From cb50d7fbe9ca68d0a6c5fa3953ecc2b5f9875922 Mon Sep 17 00:00:00 2001 From: Luohao Wang Date: Sat, 31 May 2025 17:49:14 +0800 Subject: [PATCH 01/31] [Doc] Adds Chinese README translation and updates links --- README.md | 4 +--- README_zh.md | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 3 deletions(-) create mode 100644 README_zh.md diff --git a/README.md b/README.md index c8a20247..12bcbb11 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,11 @@
OpFlow banner -

HomePage | Document

+

HomePage | Document | 中文介绍

[![Latest Release](https://img.shields.io/github/v/release/OpFlow-dev/OpFlow?color=blue&label=Latest%20Release)](https://github.com/OpFlow-dev/OpFlow/releases/latest) [![License](https://img.shields.io/badge/license-MPL--2.0-blue)](https://github.com/OpFlow-dev/OpFlow/blob/master/LICENSE) [![Downloads](https://img.shields.io/github/downloads/OpFlow-dev/OpFlow/total?color=blue&label=Downloads)](https://github.com/OpFlow-dev/OpFlow/releases/latest) -[![Format](https://img.shields.io/github/actions/workflow/status/OpFlow-dev/OpFlow/AutoFormat.yml?branch=master?color=green&label=Format)](https://github.com/OpFlow-dev/OpFlow/actions/workflows/AutoFormat.yml) -[![Build](https://img.shields.io/github/actions/workflow/status/OpFlow-dev/OpFlow/Build.yml?branch=master?color=green&label=Build)](https://github.com/OpFlow-dev/OpFlow/actions/workflows/Build.yml) ## Overview diff --git a/README_zh.md b/README_zh.md new file mode 100644 index 00000000..7b3f1501 --- /dev/null +++ b/README_zh.md @@ -0,0 +1,56 @@ +
+ OpFlow banner +

主页 | 文档 | English

+
+ +[![最新版本](https://img.shields.io/github/v/release/OpFlow-dev/OpFlow?color=blue&label=Latest%20Release)](https://github.com/OpFlow-dev/OpFlow/releases/latest) +[![许可证](https://img.shields.io/badge/license-MPL--2.0-blue)](https://github.com/OpFlow-dev/OpFlow/blob/master/LICENSE) +[![下载次数](https://img.shields.io/github/downloads/OpFlow-dev/OpFlow/total?color=blue&label=Downloads)](https://github.com/OpFlow-dev/OpFlow/releases/latest) + +## 概述 + +**OpFlow** (运筹) 是一个面向偏微分方程(PDE)求解器开发的嵌入式领域特定语言(EDSL)。它深度应用现代C++元编程技术,提供富有表现力的前端接口。通过**表达式模板**和**模板元编程**技术,OpFlow支持**显式**表达式求值与**隐式**线性系统求解。通过解耦表达式、算子及求值引擎的实现,OpFlow实现了算法、数据结构与执行调度的完全分离。其核心优势包括: + +- **完全静态**:关键路径零动态调度开销 +- **零成本抽象**:所有操作在编译期明确定义并强制内联 +- **自动并行化**:基于用户定义策略自动并行化表达式分区与求值 +- **隐式方程求解**:支持任意定义良好的隐式方程求解 +- **仅头文件 & 原生C++嵌入**:纯头文件实现,与C++生态无缝集成 +- **数学化API设计**:前端接口高度贴近数学表示法,最小化语言噪声 +- **精准抽象层级**:在避免底层编码的同时,保持所有转换操作在前端可见,离散化过程直观透明 + +## 示例 +[](examples/CONV1D/CONV1D.cpp) +[](examples/FTCS2D/FTCS-OMP.cpp) +[](examples/LidDriven/LidDriven2D.cpp) +[](examples/LevelSet/AMRLS.cpp) + +## 快速开始 + +0. 安装依赖: + +- Linux:(以Ubuntu为例) +```bash +sudo apt install -y gcc-10 g++-10 +``` +- macOS:(使用Homebrew) +```bash +brew install gcc +``` +1. 配置项目: +```bash +mkdir build && cd build && cmake -DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10 -DOPFLOW_BUILD_EXAMPLES=ON .. +``` +2. 构建与运行: +```bash +cmake --build . -t CONV1D && ./examples/CONV1D/CONV1D +``` + +## 安装 + +完整安装指南请参阅文档。 + +## 致谢 +特别感谢JetBrains提供免费的[开源开发许可证](https://jb.gg/OpenSourceSupport)支持OpFlow开发。CLion是优秀的跨平台C/C++ IDE,强烈推荐用于OpFlow开发。 + +JetBrains Logo (Main) logo. From 1004c613d2fc27af01ee080ad50ea8d82e92fa16 Mon Sep 17 00:00:00 2001 From: Luohao Wang Date: Sat, 31 May 2025 18:04:15 +0800 Subject: [PATCH 02/31] [Core] Remove dependence on fmtlib --- CMakeLists.txt | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e766ec80..d80e6e8e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -184,20 +184,6 @@ if (NOT c++20support) endif () target_compile_options(opflow INTERFACE -std=c++20) -# ---------------------------------------------------------------------------- -# Use fmt package -# ---------------------------------------------------------------------------- -if (OPFLOW_INSTALL) - # Build, install & link to the installed libfmt - include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/FMTConfig.cmake) - CONFIG_AND_INSTALL_FMT() - find_package(fmt REQUIRED PATHS ${CMAKE_INSTALL_PREFIX} NO_DEFAULT_PATH) -else () - # Add the bundled fmt library as a subproject - add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/external/fmt EXCLUDE_FROM_ALL) -endif () -target_link_libraries(opflow INTERFACE fmt::fmt) - # ---------------------------------------------------------------------------- # Use spdlog package # ---------------------------------------------------------------------------- @@ -207,7 +193,6 @@ if (OPFLOW_INSTALL) CONFIG_AND_INSTALL_SPDLOG() find_package(spdlog REQUIRED PATHS ${CMAKE_INSTALL_PREFIX} NO_DEFAULT_PATH) else () - set(SPDLOG_FMT_EXTERNAL ON) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/external/spdlog EXCLUDE_FROM_ALL) endif () target_link_libraries(opflow INTERFACE spdlog::spdlog) From f553771babcf217580e701a3f99dda2775b2a632 Mon Sep 17 00:00:00 2001 From: Luohao Wang Date: Sat, 31 May 2025 18:04:33 +0800 Subject: [PATCH 03/31] [Ext] Update HYPRE to v2.33.0 --- .gitignore | 3 +- cmake/HYPREConfig.cmake | 8 +- external/hypre/.gitignore | 74 + external/hypre/.readthedocs.yml | 29 + external/hypre/AUTOTEST/README.txt | 96 +- external/hypre/AUTOTEST/basic.sh | 4 +- external/hypre/AUTOTEST/check-case.sh | 4 +- external/hypre/AUTOTEST/check-double.sh | 7 +- external/hypre/AUTOTEST/check-glob-symb.sh | 4 +- external/hypre/AUTOTEST/check-headers.filters | 1 + external/hypre/AUTOTEST/check-headers.sh | 4 +- external/hypre/AUTOTEST/check-int.filters | 4 +- external/hypre/AUTOTEST/check-int.sh | 5 +- external/hypre/AUTOTEST/check-license.filters | 3 +- external/hypre/AUTOTEST/check-license.sh | 12 +- external/hypre/AUTOTEST/check-mem.sh | 10 +- external/hypre/AUTOTEST/check-mpi.sh | 5 +- external/hypre/AUTOTEST/cleantest.sh | 4 +- external/hypre/AUTOTEST/cmake.bat | 2 +- external/hypre/AUTOTEST/cmake.filters | 3 + external/hypre/AUTOTEST/cmake.sh | 54 +- external/hypre/AUTOTEST/configure.filters | 2 + external/hypre/AUTOTEST/configure.sh | 4 +- external/hypre/AUTOTEST/docs.sh | 4 +- external/hypre/AUTOTEST/examples.sh | 6 +- external/hypre/AUTOTEST/klocwork.sh | 4 +- external/hypre/AUTOTEST/link.sh | 4 +- external/hypre/AUTOTEST/machine-aurora.sh | 101 + .../hypre/AUTOTEST/machine-lassen-cuda.sh | 148 + .../hypre/AUTOTEST/machine-lassen-exlibs.sh | 92 + external/hypre/AUTOTEST/machine-lassen.sh | 108 +- external/hypre/AUTOTEST/machine-mac.sh | 38 +- external/hypre/AUTOTEST/machine-ray.sh | 118 - ...{machine-rztopaz.sh => machine-rzhound.sh} | 8 +- external/hypre/AUTOTEST/machine-syrah.sh | 4 +- external/hypre/AUTOTEST/machine-tioga.sh | 100 + .../hypre/AUTOTEST/machine-tux-compilers.sh | 4 +- external/hypre/AUTOTEST/machine-tux-exlibs.sh | 4 +- external/hypre/AUTOTEST/machine-tux-spack.sh | 18 +- external/hypre/AUTOTEST/machine-tux.sh | 23 +- external/hypre/AUTOTEST/machine-vs-pro.bat | 2 +- external/hypre/AUTOTEST/make.sh | 4 +- external/hypre/AUTOTEST/renametest.sh | 4 +- external/hypre/AUTOTEST/run.sh | 4 +- external/hypre/AUTOTEST/runtests-error | 1 + external/hypre/AUTOTEST/runtests-gpumemcheck | 2 + external/hypre/AUTOTEST/runtests-ij-gpu | 3 +- external/hypre/AUTOTEST/runtests-ij-noilu | 3 + external/hypre/AUTOTEST/runtests-struct | 3 +- external/hypre/AUTOTEST/test.sh | 4 +- external/hypre/CHANGELOG | 145 +- external/hypre/INSTALL.md | 22 +- external/hypre/LICENSE-MIT | 2 +- external/hypre/README.md | 10 +- external/hypre/SUPPORT.md | 7 +- external/hypre/src/CMakeLists.txt | 754 +- external/hypre/src/FEI_mv/CMakeLists.txt | 8 +- external/hypre/src/FEI_mv/fei-hypre/CHANGELOG | 2 +- .../hypre/src/FEI_mv/fei-hypre/CMakeLists.txt | 8 +- .../src/FEI_mv/fei-hypre/FEI_HYPRE_Impl.cxx | 2 +- .../src/FEI_mv/fei-hypre/FEI_HYPRE_Impl.h | 2 +- .../src/FEI_mv/fei-hypre/FEI_HYPRE_include.h | 2 +- .../src/FEI_mv/fei-hypre/HYPRE_Builder.h | 2 +- .../hypre/src/FEI_mv/fei-hypre/HYPRE_FEI.doc | 4 +- .../hypre/src/FEI_mv/fei-hypre/HYPRE_FEI.h | 2 +- .../src/FEI_mv/fei-hypre/HYPRE_FEI_includes.h | 2 +- .../src/FEI_mv/fei-hypre/HYPRE_LSC_aux.cxx | 2 +- .../src/FEI_mv/fei-hypre/HYPRE_LSI_Dsuperlu.c | 260 +- .../src/FEI_mv/fei-hypre/HYPRE_LSI_Dsuperlu.h | 2 +- .../src/FEI_mv/fei-hypre/HYPRE_LSI_UZAWA.cxx | 2 +- .../src/FEI_mv/fei-hypre/HYPRE_LSI_UZAWA.h | 2 +- .../src/FEI_mv/fei-hypre/HYPRE_LSI_Uzawa_c.h | 2 +- .../FEI_mv/fei-hypre/HYPRE_LSI_blkprec.cxx | 2 +- .../src/FEI_mv/fei-hypre/HYPRE_LSI_blkprec.h | 2 +- .../src/FEI_mv/fei-hypre/HYPRE_LSI_block.h | 2 +- .../src/FEI_mv/fei-hypre/HYPRE_LSI_ddict.c | 2 +- .../src/FEI_mv/fei-hypre/HYPRE_LSI_ddict.h | 2 +- .../src/FEI_mv/fei-hypre/HYPRE_LSI_ddilut.c | 2 +- .../src/FEI_mv/fei-hypre/HYPRE_LSI_ddilut.h | 2 +- .../hypre/src/FEI_mv/fei-hypre/HYPRE_LSI_ml.c | 2 +- .../src/FEI_mv/fei-hypre/HYPRE_LSI_mli.cxx | 2 +- .../src/FEI_mv/fei-hypre/HYPRE_LSI_mli.h | 2 +- .../FEI_mv/fei-hypre/HYPRE_LSI_mlmaxwell.c | 2 +- .../src/FEI_mv/fei-hypre/HYPRE_LSI_poly.c | 2 +- .../src/FEI_mv/fei-hypre/HYPRE_LSI_poly.h | 2 +- .../src/FEI_mv/fei-hypre/HYPRE_LSI_schur.cxx | 2 +- .../src/FEI_mv/fei-hypre/HYPRE_LSI_schur.h | 2 +- .../src/FEI_mv/fei-hypre/HYPRE_LSI_schwarz.c | 2 +- .../src/FEI_mv/fei-hypre/HYPRE_LSI_schwarz.h | 2 +- .../src/FEI_mv/fei-hypre/HYPRE_LinSysCore.cxx | 3 +- .../src/FEI_mv/fei-hypre/HYPRE_LinSysCore.h | 2 +- .../src/FEI_mv/fei-hypre/HYPRE_MHMatrix.h | 2 +- .../src/FEI_mv/fei-hypre/HYPRE_MLMatrix.h | 2 +- .../src/FEI_mv/fei-hypre/HYPRE_MLMaxwell.h | 2 +- .../FEI_mv/fei-hypre/HYPRE_SlideReduction.cxx | 2 +- .../FEI_mv/fei-hypre/HYPRE_SlideReduction.h | 2 +- .../src/FEI_mv/fei-hypre/HYPRE_fei_matrix.cxx | 2 +- .../src/FEI_mv/fei-hypre/HYPRE_fei_mesh.cxx | 2 +- .../hypre/src/FEI_mv/fei-hypre/HYPRE_fei_mv.h | 2 +- .../src/FEI_mv/fei-hypre/HYPRE_fei_vector.cxx | 2 +- .../src/FEI_mv/fei-hypre/HYPRE_parcsr_TFQmr.c | 2 +- .../src/FEI_mv/fei-hypre/HYPRE_parcsr_TFQmr.h | 2 +- .../src/FEI_mv/fei-hypre/HYPRE_parcsr_bicgs.c | 2 +- .../src/FEI_mv/fei-hypre/HYPRE_parcsr_bicgs.h | 2 +- .../FEI_mv/fei-hypre/HYPRE_parcsr_bicgstabl.c | 2 +- .../FEI_mv/fei-hypre/HYPRE_parcsr_bicgstabl.h | 2 +- .../FEI_mv/fei-hypre/HYPRE_parcsr_fgmres.c | 2 +- .../FEI_mv/fei-hypre/HYPRE_parcsr_fgmres.h | 2 +- .../src/FEI_mv/fei-hypre/HYPRE_parcsr_lsicg.c | 2 +- .../src/FEI_mv/fei-hypre/HYPRE_parcsr_lsicg.h | 2 +- .../FEI_mv/fei-hypre/HYPRE_parcsr_maxwell.c | 2 +- .../FEI_mv/fei-hypre/HYPRE_parcsr_superlu.c | 2 +- .../FEI_mv/fei-hypre/HYPRE_parcsr_superlu.h | 2 +- .../FEI_mv/fei-hypre/HYPRE_parcsr_symqmr.c | 2 +- .../FEI_mv/fei-hypre/HYPRE_parcsr_symqmr.h | 2 +- .../hypre/src/FEI_mv/fei-hypre/LLNL_FEI.doc | 2 +- .../src/FEI_mv/fei-hypre/LLNL_FEI_Fei.cxx | 2 +- .../hypre/src/FEI_mv/fei-hypre/LLNL_FEI_Fei.h | 2 +- .../src/FEI_mv/fei-hypre/LLNL_FEI_Impl.cxx | 2 +- .../src/FEI_mv/fei-hypre/LLNL_FEI_Impl.h | 2 +- .../src/FEI_mv/fei-hypre/LLNL_FEI_LSCore.cxx | 2 +- .../src/FEI_mv/fei-hypre/LLNL_FEI_LSCore.h | 2 +- .../src/FEI_mv/fei-hypre/LLNL_FEI_Matrix.cxx | 2 +- .../src/FEI_mv/fei-hypre/LLNL_FEI_Matrix.h | 2 +- .../src/FEI_mv/fei-hypre/LLNL_FEI_Solver.cxx | 2 +- .../src/FEI_mv/fei-hypre/LLNL_FEI_Solver.h | 2 +- external/hypre/src/FEI_mv/fei-hypre/SymQMR.c | 2 +- external/hypre/src/FEI_mv/fei-hypre/TFQmr.c | 2 +- .../hypre/src/FEI_mv/fei-hypre/_hypre_FEI.h | 2 +- external/hypre/src/FEI_mv/fei-hypre/bicgs.c | 2 +- .../hypre/src/FEI_mv/fei-hypre/bicgstabl.c | 2 +- .../hypre/src/FEI_mv/fei-hypre/cfei-hypre.h | 2 +- .../hypre/src/FEI_mv/fei-hypre/cfei_hypre.cxx | 2 +- .../hypre/src/FEI_mv/fei-hypre/cfei_hypre.h | 2 +- external/hypre/src/FEI_mv/fei-hypre/driver.C | 2 +- .../hypre/src/FEI_mv/fei-hypre/driver.cxx | 2 +- external/hypre/src/FEI_mv/fei-hypre/fei_mv.h | 2 +- external/hypre/src/FEI_mv/fei-hypre/fgmres.c | 2 +- .../hypre/src/FEI_mv/fei-hypre/hypre_cfei.cxx | 2 +- .../hypre/src/FEI_mv/fei-hypre/hypre_cfei.h | 2 +- .../src/FEI_mv/fei-hypre/hypre_lsi_amge.c | 2 +- .../src/FEI_mv/fei-hypre/hypre_lsi_ddamg.c | 2 +- .../src/FEI_mv/fei-hypre/hypre_lsi_misc.c | 2 +- .../FEI_mv/fei-hypre/hypre_schur_reduce.cxx | 2 +- .../FEI_mv/fei-hypre/hypre_slide_reduce.cxx | 2 +- external/hypre/src/FEI_mv/fei-hypre/lsicg.c | 2 +- .../hypre/src/FEI_mv/fei-hypre/ml_maxwell.cxx | 2 +- .../hypre/src/FEI_mv/femli/CMakeLists.txt | 2 +- external/hypre/src/FEI_mv/femli/Usage_amgs | 2 +- external/hypre/src/FEI_mv/femli/Usage_solver | 2 +- external/hypre/src/FEI_mv/femli/cmli.cxx | 2 +- external/hypre/src/FEI_mv/femli/cmli.h | 2 +- .../hypre/src/FEI_mv/femli/driver_fedata.cxx | 2 +- .../hypre/src/FEI_mv/femli/driver_matrix.cxx | 2 +- external/hypre/src/FEI_mv/femli/driver_util.c | 2 +- external/hypre/src/FEI_mv/femli/genTecPlot.c | 2 +- external/hypre/src/FEI_mv/femli/mli.cxx | 2 +- external/hypre/src/FEI_mv/femli/mli.h | 2 +- .../src/FEI_mv/femli/mli_amgsa_calib.cxx | 2 +- .../src/FEI_mv/femli/mli_amgsa_coarsen1.cxx | 2 +- .../src/FEI_mv/femli/mli_amgsa_dd_fedata.cxx | 2 +- .../src/FEI_mv/femli/mli_amgsa_dd_sfei.cxx | 2 +- .../hypre/src/FEI_mv/femli/mli_amgsa_elem.cxx | 2 +- external/hypre/src/FEI_mv/femli/mli_defs.h | 2 +- .../hypre/src/FEI_mv/femli/mli_febase.cxx | 2 +- external/hypre/src/FEI_mv/femli/mli_febase.h | 2 +- .../hypre/src/FEI_mv/femli/mli_fedata.cxx | 2 +- external/hypre/src/FEI_mv/femli/mli_fedata.h | 2 +- .../src/FEI_mv/femli/mli_fedata_utils.cxx | 2 +- .../hypre/src/FEI_mv/femli/mli_fedata_utils.h | 2 +- .../hypre/src/FEI_mv/femli/mli_festruct.h | 2 +- .../hypre/src/FEI_mv/femli/mli_mapper.cxx | 2 +- external/hypre/src/FEI_mv/femli/mli_mapper.h | 2 +- .../hypre/src/FEI_mv/femli/mli_matrix.cxx | 2 +- external/hypre/src/FEI_mv/femli/mli_matrix.h | 2 +- .../hypre/src/FEI_mv/femli/mli_matrix_misc.h | 2 +- .../src/FEI_mv/femli/mli_matrix_mult.cxx | 2 +- .../src/FEI_mv/femli/mli_matrix_utils.cxx | 2 +- .../hypre/src/FEI_mv/femli/mli_method.cxx | 2 +- external/hypre/src/FEI_mv/femli/mli_method.h | 2 +- .../src/FEI_mv/femli/mli_method_amgcr.cxx | 2 +- .../hypre/src/FEI_mv/femli/mli_method_amgcr.h | 2 +- .../src/FEI_mv/femli/mli_method_amgrs.cxx | 2 +- .../hypre/src/FEI_mv/femli/mli_method_amgrs.h | 2 +- .../src/FEI_mv/femli/mli_method_amgsa.cxx | 2 +- .../hypre/src/FEI_mv/femli/mli_method_amgsa.h | 2 +- external/hypre/src/FEI_mv/femli/mli_olapdd.c | 2 +- .../hypre/src/FEI_mv/femli/mli_oneLevel.cxx | 2 +- .../hypre/src/FEI_mv/femli/mli_oneLevel.h | 2 +- external/hypre/src/FEI_mv/femli/mli_sfei.cxx | 2 +- external/hypre/src/FEI_mv/femli/mli_sfei.h | 2 +- .../hypre/src/FEI_mv/femli/mli_solver.cxx | 2 +- external/hypre/src/FEI_mv/femli/mli_solver.h | 2 +- .../hypre/src/FEI_mv/femli/mli_solver_amg.cxx | 2 +- .../hypre/src/FEI_mv/femli/mli_solver_amg.h | 2 +- .../FEI_mv/femli/mli_solver_arpacksuperlu.cxx | 2 +- .../FEI_mv/femli/mli_solver_arpacksuperlu.h | 2 +- .../src/FEI_mv/femli/mli_solver_bjacobi.cxx | 2 +- .../src/FEI_mv/femli/mli_solver_bjacobi.h | 2 +- .../src/FEI_mv/femli/mli_solver_bsgs.cxx | 2 +- .../hypre/src/FEI_mv/femli/mli_solver_bsgs.h | 2 +- .../hypre/src/FEI_mv/femli/mli_solver_cg.cxx | 2 +- .../hypre/src/FEI_mv/femli/mli_solver_cg.h | 2 +- .../src/FEI_mv/femli/mli_solver_chebyshev.cxx | 2 +- .../src/FEI_mv/femli/mli_solver_chebyshev.h | 2 +- .../src/FEI_mv/femli/mli_solver_gmres.cxx | 2 +- .../hypre/src/FEI_mv/femli/mli_solver_gmres.h | 2 +- .../hypre/src/FEI_mv/femli/mli_solver_gs.cxx | 2 +- .../hypre/src/FEI_mv/femli/mli_solver_gs.h | 2 +- .../src/FEI_mv/femli/mli_solver_hschwarz.cxx | 2 +- .../src/FEI_mv/femli/mli_solver_hschwarz.h | 2 +- .../src/FEI_mv/femli/mli_solver_hsgs.cxx | 2 +- .../hypre/src/FEI_mv/femli/mli_solver_hsgs.h | 2 +- .../src/FEI_mv/femli/mli_solver_jacobi.cxx | 2 +- .../src/FEI_mv/femli/mli_solver_jacobi.h | 2 +- .../src/FEI_mv/femli/mli_solver_kaczmarz.cxx | 2 +- .../src/FEI_mv/femli/mli_solver_kaczmarz.h | 2 +- .../hypre/src/FEI_mv/femli/mli_solver_mli.cxx | 2 +- .../hypre/src/FEI_mv/femli/mli_solver_mli.h | 2 +- .../hypre/src/FEI_mv/femli/mli_solver_mls.cxx | 2 +- .../hypre/src/FEI_mv/femli/mli_solver_mls.h | 2 +- .../src/FEI_mv/femli/mli_solver_parasails.cxx | 2 +- .../src/FEI_mv/femli/mli_solver_parasails.h | 2 +- .../FEI_mv/femli/mli_solver_seqsuperlu.cxx | 2 +- .../src/FEI_mv/femli/mli_solver_seqsuperlu.h | 2 +- .../hypre/src/FEI_mv/femli/mli_solver_sgs.cxx | 2 +- .../hypre/src/FEI_mv/femli/mli_solver_sgs.h | 2 +- .../src/FEI_mv/femli/mli_solver_superlu.cxx | 2 +- .../src/FEI_mv/femli/mli_solver_superlu.h | 2 +- external/hypre/src/FEI_mv/femli/mli_utils.c | 2 +- external/hypre/src/FEI_mv/femli/mli_utils.h | 2 +- .../src/FEI_mv/femli/mli_utils_fortran.f | 2 +- .../hypre/src/FEI_mv/femli/mli_vector.cxx | 2 +- external/hypre/src/FEI_mv/femli/mli_vector.h | 2 +- external/hypre/src/HYPRE.h | 2 +- external/hypre/src/HYPREf.h | 11 +- external/hypre/src/IJ_mv/CMakeLists.txt | 10 +- external/hypre/src/IJ_mv/F90_HYPRE_IJMatrix.c | 360 +- external/hypre/src/IJ_mv/F90_HYPRE_IJVector.c | 244 +- external/hypre/src/IJ_mv/F90_IJMatrix.c | 18 +- external/hypre/src/IJ_mv/HYPRE_IJMatrix.c | 554 +- external/hypre/src/IJ_mv/HYPRE_IJVector.c | 379 +- external/hypre/src/IJ_mv/HYPRE_IJ_mv.h | 239 +- external/hypre/src/IJ_mv/IJMatrix.c | 448 +- external/hypre/src/IJ_mv/IJMatrix_isis.c | 706 +- external/hypre/src/IJ_mv/IJMatrix_parcsr.c | 1135 +- .../hypre/src/IJ_mv/IJMatrix_parcsr_device.c | 907 +- external/hypre/src/IJ_mv/IJMatrix_petsc.c | 640 +- external/hypre/src/IJ_mv/IJVector.c | 183 +- external/hypre/src/IJ_mv/IJVector_parcsr.c | 444 +- .../hypre/src/IJ_mv/IJVector_parcsr_device.c | 623 +- external/hypre/src/IJ_mv/IJ_assumed_part.c | 31 +- external/hypre/src/IJ_mv/IJ_matrix.h | 4 +- external/hypre/src/IJ_mv/IJ_vector.h | 16 +- external/hypre/src/IJ_mv/_hypre_IJ_mv.h | 323 +- external/hypre/src/IJ_mv/aux_par_vector.c | 86 +- external/hypre/src/IJ_mv/aux_par_vector.h | 8 +- external/hypre/src/IJ_mv/aux_parcsr_matrix.c | 29 +- external/hypre/src/IJ_mv/aux_parcsr_matrix.h | 14 +- external/hypre/src/IJ_mv/headers | 4 +- external/hypre/src/IJ_mv/protos.h | 281 +- external/hypre/src/blas/CMakeLists.txt | 2 +- external/hypre/src/blas/README | 6 +- external/hypre/src/blas/_hypre_blas.h | 28 +- external/hypre/src/blas/dasum.c | 22 +- external/hypre/src/blas/daxpy.c | 20 +- external/hypre/src/blas/dcopy.c | 2 +- external/hypre/src/blas/ddot.c | 8 +- external/hypre/src/blas/dgemm.c | 336 +- external/hypre/src/blas/dgemv.c | 166 +- external/hypre/src/blas/dger.c | 118 +- external/hypre/src/blas/dnrm2.c | 20 +- external/hypre/src/blas/drot.c | 6 +- external/hypre/src/blas/dscal.c | 20 +- external/hypre/src/blas/dswap.c | 20 +- external/hypre/src/blas/dsymm.c | 216 +- external/hypre/src/blas/dsymv.c | 164 +- external/hypre/src/blas/dsyr2.c | 174 +- external/hypre/src/blas/dsyr2k.c | 220 +- external/hypre/src/blas/dsyrk.c | 300 +- external/hypre/src/blas/dtrmm.c | 184 +- external/hypre/src/blas/dtrmv.c | 150 +- external/hypre/src/blas/dtrsm.c | 272 +- external/hypre/src/blas/dtrsv.c | 168 +- external/hypre/src/blas/f2c.h | 32 +- external/hypre/src/blas/hypre_blas.h | 2 +- external/hypre/src/blas/idamax.c | 16 +- external/hypre/src/blas/xerbla.c | 6 +- external/hypre/src/cmbuild/README.txt | 1 - .../hypre/src/config/HYPREConfig.cmake.in | 204 +- .../hypre/src/config/HYPRE_config.h.cmake.in | 84 +- external/hypre/src/config/HYPRE_config.h.in | 68 +- external/hypre/src/config/Makefile.config.in | 19 +- external/hypre/src/config/astyle-apply.sh | 79 + external/hypre/src/config/astylerc | 26 + .../config/cmake/HYPRE_CMakeUtilities.cmake | 571 +- .../config/cmake/HYPRE_SetupCUDAToolkit.cmake | 316 +- .../config/cmake/HYPRE_SetupGPUToolkit.cmake | 91 + .../config/cmake/HYPRE_SetupHIPToolkit.cmake | 211 + .../config/cmake/HYPRE_SetupSYCLToolkit.cmake | 104 + external/hypre/src/config/config.guess | 1660 +- external/hypre/src/config/config.sub | 2676 +- external/hypre/src/config/configure.in | 967 +- external/hypre/src/config/githooks/README.md | 19 + external/hypre/src/config/githooks/pre-commit | 9 + .../hypre/src/config/hypre_blas_macros.m4 | 2 +- .../hypre/src/config/hypre_lapack_macros.m4 | 2 +- .../hypre/src/config/hypre_macros_misc.m4 | 120 +- external/hypre/src/config/install-sh | 2 +- external/hypre/src/config/mkinstalldirs | 2 +- external/hypre/src/config/update-cmake.py | 115 + external/hypre/src/config/update-cmake.sh | 19 + external/hypre/src/config/update.sh | 7 +- external/hypre/src/config/version.sh | 8 +- external/hypre/src/configure | 6795 ++++-- .../hypre/src/distributed_ls/CMakeLists.txt | 2 +- .../src/distributed_ls/Euclid/CMakeLists.txt | 2 +- .../src/distributed_ls/Euclid/Euclid_apply.c | 2 +- .../src/distributed_ls/Euclid/Euclid_dh.c | 2 +- .../src/distributed_ls/Euclid/Euclid_dh.h | 2 +- .../distributed_ls/Euclid/ExternalRows_dh.c | 48 +- .../distributed_ls/Euclid/ExternalRows_dh.h | 2 +- .../src/distributed_ls/Euclid/Factor_dh.c | 125 +- .../src/distributed_ls/Euclid/Factor_dh.h | 2 +- .../hypre/src/distributed_ls/Euclid/Hash_dh.c | 4 +- .../hypre/src/distributed_ls/Euclid/Hash_dh.h | 2 +- .../src/distributed_ls/Euclid/Hash_i_dh.c | 4 +- .../src/distributed_ls/Euclid/Hash_i_dh.h | 2 +- .../src/distributed_ls/Euclid/MatGenFD.c | 84 +- .../src/distributed_ls/Euclid/MatGenFD.h | 2 +- .../hypre/src/distributed_ls/Euclid/Mat_dh.c | 165 +- .../hypre/src/distributed_ls/Euclid/Mat_dh.h | 2 +- .../hypre/src/distributed_ls/Euclid/Mem_dh.c | 16 +- .../hypre/src/distributed_ls/Euclid/Mem_dh.h | 2 +- .../src/distributed_ls/Euclid/Numbering_dh.c | 4 +- .../src/distributed_ls/Euclid/Numbering_dh.h | 2 +- .../src/distributed_ls/Euclid/Parser_dh.c | 4 +- .../src/distributed_ls/Euclid/Parser_dh.h | 2 +- .../src/distributed_ls/Euclid/README.hypre | 2 +- .../src/distributed_ls/Euclid/SortedList_dh.c | 4 +- .../src/distributed_ls/Euclid/SortedList_dh.h | 2 +- .../src/distributed_ls/Euclid/SortedSet_dh.c | 2 +- .../src/distributed_ls/Euclid/SortedSet_dh.h | 2 +- .../distributed_ls/Euclid/SubdomainGraph_dh.c | 20 +- .../distributed_ls/Euclid/SubdomainGraph_dh.h | 2 +- .../src/distributed_ls/Euclid/TimeLog_dh.c | 2 +- .../src/distributed_ls/Euclid/TimeLog_dh.h | 2 +- .../src/distributed_ls/Euclid/Timer_dh.c | 20 +- .../src/distributed_ls/Euclid/Timer_dh.h | 2 +- .../hypre/src/distributed_ls/Euclid/Vec_dh.c | 10 +- .../hypre/src/distributed_ls/Euclid/Vec_dh.h | 2 +- .../src/distributed_ls/Euclid/_hypre_Euclid.h | 71 +- .../hypre/src/distributed_ls/Euclid/blas_dh.c | 4 +- .../hypre/src/distributed_ls/Euclid/blas_dh.h | 2 +- .../src/distributed_ls/Euclid/euclid_common.h | 8 +- .../src/distributed_ls/Euclid/euclid_config.h | 2 +- .../src/distributed_ls/Euclid/getRow_dh.c | 53 +- .../src/distributed_ls/Euclid/getRow_dh.h | 2 +- .../src/distributed_ls/Euclid/globalObjects.c | 16 +- .../src/distributed_ls/Euclid/guards_dh.h | 2 +- .../hypre/src/distributed_ls/Euclid/headers | 4 +- .../hypre/src/distributed_ls/Euclid/ilu_dh.h | 2 +- .../src/distributed_ls/Euclid/ilu_mpi_bj.c | 54 +- .../src/distributed_ls/Euclid/ilu_mpi_pilu.c | 4 +- .../hypre/src/distributed_ls/Euclid/ilu_seq.c | 134 +- .../hypre/src/distributed_ls/Euclid/io_dh.c | 40 +- .../hypre/src/distributed_ls/Euclid/io_dh.h | 8 +- .../src/distributed_ls/Euclid/krylov_dh.c | 18 +- .../src/distributed_ls/Euclid/krylov_dh.h | 2 +- .../src/distributed_ls/Euclid/macros_dh.h | 9 +- .../distributed_ls/Euclid/mat_dh_private.c | 10 +- .../distributed_ls/Euclid/mat_dh_private.h | 2 +- .../src/distributed_ls/Euclid/shellSort_dh.c | 2 +- .../src/distributed_ls/Euclid/shellSort_dh.h | 2 +- .../hypre/src/distributed_ls/Euclid/sig_dh.c | 6 +- .../hypre/src/distributed_ls/Euclid/sig_dh.h | 2 +- .../distributed_ls/ParaSails/CMakeLists.txt | 2 +- .../src/distributed_ls/ParaSails/Common.h | 2 +- .../src/distributed_ls/ParaSails/ConjGrad.c | 6 +- .../src/distributed_ls/ParaSails/ConjGrad.h | 2 +- .../src/distributed_ls/ParaSails/DiagScale.c | 4 +- .../src/distributed_ls/ParaSails/DiagScale.h | 2 +- .../src/distributed_ls/ParaSails/FGmres.c | 12 +- .../hypre/src/distributed_ls/ParaSails/Hash.c | 2 +- .../hypre/src/distributed_ls/ParaSails/Hash.h | 2 +- .../src/distributed_ls/ParaSails/LoadBal.c | 2 +- .../src/distributed_ls/ParaSails/LoadBal.h | 2 +- .../src/distributed_ls/ParaSails/Matrix.c | 12 +- .../src/distributed_ls/ParaSails/Matrix.h | 2 +- .../hypre/src/distributed_ls/ParaSails/Mem.c | 4 +- .../hypre/src/distributed_ls/ParaSails/Mem.h | 4 +- .../src/distributed_ls/ParaSails/Numbering.c | 2 +- .../src/distributed_ls/ParaSails/Numbering.h | 2 +- .../src/distributed_ls/ParaSails/OrderStat.c | 2 +- .../src/distributed_ls/ParaSails/OrderStat.h | 2 +- .../src/distributed_ls/ParaSails/ParaSails.c | 132 +- .../src/distributed_ls/ParaSails/ParaSails.h | 10 +- .../src/distributed_ls/ParaSails/PrunedRows.c | 2 +- .../src/distributed_ls/ParaSails/PrunedRows.h | 2 +- .../src/distributed_ls/ParaSails/RowPatt.c | 2 +- .../src/distributed_ls/ParaSails/RowPatt.h | 2 +- .../src/distributed_ls/ParaSails/StoredRows.c | 2 +- .../src/distributed_ls/ParaSails/StoredRows.h | 2 +- .../src/distributed_ls/ParaSails/convert.c | 2 +- .../ParaSails/hypre_ParaSails.c | 29 +- .../ParaSails/hypre_ParaSails.h | 2 +- .../src/distributed_ls/ParaSails/permute.c | 2 +- .../src/distributed_ls/pilut/CMakeLists.txt | 2 +- .../pilut/DistributedMatrixPilutSolver.h | 4 +- .../HYPRE_DistributedMatrixPilutSolver.c | 81 +- ...YPRE_DistributedMatrixPilutSolver_protos.h | 2 +- ...HYPRE_DistributedMatrixPilutSolver_types.h | 2 +- .../hypre/src/distributed_ls/pilut/comm.c | 2 +- .../hypre/src/distributed_ls/pilut/const.h | 2 +- .../hypre/src/distributed_ls/pilut/debug.c | 2 +- .../distributed_ls/pilut/distributed_qsort.c | 2 +- .../pilut/distributed_qsort_si.c | 2 +- external/hypre/src/distributed_ls/pilut/ilu.h | 4 +- .../hypre/src/distributed_ls/pilut/ilut.c | 16 +- .../distributed_ls/pilut/internal_protos.h | 2 +- .../hypre/src/distributed_ls/pilut/macros.h | 11 +- .../hypre/src/distributed_ls/pilut/parilut.c | 50 +- .../hypre/src/distributed_ls/pilut/parutil.c | 6 +- .../hypre/src/distributed_ls/pilut/pblas1.c | 10 +- .../hypre/src/distributed_ls/pilut/serilut.c | 126 +- .../hypre/src/distributed_ls/pilut/struct.h | 31 +- .../src/distributed_ls/pilut/trifactor.c | 2 +- .../hypre/src/distributed_ls/pilut/util.c | 10 +- .../src/distributed_matrix/CMakeLists.txt | 2 +- .../HYPRE_distributed_matrix.c | 2 +- .../HYPRE_distributed_matrix_mv.h | 2 +- .../HYPRE_distributed_matrix_protos.h | 2 +- .../HYPRE_distributed_matrix_types.h | 2 +- .../distributed_matrix/distributed_matrix.c | 2 +- .../distributed_matrix/distributed_matrix.h | 2 +- .../distributed_matrix_ISIS.c | 74 +- .../distributed_matrix_ISIS.cc | 2 +- .../distributed_matrix_PETSc.c | 55 +- .../distributed_matrix_parcsr.c | 53 +- .../src/distributed_matrix/internal_protos.h | 2 +- external/hypre/src/docs/README.md | 14 +- external/hypre/src/docs/copyright.txt | 2 +- external/hypre/src/docs/hypre.bib | 2 +- .../hypre/src/docs/ref-manual/conf.doxygen | 1066 +- external/hypre/src/docs/update-release.sh | 8 +- .../src/docs/usr-manual/_static/custom.css | 13 +- .../hypre/src/docs/usr-manual/api-int-ij.rst | 2 +- .../src/docs/usr-manual/api-int-sstruct.rst | 2 +- .../src/docs/usr-manual/api-int-struct.rst | 2 +- .../src/docs/usr-manual/api-sol-eigen.rst | 2 +- .../src/docs/usr-manual/api-sol-krylov.rst | 2 +- .../src/docs/usr-manual/api-sol-parcsr.rst | 2 +- .../src/docs/usr-manual/api-sol-sstruct.rst | 2 +- .../src/docs/usr-manual/api-sol-struct.rst | 2 +- .../docs/usr-manual/bw-hypre-nwords.512.png | Bin 0 -> 20618 bytes external/hypre/src/docs/usr-manual/ch-api.rst | 18 +- external/hypre/src/docs/usr-manual/ch-fei.rst | 38 +- external/hypre/src/docs/usr-manual/ch-ij.rst | 6 +- .../hypre/src/docs/usr-manual/ch-intro.rst | 102 +- .../hypre/src/docs/usr-manual/ch-misc.rst | 771 +- .../src/docs/usr-manual/ch-references.rst | 21 +- .../hypre/src/docs/usr-manual/ch-solvers.rst | 35 +- .../hypre/src/docs/usr-manual/ch-sstruct.rst | 543 +- .../hypre/src/docs/usr-manual/ch-struct.rst | 186 +- external/hypre/src/docs/usr-manual/conf.py | 115 +- external/hypre/src/docs/usr-manual/dummy.png | Bin 0 -> 69 bytes .../src/docs/usr-manual/hypre-nwords.512.png | Bin 0 -> 18577 bytes .../hypre/src/docs/usr-manual/hypre_wiw.svg | 217 - external/hypre/src/docs/usr-manual/index.rst | 6 +- .../src/docs/usr-manual/requirements.txt | 9 +- .../hypre/src/docs/usr-manual/solvers-ads.rst | 2 +- .../hypre/src/docs/usr-manual/solvers-ams.rst | 47 +- .../src/docs/usr-manual/solvers-boomeramg.rst | 109 +- .../src/docs/usr-manual/solvers-euclid.rst | 44 +- .../hypre/src/docs/usr-manual/solvers-fac.rst | 2 +- .../hypre/src/docs/usr-manual/solvers-fei.rst | 52 +- .../src/docs/usr-manual/solvers-fsai.rst | 101 + .../src/docs/usr-manual/solvers-hybrid.rst | 17 +- .../src/docs/usr-manual/solvers-hypre-ilu.rst | 53 - .../hypre/src/docs/usr-manual/solvers-ilu.rst | 245 + .../src/docs/usr-manual/solvers-lobpcg.rst | 20 +- .../src/docs/usr-manual/solvers-maxwell.rst | 2 +- .../hypre/src/docs/usr-manual/solvers-mgr.rst | 2 +- .../hypre/src/docs/usr-manual/solvers-mli.rst | 18 +- .../src/docs/usr-manual/solvers-parasails.rst | 12 +- .../src/docs/usr-manual/solvers-pilut.rst | 30 +- .../src/docs/usr-manual/solvers-smg-pfmg.rst | 2 +- .../src/docs/usr-manual/solvers-split.rst | 25 +- external/hypre/src/examples/CMakeLists.txt | 2 +- external/hypre/src/examples/Makefile_gpu | 248 - external/hypre/src/examples/cudaf.f | 64 + external/hypre/src/examples/docs/build_doc.sh | 2 +- .../hypre/src/examples/docs/code2html.perl | 0 .../hypre/src/examples/docs/replace-ssi.perl | 0 external/hypre/src/examples/ex.h | 13 +- external/hypre/src/examples/ex1.c | 74 +- external/hypre/src/examples/ex10.cxx | 154 +- external/hypre/src/examples/ex11.c | 54 +- external/hypre/src/examples/ex12.c | 74 +- external/hypre/src/examples/ex12cuf.cuf | 492 + external/hypre/src/examples/ex12f.f | 36 +- external/hypre/src/examples/ex12f_cptr.f | 502 + external/hypre/src/examples/ex13.c | 123 +- external/hypre/src/examples/ex14.c | 115 +- external/hypre/src/examples/ex15.c | 209 +- external/hypre/src/examples/ex15big.c | 173 +- external/hypre/src/examples/ex16.c | 405 +- external/hypre/src/examples/ex17.c | 22 +- external/hypre/src/examples/ex18.c | 37 +- external/hypre/src/examples/ex18comp.c | 39 +- external/hypre/src/examples/ex2.c | 62 +- external/hypre/src/examples/ex3.c | 82 +- external/hypre/src/examples/ex4.c | 276 +- external/hypre/src/examples/ex5.c | 86 +- external/hypre/src/examples/ex5big.c | 68 +- external/hypre/src/examples/ex5cuf.cuf | 487 + external/hypre/src/examples/ex5f.f | 47 +- external/hypre/src/examples/ex5f_cptr.f | 510 + external/hypre/src/examples/ex6.c | 70 +- external/hypre/src/examples/ex7.c | 274 +- external/hypre/src/examples/ex8.c | 145 +- external/hypre/src/examples/ex9.c | 112 +- external/hypre/src/examples/vis.c | 391 +- external/hypre/src/examples/vis/README | 2 +- external/hypre/src/examples/vis/glvis-ex1.sh | 4 +- external/hypre/src/examples/vis/glvis-ex10.sh | 4 +- external/hypre/src/examples/vis/glvis-ex11.sh | 4 +- external/hypre/src/examples/vis/glvis-ex12.sh | 4 +- external/hypre/src/examples/vis/glvis-ex13.sh | 4 +- external/hypre/src/examples/vis/glvis-ex14.sh | 4 +- external/hypre/src/examples/vis/glvis-ex15.sh | 4 +- external/hypre/src/examples/vis/glvis-ex16.sh | 4 +- external/hypre/src/examples/vis/glvis-ex2.sh | 4 +- external/hypre/src/examples/vis/glvis-ex3.sh | 4 +- external/hypre/src/examples/vis/glvis-ex4.sh | 4 +- external/hypre/src/examples/vis/glvis-ex5.sh | 4 +- external/hypre/src/examples/vis/glvis-ex6.sh | 4 +- external/hypre/src/examples/vis/glvis-ex7.sh | 4 +- external/hypre/src/examples/vis/glvis-ex8.sh | 4 +- external/hypre/src/examples/vis/glvis-ex9.sh | 4 +- external/hypre/src/krylov/CMakeLists.txt | 2 +- .../hypre/src/krylov/HYPRE_MatvecFunctions.h | 4 +- external/hypre/src/krylov/HYPRE_bicgstab.c | 94 +- external/hypre/src/krylov/HYPRE_cgnr.c | 78 +- external/hypre/src/krylov/HYPRE_cogmres.c | 151 +- external/hypre/src/krylov/HYPRE_flexgmres.c | 135 +- external/hypre/src/krylov/HYPRE_gmres.c | 122 +- external/hypre/src/krylov/HYPRE_krylov.h | 114 +- external/hypre/src/krylov/HYPRE_lgmres.c | 134 +- external/hypre/src/krylov/HYPRE_lobpcg.c | 235 +- external/hypre/src/krylov/HYPRE_lobpcg.h | 37 +- external/hypre/src/krylov/HYPRE_pcg.c | 127 +- external/hypre/src/krylov/bicgstab.c | 457 +- external/hypre/src/krylov/bicgstab.h | 52 +- external/hypre/src/krylov/cgnr.c | 114 +- external/hypre/src/krylov/cgnr.h | 4 +- external/hypre/src/krylov/cogmres.c | 434 +- external/hypre/src/krylov/cogmres.h | 20 +- external/hypre/src/krylov/flexgmres.c | 734 +- external/hypre/src/krylov/flexgmres.h | 8 +- external/hypre/src/krylov/gmres.c | 361 +- external/hypre/src/krylov/gmres.h | 6 +- external/hypre/src/krylov/headers | 76 - external/hypre/src/krylov/krylov.h | 2985 +-- external/hypre/src/krylov/lgmres.c | 984 +- external/hypre/src/krylov/lgmres.h | 10 +- external/hypre/src/krylov/lobpcg.c | 1818 +- external/hypre/src/krylov/lobpcg.h | 86 +- external/hypre/src/krylov/pcg.c | 563 +- external/hypre/src/krylov/pcg.h | 9 +- external/hypre/src/lapack/CMakeLists.txt | 2 +- external/hypre/src/lapack/README | 2 +- external/hypre/src/lapack/_hypre_lapack.h | 2 +- external/hypre/src/lapack/dbdsqr.c | 387 +- external/hypre/src/lapack/dgebd2.c | 198 +- external/hypre/src/lapack/dgebrd.c | 240 +- external/hypre/src/lapack/dgelq2.c | 4 +- external/hypre/src/lapack/dgelqf.c | 20 +- external/hypre/src/lapack/dgels.c | 304 +- external/hypre/src/lapack/dgeqr2.c | 98 +- external/hypre/src/lapack/dgeqrf.c | 144 +- external/hypre/src/lapack/dgesvd.c | 1455 +- external/hypre/src/lapack/dgetf2.c | 96 +- external/hypre/src/lapack/dgetrf.c | 110 +- external/hypre/src/lapack/dgetri.c | 135 +- external/hypre/src/lapack/dgetrs.c | 102 +- external/hypre/src/lapack/dlabrd.c | 274 +- external/hypre/src/lapack/dlacpy.c | 62 +- external/hypre/src/lapack/dlae2.c | 80 +- external/hypre/src/lapack/dlaev2.c | 98 +- external/hypre/src/lapack/dlamch.c | 645 +- external/hypre/src/lapack/dlange.c | 101 +- external/hypre/src/lapack/dlanst.c | 87 +- external/hypre/src/lapack/dlansy.c | 119 +- external/hypre/src/lapack/dlapy2.c | 28 +- external/hypre/src/lapack/dlarf.c | 102 +- external/hypre/src/lapack/dlarfb.c | 10 +- external/hypre/src/lapack/dlarfg.c | 84 +- external/hypre/src/lapack/dlarft.c | 8 +- external/hypre/src/lapack/dlartg.c | 74 +- external/hypre/src/lapack/dlas2.c | 2 +- external/hypre/src/lapack/dlascl.c | 132 +- external/hypre/src/lapack/dlaset.c | 74 +- external/hypre/src/lapack/dlasq1.c | 118 +- external/hypre/src/lapack/dlasq2.c | 199 +- external/hypre/src/lapack/dlasq3.c | 126 +- external/hypre/src/lapack/dlasq4.c | 98 +- external/hypre/src/lapack/dlasq5.c | 80 +- external/hypre/src/lapack/dlasq6.c | 8 +- external/hypre/src/lapack/dlasr.c | 190 +- external/hypre/src/lapack/dlasrt.c | 68 +- external/hypre/src/lapack/dlassq.c | 72 +- external/hypre/src/lapack/dlasv2.c | 128 +- external/hypre/src/lapack/dlaswp.c | 82 +- external/hypre/src/lapack/dlatrd.c | 260 +- external/hypre/src/lapack/dorg2l.c | 6 +- external/hypre/src/lapack/dorg2r.c | 84 +- external/hypre/src/lapack/dorgbr.c | 226 +- external/hypre/src/lapack/dorgl2.c | 78 +- external/hypre/src/lapack/dorglq.c | 136 +- external/hypre/src/lapack/dorgql.c | 140 +- external/hypre/src/lapack/dorgqr.c | 136 +- external/hypre/src/lapack/dorgtr.c | 126 +- external/hypre/src/lapack/dorm2r.c | 12 +- external/hypre/src/lapack/dormbr.c | 228 +- external/hypre/src/lapack/dorml2.c | 134 +- external/hypre/src/lapack/dormlq.c | 198 +- external/hypre/src/lapack/dormqr.c | 196 +- external/hypre/src/lapack/dpotf2.c | 112 +- external/hypre/src/lapack/dpotrf.c | 126 +- external/hypre/src/lapack/dpotrs.c | 84 +- external/hypre/src/lapack/dsteqr.c | 252 +- external/hypre/src/lapack/dsterf.c | 136 +- external/hypre/src/lapack/dsyev.c | 174 +- external/hypre/src/lapack/dsygs2.c | 136 +- external/hypre/src/lapack/dsygst.c | 160 +- external/hypre/src/lapack/dsygv.c | 20 +- external/hypre/src/lapack/dsytd2.c | 202 +- external/hypre/src/lapack/dsytrd.c | 246 +- external/hypre/src/lapack/dtrti2.c | 98 +- external/hypre/src/lapack/dtrtri.c | 18 +- external/hypre/src/lapack/f2c.h | 30 +- external/hypre/src/lapack/hypre_lapack.h | 2 +- external/hypre/src/lapack/ieeeck.c | 52 +- external/hypre/src/lapack/ilaenv.c | 266 +- external/hypre/src/lapack/lsame.c | 54 +- .../hypre/src/matrix_matrix/CMakeLists.txt | 2 +- ...HYPRE_BuildIJMatrixFromDistributedMatrix.c | 48 +- ...RE_ConvertPETScMatrixToDistributedMatrix.c | 15 +- ...E_ConvertParCSRMatrixToDistributedMatrix.c | 2 +- .../HYPRE_matrix_matrix_protos.h | 8 +- .../hypre/src/matrix_matrix/internal_protos.h | 5 +- external/hypre/src/multivector/CMakeLists.txt | 2 +- external/hypre/src/multivector/backup.c | 945 +- .../hypre/src/multivector/csr_matmultivec.c | 128 +- .../hypre/src/multivector/csr_matmultivec.h | 6 +- external/hypre/src/multivector/interpreter.h | 75 +- external/hypre/src/multivector/multivector.c | 222 +- external/hypre/src/multivector/multivector.h | 94 +- .../src/multivector/par_csr_matmultivec.c | 74 +- .../src/multivector/par_csr_matmultivec.h | 10 +- .../hypre/src/multivector/par_csr_pmvcomm.c | 54 +- .../hypre/src/multivector/par_csr_pmvcomm.h | 20 +- .../hypre/src/multivector/par_multivector.c | 136 +- .../hypre/src/multivector/par_multivector.h | 46 +- .../hypre/src/multivector/seq_multivector.c | 236 +- .../hypre/src/multivector/seq_multivector.h | 51 +- .../hypre/src/multivector/temp_multivector.c | 861 +- .../hypre/src/multivector/temp_multivector.h | 32 +- external/hypre/src/nopoe | 0 .../hypre/src/parcsr_block_mv/CMakeLists.txt | 2 +- .../parcsr_block_mv/_hypre_parcsr_block_mv.h | 4 +- .../src/parcsr_block_mv/csr_block_matop.c | 84 +- .../src/parcsr_block_mv/csr_block_matrix.c | 920 +- .../src/parcsr_block_mv/csr_block_matrix.h | 112 +- .../src/parcsr_block_mv/csr_block_matvec.c | 90 +- .../hypre/src/parcsr_block_mv/driver_matvec.c | 258 +- .../parcsr_block_mv/par_block_nodal_systems.c | 88 +- .../src/parcsr_block_mv/par_csr_block_comm.c | 30 +- .../parcsr_block_mv/par_csr_block_interp.c | 1797 +- .../parcsr_block_mv/par_csr_block_matrix.c | 332 +- .../parcsr_block_mv/par_csr_block_matrix.h | 14 +- .../parcsr_block_mv/par_csr_block_matvec.c | 56 +- .../src/parcsr_block_mv/par_csr_block_rap.c | 683 +- .../par_csr_block_rap_communication.c | 200 +- .../src/parcsr_block_mv/par_csr_block_relax.c | 974 +- external/hypre/src/parcsr_ls/CMakeLists.txt | 40 +- external/hypre/src/parcsr_ls/Common.h | 2 +- external/hypre/src/parcsr_ls/F90_HYPRE_ams.c | 334 +- .../src/parcsr_ls/F90_HYPRE_parcsr_Euclid.c | 164 +- .../parcsr_ls/F90_HYPRE_parcsr_ParaSails.c | 264 +- .../src/parcsr_ls/F90_HYPRE_parcsr_amg.c | 1656 +- .../src/parcsr_ls/F90_HYPRE_parcsr_bicgstab.c | 271 +- .../src/parcsr_ls/F90_HYPRE_parcsr_block.c | 108 +- .../src/parcsr_ls/F90_HYPRE_parcsr_cgnr.c | 260 +- .../src/parcsr_ls/F90_HYPRE_parcsr_cogmres.c | 312 +- .../parcsr_ls/F90_HYPRE_parcsr_flexgmres.c | 271 +- .../src/parcsr_ls/F90_HYPRE_parcsr_gmres.c | 287 +- .../src/parcsr_ls/F90_HYPRE_parcsr_hybrid.c | 704 +- .../src/parcsr_ls/F90_HYPRE_parcsr_ilu.c | 316 + .../src/parcsr_ls/F90_HYPRE_parcsr_int.c | 90 +- .../src/parcsr_ls/F90_HYPRE_parcsr_lgmres.c | 271 +- .../src/parcsr_ls/F90_HYPRE_parcsr_mgr.c | 807 + .../src/parcsr_ls/F90_HYPRE_parcsr_pcg.c | 323 +- .../src/parcsr_ls/F90_HYPRE_parcsr_pilut.c | 110 +- .../src/parcsr_ls/F90_HYPRE_parcsr_schwarz.c | 144 +- .../hypre/src/parcsr_ls/F90_hypre_laplace.c | 56 +- external/hypre/src/parcsr_ls/HYPRE_ads.c | 4 +- external/hypre/src/parcsr_ls/HYPRE_ame.c | 14 +- external/hypre/src/parcsr_ls/HYPRE_ams.c | 4 +- .../hypre/src/parcsr_ls/HYPRE_parcsr_Euclid.c | 566 +- .../src/parcsr_ls/HYPRE_parcsr_ParaSails.c | 328 +- .../hypre/src/parcsr_ls/HYPRE_parcsr_amg.c | 708 +- .../hypre/src/parcsr_ls/HYPRE_parcsr_amgdd.c | 58 +- .../src/parcsr_ls/HYPRE_parcsr_bicgstab.c | 67 +- .../hypre/src/parcsr_ls/HYPRE_parcsr_block.c | 30 +- .../hypre/src/parcsr_ls/HYPRE_parcsr_cgnr.c | 70 +- .../src/parcsr_ls/HYPRE_parcsr_cogmres.c | 127 +- .../src/parcsr_ls/HYPRE_parcsr_flexgmres.c | 82 +- .../hypre/src/parcsr_ls/HYPRE_parcsr_fsai.c | 375 + .../hypre/src/parcsr_ls/HYPRE_parcsr_gmres.c | 122 +- .../hypre/src/parcsr_ls/HYPRE_parcsr_hybrid.c | 158 +- .../hypre/src/parcsr_ls/HYPRE_parcsr_ilu.c | 149 +- .../hypre/src/parcsr_ls/HYPRE_parcsr_int.c | 255 +- .../hypre/src/parcsr_ls/HYPRE_parcsr_lgmres.c | 81 +- .../hypre/src/parcsr_ls/HYPRE_parcsr_ls.h | 1175 +- .../hypre/src/parcsr_ls/HYPRE_parcsr_mgr.c | 733 +- .../hypre/src/parcsr_ls/HYPRE_parcsr_pcg.c | 128 +- .../hypre/src/parcsr_ls/HYPRE_parcsr_pilut.c | 89 +- .../src/parcsr_ls/HYPRE_parcsr_schwarz.c | 44 +- .../hypre/src/parcsr_ls/_hypre_parcsr_ls.h | 4513 +++- external/hypre/src/parcsr_ls/ads.c | 347 +- external/hypre/src/parcsr_ls/ads.h | 2 +- external/hypre/src/parcsr_ls/ame.c | 227 +- external/hypre/src/parcsr_ls/ame.h | 3 +- external/hypre/src/parcsr_ls/amg_hybrid.c | 230 +- external/hypre/src/parcsr_ls/ams.c | 1713 +- external/hypre/src/parcsr_ls/ams.h | 42 +- external/hypre/src/parcsr_ls/aux_interp.c | 1138 +- external/hypre/src/parcsr_ls/aux_interp.h | 51 +- external/hypre/src/parcsr_ls/block_tridiag.c | 102 +- external/hypre/src/parcsr_ls/block_tridiag.h | 16 +- .../hypre/src/parcsr_ls/csr_block_matrix.h | 112 +- external/hypre/src/parcsr_ls/driver.c | 411 +- external/hypre/src/parcsr_ls/dsuperlu.c | 257 +- external/hypre/src/parcsr_ls/dsuperlu.h | 24 +- external/hypre/src/parcsr_ls/gen_redcs_mat.c | 222 +- external/hypre/src/parcsr_ls/headers | 8 +- external/hypre/src/parcsr_ls/par_2s_interp.c | 439 +- .../src/parcsr_ls/par_2s_interp_device.c | 508 +- external/hypre/src/parcsr_ls/par_add_cycle.c | 446 +- external/hypre/src/parcsr_ls/par_amg.c | 1450 +- external/hypre/src/parcsr_ls/par_amg.h | 70 +- external/hypre/src/parcsr_ls/par_amg_setup.c | 1940 +- external/hypre/src/parcsr_ls/par_amg_solve.c | 196 +- external/hypre/src/parcsr_ls/par_amg_solveT.c | 214 +- external/hypre/src/parcsr_ls/par_amgdd.c | 6 +- external/hypre/src/parcsr_ls/par_amgdd.h | 5 +- .../hypre/src/parcsr_ls/par_amgdd_comp_grid.c | 433 +- .../hypre/src/parcsr_ls/par_amgdd_comp_grid.h | 12 +- .../hypre/src/parcsr_ls/par_amgdd_fac_cycle.c | 189 +- .../parcsr_ls/par_amgdd_fac_cycle_device.c | 23 +- .../hypre/src/parcsr_ls/par_amgdd_helpers.c | 1184 +- .../hypre/src/parcsr_ls/par_amgdd_setup.c | 56 +- .../hypre/src/parcsr_ls/par_amgdd_solve.c | 63 +- .../hypre/src/parcsr_ls/par_cg_relax_wt.c | 174 +- .../hypre/src/parcsr_ls/par_cgc_coarsen.c | 782 +- external/hypre/src/parcsr_ls/par_cheby.c | 153 +- .../hypre/src/parcsr_ls/par_cheby_device.c | 92 +- .../hypre/src/parcsr_ls/par_coarse_parms.c | 85 +- .../src/parcsr_ls/par_coarse_parms_device.c | 69 +- external/hypre/src/parcsr_ls/par_coarsen.c | 676 +- .../hypre/src/parcsr_ls/par_coarsen_device.c | 262 +- .../hypre/src/parcsr_ls/par_coordinates.c | 86 +- external/hypre/src/parcsr_ls/par_cr.c | 1212 +- external/hypre/src/parcsr_ls/par_cycle.c | 169 +- external/hypre/src/parcsr_ls/par_difconv.c | 138 +- external/hypre/src/parcsr_ls/par_fsai.c | 798 + external/hypre/src/parcsr_ls/par_fsai.h | 88 + .../hypre/src/parcsr_ls/par_fsai_device.c | 1338 + external/hypre/src/parcsr_ls/par_fsai_setup.c | 1357 ++ external/hypre/src/parcsr_ls/par_fsai_solve.c | 179 + external/hypre/src/parcsr_ls/par_gauss_elim.c | 866 +- external/hypre/src/parcsr_ls/par_ge_device.c | 356 + external/hypre/src/parcsr_ls/par_gsmg.c | 1593 +- external/hypre/src/parcsr_ls/par_ilu.c | 4910 ++-- external/hypre/src/parcsr_ls/par_ilu.h | 296 +- external/hypre/src/parcsr_ls/par_ilu_setup.c | 6207 ++--- .../src/parcsr_ls/par_ilu_setup_device.c | 605 + external/hypre/src/parcsr_ls/par_ilu_solve.c | 2317 +- .../src/parcsr_ls/par_ilu_solve_device.c | 1226 + external/hypre/src/parcsr_ls/par_indepset.c | 16 +- .../hypre/src/parcsr_ls/par_indepset_device.c | 102 +- external/hypre/src/parcsr_ls/par_interp.c | 1240 +- .../hypre/src/parcsr_ls/par_interp_device.c | 636 +- .../src/parcsr_ls/par_interp_trunc_device.c | 682 +- .../hypre/src/parcsr_ls/par_jacobi_interp.c | 310 +- .../hypre/src/parcsr_ls/par_krylov_func.c | 82 +- external/hypre/src/parcsr_ls/par_laplace.c | 829 +- .../hypre/src/parcsr_ls/par_laplace_27pt.c | 876 +- .../hypre/src/parcsr_ls/par_laplace_9pt.c | 246 +- external/hypre/src/parcsr_ls/par_lr_interp.c | 1431 +- .../src/parcsr_ls/par_lr_interp_device.c | 2373 +- external/hypre/src/parcsr_ls/par_lr_restr.c | 252 +- .../hypre/src/parcsr_ls/par_lr_restr_device.c | 255 +- external/hypre/src/parcsr_ls/par_mgr.c | 8402 +++---- external/hypre/src/parcsr_ls/par_mgr.h | 343 +- .../hypre/src/parcsr_ls/par_mgr_coarsen.c | 54 + external/hypre/src/parcsr_ls/par_mgr_device.c | 1007 + external/hypre/src/parcsr_ls/par_mgr_interp.c | 2637 ++ external/hypre/src/parcsr_ls/par_mgr_rap.c | 692 + external/hypre/src/parcsr_ls/par_mgr_setup.c | 3455 +-- external/hypre/src/parcsr_ls/par_mgr_solve.c | 1335 +- external/hypre/src/parcsr_ls/par_mgr_stats.c | 745 + .../hypre/src/parcsr_ls/par_mod_lr_interp.c | 671 +- .../src/parcsr_ls/par_mod_multi_interp.c | 1318 + .../parcsr_ls/par_mod_multi_interp_device.c | 2492 ++ .../hypre/src/parcsr_ls/par_multi_interp.c | 877 +- .../hypre/src/parcsr_ls/par_nodal_systems.c | 403 +- .../hypre/src/parcsr_ls/par_nongalerkin.c | 4102 ++-- external/hypre/src/parcsr_ls/par_rap.c | 634 +- .../src/parcsr_ls/par_rap_communication.c | 194 +- external/hypre/src/parcsr_ls/par_relax.c | 949 +- external/hypre/src/parcsr_ls/par_relax.h | 55 +- .../hypre/src/parcsr_ls/par_relax_device.c | 110 +- .../hypre/src/parcsr_ls/par_relax_interface.c | 5 +- external/hypre/src/parcsr_ls/par_relax_more.c | 183 +- .../src/parcsr_ls/par_relax_more_device.c | 206 +- external/hypre/src/parcsr_ls/par_restr.c | 203 +- external/hypre/src/parcsr_ls/par_rotate_7pt.c | 192 +- .../hypre/src/parcsr_ls/par_scaled_matnorm.c | 70 +- external/hypre/src/parcsr_ls/par_schwarz.c | 136 +- external/hypre/src/parcsr_ls/par_stats.c | 796 +- external/hypre/src/parcsr_ls/par_strength.c | 844 +- .../src/parcsr_ls/par_strength2nd_device.c | 58 +- .../hypre/src/parcsr_ls/par_strength_device.c | 440 +- external/hypre/src/parcsr_ls/par_sv_interp.c | 1489 +- .../hypre/src/parcsr_ls/par_sv_interp_ln.c | 1392 +- .../hypre/src/parcsr_ls/par_sv_interp_lsfit.c | 346 +- external/hypre/src/parcsr_ls/par_vardifconv.c | 342 +- .../hypre/src/parcsr_ls/par_vardifconv_rs.c | 286 +- external/hypre/src/parcsr_ls/partial.c | 884 +- external/hypre/src/parcsr_ls/protos.h | 3803 ++- external/hypre/src/parcsr_ls/schwarz.c | 2202 +- external/hypre/src/parcsr_ls/schwarz.h | 8 +- external/hypre/src/parcsr_mv/CMakeLists.txt | 20 +- .../src/parcsr_mv/F90_HYPRE_parcsr_matrix.c | 319 +- .../src/parcsr_mv/F90_HYPRE_parcsr_vector.c | 186 +- external/hypre/src/parcsr_mv/F90_par_vector.c | 120 +- .../hypre/src/parcsr_mv/F90_parcsr_matrix.c | 28 +- .../hypre/src/parcsr_mv/HYPRE_parcsr_matrix.c | 34 +- .../hypre/src/parcsr_mv/HYPRE_parcsr_mv.h | 65 +- .../hypre/src/parcsr_mv/HYPRE_parcsr_vector.c | 21 +- .../hypre/src/parcsr_mv/_hypre_parcsr_mv.h | 857 +- external/hypre/src/parcsr_mv/communicationT.c | 558 +- external/hypre/src/parcsr_mv/driver.c | 78 +- external/hypre/src/parcsr_mv/driver_aat.c | 20 +- external/hypre/src/parcsr_mv/driver_boolaat.c | 20 +- .../hypre/src/parcsr_mv/driver_boolmatmul.c | 55 +- .../hypre/src/parcsr_mv/driver_mat_multivec.c | 50 +- external/hypre/src/parcsr_mv/driver_matmul.c | 24 +- external/hypre/src/parcsr_mv/driver_matvec.c | 86 +- .../hypre/src/parcsr_mv/driver_multivec.c | 64 +- external/hypre/src/parcsr_mv/gen_fffc.c | 639 +- external/hypre/src/parcsr_mv/headers | 6 +- external/hypre/src/parcsr_mv/new_commpkg.c | 354 +- external/hypre/src/parcsr_mv/new_commpkg.h | 2 +- external/hypre/src/parcsr_mv/numbers.c | 90 +- external/hypre/src/parcsr_mv/numbers.h | 2 +- .../hypre/src/parcsr_mv/par_chord_matrix.h | 2 +- external/hypre/src/parcsr_mv/par_csr_aat.c | 308 +- .../src/parcsr_mv/par_csr_assumed_part.c | 135 +- .../src/parcsr_mv/par_csr_assumed_part.h | 2 +- .../hypre/src/parcsr_mv/par_csr_bool_matop.c | 761 +- .../hypre/src/parcsr_mv/par_csr_bool_matrix.c | 660 +- .../src/parcsr_mv/par_csr_communication.c | 715 +- .../src/parcsr_mv/par_csr_communication.h | 66 +- .../hypre/src/parcsr_mv/par_csr_fffc_device.c | 857 +- external/hypre/src/parcsr_mv/par_csr_filter.c | 218 + .../src/parcsr_mv/par_csr_filter_device.c | 358 + external/hypre/src/parcsr_mv/par_csr_matmat.c | 159 + .../src/parcsr_mv/par_csr_matmat_device.c | 152 + external/hypre/src/parcsr_mv/par_csr_matop.c | 2402 +- .../src/parcsr_mv/par_csr_matop_device.c | 2180 +- .../src/parcsr_mv/par_csr_matop_marked.c | 335 +- external/hypre/src/parcsr_mv/par_csr_matrix.c | 1410 +- external/hypre/src/parcsr_mv/par_csr_matrix.h | 50 +- .../src/parcsr_mv/par_csr_matrix_stats.c | 497 + external/hypre/src/parcsr_mv/par_csr_matvec.c | 746 +- .../src/parcsr_mv/par_csr_matvec_device.c | 593 + .../hypre/src/parcsr_mv/par_csr_triplemat.c | 517 +- .../src/parcsr_mv/par_csr_triplemat_device.c | 1240 +- .../hypre/src/parcsr_mv/par_make_system.c | 148 +- .../hypre/src/parcsr_mv/par_make_system.h | 2 +- external/hypre/src/parcsr_mv/par_vector.c | 754 +- external/hypre/src/parcsr_mv/par_vector.h | 16 +- .../hypre/src/parcsr_mv/par_vector_batched.c | 21 +- .../hypre/src/parcsr_mv/par_vector_device.c | 66 +- .../hypre/src/parcsr_mv/parchord_to_parcsr.c | 522 +- external/hypre/src/parcsr_mv/protos.h | 714 +- .../hypre/src/seq_block_mv/CMakeLists.txt | 29 + .../src/seq_block_mv/_hypre_seq_block_mv.h | 114 + .../src/seq_block_mv/dense_block_matmult.c | 136 + .../src/seq_block_mv/dense_block_matrix.c | 335 + .../src/seq_block_mv/dense_block_matrix.h | 65 + external/hypre/src/seq_block_mv/headers | 49 + external/hypre/src/seq_block_mv/protos.h | 24 + external/hypre/src/seq_mv/.gitignore | 7 + external/hypre/src/seq_mv/CMakeLists.txt | 109 +- external/hypre/src/seq_mv/HYPRE_csr_matrix.c | 6 +- .../hypre/src/seq_mv/HYPRE_mapped_matrix.c | 30 +- .../src/seq_mv/HYPRE_multiblock_matrix.c | 38 +- external/hypre/src/seq_mv/HYPRE_seq_mv.h | 42 +- external/hypre/src/seq_mv/HYPRE_vector.c | 8 +- external/hypre/src/seq_mv/MakeIRIX | 2 +- external/hypre/src/seq_mv/csr_filter.c | 52 + external/hypre/src/seq_mv/csr_matop.c | 542 +- external/hypre/src/seq_mv/csr_matop_device.c | 3563 ++- external/hypre/src/seq_mv/csr_matrix.c | 722 +- external/hypre/src/seq_mv/csr_matrix.h | 22 +- .../hypre/src/seq_mv/csr_matrix_cuda_utils.c | 58 +- external/hypre/src/seq_mv/csr_matvec.c | 485 +- external/hypre/src/seq_mv/csr_matvec_device.c | 401 +- external/hypre/src/seq_mv/csr_matvec_oomp.c | 12 +- external/hypre/src/seq_mv/csr_spadd_device.c | 29 +- external/hypre/src/seq_mv/csr_spgemm_device.c | 137 +- external/hypre/src/seq_mv/csr_spgemm_device.h | 428 +- .../src/seq_mv/csr_spgemm_device_attempt.c | 632 - .../src/seq_mv/csr_spgemm_device_confident.c | 589 - .../src/seq_mv/csr_spgemm_device_cusparse.c | 115 +- .../src/seq_mv/csr_spgemm_device_numblocks.c | 149 + .../src/seq_mv/csr_spgemm_device_numer.c | 238 + .../src/seq_mv/csr_spgemm_device_numer.h | 889 + .../src/seq_mv/csr_spgemm_device_numer.in | 50 + .../seq_mv/csr_spgemm_device_onemklsparse.c | 257 + .../src/seq_mv/csr_spgemm_device_rocsparse.c | 85 +- .../src/seq_mv/csr_spgemm_device_rowbound.c | 407 - .../src/seq_mv/csr_spgemm_device_rowest.c | 268 +- .../src/seq_mv/csr_spgemm_device_symbl.c | 426 + .../src/seq_mv/csr_spgemm_device_symbl.h | 629 + .../src/seq_mv/csr_spgemm_device_symbl.in | 40 + .../hypre/src/seq_mv/csr_spgemm_device_util.c | 296 +- external/hypre/src/seq_mv/csr_spmv_device.c | 685 +- external/hypre/src/seq_mv/csr_spmv_device.h | 123 + .../hypre/src/seq_mv/csr_sptrans_device.c | 123 +- external/hypre/src/seq_mv/genpart.c | 20 +- external/hypre/src/seq_mv/headers | 4 +- external/hypre/src/seq_mv/mapped_matrix.c | 69 +- external/hypre/src/seq_mv/mapped_matrix.h | 2 +- external/hypre/src/seq_mv/multiblock_matrix.c | 86 +- external/hypre/src/seq_mv/multiblock_matrix.h | 2 +- external/hypre/src/seq_mv/protos.h | 388 +- external/hypre/src/seq_mv/seq_mv.h | 443 +- external/hypre/src/seq_mv/seq_mv.hpp | 62 +- external/hypre/src/seq_mv/vector.c | 980 +- external/hypre/src/seq_mv/vector.h | 25 +- external/hypre/src/seq_mv/vector_batched.c | 950 +- external/hypre/src/seq_mv/vector_device.c | 403 + external/hypre/src/sstruct_ls/CMakeLists.txt | 10 +- .../sstruct_ls/F90_HYPRE_sstruct_InterFAC.c | 342 +- .../sstruct_ls/F90_HYPRE_sstruct_bicgstab.c | 230 +- .../sstruct_ls/F90_HYPRE_sstruct_flexgmres.c | 230 +- .../src/sstruct_ls/F90_HYPRE_sstruct_gmres.c | 240 +- .../src/sstruct_ls/F90_HYPRE_sstruct_int.c | 54 +- .../src/sstruct_ls/F90_HYPRE_sstruct_lgmres.c | 240 +- .../sstruct_ls/F90_HYPRE_sstruct_maxwell.c | 322 +- .../src/sstruct_ls/F90_HYPRE_sstruct_pcg.c | 268 +- .../src/sstruct_ls/F90_HYPRE_sstruct_split.c | 140 +- .../sstruct_ls/F90_HYPRE_sstruct_sys_pfmg.c | 236 +- .../src/sstruct_ls/HYPRE_sstruct_InterFAC.c | 74 +- .../src/sstruct_ls/HYPRE_sstruct_bicgstab.c | 66 +- .../src/sstruct_ls/HYPRE_sstruct_flexgmres.c | 65 +- .../src/sstruct_ls/HYPRE_sstruct_gmres.c | 64 +- .../hypre/src/sstruct_ls/HYPRE_sstruct_int.c | 81 +- .../src/sstruct_ls/HYPRE_sstruct_lgmres.c | 98 +- .../hypre/src/sstruct_ls/HYPRE_sstruct_ls.h | 24 +- .../src/sstruct_ls/HYPRE_sstruct_maxwell.c | 96 +- .../hypre/src/sstruct_ls/HYPRE_sstruct_pcg.c | 79 +- .../src/sstruct_ls/HYPRE_sstruct_split.c | 112 +- .../src/sstruct_ls/HYPRE_sstruct_sys_pfmg.c | 66 +- .../hypre/src/sstruct_ls/_hypre_sstruct_ls.h | 728 +- external/hypre/src/sstruct_ls/bsearch.c | 38 +- .../hypre/src/sstruct_ls/eliminate_rowscols.c | 76 +- .../hypre/src/sstruct_ls/eliminate_rowscols.h | 20 +- external/hypre/src/sstruct_ls/fac.c | 78 +- external/hypre/src/sstruct_ls/fac.h | 4 +- .../src/sstruct_ls/fac_CFInterfaceExtents.c | 166 +- .../hypre/src/sstruct_ls/fac_amr_fcoarsen.c | 1863 +- external/hypre/src/sstruct_ls/fac_amr_rap.c | 216 +- .../hypre/src/sstruct_ls/fac_amr_zero_data.c | 316 +- .../hypre/src/sstruct_ls/fac_cf_coarsen.c | 208 +- .../hypre/src/sstruct_ls/fac_cfstencil_box.c | 88 +- external/hypre/src/sstruct_ls/fac_interp2.c | 712 +- external/hypre/src/sstruct_ls/fac_relax.c | 2 +- external/hypre/src/sstruct_ls/fac_restrict2.c | 342 +- external/hypre/src/sstruct_ls/fac_setup2.c | 429 +- external/hypre/src/sstruct_ls/fac_solve3.c | 337 +- .../hypre/src/sstruct_ls/fac_zero_cdata.c | 118 +- .../src/sstruct_ls/fac_zero_stencilcoef.c | 83 +- external/hypre/src/sstruct_ls/headers | 60 - external/hypre/src/sstruct_ls/krylov.c | 27 +- .../hypre/src/sstruct_ls/krylov_sstruct.c | 53 +- .../hypre/src/sstruct_ls/maxwell_PNedelec.c | 938 +- .../src/sstruct_ls/maxwell_PNedelec_bdy.c | 318 +- .../hypre/src/sstruct_ls/maxwell_PTopology.h | 16 +- external/hypre/src/sstruct_ls/maxwell_TV.c | 162 +- external/hypre/src/sstruct_ls/maxwell_TV.h | 14 +- .../hypre/src/sstruct_ls/maxwell_TV_setup.c | 819 +- external/hypre/src/sstruct_ls/maxwell_grad.c | 267 +- .../hypre/src/sstruct_ls/maxwell_physbdy.c | 428 +- .../src/sstruct_ls/maxwell_semi_interp.c | 2050 +- external/hypre/src/sstruct_ls/maxwell_solve.c | 144 +- .../hypre/src/sstruct_ls/maxwell_solve2.c | 234 +- .../hypre/src/sstruct_ls/maxwell_zeroBC.c | 10 +- .../src/sstruct_ls/nd1_amge_interpolation.c | 259 +- .../src/sstruct_ls/nd1_amge_interpolation.h | 26 +- external/hypre/src/sstruct_ls/node_relax.c | 255 +- .../sstruct_amr_intercommunication.c | 21 +- .../hypre/src/sstruct_ls/sstruct_owninfo.c | 222 +- .../hypre/src/sstruct_ls/sstruct_owninfo.h | 4 +- .../hypre/src/sstruct_ls/sstruct_recvinfo.c | 102 +- .../hypre/src/sstruct_ls/sstruct_recvinfo.h | 4 +- .../hypre/src/sstruct_ls/sstruct_sendinfo.c | 119 +- .../hypre/src/sstruct_ls/sstruct_sendinfo.h | 4 +- .../src/sstruct_ls/sstruct_sharedDOFComm.c | 510 +- .../src/sstruct_ls/sstruct_sharedDOFComm.h | 6 +- external/hypre/src/sstruct_ls/sys_pfmg.c | 82 +- external/hypre/src/sstruct_ls/sys_pfmg.h | 12 +- .../hypre/src/sstruct_ls/sys_pfmg_relax.c | 12 +- .../hypre/src/sstruct_ls/sys_pfmg_setup.c | 106 +- .../src/sstruct_ls/sys_pfmg_setup_interp.c | 6 +- .../hypre/src/sstruct_ls/sys_pfmg_setup_rap.c | 18 +- .../hypre/src/sstruct_ls/sys_pfmg_solve.c | 24 +- .../hypre/src/sstruct_ls/sys_semi_interp.c | 4 +- .../hypre/src/sstruct_ls/sys_semi_restrict.c | 6 +- external/hypre/src/sstruct_mv/CMakeLists.txt | 10 +- .../src/sstruct_mv/F90_HYPRE_sstruct_graph.c | 144 +- .../src/sstruct_mv/F90_HYPRE_sstruct_grid.c | 228 +- .../src/sstruct_mv/F90_HYPRE_sstruct_matrix.c | 370 +- .../sstruct_mv/F90_HYPRE_sstruct_stencil.c | 48 +- .../src/sstruct_mv/F90_HYPRE_sstruct_vector.c | 316 +- .../src/sstruct_mv/HYPRE_sstruct_graph.c | 248 +- .../hypre/src/sstruct_mv/HYPRE_sstruct_grid.c | 60 +- .../src/sstruct_mv/HYPRE_sstruct_matrix.c | 444 +- .../hypre/src/sstruct_mv/HYPRE_sstruct_mv.h | 103 +- .../src/sstruct_mv/HYPRE_sstruct_stencil.c | 54 +- .../src/sstruct_mv/HYPRE_sstruct_vector.c | 249 +- .../hypre/src/sstruct_mv/_hypre_sstruct_mv.h | 413 +- external/hypre/src/sstruct_mv/headers | 4 +- external/hypre/src/sstruct_mv/protos.h | 383 +- external/hypre/src/sstruct_mv/sstruct_axpy.c | 8 +- external/hypre/src/sstruct_mv/sstruct_copy.c | 8 +- external/hypre/src/sstruct_mv/sstruct_graph.c | 36 +- external/hypre/src/sstruct_mv/sstruct_graph.h | 4 +- external/hypre/src/sstruct_mv/sstruct_grid.c | 598 +- external/hypre/src/sstruct_mv/sstruct_grid.h | 30 +- .../hypre/src/sstruct_mv/sstruct_innerprod.c | 12 +- .../hypre/src/sstruct_mv/sstruct_matrix.c | 296 +- .../hypre/src/sstruct_mv/sstruct_matrix.h | 4 +- .../hypre/src/sstruct_mv/sstruct_matvec.c | 28 +- external/hypre/src/sstruct_mv/sstruct_scale.c | 6 +- .../hypre/src/sstruct_mv/sstruct_stencil.c | 3 +- .../hypre/src/sstruct_mv/sstruct_stencil.h | 2 +- .../hypre/src/sstruct_mv/sstruct_vector.c | 57 +- .../hypre/src/sstruct_mv/sstruct_vector.h | 16 +- external/hypre/src/struct_ls/CMakeLists.txt | 12 +- .../src/struct_ls/F90_HYPRE_struct_bicgstab.c | 206 +- .../src/struct_ls/F90_HYPRE_struct_cycred.c | 104 +- .../struct_ls/F90_HYPRE_struct_flexgmres.c | 206 +- .../src/struct_ls/F90_HYPRE_struct_gmres.c | 206 +- .../src/struct_ls/F90_HYPRE_struct_hybrid.c | 302 +- .../src/struct_ls/F90_HYPRE_struct_int.c | 46 +- .../src/struct_ls/F90_HYPRE_struct_jacobi.c | 172 +- .../src/struct_ls/F90_HYPRE_struct_lgmres.c | 218 +- .../src/struct_ls/F90_HYPRE_struct_pcg.c | 258 +- .../src/struct_ls/F90_HYPRE_struct_pfmg.c | 418 +- .../src/struct_ls/F90_HYPRE_struct_smg.c | 320 +- .../struct_ls/F90_HYPRE_struct_sparse_msg.c | 244 +- .../src/struct_ls/HYPRE_struct_bicgstab.c | 57 +- .../hypre/src/struct_ls/HYPRE_struct_cycred.c | 34 +- .../src/struct_ls/HYPRE_struct_flexgmres.c | 57 +- .../hypre/src/struct_ls/HYPRE_struct_gmres.c | 54 +- .../hypre/src/struct_ls/HYPRE_struct_hybrid.c | 74 +- .../hypre/src/struct_ls/HYPRE_struct_int.c | 89 +- .../hypre/src/struct_ls/HYPRE_struct_jacobi.c | 50 +- .../hypre/src/struct_ls/HYPRE_struct_lgmres.c | 58 +- .../hypre/src/struct_ls/HYPRE_struct_ls.h | 420 +- .../hypre/src/struct_ls/HYPRE_struct_pcg.c | 56 +- .../hypre/src/struct_ls/HYPRE_struct_pfmg.c | 84 +- .../hypre/src/struct_ls/HYPRE_struct_smg.c | 62 +- .../src/struct_ls/HYPRE_struct_sparse_msg.c | 82 +- .../hypre/src/struct_ls/_hypre_struct_ls.h | 781 +- external/hypre/src/struct_ls/coarsen.c | 92 +- .../hypre/src/struct_ls/cyclic_reduction.c | 137 +- external/hypre/src/struct_ls/headers | 4 +- external/hypre/src/struct_ls/hybrid.c | 36 +- external/hypre/src/struct_ls/jacobi.c | 6 +- external/hypre/src/struct_ls/pcg_struct.c | 33 +- external/hypre/src/struct_ls/pfmg.c | 70 +- external/hypre/src/struct_ls/pfmg.h | 5 +- .../hypre/src/struct_ls/pfmg2_setup_rap.c | 724 +- .../hypre/src/struct_ls/pfmg3_setup_rap.c | 2171 +- external/hypre/src/struct_ls/pfmg_relax.c | 28 +- external/hypre/src/struct_ls/pfmg_setup.c | 500 +- .../hypre/src/struct_ls/pfmg_setup_interp.c | 574 +- external/hypre/src/struct_ls/pfmg_setup_rap.c | 72 +- .../hypre/src/struct_ls/pfmg_setup_rap5.c | 79 +- .../hypre/src/struct_ls/pfmg_setup_rap7.c | 99 +- external/hypre/src/struct_ls/pfmg_solve.c | 40 +- external/hypre/src/struct_ls/point_relax.c | 198 +- external/hypre/src/struct_ls/protos.h | 778 +- .../src/struct_ls/red_black_constantcoef_gs.c | 170 +- external/hypre/src/struct_ls/red_black_gs.c | 65 +- external/hypre/src/struct_ls/red_black_gs.h | 65 +- external/hypre/src/struct_ls/semi.c | 34 +- external/hypre/src/struct_ls/semi_interp.c | 38 +- external/hypre/src/struct_ls/semi_restrict.c | 42 +- external/hypre/src/struct_ls/semi_setup_rap.c | 154 +- external/hypre/src/struct_ls/smg.c | 36 +- external/hypre/src/struct_ls/smg.h | 8 +- external/hypre/src/struct_ls/smg2_setup_rap.c | 253 +- external/hypre/src/struct_ls/smg3_setup_rap.c | 895 +- external/hypre/src/struct_ls/smg_axpy.c | 2 +- external/hypre/src/struct_ls/smg_relax.c | 22 +- external/hypre/src/struct_ls/smg_residual.c | 14 +- .../src/struct_ls/smg_residual_unrolled.c | 400 +- external/hypre/src/struct_ls/smg_setup.c | 200 +- .../hypre/src/struct_ls/smg_setup_interp.c | 4 +- external/hypre/src/struct_ls/smg_setup_rap.c | 20 +- .../hypre/src/struct_ls/smg_setup_restrict.c | 13 +- external/hypre/src/struct_ls/smg_solve.c | 36 +- external/hypre/src/struct_ls/sparse_msg.c | 106 +- external/hypre/src/struct_ls/sparse_msg.h | 11 +- .../src/struct_ls/sparse_msg2_setup_rap.c | 224 +- .../src/struct_ls/sparse_msg3_setup_rap.c | 648 +- .../hypre/src/struct_ls/sparse_msg_filter.c | 42 +- .../hypre/src/struct_ls/sparse_msg_interp.c | 11 +- .../hypre/src/struct_ls/sparse_msg_restrict.c | 19 +- .../hypre/src/struct_ls/sparse_msg_setup.c | 101 +- .../src/struct_ls/sparse_msg_setup_rap.c | 77 +- .../hypre/src/struct_ls/sparse_msg_solve.c | 71 +- external/hypre/src/struct_mv/CMakeLists.txt | 10 +- .../src/struct_mv/F90_HYPRE_struct_grid.c | 78 +- .../src/struct_mv/F90_HYPRE_struct_matrix.c | 306 +- .../src/struct_mv/F90_HYPRE_struct_stencil.c | 40 +- .../src/struct_mv/F90_HYPRE_struct_vector.c | 282 +- .../hypre/src/struct_mv/HYPRE_struct_grid.c | 2 +- .../hypre/src/struct_mv/HYPRE_struct_matrix.c | 36 +- .../hypre/src/struct_mv/HYPRE_struct_mv.h | 31 +- .../src/struct_mv/HYPRE_struct_stencil.c | 8 +- .../hypre/src/struct_mv/HYPRE_struct_vector.c | 32 +- .../hypre/src/struct_mv/_hypre_struct_mv.h | 1373 +- .../hypre/src/struct_mv/_hypre_struct_mv.hpp | 1887 +- external/hypre/src/struct_mv/assumed_part.c | 232 +- external/hypre/src/struct_mv/assumed_part.h | 28 +- external/hypre/src/struct_mv/box.c | 207 +- external/hypre/src/struct_mv/box.h | 360 +- external/hypre/src/struct_mv/box_algebra.c | 194 +- external/hypre/src/struct_mv/box_boundary.c | 28 +- external/hypre/src/struct_mv/box_manager.c | 900 +- external/hypre/src/struct_mv/box_manager.h | 34 +- external/hypre/src/struct_mv/boxloop_cuda.h | 302 +- external/hypre/src/struct_mv/boxloop_host.h | 243 +- external/hypre/src/struct_mv/boxloop_kokkos.h | 31 +- .../hypre/src/struct_mv/boxloop_omp_device.h | 24 +- external/hypre/src/struct_mv/boxloop_raja.h | 35 +- external/hypre/src/struct_mv/boxloop_sycl.h | 437 + .../hypre/src/struct_mv/communication_info.c | 245 +- external/hypre/src/struct_mv/computation.c | 8 +- external/hypre/src/struct_mv/computation.h | 6 +- external/hypre/src/struct_mv/headers | 54 +- external/hypre/src/struct_mv/project.c | 14 +- external/hypre/src/struct_mv/protos.h | 547 +- external/hypre/src/struct_mv/struct_axpy.c | 17 +- .../src/struct_mv/struct_communication.c | 439 +- .../src/struct_mv/struct_communication.h | 68 +- external/hypre/src/struct_mv/struct_copy.c | 2 +- external/hypre/src/struct_mv/struct_grid.c | 69 +- external/hypre/src/struct_mv/struct_grid.h | 7 +- .../hypre/src/struct_mv/struct_innerprod.c | 6 +- external/hypre/src/struct_mv/struct_io.c | 96 +- external/hypre/src/struct_mv/struct_matrix.c | 558 +- external/hypre/src/struct_mv/struct_matrix.h | 6 +- .../hypre/src/struct_mv/struct_matrix_mask.c | 22 +- external/hypre/src/struct_mv/struct_matvec.c | 468 +- external/hypre/src/struct_mv/struct_scale.c | 2 +- external/hypre/src/struct_mv/struct_stencil.c | 16 +- external/hypre/src/struct_mv/struct_stencil.h | 4 +- external/hypre/src/struct_mv/struct_vector.c | 268 +- external/hypre/src/struct_mv/struct_vector.h | 48 +- external/hypre/src/tarch | 4 +- external/hypre/src/test/CMakeLists.txt | 121 +- external/hypre/src/test/TEST_ams/solvers.jobs | 4 +- .../hypre/src/test/TEST_ams/solvers.saved | 90 +- .../src/test/TEST_ams/solvers.saved.lassen | 154 +- .../test/TEST_ams/solvers.saved.lassen_cpu | 117 + .../hypre/src/test/TEST_ams/solvers.saved.ray | 117 - .../src/test/TEST_ams/solvers.saved.tioga | 117 + external/hypre/src/test/TEST_ams/solvers.sh | 4 +- .../src/test/TEST_bench/benchmark_ij.jobs | 63 +- .../TEST_bench/benchmark_ij.perf.saved.lassen | 106 +- .../TEST_bench/benchmark_ij.perf.saved.ray | 75 - .../TEST_bench/benchmark_ij.perf.saved.tioga | 81 + .../test/TEST_bench/benchmark_ij.saved.lassen | 176 +- .../test/TEST_bench/benchmark_ij.saved.ray | 200 - .../test/TEST_bench/benchmark_ij.saved.tioga | 107 + .../hypre/src/test/TEST_bench/benchmark_ij.sh | 23 +- .../src/test/TEST_bench/benchmark_spgemm.jobs | 65 + .../benchmark_spgemm.perf.saved.lassen | 72 + .../benchmark_spgemm.perf.saved.tioga | 72 + .../TEST_bench/benchmark_spgemm.saved.lassen | 108 + .../TEST_bench/benchmark_spgemm.saved.tioga | 108 + .../src/test/TEST_bench/benchmark_spgemm.sh | 78 + .../src/test/TEST_bench/benchmark_struct.jobs | 20 +- .../benchmark_struct.perf.saved.lassen | 32 +- .../benchmark_struct.perf.saved.ray | 24 - .../benchmark_struct.perf.saved.tioga | 24 + ...saved.ray => benchmark_struct.saved.tioga} | 0 .../src/test/TEST_bench/benchmark_struct.sh | 19 +- external/hypre/src/test/TEST_error/error.jobs | 22 + .../hypre/src/test/TEST_error/error.saved | 97 + .../src/test/TEST_error/error.saved.lassen | 71 + external/hypre/src/test/TEST_error/error.sh | 43 + .../hypre/src/test/TEST_examples/bigint.jobs | 4 +- .../hypre/src/test/TEST_examples/bigint.saved | 1 + .../hypre/src/test/TEST_examples/bigint.sh | 4 +- .../hypre/src/test/TEST_examples/complex.jobs | 4 +- .../hypre/src/test/TEST_examples/complex.sh | 4 +- .../hypre/src/test/TEST_examples/default.jobs | 4 +- .../src/test/TEST_examples/default.saved | 1 + .../hypre/src/test/TEST_examples/default.sh | 4 +- .../test/TEST_examples/fortran_examples.jobs | 4 +- .../test/TEST_examples/fortran_examples.sh | 4 +- .../hypre/src/test/TEST_examples/gpu.jobs | 8 +- .../src/test/TEST_examples/gpu.saved.lassen | 20 +- .../src/test/TEST_examples/gpu.saved.ray | 78 - external/hypre/src/test/TEST_examples/gpu.sh | 8 +- .../hypre/src/test/TEST_examples/maxdim.jobs | 4 +- .../hypre/src/test/TEST_examples/maxdim.sh | 4 +- external/hypre/src/test/TEST_fac/3lev.in | 2 +- .../hypre/src/test/TEST_fac/3lev_multibox.in | 2 +- external/hypre/src/test/TEST_fac/4lev.in | 2 +- external/hypre/src/test/TEST_fac/5lev.in | 2 +- external/hypre/src/test/TEST_fac/6lev.in | 2 +- external/hypre/src/test/TEST_fac/7lev.in | 2 +- .../hypre/src/test/TEST_fac/sstruct_fac.jobs | 14 +- .../hypre/src/test/TEST_fac/sstruct_fac.saved | 16 - .../hypre/src/test/TEST_fac/sstruct_fac.sh | 28 +- external/hypre/src/test/TEST_fei/solvers.jobs | 4 +- external/hypre/src/test/TEST_fei/solvers.sh | 4 +- .../hypre/src/test/TEST_gpumemcheck/gpu.jobs | 13 + .../test/TEST_gpumemcheck/gpu.saved.lassen | 40 + .../hypre/src/test/TEST_gpumemcheck/gpu.sh | 34 + .../hypre/src/test/TEST_ij/agg_interp.jobs | 40 +- .../hypre/src/test/TEST_ij/agg_interp.saved | 72 + .../src/test/TEST_ij/agg_interp.saved.aurora | 192 + .../src/test/TEST_ij/agg_interp.saved.lassen | 104 +- .../test/TEST_ij/agg_interp.saved.lassen_cpu | 192 + .../src/test/TEST_ij/agg_interp.saved.ray | 120 - external/hypre/src/test/TEST_ij/agg_interp.sh | 16 +- external/hypre/src/test/TEST_ij/air.jobs | 4 +- .../hypre/src/test/TEST_ij/air.saved.aurora | 48 + .../hypre/src/test/TEST_ij/air.saved.lassen | 12 +- .../src/test/TEST_ij/air.saved.lassen_cpu | 48 + external/hypre/src/test/TEST_ij/air.saved.ray | 48 - external/hypre/src/test/TEST_ij/air.sh | 4 +- external/hypre/src/test/TEST_ij/amgdd.jobs | 4 +- .../hypre/src/test/TEST_ij/amgdd.saved.aurora | 64 + .../hypre/src/test/TEST_ij/amgdd.saved.lassen | 38 +- .../src/test/TEST_ij/amgdd.saved.lassen_cpu | 64 + .../hypre/src/test/TEST_ij/amgdd.saved.ray | 64 - external/hypre/src/test/TEST_ij/amgdd.sh | 4 +- external/hypre/src/test/TEST_ij/assembly.jobs | 20 + external/hypre/src/test/TEST_ij/assembly.sh | 49 + .../hypre/src/test/TEST_ij/coarsening.jobs | 4 +- ...ning.saved.ray => coarsening.saved.aurora} | 38 +- .../src/test/TEST_ij/coarsening.saved.lassen | 34 +- .../test/TEST_ij/coarsening.saved.lassen_cpu | 74 + external/hypre/src/test/TEST_ij/coarsening.sh | 4 +- .../data/beam_hex_dof459_np2/A.IJ.00000 | 11467 +++++++++ .../data/beam_hex_dof459_np2/A.IJ.00001 | 10142 ++++++++ .../data/beam_hex_dof459_np2/b.IJ.00000 | 244 + .../data/beam_hex_dof459_np2/b.IJ.00001 | 217 + .../TEST_ij/data/beam_hex_dof459_np2/mfem.txt | 19 + .../data/beam_hex_dof459_np2/rbms.0.00000 | 244 + .../data/beam_hex_dof459_np2/rbms.0.00001 | 217 + .../data/beam_hex_dof459_np2/rbms.1.00000 | 244 + .../data/beam_hex_dof459_np2/rbms.1.00001 | 217 + .../data/beam_hex_dof459_np2/rbms.2.00000 | 244 + .../data/beam_hex_dof459_np2/rbms.2.00001 | 217 + .../data/beam_tet_dof2475_np4/A.IJ.00000 | 20224 ++++++++++++++++ .../data/beam_tet_dof2475_np4/A.IJ.00001 | 17368 +++++++++++++ .../data/beam_tet_dof2475_np4/A.IJ.00002 | 17977 ++++++++++++++ .../data/beam_tet_dof2475_np4/A.IJ.00003 | 17368 +++++++++++++ .../data/beam_tet_dof2475_np4/b.IJ.00000 | 676 + .../data/beam_tet_dof2475_np4/b.IJ.00001 | 601 + .../data/beam_tet_dof2475_np4/b.IJ.00002 | 601 + .../data/beam_tet_dof2475_np4/b.IJ.00003 | 601 + .../data/beam_tet_dof2475_np4/mfem.txt | 19 + .../data/beam_tet_dof2475_np4/rbms.0.00000 | 676 + .../data/beam_tet_dof2475_np4/rbms.0.00001 | 601 + .../data/beam_tet_dof2475_np4/rbms.0.00002 | 601 + .../data/beam_tet_dof2475_np4/rbms.0.00003 | 601 + .../data/beam_tet_dof2475_np4/rbms.1.00000 | 676 + .../data/beam_tet_dof2475_np4/rbms.1.00001 | 601 + .../data/beam_tet_dof2475_np4/rbms.1.00002 | 601 + .../data/beam_tet_dof2475_np4/rbms.1.00003 | 601 + .../data/beam_tet_dof2475_np4/rbms.2.00000 | 676 + .../data/beam_tet_dof2475_np4/rbms.2.00001 | 601 + .../data/beam_tet_dof2475_np4/rbms.2.00002 | 601 + .../data/beam_tet_dof2475_np4/rbms.2.00003 | 601 + .../data/beam_tet_dof459_np1/A.IJ.00000 | 11278 +++++++++ .../data/beam_tet_dof459_np1/b.IJ.00000 | 460 + .../TEST_ij/data/beam_tet_dof459_np1/mfem.txt | 19 + .../data/beam_tet_dof459_np1/rbms.0.00000 | 460 + .../data/beam_tet_dof459_np1/rbms.1.00000 | 460 + .../data/beam_tet_dof459_np1/rbms.2.00000 | 460 + .../TEST_ij/data/generate_poisson_10x10x10.sh | 54 + .../poisson_10x10x10_np1/IJ.A.i4f4.00000.bin | Bin 0 -> 76888 bytes .../poisson_10x10x10_np1/IJ.A.i4f8.00000.bin | Bin 0 -> 102488 bytes .../poisson_10x10x10_np1/IJ.A.i8f4.00000.bin | Bin 0 -> 128088 bytes .../poisson_10x10x10_np1/IJ.A.i8f8.00000.bin | Bin 0 -> 153688 bytes .../poisson_10x10x10_np1/IJ.b.i4f4.00000.bin | Bin 0 -> 4064 bytes .../poisson_10x10x10_np1/IJ.b.i4f8.00000.bin | Bin 0 -> 8064 bytes .../poisson_10x10x10_np1/IJ.b.i8f4.00000.bin | Bin 0 -> 4064 bytes .../poisson_10x10x10_np1/IJ.b.i8f8.00000.bin | Bin 0 -> 8064 bytes .../poisson_10x10x10_np1/IJ.x0.i4f4.00000.bin | Bin 0 -> 4064 bytes .../poisson_10x10x10_np1/IJ.x0.i4f8.00000.bin | Bin 0 -> 8064 bytes .../poisson_10x10x10_np1/IJ.x0.i8f4.00000.bin | Bin 0 -> 4064 bytes .../poisson_10x10x10_np1/IJ.x0.i8f8.00000.bin | Bin 0 -> 8064 bytes .../poisson_10x10x10_np4/IJ.A.i4f4.00000.bin | Bin 0 -> 19288 bytes .../poisson_10x10x10_np4/IJ.A.i4f4.00001.bin | Bin 0 -> 19288 bytes .../poisson_10x10x10_np4/IJ.A.i4f4.00002.bin | Bin 0 -> 19288 bytes .../poisson_10x10x10_np4/IJ.A.i4f4.00003.bin | Bin 0 -> 19288 bytes .../poisson_10x10x10_np4/IJ.A.i4f8.00000.bin | Bin 0 -> 25688 bytes .../poisson_10x10x10_np4/IJ.A.i4f8.00001.bin | Bin 0 -> 25688 bytes .../poisson_10x10x10_np4/IJ.A.i4f8.00002.bin | Bin 0 -> 25688 bytes .../poisson_10x10x10_np4/IJ.A.i4f8.00003.bin | Bin 0 -> 25688 bytes .../poisson_10x10x10_np4/IJ.A.i8f4.00000.bin | Bin 0 -> 32088 bytes .../poisson_10x10x10_np4/IJ.A.i8f4.00001.bin | Bin 0 -> 32088 bytes .../poisson_10x10x10_np4/IJ.A.i8f4.00002.bin | Bin 0 -> 32088 bytes .../poisson_10x10x10_np4/IJ.A.i8f4.00003.bin | Bin 0 -> 32088 bytes .../poisson_10x10x10_np4/IJ.A.i8f8.00000.bin | Bin 0 -> 38488 bytes .../poisson_10x10x10_np4/IJ.A.i8f8.00001.bin | Bin 0 -> 38488 bytes .../poisson_10x10x10_np4/IJ.A.i8f8.00002.bin | Bin 0 -> 38488 bytes .../poisson_10x10x10_np4/IJ.A.i8f8.00003.bin | Bin 0 -> 38488 bytes .../poisson_10x10x10_np4/IJ.b.i4f4.00000.bin | Bin 0 -> 1064 bytes .../poisson_10x10x10_np4/IJ.b.i4f4.00001.bin | Bin 0 -> 1064 bytes .../poisson_10x10x10_np4/IJ.b.i4f4.00002.bin | Bin 0 -> 1064 bytes .../poisson_10x10x10_np4/IJ.b.i4f4.00003.bin | Bin 0 -> 1064 bytes .../poisson_10x10x10_np4/IJ.b.i4f8.00000.bin | Bin 0 -> 2064 bytes .../poisson_10x10x10_np4/IJ.b.i4f8.00001.bin | Bin 0 -> 2064 bytes .../poisson_10x10x10_np4/IJ.b.i4f8.00002.bin | Bin 0 -> 2064 bytes .../poisson_10x10x10_np4/IJ.b.i4f8.00003.bin | Bin 0 -> 2064 bytes .../poisson_10x10x10_np4/IJ.b.i8f4.00000.bin | Bin 0 -> 1064 bytes .../poisson_10x10x10_np4/IJ.b.i8f4.00001.bin | Bin 0 -> 1064 bytes .../poisson_10x10x10_np4/IJ.b.i8f4.00002.bin | Bin 0 -> 1064 bytes .../poisson_10x10x10_np4/IJ.b.i8f4.00003.bin | Bin 0 -> 1064 bytes .../poisson_10x10x10_np4/IJ.b.i8f8.00000.bin | Bin 0 -> 2064 bytes .../poisson_10x10x10_np4/IJ.b.i8f8.00001.bin | Bin 0 -> 2064 bytes .../poisson_10x10x10_np4/IJ.b.i8f8.00002.bin | Bin 0 -> 2064 bytes .../poisson_10x10x10_np4/IJ.b.i8f8.00003.bin | Bin 0 -> 2064 bytes .../poisson_10x10x10_np4/IJ.x0.i4f4.00000.bin | Bin 0 -> 1064 bytes .../poisson_10x10x10_np4/IJ.x0.i4f4.00001.bin | Bin 0 -> 1064 bytes .../poisson_10x10x10_np4/IJ.x0.i4f4.00002.bin | Bin 0 -> 1064 bytes .../poisson_10x10x10_np4/IJ.x0.i4f4.00003.bin | Bin 0 -> 1064 bytes .../poisson_10x10x10_np4/IJ.x0.i4f8.00000.bin | Bin 0 -> 2064 bytes .../poisson_10x10x10_np4/IJ.x0.i4f8.00001.bin | Bin 0 -> 2064 bytes .../poisson_10x10x10_np4/IJ.x0.i4f8.00002.bin | Bin 0 -> 2064 bytes .../poisson_10x10x10_np4/IJ.x0.i4f8.00003.bin | Bin 0 -> 2064 bytes .../poisson_10x10x10_np4/IJ.x0.i8f4.00000.bin | Bin 0 -> 1064 bytes .../poisson_10x10x10_np4/IJ.x0.i8f4.00001.bin | Bin 0 -> 1064 bytes .../poisson_10x10x10_np4/IJ.x0.i8f4.00002.bin | Bin 0 -> 1064 bytes .../poisson_10x10x10_np4/IJ.x0.i8f4.00003.bin | Bin 0 -> 1064 bytes .../poisson_10x10x10_np4/IJ.x0.i8f8.00000.bin | Bin 0 -> 2064 bytes .../poisson_10x10x10_np4/IJ.x0.i8f8.00001.bin | Bin 0 -> 2064 bytes .../poisson_10x10x10_np4/IJ.x0.i8f8.00002.bin | Bin 0 -> 2064 bytes .../poisson_10x10x10_np4/IJ.x0.i8f8.00003.bin | Bin 0 -> 2064 bytes .../test/TEST_ij/data/tucker21935/IJ.A.00000 | 8570 +++++++ .../test/TEST_ij/data/tucker21935/IJ.A.00001 | 16687 +++++++++++++ .../test/TEST_ij/data/tucker21935/IJ.A.00002 | 9372 +++++++ .../test/TEST_ij/data/tucker21935/IJ.A.00003 | 16553 +++++++++++++ external/hypre/src/test/TEST_ij/default.jobs | 4 +- .../src/test/TEST_ij/default.saved.aurora | 21 + .../src/test/TEST_ij/default.saved.lassen_cpu | 21 + .../hypre/src/test/TEST_ij/default.saved.ray | 21 - external/hypre/src/test/TEST_ij/default.sh | 4 +- external/hypre/src/test/TEST_ij/elast.jobs | 4 +- .../hypre/src/test/TEST_ij/elast.saved.aurora | 84 + .../hypre/src/test/TEST_ij/elast.saved.lassen | 36 +- ...elast.saved.ray => elast.saved.lassen_cpu} | 58 +- external/hypre/src/test/TEST_ij/elast.sh | 4 +- external/hypre/src/test/TEST_ij/fsai.jobs | 89 + external/hypre/src/test/TEST_ij/fsai.saved | 152 + .../hypre/src/test/TEST_ij/fsai.saved.aurora | 152 + .../hypre/src/test/TEST_ij/fsai.saved.lassen | 151 + .../src/test/TEST_ij/fsai.saved.lassen_cpu | 152 + external/hypre/src/test/TEST_ij/fsai.sh | 67 + external/hypre/src/test/TEST_ij/ilu.jobs | 49 + external/hypre/src/test/TEST_ij/ilu.saved | 104 + .../hypre/src/test/TEST_ij/ilu.saved.aurora | 104 + .../hypre/src/test/TEST_ij/ilu.saved.lassen | 104 + .../src/test/TEST_ij/ilu.saved.lassen_cpu | 104 + external/hypre/src/test/TEST_ij/ilu.sh | 56 + external/hypre/src/test/TEST_ij/interp.jobs | 14 +- external/hypre/src/test/TEST_ij/interp.saved | 27 + .../src/test/TEST_ij/interp.saved.aurora | 91 + .../src/test/TEST_ij/interp.saved.lassen | 59 +- .../src/test/TEST_ij/interp.saved.lassen_cpu | 90 + .../hypre/src/test/TEST_ij/interp.saved.ray | 63 - external/hypre/src/test/TEST_ij/interp.sh | 8 +- external/hypre/src/test/TEST_ij/io.jobs | 71 + external/hypre/src/test/TEST_ij/io.saved | 47 + external/hypre/src/test/TEST_ij/io.sh | 43 + external/hypre/src/test/TEST_ij/lazy.jobs | 16 + external/hypre/src/test/TEST_ij/lazy.sh | 29 + external/hypre/src/test/TEST_ij/matrix.jobs | 26 +- external/hypre/src/test/TEST_ij/matrix.saved | 23 + .../{matrix.saved.ray => matrix.saved.aurora} | 36 +- .../src/test/TEST_ij/matrix.saved.lassen | 35 +- .../src/test/TEST_ij/matrix.saved.lassen_cpu | 75 + external/hypre/src/test/TEST_ij/matrix.sh | 10 +- .../hypre/src/test/TEST_ij/nonmixedint.jobs | 4 +- ...int.saved.ray => nonmixedint.saved.aurora} | 2 +- .../src/test/TEST_ij/nonmixedint.saved.lassen | 2 +- .../test/TEST_ij/nonmixedint.saved.lassen_cpu | 12 + .../hypre/src/test/TEST_ij/nonmixedint.sh | 4 +- external/hypre/src/test/TEST_ij/posneg.jobs | 17 + external/hypre/src/test/TEST_ij/posneg.sh | 46 + external/hypre/src/test/TEST_ij/smoother.jobs | 10 +- .../hypre/src/test/TEST_ij/smoother.saved | 14 +- .../src/test/TEST_ij/smoother.saved.aurora | 120 + .../src/test/TEST_ij/smoother.saved.lassen | 84 +- .../test/TEST_ij/smoother.saved.lassen_cpu | 120 + .../hypre/src/test/TEST_ij/smoother.saved.ray | 112 - external/hypre/src/test/TEST_ij/smoother.sh | 6 +- external/hypre/src/test/TEST_ij/solvers.jobs | 77 +- external/hypre/src/test/TEST_ij/solvers.saved | 178 +- .../src/test/TEST_ij/solvers.saved.aurora | 327 + .../src/test/TEST_ij/solvers.saved.lassen | 311 +- .../src/test/TEST_ij/solvers.saved.lassen_cpu | 326 + .../hypre/src/test/TEST_ij/solvers.saved.ray | 359 - external/hypre/src/test/TEST_ij/solvers.sh | 77 +- external/hypre/src/test/TEST_ij/state.jobs | 13 + external/hypre/src/test/TEST_ij/state.saved | 13 + .../hypre/src/test/TEST_ij/state.saved.aurora | 8 + .../hypre/src/test/TEST_ij/state.saved.lassen | 13 + .../src/test/TEST_ij/state.saved.lassen_cpu | 13 + external/hypre/src/test/TEST_ij/state.sh | 23 + external/hypre/src/test/TEST_ij/tst.00000 | 21 + external/hypre/src/test/TEST_ij/tst.00001 | 20 + external/hypre/src/test/TEST_ij/vector.jobs | 51 + external/hypre/src/test/TEST_ij/vector.saved | 121 + .../src/test/TEST_ij/vector.saved.aurora | 121 + .../src/test/TEST_ij/vector.saved.lassen | 121 + .../src/test/TEST_ij/vector.saved.lassen_cpu | 121 + external/hypre/src/test/TEST_ij/vector.sh | 85 + .../hypre/src/test/TEST_ij/versioncheck.jobs | 12 + .../hypre/src/test/TEST_ij/versioncheck.sh | 36 + .../hypre/src/test/TEST_lobpcg/ijdefault.jobs | 4 +- .../hypre/src/test/TEST_lobpcg/ijdefault.sh | 4 +- .../hypre/src/test/TEST_lobpcg/ijoptions.jobs | 4 +- .../hypre/src/test/TEST_lobpcg/ijoptions.sh | 6 +- .../src/test/TEST_lobpcg/nonmixedint.jobs | 4 +- .../hypre/src/test/TEST_lobpcg/nonmixedint.sh | 4 +- .../src/test/TEST_lobpcg/sstruct.in.default | 2 +- .../hypre/src/test/TEST_lobpcg/sstruct.jobs | 4 +- .../hypre/src/test/TEST_lobpcg/sstruct.sh | 4 +- .../hypre/src/test/TEST_lobpcg/struct.jobs | 4 +- external/hypre/src/test/TEST_lobpcg/struct.sh | 4 +- .../src/test/TEST_longdouble/solvers_ij.jobs | 4 +- .../src/test/TEST_longdouble/solvers_ij.saved | 55 +- .../src/test/TEST_longdouble/solvers_ij.sh | 4 +- .../test/TEST_longdouble/solvers_struct.jobs | 4 +- .../test/TEST_longdouble/solvers_struct.saved | 12 +- .../test/TEST_longdouble/solvers_struct.sh | 4 +- .../src/test/TEST_single/solvers_ij.jobs | 4 +- .../src/test/TEST_single/solvers_ij.saved | 21 +- .../test/TEST_single/solvers_ij.saved.lassen | 145 + .../hypre/src/test/TEST_single/solvers_ij.sh | 4 +- .../src/test/TEST_single/solvers_struct.jobs | 4 +- .../TEST_single/solvers_struct.saved.lassen | 120 + .../src/test/TEST_single/solvers_struct.sh | 4 +- .../src/test/TEST_sstruct/addtovalues.jobs | 2 +- .../TEST_sstruct/addtovalues.saved.lassen | 8 +- ...saved.ray => addtovalues.saved.lassen_cpu} | 16 +- .../src/test/TEST_sstruct/addtovalues.sh | 4 +- .../hypre/src/test/TEST_sstruct/amr2d.jobs | 4 +- .../src/test/TEST_sstruct/amr2d.saved.lassen | 12 +- ...amr2d.saved.ray => amr2d.saved.lassen_cpu} | 24 +- external/hypre/src/test/TEST_sstruct/amr2d.sh | 4 +- .../hypre/src/test/TEST_sstruct/cube.jobs | 4 +- .../{cube.saved.ray => cube.saved.lassen_cpu} | 0 external/hypre/src/test/TEST_sstruct/cube.sh | 4 +- .../hypre/src/test/TEST_sstruct/cycred.jobs | 4 +- ...cred.saved.ray => cycred.saved.lassen_cpu} | 0 .../hypre/src/test/TEST_sstruct/cycred.sh | 4 +- .../src/test/TEST_sstruct/default2d.jobs | 4 +- ...d.saved.ray => default2d.saved.lassen_cpu} | 0 .../hypre/src/test/TEST_sstruct/default2d.sh | 4 +- .../src/test/TEST_sstruct/default3d.jobs | 4 +- ...d.saved.ray => default3d.saved.lassen_cpu} | 0 .../hypre/src/test/TEST_sstruct/default3d.sh | 4 +- .../src/test/TEST_sstruct/emptyProc.jobs | 2 +- .../test/TEST_sstruct/emptyProc.saved.lassen | 6 +- ...c.saved.ray => emptyProc.saved.lassen_cpu} | 12 +- .../hypre/src/test/TEST_sstruct/emptyProc.sh | 4 +- external/hypre/src/test/TEST_sstruct/io.jobs | 61 + external/hypre/src/test/TEST_sstruct/io.saved | 127 + .../src/test/TEST_sstruct/io.saved.lassen | 128 + .../src/test/TEST_sstruct/io.saved.lassen_cpu | 128 + external/hypre/src/test/TEST_sstruct/io.sh | 61 + .../hypre/src/test/TEST_sstruct/maxwell.jobs | 2 +- .../test/TEST_sstruct/maxwell.saved.lassen | 6 +- ...ell.saved.ray => maxwell.saved.lassen_cpu} | 6 +- .../hypre/src/test/TEST_sstruct/maxwell.sh | 4 +- .../hypre/src/test/TEST_sstruct/miller.jobs | 4 +- .../src/test/TEST_sstruct/miller.saved.lassen | 6 +- ...ller.saved.ray => miller.saved.lassen_cpu} | 16 +- .../hypre/src/test/TEST_sstruct/miller.sh | 4 +- .../src/test/TEST_sstruct/neighborpart.jobs | 4 +- .../src/test/TEST_sstruct/neighborpart.saved | 6 +- .../TEST_sstruct/neighborpart.saved.lassen | 6 +- ...aved.ray => neighborpart.saved.lassen_cpu} | 6 +- .../src/test/TEST_sstruct/neighborpart.sh | 4 +- .../hypre/src/test/TEST_sstruct/neumann.jobs | 4 +- ...ann.saved.ray => neumann.saved.lassen_cpu} | 0 .../hypre/src/test/TEST_sstruct/neumann.sh | 4 +- .../src/test/TEST_sstruct/nonmixedint.jobs | 4 +- ...saved.ray => nonmixedint.saved.lassen_cpu} | 0 .../src/test/TEST_sstruct/nonmixedint.sh | 4 +- .../hypre/src/test/TEST_sstruct/periodic.jobs | 4 +- ...ic.saved.ray => periodic.saved.lassen_cpu} | 0 .../hypre/src/test/TEST_sstruct/periodic.sh | 4 +- .../src/test/TEST_sstruct/sharedpart.jobs | 4 +- .../src/test/TEST_sstruct/sharedpart.saved | 6 +- .../test/TEST_sstruct/sharedpart.saved.lassen | 6 +- ....saved.ray => sharedpart.saved.lassen_cpu} | 16 +- .../hypre/src/test/TEST_sstruct/sharedpart.sh | 4 +- .../hypre/src/test/TEST_sstruct/solvers.jobs | 4 +- .../test/TEST_sstruct/solvers.saved.lassen | 10 +- ...ers.saved.ray => solvers.saved.lassen_cpu} | 20 +- .../hypre/src/test/TEST_sstruct/solvers.sh | 4 +- .../src/test/TEST_sstruct/sstruct.in.19aniso | 2 +- .../src/test/TEST_sstruct/sstruct.in.19iso | 2 +- .../src/test/TEST_sstruct/sstruct.in.7aniso | 2 +- .../src/test/TEST_sstruct/sstruct.in.7iso | 2 +- .../src/test/TEST_sstruct/sstruct.in.7zero-x | 2 +- .../src/test/TEST_sstruct/sstruct.in.7zero-y | 2 +- .../src/test/TEST_sstruct/sstruct.in.7zero-z | 2 +- .../sstruct.in.addtoval_cellcentre | 2 +- .../TEST_sstruct/sstruct.in.addtoval_edges | 2 +- .../src/test/TEST_sstruct/sstruct.in.amr.2D | 2 +- .../src/test/TEST_sstruct/sstruct.in.amr.2Db | 2 +- .../src/test/TEST_sstruct/sstruct.in.amr.2Dc | 2 +- .../src/test/TEST_sstruct/sstruct.in.amr.2De | 2 +- .../test/TEST_sstruct/sstruct.in.amr.graphadd | 2 +- .../src/test/TEST_sstruct/sstruct.in.bcube | 2 +- .../test/TEST_sstruct/sstruct.in.bcube-fem | 2 +- .../src/test/TEST_sstruct/sstruct.in.block | 2 +- .../src/test/TEST_sstruct/sstruct.in.cube | 2 +- .../src/test/TEST_sstruct/sstruct.in.cube-fem | 45 + .../src/test/TEST_sstruct/sstruct.in.cube21 | 2 +- .../test/TEST_sstruct/sstruct.in.cubes2_aniso | 99 + .../test/TEST_sstruct/sstruct.in.cubes4_27pt | 266 + .../test/TEST_sstruct/sstruct.in.cycred-1Dx | 2 +- .../test/TEST_sstruct/sstruct.in.cycred-2Dx | 2 +- .../test/TEST_sstruct/sstruct.in.cycred-2Dy | 2 +- .../test/TEST_sstruct/sstruct.in.cycred-3Dx | 2 +- .../test/TEST_sstruct/sstruct.in.cycred-3Dy | 2 +- .../test/TEST_sstruct/sstruct.in.cycred-3Dz | 2 +- .../src/test/TEST_sstruct/sstruct.in.default | 2 +- .../test/TEST_sstruct/sstruct.in.default_2D | 2 +- .../test/TEST_sstruct/sstruct.in.dirichlet | 2 +- .../test/TEST_sstruct/sstruct.in.emptyProc1 | 2 +- .../test/TEST_sstruct/sstruct.in.emptyProc2 | 2 +- .../test/TEST_sstruct/sstruct.in.emptyProc3 | 2 +- .../test/TEST_sstruct/sstruct.in.enhanced3D | 2 +- .../test/TEST_sstruct/sstruct.in.fe_all2_2D | 2 +- .../TEST_sstruct/sstruct.in.fe_all2_2D_coord | 2 +- .../test/TEST_sstruct/sstruct.in.fe_all2_2Ds | 2 +- .../test/TEST_sstruct/sstruct.in.fe_all2_2Dss | 2 +- .../test/TEST_sstruct/sstruct.in.fe_all2_3D | 2 +- .../TEST_sstruct/sstruct.in.fe_all2_3D_coord | 2 +- .../test/TEST_sstruct/sstruct.in.fe_all3_3D | 2 +- .../TEST_sstruct/sstruct.in.fe_all3_3D_coord | 2 +- .../test/TEST_sstruct/sstruct.in.fe_node1_2D | 2 +- .../test/TEST_sstruct/sstruct.in.fe_node2_2D | 2 +- .../TEST_sstruct/sstruct.in.fe_node2_2D_coord | 2 +- .../test/TEST_sstruct/sstruct.in.fe_rhombus5 | 2 +- .../src/test/TEST_sstruct/sstruct.in.laps | 2 +- .../TEST_sstruct/sstruct.in.laps.periodic | 2 +- .../src/test/TEST_sstruct/sstruct.in.marinak | 2 +- .../sstruct.in.maxwell3d_unscaled | 2 +- .../test/TEST_sstruct/sstruct.in.miller_2blk | 2 +- .../test/TEST_sstruct/sstruct.in.miller_2blk1 | 2 +- .../test/TEST_sstruct/sstruct.in.miller_2stk | 2 +- .../test/TEST_sstruct/sstruct.in.miller_3blk | 19 +- .../test/TEST_sstruct/sstruct.in.miller_diag | 2 +- .../src/test/TEST_sstruct/sstruct.in.neumann | 2 +- .../test/TEST_sstruct/sstruct.in.neumann-yz | 2 +- .../sstruct.in.noaddtoval_cellcentre | 2 +- .../TEST_sstruct/sstruct.in.noaddtoval_edges | 2 +- .../src/test/TEST_sstruct/sstruct.in.p19aniso | 2 +- .../src/test/TEST_sstruct/sstruct.in.p19iso | 2 +- .../src/test/TEST_sstruct/sstruct.in.p7aniso | 2 +- .../src/test/TEST_sstruct/sstruct.in.p7iso | 2 +- .../src/test/TEST_sstruct/sstruct.in.pcube | 2 +- .../src/test/TEST_sstruct/sstruct.in.periodic | 2 +- .../test/TEST_sstruct/sstruct.in.periodic.2D | 2 +- .../test/TEST_sstruct/sstruct.in.periodic.add | 2 +- .../TEST_sstruct/sstruct.in.periodic.bigA | 2 +- .../TEST_sstruct/sstruct.in.periodic.bigB | 2 +- .../TEST_sstruct/sstruct.in.periodic.cellA | 2 +- .../TEST_sstruct/sstruct.in.periodic.cellB | 2 +- .../TEST_sstruct/sstruct.in.periodic.nodeA | 2 +- .../TEST_sstruct/sstruct.in.periodic.nodeB | 2 +- .../test/TEST_sstruct/sstruct.in.reduced3D | 2 +- .../test/TEST_sstruct/sstruct.in.reduced3D-4 | 2 +- .../src/test/TEST_sstruct/sstruct.in.struct | 2 +- .../src/test/TEST_sstruct/sstruct.in.symm0 | 2 +- .../src/test/TEST_sstruct/sstruct.in.symm0.2D | 2 +- .../src/test/TEST_sstruct/sstruct.in.symm1 | 2 +- .../src/test/TEST_sstruct/sstruct.in.symm1.2D | 2 +- .../src/test/TEST_sstruct/sstruct.in.symm2 | 2 +- .../src/test/TEST_sstruct/sstruct.in.symm2.2D | 2 +- .../src/test/TEST_sstruct/sstruct.in.symm3 | 2 +- .../src/test/TEST_sstruct/sstruct.in.symm3.2D | 2 +- .../src/test/TEST_sstruct/sstruct.in.wide.2D | 2 +- .../src/test/TEST_sstruct/sstruct_struct.jobs | 4 +- ...ed.ray => sstruct_struct.saved.lassen_cpu} | 0 .../src/test/TEST_sstruct/sstruct_struct.sh | 4 +- .../hypre/src/test/TEST_sstruct/symm.jobs | 4 +- .../{symm.saved.ray => symm.saved.lassen_cpu} | 0 external/hypre/src/test/TEST_sstruct/symm.sh | 4 +- .../src/test/TEST_sstruct/versioncheck.jobs | 12 + .../src/test/TEST_sstruct/versioncheck.sh | 36 + .../hypre/src/test/TEST_sstruct/wide.jobs | 4 +- .../{wide.saved.ray => wide.saved.lassen_cpu} | 0 external/hypre/src/test/TEST_sstruct/wide.sh | 4 +- .../hypre/src/test/TEST_sstruct/zcube.jobs | 4 +- ...zcube.saved.ray => zcube.saved.lassen_cpu} | 0 external/hypre/src/test/TEST_sstruct/zcube.sh | 4 +- .../src/test/TEST_sstruct/zsstruct.in.bcube | 2 +- .../src/test/TEST_sstruct/zsstruct.in.cube | 2 +- .../hypre/src/test/TEST_struct/cgpfmg3d.jobs | 4 +- ...g3d.saved.ray => cgpfmg3d.saved.florentia} | 0 .../TEST_struct/cgpfmg3d.saved.lassen_cpu | 8 + .../src/test/TEST_struct/cgpfmg3d.saved.tioga | 8 + .../hypre/src/test/TEST_struct/cgpfmg3d.sh | 4 +- .../hypre/src/test/TEST_struct/emptyproc.jobs | 4 +- ...oc.saved.ray => emptyproc.saved.florentia} | 0 .../TEST_struct/emptyproc.saved.lassen_cpu | 68 + .../test/TEST_struct/emptyproc.saved.tioga | 68 + .../hypre/src/test/TEST_struct/emptyproc.sh | 4 +- .../hypre/src/test/TEST_struct/hybrid.jobs | 4 +- ...ybrid.saved.ray => hybrid.saved.florentia} | 0 .../test/TEST_struct/hybrid.saved.lassen_cpu | 20 + .../src/test/TEST_struct/hybrid.saved.tioga | 20 + external/hypre/src/test/TEST_struct/hybrid.sh | 4 +- .../src/test/TEST_struct/hybridswitch.jobs | 4 +- ...saved.ray => hybridswitch.saved.florentia} | 0 .../TEST_struct/hybridswitch.saved.lassen_cpu | 32 + .../test/TEST_struct/hybridswitch.saved.tioga | 32 + .../src/test/TEST_struct/hybridswitch.sh | 4 +- external/hypre/src/test/TEST_struct/lazy.jobs | 16 + external/hypre/src/test/TEST_struct/lazy.sh | 21 + .../hypre/src/test/TEST_struct/migrate.jobs | 4 +- ...rate.saved.ray => migrate.saved.florentia} | 0 .../test/TEST_struct/migrate.saved.lassen_cpu | 27 + .../src/test/TEST_struct/migrate.saved.tioga | 27 + .../hypre/src/test/TEST_struct/migrate.sh | 4 +- .../hypre/src/test/TEST_struct/parflow.jobs | 4 +- ...flow.saved.ray => parflow.saved.florentia} | 0 .../test/TEST_struct/parflow.saved.lassen_cpu | 24 + .../src/test/TEST_struct/parflow.saved.tioga | 24 + .../hypre/src/test/TEST_struct/parflow.sh | 4 +- .../hypre/src/test/TEST_struct/periodic.jobs | 4 +- .../test/TEST_struct/periodic.saved.florentia | 67 + ...ic.saved.ray => periodic.saved.lassen_cpu} | 0 .../src/test/TEST_struct/periodic.saved.tioga | 68 + .../hypre/src/test/TEST_struct/periodic.sh | 4 +- .../src/test/TEST_struct/pfmgbase1d.jobs | 4 +- ...d.saved.ray => pfmgbase1d.saved.florentia} | 0 .../TEST_struct/pfmgbase1d.saved.lassen_cpu | 8 + .../test/TEST_struct/pfmgbase1d.saved.tioga | 8 + .../hypre/src/test/TEST_struct/pfmgbase1d.sh | 4 +- .../src/test/TEST_struct/pfmgbase2d.jobs | 4 +- ...d.saved.ray => pfmgbase2d.saved.florentia} | 0 .../TEST_struct/pfmgbase2d.saved.lassen_cpu | 24 + .../test/TEST_struct/pfmgbase2d.saved.tioga | 24 + .../hypre/src/test/TEST_struct/pfmgbase2d.sh | 4 +- .../src/test/TEST_struct/pfmgbase3d.jobs | 4 +- ...d.saved.ray => pfmgbase3d.saved.florentia} | 0 .../TEST_struct/pfmgbase3d.saved.lassen_cpu | 32 + .../test/TEST_struct/pfmgbase3d.saved.tioga | 32 + .../hypre/src/test/TEST_struct/pfmgbase3d.sh | 4 +- .../test/TEST_struct/pfmgconstcoeffmp.jobs | 4 +- ...d.ray => pfmgconstcoeffmp.saved.florentia} | 0 .../pfmgconstcoeffmp.saved.lassen_cpu | 80 + .../TEST_struct/pfmgconstcoeffmp.saved.tioga | 80 + .../src/test/TEST_struct/pfmgconstcoeffmp.sh | 4 +- .../src/test/TEST_struct/pfmgorient.jobs | 4 +- ...t.saved.ray => pfmgorient.saved.florentia} | 0 .../TEST_struct/pfmgorient.saved.lassen_cpu | 12 + .../test/TEST_struct/pfmgorient.saved.tioga | 12 + .../hypre/src/test/TEST_struct/pfmgorient.sh | 4 +- .../src/test/TEST_struct/pfmgtest1d.jobs | 4 +- ...d.saved.ray => pfmgtest1d.saved.florentia} | 0 .../TEST_struct/pfmgtest1d.saved.lassen_cpu | 12 + .../test/TEST_struct/pfmgtest1d.saved.tioga | 12 + .../hypre/src/test/TEST_struct/pfmgtest1d.sh | 4 +- .../src/test/TEST_struct/pfmgvcycle.jobs | 4 +- ...e.saved.ray => pfmgvcycle.saved.florentia} | 0 .../TEST_struct/pfmgvcycle.saved.lassen_cpu | 8 + .../test/TEST_struct/pfmgvcycle.saved.tioga | 8 + .../hypre/src/test/TEST_struct/pfmgvcycle.sh | 4 +- .../src/test/TEST_struct/psmgbase3d.jobs | 4 +- ...d.saved.ray => psmgbase3d.saved.florentia} | 0 .../TEST_struct/psmgbase3d.saved.lassen_cpu | 20 + .../test/TEST_struct/psmgbase3d.saved.tioga | 20 + .../hypre/src/test/TEST_struct/psmgbase3d.sh | 4 +- .../src/test/TEST_struct/psmgtest3d.jobs | 4 +- ...d.saved.ray => psmgtest3d.saved.florentia} | 0 .../TEST_struct/psmgtest3d.saved.lassen_cpu | 8 + .../test/TEST_struct/psmgtest3d.saved.tioga | 8 + .../hypre/src/test/TEST_struct/psmgtest3d.sh | 4 +- .../hypre/src/test/TEST_struct/smgbase1d.jobs | 4 +- ...1d.saved.ray => smgbase1d.saved.florentia} | 0 .../TEST_struct/smgbase1d.saved.lassen_cpu | 8 + .../test/TEST_struct/smgbase1d.saved.tioga | 8 + .../hypre/src/test/TEST_struct/smgbase1d.sh | 4 +- .../hypre/src/test/TEST_struct/smgbase2d.jobs | 4 +- ...2d.saved.ray => smgbase2d.saved.florentia} | 0 .../TEST_struct/smgbase2d.saved.lassen_cpu | 20 + .../test/TEST_struct/smgbase2d.saved.tioga | 20 + .../hypre/src/test/TEST_struct/smgbase2d.sh | 4 +- .../hypre/src/test/TEST_struct/smgbase3d.jobs | 4 +- ...3d.saved.ray => smgbase3d.saved.florentia} | 0 .../TEST_struct/smgbase3d.saved.lassen_cpu | 24 + .../test/TEST_struct/smgbase3d.saved.tioga | 24 + .../hypre/src/test/TEST_struct/smgbase3d.sh | 4 +- .../hypre/src/test/TEST_struct/smgtest1d.jobs | 4 +- ...1d.saved.ray => smgtest1d.saved.florentia} | 0 .../TEST_struct/smgtest1d.saved.lassen_cpu | 12 + .../test/TEST_struct/smgtest1d.saved.tioga | 12 + .../hypre/src/test/TEST_struct/smgtest1d.sh | 4 +- .../hypre/src/test/TEST_struct/smgvcycle.jobs | 4 +- ...le.saved.ray => smgvcycle.saved.florentia} | 0 .../TEST_struct/smgvcycle.saved.lassen_cpu | 4 + .../test/TEST_struct/smgvcycle.saved.tioga | 4 + .../hypre/src/test/TEST_struct/smgvcycle.sh | 4 +- .../hypre/src/test/TEST_struct/solvers.jobs | 4 +- ...vers.saved.ray => solvers.saved.florentia} | 0 .../test/TEST_struct/solvers.saved.lassen_cpu | 20 + .../src/test/TEST_struct/solvers.saved.tioga | 20 + .../hypre/src/test/TEST_struct/solvers.sh | 4 +- .../test/TEST_struct/vcpfmgRedBlackGS.jobs | 4 +- ...d.ray => vcpfmgRedBlackGS.saved.florentia} | 0 .../vcpfmgRedBlackGS.saved.lassen_cpu | 48 + .../TEST_struct/vcpfmgRedBlackGS.saved.tioga | 48 + .../src/test/TEST_struct/vcpfmgRedBlackGS.sh | 4 +- .../test/TEST_struct/vdpfmgRedBlackGS.jobs | 4 +- ...d.ray => vdpfmgRedBlackGS.saved.florentia} | 0 .../vdpfmgRedBlackGS.saved.lassen_cpu | 48 + .../TEST_struct/vdpfmgRedBlackGS.saved.tioga | 48 + .../src/test/TEST_struct/vdpfmgRedBlackGS.sh | 4 +- .../src/test/TEST_struct/versioncheck.jobs | 12 + .../src/test/TEST_struct/versioncheck.sh | 36 + .../hypre/src/test/TEST_superlu/sludist.jobs | 4 +- .../hypre/src/test/TEST_superlu/sludist.saved | 2 +- .../hypre/src/test/TEST_superlu/sludist.sh | 4 +- .../src/test/TEST_timing/efficiency.jobs | 4 +- .../hypre/src/test/TEST_timing/efficiency.sh | 4 +- external/hypre/src/test/ams_driver.c | 293 +- external/hypre/src/test/checktest.sh | 26 +- external/hypre/src/test/cleantest.sh | 21 +- external/hypre/src/test/driver_commpkg.c | 511 +- external/hypre/src/test/ex1_for.c | 82 +- external/hypre/src/test/ex3_for.c | 108 +- external/hypre/src/test/ex5_for.c | 72 +- external/hypre/src/test/ex6_for.c | 52 +- external/hypre/src/test/ex7_for.c | 262 +- external/hypre/src/test/f77_ij.f | 64 +- external/hypre/src/test/f77_ij_mv.f | 434 - external/hypre/src/test/f77_struct.f | 2 +- external/hypre/src/test/fei.cxx | 244 +- external/hypre/src/test/fei_lscore.c | 134 +- external/hypre/src/test/fij_mv.f | 2 +- external/hypre/src/test/for_maxwell.c | 220 +- external/hypre/src/test/fparcsr_ls.f | 2 +- external/hypre/src/test/fparcsr_mv.f | 2 +- external/hypre/src/test/fsstruct_ls.f | 2 +- external/hypre/src/test/fsstruct_mv.f | 2 +- external/hypre/src/test/fstruct_ls.f | 2 +- external/hypre/src/test/fstruct_mv.f | 2 +- .../hypre/src/test/hypre_ij_fortran_test.h | 62 +- .../src/test/hypre_parcsr_fortran_test.h | 609 +- external/hypre/src/test/hypre_set_precond.c | 1231 +- .../src/test/hypre_sstruct_fortran_test.h | 314 +- .../src/test/hypre_struct_fortran_test.h | 406 +- external/hypre/src/test/hypre_test.h | 16 +- external/hypre/src/test/ij.c | 4258 +++- external/hypre/src/test/ij_assembly.c | 1012 +- external/hypre/src/test/ij_device.c | 384 +- external/hypre/src/test/ij_mm.c | 1085 +- external/hypre/src/test/ij_mv.c | 1527 -- external/hypre/src/test/maxwell_unscaled.c | 236 +- external/hypre/src/test/new_ij.c | 1758 +- external/hypre/src/test/runcheck.sh | 4 +- external/hypre/src/test/runtest.sh | 72 +- external/hypre/src/test/sstruct.c | 5745 ++--- external/hypre/src/test/sstruct.in.README | 2 +- external/hypre/src/test/sstruct_fac.c | 229 +- external/hypre/src/test/struct.c | 1098 +- external/hypre/src/test/struct_migrate.c | 117 +- external/hypre/src/test/struct_newboxloop.c | 600 +- external/hypre/src/test/test_ij.c | 3367 +-- external/hypre/src/test/test_mgr.c | 1313 - external/hypre/src/test/zboxloop.c | 240 +- external/hypre/src/utilities/CMakeLists.txt | 32 +- .../hypre/src/utilities/F90_HYPRE_error.c | 24 +- .../hypre/src/utilities/F90_HYPRE_general.c | 39 +- external/hypre/src/utilities/HYPRE_error_f.h | 2 +- external/hypre/src/utilities/HYPRE_handle.c | 53 +- .../hypre/src/utilities/HYPRE_utilities.h | 391 +- external/hypre/src/utilities/HYPRE_version.c | 2 +- .../hypre/src/utilities/_hypre_onedpl.hpp | 284 + .../hypre/src/utilities/_hypre_utilities.h | 3207 ++- .../hypre/src/utilities/_hypre_utilities.hpp | 4032 ++- external/hypre/src/utilities/amg_linklist.c | 54 +- external/hypre/src/utilities/amg_linklist.h | 2 +- external/hypre/src/utilities/ap.c | 4 +- external/hypre/src/utilities/base.h | 33 + external/hypre/src/utilities/binsearch.c | 49 +- .../src/utilities/caliper_instrumentation.h | 12 +- external/hypre/src/utilities/complex.c | 38 +- external/hypre/src/utilities/cuda_utils.c | 1420 -- external/hypre/src/utilities/cuda_utils.h | 919 - .../hypre/src/utilities/device_allocator.h | 10 +- .../{cuda_reducer.h => device_reducer.h} | 119 +- external/hypre/src/utilities/device_utils.c | 3078 +++ external/hypre/src/utilities/device_utils.h | 2063 ++ external/hypre/src/utilities/error.c | 291 +- external/hypre/src/utilities/error.h | 42 +- .../hypre/src/utilities/exchange_data.README | 2 +- external/hypre/src/utilities/exchange_data.c | 209 +- external/hypre/src/utilities/exchange_data.h | 16 +- external/hypre/src/utilities/fortran.h | 39 +- external/hypre/src/utilities/fortran_matrix.c | 273 +- external/hypre/src/utilities/fortran_matrix.h | 122 +- external/hypre/src/utilities/functors.h | 100 + external/hypre/src/utilities/general.c | 607 +- external/hypre/src/utilities/general.h | 147 +- external/hypre/src/utilities/gselim.h | 2 +- external/hypre/src/utilities/handle.c | 174 +- external/hypre/src/utilities/handle.h | 119 +- external/hypre/src/utilities/headers | 24 +- external/hypre/src/utilities/hopscotch_hash.c | 403 +- external/hypre/src/utilities/hopscotch_hash.h | 1484 +- external/hypre/src/utilities/int_array.c | 621 +- external/hypre/src/utilities/int_array.h | 33 +- .../hypre/src/utilities/int_array_device.c | 225 + external/hypre/src/utilities/log.c | 2 +- external/hypre/src/utilities/magma.c | 46 + external/hypre/src/utilities/magma.h | 71 + external/hypre/src/utilities/matrix_stats.c | 477 + external/hypre/src/utilities/matrix_stats.h | 130 + external/hypre/src/utilities/memory.c | 1366 +- external/hypre/src/utilities/memory.h | 163 +- external/hypre/src/utilities/memory_dmalloc.c | 8 +- external/hypre/src/utilities/memory_tracker.c | 638 + external/hypre/src/utilities/memory_tracker.h | 176 + external/hypre/src/utilities/merge_sort.c | 185 +- external/hypre/src/utilities/mmio.c | 175 + external/hypre/src/utilities/mmio.h | 120 + external/hypre/src/utilities/mpi_comm_f2c.c | 10 +- external/hypre/src/utilities/mpistubs.c | 428 +- external/hypre/src/utilities/mpistubs.h | 142 +- external/hypre/src/utilities/nvtx.c | 31 +- external/hypre/src/utilities/omp_device.c | 5 +- external/hypre/src/utilities/omp_device.h | 11 +- external/hypre/src/utilities/predicates.h | 43 + external/hypre/src/utilities/prefix_sum.c | 80 +- external/hypre/src/utilities/printf.c | 77 +- external/hypre/src/utilities/printf.h | 16 +- external/hypre/src/utilities/protos | 4 +- external/hypre/src/utilities/protos.h | 316 +- external/hypre/src/utilities/qsort.c | 170 +- external/hypre/src/utilities/qsplit.c | 38 +- external/hypre/src/utilities/random.c | 14 +- external/hypre/src/utilities/smp.h | 2 +- external/hypre/src/utilities/state.c | 88 + external/hypre/src/utilities/state.h | 24 + external/hypre/src/utilities/stl_ops.c | 53 + .../hypre/src/utilities/thread_protos.awk | 2 +- .../hypre/src/utilities/thread_wrappers.awk | 2 +- external/hypre/src/utilities/threading.c | 14 +- external/hypre/src/utilities/threading.h | 2 +- external/hypre/src/utilities/timer.c | 24 +- external/hypre/src/utilities/timing.c | 125 +- external/hypre/src/utilities/timing.h | 8 +- external/hypre/src/utilities/utilities.c | 209 +- external/hypre/src/utilities/version.sh | 4 +- 1904 files changed, 371814 insertions(+), 124561 deletions(-) create mode 100644 external/hypre/.gitignore create mode 100644 external/hypre/.readthedocs.yml mode change 100644 => 100755 external/hypre/AUTOTEST/basic.sh mode change 100644 => 100755 external/hypre/AUTOTEST/check-case.sh mode change 100644 => 100755 external/hypre/AUTOTEST/check-double.sh mode change 100644 => 100755 external/hypre/AUTOTEST/check-glob-symb.sh mode change 100644 => 100755 external/hypre/AUTOTEST/check-headers.sh mode change 100644 => 100755 external/hypre/AUTOTEST/check-int.sh mode change 100644 => 100755 external/hypre/AUTOTEST/check-license.sh mode change 100644 => 100755 external/hypre/AUTOTEST/check-mem.sh mode change 100644 => 100755 external/hypre/AUTOTEST/check-mpi.sh mode change 100644 => 100755 external/hypre/AUTOTEST/cleantest.sh mode change 100644 => 100755 external/hypre/AUTOTEST/cmake.bat create mode 100644 external/hypre/AUTOTEST/cmake.filters mode change 100644 => 100755 external/hypre/AUTOTEST/cmake.sh mode change 100644 => 100755 external/hypre/AUTOTEST/configure.sh mode change 100644 => 100755 external/hypre/AUTOTEST/docs.sh mode change 100644 => 100755 external/hypre/AUTOTEST/examples.sh mode change 100644 => 100755 external/hypre/AUTOTEST/klocwork.sh mode change 100644 => 100755 external/hypre/AUTOTEST/link.sh create mode 100755 external/hypre/AUTOTEST/machine-aurora.sh create mode 100755 external/hypre/AUTOTEST/machine-lassen-cuda.sh create mode 100755 external/hypre/AUTOTEST/machine-lassen-exlibs.sh mode change 100644 => 100755 external/hypre/AUTOTEST/machine-lassen.sh mode change 100644 => 100755 external/hypre/AUTOTEST/machine-mac.sh delete mode 100644 external/hypre/AUTOTEST/machine-ray.sh rename external/hypre/AUTOTEST/{machine-rztopaz.sh => machine-rzhound.sh} (89%) mode change 100644 => 100755 mode change 100644 => 100755 external/hypre/AUTOTEST/machine-syrah.sh create mode 100755 external/hypre/AUTOTEST/machine-tioga.sh mode change 100644 => 100755 external/hypre/AUTOTEST/machine-tux-compilers.sh mode change 100644 => 100755 external/hypre/AUTOTEST/machine-tux-exlibs.sh mode change 100644 => 100755 external/hypre/AUTOTEST/machine-tux-spack.sh mode change 100644 => 100755 external/hypre/AUTOTEST/machine-tux.sh mode change 100644 => 100755 external/hypre/AUTOTEST/machine-vs-pro.bat mode change 100644 => 100755 external/hypre/AUTOTEST/make.sh mode change 100644 => 100755 external/hypre/AUTOTEST/renametest.sh mode change 100644 => 100755 external/hypre/AUTOTEST/run.sh create mode 100644 external/hypre/AUTOTEST/runtests-error create mode 100644 external/hypre/AUTOTEST/runtests-gpumemcheck create mode 100644 external/hypre/AUTOTEST/runtests-ij-noilu mode change 100644 => 100755 external/hypre/AUTOTEST/test.sh mode change 100644 => 100755 external/hypre/src/IJ_mv/headers delete mode 100644 external/hypre/src/cmbuild/README.txt create mode 100755 external/hypre/src/config/astyle-apply.sh create mode 100644 external/hypre/src/config/astylerc create mode 100644 external/hypre/src/config/cmake/HYPRE_SetupGPUToolkit.cmake create mode 100644 external/hypre/src/config/cmake/HYPRE_SetupHIPToolkit.cmake create mode 100644 external/hypre/src/config/cmake/HYPRE_SetupSYCLToolkit.cmake mode change 100644 => 100755 external/hypre/src/config/config.guess mode change 100644 => 100755 external/hypre/src/config/config.sub create mode 100644 external/hypre/src/config/githooks/README.md create mode 100755 external/hypre/src/config/githooks/pre-commit mode change 100644 => 100755 external/hypre/src/config/install-sh mode change 100644 => 100755 external/hypre/src/config/mkinstalldirs create mode 100755 external/hypre/src/config/update-cmake.py create mode 100755 external/hypre/src/config/update-cmake.sh mode change 100644 => 100755 external/hypre/src/config/update.sh mode change 100644 => 100755 external/hypre/src/config/version.sh mode change 100644 => 100755 external/hypre/src/configure mode change 100644 => 100755 external/hypre/src/distributed_ls/Euclid/headers mode change 100644 => 100755 external/hypre/src/docs/update-release.sh create mode 100644 external/hypre/src/docs/usr-manual/bw-hypre-nwords.512.png create mode 100644 external/hypre/src/docs/usr-manual/dummy.png create mode 100644 external/hypre/src/docs/usr-manual/hypre-nwords.512.png delete mode 100644 external/hypre/src/docs/usr-manual/hypre_wiw.svg create mode 100644 external/hypre/src/docs/usr-manual/solvers-fsai.rst delete mode 100644 external/hypre/src/docs/usr-manual/solvers-hypre-ilu.rst create mode 100644 external/hypre/src/docs/usr-manual/solvers-ilu.rst delete mode 100644 external/hypre/src/examples/Makefile_gpu create mode 100644 external/hypre/src/examples/cudaf.f mode change 100644 => 100755 external/hypre/src/examples/docs/build_doc.sh mode change 100644 => 100755 external/hypre/src/examples/docs/code2html.perl mode change 100644 => 100755 external/hypre/src/examples/docs/replace-ssi.perl create mode 100644 external/hypre/src/examples/ex12cuf.cuf create mode 100644 external/hypre/src/examples/ex12f_cptr.f create mode 100644 external/hypre/src/examples/ex5cuf.cuf create mode 100644 external/hypre/src/examples/ex5f_cptr.f mode change 100644 => 100755 external/hypre/src/examples/vis/glvis-ex1.sh mode change 100644 => 100755 external/hypre/src/examples/vis/glvis-ex10.sh mode change 100644 => 100755 external/hypre/src/examples/vis/glvis-ex11.sh mode change 100644 => 100755 external/hypre/src/examples/vis/glvis-ex12.sh mode change 100644 => 100755 external/hypre/src/examples/vis/glvis-ex13.sh mode change 100644 => 100755 external/hypre/src/examples/vis/glvis-ex14.sh mode change 100644 => 100755 external/hypre/src/examples/vis/glvis-ex15.sh mode change 100644 => 100755 external/hypre/src/examples/vis/glvis-ex16.sh mode change 100644 => 100755 external/hypre/src/examples/vis/glvis-ex2.sh mode change 100644 => 100755 external/hypre/src/examples/vis/glvis-ex3.sh mode change 100644 => 100755 external/hypre/src/examples/vis/glvis-ex4.sh mode change 100644 => 100755 external/hypre/src/examples/vis/glvis-ex5.sh mode change 100644 => 100755 external/hypre/src/examples/vis/glvis-ex6.sh mode change 100644 => 100755 external/hypre/src/examples/vis/glvis-ex7.sh mode change 100644 => 100755 external/hypre/src/examples/vis/glvis-ex8.sh mode change 100644 => 100755 external/hypre/src/examples/vis/glvis-ex9.sh delete mode 100644 external/hypre/src/krylov/headers mode change 100644 => 100755 external/hypre/src/nopoe create mode 100644 external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_ilu.c create mode 100644 external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_mgr.c create mode 100644 external/hypre/src/parcsr_ls/HYPRE_parcsr_fsai.c mode change 100644 => 100755 external/hypre/src/parcsr_ls/headers create mode 100644 external/hypre/src/parcsr_ls/par_fsai.c create mode 100644 external/hypre/src/parcsr_ls/par_fsai.h create mode 100644 external/hypre/src/parcsr_ls/par_fsai_device.c create mode 100644 external/hypre/src/parcsr_ls/par_fsai_setup.c create mode 100644 external/hypre/src/parcsr_ls/par_fsai_solve.c create mode 100644 external/hypre/src/parcsr_ls/par_ge_device.c create mode 100644 external/hypre/src/parcsr_ls/par_ilu_setup_device.c create mode 100644 external/hypre/src/parcsr_ls/par_ilu_solve_device.c create mode 100644 external/hypre/src/parcsr_ls/par_mgr_coarsen.c create mode 100644 external/hypre/src/parcsr_ls/par_mgr_device.c create mode 100644 external/hypre/src/parcsr_ls/par_mgr_interp.c create mode 100644 external/hypre/src/parcsr_ls/par_mgr_rap.c create mode 100644 external/hypre/src/parcsr_ls/par_mgr_stats.c create mode 100644 external/hypre/src/parcsr_ls/par_mod_multi_interp.c create mode 100644 external/hypre/src/parcsr_ls/par_mod_multi_interp_device.c mode change 100644 => 100755 external/hypre/src/parcsr_mv/headers create mode 100644 external/hypre/src/parcsr_mv/par_csr_filter.c create mode 100644 external/hypre/src/parcsr_mv/par_csr_filter_device.c create mode 100644 external/hypre/src/parcsr_mv/par_csr_matmat.c create mode 100644 external/hypre/src/parcsr_mv/par_csr_matmat_device.c create mode 100644 external/hypre/src/parcsr_mv/par_csr_matrix_stats.c create mode 100644 external/hypre/src/parcsr_mv/par_csr_matvec_device.c create mode 100644 external/hypre/src/seq_block_mv/CMakeLists.txt create mode 100644 external/hypre/src/seq_block_mv/_hypre_seq_block_mv.h create mode 100644 external/hypre/src/seq_block_mv/dense_block_matmult.c create mode 100644 external/hypre/src/seq_block_mv/dense_block_matrix.c create mode 100644 external/hypre/src/seq_block_mv/dense_block_matrix.h create mode 100755 external/hypre/src/seq_block_mv/headers create mode 100644 external/hypre/src/seq_block_mv/protos.h create mode 100644 external/hypre/src/seq_mv/.gitignore create mode 100644 external/hypre/src/seq_mv/csr_filter.c delete mode 100644 external/hypre/src/seq_mv/csr_spgemm_device_attempt.c delete mode 100644 external/hypre/src/seq_mv/csr_spgemm_device_confident.c create mode 100644 external/hypre/src/seq_mv/csr_spgemm_device_numblocks.c create mode 100644 external/hypre/src/seq_mv/csr_spgemm_device_numer.c create mode 100644 external/hypre/src/seq_mv/csr_spgemm_device_numer.h create mode 100644 external/hypre/src/seq_mv/csr_spgemm_device_numer.in create mode 100644 external/hypre/src/seq_mv/csr_spgemm_device_onemklsparse.c delete mode 100644 external/hypre/src/seq_mv/csr_spgemm_device_rowbound.c create mode 100644 external/hypre/src/seq_mv/csr_spgemm_device_symbl.c create mode 100644 external/hypre/src/seq_mv/csr_spgemm_device_symbl.h create mode 100644 external/hypre/src/seq_mv/csr_spgemm_device_symbl.in create mode 100644 external/hypre/src/seq_mv/csr_spmv_device.h mode change 100644 => 100755 external/hypre/src/seq_mv/headers create mode 100644 external/hypre/src/seq_mv/vector_device.c delete mode 100644 external/hypre/src/sstruct_ls/headers mode change 100644 => 100755 external/hypre/src/sstruct_mv/headers mode change 100644 => 100755 external/hypre/src/struct_ls/headers create mode 100644 external/hypre/src/struct_mv/boxloop_sycl.h mode change 100644 => 100755 external/hypre/src/struct_mv/headers mode change 100644 => 100755 external/hypre/src/tarch mode change 100644 => 100755 external/hypre/src/test/TEST_ams/solvers.jobs create mode 100644 external/hypre/src/test/TEST_ams/solvers.saved.lassen_cpu delete mode 100644 external/hypre/src/test/TEST_ams/solvers.saved.ray create mode 100644 external/hypre/src/test/TEST_ams/solvers.saved.tioga mode change 100644 => 100755 external/hypre/src/test/TEST_ams/solvers.sh mode change 100644 => 100755 external/hypre/src/test/TEST_bench/benchmark_ij.jobs delete mode 100644 external/hypre/src/test/TEST_bench/benchmark_ij.perf.saved.ray create mode 100644 external/hypre/src/test/TEST_bench/benchmark_ij.perf.saved.tioga delete mode 100644 external/hypre/src/test/TEST_bench/benchmark_ij.saved.ray create mode 100644 external/hypre/src/test/TEST_bench/benchmark_ij.saved.tioga mode change 100644 => 100755 external/hypre/src/test/TEST_bench/benchmark_ij.sh create mode 100755 external/hypre/src/test/TEST_bench/benchmark_spgemm.jobs create mode 100644 external/hypre/src/test/TEST_bench/benchmark_spgemm.perf.saved.lassen create mode 100644 external/hypre/src/test/TEST_bench/benchmark_spgemm.perf.saved.tioga create mode 100644 external/hypre/src/test/TEST_bench/benchmark_spgemm.saved.lassen create mode 100644 external/hypre/src/test/TEST_bench/benchmark_spgemm.saved.tioga create mode 100755 external/hypre/src/test/TEST_bench/benchmark_spgemm.sh mode change 100644 => 100755 external/hypre/src/test/TEST_bench/benchmark_struct.jobs delete mode 100644 external/hypre/src/test/TEST_bench/benchmark_struct.perf.saved.ray create mode 100644 external/hypre/src/test/TEST_bench/benchmark_struct.perf.saved.tioga rename external/hypre/src/test/TEST_bench/{benchmark_struct.saved.ray => benchmark_struct.saved.tioga} (100%) mode change 100644 => 100755 external/hypre/src/test/TEST_bench/benchmark_struct.sh create mode 100755 external/hypre/src/test/TEST_error/error.jobs create mode 100644 external/hypre/src/test/TEST_error/error.saved create mode 100644 external/hypre/src/test/TEST_error/error.saved.lassen create mode 100755 external/hypre/src/test/TEST_error/error.sh mode change 100644 => 100755 external/hypre/src/test/TEST_examples/bigint.jobs mode change 100644 => 100755 external/hypre/src/test/TEST_examples/bigint.sh mode change 100644 => 100755 external/hypre/src/test/TEST_examples/complex.jobs mode change 100644 => 100755 external/hypre/src/test/TEST_examples/complex.sh mode change 100644 => 100755 external/hypre/src/test/TEST_examples/default.jobs mode change 100644 => 100755 external/hypre/src/test/TEST_examples/default.sh mode change 100644 => 100755 external/hypre/src/test/TEST_examples/fortran_examples.jobs mode change 100644 => 100755 external/hypre/src/test/TEST_examples/fortran_examples.sh mode change 100644 => 100755 external/hypre/src/test/TEST_examples/gpu.jobs delete mode 100644 external/hypre/src/test/TEST_examples/gpu.saved.ray mode change 100644 => 100755 external/hypre/src/test/TEST_examples/gpu.sh mode change 100644 => 100755 external/hypre/src/test/TEST_examples/maxdim.jobs mode change 100644 => 100755 external/hypre/src/test/TEST_examples/maxdim.sh mode change 100644 => 100755 external/hypre/src/test/TEST_fac/sstruct_fac.jobs mode change 100644 => 100755 external/hypre/src/test/TEST_fac/sstruct_fac.sh mode change 100644 => 100755 external/hypre/src/test/TEST_fei/solvers.jobs mode change 100644 => 100755 external/hypre/src/test/TEST_fei/solvers.sh create mode 100644 external/hypre/src/test/TEST_gpumemcheck/gpu.jobs create mode 100644 external/hypre/src/test/TEST_gpumemcheck/gpu.saved.lassen create mode 100755 external/hypre/src/test/TEST_gpumemcheck/gpu.sh mode change 100644 => 100755 external/hypre/src/test/TEST_ij/agg_interp.jobs create mode 100644 external/hypre/src/test/TEST_ij/agg_interp.saved.aurora create mode 100644 external/hypre/src/test/TEST_ij/agg_interp.saved.lassen_cpu delete mode 100644 external/hypre/src/test/TEST_ij/agg_interp.saved.ray mode change 100644 => 100755 external/hypre/src/test/TEST_ij/agg_interp.sh mode change 100644 => 100755 external/hypre/src/test/TEST_ij/air.jobs create mode 100644 external/hypre/src/test/TEST_ij/air.saved.aurora create mode 100644 external/hypre/src/test/TEST_ij/air.saved.lassen_cpu delete mode 100644 external/hypre/src/test/TEST_ij/air.saved.ray mode change 100644 => 100755 external/hypre/src/test/TEST_ij/air.sh mode change 100644 => 100755 external/hypre/src/test/TEST_ij/amgdd.jobs create mode 100644 external/hypre/src/test/TEST_ij/amgdd.saved.aurora create mode 100644 external/hypre/src/test/TEST_ij/amgdd.saved.lassen_cpu delete mode 100644 external/hypre/src/test/TEST_ij/amgdd.saved.ray mode change 100644 => 100755 external/hypre/src/test/TEST_ij/amgdd.sh create mode 100755 external/hypre/src/test/TEST_ij/assembly.jobs create mode 100755 external/hypre/src/test/TEST_ij/assembly.sh mode change 100644 => 100755 external/hypre/src/test/TEST_ij/coarsening.jobs rename external/hypre/src/test/TEST_ij/{coarsening.saved.ray => coarsening.saved.aurora} (61%) create mode 100644 external/hypre/src/test/TEST_ij/coarsening.saved.lassen_cpu mode change 100644 => 100755 external/hypre/src/test/TEST_ij/coarsening.sh create mode 100644 external/hypre/src/test/TEST_ij/data/beam_hex_dof459_np2/A.IJ.00000 create mode 100644 external/hypre/src/test/TEST_ij/data/beam_hex_dof459_np2/A.IJ.00001 create mode 100644 external/hypre/src/test/TEST_ij/data/beam_hex_dof459_np2/b.IJ.00000 create mode 100644 external/hypre/src/test/TEST_ij/data/beam_hex_dof459_np2/b.IJ.00001 create mode 100644 external/hypre/src/test/TEST_ij/data/beam_hex_dof459_np2/mfem.txt create mode 100644 external/hypre/src/test/TEST_ij/data/beam_hex_dof459_np2/rbms.0.00000 create mode 100644 external/hypre/src/test/TEST_ij/data/beam_hex_dof459_np2/rbms.0.00001 create mode 100644 external/hypre/src/test/TEST_ij/data/beam_hex_dof459_np2/rbms.1.00000 create mode 100644 external/hypre/src/test/TEST_ij/data/beam_hex_dof459_np2/rbms.1.00001 create mode 100644 external/hypre/src/test/TEST_ij/data/beam_hex_dof459_np2/rbms.2.00000 create mode 100644 external/hypre/src/test/TEST_ij/data/beam_hex_dof459_np2/rbms.2.00001 create mode 100644 external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/A.IJ.00000 create mode 100644 external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/A.IJ.00001 create mode 100644 external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/A.IJ.00002 create mode 100644 external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/A.IJ.00003 create mode 100644 external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/b.IJ.00000 create mode 100644 external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/b.IJ.00001 create mode 100644 external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/b.IJ.00002 create mode 100644 external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/b.IJ.00003 create mode 100644 external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/mfem.txt create mode 100644 external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.0.00000 create mode 100644 external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.0.00001 create mode 100644 external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.0.00002 create mode 100644 external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.0.00003 create mode 100644 external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.1.00000 create mode 100644 external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.1.00001 create mode 100644 external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.1.00002 create mode 100644 external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.1.00003 create mode 100644 external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.2.00000 create mode 100644 external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.2.00001 create mode 100644 external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.2.00002 create mode 100644 external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.2.00003 create mode 100644 external/hypre/src/test/TEST_ij/data/beam_tet_dof459_np1/A.IJ.00000 create mode 100644 external/hypre/src/test/TEST_ij/data/beam_tet_dof459_np1/b.IJ.00000 create mode 100644 external/hypre/src/test/TEST_ij/data/beam_tet_dof459_np1/mfem.txt create mode 100644 external/hypre/src/test/TEST_ij/data/beam_tet_dof459_np1/rbms.0.00000 create mode 100644 external/hypre/src/test/TEST_ij/data/beam_tet_dof459_np1/rbms.1.00000 create mode 100644 external/hypre/src/test/TEST_ij/data/beam_tet_dof459_np1/rbms.2.00000 create mode 100755 external/hypre/src/test/TEST_ij/data/generate_poisson_10x10x10.sh create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np1/IJ.A.i4f4.00000.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np1/IJ.A.i4f8.00000.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np1/IJ.A.i8f4.00000.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np1/IJ.A.i8f8.00000.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np1/IJ.b.i4f4.00000.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np1/IJ.b.i4f8.00000.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np1/IJ.b.i8f4.00000.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np1/IJ.b.i8f8.00000.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np1/IJ.x0.i4f4.00000.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np1/IJ.x0.i4f8.00000.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np1/IJ.x0.i8f4.00000.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np1/IJ.x0.i8f8.00000.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.A.i4f4.00000.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.A.i4f4.00001.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.A.i4f4.00002.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.A.i4f4.00003.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.A.i4f8.00000.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.A.i4f8.00001.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.A.i4f8.00002.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.A.i4f8.00003.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.A.i8f4.00000.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.A.i8f4.00001.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.A.i8f4.00002.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.A.i8f4.00003.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.A.i8f8.00000.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.A.i8f8.00001.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.A.i8f8.00002.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.A.i8f8.00003.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.b.i4f4.00000.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.b.i4f4.00001.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.b.i4f4.00002.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.b.i4f4.00003.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.b.i4f8.00000.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.b.i4f8.00001.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.b.i4f8.00002.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.b.i4f8.00003.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.b.i8f4.00000.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.b.i8f4.00001.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.b.i8f4.00002.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.b.i8f4.00003.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.b.i8f8.00000.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.b.i8f8.00001.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.b.i8f8.00002.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.b.i8f8.00003.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.x0.i4f4.00000.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.x0.i4f4.00001.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.x0.i4f4.00002.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.x0.i4f4.00003.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.x0.i4f8.00000.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.x0.i4f8.00001.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.x0.i4f8.00002.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.x0.i4f8.00003.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.x0.i8f4.00000.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.x0.i8f4.00001.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.x0.i8f4.00002.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.x0.i8f4.00003.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.x0.i8f8.00000.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.x0.i8f8.00001.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.x0.i8f8.00002.bin create mode 100644 external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.x0.i8f8.00003.bin create mode 100644 external/hypre/src/test/TEST_ij/data/tucker21935/IJ.A.00000 create mode 100644 external/hypre/src/test/TEST_ij/data/tucker21935/IJ.A.00001 create mode 100644 external/hypre/src/test/TEST_ij/data/tucker21935/IJ.A.00002 create mode 100644 external/hypre/src/test/TEST_ij/data/tucker21935/IJ.A.00003 mode change 100644 => 100755 external/hypre/src/test/TEST_ij/default.jobs create mode 100644 external/hypre/src/test/TEST_ij/default.saved.aurora create mode 100644 external/hypre/src/test/TEST_ij/default.saved.lassen_cpu delete mode 100644 external/hypre/src/test/TEST_ij/default.saved.ray mode change 100644 => 100755 external/hypre/src/test/TEST_ij/default.sh mode change 100644 => 100755 external/hypre/src/test/TEST_ij/elast.jobs create mode 100644 external/hypre/src/test/TEST_ij/elast.saved.aurora rename external/hypre/src/test/TEST_ij/{elast.saved.ray => elast.saved.lassen_cpu} (51%) mode change 100644 => 100755 external/hypre/src/test/TEST_ij/elast.sh create mode 100755 external/hypre/src/test/TEST_ij/fsai.jobs create mode 100644 external/hypre/src/test/TEST_ij/fsai.saved create mode 100644 external/hypre/src/test/TEST_ij/fsai.saved.aurora create mode 100644 external/hypre/src/test/TEST_ij/fsai.saved.lassen create mode 100644 external/hypre/src/test/TEST_ij/fsai.saved.lassen_cpu create mode 100755 external/hypre/src/test/TEST_ij/fsai.sh create mode 100755 external/hypre/src/test/TEST_ij/ilu.jobs create mode 100644 external/hypre/src/test/TEST_ij/ilu.saved create mode 100644 external/hypre/src/test/TEST_ij/ilu.saved.aurora create mode 100644 external/hypre/src/test/TEST_ij/ilu.saved.lassen create mode 100644 external/hypre/src/test/TEST_ij/ilu.saved.lassen_cpu create mode 100755 external/hypre/src/test/TEST_ij/ilu.sh mode change 100644 => 100755 external/hypre/src/test/TEST_ij/interp.jobs create mode 100644 external/hypre/src/test/TEST_ij/interp.saved.aurora create mode 100644 external/hypre/src/test/TEST_ij/interp.saved.lassen_cpu delete mode 100644 external/hypre/src/test/TEST_ij/interp.saved.ray mode change 100644 => 100755 external/hypre/src/test/TEST_ij/interp.sh create mode 100755 external/hypre/src/test/TEST_ij/io.jobs create mode 100644 external/hypre/src/test/TEST_ij/io.saved create mode 100755 external/hypre/src/test/TEST_ij/io.sh create mode 100755 external/hypre/src/test/TEST_ij/lazy.jobs create mode 100755 external/hypre/src/test/TEST_ij/lazy.sh mode change 100644 => 100755 external/hypre/src/test/TEST_ij/matrix.jobs rename external/hypre/src/test/TEST_ij/{matrix.saved.ray => matrix.saved.aurora} (54%) create mode 100644 external/hypre/src/test/TEST_ij/matrix.saved.lassen_cpu mode change 100644 => 100755 external/hypre/src/test/TEST_ij/matrix.sh mode change 100644 => 100755 external/hypre/src/test/TEST_ij/nonmixedint.jobs rename external/hypre/src/test/TEST_ij/{nonmixedint.saved.ray => nonmixedint.saved.aurora} (85%) create mode 100644 external/hypre/src/test/TEST_ij/nonmixedint.saved.lassen_cpu mode change 100644 => 100755 external/hypre/src/test/TEST_ij/nonmixedint.sh create mode 100755 external/hypre/src/test/TEST_ij/posneg.jobs create mode 100755 external/hypre/src/test/TEST_ij/posneg.sh mode change 100644 => 100755 external/hypre/src/test/TEST_ij/smoother.jobs create mode 100644 external/hypre/src/test/TEST_ij/smoother.saved.aurora create mode 100644 external/hypre/src/test/TEST_ij/smoother.saved.lassen_cpu delete mode 100644 external/hypre/src/test/TEST_ij/smoother.saved.ray mode change 100644 => 100755 external/hypre/src/test/TEST_ij/smoother.sh mode change 100644 => 100755 external/hypre/src/test/TEST_ij/solvers.jobs create mode 100644 external/hypre/src/test/TEST_ij/solvers.saved.aurora create mode 100644 external/hypre/src/test/TEST_ij/solvers.saved.lassen_cpu delete mode 100644 external/hypre/src/test/TEST_ij/solvers.saved.ray mode change 100644 => 100755 external/hypre/src/test/TEST_ij/solvers.sh create mode 100755 external/hypre/src/test/TEST_ij/state.jobs create mode 100644 external/hypre/src/test/TEST_ij/state.saved create mode 100644 external/hypre/src/test/TEST_ij/state.saved.aurora create mode 100644 external/hypre/src/test/TEST_ij/state.saved.lassen create mode 100644 external/hypre/src/test/TEST_ij/state.saved.lassen_cpu create mode 100755 external/hypre/src/test/TEST_ij/state.sh create mode 100644 external/hypre/src/test/TEST_ij/tst.00000 create mode 100644 external/hypre/src/test/TEST_ij/tst.00001 create mode 100755 external/hypre/src/test/TEST_ij/vector.jobs create mode 100644 external/hypre/src/test/TEST_ij/vector.saved create mode 100644 external/hypre/src/test/TEST_ij/vector.saved.aurora create mode 100644 external/hypre/src/test/TEST_ij/vector.saved.lassen create mode 100644 external/hypre/src/test/TEST_ij/vector.saved.lassen_cpu create mode 100755 external/hypre/src/test/TEST_ij/vector.sh create mode 100755 external/hypre/src/test/TEST_ij/versioncheck.jobs create mode 100755 external/hypre/src/test/TEST_ij/versioncheck.sh mode change 100644 => 100755 external/hypre/src/test/TEST_lobpcg/ijdefault.jobs mode change 100644 => 100755 external/hypre/src/test/TEST_lobpcg/ijdefault.sh mode change 100644 => 100755 external/hypre/src/test/TEST_lobpcg/ijoptions.jobs mode change 100644 => 100755 external/hypre/src/test/TEST_lobpcg/ijoptions.sh mode change 100644 => 100755 external/hypre/src/test/TEST_lobpcg/nonmixedint.jobs mode change 100644 => 100755 external/hypre/src/test/TEST_lobpcg/nonmixedint.sh mode change 100644 => 100755 external/hypre/src/test/TEST_lobpcg/sstruct.jobs mode change 100644 => 100755 external/hypre/src/test/TEST_lobpcg/sstruct.sh mode change 100644 => 100755 external/hypre/src/test/TEST_lobpcg/struct.jobs mode change 100644 => 100755 external/hypre/src/test/TEST_lobpcg/struct.sh mode change 100644 => 100755 external/hypre/src/test/TEST_longdouble/solvers_ij.jobs mode change 100644 => 100755 external/hypre/src/test/TEST_longdouble/solvers_ij.sh mode change 100644 => 100755 external/hypre/src/test/TEST_longdouble/solvers_struct.sh mode change 100644 => 100755 external/hypre/src/test/TEST_single/solvers_ij.jobs create mode 100644 external/hypre/src/test/TEST_single/solvers_ij.saved.lassen mode change 100644 => 100755 external/hypre/src/test/TEST_single/solvers_ij.sh mode change 100644 => 100755 external/hypre/src/test/TEST_single/solvers_struct.jobs create mode 100644 external/hypre/src/test/TEST_single/solvers_struct.saved.lassen mode change 100644 => 100755 external/hypre/src/test/TEST_single/solvers_struct.sh mode change 100644 => 100755 external/hypre/src/test/TEST_sstruct/addtovalues.jobs rename external/hypre/src/test/TEST_sstruct/{addtovalues.saved.ray => addtovalues.saved.lassen_cpu} (68%) mode change 100644 => 100755 external/hypre/src/test/TEST_sstruct/addtovalues.sh mode change 100644 => 100755 external/hypre/src/test/TEST_sstruct/amr2d.jobs rename external/hypre/src/test/TEST_sstruct/{amr2d.saved.ray => amr2d.saved.lassen_cpu} (69%) mode change 100644 => 100755 external/hypre/src/test/TEST_sstruct/amr2d.sh mode change 100644 => 100755 external/hypre/src/test/TEST_sstruct/cube.jobs rename external/hypre/src/test/TEST_sstruct/{cube.saved.ray => cube.saved.lassen_cpu} (100%) mode change 100644 => 100755 external/hypre/src/test/TEST_sstruct/cube.sh mode change 100644 => 100755 external/hypre/src/test/TEST_sstruct/cycred.jobs rename external/hypre/src/test/TEST_sstruct/{cycred.saved.ray => cycred.saved.lassen_cpu} (100%) mode change 100644 => 100755 external/hypre/src/test/TEST_sstruct/cycred.sh mode change 100644 => 100755 external/hypre/src/test/TEST_sstruct/default2d.jobs rename external/hypre/src/test/TEST_sstruct/{default2d.saved.ray => default2d.saved.lassen_cpu} (100%) mode change 100644 => 100755 external/hypre/src/test/TEST_sstruct/default2d.sh mode change 100644 => 100755 external/hypre/src/test/TEST_sstruct/default3d.jobs rename external/hypre/src/test/TEST_sstruct/{default3d.saved.ray => default3d.saved.lassen_cpu} (100%) mode change 100644 => 100755 external/hypre/src/test/TEST_sstruct/default3d.sh mode change 100644 => 100755 external/hypre/src/test/TEST_sstruct/emptyProc.jobs rename external/hypre/src/test/TEST_sstruct/{emptyProc.saved.ray => emptyProc.saved.lassen_cpu} (94%) mode change 100644 => 100755 external/hypre/src/test/TEST_sstruct/emptyProc.sh create mode 100644 external/hypre/src/test/TEST_sstruct/io.jobs create mode 100644 external/hypre/src/test/TEST_sstruct/io.saved create mode 100644 external/hypre/src/test/TEST_sstruct/io.saved.lassen create mode 100644 external/hypre/src/test/TEST_sstruct/io.saved.lassen_cpu create mode 100755 external/hypre/src/test/TEST_sstruct/io.sh mode change 100644 => 100755 external/hypre/src/test/TEST_sstruct/maxwell.jobs rename external/hypre/src/test/TEST_sstruct/{maxwell.saved.ray => maxwell.saved.lassen_cpu} (51%) mode change 100644 => 100755 external/hypre/src/test/TEST_sstruct/maxwell.sh mode change 100644 => 100755 external/hypre/src/test/TEST_sstruct/miller.jobs rename external/hypre/src/test/TEST_sstruct/{miller.saved.ray => miller.saved.lassen_cpu} (73%) mode change 100644 => 100755 external/hypre/src/test/TEST_sstruct/miller.sh mode change 100644 => 100755 external/hypre/src/test/TEST_sstruct/neighborpart.jobs rename external/hypre/src/test/TEST_sstruct/{neighborpart.saved.ray => neighborpart.saved.lassen_cpu} (92%) mode change 100644 => 100755 external/hypre/src/test/TEST_sstruct/neighborpart.sh mode change 100644 => 100755 external/hypre/src/test/TEST_sstruct/neumann.jobs rename external/hypre/src/test/TEST_sstruct/{neumann.saved.ray => neumann.saved.lassen_cpu} (100%) mode change 100644 => 100755 external/hypre/src/test/TEST_sstruct/neumann.sh mode change 100644 => 100755 external/hypre/src/test/TEST_sstruct/nonmixedint.jobs rename external/hypre/src/test/TEST_sstruct/{nonmixedint.saved.ray => nonmixedint.saved.lassen_cpu} (100%) mode change 100644 => 100755 external/hypre/src/test/TEST_sstruct/nonmixedint.sh mode change 100644 => 100755 external/hypre/src/test/TEST_sstruct/periodic.jobs rename external/hypre/src/test/TEST_sstruct/{periodic.saved.ray => periodic.saved.lassen_cpu} (100%) mode change 100644 => 100755 external/hypre/src/test/TEST_sstruct/periodic.sh mode change 100644 => 100755 external/hypre/src/test/TEST_sstruct/sharedpart.jobs rename external/hypre/src/test/TEST_sstruct/{sharedpart.saved.ray => sharedpart.saved.lassen_cpu} (76%) mode change 100644 => 100755 external/hypre/src/test/TEST_sstruct/sharedpart.sh mode change 100644 => 100755 external/hypre/src/test/TEST_sstruct/solvers.jobs rename external/hypre/src/test/TEST_sstruct/{solvers.saved.ray => solvers.saved.lassen_cpu} (80%) mode change 100644 => 100755 external/hypre/src/test/TEST_sstruct/solvers.sh create mode 100644 external/hypre/src/test/TEST_sstruct/sstruct.in.cube-fem create mode 100644 external/hypre/src/test/TEST_sstruct/sstruct.in.cubes2_aniso create mode 100644 external/hypre/src/test/TEST_sstruct/sstruct.in.cubes4_27pt mode change 100644 => 100755 external/hypre/src/test/TEST_sstruct/sstruct_struct.jobs rename external/hypre/src/test/TEST_sstruct/{sstruct_struct.saved.ray => sstruct_struct.saved.lassen_cpu} (100%) mode change 100644 => 100755 external/hypre/src/test/TEST_sstruct/sstruct_struct.sh mode change 100644 => 100755 external/hypre/src/test/TEST_sstruct/symm.jobs rename external/hypre/src/test/TEST_sstruct/{symm.saved.ray => symm.saved.lassen_cpu} (100%) mode change 100644 => 100755 external/hypre/src/test/TEST_sstruct/symm.sh create mode 100755 external/hypre/src/test/TEST_sstruct/versioncheck.jobs create mode 100755 external/hypre/src/test/TEST_sstruct/versioncheck.sh mode change 100644 => 100755 external/hypre/src/test/TEST_sstruct/wide.jobs rename external/hypre/src/test/TEST_sstruct/{wide.saved.ray => wide.saved.lassen_cpu} (100%) mode change 100644 => 100755 external/hypre/src/test/TEST_sstruct/wide.sh mode change 100644 => 100755 external/hypre/src/test/TEST_sstruct/zcube.jobs rename external/hypre/src/test/TEST_sstruct/{zcube.saved.ray => zcube.saved.lassen_cpu} (100%) mode change 100644 => 100755 external/hypre/src/test/TEST_sstruct/zcube.sh mode change 100644 => 100755 external/hypre/src/test/TEST_struct/cgpfmg3d.jobs rename external/hypre/src/test/TEST_struct/{cgpfmg3d.saved.ray => cgpfmg3d.saved.florentia} (100%) create mode 100644 external/hypre/src/test/TEST_struct/cgpfmg3d.saved.lassen_cpu create mode 100644 external/hypre/src/test/TEST_struct/cgpfmg3d.saved.tioga mode change 100644 => 100755 external/hypre/src/test/TEST_struct/cgpfmg3d.sh mode change 100644 => 100755 external/hypre/src/test/TEST_struct/emptyproc.jobs rename external/hypre/src/test/TEST_struct/{emptyproc.saved.ray => emptyproc.saved.florentia} (100%) create mode 100644 external/hypre/src/test/TEST_struct/emptyproc.saved.lassen_cpu create mode 100644 external/hypre/src/test/TEST_struct/emptyproc.saved.tioga mode change 100644 => 100755 external/hypre/src/test/TEST_struct/emptyproc.sh mode change 100644 => 100755 external/hypre/src/test/TEST_struct/hybrid.jobs rename external/hypre/src/test/TEST_struct/{hybrid.saved.ray => hybrid.saved.florentia} (100%) create mode 100644 external/hypre/src/test/TEST_struct/hybrid.saved.lassen_cpu create mode 100644 external/hypre/src/test/TEST_struct/hybrid.saved.tioga mode change 100644 => 100755 external/hypre/src/test/TEST_struct/hybrid.sh mode change 100644 => 100755 external/hypre/src/test/TEST_struct/hybridswitch.jobs rename external/hypre/src/test/TEST_struct/{hybridswitch.saved.ray => hybridswitch.saved.florentia} (100%) create mode 100644 external/hypre/src/test/TEST_struct/hybridswitch.saved.lassen_cpu create mode 100644 external/hypre/src/test/TEST_struct/hybridswitch.saved.tioga mode change 100644 => 100755 external/hypre/src/test/TEST_struct/hybridswitch.sh create mode 100644 external/hypre/src/test/TEST_struct/lazy.jobs create mode 100755 external/hypre/src/test/TEST_struct/lazy.sh mode change 100644 => 100755 external/hypre/src/test/TEST_struct/migrate.jobs rename external/hypre/src/test/TEST_struct/{migrate.saved.ray => migrate.saved.florentia} (100%) create mode 100644 external/hypre/src/test/TEST_struct/migrate.saved.lassen_cpu create mode 100644 external/hypre/src/test/TEST_struct/migrate.saved.tioga mode change 100644 => 100755 external/hypre/src/test/TEST_struct/migrate.sh mode change 100644 => 100755 external/hypre/src/test/TEST_struct/parflow.jobs rename external/hypre/src/test/TEST_struct/{parflow.saved.ray => parflow.saved.florentia} (100%) create mode 100644 external/hypre/src/test/TEST_struct/parflow.saved.lassen_cpu create mode 100644 external/hypre/src/test/TEST_struct/parflow.saved.tioga mode change 100644 => 100755 external/hypre/src/test/TEST_struct/parflow.sh mode change 100644 => 100755 external/hypre/src/test/TEST_struct/periodic.jobs create mode 100644 external/hypre/src/test/TEST_struct/periodic.saved.florentia rename external/hypre/src/test/TEST_struct/{periodic.saved.ray => periodic.saved.lassen_cpu} (100%) create mode 100644 external/hypre/src/test/TEST_struct/periodic.saved.tioga mode change 100644 => 100755 external/hypre/src/test/TEST_struct/periodic.sh mode change 100644 => 100755 external/hypre/src/test/TEST_struct/pfmgbase1d.jobs rename external/hypre/src/test/TEST_struct/{pfmgbase1d.saved.ray => pfmgbase1d.saved.florentia} (100%) create mode 100644 external/hypre/src/test/TEST_struct/pfmgbase1d.saved.lassen_cpu create mode 100644 external/hypre/src/test/TEST_struct/pfmgbase1d.saved.tioga mode change 100644 => 100755 external/hypre/src/test/TEST_struct/pfmgbase1d.sh mode change 100644 => 100755 external/hypre/src/test/TEST_struct/pfmgbase2d.jobs rename external/hypre/src/test/TEST_struct/{pfmgbase2d.saved.ray => pfmgbase2d.saved.florentia} (100%) create mode 100644 external/hypre/src/test/TEST_struct/pfmgbase2d.saved.lassen_cpu create mode 100644 external/hypre/src/test/TEST_struct/pfmgbase2d.saved.tioga mode change 100644 => 100755 external/hypre/src/test/TEST_struct/pfmgbase2d.sh mode change 100644 => 100755 external/hypre/src/test/TEST_struct/pfmgbase3d.jobs rename external/hypre/src/test/TEST_struct/{pfmgbase3d.saved.ray => pfmgbase3d.saved.florentia} (100%) create mode 100644 external/hypre/src/test/TEST_struct/pfmgbase3d.saved.lassen_cpu create mode 100644 external/hypre/src/test/TEST_struct/pfmgbase3d.saved.tioga mode change 100644 => 100755 external/hypre/src/test/TEST_struct/pfmgbase3d.sh mode change 100644 => 100755 external/hypre/src/test/TEST_struct/pfmgconstcoeffmp.jobs rename external/hypre/src/test/TEST_struct/{pfmgconstcoeffmp.saved.ray => pfmgconstcoeffmp.saved.florentia} (100%) create mode 100644 external/hypre/src/test/TEST_struct/pfmgconstcoeffmp.saved.lassen_cpu create mode 100644 external/hypre/src/test/TEST_struct/pfmgconstcoeffmp.saved.tioga mode change 100644 => 100755 external/hypre/src/test/TEST_struct/pfmgconstcoeffmp.sh mode change 100644 => 100755 external/hypre/src/test/TEST_struct/pfmgorient.jobs rename external/hypre/src/test/TEST_struct/{pfmgorient.saved.ray => pfmgorient.saved.florentia} (100%) create mode 100644 external/hypre/src/test/TEST_struct/pfmgorient.saved.lassen_cpu create mode 100644 external/hypre/src/test/TEST_struct/pfmgorient.saved.tioga mode change 100644 => 100755 external/hypre/src/test/TEST_struct/pfmgorient.sh mode change 100644 => 100755 external/hypre/src/test/TEST_struct/pfmgtest1d.jobs rename external/hypre/src/test/TEST_struct/{pfmgtest1d.saved.ray => pfmgtest1d.saved.florentia} (100%) create mode 100644 external/hypre/src/test/TEST_struct/pfmgtest1d.saved.lassen_cpu create mode 100644 external/hypre/src/test/TEST_struct/pfmgtest1d.saved.tioga mode change 100644 => 100755 external/hypre/src/test/TEST_struct/pfmgtest1d.sh mode change 100644 => 100755 external/hypre/src/test/TEST_struct/pfmgvcycle.jobs rename external/hypre/src/test/TEST_struct/{pfmgvcycle.saved.ray => pfmgvcycle.saved.florentia} (100%) create mode 100644 external/hypre/src/test/TEST_struct/pfmgvcycle.saved.lassen_cpu create mode 100644 external/hypre/src/test/TEST_struct/pfmgvcycle.saved.tioga mode change 100644 => 100755 external/hypre/src/test/TEST_struct/pfmgvcycle.sh mode change 100644 => 100755 external/hypre/src/test/TEST_struct/psmgbase3d.jobs rename external/hypre/src/test/TEST_struct/{psmgbase3d.saved.ray => psmgbase3d.saved.florentia} (100%) create mode 100644 external/hypre/src/test/TEST_struct/psmgbase3d.saved.lassen_cpu create mode 100644 external/hypre/src/test/TEST_struct/psmgbase3d.saved.tioga mode change 100644 => 100755 external/hypre/src/test/TEST_struct/psmgbase3d.sh mode change 100644 => 100755 external/hypre/src/test/TEST_struct/psmgtest3d.jobs rename external/hypre/src/test/TEST_struct/{psmgtest3d.saved.ray => psmgtest3d.saved.florentia} (100%) create mode 100644 external/hypre/src/test/TEST_struct/psmgtest3d.saved.lassen_cpu create mode 100644 external/hypre/src/test/TEST_struct/psmgtest3d.saved.tioga mode change 100644 => 100755 external/hypre/src/test/TEST_struct/psmgtest3d.sh mode change 100644 => 100755 external/hypre/src/test/TEST_struct/smgbase1d.jobs rename external/hypre/src/test/TEST_struct/{smgbase1d.saved.ray => smgbase1d.saved.florentia} (100%) create mode 100644 external/hypre/src/test/TEST_struct/smgbase1d.saved.lassen_cpu create mode 100644 external/hypre/src/test/TEST_struct/smgbase1d.saved.tioga mode change 100644 => 100755 external/hypre/src/test/TEST_struct/smgbase1d.sh mode change 100644 => 100755 external/hypre/src/test/TEST_struct/smgbase2d.jobs rename external/hypre/src/test/TEST_struct/{smgbase2d.saved.ray => smgbase2d.saved.florentia} (100%) create mode 100644 external/hypre/src/test/TEST_struct/smgbase2d.saved.lassen_cpu create mode 100644 external/hypre/src/test/TEST_struct/smgbase2d.saved.tioga mode change 100644 => 100755 external/hypre/src/test/TEST_struct/smgbase2d.sh mode change 100644 => 100755 external/hypre/src/test/TEST_struct/smgbase3d.jobs rename external/hypre/src/test/TEST_struct/{smgbase3d.saved.ray => smgbase3d.saved.florentia} (100%) create mode 100644 external/hypre/src/test/TEST_struct/smgbase3d.saved.lassen_cpu create mode 100644 external/hypre/src/test/TEST_struct/smgbase3d.saved.tioga mode change 100644 => 100755 external/hypre/src/test/TEST_struct/smgbase3d.sh mode change 100644 => 100755 external/hypre/src/test/TEST_struct/smgtest1d.jobs rename external/hypre/src/test/TEST_struct/{smgtest1d.saved.ray => smgtest1d.saved.florentia} (100%) create mode 100644 external/hypre/src/test/TEST_struct/smgtest1d.saved.lassen_cpu create mode 100644 external/hypre/src/test/TEST_struct/smgtest1d.saved.tioga mode change 100644 => 100755 external/hypre/src/test/TEST_struct/smgtest1d.sh mode change 100644 => 100755 external/hypre/src/test/TEST_struct/smgvcycle.jobs rename external/hypre/src/test/TEST_struct/{smgvcycle.saved.ray => smgvcycle.saved.florentia} (100%) create mode 100644 external/hypre/src/test/TEST_struct/smgvcycle.saved.lassen_cpu create mode 100644 external/hypre/src/test/TEST_struct/smgvcycle.saved.tioga mode change 100644 => 100755 external/hypre/src/test/TEST_struct/smgvcycle.sh mode change 100644 => 100755 external/hypre/src/test/TEST_struct/solvers.jobs rename external/hypre/src/test/TEST_struct/{solvers.saved.ray => solvers.saved.florentia} (100%) create mode 100644 external/hypre/src/test/TEST_struct/solvers.saved.lassen_cpu create mode 100644 external/hypre/src/test/TEST_struct/solvers.saved.tioga mode change 100644 => 100755 external/hypre/src/test/TEST_struct/solvers.sh mode change 100644 => 100755 external/hypre/src/test/TEST_struct/vcpfmgRedBlackGS.jobs rename external/hypre/src/test/TEST_struct/{vcpfmgRedBlackGS.saved.ray => vcpfmgRedBlackGS.saved.florentia} (100%) create mode 100644 external/hypre/src/test/TEST_struct/vcpfmgRedBlackGS.saved.lassen_cpu create mode 100644 external/hypre/src/test/TEST_struct/vcpfmgRedBlackGS.saved.tioga mode change 100644 => 100755 external/hypre/src/test/TEST_struct/vcpfmgRedBlackGS.sh mode change 100644 => 100755 external/hypre/src/test/TEST_struct/vdpfmgRedBlackGS.jobs rename external/hypre/src/test/TEST_struct/{vdpfmgRedBlackGS.saved.ray => vdpfmgRedBlackGS.saved.florentia} (100%) create mode 100644 external/hypre/src/test/TEST_struct/vdpfmgRedBlackGS.saved.lassen_cpu create mode 100644 external/hypre/src/test/TEST_struct/vdpfmgRedBlackGS.saved.tioga mode change 100644 => 100755 external/hypre/src/test/TEST_struct/vdpfmgRedBlackGS.sh create mode 100755 external/hypre/src/test/TEST_struct/versioncheck.jobs create mode 100755 external/hypre/src/test/TEST_struct/versioncheck.sh mode change 100644 => 100755 external/hypre/src/test/TEST_superlu/sludist.jobs mode change 100644 => 100755 external/hypre/src/test/TEST_superlu/sludist.sh mode change 100644 => 100755 external/hypre/src/test/TEST_timing/efficiency.jobs mode change 100644 => 100755 external/hypre/src/test/TEST_timing/efficiency.sh mode change 100644 => 100755 external/hypre/src/test/checktest.sh mode change 100644 => 100755 external/hypre/src/test/cleantest.sh delete mode 100644 external/hypre/src/test/f77_ij_mv.f delete mode 100644 external/hypre/src/test/ij_mv.c mode change 100644 => 100755 external/hypre/src/test/runcheck.sh mode change 100644 => 100755 external/hypre/src/test/runtest.sh delete mode 100644 external/hypre/src/test/test_mgr.c create mode 100644 external/hypre/src/utilities/_hypre_onedpl.hpp create mode 100644 external/hypre/src/utilities/base.h delete mode 100644 external/hypre/src/utilities/cuda_utils.c delete mode 100644 external/hypre/src/utilities/cuda_utils.h rename external/hypre/src/utilities/{cuda_reducer.h => device_reducer.h} (64%) create mode 100644 external/hypre/src/utilities/device_utils.c create mode 100644 external/hypre/src/utilities/device_utils.h create mode 100644 external/hypre/src/utilities/functors.h mode change 100644 => 100755 external/hypre/src/utilities/headers create mode 100644 external/hypre/src/utilities/int_array_device.c create mode 100644 external/hypre/src/utilities/magma.c create mode 100644 external/hypre/src/utilities/magma.h create mode 100644 external/hypre/src/utilities/matrix_stats.c create mode 100644 external/hypre/src/utilities/matrix_stats.h create mode 100644 external/hypre/src/utilities/memory_tracker.c create mode 100644 external/hypre/src/utilities/memory_tracker.h create mode 100644 external/hypre/src/utilities/mmio.c create mode 100644 external/hypre/src/utilities/mmio.h create mode 100644 external/hypre/src/utilities/predicates.h mode change 100644 => 100755 external/hypre/src/utilities/protos create mode 100644 external/hypre/src/utilities/state.c create mode 100644 external/hypre/src/utilities/state.h create mode 100644 external/hypre/src/utilities/stl_ops.c mode change 100644 => 100755 external/hypre/src/utilities/version.sh diff --git a/.gitignore b/.gitignore index 12c54b30..317c740d 100644 --- a/.gitignore +++ b/.gitignore @@ -370,4 +370,5 @@ doc/build doc/*.html venv build*/ -.vscode/ \ No newline at end of file +.vscode/ +install/ \ No newline at end of file diff --git a/cmake/HYPREConfig.cmake b/cmake/HYPREConfig.cmake index 69c9e2e7..9e789c02 100644 --- a/cmake/HYPREConfig.cmake +++ b/cmake/HYPREConfig.cmake @@ -20,8 +20,8 @@ macro(CONFIG_AND_INSTALL_HYPRE) "-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}" "-DHYPRE_BUILD_TYPE=${CMAKE_BUILD_TYPE}" "-DHYPRE_ENABLE_SINGLE=${OPFLOW_SINGLE_PRECISION}" - "-DHYPRE_WITH_OPENMP=${OPFLOW_WITH_OPENMP}" - "-DHYPRE_WITH_MPI=${OPFLOW_WITH_MPI}" + "-DHYPRE_ENABLE_OPENMP=${OPFLOW_WITH_OPENMP}" + "-DHYPRE_ENABLE_MPI=${OPFLOW_WITH_MPI}" "-DHYPRE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}") string(REPLACE " " "\t\n" _hypre_options ${HYPRE_OPTIONS}) message(STATUS "HYPRE is to be configured with:\t\n${_hypre_options}") @@ -32,8 +32,8 @@ macro(CONFIG_AND_INSTALL_HYPRE) -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DHYPRE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DHYPRE_ENABLE_SINGLE=${OPFLOW_SINGLE_PRECISION} - -DHYPRE_WITH_OPENMP=${OPFLOW_WITH_OPENMP} - -DHYPRE_WITH_MPI=${OPFLOW_WITH_MPI} + -DHYPRE_ENABLE_OPENMP=${OPFLOW_WITH_OPENMP} + -DHYPRE_ENABLE_MPI=${OPFLOW_WITH_MPI} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} ${CMAKE_CURRENT_SOURCE_DIR}/external/hypre/src RESULT_VARIABLE _result diff --git a/external/hypre/.gitignore b/external/hypre/.gitignore new file mode 100644 index 00000000..1962e925 --- /dev/null +++ b/external/hypre/.gitignore @@ -0,0 +1,74 @@ +*.o +*.obj +*.a +*.so +*.out.* +*.err.* +*.err +*.out +*.perf +*.btr +*.patch +.gdbinit +build.sh +update.sh +make.log +config.log +config.status +Makefile.config +HYPRE_config.h +autom4te.cache +src/TAGS +hypre/ +install/ +AUTOTEST/*.dir +out/ +.vscode +.vs + +############### +# Documentation +############### +src/docs/ref-manual/html/ +src/docs/ref-manual-html/ +src/docs/ref-manual.pdf +src/docs/ref-manual/latex/ +src/docs/ref-manual/xml/ +src/docs/usr-manual-html/ +src/docs/usr-manual/html/ +src/docs/usr-manual.pdf +src/docs/usr-manual/_build/ + +############### +# Executables +############### +src/test/ams_driver +src/test/ams_driver.exe +src/test/ij +src/test/ij.exe +src/test/ij_assembly +src/test/ij_assembly.exe +src/test/ij_mv +src/test/ij_mv.exe +src/test/ij_mm +src/test/ij_mm.exe +src/test/maxwell_unscaled +src/test/maxwell_unscaled.exe +src/test/sstruct +src/test/sstruct.exe +src/test/sstruct_fac +src/test/sstruct_fac.exe +src/test/struct +src/test/struct.exe +src/test/struct_migrate +src/test/struct_migrate.exe +src/test/zboxloop +src/test/zboxloop.exe +src/examples/ex[0-9] +src/examples/ex[0-9].exe +src/examples/ex1[0-8] +src/examples/ex1[0-8].exe +src/examples/ex5f +src/examples/ex5f.exe +src/examples/ex12f +src/examples/ex12f.exe diff --git a/external/hypre/.readthedocs.yml b/external/hypre/.readthedocs.yml new file mode 100644 index 00000000..85287ed9 --- /dev/null +++ b/external/hypre/.readthedocs.yml @@ -0,0 +1,29 @@ +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +# .readthedocs.yml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Set the version of Python and other tools you might need +build: + os: ubuntu-22.04 + tools: + python: "3.11" + +# Build documentation in the docs/ directory with Sphinx +sphinx: + configuration: src/docs/usr-manual/conf.py + +# Optionally build your docs in additional formats such as PDF and ePub +formats: all + +# Optionally set the version of Python and requirements required to build your docs +python: + install: + - requirements: src/docs/usr-manual/requirements.txt diff --git a/external/hypre/AUTOTEST/README.txt b/external/hypre/AUTOTEST/README.txt index d8540b5c..248bf955 100644 --- a/external/hypre/AUTOTEST/README.txt +++ b/external/hypre/AUTOTEST/README.txt @@ -1,52 +1,52 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) - -This directory contains scripts for running various tests on the hypre library. -The scripts augment the 'runtest.sh' runtime tests in 'test/TEST_*'. - -Every test in this directory may be run manually by developers. Many of the -scripts are also run as part of the nightly regression testing, currently -developed and maintained in a separate git repository called 'hypre/autotest'. - -===================== - -Organization: - -This directory mainly consists of a number of simple Bourne-shell scripts (the -files with a '.sh' extension). Except for a few "special scripts" (below), each -represents an individual test written by a hypre developer. The special scripts -are as follows (note that they are the only scripts with "test" in their names): - -1. 'test.sh' - Used to run individual tests. -2. 'cleantest.sh' - Used to clean up the output from a test (or tests). -3. 'renametest.sh' - Used to rename the output from a test. - -Usage information for every script (special or individual test) can be obtained -by running it with the '-h' option (e.g., 'test.sh -h' or 'make.sh -h'). - -===================== - -Writing tests: - -The rules for writing tests are given in the 'test.sh -h' usage information. -When writing tests, keep in mind the design goals below, especially with respect -to simplicity, flexibility, and portability. - -To write a new test, just use an existing test (e.g., 'default.sh') as a -template and make the appropriate modifications. Try not to use the word "test" -in the name of the script so that we can keep the convention of only the special -scripts having this in their names. Try not to use absolute directory paths in -the script. - -===================== - -Design goals: - -- Minimal limitations on the types of tests that are possible. -- Developers should be able to run the tests manually. -- Minimal dependence on operating system and software tools (for portability). -- Developers should be able to easily add new tests. -- Simplicity and flexibility. + +This directory contains scripts for running various tests on the hypre library. +The scripts augment the 'runtest.sh' runtime tests in 'test/TEST_*'. + +Every test in this directory may be run manually by developers. Many of the +scripts are also run as part of the nightly regression testing, currently +developed and maintained in a separate git repository called 'hypre/autotest'. + +===================== + +Organization: + +This directory mainly consists of a number of simple Bourne-shell scripts (the +files with a '.sh' extension). Except for a few "special scripts" (below), each +represents an individual test written by a hypre developer. The special scripts +are as follows (note that they are the only scripts with "test" in their names): + +1. 'test.sh' - Used to run individual tests. +2. 'cleantest.sh' - Used to clean up the output from a test (or tests). +3. 'renametest.sh' - Used to rename the output from a test. + +Usage information for every script (special or individual test) can be obtained +by running it with the '-h' option (e.g., 'test.sh -h' or 'make.sh -h'). + +===================== + +Writing tests: + +The rules for writing tests are given in the 'test.sh -h' usage information. +When writing tests, keep in mind the design goals below, especially with respect +to simplicity, flexibility, and portability. + +To write a new test, just use an existing test (e.g., 'default.sh') as a +template and make the appropriate modifications. Try not to use the word "test" +in the name of the script so that we can keep the convention of only the special +scripts having this in their names. Try not to use absolute directory paths in +the script. + +===================== + +Design goals: + +- Minimal limitations on the types of tests that are possible. +- Developers should be able to run the tests manually. +- Minimal dependence on operating system and software tools (for portability). +- Developers should be able to easily add new tests. +- Simplicity and flexibility. diff --git a/external/hypre/AUTOTEST/basic.sh b/external/hypre/AUTOTEST/basic.sh old mode 100644 new mode 100755 index e3620d2f..0cec385f --- a/external/hypre/AUTOTEST/basic.sh +++ b/external/hypre/AUTOTEST/basic.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/AUTOTEST/check-case.sh b/external/hypre/AUTOTEST/check-case.sh old mode 100644 new mode 100755 index 8c6b41f9..67aa45b3 --- a/external/hypre/AUTOTEST/check-case.sh +++ b/external/hypre/AUTOTEST/check-case.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/AUTOTEST/check-double.sh b/external/hypre/AUTOTEST/check-double.sh old mode 100644 new mode 100755 index 8f6d74c6..86123092 --- a/external/hypre/AUTOTEST/check-double.sh +++ b/external/hypre/AUTOTEST/check-double.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -32,12 +32,11 @@ shift cd $src_dir find . -type f -print | egrep '[.]*[.](c|cc|cpp|cxx|C|h|hpp|hxx|H)$' | - egrep -v '/cmbuild' | egrep -v '/docs' | egrep -v '/examples' | egrep -v '/FEI_mv' | egrep -v '/hypre/include' > check-double.files -egrep '(^|[^[:alnum:]_]+)double([^[:alnum:]_]+|$)' `cat check-double.files` >&2 +egrep '(^|[^[:alnum:]_-]+)double([^[:alnum:]_-]+|$)' `cat check-double.files` >&2 rm -f check-double.files diff --git a/external/hypre/AUTOTEST/check-glob-symb.sh b/external/hypre/AUTOTEST/check-glob-symb.sh old mode 100644 new mode 100755 index 8d899c33..4188ed75 --- a/external/hypre/AUTOTEST/check-glob-symb.sh +++ b/external/hypre/AUTOTEST/check-glob-symb.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/AUTOTEST/check-headers.filters b/external/hypre/AUTOTEST/check-headers.filters index 580e2dff..ded74f6e 100644 --- a/external/hypre/AUTOTEST/check-headers.filters +++ b/external/hypre/AUTOTEST/check-headers.filters @@ -4,3 +4,4 @@ include/fortran_matrix.h include/multivector.h include/interpreter.h include/temp_multivector.h +fatal: No names found, cannot describe anything. diff --git a/external/hypre/AUTOTEST/check-headers.sh b/external/hypre/AUTOTEST/check-headers.sh old mode 100644 new mode 100755 index c0db0d66..3c1b52fe --- a/external/hypre/AUTOTEST/check-headers.sh +++ b/external/hypre/AUTOTEST/check-headers.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/AUTOTEST/check-int.filters b/external/hypre/AUTOTEST/check-int.filters index 78c6eae6..e2a6e79a 100644 --- a/external/hypre/AUTOTEST/check-int.filters +++ b/external/hypre/AUTOTEST/check-int.filters @@ -12,5 +12,5 @@ long-range interpolation monstrously long get a long msg long rows -utilities/hopscotch_hash.h: //return _InterlockedCompareExchange -utilities/hopscotch_hash.h: //return _InterlockedExchangeAdd +return _InterlockedCompareExchange +return _InterlockedExchangeAdd diff --git a/external/hypre/AUTOTEST/check-int.sh b/external/hypre/AUTOTEST/check-int.sh old mode 100644 new mode 100755 index bbf0b010..2d3b2493 --- a/external/hypre/AUTOTEST/check-int.sh +++ b/external/hypre/AUTOTEST/check-int.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -32,7 +32,6 @@ shift cd $src_dir find . -type f -print | egrep '[.]*[.](c|cc|cpp|cxx|C|h|hpp|hxx|H)$' | - egrep -v '/cmbuild' | egrep -v '/docs' | egrep -v '/examples' | egrep -v '/FEI_mv' | diff --git a/external/hypre/AUTOTEST/check-license.filters b/external/hypre/AUTOTEST/check-license.filters index 99d2f8ae..de18d6a2 100644 --- a/external/hypre/AUTOTEST/check-license.filters +++ b/external/hypre/AUTOTEST/check-license.filters @@ -9,10 +9,11 @@ ./src/test/ams_driver ./src/test/zboxloop ./src/test/ij -./src/test/ij_mv ./src/test/struct ./src/test/sstruct ./src/zerr ./src/config.log ./src/config.status +.gitignore TVD.v3breakpoints +.vscode diff --git a/external/hypre/AUTOTEST/check-license.sh b/external/hypre/AUTOTEST/check-license.sh old mode 100644 new mode 100755 index 1e7c0807..bc2e9e87 --- a/external/hypre/AUTOTEST/check-license.sh +++ b/external/hypre/AUTOTEST/check-license.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -33,13 +33,14 @@ cd $top_dir ### First check for files that do not have the license, but should -#LicStr='Copyright 1998-2019 Lawrence Livermore' +#LicStr='Copyright (c) 1998 Lawrence Livermore' LicStr='SPDX-License-Identifier: \(Apache-2.0 OR MIT\)' # Remove these files from the list of all files without 'SPDX' -egrep -LR "$LicStr" . | egrep -v '[.](o|a|filters|pdf|svg|gif)$' | +egrep -LR "$LicStr" . | egrep -v '[.](o|obj|a|filters|pdf|svg|gif|png)$' | egrep -v '[.]/[.]git' | + egrep -v '[.]/.*HYPRE_config[.]h' | egrep -v '[.]/src/(blas|lapack)/.*[.]c' | egrep -v '[.]/src/examples/docs' | egrep -v '[.]/src/test/TEST_.*' > check-license.files @@ -61,7 +62,6 @@ cat > check-license.remove < check-license.remove < check-mem.files + egrep -v '/utilities/memory_tracker.c' | + egrep -v '/utilities/memory.c' | + egrep -v '/utilities/general.c' | + egrep -v '/utilities/device_utils.c' > check-mem.files egrep '(^|[^[:alnum:]_]+)malloc[[:space:]]*\(' `cat check-mem.files` >&2 egrep '(^|[^[:alnum:]_]+)calloc[[:space:]]*\(' `cat check-mem.files` >&2 diff --git a/external/hypre/AUTOTEST/check-mpi.sh b/external/hypre/AUTOTEST/check-mpi.sh old mode 100644 new mode 100755 index f3b4244b..0a96c85e --- a/external/hypre/AUTOTEST/check-mpi.sh +++ b/external/hypre/AUTOTEST/check-mpi.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -32,7 +32,6 @@ shift cd $src_dir find . -type f -print | egrep '[.]*[.](c|cc|cpp|cxx|C|h|hpp|hxx|H)$' | - egrep -v '/cmbuild' | egrep -v '/docs' | egrep -v '/examples' | egrep -v '/FEI_mv' | diff --git a/external/hypre/AUTOTEST/cleantest.sh b/external/hypre/AUTOTEST/cleantest.sh old mode 100644 new mode 100755 index 3d987f25..2c76070a --- a/external/hypre/AUTOTEST/cleantest.sh +++ b/external/hypre/AUTOTEST/cleantest.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/AUTOTEST/cmake.bat b/external/hypre/AUTOTEST/cmake.bat old mode 100644 new mode 100755 index 30284c93..d79d1a9a --- a/external/hypre/AUTOTEST/cmake.bat +++ b/external/hypre/AUTOTEST/cmake.bat @@ -1,5 +1,5 @@ @echo off -rem Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +rem Copyright (c) 1998 Lawrence Livermore National Security, LLC and other rem HYPRE Project Developers. See the top-level COPYRIGHT file for details. rem rem SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/AUTOTEST/cmake.filters b/external/hypre/AUTOTEST/cmake.filters new file mode 100644 index 00000000..7e55edf7 --- /dev/null +++ b/external/hypre/AUTOTEST/cmake.filters @@ -0,0 +1,3 @@ +fatal: No names found, cannot describe anything. +Additional optimization may be attained by recompiling and specifying MAXMEM option with a value greater than 8192. +warning: 1501-264 The options qsmp and O0 are incompatible. Option O0 is ignored. diff --git a/external/hypre/AUTOTEST/cmake.sh b/external/hypre/AUTOTEST/cmake.sh old mode 100644 new mode 100755 index 3f6ab0f7..ce1d66fe --- a/external/hypre/AUTOTEST/cmake.sh +++ b/external/hypre/AUTOTEST/cmake.sh @@ -1,39 +1,39 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) testname=`basename $0 .sh` -drivers="ij sstruct struct ams_driver maxwell_unscaled sstruct_fac ij_mv struct_migrate" +drivers="ij sstruct struct ams_driver maxwell_unscaled sstruct_fac struct_migrate ij_assembly" # Echo usage information case $1 in -h|-help) cat < configuration options -mo: make options -ro: call the run script with these options -eo: call the examples script with these options -h|-help prints this usage information and exits - This script uses cmake to configure and compile the source in {src_dir}, then + This script uses cmake to configure and compile the source in {root_dir}/src, then optionally runs driver and example tests. - Example usage: $0 ../src -co -DCMAKE_BUILD_TYPE=Debug -ro: -ij + Example usage: $0 .. -co -DCMAKE_BUILD_TYPE=Debug -ro: -ij EOF exit ;; esac -# Set src_dir -src_dir=`cd $1; pwd` +# Set root_dir +root_dir=`cd $1; pwd` shift # Parse the rest of the command line @@ -68,38 +68,33 @@ test_dir=`pwd` output_dir=`pwd`/$testname.dir rm -fr $output_dir mkdir -p $output_dir -cd $src_dir -src_dir=`pwd` +cd $root_dir +root_dir=`pwd` -# Clean up the cmbuild directories (do it from src_dir as a precaution) -cd $src_dir -rm -fr `echo cmbuild/* | sed 's/[^ ]*README.txt//g'` +# Clean up the build directories (do it from root_dir as a precaution) +cd $root_dir +rm -fr build/* # Clean up the previous install -cd $src_dir -rm -fr hypre +cd $root_dir +rm -fr src/hypre # Configure -cd $src_dir/cmbuild -eval cmake $copts .. +cd $root_dir/build +eval cmake $copts ../src make $mopts install -# Make -cd $src_dir/cmbuild/test -make $mopts -mv -f $drivers ../../test - cd $test_dir # Run if [ -n "$rset" ]; then - ./test.sh run.sh $src_dir $ropts + ./test.sh run.sh $root_dir/src $ropts mv -f run.??? $output_dir fi # Examples if [ -n "$eset" ]; then - ./test.sh examples.sh $src_dir $eopts + ./test.sh examples.sh $root_dir/src $eopts mv -f examples.??? $output_dir fi @@ -110,8 +105,7 @@ do done # Clean up -cd $src_dir -rm -fr `echo cmbuild/* | sed 's/[^ ]*README.txt//g'` -rm -fr hypre -( cd $src_dir/test; rm -f $drivers; ./cleantest.sh ) - +cd $root_dir +rm -fr build/* +rm -fr src/hypre +( cd $root_dir/src/test; rm -f $drivers; ./cleantest.sh ) diff --git a/external/hypre/AUTOTEST/configure.filters b/external/hypre/AUTOTEST/configure.filters index e69de29b..be5d0e21 100644 --- a/external/hypre/AUTOTEST/configure.filters +++ b/external/hypre/AUTOTEST/configure.filters @@ -0,0 +1,2 @@ +fatal: No names found, cannot describe anything. +WARNING: unknown Fortran name-mangling scheme diff --git a/external/hypre/AUTOTEST/configure.sh b/external/hypre/AUTOTEST/configure.sh old mode 100644 new mode 100755 index 90bc0a59..55ec6518 --- a/external/hypre/AUTOTEST/configure.sh +++ b/external/hypre/AUTOTEST/configure.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/AUTOTEST/docs.sh b/external/hypre/AUTOTEST/docs.sh old mode 100644 new mode 100755 index bd28a72e..0fac8b2d --- a/external/hypre/AUTOTEST/docs.sh +++ b/external/hypre/AUTOTEST/docs.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/AUTOTEST/examples.sh b/external/hypre/AUTOTEST/examples.sh old mode 100644 new mode 100755 index 610766fa..96e5e6af --- a/external/hypre/AUTOTEST/examples.sh +++ b/external/hypre/AUTOTEST/examples.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -72,7 +72,7 @@ fi for tname in $tests do if [ "$tname" = "gpu" ]; then - make -j -f Makefile_gpu $mopt $tname + make -j "use_cuda=1" $mopt $tname else make $mopt $tname fi diff --git a/external/hypre/AUTOTEST/klocwork.sh b/external/hypre/AUTOTEST/klocwork.sh old mode 100644 new mode 100755 index 578c59e1..9c925b3e --- a/external/hypre/AUTOTEST/klocwork.sh +++ b/external/hypre/AUTOTEST/klocwork.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/AUTOTEST/link.sh b/external/hypre/AUTOTEST/link.sh old mode 100644 new mode 100755 index 4b5d58a6..80660144 --- a/external/hypre/AUTOTEST/link.sh +++ b/external/hypre/AUTOTEST/link.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/AUTOTEST/machine-aurora.sh b/external/hypre/AUTOTEST/machine-aurora.sh new file mode 100755 index 00000000..94c1ce3e --- /dev/null +++ b/external/hypre/AUTOTEST/machine-aurora.sh @@ -0,0 +1,101 @@ +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +testname=`basename $0 .sh` + +# Echo usage information +case $1 in + -h|-help) + cat <&2 +done + diff --git a/external/hypre/AUTOTEST/machine-lassen-cuda.sh b/external/hypre/AUTOTEST/machine-lassen-cuda.sh new file mode 100755 index 00000000..fc9e462e --- /dev/null +++ b/external/hypre/AUTOTEST/machine-lassen-cuda.sh @@ -0,0 +1,148 @@ +#!/bin/sh +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +testname=`basename $0 .sh` + +# Echo usage information +case $1 in + -h|-help) + cat <&2 done - diff --git a/external/hypre/AUTOTEST/machine-mac.sh b/external/hypre/AUTOTEST/machine-mac.sh old mode 100644 new mode 100755 index 2e7d4400..746e3dc9 --- a/external/hypre/AUTOTEST/machine-mac.sh +++ b/external/hypre/AUTOTEST/machine-mac.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -35,40 +35,18 @@ mkdir -p $output_dir src_dir=`cd $1; pwd` shift -# This is needed for some reason -export CXX="mpicxx" - # Basic build and run tests -# Make sure that we don't check for a working Fortran compiler -mo="test" -ro="-ams -ij -sstruct -struct -rt -D HYPRE_NO_SAVED" +mo="-j test" +ro="-ams -ij -sstruct -struct -lobpcg -rt -rtol 0.0 -atol 1e-3" -co="--disable-fortran" -./test.sh basic.sh $src_dir -co: $co -mo: $mo -ro: $ro +co="" +./test.sh basic.sh $src_dir -co: $co -mo: $mo ./renametest.sh basic $output_dir/basic-default -co="--enable-debug --disable-fortran" -./test.sh basic.sh $src_dir -co: $co -mo: $mo +co="--enable-debug" +./test.sh basic.sh $src_dir -co: $co -mo: $mo -ro: $ro ./renametest.sh basic $output_dir/basic--enable-debug -co="--enable-bigint --disable-fortran" -./test.sh basic.sh $src_dir -co: $co -mo: $mo -./renametest.sh basic $output_dir/basic--enable-bigint - -co="--enable-mixedint --disable-fortran" -./test.sh basic.sh $src_dir -co: $co -mo: $mo -./renametest.sh basic $output_dir/basic--enable-mixedint - -# Test linking for different languages -link_opts="all++" -for opt in $link_opts -do - output_subdir=$output_dir/link$opt - mkdir -p $output_subdir - ./test.sh link.sh $src_dir $opt - mv -f link.??? $output_subdir -done - # Echo to stderr all nonempty error files in $output_dir for errfile in $( find $output_dir ! -size 0 -name "*.err" ) do diff --git a/external/hypre/AUTOTEST/machine-ray.sh b/external/hypre/AUTOTEST/machine-ray.sh deleted file mode 100644 index 9af1d413..00000000 --- a/external/hypre/AUTOTEST/machine-ray.sh +++ /dev/null @@ -1,118 +0,0 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other -# HYPRE Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -testname=`basename $0 .sh` - -# Echo usage information -case $1 in - -h|-help) - cat <&2 -done - diff --git a/external/hypre/AUTOTEST/machine-rztopaz.sh b/external/hypre/AUTOTEST/machine-rzhound.sh old mode 100644 new mode 100755 similarity index 89% rename from external/hypre/AUTOTEST/machine-rztopaz.sh rename to external/hypre/AUTOTEST/machine-rzhound.sh index 9d79ae0e..98dd9798 --- a/external/hypre/AUTOTEST/machine-rztopaz.sh +++ b/external/hypre/AUTOTEST/machine-rzhound.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -11,14 +11,14 @@ case $1 in -h|-help) cat <&2 +done diff --git a/external/hypre/AUTOTEST/machine-tux-compilers.sh b/external/hypre/AUTOTEST/machine-tux-compilers.sh old mode 100644 new mode 100755 index 54f8b087..4b2e83f6 --- a/external/hypre/AUTOTEST/machine-tux-compilers.sh +++ b/external/hypre/AUTOTEST/machine-tux-compilers.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/AUTOTEST/machine-tux-exlibs.sh b/external/hypre/AUTOTEST/machine-tux-exlibs.sh old mode 100644 new mode 100755 index 30e105d0..b7fa0fe2 --- a/external/hypre/AUTOTEST/machine-tux-exlibs.sh +++ b/external/hypre/AUTOTEST/machine-tux-exlibs.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/AUTOTEST/machine-tux-spack.sh b/external/hypre/AUTOTEST/machine-tux-spack.sh old mode 100644 new mode 100755 index 0800559f..1ced7341 --- a/external/hypre/AUTOTEST/machine-tux-spack.sh +++ b/external/hypre/AUTOTEST/machine-tux-spack.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -37,7 +37,9 @@ src_dir=`cd $1; pwd` shift # OpenMPI limits the number of processes available by default - override +# RDF: The first environment variable didn't work for me export OMPI_MCA_rmaps_base_oversubscribe=1 +export PRTE_MCA_rmaps_default_mapping_policy=:oversubscribe # Basic build and run tests @@ -53,11 +55,21 @@ export OMPI_MCA_rmaps_base_oversubscribe=1 # Use the develop branch for superlu-dist superludistspec="superlu-dist@develop" spackspec="hypre@develop~debug+superlu-dist ^$superludistspec" -spack install $spackspec +# The --fresh option will ensure the latest versions of dependencies are used +spack install --fresh $spackspec spack load $spackspec spackdir=`spack location -i $spackspec` test.sh basic.sh ../src -co: -mo: -spack $spackdir -ro: -superlu ./renametest.sh basic $output_dir/basic-dsuperlu + +# Clean-up spack build +# RDF: Commenting out PR #481 (for now) to test the '--fresh' option above (faster) +# spack spec --yaml $spackspec > test.yaml +# grep ' hash:' test.yaml | sed -e 's/^.*: /\//' | xargs spack mark -e +# spack gc -y +# grep ' hash:' test.yaml | sed -e 's/^.*: /\//' | xargs spack mark -i +# rm -f test.yaml +# spack clean --all spack uninstall -yR $superludistspec # Echo to stderr all nonempty error files in $output_dir diff --git a/external/hypre/AUTOTEST/machine-tux.sh b/external/hypre/AUTOTEST/machine-tux.sh old mode 100644 new mode 100755 index 8914cd9c..ed08800e --- a/external/hypre/AUTOTEST/machine-tux.sh +++ b/external/hypre/AUTOTEST/machine-tux.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -34,6 +34,7 @@ output_dir=`pwd`/$testname.dir rm -fr $output_dir mkdir -p $output_dir src_dir=`cd $1; pwd` +root_dir=`cd $src_dir/..; pwd` shift # Organizing the tests from "fast" to "slow" @@ -96,7 +97,7 @@ co="--enable-shared" ./test.sh basic.sh $src_dir -co: $co -mo: $mo ./renametest.sh basic $output_dir/basic--enable-shared -co="--enable-debug" +co="--enable-debug --with-extra-CFLAGS=\\'-Wstrict-prototypes\\'" ./test.sh basic.sh $src_dir -co: $co -mo: $mo -eo: $eo ./renametest.sh basic $output_dir/basic-debug1 @@ -144,7 +145,7 @@ RO="-ams -ij-mixed -sstruct-mixed -struct -lobpcg-mixed" ./renametest.sh basic $output_dir/basic--enable-mixedint co="--enable-debug --with-print-errors" -./test.sh basic.sh $src_dir -co: $co -mo: $mo -ro: $ro -rt -valgrind +./test.sh basic.sh $src_dir -co: $co -mo: $mo -ro: $ro -error -rt -valgrind ./renametest.sh basic $output_dir/basic--valgrind # CMake build and run tests @@ -153,31 +154,31 @@ ro="-ams -ij -sstruct -struct -lobpcg" eo="" co="" -./test.sh cmake.sh $src_dir -co: $co -mo: $mo +./test.sh cmake.sh $root_dir -co: $co -mo: $mo ./renametest.sh cmake $output_dir/cmake-default co="-DHYPRE_SEQUENTIAL=ON" -./test.sh cmake.sh $src_dir -co: $co -mo: $mo +./test.sh cmake.sh $root_dir -co: $co -mo: $mo ./renametest.sh cmake $output_dir/cmake-sequential co="-DHYPRE_SHARED=ON" -./test.sh cmake.sh $src_dir -co: $co -mo: $mo +./test.sh cmake.sh $root_dir -co: $co -mo: $mo ./renametest.sh cmake $output_dir/cmake-shared co="-DHYPRE_SINGLE=ON" -./test.sh cmake.sh $src_dir -co: $co -mo: $mo -ro: -single +./test.sh cmake.sh $root_dir -co: $co -mo: $mo -ro: -single ./renametest.sh cmake $output_dir/cmake-single co="-DHYPRE_LONG_DOUBLE=ON" -./test.sh cmake.sh $src_dir -co: $co -mo: $mo -ro: -longdouble +./test.sh cmake.sh $root_dir -co: $co -mo: $mo -ro: -longdouble ./renametest.sh cmake $output_dir/cmake-longdouble co="-DCMAKE_BUILD_TYPE=Debug" -./test.sh cmake.sh $src_dir -co: $co -mo: $mo -ro: $ro +./test.sh cmake.sh $root_dir -co: $co -mo: $mo -ro: $ro ./renametest.sh cmake $output_dir/cmake-debug co="-DHYPRE_BIGINT=ON" -./test.sh cmake.sh $src_dir -co: $co -mo: $mo -ro: $ro +./test.sh cmake.sh $root_dir -co: $co -mo: $mo -ro: $ro ./renametest.sh cmake $output_dir/cmake-bigint # cmake build doesn't currently support maxdim diff --git a/external/hypre/AUTOTEST/machine-vs-pro.bat b/external/hypre/AUTOTEST/machine-vs-pro.bat old mode 100644 new mode 100755 index 59188ea7..ef02b6aa --- a/external/hypre/AUTOTEST/machine-vs-pro.bat +++ b/external/hypre/AUTOTEST/machine-vs-pro.bat @@ -1,5 +1,5 @@ @echo off -rem Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +rem Copyright (c) 1998 Lawrence Livermore National Security, LLC and other rem HYPRE Project Developers. See the top-level COPYRIGHT file for details. rem rem SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/AUTOTEST/make.sh b/external/hypre/AUTOTEST/make.sh old mode 100644 new mode 100755 index 6dd7e660..39f785c8 --- a/external/hypre/AUTOTEST/make.sh +++ b/external/hypre/AUTOTEST/make.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/AUTOTEST/renametest.sh b/external/hypre/AUTOTEST/renametest.sh old mode 100644 new mode 100755 index 9d7f5f8d..13d8f40a --- a/external/hypre/AUTOTEST/renametest.sh +++ b/external/hypre/AUTOTEST/renametest.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/AUTOTEST/run.sh b/external/hypre/AUTOTEST/run.sh old mode 100644 new mode 100755 index 1ac1f7b0..f7c54456 --- a/external/hypre/AUTOTEST/run.sh +++ b/external/hypre/AUTOTEST/run.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/AUTOTEST/runtests-error b/external/hypre/AUTOTEST/runtests-error new file mode 100644 index 00000000..97aeafbb --- /dev/null +++ b/external/hypre/AUTOTEST/runtests-error @@ -0,0 +1 @@ +TEST_error/*.sh diff --git a/external/hypre/AUTOTEST/runtests-gpumemcheck b/external/hypre/AUTOTEST/runtests-gpumemcheck new file mode 100644 index 00000000..8915428b --- /dev/null +++ b/external/hypre/AUTOTEST/runtests-gpumemcheck @@ -0,0 +1,2 @@ +TEST_gpumemcheck/*.sh + diff --git a/external/hypre/AUTOTEST/runtests-ij-gpu b/external/hypre/AUTOTEST/runtests-ij-gpu index 9205a9a1..6326bb24 100644 --- a/external/hypre/AUTOTEST/runtests-ij-gpu +++ b/external/hypre/AUTOTEST/runtests-ij-gpu @@ -1,2 +1 @@ -TEST_ij/*.sh - +TEST_ij/[^f]*.sh diff --git a/external/hypre/AUTOTEST/runtests-ij-noilu b/external/hypre/AUTOTEST/runtests-ij-noilu new file mode 100644 index 00000000..340f6e8a --- /dev/null +++ b/external/hypre/AUTOTEST/runtests-ij-noilu @@ -0,0 +1,3 @@ +TEST_ij/[^i]*.sh +TEST_ij/interp.sh + diff --git a/external/hypre/AUTOTEST/runtests-struct b/external/hypre/AUTOTEST/runtests-struct index 0d28db49..ac43572d 100644 --- a/external/hypre/AUTOTEST/runtests-struct +++ b/external/hypre/AUTOTEST/runtests-struct @@ -1,2 +1 @@ -TEST_struct/[^b]*.sh - +TEST_struct/*.sh diff --git a/external/hypre/AUTOTEST/test.sh b/external/hypre/AUTOTEST/test.sh old mode 100644 new mode 100755 index 76f87909..0f1accea --- a/external/hypre/AUTOTEST/test.sh +++ b/external/hypre/AUTOTEST/test.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/CHANGELOG b/external/hypre/CHANGELOG index bc336a8f..a6e149b7 100644 --- a/external/hypre/CHANGELOG +++ b/external/hypre/CHANGELOG @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -7,6 +7,149 @@ # This file chronicles user-level changes, beginning with the most recent. # ============================================================================= +Version 2.33.0 released 2025/04/03 + +- Added verbosity control to error printing +- Updated cmake to provide full build support (matches autotools) +- Added early assembly feature to IJ to minimize memory use +- Added new IJ matrix and vector APIs +- Various bug fixes + +#==================================== + +Version 2.32.0 released 2024/10/08 + +- New MGR features and updates +- New filtering option to AMG for block-diagonal preconditioning +- New memory usage monitoring functions +- Added non-UVM support for ILUT and HMIS coarsening +- Various bug fixes + +#==================================== + +Version 2.31.0 released 2024/02/14 + +- Added iterative ILU0 option +- Refactored MGR interpolation, added column-sum restriction, improved robustness +- Added new print level options for MGR +- Updated IJ vector I/O functions +- Updated default compiler list for configure +- Added a feature to avoid GPU device initialization for CPU runs +- Improved FSAI performance on GPUs +- Added MGR function to set the F-relaxation solver on a specific level +- Various bug fixes + +#==================================== + +Version 2.30.0 released 2023/11/06 + +- Added FSAI support with CUDA and HIP +- Added MAGMA option to FSAI +- Added Binary I/O functions for IJ matrices and vectors +- Added a convergent l1-hybrid symmetric Gauss-Seidel smoother to BoomerAMG +- Added CUDA support to dense direct solver options in BoomerAMG and MGR +- Added SYCL support for triangular solves (enabling Gauss-Seidel, ILU, etc.) + and Chebyshev relaxation +- Improved MGR statistics and data printing +- Added CG options to ignore errors, and added a flexible CG version +- Added superlu_dist support on GPUs +- Various bug fixes + +#==================================== + +Version 2.29.0 released 2023/06/22 + +- Added ILU support for AMD GPUs +- Added new error handling feature to print messages to a memory buffer +- Enabled more support with SYCL: MGR, AMS/ADS/ADE, AIR, ... +- Added MAGMA support +- Added support for CUDA 12 +- Added HYPRE_Initialized/HYPRE_Finalized functions +- Ported MGR features to CUDA and HIP: Non-Galerkin options, block diagonal + interpolation, and block Jacobi relaxation +- Added non-UVM device support for ILU and MGR +- Added cuSOLVER and rocSOLVER support +- Various bug fixes + +#==================================== + +Version 2.28.0 released 2023/03/17 + +- Added new Gaussian elimination options for F-relaxation in MGR. +- Switched to read-the-docs theme for documentation. +- Using autoconf 2.71 now to generate 'configure' script. +- Improved error handling for multi-component vectors. +- Various bug fixes + +#==================================== + +Version 2.27.0 released 2022/12/20 + +- New SStructMatrix and SStructVector AddFEMBoxValues() routines to set finite + element stiffness matrices a box at a time for better performance. +- Added environment variable HYPRE_BRANCH_NAME. +- Added HIP support to the MGR solver. +- Added Jacobi iterative solver approach for ILU smoothing/preconditioning. +- Various optimizations for IJ solvers +- Various CMake build system updates +- Various bug fixes + +#==================================== + +Version 2.26.0 released 2022/10/14 + +- Added a new feature of BoomerAMG (L1-Jacobi and Chebyshev smoothers) and + Krylov subspace solvers with multiple right-hand-side vectors; +- Optimized parallel sparse matrix/multi-component vector multiplication + on CPUs and GPUs. +- Added SYCL support for the IJ interface and various AMG operators; +- Added a runtime switch feature between CPU and GPU; +- Added CMAKE support for CUDA; +- Optimized the performance of AMG interpolation truncation routines with CUDA/HIP; +- Optimized the performance of hypre's SpGEMM kernels on NVIDIA/AMD GPUs; +- Various bug fixes + +#==================================== + +Version 2.25.0 released 2022/06/15 + +- New features in MGR: multilevel assignment of solver options, block Jacobi for + smoothers and inter-grid transfer, CPR, non-Galerkin. +- New factorized sparse approximate inverse (FSAI) solver/preconditioner. Can + also be used as a smoother in BoomerAMG. +- Added various optimizations for Nvidia and AMD GPUs by removing synchronizations, + reducing memory transfers, and adding faster custom kernels. +- Ported parallel matrix matrix multiplicaton to SYCL. +- Infrastructure changes to unify GPU implementations across CUDA/HIP/SYCL. +- Added SStruct I/O routines. +- Various bug fixes. + +#==================================== + +Version 2.24.0 released 2022/02/11 + +- Added SYCL support for the structured interface and solvers +- Added SYCL support for AMG solve phase. +- Enabled GPU setup for the MGR solver. +- Enabled new interpolation options for MGR (L1-Jacobi, MM-ext, MM-ext+i, + MM-ext+e) for both CPU and GPU. +- Added GPU examples for Fortran users ('ex5f.f' and 'ex12f.f'). +- Added source file indentation with Artistic Style (astyle). +- Various bug fixes. + +#==================================== + +Version 2.23.0 released 2021/10/01 + +- Added GPU support for multipass interpolation. +- Added new header file variables (HYPRE_DEVELOP_STRING, HYPRE_DEVELOP_NUMBER, + HYPRE_DEVELOP_BRANCH) to help users working with the development branch. +- Added rocsparse triangular solve required for Gauss-Seidel relaxation when + using hip and rocsparse on AMD GPUs. +- Various bug fixes. + +#==================================== + Version 2.22.1 released 2021/08/20 - Ported Neumann version of AIR to the GPU. diff --git a/external/hypre/INSTALL.md b/external/hypre/INSTALL.md index 260a2ecc..bb13edb6 100644 --- a/external/hypre/INSTALL.md +++ b/external/hypre/INSTALL.md @@ -1,5 +1,5 @@ + +This directory contains recommended git hooks for hypre: + +### The hooks (currently only one) + +* `pre-commit` is a hook that is applied before each commit that runs `astyle` +to format code according to hypre coding style guidelines. + +### Setup + +To setup the git hooks, copy the hooks to the `.git/hooks` directory (or create +a symbolic link to them, e.g., `ln -s ../../src/config/githooks/pre-commit .`). + diff --git a/external/hypre/src/config/githooks/pre-commit b/external/hypre/src/config/githooks/pre-commit new file mode 100755 index 00000000..d010d4b3 --- /dev/null +++ b/external/hypre/src/config/githooks/pre-commit @@ -0,0 +1,9 @@ +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +# Apply code formatting +( cd $(git rev-parse --show-toplevel)/src; ./config/astyle-apply.sh . ) + diff --git a/external/hypre/src/config/hypre_blas_macros.m4 b/external/hypre/src/config/hypre_blas_macros.m4 index 8335f21e..65b286a7 100644 --- a/external/hypre/src/config/hypre_blas_macros.m4 +++ b/external/hypre/src/config/hypre_blas_macros.m4 @@ -1,4 +1,4 @@ -dnl Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +dnl Copyright (c) 1998 Lawrence Livermore National Security, LLC and other dnl HYPRE Project Developers. See the top-level COPYRIGHT file for details. dnl dnl SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/config/hypre_lapack_macros.m4 b/external/hypre/src/config/hypre_lapack_macros.m4 index 501cb0c2..2a75db7c 100644 --- a/external/hypre/src/config/hypre_lapack_macros.m4 +++ b/external/hypre/src/config/hypre_lapack_macros.m4 @@ -1,4 +1,4 @@ -dnl Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +dnl Copyright (c) 1998 Lawrence Livermore National Security, LLC and other dnl HYPRE Project Developers. See the top-level COPYRIGHT file for details. dnl dnl SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/config/hypre_macros_misc.m4 b/external/hypre/src/config/hypre_macros_misc.m4 index 14319b50..5c186a04 100644 --- a/external/hypre/src/config/hypre_macros_misc.m4 +++ b/external/hypre/src/config/hypre_macros_misc.m4 @@ -1,4 +1,4 @@ -dnl Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +dnl Copyright (c) 1998 Lawrence Livermore National Security, LLC and other dnl HYPRE Project Developers. See the top-level COPYRIGHT file for details. dnl dnl SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -15,15 +15,15 @@ dnl if it is not found. If ACTION-IF-FOUND is not specified, dnl the default action will define HAVE_MPI. dnl ********************************************************************** AC_DEFUN([AC_HYPRE_CHECK_MPI], -[AC_PREREQ(2.57)dnl -AC_PREREQ(2.50) dnl for AC_LANG_CASE +[AC_PREREQ([2.69])dnl +AC_PREREQ([2.69]) dnl for AC_LANG_CASE if test x = x"$MPILIBS"; then AC_LANG_CASE([C], [AC_CHECK_FUNC(MPI_Init, [MPILIBS=" "])], [C++], [AC_CHECK_FUNC(MPI_Init, [MPILIBS=" "])], [Fortran 77], [AC_MSG_CHECKING([for MPI_Init]) - AC_TRY_LINK([],[ call MPI_Init], [MPILIBS=" " - AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)])]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ call MPI_Init]])],[MPILIBS=" " + AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])]) fi if test x = x"$MPILIBS"; then @@ -34,16 +34,16 @@ if test x = x"$MPILIBS"; then AC_CHECK_LIB(mpich, MPI_Init, [MPILIBS="-lmpich"]) fi -dnl We have to use AC_TRY_COMPILE and not AC_CHECK_HEADER because the -dnl latter uses $CPP, not $CC (which may be mpicc). +dnl We have to use AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[],[]) and not +dnl AC_CHECK_HEADER because the latter uses $CPP, not $CC (which may be mpicc). AC_LANG_CASE([C], [if test x != x"$MPILIBS"; then AC_MSG_CHECKING([for mpi.h]) - AC_TRY_COMPILE([#include ],[],[AC_MSG_RESULT(yes)], [MPILIBS="" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[]])],[AC_MSG_RESULT(yes)],[MPILIBS="" AC_MSG_RESULT(no)]) fi], [C++], [if test x != x"$MPILIBS"; then AC_MSG_CHECKING([for mpi.h]) - AC_TRY_COMPILE([#include ],[],[AC_MSG_RESULT(yes)], [MPILIBS="" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[]])],[AC_MSG_RESULT(yes)],[MPILIBS="" AC_MSG_RESULT(no)]) fi]) @@ -94,37 +94,37 @@ dnl * dnl * Set compile FLAGS for optimization dnl ********************************************************************** AC_DEFUN([AC_HYPRE_OPTIMIZATION_FLAGS], -[AC_PREREQ(2.57)dnl +[AC_PREREQ([2.69])dnl if test "x${hypre_user_chose_cflags}" = "xno" then - case `basename "${CC}"` in + case `basename ${CC}` in gcc|mpigcc|mpicc) CFLAGS="-O2" if test "$hypre_using_openmp" = "yes" ; then - CFLAGS="$CFLAGS -fopenmp" - LDFLAGS="$LDFLAGS -fopenmp" + CFLAGS+=" -fopenmp" + LDFLAGS+=" -fopenmp" fi ;; - icc|mpiicc) + icc|mpiicc|icx|mpiicx) CFLAGS="-O2" if test "$hypre_using_openmp" = "yes" ; then - CFLAGS="$CFLAGS -qopenmp" - LDFLAGS="$LDFLAGS -qopenmp" + CFLAGS+=" -qopenmp" + LDFLAGS+=" -qopenmp" fi ;; pgcc|mpipgcc|mpipgicc) CFLAGS="-fast" if test "$hypre_using_openmp" = "yes" ; then - CFLAGS="$CFLAGS -mp" - LDFLAGS="$LDFLAGS -mp" + CFLAGS+=" -mp" + LDFLAGS+=" -mp" fi ;; cc|xlc|xlc_r|mpxlc|mpixlc|mpixlc_r|mpixlc-gpu|mpcc) CFLAGS="-O2" if test "$hypre_using_openmp" = "yes" ; then - CFLAGS="$CFLAGS -qsmp=omp" - LDFLAGS="$LDFLAGS -qsmp=omp" + CFLAGS+=" -qsmp=omp" + LDFLAGS+=" -qsmp=omp" fi ;; KCC|mpiKCC) @@ -138,29 +138,29 @@ fi if test "x${hypre_user_chose_cxxflags}" = "xno" then - case `basename "${CXX}"` in + case `basename ${CXX}` in g++|gCC|mpig++|mpicxx|mpic++|mpiCC) CXXFLAGS="-O2" if test "$hypre_using_openmp" = "yes" ; then - CXXFLAGS="$CXXFLAGS -fopenmp" + CXXFLAGS+=" -fopenmp" fi ;; - icpc|icc|mpiicpc|mpiicc) + icpc|icc|mpiicpc|mpiicc|icpx|mpiicpx) CXXFLAGS="-O2" if test "$hypre_using_openmp" = "yes" ; then - CXXFLAGS="$CXXFLAGS -qopenmp" + CXXFLAGS+=" -qopenmp" fi ;; pgCC|mpipgCC|pgc++|mpipgic++) CXXFLAGS="-fast" if test "$hypre_using_openmp" = "yes" ; then - CXXFLAGS="$CXXFLAGS -mp" + CXXFLAGS+=" -mp" fi ;; CC|cxx|xlC|xlC_r|mpxlC|mpixlC|mpixlC-gpu|mpixlcxx|mpixlcxx_r|mpCC) CXXFLAGS="-O2" if test "$hypre_using_openmp" = "yes" ; then - CXXFLAGS="$CXXFLAGS -qsmp=omp" + CXXFLAGS+=" -qsmp=omp" fi ;; KCC|mpiKCC) @@ -172,31 +172,31 @@ then esac fi -if test "x${hypre_user_chose_fflags}" = "xno" +if test "$hypre_using_fortran" = "yes" -a "x${hypre_user_chose_fflags}" = "xno" then - case `basename "${FC}"` in + case `basename ${FC}` in g77|gfortran|mpigfortran|mpif77) FFLAGS="-O2" if test "$hypre_using_openmp" = "yes" ; then - FFLAGS="$FFLAGS -fopenmp" + FFLAGS+=" -fopenmp" fi ;; ifort|mpiifort) FFLAGS="-O2" if test "$hypre_using_openmp" = "yes" ; then - FFLAGS="$FFLAGS -qopenmp" + FFLAGS+=" -qopenmp" fi ;; pgf77|mpipgf77|pgfortran|mpipgifort) FFLAGS="-fast" if test "$hypre_using_openmp" = "yes" ; then - FFLAGS="$FFLAGS -mp" + FFLAGS+=" -mp" fi ;; f77|f90|xlf|xlf_r|mpxlf|mpixlf77|mpixlf77_r) FFLAGS="-O2" if test "$hypre_using_openmp" = "yes" ; then - FFLAGS="$FFLAGS -qsmp=omp" + FFLAGS+=" -qsmp=omp" fi ;; kf77|mpikf77) @@ -214,37 +214,37 @@ dnl * dnl * Set compile FLAGS for debug dnl ********************************************************************** AC_DEFUN([AC_HYPRE_DEBUG_FLAGS], -[AC_PREREQ(2.57)dnl +[AC_PREREQ([2.69])dnl if test "x${hypre_user_chose_cflags}" = "xno" then - case `basename "${CC}"` in + case `basename ${CC}` in gcc|mpigcc|mpicc) - CFLAGS="-g -Wall" + CFLAGS="-O0 -g -Wall" if test "$hypre_using_openmp" = "yes" ; then - CFLAGS="$CFLAGS -fopenmp" - LDFLAGS="$LDFLAGS -fopenmp" + CFLAGS+=" -fopenmp" + LDFLAGS+=" -fopenmp" fi ;; - icc|mpiicc) - CFLAGS="-g" + icc|mpiicc|icx|mpiicx) + CFLAGS="-O0 -g -Wall" if test "$hypre_using_openmp" = "yes" ; then - CFLAGS="$CFLAGS -qopenmp" - LDFLAGS="$LDFLAGS -qopenmp" + CFLAGS+=" -qopenmp" + LDFLAGS+=" -qopenmp" fi ;; pgcc|mpipgcc|mpipgicc) - CFLAGS="-g" + CFLAGS="-O0 -g -Wall" if test "$hypre_using_openmp" = "yes" ; then - CFLAGS="$CFLAGS -mp" - LDFLAGS="$LDFLAGS -mp" + CFLAGS+=" -mp" + LDFLAGS+=" -mp" fi ;; cc|xlc|mpxlc|mpixlc|mpcc) - CFLAGS="-g" + CFLAGS="-O0 -g -Wall" if test "$hypre_using_openmp" = "yes" ; then - CFLAGS="$CFLAGS -qsmp=omp" - LDFLAGS="$LDFLAGS -qsmp=omp" + CFLAGS+=" -qsmp=omp" + LDFLAGS+=" -qsmp=omp" fi ;; KCC|mpiKCC) @@ -258,29 +258,29 @@ fi if test "x${hypre_user_chose_cxxflags}" = "xno" then - case `basename "${CXX}"` in + case `basename ${CXX}` in g++|gCC|mpig++|mpicxx|mpic++|mpiCC) - CXXFLAGS="-g -Wall" + CXXFLAGS="-O0 -g -Wall" if test "$hypre_using_openmp" = "yes" ; then - CXXFLAGS="$CXXFLAGS -fopenmp" + CXXFLAGS+=" -fopenmp" fi ;; - icpc|icc|mpiicpc|mpiicc) - CXXFLAGS="-g" + icpc|icc|mpiicpc|mpiicc|icpx|mpiicpx) + CXXFLAGS="-O0 -g -Wall" if test "$hypre_using_openmp" = "yes" ; then - CXXFLAGS="$CXXFLAGS -qopenmp" + CXXFLAGS+=" -qopenmp" fi ;; pgCC|mpipgCC|pgc++|mpipgic++) - CXXFLAGS="-g" + CXXFLAGS="-O0 -g -Wall" if test "$hypre_using_openmp" = "yes" ; then - CXXFLAGS="$CXXFLAGS -mp" + CXXFLAGS+=" -mp" fi ;; CC|cxx|xlC|mpxlC|mpixlcxx|mpCC) - CXXFLAGS="-g" + CXXFLAGS="-O0 -g" if test "$hypre_using_openmp" = "yes" ; then - CXXFLAGS="$CXXFLAGS -qsmp=omp" + CXXFLAGS+=" -qsmp=omp" fi ;; KCC|mpiKCC) @@ -292,16 +292,16 @@ then esac fi -if test "x${hypre_user_chose_fflags}" = "xno" +if test "$hypre_using_fortran" = "yes" -a "x${hypre_user_chose_fflags}" = "xno" then - case `basename "${FC}"` in + case `basename ${FC}` in g77|gfortran|mpigfortran|mpif77) FFLAGS="-g -Wall" if test "$hypre_using_openmp" = "yes" ; then FFLAGS="$FFLAGS -fopenmp" fi ;; - ifort|mpiifort) + ifort|mpiifort|ifx|mpiifx) FFLAGS="-g" if test "$hypre_using_openmp" = "yes" ; then FFLAGS="$FFLAGS -qopenmp" diff --git a/external/hypre/src/config/install-sh b/external/hypre/src/config/install-sh old mode 100644 new mode 100755 index e4160c99..20cad0be --- a/external/hypre/src/config/install-sh +++ b/external/hypre/src/config/install-sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # install - install a program, script, or datafile scriptversion=2004-04-01.17 diff --git a/external/hypre/src/config/mkinstalldirs b/external/hypre/src/config/mkinstalldirs old mode 100644 new mode 100755 index 6fbe5e11..b55d9014 --- a/external/hypre/src/config/mkinstalldirs +++ b/external/hypre/src/config/mkinstalldirs @@ -1,4 +1,4 @@ -#! /bin/sh +#! /bin/bash # mkinstalldirs --- make directory hierarchy scriptversion=2004-02-15.20 diff --git a/external/hypre/src/config/update-cmake.py b/external/hypre/src/config/update-cmake.py new file mode 100755 index 00000000..11b6fd38 --- /dev/null +++ b/external/hypre/src/config/update-cmake.py @@ -0,0 +1,115 @@ +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +import argparse +import os + +def extract_files_from_section(input_text, section_start): + files = [] + collect_files = False + for line in input_text.splitlines(): + if line.strip().startswith(section_start): + collect_files = True + continue + + if collect_files: + if line.strip() == "": + break # Assuming an empty line marks the end of the section + + # Extract the file name, assuming no spaces in file names + file_name = line.strip().split("\\")[0] + + # Filter only source files + if file_name.endswith('.c') or file_name.endswith('.cpp'): + files.append(file_name) + + return files + +def are_files_in_list(file_list_a, file_list_b): + return [fn for fn in file_list_a if fn not in file_list_b] + +def add_missing_files(file_content, section_start, missing_files): + lines = file_content.split('\n') + updated_lines = [] + in_section_start = -1 + in_section_end = -1 + + # Identify the start and end of the SRCS block + for i, line in enumerate(lines): + trimmed_line = line.strip() + if trimmed_line.startswith(section_start): + in_section_start = i + + if in_section_start != -1 and trimmed_line.endswith(")") and in_section_end == -1: + in_section_end = i + break + + if in_section_start == -1 or in_section_end == -1: + print("Error: Could not find a complete SRCS block in file B.") + return file_content + + # Add all lines up to the end of the section, excluding the closing parenthesis + updated_lines.extend(lines[:in_section_end]) + + # Add missing files + for missing_file in missing_files: + updated_lines.append(f" {missing_file}") + + # Add closing parenthesis + updated_lines.append(lines[in_section_end]) + + # Add remaining lines + updated_lines.extend(lines[in_section_end + 1:]) + + updated_content = '\n'.join(updated_lines) + return updated_content + +def process(args, section_A, section_B): + # Read file contents + file_A_path = os.path.join(args.folder, "Makefile") + file_B_path = os.path.join(args.folder, "CMakeLists.txt") + with open(file_A_path, 'r') as file_A, open(file_B_path, 'r') as file_B: + file_A_content = file_A.read() + file_B_content = file_B.read() + + # Extract files + files_A = extract_files_from_section(file_A_content, section_A) + files_B = extract_files_from_section(file_B_content, section_B) + if args.verbose: + print(f"{files_A = }\n") + print(f"{files_B = }") + + # Check if all files in A are in B + missing = are_files_in_list(files_A, files_B) + + if missing: + print("\nAdded to FILE B:", missing) + new_file_B_content = add_missing_files(file_B_content, section_B, missing) + with open(file_B_path, 'w') as file_B: + file_B.write(new_file_B_content) + +def main(): + parser = argparse.ArgumentParser(description="Check and update CMakeLists based on the contents of Makefile") + parser.add_argument("-f", "--folder", required=True, help="Folder path") + parser.add_argument("-v", "--verbose", action="store_true", help="Turn on verbose mode") + args = parser.parse_args() + + # Validate folder path + args.folder = os.path.normpath(args.folder) + if not os.path.isdir(args.folder): + print("The specified folder does not exist or is not a directory.") + return + + # Process source files + process(args, "FILES =", "set(SRCS") + + # Process GPU source files + process(args, "CUFILES =", "set(GPU_SRCS") + + # Done! + print(f"Done with {args.folder = }...") + +if __name__ == "__main__": + main() diff --git a/external/hypre/src/config/update-cmake.sh b/external/hypre/src/config/update-cmake.sh new file mode 100755 index 00000000..18b34484 --- /dev/null +++ b/external/hypre/src/config/update-cmake.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +# Usage: +# ./update-cmake.sh +# +# The script checks for missing source files listed in various CMakeLists.txt +# by looking at the respective Makefile. If any files are missing, they are added +# to CMakeLists.txt + +DIRNAME=$(dirname $0) +FOLDERS=(blas examples IJ_mv krylov lapack parcsr_block_mv parcsr_ls parcsr_mv seq_block_mv seq_mv sstruct_ls sstruct_mv test utilities) + +for FOLDER in ${FOLDERS[@]}; do + python3 ${DIRNAME}/update-cmake.py -f ${DIRNAME}/../${FOLDER} +done diff --git a/external/hypre/src/config/update.sh b/external/hypre/src/config/update.sh old mode 100644 new mode 100755 index 08d93d04..31a19701 --- a/external/hypre/src/config/update.sh +++ b/external/hypre/src/config/update.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -34,7 +34,7 @@ sed -e 's#m4_define.*HYPRE_DATE[^)]*#m4_define([M4_HYPRE_DATE], ['$hypre_reld > config/configure.in.tmp mv config/configure.in.tmp config/configure.in -ln -s config/configure.in . +ln -s -f config/configure.in . rm -rf aclocal.m4 configure autom4te.cache autoconf --include=config autoheader configure.in @@ -61,4 +61,3 @@ mv CMakeLists.txt.tmp CMakeLists.txt ##### Update release information in documentation (cd docs; ./update-release.sh) - diff --git a/external/hypre/src/config/version.sh b/external/hypre/src/config/version.sh old mode 100644 new mode 100755 index 832d4931..e708393e --- a/external/hypre/src/config/version.sh +++ b/external/hypre/src/config/version.sh @@ -1,11 +1,11 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -hypre_version="2.22.1" -hypre_reldate="2021/08/20" +hypre_version="2.33.0" +hypre_reldate="2025/04/03" hypre_major=`echo $hypre_version | cut -d. -f 1` hypre_minor=`echo $hypre_version | cut -d. -f 2` diff --git a/external/hypre/src/configure b/external/hypre/src/configure old mode 100644 new mode 100755 index d1fa2ada..99f92a8f --- a/external/hypre/src/configure +++ b/external/hypre/src/configure @@ -1,16 +1,17 @@ #! /bin/sh # From configure.in Id. # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for hypre 2.22.1. +# Generated by GNU Autoconf 2.71 for hypre 2.33.0. # # -# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, +# Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. # -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. ## -------------------- ## ## M4sh Initialization. ## @@ -18,14 +19,16 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else +else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -35,46 +38,46 @@ esac fi + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then +if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -83,13 +86,6 @@ if test "${PATH_SEPARATOR+set}" != set; then fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -98,8 +94,12 @@ case $0 in #(( for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS @@ -111,30 +111,10 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. @@ -156,20 +136,22 @@ esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -as_fn_exit 255 +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + as_bourne_compatible="as_nop=: +if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST -else +else \$as_nop case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( @@ -189,42 +171,53 @@ as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : +if ( set x; as_fn_ret_success y && test x = \"\$1\" ) +then : -else +else \$as_nop exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 +blah=\$(echo \$(echo blah)) +test x\"\$blah\" = xblah || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null; then : + if (eval "$as_required") 2>/dev/null +then : as_have_required=yes -else +else $as_nop as_have_required=no fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null +then : -else +else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base + as_shell=$as_dir$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null +then : break 2 fi fi @@ -232,14 +225,21 @@ fi esac as_found=false done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi +fi - if test "x$CONFIG_SHELL" != x; then : + if test "x$CONFIG_SHELL" != x +then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also @@ -257,18 +257,19 @@ esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." + if test x$as_have_required = xno +then : + printf "%s\n" "$0: This script requires a shell more modern than all" + printf "%s\n" "$0: the shells that I found on your system." + if test ${ZSH_VERSION+y} ; then + printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" + printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else - $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, + printf "%s\n" "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." @@ -295,6 +296,7 @@ as_fn_unset () } as_unset=as_fn_unset + # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -312,6 +314,14 @@ as_fn_exit () as_fn_set_status $1 exit $1 } # as_fn_exit +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop # as_fn_mkdir_p # ------------- @@ -326,7 +336,7 @@ as_fn_mkdir_p () as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -335,7 +345,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | +printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -374,12 +384,13 @@ as_fn_executable_p () # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : eval 'as_fn_append () { eval $1+=\$2 }' -else +else $as_nop as_fn_append () { eval $1=\$$1\$2 @@ -391,18 +402,27 @@ fi # as_fn_append # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else +else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- @@ -414,9 +434,9 @@ as_fn_error () as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $2" >&2 + printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -443,7 +463,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -487,7 +507,7 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall @@ -501,6 +521,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits exit } + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -514,6 +538,13 @@ case `echo -n x` in #((((( ECHO_N='-n';; esac +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + + rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -581,8 +612,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='hypre' PACKAGE_TARNAME='hypre' -PACKAGE_VERSION='2.22.1' -PACKAGE_STRING='hypre 2.22.1' +PACKAGE_VERSION='2.33.0' +PACKAGE_STRING='hypre 2.33.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -590,40 +621,36 @@ ac_unique_file="HYPRE.h" ac_default_prefix=`pwd`/hypre # Factoring default headers for most tests. ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include +#include +#ifdef HAVE_STDIO_H +# include #endif -#ifdef STDC_HEADERS +#ifdef HAVE_STDLIB_H # include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif #endif #ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif # include #endif -#ifdef HAVE_STRINGS_H -# include -#endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif #ifdef HAVE_UNISTD_H # include #endif" +ac_header_c_list= ac_subst_vars='LTLIBOBJS LIBOBJS AR @@ -631,8 +658,13 @@ DSUPERLU_LIBS DSUPERLU_INCLUDE SUPERLU_LIBS SUPERLU_INCLUDE +HYPRE_MAGMA_LIB +HYPRE_MAGMA_INCLUDE +HYPRE_MAGMA_LIB_DIR CALIPER_LIBS CALIPER_INCLUDE +HYPRE_SYCL_LIBS +HYPRE_SYCL_INCL HYPRE_HIP_LIBS HYPRE_HIP_INCL HYPRE_CUDA_LIBS @@ -746,6 +778,7 @@ infodir docdir oldincludedir includedir +runstatedir localstatedir sharedstatedir sysconfdir @@ -780,24 +813,20 @@ enable_persistent enable_hopscotch enable_fortran enable_unified_memory -enable_cuda_streams -enable_cusparse enable_device_memory_pool -enable_cublas -enable_curand -enable_rocsparse -enable_rocblas -enable_rocrand +enable_device_malloc_async +enable_thrust_nosync enable_gpu_profiling enable_gpu_aware_mpi +with_cxxstandard with_LD with_LDFLAGS with_extra_CFLAGS with_extra_CXXFLAGS +with_extra_CUFLAGS with_extra_BUILDFLAGS with_extra_incpath with_extra_ldpath -with_insure with_strict_checking with_MPI_include with_MPI_libs @@ -806,6 +835,7 @@ with_MPI_flags with_node_aware_mpi with_node_aware_mpi_include with_memory_tracker +with_test_using_host with_blas_lib with_blas_libs with_blas_lib_dirs @@ -830,8 +860,23 @@ with_mli with_MPI with_cuda with_hip +enable_rocsparse +enable_rocblas +enable_rocsolver +enable_rocrand +with_sycl with_cuda_home with_gpu_arch +enable_cublas +enable_curand +enable_cuda_streams +enable_cusparse +enable_cusolver +with_sycl_target +with_sycl_target_backend +enable_onemklsparse +enable_onemklblas +enable_onemklrand with_raja with_raja_include with_raja_lib @@ -851,6 +896,11 @@ with_umpire_include with_umpire_lib with_umpire_libs with_umpire_lib_dirs +with_magma +with_magma_include +with_magma_lib +with_magma_libs +with_magma_lib_dirs with_caliper with_caliper_include with_caliper_lib @@ -913,6 +963,7 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -942,8 +993,6 @@ do *) ac_optarg=yes ;; esac - # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; @@ -984,9 +1033,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -1010,9 +1059,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -1165,6 +1214,15 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1214,9 +1272,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1230,9 +1288,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1276,9 +1334,9 @@ Try \`$0 --help' for more information" *) # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; @@ -1294,7 +1352,7 @@ if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1302,7 +1360,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1358,7 +1416,7 @@ $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | +printf "%s\n" X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1415,7 +1473,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures hypre 2.22.1 to adapt to many kinds of systems. +\`configure' configures hypre 2.33.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1455,6 +1513,7 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -1480,7 +1539,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of hypre 2.22.1:";; + short | recursive ) echo "Configuration of hypre 2.33.0:";; esac cat <<\_ACEOF @@ -1506,21 +1565,33 @@ Optional Features: --enable-fortran Require a working Fortran compiler (default is YES). --enable-unified-memory Use unified memory for allocating the memory (default is NO). - --enable-cuda-streams Use CUDA streams (default is YES). - --enable-cusparse Use cuSPARSE (default is YES). --enable-device-memory-pool Use device pooling allocator (default is NO). - --enable-cublas Use cuBLAS (default is NO). - --enable-curand Use cuRAND (default is YES). - --enable-rocsparse Use rocSPARSE (default is YES). - --enable-rocblas Use rocBLAS (default is NO). - --enable-rocrand Use rocRAND (default is YES). + --enable-device-malloc-async + Use device async malloc (default is NO). + --enable-thrust-nosync Use thrust par_nosync policy (default is NO). --enable-gpu-profiling Use NVTX on CUDA, rocTX on HIP (default is NO). --enable-gpu-aware-mpi Use GPU memory aware MPI + --enable-rocsparse Use rocSPARSE (default is YES with HIP, otherwise + NO). + --enable-rocblas Use rocBLAS (default is NO). + --enable-rocsolver Use rocSOLVER (default is NO). + --enable-rocrand Use rocRAND (default is YES with HIP, otherwise NO). + --enable-cublas Use cuBLAS (default is YES with CUDA, otherwise NO). + --enable-curand Use cuRAND (default is YES with CUDA, otherwise NO). + --enable-cuda-streams Use CUDA streams (default is YES with CUDA, + otherwise NO). + --enable-cusparse Use cuSPARSE (default is YES with CUDA, otherwise + NO). + --enable-cusolver Use cuSOLVER (default is NO). + --enable-onemklsparse Use oneMKL sparse (default is YES). + --enable-onemklblas Use oneMKL blas (default is YES). + --enable-onemklrand Use oneMKL rand (default is YES). Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-cxxstandard=val User specifies c++ starndard in val. --with-LD=ARG Set linker to ARG. The environment variable 'LD' will be overridden. --with-LDFLAGS=ARG User can manually set linker flags. The 'LDFLAGS' @@ -1532,6 +1603,10 @@ Optional Packages: Define extra C++ compile flag, where ARG is a space-separated list (enclosed in quotes) of directories. + --with-extra-CUFLAGS=ARG + Define extra CUDA compile flag, where ARG is a + space-separated list (enclosed in quotes) of + directories. --with-extra-BUILDFLAGS=ARG Define extra library build flag, where ARG is a space-separated list (enclosed in quotes) of @@ -1544,8 +1619,6 @@ Optional Packages: Define extra ld path, where PATH is a space-separated list (enclosed in quotes) of directories. - --with-insure=FLAGS FLAGS are options to pass to insure. Nothing is done - to verify that insure is available --with-strict-checking Compiles without MPI ('--without-MPI') and tries to find a compiler option that warns of as many non-ISO features as possible. @@ -1572,6 +1645,8 @@ Optional Packages: --with-node-aware-mpi-include=DIR User specifies that nap_comm.hpp is in DIR. --with-memory-tracker Use memory tracker in hypre (default is NO). + --with-test-using-host Use host memory in hypre test drivers (default is + NO). --with-blas-lib=LIBS LIBS is space-separated linkable list (enclosed in quotes) of libraries needed for BLAS. OK to use -L and -l flags in the list @@ -1635,11 +1710,22 @@ Optional Packages: --with-cuda Use CUDA. Require cuda-8.0 or higher (default is NO). --with-hip Use HIP for AMD GPUs. (default is NO). + --with-sycl Use SYCL for Intel GPUs. (default is NO). --with-cuda-home=DIR User specifies CUDA_HOME in DIR. --with-gpu-arch=ARG User specifies NVIDIA GPU architecture that the CUDA files will be compiled for in ARG, where ARG is a space-separated list (enclosed in quotes) of numbers. + --with-sycl-target=ARG User specifies sycl targets for AOT compilation in + ARG, where ARG is a comma-separated list (enclosed + in quotes), e.g. "spir64_gen". + --with-sycl-target-backend=ARG + User specifies additional options for the sycl + target backend for AOT compilation in ARG, where ARG + contains the desired options (enclosed in + double+single quotes), e.g. + --with-sycl-target-backend="'-device + 12.1.0,12.4.0'". --with-raja Use RAJA. Require RAJA package to be compiled properly (default is NO). --with-raja-include=DIR User specifies that RAJA/*.h is in DIR. The options @@ -1704,6 +1790,25 @@ Optional Packages: --with-umpire-libs, e.g "usr/lib /usr/local/lib". The options --with-umpire-libs and --with-umpire-dirs must be used together. + --with-magma Use MAGMA (Matrix Algebra for GPUs and Multicore + Architectures). + --with-magma-include=DIR + User specifies that MAGMA headers are in DIR. The + options --with-magma-include --with-magma-libs and + --with-magma-dirs must be used together. + --with-magma-lib=LIBS LIBS is space-separated linkable list (enclosed in + quotes) of libraries needed for MAGMA. OK to use -L + and -l flags in the list + --with-magma-libs=LIBS LIBS is space-separated list (enclosed in quotes) of + libraries needed for MAGMA (base name only). The + options --with-magma-libs and --with-magma-lib-dirs + must be used together. + --with-magma-lib-dirs=DIRS + DIRS is space-separated list (enclosed in quotes) of + directories containing the libraries specified by + --with-magma-libs, e.g "usr/lib /usr/local/lib". The + options --with-magma-libs and --with-magma-lib-dirs + must be used together. --with-caliper Use Caliper instrumentation (default is NO). --with-caliper-include=DIR Directory where Caliper is installed. @@ -1751,9 +1856,9 @@ if test "$ac_init_help" = "recursive"; then case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -1781,7 +1886,8 @@ esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. + # Check for configure.gnu first; this name is used for a wrapper for + # Metaconfig's "Configure" on case-insensitive file systems. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive @@ -1789,7 +1895,7 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix echo && $SHELL "$ac_srcdir/configure" --help=recursive else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done @@ -1798,14 +1904,14 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -hypre configure 2.22.1 -generated by GNU Autoconf 2.69 +hypre configure 2.33.0 +generated by GNU Autoconf 2.71 -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2021 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. -Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +Copyright (c) 1998 Lawrence Livermore National Security, LLC and other HYPRE Project Developers. See the top-level COPYRIGHT file for details. _ACEOF exit @@ -1821,14 +1927,14 @@ fi ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext + rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1836,14 +1942,15 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then : + } && test -s conftest.$ac_objext +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1859,14 +1966,14 @@ fi ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext + rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1874,14 +1981,15 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then : + } && test -s conftest.$ac_objext +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1897,14 +2005,14 @@ fi ac_fn_fc_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext + rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1912,14 +2020,15 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_fc_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then : + } && test -s conftest.$ac_objext +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1935,14 +2044,14 @@ fi ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1950,17 +2059,18 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext - }; then : + } +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1981,11 +2091,12 @@ fi ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. @@ -1993,16 +2104,9 @@ else #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif + which can conflict with char $2 (); below. */ +#include #undef $2 /* Override any GCC internal prototype to avoid an error. @@ -2028,24 +2132,25 @@ choke me #endif #endif int -main () +main (void) { return $2 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$3=yes" -else +else $as_nop eval "$3=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func @@ -2062,7 +2167,7 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -2070,14 +2175,15 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err - }; then : + } +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -2087,135 +2193,6 @@ fi } # ac_fn_c_try_cpp -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_mongrel - -# ac_fn_c_try_run LINENO -# ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. -ac_fn_c_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_run - # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in @@ -2223,37 +2200,59 @@ fi ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$3=yes" -else +else $as_nop eval "$3=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile +ac_configure_args_raw= +for ac_arg +do + case $ac_arg in + *\'*) + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append ac_configure_args_raw " '$ac_arg'" +done + +case $ac_configure_args_raw in + *$as_nl*) + ac_safe_unquote= ;; + *) + ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. + ac_unsafe_a="$ac_unsafe_z#~" + ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" + ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; +esac + cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by hypre $as_me 2.22.1, which was -generated by GNU Autoconf 2.69. Invocation command line was +It was created by hypre $as_me 2.33.0, which was +generated by GNU Autoconf 2.71. Invocation command line was - $ $0 $@ + $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log @@ -2286,8 +2285,12 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS @@ -2322,7 +2325,7 @@ do | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; @@ -2357,11 +2360,13 @@ done # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? + # Sanitize IFS. + IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo - $as_echo "## ---------------- ## + printf "%s\n" "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo @@ -2372,8 +2377,8 @@ trap 'exit_status=$? case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -2397,7 +2402,7 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; ) echo - $as_echo "## ----------------- ## + printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo @@ -2405,14 +2410,14 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## + printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo @@ -2420,15 +2425,15 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then - $as_echo "## ----------- ## + printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo @@ -2436,8 +2441,8 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; echo fi test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" + printf "%s\n" "$as_me: caught signal $ac_signal" + printf "%s\n" "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && @@ -2451,63 +2456,48 @@ ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h -$as_echo "/* confdefs.h */" > confdefs.h +printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF +printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF +printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF +printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF +printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF +printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" -_ACEOF +printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in #(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac + ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site + ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site + ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" + +for ac_site_file in $ac_site_files do - test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} + case $ac_site_file in #( + */*) : + ;; #( + *) : + ac_site_file=./$ac_site_file ;; +esac + if test -f "$ac_site_file" && test -r "$ac_site_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi @@ -2517,118 +2507,722 @@ if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +printf "%s\n" "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +printf "%s\n" "$as_me: creating cache $cache_file" >&6;} >$cache_file fi -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 -fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -ac_config_headers="$ac_config_headers HYPRE_config.h:config/HYPRE_config.h.in" - - - -ac_aux_dir= -for ac_dir in config "$srcdir"/config; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in config \"$srcdir\"/config" "$LINENO" 5 -fi +# Test code for whether the C compiler supports C89 (global declarations) +ac_c_conftest_c89_globals=' +/* Does the compiler advertise C89 conformance? + Do not test the value of __STDC__, because some compilers set it to 0 + while being otherwise adequately conformant. */ +#if !defined __STDC__ +# error "Compiler does not advertise C89 conformance" +#endif -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ +struct buf { int x; }; +struct buf * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not \xHH hex character constants. + These do not provoke an error unfortunately, instead are silently treated + as an "x". The following induces an error, until -std is added to get + proper ANSI mode. Curiously \x00 != x always comes out true, for an + array size at least. It is necessary to write \x00 == 0 to get something + that is true only with -std. */ +int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) '\''x'\'' +int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), + int, int);' + +# Test code for whether the C compiler supports C89 (body of main). +ac_c_conftest_c89_main=' +ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); +' + +# Test code for whether the C compiler supports C99 (global declarations) +ac_c_conftest_c99_globals=' +// Does the compiler advertise C99 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L +# error "Compiler does not advertise C99 conformance" +#endif + +#include +extern int puts (const char *); +extern int printf (const char *, ...); +extern int dprintf (int, const char *, ...); +extern void *malloc (size_t); + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +// dprintf is used instead of fprintf to avoid needing to declare +// FILE and stderr. +#define debug(...) dprintf (2, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + #error "your preprocessor is broken" +#endif +#if BIG_OK +#else + #error "your preprocessor is broken" +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; + +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +typedef const char *ccp; + +static inline int +test_restrict (ccp restrict text) +{ + // See if C++-style comments work. + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) + continue; + return 0; +} + +// Check varargs and va_copy. +static bool +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str = ""; + int number = 0; + float fnumber = 0; + + while (*format) + { + switch (*format++) + { + case '\''s'\'': // string + str = va_arg (args_copy, const char *); + break; + case '\''d'\'': // int + number = va_arg (args_copy, int); + break; + case '\''f'\'': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); + + return *str && number && fnumber; +} +' + +# Test code for whether the C compiler supports C99 (body of main). +ac_c_conftest_c99_main=' + // Check bool. + _Bool success = false; + success |= (argc != 0); + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[0] = argv[0][0]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' + || dynamic_array[ni.number - 1] != 543); +' + +# Test code for whether the C compiler supports C11 (global declarations) +ac_c_conftest_c11_globals=' +// Does the compiler advertise C11 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L +# error "Compiler does not advertise C11 conformance" +#endif + +// Check _Alignas. +char _Alignas (double) aligned_as_double; +char _Alignas (0) no_special_alignment; +extern char aligned_as_int; +char _Alignas (0) _Alignas (int) aligned_as_int; + +// Check _Alignof. +enum +{ + int_alignment = _Alignof (int), + int_array_alignment = _Alignof (int[100]), + char_alignment = _Alignof (char) +}; +_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); + +// Check _Noreturn. +int _Noreturn does_not_return (void) { for (;;) continue; } + +// Check _Static_assert. +struct test_static_assert +{ + int x; + _Static_assert (sizeof (int) <= sizeof (long int), + "_Static_assert does not work in struct"); + long int y; +}; + +// Check UTF-8 literals. +#define u8 syntax error! +char const utf8_literal[] = u8"happens to be ASCII" "another string"; + +// Check duplicate typedefs. +typedef long *long_ptr; +typedef long int *long_ptr; +typedef long_ptr long_ptr; + +// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. +struct anonymous +{ + union { + struct { int i; int j; }; + struct { int k; long int l; } w; + }; + int m; +} v1; +' + +# Test code for whether the C compiler supports C11 (body of main). +ac_c_conftest_c11_main=' + _Static_assert ((offsetof (struct anonymous, i) + == offsetof (struct anonymous, w.k)), + "Anonymous union alignment botch"); + v1.i = 2; + v1.w.k = 5; + ok |= v1.i != 5; +' + +# Test code for whether the C compiler supports C11 (complete). +ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} +${ac_c_conftest_c11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + ${ac_c_conftest_c11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C99 (complete). +ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + return ok; +} +" + +# Test code for whether the C compiler supports C89 (complete). +ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + return ok; +} +" + +# Test code for whether the C++ compiler supports C++98 (global declarations) +ac_cxx_conftest_cxx98_globals=' +// Does the compiler advertise C++98 conformance? +#if !defined __cplusplus || __cplusplus < 199711L +# error "Compiler does not advertise C++98 conformance" +#endif + +// These inclusions are to reject old compilers that +// lack the unsuffixed header files. +#include +#include + +// and are *not* freestanding headers in C++98. +extern void assert (int); +namespace std { + extern int strcmp (const char *, const char *); +} + +// Namespaces, exceptions, and templates were all added after "C++ 2.0". +using std::exception; +using std::strcmp; + +namespace { + +void test_exception_syntax() +{ + try { + throw "test"; + } catch (const char *s) { + // Extra parentheses suppress a warning when building autoconf itself, + // due to lint rules shared with more typical C programs. + assert (!(strcmp) (s, "test")); + } +} + +template struct test_template +{ + T const val; + explicit test_template(T t) : val(t) {} + template T add(U u) { return static_cast(u) + val; } +}; + +} // anonymous namespace +' + +# Test code for whether the C++ compiler supports C++98 (body of main) +ac_cxx_conftest_cxx98_main=' + assert (argc); + assert (! argv[0]); +{ + test_exception_syntax (); + test_template tt (2.0); + assert (tt.add (4) == 6.0); + assert (true && !false); +} +' + +# Test code for whether the C++ compiler supports C++11 (global declarations) +ac_cxx_conftest_cxx11_globals=' +// Does the compiler advertise C++ 2011 conformance? +#if !defined __cplusplus || __cplusplus < 201103L +# error "Compiler does not advertise C++11 conformance" +#endif + +namespace cxx11test +{ + constexpr int get_val() { return 20; } + + struct testinit + { + int i; + double d; + }; + + class delegate + { + public: + delegate(int n) : n(n) {} + delegate(): delegate(2354) {} + + virtual int getval() { return this->n; }; + protected: + int n; + }; + + class overridden : public delegate + { + public: + overridden(int n): delegate(n) {} + virtual int getval() override final { return this->n * 2; } + }; + + class nocopy + { + public: + nocopy(int i): i(i) {} + nocopy() = default; + nocopy(const nocopy&) = delete; + nocopy & operator=(const nocopy&) = delete; + private: + int i; + }; + + // for testing lambda expressions + template Ret eval(Fn f, Ret v) + { + return f(v); + } + + // for testing variadic templates and trailing return types + template auto sum(V first) -> V + { + return first; + } + template auto sum(V first, Args... rest) -> V + { + return first + sum(rest...); + } +} +' + +# Test code for whether the C++ compiler supports C++11 (body of main) +ac_cxx_conftest_cxx11_main=' +{ + // Test auto and decltype + auto a1 = 6538; + auto a2 = 48573953.4; + auto a3 = "String literal"; + + int total = 0; + for (auto i = a3; *i; ++i) { total += *i; } + + decltype(a2) a4 = 34895.034; +} +{ + // Test constexpr + short sa[cxx11test::get_val()] = { 0 }; +} +{ + // Test initializer lists + cxx11test::testinit il = { 4323, 435234.23544 }; +} +{ + // Test range-based for + int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, + 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; + for (auto &x : array) { x += 23; } +} +{ + // Test lambda expressions + using cxx11test::eval; + assert (eval ([](int x) { return x*2; }, 21) == 42); + double d = 2.0; + assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0); + assert (d == 5.0); + assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0); + assert (d == 5.0); +} +{ + // Test use of variadic templates + using cxx11test::sum; + auto a = sum(1); + auto b = sum(1, 2); + auto c = sum(1.0, 2.0, 3.0); +} +{ + // Test constructor delegation + cxx11test::delegate d1; + cxx11test::delegate d2(); + cxx11test::delegate d3(45); +} +{ + // Test override and final + cxx11test::overridden o1(55464); +} +{ + // Test nullptr + char *c = nullptr; +} +{ + // Test template brackets + test_template<::test_template> v(test_template(12)); +} +{ + // Unicode literals + char const *utf8 = u8"UTF-8 string \u2500"; + char16_t const *utf16 = u"UTF-8 string \u2500"; + char32_t const *utf32 = U"UTF-32 string \u2500"; +} +' + +# Test code for whether the C compiler supports C++11 (complete). +ac_cxx_conftest_cxx11_program="${ac_cxx_conftest_cxx98_globals} +${ac_cxx_conftest_cxx11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_cxx_conftest_cxx98_main} + ${ac_cxx_conftest_cxx11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C++98 (complete). +ac_cxx_conftest_cxx98_program="${ac_cxx_conftest_cxx98_globals} +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_cxx_conftest_cxx98_main} + return ok; +} +" + +as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" +as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" +as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" +as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" +as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" +as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" +as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" +as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" +as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" + +# Auxiliary files required by this configure script. +ac_aux_files="config.guess config.sub" + +# Locations in which to look for auxiliary files. +ac_aux_dir_candidates="${srcdir}/config" + +# Search for a directory containing all of the required auxiliary files, +# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. +# If we don't find one directory that contains all the files we need, +# we report the set of missing files from the *first* directory in +# $ac_aux_dir_candidates and give up. +ac_missing_aux_files="" +ac_first_candidate=: +printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in $ac_aux_dir_candidates +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + + printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 + ac_aux_dir_found=yes + ac_install_sh= + for ac_aux in $ac_aux_files + do + # As a special case, if "install-sh" is required, that requirement + # can be satisfied by any of "install-sh", "install.sh", or "shtool", + # and $ac_install_sh is set appropriately for whichever one is found. + if test x"$ac_aux" = x"install-sh" + then + if test -f "${as_dir}install-sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 + ac_install_sh="${as_dir}install-sh -c" + elif test -f "${as_dir}install.sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 + ac_install_sh="${as_dir}install.sh -c" + elif test -f "${as_dir}shtool"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 + ac_install_sh="${as_dir}shtool install -c" + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} install-sh" + else + break + fi + fi + else + if test -f "${as_dir}${ac_aux}"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" + else + break + fi + fi + fi + done + if test "$ac_aux_dir_found" = yes; then + ac_aux_dir="$as_dir" + break + fi + ac_first_candidate=false + + as_found=false +done +IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 +fi + + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. +if test -f "${ac_aux_dir}config.guess"; then + ac_config_guess="$SHELL ${ac_aux_dir}config.guess" +fi +if test -f "${ac_aux_dir}config.sub"; then + ac_config_sub="$SHELL ${ac_aux_dir}config.sub" +fi +if test -f "$ac_aux_dir/configure"; then + ac_configure="$SHELL ${ac_aux_dir}configure" +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' + and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +ac_config_headers="$ac_config_headers HYPRE_config.h:config/HYPRE_config.h.in" + + @@ -2636,42 +3230,31 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. HYPRE_NAME="hypre" -HYPRE_VERSION="2.22.1" -HYPRE_NUMBER=22201 -HYPRE_DATE="2021/08/20" +HYPRE_VERSION="2.33.0" +HYPRE_NUMBER=23300 +HYPRE_DATE="2025/04/03" HYPRE_TIME="00:00:00" HYPRE_BUGS="https://github.com/hypre-space/hypre/issues" HYPRE_SRCDIR="`pwd`" -cat >>confdefs.h <<_ACEOF -#define HYPRE_RELEASE_NAME "$HYPRE_NAME" -_ACEOF +printf "%s\n" "#define HYPRE_RELEASE_NAME \"$HYPRE_NAME\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define HYPRE_RELEASE_VERSION "$HYPRE_VERSION" -_ACEOF +printf "%s\n" "#define HYPRE_RELEASE_VERSION \"$HYPRE_VERSION\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define HYPRE_RELEASE_NUMBER $HYPRE_NUMBER -_ACEOF +printf "%s\n" "#define HYPRE_RELEASE_NUMBER $HYPRE_NUMBER" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define HYPRE_RELEASE_DATE "$HYPRE_DATE" -_ACEOF +printf "%s\n" "#define HYPRE_RELEASE_DATE \"$HYPRE_DATE\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define HYPRE_RELEASE_TIME "$HYPRE_TIME" -_ACEOF +printf "%s\n" "#define HYPRE_RELEASE_TIME \"$HYPRE_TIME\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define HYPRE_RELEASE_BUGS "$HYPRE_BUGS" -_ACEOF +printf "%s\n" "#define HYPRE_RELEASE_BUGS \"$HYPRE_BUGS\"" >>confdefs.h + @@ -2682,6 +3265,47 @@ _ACEOF +if test -d "$HYPRE_SRCDIR/../.git" +then : + + develop_string=$(git -C $HYPRE_SRCDIR describe --match 'v*' --long --abbrev=9) + develop_lastag=$(git -C $HYPRE_SRCDIR describe --match 'v*' --abbrev=0) + develop_number=$(git -C $HYPRE_SRCDIR rev-list --count $develop_lastag..HEAD) + develop_branch=$(git -C $HYPRE_SRCDIR rev-parse --abbrev-ref HEAD) + if test -n "$develop_string" +then : + + +printf "%s\n" "#define HYPRE_DEVELOP_STRING \"$develop_string\"" >>confdefs.h + + +printf "%s\n" "#define HYPRE_DEVELOP_NUMBER $develop_number" >>confdefs.h + + +printf "%s\n" "#define HYPRE_BRANCH_NAME \"$develop_branch\"" >>confdefs.h + + if test "x$develop_branch" = "xmaster" +then : + +printf "%s\n" "#define HYPRE_DEVELOP_BRANCH \"$develop_branch\"" >>confdefs.h + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: NOTE: On branch $develop_branch, not the main development branch" >&5 +printf "%s\n" "$as_me: NOTE: On branch $develop_branch, not the main development branch" >&6;} + +fi + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: NOTE: Could not describe development branch" >&5 +printf "%s\n" "$as_me: NOTE: Could not describe development branch" >&6;} + +fi + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: NOTE: Could not find .git directory" >&5 +printf "%s\n" "$as_me: NOTE: Could not find .git directory" >&6;} + +fi PACKAGE_DATE= PACKAGE_TIME= @@ -2715,17 +3339,19 @@ hypre_using_mli=no hypre_using_openmp=no hypre_using_device_openmp=no -hypre_using_insure=no hypre_using_cuda=no hypre_using_gpu=no hypre_using_um=no hypre_gpu_mpi=no hypre_using_gpu_profiling=no hypre_using_cuda_streams=no -hypre_using_cusparse=yes +hypre_using_cusparse=no hypre_using_cublas=no -hypre_using_curand=yes +hypre_using_curand=no +hypre_using_cusolver=no hypre_using_device_pool=no +hypre_using_device_malloc_async=no +hypre_using_thrust_nosync=no hypre_using_umpire=no hypre_using_umpire_host=no hypre_using_umpire_device=no @@ -2741,15 +3367,31 @@ hypre_found_cuda=no hypre_using_node_aware_mpi=no hypre_using_memory_tracker=no +hypre_test_using_host=no + +hypre_cxxstd=11 + +hypre_using_magma=no +hypre_user_gave_magma_inc=no +hypre_user_gave_magma_lib=no +hypre_user_gave_magma_libs=no +hypre_user_gave_magma_lib_dirs=no hypre_using_hip=no hypre_using_rocsparse=no hypre_using_rocblas=no +hypre_using_rocsolver=no hypre_using_rocrand=no hypre_found_hip=no +hypre_using_sycl=no +hypre_using_onemklsparse=no +hypre_using_onemklblas=no +hypre_using_onemklrand=no + +hypre_found_mkl=no hypre_blas_lib_old_style=no hypre_blas_lib_dir_old_style=no @@ -2758,26 +3400,30 @@ hypre_lapack_lib_dir_old_style=no if test "x$build_alias" = "x" then - # Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if ${ac_cv_build+:} false; then : - $as_echo_n "(cached) " >&6 -else + + + # Make sure we can run config.sub. +$SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +printf %s "checking build system type... " >&6; } +if test ${ac_cv_build+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_build_alias=$build_alias test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` + ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 +ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +printf "%s\n" "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; @@ -2800,21 +3446,22 @@ fi if test "x$host_alias" = "x" then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if ${ac_cv_host+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +printf %s "checking host system type... " >&6; } +if test ${ac_cv_host+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 + ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +printf "%s\n" "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; @@ -2841,33 +3488,36 @@ then fi # Check whether --enable-debug was given. -if test "${enable_debug+set}" = set; then : +if test ${enable_debug+y} +then : enableval=$enable_debug; case "${enableval}" in yes) hypre_using_debug=yes ;; no) hypre_using_debug=no ;; *) as_fn_error $? "Bad value ${enableval} for --enable-debug" "$LINENO" 5 ;; esac -else +else $as_nop hypre_using_debug=no fi # Check whether --enable-shared was given. -if test "${enable_shared+set}" = set; then : +if test ${enable_shared+y} +then : enableval=$enable_shared; case "${enableval}" in yes) hypre_using_shared=yes ;; no) hypre_using_shared=no ;; *) as_fn_error $? "Bad value ${enableval} for --enable-shared" "$LINENO" 5 ;; esac -else +else $as_nop hypre_using_shared=no fi # Check whether --enable-mixedint was given. -if test "${enable_mixedint+set}" = set; then : +if test ${enable_mixedint+y} +then : enableval=$enable_mixedint; case "${enableval}" in yes) hypre_using_fei=no hypre_using_mixedint=yes @@ -2876,7 +3526,7 @@ if test "${enable_mixedint+set}" = set; then : hypre_using_distributed_ls=yes ;; *) as_fn_error $? "Bad value ${enableval} for --enable-mixedint" "$LINENO" 5 ;; esac -else +else $as_nop hypre_using_mixedint=no fi @@ -2884,19 +3534,20 @@ fi if test "$hypre_using_mixedint" = "yes" then -$as_echo "#define HYPRE_MIXEDINT 1" >>confdefs.h +printf "%s\n" "#define HYPRE_MIXEDINT 1" >>confdefs.h fi # Check whether --enable-bigint was given. -if test "${enable_bigint+set}" = set; then : +if test ${enable_bigint+y} +then : enableval=$enable_bigint; case "${enableval}" in yes) hypre_using_fei=no hypre_using_bigint=yes ;; no) hypre_using_bigint=no ;; *) as_fn_error $? "Bad value ${enableval} for --enable-bigint" "$LINENO" 5 ;; esac -else +else $as_nop hypre_using_bigint=no fi @@ -2904,19 +3555,20 @@ fi if test "$hypre_using_bigint" = "yes" then -$as_echo "#define HYPRE_BIGINT 1" >>confdefs.h +printf "%s\n" "#define HYPRE_BIGINT 1" >>confdefs.h fi # Check whether --enable-single was given. -if test "${enable_single+set}" = set; then : +if test ${enable_single+y} +then : enableval=$enable_single; case "${enableval}" in yes) hypre_using_fei=no hypre_using_single=yes ;; no) hypre_using_single=no ;; *) as_fn_error $? "Bad value ${enableval} for --enable-single" "$LINENO" 5 ;; esac -else +else $as_nop hypre_using_single=no fi @@ -2924,19 +3576,20 @@ fi if test "$hypre_using_single" = "yes" then -$as_echo "#define HYPRE_SINGLE 1" >>confdefs.h +printf "%s\n" "#define HYPRE_SINGLE 1" >>confdefs.h fi # Check whether --enable-longdouble was given. -if test "${enable_longdouble+set}" = set; then : +if test ${enable_longdouble+y} +then : enableval=$enable_longdouble; case "${enableval}" in yes) hypre_using_fei=no hypre_using_longdouble=yes ;; no) hypre_using_longdouble=no ;; *) as_fn_error $? "Bad value ${enableval} for --enable-longdouble" "$LINENO" 5 ;; esac -else +else $as_nop hypre_using_longdouble=no fi @@ -2944,19 +3597,20 @@ fi if test "$hypre_using_longdouble" = "yes" then -$as_echo "#define HYPRE_LONG_DOUBLE 1" >>confdefs.h +printf "%s\n" "#define HYPRE_LONG_DOUBLE 1" >>confdefs.h fi # Check whether --enable-complex was given. -if test "${enable_complex+set}" = set; then : +if test ${enable_complex+y} +then : enableval=$enable_complex; case "${enableval}" in yes) hypre_using_fei=no hypre_using_complex=yes ;; no) hypre_using_complex=no ;; *) as_fn_error $? "Bad value ${enableval} for --enable-complex" "$LINENO" 5 ;; esac -else +else $as_nop hypre_using_complex=no fi @@ -2964,32 +3618,32 @@ fi if test "$hypre_using_complex" = "yes" then -$as_echo "#define HYPRE_COMPLEX 1" >>confdefs.h +printf "%s\n" "#define HYPRE_COMPLEX 1" >>confdefs.h fi # Check whether --enable-maxdim was given. -if test "${enable_maxdim+set}" = set; then : +if test ${enable_maxdim+y} +then : enableval=$enable_maxdim; hypre_maxdim=${enableval} -else +else $as_nop hypre_maxdim=3 fi -cat >>confdefs.h <<_ACEOF -#define HYPRE_MAXDIM $hypre_maxdim -_ACEOF +printf "%s\n" "#define HYPRE_MAXDIM $hypre_maxdim" >>confdefs.h # Check whether --enable-persistent was given. -if test "${enable_persistent+set}" = set; then : +if test ${enable_persistent+y} +then : enableval=$enable_persistent; case "${enableval}" in yes) hypre_using_persistent=yes ;; no) hypre_using_persistent=no ;; *) as_fn_error $? "Bad value ${enableval} for --enable-persistent" "$LINENO" 5 ;; esac -else +else $as_nop hypre_using_persistent=no fi @@ -2997,188 +3651,136 @@ fi if test "$hypre_using_persistent" = "yes" then -$as_echo "#define HYPRE_USING_PERSISTENT_COMM 1" >>confdefs.h +printf "%s\n" "#define HYPRE_USING_PERSISTENT_COMM 1" >>confdefs.h fi # Check whether --enable-hopscotch was given. -if test "${enable_hopscotch+set}" = set; then : +if test ${enable_hopscotch+y} +then : enableval=$enable_hopscotch; case "${enableval}" in yes) hypre_using_hopscotch=yes ;; no) hypre_using_hopscotch=no ;; *) as_fn_error $? "Bad value ${enableval} for --enable-hopscotch" "$LINENO" 5 ;; esac -else - hypre_using_hopscotch=no - -fi - -if test "$hypre_using_hopscotch" = "yes" -then - -$as_echo "#define HYPRE_HOPSCOTCH 1" >>confdefs.h - -fi - -# Check whether --enable-fortran was given. -if test "${enable_fortran+set}" = set; then : - enableval=$enable_fortran; case "${enableval}" in - yes) hypre_using_fortran=yes ;; - no) hypre_using_fortran=no ;; - *) hypre_using_fortran=yes ;; - esac -else - hypre_using_fortran=yes - -fi - - -# Check whether --enable-unified-memory was given. -if test "${enable_unified_memory+set}" = set; then : - enableval=$enable_unified_memory; case "${enableval}" in - yes) hypre_using_um=yes ;; - no) hypre_using_um=no ;; - *) hypre_using_um=no ;; - esac -else - hypre_using_um=no - -fi - - -# Check whether --enable-cuda-streams was given. -if test "${enable_cuda_streams+set}" = set; then : - enableval=$enable_cuda_streams; case "${enableval}" in - yes) hypre_using_cuda_streams=yes ;; - no) hypre_using_cuda_streams=no ;; - *) hypre_using_cuda_streams=yes ;; - esac -else - hypre_using_cuda_streams=yes - -fi - - -# Check whether --enable-cusparse was given. -if test "${enable_cusparse+set}" = set; then : - enableval=$enable_cusparse; case "${enableval}" in - yes) hypre_using_cusparse=yes ;; - no) hypre_using_cusparse=no ;; - *) hypre_using_cusparse=yes ;; - esac -else - hypre_using_cusparse=yes +else $as_nop + hypre_using_hopscotch=no fi +if test "$hypre_using_hopscotch" = "yes" +then -# Check whether --enable-device-memory-pool was given. -if test "${enable_device_memory_pool+set}" = set; then : - enableval=$enable_device_memory_pool; case "${enableval}" in - yes) hypre_using_device_pool=yes ;; - no) hypre_using_device_pool=no ;; - *) hypre_using_device_pool=no ;; - esac -else - hypre_using_device_pool=no +printf "%s\n" "#define HYPRE_USING_HOPSCOTCH 1" >>confdefs.h fi - -# Check whether --enable-cublas was given. -if test "${enable_cublas+set}" = set; then : - enableval=$enable_cublas; case "${enableval}" in - yes) hypre_using_cublas=yes ;; - no) hypre_using_cublas=no ;; - *) hypre_using_cublas=no ;; +# Check whether --enable-fortran was given. +if test ${enable_fortran+y} +then : + enableval=$enable_fortran; case "${enableval}" in + yes) hypre_using_fortran=yes ;; + no) hypre_using_fortran=no ;; + *) hypre_using_fortran=yes ;; esac -else - hypre_using_cublas=no +else $as_nop + hypre_using_fortran=yes fi -# Check whether --enable-curand was given. -if test "${enable_curand+set}" = set; then : - enableval=$enable_curand; case "${enableval}" in - yes) hypre_using_curand=yes ;; - no) hypre_using_curand=no ;; - *) hypre_using_curand=yes ;; +# Check whether --enable-unified-memory was given. +if test ${enable_unified_memory+y} +then : + enableval=$enable_unified_memory; case "${enableval}" in + yes) hypre_using_um=yes ;; + no) hypre_using_um=no ;; + *) hypre_using_um=no ;; esac -else - hypre_using_curand=yes +else $as_nop + hypre_using_um=no fi - - -# Check whether --enable-rocsparse was given. -if test "${enable_rocsparse+set}" = set; then : - enableval=$enable_rocsparse; case "${enableval}" in - yes) hypre_using_rocsparse=yes ;; - no) hypre_using_rocsparse=no ;; - *) hypre_using_rocsparse=yes ;; +# Check whether --enable-device-memory-pool was given. +if test ${enable_device_memory_pool+y} +then : + enableval=$enable_device_memory_pool; case "${enableval}" in + yes) hypre_using_device_pool=yes ;; + no) hypre_using_device_pool=no ;; + *) hypre_using_device_pool=no ;; esac -else - hypre_using_rocsparse=yes +else $as_nop + hypre_using_device_pool=no fi -# Check whether --enable-rocblas was given. -if test "${enable_rocblas+set}" = set; then : - enableval=$enable_rocblas; case "${enableval}" in - yes) hypre_using_rocblas=yes ;; - no) hypre_using_rocblas=no ;; - *) hypre_using_rocblas=no ;; +# Check whether --enable-device-malloc-async was given. +if test ${enable_device_malloc_async+y} +then : + enableval=$enable_device_malloc_async; case "${enableval}" in + yes) hypre_using_device_malloc_async=yes ;; + no) hypre_using_device_malloc_async=no ;; + *) hypre_using_device_malloc_async=no ;; esac -else - hypre_using_rocblas=no +else $as_nop + hypre_using_device_malloc_async=no fi -# Check whether --enable-rocrand was given. -if test "${enable_rocrand+set}" = set; then : - enableval=$enable_rocrand; case "${enableval}" in - yes) hypre_using_rocrand=yes ;; - no) hypre_using_rocrand=no ;; - *) hypre_using_rocrand=yes ;; +# Check whether --enable-thrust-nosync was given. +if test ${enable_thrust_nosync+y} +then : + enableval=$enable_thrust_nosync; case "${enableval}" in + yes) hypre_using_thrust_nosync=yes ;; + no) hypre_using_thrust_nosync=no ;; + *) hypre_using_thrust_nosync=no ;; esac -else - hypre_using_rocrand=yes +else $as_nop + hypre_using_thrust_nosync=no fi # Check whether --enable-gpu-profiling was given. -if test "${enable_gpu_profiling+set}" = set; then : +if test ${enable_gpu_profiling+y} +then : enableval=$enable_gpu_profiling; case "${enableval}" in yes) hypre_using_gpu_profiling=yes ;; no) hypre_using_gpu_profiling=no ;; *) hypre_using_gpu_profiling=no ;; esac -else +else $as_nop hypre_using_gpu_profiling=no fi # Check whether --enable-gpu-aware-mpi was given. -if test "${enable_gpu_aware_mpi+set}" = set; then : +if test ${enable_gpu_aware_mpi+y} +then : enableval=$enable_gpu_aware_mpi; case "${enableval}" in yes) hypre_gpu_mpi=yes ;; no) hypre_gpu_mpi=no ;; *) as_fn_error $? "Bad value ${enableval} for --enable-gpu-aware-mpi" "$LINENO" 5 ;; esac -else +else $as_nop hypre_gpu_mpi=no fi +if test "x$LDFLAGS" = "x" +then + hypre_user_chose_ldflags=no +else + hypre_user_chose_ldflags=yes +fi + if test "x$CC" = "x" then hypre_user_chose_ccompilers=no @@ -3256,9 +3858,19 @@ then fi +# Check whether --with-cxxstandard was given. +if test ${with_cxxstandard+y} +then : + withval=$with_cxxstandard; hypre_cxxstd=$withval + +fi + + + # Check whether --with-LD was given. -if test "${with_LD+set}" = set; then : +if test ${with_LD+y} +then : withval=$with_LD; LD=$withval fi @@ -3266,7 +3878,8 @@ fi # Check whether --with-LDFLAGS was given. -if test "${with_LDFLAGS+set}" = set; then : +if test ${with_LDFLAGS+y} +then : withval=$with_LDFLAGS; LDFLAGS=$withval fi @@ -3274,7 +3887,8 @@ fi # Check whether --with-extra-CFLAGS was given. -if test "${with_extra_CFLAGS+set}" = set; then : +if test ${with_extra_CFLAGS+y} +then : withval=$with_extra_CFLAGS; EXTRA_CFLAGS=$withval fi @@ -3282,15 +3896,26 @@ fi # Check whether --with-extra-CXXFLAGS was given. -if test "${with_extra_CXXFLAGS+set}" = set; then : +if test ${with_extra_CXXFLAGS+y} +then : withval=$with_extra_CXXFLAGS; EXTRA_CXXFLAGS=$withval fi +# Check whether --with-extra-CUFLAGS was given. +if test ${with_extra_CUFLAGS+y} +then : + withval=$with_extra_CUFLAGS; EXTRA_CUFLAGS=$withval + +fi + + + # Check whether --with-extra-BUILDFLAGS was given. -if test "${with_extra_BUILDFLAGS+set}" = set; then : +if test ${with_extra_BUILDFLAGS+y} +then : withval=$with_extra_BUILDFLAGS; EXTRA_BUILDFLAGS=$withval fi @@ -3298,7 +3923,8 @@ fi # Check whether --with-extra-incpath was given. -if test "${with_extra_incpath+set}" = set; then : +if test ${with_extra_incpath+y} +then : withval=$with_extra_incpath; CCFLAGS="${CCFLAGS} -I`echo ${withval}|sed 's/ /\ -I/g'`" fi @@ -3306,31 +3932,17 @@ fi # Check whether --with-extra-ldpath was given. -if test "${with_extra_ldpath+set}" = set; then : +if test ${with_extra_ldpath+y} +then : withval=$with_extra_ldpath; LDFLAGS="-L`echo ${withval}|sed 's/ /\ -L/g'` ${LDFLAGS}" fi -# Check whether --with-insure was given. -if test "${with_insure+set}" = set; then : - withval=$with_insure; case "${withval}" in - yes) hypre_using_insure=yes - hypre_using_debug=yes - hypre_insure_flags="" ;; - no) ;; - *) hypre_using_insure=yes - hypre_using_debug=yes - hypre_insure_flags="$withval" ;; - esac - -fi - - - # Check whether --with-strict-checking was given. -if test "${with_strict_checking+set}" = set; then : +if test ${with_strict_checking+y} +then : withval=$with_strict_checking; case "${withval}" in yes) hypre_user_chose_ccompilers=yes @@ -3346,11 +3958,12 @@ if test "${with_strict_checking+set}" = set; then : do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -3358,11 +3971,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3373,11 +3990,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3391,7 +4008,7 @@ test -n "$CC" || CC="""" CFLAGS="" elif test "x$GCC" = "xyes" || test "x$CC" = "xgcc"; then FFLAGS="-g -Wall" - CFLAGS="-g -Wall -std=gnu99 -pedantic" + CFLAGS="-g -Wall -std=gnu99 -pedantic -Wfloat-conversion -fsingle-precision-constant" CXXFLAGS="-g -Wall -Wshadow -fno-implicit-templates" CXXFLAGS="$CXXFLAGS -Woverloaded-virtual -ansi -pedantic" elif test "x$CC" = "xicc"; then @@ -3419,11 +4036,12 @@ test -n "$CC" || CC="""" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else @@ -3431,11 +4049,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3446,11 +4068,11 @@ fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -$as_echo "$CXX" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +printf "%s\n" "$CXX" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3469,11 +4091,12 @@ test -n "$CXX" || CXX="""" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_FC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_FC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$FC"; then ac_cv_prog_FC="$FC" # Let the user override the test. else @@ -3481,11 +4104,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_FC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3496,11 +4123,11 @@ fi fi FC=$ac_cv_prog_FC if test -n "$FC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FC" >&5 -$as_echo "$FC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FC" >&5 +printf "%s\n" "$FC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3516,7 +4143,7 @@ test -n "$FC" || FC="""" fi -$as_echo "#define HYPRE_SEQUENTIAL 1" >>confdefs.h +printf "%s\n" "#define HYPRE_SEQUENTIAL 1" >>confdefs.h ;; esac @@ -3527,12 +4154,13 @@ fi # Check whether --with-MPI-include was given. -if test "${with_MPI_include+set}" = set; then : +if test ${with_MPI_include+y} +then : withval=$with_MPI_include; for mpi_dir in $withval; do MPIINCLUDE="$MPIINCLUDE -I$mpi_dir" done; hypre_user_chose_mpi=yes -else +else $as_nop hypre_user_chose_mpi=no fi @@ -3540,7 +4168,8 @@ fi # Check whether --with-MPI-libs was given. -if test "${with_MPI_libs+set}" = set; then : +if test ${with_MPI_libs+y} +then : withval=$with_MPI_libs; for mpi_lib in $withval; do MPILIBS="$MPILIBS -l$mpi_lib" done; @@ -3551,7 +4180,8 @@ fi # Check whether --with-MPI-lib-dirs was given. -if test "${with_MPI_lib_dirs+set}" = set; then : +if test ${with_MPI_lib_dirs+y} +then : withval=$with_MPI_lib_dirs; for mpi_lib_dir in $withval; do MPILIBDIRS="-L$mpi_lib_dir $MPILIBDIRS" done; @@ -3562,13 +4192,14 @@ fi # Check whether --with-MPI-flags was given. -if test "${with_MPI_flags+set}" = set; then : +if test ${with_MPI_flags+y} +then : withval=$with_MPI_flags; case "${withval}" in yes) MPIFLAGS="" ;; no) MPIFLAGS="" ;; *) MPIFLAGS=$withval ;; esac -else +else $as_nop MPIFLAGS="" fi @@ -3576,13 +4207,14 @@ fi # Check whether --with-node-aware-mpi was given. -if test "${with_node_aware_mpi+set}" = set; then : +if test ${with_node_aware_mpi+y} +then : withval=$with_node_aware_mpi; case "$withval" in yes) hypre_using_node_aware_mpi=yes;; no) hypre_using_node_aware_mpi=no ;; *) hypre_using_node_aware_mpi=no ;; esac -else +else $as_nop hypre_using_node_aware_mpi=no fi @@ -3590,7 +4222,8 @@ fi # Check whether --with-node-aware-mpi-include was given. -if test "${with_node_aware_mpi_include+set}" = set; then : +if test ${with_node_aware_mpi_include+y} +then : withval=$with_node_aware_mpi_include; for nap_dir in $withval; do HYPRE_NAP_INCLUDE="$HYPRE_NAP_INCLUDE -I$nap_dir" done; @@ -3601,22 +4234,39 @@ fi # Check whether --with-memory_tracker was given. -if test "${with_memory_tracker+set}" = set; then : +if test ${with_memory_tracker+y} +then : withval=$with_memory_tracker; case "$withval" in yes) hypre_using_memory_tracker=yes;; no) hypre_using_memory_tracker=no ;; *) hypre_using_memory_tracker=no ;; esac -else +else $as_nop hypre_using_memory_tracker=no fi +# Check whether --with-test_using_host was given. +if test ${with_test_using_host+y} +then : + withval=$with_test_using_host; case "$withval" in + yes) hypre_test_using_host=yes;; + no) hypre_test_using_host=no ;; + *) hypre_test_using_host=no ;; + esac +else $as_nop + hypre_test_using_host=no + +fi + + + # Check whether --with-blas-lib was given. -if test "${with_blas_lib+set}" = set; then : +if test ${with_blas_lib+y} +then : withval=$with_blas_lib; for blas_lib in $withval; do BLASLIBS="$BLASLIBS $blas_lib" done; @@ -3627,7 +4277,8 @@ fi # Check whether --with-blas-libs was given. -if test "${with_blas_libs+set}" = set; then : +if test ${with_blas_libs+y} +then : withval=$with_blas_libs; for blas_lib in $withval; do BLASLIBS="$BLASLIBS -l$blas_lib" done; @@ -3639,7 +4290,8 @@ fi # Check whether --with-blas-lib-dirs was given. -if test "${with_blas_lib_dirs+set}" = set; then : +if test ${with_blas_lib_dirs+y} +then : withval=$with_blas_lib_dirs; for blas_lib_dir in $withval; do BLASLIBDIRS="-L$blas_lib_dir $BLASLIBDIRS" done; @@ -3652,7 +4304,8 @@ fi # Check whether --with-lapack-lib was given. -if test "${with_lapack_lib+set}" = set; then : +if test ${with_lapack_lib+y} +then : withval=$with_lapack_lib; for lapack_lib in $withval; do LAPACKLIBS="$LAPACKLIBS $lapack_lib" done; @@ -3663,7 +4316,8 @@ fi # Check whether --with-lapack-libs was given. -if test "${with_lapack_libs+set}" = set; then : +if test ${with_lapack_libs+y} +then : withval=$with_lapack_libs; for lapack_lib in $withval; do LAPACKLIBS="$LAPACKLIBS -l$lapack_lib" done; @@ -3675,7 +4329,8 @@ fi # Check whether --with-lapack-lib-dirs was given. -if test "${with_lapack_lib_dirs+set}" = set; then : +if test ${with_lapack_lib_dirs+y} +then : withval=$with_lapack_lib_dirs; for lapack_lib_dir in $withval; do LAPACKLIBDIRS="-L$lapack_lib_dir $LAPACKLIBDIRS" done; @@ -3689,7 +4344,8 @@ fi # Check whether --with-fmangle was given. -if test "${with_fmangle+set}" = set; then : +if test ${with_fmangle+y} +then : withval=$with_fmangle; hypre_fmangle=0; case "$withval" in no-underscores) hypre_fmangle=1 ;; @@ -3699,22 +4355,21 @@ if test "${with_fmangle+set}" = set; then : one-before-after) hypre_fmangle=5 ;; esac -else +else $as_nop hypre_fmangle=0 fi -cat >>confdefs.h <<_ACEOF -#define HYPRE_FMANGLE $hypre_fmangle -_ACEOF +printf "%s\n" "#define HYPRE_FMANGLE $hypre_fmangle" >>confdefs.h # Check whether --with-fmangle-blas was given. -if test "${with_fmangle_blas+set}" = set; then : +if test ${with_fmangle_blas+y} +then : withval=$with_fmangle_blas; hypre_fmangle_blas=0; case "$withval" in no-underscores) hypre_fmangle_blas=1 ;; @@ -3724,22 +4379,21 @@ if test "${with_fmangle_blas+set}" = set; then : one-before-after) hypre_fmangle_blas=5 ;; esac -else +else $as_nop hypre_fmangle_blas=0 fi -cat >>confdefs.h <<_ACEOF -#define HYPRE_FMANGLE_BLAS $hypre_fmangle_blas -_ACEOF +printf "%s\n" "#define HYPRE_FMANGLE_BLAS $hypre_fmangle_blas" >>confdefs.h # Check whether --with-fmangle-lapack was given. -if test "${with_fmangle_lapack+set}" = set; then : +if test ${with_fmangle_lapack+y} +then : withval=$with_fmangle_lapack; hypre_fmangle_lapack=0; case "$withval" in no-underscores) hypre_fmangle_lapack=1 ;; @@ -3749,24 +4403,23 @@ if test "${with_fmangle_lapack+set}" = set; then : one-before-after) hypre_fmangle_lapack=5 ;; esac -else +else $as_nop hypre_fmangle_lapack=0 fi -cat >>confdefs.h <<_ACEOF -#define HYPRE_FMANGLE_LAPACK $hypre_fmangle_lapack -_ACEOF +printf "%s\n" "#define HYPRE_FMANGLE_LAPACK $hypre_fmangle_lapack" >>confdefs.h # Check whether --with-print-errors was given. -if test "${with_print_errors+set}" = set; then : +if test ${with_print_errors+y} +then : withval=$with_print_errors; if test "$withval" = "yes" then -$as_echo "#define HYPRE_PRINT_ERRORS 1" >>confdefs.h +printf "%s\n" "#define HYPRE_PRINT_ERRORS 1" >>confdefs.h fi @@ -3775,11 +4428,12 @@ fi # Check whether --with-timing was given. -if test "${with_timing+set}" = set; then : +if test ${with_timing+y} +then : withval=$with_timing; if test "$withval" = "yes" then -$as_echo "#define HYPRE_TIMING 1" >>confdefs.h +printf "%s\n" "#define HYPRE_TIMING 1" >>confdefs.h fi @@ -3788,12 +4442,13 @@ fi # Check whether --with-openmp was given. -if test "${with_openmp+set}" = set; then : +if test ${with_openmp+y} +then : withval=$with_openmp; case "${withval}" in yes) hypre_using_openmp=yes;; no) hypre_using_openmp=no ;; esac -else +else $as_nop hypre_using_openmp=no fi @@ -3801,12 +4456,13 @@ fi # Check whether --with-device-openmp was given. -if test "${with_device_openmp+set}" = set; then : +if test ${with_device_openmp+y} +then : withval=$with_device_openmp; case "${withval}" in yes) hypre_using_device_openmp=yes ;; no) hypre_using_device_openmp=no ;; esac -else +else $as_nop hypre_using_device_openmp=no fi @@ -3815,7 +4471,8 @@ fi # Check whether --with-superlu was given. -if test "${with_superlu+set}" = set; then : +if test ${with_superlu+y} +then : withval=$with_superlu; case "${withval}" in no) hypre_using_superlu=no ;; *) hypre_using_superlu=yes ;; @@ -3824,15 +4481,17 @@ if test "${with_superlu+set}" = set; then : fi -if test "x$with_superlu" = "xyes"; then : +if test "x$with_superlu" = "xyes" +then : -$as_echo "#define HAVE_SUPERLU 1" >>confdefs.h +printf "%s\n" "#define HAVE_SUPERLU 1" >>confdefs.h fi # Check whether --with-superlu-include was given. -if test "${with_superlu_include+set}" = set; then : +if test ${with_superlu_include+y} +then : withval=$with_superlu_include; for superlu_inc_dir in $withval; do SUPERLU_INCLUDE="-I$superlu_inc_dir $SUPERLU_INCLUDE" done @@ -3842,7 +4501,8 @@ fi # Check whether --with-superlu-lib was given. -if test "${with_superlu_lib+set}" = set; then : +if test ${with_superlu_lib+y} +then : withval=$with_superlu_lib; for superlu_lib in $withval; do SUPERLU_LIBS="$SUPERLU_LIBS $superlu_lib" done @@ -3853,7 +4513,8 @@ fi # Check whether --with-dsuperlu was given. -if test "${with_dsuperlu+set}" = set; then : +if test ${with_dsuperlu+y} +then : withval=$with_dsuperlu; case "${withval}" in no) hypre_using_dsuperlu=no ;; *) hypre_using_dsuperlu=yes ;; @@ -3862,15 +4523,17 @@ if test "${with_dsuperlu+set}" = set; then : fi -if test "x$with_dsuperlu" = "xyes"; then : +if test "x$with_dsuperlu" = "xyes" +then : -$as_echo "#define HYPRE_USING_DSUPERLU 1" >>confdefs.h +printf "%s\n" "#define HYPRE_USING_DSUPERLU 1" >>confdefs.h fi # Check whether --with-dsuperlu-include was given. -if test "${with_dsuperlu_include+set}" = set; then : +if test ${with_dsuperlu_include+y} +then : withval=$with_dsuperlu_include; for dsuperlu_inc_dir in $withval; do DSUPERLU_INCLUDE="-I$dsuperlu_inc_dir $DSUPERLU_INCLUDE" done @@ -3880,7 +4543,8 @@ fi # Check whether --with-dsuperlu-lib was given. -if test "${with_dsuperlu_lib+set}" = set; then : +if test ${with_dsuperlu_lib+y} +then : withval=$with_dsuperlu_lib; for dsuperlu_lib in $withval; do DSUPERLU_LIBS="$DSUPERLU_LIBS $dsuperlu_lib" done @@ -3891,7 +4555,8 @@ fi # Check whether --with-fei-inc-dir was given. -if test "${with_fei_inc_dir+set}" = set; then : +if test ${with_fei_inc_dir+y} +then : withval=$with_fei_inc_dir; HYPRE_FEI_BASE_DIR="$withval"; hypre_using_fei=yes @@ -3901,94 +4566,341 @@ fi # Check whether --with-mli was given. -if test "${with_mli+set}" = set; then : +if test ${with_mli+y} +then : withval=$with_mli; case "${withval}" in no) hypre_using_mli=no ;; *) hypre_using_mli=yes ;; esac - + +fi + + + + +# Check whether --with-MPI was given. +if test ${with_MPI+y} +then : + withval=$with_MPI; case "$withval" in + no) hypre_using_mpi=no ;; + *) hypre_using_mpi=yes ;; + esac + +fi + + + + +# Check whether --with-cuda was given. +if test ${with_cuda+y} +then : + withval=$with_cuda; case "$withval" in + yes) hypre_using_cuda=yes ;; + no) hypre_using_cuda=no ;; + *) hypre_using_cuda=no ;; + esac +else $as_nop + hypre_using_cuda=no + +fi + + + +# Check whether --with-hip was given. +if test ${with_hip+y} +then : + withval=$with_hip; case "$withval" in + yes) hypre_using_hip=yes ;; + no) hypre_using_hip=no ;; + *) hypre_using_hip=no ;; + esac +else $as_nop + hypre_using_hip=no + +fi + + +# Check whether --enable-rocsparse was given. +if test ${enable_rocsparse+y} +then : + enableval=$enable_rocsparse; case "${enableval}" in + yes) hypre_using_rocsparse=yes ;; + no) hypre_using_rocsparse=no ;; + *) hypre_using_rocsparse=yes ;; + esac +else $as_nop + case "$hypre_using_hip" in + yes) hypre_using_rocsparse=yes ;; + no) hypre_using_rocsparse=no ;; + *) hypre_using_rocsparse=no ;; + esac + +fi + + +# Check whether --enable-rocblas was given. +if test ${enable_rocblas+y} +then : + enableval=$enable_rocblas; case "${enableval}" in + yes) hypre_using_rocblas=yes ;; + no) hypre_using_rocblas=no ;; + *) hypre_using_rocblas=no ;; + esac +else $as_nop + hypre_using_rocblas=no + +fi + + +# Check whether --enable-rocsolver was given. +if test ${enable_rocsolver+y} +then : + enableval=$enable_rocsolver; case "${enableval}" in + yes) hypre_using_rocsolver=yes; hypre_using_rocblas=yes ;; + no) hypre_using_rocsolver=no ;; + *) hypre_using_rocsolver=no ;; + esac +else $as_nop + hypre_using_rocsolver=no + +fi + + +# Check whether --enable-rocrand was given. +if test ${enable_rocrand+y} +then : + enableval=$enable_rocrand; case "${enableval}" in + yes) hypre_using_rocrand=yes ;; + no) hypre_using_rocrand=no ;; + *) hypre_using_rocrand=yes ;; + esac +else $as_nop + case "$hypre_using_hip" in + yes) hypre_using_rocrand=yes ;; + no) hypre_using_rocrand=no ;; + *) hypre_using_rocrand=no ;; + esac + +fi + + + +# Check whether --with-sycl was given. +if test ${with_sycl+y} +then : + withval=$with_sycl; case "$withval" in + yes) hypre_using_sycl=yes ;; + no) hypre_using_sycl=no ;; + *) hypre_using_sycl=no ;; +esac +else $as_nop + hypre_using_sycl=no + +fi + + + + +# Check whether --with-cuda-home was given. +if test ${with_cuda_home+y} +then : + withval=$with_cuda_home; for cuda_dir in $withval; do + CUDA_HOME="$cuda_dir" + done; + hypre_using_cuda=yes + +fi + + + +# Check whether --with-gpu-arch was given. +if test ${with_gpu_arch+y} +then : + withval=$with_gpu_arch; + if test "x${withval}" != "x" + then + if test "x${HYPRE_CUDA_SM}" = "x" + then + HYPRE_CUDA_SM="${withval}" + fi + fi + + +fi + + +# Check whether --enable-cublas was given. +if test ${enable_cublas+y} +then : + enableval=$enable_cublas; case "${enableval}" in + yes) hypre_using_cublas=yes ;; + no) hypre_using_cublas=no ;; + *) hypre_using_cublas=no ;; + esac +else $as_nop + case "$hypre_using_cuda" in + yes) hypre_using_cublas=yes ;; + no) hypre_using_cublas=no ;; + *) hypre_using_cublas=no ;; + esac + +fi + + +# Check whether --enable-curand was given. +if test ${enable_curand+y} +then : + enableval=$enable_curand; case "${enableval}" in + yes) hypre_using_curand=yes ;; + no) hypre_using_curand=no ;; + *) hypre_using_curand=no ;; + esac +else $as_nop + case "$hypre_using_cuda" in + yes) hypre_using_curand=yes ;; + no) hypre_using_curand=no ;; + *) hypre_using_curand=no ;; + esac + +fi + + +# Check whether --enable-cuda-streams was given. +if test ${enable_cuda_streams+y} +then : + enableval=$enable_cuda_streams; case "${enableval}" in + yes) hypre_using_cuda_streams=yes ;; + no) hypre_using_cuda_streams=no ;; + *) hypre_using_cuda_streams=yes ;; + esac +else $as_nop + case "$hypre_using_cuda" in + yes) hypre_using_cuda_streams=yes ;; + no) hypre_using_cuda_streams=no ;; + *) hypre_using_cuda_streams=yes ;; + esac fi +# Check whether --enable-cusparse was given. +if test ${enable_cusparse+y} +then : + enableval=$enable_cusparse; case "${enableval}" in + yes) hypre_using_cusparse=yes ;; + no) hypre_using_cusparse=no ;; + *) hypre_using_cusparse=no ;; + esac +else $as_nop + case "$hypre_using_cuda" in + yes) hypre_using_cusparse=yes ;; + no) hypre_using_cusparse=no ;; + *) hypre_using_cusparse=no ;; + esac +fi -# Check whether --with-MPI was given. -if test "${with_MPI+set}" = set; then : - withval=$with_MPI; case "$withval" in - no) hypre_using_mpi=no ;; - *) hypre_using_mpi=yes ;; +# Check whether --enable-cusolver was given. +if test ${enable_cusolver+y} +then : + enableval=$enable_cusolver; case "${enableval}" in + yes) hypre_using_cusolver=yes ;; + no) hypre_using_cusolver=no ;; + *) hypre_using_cusolver=no ;; esac +else $as_nop + hypre_using_cusolver=no fi -# Check whether --with-cuda was given. -if test "${with_cuda+set}" = set; then : - withval=$with_cuda; case "$withval" in - yes) hypre_using_cuda=yes ;; - no) hypre_using_cuda=no ;; - *) hypre_using_cuda=no ;; - esac -else - hypre_using_cuda=no +# Check whether --with-sycl-target was given. +if test ${with_sycl_target+y} +then : + withval=$with_sycl_target; + if test "x${withval}" != "x" + then + if test "x${HYPRE_SYCL_TARGET}" = "x" + then + HYPRE_SYCL_TARGET="${withval}" + fi + fi + fi +# Check whether --with-sycl-target-backend was given. +if test ${with_sycl_target_backend+y} +then : + withval=$with_sycl_target_backend; + if test "x${withval}" != "x" + then + if test "x${HYPRE_SYCL_TARGET_BACKEND}" = "x" + then + HYPRE_SYCL_TARGET_BACKEND="${withval}" + fi + fi -# Check whether --with-hip was given. -if test "${with_hip+set}" = set; then : - withval=$with_hip; case "$withval" in - yes) hypre_using_hip=yes ;; - no) hypre_using_hip=no ;; - *) hypre_using_hip=no ;; - esac -else - hypre_using_hip=no fi - -# Check whether --with-cuda-home was given. -if test "${with_cuda_home+set}" = set; then : - withval=$with_cuda_home; for cuda_dir in $withval; do - CUDA_HOME="$cuda_dir" - done; - hypre_using_cuda=yes +# Check whether --enable-onemklsparse was given. +if test ${enable_onemklsparse+y} +then : + enableval=$enable_onemklsparse; case "${enableval}" in + yes) hypre_using_onemklsparse=yes ;; + no) hypre_using_onemklsparse=no ;; + *) hypre_using_onemklsparse=yes ;; + esac +else $as_nop + hypre_using_onemklsparse=yes fi +# Check whether --enable-onemklblas was given. +if test ${enable_onemklblas+y} +then : + enableval=$enable_onemklblas; case "${enableval}" in + yes) hypre_using_onemklblas=yes ;; + no) hypre_using_onemklblas=no ;; + *) hypre_using_onemklblas=yes ;; + esac +else $as_nop + hypre_using_onemklblas=yes -# Check whether --with-gpu-arch was given. -if test "${with_gpu_arch+set}" = set; then : - withval=$with_gpu_arch; - if test "x${withval}" != "x" - then - if test "x${HYPRE_CUDA_SM}" = "x" - then - HYPRE_CUDA_SM="${withval}" - fi - fi +fi +# Check whether --enable-onemklrand was given. +if test ${enable_onemklrand+y} +then : + enableval=$enable_onemklrand; case "${enableval}" in + yes) hypre_using_onemklrand=yes ;; + no) hypre_using_onemklrand=no ;; + *) hypre_using_onemklrand=yes ;; + esac +else $as_nop + hypre_using_onemklrand=yes + fi # Check whether --with-raja was given. -if test "${with_raja+set}" = set; then : +if test ${with_raja+y} +then : withval=$with_raja; case "$withval" in yes) hypre_using_raja=yes;; no) hypre_using_raja=no ;; *) hypre_using_raja=no ;; esac -else +else $as_nop hypre_using_raja=no fi @@ -3996,7 +4908,8 @@ fi # Check whether --with-raja-include was given. -if test "${with_raja_include+set}" = set; then : +if test ${with_raja_include+y} +then : withval=$with_raja_include; for raja_dir in $withval; do HYPRE_RAJA_INCLUDE="-I$raja_dir $HYPRE_RAJA_INCLUDE" done; @@ -4007,7 +4920,8 @@ fi # Check whether --with-raja-lib was given. -if test "${with_raja_lib+set}" = set; then : +if test ${with_raja_lib+y} +then : withval=$with_raja_lib; for raja_lib in $withval; do HYPRE_RAJA_LIB="$raja_lib $HYPRE_RAJA_LIB" done; @@ -4018,7 +4932,8 @@ fi # Check whether --with-raja-libs was given. -if test "${with_raja_libs+set}" = set; then : +if test ${with_raja_libs+y} +then : withval=$with_raja_libs; for raja_lib in $withval; do HYPRE_RAJA_LIB="-l$raja_lib $HYPRE_RAJA_LIB" done; @@ -4029,7 +4944,8 @@ fi # Check whether --with-raja-lib-dirs was given. -if test "${with_raja_lib_dirs+set}" = set; then : +if test ${with_raja_lib_dirs+y} +then : withval=$with_raja_lib_dirs; for raja_lib_dir in $withval; do HYPRE_RAJA_LIB_DIR="-L$raja_lib_dir $HYPRE_RAJA_LIB_DIR" done; @@ -4041,13 +4957,14 @@ fi # Check whether --with-kokkos was given. -if test "${with_kokkos+set}" = set; then : +if test ${with_kokkos+y} +then : withval=$with_kokkos; case "$withval" in yes) hypre_using_kokkos=yes ;; no) hypre_using_kokkos=no ;; *) hypre_using_kokkos=no ;; esac -else +else $as_nop hypre_using_kokkos=no fi @@ -4055,7 +4972,8 @@ fi # Check whether --with-kokkos-include was given. -if test "${with_kokkos_include+set}" = set; then : +if test ${with_kokkos_include+y} +then : withval=$with_kokkos_include; for kokkos_dir in $withval; do HYPRE_KOKKOS_INCLUDE="-I$kokkos_dir $HYPRE_KOKKOS_INCLUDE" done; @@ -4066,7 +4984,8 @@ fi # Check whether --with-kokkos-lib was given. -if test "${with_kokkos_lib+set}" = set; then : +if test ${with_kokkos_lib+y} +then : withval=$with_kokkos_lib; for kokkos_lib in $withval; do HYPRE_KOKKOS_LIB="$kokkos_lib $HYPRE_KOKKOS_LIB" done; @@ -4077,7 +4996,8 @@ fi # Check whether --with-kokkos-libs was given. -if test "${with_kokkos_libs+set}" = set; then : +if test ${with_kokkos_libs+y} +then : withval=$with_kokkos_libs; for kokkos_lib in $withval; do HYPRE_KOKKOS_LIB="-l$kokkos_lib $HYPRE_KOKKOS_LIB" done; @@ -4088,7 +5008,8 @@ fi # Check whether --with-kokkos-lib-dirs was given. -if test "${with_kokkos_lib_dirs+set}" = set; then : +if test ${with_kokkos_lib_dirs+y} +then : withval=$with_kokkos_lib_dirs; for kokkos_lib_dir in $withval; do HYPRE_KOKKOS_LIB_DIR="-L$kokkos_lib_dir $HYPRE_KOKKOS_LIB_DIR" done; @@ -4100,13 +5021,14 @@ fi # Check whether --with-umpire-host was given. -if test "${with_umpire_host+set}" = set; then : +if test ${with_umpire_host+y} +then : withval=$with_umpire_host; case "${withval}" in yes) hypre_using_umpire_host=yes ;; no) hypre_using_umpire_host=no ;; *) hypre_using_umpire_host=no ;; esac -else +else $as_nop hypre_using_umpire_host=no fi @@ -4114,13 +5036,14 @@ fi # Check whether --with-umpire-device was given. -if test "${with_umpire_device+set}" = set; then : +if test ${with_umpire_device+y} +then : withval=$with_umpire_device; case "${withval}" in yes) hypre_using_umpire_device=yes ;; no) hypre_using_umpire_device=no ;; *) hypre_using_umpire_device=no ;; esac -else +else $as_nop hypre_using_umpire_device=no fi @@ -4128,13 +5051,14 @@ fi # Check whether --with-umpire-um was given. -if test "${with_umpire_um+set}" = set; then : +if test ${with_umpire_um+y} +then : withval=$with_umpire_um; case "${withval}" in yes) hypre_using_umpire_um=yes ;; no) hypre_using_umpire_um=no ;; *) hypre_using_umpire_um=no ;; esac -else +else $as_nop hypre_using_umpire_um=no fi @@ -4142,13 +5066,14 @@ fi # Check whether --with-umpire-pinned was given. -if test "${with_umpire_pinned+set}" = set; then : +if test ${with_umpire_pinned+y} +then : withval=$with_umpire_pinned; case "${withval}" in yes) hypre_using_umpire_pinned=yes ;; no) hypre_using_umpire_pinned=no ;; *) hypre_using_umpire_pinned=no ;; esac -else +else $as_nop hypre_using_umpire_pinned=no fi @@ -4156,7 +5081,8 @@ fi # Check whether --with-umpire was given. -if test "${with_umpire+set}" = set; then : +if test ${with_umpire+y} +then : withval=$with_umpire; case "${withval}" in yes) hypre_using_umpire_device=yes hypre_using_umpire_um=yes ;; @@ -4168,7 +5094,8 @@ fi # Check whether --with-umpire-include was given. -if test "${with_umpire_include+set}" = set; then : +if test ${with_umpire_include+y} +then : withval=$with_umpire_include; for umpire_dir in $withval; do HYPRE_UMPIRE_INCLUDE="-I$umpire_dir $HYPRE_UMPIRE_INCLUDE" done; @@ -4179,7 +5106,8 @@ fi # Check whether --with-umpire-lib was given. -if test "${with_umpire_lib+set}" = set; then : +if test ${with_umpire_lib+y} +then : withval=$with_umpire_lib; for umpire_lib in $withval; do HYPRE_UMPIRE_LIB="$umpire_lib $HYPRE_UMPIRE_LIB" done; @@ -4190,7 +5118,8 @@ fi # Check whether --with-umpire-libs was given. -if test "${with_umpire_libs+set}" = set; then : +if test ${with_umpire_libs+y} +then : withval=$with_umpire_libs; for umpire_lib in $withval; do HYPRE_UMPIRE_LIB="-l$umpire_lib $HYPRE_UMPIRE_LIB" done; @@ -4201,7 +5130,8 @@ fi # Check whether --with-umpire-lib-dirs was given. -if test "${with_umpire_lib_dirs+set}" = set; then : +if test ${with_umpire_lib_dirs+y} +then : withval=$with_umpire_lib_dirs; for umpire_lib_dir in $withval; do HYPRE_UMPIRE_LIB_DIR="-L$umpire_lib_dir $HYPRE_UMPIRE_LIB_DIR" done; @@ -4212,26 +5142,100 @@ fi +# Check whether --with-magma was given. +if test ${with_magma+y} +then : + withval=$with_magma; case "${withval}" in + yes) hypre_using_magma=yes;; + no) hypre_using_magma=no ;; + *) hypre_using_magma=no ;; + esac +else $as_nop + hypre_using_magma=no + +fi + + +if test "x$with_magma" = "xyes" +then : + +printf "%s\n" "#define HYPRE_USING_MAGMA 1" >>confdefs.h + +fi + + +# Check whether --with-magma-include was given. +if test ${with_magma_include+y} +then : + withval=$with_magma_include; for magma_dir in $withval; do + HYPRE_MAGMA_INCLUDE="-I$magma_dir $HYPRE_MAGMA_INCLUDE" +done; +hypre_user_gave_magma_inc=yes + +fi + + + +# Check whether --with-magma-lib was given. +if test ${with_magma_lib+y} +then : + withval=$with_magma_lib; for magma_lib in $withval; do + HYPRE_MAGMA_LIB="$magma_lib $HYPRE_MAGMA_LIB" + done; +hypre_user_gave_magma_lib=yes + +fi + + + +# Check whether --with-magma-libs was given. +if test ${with_magma_libs+y} +then : + withval=$with_magma_libs; for magma_lib in $withval; do + HYPRE_MAGMA_LIB="-l$magma_lib $HYPRE_MAGMA_LIB" + done; +hypre_user_gave_magma_libs=yes + +fi + + + +# Check whether --with-magma-lib-dirs was given. +if test ${with_magma_lib_dirs+y} +then : + withval=$with_magma_lib_dirs; for magma_lib_dir in $withval; do + HYPRE_MAGMA_LIB_DIR="-L$magma_lib_dir $HYPRE_MAGMA_LIB_DIR" + done; +hypre_user_gave_magma_lib_dirs=yes + +fi + + + + # Check whether --with-caliper was given. -if test "${with_caliper+set}" = set; then : +if test ${with_caliper+y} +then : withval=$with_caliper; case "$withval" in yes) hypre_using_caliper=yes;; *) hypre_using_caliper=no ;; esac -else +else $as_nop hypre_using_caliper=no fi -if test "x$with_caliper" = "xyes"; then : +if test "x$with_caliper" = "xyes" +then : -$as_echo "#define HYPRE_USING_CALIPER 1" >>confdefs.h +printf "%s\n" "#define HYPRE_USING_CALIPER 1" >>confdefs.h fi # Check whether --with-caliper-include was given. -if test "${with_caliper_include+set}" = set; then : +if test ${with_caliper_include+y} +then : withval=$with_caliper_include; for caliper_inc_dir in $withval; do CALIPER_INCLUDE="-I$caliper_inc_dir $CALIPER_INCLUDE" done; @@ -4242,7 +5246,8 @@ fi # Check whether --with-caliper-lib was given. -if test "${with_caliper_lib+set}" = set; then : +if test ${with_caliper_lib+y} +then : withval=$with_caliper_lib; for caliper_lib in $withval; do CALIPER_LIBS="$CALIPER_LIBS $caliper_lib" done; @@ -4257,15 +5262,16 @@ then then if test "$hypre_using_openmp" = "yes" then - for ac_prog in xlc_r xlC_r xlc xlC icc icpc gcc g++ pgcc pgCC cc CC kcc KCC + for ac_prog in xlc_r xlC_r xlc xlC icx icc icpc icpx gcc g++ pgcc pgCC cc CC kcc KCC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -4273,11 +5279,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4288,11 +5298,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -4300,15 +5310,16 @@ fi done else - for ac_prog in xlc xlC icc icpc gcc g++ pgcc pgCC cc CC kcc KCC + for ac_prog in xlc xlC icx icc icpc icpx gcc g++ pgcc pgCC cc CC kcc KCC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -4316,11 +5327,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4331,11 +5346,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -4346,15 +5361,16 @@ done else if test "$hypre_using_openmp" = "yes" then - for ac_prog in mpxlc mpixlc_r mpixlc mpiicc mpigcc mpicc mpipgcc mpipgicc + for ac_prog in mpxlc mpixlc_r mpixlc mpiicx mpiicc mpigcc mpipgcc mpipgicc mpicc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -4362,11 +5378,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4377,11 +5397,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -4389,15 +5409,16 @@ fi done else - for ac_prog in mpxlc mpixlc mpiicc mpigcc mpicc mpipgcc mpipgicc + for ac_prog in mpxlc mpixlc mpiicx mpiicc mpigcc mpipgcc mpipgicc mpicc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -4405,11 +5426,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4420,11 +5445,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -4446,15 +5471,16 @@ then then if test "$hypre_using_openmp" = "yes" then - for ac_prog in xlC_r xlc_r xlC xlc icpc icc g++ gcc pgCC pgcc pgc++ CC cc KCC kcc + for ac_prog in xlC_r xlc_r xlC xlc icpx icx icpc icc g++ gcc pgCC pgcc pgc++ CC cc KCC kcc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else @@ -4462,11 +5488,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4477,11 +5507,11 @@ fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -$as_echo "$CXX" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +printf "%s\n" "$CXX" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -4489,15 +5519,16 @@ fi done else - for ac_prog in xlC xlc icpc icc g++ gcc pgCC pgcc pgc++ CC cc KCC kcc + for ac_prog in xlC xlc icpx icx icpc icc g++ gcc pgCC pgcc pgc++ CC cc KCC kcc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else @@ -4505,11 +5536,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4520,11 +5555,11 @@ fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -$as_echo "$CXX" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +printf "%s\n" "$CXX" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -4535,15 +5570,16 @@ done else if test "$hypre_using_openmp" = "yes" then - for ac_prog in mpxlC mpixlcxx_r mpixlcxx mpixlC mpiicpc mpig++ mpic++ mpicxx mpiCC mpipgCC mpipgic++ + for ac_prog in CC mpxlC mpixlcxx_r mpixlcxx mpixlC mpiicpx mpiicpc mpig++ mpic++ mpicxx mpiCC mpipgCC mpipgic++ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else @@ -4551,11 +5587,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4566,11 +5606,11 @@ fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -$as_echo "$CXX" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +printf "%s\n" "$CXX" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -4578,15 +5618,16 @@ fi done else - for ac_prog in mpxlC mpixlcxx mpixlC mpiicpc mpig++ mpic++ mpicxx mpiCC mpipgCC mpipgic++ + for ac_prog in CC mpxlC mpixlcxx mpixlC mpiicpx mpiicpc mpig++ mpic++ mpicxx mpiCC mpipgCC mpipgic++ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else @@ -4594,11 +5635,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4609,11 +5654,11 @@ fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -$as_echo "$CXX" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +printf "%s\n" "$CXX" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -4635,15 +5680,16 @@ then then if test "$hypre_using_openmp" = "yes" then - for ac_prog in xlf_r ifort gfortran g77 g95 pgf77 pgfortran f77 + for ac_prog in xlf_r ifx ifort gfortran g77 g95 pgf77 pgfortran f77 do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_FC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_FC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$FC"; then ac_cv_prog_FC="$FC" # Let the user override the test. else @@ -4651,11 +5697,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_FC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4666,11 +5716,11 @@ fi fi FC=$ac_cv_prog_FC if test -n "$FC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FC" >&5 -$as_echo "$FC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FC" >&5 +printf "%s\n" "$FC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -4678,15 +5728,115 @@ fi done else - for ac_prog in xlf ifort gfortran g77 g95 pgf77 pgfortran f77 + for ac_prog in xlf ifx ifort gfortran g77 g95 pgf77 pgfortran f77 +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_FC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$FC"; then + ac_cv_prog_FC="$FC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_FC="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +FC=$ac_cv_prog_FC +if test -n "$FC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FC" >&5 +printf "%s\n" "$FC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$FC" && break +done + + fi + else + if test "$hypre_using_openmp" = "yes" + then + for ac_prog in mpxlf mpixlf77_r mpiifx mpiifort mpif77 mpipgf77 mpipgifort do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_FC+:} false; then : - $as_echo_n "(cached) " >&6 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_FC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$FC"; then + ac_cv_prog_FC="$FC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_FC="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +FC=$ac_cv_prog_FC +if test -n "$FC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FC" >&5 +printf "%s\n" "$FC" >&6; } else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$FC" && break +done + + else + for ac_prog in mpxlf mpixlf77 mpiifx mpiifort mpif77 mpipgf77 mpipgifort +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_FC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$FC"; then ac_cv_prog_FC="$FC" # Let the user override the test. else @@ -4694,11 +5844,110 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_FC="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +FC=$ac_cv_prog_FC +if test -n "$FC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FC" >&5 +printf "%s\n" "$FC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$FC" && break +done + + fi + fi + + if test "x$FC" = "x" + then + hypre_using_fortran=no + fi +fi + +if test "x$hypre_using_cuda" = "xyes" && test "x$hypre_using_device_openmp" = "xyes" +then + as_fn_error $? "--with-cuda and --with-device-openmp are mutually exclusive" "$LINENO" 5 +fi + +if test "x$hypre_using_cuda" = "xyes" && test "x$hypre_using_hip" = "xyes" +then + as_fn_error $? "--with-cuda and --with-hip are mutually exclusive" "$LINENO" 5 +fi + +if test "x$hypre_using_cuda" = "xyes" && test "x$hypre_using_sycl" = "xyes" +then + as_fn_error $? "--with-cuda and --with-sycl are mutually exclusive" "$LINENO" 5 +fi + +if test "x$hypre_using_hip" = "xyes" && test "x$hypre_using_device_openmp" = "xyes" +then + as_fn_error $? "--with-hip and --with-device-openmp are mutually exclusive" "$LINENO" 5 +fi + +if test "x$hypre_using_hip" = "xyes" && test "x$hypre_using_sycl" = "xyes" +then + as_fn_error $? "--with-hip and --with-sycl are mutually exclusive" "$LINENO" 5 +fi + +if test "x$hypre_using_sycl" = "xyes" && test "x$hypre_using_device_openmp" = "xyes" +then + as_fn_error $? "--with-sycl and --with-device-openmp are mutually exclusive" "$LINENO" 5 +fi + + +if test "$hypre_user_chose_cudacompilers" = "no" +then + if test "$hypre_using_device_openmp" = "yes" + then + if test "x$hypre_using_kokkos" = "xyes" + then + if test "$hypre_using_mpi" = "no" + then + for ac_prog in clang++-gpu icpx +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CUCC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CUCC"; then + ac_cv_prog_CUCC="$CUCC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_FC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CUCC="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4707,44 +5956,46 @@ IFS=$as_save_IFS fi fi -FC=$ac_cv_prog_FC -if test -n "$FC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FC" >&5 -$as_echo "$FC" >&6; } +CUCC=$ac_cv_prog_CUCC +if test -n "$CUCC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CUCC" >&5 +printf "%s\n" "$CUCC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi - test -n "$FC" && break + test -n "$CUCC" && break done - fi - else - if test "$hypre_using_openmp" = "yes" - then - for ac_prog in mpxlf mpixlf77_r mpiifort mpif77 mpipgf77 mpipgifort + else + for ac_prog in mpiclang++-gpu mpiicpx do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_FC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$FC"; then - ac_cv_prog_FC="$FC" # Let the user override the test. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CUCC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CUCC"; then + ac_cv_prog_CUCC="$CUCC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_FC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CUCC="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4753,41 +6004,49 @@ IFS=$as_save_IFS fi fi -FC=$ac_cv_prog_FC -if test -n "$FC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FC" >&5 -$as_echo "$FC" >&6; } +CUCC=$ac_cv_prog_CUCC +if test -n "$CUCC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CUCC" >&5 +printf "%s\n" "$CUCC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi - test -n "$FC" && break + test -n "$CUCC" && break done + fi else - for ac_prog in mpxlf mpixlf77 mpiifort mpif77 mpipgf77 mpipgifort + if test "$hypre_using_mpi" = "no" + then + for ac_prog in xlc-gpu clang-gpu icx do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_FC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$FC"; then - ac_cv_prog_FC="$FC" # Let the user override the test. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CUCC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CUCC"; then + ac_cv_prog_CUCC="$CUCC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_FC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CUCC="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4796,59 +6055,30 @@ IFS=$as_save_IFS fi fi -FC=$ac_cv_prog_FC -if test -n "$FC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FC" >&5 -$as_echo "$FC" >&6; } +CUCC=$ac_cv_prog_CUCC +if test -n "$CUCC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CUCC" >&5 +printf "%s\n" "$CUCC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi - test -n "$FC" && break + test -n "$CUCC" && break done - fi - fi - - if test "x$FC" = "x" - then - hypre_using_fortran=no - fi -fi - -if test "x$hypre_using_cuda" = "xyes" && test "x$hypre_using_device_openmp" = "xyes" -then - as_fn_error $? "--with-cuda and --with-device-openmp are mutually exclusive" "$LINENO" 5 -fi - -if test "x$hypre_using_cuda" = "xyes" && test "x$hypre_using_hip" = "xyes" -then - as_fn_error $? "--with-cuda and --with-hip are mutually exclusive" "$LINENO" 5 -fi - -if test "x$hypre_using_hip" = "xyes" && test "x$hypre_using_device_openmp" = "xyes" -then - as_fn_error $? "--with-hip and --with-device-openmp are mutually exclusive" "$LINENO" 5 -fi - - -if test "$hypre_user_chose_cudacompilers" = "no" -then - if test "$hypre_using_device_openmp" = "yes" - then - if test "$hypre_using_mpi" = "no" - then - for ac_prog in xlc-gpu clang-gpu + else + for ac_prog in mpixlc-gpu mpiclang-gpu mpiicx do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CUCC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CUCC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CUCC"; then ac_cv_prog_CUCC="$CUCC" # Let the user override the test. else @@ -4856,11 +6086,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CUCC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4871,39 +6105,49 @@ fi fi CUCC=$ac_cv_prog_CUCC if test -n "$CUCC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CUCC" >&5 -$as_echo "$CUCC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CUCC" >&5 +printf "%s\n" "$CUCC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi test -n "$CUCC" && break done - else - for ac_prog in mpixlc-gpu mpiclang-gpu + fi + fi + fi + + if test "$hypre_using_cuda" = "yes" + then + for ac_prog in nvcc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CUCC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CUCC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CUCC"; then ac_cv_prog_CUCC="$CUCC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH +for as_dir in "${CUDA_HOME}/bin" do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CUCC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4914,43 +6158,49 @@ fi fi CUCC=$ac_cv_prog_CUCC if test -n "$CUCC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CUCC" >&5 -$as_echo "$CUCC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CUCC" >&5 +printf "%s\n" "$CUCC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi test -n "$CUCC" && break done +test -n "$CUCC" || CUCC="""" - fi + CUCC="\${HYPRE_CUDA_PATH}/bin/${CUCC} -ccbin=\${CXX}" fi - if test "$hypre_using_cuda" = "yes" + if test "$hypre_using_hip" = "yes" then - for ac_prog in nvcc + for ac_prog in hipcc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CUCC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CUCC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CUCC"; then ac_cv_prog_CUCC="$CUCC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in "${CUDA_HOME}/bin" +for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CUCC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4961,32 +6211,31 @@ fi fi CUCC=$ac_cv_prog_CUCC if test -n "$CUCC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CUCC" >&5 -$as_echo "$CUCC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CUCC" >&5 +printf "%s\n" "$CUCC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi test -n "$CUCC" && break done -test -n "$CUCC" || CUCC="""" - CUCC="\${HYPRE_CUDA_PATH}/bin/${CUCC} -ccbin=\${CXX}" fi - if test "$hypre_using_hip" = "yes" + if test "$hypre_using_sycl" = "yes" then - for ac_prog in hipcc + for ac_prog in icpx do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CUCC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CUCC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CUCC"; then ac_cv_prog_CUCC="$CUCC" # Let the user override the test. else @@ -4994,11 +6243,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CUCC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5009,11 +6262,11 @@ fi fi CUCC=$ac_cv_prog_CUCC if test -n "$CUCC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CUCC" >&5 -$as_echo "$CUCC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CUCC" >&5 +printf "%s\n" "$CUCC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5023,13 +6276,14 @@ done fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : - $as_echo_n "(cached) " >&6 -else +ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval test \${ac_cv_prog_make_${ac_make}_set+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @@ -5045,23 +6299,24 @@ esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } SET_MAKE= else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_RANLIB+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else @@ -5069,11 +6324,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5084,11 +6343,11 @@ fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 -$as_echo "$RANLIB" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +printf "%s\n" "$RANLIB" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5097,11 +6356,12 @@ if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_RANLIB+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else @@ -5109,11 +6369,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5124,11 +6388,11 @@ fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -$as_echo "$ac_ct_RANLIB" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +printf "%s\n" "$ac_ct_RANLIB" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then @@ -5136,8 +6400,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB @@ -5149,7 +6413,16 @@ fi if test "$hypre_using_c" = "yes" then - ac_ext=c + + + + + + + + + +ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' @@ -5157,11 +6430,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -5169,11 +6443,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5184,11 +6462,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5197,11 +6475,12 @@ if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else @@ -5209,11 +6488,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5224,11 +6507,11 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then @@ -5236,8 +6519,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -5250,11 +6533,12 @@ if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -5262,11 +6546,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5277,11 +6565,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5290,11 +6578,12 @@ fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -5303,15 +6592,19 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5327,18 +6620,18 @@ if test $ac_prog_rejected = yes; then # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5349,11 +6642,12 @@ if test -z "$CC"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -5361,11 +6655,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5376,11 +6674,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5393,11 +6691,12 @@ if test -z "$CC"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else @@ -5405,11 +6704,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5420,11 +6723,11 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5436,34 +6739,138 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. +set dummy ${ac_tool_prefix}clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "clang", so it can be a program name with args. +set dummy clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi +else + CC="$ac_cv_prog_CC" fi fi -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 -for ac_option in --version -v -V -qversion; do +for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -5473,7 +6880,7 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done @@ -5481,7 +6888,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; @@ -5493,9 +6900,9 @@ ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +printf %s "checking whether the C compiler works... " >&6; } +ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" @@ -5516,11 +6923,12 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, @@ -5537,7 +6945,7 @@ do # certainly right. break;; *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi @@ -5553,44 +6961,46 @@ do done test "$ac_cv_exeext" = no && ac_cv_exeext= -else +else $as_nop ac_file='' fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 +if test -z "$ac_file" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +printf %s "checking for C compiler default output file name... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +printf "%s\n" "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +printf %s "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with @@ -5604,15 +7014,15 @@ for ac_file in conftest.exe conftest conftest.*; do * ) break;; esac done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +printf "%s\n" "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext @@ -5621,7 +7031,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; @@ -5633,8 +7043,8 @@ _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +printf %s "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in @@ -5642,10 +7052,10 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in @@ -5653,39 +7063,40 @@ $as_echo "$ac_try_echo"; } >&5 *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +printf "%s\n" "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +printf %s "checking for suffix of object files... " >&6; } +if test ${ac_cv_objext+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; @@ -5699,11 +7110,12 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in @@ -5712,31 +7124,32 @@ $as_echo "$ac_try_echo"; } >&5 break;; esac done -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +printf "%s\n" "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +printf %s "checking whether the compiler supports GNU C... " >&6; } +if test ${ac_cv_c_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { #ifndef __GNUC__ choke me @@ -5746,29 +7159,33 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_compiler_gnu=yes -else +else $as_nop ac_compiler_gnu=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_c_compiler_gnu + if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi -ac_test_CFLAGS=${CFLAGS+set} +ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +printf %s "checking whether $CC accepts -g... " >&6; } +if test ${ac_cv_prog_cc_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no @@ -5777,57 +7194,60 @@ else /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_g=yes -else +else $as_nop CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : -else +else $as_nop ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then @@ -5842,94 +7262,144 @@ else CFLAGS= fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no +ac_prog_cc_stdc=no +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 +printf %s "checking for $CC option to enable C11 features... " >&6; } +if test ${ac_cv_prog_cc_c11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; +$ac_c_conftest_c11_program +_ACEOF +for ac_arg in '' -std=gnu11 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c11" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; +if test "x$ac_cv_prog_cc_c11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } + CC="$CC $ac_cv_prog_cc_c11" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 + ac_prog_cc_stdc=c11 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 +printf %s "checking for $CC option to enable C99 features... " >&6; } +if test ${ac_cv_prog_cc_c99+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c99_program +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} +if test "x$ac_cv_prog_cc_c99" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c99" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } + CC="$CC $ac_cv_prog_cc_c99" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 + ac_prog_cc_stdc=c99 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 +printf %s "checking for $CC option to enable C89 features... " >&6; } +if test ${ac_cv_prog_cc_c89+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c89_program _ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : + if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_c89=$ac_arg fi -rm -f core conftest.err conftest.$ac_objext +rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC - fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : +if test "x$ac_cv_prog_cc_c89" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c89" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } + CC="$CC $ac_cv_prog_cc_c89" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + ac_prog_cc_stdc=c89 +fi fi ac_ext=c @@ -5942,7 +7412,13 @@ fi if test "$hypre_using_cxx" = "yes" then - ac_ext=cpp + + + + + + +ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' @@ -5952,15 +7428,16 @@ if test -z "$CXX"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else @@ -5968,11 +7445,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5983,11 +7464,11 @@ fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -$as_echo "$CXX" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +printf "%s\n" "$CXX" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5996,15 +7477,16 @@ fi fi if test -z "$CXX"; then ac_ct_CXX=$CXX - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else @@ -6012,11 +7494,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6027,11 +7513,11 @@ fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 -$as_echo "$ac_ct_CXX" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +printf "%s\n" "$ac_ct_CXX" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -6043,8 +7529,8 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX @@ -6054,7 +7540,7 @@ fi fi fi # Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do @@ -6064,7 +7550,7 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -6074,20 +7560,21 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 -$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } -if ${ac_cv_cxx_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C++" >&5 +printf %s "checking whether the compiler supports GNU C++... " >&6; } +if test ${ac_cv_cxx_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { #ifndef __GNUC__ choke me @@ -6097,29 +7584,33 @@ main () return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : ac_compiler_gnu=yes -else +else $as_nop ac_compiler_gnu=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 -$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi -ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_test_CXXFLAGS=${CXXFLAGS+y} ac_save_CXXFLAGS=$CXXFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 -$as_echo_n "checking whether $CXX accepts -g... " >&6; } -if ${ac_cv_prog_cxx_g+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +printf %s "checking whether $CXX accepts -g... " >&6; } +if test ${ac_cv_prog_cxx_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no @@ -6128,57 +7619,60 @@ else /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : ac_cv_prog_cxx_g=yes -else +else $as_nop CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : -else +else $as_nop ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : ac_cv_prog_cxx_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 -$as_echo "$ac_cv_prog_cxx_g" >&6; } -if test "$ac_test_CXXFLAGS" = set; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +printf "%s\n" "$ac_cv_prog_cxx_g" >&6; } +if test $ac_test_CXXFLAGS; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then @@ -6193,6 +7687,100 @@ else CXXFLAGS= fi fi +ac_prog_cxx_stdcxx=no +if test x$ac_prog_cxx_stdcxx = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5 +printf %s "checking for $CXX option to enable C++11 features... " >&6; } +if test ${ac_cv_prog_cxx_11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cxx_11=no +ac_save_CXX=$CXX +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_cxx_conftest_cxx11_program +_ACEOF +for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA +do + CXX="$ac_save_CXX $ac_arg" + if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_cxx11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cxx_cxx11" != "xno" && break +done +rm -f conftest.$ac_ext +CXX=$ac_save_CXX +fi + +if test "x$ac_cv_prog_cxx_cxx11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cxx_cxx11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5 +printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; } + CXX="$CXX $ac_cv_prog_cxx_cxx11" +fi + ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 + ac_prog_cxx_stdcxx=cxx11 +fi +fi +if test x$ac_prog_cxx_stdcxx = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5 +printf %s "checking for $CXX option to enable C++98 features... " >&6; } +if test ${ac_cv_prog_cxx_98+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cxx_98=no +ac_save_CXX=$CXX +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_cxx_conftest_cxx98_program +_ACEOF +for ac_arg in '' -std=gnu++98 -std=c++98 -qlanglvl=extended -AA +do + CXX="$ac_save_CXX $ac_arg" + if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_cxx98=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cxx_cxx98" != "xno" && break +done +rm -f conftest.$ac_ext +CXX=$ac_save_CXX +fi + +if test "x$ac_cv_prog_cxx_cxx98" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cxx_cxx98" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5 +printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; } + CXX="$CXX $ac_cv_prog_cxx_cxx98" +fi + ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98 + ac_prog_cxx_stdcxx=cxx98 +fi +fi + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -6212,11 +7800,12 @@ if test -n "$ac_tool_prefix"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_FC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_FC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$FC"; then ac_cv_prog_FC="$FC" # Let the user override the test. else @@ -6224,11 +7813,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_FC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6239,11 +7832,11 @@ fi fi FC=$ac_cv_prog_FC if test -n "$FC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FC" >&5 -$as_echo "$FC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FC" >&5 +printf "%s\n" "$FC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -6256,11 +7849,12 @@ if test -z "$FC"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_FC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_FC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_FC"; then ac_cv_prog_ac_ct_FC="$ac_ct_FC" # Let the user override the test. else @@ -6268,11 +7862,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_FC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6283,11 +7881,11 @@ fi fi ac_ct_FC=$ac_cv_prog_ac_ct_FC if test -n "$ac_ct_FC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FC" >&5 -$as_echo "$ac_ct_FC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FC" >&5 +printf "%s\n" "$ac_ct_FC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -6299,8 +7897,8 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac FC=$ac_ct_FC @@ -6309,7 +7907,7 @@ fi # Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran compiler version" >&5 +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Fortran compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do @@ -6319,7 +7917,7 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -6329,7 +7927,7 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done rm -f a.out @@ -6338,11 +7936,12 @@ rm -f a.out # input file. (Note that this only needs to work for GNU compilers.) ac_save_ext=$ac_ext ac_ext=F -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU Fortran compiler" >&5 -$as_echo_n "checking whether we are using the GNU Fortran compiler... " >&6; } -if ${ac_cv_fc_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU Fortran" >&5 +printf %s "checking whether the compiler supports GNU Fortran... " >&6; } +if test ${ac_cv_fc_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat > conftest.$ac_ext <<_ACEOF program main #ifndef __GNUC__ @@ -6351,43 +7950,48 @@ else end _ACEOF -if ac_fn_fc_try_compile "$LINENO"; then : +if ac_fn_fc_try_compile "$LINENO" +then : ac_compiler_gnu=yes -else +else $as_nop ac_compiler_gnu=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_fc_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_compiler_gnu" >&5 -$as_echo "$ac_cv_fc_compiler_gnu" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_fc_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_fc_compiler_gnu + ac_ext=$ac_save_ext -ac_test_FCFLAGS=${FCFLAGS+set} +ac_test_FCFLAGS=${FCFLAGS+y} ac_save_FCFLAGS=$FCFLAGS FCFLAGS= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $FC accepts -g" >&5 -$as_echo_n "checking whether $FC accepts -g... " >&6; } -if ${ac_cv_prog_fc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $FC accepts -g" >&5 +printf %s "checking whether $FC accepts -g... " >&6; } +if test ${ac_cv_prog_fc_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop FCFLAGS=-g cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF -if ac_fn_fc_try_compile "$LINENO"; then : +if ac_fn_fc_try_compile "$LINENO" +then : ac_cv_prog_fc_g=yes -else +else $as_nop ac_cv_prog_fc_g=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_fc_g" >&5 -$as_echo "$ac_cv_prog_fc_g" >&6; } -if test "$ac_test_FCFLAGS" = set; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_fc_g" >&5 +printf "%s\n" "$ac_cv_prog_fc_g" >&6; } +if test $ac_test_FCFLAGS; then FCFLAGS=$ac_save_FCFLAGS elif test $ac_cv_prog_fc_g = yes; then if test "x$ac_cv_fc_compiler_gnu" = xyes; then @@ -6419,17 +8023,19 @@ ac_ext=${ac_fc_srcext-f} ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_fc_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to get verbose linking output from $FC" >&5 -$as_echo_n "checking how to get verbose linking output from $FC... " >&6; } -if ${ac_cv_prog_fc_v+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to get verbose linking output from $FC" >&5 +printf %s "checking how to get verbose linking output from $FC... " >&6; } +if test ${ac_cv_prog_fc_v+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF -if ac_fn_fc_try_compile "$LINENO"; then : +if ac_fn_fc_try_compile "$LINENO" +then : ac_cv_prog_fc_v= # Try some options frequently used verbose output for ac_verb in -v -verbose --verbose -V -\#\#\#; do @@ -6447,13 +8053,13 @@ ac_save_FCFLAGS=$FCFLAGS FCFLAGS="$FCFLAGS $ac_verb" eval "set x $ac_link" shift -$as_echo "$as_me:${as_lineno-$LINENO}: $*" >&5 +printf "%s\n" "$as_me:${as_lineno-$LINENO}: $*" >&5 # gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH, # LIBRARY_PATH; skip all such settings. ac_fc_v_output=`eval $ac_link 5>&1 2>&1 | sed '/^Driving:/d; /^Configured with:/d; '"/^[_$as_cr_Letters][_$as_cr_alnum]*=/d"` -$as_echo "$ac_fc_v_output" >&5 +printf "%s\n" "$ac_fc_v_output" >&5 FCFLAGS=$ac_save_FCFLAGS rm -rf conftest* @@ -6520,23 +8126,24 @@ esac done done if test -z "$ac_cv_prog_fc_v"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot determine how to obtain linking information from $FC" >&5 -$as_echo "$as_me: WARNING: cannot determine how to obtain linking information from $FC" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cannot determine how to obtain linking information from $FC" >&5 +printf "%s\n" "$as_me: WARNING: cannot determine how to obtain linking information from $FC" >&2;} fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: compilation failed" >&5 -$as_echo "$as_me: WARNING: compilation failed" >&2;} +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: compilation failed" >&5 +printf "%s\n" "$as_me: WARNING: compilation failed" >&2;} fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_fc_v" >&5 -$as_echo "$ac_cv_prog_fc_v" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran libraries of $FC" >&5 -$as_echo_n "checking for Fortran libraries of $FC... " >&6; } -if ${ac_cv_fc_libs+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_fc_v" >&5 +printf "%s\n" "$ac_cv_prog_fc_v" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Fortran libraries of $FC" >&5 +printf %s "checking for Fortran libraries of $FC... " >&6; } +if test ${ac_cv_fc_libs+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test "x$FCLIBS" != "x"; then ac_cv_fc_libs="$FCLIBS" # Let the user override the test. else @@ -6555,13 +8162,13 @@ ac_save_FCFLAGS=$FCFLAGS FCFLAGS="$FCFLAGS $ac_cv_prog_fc_v" eval "set x $ac_link" shift -$as_echo "$as_me:${as_lineno-$LINENO}: $*" >&5 +printf "%s\n" "$as_me:${as_lineno-$LINENO}: $*" >&5 # gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH, # LIBRARY_PATH; skip all such settings. ac_fc_v_output=`eval $ac_link 5>&1 2>&1 | sed '/^Driving:/d; /^Configured with:/d; '"/^[_$as_cr_Letters][_$as_cr_alnum]*=/d"` -$as_echo "$ac_fc_v_output" >&5 +printf "%s\n" "$ac_fc_v_output" >&5 FCFLAGS=$ac_save_FCFLAGS rm -rf conftest* @@ -6638,9 +8245,10 @@ while test $# != 1; do fi done - if test x"$ac_exists" = xtrue; then : + if test x"$ac_exists" = xtrue +then : -else +else $as_nop ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg" fi ;; @@ -6653,9 +8261,10 @@ fi fi done - if test x"$ac_exists" = xtrue; then : + if test x"$ac_exists" = xtrue +then : -else +else $as_nop if test "$ac_compiler_gnu" = yes; then for ac_link_opt in $ac_arg; do ac_cv_fc_libs="$ac_cv_fc_libs -Xlinker $ac_link_opt" @@ -6670,9 +8279,24 @@ fi |-LANG:=* | -LIST:* | -LNO:* | -link) ;; -lkernel32) + # Ignore this library only on Windows-like systems. case $host_os in - *cygwin*) ;; - *) ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg" + cygwin* | msys* ) ;; + *) + ac_exists=false + for ac_i in $ac_cv_fc_libs; do + if test x"$ac_arg" = x"$ac_i"; then + ac_exists=true + break + fi + done + + if test x"$ac_exists" = xtrue +then : + +else $as_nop + ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg" +fi ;; esac ;; @@ -6690,7 +8314,7 @@ fi esac ;; -YP,*) - for ac_j in `$as_echo "$ac_arg" | sed -e 's/-YP,/-L/;s/:/ -L/g'`; do + for ac_j in `printf "%s\n" "$ac_arg" | sed -e 's/-YP,/-L/;s/:/ -L/g'`; do ac_exists=false for ac_i in $ac_cv_fc_libs; do if test x"$ac_j" = x"$ac_i"; then @@ -6699,9 +8323,10 @@ fi fi done - if test x"$ac_exists" = xtrue; then : + if test x"$ac_exists" = xtrue +then : -else +else $as_nop ac_arg="$ac_arg $ac_j" ac_cv_fc_libs="$ac_cv_fc_libs $ac_j" fi @@ -6716,15 +8341,17 @@ fi fi done - if test x"$ac_exists" = xtrue; then : + if test x"$ac_exists" = xtrue +then : -else +else $as_nop ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg" fi ;; -zallextract*| -zdefaultextract) ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg" ;; + -mllvm) ${2+shift};; # Defend against 'clang -mllvm -loopopt=0'. # Ignore everything else. esac done @@ -6736,7 +8363,7 @@ set X $ac_save_positional; shift # must begin with a "/"). case `(uname -sr) 2>/dev/null` in "SunOS 5"*) - ac_ld_run_path=`$as_echo "$ac_fc_v_output" | + ac_ld_run_path=`printf "%s\n" "$ac_fc_v_output" | sed -n 's,^.*LD_RUN_PATH *= *\(/[^ ]*\).*$,-R\1,p'` test "x$ac_ld_run_path" != x && if test "$ac_compiler_gnu" = yes; then @@ -6751,8 +8378,8 @@ esac fi # test "x$[]_AC_LANG_PREFIX[]LIBS" = "x" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_libs" >&5 -$as_echo "$ac_cv_fc_libs" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_libs" >&5 +printf "%s\n" "$ac_cv_fc_libs" >&6; } FCLIBS="$ac_cv_fc_libs" @@ -6768,11 +8395,12 @@ ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_fc_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dummy main to link with Fortran libraries" >&5 -$as_echo_n "checking for dummy main to link with Fortran libraries... " >&6; } -if ${ac_cv_fc_dummy_main+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dummy main to link with Fortran libraries" >&5 +printf %s "checking for dummy main to link with Fortran libraries... " >&6; } +if test ${ac_cv_fc_dummy_main+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_fc_dm_save_LIBS=$LIBS LIBS="$LIBS $FCLIBS" ac_fortran_dm_var=FC_DUMMY_MAIN @@ -6795,19 +8423,20 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu #endif #endif int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_fortran_dummy_main=none -else +else $as_nop ac_cv_fortran_dummy_main=unknown fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test $ac_cv_fortran_dummy_main = unknown; then @@ -6824,17 +8453,18 @@ rm -f core conftest.err conftest.$ac_objext \ #endif #endif int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_fortran_dummy_main=$ac_func; break fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext done fi @@ -6847,25 +8477,24 @@ ac_compiler_gnu=$ac_cv_fc_compiler_gnu LIBS=$ac_fc_dm_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_dummy_main" >&5 -$as_echo "$ac_cv_fc_dummy_main" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_dummy_main" >&5 +printf "%s\n" "$ac_cv_fc_dummy_main" >&6; } FC_DUMMY_MAIN=$ac_cv_fc_dummy_main -if test "$FC_DUMMY_MAIN" != unknown; then : +if test "$FC_DUMMY_MAIN" != unknown +then : if test $FC_DUMMY_MAIN != none; then -cat >>confdefs.h <<_ACEOF -#define FC_DUMMY_MAIN $FC_DUMMY_MAIN -_ACEOF +printf "%s\n" "#define FC_DUMMY_MAIN $FC_DUMMY_MAIN" >>confdefs.h if test "x$ac_cv_fc_dummy_main" = "x$ac_cv_f77_dummy_main"; then -$as_echo "#define FC_DUMMY_MAIN_EQ_F77 1" >>confdefs.h +printf "%s\n" "#define FC_DUMMY_MAIN_EQ_F77 1" >>confdefs.h fi fi -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "linking to Fortran libraries from C fails See \`config.log' for more details" "$LINENO" 5; } fi @@ -6880,11 +8509,12 @@ ac_ext=${ac_fc_srcext-f} ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_fc_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran name-mangling scheme" >&5 -$as_echo_n "checking for Fortran name-mangling scheme... " >&6; } -if ${ac_cv_fc_mangling+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Fortran name-mangling scheme" >&5 +printf %s "checking for Fortran name-mangling scheme... " >&6; } +if test ${ac_cv_fc_mangling+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat > conftest.$ac_ext <<_ACEOF subroutine foobar() return @@ -6893,7 +8523,8 @@ else return end _ACEOF -if ac_fn_fc_try_compile "$LINENO"; then : +if ac_fn_fc_try_compile "$LINENO" +then : mv conftest.$ac_objext cfortran_test.$ac_objext ac_save_LIBS=$LIBS @@ -6914,9 +8545,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char $ac_func (); #ifdef FC_DUMMY_MAIN #ifndef FC_DUMMY_MAIN_EQ_F77 @@ -6927,17 +8555,18 @@ char $ac_func (); #endif #endif int -main () +main (void) { return $ac_func (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_success=yes; break 2 fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext done done @@ -6972,9 +8601,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char $ac_func (); #ifdef FC_DUMMY_MAIN #ifndef FC_DUMMY_MAIN_EQ_F77 @@ -6985,17 +8611,18 @@ char $ac_func (); #endif #endif int -main () +main (void) { return $ac_func (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_success_extra=yes; break fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext done ac_ext=${ac_fc_srcext-f} @@ -7025,17 +8652,17 @@ ac_compiler_gnu=$ac_cv_fc_compiler_gnu LIBS=$ac_save_LIBS rm -rf conftest* rm -f cfortran_test* -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compile a simple Fortran program See \`config.log' for more details" "$LINENO" 5; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_mangling" >&5 -$as_echo "$ac_cv_fc_mangling" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_mangling" >&5 +printf "%s\n" "$ac_cv_fc_mangling" >&6; } ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -7049,48 +8676,48 @@ ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest ac_compiler_gnu=$ac_cv_fc_compiler_gnu case $ac_cv_fc_mangling in "lower case, no underscore, no extra underscore") - $as_echo "#define FC_FUNC(name,NAME) name" >>confdefs.h + printf "%s\n" "#define FC_FUNC(name,NAME) name" >>confdefs.h - $as_echo "#define FC_FUNC_(name,NAME) name" >>confdefs.h + printf "%s\n" "#define FC_FUNC_(name,NAME) name" >>confdefs.h ;; "lower case, no underscore, extra underscore") - $as_echo "#define FC_FUNC(name,NAME) name" >>confdefs.h + printf "%s\n" "#define FC_FUNC(name,NAME) name" >>confdefs.h - $as_echo "#define FC_FUNC_(name,NAME) name ## _" >>confdefs.h + printf "%s\n" "#define FC_FUNC_(name,NAME) name ## _" >>confdefs.h ;; "lower case, underscore, no extra underscore") - $as_echo "#define FC_FUNC(name,NAME) name ## _" >>confdefs.h + printf "%s\n" "#define FC_FUNC(name,NAME) name ## _" >>confdefs.h - $as_echo "#define FC_FUNC_(name,NAME) name ## _" >>confdefs.h + printf "%s\n" "#define FC_FUNC_(name,NAME) name ## _" >>confdefs.h ;; "lower case, underscore, extra underscore") - $as_echo "#define FC_FUNC(name,NAME) name ## _" >>confdefs.h + printf "%s\n" "#define FC_FUNC(name,NAME) name ## _" >>confdefs.h - $as_echo "#define FC_FUNC_(name,NAME) name ## __" >>confdefs.h + printf "%s\n" "#define FC_FUNC_(name,NAME) name ## __" >>confdefs.h ;; "upper case, no underscore, no extra underscore") - $as_echo "#define FC_FUNC(name,NAME) NAME" >>confdefs.h + printf "%s\n" "#define FC_FUNC(name,NAME) NAME" >>confdefs.h - $as_echo "#define FC_FUNC_(name,NAME) NAME" >>confdefs.h + printf "%s\n" "#define FC_FUNC_(name,NAME) NAME" >>confdefs.h ;; "upper case, no underscore, extra underscore") - $as_echo "#define FC_FUNC(name,NAME) NAME" >>confdefs.h + printf "%s\n" "#define FC_FUNC(name,NAME) NAME" >>confdefs.h - $as_echo "#define FC_FUNC_(name,NAME) NAME ## _" >>confdefs.h + printf "%s\n" "#define FC_FUNC_(name,NAME) NAME ## _" >>confdefs.h ;; "upper case, underscore, no extra underscore") - $as_echo "#define FC_FUNC(name,NAME) NAME ## _" >>confdefs.h + printf "%s\n" "#define FC_FUNC(name,NAME) NAME ## _" >>confdefs.h - $as_echo "#define FC_FUNC_(name,NAME) NAME ## _" >>confdefs.h + printf "%s\n" "#define FC_FUNC_(name,NAME) NAME ## _" >>confdefs.h ;; "upper case, underscore, extra underscore") - $as_echo "#define FC_FUNC(name,NAME) NAME ## _" >>confdefs.h + printf "%s\n" "#define FC_FUNC(name,NAME) NAME ## _" >>confdefs.h - $as_echo "#define FC_FUNC_(name,NAME) NAME ## __" >>confdefs.h + printf "%s\n" "#define FC_FUNC_(name,NAME) NAME ## __" >>confdefs.h ;; *) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unknown Fortran name-mangling scheme" >&5 -$as_echo "$as_me: WARNING: unknown Fortran name-mangling scheme" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unknown Fortran name-mangling scheme" >&5 +printf "%s\n" "$as_me: WARNING: unknown Fortran name-mangling scheme" >&2;} ;; esac @@ -7105,24 +8732,26 @@ fi if test "$hypre_using_mpi" = "no" then -$as_echo "#define HYPRE_SEQUENTIAL 1" >>confdefs.h +printf "%s\n" "#define HYPRE_SEQUENTIAL 1" >>confdefs.h else if test x = x"$MPILIBS"; then ac_fn_c_check_func "$LINENO" "MPI_Init" "ac_cv_func_MPI_Init" -if test "x$ac_cv_func_MPI_Init" = xyes; then : +if test "x$ac_cv_func_MPI_Init" = xyes +then : MPILIBS=" " fi fi if test x = x"$MPILIBS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MPI_Init in -lmpi" >&5 -$as_echo_n "checking for MPI_Init in -lmpi... " >&6; } -if ${ac_cv_lib_mpi_MPI_Init+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MPI_Init in -lmpi" >&5 +printf %s "checking for MPI_Init in -lmpi... " >&6; } +if test ${ac_cv_lib_mpi_MPI_Init+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lmpi $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -7131,9 +8760,6 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char MPI_Init (); #ifdef FC_DUMMY_MAIN #ifndef FC_DUMMY_MAIN_EQ_F77 @@ -7144,36 +8770,39 @@ char MPI_Init (); #endif #endif int -main () +main (void) { return MPI_Init (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_mpi_MPI_Init=yes -else +else $as_nop ac_cv_lib_mpi_MPI_Init=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mpi_MPI_Init" >&5 -$as_echo "$ac_cv_lib_mpi_MPI_Init" >&6; } -if test "x$ac_cv_lib_mpi_MPI_Init" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mpi_MPI_Init" >&5 +printf "%s\n" "$ac_cv_lib_mpi_MPI_Init" >&6; } +if test "x$ac_cv_lib_mpi_MPI_Init" = xyes +then : MPILIBS="-lmpi" fi fi if test x = x"$MPILIBS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MPI_Init in -lmpich" >&5 -$as_echo_n "checking for MPI_Init in -lmpich... " >&6; } -if ${ac_cv_lib_mpich_MPI_Init+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MPI_Init in -lmpich" >&5 +printf %s "checking for MPI_Init in -lmpich... " >&6; } +if test ${ac_cv_lib_mpich_MPI_Init+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lmpich $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -7182,9 +8811,6 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char MPI_Init (); #ifdef FC_DUMMY_MAIN #ifndef FC_DUMMY_MAIN_EQ_F77 @@ -7195,33 +8821,35 @@ char MPI_Init (); #endif #endif int -main () +main (void) { return MPI_Init (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_mpich_MPI_Init=yes -else +else $as_nop ac_cv_lib_mpich_MPI_Init=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mpich_MPI_Init" >&5 -$as_echo "$ac_cv_lib_mpich_MPI_Init" >&6; } -if test "x$ac_cv_lib_mpich_MPI_Init" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mpich_MPI_Init" >&5 +printf "%s\n" "$ac_cv_lib_mpich_MPI_Init" >&6; } +if test "x$ac_cv_lib_mpich_MPI_Init" = xyes +then : MPILIBS="-lmpich" fi fi if test x != x"$MPILIBS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mpi.h" >&5 -$as_echo_n "checking for mpi.h... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mpi.h" >&5 +printf %s "checking for mpi.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -7234,22 +8862,23 @@ $as_echo_n "checking for mpi.h... " >&6; } #endif #endif int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop MPILIBS="" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi @@ -7260,62 +8889,54 @@ if test x = x"$MPILIBS"; then : else -$as_echo "#define HYPRE_HAVE_MPI 1" >>confdefs.h +printf "%s\n" "#define HYPRE_HAVE_MPI 1" >>confdefs.h LIBS="$LIBS $MPILIBS" : fi - for ac_func in MPI_Comm_f2c -do : - ac_fn_c_check_func "$LINENO" "MPI_Comm_f2c" "ac_cv_func_MPI_Comm_f2c" -if test "x$ac_cv_func_MPI_Comm_f2c" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_MPI_COMM_F2C 1 -_ACEOF + ac_fn_c_check_func "$LINENO" "MPI_Comm_f2c" "ac_cv_func_MPI_Comm_f2c" +if test "x$ac_cv_func_MPI_Comm_f2c" = xyes +then : + printf "%s\n" "#define HAVE_MPI_COMM_F2C 1" >>confdefs.h fi -done ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +printf %s "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + if test ${ac_cv_prog_CPP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + # Double quotes because $CC needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif +#include Syntax error _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : -else +else $as_nop # Broken: fails on valid input. continue fi @@ -7327,10 +8948,11 @@ rm -f conftest.err conftest.i conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : # Broken: success on invalid input. continue -else +else $as_nop # Passes both tests. ac_preproc_ok=: break @@ -7340,7 +8962,8 @@ rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : +if $ac_preproc_ok +then : break fi @@ -7352,29 +8975,24 @@ fi else ac_cv_prog_CPP=$CPP fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +printf "%s\n" "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif +#include Syntax error _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : -else +else $as_nop # Broken: fails on valid input. continue fi @@ -7386,10 +9004,11 @@ rm -f conftest.err conftest.i conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : # Broken: success on invalid input. continue -else +else $as_nop # Passes both tests. ac_preproc_ok=: break @@ -7399,11 +9018,12 @@ rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : +if $ac_preproc_ok +then : -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi @@ -7415,11 +9035,12 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +printf %s "checking for grep that handles long lines and -e... " >&6; } +if test ${ac_cv_path_GREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST @@ -7427,10 +9048,15 @@ else for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in grep ggrep + do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP @@ -7439,13 +9065,13 @@ case `"$ac_path_GREP" --version 2>&1` in ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" + printf "%s\n" 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val @@ -7473,16 +9099,17 @@ else fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +printf "%s\n" "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +printf %s "checking for egrep... " >&6; } +if test ${ac_cv_path_EGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else @@ -7493,10 +9120,15 @@ else for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in egrep + do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP @@ -7505,13 +9137,13 @@ case `"$ac_path_EGREP" --version 2>&1` in ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" + printf "%s\n" 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val @@ -7540,16 +9172,17 @@ fi fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +printf "%s\n" "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether MPI_Comm_f2c is a macro" >&5 -$as_echo_n "checking whether MPI_Comm_f2c is a macro... " >&6; } -if ${hypre_cv_func_MPI_Comm_f2c_macro+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether MPI_Comm_f2c is a macro" >&5 +printf %s "checking whether MPI_Comm_f2c is a macro... " >&6; } +if test ${hypre_cv_func_MPI_Comm_f2c_macro+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7559,20 +9192,21 @@ else #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "mpi_header_defines_MPI_Comm_f2c" >/dev/null 2>&1; then : + $EGREP "mpi_header_defines_MPI_Comm_f2c" >/dev/null 2>&1 +then : hypre_cv_func_MPI_Comm_f2c_macro=yes -else +else $as_nop hypre_cv_func_MPI_Comm_f2c_macro=no fi -rm -f conftest* +rm -rf conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hypre_cv_func_MPI_Comm_f2c_macro" >&5 -$as_echo "$hypre_cv_func_MPI_Comm_f2c_macro" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hypre_cv_func_MPI_Comm_f2c_macro" >&5 +printf "%s\n" "$hypre_cv_func_MPI_Comm_f2c_macro" >&6; } if test $ac_cv_func_MPI_Comm_f2c = yes \ || test $hypre_cv_func_MPI_Comm_f2c_macro = yes; then -$as_echo "#define HYPRE_HAVE_MPI_COMM_F2C 1" >>confdefs.h +printf "%s\n" "#define HYPRE_HAVE_MPI_COMM_F2C 1" >>confdefs.h fi fi @@ -7580,14 +9214,21 @@ fi if test "$hypre_using_node_aware_mpi" = "yes" then -$as_echo "#define HYPRE_USING_NODE_AWARE_MPI 1" >>confdefs.h +printf "%s\n" "#define HYPRE_USING_NODE_AWARE_MPI 1" >>confdefs.h fi if test "$hypre_using_memory_tracker" = "yes" then -$as_echo "#define HYPRE_USING_MEMORY_TRACKER 1" >>confdefs.h +printf "%s\n" "#define HYPRE_USING_MEMORY_TRACKER 1" >>confdefs.h + +fi + +if test "$hypre_test_using_host" = "yes" +then + +printf "%s\n" "#define HYPRE_TEST_USING_HOST 1" >>confdefs.h fi @@ -7597,14 +9238,14 @@ then if test $blas_lib = "-ldxml" then -$as_echo "#define HYPRE_USING_DXML 1" >>confdefs.h +printf "%s\n" "#define HYPRE_USING_DXML 1" >>confdefs.h fi if test $blas_lib = "-lessl" then -$as_echo "#define HYPRE_USING_ESSL 1" >>confdefs.h +printf "%s\n" "#define HYPRE_USING_ESSL 1" >>confdefs.h fi done @@ -7626,7 +9267,8 @@ then # Check whether --with-blas was given. -if test "${with_blas+set}" = set; then : +if test ${with_blas+y} +then : withval=$with_blas; fi @@ -7678,12 +9320,13 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu for lib in $BLAS_LIB_NAMES; do - as_ac_Lib=`$as_echo "ac_cv_lib_$lib''_$dgemm" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $dgemm in -l$lib" >&5 -$as_echo_n "checking for $dgemm in -l$lib... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else + as_ac_Lib=`printf "%s\n" "ac_cv_lib_$lib""_$dgemm" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $dgemm in -l$lib" >&5 +printf %s "checking for $dgemm in -l$lib... " >&6; } +if eval test \${$as_ac_Lib+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-l$lib $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -7692,9 +9335,6 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char $dgemm (); #ifdef FC_DUMMY_MAIN #ifndef FC_DUMMY_MAIN_EQ_F77 @@ -7705,26 +9345,28 @@ char $dgemm (); #endif #endif int -main () +main (void) { return $dgemm (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$as_ac_Lib=yes" -else +else $as_nop eval "$as_ac_Lib=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes" +then : BLASLIBS=$lib fi @@ -7753,13 +9395,13 @@ fi #*************************************************************** if test "$BLASLIBS" = "dxml"; then -$as_echo "#define HYPRE_USING_DXML 1" >>confdefs.h +printf "%s\n" "#define HYPRE_USING_DXML 1" >>confdefs.h fi if test "$BLASLIBS" = "essl"; then -$as_echo "#define HYPRE_USING_ESSL 1" >>confdefs.h +printf "%s\n" "#define HYPRE_USING_ESSL 1" >>confdefs.h fi @@ -7783,14 +9425,14 @@ $as_echo "#define HYPRE_USING_ESSL 1" >>confdefs.h if test "$BLASLIBS" = "null" then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ***************************************" >&5 -$as_echo "$as_me: WARNING: ***************************************" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find BLAS library" >&5 -$as_echo "$as_me: WARNING: Cannot find BLAS library" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: configuring --without-blas" >&5 -$as_echo "$as_me: WARNING: configuring --without-blas" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ***************************************" >&5 -$as_echo "$as_me: WARNING: ***************************************" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: ***************************************" >&5 +printf "%s\n" "$as_me: WARNING: ***************************************" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find BLAS library" >&5 +printf "%s\n" "$as_me: WARNING: Cannot find BLAS library" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: configuring --without-blas" >&5 +printf "%s\n" "$as_me: WARNING: configuring --without-blas" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: ***************************************" >&5 +printf "%s\n" "$as_me: WARNING: ***************************************" >&2;} elif test "$BLASLIBS" != "internal" then hypre_using_hypre_blas=no @@ -7801,7 +9443,7 @@ $as_echo "$as_me: WARNING: ***************************************" >&2;} BLASLIBDIRS="" BLASLIBS="" -$as_echo "#define HYPRE_USING_HYPRE_BLAS 1" >>confdefs.h +printf "%s\n" "#define HYPRE_USING_HYPRE_BLAS 1" >>confdefs.h fi fi @@ -7812,7 +9454,7 @@ then if test $lapack_lib = "-lessl" then -$as_echo "#define HYPRE_USING_ESSL 1" >>confdefs.h +printf "%s\n" "#define HYPRE_USING_ESSL 1" >>confdefs.h fi done @@ -7834,7 +9476,8 @@ then # Check whether --with-lapack was given. -if test "${with_lapack+set}" = set; then : +if test ${with_lapack+y} +then : withval=$with_lapack; fi @@ -7886,12 +9529,13 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu for lib in $LAPACK_LIB_NAMES; do - as_ac_Lib=`$as_echo "ac_cv_lib_$lib''_$dsygv" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $dsygv in -l$lib" >&5 -$as_echo_n "checking for $dsygv in -l$lib... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else + as_ac_Lib=`printf "%s\n" "ac_cv_lib_$lib""_$dsygv" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $dsygv in -l$lib" >&5 +printf %s "checking for $dsygv in -l$lib... " >&6; } +if eval test \${$as_ac_Lib+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-l$lib -lblas $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -7900,9 +9544,6 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char $dsygv (); #ifdef FC_DUMMY_MAIN #ifndef FC_DUMMY_MAIN_EQ_F77 @@ -7913,26 +9554,28 @@ char $dsygv (); #endif #endif int -main () +main (void) { return $dsygv (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$as_ac_Lib=yes" -else +else $as_nop eval "$as_ac_Lib=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes" +then : LAPACKLIBS=$lib fi @@ -7976,14 +9619,14 @@ fi if test "$LAPACKLIBS" = "null" then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ***************************************" >&5 -$as_echo "$as_me: WARNING: ***************************************" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find LAPACK library" >&5 -$as_echo "$as_me: WARNING: Cannot find LAPACK library" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: configuring --without-lapack" >&5 -$as_echo "$as_me: WARNING: configuring --without-lapack" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ***************************************" >&5 -$as_echo "$as_me: WARNING: ***************************************" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: ***************************************" >&5 +printf "%s\n" "$as_me: WARNING: ***************************************" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find LAPACK library" >&5 +printf "%s\n" "$as_me: WARNING: Cannot find LAPACK library" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: configuring --without-lapack" >&5 +printf "%s\n" "$as_me: WARNING: configuring --without-lapack" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: ***************************************" >&5 +printf "%s\n" "$as_me: WARNING: ***************************************" >&2;} elif test "$LAPACKLIBS" != "internal" then hypre_using_hypre_lapack=no @@ -7994,7 +9637,7 @@ $as_echo "$as_me: WARNING: ***************************************" >&2;} LAPACKLIBDIRS="" LAPACKLIBS="" -$as_echo "#define HYPRE_USING_HYPRE_LAPACK 1" >>confdefs.h +printf "%s\n" "#define HYPRE_USING_HYPRE_LAPACK 1" >>confdefs.h fi fi @@ -8012,15 +9655,16 @@ then HYPRE_FEI_SUBDIRS="femli $HYPRE_FEI_SUBDIRS" HYPRE_FEI_FEMLI_FILES="$HYPRE_SRCDIR/FEI_mv/femli/*.o" -$as_echo "#define HAVE_MLI 1" >>confdefs.h +printf "%s\n" "#define HAVE_MLI 1" >>confdefs.h fi fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __gxx_personality_v0 in -lstdc++" >&5 -$as_echo_n "checking for __gxx_personality_v0 in -lstdc++... " >&6; } -if ${ac_cv_lib_stdcpp___gxx_personality_v0+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for __gxx_personality_v0 in -lstdc++" >&5 +printf %s "checking for __gxx_personality_v0 in -lstdc++... " >&6; } +if test ${ac_cv_lib_stdcpp___gxx_personality_v0+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lstdc++ $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -8029,9 +9673,6 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char __gxx_personality_v0 (); #ifdef FC_DUMMY_MAIN #ifndef FC_DUMMY_MAIN_EQ_F77 @@ -8042,25 +9683,27 @@ char __gxx_personality_v0 (); #endif #endif int -main () +main (void) { return __gxx_personality_v0 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_stdcpp___gxx_personality_v0=yes -else +else $as_nop ac_cv_lib_stdcpp___gxx_personality_v0=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_stdcpp___gxx_personality_v0" >&5 -$as_echo "$ac_cv_lib_stdcpp___gxx_personality_v0" >&6; } -if test "x$ac_cv_lib_stdcpp___gxx_personality_v0" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_stdcpp___gxx_personality_v0" >&5 +printf "%s\n" "$ac_cv_lib_stdcpp___gxx_personality_v0" >&6; } +if test "x$ac_cv_lib_stdcpp___gxx_personality_v0" = xyes +then : LIBS="$LIBS -lstdc++" fi @@ -8089,33 +9732,33 @@ then if test "x${hypre_user_chose_cflags}" = "xno" then - case `basename "${CC}"` in + case `basename ${CC}` in gcc|mpigcc|mpicc) - CFLAGS="-g -Wall" + CFLAGS="-O0 -g -Wall" if test "$hypre_using_openmp" = "yes" ; then - CFLAGS="$CFLAGS -fopenmp" - LDFLAGS="$LDFLAGS -fopenmp" + CFLAGS+=" -fopenmp" + LDFLAGS+=" -fopenmp" fi ;; - icc|mpiicc) - CFLAGS="-g" + icc|mpiicc|icx|mpiicx) + CFLAGS="-O0 -g -Wall" if test "$hypre_using_openmp" = "yes" ; then - CFLAGS="$CFLAGS -qopenmp" - LDFLAGS="$LDFLAGS -qopenmp" + CFLAGS+=" -qopenmp" + LDFLAGS+=" -qopenmp" fi ;; pgcc|mpipgcc|mpipgicc) - CFLAGS="-g" + CFLAGS="-O0 -g -Wall" if test "$hypre_using_openmp" = "yes" ; then - CFLAGS="$CFLAGS -mp" - LDFLAGS="$LDFLAGS -mp" + CFLAGS+=" -mp" + LDFLAGS+=" -mp" fi ;; cc|xlc|mpxlc|mpixlc|mpcc) - CFLAGS="-g" + CFLAGS="-O0 -g -Wall" if test "$hypre_using_openmp" = "yes" ; then - CFLAGS="$CFLAGS -qsmp=omp" - LDFLAGS="$LDFLAGS -qsmp=omp" + CFLAGS+=" -qsmp=omp" + LDFLAGS+=" -qsmp=omp" fi ;; KCC|mpiKCC) @@ -8129,29 +9772,29 @@ fi if test "x${hypre_user_chose_cxxflags}" = "xno" then - case `basename "${CXX}"` in + case `basename ${CXX}` in g++|gCC|mpig++|mpicxx|mpic++|mpiCC) - CXXFLAGS="-g -Wall" + CXXFLAGS="-O0 -g -Wall" if test "$hypre_using_openmp" = "yes" ; then - CXXFLAGS="$CXXFLAGS -fopenmp" + CXXFLAGS+=" -fopenmp" fi ;; - icpc|icc|mpiicpc|mpiicc) - CXXFLAGS="-g" + icpc|icc|mpiicpc|mpiicc|icpx|mpiicpx) + CXXFLAGS="-O0 -g -Wall" if test "$hypre_using_openmp" = "yes" ; then - CXXFLAGS="$CXXFLAGS -qopenmp" + CXXFLAGS+=" -qopenmp" fi ;; pgCC|mpipgCC|pgc++|mpipgic++) - CXXFLAGS="-g" + CXXFLAGS="-O0 -g -Wall" if test "$hypre_using_openmp" = "yes" ; then - CXXFLAGS="$CXXFLAGS -mp" + CXXFLAGS+=" -mp" fi ;; CC|cxx|xlC|mpxlC|mpixlcxx|mpCC) - CXXFLAGS="-g" + CXXFLAGS="-O0 -g" if test "$hypre_using_openmp" = "yes" ; then - CXXFLAGS="$CXXFLAGS -qsmp=omp" + CXXFLAGS+=" -qsmp=omp" fi ;; KCC|mpiKCC) @@ -8163,16 +9806,16 @@ then esac fi -if test "x${hypre_user_chose_fflags}" = "xno" +if test "$hypre_using_fortran" = "yes" -a "x${hypre_user_chose_fflags}" = "xno" then - case `basename "${FC}"` in + case `basename ${FC}` in g77|gfortran|mpigfortran|mpif77) FFLAGS="-g -Wall" if test "$hypre_using_openmp" = "yes" ; then FFLAGS="$FFLAGS -fopenmp" fi ;; - ifort|mpiifort) + ifort|mpiifort|ifx|mpiifx) FFLAGS="-g" if test "$hypre_using_openmp" = "yes" ; then FFLAGS="$FFLAGS -qopenmp" @@ -8199,39 +9842,39 @@ then esac fi -$as_echo "#define HYPRE_DEBUG 1" >>confdefs.h +printf "%s\n" "#define HYPRE_DEBUG 1" >>confdefs.h else if test "x${hypre_user_chose_cflags}" = "xno" then - case `basename "${CC}"` in + case `basename ${CC}` in gcc|mpigcc|mpicc) CFLAGS="-O2" if test "$hypre_using_openmp" = "yes" ; then - CFLAGS="$CFLAGS -fopenmp" - LDFLAGS="$LDFLAGS -fopenmp" + CFLAGS+=" -fopenmp" + LDFLAGS+=" -fopenmp" fi ;; - icc|mpiicc) + icc|mpiicc|icx|mpiicx) CFLAGS="-O2" if test "$hypre_using_openmp" = "yes" ; then - CFLAGS="$CFLAGS -qopenmp" - LDFLAGS="$LDFLAGS -qopenmp" + CFLAGS+=" -qopenmp" + LDFLAGS+=" -qopenmp" fi ;; pgcc|mpipgcc|mpipgicc) CFLAGS="-fast" if test "$hypre_using_openmp" = "yes" ; then - CFLAGS="$CFLAGS -mp" - LDFLAGS="$LDFLAGS -mp" + CFLAGS+=" -mp" + LDFLAGS+=" -mp" fi ;; cc|xlc|xlc_r|mpxlc|mpixlc|mpixlc_r|mpixlc-gpu|mpcc) CFLAGS="-O2" if test "$hypre_using_openmp" = "yes" ; then - CFLAGS="$CFLAGS -qsmp=omp" - LDFLAGS="$LDFLAGS -qsmp=omp" + CFLAGS+=" -qsmp=omp" + LDFLAGS+=" -qsmp=omp" fi ;; KCC|mpiKCC) @@ -8245,29 +9888,29 @@ fi if test "x${hypre_user_chose_cxxflags}" = "xno" then - case `basename "${CXX}"` in + case `basename ${CXX}` in g++|gCC|mpig++|mpicxx|mpic++|mpiCC) CXXFLAGS="-O2" if test "$hypre_using_openmp" = "yes" ; then - CXXFLAGS="$CXXFLAGS -fopenmp" + CXXFLAGS+=" -fopenmp" fi ;; - icpc|icc|mpiicpc|mpiicc) + icpc|icc|mpiicpc|mpiicc|icpx|mpiicpx) CXXFLAGS="-O2" if test "$hypre_using_openmp" = "yes" ; then - CXXFLAGS="$CXXFLAGS -qopenmp" + CXXFLAGS+=" -qopenmp" fi ;; pgCC|mpipgCC|pgc++|mpipgic++) CXXFLAGS="-fast" if test "$hypre_using_openmp" = "yes" ; then - CXXFLAGS="$CXXFLAGS -mp" + CXXFLAGS+=" -mp" fi ;; CC|cxx|xlC|xlC_r|mpxlC|mpixlC|mpixlC-gpu|mpixlcxx|mpixlcxx_r|mpCC) CXXFLAGS="-O2" if test "$hypre_using_openmp" = "yes" ; then - CXXFLAGS="$CXXFLAGS -qsmp=omp" + CXXFLAGS+=" -qsmp=omp" fi ;; KCC|mpiKCC) @@ -8279,31 +9922,31 @@ then esac fi -if test "x${hypre_user_chose_fflags}" = "xno" +if test "$hypre_using_fortran" = "yes" -a "x${hypre_user_chose_fflags}" = "xno" then - case `basename "${FC}"` in + case `basename ${FC}` in g77|gfortran|mpigfortran|mpif77) FFLAGS="-O2" if test "$hypre_using_openmp" = "yes" ; then - FFLAGS="$FFLAGS -fopenmp" + FFLAGS+=" -fopenmp" fi ;; ifort|mpiifort) FFLAGS="-O2" if test "$hypre_using_openmp" = "yes" ; then - FFLAGS="$FFLAGS -qopenmp" + FFLAGS+=" -qopenmp" fi ;; pgf77|mpipgf77|pgfortran|mpipgifort) FFLAGS="-fast" if test "$hypre_using_openmp" = "yes" ; then - FFLAGS="$FFLAGS -mp" + FFLAGS+=" -mp" fi ;; f77|f90|xlf|xlf_r|mpxlf|mpixlf77|mpixlf77_r) FFLAGS="-O2" if test "$hypre_using_openmp" = "yes" ; then - FFLAGS="$FFLAGS -qsmp=omp" + FFLAGS+=" -qsmp=omp" fi ;; kf77|mpikf77) @@ -8347,26 +9990,12 @@ then BUILD_JAVA=1 fi -if test "$hypre_using_insure" = "yes" -then - LINK_FC="insure" - LINK_CC="insure" - LINK_CXX="insure" - LDFLAGS=`mpicc -link-info | awk '{$1=""; print}'` - LDFLAGS="$LDFLAGS ${hypre_insure_flags}" - FC="insure" - CC="insure" - CXX="insure" - FFLAGS="`mpicc -link-info | awk '{$1=""; print}'` $FFLAGS" - CFLAGS="`mpicc -link-info | awk '{$1=""; print}'` $CFLAGS" - CXXFLAGS="`mpicc -link-info | awk '{$1=""; print}'` $CXXFLAGS" -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cabs in -lm" >&5 -$as_echo_n "checking for cabs in -lm... " >&6; } -if ${ac_cv_lib_m_cabs+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for cabs in -lm" >&5 +printf %s "checking for cabs in -lm... " >&6; } +if test ${ac_cv_lib_m_cabs+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -8375,9 +10004,6 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char cabs (); #ifdef FC_DUMMY_MAIN #ifndef FC_DUMMY_MAIN_EQ_F77 @@ -8388,25 +10014,27 @@ char cabs (); #endif #endif int -main () +main (void) { return cabs (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_m_cabs=yes -else +else $as_nop ac_cv_lib_m_cabs=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cabs" >&5 -$as_echo "$ac_cv_lib_m_cabs" >&6; } -if test "x$ac_cv_lib_m_cabs" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cabs" >&5 +printf "%s\n" "$ac_cv_lib_m_cabs" >&6; } +if test "x$ac_cv_lib_m_cabs" = xyes +then : LIBS="$LIBS -lm" fi @@ -8489,7 +10117,7 @@ then BUILD_CC_SHARED="\${CC} ${SHARED_BUILD_FLAG}" fi BUILD_CXX_SHARED="\${CXX} ${SHARED_BUILD_FLAG}" - if test "$hypre_using_cuda" == "yes" || test "$hypre_using_hip" == "yes" + if test "$hypre_using_cuda" == "yes" || test "$hypre_using_hip" == "yes" || test "$hypre_using_kokkos" == "yes" then BUILD_CC_SHARED="\${CXX} ${SHARED_BUILD_FLAG}" fi @@ -8500,258 +10128,493 @@ if test "$hypre_using_caliper" = "yes" then if test "$hypre_user_gave_caliper_inc" != "yes" then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *******************************************************" >&5 -$as_echo "$as_me: WARNING: *******************************************************" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Configuring with --with-caliper=yes without providing" >&5 -$as_echo "$as_me: WARNING: Configuring with --with-caliper=yes without providing" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-caliper-include=." >&5 -$as_echo "$as_me: WARNING: --with-caliper-include=." >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Using default user include path." >&5 -$as_echo "$as_me: WARNING: Using default user include path." >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: NOTE: Caliper annotations may not work." >&5 -$as_echo "$as_me: WARNING: NOTE: Caliper annotations may not work." >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *******************************************************" >&5 -$as_echo "$as_me: WARNING: *******************************************************" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: *******************************************************" >&5 +printf "%s\n" "$as_me: WARNING: *******************************************************" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Configuring with --with-caliper=yes without providing" >&5 +printf "%s\n" "$as_me: WARNING: Configuring with --with-caliper=yes without providing" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: --with-caliper-include=." >&5 +printf "%s\n" "$as_me: WARNING: --with-caliper-include=." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Using default user include path." >&5 +printf "%s\n" "$as_me: WARNING: Using default user include path." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: NOTE: Caliper annotations may not work." >&5 +printf "%s\n" "$as_me: WARNING: NOTE: Caliper annotations may not work." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: *******************************************************" >&5 +printf "%s\n" "$as_me: WARNING: *******************************************************" >&2;} fi if test "$hypre_user_gave_caliper_lib" != "yes" then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *******************************************************" >&5 -$as_echo "$as_me: WARNING: *******************************************************" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Configuring with --with-caliper=yes without providing" >&5 -$as_echo "$as_me: WARNING: Configuring with --with-caliper=yes without providing" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-caliper-lib=." >&5 -$as_echo "$as_me: WARNING: --with-caliper-lib=." >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Using default user library path." >&5 -$as_echo "$as_me: WARNING: Using default user library path." >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: NOTE: Caliper annotations may not work." >&5 -$as_echo "$as_me: WARNING: NOTE: Caliper annotations may not work." >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *******************************************************" >&5 -$as_echo "$as_me: WARNING: *******************************************************" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: *******************************************************" >&5 +printf "%s\n" "$as_me: WARNING: *******************************************************" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Configuring with --with-caliper=yes without providing" >&5 +printf "%s\n" "$as_me: WARNING: Configuring with --with-caliper=yes without providing" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: --with-caliper-lib=." >&5 +printf "%s\n" "$as_me: WARNING: --with-caliper-lib=." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Using default user library path." >&5 +printf "%s\n" "$as_me: WARNING: Using default user library path." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: NOTE: Caliper annotations may not work." >&5 +printf "%s\n" "$as_me: WARNING: NOTE: Caliper annotations may not work." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: *******************************************************" >&5 +printf "%s\n" "$as_me: WARNING: *******************************************************" >&2;} + fi +fi + +if test "x$hypre_using_magma" = "xyes" +then + if test "x$hypre_user_gave_magma_inc" != "xyes" + then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: *******************************************************" >&5 +printf "%s\n" "$as_me: WARNING: *******************************************************" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Configuring with --with-magma=yes without providing" >&5 +printf "%s\n" "$as_me: WARNING: Configuring with --with-magma=yes without providing" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: --with-magma-include=." >&5 +printf "%s\n" "$as_me: WARNING: --with-magma-include=." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Using default user include path." >&5 +printf "%s\n" "$as_me: WARNING: Using default user include path." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: NOTE: MAGMA may not work." >&5 +printf "%s\n" "$as_me: WARNING: NOTE: MAGMA may not work." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: *******************************************************" >&5 +printf "%s\n" "$as_me: WARNING: *******************************************************" >&2;} + fi + if test "x$hypre_user_gave_magma_lib" != "xyes" + then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: *******************************************************" >&5 +printf "%s\n" "$as_me: WARNING: *******************************************************" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Configuring with --with-magma=yes without providing" >&5 +printf "%s\n" "$as_me: WARNING: Configuring with --with-magma=yes without providing" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: --with-magma-lib=." >&5 +printf "%s\n" "$as_me: WARNING: --with-magma-lib=." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Using default user library path." >&5 +printf "%s\n" "$as_me: WARNING: Using default user library path." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: NOTE: MAGMA may not work." >&5 +printf "%s\n" "$as_me: WARNING: NOTE: MAGMA may not work." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: *******************************************************" >&5 +printf "%s\n" "$as_me: WARNING: *******************************************************" >&2;} fi fi + if test "x$hypre_using_um" = "xyes" then - if test "x$hypre_using_cuda" != "xyes" && test "x$hypre_using_device_openmp" != "xyes" && test "x$hypre_using_hip" != "xyes" + if test "x$hypre_using_cuda" != "xyes" && test "x$hypre_using_device_openmp" != "xyes" && test "x$hypre_using_hip" != "xyes" && test "x$hypre_using_sycl" != "xyes" then - as_fn_error $? "Asked for unified memory, but not using CUDA, HIP, or device OpenMP!" "$LINENO" 5 + as_fn_error $? "Asked for unified memory, but not using CUDA, HIP, SYCL, or device OpenMP!" "$LINENO" 5 fi fi -if test "$hypre_using_cuda" = "yes" || test "$hypre_using_device_openmp" = "yes" + + +if test "$hypre_using_cuda" = "yes" then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include + ac_header= ac_cache= +for ac_item in $ac_header_c_list +do + if test $ac_cache; then + ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" + if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then + printf "%s\n" "#define $ac_item 1" >> confdefs.h + fi + ac_header= ac_cache= + elif test $ac_header; then + ac_cache=$ac_item + else + ac_header=$ac_item + fi +done -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : -else - ac_cv_header_stdc=no + + + +if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes +then : + +printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h + fi -rm -f conftest* +as_ac_Header=`printf "%s\n" "ac_cv_header_"${CUDA_HOME}/include/cuda.h"" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" ""${CUDA_HOME}/include/cuda.h"" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes" +then : + hypre_found_cuda=yes; HYPRE_CUDA_PATH=${CUDA_HOME} +fi + + if test "x$hypre_found_cuda" != "xyes" + then + as_ac_Header=`printf "%s\n" "ac_cv_header_"${CUDA_PATH}/include/cuda.h"" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" ""${CUDA_PATH}/include/cuda.h"" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes" +then : + hypre_found_cuda=yes; HYPRE_CUDA_PATH=${CUDA_PATH} fi -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include + fi -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : + if test "x$hypre_found_cuda" != "xyes" + then + as_fn_error $? "unable to find cuda.h ... Ensure that CUDA_HOME or CUDA_PATH is set" "$LINENO" 5 + fi +fi + +if test "$hypre_using_cusparse" = "yes" +then + as_ac_File=`printf "%s\n" "ac_cv_file_${HYPRE_CUDA_PATH}/include/cusparse.h" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${HYPRE_CUDA_PATH}/include/cusparse.h" >&5 +printf %s "checking for ${HYPRE_CUDA_PATH}/include/cusparse.h... " >&6; } +if eval test \${$as_ac_File+y} +then : + printf %s "(cached) " >&6 +else $as_nop + test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "${HYPRE_CUDA_PATH}/include/cusparse.h"; then + eval "$as_ac_File=yes" else - ac_cv_header_stdc=no + eval "$as_ac_File=no" +fi +fi +eval ac_res=\$$as_ac_File + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_File"\" = x"yes" +then : + hypre_found_cusparse=yes; HYPRE_VENDOR_MATH_PATH=${HYPRE_CUDA_PATH} fi -rm -f conftest* + + if test "x$hypre_found_cusparse" != "xyes" + then + as_ac_File=`printf "%s\n" "ac_cv_file_${HYPRE_CUDA_PATH}/../math_libs/include/cusparse.h" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${HYPRE_CUDA_PATH}/../math_libs/include/cusparse.h" >&5 +printf %s "checking for ${HYPRE_CUDA_PATH}/../math_libs/include/cusparse.h... " >&6; } +if eval test \${$as_ac_File+y} +then : + printf %s "(cached) " >&6 +else $as_nop + test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "${HYPRE_CUDA_PATH}/../math_libs/include/cusparse.h"; then + eval "$as_ac_File=yes" +else + eval "$as_ac_File=no" +fi +fi +eval ac_res=\$$as_ac_File + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_File"\" = x"yes" +then : + hypre_found_cusparse=yes; HYPRE_VENDOR_MATH_PATH=$(readlink -f ${HYPRE_CUDA_PATH}/../math_libs); { printf "%s\n" "$as_me:${as_lineno-$LINENO}: setting vendor math path to ${HYPRE_VENDOR_MATH_PATH}" >&5 +printf "%s\n" "$as_me: setting vendor math path to ${HYPRE_VENDOR_MATH_PATH}" >&6;} fi -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : + fi + + if test "x$hypre_found_cusparse" != "xyes" + then + as_ac_File=`printf "%s\n" "ac_cv_file_${HYPRE_CUDA_PATH}/../../math_libs/include/cusparse.h" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${HYPRE_CUDA_PATH}/../../math_libs/include/cusparse.h" >&5 +printf %s "checking for ${HYPRE_CUDA_PATH}/../../math_libs/include/cusparse.h... " >&6; } +if eval test \${$as_ac_File+y} +then : + printf %s "(cached) " >&6 +else $as_nop + test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "${HYPRE_CUDA_PATH}/../../math_libs/include/cusparse.h"; then + eval "$as_ac_File=yes" +else + eval "$as_ac_File=no" +fi +fi +eval ac_res=\$$as_ac_File + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_File"\" = x"yes" +then : + hypre_found_cusparse=yes; HYPRE_VENDOR_MATH_PATH=$(readlink -f ${HYPRE_CUDA_PATH}/../../math_libs); { printf "%s\n" "$as_me:${as_lineno-$LINENO}: setting vendor math path to ${HYPRE_VENDOR_MATH_PATH}" >&5 +printf "%s\n" "$as_me: setting vendor math path to ${HYPRE_VENDOR_MATH_PATH}" >&6;} +fi + + fi + + if test "x$hypre_found_cusparse" != "xyes" + then + as_fn_error $? "unable to find cusparse.h ..." "$LINENO" 5 + fi +fi + + +if test "$hypre_using_cublas" = "yes" +then + as_ac_File=`printf "%s\n" "ac_cv_file_${HYPRE_CUDA_PATH}/include/cublas.h" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${HYPRE_CUDA_PATH}/include/cublas.h" >&5 +printf %s "checking for ${HYPRE_CUDA_PATH}/include/cublas.h... " >&6; } +if eval test \${$as_ac_File+y} +then : + printf %s "(cached) " >&6 +else $as_nop + test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "${HYPRE_CUDA_PATH}/include/cublas.h"; then + eval "$as_ac_File=yes" else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif + eval "$as_ac_File=no" +fi +fi +eval ac_res=\$$as_ac_File + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_File"\" = x"yes" +then : + hypre_found_cublas=yes; HYPRE_VENDOR_MATH_PATH=${HYPRE_CUDA_PATH} +fi -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : + if test "x$hypre_found_cublas" != "xyes" && test "x${HYPRE_VENDOR_MATH_PATH}" != "x" + then + as_ac_File=`printf "%s\n" "ac_cv_file_${HYPRE_VENDOR_MATH_PATH}/include/cublas.h" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${HYPRE_VENDOR_MATH_PATH}/include/cublas.h" >&5 +printf %s "checking for ${HYPRE_VENDOR_MATH_PATH}/include/cublas.h... " >&6; } +if eval test \${$as_ac_File+y} +then : + printf %s "(cached) " >&6 +else $as_nop + test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "${HYPRE_VENDOR_MATH_PATH}/include/cublas.h"; then + eval "$as_ac_File=yes" else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + eval "$as_ac_File=no" fi - fi +eval ac_res=\$$as_ac_File + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_File"\" = x"yes" +then : + hypre_found_cublas=yes; fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then -$as_echo "#define STDC_HEADERS 1" >>confdefs.h + fi + if test "x$hypre_found_cublas" != "xyes" + then + as_ac_File=`printf "%s\n" "ac_cv_file_${HYPRE_CUDA_PATH}/../math_libs/include/cublas.h" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${HYPRE_CUDA_PATH}/../math_libs/include/cublas.h" >&5 +printf %s "checking for ${HYPRE_CUDA_PATH}/../math_libs/include/cublas.h... " >&6; } +if eval test \${$as_ac_File+y} +then : + printf %s "(cached) " >&6 +else $as_nop + test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "${HYPRE_CUDA_PATH}/../math_libs/include/cublas.h"; then + eval "$as_ac_File=yes" +else + eval "$as_ac_File=no" +fi +fi +eval ac_res=\$$as_ac_File + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_File"\" = x"yes" +then : + hypre_found_cublas=yes; HYPRE_VENDOR_MATH_PATH=$(readlink -f ${HYPRE_CUDA_PATH}/../math_libs); { printf "%s\n" "$as_me:${as_lineno-$LINENO}: setting vendor math path to ${HYPRE_VENDOR_MATH_PATH}" >&5 +printf "%s\n" "$as_me: setting vendor math path to ${HYPRE_VENDOR_MATH_PATH}" >&6;} fi -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + fi + if test "x$hypre_found_cublas" != "xyes" + then + as_ac_File=`printf "%s\n" "ac_cv_file_${HYPRE_CUDA_PATH}/../../math_libs/include/cublas.h" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${HYPRE_CUDA_PATH}/../../math_libs/include/cublas.h" >&5 +printf %s "checking for ${HYPRE_CUDA_PATH}/../../math_libs/include/cublas.h... " >&6; } +if eval test \${$as_ac_File+y} +then : + printf %s "(cached) " >&6 +else $as_nop + test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "${HYPRE_CUDA_PATH}/../../math_libs/include/cublas.h"; then + eval "$as_ac_File=yes" +else + eval "$as_ac_File=no" +fi +fi +eval ac_res=\$$as_ac_File + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_File"\" = x"yes" +then : + hypre_found_cublas=yes; HYPRE_VENDOR_MATH_PATH=$(readlink -f ${HYPRE_CUDA_PATH}/../../math_libs); { printf "%s\n" "$as_me:${as_lineno-$LINENO}: setting vendor math path to ${HYPRE_VENDOR_MATH_PATH}" >&5 +printf "%s\n" "$as_me: setting vendor math path to ${HYPRE_VENDOR_MATH_PATH}" >&6;} fi -done + fi + + if test "x$hypre_found_cublas" != "xyes" + then + as_fn_error $? "unable to find cublas.h ..." "$LINENO" 5 + fi +fi -for ac_header in "${CUDA_HOME}/include/cuda.h" -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - hypre_found_cuda=yes; HYPRE_CUDA_PATH=${CUDA_HOME} +if test "$hypre_using_cusolver" = "yes" +then + as_ac_File=`printf "%s\n" "ac_cv_file_${HYPRE_CUDA_PATH}/include/cusolverDn.h" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${HYPRE_CUDA_PATH}/include/cusolverDn.h" >&5 +printf %s "checking for ${HYPRE_CUDA_PATH}/include/cusolverDn.h... " >&6; } +if eval test \${$as_ac_File+y} +then : + printf %s "(cached) " >&6 +else $as_nop + test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "${HYPRE_CUDA_PATH}/include/cusolverDn.h"; then + eval "$as_ac_File=yes" +else + eval "$as_ac_File=no" +fi +fi +eval ac_res=\$$as_ac_File + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_File"\" = x"yes" +then : + hypre_found_cusolver=yes; HYPRE_VENDOR_MATH_PATH=${HYPRE_CUDA_PATH} fi -done + if test "x$hypre_found_cusolver" != "xyes" && test "x${HYPRE_VENDOR_MATH_PATH}" != "x" + then + as_ac_File=`printf "%s\n" "ac_cv_file_${HYPRE_VENDOR_MATH_PATH}/include/cusolverDn.h" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${HYPRE_VENDOR_MATH_PATH}/include/cusolverDn.h" >&5 +printf %s "checking for ${HYPRE_VENDOR_MATH_PATH}/include/cusolverDn.h... " >&6; } +if eval test \${$as_ac_File+y} +then : + printf %s "(cached) " >&6 +else $as_nop + test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "${HYPRE_VENDOR_MATH_PATH}/include/cusolverDn.h"; then + eval "$as_ac_File=yes" +else + eval "$as_ac_File=no" +fi +fi +eval ac_res=\$$as_ac_File + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_File"\" = x"yes" +then : + hypre_found_cusolver=yes; +fi + + fi - if test "x$hypre_found_cuda" != "xyes" + if test "x$hypre_found_cusolver" != "xyes" then - for ac_header in "${CUDA_PATH}/include/cuda.h" -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - hypre_found_cuda=yes; HYPRE_CUDA_PATH=${CUDA_PATH} + as_ac_File=`printf "%s\n" "ac_cv_file_${HYPRE_CUDA_PATH}/../math_libs/include/cusolverDn.h" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${HYPRE_CUDA_PATH}/../math_libs/include/cusolverDn.h" >&5 +printf %s "checking for ${HYPRE_CUDA_PATH}/../math_libs/include/cusolverDn.h... " >&6; } +if eval test \${$as_ac_File+y} +then : + printf %s "(cached) " >&6 +else $as_nop + test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "${HYPRE_CUDA_PATH}/../math_libs/include/cusolverDn.h"; then + eval "$as_ac_File=yes" +else + eval "$as_ac_File=no" +fi +fi +eval ac_res=\$$as_ac_File + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_File"\" = x"yes" +then : + hypre_found_cusolver=yes; HYPRE_VENDOR_MATH_PATH=$(readlink -f ${HYPRE_CUDA_PATH}/../math_libs); { printf "%s\n" "$as_me:${as_lineno-$LINENO}: setting vendor math path to ${HYPRE_VENDOR_MATH_PATH}" >&5 +printf "%s\n" "$as_me: setting vendor math path to ${HYPRE_VENDOR_MATH_PATH}" >&6;} fi -done + fi + + if test "x$hypre_found_cusolver" != "xyes" + then + as_ac_File=`printf "%s\n" "ac_cv_file_${HYPRE_CUDA_PATH}/../../math_libs/include/cusolverDn.h" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${HYPRE_CUDA_PATH}/../../math_libs/include/cusolverDn.h" >&5 +printf %s "checking for ${HYPRE_CUDA_PATH}/../../math_libs/include/cusolverDn.h... " >&6; } +if eval test \${$as_ac_File+y} +then : + printf %s "(cached) " >&6 +else $as_nop + test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "${HYPRE_CUDA_PATH}/../../math_libs/include/cusolverDn.h"; then + eval "$as_ac_File=yes" +else + eval "$as_ac_File=no" +fi +fi +eval ac_res=\$$as_ac_File + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_File"\" = x"yes" +then : + hypre_found_cusolver=yes; HYPRE_VENDOR_MATH_PATH=$(readlink -f ${HYPRE_CUDA_PATH}/../../math_libs); { printf "%s\n" "$as_me:${as_lineno-$LINENO}: setting vendor math path to ${HYPRE_VENDOR_MATH_PATH}" >&5 +printf "%s\n" "$as_me: setting vendor math path to ${HYPRE_VENDOR_MATH_PATH}" >&6;} +fi fi - if test "x$hypre_found_cuda" != "xyes" + if test "x$hypre_found_cusolver" != "xyes" then - as_fn_error $? "unable to find cuda.h ... Ensure that CUDA_HOME or CUDA_PATH is set" "$LINENO" 5 + as_fn_error $? "unable to find cusolverDn.h ..." "$LINENO" 5 fi fi -if test x"$hypre_using_hip" == x"yes" ; then : - if test -n "$ROCM_PATH"; then : +if test x"$hypre_using_hip" == x"yes" +then : + if test -n "$ROCM_PATH" +then : HYPRE_ROCM_PREFIX=$ROCM_PATH -else +else $as_nop HYPRE_ROCM_PREFIX=/opt/rocm fi - for ac_header in "${HYPRE_ROCM_PREFIX}/include/hip/hip_common.h" -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - hypre_found_hip=yes -else + as_ac_Header=`printf "%s\n" "ac_cv_header_"${HYPRE_ROCM_PREFIX}/include/hip/hip_common.h"" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" ""${HYPRE_ROCM_PREFIX}/include/hip/hip_common.h"" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes" +then : + hypre_found_hip=yes +else $as_nop as_fn_error $? "unable to find ${HYPRE_ROCM_PREFIX}/include/hip/hip_common.h ... Ensure ROCm is installed and set ROCM_PATH environment variable to ROCm installation path." "$LINENO" 5 fi -done - fi - - if test "x$hypre_using_raja" = "xyes" then -$as_echo "#define HYPRE_USING_RAJA 1" >>confdefs.h +printf "%s\n" "#define HYPRE_USING_RAJA 1" >>confdefs.h - if test "$hypre_using_cuda" != "yes" + if test "$hypre_user_chose_cxxflags" = "no" then - if test "$CXX" = "mpixlC" || test "$CXX" = "xlC_r" + if test "$hypre_using_cuda" != "yes" then - CXXFLAGS="${CXXFLAGS} -+ -std=c++11" + if test "$CXX" = "mpixlC" || test "$CXX" = "xlC_r" + then + CXXFLAGS="${CXXFLAGS} -+ -std=c++${hypre_cxxstd}" + fi fi fi @@ -8763,27 +10626,32 @@ fi if test "x$hypre_using_kokkos" = "xyes" then -$as_echo "#define HYPRE_USING_KOKKOS 1" >>confdefs.h +printf "%s\n" "#define HYPRE_USING_KOKKOS 1" >>confdefs.h - if test "$hypre_using_cuda" != "yes" + if test "$hypre_user_chose_cxxflags" = "no" then - if test "$CXX" = "mpixlC" || test "$CXX" = "xlC_r" + CXXFLAGS="${CXXFLAGS} -std=c++${hypre_cxxstd}" + + if test "$CXX" = "mpiclang++" || test "$CXX" = "mpiclang++-gpu" || test "$CXX" = "clang++" || test "$CXX" = "clang++-gpu" || test "$CXX" = "icpx" || test "$CXX" = "mpiicpx" + then + CXXFLAGS="${CXXFLAGS} -x c++" + fi + + if test "$CXX" = "mpixlC" || test "$CXX" = "mpixlC-gpu" || test "$CXX" = "xlC" || test "$CXX" = "xlC-gpu" then - CXXFLAGS="${CXXFLAGS} -+ -std=c++11" + CXXFLAGS="${CXXFLAGS} -+" fi fi - CC=${CXX} - LINK_CC=${LINK_CXX} - CFLAGS=${CXXFLAGS} -fi + LINK_CC=${LINK_CXX} + fi if test "x$hypre_using_umpire_host" = "xyes" then hypre_using_umpire=yes -$as_echo "#define HYPRE_USING_UMPIRE_HOST 1" >>confdefs.h +printf "%s\n" "#define HYPRE_USING_UMPIRE_HOST 1" >>confdefs.h fi @@ -8791,7 +10659,7 @@ if test "x$hypre_using_umpire_device" = "xyes" then hypre_using_umpire=yes -$as_echo "#define HYPRE_USING_UMPIRE_DEVICE 1" >>confdefs.h +printf "%s\n" "#define HYPRE_USING_UMPIRE_DEVICE 1" >>confdefs.h fi @@ -8799,7 +10667,7 @@ if test "x$hypre_using_umpire_um" = "xyes" then hypre_using_umpire=yes -$as_echo "#define HYPRE_USING_UMPIRE_UM 1" >>confdefs.h +printf "%s\n" "#define HYPRE_USING_UMPIRE_UM 1" >>confdefs.h fi @@ -8807,65 +10675,27 @@ if test "x$hypre_using_umpire_pinned" = "xyes" then hypre_using_umpire=yes -$as_echo "#define HYPRE_USING_UMPIRE_PINNED 1" >>confdefs.h +printf "%s\n" "#define HYPRE_USING_UMPIRE_PINNED 1" >>confdefs.h fi if test "x$hypre_using_umpire" = "xyes" then -$as_echo "#define HYPRE_USING_UMPIRE 1" >>confdefs.h +printf "%s\n" "#define HYPRE_USING_UMPIRE 1" >>confdefs.h fi if test "$hypre_using_cuda" = "yes" then -$as_echo "#define HYPRE_USING_GPU 1" >>confdefs.h - - - -$as_echo "#define HYPRE_USING_CUDA 1" >>confdefs.h - - - -$as_echo "#define HYPRE_USING_CUSPARSE 1" >>confdefs.h - - - if test "$hypre_using_gpu_profiling" = "yes" - then - -$as_echo "#define HYPRE_USING_NVTX 1" >>confdefs.h - - fi - - if test "$hypre_using_cusparse" = "yes" - then - -$as_echo "#define HYPRE_USING_CUSPARSE 1" >>confdefs.h - - fi - - if test "$hypre_using_device_pool" = "yes" - then - -$as_echo "#define HYPRE_USING_DEVICE_POOL 1" >>confdefs.h - - fi - - if test "$hypre_using_cublas" = "yes" - then +printf "%s\n" "#define HYPRE_USING_GPU 1" >>confdefs.h -$as_echo "#define HYPRE_USING_CUBLAS 1" >>confdefs.h - fi - if test "$hypre_using_curand" = "yes" - then +printf "%s\n" "#define HYPRE_USING_CUDA 1" >>confdefs.h -$as_echo "#define HYPRE_USING_CURAND 1" >>confdefs.h - fi LINK_CC=${LINK_CXX} @@ -8881,7 +10711,7 @@ $as_echo "#define HYPRE_USING_CURAND 1" >>confdefs.h if test "$hypre_user_chose_cuflags" = "no" then - CUFLAGS="-lineinfo -expt-extended-lambda -std=c++11 --x cu" + CUFLAGS="-lineinfo -expt-extended-lambda -std=c++${hypre_cxxstd} --x cu" if test "$hypre_using_debug" = "yes" then CUFLAGS="-g -O0 ${CUFLAGS}" @@ -8896,34 +10726,93 @@ $as_echo "#define HYPRE_USING_CURAND 1" >>confdefs.h HYPRE_CUDA_INCLUDE='-I${HYPRE_CUDA_PATH}/include' HYPRE_CUDA_LIBS='-L${HYPRE_CUDA_PATH}/lib64 -lcudart' + + if test x"$hypre_using_cusparse" == x"yes" || test x"$hypre_using_cublas" == x"yes" || test x"$hypre_using_cusolver" == x"yes" +then : + if test "x$HYPRE_CUDA_PATH" != "x$HYPRE_VENDOR_MATH_PATH" +then : + HYPRE_CUDA_INCLUDE+=" -I${HYPRE_VENDOR_MATH_PATH}/include" + HYPRE_CUDA_LIBS+=" -L${HYPRE_VENDOR_MATH_PATH}/lib64" +fi +fi + if test "$hypre_using_gpu_profiling" = "yes" then + +printf "%s\n" "#define HYPRE_USING_NVTX 1" >>confdefs.h + HYPRE_CUDA_LIBS+=" -lnvToolsExt" fi if test "$hypre_using_cusparse" = "yes" then + +printf "%s\n" "#define HYPRE_USING_CUSPARSE 1" >>confdefs.h + HYPRE_CUDA_LIBS+=" -lcusparse" fi if test "$hypre_using_cublas" = "yes" then + +printf "%s\n" "#define HYPRE_USING_CUBLAS 1" >>confdefs.h + HYPRE_CUDA_LIBS+=" -lcublas" fi if test "$hypre_using_curand" = "yes" then + +printf "%s\n" "#define HYPRE_USING_CURAND 1" >>confdefs.h + HYPRE_CUDA_LIBS+=" -lcurand" fi + + if test "$hypre_using_cusolver" = "yes" + then + +printf "%s\n" "#define HYPRE_USING_CUSOLVER 1" >>confdefs.h + + HYPRE_CUDA_LIBS+=" -lcusolver" + fi + + if test "$hypre_using_device_pool" = "yes" + then + +printf "%s\n" "#define HYPRE_USING_DEVICE_POOL 1" >>confdefs.h + + fi + + if test "$hypre_using_device_malloc_async" = "yes" + then + +printf "%s\n" "#define HYPRE_USING_DEVICE_MALLOC_ASYNC 1" >>confdefs.h + + fi + + if test "$hypre_using_thrust_nosync" = "yes" + then + +printf "%s\n" "#define HYPRE_USING_THRUST_NOSYNC 1" >>confdefs.h + + fi + + if test "x$hypre_using_cuda_streams" = "xyes" + then + +printf "%s\n" "#define HYPRE_USING_CUDA_STREAMS 1" >>confdefs.h + + fi fi -if test x"$hypre_using_hip" == x"yes"; then : +if test x"$hypre_using_hip" == x"yes" +then : -$as_echo "#define HYPRE_USING_GPU 1" >>confdefs.h +printf "%s\n" "#define HYPRE_USING_GPU 1" >>confdefs.h -$as_echo "#define HYPRE_USING_HIP 1" >>confdefs.h +printf "%s\n" "#define HYPRE_USING_HIP 1" >>confdefs.h @@ -8932,7 +10821,7 @@ $as_echo "#define HYPRE_USING_HIP 1" >>confdefs.h if test "x${HYPRE_CUDA_SM}" != "x" then - HYPRE_CUDA_GENCODE="--amdgpu-target=" + HYPRE_CUDA_GENCODE="--offload-arch=" for sm in ${HYPRE_CUDA_SM}; do HYPRE_CUDA_GENCODE="${HYPRE_CUDA_GENCODE}${sm}," done @@ -8941,9 +10830,11 @@ $as_echo "#define HYPRE_USING_HIP 1" >>confdefs.h HIPCXXFLAGS="-x hip -std=c++14 ${HIPCXXFLAGS}" - if test x"$hypre_using_debug" == x"yes"; then : - HIPCXXFLAGS="-O0 -Wall -g -ggdb ${HIPCXXFLAGS}" -elif HIPCXXFLAGS="-O2 ${HIPCXXFLAGS}"; then : + if test x"$hypre_using_debug" == x"yes" +then : + HIPCXXFLAGS="-O1 -Wall -g -ggdb ${HIPCXXFLAGS}" +elif HIPCXXFLAGS="-O2 ${HIPCXXFLAGS}" +then : fi @@ -8958,183 +10849,270 @@ fi CUFLAGS="${HIPCPPFLAGS} ${HIPCXXFLAGS}" fi - HYPRE_HIP_INCL="-I${HYPRE_ROCM_PREFIX}/rocthrust/include" - HYPRE_HIP_INCL="${HYPRE_HIP_INCL} -I${HYPRE_ROCM_PREFIX}/rocprim/include" + HYPRE_HIP_INCL="-I${HYPRE_ROCM_PREFIX}/include" HYPRE_HIP_LIBS="-L${HYPRE_ROCM_PREFIX}/lib -lamdhip64" - if test x"$hypre_using_rocsparse" == x"yes"; then : + if test x"$hypre_using_rocsparse" == x"yes" +then : + +printf "%s\n" "#define HYPRE_USING_ROCSPARSE 1" >>confdefs.h + + HYPRE_HIP_LIBS+=" -lrocsparse" + +fi + + if test x"$hypre_using_rocblas" == x"yes" +then : + +printf "%s\n" "#define HYPRE_USING_ROCBLAS 1" >>confdefs.h + + HYPRE_HIP_LIBS+=" -lrocblas" + +fi + + if test x"$hypre_using_rocsolver" == x"yes" +then : + +printf "%s\n" "#define HYPRE_USING_ROCSOLVER 1" >>confdefs.h + + HYPRE_HIP_LIBS+=" -lrocsolver" + +fi + + if test x"$hypre_using_rocrand" == x"yes" +then : + +printf "%s\n" "#define HYPRE_USING_ROCRAND 1" >>confdefs.h + + HYPRE_HIP_LIBS+=" -lrocrand" + +fi -$as_echo "#define HYPRE_USING_ROCSPARSE 1" >>confdefs.h + if test x"$hypre_using_gpu_profiling" == x"yes" +then : - HYPRE_HIP_LIBS="${HYPRE_HIP_LIBS} -lrocsparse" - HYPRE_HIP_INCL="${HYPRE_HIP_INCL} -I${HYPRE_ROCM_PREFIX}/rocsparse/include" +printf "%s\n" "#define HYPRE_USING_ROCTX 1" >>confdefs.h + + HYPRE_HIP_LIBS+=" -lroctx64" fi - if test x"$hypre_using_rocblas" == x"yes"; then : + if test x"$hypre_using_cuda_streams" == x"yes" +then : + +printf "%s\n" "#define HYPRE_USING_CUDA_STREAMS 1" >>confdefs.h -$as_echo "#define HYPRE_USING_ROCBLAS 1" >>confdefs.h - HYPRE_HIP_INCL="${HYPRE_HIP_INCL} -I${HYPRE_ROCM_PREFIX}/rocblas/include" +fi + fi - if test x"$hypre_using_rocrand" == x"yes"; then : +if test x"$hypre_using_sycl" == x"yes" +then : + + +printf "%s\n" "#define HYPRE_USING_GPU 1" >>confdefs.h + + +printf "%s\n" "#define HYPRE_USING_SYCL 1" >>confdefs.h + + + LINK_CC=${CUCC} + LINK_CXX=${CUCC} + + SYCLFLAGS="-fsycl -fsycl-unnamed-lambda" + if test "$hypre_using_debug" = "yes" + then + SYCLFLAGS="-Wall ${SYCLFLAGS}" + else + SYCLFLAGS="-O3 ${SYCLFLAGS}" + fi + LDFLAGS+=" -fsycl -fsycl-device-code-split=per_kernel -Wl,--no-relax" + + if test "x${HYPRE_SYCL_TARGET}" != "x" + then + LDFLAGS+=" -fsycl-targets=${HYPRE_SYCL_TARGET}" + fi + if test "x${HYPRE_SYCL_TARGET_BACKEND}" != "x" + then + LDFLAGS+=" -Xsycl-target-backend ${HYPRE_SYCL_TARGET_BACKEND}" + fi + + if test "$hypre_using_shared" = "yes" + then + SYCLFLAGS="${SHARED_COMPILE_FLAG} ${SYCLFLAGS}" + BUILD_CC_SHARED="\${CUCC} ${SHARED_BUILD_FLAG}" + fi + + if test "$hypre_user_chose_cuflags" = "no" + then + CUFLAGS="${SYCLFLAGS}" + fi -$as_echo "#define HYPRE_USING_ROCRAND 1" >>confdefs.h + if test x"$hypre_using_onemklsparse" == x"yes" || test x"$hypre_using_onemklblas" == x"yes" || test x"$hypre_using_onemklrand" == x"yes" +then : + as_ac_Header=`printf "%s\n" "ac_cv_header_"${MKLROOT}/include/mkl.h"" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" ""${MKLROOT}/include/mkl.h"" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes" +then : + hypre_found_mkl=yes +else $as_nop + as_fn_error $? "unable to find oneMKL ... Ensure that MKLROOT is set" "$LINENO" 5 +fi - HYPRE_HIP_LIBS="${HYPRE_HIP_LIBS} -lrocrand" - HYPRE_HIP_INCL="${HYPRE_HIP_INCL} -I${HYPRE_ROCM_PREFIX}/rocrand/include" + HYPRE_SYCL_LIBS="${HYPRE_SYCL_LIBS} -qmkl -Wl,-export-dynamic -Wl,--start-group -Wl,--end-group -lsycl -lOpenCL -lpthread -lm -ldl" + HYPRE_SYCL_INCL="${HYPRE_SYCL_INCL} -qmkl -I${DPLROOT}/include -DMKL_ILP64 -I${MKLROOT}/include" fi - if test x"$hypre_using_gpu_profiling" == x"yes"; then : + if test x"$hypre_using_onemklsparse" == x"yes" +then : + +printf "%s\n" "#define HYPRE_USING_ONEMKLSPARSE 1" >>confdefs.h + +fi -$as_echo "#define HYPRE_USING_ROCTX 1" >>confdefs.h + if test x"$hypre_using_onemklblas" == x"yes" +then : - HYPRE_HIP_INCL="${HYPRE_HIP_INCL} -I${HYPRE_ROCM_PREFIX}/roctracer/include" - HYPRE_HIP_LIBS="${HYPRE_HIP_LIBS} -lroctx64" +printf "%s\n" "#define HYPRE_USING_ONEMKLBLAS 1" >>confdefs.h fi + if test x"$hypre_using_onemklrand" == x"yes" +then : + +printf "%s\n" "#define HYPRE_USING_ONEMKLRAND 1" >>confdefs.h fi +printf "%s\n" "#define HYPRE_USING_CUDA_STREAMS 1" >>confdefs.h + + + +fi if test "$hypre_using_um" != "yes" then if test "$hypre_using_cuda" = "yes" then - { $as_echo "$as_me:${as_lineno-$LINENO}: ***********************************************************************" >&5 -$as_echo "$as_me: ***********************************************************************" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Configuring with --with-cuda=yes without unified memory." >&5 -$as_echo "$as_me: Configuring with --with-cuda=yes without unified memory." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: It only works for structured solvers and selected unstructured solvers" >&5 -$as_echo "$as_me: It only works for structured solvers and selected unstructured solvers" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Use --enable-unified-memory to compile with unified memory." >&5 -$as_echo "$as_me: Use --enable-unified-memory to compile with unified memory." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: ***********************************************************************" >&5 -$as_echo "$as_me: ***********************************************************************" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: ***********************************************************************" >&5 +printf "%s\n" "$as_me: ***********************************************************************" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Configuring with --with-cuda=yes without unified memory." >&5 +printf "%s\n" "$as_me: Configuring with --with-cuda=yes without unified memory." >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: It only works for structured solvers and selected unstructured solvers" >&5 +printf "%s\n" "$as_me: It only works for structured solvers and selected unstructured solvers" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Use --enable-unified-memory to compile with unified memory." >&5 +printf "%s\n" "$as_me: Use --enable-unified-memory to compile with unified memory." >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: ***********************************************************************" >&5 +printf "%s\n" "$as_me: ***********************************************************************" >&6;} fi if test "$hypre_using_hip" = "yes" then - { $as_echo "$as_me:${as_lineno-$LINENO}: ***********************************************************************" >&5 -$as_echo "$as_me: ***********************************************************************" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Configuring with --with-hip=yes without unified memory." >&5 -$as_echo "$as_me: Configuring with --with-hip=yes without unified memory." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: It only works for structured solvers and selected unstructured solvers" >&5 -$as_echo "$as_me: It only works for structured solvers and selected unstructured solvers" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Use --enable-unified-memory to compile with unified memory." >&5 -$as_echo "$as_me: Use --enable-unified-memory to compile with unified memory." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: ***********************************************************************" >&5 -$as_echo "$as_me: ***********************************************************************" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: ***********************************************************************" >&5 +printf "%s\n" "$as_me: ***********************************************************************" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Configuring with --with-hip=yes without unified memory." >&5 +printf "%s\n" "$as_me: Configuring with --with-hip=yes without unified memory." >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: It only works for structured solvers and selected unstructured solvers" >&5 +printf "%s\n" "$as_me: It only works for structured solvers and selected unstructured solvers" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Use --enable-unified-memory to compile with unified memory." >&5 +printf "%s\n" "$as_me: Use --enable-unified-memory to compile with unified memory." >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: ***********************************************************************" >&5 +printf "%s\n" "$as_me: ***********************************************************************" >&6;} + fi + if test "$hypre_using_sycl" = "yes" + then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: ***********************************************************" >&5 +printf "%s\n" "$as_me: ***********************************************************" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Configuring with --with-sycl=yes without unified memory." >&5 +printf "%s\n" "$as_me: Configuring with --with-sycl=yes without unified memory." >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: It only works for struct interface." >&5 +printf "%s\n" "$as_me: It only works for struct interface." >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Use --enable-unified-memory to compile with unified memory." >&5 +printf "%s\n" "$as_me: Use --enable-unified-memory to compile with unified memory." >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: ***********************************************************" >&5 +printf "%s\n" "$as_me: ***********************************************************" >&6;} fi if test "$hypre_using_device_openmp" = "yes" then - { $as_echo "$as_me:${as_lineno-$LINENO}: ***********************************************************************" >&5 -$as_echo "$as_me: ***********************************************************************" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Configuring with --with-device-openmp=yes without unified memory." >&5 -$as_echo "$as_me: Configuring with --with-device-openmp=yes without unified memory." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: It only works for structured solvers and selected unstructured solvers" >&5 -$as_echo "$as_me: It only works for structured solvers and selected unstructured solvers" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Use --enable-unified-memory to compile with unified memory." >&5 -$as_echo "$as_me: Use --enable-unified-memory to compile with unified memory." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: ***********************************************************************" >&5 -$as_echo "$as_me: ***********************************************************************" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: ***********************************************************************" >&5 +printf "%s\n" "$as_me: ***********************************************************************" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Configuring with --with-device-openmp=yes without unified memory." >&5 +printf "%s\n" "$as_me: Configuring with --with-device-openmp=yes without unified memory." >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: It only works for structured solvers and selected unstructured solvers" >&5 +printf "%s\n" "$as_me: It only works for structured solvers and selected unstructured solvers" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Use --enable-unified-memory to compile with unified memory." >&5 +printf "%s\n" "$as_me: Use --enable-unified-memory to compile with unified memory." >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: ***********************************************************************" >&5 +printf "%s\n" "$as_me: ***********************************************************************" >&6;} fi fi if test "$hypre_using_openmp" = "yes" then -$as_echo "#define HYPRE_USING_OPENMP 1" >>confdefs.h +printf "%s\n" "#define HYPRE_USING_OPENMP 1" >>confdefs.h fi if test "$hypre_using_device_openmp" = "yes" then -$as_echo "#define HYPRE_USING_CUSPARSE 1" >>confdefs.h - - - if test "$hypre_using_gpu_profiling" = "yes" - then - -$as_echo "#define HYPRE_USING_NVTX 1" >>confdefs.h - - fi - - -$as_echo "#define HYPRE_USING_DEVICE_OPENMP 1" >>confdefs.h +printf "%s\n" "#define HYPRE_USING_DEVICE_OPENMP 1" >>confdefs.h -$as_echo "#define HYPRE_USING_GPU 1" >>confdefs.h - - - -$as_echo "#define HYPRE_DEVICE_OPENMP_ALLOC 1" >>confdefs.h +printf "%s\n" "#define HYPRE_DEVICE_OPENMP_ALLOC 1" >>confdefs.h if test "$hypre_user_chose_cuflags" = "no" then - CUFLAGS=${CFLAGS} - - if test "$CUCC" = "clang-gpu" || test "$CUCC" = "mpiclang-gpu" + CUFLAGS="${CXXFLAGS} ${CUFLAGS}" + # dnl this is too old + #CUFLAGS+=" -fopenmp-nonaliased-maps" + if test "$CUCC" = "icx" || test "$CUCC" = "icpx" || test "$CUCC" = "mpiicx" || test "$CUCC" = "mpiicpx" then - CUFLAGS+=" -fopenmp-nonaliased-maps" + CUFLAGS+="-qopenmp -fopenmp-targets=spir64" fi - if test "$CUCC" = "clang++-gpu" || test "$CUCC" = "mpiclang++-gpu" + fi + + if test "$hypre_user_chose_ldflags" = "no" + then + if test "$CUCC" = "icx" || test "$CUCC" = "icpx" || test "$CUCC" = "mpiicx" || test "$CUCC" = "mpiicpx" then - CUFLAGS+=" -fopenmp-nonaliased-maps" + LDFLAGS+="-qopenmp -fopenmp-targets=spir64" fi fi if test "$hypre_using_debug" = "yes" then -$as_echo "#define HYPRE_DEVICE_OPENMP_CHECK 1" >>confdefs.h - - fi +printf "%s\n" "#define HYPRE_DEVICE_OPENMP_CHECK 1" >>confdefs.h - HYPRE_CUDA_INCLUDE='-I${HYPRE_CUDA_PATH}/include' - HYPRE_CUDA_LIBS='-L${HYPRE_CUDA_PATH}/lib64 -lcudart -lcusparse -lcurand' - if test "$hypre_using_gpu_profiling" = "yes" - then - HYPRE_CUDA_LIBS+=" -lnvToolsExt" fi LINK_CC='${CUCC}' LINK_CXX='${CUCC}' fi -if test "x$hypre_using_cuda" = "xyes" || test "x$hypre_using_device_openmp" = "xyes" -then - if test "x$hypre_using_cuda_streams" = "xyes"] - then - -$as_echo "#define HYPRE_USING_CUDA_STREAMS 1" >>confdefs.h - - fi -fi - if test "x$hypre_using_um" = "xyes" then -$as_echo "#define HYPRE_USING_UNIFIED_MEMORY 1" >>confdefs.h +printf "%s\n" "#define HYPRE_USING_UNIFIED_MEMORY 1" >>confdefs.h else - if test "x$hypre_using_cuda" = "xyes" || test "x$hypre_using_device_openmp" = "xyes" || test "x$hypre_using_hip" = "xyes" + if test "x$hypre_using_cuda" = "xyes" || test "x$hypre_using_device_openmp" = "xyes" || test "x$hypre_using_hip" = "xyes" || test "x$hypre_using_sycl" = "xyes" then -$as_echo "#define HYPRE_USING_DEVICE_MEMORY 1" >>confdefs.h +printf "%s\n" "#define HYPRE_USING_DEVICE_MEMORY 1" >>confdefs.h else -$as_echo "#define HYPRE_USING_HOST_MEMORY 1" >>confdefs.h +printf "%s\n" "#define HYPRE_USING_HOST_MEMORY 1" >>confdefs.h fi fi @@ -9142,10 +11120,12 @@ fi if test "$hypre_gpu_mpi" = "yes" then -$as_echo "#define HYPRE_WITH_GPU_AWARE_MPI 1" >>confdefs.h +printf "%s\n" "#define HYPRE_USING_GPU_AWARE_MPI 1" >>confdefs.h fi +CUFLAGS="${CUFLAGS} ${EXTRA_CUFLAGS}" + HYPRE_INSTALLDIR="${prefix}" HYPRE_LIBINSTALL="${libdir}" HYPRE_INCINSTALL="${includedir}" @@ -9154,23 +11134,23 @@ HYPRE_INCINSTALL="${includedir}" if test $host_alias = $build_alias then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking the hostname" >&5 -$as_echo_n "checking the hostname... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the hostname" >&5 +printf %s "checking the hostname... " >&6; } hypre_hostname=hostname HOSTNAME="`$hypre_hostname`" if test -z "$HOSTNAME" then HOSTNAME=unknown - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: hostname is unknown" >&5 -$as_echo "$as_me: WARNING: hostname is unknown" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: hostname is unknown" >&5 +printf "%s\n" "$as_me: WARNING: hostname is unknown" >&2;} else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HOSTNAME" >&5 -$as_echo "$HOSTNAME" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $HOSTNAME" >&5 +printf "%s\n" "$HOSTNAME" >&6; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking the architecture" >&5 -$as_echo_n "checking the architecture... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the architecture" >&5 +printf %s "checking the architecture... " >&6; } if test -z "$ARCH"; then @@ -9184,8 +11164,8 @@ $as_echo_n "checking the architecture... " >&6; } done if test -z "$hypre_tarch_dir"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find tarch" >&5 -$as_echo "$as_me: WARNING: cannot find tarch" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cannot find tarch" >&5 +printf "%s\n" "$as_me: WARNING: cannot find tarch" >&2;} HYPRE_ARCH=$HOSTTYPE else HYPRE_ARCH="`$hypre_tarch`" @@ -9197,16 +11177,16 @@ $as_echo "$as_me: WARNING: cannot find tarch" >&2;} if test -z "$HYPRE_ARCH"; then HYPRE_ARCH=unknown - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: architecture is unknown" >&5 -$as_echo "$as_me: WARNING: architecture is unknown" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: architecture is unknown" >&5 +printf "%s\n" "$as_me: WARNING: architecture is unknown" >&2;} else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HYPRE_ARCH" >&5 -$as_echo "$HYPRE_ARCH" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $HYPRE_ARCH" >&5 +printf "%s\n" "$HYPRE_ARCH" >&6; } fi else HYPRE_ARCH=$ARCH - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HYPRE_ARCH" >&5 -$as_echo "$HYPRE_ARCH" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $HYPRE_ARCH" >&5 +printf "%s\n" "$HYPRE_ARCH" >&6; } fi else @@ -9216,27 +11196,27 @@ $as_echo "$HYPRE_ARCH" >&6; } case $HYPRE_ARCH in alpha) -$as_echo "#define HYPRE_ALPHA 1" >>confdefs.h +printf "%s\n" "#define HYPRE_ALPHA 1" >>confdefs.h ;; sun* | solaris*) -$as_echo "#define HYPRE_SOLARIS 1" >>confdefs.h +printf "%s\n" "#define HYPRE_SOLARIS 1" >>confdefs.h ;; hp* | HP*) -$as_echo "#define HYPRE_HPPA 1" >>confdefs.h +printf "%s\n" "#define HYPRE_HPPA 1" >>confdefs.h ;; rs6000 | RS6000 | *bgl* | *BGL* | ppc64*) -$as_echo "#define HYPRE_RS6000 1" >>confdefs.h +printf "%s\n" "#define HYPRE_RS6000 1" >>confdefs.h ;; IRIX64) -$as_echo "#define HYPRE_IRIX64 1" >>confdefs.h +printf "%s\n" "#define HYPRE_IRIX64 1" >>confdefs.h ;; Linux | linux | LINUX) @@ -9246,18 +11226,18 @@ $as_echo "#define HYPRE_IRIX64 1" >>confdefs.h case $systemtype in chaos*) -$as_echo "#define HYPRE_LINUX_CHAOS 1" >>confdefs.h +printf "%s\n" "#define HYPRE_LINUX_CHAOS 1" >>confdefs.h ;; *) -$as_echo "#define HYPRE_LINUX 1" >>confdefs.h +printf "%s\n" "#define HYPRE_LINUX 1" >>confdefs.h ;; esac else -$as_echo "#define HYPRE_LINUX 1" >>confdefs.h +printf "%s\n" "#define HYPRE_LINUX 1" >>confdefs.h fi ;; @@ -9355,6 +11335,13 @@ $as_echo "#define HYPRE_LINUX 1" >>confdefs.h + + + + + + + @@ -9393,8 +11380,8 @@ _ACEOF case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -9424,15 +11411,15 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; /^ac_cv_env_/b end t clear :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +printf "%s\n" "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else @@ -9446,8 +11433,8 @@ $as_echo "$as_me: updating cache $cache_file" >&6;} fi fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -9464,7 +11451,7 @@ U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" @@ -9480,8 +11467,8 @@ LTLIBOBJS=$ac_ltlibobjs ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL @@ -9504,14 +11491,16 @@ cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else +else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -9521,46 +11510,46 @@ esac fi + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then +if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -9569,13 +11558,6 @@ if test "${PATH_SEPARATOR+set}" != set; then fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -9584,8 +11566,12 @@ case $0 in #(( for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS @@ -9597,30 +11583,10 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] @@ -9633,13 +11599,14 @@ as_fn_error () as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $2" >&2 + printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error + # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -9666,18 +11633,20 @@ as_fn_unset () { eval $1=; unset $1;} } as_unset=as_fn_unset + # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : eval 'as_fn_append () { eval $1+=\$2 }' -else +else $as_nop as_fn_append () { eval $1=\$$1\$2 @@ -9689,12 +11658,13 @@ fi # as_fn_append # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else +else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` @@ -9725,7 +11695,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -9747,6 +11717,10 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -9760,6 +11734,12 @@ case `echo -n x` in #((((( ECHO_N='-n';; esac +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -9801,7 +11781,7 @@ as_fn_mkdir_p () as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -9810,7 +11790,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | +printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -9872,8 +11852,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by hypre $as_me 2.22.1, which was -generated by GNU Autoconf 2.69. Invocation command line was +This file was extended by hypre $as_me 2.33.0, which was +generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -9931,14 +11911,16 @@ $config_headers Report bugs to the package provider." _ACEOF +ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` +ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -hypre config.status 2.22.1 -configured by $0, generated by GNU Autoconf 2.69, +hypre config.status 2.33.0 +configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2021 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -9975,15 +11957,15 @@ do -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; + printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; + printf "%s\n" "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" @@ -9991,7 +11973,7 @@ do --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; @@ -10000,7 +11982,7 @@ do as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; + printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; @@ -10028,7 +12010,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" @@ -10042,7 +12024,7 @@ exec 5>>config.log sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX - $as_echo "$ac_log" + printf "%s\n" "$ac_log" } >&5 _ACEOF @@ -10068,8 +12050,8 @@ done # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files + test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree @@ -10405,7 +12387,7 @@ do esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done @@ -10413,17 +12395,17 @@ do # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +printf "%s\n" "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | + ac_sed_conf_input=`printf "%s\n" "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac @@ -10440,7 +12422,7 @@ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | +printf "%s\n" X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -10464,9 +12446,9 @@ $as_echo X"$ac_file" | case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -10519,8 +12501,8 @@ ac_sed_dataroot=' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' @@ -10562,9 +12544,9 @@ test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" @@ -10580,20 +12562,20 @@ which seems to be undefined. Please make sure it is defined" >&2;} # if test x"$ac_file" != x-; then { - $as_echo "/* $configure_input */" \ + printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else - $as_echo "/* $configure_input */" \ + printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi @@ -10634,11 +12616,12 @@ if test "$no_create" != yes; then $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi + mv HYPRE_config.h HYPRE_config.h.tmp sed 's/FC_FUNC/HYPRE_FC_FUNC/g' < HYPRE_config.h.tmp > HYPRE_config.h rm -f HYPRE_config.h.tmp diff --git a/external/hypre/src/distributed_ls/CMakeLists.txt b/external/hypre/src/distributed_ls/CMakeLists.txt index 511f366c..afa06b62 100644 --- a/external/hypre/src/distributed_ls/CMakeLists.txt +++ b/external/hypre/src/distributed_ls/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/Euclid/CMakeLists.txt b/external/hypre/src/distributed_ls/Euclid/CMakeLists.txt index 2ae900c4..134d9ac4 100644 --- a/external/hypre/src/distributed_ls/Euclid/CMakeLists.txt +++ b/external/hypre/src/distributed_ls/Euclid/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/Euclid/Euclid_apply.c b/external/hypre/src/distributed_ls/Euclid/Euclid_apply.c index a3bd9b68..9a1ccaec 100644 --- a/external/hypre/src/distributed_ls/Euclid/Euclid_apply.c +++ b/external/hypre/src/distributed_ls/Euclid/Euclid_apply.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/Euclid/Euclid_dh.c b/external/hypre/src/distributed_ls/Euclid/Euclid_dh.c index 05d04cd1..1c16c8d0 100644 --- a/external/hypre/src/distributed_ls/Euclid/Euclid_dh.c +++ b/external/hypre/src/distributed_ls/Euclid/Euclid_dh.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/Euclid/Euclid_dh.h b/external/hypre/src/distributed_ls/Euclid/Euclid_dh.h index 846c8e30..8756c682 100644 --- a/external/hypre/src/distributed_ls/Euclid/Euclid_dh.h +++ b/external/hypre/src/distributed_ls/Euclid/Euclid_dh.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/Euclid/ExternalRows_dh.c b/external/hypre/src/distributed_ls/Euclid/ExternalRows_dh.c index 0120ddd8..8e6d5581 100644 --- a/external/hypre/src/distributed_ls/Euclid/ExternalRows_dh.c +++ b/external/hypre/src/distributed_ls/Euclid/ExternalRows_dh.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -106,7 +106,7 @@ void ExternalRows_dhGetRow(ExternalRows_dh er, HYPRE_Int globalRow, START_FUNC_DH if (er->rowLookup == NULL) { *len = 0; - } + } else { HashData *r = NULL; @@ -126,8 +126,8 @@ void ExternalRows_dhGetRow(ExternalRows_dh er, HYPRE_Int globalRow, /*===================================================================== * methods for receiving external rows from lower-ordered subdomains *=====================================================================*/ -static void rcv_ext_storage_private(ExternalRows_dh extRows); -static void build_hash_table_private(ExternalRows_dh er); +static void rcv_ext_storage_private(ExternalRows_dh extRows); +static void build_hash_table_private(ExternalRows_dh er); static void rcv_external_rows_private(ExternalRows_dh er); static void allocate_ext_row_storage_private(ExternalRows_dh er); static void print_received_rows_private(ExternalRows_dh er); @@ -148,28 +148,28 @@ void ExternalRows_dhRecvRows(ExternalRows_dh er) rcv_ext_storage_private(er); CHECK_V_ERROR; - /* allocate data structures for receiving the rows (no comms) + /* allocate data structures for receiving the rows (no comms) (allocates: cvalExt, fillExt, avalExt) (no communications) */ allocate_ext_row_storage_private(er); CHECK_V_ERROR; - /* construct hash table for external row lookup (no comms) + /* construct hash table for external row lookup (no comms) (Creates/allocates: rowLookup) (no communications) */ build_hash_table_private(er); CHECK_V_ERROR; - /* receive the actual row structures and values - from lower ordered neighbors + /* receive the actual row structures and values + from lower ordered neighbors */ rcv_external_rows_private(er); CHECK_V_ERROR; if (debug) { print_received_rows_private(er); CHECK_V_ERROR; } - } + } END_FUNC_DH } @@ -178,7 +178,7 @@ void ExternalRows_dhRecvRows(ExternalRows_dh er) void rcv_ext_storage_private(ExternalRows_dh er) { START_FUNC_DH - HYPRE_Int i; + HYPRE_Int i; HYPRE_Int loCount = er->sg->loCount, *loNabors = er->sg->loNabors; HYPRE_Int *rcv_row_counts = er->rcv_row_counts; HYPRE_Int *rcv_nz_counts = er->rcv_nz_counts; @@ -192,7 +192,7 @@ void rcv_ext_storage_private(ExternalRows_dh er) HYPRE_Int nabor = loNabors[i]; hypre_MPI_Irecv(rcv_row_counts+i, 1, HYPRE_MPI_INT, nabor, ROW_CT_TAG, comm_dh, er->req1+i); hypre_MPI_Irecv(rcv_nz_counts+i, 1, HYPRE_MPI_INT, nabor, NZ_CT_TAG, comm_dh, er->req2+i); - } + } hypre_MPI_Waitall(loCount, er->req1, er->status); hypre_MPI_Waitall(loCount, er->req2, er->status); @@ -217,7 +217,7 @@ void rcv_ext_storage_private(ExternalRows_dh er) if (debug) { HYPRE_Int j, nz; - for (i=0; i to be received from P_%i\nEXR ", loNabors[i]); nz = rcv_row_counts[i]; for (j=0; j ", numbers[i][j], lengths[i][j]); @@ -272,13 +272,13 @@ void build_hash_table_private(ExternalRows_dh er) offset = 0; /* loop over lower ordered nabors in subdomain graph */ - for (i=0; ircv_row_numbers[i][j]; + for (j=0; jrcv_row_numbers[i][j]; HYPRE_Int rowLen = er->rcv_row_lengths[i][j]; hypre_fprintf(logFile, "EXR %i :: ", 1+rowNum); for (k=0; k 0) { hypre_fprintf(logFile, "EXR %i :: ", i+1); @@ -420,7 +420,7 @@ void send_ext_storage_private(ExternalRows_dh er) HYPRE_Int m = er->F->m; HYPRE_Int beg_row = er->F->beg_row; HYPRE_Int rowCount = er->F->bdry_count; /* number of boundary rows */ - HYPRE_Int first_bdry = er->F->first_bdry; + HYPRE_Int first_bdry = er->F->first_bdry; bool debug = false; if (logFile != NULL && er->debug) debug = true; @@ -448,7 +448,7 @@ void send_ext_storage_private(ExternalRows_dh er) HYPRE_Int nabor = hiNabors[i]; hypre_MPI_Isend(&rowCount, 1, HYPRE_MPI_INT, nabor, ROW_CT_TAG, comm_dh, er->req1+i); hypre_MPI_Isend(&nz, 1, HYPRE_MPI_INT, nabor, NZ_CT_TAG, comm_dh, er->req2+i); - } + } /* set up array for global row numbers */ for (i=0, j=first_bdry; jsg->hiCount, *hiNabors = er->sg->hiNabors; HYPRE_Int offset, nz = er->nzSend; - HYPRE_Int *cvalSend, *fillSend; - REAL_DH *avalSend; + HYPRE_Int *cvalSend, *fillSend; + REAL_DH *avalSend; HYPRE_Int *cval = er->F->cval, *fill = er->F->fill; HYPRE_Int m = er->F->m; HYPRE_Int *rp = er->F->rp, *diag = er->F->diag; @@ -531,7 +531,7 @@ void send_external_rows_private(ExternalRows_dh er) for (i=0; icval_req+i); - hypre_MPI_Isend(fillSend, nz, HYPRE_MPI_INT, nabor, FILL_TAG, comm_dh, er->fill_req+i); + hypre_MPI_Isend(fillSend, nz, HYPRE_MPI_INT, nabor, FILL_TAG, comm_dh, er->fill_req+i); hypre_MPI_Isend(avalSend, nz, hypre_MPI_REAL, nabor, AVAL_TAG, comm_dh, er->aval_req+i); } END_FUNC_DH diff --git a/external/hypre/src/distributed_ls/Euclid/ExternalRows_dh.h b/external/hypre/src/distributed_ls/Euclid/ExternalRows_dh.h index 9df4cb65..495ccfc9 100644 --- a/external/hypre/src/distributed_ls/Euclid/ExternalRows_dh.h +++ b/external/hypre/src/distributed_ls/Euclid/ExternalRows_dh.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/Euclid/Factor_dh.c b/external/hypre/src/distributed_ls/Euclid/Factor_dh.c index be625a70..c150e78a 100644 --- a/external/hypre/src/distributed_ls/Euclid/Factor_dh.c +++ b/external/hypre/src/distributed_ls/Euclid/Factor_dh.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -21,7 +21,7 @@ /* #include "io_dh.h" */ /* suppress compiler complaints */ -void Factor_dh_junk() +void Factor_dh_junk(void) { } @@ -35,7 +35,7 @@ void Factor_dhCreate(Factor_dh *mat) { START_FUNC_DH HYPRE_Int i; - struct _factor_dh* tmp; + struct _factor_dh* tmp; if (np_dh > MAX_MPI_TASKS) { SET_V_ERROR("you must change MAX_MPI_TASKS and recompile!"); @@ -47,7 +47,7 @@ void Factor_dhCreate(Factor_dh *mat) tmp->m = 0; tmp->n = 0; tmp->id = myid_dh; - tmp->beg_row = 0; + tmp->beg_row = 0; tmp->first_bdry = 0; tmp->bdry_count = 0; tmp->blockJacobi = false; @@ -70,7 +70,7 @@ void Factor_dhCreate(Factor_dh *mat) tmp->numbSolve = NULL; tmp->debug = Parser_dhHasSwitch(parser_dh, "-debug_Factor"); - + /* initialize MPI request to null */ for(i=0; isendindHi != NULL) { FREE_DH(mat->sendindHi); CHECK_V_ERROR; } if (mat->numbSolve != NULL) { Numbering_dhDestroy(mat->numbSolve); CHECK_V_ERROR; } - + /* cleanup MPI requests */ for(i=0; irecv_reqLo[i] != hypre_MPI_REQUEST_NULL) hypre_MPI_Request_free(&(mat->recv_reqLo[i])); - if(mat->recv_reqHi[i] != hypre_MPI_REQUEST_NULL) hypre_MPI_Request_free(&(mat->recv_reqHi[i])); + if(mat->recv_reqHi[i] != hypre_MPI_REQUEST_NULL) hypre_MPI_Request_free(&(mat->recv_reqHi[i])); if(mat->send_reqLo[i] != hypre_MPI_REQUEST_NULL) hypre_MPI_Request_free(&(mat->send_reqLo[i])); if(mat->send_reqHi[i] != hypre_MPI_REQUEST_NULL) hypre_MPI_Request_free(&(mat->send_reqHi[i])); - if(mat->requests[i] != hypre_MPI_REQUEST_NULL) hypre_MPI_Request_free(&(mat->requests[i])); + if(mat->requests[i] != hypre_MPI_REQUEST_NULL) hypre_MPI_Request_free(&(mat->requests[i])); } - FREE_DH(mat); CHECK_V_ERROR; + FREE_DH(mat); CHECK_V_ERROR; END_FUNC_DH } @@ -207,14 +207,14 @@ void Factor_dhPrintDiags(Factor_dh mat, FILE *fp) START_FUNC_DH HYPRE_Int beg_row = mat->beg_row; HYPRE_Int m = mat->m, i, pe, *diag = mat->diag; - REAL_DH *aval = mat->aval; + REAL_DH *aval = mat->aval; + - fprintf_dh(fp, "\n----------------------- Factor_dhPrintDiags ------------------\n"); fprintf_dh(fp, "(grep for 'ZERO')\n"); for (pe=0; peid == pe) { hypre_fprintf(fp, "----- subdomain: %i processor: %i\n", pe, myid_dh); for (i=0; iid == pe) { - if (pe == 0) { + if (pe == 0) { fp=openFile_dh(filename, "w"); CHECK_V_ERROR; - } - else { + } + else { fp=openFile_dh(filename, "a"); CHECK_V_ERROR; } @@ -298,7 +298,7 @@ void Factor_dhPrintTriples(Factor_dh mat, char *filename) if (noValues) { hypre_fprintf(fp, "%i %i\n", 1+i+beg_row, 1+mat->cval[j]); } else { - hypre_fprintf(fp, TRIPLES_FORMAT, + hypre_fprintf(fp, TRIPLES_FORMAT, 1+i+beg_row, 1+mat->cval[j], aval[j]); } } @@ -328,11 +328,12 @@ void Factor_dhPrintTriples(Factor_dh mat, char *filename) */ #undef __FUNC__ #define __FUNC__ "setup_receives_private" -static HYPRE_Int setup_receives_private(Factor_dh mat, HYPRE_Int *beg_rows, HYPRE_Int *end_rows, +static HYPRE_Int setup_receives_private(Factor_dh mat, HYPRE_Int *beg_rows, HYPRE_Int *end_rows, HYPRE_Real *recvBuf, hypre_MPI_Request *req, - HYPRE_Int *reqind, HYPRE_Int reqlen, + HYPRE_Int *reqind, HYPRE_Int reqlen, HYPRE_Int *outlist, bool debug) { + HYPRE_UNUSED_VAR(mat); START_FUNC_DH HYPRE_Int i, j, this_pe, num_recv = 0; hypre_MPI_Request request; @@ -342,7 +343,7 @@ static HYPRE_Int setup_receives_private(Factor_dh mat, HYPRE_Int *beg_rows, HYPR hypre_fprintf(logFile, "FACT STARTING: setup_receives_private\n"); } - for (i=0; inum_sendLo = mat->num_sendHi */ - hypre_MPI_Waitall(count, requests, statuses); + hypre_MPI_Waitall(count, requests, statuses); if (debug) { HYPRE_Int j; @@ -491,7 +492,7 @@ static void setup_sends_private(Factor_dh mat, HYPRE_Int *inlist, -#undef __FUNC__ +#undef __FUNC__ #define __FUNC__ "Factor_dhSolveSetup" void Factor_dhSolveSetup(Factor_dh mat, SubdomainGraph_dh sg) { @@ -540,7 +541,7 @@ void Factor_dhSolveSetup(Factor_dh mat, SubdomainGraph_dh sg) mat->num_recvHi = 0; if (numb->num_extLo) { recvBuf = mat->work_y_lo + m; - mat->num_recvLo = setup_receives_private(mat, beg_rows, end_rows, + mat->num_recvLo = setup_receives_private(mat, beg_rows, end_rows, recvBuf, mat->recv_reqLo, numb->idx_extLo, numb->num_extLo, outlist, debug); CHECK_V_ERROR; @@ -551,12 +552,12 @@ void Factor_dhSolveSetup(Factor_dh mat, SubdomainGraph_dh sg) recvBuf = mat->work_x_hi + m + numb->num_extLo; mat->num_recvHi = setup_receives_private(mat, beg_rows, end_rows, recvBuf, mat->recv_reqHi, - numb->idx_extHi, numb->num_extHi, + numb->idx_extHi, numb->num_extHi, outlist, debug); CHECK_V_ERROR; } - hypre_MPI_Alltoall(outlist, 1, HYPRE_MPI_INT, inlist, 1, HYPRE_MPI_INT, comm_dh); - /* At this point, inlist[j] contains the number of indices + hypre_MPI_Alltoall(outlist, 1, HYPRE_MPI_INT, inlist, 1, HYPRE_MPI_INT, comm_dh); + /* At this point, inlist[j] contains the number of indices that this processor must send to P_j. Processors next need to exchange the actual lists of required indices; this is done in setup_sends_private() @@ -596,12 +597,12 @@ void Factor_dhSolveSetup(Factor_dh mat, SubdomainGraph_dh sg) so similar to MatVec, that I put it here, instead of with the other solves located in Euclid_apply.c. */ -static void forward_solve_private(HYPRE_Int m, HYPRE_Int from, HYPRE_Int to, - HYPRE_Int *rp, HYPRE_Int *cval, HYPRE_Int *diag, HYPRE_Real *aval, +static void forward_solve_private(HYPRE_Int m, HYPRE_Int from, HYPRE_Int to, + HYPRE_Int *rp, HYPRE_Int *cval, HYPRE_Int *diag, HYPRE_Real *aval, HYPRE_Real *rhs, HYPRE_Real *work_y, bool debug); -static void backward_solve_private(HYPRE_Int m, HYPRE_Int from, HYPRE_Int to, - HYPRE_Int *rp, HYPRE_Int *cval, HYPRE_Int *diag, HYPRE_Real *aval, +static void backward_solve_private(HYPRE_Int m, HYPRE_Int from, HYPRE_Int to, + HYPRE_Int *rp, HYPRE_Int *cval, HYPRE_Int *diag, HYPRE_Real *aval, HYPRE_Real *work_y, HYPRE_Real *work_x, bool debug); static HYPRE_Int beg_rowG; @@ -621,7 +622,7 @@ void Factor_dhSolve(HYPRE_Real *rhs, HYPRE_Real *lhs, Euclid_dh ctx) HYPRE_Real *aval = mat->aval; HYPRE_Int *sendindLo = mat->sendindLo, *sendindHi = mat->sendindHi; HYPRE_Int sendlenLo = mat->sendlenLo, sendlenHi = mat->sendlenHi; - HYPRE_Real *sendbufLo = mat->sendbufLo, *sendbufHi = mat->sendbufHi; + HYPRE_Real *sendbufLo = mat->sendbufLo, *sendbufHi = mat->sendbufHi; HYPRE_Real *work_y = mat->work_y_lo; HYPRE_Real *work_x = mat->work_x_hi; bool debug = false; @@ -644,10 +645,10 @@ for (i=0; inum_recvLo) { - hypre_MPI_Startall(mat->num_recvLo, mat->recv_reqLo); + hypre_MPI_Startall(mat->num_recvLo, mat->recv_reqLo); } if (mat->num_recvHi) { - hypre_MPI_Startall(mat->num_recvHi, mat->recv_reqHi); + hypre_MPI_Startall(mat->num_recvHi, mat->recv_reqHi); } /*------------------------------------------------------------- @@ -657,7 +658,7 @@ for (i=0; inum_sendHi, mat->send_reqHi); + hypre_MPI_Startall(mat->num_sendHi, mat->send_reqHi); /* debug block */ if (debug) { @@ -726,7 +727,7 @@ for (i=0; i=to; --i) { @@ -905,8 +906,8 @@ void Factor_dhInit(void *A, bool fillFlag, bool avalFlag, Factor_dh F; EuclidGetDimensions(A, &beg_row, &m, &n); CHECK_V_ERROR; - alloc = rho*m; - Factor_dhCreate(&F); CHECK_V_ERROR; + alloc = (HYPRE_Int)(rho*m); + Factor_dhCreate(&F); CHECK_V_ERROR; *Fout = F; F->m = m; @@ -937,7 +938,7 @@ void Factor_dhReallocate(Factor_dh F, HYPRE_Int used, HYPRE_Int additional) if (used+additional > F->alloc) { HYPRE_Int *tmpI; - while (alloc < used+additional) alloc *= 2.0; + while (alloc < used+additional) alloc *= 2; F->alloc = alloc; tmpI = F->cval; F->cval = (HYPRE_Int*)MALLOC_DH(alloc*sizeof(HYPRE_Int)); CHECK_V_ERROR; @@ -966,7 +967,7 @@ void Factor_dhTranspose(Factor_dh A, Factor_dh *Bout) START_FUNC_DH Factor_dh B; - if (np_dh > 1) { SET_V_ERROR("only for sequential"); } + if (np_dh > 1) { SET_V_ERROR("only for sequential"); } Factor_dhCreate(&B); CHECK_V_ERROR; *Bout = B; @@ -1119,7 +1120,7 @@ HYPRE_Real Factor_dhMaxPivotInverse(Factor_dh mat) HYPRE_Real minGlobal = 0.0, min = aval[diags[0]]; HYPRE_Real retval; - for (i=0; iaval; for (i=0; ivals; for (i=0; isize = size; /* diff --git a/external/hypre/src/distributed_ls/Euclid/Hash_dh.h b/external/hypre/src/distributed_ls/Euclid/Hash_dh.h index cde3e127..666f38d1 100644 --- a/external/hypre/src/distributed_ls/Euclid/Hash_dh.h +++ b/external/hypre/src/distributed_ls/Euclid/Hash_dh.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/Euclid/Hash_i_dh.c b/external/hypre/src/distributed_ls/Euclid/Hash_i_dh.c index e362a846..f54b39fb 100644 --- a/external/hypre/src/distributed_ls/Euclid/Hash_i_dh.c +++ b/external/hypre/src/distributed_ls/Euclid/Hash_i_dh.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -80,7 +80,7 @@ void Hash_i_dhCreate(Hash_i_dh *h, HYPRE_Int sizeIN) */ while (size < sizeIN) size *= 2; /* want table size to be a power of 2: */ /* rule-of-thumb: ensure there's at least 10% padding */ - if ( (size-sizeIN) < (.1 * size) ) { size *= 2.0; } + if ( (size-sizeIN) < (.1 * size) ) { size *= 2; } tmp->size = size; diff --git a/external/hypre/src/distributed_ls/Euclid/Hash_i_dh.h b/external/hypre/src/distributed_ls/Euclid/Hash_i_dh.h index fdb8a295..7177f5c2 100644 --- a/external/hypre/src/distributed_ls/Euclid/Hash_i_dh.h +++ b/external/hypre/src/distributed_ls/Euclid/Hash_i_dh.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/Euclid/MatGenFD.c b/external/hypre/src/distributed_ls/Euclid/MatGenFD.c index 6ca993c0..9354c2a0 100644 --- a/external/hypre/src/distributed_ls/Euclid/MatGenFD.c +++ b/external/hypre/src/distributed_ls/Euclid/MatGenFD.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -14,7 +14,7 @@ /* #include "graphColor_dh.h" */ static bool isThreeD; - + /* handles for values in the 5-point (2D) or 7-point (for 3D) stencil */ #define FRONT(a) a[5] #define SOUTH(a) a[3] @@ -27,14 +27,14 @@ static bool isThreeD; static void setBoundary_private(HYPRE_Int node, HYPRE_Int *cval, HYPRE_Real *aval, HYPRE_Int len, HYPRE_Real *rhs, HYPRE_Real bc, HYPRE_Real coeff, HYPRE_Real ctr, HYPRE_Int nabor); -static void generateStriped(MatGenFD mg, HYPRE_Int *rp, HYPRE_Int *cval, +static void generateStriped(MatGenFD mg, HYPRE_Int *rp, HYPRE_Int *cval, HYPRE_Real *aval, Mat_dh A, Vec_dh b); -static void generateBlocked(MatGenFD mg, HYPRE_Int *rp, HYPRE_Int *cval, HYPRE_Real *aval, +static void generateBlocked(MatGenFD mg, HYPRE_Int *rp, HYPRE_Int *cval, HYPRE_Real *aval, Mat_dh A, Vec_dh b); static void getstencil(MatGenFD g, HYPRE_Int ix, HYPRE_Int iy, HYPRE_Int iz); #if 0 -static void fdaddbc(HYPRE_Int nx, HYPRE_Int ny, HYPRE_Int nz, HYPRE_Int *rp, HYPRE_Int *cval, +static void fdaddbc(HYPRE_Int nx, HYPRE_Int ny, HYPRE_Int nz, HYPRE_Int *rp, HYPRE_Int *cval, HYPRE_Int *diag, HYPRE_Real *aval, HYPRE_Real *rhs, HYPRE_Real h, MatGenFD mg); #endif @@ -69,7 +69,7 @@ void MatGenFD_Create(MatGenFD *mg) tmp->a = tmp->b = tmp->c = 1.0; tmp->d = tmp->e = tmp->f = 0.0; - tmp->g = tmp->h = 0.0; + tmp->g = tmp->h = 0.0; Parser_dhReadDouble(parser_dh,"-dx",&tmp->a); Parser_dhReadDouble(parser_dh,"-dy",&tmp->b); @@ -78,13 +78,13 @@ void MatGenFD_Create(MatGenFD *mg) Parser_dhReadDouble(parser_dh,"-cy",&tmp->e); Parser_dhReadDouble(parser_dh,"-cz",&tmp->f); - tmp->a = -1*fabs(tmp->a); - tmp->b = -1*fabs(tmp->b); - tmp->c = -1*fabs(tmp->c); + tmp->a = -1*hypre_abs(tmp->a); + tmp->b = -1*hypre_abs(tmp->b); + tmp->c = -1*hypre_abs(tmp->c); tmp->allocateMem = true; - tmp->A = tmp->B = tmp->C = tmp->D = tmp->E + tmp->A = tmp->B = tmp->C = tmp->D = tmp->E = tmp->F = tmp->G = tmp->H = konstant; tmp->bcX1 = tmp->bcX2 = tmp->bcY1 = tmp->bcY2 @@ -155,15 +155,15 @@ void MatGenFD_Run(MatGenFD mg, HYPRE_Int id, HYPRE_Int np, Mat_dh *AOut, Vec_dh /* 1. compute "nice to have" values */ /* each proc's subgrid dimension */ mg->cc = m; - if (threeD) { + if (threeD) { m = mg->m = m*m*m; } else { m = mg->m = m*m; - } + } mg->first = id*m; mg->hh = 1.0/(mg->px*mg->cc - 1); - + if (debug) { hypre_sprintf(msgBuf_dh, "cc (local grid dimension) = %i", mg->cc); SET_INFO(msgBuf_dh); @@ -181,7 +181,7 @@ void MatGenFD_Run(MatGenFD mg, HYPRE_Int id, HYPRE_Int np, Mat_dh *AOut, Vec_dh /* 2. allocate storage */ if (mg->allocateMem) { A->rp = (HYPRE_Int*)MALLOC_DH((m+1)*sizeof(HYPRE_Int)); CHECK_V_ERROR; - A->rp[0] = 0; + A->rp[0] = 0; A->cval = (HYPRE_Int*)MALLOC_DH(nnz*sizeof(HYPRE_Int)); CHECK_V_ERROR A->aval = (HYPRE_Real*)MALLOC_DH(nnz*sizeof(HYPRE_Real)); CHECK_V_ERROR; /* rhs->vals = (HYPRE_Real*)MALLOC_DH(m*sizeof(HYPRE_Real)); CHECK_V_ERROR; */ @@ -199,7 +199,7 @@ void MatGenFD_Run(MatGenFD mg, HYPRE_Int id, HYPRE_Int np, Mat_dh *AOut, Vec_dh generateStriped(mg, A->rp, A->cval, A->aval, A, rhs); CHECK_V_ERROR; } else { generateBlocked(mg, A->rp, A->cval, A->aval, A, rhs); CHECK_V_ERROR; - } + } /* add in bdry conditions */ /* only implemented for 2D mats! */ @@ -225,7 +225,7 @@ void generateStriped(MatGenFD mg, HYPRE_Int *rp, HYPRE_Int *cval, HYPRE_Real *av HYPRE_Real *stencil = mg->stencil; bool debug = false; HYPRE_Int plane, nodeRemainder; - HYPRE_Int naborx1, naborx2, nabory1, nabory2; + HYPRE_Int naborx1 = 0, naborx2 = 0, nabory1 = 0, nabory2 = 0; HYPRE_Real *rhs; bool applyBdry = true; @@ -273,7 +273,7 @@ void generateStriped(MatGenFD mg, HYPRE_Int *rp, HYPRE_Int *cval, HYPRE_Real *av HYPRE_Int localRow = row-beg_row; /* compute current node's position in grid */ - k = (row / plane); + k = (row / plane); nodeRemainder = row - (k*plane); /* map row to 1st plane */ j = nodeRemainder / m; i = nodeRemainder % m; @@ -332,7 +332,7 @@ void generateStriped(MatGenFD mg, HYPRE_Int *rp, HYPRE_Int *cval, HYPRE_Real *av } rhs[localRow] = 0.0; ++localRow; - rp[localRow] = idx; + rp[localRow] = idx; /* apply boundary conditions; only for 2D! */ if (!threeD && applyBdry) { @@ -369,15 +369,15 @@ void generateStriped(MatGenFD mg, HYPRE_Int *rp, HYPRE_Int *cval, HYPRE_Real *av } -/* zero-based +/* zero-based (from Edmond Chow) */ -/* +/* x,y,z - coordinates of row, wrt naturally ordered grid nz, ny, nz - local grid dimensions, wrt 0 P, Q - subdomain grid dimensions in x and y directions */ -HYPRE_Int rownum(const bool threeD, const HYPRE_Int x, const HYPRE_Int y, const HYPRE_Int z, +HYPRE_Int rownum(const bool threeD, const HYPRE_Int x, const HYPRE_Int y, const HYPRE_Int z, const HYPRE_Int nx, const HYPRE_Int ny, const HYPRE_Int nz, HYPRE_Int P, HYPRE_Int Q) { HYPRE_Int p, q, r; @@ -417,8 +417,8 @@ if (myid_dh == 0) hypre_printf("x= %i y= %i z= %i threeD= %i p= %i q= %i r= %i lowerx = nx*p; lowery = ny*q; lowerz = nz*r; - - if (threeD) { + + if (threeD) { return startrow + nx*ny*(z-lowerz) + nx*(y-lowery) + (x-lowerx); } else { return startrow + nx*(y-lowery) + (x-lowerx); @@ -429,7 +429,7 @@ if (myid_dh == 0) hypre_printf("x= %i y= %i z= %i threeD= %i p= %i q= %i r= %i void getstencil(MatGenFD g, HYPRE_Int ix, HYPRE_Int iy, HYPRE_Int iz) { - HYPRE_Int k; + HYPRE_Int k; HYPRE_Real h = g->hh; HYPRE_Real hhalf = h*0.5; HYPRE_Real x = h*ix; @@ -492,10 +492,21 @@ void getstencil(MatGenFD g, HYPRE_Int ix, HYPRE_Int iy, HYPRE_Int iz) HYPRE_Real konstant(HYPRE_Real coeff, HYPRE_Real x, HYPRE_Real y, HYPRE_Real z) -{ return coeff; } +{ + HYPRE_UNUSED_VAR(coeff); + HYPRE_UNUSED_VAR(x); + HYPRE_UNUSED_VAR(y); + HYPRE_UNUSED_VAR(z); + + return coeff; +} HYPRE_Real e2_xy(HYPRE_Real coeff, HYPRE_Real x, HYPRE_Real y, HYPRE_Real z) -{ return exp(coeff*x*y); } +{ + HYPRE_UNUSED_VAR(z); + + return hypre_exp(coeff*x*y); +} HYPRE_Real boxThreeD(HYPRE_Real coeff, HYPRE_Real x, HYPRE_Real y, HYPRE_Real z); @@ -508,11 +519,11 @@ HYPRE_Real box_1(HYPRE_Real coeff, HYPRE_Real x, HYPRE_Real y, HYPRE_Real z) { static bool setup = false; HYPRE_Real retval = coeff; - + /* dffusivity constants */ static HYPRE_Real dd1 = BOX1_DD; static HYPRE_Real dd2 = BOX2_DD; - static HYPRE_Real dd3 = BOX3_DD; + static HYPRE_Real dd3 = BOX3_DD; /* boxes */ static HYPRE_Real ax1 = BOX1_X1, ay1 = BOX1_Y1; @@ -556,7 +567,7 @@ HYPRE_Real box_1(HYPRE_Real coeff, HYPRE_Real x, HYPRE_Real y, HYPRE_Real z) } return retval; -} +} HYPRE_Real boxThreeD(HYPRE_Real coeff, HYPRE_Real x, HYPRE_Real y, HYPRE_Real z) { @@ -583,7 +594,7 @@ HYPRE_Real boxThreeD(HYPRE_Real coeff, HYPRE_Real x, HYPRE_Real y, HYPRE_Real z) } return retval; -} +} #if 0 HYPRE_Real box_1(HYPRE_Real coeff, HYPRE_Real x, HYPRE_Real y, HYPRE_Real z) @@ -616,7 +627,7 @@ HYPRE_Real box_1(HYPRE_Real coeff, HYPRE_Real x, HYPRE_Real y, HYPRE_Real z) } return -1*retval; -} +} #endif /* divide square into 4 quadrants; return one of @@ -624,6 +635,9 @@ HYPRE_Real box_1(HYPRE_Real coeff, HYPRE_Real x, HYPRE_Real y, HYPRE_Real z) */ HYPRE_Real box_2(HYPRE_Real coeff, HYPRE_Real x, HYPRE_Real y, HYPRE_Real z) { + HYPRE_UNUSED_VAR(coeff); + HYPRE_UNUSED_VAR(z); + bool setup = false; static HYPRE_Real d1, d2; HYPRE_Real retval; @@ -661,7 +675,7 @@ void generateBlocked(MatGenFD mg, HYPRE_Int *rp, HYPRE_Int *cval, HYPRE_Real *av HYPRE_Int x, y, z; bool debug = false; HYPRE_Int idx = 0, localRow = 0; /* nabor; */ - HYPRE_Int naborx1, naborx2, nabory1, nabory2, naborz1, naborz2; + HYPRE_Int naborx1 = 0, naborx2 = 0, nabory1 = 0, nabory2 = 0, naborz1, naborz2; HYPRE_Real *rhs; HYPRE_Real hhalf = 0.5 * mg->hh; @@ -788,7 +802,7 @@ hypre_fprintf(logFile, "--- row: %i; x >= nx*px-1; nobors2 has old value: %i\n" rhs[localRow] = 0.0; ++localRow; - rp[localRow] = idx; + rp[localRow] = idx; /* apply boundary conditions; only for 2D! */ if (!threeD && applyBdry) { @@ -850,7 +864,7 @@ void setBoundary_private(HYPRE_Int node, HYPRE_Int *cval, HYPRE_Real *aval, HYPR /* case 1: Dirichlet Boundary condition */ if (bc >= 0) { - /* set all values to zero, set the diagonal to 1.0, set rhs to "bc" */ + /* set all values to zero, set the diagonal to 1.0, set rhs to "bc" */ *rhs = bc; for (i=0; im = 0; tmp->n = 0; - tmp->beg_row = 0; + tmp->beg_row = 0; tmp->bs = 1; tmp->rp = NULL; @@ -117,7 +117,7 @@ void Mat_dhDestroy(Mat_dh mat) Mat_dhMatVecSetdown(mat); CHECK_V_ERROR; } if (mat->numb != NULL) { Numbering_dhDestroy(mat->numb); CHECK_V_ERROR; } - FREE_DH(mat); CHECK_V_ERROR; + FREE_DH(mat); CHECK_V_ERROR; END_FUNC_DH } @@ -127,6 +127,8 @@ void Mat_dhDestroy(Mat_dh mat) #define __FUNC__ "Mat_dhMatVecSetDown" void Mat_dhMatVecSetdown(Mat_dh mat) { + HYPRE_UNUSED_VAR(mat); + START_FUNC_DH if (ignoreMe) SET_V_ERROR("not implemented"); END_FUNC_DH @@ -151,54 +153,54 @@ void Mat_dhMatVecSetup(Mat_dh mat) HYPRE_Int firstLocal = mat->beg_row; HYPRE_Int lastLocal = firstLocal+m; HYPRE_Int *beg_rows, *end_rows; - + mat->recv_req = (hypre_MPI_Request *)MALLOC_DH(np_dh * sizeof(hypre_MPI_Request)); CHECK_V_ERROR; mat->send_req = (hypre_MPI_Request *)MALLOC_DH(np_dh * sizeof(hypre_MPI_Request)); CHECK_V_ERROR; mat->status = (hypre_MPI_Status *)MALLOC_DH(np_dh * sizeof(hypre_MPI_Status)); CHECK_V_ERROR; beg_rows = (HYPRE_Int*)MALLOC_DH(np_dh*sizeof(HYPRE_Int)); CHECK_V_ERROR; end_rows = (HYPRE_Int*)MALLOC_DH(np_dh*sizeof(HYPRE_Int)); CHECK_V_ERROR; - + if (np_dh == 1) { /* this is for debugging purposes in some of the drivers */ beg_rows[0] = 0; end_rows[0] = m; } else { - ierr = hypre_MPI_Allgather(&firstLocal, 1, HYPRE_MPI_INT, beg_rows, 1, HYPRE_MPI_INT, comm_dh); - + ierr = hypre_MPI_Allgather(&firstLocal, 1, HYPRE_MPI_INT, beg_rows, 1, HYPRE_MPI_INT, comm_dh); + CHECK_MPI_V_ERROR(ierr); - + ierr = hypre_MPI_Allgather(&lastLocal, 1, HYPRE_MPI_INT, end_rows, 1, HYPRE_MPI_INT, comm_dh); CHECK_MPI_V_ERROR(ierr); } - + outlist = (HYPRE_Int *)MALLOC_DH(np_dh*sizeof(HYPRE_Int)); CHECK_V_ERROR; inlist = (HYPRE_Int *)MALLOC_DH(np_dh*sizeof(HYPRE_Int)); CHECK_V_ERROR; for (i=0; inumb)); CHECK_V_ERROR; numb = mat->numb; Numbering_dhSetup(numb, mat); CHECK_V_ERROR; - - setup_matvec_receives_private(mat, beg_rows, end_rows, numb->num_ext, + + setup_matvec_receives_private(mat, beg_rows, end_rows, numb->num_ext, numb->idx_ext, outlist); CHECK_V_ERROR; - + if (np_dh == 1) { /* this is for debugging purposes in some of the drivers */ inlist[0] = outlist[0]; } else { ierr = hypre_MPI_Alltoall(outlist, 1, HYPRE_MPI_INT, inlist, 1, HYPRE_MPI_INT, comm_dh); CHECK_MPI_V_ERROR(ierr); } - + setup_matvec_sends_private(mat, inlist); CHECK_V_ERROR; - + /* Convert to local indices */ for (row=0; rowrecvbuf = (HYPRE_Real*)MALLOC_DH((reqlen+m) * sizeof(HYPRE_Real)); - for (i=0; iaval; HYPRE_Int *sendind = mat->sendind; HYPRE_Int sendlen = mat->sendlen; - HYPRE_Real *sendbuf = mat->sendbuf; + HYPRE_Real *sendbuf = mat->sendbuf; HYPRE_Real *recvbuf = mat->recvbuf; HYPRE_Real t1 = 0, t2 = 0, t3 = 0, t4 = 0; bool timeFlag = mat->matvec_timing; - - + + if (timeFlag) t1 = hypre_MPI_Wtime(); - + /* Put components of x into the right outgoing buffers */ if (! commsOnly) { - for (i=0; itime[MATVEC_TIME] += (t2 - t1); - + } - + ierr = hypre_MPI_Startall(mat->num_recv, mat->recv_req); CHECK_MPI_V_ERROR(ierr); ierr = hypre_MPI_Startall(mat->num_send, mat->send_req); CHECK_MPI_V_ERROR(ierr); ierr = hypre_MPI_Waitall(mat->num_recv, mat->recv_req, mat->status); CHECK_MPI_V_ERROR(ierr); ierr = hypre_MPI_Waitall(mat->num_send, mat->send_req, mat->status); CHECK_MPI_V_ERROR(ierr); - - + + if (timeFlag) { t3 = hypre_MPI_Wtime(); mat->time[MATVEC_MPI_TIME] += (t3 - t2); } - + /* Copy local part of x into top part of recvbuf */ if (! commsOnly) { for (i=0; itime[MATVEC_TOTAL_TIME] += (t4 - t1); @@ -390,7 +392,7 @@ void Mat_dhMatVec_omp(Mat_dh mat, HYPRE_Real *x, HYPRE_Real *b) HYPRE_Real *aval = mat->aval; HYPRE_Int *sendind = mat->sendind; HYPRE_Int sendlen = mat->sendlen; - HYPRE_Real *sendbuf = mat->sendbuf; + HYPRE_Real *sendbuf = mat->sendbuf; HYPRE_Real *recvbuf = mat->recvbuf; HYPRE_Real t1 = 0, t2 = 0, t3 = 0, t4 = 0, tx = 0; HYPRE_Real *val, temp; @@ -403,7 +405,7 @@ void Mat_dhMatVec_omp(Mat_dh mat, HYPRE_Real *x, HYPRE_Real *b) #ifdef USING_OPENMP_DH #pragma omp parallel for schedule(runtime) private(i) #endif - for (i=0; im, A->beg_row, A->rp, A->cval, + mat_dh_print_graph_private(A->m, A->beg_row, A->rp, A->cval, A->aval, NULL, NULL, NULL, fp); CHECK_V_ERROR; } else { HYPRE_Int beg_row = sg->beg_rowP[myid_dh]; - mat_dh_print_graph_private(A->m, beg_row, A->rp, A->cval, + mat_dh_print_graph_private(A->m, beg_row, A->rp, A->cval, A->aval, sg->n2o_row, sg->o2n_col, sg->o2n_ext, fp); CHECK_V_ERROR; } } @@ -686,14 +688,14 @@ void Mat_dhPrintGraph(Mat_dh A, SubdomainGraph_dh sg, FILE *fp) void Mat_dhPrintRows(Mat_dh A, SubdomainGraph_dh sg, FILE *fp) { START_FUNC_DH - bool noValues; + bool noValues; HYPRE_Int m = A->m, *rp = A->rp, *cval = A->cval; HYPRE_Real *aval = A->aval; noValues = (Parser_dhHasSwitch(parser_dh, "-noValues")); if (noValues) aval = NULL; - /*---------------------------------------------------------------- + /*---------------------------------------------------------------- * case 1: print local portion of unpermuted matrix *----------------------------------------------------------------*/ if (sg == NULL) { @@ -714,7 +716,7 @@ void Mat_dhPrintRows(Mat_dh A, SubdomainGraph_dh sg, FILE *fp) } } - /*---------------------------------------------------------------- + /*---------------------------------------------------------------- * case 2: single mpi task, with multiple subdomains *----------------------------------------------------------------*/ else if (np_dh == 1) { @@ -733,7 +735,7 @@ void Mat_dhPrintRows(Mat_dh A, SubdomainGraph_dh sg, FILE *fp) hypre_fprintf(fp, "\n"); hypre_fprintf(fp, "\n----- A, permuted, single mpi task ------------------\n"); hypre_fprintf(fp, "---- new subdomain: %i; old subdomain: %i\n", i, oldBlock); - hypre_fprintf(fp, " old beg_row: %i; new beg_row: %i\n", + hypre_fprintf(fp, " old beg_row: %i; new beg_row: %i\n", sg->beg_row[oldBlock], sg->beg_rowP[oldBlock]); hypre_fprintf(fp, " local rows in this block: %i\n", sg->row_count[oldBlock]); hypre_fprintf(fp, " bdry rows in this block: %i\n", sg->bdry_count[oldBlock]); @@ -749,7 +751,7 @@ void Mat_dhPrintRows(Mat_dh A, SubdomainGraph_dh sg, FILE *fp) for (k=0; ko2n_col[cval[k]]); + hypre_fprintf(fp, "%i ", 1+sg->o2n_col[cval[k]]); } else { hypre_fprintf(fp, "%i,%g ; ", 1+sg->o2n_col[cval[k]], aval[k]); } @@ -761,7 +763,7 @@ void Mat_dhPrintRows(Mat_dh A, SubdomainGraph_dh sg, FILE *fp) } } - /*---------------------------------------------------------------- + /*---------------------------------------------------------------- * case 3: multiple mpi tasks, one subdomain per task *----------------------------------------------------------------*/ else { @@ -781,14 +783,14 @@ void Mat_dhPrintRows(Mat_dh A, SubdomainGraph_dh sg, FILE *fp) /* case i: column is locally owned */ if (col >= beg_row && col < beg_row+m) { col = o2n_col[col-beg_row] + beg_rowP; - } + } /* case ii: column is external */ else { HYPRE_Int tmp = col; tmp = Hash_i_dhLookup(hash, col); CHECK_V_ERROR; - if (tmp == -1) { - hypre_sprintf(msgBuf_dh, "nonlocal column= %i not in hash table", 1+col); + if (tmp == -1) { + hypre_sprintf(msgBuf_dh, "nonlocal column= %i not in hash table", 1+col); SET_V_ERROR(msgBuf_dh); } else { col = tmp; @@ -816,7 +818,7 @@ void Mat_dhPrintTriples(Mat_dh A, SubdomainGraph_dh sg, char *filename) START_FUNC_DH HYPRE_Int m = A->m, *rp = A->rp, *cval = A->cval; HYPRE_Real *aval = A->aval; - bool noValues; + bool noValues; bool matlab; FILE *fp; @@ -824,7 +826,7 @@ void Mat_dhPrintTriples(Mat_dh A, SubdomainGraph_dh sg, char *filename) if (noValues) aval = NULL; matlab = (Parser_dhHasSwitch(parser_dh, "-matlab")); - /*---------------------------------------------------------------- + /*---------------------------------------------------------------- * case 1: unpermuted matrix, single or multiple mpi tasks *----------------------------------------------------------------*/ if (sg == NULL) { @@ -833,11 +835,11 @@ void Mat_dhPrintTriples(Mat_dh A, SubdomainGraph_dh sg, char *filename) HYPRE_Real val; for (pe=0; pen2o_row[j]; Mat_dhGetRow(A, oldRow, &len, &cval, &aval); CHECK_V_ERROR; - + if (noValues) { for (k=0; ko2n_col[cval[k]]); @@ -897,7 +899,7 @@ void Mat_dhPrintTriples(Mat_dh A, SubdomainGraph_dh sg, char *filename) } } - /*---------------------------------------------------------------- + /*---------------------------------------------------------------- * case 3: multiple mpi tasks, one subdomain per task *----------------------------------------------------------------*/ else { @@ -911,10 +913,10 @@ void Mat_dhPrintTriples(Mat_dh A, SubdomainGraph_dh sg, char *filename) for (pe=0; pe= beg_row && col < beg_row+m) { col = o2n_col[col-beg_row] + beg_rowP; - } + } /* case ii: column is external */ else { HYPRE_Int tmp = col; tmp = Hash_i_dhLookup(hash, col); CHECK_V_ERROR; - if (tmp == -1) { - hypre_sprintf(msgBuf_dh, "nonlocal column= %i not in hash table", 1+col); + if (tmp == -1) { + hypre_sprintf(msgBuf_dh, "nonlocal column= %i not in hash table", 1+col); SET_V_ERROR(msgBuf_dh); } else { col = tmp; @@ -1026,7 +1028,7 @@ void Mat_dhReadCSR(Mat_dh *mat, char *filename) } fp=openFile_dh(filename, "r"); CHECK_V_ERROR; - + Mat_dhCreate(&A); CHECK_V_ERROR; mat_dh_read_csr_private(&A->m, &A->rp, &A->cval, &A->aval, fp); CHECK_V_ERROR; A->n = A->m; @@ -1089,7 +1091,7 @@ void Mat_dhTranspose(Mat_dh A, Mat_dh *Bout) START_FUNC_DH Mat_dh B; - if (np_dh > 1) { SET_V_ERROR("only for sequential"); } + if (np_dh > 1) { SET_V_ERROR("only for sequential"); } Mat_dhCreate(&B); CHECK_V_ERROR; *Bout = B; @@ -1104,7 +1106,7 @@ void Mat_dhTranspose(Mat_dh A, Mat_dh *Bout) void Mat_dhMakeStructurallySymmetric(Mat_dh A) { START_FUNC_DH - if (np_dh > 1) { SET_V_ERROR("only for sequential"); } + if (np_dh > 1) { SET_V_ERROR("only for sequential"); } make_symmetric_private(A->m, &A->rp, &A->cval, &A->aval); CHECK_V_ERROR; END_FUNC_DH } @@ -1151,7 +1153,7 @@ void Mat_dhFixDiags(Mat_dh A) for (i=0; ibeg_row; @@ -1242,15 +1244,21 @@ void Mat_dhGetRow(Mat_dh B, HYPRE_Int globalRow, HYPRE_Int *len, HYPRE_Int **ind SET_V_ERROR(msgBuf_dh); } *len = B->rp[row+1] - B->rp[row]; - if (ind != NULL) *ind = B->cval + B->rp[row]; - if (val != NULL) *val = B->aval + B->rp[row]; + if (ind != NULL) *ind = B->cval + B->rp[row]; + if (val != NULL) *val = B->aval + B->rp[row]; END_FUNC_DH } #undef __FUNC__ #define __FUNC__ "Mat_dhRestoreRow" -void Mat_dhRestoreRow(Mat_dh B, HYPRE_Int row, HYPRE_Int *len, HYPRE_Int **ind, HYPRE_Real **val) +void Mat_dhRestoreRow(Mat_dh B, HYPRE_Int row, HYPRE_Int *len, HYPRE_Int **ind, HYPRE_Real **val) { + HYPRE_UNUSED_VAR(B); + HYPRE_UNUSED_VAR(row); + HYPRE_UNUSED_VAR(len); + HYPRE_UNUSED_VAR(ind); + HYPRE_UNUSED_VAR(val); + START_FUNC_DH END_FUNC_DH } @@ -1259,6 +1267,8 @@ void Mat_dhRestoreRow(Mat_dh B, HYPRE_Int row, HYPRE_Int *len, HYPRE_Int **ind, #define __FUNC__ "Mat_dhRowPermute" void Mat_dhRowPermute(Mat_dh mat) { + HYPRE_UNUSED_VAR(mat); + START_FUNC_DH if (ignoreMe) SET_V_ERROR("turned off; compilation problem on blue"); @@ -1276,7 +1286,7 @@ void Mat_dhRowPermute(Mat_dh mat) * permuted matrix has as many entries on its diagonal as * possible. The values on the diagonal are of arbitrary size. * HSL subroutine MC21A/AD is used for this. - * = 2 : Compute a row permutation of the matrix so that the smallest + * = 2 : Compute a row permutation of the matrix so that the smallest * value on the diagonal of the permuted matrix is maximized. * = 3 : Compute a row permutation of the matrix so that the smallest * value on the diagonal of the permuted matrix is maximized. @@ -1286,9 +1296,9 @@ void Mat_dhRowPermute(Mat_dh mat) * of the diagonal entries of the permuted matrix is maximized. * = 5 : Compute a row permutation of the matrix so that the product * of the diagonal entries of the permuted matrix is maximized - * and vectors to scale the matrix so that the nonzero diagonal - * entries of the permuted matrix are one in absolute value and - * all the off-diagonal entries are less than or equal to one in + * and vectors to scale the matrix so that the nonzero diagonal + * entries of the permuted matrix are one in absolute value and + * all the off-diagonal entries are less than or equal to one in * absolute value. #endif @@ -1401,9 +1411,16 @@ void build_adj_lists_private(Mat_dh mat, HYPRE_Int **rpOUT, HYPRE_Int **cvalOUT) #undef __FUNC__ #define __FUNC__ "Mat_dhPartition" -void Mat_dhPartition(Mat_dh mat, HYPRE_Int blocks, +void Mat_dhPartition(Mat_dh mat, HYPRE_Int blocks, HYPRE_Int **beg_rowOUT, HYPRE_Int **row_countOUT, HYPRE_Int **n2oOUT, HYPRE_Int **o2nOUT) { + HYPRE_UNUSED_VAR(mat); + HYPRE_UNUSED_VAR(blocks); + HYPRE_UNUSED_VAR(beg_rowOUT); + HYPRE_UNUSED_VAR(row_countOUT); + HYPRE_UNUSED_VAR(n2oOUT); + HYPRE_UNUSED_VAR(o2nOUT); + START_FUNC_DH #ifndef HAVE_METIS_DH @@ -1434,11 +1451,11 @@ NULL, NULL, 0 /*no edge or vertex weights*/ 0 /*use zero-based numbering*/ blocksIN, -options[5] = +options[5] = 0 :: 0/1 use defauls; use uptions 1..4 - 1 :: + 1 :: edgecutOUT, -part[] +part[] ============================================================= #endif diff --git a/external/hypre/src/distributed_ls/Euclid/Mat_dh.h b/external/hypre/src/distributed_ls/Euclid/Mat_dh.h index df1f59e7..32e14e2c 100644 --- a/external/hypre/src/distributed_ls/Euclid/Mat_dh.h +++ b/external/hypre/src/distributed_ls/Euclid/Mat_dh.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/Euclid/Mem_dh.c b/external/hypre/src/distributed_ls/Euclid/Mem_dh.c index bd2ebb10..4c781798 100644 --- a/external/hypre/src/distributed_ls/Euclid/Mem_dh.c +++ b/external/hypre/src/distributed_ls/Euclid/Mem_dh.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -14,8 +14,8 @@ */ - /* a memRecord_dh is pre and post-pended to every - * piece of memory obtained by calling MALLOC_DH + /* a memRecord_dh is pre and post-pended to every + * piece of memory obtained by calling MALLOC_DH */ typedef struct { HYPRE_Real size; @@ -80,7 +80,7 @@ void* Mem_dhMalloc(Mem_dh m, size_t size) retval = (char*)address + sizeof(memRecord_dh); - /* we prepend and postpend a private record to the + /* we prepend and postpend a private record to the * requested chunk of memory; this permits tracking the * sizes of freed memory, along with other rudimentary * error checking. This is modeled after the PETSc code. @@ -101,13 +101,15 @@ void* Mem_dhMalloc(Mem_dh m, size_t size) #define __FUNC__ "Mem_dhFree" void Mem_dhFree(Mem_dh m, void *ptr) { + HYPRE_UNUSED_VAR(m); + START_FUNC_DH_2 HYPRE_Real size; char *tmp = (char*)ptr; memRecord_dh *rec; tmp -= sizeof(memRecord_dh); rec = (memRecord_dh*)tmp; - size = rec->size; + size = rec->size; mem_dh->curMem -= size; mem_dh->freeCount += 1; @@ -128,13 +130,13 @@ void Mem_dhPrint(Mem_dh m, FILE* fp, bool allPrint) hypre_fprintf(fp, "---------------------- Euclid memory report (start)\n"); hypre_fprintf(fp, "malloc calls = %g\n", m->mallocCount); hypre_fprintf(fp, "free calls = %g\n", m->freeCount); - hypre_fprintf(fp, "curMem = %g Mbytes (should be zero)\n", + hypre_fprintf(fp, "curMem = %g Mbytes (should be zero)\n", m->curMem/1000000); tmp = m->totalMem / 1000000; hypre_fprintf(fp, "total allocated = %g Mbytes\n", tmp); hypre_fprintf(fp, "max malloc = %g Mbytes (max allocated at any point in time)\n", m->maxMem/1000000); hypre_fprintf(fp, "\n"); hypre_fprintf(fp, "---------------------- Euclid memory report (end)\n"); - } + } END_FUNC_DH_2 } diff --git a/external/hypre/src/distributed_ls/Euclid/Mem_dh.h b/external/hypre/src/distributed_ls/Euclid/Mem_dh.h index 82e3cb12..e3cb3e3a 100644 --- a/external/hypre/src/distributed_ls/Euclid/Mem_dh.h +++ b/external/hypre/src/distributed_ls/Euclid/Mem_dh.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/Euclid/Numbering_dh.c b/external/hypre/src/distributed_ls/Euclid/Numbering_dh.c index 9581e84e..6ada09d4 100644 --- a/external/hypre/src/distributed_ls/Euclid/Numbering_dh.c +++ b/external/hypre/src/distributed_ls/Euclid/Numbering_dh.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -108,7 +108,7 @@ void Numbering_dhSetup(Numbering_dh numb, Mat_dh mat) */ /* RL : why ``m+num_ext'' instead of ``num_ext+1'' ??? */ if (m+num_ext >= size) { - HYPRE_Int newSize = hypre_max(m+num_ext+1, size*1.5); /* heuristic */ + HYPRE_Int newSize = (HYPRE_Int)hypre_max(m+num_ext+1, size*1.5); /* heuristic */ HYPRE_Int *tmp = (HYPRE_Int*)MALLOC_DH(newSize*sizeof(HYPRE_Int)); CHECK_V_ERROR; hypre_TMemcpy(tmp, idx_ext, size, size, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); FREE_DH(idx_ext); CHECK_V_ERROR; diff --git a/external/hypre/src/distributed_ls/Euclid/Numbering_dh.h b/external/hypre/src/distributed_ls/Euclid/Numbering_dh.h index ab915eac..e0ca7008 100644 --- a/external/hypre/src/distributed_ls/Euclid/Numbering_dh.h +++ b/external/hypre/src/distributed_ls/Euclid/Numbering_dh.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/Euclid/Parser_dh.c b/external/hypre/src/distributed_ls/Euclid/Parser_dh.c index 51d45283..d95d6c75 100644 --- a/external/hypre/src/distributed_ls/Euclid/Parser_dh.c +++ b/external/hypre/src/distributed_ls/Euclid/Parser_dh.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -200,7 +200,7 @@ bool Parser_dhReadDouble(Parser_dh p,const char* in, HYPRE_Real *out) OptionsNode *node; if (p != NULL && find(p,in,&node)) { - *out = atof(node->value); + *out = (HYPRE_Real)atof(node->value); optionExists = true; } END_FUNC_VAL_2(optionExists) diff --git a/external/hypre/src/distributed_ls/Euclid/Parser_dh.h b/external/hypre/src/distributed_ls/Euclid/Parser_dh.h index 2a91f948..35603900 100644 --- a/external/hypre/src/distributed_ls/Euclid/Parser_dh.h +++ b/external/hypre/src/distributed_ls/Euclid/Parser_dh.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/Euclid/README.hypre b/external/hypre/src/distributed_ls/Euclid/README.hypre index 17f4a825..4cfd585b 100644 --- a/external/hypre/src/distributed_ls/Euclid/README.hypre +++ b/external/hypre/src/distributed_ls/Euclid/README.hypre @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/Euclid/SortedList_dh.c b/external/hypre/src/distributed_ls/Euclid/SortedList_dh.c index 0e840b7f..6a27c90d 100644 --- a/external/hypre/src/distributed_ls/Euclid/SortedList_dh.c +++ b/external/hypre/src/distributed_ls/Euclid/SortedList_dh.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -173,7 +173,7 @@ bool SortedList_dhPermuteAndInsert(SortedList_dh sList, SRecord *sr, HYPRE_Real START_FUNC_DH bool wasInserted = false; HYPRE_Int col = sr->col; - HYPRE_Real testVal = fabs(sr->val); + HYPRE_Real testVal = hypre_abs(sr->val); HYPRE_Int beg_row = sList->beg_row, end_row = beg_row + sList->m; HYPRE_Int beg_rowP = sList->beg_rowP; diff --git a/external/hypre/src/distributed_ls/Euclid/SortedList_dh.h b/external/hypre/src/distributed_ls/Euclid/SortedList_dh.h index 95a897e9..e357e18d 100644 --- a/external/hypre/src/distributed_ls/Euclid/SortedList_dh.h +++ b/external/hypre/src/distributed_ls/Euclid/SortedList_dh.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/Euclid/SortedSet_dh.c b/external/hypre/src/distributed_ls/Euclid/SortedSet_dh.c index 6afc27f9..d2a92af8 100644 --- a/external/hypre/src/distributed_ls/Euclid/SortedSet_dh.c +++ b/external/hypre/src/distributed_ls/Euclid/SortedSet_dh.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/Euclid/SortedSet_dh.h b/external/hypre/src/distributed_ls/Euclid/SortedSet_dh.h index 930667c4..476548b6 100644 --- a/external/hypre/src/distributed_ls/Euclid/SortedSet_dh.h +++ b/external/hypre/src/distributed_ls/Euclid/SortedSet_dh.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/Euclid/SubdomainGraph_dh.c b/external/hypre/src/distributed_ls/Euclid/SubdomainGraph_dh.c index ae083a29..190f9bc5 100644 --- a/external/hypre/src/distributed_ls/Euclid/SubdomainGraph_dh.c +++ b/external/hypre/src/distributed_ls/Euclid/SubdomainGraph_dh.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -164,8 +164,8 @@ hypre_fprintf(stderr, "blocks= %i\n", blocks); void SubdomainGraph_dhPrintStatsLong(SubdomainGraph_dh s, FILE *fp) { START_FUNC_DH - HYPRE_Int i, j, k; - HYPRE_Real max = 0, min = INT_MAX; + HYPRE_Int i, j, k; + HYPRE_Real max = 0, min = (HYPRE_Real) INT_MAX; hypre_fprintf(fp, "\n------------- SubdomainGraph_dhPrintStatsLong -----------\n"); hypre_fprintf(fp, "colors used = %i\n", s->colors); @@ -243,7 +243,7 @@ void SubdomainGraph_dhPrintStatsLong(SubdomainGraph_dh s, FILE *fp) } else { /*----------------------------------------- - * local n2o_row permutation + * local n2o_row permutation *-----------------------------------------*/ hypre_fprintf(fp, "\nlocal n2o_row permutation:\n"); hypre_fprintf(fp, "--------------------------\n"); @@ -529,7 +529,7 @@ void init_mpi_private(SubdomainGraph_dh s, HYPRE_Int blocks, bool bj, void *A) t1 = hypre_MPI_Wtime(); if (!bj) { HYPRE_Int *interiorNodes, *bdryNodes; - HYPRE_Int interiorCount, bdryCount; + HYPRE_Int interiorCount = 0, bdryCount; HYPRE_Int *o2n = s->o2n_col, idx; HYPRE_Int i; @@ -828,6 +828,8 @@ void form_subdomaingraph_mpi_private(SubdomainGraph_dh s) #define __FUNC__ "form_subdomaingraph_seq_private" void form_subdomaingraph_seq_private(SubdomainGraph_dh s, HYPRE_Int m, void *A) { + HYPRE_UNUSED_VAR(m); + START_FUNC_DH HYPRE_Int *dense, i, j, row, blocks = s->blocks; HYPRE_Int *cval, len, *adj; @@ -924,6 +926,8 @@ void find_all_neighbors_sym_private(SubdomainGraph_dh s, HYPRE_Int m, void *A) #define __FUNC__ "find_all_neighbors_unsym_private" void find_all_neighbors_unsym_private(SubdomainGraph_dh s, HYPRE_Int m, void *A) { + HYPRE_UNUSED_VAR(m); + START_FUNC_DH HYPRE_Int i, j, row, beg_row, end_row; HYPRE_Int *marker; @@ -1022,6 +1026,8 @@ void find_bdry_nodes_sym_private(SubdomainGraph_dh s, HYPRE_Int m, void* A, HYPRE_Int *interiorNodes, HYPRE_Int *bdryNodes, HYPRE_Int *interiorCount, HYPRE_Int *bdryCount) { + HYPRE_UNUSED_VAR(m); + START_FUNC_DH HYPRE_Int beg_row = s->beg_row[myid_dh]; HYPRE_Int end_row = beg_row + s->row_count[myid_dh]; @@ -1427,7 +1433,7 @@ void SubdomainGraph_dhDump(SubdomainGraph_dh s, char *filename) hypre_fprintf(fp, "%i ", s->bdry_count[i]); } hypre_fprintf(fp, "\n"); - + } /* write subdomain graph */ @@ -1567,7 +1573,7 @@ void find_bdry_nodes_seq_private(SubdomainGraph_dh s, HYPRE_Int m, void* A) tmp = (HYPRE_Int*)MALLOC_DH(m*sizeof(HYPRE_Int)); CHECK_V_ERROR; for (i=0; isc_clk_tck); SET_INFO(msgBuf_dh); -#elif defined(hypre_MPI_TIMING) +#elif defined(hypre_MPI_TIMING) SET_INFO("using MPI timing") #else SET_INFO("using JUNK timing") @@ -47,7 +47,7 @@ void Timer_dhDestroy(Timer_dh t) } /*------------------------------------------------------------------------------- - * EUCLID_TIMING timing methods; these use times() to record + * EUCLID_TIMING timing methods; these use times() to record * both wall and cpu time. *-------------------------------------------------------------------------------*/ @@ -108,12 +108,12 @@ HYPRE_Real Timer_dhReadUsage(Timer_dh t) START_FUNC_DH HYPRE_Real cpu = Timer_dhReadCPU(t); HYPRE_Real wall = Timer_dhReadWall(t); - HYPRE_Real retval = 100.0*cpu/wall; + HYPRE_Real retval = 100.0*cpu/wall; END_FUNC_VAL(retval); } /*------------------------------------------------------------------------------- - * Parallel timing functions; these use hypre_MPI_Wtime() to record + * Parallel timing functions; these use hypre_MPI_Wtime() to record * wall-clock time only. *-------------------------------------------------------------------------------*/ @@ -177,6 +177,8 @@ HYPRE_Real Timer_dhReadUsage(Timer_dh t) #define __FUNC__ "Timer_dhStart" void Timer_dhStart(Timer_dh t) { + HYPRE_UNUSED_VAR(t); + START_FUNC_DH END_FUNC_DH } @@ -185,6 +187,8 @@ void Timer_dhStart(Timer_dh t) #define __FUNC__ "Timer_dhStop" void Timer_dhStop(Timer_dh t) { + HYPRE_UNUSED_VAR(t); + START_FUNC_DH END_FUNC_DH } @@ -193,6 +197,8 @@ void Timer_dhStop(Timer_dh t) #define __FUNC__ "Timer_dhReadWall" HYPRE_Real Timer_dhReadWall(Timer_dh t) { + HYPRE_UNUSED_VAR(t); + START_FUNC_DH END_FUNC_VAL(-1.0) } @@ -201,6 +207,8 @@ HYPRE_Real Timer_dhReadWall(Timer_dh t) #define __FUNC__ "Timer_dhReadCPU" HYPRE_Real Timer_dhReadCPU(Timer_dh t) { + HYPRE_UNUSED_VAR(t); + START_FUNC_DH END_FUNC_VAL(-1.0) } @@ -209,6 +217,8 @@ HYPRE_Real Timer_dhReadCPU(Timer_dh t) #define __FUNC__ "Timer_dhReadUsage" HYPRE_Real Timer_dhReadUsage(Timer_dh t) { + HYPRE_UNUSED_VAR(t); + START_FUNC_DH END_FUNC_VAL(-1.0); } diff --git a/external/hypre/src/distributed_ls/Euclid/Timer_dh.h b/external/hypre/src/distributed_ls/Euclid/Timer_dh.h index 1fe4f921..255af5b6 100644 --- a/external/hypre/src/distributed_ls/Euclid/Timer_dh.h +++ b/external/hypre/src/distributed_ls/Euclid/Timer_dh.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/Euclid/Vec_dh.c b/external/hypre/src/distributed_ls/Euclid/Vec_dh.c index 515e5696..ddf5b4cb 100644 --- a/external/hypre/src/distributed_ls/Euclid/Vec_dh.c +++ b/external/hypre/src/distributed_ls/Euclid/Vec_dh.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -29,7 +29,9 @@ void Vec_dhCreate(Vec_dh *v) void Vec_dhDestroy(Vec_dh v) { START_FUNC_DH - if (v->vals != NULL) FREE_DH(v->vals); CHECK_V_ERROR; + if (v->vals != NULL) { + FREE_DH(v->vals); CHECK_V_ERROR; + } FREE_DH(v); CHECK_V_ERROR; END_FUNC_DH } @@ -213,7 +215,7 @@ void Vec_dhPrintBIN(Vec_dh v, SubdomainGraph_dh sg, char *filename) void Vec_dhRead(Vec_dh *vout, HYPRE_Int ignore, char *filename) { START_FUNC_DH - Vec_dh tmp; + Vec_dh tmp = 0; FILE *fp; HYPRE_Int items, n, i; HYPRE_Real *v, w; @@ -283,7 +285,7 @@ extern void Vec_dhReadBIN(Vec_dh *vout, char *filename) { START_FUNC_DH - Vec_dh tmp; + Vec_dh tmp = 0; Vec_dhCreate(&tmp); CHECK_V_ERROR; *vout = tmp; diff --git a/external/hypre/src/distributed_ls/Euclid/Vec_dh.h b/external/hypre/src/distributed_ls/Euclid/Vec_dh.h index a88336ce..fca8056c 100644 --- a/external/hypre/src/distributed_ls/Euclid/Vec_dh.h +++ b/external/hypre/src/distributed_ls/Euclid/Vec_dh.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/Euclid/_hypre_Euclid.h b/external/hypre/src/distributed_ls/Euclid/_hypre_Euclid.h index 3477d98f..6566d503 100644 --- a/external/hypre/src/distributed_ls/Euclid/_hypre_Euclid.h +++ b/external/hypre/src/distributed_ls/Euclid/_hypre_Euclid.h @@ -24,7 +24,7 @@ extern "C" { #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -150,7 +150,7 @@ you need to write EUCLID_GET_ROW() functions: see src/getRow.c #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -180,11 +180,8 @@ you need to write EUCLID_GET_ROW() functions: see src/getRow.c #endif /* used in Mat_SEQ_PrintTriples, so matlab won't discard zeros (yuck!) */ -#ifdef HYPRE_SINGLE -#define _MATLAB_ZERO_ 1e-30 -#else // default -#define _MATLAB_ZERO_ 1e-100 -#endif +#define _MATLAB_ZERO_ HYPRE_REAL_MIN + /*---------------------------------------------------------------------- @@ -339,7 +336,7 @@ you need to write EUCLID_GET_ROW() functions: see src/getRow.c #endif /* #ifndef MACROS_DH */ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -458,7 +455,7 @@ extern char msgBuf_dh[MSG_BUF_SIZE_DH]; * enabled when compiled with the debugging (-g) option. */ extern void openLogfile_dh(HYPRE_Int argc, char *argv[]); -extern void closeLogfile_dh(); +extern void closeLogfile_dh(void); extern bool logInfoToStderr; extern bool logInfoToFile; extern bool logFuncsToStderr; @@ -470,8 +467,8 @@ extern void dh_EndFunc(const char *function, HYPRE_Int priority); extern void printFunctionStack(FILE *fp); extern void EuclidInitialize(HYPRE_Int argc, char *argv[], char *help); /* instantiates global objects */ -extern void EuclidFinalize(); /* deletes global objects */ -extern bool EuclidIsInitialized(); +extern void EuclidFinalize(void); /* deletes global objects */ +extern bool EuclidIsInitialized(void); extern void printf_dh(const char *fmt, ...); extern void fprintf_dh(FILE *fp, const char *fmt, ...); @@ -483,7 +480,7 @@ extern void echoInvocation_dh(MPI_Comm comm, char *prefix, HYPRE_Int argc, char #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -553,7 +550,7 @@ struct _extrows_dh { #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -647,7 +644,7 @@ extern void Factor_dhPrintRows(Factor_dh mat, FILE *fp); #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -689,7 +686,7 @@ extern void Vec_dhPrint(Vec_dh v, SubdomainGraph_dh sg, char *filename); extern void Vec_dhPrintBIN(Vec_dh v, SubdomainGraph_dh sg, char *filename); #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -827,7 +824,7 @@ extern HYPRE_Real box_2(HYPRE_Real coeff, HYPRE_Real x, HYPRE_Real y, HYPRE_Real #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -979,7 +976,7 @@ extern void dldperm(HYPRE_Int job, HYPRE_Int n, HYPRE_Int nnz, HYPRE_Int colptr[ #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -1097,7 +1094,7 @@ extern void SubdomainGraph_dhPrintStats(SubdomainGraph_dh sg, FILE *fp); #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -1126,7 +1123,7 @@ extern void TimeLog_dhPrint(TimeLog_dh t, FILE *fp, bool allPrint); #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -1151,7 +1148,7 @@ extern void SortedSet_dhGetList(SortedSet_dh ss, HYPRE_Int **list, HYPRE_Int *co #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -1178,7 +1175,7 @@ extern void Mem_dhPrint(Mem_dh m, FILE* fp, bool allPrint); #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -1200,7 +1197,7 @@ extern void shellSort_int_int_float(HYPRE_Int n, HYPRE_Int *x, HYPRE_Int *y, HYP #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -1250,7 +1247,7 @@ extern void Numbering_dhGlobalToLocal(Numbering_dh numb, HYPRE_Int len, #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -1293,7 +1290,7 @@ extern HYPRE_Int Hash_i_dhLookup(Hash_i_dh h, HYPRE_Int key); #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -1380,7 +1377,7 @@ extern HYPRE_Real Timer_dhReadUsage(Timer_dh t); #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -1449,7 +1446,7 @@ extern void Parser_dhInit(Parser_dh p, HYPRE_Int argc, char *argv[]); #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -1534,7 +1531,7 @@ extern void SortedList_dhUpdateVal(SortedList_dh sList, SRecord *sr); #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -1596,7 +1593,7 @@ extern void Hash_dhPrint(Hash_dh h, FILE *fp); #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -1720,7 +1717,7 @@ extern void make_symmetric_private(HYPRE_Int m, HYPRE_Int **rp, HYPRE_Int **cval #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -1746,7 +1743,7 @@ extern void PrintMatUsingGetRow(void* A, HYPRE_Int beg_row, HYPRE_Int m, #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -1787,7 +1784,7 @@ extern void ilut_seq(Euclid_dh ctx); #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -1946,7 +1943,7 @@ struct _mpi_interface_dh { #endif /* #ifndef EUCLID_MPI_INTERFACE_DH */ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -1965,14 +1962,14 @@ extern void cg_euclid(Mat_dh A, Euclid_dh ctx, HYPRE_Real *x, HYPRE_Real *b, #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ /* - Note: this module contains functionality for reading/writing + Note: this module contains functionality for reading/writing Euclid's binary io format, and opening and closing files. Additional io can be found in in mat_dh_private, which contains private functions for reading/writing various matrix and @@ -1995,11 +1992,11 @@ extern void closeFile_dh(FILE *fpIN); * binary io; these are called by functions in mat_dh_private *---------------------------------------------------------------------------*/ -bool isSmallEndian(); +bool isSmallEndian(void); /* seq only ?? */ extern void io_dh_print_ebin_mat_private(HYPRE_Int m, HYPRE_Int beg_row, - HYPRE_Int *rp, HYPRE_Int *cval, HYPRE_Real *aval, + HYPRE_Int *rp, HYPRE_Int *cval, HYPRE_Real *aval, HYPRE_Int *n2o, HYPRE_Int *o2n, Hash_i_dh hash, char *filename); /* seq only ?? */ @@ -2016,7 +2013,7 @@ extern void io_dh_read_ebin_vec_private(HYPRE_Int *n, HYPRE_Real **vals, char *f #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/Euclid/blas_dh.c b/external/hypre/src/distributed_ls/Euclid/blas_dh.c index 8a0d2dd8..a75cbc5d 100644 --- a/external/hypre/src/distributed_ls/Euclid/blas_dh.c +++ b/external/hypre/src/distributed_ls/Euclid/blas_dh.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -144,6 +144,6 @@ HYPRE_Real Norm2(HYPRE_Int n, HYPRE_Real *x) } else { result = local_result; } - result = sqrt(result); + result = hypre_sqrt(result); END_FUNC_VAL(result) } diff --git a/external/hypre/src/distributed_ls/Euclid/blas_dh.h b/external/hypre/src/distributed_ls/Euclid/blas_dh.h index ab93ef9a..4f3cf709 100644 --- a/external/hypre/src/distributed_ls/Euclid/blas_dh.h +++ b/external/hypre/src/distributed_ls/Euclid/blas_dh.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/Euclid/euclid_common.h b/external/hypre/src/distributed_ls/Euclid/euclid_common.h index 24dbaa4d..1ac1ba1b 100644 --- a/external/hypre/src/distributed_ls/Euclid/euclid_common.h +++ b/external/hypre/src/distributed_ls/Euclid/euclid_common.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -118,7 +118,7 @@ extern char msgBuf_dh[MSG_BUF_SIZE_DH]; * enabled when compiled with the debugging (-g) option. */ extern void openLogfile_dh(HYPRE_Int argc, char *argv[]); -extern void closeLogfile_dh(); +extern void closeLogfile_dh(void); extern bool logInfoToStderr; extern bool logInfoToFile; extern bool logFuncsToStderr; @@ -130,8 +130,8 @@ extern void dh_EndFunc(const char *function, HYPRE_Int priority); extern void printFunctionStack(FILE *fp); extern void EuclidInitialize(HYPRE_Int argc, char *argv[], char *help); /* instantiates global objects */ -extern void EuclidFinalize(); /* deletes global objects */ -extern bool EuclidIsInitialized(); +extern void EuclidFinalize(void); /* deletes global objects */ +extern bool EuclidIsInitialized(void); extern void printf_dh(const char *fmt, ...); extern void fprintf_dh(FILE *fp, const char *fmt, ...); diff --git a/external/hypre/src/distributed_ls/Euclid/euclid_config.h b/external/hypre/src/distributed_ls/Euclid/euclid_config.h index b184414b..7b31bd0b 100644 --- a/external/hypre/src/distributed_ls/Euclid/euclid_config.h +++ b/external/hypre/src/distributed_ls/Euclid/euclid_config.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/Euclid/getRow_dh.c b/external/hypre/src/distributed_ls/Euclid/getRow_dh.c index 20f2bc4b..bd5fcff9 100644 --- a/external/hypre/src/distributed_ls/Euclid/getRow_dh.c +++ b/external/hypre/src/distributed_ls/Euclid/getRow_dh.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -18,12 +18,12 @@ #undef __FUNC__ #define __FUNC__ "EuclidGetRow (HYPRE_GET_ROW)" -void EuclidGetRow(void *A, HYPRE_Int row, HYPRE_Int *len, HYPRE_Int **ind, HYPRE_Real **val) +void EuclidGetRow(void *A, HYPRE_Int row, HYPRE_Int *len, HYPRE_Int **ind, HYPRE_Real **val) { START_FUNC_DH HYPRE_Int ierr; HYPRE_ParCSRMatrix mat = (HYPRE_ParCSRMatrix) A; - ierr = HYPRE_ParCSRMatrixGetRow(mat, row, len, ind, val); + ierr = HYPRE_ParCSRMatrixGetRow(mat, row, len, (HYPRE_BigInt **) ind, val); if (ierr) { hypre_sprintf(msgBuf_dh, "HYPRE_ParCSRMatrixRestoreRow(row= %i) returned %i", row+1, ierr); SET_V_ERROR(msgBuf_dh); @@ -33,12 +33,12 @@ void EuclidGetRow(void *A, HYPRE_Int row, HYPRE_Int *len, HYPRE_Int **ind, HYPRE #undef __FUNC__ #define __FUNC__ "EuclidRestoreRow (HYPRE_GET_ROW)" -void EuclidRestoreRow(void *A, HYPRE_Int row, HYPRE_Int *len, HYPRE_Int **ind, HYPRE_Real **val) +void EuclidRestoreRow(void *A, HYPRE_Int row, HYPRE_Int *len, HYPRE_Int **ind, HYPRE_Real **val) { START_FUNC_DH HYPRE_Int ierr; HYPRE_ParCSRMatrix mat = (HYPRE_ParCSRMatrix) A; - ierr = HYPRE_ParCSRMatrixRestoreRow(mat, row, len, ind, val); + ierr = HYPRE_ParCSRMatrixRestoreRow(mat, row, len, (HYPRE_BigInt **) ind, val); if (ierr) { hypre_sprintf(msgBuf_dh, "HYPRE_ParCSRMatrixRestoreRow(row= %i) returned %i", row+1, ierr); SET_V_ERROR(msgBuf_dh); @@ -51,8 +51,8 @@ void EuclidRestoreRow(void *A, HYPRE_Int row, HYPRE_Int *len, HYPRE_Int **ind, H void EuclidGetDimensions(void *A, HYPRE_Int *beg_row, HYPRE_Int *rowsLocal, HYPRE_Int *rowsGlobal) { START_FUNC_DH - HYPRE_Int ierr, m, n; - HYPRE_Int row_start, row_end, col_start, col_end; + HYPRE_Int ierr; + HYPRE_BigInt m, n, row_start, row_end, col_start, col_end; HYPRE_ParCSRMatrix mat = (HYPRE_ParCSRMatrix) A; ierr = HYPRE_ParCSRMatrixGetDims(mat, &m, &n); @@ -61,8 +61,8 @@ void EuclidGetDimensions(void *A, HYPRE_Int *beg_row, HYPRE_Int *rowsLocal, HYPR SET_V_ERROR(msgBuf_dh); } - ierr = HYPRE_ParCSRMatrixGetLocalRange(mat, &row_start, &row_end, - &col_start, &col_end); + ierr = HYPRE_ParCSRMatrixGetLocalRange(mat, &row_start, &row_end, + &col_start, &col_end); if (ierr) { hypre_sprintf(msgBuf_dh, "HYPRE_ParCSRMatrixGetLocalRange() returned %i", ierr); SET_V_ERROR(msgBuf_dh); @@ -98,14 +98,14 @@ HYPRE_Int EuclidReadLocalNz(void *A) #undef __FUNC__ #define __FUNC__ "EuclidGetRow (PETSC_GET_ROW)" -void EuclidGetRow(void *Ain, HYPRE_Int row, HYPRE_Int *len, HYPRE_Int **ind, HYPRE_Real **val) +void EuclidGetRow(void *Ain, HYPRE_Int row, HYPRE_Int *len, HYPRE_Int **ind, HYPRE_Real **val) { START_FUNC_DH Mat A = Ain; HYPRE_Int ierr; ierr = MatGetRow(A, row, len, ind, val); - if (ierr) { + if (ierr) { hypre_sprintf(msgBuf_dh, "PETSc's MatGetRow bombed for row= %i", row); SET_V_ERROR(msgBuf_dh); } @@ -115,7 +115,7 @@ void EuclidGetRow(void *Ain, HYPRE_Int row, HYPRE_Int *len, HYPRE_Int **ind, HYP #undef __FUNC__ #define __FUNC__ "EuclidRestoreRow (PETSC_GET_ROW)" -void EuclidRestoreRow(void *Ain, HYPRE_Int row, HYPRE_Int *len, HYPRE_Int **ind, HYPRE_Real **val) +void EuclidRestoreRow(void *Ain, HYPRE_Int row, HYPRE_Int *len, HYPRE_Int **ind, HYPRE_Real **val) { START_FUNC_DH Mat A = (Mat)Ain; @@ -143,7 +143,7 @@ void EuclidGetDimensions(void *Ain, HYPRE_Int *beg_row, HYPRE_Int *rowsLocal, HY hypre_sprintf(msgBuf_dh, "PETSc's MatGetOwnershipRange failed"); SET_V_ERROR(msgBuf_dh); } - ierr = MatGetSize(A, &rows, &cols); + ierr = MatGetSize(A, &rows, &cols); if (ierr) { hypre_sprintf(msgBuf_dh, "PETSc'MatGetSize failed"); SET_V_ERROR(msgBuf_dh); @@ -167,7 +167,7 @@ HYPRE_Int EuclidReadLocalNz(void *Ain) Mat A = (Mat)Ain; HYPRE_Int m, n, ierr; - ierr = MatGetLocalSize(Ain, &m, &n); + ierr = MatGetLocalSize(Ain, &m, &n); if (ierr) SET_ERROR(-1, "PETSc::MatGetLocalSize failed!\n"); END_FUNC_VAL(m) } @@ -175,17 +175,17 @@ HYPRE_Int EuclidReadLocalNz(void *Ain) /*------------------------------------------------------------------- - * Euclid + * Euclid *-------------------------------------------------------------------*/ #elif defined(EUCLID_GET_ROW) #undef __FUNC__ #define __FUNC__ "EuclidGetRow (EUCLID_GET_ROW)" -void EuclidGetRow(void *A, HYPRE_Int globalRow, HYPRE_Int *len, HYPRE_Int **ind, HYPRE_Real **val) +void EuclidGetRow(void *A, HYPRE_Int globalRow, HYPRE_Int *len, HYPRE_Int **ind, HYPRE_Real **val) { START_FUNC_DH - Mat_dh B = (Mat_dh)A; + Mat_dh B = (Mat_dh)A; HYPRE_Int row = globalRow - B->beg_row; if (row > B->m) { hypre_sprintf(msgBuf_dh, "requested globalRow= %i, which is local row= %i, but only have %i rows!", @@ -193,14 +193,14 @@ void EuclidGetRow(void *A, HYPRE_Int globalRow, HYPRE_Int *len, HYPRE_Int **ind, SET_V_ERROR(msgBuf_dh); } *len = B->rp[row+1] - B->rp[row]; - if (ind != NULL) *ind = B->cval + B->rp[row]; - if (val != NULL) *val = B->aval + B->rp[row]; + if (ind != NULL) *ind = B->cval + B->rp[row]; + if (val != NULL) *val = B->aval + B->rp[row]; END_FUNC_DH } #undef __FUNC__ #define __FUNC__ "EuclidRestoreRow (EUCLID_GET_ROW)" -void EuclidRestoreRow(void *A, HYPRE_Int row, HYPRE_Int *len, HYPRE_Int **ind, HYPRE_Real **val) +void EuclidRestoreRow(void *A, HYPRE_Int row, HYPRE_Int *len, HYPRE_Int **ind, HYPRE_Real **val) { START_FUNC_DH END_FUNC_DH @@ -211,7 +211,7 @@ void EuclidRestoreRow(void *A, HYPRE_Int row, HYPRE_Int *len, HYPRE_Int **ind, H void EuclidGetDimensions(void *A, HYPRE_Int *beg_row, HYPRE_Int *rowsLocal, HYPRE_Int *rowsGlobal) { START_FUNC_DH - Mat_dh B = (Mat_dh)A; + Mat_dh B = (Mat_dh)A; *beg_row = B->beg_row; *rowsLocal = B->m; *rowsGlobal = B->n; @@ -223,7 +223,7 @@ void EuclidGetDimensions(void *A, HYPRE_Int *beg_row, HYPRE_Int *rowsLocal, HYPR HYPRE_Int EuclidReadLocalNz(void *A) { START_FUNC_DH - Mat_dh B = (Mat_dh)A; + Mat_dh B = (Mat_dh)A; HYPRE_Int nz = B->rp[B->m]; END_FUNC_VAL(nz) } @@ -235,7 +235,7 @@ HYPRE_Int EuclidReadLocalNz(void *A) #undef __FUNC__ #define __FUNC__ "EuclidGetRow (ERROR)" -void EuclidGetRow(void *A, HYPRE_Int row, HYPRE_Int *len, HYPRE_Int **ind, HYPRE_Real **val) +void EuclidGetRow(void *A, HYPRE_Int row, HYPRE_Int *len, HYPRE_Int **ind, HYPRE_Real **val) { START_FUNC_DH SET_ERROR(EUCLID_ERROR, "Oops; missing XXX_GET_ROW definition!"); @@ -244,7 +244,7 @@ void EuclidGetRow(void *A, HYPRE_Int row, HYPRE_Int *len, HYPRE_Int **ind, HYPRE #undef __FUNC__ #define __FUNC__ "EuclidRestoreRow (ERROR)" -void EuclidRestoreRow(void *A, HYPRE_Int row, HYPRE_Int *len, HYPRE_Int **ind, HYPRE_Real **val) +void EuclidRestoreRow(void *A, HYPRE_Int row, HYPRE_Int *len, HYPRE_Int **ind, HYPRE_Real **val) { START_FUNC_DH SET_ERROR(EUCLID_ERROR, "Oops; missing XXX_GET_ROW definition!"); @@ -321,7 +321,7 @@ void PrintMatUsingGetRow(void* A, HYPRE_Int beg_row, HYPRE_Int m, newRow = n2o_row[i] + beg_row; EuclidGetRow(A, newRow, &len, &cval, &aval); CHECK_V_ERROR; for (j=0; jF->rp == NULL) { tmpFill = (HYPRE_Int*)MALLOC_DH(m*sizeof(HYPRE_Int)); CHECK_V_ERROR; for (i=0; ibeg_row[myid_dh]; last_row = first_row + sg->row_count[myid_dh]; @@ -90,15 +90,15 @@ if (ctx->F->rp == NULL) { EuclidGetRow(ctx->A, globalRow, &len, &CVAL, &AVAL); CHECK_V_ERROR; /* compute scaling value for row(i) */ - if (ctx->isScaled) { - compute_scaling_private(i, len, AVAL, ctx); CHECK_V_ERROR; + if (ctx->isScaled) { + compute_scaling_private(i, len, AVAL, ctx); CHECK_V_ERROR; } /* Compute symbolic factor for row(i); this also performs sparsification */ count = symbolic_row_private(i, first_row, last_row, - list, marker, tmpFill, + list, marker, tmpFill, len, CVAL, AVAL, o2n_col, ctx); CHECK_V_ERROR; @@ -114,7 +114,7 @@ if (ctx->F->rp == NULL) { /* Copy factored symbolic row to permanent storage */ col = list[m]; while (count--) { - cval[idx] = col; + cval[idx] = col; fill[idx] = tmpFill[col]; ++idx; col = list[col]; @@ -124,13 +124,13 @@ if (ctx->F->rp == NULL) { rp[i+1] = idx; /* Insert pointer to diagonal */ - temp = rp[i]; - while (cval[temp] != i) ++temp; + temp = rp[i]; + while (cval[temp] != i) ++temp; diag[i] = temp; /* compute numeric factor for current row */ numeric_row_private(i, first_row, last_row, - len, CVAL, AVAL, + len, CVAL, AVAL, work, o2n_col, ctx); CHECK_V_ERROR EuclidRestoreRow(ctx->A, globalRow, &len, &CVAL, &AVAL); CHECK_V_ERROR; @@ -138,10 +138,10 @@ if (ctx->F->rp == NULL) { and re-zero work vector */ for (j=rp[i]; jF->rp == NULL) { -/* Computes ILU(K) factor of a single row; returns fill - count for the row. Explicitly inserts diag if not already - present. On return, all column indices are local +/* Computes ILU(K) factor of a single row; returns fill + count for the row. Explicitly inserts diag if not already + present. On return, all column indices are local (i.e, referenced to 0). */ #undef __FUNC__ @@ -173,16 +173,16 @@ HYPRE_Int symbolic_row_private(HYPRE_Int localRow, HYPRE_Int beg_row, HYPRE_Int { START_FUNC_DH HYPRE_Int level = ctx->level, m = ctx->F->m; - HYPRE_Int *cval = ctx->F->cval, *diag = ctx->F->diag, *rp = ctx->F->rp; + HYPRE_Int *cval = ctx->F->cval, *diag = ctx->F->diag, *rp = ctx->F->rp; HYPRE_Int *fill = ctx->F->fill; HYPRE_Int count = 0; HYPRE_Int j, node, tmp, col, head; HYPRE_Int fill1, fill2; - float val; + HYPRE_Real val; HYPRE_Real thresh = ctx->sparseTolA; REAL_DH scale; - scale = ctx->scale[localRow]; + scale = ctx->scale[localRow]; ctx->stats[NZA_STATS] += (HYPRE_Real)len; /* Insert col indices in linked list, and values in work vector. @@ -192,14 +192,14 @@ HYPRE_Int symbolic_row_private(HYPRE_Int localRow, HYPRE_Int beg_row, HYPRE_Int list[m] = m; for (j=0; j= beg_row && col < end_row) { col -= beg_row; /* adjust column to local zero-based */ col = o2n_col[col]; /* permute column */ - if (fabs(scale*val) > thresh || col == localRow) { /* sparsification */ + if (hypre_abs(scale*val) > thresh || col == localRow) { /* sparsification */ ++count; while (col > list[tmp]) tmp = list[tmp]; list[col] = list[tmp]; @@ -277,15 +277,15 @@ HYPRE_Int numeric_row_private(HYPRE_Int localRow, HYPRE_Int beg_row, HYPRE_Int e HYPRE_Real val; REAL_DH *aval = ctx->F->aval, scale; - scale = ctx->scale[localRow]; + scale = ctx->scale[localRow]; /* zero work vector */ - /* note: indices in col[] are already permuted, and are + /* note: indices in col[] are already permuted, and are local (zero-based) */ - for (j=rp[localRow]; j thresh) { */ +/* if (hypre_abs(sr.val) > thresh) { */ wasInserted = SortedList_dhPermuteAndInsert(slist, &sr, thresh); CHECK_V_ERROR; if (wasInserted) ++count; /* } */ diff --git a/external/hypre/src/distributed_ls/Euclid/ilu_seq.c b/external/hypre/src/distributed_ls/Euclid/ilu_seq.c index 753cfb31..26f33d0a 100644 --- a/external/hypre/src/distributed_ls/Euclid/ilu_seq.c +++ b/external/hypre/src/distributed_ls/Euclid/ilu_seq.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -19,12 +19,12 @@ static bool check_constraint_private(Euclid_dh ctx, HYPRE_Int b, HYPRE_Int j); -static HYPRE_Int symbolic_row_private(HYPRE_Int localRow, +static HYPRE_Int symbolic_row_private(HYPRE_Int localRow, HYPRE_Int *list, HYPRE_Int *marker, HYPRE_Int *tmpFill, HYPRE_Int len, HYPRE_Int *CVAL, HYPRE_Real *AVAL, HYPRE_Int *o2n_col, Euclid_dh ctx, bool debug); -static HYPRE_Int numeric_row_private(HYPRE_Int localRow, +static HYPRE_Int numeric_row_private(HYPRE_Int localRow, HYPRE_Int len, HYPRE_Int *CVAL, HYPRE_Real *AVAL, REAL_DH *work, HYPRE_Int *o2n_col, Euclid_dh ctx, bool debug); @@ -37,7 +37,7 @@ void compute_scaling_private(HYPRE_Int row, HYPRE_Int len, HYPRE_Real *AVAL, Euc HYPRE_Real tmp = 0.0; HYPRE_Int j; - for (j=0; jscale[row] = 1.0/tmp; } @@ -57,7 +57,7 @@ HYPRE_Real fixPivot_private(HYPRE_Int row, HYPRE_Int len, float *vals) bool debug = false; for (i=0; ipivotFix) @@ -112,9 +112,9 @@ void iluk_seq(Euclid_dh ctx) for (i=0; ilevel); +/* printf_dh("====================== starting iluk_seq; level= %i\n\n", ctx->level); */ @@ -134,14 +134,14 @@ void iluk_seq(Euclid_dh ctx) EuclidGetRow(ctx->A, globalRow, &len, &CVAL, &AVAL); CHECK_V_ERROR; /* compute scaling value for row(i) */ - if (ctx->isScaled) { - compute_scaling_private(i, len, AVAL, ctx); CHECK_V_ERROR; + if (ctx->isScaled) { + compute_scaling_private(i, len, AVAL, ctx); CHECK_V_ERROR; } /* Compute symbolic factor for row(i); this also performs sparsification */ - count = symbolic_row_private(i, list, marker, tmpFill, + count = symbolic_row_private(i, list, marker, tmpFill, len, CVAL, AVAL, o2n_col, ctx, debug); CHECK_V_ERROR; @@ -157,7 +157,7 @@ void iluk_seq(Euclid_dh ctx) /* Copy factored symbolic row to permanent storage */ col = list[m]; while (count--) { - cval[idx] = col; + cval[idx] = col; fill[idx] = tmpFill[col]; ++idx; /*hypre_fprintf(logFile, " col= %i\n", 1+col); @@ -169,15 +169,15 @@ void iluk_seq(Euclid_dh ctx) rp[i+1] = idx; /* Insert pointer to diagonal */ - temp = rp[i]; - while (cval[temp] != i) ++temp; + temp = rp[i]; + while (cval[temp] != i) ++temp; diag[i] = temp; /*hypre_fprintf(logFile, " diag[i]= %i\n", diag); */ /* compute numeric factor for current row */ - numeric_row_private(i, len, CVAL, AVAL, + numeric_row_private(i, len, CVAL, AVAL, work, o2n_col, ctx, debug); CHECK_V_ERROR EuclidRestoreRow(ctx->A, globalRow, &len, &CVAL, &AVAL); CHECK_V_ERROR; @@ -187,8 +187,8 @@ void iluk_seq(Euclid_dh ctx) if (debug) { hypre_fprintf(logFile, "ILU_seq: "); for (j=rp[i]; jF; SubdomainGraph_dh sg = ctx->sg; bool bj = false, constrained = false; - HYPRE_Int discard = 0; + //HYPRE_Int discard = 0; HYPRE_Int gr = -1; /* globalRow */ bool debug = false; if (logFile != NULL && Parser_dhHasSwitch(parser_dh, "-debug_ilu")) debug = true; -/*hypre_fprintf(stderr, "====================== starting iluk_seq_block; level= %i\n\n", ctx->level); +/*hypre_fprintf(stderr, "====================== starting iluk_seq_block; level= %i\n\n", ctx->level); */ if (!strcmp(ctx->algo_par, "bj")) bj = true; @@ -295,7 +295,7 @@ void iluk_seq_block(Euclid_dh ctx) for (i=0; iA, row, &len, &CVAL, &AVAL); CHECK_V_ERROR; /* compute scaling value for row(i) */ - if (ctx->isScaled) { - compute_scaling_private(i, len, AVAL, ctx); CHECK_V_ERROR; + if (ctx->isScaled) { + compute_scaling_private(i, len, AVAL, ctx); CHECK_V_ERROR; } /* Compute symbolic factor for row(i); this also performs sparsification */ - count = symbolic_row_private(i, list, marker, tmpFill, + count = symbolic_row_private(i, list, marker, tmpFill, len, CVAL, AVAL, o2n_col, ctx, debug); CHECK_V_ERROR; @@ -350,16 +350,16 @@ void iluk_seq_block(Euclid_dh ctx) /* constrained pilu */ if (constrained && !bj) { if (col >= first_row && col < end_row) { - cval[idx] = col; + cval[idx] = col; fill[idx] = tmpFill[col]; ++idx; - } else { + } else { if (check_constraint_private(ctx, curBlock, col)) { - cval[idx] = col; + cval[idx] = col; fill[idx] = tmpFill[col]; ++idx; } else { - ++discard; + //++discard; } } col = list[col]; @@ -368,18 +368,18 @@ void iluk_seq_block(Euclid_dh ctx) /* block jacobi case */ else if (bj) { if (col >= first_row && col < end_row) { - cval[idx] = col; + cval[idx] = col; fill[idx] = tmpFill[col]; ++idx; - } else { - ++discard; + } else { + //++discard; } col = list[col]; } /* general case */ else { - cval[idx] = col; + cval[idx] = col; fill[idx] = tmpFill[col]; ++idx; col = list[col]; @@ -390,12 +390,12 @@ void iluk_seq_block(Euclid_dh ctx) rp[i+1] = idx; /* Insert pointer to diagonal */ - temp = rp[i]; - while (cval[temp] != i) ++temp; + temp = rp[i]; + while (cval[temp] != i) ++temp; diag[i] = temp; /* compute numeric factor for current row */ - numeric_row_private(i, len, CVAL, AVAL, + numeric_row_private(i, len, CVAL, AVAL, work, o2n_col, ctx, debug); CHECK_V_ERROR EuclidRestoreRow(ctx->A, row, &len, &CVAL, &AVAL); CHECK_V_ERROR; @@ -405,21 +405,21 @@ void iluk_seq_block(Euclid_dh ctx) if (debug) { hypre_fprintf(logFile, "ILU_seq: "); for (j=rp[i]; jlevel, m = ctx->F->m; - HYPRE_Int *cval = ctx->F->cval, *diag = ctx->F->diag, *rp = ctx->F->rp; + HYPRE_Int *cval = ctx->F->cval, *diag = ctx->F->diag, *rp = ctx->F->rp; HYPRE_Int *fill = ctx->F->fill; HYPRE_Int count = 0; HYPRE_Int j, node, tmp, col, head; @@ -465,7 +465,7 @@ HYPRE_Int symbolic_row_private(HYPRE_Int localRow, HYPRE_Real thresh = ctx->sparseTolA; REAL_DH scale; - scale = ctx->scale[localRow]; + scale = ctx->scale[localRow]; ctx->stats[NZA_STATS] += (HYPRE_Real)len; beg_row = ctx->sg->beg_row[myid_dh]; @@ -482,7 +482,7 @@ HYPRE_Int symbolic_row_private(HYPRE_Int localRow, val = *AVAL++; val *= scale; /* scale the value */ - if (fabs(val) > thresh || col == localRow) { /* sparsification */ + if (hypre_abs(val) > thresh || col == localRow) { /* sparsification */ ++count; while (col > list[tmp]) tmp = list[tmp]; list[col] = list[tmp]; @@ -550,7 +550,7 @@ HYPRE_Int symbolic_row_private(HYPRE_Int localRow, #undef __FUNC__ #define __FUNC__ "numeric_row_private" -HYPRE_Int numeric_row_private(HYPRE_Int localRow, +HYPRE_Int numeric_row_private(HYPRE_Int localRow, HYPRE_Int len, HYPRE_Int *CVAL, HYPRE_Real *AVAL, REAL_DH *work, HYPRE_Int *o2n_col, Euclid_dh ctx, bool debug) { @@ -563,14 +563,14 @@ HYPRE_Int numeric_row_private(HYPRE_Int localRow, HYPRE_Real val; REAL_DH *aval = ctx->F->aval, scale; - scale = ctx->scale[localRow]; + scale = ctx->scale[localRow]; beg_row = ctx->sg->beg_row[myid_dh]; /* zero work vector */ /* note: indices in col[] are already permuted. */ - for (j=rp[localRow]; jF; SubdomainGraph_dh sg = ctx->sg; @@ -686,7 +686,7 @@ void ilut_seq(Euclid_dh ctx) rp[0] = 0; /* working space for values */ - for (i=0; iA, globalRow, &len, &CVAL, &AVAL); CHECK_V_ERROR; /* compute scaling value for row(i) */ - compute_scaling_private(i, len, AVAL, ctx); CHECK_V_ERROR; + compute_scaling_private(i, len, AVAL, ctx); CHECK_V_ERROR; /* compute factor for row i */ count = ilut_row_private(i, list, o2n_col, marker, @@ -718,8 +718,8 @@ void ilut_seq(Euclid_dh ctx) col = list[m]; while (count--) { val = work[col]; - if (col == i || fabs(val) > droptol) { - cval[idx] = col; + if (col == i || hypre_abs(val) > droptol) { + cval[idx] = col; aval[idx++] = val; work[col] = 0.0; } @@ -730,7 +730,7 @@ void ilut_seq(Euclid_dh ctx) rp[i+1] = idx; /* Insert pointer to diagonal */ - temp = rp[i]; + temp = rp[i]; while (cval[temp] != i) ++temp; diag[i] = temp; @@ -760,6 +760,8 @@ HYPRE_Int ilut_row_private(HYPRE_Int localRow, HYPRE_Int *list, HYPRE_Int *o2n_c HYPRE_Int len, HYPRE_Int *CVAL, HYPRE_Real *AVAL, REAL_DH *work, Euclid_dh ctx, bool debug) { + HYPRE_UNUSED_VAR(debug); + START_FUNC_DH Factor_dh F = ctx->F; HYPRE_Int j, col, m = ctx->m, *rp = F->rp, *cval = F->cval; @@ -790,7 +792,7 @@ HYPRE_Int ilut_row_private(HYPRE_Int localRow, HYPRE_Int *list, HYPRE_Int *o2n_c val = *AVAL++; val *= scale; /* scale the value */ - if (fabs(val) > thresh || col == localRow) { /* sparsification */ + if (hypre_abs(val) > thresh || col == localRow) { /* sparsification */ ++count; while (col > list[tmp]) tmp = list[tmp]; list[col] = list[tmp]; @@ -822,7 +824,7 @@ HYPRE_Int ilut_row_private(HYPRE_Int localRow, HYPRE_Int *list, HYPRE_Int *o2n_c mult = pc / pv; /* update localRow from previously factored "row" */ - if (fabs(mult) > droptol) { + if (hypre_abs(mult) > droptol) { work[row] = mult; for (j=diag[row]+1; jsg == NULL"); } - + p2 = SubdomainGraph_dhFindOwner(ctx->sg, j, true); diff --git a/external/hypre/src/distributed_ls/Euclid/io_dh.c b/external/hypre/src/distributed_ls/Euclid/io_dh.c index e21cef56..35a66333 100644 --- a/external/hypre/src/distributed_ls/Euclid/io_dh.c +++ b/external/hypre/src/distributed_ls/Euclid/io_dh.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -40,17 +40,45 @@ void closeFile_dh(FILE *fpIN) /*----------------------------------------------------------------*/ void io_dh_print_ebin_mat_private(HYPRE_Int m, HYPRE_Int beg_row, - HYPRE_Int *rp, HYPRE_Int *cval, HYPRE_Real *aval, + HYPRE_Int *rp, HYPRE_Int *cval, HYPRE_Real *aval, HYPRE_Int *n2o, HYPRE_Int *o2n, Hash_i_dh hash, char *filename) -{} +{ + HYPRE_UNUSED_VAR(m); + HYPRE_UNUSED_VAR(beg_row); + HYPRE_UNUSED_VAR(rp); + HYPRE_UNUSED_VAR(cval); + HYPRE_UNUSED_VAR(aval); + HYPRE_UNUSED_VAR(n2o); + HYPRE_UNUSED_VAR(o2n); + HYPRE_UNUSED_VAR(hash); + HYPRE_UNUSED_VAR(filename); +} extern void io_dh_read_ebin_mat_private(HYPRE_Int *m, HYPRE_Int **rp, HYPRE_Int **cval, HYPRE_Real **aval, char *filename) -{} +{ + HYPRE_UNUSED_VAR(m); + HYPRE_UNUSED_VAR(rp); + HYPRE_UNUSED_VAR(cval); + HYPRE_UNUSED_VAR(aval); + HYPRE_UNUSED_VAR(filename); +} void io_dh_print_ebin_vec_private(HYPRE_Int n, HYPRE_Int beg_row, HYPRE_Real *vals, HYPRE_Int *n2o, HYPRE_Int *o2n, Hash_i_dh hash, char *filename) -{} +{ + HYPRE_UNUSED_VAR(n); + HYPRE_UNUSED_VAR(beg_row); + HYPRE_UNUSED_VAR(vals); + HYPRE_UNUSED_VAR(n2o); + HYPRE_UNUSED_VAR(o2n); + HYPRE_UNUSED_VAR(hash); + HYPRE_UNUSED_VAR(filename); +} void io_dh_read_ebin_vec_private(HYPRE_Int *n, HYPRE_Real **vals, char *filename) -{} +{ + HYPRE_UNUSED_VAR(n); + HYPRE_UNUSED_VAR(vals); + HYPRE_UNUSED_VAR(filename); +} diff --git a/external/hypre/src/distributed_ls/Euclid/io_dh.h b/external/hypre/src/distributed_ls/Euclid/io_dh.h index 55c8e4a4..4e9b1881 100644 --- a/external/hypre/src/distributed_ls/Euclid/io_dh.h +++ b/external/hypre/src/distributed_ls/Euclid/io_dh.h @@ -1,12 +1,12 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ /* - Note: this module contains functionality for reading/writing + Note: this module contains functionality for reading/writing Euclid's binary io format, and opening and closing files. Additional io can be found in in mat_dh_private, which contains private functions for reading/writing various matrix and @@ -29,11 +29,11 @@ extern void closeFile_dh(FILE *fpIN); * binary io; these are called by functions in mat_dh_private *---------------------------------------------------------------------------*/ -bool isSmallEndian(); +bool isSmallEndian(void); /* seq only ?? */ extern void io_dh_print_ebin_mat_private(HYPRE_Int m, HYPRE_Int beg_row, - HYPRE_Int *rp, HYPRE_Int *cval, HYPRE_Real *aval, + HYPRE_Int *rp, HYPRE_Int *cval, HYPRE_Real *aval, HYPRE_Int *n2o, HYPRE_Int *o2n, Hash_i_dh hash, char *filename); /* seq only ?? */ diff --git a/external/hypre/src/distributed_ls/Euclid/krylov_dh.c b/external/hypre/src/distributed_ls/Euclid/krylov_dh.c index e0a7f8b6..d6678ab9 100644 --- a/external/hypre/src/distributed_ls/Euclid/krylov_dh.c +++ b/external/hypre/src/distributed_ls/Euclid/krylov_dh.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -23,10 +23,10 @@ void bicgstab_euclid(Mat_dh A, Euclid_dh ctx, HYPRE_Real *x, HYPRE_Real *b, HYPR HYPRE_Real atol = ctx->atol, rtol = ctx->rtol; /* scalars */ - HYPRE_Real alpha, alpha_1, + HYPRE_Real alpha, alpha_1 = 1.0, beta_1, - widget, widget_1, - rho_1, rho_2, + widget, widget_1 = 1.0, + rho_1, rho_2 = 1.0, s_norm, eps, exit_a, b_iprod, r_iprod; @@ -58,7 +58,7 @@ void bicgstab_euclid(Mat_dh A, Euclid_dh ctx, HYPRE_Real *x, HYPRE_Real *b, HYPR its = 0; while(1) { - ++its; + ++its; rho_1 = InnerProd(m, r_hat, r); if (rho_1 == 0) { SET_V_ERROR("(r_hat . r) = 0; method fails"); @@ -68,7 +68,7 @@ void bicgstab_euclid(Mat_dh A, Euclid_dh ctx, HYPRE_Real *x, HYPRE_Real *b, HYPR CopyVec(m, r, p); /* p = r_0 */ CHECK_V_ERROR; } else { beta_1 = (rho_1/rho_2)*(alpha_1/widget_1); - + /* p_i = r_(i-1) + beta_(i-1)*( p_(i-1) - w_(i-1)*v_(i-1) ) */ Axpy(m, -widget_1, v, p); CHECK_V_ERROR; ScaleVec(m, beta_1, p); CHECK_V_ERROR; @@ -132,7 +132,7 @@ void bicgstab_euclid(Mat_dh A, Euclid_dh ctx, HYPRE_Real *x, HYPRE_Real *b, HYPR /* monitor convergence */ if (monitor && myid_dh == 0) { - hypre_fprintf(stderr, "[it = %i] %e\n", its, sqrt(r_iprod/b_iprod)); + hypre_fprintf(stderr, "[it = %i] %e\n", its, hypre_sqrt(r_iprod/b_iprod)); } /* prepare for next iteration */ @@ -212,7 +212,7 @@ void cg_euclid(Mat_dh A, Euclid_dh ctx, HYPRE_Real *x, HYPRE_Real *b, HYPRE_Int /* r = r - alpha*s */ Axpy(m, -alpha, s, r); CHECK_V_ERROR; - + /* solve Ms = r */ Euclid_dhApply(ctx, r, s); CHECK_V_ERROR; @@ -223,7 +223,7 @@ void cg_euclid(Mat_dh A, Euclid_dh ctx, HYPRE_Real *x, HYPRE_Real *b, HYPRE_Int i_prod = InnerProd(m, r, r); CHECK_V_ERROR; if (monitor && myid_dh == 0) { - hypre_fprintf(stderr, "iter = %i rel. resid. norm: %e\n", its, sqrt(i_prod/bi_prod)); + hypre_fprintf(stderr, "iter = %i rel. resid. norm: %e\n", its, hypre_sqrt(i_prod/bi_prod)); } /* check for convergence */ diff --git a/external/hypre/src/distributed_ls/Euclid/krylov_dh.h b/external/hypre/src/distributed_ls/Euclid/krylov_dh.h index b1587149..84af54b2 100644 --- a/external/hypre/src/distributed_ls/Euclid/krylov_dh.h +++ b/external/hypre/src/distributed_ls/Euclid/krylov_dh.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/Euclid/macros_dh.h b/external/hypre/src/distributed_ls/Euclid/macros_dh.h index 9e273294..c35459f0 100644 --- a/external/hypre/src/distributed_ls/Euclid/macros_dh.h +++ b/external/hypre/src/distributed_ls/Euclid/macros_dh.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -29,11 +29,8 @@ #endif /* used in Mat_SEQ_PrintTriples, so matlab won't discard zeros (yuck!) */ -#ifdef HYPRE_SINGLE -#define _MATLAB_ZERO_ 1e-30 -#else // default -#define _MATLAB_ZERO_ 1e-100 -#endif +#define _MATLAB_ZERO_ HYPRE_REAL_MIN + /*---------------------------------------------------------------------- diff --git a/external/hypre/src/distributed_ls/Euclid/mat_dh_private.c b/external/hypre/src/distributed_ls/Euclid/mat_dh_private.c index 3f13e515..853cb3e7 100644 --- a/external/hypre/src/distributed_ls/Euclid/mat_dh_private.c +++ b/external/hypre/src/distributed_ls/Euclid/mat_dh_private.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -110,6 +110,8 @@ void mat_dh_print_graph_private(HYPRE_Int m, HYPRE_Int beg_row, HYPRE_Int *rp, H void mat_dh_print_graph_private(HYPRE_Int m, HYPRE_Int beg_row, HYPRE_Int *rp, HYPRE_Int *cval, HYPRE_Real *aval, HYPRE_Int *n2o, HYPRE_Int *o2n, Hash_i_dh hash, FILE* fp) { + HYPRE_UNUSED_VAR(aval); + START_FUNC_DH HYPRE_Int i, j, row, col; bool private_n2o = false; @@ -587,7 +589,7 @@ void fix_diags_private(Mat_dh A) for (i=0; i -extern void sigRegister_dh(); +extern void sigRegister_dh(void); extern void sigHandler_dh(hypre_int sig); /* @@ -85,7 +85,7 @@ void sigHandler_dh(hypre_int sig) #undef __FUNC__ #define __FUNC__ "sigRegister_dh" -void sigRegister_dh() +void sigRegister_dh(void) { if (Parser_dhHasSwitch(parser_dh, "-sig_dh")) { hypre_int i; diff --git a/external/hypre/src/distributed_ls/Euclid/sig_dh.h b/external/hypre/src/distributed_ls/Euclid/sig_dh.h index 66370686..ba10f69c 100644 --- a/external/hypre/src/distributed_ls/Euclid/sig_dh.h +++ b/external/hypre/src/distributed_ls/Euclid/sig_dh.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/ParaSails/CMakeLists.txt b/external/hypre/src/distributed_ls/ParaSails/CMakeLists.txt index ac677ef1..585adefb 100644 --- a/external/hypre/src/distributed_ls/ParaSails/CMakeLists.txt +++ b/external/hypre/src/distributed_ls/ParaSails/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/ParaSails/Common.h b/external/hypre/src/distributed_ls/ParaSails/Common.h index b8ff4fe5..6958ddc6 100644 --- a/external/hypre/src/distributed_ls/ParaSails/Common.h +++ b/external/hypre/src/distributed_ls/ParaSails/Common.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/ParaSails/ConjGrad.c b/external/hypre/src/distributed_ls/ParaSails/ConjGrad.c index fbe968ba..0ef71b36 100644 --- a/external/hypre/src/distributed_ls/ParaSails/ConjGrad.c +++ b/external/hypre/src/distributed_ls/ParaSails/ConjGrad.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -135,7 +135,7 @@ void PCG_ParaSails(Matrix *mat, ParaSails *ps, HYPRE_Real *b, HYPRE_Real *x, #ifdef PARASAILS_CG_PRINT if (mype == 0 && i % 100 == 0) - hypre_printf("Iter (%d): rel. resid. norm: %e\n", i, sqrt(i_prod/bi_prod)); + hypre_printf("Iter (%d): rel. resid. norm: %e\n", i, hypre_sqrt(i_prod/bi_prod)); #endif /* check for convergence */ @@ -170,5 +170,5 @@ void PCG_ParaSails(Matrix *mat, ParaSails *ps, HYPRE_Real *b, HYPRE_Real *x, hypre_TFree(r, HYPRE_MEMORY_HOST); if (mype == 0) - hypre_printf("Iter (%4d): computed rrn : %e\n", i, sqrt(i_prod/bi_prod)); + hypre_printf("Iter (%4d): computed rrn : %e\n", i, hypre_sqrt(i_prod/bi_prod)); } diff --git a/external/hypre/src/distributed_ls/ParaSails/ConjGrad.h b/external/hypre/src/distributed_ls/ParaSails/ConjGrad.h index 781a9f8a..990f84c9 100644 --- a/external/hypre/src/distributed_ls/ParaSails/ConjGrad.h +++ b/external/hypre/src/distributed_ls/ParaSails/ConjGrad.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/ParaSails/DiagScale.c b/external/hypre/src/distributed_ls/ParaSails/DiagScale.c index 82cd2212..a347cf6b 100644 --- a/external/hypre/src/distributed_ls/ParaSails/DiagScale.c +++ b/external/hypre/src/distributed_ls/ParaSails/DiagScale.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -162,7 +162,7 @@ DiagScale *DiagScaleCreate(Matrix *A, Numbering *numb) if (ind[j] == row) { if (val[j] != 0.0) - p->local_diags[row] = 1.0 / sqrt(ABS(val[j])); + p->local_diags[row] = 1.0 / hypre_sqrt(ABS(val[j])); break; } } diff --git a/external/hypre/src/distributed_ls/ParaSails/DiagScale.h b/external/hypre/src/distributed_ls/ParaSails/DiagScale.h index e6b6d80d..da7d7a1b 100644 --- a/external/hypre/src/distributed_ls/ParaSails/DiagScale.h +++ b/external/hypre/src/distributed_ls/ParaSails/DiagScale.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/ParaSails/FGmres.c b/external/hypre/src/distributed_ls/ParaSails/FGmres.c index 573c6000..fd9a5ac4 100644 --- a/external/hypre/src/distributed_ls/ParaSails/FGmres.c +++ b/external/hypre/src/distributed_ls/ParaSails/FGmres.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -61,11 +61,11 @@ GeneratePlaneRotation(HYPRE_Real dx, HYPRE_Real dy, HYPRE_Real *cs, HYPRE_Real * *sn = 0.0; } else if (ABS(dy) > ABS(dx)) { HYPRE_Real temp = dx / dy; - *sn = 1.0 / sqrt( 1.0 + temp*temp ); + *sn = 1.0 / hypre_sqrt( 1.0 + temp*temp ); *cs = temp * *sn; } else { HYPRE_Real temp = dy / dx; - *cs = 1.0 / sqrt( 1.0 + temp*temp ); + *cs = 1.0 / hypre_sqrt( 1.0 + temp*temp ); *sn = temp * *cs; } } @@ -109,7 +109,7 @@ void FGMRES_ParaSails(Matrix *mat, ParaSails *ps, HYPRE_Real *b, HYPRE_Real *x, /* compute initial residual and its norm */ MatrixMatvec(mat, x, V(0)); /* V(0) = A*x */ Axpy(n, -1.0, b, V(0)); /* V(0) = V(0) - b */ - beta = sqrt(InnerProd(n, V(0), V(0), comm)); /* beta = norm(V(0)) */ + beta = hypre_sqrt(InnerProd(n, V(0), V(0), comm)); /* beta = norm(V(0)) */ ScaleVector(n, -1.0/beta, V(0)); /* V(0) = -V(0)/beta */ /* save very first residual norm */ @@ -140,7 +140,7 @@ void FGMRES_ParaSails(Matrix *mat, ParaSails *ps, HYPRE_Real *b, HYPRE_Real *x, Axpy(n, -H(k,i), V(k), V(i+1)); } - H(i+1, i) = sqrt(InnerProd(n, V(i+1), V(i+1), comm)); + H(i+1, i) = hypre_sqrt(InnerProd(n, V(i+1), V(i+1), comm)); /* V(i+1) = V(i+1) / H(i+1, i) */ ScaleVector(n, 1.0 / H(i+1, i), V(i+1)); @@ -181,7 +181,7 @@ void FGMRES_ParaSails(Matrix *mat, ParaSails *ps, HYPRE_Real *b, HYPRE_Real *x, /* compute exact residual norm reduction */ MatrixMatvec(mat, x, V(0)); /* V(0) = A*x */ Axpy(n, -1.0, b, V(0)); /* V(0) = V(0) - b */ - beta = sqrt(InnerProd(n, V(0), V(0), comm)); /* beta = norm(V(0)) */ + beta = hypre_sqrt(InnerProd(n, V(0), V(0), comm)); /* beta = norm(V(0)) */ rel_resid = beta / resid0; if (mype == 0) diff --git a/external/hypre/src/distributed_ls/ParaSails/Hash.c b/external/hypre/src/distributed_ls/ParaSails/Hash.c index c872e390..55a20a4c 100644 --- a/external/hypre/src/distributed_ls/ParaSails/Hash.c +++ b/external/hypre/src/distributed_ls/ParaSails/Hash.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/ParaSails/Hash.h b/external/hypre/src/distributed_ls/ParaSails/Hash.h index cf7a7af9..116f494d 100644 --- a/external/hypre/src/distributed_ls/ParaSails/Hash.h +++ b/external/hypre/src/distributed_ls/ParaSails/Hash.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/ParaSails/LoadBal.c b/external/hypre/src/distributed_ls/ParaSails/LoadBal.c index 2f6d60c7..60deb4b5 100644 --- a/external/hypre/src/distributed_ls/ParaSails/LoadBal.c +++ b/external/hypre/src/distributed_ls/ParaSails/LoadBal.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/ParaSails/LoadBal.h b/external/hypre/src/distributed_ls/ParaSails/LoadBal.h index c375354f..066ba0be 100644 --- a/external/hypre/src/distributed_ls/ParaSails/LoadBal.h +++ b/external/hypre/src/distributed_ls/ParaSails/LoadBal.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/ParaSails/Matrix.c b/external/hypre/src/distributed_ls/ParaSails/Matrix.c index ef45ca0a..cc9f3622 100644 --- a/external/hypre/src/distributed_ls/ParaSails/Matrix.c +++ b/external/hypre/src/distributed_ls/ParaSails/Matrix.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -181,10 +181,16 @@ void MatrixSetRow(Matrix *mat, HYPRE_Int row, HYPRE_Int len, HYPRE_Int *ind, HYP mat->vals[row] = (HYPRE_Real *) MemAlloc(mat->mem, len*sizeof(HYPRE_Real)); if (ind != NULL) - hypre_TMemcpy(mat->inds[row], ind, HYPRE_Int, len, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + { + //hypre_TMemcpy(mat->inds[row], ind, HYPRE_Int, len, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + memcpy(mat->inds[row], ind, sizeof(HYPRE_Int) * len); + } if (val != NULL) - hypre_TMemcpy(mat->vals[row], val, HYPRE_Real, len, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + { + //hypre_TMemcpy(mat->vals[row], val, HYPRE_Real, len, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + memcpy(mat->vals[row], val, sizeof(HYPRE_Real) * len); + } } /*-------------------------------------------------------------------------- diff --git a/external/hypre/src/distributed_ls/ParaSails/Matrix.h b/external/hypre/src/distributed_ls/ParaSails/Matrix.h index 7cb24f11..c754be09 100644 --- a/external/hypre/src/distributed_ls/ParaSails/Matrix.h +++ b/external/hypre/src/distributed_ls/ParaSails/Matrix.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/ParaSails/Mem.c b/external/hypre/src/distributed_ls/ParaSails/Mem.c index 2edb8056..ec336808 100644 --- a/external/hypre/src/distributed_ls/ParaSails/Mem.c +++ b/external/hypre/src/distributed_ls/ParaSails/Mem.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -38,7 +38,7 @@ * MemCreate - Return (a pointer to) a memory pool object. *--------------------------------------------------------------------------*/ -Mem *MemCreate() +Mem *MemCreate(void) { Mem *m = hypre_TAlloc(Mem, 1, HYPRE_MEMORY_HOST); diff --git a/external/hypre/src/distributed_ls/ParaSails/Mem.h b/external/hypre/src/distributed_ls/ParaSails/Mem.h index 26e58654..2092ae15 100644 --- a/external/hypre/src/distributed_ls/ParaSails/Mem.h +++ b/external/hypre/src/distributed_ls/ParaSails/Mem.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -33,7 +33,7 @@ typedef struct } Mem; -Mem *MemCreate(); +Mem *MemCreate(void); void MemDestroy(Mem *m); char *MemAlloc(Mem *m, HYPRE_Int size); void MemStat(Mem *m, FILE *stream, char *msg); diff --git a/external/hypre/src/distributed_ls/ParaSails/Numbering.c b/external/hypre/src/distributed_ls/ParaSails/Numbering.c index 878ee42e..80a9b576 100644 --- a/external/hypre/src/distributed_ls/ParaSails/Numbering.c +++ b/external/hypre/src/distributed_ls/ParaSails/Numbering.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/ParaSails/Numbering.h b/external/hypre/src/distributed_ls/ParaSails/Numbering.h index 969c6e68..1ed2317e 100644 --- a/external/hypre/src/distributed_ls/ParaSails/Numbering.h +++ b/external/hypre/src/distributed_ls/ParaSails/Numbering.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/ParaSails/OrderStat.c b/external/hypre/src/distributed_ls/ParaSails/OrderStat.c index be9e9871..431a6168 100644 --- a/external/hypre/src/distributed_ls/ParaSails/OrderStat.c +++ b/external/hypre/src/distributed_ls/ParaSails/OrderStat.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/ParaSails/OrderStat.h b/external/hypre/src/distributed_ls/ParaSails/OrderStat.h index 38e314b4..b1703b5c 100644 --- a/external/hypre/src/distributed_ls/ParaSails/OrderStat.h +++ b/external/hypre/src/distributed_ls/ParaSails/OrderStat.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/ParaSails/ParaSails.c b/external/hypre/src/distributed_ls/ParaSails/ParaSails.c index 2c63d8ae..e09236d4 100644 --- a/external/hypre/src/distributed_ls/ParaSails/ParaSails.c +++ b/external/hypre/src/distributed_ls/ParaSails/ParaSails.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -41,7 +41,6 @@ static void bzero(char *a, HYPRE_Int n) {HYPRE_Int i; for (i=0; icomm, &npes); *costp = 0.0; @@ -844,16 +845,19 @@ static void ConstructPatternForEachRow(HYPRE_Int symmetric, PrunedRows *pruned_r /* Following statement allocates space but does not store values */ MatrixSetRow(M, row+M->beg_row, len, ind, NULL); - nnz += len; (*costp) += (HYPRE_Real) len*len*len; +#ifdef PARASAILS_DEBUG + nnz += len; +#endif } -#if 0 +#ifdef PARASAILS_DEBUG { - HYPRE_Int mype; - hypre_MPI_Comm_rank(hypre_MPI_COMM_WORLD, &mype); - hypre_printf("%d: nnz: %10d ********* cost %7.1e\n", mype, nnz, *costp); - fflush(stdout); + HYPRE_Int mype; + + hypre_MPI_Comm_rank(hypre_MPI_COMM_WORLD, &mype); + hypre_printf("%d: nnz: %10d ********* cost %7.1e\n", mype, nnz, *costp); + fflush(stdout); } #endif @@ -869,16 +873,18 @@ static void ConstructPatternForEachRow(HYPRE_Int symmetric, PrunedRows *pruned_r * This is the approximate inverse with lower triangular pattern *--------------------------------------------------------------------------*/ -static void ConstructPatternForEachRowExt(HYPRE_Int symmetric, - PrunedRows *pruned_rows_global, PrunedRows *pruned_rows_local, +static void ConstructPatternForEachRowExt(HYPRE_Int symmetric, + PrunedRows *pruned_rows_global, PrunedRows *pruned_rows_local, HYPRE_Int num_levels, Numbering *numb, Matrix *M, HYPRE_Real *costp) { HYPRE_Int row, len, *ind, level, lenprev, *indprev; HYPRE_Int i, j; RowPatt *row_patt; RowPatt *row_patt2; - HYPRE_Int nnz = 0; HYPRE_Int npes; +#ifdef PARASAILS_DEBUG + HYPRE_Int nnz = 0; +#endif hypre_MPI_Comm_size(M->comm, &npes); *costp = 0.0; @@ -906,7 +912,7 @@ static void ConstructPatternForEachRowExt(HYPRE_Int symmetric, } /*********************** - * Now do the transpose + * Now do the transpose ***********************/ /* Get initial pattern for row */ @@ -969,16 +975,19 @@ static void ConstructPatternForEachRowExt(HYPRE_Int symmetric, /* Following statement allocates space but does not store values */ MatrixSetRow(M, row+M->beg_row, len, ind, NULL); - nnz += len; (*costp) += (HYPRE_Real) len*len*len; +#ifdef PARASAILS_DEBUG + nnz += len; +#endif } -#if 0 +#ifdef PARASAILS_DEBUG { - HYPRE_Int mype; - hypre_MPI_Comm_rank(hypre_MPI_COMM_WORLD, &mype); - hypre_printf("%d: nnz: %10d ********* cost %7.1e\n", mype, nnz, *costp); - fflush(stdout); + HYPRE_Int mype; + + hypre_MPI_Comm_rank(hypre_MPI_COMM_WORLD, &mype); + hypre_printf("%d: nnz: %10d ********* cost %7.1e\n", mype, nnz, *costp); + fflush(stdout); } #endif @@ -1000,11 +1009,13 @@ static HYPRE_Int ComputeValuesSym(StoredRows *stored_rows, Matrix *mat, HYPRE_Real *ahat, *ahatp; HYPRE_Int i, j, len2, *ind2, loc; HYPRE_Real *val2, temp; - HYPRE_Real time0, time1, timet = 0.0, timea = 0.0; + HYPRE_Int error = 0; +#ifdef PARASAILS_DEBUG + HYPRE_Real time0, time1; + HYPRE_Real timet = 0.0, timea = 0.0; HYPRE_Real ahatcost = 0.0; - - HYPRE_Real error = 0; +#endif #ifndef ESSL char uplo = 'L'; @@ -1051,7 +1062,9 @@ static HYPRE_Int ComputeValuesSym(StoredRows *stored_rows, Matrix *mat, memset(ahat, 0, len*len * sizeof(HYPRE_Real)); #endif +#ifdef PARASAILS_DEBUG time0 = hypre_MPI_Wtime(); +#endif /* Form ahat matrix, entries correspond to indices in "ind" only */ ahatp = ahat; @@ -1105,9 +1118,11 @@ static HYPRE_Int ComputeValuesSym(StoredRows *stored_rows, Matrix *mat, #endif } +#ifdef PARASAILS_DEBUG time1 = hypre_MPI_Wtime(); - timea += (time1-time0); + timea += (time1 - time0); ahatcost += (HYPRE_Real) (len*len2); +#endif /* Set the right-hand side */ /* bzero((char *) val, len*sizeof(HYPRE_Real));*/ @@ -1121,7 +1136,9 @@ static HYPRE_Int ComputeValuesSym(StoredRows *stored_rows, Matrix *mat, for (i=0; iend_row-local_beg_row+1, maxlen); - fflush(stdout); + HYPRE_Int mype; + + hypre_MPI_Comm_rank(hypre_MPI_COMM_WORLD, &mype); + hypre_printf("%d: Time for ahat: %f, for local solves: %f\n", mype, timea, timet); + hypre_printf("%d: ahatcost: %7.1e, numrows: %d, maxlen: %d\n", + mype, ahatcost, mat->end_row-local_beg_row+1, maxlen); + fflush(stdout); } #endif @@ -1197,7 +1218,11 @@ static HYPRE_Int ComputeValuesNonsym(StoredRows *stored_rows, Matrix *mat, HYPRE_Int i, j, len2, *ind2, loc; HYPRE_Real *val2; - HYPRE_Real time0, time1, timet = 0.0, timea = 0.0; + +#ifdef PARASAILS_DEBUG + HYPRE_Real time0, time1; + HYPRE_Real timet = 0.0, timea = 0.0; +#endif HYPRE_Int npat; HYPRE_Int pattsize = 1000; @@ -1226,7 +1251,9 @@ static HYPRE_Int ComputeValuesNonsym(StoredRows *stored_rows, Matrix *mat, /* Compute values for row "row" of approximate inverse */ for (row=local_beg_row; row<=mat->end_row; row++) { +#ifdef PARASAILS_DEBUG time0 = hypre_MPI_Wtime(); +#endif /* Retrieve local indices */ MatrixGetRow(mat, row - mat->beg_row, &len, &ind, &val); @@ -1286,8 +1313,10 @@ static HYPRE_Int ComputeValuesNonsym(StoredRows *stored_rows, Matrix *mat, ahatp += npat; } +#ifdef PARASAILS_DEBUG time1 = hypre_MPI_Wtime(); - timea += (time1-time0); + timea += (time1 - time0); +#endif /* Reallocate bhat if necessary */ if (npat > bhat_size) @@ -1309,7 +1338,9 @@ static HYPRE_Int ComputeValuesNonsym(StoredRows *stored_rows, Matrix *mat, for (i=0; ithresh < 0.0) ps->thresh = SelectThresh(ps->comm, A, diag_scale, -ps->thresh); - pruned_rows_global = PrunedRowsCreate(A, PARASAILS_NROWS, diag_scale, + pruned_rows_global = PrunedRowsCreate(A, PARASAILS_NROWS, diag_scale, thresh_global); - pruned_rows_local = PrunedRowsCreate(A, PARASAILS_NROWS, diag_scale, + pruned_rows_local = PrunedRowsCreate(A, PARASAILS_NROWS, diag_scale, thresh_local); - ExchangePrunedRowsExt(ps->comm, A, ps->numb, + ExchangePrunedRowsExt(ps->comm, A, ps->numb, pruned_rows_global, pruned_rows_local, ps->num_levels); - ExchangePrunedRowsExt2(ps->comm, A, ps->numb, + ExchangePrunedRowsExt2(ps->comm, A, ps->numb, pruned_rows_global, pruned_rows_local, ps->num_levels); ConstructPatternForEachRowExt(ps->symmetric, pruned_rows_global, @@ -1781,7 +1815,7 @@ HYPRE_Int ParaSailsSetupValues(ParaSails *ps, Matrix *A, HYPRE_Real filter) if (ps->symmetric) { - error += + error += ComputeValuesSym(stored_rows, ps->M, load_bal->beg_row, ps->numb, ps->symmetric); @@ -1795,7 +1829,7 @@ HYPRE_Int ParaSailsSetupValues(ParaSails *ps, Matrix *A, HYPRE_Real filter) } else { - error += + error += ComputeValuesNonsym(stored_rows, ps->M, load_bal->beg_row, ps->numb); for (i=0; inum_taken; i++) @@ -1957,7 +1991,7 @@ HYPRE_Real ParaSailsStatsPattern(ParaSails *ps, Matrix *A) nnza = (nnza - n) / 2 + n; } - hypre_MPI_Allreduce(&ps->setup_pattern_time, &max_pattern_time, + hypre_MPI_Allreduce(&ps->setup_pattern_time, &max_pattern_time, 1, hypre_MPI_REAL, hypre_MPI_MAX, comm); hypre_MPI_Allreduce(&ps->cost, &max_cost, 1, hypre_MPI_REAL, hypre_MPI_MAX, comm); hypre_MPI_Allreduce(&ps->cost, &ave_cost, 1, hypre_MPI_REAL, hypre_MPI_SUM, comm); @@ -2006,7 +2040,7 @@ void ParaSailsStatsValues(ParaSails *ps, Matrix *A) nnza = (nnza - n) / 2 + n; } - hypre_MPI_Allreduce(&ps->setup_values_time, &max_values_time, + hypre_MPI_Allreduce(&ps->setup_values_time, &max_values_time, 1, hypre_MPI_REAL, hypre_MPI_MAX, comm); if (!mype) diff --git a/external/hypre/src/distributed_ls/ParaSails/ParaSails.h b/external/hypre/src/distributed_ls/ParaSails/ParaSails.h index b0345792..79911eca 100644 --- a/external/hypre/src/distributed_ls/ParaSails/ParaSails.h +++ b/external/hypre/src/distributed_ls/ParaSails/ParaSails.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -21,6 +21,8 @@ #ifndef _PARASAILS_H #define _PARASAILS_H +//#define PARASAILS_DEBUG + #ifdef __cplusplus extern "C" { #endif @@ -50,9 +52,9 @@ ParaSails; ParaSails *ParaSailsCreate(MPI_Comm comm, HYPRE_Int beg_row, HYPRE_Int end_row, HYPRE_Int sym); void ParaSailsDestroy(ParaSails *ps); -void ParaSailsSetupPattern(ParaSails *ps, Matrix *A, +void ParaSailsSetupPattern(ParaSails *ps, Matrix *A, HYPRE_Real thresh, HYPRE_Int num_levels); -void ParaSailsSetupPatternExt(ParaSails *ps, Matrix *A, +void ParaSailsSetupPatternExt(ParaSails *ps, Matrix *A, HYPRE_Real thresh_global, HYPRE_Real thresh_local, HYPRE_Int num_levels); HYPRE_Int ParaSailsSetupValues(ParaSails *ps, Matrix *A, HYPRE_Real filter); void ParaSailsApply(ParaSails *ps, HYPRE_Real *u, HYPRE_Real *v); @@ -63,5 +65,5 @@ void ParaSailsStatsValues(ParaSails *ps, Matrix *A); #ifdef __cplusplus } #endif - + #endif /* _PARASAILS_H */ diff --git a/external/hypre/src/distributed_ls/ParaSails/PrunedRows.c b/external/hypre/src/distributed_ls/ParaSails/PrunedRows.c index d12cfa19..83d8116f 100644 --- a/external/hypre/src/distributed_ls/ParaSails/PrunedRows.c +++ b/external/hypre/src/distributed_ls/ParaSails/PrunedRows.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/ParaSails/PrunedRows.h b/external/hypre/src/distributed_ls/ParaSails/PrunedRows.h index 959e6e55..b6b8447e 100644 --- a/external/hypre/src/distributed_ls/ParaSails/PrunedRows.h +++ b/external/hypre/src/distributed_ls/ParaSails/PrunedRows.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/ParaSails/RowPatt.c b/external/hypre/src/distributed_ls/ParaSails/RowPatt.c index 2dfb6eee..3724d797 100644 --- a/external/hypre/src/distributed_ls/ParaSails/RowPatt.c +++ b/external/hypre/src/distributed_ls/ParaSails/RowPatt.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/ParaSails/RowPatt.h b/external/hypre/src/distributed_ls/ParaSails/RowPatt.h index 11b9a24b..6793c90d 100644 --- a/external/hypre/src/distributed_ls/ParaSails/RowPatt.h +++ b/external/hypre/src/distributed_ls/ParaSails/RowPatt.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/ParaSails/StoredRows.c b/external/hypre/src/distributed_ls/ParaSails/StoredRows.c index 86f8d0a9..5b850d4e 100644 --- a/external/hypre/src/distributed_ls/ParaSails/StoredRows.c +++ b/external/hypre/src/distributed_ls/ParaSails/StoredRows.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/ParaSails/StoredRows.h b/external/hypre/src/distributed_ls/ParaSails/StoredRows.h index 83a69b0e..2de6dcf9 100644 --- a/external/hypre/src/distributed_ls/ParaSails/StoredRows.h +++ b/external/hypre/src/distributed_ls/ParaSails/StoredRows.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/ParaSails/convert.c b/external/hypre/src/distributed_ls/ParaSails/convert.c index 9a20944b..8b30c0ca 100644 --- a/external/hypre/src/distributed_ls/ParaSails/convert.c +++ b/external/hypre/src/distributed_ls/ParaSails/convert.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/ParaSails/hypre_ParaSails.c b/external/hypre/src/distributed_ls/ParaSails/hypre_ParaSails.c index 593eb551..6c72c678 100644 --- a/external/hypre/src/distributed_ls/ParaSails/hypre_ParaSails.c +++ b/external/hypre/src/distributed_ls/ParaSails/hypre_ParaSails.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -31,7 +31,7 @@ typedef struct hypre_ParaSails_struct; /*-------------------------------------------------------------------------- - * balance_info - Dump out information about the partitioning of the + * balance_info - Dump out information about the partitioning of the * matrix, which affects load balance *--------------------------------------------------------------------------*/ @@ -120,7 +120,7 @@ static void matvec_timing(MPI_Comm comm, Matrix *mat) hypre_MPI_Comm_rank(comm, &mype); if (mype == 0) - hypre_printf("Timings: %f %f %f Serial: %f %f %f\n", + hypre_printf("Timings: %f %f %f Serial: %f %f %f\n", trial1, trial2, trial3, trial4, trial5, trial6); fflush(stdout); @@ -131,14 +131,16 @@ static void matvec_timing(MPI_Comm comm, Matrix *mat) #endif /*-------------------------------------------------------------------------- - * convert_matrix - Create and convert distributed matrix to native + * convert_matrix - Create and convert distributed matrix to native * data structure of ParaSails *--------------------------------------------------------------------------*/ static Matrix *convert_matrix(MPI_Comm comm, HYPRE_DistributedMatrix distmat) { - HYPRE_Int beg_row, end_row, row, dummy; - HYPRE_Int len, *ind; + HYPRE_Int row; + HYPRE_BigInt beg_row, end_row, dummy; + HYPRE_Int len; + HYPRE_BigInt *ind; HYPRE_Real *val; Matrix *mat; @@ -150,7 +152,7 @@ static Matrix *convert_matrix(MPI_Comm comm, HYPRE_DistributedMatrix distmat) for (row=beg_row; row<=end_row; row++) { HYPRE_DistributedMatrixGetRow(distmat, row, &len, &ind, &val); - MatrixSetRow(mat, row, len, ind, val); + MatrixSetRow(mat, row, len, (HYPRE_Int*) ind, val); HYPRE_DistributedMatrixRestoreRow(distmat, row, &len, &ind, &val); } @@ -216,7 +218,7 @@ HYPRE_Int hypre_ParaSailsSetup(hypre_ParaSails obj, ParaSailsDestroy(internal->ps); - internal->ps = ParaSailsCreate(internal->comm, + internal->ps = ParaSailsCreate(internal->comm, mat->beg_row, mat->end_row, sym); ParaSailsSetupPattern(internal->ps, mat, thresh, nlevels); @@ -256,7 +258,7 @@ HYPRE_Int hypre_ParaSailsSetupPattern(hypre_ParaSails obj, ParaSailsDestroy(internal->ps); - internal->ps = ParaSailsCreate(internal->comm, + internal->ps = ParaSailsCreate(internal->comm, mat->beg_row, mat->end_row, sym); ParaSailsSetupPattern(internal->ps, mat, thresh, nlevels); @@ -301,7 +303,7 @@ HYPRE_Int hypre_ParaSailsSetupValues(hypre_ParaSails obj, } /*-------------------------------------------------------------------------- - * hypre_ParaSailsApply - Apply the ParaSails preconditioner to an array + * hypre_ParaSailsApply - Apply the ParaSails preconditioner to an array * "u", and return the result in the array "v". *--------------------------------------------------------------------------*/ @@ -341,9 +343,9 @@ hypre_ParaSailsBuildIJMatrix(hypre_ParaSails obj, HYPRE_IJMatrix *pij_A) ParaSails *ps = internal->ps; Matrix *mat = internal->ps->M; - HYPRE_Int *diag_sizes, *offdiag_sizes, local_row, i, j; + HYPRE_Int *col_inds, *diag_sizes, *offdiag_sizes, local_row, j; + HYPRE_BigInt i; HYPRE_Int size; - HYPRE_Int *col_inds; HYPRE_Real *values; HYPRE_IJMatrixCreate( ps->comm, ps->beg_row, ps->end_row, @@ -382,7 +384,8 @@ hypre_ParaSailsBuildIJMatrix(hypre_ParaSails obj, HYPRE_IJMatrix *pij_A) { MatrixGetRow(mat, local_row, &size, &col_inds, &values); - HYPRE_IJMatrixSetValues( *pij_A, 1, &size, &i, (const HYPRE_Int *) col_inds, + HYPRE_IJMatrixSetValues( *pij_A, 1, &size, &i, + (const HYPRE_BigInt *) col_inds, (const HYPRE_Real *) values ); NumberingGlobalToLocal(ps->numb, size, col_inds, col_inds); diff --git a/external/hypre/src/distributed_ls/ParaSails/hypre_ParaSails.h b/external/hypre/src/distributed_ls/ParaSails/hypre_ParaSails.h index 5133d028..892acfed 100644 --- a/external/hypre/src/distributed_ls/ParaSails/hypre_ParaSails.h +++ b/external/hypre/src/distributed_ls/ParaSails/hypre_ParaSails.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/ParaSails/permute.c b/external/hypre/src/distributed_ls/ParaSails/permute.c index a58d7cb4..2c34b51d 100644 --- a/external/hypre/src/distributed_ls/ParaSails/permute.c +++ b/external/hypre/src/distributed_ls/ParaSails/permute.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/pilut/CMakeLists.txt b/external/hypre/src/distributed_ls/pilut/CMakeLists.txt index f47c43fd..af9bb420 100644 --- a/external/hypre/src/distributed_ls/pilut/CMakeLists.txt +++ b/external/hypre/src/distributed_ls/pilut/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/pilut/DistributedMatrixPilutSolver.h b/external/hypre/src/distributed_ls/pilut/DistributedMatrixPilutSolver.h index 70463a49..dcaa5243 100644 --- a/external/hypre/src/distributed_ls/pilut/DistributedMatrixPilutSolver.h +++ b/external/hypre/src/distributed_ls/pilut/DistributedMatrixPilutSolver.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -86,7 +86,7 @@ HYPRE_Int Ul_timer; #define jr (globals->_jr) #define jw (globals->_jw) #define lastjr (globals->_lastjr) -#define lr (globals->_lr) +#define hypre_lr (globals->_lr) #define lastlr (globals->_lastlr) #define w (globals->_w) #define firstrow (globals->_firstrow) diff --git a/external/hypre/src/distributed_ls/pilut/HYPRE_DistributedMatrixPilutSolver.c b/external/hypre/src/distributed_ls/pilut/HYPRE_DistributedMatrixPilutSolver.c index 5844a356..ce73d1ad 100644 --- a/external/hypre/src/distributed_ls/pilut/HYPRE_DistributedMatrixPilutSolver.c +++ b/external/hypre/src/distributed_ls/pilut/HYPRE_DistributedMatrixPilutSolver.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -13,7 +13,7 @@ * HYPRE_NewDistributedMatrixPilutSolver *--------------------------------------------------------------------------*/ -HYPRE_Int HYPRE_NewDistributedMatrixPilutSolver( +HYPRE_Int HYPRE_NewDistributedMatrixPilutSolver( MPI_Comm comm, HYPRE_DistributedMatrix matrix, HYPRE_DistributedMatrixPilutSolver *new_solver ) @@ -26,20 +26,20 @@ HYPRE_Int HYPRE_NewDistributedMatrixPilutSolver( FactorMatType *ldu; /* Allocate structure for holding solver data */ - solver = (hypre_DistributedMatrixPilutSolver *) + solver = (hypre_DistributedMatrixPilutSolver *) hypre_CTAlloc( hypre_DistributedMatrixPilutSolver, 1, HYPRE_MEMORY_HOST); /* Initialize components of solver */ hypre_DistributedMatrixPilutSolverComm(solver) = comm; - hypre_DistributedMatrixPilutSolverDataDist(solver) = + hypre_DistributedMatrixPilutSolverDataDist(solver) = (DataDistType *) hypre_CTAlloc( DataDistType, 1 , HYPRE_MEMORY_HOST); /* Structure for holding "global variables"; makes code thread safe(r) */ - globals = hypre_DistributedMatrixPilutSolverGlobals(solver) = + globals = hypre_DistributedMatrixPilutSolverGlobals(solver) = (hypre_PilutSolverGlobals *) hypre_CTAlloc( hypre_PilutSolverGlobals, 1 , HYPRE_MEMORY_HOST); jr = NULL; - lr = NULL; + hypre_lr = NULL; jw = NULL; w = NULL; @@ -75,7 +75,7 @@ HYPRE_Int HYPRE_NewDistributedMatrixPilutSolver( DataDistTypeRowdist(hypre_DistributedMatrixPilutSolverDataDist(solver)) = (HYPRE_Int *) hypre_CTAlloc( HYPRE_Int, nprocs+1 , HYPRE_MEMORY_HOST); - hypre_DistributedMatrixPilutSolverFactorMat(solver) = + hypre_DistributedMatrixPilutSolverFactorMat(solver) = (FactorMatType *) hypre_CTAlloc( FactorMatType, 1 , HYPRE_MEMORY_HOST); ldu = hypre_DistributedMatrixPilutSolverFactorMat(solver); @@ -112,12 +112,12 @@ HYPRE_Int HYPRE_NewDistributedMatrixPilutSolver( * HYPRE_FreeDistributedMatrixPilutSolver *--------------------------------------------------------------------------*/ -HYPRE_Int HYPRE_FreeDistributedMatrixPilutSolver ( +HYPRE_Int HYPRE_FreeDistributedMatrixPilutSolver ( HYPRE_DistributedMatrixPilutSolver in_ptr ) { FactorMatType *ldu; - hypre_DistributedMatrixPilutSolver *solver = + hypre_DistributedMatrixPilutSolver *solver = (hypre_DistributedMatrixPilutSolver *) in_ptr; #ifdef HYPRE_TIMING @@ -127,7 +127,7 @@ HYPRE_Int HYPRE_FreeDistributedMatrixPilutSolver ( hypre_TFree( DataDistTypeRowdist(hypre_DistributedMatrixPilutSolverDataDist(solver)), HYPRE_MEMORY_HOST); hypre_TFree( hypre_DistributedMatrixPilutSolverDataDist(solver) , HYPRE_MEMORY_HOST); - + /* Free malloced members of the FactorMat member */ ldu = hypre_DistributedMatrixPilutSolverFactorMat(solver); @@ -208,9 +208,10 @@ HYPRE_Int HYPRE_FreeDistributedMatrixPilutSolver ( * HYPRE_DistributedMatrixPilutSolverInitialize *--------------------------------------------------------------------------*/ -HYPRE_Int HYPRE_DistributedMatrixPilutSolverInitialize ( - HYPRE_DistributedMatrixPilutSolver solver ) +HYPRE_Int +HYPRE_DistributedMatrixPilutSolverInitialize( HYPRE_DistributedMatrixPilutSolver solver ) { + HYPRE_UNUSED_VAR(solver); return(0); } @@ -219,11 +220,11 @@ HYPRE_Int HYPRE_DistributedMatrixPilutSolverInitialize ( * HYPRE_DistributedMatrixPilutSolverSetMatrix *--------------------------------------------------------------------------*/ -HYPRE_Int HYPRE_DistributedMatrixPilutSolverSetMatrix( +HYPRE_Int HYPRE_DistributedMatrixPilutSolverSetMatrix( HYPRE_DistributedMatrixPilutSolver in_ptr, HYPRE_DistributedMatrix matrix ) { - hypre_DistributedMatrixPilutSolver *solver = + hypre_DistributedMatrixPilutSolver *solver = (hypre_DistributedMatrixPilutSolver *) in_ptr; hypre_DistributedMatrixPilutSolverMatrix( solver ) = matrix; @@ -235,10 +236,10 @@ HYPRE_Int HYPRE_DistributedMatrixPilutSolverSetMatrix( *--------------------------------------------------------------------------*/ HYPRE_DistributedMatrix - HYPRE_DistributedMatrixPilutSolverGetMatrix( + HYPRE_DistributedMatrixPilutSolverGetMatrix( HYPRE_DistributedMatrixPilutSolver in_ptr ) { - hypre_DistributedMatrixPilutSolver *solver = + hypre_DistributedMatrixPilutSolver *solver = (hypre_DistributedMatrixPilutSolver *) in_ptr; return( hypre_DistributedMatrixPilutSolverMatrix( solver ) ); @@ -249,15 +250,15 @@ HYPRE_DistributedMatrix * HYPRE_DistributedMatrixPilutSolverSetFirstLocalRow *--------------------------------------------------------------------------*/ -HYPRE_Int HYPRE_DistributedMatrixPilutSolverSetNumLocalRow( +HYPRE_Int HYPRE_DistributedMatrixPilutSolverSetNumLocalRow( HYPRE_DistributedMatrixPilutSolver in_ptr, HYPRE_Int FirstLocalRow ) { - hypre_DistributedMatrixPilutSolver *solver = + hypre_DistributedMatrixPilutSolver *solver = (hypre_DistributedMatrixPilutSolver *) in_ptr; hypre_PilutSolverGlobals *globals = hypre_DistributedMatrixPilutSolverGlobals(solver); - DataDistTypeRowdist(hypre_DistributedMatrixPilutSolverDataDist( solver ))[mype] = + DataDistTypeRowdist(hypre_DistributedMatrixPilutSolverDataDist( solver ))[mype] = FirstLocalRow; return hypre_error_flag; @@ -270,11 +271,11 @@ HYPRE_Int HYPRE_DistributedMatrixPilutSolverSetNumLocalRow( * row of U. *--------------------------------------------------------------------------*/ -HYPRE_Int HYPRE_DistributedMatrixPilutSolverSetFactorRowSize( +HYPRE_Int HYPRE_DistributedMatrixPilutSolverSetFactorRowSize( HYPRE_DistributedMatrixPilutSolver in_ptr, HYPRE_Int size ) { - hypre_DistributedMatrixPilutSolver *solver = + hypre_DistributedMatrixPilutSolver *solver = (hypre_DistributedMatrixPilutSolver *) in_ptr; hypre_DistributedMatrixPilutSolverGmaxnz( solver ) = size; @@ -286,11 +287,11 @@ HYPRE_Int HYPRE_DistributedMatrixPilutSolverSetFactorRowSize( * HYPRE_DistributedMatrixPilutSolverSetDropTolerance *--------------------------------------------------------------------------*/ -HYPRE_Int HYPRE_DistributedMatrixPilutSolverSetDropTolerance( +HYPRE_Int HYPRE_DistributedMatrixPilutSolverSetDropTolerance( HYPRE_DistributedMatrixPilutSolver in_ptr, HYPRE_Real tolerance ) { - hypre_DistributedMatrixPilutSolver *solver = + hypre_DistributedMatrixPilutSolver *solver = (hypre_DistributedMatrixPilutSolver *) in_ptr; hypre_DistributedMatrixPilutSolverTol( solver ) = tolerance; @@ -302,11 +303,11 @@ HYPRE_Int HYPRE_DistributedMatrixPilutSolverSetDropTolerance( * HYPRE_DistributedMatrixPilutSolverSetMaxIts *--------------------------------------------------------------------------*/ -HYPRE_Int HYPRE_DistributedMatrixPilutSolverSetMaxIts( +HYPRE_Int HYPRE_DistributedMatrixPilutSolverSetMaxIts( HYPRE_DistributedMatrixPilutSolver in_ptr, HYPRE_Int its ) { - hypre_DistributedMatrixPilutSolver *solver = + hypre_DistributedMatrixPilutSolver *solver = (hypre_DistributedMatrixPilutSolver *) in_ptr; hypre_DistributedMatrixPilutSolverMaxIts( solver ) = its; @@ -314,11 +315,11 @@ HYPRE_Int HYPRE_DistributedMatrixPilutSolverSetMaxIts( return hypre_error_flag; } -HYPRE_Int HYPRE_DistributedMatrixPilutSolverSetLogging( +HYPRE_Int HYPRE_DistributedMatrixPilutSolverSetLogging( HYPRE_DistributedMatrixPilutSolver in_ptr, HYPRE_Int logging ) { - hypre_DistributedMatrixPilutSolver *solver = + hypre_DistributedMatrixPilutSolver *solver = (hypre_DistributedMatrixPilutSolver *) in_ptr; hypre_PilutSolverGlobals *globals = hypre_DistributedMatrixPilutSolverGlobals(solver); @@ -336,13 +337,12 @@ HYPRE_Int HYPRE_DistributedMatrixPilutSolverSetLogging( HYPRE_Int HYPRE_DistributedMatrixPilutSolverSetup( HYPRE_DistributedMatrixPilutSolver in_ptr ) { - HYPRE_Int m, n, nprocs, start, end, *rowdist, col0, coln, ierr; - hypre_DistributedMatrixPilutSolver *solver = + HYPRE_Int nprocs, *rowdist, ierr; + HYPRE_BigInt m, n, start, end, col0, coln; + hypre_DistributedMatrixPilutSolver *solver = (hypre_DistributedMatrixPilutSolver *) in_ptr; hypre_PilutSolverGlobals *globals = hypre_DistributedMatrixPilutSolverGlobals(solver); - HYPRE_Int logging = globals ? globals->logging : 0; - if(hypre_DistributedMatrixPilutSolverMatrix(solver) == NULL ) { @@ -361,7 +361,7 @@ HYPRE_Int HYPRE_DistributedMatrixPilutSolverSetup( HYPRE_DistributedMatrixPilutS HYPRE_DistributedMatrixGetLocalRange( hypre_DistributedMatrixPilutSolverMatrix(solver), &start, &end, &col0, &coln); - DataDistTypeLnrows(hypre_DistributedMatrixPilutSolverDataDist( solver )) = + DataDistTypeLnrows(hypre_DistributedMatrixPilutSolverDataDist( solver )) = end - start + 1; /* Set up DataDist entry in distributed_solver */ @@ -370,7 +370,7 @@ HYPRE_Int HYPRE_DistributedMatrixPilutSolverSetup( HYPRE_DistributedMatrixPilutS rowdist = DataDistTypeRowdist( hypre_DistributedMatrixPilutSolverDataDist( solver ) ); - hypre_MPI_Allgather( &start, 1, HYPRE_MPI_INT, rowdist, 1, HYPRE_MPI_INT, + hypre_MPI_Allgather( &start, 1, HYPRE_MPI_INT, rowdist, 1, HYPRE_MPI_INT, hypre_DistributedMatrixPilutSolverComm(solver) ); rowdist[ nprocs ] = n; @@ -399,7 +399,7 @@ HYPRE_Int HYPRE_DistributedMatrixPilutSolverSetup( HYPRE_DistributedMatrixPilutS } #endif - if (ierr) + if (ierr) { hypre_error(HYPRE_ERROR_GENERIC); /* return hypre_error_flag; */ @@ -414,7 +414,7 @@ HYPRE_Int HYPRE_DistributedMatrixPilutSolverSetup( HYPRE_DistributedMatrixPilutS hypre_BeginTiming( Setup_timer ); #endif - ierr = hypre_SetUpLUFactor( hypre_DistributedMatrixPilutSolverDataDist (solver), + ierr = hypre_SetUpLUFactor( hypre_DistributedMatrixPilutSolverDataDist (solver), hypre_DistributedMatrixPilutSolverFactorMat (solver), hypre_DistributedMatrixPilutSolverGmaxnz (solver), hypre_DistributedMatrixPilutSolverGlobals (solver) ); @@ -425,13 +425,15 @@ HYPRE_Int HYPRE_DistributedMatrixPilutSolverSetup( HYPRE_DistributedMatrixPilutS } #endif - if (ierr) + if (ierr) { hypre_error(HYPRE_ERROR_GENERIC); /* return hypre_error_flag; */ } #ifdef HYPRE_DEBUG + HYPRE_Int logging = globals ? globals->logging : 0; + if (logging) { fflush(stdout); @@ -452,16 +454,16 @@ HYPRE_Int HYPRE_DistributedMatrixPilutSolverSolve( HYPRE_DistributedMatrixPilutS HYPRE_Real *x, HYPRE_Real *b ) { - hypre_DistributedMatrixPilutSolver *solver = + hypre_DistributedMatrixPilutSolver *solver = (hypre_DistributedMatrixPilutSolver *) in_ptr; /******** NOTE: Since I am using this currently as a preconditioner, I am only doing a single front and back solve. To be a general-purpose solver, this call should really be in a loop checking convergence and counting iterations. - AC - 2/12/98 + AC - 2/12/98 */ /* It should be obvious, but the current treatment of vectors is pretty - insufficient. -AC 2/12/98 + insufficient. -AC 2/12/98 */ #ifdef HYPRE_TIMING { @@ -487,4 +489,3 @@ HYPRE_Int HYPRE_DistributedMatrixPilutSolverSolve( HYPRE_DistributedMatrixPilutS return hypre_error_flag; } - diff --git a/external/hypre/src/distributed_ls/pilut/HYPRE_DistributedMatrixPilutSolver_protos.h b/external/hypre/src/distributed_ls/pilut/HYPRE_DistributedMatrixPilutSolver_protos.h index eb3bce13..29810a0a 100644 --- a/external/hypre/src/distributed_ls/pilut/HYPRE_DistributedMatrixPilutSolver_protos.h +++ b/external/hypre/src/distributed_ls/pilut/HYPRE_DistributedMatrixPilutSolver_protos.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/pilut/HYPRE_DistributedMatrixPilutSolver_types.h b/external/hypre/src/distributed_ls/pilut/HYPRE_DistributedMatrixPilutSolver_types.h index ed583072..2b62b870 100644 --- a/external/hypre/src/distributed_ls/pilut/HYPRE_DistributedMatrixPilutSolver_types.h +++ b/external/hypre/src/distributed_ls/pilut/HYPRE_DistributedMatrixPilutSolver_types.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/pilut/comm.c b/external/hypre/src/distributed_ls/pilut/comm.c index ce5182d6..cca3302c 100644 --- a/external/hypre/src/distributed_ls/pilut/comm.c +++ b/external/hypre/src/distributed_ls/pilut/comm.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/pilut/const.h b/external/hypre/src/distributed_ls/pilut/const.h index 8712246b..25a6d26a 100644 --- a/external/hypre/src/distributed_ls/pilut/const.h +++ b/external/hypre/src/distributed_ls/pilut/const.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/pilut/debug.c b/external/hypre/src/distributed_ls/pilut/debug.c index 54958b4c..1df1b49c 100644 --- a/external/hypre/src/distributed_ls/pilut/debug.c +++ b/external/hypre/src/distributed_ls/pilut/debug.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/pilut/distributed_qsort.c b/external/hypre/src/distributed_ls/pilut/distributed_qsort.c index bfb5d880..26da4c84 100644 --- a/external/hypre/src/distributed_ls/pilut/distributed_qsort.c +++ b/external/hypre/src/distributed_ls/pilut/distributed_qsort.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/pilut/distributed_qsort_si.c b/external/hypre/src/distributed_ls/pilut/distributed_qsort_si.c index 733befa7..d3d5d992 100644 --- a/external/hypre/src/distributed_ls/pilut/distributed_qsort_si.c +++ b/external/hypre/src/distributed_ls/pilut/distributed_qsort_si.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/pilut/ilu.h b/external/hypre/src/distributed_ls/pilut/ilu.h index c41ea706..d925afcb 100644 --- a/external/hypre/src/distributed_ls/pilut/ilu.h +++ b/external/hypre/src/distributed_ls/pilut/ilu.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -28,9 +28,11 @@ #include +#include "_hypre_utilities.h" #include "macros.h" #include "struct.h" #include "const.h" + #endif diff --git a/external/hypre/src/distributed_ls/pilut/ilut.c b/external/hypre/src/distributed_ls/pilut/ilut.c index 5b7d3409..a3ea1af7 100644 --- a/external/hypre/src/distributed_ls/pilut/ilut.c +++ b/external/hypre/src/distributed_ls/pilut/ilut.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -22,16 +22,16 @@ /************************************************************************* * This function is the entry point of the hypre_ILUT factorization **************************************************************************/ -HYPRE_Int hypre_ILUT(DataDistType *ddist, HYPRE_DistributedMatrix matrix, FactorMatType *ldu, +HYPRE_Int hypre_ILUT(DataDistType *ddist, HYPRE_DistributedMatrix matrix, FactorMatType *ldu, HYPRE_Int maxnz, HYPRE_Real tol, hypre_PilutSolverGlobals *globals ) { - HYPRE_Int logging = globals ? globals->logging : 0; - HYPRE_Int i, ierr; + HYPRE_Int i, ierr = 0; ReduceMatType rmat; HYPRE_Int dummy_row_ptr[2], size; HYPRE_Real *values; #ifdef HYPRE_DEBUG + HYPRE_Int logging = globals ? globals->logging : 0; if (logging) { hypre_printf("hypre_ILUT, maxnz = %d\n ", maxnz); @@ -137,7 +137,7 @@ HYPRE_Int hypre_ILUT(DataDistType *ddist, HYPRE_DistributedMatrix matrix, Factor } #endif - /*hypre_free_multi(rmat.rmat_rnz, rmat.rmat_rrowlen, + /*hypre_free_multi(rmat.rmat_rnz, rmat.rmat_rrowlen, rmat.rmat_rcolind, rmat.rmat_rvalues, -1);*/ hypre_TFree(rmat.rmat_rnz, HYPRE_MEMORY_HOST); hypre_TFree(rmat.rmat_rrowlen, HYPRE_MEMORY_HOST); @@ -149,7 +149,7 @@ HYPRE_Int hypre_ILUT(DataDistType *ddist, HYPRE_DistributedMatrix matrix, Factor /************************************************************************* -* This function computes the 2 norms of the rows and adds them into the +* This function computes the 2 norms of the rows and adds them into the * nrm2s array ... Changed to "Add" by AJC, Dec 22 1997. **************************************************************************/ void hypre_ComputeAdd2Nrms(HYPRE_Int num_rows, HYPRE_Int *rowptr, HYPRE_Real *values, HYPRE_Real *nrm2s) @@ -159,10 +159,10 @@ void hypre_ComputeAdd2Nrms(HYPRE_Int num_rows, HYPRE_Int *rowptr, HYPRE_Real *va for (i=0; i directly instead */ +/* #ifdef MACHINE_IS_CRAY #ifdef USE_SHORT #define SNRM2 SNRM2 @@ -96,12 +95,12 @@ #endif #endif #endif - +*/ /********************************************************************* * Utility Macros **********************************************************************/ /* MPI and Cray native timers. Note MPI uses doubles while Cray uses longs */ -#if MACHINE_IS_CRAY +#if defined(MACHINE_IS_CRAY) && MACHINE_IS_CRAY # define cleartimer(tmr) (tmr = 0) # define starttimer(tmr) (tmr -= rtclock()) # define stoptimer(tmr) (tmr += rtclock()) diff --git a/external/hypre/src/distributed_ls/pilut/parilut.c b/external/hypre/src/distributed_ls/pilut/parilut.c index d1139d04..81ae3959 100644 --- a/external/hypre/src/distributed_ls/pilut/parilut.c +++ b/external/hypre/src/distributed_ls/pilut/parilut.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -145,7 +145,7 @@ void hypre_ParILUT(DataDistType *ddist, FactorMatType *ldu, newperm, newiperm, vrowdist, -1);*/ hypre_TFree(jr, HYPRE_MEMORY_HOST); hypre_TFree(jw, HYPRE_MEMORY_HOST); - hypre_TFree(lr, HYPRE_MEMORY_HOST); + hypre_TFree(hypre_lr, HYPRE_MEMORY_HOST); hypre_TFree(w, HYPRE_MEMORY_HOST); hypre_TFree(pilut_map, HYPRE_MEMORY_HOST); hypre_TFree(nrmat.rmat_rnz, HYPRE_MEMORY_HOST); @@ -167,7 +167,7 @@ void hypre_ParILUT(DataDistType *ddist, FactorMatType *ldu, jr = NULL; jw = NULL; - lr = NULL; + hypre_lr = NULL; w = NULL; #ifdef HYPRE_DEBUG @@ -357,6 +357,8 @@ HYPRE_Int hypre_SelectSet(ReduceMatType *rmat, CommInfoType *cinfo, HYPRE_Int *newperm, HYPRE_Int *newiperm, hypre_PilutSolverGlobals *globals) { + HYPRE_UNUSED_VAR(iperm); + HYPRE_Int ir, i, j, k, l, num; HYPRE_Int nnz, snnbr; HYPRE_Int *rcolind, *snbrind, *snbrptr, *srowind; @@ -592,6 +594,8 @@ void hypre_ComputeRmat(FactorMatType *ldu, ReduceMatType *rmat, HYPRE_Int *newperm, HYPRE_Int *newiperm, HYPRE_Int nmis, HYPRE_Real tol, hypre_PilutSolverGlobals *globals) { + HYPRE_UNUSED_VAR(perm); + HYPRE_Int i, ir, inr, start, k, kk, l, m, end, nnz; HYPRE_Int *usrowptr, *uerowptr, *ucolind, *incolind, *rcolind, rrowlen; HYPRE_Real *uvalues, *nrm2s, *invalues, *rvalues, *dvalues; @@ -651,9 +655,9 @@ void hypre_ComputeRmat(FactorMatType *ldu, ReduceMatType *rmat, /* record L elements */ if (IsInMIS(pilut_map[rcolind[lastjr]])) { if (rcolind[lastjr] >= firstrow && rcolind[lastjr] < lastrow) - lr[lastlr] = (newiperm[rcolind[lastjr]-firstrow] << 1); + hypre_lr[lastlr] = (newiperm[rcolind[lastjr]-firstrow] << 1); else { - lr[lastlr] = pilut_map[rcolind[lastjr]]; /* map[] == (l<<1) | 1 */ + hypre_lr[lastlr] = pilut_map[rcolind[lastjr]]; /* map[] == (l<<1) | 1 */ hypre_assert(incolind[StripMIS(pilut_map[rcolind[lastjr]])+1] == rcolind[lastjr]); } @@ -683,20 +687,20 @@ void hypre_ComputeRmat(FactorMatType *ldu, ReduceMatType *rmat, mult = w[jr[k]]*dvalues[kk]; w[jr[k]] = mult; - if (fabs(mult) < rtol) + if (hypre_abs(mult) < rtol) continue; /* First drop test */ for (l=usrowptr[kk]; l= firstrow && ucolind[l] < lastrow); - lr[lastlr] = (newiperm[ucolind[l]-firstrow] << 1); + hypre_lr[lastlr] = (newiperm[ucolind[l]-firstrow] << 1); lastlr++; } @@ -723,20 +727,20 @@ void hypre_ComputeRmat(FactorMatType *ldu, ReduceMatType *rmat, mult = w[jr[k]]*invalues[start]; w[jr[k]] = mult; - if (fabs(mult) < rtol) + if (hypre_abs(mult) < rtol) continue; /* First drop test */ for (l=++start; l<=end; l++) { hypre_CheckBounds(0, incolind[l], nrows, globals); m = jr[incolind[l]]; if (m == -1) { - if (fabs(mult*invalues[l]) < rtol) + if (hypre_abs(mult*invalues[l]) < rtol) continue; /* Don't worry. The fill has too small of a value */ /* record L elements -- these must be remote */ if (IsInMIS(pilut_map[incolind[l]])) { hypre_assert(incolind[l] < firstrow || incolind[l] >= lastrow); - lr[lastlr] = pilut_map[incolind[l]]; /* map[] == (l<<1) | 1 */ + hypre_lr[lastlr] = pilut_map[incolind[l]]; /* map[] == (l<<1) | 1 */ lastlr++; } @@ -778,6 +782,8 @@ void hypre_FactorLocal(FactorMatType *ldu, ReduceMatType *rmat, HYPRE_Int *newperm, HYPRE_Int *newiperm, HYPRE_Int nmis, HYPRE_Real tol, hypre_PilutSolverGlobals *globals) { + HYPRE_UNUSED_VAR(cinfo); + HYPRE_Int i, ir, k, kk, l, m, nnz, diag; HYPRE_Int *usrowptr, *uerowptr, *ucolind, *rcolind; HYPRE_Real *uvalues, *nrm2s, *rvalues, *dvalues; @@ -834,7 +840,7 @@ void hypre_FactorLocal(FactorMatType *ldu, ReduceMatType *rmat, if (rcolind[lastjr] >= firstrow && rcolind[lastjr] < lastrow && newiperm[rcolind[lastjr]-firstrow] < diag) { - lr[lastlr] = newiperm[rcolind[lastjr]-firstrow]; + hypre_lr[lastlr] = newiperm[rcolind[lastjr]-firstrow]; lastlr++; } @@ -858,14 +864,14 @@ void hypre_FactorLocal(FactorMatType *ldu, ReduceMatType *rmat, mult = w[jr[k]]*dvalues[kk]; w[jr[k]] = mult; - if (fabs(mult) < rtol) + if (hypre_abs(mult) < rtol) continue; /* First drop test */ for (l=usrowptr[kk]; l fabs(w[max])) + if (hypre_abs(w[j]) > hypre_abs(w[max])) max = j; } @@ -1255,7 +1261,7 @@ void hypre_FormDU(HYPRE_Int lrow, HYPRE_Int first, FactorMatType *ldu, /* The entries [first, lastjr) are part of U */ max = first; for (j=first+1; j fabs(w[max])) + if (hypre_abs(w[j]) > hypre_abs(w[max])) max = j; } @@ -1353,8 +1359,8 @@ void hypre_ParINIT( ReduceMatType *nrmat, CommInfoType *cinfo, HYPRE_Int *rowdis /* Allocate work space */ hypre_TFree(jr, HYPRE_MEMORY_HOST); jr = hypre_idx_malloc_init(nrows, -1, "hypre_ParILUT: jr"); - hypre_TFree(lr, HYPRE_MEMORY_HOST); - lr = hypre_idx_malloc_init(nleft, -1, "hypre_ParILUT: lr"); + hypre_TFree(hypre_lr, HYPRE_MEMORY_HOST); + hypre_lr = hypre_idx_malloc_init(nleft, -1, "hypre_ParILUT: lr"); hypre_TFree(jw, HYPRE_MEMORY_HOST); jw = hypre_idx_malloc(nleft, "hypre_ParILUT: jw"); hypre_TFree(w, HYPRE_MEMORY_HOST); diff --git a/external/hypre/src/distributed_ls/pilut/parutil.c b/external/hypre/src/distributed_ls/pilut/parutil.c index 16985fb0..56255351 100644 --- a/external/hypre/src/distributed_ls/pilut/parutil.c +++ b/external/hypre/src/distributed_ls/pilut/parutil.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -198,14 +198,14 @@ void hypre_memcpy_idx( HYPRE_Int *dest, const HYPRE_Int *src, size_t n ) /************************************************************************* * The following function copies a floating point (HYPRE_Real) array. -* Note this assumes BLAS 1 routine SCOPY. An alternative would be memcpy. +* Note this assumes BLAS 1 routine hypre_dcopy. An alternative would be memcpy. * There is a noticeable difference between this and just a for loop. **************************************************************************/ void hypre_memcpy_fp( HYPRE_Real *dest, const HYPRE_Real *src, size_t n ) { HYPRE_Int i, ni = (HYPRE_Int) n; - /*SCOPY(&n, src, &inc, dest, &inc);*/ + /*hypre_dcopy(&n, src, &inc, dest, &inc);*/ for (i=0; iddist_lnrows), x, &incx); - return sqrt(hypre_GlobalSESumDouble(sum*sum, pilut_comm)); + sum = hypre_dnrm2(&(ddist->ddist_lnrows), x, &incx); + return hypre_sqrt(hypre_GlobalSESumDouble(sum*sum, pilut_comm)); } @@ -45,7 +45,7 @@ HYPRE_Real hypre_p_ddot(DataDistType *ddist, HYPRE_Real *x, HYPRE_Real *y, { HYPRE_Int incx=1; - return hypre_GlobalSESumDouble(SDOT(&(ddist->ddist_lnrows), x, &incx, y, &incx), + return hypre_GlobalSESumDouble(hypre_ddot(&(ddist->ddist_lnrows), x, &incx, y, &incx), pilut_comm ); } diff --git a/external/hypre/src/distributed_ls/pilut/serilut.c b/external/hypre/src/distributed_ls/pilut/serilut.c index 3c7278b7..c68db3e0 100644 --- a/external/hypre/src/distributed_ls/pilut/serilut.c +++ b/external/hypre/src/distributed_ls/pilut/serilut.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -39,14 +39,14 @@ **************************************************************************/ HYPRE_Int hypre_SerILUT(DataDistType *ddist, HYPRE_DistributedMatrix matrix, FactorMatType *ldu, - ReduceMatType *rmat, HYPRE_Int maxnz, HYPRE_Real tol, + ReduceMatType *rmat, HYPRE_Int maxnz, HYPRE_Real tol, hypre_PilutSolverGlobals *globals) { - HYPRE_Int logging = globals ? globals->logging : 0; HYPRE_Int i, ii, j, k, kk, l, m, ierr, diag_present; - HYPRE_Int *perm, *iperm, + HYPRE_Int *perm, *iperm, *usrowptr, *uerowptr, *ucolind; - HYPRE_Int row_size, *col_ind; + HYPRE_Int row_size; + HYPRE_BigInt *col_ind; HYPRE_Real *values, *uvalues, *dvalues, *nrm2s; HYPRE_Int nlocal, nbnd; HYPRE_Real mult, rtol; @@ -70,8 +70,8 @@ HYPRE_Int hypre_SerILUT(DataDistType *ddist, HYPRE_DistributedMatrix matrix, /* Allocate work space */ hypre_TFree(jr, HYPRE_MEMORY_HOST); jr = hypre_idx_malloc_init(nrows, -1, "hypre_SerILUT: jr"); - hypre_TFree(lr, HYPRE_MEMORY_HOST); - lr = hypre_idx_malloc_init(nrows, -1, "hypre_SerILUT: lr"); + hypre_TFree(hypre_lr, HYPRE_MEMORY_HOST); + hypre_lr = hypre_idx_malloc_init(nrows, -1, "hypre_SerILUT: lr"); hypre_TFree(jw, HYPRE_MEMORY_HOST); jw = hypre_idx_malloc(nrows, "hypre_SerILUT: jw"); hypre_TFree(w, HYPRE_MEMORY_HOST); @@ -120,6 +120,8 @@ HYPRE_Int hypre_SerILUT(DataDistType *ddist, HYPRE_DistributedMatrix matrix, nbnd = lnrows - nlocal ; #ifdef HYPRE_DEBUG + HYPRE_Int logging = globals ? globals->logging : 0; + if (logging) { hypre_printf("nbnd = %d, lnrows=%d, nlocal=%d\n", nbnd, lnrows, nlocal ); @@ -157,8 +159,8 @@ HYPRE_Int hypre_SerILUT(DataDistType *ddist, HYPRE_DistributedMatrix matrix, /* if (ierr) return(ierr); */ for (lastjr=1, lastlr=0, j=0, diag_present=0; j= firstrow && col_ind[j] < lastrow && - iperm[col_ind[j]-firstrow] < nlocal) - lr[lastlr++] = iperm[col_ind[j]-firstrow]; /* Copy the L elements separately */ + iperm[col_ind[j]-firstrow] < nlocal) + hypre_lr[lastlr++] = iperm[col_ind[j]-firstrow]; /* Copy the L elements separately */ if (col_ind[j] != i+firstrow) { /* Off-diagonal element */ jr[col_ind[j]] = lastjr; @@ -292,19 +294,19 @@ HYPRE_Int hypre_SerILUT(DataDistType *ddist, HYPRE_DistributedMatrix matrix, mult = w[jr[k]]*dvalues[kk]; w[jr[k]] = mult; - if (fabs(mult) < rtol) + if (hypre_abs(mult) < rtol) continue;/* First drop test */ for (l=usrowptr[kk]; l= lastrow) + if (col_ind[j] < firstrow || col_ind[j] >= lastrow) { newperm[local_num_rows-nbnd-1] = i; newiperm[i] = local_num_rows-nbnd-1; @@ -389,7 +392,7 @@ HYPRE_Int hypre_SelectInterior( HYPRE_Int local_num_rows, HYPRE_DistributedMatrixRestoreRow( matrix, firstrow+i, &row_size, &col_ind, &values); - if ( break_loop == 0 ) + if ( break_loop == 0 ) { newperm[nlocal] = i; newiperm[i] = nlocal; @@ -407,11 +410,12 @@ HYPRE_Int hypre_SelectInterior( HYPRE_Int local_num_rows, * Produces a vector of length n that marks the union of the nonzero * structure of all locally stored rows, not including locally stored columns. **************************************************************************/ -HYPRE_Int hypre_FindStructuralUnion( HYPRE_DistributedMatrix matrix, +HYPRE_Int hypre_FindStructuralUnion( HYPRE_DistributedMatrix matrix, HYPRE_Int **structural_union, hypre_PilutSolverGlobals *globals ) -{ - HYPRE_Int ierr=0, i, j, row_size, *col_ind; +{ + HYPRE_Int ierr=0, i, j, row_size; + HYPRE_BigInt *col_ind; /* Allocate and clear structural_union vector */ *structural_union = hypre_CTAlloc( HYPRE_Int, nrows , HYPRE_MEMORY_HOST); @@ -427,7 +431,7 @@ HYPRE_Int hypre_FindStructuralUnion( HYPRE_DistributedMatrix matrix, /* Loop through nonzeros in this row */ for ( j=0; j= lastrow) + if (col_ind[j] < firstrow || col_ind[j] >= lastrow) { (*structural_union)[ col_ind[j] ] = 1; } @@ -455,13 +459,15 @@ HYPRE_Int hypre_FindStructuralUnion( HYPRE_DistributedMatrix matrix, HYPRE_Int hypre_ExchangeStructuralUnions( DataDistType *ddist, HYPRE_Int **structural_union, hypre_PilutSolverGlobals *globals ) -{ +{ + HYPRE_UNUSED_VAR(ddist); + HYPRE_Int ierr=0, *recv_unions; /* allocate space for receiving unions */ recv_unions = hypre_CTAlloc( HYPRE_Int, nrows , HYPRE_MEMORY_HOST); - hypre_MPI_Allreduce( *structural_union, recv_unions, nrows, + hypre_MPI_Allreduce( *structural_union, recv_unions, nrows, HYPRE_MPI_INT, hypre_MPI_LOR, pilut_comm ); /* free and reallocate structural union so that is of local size */ @@ -478,20 +484,23 @@ HYPRE_Int hypre_ExchangeStructuralUnions( DataDistType *ddist, /************************************************************************* -* This function applies the second droping rule where maxnz elements +* This function applies the second droping rule where maxnz elements * greater than tol are kept. The elements are stored into LDU. **************************************************************************/ void hypre_SecondDrop(HYPRE_Int maxnz, HYPRE_Real tol, HYPRE_Int row, HYPRE_Int *perm, HYPRE_Int *iperm, FactorMatType *ldu, hypre_PilutSolverGlobals *globals) { + HYPRE_UNUSED_VAR(iperm); + HYPRE_UNUSED_VAR(perm); + HYPRE_Int i, j; HYPRE_Int diag, lrow; HYPRE_Int first, last, itmp; HYPRE_Real dtmp; /* Reset the jr array, it is not needed any more */ - for (i=0; idvalues[lrow] = 1.0/w[0]; else { /* zero pivot */ hypre_printf("Zero pivot in row %d, adding e to proceed!\n", row); @@ -511,7 +520,7 @@ void hypre_SecondDrop(HYPRE_Int maxnz, HYPRE_Real tol, HYPRE_Int row, /* First go and remove any off diagonal elements bellow the tolerance */ for (i=0; ilcolind[ldu->lerowptr[lrow]] = jw[ j ]; ldu->lvalues[ldu->lerowptr[lrow]++] = w[ j ]; @@ -577,10 +586,10 @@ void hypre_SecondDrop(HYPRE_Int maxnz, HYPRE_Real tol, HYPRE_Int row, /* This was the previous insertion sort that was replaced with - the QuickSplit routine above. AJC, 5/00 + the QuickSplit routine above. AJC, 5/00 for (nz=0; nz0; nz++) { for (max=0, j=1; j fabs(w[max])) + if (hypre_abs(w[j]) > hypre_abs(w[max])) max = j; } @@ -595,9 +604,9 @@ void hypre_SecondDrop(HYPRE_Int maxnz, HYPRE_Real tol, HYPRE_Int row, /* Now, I want to keep maxnz elements of U. Go and extract them */ - hypre_DoubleQuickSplit( w+first, jw+first, lastjr-first, maxnz ); + hypre_DoubleQuickSplit( w+first, jw+first, lastjr-first, maxnz ); /* if (ierr) return; */ - for ( j=hypre_max(first, lastjr-maxnz); j< lastjr; j++ ) + for ( j=hypre_max(first, lastjr-maxnz); j< lastjr; j++ ) { ldu->ucolind[ldu->uerowptr[lrow]] = jw[ j ]; ldu->uvalues[ldu->uerowptr[lrow]++] = w[ j ]; @@ -605,10 +614,10 @@ void hypre_SecondDrop(HYPRE_Int maxnz, HYPRE_Real tol, HYPRE_Int row, /* This was the previous insertion sort that was replaced with - the QuickSplit routine above. AJC, 5/00 + the QuickSplit routine above. AJC, 5/00 for (nz=0; nzfirst; nz++) { for (max=first, j=first+1; j fabs(w[max])) + if (hypre_abs(w[j]) > hypre_abs(w[max])) max = j; } @@ -631,15 +640,17 @@ void hypre_SecondDrop(HYPRE_Int maxnz, HYPRE_Real tol, HYPRE_Int row, /************************************************************************* -* This function applyies the second droping rule whre maxnz elements +* This function applyies the second droping rule whre maxnz elements * greater than tol are kept. The elements are stored into L and the Rmat. -* This version keeps only maxnzkeep +* This version keeps only maxnzkeep **************************************************************************/ void hypre_SecondDropUpdate(HYPRE_Int maxnz, HYPRE_Int maxnzkeep, HYPRE_Real tol, HYPRE_Int row, - HYPRE_Int nlocal, HYPRE_Int *perm, HYPRE_Int *iperm, + HYPRE_Int nlocal, HYPRE_Int *perm, HYPRE_Int *iperm, FactorMatType *ldu, ReduceMatType *rmat, hypre_PilutSolverGlobals *globals ) { + HYPRE_UNUSED_VAR(perm); + HYPRE_Int i, j, nl; HYPRE_Int max, nz, lrow, rrow; HYPRE_Int last, first, itmp; @@ -647,7 +658,7 @@ void hypre_SecondDropUpdate(HYPRE_Int maxnz, HYPRE_Int maxnzkeep, HYPRE_Real tol /* Reset the jr array, it is not needed any more */ - for (i=0; ilcolind[ldu->lerowptr[lrow]] = jw[ j ]; ldu->lvalues[ldu->lerowptr[lrow]++] = w[ j ]; @@ -730,10 +741,10 @@ void hypre_SecondDropUpdate(HYPRE_Int maxnz, HYPRE_Int maxnzkeep, HYPRE_Real tol /* This was the previous insertion sort that was replaced with - the QuickSplit routine above. AJC, 5/00 + the QuickSplit routine above. AJC, 5/00 for (nz=0; nz1; nz++) { for (max=1, j=2; j fabs(w[max])) + if (hypre_abs(w[j]) > hypre_abs(w[max])) max = j; } @@ -765,7 +776,7 @@ void hypre_SecondDropUpdate(HYPRE_Int maxnz, HYPRE_Int maxnzkeep, HYPRE_Real tol else { /* Keep large nl elements in the reduced row */ for (nz=1; nz fabs(w[max])) + if (hypre_abs(w[j]) > hypre_abs(w[max])) max = j; } @@ -781,4 +792,3 @@ void hypre_SecondDropUpdate(HYPRE_Int maxnz, HYPRE_Int maxnzkeep, HYPRE_Real tol #endif } - diff --git a/external/hypre/src/distributed_ls/pilut/struct.h b/external/hypre/src/distributed_ls/pilut/struct.h index 22a3a704..270e9742 100644 --- a/external/hypre/src/distributed_ls/pilut/struct.h +++ b/external/hypre/src/distributed_ls/pilut/struct.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -30,21 +30,28 @@ * $Id$ */ -#ifndef __cplusplus -#ifndef true -# define true 1 -# define false 0 -#endif - +#ifndef __cplusplus /* In C++, bool is built-in, no need to define it */ +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L && __STDC_VERSION__ < 202311L +/* C99 - C11: Use stdbool.h */ +#include +#elif defined(__STDC_VERSION__) && __STDC_VERSION__ < 199901L +/* Pre-C99: Define bool manually */ #ifndef bool -# ifdef Boolean +#ifdef Boolean typedef Boolean bool; -# else +#else typedef unsigned char bool; -# endif #endif #endif - +#ifndef true +#define true 1 +#endif +#ifndef false +#define false 0 +#endif +#endif +#endif /* ifndef __cplusplus */ + /************************************************************************* * This data structure holds the data distribution **************************************************************************/ @@ -142,7 +149,7 @@ typedef struct reducematdef ReduceMatType; /************************************************************************* -* This data structure stores information about the send in each phase +* This data structure stores information about the send in each phase * of parallel hypre_ILUT **************************************************************************/ struct comminfodef { diff --git a/external/hypre/src/distributed_ls/pilut/trifactor.c b/external/hypre/src/distributed_ls/pilut/trifactor.c index aed5d7a4..13f1774f 100644 --- a/external/hypre/src/distributed_ls/pilut/trifactor.c +++ b/external/hypre/src/distributed_ls/pilut/trifactor.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_ls/pilut/util.c b/external/hypre/src/distributed_ls/pilut/util.c index 13c15cd1..3fb15aad 100644 --- a/external/hypre/src/distributed_ls/pilut/util.c +++ b/external/hypre/src/distributed_ls/pilut/util.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -28,15 +28,15 @@ HYPRE_Int hypre_ExtractMinLR( hypre_PilutSolverGlobals *globals ) HYPRE_Int i, j=0 ; for (i=1; i fabs(val[max])) + if (hypre_abs(val[j]) > hypre_abs(val[max])) max = j; } diff --git a/external/hypre/src/distributed_matrix/CMakeLists.txt b/external/hypre/src/distributed_matrix/CMakeLists.txt index 35464c08..e6bc7d11 100644 --- a/external/hypre/src/distributed_matrix/CMakeLists.txt +++ b/external/hypre/src/distributed_matrix/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_matrix/HYPRE_distributed_matrix.c b/external/hypre/src/distributed_matrix/HYPRE_distributed_matrix.c index 41b7bcf6..a8527182 100644 --- a/external/hypre/src/distributed_matrix/HYPRE_distributed_matrix.c +++ b/external/hypre/src/distributed_matrix/HYPRE_distributed_matrix.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_matrix/HYPRE_distributed_matrix_mv.h b/external/hypre/src/distributed_matrix/HYPRE_distributed_matrix_mv.h index bce13fc2..bca2f968 100644 --- a/external/hypre/src/distributed_matrix/HYPRE_distributed_matrix_mv.h +++ b/external/hypre/src/distributed_matrix/HYPRE_distributed_matrix_mv.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_matrix/HYPRE_distributed_matrix_protos.h b/external/hypre/src/distributed_matrix/HYPRE_distributed_matrix_protos.h index 1f9159d4..359e927c 100644 --- a/external/hypre/src/distributed_matrix/HYPRE_distributed_matrix_protos.h +++ b/external/hypre/src/distributed_matrix/HYPRE_distributed_matrix_protos.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_matrix/HYPRE_distributed_matrix_types.h b/external/hypre/src/distributed_matrix/HYPRE_distributed_matrix_types.h index 1f9159d4..359e927c 100644 --- a/external/hypre/src/distributed_matrix/HYPRE_distributed_matrix_types.h +++ b/external/hypre/src/distributed_matrix/HYPRE_distributed_matrix_types.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_matrix/distributed_matrix.c b/external/hypre/src/distributed_matrix/distributed_matrix.c index 6b52a10f..85fc09e6 100644 --- a/external/hypre/src/distributed_matrix/distributed_matrix.c +++ b/external/hypre/src/distributed_matrix/distributed_matrix.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_matrix/distributed_matrix.h b/external/hypre/src/distributed_matrix/distributed_matrix.h index 9a21ea21..1a3182b8 100644 --- a/external/hypre/src/distributed_matrix/distributed_matrix.h +++ b/external/hypre/src/distributed_matrix/distributed_matrix.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_matrix/distributed_matrix_ISIS.c b/external/hypre/src/distributed_matrix/distributed_matrix_ISIS.c index 0789d81c..70ae1bff 100644 --- a/external/hypre/src/distributed_matrix/distributed_matrix_ISIS.c +++ b/external/hypre/src/distributed_matrix/distributed_matrix_ISIS.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -21,7 +21,7 @@ typedef struct { HYPRE_BigInt *ind; HYPRE_Real *val; -} +} RowBuf; #endif @@ -31,7 +31,7 @@ RowBuf; /* matrix must be set before calling this function*/ -HYPRE_Int +HYPRE_Int hypre_InitializeDistributedMatrixISIS(hypre_DistributedMatrix *dm) { #ifdef ISIS_AVAILABLE @@ -41,7 +41,7 @@ hypre_InitializeDistributedMatrixISIS(hypre_DistributedMatrix *dm) HYPRE_BigInt num_rows = mat->getMap().n(); HYPRE_BigInt num_cols = mat->getMap().n(); - + hypre_DistributedMatrixM(dm) = num_rows; hypre_DistributedMatrixN(dm) = num_cols; @@ -52,6 +52,8 @@ hypre_InitializeDistributedMatrixISIS(hypre_DistributedMatrix *dm) rowbuf->val = new HYPRE_Real[num_cols]; dm->auxiliary_data = (void *) rowbuf; +#else + HYPRE_UNUSED_VAR(dm); #endif return 0; @@ -61,7 +63,7 @@ hypre_InitializeDistributedMatrixISIS(hypre_DistributedMatrix *dm) * hypre_FreeDistributedMatrixISIS *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int hypre_FreeDistributedMatrixISIS( hypre_DistributedMatrix *dm) { #ifdef ISIS_AVAILABLE @@ -70,6 +72,8 @@ hypre_FreeDistributedMatrixISIS( hypre_DistributedMatrix *dm) delete rowbuf->ind; delete rowbuf->val; delete rowbuf; +#else + HYPRE_UNUSED_VAR(dm); #endif return 0; @@ -79,9 +83,10 @@ hypre_FreeDistributedMatrixISIS( hypre_DistributedMatrix *dm) * hypre_PrintDistributedMatrixISIS *--------------------------------------------------------------------------*/ -HYPRE_Int -hypre_PrintDistributedMatrixISIS( hypre_DistributedMatrix *matrix ) +HYPRE_Int +hypre_PrintDistributedMatrixISIS( hypre_DistributedMatrix *dm ) { + HYPRE_UNUSED_VAR(dm); #ifdef ISIS_AVAILABLE cout << "hypre_PrintDistributedMatrixISIS not implemented" << endl; #endif @@ -93,19 +98,24 @@ hypre_PrintDistributedMatrixISIS( hypre_DistributedMatrix *matrix ) * hypre_GetDistributedMatrixLocalRangeISIS *--------------------------------------------------------------------------*/ -HYPRE_Int -hypre_GetDistributedMatrixLocalRangeISIS( hypre_DistributedMatrix *dm, - HYPRE_BigInt *start, - HYPRE_BigInt *end ) +HYPRE_Int +hypre_GetDistributedMatrixLocalRangeISIS( hypre_DistributedMatrix *dm, + HYPRE_BigInt *start, + HYPRE_BigInt *end ) { #ifdef ISIS_AVAILABLE RowMatrix *mat = (RowMatrix *) hypre_DistributedMatrixLocalStorage(dm); *start = mat->getMap().startRow() - 1; /* convert to 0-based */ *end = mat->getMap().endRow(); /* endRow actually returns 1 less */ - + cout << "LocalRangeISIS " << *start << " " << *end << endl; +#else + HYPRE_UNUSED_VAR(dm); + HYPRE_UNUSED_VAR(start); + HYPRE_UNUSED_VAR(end); #endif + return 0; } @@ -113,15 +123,15 @@ hypre_GetDistributedMatrixLocalRangeISIS( hypre_DistributedMatrix *dm, * hypre_GetDistributedMatrixRowISIS *--------------------------------------------------------------------------*/ -/* semantics: buffers returned will be overwritten on next call to +/* semantics: buffers returned will be overwritten on next call to this get function */ -HYPRE_Int +HYPRE_Int hypre_GetDistributedMatrixRowISIS( hypre_DistributedMatrix *dm, - HYPRE_BigInt row, - HYPRE_Int *size, - HYPRE_BigInt **col_ind, - HYPRE_Real **values ) + HYPRE_BigInt row, + HYPRE_Int *size, + HYPRE_BigInt **col_ind, + HYPRE_Real **values ) { #ifdef ISIS_AVAILABLE RowMatrix *mat = (RowMatrix *) hypre_DistributedMatrixLocalStorage(dm); @@ -140,7 +150,7 @@ hypre_GetDistributedMatrixRowISIS( hypre_DistributedMatrix *dm, for (i=0, p=rowbuf->ind; ival; *size = temp; } - +#else + HYPRE_UNUSED_VAR(dm); + HYPRE_UNUSED_VAR(row); + HYPRE_UNUSED_VAR(size); + HYPRE_UNUSED_VAR(col_ind); + HYPRE_UNUSED_VAR(values); #endif return 0; @@ -181,14 +196,19 @@ hypre_GetDistributedMatrixRowISIS( hypre_DistributedMatrix *dm, * hypre_RestoreDistributedMatrixRowISIS *--------------------------------------------------------------------------*/ -HYPRE_Int -hypre_RestoreDistributedMatrixRowISIS( hypre_DistributedMatrix *dm, - HYPRE_BigInt row, - HYPRE_Int *size, - HYPRE_BigInt **col_ind, - HYPRE_Real **values ) +HYPRE_Int +hypre_RestoreDistributedMatrixRowISIS( hypre_DistributedMatrix *dm, + HYPRE_BigInt row, + HYPRE_Int *size, + HYPRE_BigInt **col_ind, + HYPRE_Real **values ) { - /* does nothing, since we use local buffers */ + /* does nothing, since we use local buffers */ + HYPRE_UNUSED_VAR(dm); + HYPRE_UNUSED_VAR(row); + HYPRE_UNUSED_VAR(size); + HYPRE_UNUSED_VAR(col_ind); + HYPRE_UNUSED_VAR(values); return 0; } diff --git a/external/hypre/src/distributed_matrix/distributed_matrix_ISIS.cc b/external/hypre/src/distributed_matrix/distributed_matrix_ISIS.cc index 05772805..aaeffdfc 100644 --- a/external/hypre/src/distributed_matrix/distributed_matrix_ISIS.cc +++ b/external/hypre/src/distributed_matrix/distributed_matrix_ISIS.cc @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/distributed_matrix/distributed_matrix_PETSc.c b/external/hypre/src/distributed_matrix/distributed_matrix_PETSc.c index eba39aef..6d69d92e 100644 --- a/external/hypre/src/distributed_matrix/distributed_matrix_PETSc.c +++ b/external/hypre/src/distributed_matrix/distributed_matrix_PETSc.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -23,13 +23,15 @@ * Internal routine for freeing a matrix stored in PETSc form. *--------------------------------------------------------------------------*/ -HYPRE_Int -hypre_DistributedMatrixDestroyPETSc( hypre_DistributedMatrix *distributed_matrix ) +HYPRE_Int +hypre_DistributedMatrixDestroyPETSc( hypre_DistributedMatrix *dm ) { #ifdef PETSC_AVAILABLE - Mat PETSc_matrix = (Mat) hypre_DistributedMatrixLocalStorage(distributed_matrix); + Mat PETSc_matrix = (Mat) hypre_DistributedMatrixLocalStorage(dm); MatDestroy( PETSc_matrix ); +#else + HYPRE_UNUSED_VAR(dm); #endif return(0); @@ -44,15 +46,18 @@ hypre_DistributedMatrixDestroyPETSc( hypre_DistributedMatrix *distributed_matrix * Internal routine for printing a matrix stored in PETSc form. *--------------------------------------------------------------------------*/ -HYPRE_Int -hypre_DistributedMatrixPrintPETSc( hypre_DistributedMatrix *matrix ) +HYPRE_Int +hypre_DistributedMatrixPrintPETSc( hypre_DistributedMatrix *dm ) { HYPRE_Int ierr=0; #ifdef PETSC_AVAILABLE - Mat PETSc_matrix = (Mat) hypre_DistributedMatrixLocalStorage(matrix); + Mat PETSc_matrix = (Mat) hypre_DistributedMatrixLocalStorage(dm); ierr = MatView( PETSc_matrix, VIEWER_STDOUT_WORLD ); +#else + HYPRE_UNUSED_VAR(dm); #endif + return(ierr); } @@ -60,14 +65,14 @@ hypre_DistributedMatrixPrintPETSc( hypre_DistributedMatrix *matrix ) * hypre_DistributedMatrixGetLocalRangePETSc *--------------------------------------------------------------------------*/ -HYPRE_Int -hypre_DistributedMatrixGetLocalRangePETSc( hypre_DistributedMatrix *matrix, +HYPRE_Int +hypre_DistributedMatrixGetLocalRangePETSc( hypre_DistributedMatrix *dm, HYPRE_BigInt *start, HYPRE_BigInt *end ) { HYPRE_Int ierr=0; #ifdef PETSC_AVAILABLE - Mat PETSc_matrix = (Mat) hypre_DistributedMatrixLocalStorage(matrix); + Mat PETSc_matrix = (Mat) hypre_DistributedMatrixLocalStorage(dm); if (!PETSc_matrix) return(-1); @@ -75,13 +80,17 @@ hypre_DistributedMatrixGetLocalRangePETSc( hypre_DistributedMatrix *matrix, ierr = MatGetOwnershipRange( PETSc_matrix, start, end ); CHKERRA(ierr); /* - Since PETSc's MatGetOwnershipRange actually returns + Since PETSc's MatGetOwnershipRange actually returns end = "one more than the global index of the last local row", we need to subtract one; hypre assumes we return the index of the last row itself. */ *end = *end - 1; +#else + HYPRE_UNUSED_VAR(dm); + HYPRE_UNUSED_VAR(start); + HYPRE_UNUSED_VAR(end); #endif return(ierr); @@ -91,8 +100,8 @@ hypre_DistributedMatrixGetLocalRangePETSc( hypre_DistributedMatrix *matrix, * hypre_DistributedMatrixGetRowPETSc *--------------------------------------------------------------------------*/ -HYPRE_Int -hypre_DistributedMatrixGetRowPETSc( hypre_DistributedMatrix *matrix, +HYPRE_Int +hypre_DistributedMatrixGetRowPETSc( hypre_DistributedMatrix *dm, HYPRE_BigInt row, HYPRE_Int *size, HYPRE_BigInt **col_ind, @@ -100,11 +109,17 @@ hypre_DistributedMatrixGetRowPETSc( hypre_DistributedMatrix *matrix, { HYPRE_Int ierr=0; #ifdef PETSC_AVAILABLE - Mat PETSc_matrix = (Mat) hypre_DistributedMatrixLocalStorage(matrix); + Mat PETSc_matrix = (Mat) hypre_DistributedMatrixLocalStorage(dm); if (!PETSc_matrix) return(-1); ierr = MatGetRow( PETSc_matrix, row, size, col_ind, values); CHKERRA(ierr); +#else + HYPRE_UNUSED_VAR(dm); + HYPRE_UNUSED_VAR(row); + HYPRE_UNUSED_VAR(size); + HYPRE_UNUSED_VAR(col_ind); + HYPRE_UNUSED_VAR(values); #endif return(ierr); @@ -114,8 +129,8 @@ hypre_DistributedMatrixGetRowPETSc( hypre_DistributedMatrix *matrix, * hypre_DistributedMatrixRestoreRowPETSc *--------------------------------------------------------------------------*/ -HYPRE_Int -hypre_DistributedMatrixRestoreRowPETSc( hypre_DistributedMatrix *matrix, +HYPRE_Int +hypre_DistributedMatrixRestoreRowPETSc( hypre_DistributedMatrix *dm, HYPRE_BigInt row, HYPRE_Int *size, HYPRE_BigInt **col_ind, @@ -123,11 +138,17 @@ hypre_DistributedMatrixRestoreRowPETSc( hypre_DistributedMatrix *matrix, { HYPRE_Int ierr=0; #ifdef PETSC_AVAILABLE - Mat PETSc_matrix = (Mat) hypre_DistributedMatrixLocalStorage(matrix); + Mat PETSc_matrix = (Mat) hypre_DistributedMatrixLocalStorage(dm); if (PETSc_matrix == NULL) return(-1); ierr = MatRestoreRow( PETSc_matrix, row, size, col_ind, values); CHKERRA(ierr); +#else + HYPRE_UNUSED_VAR(dm); + HYPRE_UNUSED_VAR(row); + HYPRE_UNUSED_VAR(size); + HYPRE_UNUSED_VAR(col_ind); + HYPRE_UNUSED_VAR(values); #endif return(ierr); diff --git a/external/hypre/src/distributed_matrix/distributed_matrix_parcsr.c b/external/hypre/src/distributed_matrix/distributed_matrix_parcsr.c index 0df9ae59..3802e15d 100644 --- a/external/hypre/src/distributed_matrix/distributed_matrix_parcsr.c +++ b/external/hypre/src/distributed_matrix/distributed_matrix_parcsr.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -21,8 +21,9 @@ *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_DistributedMatrixDestroyParCSR( hypre_DistributedMatrix *distributed_matrix ) +hypre_DistributedMatrixDestroyParCSR( hypre_DistributedMatrix *dm ) { + HYPRE_UNUSED_VAR(dm); return(0); } @@ -34,8 +35,9 @@ hypre_DistributedMatrixDestroyParCSR( hypre_DistributedMatrix *distributed_matri /* matrix must be set before calling this function*/ HYPRE_Int -hypre_DistributedMatrixInitializeParCSR(hypre_DistributedMatrix *matrix) +hypre_DistributedMatrixInitializeParCSR(hypre_DistributedMatrix *dm) { + HYPRE_UNUSED_VAR(dm); return 0; } @@ -50,10 +52,10 @@ hypre_DistributedMatrixInitializeParCSR(hypre_DistributedMatrix *matrix) *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_DistributedMatrixPrintParCSR( hypre_DistributedMatrix *matrix ) +hypre_DistributedMatrixPrintParCSR( hypre_DistributedMatrix *dm ) { HYPRE_Int ierr=0; - HYPRE_ParCSRMatrix Parcsr_matrix = (HYPRE_ParCSRMatrix) hypre_DistributedMatrixLocalStorage(matrix); + HYPRE_ParCSRMatrix Parcsr_matrix = (HYPRE_ParCSRMatrix) hypre_DistributedMatrixLocalStorage(dm); HYPRE_ParCSRMatrixPrint( Parcsr_matrix, "STDOUT" ); return(ierr); @@ -64,20 +66,19 @@ hypre_DistributedMatrixPrintParCSR( hypre_DistributedMatrix *matrix ) *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_DistributedMatrixGetLocalRangeParCSR( hypre_DistributedMatrix *matrix, - HYPRE_BigInt *row_start, - HYPRE_BigInt *row_end, - HYPRE_BigInt *col_start, - HYPRE_BigInt *col_end ) +hypre_DistributedMatrixGetLocalRangeParCSR( hypre_DistributedMatrix *dm, + HYPRE_BigInt *row_start, + HYPRE_BigInt *row_end, + HYPRE_BigInt *col_start, + HYPRE_BigInt *col_end ) { HYPRE_Int ierr=0; - HYPRE_ParCSRMatrix Parcsr_matrix = (HYPRE_ParCSRMatrix) hypre_DistributedMatrixLocalStorage(matrix); + HYPRE_ParCSRMatrix Parcsr_matrix = (HYPRE_ParCSRMatrix) hypre_DistributedMatrixLocalStorage(dm); if (!Parcsr_matrix) return(-1); - ierr = HYPRE_ParCSRMatrixGetLocalRange( Parcsr_matrix, row_start, row_end, - col_start, col_end ); + col_start, col_end ); return(ierr); } @@ -87,14 +88,14 @@ hypre_DistributedMatrixGetLocalRangeParCSR( hypre_DistributedMatrix *matrix, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_DistributedMatrixGetRowParCSR( hypre_DistributedMatrix *matrix, - HYPRE_BigInt row, - HYPRE_Int *size, - HYPRE_BigInt **col_ind, - HYPRE_Real **values ) +hypre_DistributedMatrixGetRowParCSR( hypre_DistributedMatrix *dm, + HYPRE_BigInt row, + HYPRE_Int *size, + HYPRE_BigInt **col_ind, + HYPRE_Real **values ) { HYPRE_Int ierr = 0; - HYPRE_ParCSRMatrix Parcsr_matrix = (HYPRE_ParCSRMatrix) hypre_DistributedMatrixLocalStorage(matrix); + HYPRE_ParCSRMatrix Parcsr_matrix = (HYPRE_ParCSRMatrix) hypre_DistributedMatrixLocalStorage(dm); if (!Parcsr_matrix) return(-1); @@ -102,7 +103,7 @@ hypre_DistributedMatrixGetRowParCSR( hypre_DistributedMatrix *matrix, // RL: if HYPRE_ParCSRMatrixGetRow was on device, need the next line to guarantee it's done #if defined(HYPRE_USING_GPU) - hypre_SyncCudaComputeStream(hypre_handle()); + hypre_SyncComputeStream(); #endif return(ierr); @@ -113,14 +114,14 @@ hypre_DistributedMatrixGetRowParCSR( hypre_DistributedMatrix *matrix, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_DistributedMatrixRestoreRowParCSR( hypre_DistributedMatrix *matrix, - HYPRE_BigInt row, - HYPRE_Int *size, - HYPRE_BigInt **col_ind, - HYPRE_Real **values ) +hypre_DistributedMatrixRestoreRowParCSR( hypre_DistributedMatrix *dm, + HYPRE_BigInt row, + HYPRE_Int *size, + HYPRE_BigInt **col_ind, + HYPRE_Real **values ) { HYPRE_Int ierr; - HYPRE_ParCSRMatrix Parcsr_matrix = (HYPRE_ParCSRMatrix) hypre_DistributedMatrixLocalStorage(matrix); + HYPRE_ParCSRMatrix Parcsr_matrix = (HYPRE_ParCSRMatrix) hypre_DistributedMatrixLocalStorage(dm); if (Parcsr_matrix == NULL) return(-1); diff --git a/external/hypre/src/distributed_matrix/internal_protos.h b/external/hypre/src/distributed_matrix/internal_protos.h index e8af488e..2ec5e20d 100644 --- a/external/hypre/src/distributed_matrix/internal_protos.h +++ b/external/hypre/src/distributed_matrix/internal_protos.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/docs/README.md b/external/hypre/src/docs/README.md index d5e608ab..836e92ee 100644 --- a/external/hypre/src/docs/README.md +++ b/external/hypre/src/docs/README.md @@ -1,5 +1,5 @@ - -image/svg+xml \ No newline at end of file diff --git a/external/hypre/src/docs/usr-manual/index.rst b/external/hypre/src/docs/usr-manual/index.rst index f384220d..914c1958 100644 --- a/external/hypre/src/docs/usr-manual/index.rst +++ b/external/hypre/src/docs/usr-manual/index.rst @@ -1,4 +1,4 @@ -.. Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +.. Copyright (c) 1998 Lawrence Livermore National Security, LLC and other HYPRE Project Developers. See the top-level COPYRIGHT file for details. SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -8,8 +8,8 @@ You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. -Welcome to hypre's documentation! -================================= +Documentation for hypre +======================= .. include:: ../copyright.txt diff --git a/external/hypre/src/docs/usr-manual/requirements.txt b/external/hypre/src/docs/usr-manual/requirements.txt index f4b17dcd..c4ea9613 100644 --- a/external/hypre/src/docs/usr-manual/requirements.txt +++ b/external/hypre/src/docs/usr-manual/requirements.txt @@ -1,6 +1,11 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -breathe +sphinx>=5.3 +breathe>=4.34 +sphinx-rtd-theme>=1.1.1 +docutils>=0.17.1 + + diff --git a/external/hypre/src/docs/usr-manual/solvers-ads.rst b/external/hypre/src/docs/usr-manual/solvers-ads.rst index 89230cdf..f427ce0f 100644 --- a/external/hypre/src/docs/usr-manual/solvers-ads.rst +++ b/external/hypre/src/docs/usr-manual/solvers-ads.rst @@ -1,4 +1,4 @@ -.. Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +.. Copyright (c) 1998 Lawrence Livermore National Security, LLC and other HYPRE Project Developers. See the top-level COPYRIGHT file for details. SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/docs/usr-manual/solvers-ams.rst b/external/hypre/src/docs/usr-manual/solvers-ams.rst index 668e5a47..46b7cc28 100644 --- a/external/hypre/src/docs/usr-manual/solvers-ams.rst +++ b/external/hypre/src/docs/usr-manual/solvers-ams.rst @@ -1,4 +1,4 @@ -.. Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +.. Copyright (c) 1998 Lawrence Livermore National Security, LLC and other HYPRE Project Developers. See the top-level COPYRIGHT file for details. SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -68,9 +68,9 @@ In addition to the above quantities, AMS can utilize the following (optional) information: * The Poisson matrices :math:`A_\alpha` and :math:`A_\beta`, corresponding to - assembling of the forms :math:`(\alpha\, \nabla u, \nabla v)+(\beta\, \nabla - u, \nabla v)` and :math:`(\beta\, \nabla u, \nabla v)` using standard linear - finite elements on the same mesh. + assembling of the forms :math:`(\alpha\, \nabla u, \nabla v)+(\beta\, u, v)` + and :math:`(\beta\, \nabla u, \nabla v)` using standard linear finite elements + on the same mesh. Internally, AMS proceeds with the construction of the following additional objects: @@ -105,7 +105,7 @@ code ``ex15.c`` for a complete implementation. We start with the allocation of the ``HYPRE_Solver`` object: .. code-block:: c - + HYPRE_Solver solver; HYPRE_AMSCreate(&solver); @@ -118,7 +118,7 @@ with the function given below. We note that a 3D solver will still work for a 2D problem, but it will be slower and will require more memory than necessary. .. code-block:: c - + HYPRE_AMSSetDimension(solver, dim); The user is required to provide the discrete gradient matrix :math:`G`. AMS @@ -129,7 +129,7 @@ excluded. It is essential to **not** impose any boundary conditions on the following function. .. code-block:: c - + HYPRE_AMSSetDiscreteGradient(solver, G); In addition to :math:`G`, we need one additional piece of information in order @@ -140,13 +140,13 @@ vectors should be provided. For 2D problems, the user can set the third vector to NULL. The corresponding function calls read: .. code-block:: c - + HYPRE_AMSSetCoordinateVectors(solver,x,y,z); or .. code-block:: c - + HYPRE_AMSSetEdgeConstantVectors(solver, one_zero_zero, zero_one_zero, zero_zero_one); The vectors ``one_zero_zero``, ``zero_one_zero`` and ``zero_zero_one`` above @@ -157,7 +157,7 @@ The remaining solver parameters are optional. For example, the user can choose a different cycle type by calling .. code-block:: c - + HYPRE_AMSSetCycleType(solver, cycle_type); /* default value: 1 */ The available cycle types in AMS are: @@ -195,7 +195,7 @@ Additional solver parameters, such as the maximum number of iterations, the convergence tolerance and the output level, can be set with .. code-block:: c - + HYPRE_AMSSetMaxIter(solver, maxit); /* default value: 20 */ HYPRE_AMSSetTol(solver, tol); /* default value: 1e-6 */ HYPRE_AMSSetPrintLevel(solver, print); /* default value: 1 */ @@ -204,7 +204,7 @@ More advanced parameters, affecting the smoothing and the internal AMG solvers, can be set with the following three functions: .. code-block:: c - + HYPRE_AMSSetSmoothingOptions(solver, 2, 1, 1.0, 1.0); HYPRE_AMSSetAlphaAMGOptions(solver, 10, 1, 3, 0.25, 0, 0); HYPRE_AMSSetBetaAMGOptions(solver, 10, 1, 3, 0.25, 0, 0); @@ -214,7 +214,7 @@ For (singular) problems where :math:`\beta = 0` in the whole domain, different simplification, use the following hypre call .. code-block:: c - + HYPRE_AMSSetBetaPoissonMatrix(solver, NULL); If :math:`\beta` is zero only in parts of the domain, the problem is still @@ -226,7 +226,7 @@ the list of nodes which are interior to a zero-conductivity region provided by the function .. code-block:: c - + HYPRE_AMSSetInteriorNodes(solver, HYPRE_ParVector interior_nodes); A node is interior, if its entry in the ``interior_nodes`` array is :math:`1.0`. @@ -238,7 +238,7 @@ is advantageous to project on the compatible subspace :math:`Ker(G_0^T)`. This can be done periodically, or manually through the functions .. code-block:: c - + HYPRE_AMSSetProjectionFrequency(solver, int projection_frequency); HYPRE_AMSProjectOutGradients(solver, HYPRE_ParVector x); @@ -250,7 +250,7 @@ Poisson matrix with coefficient :math:`\beta` (denoted by ``Abeta``) is available then one can avoid one matrix construction by calling .. code-block:: c - + HYPRE_AMSSetBetaPoissonMatrix(solver, Abeta); Similarly, if the Poisson matrix with coefficient :math:`\alpha` is available @@ -258,7 +258,7 @@ Similarly, if the Poisson matrix with coefficient :math:`\alpha` is available calling .. code-block:: c - + HYPRE_AMSSetAlphaPoissonMatrix(solver, Aalpha); Note the following regarding these functions: @@ -282,7 +282,7 @@ hypre parallel vectors :math:`{\mathbf b}` and :math:`{\mathbf x}`. (The vectors are actually not used in the current AMS setup.) The setup call reads, .. code-block:: c - + HYPRE_AMSSetup(solver, A, b, x); It is important to note the order of the calling sequence. For example, do @@ -293,13 +293,13 @@ and one of the functions ``HYPRE_AMSSetCoordinateVectors`` or Once the setup has completed, we can solve the linear system by calling .. code-block:: c - + HYPRE_AMSSolve(solver, A, b, x); Finally, the solver can be destroyed with .. code-block:: c - + HYPRE_AMSDestroy(&solver); More details can be found in the files ``ams.h`` and ``ams.c`` located in the @@ -342,7 +342,7 @@ basis functions and degrees of freedom. With these matrices, the high-order setup procedure is simply .. code-block:: c - + HYPRE_AMSSetDimension(solver, dim); HYPRE_AMSSetDiscreteGradient(solver, G); HYPRE_AMSSetInterpolations(solver, Pi, NULL, NULL, NULL); @@ -358,7 +358,7 @@ options to those less than 10. Alternatively one can separately specify the :math:`x`, :math:`y` and :math:`z` components of :math:`\mathbf \Pi`: .. code-block:: c - + HYPRE_AMSSetInterpolations(solver, NULL, Pix, Piy, Piz); which enables the use of AMS cycle types with index greater than 10. By @@ -370,7 +370,7 @@ the coordinates of the mesh vertices. Finally, both :math:`{\mathbf \Pi}` and its components can be passed to the solver: .. code-block:: c - + HYPRE_AMSSetInterpolations(solver, Pi, Pix, Piy, Piz); which will duplicate some memory, but allows for experimentation with all @@ -436,4 +436,3 @@ with :math:`{\mathbf \Pi}_{nc}` computed element-wise as in the previous subsection. Note that in the low-order case, :math:`{\mathbf \Pi}_{c}` can be computed internally in AMS based only :math:`G_c` and the conforming coordinates of the vertices :math:`x_c`/:math:`y_c`/:math:`z_c`, see [GrKo2015]_. - diff --git a/external/hypre/src/docs/usr-manual/solvers-boomeramg.rst b/external/hypre/src/docs/usr-manual/solvers-boomeramg.rst index d5b7c816..efce7667 100644 --- a/external/hypre/src/docs/usr-manual/solvers-boomeramg.rst +++ b/external/hypre/src/docs/usr-manual/solvers-boomeramg.rst @@ -1,4 +1,4 @@ -.. Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +.. Copyright (c) 1998 Lawrence Livermore National Security, LLC and other HYPRE Project Developers. See the top-level COPYRIGHT file for details. SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -10,13 +10,11 @@ BoomerAMG BoomerAMG is a parallel implementation of the algebraic multigrid method [RuSt1987]_. It can be used both as a solver or as a preconditioner. The user can choose between various different parallel coarsening techniques, -interpolation and relaxation schemes. While the default settings work fairly -well for two-dimensional diffusion problems, for three-dimensional diffusion -problems, it is recommended to choose a lower complexity coarsening like HMIS or -PMIS (coarsening 10 or 8) and combine it with a distance-two interpolation -(interpolation 6 or 7), that is also truncated to 4 or 5 elements per -row. Additional reduction in complexity and increased scalability can often be -achieved using one or two levels of aggressive coarsening. +interpolation and relaxation schemes. The default settings for CPUs, HMIS +(coarsening 8) combined with a distance-two interpolation (6) truncated to 4 +or 5 elements per row, should work fairly well for two- and three-dimensional +diffusion problems. Additional reduction in complexity and increased scalability +can often be achieved using one or two levels of aggressive coarsening. Parameter Options @@ -42,6 +40,7 @@ techniques can be found in [HeYa2002]_, [Yang2005]_. Various coarsening techniques are available: * the Cleary-Luby-Jones-Plassman (CLJP) coarsening, +* parallel versions of the classical RS coarsening described in [HeYa2002]_. * the Falgout coarsening which is a combination of CLJP and the classical RS coarsening algorithm, * CGC and CGC-E coarsenings [GrMS2006a]_, [GrMS2006b]_, @@ -51,14 +50,15 @@ Various coarsening techniques are available: techniques mentioned above a nd thus achieving much lower complexities and lower memory use [Stue1999]_. -To use aggressive coarsening the user has to set the number of levels to which -he wants to apply aggressive coarsening (starting with the finest level) via +To use aggressive coarsening users have to set the number of levels to which +they want to apply aggressive coarsening (starting with the finest level) via ``HYPRE_BoomerAMGSetAggNumLevels``. Since aggressive coarsening requires long range interpolation, multipass interpolation is always used on levels with aggressive coarsening, unless the user specifies another long-range -interpolation suitable for aggressive coarsening. +interpolation suitable for aggressive coarsening via +``HYPRE_BoomerAMGSetAggInterpType``.. -Note that the default coarsening is HMIS [DeYH2004]_. +Note that the default coarsening for CPUs is HMIS, for GPUs PMIS [DeYH2004]_. Interpolation Options @@ -66,18 +66,19 @@ Interpolation Options Various interpolation techniques can be set using ``HYPRE_BoomerAMGSetInterpType``: -* the "classical" interpolation as defined in [RuSt1987]_, -* direct interpolation [Stue1999]_, -* standard interpolation [Stue1999]_, +* the "classical" interpolation (0) as defined in [RuSt1987]_, +* direct interpolation (3) [Stue1999]_, +* standard interpolation (8) [Stue1999]_, * an extended "classical" interpolation, which is a long range interpolation and is recommended to be used with PMIS and HMIS coarsening for harder problems - [DFNY2008]_, -* multipass interpolation [Stue1999]_, + (6) [DFNY2008]_, +* distance-two interpolation based on matrix operations (17) [LiSY2021]_, +* multipass interpolation (4) [Stue1999]_, * two-stage interpolation [Yang2010]_, * Jacobi interpolation [Stue1999]_, -* the "classical" interpolation modified for hyperbolic PDEs. +* the "classical" interpolation modified for hyperbolic PDEs (2). -Jacobi interpolation is only use to improve certain interpolation operators and +Jacobi interpolation is only used to improve certain interpolation operators and can be used with ``HYPRE_BoomerAMGSetPostInterpType``. Since some of the interpolation operators might generate large stencils, it is often possible and recommended to control complexity and truncate the interpolation operators using @@ -85,7 +86,8 @@ recommended to control complexity and truncate the interpolation operators using ``HYPRE_BoomerAMGSetJacobiTruncTheshold`` (for Jacobi interpolation only). Note that the default interpolation is extended+i interpolation [DFNY2008]_ -truncated to 4 elements per row. +truncated to 4 elements per row, for CPUs, and a version of this interpolation +based on matrix operations for GPUs [LiSY2021]_. Non-Galerkin Options @@ -112,13 +114,15 @@ Smoother Options A good overview of parallel smoothers and their properties can be found in [BFKY2011]_. Various of the described relaxation techniques are available: -* weighted Jacobi relaxation, -* a hybrid Gauss-Seidel / Jacobi relaxation scheme, -* a symmetric hybrid Gauss-Seidel / Jacobi relaxation scheme, -* l1-Gauss-Seidel or Jacobi, -* Chebyshev smoothers, +* weighted Jacobi relaxation (0), +* a hybrid Gauss-Seidel / Jacobi relaxation scheme (3 4), +* a symmetric hybrid Gauss-Seidel / Jacobi relaxation scheme (6), +* l1-Gauss-Seidel or Jacobi (13 14 18 8), +* Chebyshev smoothers (16), +* two-stage Gauss-Seidel smoothers (11 12) [BKRHSMTY2021]_, * hybrid block and Schwarz smoothers [Yang2004]_, -* ILU and approximate inverse smoothers. +* Incomplete LU factorization, see :ref:`ilu-amg-smoother`. +* Factorized Sparse Approximate Inverse (FSAI), see :ref:`fsai-amg-smoother`. Point relaxation schemes can be set using ``HYPRE_BoomerAMGSetRelaxType`` or, if one wants to specifically set the up cycle, down cycle or the coarsest grid, @@ -143,6 +147,19 @@ used. Functions that enable the user to access the systems AMG version are ``HYPRE_BoomerAMGSetNumFunctions``, ``HYPRE_BoomerAMGSetDofFunc`` and ``HYPRE_BoomerAMGSetNodal``. +There are basically two approaches to deal with matrices derived from systems +of PDEs. The unknown-based approach (which is the default) treats variables +corresponding to the same unknown or function separately, i.e., when coarsening +or generating interpolation, connections between variables associated with +different unknowns are ignored. This can work well for weakly coupled PDEs, +but will be problematic for strongly coupled PDEs. For such problems, we recommend +to use hypre's multigrid reduction (MGR) solver. The second approach, called +the nodal approach, considers all unknowns at a physical grid point together +such that coarsening, interpolation and relaxation occur in a point-wise fashion. +It is possible and sometimes prefered to combine nodal coarsening with unknown-based +interpolation. For this case, ``HYPRE_BoomerAMGSetNodal`` should be set > 1. +For details see the reference manual. + If the user can provide the near null-space vectors, such as the rigid body modes for linear elasticity problems, an interpolation is available that will incorporate these vectors with ``HYPRE_BoomerAMGSetInterpVectors`` and @@ -170,15 +187,32 @@ GPU-supported Options In general, CUDA unified memory is required for running BoomerAMG solvers on GPUs. However, hypre can also be built without ``--enable-unified-memory`` if -all the selected parameters have GPU-support. +all the selected parameters have GPU-support. The currently available GPU-supported BoomerAMG options include: * Coarsening: PMIS (8) * Interpolation: direct (3), BAMG-direct (15), extended (14), extended+i (6) and extended+e (18) * Aggressive coarsening * Second-stage interpolation with aggressive coarsening: extended (5) and extended+e (7) -* Smoother: Jacobi (7), l1-Jacobi (18), hybrid Gauss Seidel/SRROR (3 4 6), two-stage Gauss-Seidel (11,12) [BKRHSMTY2021]_ -* Relaxation order: must be 0, i.e., lexicographic order +* Smoother: Jacobi (7), l1-Jacobi (18), hybrid Gauss Seidel/SSOR (3 4 6), two-stage Gauss-Seidel (11,12) [BKRHSMTY2021]_, and Chebyshev (16) +* Relaxation order can be 0, lexicographic order, or C/F for (7) and (18) + +Memory locations and execution policies +------------------------------------------------------------------------------ +Hypre provides two user-level memory locations, ``HYPRE_MEMORY_HOST`` and ``HYPRE_MEMORY_DEVICE``, where +``HYPRE_MEMORY_HOST`` is always the CPU memory while ``HYPRE_MEMORY_DEVICE`` can be mapped to different memory spaces +based on the configure options of hypre. +When built with ``--with-cuda``, ``--with-hip``, ``--with-sycl``, or ``--with-device-openmp``, +``HYPRE_MEMORY_DEVICE`` is the GPU device memory, +and when built additionally with ``--enable-unified-memory``, it is the GPU unified memory (UM). +For a non-GPU build, ``HYPRE_MEMORY_DEVICE`` is also mapped to the CPU memory. +The default memory location of hypre's matrix and vector objects is ``HYPRE_MEMORY_DEVICE``, +which can be changed at runtime by ``HYPRE_SetMemoryLocation(...)``. + +The execution policies define the platform of running computations based on the memory locations of participating objects. +The default policy is ``HYPRE_EXEC_HOST``, i.e., executing on the host **if the objects are accessible from the host**. +It can be adjusted by ``HYPRE_SetExecutionPolicy(...)``. +Clearly, this policy only affects objects in UM, since UM is accessible from **both CPUs and GPUs**. A sample code of setting up IJ matrix :math:`A` and solve :math:`Ax=b` using AMG-preconditioned CG on GPUs is shown below. @@ -187,14 +221,14 @@ on GPUs is shown below. cudaSetDevice(device_id); /* GPU binding */ ... - HYPRE_Init(); /* must be the first HYPRE function call */ + HYPRE_Initialize(); /* must be the first HYPRE function call */ ... /* AMG in GPU memory (default) */ HYPRE_SetMemoryLocation(HYPRE_MEMORY_DEVICE); /* setup AMG on GPUs */ HYPRE_SetExecutionPolicy(HYPRE_EXEC_DEVICE); - /* use hypre's SpGEMM instead of cuSPARSE */ - HYPRE_SetSpGemmUseCusparse(FALSE); + /* use hypre's SpGEMM instead of vendor implementation */ + HYPRE_SetSpGemmUseVendor(FALSE); /* use GPU RNG */ HYPRE_SetUseGpuRand(TRUE); if (useHypreGpuMemPool) @@ -238,7 +272,7 @@ on GPUs is shown below. ... HYPRE_Finalize(); /* must be the last HYPRE function call */ -``HYPRE_Init()`` must be called and precede all the other ``HYPRE_`` functions, and +``HYPRE_Initialize()`` must be called and precede all the other ``HYPRE_`` functions, and ``HYPRE_Finalize()`` must be called before exiting. Miscellaneous @@ -248,9 +282,6 @@ For best performance, it might be necessary to set certain parameters, which will affect both coarsening and interpolation. One important parameter is the strong threshold, which can be set using the function ``HYPRE_BoomerAMGSetStrongThreshold``. The default value is 0.25, which appears -to be a good choice for 2-dimensional problems and the low complexity coarsening -algorithms. For 3-dimensional problems a better choice appears to be 0.5, when -using the default coarsening algorithm. However, the choice of the strength -threshold is problem dependent and therefore there could be better choices than -the two suggested ones. - +to be a good choice for diffusion problems. The choice of the strength +threshold is problem dependent. For example, elasticity problems often require a larger +strength threshold. diff --git a/external/hypre/src/docs/usr-manual/solvers-euclid.rst b/external/hypre/src/docs/usr-manual/solvers-euclid.rst index ab1ff5aa..e6d35406 100644 --- a/external/hypre/src/docs/usr-manual/solvers-euclid.rst +++ b/external/hypre/src/docs/usr-manual/solvers-euclid.rst @@ -1,4 +1,4 @@ -.. Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +.. Copyright (c) 1998 Lawrence Livermore National Security, LLC and other HYPRE Project Developers. See the top-level COPYRIGHT file for details. SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -7,6 +7,13 @@ Euclid ============================================================================== +.. warning:: + Euclid is not actively supported by the hypre development team. We recommend using + :ref:`ilu` for parallel ILU algorithms. This new ILU implementation includes + 64-bit integers support (for linear systems with more than 2,147,483,647 global + unknowns) through both *mixedint* and *bigint* builds of hypre and NVIDIA/AMD GPUs + support through the CUDA/HIP backends. + The Euclid library is a scalable implementation of the Parallel ILU algorithm that was presented at SC99 [HyPo1999]_, and published in expanded form in the SIAM Journal on Scientific Computing [HyPo2001]_. By *scalable* we mean that @@ -45,28 +52,28 @@ subsection lists the options, and provides guidance as to the settings that (in our experience) will likely prove effective for minimizing execution time. .. code-block:: c - + #include "HYPRE_parcsr_ls.h" - + HYPRE_Solver eu; HYPRE_Solver pcg_solver; HYPRE_ParVector b, x; HYPRE_ParCSRMatrix A; - + //Instantiate the preconditioner. HYPRE_EuclidCreate(comm, &eu); - + //Optionally use the following three methods to set runtime options. // 1. pass options from command line or string array. HYPRE_EuclidSetParams(eu, argc, argv); - + // 2. pass options from a configuration file. HYPRE_EuclidSetParamsFromFile(eu, "filename"); - + // 3. pass options using interface functions. HYPRE_EuclidSetLevel(eu, 3); ... - + //Set Euclid as the preconditioning method for some //other solver, using the function calls HYPRE_EuclidSetup //and HYPRE_EuclidSolve. We assume that the pcg_solver @@ -75,13 +82,13 @@ our experience) will likely prove effective for minimizing execution time. (HYPRE_PtrToSolverFcn) HYPRE_EuclidSolve, (HYPRE_PtrToSolverFcn) HYPRE_EuclidSetup, eu); - - //Solve the system by calling the Setup and Solve methods for, + + //Solve the system by calling the Setup and Solve methods for, //in this case, the HYPRE_PCG solver. We assume that A, b, and x //have been properly initialized. HYPRE_PCGSetup(pcg_solver, (HYPRE_Matrix)A, (HYPRE_Vector)b, (HYPRE_Vector)x); HYPRE_PCGSolve(pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, (HYPRE_Vector)x); - + //Destroy the Euclid preconditioning object. HYPRE_EuclidDestroy(eu); @@ -118,7 +125,7 @@ recognized by Euclid, no harm should ensue. **Method 2.** To pass options on the command line, call .. code-block:: c - + HYPRE_EuclidSetParams(HYPRE_Solver solver, int argc, char *argv[]); where ``argc`` and ``argv`` carry the usual connotation: ``main(int argc, char @@ -126,7 +133,7 @@ where ``argc`` and ``argv`` carry the usual connotation: ``main(int argc, char options on the command line per the following example. .. code-block:: bash - + mpirun -np 2 phoo -level 3 Since Euclid looks for the ``database`` file when ``HYPRE_EuclidCreate`` is @@ -149,13 +156,13 @@ you can then specify the configuration filename on the command line using the ``-db_filename filename`` option, e.g., .. code-block:: bash - + mpirun -np 2 phoo -db_filename ../myConfigFile **Method 4.** One can also set parameters via interface functions, e.g .. code-block:: c - + int HYPRE_EuclidSetLevel(HYPRE_Solver solver, int level); For a full set of functions, see the reference manual. @@ -192,13 +199,13 @@ Options Summary largest absolute value of any entry in the row. Guidance: try this in conjunction with -rowScale. CAUTION: If the coefficient matrix :math:`A` is symmetric, this setting is likely to cause the filled matrix, :math:`F = - L+U-I`, to be unsymmetric. This setting has no effect when ILUT factorization + L+U-I`, to be non-symmetric. This setting has no effect when ILUT factorization is selected. * **-rowScale** Scale values prior to factorization such that the largest value in any row is +1 or -1. Default: 0 (false). CAUTION: If the coefficient matrix :math:`A` is symmetric, this setting is likely to cause the filled - matrix, :math:`F = L+U-I`, to be unsymmetric. Guidance: if the matrix is + matrix, :math:`F = L+U-I`, to be non-symmetric. Guidance: if the matrix is poorly scaled, turning on row scaling may help convergence. * **-ilut** :math:`\langle float \rangle` Use ILUT factorization instead of the @@ -206,5 +213,4 @@ Options Summary tolerance, which is relative to the largest absolute value of any entry in the row being factored. CAUTION: If the coefficient matrix :math:`A` is symmetric, this setting is likely to cause the filled matrix, :math:`F = - L+U-I`, to be unsymmetric. NOTE: this option can only be used sequentially! - + L+U-I`, to be non-symmetric. NOTE: this option can only be used sequentially! diff --git a/external/hypre/src/docs/usr-manual/solvers-fac.rst b/external/hypre/src/docs/usr-manual/solvers-fac.rst index 580d220e..d3f26338 100644 --- a/external/hypre/src/docs/usr-manual/solvers-fac.rst +++ b/external/hypre/src/docs/usr-manual/solvers-fac.rst @@ -1,4 +1,4 @@ -.. Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +.. Copyright (c) 1998 Lawrence Livermore National Security, LLC and other HYPRE Project Developers. See the top-level COPYRIGHT file for details. SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/docs/usr-manual/solvers-fei.rst b/external/hypre/src/docs/usr-manual/solvers-fei.rst index 611bbe2d..51e0035f 100644 --- a/external/hypre/src/docs/usr-manual/solvers-fei.rst +++ b/external/hypre/src/docs/usr-manual/solvers-fei.rst @@ -1,4 +1,4 @@ -.. Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +.. Copyright (c) 1998 Lawrence Livermore National Security, LLC and other HYPRE Project Developers. See the top-level COPYRIGHT file for details. SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -9,6 +9,12 @@ FEI Solvers ============================================================================== +.. warning:: + FEI is not actively supported by the hypre development team. For similar + functionality, we recommend using :ref:`sec-Block-Structured-Grids-FEM`, which + allows the representation of block-structured grid problems via hypre's + SStruct interface. + After the FEI has been used to assemble the global linear system (as described in Chapter :ref:`ch-FEI`), a number of hypre solvers can be called to perform the solution. This is straightforward, if hypre's FEI has been used. If an @@ -20,24 +26,24 @@ the available options can be found in the FEI section of the reference manual. They are passed to the FEI as in the following example: .. code-block:: c++ - + nParams = 5; paramStrings = new char*[nParams]; for (i = 0; i < nParams; i++) } paramStrings[i] = new char[100]; - + strcpy(paramStrings[0], "solver cg"); strcpy(paramStrings[1], "preconditioner diag"); strcpy(paramStrings[2], "maxiterations 100"); strcpy(paramStrings[3], "tolerance 1.0e-6"); strcpy(paramStrings[4], "outputLevel 1"); - + feiPtr -> parameters(nParams, paramStrings); To solve the linear system of equations, we call .. code-block:: c++ - + feiPtr -> solve(&status); where the returned value ``status`` indicates whether the solve was successful. @@ -45,7 +51,7 @@ where the returned value ``status`` indicates whether the solve was successful. Finally, the solution can be retrieved by the following function call: .. code-block:: c++ - + feiPtr -> getBlockNodeSolution(elemBlkID, nNodes, nodeIDList, solnOffsets, solnValues); @@ -53,7 +59,7 @@ where ``nodeIDList`` is a list of nodes in element block ``elemBlkID``, and ``solnOffsets[i]`` is the index pointing to the first location where the variables at node :math:`i` is returned in ``solnValues``. -Solvers Available Only through the FEI +Solvers Available Only through the FEI ------------------------------------------------------------------------------ While most of the solvers from the previous sections are available through the @@ -71,9 +77,9 @@ following we list some of these internal solvers. #. Additional Krylov solvers (FGMRES, TFQMR, symmetric QMR), #. SuperLU direct solver (sequential), -#. SuperLU direct solver with iterative refinement (sequential), +#. SuperLU direct solver with iterative refinement (sequential), -Parallel Preconditioners +Parallel Preconditioners ^^^^^^^^^^^^^^^^^^^^^^^^ The performance of the Krylov solvers can be improved by clever selection of @@ -82,7 +88,7 @@ following preconditioners are available via the ``LinearSystemCore`` interface: #. the modified version of MLI, which requires the finite element substructure matrices to construct the prolongation operators, -#. parallel domain decomposition with inexact local solves (``DDIlut``), +#. parallel domain decomposition with inexact local solves (``DDIlut``), #. least-squares polynomial preconditioner, #. :math:`2 \times 2` block preconditioner, and #. :math:`2 \times 2` Uzawa preconditioner. @@ -107,25 +113,25 @@ The incoming linear system of equations is assumed to be in the form: .. math:: - \left[ - \begin{array}{cc} + \left[ + \begin{array}{cc} D & B \\ B^T & 0 \end{array} - \right] + \right] \left[ - \begin{array}{c} + \begin{array}{c} x_1 \\ x_2 \end{array} - \right] + \right] = \left[ - \begin{array}{c} + \begin{array}{c} b_1 \\ b_2 \end{array} - \right] + \right] where :math:`D` is a diagonal matrix. After Schur complement reduction is applied, the resulting linear system becomes @@ -145,20 +151,20 @@ re-order the system into a :math:`3 \times 3` block matrix. .. math:: - \left[ - \begin{array}{ccc} + \left[ + \begin{array}{ccc} A_{11} & A_{12} & N \\ A_{21} & A_{22} & D \\ N_{T} & D & 0 \\ \end{array} - \right] + \right] = - \left[ - \begin{array}{ccc} + \left[ + \begin{array}{ccc} A_{11} & \hat{A}_{12} \\ \hat{A}_{21} & \hat{A}_{22}. \end{array} - \right] + \right] The reduced system has the form : diff --git a/external/hypre/src/docs/usr-manual/solvers-fsai.rst b/external/hypre/src/docs/usr-manual/solvers-fsai.rst new file mode 100644 index 00000000..8a961428 --- /dev/null +++ b/external/hypre/src/docs/usr-manual/solvers-fsai.rst @@ -0,0 +1,101 @@ +.. Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + HYPRE Project Developers. See the top-level COPYRIGHT file for details. + + SPDX-License-Identifier: (Apache-2.0 OR MIT) + +.. _fsai: + +FSAI +============================================================================== + +FSAI is a parallel implementation of the Factorized Sparse Approximate Inverse preconditioner, +initially proposed by [KoYe1993]_. Given a symmetric positive definite matrix :math:`A`, FSAI +computes a triangular matrix :math:`G` that approximates the inverse of the lower Cholesky +factor (:math:`L`) of :math:`A`. This computation is done by minimizing the Frobenius norm +:math:`|| I - G L ||_F` without explicit knowledge of :math:`L`. The resulting preconditioner +preserves the positive definiteness of :math:`A` and is given by :math:`M^{-1} = G^{T} G`. + +One of the critical factors determining the quality of sparse approximate inverse +preconditioners lies in choosing the sparsity pattern of :math:`G`. While ParaSails +employs *a priori* sparsity patterns, FSAI uses an iterative strategy that generates +sparsity patterns on the fly, i.e., while computing their nonzero coefficient values +concurrently. At every step of the iterative process, the sparsity pattern of a row of +:math:`G` is augmented with a fixed number of entries, leading to the most significant +reduction of the conditioning number of :math:`G A G^T`. Such a strategy is also called +"adaptive FSAI" or "dynamic FSAI" and it can lead to more robust sparse approximate +inverses than ParaSails. For more details on how it works, see [JaFe2015]_. + +Parameter Settings +------------------------------------------------------------------------------ + +The accuracy and cost of FSAI are determined by three configurations parameters as shown +in the table below + + ================= ======= ============= ================= ======= + param type range sug. values default + ================= ======= ============= ================= ======= + ``max_steps`` int :math:`\ge 0` 5, 10, 30 5 + ``max_step_size`` int :math:`\ge 0` 1, 3, 6 3 + ``kap_tolerance`` real :math:`\ge 0` 0.0, 1.E-2, 1.E-3 1.E-3 + ================= ======= ============= ================= ======= + +The first parameter, ``max_steps``, controls the number of maximum steps used in the iterative +algorithm. The second parameter, ``max_step_size``, gives the maximum number of indices added +to the sparsity pattern of :math:`G` at each step. Lastly, the third parameter, +``kap_tolerance``, is a floating-point value used to stop the inclusion of new indices to the +sparsity pattern of :math:`G` when the conditioning number of :math:`G A G^T` +stagnates. This can be disabled by setting ``kap_tolerance = 0``. Naturally, the +preconditioner quality increases for denser sparsity patterns of :math:`G`, but so do +its setup and solve costs. For a reasonable balance between accuracy and cost, +we recommend that :math:`max\_steps * max\_step\_size \leq 30`. The configuration +parameters of FSAI can be set via the following calls: + +.. code-block:: c + + HYPRE_FSAISetMaxSteps(HYPRE_Solver solver, HYPRE_Int max_steps); + HYPRE_FSAISetMaxStepSize(HYPRE_Solver solver, HYPRE_Int max_step_size); + HYPRE_FSAISetKapTolerance(HYPRE_Solver solver, HYPRE_Real kap_tolerance); + +.. _fsai-amg-smoother: + +FSAI as Smoother to BoomerAMG +------------------------------------------------------------------------------ + +As discussed in [PaFa2019]_, the factorized sparse approximate inverse method can be an +effective smoother to AMG for several reasons. Particularly, it leads to a symmetric operator, +and thus allows AMG to be used as a preconditioner for the conjugate gradient solver. In +hypre, FSAI can be used as a complex smoother to BoomerAMG by calling the functions: + +.. code-block:: c + + HYPRE_BoomerAMGSetSmoothType(HYPRE_Solver solver, 4); + HYPRE_BoomerAMGSetSmoothNumLevels(HYPRE_Solver solver, HYPRE_Int num_levels); + +where ``num_levels`` is the last multigrid level where FSAI is used. The configuration +parameters of the FSAI smoother, as described above, can be set via the following calls: + +.. code-block:: c + + HYPRE_BoomerAMGSetFSAIMaxSteps(HYPRE_Solver solver, HYPRE_Int max_steps); + HYPRE_BoomerAMGSetFSAIMaxStepSize(HYPRE_Solver solver, HYPRE_Int max_step_size); + HYPRE_BoomerAMGSetFSAIKapTolerance(HYPRE_Solver solver, HYPRE_Real kap_tolerance); + +Implementation Notes +------------------------------------------------------------------------------ + +* When the matrix :math:`A` is distributed across MPI tasks, FSAI considers only the + block diagonal portions of :math:`A` for computing :math:`G`. The resulting + preconditioner is effectively a block-Jacobi sparse approximate inverse in the MPI + sense. Although this strategy reduces communication costs, it can degrade convergence + performance when several tasks are used, especially when FSAI is employed as a + preconditioner to a Krylov solver. + +* The CPU version of FSAI supports threading via OpenMP. To enable it, users need to + compile hypre with OpenMP support via the configure option ``--with-openmp``. In this + case, FSAI relies on an implementation of BLAS/LAPACK that is thread-safe. The one + distributed internally with hypre fulfills this criterion, but care must be taken when + linking hypre to external BLAS/LAPACK libraries. In HPC platforms, we recommend using + vendor implementations of BLAS/LAPACK for better setup performance of FSAI, regardless + of whether using OpenMP or not. + +* The GPU version of FSAI is under development. diff --git a/external/hypre/src/docs/usr-manual/solvers-hybrid.rst b/external/hypre/src/docs/usr-manual/solvers-hybrid.rst index 56fbc76e..7977b30e 100644 --- a/external/hypre/src/docs/usr-manual/solvers-hybrid.rst +++ b/external/hypre/src/docs/usr-manual/solvers-hybrid.rst @@ -1,4 +1,4 @@ -.. Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +.. Copyright (c) 1998 Lawrence Livermore National Security, LLC and other HYPRE Project Developers. See the top-level COPYRIGHT file for details. SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -23,7 +23,7 @@ ParCSRHybrid, if used through the ``IJ`` interface and is used here with BoomerAMG. The user can determine the average convergence speed by setting a convergence tolerance :math:`0 \leq \theta < 1` via the routine ``HYPRE_StructHybridSetConvergenceTol`` or -``HYPRE_StructParCSRHybridSetConvergenceTol``. The default setting is 0.9. +``HYPRE_ParCSRHybridSetConvergenceTol``. The default setting is 0.9. The average convergence factor :math:`\rho_i = \left({{\| r_i \|} \over {\| r_0 \|}}\right)^{1/i}` is monitored within the chosen Krylov solver, where @@ -37,3 +37,16 @@ considered too slow when When this condition is fulfilled the hybrid solver switches from a diagonally scaled Krylov solver to a preconditioned solver. +.. Add blank lines to help with navigation pane formatting +| +| +| +| +| +| +| +| +| +| +| +| diff --git a/external/hypre/src/docs/usr-manual/solvers-hypre-ilu.rst b/external/hypre/src/docs/usr-manual/solvers-hypre-ilu.rst deleted file mode 100644 index b595e456..00000000 --- a/external/hypre/src/docs/usr-manual/solvers-hypre-ilu.rst +++ /dev/null @@ -1,53 +0,0 @@ -.. Copyright 1998-2019 Lawrence Livermore National Security, LLC and other - HYPRE Project Developers. See the top-level COPYRIGHT file for details. - - SPDX-License-Identifier: (Apache-2.0 OR MIT) - - -hypre-ILU -============================================================================== - -The hypre-ILU solver is a parallel ILU solver based on a domain decomposition -framework. It may be use iteratively as a standalone solver or smoother, as well as a -preconditioner for accelerators like Krylov subspace methods. This solver -implements various parallel variants of the dual threshold (truncation) incomplete -LU factorization - ILUT, and the level-based incomplete LU factorization - ILUk. - - -Overview ------------------------------------------------------------------------------- -The parallel hypre-ILU solver follows a domain decomposition approach for solving -distributed sparse linear systems of equations. The strategy is to decompose the -domain into interior and interface nodes, where an interface node separates two -interior nodes from adjacent domains. In the purely algebraic setting, this is -equivalent to partitioning the matrix row data into local (processor-owned) data -and external (off-processor-owned) data. The resulting global view of the -partitioned matrix has (diagonal) blocks corresponding to local data, and -off-diagonal blocks corresponding to non-local data. The resulting parallel ILU -strategy is composed of a (local) block factorization and a (global) Schur -complement solve. Several strategies provided to efficiently solve the Schur -complement system. - -The following represents a minimal set of functions, and some optional -functions, to call to use the hypre_ILU solver. For simplicity, we ignore the function -parameters here, and refer the reader to the reference manual for more details -on the parameters and their defaults. - - -* ``HYPRE_ILUCreate:`` Create the hypre_ILU solver object. -* ``HYPRE_ILUSetType:`` Set the type of ILU factorization to do. Here, the user specifies - one of several flavors of parallel ILU based on the different combinations of local - factorizations and global Schur complement solves. Please refer to the reference manual - for more details about the different options available to the user. -* (Optional) ``HYPRE_ILUSetLevelOfFill:`` Set the level of fill used by the level-based ILUk strategy. -* (Optional) ``HYPRE_ILUSetSchurMaxIter:`` Set the maximum number of iterations for solving - the Schur complement system. -* (Optional) ``HYPRE_ILUSetMaxIter:`` Set the maximum number of iterations when used as a - solver or smoother. -* ``HYPRE_ILUSetup:`` Setup and hypre_ILU solver object. -* ``HYPRE_ILUSolve:`` Solve the linear system. -* ``HYPRE_ILUDestroy:`` Destroy the hypre_ILU solver object - -For more details about additional solver options and parameters, please refer to -the reference manual. NOTE: The hypre_ILU solver is currently only supported by the -IJ interface. diff --git a/external/hypre/src/docs/usr-manual/solvers-ilu.rst b/external/hypre/src/docs/usr-manual/solvers-ilu.rst new file mode 100644 index 00000000..e11f6a4e --- /dev/null +++ b/external/hypre/src/docs/usr-manual/solvers-ilu.rst @@ -0,0 +1,245 @@ +.. Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + HYPRE Project Developers. See the top-level COPYRIGHT file for details. + + SPDX-License-Identifier: (Apache-2.0 OR MIT) + +.. _ilu: + +ILU +============================================================================== + +ILU is a suite of parallel incomplete LU factorization algorithms featuring dual threshold +(ILUT) and level-based (ILUK) variants. The implementation is based on a domain +decomposition framework for achieving distributed parallelism. ILU can be used as a +standalone iterative solver (this is not recommended), preconditioner for Krylov subspace +methods, or smoother for multigrid methods such as BoomerAMG and MGR. + +.. note:: + ILU is currently only supported by the IJ interface. + +Overview +------------------------------------------------------------------------------ + +ILU utilizes a domain decomposition framework. A basic block-Jacobi approach involves +performing inexact solutions within the local domains owned by the processes, using +parallel local ILU factorizations. In a more advanced approach, the unknowns are +partitioned into interior and interface points, where the interface points separate the +interior points in adjacent domains. In an algebraic context, this is equivalent to +dividing the matrix rows into local (processor-owned) and external (off-processor-owned) +blocks. The overall parallel ILU strategy is a two-level method that consists of ILU +solves within the local blocks and a global solve involving the Schur complement system, +which various iterative approaches in this framework can solve. + +User-level functions +------------------------------------------------------------------------------ + +A list of user-level functions for configuring ILU is given below, where each block +of functions is marked as *Required*, *Recommended*, *Optional*, or *Exclusively +required*. Note that the last two blocks of function calls are exclusively required, i.e., +the first block should be called only when ILU is used as a standalone solver, while +the second block should be called only when it is used as a preconditioner to GMRES. In +the last case, other Krylov methods can be chosen. We refer the reader to +:ref:`ch-Solvers` for more information. + +.. code-block:: c + + /* (Required) Create ILU solver */ + HYPRE_ILUCreate(&ilu_solver); + + /* (Recommended) General solver options */ + HYPRE_ILUSetType(ilu_solver, ilu_type); /* 0, 1, 10, 11, 20, 21, 30, 31, 40, 41, 50 */ + HYPRE_ILUSetMaxIter(ilu_solver, max_iter); + HYPRE_ILUSetTol(ilu_solver, tol); + HYPRE_ILUSetLocalReordering(ilu_solver, reordering); /* 0: none, 1: RCM */ + HYPRE_ILUSetPrintLevel(ilu_solver, print_level); + + /* (Optional) Function calls for ILUK variants */ + HYPRE_ILUSetLevelOfFill(ilu_solver, fill); + + /* (Optional) Function calls for ILUT variants */ + HYPRE_ILUSetMaxNnzPerRow(ilu_solver, max_nnz_row); + HYPRE_ILUSetDropThreshold(ilu_solver, threshold); + + /* (Optional) Function calls for GMRES-ILU or NSH-ILU */ + HYPRE_ILUSetNSHDropThreshold(ilu_solver, threshold); + HYPRE_ILUSetSchurMaxIter(ilu_solver, schur_max_iter); + + /* (Optional) Function calls for iterative ILU variants */ + HYPRE_ILUSetTriSolve(ilu_solver, 0); + HYPRE_ILUSetLowerJacobiIters(ilu_solver, ljac_iters); + HYPRE_ILUSetUpperJacobiIters(ilu_solver, ujac_iters); + + /* (Exclusively required) Function calls for using ILU as standalone solver */ + HYPRE_ILUSetup(ilu_solver, parcsr_M, b, x); + HYPRE_ILUSolve(ilu_solver, parcsr_A, b, x); + + /* (Exclusively required) Function calls for using ILU as preconditioner to GMRES */ + HYPRE_GMRESSetup(gmres_solver, (HYPRE_Matrix)A, (HYPRE_Vector)b, (HYPRE_Vector)x); + HYPRE_GMRESSolve(gmres_solver, (HYPRE_Matrix)A, (HYPRE_Vector)b, (HYPRE_Vector)x); + + /* (Required) Free memory */ + HYPRE_ILUDestroy(ilu_solver); + +A short explanation for each of those functions and its parameters is given next. + +* ``HYPRE_ILUCreate`` Create the hypre_ILU solver object. +* ``HYPRE_ILUDestroy`` Destroy the hypre_ILU solver object. +* ``HYPRE_ILUSetType`` Set the type of ILU factorization. Options are: + + * 0: Block-Jacobi ILUK (BJ-ILUK). + * 1: Block-Jacobi ILUT (BJ-ILUT). + * 10: GMRES with ILUK (GMRES-ILUK). + * 11: GMRES with ILUT (GMRES-ILUT). + * 20: NSH with ILUK (NSH-ILUK). + * 21: NSH with ILUT (NSH-ILUT). + * 30: RAS with ILUK (RAS-ILUK). + * 31: RAS with ILUT (RAS-ILUT). + * 40: ddPQ-GMRES with ILUK (ddPQ-GMRES-ILUK). + * 41: ddPQ-GMRES with ILUT (ddPQ-GMRES-ILUT). + * 50: GMRES with RAP-ILU0 with modified ILU0 (GMRES-RAP-ILU0). +* ``HYPRE_ILUSetMaxIter`` Set the maximum number of ILU iterations. We recommend setting + this value to one when ILU is used as a preconditioner or smoother. +* ``HYPRE_ILUSetTol`` Set the convergence tolerance for ILU. We recommend setting + this value to zero when ILU is used as a preconditioner or smoother. +* ``HYPRE_ILUSetLocalReordering`` Set the local matrix reordering algorithm. + + * 0: No reordering. + * 1: Reverse Cuthill–McKee (RCM). +* ``HYPRE_ILUSetPrintLevel`` Set the verbosity level for algorithm statistics. + + * 0: No output. + * 1: Print setup info. + * 2: Print solve info. + * 3: Print setup and solve info. +* ``HYPRE_ILUSetLevelOfFill`` Set the level of fill used by the level-based ILUK + strategy. +* ``HYPRE_ILUSetMaxNnzPerRow`` Set the maximum number of nonzero entries per row in the + triangular factors for ILUT. +* ``HYPRE_ILUSetDropThreshold`` Set the threshold for dropping nonzero entries during the + construction of the triangular factors for ILUT. +* ``HYPRE_ILUSetNSHDropThreshold`` Set the threshold for dropping nonzero entries during the + computation of the approximate inverse matrix via NSH-ILU. +* ``HYPRE_ILUSetSchurMaxIter`` Set the maximum number of iterations for solving + the Schur complement system (GMRES-ILU or NSH-ILU). +* ``HYPRE_ILUSetTriSolve`` Set triangular solve method used in ILU's solve phase. Option zero + refers to the iterative approach, which leads to good performance in GPUs, and option + one refers to the direct (exact) approach. +* ``HYPRE_ILUSetLowerJacobiIters`` Set the number of iterations for solving the lower + triangular linear system. This option makes sense when enabling the iterative triangular + solve approach. +* ``HYPRE_ILUSetUpperJacobiIters`` Same as previous function, but for the upper + triangular factor. +* ``HYPRE_ILUSetup`` Setup a hypre_ILU solver object. +* ``HYPRE_ILUSolve`` Solve the linear system with hypre_ILU. +* ``HYPRE_ILUDestroy`` Destroy the hypre_ILU solver object. + +.. note:: + For more details about ILU options and parameters, including their default + values, we refer the reader to hypre's reference manual or section :ref:`sec-ParCSR-Solvers`. + +.. _ilu-amg-smoother: + +ILU as Smoother for BoomerAMG +------------------------------------------------------------------------------ + +The following functions can be used to configure ILU as a smoother to BoomerAMG: + +.. code-block:: c + + /* (Required) Set ILU as smoother to BoomerAMG */ + HYPRE_BoomerAMGSetSmoothType(amg_solver, 5); + HYPRE_BoomerAMGSetSmoothNumLevels(amg_solver, num_levels); + + /* (Optional) General ILU configuration parameters */ + HYPRE_BoomerAMGSetILUType(amg_solver, ilu_type); + HYPRE_BoomerAMGSetILUMaxIter(amg_solver, ilu_max_iter); + HYPRE_BoomerAMGSetILULocalReordering(amg_solver, ilu_reordering); + + /* (Optional) Function calls for ILUK smoother variants */ + HYPRE_BoomerAMGSetILULevel(amg_solver, ilu_fill); + + /* (Optional) Function calls for ILUT smoother variants */ + HYPRE_BoomerAMGSetILUDroptol(amg_solver, ilu_threshold); + HYPRE_BoomerAMGSetILUMaxRowNnz(amg_solver, ilu_max_nnz_row); + + /* (Optional) Function calls for iterative ILU smoother variants */ + HYPRE_BoomerAMGSetILUTriSolve(amg_solver, 0); + HYPRE_BoomerAMGSetILULowerJacobiIters(amg_solver, ilu_ljac_iters); + HYPRE_BoomerAMGSetILUUpperJacobiIters(amg_solver, ilu_ujac_iters); + +where: + +* ``HYPRE_BoomerAMGSetSmoothNumLevels`` Enable smoothing in the first ``num_levels`` + levels of AMG. +* ``HYPRE_BoomerAMGSetILUType`` Set the type of ILU factorization. See ``HYPRE_ILUSetType``. +* ``HYPRE_BoomerAMGSetILUMaxIter`` Set the number of ILU smoother sweeps. +* ``HYPRE_BoomerAMGSetILULocalReordering`` Set the local matrix reordering algorithm. +* ``HYPRE_BoomerAMGSetILULevel`` Set ILUK's fill level. +* ``HYPRE_BoomerAMGSetILUDroptol`` Set ILUT's threshold. +* ``HYPRE_BoomerAMGSetILUMaxRowNnz`` Set ILUT's maximum number of nonzero entries per row. +* ``HYPRE_BoomerAMGSetILUTriSolve`` Set triangular solve method. See ``HYPRE_ILUSetTriSolve``. +* ``HYPRE_BoomerAMGSetILULowerJacobiIters`` Set the number of iterations for the L factor. +* ``HYPRE_BoomerAMGSetILUUpperJacobiIters`` Same as previous function, but for the U factor. + +GPU support +------------------------------------------------------------------------------ + +The addition of GPU support to ILU is ongoing work. A few algorithm types have already +been fully ported to the CUDA and HIP backends, i.e., both their setup (factorization) and +solve phases are executed on the device. Below is a detailed list of which phases (setup +and solve) of the various ILU algorithms have been ported to GPUs. In the table, +*UVM-Setup* indicates that the setup phase is executed on the CPU (host); at the same +time, the triangular factors are stored in a memory space that is accessible from the GPU +(device) via unified memory. This feature must be enabled during hypre's configuration. + +.. list-table:: + :widths: 20 20 20 20 + :header-rows: 1 + + * - + - CUDA (NVIDIA GPUs) + - HIP (AMD GPUs) + - SYCL (Intel GPUs) + * - **BJ-ILU0** + - Setup and Solve + - Setup and Solve + - UVM-Setup and Solve + * - **BJ-ILU(K/T)** + - UVM-Setup and Solve + - UVM-Setup and Solve + - UVM-Setup and Solve + * - **GMRES-ILU0** + - Setup and Solve + - Setup and Solve + - UVM-Setup and Solve + * - **GMRES-RAP-ILU0** + - UVM-Setup and Solve + - UVM-Setup and Solve + - UVM-Setup and Solve + * - **GMRES-ILU(K/T)** + - UVM-Setup and Solve + - UVM-Setup and Solve + - UVM-Setup and Solve + * - **ddPQ-GMRES-ILU(K/T)** + - UVM-Setup and Solve + - UVM-Setup and Solve + - UVM-Setup and Solve + * - **NSH-ILU(K/T)** + - UVM-Setup and Solve + - UVM-Setup and Solve + - UVM-Setup and Solve + * - **RAS-ILU(K/T)** + - UVM-Setup and Solve + - UVM-Setup and Solve + - UVM-Setup and Solve + +.. hint:: + For better setup performance on GPUs, disable local reordering by passing option + zero to ``HYPRE_ILUSetLocalReordering`` or + ``HYPRE_BoomerAMGSetILULocalReordering``. This may degrade convergence of the iterative + solver. + +.. note:: + hypre must be built with ``cuSPARSE`` support when running ILU on NVIDIA + GPUs, ``rocSPARSE`` when running on AMD GPUs, or ``oneMKL sparse`` when + running on Intel GPUs. diff --git a/external/hypre/src/docs/usr-manual/solvers-lobpcg.rst b/external/hypre/src/docs/usr-manual/solvers-lobpcg.rst index c592ef5f..66d20e2e 100644 --- a/external/hypre/src/docs/usr-manual/solvers-lobpcg.rst +++ b/external/hypre/src/docs/usr-manual/solvers-lobpcg.rst @@ -1,4 +1,4 @@ -.. Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +.. Copyright (c) 1998 Lawrence Livermore National Security, LLC and other HYPRE Project Developers. See the top-level COPYRIGHT file for details. SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -31,3 +31,21 @@ The LOBPCG code is available for system interfaces: Struct, SStruct, and IJ. It is also used in the Auxiliary-space Maxwell Eigensolver (AME). The LOBPCG setup is similar to the setup for PCG. +.. Add blank lines to help with navigation pane formatting +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| diff --git a/external/hypre/src/docs/usr-manual/solvers-maxwell.rst b/external/hypre/src/docs/usr-manual/solvers-maxwell.rst index 9a67739a..9713ae9c 100644 --- a/external/hypre/src/docs/usr-manual/solvers-maxwell.rst +++ b/external/hypre/src/docs/usr-manual/solvers-maxwell.rst @@ -1,4 +1,4 @@ -.. Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +.. Copyright (c) 1998 Lawrence Livermore National Security, LLC and other HYPRE Project Developers. See the top-level COPYRIGHT file for details. SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/docs/usr-manual/solvers-mgr.rst b/external/hypre/src/docs/usr-manual/solvers-mgr.rst index 62284a5a..05ec8890 100644 --- a/external/hypre/src/docs/usr-manual/solvers-mgr.rst +++ b/external/hypre/src/docs/usr-manual/solvers-mgr.rst @@ -1,4 +1,4 @@ -.. Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +.. Copyright (c) 1998 Lawrence Livermore National Security, LLC and other HYPRE Project Developers. See the top-level COPYRIGHT file for details. SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/docs/usr-manual/solvers-mli.rst b/external/hypre/src/docs/usr-manual/solvers-mli.rst index 9e13f9b3..60872c4a 100644 --- a/external/hypre/src/docs/usr-manual/solvers-mli.rst +++ b/external/hypre/src/docs/usr-manual/solvers-mli.rst @@ -1,4 +1,4 @@ -.. Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +.. Copyright (c) 1998 Lawrence Livermore National Security, LLC and other HYPRE Project Developers. See the top-level COPYRIGHT file for details. SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -36,3 +36,19 @@ Note that parameters are set via ``HYPRE_LSI_MLISetParams``. A list of valid parameters that can be set using this routine can be found in the FEI section of the reference manual. +.. Add blank lines to help with navigation pane formatting +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| diff --git a/external/hypre/src/docs/usr-manual/solvers-parasails.rst b/external/hypre/src/docs/usr-manual/solvers-parasails.rst index fe7ad179..27469f0c 100644 --- a/external/hypre/src/docs/usr-manual/solvers-parasails.rst +++ b/external/hypre/src/docs/usr-manual/solvers-parasails.rst @@ -1,4 +1,4 @@ -.. Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +.. Copyright (c) 1998 Lawrence Livermore National Security, LLC and other HYPRE Project Developers. See the top-level COPYRIGHT file for details. SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -7,6 +7,11 @@ ParaSails ============================================================================== +.. warning:: + ParaSails is not actively supported by the hypre development team. We recommend using + :ref:`fsai` for parallel sparse approximate inverse algorithms. This new implementation + includes NVIDIA/AMD GPU support through the CUDA/HIP backends. + ParaSails is a parallel implementation of a sparse approximate inverse preconditioner, using *a priori* sparsity patterns and least-squares (Frobenius norm) minimization. Symmetric positive definite (SPD) problems are handled @@ -53,7 +58,7 @@ in order to construct the preconditioner. ParaSail's Create function differs from the synopsis in the following way: .. code-block:: c - + int HYPRE_ParaSailsCreate(MPI_Comm comm, HYPRE_Solver *solver, int symmetry); where ``comm`` is the MPI communicator. @@ -75,7 +80,7 @@ For more information about the final case, see section :ref:`nearly`. Parameters for setting up the preconditioner are specified using .. code-block:: c - + int HYPRE_ParaSailsSetParams(HYPRE_Solver solver, double thresh, int nlevel, double filter); @@ -119,4 +124,3 @@ latter may be guaranteed by 1) constructing the sparsity pattern with a symmetric matrix, or 2) if the matrix is structurally symmetric (has symmetric pattern), then thresholding to construct the pattern is not used (i.e., zero value of the ``thresh`` parameter is used). - diff --git a/external/hypre/src/docs/usr-manual/solvers-pilut.rst b/external/hypre/src/docs/usr-manual/solvers-pilut.rst index 772e1e61..f8848613 100644 --- a/external/hypre/src/docs/usr-manual/solvers-pilut.rst +++ b/external/hypre/src/docs/usr-manual/solvers-pilut.rst @@ -1,4 +1,4 @@ -.. Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +.. Copyright (c) 1998 Lawrence Livermore National Security, LLC and other HYPRE Project Developers. See the top-level COPYRIGHT file for details. SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -9,9 +9,12 @@ PILUT: Parallel Incomplete Factorization ============================================================================== -**Note:** this code is no longer supported by the hypre team. We recommend to -use Euclid instead, which is more versatile and in general more efficient, -especially when used with many processors. +.. warning:: + PILUT is not actively supported by the hypre development team. We recommend using + :ref:`ilu` for parallel ILU algorithms. This new ILU implementation includes + 64-bit integers support (for linear systems with more than 2,147,483,647 global + unknowns) through both *mixedint* and *bigint* builds of hypre and NVIDIA/AMD GPUs + support through the CUDA/HIP backends. PILUT is a parallel preconditioner based on Saad's dual-threshold incomplete factorization algorithm. The original version of PILUT was done by Karypis and @@ -22,10 +25,10 @@ matrix implementations, including hypre's ParCSR format, PETSc's matrices, and ISIS++ RowMatrix. The algorithm produces an approximate factorization :math:`L U`, with the preconditioner :math:`M` defined by :math:`M = L U`. -**Note:** PILUT produces a nonsymmetric preconditioner even when the original -matrix is symmetric. Thus, it is generally inappropriate for preconditioning -symmetric methods such as Conjugate Gradient. - +.. note:: + PILUT produces a nonsymmetric preconditioner even when the original matrix is + symmetric. Thus, it is generally inappropriate for preconditioning symmetric methods + such as Conjugate Gradient. Parameters: ------------------------------------------------------------------------------ @@ -45,3 +48,14 @@ Parameters: values of ``tol`` lead to more accurate preconditioners, but can also lead to increases in the time to calculate the preconditioner. +.. Add blank lines to help with navigation pane formatting +| +| +| +| +| +| +| +| +| +| diff --git a/external/hypre/src/docs/usr-manual/solvers-smg-pfmg.rst b/external/hypre/src/docs/usr-manual/solvers-smg-pfmg.rst index db119e81..859a9712 100644 --- a/external/hypre/src/docs/usr-manual/solvers-smg-pfmg.rst +++ b/external/hypre/src/docs/usr-manual/solvers-smg-pfmg.rst @@ -1,4 +1,4 @@ -.. Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +.. Copyright (c) 1998 Lawrence Livermore National Security, LLC and other HYPRE Project Developers. See the top-level COPYRIGHT file for details. SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/docs/usr-manual/solvers-split.rst b/external/hypre/src/docs/usr-manual/solvers-split.rst index 714ab230..7a079a84 100644 --- a/external/hypre/src/docs/usr-manual/solvers-split.rst +++ b/external/hypre/src/docs/usr-manual/solvers-split.rst @@ -1,4 +1,4 @@ -.. Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +.. Copyright (c) 1998 Lawrence Livermore National Security, LLC and other HYPRE Project Developers. See the top-level COPYRIGHT file for details. SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -25,3 +25,26 @@ where :math:`\tilde{M}^{-1}` is a decoupled block-diagonal V(1,1) cycle, a separate cycle for each part and variable type. There are two V-cycle options, SMG and PFMG. +.. Add blank lines to help with navigation pane formatting +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| diff --git a/external/hypre/src/examples/CMakeLists.txt b/external/hypre/src/examples/CMakeLists.txt index 505d55d0..359aee73 100644 --- a/external/hypre/src/examples/CMakeLists.txt +++ b/external/hypre/src/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/examples/Makefile_gpu b/external/hypre/src/examples/Makefile_gpu deleted file mode 100644 index 82e8cf43..00000000 --- a/external/hypre/src/examples/Makefile_gpu +++ /dev/null @@ -1,248 +0,0 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other -# HYPRE Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -######################################################################## -# Compiler and external dependences -######################################################################## -CC = mpixlc -F77 = mpif77 -CXX = mpixlC -F90 = mpif77 -LINK_CC = nvcc -LINK_CXX = nvcc - -HYPRE_DIR = ../hypre - -######################################################################## -# CUDA -######################################################################## -CUDA_INCL = -I${CUDA_HOME}/include -CUDA_LIBS = -L${CUDA_HOME}lib64 -lcudart -lcusparse -lcurand -CUDA_ARCH = -gencode arch=compute_60,code=sm_60 -gencode arch=compute_70,code=sm_70 -NVCC_LDFLAGS = -ccbin=${CXX} ${CUDA_ARCH} - -######################################################################## -# Compiling and linking options -######################################################################## -COPTS = -g -Wall -CINCLUDES = -I$(HYPRE_DIR)/include $(CUDA_INCL) -#CDEFS = -DHYPRE_EXVIS -CDEFS = -CFLAGS = $(COPTS) $(CINCLUDES) $(CDEFS) -FOPTS = -g -FINCLUDES = $(CINCLUDES) -FFLAGS = $(FOPTS) $(FINCLUDES) -CXXOPTS = $(COPTS) -Wno-deprecated -CXXINCLUDES = $(CINCLUDES) -I.. -CXXDEFS = $(CDEFS) -IFLAGS_BXX = -CXXFLAGS = $(CXXOPTS) $(CXXINCLUDES) $(CXXDEFS) $(IFLAGS_BXX) -IF90FLAGS = -F90FLAGS = $(FFLAGS) $(IF90FLAGS) - -LINKOPTS = -LIBS = -L$(HYPRE_DIR)/lib -lHYPRE -lm ${CUDA_LIBS} -LFLAGS = $(LINKOPTS) $(LIBS) $(NVCC_LDFLAGS) -lstdc++ -LFLAGS_B =\ - -L${HYPRE_DIR}/lib\ - -lbHYPREClient-C\ - -lbHYPREClient-CX\ - -lbHYPREClient-F\ - -lbHYPRE\ - -lsidl -ldl -lxml2 -LFLAGS77 = $(LFLAGS) -LFLAGS90 = - -######################################################################## -# Rules for compiling the source files -######################################################################## -.SUFFIXES: .c .f .cxx .f90 - -.c.o: - $(CC) $(CFLAGS) -c $< -.f.o: - $(FC) $(FFLAGS) -c $< -.cxx.o: - $(CXX) $(CXXFLAGS) -c $< - -######################################################################## -# List of all programs to be compiled -######################################################################## -ALLPROGS = ex1 ex2 ex3 ex4 ex5 ex6 ex7 ex8 ex9 ex11 ex12 ex13 ex14 ex15 ex16 - -BIGINTPROGS = ex5big ex15big -FORTRANPROGS = ex5f ex12f -MAXDIMPROGS = ex17 ex18 -COMPLEXPROGS = ex18comp - -all: $(ALLPROGS) - -default: all - -gpu: all - -bigint: $(BIGINTPROGS) - -fortran: $(FORTRANPROGS) - -maxdim: $(MAXDIMPROGS) - -complex: $(COMPLEXPROGS) - -######################################################################## -# Example 1 -######################################################################## -ex1: ex1.o - $(LINK_CC) -o $@ $^ $(LFLAGS) - -######################################################################## -# Example 2 -######################################################################## -ex2: ex2.o - $(LINK_CC) -o $@ $^ $(LFLAGS) - -######################################################################## -# Example 3 -######################################################################## -ex3: ex3.o - $(LINK_CC) -o $@ $^ $(LFLAGS) - -######################################################################## -# Example 4 -######################################################################## -ex4: ex4.o - $(LINK_CC) -o $@ $^ $(LFLAGS) - -######################################################################## -# Example 5 -######################################################################## -ex5: ex5.o - $(LINK_CC) -o $@ $^ $(LFLAGS) - -######################################################################## -# Example 5 with 64-bit integers -######################################################################## -ex5big: ex5big.o - $(LINK_CC) -o $@ $^ $(LFLAGS) - -######################################################################## -# Example 5 Fortran 77 -######################################################################## -ex5f: ex5f.o - $(F77) -o $@ $^ $(LFLAGS77) - -######################################################################## -# Example 6 -######################################################################## -ex6: ex6.o - $(LINK_CC) -o $@ $^ $(LFLAGS) - -######################################################################## -# Example 7 -######################################################################## -ex7: ex7.o - $(LINK_CC) -o $@ $^ $(LFLAGS) - -######################################################################## -# Example 8 -######################################################################## -ex8: ex8.o - $(LINK_CC) -o $@ $^ $(LFLAGS) - -######################################################################## -# Example 9 -######################################################################## -ex9: ex9.o - $(LINK_CC) -o $@ $^ $(LFLAGS) - -######################################################################## -# Example 10 -######################################################################## -ex10: ex10.o - $(LINK_CXX) -o $@ $^ $(LFLAGS) - -######################################################################## -# Example 11 -######################################################################## -ex11: ex11.o - $(LINK_CC) -o $@ $^ $(LFLAGS) - -######################################################################## -# Example 12 -######################################################################## -ex12: ex12.o - $(LINK_CC) -o $@ $^ $(LFLAGS) - -######################################################################## -# Example 12 Fortran 77 -######################################################################## -ex12f: ex12f.o - $(F77) -o $@ $^ $(LFLAGS77) - -######################################################################## -# Example 13 -######################################################################## -ex13: ex13.o - $(LINK_CC) -o $@ $^ $(LFLAGS) - -######################################################################## -# Example 14 -######################################################################## -ex14: ex14.o - $(LINK_CC) -o $@ $^ $(LFLAGS) - -######################################################################## -# Example 15 -######################################################################## -ex15: ex15.o - $(LINK_CC) -o $@ $^ $(LFLAGS) - -######################################################################## -# Example 15 with 64-bit integers -######################################################################## -ex15big: ex15big.o - $(LINK_CC) -o $@ $^ $(LFLAGS) - -######################################################################## -# Example 16 -######################################################################## -ex16: ex16.o - $(LINK_CC) -o $@ $^ $(LFLAGS) - -######################################################################## -# Example 17 -######################################################################## -ex17: ex17.o - $(LINK_CC) -o $@ $^ $(LFLAGS) - -######################################################################## -# Example 18 -######################################################################## -ex18: ex18.o - $(LINK_CC) -o $@ $^ $(LFLAGS) - -######################################################################## -# Example 18 (complex) -######################################################################## -ex18comp: ex18comp.o - $(LINK_CC) -o $@ $^ $(LFLAGS) - -######################################################################## -# Clean up -######################################################################## -clean: - rm -f $(ALLPROGS:=.o) - rm -f $(BIGINTPROGS:=.o) - rm -f $(FORTRANPROGS:=.o) - rm -f $(MAXDIMPROGS:=.o) - rm -f $(COMPLEXPROGS:=.o) - cd vis; make clean -distclean: clean - rm -f $(ALLPROGS) $(ALLPROGS:=*~) - rm -f $(BIGINTPROGS) $(BIGINTPROGS:=*~) - rm -f $(FORTRANLPROGS) $(FORTRANPROGS:=*~) - rm -f $(MAXDIMPROGS) $(MAXDIMPROGS:=*~) - rm -f $(COMPLEXPROGS) $(COMPLEXPROGS:=*~) - rm -fr README* diff --git a/external/hypre/src/examples/cudaf.f b/external/hypre/src/examples/cudaf.f new file mode 100644 index 00000000..09ce19f8 --- /dev/null +++ b/external/hypre/src/examples/cudaf.f @@ -0,0 +1,64 @@ +! Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +! HYPRE Project Developers. See the top-level COPYRIGHT file for details. +! +! SPDX-License-Identifier: (Apache-2.0 OR MIT) + +! This file contains the module defining Fortran interfaces for the CUDA Runtime API +! Copied and modified from: +! https://raw.githubusercontent.com/starkiller-astro/XNet/master/source/cudaf.f90 + + module cudaf + ! Interface to CUDA Runtime API + + use, intrinsic :: iso_c_binding, only: c_int + + implicit none + + integer(c_int), parameter :: cudaMemAttachGlobal = 1 + integer(c_int), parameter :: cudaMemAttachHost = 2 + integer(c_int), parameter :: cudaMemAttachSingle = 4 + + !include "cudaDeviceProp.fh" + + interface + + integer(c_int) function + 1 cudaMallocManaged(dPtr, size, flags) + 1 bind(c, name="cudaMallocManaged") + use, intrinsic :: iso_c_binding + type(c_ptr), intent(out) :: dPtr + integer(c_size_t), value :: size + integer(c_int), value :: flags + end function cudaMallocManaged + + integer(c_int) function + 1 cudaFree(dPtr) + 1 bind(c, name="cudaFree") + use, intrinsic :: iso_c_binding + type(c_ptr), value :: dPtr + end function cudaFree + + end interface + + contains + + ! wrapper functions + + integer function + 1 device_malloc_managed(nbytes, dPtr) result(stat) + use, intrinsic :: iso_c_binding, only: c_size_t, c_ptr + use, intrinsic :: iso_fortran_env, only: int64 + integer(int64), intent(in) :: nbytes + type(c_ptr), intent(inout) :: dPtr + stat = cudaMallocManaged(dPtr, int(nbytes,c_size_t), + 1 cudaMemAttachGlobal) + end function device_malloc_managed + ! + integer function + 1 device_free(dPtr) result(stat) + use, intrinsic :: iso_c_binding, only: c_ptr + type(c_ptr), intent(inout) :: dPtr + stat = cudaFree(dPtr) + end function device_free + + end module cudaf diff --git a/external/hypre/src/examples/docs/build_doc.sh b/external/hypre/src/examples/docs/build_doc.sh old mode 100644 new mode 100755 index 43f8ed79..39ec2ce4 --- a/external/hypre/src/examples/docs/build_doc.sh +++ b/external/hypre/src/examples/docs/build_doc.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash examplesdir="$1" currentdir=`pwd` diff --git a/external/hypre/src/examples/docs/code2html.perl b/external/hypre/src/examples/docs/code2html.perl old mode 100644 new mode 100755 diff --git a/external/hypre/src/examples/docs/replace-ssi.perl b/external/hypre/src/examples/docs/replace-ssi.perl old mode 100644 new mode 100755 diff --git a/external/hypre/src/examples/ex.h b/external/hypre/src/examples/ex.h index ff49f9ec..8b2324c1 100644 --- a/external/hypre/src/examples/ex.h +++ b/external/hypre/src/examples/ex.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -14,7 +14,7 @@ #include -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_DEVICE_OPENMP) +#if defined(HYPRE_EXAMPLE_USING_CUDA) #include @@ -34,15 +34,14 @@ static inline void* gpu_calloc(size_t num, size_t size) { void *ptr = NULL; - cudaMallocManaged(&ptr, num*size, cudaMemAttachGlobal); - cudaMemset(ptr, 0, num*size); + cudaMallocManaged(&ptr, num * size, cudaMemAttachGlobal); + cudaMemset(ptr, 0, num * size); return ptr; } #define malloc(size) gpu_malloc(size) #define calloc(num, size) gpu_calloc(num, size) #define free(ptr) ( cudaFree(ptr), ptr = NULL ) -#endif - -#endif +#endif /* #if defined(HYPRE_EXAMPLE_USING_CUDA) */ +#endif /* #ifndef HYPRE_EXAMPLES_INCLUDES */ diff --git a/external/hypre/src/examples/ex1.c b/external/hypre/src/examples/ex1.c index bc3f7c18..4014768d 100644 --- a/external/hypre/src/examples/ex1.c +++ b/external/hypre/src/examples/ex1.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -58,14 +58,14 @@ int main (int argc, char *argv[]) if (num_procs != 2) { - if (myid == 0) printf("Must run with 2 processors!\n"); + if (myid == 0) { printf("Must run with 2 processors!\n"); } MPI_Finalize(); - return(0); + return (0); } /* Initialize HYPRE */ - HYPRE_Init(); + HYPRE_Initialize(); /* Print GPU info */ /* HYPRE_PrintDeviceInfo(); */ @@ -118,12 +118,12 @@ int main (int argc, char *argv[]) /* Add boxes to the grid */ if (myid == 0) { - int ilower[2]={-3,1}, iupper[2]={-1,2}; + int ilower[2] = {-3, 1}, iupper[2] = {-1, 2}; HYPRE_StructGridSetExtents(grid, ilower, iupper); } else if (myid == 1) { - int ilower[2]={0,1}, iupper[2]={2,4}; + int ilower[2] = {0, 1}, iupper[2] = {2, 4}; HYPRE_StructGridSetExtents(grid, ilower, iupper); } @@ -141,11 +141,13 @@ int main (int argc, char *argv[]) relative offset (in the index space). */ { int entry; - int offsets[5][2] = {{0,0}, {-1,0}, {1,0}, {0,-1}, {0,1}}; + int offsets[5][2] = {{0, 0}, {-1, 0}, {1, 0}, {0, -1}, {0, 1}}; /* Assign each of the 5 stencil entries */ for (entry = 0; entry < 5; entry++) + { HYPRE_StructStencilSetElement(stencil, entry, offsets[entry]); + } } } @@ -165,21 +167,23 @@ int main (int argc, char *argv[]) the boundary. */ if (myid == 0) { - int ilower[2]={-3,1}, iupper[2]={-1,2}; - int stencil_indices[5] = {0,1,2,3,4}; /* labels for the stencil entries - + int ilower[2] = {-3, 1}, iupper[2] = {-1, 2}; + int stencil_indices[5] = {0, 1, 2, 3, 4}; /* labels for the stencil entries - these correspond to the offsets defined above */ int nentries = 5; int nvalues = 30; /* 6 grid points, each with 5 stencil entries */ /* double values[30]; OK to use constant-length arrays for CPUs */ - double *values = (double *) malloc(30*sizeof(double)); + double *values = (double *) malloc(30 * sizeof(double)); /* We have 6 grid points, each with 5 stencil entries */ for (i = 0; i < nvalues; i += nentries) { values[i] = 4.0; for (j = 1; j < nentries; j++) - values[i+j] = -1.0; + { + values[i + j] = -1.0; + } } HYPRE_StructMatrixSetBoxValues(A, ilower, iupper, nentries, @@ -189,18 +193,20 @@ int main (int argc, char *argv[]) } else if (myid == 1) { - int ilower[2]={0,1}, iupper[2]={2,4}; - int stencil_indices[5] = {0,1,2,3,4}; + int ilower[2] = {0, 1}, iupper[2] = {2, 4}; + int stencil_indices[5] = {0, 1, 2, 3, 4}; int nentries = 5; int nvalues = 60; /* 12 grid points, each with 5 stencil entries */ /* double values[60]; OK to use constant-length arrays for CPUs */ - double *values = (double *) malloc(60*sizeof(double)); + double *values = (double *) malloc(60 * sizeof(double)); for (i = 0; i < nvalues; i += nentries) { values[i] = 4.0; for (j = 1; j < nentries; j++) - values[i+j] = -1.0; + { + values[i + j] = -1.0; + } } HYPRE_StructMatrixSetBoxValues(A, ilower, iupper, nentries, @@ -213,26 +219,28 @@ int main (int argc, char *argv[]) if (myid == 0) { /* double values[3]; OK to use constant-length arrays for CPUs */ - double *values = (double *) malloc(3*sizeof(double)); + double *values = (double *) malloc(3 * sizeof(double)); for (i = 0; i < 3; i++) + { values[i] = 0.0; + } { /* values below our box */ - int ilower[2]={-3,1}, iupper[2]={-1,1}; + int ilower[2] = {-3, 1}, iupper[2] = {-1, 1}; int stencil_indices[1] = {3}; HYPRE_StructMatrixSetBoxValues(A, ilower, iupper, 1, stencil_indices, values); } { /* values to the left of our box */ - int ilower[2]={-3,1}, iupper[2]={-3,2}; + int ilower[2] = {-3, 1}, iupper[2] = {-3, 2}; int stencil_indices[1] = {1}; HYPRE_StructMatrixSetBoxValues(A, ilower, iupper, 1, stencil_indices, values); } { /* values above our box */ - int ilower[2]={-3,2}, iupper[2]={-1,2}; + int ilower[2] = {-3, 2}, iupper[2] = {-1, 2}; int stencil_indices[1] = {4}; HYPRE_StructMatrixSetBoxValues(A, ilower, iupper, 1, stencil_indices, values); @@ -242,26 +250,28 @@ int main (int argc, char *argv[]) else if (myid == 1) { /* double values[4]; OK to use constant-length arrays for CPUs */ - double *values = (double *) malloc(4*sizeof(double)); + double *values = (double *) malloc(4 * sizeof(double)); for (i = 0; i < 4; i++) + { values[i] = 0.0; + } { /* values below our box */ - int ilower[2]={0,1}, iupper[2]={2,1}; + int ilower[2] = {0, 1}, iupper[2] = {2, 1}; int stencil_indices[1] = {3}; HYPRE_StructMatrixSetBoxValues(A, ilower, iupper, 1, stencil_indices, values); } { /* values to the right of our box */ - int ilower[2]={2,1}, iupper[2]={2,4}; + int ilower[2] = {2, 1}, iupper[2] = {2, 4}; int stencil_indices[1] = {2}; HYPRE_StructMatrixSetBoxValues(A, ilower, iupper, 1, stencil_indices, values); } { /* values above our box */ - int ilower[2]={0,4}, iupper[2]={2,4}; + int ilower[2] = {0, 4}, iupper[2] = {2, 4}; int stencil_indices[1] = {4}; HYPRE_StructMatrixSetBoxValues(A, ilower, iupper, 1, stencil_indices, values); @@ -269,7 +279,7 @@ int main (int argc, char *argv[]) { /* values to the left of our box (that do not border the other box on proc. 0) */ - int ilower[2]={0,3}, iupper[2]={0,4}; + int ilower[2] = {0, 3}, iupper[2] = {0, 4}; int stencil_indices[1] = {1}; HYPRE_StructMatrixSetBoxValues(A, ilower, iupper, 1, stencil_indices, values); @@ -296,31 +306,39 @@ int main (int argc, char *argv[]) /* Set the vector coefficients */ if (myid == 0) { - int ilower[2]={-3,1}, iupper[2]={-1,2}; + int ilower[2] = {-3, 1}, iupper[2] = {-1, 2}; /* double values[6]; OK to use constant-length arrays for CPUs */ - double *values = (double *) malloc(6*sizeof(double)); /* 6 grid points */ + double *values = (double *) malloc(6 * sizeof(double)); /* 6 grid points */ for (i = 0; i < 6; i ++) + { values[i] = 1.0; + } HYPRE_StructVectorSetBoxValues(b, ilower, iupper, values); for (i = 0; i < 6; i ++) + { values[i] = 0.0; + } HYPRE_StructVectorSetBoxValues(x, ilower, iupper, values); free(values); } else if (myid == 1) { - int ilower[2]={0,1}, iupper[2]={2,4}; + int ilower[2] = {0, 1}, iupper[2] = {2, 4}; /* double values[12]; OK to use constant-length arrays for CPUs */ - double *values = (double *) malloc(12*sizeof(double)); /* 12 grid points */ + double *values = (double *) malloc(12 * sizeof(double)); /* 12 grid points */ for (i = 0; i < 12; i ++) + { values[i] = 1.0; + } HYPRE_StructVectorSetBoxValues(b, ilower, iupper, values); for (i = 0; i < 12; i ++) + { values[i] = 0.0; + } HYPRE_StructVectorSetBoxValues(x, ilower, iupper, values); free(values); } diff --git a/external/hypre/src/examples/ex10.cxx b/external/hypre/src/examples/ex10.cxx index 85a09b19..35ebff83 100644 --- a/external/hypre/src/examples/ex10.cxx +++ b/external/hypre/src/examples/ex10.cxx @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -57,13 +57,13 @@ int main(int argc, char *argv[]) MPI_Comm_rank(MPI_COMM_WORLD, &mypid); /* Initialize HYPRE */ - HYPRE_Init(); + HYPRE_Initialize(); /* Print GPU info */ /* HYPRE_PrintDeviceInfo(); */ // Set default parameters - n = 4*nprocs; + n = 4 * nprocs; solverID = 2; vis = 0; @@ -105,7 +105,7 @@ int main(int argc, char *argv[]) printf("\n"); printf("Usage: %s []\n", argv[0]); printf("\n"); - printf(" -n : problem size per processor (default: %d)\n", 4*nprocs); + printf(" -n : problem size per processor (default: %d)\n", 4 * nprocs); printf(" -solver : solver ID\n"); printf(" 0 - DS-PCG\n"); printf(" 1 - ParaSails-PCG\n"); @@ -132,7 +132,7 @@ int main(int argc, char *argv[]) // are numbered globally starting from the lower left corner and moving // row-wise to the upper right corner. m = n / nprocs; - offset = mypid*(m*(n+1)); + offset = mypid * (m * (n + 1)); h = 1.0 / n; // mesh size @@ -164,7 +164,7 @@ int main(int argc, char *argv[]) // have to describe the number of elements in the block (nElems) as // well as the fields (unknowns) per element. int elemBlkID = 0; - int nElems = m*n; + int nElems = m * n; int elemNNodes = 4; // number of (shared) nodes per element int *nodeNFields = new int[elemNNodes]; // fields per node int **nodeFieldIDs = new int*[elemNNodes]; // node-fields IDs @@ -188,84 +188,98 @@ int main(int argc, char *argv[]) for (i = 0; i < m; i++) for (j = 0; j < n; j++) { - elemConn[i*n+j] = new int[elemNNodes]; // element with coordinates (i,j) - elemConn[i*n+j][0] = offset + i*(n+1)+j; // node in the lower left - elemConn[i*n+j][1] = elemConn[i*n+j][0]+1; // node in the lower right - elemConn[i*n+j][2] = elemConn[i*n+j][1]+n+1; // node in the upper right - elemConn[i*n+j][3] = elemConn[i*n+j][2]-1; // node in the upper left + elemConn[i * n + j] = new int[elemNNodes]; // element with coordinates (i,j) + elemConn[i * n + j][0] = offset + i * (n + 1) + j; // node in the lower left + elemConn[i * n + j][1] = elemConn[i * n + j][0] + 1; // node in the lower right + elemConn[i * n + j][2] = elemConn[i * n + j][1] + n + 1; // node in the upper right + elemConn[i * n + j][3] = elemConn[i * n + j][2] - 1; // node in the upper left } // Pass the element topology information to the FEI for (i = 0; i < nElems; i++) + { feiPtr->initElem(elemBlkID, i, elemConn[i]); + } // List the global indexes of nodes that are shared between processors int nShared, *SharedIDs, *SharedLengs, **SharedProcs; if (mypid == 0) { // Nodes in the top row are shared - nShared = n+1; + nShared = n + 1; SharedIDs = new int[nShared]; for (i = 0; i < nShared; i++) - SharedIDs[i] = offset + m*(n+1) + i; + { + SharedIDs[i] = offset + m * (n + 1) + i; + } SharedLengs = new int[nShared]; for (i = 0; i < nShared; i++) + { SharedLengs[i] = 2; + } SharedProcs = new int*[nShared]; for (i = 0; i < nShared; i++) { SharedProcs[i] = new int[SharedLengs[i]]; SharedProcs[i][0] = mypid; - SharedProcs[i][1] = mypid+1; + SharedProcs[i][1] = mypid + 1; } } - else if (mypid == nprocs-1) + else if (mypid == nprocs - 1) { // Nodes in the bottom row are shared - nShared = n+1; + nShared = n + 1; SharedIDs = new int[nShared]; for (i = 0; i < nShared; i++) + { SharedIDs[i] = offset + i; + } SharedLengs = new int[nShared]; for (i = 0; i < nShared; i++) + { SharedLengs[i] = 2; + } SharedProcs = new int*[nShared]; for (i = 0; i < nShared; i++) { SharedProcs[i] = new int[SharedLengs[i]]; - SharedProcs[i][0] = mypid-1; + SharedProcs[i][0] = mypid - 1; SharedProcs[i][1] = mypid; } } else { // Nodes in the top and bottom rows are shared - nShared = 2*(n+1); + nShared = 2 * (n + 1); SharedIDs = new int[nShared]; - for (i = 0; i < n+1; i++) + for (i = 0; i < n + 1; i++) { SharedIDs[i] = offset + i; - SharedIDs[n+1+i] = offset + m*(n+1) + i; + SharedIDs[n + 1 + i] = offset + m * (n + 1) + i; } SharedLengs = new int[nShared]; for (i = 0; i < nShared; i++) + { SharedLengs[i] = 2; + } SharedProcs = new int*[nShared]; - for (i = 0; i < n+1; i++) + for (i = 0; i < n + 1; i++) { SharedProcs[i] = new int[SharedLengs[i]]; - SharedProcs[i][0] = mypid-1; + SharedProcs[i][0] = mypid - 1; SharedProcs[i][1] = mypid; - SharedProcs[n+1+i] = new int[SharedLengs[n+1+i]]; - SharedProcs[n+1+i][0] = mypid; - SharedProcs[n+1+i][1] = mypid+1; + SharedProcs[n + 1 + i] = new int[SharedLengs[n + 1 + i]]; + SharedProcs[n + 1 + i][0] = mypid; + SharedProcs[n + 1 + i][1] = mypid + 1; } } // Pass the shared nodes information to the FEI if (nprocs != 1 && nShared > 0) + { feiPtr->initSharedNodes(nShared, SharedIDs, SharedLengs, SharedProcs); + } // Finish the FEI initialization phase feiPtr->initComplete(); @@ -278,38 +292,42 @@ int main(int argc, char *argv[]) if (mypid == 0) { // Nodes in the bottom row and left and right columns - nBCs = n+1 + 2*m; + nBCs = n + 1 + 2 * m; BCEqn = new int[nBCs]; - for (i = 0; i < n+1; i++) + for (i = 0; i < n + 1; i++) + { BCEqn[i] = offset + i; + } for (i = 0; i < m; i++) { - BCEqn[n+1+2*i] = offset + (i+1)*(n+1); - BCEqn[n+2+2*i] = offset + (i+1)*(n+1)+n; + BCEqn[n + 1 + 2 * i] = offset + (i + 1) * (n + 1); + BCEqn[n + 2 + 2 * i] = offset + (i + 1) * (n + 1) + n; } } - else if (mypid == nprocs-1) + else if (mypid == nprocs - 1) { // Nodes in the top row and left and right columns - nBCs = n+1 + 2*m; + nBCs = n + 1 + 2 * m; BCEqn = new int[nBCs]; - for (i = 0; i < n+1; i++) - BCEqn[i] = offset + m*(n+1) + i; + for (i = 0; i < n + 1; i++) + { + BCEqn[i] = offset + m * (n + 1) + i; + } for (i = 0; i < m; i++) { - BCEqn[n+1+2*i] = offset + i*(n+1); - BCEqn[n+2+2*i] = offset + i*(n+1)+n; + BCEqn[n + 1 + 2 * i] = offset + i * (n + 1); + BCEqn[n + 2 + 2 * i] = offset + i * (n + 1) + n; } } else { // Nodes in the left and right columns - nBCs = 2*(m+1); + nBCs = 2 * (m + 1); BCEqn = new int[nBCs]; - for (i = 0; i < m+1; i++) + for (i = 0; i < m + 1; i++) { - BCEqn[2*i] = offset + i*(n+1); - BCEqn[2*i+1] = offset + i*(n+1)+n; + BCEqn[2 * i] = offset + i * (n + 1); + BCEqn[2 * i + 1] = offset + i * (n + 1) + n; } } @@ -336,32 +354,38 @@ int main(int argc, char *argv[]) for (j = 0; j < n; j++) { // Element with coordinates (i,j) - elemStiff[i*n+j] = new double*[elemNNodes]; + elemStiff[i * n + j] = new double*[elemNNodes]; for (k = 0; k < elemNNodes; k++) - elemStiff[i*n+j][k] = new double[elemNNodes]; + { + elemStiff[i * n + j][k] = new double[elemNNodes]; + } // Stiffness matrix for the reference square // 3 +---+ 2 // | | // 0 +---+ 1 - double **A = elemStiff[i*n+j]; + double **A = elemStiff[i * n + j]; for (k = 0; k < 4; k++) - A[k][k] = 2/3.; - - A[0][1] = A[1][0] = -1/6.; - A[0][2] = A[2][0] = -1/3.; - A[0][3] = A[3][0] = -1/6.; - A[1][2] = A[2][1] = -1/6.; - A[1][3] = A[3][1] = -1/3.; - A[2][3] = A[3][2] = -1/6.; + { + A[k][k] = 2 / 3.; + } + + A[0][1] = A[1][0] = -1 / 6.; + A[0][2] = A[2][0] = -1 / 3.; + A[0][3] = A[3][0] = -1 / 6.; + A[1][2] = A[2][1] = -1 / 6.; + A[1][3] = A[3][1] = -1 / 3.; + A[2][3] = A[3][2] = -1 / 6.; } // Specify element load vectors - double *elemLoad = new double[nElems*elemNNodes]; - for (i = 0; i < nElems*elemNNodes; i++) - elemLoad[i] = h*h/4; + double *elemLoad = new double[nElems * elemNNodes]; + for (i = 0; i < nElems * elemNNodes; i++) + { + elemLoad[i] = h * h / 4; + } // Assemble the matrix. The elemFormat parameter describes // the storage (symmetric/non-symmetric, row/column-wise) @@ -369,17 +393,17 @@ int main(int argc, char *argv[]) int elemFormat = 0; for (i = 0; i < nElems; i++) feiPtr->sumInElem(elemBlkID, i, elemConn[i], elemStiff[i], - &(elemLoad[i*elemNNodes]), elemFormat); + &(elemLoad[i * elemNNodes]), elemFormat); // Finish the FEI load phase feiPtr->loadComplete(); // Clean up - for (i = 0; i < nElems; i++) delete [] elemConn[i]; + for (i = 0; i < nElems; i++) { delete [] elemConn[i]; } delete [] elemConn; for (i = 0; i < nElems; i++) { - for (j = 0; j < elemNNodes; j++) delete [] elemStiff[i][j]; + for (j = 0; j < elemNNodes; j++) { delete [] elemStiff[i][j]; } delete [] elemStiff[i]; } delete [] elemStiff; @@ -400,12 +424,12 @@ int main(int argc, char *argv[]) { delete [] SharedIDs; delete [] SharedLengs; - for (i = 0; i < nShared; i++) delete [] SharedProcs[i]; + for (i = 0; i < nShared; i++) { delete [] SharedProcs[i]; } delete [] SharedProcs; } delete [] nodeNFields; - for (i = 0; i < elemNNodes; i++) delete [] nodeFieldIDs[i]; + for (i = 0; i < elemNNodes; i++) { delete [] nodeFieldIDs[i]; } delete [] nodeFieldIDs; delete [] fieldSizes; @@ -416,10 +440,12 @@ int main(int argc, char *argv[]) int nParams = 19; char **paramStrings = new char*[nParams]; for (i = 0; i < nParams; i++) + { paramStrings[i] = new char[100]; + } strcpy(paramStrings[0], "outputLevel 2"); - switch(solverID) + switch (solverID) { case 0: strcpy(paramStrings[1], "solver cg"); @@ -479,7 +505,9 @@ int main(int argc, char *argv[]) feiPtr->parameters(nParams, paramStrings); for (i = 0; i < nParams; i++) + { delete [] paramStrings[i]; + } delete [] paramStrings; } @@ -508,7 +536,9 @@ int main(int argc, char *argv[]) // Find the location of the ith local node for (i = 0; i < numNodes; i++) - solnOffsets[nodeIDList[i]-offset] = i; + { + solnOffsets[nodeIDList[i] - offset] = i; + } // Save the ordered nodal values to a file char sol_out[20]; @@ -519,10 +549,12 @@ int main(int argc, char *argv[]) << "VDim: 1\n" << "Ordering: 0\n\n"; for (i = 0; i < numNodes; i++) + { sol << solnValues[solnOffsets[i]] << endl; + } // Save local finite element mesh - GLVis_PrintLocalSquareMesh("vis/ex10.mesh", n, m, h, 0, mypid*h*m, mypid); + GLVis_PrintLocalSquareMesh("vis/ex10.mesh", n, m, h, 0, mypid * h * m, mypid); // additional visualization data if (mypid == 0) diff --git a/external/hypre/src/examples/ex11.c b/external/hypre/src/examples/ex11.c index b848f266..dc432a5c 100644 --- a/external/hypre/src/examples/ex11.c +++ b/external/hypre/src/examples/ex11.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -74,7 +74,7 @@ int main (int argc, char *argv[]) MPI_Comm_size(MPI_COMM_WORLD, &num_procs); /* Initialize HYPRE */ - HYPRE_Init(); + HYPRE_Initialize(); /* Print GPU info */ /* HYPRE_PrintDeviceInfo(); */ @@ -136,20 +136,20 @@ int main (int argc, char *argv[]) } /* Preliminaries: want at least one processor per row */ - if (n*n < num_procs) n = sqrt(num_procs) + 1; - N = n*n; /* global number of rows */ + if (n * n < num_procs) { n = sqrt(num_procs) + 1; } + N = n * n; /* global number of rows */ /* Each processor knows only of its own rows - the range is denoted by ilower and iupper. Here we partition the rows. We account for the fact that N may not divide evenly by the number of processors. */ - local_size = N/num_procs; - extra = N - local_size*num_procs; + local_size = N / num_procs; + extra = N - local_size * num_procs; - ilower = local_size*myid; + ilower = local_size * myid; ilower += my_min(myid, extra); - iupper = local_size*(myid+1); - iupper += my_min(myid+1, extra); + iupper = local_size * (myid + 1); + iupper += my_min(myid + 1, extra); iupper = iupper - 1; /* How many rows do I have? */ @@ -179,25 +179,25 @@ int main (int argc, char *argv[]) int nnz; /* double values[5]; * int cols[5]; OK to use constant-length arrays for CPUs */ - double *values = (double *) malloc(5*sizeof(double)); - int *cols = (int *) malloc(5*sizeof(int)); + double *values = (double *) malloc(5 * sizeof(double)); + int *cols = (int *) malloc(5 * sizeof(int)); for (i = ilower; i <= iupper; i++) { nnz = 0; /* The left identity block:position i-n */ - if ((i-n)>=0) + if ((i - n) >= 0) { - cols[nnz] = i-n; + cols[nnz] = i - n; values[nnz] = -1.0; nnz++; } /* The left -1: position i-1 */ - if (i%n) + if (i % n) { - cols[nnz] = i-1; + cols[nnz] = i - 1; values[nnz] = -1.0; nnz++; } @@ -208,17 +208,17 @@ int main (int argc, char *argv[]) nnz++; /* The right -1: position i+1 */ - if ((i+1)%n) + if ((i + 1) % n) { - cols[nnz] = i+1; + cols[nnz] = i + 1; values[nnz] = -1.0; nnz++; } /* The right identity block:position i+n */ - if ((i+n)< N) + if ((i + n) < N) { - cols[nnz] = i+n; + cols[nnz] = i + n; values[nnz] = -1.0; nnz++; } @@ -237,13 +237,13 @@ int main (int argc, char *argv[]) HYPRE_IJMatrixGetObject(A, (void**) &parcsr_A); /* Create sample rhs and solution vectors */ - HYPRE_IJVectorCreate(MPI_COMM_WORLD, ilower, iupper,&b); + HYPRE_IJVectorCreate(MPI_COMM_WORLD, ilower, iupper, &b); HYPRE_IJVectorSetObjectType(b, HYPRE_PARCSR); HYPRE_IJVectorInitialize(b); HYPRE_IJVectorAssemble(b); HYPRE_IJVectorGetObject(b, (void **) &par_b); - HYPRE_IJVectorCreate(MPI_COMM_WORLD, ilower, iupper,&x); + HYPRE_IJVectorCreate(MPI_COMM_WORLD, ilower, iupper, &x); HYPRE_IJVectorSetObjectType(x, HYPRE_PARCSR); HYPRE_IJVectorInitialize(x); HYPRE_IJVectorAssemble(x); @@ -274,7 +274,9 @@ int main (int argc, char *argv[]) double *eigenvalues = NULL; if (myid != 0) + { verbosity = 0; + } /* define an interpreter for the ParCSR interface */ interpreter = (mv_InterfaceInterpreter *) calloc(1, sizeof(mv_InterfaceInterpreter)); @@ -338,7 +340,7 @@ int main (int argc, char *argv[]) /* get the local solution */ values = hypre_VectorData(hypre_ParVectorLocalVector( - (hypre_ParVector*)pvx[blockSize-1])); + (hypre_ParVector*)pvx[blockSize - 1])); sprintf(filename, "%s.%06d", "vis/ex11.sol", myid); if ((file = fopen(filename, "w")) == NULL) @@ -350,14 +352,18 @@ int main (int argc, char *argv[]) /* save solution */ for (i = 0; i < nvalues; i++) + { fprintf(file, "%.14e\n", values[i]); + } fflush(file); fclose(file); /* save global finite element mesh */ if (myid == 0) - GLVis_PrintGlobalSquareMesh("vis/ex11.mesh", n-1); + { + GLVis_PrintGlobalSquareMesh("vis/ex11.mesh", n - 1); + } #endif } @@ -372,5 +378,5 @@ int main (int argc, char *argv[]) /* Finalize MPI*/ MPI_Finalize(); - return(0); + return (0); } diff --git a/external/hypre/src/examples/ex12.c b/external/hypre/src/examples/ex12.c index 87fae442..b1d08940 100644 --- a/external/hypre/src/examples/ex12.c +++ b/external/hypre/src/examples/ex12.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -68,14 +68,14 @@ int main (int argc, char *argv[]) MPI_Comm_size(MPI_COMM_WORLD, &num_procs); /* Initialize HYPRE */ - HYPRE_Init(); + HYPRE_Initialize(); /* Print GPU info */ /* HYPRE_PrintDeviceInfo(); */ if (num_procs != 2) { - if (myid == 0) printf("Must run with 2 processors!\n"); + if (myid == 0) { printf("Must run with 2 processors!\n"); } exit(1); } @@ -141,12 +141,12 @@ int main (int argc, char *argv[]) /* Add boxes to the grid */ if (myid == 0) { - int ilower[2]={-3,1}, iupper[2]={-1,2}; + int ilower[2] = {-3, 1}, iupper[2] = {-1, 2}; HYPRE_SStructGridSetExtents(grid, part, ilower, iupper); } else if (myid == 1) { - int ilower[2]={0,1}, iupper[2]={2,4}; + int ilower[2] = {0, 1}, iupper[2] = {2, 4}; HYPRE_SStructGridSetExtents(grid, part, ilower, iupper); } @@ -171,13 +171,15 @@ int main (int argc, char *argv[]) (in the index space). */ { int entry; - int offsets[5][2] = {{0,0}, {-1,0}, {1,0}, {0,-1}, {0,1}}; + int offsets[5][2] = {{0, 0}, {-1, 0}, {1, 0}, {0, -1}, {0, 1}}; /* Assign numerical values to the offsets so that we can easily refer to them - the last argument indicates the variable for which we are assigning this stencil */ for (entry = 0; entry < 5; entry++) + { HYPRE_SStructStencilSetEntry(stencil, entry, offsets[entry], var); + } } } @@ -226,20 +228,22 @@ int main (int argc, char *argv[]) See the User and Reference manuals for more details. */ if (myid == 0) { - int ilower[2]={-4,0}, iupper[2]={-1,2}; - int stencil_indices[5] = {0,1,2,3,4}; /* labels for the stencil entries - + int ilower[2] = {-4, 0}, iupper[2] = {-1, 2}; + int stencil_indices[5] = {0, 1, 2, 3, 4}; /* labels for the stencil entries - these correspond to the offsets defined above */ int nentries = 5; int nvalues = 60; /* 12 grid points, each with 5 stencil entries */ /* double values[60]; OK to use constant-length arrays for CPUs */ - double *values = (double *) malloc(60*sizeof(double)); + double *values = (double *) malloc(60 * sizeof(double)); for (i = 0; i < nvalues; i += nentries) { values[i] = 4.0; for (j = 1; j < nentries; j++) - values[i+j] = -1.0; + { + values[i + j] = -1.0; + } } HYPRE_SStructMatrixSetBoxValues(A, part, ilower, iupper, var, nentries, @@ -249,18 +253,20 @@ int main (int argc, char *argv[]) } else if (myid == 1) { - int ilower[2]={-1,0}, iupper[2]={2,4}; - int stencil_indices[5] = {0,1,2,3,4}; + int ilower[2] = {-1, 0}, iupper[2] = {2, 4}; + int stencil_indices[5] = {0, 1, 2, 3, 4}; int nentries = 5; int nvalues = 100; /* 20 grid points, each with 5 stencil entries */ /* double values[100]; OK to use constant-length array for CPUs */ - double *values = (double *) malloc(100*sizeof(double)); + double *values = (double *) malloc(100 * sizeof(double)); for (i = 0; i < nvalues; i += nentries) { values[i] = 4.0; for (j = 1; j < nentries; j++) - values[i+j] = -1.0; + { + values[i + j] = -1.0; + } } HYPRE_SStructMatrixSetBoxValues(A, part, ilower, iupper, var, nentries, @@ -274,26 +280,28 @@ int main (int argc, char *argv[]) if (myid == 0) { /* double values[4]; OK to use constant-length array for CPUs */ - double *values = (double *) malloc(4*sizeof(double)); + double *values = (double *) malloc(4 * sizeof(double)); for (i = 0; i < 4; i++) + { values[i] = 0.0; + } { /* values below our box */ - int ilower[2]={-4,0}, iupper[2]={-1,0}; + int ilower[2] = {-4, 0}, iupper[2] = {-1, 0}; int stencil_indices[1] = {3}; HYPRE_SStructMatrixSetBoxValues(A, part, ilower, iupper, var, 1, stencil_indices, values); } { /* values to the left of our box */ - int ilower[2]={-4,0}, iupper[2]={-4,2}; + int ilower[2] = {-4, 0}, iupper[2] = {-4, 2}; int stencil_indices[1] = {1}; HYPRE_SStructMatrixSetBoxValues(A, part, ilower, iupper, var, 1, stencil_indices, values); } { /* values above our box */ - int ilower[2]={-4,2}, iupper[2]={-2,2}; + int ilower[2] = {-4, 2}, iupper[2] = {-2, 2}; int stencil_indices[1] = {4}; HYPRE_SStructMatrixSetBoxValues(A, part, ilower, iupper, var, 1, stencil_indices, values); @@ -304,26 +312,28 @@ int main (int argc, char *argv[]) else if (myid == 1) { /* double values[5]; OK to use constant-length array for CPUs */ - double *values = (double *) malloc(5*sizeof(double)); + double *values = (double *) malloc(5 * sizeof(double)); for (i = 0; i < 5; i++) + { values[i] = 0.0; + } { /* values below our box */ - int ilower[2]={-1,0}, iupper[2]={2,0}; + int ilower[2] = {-1, 0}, iupper[2] = {2, 0}; int stencil_indices[1] = {3}; HYPRE_SStructMatrixSetBoxValues(A, part, ilower, iupper, var, 1, stencil_indices, values); } { /* values to the right of our box */ - int ilower[2]={2,0}, iupper[2]={2,4}; + int ilower[2] = {2, 0}, iupper[2] = {2, 4}; int stencil_indices[1] = {2}; HYPRE_SStructMatrixSetBoxValues(A, part, ilower, iupper, var, 1, stencil_indices, values); } { /* values above our box */ - int ilower[2]={-1,4}, iupper[2]={2,4}; + int ilower[2] = {-1, 4}, iupper[2] = {2, 4}; int stencil_indices[1] = {4}; HYPRE_SStructMatrixSetBoxValues(A, part, ilower, iupper, var, 1, stencil_indices, values); @@ -331,7 +341,7 @@ int main (int argc, char *argv[]) { /* values to the left of our box (that do not border the other box on proc. 0) */ - int ilower[2]={-1,3}, iupper[2]={-1,4}; + int ilower[2] = {-1, 3}, iupper[2] = {-1, 4}; int stencil_indices[1] = {1}; HYPRE_SStructMatrixSetBoxValues(A, part, ilower, iupper, var, 1, stencil_indices, values); @@ -364,32 +374,40 @@ int main (int argc, char *argv[]) both processors. */ if (myid == 0) { - int ilower[2]={-4,0}, iupper[2]={-1,2}; + int ilower[2] = {-4, 0}, iupper[2] = {-1, 2}; /* double values[12]; OK to use constant-length array for CPUs */ - double *values = (double *) malloc(12*sizeof(double)); /* 12 grid points */ + double *values = (double *) malloc(12 * sizeof(double)); /* 12 grid points */ for (i = 0; i < 12; i ++) + { values[i] = 1.0; + } HYPRE_SStructVectorSetBoxValues(b, part, ilower, iupper, var, values); for (i = 0; i < 12; i ++) + { values[i] = 0.0; + } HYPRE_SStructVectorSetBoxValues(x, part, ilower, iupper, var, values); free(values); } else if (myid == 1) { - int ilower[2]={0,1}, iupper[2]={2,4}; + int ilower[2] = {0, 1}, iupper[2] = {2, 4}; /* double values[20]; OK to use constant-length array for CPUs */ - double *values = (double *) malloc(20*sizeof(double)); /* 20 grid points */ + double *values = (double *) malloc(20 * sizeof(double)); /* 20 grid points */ for (i = 0; i < 20; i ++) + { values[i] = 1.0; + } HYPRE_SStructVectorSetBoxValues(b, part, ilower, iupper, var, values); for (i = 0; i < 20; i ++) + { values[i] = 0.0; + } HYPRE_SStructVectorSetBoxValues(x, part, ilower, iupper, var, values); free(values); @@ -445,7 +463,7 @@ int main (int argc, char *argv[]) /* Set preconditioner and solve */ HYPRE_StructPCGSetPrecond(solver, HYPRE_StructPFMGSolve, - HYPRE_StructPFMGSetup, precond); + HYPRE_StructPFMGSetup, precond); HYPRE_StructPCGSetup(solver, sA, sb, sx); HYPRE_StructPCGSolve(solver, sA, sb, sx); diff --git a/external/hypre/src/examples/ex12cuf.cuf b/external/hypre/src/examples/ex12cuf.cuf new file mode 100644 index 00000000..95bf616a --- /dev/null +++ b/external/hypre/src/examples/ex12cuf.cuf @@ -0,0 +1,492 @@ +! Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +! HYPRE Project Developers. See the top-level COPYRIGHT file for details. +! +! SPDX-License-Identifier: (Apache-2.0 OR MIT) + +! +! Example 12 +! +! Interface: Semi-Structured interface (SStruct) +! +! Compile with: make ex12f (may need to edit HYPRE_DIR in Makefile) +! +! Sample runs: mpirun -np 2 ex12f +! +! Description: The grid layout is the same as ex1, but with nodal +! unknowns. The solver is PCG preconditioned with either PFMG or +! BoomerAMG, set with 'precond_id' below. +! +! We recommend viewing the Struct examples before viewing this and +! the other SStruct examples. This is one of the simplest SStruct +! examples, used primarily to demonstrate how to set up +! non-cell-centered problems, and to demonstrate how easy it is to +! switch between structured solvers (PFMG) and solvers designed for +! more general settings (AMG). +! + + program ex12f + + implicit none + + include 'mpif.h' + include 'HYPREf.h' + + integer ierr + integer i, j, myid, num_procs + + integer*8 grid + integer*8 graph + integer*8 stencil + integer*8 A + integer*8 b + integer*8 x + + integer nparts + integer nvars + integer part + integer var + + integer precond_id, object_type + + integer ilower(2), iupper(2) + integer vartypes(1) + integer offsets(2,5) + integer ent + integer nentries, nvalues, stencil_indices(5) + + double precision tol + + double precision, managed, allocatable :: values(:) + +! This comes from 'sstruct_mv/HYPRE_sstruct_mv.h' + integer HYPRE_SSTRUCT_VARIABLE_NODE + parameter( HYPRE_SSTRUCT_VARIABLE_NODE = 1 ) + + integer*8 sA + integer*8 sb + integer*8 sx + integer*8 parA + integer*8 parb + integer*8 parx + integer*8 solver + integer*8 precond + + character*32 matfile + + allocate(values(100)) + +! We only have one part and one variable + nparts = 1 + nvars = 1 + part = 0 + var = 0 + +! Initialize MPI + call MPI_Init(ierr) + call MPI_Comm_rank(MPI_COMM_WORLD, myid, ierr) + call MPI_Comm_size(MPI_COMM_WORLD, num_procs, ierr) + + call HYPRE_Initialize(ierr) + + if (num_procs .ne. 2) then + if (myid .eq. 0) then + print *, "Must run with 2 processors!" + stop + endif + endif + +! Set preconditioner id (PFMG = 1, BoomerAMG = 2) + precond_id = 1 + + if (precond_id .eq. 1) then + object_type = HYPRE_STRUCT + else if (precond_id .eq. 2) then + object_type = HYPRE_PARCSR + else + if (myid .eq. 0) then + print *, "Invalid solver!" + stop + endif + endif + +!----------------------------------------------------------------------- +! 1. Set up the grid. Here we use only one part. Each processor +! describes the piece of the grid that it owns. +!----------------------------------------------------------------------- + +! Create an empty 2D grid object + call HYPRE_SStructGridCreate(MPI_COMM_WORLD, 2, nparts, grid, & + ierr) + +! Add boxes to the grid + if (myid .eq. 0) then + ilower(1) = -3 + ilower(2) = 1 + iupper(1) = -1 + iupper(2) = 2 + call HYPRE_SStructGridSetExtents(grid, part, ilower, iupper, & + ierr) + else if (myid .eq. 1) then + ilower(1) = 0 + ilower(2) = 1 + iupper(1) = 2 + iupper(2) = 4 + call HYPRE_SStructGridSetExtents(grid, part, ilower, iupper, & + ierr) + endif + +! Set the variable type and number of variables on each part + vartypes(1) = HYPRE_SSTRUCT_VARIABLE_NODE + call HYPRE_SStructGridSetVariables(grid, part, nvars, vartypes, & + ierr) + +! This is a collective call finalizing the grid assembly + call HYPRE_SStructGridAssemble(grid, ierr) + +!----------------------------------------------------------------------- +! 2. Define the discretization stencil +!----------------------------------------------------------------------- + +! Create an empty 2D, 5-pt stencil object + call HYPRE_SStructStencilCreate(2, 5, stencil, ierr) + +! Define the geometry of the stencil. Each represents a relative +! offset (in the index space). + offsets(1,1) = 0 + offsets(2,1) = 0 + offsets(1,2) = -1 + offsets(2,2) = 0 + offsets(1,3) = 1 + offsets(2,3) = 0 + offsets(1,4) = 0 + offsets(2,4) = -1 + offsets(1,5) = 0 + offsets(2,5) = 1 + +! Assign numerical values to the offsets so that we can easily refer +! to them - the last argument indicates the variable for which we +! are assigning this stencil + do ent = 1, 5 + call HYPRE_SStructStencilSetEntry(stencil, & + ent-1, offsets(1,ent), var, ierr) + enddo + +!----------------------------------------------------------------------- +! 3. Set up the Graph - this determines the non-zero structure of +! the matrix and allows non-stencil relationships between the parts +!----------------------------------------------------------------------- + +! Create the graph object + call HYPRE_SStructGraphCreate(MPI_COMM_WORLD, grid, graph, ierr) + +! See MatrixSetObjectType below + call HYPRE_SStructGraphSetObjectType(graph, object_type, ierr) + +! Now we need to tell the graph which stencil to use for each +! variable on each part (we only have one variable and one part) + call HYPRE_SStructGraphSetStencil(graph, part, var, stencil, ierr) + +! Here we could establish connections between parts if we had more +! than one part using the graph. For example, we could use +! HYPRE_GraphAddEntries() routine or HYPRE_GridSetNeighborPart() + +! Assemble the graph + call HYPRE_SStructGraphAssemble(graph, ierr) + +!----------------------------------------------------------------------- +! 4. Set up a SStruct Matrix +!----------------------------------------------------------------------- + +! Create an empty matrix object + call HYPRE_SStructMatrixCreate(MPI_COMM_WORLD, graph, A, ierr) + +! Set the object type (by default HYPRE_SSTRUCT). This determines +! the data structure used to store the matrix. For PFMG we use +! HYPRE_STRUCT, and for BoomerAMG we use HYPRE_PARCSR (set above). + call HYPRE_SStructMatrixSetObjectTyp(A, object_type, ierr) + +! Get ready to set values + call HYPRE_SStructMatrixInitialize(A, ierr) + +! Set the matrix coefficients. Each processor assigns coefficients +! for the boxes in the grid that it owns. Note that the +! coefficients associated with each stencil entry may vary from grid +! point to grid point if desired. Here, we first set the same +! stencil entries for each grid point. Then we make modifications +! to grid points near the boundary. Note that the ilower values are +! different from those used in ex1 because of the way nodal +! variables are referenced. Also note that some of the stencil +! values are set on both processor 0 and processor 1. See the User +! and Reference manuals for more details. + +! Stencil entry labels correspond to the offsets defined above + do i = 1, 5 + stencil_indices(i) = i-1 + enddo + nentries = 5 + + if (myid .eq. 0) then + ilower(1) = -4 + ilower(2) = 0 + iupper(1) = -1 + iupper(2) = 2 +! 12 grid points, each with 5 stencil entries + nvalues = 60 + else if (myid .eq. 1) then + ilower(1) = -1 + ilower(2) = 0 + iupper(1) = 2 + iupper(2) = 4 +! 12 grid points, each with 5 stencil entries + nvalues = 100 + endif + + do i = 1, nvalues, nentries + values(i) = 4.0 + do j = 1, nentries-1 + values(i+j) = -1.0 + enddo + enddo + + call HYPRE_SStructMatrixSetBoxValues(A, part, ilower, iupper, & + var, nentries, stencil_indices, values, ierr) + +! Set the coefficients reaching outside of the boundary to 0. Note +! that both ilower *and* iupper may be different from those in ex1. + + do i = 1, 5 + values(i) = 0.0 + enddo + + if (myid .eq. 0) then + +! values below our box + ilower(1) = -4 + ilower(2) = 0 + iupper(1) = -1 + iupper(2) = 0 + stencil_indices(1) = 3 + call HYPRE_SStructMatrixSetBoxValues(A, part, ilower, iupper, & + var, 1, stencil_indices, values, ierr) +! values to the left of our box + ilower(1) = -4 + ilower(2) = 0 + iupper(1) = -4 + iupper(2) = 2 + stencil_indices(1) = 1 + call HYPRE_SStructMatrixSetBoxValues(A, part, ilower, iupper, & + var, 1, stencil_indices, values, ierr) +! values above our box + ilower(1) = -4 + ilower(2) = 2 + iupper(1) = -2 + iupper(2) = 2 + stencil_indices(1) = 4 + call HYPRE_SStructMatrixSetBoxValues(A, part, ilower, iupper, & + var, 1, stencil_indices, values, ierr) + + else if (myid .eq. 1) then + +! values below our box + ilower(1) = -1 + ilower(2) = 0 + iupper(1) = 2 + iupper(2) = 0 + stencil_indices(1) = 3 + call HYPRE_SStructMatrixSetBoxValues(A, part, ilower, iupper, & + var, 1, stencil_indices, values, ierr) +! values to the right of our box + ilower(1) = 2 + ilower(2) = 0 + iupper(1) = 2 + iupper(2) = 4 + stencil_indices(1) = 2 + call HYPRE_SStructMatrixSetBoxValues(A, part, ilower, iupper, & + var, 1, stencil_indices, values, ierr) +! values above our box + ilower(1) = -1 + ilower(2) = 4 + iupper(1) = 2 + iupper(2) = 4 + stencil_indices(1) = 4 + call HYPRE_SStructMatrixSetBoxValues(A, part, ilower, iupper, & + var, 1, stencil_indices, values, ierr) +! values to the left of our box +! (that do not border the other box on proc. 0) + ilower(1) = -1 + ilower(2) = 3 + iupper(1) = -1 + iupper(2) = 4 + stencil_indices(1) = 1 + call HYPRE_SStructMatrixSetBoxValues(A, part, ilower, iupper, & + var, 1, stencil_indices, values, ierr) + + endif + +! This is a collective call finalizing the matrix assembly + call HYPRE_SStructMatrixAssemble(A, ierr) + +! matfile = 'ex12f.out' +! matfile(10:10) = char(0) +! call HYPRE_SStructMatrixPrint(matfile, A, 0, ierr) + +! Create an empty vector object + call HYPRE_SStructVectorCreate(MPI_COMM_WORLD, grid, b, ierr) + call HYPRE_SStructVectorCreate(MPI_COMM_WORLD, grid, x, ierr) + +! As with the matrix, set the appropriate object type for the vectors + call HYPRE_SStructVectorSetObjectTyp(b, object_type, ierr) + call HYPRE_SStructVectorSetObjectTyp(x, object_type, ierr) + +! Indicate that the vector coefficients are ready to be set + call HYPRE_SStructVectorInitialize(b, ierr) + call HYPRE_SStructVectorInitialize(x, ierr) + +! Set the vector coefficients. Again, note that the ilower values +! are different from those used in ex1, and some of the values are +! set on both processors. + + if (myid .eq. 0) then + + ilower(1) = -4 + ilower(2) = 0 + iupper(1) = -1 + iupper(2) = 2 + + do i = 1, 12 + values(i) = 1.0 + enddo + call HYPRE_SStructVectorSetBoxValues(b, part, ilower, iupper, & + var, values, ierr) + do i = 1, 12 + values(i) = 0.0 + enddo + call HYPRE_SStructVectorSetBoxValues(x, part, ilower, iupper, & + var, values, ierr) + + else if (myid .eq. 1) then + + ilower(1) = 0 + ilower(2) = 1 + iupper(1) = 2 + iupper(2) = 4 + + do i = 1, 20 + values(i) = 1.0 + enddo + call HYPRE_SStructVectorSetBoxValues(b, part, ilower, iupper, & + var, values, ierr) + do i = 1, 20 + values(i) = 0.0 + enddo + call HYPRE_SStructVectorSetBoxValues(x, part, ilower, iupper, & + var, values, ierr) + + endif + +! This is a collective call finalizing the vector assembly + call HYPRE_SStructVectorAssemble(b, ierr) + call HYPRE_SStructVectorAssemble(x, ierr) + +!----------------------------------------------------------------------- +! 6. Set up and use a solver (See the Reference Manual for +! descriptions of all of the options.) +!----------------------------------------------------------------------- + + tol = 1.0E-6 + + if (precond_id .eq. 1) then + +! PFMG + +! Because we are using a struct solver, we need to get the object +! of the matrix and vectors to pass in to the struct solvers + call HYPRE_SStructMatrixGetObject(A, sA, ierr) + call HYPRE_SStructVectorGetObject(b, sb, ierr) + call HYPRE_SStructVectorGetObject(x, sx, ierr) + +! Create an empty PCG Struct solver + call HYPRE_StructPCGCreate(MPI_COMM_WORLD, solver, ierr) +! Set PCG parameters + call HYPRE_StructPCGSetTol(solver, tol, ierr) + call HYPRE_StructPCGSetPrintLevel(solver, 2, ierr) + call HYPRE_StructPCGSetMaxIter(solver, 50, ierr) + +! Create the Struct PFMG solver for use as a preconditioner + call HYPRE_StructPFMGCreate(MPI_COMM_WORLD, precond, ierr) +! Set PFMG parameters + call HYPRE_StructPFMGSetMaxIter(precond, 1, ierr) + call HYPRE_StructPFMGSetTol(precond, 0.0d0, ierr) + call HYPRE_StructPFMGSetZeroGuess(precond, ierr) + call HYPRE_StructPFMGSetNumPreRelax(precond, 2, ierr) + call HYPRE_StructPFMGSetNumPostRelax(precond, 2, ierr) +! Non-Galerkin coarse grid (more efficient for this problem) + call HYPRE_StructPFMGSetRAPType(precond, 1, ierr) +! R/B Gauss-Seidel + call HYPRE_StructPFMGSetRelaxType(precond, 2, ierr) +! Skip relaxation on some levels (more efficient for this problem) + call HYPRE_StructPFMGSetSkipRelax(precond, 1, ierr) +! Set preconditioner (PFMG = 1) and solve + call HYPRE_StructPCGSetPrecond(solver, 1, precond, ierr) + call HYPRE_StructPCGSetup(solver, sA, sb, sx, ierr) + call HYPRE_StructPCGSolve(solver, sA, sb, sx, ierr) + +! Free memory + call HYPRE_StructPCGDestroy(solver, ierr) + call HYPRE_StructPFMGDestroy(precond, ierr) + + else if (precond_id .eq. 2) then + +! BoomerAMG + +! Because we are using a struct solver, we need to get the object +! of the matrix and vectors to pass in to the struct solvers + call HYPRE_SStructMatrixGetObject(A, parA, ierr) + call HYPRE_SStructVectorGetObject(b, parb, ierr) + call HYPRE_SStructVectorGetObject(x, parx, ierr) + +! Create an empty PCG Struct solver + call HYPRE_ParCSRPCGCreate(MPI_COMM_WORLD, solver, ierr) +! Set PCG parameters + call HYPRE_ParCSRPCGSetTol(solver, tol, ierr) + call HYPRE_ParCSRPCGSetPrintLevel(solver, 2, ierr) + call HYPRE_ParCSRPCGSetMaxIter(solver, 50, ierr) + +! Create the BoomerAMG solver for use as a preconditioner + call HYPRE_BoomerAMGCreate(precond, ierr) +! Set BoomerAMG parameters + call HYPRE_BoomerAMGSetMaxIter(precond, 1, ierr) + call HYPRE_BoomerAMGSetTol(precond, 0.0, ierr) +! Print amg solution info + call HYPRE_BoomerAMGSetPrintLevel(precond, 1, ierr) + call HYPRE_BoomerAMGSetCoarsenType(precond, 6, ierr) + call HYPRE_BoomerAMGSetOldDefault(precond, ierr) +! Sym G.S./Jacobi hybrid + call HYPRE_BoomerAMGSetRelaxType(precond, 6, ierr) + call HYPRE_BoomerAMGSetNumSweeps(precond, 1, ierr) +! Set preconditioner (BoomerAMG = 2) and solve + call HYPRE_ParCSRPCGSetPrecond(solver, 2, precond, ierr) + call HYPRE_ParCSRPCGSetup(solver, parA, parb, parx, ierr) + call HYPRE_ParCSRPCGSolve(solver, parA, parb, parx, ierr) + +! Free memory + call HYPRE_ParCSRPCGDestroy(solver, ierr) + call HYPRE_BoomerAMGDestroy(precond, ierr) + + endif + +! Free memory + call HYPRE_SStructGridDestroy(grid, ierr) + call HYPRE_SStructStencilDestroy(stencil, ierr) + call HYPRE_SStructGraphDestroy(graph, ierr) + call HYPRE_SStructMatrixDestroy(A, ierr) + call HYPRE_SStructVectorDestroy(b, ierr) + call HYPRE_SStructVectorDestroy(x, ierr) + + call HYPRE_Finalize(ierr) + +! Finalize MPI + call MPI_Finalize(ierr) + + deallocate(values) + end diff --git a/external/hypre/src/examples/ex12f.f b/external/hypre/src/examples/ex12f.f index 2281282b..7c72e8d4 100644 --- a/external/hypre/src/examples/ex12f.f +++ b/external/hypre/src/examples/ex12f.f @@ -1,4 +1,4 @@ -! Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +! Copyright (c) 1998 Lawrence Livermore National Security, LLC and other ! HYPRE Project Developers. See the top-level COPYRIGHT file for details. ! ! SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -54,7 +54,9 @@ program ex12f integer ent integer nentries, nvalues, stencil_indices(5) - double precision values(100), tol + double precision tol + + double precision values(100) ! This comes from 'sstruct_mv/HYPRE_sstruct_mv.h' integer HYPRE_SSTRUCT_VARIABLE_NODE @@ -69,7 +71,7 @@ program ex12f integer*8 solver integer*8 precond - character*32 matfile +! character*32 matfile ! We only have one part and one variable nparts = 1 @@ -82,7 +84,7 @@ program ex12f call MPI_Comm_rank(MPI_COMM_WORLD, myid, ierr) call MPI_Comm_size(MPI_COMM_WORLD, num_procs, ierr) - call HYPRE_Init(ierr) + call HYPRE_Initialize(ierr) if (num_procs .ne. 2) then if (myid .eq. 0) then @@ -105,6 +107,8 @@ program ex12f endif endif + !$omp target enter data map(alloc:values) + !----------------------------------------------------------------------- ! 1. Set up the grid. Here we use only one part. Each processor ! describes the piece of the grid that it owns. @@ -235,6 +239,8 @@ program ex12f iupper(2) = 4 ! 12 grid points, each with 5 stencil entries nvalues = 100 + else + nvalues = 0 endif do i = 1, nvalues, nentries @@ -244,8 +250,11 @@ program ex12f enddo enddo + !$omp target update to(values) + !$omp target data use_device_ptr(values) call HYPRE_SStructMatrixSetBoxValues(A, part, ilower, iupper, + var, nentries, stencil_indices, values, ierr) + !$omp end target data ! Set the coefficients reaching outside of the boundary to 0. Note ! that both ilower *and* iupper may be different from those in ex1. @@ -254,6 +263,9 @@ program ex12f values(i) = 0.0 enddo + !$omp target update to(values) + !$omp target data use_device_ptr(values) + if (myid .eq. 0) then ! values below our box @@ -319,6 +331,8 @@ program ex12f endif + !$omp end target data + ! This is a collective call finalizing the matrix assembly call HYPRE_SStructMatrixAssemble(A, ierr) @@ -352,13 +366,19 @@ program ex12f do i = 1, 12 values(i) = 1.0 enddo + !$omp target update to(values) + !$omp target data use_device_ptr(values) call HYPRE_SStructVectorSetBoxValues(b, part, ilower, iupper, + var, values, ierr) + !$omp end target data do i = 1, 12 values(i) = 0.0 enddo + !$omp target update to(values) + !$omp target data use_device_ptr(values) call HYPRE_SStructVectorSetBoxValues(x, part, ilower, iupper, + var, values, ierr) + !$omp end target data else if (myid .eq. 1) then @@ -370,13 +390,19 @@ program ex12f do i = 1, 20 values(i) = 1.0 enddo + !$omp target update to(values) + !$omp target data use_device_ptr(values) call HYPRE_SStructVectorSetBoxValues(b, part, ilower, iupper, + var, values, ierr) + !$omp end target data do i = 1, 20 values(i) = 0.0 enddo + !$omp target update to(values) + !$omp target data use_device_ptr(values) call HYPRE_SStructVectorSetBoxValues(x, part, ilower, iupper, + var, values, ierr) + !$omp end target data endif @@ -484,6 +510,4 @@ program ex12f ! Finalize MPI call MPI_Finalize(ierr) - stop end - diff --git a/external/hypre/src/examples/ex12f_cptr.f b/external/hypre/src/examples/ex12f_cptr.f new file mode 100644 index 00000000..f43ad505 --- /dev/null +++ b/external/hypre/src/examples/ex12f_cptr.f @@ -0,0 +1,502 @@ +! Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +! HYPRE Project Developers. See the top-level COPYRIGHT file for details. +! +! SPDX-License-Identifier: (Apache-2.0 OR MIT) + +! +! Example 12 +! +! Interface: Semi-Structured interface (SStruct) +! +! Compile with: make ex12f (may need to edit HYPRE_DIR in Makefile) +! +! Sample runs: mpirun -np 2 ex12f +! +! Description: The grid layout is the same as ex1, but with nodal +! unknowns. The solver is PCG preconditioned with either PFMG or +! BoomerAMG, set with 'precond_id' below. +! +! We recommend viewing the Struct examples before viewing this and +! the other SStruct examples. This is one of the simplest SStruct +! examples, used primarily to demonstrate how to set up +! non-cell-centered problems, and to demonstrate how easy it is to +! switch between structured solvers (PFMG) and solvers designed for +! more general settings (AMG). +! + + program ex12f + + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env, only: int64 + use cudaf + + implicit none + + include 'mpif.h' + include 'HYPREf.h' + + integer ierr + integer i, j, myid, num_procs + + integer*8 grid + integer*8 graph + integer*8 stencil + integer*8 A + integer*8 b + integer*8 x + + integer nparts + integer nvars + integer part + integer var + + integer precond_id, object_type + + integer ilower(2), iupper(2) + integer vartypes(1) + integer offsets(2,5) + integer ent + integer nentries, nvalues, stencil_indices(5) + + double precision tol + + double precision, pointer :: values(:) + type(c_ptr) :: p_values + + integer :: stat + +! This comes from 'sstruct_mv/HYPRE_sstruct_mv.h' + integer HYPRE_SSTRUCT_VARIABLE_NODE + parameter( HYPRE_SSTRUCT_VARIABLE_NODE = 1 ) + + integer*8 sA + integer*8 sb + integer*8 sx + integer*8 parA + integer*8 parb + integer*8 parx + integer*8 solver + integer*8 precond + + character*32 matfile + + stat = device_malloc_managed(int(100 * 8, int64), p_values) + + call c_f_pointer(p_values, values, [100]) + +! We only have one part and one variable + nparts = 1 + nvars = 1 + part = 0 + var = 0 + +! Initialize MPI + call MPI_Init(ierr) + call MPI_Comm_rank(MPI_COMM_WORLD, myid, ierr) + call MPI_Comm_size(MPI_COMM_WORLD, num_procs, ierr) + + call HYPRE_Initialize(ierr) + + if (num_procs .ne. 2) then + if (myid .eq. 0) then + print *, "Must run with 2 processors!" + stop + endif + endif + +! Set preconditioner id (PFMG = 1, BoomerAMG = 2) + precond_id = 1 + + if (precond_id .eq. 1) then + object_type = HYPRE_STRUCT + else if (precond_id .eq. 2) then + object_type = HYPRE_PARCSR + else + if (myid .eq. 0) then + print *, "Invalid solver!" + stop + endif + endif + +!----------------------------------------------------------------------- +! 1. Set up the grid. Here we use only one part. Each processor +! describes the piece of the grid that it owns. +!----------------------------------------------------------------------- + +! Create an empty 2D grid object + call HYPRE_SStructGridCreate(MPI_COMM_WORLD, 2, nparts, grid, + + ierr) + +! Add boxes to the grid + if (myid .eq. 0) then + ilower(1) = -3 + ilower(2) = 1 + iupper(1) = -1 + iupper(2) = 2 + call HYPRE_SStructGridSetExtents(grid, part, ilower, iupper, + + ierr) + else if (myid .eq. 1) then + ilower(1) = 0 + ilower(2) = 1 + iupper(1) = 2 + iupper(2) = 4 + call HYPRE_SStructGridSetExtents(grid, part, ilower, iupper, + + ierr) + endif + +! Set the variable type and number of variables on each part + vartypes(1) = HYPRE_SSTRUCT_VARIABLE_NODE + call HYPRE_SStructGridSetVariables(grid, part, nvars, vartypes, + + ierr) + +! This is a collective call finalizing the grid assembly + call HYPRE_SStructGridAssemble(grid, ierr) + +!----------------------------------------------------------------------- +! 2. Define the discretization stencil +!----------------------------------------------------------------------- + +! Create an empty 2D, 5-pt stencil object + call HYPRE_SStructStencilCreate(2, 5, stencil, ierr) + +! Define the geometry of the stencil. Each represents a relative +! offset (in the index space). + offsets(1,1) = 0 + offsets(2,1) = 0 + offsets(1,2) = -1 + offsets(2,2) = 0 + offsets(1,3) = 1 + offsets(2,3) = 0 + offsets(1,4) = 0 + offsets(2,4) = -1 + offsets(1,5) = 0 + offsets(2,5) = 1 + +! Assign numerical values to the offsets so that we can easily refer +! to them - the last argument indicates the variable for which we +! are assigning this stencil + do ent = 1, 5 + call HYPRE_SStructStencilSetEntry(stencil, + + ent-1, offsets(1,ent), var, ierr) + enddo + +!----------------------------------------------------------------------- +! 3. Set up the Graph - this determines the non-zero structure of +! the matrix and allows non-stencil relationships between the parts +!----------------------------------------------------------------------- + +! Create the graph object + call HYPRE_SStructGraphCreate(MPI_COMM_WORLD, grid, graph, ierr) + +! See MatrixSetObjectType below + call HYPRE_SStructGraphSetObjectType(graph, object_type, ierr) + +! Now we need to tell the graph which stencil to use for each +! variable on each part (we only have one variable and one part) + call HYPRE_SStructGraphSetStencil(graph, part, var, stencil, ierr) + +! Here we could establish connections between parts if we had more +! than one part using the graph. For example, we could use +! HYPRE_GraphAddEntries() routine or HYPRE_GridSetNeighborPart() + +! Assemble the graph + call HYPRE_SStructGraphAssemble(graph, ierr) + +!----------------------------------------------------------------------- +! 4. Set up a SStruct Matrix +!----------------------------------------------------------------------- + +! Create an empty matrix object + call HYPRE_SStructMatrixCreate(MPI_COMM_WORLD, graph, A, ierr) + +! Set the object type (by default HYPRE_SSTRUCT). This determines +! the data structure used to store the matrix. For PFMG we use +! HYPRE_STRUCT, and for BoomerAMG we use HYPRE_PARCSR (set above). + call HYPRE_SStructMatrixSetObjectTyp(A, object_type, ierr) + +! Get ready to set values + call HYPRE_SStructMatrixInitialize(A, ierr) + +! Set the matrix coefficients. Each processor assigns coefficients +! for the boxes in the grid that it owns. Note that the +! coefficients associated with each stencil entry may vary from grid +! point to grid point if desired. Here, we first set the same +! stencil entries for each grid point. Then we make modifications +! to grid points near the boundary. Note that the ilower values are +! different from those used in ex1 because of the way nodal +! variables are referenced. Also note that some of the stencil +! values are set on both processor 0 and processor 1. See the User +! and Reference manuals for more details. + +! Stencil entry labels correspond to the offsets defined above + do i = 1, 5 + stencil_indices(i) = i-1 + enddo + nentries = 5 + + if (myid .eq. 0) then + ilower(1) = -4 + ilower(2) = 0 + iupper(1) = -1 + iupper(2) = 2 +! 12 grid points, each with 5 stencil entries + nvalues = 60 + else if (myid .eq. 1) then + ilower(1) = -1 + ilower(2) = 0 + iupper(1) = 2 + iupper(2) = 4 +! 12 grid points, each with 5 stencil entries + nvalues = 100 + endif + + do i = 1, nvalues, nentries + values(i) = 4.0 + do j = 1, nentries-1 + values(i+j) = -1.0 + enddo + enddo + + call HYPRE_SStructMatrixSetBoxValues(A, part, ilower, iupper, + + var, nentries, stencil_indices, values, ierr) + +! Set the coefficients reaching outside of the boundary to 0. Note +! that both ilower *and* iupper may be different from those in ex1. + + do i = 1, 5 + values(i) = 0.0 + enddo + + if (myid .eq. 0) then + +! values below our box + ilower(1) = -4 + ilower(2) = 0 + iupper(1) = -1 + iupper(2) = 0 + stencil_indices(1) = 3 + call HYPRE_SStructMatrixSetBoxValues(A, part, ilower, iupper, + + var, 1, stencil_indices, values, ierr) +! values to the left of our box + ilower(1) = -4 + ilower(2) = 0 + iupper(1) = -4 + iupper(2) = 2 + stencil_indices(1) = 1 + call HYPRE_SStructMatrixSetBoxValues(A, part, ilower, iupper, + + var, 1, stencil_indices, values, ierr) +! values above our box + ilower(1) = -4 + ilower(2) = 2 + iupper(1) = -2 + iupper(2) = 2 + stencil_indices(1) = 4 + call HYPRE_SStructMatrixSetBoxValues(A, part, ilower, iupper, + + var, 1, stencil_indices, values, ierr) + + else if (myid .eq. 1) then + +! values below our box + ilower(1) = -1 + ilower(2) = 0 + iupper(1) = 2 + iupper(2) = 0 + stencil_indices(1) = 3 + call HYPRE_SStructMatrixSetBoxValues(A, part, ilower, iupper, + + var, 1, stencil_indices, values, ierr) +! values to the right of our box + ilower(1) = 2 + ilower(2) = 0 + iupper(1) = 2 + iupper(2) = 4 + stencil_indices(1) = 2 + call HYPRE_SStructMatrixSetBoxValues(A, part, ilower, iupper, + + var, 1, stencil_indices, values, ierr) +! values above our box + ilower(1) = -1 + ilower(2) = 4 + iupper(1) = 2 + iupper(2) = 4 + stencil_indices(1) = 4 + call HYPRE_SStructMatrixSetBoxValues(A, part, ilower, iupper, + + var, 1, stencil_indices, values, ierr) +! values to the left of our box +! (that do not border the other box on proc. 0) + ilower(1) = -1 + ilower(2) = 3 + iupper(1) = -1 + iupper(2) = 4 + stencil_indices(1) = 1 + call HYPRE_SStructMatrixSetBoxValues(A, part, ilower, iupper, + + var, 1, stencil_indices, values, ierr) + + endif + +! This is a collective call finalizing the matrix assembly + call HYPRE_SStructMatrixAssemble(A, ierr) + +! matfile = 'ex12f.out' +! matfile(10:10) = char(0) +! call HYPRE_SStructMatrixPrint(matfile, A, 0, ierr) + +! Create an empty vector object + call HYPRE_SStructVectorCreate(MPI_COMM_WORLD, grid, b, ierr) + call HYPRE_SStructVectorCreate(MPI_COMM_WORLD, grid, x, ierr) + +! As with the matrix, set the appropriate object type for the vectors + call HYPRE_SStructVectorSetObjectTyp(b, object_type, ierr) + call HYPRE_SStructVectorSetObjectTyp(x, object_type, ierr) + +! Indicate that the vector coefficients are ready to be set + call HYPRE_SStructVectorInitialize(b, ierr) + call HYPRE_SStructVectorInitialize(x, ierr) + +! Set the vector coefficients. Again, note that the ilower values +! are different from those used in ex1, and some of the values are +! set on both processors. + + if (myid .eq. 0) then + + ilower(1) = -4 + ilower(2) = 0 + iupper(1) = -1 + iupper(2) = 2 + + do i = 1, 12 + values(i) = 1.0 + enddo + call HYPRE_SStructVectorSetBoxValues(b, part, ilower, iupper, + + var, values, ierr) + do i = 1, 12 + values(i) = 0.0 + enddo + call HYPRE_SStructVectorSetBoxValues(x, part, ilower, iupper, + + var, values, ierr) + + else if (myid .eq. 1) then + + ilower(1) = 0 + ilower(2) = 1 + iupper(1) = 2 + iupper(2) = 4 + + do i = 1, 20 + values(i) = 1.0 + enddo + call HYPRE_SStructVectorSetBoxValues(b, part, ilower, iupper, + + var, values, ierr) + do i = 1, 20 + values(i) = 0.0 + enddo + call HYPRE_SStructVectorSetBoxValues(x, part, ilower, iupper, + + var, values, ierr) + + endif + +! This is a collective call finalizing the vector assembly + call HYPRE_SStructVectorAssemble(b, ierr) + call HYPRE_SStructVectorAssemble(x, ierr) + +!----------------------------------------------------------------------- +! 6. Set up and use a solver (See the Reference Manual for +! descriptions of all of the options.) +!----------------------------------------------------------------------- + + tol = 1.0E-6 + + if (precond_id .eq. 1) then + +! PFMG + +! Because we are using a struct solver, we need to get the object +! of the matrix and vectors to pass in to the struct solvers + call HYPRE_SStructMatrixGetObject(A, sA, ierr) + call HYPRE_SStructVectorGetObject(b, sb, ierr) + call HYPRE_SStructVectorGetObject(x, sx, ierr) + +! Create an empty PCG Struct solver + call HYPRE_StructPCGCreate(MPI_COMM_WORLD, solver, ierr) +! Set PCG parameters + call HYPRE_StructPCGSetTol(solver, tol, ierr) + call HYPRE_StructPCGSetPrintLevel(solver, 2, ierr) + call HYPRE_StructPCGSetMaxIter(solver, 50, ierr) + +! Create the Struct PFMG solver for use as a preconditioner + call HYPRE_StructPFMGCreate(MPI_COMM_WORLD, precond, ierr) +! Set PFMG parameters + call HYPRE_StructPFMGSetMaxIter(precond, 1, ierr) + call HYPRE_StructPFMGSetTol(precond, 0.0d0, ierr) + call HYPRE_StructPFMGSetZeroGuess(precond, ierr) + call HYPRE_StructPFMGSetNumPreRelax(precond, 2, ierr) + call HYPRE_StructPFMGSetNumPostRelax(precond, 2, ierr) +! Non-Galerkin coarse grid (more efficient for this problem) + call HYPRE_StructPFMGSetRAPType(precond, 1, ierr) +! R/B Gauss-Seidel + call HYPRE_StructPFMGSetRelaxType(precond, 2, ierr) +! Skip relaxation on some levels (more efficient for this problem) + call HYPRE_StructPFMGSetSkipRelax(precond, 1, ierr) +! Set preconditioner (PFMG = 1) and solve + call HYPRE_StructPCGSetPrecond(solver, 1, precond, ierr) + call HYPRE_StructPCGSetup(solver, sA, sb, sx, ierr) + call HYPRE_StructPCGSolve(solver, sA, sb, sx, ierr) + +! Free memory + call HYPRE_StructPCGDestroy(solver, ierr) + call HYPRE_StructPFMGDestroy(precond, ierr) + + else if (precond_id .eq. 2) then + +! BoomerAMG + +! Because we are using a struct solver, we need to get the object +! of the matrix and vectors to pass in to the struct solvers + call HYPRE_SStructMatrixGetObject(A, parA, ierr) + call HYPRE_SStructVectorGetObject(b, parb, ierr) + call HYPRE_SStructVectorGetObject(x, parx, ierr) + +! Create an empty PCG Struct solver + call HYPRE_ParCSRPCGCreate(MPI_COMM_WORLD, solver, ierr) +! Set PCG parameters + call HYPRE_ParCSRPCGSetTol(solver, tol, ierr) + call HYPRE_ParCSRPCGSetPrintLevel(solver, 2, ierr) + call HYPRE_ParCSRPCGSetMaxIter(solver, 50, ierr) + +! Create the BoomerAMG solver for use as a preconditioner + call HYPRE_BoomerAMGCreate(precond, ierr) +! Set BoomerAMG parameters + call HYPRE_BoomerAMGSetMaxIter(precond, 1, ierr) + call HYPRE_BoomerAMGSetTol(precond, 0.0, ierr) +! Print amg solution info + call HYPRE_BoomerAMGSetPrintLevel(precond, 1, ierr) + call HYPRE_BoomerAMGSetCoarsenType(precond, 6, ierr) + call HYPRE_BoomerAMGSetOldDefault(precond, ierr) +! Sym G.S./Jacobi hybrid + call HYPRE_BoomerAMGSetRelaxType(precond, 6, ierr) + call HYPRE_BoomerAMGSetNumSweeps(precond, 1, ierr) +! Set preconditioner (BoomerAMG = 2) and solve + call HYPRE_ParCSRPCGSetPrecond(solver, 2, precond, ierr) + call HYPRE_ParCSRPCGSetup(solver, parA, parb, parx, ierr) + call HYPRE_ParCSRPCGSolve(solver, parA, parb, parx, ierr) + +! Free memory + call HYPRE_ParCSRPCGDestroy(solver, ierr) + call HYPRE_BoomerAMGDestroy(precond, ierr) + + endif + +! Free memory + call HYPRE_SStructGridDestroy(grid, ierr) + call HYPRE_SStructStencilDestroy(stencil, ierr) + call HYPRE_SStructGraphDestroy(graph, ierr) + call HYPRE_SStructMatrixDestroy(A, ierr) + call HYPRE_SStructVectorDestroy(b, ierr) + call HYPRE_SStructVectorDestroy(x, ierr) + + call HYPRE_Finalize(ierr) + +! Finalize MPI + call MPI_Finalize(ierr) + + stat = device_free(p_values) + + end diff --git a/external/hypre/src/examples/ex13.c b/external/hypre/src/examples/ex13.c index 25cebe81..164591b7 100644 --- a/external/hypre/src/examples/ex13.c +++ b/external/hypre/src/examples/ex13.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -123,29 +123,33 @@ void ComputeFEMRhombus (double **S, double F[4], double gamma, double h) { int i, j; - double h2_4 = h*h/4; + double h2_4 = h * h / 4; double sing = sin(gamma); - double alpha = 1/(6*sing); - double k = 3*cos(gamma); + double alpha = 1 / (6 * sing); + double k = 3 * cos(gamma); - S[0][0] = alpha * (4-k); + S[0][0] = alpha * (4 - k); S[0][1] = alpha * (-1); - S[0][2] = alpha * (-2+k); + S[0][2] = alpha * (-2 + k); S[0][3] = alpha * (-1); - S[1][1] = alpha * (4+k); + S[1][1] = alpha * (4 + k); S[1][2] = alpha * (-1); - S[1][3] = alpha * (-2-k); - S[2][2] = alpha * (4-k); + S[1][3] = alpha * (-2 - k); + S[2][2] = alpha * (4 - k); S[2][3] = alpha * (-1); - S[3][3] = alpha * (4+k); + S[3][3] = alpha * (4 + k); /* The stiffness matrix is symmetric */ for (i = 1; i < 4; i++) for (j = 0; j < i; j++) + { S[i][j] = S[j][i]; + } for (i = 0; i < 4; i++) - F[i] = h2_4*sing; + { + F[i] = h2_4 * sing; + } } @@ -171,7 +175,7 @@ int main (int argc, char *argv[]) MPI_Comm_size(MPI_COMM_WORLD, &num_procs); /* Initialize HYPRE */ - HYPRE_Init(); + HYPRE_Initialize(); /* Print GPU info */ /* HYPRE_PrintDeviceInfo(); */ @@ -229,12 +233,12 @@ int main (int argc, char *argv[]) number of processors np and the given n */ if (num_procs < 3) { - if (myid ==0) printf("Must run with at least 3 processors!\n"); + if (myid == 0) { printf("Must run with at least 3 processors!\n"); } MPI_Finalize(); exit(1); } - gamma = 2*M_PI/num_procs; - h = 1.0/n; + gamma = 2 * M_PI / num_procs; + h = 1.0 / n; /* 1. Set up the grid. We will set up the grid so that processor X owns part X. Note that each part has its own index space numbering. Later @@ -250,8 +254,8 @@ int main (int argc, char *argv[]) part has its own relative index space numbering */ { int part = myid; - int ilower[2] = {1,1}; /* lower-left cell touching the origin */ - int iupper[2] = {n,n}; /* upper-right cell */ + int ilower[2] = {1, 1}; /* lower-left cell touching the origin */ + int iupper[2] = {n, n}; /* upper-right cell */ HYPRE_SStructGridSetExtents(grid, part, ilower, iupper); } @@ -265,7 +269,9 @@ int main (int argc, char *argv[]) HYPRE_SStructVariable vartypes[1] = {HYPRE_SSTRUCT_VARIABLE_NODE}; for (i = 0; i < nparts; i++) + { HYPRE_SStructGridSetVariables(grid, i, nvars, vartypes); + } } /* Now we need to set the spatial relation between each of the parts. @@ -278,19 +284,19 @@ int main (int argc, char *argv[]) { int part = myid; /* the box of cells intersecting the boundary in the current part */ - int ilower[2] = {1,1}, iupper[2] = {1,n}; + int ilower[2] = {1, 1}, iupper[2] = {1, n}; /* share all data on the left side of the box */ - int offset[2] = {-1,0}; + int offset[2] = {-1, 0}; - int shared_part = (myid+1) % num_procs; + int shared_part = (myid + 1) % num_procs; /* the box of cells intersecting the boundary in the neighbor */ - int shared_ilower[2] = {1,1}, shared_iupper[2] = {n,1}; + int shared_ilower[2] = {1, 1}, shared_iupper[2] = {n, 1}; /* share all data on the bottom of the box */ - int shared_offset[2] = {0,-1}; + int shared_offset[2] = {0, -1}; /* x/y-direction on the current part is -y/x on the neighbor */ - int index_map[2] = {1,0}; - int index_dir[2] = {-1,1}; + int index_map[2] = {1, 0}; + int index_dir[2] = {-1, 1}; HYPRE_SStructGridSetSharedPart(grid, part, ilower, iupper, offset, shared_part, shared_ilower, @@ -304,19 +310,19 @@ int main (int argc, char *argv[]) { int part = myid; /* the box of cells intersecting the boundary in the current part */ - int ilower[2] = {1,1}, iupper[2] = {n,1}; + int ilower[2] = {1, 1}, iupper[2] = {n, 1}; /* share all data on the bottom of the box */ - int offset[2] = {0,-1}; + int offset[2] = {0, -1}; - int shared_part = (myid+num_procs-1) % num_procs; + int shared_part = (myid + num_procs - 1) % num_procs; /* the box of cells intersecting the boundary in the neighbor */ - int shared_ilower[2] = {1,1}, shared_iupper[2] = {1,n}; + int shared_ilower[2] = {1, 1}, shared_iupper[2] = {1, n}; /* share all data on the left side of the box */ - int shared_offset[2] = {-1,0}; + int shared_offset[2] = {-1, 0}; /* x/y-direction on the current part is y/-x on the neighbor */ - int index_map[2] = {1,0}; - int index_dir[2] = {1,-1}; + int index_map[2] = {1, 0}; + int index_dir[2] = {1, -1}; HYPRE_SStructGridSetSharedPart(grid, part, ilower, iupper, offset, shared_part, shared_ilower, @@ -329,29 +335,29 @@ int main (int argc, char *argv[]) { int part = myid; /* the (one cell) box that touches the origin */ - int ilower[2] = {1,1}, iupper[2] = {1,1}; + int ilower[2] = {1, 1}, iupper[2] = {1, 1}; /* share all data in the bottom left corner (i.e. the origin) */ - int offset[2] = {-1,-1}; + int offset[2] = {-1, -1}; int shared_part; /* the box of one cell that touches the origin */ - int shared_ilower[2] = {1,1}, shared_iupper[2] = {1,1}; + int shared_ilower[2] = {1, 1}, shared_iupper[2] = {1, 1}; /* share all data in the bottom left corner (i.e. the origin) */ - int shared_offset[2] = {-1,-1}; + int shared_offset[2] = {-1, -1}; /* x/y-direction on the current part is -x/-y on the neighbor, but in this case the arguments are not really important since we are only sharing a point */ - int index_map[2] = {0,1}; - int index_dir[2] = {-1,-1}; + int index_map[2] = {0, 1}; + int index_dir[2] = {-1, -1}; - for (shared_part = 0; shared_part < myid-1; shared_part++) + for (shared_part = 0; shared_part < myid - 1; shared_part++) HYPRE_SStructGridSetSharedPart(grid, part, ilower, iupper, offset, shared_part, shared_ilower, shared_iupper, shared_offset, index_map, index_dir); - for (shared_part = myid+2; shared_part < num_procs; shared_part++) + for (shared_part = myid + 2; shared_part < num_procs; shared_part++) HYPRE_SStructGridSetSharedPart(grid, part, ilower, iupper, offset, shared_part, shared_ilower, shared_iupper, shared_offset, @@ -373,16 +379,21 @@ int main (int argc, char *argv[]) /* Define the geometry of the 9-point stencil */ int stencil_size = 9; - int offsets[9][2] = {{0,0}, /* [8] [4] [7] */ - {-1,0}, {1,0}, /* \ | / */ - {0,-1}, {0,1}, /* [1]-[0]-[2] */ - {-1,-1}, {1,-1}, /* / | \ */ - {1,1}, {-1,1}}; /* [5] [3] [6] */ + int offsets[9][2] = + { + { 0, 0}, /* [8] [4] [7] */ + {-1, 0}, { 1, 0}, /* \ | / */ + { 0, -1}, { 0, 1}, /* [1]-[0]-[2] */ + {-1, -1}, { 1, -1}, /* / | \ */ + { 1, 1}, {-1, 1} /* [5] [3] [6] */ + }; HYPRE_SStructStencilCreate(ndim, stencil_size, &stencil); for (entry = 0; entry < stencil_size; entry++) + { HYPRE_SStructStencilSetEntry(stencil, entry, offsets[entry], var); + } } /* 3. Set up the Graph - this determines the non-zero structure of the @@ -400,7 +411,9 @@ int main (int argc, char *argv[]) /* Now we need to tell the graph which stencil to use for each variable on each part (we only have one variable) */ for (part = 0; part < num_procs; part++) + { HYPRE_SStructGraphSetStencil(graph, part, var, stencil); + } /* Assemble the graph */ HYPRE_SStructGraphAssemble(graph); @@ -429,16 +442,16 @@ int main (int argc, char *argv[]) { /* local stifness matrix and load vector */ /* double F[4]; OK to use constant-length arrays for CPUs */ - double *F = (double *) malloc(4*sizeof(double)); + double *F = (double *) malloc(4 * sizeof(double)); /*double S[4][4]; OK to use constant-length arrays for CPUs */ - double *S_flat = (double *) malloc(16*sizeof(double)); + double *S_flat = (double *) malloc(16 * sizeof(double)); double *S[4]; S[0] = S_flat; S[1] = S[0] + 4; S[2] = S[1] + 4; S[3] = S[2] + 4; /* The index of the local nodes 0-3 relative to the cell index, i.e. node k in cell (i,j) is in the upper-right corner of the cell (i,j) + node_index_offset[k]. */ - int node_index_offset[4][2] = {{-1,-1},{0,-1},{0,0},{-1,0}}; + int node_index_offset[4][2] = {{-1, -1}, {0, -1}, {0, 0}, {-1, 0}}; /* The cell sub-stencils of nodes 0-3 indexed from the full stencil, i.e. we take the full stencil in each node of a fixed cell, and @@ -452,7 +465,7 @@ int main (int argc, char *argv[]) therefore the above sub-stencil at node k corresponds to the kth row of the local stiffness matrix and the kth entry of the local load vector. */ - int node_stencil[4][4] = {{0,2,7,4},{1,0,4,8},{5,3,0,1},{3,6,2,0}}; + int node_stencil[4][4] = {{0, 2, 7, 4}, {1, 0, 4, 8}, {5, 3, 0, 1}, {3, 6, 2, 0}}; int i, j, k; int index[2]; @@ -574,14 +587,14 @@ int main (int argc, char *argv[]) { int part = myid; int var = 0; - int nvalues = (n+1)*(n+1); + int nvalues = (n + 1) * (n + 1); double *values; /* Since the SetBoxValues() calls below set the values of the nodes in the upper-right corners of the cells, the nodal box should start from (0,0) instead of (1,1). */ - int ilower[2] = {0,0}; - int iupper[2] = {n,n}; + int ilower[2] = {0, 0}; + int iupper[2] = {n, n}; values = (double*) calloc(nvalues, sizeof(double)); @@ -648,10 +661,10 @@ int main (int argc, char *argv[]) char filename[255]; int i, part = myid, var = 0; - int nvalues = (n+1)*(n+1); + int nvalues = (n + 1) * (n + 1); double *values = (double*) calloc(nvalues, sizeof(double)); - int ilower[2] = {0,0}; - int iupper[2] = {n,n}; + int ilower[2] = {0, 0}; + int iupper[2] = {n, n}; /* get all local data (including a local copy of the shared values) */ HYPRE_SStructVectorGetBoxValues(x, part, ilower, iupper, @@ -673,7 +686,9 @@ int main (int argc, char *argv[]) /* save solution */ for (i = 0; i < nvalues; i++) + { fprintf(file, "%.14e\n", values[i]); + } fflush(file); fclose(file); diff --git a/external/hypre/src/examples/ex14.c b/external/hypre/src/examples/ex14.c index 81d00510..bfe35fda 100644 --- a/external/hypre/src/examples/ex14.c +++ b/external/hypre/src/examples/ex14.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -121,29 +121,33 @@ void ComputeFEMRhombus (double **S, double F[4], double gamma, double h) { int i, j; - double h2_4 = h*h/4; + double h2_4 = h * h / 4; double sing = sin(gamma); - double alpha = 1/(6*sing); - double k = 3*cos(gamma); + double alpha = 1 / (6 * sing); + double k = 3 * cos(gamma); - S[0][0] = alpha * (4-k); + S[0][0] = alpha * (4 - k); S[0][1] = alpha * (-1); - S[0][2] = alpha * (-2+k); + S[0][2] = alpha * (-2 + k); S[0][3] = alpha * (-1); - S[1][1] = alpha * (4+k); + S[1][1] = alpha * (4 + k); S[1][2] = alpha * (-1); - S[1][3] = alpha * (-2-k); - S[2][2] = alpha * (4-k); + S[1][3] = alpha * (-2 - k); + S[2][2] = alpha * (4 - k); S[2][3] = alpha * (-1); - S[3][3] = alpha * (4+k); + S[3][3] = alpha * (4 + k); /* The stiffness matrix is symmetric */ for (i = 1; i < 4; i++) for (j = 0; j < i; j++) + { S[i][j] = S[j][i]; + } for (i = 0; i < 4; i++) - F[i] = h2_4*sing; + { + F[i] = h2_4 * sing; + } } @@ -168,7 +172,7 @@ int main (int argc, char *argv[]) MPI_Comm_size(MPI_COMM_WORLD, &num_procs); /* Initialize HYPRE */ - HYPRE_Init(); + HYPRE_Initialize(); /* Print GPU info */ /* HYPRE_PrintDeviceInfo(); */ @@ -226,12 +230,12 @@ int main (int argc, char *argv[]) number of processors np and the given n */ if (num_procs < 3) { - if (myid ==0) printf("Must run with at least 3 processors!\n"); + if (myid == 0) { printf("Must run with at least 3 processors!\n"); } MPI_Finalize(); exit(1); } - gamma = 2*M_PI/num_procs; - h = 1.0/n; + gamma = 2 * M_PI / num_procs; + h = 1.0 / n; /* 1. Set up the grid. We will set up the grid so that processor X owns part X. Note that each part has its own index space numbering. Later @@ -247,8 +251,8 @@ int main (int argc, char *argv[]) part has its own relative index space numbering */ { int part = myid; - int ilower[2] = {1,1}; /* lower-left cell touching the origin */ - int iupper[2] = {n,n}; /* upper-right cell */ + int ilower[2] = {1, 1}; /* lower-left cell touching the origin */ + int iupper[2] = {n, n}; /* upper-right cell */ HYPRE_SStructGridSetExtents(grid, part, ilower, iupper); } @@ -262,7 +266,9 @@ int main (int argc, char *argv[]) HYPRE_SStructVariable vartypes[1] = {HYPRE_SSTRUCT_VARIABLE_NODE}; for (i = 0; i < nparts; i++) + { HYPRE_SStructGridSetVariables(grid, i, nvars, vartypes); + } } /* Set the ordering of the variables in the finite element problem. This @@ -270,10 +276,13 @@ int main (int argc, char *argv[]) element's center. See the Reference Manual for more details. */ { int part = myid; - int ordering[12] = { 0, -1, -1, /* [3]------[2] */ - 0, +1, -1, /* / / */ - 0, +1, +1, /* / / */ - 0, -1, +1 }; /* [0]------[1] */ + int ordering[12] = + { + 0, -1, -1, /* [3]------[2] */ + 0, +1, -1, /* / / */ + 0, +1, +1, /* / / */ + 0, -1, +1 /* [0]------[1] */ + }; HYPRE_SStructGridSetFEMOrdering(grid, part, ordering); } @@ -288,19 +297,19 @@ int main (int argc, char *argv[]) { int part = myid; /* the box of cells intersecting the boundary in the current part */ - int ilower[2] = {1,1}, iupper[2] = {1,n}; + int ilower[2] = {1, 1}, iupper[2] = {1, n}; /* share all data on the left side of the box */ - int offset[2] = {-1,0}; + int offset[2] = {-1, 0}; - int shared_part = (myid+1) % num_procs; + int shared_part = (myid + 1) % num_procs; /* the box of cells intersecting the boundary in the neighbor */ - int shared_ilower[2] = {1,1}, shared_iupper[2] = {n,1}; + int shared_ilower[2] = {1, 1}, shared_iupper[2] = {n, 1}; /* share all data on the bottom of the box */ - int shared_offset[2] = {0,-1}; + int shared_offset[2] = {0, -1}; /* x/y-direction on the current part is -y/x on the neighbor */ - int index_map[2] = {1,0}; - int index_dir[2] = {-1,1}; + int index_map[2] = {1, 0}; + int index_dir[2] = {-1, 1}; HYPRE_SStructGridSetSharedPart(grid, part, ilower, iupper, offset, shared_part, shared_ilower, @@ -314,19 +323,19 @@ int main (int argc, char *argv[]) { int part = myid; /* the box of cells intersecting the boundary in the current part */ - int ilower[2] = {1,1}, iupper[2] = {n,1}; + int ilower[2] = {1, 1}, iupper[2] = {n, 1}; /* share all data on the bottom of the box */ - int offset[2] = {0,-1}; + int offset[2] = {0, -1}; - int shared_part = (myid+num_procs-1) % num_procs; + int shared_part = (myid + num_procs - 1) % num_procs; /* the box of cells intersecting the boundary in the neighbor */ - int shared_ilower[2] = {1,1}, shared_iupper[2] = {1,n}; + int shared_ilower[2] = {1, 1}, shared_iupper[2] = {1, n}; /* share all data on the left side of the box */ - int shared_offset[2] = {-1,0}; + int shared_offset[2] = {-1, 0}; /* x/y-direction on the current part is y/-x on the neighbor */ - int index_map[2] = {1,0}; - int index_dir[2] = {1,-1}; + int index_map[2] = {1, 0}; + int index_dir[2] = {1, -1}; HYPRE_SStructGridSetSharedPart(grid, part, ilower, iupper, offset, shared_part, shared_ilower, @@ -339,29 +348,29 @@ int main (int argc, char *argv[]) { int part = myid; /* the (one cell) box that touches the origin */ - int ilower[2] = {1,1}, iupper[2] = {1,1}; + int ilower[2] = {1, 1}, iupper[2] = {1, 1}; /* share all data in the bottom left corner (i.e. the origin) */ - int offset[2] = {-1,-1}; + int offset[2] = {-1, -1}; int shared_part; /* the box of one cell that touches the origin */ - int shared_ilower[2] = {1,1}, shared_iupper[2] = {1,1}; + int shared_ilower[2] = {1, 1}, shared_iupper[2] = {1, 1}; /* share all data in the bottom left corner (i.e. the origin) */ - int shared_offset[2] = {-1,-1}; + int shared_offset[2] = {-1, -1}; /* x/y-direction on the current part is -x/-y on the neighbor, but in this case the arguments are not really important since we are only sharing a point */ - int index_map[2] = {0,1}; - int index_dir[2] = {-1,-1}; + int index_map[2] = {0, 1}; + int index_dir[2] = {-1, -1}; - for (shared_part = 0; shared_part < myid-1; shared_part++) + for (shared_part = 0; shared_part < myid - 1; shared_part++) HYPRE_SStructGridSetSharedPart(grid, part, ilower, iupper, offset, shared_part, shared_ilower, shared_iupper, shared_offset, index_map, index_dir); - for (shared_part = myid+2; shared_part < num_procs; shared_part++) + for (shared_part = myid + 2; shared_part < num_procs; shared_part++) HYPRE_SStructGridSetSharedPart(grid, part, ilower, iupper, offset, shared_part, shared_ilower, shared_iupper, shared_offset, @@ -387,7 +396,9 @@ int main (int argc, char *argv[]) /* Indicate that this problem uses finite element stiffness matrices and load vectors, instead of stencils. */ for (part = 0; part < num_procs; part++) + { HYPRE_SStructGraphSetFEM(graph, part); + } /* The local stiffness matrix is full, so there is no need to call HYPRE_SStructGraphSetFEMSparsity to set its sparsity pattern. */ @@ -419,8 +430,8 @@ int main (int argc, char *argv[]) /* local stifness matrix and load vector */ /* OK to use constant-length arrays for CPUs */ /* double S[4][4], F[4]; */ - double *F = (double *) malloc(4*sizeof(double)); - double *S_flat = (double *) malloc(16*sizeof(double)); + double *F = (double *) malloc(4 * sizeof(double)); + double *S_flat = (double *) malloc(16 * sizeof(double)); double *S[4]; S[0] = S_flat; S[1] = S[0] + 4; S[2] = S[1] + 4; S[3] = S[2] + 4; @@ -532,14 +543,14 @@ int main (int argc, char *argv[]) { int part = myid; int var = 0; - int nvalues = (n+1)*(n+1); + int nvalues = (n + 1) * (n + 1); double *values; /* Since the SetBoxValues() calls below set the values of the nodes in the upper-right corners of the cells, the nodal box should start from (0,0) instead of (1,1). */ - int ilower[2] = {0,0}; - int iupper[2] = {n,n}; + int ilower[2] = {0, 0}; + int iupper[2] = {n, n}; values = (double*) calloc(nvalues, sizeof(double)); @@ -606,10 +617,10 @@ int main (int argc, char *argv[]) char filename[255]; int i, part = myid, var = 0; - int nvalues = (n+1)*(n+1); + int nvalues = (n + 1) * (n + 1); double *values = (double*) calloc(nvalues, sizeof(double)); - int ilower[2] = {0,0}; - int iupper[2] = {n,n}; + int ilower[2] = {0, 0}; + int iupper[2] = {n, n}; /* get all local data (including a local copy of the shared values) */ HYPRE_SStructVectorGetBoxValues(x, part, ilower, iupper, @@ -631,7 +642,9 @@ int main (int argc, char *argv[]) /* save solution */ for (i = 0; i < nvalues; i++) + { fprintf(file, "%.14e\n", values[i]); + } fflush(file); fclose(file); diff --git a/external/hypre/src/examples/ex15.c b/external/hypre/src/examples/ex15.c index ead8babc..efdc9cc6 100644 --- a/external/hypre/src/examples/ex15.c +++ b/external/hypre/src/examples/ex15.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -62,19 +62,27 @@ double alpha(double x, double y, double z) case 0: /* uniform coefficient */ return 1.0; case 1: /* smooth coefficient */ - return x*x+exp(y)+sin(z); + return x * x + exp(y) + sin(z); case 2: /* small outside of an interior cube */ - if ((fabs(x-0.5) < 0.25) && (fabs(y-0.5) < 0.25) && (fabs(z-0.5) < 0.25)) + if ((fabs(x - 0.5) < 0.25) && (fabs(y - 0.5) < 0.25) && (fabs(z - 0.5) < 0.25)) + { return 1.0; + } else + { return 1.0e-6; + } case 3: /* small outside of an interior ball */ - if (((x-0.5)*(x-0.5)+(y-0.5)*(y-0.5)+(z-0.5)*(z-0.5)) < 0.0625) + if (((x - 0.5) * (x - 0.5) + (y - 0.5) * (y - 0.5) + (z - 0.5) * (z - 0.5)) < 0.0625) + { return 1.0; + } else + { return 1.0e-6; + } case 4: /* random coefficient */ - return ((double)rand()/RAND_MAX); + return ((double)rand() / RAND_MAX); default: return 1.0; } @@ -88,19 +96,27 @@ double beta(double x, double y, double z) case 0: /* uniform coefficient */ return 1.0; case 1: /* smooth coefficient */ - return x*x+exp(y)+sin(z); + return x * x + exp(y) + sin(z); case 2:/* small outside of interior cube */ - if ((fabs(x-0.5) < 0.25) && (fabs(y-0.5) < 0.25) && (fabs(z-0.5) < 0.25)) + if ((fabs(x - 0.5) < 0.25) && (fabs(y - 0.5) < 0.25) && (fabs(z - 0.5) < 0.25)) + { return 1.0; + } else + { return 1.0e-6; + } case 3: /* small outside of an interior ball */ - if (((x-0.5)*(x-0.5)+(y-0.5)*(y-0.5)+(z-0.5)*(z-0.5)) < 0.0625) + if (((x - 0.5) * (x - 0.5) + (y - 0.5) * (y - 0.5) + (z - 0.5) * (z - 0.5)) < 0.0625) + { return 1.0; + } else + { return 1.0e-6; + } case 4: /* random coefficient */ - return ((double)rand()/RAND_MAX); + return ((double)rand() / RAND_MAX); default: return 1.0; } @@ -134,10 +150,10 @@ void ComputeFEMND1(double **S, double F[12], { int i, j; - double h2_4 = h*h/4; + double h2_4 = h * h / 4; - double cS1 = alpha(x,y,z)/(6.0*h), cS2 = 2*cS1, cS4 = 2*cS2; - double cM1 = beta(x,y,z)*h/36.0, cM2 = 2*cM1, cM4 = 2*cM2; + double cS1 = alpha(x, y, z) / (6.0 * h), cS2 = 2 * cS1, cS4 = 2 * cS2; + double cM1 = beta(x, y, z) * h / 36.0, cM2 = 2 * cM1, cM4 = 2 * cM2; S[ 0][ 0] = cS4 + cM4; S[ 0][ 1] = cS2; S[ 0][ 2] = -cS1 + cM2; S[ 0][ 3] = -cS2; S[ 0][ 4] = -cS1 + cM2; S[ 0][ 5] = cS1; @@ -184,10 +200,14 @@ void ComputeFEMND1(double **S, double F[12], /* The stiffness matrix is symmetric */ for (i = 1; i < 12; i++) for (j = 0; j < i; j++) + { S[i][j] = S[j][i]; + } for (i = 0; i < 12; i++) + { F[i] = h2_4; + } } @@ -227,7 +247,7 @@ int main (int argc, char *argv[]) MPI_Comm_size(MPI_COMM_WORLD, &num_procs); /* Initialize HYPRE */ - HYPRE_Init(); + HYPRE_Initialize(); /* Print GPU info */ /* HYPRE_PrintDeviceInfo(); */ @@ -399,18 +419,18 @@ int main (int argc, char *argv[]) /* Figure out the processor grid (N x N x N). The local problem size is n^3, while pi, pj and pk indicate the position in the processor grid. */ - N = pow(num_procs,1.0/3.0) + 0.5; - if (num_procs != N*N*N) + N = pow(num_procs, 1.0 / 3.0) + 0.5; + if (num_procs != N * N * N) { if (myid == 0) printf("Can't run on %d processors, try %d.\n", - num_procs, N*N*N); + num_procs, N * N * N); MPI_Finalize(); exit(1); } - h = 1.0 / (N*n); - pk = myid / (N*N); - pj = myid/N - pk*N; - pi = myid - pj*N - pk*N*N; + h = 1.0 / (N * n); + pk = myid / (N * N); + pj = myid / N - pk * N; + pi = myid - pj * N - pk * N * N; /* Start timing */ mytime -= MPI_Wtime(); @@ -429,8 +449,8 @@ int main (int argc, char *argv[]) /* Set the extents of the grid - each processor sets its grid boxes. */ { int part = 0; - int ilower[3] = {1 + pi*n, 1 + pj*n, 1 + pk*n}; - int iupper[3] = {n + pi*n, n + pj*n, n + pk*n}; + int ilower[3] = {1 + pi * n, 1 + pj * n, 1 + pk * n}; + int iupper[3] = {n + pi * n, n + pj * n, n + pk * n}; HYPRE_SStructGridSetExtents(node_grid, part, ilower, iupper); HYPRE_SStructGridSetExtents(edge_grid, part, ilower, iupper); @@ -445,7 +465,8 @@ int main (int argc, char *argv[]) HYPRE_SStructVariable nodevars[1] = {HYPRE_SSTRUCT_VARIABLE_NODE}; HYPRE_SStructVariable edgevars[3] = {HYPRE_SSTRUCT_VARIABLE_XEDGE, HYPRE_SSTRUCT_VARIABLE_YEDGE, - HYPRE_SSTRUCT_VARIABLE_ZEDGE}; + HYPRE_SSTRUCT_VARIABLE_ZEDGE + }; for (i = 0; i < nparts; i++) { HYPRE_SStructGridSetVariables(node_grid, i, nnodevars, nodevars); @@ -471,18 +492,21 @@ int main (int argc, char *argv[]) is done by listing the variable offset directions relative to the element's center. See the Reference Manual for more details. */ { - int ordering[48] = { 0, 0, -1, -1, /* x-edge [0]-[1] */ - 1, +1, 0, -1, /* y-edge [1]-[2] */ - /* [7]------[6] */ 0, 0, +1, -1, /* x-edge [3]-[2] */ - /* /| /| */ 1, -1, 0, -1, /* y-edge [0]-[3] */ - /* / | / | */ 0, 0, -1, +1, /* x-edge [4]-[5] */ - /* [4]------[5] | */ 1, +1, 0, +1, /* y-edge [5]-[6] */ - /* | [3]----|-[2] */ 0, 0, +1, +1, /* x-edge [7]-[6] */ - /* | / | / */ 1, -1, 0, +1, /* y-edge [4]-[7] */ - /* |/ |/ */ 2, -1, -1, 0, /* z-edge [0]-[4] */ - /* [0]------[1] */ 2, +1, -1, 0, /* z-edge [1]-[5] */ - 2, +1, +1, 0, /* z-edge [2]-[6] */ - 2, -1, +1, 0 }; /* z-edge [3]-[7] */ + int ordering[48] = + { + 0, 0, -1, -1, /* x-edge [0]-[1] */ + 1, +1, 0, -1, /* y-edge [1]-[2] */ + 0, 0, +1, -1, /* x-edge [3]-[2] [7]------[6] */ + 1, -1, 0, -1, /* y-edge [0]-[3] /| /| */ + 0, 0, -1, +1, /* x-edge [4]-[5] / | / | */ + 1, +1, 0, +1, /* y-edge [5]-[6] [4]------[5] | */ + 0, 0, +1, +1, /* x-edge [7]-[6] | [3]----|-[2] */ + 1, -1, 0, +1, /* y-edge [4]-[7] | / | / */ + 2, -1, -1, 0, /* z-edge [0]-[4] |/ |/ */ + 2, +1, -1, 0, /* z-edge [1]-[5] [0]------[1] */ + 2, +1, +1, 0, /* z-edge [2]-[6] */ + 2, -1, +1, 0 /* z-edge [3]-[7] */ + }; HYPRE_SStructGridSetFEMOrdering(edge_grid, part, ordering); } @@ -531,8 +555,8 @@ int main (int argc, char *argv[]) /* local stiffness matrix and load vector */ /* OK to use constant-length arrays for CPUs */ /* double S[12][12], F[12]; */ - double *F = (double *) malloc(12*sizeof(double)); - double *S_flat = (double *) malloc(12*12*sizeof(double)); + double *F = (double *) malloc(12 * sizeof(double)); + double *S_flat = (double *) malloc(12 * 12 * sizeof(double)); double *S[12]; int i, j, k; @@ -540,7 +564,7 @@ int main (int argc, char *argv[]) for (i = 0; i < 12; i++) { - S[i] = &S_flat[i*12]; + S[i] = &S_flat[i * 12]; } for (i = 1; i <= n; i++) @@ -551,8 +575,11 @@ int main (int argc, char *argv[]) { /* Compute the FEM matrix and r.h.s. for cell (i,j,k) with coefficients evaluated at the cell center. */ - index[0] = i + pi*n; index[1] = j + pj*n; index[2] = k + pk*n; - ComputeFEMND1(S,F,(pi*n+i)*h-h/2,(pj*n+j)*h-h/2,(pk*n+k)*h-h/2,h); + index[0] = i + pi * n; index[1] = j + pj * n; index[2] = k + pk * n; + ComputeFEMND1(S, F, + (pi * n + i)*h - h / 2, + (pj * n + j)*h - h / 2, + (pk * n + k)*h - h / 2, h); /* Eliminate boundary conditions on x = 0 */ if (index[0] == 1) @@ -561,7 +588,9 @@ int main (int argc, char *argv[]) for (ii = 0; ii < 4; ii++) { for (jj = 0; jj < 12; jj++) + { S[bc_edges[ii]][jj] = S[jj][bc_edges[ii]] = 0.0; + } S[bc_edges[ii]][bc_edges[ii]] = 1.0; F[bc_edges[ii]] = 0.0; } @@ -573,7 +602,9 @@ int main (int argc, char *argv[]) for (ii = 0; ii < 4; ii++) { for (jj = 0; jj < 12; jj++) + { S[bc_edges[ii]][jj] = S[jj][bc_edges[ii]] = 0.0; + } S[bc_edges[ii]][bc_edges[ii]] = 1.0; F[bc_edges[ii]] = 0.0; } @@ -585,43 +616,51 @@ int main (int argc, char *argv[]) for (ii = 0; ii < 4; ii++) { for (jj = 0; jj < 12; jj++) + { S[bc_edges[ii]][jj] = S[jj][bc_edges[ii]] = 0.0; + } S[bc_edges[ii]][bc_edges[ii]] = 1.0; F[bc_edges[ii]] = 0.0; } } /* Eliminate boundary conditions on x = 1 */ - if (index[0] == N*n) + if (index[0] == N * n) { int ii, jj, bc_edges[4] = { 1, 10, 5, 9 }; for (ii = 0; ii < 4; ii++) { for (jj = 0; jj < 12; jj++) + { S[bc_edges[ii]][jj] = S[jj][bc_edges[ii]] = 0.0; + } S[bc_edges[ii]][bc_edges[ii]] = 1.0; F[bc_edges[ii]] = 0.0; } } /* Eliminate boundary conditions on y = 1 */ - if (index[1] == N*n) + if (index[1] == N * n) { int ii, jj, bc_edges[4] = { 2, 10, 6, 11 }; for (ii = 0; ii < 4; ii++) { for (jj = 0; jj < 12; jj++) + { S[bc_edges[ii]][jj] = S[jj][bc_edges[ii]] = 0.0; + } S[bc_edges[ii]][bc_edges[ii]] = 1.0; F[bc_edges[ii]] = 0.0; } } /* Eliminate boundary conditions on z = 1 */ - if (index[2] == N*n) + if (index[2] == N * n) { int ii, jj, bc_edges[4] = { 4, 5, 6, 7 }; for (ii = 0; ii < 4; ii++) { for (jj = 0; jj < 12; jj++) + { S[bc_edges[ii]][jj] = S[jj][bc_edges[ii]] = 0.0; + } S[bc_edges[ii]][bc_edges[ii]] = 1.0; F[bc_edges[ii]] = 0.0; } @@ -657,9 +696,9 @@ int main (int argc, char *argv[]) int var = 0; /* the node variable */ /* The discrete gradient stencils connect edge to node variables. */ - int Gx_offsets[2][3] = {{-1,0,0},{0,0,0}}; /* x-edge [7]-[6] */ - int Gy_offsets[2][3] = {{0,-1,0},{0,0,0}}; /* y-edge [5]-[6] */ - int Gz_offsets[2][3] = {{0,0,-1},{0,0,0}}; /* z-edge [2]-[6] */ + int Gx_offsets[2][3] = {{-1, 0, 0}, {0, 0, 0}}; /* x-edge [7]-[6] */ + int Gy_offsets[2][3] = {{0, -1, 0}, {0, 0, 0}}; /* y-edge [5]-[6] */ + int Gz_offsets[2][3] = {{0, 0, -1}, {0, 0, 0}}; /* z-edge [2]-[6] */ HYPRE_SStructStencilCreate(ndim, stencil_size, &G_stencil[0]); HYPRE_SStructStencilCreate(ndim, stencil_size, &G_stencil[1]); @@ -692,7 +731,9 @@ int main (int argc, char *argv[]) /* Tell the graph which stencil to use for each edge variable on each part (we only have one part). */ for (var = 0; var < nvars; var++) + { HYPRE_SStructGraphSetStencil(G_graph, part, var, G_stencil[var]); + } /* Assemble the graph */ HYPRE_SStructGraphAssemble(G_graph); @@ -712,24 +753,24 @@ int main (int argc, char *argv[]) the edges (i.e. one in agreement with the coordinate directions). */ { int i; - int nedges = n*(n+1)*(n+1); + int nedges = n * (n + 1) * (n + 1); double *values; - int stencil_indices[2] = {0,1}; /* the nodes of each edge */ + int stencil_indices[2] = {0, 1}; /* the nodes of each edge */ - values = (double*) calloc(2*nedges, sizeof(double)); + values = (double*) calloc(2 * nedges, sizeof(double)); /* The edge orientation is fixed: from first to second node */ for (i = 0; i < nedges; i++) { - values[2*i] = -1.0; - values[2*i+1] = 1.0; + values[2 * i] = -1.0; + values[2 * i + 1] = 1.0; } /* Set the values in the discrete gradient x-edges */ { int var = 0; - int ilower[3] = {1 + pi*n, 0 + pj*n, 0 + pk*n}; - int iupper[3] = {n + pi*n, n + pj*n, n + pk*n}; + int ilower[3] = {1 + pi * n, 0 + pj * n, 0 + pk * n}; + int iupper[3] = {n + pi * n, n + pj * n, n + pk * n}; HYPRE_SStructMatrixSetBoxValues(G, part, ilower, iupper, var, stencil_size, stencil_indices, values); @@ -737,8 +778,8 @@ int main (int argc, char *argv[]) /* Set the values in the discrete gradient y-edges */ { int var = 1; - int ilower[3] = {0 + pi*n, 1 + pj*n, 0 + pk*n}; - int iupper[3] = {n + pi*n, n + pj*n, n + pk*n}; + int ilower[3] = {0 + pi * n, 1 + pj * n, 0 + pk * n}; + int iupper[3] = {n + pi * n, n + pj * n, n + pk * n}; HYPRE_SStructMatrixSetBoxValues(G, part, ilower, iupper, var, stencil_size, stencil_indices, values); @@ -746,8 +787,8 @@ int main (int argc, char *argv[]) /* Set the values in the discrete gradient z-edges */ { int var = 2; - int ilower[3] = {0 + pi*n, 0 + pj*n, 1 + pk*n}; - int iupper[3] = {n + pi*n, n + pj*n, n + pk*n}; + int ilower[3] = {0 + pi * n, 0 + pj * n, 1 + pk * n}; + int iupper[3] = {n + pi * n, n + pj * n, n + pk * n}; HYPRE_SStructMatrixSetBoxValues(G, part, ilower, iupper, var, stencil_size, stencil_indices, values); @@ -767,7 +808,7 @@ int main (int argc, char *argv[]) int part = 0; int var = 0; /* the node variable */ int index[3]; - double *xyzval = (double *) malloc(3*sizeof(double)); + double *xyzval = (double *) malloc(3 * sizeof(double)); /* Create empty vector objects */ HYPRE_SStructVectorCreate(MPI_COMM_WORLD, node_grid, &xcoord); @@ -787,11 +828,11 @@ int main (int argc, char *argv[]) for (j = 0; j <= n; j++) for (k = 0; k <= n; k++) { - index[0] = i + pi*n; index[1] = j + pj*n; index[2] = k + pk*n; + index[0] = i + pi * n; index[1] = j + pj * n; index[2] = k + pk * n; - xyzval[0] = index[0]*h; - xyzval[1] = index[1]*h; - xyzval[2] = index[2]*h; + xyzval[0] = index[0] * h; + xyzval[1] = index[1] * h; + xyzval[2] = index[2] * h; HYPRE_SStructVectorSetValues(xcoord, part, index, var, &xyzval[0]); HYPRE_SStructVectorSetValues(ycoord, part, index, var, &xyzval[1]); @@ -808,7 +849,7 @@ int main (int argc, char *argv[]) /* 5. Set up a SStruct Vector for the solution vector x */ { int part = 0; - int nvalues = n*(n+1)*(n+1); + int nvalues = n * (n + 1) * (n + 1); double *values; values = (double*) calloc(nvalues, sizeof(double)); @@ -823,22 +864,22 @@ int main (int argc, char *argv[]) /* Set the values for the initial guess x-edge */ { int var = 0; - int ilower[3] = {1 + pi*n, 0 + pj*n, 0 + pk*n}; - int iupper[3] = {n + pi*n, n + pj*n, n + pk*n}; + int ilower[3] = {1 + pi * n, 0 + pj * n, 0 + pk * n}; + int iupper[3] = {n + pi * n, n + pj * n, n + pk * n}; HYPRE_SStructVectorSetBoxValues(x, part, ilower, iupper, var, values); } /* Set the values for the initial guess y-edge */ { int var = 1; - int ilower[3] = {0 + pi*n, 1 + pj*n, 0 + pk*n}; - int iupper[3] = {n + pi*n, n + pj*n, n + pk*n}; + int ilower[3] = {0 + pi * n, 1 + pj * n, 0 + pk * n}; + int iupper[3] = {n + pi * n, n + pj * n, n + pk * n}; HYPRE_SStructVectorSetBoxValues(x, part, ilower, iupper, var, values); } /* Set the values for the initial guess z-edge */ { int var = 2; - int ilower[3] = {0 + pi*n, 0 + pj*n, 1 + pk*n}; - int iupper[3] = {n + pi*n, n + pj*n, n + pk*n}; + int ilower[3] = {0 + pi * n, 0 + pj * n, 1 + pk * n}; + int iupper[3] = {n + pi * n, n + pj * n, n + pk * n}; HYPRE_SStructVectorSetBoxValues(x, part, ilower, iupper, var, values); } @@ -917,7 +958,9 @@ int main (int argc, char *argv[]) par_xcoord, par_ycoord, par_zcoord); if (singular_problem) + { HYPRE_AMSSetBetaPoissonMatrix(precond, NULL); + } /* Smoothing and AMG options */ HYPRE_AMSSetSmoothingOptions(precond, @@ -982,7 +1025,7 @@ int main (int argc, char *argv[]) char filename[255]; int part = 0; - int nvalues = n*(n+1)*(n+1); + int nvalues = n * (n + 1) * (n + 1); double *xvalues, *yvalues, *zvalues; xvalues = (double*) calloc(nvalues, sizeof(double)); @@ -992,24 +1035,24 @@ int main (int argc, char *argv[]) /* Get local solution in the x-edges */ { int var = 0; - int ilower[3] = {1 + pi*n, 0 + pj*n, 0 + pk*n}; - int iupper[3] = {n + pi*n, n + pj*n, n + pk*n}; + int ilower[3] = {1 + pi * n, 0 + pj * n, 0 + pk * n}; + int iupper[3] = {n + pi * n, n + pj * n, n + pk * n}; HYPRE_SStructVectorGetBoxValues(x, part, ilower, iupper, var, xvalues); } /* Get local solution in the y-edges */ { int var = 1; - int ilower[3] = {0 + pi*n, 1 + pj*n, 0 + pk*n}; - int iupper[3] = {n + pi*n, n + pj*n, n + pk*n}; + int ilower[3] = {0 + pi * n, 1 + pj * n, 0 + pk * n}; + int iupper[3] = {n + pi * n, n + pj * n, n + pk * n}; HYPRE_SStructVectorGetBoxValues(x, part, ilower, iupper, var, yvalues); } /* Get local solution in the z-edges */ { int var = 2; - int ilower[3] = {0 + pi*n, 0 + pj*n, 1 + pk*n}; - int iupper[3] = {n + pi*n, n + pj*n, n + pk*n}; + int ilower[3] = {0 + pi * n, 0 + pj * n, 1 + pk * n}; + int iupper[3] = {n + pi * n, n + pj * n, n + pk * n}; HYPRE_SStructVectorGetBoxValues(x, part, ilower, iupper, var, zvalues); } @@ -1034,9 +1077,9 @@ int main (int argc, char *argv[]) int i, j, k, s; /* Initial x-, y- and z-edge indices in the values arrays */ - int oi[4] = { 0, n, n*(n+1), n*(n+1)+n }; /* e_0, e_2, e_4, e_6 */ - int oj[4] = { 0, 1, n*(n+1), n*(n+1)+1 }; /* e_3, e_1, e_7, e_5 */ - int ok[4] = { 0, 1, n+1, n+2 }; /* e_8, e_9, e_11, e_10 */ + int oi[4] = { 0, n, n*(n + 1), n*(n + 1) + n }; /* e_0, e_2, e_4, e_6 */ + int oj[4] = { 0, 1, n*(n + 1), n*(n + 1) + 1 }; /* e_3, e_1, e_7, e_5 */ + int ok[4] = { 0, 1, n + 1, n + 2 }; /* e_8, e_9, e_11, e_10 */ /* Loop over the cells while updating the above offsets */ for (k = 0; k < n; k++) { @@ -1052,11 +1095,11 @@ int main (int argc, char *argv[]) xvalues[oi[2]], yvalues[oj[3]], xvalues[oi[3]], yvalues[oj[2]], zvalues[ok[0]], zvalues[ok[1]], zvalues[ok[3]], zvalues[ok[2]]); - for (s=0; s<4; s++) oi[s]++, oj[s]++, ok[s]++; + for (s = 0; s < 4; s++) { oi[s]++, oj[s]++, ok[s]++; } } - for (s=0; s<4; s++) oj[s]++, ok[s]++; + for (s = 0; s < 4; s++) { oj[s]++, ok[s]++; } } - for (s=0; s<4; s++) oi[s]+=n, ok[s]+=n+1; + for (s = 0; s < 4; s++) { oi[s] += n, ok[s] += n + 1; } } } @@ -1068,7 +1111,7 @@ int main (int argc, char *argv[]) /* Save local finite element mesh */ GLVis_PrintLocalCubicMesh("vis/ex15.mesh", n, n, n, h, - pi*h*n, pj*h*n, pk*h*n, myid); + pi * h * n, pj * h * n, pk * h * n, myid); /* Additional visualization data */ GLVis_PrintData("vis/ex15.data", myid, num_procs); diff --git a/external/hypre/src/examples/ex15big.c b/external/hypre/src/examples/ex15big.c index 7d24d082..6c1301c0 100644 --- a/external/hypre/src/examples/ex15big.c +++ b/external/hypre/src/examples/ex15big.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -53,19 +53,27 @@ double alpha(double x, double y, double z) case 0: /* uniform coefficient */ return 1.0; case 1: /* smooth coefficient */ - return x*x+exp(y)+sin(z); + return x * x + exp(y) + sin(z); case 2: /* small outside of an interior cube */ - if ((fabs(x-0.5) < 0.25) && (fabs(y-0.5) < 0.25) && (fabs(z-0.5) < 0.25)) + if ((fabs(x - 0.5) < 0.25) && (fabs(y - 0.5) < 0.25) && (fabs(z - 0.5) < 0.25)) + { return 1.0; + } else + { return 1.0e-6; + } case 3: /* small outside of an interior ball */ - if (((x-0.5)*(x-0.5)+(y-0.5)*(y-0.5)+(z-0.5)*(z-0.5)) < 0.0625) + if (((x - 0.5) * (x - 0.5) + (y - 0.5) * (y - 0.5) + (z - 0.5) * (z - 0.5)) < 0.0625) + { return 1.0; + } else + { return 1.0e-6; + } case 4: /* random coefficient */ - return ((double)rand()/RAND_MAX); + return ((double)rand() / RAND_MAX); default: return 1.0; } @@ -79,19 +87,27 @@ double beta(double x, double y, double z) case 0: /* uniform coefficient */ return 1.0; case 1: /* smooth coefficient */ - return x*x+exp(y)+sin(z); + return x * x + exp(y) + sin(z); case 2:/* small outside of interior cube */ - if ((fabs(x-0.5) < 0.25) && (fabs(y-0.5) < 0.25) && (fabs(z-0.5) < 0.25)) + if ((fabs(x - 0.5) < 0.25) && (fabs(y - 0.5) < 0.25) && (fabs(z - 0.5) < 0.25)) + { return 1.0; + } else + { return 1.0e-6; + } case 3: /* small outside of an interior ball */ - if (((x-0.5)*(x-0.5)+(y-0.5)*(y-0.5)+(z-0.5)*(z-0.5)) < 0.0625) + if (((x - 0.5) * (x - 0.5) + (y - 0.5) * (y - 0.5) + (z - 0.5) * (z - 0.5)) < 0.0625) + { return 1.0; + } else + { return 1.0e-6; + } case 4: /* random coefficient */ - return ((double)rand()/RAND_MAX); + return ((double)rand() / RAND_MAX); default: return 1.0; } @@ -125,10 +141,10 @@ void ComputeFEMND1(double S[12][12], double F[12], { int i, j; - double h2_4 = h*h/4; + double h2_4 = h * h / 4; - double cS1 = alpha(x,y,z)/(6.0*h), cS2 = 2*cS1, cS4 = 2*cS2; - double cM1 = beta(x,y,z)*h/36.0, cM2 = 2*cM1, cM4 = 2*cM2; + double cS1 = alpha(x, y, z) / (6.0 * h), cS2 = 2 * cS1, cS4 = 2 * cS2; + double cM1 = beta(x, y, z) * h / 36.0, cM2 = 2 * cM1, cM4 = 2 * cM2; S[ 0][ 0] = cS4 + cM4; S[ 0][ 1] = cS2; S[ 0][ 2] = -cS1 + cM2; S[ 0][ 3] = -cS2; S[ 0][ 4] = -cS1 + cM2; S[ 0][ 5] = cS1; @@ -175,10 +191,14 @@ void ComputeFEMND1(double S[12][12], double F[12], /* The stiffness matrix is symmetric */ for (i = 1; i < 12; i++) for (j = 0; j < i; j++) + { S[i][j] = S[j][i]; + } for (i = 0; i < 12; i++) + { F[i] = h2_4; + } } @@ -217,7 +237,7 @@ int main (int argc, char *argv[]) MPI_Comm_size(MPI_COMM_WORLD, &num_procs); /* Initialize HYPRE */ - HYPRE_Init(); + HYPRE_Initialize(); /* Print GPU info */ /* HYPRE_PrintDeviceInfo(); */ @@ -382,18 +402,18 @@ int main (int argc, char *argv[]) /* Figure out the processor grid (N x N x N). The local problem size is n^3, while pi, pj and pk indicate the position in the processor grid. */ - N = pow(num_procs,1.0/3.0) + 0.5; - if (num_procs != N*N*N) + N = pow(num_procs, 1.0 / 3.0) + 0.5; + if (num_procs != N * N * N) { if (myid == 0) printf("Can't run on %d processors, try %d.\n", - num_procs, N*N*N); + num_procs, N * N * N); MPI_Finalize(); exit(1); } - h = 1.0 / (N*n); - pk = myid / (N*N); - pj = myid/N - pk*N; - pi = myid - pj*N - pk*N*N; + h = 1.0 / (N * n); + pk = myid / (N * N); + pj = myid / N - pk * N; + pi = myid - pj * N - pk * N * N; /* Start timing */ mytime -= MPI_Wtime(); @@ -412,8 +432,8 @@ int main (int argc, char *argv[]) /* Set the extents of the grid - each processor sets its grid boxes. */ { HYPRE_Int part = 0; - HYPRE_Int ilower[3] = {1 + pi*n, 1 + pj*n, 1 + pk*n}; - HYPRE_Int iupper[3] = {n + pi*n, n + pj*n, n + pk*n}; + HYPRE_Int ilower[3] = {1 + pi * n, 1 + pj * n, 1 + pk * n}; + HYPRE_Int iupper[3] = {n + pi * n, n + pj * n, n + pk * n}; HYPRE_SStructGridSetExtents(node_grid, part, ilower, iupper); HYPRE_SStructGridSetExtents(edge_grid, part, ilower, iupper); @@ -428,7 +448,8 @@ int main (int argc, char *argv[]) HYPRE_SStructVariable nodevars[1] = {HYPRE_SSTRUCT_VARIABLE_NODE}; HYPRE_SStructVariable edgevars[3] = {HYPRE_SSTRUCT_VARIABLE_XEDGE, HYPRE_SSTRUCT_VARIABLE_YEDGE, - HYPRE_SSTRUCT_VARIABLE_ZEDGE}; + HYPRE_SSTRUCT_VARIABLE_ZEDGE + }; for (i = 0; i < nparts; i++) { HYPRE_SStructGridSetVariables(node_grid, i, nnodevars, nodevars); @@ -454,18 +475,21 @@ int main (int argc, char *argv[]) is done by listing the variable offset directions relative to the element's center. See the Reference Manual for more details. */ { - HYPRE_Int ordering[48] = { 0, 0, -1, -1, /* x-edge [0]-[1] */ - 1, +1, 0, -1, /* y-edge [1]-[2] */ - /* [7]------[6] */ 0, 0, +1, -1, /* x-edge [3]-[2] */ - /* /| /| */ 1, -1, 0, -1, /* y-edge [0]-[3] */ - /* / | / | */ 0, 0, -1, +1, /* x-edge [4]-[5] */ - /* [4]------[5] | */ 1, +1, 0, +1, /* y-edge [5]-[6] */ - /* | [3]----|-[2] */ 0, 0, +1, +1, /* x-edge [7]-[6] */ - /* | / | / */ 1, -1, 0, +1, /* y-edge [4]-[7] */ - /* |/ |/ */ 2, -1, -1, 0, /* z-edge [0]-[4] */ - /* [0]------[1] */ 2, +1, -1, 0, /* z-edge [1]-[5] */ - 2, +1, +1, 0, /* z-edge [2]-[6] */ - 2, -1, +1, 0 }; /* z-edge [3]-[7] */ + HYPRE_Int ordering[48] = + { + 0, 0, -1, -1, /* x-edge [0]-[1] */ + 1, +1, 0, -1, /* y-edge [1]-[2] */ + 0, 0, +1, -1, /* x-edge [3]-[2] [7]------[6] */ + 1, -1, 0, -1, /* y-edge [0]-[3] /| /| */ + 0, 0, -1, +1, /* x-edge [4]-[5] / | / | */ + 1, +1, 0, +1, /* y-edge [5]-[6] [4]------[5] | */ + 0, 0, +1, +1, /* x-edge [7]-[6] | [3]----|-[2] */ + 1, -1, 0, +1, /* y-edge [4]-[7] | / | / */ + 2, -1, -1, 0, /* z-edge [0]-[4] |/ |/ */ + 2, +1, -1, 0, /* z-edge [1]-[5] [0]------[1] */ + 2, +1, +1, 0, /* z-edge [2]-[6] */ + 2, -1, +1, 0 /* z-edge [3]-[7] */ + }; HYPRE_SStructGridSetFEMOrdering(edge_grid, part, ordering); } @@ -523,8 +547,11 @@ int main (int argc, char *argv[]) { /* Compute the FEM matrix and r.h.s. for cell (i,j,k) with coefficients evaluated at the cell center. */ - index[0] = i + pi*n; index[1] = j + pj*n; index[2] = k + pk*n; - ComputeFEMND1(S,F,(pi*n+i)*h-h/2,(pj*n+j)*h-h/2,(pk*n+k)*h-h/2,h); + index[0] = i + pi * n; index[1] = j + pj * n; index[2] = k + pk * n; + ComputeFEMND1(S, F, + (pi * n + i)*h - h / 2, + (pj * n + j)*h - h / 2, + (pk * n + k)*h - h / 2, h); /* Eliminate boundary conditions on x = 0 */ if (index[0] == 1) @@ -533,7 +560,9 @@ int main (int argc, char *argv[]) for (ii = 0; ii < 4; ii++) { for (jj = 0; jj < 12; jj++) + { S[bc_edges[ii]][jj] = S[jj][bc_edges[ii]] = 0.0; + } S[bc_edges[ii]][bc_edges[ii]] = 1.0; F[bc_edges[ii]] = 0.0; } @@ -545,7 +574,9 @@ int main (int argc, char *argv[]) for (ii = 0; ii < 4; ii++) { for (jj = 0; jj < 12; jj++) + { S[bc_edges[ii]][jj] = S[jj][bc_edges[ii]] = 0.0; + } S[bc_edges[ii]][bc_edges[ii]] = 1.0; F[bc_edges[ii]] = 0.0; } @@ -557,43 +588,51 @@ int main (int argc, char *argv[]) for (ii = 0; ii < 4; ii++) { for (jj = 0; jj < 12; jj++) + { S[bc_edges[ii]][jj] = S[jj][bc_edges[ii]] = 0.0; + } S[bc_edges[ii]][bc_edges[ii]] = 1.0; F[bc_edges[ii]] = 0.0; } } /* Eliminate boundary conditions on x = 1 */ - if (index[0] == N*n) + if (index[0] == N * n) { int ii, jj, bc_edges[4] = { 1, 10, 5, 9 }; for (ii = 0; ii < 4; ii++) { for (jj = 0; jj < 12; jj++) + { S[bc_edges[ii]][jj] = S[jj][bc_edges[ii]] = 0.0; + } S[bc_edges[ii]][bc_edges[ii]] = 1.0; F[bc_edges[ii]] = 0.0; } } /* Eliminate boundary conditions on y = 1 */ - if (index[1] == N*n) + if (index[1] == N * n) { int ii, jj, bc_edges[4] = { 2, 10, 6, 11 }; for (ii = 0; ii < 4; ii++) { for (jj = 0; jj < 12; jj++) + { S[bc_edges[ii]][jj] = S[jj][bc_edges[ii]] = 0.0; + } S[bc_edges[ii]][bc_edges[ii]] = 1.0; F[bc_edges[ii]] = 0.0; } } /* Eliminate boundary conditions on z = 1 */ - if (index[2] == N*n) + if (index[2] == N * n) { int ii, jj, bc_edges[4] = { 4, 5, 6, 7 }; for (ii = 0; ii < 4; ii++) { for (jj = 0; jj < 12; jj++) + { S[bc_edges[ii]][jj] = S[jj][bc_edges[ii]] = 0.0; + } S[bc_edges[ii]][bc_edges[ii]] = 1.0; F[bc_edges[ii]] = 0.0; } @@ -625,9 +664,9 @@ int main (int argc, char *argv[]) HYPRE_Int var = 0; /* the node variable */ /* The discrete gradient stencils connect edge to node variables. */ - HYPRE_Int Gx_offsets[2][3] = {{-1,0,0},{0,0,0}}; /* x-edge [7]-[6] */ - HYPRE_Int Gy_offsets[2][3] = {{0,-1,0},{0,0,0}}; /* y-edge [5]-[6] */ - HYPRE_Int Gz_offsets[2][3] = {{0,0,-1},{0,0,0}}; /* z-edge [2]-[6] */ + HYPRE_Int Gx_offsets[2][3] = {{-1, 0, 0}, {0, 0, 0}}; /* x-edge [7]-[6] */ + HYPRE_Int Gy_offsets[2][3] = {{0, -1, 0}, {0, 0, 0}}; /* y-edge [5]-[6] */ + HYPRE_Int Gz_offsets[2][3] = {{0, 0, -1}, {0, 0, 0}}; /* z-edge [2]-[6] */ HYPRE_SStructStencilCreate(ndim, stencil_size, &G_stencil[0]); HYPRE_SStructStencilCreate(ndim, stencil_size, &G_stencil[1]); @@ -660,7 +699,9 @@ int main (int argc, char *argv[]) /* Tell the graph which stencil to use for each edge variable on each part (we only have one part). */ for (var = 0; var < nvars; var++) + { HYPRE_SStructGraphSetStencil(G_graph, part, var, G_stencil[var]); + } /* Assemble the graph */ HYPRE_SStructGraphAssemble(G_graph); @@ -680,24 +721,24 @@ int main (int argc, char *argv[]) the edges (i.e. one in agreement with the coordinate directions). */ { int i; - int nedges = n*(n+1)*(n+1); + int nedges = n * (n + 1) * (n + 1); double *values; - HYPRE_Int stencil_indices[2] = {0,1}; /* the nodes of each edge */ + HYPRE_Int stencil_indices[2] = {0, 1}; /* the nodes of each edge */ - values = (double*) calloc(2*nedges, sizeof(double)); + values = (double*) calloc(2 * nedges, sizeof(double)); /* The edge orientation is fixed: from first to second node */ for (i = 0; i < nedges; i++) { - values[2*i] = -1.0; - values[2*i+1] = 1.0; + values[2 * i] = -1.0; + values[2 * i + 1] = 1.0; } /* Set the values in the discrete gradient x-edges */ { HYPRE_Int var = 0; - HYPRE_Int ilower[3] = {1 + pi*n, 0 + pj*n, 0 + pk*n}; - HYPRE_Int iupper[3] = {n + pi*n, n + pj*n, n + pk*n}; + HYPRE_Int ilower[3] = {1 + pi * n, 0 + pj * n, 0 + pk * n}; + HYPRE_Int iupper[3] = {n + pi * n, n + pj * n, n + pk * n}; HYPRE_SStructMatrixSetBoxValues(G, part, ilower, iupper, var, stencil_size, stencil_indices, values); @@ -705,8 +746,8 @@ int main (int argc, char *argv[]) /* Set the values in the discrete gradient y-edges */ { HYPRE_Int var = 1; - HYPRE_Int ilower[3] = {0 + pi*n, 1 + pj*n, 0 + pk*n}; - HYPRE_Int iupper[3] = {n + pi*n, n + pj*n, n + pk*n}; + HYPRE_Int ilower[3] = {0 + pi * n, 1 + pj * n, 0 + pk * n}; + HYPRE_Int iupper[3] = {n + pi * n, n + pj * n, n + pk * n}; HYPRE_SStructMatrixSetBoxValues(G, part, ilower, iupper, var, stencil_size, stencil_indices, values); @@ -714,8 +755,8 @@ int main (int argc, char *argv[]) /* Set the values in the discrete gradient z-edges */ { HYPRE_Int var = 2; - HYPRE_Int ilower[3] = {0 + pi*n, 0 + pj*n, 1 + pk*n}; - HYPRE_Int iupper[3] = {n + pi*n, n + pj*n, n + pk*n}; + HYPRE_Int ilower[3] = {0 + pi * n, 0 + pj * n, 1 + pk * n}; + HYPRE_Int iupper[3] = {n + pi * n, n + pj * n, n + pk * n}; HYPRE_SStructMatrixSetBoxValues(G, part, ilower, iupper, var, stencil_size, stencil_indices, values); @@ -755,11 +796,11 @@ int main (int argc, char *argv[]) for (j = 0; j <= n; j++) for (k = 0; k <= n; k++) { - index[0] = i + pi*n; index[1] = j + pj*n; index[2] = k + pk*n; + index[0] = i + pi * n; index[1] = j + pj * n; index[2] = k + pk * n; - xval = index[0]*h; - yval = index[1]*h; - zval = index[2]*h; + xval = index[0] * h; + yval = index[1] * h; + zval = index[2] * h; HYPRE_SStructVectorSetValues(xcoord, part, index, var, &xval); HYPRE_SStructVectorSetValues(ycoord, part, index, var, &yval); @@ -775,7 +816,7 @@ int main (int argc, char *argv[]) /* 5. Set up a SStruct Vector for the solution vector x */ { HYPRE_Int part = 0; - int nvalues = n*(n+1)*(n+1); + int nvalues = n * (n + 1) * (n + 1); double *values; values = (double*) calloc(nvalues, sizeof(double)); @@ -790,22 +831,22 @@ int main (int argc, char *argv[]) /* Set the values for the initial guess x-edge */ { HYPRE_Int var = 0; - HYPRE_Int ilower[3] = {1 + pi*n, 0 + pj*n, 0 + pk*n}; - HYPRE_Int iupper[3] = {n + pi*n, n + pj*n, n + pk*n}; + HYPRE_Int ilower[3] = {1 + pi * n, 0 + pj * n, 0 + pk * n}; + HYPRE_Int iupper[3] = {n + pi * n, n + pj * n, n + pk * n}; HYPRE_SStructVectorSetBoxValues(x, part, ilower, iupper, var, values); } /* Set the values for the initial guess y-edge */ { HYPRE_Int var = 1; - HYPRE_Int ilower[3] = {0 + pi*n, 1 + pj*n, 0 + pk*n}; - HYPRE_Int iupper[3] = {n + pi*n, n + pj*n, n + pk*n}; + HYPRE_Int ilower[3] = {0 + pi * n, 1 + pj * n, 0 + pk * n}; + HYPRE_Int iupper[3] = {n + pi * n, n + pj * n, n + pk * n}; HYPRE_SStructVectorSetBoxValues(x, part, ilower, iupper, var, values); } /* Set the values for the initial guess z-edge */ { HYPRE_Int var = 2; - HYPRE_Int ilower[3] = {0 + pi*n, 0 + pj*n, 1 + pk*n}; - HYPRE_Int iupper[3] = {n + pi*n, n + pj*n, n + pk*n}; + HYPRE_Int ilower[3] = {0 + pi * n, 0 + pj * n, 1 + pk * n}; + HYPRE_Int iupper[3] = {n + pi * n, n + pj * n, n + pk * n}; HYPRE_SStructVectorSetBoxValues(x, part, ilower, iupper, var, values); } @@ -884,7 +925,9 @@ int main (int argc, char *argv[]) par_xcoord, par_ycoord, par_zcoord); if (singular_problem) + { HYPRE_AMSSetBetaPoissonMatrix(precond, NULL); + } /* Smoothing and AMG options */ HYPRE_AMSSetSmoothingOptions(precond, diff --git a/external/hypre/src/examples/ex16.c b/external/hypre/src/examples/ex16.c index 5ddd3635..02a7cbb7 100644 --- a/external/hypre/src/examples/ex16.c +++ b/external/hypre/src/examples/ex16.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -53,181 +53,183 @@ void ComputeFEMQ3 (double S[16][16], double F[16], double h) { int i, j; - double s = 1.0/33600; - double h2_64 = h*h/64; - - S[ 0][ 0] = 18944*s; - S[ 0][ 1] = -4770*s; - S[ 0][ 2] = 792*s; - S[ 0][ 3] = 574*s; - S[ 0][ 4] = -4770*s; - S[ 0][ 5] = -18711*s; - S[ 0][ 6] = 6075*s; - S[ 0][ 7] = -2439*s; - S[ 0][ 8] = 792*s; - S[ 0][ 9] = 6075*s; - S[ 0][10] = -1944*s; - S[ 0][11] = 747*s; - S[ 0][12] = 574*s; - S[ 0][13] = -2439*s; - S[ 0][14] = 747*s; - S[ 0][15] = -247*s; - - S[ 1][ 1] = 75600*s; - S[ 1][ 2] = -25002*s; - S[ 1][ 3] = 792*s; - S[ 1][ 4] = -18711*s; - S[ 1][ 5] = -39852*s; - S[ 1][ 6] = -7047*s; - S[ 1][ 7] = 6075*s; - S[ 1][ 8] = 6075*s; - S[ 1][ 9] = 9720*s; - S[ 1][10] = 3159*s; - S[ 1][11] = -1944*s; - S[ 1][12] = -2439*s; - S[ 1][13] = -108*s; - S[ 1][14] = -2295*s; - S[ 1][15] = 747*s; - - S[ 2][ 2] = 75600*s; - S[ 2][ 3] = -4770*s; - S[ 2][ 4] = 6075*s; - S[ 2][ 5] = -7047*s; - S[ 2][ 6] = -39852*s; - S[ 2][ 7] = -18711*s; - S[ 2][ 8] = -1944*s; - S[ 2][ 9] = 3159*s; - S[ 2][10] = 9720*s; - S[ 2][11] = 6075*s; - S[ 2][12] = 747*s; - S[ 2][13] = -2295*s; - S[ 2][14] = -108*s; - S[ 2][15] = -2439*s; - - S[ 3][ 3] = 18944*s; - S[ 3][ 4] = -2439*s; - S[ 3][ 5] = 6075*s; - S[ 3][ 6] = -18711*s; - S[ 3][ 7] = -4770*s; - S[ 3][ 8] = 747*s; - S[ 3][ 9] = -1944*s; - S[ 3][10] = 6075*s; - S[ 3][11] = 792*s; - S[ 3][12] = -247*s; - S[ 3][13] = 747*s; - S[ 3][14] = -2439*s; - S[ 3][15] = 574*s; - - S[ 4][ 4] = 75600*s; - S[ 4][ 5] = -39852*s; - S[ 4][ 6] = 9720*s; - S[ 4][ 7] = -108*s; - S[ 4][ 8] = -25002*s; - S[ 4][ 9] = -7047*s; - S[ 4][10] = 3159*s; - S[ 4][11] = -2295*s; - S[ 4][12] = 792*s; - S[ 4][13] = 6075*s; - S[ 4][14] = -1944*s; - S[ 4][15] = 747*s; - - S[ 5][ 5] = 279936*s; - S[ 5][ 6] = -113724*s; - S[ 5][ 7] = 9720*s; - S[ 5][ 8] = -7047*s; - S[ 5][ 9] = -113724*s; - S[ 5][10] = 24057*s; - S[ 5][11] = 3159*s; - S[ 5][12] = 6075*s; - S[ 5][13] = 9720*s; - S[ 5][14] = 3159*s; - S[ 5][15] = -1944*s; - - S[ 6][ 6] = 279936*s; - S[ 6][ 7] = -39852*s; - S[ 6][ 8] = 3159*s; - S[ 6][ 9] = 24057*s; - S[ 6][10] = -113724*s; - S[ 6][11] = -7047*s; - S[ 6][12] = -1944*s; - S[ 6][13] = 3159*s; - S[ 6][14] = 9720*s; - S[ 6][15] = 6075*s; - - S[ 7][ 7] = 75600*s; - S[ 7][ 8] = -2295*s; - S[ 7][ 9] = 3159*s; - S[ 7][10] = -7047*s; - S[ 7][11] = -25002*s; - S[ 7][12] = 747*s; - S[ 7][13] = -1944*s; - S[ 7][14] = 6075*s; - S[ 7][15] = 792*s; - - S[ 8][ 8] = 75600*s; - S[ 8][ 9] = -39852*s; - S[ 8][10] = 9720*s; - S[ 8][11] = -108*s; - S[ 8][12] = -4770*s; - S[ 8][13] = -18711*s; - S[ 8][14] = 6075*s; - S[ 8][15] = -2439*s; - - S[ 9][ 9] = 279936*s; - S[ 9][10] = -113724*s; - S[ 9][11] = 9720*s; - S[ 9][12] = -18711*s; - S[ 9][13] = -39852*s; - S[ 9][14] = -7047*s; - S[ 9][15] = 6075*s; - - S[10][10] = 279936*s; - S[10][11] = -39852*s; - S[10][12] = 6075*s; - S[10][13] = -7047*s; - S[10][14] = -39852*s; - S[10][15] = -18711*s; - - S[11][11] = 75600*s; - S[11][12] = -2439*s; - S[11][13] = 6075*s; - S[11][14] = -18711*s; - S[11][15] = -4770*s; - - S[12][12] = 18944*s; - S[12][13] = -4770*s; - S[12][14] = 792*s; - S[12][15] = 574*s; - - S[13][13] = 75600*s; - S[13][14] = -25002*s; - S[13][15] = 792*s; - - S[14][14] = 75600*s; - S[14][15] = -4770*s; - - S[15][15] = 18944*s; + double s = 1.0 / 33600; + double h2_64 = h * h / 64; + + S[ 0][ 0] = 18944 * s; + S[ 0][ 1] = -4770 * s; + S[ 0][ 2] = 792 * s; + S[ 0][ 3] = 574 * s; + S[ 0][ 4] = -4770 * s; + S[ 0][ 5] = -18711 * s; + S[ 0][ 6] = 6075 * s; + S[ 0][ 7] = -2439 * s; + S[ 0][ 8] = 792 * s; + S[ 0][ 9] = 6075 * s; + S[ 0][10] = -1944 * s; + S[ 0][11] = 747 * s; + S[ 0][12] = 574 * s; + S[ 0][13] = -2439 * s; + S[ 0][14] = 747 * s; + S[ 0][15] = -247 * s; + + S[ 1][ 1] = 75600 * s; + S[ 1][ 2] = -25002 * s; + S[ 1][ 3] = 792 * s; + S[ 1][ 4] = -18711 * s; + S[ 1][ 5] = -39852 * s; + S[ 1][ 6] = -7047 * s; + S[ 1][ 7] = 6075 * s; + S[ 1][ 8] = 6075 * s; + S[ 1][ 9] = 9720 * s; + S[ 1][10] = 3159 * s; + S[ 1][11] = -1944 * s; + S[ 1][12] = -2439 * s; + S[ 1][13] = -108 * s; + S[ 1][14] = -2295 * s; + S[ 1][15] = 747 * s; + + S[ 2][ 2] = 75600 * s; + S[ 2][ 3] = -4770 * s; + S[ 2][ 4] = 6075 * s; + S[ 2][ 5] = -7047 * s; + S[ 2][ 6] = -39852 * s; + S[ 2][ 7] = -18711 * s; + S[ 2][ 8] = -1944 * s; + S[ 2][ 9] = 3159 * s; + S[ 2][10] = 9720 * s; + S[ 2][11] = 6075 * s; + S[ 2][12] = 747 * s; + S[ 2][13] = -2295 * s; + S[ 2][14] = -108 * s; + S[ 2][15] = -2439 * s; + + S[ 3][ 3] = 18944 * s; + S[ 3][ 4] = -2439 * s; + S[ 3][ 5] = 6075 * s; + S[ 3][ 6] = -18711 * s; + S[ 3][ 7] = -4770 * s; + S[ 3][ 8] = 747 * s; + S[ 3][ 9] = -1944 * s; + S[ 3][10] = 6075 * s; + S[ 3][11] = 792 * s; + S[ 3][12] = -247 * s; + S[ 3][13] = 747 * s; + S[ 3][14] = -2439 * s; + S[ 3][15] = 574 * s; + + S[ 4][ 4] = 75600 * s; + S[ 4][ 5] = -39852 * s; + S[ 4][ 6] = 9720 * s; + S[ 4][ 7] = -108 * s; + S[ 4][ 8] = -25002 * s; + S[ 4][ 9] = -7047 * s; + S[ 4][10] = 3159 * s; + S[ 4][11] = -2295 * s; + S[ 4][12] = 792 * s; + S[ 4][13] = 6075 * s; + S[ 4][14] = -1944 * s; + S[ 4][15] = 747 * s; + + S[ 5][ 5] = 279936 * s; + S[ 5][ 6] = -113724 * s; + S[ 5][ 7] = 9720 * s; + S[ 5][ 8] = -7047 * s; + S[ 5][ 9] = -113724 * s; + S[ 5][10] = 24057 * s; + S[ 5][11] = 3159 * s; + S[ 5][12] = 6075 * s; + S[ 5][13] = 9720 * s; + S[ 5][14] = 3159 * s; + S[ 5][15] = -1944 * s; + + S[ 6][ 6] = 279936 * s; + S[ 6][ 7] = -39852 * s; + S[ 6][ 8] = 3159 * s; + S[ 6][ 9] = 24057 * s; + S[ 6][10] = -113724 * s; + S[ 6][11] = -7047 * s; + S[ 6][12] = -1944 * s; + S[ 6][13] = 3159 * s; + S[ 6][14] = 9720 * s; + S[ 6][15] = 6075 * s; + + S[ 7][ 7] = 75600 * s; + S[ 7][ 8] = -2295 * s; + S[ 7][ 9] = 3159 * s; + S[ 7][10] = -7047 * s; + S[ 7][11] = -25002 * s; + S[ 7][12] = 747 * s; + S[ 7][13] = -1944 * s; + S[ 7][14] = 6075 * s; + S[ 7][15] = 792 * s; + + S[ 8][ 8] = 75600 * s; + S[ 8][ 9] = -39852 * s; + S[ 8][10] = 9720 * s; + S[ 8][11] = -108 * s; + S[ 8][12] = -4770 * s; + S[ 8][13] = -18711 * s; + S[ 8][14] = 6075 * s; + S[ 8][15] = -2439 * s; + + S[ 9][ 9] = 279936 * s; + S[ 9][10] = -113724 * s; + S[ 9][11] = 9720 * s; + S[ 9][12] = -18711 * s; + S[ 9][13] = -39852 * s; + S[ 9][14] = -7047 * s; + S[ 9][15] = 6075 * s; + + S[10][10] = 279936 * s; + S[10][11] = -39852 * s; + S[10][12] = 6075 * s; + S[10][13] = -7047 * s; + S[10][14] = -39852 * s; + S[10][15] = -18711 * s; + + S[11][11] = 75600 * s; + S[11][12] = -2439 * s; + S[11][13] = 6075 * s; + S[11][14] = -18711 * s; + S[11][15] = -4770 * s; + + S[12][12] = 18944 * s; + S[12][13] = -4770 * s; + S[12][14] = 792 * s; + S[12][15] = 574 * s; + + S[13][13] = 75600 * s; + S[13][14] = -25002 * s; + S[13][15] = 792 * s; + + S[14][14] = 75600 * s; + S[14][15] = -4770 * s; + + S[15][15] = 18944 * s; /* The stiffness matrix is symmetric */ for (i = 1; i < 16; i++) for (j = 0; j < i; j++) + { S[i][j] = S[j][i]; + } F[ 0] = h2_64; - F[ 1] = 3*h2_64; - F[ 2] = 3*h2_64; + F[ 1] = 3 * h2_64; + F[ 2] = 3 * h2_64; F[ 3] = h2_64; - F[ 4] = 3*h2_64; - F[ 5] = 9*h2_64; - F[ 6] = 9*h2_64; - F[ 7] = 3*h2_64; - F[ 8] = 3*h2_64; - F[ 9] = 9*h2_64; - F[10] = 9*h2_64; - F[11] = 3*h2_64; + F[ 4] = 3 * h2_64; + F[ 5] = 9 * h2_64; + F[ 6] = 9 * h2_64; + F[ 7] = 3 * h2_64; + F[ 8] = 3 * h2_64; + F[ 9] = 9 * h2_64; + F[10] = 9 * h2_64; + F[11] = 3 * h2_64; F[12] = h2_64; - F[13] = 3*h2_64; - F[14] = 3*h2_64; + F[13] = 3 * h2_64; + F[14] = 3 * h2_64; F[15] = h2_64; } @@ -253,7 +255,7 @@ int main (int argc, char *argv[]) MPI_Comm_size(MPI_COMM_WORLD, &num_procs); /* Initialize HYPRE */ - HYPRE_Init(); + HYPRE_Initialize(); /* Print GPU info */ /* HYPRE_PrintDeviceInfo(); */ @@ -309,19 +311,19 @@ int main (int argc, char *argv[]) /* Figure out the processor grid (N x N). The local problem size is n^2, while pi and pj indicate the position in the processor grid. */ - N = pow(num_procs,1.0/2.0) + 0.5; - if (num_procs != N*N) + N = pow(num_procs, 1.0 / 2.0) + 0.5; + if (num_procs != N * N) { if (myid == 0) { - printf("Can't run on %d processors, try %d.\n", num_procs, N*N); + printf("Can't run on %d processors, try %d.\n", num_procs, N * N); } MPI_Finalize(); exit(1); } - h = 1.0 / (N*n); + h = 1.0 / (N * n); pj = myid / N; - pi = myid - pj*N; + pi = myid - pj * N; /* 1. Set up the grid. For simplicity we use only one part to represent the unit square. */ @@ -335,8 +337,8 @@ int main (int argc, char *argv[]) /* Set the extents of the grid - each processor sets its grid boxes. */ { int part = 0; - int ilower[2] = {1 + pi*n, 1 + pj*n}; - int iupper[2] = {n + pi*n, n + pj*n}; + int ilower[2] = {1 + pi * n, 1 + pj * n}; + int iupper[2] = {n + pi * n, n + pj * n}; HYPRE_SStructGridSetExtents(grid, part, ilower, iupper); } @@ -356,7 +358,8 @@ int main (int argc, char *argv[]) HYPRE_SSTRUCT_VARIABLE_CELL, HYPRE_SSTRUCT_VARIABLE_CELL, HYPRE_SSTRUCT_VARIABLE_CELL, - HYPRE_SSTRUCT_VARIABLE_CELL}; + HYPRE_SSTRUCT_VARIABLE_CELL + }; for (i = 0; i < nparts; i++) { HYPRE_SStructGridSetVariables(grid, i, nvars, vars); @@ -382,10 +385,11 @@ int main (int argc, char *argv[]) */ { int part = 0; - int ordering[48] = { 0,-1,-1, 3, 0,-1, 4, 0,-1, 0,+1,-1, - 1,-1, 0, 5, 0, 0, 6, 0, 0, 1,+1, 0, - 2,-1, 0, 7, 0, 0, 8, 0, 0, 2,+1, 0, - 0,-1,+1, 3, 0,+1, 4, 0,+1, 0,+1,+1 }; + int ordering[48] = { 0, -1, -1, 3, 0, -1, 4, 0, -1, 0, +1, -1, + 1, -1, 0, 5, 0, 0, 6, 0, 0, 1, +1, 0, + 2, -1, 0, 7, 0, 0, 8, 0, 0, 2, +1, 0, + 0, -1, +1, 3, 0, +1, 4, 0, +1, 0, +1, +1 + }; HYPRE_SStructGridSetFEMOrdering(grid, part, ordering); } @@ -446,8 +450,8 @@ int main (int argc, char *argv[]) { for (i = 1; i <= n; i++) { - index[0] = i + pi*n; - index[1] = j + pj*n; + index[0] = i + pi * n; + index[1] = j + pj * n; /* Compute the FEM matrix and rhs */ ComputeFEMQ3(S, F, h); @@ -456,16 +460,19 @@ int main (int argc, char *argv[]) { int ii, jj, bdy, dd; int set_bc[4] = {0, 0, 0, 0}; - int bc_dofs[4][4] = {{ 0, 4, 8, 12}, /* x = 0 boundary */ - { 0, 1, 2, 3}, /* y = 0 boundary */ - { 3, 7, 11, 15}, /* x = 1 boundary */ - {12, 13, 14, 15}}; /* y = 1 boundary */ + int bc_dofs[4][4] = + { + { 0, 4, 8, 12}, /* x = 0 boundary */ + { 0, 1, 2, 3}, /* y = 0 boundary */ + { 3, 7, 11, 15}, /* x = 1 boundary */ + {12, 13, 14, 15} /* y = 1 boundary */ + }; /* Determine the boundary conditions to be set */ - if (index[0] == 1) set_bc[0] = 1; /* x = 0 boundary */ - if (index[1] == 1) set_bc[1] = 1; /* y = 0 boundary */ - if (index[0] == N*n) set_bc[2] = 1; /* x = 1 boundary */ - if (index[1] == N*n) set_bc[3] = 1; /* y = 1 boundary */ + if (index[0] == 1) { set_bc[0] = 1; } /* x = 0 boundary */ + if (index[1] == 1) { set_bc[1] = 1; } /* y = 0 boundary */ + if (index[0] == N * n) { set_bc[2] = 1; } /* x = 1 boundary */ + if (index[1] == N * n) { set_bc[3] = 1; } /* y = 1 boundary */ /* Modify the FEM matrix and rhs on each boundary by setting rows and columns of S to the identity and F to zero */ @@ -507,7 +514,7 @@ int main (int argc, char *argv[]) { int part = 0; int var, nvars = 9; - int nvalues = (n+1)*(n+1); + int nvalues = (n + 1) * (n + 1); double *values; values = (double*) calloc(nvalues, sizeof(double)); @@ -524,10 +531,10 @@ int main (int argc, char *argv[]) cell center, ilower needs to be adjusted. */ for (var = 0; var < nvars; var++) { - int ilower[2] = {1 + pi*n, 1 + pj*n}; - int iupper[2] = {n + pi*n, n + pj*n}; + int ilower[2] = {1 + pi * n, 1 + pj * n}; + int iupper[2] = {n + pi * n, n + pj * n}; - switch(var) + switch (var) { case 0: /* NODE */ ilower[0]--; @@ -599,7 +606,7 @@ int main (int argc, char *argv[]) int part = 0; int i, j, k, index[2]; - int nvalues = n*n*16; + int nvalues = n * n * 16; double X[16], *values; /* GLVis-to-hypre local renumbering */ @@ -612,8 +619,8 @@ int main (int argc, char *argv[]) { for (i = 1; i <= n; i++) { - index[0] = i + pi*n; - index[1] = j + pj*n; + index[0] = i + pi * n; + index[1] = j + pj * n; /* Get local element solution values X */ HYPRE_SStructVectorGetFEMValues(x, part, index, X); @@ -643,7 +650,9 @@ int main (int argc, char *argv[]) /* Save solution with replicated shared data */ for (i = 0; i < nvalues; i++) + { fprintf(file, "%.14e\n", values[i]); + } fflush(file); fclose(file); @@ -651,7 +660,7 @@ int main (int argc, char *argv[]) /* Save local finite element mesh */ GLVis_PrintLocalSquareMesh("vis/ex16.mesh", n, n, h, - pi*h*n, pj*h*n, myid); + pi * h * n, pj * h * n, myid); /* Additional visualization data */ GLVis_PrintData("vis/ex16.data", myid, num_procs); diff --git a/external/hypre/src/examples/ex17.c b/external/hypre/src/examples/ex17.c index 6e1850ab..1ed86bbd 100644 --- a/external/hypre/src/examples/ex17.c +++ b/external/hypre/src/examples/ex17.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -54,7 +54,7 @@ int main (int argc, char *argv[]) MPI_Comm_size(MPI_COMM_WORLD, &num_procs); /* Initialize HYPRE */ - HYPRE_Init(); + HYPRE_Initialize(); /* Print GPU info */ /* HYPRE_PrintDeviceInfo(); */ @@ -115,7 +115,7 @@ int main (int argc, char *argv[]) /* Figure out the processor grid (N x N x N x N). The local problem size for the interior nodes is indicated by n (n x n x n x n). p indicates the position in the processor grid. */ - N = pow(num_procs, 1.0/NDIM) + 1.0e-6; + N = pow(num_procs, 1.0 / NDIM) + 1.0e-6; div = pow(N, NDIM); rem = myid; if (num_procs != div) @@ -124,7 +124,7 @@ int main (int argc, char *argv[]) MPI_Finalize(); exit(1); } - for (d = NDIM-1; d >= 0; d--) + for (d = NDIM - 1; d >= 0; d--) { div /= N; p[d] = rem / div; @@ -134,8 +134,8 @@ int main (int argc, char *argv[]) /* Figure out the extents of each processor's piece of the grid. */ for (d = 0; d < NDIM; d++) { - ilower[d] = p[d]*n; - iupper[d] = ilower[d] + n-1; + ilower[d] = p[d] * n; + iupper[d] = ilower[d] + n - 1; } /* 1. Set up a grid */ @@ -181,7 +181,7 @@ int main (int argc, char *argv[]) /* 3. Set up a Struct Matrix */ { int nentries = NSTENC; - int nvalues = nentries*nvol; + int nvalues = nentries * nvol; double *values; int stencil_indices[NSTENC]; @@ -204,7 +204,7 @@ int main (int argc, char *argv[]) values[i] = NSTENC; /* Use absolute row sum */ for (j = 1; j < nentries; j++) { - values[i+j] = -1.0; + values[i + j] = -1.0; } } @@ -220,7 +220,7 @@ int main (int argc, char *argv[]) int bc_ilower[NDIM]; int bc_iupper[NDIM]; int nentries = 1; - int nvalues = nentries*nvol/n; /* number of stencil entries times the + int nvalues = nentries * nvol / n; /* number of stencil entries times the length of one side of my grid box */ double *values; int stencil_indices[1]; @@ -250,7 +250,7 @@ int main (int argc, char *argv[]) stencil_indices[0]++; /* upper boundary in dimension d */ - if (p[d] == N-1) + if (p[d] == N - 1) { bc_ilower[d] = iupper[d]; HYPRE_StructMatrixSetBoxValues(A, bc_ilower, bc_iupper, nentries, @@ -282,7 +282,7 @@ int main (int argc, char *argv[]) HYPRE_StructVectorInitialize(b); HYPRE_StructVectorInitialize(x); - /* Set the values */ + /* Set the values */ for (i = 0; i < nvalues; i ++) { values[i] = 1.0; diff --git a/external/hypre/src/examples/ex18.c b/external/hypre/src/examples/ex18.c index 71dc5735..6ae68cf6 100644 --- a/external/hypre/src/examples/ex18.c +++ b/external/hypre/src/examples/ex18.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -58,7 +58,7 @@ int main (int argc, char *argv[]) MPI_Comm_size(MPI_COMM_WORLD, &num_procs); /* Initialize HYPRE */ - HYPRE_Init(); + HYPRE_Initialize(); /* Print GPU info */ /* HYPRE_PrintDeviceInfo(); */ @@ -119,7 +119,7 @@ int main (int argc, char *argv[]) /* Figure out the processor grid (N x N x N x N). The local problem size for the interior nodes is indicated by n (n x n x n x n). p indicates the position in the processor grid. */ - N = pow(num_procs, 1.0/NDIM) + 1.0e-6; + N = pow(num_procs, 1.0 / NDIM) + 1.0e-6; div = pow(N, NDIM); rem = myid; if (num_procs != div) @@ -128,7 +128,7 @@ int main (int argc, char *argv[]) MPI_Finalize(); exit(1); } - for (d = NDIM-1; d >= 0; d--) + for (d = NDIM - 1; d >= 0; d--) { div /= N; p[d] = rem / div; @@ -138,15 +138,16 @@ int main (int argc, char *argv[]) /* Figure out the extents of each processor's piece of the grid. */ for (d = 0; d < NDIM; d++) { - ilower[d] = p[d]*n; - iupper[d] = ilower[d] + n-1; + ilower[d] = p[d] * n; + iupper[d] = ilower[d] + n - 1; } /* 1. Set up a grid */ { int part = 0; HYPRE_SStructVariable vartypes[NVARS] = {HYPRE_SSTRUCT_VARIABLE_CELL, - HYPRE_SSTRUCT_VARIABLE_CELL}; + HYPRE_SSTRUCT_VARIABLE_CELL + }; /* Create an empty 2D grid object */ HYPRE_SStructGridCreate(MPI_COMM_WORLD, NDIM, NPARTS, &grid); @@ -227,8 +228,8 @@ int main (int argc, char *argv[]) { int part = 0; int var0 = 0, var1 = 1; - int nentries = NSTENC/NVARS; - int nvalues = nentries*nvol; + int nentries = NSTENC / NVARS; + int nvalues = nentries * nvol; double *values; int stencil_indices[NSTENC]; @@ -246,14 +247,14 @@ int main (int argc, char *argv[]) /* Set intra-variable values; fix boundaries later */ for (j = 0; j < nentries; j++) { - stencil_indices[j] = 2*j; + stencil_indices[j] = 2 * j; } for (i = 0; i < nvalues; i += nentries) { - values[i] = 1.1*(NSTENC/NVARS); /* Diagonal: Use absolute row sum */ + values[i] = 1.1 * (NSTENC / NVARS); /* Diagonal: Use absolute row sum */ for (j = 1; j < nentries; j++) { - values[i+j] = -1.0; + values[i + j] = -1.0; } } HYPRE_SStructMatrixSetBoxValues(A, part, ilower, iupper, var0, @@ -264,14 +265,14 @@ int main (int argc, char *argv[]) /* Set inter-variable values; fix boundaries later */ for (j = 0; j < nentries; j++) { - stencil_indices[j] = 2*j+1; + stencil_indices[j] = 2 * j + 1; } for (i = 0; i < nvalues; i += nentries) { values[i] = -0.1; for (j = 1; j < nentries; j++) { - values[i+j] = -0.1; + values[i + j] = -0.1; } } HYPRE_SStructMatrixSetBoxValues(A, part, ilower, iupper, var0, @@ -290,7 +291,7 @@ int main (int argc, char *argv[]) int bc_ilower[NDIM]; int bc_iupper[NDIM]; int nentries = 1; - int nvalues = nentries*nvol/n; /* number of stencil entries times the + int nvalues = nentries * nvol / n; /* number of stencil entries times the length of one side of my grid box */ double *values; int stencil_indices[1]; @@ -329,7 +330,7 @@ int main (int argc, char *argv[]) } /* upper boundary in dimension d */ - if (p[d] == N-1) + if (p[d] == N - 1) { bc_ilower[d] = iupper[d]; for (i = 0; i < NVARS; i++) @@ -358,7 +359,7 @@ int main (int argc, char *argv[]) { int part = 0; int var0 = 0, var1 = 1; - int nvalues = NVARS*nvol; + int nvalues = NVARS * nvol; double *values; values = (double*) calloc(nvalues, sizeof(double)); @@ -375,7 +376,7 @@ int main (int argc, char *argv[]) HYPRE_SStructVectorInitialize(b); HYPRE_SStructVectorInitialize(x); - /* Set the values */ + /* Set the values */ for (i = 0; i < nvalues; i ++) { values[i] = 1.0; diff --git a/external/hypre/src/examples/ex18comp.c b/external/hypre/src/examples/ex18comp.c index 8226690c..a9c7aaeb 100644 --- a/external/hypre/src/examples/ex18comp.c +++ b/external/hypre/src/examples/ex18comp.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -58,7 +58,7 @@ int main (int argc, char *argv[]) MPI_Comm_size(MPI_COMM_WORLD, &num_procs); /* Initialize HYPRE */ - HYPRE_Init(); + HYPRE_Initialize(); /* Print GPU info */ /* HYPRE_PrintDeviceInfo(); */ @@ -119,7 +119,7 @@ int main (int argc, char *argv[]) /* Figure out the processor grid (N x N x N x N). The local problem size for the interior nodes is indicated by n (n x n x n x n). p indicates the position in the processor grid. */ - N = pow(num_procs, 1.0/NDIM) + 1.0e-6; + N = pow(num_procs, 1.0 / NDIM) + 1.0e-6; div = pow(N, NDIM); rem = myid; if (num_procs != div) @@ -128,7 +128,7 @@ int main (int argc, char *argv[]) MPI_Finalize(); exit(1); } - for (d = NDIM-1; d >= 0; d--) + for (d = NDIM - 1; d >= 0; d--) { div /= N; p[d] = rem / div; @@ -138,15 +138,16 @@ int main (int argc, char *argv[]) /* Figure out the extents of each processor's piece of the grid. */ for (d = 0; d < NDIM; d++) { - ilower[d] = p[d]*n; - iupper[d] = ilower[d] + n-1; + ilower[d] = p[d] * n; + iupper[d] = ilower[d] + n - 1; } /* 1. Set up a grid */ { int part = 0; HYPRE_SStructVariable vartypes[NVARS] = {HYPRE_SSTRUCT_VARIABLE_CELL, - HYPRE_SSTRUCT_VARIABLE_CELL}; + HYPRE_SSTRUCT_VARIABLE_CELL + }; /* Create an empty 2D grid object */ HYPRE_SStructGridCreate(MPI_COMM_WORLD, NDIM, NPARTS, &grid); @@ -227,8 +228,8 @@ int main (int argc, char *argv[]) { int part = 0; int var0 = 0, var1 = 1; - int nentries = NSTENC/NVARS; - int nvalues = nentries*nvol; + int nentries = NSTENC / NVARS; + int nvalues = nentries * nvol; HYPRE_Complex *values; int stencil_indices[NSTENC]; @@ -246,14 +247,14 @@ int main (int argc, char *argv[]) /* Set intra-variable values; fix boundaries later */ for (j = 0; j < nentries; j++) { - stencil_indices[j] = 2*j; + stencil_indices[j] = 2 * j; } for (i = 0; i < nvalues; i += nentries) { - values[i] = 1.1*(NSTENC/NVARS); /* Diagonal: Use absolute row sum */ + values[i] = 1.1 * (NSTENC / NVARS); /* Diagonal: Use absolute row sum */ for (j = 1; j < nentries; j++) { - values[i+j] = -1.0; + values[i + j] = -1.0; } } HYPRE_SStructMatrixSetBoxValues(A, part, ilower, iupper, var0, @@ -264,14 +265,14 @@ int main (int argc, char *argv[]) /* Set inter-variable values; fix boundaries later */ for (j = 0; j < nentries; j++) { - stencil_indices[j] = 2*j+1; + stencil_indices[j] = 2 * j + 1; } /* Add an imaginary component and ensure conjugate to below */ for (i = 0; i < nvalues; i += nentries) { for (j = 0; j < nentries; j++) { - values[i+j] =(-0.1 + (HYPRE_Complex)I*0.1); + values[i + j] = (-0.1 + (HYPRE_Complex)I * 0.1); } } HYPRE_SStructMatrixSetBoxValues(A, part, ilower, iupper, var0, @@ -281,7 +282,7 @@ int main (int argc, char *argv[]) { for (j = 0; j < nentries; j++) { - values[i+j] =(HYPRE_Complex)(-0.1 - I*0.1); + values[i + j] = (HYPRE_Complex)(-0.1 - I * 0.1); } } HYPRE_SStructMatrixSetBoxValues(A, part, ilower, iupper, var1, @@ -298,7 +299,7 @@ int main (int argc, char *argv[]) int bc_ilower[NDIM]; int bc_iupper[NDIM]; int nentries = 1; - int nvalues = nentries*nvol/n; /* number of stencil entries times the + int nvalues = nentries * nvol / n; /* number of stencil entries times the length of one side of my grid box */ HYPRE_Complex *values; int stencil_indices[1]; @@ -337,7 +338,7 @@ int main (int argc, char *argv[]) } /* upper boundary in dimension d */ - if (p[d] == N-1) + if (p[d] == N - 1) { bc_ilower[d] = iupper[d]; for (i = 0; i < NVARS; i++) @@ -366,7 +367,7 @@ int main (int argc, char *argv[]) { int part = 0; int var0 = 0, var1 = 1; - int nvalues = NVARS*nvol; + int nvalues = NVARS * nvol; HYPRE_Complex *values; values = (HYPRE_Complex*) calloc(nvalues, sizeof(HYPRE_Complex)); @@ -383,7 +384,7 @@ int main (int argc, char *argv[]) HYPRE_SStructVectorInitialize(b); HYPRE_SStructVectorInitialize(x); - /* Set the values */ + /* Set the values */ for (i = 0; i < nvalues; i ++) { values[i] = 1.0; diff --git a/external/hypre/src/examples/ex2.c b/external/hypre/src/examples/ex2.c index 9089a75c..3e80377c 100644 --- a/external/hypre/src/examples/ex2.c +++ b/external/hypre/src/examples/ex2.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -60,14 +60,14 @@ int main (int argc, char *argv[]) if (num_procs != 2) { - if (myid == 0) printf("Must run with 2 processors!\n"); + if (myid == 0) { printf("Must run with 2 processors!\n"); } MPI_Finalize(); - return(0); + return (0); } /* Initialize HYPRE */ - HYPRE_Init(); + HYPRE_Initialize(); /* Print GPU info */ /* HYPRE_PrintDeviceInfo(); */ @@ -162,11 +162,13 @@ int main (int argc, char *argv[]) relative offset (in the index space). */ { int entry; - int offsets[5][2] = {{0,0}, {-1,0}, {1,0}, {0,-1}, {0,1}}; + int offsets[5][2] = {{0, 0}, {-1, 0}, {1, 0}, {0, -1}, {0, 1}}; /* Assign each of the 5 stencil entries */ for (entry = 0; entry < 5; entry++) + { HYPRE_StructStencilSetElement(stencil, entry, offsets[entry]); + } } } @@ -190,19 +192,23 @@ int main (int argc, char *argv[]) int nentries = 5; int nvalues = 30; /* 6 grid points, each with 5 stencil entries */ /* double values[30]; OK to use constant-length array for CPUs */ - double *values = (double *) malloc(30*sizeof(double)); + double *values = (double *) malloc(30 * sizeof(double)); int stencil_indices[5]; for (j = 0; j < nentries; j++) /* label the stencil indices - these correspond to the offsets defined above */ + { stencil_indices[j] = j; + } for (i = 0; i < nvalues; i += nentries) { values[i] = 4.0; for (j = 1; j < nentries; j++) - values[i+j] = -1.0; + { + values[i + j] = -1.0; + } } HYPRE_StructMatrixSetBoxValues(A, ilower, iupper, nentries, @@ -220,17 +226,21 @@ int main (int argc, char *argv[]) int nentries = 5; int nvalues = 60; /* 12 grid points, each with 5 stencil entries */ /* double values[60]; OK to use constant-length array for CPUs */ - double *values = (double *) malloc(60*sizeof(double)); + double *values = (double *) malloc(60 * sizeof(double)); int stencil_indices[5]; for (j = 0; j < nentries; j++) + { stencil_indices[j] = j; + } for (i = 0; i < nvalues; i += nentries) { values[i] = 4.0; for (j = 1; j < nentries; j++) - values[i+j] = -1.0; + { + values[i + j] = -1.0; + } } HYPRE_StructMatrixSetBoxValues(A, ilower, iupper, nentries, @@ -250,17 +260,21 @@ int main (int argc, char *argv[]) int nentries = 5; int nvalues = 80; /* 16 grid points, each with 5 stencil entries */ /* double values[80]; OK to use constant-length array for CPUs */ - double *values = (double *) malloc(80*sizeof(double)); + double *values = (double *) malloc(80 * sizeof(double)); int stencil_indices[5]; for (j = 0; j < nentries; j++) + { stencil_indices[j] = j; + } for (i = 0; i < nvalues; i += nentries) { values[i] = 4.0; for (j = 1; j < nentries; j++) - values[i+j] = -1.0; + { + values[i + j] = -1.0; + } } HYPRE_StructMatrixSetBoxValues(A, ilower, iupper, nentries, @@ -276,10 +290,12 @@ int main (int argc, char *argv[]) { int maxnvalues = 6; /* double values[6]; OK to use constant-length array for CPUs */ - double *values = (double *) malloc(6*sizeof(double)); + double *values = (double *) malloc(6 * sizeof(double)); for (i = 0; i < maxnvalues; i++) + { values[i] = 0.0; + } { /* Values below our first AND second box */ @@ -343,10 +359,12 @@ int main (int argc, char *argv[]) { int maxnvalues = 4; /* double values[4]; OK to use constant-length array for CPUs */ - double *values = (double *) malloc(4*sizeof(double)); + double *values = (double *) malloc(4 * sizeof(double)); for (i = 0; i < maxnvalues; i++) + { values[i] = 0.0; + } { /* Values below our box */ @@ -408,14 +426,18 @@ int main (int argc, char *argv[]) int nvalues = 6; /* 6 grid points */ /* double values[6]; OK to use constant-length array for CPUs */ - double *values = (double *) malloc(6*sizeof(double)); + double *values = (double *) malloc(6 * sizeof(double)); for (i = 0; i < nvalues; i ++) + { values[i] = 1.0; + } HYPRE_StructVectorSetBoxValues(b, ilower, iupper, values); for (i = 0; i < nvalues; i ++) + { values[i] = 0.0; + } HYPRE_StructVectorSetBoxValues(x, ilower, iupper, values); free(values); @@ -428,14 +450,18 @@ int main (int argc, char *argv[]) int nvalues = 12; /* 12 grid points */ /* double values[12]; OK to use constant-length array for CPUs */ - double *values = (double *) malloc(12*sizeof(double)); + double *values = (double *) malloc(12 * sizeof(double)); for (i = 0; i < nvalues; i ++) + { values[i] = 1.0; + } HYPRE_StructVectorSetBoxValues(b, ilower, iupper, values); for (i = 0; i < nvalues; i ++) + { values[i] = 0.0; + } HYPRE_StructVectorSetBoxValues(x, ilower, iupper, values); free(values); @@ -450,14 +476,18 @@ int main (int argc, char *argv[]) int nvalues = 16; /* 16 grid points */ /* double values[16]; OK to use constant-length array for CPUs */ - double *values = (double *) malloc(16*sizeof(double)); + double *values = (double *) malloc(16 * sizeof(double)); for (i = 0; i < nvalues; i ++) + { values[i] = 1.0; + } HYPRE_StructVectorSetBoxValues(b, ilower, iupper, values); for (i = 0; i < nvalues; i ++) + { values[i] = 0.0; + } HYPRE_StructVectorSetBoxValues(x, ilower, iupper, values); free(values); diff --git a/external/hypre/src/examples/ex3.c b/external/hypre/src/examples/ex3.c index b047bf68..9b4596bc 100644 --- a/external/hypre/src/examples/ex3.c +++ b/external/hypre/src/examples/ex3.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -153,7 +153,7 @@ int main (int argc, char *argv[]) } /* Initialize HYPRE */ - HYPRE_Init(); + HYPRE_Initialize(); /* Print GPU info */ /* HYPRE_PrintDeviceInfo(); */ @@ -162,18 +162,18 @@ int main (int argc, char *argv[]) size for the interior nodes is indicated by n (n x n). pi and pj indicate position in the processor grid. */ N = sqrt(num_procs); - h = 1.0 / (N*n+1); /* note that when calculating h we must + h = 1.0 / (N * n + 1); /* note that when calculating h we must remember to count the boundary nodes */ - h2 = h*h; + h2 = h * h; pj = myid / N; - pi = myid - pj*N; + pi = myid - pj * N; /* Figure out the extents of each processor's piece of the grid. */ - ilower[0] = pi*n; - ilower[1] = pj*n; + ilower[0] = pi * n; + ilower[1] = pj * n; - iupper[0] = ilower[0] + n-1; - iupper[1] = ilower[1] + n-1; + iupper[0] = ilower[0] + n - 1; + iupper[1] = ilower[1] + n - 1; /* 1. Set up a grid */ { @@ -196,17 +196,19 @@ int main (int argc, char *argv[]) /* Define the geometry of the stencil */ { int entry; - int offsets[5][2] = {{0,0}, {-1,0}, {1,0}, {0,-1}, {0,1}}; + int offsets[5][2] = {{0, 0}, {-1, 0}, {1, 0}, {0, -1}, {0, 1}}; for (entry = 0; entry < 5; entry++) + { HYPRE_StructStencilSetElement(stencil, entry, offsets[entry]); + } } } /* 3. Set up a Struct Matrix */ { int nentries = 5; - int nvalues = nentries*n*n; + int nvalues = nentries * n * n; double *values; int stencil_indices[5]; @@ -219,7 +221,9 @@ int main (int argc, char *argv[]) values = (double*) calloc(nvalues, sizeof(double)); for (j = 0; j < nentries; j++) + { stencil_indices[j] = j; + } /* Set the standard stencil at each grid point, we will fix the boundaries later */ @@ -227,7 +231,9 @@ int main (int argc, char *argv[]) { values[i] = 4.0; for (j = 1; j < nentries; j++) - values[i+j] = -1.0; + { + values[i + j] = -1.0; + } } HYPRE_StructMatrixSetBoxValues(A, ilower, iupper, nentries, @@ -243,23 +249,25 @@ int main (int argc, char *argv[]) int bc_ilower[2]; int bc_iupper[2]; int nentries = 1; - int nvalues = nentries*n; /* number of stencil entries times the length + int nvalues = nentries * n; /* number of stencil entries times the length of one side of my grid box */ double *values; int stencil_indices[1]; values = (double*) calloc(nvalues, sizeof(double)); for (j = 0; j < nvalues; j++) + { values[j] = 0.0; + } /* Recall: pi and pj describe position in the processor grid */ if (pj == 0) { /* Bottom row of grid points */ - bc_ilower[0] = pi*n; - bc_ilower[1] = pj*n; + bc_ilower[0] = pi * n; + bc_ilower[1] = pj * n; - bc_iupper[0] = bc_ilower[0] + n-1; + bc_iupper[0] = bc_ilower[0] + n - 1; bc_iupper[1] = bc_ilower[1]; stencil_indices[0] = 3; @@ -268,13 +276,13 @@ int main (int argc, char *argv[]) stencil_indices, values); } - if (pj == N-1) + if (pj == N - 1) { /* upper row of grid points */ - bc_ilower[0] = pi*n; - bc_ilower[1] = pj*n + n-1; + bc_ilower[0] = pi * n; + bc_ilower[1] = pj * n + n - 1; - bc_iupper[0] = bc_ilower[0] + n-1; + bc_iupper[0] = bc_ilower[0] + n - 1; bc_iupper[1] = bc_ilower[1]; stencil_indices[0] = 4; @@ -286,11 +294,11 @@ int main (int argc, char *argv[]) if (pi == 0) { /* Left row of grid points */ - bc_ilower[0] = pi*n; - bc_ilower[1] = pj*n; + bc_ilower[0] = pi * n; + bc_ilower[1] = pj * n; bc_iupper[0] = bc_ilower[0]; - bc_iupper[1] = bc_ilower[1] + n-1; + bc_iupper[1] = bc_ilower[1] + n - 1; stencil_indices[0] = 1; @@ -298,14 +306,14 @@ int main (int argc, char *argv[]) stencil_indices, values); } - if (pi == N-1) + if (pi == N - 1) { /* Right row of grid points */ - bc_ilower[0] = pi*n + n-1; - bc_ilower[1] = pj*n; + bc_ilower[0] = pi * n + n - 1; + bc_ilower[1] = pj * n; bc_iupper[0] = bc_ilower[0]; - bc_iupper[1] = bc_ilower[1] + n-1; + bc_iupper[1] = bc_ilower[1] + n - 1; stencil_indices[0] = 2; @@ -322,7 +330,7 @@ int main (int argc, char *argv[]) /* 5. Set up Struct Vectors for b and x */ { - int nvalues = n*n; + int nvalues = n * n; double *values; values = (double*) calloc(nvalues, sizeof(double)); @@ -335,13 +343,17 @@ int main (int argc, char *argv[]) HYPRE_StructVectorInitialize(b); HYPRE_StructVectorInitialize(x); - /* Set the values */ + /* Set the values */ for (i = 0; i < nvalues; i ++) + { values[i] = h2; + } HYPRE_StructVectorSetBoxValues(b, ilower, iupper, values); for (i = 0; i < nvalues; i ++) + { values[i] = 0.0; + } HYPRE_StructVectorSetBoxValues(x, ilower, iupper, values); free(values); @@ -375,7 +387,7 @@ int main (int argc, char *argv[]) /* Set the preconditioner and solve */ HYPRE_StructPCGSetPrecond(solver, HYPRE_StructSMGSolve, - HYPRE_StructSMGSetup, precond); + HYPRE_StructSMGSetup, precond); HYPRE_StructPCGSetup(solver, A, b, x); HYPRE_StructPCGSolve(solver, A, b, x); @@ -419,7 +431,7 @@ int main (int argc, char *argv[]) FILE *file; char filename[255]; - int k, nvalues = n*n; + int k, nvalues = n * n; double *values = (double*) calloc(nvalues, sizeof(double)); /* get the local solution */ @@ -437,7 +449,9 @@ int main (int argc, char *argv[]) k = 0; for (j = 0; j < n; j++) for (i = 0; i < n; i++) - fprintf(file, "%06d %.14e\n", pj*N*n*n+pi*n+j*N*n+i, values[k++]); + { + fprintf(file, "%06d %.14e\n", pj * N * n * n + pi * n + j * N * n + i, values[k++]); + } fflush(file); fclose(file); @@ -445,7 +459,9 @@ int main (int argc, char *argv[]) /* save global finite element mesh */ if (myid == 0) - GLVis_PrintGlobalSquareMesh("vis/ex3.mesh", N*n-1); + { + GLVis_PrintGlobalSquareMesh("vis/ex3.mesh", N * n - 1); + } #endif } diff --git a/external/hypre/src/examples/ex4.c b/external/hypre/src/examples/ex4.c index ac2b78a9..202f0278 100644 --- a/external/hypre/src/examples/ex4.c +++ b/external/hypre/src/examples/ex4.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -61,9 +61,9 @@ #include "ex.h" #ifdef M_PI - #define PI M_PI +#define PI M_PI #else - #define PI 3.14159265358979 +#define PI 3.14159265358979 #endif #ifdef HYPRE_EXVIS @@ -84,17 +84,25 @@ double K(double x, double y) case 0: return 1.0; case 1: - return x*x+exp(y); + return x * x + exp(y); case 2: - if ((fabs(x-0.5) < 0.25) && (fabs(y-0.5) < 0.25)) + if ((fabs(x - 0.5) < 0.25) && (fabs(y - 0.5) < 0.25)) + { return 100.0; + } else + { return 1.0; + } case 3: - if (((x-0.5)*(x-0.5)+(y-0.5)*(y-0.5)) < 0.0625) + if (((x - 0.5) * (x - 0.5) + (y - 0.5) * (y - 0.5)) < 0.0625) + { return 10.0; + } else + { return 1.0; + } default: return 1.0; } @@ -160,9 +168,9 @@ double U0(double x, double y) case 0: return 0.0; case 1: - return (x+y)/100; + return (x + y) / 100; case 2: - return (sin(5*PI*x)+sin(5*PI*y))/1000; + return (sin(5 * PI * x) + sin(5 * PI * y)) / 1000; default: return 0.0; } @@ -178,17 +186,25 @@ double F(double x, double y) case 1: return 0.0; case 2: - return 2*PI*PI*sin(PI*x)*sin(PI*y); + return 2 * PI * PI * sin(PI * x) * sin(PI * y); case 3: - if ((fabs(x-0.5) < 0.25) && (fabs(y-0.5) < 0.25)) + if ((fabs(x - 0.5) < 0.25) && (fabs(y - 0.5) < 0.25)) + { return -1.0; + } else + { return 1.0; + } case 4: - if (((x-0.5)*(x-0.5)+(y-0.5)*(y-0.5)) < 0.0625) + if (((x - 0.5) * (x - 0.5) + (y - 0.5) * (y - 0.5)) < 0.0625) + { return -1.0; + } else + { return 1.0; + } default: return 1.0; } @@ -229,7 +245,7 @@ int main (int argc, char *argv[]) MPI_Comm_size(MPI_COMM_WORLD, &num_procs); /* Initialize HYPRE */ - HYPRE_Init(); + HYPRE_Initialize(); /* Print GPU info */ /* HYPRE_PrintDeviceInfo(); */ @@ -384,23 +400,25 @@ int main (int argc, char *argv[]) /* Convection produces non-symmetric matrices */ if (optionB && sym) + { optionB = 0; + } /* Figure out the processor grid (N x N). The local problem size is indicated by n (n x n). pi and pj indicate position in the processor grid. */ N = sqrt(num_procs); - h = 1.0 / (N*n-1); - h2 = h*h; + h = 1.0 / (N * n - 1); + h2 = h * h; pj = myid / N; - pi = myid - pj*N; + pi = myid - pj * N; /* Define the nodes owned by the current processor (each processor's piece of the global grid) */ - ilower[0] = pi*n; - ilower[1] = pj*n; - iupper[0] = ilower[0] + n-1; - iupper[1] = ilower[1] + n-1; + ilower[0] = pi * n; + ilower[1] = pj * n; + iupper[0] = ilower[0] + n - 1; + iupper[1] = ilower[1] + n - 1; /* 1. Set up a grid */ { @@ -419,26 +437,30 @@ int main (int argc, char *argv[]) if (sym == 0) { /* Define the geometry of the stencil */ - int offsets[5][2] = {{0,0}, {-1,0}, {1,0}, {0,-1}, {0,1}}; + int offsets[5][2] = {{0, 0}, {-1, 0}, {1, 0}, {0, -1}, {0, 1}}; /* Create an empty 2D, 5-pt stencil object */ HYPRE_StructStencilCreate(2, 5, &stencil); /* Assign stencil entries */ for (i = 0; i < 5; i++) + { HYPRE_StructStencilSetElement(stencil, i, offsets[i]); + } } else /* Symmetric storage */ { /* Define the geometry of the stencil */ - int offsets[3][2] = {{0,0}, {1,0}, {0,1}}; + int offsets[3][2] = {{0, 0}, {1, 0}, {0, 1}}; /* Create an empty 2D, 3-pt stencil object */ HYPRE_StructStencilCreate(2, 3, &stencil); /* Assign stencil entries */ for (i = 0; i < 3; i++) + { HYPRE_StructStencilSetElement(stencil, i, offsets[i]); + } } /* 3. Set up Struct Vectors for b and x */ @@ -453,17 +475,21 @@ int main (int argc, char *argv[]) HYPRE_StructVectorInitialize(b); HYPRE_StructVectorInitialize(x); - values = (double*) calloc((n*n), sizeof(double)); + values = (double*) calloc((n * n), sizeof(double)); /* Set the values of b in left-to-right, bottom-to-top order */ for (k = 0, j = 0; j < n; j++) for (i = 0; i < n; i++, k++) - values[k] = h2 * Eval(F,i,j); + { + values[k] = h2 * Eval(F, i, j); + } HYPRE_StructVectorSetBoxValues(b, ilower, iupper, values); /* Set x = 0 */ - for (i = 0; i < (n*n); i ++) + for (i = 0; i < (n * n); i ++) + { values[i] = 0.0; + } HYPRE_StructVectorSetBoxValues(x, ilower, iupper, values); free(values); @@ -490,25 +516,25 @@ int main (int argc, char *argv[]) to the offsets */ double *values; - values = (double*) calloc(5*(n*n), sizeof(double)); + values = (double*) calloc(5 * (n * n), sizeof(double)); /* The order is left-to-right, bottom-to-top */ for (k = 0, j = 0; j < n; j++) - for (i = 0; i < n; i++, k+=5) + for (i = 0; i < n; i++, k += 5) { - values[k+1] = - Eval(K,i-0.5,j) - Eval(B1,i-0.5,j); + values[k + 1] = - Eval(K, i - 0.5, j) - Eval(B1, i - 0.5, j); - values[k+2] = - Eval(K,i+0.5,j) + Eval(B1,i+0.5,j); + values[k + 2] = - Eval(K, i + 0.5, j) + Eval(B1, i + 0.5, j); - values[k+3] = - Eval(K,i,j-0.5) - Eval(B2,i,j-0.5); + values[k + 3] = - Eval(K, i, j - 0.5) - Eval(B2, i, j - 0.5); - values[k+4] = - Eval(K,i,j+0.5) + Eval(B2,i,j+0.5); + values[k + 4] = - Eval(K, i, j + 0.5) + Eval(B2, i, j + 0.5); - values[k] = h2 * Eval(C,i,j) - + Eval(K ,i-0.5,j) + Eval(K ,i+0.5,j) - + Eval(K ,i,j-0.5) + Eval(K ,i,j+0.5) - - Eval(B1,i-0.5,j) + Eval(B1,i+0.5,j) - - Eval(B2,i,j-0.5) + Eval(B2,i,j+0.5); + values[k] = h2 * Eval(C, i, j) + + Eval(K, i - 0.5, j) + Eval(K, i + 0.5, j) + + Eval(K, i, j - 0.5) + Eval(K, i, j + 0.5) + - Eval(B1, i - 0.5, j) + Eval(B1, i + 0.5, j) + - Eval(B2, i, j - 0.5) + Eval(B2, i, j + 0.5); } HYPRE_StructMatrixSetBoxValues(A, ilower, iupper, 5, @@ -521,17 +547,17 @@ int main (int argc, char *argv[]) int stencil_indices[3] = {0, 1, 2}; double *values; - values = (double*) calloc(3*(n*n), sizeof(double)); + values = (double*) calloc(3 * (n * n), sizeof(double)); /* The order is left-to-right, bottom-to-top */ for (k = 0, j = 0; j < n; j++) - for (i = 0; i < n; i++, k+=3) + for (i = 0; i < n; i++, k += 3) { - values[k+1] = - Eval(K,i+0.5,j); - values[k+2] = - Eval(K,i,j+0.5); - values[k] = h2 * Eval(C,i,j) - + Eval(K,i+0.5,j) + Eval(K,i,j+0.5) - + Eval(K,i-0.5,j) + Eval(K,i,j-0.5); + values[k + 1] = - Eval(K, i + 0.5, j); + values[k + 2] = - Eval(K, i, j + 0.5); + values[k] = h2 * Eval(C, i, j) + + Eval(K, i + 0.5, j) + Eval(K, i, j + 0.5) + + Eval(K, i - 0.5, j) + Eval(K, i, j - 0.5); } HYPRE_StructMatrixSetBoxValues(A, ilower, iupper, 3, @@ -553,29 +579,35 @@ int main (int argc, char *argv[]) int nentries; if (sym == 0) + { nentries = 5; + } else + { nentries = 3; + } - values = (double*) calloc(nentries*n, sizeof(double)); + values = (double*) calloc(nentries * n, sizeof(double)); bvalues = (double*) calloc(n, sizeof(double)); /* The stencil at the boundary nodes is 1-0-0-0-0. Because we have I x_b = u_0; */ - for (i = 0; i < nentries*n; i += nentries) + for (i = 0; i < nentries * n; i += nentries) { values[i] = 1.0; for (j = 1; j < nentries; j++) - values[i+j] = 0.0; + { + values[i + j] = 0.0; + } } /* Processors at y = 0 */ if (pj == 0) { - bc_ilower[0] = pi*n; - bc_ilower[1] = pj*n; + bc_ilower[0] = pi * n; + bc_ilower[1] = pj * n; - bc_iupper[0] = bc_ilower[0] + n-1; + bc_iupper[0] = bc_ilower[0] + n - 1; bc_iupper[1] = bc_ilower[1]; /* Modify the matrix */ @@ -584,18 +616,20 @@ int main (int argc, char *argv[]) /* Put the boundary conditions in b */ for (i = 0; i < n; i++) - bvalues[i] = bcEval(U0,i,0); + { + bvalues[i] = bcEval(U0, i, 0); + } HYPRE_StructVectorSetBoxValues(b, bc_ilower, bc_iupper, bvalues); } /* Processors at y = 1 */ - if (pj == N-1) + if (pj == N - 1) { - bc_ilower[0] = pi*n; - bc_ilower[1] = pj*n + n-1; + bc_ilower[0] = pi * n; + bc_ilower[1] = pj * n + n - 1; - bc_iupper[0] = bc_ilower[0] + n-1; + bc_iupper[0] = bc_ilower[0] + n - 1; bc_iupper[1] = bc_ilower[1]; /* Modify the matrix */ @@ -604,7 +638,9 @@ int main (int argc, char *argv[]) /* Put the boundary conditions in b */ for (i = 0; i < n; i++) - bvalues[i] = bcEval(U0,i,0); + { + bvalues[i] = bcEval(U0, i, 0); + } HYPRE_StructVectorSetBoxValues(b, bc_ilower, bc_iupper, bvalues); } @@ -612,11 +648,11 @@ int main (int argc, char *argv[]) /* Processors at x = 0 */ if (pi == 0) { - bc_ilower[0] = pi*n; - bc_ilower[1] = pj*n; + bc_ilower[0] = pi * n; + bc_ilower[1] = pj * n; bc_iupper[0] = bc_ilower[0]; - bc_iupper[1] = bc_ilower[1] + n-1; + bc_iupper[1] = bc_ilower[1] + n - 1; /* Modify the matrix */ HYPRE_StructMatrixSetBoxValues(A, bc_ilower, bc_iupper, nentries, @@ -624,19 +660,21 @@ int main (int argc, char *argv[]) /* Put the boundary conditions in b */ for (j = 0; j < n; j++) - bvalues[j] = bcEval(U0,0,j); + { + bvalues[j] = bcEval(U0, 0, j); + } HYPRE_StructVectorSetBoxValues(b, bc_ilower, bc_iupper, bvalues); } /* Processors at x = 1 */ - if (pi == N-1) + if (pi == N - 1) { - bc_ilower[0] = pi*n + n-1; - bc_ilower[1] = pj*n; + bc_ilower[0] = pi * n + n - 1; + bc_ilower[1] = pj * n; bc_iupper[0] = bc_ilower[0]; - bc_iupper[1] = bc_ilower[1] + n-1; + bc_iupper[1] = bc_ilower[1] + n - 1; /* Modify the matrix */ HYPRE_StructMatrixSetBoxValues(A, bc_ilower, bc_iupper, nentries, @@ -644,7 +682,9 @@ int main (int argc, char *argv[]) /* Put the boundary conditions in b */ for (j = 0; j < n; j++) - bvalues[j] = bcEval(U0,0,j); + { + bvalues[j] = bcEval(U0, 0, j); + } HYPRE_StructVectorSetBoxValues(b, bc_ilower, bc_iupper, bvalues); } @@ -661,17 +701,19 @@ int main (int argc, char *argv[]) /* Processors at y = 0, neighbors of boundary nodes */ if (pj == 0) { - bc_ilower[0] = pi*n; - bc_ilower[1] = pj*n + 1; + bc_ilower[0] = pi * n; + bc_ilower[1] = pj * n + 1; - bc_iupper[0] = bc_ilower[0] + n-1; + bc_iupper[0] = bc_ilower[0] + n - 1; bc_iupper[1] = bc_ilower[1]; stencil_indices[0] = 3; /* Modify the matrix */ for (i = 0; i < n; i++) + { bvalues[i] = 0.0; + } if (sym == 0) HYPRE_StructMatrixSetBoxValues(A, bc_ilower, bc_iupper, 1, @@ -679,13 +721,19 @@ int main (int argc, char *argv[]) /* Eliminate the boundary conditions in b */ for (i = 0; i < n; i++) - bvalues[i] = bcEval(U0,i,-1) * (bcEval(K,i,-0.5)+bcEval(B2,i,-0.5)); + { + bvalues[i] = bcEval(U0, i, -1) * (bcEval(K, i, -0.5) + bcEval(B2, i, -0.5)); + } if (pi == 0) + { bvalues[0] = 0.0; + } - if (pi == N-1) - bvalues[n-1] = 0.0; + if (pi == N - 1) + { + bvalues[n - 1] = 0.0; + } /* Note the use of AddToBoxValues (because we have already set values at these nodes) */ @@ -695,17 +743,19 @@ int main (int argc, char *argv[]) /* Processors at x = 0, neighbors of boundary nodes */ if (pi == 0) { - bc_ilower[0] = pi*n + 1; - bc_ilower[1] = pj*n; + bc_ilower[0] = pi * n + 1; + bc_ilower[1] = pj * n; bc_iupper[0] = bc_ilower[0]; - bc_iupper[1] = bc_ilower[1] + n-1; + bc_iupper[1] = bc_ilower[1] + n - 1; stencil_indices[0] = 1; /* Modify the matrix */ for (j = 0; j < n; j++) + { bvalues[j] = 0.0; + } if (sym == 0) HYPRE_StructMatrixSetBoxValues(A, bc_ilower, bc_iupper, 1, @@ -713,81 +763,111 @@ int main (int argc, char *argv[]) /* Eliminate the boundary conditions in b */ for (j = 0; j < n; j++) - bvalues[j] = bcEval(U0,-1,j) * (bcEval(K,-0.5,j)+bcEval(B1,-0.5,j)); + { + bvalues[j] = bcEval(U0, -1, j) * (bcEval(K, -0.5, j) + bcEval(B1, -0.5, j)); + } if (pj == 0) + { bvalues[0] = 0.0; + } - if (pj == N-1) - bvalues[n-1] = 0.0; + if (pj == N - 1) + { + bvalues[n - 1] = 0.0; + } HYPRE_StructVectorAddToBoxValues(b, bc_ilower, bc_iupper, bvalues); } /* Processors at y = 1, neighbors of boundary nodes */ - if (pj == N-1) + if (pj == N - 1) { - bc_ilower[0] = pi*n; - bc_ilower[1] = pj*n + (n-1) -1; + bc_ilower[0] = pi * n; + bc_ilower[1] = pj * n + (n - 1) - 1; - bc_iupper[0] = bc_ilower[0] + n-1; + bc_iupper[0] = bc_ilower[0] + n - 1; bc_iupper[1] = bc_ilower[1]; if (sym == 0) + { stencil_indices[0] = 4; + } else + { stencil_indices[0] = 2; + } /* Modify the matrix */ for (i = 0; i < n; i++) + { bvalues[i] = 0.0; + } HYPRE_StructMatrixSetBoxValues(A, bc_ilower, bc_iupper, 1, stencil_indices, bvalues); /* Eliminate the boundary conditions in b */ for (i = 0; i < n; i++) - bvalues[i] = bcEval(U0,i,1) * (bcEval(K,i,0.5)+bcEval(B2,i,0.5)); + { + bvalues[i] = bcEval(U0, i, 1) * (bcEval(K, i, 0.5) + bcEval(B2, i, 0.5)); + } if (pi == 0) + { bvalues[0] = 0.0; + } - if (pi == N-1) - bvalues[n-1] = 0.0; + if (pi == N - 1) + { + bvalues[n - 1] = 0.0; + } HYPRE_StructVectorAddToBoxValues(b, bc_ilower, bc_iupper, bvalues); } /* Processors at x = 1, neighbors of boundary nodes */ - if (pi == N-1) + if (pi == N - 1) { - bc_ilower[0] = pi*n + (n-1) - 1; - bc_ilower[1] = pj*n; + bc_ilower[0] = pi * n + (n - 1) - 1; + bc_ilower[1] = pj * n; bc_iupper[0] = bc_ilower[0]; - bc_iupper[1] = bc_ilower[1] + n-1; + bc_iupper[1] = bc_ilower[1] + n - 1; if (sym == 0) + { stencil_indices[0] = 2; + } else + { stencil_indices[0] = 1; + } /* Modify the matrix */ for (j = 0; j < n; j++) + { bvalues[j] = 0.0; + } HYPRE_StructMatrixSetBoxValues(A, bc_ilower, bc_iupper, 1, stencil_indices, bvalues); /* Eliminate the boundary conditions in b */ for (j = 0; j < n; j++) - bvalues[j] = bcEval(U0,1,j) * (bcEval(K,0.5,j)+bcEval(B1,0.5,j)); + { + bvalues[j] = bcEval(U0, 1, j) * (bcEval(K, 0.5, j) + bcEval(B1, 0.5, j)); + } if (pj == 0) + { bvalues[0] = 0.0; + } - if (pj == N-1) - bvalues[n-1] = 0.0; + if (pj == N - 1) + { + bvalues[n - 1] = 0.0; + } HYPRE_StructVectorAddToBoxValues(b, bc_ilower, bc_iupper, bvalues); } @@ -1024,7 +1104,7 @@ int main (int argc, char *argv[]) type HYPRE_Solver, and then the casting would not be necessary.*/ HYPRE_GMRESSetMaxIter((HYPRE_Solver) solver, 500 ); - HYPRE_GMRESSetKDim((HYPRE_Solver) solver,30); + HYPRE_GMRESSetKDim((HYPRE_Solver) solver, 30); HYPRE_GMRESSetTol((HYPRE_Solver) solver, 1.0e-06 ); HYPRE_GMRESSetPrintLevel((HYPRE_Solver) solver, 2 ); HYPRE_GMRESSetLogging((HYPRE_Solver) solver, 1 ); @@ -1085,9 +1165,9 @@ int main (int argc, char *argv[]) /* use diagonal scaling as preconditioner */ precond = NULL; HYPRE_StructGMRESSetPrecond( solver, - HYPRE_StructDiagScale, - HYPRE_StructDiagScaleSetup, - precond); + HYPRE_StructDiagScale, + HYPRE_StructDiagScaleSetup, + precond); } /* GMRES Setup */ @@ -1138,7 +1218,7 @@ int main (int argc, char *argv[]) FILE *file; char filename[255]; - int nvalues = n*n; + int nvalues = n * n; double *values = (double*) calloc(nvalues, sizeof(double)); /* get the local solution */ @@ -1156,7 +1236,9 @@ int main (int argc, char *argv[]) k = 0; for (j = 0; j < n; j++) for (i = 0; i < n; i++) - fprintf(file, "%06d %.14e\n", pj*N*n*n+pi*n+j*N*n+i, values[k++]); + { + fprintf(file, "%06d %.14e\n", pj * N * n * n + pi * n + j * N * n + i, values[k++]); + } fflush(file); fclose(file); @@ -1164,7 +1246,9 @@ int main (int argc, char *argv[]) /* save global finite element mesh */ if (myid == 0) - GLVis_PrintGlobalSquareMesh("vis/ex4.mesh", N*n-1); + { + GLVis_PrintGlobalSquareMesh("vis/ex4.mesh", N * n - 1); + } #endif } diff --git a/external/hypre/src/examples/ex5.c b/external/hypre/src/examples/ex5.c index 8e8ea739..7afa32ce 100644 --- a/external/hypre/src/examples/ex5.c +++ b/external/hypre/src/examples/ex5.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -70,10 +70,14 @@ int main (int argc, char *argv[]) MPI_Comm_size(MPI_COMM_WORLD, &num_procs); /* Initialize HYPRE */ - HYPRE_Init(); + HYPRE_Initialize(); /* Print GPU info */ /* HYPRE_PrintDeviceInfo(); */ +#if defined(HYPRE_USING_GPU) + /* use vendor implementation for SpGEMM */ + HYPRE_SetSpGemmUseVendor(0); +#endif /* Default problem parameters */ n = 33; @@ -145,22 +149,22 @@ int main (int argc, char *argv[]) } /* Preliminaries: want at least one processor per row */ - if (n*n < num_procs) n = sqrt(num_procs) + 1; - N = n*n; /* global number of rows */ - h = 1.0/(n+1); /* mesh size*/ - h2 = h*h; + if (n * n < num_procs) { n = sqrt(num_procs) + 1; } + N = n * n; /* global number of rows */ + h = 1.0 / (n + 1); /* mesh size*/ + h2 = h * h; /* Each processor knows only of its own rows - the range is denoted by ilower and upper. Here we partition the rows. We account for the fact that N may not divide evenly by the number of processors. */ - local_size = N/num_procs; - extra = N - local_size*num_procs; + local_size = N / num_procs; + extra = N - local_size * num_procs; - ilower = local_size*myid; + ilower = local_size * myid; ilower += my_min(myid, extra); - iupper = local_size*(myid+1); - iupper += my_min(myid+1, extra); + iupper = local_size * (myid + 1); + iupper += my_min(myid + 1, extra); iupper = iupper - 1; /* How many rows do I have? */ @@ -192,26 +196,26 @@ int main (int argc, char *argv[]) double values[5]; int cols[5]; */ - double *values = (double *) malloc(5*sizeof(double)); - int *cols = (int *) malloc(5*sizeof(int)); - int *tmp = (int *) malloc(2*sizeof(int)); + double *values = (double *) malloc(5 * sizeof(double)); + int *cols = (int *) malloc(5 * sizeof(int)); + int *tmp = (int *) malloc(2 * sizeof(int)); for (i = ilower; i <= iupper; i++) { nnz = 0; /* The left identity block:position i-n */ - if ((i-n)>=0) + if ((i - n) >= 0) { - cols[nnz] = i-n; + cols[nnz] = i - n; values[nnz] = -1.0; nnz++; } /* The left -1: position i-1 */ - if (i%n) + if (i % n) { - cols[nnz] = i-1; + cols[nnz] = i - 1; values[nnz] = -1.0; nnz++; } @@ -222,17 +226,17 @@ int main (int argc, char *argv[]) nnz++; /* The right -1: position i+1 */ - if ((i+1)%n) + if ((i + 1) % n) { - cols[nnz] = i+1; + cols[nnz] = i + 1; values[nnz] = -1.0; nnz++; } /* The right identity block:position i+n */ - if ((i+n)< N) + if ((i + n) < N) { - cols[nnz] = i+n; + cols[nnz] = i + n; values[nnz] = -1.0; nnz++; } @@ -270,11 +274,11 @@ int main (int argc, char *argv[]) /* Create the rhs and solution */ - HYPRE_IJVectorCreate(MPI_COMM_WORLD, ilower, iupper,&b); + HYPRE_IJVectorCreate(MPI_COMM_WORLD, ilower, iupper, &b); HYPRE_IJVectorSetObjectType(b, HYPRE_PARCSR); HYPRE_IJVectorInitialize(b); - HYPRE_IJVectorCreate(MPI_COMM_WORLD, ilower, iupper,&x); + HYPRE_IJVectorCreate(MPI_COMM_WORLD, ilower, iupper, &x); HYPRE_IJVectorSetObjectType(x, HYPRE_PARCSR); HYPRE_IJVectorInitialize(x); @@ -287,7 +291,7 @@ int main (int argc, char *argv[]) x_values = (double*) calloc(local_size, sizeof(double)); rows = (int*) calloc(local_size, sizeof(int)); - for (i=0; i=0) + if ((i - n) >= 0) { - cols[nnz] = i-n; + cols[nnz] = i - n; values[nnz] = -1.0; nnz++; } /* The left -1: position i-1 */ - if (i%n) + if (i % n) { - cols[nnz] = i-1; + cols[nnz] = i - 1; values[nnz] = -1.0; nnz++; } @@ -210,17 +210,17 @@ int main (int argc, char *argv[]) nnz++; /* The right -1: position i+1 */ - if ((i+1)%n) + if ((i + 1) % n) { - cols[nnz] = i+1; + cols[nnz] = i + 1; values[nnz] = -1.0; nnz++; } /* The right identity block:position i+n */ - if ((i+n)< N) + if ((i + n) < N) { - cols[nnz] = i+n; + cols[nnz] = i + n; values[nnz] = -1.0; nnz++; } @@ -252,11 +252,11 @@ int main (int argc, char *argv[]) /* Create the rhs and solution */ - HYPRE_IJVectorCreate(MPI_COMM_WORLD, ilower, iupper,&b); + HYPRE_IJVectorCreate(MPI_COMM_WORLD, ilower, iupper, &b); HYPRE_IJVectorSetObjectType(b, HYPRE_PARCSR); HYPRE_IJVectorInitialize(b); - HYPRE_IJVectorCreate(MPI_COMM_WORLD, ilower, iupper,&x); + HYPRE_IJVectorCreate(MPI_COMM_WORLD, ilower, iupper, &x); HYPRE_IJVectorSetObjectType(x, HYPRE_PARCSR); HYPRE_IJVectorInitialize(x); @@ -269,7 +269,7 @@ int main (int argc, char *argv[]) x_values = (double*) calloc(local_size, sizeof(double)); rows = (HYPRE_Int*) calloc(local_size, sizeof(HYPRE_Int)); - for (i=0; i @@ -6,12 +13,12 @@ void GLVis_PrintGlobalSquareMesh(const char *meshfile, int n) FILE *file; int Dim = 2; - int NumOfVertices = (n+1)*(n+1); - int NumOfElements = n*n; + int NumOfVertices = (n + 1) * (n + 1); + int NumOfElements = n * n; int i, j; double x, y; - double h = 1.0/n; + double h = 1.0 / n; if ((file = fopen(meshfile, "w")) == NULL) { @@ -29,8 +36,8 @@ void GLVis_PrintGlobalSquareMesh(const char *meshfile, int n) fprintf(file, "%d\n", NumOfElements); for (j = 0; j < n; j++) for (i = 0; i < n; i++) - fprintf(file, "1 3 %d %d %d %d\n", i + j*(n+1), i + 1 +j*(n+1), - i + 1 + (j+1)*(n+1), i + (j+1)*(n+1)); + fprintf(file, "1 3 %d %d %d %d\n", i + j * (n + 1), i + 1 + j * (n + 1), + i + 1 + (j + 1) * (n + 1), i + (j + 1) * (n + 1)); /* boundary will be generated by GLVis */ fprintf(file, "\nboundary\n"); @@ -40,11 +47,11 @@ void GLVis_PrintGlobalSquareMesh(const char *meshfile, int n) fprintf(file, "\nvertices\n"); fprintf(file, "%d\n", NumOfVertices); fprintf(file, "%d\n", Dim); - for (j = 0; j < n+1; j++) - for (i = 0; i < n+1; i++) + for (j = 0; j < n + 1; j++) + for (i = 0; i < n + 1; i++) { - x = i*h; - y = j*h; + x = i * h; + y = j * h; fprintf(file, "%.14e %.14e\n", x, y); } @@ -61,8 +68,8 @@ void GLVis_PrintLocalSquareMesh(const char *meshfile_prefix, int nx, int ny, char meshfile[255]; int Dim = 2; - int NumOfVertices = (nx+1)*(ny+1); - int NumOfElements = nx*ny; + int NumOfVertices = (nx + 1) * (ny + 1); + int NumOfElements = nx * ny; int i, j; double x, y; @@ -84,8 +91,8 @@ void GLVis_PrintLocalSquareMesh(const char *meshfile_prefix, int nx, int ny, fprintf(file, "%d\n", NumOfElements); for (j = 0; j < ny; j++) for (i = 0; i < nx; i++) - fprintf(file, "1 3 %d %d %d %d\n", i + j*(nx+1), i + 1 +j*(nx+1), - i + 1 + (j+1)*(nx+1), i + (j+1)*(nx+1)); + fprintf(file, "1 3 %d %d %d %d\n", i + j * (nx + 1), i + 1 + j * (nx + 1), + i + 1 + (j + 1) * (nx + 1), i + (j + 1) * (nx + 1)); /* boundary will be generated by GLVis */ fprintf(file, "\nboundary\n"); @@ -95,11 +102,11 @@ void GLVis_PrintLocalSquareMesh(const char *meshfile_prefix, int nx, int ny, fprintf(file, "\nvertices\n"); fprintf(file, "%d\n", NumOfVertices); fprintf(file, "%d\n", Dim); - for (j = 0; j < ny+1; j++) - for (i = 0; i < nx+1; i++) + for (j = 0; j < ny + 1; j++) + for (i = 0; i < nx + 1; i++) { - x = x0+i*h; - y = y0+j*h; + x = x0 + i * h; + y = y0 + j * h; fprintf(file, "%.14e %.14e\n", x, y); } @@ -116,14 +123,14 @@ void GLVis_PrintLocalRhombusMesh(const char *meshfile_prefix, char meshfile[255]; int Dim = 2; - int NumOfVertices = (n+1)*(n+1); - int NumOfElements = n*n; + int NumOfVertices = (n + 1) * (n + 1); + int NumOfElements = n * n; int i, j; double x, y; - double h = 1.0/n; + double h = 1.0 / n; - double rho = gamma*myid; + double rho = gamma * myid; double sg = sin(gamma); double cg = cos(gamma); double sr = sin(rho); @@ -146,8 +153,8 @@ void GLVis_PrintLocalRhombusMesh(const char *meshfile_prefix, fprintf(file, "%d\n", NumOfElements); for (j = 0; j < n; j++) for (i = 0; i < n; i++) - fprintf(file, "1 3 %d %d %d %d\n", i + j*(n+1), i + 1 +j*(n+1), - i + 1 + (j+1)*(n+1), i + (j+1)*(n+1)); + fprintf(file, "1 3 %d %d %d %d\n", i + j * (n + 1), i + 1 + j * (n + 1), + i + 1 + (j + 1) * (n + 1), i + (j + 1) * (n + 1)); /* boundary will be generated by GLVis */ fprintf(file, "\nboundary\n"); @@ -157,12 +164,12 @@ void GLVis_PrintLocalRhombusMesh(const char *meshfile_prefix, fprintf(file, "\nvertices\n"); fprintf(file, "%d\n", NumOfVertices); fprintf(file, "%d\n", Dim); - for (j = 0; j < n+1; j++) - for (i = 0; i < n+1; i++) + for (j = 0; j < n + 1; j++) + for (i = 0; i < n + 1; i++) { - x = i*h + cg*j*h; - y = sg*j*h; - fprintf(file, "%.14e %.14e\n", cr*x - sr*y, sr*x + cr*y); + x = i * h + cg * j * h; + y = sg * j * h; + fprintf(file, "%.14e %.14e\n", cr * x - sr * y, sr * x + cr * y); } fflush(file); @@ -179,8 +186,8 @@ void GLVis_PrintLocalCubicMesh(const char *meshfile_prefix, char meshfile[255]; int Dim = 3; - int NumOfVertices = (nx+1)*(ny+1)*(nz+1); - int NumOfElements = nx*ny*nz; + int NumOfVertices = (nx + 1) * (ny + 1) * (nz + 1); + int NumOfElements = nx * ny * nz; int i, j, k; double x, y, z; @@ -204,14 +211,14 @@ void GLVis_PrintLocalCubicMesh(const char *meshfile_prefix, for (j = 0; j < ny; j++) for (i = 0; i < nx; i++) fprintf(file, "1 5 %d %d %d %d %d %d %d %d\n", - i + j*(nx+1) + k*(nx+1)*(ny+1), - i + 1 +j*(nx+1) + k*(nx+1)*(ny+1), - i + 1 + (j+1)*(nx+1) + k*(nx+1)*(ny+1), - i + (j+1)*(nx+1) + k*(nx+1)*(ny+1), - i + j*(nx+1) + (k+1)*(nx+1)*(ny+1), - i + 1 +j*(nx+1) + (k+1)*(nx+1)*(ny+1), - i + 1 + (j+1)*(nx+1) + (k+1)*(nx+1)*(ny+1), - i + (j+1)*(nx+1) + (k+1)*(nx+1)*(ny+1)); + i + j * (nx + 1) + k * (nx + 1) * (ny + 1), + i + 1 + j * (nx + 1) + k * (nx + 1) * (ny + 1), + i + 1 + (j + 1) * (nx + 1) + k * (nx + 1) * (ny + 1), + i + (j + 1) * (nx + 1) + k * (nx + 1) * (ny + 1), + i + j * (nx + 1) + (k + 1) * (nx + 1) * (ny + 1), + i + 1 + j * (nx + 1) + (k + 1) * (nx + 1) * (ny + 1), + i + 1 + (j + 1) * (nx + 1) + (k + 1) * (nx + 1) * (ny + 1), + i + (j + 1) * (nx + 1) + (k + 1) * (nx + 1) * (ny + 1)); /* boundary will be generated by GLVis */ fprintf(file, "\nboundary\n"); @@ -221,13 +228,13 @@ void GLVis_PrintLocalCubicMesh(const char *meshfile_prefix, fprintf(file, "\nvertices\n"); fprintf(file, "%d\n", NumOfVertices); fprintf(file, "%d\n", Dim); - for (k = 0; k < nz+1; k++) - for (j = 0; j < ny+1; j++) - for (i = 0; i < nx+1; i++) + for (k = 0; k < nz + 1; k++) + for (j = 0; j < ny + 1; j++) + for (i = 0; i < nx + 1; i++) { - x = x0+i*h; - y = y0+j*h; - z = z0+k*h; + x = x0 + i * h; + y = y0 + j * h; + z = z0 + k * h; fprintf(file, "%.14e %.14e %.14e\n", x, y, z); } @@ -251,7 +258,7 @@ void GLVis_PrintSStructGrid(HYPRE_SStructGrid grid, int dim = ((hypre_SStructGrid *)grid)->ndim; int cellNV = (dim == 2) ? 4 : 8; - int elemid = 2*dim-1; + int elemid = 2 * dim - 1; int nvert, nelem; hypre_StructGrid *part; @@ -272,7 +279,7 @@ void GLVis_PrintSStructGrid(HYPRE_SStructGrid grid, { box = hypre_BoxArrayBox(boxes, b); ncells = hypre_BoxVolume(box); - nvert += ncells*cellNV; + nvert += ncells * cellNV; nelem += ncells; } } @@ -305,13 +312,15 @@ void GLVis_PrintSStructGrid(HYPRE_SStructGrid grid, for (b = 0; b < hypre_BoxArraySize(boxes); b++) { box = hypre_BoxArrayBox(boxes, b); - for (k = hypre_BoxIMinD(box,2); k <= hypre_BoxIMaxD(box,2); k++) - for (j = hypre_BoxIMinD(box,1); j <= hypre_BoxIMaxD(box,1); j++) - for (i = hypre_BoxIMinD(box,0); i <= hypre_BoxIMaxD(box,0); i++) + for (k = hypre_BoxIMinD(box, 2); k <= hypre_BoxIMaxD(box, 2); k++) + for (j = hypre_BoxIMinD(box, 1); j <= hypre_BoxIMaxD(box, 1); j++) + for (i = hypre_BoxIMinD(box, 0); i <= hypre_BoxIMaxD(box, 0); i++) { fprintf(file, "1 %d ", elemid); for (v = 0; v < cellNV; v++, vert++) + { fprintf(file, "%d ", vert); + } fprintf(file, "\n"); } } @@ -335,88 +344,88 @@ void GLVis_PrintSStructGrid(HYPRE_SStructGrid grid, for (b = 0; b < hypre_BoxArraySize(boxes); b++) { box = hypre_BoxArrayBox(boxes, b); - for (k = hypre_BoxIMinD(box,2); k <= hypre_BoxIMaxD(box,2); k++) - for (j = hypre_BoxIMinD(box,1); j <= hypre_BoxIMaxD(box,1); j++) - for (i = hypre_BoxIMinD(box,0); i <= hypre_BoxIMaxD(box,0); i++) + for (k = hypre_BoxIMinD(box, 2); k <= hypre_BoxIMaxD(box, 2); k++) + for (j = hypre_BoxIMinD(box, 1); j <= hypre_BoxIMaxD(box, 1); j++) + for (i = hypre_BoxIMinD(box, 0); i <= hypre_BoxIMaxD(box, 0); i++) if (dim == 2) { if (!given_trans) { - fprintf(file, "%.14e %.14e \n", x0+i*h, y0+j*h); - fprintf(file, "%.14e %.14e \n", x0+(i+1)*h, y0+j*h); - fprintf(file, "%.14e %.14e \n", x0+(i+1)*h, y0+(j+1)*h); - fprintf(file, "%.14e %.14e \n", x0+i*h, y0+(j+1)*h); + fprintf(file, "%.14e %.14e \n", x0 + i * h, y0 + j * h); + fprintf(file, "%.14e %.14e \n", x0 + (i + 1)*h, y0 + j * h); + fprintf(file, "%.14e %.14e \n", x0 + (i + 1)*h, y0 + (j + 1)*h); + fprintf(file, "%.14e %.14e \n", x0 + i * h, y0 + (j + 1)*h); } else { fprintf(file, "%.14e %.14e \n", - T[0]*i+T[1]*j+O[0], - T[2]*i+T[3]*j+O[1]); + T[0]*i + T[1]*j + O[0], + T[2]*i + T[3]*j + O[1]); fprintf(file, "%.14e %.14e \n", - T[0]*(i+1)+T[1]*j+O[0], - T[2]*(i+1)+T[3]*j+O[1]); + T[0] * (i + 1) + T[1]*j + O[0], + T[2] * (i + 1) + T[3]*j + O[1]); fprintf(file, "%.14e %.14e \n", - T[0]*(i+1)+T[1]*(j+1)+O[0], - T[2]*(i+1)+T[3]*(j+1)+O[1]); + T[0] * (i + 1) + T[1] * (j + 1) + O[0], + T[2] * (i + 1) + T[3] * (j + 1) + O[1]); fprintf(file, "%.14e %.14e \n", - T[0]*i+T[1]*(j+1)+O[0], - T[2]*i+T[3]*(j+1)+O[1]); + T[0]*i + T[1] * (j + 1) + O[0], + T[2]*i + T[3] * (j + 1) + O[1]); } } else { if (!given_trans) { - fprintf(file, "%.14e %.14e %.14e \n", x0+i*h, y0+j*h, z0+k*h); - fprintf(file, "%.14e %.14e %.14e \n", x0+(i+1)*h, y0+j*h, z0+k*h); - fprintf(file, "%.14e %.14e %.14e \n", x0+(i+1)*h, y0+(j+1)*h, z0+k*h); - fprintf(file, "%.14e %.14e %.14e \n", x0+i*h, y0+(j+1)*h, z0+k*h); - fprintf(file, "%.14e %.14e %.14e \n", x0+i*h, y0+j*h, z0+(k+1)*h); - fprintf(file, "%.14e %.14e %.14e \n", x0+(i+1)*h, y0+j*h, z0+(k+1)*h); - fprintf(file, "%.14e %.14e %.14e \n", x0+(i+1)*h, y0+(j+1)*h, z0+(k+1)*h); - fprintf(file, "%.14e %.14e %.14e \n", x0+i*h, y0+(j+1)*h, z0+(k+1)*h); + fprintf(file, "%.14e %.14e %.14e \n", x0 + i * h, y0 + j * h, z0 + k * h); + fprintf(file, "%.14e %.14e %.14e \n", x0 + (i + 1)*h, y0 + j * h, z0 + k * h); + fprintf(file, "%.14e %.14e %.14e \n", x0 + (i + 1)*h, y0 + (j + 1)*h, z0 + k * h); + fprintf(file, "%.14e %.14e %.14e \n", x0 + i * h, y0 + (j + 1)*h, z0 + k * h); + fprintf(file, "%.14e %.14e %.14e \n", x0 + i * h, y0 + j * h, z0 + (k + 1)*h); + fprintf(file, "%.14e %.14e %.14e \n", x0 + (i + 1)*h, y0 + j * h, z0 + (k + 1)*h); + fprintf(file, "%.14e %.14e %.14e \n", x0 + (i + 1)*h, y0 + (j + 1)*h, z0 + (k + 1)*h); + fprintf(file, "%.14e %.14e %.14e \n", x0 + i * h, y0 + (j + 1)*h, z0 + (k + 1)*h); } else { fprintf(file, "%.14e %.14e %.14e \n", - T[0]*i+T[1]*j+T[2]*k+O[0], - T[3]*i+T[4]*j+T[5]*k+O[1], - T[6]*i+T[7]*j+T[8]*k+O[2]); + T[0]*i + T[1]*j + T[2]*k + O[0], + T[3]*i + T[4]*j + T[5]*k + O[1], + T[6]*i + T[7]*j + T[8]*k + O[2]); fprintf(file, "%.14e %.14e %.14e \n", - T[0]*(i+1)+T[1]*j+T[2]*k+O[0], - T[3]*(i+1)+T[4]*j+T[5]*k+O[1], - T[6]*(i+1)+T[7]*j+T[8]*k+O[2]); + T[0] * (i + 1) + T[1]*j + T[2]*k + O[0], + T[3] * (i + 1) + T[4]*j + T[5]*k + O[1], + T[6] * (i + 1) + T[7]*j + T[8]*k + O[2]); fprintf(file, "%.14e %.14e %.14e \n", - T[0]*(i+1)+T[1]*(j+1)+T[2]*k+O[0], - T[3]*(i+1)+T[4]*(j+1)+T[5]*k+O[1], - T[6]*(i+1)+T[7]*(j+1)+T[8]*k+O[2]); + T[0] * (i + 1) + T[1] * (j + 1) + T[2]*k + O[0], + T[3] * (i + 1) + T[4] * (j + 1) + T[5]*k + O[1], + T[6] * (i + 1) + T[7] * (j + 1) + T[8]*k + O[2]); fprintf(file, "%.14e %.14e %.14e \n", - T[0]*i+T[1]*(j+1)+T[2]*k+O[0], - T[3]*i+T[4]*(j+1)+T[5]*k+O[1], - T[6]*i+T[7]*(j+1)+T[8]*k+O[2]); + T[0]*i + T[1] * (j + 1) + T[2]*k + O[0], + T[3]*i + T[4] * (j + 1) + T[5]*k + O[1], + T[6]*i + T[7] * (j + 1) + T[8]*k + O[2]); fprintf(file, "%.14e %.14e %.14e \n", - T[0]*i+T[1]*j+T[2]*(k+1)+O[0], - T[3]*i+T[4]*j+T[5]*(k+1)+O[1], - T[6]*i+T[7]*j+T[8]*(k+1)+O[2]); + T[0]*i + T[1]*j + T[2] * (k + 1) + O[0], + T[3]*i + T[4]*j + T[5] * (k + 1) + O[1], + T[6]*i + T[7]*j + T[8] * (k + 1) + O[2]); fprintf(file, "%.14e %.14e %.14e \n", - T[0]*(i+1)+T[1]*j+T[2]*(k+1)+O[0], - T[3]*(i+1)+T[4]*j+T[5]*(k+1)+O[1], - T[6]*(i+1)+T[7]*j+T[8]*(k+1)+O[2]); + T[0] * (i + 1) + T[1]*j + T[2] * (k + 1) + O[0], + T[3] * (i + 1) + T[4]*j + T[5] * (k + 1) + O[1], + T[6] * (i + 1) + T[7]*j + T[8] * (k + 1) + O[2]); fprintf(file, "%.14e %.14e %.14e \n", - T[0]*(i+1)+T[1]*(j+1)+T[2]*(k+1)+O[0], - T[3]*(i+1)+T[4]*(j+1)+T[5]*(k+1)+O[1], - T[6]*(i+1)+T[7]*(j+1)+T[8]*(k+1)+O[2]); + T[0] * (i + 1) + T[1] * (j + 1) + T[2] * (k + 1) + O[0], + T[3] * (i + 1) + T[4] * (j + 1) + T[5] * (k + 1) + O[1], + T[6] * (i + 1) + T[7] * (j + 1) + T[8] * (k + 1) + O[2]); fprintf(file, "%.14e %.14e %.14e \n", - T[0]*i+T[1]*(j+1)+T[2]*(k+1)+O[0], - T[3]*i+T[4]*(j+1)+T[5]*(k+1)+O[1], - T[6]*i+T[7]*(j+1)+T[8]*(k+1)+O[2]); + T[0]*i + T[1] * (j + 1) + T[2] * (k + 1) + O[0], + T[3]*i + T[4] * (j + 1) + T[5] * (k + 1) + O[1], + T[6]*i + T[7] * (j + 1) + T[8] * (k + 1) + O[2]); } } } if (given_trans) { - T += dim*dim; + T += dim * dim; O += dim; } } @@ -492,22 +501,24 @@ void GLVis_PrintSStructVector(HYPRE_SStructVector sol, for (b = 0; b < hypre_BoxArraySize(boxes); b++) { box = hypre_BoxArrayBox(boxes, b); - ni = hypre_BoxSizeD(box,0); - nj = hypre_BoxSizeD(box,1); - nk = hypre_BoxSizeD(box,2); + ni = hypre_BoxSizeD(box, 0); + nj = hypre_BoxSizeD(box, 1); + nk = hypre_BoxSizeD(box, 2); - ilower[0] = hypre_BoxIMinD(box,0) - var_off; - ilower[1] = hypre_BoxIMinD(box,1) - var_off; - iupper[0] = hypre_BoxIMaxD(box,0); - iupper[1] = hypre_BoxIMaxD(box,1); + ilower[0] = hypre_BoxIMinD(box, 0) - var_off; + ilower[1] = hypre_BoxIMinD(box, 1) - var_off; + iupper[0] = hypre_BoxIMaxD(box, 0); + iupper[1] = hypre_BoxIMaxD(box, 1); if (dim == 2) - values = (double*) malloc((ni+var_off)*(nj+var_off)*sizeof(double)); + { + values = (double*) malloc((ni + var_off) * (nj + var_off) * sizeof(double)); + } else { - values = (double*) malloc((ni+var_off)*(nj+var_off)*(nk+var_off)*sizeof(double)); - ilower[2] = hypre_BoxIMinD(box,2) - var_off; - iupper[2] = hypre_BoxIMaxD(box,2); + values = (double*) malloc((ni + var_off) * (nj + var_off) * (nk + var_off) * sizeof(double)); + ilower[2] = hypre_BoxIMinD(box, 2) - var_off; + iupper[2] = hypre_BoxIMaxD(box, 2); } HYPRE_SStructVectorGetBoxValues(sol, p, ilower, iupper, var, values); @@ -517,7 +528,9 @@ void GLVis_PrintSStructVector(HYPRE_SStructVector sol, for (k = 0; k < nk; k++) for (j = 0; j < nj; j++) for (i = 0; i < ni; i++) - fprintf(file, "%.14e\n", values[i + j*ni]); + { + fprintf(file, "%.14e\n", values[i + j * ni]); + } } else if (vartype == HYPRE_SSTRUCT_VARIABLE_NODE) { @@ -526,10 +539,10 @@ void GLVis_PrintSStructVector(HYPRE_SStructVector sol, for (j = 0; j < nj; j++) for (i = 0; i < ni; i++) { - fprintf(file, "%.14e\n", values[i + j*(ni+1)]); - fprintf(file, "%.14e\n", values[i+1 + j*(ni+1)]); - fprintf(file, "%.14e\n", values[i+1 + (j+1)*(ni+1)]); - fprintf(file, "%.14e\n", values[i + (j+1)*(ni+1)]); + fprintf(file, "%.14e\n", values[i + j * (ni + 1)]); + fprintf(file, "%.14e\n", values[i + 1 + j * (ni + 1)]); + fprintf(file, "%.14e\n", values[i + 1 + (j + 1) * (ni + 1)]); + fprintf(file, "%.14e\n", values[i + (j + 1) * (ni + 1)]); } } else @@ -538,14 +551,14 @@ void GLVis_PrintSStructVector(HYPRE_SStructVector sol, for (j = 0; j < nj; j++) for (i = 0; i < ni; i++) { - fprintf(file, "%.14e\n", values[i + j*(ni+1) + k*(ni+1)*(nj+1)]); - fprintf(file, "%.14e\n", values[i+1 + j*(ni+1) + k*(ni+1)*(nj+1)]); - fprintf(file, "%.14e\n", values[i+1 + (j+1)*(ni+1) + k*(ni+1)*(nj+1)]); - fprintf(file, "%.14e\n", values[i + (j+1)*(ni+1) + k*(ni+1)*(nj+1)]); - fprintf(file, "%.14e\n", values[i + j*(ni+1) + (k+1)*(ni+1)*(nj+1)]); - fprintf(file, "%.14e\n", values[i+1 + j*(ni+1) + (k+1)*(ni+1)*(nj+1)]); - fprintf(file, "%.14e\n", values[i+1 + (j+1)*(ni+1) + (k+1)*(ni+1)*(nj+1)]); - fprintf(file, "%.14e\n", values[i + (j+1)*(ni+1) + (k+1)*(ni+1)*(nj+1)]); + fprintf(file, "%.14e\n", values[i + j * (ni + 1) + k * (ni + 1) * (nj + 1)]); + fprintf(file, "%.14e\n", values[i + 1 + j * (ni + 1) + k * (ni + 1) * (nj + 1)]); + fprintf(file, "%.14e\n", values[i + 1 + (j + 1) * (ni + 1) + k * (ni + 1) * (nj + 1)]); + fprintf(file, "%.14e\n", values[i + (j + 1) * (ni + 1) + k * (ni + 1) * (nj + 1)]); + fprintf(file, "%.14e\n", values[i + j * (ni + 1) + (k + 1) * (ni + 1) * (nj + 1)]); + fprintf(file, "%.14e\n", values[i + 1 + j * (ni + 1) + (k + 1) * (ni + 1) * (nj + 1)]); + fprintf(file, "%.14e\n", values[i + 1 + (j + 1) * (ni + 1) + (k + 1) * (ni + 1) * (nj + 1)]); + fprintf(file, "%.14e\n", values[i + (j + 1) * (ni + 1) + (k + 1) * (ni + 1) * (nj + 1)]); } } } @@ -572,7 +585,7 @@ void GLVis_PrintStructGrid(HYPRE_StructGrid Grid, hypre_StructGrid *grid = (hypre_StructGrid *)Grid; int dim = grid->ndim; int cellNV = (dim == 2) ? 4 : 8; - int elemid = 2*dim-1; + int elemid = 2 * dim - 1; int nvert, nelem; int given_trans = (trans != NULL && origin != NULL); @@ -588,7 +601,7 @@ void GLVis_PrintStructGrid(HYPRE_StructGrid Grid, { box = hypre_BoxArrayBox(boxes, b); ncells = hypre_BoxVolume(box); - nvert += ncells*cellNV; + nvert += ncells * cellNV; nelem += ncells; } @@ -618,13 +631,15 @@ void GLVis_PrintStructGrid(HYPRE_StructGrid Grid, for (b = 0; b < hypre_BoxArraySize(boxes); b++) { box = hypre_BoxArrayBox(boxes, b); - for (k = hypre_BoxIMinD(box,2); k <= hypre_BoxIMaxD(box,2); k++) - for (j = hypre_BoxIMinD(box,1); j <= hypre_BoxIMaxD(box,1); j++) - for (i = hypre_BoxIMinD(box,0); i <= hypre_BoxIMaxD(box,0); i++) + for (k = hypre_BoxIMinD(box, 2); k <= hypre_BoxIMaxD(box, 2); k++) + for (j = hypre_BoxIMinD(box, 1); j <= hypre_BoxIMaxD(box, 1); j++) + for (i = hypre_BoxIMinD(box, 0); i <= hypre_BoxIMaxD(box, 0); i++) { fprintf(file, "1 %d ", elemid); for (v = 0; v < cellNV; v++, vert++) + { fprintf(file, "%d ", vert); + } fprintf(file, "\n"); } } @@ -644,87 +659,87 @@ void GLVis_PrintStructGrid(HYPRE_StructGrid Grid, for (b = 0; b < hypre_BoxArraySize(boxes); b++) { box = hypre_BoxArrayBox(boxes, b); - for (k = hypre_BoxIMinD(box,2); k <= hypre_BoxIMaxD(box,2); k++) - for (j = hypre_BoxIMinD(box,1); j <= hypre_BoxIMaxD(box,1); j++) - for (i = hypre_BoxIMinD(box,0); i <= hypre_BoxIMaxD(box,0); i++) + for (k = hypre_BoxIMinD(box, 2); k <= hypre_BoxIMaxD(box, 2); k++) + for (j = hypre_BoxIMinD(box, 1); j <= hypre_BoxIMaxD(box, 1); j++) + for (i = hypre_BoxIMinD(box, 0); i <= hypre_BoxIMaxD(box, 0); i++) if (dim == 2) { if (!given_trans) { - fprintf(file, "%.14e %.14e \n", x0+i*h, y0+j*h); - fprintf(file, "%.14e %.14e \n", x0+(i+1)*h, y0+j*h); - fprintf(file, "%.14e %.14e \n", x0+(i+1)*h, y0+(j+1)*h); - fprintf(file, "%.14e %.14e \n", x0+i*h, y0+(j+1)*h); + fprintf(file, "%.14e %.14e \n", x0 + i * h, y0 + j * h); + fprintf(file, "%.14e %.14e \n", x0 + (i + 1)*h, y0 + j * h); + fprintf(file, "%.14e %.14e \n", x0 + (i + 1)*h, y0 + (j + 1)*h); + fprintf(file, "%.14e %.14e \n", x0 + i * h, y0 + (j + 1)*h); } else { fprintf(file, "%.14e %.14e \n", - T[0]*i+T[1]*j+O[0], - T[2]*i+T[3]*j+O[1]); + T[0]*i + T[1]*j + O[0], + T[2]*i + T[3]*j + O[1]); fprintf(file, "%.14e %.14e \n", - T[0]*(i+1)+T[1]*j+O[0], - T[2]*(i+1)+T[3]*j+O[1]); + T[0] * (i + 1) + T[1]*j + O[0], + T[2] * (i + 1) + T[3]*j + O[1]); fprintf(file, "%.14e %.14e \n", - T[0]*(i+1)+T[1]*(j+1)+O[0], - T[2]*(i+1)+T[3]*(j+1)+O[1]); + T[0] * (i + 1) + T[1] * (j + 1) + O[0], + T[2] * (i + 1) + T[3] * (j + 1) + O[1]); fprintf(file, "%.14e %.14e \n", - T[0]*i+T[1]*(j+1)+O[0], - T[2]*i+T[3]*(j+1)+O[1]); + T[0]*i + T[1] * (j + 1) + O[0], + T[2]*i + T[3] * (j + 1) + O[1]); } } else { if (!given_trans) { - fprintf(file, "%.14e %.14e %.14e \n", x0+i*h, y0+j*h, z0+k*h); - fprintf(file, "%.14e %.14e %.14e \n", x0+(i+1)*h, y0+j*h, z0+k*h); - fprintf(file, "%.14e %.14e %.14e \n", x0+(i+1)*h, y0+(j+1)*h, z0+k*h); - fprintf(file, "%.14e %.14e %.14e \n", x0+i*h, y0+(j+1)*h, z0+k*h); - fprintf(file, "%.14e %.14e %.14e \n", x0+i*h, y0+j*h, z0+(k+1)*h); - fprintf(file, "%.14e %.14e %.14e \n", x0+(i+1)*h, y0+j*h, z0+(k+1)*h); - fprintf(file, "%.14e %.14e %.14e \n", x0+(i+1)*h, y0+(j+1)*h, z0+(k+1)*h); - fprintf(file, "%.14e %.14e %.14e \n", x0+i*h, y0+(j+1)*h, z0+(k+1)*h); + fprintf(file, "%.14e %.14e %.14e \n", x0 + i * h, y0 + j * h, z0 + k * h); + fprintf(file, "%.14e %.14e %.14e \n", x0 + (i + 1)*h, y0 + j * h, z0 + k * h); + fprintf(file, "%.14e %.14e %.14e \n", x0 + (i + 1)*h, y0 + (j + 1)*h, z0 + k * h); + fprintf(file, "%.14e %.14e %.14e \n", x0 + i * h, y0 + (j + 1)*h, z0 + k * h); + fprintf(file, "%.14e %.14e %.14e \n", x0 + i * h, y0 + j * h, z0 + (k + 1)*h); + fprintf(file, "%.14e %.14e %.14e \n", x0 + (i + 1)*h, y0 + j * h, z0 + (k + 1)*h); + fprintf(file, "%.14e %.14e %.14e \n", x0 + (i + 1)*h, y0 + (j + 1)*h, z0 + (k + 1)*h); + fprintf(file, "%.14e %.14e %.14e \n", x0 + i * h, y0 + (j + 1)*h, z0 + (k + 1)*h); } else { fprintf(file, "%.14e %.14e %.14e \n", - T[0]*i+T[1]*j+T[2]*k+O[0], - T[3]*i+T[4]*j+T[5]*k+O[1], - T[6]*i+T[7]*j+T[8]*k+O[2]); + T[0]*i + T[1]*j + T[2]*k + O[0], + T[3]*i + T[4]*j + T[5]*k + O[1], + T[6]*i + T[7]*j + T[8]*k + O[2]); fprintf(file, "%.14e %.14e %.14e \n", - T[0]*(i+1)+T[1]*j+T[2]*k+O[0], - T[3]*(i+1)+T[4]*j+T[5]*k+O[1], - T[6]*(i+1)+T[7]*j+T[8]*k+O[2]); + T[0] * (i + 1) + T[1]*j + T[2]*k + O[0], + T[3] * (i + 1) + T[4]*j + T[5]*k + O[1], + T[6] * (i + 1) + T[7]*j + T[8]*k + O[2]); fprintf(file, "%.14e %.14e %.14e \n", - T[0]*(i+1)+T[1]*(j+1)+T[2]*k+O[0], - T[3]*(i+1)+T[4]*(j+1)+T[5]*k+O[1], - T[6]*(i+1)+T[7]*(j+1)+T[8]*k+O[2]); + T[0] * (i + 1) + T[1] * (j + 1) + T[2]*k + O[0], + T[3] * (i + 1) + T[4] * (j + 1) + T[5]*k + O[1], + T[6] * (i + 1) + T[7] * (j + 1) + T[8]*k + O[2]); fprintf(file, "%.14e %.14e %.14e \n", - T[0]*i+T[1]*(j+1)+T[2]*k+O[0], - T[3]*i+T[4]*(j+1)+T[5]*k+O[1], - T[6]*i+T[7]*(j+1)+T[8]*k+O[2]); + T[0]*i + T[1] * (j + 1) + T[2]*k + O[0], + T[3]*i + T[4] * (j + 1) + T[5]*k + O[1], + T[6]*i + T[7] * (j + 1) + T[8]*k + O[2]); fprintf(file, "%.14e %.14e %.14e \n", - T[0]*i+T[1]*j+T[2]*(k+1)+O[0], - T[3]*i+T[4]*j+T[5]*(k+1)+O[1], - T[6]*i+T[7]*j+T[8]*(k+1)+O[2]); + T[0]*i + T[1]*j + T[2] * (k + 1) + O[0], + T[3]*i + T[4]*j + T[5] * (k + 1) + O[1], + T[6]*i + T[7]*j + T[8] * (k + 1) + O[2]); fprintf(file, "%.14e %.14e %.14e \n", - T[0]*(i+1)+T[1]*j+T[2]*(k+1)+O[0], - T[3]*(i+1)+T[4]*j+T[5]*(k+1)+O[1], - T[6]*(i+1)+T[7]*j+T[8]*(k+1)+O[2]); + T[0] * (i + 1) + T[1]*j + T[2] * (k + 1) + O[0], + T[3] * (i + 1) + T[4]*j + T[5] * (k + 1) + O[1], + T[6] * (i + 1) + T[7]*j + T[8] * (k + 1) + O[2]); fprintf(file, "%.14e %.14e %.14e \n", - T[0]*(i+1)+T[1]*(j+1)+T[2]*(k+1)+O[0], - T[3]*(i+1)+T[4]*(j+1)+T[5]*(k+1)+O[1], - T[6]*(i+1)+T[7]*(j+1)+T[8]*(k+1)+O[2]); + T[0] * (i + 1) + T[1] * (j + 1) + T[2] * (k + 1) + O[0], + T[3] * (i + 1) + T[4] * (j + 1) + T[5] * (k + 1) + O[1], + T[6] * (i + 1) + T[7] * (j + 1) + T[8] * (k + 1) + O[2]); fprintf(file, "%.14e %.14e %.14e \n", - T[0]*i+T[1]*(j+1)+T[2]*(k+1)+O[0], - T[3]*i+T[4]*(j+1)+T[5]*(k+1)+O[1], - T[6]*i+T[7]*(j+1)+T[8]*(k+1)+O[2]); + T[0]*i + T[1] * (j + 1) + T[2] * (k + 1) + O[0], + T[3]*i + T[4] * (j + 1) + T[5] * (k + 1) + O[1], + T[6]*i + T[7] * (j + 1) + T[8] * (k + 1) + O[2]); } } if (given_trans) { - T += dim*dim; + T += dim * dim; O += dim; } } @@ -772,22 +787,24 @@ void GLVis_PrintStructVector(HYPRE_StructVector sol, for (b = 0; b < hypre_BoxArraySize(boxes); b++) { box = hypre_BoxArrayBox(boxes, b); - ni = hypre_BoxSizeD(box,0); - nj = hypre_BoxSizeD(box,1); - nk = hypre_BoxSizeD(box,2); + ni = hypre_BoxSizeD(box, 0); + nj = hypre_BoxSizeD(box, 1); + nk = hypre_BoxSizeD(box, 2); - ilower[0] = hypre_BoxIMinD(box,0); - ilower[1] = hypre_BoxIMinD(box,1); - iupper[0] = hypre_BoxIMaxD(box,0); - iupper[1] = hypre_BoxIMaxD(box,1); + ilower[0] = hypre_BoxIMinD(box, 0); + ilower[1] = hypre_BoxIMinD(box, 1); + iupper[0] = hypre_BoxIMaxD(box, 0); + iupper[1] = hypre_BoxIMaxD(box, 1); if (dim == 2) - values = (double*) malloc(ni*nj*sizeof(double)); + { + values = (double*) malloc(ni * nj * sizeof(double)); + } else { - values = (double*) malloc(ni*nj*nk*sizeof(double)); - ilower[2] = hypre_BoxIMinD(box,2); - iupper[2] = hypre_BoxIMaxD(box,2); + values = (double*) malloc(ni * nj * nk * sizeof(double)); + ilower[2] = hypre_BoxIMinD(box, 2); + iupper[2] = hypre_BoxIMaxD(box, 2); } HYPRE_StructVectorGetBoxValues(sol, ilower, iupper, values); @@ -795,7 +812,9 @@ void GLVis_PrintStructVector(HYPRE_StructVector sol, for (k = 0; k < nk; k++) for (j = 0; j < nj; j++) for (i = 0; i < ni; i++) - fprintf(file, "%.14e\n", values[i + j*ni]); + { + fprintf(file, "%.14e\n", values[i + j * ni]); + } free(values); } diff --git a/external/hypre/src/examples/vis/README b/external/hypre/src/examples/vis/README index d33b497e..5c301778 100644 --- a/external/hypre/src/examples/vis/README +++ b/external/hypre/src/examples/vis/README @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/examples/vis/glvis-ex1.sh b/external/hypre/src/examples/vis/glvis-ex1.sh old mode 100644 new mode 100755 index 745c0e26..166a3c47 --- a/external/hypre/src/examples/vis/glvis-ex1.sh +++ b/external/hypre/src/examples/vis/glvis-ex1.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/examples/vis/glvis-ex10.sh b/external/hypre/src/examples/vis/glvis-ex10.sh old mode 100644 new mode 100755 index 99a56ea3..0029802e --- a/external/hypre/src/examples/vis/glvis-ex10.sh +++ b/external/hypre/src/examples/vis/glvis-ex10.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/examples/vis/glvis-ex11.sh b/external/hypre/src/examples/vis/glvis-ex11.sh old mode 100644 new mode 100755 index a046b97a..d0123ef0 --- a/external/hypre/src/examples/vis/glvis-ex11.sh +++ b/external/hypre/src/examples/vis/glvis-ex11.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/examples/vis/glvis-ex12.sh b/external/hypre/src/examples/vis/glvis-ex12.sh old mode 100644 new mode 100755 index d69875d7..90dc07bc --- a/external/hypre/src/examples/vis/glvis-ex12.sh +++ b/external/hypre/src/examples/vis/glvis-ex12.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/examples/vis/glvis-ex13.sh b/external/hypre/src/examples/vis/glvis-ex13.sh old mode 100644 new mode 100755 index 1d3dd0f6..5fab1f57 --- a/external/hypre/src/examples/vis/glvis-ex13.sh +++ b/external/hypre/src/examples/vis/glvis-ex13.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/examples/vis/glvis-ex14.sh b/external/hypre/src/examples/vis/glvis-ex14.sh old mode 100644 new mode 100755 index 276be08a..849da057 --- a/external/hypre/src/examples/vis/glvis-ex14.sh +++ b/external/hypre/src/examples/vis/glvis-ex14.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/examples/vis/glvis-ex15.sh b/external/hypre/src/examples/vis/glvis-ex15.sh old mode 100644 new mode 100755 index 6187e000..328cdc17 --- a/external/hypre/src/examples/vis/glvis-ex15.sh +++ b/external/hypre/src/examples/vis/glvis-ex15.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/examples/vis/glvis-ex16.sh b/external/hypre/src/examples/vis/glvis-ex16.sh old mode 100644 new mode 100755 index c71a820f..056acf6b --- a/external/hypre/src/examples/vis/glvis-ex16.sh +++ b/external/hypre/src/examples/vis/glvis-ex16.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/examples/vis/glvis-ex2.sh b/external/hypre/src/examples/vis/glvis-ex2.sh old mode 100644 new mode 100755 index 6a2375c6..5e99fa13 --- a/external/hypre/src/examples/vis/glvis-ex2.sh +++ b/external/hypre/src/examples/vis/glvis-ex2.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/examples/vis/glvis-ex3.sh b/external/hypre/src/examples/vis/glvis-ex3.sh old mode 100644 new mode 100755 index ca6f51b3..a452f8e3 --- a/external/hypre/src/examples/vis/glvis-ex3.sh +++ b/external/hypre/src/examples/vis/glvis-ex3.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/examples/vis/glvis-ex4.sh b/external/hypre/src/examples/vis/glvis-ex4.sh old mode 100644 new mode 100755 index 25e524cf..592e116e --- a/external/hypre/src/examples/vis/glvis-ex4.sh +++ b/external/hypre/src/examples/vis/glvis-ex4.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/examples/vis/glvis-ex5.sh b/external/hypre/src/examples/vis/glvis-ex5.sh old mode 100644 new mode 100755 index 42c65ed5..deedf0ab --- a/external/hypre/src/examples/vis/glvis-ex5.sh +++ b/external/hypre/src/examples/vis/glvis-ex5.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/examples/vis/glvis-ex6.sh b/external/hypre/src/examples/vis/glvis-ex6.sh old mode 100644 new mode 100755 index e806c7d0..0eb025af --- a/external/hypre/src/examples/vis/glvis-ex6.sh +++ b/external/hypre/src/examples/vis/glvis-ex6.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/examples/vis/glvis-ex7.sh b/external/hypre/src/examples/vis/glvis-ex7.sh old mode 100644 new mode 100755 index 37f566d4..564a6eb7 --- a/external/hypre/src/examples/vis/glvis-ex7.sh +++ b/external/hypre/src/examples/vis/glvis-ex7.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/examples/vis/glvis-ex8.sh b/external/hypre/src/examples/vis/glvis-ex8.sh old mode 100644 new mode 100755 index 4ecef357..e15b4eee --- a/external/hypre/src/examples/vis/glvis-ex8.sh +++ b/external/hypre/src/examples/vis/glvis-ex8.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/examples/vis/glvis-ex9.sh b/external/hypre/src/examples/vis/glvis-ex9.sh old mode 100644 new mode 100755 index 4f49f612..f6d3bda6 --- a/external/hypre/src/examples/vis/glvis-ex9.sh +++ b/external/hypre/src/examples/vis/glvis-ex9.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/krylov/CMakeLists.txt b/external/hypre/src/krylov/CMakeLists.txt index 63daa088..f1506709 100644 --- a/external/hypre/src/krylov/CMakeLists.txt +++ b/external/hypre/src/krylov/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/krylov/HYPRE_MatvecFunctions.h b/external/hypre/src/krylov/HYPRE_MatvecFunctions.h index 6011672b..47ca7f38 100644 --- a/external/hypre/src/krylov/HYPRE_MatvecFunctions.h +++ b/external/hypre/src/krylov/HYPRE_MatvecFunctions.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -14,7 +14,7 @@ typedef struct HYPRE_Int (*Matvec) ( void *matvec_data, HYPRE_Complex alpha, void *A, void *x, HYPRE_Complex beta, void *y ); HYPRE_Int (*MatvecDestroy) ( void *matvec_data ); - + void* (*MatMultiVecCreate) ( void *A, void *x ); HYPRE_Int (*MatMultiVec) ( void *data, HYPRE_Complex alpha, void *A, void *x, HYPRE_Complex beta, void *y ); diff --git a/external/hypre/src/krylov/HYPRE_bicgstab.c b/external/hypre/src/krylov/HYPRE_bicgstab.c index 43eefcf0..923271fc 100644 --- a/external/hypre/src/krylov/HYPRE_bicgstab.c +++ b/external/hypre/src/krylov/HYPRE_bicgstab.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -21,42 +21,36 @@ * HYPRE_BiCGSTABDestroy *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_BiCGSTABDestroy( HYPRE_Solver solver ) { - return( hypre_BiCGSTABDestroy( (void *) solver ) ); + return ( hypre_BiCGSTABDestroy( (void *) solver ) ); } /*-------------------------------------------------------------------------- * HYPRE_BiCGSTABSetup *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_BiCGSTABSetup( HYPRE_Solver solver, - HYPRE_Matrix A, - HYPRE_Vector b, - HYPRE_Vector x ) + HYPRE_Matrix A, + HYPRE_Vector b, + HYPRE_Vector x ) { - return( hypre_BiCGSTABSetup( (void *) solver, - (void *) A, - (void *) b, - (void *) x ) ); + return ( hypre_BiCGSTABSetup( solver, A, b, x ) ); } /*-------------------------------------------------------------------------- * HYPRE_BiCGSTABSolve *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_BiCGSTABSolve( HYPRE_Solver solver, - HYPRE_Matrix A, - HYPRE_Vector b, - HYPRE_Vector x ) + HYPRE_Matrix A, + HYPRE_Vector b, + HYPRE_Vector x ) { - return( hypre_BiCGSTABSolve( (void *) solver, - (void *) A, - (void *) b, - (void *) x ) ); + return ( hypre_BiCGSTABSolve( solver, A, b, x ) ); } /*-------------------------------------------------------------------------- @@ -65,9 +59,9 @@ HYPRE_BiCGSTABSolve( HYPRE_Solver solver, HYPRE_Int HYPRE_BiCGSTABSetTol( HYPRE_Solver solver, - HYPRE_Real tol ) + HYPRE_Real tol ) { - return( hypre_BiCGSTABSetTol( (void *) solver, tol ) ); + return ( hypre_BiCGSTABSetTol( (void *) solver, tol ) ); } /*-------------------------------------------------------------------------- * HYPRE_BiCGSTABSetAbsoluteTol @@ -75,9 +69,9 @@ HYPRE_BiCGSTABSetTol( HYPRE_Solver solver, HYPRE_Int HYPRE_BiCGSTABSetAbsoluteTol( HYPRE_Solver solver, - HYPRE_Real a_tol ) + HYPRE_Real a_tol ) { - return( hypre_BiCGSTABSetAbsoluteTol( (void *) solver, a_tol ) ); + return ( hypre_BiCGSTABSetAbsoluteTol( (void *) solver, a_tol ) ); } /*-------------------------------------------------------------------------- * HYPRE_BiCGSTABSetConvergenceFactorTol @@ -85,9 +79,9 @@ HYPRE_BiCGSTABSetAbsoluteTol( HYPRE_Solver solver, HYPRE_Int HYPRE_BiCGSTABSetConvergenceFactorTol( HYPRE_Solver solver, - HYPRE_Real cf_tol ) + HYPRE_Real cf_tol ) { - return( hypre_BiCGSTABSetConvergenceFactorTol( (void *) solver, cf_tol ) ); + return ( hypre_BiCGSTABSetConvergenceFactorTol( (void *) solver, cf_tol ) ); } /*-------------------------------------------------------------------------- @@ -96,9 +90,9 @@ HYPRE_BiCGSTABSetConvergenceFactorTol( HYPRE_Solver solver, HYPRE_Int HYPRE_BiCGSTABSetMinIter( HYPRE_Solver solver, - HYPRE_Int min_iter ) + HYPRE_Int min_iter ) { - return( hypre_BiCGSTABSetMinIter( (void *) solver, min_iter ) ); + return ( hypre_BiCGSTABSetMinIter( (void *) solver, min_iter ) ); } /*-------------------------------------------------------------------------- @@ -107,9 +101,9 @@ HYPRE_BiCGSTABSetMinIter( HYPRE_Solver solver, HYPRE_Int HYPRE_BiCGSTABSetMaxIter( HYPRE_Solver solver, - HYPRE_Int max_iter ) + HYPRE_Int max_iter ) { - return( hypre_BiCGSTABSetMaxIter( (void *) solver, max_iter ) ); + return ( hypre_BiCGSTABSetMaxIter( (void *) solver, max_iter ) ); } /*-------------------------------------------------------------------------- @@ -118,9 +112,9 @@ HYPRE_BiCGSTABSetMaxIter( HYPRE_Solver solver, HYPRE_Int HYPRE_BiCGSTABSetStopCrit( HYPRE_Solver solver, - HYPRE_Int stop_crit ) + HYPRE_Int stop_crit ) { - return( hypre_BiCGSTABSetStopCrit( (void *) solver, stop_crit ) ); + return ( hypre_BiCGSTABSetStopCrit( (void *) solver, stop_crit ) ); } /*-------------------------------------------------------------------------- @@ -129,14 +123,14 @@ HYPRE_BiCGSTABSetStopCrit( HYPRE_Solver solver, HYPRE_Int HYPRE_BiCGSTABSetPrecond( HYPRE_Solver solver, - HYPRE_PtrToSolverFcn precond, - HYPRE_PtrToSolverFcn precond_setup, - HYPRE_Solver precond_solver ) + HYPRE_PtrToSolverFcn precond, + HYPRE_PtrToSolverFcn precond_setup, + HYPRE_Solver precond_solver ) { - return( hypre_BiCGSTABSetPrecond( (void *) solver, - (HYPRE_Int (*)(void*, void*, void*, void*))precond, - (HYPRE_Int (*)(void*, void*, void*, void*))precond_setup, - (void *) precond_solver ) ); + return ( hypre_BiCGSTABSetPrecond( (void *) solver, + (HYPRE_Int (*)(void*, void*, void*, void*))precond, + (HYPRE_Int (*)(void*, void*, void*, void*))precond_setup, + (void *) precond_solver ) ); } /*-------------------------------------------------------------------------- @@ -145,10 +139,10 @@ HYPRE_BiCGSTABSetPrecond( HYPRE_Solver solver, HYPRE_Int HYPRE_BiCGSTABGetPrecond( HYPRE_Solver solver, - HYPRE_Solver *precond_data_ptr ) + HYPRE_Solver *precond_data_ptr ) { - return( hypre_BiCGSTABGetPrecond( (void *) solver, - (HYPRE_Solver *) precond_data_ptr ) ); + return ( hypre_BiCGSTABGetPrecond( (void *) solver, + (HYPRE_Solver *) precond_data_ptr ) ); } /*-------------------------------------------------------------------------- @@ -157,9 +151,9 @@ HYPRE_BiCGSTABGetPrecond( HYPRE_Solver solver, HYPRE_Int HYPRE_BiCGSTABSetLogging( HYPRE_Solver solver, - HYPRE_Int logging) + HYPRE_Int logging) { - return( hypre_BiCGSTABSetLogging( (void *) solver, logging ) ); + return ( hypre_BiCGSTABSetLogging( (void *) solver, logging ) ); } /*-------------------------------------------------------------------------- @@ -170,7 +164,7 @@ HYPRE_Int HYPRE_BiCGSTABSetPrintLevel( HYPRE_Solver solver, HYPRE_Int print_level) { - return( hypre_BiCGSTABSetPrintLevel( (void *) solver, print_level ) ); + return ( hypre_BiCGSTABSetPrintLevel( (void *) solver, print_level ) ); } /*-------------------------------------------------------------------------- @@ -179,9 +173,9 @@ HYPRE_BiCGSTABSetPrintLevel( HYPRE_Solver solver, HYPRE_Int HYPRE_BiCGSTABGetNumIterations( HYPRE_Solver solver, - HYPRE_Int *num_iterations ) + HYPRE_Int *num_iterations ) { - return( hypre_BiCGSTABGetNumIterations( (void *) solver, num_iterations ) ); + return ( hypre_BiCGSTABGetNumIterations( (void *) solver, num_iterations ) ); } /*-------------------------------------------------------------------------- @@ -190,9 +184,9 @@ HYPRE_BiCGSTABGetNumIterations( HYPRE_Solver solver, HYPRE_Int HYPRE_BiCGSTABGetFinalRelativeResidualNorm( HYPRE_Solver solver, - HYPRE_Real *norm ) + HYPRE_Real *norm ) { - return( hypre_BiCGSTABGetFinalRelativeResidualNorm( (void *) solver, norm ) ); + return ( hypre_BiCGSTABGetFinalRelativeResidualNorm( (void *) solver, norm ) ); } /*-------------------------------------------------------------------------- @@ -201,7 +195,7 @@ HYPRE_BiCGSTABGetFinalRelativeResidualNorm( HYPRE_Solver solver, HYPRE_Int HYPRE_BiCGSTABGetResidual( HYPRE_Solver solver, - void *residual ) + void *residual ) { - return( hypre_BiCGSTABGetResidual( (void *) solver, (void **) residual ) ); + return ( hypre_BiCGSTABGetResidual( (void *) solver, (void **) residual ) ); } diff --git a/external/hypre/src/krylov/HYPRE_cgnr.c b/external/hypre/src/krylov/HYPRE_cgnr.c index dde357ad..01b51daa 100644 --- a/external/hypre/src/krylov/HYPRE_cgnr.c +++ b/external/hypre/src/krylov/HYPRE_cgnr.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -21,36 +21,36 @@ * HYPRE_CGNRDestroy *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_CGNRDestroy( HYPRE_Solver solver ) { - return( hypre_CGNRDestroy( (void *) solver ) ); + return ( hypre_CGNRDestroy( (void *) solver ) ); } /*-------------------------------------------------------------------------- * HYPRE_CGNRSetup *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_CGNRSetup( HYPRE_Solver solver, - HYPRE_Matrix A, - HYPRE_Vector b, - HYPRE_Vector x ) + HYPRE_Matrix A, + HYPRE_Vector b, + HYPRE_Vector x ) { - return( hypre_CGNRSetup( solver, A, b, x ) ); + return ( hypre_CGNRSetup( solver, A, b, x ) ); } /*-------------------------------------------------------------------------- * HYPRE_CGNRSolve *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_CGNRSolve( HYPRE_Solver solver, - HYPRE_Matrix A, - HYPRE_Vector b, - HYPRE_Vector x ) + HYPRE_Matrix A, + HYPRE_Vector b, + HYPRE_Vector x ) { - return( hypre_CGNRSolve( solver, A, b, x ) ); + return ( hypre_CGNRSolve( solver, A, b, x ) ); } /*-------------------------------------------------------------------------- @@ -59,9 +59,9 @@ HYPRE_CGNRSolve( HYPRE_Solver solver, HYPRE_Int HYPRE_CGNRSetTol( HYPRE_Solver solver, - HYPRE_Real tol ) + HYPRE_Real tol ) { - return( hypre_CGNRSetTol( (void *) solver, tol ) ); + return ( hypre_CGNRSetTol( (void *) solver, tol ) ); } /*-------------------------------------------------------------------------- @@ -70,9 +70,9 @@ HYPRE_CGNRSetTol( HYPRE_Solver solver, HYPRE_Int HYPRE_CGNRSetMinIter( HYPRE_Solver solver, - HYPRE_Int min_iter ) + HYPRE_Int min_iter ) { - return( hypre_CGNRSetMinIter( (void *) solver, min_iter ) ); + return ( hypre_CGNRSetMinIter( (void *) solver, min_iter ) ); } /*-------------------------------------------------------------------------- @@ -81,9 +81,9 @@ HYPRE_CGNRSetMinIter( HYPRE_Solver solver, HYPRE_Int HYPRE_CGNRSetMaxIter( HYPRE_Solver solver, - HYPRE_Int max_iter ) + HYPRE_Int max_iter ) { - return( hypre_CGNRSetMaxIter( (void *) solver, max_iter ) ); + return ( hypre_CGNRSetMaxIter( (void *) solver, max_iter ) ); } /*-------------------------------------------------------------------------- @@ -92,9 +92,9 @@ HYPRE_CGNRSetMaxIter( HYPRE_Solver solver, HYPRE_Int HYPRE_CGNRSetStopCrit( HYPRE_Solver solver, - HYPRE_Int stop_crit ) + HYPRE_Int stop_crit ) { - return( hypre_CGNRSetStopCrit( (void *) solver, stop_crit ) ); + return ( hypre_CGNRSetStopCrit( (void *) solver, stop_crit ) ); } /*-------------------------------------------------------------------------- @@ -103,16 +103,16 @@ HYPRE_CGNRSetStopCrit( HYPRE_Solver solver, HYPRE_Int HYPRE_CGNRSetPrecond( HYPRE_Solver solver, - HYPRE_PtrToSolverFcn precond, - HYPRE_PtrToSolverFcn precondT, - HYPRE_PtrToSolverFcn precond_setup, - HYPRE_Solver precond_solver ) + HYPRE_PtrToSolverFcn precond, + HYPRE_PtrToSolverFcn precondT, + HYPRE_PtrToSolverFcn precond_setup, + HYPRE_Solver precond_solver ) { - return( hypre_CGNRSetPrecond( (void *) solver, - (HYPRE_Int (*)(void*, void*, void*, void*))precond, - (HYPRE_Int (*)(void*, void*, void*, void*))precondT, - (HYPRE_Int (*)(void*, void*, void*, void*))precond_setup, - (void *) precond_solver ) ); + return ( hypre_CGNRSetPrecond( (void *) solver, + (HYPRE_Int (*)(void*, void*, void*, void*))precond, + (HYPRE_Int (*)(void*, void*, void*, void*))precondT, + (HYPRE_Int (*)(void*, void*, void*, void*))precond_setup, + (void *) precond_solver ) ); } /*-------------------------------------------------------------------------- @@ -121,10 +121,10 @@ HYPRE_CGNRSetPrecond( HYPRE_Solver solver, HYPRE_Int HYPRE_CGNRGetPrecond( HYPRE_Solver solver, - HYPRE_Solver *precond_data_ptr ) + HYPRE_Solver *precond_data_ptr ) { - return( hypre_CGNRGetPrecond( (void *) solver, - (HYPRE_Solver *) precond_data_ptr ) ); + return ( hypre_CGNRGetPrecond( (void *) solver, + (HYPRE_Solver *) precond_data_ptr ) ); } /*-------------------------------------------------------------------------- @@ -133,9 +133,9 @@ HYPRE_CGNRGetPrecond( HYPRE_Solver solver, HYPRE_Int HYPRE_CGNRSetLogging( HYPRE_Solver solver, - HYPRE_Int logging) + HYPRE_Int logging) { - return( hypre_CGNRSetLogging( (void *) solver, logging ) ); + return ( hypre_CGNRSetLogging( (void *) solver, logging ) ); } /*-------------------------------------------------------------------------- @@ -144,9 +144,9 @@ HYPRE_CGNRSetLogging( HYPRE_Solver solver, HYPRE_Int HYPRE_CGNRGetNumIterations( HYPRE_Solver solver, - HYPRE_Int *num_iterations ) + HYPRE_Int *num_iterations ) { - return( hypre_CGNRGetNumIterations( (void *) solver, num_iterations ) ); + return ( hypre_CGNRGetNumIterations( (void *) solver, num_iterations ) ); } /*-------------------------------------------------------------------------- @@ -155,7 +155,7 @@ HYPRE_CGNRGetNumIterations( HYPRE_Solver solver, HYPRE_Int HYPRE_CGNRGetFinalRelativeResidualNorm( HYPRE_Solver solver, - HYPRE_Real *norm ) + HYPRE_Real *norm ) { - return( hypre_CGNRGetFinalRelativeResidualNorm( (void *) solver, norm ) ); + return ( hypre_CGNRGetFinalRelativeResidualNorm( (void *) solver, norm ) ); } diff --git a/external/hypre/src/krylov/HYPRE_cogmres.c b/external/hypre/src/krylov/HYPRE_cogmres.c index aed6aaa3..149a4f9f 100644 --- a/external/hypre/src/krylov/HYPRE_cogmres.c +++ b/external/hypre/src/krylov/HYPRE_cogmres.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,7 +17,7 @@ *--------------------------------------------------------------------------*/ /* to do, not trivial */ /* -HYPRE_Int +HYPRE_Int HYPRE_ParCSRCOGMRESDestroy( HYPRE_Solver solver ) { return( hypre_COGMRESDestroy( (void *) solver ) ); @@ -28,32 +28,26 @@ HYPRE_ParCSRCOGMRESDestroy( HYPRE_Solver solver ) * HYPRE_COGMRESSetup *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_COGMRESSetup( HYPRE_Solver solver, - HYPRE_Matrix A, - HYPRE_Vector b, - HYPRE_Vector x ) + HYPRE_Matrix A, + HYPRE_Vector b, + HYPRE_Vector x ) { - return( hypre_COGMRESSetup( solver, - A, - b, - x ) ); + return ( hypre_COGMRESSetup( solver, A, b, x ) ); } /*-------------------------------------------------------------------------- * HYPRE_COGMRESSolve *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_COGMRESSolve( HYPRE_Solver solver, - HYPRE_Matrix A, - HYPRE_Vector b, - HYPRE_Vector x ) + HYPRE_Matrix A, + HYPRE_Vector b, + HYPRE_Vector x ) { - return( hypre_COGMRESSolve( solver, - A, - b, - x ) ); + return ( hypre_COGMRESSolve( solver, A, b, x ) ); } /*-------------------------------------------------------------------------- @@ -62,16 +56,16 @@ HYPRE_COGMRESSolve( HYPRE_Solver solver, HYPRE_Int HYPRE_COGMRESSetKDim( HYPRE_Solver solver, - HYPRE_Int k_dim ) + HYPRE_Int k_dim ) { - return( hypre_COGMRESSetKDim( (void *) solver, k_dim ) ); + return ( hypre_COGMRESSetKDim( (void *) solver, k_dim ) ); } HYPRE_Int HYPRE_COGMRESGetKDim( HYPRE_Solver solver, - HYPRE_Int * k_dim ) + HYPRE_Int * k_dim ) { - return( hypre_COGMRESGetKDim( (void *) solver, k_dim ) ); + return ( hypre_COGMRESGetKDim( (void *) solver, k_dim ) ); } /*-------------------------------------------------------------------------- @@ -80,16 +74,16 @@ HYPRE_COGMRESGetKDim( HYPRE_Solver solver, HYPRE_Int HYPRE_COGMRESSetUnroll( HYPRE_Solver solver, - HYPRE_Int unroll ) + HYPRE_Int unroll ) { - return( hypre_COGMRESSetUnroll( (void *) solver, unroll ) ); + return ( hypre_COGMRESSetUnroll( (void *) solver, unroll ) ); } HYPRE_Int HYPRE_COGMRESGetUnroll( HYPRE_Solver solver, - HYPRE_Int * unroll ) + HYPRE_Int * unroll ) { - return( hypre_COGMRESGetUnroll( (void *) solver, unroll ) ); + return ( hypre_COGMRESGetUnroll( (void *) solver, unroll ) ); } /*-------------------------------------------------------------------------- @@ -98,16 +92,16 @@ HYPRE_COGMRESGetUnroll( HYPRE_Solver solver, HYPRE_Int HYPRE_COGMRESSetCGS( HYPRE_Solver solver, - HYPRE_Int cgs ) + HYPRE_Int cgs ) { - return( hypre_COGMRESSetCGS( (void *) solver, cgs ) ); + return ( hypre_COGMRESSetCGS( (void *) solver, cgs ) ); } HYPRE_Int HYPRE_COGMRESGetCGS( HYPRE_Solver solver, - HYPRE_Int * cgs ) + HYPRE_Int * cgs ) { - return( hypre_COGMRESGetCGS( (void *) solver, cgs ) ); + return ( hypre_COGMRESGetCGS( (void *) solver, cgs ) ); } /*-------------------------------------------------------------------------- @@ -116,16 +110,16 @@ HYPRE_COGMRESGetCGS( HYPRE_Solver solver, HYPRE_Int HYPRE_COGMRESSetTol( HYPRE_Solver solver, - HYPRE_Real tol ) + HYPRE_Real tol ) { - return( hypre_COGMRESSetTol( (void *) solver, tol ) ); + return ( hypre_COGMRESSetTol( (void *) solver, tol ) ); } HYPRE_Int HYPRE_COGMRESGetTol( HYPRE_Solver solver, - HYPRE_Real * tol ) + HYPRE_Real * tol ) { - return( hypre_COGMRESGetTol( (void *) solver, tol ) ); + return ( hypre_COGMRESGetTol( (void *) solver, tol ) ); } /*-------------------------------------------------------------------------- * HYPRE_COGMRESSetAbsoluteTol, HYPRE_COGMRESGetAbsoluteTol @@ -133,16 +127,16 @@ HYPRE_COGMRESGetTol( HYPRE_Solver solver, HYPRE_Int HYPRE_COGMRESSetAbsoluteTol( HYPRE_Solver solver, - HYPRE_Real a_tol ) + HYPRE_Real a_tol ) { - return( hypre_COGMRESSetAbsoluteTol( (void *) solver, a_tol ) ); + return ( hypre_COGMRESSetAbsoluteTol( (void *) solver, a_tol ) ); } HYPRE_Int HYPRE_COGMRESGetAbsoluteTol( HYPRE_Solver solver, - HYPRE_Real * a_tol ) + HYPRE_Real * a_tol ) { - return( hypre_COGMRESGetAbsoluteTol( (void *) solver, a_tol ) ); + return ( hypre_COGMRESGetAbsoluteTol( (void *) solver, a_tol ) ); } /*-------------------------------------------------------------------------- @@ -151,16 +145,16 @@ HYPRE_COGMRESGetAbsoluteTol( HYPRE_Solver solver, HYPRE_Int HYPRE_COGMRESSetConvergenceFactorTol( HYPRE_Solver solver, - HYPRE_Real cf_tol ) + HYPRE_Real cf_tol ) { - return( hypre_COGMRESSetConvergenceFactorTol( (void *) solver, cf_tol ) ); + return ( hypre_COGMRESSetConvergenceFactorTol( (void *) solver, cf_tol ) ); } HYPRE_Int HYPRE_COGMRESGetConvergenceFactorTol( HYPRE_Solver solver, - HYPRE_Real * cf_tol ) + HYPRE_Real * cf_tol ) { - return( hypre_COGMRESGetConvergenceFactorTol( (void *) solver, cf_tol ) ); + return ( hypre_COGMRESGetConvergenceFactorTol( (void *) solver, cf_tol ) ); } /*-------------------------------------------------------------------------- @@ -169,16 +163,16 @@ HYPRE_COGMRESGetConvergenceFactorTol( HYPRE_Solver solver, HYPRE_Int HYPRE_COGMRESSetMinIter( HYPRE_Solver solver, - HYPRE_Int min_iter ) + HYPRE_Int min_iter ) { - return( hypre_COGMRESSetMinIter( (void *) solver, min_iter ) ); + return ( hypre_COGMRESSetMinIter( (void *) solver, min_iter ) ); } HYPRE_Int HYPRE_COGMRESGetMinIter( HYPRE_Solver solver, - HYPRE_Int * min_iter ) + HYPRE_Int * min_iter ) { - return( hypre_COGMRESGetMinIter( (void *) solver, min_iter ) ); + return ( hypre_COGMRESGetMinIter( (void *) solver, min_iter ) ); } /*-------------------------------------------------------------------------- @@ -187,16 +181,16 @@ HYPRE_COGMRESGetMinIter( HYPRE_Solver solver, HYPRE_Int HYPRE_COGMRESSetMaxIter( HYPRE_Solver solver, - HYPRE_Int max_iter ) + HYPRE_Int max_iter ) { - return( hypre_COGMRESSetMaxIter( (void *) solver, max_iter ) ); + return ( hypre_COGMRESSetMaxIter( (void *) solver, max_iter ) ); } HYPRE_Int HYPRE_COGMRESGetMaxIter( HYPRE_Solver solver, - HYPRE_Int * max_iter ) + HYPRE_Int * max_iter ) { - return( hypre_COGMRESGetMaxIter( (void *) solver, max_iter ) ); + return ( hypre_COGMRESGetMaxIter( (void *) solver, max_iter ) ); } @@ -207,14 +201,14 @@ HYPRE_COGMRESGetMaxIter( HYPRE_Solver solver, HYPRE_Int HYPRE_COGMRESSetPrecond( HYPRE_Solver solver, - HYPRE_PtrToSolverFcn precond, - HYPRE_PtrToSolverFcn precond_setup, - HYPRE_Solver precond_solver ) + HYPRE_PtrToSolverFcn precond, + HYPRE_PtrToSolverFcn precond_setup, + HYPRE_Solver precond_solver ) { - return( hypre_COGMRESSetPrecond( (void *) solver, - (HYPRE_Int (*)(void*, void*, void*, void*))precond, - (HYPRE_Int (*)(void*, void*, void*, void*))precond_setup, - (void *) precond_solver ) ); + return ( hypre_COGMRESSetPrecond( (void *) solver, + (HYPRE_Int (*)(void*, void*, void*, void*))precond, + (HYPRE_Int (*)(void*, void*, void*, void*))precond_setup, + (void *) precond_solver ) ); } /*-------------------------------------------------------------------------- @@ -223,10 +217,10 @@ HYPRE_COGMRESSetPrecond( HYPRE_Solver solver, HYPRE_Int HYPRE_COGMRESGetPrecond( HYPRE_Solver solver, - HYPRE_Solver *precond_data_ptr ) + HYPRE_Solver *precond_data_ptr ) { - return( hypre_COGMRESGetPrecond( (void *) solver, - (HYPRE_Solver *) precond_data_ptr ) ); + return ( hypre_COGMRESGetPrecond( (void *) solver, + (HYPRE_Solver *) precond_data_ptr ) ); } /*-------------------------------------------------------------------------- @@ -235,16 +229,16 @@ HYPRE_COGMRESGetPrecond( HYPRE_Solver solver, HYPRE_Int HYPRE_COGMRESSetPrintLevel( HYPRE_Solver solver, - HYPRE_Int level ) + HYPRE_Int level ) { - return( hypre_COGMRESSetPrintLevel( (void *) solver, level ) ); + return ( hypre_COGMRESSetPrintLevel( (void *) solver, level ) ); } HYPRE_Int HYPRE_COGMRESGetPrintLevel( HYPRE_Solver solver, - HYPRE_Int * level ) + HYPRE_Int * level ) { - return( hypre_COGMRESGetPrintLevel( (void *) solver, level ) ); + return ( hypre_COGMRESGetPrintLevel( (void *) solver, level ) ); } /*-------------------------------------------------------------------------- @@ -253,16 +247,16 @@ HYPRE_COGMRESGetPrintLevel( HYPRE_Solver solver, HYPRE_Int HYPRE_COGMRESSetLogging( HYPRE_Solver solver, - HYPRE_Int level ) + HYPRE_Int level ) { - return( hypre_COGMRESSetLogging( (void *) solver, level ) ); + return ( hypre_COGMRESSetLogging( (void *) solver, level ) ); } HYPRE_Int HYPRE_COGMRESGetLogging( HYPRE_Solver solver, - HYPRE_Int * level ) + HYPRE_Int * level ) { - return( hypre_COGMRESGetLogging( (void *) solver, level ) ); + return ( hypre_COGMRESGetLogging( (void *) solver, level ) ); } /*-------------------------------------------------------------------------- @@ -271,9 +265,9 @@ HYPRE_COGMRESGetLogging( HYPRE_Solver solver, HYPRE_Int HYPRE_COGMRESGetNumIterations( HYPRE_Solver solver, - HYPRE_Int *num_iterations ) + HYPRE_Int *num_iterations ) { - return( hypre_COGMRESGetNumIterations( (void *) solver, num_iterations ) ); + return ( hypre_COGMRESGetNumIterations( (void *) solver, num_iterations ) ); } /*-------------------------------------------------------------------------- @@ -282,9 +276,9 @@ HYPRE_COGMRESGetNumIterations( HYPRE_Solver solver, HYPRE_Int HYPRE_COGMRESGetConverged( HYPRE_Solver solver, - HYPRE_Int *converged ) + HYPRE_Int *converged ) { - return( hypre_COGMRESGetConverged( (void *) solver, converged ) ); + return ( hypre_COGMRESGetConverged( (void *) solver, converged ) ); } /*-------------------------------------------------------------------------- @@ -293,9 +287,9 @@ HYPRE_COGMRESGetConverged( HYPRE_Solver solver, HYPRE_Int HYPRE_COGMRESGetFinalRelativeResidualNorm( HYPRE_Solver solver, - HYPRE_Real *norm ) + HYPRE_Real *norm ) { - return( hypre_COGMRESGetFinalRelativeResidualNorm( (void *) solver, norm ) ); + return ( hypre_COGMRESGetFinalRelativeResidualNorm( (void *) solver, norm ) ); } /*-------------------------------------------------------------------------- @@ -312,13 +306,14 @@ HYPRE_Int HYPRE_COGMRESGetResidual( HYPRE_Solver solver, void *residual ) /*-------------------------------------------------------------------------- * HYPRE_COGMRESSetModifyPC *--------------------------------------------------------------------------*/ - + HYPRE_Int HYPRE_COGMRESSetModifyPC( HYPRE_Solver solver, - HYPRE_Int (*modify_pc)(HYPRE_Solver, HYPRE_Int, HYPRE_Real) ) + HYPRE_Int (*modify_pc)(HYPRE_Solver, HYPRE_Int, HYPRE_Real) ) { - return hypre_COGMRESSetModifyPC( (void *) solver, (HYPRE_Int(*)(void*, HYPRE_Int, HYPRE_Real))modify_pc); - + return hypre_COGMRESSetModifyPC( (void *) solver, (HYPRE_Int(*)(void*, HYPRE_Int, + HYPRE_Real))modify_pc); + } diff --git a/external/hypre/src/krylov/HYPRE_flexgmres.c b/external/hypre/src/krylov/HYPRE_flexgmres.c index 42f42661..f0299f1f 100644 --- a/external/hypre/src/krylov/HYPRE_flexgmres.c +++ b/external/hypre/src/krylov/HYPRE_flexgmres.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,7 +17,7 @@ *--------------------------------------------------------------------------*/ /* to do, not trivial */ /* -HYPRE_Int +HYPRE_Int HYPRE_ParCSRFlexGMRESDestroy( HYPRE_Solver solver ) { return( hypre_FlexGMRESDestroy( (void *) solver ) ); @@ -28,32 +28,26 @@ HYPRE_ParCSRFlexGMRESDestroy( HYPRE_Solver solver ) * HYPRE_FlexGMRESSetup *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_FlexGMRESSetup( HYPRE_Solver solver, - HYPRE_Matrix A, - HYPRE_Vector b, - HYPRE_Vector x ) + HYPRE_Matrix A, + HYPRE_Vector b, + HYPRE_Vector x ) { - return( hypre_FlexGMRESSetup( solver, - A, - b, - x ) ); + return ( hypre_FlexGMRESSetup( solver, A, b, x ) ); } /*-------------------------------------------------------------------------- * HYPRE_FlexGMRESSolve *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_FlexGMRESSolve( HYPRE_Solver solver, - HYPRE_Matrix A, - HYPRE_Vector b, - HYPRE_Vector x ) + HYPRE_Matrix A, + HYPRE_Vector b, + HYPRE_Vector x ) { - return( hypre_FlexGMRESSolve( solver, - A, - b, - x ) ); + return ( hypre_FlexGMRESSolve( solver, A, b, x ) ); } /*-------------------------------------------------------------------------- @@ -62,16 +56,16 @@ HYPRE_FlexGMRESSolve( HYPRE_Solver solver, HYPRE_Int HYPRE_FlexGMRESSetKDim( HYPRE_Solver solver, - HYPRE_Int k_dim ) + HYPRE_Int k_dim ) { - return( hypre_FlexGMRESSetKDim( (void *) solver, k_dim ) ); + return ( hypre_FlexGMRESSetKDim( (void *) solver, k_dim ) ); } HYPRE_Int HYPRE_FlexGMRESGetKDim( HYPRE_Solver solver, - HYPRE_Int * k_dim ) + HYPRE_Int * k_dim ) { - return( hypre_FlexGMRESGetKDim( (void *) solver, k_dim ) ); + return ( hypre_FlexGMRESGetKDim( (void *) solver, k_dim ) ); } /*-------------------------------------------------------------------------- @@ -80,16 +74,16 @@ HYPRE_FlexGMRESGetKDim( HYPRE_Solver solver, HYPRE_Int HYPRE_FlexGMRESSetTol( HYPRE_Solver solver, - HYPRE_Real tol ) + HYPRE_Real tol ) { - return( hypre_FlexGMRESSetTol( (void *) solver, tol ) ); + return ( hypre_FlexGMRESSetTol( (void *) solver, tol ) ); } HYPRE_Int HYPRE_FlexGMRESGetTol( HYPRE_Solver solver, - HYPRE_Real * tol ) + HYPRE_Real * tol ) { - return( hypre_FlexGMRESGetTol( (void *) solver, tol ) ); + return ( hypre_FlexGMRESGetTol( (void *) solver, tol ) ); } /*-------------------------------------------------------------------------- * HYPRE_FlexGMRESSetAbsoluteTol, HYPRE_FlexGMRESGetAbsoluteTol @@ -97,16 +91,16 @@ HYPRE_FlexGMRESGetTol( HYPRE_Solver solver, HYPRE_Int HYPRE_FlexGMRESSetAbsoluteTol( HYPRE_Solver solver, - HYPRE_Real a_tol ) + HYPRE_Real a_tol ) { - return( hypre_FlexGMRESSetAbsoluteTol( (void *) solver, a_tol ) ); + return ( hypre_FlexGMRESSetAbsoluteTol( (void *) solver, a_tol ) ); } HYPRE_Int HYPRE_FlexGMRESGetAbsoluteTol( HYPRE_Solver solver, - HYPRE_Real * a_tol ) + HYPRE_Real * a_tol ) { - return( hypre_FlexGMRESGetAbsoluteTol( (void *) solver, a_tol ) ); + return ( hypre_FlexGMRESGetAbsoluteTol( (void *) solver, a_tol ) ); } /*-------------------------------------------------------------------------- @@ -115,16 +109,16 @@ HYPRE_FlexGMRESGetAbsoluteTol( HYPRE_Solver solver, HYPRE_Int HYPRE_FlexGMRESSetConvergenceFactorTol( HYPRE_Solver solver, - HYPRE_Real cf_tol ) + HYPRE_Real cf_tol ) { - return( hypre_FlexGMRESSetConvergenceFactorTol( (void *) solver, cf_tol ) ); + return ( hypre_FlexGMRESSetConvergenceFactorTol( (void *) solver, cf_tol ) ); } HYPRE_Int HYPRE_FlexGMRESGetConvergenceFactorTol( HYPRE_Solver solver, - HYPRE_Real * cf_tol ) + HYPRE_Real * cf_tol ) { - return( hypre_FlexGMRESGetConvergenceFactorTol( (void *) solver, cf_tol ) ); + return ( hypre_FlexGMRESGetConvergenceFactorTol( (void *) solver, cf_tol ) ); } /*-------------------------------------------------------------------------- @@ -133,16 +127,16 @@ HYPRE_FlexGMRESGetConvergenceFactorTol( HYPRE_Solver solver, HYPRE_Int HYPRE_FlexGMRESSetMinIter( HYPRE_Solver solver, - HYPRE_Int min_iter ) + HYPRE_Int min_iter ) { - return( hypre_FlexGMRESSetMinIter( (void *) solver, min_iter ) ); + return ( hypre_FlexGMRESSetMinIter( (void *) solver, min_iter ) ); } HYPRE_Int HYPRE_FlexGMRESGetMinIter( HYPRE_Solver solver, - HYPRE_Int * min_iter ) + HYPRE_Int * min_iter ) { - return( hypre_FlexGMRESGetMinIter( (void *) solver, min_iter ) ); + return ( hypre_FlexGMRESGetMinIter( (void *) solver, min_iter ) ); } /*-------------------------------------------------------------------------- @@ -151,16 +145,16 @@ HYPRE_FlexGMRESGetMinIter( HYPRE_Solver solver, HYPRE_Int HYPRE_FlexGMRESSetMaxIter( HYPRE_Solver solver, - HYPRE_Int max_iter ) + HYPRE_Int max_iter ) { - return( hypre_FlexGMRESSetMaxIter( (void *) solver, max_iter ) ); + return ( hypre_FlexGMRESSetMaxIter( (void *) solver, max_iter ) ); } HYPRE_Int HYPRE_FlexGMRESGetMaxIter( HYPRE_Solver solver, - HYPRE_Int * max_iter ) + HYPRE_Int * max_iter ) { - return( hypre_FlexGMRESGetMaxIter( (void *) solver, max_iter ) ); + return ( hypre_FlexGMRESGetMaxIter( (void *) solver, max_iter ) ); } @@ -171,14 +165,14 @@ HYPRE_FlexGMRESGetMaxIter( HYPRE_Solver solver, HYPRE_Int HYPRE_FlexGMRESSetPrecond( HYPRE_Solver solver, - HYPRE_PtrToSolverFcn precond, - HYPRE_PtrToSolverFcn precond_setup, - HYPRE_Solver precond_solver ) + HYPRE_PtrToSolverFcn precond, + HYPRE_PtrToSolverFcn precond_setup, + HYPRE_Solver precond_solver ) { - return( hypre_FlexGMRESSetPrecond( (void *) solver, - (HYPRE_Int (*)(void*, void*, void*, void*))precond, - (HYPRE_Int (*)(void*, void*, void*, void*))precond_setup, - (void *) precond_solver ) ); + return ( hypre_FlexGMRESSetPrecond( (void *) solver, + (HYPRE_Int (*)(void*, void*, void*, void*))precond, + (HYPRE_Int (*)(void*, void*, void*, void*))precond_setup, + (void *) precond_solver ) ); } /*-------------------------------------------------------------------------- @@ -187,10 +181,10 @@ HYPRE_FlexGMRESSetPrecond( HYPRE_Solver solver, HYPRE_Int HYPRE_FlexGMRESGetPrecond( HYPRE_Solver solver, - HYPRE_Solver *precond_data_ptr ) + HYPRE_Solver *precond_data_ptr ) { - return( hypre_FlexGMRESGetPrecond( (void *) solver, - (HYPRE_Solver *) precond_data_ptr ) ); + return ( hypre_FlexGMRESGetPrecond( (void *) solver, + (HYPRE_Solver *) precond_data_ptr ) ); } /*-------------------------------------------------------------------------- @@ -199,16 +193,16 @@ HYPRE_FlexGMRESGetPrecond( HYPRE_Solver solver, HYPRE_Int HYPRE_FlexGMRESSetPrintLevel( HYPRE_Solver solver, - HYPRE_Int level ) + HYPRE_Int level ) { - return( hypre_FlexGMRESSetPrintLevel( (void *) solver, level ) ); + return ( hypre_FlexGMRESSetPrintLevel( (void *) solver, level ) ); } HYPRE_Int HYPRE_FlexGMRESGetPrintLevel( HYPRE_Solver solver, - HYPRE_Int * level ) + HYPRE_Int * level ) { - return( hypre_FlexGMRESGetPrintLevel( (void *) solver, level ) ); + return ( hypre_FlexGMRESGetPrintLevel( (void *) solver, level ) ); } /*-------------------------------------------------------------------------- @@ -217,16 +211,16 @@ HYPRE_FlexGMRESGetPrintLevel( HYPRE_Solver solver, HYPRE_Int HYPRE_FlexGMRESSetLogging( HYPRE_Solver solver, - HYPRE_Int level ) + HYPRE_Int level ) { - return( hypre_FlexGMRESSetLogging( (void *) solver, level ) ); + return ( hypre_FlexGMRESSetLogging( (void *) solver, level ) ); } HYPRE_Int HYPRE_FlexGMRESGetLogging( HYPRE_Solver solver, - HYPRE_Int * level ) + HYPRE_Int * level ) { - return( hypre_FlexGMRESGetLogging( (void *) solver, level ) ); + return ( hypre_FlexGMRESGetLogging( (void *) solver, level ) ); } /*-------------------------------------------------------------------------- @@ -235,9 +229,9 @@ HYPRE_FlexGMRESGetLogging( HYPRE_Solver solver, HYPRE_Int HYPRE_FlexGMRESGetNumIterations( HYPRE_Solver solver, - HYPRE_Int *num_iterations ) + HYPRE_Int *num_iterations ) { - return( hypre_FlexGMRESGetNumIterations( (void *) solver, num_iterations ) ); + return ( hypre_FlexGMRESGetNumIterations( (void *) solver, num_iterations ) ); } /*-------------------------------------------------------------------------- @@ -246,9 +240,9 @@ HYPRE_FlexGMRESGetNumIterations( HYPRE_Solver solver, HYPRE_Int HYPRE_FlexGMRESGetConverged( HYPRE_Solver solver, - HYPRE_Int *converged ) + HYPRE_Int *converged ) { - return( hypre_FlexGMRESGetConverged( (void *) solver, converged ) ); + return ( hypre_FlexGMRESGetConverged( (void *) solver, converged ) ); } /*-------------------------------------------------------------------------- @@ -257,9 +251,9 @@ HYPRE_FlexGMRESGetConverged( HYPRE_Solver solver, HYPRE_Int HYPRE_FlexGMRESGetFinalRelativeResidualNorm( HYPRE_Solver solver, - HYPRE_Real *norm ) + HYPRE_Real *norm ) { - return( hypre_FlexGMRESGetFinalRelativeResidualNorm( (void *) solver, norm ) ); + return ( hypre_FlexGMRESGetFinalRelativeResidualNorm( (void *) solver, norm ) ); } /*-------------------------------------------------------------------------- @@ -275,14 +269,15 @@ HYPRE_Int HYPRE_FlexGMRESGetResidual( HYPRE_Solver solver, void *residual ) /*-------------------------------------------------------------------------- * HYPRE_FlexGMRESSetModifyPC *--------------------------------------------------------------------------*/ - + HYPRE_Int HYPRE_FlexGMRESSetModifyPC( HYPRE_Solver solver, - HYPRE_Int (*modify_pc)(HYPRE_Solver, HYPRE_Int, HYPRE_Real) ) + HYPRE_Int (*modify_pc)(HYPRE_Solver, HYPRE_Int, HYPRE_Real) ) { - return hypre_FlexGMRESSetModifyPC( (void *) solver, (HYPRE_Int(*)(void*, HYPRE_Int, HYPRE_Real))modify_pc); - + return hypre_FlexGMRESSetModifyPC( (void *) solver, (HYPRE_Int(*)(void*, HYPRE_Int, + HYPRE_Real))modify_pc); + } diff --git a/external/hypre/src/krylov/HYPRE_gmres.c b/external/hypre/src/krylov/HYPRE_gmres.c index 0931984a..9612e466 100644 --- a/external/hypre/src/krylov/HYPRE_gmres.c +++ b/external/hypre/src/krylov/HYPRE_gmres.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,7 +17,7 @@ *--------------------------------------------------------------------------*/ /* to do, not trivial */ /* -HYPRE_Int +HYPRE_Int HYPRE_ParCSRGMRESDestroy( HYPRE_Solver solver ) { return( hypre_GMRESDestroy( (void *) solver ) ); @@ -28,32 +28,26 @@ HYPRE_ParCSRGMRESDestroy( HYPRE_Solver solver ) * HYPRE_GMRESSetup *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_GMRESSetup( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ) { - return( hypre_GMRESSetup( solver, - A, - b, - x ) ); + return ( hypre_GMRESSetup( solver, A, b, x ) ); } /*-------------------------------------------------------------------------- * HYPRE_GMRESSolve *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_GMRESSolve( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ) { - return( hypre_GMRESSolve( solver, - A, - b, - x ) ); + return ( hypre_GMRESSolve( solver, A, b, x ) ); } /*-------------------------------------------------------------------------- @@ -62,16 +56,16 @@ HYPRE_GMRESSolve( HYPRE_Solver solver, HYPRE_Int HYPRE_GMRESSetKDim( HYPRE_Solver solver, - HYPRE_Int k_dim ) + HYPRE_Int k_dim ) { - return( hypre_GMRESSetKDim( (void *) solver, k_dim ) ); + return ( hypre_GMRESSetKDim( (void *) solver, k_dim ) ); } HYPRE_Int HYPRE_GMRESGetKDim( HYPRE_Solver solver, - HYPRE_Int * k_dim ) + HYPRE_Int * k_dim ) { - return( hypre_GMRESGetKDim( (void *) solver, k_dim ) ); + return ( hypre_GMRESGetKDim( (void *) solver, k_dim ) ); } /*-------------------------------------------------------------------------- @@ -80,16 +74,16 @@ HYPRE_GMRESGetKDim( HYPRE_Solver solver, HYPRE_Int HYPRE_GMRESSetTol( HYPRE_Solver solver, - HYPRE_Real tol ) + HYPRE_Real tol ) { - return( hypre_GMRESSetTol( (void *) solver, tol ) ); + return ( hypre_GMRESSetTol( (void *) solver, tol ) ); } HYPRE_Int HYPRE_GMRESGetTol( HYPRE_Solver solver, - HYPRE_Real * tol ) + HYPRE_Real * tol ) { - return( hypre_GMRESGetTol( (void *) solver, tol ) ); + return ( hypre_GMRESGetTol( (void *) solver, tol ) ); } /*-------------------------------------------------------------------------- * HYPRE_GMRESSetAbsoluteTol, HYPRE_GMRESGetAbsoluteTol @@ -97,16 +91,16 @@ HYPRE_GMRESGetTol( HYPRE_Solver solver, HYPRE_Int HYPRE_GMRESSetAbsoluteTol( HYPRE_Solver solver, - HYPRE_Real a_tol ) + HYPRE_Real a_tol ) { - return( hypre_GMRESSetAbsoluteTol( (void *) solver, a_tol ) ); + return ( hypre_GMRESSetAbsoluteTol( (void *) solver, a_tol ) ); } HYPRE_Int HYPRE_GMRESGetAbsoluteTol( HYPRE_Solver solver, - HYPRE_Real * a_tol ) + HYPRE_Real * a_tol ) { - return( hypre_GMRESGetAbsoluteTol( (void *) solver, a_tol ) ); + return ( hypre_GMRESGetAbsoluteTol( (void *) solver, a_tol ) ); } /*-------------------------------------------------------------------------- @@ -115,16 +109,16 @@ HYPRE_GMRESGetAbsoluteTol( HYPRE_Solver solver, HYPRE_Int HYPRE_GMRESSetConvergenceFactorTol( HYPRE_Solver solver, - HYPRE_Real cf_tol ) + HYPRE_Real cf_tol ) { - return( hypre_GMRESSetConvergenceFactorTol( (void *) solver, cf_tol ) ); + return ( hypre_GMRESSetConvergenceFactorTol( (void *) solver, cf_tol ) ); } HYPRE_Int HYPRE_GMRESGetConvergenceFactorTol( HYPRE_Solver solver, - HYPRE_Real * cf_tol ) + HYPRE_Real * cf_tol ) { - return( hypre_GMRESGetConvergenceFactorTol( (void *) solver, cf_tol ) ); + return ( hypre_GMRESGetConvergenceFactorTol( (void *) solver, cf_tol ) ); } /*-------------------------------------------------------------------------- @@ -133,16 +127,16 @@ HYPRE_GMRESGetConvergenceFactorTol( HYPRE_Solver solver, HYPRE_Int HYPRE_GMRESSetMinIter( HYPRE_Solver solver, - HYPRE_Int min_iter ) + HYPRE_Int min_iter ) { - return( hypre_GMRESSetMinIter( (void *) solver, min_iter ) ); + return ( hypre_GMRESSetMinIter( (void *) solver, min_iter ) ); } HYPRE_Int HYPRE_GMRESGetMinIter( HYPRE_Solver solver, - HYPRE_Int * min_iter ) + HYPRE_Int * min_iter ) { - return( hypre_GMRESGetMinIter( (void *) solver, min_iter ) ); + return ( hypre_GMRESGetMinIter( (void *) solver, min_iter ) ); } /*-------------------------------------------------------------------------- @@ -151,16 +145,16 @@ HYPRE_GMRESGetMinIter( HYPRE_Solver solver, HYPRE_Int HYPRE_GMRESSetMaxIter( HYPRE_Solver solver, - HYPRE_Int max_iter ) + HYPRE_Int max_iter ) { - return( hypre_GMRESSetMaxIter( (void *) solver, max_iter ) ); + return ( hypre_GMRESSetMaxIter( (void *) solver, max_iter ) ); } HYPRE_Int HYPRE_GMRESGetMaxIter( HYPRE_Solver solver, - HYPRE_Int * max_iter ) + HYPRE_Int * max_iter ) { - return( hypre_GMRESGetMaxIter( (void *) solver, max_iter ) ); + return ( hypre_GMRESGetMaxIter( (void *) solver, max_iter ) ); } /*-------------------------------------------------------------------------- @@ -169,16 +163,16 @@ HYPRE_GMRESGetMaxIter( HYPRE_Solver solver, HYPRE_Int HYPRE_GMRESSetStopCrit( HYPRE_Solver solver, - HYPRE_Int stop_crit ) + HYPRE_Int stop_crit ) { - return( hypre_GMRESSetStopCrit( (void *) solver, stop_crit ) ); + return ( hypre_GMRESSetStopCrit( (void *) solver, stop_crit ) ); } HYPRE_Int HYPRE_GMRESGetStopCrit( HYPRE_Solver solver, - HYPRE_Int * stop_crit ) + HYPRE_Int * stop_crit ) { - return( hypre_GMRESGetStopCrit( (void *) solver, stop_crit ) ); + return ( hypre_GMRESGetStopCrit( (void *) solver, stop_crit ) ); } /*-------------------------------------------------------------------------- @@ -189,14 +183,14 @@ HYPRE_Int HYPRE_GMRESSetRelChange( HYPRE_Solver solver, HYPRE_Int rel_change ) { - return( hypre_GMRESSetRelChange( (void *) solver, rel_change ) ); + return ( hypre_GMRESSetRelChange( (void *) solver, rel_change ) ); } HYPRE_Int HYPRE_GMRESGetRelChange( HYPRE_Solver solver, HYPRE_Int * rel_change ) { - return( hypre_GMRESGetRelChange( (void *) solver, rel_change ) ); + return ( hypre_GMRESGetRelChange( (void *) solver, rel_change ) ); } /*-------------------------------------------------------------------------- @@ -207,14 +201,14 @@ HYPRE_Int HYPRE_GMRESSetSkipRealResidualCheck( HYPRE_Solver solver, HYPRE_Int skip_real_r_check ) { - return( hypre_GMRESSetSkipRealResidualCheck( (void *) solver, skip_real_r_check ) ); + return ( hypre_GMRESSetSkipRealResidualCheck( (void *) solver, skip_real_r_check ) ); } HYPRE_Int HYPRE_GMRESGetSkipRealResidualCheck( HYPRE_Solver solver, HYPRE_Int *skip_real_r_check ) { - return( hypre_GMRESGetSkipRealResidualCheck( (void *) solver, skip_real_r_check ) ); + return ( hypre_GMRESGetSkipRealResidualCheck( (void *) solver, skip_real_r_check ) ); } /*-------------------------------------------------------------------------- @@ -227,10 +221,10 @@ HYPRE_GMRESSetPrecond( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ) { - return( hypre_GMRESSetPrecond( (void *) solver, - (HYPRE_Int (*)(void*, void*, void*, void*))precond, - (HYPRE_Int (*)(void*, void*, void*, void*))precond_setup, - (void *) precond_solver ) ); + return ( hypre_GMRESSetPrecond( (void *) solver, + (HYPRE_Int (*)(void*, void*, void*, void*))precond, + (HYPRE_Int (*)(void*, void*, void*, void*))precond_setup, + (void *) precond_solver ) ); } /*-------------------------------------------------------------------------- @@ -239,10 +233,10 @@ HYPRE_GMRESSetPrecond( HYPRE_Solver solver, HYPRE_Int HYPRE_GMRESGetPrecond( HYPRE_Solver solver, - HYPRE_Solver *precond_data_ptr ) + HYPRE_Solver *precond_data_ptr ) { - return( hypre_GMRESGetPrecond( (void *) solver, - (HYPRE_Solver *) precond_data_ptr ) ); + return ( hypre_GMRESGetPrecond( (void *) solver, + (HYPRE_Solver *) precond_data_ptr ) ); } /*-------------------------------------------------------------------------- @@ -251,16 +245,16 @@ HYPRE_GMRESGetPrecond( HYPRE_Solver solver, HYPRE_Int HYPRE_GMRESSetPrintLevel( HYPRE_Solver solver, - HYPRE_Int level ) + HYPRE_Int level ) { - return( hypre_GMRESSetPrintLevel( (void *) solver, level ) ); + return ( hypre_GMRESSetPrintLevel( (void *) solver, level ) ); } HYPRE_Int HYPRE_GMRESGetPrintLevel( HYPRE_Solver solver, - HYPRE_Int * level ) + HYPRE_Int * level ) { - return( hypre_GMRESGetPrintLevel( (void *) solver, level ) ); + return ( hypre_GMRESGetPrintLevel( (void *) solver, level ) ); } /*-------------------------------------------------------------------------- @@ -269,16 +263,16 @@ HYPRE_GMRESGetPrintLevel( HYPRE_Solver solver, HYPRE_Int HYPRE_GMRESSetLogging( HYPRE_Solver solver, - HYPRE_Int level ) + HYPRE_Int level ) { - return( hypre_GMRESSetLogging( (void *) solver, level ) ); + return ( hypre_GMRESSetLogging( (void *) solver, level ) ); } HYPRE_Int HYPRE_GMRESGetLogging( HYPRE_Solver solver, - HYPRE_Int * level ) + HYPRE_Int * level ) { - return( hypre_GMRESGetLogging( (void *) solver, level ) ); + return ( hypre_GMRESGetLogging( (void *) solver, level ) ); } /*-------------------------------------------------------------------------- @@ -287,9 +281,9 @@ HYPRE_GMRESGetLogging( HYPRE_Solver solver, HYPRE_Int HYPRE_GMRESGetNumIterations( HYPRE_Solver solver, - HYPRE_Int *num_iterations ) + HYPRE_Int *num_iterations ) { - return( hypre_GMRESGetNumIterations( (void *) solver, num_iterations ) ); + return ( hypre_GMRESGetNumIterations( (void *) solver, num_iterations ) ); } /*-------------------------------------------------------------------------- @@ -300,7 +294,7 @@ HYPRE_Int HYPRE_GMRESGetConverged( HYPRE_Solver solver, HYPRE_Int *converged ) { - return( hypre_GMRESGetConverged( (void *) solver, converged ) ); + return ( hypre_GMRESGetConverged( (void *) solver, converged ) ); } /*-------------------------------------------------------------------------- @@ -309,9 +303,9 @@ HYPRE_GMRESGetConverged( HYPRE_Solver solver, HYPRE_Int HYPRE_GMRESGetFinalRelativeResidualNorm( HYPRE_Solver solver, - HYPRE_Real *norm ) + HYPRE_Real *norm ) { - return( hypre_GMRESGetFinalRelativeResidualNorm( (void *) solver, norm ) ); + return ( hypre_GMRESGetFinalRelativeResidualNorm( (void *) solver, norm ) ); } /*-------------------------------------------------------------------------- diff --git a/external/hypre/src/krylov/HYPRE_krylov.h b/external/hypre/src/krylov/HYPRE_krylov.h index 71fab7ce..9b7cc3a2 100644 --- a/external/hypre/src/krylov/HYPRE_krylov.h +++ b/external/hypre/src/krylov/HYPRE_krylov.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -20,11 +20,10 @@ extern "C" { /** * @defgroup KrylovSolvers Krylov Solvers * - * These solvers support many of the matrix/vector storage schemes in hypre. - * They should be used in conjunction with the storage-specific interfaces, - * particularly the specific Create() and Destroy() functions. - * - * @memo A basic interface for Krylov solvers + * A basic interface for Krylov solvers. These solvers support many of the + * matrix/vector storage schemes in hypre. They should be used in conjunction + * with the storage-specific interfaces, particularly the specific Create() and + * Destroy() functions. * * @{ **/ @@ -38,43 +37,11 @@ extern "C" { * @{ **/ -#ifndef HYPRE_SOLVER_STRUCT -#define HYPRE_SOLVER_STRUCT -struct hypre_Solver_struct; -/** - * The solver object. - **/ -typedef struct hypre_Solver_struct *HYPRE_Solver; -#endif - -#ifndef HYPRE_MATRIX_STRUCT -#define HYPRE_MATRIX_STRUCT -struct hypre_Matrix_struct; -/** - * The matrix object. - **/ -typedef struct hypre_Matrix_struct *HYPRE_Matrix; -#endif - -#ifndef HYPRE_VECTOR_STRUCT -#define HYPRE_VECTOR_STRUCT -struct hypre_Vector_struct; -/** - * The vector object. - **/ -typedef struct hypre_Vector_struct *HYPRE_Vector; -#endif - -typedef HYPRE_Int (*HYPRE_PtrToSolverFcn)(HYPRE_Solver, - HYPRE_Matrix, - HYPRE_Vector, - HYPRE_Vector); - #ifndef HYPRE_MODIFYPC #define HYPRE_MODIFYPC typedef HYPRE_Int (*HYPRE_PtrToModifyPCFcn)(HYPRE_Solver, - HYPRE_Int, - HYPRE_Real); + HYPRE_Int, + HYPRE_Real); #endif /**@}*/ @@ -178,6 +145,24 @@ HYPRE_Int HYPRE_PCGSetRecomputeResidual(HYPRE_Solver solver, HYPRE_Int HYPRE_PCGSetRecomputeResidualP(HYPRE_Solver solver, HYPRE_Int recompute_residual_p); +/** + * (Optional) Setting this to 1 allows use of Polak-Ribiere Method (flexible) + * this incrceases robustness, but adds an additional dot product per iteration + **/ +HYPRE_Int HYPRE_PCGSetFlex(HYPRE_Solver solver, + HYPRE_Int flex); + +/** + * (Optional) Skips subnormal alpha, gamma and iprod values in CG. + * If set to 0 (default): will break if values are below HYPRE_REAL_MIN + * If set to 1: will break if values are below HYPRE_REAL_TRUE_MIN + * (requires C11 minimal or will check to HYPRE_REAL_MIN) + * If set to 2: will break if values are <= 0. + * If set to 3 or larger: will not break at all + **/ +HYPRE_Int HYPRE_PCGSetSkipBreak(HYPRE_Solver solver, + HYPRE_Int skip_break); + /** * (Optional) Set the preconditioner to use. **/ @@ -186,6 +171,15 @@ HYPRE_Int HYPRE_PCGSetPrecond(HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver); +/** + * (Optional) Set the preconditioner to use in a generic fashion. + * This function does not require explicit input of the setup and solve pointers + * of the preconditioner object. Instead, it automatically extracts this information + * from the aforementioned object. + **/ +HYPRE_Int HYPRE_PCGSetPreconditioner(HYPRE_Solver solver, + HYPRE_Solver precond); + /** * (Optional) Set the amount of logging to do. **/ @@ -261,8 +255,13 @@ HYPRE_Int HYPRE_PCGGetRelChange(HYPRE_Solver solver, /** **/ -HYPRE_Int HYPRE_GMRESGetSkipRealResidualCheck(HYPRE_Solver solver, - HYPRE_Int *skip_real_r_check); +HYPRE_Int HYPRE_PCGGetSkipBreak(HYPRE_Solver solver, + HYPRE_Int *skip_break); + +/** + **/ +HYPRE_Int HYPRE_PCGGetFlex(HYPRE_Solver solver, + HYPRE_Int *flex); /** **/ @@ -282,7 +281,7 @@ HYPRE_Int HYPRE_PCGGetPrintLevel(HYPRE_Solver solver, /** **/ HYPRE_Int HYPRE_PCGGetConverged(HYPRE_Solver solver, - HYPRE_Int *converged); + HYPRE_Int *converged); /**@}*/ @@ -319,10 +318,10 @@ HYPRE_Int HYPRE_GMRESSetTol(HYPRE_Solver solver, HYPRE_Real tol); /** - * (Optional) Set the absolute convergence tolerance (default is 0). + * (Optional) Set the absolute convergence tolerance (default is 0). * If one desires * the convergence test to check the absolute convergence tolerance \e only, then - * set the relative convergence tolerance to 0.0. (The convergence test is + * set the relative convergence tolerance to 0.0. (The convergence test is * \f$\|r\| \leq\f$ max(relative\f$\_\f$tolerance\f$\ast \|b\|\f$, absolute\f$\_\f$tolerance).) * **/ @@ -414,6 +413,11 @@ HYPRE_Int HYPRE_GMRESGetFinalRelativeResidualNorm(HYPRE_Solver solver, HYPRE_Int HYPRE_GMRESGetResidual(HYPRE_Solver solver, void *residual); +/** + **/ +HYPRE_Int HYPRE_GMRESGetSkipRealResidualCheck(HYPRE_Solver solver, + HYPRE_Int *skip_real_r_check); + /** **/ HYPRE_Int HYPRE_GMRESGetTol(HYPRE_Solver solver, @@ -431,7 +435,7 @@ HYPRE_Int HYPRE_GMRESGetConvergenceFactorTol(HYPRE_Solver solver, HYPRE_Real *cf_tol); /* - * OBSOLETE + * OBSOLETE **/ HYPRE_Int HYPRE_GMRESGetStopCrit(HYPRE_Solver solver, HYPRE_Int *stop_crit); @@ -512,10 +516,10 @@ HYPRE_Int HYPRE_FlexGMRESSetTol(HYPRE_Solver solver, HYPRE_Real tol); /** - * (Optional) Set the absolute convergence tolerance (default is 0). + * (Optional) Set the absolute convergence tolerance (default is 0). * If one desires * the convergence test to check the absolute convergence tolerance \e only, then - * set the relative convergence tolerance to 0.0. (The convergence test is + * set the relative convergence tolerance to 0.0. (The convergence test is * \f$\|r\| \leq\f$ max(relative\f$\_\f$tolerance\f$\ast \|b\|\f$, absolute\f$\_\f$tolerance).) * **/ @@ -680,10 +684,10 @@ HYPRE_Int HYPRE_LGMRESSolve(HYPRE_Solver solver, HYPRE_Int HYPRE_LGMRESSetTol(HYPRE_Solver solver, HYPRE_Real tol); /** - * (Optional) Set the absolute convergence tolerance (default is 0). + * (Optional) Set the absolute convergence tolerance (default is 0). * If one desires * the convergence test to check the absolute convergence tolerance \e only, then - * set the relative convergence tolerance to 0.0. (The convergence test is + * set the relative convergence tolerance to 0.0. (The convergence test is * \f$\|r\| \leq\f$ max(relative\f$\_\f$tolerance\f$\ast \|b\|\f$, absolute\f$\_\f$tolerance).) * **/ @@ -849,10 +853,10 @@ HYPRE_Int HYPRE_COGMRESSetTol(HYPRE_Solver solver, HYPRE_Real tol); /** - * (Optional) Set the absolute convergence tolerance (default is 0). + * (Optional) Set the absolute convergence tolerance (default is 0). * If one desires * the convergence test to check the absolute convergence tolerance \e only, then - * set the relative convergence tolerance to 0.0. (The convergence test is + * set the relative convergence tolerance to 0.0. (The convergence test is * \f$\|r\| \leq\f$ max(relative\f$\_\f$tolerance\f$\ast \|b\|\f$, absolute\f$\_\f$tolerance).) * **/ @@ -884,7 +888,7 @@ HYPRE_Int HYPRE_COGMRESSetKDim(HYPRE_Solver solver, HYPRE_Int k_dim); /** - * (Optional) Set number of unrolling in mass funcyions in COGMRES + * (Optional) Set number of unrolling in mass funcyions in COGMRES * Can be 4 or 8. Default: no unrolling. **/ HYPRE_Int HYPRE_COGMRESSetUnroll(HYPRE_Solver solver, @@ -1046,10 +1050,10 @@ HYPRE_Int HYPRE_BiCGSTABSetTol(HYPRE_Solver solver, HYPRE_Real tol); /** - * (Optional) Set the absolute convergence tolerance (default is 0). + * (Optional) Set the absolute convergence tolerance (default is 0). * If one desires * the convergence test to check the absolute convergence tolerance \e only, then - * set the relative convergence tolerance to 0.0. (The convergence test is + * set the relative convergence tolerance to 0.0. (The convergence test is * \f$\|r\| \leq\f$ max(relative\f$\_\f$tolerance \f$\ast \|b\|\f$, absolute\f$\_\f$tolerance).) * **/ diff --git a/external/hypre/src/krylov/HYPRE_lgmres.c b/external/hypre/src/krylov/HYPRE_lgmres.c index 62bbbdbc..89baf31e 100644 --- a/external/hypre/src/krylov/HYPRE_lgmres.c +++ b/external/hypre/src/krylov/HYPRE_lgmres.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,7 +17,7 @@ *--------------------------------------------------------------------------*/ /* to do, not trivial */ /* -HYPRE_Int +HYPRE_Int HYPRE_ParCSRLGMRESDestroy( HYPRE_Solver solver ) { return( hypre_LGMRESDestroy( (void *) solver ) ); @@ -28,32 +28,26 @@ HYPRE_ParCSRLGMRESDestroy( HYPRE_Solver solver ) * HYPRE_LGMRESSetup *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_LGMRESSetup( HYPRE_Solver solver, - HYPRE_Matrix A, - HYPRE_Vector b, - HYPRE_Vector x ) + HYPRE_Matrix A, + HYPRE_Vector b, + HYPRE_Vector x ) { - return( hypre_LGMRESSetup( solver, - A, - b, - x ) ); + return ( hypre_LGMRESSetup( solver, A, b, x ) ); } /*-------------------------------------------------------------------------- * HYPRE_LGMRESSolve *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_LGMRESSolve( HYPRE_Solver solver, - HYPRE_Matrix A, - HYPRE_Vector b, - HYPRE_Vector x ) + HYPRE_Matrix A, + HYPRE_Vector b, + HYPRE_Vector x ) { - return( hypre_LGMRESSolve( solver, - A, - b, - x ) ); + return ( hypre_LGMRESSolve( solver, A, b, x ) ); } /*-------------------------------------------------------------------------- @@ -62,16 +56,16 @@ HYPRE_LGMRESSolve( HYPRE_Solver solver, HYPRE_Int HYPRE_LGMRESSetKDim( HYPRE_Solver solver, - HYPRE_Int k_dim ) + HYPRE_Int k_dim ) { - return( hypre_LGMRESSetKDim( (void *) solver, k_dim ) ); + return ( hypre_LGMRESSetKDim( (void *) solver, k_dim ) ); } HYPRE_Int HYPRE_LGMRESGetKDim( HYPRE_Solver solver, - HYPRE_Int * k_dim ) + HYPRE_Int * k_dim ) { - return( hypre_LGMRESGetKDim( (void *) solver, k_dim ) ); + return ( hypre_LGMRESGetKDim( (void *) solver, k_dim ) ); } /*-------------------------------------------------------------------------- * HYPRE_LGMRESSetAugDim, HYPRE_LGMRESGetAugDim @@ -79,16 +73,16 @@ HYPRE_LGMRESGetKDim( HYPRE_Solver solver, HYPRE_Int HYPRE_LGMRESSetAugDim( HYPRE_Solver solver, - HYPRE_Int aug_dim ) + HYPRE_Int aug_dim ) { - return( hypre_LGMRESSetAugDim( (void *) solver, aug_dim ) ); + return ( hypre_LGMRESSetAugDim( (void *) solver, aug_dim ) ); } HYPRE_Int HYPRE_LGMRESGetAugDim( HYPRE_Solver solver, - HYPRE_Int * aug_dim ) + HYPRE_Int * aug_dim ) { - return( hypre_LGMRESGetAugDim( (void *) solver, aug_dim ) ); + return ( hypre_LGMRESGetAugDim( (void *) solver, aug_dim ) ); } /*-------------------------------------------------------------------------- @@ -97,16 +91,16 @@ HYPRE_LGMRESGetAugDim( HYPRE_Solver solver, HYPRE_Int HYPRE_LGMRESSetTol( HYPRE_Solver solver, - HYPRE_Real tol ) + HYPRE_Real tol ) { - return( hypre_LGMRESSetTol( (void *) solver, tol ) ); + return ( hypre_LGMRESSetTol( (void *) solver, tol ) ); } HYPRE_Int HYPRE_LGMRESGetTol( HYPRE_Solver solver, - HYPRE_Real * tol ) + HYPRE_Real * tol ) { - return( hypre_LGMRESGetTol( (void *) solver, tol ) ); + return ( hypre_LGMRESGetTol( (void *) solver, tol ) ); } /*-------------------------------------------------------------------------- * HYPRE_LGMRESSetAbsoluteTol, HYPRE_LGMRESGetAbsoluteTol @@ -114,16 +108,16 @@ HYPRE_LGMRESGetTol( HYPRE_Solver solver, HYPRE_Int HYPRE_LGMRESSetAbsoluteTol( HYPRE_Solver solver, - HYPRE_Real a_tol ) + HYPRE_Real a_tol ) { - return( hypre_LGMRESSetAbsoluteTol( (void *) solver, a_tol ) ); + return ( hypre_LGMRESSetAbsoluteTol( (void *) solver, a_tol ) ); } HYPRE_Int HYPRE_LGMRESGetAbsoluteTol( HYPRE_Solver solver, - HYPRE_Real * a_tol ) + HYPRE_Real * a_tol ) { - return( hypre_LGMRESGetAbsoluteTol( (void *) solver, a_tol ) ); + return ( hypre_LGMRESGetAbsoluteTol( (void *) solver, a_tol ) ); } /*-------------------------------------------------------------------------- @@ -132,16 +126,16 @@ HYPRE_LGMRESGetAbsoluteTol( HYPRE_Solver solver, HYPRE_Int HYPRE_LGMRESSetConvergenceFactorTol( HYPRE_Solver solver, - HYPRE_Real cf_tol ) + HYPRE_Real cf_tol ) { - return( hypre_LGMRESSetConvergenceFactorTol( (void *) solver, cf_tol ) ); + return ( hypre_LGMRESSetConvergenceFactorTol( (void *) solver, cf_tol ) ); } HYPRE_Int HYPRE_LGMRESGetConvergenceFactorTol( HYPRE_Solver solver, - HYPRE_Real * cf_tol ) + HYPRE_Real * cf_tol ) { - return( hypre_LGMRESGetConvergenceFactorTol( (void *) solver, cf_tol ) ); + return ( hypre_LGMRESGetConvergenceFactorTol( (void *) solver, cf_tol ) ); } /*-------------------------------------------------------------------------- @@ -150,16 +144,16 @@ HYPRE_LGMRESGetConvergenceFactorTol( HYPRE_Solver solver, HYPRE_Int HYPRE_LGMRESSetMinIter( HYPRE_Solver solver, - HYPRE_Int min_iter ) + HYPRE_Int min_iter ) { - return( hypre_LGMRESSetMinIter( (void *) solver, min_iter ) ); + return ( hypre_LGMRESSetMinIter( (void *) solver, min_iter ) ); } HYPRE_Int HYPRE_LGMRESGetMinIter( HYPRE_Solver solver, - HYPRE_Int * min_iter ) + HYPRE_Int * min_iter ) { - return( hypre_LGMRESGetMinIter( (void *) solver, min_iter ) ); + return ( hypre_LGMRESGetMinIter( (void *) solver, min_iter ) ); } /*-------------------------------------------------------------------------- @@ -168,16 +162,16 @@ HYPRE_LGMRESGetMinIter( HYPRE_Solver solver, HYPRE_Int HYPRE_LGMRESSetMaxIter( HYPRE_Solver solver, - HYPRE_Int max_iter ) + HYPRE_Int max_iter ) { - return( hypre_LGMRESSetMaxIter( (void *) solver, max_iter ) ); + return ( hypre_LGMRESSetMaxIter( (void *) solver, max_iter ) ); } HYPRE_Int HYPRE_LGMRESGetMaxIter( HYPRE_Solver solver, - HYPRE_Int * max_iter ) + HYPRE_Int * max_iter ) { - return( hypre_LGMRESGetMaxIter( (void *) solver, max_iter ) ); + return ( hypre_LGMRESGetMaxIter( (void *) solver, max_iter ) ); } @@ -188,14 +182,14 @@ HYPRE_LGMRESGetMaxIter( HYPRE_Solver solver, HYPRE_Int HYPRE_LGMRESSetPrecond( HYPRE_Solver solver, - HYPRE_PtrToSolverFcn precond, - HYPRE_PtrToSolverFcn precond_setup, - HYPRE_Solver precond_solver ) + HYPRE_PtrToSolverFcn precond, + HYPRE_PtrToSolverFcn precond_setup, + HYPRE_Solver precond_solver ) { - return( hypre_LGMRESSetPrecond( (void *) solver, - (HYPRE_Int (*)(void*, void*, void*, void*))precond, - (HYPRE_Int (*)(void*, void*, void*, void*))precond_setup, - (void *) precond_solver ) ); + return ( hypre_LGMRESSetPrecond( (void *) solver, + (HYPRE_Int (*)(void*, void*, void*, void*))precond, + (HYPRE_Int (*)(void*, void*, void*, void*))precond_setup, + (void *) precond_solver ) ); } /*-------------------------------------------------------------------------- @@ -204,10 +198,10 @@ HYPRE_LGMRESSetPrecond( HYPRE_Solver solver, HYPRE_Int HYPRE_LGMRESGetPrecond( HYPRE_Solver solver, - HYPRE_Solver *precond_data_ptr ) + HYPRE_Solver *precond_data_ptr ) { - return( hypre_LGMRESGetPrecond( (void *) solver, - (HYPRE_Solver *) precond_data_ptr ) ); + return ( hypre_LGMRESGetPrecond( (void *) solver, + (HYPRE_Solver *) precond_data_ptr ) ); } /*-------------------------------------------------------------------------- @@ -216,16 +210,16 @@ HYPRE_LGMRESGetPrecond( HYPRE_Solver solver, HYPRE_Int HYPRE_LGMRESSetPrintLevel( HYPRE_Solver solver, - HYPRE_Int level ) + HYPRE_Int level ) { - return( hypre_LGMRESSetPrintLevel( (void *) solver, level ) ); + return ( hypre_LGMRESSetPrintLevel( (void *) solver, level ) ); } HYPRE_Int HYPRE_LGMRESGetPrintLevel( HYPRE_Solver solver, - HYPRE_Int * level ) + HYPRE_Int * level ) { - return( hypre_LGMRESGetPrintLevel( (void *) solver, level ) ); + return ( hypre_LGMRESGetPrintLevel( (void *) solver, level ) ); } /*-------------------------------------------------------------------------- @@ -234,16 +228,16 @@ HYPRE_LGMRESGetPrintLevel( HYPRE_Solver solver, HYPRE_Int HYPRE_LGMRESSetLogging( HYPRE_Solver solver, - HYPRE_Int level ) + HYPRE_Int level ) { - return( hypre_LGMRESSetLogging( (void *) solver, level ) ); + return ( hypre_LGMRESSetLogging( (void *) solver, level ) ); } HYPRE_Int HYPRE_LGMRESGetLogging( HYPRE_Solver solver, - HYPRE_Int * level ) + HYPRE_Int * level ) { - return( hypre_LGMRESGetLogging( (void *) solver, level ) ); + return ( hypre_LGMRESGetLogging( (void *) solver, level ) ); } /*-------------------------------------------------------------------------- @@ -252,9 +246,9 @@ HYPRE_LGMRESGetLogging( HYPRE_Solver solver, HYPRE_Int HYPRE_LGMRESGetNumIterations( HYPRE_Solver solver, - HYPRE_Int *num_iterations ) + HYPRE_Int *num_iterations ) { - return( hypre_LGMRESGetNumIterations( (void *) solver, num_iterations ) ); + return ( hypre_LGMRESGetNumIterations( (void *) solver, num_iterations ) ); } /*-------------------------------------------------------------------------- @@ -263,9 +257,9 @@ HYPRE_LGMRESGetNumIterations( HYPRE_Solver solver, HYPRE_Int HYPRE_LGMRESGetConverged( HYPRE_Solver solver, - HYPRE_Int *converged ) + HYPRE_Int *converged ) { - return( hypre_LGMRESGetConverged( (void *) solver, converged ) ); + return ( hypre_LGMRESGetConverged( (void *) solver, converged ) ); } /*-------------------------------------------------------------------------- @@ -274,9 +268,9 @@ HYPRE_LGMRESGetConverged( HYPRE_Solver solver, HYPRE_Int HYPRE_LGMRESGetFinalRelativeResidualNorm( HYPRE_Solver solver, - HYPRE_Real *norm ) + HYPRE_Real *norm ) { - return( hypre_LGMRESGetFinalRelativeResidualNorm( (void *) solver, norm ) ); + return ( hypre_LGMRESGetFinalRelativeResidualNorm( (void *) solver, norm ) ); } /*-------------------------------------------------------------------------- diff --git a/external/hypre/src/krylov/HYPRE_lobpcg.c b/external/hypre/src/krylov/HYPRE_lobpcg.c index c5d41908..870cdde3 100644 --- a/external/hypre/src/krylov/HYPRE_lobpcg.c +++ b/external/hypre/src/krylov/HYPRE_lobpcg.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -25,8 +25,8 @@ typedef struct { - HYPRE_Int (*Precond)(void*,void*,void*,void*); - HYPRE_Int (*PrecondSetup)(void*,void*,void*,void*); + HYPRE_Int (*Precond)(void*, void*, void*, void*); + HYPRE_Int (*PrecondSetup)(void*, void*, void*, void*); } hypre_LOBPCGPrecond; @@ -77,15 +77,15 @@ typedef struct } hypre_LOBPCGData; static HYPRE_Int dsygv_interface (HYPRE_Int *itype, char *jobz, char *uplo, HYPRE_Int * - n, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Real *b, HYPRE_Int *ldb, - HYPRE_Real *w, HYPRE_Real *work, HYPRE_Int *lwork, HYPRE_Int *info) + n, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Real *b, HYPRE_Int *ldb, + HYPRE_Real *w, HYPRE_Real *work, HYPRE_Int *lwork, HYPRE_Int *info) { hypre_dsygv(itype, jobz, uplo, n, a, lda, b, ldb, w, work, lwork, info); return 0; } static HYPRE_Int dpotrf_interface (const char *uplo, HYPRE_Int *n, HYPRE_Real *a, HYPRE_Int * - lda, HYPRE_Int *info) + lda, HYPRE_Int *info) { hypre_dpotrf(uplo, n, a, lda, info); return 0; @@ -120,26 +120,30 @@ lobpcg_clean( lobpcg_Data* data ) HYPRE_Int hypre_LOBPCGDestroy( void *pcg_vdata ) { - hypre_LOBPCGData *pcg_data = (hypre_LOBPCGData*)pcg_vdata; + hypre_LOBPCGData *pcg_data = (hypre_LOBPCGData*)pcg_vdata; - if (pcg_data) { + if (pcg_data) + { HYPRE_MatvecFunctions * mv = pcg_data->matvecFunctions; - if ( pcg_data->matvecData != NULL ) { + if ( pcg_data->matvecData != NULL ) + { (*(mv->MatvecDestroy))(pcg_data->matvecData); pcg_data->matvecData = NULL; } - if ( pcg_data->matvecDataB != NULL ) { + if ( pcg_data->matvecDataB != NULL ) + { (*(mv->MatvecDestroy))(pcg_data->matvecDataB); pcg_data->matvecDataB = NULL; } - if ( pcg_data->matvecDataT != NULL ) { + if ( pcg_data->matvecDataT != NULL ) + { (*(mv->MatvecDestroy))(pcg_data->matvecDataT); pcg_data->matvecDataT = NULL; } - + lobpcg_clean( &(pcg_data->lobpcgData) ); - hypre_TFree( pcg_vdata , HYPRE_MEMORY_HOST); + hypre_TFree( pcg_vdata, HYPRE_MEMORY_HOST); } return hypre_error_flag; @@ -150,20 +154,27 @@ hypre_LOBPCGSetup( void *pcg_vdata, void *A, void *b, void *x ) { hypre_LOBPCGData *pcg_data = (hypre_LOBPCGData*)pcg_vdata; HYPRE_MatvecFunctions * mv = pcg_data->matvecFunctions; - HYPRE_Int (*precond_setup)(void*,void*,void*,void*) = (pcg_data->precondFunctions).PrecondSetup; + HYPRE_Int (*precond_setup)(void*, void*, void*, void*) = (pcg_data->precondFunctions).PrecondSetup; void *precond_data = (pcg_data->precondData); (pcg_data->A) = A; if ( pcg_data->matvecData != NULL ) + { (*(mv->MatvecDestroy))(pcg_data->matvecData); + } (pcg_data->matvecData) = (*(mv->MatvecCreate))(A, x); - if ( precond_setup != NULL ) { + if ( precond_setup != NULL ) + { if ( pcg_data->T == NULL ) + { precond_setup(precond_data, A, b, x); + } else + { precond_setup(precond_data, pcg_data->T, b, x); + } } return hypre_error_flag; @@ -178,12 +189,18 @@ hypre_LOBPCGSetupB( void *pcg_vdata, void *B, void *x ) (pcg_data->B) = B; if ( pcg_data->matvecDataB != NULL ) + { (*(mv->MatvecDestroy))(pcg_data -> matvecDataB); + } (pcg_data->matvecDataB) = (*(mv->MatvecCreate))(B, x); if ( B != NULL ) + { (pcg_data->matvecDataB) = (*(mv->MatvecCreate))(B, x); + } else + { (pcg_data->matvecDataB) = NULL; + } return hypre_error_flag; } @@ -197,11 +214,17 @@ hypre_LOBPCGSetupT( void *pcg_vdata, void *T, void *x ) (pcg_data -> T) = T; if ( pcg_data->matvecDataT != NULL ) + { (*(mv->MatvecDestroy))(pcg_data->matvecDataT); + } if ( T != NULL ) + { (pcg_data->matvecDataT) = (*(mv->MatvecCreate))(T, x); + } else + { (pcg_data->matvecDataT) = NULL; + } return hypre_error_flag; } @@ -209,48 +232,48 @@ hypre_LOBPCGSetupT( void *pcg_vdata, void *T, void *x ) HYPRE_Int hypre_LOBPCGSetTol( void* pcg_vdata, HYPRE_Real tol ) { - hypre_LOBPCGData *pcg_data = (hypre_LOBPCGData*)pcg_vdata; + hypre_LOBPCGData *pcg_data = (hypre_LOBPCGData*)pcg_vdata; lobpcg_absoluteTolerance(pcg_data->lobpcgData) = tol; - + return hypre_error_flag; } HYPRE_Int hypre_LOBPCGSetRTol( void* pcg_vdata, HYPRE_Real tol ) { - hypre_LOBPCGData *pcg_data = (hypre_LOBPCGData*) pcg_vdata; + hypre_LOBPCGData *pcg_data = (hypre_LOBPCGData*) pcg_vdata; lobpcg_relativeTolerance(pcg_data->lobpcgData) = tol; - + return hypre_error_flag; } HYPRE_Int hypre_LOBPCGSetMaxIter( void* pcg_vdata, HYPRE_Int max_iter ) { - hypre_LOBPCGData *pcg_data = (hypre_LOBPCGData*)pcg_vdata; - + hypre_LOBPCGData *pcg_data = (hypre_LOBPCGData*)pcg_vdata; + lobpcg_maxIterations(pcg_data->lobpcgData) = max_iter; - + return hypre_error_flag; } HYPRE_Int hypre_LOBPCGSetPrecondUsageMode( void* pcg_vdata, HYPRE_Int mode ) { - hypre_LOBPCGData *pcg_data = (hypre_LOBPCGData*)pcg_vdata; - + hypre_LOBPCGData *pcg_data = (hypre_LOBPCGData*)pcg_vdata; + lobpcg_precondUsageMode(pcg_data->lobpcgData) = mode; - + return hypre_error_flag; } HYPRE_Int hypre_LOBPCGGetPrecond( void *pcg_vdata, - HYPRE_Solver *precond_data_ptr ) + HYPRE_Solver *precond_data_ptr ) { - hypre_LOBPCGData* pcg_data = (hypre_LOBPCGData*)pcg_vdata; + hypre_LOBPCGData* pcg_data = (hypre_LOBPCGData*)pcg_vdata; *precond_data_ptr = (HYPRE_Solver)(pcg_data -> precondData); @@ -259,16 +282,16 @@ hypre_LOBPCGGetPrecond( void *pcg_vdata, HYPRE_Int hypre_LOBPCGSetPrecond( void *pcg_vdata, - HYPRE_Int (*precond)(void*,void*,void*,void*), - HYPRE_Int (*precond_setup)(void*,void*,void*,void*), - void *precond_data ) + HYPRE_Int (*precond)(void*, void*, void*, void*), + HYPRE_Int (*precond_setup)(void*, void*, void*, void*), + void *precond_data ) { hypre_LOBPCGData* pcg_data = (hypre_LOBPCGData*)pcg_vdata; - + (pcg_data->precondFunctions).Precond = precond; (pcg_data->precondFunctions).PrecondSetup = precond_setup; (pcg_data->precondData) = precond_data; - + return hypre_error_flag; } @@ -276,9 +299,9 @@ HYPRE_Int hypre_LOBPCGSetPrintLevel( void *pcg_vdata, HYPRE_Int level ) { hypre_LOBPCGData *pcg_data = (hypre_LOBPCGData*)pcg_vdata; - + lobpcg_verbosityLevel(pcg_data->lobpcgData) = level; - + return hypre_error_flag; } @@ -287,22 +310,31 @@ hypre_LOBPCGPreconditioner( void *vdata, void* x, void* y ) { hypre_LOBPCGData *data = (hypre_LOBPCGData*)vdata; mv_InterfaceInterpreter* ii = data->interpreter; - HYPRE_Int (*precond)(void*,void*,void*,void*) = (data->precondFunctions).Precond; + HYPRE_Int (*precond)(void*, void*, void*, void*) = (data->precondFunctions).Precond; - if ( precond == NULL ) { - (*(ii->CopyVector))(x,y); + if ( precond == NULL ) + { + (*(ii->CopyVector))(x, y); return; } if ( lobpcg_precondUsageMode(data->lobpcgData) == 0 ) + { (*(ii->ClearVector))(y); + } else - (*(ii->CopyVector))(x,y); - + { + (*(ii->CopyVector))(x, y); + } + if ( data->T == NULL ) + { precond(data->precondData, data->A, x, y); + } else + { precond(data->precondData, data->T, x, y); + } } void @@ -310,7 +342,7 @@ hypre_LOBPCGOperatorA( void *pcg_vdata, void* x, void* y ) { hypre_LOBPCGData* pcg_data = (hypre_LOBPCGData*)pcg_vdata; HYPRE_MatvecFunctions * mv = pcg_data->matvecFunctions; - void* matvec_data = (pcg_data -> matvecData); + void* matvec_data = (pcg_data -> matvecData); (*(mv->Matvec))(matvec_data, 1.0, pcg_data->A, x, 0.0, y); } @@ -323,14 +355,15 @@ hypre_LOBPCGOperatorB( void *pcg_vdata, void* x, void* y ) HYPRE_MatvecFunctions * mv = pcg_data->matvecFunctions; void* matvec_data = (pcg_data -> matvecDataB); - if ( pcg_data->B == NULL ) { + if ( pcg_data->B == NULL ) + { (*(ii->CopyVector))(x, y); /* a test */ /* (*(ii->ScaleVector))(2.0, y); */ - + return; } @@ -341,8 +374,8 @@ void hypre_LOBPCGMultiPreconditioner( void *data, void * x, void* y ) { hypre_LOBPCGData *pcg_data = (hypre_LOBPCGData*)data; - mv_InterfaceInterpreter* ii = pcg_data->interpreter; - + mv_InterfaceInterpreter* ii = pcg_data->interpreter; + ii->Eval( hypre_LOBPCGPreconditioner, data, x, y ); } @@ -351,7 +384,7 @@ hypre_LOBPCGMultiOperatorA( void *data, void * x, void* y ) { hypre_LOBPCGData *pcg_data = (hypre_LOBPCGData*)data; mv_InterfaceInterpreter* ii = pcg_data->interpreter; - + ii->Eval( hypre_LOBPCGOperatorA, data, x, y ); } @@ -360,20 +393,20 @@ hypre_LOBPCGMultiOperatorB( void *data, void * x, void* y ) { hypre_LOBPCGData *pcg_data = (hypre_LOBPCGData*)data; mv_InterfaceInterpreter* ii = pcg_data->interpreter; - + ii->Eval( hypre_LOBPCGOperatorB, data, x, y ); } HYPRE_Int -hypre_LOBPCGSolve( void *vdata, - mv_MultiVectorPtr con, - mv_MultiVectorPtr vec, - HYPRE_Real* val ) +hypre_LOBPCGSolve( void *vdata, + mv_MultiVectorPtr con, + mv_MultiVectorPtr vec, + HYPRE_Real* val ) { hypre_LOBPCGData* data = (hypre_LOBPCGData*)vdata; - HYPRE_Int (*precond)(void*,void*,void*,void*) = (data->precondFunctions).Precond; + HYPRE_Int (*precond)(void*, void*, void*, void*) = (data->precondFunctions).Precond; void* opB = data->B; - + void (*prec)( void*, void*, void* ); void (*operatorA)( void*, void*, void* ); void (*operatorB)( void*, void*, void* ); @@ -381,51 +414,59 @@ hypre_LOBPCGSolve( void *vdata, HYPRE_Int maxit = lobpcg_maxIterations(data->lobpcgData); HYPRE_Int verb = lobpcg_verbosityLevel(data->lobpcgData); - HYPRE_Int n = mv_MultiVectorWidth( vec ); + HYPRE_Int n = mv_MultiVectorWidth( vec ); lobpcg_BLASLAPACKFunctions blap_fn; - + utilities_FortranMatrix* lambdaHistory; utilities_FortranMatrix* residuals; utilities_FortranMatrix* residualsHistory; - - lambdaHistory = lobpcg_eigenvaluesHistory(data->lobpcgData); + + lambdaHistory = lobpcg_eigenvaluesHistory(data->lobpcgData); residuals = lobpcg_residualNorms(data->lobpcgData); residualsHistory = lobpcg_residualNormsHistory(data->lobpcgData); - utilities_FortranMatrixAllocateData( n, maxit + 1, lambdaHistory ); - utilities_FortranMatrixAllocateData( n, 1, residuals ); - utilities_FortranMatrixAllocateData( n, maxit + 1, residualsHistory ); + utilities_FortranMatrixAllocateData( n, maxit + 1, lambdaHistory ); + utilities_FortranMatrixAllocateData( n, 1, residuals ); + utilities_FortranMatrixAllocateData( n, maxit + 1, residualsHistory ); if ( precond != NULL ) + { prec = hypre_LOBPCGMultiPreconditioner; + } else + { prec = NULL; + } operatorA = hypre_LOBPCGMultiOperatorA; if ( opB != NULL ) + { operatorB = hypre_LOBPCGMultiOperatorB; + } else + { operatorB = NULL; + } blap_fn.dsygv = dsygv_interface; blap_fn.dpotrf = dpotrf_interface; - - lobpcg_solve( vec, - vdata, operatorA, + + lobpcg_solve( vec, + vdata, operatorA, vdata, operatorB, vdata, prec, con, blap_fn, lobpcg_tolerance(data->lobpcgData), maxit, verb, &(lobpcg_iterationNumber(data->lobpcgData)), - val, + val, utilities_FortranMatrixValues(lambdaHistory), utilities_FortranMatrixGlobalHeight(lambdaHistory), utilities_FortranMatrixValues(residuals), utilities_FortranMatrixValues(residualsHistory), utilities_FortranMatrixGlobalHeight(residualsHistory) - ); + ); return hypre_error_flag; } @@ -433,21 +474,21 @@ hypre_LOBPCGSolve( void *vdata, utilities_FortranMatrix* hypre_LOBPCGResidualNorms( void *vdata ) { - hypre_LOBPCGData *data = (hypre_LOBPCGData*)vdata; + hypre_LOBPCGData *data = (hypre_LOBPCGData*)vdata; return (lobpcg_residualNorms(data->lobpcgData)); } utilities_FortranMatrix* hypre_LOBPCGResidualNormsHistory( void *vdata ) { - hypre_LOBPCGData *data = (hypre_LOBPCGData*)vdata; + hypre_LOBPCGData *data = (hypre_LOBPCGData*)vdata; return (lobpcg_residualNormsHistory(data->lobpcgData)); } utilities_FortranMatrix* hypre_LOBPCGEigenvaluesHistory( void *vdata ) { - hypre_LOBPCGData *data = (hypre_LOBPCGData*)vdata; + hypre_LOBPCGData *data = (hypre_LOBPCGData*)vdata; return (lobpcg_eigenvaluesHistory(data->lobpcgData)); } @@ -460,7 +501,7 @@ hypre_LOBPCGIterations( void* vdata ) HYPRE_Int -HYPRE_LOBPCGCreate( mv_InterfaceInterpreter* ii, HYPRE_MatvecFunctions* mv, +HYPRE_LOBPCGCreate( mv_InterfaceInterpreter* ii, HYPRE_MatvecFunctions* mv, HYPRE_Solver* solver ) { hypre_LOBPCGData *pcg_data; @@ -475,12 +516,12 @@ HYPRE_LOBPCGCreate( mv_InterfaceInterpreter* ii, HYPRE_MatvecFunctions* mv, (pcg_data->interpreter) = ii; pcg_data->matvecFunctions = mv; - (pcg_data->matvecData) = NULL; - (pcg_data->B) = NULL; - (pcg_data->matvecDataB) = NULL; - (pcg_data->T) = NULL; - (pcg_data->matvecDataT) = NULL; - (pcg_data->precondData) = NULL; + (pcg_data->matvecData) = NULL; + (pcg_data->B) = NULL; + (pcg_data->matvecDataB) = NULL; + (pcg_data->T) = NULL; + (pcg_data->matvecDataT) = NULL; + (pcg_data->precondData) = NULL; lobpcg_initialize( &(pcg_data->lobpcgData) ); @@ -489,66 +530,66 @@ HYPRE_LOBPCGCreate( mv_InterfaceInterpreter* ii, HYPRE_MatvecFunctions* mv, return hypre_error_flag; } -HYPRE_Int +HYPRE_Int HYPRE_LOBPCGDestroy( HYPRE_Solver solver ) { - return( hypre_LOBPCGDestroy( (void *) solver ) ); + return ( hypre_LOBPCGDestroy( (void *) solver ) ); } -HYPRE_Int +HYPRE_Int HYPRE_LOBPCGSetup( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ) { - return( hypre_LOBPCGSetup( solver, A, b, x ) ); + return ( hypre_LOBPCGSetup( solver, A, b, x ) ); } -HYPRE_Int +HYPRE_Int HYPRE_LOBPCGSetupB( HYPRE_Solver solver, HYPRE_Matrix B, HYPRE_Vector x ) { - return( hypre_LOBPCGSetupB( solver, B, x ) ); + return ( hypre_LOBPCGSetupB( solver, B, x ) ); } -HYPRE_Int +HYPRE_Int HYPRE_LOBPCGSetupT( HYPRE_Solver solver, HYPRE_Matrix T, HYPRE_Vector x ) { - return( hypre_LOBPCGSetupT( solver, T, x ) ); + return ( hypre_LOBPCGSetupT( solver, T, x ) ); } -HYPRE_Int -HYPRE_LOBPCGSolve( HYPRE_Solver solver, mv_MultiVectorPtr con, - mv_MultiVectorPtr vec, HYPRE_Real* val ) +HYPRE_Int +HYPRE_LOBPCGSolve( HYPRE_Solver solver, mv_MultiVectorPtr con, + mv_MultiVectorPtr vec, HYPRE_Real* val ) { - return( hypre_LOBPCGSolve( (void *) solver, con, vec, val ) ); + return ( hypre_LOBPCGSolve( (void *) solver, con, vec, val ) ); } HYPRE_Int HYPRE_LOBPCGSetTol( HYPRE_Solver solver, HYPRE_Real tol ) { - return( hypre_LOBPCGSetTol( (void *) solver, tol ) ); + return ( hypre_LOBPCGSetTol( (void *) solver, tol ) ); } HYPRE_Int HYPRE_LOBPCGSetRTol( HYPRE_Solver solver, HYPRE_Real tol ) { - return( hypre_LOBPCGSetRTol( (void *) solver, tol ) ); + return ( hypre_LOBPCGSetRTol( (void *) solver, tol ) ); } HYPRE_Int HYPRE_LOBPCGSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ) { - return( hypre_LOBPCGSetMaxIter( (void *) solver, max_iter ) ); + return ( hypre_LOBPCGSetMaxIter( (void *) solver, max_iter ) ); } HYPRE_Int HYPRE_LOBPCGSetPrecondUsageMode( HYPRE_Solver solver, HYPRE_Int mode ) { - return( hypre_LOBPCGSetPrecondUsageMode( (void *) solver, mode ) ); + return ( hypre_LOBPCGSetPrecondUsageMode( (void *) solver, mode ) ); } HYPRE_Int @@ -557,24 +598,24 @@ HYPRE_LOBPCGSetPrecond( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ) { - return( hypre_LOBPCGSetPrecond( (void *) solver, - (HYPRE_Int (*)(void*, void*, void*, void*))precond, - (HYPRE_Int (*)(void*, void*, void*, void*))precond_setup, - (void *) precond_solver ) ); + return ( hypre_LOBPCGSetPrecond( (void *) solver, + (HYPRE_Int (*)(void*, void*, void*, void*))precond, + (HYPRE_Int (*)(void*, void*, void*, void*))precond_setup, + (void *) precond_solver ) ); } HYPRE_Int HYPRE_LOBPCGGetPrecond( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ) { - return( hypre_LOBPCGGetPrecond( (void *) solver, - (HYPRE_Solver *) precond_data_ptr ) ); + return ( hypre_LOBPCGGetPrecond( (void *) solver, + (HYPRE_Solver *) precond_data_ptr ) ); } HYPRE_Int HYPRE_LOBPCGSetPrintLevel( HYPRE_Solver solver, HYPRE_Int level ) { - return( hypre_LOBPCGSetPrintLevel( (void*)solver, level ) ); + return ( hypre_LOBPCGSetPrintLevel( (void*)solver, level ) ); } utilities_FortranMatrix* diff --git a/external/hypre/src/krylov/HYPRE_lobpcg.h b/external/hypre/src/krylov/HYPRE_lobpcg.h index 1b6e678d..fd70c3bd 100644 --- a/external/hypre/src/krylov/HYPRE_lobpcg.h +++ b/external/hypre/src/krylov/HYPRE_lobpcg.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -26,11 +26,9 @@ extern "C" { /** * @defgroup Eigensolvers Eigensolvers * - * These eigensolvers support many of the matrix/vector storage schemes in - * hypre. They should be used in conjunction with the storage-specific - * interfaces. - * - * @memo A basic interface for eigensolvers + * A basic interface for eigensolvers. These eigensolvers support many of the + * matrix/vector storage schemes in hypre. They should be used in conjunction + * with the storage-specific interfaces. * * @{ **/ @@ -44,33 +42,6 @@ extern "C" { * @{ **/ -#ifndef HYPRE_SOLVER_STRUCT -#define HYPRE_SOLVER_STRUCT - struct hypre_Solver_struct; -/** - * The solver object. - **/ - typedef struct hypre_Solver_struct *HYPRE_Solver; -#endif - -#ifndef HYPRE_MATRIX_STRUCT -#define HYPRE_MATRIX_STRUCT - struct hypre_Matrix_struct; -/** - * The matrix object. - **/ - typedef struct hypre_Matrix_struct *HYPRE_Matrix; -#endif - -#ifndef HYPRE_VECTOR_STRUCT -#define HYPRE_VECTOR_STRUCT - struct hypre_Vector_struct; -/** - * The vector object. - **/ - typedef struct hypre_Vector_struct *HYPRE_Vector; -#endif - /**@}*/ /*-------------------------------------------------------------------------- diff --git a/external/hypre/src/krylov/HYPRE_pcg.c b/external/hypre/src/krylov/HYPRE_pcg.c index dd6348ae..02b7e4b1 100644 --- a/external/hypre/src/krylov/HYPRE_pcg.c +++ b/external/hypre/src/krylov/HYPRE_pcg.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -25,32 +25,26 @@ * HYPRE_PCGSetup *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_PCGSetup( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ) { - return( hypre_PCGSetup( solver, - A, - b, - x ) ); + return ( hypre_PCGSetup( solver, A, b, x ) ); } /*-------------------------------------------------------------------------- * HYPRE_PCGSolve *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_PCGSolve( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ) { - return( hypre_PCGSolve( (void *) solver, - (void *) A, - (void *) b, - (void *) x ) ); + return ( hypre_PCGSolve( solver, A, b, x ) ); } /*-------------------------------------------------------------------------- @@ -61,14 +55,14 @@ HYPRE_Int HYPRE_PCGSetTol( HYPRE_Solver solver, HYPRE_Real tol ) { - return( hypre_PCGSetTol( (void *) solver, tol ) ); + return ( hypre_PCGSetTol( (void *) solver, tol ) ); } HYPRE_Int HYPRE_PCGGetTol( HYPRE_Solver solver, HYPRE_Real *tol ) { - return( hypre_PCGGetTol( (void *) solver, tol ) ); + return ( hypre_PCGGetTol( (void *) solver, tol ) ); } /*-------------------------------------------------------------------------- * HYPRE_PCGSetAbsoluteTol, HYPRE_PCGGetAbsoluteTol @@ -78,14 +72,14 @@ HYPRE_Int HYPRE_PCGSetAbsoluteTol( HYPRE_Solver solver, HYPRE_Real a_tol ) { - return( hypre_PCGSetAbsoluteTol( (void *) solver, a_tol ) ); + return ( hypre_PCGSetAbsoluteTol( (void *) solver, a_tol ) ); } HYPRE_Int HYPRE_PCGGetAbsoluteTol( HYPRE_Solver solver, HYPRE_Real *a_tol ) { - return( hypre_PCGGetAbsoluteTol( (void *) solver, a_tol ) ); + return ( hypre_PCGGetAbsoluteTol( (void *) solver, a_tol ) ); } /*-------------------------------------------------------------------------- @@ -96,14 +90,14 @@ HYPRE_Int HYPRE_PCGSetResidualTol( HYPRE_Solver solver, HYPRE_Real rtol ) { - return( hypre_PCGSetResidualTol( (void *) solver, rtol ) ); + return ( hypre_PCGSetResidualTol( (void *) solver, rtol ) ); } HYPRE_Int HYPRE_PCGGetResidualTol( HYPRE_Solver solver, HYPRE_Real *rtol ) { - return( hypre_PCGGetResidualTol( (void *) solver, rtol ) ); + return ( hypre_PCGGetResidualTol( (void *) solver, rtol ) ); } /*-------------------------------------------------------------------------- @@ -114,14 +108,14 @@ HYPRE_Int HYPRE_PCGSetAbsoluteTolFactor( HYPRE_Solver solver, HYPRE_Real abstolf ) { - return( hypre_PCGSetAbsoluteTolFactor( (void *) solver, abstolf ) ); + return ( hypre_PCGSetAbsoluteTolFactor( (void *) solver, abstolf ) ); } HYPRE_Int HYPRE_PCGGetAbsoluteTolFactor( HYPRE_Solver solver, HYPRE_Real *abstolf ) { - return( hypre_PCGGetAbsoluteTolFactor( (void *) solver, abstolf ) ); + return ( hypre_PCGGetAbsoluteTolFactor( (void *) solver, abstolf ) ); } /*-------------------------------------------------------------------------- @@ -152,14 +146,14 @@ HYPRE_Int HYPRE_PCGSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ) { - return( hypre_PCGSetMaxIter( (void *) solver, max_iter ) ); + return ( hypre_PCGSetMaxIter( (void *) solver, max_iter ) ); } HYPRE_Int HYPRE_PCGGetMaxIter( HYPRE_Solver solver, HYPRE_Int *max_iter ) { - return( hypre_PCGGetMaxIter( (void *) solver, max_iter ) ); + return ( hypre_PCGGetMaxIter( (void *) solver, max_iter ) ); } /*-------------------------------------------------------------------------- @@ -170,14 +164,14 @@ HYPRE_Int HYPRE_PCGSetStopCrit( HYPRE_Solver solver, HYPRE_Int stop_crit ) { - return( hypre_PCGSetStopCrit( (void *) solver, stop_crit ) ); + return ( hypre_PCGSetStopCrit( (void *) solver, stop_crit ) ); } HYPRE_Int HYPRE_PCGGetStopCrit( HYPRE_Solver solver, HYPRE_Int *stop_crit ) { - return( hypre_PCGGetStopCrit( (void *) solver, stop_crit ) ); + return ( hypre_PCGGetStopCrit( (void *) solver, stop_crit ) ); } /*-------------------------------------------------------------------------- @@ -188,14 +182,14 @@ HYPRE_Int HYPRE_PCGSetTwoNorm( HYPRE_Solver solver, HYPRE_Int two_norm ) { - return( hypre_PCGSetTwoNorm( (void *) solver, two_norm ) ); + return ( hypre_PCGSetTwoNorm( (void *) solver, two_norm ) ); } HYPRE_Int HYPRE_PCGGetTwoNorm( HYPRE_Solver solver, HYPRE_Int *two_norm ) { - return( hypre_PCGGetTwoNorm( (void *) solver, two_norm ) ); + return ( hypre_PCGGetTwoNorm( (void *) solver, two_norm ) ); } /*-------------------------------------------------------------------------- @@ -206,14 +200,14 @@ HYPRE_Int HYPRE_PCGSetRelChange( HYPRE_Solver solver, HYPRE_Int rel_change ) { - return( hypre_PCGSetRelChange( (void *) solver, rel_change ) ); + return ( hypre_PCGSetRelChange( (void *) solver, rel_change ) ); } HYPRE_Int HYPRE_PCGGetRelChange( HYPRE_Solver solver, HYPRE_Int *rel_change ) { - return( hypre_PCGGetRelChange( (void *) solver, rel_change ) ); + return ( hypre_PCGGetRelChange( (void *) solver, rel_change ) ); } /*-------------------------------------------------------------------------- @@ -224,14 +218,14 @@ HYPRE_Int HYPRE_PCGSetRecomputeResidual( HYPRE_Solver solver, HYPRE_Int recompute_residual ) { - return( hypre_PCGSetRecomputeResidual( (void *) solver, recompute_residual ) ); + return ( hypre_PCGSetRecomputeResidual( (void *) solver, recompute_residual ) ); } HYPRE_Int HYPRE_PCGGetRecomputeResidual( HYPRE_Solver solver, HYPRE_Int *recompute_residual ) { - return( hypre_PCGGetRecomputeResidual( (void *) solver, recompute_residual ) ); + return ( hypre_PCGGetRecomputeResidual( (void *) solver, recompute_residual ) ); } /*-------------------------------------------------------------------------- @@ -242,14 +236,50 @@ HYPRE_Int HYPRE_PCGSetRecomputeResidualP( HYPRE_Solver solver, HYPRE_Int recompute_residual_p ) { - return( hypre_PCGSetRecomputeResidualP( (void *) solver, recompute_residual_p ) ); + return ( hypre_PCGSetRecomputeResidualP( (void *) solver, recompute_residual_p ) ); } HYPRE_Int HYPRE_PCGGetRecomputeResidualP( HYPRE_Solver solver, HYPRE_Int *recompute_residual_p ) { - return( hypre_PCGGetRecomputeResidualP( (void *) solver, recompute_residual_p ) ); + return ( hypre_PCGGetRecomputeResidualP( (void *) solver, recompute_residual_p ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_PCGSetSkipBreak, HYPRE_PCGGetSkipBreak + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGSetSkipBreak( HYPRE_Solver solver, + HYPRE_Int skip_break ) +{ + return ( hypre_PCGSetSkipBreak( (void *) solver, skip_break ) ); +} + +HYPRE_Int +HYPRE_PCGGetSkipBreak( HYPRE_Solver solver, + HYPRE_Int *skip_break ) +{ + return ( hypre_PCGGetSkipBreak( (void *) solver, skip_break ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_PCGSetFlex, HYPRE_PCGGetFlex + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGSetFlex( HYPRE_Solver solver, + HYPRE_Int flex ) +{ + return ( hypre_PCGSetFlex( (void *) solver, flex ) ); +} + +HYPRE_Int +HYPRE_PCGGetFlex( HYPRE_Solver solver, + HYPRE_Int *flex ) +{ + return ( hypre_PCGGetFlex( (void *) solver, flex ) ); } /*-------------------------------------------------------------------------- @@ -262,10 +292,22 @@ HYPRE_PCGSetPrecond( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ) { - return( hypre_PCGSetPrecond( (void *) solver, - (HYPRE_Int (*)(void*, void*, void*, void*))precond, - (HYPRE_Int (*)(void*, void*, void*, void*))precond_setup, - (void *) precond_solver ) ); + return ( hypre_PCGSetPrecond( (void *) solver, + (HYPRE_Int (*)(void*, void*, void*, void*))precond, + (HYPRE_Int (*)(void*, void*, void*, void*))precond_setup, + (void *) precond_solver ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_PCGSetPreconditioner + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGSetPreconditioner( HYPRE_Solver solver, + HYPRE_Solver precond_solver ) +{ + return ( hypre_PCGSetPreconditioner( (void *) solver, + (void *) precond_solver ) ); } /*-------------------------------------------------------------------------- @@ -276,8 +318,8 @@ HYPRE_Int HYPRE_PCGGetPrecond( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ) { - return( hypre_PCGGetPrecond( (void *) solver, - (HYPRE_Solver *) precond_data_ptr ) ); + return ( hypre_PCGGetPrecond( (void *) solver, + (HYPRE_Solver *) precond_data_ptr ) ); } /*-------------------------------------------------------------------------- @@ -308,14 +350,14 @@ HYPRE_Int HYPRE_PCGSetPrintLevel( HYPRE_Solver solver, HYPRE_Int level ) { - return( hypre_PCGSetPrintLevel( (void *) solver, level ) ); + return ( hypre_PCGSetPrintLevel( (void *) solver, level ) ); } HYPRE_Int HYPRE_PCGGetPrintLevel( HYPRE_Solver solver, HYPRE_Int *level ) { - return( hypre_PCGGetPrintLevel( (void *) solver, level ) ); + return ( hypre_PCGGetPrintLevel( (void *) solver, level ) ); } /*-------------------------------------------------------------------------- @@ -326,7 +368,7 @@ HYPRE_Int HYPRE_PCGGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ) { - return( hypre_PCGGetNumIterations( (void *) solver, num_iterations ) ); + return ( hypre_PCGGetNumIterations( (void *) solver, num_iterations ) ); } /*-------------------------------------------------------------------------- @@ -337,7 +379,7 @@ HYPRE_Int HYPRE_PCGGetConverged( HYPRE_Solver solver, HYPRE_Int *converged ) { - return( hypre_PCGGetConverged( (void *) solver, converged ) ); + return ( hypre_PCGGetConverged( (void *) solver, converged ) ); } /*-------------------------------------------------------------------------- @@ -348,7 +390,7 @@ HYPRE_Int HYPRE_PCGGetFinalRelativeResidualNorm( HYPRE_Solver solver, HYPRE_Real *norm ) { - return( hypre_PCGGetFinalRelativeResidualNorm( (void *) solver, norm ) ); + return ( hypre_PCGGetFinalRelativeResidualNorm( (void *) solver, norm ) ); } /*-------------------------------------------------------------------------- @@ -361,4 +403,3 @@ HYPRE_Int HYPRE_PCGGetResidual( HYPRE_Solver solver, /* returns a pointer to the residual vector */ return hypre_PCGGetResidual( (void *) solver, (void **) residual ); } - diff --git a/external/hypre/src/krylov/bicgstab.c b/external/hypre/src/krylov/bicgstab.c index ed9cc013..42c5efc7 100644 --- a/external/hypre/src/krylov/bicgstab.c +++ b/external/hypre/src/krylov/bicgstab.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -22,24 +22,24 @@ hypre_BiCGSTABFunctions * hypre_BiCGSTABFunctionsCreate( void * (*CreateVector) ( void *vvector ), HYPRE_Int (*DestroyVector) ( void *vvector ), - void * (*MatvecCreate) ( void *A , void *x ), - HYPRE_Int (*Matvec) ( void *matvec_data , HYPRE_Complex alpha , void *A , - void *x , HYPRE_Complex beta , void *y ), + void * (*MatvecCreate) ( void *A, void *x ), + HYPRE_Int (*Matvec) ( void *matvec_data, HYPRE_Complex alpha, void *A, + void *x, HYPRE_Complex beta, void *y ), HYPRE_Int (*MatvecDestroy) ( void *matvec_data ), - HYPRE_Real (*InnerProd) ( void *x , void *y ), - HYPRE_Int (*CopyVector) ( void *x , void *y ), + HYPRE_Real (*InnerProd) ( void *x, void *y ), + HYPRE_Int (*CopyVector) ( void *x, void *y ), HYPRE_Int (*ClearVector) ( void *x ), - HYPRE_Int (*ScaleVector) ( HYPRE_Complex alpha , void *x ), - HYPRE_Int (*Axpy) ( HYPRE_Complex alpha , void *x , void *y ), - HYPRE_Int (*CommInfo) ( void *A , HYPRE_Int *my_id , + HYPRE_Int (*ScaleVector) ( HYPRE_Complex alpha, void *x ), + HYPRE_Int (*Axpy) ( HYPRE_Complex alpha, void *x, void *y ), + HYPRE_Int (*CommInfo) ( void *A, HYPRE_Int *my_id, HYPRE_Int *num_procs ), HYPRE_Int (*PrecondSetup) ( void *vdata, void *A, void *b, void *x ), HYPRE_Int (*Precond) ( void *vdata, void *A, void *b, void *x ) - ) +) { hypre_BiCGSTABFunctions * bicgstab_functions; bicgstab_functions = (hypre_BiCGSTABFunctions *) - hypre_CTAlloc( hypre_BiCGSTABFunctions, 1 , HYPRE_MEMORY_HOST); + hypre_CTAlloc( hypre_BiCGSTABFunctions, 1, HYPRE_MEMORY_HOST); bicgstab_functions->CreateVector = CreateVector; bicgstab_functions->DestroyVector = DestroyVector; @@ -112,7 +112,9 @@ hypre_BiCGSTABDestroy( void *bicgstab_vdata ) { hypre_BiCGSTABFunctions *bicgstab_functions = bicgstab_data->functions; if ( (bicgstab_data -> norms) != NULL ) - hypre_TFree(bicgstab_data -> norms, HYPRE_MEMORY_HOST); + { + hypre_TFree(bicgstab_data -> norms, HYPRE_MEMORY_HOST); + } (*(bicgstab_functions->MatvecDestroy))(bicgstab_data -> matvec_data); @@ -129,7 +131,7 @@ hypre_BiCGSTABDestroy( void *bicgstab_vdata ) HYPRE_ANNOTATE_FUNC_END; - return(hypre_error_flag); + return (hypre_error_flag); } /*-------------------------------------------------------------------------- @@ -138,15 +140,16 @@ hypre_BiCGSTABDestroy( void *bicgstab_vdata ) HYPRE_Int hypre_BiCGSTABSetup( void *bicgstab_vdata, - void *A, - void *b, - void *x ) + void *A, + void *b, + void *x ) { hypre_BiCGSTABData *bicgstab_data = (hypre_BiCGSTABData *)bicgstab_vdata; hypre_BiCGSTABFunctions *bicgstab_functions = bicgstab_data->functions; HYPRE_Int max_iter = (bicgstab_data -> max_iter); - HYPRE_Int (*precond_setup)(void*,void*,void*,void*) = (bicgstab_functions -> precond_setup); + HYPRE_Int (*precond_setup)(void*, void*, void*, + void*) = (bicgstab_functions -> precond_setup); void *precond_data = (bicgstab_data -> precond_data); HYPRE_ANNOTATE_FUNC_BEGIN; @@ -160,17 +163,29 @@ hypre_BiCGSTABSetup( void *bicgstab_vdata, *--------------------------------------------------*/ if ((bicgstab_data -> p) == NULL) + { (bicgstab_data -> p) = (*(bicgstab_functions->CreateVector))(b); + } if ((bicgstab_data -> q) == NULL) + { (bicgstab_data -> q) = (*(bicgstab_functions->CreateVector))(b); + } if ((bicgstab_data -> r) == NULL) + { (bicgstab_data -> r) = (*(bicgstab_functions->CreateVector))(b); + } if ((bicgstab_data -> r0) == NULL) + { (bicgstab_data -> r0) = (*(bicgstab_functions->CreateVector))(b); + } if ((bicgstab_data -> s) == NULL) + { (bicgstab_data -> s) = (*(bicgstab_functions->CreateVector))(b); + } if ((bicgstab_data -> v) == NULL) + { (bicgstab_data -> v) = (*(bicgstab_functions->CreateVector))(b); + } if ((bicgstab_data -> matvec_data) == NULL) (bicgstab_data -> matvec_data) = @@ -182,16 +197,20 @@ hypre_BiCGSTABSetup( void *bicgstab_vdata, * Allocate space for log info *-----------------------------------------------------*/ - if ((bicgstab_data->logging)>0 || (bicgstab_data->print_level) > 0) + if ((bicgstab_data->logging) > 0 || (bicgstab_data->print_level) > 0) { if ((bicgstab_data -> norms) != NULL) + { hypre_TFree (bicgstab_data -> norms, HYPRE_MEMORY_HOST); + } (bicgstab_data -> norms) = hypre_CTAlloc(HYPRE_Real, max_iter + 1, HYPRE_MEMORY_HOST); } if ((bicgstab_data -> print_level) > 0) { if ((bicgstab_data -> log_file_name) == NULL) - (bicgstab_data -> log_file_name) = (char*)"bicgstab.out.log"; + { + (bicgstab_data -> log_file_name) = (char*)"bicgstab.out.log"; + } } HYPRE_ANNOTATE_FUNC_END; @@ -205,19 +224,19 @@ hypre_BiCGSTABSetup( void *bicgstab_vdata, HYPRE_Int hypre_BiCGSTABSolve(void *bicgstab_vdata, - void *A, - void *b, - void *x) + void *A, + void *b, + void *x) { hypre_BiCGSTABData *bicgstab_data = (hypre_BiCGSTABData*)bicgstab_vdata; hypre_BiCGSTABFunctions *bicgstab_functions = bicgstab_data->functions; HYPRE_Int min_iter = (bicgstab_data -> min_iter); - HYPRE_Int max_iter = (bicgstab_data -> max_iter); - HYPRE_Int stop_crit = (bicgstab_data -> stop_crit); - HYPRE_Int hybrid = (bicgstab_data -> hybrid); - HYPRE_Real r_tol = (bicgstab_data -> tol); - HYPRE_Real cf_tol = (bicgstab_data -> cf_tol); + HYPRE_Int max_iter = (bicgstab_data -> max_iter); + HYPRE_Int stop_crit = (bicgstab_data -> stop_crit); + HYPRE_Int hybrid = (bicgstab_data -> hybrid); + HYPRE_Real r_tol = (bicgstab_data -> tol); + HYPRE_Real cf_tol = (bicgstab_data -> cf_tol); void *matvec_data = (bicgstab_data -> matvec_data); HYPRE_Real a_tol = (bicgstab_data -> a_tol); @@ -230,8 +249,8 @@ hypre_BiCGSTABSolve(void *bicgstab_vdata, void *p = (bicgstab_data -> p); void *q = (bicgstab_data -> q); - HYPRE_Int (*precond)(void*,void*,void*,void*) = (bicgstab_functions -> precond); - HYPRE_Int *precond_data = (HYPRE_Int*)(bicgstab_data -> precond_data); + HYPRE_Int (*precond)(void*, void*, void*, void*) = (bicgstab_functions -> precond); + HYPRE_Int *precond_data = (HYPRE_Int*)(bicgstab_data -> precond_data); /* logging variables */ HYPRE_Int logging = (bicgstab_data -> logging); @@ -257,7 +276,7 @@ hypre_BiCGSTABSolve(void *bicgstab_vdata, (bicgstab_data -> converged) = 0; - (*(bicgstab_functions->CommInfo))(A,&my_id,&num_procs); + (*(bicgstab_functions->CommInfo))(A, &my_id, &num_procs); if (logging > 0 || print_level > 0) { norms = (bicgstab_data -> norms); @@ -266,19 +285,19 @@ hypre_BiCGSTABSolve(void *bicgstab_vdata, } /* initialize work arrays */ - (*(bicgstab_functions->CopyVector))(b,r0); + (*(bicgstab_functions->CopyVector))(b, r0); /* compute initial residual */ - (*(bicgstab_functions->Matvec))(matvec_data,-1.0, A, x, 1.0, r0); - (*(bicgstab_functions->CopyVector))(r0,r); - (*(bicgstab_functions->CopyVector))(r0,p); + (*(bicgstab_functions->Matvec))(matvec_data, -1.0, A, x, 1.0, r0); + (*(bicgstab_functions->CopyVector))(r0, r); + (*(bicgstab_functions->CopyVector))(r0, p); - b_norm = sqrt((*(bicgstab_functions->InnerProd))(b,b)); + b_norm = hypre_sqrt((*(bicgstab_functions->InnerProd))(b, b)); - /* Since it is does not diminish performance, attempt to return an error flag + /* Since it does not diminish performance, attempt to return an error flag and notify users when they supply bad input. */ - if (b_norm != 0.) ieee_check = b_norm/b_norm; /* INF -> NaN conversion */ + if (b_norm != 0.) { ieee_check = b_norm / b_norm; } /* INF -> NaN conversion */ if (ieee_check != ieee_check) { /* ...INFs or NaNs in input can make ieee_check a NaN. This test @@ -288,11 +307,11 @@ hypre_BiCGSTABSolve(void *bicgstab_vdata, found at http://HTTP.CS.Berkeley.EDU/~wkahan/ieee754status/IEEE754.PDF */ if (logging > 0 || print_level > 0) { - hypre_printf("\n\nERROR detected by Hypre ... BEGIN\n"); - hypre_printf("ERROR -- hypre_BiCGSTABSolve: INFs and/or NaNs detected in input.\n"); - hypre_printf("User probably placed non-numerics in supplied b.\n"); - hypre_printf("Returning error flag += 101. Program not terminated.\n"); - hypre_printf("ERROR detected by Hypre ... END\n\n\n"); + hypre_printf("\n\nERROR detected by Hypre ... BEGIN\n"); + hypre_printf("ERROR -- hypre_BiCGSTABSolve: INFs and/or NaNs detected in input.\n"); + hypre_printf("User probably placed non-numerics in supplied b.\n"); + hypre_printf("Returning error flag += 101. Program not terminated.\n"); + hypre_printf("ERROR detected by Hypre ... END\n\n\n"); } hypre_error(HYPRE_ERROR_GENERIC); HYPRE_ANNOTATE_FUNC_END; @@ -300,13 +319,13 @@ hypre_BiCGSTABSolve(void *bicgstab_vdata, return hypre_error_flag; } - res = (*(bicgstab_functions->InnerProd))(r0,r0); - r_norm = sqrt(res); + res = (*(bicgstab_functions->InnerProd))(r0, r0); + r_norm = hypre_sqrt(res); r_norm_0 = r_norm; - /* Since it is does not diminish performance, attempt to return an error flag + /* Since it does not diminish performance, attempt to return an error flag and notify users when they supply bad input. */ - if (r_norm != 0.) ieee_check = r_norm/r_norm; /* INF -> NaN conversion */ + if (r_norm != 0.) { ieee_check = r_norm / r_norm; } /* INF -> NaN conversion */ if (ieee_check != ieee_check) { /* ...INFs or NaNs in input can make ieee_check a NaN. This test @@ -316,11 +335,11 @@ hypre_BiCGSTABSolve(void *bicgstab_vdata, found at http://HTTP.CS.Berkeley.EDU/~wkahan/ieee754status/IEEE754.PDF */ if (logging > 0 || print_level > 0) { - hypre_printf("\n\nERROR detected by Hypre ... BEGIN\n"); - hypre_printf("ERROR -- hypre_BiCGSTABSolve: INFs and/or NaNs detected in input.\n"); - hypre_printf("User probably placed non-numerics in supplied A or x_0.\n"); - hypre_printf("Returning error flag += 101. Program not terminated.\n"); - hypre_printf("ERROR detected by Hypre ... END\n\n\n"); + hypre_printf("\n\nERROR detected by Hypre ... BEGIN\n"); + hypre_printf("ERROR -- hypre_BiCGSTABSolve: INFs and/or NaNs detected in input.\n"); + hypre_printf("User probably placed non-numerics in supplied A or x_0.\n"); + hypre_printf("Returning error flag += 101. Program not terminated.\n"); + hypre_printf("ERROR detected by Hypre ... END\n\n\n"); } hypre_error(HYPRE_ERROR_GENERIC); @@ -334,9 +353,11 @@ hypre_BiCGSTABSolve(void *bicgstab_vdata, norms[0] = r_norm; if (print_level > 0 && my_id == 0) { - hypre_printf("L2 norm of b: %e\n", b_norm); + hypre_printf("L2 norm of b: %e\n", b_norm); if (b_norm == 0.0) + { hypre_printf("Rel_resid_norm actually contains the residual norm\n"); + } hypre_printf("Initial L2 norm of residual: %e\n", r_norm); } } @@ -359,9 +380,13 @@ hypre_BiCGSTABSolve(void *bicgstab_vdata, if (a_tol == 0.0) /* this is for backwards compatibility (accomodating setting stop_crit to 1, but not setting a_tol) - eventually we will get rid of the stop_crit flag as with GMRES */ + { epsilon = r_tol; + } else - epsilon = a_tol; /* this means new interface fcn called */ + { + epsilon = a_tol; /* this means new interface fcn called */ + } } else /* default convergence test (stop_crit = 0)*/ @@ -373,7 +398,7 @@ hypre_BiCGSTABSolve(void *bicgstab_vdata, user also specifies a_tol or sets r_tol = 0.0, which means absolute tol only is checked */ - epsilon = hypre_max(a_tol, r_tol*den_norm); + epsilon = hypre_max(a_tol, r_tol * den_norm); } @@ -381,153 +406,171 @@ hypre_BiCGSTABSolve(void *bicgstab_vdata, if (print_level > 0 && my_id == 0) { if (b_norm > 0.0) - {hypre_printf("=============================================\n\n"); - hypre_printf("Iters resid.norm conv.rate rel.res.norm\n"); - hypre_printf("----- ------------ ---------- ------------\n"); + { + hypre_printf("=============================================\n\n"); + hypre_printf("Iters resid.norm conv.rate rel.res.norm\n"); + hypre_printf("----- ------------ ---------- ------------\n"); } else - {hypre_printf("=============================================\n\n"); - hypre_printf("Iters resid.norm conv.rate\n"); - hypre_printf("----- ------------ ----------\n"); + { + hypre_printf("=============================================\n\n"); + hypre_printf("Iters resid.norm conv.rate\n"); + hypre_printf("----- ------------ ----------\n"); } } (bicgstab_data -> num_iterations) = iter; if (b_norm > 0.0) - (bicgstab_data -> rel_residual_norm) = r_norm/b_norm; + { + (bicgstab_data -> rel_residual_norm) = r_norm / b_norm; + } /* check for convergence before starting */ if (r_norm == 0.0) { - HYPRE_ANNOTATE_FUNC_END; - return hypre_error_flag; + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; } else if (r_norm <= epsilon && iter >= min_iter) { - if (print_level > 0 && my_id == 0) - { - hypre_printf("\n\n"); - hypre_printf("Tolerance and min_iter requirements satisfied by initial data.\n"); - hypre_printf("Final L2 norm of residual: %e\n\n", r_norm); - } - (bicgstab_data -> converged) = 1; - HYPRE_ANNOTATE_FUNC_END; - - return hypre_error_flag; + if (print_level > 0 && my_id == 0) + { + hypre_printf("\n\n"); + hypre_printf("Tolerance and min_iter requirements satisfied by initial data.\n"); + hypre_printf("Final L2 norm of residual: %e\n\n", r_norm); + } + (bicgstab_data -> converged) = 1; + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; } /* Start BiCGStab iterations */ while (iter < max_iter) { - iter++; - - (*(bicgstab_functions->ClearVector))(v); - precond(precond_data, A, p, v); - (*(bicgstab_functions->Matvec))(matvec_data,1.0,A,v,0.0,q); - temp = (*(bicgstab_functions->InnerProd))(r0,q); - if (fabs(temp) >= epsmac) - alpha = res/temp; - else - { - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"BiCGSTAB broke down!! divide by near zero\n"); - HYPRE_ANNOTATE_FUNC_END; - - return hypre_error_flag; - } - (*(bicgstab_functions->Axpy))(alpha,v,x); - (*(bicgstab_functions->Axpy))(-alpha,q,r); - (*(bicgstab_functions->ClearVector))(v); - precond(precond_data, A, r, v); - (*(bicgstab_functions->Matvec))(matvec_data,1.0,A,v,0.0,s); - /* Handle case when gamma = 0.0/0.0 as 0.0 and not NAN */ - gamma_numer = (*(bicgstab_functions->InnerProd))(r,s); - gamma_denom = (*(bicgstab_functions->InnerProd))(s,s); - if ((gamma_numer == 0.0) && (gamma_denom == 0.0)) - gamma = 0.0; - else - gamma= gamma_numer/gamma_denom; - (*(bicgstab_functions->Axpy))(gamma,v,x); - (*(bicgstab_functions->Axpy))(-gamma,s,r); - /* residual is now updated, must immediately check for convergence */ - r_norm = sqrt((*(bicgstab_functions->InnerProd))(r,r)); - if (logging > 0 || print_level > 0) - { - norms[iter] = r_norm; - } - if (print_level > 0 && my_id == 0) - { - if (b_norm > 0.0) - hypre_printf("% 5d %e %f %e\n", iter, norms[iter], - norms[iter]/norms[iter-1], norms[iter]/b_norm); - else - hypre_printf("% 5d %e %f\n", iter, norms[iter], - norms[iter]/norms[iter-1]); - } - /* check for convergence, evaluate actual residual */ - if (r_norm <= epsilon && iter >= min_iter) - { - (*(bicgstab_functions->CopyVector))(b,r); - (*(bicgstab_functions->Matvec))(matvec_data,-1.0,A,x,1.0,r); - r_norm = sqrt((*(bicgstab_functions->InnerProd))(r,r)); - if (r_norm <= epsilon) - { - if (print_level > 0 && my_id == 0) - { - hypre_printf("\n\n"); - hypre_printf("Final L2 norm of residual: %e\n\n", r_norm); - } - (bicgstab_data -> converged) = 1; - break; - } - } - /*-------------------------------------------------------------------- - * Optional test to see if adequate progress is being made. - * The average convergence factor is recorded and compared - * against the tolerance 'cf_tol'. The weighting factor is - * intended to pay more attention to the test when an accurate - * estimate for average convergence factor is available. - *--------------------------------------------------------------------*/ - if (cf_tol > 0.0) - { - cf_ave_0 = cf_ave_1; - cf_ave_1 = pow( r_norm / r_norm_0, 1.0/(2.0*iter)); - - weight = fabs(cf_ave_1 - cf_ave_0); - weight = weight / hypre_max(cf_ave_1, cf_ave_0); - weight = 1.0 - weight; - if (weight * cf_ave_1 > cf_tol) break; - } - - if (fabs(res) >= epsmac) - beta = 1.0/res; - else - { - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"BiCGSTAB broke down!! res=0 \n"); - HYPRE_ANNOTATE_FUNC_END; - - return hypre_error_flag; - } - res = (*(bicgstab_functions->InnerProd))(r0,r); - beta *= res; - (*(bicgstab_functions->Axpy))(-gamma,q,p); - if (fabs(gamma) >= epsmac) - (*(bicgstab_functions->ScaleVector))((beta*alpha/gamma),p); - else - { - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"BiCGSTAB broke down!! gamma=0 \n"); - HYPRE_ANNOTATE_FUNC_END; - - return hypre_error_flag; - } - (*(bicgstab_functions->Axpy))(1.0,r,p); + iter++; + + (*(bicgstab_functions->ClearVector))(v); + precond(precond_data, A, p, v); + (*(bicgstab_functions->Matvec))(matvec_data, 1.0, A, v, 0.0, q); + temp = (*(bicgstab_functions->InnerProd))(r0, q); + if (hypre_abs(temp) >= epsmac) + { + alpha = res / temp; + } + else + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "BiCGSTAB broke down!! divide by near zero\n"); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; + } + (*(bicgstab_functions->Axpy))(alpha, v, x); + (*(bicgstab_functions->Axpy))(-alpha, q, r); + (*(bicgstab_functions->ClearVector))(v); + precond(precond_data, A, r, v); + (*(bicgstab_functions->Matvec))(matvec_data, 1.0, A, v, 0.0, s); + /* Handle case when gamma = 0.0/0.0 as 0.0 and not NAN */ + gamma_numer = (*(bicgstab_functions->InnerProd))(r, s); + gamma_denom = (*(bicgstab_functions->InnerProd))(s, s); + if ((gamma_numer == 0.0) && (gamma_denom == 0.0)) + { + gamma = 0.0; + } + else + { + gamma = gamma_numer / gamma_denom; + } + (*(bicgstab_functions->Axpy))(gamma, v, x); + (*(bicgstab_functions->Axpy))(-gamma, s, r); + /* residual is now updated, must immediately check for convergence */ + r_norm = hypre_sqrt((*(bicgstab_functions->InnerProd))(r, r)); + if (logging > 0 || print_level > 0) + { + norms[iter] = r_norm; + } + if (print_level > 0 && my_id == 0) + { + if (b_norm > 0.0) + hypre_printf("% 5d %e %f %e\n", iter, norms[iter], + norms[iter] / norms[iter - 1], norms[iter] / b_norm); + else + hypre_printf("% 5d %e %f\n", iter, norms[iter], + norms[iter] / norms[iter - 1]); + } + /* check for convergence, evaluate actual residual */ + if (r_norm <= epsilon && iter >= min_iter) + { + (*(bicgstab_functions->CopyVector))(b, r); + (*(bicgstab_functions->Matvec))(matvec_data, -1.0, A, x, 1.0, r); + r_norm = hypre_sqrt((*(bicgstab_functions->InnerProd))(r, r)); + if (r_norm <= epsilon) + { + if (print_level > 0 && my_id == 0) + { + hypre_printf("\n\n"); + hypre_printf("Final L2 norm of residual: %e\n\n", r_norm); + } + (bicgstab_data -> converged) = 1; + break; + } + } + /*-------------------------------------------------------------------- + * Optional test to see if adequate progress is being made. + * The average convergence factor is recorded and compared + * against the tolerance 'cf_tol'. The weighting factor is + * intended to pay more attention to the test when an accurate + * estimate for average convergence factor is available. + *--------------------------------------------------------------------*/ + if (cf_tol > 0.0) + { + cf_ave_0 = cf_ave_1; + cf_ave_1 = hypre_pow( r_norm / r_norm_0, 1.0 / (2.0 * iter)); + + weight = hypre_abs(cf_ave_1 - cf_ave_0); + weight = weight / hypre_max(cf_ave_1, cf_ave_0); + weight = 1.0 - weight; + if (weight * cf_ave_1 > cf_tol) { break; } + } + + if (hypre_abs(res) >= epsmac) + { + beta = 1.0 / res; + } + else + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "BiCGSTAB broke down!! res=0 \n"); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; + } + res = (*(bicgstab_functions->InnerProd))(r0, r); + beta *= res; + (*(bicgstab_functions->Axpy))(-gamma, q, p); + if (hypre_abs(gamma) >= epsmac) + { + (*(bicgstab_functions->ScaleVector))((beta * alpha / gamma), p); + } + else + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "BiCGSTAB broke down!! gamma=0 \n"); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; + } + (*(bicgstab_functions->Axpy))(1.0, r, p); } /* end while loop */ (bicgstab_data -> num_iterations) = iter; if (b_norm > 0.0) - (bicgstab_data -> rel_residual_norm) = r_norm/b_norm; + { + (bicgstab_data -> rel_residual_norm) = r_norm / b_norm; + } if (b_norm == 0.0) + { (bicgstab_data -> rel_residual_norm) = r_norm; + } - if (iter >= max_iter && r_norm > epsilon && epsilon > 0 && hybrid != -1) hypre_error(HYPRE_ERROR_CONV); + if (iter >= max_iter && r_norm > epsilon && epsilon > 0 && hybrid != -1) { hypre_error(HYPRE_ERROR_CONV); } HYPRE_ANNOTATE_FUNC_END; @@ -540,9 +583,9 @@ hypre_BiCGSTABSolve(void *bicgstab_vdata, HYPRE_Int hypre_BiCGSTABSetTol( void *bicgstab_vdata, - HYPRE_Real tol ) + HYPRE_Real tol ) { - hypre_BiCGSTABData *bicgstab_data = (hypre_BiCGSTABData *)bicgstab_vdata; + hypre_BiCGSTABData *bicgstab_data = (hypre_BiCGSTABData *)bicgstab_vdata; (bicgstab_data -> tol) = tol; @@ -554,9 +597,9 @@ hypre_BiCGSTABSetTol( void *bicgstab_vdata, HYPRE_Int hypre_BiCGSTABSetAbsoluteTol( void *bicgstab_vdata, - HYPRE_Real a_tol ) + HYPRE_Real a_tol ) { - hypre_BiCGSTABData *bicgstab_data = (hypre_BiCGSTABData *)bicgstab_vdata; + hypre_BiCGSTABData *bicgstab_data = (hypre_BiCGSTABData *)bicgstab_vdata; (bicgstab_data -> a_tol) = a_tol; @@ -569,9 +612,9 @@ hypre_BiCGSTABSetAbsoluteTol( void *bicgstab_vdata, HYPRE_Int hypre_BiCGSTABSetConvergenceFactorTol( void *bicgstab_vdata, - HYPRE_Real cf_tol ) + HYPRE_Real cf_tol ) { - hypre_BiCGSTABData *bicgstab_data = (hypre_BiCGSTABData *)bicgstab_vdata; + hypre_BiCGSTABData *bicgstab_data = (hypre_BiCGSTABData *)bicgstab_vdata; (bicgstab_data -> cf_tol) = cf_tol; @@ -584,9 +627,9 @@ hypre_BiCGSTABSetConvergenceFactorTol( void *bicgstab_vdata, HYPRE_Int hypre_BiCGSTABSetMinIter( void *bicgstab_vdata, - HYPRE_Int min_iter ) + HYPRE_Int min_iter ) { - hypre_BiCGSTABData *bicgstab_data = (hypre_BiCGSTABData *)bicgstab_vdata; + hypre_BiCGSTABData *bicgstab_data = (hypre_BiCGSTABData *)bicgstab_vdata; (bicgstab_data -> min_iter) = min_iter; @@ -599,9 +642,9 @@ hypre_BiCGSTABSetMinIter( void *bicgstab_vdata, HYPRE_Int hypre_BiCGSTABSetMaxIter( void *bicgstab_vdata, - HYPRE_Int max_iter ) + HYPRE_Int max_iter ) { - hypre_BiCGSTABData *bicgstab_data = (hypre_BiCGSTABData *)bicgstab_vdata; + hypre_BiCGSTABData *bicgstab_data = (hypre_BiCGSTABData *)bicgstab_vdata; (bicgstab_data -> max_iter) = max_iter; @@ -614,9 +657,9 @@ hypre_BiCGSTABSetMaxIter( void *bicgstab_vdata, HYPRE_Int hypre_BiCGSTABSetStopCrit( void *bicgstab_vdata, - HYPRE_Int stop_crit ) + HYPRE_Int stop_crit ) { - hypre_BiCGSTABData *bicgstab_data = (hypre_BiCGSTABData *)bicgstab_vdata; + hypre_BiCGSTABData *bicgstab_data = (hypre_BiCGSTABData *)bicgstab_vdata; (bicgstab_data -> stop_crit) = stop_crit; @@ -629,11 +672,11 @@ hypre_BiCGSTABSetStopCrit( void *bicgstab_vdata, HYPRE_Int hypre_BiCGSTABSetPrecond( void *bicgstab_vdata, - HYPRE_Int (*precond)(void*,void*,void*,void*), - HYPRE_Int (*precond_setup)(void*,void*,void*,void*), - void *precond_data ) + HYPRE_Int (*precond)(void*, void*, void*, void*), + HYPRE_Int (*precond_setup)(void*, void*, void*, void*), + void *precond_data ) { - hypre_BiCGSTABData *bicgstab_data = (hypre_BiCGSTABData *)bicgstab_vdata; + hypre_BiCGSTABData *bicgstab_data = (hypre_BiCGSTABData *)bicgstab_vdata; hypre_BiCGSTABFunctions *bicgstab_functions = bicgstab_data->functions; @@ -650,9 +693,9 @@ hypre_BiCGSTABSetPrecond( void *bicgstab_vdata, HYPRE_Int hypre_BiCGSTABGetPrecond( void *bicgstab_vdata, - HYPRE_Solver *precond_data_ptr ) + HYPRE_Solver *precond_data_ptr ) { - hypre_BiCGSTABData *bicgstab_data = (hypre_BiCGSTABData *)bicgstab_vdata; + hypre_BiCGSTABData *bicgstab_data = (hypre_BiCGSTABData *)bicgstab_vdata; *precond_data_ptr = (HYPRE_Solver)(bicgstab_data -> precond_data); @@ -665,9 +708,9 @@ hypre_BiCGSTABGetPrecond( void *bicgstab_vdata, HYPRE_Int hypre_BiCGSTABSetLogging( void *bicgstab_vdata, - HYPRE_Int logging) + HYPRE_Int logging) { - hypre_BiCGSTABData *bicgstab_data = (hypre_BiCGSTABData *)bicgstab_vdata; + hypre_BiCGSTABData *bicgstab_data = (hypre_BiCGSTABData *)bicgstab_vdata; (bicgstab_data -> logging) = logging; @@ -676,9 +719,9 @@ hypre_BiCGSTABSetLogging( void *bicgstab_vdata, HYPRE_Int hypre_BiCGSTABSetHybrid( void *bicgstab_vdata, - HYPRE_Int logging) + HYPRE_Int logging) { - hypre_BiCGSTABData *bicgstab_data = (hypre_BiCGSTABData *)bicgstab_vdata; + hypre_BiCGSTABData *bicgstab_data = (hypre_BiCGSTABData *)bicgstab_vdata; (bicgstab_data -> hybrid) = logging; @@ -691,9 +734,9 @@ hypre_BiCGSTABSetHybrid( void *bicgstab_vdata, HYPRE_Int hypre_BiCGSTABSetPrintLevel( void *bicgstab_vdata, - HYPRE_Int print_level) + HYPRE_Int print_level) { - hypre_BiCGSTABData *bicgstab_data = (hypre_BiCGSTABData *)bicgstab_vdata; + hypre_BiCGSTABData *bicgstab_data = (hypre_BiCGSTABData *)bicgstab_vdata; (bicgstab_data -> print_level) = print_level; @@ -706,9 +749,9 @@ hypre_BiCGSTABSetPrintLevel( void *bicgstab_vdata, HYPRE_Int hypre_BiCGSTABGetConverged( void *bicgstab_vdata, - HYPRE_Int *converged ) + HYPRE_Int *converged ) { - hypre_BiCGSTABData *bicgstab_data = (hypre_BiCGSTABData *)bicgstab_vdata; + hypre_BiCGSTABData *bicgstab_data = (hypre_BiCGSTABData *)bicgstab_vdata; *converged = (bicgstab_data -> converged); @@ -721,9 +764,9 @@ hypre_BiCGSTABGetConverged( void *bicgstab_vdata, HYPRE_Int hypre_BiCGSTABGetNumIterations( void *bicgstab_vdata, - HYPRE_Int *num_iterations ) + HYPRE_Int *num_iterations ) { - hypre_BiCGSTABData *bicgstab_data = (hypre_BiCGSTABData *)bicgstab_vdata; + hypre_BiCGSTABData *bicgstab_data = (hypre_BiCGSTABData *)bicgstab_vdata; *num_iterations = (bicgstab_data -> num_iterations); @@ -736,9 +779,9 @@ hypre_BiCGSTABGetNumIterations( void *bicgstab_vdata, HYPRE_Int hypre_BiCGSTABGetFinalRelativeResidualNorm( void *bicgstab_vdata, - HYPRE_Real *relative_residual_norm ) + HYPRE_Real *relative_residual_norm ) { - hypre_BiCGSTABData *bicgstab_data = (hypre_BiCGSTABData *)bicgstab_vdata; + hypre_BiCGSTABData *bicgstab_data = (hypre_BiCGSTABData *)bicgstab_vdata; *relative_residual_norm = (bicgstab_data -> rel_residual_norm); @@ -753,7 +796,7 @@ HYPRE_Int hypre_BiCGSTABGetResidual( void *bicgstab_vdata, void **residual ) { - hypre_BiCGSTABData *bicgstab_data = (hypre_BiCGSTABData *)bicgstab_vdata; + hypre_BiCGSTABData *bicgstab_data = (hypre_BiCGSTABData *)bicgstab_vdata; *residual = (bicgstab_data -> r); diff --git a/external/hypre/src/krylov/bicgstab.h b/external/hypre/src/krylov/bicgstab.h index 3b90f2bd..4b0c07ce 100644 --- a/external/hypre/src/krylov/bicgstab.h +++ b/external/hypre/src/krylov/bicgstab.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -70,20 +70,20 @@ HYPRE_Int hypre_ParKrylovMatvecT( void *matvec_data , HYPRE_Real alpha , void *A typedef struct { - void * (*CreateVector) ( void *vvector ); - HYPRE_Int (*DestroyVector) ( void *vvector ); - void * (*MatvecCreate) ( void *A , void *x ); - HYPRE_Int (*Matvec) ( void *matvec_data , HYPRE_Complex alpha , void *A , - void *x , HYPRE_Complex beta , void *y ); - HYPRE_Int (*MatvecDestroy) ( void *matvec_data ); - HYPRE_Real (*InnerProd) ( void *x , void *y ); - HYPRE_Int (*CopyVector) ( void *x , void *y ); - HYPRE_Int (*ClearVector) ( void *x ); - HYPRE_Int (*ScaleVector) ( HYPRE_Complex alpha , void *x ); - HYPRE_Int (*Axpy) ( HYPRE_Complex alpha , void *x , void *y ); - HYPRE_Int (*CommInfo) ( void *A , HYPRE_Int *my_id , HYPRE_Int *num_procs ); - HYPRE_Int (*precond_setup) (void *vdata , void *A , void *b , void *x); - HYPRE_Int (*precond) (void *vdata , void *A , void *b , void *x); + void * (*CreateVector) ( void *vvector ); + HYPRE_Int (*DestroyVector) ( void *vvector ); + void * (*MatvecCreate) ( void *A, void *x ); + HYPRE_Int (*Matvec) ( void *matvec_data, HYPRE_Complex alpha, void *A, + void *x, HYPRE_Complex beta, void *y ); + HYPRE_Int (*MatvecDestroy) ( void *matvec_data ); + HYPRE_Real (*InnerProd) ( void *x, void *y ); + HYPRE_Int (*CopyVector) ( void *x, void *y ); + HYPRE_Int (*ClearVector) ( void *x ); + HYPRE_Int (*ScaleVector) ( HYPRE_Complex alpha, void *x ); + HYPRE_Int (*Axpy) ( HYPRE_Complex alpha, void *x, void *y ); + HYPRE_Int (*CommInfo) ( void *A, HYPRE_Int *my_id, HYPRE_Int *num_procs ); + HYPRE_Int (*precond_setup) (void *vdata, void *A, void *b, void *x); + HYPRE_Int (*precond) (void *vdata, void *A, void *b, void *x); } hypre_BiCGSTABFunctions; @@ -102,7 +102,7 @@ typedef struct HYPRE_Real cf_tol; HYPRE_Real rel_residual_norm; HYPRE_Real a_tol; - + void *A; void *r; @@ -119,7 +119,7 @@ typedef struct /* log info (always logged) */ HYPRE_Int num_iterations; - + /* additional log info (logged when `logging' > 0) */ HYPRE_Int logging; HYPRE_Int print_level; @@ -149,20 +149,20 @@ hypre_BiCGSTABFunctions * hypre_BiCGSTABFunctionsCreate( void * (*CreateVector) ( void *vvector ), HYPRE_Int (*DestroyVector) ( void *vvector ), - void * (*MatvecCreate) ( void *A , void *x ), - HYPRE_Int (*Matvec) ( void *matvec_data , HYPRE_Complex alpha , void *A , - void *x , HYPRE_Complex beta , void *y ), + void * (*MatvecCreate) ( void *A, void *x ), + HYPRE_Int (*Matvec) ( void *matvec_data, HYPRE_Complex alpha, void *A, + void *x, HYPRE_Complex beta, void *y ), HYPRE_Int (*MatvecDestroy) ( void *matvec_data ), - HYPRE_Real (*InnerProd) ( void *x , void *y ), - HYPRE_Int (*CopyVector) ( void *x , void *y ), + HYPRE_Real (*InnerProd) ( void *x, void *y ), + HYPRE_Int (*CopyVector) ( void *x, void *y ), HYPRE_Int (*ClearVector) ( void *x ), - HYPRE_Int (*ScaleVector) ( HYPRE_Complex alpha , void *x ), - HYPRE_Int (*Axpy) ( HYPRE_Complex alpha , void *x , void *y ), - HYPRE_Int (*CommInfo) ( void *A , HYPRE_Int *my_id , + HYPRE_Int (*ScaleVector) ( HYPRE_Complex alpha, void *x ), + HYPRE_Int (*Axpy) ( HYPRE_Complex alpha, void *x, void *y ), + HYPRE_Int (*CommInfo) ( void *A, HYPRE_Int *my_id, HYPRE_Int *num_procs ), HYPRE_Int (*PrecondSetup) (void *vdata, void *A, void *b, void *x ), HYPRE_Int (*Precond) ( void *vdata, void *A, void *b, void *x ) - ); +); /** * Description... diff --git a/external/hypre/src/krylov/cgnr.c b/external/hypre/src/krylov/cgnr.c index d88920c5..5fa53ffb 100644 --- a/external/hypre/src/krylov/cgnr.c +++ b/external/hypre/src/krylov/cgnr.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -38,11 +38,11 @@ hypre_CGNRFunctionsCreate( HYPRE_Int (*PrecondSetup) ( void *vdata, void *A, void *b, void *x ), HYPRE_Int (*Precond) ( void *vdata, void *A, void *b, void *x ), HYPRE_Int (*PrecondT) ( void *vdata, void *A, void *b, void *x ) - ) +) { hypre_CGNRFunctions * cgnr_functions; cgnr_functions = (hypre_CGNRFunctions *) - hypre_CTAlloc( hypre_CGNRFunctions, 1 , HYPRE_MEMORY_HOST); + hypre_CTAlloc( hypre_CGNRFunctions, 1, HYPRE_MEMORY_HOST); cgnr_functions->CommInfo = CommInfo; cgnr_functions->CreateVector = CreateVector; @@ -56,10 +56,10 @@ hypre_CGNRFunctionsCreate( cgnr_functions->ClearVector = ClearVector; cgnr_functions->ScaleVector = ScaleVector; cgnr_functions->Axpy = Axpy; -/* default preconditioner must be set here but can be changed later... */ + /* default preconditioner must be set here but can be changed later... */ cgnr_functions->precond_setup = PrecondSetup; cgnr_functions->precond = Precond; - cgnr_functions->precondT = Precond; + cgnr_functions->precondT = PrecondT; return cgnr_functions; } @@ -127,7 +127,7 @@ hypre_CGNRDestroy( void *cgnr_vdata ) HYPRE_ANNOTATE_FUNC_END; - return(ierr); + return (ierr); } /*-------------------------------------------------------------------------- @@ -218,17 +218,17 @@ hypre_CGNRSolve(void *cgnr_vdata, HYPRE_Int ierr = 0; HYPRE_Int my_id, num_procs; HYPRE_Int x_not_set = 1; - /* char *log_file_name; */ + /* char *log_file_name; */ HYPRE_ANNOTATE_FUNC_BEGIN; /*----------------------------------------------------------------------- * Start cgnr solve *-----------------------------------------------------------------------*/ - (*(cgnr_functions->CommInfo))(A,&my_id,&num_procs); + (*(cgnr_functions->CommInfo))(A, &my_id, &num_procs); if (logging > 1 && my_id == 0) { -/* not used yet log_file_name = (cgnr_data -> log_file_name); */ + /* not used yet log_file_name = (cgnr_data -> log_file_name); */ hypre_printf("Iters ||r||_2 conv.rate ||r||_2/||b||_2\n"); hypre_printf("----- ------------ --------- ------------ \n"); } @@ -237,9 +237,9 @@ hypre_CGNRSolve(void *cgnr_vdata, /* compute eps */ bi_prod = (*(cgnr_functions->InnerProd))(b, b); - /* Since it is does not diminish performance, attempt to return an error flag + /* Since it does not diminish performance, attempt to return an error flag and notify users when they supply bad input. */ - if (bi_prod != 0.) ieee_check = bi_prod/bi_prod; /* INF -> NaN conversion */ + if (bi_prod != 0.) { ieee_check = bi_prod / bi_prod; } /* INF -> NaN conversion */ if (ieee_check != ieee_check) { /* ...INFs or NaNs in input can make ieee_check a NaN. This test @@ -249,11 +249,11 @@ hypre_CGNRSolve(void *cgnr_vdata, found at http://HTTP.CS.Berkeley.EDU/~wkahan/ieee754status/IEEE754.PDF */ if (logging > 0) { - hypre_printf("\n\nERROR detected by Hypre ... BEGIN\n"); - hypre_printf("ERROR -- hypre_CGNRSolve: INFs and/or NaNs detected in input.\n"); - hypre_printf("User probably placed non-numerics in supplied b.\n"); - hypre_printf("Returning error flag += 101. Program not terminated.\n"); - hypre_printf("ERROR detected by Hypre ... END\n\n\n"); + hypre_printf("\n\nERROR detected by Hypre ... BEGIN\n"); + hypre_printf("ERROR -- hypre_CGNRSolve: INFs and/or NaNs detected in input.\n"); + hypre_printf("User probably placed non-numerics in supplied b.\n"); + hypre_printf("Returning error flag += 101. Program not terminated.\n"); + hypre_printf("ERROR detected by Hypre ... END\n\n\n"); } ierr += 101; HYPRE_ANNOTATE_FUNC_END; @@ -262,9 +262,13 @@ hypre_CGNRSolve(void *cgnr_vdata, } if (stop_crit) - eps = tol*tol; /* absolute residual norm */ + { + eps = tol * tol; /* absolute residual norm */ + } else - eps = (tol*tol)*bi_prod; /* relative residual norm */ + { + eps = (tol * tol) * bi_prod; /* relative residual norm */ + } /* Check to see if the rhs vector b is zero */ if (bi_prod == 0.0) @@ -288,11 +292,11 @@ hypre_CGNRSolve(void *cgnr_vdata, /* Set initial residual norm */ if (logging > 0) { - norms[0] = sqrt((*(cgnr_functions->InnerProd))(r,r)); + norms[0] = hypre_sqrt((*(cgnr_functions->InnerProd))(r, r)); - /* Since it is does not diminish performance, attempt to return an error flag + /* Since it does not diminish performance, attempt to return an error flag and notify users when they supply bad input. */ - if (norms[0] != 0.) ieee_check = norms[0]/norms[0]; /* INF -> NaN conversion */ + if (norms[0] != 0.) { ieee_check = norms[0] / norms[0]; } /* INF -> NaN conversion */ if (ieee_check != ieee_check) { /* ...INFs or NaNs in input can make ieee_check a NaN. This test @@ -302,11 +306,11 @@ hypre_CGNRSolve(void *cgnr_vdata, found at http://HTTP.CS.Berkeley.EDU/~wkahan/ieee754status/IEEE754.PDF */ if (logging > 0) { - hypre_printf("\n\nERROR detected by Hypre ... BEGIN\n"); - hypre_printf("ERROR -- hypre_CGNRSolve: INFs and/or NaNs detected in input.\n"); - hypre_printf("User probably placed non-numerics in supplied A or x_0.\n"); - hypre_printf("Returning error flag += 101. Program not terminated.\n"); - hypre_printf("ERROR detected by Hypre ... END\n\n\n"); + hypre_printf("\n\nERROR detected by Hypre ... BEGIN\n"); + hypre_printf("ERROR -- hypre_CGNRSolve: INFs and/or NaNs detected in input.\n"); + hypre_printf("User probably placed non-numerics in supplied A or x_0.\n"); + hypre_printf("Returning error flag += 101. Program not terminated.\n"); + hypre_printf("ERROR detected by Hypre ... END\n\n\n"); } ierr += 101; HYPRE_ANNOTATE_FUNC_END; @@ -324,11 +328,11 @@ hypre_CGNRSolve(void *cgnr_vdata, (*(cgnr_functions->CopyVector))(r, p); /* gamma = */ - gamma = (*(cgnr_functions->InnerProd))(t,t); + gamma = (*(cgnr_functions->InnerProd))(t, t); - /* Since it is does not diminish performance, attempt to return an error flag + /* Since it does not diminish performance, attempt to return an error flag and notify users when they supply bad input. */ - if (gamma != 0.) ieee_check = gamma/gamma; /* INF -> NaN conversion */ + if (gamma != 0.) { ieee_check = gamma / gamma; } /* INF -> NaN conversion */ if (ieee_check != ieee_check) { /* ...INFs or NaNs in input can make ieee_check a NaN. This test @@ -338,11 +342,11 @@ hypre_CGNRSolve(void *cgnr_vdata, found at http://HTTP.CS.Berkeley.EDU/~wkahan/ieee754status/IEEE754.PDF */ if (logging > 0) { - hypre_printf("\n\nERROR detected by Hypre ... BEGIN\n"); - hypre_printf("ERROR -- hypre_CGNRSolve: INFs and/or NaNs detected in input.\n"); - hypre_printf("User probably placed non-numerics in supplied A or x_0.\n"); - hypre_printf("Returning error flag += 101. Program not terminated.\n"); - hypre_printf("ERROR detected by Hypre ... END\n\n\n"); + hypre_printf("\n\nERROR detected by Hypre ... BEGIN\n"); + hypre_printf("ERROR -- hypre_CGNRSolve: INFs and/or NaNs detected in input.\n"); + hypre_printf("User probably placed non-numerics in supplied A or x_0.\n"); + hypre_printf("Returning error flag += 101. Program not terminated.\n"); + hypre_printf("ERROR detected by Hypre ... END\n\n\n"); } ierr += 101; HYPRE_ANNOTATE_FUNC_END; @@ -350,7 +354,7 @@ hypre_CGNRSolve(void *cgnr_vdata, return ierr; } - while ((i+1) <= max_iter) + while ((i + 1) <= max_iter) { i++; @@ -379,16 +383,16 @@ hypre_CGNRSolve(void *cgnr_vdata, gamma = (*(cgnr_functions->InnerProd))(t, t); /* set i_prod for convergence test */ - i_prod = (*(cgnr_functions->InnerProd))(r,r); + i_prod = (*(cgnr_functions->InnerProd))(r, r); /* log norm info */ if (logging > 0) { - norms[i] = sqrt(i_prod); + norms[i] = hypre_sqrt(i_prod); if (logging > 1 && my_id == 0) { - hypre_printf("% 5d %e %f %e\n", i, norms[i], norms[i]/ - norms[i-1], norms[i]/bi_prod); + hypre_printf("% 5d %e %f %e\n", i, norms[i], norms[i] / + norms[i - 1], norms[i] / bi_prod); } } @@ -403,12 +407,12 @@ hypre_CGNRSolve(void *cgnr_vdata, /* r = b - Aq */ (*(cgnr_functions->CopyVector))(b, r); (*(cgnr_functions->Matvec))(matvec_data, -1.0, A, q, 1.0, r); - i_prod = (*(cgnr_functions->InnerProd))(r,r); + i_prod = (*(cgnr_functions->InnerProd))(r, r); if (i_prod < eps) { - (*(cgnr_functions->CopyVector))(q,x); - x_not_set = 0; - break; + (*(cgnr_functions->CopyVector))(q, x); + x_not_set = 0; + break; } } @@ -420,12 +424,12 @@ hypre_CGNRSolve(void *cgnr_vdata, (*(cgnr_functions->Axpy))(1.0, t, p); } - /*----------------------------------------------------------------- - * Generate solution x = Cx - *-----------------------------------------------------------------*/ + /*----------------------------------------------------------------- + * Generate solution x = Cx + *-----------------------------------------------------------------*/ if (x_not_set) { - (*(cgnr_functions->CopyVector))(x,q); + (*(cgnr_functions->CopyVector))(x, q); (*(cgnr_functions->ClearVector))(x); precond(precond_data, A, q, x); } @@ -434,7 +438,7 @@ hypre_CGNRSolve(void *cgnr_vdata, * Print log *-----------------------------------------------------------------------*/ - bi_prod = sqrt(bi_prod); + bi_prod = hypre_sqrt(bi_prod); if (logging > 1 && my_id == 0) { @@ -442,7 +446,7 @@ hypre_CGNRSolve(void *cgnr_vdata, } (cgnr_data -> num_iterations) = i; - (cgnr_data -> rel_residual_norm) = norms[i]/bi_prod; + (cgnr_data -> rel_residual_norm) = norms[i] / bi_prod; HYPRE_ANNOTATE_FUNC_END; @@ -471,7 +475,7 @@ hypre_CGNRSetTol(void *cgnr_vdata, HYPRE_Int hypre_CGNRSetMinIter( void *cgnr_vdata, - HYPRE_Int min_iter ) + HYPRE_Int min_iter ) { hypre_CGNRData *cgnr_data = (hypre_CGNRData *)cgnr_vdata; HYPRE_Int ierr = 0; @@ -487,7 +491,7 @@ hypre_CGNRSetMinIter( void *cgnr_vdata, HYPRE_Int hypre_CGNRSetMaxIter( void *cgnr_vdata, - HYPRE_Int max_iter ) + HYPRE_Int max_iter ) { hypre_CGNRData *cgnr_data = (hypre_CGNRData *)cgnr_vdata; HYPRE_Int ierr = 0; @@ -503,7 +507,7 @@ hypre_CGNRSetMaxIter( void *cgnr_vdata, HYPRE_Int hypre_CGNRSetStopCrit( void *cgnr_vdata, - HYPRE_Int stop_crit ) + HYPRE_Int stop_crit ) { hypre_CGNRData *cgnr_data = (hypre_CGNRData *)cgnr_vdata; HYPRE_Int ierr = 0; @@ -558,7 +562,7 @@ hypre_CGNRGetPrecond( void *cgnr_vdata, HYPRE_Int hypre_CGNRSetLogging( void *cgnr_vdata, - HYPRE_Int logging) + HYPRE_Int logging) { hypre_CGNRData *cgnr_data = (hypre_CGNRData *)cgnr_vdata; HYPRE_Int ierr = 0; @@ -574,7 +578,7 @@ hypre_CGNRSetLogging( void *cgnr_vdata, HYPRE_Int hypre_CGNRGetNumIterations( void *cgnr_vdata, - HYPRE_Int *num_iterations ) + HYPRE_Int *num_iterations ) { hypre_CGNRData *cgnr_data = (hypre_CGNRData *)cgnr_vdata; HYPRE_Int ierr = 0; @@ -591,7 +595,7 @@ hypre_CGNRGetNumIterations( void *cgnr_vdata, HYPRE_Int hypre_CGNRGetFinalRelativeResidualNorm( void *cgnr_vdata, - HYPRE_Real *relative_residual_norm ) + HYPRE_Real *relative_residual_norm ) { hypre_CGNRData *cgnr_data = (hypre_CGNRData *)cgnr_vdata; HYPRE_Int ierr = 0; diff --git a/external/hypre/src/krylov/cgnr.h b/external/hypre/src/krylov/cgnr.h index 9f28dbc3..a7c124e3 100644 --- a/external/hypre/src/krylov/cgnr.h +++ b/external/hypre/src/krylov/cgnr.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -138,7 +138,7 @@ hypre_CGNRFunctionsCreate( HYPRE_Int (*PrecondSetup) ( void *vdata, void *A, void *b, void *x ), HYPRE_Int (*Precond) ( void *vdata, void *A, void *b, void *x ), HYPRE_Int (*PrecondT) ( void *vdata, void *A, void *b, void *x ) - ); +); /** * Description... diff --git a/external/hypre/src/krylov/cogmres.c b/external/hypre/src/krylov/cogmres.c index 72fc6366..f4b12316 100644 --- a/external/hypre/src/krylov/cogmres.c +++ b/external/hypre/src/krylov/cogmres.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -33,19 +33,21 @@ hypre_COGMRESFunctionsCreate( HYPRE_Int (*MatvecDestroy) ( void *matvec_data ), HYPRE_Real (*InnerProd) ( void *x, void *y ), HYPRE_Int (*MassInnerProd) (void *x, void **y, HYPRE_Int k, HYPRE_Int unroll, void *result), - HYPRE_Int (*MassDotpTwo) (void *x, void *y, void **z, HYPRE_Int k, HYPRE_Int unroll, void *result_x, void *result_y), + HYPRE_Int (*MassDotpTwo) (void *x, void *y, void **z, HYPRE_Int k, HYPRE_Int unroll, + void *result_x, void *result_y), HYPRE_Int (*CopyVector) ( void *x, void *y ), HYPRE_Int (*ClearVector) ( void *x ), HYPRE_Int (*ScaleVector) ( HYPRE_Complex alpha, void *x ), HYPRE_Int (*Axpy) ( HYPRE_Complex alpha, void *x, void *y ), - HYPRE_Int (*MassAxpy) ( HYPRE_Complex *alpha, void **x, void *y, HYPRE_Int k, HYPRE_Int unroll), + HYPRE_Int (*MassAxpy) ( HYPRE_Complex *alpha, void **x, void *y, HYPRE_Int k, + HYPRE_Int unroll), HYPRE_Int (*PrecondSetup) ( void *vdata, void *A, void *b, void *x ), HYPRE_Int (*Precond) ( void *vdata, void *A, void *b, void *x ) - ) +) { hypre_COGMRESFunctions * cogmres_functions; cogmres_functions = (hypre_COGMRESFunctions *) - CAlloc( 1, sizeof(hypre_COGMRESFunctions), HYPRE_MEMORY_HOST ); + CAlloc( 1, sizeof(hypre_COGMRESFunctions), HYPRE_MEMORY_HOST ); cogmres_functions->CAlloc = CAlloc; cogmres_functions->Free = Free; @@ -127,29 +129,41 @@ hypre_COGMRESDestroy( void *cogmres_vdata ) if (cogmres_data) { hypre_COGMRESFunctions *cogmres_functions = cogmres_data->functions; - if ( (cogmres_data->logging>0) || (cogmres_data->print_level) > 0 ) + if ( (cogmres_data->logging > 0) || (cogmres_data->print_level) > 0 ) { if ( (cogmres_data -> norms) != NULL ) - hypre_TFreeF( cogmres_data -> norms, cogmres_functions ); + { + hypre_TFreeF( cogmres_data -> norms, cogmres_functions ); + } } if ( (cogmres_data -> matvec_data) != NULL ) + { (*(cogmres_functions->MatvecDestroy))(cogmres_data -> matvec_data); + } if ( (cogmres_data -> r) != NULL ) + { (*(cogmres_functions->DestroyVector))(cogmres_data -> r); + } if ( (cogmres_data -> w) != NULL ) + { (*(cogmres_functions->DestroyVector))(cogmres_data -> w); + } if ( (cogmres_data -> w_2) != NULL ) + { (*(cogmres_functions->DestroyVector))(cogmres_data -> w_2); + } if ( (cogmres_data -> p) != NULL ) { - for (i = 0; i < (cogmres_data -> k_dim+1); i++) + for (i = 0; i < (cogmres_data -> k_dim + 1); i++) { if ( (cogmres_data -> p)[i] != NULL ) - (*(cogmres_functions->DestroyVector))( (cogmres_data -> p) [i]); + { + (*(cogmres_functions->DestroyVector))( (cogmres_data -> p) [i]); + } } hypre_TFreeF( cogmres_data->p, cogmres_functions ); } @@ -189,7 +203,7 @@ hypre_COGMRESSetup( void *cogmres_vdata, HYPRE_Int k_dim = (cogmres_data -> k_dim); HYPRE_Int max_iter = (cogmres_data -> max_iter); - HYPRE_Int (*precond_setup)(void*,void*,void*,void*) = (cogmres_functions->precond_setup); + HYPRE_Int (*precond_setup)(void*, void*, void*, void*) = (cogmres_functions->precond_setup); void *precond_data = (cogmres_data -> precond_data); HYPRE_Int rel_change = (cogmres_data -> rel_change); @@ -204,21 +218,31 @@ hypre_COGMRESSetup( void *cogmres_vdata, *--------------------------------------------------*/ if ((cogmres_data -> p) == NULL) - (cogmres_data -> p) = (void**)(*(cogmres_functions->CreateVectorArray))(k_dim+1,x); + { + (cogmres_data -> p) = (void**)(*(cogmres_functions->CreateVectorArray))(k_dim + 1, x); + } if ((cogmres_data -> r) == NULL) + { (cogmres_data -> r) = (*(cogmres_functions->CreateVector))(b); + } if ((cogmres_data -> w) == NULL) + { (cogmres_data -> w) = (*(cogmres_functions->CreateVector))(b); + } if (rel_change) { if ((cogmres_data -> w_2) == NULL) + { (cogmres_data -> w_2) = (*(cogmres_functions->CreateVector))(b); + } } if ((cogmres_data -> matvec_data) == NULL) + { (cogmres_data -> matvec_data) = (*(cogmres_functions->MatvecCreate))(A, x); + } precond_setup(precond_data, A, b, x); @@ -226,15 +250,20 @@ hypre_COGMRESSetup( void *cogmres_vdata, * Allocate space for log info *-----------------------------------------------------*/ - if ( (cogmres_data->logging)>0 || (cogmres_data->print_level) > 0 ) + if ( (cogmres_data->logging) > 0 || (cogmres_data->print_level) > 0 ) { if ((cogmres_data -> norms) == NULL) - (cogmres_data -> norms) = hypre_CTAllocF(HYPRE_Real, max_iter + 1,cogmres_functions, HYPRE_MEMORY_HOST); + { + (cogmres_data -> norms) = hypre_CTAllocF(HYPRE_Real, max_iter + 1, cogmres_functions, + HYPRE_MEMORY_HOST); + } } if ( (cogmres_data->print_level) > 0 ) { if ((cogmres_data -> log_file_name) == NULL) + { (cogmres_data -> log_file_name) = (char*)"cogmres.out.log"; + } } HYPRE_ANNOTATE_FUNC_END; @@ -273,21 +302,21 @@ hypre_COGMRESSolve(void *cogmres_vdata, void **p = (cogmres_data -> p); - HYPRE_Int (*precond)(void*,void*,void*,void*) = (cogmres_functions -> precond); + HYPRE_Int (*precond)(void*, void*, void*, void*) = (cogmres_functions -> precond); HYPRE_Int *precond_data = (HYPRE_Int*)(cogmres_data -> precond_data); HYPRE_Int print_level = (cogmres_data -> print_level); HYPRE_Int logging = (cogmres_data -> logging); HYPRE_Real *norms = (cogmres_data -> norms); - /* not used yet char *log_file_name = (cogmres_data -> log_file_name);*/ - /* FILE *fp; */ + /* not used yet char *log_file_name = (cogmres_data -> log_file_name);*/ + /* FILE *fp; */ HYPRE_Int break_value = 0; HYPRE_Int i, j, k; - /*KS: rv is the norm history */ - HYPRE_Real *rs, *hh, *uu, *c, *s, *rs_2, *rv; - //, *tmp; + /*KS: rv is the norm history */ + HYPRE_Real *rs, *hh, *uu, *c, *s, *rs_2 = NULL, *rv; + //, *tmp; HYPRE_Int iter; HYPRE_Int my_id, num_procs; HYPRE_Real epsilon, gamma, t, r_norm, b_norm, den_norm, x_norm; @@ -319,34 +348,34 @@ hypre_COGMRESSolve(void *cogmres_vdata, *-----------------------------------------------------------------------*/ guard_zero_residual = 0.0; - (*(cogmres_functions->CommInfo))(A,&my_id,&num_procs); - if ( logging>0 || print_level>0 ) + (*(cogmres_functions->CommInfo))(A, &my_id, &num_procs); + if ( logging > 0 || print_level > 0 ) { norms = (cogmres_data -> norms); } /* initialize work arrays */ - rs = hypre_CTAllocF(HYPRE_Real,k_dim+1,cogmres_functions, HYPRE_MEMORY_HOST); - c = hypre_CTAllocF(HYPRE_Real,k_dim,cogmres_functions, HYPRE_MEMORY_HOST); - s = hypre_CTAllocF(HYPRE_Real,k_dim,cogmres_functions, HYPRE_MEMORY_HOST); - if (rel_change) rs_2 = hypre_CTAllocF(HYPRE_Real,k_dim+1,cogmres_functions, HYPRE_MEMORY_HOST); + rs = hypre_CTAllocF(HYPRE_Real, k_dim + 1, cogmres_functions, HYPRE_MEMORY_HOST); + c = hypre_CTAllocF(HYPRE_Real, k_dim, cogmres_functions, HYPRE_MEMORY_HOST); + s = hypre_CTAllocF(HYPRE_Real, k_dim, cogmres_functions, HYPRE_MEMORY_HOST); + if (rel_change) { rs_2 = hypre_CTAllocF(HYPRE_Real, k_dim + 1, cogmres_functions, HYPRE_MEMORY_HOST); } - rv = hypre_CTAllocF(HYPRE_Real, k_dim+1, cogmres_functions, HYPRE_MEMORY_HOST); + rv = hypre_CTAllocF(HYPRE_Real, k_dim + 1, cogmres_functions, HYPRE_MEMORY_HOST); - hh = hypre_CTAllocF(HYPRE_Real, (k_dim+1)*k_dim, cogmres_functions, HYPRE_MEMORY_HOST); - uu = hypre_CTAllocF(HYPRE_Real, (k_dim+1)*k_dim, cogmres_functions, HYPRE_MEMORY_HOST); + hh = hypre_CTAllocF(HYPRE_Real, (k_dim + 1) * k_dim, cogmres_functions, HYPRE_MEMORY_HOST); + uu = hypre_CTAllocF(HYPRE_Real, (k_dim + 1) * k_dim, cogmres_functions, HYPRE_MEMORY_HOST); - (*(cogmres_functions->CopyVector))(b,p[0]); + (*(cogmres_functions->CopyVector))(b, p[0]); /* compute initial residual */ - (*(cogmres_functions->Matvec))(matvec_data,-1.0, A, x, 1.0, p[0]); + (*(cogmres_functions->Matvec))(matvec_data, -1.0, A, x, 1.0, p[0]); - b_norm = sqrt((*(cogmres_functions->InnerProd))(b,b)); + b_norm = hypre_sqrt((*(cogmres_functions->InnerProd))(b, b)); real_r_norm_old = b_norm; - /* Since it is does not diminish performance, attempt to return an error flag + /* Since it does not diminish performance, attempt to return an error flag and notify users when they supply bad input. */ - if (b_norm != 0.) ieee_check = b_norm/b_norm; /* INF -> NaN conversion */ + if (b_norm != 0.) { ieee_check = b_norm / b_norm; } /* INF -> NaN conversion */ if (ieee_check != ieee_check) { /* ...INFs or NaNs in input can make ieee_check a NaN. This test @@ -368,12 +397,12 @@ hypre_COGMRESSolve(void *cogmres_vdata, return hypre_error_flag; } - r_norm = sqrt((*(cogmres_functions->InnerProd))(p[0],p[0])); + r_norm = hypre_sqrt((*(cogmres_functions->InnerProd))(p[0], p[0])); r_norm_0 = r_norm; - /* Since it is does not diminish performance, attempt to return an error flag + /* Since it does not diminish performance, attempt to return an error flag and notify users when they supply bad input. */ - if (r_norm != 0.) ieee_check = r_norm/r_norm; /* INF -> NaN conversion */ + if (r_norm != 0.) { ieee_check = r_norm / r_norm; } /* INF -> NaN conversion */ if (ieee_check != ieee_check) { /* ...INFs or NaNs in input can make ieee_check a NaN. This test @@ -395,14 +424,16 @@ hypre_COGMRESSolve(void *cogmres_vdata, return hypre_error_flag; } - if ( logging>0 || print_level > 0) + if ( logging > 0 || print_level > 0) { norms[0] = r_norm; - if ( print_level>1 && my_id == 0 ) + if ( print_level > 1 && my_id == 0 ) { hypre_printf("L2 norm of b: %e\n", b_norm); if (b_norm == 0.0) + { hypre_printf("Rel_resid_norm actually contains the residual norm\n"); + } hypre_printf("Initial L2 norm of residual: %e\n", r_norm); } } @@ -425,11 +456,11 @@ hypre_COGMRESSolve(void *cogmres_vdata, user specifies a_tol, or sets r_tol = 0.0, which means absolute tol only is checked */ - epsilon = hypre_max(a_tol,r_tol*den_norm); + epsilon = hypre_max(a_tol, r_tol * den_norm); /* so now our stop criteria is |r_i| <= epsilon */ - if ( print_level>1 && my_id == 0 ) + if ( print_level > 1 && my_id == 0 ) { if (b_norm > 0.0) { @@ -456,13 +487,13 @@ hypre_COGMRESSolve(void *cogmres_vdata, rs[0] = r_norm; if (r_norm == 0.0) { - hypre_TFreeF(c,cogmres_functions); - hypre_TFreeF(s,cogmres_functions); - hypre_TFreeF(rs,cogmres_functions); - hypre_TFreeF(rv,cogmres_functions); - if (rel_change) hypre_TFreeF(rs_2,cogmres_functions); - hypre_TFreeF(hh,cogmres_functions); - hypre_TFreeF(uu,cogmres_functions); + hypre_TFreeF(c, cogmres_functions); + hypre_TFreeF(s, cogmres_functions); + hypre_TFreeF(rs, cogmres_functions); + hypre_TFreeF(rv, cogmres_functions); + if (rel_change) { hypre_TFreeF(rs_2, cogmres_functions); } + hypre_TFreeF(hh, cogmres_functions); + hypre_TFreeF(uu, cogmres_functions); HYPRE_ANNOTATE_FUNC_END; return hypre_error_flag; @@ -476,120 +507,130 @@ hypre_COGMRESSolve(void *cogmres_vdata, if (!rel_change) /* shouldn't exit after no iterations if * relative change is on*/ { - (*(cogmres_functions->CopyVector))(b,r); - (*(cogmres_functions->Matvec))(matvec_data,-1.0,A,x,1.0,r); - r_norm = sqrt((*(cogmres_functions->InnerProd))(r,r)); + (*(cogmres_functions->CopyVector))(b, r); + (*(cogmres_functions->Matvec))(matvec_data, -1.0, A, x, 1.0, r); + r_norm = hypre_sqrt((*(cogmres_functions->InnerProd))(r, r)); if (r_norm <= epsilon) { - if ( print_level>1 && my_id == 0) + if ( print_level > 1 && my_id == 0) { hypre_printf("\n\n"); hypre_printf("Final L2 norm of residual: %e\n\n", r_norm); } break; } - else if ( print_level>0 && my_id == 0) + else if ( print_level > 0 && my_id == 0) + { hypre_printf("false convergence 1\n"); + } } } t = 1.0 / r_norm; - (*(cogmres_functions->ScaleVector))(t,p[0]); + (*(cogmres_functions->ScaleVector))(t, p[0]); i = 0; /***RESTART CYCLE (right-preconditioning) ***/ while (i < k_dim && iter < max_iter) { i++; iter++; - itmp = (i-1)*(k_dim+1); + itmp = (i - 1) * (k_dim + 1); (*(cogmres_functions->ClearVector))(r); - precond(precond_data, A, p[i-1], r); + precond(precond_data, A, p[i - 1], r); (*(cogmres_functions->Matvec))(matvec_data, 1.0, A, r, 0.0, p[i]); - for (j=0; j 1) { - (*(cogmres_functions->MassDotpTwo))((void *) p[i], p[i-1], p, i, unroll, &hh[itmp], &uu[itmp]); - for (j=0; jMassDotpTwo))((void *) p[i], p[i - 1], p, i, unroll, &hh[itmp], &uu[itmp]); + for (j = 0; j < i - 1; j++) { uu[j * (k_dim + 1) + i - 1] = uu[itmp + j]; } + for (j = 0; j < i; j++) { rv[j] = hh[itmp + j]; } + for (k = 0; k < i; k++) { - for (j=0; j < i; j++) + for (j = 0; j < i; j++) { - hh[itmp+j] -= (uu[k*(k_dim+1)+j]*rv[j]); + hh[itmp + j] -= (uu[k * (k_dim + 1) + j] * rv[j]); } } - for (j=0; jMassInnerProd))((void *) p[i], p, i, unroll, &hh[itmp]); - for (j=0; jMassAxpy))(&hh[itmp],p,p[i], i, unroll); - for (j=0; jInnerProd))(p[i],p[i]) ); - hh[itmp+i] = t; + (*(cogmres_functions->MassAxpy))(&hh[itmp], p, p[i], i, unroll); + for (j = 0; j < i; j++) + { + hh[itmp + j] = -hh[itmp + j]; + } + t = hypre_sqrt( (*(cogmres_functions->InnerProd))(p[i], p[i]) ); + hh[itmp + i] = t; - if (hh[itmp+i] != 0.0) + if (hh[itmp + i] != 0.0) { - t = 1.0/t; - (*(cogmres_functions->ScaleVector))(t,p[i]); + t = 1.0 / t; + (*(cogmres_functions->ScaleVector))(t, p[i]); } for (j = 1; j < i; j++) { - t = hh[itmp+j-1]; - hh[itmp+j-1] = s[j-1]*hh[itmp+j] + c[j-1]*t; - hh[itmp+j] = -s[j-1]*t + c[j-1]*hh[itmp+j]; + t = hh[itmp + j - 1]; + hh[itmp + j - 1] = s[j - 1] * hh[itmp + j] + c[j - 1] * t; + hh[itmp + j] = -s[j - 1] * t + c[j - 1] * hh[itmp + j]; } - t= hh[itmp+i]*hh[itmp+i]; - t+= hh[itmp+i-1]*hh[itmp+i-1]; - gamma = sqrt(t); - if (gamma == 0.0) gamma = epsmac; - c[i-1] = hh[itmp+i-1]/gamma; - s[i-1] = hh[itmp+i]/gamma; - rs[i] = -hh[itmp+i]*rs[i-1]; + t = hh[itmp + i] * hh[itmp + i]; + t += hh[itmp + i - 1] * hh[itmp + i - 1]; + gamma = hypre_sqrt(t); + if (gamma == 0.0) { gamma = epsmac; } + c[i - 1] = hh[itmp + i - 1] / gamma; + s[i - 1] = hh[itmp + i] / gamma; + rs[i] = -hh[itmp + i] * rs[i - 1]; rs[i] /= gamma; - rs[i-1] = c[i-1]*rs[i-1]; + rs[i - 1] = c[i - 1] * rs[i - 1]; // determine residual norm - hh[itmp+i-1] = s[i-1]*hh[itmp+i] + c[i-1]*hh[itmp+i-1]; - r_norm = fabs(rs[i]); - if ( print_level>0 ) + hh[itmp + i - 1] = s[i - 1] * hh[itmp + i] + c[i - 1] * hh[itmp + i - 1]; + r_norm = hypre_abs(rs[i]); + if ( print_level > 0 ) { norms[iter] = r_norm; - if ( print_level>1 && my_id == 0 ) + if ( print_level > 1 && my_id == 0 ) { if (b_norm > 0.0) hypre_printf("% 5d %e %f %e\n", iter, - norms[iter],norms[iter]/norms[iter-1], - norms[iter]/b_norm); + norms[iter], norms[iter] / norms[iter - 1], + norms[iter] / b_norm); else hypre_printf("% 5d %e %f\n", iter, norms[iter], - norms[iter]/norms[iter-1]); + norms[iter] / norms[iter - 1]); } } /*convergence factor tolerance */ if (cf_tol > 0.0) { cf_ave_0 = cf_ave_1; - cf_ave_1 = pow( r_norm / r_norm_0, 1.0/(2.0*iter)); + cf_ave_1 = hypre_pow( r_norm / r_norm_0, 1.0 / (2.0 * iter)); - weight = fabs(cf_ave_1 - cf_ave_0); + weight = hypre_abs(cf_ave_1 - cf_ave_0); weight = weight / hypre_max(cf_ave_1, cf_ave_0); weight = 1.0 - weight; #if 0 - hypre_printf("I = %d: cf_new = %e, cf_old = %e, weight = %e\n", - i, cf_ave_1, cf_ave_0, weight ); + hypre_printf("I = %d: cf_new = %e, cf_old = %e, weight = %e\n", + i, cf_ave_1, cf_ave_0, weight ); #endif if (weight * cf_ave_1 > cf_tol) { @@ -613,42 +654,47 @@ hypre_COGMRESSolve(void *cogmres_vdata, and check the relative change outside the cycle. Here we will check the relative here as we don't want to exit the restart cycle prematurely */ - for (k=0; k= 0; k--) + rs_2[i - 1] = rs_2[i - 1] / hh[itmp + i - 1]; + for (k = i - 2; k >= 0; k--) { t = 0.0; - for (j = k+1; j < i; j++) + for (j = k + 1; j < i; j++) { - t -= hh[j*(k_dim+1)+k]*rs_2[j]; + t -= hh[j * (k_dim + 1) + k] * rs_2[j]; } - t+= rs_2[k]; - rs_2[k] = t/hh[k*(k_dim+1)+k]; + t += rs_2[k]; + rs_2[k] = t / hh[k * (k_dim + 1) + k]; } - (*(cogmres_functions->CopyVector))(p[i-1],w); - (*(cogmres_functions->ScaleVector))(rs_2[i-1],w); - for (j = i-2; j >=0; j--) + (*(cogmres_functions->CopyVector))(p[i - 1], w); + (*(cogmres_functions->ScaleVector))(rs_2[i - 1], w); + for (j = i - 2; j >= 0; j--) + { (*(cogmres_functions->Axpy))(rs_2[j], p[j], w); + } (*(cogmres_functions->ClearVector))(r); /* find correction (in r) */ precond(precond_data, A, w, r); /* copy current solution (x) to w (don't want to over-write x)*/ - (*(cogmres_functions->CopyVector))(x,w); + (*(cogmres_functions->CopyVector))(x, w); /* add the correction */ - (*(cogmres_functions->Axpy))(1.0,r,w); + (*(cogmres_functions->Axpy))(1.0, r, w); /* now w is the approx solution - get the norm*/ - x_norm = sqrt( (*(cogmres_functions->InnerProd))(w,w) ); + x_norm = hypre_sqrt( (*(cogmres_functions->InnerProd))(w, w) ); if ( !(x_norm <= guard_zero_residual )) /* don't divide by zero */ - { /* now get x_i - x_i-1 */ + { + /* now get x_i - x_i-1 */ if (num_rel_change_check) { /* have already checked once so we can avoid another precond. @@ -667,15 +713,15 @@ hypre_COGMRESSolve(void *cogmres_vdata, (*(cogmres_functions->CopyVector))(w, w_2); (*(cogmres_functions->ClearVector))(w); - (*(cogmres_functions->Axpy))(rs_2[i-1], p[i-1], w); + (*(cogmres_functions->Axpy))(rs_2[i - 1], p[i - 1], w); (*(cogmres_functions->ClearVector))(r); /* apply the preconditioner */ precond(precond_data, A, w, r); /* now r contains x_i - x_i-1 */ } /* find the norm of x_i - x_i-1 */ - w_norm = sqrt( (*(cogmres_functions->InnerProd))(r,r) ); - relative_error = w_norm/x_norm; + w_norm = hypre_sqrt( (*(cogmres_functions->InnerProd))(r, r) ); + relative_error = w_norm / x_norm; if (relative_error <= r_tol) { rel_change_passed = 1; @@ -697,31 +743,33 @@ hypre_COGMRESSolve(void *cogmres_vdata, } /*** end of restart cycle ***/ /* now compute solution, first solve upper triangular system */ - if (break_value) break; + if (break_value) { break; } - rs[i-1] = rs[i-1]/hh[itmp+i-1]; - for (k = i-2; k >= 0; k--) + rs[i - 1] = rs[i - 1] / hh[itmp + i - 1]; + for (k = i - 2; k >= 0; k--) { t = 0.0; - for (j = k+1; j < i; j++) + for (j = k + 1; j < i; j++) { - t -= hh[j*(k_dim+1)+k]*rs[j]; + t -= hh[j * (k_dim + 1) + k] * rs[j]; } - t+= rs[k]; - rs[k] = t/hh[k*(k_dim+1)+k]; + t += rs[k]; + rs[k] = t / hh[k * (k_dim + 1) + k]; } - (*(cogmres_functions->CopyVector))(p[i-1],w); - (*(cogmres_functions->ScaleVector))(rs[i-1],w); - for (j = i-2; j >=0; j--) + (*(cogmres_functions->CopyVector))(p[i - 1], w); + (*(cogmres_functions->ScaleVector))(rs[i - 1], w); + for (j = i - 2; j >= 0; j--) + { (*(cogmres_functions->Axpy))(rs[j], p[j], w); + } (*(cogmres_functions->ClearVector))(r); /* find correction (in r) */ precond(precond_data, A, w, r); /* update current solution x (in x) */ - (*(cogmres_functions->Axpy))(1.0,r,x); + (*(cogmres_functions->Axpy))(1.0, r, x); /* check for convergence by evaluating the actual residual */ @@ -734,32 +782,32 @@ hypre_COGMRESSolve(void *cogmres_vdata, } /* calculate actual residual norm*/ - (*(cogmres_functions->CopyVector))(b,r); - (*(cogmres_functions->Matvec))(matvec_data,-1.0,A,x,1.0,r); - real_r_norm_new = r_norm = sqrt( (*(cogmres_functions->InnerProd))(r,r) ); + (*(cogmres_functions->CopyVector))(b, r); + (*(cogmres_functions->Matvec))(matvec_data, -1.0, A, x, 1.0, r); + real_r_norm_new = r_norm = hypre_sqrt( (*(cogmres_functions->InnerProd))(r, r) ); if (r_norm <= epsilon) { if (rel_change && !rel_change_passed) /* calculate the relative change */ { /* calculate the norm of the solution */ - x_norm = sqrt( (*(cogmres_functions->InnerProd))(x,x) ); + x_norm = hypre_sqrt( (*(cogmres_functions->InnerProd))(x, x) ); if ( !(x_norm <= guard_zero_residual )) - /* don't divide by zero */ + /* don't divide by zero */ { (*(cogmres_functions->ClearVector))(w); - (*(cogmres_functions->Axpy))(rs[i-1], p[i-1], w); + (*(cogmres_functions->Axpy))(rs[i - 1], p[i - 1], w); (*(cogmres_functions->ClearVector))(r); /* apply the preconditioner */ precond(precond_data, A, w, r); /* find the norm of x_i - x_i-1 */ - w_norm = sqrt( (*(cogmres_functions->InnerProd))(r,r) ); - relative_error= w_norm/x_norm; + w_norm = hypre_sqrt( (*(cogmres_functions->InnerProd))(r, r) ); + relative_error = w_norm / x_norm; if ( relative_error < r_tol ) { (cogmres_data -> converged) = 1; - if ( print_level>1 && my_id == 0 ) + if ( print_level > 1 && my_id == 0 ) { hypre_printf("\n\n"); hypre_printf("Final L2 norm of residual: %e\n\n", r_norm); @@ -770,7 +818,7 @@ hypre_COGMRESSolve(void *cogmres_vdata, else { (cogmres_data -> converged) = 1; - if ( print_level>1 && my_id == 0 ) + if ( print_level > 1 && my_id == 0 ) { hypre_printf("\n\n"); hypre_printf("Final L2 norm of residual: %e\n\n", r_norm); @@ -780,7 +828,7 @@ hypre_COGMRESSolve(void *cogmres_vdata, } else /* don't need to check rel. change */ { - if ( print_level>1 && my_id == 0 ) + if ( print_level > 1 && my_id == 0 ) { hypre_printf("\n\n"); hypre_printf("Final L2 norm of residual: %e\n\n", r_norm); @@ -803,29 +851,33 @@ hypre_COGMRESSolve(void *cogmres_vdata, break; } /* report discrepancy between real/COGMRES residuals and restart */ - if ( print_level>0 && my_id == 0) + if ( print_level > 0 && my_id == 0) + { hypre_printf("false convergence 2, L2 norm of residual: %e\n", r_norm); - (*(cogmres_functions->CopyVector))(r,p[0]); + } + (*(cogmres_functions->CopyVector))(r, p[0]); i = 0; real_r_norm_old = real_r_norm_new; } } /* end of convergence check */ /* compute residual vector and continue loop */ - for (j=i ; j > 0; j--) + for (j = i ; j > 0; j--) { - rs[j-1] = -s[j-1]*rs[j]; - rs[j] = c[j-1]*rs[j]; + rs[j - 1] = -s[j - 1] * rs[j]; + rs[j] = c[j - 1] * rs[j]; } - if (i) (*(cogmres_functions->Axpy))(rs[i]-1.0,p[i],p[i]); - for (j=i-1 ; j > 0; j--) - (*(cogmres_functions->Axpy))(rs[j],p[j],p[i]); + if (i) { (*(cogmres_functions->Axpy))(rs[i] - 1.0, p[i], p[i]); } + for (j = i - 1 ; j > 0; j--) + { + (*(cogmres_functions->Axpy))(rs[j], p[j], p[i]); + } if (i) { - (*(cogmres_functions->Axpy))(rs[0]-1.0,p[0],p[0]); - (*(cogmres_functions->Axpy))(1.0,p[i],p[0]); + (*(cogmres_functions->Axpy))(rs[0] - 1.0, p[0], p[0]); + (*(cogmres_functions->Axpy))(1.0, p[i], p[0]); } } /* END of iteration while loop */ @@ -833,25 +885,29 @@ hypre_COGMRESSolve(void *cogmres_vdata, (cogmres_data -> num_iterations) = iter; if (b_norm > 0.0) - (cogmres_data -> rel_residual_norm) = r_norm/b_norm; + { + (cogmres_data -> rel_residual_norm) = r_norm / b_norm; + } if (b_norm == 0.0) + { (cogmres_data -> rel_residual_norm) = r_norm; + } - if (iter >= max_iter && r_norm > epsilon && epsilon > 0) hypre_error(HYPRE_ERROR_CONV); + if (iter >= max_iter && r_norm > epsilon && epsilon > 0) { hypre_error(HYPRE_ERROR_CONV); } - hypre_TFreeF(c,cogmres_functions); - hypre_TFreeF(s,cogmres_functions); - hypre_TFreeF(rs,cogmres_functions); - hypre_TFreeF(rv,cogmres_functions); - if (rel_change) hypre_TFreeF(rs_2,cogmres_functions); + hypre_TFreeF(c, cogmres_functions); + hypre_TFreeF(s, cogmres_functions); + hypre_TFreeF(rs, cogmres_functions); + hypre_TFreeF(rv, cogmres_functions); + if (rel_change) { hypre_TFreeF(rs_2, cogmres_functions); } /*for (i=0; i < k_dim+1; i++) { hypre_TFreeF(hh[i],cogmres_functions); hypre_TFreeF(uu[i],cogmres_functions); }*/ - hypre_TFreeF(hh,cogmres_functions); - hypre_TFreeF(uu,cogmres_functions); + hypre_TFreeF(hh, cogmres_functions); + hypre_TFreeF(uu, cogmres_functions); HYPRE_ANNOTATE_FUNC_END; @@ -864,16 +920,16 @@ hypre_COGMRESSolve(void *cogmres_vdata, HYPRE_Int hypre_COGMRESSetKDim( void *cogmres_vdata, - HYPRE_Int k_dim ) + HYPRE_Int k_dim ) { - hypre_COGMRESData *cogmres_data =(hypre_COGMRESData *) cogmres_vdata; + hypre_COGMRESData *cogmres_data = (hypre_COGMRESData *) cogmres_vdata; (cogmres_data -> k_dim) = k_dim; return hypre_error_flag; } HYPRE_Int hypre_COGMRESGetKDim( void *cogmres_vdata, - HYPRE_Int * k_dim ) + HYPRE_Int * k_dim ) { hypre_COGMRESData *cogmres_data = (hypre_COGMRESData *)cogmres_vdata; *k_dim = (cogmres_data -> k_dim); @@ -886,16 +942,16 @@ hypre_COGMRESGetKDim( void *cogmres_vdata, HYPRE_Int hypre_COGMRESSetUnroll( void *cogmres_vdata, - HYPRE_Int unroll ) + HYPRE_Int unroll ) { - hypre_COGMRESData *cogmres_data =(hypre_COGMRESData *) cogmres_vdata; + hypre_COGMRESData *cogmres_data = (hypre_COGMRESData *) cogmres_vdata; (cogmres_data -> unroll) = unroll; return hypre_error_flag; } HYPRE_Int hypre_COGMRESGetUnroll( void *cogmres_vdata, - HYPRE_Int * unroll ) + HYPRE_Int * unroll ) { hypre_COGMRESData *cogmres_data = (hypre_COGMRESData *)cogmres_vdata; *unroll = (cogmres_data -> unroll); @@ -908,16 +964,16 @@ hypre_COGMRESGetUnroll( void *cogmres_vdata, HYPRE_Int hypre_COGMRESSetCGS( void *cogmres_vdata, - HYPRE_Int cgs ) + HYPRE_Int cgs ) { - hypre_COGMRESData *cogmres_data =(hypre_COGMRESData *) cogmres_vdata; + hypre_COGMRESData *cogmres_data = (hypre_COGMRESData *) cogmres_vdata; (cogmres_data -> cgs) = cgs; return hypre_error_flag; } HYPRE_Int hypre_COGMRESGetCGS( void *cogmres_vdata, - HYPRE_Int * cgs ) + HYPRE_Int * cgs ) { hypre_COGMRESData *cogmres_data = (hypre_COGMRESData *)cogmres_vdata; *cgs = (cogmres_data -> cgs); @@ -930,7 +986,7 @@ hypre_COGMRESGetCGS( void *cogmres_vdata, HYPRE_Int hypre_COGMRESSetTol( void *cogmres_vdata, - HYPRE_Real tol ) + HYPRE_Real tol ) { hypre_COGMRESData *cogmres_data = (hypre_COGMRESData *)cogmres_vdata; (cogmres_data -> tol) = tol; @@ -939,7 +995,7 @@ hypre_COGMRESSetTol( void *cogmres_vdata, HYPRE_Int hypre_COGMRESGetTol( void *cogmres_vdata, - HYPRE_Real * tol ) + HYPRE_Real * tol ) { hypre_COGMRESData *cogmres_data = (hypre_COGMRESData *)cogmres_vdata; *tol = (cogmres_data -> tol); @@ -951,7 +1007,7 @@ hypre_COGMRESGetTol( void *cogmres_vdata, HYPRE_Int hypre_COGMRESSetAbsoluteTol( void *cogmres_vdata, - HYPRE_Real a_tol ) + HYPRE_Real a_tol ) { hypre_COGMRESData *cogmres_data = (hypre_COGMRESData *)cogmres_vdata; (cogmres_data -> a_tol) = a_tol; @@ -960,7 +1016,7 @@ hypre_COGMRESSetAbsoluteTol( void *cogmres_vdata, HYPRE_Int hypre_COGMRESGetAbsoluteTol( void *cogmres_vdata, - HYPRE_Real * a_tol ) + HYPRE_Real * a_tol ) { hypre_COGMRESData *cogmres_data = (hypre_COGMRESData *)cogmres_vdata; *a_tol = (cogmres_data -> a_tol); @@ -972,7 +1028,7 @@ hypre_COGMRESGetAbsoluteTol( void *cogmres_vdata, HYPRE_Int hypre_COGMRESSetConvergenceFactorTol( void *cogmres_vdata, - HYPRE_Real cf_tol ) + HYPRE_Real cf_tol ) { hypre_COGMRESData *cogmres_data = (hypre_COGMRESData *)cogmres_vdata; (cogmres_data -> cf_tol) = cf_tol; @@ -981,7 +1037,7 @@ hypre_COGMRESSetConvergenceFactorTol( void *cogmres_vdata, HYPRE_Int hypre_COGMRESGetConvergenceFactorTol( void *cogmres_vdata, - HYPRE_Real * cf_tol ) + HYPRE_Real * cf_tol ) { hypre_COGMRESData *cogmres_data = (hypre_COGMRESData *)cogmres_vdata; *cf_tol = (cogmres_data -> cf_tol); @@ -994,7 +1050,7 @@ hypre_COGMRESGetConvergenceFactorTol( void *cogmres_vdata, HYPRE_Int hypre_COGMRESSetMinIter( void *cogmres_vdata, - HYPRE_Int min_iter ) + HYPRE_Int min_iter ) { hypre_COGMRESData *cogmres_data = (hypre_COGMRESData *)cogmres_vdata; (cogmres_data -> min_iter) = min_iter; @@ -1003,7 +1059,7 @@ hypre_COGMRESSetMinIter( void *cogmres_vdata, HYPRE_Int hypre_COGMRESGetMinIter( void *cogmres_vdata, - HYPRE_Int * min_iter ) + HYPRE_Int * min_iter ) { hypre_COGMRESData *cogmres_data = (hypre_COGMRESData *)cogmres_vdata; *min_iter = (cogmres_data -> min_iter); @@ -1016,7 +1072,7 @@ hypre_COGMRESGetMinIter( void *cogmres_vdata, HYPRE_Int hypre_COGMRESSetMaxIter( void *cogmres_vdata, - HYPRE_Int max_iter ) + HYPRE_Int max_iter ) { hypre_COGMRESData *cogmres_data = (hypre_COGMRESData *)cogmres_vdata; (cogmres_data -> max_iter) = max_iter; @@ -1025,7 +1081,7 @@ hypre_COGMRESSetMaxIter( void *cogmres_vdata, HYPRE_Int hypre_COGMRESGetMaxIter( void *cogmres_vdata, - HYPRE_Int * max_iter ) + HYPRE_Int * max_iter ) { hypre_COGMRESData *cogmres_data = (hypre_COGMRESData *)cogmres_vdata; *max_iter = (cogmres_data -> max_iter); @@ -1038,7 +1094,7 @@ hypre_COGMRESGetMaxIter( void *cogmres_vdata, HYPRE_Int hypre_COGMRESSetRelChange( void *cogmres_vdata, - HYPRE_Int rel_change ) + HYPRE_Int rel_change ) { hypre_COGMRESData *cogmres_data = (hypre_COGMRESData *)cogmres_vdata; (cogmres_data -> rel_change) = rel_change; @@ -1047,7 +1103,7 @@ hypre_COGMRESSetRelChange( void *cogmres_vdata, HYPRE_Int hypre_COGMRESGetRelChange( void *cogmres_vdata, - HYPRE_Int * rel_change ) + HYPRE_Int * rel_change ) { hypre_COGMRESData *cogmres_data = (hypre_COGMRESData *)cogmres_vdata; *rel_change = (cogmres_data -> rel_change); @@ -1060,7 +1116,7 @@ hypre_COGMRESGetRelChange( void *cogmres_vdata, HYPRE_Int hypre_COGMRESSetSkipRealResidualCheck( void *cogmres_vdata, - HYPRE_Int skip_real_r_check ) + HYPRE_Int skip_real_r_check ) { hypre_COGMRESData *cogmres_data = (hypre_COGMRESData *)cogmres_vdata; (cogmres_data -> skip_real_r_check) = skip_real_r_check; @@ -1069,7 +1125,7 @@ hypre_COGMRESSetSkipRealResidualCheck( void *cogmres_vdata, HYPRE_Int hypre_COGMRESGetSkipRealResidualCheck( void *cogmres_vdata, - HYPRE_Int *skip_real_r_check) + HYPRE_Int *skip_real_r_check) { hypre_COGMRESData *cogmres_data = (hypre_COGMRESData *)cogmres_vdata; *skip_real_r_check = (cogmres_data -> skip_real_r_check); @@ -1082,9 +1138,9 @@ hypre_COGMRESGetSkipRealResidualCheck( void *cogmres_vdata, HYPRE_Int hypre_COGMRESSetPrecond( void *cogmres_vdata, - HYPRE_Int (*precond)(void*,void*,void*,void*), - HYPRE_Int (*precond_setup)(void*,void*,void*,void*), - void *precond_data ) + HYPRE_Int (*precond)(void*, void*, void*, void*), + HYPRE_Int (*precond_setup)(void*, void*, void*, void*), + void *precond_data ) { hypre_COGMRESData *cogmres_data = (hypre_COGMRESData *)cogmres_vdata; hypre_COGMRESFunctions *cogmres_functions = cogmres_data->functions; @@ -1100,7 +1156,7 @@ hypre_COGMRESSetPrecond( void *cogmres_vdata, HYPRE_Int hypre_COGMRESGetPrecond( void *cogmres_vdata, - HYPRE_Solver *precond_data_ptr ) + HYPRE_Solver *precond_data_ptr ) { hypre_COGMRESData *cogmres_data = (hypre_COGMRESData *)cogmres_vdata; *precond_data_ptr = (HYPRE_Solver)(cogmres_data -> precond_data); @@ -1113,7 +1169,7 @@ hypre_COGMRESGetPrecond( void *cogmres_vdata, HYPRE_Int hypre_COGMRESSetPrintLevel( void *cogmres_vdata, - HYPRE_Int level) + HYPRE_Int level) { hypre_COGMRESData *cogmres_data = (hypre_COGMRESData *)cogmres_vdata; (cogmres_data -> print_level) = level; @@ -1122,7 +1178,7 @@ hypre_COGMRESSetPrintLevel( void *cogmres_vdata, HYPRE_Int hypre_COGMRESGetPrintLevel( void *cogmres_vdata, - HYPRE_Int * level) + HYPRE_Int * level) { hypre_COGMRESData *cogmres_data = (hypre_COGMRESData *)cogmres_vdata; *level = (cogmres_data -> print_level); @@ -1135,7 +1191,7 @@ hypre_COGMRESGetPrintLevel( void *cogmres_vdata, HYPRE_Int hypre_COGMRESSetLogging( void *cogmres_vdata, - HYPRE_Int level) + HYPRE_Int level) { hypre_COGMRESData *cogmres_data = (hypre_COGMRESData *)cogmres_vdata; (cogmres_data -> logging) = level; @@ -1144,7 +1200,7 @@ hypre_COGMRESSetLogging( void *cogmres_vdata, HYPRE_Int hypre_COGMRESGetLogging( void *cogmres_vdata, - HYPRE_Int * level) + HYPRE_Int * level) { hypre_COGMRESData *cogmres_data = (hypre_COGMRESData *)cogmres_vdata; *level = (cogmres_data -> logging); @@ -1157,7 +1213,7 @@ hypre_COGMRESGetLogging( void *cogmres_vdata, HYPRE_Int hypre_COGMRESGetNumIterations( void *cogmres_vdata, - HYPRE_Int *num_iterations ) + HYPRE_Int *num_iterations ) { hypre_COGMRESData *cogmres_data = (hypre_COGMRESData *)cogmres_vdata; *num_iterations = (cogmres_data -> num_iterations); @@ -1170,7 +1226,7 @@ hypre_COGMRESGetNumIterations( void *cogmres_vdata, HYPRE_Int hypre_COGMRESGetConverged( void *cogmres_vdata, - HYPRE_Int *converged ) + HYPRE_Int *converged ) { hypre_COGMRESData *cogmres_data = (hypre_COGMRESData *)cogmres_vdata; *converged = (cogmres_data -> converged); @@ -1183,7 +1239,7 @@ hypre_COGMRESGetConverged( void *cogmres_vdata, HYPRE_Int hypre_COGMRESGetFinalRelativeResidualNorm( void *cogmres_vdata, - HYPRE_Real *relative_residual_norm ) + HYPRE_Real *relative_residual_norm ) { hypre_COGMRESData *cogmres_data = (hypre_COGMRESData *)cogmres_vdata; *relative_residual_norm = (cogmres_data -> rel_residual_norm); @@ -1193,7 +1249,7 @@ hypre_COGMRESGetFinalRelativeResidualNorm( void *cogmres_vdata, HYPRE_Int hypre_COGMRESSetModifyPC(void *cogmres_vdata, - HYPRE_Int (*modify_pc)(void *precond_data, HYPRE_Int iteration, HYPRE_Real rel_residual_norm)) + HYPRE_Int (*modify_pc)(void *precond_data, HYPRE_Int iteration, HYPRE_Real rel_residual_norm)) { hypre_COGMRESData *cogmres_data = (hypre_COGMRESData *)cogmres_vdata; hypre_COGMRESFunctions *cogmres_functions = cogmres_data->functions; diff --git a/external/hypre/src/krylov/cogmres.h b/external/hypre/src/krylov/cogmres.h index 4f561814..d939379b 100644 --- a/external/hypre/src/krylov/cogmres.h +++ b/external/hypre/src/krylov/cogmres.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -59,16 +59,18 @@ typedef struct HYPRE_Int (*MatvecDestroy) ( void *matvec_data ); HYPRE_Real (*InnerProd) ( void *x, void *y ); HYPRE_Int (*MassInnerProd) ( void *x, void **p, HYPRE_Int k, HYPRE_int unroll, void *result); - HYPRE_Int (*MassDotpTwo)( void *x, void *y, void **p, HYPRE_Int k, void *result_x, HYPRE_int unroll, void *result_y); + HYPRE_Int (*MassDotpTwo)( void *x, void *y, void **p, HYPRE_Int k, void *result_x, + HYPRE_int unroll, void *result_y); HYPRE_Int (*CopyVector) ( void *x, void *y ); HYPRE_Int (*ClearVector) ( void *x ); HYPRE_Int (*ScaleVector) ( HYPRE_Complex alpha, void *x ); HYPRE_Int (*Axpy) ( HYPRE_Complex alpha, void *x, void *y ); - HYPRE_Int (*MassAxpy) ( HYPRE_Complex *alpha, void **x, void *y, HYPRE_Int k, HYPRE_Int unroll); + HYPRE_Int (*MassAxpy) ( HYPRE_Complex *alpha, void **x, void *y, HYPRE_Int k, + HYPRE_Int unroll); HYPRE_Int (*precond) (); HYPRE_Int (*precond_setup) (); - HYPRE_Int (*modify_pc)(void *precond_data, HYPRE_Int iteration, HYPRE_Real rel_residual_norm ); + HYPRE_Int (*modify_pc)(void *precond_data, HYPRE_Int iteration, HYPRE_Real rel_residual_norm ); } hypre_COGMRESFunctions; @@ -104,7 +106,7 @@ typedef struct /* log info (always logged) */ HYPRE_Int num_iterations; - + HYPRE_Int print_level; /* printing when print_level>0 */ HYPRE_Int logging; /* extra computations for logging when logging>0 */ HYPRE_Real *norms; @@ -144,15 +146,17 @@ hypre_COGMRESFunctionsCreate( HYPRE_Int (*MatvecDestroy) ( void *matvec_data ), HYPRE_Real (*InnerProd) ( void *x, void *y ), HYPRE_Int (*MassInnerProd) ( void *x, void **p, HYPRE_Int k, HYPRE_Int unroll, void *result), - HYPRE_Int (*MassDotpTwo) ( void *x, void *y, void **p, HYPRE_Int k, HYPRE_Int unroll, void *result_x, void *result_y), + HYPRE_Int (*MassDotpTwo) ( void *x, void *y, void **p, HYPRE_Int k, HYPRE_Int unroll, + void *result_x, void *result_y), HYPRE_Int (*CopyVector) ( void *x, void *y ), HYPRE_Int (*ClearVector) ( void *x ), HYPRE_Int (*ScaleVector) ( HYPRE_Complex alpha, void *x ), HYPRE_Int (*Axpy) ( HYPRE_Complex alpha, void *x, void *y ), - HYPRE_Int (*MassAxpy) ( HYPRE_Complex *alpha, void **x, void *y, HYPRE_Int k, HYPRE_Int unroll), + HYPRE_Int (*MassAxpy) ( HYPRE_Complex *alpha, void **x, void *y, HYPRE_Int k, + HYPRE_Int unroll), HYPRE_Int (*PrecondSetup) ( void *vdata, void *A, void *b, void *x ), HYPRE_Int (*Precond) ( void *vdata, void *A, void *b, void *x ) - ); +); /** * Description... diff --git a/external/hypre/src/krylov/flexgmres.c b/external/hypre/src/krylov/flexgmres.c index 505e527d..b8bad83c 100644 --- a/external/hypre/src/krylov/flexgmres.c +++ b/external/hypre/src/krylov/flexgmres.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -38,11 +38,11 @@ hypre_FlexGMRESFunctionsCreate( HYPRE_Int (*Axpy) ( HYPRE_Complex alpha, void *x, void *y ), HYPRE_Int (*PrecondSetup) ( void *vdata, void *A, void *b, void *x ), HYPRE_Int (*Precond) ( void *vdata, void *A, void *b, void *x ) - ) +) { hypre_FlexGMRESFunctions * fgmres_functions; fgmres_functions = (hypre_FlexGMRESFunctions *) - CAlloc( 1, sizeof(hypre_FlexGMRESFunctions), HYPRE_MEMORY_HOST ); + CAlloc( 1, sizeof(hypre_FlexGMRESFunctions), HYPRE_MEMORY_HOST ); fgmres_functions->CAlloc = CAlloc; fgmres_functions->Free = Free; @@ -58,7 +58,7 @@ hypre_FlexGMRESFunctionsCreate( fgmres_functions->ClearVector = ClearVector; fgmres_functions->ScaleVector = ScaleVector; fgmres_functions->Axpy = Axpy; -/* default preconditioner must be set here but can be changed later... */ + /* default preconditioner must be set here but can be changed later... */ fgmres_functions->precond_setup = PrecondSetup; fgmres_functions->precond = Precond; @@ -122,28 +122,40 @@ hypre_FlexGMRESDestroy( void *fgmres_vdata ) if (fgmres_data) { hypre_FlexGMRESFunctions *fgmres_functions = fgmres_data->functions; - if ( (fgmres_data->logging>0) || (fgmres_data->print_level) > 0 ) + if ( (fgmres_data->logging > 0) || (fgmres_data->print_level) > 0 ) { if ( (fgmres_data -> norms) != NULL ) + { hypre_TFreeF( fgmres_data -> norms, fgmres_functions ); + } } if ( (fgmres_data -> matvec_data) != NULL ) + { (*(fgmres_functions->MatvecDestroy))(fgmres_data -> matvec_data); + } if ( (fgmres_data -> r) != NULL ) + { (*(fgmres_functions->DestroyVector))(fgmres_data -> r); + } if ( (fgmres_data -> w) != NULL ) + { (*(fgmres_functions->DestroyVector))(fgmres_data -> w); + } if ( (fgmres_data -> w_2) != NULL ) + { (*(fgmres_functions->DestroyVector))(fgmres_data -> w_2); + } if ( (fgmres_data -> p) != NULL ) { - for (i = 0; i < (fgmres_data -> k_dim+1); i++) + for (i = 0; i < (fgmres_data -> k_dim + 1); i++) { if ( (fgmres_data -> p)[i] != NULL ) - (*(fgmres_functions->DestroyVector))( (fgmres_data -> p) [i]); + { + (*(fgmres_functions->DestroyVector))( (fgmres_data -> p) [i]); + } } hypre_TFreeF( fgmres_data->p, fgmres_functions ); } @@ -154,7 +166,9 @@ hypre_FlexGMRESDestroy( void *fgmres_vdata ) for (i = 0; i < (fgmres_data -> k_dim + 1); i++) { if ( (fgmres_data -> pre_vecs)[i] != NULL ) - (*(fgmres_functions->DestroyVector))( (fgmres_data -> pre_vecs) [i]); + { + (*(fgmres_functions->DestroyVector))( (fgmres_data -> pre_vecs) [i]); + } } hypre_TFreeF( fgmres_data->pre_vecs, fgmres_functions ); } @@ -187,16 +201,16 @@ HYPRE_Int hypre_FlexGMRESGetResidual( void *fgmres_vdata, void **residual ) HYPRE_Int hypre_FlexGMRESSetup( void *fgmres_vdata, - void *A, - void *b, - void *x ) + void *A, + void *b, + void *x ) { hypre_FlexGMRESData *fgmres_data = (hypre_FlexGMRESData *)fgmres_vdata; hypre_FlexGMRESFunctions *fgmres_functions = fgmres_data->functions; HYPRE_Int k_dim = (fgmres_data -> k_dim); HYPRE_Int max_iter = (fgmres_data -> max_iter); - HYPRE_Int (*precond_setup)(void*,void*,void*,void*) = (fgmres_functions->precond_setup); + HYPRE_Int (*precond_setup)(void*, void*, void*, void*) = (fgmres_functions->precond_setup); void *precond_data = (fgmres_data -> precond_data); HYPRE_Int rel_change = (fgmres_data -> rel_change); @@ -212,24 +226,34 @@ hypre_FlexGMRESSetup( void *fgmres_vdata, *--------------------------------------------------*/ if ((fgmres_data -> p) == NULL) - (fgmres_data -> p) = (void**)(*(fgmres_functions->CreateVectorArray))(k_dim+1,x); + { + (fgmres_data -> p) = (void**)(*(fgmres_functions->CreateVectorArray))(k_dim + 1, x); + } if ((fgmres_data -> r) == NULL) + { (fgmres_data -> r) = (*(fgmres_functions->CreateVector))(b); + } if ((fgmres_data -> w) == NULL) + { (fgmres_data -> w) = (*(fgmres_functions->CreateVector))(b); + } if (rel_change) { if ((fgmres_data -> w_2) == NULL) + { (fgmres_data -> w_2) = (*(fgmres_functions->CreateVector))(b); + } } /* fgmres mod */ - (fgmres_data -> pre_vecs) = (void**)(*(fgmres_functions->CreateVectorArray))(k_dim+1,x); + (fgmres_data -> pre_vecs) = (void**)(*(fgmres_functions->CreateVectorArray))(k_dim + 1, x); /*---*/ if ((fgmres_data -> matvec_data) == NULL) + { (fgmres_data -> matvec_data) = (*(fgmres_functions->MatvecCreate))(A, x); + } precond_setup(precond_data, A, b, x); @@ -237,14 +261,20 @@ hypre_FlexGMRESSetup( void *fgmres_vdata, * Allocate space for log info *-----------------------------------------------------*/ - if ( (fgmres_data->logging)>0 || (fgmres_data->print_level) > 0 ) + if ( (fgmres_data->logging) > 0 || (fgmres_data->print_level) > 0 ) { if ((fgmres_data -> norms) == NULL) - (fgmres_data -> norms) = hypre_CTAllocF(HYPRE_Real, max_iter + 1,fgmres_functions, HYPRE_MEMORY_HOST); + { + (fgmres_data -> norms) = hypre_CTAllocF(HYPRE_Real, max_iter + 1, fgmres_functions, + HYPRE_MEMORY_HOST); + } } - if ( (fgmres_data->print_level) > 0 ) { + if ( (fgmres_data->print_level) > 0 ) + { if ((fgmres_data -> log_file_name) == NULL) - (fgmres_data -> log_file_name) = (char*)"fgmres.out.log"; + { + (fgmres_data -> log_file_name) = (char*)"fgmres.out.log"; + } } HYPRE_ANNOTATE_FUNC_END; @@ -264,11 +294,11 @@ hypre_FlexGMRESSolve(void *fgmres_vdata, { hypre_FlexGMRESData *fgmres_data = (hypre_FlexGMRESData *)fgmres_vdata; hypre_FlexGMRESFunctions *fgmres_functions = fgmres_data->functions; - HYPRE_Int k_dim = (fgmres_data -> k_dim); + HYPRE_Int k_dim = (fgmres_data -> k_dim); HYPRE_Int min_iter = (fgmres_data -> min_iter); - HYPRE_Int max_iter = (fgmres_data -> max_iter); - HYPRE_Real r_tol = (fgmres_data -> tol); - HYPRE_Real cf_tol = (fgmres_data -> cf_tol); + HYPRE_Int max_iter = (fgmres_data -> max_iter); + HYPRE_Real r_tol = (fgmres_data -> tol); + HYPRE_Real cf_tol = (fgmres_data -> cf_tol); HYPRE_Real a_tol = (fgmres_data -> a_tol); void *matvec_data = (fgmres_data -> matvec_data); @@ -281,8 +311,8 @@ hypre_FlexGMRESSolve(void *fgmres_vdata, void **pre_vecs = (fgmres_data ->pre_vecs); /*---*/ - HYPRE_Int (*precond)(void*,void*,void*,void*) = (fgmres_functions -> precond); - HYPRE_Int *precond_data = (HYPRE_Int*)(fgmres_data -> precond_data); + HYPRE_Int (*precond)(void*, void*, void*, void*) = (fgmres_functions -> precond); + HYPRE_Int *precond_data = (HYPRE_Int*)(fgmres_data -> precond_data); HYPRE_Int print_level = (fgmres_data -> print_level); HYPRE_Int logging = (fgmres_data -> logging); @@ -290,7 +320,7 @@ hypre_FlexGMRESSolve(void *fgmres_vdata, HYPRE_Real *norms = (fgmres_data -> norms); HYPRE_Int break_value = 0; - HYPRE_Int i, j, k; + HYPRE_Int i, j, k; HYPRE_Real *rs, **hh, *c, *s; HYPRE_Int iter; HYPRE_Int my_id, num_procs; @@ -304,7 +334,7 @@ hypre_FlexGMRESSolve(void *fgmres_vdata, HYPRE_Real weight; HYPRE_Real r_norm_0; - HYPRE_Int (*modify_pc)(void*,HYPRE_Int,HYPRE_Real) = (fgmres_functions -> modify_pc); + HYPRE_Int (*modify_pc)(void*, HYPRE_Int, HYPRE_Real) = (fgmres_functions -> modify_pc); /* We are not checking rel. change for now... */ @@ -318,8 +348,8 @@ hypre_FlexGMRESSolve(void *fgmres_vdata, * this. Perhaps it should be set to something non-zero (but small). *-----------------------------------------------------------------------*/ - (*(fgmres_functions->CommInfo))(A,&my_id,&num_procs); - if ( logging>0 || print_level>0 ) + (*(fgmres_functions->CommInfo))(A, &my_id, &num_procs); + if ( logging > 0 || print_level > 0 ) { norms = (fgmres_data -> norms); /* not used yet log_file_name = (fgmres_data -> log_file_name);*/ @@ -327,28 +357,28 @@ hypre_FlexGMRESSolve(void *fgmres_vdata, } /* initialize work arrays */ - rs = hypre_CTAllocF(HYPRE_Real,k_dim+1,fgmres_functions, HYPRE_MEMORY_HOST); - c = hypre_CTAllocF(HYPRE_Real,k_dim,fgmres_functions, HYPRE_MEMORY_HOST); - s = hypre_CTAllocF(HYPRE_Real,k_dim,fgmres_functions, HYPRE_MEMORY_HOST); + rs = hypre_CTAllocF(HYPRE_Real, k_dim + 1, fgmres_functions, HYPRE_MEMORY_HOST); + c = hypre_CTAllocF(HYPRE_Real, k_dim, fgmres_functions, HYPRE_MEMORY_HOST); + s = hypre_CTAllocF(HYPRE_Real, k_dim, fgmres_functions, HYPRE_MEMORY_HOST); /* fgmres mod. - need non-modified hessenberg ???? */ - hh = hypre_CTAllocF(HYPRE_Real*,k_dim+1,fgmres_functions, HYPRE_MEMORY_HOST); - for (i=0; i < k_dim+1; i++) + hh = hypre_CTAllocF(HYPRE_Real*, k_dim + 1, fgmres_functions, HYPRE_MEMORY_HOST); + for (i = 0; i < k_dim + 1; i++) { - hh[i] = hypre_CTAllocF(HYPRE_Real,k_dim,fgmres_functions, HYPRE_MEMORY_HOST); + hh[i] = hypre_CTAllocF(HYPRE_Real, k_dim, fgmres_functions, HYPRE_MEMORY_HOST); } - (*(fgmres_functions->CopyVector))(b,p[0]); + (*(fgmres_functions->CopyVector))(b, p[0]); /* compute initial residual */ - (*(fgmres_functions->Matvec))(matvec_data,-1.0, A, x, 1.0, p[0]); + (*(fgmres_functions->Matvec))(matvec_data, -1.0, A, x, 1.0, p[0]); - b_norm = sqrt((*(fgmres_functions->InnerProd))(b,b)); + b_norm = hypre_sqrt((*(fgmres_functions->InnerProd))(b, b)); - /* Since it is does not diminish performance, attempt to return an error flag + /* Since it does not diminish performance, attempt to return an error flag and notify users when they supply bad input. */ - if (b_norm != 0.) ieee_check = b_norm/b_norm; /* INF -> NaN conversion */ + if (b_norm != 0.) { ieee_check = b_norm / b_norm; } /* INF -> NaN conversion */ if (ieee_check != ieee_check) { /* ...INFs or NaNs in input can make ieee_check a NaN. This test @@ -358,11 +388,11 @@ hypre_FlexGMRESSolve(void *fgmres_vdata, found at http://HTTP.CS.Berkeley.EDU/~wkahan/ieee754status/IEEE754.PDF */ if (logging > 0 || print_level > 0) { - hypre_printf("\n\nERROR detected by Hypre ... BEGIN\n"); - hypre_printf("ERROR -- hypre_FlexGMRESSolve: INFs and/or NaNs detected in input.\n"); - hypre_printf("User probably placed non-numerics in supplied b.\n"); - hypre_printf("Returning error flag += 101. Program not terminated.\n"); - hypre_printf("ERROR detected by Hypre ... END\n\n\n"); + hypre_printf("\n\nERROR detected by Hypre ... BEGIN\n"); + hypre_printf("ERROR -- hypre_FlexGMRESSolve: INFs and/or NaNs detected in input.\n"); + hypre_printf("User probably placed non-numerics in supplied b.\n"); + hypre_printf("Returning error flag += 101. Program not terminated.\n"); + hypre_printf("ERROR detected by Hypre ... END\n\n\n"); } hypre_error(HYPRE_ERROR_GENERIC); HYPRE_ANNOTATE_FUNC_END; @@ -370,12 +400,12 @@ hypre_FlexGMRESSolve(void *fgmres_vdata, return hypre_error_flag; } - r_norm = sqrt((*(fgmres_functions->InnerProd))(p[0],p[0])); + r_norm = hypre_sqrt((*(fgmres_functions->InnerProd))(p[0], p[0])); r_norm_0 = r_norm; - /* Since it is does not diminish performance, attempt to return an error flag + /* Since it does not diminish performance, attempt to return an error flag and notify users when they supply bad input. */ - if (r_norm != 0.) ieee_check = r_norm/r_norm; /* INF -> NaN conversion */ + if (r_norm != 0.) { ieee_check = r_norm / r_norm; } /* INF -> NaN conversion */ if (ieee_check != ieee_check) { /* ...INFs or NaNs in input can make ieee_check a NaN. This test @@ -385,11 +415,11 @@ hypre_FlexGMRESSolve(void *fgmres_vdata, found at http://HTTP.CS.Berkeley.EDU/~wkahan/ieee754status/IEEE754.PDF */ if (logging > 0 || print_level > 0) { - hypre_printf("\n\nERROR detected by Hypre ... BEGIN\n"); - hypre_printf("ERROR -- hypre_FlexGMRESSolve: INFs and/or NaNs detected in input.\n"); - hypre_printf("User probably placed non-numerics in supplied A or x_0.\n"); - hypre_printf("Returning error flag += 101. Program not terminated.\n"); - hypre_printf("ERROR detected by Hypre ... END\n\n\n"); + hypre_printf("\n\nERROR detected by Hypre ... BEGIN\n"); + hypre_printf("ERROR -- hypre_FlexGMRESSolve: INFs and/or NaNs detected in input.\n"); + hypre_printf("User probably placed non-numerics in supplied A or x_0.\n"); + hypre_printf("Returning error flag += 101. Program not terminated.\n"); + hypre_printf("ERROR detected by Hypre ... END\n\n\n"); } hypre_error(HYPRE_ERROR_GENERIC); HYPRE_ANNOTATE_FUNC_END; @@ -397,14 +427,16 @@ hypre_FlexGMRESSolve(void *fgmres_vdata, return hypre_error_flag; } - if ( logging>0 || print_level > 0) + if ( logging > 0 || print_level > 0) { norms[0] = r_norm; - if ( print_level>1 && my_id == 0 ) + if ( print_level > 1 && my_id == 0 ) { - hypre_printf("L2 norm of b: %e\n", b_norm); + hypre_printf("L2 norm of b: %e\n", b_norm); if (b_norm == 0.0) + { hypre_printf("Rel_resid_norm actually contains the residual norm\n"); + } hypre_printf("Initial L2 norm of residual: %e\n", r_norm); } @@ -413,41 +445,43 @@ hypre_FlexGMRESSolve(void *fgmres_vdata, if (b_norm > 0.0) { -/* convergence criterion |r_i|/|b| <= accuracy if |b| > 0 */ - den_norm= b_norm; + /* convergence criterion |r_i|/|b| <= accuracy if |b| > 0 */ + den_norm = b_norm; } else { -/* convergence criterion |r_i|/|r0| <= accuracy if |b| = 0 */ - den_norm= r_norm; + /* convergence criterion |r_i|/|r0| <= accuracy if |b| = 0 */ + den_norm = r_norm; }; -/* convergence criteria: |r_i| <= max( a_tol, r_tol * den_norm) - den_norm = |r_0| or |b| - note: default for a_tol is 0.0, so relative residual criteria is used unless - user specifies a_tol, or sets r_tol = 0.0, which means absolute - tol only is checked */ + /* convergence criteria: |r_i| <= max( a_tol, r_tol * den_norm) + den_norm = |r_0| or |b| + note: default for a_tol is 0.0, so relative residual criteria is used unless + user specifies a_tol, or sets r_tol = 0.0, which means absolute + tol only is checked */ - epsilon = hypre_max(a_tol,r_tol*den_norm); + epsilon = hypre_max(a_tol, r_tol * den_norm); /* so now our stop criteria is |r_i| <= epsilon */ - if ( print_level>1 && my_id == 0 ) + if ( print_level > 1 && my_id == 0 ) { if (b_norm > 0.0) - {hypre_printf("=============================================\n\n"); - hypre_printf("Iters resid.norm conv.rate rel.res.norm\n"); - hypre_printf("----- ------------ ---------- ------------\n"); + { + hypre_printf("=============================================\n\n"); + hypre_printf("Iters resid.norm conv.rate rel.res.norm\n"); + hypre_printf("----- ------------ ---------- ------------\n"); - } + } else - {hypre_printf("=============================================\n\n"); - hypre_printf("Iters resid.norm conv.rate\n"); - hypre_printf("----- ------------ ----------\n"); + { + hypre_printf("=============================================\n\n"); + hypre_printf("Iters resid.norm conv.rate\n"); + hypre_printf("----- ------------ ----------\n"); - }; + }; } @@ -455,255 +489,269 @@ hypre_FlexGMRESSolve(void *fgmres_vdata, /* outer iteration cycle */ while (iter < max_iter) { - /* initialize first term of hessenberg system */ - - rs[0] = r_norm; - if (r_norm == 0.0) - { - hypre_TFreeF(c,fgmres_functions); - hypre_TFreeF(s,fgmres_functions); - hypre_TFreeF(rs,fgmres_functions); - - for (i=0; i < k_dim+1; i++) { - hypre_TFreeF(hh[i],fgmres_functions); - } - - hypre_TFreeF(hh,fgmres_functions); - HYPRE_ANNOTATE_FUNC_END; - - return hypre_error_flag; - } - - /* see if we are already converged and - should print the final norm and exit */ - if (r_norm <= epsilon && iter >= min_iter) - { - - (*(fgmres_functions->CopyVector))(b,r); - (*(fgmres_functions->Matvec))(matvec_data,-1.0,A,x,1.0,r); - r_norm = sqrt((*(fgmres_functions->InnerProd))(r,r)); - if (r_norm <= epsilon) - { - if ( print_level>1 && my_id == 0) - { - hypre_printf("\n\n"); - hypre_printf("Final L2 norm of residual: %e\n\n", r_norm); - } - break; - } - else - if ( print_level>0 && my_id == 0) - hypre_printf("false convergence 1\n"); - - } - - t = 1.0 / r_norm; - - - (*(fgmres_functions->ScaleVector))(t,p[0]); - i = 0; - - - /***RESTART CYCLE (right-preconditioning) ***/ - while (i < k_dim && iter < max_iter) - { - i++; - iter++; - - (*(fgmres_functions->ClearVector))(pre_vecs[i-1]); - - /* allow some user function here (to change - * prec. attributes, i.e.tolerances, etc. ? */ - modify_pc(precond_data, iter, r_norm/den_norm ); - - /*apply preconditioner and store in pre_vecs */ - precond(precond_data, A, p[i-1], pre_vecs[i-1]); - /*apply operator and store in p */ - (*(fgmres_functions->Matvec))(matvec_data, 1.0, A, pre_vecs[i-1], 0.0, p[i]); - - - /* modified Gram_Schmidt */ - for (j=0; j < i; j++) - { - hh[j][i-1] = (*(fgmres_functions->InnerProd))(p[j],p[i]); - (*(fgmres_functions->Axpy))(-hh[j][i-1],p[j],p[i]); - } - t = sqrt((*(fgmres_functions->InnerProd))(p[i],p[i])); - hh[i][i-1] = t; - if (t != 0.0) - { - t = 1.0/t; - (*(fgmres_functions->ScaleVector))(t,p[i]); - } - - - /* done with modified Gram_schmidt and Arnoldi step. - update factorization of hh */ - for (j = 1; j < i; j++) - { - t = hh[j-1][i-1]; - hh[j-1][i-1] = s[j-1]*hh[j][i-1] + c[j-1]*t; - hh[j][i-1] = -s[j-1]*t + c[j-1]*hh[j][i-1]; - } - t= hh[i][i-1]*hh[i][i-1]; - t+= hh[i-1][i-1]*hh[i-1][i-1]; - gamma = sqrt(t); - if (gamma == 0.0) gamma = epsmac; - c[i-1] = hh[i-1][i-1]/gamma; - s[i-1] = hh[i][i-1]/gamma; - rs[i] = -hh[i][i-1]*rs[i-1]; - rs[i]/= gamma; - rs[i-1] = c[i-1]*rs[i-1]; - /* determine residual norm */ - hh[i-1][i-1] = s[i-1]*hh[i][i-1] + c[i-1]*hh[i-1][i-1]; - r_norm = fabs(rs[i]); - - /* print ? */ - if ( print_level>0 ) - { - norms[iter] = r_norm; - if ( print_level>1 && my_id == 0 ) - { - if (b_norm > 0.0) - hypre_printf("% 5d %e %f %e\n", iter, - norms[iter],norms[iter]/norms[iter-1], - norms[iter]/b_norm); - else - hypre_printf("% 5d %e %f\n", iter, norms[iter], - norms[iter]/norms[iter-1]); - } - } - /*convergence factor tolerance */ - if (cf_tol > 0.0) - { - cf_ave_0 = cf_ave_1; - cf_ave_1 = pow( r_norm / r_norm_0, 1.0/(2.0*iter)); - - weight = fabs(cf_ave_1 - cf_ave_0); - weight = weight / hypre_max(cf_ave_1, cf_ave_0); - weight = 1.0 - weight; + /* initialize first term of hessenberg system */ + + rs[0] = r_norm; + if (r_norm == 0.0) + { + hypre_TFreeF(c, fgmres_functions); + hypre_TFreeF(s, fgmres_functions); + hypre_TFreeF(rs, fgmres_functions); + + for (i = 0; i < k_dim + 1; i++) + { + hypre_TFreeF(hh[i], fgmres_functions); + } + + hypre_TFreeF(hh, fgmres_functions); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; + } + + /* see if we are already converged and + should print the final norm and exit */ + if (r_norm <= epsilon && iter >= min_iter) + { + + (*(fgmres_functions->CopyVector))(b, r); + (*(fgmres_functions->Matvec))(matvec_data, -1.0, A, x, 1.0, r); + r_norm = hypre_sqrt((*(fgmres_functions->InnerProd))(r, r)); + if (r_norm <= epsilon) + { + if ( print_level > 1 && my_id == 0) + { + hypre_printf("\n\n"); + hypre_printf("Final L2 norm of residual: %e\n\n", r_norm); + } + break; + } + else if ( print_level > 0 && my_id == 0) + { + hypre_printf("false convergence 1\n"); + } + + } + + t = 1.0 / r_norm; + + + (*(fgmres_functions->ScaleVector))(t, p[0]); + i = 0; + + + /***RESTART CYCLE (right-preconditioning) ***/ + while (i < k_dim && iter < max_iter) + { + i++; + iter++; + + (*(fgmres_functions->ClearVector))(pre_vecs[i - 1]); + + /* allow some user function here (to change + * prec. attributes, i.e.tolerances, etc. ? */ + modify_pc(precond_data, iter, r_norm / den_norm ); + + /*apply preconditioner and store in pre_vecs */ + precond(precond_data, A, p[i - 1], pre_vecs[i - 1]); + /*apply operator and store in p */ + (*(fgmres_functions->Matvec))(matvec_data, 1.0, A, pre_vecs[i - 1], 0.0, p[i]); + + + /* modified Gram_Schmidt */ + for (j = 0; j < i; j++) + { + hh[j][i - 1] = (*(fgmres_functions->InnerProd))(p[j], p[i]); + (*(fgmres_functions->Axpy))(-hh[j][i - 1], p[j], p[i]); + } + t = hypre_sqrt((*(fgmres_functions->InnerProd))(p[i], p[i])); + hh[i][i - 1] = t; + if (t != 0.0) + { + t = 1.0 / t; + (*(fgmres_functions->ScaleVector))(t, p[i]); + } + + + /* done with modified Gram_schmidt and Arnoldi step. + update factorization of hh */ + for (j = 1; j < i; j++) + { + t = hh[j - 1][i - 1]; + hh[j - 1][i - 1] = s[j - 1] * hh[j][i - 1] + c[j - 1] * t; + hh[j][i - 1] = -s[j - 1] * t + c[j - 1] * hh[j][i - 1]; + } + t = hh[i][i - 1] * hh[i][i - 1]; + t += hh[i - 1][i - 1] * hh[i - 1][i - 1]; + gamma = hypre_sqrt(t); + if (gamma == 0.0) { gamma = epsmac; } + c[i - 1] = hh[i - 1][i - 1] / gamma; + s[i - 1] = hh[i][i - 1] / gamma; + rs[i] = -hh[i][i - 1] * rs[i - 1]; + rs[i] /= gamma; + rs[i - 1] = c[i - 1] * rs[i - 1]; + /* determine residual norm */ + hh[i - 1][i - 1] = s[i - 1] * hh[i][i - 1] + c[i - 1] * hh[i - 1][i - 1]; + r_norm = hypre_abs(rs[i]); + + /* print ? */ + if ( print_level > 0 ) + { + norms[iter] = r_norm; + if ( print_level > 1 && my_id == 0 ) + { + if (b_norm > 0.0) + hypre_printf("% 5d %e %f %e\n", iter, + norms[iter], norms[iter] / norms[iter - 1], + norms[iter] / b_norm); + else + hypre_printf("% 5d %e %f\n", iter, norms[iter], + norms[iter] / norms[iter - 1]); + } + } + /*convergence factor tolerance */ + if (cf_tol > 0.0) + { + cf_ave_0 = cf_ave_1; + cf_ave_1 = hypre_pow( r_norm / r_norm_0, 1.0 / (2.0 * iter)); + + weight = hypre_abs(cf_ave_1 - cf_ave_0); + weight = weight / hypre_max(cf_ave_1, cf_ave_0); + weight = 1.0 - weight; #if 0 - hypre_printf("I = %d: cf_new = %e, cf_old = %e, weight = %e\n", - i, cf_ave_1, cf_ave_0, weight ); + hypre_printf("I = %d: cf_new = %e, cf_old = %e, weight = %e\n", + i, cf_ave_1, cf_ave_0, weight ); #endif - if (weight * cf_ave_1 > cf_tol) - { - break_value = 1; - break; - } - } - /* should we exit the restart cycle? (conv. check) */ - if (r_norm <= epsilon && iter >= min_iter) - { - /* no relative change */ - - break; - - } - - - } /*** end of restart cycle ***/ - - /* now compute solution, first solve upper triangular system */ - - if (break_value) break; - - rs[i-1] = rs[i-1]/hh[i-1][i-1]; - for (k = i-2; k >= 0; k--) - { - t = 0.0; - for (j = k+1; j < i; j++) - { - t -= hh[k][j]*rs[j]; - } - t+= rs[k]; - rs[k] = t/hh[k][k]; - } - /* form linear combination of pre_vecs's to get solution */ - - (*(fgmres_functions->CopyVector))(pre_vecs[i-1],w); - (*(fgmres_functions->ScaleVector))(rs[i-1],w); - for (j = i-2; j >=0; j--) - (*(fgmres_functions->Axpy))(rs[j], pre_vecs[j], w); - - - /* don't need to un-wind precond... - so now the correction is - * in w */ - - - /* update current solution x (in x) */ - (*(fgmres_functions->Axpy))(1.0,w,x); - - - /* check for convergence by evaluating the actual residual */ - if (r_norm <= epsilon && iter >= min_iter) - { - /* calculate actual residual norm*/ - (*(fgmres_functions->CopyVector))(b,r); - (*(fgmres_functions->Matvec))(matvec_data,-1.0,A,x,1.0,r); - r_norm = sqrt( (*(fgmres_functions->InnerProd))(r,r) ); - - if (r_norm <= epsilon) - { - if ( print_level>1 && my_id == 0 ) - { - hypre_printf("\n\n"); - hypre_printf("Final L2 norm of residual: %e\n\n", r_norm); - } - (fgmres_data -> converged) = 1; - break; - - } - else /* conv. has not occurred, according to true residual */ - { - if ( print_level>0 && my_id == 0) - hypre_printf("false convergence 2\n"); - (*(fgmres_functions->CopyVector))(r,p[0]); - i = 0; - } - } /* end of convergence check */ - - /* compute residual vector and continue loop */ - for (j=i ; j > 0; j--) - { - rs[j-1] = -s[j-1]*rs[j]; - rs[j] = c[j-1]*rs[j]; - } - - if (i) (*(fgmres_functions->Axpy))(rs[i]-1.0,p[i],p[i]); - for (j=i-1 ; j > 0; j--) - (*(fgmres_functions->Axpy))(rs[j],p[j],p[i]); - - if (i) - { - (*(fgmres_functions->Axpy))(rs[0]-1.0,p[0],p[0]); - (*(fgmres_functions->Axpy))(1.0,p[i],p[0]); - } + if (weight * cf_ave_1 > cf_tol) + { + break_value = 1; + break; + } + } + /* should we exit the restart cycle? (conv. check) */ + if (r_norm <= epsilon && iter >= min_iter) + { + /* no relative change */ + + break; + + } + + + } /*** end of restart cycle ***/ + + /* now compute solution, first solve upper triangular system */ + + if (break_value) { break; } + + rs[i - 1] = rs[i - 1] / hh[i - 1][i - 1]; + for (k = i - 2; k >= 0; k--) + { + t = 0.0; + for (j = k + 1; j < i; j++) + { + t -= hh[k][j] * rs[j]; + } + t += rs[k]; + rs[k] = t / hh[k][k]; + } + /* form linear combination of pre_vecs's to get solution */ + + (*(fgmres_functions->CopyVector))(pre_vecs[i - 1], w); + (*(fgmres_functions->ScaleVector))(rs[i - 1], w); + for (j = i - 2; j >= 0; j--) + { + (*(fgmres_functions->Axpy))(rs[j], pre_vecs[j], w); + } + + + /* don't need to un-wind precond... - so now the correction is + * in w */ + + + /* update current solution x (in x) */ + (*(fgmres_functions->Axpy))(1.0, w, x); + + + /* check for convergence by evaluating the actual residual */ + if (r_norm <= epsilon && iter >= min_iter) + { + /* calculate actual residual norm*/ + (*(fgmres_functions->CopyVector))(b, r); + (*(fgmres_functions->Matvec))(matvec_data, -1.0, A, x, 1.0, r); + r_norm = hypre_sqrt( (*(fgmres_functions->InnerProd))(r, r) ); + + if (r_norm <= epsilon) + { + if ( print_level > 1 && my_id == 0 ) + { + hypre_printf("\n\n"); + hypre_printf("Final L2 norm of residual: %e\n\n", r_norm); + } + (fgmres_data -> converged) = 1; + break; + + } + else /* conv. has not occurred, according to true residual */ + { + if ( print_level > 0 && my_id == 0) + { + hypre_printf("false convergence 2\n"); + } + (*(fgmres_functions->CopyVector))(r, p[0]); + i = 0; + } + } /* end of convergence check */ + + /* compute residual vector and continue loop */ + for (j = i ; j > 0; j--) + { + rs[j - 1] = -s[j - 1] * rs[j]; + rs[j] = c[j - 1] * rs[j]; + } + + if (i) { (*(fgmres_functions->Axpy))(rs[i] - 1.0, p[i], p[i]); } + for (j = i - 1 ; j > 0; j--) + { + (*(fgmres_functions->Axpy))(rs[j], p[j], p[i]); + } + + if (i) + { + (*(fgmres_functions->Axpy))(rs[0] - 1.0, p[0], p[0]); + (*(fgmres_functions->Axpy))(1.0, p[i], p[0]); + } } /* END of iteration while loop */ - if ( print_level>1 && my_id == 0 ) - hypre_printf("\n\n"); + if ( print_level > 1 && my_id == 0 ) + { + hypre_printf("\n\n"); + } (fgmres_data -> num_iterations) = iter; if (b_norm > 0.0) - (fgmres_data -> rel_residual_norm) = r_norm/b_norm; + { + (fgmres_data -> rel_residual_norm) = r_norm / b_norm; + } if (b_norm == 0.0) + { (fgmres_data -> rel_residual_norm) = r_norm; + } - if (iter >= max_iter && r_norm > epsilon && epsilon > 0) hypre_error(HYPRE_ERROR_CONV); + if (iter >= max_iter && r_norm > epsilon && epsilon > 0) { hypre_error(HYPRE_ERROR_CONV); } - hypre_TFreeF(c,fgmres_functions); - hypre_TFreeF(s,fgmres_functions); - hypre_TFreeF(rs,fgmres_functions); + hypre_TFreeF(c, fgmres_functions); + hypre_TFreeF(s, fgmres_functions); + hypre_TFreeF(rs, fgmres_functions); - for (i=0; i < k_dim+1; i++) + for (i = 0; i < k_dim + 1; i++) { - hypre_TFreeF(hh[i],fgmres_functions); + hypre_TFreeF(hh[i], fgmres_functions); } - hypre_TFreeF(hh,fgmres_functions); + hypre_TFreeF(hh, fgmres_functions); HYPRE_ANNOTATE_FUNC_END; @@ -716,7 +764,7 @@ hypre_FlexGMRESSolve(void *fgmres_vdata, HYPRE_Int hypre_FlexGMRESSetKDim( void *fgmres_vdata, - HYPRE_Int k_dim ) + HYPRE_Int k_dim ) { hypre_FlexGMRESData *fgmres_data = (hypre_FlexGMRESData *)fgmres_vdata; @@ -729,7 +777,7 @@ hypre_FlexGMRESSetKDim( void *fgmres_vdata, HYPRE_Int hypre_FlexGMRESGetKDim( void *fgmres_vdata, - HYPRE_Int * k_dim ) + HYPRE_Int * k_dim ) { hypre_FlexGMRESData *fgmres_data = (hypre_FlexGMRESData *)fgmres_vdata; @@ -746,7 +794,7 @@ hypre_FlexGMRESGetKDim( void *fgmres_vdata, HYPRE_Int hypre_FlexGMRESSetTol( void *fgmres_vdata, - HYPRE_Real tol ) + HYPRE_Real tol ) { hypre_FlexGMRESData *fgmres_data = (hypre_FlexGMRESData *)fgmres_vdata; @@ -758,7 +806,7 @@ hypre_FlexGMRESSetTol( void *fgmres_vdata, HYPRE_Int hypre_FlexGMRESGetTol( void *fgmres_vdata, - HYPRE_Real * tol ) + HYPRE_Real * tol ) { hypre_FlexGMRESData *fgmres_data = (hypre_FlexGMRESData *)fgmres_vdata; @@ -773,7 +821,7 @@ hypre_FlexGMRESGetTol( void *fgmres_vdata, HYPRE_Int hypre_FlexGMRESSetAbsoluteTol( void *fgmres_vdata, - HYPRE_Real a_tol ) + HYPRE_Real a_tol ) { hypre_FlexGMRESData *fgmres_data = (hypre_FlexGMRESData *)fgmres_vdata; @@ -785,7 +833,7 @@ hypre_FlexGMRESSetAbsoluteTol( void *fgmres_vdata, HYPRE_Int hypre_FlexGMRESGetAbsoluteTol( void *fgmres_vdata, - HYPRE_Real * a_tol ) + HYPRE_Real * a_tol ) { hypre_FlexGMRESData *fgmres_data = (hypre_FlexGMRESData *)fgmres_vdata; @@ -800,7 +848,7 @@ hypre_FlexGMRESGetAbsoluteTol( void *fgmres_vdata, HYPRE_Int hypre_FlexGMRESSetConvergenceFactorTol( void *fgmres_vdata, - HYPRE_Real cf_tol ) + HYPRE_Real cf_tol ) { hypre_FlexGMRESData *fgmres_data = (hypre_FlexGMRESData *)fgmres_vdata; @@ -812,7 +860,7 @@ hypre_FlexGMRESSetConvergenceFactorTol( void *fgmres_vdata, HYPRE_Int hypre_FlexGMRESGetConvergenceFactorTol( void *fgmres_vdata, - HYPRE_Real * cf_tol ) + HYPRE_Real * cf_tol ) { hypre_FlexGMRESData *fgmres_data = (hypre_FlexGMRESData *)fgmres_vdata; @@ -828,7 +876,7 @@ hypre_FlexGMRESGetConvergenceFactorTol( void *fgmres_vdata, HYPRE_Int hypre_FlexGMRESSetMinIter( void *fgmres_vdata, - HYPRE_Int min_iter ) + HYPRE_Int min_iter ) { hypre_FlexGMRESData *fgmres_data = (hypre_FlexGMRESData *)fgmres_vdata; @@ -840,7 +888,7 @@ hypre_FlexGMRESSetMinIter( void *fgmres_vdata, HYPRE_Int hypre_FlexGMRESGetMinIter( void *fgmres_vdata, - HYPRE_Int * min_iter ) + HYPRE_Int * min_iter ) { hypre_FlexGMRESData *fgmres_data = (hypre_FlexGMRESData *)fgmres_vdata; @@ -856,7 +904,7 @@ hypre_FlexGMRESGetMinIter( void *fgmres_vdata, HYPRE_Int hypre_FlexGMRESSetMaxIter( void *fgmres_vdata, - HYPRE_Int max_iter ) + HYPRE_Int max_iter ) { hypre_FlexGMRESData *fgmres_data = (hypre_FlexGMRESData *)fgmres_vdata; @@ -868,7 +916,7 @@ hypre_FlexGMRESSetMaxIter( void *fgmres_vdata, HYPRE_Int hypre_FlexGMRESGetMaxIter( void *fgmres_vdata, - HYPRE_Int * max_iter ) + HYPRE_Int * max_iter ) { hypre_FlexGMRESData *fgmres_data = (hypre_FlexGMRESData *)fgmres_vdata; @@ -885,7 +933,7 @@ hypre_FlexGMRESGetMaxIter( void *fgmres_vdata, HYPRE_Int hypre_FlexGMRESSetStopCrit( void *fgmres_vdata, - HYPRE_Int stop_crit ) + HYPRE_Int stop_crit ) { hypre_FlexGMRESData *fgmres_data = (hypre_FlexGMRESData *)fgmres_vdata; @@ -897,7 +945,7 @@ hypre_FlexGMRESSetStopCrit( void *fgmres_vdata, HYPRE_Int hypre_FlexGMRESGetStopCrit( void *fgmres_vdata, - HYPRE_Int * stop_crit ) + HYPRE_Int * stop_crit ) { hypre_FlexGMRESData *fgmres_data = (hypre_FlexGMRESData *)fgmres_vdata; @@ -913,9 +961,9 @@ hypre_FlexGMRESGetStopCrit( void *fgmres_vdata, HYPRE_Int hypre_FlexGMRESSetPrecond( void *fgmres_vdata, - HYPRE_Int (*precond)(void*,void*,void*,void*), - HYPRE_Int (*precond_setup)(void*,void*,void*,void*), - void *precond_data ) + HYPRE_Int (*precond)(void*, void*, void*, void*), + HYPRE_Int (*precond_setup)(void*, void*, void*, void*), + void *precond_data ) { hypre_FlexGMRESData *fgmres_data = (hypre_FlexGMRESData *)fgmres_vdata; hypre_FlexGMRESFunctions *fgmres_functions = fgmres_data->functions; @@ -934,7 +982,7 @@ hypre_FlexGMRESSetPrecond( void *fgmres_vdata, HYPRE_Int hypre_FlexGMRESGetPrecond( void *fgmres_vdata, - HYPRE_Solver *precond_data_ptr ) + HYPRE_Solver *precond_data_ptr ) { hypre_FlexGMRESData *fgmres_data = (hypre_FlexGMRESData *)fgmres_vdata; @@ -950,7 +998,7 @@ hypre_FlexGMRESGetPrecond( void *fgmres_vdata, HYPRE_Int hypre_FlexGMRESSetPrintLevel( void *fgmres_vdata, - HYPRE_Int level) + HYPRE_Int level) { hypre_FlexGMRESData *fgmres_data = (hypre_FlexGMRESData *)fgmres_vdata; @@ -962,7 +1010,7 @@ hypre_FlexGMRESSetPrintLevel( void *fgmres_vdata, HYPRE_Int hypre_FlexGMRESGetPrintLevel( void *fgmres_vdata, - HYPRE_Int * level) + HYPRE_Int * level) { hypre_FlexGMRESData *fgmres_data = (hypre_FlexGMRESData *)fgmres_vdata; @@ -978,7 +1026,7 @@ hypre_FlexGMRESGetPrintLevel( void *fgmres_vdata, HYPRE_Int hypre_FlexGMRESSetLogging( void *fgmres_vdata, - HYPRE_Int level) + HYPRE_Int level) { hypre_FlexGMRESData *fgmres_data = (hypre_FlexGMRESData *)fgmres_vdata; @@ -990,7 +1038,7 @@ hypre_FlexGMRESSetLogging( void *fgmres_vdata, HYPRE_Int hypre_FlexGMRESGetLogging( void *fgmres_vdata, - HYPRE_Int * level) + HYPRE_Int * level) { hypre_FlexGMRESData *fgmres_data = (hypre_FlexGMRESData *)fgmres_vdata; @@ -1006,7 +1054,7 @@ hypre_FlexGMRESGetLogging( void *fgmres_vdata, HYPRE_Int hypre_FlexGMRESGetNumIterations( void *fgmres_vdata, - HYPRE_Int *num_iterations ) + HYPRE_Int *num_iterations ) { hypre_FlexGMRESData *fgmres_data = (hypre_FlexGMRESData *)fgmres_vdata; @@ -1038,7 +1086,7 @@ hypre_FlexGMRESGetConverged( void *fgmres_vdata, HYPRE_Int hypre_FlexGMRESGetFinalRelativeResidualNorm( void *fgmres_vdata, - HYPRE_Real *relative_residual_norm ) + HYPRE_Real *relative_residual_norm ) { hypre_FlexGMRESData *fgmres_data = (hypre_FlexGMRESData *)fgmres_vdata; @@ -1051,32 +1099,34 @@ hypre_FlexGMRESGetFinalRelativeResidualNorm( void *fgmres_vdata, * hypre_FlexGMRESSetModifyPC *--------------------------------------------------------------------------*/ -HYPRE_Int hypre_FlexGMRESSetModifyPC(void *fgmres_vdata, - HYPRE_Int (*modify_pc)(void *precond_data, HYPRE_Int iteration, HYPRE_Real rel_residual_norm)) +HYPRE_Int +hypre_FlexGMRESSetModifyPC(void *fgmres_vdata, + HYPRE_Int (*modify_pc)(void*, HYPRE_Int, HYPRE_Real)) { - hypre_FlexGMRESData *fgmres_data = (hypre_FlexGMRESData *)fgmres_vdata; hypre_FlexGMRESFunctions *fgmres_functions = fgmres_data->functions; - (fgmres_functions -> modify_pc) = modify_pc; + (fgmres_functions -> modify_pc) = modify_pc; return hypre_error_flag; } - /*-------------------------------------------------------------------------- * hypre_FlexGMRESModifyPCDefault - if the user does not specify a function *--------------------------------------------------------------------------*/ -HYPRE_Int hypre_FlexGMRESModifyPCDefault(void *precond_data, HYPRE_Int iteration, - HYPRE_Real rel_residual_norm) +HYPRE_Int +hypre_FlexGMRESModifyPCDefault(void *precond_data, + HYPRE_Int iteration, + HYPRE_Real rel_residual_norm) { + /* TODO - Here could check the number of its and the current + residual and make some changes to the preconditioner. + There is an example in ex5.c.*/ - - /* Here would could check the number of its and the current - residual and make some changes to the preconditioner. There is - an example in ex5.c.*/ - + HYPRE_UNUSED_VAR(precond_data); + HYPRE_UNUSED_VAR(iteration); + HYPRE_UNUSED_VAR(rel_residual_norm); return 0; } diff --git a/external/hypre/src/krylov/flexgmres.h b/external/hypre/src/krylov/flexgmres.h index 56fb061c..f4d10759 100644 --- a/external/hypre/src/krylov/flexgmres.h +++ b/external/hypre/src/krylov/flexgmres.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -66,7 +66,7 @@ typedef struct HYPRE_Int (*precond_setup)(void *vdata, void *A, void *b, void *x ); HYPRE_Int (*modify_pc)(void *precond_data, HYPRE_Int iteration, HYPRE_Real rel_residual_norm ); - + } hypre_FlexGMRESFunctions; /** @@ -101,7 +101,7 @@ typedef struct /* log info (always logged) */ HYPRE_Int num_iterations; - + HYPRE_Int print_level; /* printing when print_level>0 */ HYPRE_Int logging; /* extra computations for logging when logging>0 */ HYPRE_Real *norms; @@ -146,7 +146,7 @@ hypre_FlexGMRESFunctionsCreate( HYPRE_Int (*Axpy) ( HYPRE_Complex alpha, void *x, void *y ), HYPRE_Int (*PrecondSetup) ( void *vdata, void *A, void *b, void *x ), HYPRE_Int (*Precond) ( void *vdata, void *A, void *b, void *x ) - ); +); /** * Description... diff --git a/external/hypre/src/krylov/gmres.c b/external/hypre/src/krylov/gmres.c index 343e4211..dec83794 100644 --- a/external/hypre/src/krylov/gmres.c +++ b/external/hypre/src/krylov/gmres.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -38,11 +38,11 @@ hypre_GMRESFunctionsCreate( HYPRE_Int (*Axpy) ( HYPRE_Complex alpha, void *x, void *y ), HYPRE_Int (*PrecondSetup) ( void *vdata, void *A, void *b, void *x ), HYPRE_Int (*Precond) ( void *vdata, void *A, void *b, void *x ) - ) +) { hypre_GMRESFunctions * gmres_functions; gmres_functions = (hypre_GMRESFunctions *) - CAlloc( 1, sizeof(hypre_GMRESFunctions), HYPRE_MEMORY_HOST ); + CAlloc( 1, sizeof(hypre_GMRESFunctions), HYPRE_MEMORY_HOST ); gmres_functions->CAlloc = CAlloc; gmres_functions->Free = Free; @@ -58,7 +58,7 @@ hypre_GMRESFunctionsCreate( gmres_functions->ClearVector = ClearVector; gmres_functions->ScaleVector = ScaleVector; gmres_functions->Axpy = Axpy; -/* default preconditioner must be set here but can be changed later... */ + /* default preconditioner must be set here but can be changed later... */ gmres_functions->precond_setup = PrecondSetup; gmres_functions->precond = Precond; @@ -121,26 +121,36 @@ hypre_GMRESDestroy( void *gmres_vdata ) if (gmres_data) { hypre_GMRESFunctions *gmres_functions = gmres_data->functions; - if ( (gmres_data->logging>0) || (gmres_data->print_level) > 0 ) + if ( (gmres_data->logging > 0) || (gmres_data->print_level) > 0 ) { if ( (gmres_data -> norms) != NULL ) + { hypre_TFreeF( gmres_data -> norms, gmres_functions ); + } } if ( (gmres_data -> matvec_data) != NULL ) + { (*(gmres_functions->MatvecDestroy))(gmres_data -> matvec_data); + } if ( (gmres_data -> r) != NULL ) + { (*(gmres_functions->DestroyVector))(gmres_data -> r); + } if ( (gmres_data -> w) != NULL ) + { (*(gmres_functions->DestroyVector))(gmres_data -> w); + } if ( (gmres_data -> w_2) != NULL ) + { (*(gmres_functions->DestroyVector))(gmres_data -> w_2); + } if ( (gmres_data -> p) != NULL ) { - for (i = 0; i < (gmres_data -> k_dim+1); i++) + for (i = 0; i < (gmres_data -> k_dim + 1); i++) { if ( (gmres_data -> p)[i] != NULL ) { @@ -178,17 +188,17 @@ HYPRE_Int hypre_GMRESSetup( void *gmres_vdata, void *A, void *b, - void *x ) + void *x ) { - hypre_GMRESData *gmres_data = (hypre_GMRESData *)gmres_vdata; - hypre_GMRESFunctions *gmres_functions = gmres_data->functions; + hypre_GMRESData *gmres_data = (hypre_GMRESData *)gmres_vdata; + hypre_GMRESFunctions *gmres_functions = (gmres_data -> functions); - HYPRE_Int k_dim = (gmres_data -> k_dim); - HYPRE_Int max_iter = (gmres_data -> max_iter); - HYPRE_Int (*precond_setup)(void*,void*,void*,void*) = (gmres_functions->precond_setup); - void *precond_data = (gmres_data -> precond_data); + HYPRE_Int k_dim = (gmres_data -> k_dim); + HYPRE_Int max_iter = (gmres_data -> max_iter); + void *precond_data = (gmres_data -> precond_data); + HYPRE_Int rel_change = (gmres_data -> rel_change); - HYPRE_Int rel_change = (gmres_data -> rel_change); + HYPRE_Int (*precond_setup)(void*, void*, void*, void*) = (gmres_functions->precond_setup); HYPRE_ANNOTATE_FUNC_BEGIN; @@ -201,21 +211,32 @@ hypre_GMRESSetup( void *gmres_vdata, *--------------------------------------------------*/ if ((gmres_data -> p) == NULL) - (gmres_data -> p) = (void**)(*(gmres_functions->CreateVectorArray))(k_dim+1,x); + { + (gmres_data -> p) = (void**)(*(gmres_functions->CreateVectorArray))(k_dim + 1, x); + } + if ((gmres_data -> r) == NULL) + { (gmres_data -> r) = (*(gmres_functions->CreateVector))(b); + } + if ((gmres_data -> w) == NULL) + { (gmres_data -> w) = (*(gmres_functions->CreateVector))(b); + } if (rel_change) { if ((gmres_data -> w_2) == NULL) + { (gmres_data -> w_2) = (*(gmres_functions->CreateVector))(b); + } } - if ((gmres_data -> matvec_data) == NULL) + { (gmres_data -> matvec_data) = (*(gmres_functions->MatvecCreate))(A, x); + } precond_setup(precond_data, A, b, x); @@ -223,11 +244,14 @@ hypre_GMRESSetup( void *gmres_vdata, * Allocate space for log info *-----------------------------------------------------*/ - if ( (gmres_data->logging)>0 || (gmres_data->print_level) > 0 ) + if ( (gmres_data->logging) > 0 || (gmres_data->print_level) > 0 ) { if ((gmres_data -> norms) != NULL) - hypre_TFreeF(gmres_data -> norms,gmres_functions); - (gmres_data -> norms) = hypre_CTAllocF(HYPRE_Real, max_iter + 1,gmres_functions, HYPRE_MEMORY_HOST); + { + hypre_TFreeF(gmres_data -> norms, gmres_functions); + } + (gmres_data -> norms) = hypre_CTAllocF(HYPRE_Real, max_iter + 1, gmres_functions, + HYPRE_MEMORY_HOST); } if ( (gmres_data->print_level) > 0 ) { @@ -253,56 +277,53 @@ hypre_GMRESSolve(void *gmres_vdata, void *x) { hypre_GMRESData *gmres_data = (hypre_GMRESData *)gmres_vdata; - hypre_GMRESFunctions *gmres_functions = gmres_data->functions; + hypre_GMRESFunctions *gmres_functions = (gmres_data -> functions); + HYPRE_Int k_dim = (gmres_data -> k_dim); HYPRE_Int min_iter = (gmres_data -> min_iter); HYPRE_Int max_iter = (gmres_data -> max_iter); HYPRE_Int rel_change = (gmres_data -> rel_change); HYPRE_Int skip_real_r_check = (gmres_data -> skip_real_r_check); - HYPRE_Int hybrid = (gmres_data -> hybrid); + HYPRE_Int hybrid = (gmres_data -> hybrid); HYPRE_Real r_tol = (gmres_data -> tol); HYPRE_Real cf_tol = (gmres_data -> cf_tol); HYPRE_Real a_tol = (gmres_data -> a_tol); void *matvec_data = (gmres_data -> matvec_data); void *r = (gmres_data -> r); void *w = (gmres_data -> w); + /* note: w_2 is only allocated if rel_change = 1 */ void *w_2 = (gmres_data -> w_2); - void **p = (gmres_data -> p); - - HYPRE_Int (*precond)(void*,void*,void*,void*) = (gmres_functions -> precond); + HYPRE_Int (*precond)(void*, void*, void*, void*) = (gmres_functions -> precond); HYPRE_Int *precond_data = (HYPRE_Int*) (gmres_data -> precond_data); HYPRE_Int print_level = (gmres_data -> print_level); HYPRE_Int logging = (gmres_data -> logging); - HYPRE_Real *norms = (gmres_data -> norms); -/* not used yet char *log_file_name = (gmres_data -> log_file_name);*/ -/* FILE *fp; */ - - HYPRE_Int break_value = 0; - HYPRE_Int i, j, k; - HYPRE_Real *rs, **hh, *c, *s, *rs_2; - HYPRE_Int iter; - HYPRE_Int my_id, num_procs; - HYPRE_Real epsilon, gamma, t, r_norm, b_norm, den_norm, x_norm; - HYPRE_Real w_norm; - - HYPRE_Real epsmac = 1.e-16; - HYPRE_Real ieee_check = 0.; - - HYPRE_Real guard_zero_residual; - HYPRE_Real cf_ave_0 = 0.0; - HYPRE_Real cf_ave_1 = 0.0; - HYPRE_Real weight; - HYPRE_Real r_norm_0; - HYPRE_Real relative_error = 1.0; - - HYPRE_Int rel_change_passed = 0, num_rel_change_check = 0; - - HYPRE_Real real_r_norm_old, real_r_norm_new; + /* not used yet char *log_file_name = (gmres_data -> log_file_name);*/ + /* FILE *fp; */ + + HYPRE_Int break_value = 0; + HYPRE_Int i, j, k; + HYPRE_Real *rs, **hh, *c, *s, *rs_2 = NULL; + HYPRE_Int iter; + HYPRE_Int my_id, num_procs; + HYPRE_Real epsilon, gamma, t, r_norm, b_norm, den_norm, x_norm; + HYPRE_Real w_norm; + + HYPRE_Real epsmac = 1.e-16; + HYPRE_Real ieee_check = 0.; + + HYPRE_Real guard_zero_residual; + HYPRE_Real cf_ave_0 = 0.0; + HYPRE_Real cf_ave_1 = 0.0; + HYPRE_Real weight; + HYPRE_Real r_norm_0; + HYPRE_Real relative_error = 1.0; + HYPRE_Int rel_change_passed = 0, num_rel_change_check = 0; + HYPRE_Real real_r_norm_old, real_r_norm_new; HYPRE_ANNOTATE_FUNC_BEGIN; @@ -315,39 +336,39 @@ hypre_GMRESSolve(void *gmres_vdata, *-----------------------------------------------------------------------*/ guard_zero_residual = 0.0; - (*(gmres_functions->CommInfo))(A,&my_id,&num_procs); - if ( logging>0 || print_level>0 ) + (*(gmres_functions->CommInfo))(A, &my_id, &num_procs); + if ( logging > 0 || print_level > 0 ) { norms = (gmres_data -> norms); } /* initialize work arrays */ - rs = hypre_CTAllocF(HYPRE_Real,k_dim+1,gmres_functions, HYPRE_MEMORY_HOST); - c = hypre_CTAllocF(HYPRE_Real,k_dim,gmres_functions, HYPRE_MEMORY_HOST); - s = hypre_CTAllocF(HYPRE_Real,k_dim,gmres_functions, HYPRE_MEMORY_HOST); + rs = hypre_CTAllocF(HYPRE_Real, k_dim + 1, gmres_functions, HYPRE_MEMORY_HOST); + c = hypre_CTAllocF(HYPRE_Real, k_dim, gmres_functions, HYPRE_MEMORY_HOST); + s = hypre_CTAllocF(HYPRE_Real, k_dim, gmres_functions, HYPRE_MEMORY_HOST); if (rel_change) { - rs_2 = hypre_CTAllocF(HYPRE_Real,k_dim+1,gmres_functions, HYPRE_MEMORY_HOST); + rs_2 = hypre_CTAllocF(HYPRE_Real, k_dim + 1, gmres_functions, HYPRE_MEMORY_HOST); } - hh = hypre_CTAllocF(HYPRE_Real*,k_dim+1,gmres_functions, HYPRE_MEMORY_HOST); - for (i=0; i < k_dim+1; i++) + hh = hypre_CTAllocF(HYPRE_Real*, k_dim + 1, gmres_functions, HYPRE_MEMORY_HOST); + for (i = 0; i < k_dim + 1; i++) { - hh[i] = hypre_CTAllocF(HYPRE_Real,k_dim,gmres_functions, HYPRE_MEMORY_HOST); + hh[i] = hypre_CTAllocF(HYPRE_Real, k_dim, gmres_functions, HYPRE_MEMORY_HOST); } - (*(gmres_functions->CopyVector))(b,p[0]); + (*(gmres_functions->CopyVector))(b, p[0]); /* compute initial residual */ - (*(gmres_functions->Matvec))(matvec_data,-1.0, A, x, 1.0, p[0]); + (*(gmres_functions->Matvec))(matvec_data, -1.0, A, x, 1.0, p[0]); - b_norm = sqrt((*(gmres_functions->InnerProd))(b,b)); + b_norm = hypre_sqrt((*(gmres_functions->InnerProd))(b, b)); real_r_norm_old = b_norm; - /* Since it is does not diminish performance, attempt to return an error flag + /* Since it does not diminish performance, attempt to return an error flag and notify users when they supply bad input. */ if (b_norm != 0.) { - ieee_check = b_norm/b_norm; /* INF -> NaN conversion */ + ieee_check = b_norm / b_norm; /* INF -> NaN conversion */ } if (ieee_check != ieee_check) { @@ -370,14 +391,14 @@ hypre_GMRESSolve(void *gmres_vdata, return hypre_error_flag; } - r_norm = sqrt((*(gmres_functions->InnerProd))(p[0],p[0])); + r_norm = hypre_sqrt((*(gmres_functions->InnerProd))(p[0], p[0])); r_norm_0 = r_norm; - /* Since it is does not diminish performance, attempt to return an error flag + /* Since it does not diminish performance, attempt to return an error flag and notify users when they supply bad input. */ if (r_norm != 0.) { - ieee_check = r_norm/r_norm; /* INF -> NaN conversion */ + ieee_check = r_norm / r_norm; /* INF -> NaN conversion */ } if (ieee_check != ieee_check) { @@ -400,10 +421,10 @@ hypre_GMRESSolve(void *gmres_vdata, return hypre_error_flag; } - if ( logging>0 || print_level > 0) + if ( logging > 0 || print_level > 0) { norms[0] = r_norm; - if ( print_level>1 && my_id == 0 ) + if ( print_level > 1 && my_id == 0 ) { hypre_printf("L2 norm of b: %e\n", b_norm); if (b_norm == 0.0) @@ -418,12 +439,12 @@ hypre_GMRESSolve(void *gmres_vdata, if (b_norm > 0.0) { /* convergence criterion |r_i|/|b| <= accuracy if |b| > 0 */ - den_norm= b_norm; + den_norm = b_norm; } else { /* convergence criterion |r_i|/|r0| <= accuracy if |b| = 0 */ - den_norm= r_norm; + den_norm = r_norm; } @@ -433,11 +454,11 @@ hypre_GMRESSolve(void *gmres_vdata, user specifies a_tol, or sets r_tol = 0.0, which means absolute tol only is checked */ - epsilon = hypre_max(a_tol,r_tol*den_norm); + epsilon = hypre_max(a_tol, r_tol * den_norm); /* so now our stop criteria is |r_i| <= epsilon */ - if ( print_level>1 && my_id == 0 ) + if ( print_level > 1 && my_id == 0 ) { if (b_norm > 0.0) { @@ -464,12 +485,13 @@ hypre_GMRESSolve(void *gmres_vdata, rs[0] = r_norm; if (r_norm == 0.0) { - hypre_TFreeF(c,gmres_functions); - hypre_TFreeF(s,gmres_functions); - hypre_TFreeF(rs,gmres_functions); - if (rel_change) hypre_TFreeF(rs_2,gmres_functions); - for (i=0; i < k_dim+1; i++) hypre_TFreeF(hh[i],gmres_functions); - hypre_TFreeF(hh,gmres_functions); + hypre_TFreeF(c, gmres_functions); + hypre_TFreeF(s, gmres_functions); + hypre_TFreeF(rs, gmres_functions); + if (rel_change) { hypre_TFreeF(rs_2, gmres_functions); } + for (i = 0; i < k_dim + 1; i++) { hypre_TFreeF(hh[i], gmres_functions); } + hypre_TFreeF(hh, gmres_functions); + (gmres_data -> num_iterations) = iter; HYPRE_ANNOTATE_FUNC_END; return hypre_error_flag; @@ -482,12 +504,12 @@ hypre_GMRESSolve(void *gmres_vdata, if (!rel_change) /* shouldn't exit after no iterations if * relative change is on*/ { - (*(gmres_functions->CopyVector))(b,r); - (*(gmres_functions->Matvec))(matvec_data,-1.0,A,x,1.0,r); - r_norm = sqrt((*(gmres_functions->InnerProd))(r,r)); + (*(gmres_functions->CopyVector))(b, r); + (*(gmres_functions->Matvec))(matvec_data, -1.0, A, x, 1.0, r); + r_norm = hypre_sqrt((*(gmres_functions->InnerProd))(r, r)); if (r_norm <= epsilon) { - if ( print_level>1 && my_id == 0) + if ( print_level > 1 && my_id == 0) { hypre_printf("\n\n"); hypre_printf("Final L2 norm of residual: %e\n\n", r_norm); @@ -496,7 +518,7 @@ hypre_GMRESSolve(void *gmres_vdata, } else { - if ( print_level>0 && my_id == 0) + if ( print_level > 0 && my_id == 0) { hypre_printf("false convergence 1\n"); } @@ -505,7 +527,7 @@ hypre_GMRESSolve(void *gmres_vdata, } t = 1.0 / r_norm; - (*(gmres_functions->ScaleVector))(t,p[0]); + (*(gmres_functions->ScaleVector))(t, p[0]); i = 0; /***RESTART CYCLE (right-preconditioning) ***/ @@ -514,61 +536,61 @@ hypre_GMRESSolve(void *gmres_vdata, i++; iter++; (*(gmres_functions->ClearVector))(r); - precond(precond_data, A, p[i-1], r); + precond(precond_data, A, p[i - 1], r); (*(gmres_functions->Matvec))(matvec_data, 1.0, A, r, 0.0, p[i]); /* modified Gram_Schmidt */ - for (j=0; j < i; j++) + for (j = 0; j < i; j++) { - hh[j][i-1] = (*(gmres_functions->InnerProd))(p[j],p[i]); - (*(gmres_functions->Axpy))(-hh[j][i-1],p[j],p[i]); + hh[j][i - 1] = (*(gmres_functions->InnerProd))(p[j], p[i]); + (*(gmres_functions->Axpy))(-hh[j][i - 1], p[j], p[i]); } - t = sqrt((*(gmres_functions->InnerProd))(p[i],p[i])); - hh[i][i-1] = t; + t = hypre_sqrt((*(gmres_functions->InnerProd))(p[i], p[i])); + hh[i][i - 1] = t; if (t != 0.0) { - t = 1.0/t; - (*(gmres_functions->ScaleVector))(t,p[i]); + t = 1.0 / t; + (*(gmres_functions->ScaleVector))(t, p[i]); } /* done with modified Gram_schmidt and Arnoldi step. update factorization of hh */ for (j = 1; j < i; j++) { - t = hh[j-1][i-1]; - hh[j-1][i-1] = s[j-1]*hh[j][i-1] + c[j-1]*t; - hh[j][i-1] = -s[j-1]*t + c[j-1]*hh[j][i-1]; + t = hh[j - 1][i - 1]; + hh[j - 1][i - 1] = s[j - 1] * hh[j][i - 1] + c[j - 1] * t; + hh[j][i - 1] = -s[j - 1] * t + c[j - 1] * hh[j][i - 1]; } - t= hh[i][i-1]*hh[i][i-1]; - t+= hh[i-1][i-1]*hh[i-1][i-1]; - gamma = sqrt(t); + t = hh[i][i - 1] * hh[i][i - 1]; + t += hh[i - 1][i - 1] * hh[i - 1][i - 1]; + gamma = hypre_sqrt(t); if (gamma == 0.0) { gamma = epsmac; } - c[i-1] = hh[i-1][i-1]/gamma; - s[i-1] = hh[i][i-1]/gamma; - rs[i] = -hh[i][i-1]*rs[i-1]; - rs[i]/= gamma; - rs[i-1] = c[i-1]*rs[i-1]; + c[i - 1] = hh[i - 1][i - 1] / gamma; + s[i - 1] = hh[i][i - 1] / gamma; + rs[i] = -hh[i][i - 1] * rs[i - 1]; + rs[i] /= gamma; + rs[i - 1] = c[i - 1] * rs[i - 1]; /* determine residual norm */ - hh[i-1][i-1] = s[i-1]*hh[i][i-1] + c[i-1]*hh[i-1][i-1]; - r_norm = fabs(rs[i]); + hh[i - 1][i - 1] = s[i - 1] * hh[i][i - 1] + c[i - 1] * hh[i - 1][i - 1]; + r_norm = hypre_abs(rs[i]); /* print ? */ - if ( print_level>0 ) + if ( print_level > 0 ) { norms[iter] = r_norm; - if ( print_level>1 && my_id == 0 ) + if ( print_level > 1 && my_id == 0 ) { if (b_norm > 0.0) { hypre_printf("% 5d %e %f %e\n", iter, - norms[iter],norms[iter]/norms[iter-1], - norms[iter]/b_norm); + norms[iter], norms[iter] / norms[iter - 1], + norms[iter] / b_norm); } else { hypre_printf("% 5d %e %f\n", iter, norms[iter], - norms[iter]/norms[iter-1]); + norms[iter] / norms[iter - 1]); } } } @@ -576,14 +598,14 @@ hypre_GMRESSolve(void *gmres_vdata, if (cf_tol > 0.0) { cf_ave_0 = cf_ave_1; - cf_ave_1 = pow( r_norm / r_norm_0, 1.0/(2.0*iter)); + cf_ave_1 = hypre_pow( r_norm / r_norm_0, 1.0 / (2.0 * iter)); - weight = fabs(cf_ave_1 - cf_ave_0); + weight = hypre_abs(cf_ave_1 - cf_ave_0); weight = weight / hypre_max(cf_ave_1, cf_ave_0); weight = 1.0 - weight; #if 0 hypre_printf("I = %d: cf_new = %e, cf_old = %e, weight = %e\n", - i, cf_ave_1, cf_ave_0, weight ); + i, cf_ave_1, cf_ave_0, weight ); #endif if (weight * cf_ave_1 > cf_tol) { @@ -610,28 +632,28 @@ hypre_GMRESSolve(void *gmres_vdata, Here we will check the relative here as we don't want to exit the restart cycle prematurely */ - for (k=0; k= 0; k--) + rs_2[i - 1] = rs_2[i - 1] / hh[i - 1][i - 1]; + for (k = i - 2; k >= 0; k--) { t = 0.0; - for (j = k+1; j < i; j++) + for (j = k + 1; j < i; j++) { - t -= hh[k][j]*rs_2[j]; + t -= hh[k][j] * rs_2[j]; } - t+= rs_2[k]; - rs_2[k] = t/hh[k][k]; + t += rs_2[k]; + rs_2[k] = t / hh[k][k]; } - (*(gmres_functions->CopyVector))(p[i-1],w); - (*(gmres_functions->ScaleVector))(rs_2[i-1],w); - for (j = i-2; j >=0; j--) + (*(gmres_functions->CopyVector))(p[i - 1], w); + (*(gmres_functions->ScaleVector))(rs_2[i - 1], w); + for (j = i - 2; j >= 0; j--) { (*(gmres_functions->Axpy))(rs_2[j], p[j], w); } @@ -639,17 +661,18 @@ hypre_GMRESSolve(void *gmres_vdata, /* find correction (in r) */ precond(precond_data, A, w, r); /* copy current solution (x) to w (don't want to over-write x)*/ - (*(gmres_functions->CopyVector))(x,w); + (*(gmres_functions->CopyVector))(x, w); /* add the correction */ - (*(gmres_functions->Axpy))(1.0,r,w); + (*(gmres_functions->Axpy))(1.0, r, w); /* now w is the approx solution - get the norm*/ - x_norm = sqrt( (*(gmres_functions->InnerProd))(w,w) ); + x_norm = hypre_sqrt( (*(gmres_functions->InnerProd))(w, w) ); if ( !(x_norm <= guard_zero_residual )) /* don't divide by zero */ - { /* now get x_i - x_i-1 */ + { + /* now get x_i - x_i-1 */ if (num_rel_change_check) { @@ -677,15 +700,15 @@ hypre_GMRESSolve(void *gmres_vdata, = M^{-1} rs_{i-1}{p_{i-1}} */ (*(gmres_functions->ClearVector))(w); - (*(gmres_functions->Axpy))(rs_2[i-1], p[i-1], w); + (*(gmres_functions->Axpy))(rs_2[i - 1], p[i - 1], w); (*(gmres_functions->ClearVector))(r); /* apply the preconditioner */ precond(precond_data, A, w, r); /* now r contains x_i - x_i-1 */ } /* find the norm of x_i - x_i-1 */ - w_norm = sqrt( (*(gmres_functions->InnerProd))(r,r) ); - relative_error = w_norm/x_norm; + w_norm = hypre_sqrt( (*(gmres_functions->InnerProd))(r, r) ); + relative_error = w_norm / x_norm; if (relative_error <= r_tol) { rel_change_passed = 1; @@ -714,29 +737,31 @@ hypre_GMRESSolve(void *gmres_vdata, break; } - rs[i-1] = rs[i-1]/hh[i-1][i-1]; - for (k = i-2; k >= 0; k--) + rs[i - 1] = rs[i - 1] / hh[i - 1][i - 1]; + for (k = i - 2; k >= 0; k--) { t = 0.0; - for (j = k+1; j < i; j++) + for (j = k + 1; j < i; j++) { - t -= hh[k][j]*rs[j]; + t -= hh[k][j] * rs[j]; } t += rs[k]; - rs[k] = t/hh[k][k]; + rs[k] = t / hh[k][k]; } - (*(gmres_functions->CopyVector))(p[i-1],w); - (*(gmres_functions->ScaleVector))(rs[i-1],w); - for (j = i-2; j >=0; j--) + (*(gmres_functions->CopyVector))(p[i - 1], w); + (*(gmres_functions->ScaleVector))(rs[i - 1], w); + for (j = i - 2; j >= 0; j--) + { (*(gmres_functions->Axpy))(rs[j], p[j], w); + } (*(gmres_functions->ClearVector))(r); /* find correction (in r) */ precond(precond_data, A, w, r); /* update current solution x (in x) */ - (*(gmres_functions->Axpy))(1.0,r,x); + (*(gmres_functions->Axpy))(1.0, r, x); /* check for convergence by evaluating the actual residual */ if (r_norm <= epsilon && iter >= min_iter) @@ -748,16 +773,16 @@ hypre_GMRESSolve(void *gmres_vdata, } /* calculate actual residual norm*/ - (*(gmres_functions->CopyVector))(b,r); - (*(gmres_functions->Matvec))(matvec_data,-1.0,A,x,1.0,r); - real_r_norm_new = r_norm = sqrt( (*(gmres_functions->InnerProd))(r,r) ); + (*(gmres_functions->CopyVector))(b, r); + (*(gmres_functions->Matvec))(matvec_data, -1.0, A, x, 1.0, r); + real_r_norm_new = r_norm = hypre_sqrt( (*(gmres_functions->InnerProd))(r, r) ); if (r_norm <= epsilon) { if (rel_change && !rel_change_passed) /* calculate the relative change */ { /* calculate the norm of the solution */ - x_norm = sqrt( (*(gmres_functions->InnerProd))(x,x) ); + x_norm = hypre_sqrt( (*(gmres_functions->InnerProd))(x, x) ); if ( !(x_norm <= guard_zero_residual )) /* don't divide by zero */ @@ -769,17 +794,17 @@ hypre_GMRESSolve(void *gmres_vdata, - {x + M^{-1}[sum{j=0..i-2} rs_j p_j ]} = M^{-1} rs_{i-1}{p_{i-1}} */ (*(gmres_functions->ClearVector))(w); - (*(gmres_functions->Axpy))(rs[i-1], p[i-1], w); + (*(gmres_functions->Axpy))(rs[i - 1], p[i - 1], w); (*(gmres_functions->ClearVector))(r); /* apply the preconditioner */ precond(precond_data, A, w, r); /* find the norm of x_i - x_i-1 */ - w_norm = sqrt( (*(gmres_functions->InnerProd))(r,r) ); - relative_error= w_norm/x_norm; + w_norm = hypre_sqrt( (*(gmres_functions->InnerProd))(r, r) ); + relative_error = w_norm / x_norm; if ( relative_error < r_tol ) { (gmres_data -> converged) = 1; - if ( print_level>1 && my_id == 0 ) + if ( print_level > 1 && my_id == 0 ) { hypre_printf("\n\n"); hypre_printf("Final L2 norm of residual: %e\n\n", r_norm); @@ -790,7 +815,7 @@ hypre_GMRESSolve(void *gmres_vdata, else { (gmres_data -> converged) = 1; - if ( print_level>1 && my_id == 0 ) + if ( print_level > 1 && my_id == 0 ) { hypre_printf("\n\n"); hypre_printf("Final L2 norm of residual: %e\n\n", r_norm); @@ -801,7 +826,7 @@ hypre_GMRESSolve(void *gmres_vdata, } else /* don't need to check rel. change */ { - if ( print_level>1 && my_id == 0 ) + if ( print_level > 1 && my_id == 0 ) { hypre_printf("\n\n"); hypre_printf("Final L2 norm of residual: %e\n\n", r_norm); @@ -825,36 +850,38 @@ hypre_GMRESSolve(void *gmres_vdata, } /* report discrepancy between real/GMRES residuals and restart */ - if ( print_level>0 && my_id == 0) + if ( print_level > 0 && my_id == 0) { hypre_printf("false convergence 2, L2 norm of residual: %e\n", r_norm); } - (*(gmres_functions->CopyVector))(r,p[0]); + (*(gmres_functions->CopyVector))(r, p[0]); i = 0; real_r_norm_old = real_r_norm_new; } } /* end of convergence check */ /* compute residual vector and continue loop */ - for (j=i ; j > 0; j--) + for (j = i ; j > 0; j--) { - rs[j-1] = -s[j-1]*rs[j]; - rs[j] = c[j-1]*rs[j]; + rs[j - 1] = -s[j - 1] * rs[j]; + rs[j] = c[j - 1] * rs[j]; } - if (i) (*(gmres_functions->Axpy))(rs[i]-1.0,p[i],p[i]); - for (j=i-1 ; j > 0; j--) - (*(gmres_functions->Axpy))(rs[j],p[j],p[i]); + if (i) { (*(gmres_functions->Axpy))(rs[i] - 1.0, p[i], p[i]); } + for (j = i - 1 ; j > 0; j--) + { + (*(gmres_functions->Axpy))(rs[j], p[j], p[i]); + } if (i) { - (*(gmres_functions->Axpy))(rs[0]-1.0,p[0],p[0]); - (*(gmres_functions->Axpy))(1.0,p[i],p[0]); + (*(gmres_functions->Axpy))(rs[0] - 1.0, p[0], p[0]); + (*(gmres_functions->Axpy))(1.0, p[i], p[0]); } } /* END of iteration while loop */ - if ( print_level>1 && my_id == 0 ) + if ( print_level > 1 && my_id == 0 ) { hypre_printf("\n\n"); } @@ -863,7 +890,7 @@ hypre_GMRESSolve(void *gmres_vdata, if (b_norm > 0.0) { - (gmres_data -> rel_residual_norm) = r_norm/b_norm; + (gmres_data -> rel_residual_norm) = r_norm / b_norm; } if (b_norm == 0.0) @@ -882,12 +909,12 @@ hypre_GMRESSolve(void *gmres_vdata, if (rel_change) { - hypre_TFreeF(rs_2,gmres_functions); + hypre_TFreeF(rs_2, gmres_functions); } - for (i=0; i < k_dim+1; i++) + for (i = 0; i < k_dim + 1; i++) { - hypre_TFreeF(hh[i],gmres_functions); + hypre_TFreeF(hh[i], gmres_functions); } hypre_TFreeF(hh, gmres_functions); @@ -905,7 +932,7 @@ HYPRE_Int hypre_GMRESSetKDim( void *gmres_vdata, HYPRE_Int k_dim ) { - hypre_GMRESData *gmres_data =(hypre_GMRESData *) gmres_vdata; + hypre_GMRESData *gmres_data = (hypre_GMRESData *) gmres_vdata; (gmres_data -> k_dim) = k_dim; @@ -1154,8 +1181,8 @@ hypre_GMRESGetStopCrit( void *gmres_vdata, HYPRE_Int hypre_GMRESSetPrecond( void *gmres_vdata, - HYPRE_Int (*precond)(void*,void*,void*,void*), - HYPRE_Int (*precond_setup)(void*,void*,void*,void*), + HYPRE_Int (*precond)(void*, void*, void*, void*), + HYPRE_Int (*precond_setup)(void*, void*, void*, void*), void *precond_data ) { hypre_GMRESData *gmres_data = (hypre_GMRESData *)gmres_vdata; diff --git a/external/hypre/src/krylov/gmres.h b/external/hypre/src/krylov/gmres.h index 89bb7e1d..3a77eb44 100644 --- a/external/hypre/src/krylov/gmres.h +++ b/external/hypre/src/krylov/gmres.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -102,7 +102,7 @@ typedef struct /* log info (always logged) */ HYPRE_Int num_iterations; - + HYPRE_Int print_level; /* printing when print_level>0 */ HYPRE_Int logging; /* extra computations for logging when logging>0 */ HYPRE_Real *norms; @@ -147,7 +147,7 @@ hypre_GMRESFunctionsCreate( HYPRE_Int (*Axpy) ( HYPRE_Complex alpha, void *x, void *y ), HYPRE_Int (*PrecondSetup) ( void *vdata, void *A, void *b, void *x ), HYPRE_Int (*Precond) ( void *vdata, void *A, void *b, void *x ) - ); +); /** * Description... diff --git a/external/hypre/src/krylov/headers b/external/hypre/src/krylov/headers deleted file mode 100644 index 3656b34f..00000000 --- a/external/hypre/src/krylov/headers +++ /dev/null @@ -1,76 +0,0 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other -# HYPRE Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -INTERNAL_HEADER=krylov.h - -#=========================================================================== -# Include guards and other includes -#=========================================================================== - -cat > $INTERNAL_HEADER <<@ - -#include "HYPRE_krylov.h" - -#ifndef hypre_KRYLOV_HEADER -#define hypre_KRYLOV_HEADER - -#include -#include -#include - -#include "_hypre_utilities.h" - -#define hypre_CTAllocF(type, count, funcs) \ -( (type *)(*(funcs->CAlloc))\ -((size_t)(count), (size_t)sizeof(type)) ) - -#define hypre_TFreeF( ptr, funcs ) \ -( (*(funcs->Free))((char *)ptr), ptr = NULL ) - -#ifdef __cplusplus -extern "C" { -#endif - -@ - -#=========================================================================== -# Structures and prototypes -#=========================================================================== - -cat bicgstab.h >> $INTERNAL_HEADER -cat cgnr.h >> $INTERNAL_HEADER -cat gmres.h >> $INTERNAL_HEADER -cat lgmres.h >> $INTERNAL_HEADER -cat flexgmres.h >> $INTERNAL_HEADER -cat pcg.h >> $INTERNAL_HEADER - -../utilities/protos bicgstab.c >> $INTERNAL_HEADER -../utilities/protos cgnr.c >> $INTERNAL_HEADER -../utilities/protos gmres.c >> $INTERNAL_HEADER -../utilities/protos flexgmres.c >> $INTERNAL_HEADER -../utilities/protos lgmres.c >> $INTERNAL_HEADER -../utilities/protos HYPRE_bicgstab.c >> $INTERNAL_HEADER -../utilities/protos HYPRE_cgnr.c >> $INTERNAL_HEADER -../utilities/protos HYPRE_gmres.c >> $INTERNAL_HEADER -../utilities/protos HYPRE_flexgmres.c >> $INTERNAL_HEADER -../utilities/protos HYPRE_lgmres.c >> $INTERNAL_HEADER -../utilities/protos HYPRE_pcg.c >> $INTERNAL_HEADER -../utilities/protos pcg.c >> $INTERNAL_HEADER - -#=========================================================================== -# Include guards -#=========================================================================== - -cat >> $INTERNAL_HEADER <<@ - -#ifdef __cplusplus -} -#endif - -#endif - -@ - diff --git a/external/hypre/src/krylov/krylov.h b/external/hypre/src/krylov/krylov.h index 2e017f15..03eeb124 100644 --- a/external/hypre/src/krylov/krylov.h +++ b/external/hypre/src/krylov/krylov.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -25,1584 +25,1641 @@ extern "C" { #endif - /****************************************************************************** - * - * BiCGSTAB bicgstab - * - *****************************************************************************/ +/****************************************************************************** + * + * BiCGSTAB bicgstab + * + *****************************************************************************/ #ifndef hypre_KRYLOV_BiCGSTAB_HEADER #define hypre_KRYLOV_BiCGSTAB_HEADER - /*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - - /** - * @name Generic BiCGSTAB Interface - * - * A general description of the interface goes here... - * - * @memo A generic BiCGSTAB linear solver interface - * @version 0.1 - * @author Jeffrey F. Painter - **/ - /*@{*/ - - /*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - - /*-------------------------------------------------------------------------- - * hypre_BiCGSTABData and hypre_BiCGSTABFunctions - *--------------------------------------------------------------------------*/ - - /** - * @name BiCGSTAB structs - * - * Description... - **/ - /*@{*/ - - /** - * The {\tt hypre\_BiCGSTABSFunctions} object ... - **/ - - /* functions in pcg_struct.c which aren't used here: - void *hypre_ParKrylovCAlloc( HYPRE_Int count , HYPRE_Int elt_size ); - HYPRE_Int hypre_ParKrylovFree( void *ptr ); - void *hypre_ParKrylovCreateVectorArray( HYPRE_Int n , void *vvector ); - HYPRE_Int hypre_ParKrylovMatvecT( void *matvec_data , HYPRE_Real alpha , void *A , void *x , HYPRE_Real beta , void *y ); - */ - /* functions in pcg_struct.c which are used here: - void *hypre_ParKrylovCreateVector( void *vvector ); - HYPRE_Int hypre_ParKrylovDestroyVector( void *vvector ); - void *hypre_ParKrylovMatvecCreate( void *A , void *x ); - HYPRE_Int hypre_ParKrylovMatvec( void *matvec_data , HYPRE_Real alpha , void *A , void *x , HYPRE_Real beta , void *y ); - HYPRE_Int hypre_ParKrylovMatvecDestroy( void *matvec_data ); - HYPRE_Real hypre_ParKrylovInnerProd( void *x , void *y ); - HYPRE_Int hypre_ParKrylovCopyVector( void *x , void *y ); - HYPRE_Int hypre_ParKrylovClearVector( void *x ); - HYPRE_Int hypre_ParKrylovScaleVector( HYPRE_Real alpha , void *x ); - HYPRE_Int hypre_ParKrylovAxpy( HYPRE_Real alpha , void *x , void *y ); - HYPRE_Int hypre_ParKrylovCommInfo( void *A , HYPRE_Int *my_id , HYPRE_Int *num_procs ); - HYPRE_Int hypre_ParKrylovIdentitySetup( void *vdata , void *A , void *b , void *x ); - HYPRE_Int hypre_ParKrylovIdentity( void *vdata , void *A , void *b , void *x ); - */ - - typedef struct - { - void * (*CreateVector) ( void *vvector ); - HYPRE_Int (*DestroyVector) ( void *vvector ); - void * (*MatvecCreate) ( void *A , void *x ); - HYPRE_Int (*Matvec) ( void *matvec_data , HYPRE_Complex alpha , void *A , - void *x , HYPRE_Complex beta , void *y ); - HYPRE_Int (*MatvecDestroy) ( void *matvec_data ); - HYPRE_Real (*InnerProd) ( void *x , void *y ); - HYPRE_Int (*CopyVector) ( void *x , void *y ); - HYPRE_Int (*ClearVector) ( void *x ); - HYPRE_Int (*ScaleVector) ( HYPRE_Complex alpha , void *x ); - HYPRE_Int (*Axpy) ( HYPRE_Complex alpha , void *x , void *y ); - HYPRE_Int (*CommInfo) ( void *A , HYPRE_Int *my_id , HYPRE_Int *num_procs ); - HYPRE_Int (*precond_setup) (void *vdata , void *A , void *b , void *x); - HYPRE_Int (*precond) (void *vdata , void *A , void *b , void *x); - - } hypre_BiCGSTABFunctions; - - /** - * The {\tt hypre\_BiCGSTABData} object ... - **/ - - typedef struct - { - HYPRE_Int min_iter; - HYPRE_Int max_iter; - HYPRE_Int stop_crit; - HYPRE_Int converged; - HYPRE_Int hybrid; - HYPRE_Real tol; - HYPRE_Real cf_tol; - HYPRE_Real rel_residual_norm; - HYPRE_Real a_tol; - - - void *A; - void *r; - void *r0; - void *s; - void *v; - void *p; - void *q; - - void *matvec_data; - void *precond_data; - - hypre_BiCGSTABFunctions * functions; - - /* log info (always logged) */ - HYPRE_Int num_iterations; - - /* additional log info (logged when `logging' > 0) */ - HYPRE_Int logging; - HYPRE_Int print_level; - HYPRE_Real *norms; - char *log_file_name; - - } hypre_BiCGSTABData; +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +/** + * @name Generic BiCGSTAB Interface + * + * A general description of the interface goes here... + * + * @memo A generic BiCGSTAB linear solver interface + * @version 0.1 + * @author Jeffrey F. Painter + **/ +/*@{*/ + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +/*-------------------------------------------------------------------------- + * hypre_BiCGSTABData and hypre_BiCGSTABFunctions + *--------------------------------------------------------------------------*/ + +/** + * @name BiCGSTAB structs + * + * Description... + **/ +/*@{*/ + +/** + * The {\tt hypre\_BiCGSTABSFunctions} object ... + **/ + +/* functions in pcg_struct.c which aren't used here: + void *hypre_ParKrylovCAlloc( HYPRE_Int count , HYPRE_Int elt_size ); + HYPRE_Int hypre_ParKrylovFree( void *ptr ); + void *hypre_ParKrylovCreateVectorArray( HYPRE_Int n , void *vvector ); + HYPRE_Int hypre_ParKrylovMatvecT( void *matvec_data , HYPRE_Real alpha , void *A , void *x , HYPRE_Real beta , void *y ); + */ +/* functions in pcg_struct.c which are used here: + void *hypre_ParKrylovCreateVector( void *vvector ); + HYPRE_Int hypre_ParKrylovDestroyVector( void *vvector ); + void *hypre_ParKrylovMatvecCreate( void *A , void *x ); + HYPRE_Int hypre_ParKrylovMatvec( void *matvec_data , HYPRE_Real alpha , void *A , void *x , HYPRE_Real beta , void *y ); + HYPRE_Int hypre_ParKrylovMatvecDestroy( void *matvec_data ); + HYPRE_Real hypre_ParKrylovInnerProd( void *x , void *y ); + HYPRE_Int hypre_ParKrylovCopyVector( void *x , void *y ); + HYPRE_Int hypre_ParKrylovClearVector( void *x ); + HYPRE_Int hypre_ParKrylovScaleVector( HYPRE_Real alpha , void *x ); + HYPRE_Int hypre_ParKrylovAxpy( HYPRE_Real alpha , void *x , void *y ); + HYPRE_Int hypre_ParKrylovCommInfo( void *A , HYPRE_Int *my_id , HYPRE_Int *num_procs ); + HYPRE_Int hypre_ParKrylovIdentitySetup( void *vdata , void *A , void *b , void *x ); + HYPRE_Int hypre_ParKrylovIdentity( void *vdata , void *A , void *b , void *x ); + */ + +typedef struct +{ + void * (*CreateVector) ( void *vvector ); + HYPRE_Int (*DestroyVector) ( void *vvector ); + void * (*MatvecCreate) ( void *A, void *x ); + HYPRE_Int (*Matvec) ( void *matvec_data, HYPRE_Complex alpha, void *A, + void *x, HYPRE_Complex beta, void *y ); + HYPRE_Int (*MatvecDestroy) ( void *matvec_data ); + HYPRE_Real (*InnerProd) ( void *x, void *y ); + HYPRE_Int (*CopyVector) ( void *x, void *y ); + HYPRE_Int (*ClearVector) ( void *x ); + HYPRE_Int (*ScaleVector) ( HYPRE_Complex alpha, void *x ); + HYPRE_Int (*Axpy) ( HYPRE_Complex alpha, void *x, void *y ); + HYPRE_Int (*CommInfo) ( void *A, HYPRE_Int *my_id, HYPRE_Int *num_procs ); + HYPRE_Int (*precond_setup) (void *vdata, void *A, void *b, void *x); + HYPRE_Int (*precond) (void *vdata, void *A, void *b, void *x); + +} hypre_BiCGSTABFunctions; + +/** + * The {\tt hypre\_BiCGSTABData} object ... + **/ + +typedef struct +{ + HYPRE_Int min_iter; + HYPRE_Int max_iter; + HYPRE_Int stop_crit; + HYPRE_Int converged; + HYPRE_Int hybrid; + HYPRE_Real tol; + HYPRE_Real cf_tol; + HYPRE_Real rel_residual_norm; + HYPRE_Real a_tol; + + + void *A; + void *r; + void *r0; + void *s; + void *v; + void *p; + void *q; + + void *matvec_data; + void *precond_data; + + hypre_BiCGSTABFunctions * functions; + + /* log info (always logged) */ + HYPRE_Int num_iterations; + + /* additional log info (logged when `logging' > 0) */ + HYPRE_Int logging; + HYPRE_Int print_level; + HYPRE_Real *norms; + char *log_file_name; + +} hypre_BiCGSTABData; #define hypre_BiCGSTABDataHybrid(pcgdata) ((pcgdata) -> hybrid) #ifdef __cplusplus - extern "C" { +extern "C" { #endif - /** - * @name generic BiCGSTAB Solver - * - * Description... - **/ - /*@{*/ - - /** - * Description... - * - * @param param [IN] ... - **/ - - hypre_BiCGSTABFunctions * - hypre_BiCGSTABFunctionsCreate( - void * (*CreateVector) ( void *vvector ), - HYPRE_Int (*DestroyVector) ( void *vvector ), - void * (*MatvecCreate) ( void *A , void *x ), - HYPRE_Int (*Matvec) ( void *matvec_data , HYPRE_Complex alpha , void *A , - void *x , HYPRE_Complex beta , void *y ), - HYPRE_Int (*MatvecDestroy) ( void *matvec_data ), - HYPRE_Real (*InnerProd) ( void *x , void *y ), - HYPRE_Int (*CopyVector) ( void *x , void *y ), - HYPRE_Int (*ClearVector) ( void *x ), - HYPRE_Int (*ScaleVector) ( HYPRE_Complex alpha , void *x ), - HYPRE_Int (*Axpy) ( HYPRE_Complex alpha , void *x , void *y ), - HYPRE_Int (*CommInfo) ( void *A , HYPRE_Int *my_id , - HYPRE_Int *num_procs ), - HYPRE_Int (*PrecondSetup) ( void *vdata, void *A, void *b, void *x ), - HYPRE_Int (*Precond) ( void *vdata, void *A, void *b, void *x ) - ); - - /** - * Description... - * - * @param param [IN] ... - **/ - - void * - hypre_BiCGSTABCreate( hypre_BiCGSTABFunctions * bicgstab_functions ); + /** + * @name generic BiCGSTAB Solver + * + * Description... + **/ + /*@{*/ + + /** + * Description... + * + * @param param [IN] ... + **/ + + hypre_BiCGSTABFunctions * + hypre_BiCGSTABFunctionsCreate( + void * (*CreateVector) ( void *vvector ), + HYPRE_Int (*DestroyVector) ( void *vvector ), + void * (*MatvecCreate) ( void *A, void *x ), + HYPRE_Int (*Matvec) ( void *matvec_data, HYPRE_Complex alpha, void *A, + void *x, HYPRE_Complex beta, void *y ), + HYPRE_Int (*MatvecDestroy) ( void *matvec_data ), + HYPRE_Real (*InnerProd) ( void *x, void *y ), + HYPRE_Int (*CopyVector) ( void *x, void *y ), + HYPRE_Int (*ClearVector) ( void *x ), + HYPRE_Int (*ScaleVector) ( HYPRE_Complex alpha, void *x ), + HYPRE_Int (*Axpy) ( HYPRE_Complex alpha, void *x, void *y ), + HYPRE_Int (*CommInfo) ( void *A, HYPRE_Int *my_id, + HYPRE_Int *num_procs ), + HYPRE_Int (*PrecondSetup) ( void *vdata, void *A, void *b, void *x ), + HYPRE_Int (*Precond) ( void *vdata, void *A, void *b, void *x ) + ); + + /** + * Description... + * + * @param param [IN] ... + **/ + + void * + hypre_BiCGSTABCreate( hypre_BiCGSTABFunctions * bicgstab_functions ); #ifdef __cplusplus - } +} #endif #endif - /****************************************************************************** - * - * cgnr (conjugate gradient on the normal equations A^TAx = A^Tb) functions - * - *****************************************************************************/ +/****************************************************************************** + * + * cgnr (conjugate gradient on the normal equations A^TAx = A^Tb) functions + * + *****************************************************************************/ #ifndef hypre_KRYLOV_CGNR_HEADER #define hypre_KRYLOV_CGNR_HEADER - /*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - - /** - * @name Generic CGNR Interface - * - * A general description of the interface goes here... - * - * @memo A generic CGNR linear solver interface - * @version 0.1 - * @author Jeffrey F. Painter - **/ - /*@{*/ - - /*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - - /*-------------------------------------------------------------------------- - * hypre_CGNRData and hypre_CGNRFunctions - *--------------------------------------------------------------------------*/ - - /** - * @name CGNR structs - * - * Description... - **/ - /*@{*/ - - /** - * The {\tt hypre\_CGNRSFunctions} object ... - **/ - - typedef struct - { - HYPRE_Int (*CommInfo) ( void *A, HYPRE_Int *my_id, - HYPRE_Int *num_procs ); - void * (*CreateVector) ( void *vector ); - HYPRE_Int (*DestroyVector) ( void *vector ); - void * (*MatvecCreate) ( void *A, void *x ); - HYPRE_Int (*Matvec) ( void *matvec_data, HYPRE_Complex alpha, void *A, - void *x, HYPRE_Complex beta, void *y ); - HYPRE_Int (*MatvecT) ( void *matvec_data, HYPRE_Complex alpha, void *A, - void *x, HYPRE_Complex beta, void *y ); - HYPRE_Int (*MatvecDestroy) ( void *matvec_data ); - HYPRE_Real (*InnerProd) ( void *x, void *y ); - HYPRE_Int (*CopyVector) ( void *x, void *y ); - HYPRE_Int (*ClearVector) ( void *x ); - HYPRE_Int (*ScaleVector) ( HYPRE_Complex alpha, void *x ); - HYPRE_Int (*Axpy) ( HYPRE_Complex alpha, void *x, void *y ); - HYPRE_Int (*precond_setup) ( void *vdata, void *A, void *b, void *x ); - HYPRE_Int (*precond) ( void *vdata, void *A, void *b, void *x ); - HYPRE_Int (*precondT) ( void *vdata, void *A, void *b, void *x ); - - } hypre_CGNRFunctions; - - /** - * The {\tt hypre\_CGNRData} object ... - **/ - - typedef struct - { - HYPRE_Real tol; - HYPRE_Real rel_residual_norm; - HYPRE_Int min_iter; - HYPRE_Int max_iter; - HYPRE_Int stop_crit; - - void *A; - void *p; - void *q; - void *r; - void *t; - - void *matvec_data; - void *precond_data; - - hypre_CGNRFunctions * functions; - - /* log info (always logged) */ - HYPRE_Int num_iterations; - - /* additional log info (logged when `logging' > 0) */ - HYPRE_Int logging; - HYPRE_Real *norms; - char *log_file_name; - - } hypre_CGNRData; +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +/** + * @name Generic CGNR Interface + * + * A general description of the interface goes here... + * + * @memo A generic CGNR linear solver interface + * @version 0.1 + * @author Jeffrey F. Painter + **/ +/*@{*/ + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +/*-------------------------------------------------------------------------- + * hypre_CGNRData and hypre_CGNRFunctions + *--------------------------------------------------------------------------*/ + +/** + * @name CGNR structs + * + * Description... + **/ +/*@{*/ + +/** + * The {\tt hypre\_CGNRSFunctions} object ... + **/ + +typedef struct +{ + HYPRE_Int (*CommInfo) ( void *A, HYPRE_Int *my_id, + HYPRE_Int *num_procs ); + void * (*CreateVector) ( void *vector ); + HYPRE_Int (*DestroyVector) ( void *vector ); + void * (*MatvecCreate) ( void *A, void *x ); + HYPRE_Int (*Matvec) ( void *matvec_data, HYPRE_Complex alpha, void *A, + void *x, HYPRE_Complex beta, void *y ); + HYPRE_Int (*MatvecT) ( void *matvec_data, HYPRE_Complex alpha, void *A, + void *x, HYPRE_Complex beta, void *y ); + HYPRE_Int (*MatvecDestroy) ( void *matvec_data ); + HYPRE_Real (*InnerProd) ( void *x, void *y ); + HYPRE_Int (*CopyVector) ( void *x, void *y ); + HYPRE_Int (*ClearVector) ( void *x ); + HYPRE_Int (*ScaleVector) ( HYPRE_Complex alpha, void *x ); + HYPRE_Int (*Axpy) ( HYPRE_Complex alpha, void *x, void *y ); + HYPRE_Int (*precond_setup) ( void *vdata, void *A, void *b, void *x ); + HYPRE_Int (*precond) ( void *vdata, void *A, void *b, void *x ); + HYPRE_Int (*precondT) ( void *vdata, void *A, void *b, void *x ); + +} hypre_CGNRFunctions; + +/** + * The {\tt hypre\_CGNRData} object ... + **/ + +typedef struct +{ + HYPRE_Real tol; + HYPRE_Real rel_residual_norm; + HYPRE_Int min_iter; + HYPRE_Int max_iter; + HYPRE_Int stop_crit; + + void *A; + void *p; + void *q; + void *r; + void *t; + + void *matvec_data; + void *precond_data; + + hypre_CGNRFunctions * functions; + + /* log info (always logged) */ + HYPRE_Int num_iterations; + + /* additional log info (logged when `logging' > 0) */ + HYPRE_Int logging; + HYPRE_Real *norms; + char *log_file_name; + +} hypre_CGNRData; #ifdef __cplusplus - extern "C" { +extern "C" { #endif - /** - * @name generic CGNR Solver - * - * Description... - **/ - /*@{*/ - - /** - * Description... - * - * @param param [IN] ... - **/ - hypre_CGNRFunctions * - hypre_CGNRFunctionsCreate( - HYPRE_Int (*CommInfo) ( void *A, HYPRE_Int *my_id, - HYPRE_Int *num_procs ), - void * (*CreateVector) ( void *vector ), - HYPRE_Int (*DestroyVector) ( void *vector ), - void * (*MatvecCreate) ( void *A, void *x ), - HYPRE_Int (*Matvec) ( void *matvec_data, HYPRE_Complex alpha, void *A, - void *x, HYPRE_Complex beta, void *y ), - HYPRE_Int (*MatvecT) ( void *matvec_data, HYPRE_Complex alpha, void *A, - void *x, HYPRE_Complex beta, void *y ), - HYPRE_Int (*MatvecDestroy) ( void *matvec_data ), - HYPRE_Real (*InnerProd) ( void *x, void *y ), - HYPRE_Int (*CopyVector) ( void *x, void *y ), - HYPRE_Int (*ClearVector) ( void *x ), - HYPRE_Int (*ScaleVector) ( HYPRE_Complex alpha, void *x ), - HYPRE_Int (*Axpy) ( HYPRE_Complex alpha, void *x, void *y ), - HYPRE_Int (*PrecondSetup) ( void *vdata, void *A, void *b, void *x ), - HYPRE_Int (*Precond) ( void *vdata, void *A, void *b, void *x ), - HYPRE_Int (*PrecondT) ( void *vdata, void *A, void *b, void *x ) - ); - - /** - * Description... - * - * @param param [IN] ... - **/ - - void * - hypre_CGNRCreate( hypre_CGNRFunctions *cgnr_functions ); + /** + * @name generic CGNR Solver + * + * Description... + **/ + /*@{*/ + + /** + * Description... + * + * @param param [IN] ... + **/ + hypre_CGNRFunctions * + hypre_CGNRFunctionsCreate( + HYPRE_Int (*CommInfo) ( void *A, HYPRE_Int *my_id, + HYPRE_Int *num_procs ), + void * (*CreateVector) ( void *vector ), + HYPRE_Int (*DestroyVector) ( void *vector ), + void * (*MatvecCreate) ( void *A, void *x ), + HYPRE_Int (*Matvec) ( void *matvec_data, HYPRE_Complex alpha, void *A, + void *x, HYPRE_Complex beta, void *y ), + HYPRE_Int (*MatvecT) ( void *matvec_data, HYPRE_Complex alpha, void *A, + void *x, HYPRE_Complex beta, void *y ), + HYPRE_Int (*MatvecDestroy) ( void *matvec_data ), + HYPRE_Real (*InnerProd) ( void *x, void *y ), + HYPRE_Int (*CopyVector) ( void *x, void *y ), + HYPRE_Int (*ClearVector) ( void *x ), + HYPRE_Int (*ScaleVector) ( HYPRE_Complex alpha, void *x ), + HYPRE_Int (*Axpy) ( HYPRE_Complex alpha, void *x, void *y ), + HYPRE_Int (*PrecondSetup) ( void *vdata, void *A, void *b, void *x ), + HYPRE_Int (*Precond) ( void *vdata, void *A, void *b, void *x ), + HYPRE_Int (*PrecondT) ( void *vdata, void *A, void *b, void *x ) + ); + + /** + * Description... + * + * @param param [IN] ... + **/ + + void * + hypre_CGNRCreate( hypre_CGNRFunctions *cgnr_functions ); #ifdef __cplusplus - } +} #endif #endif - /****************************************************************************** - * - * GMRES gmres - * - *****************************************************************************/ +/****************************************************************************** + * + * GMRES gmres + * + *****************************************************************************/ #ifndef hypre_KRYLOV_GMRES_HEADER #define hypre_KRYLOV_GMRES_HEADER - /*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - - /** - * @name Generic GMRES Interface - * - * A general description of the interface goes here... - * - * @memo A generic GMRES linear solver interface - * @version 0.1 - * @author Jeffrey F. Painter - **/ - /*@{*/ - - /*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - - /*-------------------------------------------------------------------------- - * hypre_GMRESData and hypre_GMRESFunctions - *--------------------------------------------------------------------------*/ - - /** - * @name GMRES structs - * - * Description... - **/ - /*@{*/ - - /** - * The {\tt hypre\_GMRESFunctions} object ... - **/ - - typedef struct - { - void * (*CAlloc) ( size_t count, size_t elt_size, HYPRE_MemoryLocation location ); - HYPRE_Int (*Free) ( void *ptr ); - HYPRE_Int (*CommInfo) ( void *A, HYPRE_Int *my_id, - HYPRE_Int *num_procs ); - void * (*CreateVector) ( void *vector ); - void * (*CreateVectorArray) ( HYPRE_Int size, void *vectors ); - HYPRE_Int (*DestroyVector) ( void *vector ); - void * (*MatvecCreate) ( void *A, void *x ); - HYPRE_Int (*Matvec) ( void *matvec_data, HYPRE_Complex alpha, void *A, - void *x, HYPRE_Complex beta, void *y ); - HYPRE_Int (*MatvecDestroy) ( void *matvec_data ); - HYPRE_Real (*InnerProd) ( void *x, void *y ); - HYPRE_Int (*CopyVector) ( void *x, void *y ); - HYPRE_Int (*ClearVector) ( void *x ); - HYPRE_Int (*ScaleVector) ( HYPRE_Complex alpha, void *x ); - HYPRE_Int (*Axpy) ( HYPRE_Complex alpha, void *x, void *y ); - - HYPRE_Int (*precond) (void *vdata , void *A , void *b , void *x); - HYPRE_Int (*precond_setup) (void *vdata , void *A , void *b , void *x); - - } hypre_GMRESFunctions; - - /** - * The {\tt hypre\_GMRESData} object ... - **/ - - typedef struct - { - HYPRE_Int k_dim; - HYPRE_Int min_iter; - HYPRE_Int max_iter; - HYPRE_Int rel_change; - HYPRE_Int skip_real_r_check; - HYPRE_Int stop_crit; - HYPRE_Int converged; - HYPRE_Int hybrid; - HYPRE_Real tol; - HYPRE_Real cf_tol; - HYPRE_Real a_tol; - HYPRE_Real rel_residual_norm; - - void *A; - void *r; - void *w; - void *w_2; - void **p; - - void *matvec_data; - void *precond_data; - - hypre_GMRESFunctions * functions; - - /* log info (always logged) */ - HYPRE_Int num_iterations; - - HYPRE_Int print_level; /* printing when print_level>0 */ - HYPRE_Int logging; /* extra computations for logging when logging>0 */ - HYPRE_Real *norms; - char *log_file_name; - - } hypre_GMRESData; +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +/** + * @name Generic GMRES Interface + * + * A general description of the interface goes here... + * + * @memo A generic GMRES linear solver interface + * @version 0.1 + * @author Jeffrey F. Painter + **/ +/*@{*/ + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +/*-------------------------------------------------------------------------- + * hypre_GMRESData and hypre_GMRESFunctions + *--------------------------------------------------------------------------*/ + +/** + * @name GMRES structs + * + * Description... + **/ +/*@{*/ + +/** + * The {\tt hypre\_GMRESFunctions} object ... + **/ + +typedef struct +{ + void * (*CAlloc) ( size_t count, size_t elt_size, HYPRE_MemoryLocation location ); + HYPRE_Int (*Free) ( void *ptr ); + HYPRE_Int (*CommInfo) ( void *A, HYPRE_Int *my_id, + HYPRE_Int *num_procs ); + void * (*CreateVector) ( void *vector ); + void * (*CreateVectorArray) ( HYPRE_Int size, void *vectors ); + HYPRE_Int (*DestroyVector) ( void *vector ); + void * (*MatvecCreate) ( void *A, void *x ); + HYPRE_Int (*Matvec) ( void *matvec_data, HYPRE_Complex alpha, void *A, + void *x, HYPRE_Complex beta, void *y ); + HYPRE_Int (*MatvecDestroy) ( void *matvec_data ); + HYPRE_Real (*InnerProd) ( void *x, void *y ); + HYPRE_Int (*CopyVector) ( void *x, void *y ); + HYPRE_Int (*ClearVector) ( void *x ); + HYPRE_Int (*ScaleVector) ( HYPRE_Complex alpha, void *x ); + HYPRE_Int (*Axpy) ( HYPRE_Complex alpha, void *x, void *y ); + + HYPRE_Int (*precond) (void *vdata, void *A, void *b, void *x); + HYPRE_Int (*precond_setup) (void *vdata, void *A, void *b, void *x); + +} hypre_GMRESFunctions; + +/** + * The {\tt hypre\_GMRESData} object ... + **/ + +typedef struct +{ + HYPRE_Int k_dim; + HYPRE_Int min_iter; + HYPRE_Int max_iter; + HYPRE_Int rel_change; + HYPRE_Int skip_real_r_check; + HYPRE_Int stop_crit; + HYPRE_Int converged; + HYPRE_Int hybrid; + HYPRE_Real tol; + HYPRE_Real cf_tol; + HYPRE_Real a_tol; + HYPRE_Real rel_residual_norm; + + void *A; + void *r; + void *w; + void *w_2; + void **p; + + void *matvec_data; + void *precond_data; + + hypre_GMRESFunctions * functions; + + /* log info (always logged) */ + HYPRE_Int num_iterations; + + HYPRE_Int print_level; /* printing when print_level>0 */ + HYPRE_Int logging; /* extra computations for logging when logging>0 */ + HYPRE_Real *norms; + char *log_file_name; + +} hypre_GMRESData; #define hypre_GMRESDataHybrid(pcgdata) ((pcgdata) -> hybrid) #ifdef __cplusplus - extern "C" { +extern "C" { #endif - /** - * @name generic GMRES Solver - * - * Description... - **/ - /*@{*/ - - /** - * Description... - * - * @param param [IN] ... - **/ - - hypre_GMRESFunctions * - hypre_GMRESFunctionsCreate( - void * (*CAlloc) ( size_t count, size_t elt_size, HYPRE_MemoryLocation location ), - HYPRE_Int (*Free) ( void *ptr ), - HYPRE_Int (*CommInfo) ( void *A, HYPRE_Int *my_id, - HYPRE_Int *num_procs ), - void * (*CreateVector) ( void *vector ), - void * (*CreateVectorArray) ( HYPRE_Int size, void *vectors ), - HYPRE_Int (*DestroyVector) ( void *vector ), - void * (*MatvecCreate) ( void *A, void *x ), - HYPRE_Int (*Matvec) ( void *matvec_data, HYPRE_Complex alpha, void *A, - void *x, HYPRE_Complex beta, void *y ), - HYPRE_Int (*MatvecDestroy) ( void *matvec_data ), - HYPRE_Real (*InnerProd) ( void *x, void *y ), - HYPRE_Int (*CopyVector) ( void *x, void *y ), - HYPRE_Int (*ClearVector) ( void *x ), - HYPRE_Int (*ScaleVector) ( HYPRE_Complex alpha, void *x ), - HYPRE_Int (*Axpy) ( HYPRE_Complex alpha, void *x, void *y ), - HYPRE_Int (*PrecondSetup) ( void *vdata, void *A, void *b, void *x ), - HYPRE_Int (*Precond) ( void *vdata, void *A, void *b, void *x ) - ); - - /** - * Description... - * - * @param param [IN] ... - **/ - - void * - hypre_GMRESCreate( hypre_GMRESFunctions *gmres_functions ); + /** + * @name generic GMRES Solver + * + * Description... + **/ + /*@{*/ + + /** + * Description... + * + * @param param [IN] ... + **/ + + hypre_GMRESFunctions * + hypre_GMRESFunctionsCreate( + void * (*CAlloc) ( size_t count, size_t elt_size, HYPRE_MemoryLocation location ), + HYPRE_Int (*Free) ( void *ptr ), + HYPRE_Int (*CommInfo) ( void *A, HYPRE_Int *my_id, + HYPRE_Int *num_procs ), + void * (*CreateVector) ( void *vector ), + void * (*CreateVectorArray) ( HYPRE_Int size, void *vectors ), + HYPRE_Int (*DestroyVector) ( void *vector ), + void * (*MatvecCreate) ( void *A, void *x ), + HYPRE_Int (*Matvec) ( void *matvec_data, HYPRE_Complex alpha, void *A, + void *x, HYPRE_Complex beta, void *y ), + HYPRE_Int (*MatvecDestroy) ( void *matvec_data ), + HYPRE_Real (*InnerProd) ( void *x, void *y ), + HYPRE_Int (*CopyVector) ( void *x, void *y ), + HYPRE_Int (*ClearVector) ( void *x ), + HYPRE_Int (*ScaleVector) ( HYPRE_Complex alpha, void *x ), + HYPRE_Int (*Axpy) ( HYPRE_Complex alpha, void *x, void *y ), + HYPRE_Int (*PrecondSetup) ( void *vdata, void *A, void *b, void *x ), + HYPRE_Int (*Precond) ( void *vdata, void *A, void *b, void *x ) + ); + + /** + * Description... + * + * @param param [IN] ... + **/ + + void * + hypre_GMRESCreate( hypre_GMRESFunctions *gmres_functions ); #ifdef __cplusplus - } +} #endif #endif - /***********KS code ****************/ - /****************************************************************************** - * - * COGMRES cogmres - * - *****************************************************************************/ +/***********KS code ****************/ +/****************************************************************************** + * + * COGMRES cogmres + * + *****************************************************************************/ #ifndef hypre_KRYLOV_COGMRES_HEADER #define hypre_KRYLOV_COGMRES_HEADER - /*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - - /** - * @name Generic GMRES Interface - * - * A general description of the interface goes here... - * - * @memo A generic GMRES linear solver interface - * @version 0.1 - * @author Jeffrey F. Painter - **/ - /*@{*/ - - /*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - - /*-------------------------------------------------------------------------- - * hypre_COGMRESData and hypre_COGMRESFunctions - *--------------------------------------------------------------------------*/ - - /** - * @name GMRES structs - * - * Description... - **/ - /*@{*/ - - /** - * The {\tt hypre\_GMRESFunctions} object ... - **/ - - typedef struct - { - void * (*CAlloc) ( size_t count, size_t elt_size, HYPRE_MemoryLocation location ); - HYPRE_Int (*Free) ( void *ptr ); - HYPRE_Int (*CommInfo) ( void *A, HYPRE_Int *my_id, - HYPRE_Int *num_procs ); - void * (*CreateVector) ( void *vector ); - void * (*CreateVectorArray) ( HYPRE_Int size, void *vectors ); - HYPRE_Int (*DestroyVector) ( void *vector ); - void * (*MatvecCreate) ( void *A, void *x ); - HYPRE_Int (*Matvec) ( void *matvec_data, HYPRE_Complex alpha, void *A, - void *x, HYPRE_Complex beta, void *y ); - HYPRE_Int (*MatvecDestroy) ( void *matvec_data ); - HYPRE_Real (*InnerProd) ( void *x, void *y ); - HYPRE_Int (*MassInnerProd) ( void *x, void **p, HYPRE_Int k, HYPRE_Int unroll, void *result); - HYPRE_Int (*MassDotpTwo) ( void *x, void *y, void **p, HYPRE_Int k, HYPRE_Int unroll, void *result_x, void *result_y); - HYPRE_Int (*CopyVector) ( void *x, void *y ); - HYPRE_Int (*ClearVector) ( void *x ); - HYPRE_Int (*ScaleVector) ( HYPRE_Complex alpha, void *x ); - HYPRE_Int (*Axpy) ( HYPRE_Complex alpha, void *x, void *y ); - HYPRE_Int (*MassAxpy) ( HYPRE_Complex * alpha, void **x, void *y, HYPRE_Int k, HYPRE_Int unroll); - HYPRE_Int (*precond) (void *vdata , void *A , void *b , void *x); - HYPRE_Int (*precond_setup) (void *vdata , void *A , void *b , void *x); - - HYPRE_Int (*modify_pc)( void *precond_data, HYPRE_Int iteration, HYPRE_Real rel_residual_norm); - - - } hypre_COGMRESFunctions; - - /** - * The {\tt hypre\_GMRESData} object ... - **/ - - typedef struct - { - HYPRE_Int k_dim; - HYPRE_Int unroll; - HYPRE_Int cgs; - HYPRE_Int min_iter; - HYPRE_Int max_iter; - HYPRE_Int rel_change; - HYPRE_Int skip_real_r_check; - HYPRE_Int stop_crit; - HYPRE_Int converged; - HYPRE_Real tol; - HYPRE_Real cf_tol; - HYPRE_Real a_tol; - HYPRE_Real rel_residual_norm; - - void *A; - void *r; - void *w; - void *w_2; - void **p; - - void *matvec_data; - void *precond_data; - - hypre_COGMRESFunctions * functions; - - /* log info (always logged) */ - HYPRE_Int num_iterations; - - HYPRE_Int print_level; /* printing when print_level>0 */ - HYPRE_Int logging; /* extra computations for logging when logging>0 */ - HYPRE_Real *norms; - char *log_file_name; - - } hypre_COGMRESData; +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +/** + * @name Generic GMRES Interface + * + * A general description of the interface goes here... + * + * @memo A generic GMRES linear solver interface + * @version 0.1 + * @author Jeffrey F. Painter + **/ +/*@{*/ + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +/*-------------------------------------------------------------------------- + * hypre_COGMRESData and hypre_COGMRESFunctions + *--------------------------------------------------------------------------*/ + +/** + * @name GMRES structs + * + * Description... + **/ +/*@{*/ + +/** + * The {\tt hypre\_GMRESFunctions} object ... + **/ + +typedef struct +{ + void * (*CAlloc) ( size_t count, size_t elt_size, HYPRE_MemoryLocation location ); + HYPRE_Int (*Free) ( void *ptr ); + HYPRE_Int (*CommInfo) ( void *A, HYPRE_Int *my_id, + HYPRE_Int *num_procs ); + void * (*CreateVector) ( void *vector ); + void * (*CreateVectorArray) ( HYPRE_Int size, void *vectors ); + HYPRE_Int (*DestroyVector) ( void *vector ); + void * (*MatvecCreate) ( void *A, void *x ); + HYPRE_Int (*Matvec) ( void *matvec_data, HYPRE_Complex alpha, void *A, + void *x, HYPRE_Complex beta, void *y ); + HYPRE_Int (*MatvecDestroy) ( void *matvec_data ); + HYPRE_Real (*InnerProd) ( void *x, void *y ); + HYPRE_Int (*MassInnerProd) ( void *x, void **p, HYPRE_Int k, HYPRE_Int unroll, void *result); + HYPRE_Int (*MassDotpTwo) ( void *x, void *y, void **p, HYPRE_Int k, HYPRE_Int unroll, + void *result_x, void *result_y); + HYPRE_Int (*CopyVector) ( void *x, void *y ); + HYPRE_Int (*ClearVector) ( void *x ); + HYPRE_Int (*ScaleVector) ( HYPRE_Complex alpha, void *x ); + HYPRE_Int (*Axpy) ( HYPRE_Complex alpha, void *x, void *y ); + HYPRE_Int (*MassAxpy) ( HYPRE_Complex * alpha, void **x, void *y, HYPRE_Int k, + HYPRE_Int unroll); + HYPRE_Int (*precond) (void *vdata, void *A, void *b, void *x); + HYPRE_Int (*precond_setup) (void *vdata, void *A, void *b, void *x); + + HYPRE_Int (*modify_pc)( void *precond_data, HYPRE_Int iteration, HYPRE_Real rel_residual_norm); + + +} hypre_COGMRESFunctions; + +/** + * The {\tt hypre\_GMRESData} object ... + **/ + +typedef struct +{ + HYPRE_Int k_dim; + HYPRE_Int unroll; + HYPRE_Int cgs; + HYPRE_Int min_iter; + HYPRE_Int max_iter; + HYPRE_Int rel_change; + HYPRE_Int skip_real_r_check; + HYPRE_Int stop_crit; + HYPRE_Int converged; + HYPRE_Real tol; + HYPRE_Real cf_tol; + HYPRE_Real a_tol; + HYPRE_Real rel_residual_norm; + + void *A; + void *r; + void *w; + void *w_2; + void **p; + + void *matvec_data; + void *precond_data; + + hypre_COGMRESFunctions * functions; + + /* log info (always logged) */ + HYPRE_Int num_iterations; + + HYPRE_Int print_level; /* printing when print_level>0 */ + HYPRE_Int logging; /* extra computations for logging when logging>0 */ + HYPRE_Real *norms; + char *log_file_name; + +} hypre_COGMRESData; #ifdef __cplusplus - extern "C" { +extern "C" { #endif - /** - * @name generic GMRES Solver - * - * Description... - **/ - /*@{*/ - - /** - * Description... - * - * @param param [IN] ... - **/ - - hypre_COGMRESFunctions * - hypre_COGMRESFunctionsCreate( - void * (*CAlloc) ( size_t count, size_t elt_size, HYPRE_MemoryLocation location ), - HYPRE_Int (*Free) ( void *ptr ), - HYPRE_Int (*CommInfo) ( void *A, HYPRE_Int *my_id, - HYPRE_Int *num_procs ), - void * (*CreateVector) ( void *vector ), - void * (*CreateVectorArray) ( HYPRE_Int size, void *vectors ), - HYPRE_Int (*DestroyVector) ( void *vector ), - void * (*MatvecCreate) ( void *A, void *x ), - HYPRE_Int (*Matvec) ( void *matvec_data, HYPRE_Complex alpha, void *A, void *x, HYPRE_Complex beta, void *y ), - HYPRE_Int (*MatvecDestroy) ( void *matvec_data ), - HYPRE_Real (*InnerProd) ( void *x, void *y ), - HYPRE_Int (*MassInnerProd) ( void *x, void **p, HYPRE_Int k, HYPRE_Int unroll, void *result), - HYPRE_Int (*MassDotpTwo) ( void *x, void *y, void **p, HYPRE_Int k, HYPRE_Int unroll, void *result_x, void *result_y), - HYPRE_Int (*CopyVector) ( void *x, void *y ), - HYPRE_Int (*ClearVector) ( void *x ), - HYPRE_Int (*ScaleVector) ( HYPRE_Complex alpha, void *x ), - HYPRE_Int (*Axpy) ( HYPRE_Complex alpha, void *x, void *y ), - HYPRE_Int (*MassAxpy) ( HYPRE_Complex *alpha, void **x, void *y, HYPRE_Int k, HYPRE_Int unroll), - HYPRE_Int (*PrecondSetup) ( void *vdata, void *A, void *b, void *x ), - HYPRE_Int (*Precond) ( void *vdata, void *A, void *b, void *x ) - ); - - /** - * Description... - * - * @param param [IN] ... - **/ - - void * - hypre_COGMRESCreate( hypre_COGMRESFunctions *gmres_functions ); + /** + * @name generic GMRES Solver + * + * Description... + **/ + /*@{*/ + + /** + * Description... + * + * @param param [IN] ... + **/ + + hypre_COGMRESFunctions * + hypre_COGMRESFunctionsCreate( + void * (*CAlloc) ( size_t count, size_t elt_size, HYPRE_MemoryLocation location ), + HYPRE_Int (*Free) ( void *ptr ), + HYPRE_Int (*CommInfo) ( void *A, HYPRE_Int *my_id, + HYPRE_Int *num_procs ), + void * (*CreateVector) ( void *vector ), + void * (*CreateVectorArray) ( HYPRE_Int size, void *vectors ), + HYPRE_Int (*DestroyVector) ( void *vector ), + void * (*MatvecCreate) ( void *A, void *x ), + HYPRE_Int (*Matvec) ( void *matvec_data, HYPRE_Complex alpha, void *A, void *x, + HYPRE_Complex beta, void *y ), + HYPRE_Int (*MatvecDestroy) ( void *matvec_data ), + HYPRE_Real (*InnerProd) ( void *x, void *y ), + HYPRE_Int (*MassInnerProd) ( void *x, void **p, HYPRE_Int k, HYPRE_Int unroll, void *result), + HYPRE_Int (*MassDotpTwo) ( void *x, void *y, void **p, HYPRE_Int k, HYPRE_Int unroll, + void *result_x, void *result_y), + HYPRE_Int (*CopyVector) ( void *x, void *y ), + HYPRE_Int (*ClearVector) ( void *x ), + HYPRE_Int (*ScaleVector) ( HYPRE_Complex alpha, void *x ), + HYPRE_Int (*Axpy) ( HYPRE_Complex alpha, void *x, void *y ), + HYPRE_Int (*MassAxpy) ( HYPRE_Complex *alpha, void **x, void *y, HYPRE_Int k, + HYPRE_Int unroll), + HYPRE_Int (*PrecondSetup) ( void *vdata, void *A, void *b, void *x ), + HYPRE_Int (*Precond) ( void *vdata, void *A, void *b, void *x ) + ); + + /** + * Description... + * + * @param param [IN] ... + **/ + + void * + hypre_COGMRESCreate( hypre_COGMRESFunctions *gmres_functions ); #ifdef __cplusplus - } +} #endif #endif - /***********end of KS code *********/ +/***********end of KS code *********/ - /****************************************************************************** - * - * LGMRES lgmres - * - *****************************************************************************/ +/****************************************************************************** + * + * LGMRES lgmres + * + *****************************************************************************/ #ifndef hypre_KRYLOV_LGMRES_HEADER #define hypre_KRYLOV_LGMRES_HEADER - /*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - - /** - * @name Generic LGMRES Interface - * - * A general description of the interface goes here... - * - **/ - /*@{*/ - - /*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - - /*-------------------------------------------------------------------------- - * hypre_LGMRESData and hypre_LGMRESFunctions - *--------------------------------------------------------------------------*/ - - /** - * @name LGMRES structs - * - * Description... - **/ - /*@{*/ - - /** - * The {\tt hypre\_LGMRESFunctions} object ... - **/ - - typedef struct - { - void * (*CAlloc) ( size_t count, size_t elt_size, HYPRE_MemoryLocation location ); - HYPRE_Int (*Free) ( void *ptr ); - HYPRE_Int (*CommInfo) ( void *A, HYPRE_Int *my_id, - HYPRE_Int *num_procs ); - void * (*CreateVector) ( void *vector ); - void * (*CreateVectorArray) ( HYPRE_Int size, void *vectors ); - HYPRE_Int (*DestroyVector) ( void *vector ); - void * (*MatvecCreate) ( void *A, void *x ); - HYPRE_Int (*Matvec) ( void *matvec_data, HYPRE_Complex alpha, void *A, - void *x, HYPRE_Complex beta, void *y ); - HYPRE_Int (*MatvecDestroy) ( void *matvec_data ); - HYPRE_Real (*InnerProd) ( void *x, void *y ); - HYPRE_Int (*CopyVector) ( void *x, void *y ); - HYPRE_Int (*ClearVector) ( void *x ); - HYPRE_Int (*ScaleVector) ( HYPRE_Complex alpha, void *x ); - HYPRE_Int (*Axpy) ( HYPRE_Complex alpha, void *x, void *y ); - - HYPRE_Int (*precond) (void *vdata , void *A , void *b , void *x); - HYPRE_Int (*precond_setup) (void *vdata , void *A , void *b , void *x); - - } hypre_LGMRESFunctions; - - /** - * The {\tt hypre\_LGMRESData} object ... - **/ - - typedef struct - { - HYPRE_Int k_dim; - HYPRE_Int min_iter; - HYPRE_Int max_iter; - HYPRE_Int rel_change; - HYPRE_Int stop_crit; - HYPRE_Int converged; - HYPRE_Real tol; - HYPRE_Real cf_tol; - HYPRE_Real a_tol; - HYPRE_Real rel_residual_norm; - - /*lgmres specific stuff */ - HYPRE_Int aug_dim; - HYPRE_Int approx_constant; - void **aug_vecs; - HYPRE_Int *aug_order; - void **a_aug_vecs; - /*---*/ - - void *A; - void *r; - void *w; - void *w_2; - void **p; - - void *matvec_data; - void *precond_data; - - hypre_LGMRESFunctions * functions; - - /* log info (always logged) */ - HYPRE_Int num_iterations; - - HYPRE_Int print_level; /* printing when print_level>0 */ - HYPRE_Int logging; /* extra computations for logging when logging>0 */ - HYPRE_Real *norms; - char *log_file_name; - - } hypre_LGMRESData; +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +/** + * @name Generic LGMRES Interface + * + * A general description of the interface goes here... + * + **/ +/*@{*/ + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +/*-------------------------------------------------------------------------- + * hypre_LGMRESData and hypre_LGMRESFunctions + *--------------------------------------------------------------------------*/ + +/** + * @name LGMRES structs + * + * Description... + **/ +/*@{*/ + +/** + * The {\tt hypre\_LGMRESFunctions} object ... + **/ + +typedef struct +{ + void * (*CAlloc) ( size_t count, size_t elt_size, HYPRE_MemoryLocation location ); + HYPRE_Int (*Free) ( void *ptr ); + HYPRE_Int (*CommInfo) ( void *A, HYPRE_Int *my_id, + HYPRE_Int *num_procs ); + void * (*CreateVector) ( void *vector ); + void * (*CreateVectorArray) ( HYPRE_Int size, void *vectors ); + HYPRE_Int (*DestroyVector) ( void *vector ); + void * (*MatvecCreate) ( void *A, void *x ); + HYPRE_Int (*Matvec) ( void *matvec_data, HYPRE_Complex alpha, void *A, + void *x, HYPRE_Complex beta, void *y ); + HYPRE_Int (*MatvecDestroy) ( void *matvec_data ); + HYPRE_Real (*InnerProd) ( void *x, void *y ); + HYPRE_Int (*CopyVector) ( void *x, void *y ); + HYPRE_Int (*ClearVector) ( void *x ); + HYPRE_Int (*ScaleVector) ( HYPRE_Complex alpha, void *x ); + HYPRE_Int (*Axpy) ( HYPRE_Complex alpha, void *x, void *y ); + + HYPRE_Int (*precond) (void *vdata, void *A, void *b, void *x); + HYPRE_Int (*precond_setup) (void *vdata, void *A, void *b, void *x); + +} hypre_LGMRESFunctions; + +/** + * The {\tt hypre\_LGMRESData} object ... + **/ + +typedef struct +{ + HYPRE_Int k_dim; + HYPRE_Int min_iter; + HYPRE_Int max_iter; + HYPRE_Int rel_change; + HYPRE_Int stop_crit; + HYPRE_Int converged; + HYPRE_Real tol; + HYPRE_Real cf_tol; + HYPRE_Real a_tol; + HYPRE_Real rel_residual_norm; + + /*lgmres specific stuff */ + HYPRE_Int aug_dim; + HYPRE_Int approx_constant; + void **aug_vecs; + HYPRE_Int *aug_order; + void **a_aug_vecs; + /*---*/ + + void *A; + void *r; + void *w; + void *w_2; + void **p; + + void *matvec_data; + void *precond_data; + + hypre_LGMRESFunctions * functions; + + /* log info (always logged) */ + HYPRE_Int num_iterations; + + HYPRE_Int print_level; /* printing when print_level>0 */ + HYPRE_Int logging; /* extra computations for logging when logging>0 */ + HYPRE_Real *norms; + char *log_file_name; + +} hypre_LGMRESData; #ifdef __cplusplus - extern "C" { +extern "C" { #endif - /** - * @name generic LGMRES Solver - * - * Description... - **/ - /*@{*/ - - /** - * Description... - * - * @param param [IN] ... - **/ - - hypre_LGMRESFunctions * - hypre_LGMRESFunctionsCreate( - void * (*CAlloc) ( size_t count, size_t elt_size, HYPRE_MemoryLocation location), - HYPRE_Int (*Free) ( void *ptr ), - HYPRE_Int (*CommInfo) ( void *A, HYPRE_Int *my_id, - HYPRE_Int *num_procs ), - void * (*CreateVector) ( void *vector ), - void * (*CreateVectorArray) ( HYPRE_Int size, void *vectors ), - HYPRE_Int (*DestroyVector) ( void *vector ), - void * (*MatvecCreate) ( void *A, void *x ), - HYPRE_Int (*Matvec) ( void *matvec_data, HYPRE_Complex alpha, void *A, - void *x, HYPRE_Complex beta, void *y ), - HYPRE_Int (*MatvecDestroy) ( void *matvec_data ), - HYPRE_Real (*InnerProd) ( void *x, void *y ), - HYPRE_Int (*CopyVector) ( void *x, void *y ), - HYPRE_Int (*ClearVector) ( void *x ), - HYPRE_Int (*ScaleVector) ( HYPRE_Complex alpha, void *x ), - HYPRE_Int (*Axpy) ( HYPRE_Complex alpha, void *x, void *y ), - HYPRE_Int (*PrecondSetup) ( void *vdata, void *A, void *b, void *x ), - HYPRE_Int (*Precond) ( void *vdata, void *A, void *b, void *x ) - ); - - /** - * Description... - * - * @param param [IN] ... - **/ - - void * - hypre_LGMRESCreate( hypre_LGMRESFunctions *lgmres_functions ); + /** + * @name generic LGMRES Solver + * + * Description... + **/ + /*@{*/ + + /** + * Description... + * + * @param param [IN] ... + **/ + + hypre_LGMRESFunctions * + hypre_LGMRESFunctionsCreate( + void * (*CAlloc) ( size_t count, size_t elt_size, HYPRE_MemoryLocation location), + HYPRE_Int (*Free) ( void *ptr ), + HYPRE_Int (*CommInfo) ( void *A, HYPRE_Int *my_id, + HYPRE_Int *num_procs ), + void * (*CreateVector) ( void *vector ), + void * (*CreateVectorArray) ( HYPRE_Int size, void *vectors ), + HYPRE_Int (*DestroyVector) ( void *vector ), + void * (*MatvecCreate) ( void *A, void *x ), + HYPRE_Int (*Matvec) ( void *matvec_data, HYPRE_Complex alpha, void *A, + void *x, HYPRE_Complex beta, void *y ), + HYPRE_Int (*MatvecDestroy) ( void *matvec_data ), + HYPRE_Real (*InnerProd) ( void *x, void *y ), + HYPRE_Int (*CopyVector) ( void *x, void *y ), + HYPRE_Int (*ClearVector) ( void *x ), + HYPRE_Int (*ScaleVector) ( HYPRE_Complex alpha, void *x ), + HYPRE_Int (*Axpy) ( HYPRE_Complex alpha, void *x, void *y ), + HYPRE_Int (*PrecondSetup) ( void *vdata, void *A, void *b, void *x ), + HYPRE_Int (*Precond) ( void *vdata, void *A, void *b, void *x ) + ); + + /** + * Description... + * + * @param param [IN] ... + **/ + + void * + hypre_LGMRESCreate( hypre_LGMRESFunctions *lgmres_functions ); #ifdef __cplusplus - } +} #endif #endif - /****************************************************************************** - * - * FLEXGMRES flexible gmres - * - *****************************************************************************/ +/****************************************************************************** + * + * FLEXGMRES flexible gmres + * + *****************************************************************************/ #ifndef hypre_KRYLOV_FLEXGMRES_HEADER #define hypre_KRYLOV_FLEXGMRES_HEADER - /*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - - /** - * @name Generic FlexGMRES Interface - * - * A general description of the interface goes here... - * - **/ - /*@{*/ - - /*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - - /*-------------------------------------------------------------------------- - * hypre_FlexGMRESData and hypre_FlexGMRESFunctions - *--------------------------------------------------------------------------*/ - - /** - * @name FlexGMRES structs - * - * Description... - **/ - /*@{*/ - - /** - * The {\tt hypre\_FlexGMRESFunctions} object ... - **/ - - typedef struct - { - void * (*CAlloc) ( size_t count, size_t elt_size, HYPRE_MemoryLocation location ); - HYPRE_Int (*Free) ( void *ptr ); - HYPRE_Int (*CommInfo) ( void *A, HYPRE_Int *my_id, - HYPRE_Int *num_procs ); - void * (*CreateVector) ( void *vector ); - void * (*CreateVectorArray) ( HYPRE_Int size, void *vectors ); - HYPRE_Int (*DestroyVector) ( void *vector ); - void * (*MatvecCreate) ( void *A, void *x ); - HYPRE_Int (*Matvec) ( void *matvec_data, HYPRE_Complex alpha, void *A, - void *x, HYPRE_Complex beta, void *y ); - HYPRE_Int (*MatvecDestroy) ( void *matvec_data ); - HYPRE_Real (*InnerProd) ( void *x, void *y ); - HYPRE_Int (*CopyVector) ( void *x, void *y ); - HYPRE_Int (*ClearVector) ( void *x ); - HYPRE_Int (*ScaleVector) ( HYPRE_Complex alpha, void *x ); - HYPRE_Int (*Axpy) ( HYPRE_Complex alpha, void *x, void *y ); - - HYPRE_Int (*precond)(void *vdata, void *A, void *b, void *x ); - HYPRE_Int (*precond_setup)(void *vdata, void *A, void *b, void *x ); - - HYPRE_Int (*modify_pc)( void *precond_data, HYPRE_Int iteration, HYPRE_Real rel_residual_norm); - - } hypre_FlexGMRESFunctions; - - /** - * The {\tt hypre\_FlexGMRESData} object ... - **/ - - typedef struct - { - HYPRE_Int k_dim; - HYPRE_Int min_iter; - HYPRE_Int max_iter; - HYPRE_Int rel_change; - HYPRE_Int stop_crit; - HYPRE_Int converged; - HYPRE_Real tol; - HYPRE_Real cf_tol; - HYPRE_Real a_tol; - HYPRE_Real rel_residual_norm; - - void **pre_vecs; - - void *A; - void *r; - void *w; - void *w_2; - void **p; - - void *matvec_data; - void *precond_data; - - hypre_FlexGMRESFunctions * functions; - - /* log info (always logged) */ - HYPRE_Int num_iterations; - - HYPRE_Int print_level; /* printing when print_level>0 */ - HYPRE_Int logging; /* extra computations for logging when logging>0 */ - HYPRE_Real *norms; - char *log_file_name; - - } hypre_FlexGMRESData; +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +/** + * @name Generic FlexGMRES Interface + * + * A general description of the interface goes here... + * + **/ +/*@{*/ + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +/*-------------------------------------------------------------------------- + * hypre_FlexGMRESData and hypre_FlexGMRESFunctions + *--------------------------------------------------------------------------*/ + +/** + * @name FlexGMRES structs + * + * Description... + **/ +/*@{*/ + +/** + * The {\tt hypre\_FlexGMRESFunctions} object ... + **/ + +typedef struct +{ + void * (*CAlloc) ( size_t count, size_t elt_size, HYPRE_MemoryLocation location ); + HYPRE_Int (*Free) ( void *ptr ); + HYPRE_Int (*CommInfo) ( void *A, HYPRE_Int *my_id, + HYPRE_Int *num_procs ); + void * (*CreateVector) ( void *vector ); + void * (*CreateVectorArray) ( HYPRE_Int size, void *vectors ); + HYPRE_Int (*DestroyVector) ( void *vector ); + void * (*MatvecCreate) ( void *A, void *x ); + HYPRE_Int (*Matvec) ( void *matvec_data, HYPRE_Complex alpha, void *A, + void *x, HYPRE_Complex beta, void *y ); + HYPRE_Int (*MatvecDestroy) ( void *matvec_data ); + HYPRE_Real (*InnerProd) ( void *x, void *y ); + HYPRE_Int (*CopyVector) ( void *x, void *y ); + HYPRE_Int (*ClearVector) ( void *x ); + HYPRE_Int (*ScaleVector) ( HYPRE_Complex alpha, void *x ); + HYPRE_Int (*Axpy) ( HYPRE_Complex alpha, void *x, void *y ); + + HYPRE_Int (*precond)(void *vdata, void *A, void *b, void *x ); + HYPRE_Int (*precond_setup)(void *vdata, void *A, void *b, void *x ); + + HYPRE_Int (*modify_pc)( void *precond_data, HYPRE_Int iteration, HYPRE_Real rel_residual_norm); + +} hypre_FlexGMRESFunctions; + +/** + * The {\tt hypre\_FlexGMRESData} object ... + **/ + +typedef struct +{ + HYPRE_Int k_dim; + HYPRE_Int min_iter; + HYPRE_Int max_iter; + HYPRE_Int rel_change; + HYPRE_Int stop_crit; + HYPRE_Int converged; + HYPRE_Real tol; + HYPRE_Real cf_tol; + HYPRE_Real a_tol; + HYPRE_Real rel_residual_norm; + + void **pre_vecs; + + void *A; + void *r; + void *w; + void *w_2; + void **p; + + void *matvec_data; + void *precond_data; + + hypre_FlexGMRESFunctions * functions; + + /* log info (always logged) */ + HYPRE_Int num_iterations; + + HYPRE_Int print_level; /* printing when print_level>0 */ + HYPRE_Int logging; /* extra computations for logging when logging>0 */ + HYPRE_Real *norms; + char *log_file_name; + +} hypre_FlexGMRESData; #ifdef __cplusplus - extern "C" { +extern "C" { #endif - /** - * @name generic FlexGMRES Solver - * - * Description... - **/ - /*@{*/ - - /** - * Description... - * - * @param param [IN] ... - **/ - - hypre_FlexGMRESFunctions * - hypre_FlexGMRESFunctionsCreate( - void * (*CAlloc) ( size_t count, size_t elt_size, HYPRE_MemoryLocation location ), - HYPRE_Int (*Free) ( void *ptr ), - HYPRE_Int (*CommInfo) ( void *A, HYPRE_Int *my_id, - HYPRE_Int *num_procs ), - void * (*CreateVector) ( void *vector ), - void * (*CreateVectorArray) ( HYPRE_Int size, void *vectors ), - HYPRE_Int (*DestroyVector) ( void *vector ), - void * (*MatvecCreate) ( void *A, void *x ), - HYPRE_Int (*Matvec) ( void *matvec_data, HYPRE_Complex alpha, void *A, - void *x, HYPRE_Complex beta, void *y ), - HYPRE_Int (*MatvecDestroy) ( void *matvec_data ), - HYPRE_Real (*InnerProd) ( void *x, void *y ), - HYPRE_Int (*CopyVector) ( void *x, void *y ), - HYPRE_Int (*ClearVector) ( void *x ), - HYPRE_Int (*ScaleVector) ( HYPRE_Complex alpha, void *x ), - HYPRE_Int (*Axpy) ( HYPRE_Complex alpha, void *x, void *y ), - HYPRE_Int (*PrecondSetup) ( void *vdata, void *A, void *b, void *x ), - HYPRE_Int (*Precond) ( void *vdata, void *A, void *b, void *x ) - ); - - /** - * Description... - * - * @param param [IN] ... - **/ - - void * - hypre_FlexGMRESCreate( hypre_FlexGMRESFunctions *fgmres_functions ); + /** + * @name generic FlexGMRES Solver + * + * Description... + **/ + /*@{*/ + + /** + * Description... + * + * @param param [IN] ... + **/ + + hypre_FlexGMRESFunctions * + hypre_FlexGMRESFunctionsCreate( + void * (*CAlloc) ( size_t count, size_t elt_size, HYPRE_MemoryLocation location ), + HYPRE_Int (*Free) ( void *ptr ), + HYPRE_Int (*CommInfo) ( void *A, HYPRE_Int *my_id, + HYPRE_Int *num_procs ), + void * (*CreateVector) ( void *vector ), + void * (*CreateVectorArray) ( HYPRE_Int size, void *vectors ), + HYPRE_Int (*DestroyVector) ( void *vector ), + void * (*MatvecCreate) ( void *A, void *x ), + HYPRE_Int (*Matvec) ( void *matvec_data, HYPRE_Complex alpha, void *A, + void *x, HYPRE_Complex beta, void *y ), + HYPRE_Int (*MatvecDestroy) ( void *matvec_data ), + HYPRE_Real (*InnerProd) ( void *x, void *y ), + HYPRE_Int (*CopyVector) ( void *x, void *y ), + HYPRE_Int (*ClearVector) ( void *x ), + HYPRE_Int (*ScaleVector) ( HYPRE_Complex alpha, void *x ), + HYPRE_Int (*Axpy) ( HYPRE_Complex alpha, void *x, void *y ), + HYPRE_Int (*PrecondSetup) ( void *vdata, void *A, void *b, void *x ), + HYPRE_Int (*Precond) ( void *vdata, void *A, void *b, void *x ) + ); + + /** + * Description... + * + * @param param [IN] ... + **/ + + void * + hypre_FlexGMRESCreate( hypre_FlexGMRESFunctions *fgmres_functions ); #ifdef __cplusplus - } +} #endif #endif - /****************************************************************************** - * - * Preconditioned conjugate gradient (Omin) headers - * - *****************************************************************************/ +/****************************************************************************** + * + * Preconditioned conjugate gradient (Omin) headers + * + *****************************************************************************/ #ifndef hypre_KRYLOV_PCG_HEADER #define hypre_KRYLOV_PCG_HEADER - /*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - - /** - * @name Generic PCG Interface - * - * A general description of the interface goes here... - * - * @memo A generic PCG linear solver interface - * @version 0.1 - * @author Jeffrey F. Painter - **/ - /*@{*/ - - /*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - - /*-------------------------------------------------------------------------- - * hypre_PCGData and hypre_PCGFunctions - *--------------------------------------------------------------------------*/ - - /** - * @name PCG structs - * - * Description... - **/ - /*@{*/ - - /** - * The {\tt hypre\_PCGSFunctions} object ... - **/ - - typedef struct - { - void * (*CAlloc) ( size_t count, size_t elt_size, HYPRE_MemoryLocation location ); - HYPRE_Int (*Free) ( void *ptr ); - HYPRE_Int (*CommInfo) ( void *A, HYPRE_Int *my_id, - HYPRE_Int *num_procs ); - void * (*CreateVector) ( void *vector ); - HYPRE_Int (*DestroyVector) ( void *vector ); - void * (*MatvecCreate) ( void *A, void *x ); - HYPRE_Int (*Matvec) ( void *matvec_data, HYPRE_Complex alpha, void *A, - void *x, HYPRE_Complex beta, void *y ); - HYPRE_Int (*MatvecDestroy) ( void *matvec_data ); - HYPRE_Real (*InnerProd) ( void *x, void *y ); - HYPRE_Int (*CopyVector) ( void *x, void *y ); - HYPRE_Int (*ClearVector) ( void *x ); - HYPRE_Int (*ScaleVector) ( HYPRE_Complex alpha, void *x ); - HYPRE_Int (*Axpy) ( HYPRE_Complex alpha, void *x, void *y ); - - HYPRE_Int (*precond)(void *vdata , void *A , void *b , void *x); - HYPRE_Int (*precond_setup)(void *vdata , void *A , void *b , void *x); - - } hypre_PCGFunctions; - - /** - * The {\tt hypre\_PCGData} object ... - **/ - - /* - Summary of Parameters to Control Stopping Test: - - Standard (default) error tolerance: |delta-residual|/|right-hand-side|). - - two_norm!=0 means: the norm is the L2 norm, |r|=sqrt() - - rel_change!=0 means: if pass the other stopping criteria, also check the - relative change in the solution x. Pass iff this relative change is small. - - tol = relative error tolerance, as above - -a_tol = absolute convergence tolerance (default is 0.0) - If one desires the convergence test to check the absolute - convergence tolerance *only*, then set the relative convergence - tolerance to 0.0. (The default convergence test is <= - max(relative_tolerance^2 * , absolute_tolerance^2) - - cf_tol = convergence factor tolerance; if >0 used for special test - for slow convergence - - stop_crit!=0 means (TO BE PHASED OUT): - pure absolute error tolerance rather than a pure relative - error tolerance on the residual. Never applies if rel_change!=0 or atolf!=0. - - atolf = absolute error tolerance factor to be used _together_ with the - relative error tolerance, |delta-residual| / ( atolf + |right-hand-side| ) < tol - (To BE PHASED OUT) - - recompute_residual means: when the iteration seems to be converged, recompute the - residual from scratch (r=b-Ax) and use this new residual to repeat the convergence test. - This can be expensive, use this only if you have seen a problem with the regular - residual computation. - - recompute_residual_p means: recompute the residual from scratch (r=b-Ax) - every "recompute_residual_p" iterations. This can be expensive and degrade the - convergence. Use it only if you have seen a problem with the regular residual - computation. - */ - - typedef struct - { - HYPRE_Real tol; - HYPRE_Real atolf; - HYPRE_Real cf_tol; - HYPRE_Real a_tol; - HYPRE_Real rtol; - HYPRE_Int max_iter; - HYPRE_Int two_norm; - HYPRE_Int rel_change; - HYPRE_Int recompute_residual; - HYPRE_Int recompute_residual_p; - HYPRE_Int stop_crit; - HYPRE_Int converged; - HYPRE_Int hybrid; - - void *A; - void *p; - void *s; - void *r; /* ...contains the residual. This is currently kept permanently. +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +/** + * @name Generic PCG Interface + * + * A general description of the interface goes here... + * + * @memo A generic PCG linear solver interface + * @version 0.1 + * @author Jeffrey F. Painter + **/ +/*@{*/ + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +/*-------------------------------------------------------------------------- + * hypre_PCGData and hypre_PCGFunctions + *--------------------------------------------------------------------------*/ + +/** + * @name PCG structs + * + * Description... + **/ +/*@{*/ + +/** + * The {\tt hypre\_PCGSFunctions} object ... + **/ + +typedef struct +{ + void * (*CAlloc) ( size_t count, size_t elt_size, HYPRE_MemoryLocation location ); + HYPRE_Int (*Free) ( void *ptr ); + HYPRE_Int (*CommInfo) ( void *A, HYPRE_Int *my_id, + HYPRE_Int *num_procs ); + void * (*CreateVector) ( void *vector ); + HYPRE_Int (*DestroyVector) ( void *vector ); + void * (*MatvecCreate) ( void *A, void *x ); + HYPRE_Int (*Matvec) ( void *matvec_data, HYPRE_Complex alpha, void *A, + void *x, HYPRE_Complex beta, void *y ); + HYPRE_Int (*MatvecDestroy) ( void *matvec_data ); + HYPRE_Real (*InnerProd) ( void *x, void *y ); + HYPRE_Int (*CopyVector) ( void *x, void *y ); + HYPRE_Int (*ClearVector) ( void *x ); + HYPRE_Int (*ScaleVector) ( HYPRE_Complex alpha, void *x ); + HYPRE_Int (*Axpy) ( HYPRE_Complex alpha, void *x, void *y ); + + HYPRE_Int (*precond)(void *vdata, void *A, void *b, void *x); + HYPRE_Int (*precond_setup)(void *vdata, void *A, void *b, void *x); + +} hypre_PCGFunctions; + +/** + * The {\tt hypre\_PCGData} object ... + **/ + +/* + Summary of Parameters to Control Stopping Test: + - Standard (default) error tolerance: |delta-residual|/|right-hand-side|). + - two_norm!=0 means: the norm is the L2 norm, |r|=sqrt() + - rel_change!=0 means: if pass the other stopping criteria, also check the + relative change in the solution x. Pass iff this relative change is small. + - tol = relative error tolerance, as above + -a_tol = absolute convergence tolerance (default is 0.0) + If one desires the convergence test to check the absolute + convergence tolerance *only*, then set the relative convergence + tolerance to 0.0. (The default convergence test is <= + max(relative_tolerance^2 * , absolute_tolerance^2) + - cf_tol = convergence factor tolerance; if >0 used for special test + for slow convergence + - stop_crit!=0 means (TO BE PHASED OUT): + pure absolute error tolerance rather than a pure relative + error tolerance on the residual. Never applies if rel_change!=0 or atolf!=0. + - atolf = absolute error tolerance factor to be used _together_ with the + relative error tolerance, |delta-residual| / ( atolf + |right-hand-side| ) < tol + (To BE PHASED OUT) + - recompute_residual means: when the iteration seems to be converged, recompute the + residual from scratch (r=b-Ax) and use this new residual to repeat the convergence test. + This can be expensive, use this only if you have seen a problem with the regular + residual computation. + - recompute_residual_p means: recompute the residual from scratch (r=b-Ax) + every "recompute_residual_p" iterations. This can be expensive and degrade the + convergence. Use it only if you have seen a problem with the regular residual + computation. + */ + +typedef struct +{ + HYPRE_Real tol; + HYPRE_Real atolf; + HYPRE_Real cf_tol; + HYPRE_Real a_tol; + HYPRE_Real rtol; + HYPRE_Int max_iter; + HYPRE_Int two_norm; + HYPRE_Int rel_change; + HYPRE_Int recompute_residual; + HYPRE_Int recompute_residual_p; + HYPRE_Int stop_crit; + HYPRE_Int converged; + HYPRE_Int hybrid; + HYPRE_Int skip_break; + HYPRE_Int flex; + + void *A; + void *p; + void *s; + void *r; /* ...contains the residual. This is currently kept permanently. If that is ever changed, it still must be kept if logging>1 */ + void *r_old; /* only needed for flexible CG */ + void *v; /* work vector; only needed if recompute_residual_p is set */ - HYPRE_Int owns_matvec_data; /* normally 1; if 0, don't delete it */ - void *matvec_data; - void *precond_data; + HYPRE_Int owns_matvec_data; /* normally 1; if 0, don't delete it */ + void *matvec_data; + void *precond_data; - hypre_PCGFunctions * functions; + hypre_PCGFunctions * functions; - /* log info (always logged) */ - HYPRE_Int num_iterations; - HYPRE_Real rel_residual_norm; + /* log info (always logged) */ + HYPRE_Int num_iterations; + HYPRE_Real rel_residual_norm; - HYPRE_Int print_level; /* printing when print_level>0 */ - HYPRE_Int logging; /* extra computations for logging when logging>0 */ - HYPRE_Real *norms; - HYPRE_Real *rel_norms; + HYPRE_Int print_level; /* printing when print_level>0 */ + HYPRE_Int logging; /* extra computations for logging when logging>0 */ + HYPRE_Real *norms; + HYPRE_Real *rel_norms; - } hypre_PCGData; +} hypre_PCGData; #define hypre_PCGDataOwnsMatvecData(pcgdata) ((pcgdata) -> owns_matvec_data) #define hypre_PCGDataHybrid(pcgdata) ((pcgdata) -> hybrid) #ifdef __cplusplus - extern "C" { +extern "C" { #endif - /** - * @name generic PCG Solver - * - * Description... - **/ - /*@{*/ - - /** - * Description... - * - * @param param [IN] ... - **/ - - hypre_PCGFunctions * - hypre_PCGFunctionsCreate( - void * (*CAlloc) ( size_t count, size_t elt_size, HYPRE_MemoryLocation location ), - HYPRE_Int (*Free) ( void *ptr ), - HYPRE_Int (*CommInfo) ( void *A, HYPRE_Int *my_id, - HYPRE_Int *num_procs ), - void * (*CreateVector) ( void *vector ), - HYPRE_Int (*DestroyVector) ( void *vector ), - void * (*MatvecCreate) ( void *A, void *x ), - HYPRE_Int (*Matvec) ( void *matvec_data, HYPRE_Complex alpha, void *A, - void *x, HYPRE_Complex beta, void *y ), - HYPRE_Int (*MatvecDestroy) ( void *matvec_data ), - HYPRE_Real (*InnerProd) ( void *x, void *y ), - HYPRE_Int (*CopyVector) ( void *x, void *y ), - HYPRE_Int (*ClearVector) ( void *x ), - HYPRE_Int (*ScaleVector) ( HYPRE_Complex alpha, void *x ), - HYPRE_Int (*Axpy) ( HYPRE_Complex alpha, void *x, void *y ), - HYPRE_Int (*PrecondSetup) ( void *vdata, void *A, void *b, void *x ), - HYPRE_Int (*Precond) ( void *vdata, void *A, void *b, void *x ) - ); - - /** - * Description... - * - * @param param [IN] ... - **/ - - void * - hypre_PCGCreate( hypre_PCGFunctions *pcg_functions ); + /** + * @name generic PCG Solver + * + * Description... + **/ + /*@{*/ + + /** + * Description... + * + * @param param [IN] ... + **/ + + hypre_PCGFunctions * + hypre_PCGFunctionsCreate( + void * (*CAlloc) ( size_t count, size_t elt_size, HYPRE_MemoryLocation location ), + HYPRE_Int (*Free) ( void *ptr ), + HYPRE_Int (*CommInfo) ( void *A, HYPRE_Int *my_id, + HYPRE_Int *num_procs ), + void * (*CreateVector) ( void *vector ), + HYPRE_Int (*DestroyVector) ( void *vector ), + void * (*MatvecCreate) ( void *A, void *x ), + HYPRE_Int (*Matvec) ( void *matvec_data, HYPRE_Complex alpha, void *A, + void *x, HYPRE_Complex beta, void *y ), + HYPRE_Int (*MatvecDestroy) ( void *matvec_data ), + HYPRE_Real (*InnerProd) ( void *x, void *y ), + HYPRE_Int (*CopyVector) ( void *x, void *y ), + HYPRE_Int (*ClearVector) ( void *x ), + HYPRE_Int (*ScaleVector) ( HYPRE_Complex alpha, void *x ), + HYPRE_Int (*Axpy) ( HYPRE_Complex alpha, void *x, void *y ), + HYPRE_Int (*PrecondSetup) ( void *vdata, void *A, void *b, void *x ), + HYPRE_Int (*Precond) ( void *vdata, void *A, void *b, void *x ) + ); + + /** + * Description... + * + * @param param [IN] ... + **/ + + void * + hypre_PCGCreate( hypre_PCGFunctions *pcg_functions ); #ifdef __cplusplus - } +} #endif #endif - /* bicgstab.c */ - void *hypre_BiCGSTABCreate ( hypre_BiCGSTABFunctions *bicgstab_functions ); - HYPRE_Int hypre_BiCGSTABDestroy ( void *bicgstab_vdata ); - HYPRE_Int hypre_BiCGSTABSetup ( void *bicgstab_vdata , void *A , void *b , void *x ); - HYPRE_Int hypre_BiCGSTABSolve ( void *bicgstab_vdata , void *A , void *b , void *x ); - HYPRE_Int hypre_BiCGSTABSetTol ( void *bicgstab_vdata , HYPRE_Real tol ); - HYPRE_Int hypre_BiCGSTABSetAbsoluteTol ( void *bicgstab_vdata , HYPRE_Real a_tol ); - HYPRE_Int hypre_BiCGSTABSetConvergenceFactorTol ( void *bicgstab_vdata , HYPRE_Real cf_tol ); - HYPRE_Int hypre_BiCGSTABSetMinIter ( void *bicgstab_vdata , HYPRE_Int min_iter ); - HYPRE_Int hypre_BiCGSTABSetMaxIter ( void *bicgstab_vdata , HYPRE_Int max_iter ); - HYPRE_Int hypre_BiCGSTABSetStopCrit ( void *bicgstab_vdata , HYPRE_Int stop_crit ); - HYPRE_Int hypre_BiCGSTABSetPrecond ( void *bicgstab_vdata , HYPRE_Int (*precond )(void*,void*,void*,void*), HYPRE_Int (*precond_setup )(void*,void*,void*,void*), void *precond_data ); - HYPRE_Int hypre_BiCGSTABGetPrecond ( void *bicgstab_vdata , HYPRE_Solver *precond_data_ptr ); - HYPRE_Int hypre_BiCGSTABSetLogging ( void *bicgstab_vdata , HYPRE_Int logging ); - HYPRE_Int hypre_BiCGSTABSetHybrid ( void *bicgstab_vdata , HYPRE_Int logging ); - HYPRE_Int hypre_BiCGSTABSetPrintLevel ( void *bicgstab_vdata , HYPRE_Int print_level ); - HYPRE_Int hypre_BiCGSTABGetConverged ( void *bicgstab_vdata , HYPRE_Int *converged ); - HYPRE_Int hypre_BiCGSTABGetNumIterations ( void *bicgstab_vdata , HYPRE_Int *num_iterations ); - HYPRE_Int hypre_BiCGSTABGetFinalRelativeResidualNorm ( void *bicgstab_vdata , HYPRE_Real *relative_residual_norm ); - HYPRE_Int hypre_BiCGSTABGetResidual ( void *bicgstab_vdata , void **residual ); - - /* cgnr.c */ - void *hypre_CGNRCreate ( hypre_CGNRFunctions *cgnr_functions ); - HYPRE_Int hypre_CGNRDestroy ( void *cgnr_vdata ); - HYPRE_Int hypre_CGNRSetup ( void *cgnr_vdata , void *A , void *b , void *x ); - HYPRE_Int hypre_CGNRSolve ( void *cgnr_vdata , void *A , void *b , void *x ); - HYPRE_Int hypre_CGNRSetTol ( void *cgnr_vdata , HYPRE_Real tol ); - HYPRE_Int hypre_CGNRSetMinIter ( void *cgnr_vdata , HYPRE_Int min_iter ); - HYPRE_Int hypre_CGNRSetMaxIter ( void *cgnr_vdata , HYPRE_Int max_iter ); - HYPRE_Int hypre_CGNRSetStopCrit ( void *cgnr_vdata , HYPRE_Int stop_crit ); - HYPRE_Int hypre_CGNRSetPrecond ( void *cgnr_vdata , HYPRE_Int (*precond )(void*,void*,void*,void*), HYPRE_Int (*precondT )(void*,void*,void*,void*), HYPRE_Int (*precond_setup )(void*,void*,void*,void*), void *precond_data ); - HYPRE_Int hypre_CGNRGetPrecond ( void *cgnr_vdata , HYPRE_Solver *precond_data_ptr ); - HYPRE_Int hypre_CGNRSetLogging ( void *cgnr_vdata , HYPRE_Int logging ); - HYPRE_Int hypre_CGNRGetNumIterations ( void *cgnr_vdata , HYPRE_Int *num_iterations ); - HYPRE_Int hypre_CGNRGetFinalRelativeResidualNorm ( void *cgnr_vdata , HYPRE_Real *relative_residual_norm ); - - /* gmres.c */ - void *hypre_GMRESCreate ( hypre_GMRESFunctions *gmres_functions ); - HYPRE_Int hypre_GMRESDestroy ( void *gmres_vdata ); - HYPRE_Int hypre_GMRESGetResidual ( void *gmres_vdata , void **residual ); - HYPRE_Int hypre_GMRESSetup ( void *gmres_vdata , void *A , void *b , void *x ); - HYPRE_Int hypre_GMRESSolve ( void *gmres_vdata , void *A , void *b , void *x ); - HYPRE_Int hypre_GMRESSetKDim ( void *gmres_vdata , HYPRE_Int k_dim ); - HYPRE_Int hypre_GMRESGetKDim ( void *gmres_vdata , HYPRE_Int *k_dim ); - HYPRE_Int hypre_GMRESSetTol ( void *gmres_vdata , HYPRE_Real tol ); - HYPRE_Int hypre_GMRESGetTol ( void *gmres_vdata , HYPRE_Real *tol ); - HYPRE_Int hypre_GMRESSetAbsoluteTol ( void *gmres_vdata , HYPRE_Real a_tol ); - HYPRE_Int hypre_GMRESGetAbsoluteTol ( void *gmres_vdata , HYPRE_Real *a_tol ); - HYPRE_Int hypre_GMRESSetConvergenceFactorTol ( void *gmres_vdata , HYPRE_Real cf_tol ); - HYPRE_Int hypre_GMRESGetConvergenceFactorTol ( void *gmres_vdata , HYPRE_Real *cf_tol ); - HYPRE_Int hypre_GMRESSetMinIter ( void *gmres_vdata , HYPRE_Int min_iter ); - HYPRE_Int hypre_GMRESGetMinIter ( void *gmres_vdata , HYPRE_Int *min_iter ); - HYPRE_Int hypre_GMRESSetMaxIter ( void *gmres_vdata , HYPRE_Int max_iter ); - HYPRE_Int hypre_GMRESGetMaxIter ( void *gmres_vdata , HYPRE_Int *max_iter ); - HYPRE_Int hypre_GMRESSetRelChange ( void *gmres_vdata , HYPRE_Int rel_change ); - HYPRE_Int hypre_GMRESGetRelChange ( void *gmres_vdata , HYPRE_Int *rel_change ); - HYPRE_Int hypre_GMRESSetSkipRealResidualCheck ( void *gmres_vdata , HYPRE_Int skip_real_r_check ); - HYPRE_Int hypre_GMRESGetSkipRealResidualCheck ( void *gmres_vdata , HYPRE_Int *skip_real_r_check ); - HYPRE_Int hypre_GMRESSetStopCrit ( void *gmres_vdata , HYPRE_Int stop_crit ); - HYPRE_Int hypre_GMRESGetStopCrit ( void *gmres_vdata , HYPRE_Int *stop_crit ); - HYPRE_Int hypre_GMRESSetPrecond ( void *gmres_vdata , HYPRE_Int (*precond )(void*,void*,void*,void*), HYPRE_Int (*precond_setup )(void*,void*,void*,void*), void *precond_data ); - HYPRE_Int hypre_GMRESGetPrecond ( void *gmres_vdata , HYPRE_Solver *precond_data_ptr ); - HYPRE_Int hypre_GMRESSetPrintLevel ( void *gmres_vdata , HYPRE_Int level ); - HYPRE_Int hypre_GMRESGetPrintLevel ( void *gmres_vdata , HYPRE_Int *level ); - HYPRE_Int hypre_GMRESSetLogging ( void *gmres_vdata , HYPRE_Int level ); - HYPRE_Int hypre_GMRESGetLogging ( void *gmres_vdata , HYPRE_Int *level ); - HYPRE_Int hypre_GMRESSetHybrid ( void *gmres_vdata , HYPRE_Int level ); - HYPRE_Int hypre_GMRESGetNumIterations ( void *gmres_vdata , HYPRE_Int *num_iterations ); - HYPRE_Int hypre_GMRESGetConverged ( void *gmres_vdata , HYPRE_Int *converged ); - HYPRE_Int hypre_GMRESGetFinalRelativeResidualNorm ( void *gmres_vdata , HYPRE_Real *relative_residual_norm ); - - /* cogmres.c */ - void *hypre_COGMRESCreate ( hypre_COGMRESFunctions *gmres_functions ); - HYPRE_Int hypre_COGMRESDestroy ( void *gmres_vdata ); - HYPRE_Int hypre_COGMRESGetResidual ( void *gmres_vdata , void **residual ); - HYPRE_Int hypre_COGMRESSetup ( void *gmres_vdata , void *A , void *b , void *x ); - HYPRE_Int hypre_COGMRESSolve ( void *gmres_vdata , void *A , void *b , void *x ); - HYPRE_Int hypre_COGMRESSetKDim ( void *gmres_vdata , HYPRE_Int k_dim ); - HYPRE_Int hypre_COGMRESGetKDim ( void *gmres_vdata , HYPRE_Int *k_dim ); - HYPRE_Int hypre_COGMRESSetUnroll ( void *gmres_vdata , HYPRE_Int unroll ); - HYPRE_Int hypre_COGMRESGetUnroll ( void *gmres_vdata , HYPRE_Int *unroll ); - HYPRE_Int hypre_COGMRESSetCGS ( void *gmres_vdata , HYPRE_Int cgs ); - HYPRE_Int hypre_COGMRESGetCGS ( void *gmres_vdata , HYPRE_Int *cgs ); - HYPRE_Int hypre_COGMRESSetTol ( void *gmres_vdata , HYPRE_Real tol ); - HYPRE_Int hypre_COGMRESGetTol ( void *gmres_vdata , HYPRE_Real *tol ); - HYPRE_Int hypre_COGMRESSetAbsoluteTol ( void *gmres_vdata , HYPRE_Real a_tol ); - HYPRE_Int hypre_COGMRESGetAbsoluteTol ( void *gmres_vdata , HYPRE_Real *a_tol ); - HYPRE_Int hypre_COGMRESSetConvergenceFactorTol ( void *gmres_vdata , HYPRE_Real cf_tol ); - HYPRE_Int hypre_COGMRESGetConvergenceFactorTol ( void *gmres_vdata , HYPRE_Real *cf_tol ); - HYPRE_Int hypre_COGMRESSetMinIter ( void *gmres_vdata , HYPRE_Int min_iter ); - HYPRE_Int hypre_COGMRESGetMinIter ( void *gmres_vdata , HYPRE_Int *min_iter ); - HYPRE_Int hypre_COGMRESSetMaxIter ( void *gmres_vdata , HYPRE_Int max_iter ); - HYPRE_Int hypre_COGMRESGetMaxIter ( void *gmres_vdata , HYPRE_Int *max_iter ); - HYPRE_Int hypre_COGMRESSetRelChange ( void *gmres_vdata , HYPRE_Int rel_change ); - HYPRE_Int hypre_COGMRESGetRelChange ( void *gmres_vdata , HYPRE_Int *rel_change ); - HYPRE_Int hypre_COGMRESSetSkipRealResidualCheck ( void *gmres_vdata , HYPRE_Int skip_real_r_check ); - HYPRE_Int hypre_COGMRESGetSkipRealResidualCheck ( void *gmres_vdata , HYPRE_Int *skip_real_r_check ); - HYPRE_Int hypre_COGMRESSetPrecond ( void *gmres_vdata , HYPRE_Int (*precond )(void*,void*,void*,void*), HYPRE_Int (*precond_setup )(void*,void*,void*,void*), void *precond_data ); - HYPRE_Int hypre_COGMRESGetPrecond ( void *gmres_vdata , HYPRE_Solver *precond_data_ptr ); - HYPRE_Int hypre_COGMRESSetPrintLevel ( void *gmres_vdata , HYPRE_Int level ); - HYPRE_Int hypre_COGMRESGetPrintLevel ( void *gmres_vdata , HYPRE_Int *level ); - HYPRE_Int hypre_COGMRESSetLogging ( void *gmres_vdata , HYPRE_Int level ); - HYPRE_Int hypre_COGMRESGetLogging ( void *gmres_vdata , HYPRE_Int *level ); - HYPRE_Int hypre_COGMRESGetNumIterations ( void *gmres_vdata , HYPRE_Int *num_iterations ); - HYPRE_Int hypre_COGMRESGetConverged ( void *gmres_vdata , HYPRE_Int *converged ); - HYPRE_Int hypre_COGMRESGetFinalRelativeResidualNorm ( void *gmres_vdata , HYPRE_Real *relative_residual_norm ); - HYPRE_Int hypre_COGMRESSetModifyPC ( void *fgmres_vdata , HYPRE_Int (*modify_pc )(void *precond_data, HYPRE_Int iteration, HYPRE_Real rel_residual_norm)); - - - - /* flexgmres.c */ - void *hypre_FlexGMRESCreate ( hypre_FlexGMRESFunctions *fgmres_functions ); - HYPRE_Int hypre_FlexGMRESDestroy ( void *fgmres_vdata ); - HYPRE_Int hypre_FlexGMRESGetResidual ( void *fgmres_vdata , void **residual ); - HYPRE_Int hypre_FlexGMRESSetup ( void *fgmres_vdata , void *A , void *b , void *x ); - HYPRE_Int hypre_FlexGMRESSolve ( void *fgmres_vdata , void *A , void *b , void *x ); - HYPRE_Int hypre_FlexGMRESSetKDim ( void *fgmres_vdata , HYPRE_Int k_dim ); - HYPRE_Int hypre_FlexGMRESGetKDim ( void *fgmres_vdata , HYPRE_Int *k_dim ); - HYPRE_Int hypre_FlexGMRESSetTol ( void *fgmres_vdata , HYPRE_Real tol ); - HYPRE_Int hypre_FlexGMRESGetTol ( void *fgmres_vdata , HYPRE_Real *tol ); - HYPRE_Int hypre_FlexGMRESSetAbsoluteTol ( void *fgmres_vdata , HYPRE_Real a_tol ); - HYPRE_Int hypre_FlexGMRESGetAbsoluteTol ( void *fgmres_vdata , HYPRE_Real *a_tol ); - HYPRE_Int hypre_FlexGMRESSetConvergenceFactorTol ( void *fgmres_vdata , HYPRE_Real cf_tol ); - HYPRE_Int hypre_FlexGMRESGetConvergenceFactorTol ( void *fgmres_vdata , HYPRE_Real *cf_tol ); - HYPRE_Int hypre_FlexGMRESSetMinIter ( void *fgmres_vdata , HYPRE_Int min_iter ); - HYPRE_Int hypre_FlexGMRESGetMinIter ( void *fgmres_vdata , HYPRE_Int *min_iter ); - HYPRE_Int hypre_FlexGMRESSetMaxIter ( void *fgmres_vdata , HYPRE_Int max_iter ); - HYPRE_Int hypre_FlexGMRESGetMaxIter ( void *fgmres_vdata , HYPRE_Int *max_iter ); - HYPRE_Int hypre_FlexGMRESSetStopCrit ( void *fgmres_vdata , HYPRE_Int stop_crit ); - HYPRE_Int hypre_FlexGMRESGetStopCrit ( void *fgmres_vdata , HYPRE_Int *stop_crit ); - HYPRE_Int hypre_FlexGMRESSetPrecond ( void *fgmres_vdata , HYPRE_Int (*precond )(void*,void*,void*,void*), HYPRE_Int (*precond_setup )(void*,void*,void*,void*), void *precond_data ); - HYPRE_Int hypre_FlexGMRESGetPrecond ( void *fgmres_vdata , HYPRE_Solver *precond_data_ptr ); - HYPRE_Int hypre_FlexGMRESSetPrintLevel ( void *fgmres_vdata , HYPRE_Int level ); - HYPRE_Int hypre_FlexGMRESGetPrintLevel ( void *fgmres_vdata , HYPRE_Int *level ); - HYPRE_Int hypre_FlexGMRESSetLogging ( void *fgmres_vdata , HYPRE_Int level ); - HYPRE_Int hypre_FlexGMRESGetLogging ( void *fgmres_vdata , HYPRE_Int *level ); - HYPRE_Int hypre_FlexGMRESGetNumIterations ( void *fgmres_vdata , HYPRE_Int *num_iterations ); - HYPRE_Int hypre_FlexGMRESGetConverged ( void *fgmres_vdata , HYPRE_Int *converged ); - HYPRE_Int hypre_FlexGMRESGetFinalRelativeResidualNorm ( void *fgmres_vdata , HYPRE_Real *relative_residual_norm ); - HYPRE_Int hypre_FlexGMRESSetModifyPC ( void *fgmres_vdata , HYPRE_Int (*modify_pc )(void *precond_data, HYPRE_Int iteration, HYPRE_Real rel_residual_norm)); - HYPRE_Int hypre_FlexGMRESModifyPCDefault ( void *precond_data , HYPRE_Int iteration , HYPRE_Real rel_residual_norm ); - - /* lgmres.c */ - void *hypre_LGMRESCreate ( hypre_LGMRESFunctions *lgmres_functions ); - HYPRE_Int hypre_LGMRESDestroy ( void *lgmres_vdata ); - HYPRE_Int hypre_LGMRESGetResidual ( void *lgmres_vdata , void **residual ); - HYPRE_Int hypre_LGMRESSetup ( void *lgmres_vdata , void *A , void *b , void *x ); - HYPRE_Int hypre_LGMRESSolve ( void *lgmres_vdata , void *A , void *b , void *x ); - HYPRE_Int hypre_LGMRESSetKDim ( void *lgmres_vdata , HYPRE_Int k_dim ); - HYPRE_Int hypre_LGMRESGetKDim ( void *lgmres_vdata , HYPRE_Int *k_dim ); - HYPRE_Int hypre_LGMRESSetAugDim ( void *lgmres_vdata , HYPRE_Int aug_dim ); - HYPRE_Int hypre_LGMRESGetAugDim ( void *lgmres_vdata , HYPRE_Int *aug_dim ); - HYPRE_Int hypre_LGMRESSetTol ( void *lgmres_vdata , HYPRE_Real tol ); - HYPRE_Int hypre_LGMRESGetTol ( void *lgmres_vdata , HYPRE_Real *tol ); - HYPRE_Int hypre_LGMRESSetAbsoluteTol ( void *lgmres_vdata , HYPRE_Real a_tol ); - HYPRE_Int hypre_LGMRESGetAbsoluteTol ( void *lgmres_vdata , HYPRE_Real *a_tol ); - HYPRE_Int hypre_LGMRESSetConvergenceFactorTol ( void *lgmres_vdata , HYPRE_Real cf_tol ); - HYPRE_Int hypre_LGMRESGetConvergenceFactorTol ( void *lgmres_vdata , HYPRE_Real *cf_tol ); - HYPRE_Int hypre_LGMRESSetMinIter ( void *lgmres_vdata , HYPRE_Int min_iter ); - HYPRE_Int hypre_LGMRESGetMinIter ( void *lgmres_vdata , HYPRE_Int *min_iter ); - HYPRE_Int hypre_LGMRESSetMaxIter ( void *lgmres_vdata , HYPRE_Int max_iter ); - HYPRE_Int hypre_LGMRESGetMaxIter ( void *lgmres_vdata , HYPRE_Int *max_iter ); - HYPRE_Int hypre_LGMRESSetStopCrit ( void *lgmres_vdata , HYPRE_Int stop_crit ); - HYPRE_Int hypre_LGMRESGetStopCrit ( void *lgmres_vdata , HYPRE_Int *stop_crit ); - HYPRE_Int hypre_LGMRESSetPrecond ( void *lgmres_vdata , HYPRE_Int (*precond )(void*,void*,void*,void*), HYPRE_Int (*precond_setup )(void*,void*,void*,void*), void *precond_data ); - HYPRE_Int hypre_LGMRESGetPrecond ( void *lgmres_vdata , HYPRE_Solver *precond_data_ptr ); - HYPRE_Int hypre_LGMRESSetPrintLevel ( void *lgmres_vdata , HYPRE_Int level ); - HYPRE_Int hypre_LGMRESGetPrintLevel ( void *lgmres_vdata , HYPRE_Int *level ); - HYPRE_Int hypre_LGMRESSetLogging ( void *lgmres_vdata , HYPRE_Int level ); - HYPRE_Int hypre_LGMRESGetLogging ( void *lgmres_vdata , HYPRE_Int *level ); - HYPRE_Int hypre_LGMRESGetNumIterations ( void *lgmres_vdata , HYPRE_Int *num_iterations ); - HYPRE_Int hypre_LGMRESGetConverged ( void *lgmres_vdata , HYPRE_Int *converged ); - HYPRE_Int hypre_LGMRESGetFinalRelativeResidualNorm ( void *lgmres_vdata , HYPRE_Real *relative_residual_norm ); - - /* HYPRE_bicgstab.c */ - HYPRE_Int HYPRE_BiCGSTABDestroy ( HYPRE_Solver solver ); - HYPRE_Int HYPRE_BiCGSTABSetup ( HYPRE_Solver solver , HYPRE_Matrix A , HYPRE_Vector b , HYPRE_Vector x ); - HYPRE_Int HYPRE_BiCGSTABSolve ( HYPRE_Solver solver , HYPRE_Matrix A , HYPRE_Vector b , HYPRE_Vector x ); - HYPRE_Int HYPRE_BiCGSTABSetTol ( HYPRE_Solver solver , HYPRE_Real tol ); - HYPRE_Int HYPRE_BiCGSTABSetAbsoluteTol ( HYPRE_Solver solver , HYPRE_Real a_tol ); - HYPRE_Int HYPRE_BiCGSTABSetConvergenceFactorTol ( HYPRE_Solver solver , HYPRE_Real cf_tol ); - HYPRE_Int HYPRE_BiCGSTABSetMinIter ( HYPRE_Solver solver , HYPRE_Int min_iter ); - HYPRE_Int HYPRE_BiCGSTABSetMaxIter ( HYPRE_Solver solver , HYPRE_Int max_iter ); - HYPRE_Int HYPRE_BiCGSTABSetStopCrit ( HYPRE_Solver solver , HYPRE_Int stop_crit ); - HYPRE_Int HYPRE_BiCGSTABSetPrecond ( HYPRE_Solver solver , HYPRE_PtrToSolverFcn precond , HYPRE_PtrToSolverFcn precond_setup , HYPRE_Solver precond_solver ); - HYPRE_Int HYPRE_BiCGSTABGetPrecond ( HYPRE_Solver solver , HYPRE_Solver *precond_data_ptr ); - HYPRE_Int HYPRE_BiCGSTABSetLogging ( HYPRE_Solver solver , HYPRE_Int logging ); - HYPRE_Int HYPRE_BiCGSTABSetPrintLevel ( HYPRE_Solver solver , HYPRE_Int print_level ); - HYPRE_Int HYPRE_BiCGSTABGetNumIterations ( HYPRE_Solver solver , HYPRE_Int *num_iterations ); - HYPRE_Int HYPRE_BiCGSTABGetFinalRelativeResidualNorm ( HYPRE_Solver solver , HYPRE_Real *norm ); - HYPRE_Int HYPRE_BiCGSTABGetResidual ( HYPRE_Solver solver , void *residual ); - - /* HYPRE_cgnr.c */ - HYPRE_Int HYPRE_CGNRDestroy ( HYPRE_Solver solver ); - HYPRE_Int HYPRE_CGNRSetup ( HYPRE_Solver solver , HYPRE_Matrix A , HYPRE_Vector b , HYPRE_Vector x ); - HYPRE_Int HYPRE_CGNRSolve ( HYPRE_Solver solver , HYPRE_Matrix A , HYPRE_Vector b , HYPRE_Vector x ); - HYPRE_Int HYPRE_CGNRSetTol ( HYPRE_Solver solver , HYPRE_Real tol ); - HYPRE_Int HYPRE_CGNRSetMinIter ( HYPRE_Solver solver , HYPRE_Int min_iter ); - HYPRE_Int HYPRE_CGNRSetMaxIter ( HYPRE_Solver solver , HYPRE_Int max_iter ); - HYPRE_Int HYPRE_CGNRSetStopCrit ( HYPRE_Solver solver , HYPRE_Int stop_crit ); - HYPRE_Int HYPRE_CGNRSetPrecond ( HYPRE_Solver solver , HYPRE_PtrToSolverFcn precond , HYPRE_PtrToSolverFcn precondT , HYPRE_PtrToSolverFcn precond_setup , HYPRE_Solver precond_solver ); - HYPRE_Int HYPRE_CGNRGetPrecond ( HYPRE_Solver solver , HYPRE_Solver *precond_data_ptr ); - HYPRE_Int HYPRE_CGNRSetLogging ( HYPRE_Solver solver , HYPRE_Int logging ); - HYPRE_Int HYPRE_CGNRGetNumIterations ( HYPRE_Solver solver , HYPRE_Int *num_iterations ); - HYPRE_Int HYPRE_CGNRGetFinalRelativeResidualNorm ( HYPRE_Solver solver , HYPRE_Real *norm ); - - /* HYPRE_gmres.c */ - HYPRE_Int HYPRE_GMRESSetup ( HYPRE_Solver solver , HYPRE_Matrix A , HYPRE_Vector b , HYPRE_Vector x ); - HYPRE_Int HYPRE_GMRESSolve ( HYPRE_Solver solver , HYPRE_Matrix A , HYPRE_Vector b , HYPRE_Vector x ); - HYPRE_Int HYPRE_GMRESSetKDim ( HYPRE_Solver solver , HYPRE_Int k_dim ); - HYPRE_Int HYPRE_GMRESGetKDim ( HYPRE_Solver solver , HYPRE_Int *k_dim ); - HYPRE_Int HYPRE_GMRESSetTol ( HYPRE_Solver solver , HYPRE_Real tol ); - HYPRE_Int HYPRE_GMRESGetTol ( HYPRE_Solver solver , HYPRE_Real *tol ); - HYPRE_Int HYPRE_GMRESSetAbsoluteTol ( HYPRE_Solver solver , HYPRE_Real a_tol ); - HYPRE_Int HYPRE_GMRESGetAbsoluteTol ( HYPRE_Solver solver , HYPRE_Real *a_tol ); - HYPRE_Int HYPRE_GMRESSetConvergenceFactorTol ( HYPRE_Solver solver , HYPRE_Real cf_tol ); - HYPRE_Int HYPRE_GMRESGetConvergenceFactorTol ( HYPRE_Solver solver , HYPRE_Real *cf_tol ); - HYPRE_Int HYPRE_GMRESSetMinIter ( HYPRE_Solver solver , HYPRE_Int min_iter ); - HYPRE_Int HYPRE_GMRESGetMinIter ( HYPRE_Solver solver , HYPRE_Int *min_iter ); - HYPRE_Int HYPRE_GMRESSetMaxIter ( HYPRE_Solver solver , HYPRE_Int max_iter ); - HYPRE_Int HYPRE_GMRESGetMaxIter ( HYPRE_Solver solver , HYPRE_Int *max_iter ); - HYPRE_Int HYPRE_GMRESSetStopCrit ( HYPRE_Solver solver , HYPRE_Int stop_crit ); - HYPRE_Int HYPRE_GMRESGetStopCrit ( HYPRE_Solver solver , HYPRE_Int *stop_crit ); - HYPRE_Int HYPRE_GMRESSetRelChange ( HYPRE_Solver solver , HYPRE_Int rel_change ); - HYPRE_Int HYPRE_GMRESGetRelChange ( HYPRE_Solver solver , HYPRE_Int *rel_change ); - HYPRE_Int HYPRE_GMRESSetSkipRealResidualCheck ( HYPRE_Solver solver , HYPRE_Int skip_real_r_check ); - HYPRE_Int HYPRE_GMRESGetSkipRealResidualCheck ( HYPRE_Solver solver , HYPRE_Int *skip_real_r_check ); - HYPRE_Int HYPRE_GMRESSetPrecond ( HYPRE_Solver solver , HYPRE_PtrToSolverFcn precond , HYPRE_PtrToSolverFcn precond_setup , HYPRE_Solver precond_solver ); - HYPRE_Int HYPRE_GMRESGetPrecond ( HYPRE_Solver solver , HYPRE_Solver *precond_data_ptr ); - HYPRE_Int HYPRE_GMRESSetPrintLevel ( HYPRE_Solver solver , HYPRE_Int level ); - HYPRE_Int HYPRE_GMRESGetPrintLevel ( HYPRE_Solver solver , HYPRE_Int *level ); - HYPRE_Int HYPRE_GMRESSetLogging ( HYPRE_Solver solver , HYPRE_Int level ); - HYPRE_Int HYPRE_GMRESGetLogging ( HYPRE_Solver solver , HYPRE_Int *level ); - HYPRE_Int HYPRE_GMRESGetNumIterations ( HYPRE_Solver solver , HYPRE_Int *num_iterations ); - HYPRE_Int HYPRE_GMRESGetConverged ( HYPRE_Solver solver , HYPRE_Int *converged ); - HYPRE_Int HYPRE_GMRESGetFinalRelativeResidualNorm ( HYPRE_Solver solver , HYPRE_Real *norm ); - HYPRE_Int HYPRE_GMRESGetResidual ( HYPRE_Solver solver , void *residual ); - - /* HYPRE_cogmres.c */ - HYPRE_Int HYPRE_COGMRESSetup ( HYPRE_Solver solver , HYPRE_Matrix A , HYPRE_Vector b , HYPRE_Vector x ); - HYPRE_Int HYPRE_COGMRESSolve ( HYPRE_Solver solver , HYPRE_Matrix A , HYPRE_Vector b , HYPRE_Vector x ); - HYPRE_Int HYPRE_COGMRESSetKDim ( HYPRE_Solver solver , HYPRE_Int k_dim ); - HYPRE_Int HYPRE_COGMRESGetKDim ( HYPRE_Solver solver , HYPRE_Int *k_dim ); - HYPRE_Int HYPRE_COGMRESSetUnroll ( HYPRE_Solver solver , HYPRE_Int unroll ); - HYPRE_Int HYPRE_COGMRESGetUnroll ( HYPRE_Solver solver , HYPRE_Int *unroll ); - HYPRE_Int HYPRE_COGMRESSetCGS ( HYPRE_Solver solver , HYPRE_Int cgs ); - HYPRE_Int HYPRE_COGMRESGetCGS ( HYPRE_Solver solver , HYPRE_Int *cgs ); - HYPRE_Int HYPRE_COGMRESSetTol ( HYPRE_Solver solver , HYPRE_Real tol ); - HYPRE_Int HYPRE_COGMRESGetTol ( HYPRE_Solver solver , HYPRE_Real *tol ); - HYPRE_Int HYPRE_COGMRESSetAbsoluteTol ( HYPRE_Solver solver , HYPRE_Real a_tol ); - HYPRE_Int HYPRE_COGMRESGetAbsoluteTol ( HYPRE_Solver solver , HYPRE_Real *a_tol ); - HYPRE_Int HYPRE_COGMRESSetConvergenceFactorTol ( HYPRE_Solver solver , HYPRE_Real cf_tol ); - HYPRE_Int HYPRE_COGMRESGetConvergenceFactorTol ( HYPRE_Solver solver , HYPRE_Real *cf_tol ); - HYPRE_Int HYPRE_COGMRESSetMinIter ( HYPRE_Solver solver , HYPRE_Int min_iter ); - HYPRE_Int HYPRE_COGMRESGetMinIter ( HYPRE_Solver solver , HYPRE_Int *min_iter ); - HYPRE_Int HYPRE_COGMRESSetMaxIter ( HYPRE_Solver solver , HYPRE_Int max_iter ); - HYPRE_Int HYPRE_COGMRESGetMaxIter ( HYPRE_Solver solver , HYPRE_Int *max_iter ); - HYPRE_Int HYPRE_COGMRESSetRelChange ( HYPRE_Solver solver , HYPRE_Int rel_change ); - HYPRE_Int HYPRE_COGMRESGetRelChange ( HYPRE_Solver solver , HYPRE_Int *rel_change ); - HYPRE_Int HYPRE_COGMRESSetSkipRealResidualCheck ( HYPRE_Solver solver , HYPRE_Int skip_real_r_check ); - HYPRE_Int HYPRE_COGMRESGetSkipRealResidualCheck ( HYPRE_Solver solver , HYPRE_Int *skip_real_r_check ); - HYPRE_Int HYPRE_COGMRESSetPrecond ( HYPRE_Solver solver , HYPRE_PtrToSolverFcn precond , HYPRE_PtrToSolverFcn precond_setup , HYPRE_Solver precond_solver ); - HYPRE_Int HYPRE_COGMRESGetPrecond ( HYPRE_Solver solver , HYPRE_Solver *precond_data_ptr ); - HYPRE_Int HYPRE_COGMRESSetPrintLevel ( HYPRE_Solver solver , HYPRE_Int level ); - HYPRE_Int HYPRE_COGMRESGetPrintLevel ( HYPRE_Solver solver , HYPRE_Int *level ); - HYPRE_Int HYPRE_COGMRESSetLogging ( HYPRE_Solver solver , HYPRE_Int level ); - HYPRE_Int HYPRE_COGMRESGetLogging ( HYPRE_Solver solver , HYPRE_Int *level ); - HYPRE_Int HYPRE_COGMRESGetNumIterations ( HYPRE_Solver solver , HYPRE_Int *num_iterations ); - HYPRE_Int HYPRE_COGMRESGetConverged ( HYPRE_Solver solver , HYPRE_Int *converged ); - HYPRE_Int HYPRE_COGMRESGetFinalRelativeResidualNorm ( HYPRE_Solver solver , HYPRE_Real *norm ); - HYPRE_Int HYPRE_COGMRESGetResidual ( HYPRE_Solver solver , void *residual ); - - /* HYPRE_flexgmres.c */ - HYPRE_Int HYPRE_FlexGMRESSetup ( HYPRE_Solver solver , HYPRE_Matrix A , HYPRE_Vector b , HYPRE_Vector x ); - HYPRE_Int HYPRE_FlexGMRESSolve ( HYPRE_Solver solver , HYPRE_Matrix A , HYPRE_Vector b , HYPRE_Vector x ); - HYPRE_Int HYPRE_FlexGMRESSetKDim ( HYPRE_Solver solver , HYPRE_Int k_dim ); - HYPRE_Int HYPRE_FlexGMRESGetKDim ( HYPRE_Solver solver , HYPRE_Int *k_dim ); - HYPRE_Int HYPRE_FlexGMRESSetTol ( HYPRE_Solver solver , HYPRE_Real tol ); - HYPRE_Int HYPRE_FlexGMRESGetTol ( HYPRE_Solver solver , HYPRE_Real *tol ); - HYPRE_Int HYPRE_FlexGMRESSetAbsoluteTol ( HYPRE_Solver solver , HYPRE_Real a_tol ); - HYPRE_Int HYPRE_FlexGMRESGetAbsoluteTol ( HYPRE_Solver solver , HYPRE_Real *a_tol ); - HYPRE_Int HYPRE_FlexGMRESSetConvergenceFactorTol ( HYPRE_Solver solver , HYPRE_Real cf_tol ); - HYPRE_Int HYPRE_FlexGMRESGetConvergenceFactorTol ( HYPRE_Solver solver , HYPRE_Real *cf_tol ); - HYPRE_Int HYPRE_FlexGMRESSetMinIter ( HYPRE_Solver solver , HYPRE_Int min_iter ); - HYPRE_Int HYPRE_FlexGMRESGetMinIter ( HYPRE_Solver solver , HYPRE_Int *min_iter ); - HYPRE_Int HYPRE_FlexGMRESSetMaxIter ( HYPRE_Solver solver , HYPRE_Int max_iter ); - HYPRE_Int HYPRE_FlexGMRESGetMaxIter ( HYPRE_Solver solver , HYPRE_Int *max_iter ); - HYPRE_Int HYPRE_FlexGMRESSetPrecond ( HYPRE_Solver solver , HYPRE_PtrToSolverFcn precond , HYPRE_PtrToSolverFcn precond_setup , HYPRE_Solver precond_solver ); - HYPRE_Int HYPRE_FlexGMRESGetPrecond ( HYPRE_Solver solver , HYPRE_Solver *precond_data_ptr ); - HYPRE_Int HYPRE_FlexGMRESSetPrintLevel ( HYPRE_Solver solver , HYPRE_Int level ); - HYPRE_Int HYPRE_FlexGMRESGetPrintLevel ( HYPRE_Solver solver , HYPRE_Int *level ); - HYPRE_Int HYPRE_FlexGMRESSetLogging ( HYPRE_Solver solver , HYPRE_Int level ); - HYPRE_Int HYPRE_FlexGMRESGetLogging ( HYPRE_Solver solver , HYPRE_Int *level ); - HYPRE_Int HYPRE_FlexGMRESGetNumIterations ( HYPRE_Solver solver , HYPRE_Int *num_iterations ); - HYPRE_Int HYPRE_FlexGMRESGetConverged ( HYPRE_Solver solver , HYPRE_Int *converged ); - HYPRE_Int HYPRE_FlexGMRESGetFinalRelativeResidualNorm ( HYPRE_Solver solver , HYPRE_Real *norm ); - HYPRE_Int HYPRE_FlexGMRESGetResidual ( HYPRE_Solver solver , void *residual ); - HYPRE_Int HYPRE_FlexGMRESSetModifyPC ( HYPRE_Solver solver , HYPRE_Int (*modify_pc )(HYPRE_Solver ,HYPRE_Int ,HYPRE_Real )); - - /* HYPRE_lgmres.c */ - HYPRE_Int HYPRE_LGMRESSetup ( HYPRE_Solver solver , HYPRE_Matrix A , HYPRE_Vector b , HYPRE_Vector x ); - HYPRE_Int HYPRE_LGMRESSolve ( HYPRE_Solver solver , HYPRE_Matrix A , HYPRE_Vector b , HYPRE_Vector x ); - HYPRE_Int HYPRE_LGMRESSetKDim ( HYPRE_Solver solver , HYPRE_Int k_dim ); - HYPRE_Int HYPRE_LGMRESGetKDim ( HYPRE_Solver solver , HYPRE_Int *k_dim ); - HYPRE_Int HYPRE_LGMRESSetAugDim ( HYPRE_Solver solver , HYPRE_Int aug_dim ); - HYPRE_Int HYPRE_LGMRESGetAugDim ( HYPRE_Solver solver , HYPRE_Int *aug_dim ); - HYPRE_Int HYPRE_LGMRESSetTol ( HYPRE_Solver solver , HYPRE_Real tol ); - HYPRE_Int HYPRE_LGMRESGetTol ( HYPRE_Solver solver , HYPRE_Real *tol ); - HYPRE_Int HYPRE_LGMRESSetAbsoluteTol ( HYPRE_Solver solver , HYPRE_Real a_tol ); - HYPRE_Int HYPRE_LGMRESGetAbsoluteTol ( HYPRE_Solver solver , HYPRE_Real *a_tol ); - HYPRE_Int HYPRE_LGMRESSetConvergenceFactorTol ( HYPRE_Solver solver , HYPRE_Real cf_tol ); - HYPRE_Int HYPRE_LGMRESGetConvergenceFactorTol ( HYPRE_Solver solver , HYPRE_Real *cf_tol ); - HYPRE_Int HYPRE_LGMRESSetMinIter ( HYPRE_Solver solver , HYPRE_Int min_iter ); - HYPRE_Int HYPRE_LGMRESGetMinIter ( HYPRE_Solver solver , HYPRE_Int *min_iter ); - HYPRE_Int HYPRE_LGMRESSetMaxIter ( HYPRE_Solver solver , HYPRE_Int max_iter ); - HYPRE_Int HYPRE_LGMRESGetMaxIter ( HYPRE_Solver solver , HYPRE_Int *max_iter ); - HYPRE_Int HYPRE_LGMRESSetPrecond ( HYPRE_Solver solver , HYPRE_PtrToSolverFcn precond , HYPRE_PtrToSolverFcn precond_setup , HYPRE_Solver precond_solver ); - HYPRE_Int HYPRE_LGMRESGetPrecond ( HYPRE_Solver solver , HYPRE_Solver *precond_data_ptr ); - HYPRE_Int HYPRE_LGMRESSetPrintLevel ( HYPRE_Solver solver , HYPRE_Int level ); - HYPRE_Int HYPRE_LGMRESGetPrintLevel ( HYPRE_Solver solver , HYPRE_Int *level ); - HYPRE_Int HYPRE_LGMRESSetLogging ( HYPRE_Solver solver , HYPRE_Int level ); - HYPRE_Int HYPRE_LGMRESGetLogging ( HYPRE_Solver solver , HYPRE_Int *level ); - HYPRE_Int HYPRE_LGMRESGetNumIterations ( HYPRE_Solver solver , HYPRE_Int *num_iterations ); - HYPRE_Int HYPRE_LGMRESGetConverged ( HYPRE_Solver solver , HYPRE_Int *converged ); - HYPRE_Int HYPRE_LGMRESGetFinalRelativeResidualNorm ( HYPRE_Solver solver , HYPRE_Real *norm ); - HYPRE_Int HYPRE_LGMRESGetResidual ( HYPRE_Solver solver , void *residual ); - - /* HYPRE_pcg.c */ - HYPRE_Int HYPRE_PCGSetup ( HYPRE_Solver solver , HYPRE_Matrix A , HYPRE_Vector b , HYPRE_Vector x ); - HYPRE_Int HYPRE_PCGSolve ( HYPRE_Solver solver , HYPRE_Matrix A , HYPRE_Vector b , HYPRE_Vector x ); - HYPRE_Int HYPRE_PCGSetTol ( HYPRE_Solver solver , HYPRE_Real tol ); - HYPRE_Int HYPRE_PCGGetTol ( HYPRE_Solver solver , HYPRE_Real *tol ); - HYPRE_Int HYPRE_PCGSetAbsoluteTol ( HYPRE_Solver solver , HYPRE_Real a_tol ); - HYPRE_Int HYPRE_PCGGetAbsoluteTol ( HYPRE_Solver solver , HYPRE_Real *a_tol ); - HYPRE_Int HYPRE_PCGSetAbsoluteTolFactor ( HYPRE_Solver solver , HYPRE_Real abstolf ); - HYPRE_Int HYPRE_PCGGetAbsoluteTolFactor ( HYPRE_Solver solver , HYPRE_Real *abstolf ); - HYPRE_Int HYPRE_PCGSetResidualTol ( HYPRE_Solver solver , HYPRE_Real rtol ); - HYPRE_Int HYPRE_PCGGetResidualTol ( HYPRE_Solver solver , HYPRE_Real *rtol ); - HYPRE_Int HYPRE_PCGSetConvergenceFactorTol ( HYPRE_Solver solver , HYPRE_Real cf_tol ); - HYPRE_Int HYPRE_PCGGetConvergenceFactorTol ( HYPRE_Solver solver , HYPRE_Real *cf_tol ); - HYPRE_Int HYPRE_PCGSetMaxIter ( HYPRE_Solver solver , HYPRE_Int max_iter ); - HYPRE_Int HYPRE_PCGGetMaxIter ( HYPRE_Solver solver , HYPRE_Int *max_iter ); - HYPRE_Int HYPRE_PCGSetStopCrit ( HYPRE_Solver solver , HYPRE_Int stop_crit ); - HYPRE_Int HYPRE_PCGGetStopCrit ( HYPRE_Solver solver , HYPRE_Int *stop_crit ); - HYPRE_Int HYPRE_PCGSetTwoNorm ( HYPRE_Solver solver , HYPRE_Int two_norm ); - HYPRE_Int HYPRE_PCGGetTwoNorm ( HYPRE_Solver solver , HYPRE_Int *two_norm ); - HYPRE_Int HYPRE_PCGSetRelChange ( HYPRE_Solver solver , HYPRE_Int rel_change ); - HYPRE_Int HYPRE_PCGGetRelChange ( HYPRE_Solver solver , HYPRE_Int *rel_change ); - HYPRE_Int HYPRE_PCGSetRecomputeResidual ( HYPRE_Solver solver , HYPRE_Int recompute_residual ); - HYPRE_Int HYPRE_PCGGetRecomputeResidual ( HYPRE_Solver solver , HYPRE_Int *recompute_residual ); - HYPRE_Int HYPRE_PCGSetRecomputeResidualP ( HYPRE_Solver solver , HYPRE_Int recompute_residual_p ); - HYPRE_Int HYPRE_PCGGetRecomputeResidualP ( HYPRE_Solver solver , HYPRE_Int *recompute_residual_p ); - HYPRE_Int HYPRE_PCGSetPrecond ( HYPRE_Solver solver , HYPRE_PtrToSolverFcn precond , HYPRE_PtrToSolverFcn precond_setup , HYPRE_Solver precond_solver ); - HYPRE_Int HYPRE_PCGGetPrecond ( HYPRE_Solver solver , HYPRE_Solver *precond_data_ptr ); - HYPRE_Int HYPRE_PCGSetLogging ( HYPRE_Solver solver , HYPRE_Int level ); - HYPRE_Int HYPRE_PCGGetLogging ( HYPRE_Solver solver , HYPRE_Int *level ); - HYPRE_Int HYPRE_PCGSetPrintLevel ( HYPRE_Solver solver , HYPRE_Int level ); - HYPRE_Int HYPRE_PCGGetPrintLevel ( HYPRE_Solver solver , HYPRE_Int *level ); - HYPRE_Int HYPRE_PCGGetNumIterations ( HYPRE_Solver solver , HYPRE_Int *num_iterations ); - HYPRE_Int HYPRE_PCGGetConverged ( HYPRE_Solver solver , HYPRE_Int *converged ); - HYPRE_Int HYPRE_PCGGetFinalRelativeResidualNorm ( HYPRE_Solver solver , HYPRE_Real *norm ); - HYPRE_Int HYPRE_PCGGetResidual ( HYPRE_Solver solver , void *residual ); - - /* pcg.c */ - void *hypre_PCGCreate ( hypre_PCGFunctions *pcg_functions ); - HYPRE_Int hypre_PCGDestroy ( void *pcg_vdata ); - HYPRE_Int hypre_PCGGetResidual ( void *pcg_vdata , void **residual ); - HYPRE_Int hypre_PCGSetup ( void *pcg_vdata , void *A , void *b , void *x ); - HYPRE_Int hypre_PCGSolve ( void *pcg_vdata , void *A , void *b , void *x ); - HYPRE_Int hypre_PCGSetTol ( void *pcg_vdata , HYPRE_Real tol ); - HYPRE_Int hypre_PCGGetTol ( void *pcg_vdata , HYPRE_Real *tol ); - HYPRE_Int hypre_PCGSetAbsoluteTol ( void *pcg_vdata , HYPRE_Real a_tol ); - HYPRE_Int hypre_PCGGetAbsoluteTol ( void *pcg_vdata , HYPRE_Real *a_tol ); - HYPRE_Int hypre_PCGSetAbsoluteTolFactor ( void *pcg_vdata , HYPRE_Real atolf ); - HYPRE_Int hypre_PCGGetAbsoluteTolFactor ( void *pcg_vdata , HYPRE_Real *atolf ); - HYPRE_Int hypre_PCGSetResidualTol ( void *pcg_vdata , HYPRE_Real rtol ); - HYPRE_Int hypre_PCGGetResidualTol ( void *pcg_vdata , HYPRE_Real *rtol ); - HYPRE_Int hypre_PCGSetConvergenceFactorTol ( void *pcg_vdata , HYPRE_Real cf_tol ); - HYPRE_Int hypre_PCGGetConvergenceFactorTol ( void *pcg_vdata , HYPRE_Real *cf_tol ); - HYPRE_Int hypre_PCGSetMaxIter ( void *pcg_vdata , HYPRE_Int max_iter ); - HYPRE_Int hypre_PCGGetMaxIter ( void *pcg_vdata , HYPRE_Int *max_iter ); - HYPRE_Int hypre_PCGSetTwoNorm ( void *pcg_vdata , HYPRE_Int two_norm ); - HYPRE_Int hypre_PCGGetTwoNorm ( void *pcg_vdata , HYPRE_Int *two_norm ); - HYPRE_Int hypre_PCGSetRelChange ( void *pcg_vdata , HYPRE_Int rel_change ); - HYPRE_Int hypre_PCGGetRelChange ( void *pcg_vdata , HYPRE_Int *rel_change ); - HYPRE_Int hypre_PCGSetRecomputeResidual ( void *pcg_vdata , HYPRE_Int recompute_residual ); - HYPRE_Int hypre_PCGGetRecomputeResidual ( void *pcg_vdata , HYPRE_Int *recompute_residual ); - HYPRE_Int hypre_PCGSetRecomputeResidualP ( void *pcg_vdata , HYPRE_Int recompute_residual_p ); - HYPRE_Int hypre_PCGGetRecomputeResidualP ( void *pcg_vdata , HYPRE_Int *recompute_residual_p ); - HYPRE_Int hypre_PCGSetStopCrit ( void *pcg_vdata , HYPRE_Int stop_crit ); - HYPRE_Int hypre_PCGGetStopCrit ( void *pcg_vdata , HYPRE_Int *stop_crit ); - HYPRE_Int hypre_PCGGetPrecond ( void *pcg_vdata , HYPRE_Solver *precond_data_ptr ); - HYPRE_Int hypre_PCGSetPrecond ( void *pcg_vdata , HYPRE_Int (*precond )(void*,void*,void*,void*), HYPRE_Int (*precond_setup )(void*,void*,void*,void*), void *precond_data ); - HYPRE_Int hypre_PCGSetPrintLevel ( void *pcg_vdata , HYPRE_Int level ); - HYPRE_Int hypre_PCGGetPrintLevel ( void *pcg_vdata , HYPRE_Int *level ); - HYPRE_Int hypre_PCGSetLogging ( void *pcg_vdata , HYPRE_Int level ); - HYPRE_Int hypre_PCGGetLogging ( void *pcg_vdata , HYPRE_Int *level ); - HYPRE_Int hypre_PCGSetHybrid ( void *pcg_vdata , HYPRE_Int level ); - HYPRE_Int hypre_PCGGetNumIterations ( void *pcg_vdata , HYPRE_Int *num_iterations ); - HYPRE_Int hypre_PCGGetConverged ( void *pcg_vdata , HYPRE_Int *converged ); - HYPRE_Int hypre_PCGPrintLogging ( void *pcg_vdata , HYPRE_Int myid ); - HYPRE_Int hypre_PCGGetFinalRelativeResidualNorm ( void *pcg_vdata , HYPRE_Real *relative_residual_norm ); +/* bicgstab.c */ +void *hypre_BiCGSTABCreate ( hypre_BiCGSTABFunctions *bicgstab_functions ); +HYPRE_Int hypre_BiCGSTABDestroy ( void *bicgstab_vdata ); +HYPRE_Int hypre_BiCGSTABSetup ( void *bicgstab_vdata, void *A, void *b, void *x ); +HYPRE_Int hypre_BiCGSTABSolve ( void *bicgstab_vdata, void *A, void *b, void *x ); +HYPRE_Int hypre_BiCGSTABSetTol ( void *bicgstab_vdata, HYPRE_Real tol ); +HYPRE_Int hypre_BiCGSTABSetAbsoluteTol ( void *bicgstab_vdata, HYPRE_Real a_tol ); +HYPRE_Int hypre_BiCGSTABSetConvergenceFactorTol ( void *bicgstab_vdata, HYPRE_Real cf_tol ); +HYPRE_Int hypre_BiCGSTABSetMinIter ( void *bicgstab_vdata, HYPRE_Int min_iter ); +HYPRE_Int hypre_BiCGSTABSetMaxIter ( void *bicgstab_vdata, HYPRE_Int max_iter ); +HYPRE_Int hypre_BiCGSTABSetStopCrit ( void *bicgstab_vdata, HYPRE_Int stop_crit ); +HYPRE_Int hypre_BiCGSTABSetPrecond ( void *bicgstab_vdata, HYPRE_Int (*precond )(void*, void*, + void*, + void*), HYPRE_Int (*precond_setup )(void*, void*, void*, void*), void *precond_data ); +HYPRE_Int hypre_BiCGSTABGetPrecond ( void *bicgstab_vdata, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int hypre_BiCGSTABSetLogging ( void *bicgstab_vdata, HYPRE_Int logging ); +HYPRE_Int hypre_BiCGSTABSetHybrid ( void *bicgstab_vdata, HYPRE_Int logging ); +HYPRE_Int hypre_BiCGSTABSetPrintLevel ( void *bicgstab_vdata, HYPRE_Int print_level ); +HYPRE_Int hypre_BiCGSTABGetConverged ( void *bicgstab_vdata, HYPRE_Int *converged ); +HYPRE_Int hypre_BiCGSTABGetNumIterations ( void *bicgstab_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int hypre_BiCGSTABGetFinalRelativeResidualNorm ( void *bicgstab_vdata, + HYPRE_Real *relative_residual_norm ); +HYPRE_Int hypre_BiCGSTABGetResidual ( void *bicgstab_vdata, void **residual ); + +/* cgnr.c */ +void *hypre_CGNRCreate ( hypre_CGNRFunctions *cgnr_functions ); +HYPRE_Int hypre_CGNRDestroy ( void *cgnr_vdata ); +HYPRE_Int hypre_CGNRSetup ( void *cgnr_vdata, void *A, void *b, void *x ); +HYPRE_Int hypre_CGNRSolve ( void *cgnr_vdata, void *A, void *b, void *x ); +HYPRE_Int hypre_CGNRSetTol ( void *cgnr_vdata, HYPRE_Real tol ); +HYPRE_Int hypre_CGNRSetMinIter ( void *cgnr_vdata, HYPRE_Int min_iter ); +HYPRE_Int hypre_CGNRSetMaxIter ( void *cgnr_vdata, HYPRE_Int max_iter ); +HYPRE_Int hypre_CGNRSetStopCrit ( void *cgnr_vdata, HYPRE_Int stop_crit ); +HYPRE_Int hypre_CGNRSetPrecond ( void *cgnr_vdata, HYPRE_Int (*precond )(void*, void*, void*, + void*), + HYPRE_Int (*precondT )(void*, void*, void*, void*), HYPRE_Int (*precond_setup )(void*, void*, void*, + void*), void *precond_data ); +HYPRE_Int hypre_CGNRGetPrecond ( void *cgnr_vdata, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int hypre_CGNRSetLogging ( void *cgnr_vdata, HYPRE_Int logging ); +HYPRE_Int hypre_CGNRGetNumIterations ( void *cgnr_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int hypre_CGNRGetFinalRelativeResidualNorm ( void *cgnr_vdata, + HYPRE_Real *relative_residual_norm ); + +/* gmres.c */ +void *hypre_GMRESCreate ( hypre_GMRESFunctions *gmres_functions ); +HYPRE_Int hypre_GMRESDestroy ( void *gmres_vdata ); +HYPRE_Int hypre_GMRESGetResidual ( void *gmres_vdata, void **residual ); +HYPRE_Int hypre_GMRESSetup ( void *gmres_vdata, void *A, void *b, void *x ); +HYPRE_Int hypre_GMRESSolve ( void *gmres_vdata, void *A, void *b, void *x ); +HYPRE_Int hypre_GMRESSetKDim ( void *gmres_vdata, HYPRE_Int k_dim ); +HYPRE_Int hypre_GMRESGetKDim ( void *gmres_vdata, HYPRE_Int *k_dim ); +HYPRE_Int hypre_GMRESSetTol ( void *gmres_vdata, HYPRE_Real tol ); +HYPRE_Int hypre_GMRESGetTol ( void *gmres_vdata, HYPRE_Real *tol ); +HYPRE_Int hypre_GMRESSetAbsoluteTol ( void *gmres_vdata, HYPRE_Real a_tol ); +HYPRE_Int hypre_GMRESGetAbsoluteTol ( void *gmres_vdata, HYPRE_Real *a_tol ); +HYPRE_Int hypre_GMRESSetConvergenceFactorTol ( void *gmres_vdata, HYPRE_Real cf_tol ); +HYPRE_Int hypre_GMRESGetConvergenceFactorTol ( void *gmres_vdata, HYPRE_Real *cf_tol ); +HYPRE_Int hypre_GMRESSetMinIter ( void *gmres_vdata, HYPRE_Int min_iter ); +HYPRE_Int hypre_GMRESGetMinIter ( void *gmres_vdata, HYPRE_Int *min_iter ); +HYPRE_Int hypre_GMRESSetMaxIter ( void *gmres_vdata, HYPRE_Int max_iter ); +HYPRE_Int hypre_GMRESGetMaxIter ( void *gmres_vdata, HYPRE_Int *max_iter ); +HYPRE_Int hypre_GMRESSetRelChange ( void *gmres_vdata, HYPRE_Int rel_change ); +HYPRE_Int hypre_GMRESGetRelChange ( void *gmres_vdata, HYPRE_Int *rel_change ); +HYPRE_Int hypre_GMRESSetSkipRealResidualCheck ( void *gmres_vdata, HYPRE_Int skip_real_r_check ); +HYPRE_Int hypre_GMRESGetSkipRealResidualCheck ( void *gmres_vdata, HYPRE_Int *skip_real_r_check ); +HYPRE_Int hypre_GMRESSetStopCrit ( void *gmres_vdata, HYPRE_Int stop_crit ); +HYPRE_Int hypre_GMRESGetStopCrit ( void *gmres_vdata, HYPRE_Int *stop_crit ); +HYPRE_Int hypre_GMRESSetPrecond ( void *gmres_vdata, HYPRE_Int (*precond )(void*, void*, void*, + void*), + HYPRE_Int (*precond_setup )(void*, void*, void*, void*), void *precond_data ); +HYPRE_Int hypre_GMRESGetPrecond ( void *gmres_vdata, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int hypre_GMRESSetPrintLevel ( void *gmres_vdata, HYPRE_Int level ); +HYPRE_Int hypre_GMRESGetPrintLevel ( void *gmres_vdata, HYPRE_Int *level ); +HYPRE_Int hypre_GMRESSetLogging ( void *gmres_vdata, HYPRE_Int level ); +HYPRE_Int hypre_GMRESGetLogging ( void *gmres_vdata, HYPRE_Int *level ); +HYPRE_Int hypre_GMRESSetHybrid ( void *gmres_vdata, HYPRE_Int level ); +HYPRE_Int hypre_GMRESGetNumIterations ( void *gmres_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int hypre_GMRESGetConverged ( void *gmres_vdata, HYPRE_Int *converged ); +HYPRE_Int hypre_GMRESGetFinalRelativeResidualNorm ( void *gmres_vdata, + HYPRE_Real *relative_residual_norm ); + +/* cogmres.c */ +void *hypre_COGMRESCreate ( hypre_COGMRESFunctions *gmres_functions ); +HYPRE_Int hypre_COGMRESDestroy ( void *gmres_vdata ); +HYPRE_Int hypre_COGMRESGetResidual ( void *gmres_vdata, void **residual ); +HYPRE_Int hypre_COGMRESSetup ( void *gmres_vdata, void *A, void *b, void *x ); +HYPRE_Int hypre_COGMRESSolve ( void *gmres_vdata, void *A, void *b, void *x ); +HYPRE_Int hypre_COGMRESSetKDim ( void *gmres_vdata, HYPRE_Int k_dim ); +HYPRE_Int hypre_COGMRESGetKDim ( void *gmres_vdata, HYPRE_Int *k_dim ); +HYPRE_Int hypre_COGMRESSetUnroll ( void *gmres_vdata, HYPRE_Int unroll ); +HYPRE_Int hypre_COGMRESGetUnroll ( void *gmres_vdata, HYPRE_Int *unroll ); +HYPRE_Int hypre_COGMRESSetCGS ( void *gmres_vdata, HYPRE_Int cgs ); +HYPRE_Int hypre_COGMRESGetCGS ( void *gmres_vdata, HYPRE_Int *cgs ); +HYPRE_Int hypre_COGMRESSetTol ( void *gmres_vdata, HYPRE_Real tol ); +HYPRE_Int hypre_COGMRESGetTol ( void *gmres_vdata, HYPRE_Real *tol ); +HYPRE_Int hypre_COGMRESSetAbsoluteTol ( void *gmres_vdata, HYPRE_Real a_tol ); +HYPRE_Int hypre_COGMRESGetAbsoluteTol ( void *gmres_vdata, HYPRE_Real *a_tol ); +HYPRE_Int hypre_COGMRESSetConvergenceFactorTol ( void *gmres_vdata, HYPRE_Real cf_tol ); +HYPRE_Int hypre_COGMRESGetConvergenceFactorTol ( void *gmres_vdata, HYPRE_Real *cf_tol ); +HYPRE_Int hypre_COGMRESSetMinIter ( void *gmres_vdata, HYPRE_Int min_iter ); +HYPRE_Int hypre_COGMRESGetMinIter ( void *gmres_vdata, HYPRE_Int *min_iter ); +HYPRE_Int hypre_COGMRESSetMaxIter ( void *gmres_vdata, HYPRE_Int max_iter ); +HYPRE_Int hypre_COGMRESGetMaxIter ( void *gmres_vdata, HYPRE_Int *max_iter ); +HYPRE_Int hypre_COGMRESSetRelChange ( void *gmres_vdata, HYPRE_Int rel_change ); +HYPRE_Int hypre_COGMRESGetRelChange ( void *gmres_vdata, HYPRE_Int *rel_change ); +HYPRE_Int hypre_COGMRESSetSkipRealResidualCheck ( void *gmres_vdata, HYPRE_Int skip_real_r_check ); +HYPRE_Int hypre_COGMRESGetSkipRealResidualCheck ( void *gmres_vdata, HYPRE_Int *skip_real_r_check ); +HYPRE_Int hypre_COGMRESSetPrecond ( void *gmres_vdata, HYPRE_Int (*precond )(void*, void*, void*, + void*), HYPRE_Int (*precond_setup )(void*, void*, void*, void*), void *precond_data ); +HYPRE_Int hypre_COGMRESGetPrecond ( void *gmres_vdata, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int hypre_COGMRESSetPrintLevel ( void *gmres_vdata, HYPRE_Int level ); +HYPRE_Int hypre_COGMRESGetPrintLevel ( void *gmres_vdata, HYPRE_Int *level ); +HYPRE_Int hypre_COGMRESSetLogging ( void *gmres_vdata, HYPRE_Int level ); +HYPRE_Int hypre_COGMRESGetLogging ( void *gmres_vdata, HYPRE_Int *level ); +HYPRE_Int hypre_COGMRESGetNumIterations ( void *gmres_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int hypre_COGMRESGetConverged ( void *gmres_vdata, HYPRE_Int *converged ); +HYPRE_Int hypre_COGMRESGetFinalRelativeResidualNorm ( void *gmres_vdata, + HYPRE_Real *relative_residual_norm ); +HYPRE_Int hypre_COGMRESSetModifyPC ( void *fgmres_vdata, HYPRE_Int (*modify_pc )(void *precond_data, + HYPRE_Int iteration, HYPRE_Real rel_residual_norm)); + + + +/* flexgmres.c */ +void *hypre_FlexGMRESCreate ( hypre_FlexGMRESFunctions *fgmres_functions ); +HYPRE_Int hypre_FlexGMRESDestroy ( void *fgmres_vdata ); +HYPRE_Int hypre_FlexGMRESGetResidual ( void *fgmres_vdata, void **residual ); +HYPRE_Int hypre_FlexGMRESSetup ( void *fgmres_vdata, void *A, void *b, void *x ); +HYPRE_Int hypre_FlexGMRESSolve ( void *fgmres_vdata, void *A, void *b, void *x ); +HYPRE_Int hypre_FlexGMRESSetKDim ( void *fgmres_vdata, HYPRE_Int k_dim ); +HYPRE_Int hypre_FlexGMRESGetKDim ( void *fgmres_vdata, HYPRE_Int *k_dim ); +HYPRE_Int hypre_FlexGMRESSetTol ( void *fgmres_vdata, HYPRE_Real tol ); +HYPRE_Int hypre_FlexGMRESGetTol ( void *fgmres_vdata, HYPRE_Real *tol ); +HYPRE_Int hypre_FlexGMRESSetAbsoluteTol ( void *fgmres_vdata, HYPRE_Real a_tol ); +HYPRE_Int hypre_FlexGMRESGetAbsoluteTol ( void *fgmres_vdata, HYPRE_Real *a_tol ); +HYPRE_Int hypre_FlexGMRESSetConvergenceFactorTol ( void *fgmres_vdata, HYPRE_Real cf_tol ); +HYPRE_Int hypre_FlexGMRESGetConvergenceFactorTol ( void *fgmres_vdata, HYPRE_Real *cf_tol ); +HYPRE_Int hypre_FlexGMRESSetMinIter ( void *fgmres_vdata, HYPRE_Int min_iter ); +HYPRE_Int hypre_FlexGMRESGetMinIter ( void *fgmres_vdata, HYPRE_Int *min_iter ); +HYPRE_Int hypre_FlexGMRESSetMaxIter ( void *fgmres_vdata, HYPRE_Int max_iter ); +HYPRE_Int hypre_FlexGMRESGetMaxIter ( void *fgmres_vdata, HYPRE_Int *max_iter ); +HYPRE_Int hypre_FlexGMRESSetStopCrit ( void *fgmres_vdata, HYPRE_Int stop_crit ); +HYPRE_Int hypre_FlexGMRESGetStopCrit ( void *fgmres_vdata, HYPRE_Int *stop_crit ); +HYPRE_Int hypre_FlexGMRESSetPrecond ( void *fgmres_vdata, HYPRE_Int (*precond )(void*, void*, void*, + void*), HYPRE_Int (*precond_setup )(void*, void*, void*, void*), void *precond_data ); +HYPRE_Int hypre_FlexGMRESGetPrecond ( void *fgmres_vdata, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int hypre_FlexGMRESSetPrintLevel ( void *fgmres_vdata, HYPRE_Int level ); +HYPRE_Int hypre_FlexGMRESGetPrintLevel ( void *fgmres_vdata, HYPRE_Int *level ); +HYPRE_Int hypre_FlexGMRESSetLogging ( void *fgmres_vdata, HYPRE_Int level ); +HYPRE_Int hypre_FlexGMRESGetLogging ( void *fgmres_vdata, HYPRE_Int *level ); +HYPRE_Int hypre_FlexGMRESGetNumIterations ( void *fgmres_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int hypre_FlexGMRESGetConverged ( void *fgmres_vdata, HYPRE_Int *converged ); +HYPRE_Int hypre_FlexGMRESGetFinalRelativeResidualNorm ( void *fgmres_vdata, + HYPRE_Real *relative_residual_norm ); +HYPRE_Int hypre_FlexGMRESSetModifyPC ( void *fgmres_vdata, + HYPRE_Int (*modify_pc )(void *precond_data, HYPRE_Int iteration, HYPRE_Real rel_residual_norm)); +HYPRE_Int hypre_FlexGMRESModifyPCDefault ( void *precond_data, HYPRE_Int iteration, + HYPRE_Real rel_residual_norm ); + +/* lgmres.c */ +void *hypre_LGMRESCreate ( hypre_LGMRESFunctions *lgmres_functions ); +HYPRE_Int hypre_LGMRESDestroy ( void *lgmres_vdata ); +HYPRE_Int hypre_LGMRESGetResidual ( void *lgmres_vdata, void **residual ); +HYPRE_Int hypre_LGMRESSetup ( void *lgmres_vdata, void *A, void *b, void *x ); +HYPRE_Int hypre_LGMRESSolve ( void *lgmres_vdata, void *A, void *b, void *x ); +HYPRE_Int hypre_LGMRESSetKDim ( void *lgmres_vdata, HYPRE_Int k_dim ); +HYPRE_Int hypre_LGMRESGetKDim ( void *lgmres_vdata, HYPRE_Int *k_dim ); +HYPRE_Int hypre_LGMRESSetAugDim ( void *lgmres_vdata, HYPRE_Int aug_dim ); +HYPRE_Int hypre_LGMRESGetAugDim ( void *lgmres_vdata, HYPRE_Int *aug_dim ); +HYPRE_Int hypre_LGMRESSetTol ( void *lgmres_vdata, HYPRE_Real tol ); +HYPRE_Int hypre_LGMRESGetTol ( void *lgmres_vdata, HYPRE_Real *tol ); +HYPRE_Int hypre_LGMRESSetAbsoluteTol ( void *lgmres_vdata, HYPRE_Real a_tol ); +HYPRE_Int hypre_LGMRESGetAbsoluteTol ( void *lgmres_vdata, HYPRE_Real *a_tol ); +HYPRE_Int hypre_LGMRESSetConvergenceFactorTol ( void *lgmres_vdata, HYPRE_Real cf_tol ); +HYPRE_Int hypre_LGMRESGetConvergenceFactorTol ( void *lgmres_vdata, HYPRE_Real *cf_tol ); +HYPRE_Int hypre_LGMRESSetMinIter ( void *lgmres_vdata, HYPRE_Int min_iter ); +HYPRE_Int hypre_LGMRESGetMinIter ( void *lgmres_vdata, HYPRE_Int *min_iter ); +HYPRE_Int hypre_LGMRESSetMaxIter ( void *lgmres_vdata, HYPRE_Int max_iter ); +HYPRE_Int hypre_LGMRESGetMaxIter ( void *lgmres_vdata, HYPRE_Int *max_iter ); +HYPRE_Int hypre_LGMRESSetStopCrit ( void *lgmres_vdata, HYPRE_Int stop_crit ); +HYPRE_Int hypre_LGMRESGetStopCrit ( void *lgmres_vdata, HYPRE_Int *stop_crit ); +HYPRE_Int hypre_LGMRESSetPrecond ( void *lgmres_vdata, HYPRE_Int (*precond )(void*, void*, void*, + void*), HYPRE_Int (*precond_setup )(void*, void*, void*, void*), void *precond_data ); +HYPRE_Int hypre_LGMRESGetPrecond ( void *lgmres_vdata, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int hypre_LGMRESSetPrintLevel ( void *lgmres_vdata, HYPRE_Int level ); +HYPRE_Int hypre_LGMRESGetPrintLevel ( void *lgmres_vdata, HYPRE_Int *level ); +HYPRE_Int hypre_LGMRESSetLogging ( void *lgmres_vdata, HYPRE_Int level ); +HYPRE_Int hypre_LGMRESGetLogging ( void *lgmres_vdata, HYPRE_Int *level ); +HYPRE_Int hypre_LGMRESGetNumIterations ( void *lgmres_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int hypre_LGMRESGetConverged ( void *lgmres_vdata, HYPRE_Int *converged ); +HYPRE_Int hypre_LGMRESGetFinalRelativeResidualNorm ( void *lgmres_vdata, + HYPRE_Real *relative_residual_norm ); + +/* HYPRE_bicgstab.c */ +HYPRE_Int HYPRE_BiCGSTABDestroy ( HYPRE_Solver solver ); +HYPRE_Int HYPRE_BiCGSTABSetup ( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, + HYPRE_Vector x ); +HYPRE_Int HYPRE_BiCGSTABSolve ( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, + HYPRE_Vector x ); +HYPRE_Int HYPRE_BiCGSTABSetTol ( HYPRE_Solver solver, HYPRE_Real tol ); +HYPRE_Int HYPRE_BiCGSTABSetAbsoluteTol ( HYPRE_Solver solver, HYPRE_Real a_tol ); +HYPRE_Int HYPRE_BiCGSTABSetConvergenceFactorTol ( HYPRE_Solver solver, HYPRE_Real cf_tol ); +HYPRE_Int HYPRE_BiCGSTABSetMinIter ( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int HYPRE_BiCGSTABSetMaxIter ( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int HYPRE_BiCGSTABSetStopCrit ( HYPRE_Solver solver, HYPRE_Int stop_crit ); +HYPRE_Int HYPRE_BiCGSTABSetPrecond ( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, + HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int HYPRE_BiCGSTABGetPrecond ( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int HYPRE_BiCGSTABSetLogging ( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int HYPRE_BiCGSTABSetPrintLevel ( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int HYPRE_BiCGSTABGetNumIterations ( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int HYPRE_BiCGSTABGetFinalRelativeResidualNorm ( HYPRE_Solver solver, HYPRE_Real *norm ); +HYPRE_Int HYPRE_BiCGSTABGetResidual ( HYPRE_Solver solver, void *residual ); + +/* HYPRE_cgnr.c */ +HYPRE_Int HYPRE_CGNRDestroy ( HYPRE_Solver solver ); +HYPRE_Int HYPRE_CGNRSetup ( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int HYPRE_CGNRSolve ( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int HYPRE_CGNRSetTol ( HYPRE_Solver solver, HYPRE_Real tol ); +HYPRE_Int HYPRE_CGNRSetMinIter ( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int HYPRE_CGNRSetMaxIter ( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int HYPRE_CGNRSetStopCrit ( HYPRE_Solver solver, HYPRE_Int stop_crit ); +HYPRE_Int HYPRE_CGNRSetPrecond ( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, + HYPRE_PtrToSolverFcn precondT, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int HYPRE_CGNRGetPrecond ( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int HYPRE_CGNRSetLogging ( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int HYPRE_CGNRGetNumIterations ( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int HYPRE_CGNRGetFinalRelativeResidualNorm ( HYPRE_Solver solver, HYPRE_Real *norm ); + +/* HYPRE_gmres.c */ +HYPRE_Int HYPRE_GMRESSetup ( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int HYPRE_GMRESSolve ( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int HYPRE_GMRESSetKDim ( HYPRE_Solver solver, HYPRE_Int k_dim ); +HYPRE_Int HYPRE_GMRESGetKDim ( HYPRE_Solver solver, HYPRE_Int *k_dim ); +HYPRE_Int HYPRE_GMRESSetTol ( HYPRE_Solver solver, HYPRE_Real tol ); +HYPRE_Int HYPRE_GMRESGetTol ( HYPRE_Solver solver, HYPRE_Real *tol ); +HYPRE_Int HYPRE_GMRESSetAbsoluteTol ( HYPRE_Solver solver, HYPRE_Real a_tol ); +HYPRE_Int HYPRE_GMRESGetAbsoluteTol ( HYPRE_Solver solver, HYPRE_Real *a_tol ); +HYPRE_Int HYPRE_GMRESSetConvergenceFactorTol ( HYPRE_Solver solver, HYPRE_Real cf_tol ); +HYPRE_Int HYPRE_GMRESGetConvergenceFactorTol ( HYPRE_Solver solver, HYPRE_Real *cf_tol ); +HYPRE_Int HYPRE_GMRESSetMinIter ( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int HYPRE_GMRESGetMinIter ( HYPRE_Solver solver, HYPRE_Int *min_iter ); +HYPRE_Int HYPRE_GMRESSetMaxIter ( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int HYPRE_GMRESGetMaxIter ( HYPRE_Solver solver, HYPRE_Int *max_iter ); +HYPRE_Int HYPRE_GMRESSetStopCrit ( HYPRE_Solver solver, HYPRE_Int stop_crit ); +HYPRE_Int HYPRE_GMRESGetStopCrit ( HYPRE_Solver solver, HYPRE_Int *stop_crit ); +HYPRE_Int HYPRE_GMRESSetRelChange ( HYPRE_Solver solver, HYPRE_Int rel_change ); +HYPRE_Int HYPRE_GMRESGetRelChange ( HYPRE_Solver solver, HYPRE_Int *rel_change ); +HYPRE_Int HYPRE_GMRESSetSkipRealResidualCheck ( HYPRE_Solver solver, HYPRE_Int skip_real_r_check ); +HYPRE_Int HYPRE_GMRESGetSkipRealResidualCheck ( HYPRE_Solver solver, HYPRE_Int *skip_real_r_check ); +HYPRE_Int HYPRE_GMRESSetPrecond ( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, + HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int HYPRE_GMRESGetPrecond ( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int HYPRE_GMRESSetPrintLevel ( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int HYPRE_GMRESGetPrintLevel ( HYPRE_Solver solver, HYPRE_Int *level ); +HYPRE_Int HYPRE_GMRESSetLogging ( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int HYPRE_GMRESGetLogging ( HYPRE_Solver solver, HYPRE_Int *level ); +HYPRE_Int HYPRE_GMRESGetNumIterations ( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int HYPRE_GMRESGetConverged ( HYPRE_Solver solver, HYPRE_Int *converged ); +HYPRE_Int HYPRE_GMRESGetFinalRelativeResidualNorm ( HYPRE_Solver solver, HYPRE_Real *norm ); +HYPRE_Int HYPRE_GMRESGetResidual ( HYPRE_Solver solver, void *residual ); + +/* HYPRE_cogmres.c */ +HYPRE_Int HYPRE_COGMRESSetup ( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, + HYPRE_Vector x ); +HYPRE_Int HYPRE_COGMRESSolve ( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, + HYPRE_Vector x ); +HYPRE_Int HYPRE_COGMRESSetKDim ( HYPRE_Solver solver, HYPRE_Int k_dim ); +HYPRE_Int HYPRE_COGMRESGetKDim ( HYPRE_Solver solver, HYPRE_Int *k_dim ); +HYPRE_Int HYPRE_COGMRESSetUnroll ( HYPRE_Solver solver, HYPRE_Int unroll ); +HYPRE_Int HYPRE_COGMRESGetUnroll ( HYPRE_Solver solver, HYPRE_Int *unroll ); +HYPRE_Int HYPRE_COGMRESSetCGS ( HYPRE_Solver solver, HYPRE_Int cgs ); +HYPRE_Int HYPRE_COGMRESGetCGS ( HYPRE_Solver solver, HYPRE_Int *cgs ); +HYPRE_Int HYPRE_COGMRESSetTol ( HYPRE_Solver solver, HYPRE_Real tol ); +HYPRE_Int HYPRE_COGMRESGetTol ( HYPRE_Solver solver, HYPRE_Real *tol ); +HYPRE_Int HYPRE_COGMRESSetAbsoluteTol ( HYPRE_Solver solver, HYPRE_Real a_tol ); +HYPRE_Int HYPRE_COGMRESGetAbsoluteTol ( HYPRE_Solver solver, HYPRE_Real *a_tol ); +HYPRE_Int HYPRE_COGMRESSetConvergenceFactorTol ( HYPRE_Solver solver, HYPRE_Real cf_tol ); +HYPRE_Int HYPRE_COGMRESGetConvergenceFactorTol ( HYPRE_Solver solver, HYPRE_Real *cf_tol ); +HYPRE_Int HYPRE_COGMRESSetMinIter ( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int HYPRE_COGMRESGetMinIter ( HYPRE_Solver solver, HYPRE_Int *min_iter ); +HYPRE_Int HYPRE_COGMRESSetMaxIter ( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int HYPRE_COGMRESGetMaxIter ( HYPRE_Solver solver, HYPRE_Int *max_iter ); +HYPRE_Int HYPRE_COGMRESSetRelChange ( HYPRE_Solver solver, HYPRE_Int rel_change ); +HYPRE_Int HYPRE_COGMRESGetRelChange ( HYPRE_Solver solver, HYPRE_Int *rel_change ); +HYPRE_Int HYPRE_COGMRESSetSkipRealResidualCheck ( HYPRE_Solver solver, + HYPRE_Int skip_real_r_check ); +HYPRE_Int HYPRE_COGMRESGetSkipRealResidualCheck ( HYPRE_Solver solver, + HYPRE_Int *skip_real_r_check ); +HYPRE_Int HYPRE_COGMRESSetPrecond ( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, + HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int HYPRE_COGMRESGetPrecond ( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int HYPRE_COGMRESSetPrintLevel ( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int HYPRE_COGMRESGetPrintLevel ( HYPRE_Solver solver, HYPRE_Int *level ); +HYPRE_Int HYPRE_COGMRESSetLogging ( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int HYPRE_COGMRESGetLogging ( HYPRE_Solver solver, HYPRE_Int *level ); +HYPRE_Int HYPRE_COGMRESGetNumIterations ( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int HYPRE_COGMRESGetConverged ( HYPRE_Solver solver, HYPRE_Int *converged ); +HYPRE_Int HYPRE_COGMRESGetFinalRelativeResidualNorm ( HYPRE_Solver solver, HYPRE_Real *norm ); +HYPRE_Int HYPRE_COGMRESGetResidual ( HYPRE_Solver solver, void *residual ); + +/* HYPRE_flexgmres.c */ +HYPRE_Int HYPRE_FlexGMRESSetup ( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, + HYPRE_Vector x ); +HYPRE_Int HYPRE_FlexGMRESSolve ( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, + HYPRE_Vector x ); +HYPRE_Int HYPRE_FlexGMRESSetKDim ( HYPRE_Solver solver, HYPRE_Int k_dim ); +HYPRE_Int HYPRE_FlexGMRESGetKDim ( HYPRE_Solver solver, HYPRE_Int *k_dim ); +HYPRE_Int HYPRE_FlexGMRESSetTol ( HYPRE_Solver solver, HYPRE_Real tol ); +HYPRE_Int HYPRE_FlexGMRESGetTol ( HYPRE_Solver solver, HYPRE_Real *tol ); +HYPRE_Int HYPRE_FlexGMRESSetAbsoluteTol ( HYPRE_Solver solver, HYPRE_Real a_tol ); +HYPRE_Int HYPRE_FlexGMRESGetAbsoluteTol ( HYPRE_Solver solver, HYPRE_Real *a_tol ); +HYPRE_Int HYPRE_FlexGMRESSetConvergenceFactorTol ( HYPRE_Solver solver, HYPRE_Real cf_tol ); +HYPRE_Int HYPRE_FlexGMRESGetConvergenceFactorTol ( HYPRE_Solver solver, HYPRE_Real *cf_tol ); +HYPRE_Int HYPRE_FlexGMRESSetMinIter ( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int HYPRE_FlexGMRESGetMinIter ( HYPRE_Solver solver, HYPRE_Int *min_iter ); +HYPRE_Int HYPRE_FlexGMRESSetMaxIter ( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int HYPRE_FlexGMRESGetMaxIter ( HYPRE_Solver solver, HYPRE_Int *max_iter ); +HYPRE_Int HYPRE_FlexGMRESSetPrecond ( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, + HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int HYPRE_FlexGMRESGetPrecond ( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int HYPRE_FlexGMRESSetPrintLevel ( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int HYPRE_FlexGMRESGetPrintLevel ( HYPRE_Solver solver, HYPRE_Int *level ); +HYPRE_Int HYPRE_FlexGMRESSetLogging ( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int HYPRE_FlexGMRESGetLogging ( HYPRE_Solver solver, HYPRE_Int *level ); +HYPRE_Int HYPRE_FlexGMRESGetNumIterations ( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int HYPRE_FlexGMRESGetConverged ( HYPRE_Solver solver, HYPRE_Int *converged ); +HYPRE_Int HYPRE_FlexGMRESGetFinalRelativeResidualNorm ( HYPRE_Solver solver, HYPRE_Real *norm ); +HYPRE_Int HYPRE_FlexGMRESGetResidual ( HYPRE_Solver solver, void *residual ); +HYPRE_Int HYPRE_FlexGMRESSetModifyPC ( HYPRE_Solver solver, HYPRE_Int (*modify_pc )(HYPRE_Solver, + HYPRE_Int, HYPRE_Real )); + +/* HYPRE_lgmres.c */ +HYPRE_Int HYPRE_LGMRESSetup ( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int HYPRE_LGMRESSolve ( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int HYPRE_LGMRESSetKDim ( HYPRE_Solver solver, HYPRE_Int k_dim ); +HYPRE_Int HYPRE_LGMRESGetKDim ( HYPRE_Solver solver, HYPRE_Int *k_dim ); +HYPRE_Int HYPRE_LGMRESSetAugDim ( HYPRE_Solver solver, HYPRE_Int aug_dim ); +HYPRE_Int HYPRE_LGMRESGetAugDim ( HYPRE_Solver solver, HYPRE_Int *aug_dim ); +HYPRE_Int HYPRE_LGMRESSetTol ( HYPRE_Solver solver, HYPRE_Real tol ); +HYPRE_Int HYPRE_LGMRESGetTol ( HYPRE_Solver solver, HYPRE_Real *tol ); +HYPRE_Int HYPRE_LGMRESSetAbsoluteTol ( HYPRE_Solver solver, HYPRE_Real a_tol ); +HYPRE_Int HYPRE_LGMRESGetAbsoluteTol ( HYPRE_Solver solver, HYPRE_Real *a_tol ); +HYPRE_Int HYPRE_LGMRESSetConvergenceFactorTol ( HYPRE_Solver solver, HYPRE_Real cf_tol ); +HYPRE_Int HYPRE_LGMRESGetConvergenceFactorTol ( HYPRE_Solver solver, HYPRE_Real *cf_tol ); +HYPRE_Int HYPRE_LGMRESSetMinIter ( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int HYPRE_LGMRESGetMinIter ( HYPRE_Solver solver, HYPRE_Int *min_iter ); +HYPRE_Int HYPRE_LGMRESSetMaxIter ( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int HYPRE_LGMRESGetMaxIter ( HYPRE_Solver solver, HYPRE_Int *max_iter ); +HYPRE_Int HYPRE_LGMRESSetPrecond ( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, + HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int HYPRE_LGMRESGetPrecond ( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int HYPRE_LGMRESSetPrintLevel ( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int HYPRE_LGMRESGetPrintLevel ( HYPRE_Solver solver, HYPRE_Int *level ); +HYPRE_Int HYPRE_LGMRESSetLogging ( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int HYPRE_LGMRESGetLogging ( HYPRE_Solver solver, HYPRE_Int *level ); +HYPRE_Int HYPRE_LGMRESGetNumIterations ( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int HYPRE_LGMRESGetConverged ( HYPRE_Solver solver, HYPRE_Int *converged ); +HYPRE_Int HYPRE_LGMRESGetFinalRelativeResidualNorm ( HYPRE_Solver solver, HYPRE_Real *norm ); +HYPRE_Int HYPRE_LGMRESGetResidual ( HYPRE_Solver solver, void *residual ); + +/* HYPRE_pcg.c */ +HYPRE_Int HYPRE_PCGSetup ( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int HYPRE_PCGSolve ( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int HYPRE_PCGSetTol ( HYPRE_Solver solver, HYPRE_Real tol ); +HYPRE_Int HYPRE_PCGGetTol ( HYPRE_Solver solver, HYPRE_Real *tol ); +HYPRE_Int HYPRE_PCGSetAbsoluteTol ( HYPRE_Solver solver, HYPRE_Real a_tol ); +HYPRE_Int HYPRE_PCGGetAbsoluteTol ( HYPRE_Solver solver, HYPRE_Real *a_tol ); +HYPRE_Int HYPRE_PCGSetAbsoluteTolFactor ( HYPRE_Solver solver, HYPRE_Real abstolf ); +HYPRE_Int HYPRE_PCGGetAbsoluteTolFactor ( HYPRE_Solver solver, HYPRE_Real *abstolf ); +HYPRE_Int HYPRE_PCGSetResidualTol ( HYPRE_Solver solver, HYPRE_Real rtol ); +HYPRE_Int HYPRE_PCGGetResidualTol ( HYPRE_Solver solver, HYPRE_Real *rtol ); +HYPRE_Int HYPRE_PCGSetConvergenceFactorTol ( HYPRE_Solver solver, HYPRE_Real cf_tol ); +HYPRE_Int HYPRE_PCGGetConvergenceFactorTol ( HYPRE_Solver solver, HYPRE_Real *cf_tol ); +HYPRE_Int HYPRE_PCGSetMaxIter ( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int HYPRE_PCGGetMaxIter ( HYPRE_Solver solver, HYPRE_Int *max_iter ); +HYPRE_Int HYPRE_PCGSetStopCrit ( HYPRE_Solver solver, HYPRE_Int stop_crit ); +HYPRE_Int HYPRE_PCGGetStopCrit ( HYPRE_Solver solver, HYPRE_Int *stop_crit ); +HYPRE_Int HYPRE_PCGSetTwoNorm ( HYPRE_Solver solver, HYPRE_Int two_norm ); +HYPRE_Int HYPRE_PCGGetTwoNorm ( HYPRE_Solver solver, HYPRE_Int *two_norm ); +HYPRE_Int HYPRE_PCGSetRelChange ( HYPRE_Solver solver, HYPRE_Int rel_change ); +HYPRE_Int HYPRE_PCGGetRelChange ( HYPRE_Solver solver, HYPRE_Int *rel_change ); +HYPRE_Int HYPRE_PCGSetRecomputeResidual ( HYPRE_Solver solver, HYPRE_Int recompute_residual ); +HYPRE_Int HYPRE_PCGGetRecomputeResidual ( HYPRE_Solver solver, HYPRE_Int *recompute_residual ); +HYPRE_Int HYPRE_PCGSetRecomputeResidualP ( HYPRE_Solver solver, HYPRE_Int recompute_residual_p ); +HYPRE_Int HYPRE_PCGGetRecomputeResidualP ( HYPRE_Solver solver, HYPRE_Int *recompute_residual_p ); +HYPRE_Int HYPRE_PCGSetSkipBreak ( HYPRE_Solver solver, HYPRE_Int skip_break ); +HYPRE_Int HYPRE_PCGGetSkipBreak ( HYPRE_Solver solver, HYPRE_Int *skip_break ); +HYPRE_Int HYPRE_PCGSetFlex ( HYPRE_Solver solver, HYPRE_Int flex ); +HYPRE_Int HYPRE_PCGGetFlex ( HYPRE_Solver solver, HYPRE_Int *flex ); +HYPRE_Int HYPRE_PCGSetPrecond ( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, + HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int HYPRE_PCGSetPreconditioner ( HYPRE_Solver solver, HYPRE_Solver precond_solver ); +HYPRE_Int HYPRE_PCGGetPrecond ( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int HYPRE_PCGSetLogging ( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int HYPRE_PCGGetLogging ( HYPRE_Solver solver, HYPRE_Int *level ); +HYPRE_Int HYPRE_PCGSetPrintLevel ( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int HYPRE_PCGGetPrintLevel ( HYPRE_Solver solver, HYPRE_Int *level ); +HYPRE_Int HYPRE_PCGGetNumIterations ( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int HYPRE_PCGGetConverged ( HYPRE_Solver solver, HYPRE_Int *converged ); +HYPRE_Int HYPRE_PCGGetFinalRelativeResidualNorm ( HYPRE_Solver solver, HYPRE_Real *norm ); +HYPRE_Int HYPRE_PCGGetResidual ( HYPRE_Solver solver, void *residual ); + +/* pcg.c */ +void *hypre_PCGCreate ( hypre_PCGFunctions *pcg_functions ); +HYPRE_Int hypre_PCGDestroy ( void *pcg_vdata ); +HYPRE_Int hypre_PCGGetResidual ( void *pcg_vdata, void **residual ); +HYPRE_Int hypre_PCGSetup ( void *pcg_vdata, void *A, void *b, void *x ); +HYPRE_Int hypre_PCGSolve ( void *pcg_vdata, void *A, void *b, void *x ); +HYPRE_Int hypre_PCGSetTol ( void *pcg_vdata, HYPRE_Real tol ); +HYPRE_Int hypre_PCGGetTol ( void *pcg_vdata, HYPRE_Real *tol ); +HYPRE_Int hypre_PCGSetAbsoluteTol ( void *pcg_vdata, HYPRE_Real a_tol ); +HYPRE_Int hypre_PCGGetAbsoluteTol ( void *pcg_vdata, HYPRE_Real *a_tol ); +HYPRE_Int hypre_PCGSetAbsoluteTolFactor ( void *pcg_vdata, HYPRE_Real atolf ); +HYPRE_Int hypre_PCGGetAbsoluteTolFactor ( void *pcg_vdata, HYPRE_Real *atolf ); +HYPRE_Int hypre_PCGSetResidualTol ( void *pcg_vdata, HYPRE_Real rtol ); +HYPRE_Int hypre_PCGGetResidualTol ( void *pcg_vdata, HYPRE_Real *rtol ); +HYPRE_Int hypre_PCGSetConvergenceFactorTol ( void *pcg_vdata, HYPRE_Real cf_tol ); +HYPRE_Int hypre_PCGGetConvergenceFactorTol ( void *pcg_vdata, HYPRE_Real *cf_tol ); +HYPRE_Int hypre_PCGSetMaxIter ( void *pcg_vdata, HYPRE_Int max_iter ); +HYPRE_Int hypre_PCGGetMaxIter ( void *pcg_vdata, HYPRE_Int *max_iter ); +HYPRE_Int hypre_PCGSetTwoNorm ( void *pcg_vdata, HYPRE_Int two_norm ); +HYPRE_Int hypre_PCGGetTwoNorm ( void *pcg_vdata, HYPRE_Int *two_norm ); +HYPRE_Int hypre_PCGSetRelChange ( void *pcg_vdata, HYPRE_Int rel_change ); +HYPRE_Int hypre_PCGGetRelChange ( void *pcg_vdata, HYPRE_Int *rel_change ); +HYPRE_Int hypre_PCGSetRecomputeResidual ( void *pcg_vdata, HYPRE_Int recompute_residual ); +HYPRE_Int hypre_PCGGetRecomputeResidual ( void *pcg_vdata, HYPRE_Int *recompute_residual ); +HYPRE_Int hypre_PCGSetRecomputeResidualP ( void *pcg_vdata, HYPRE_Int recompute_residual_p ); +HYPRE_Int hypre_PCGGetRecomputeResidualP ( void *pcg_vdata, HYPRE_Int *recompute_residual_p ); +HYPRE_Int hypre_PCGSetStopCrit ( void *pcg_vdata, HYPRE_Int stop_crit ); +HYPRE_Int hypre_PCGGetStopCrit ( void *pcg_vdata, HYPRE_Int *stop_crit ); +HYPRE_Int hypre_PCGSetSkipBreak ( void *pcg_vdata, HYPRE_Int skip_break ); +HYPRE_Int hypre_PCGGetSkipBreak ( void *pcg_vdata, HYPRE_Int *skip_break ); +HYPRE_Int hypre_PCGSetFlex ( void *pcg_vdata, HYPRE_Int flex ); +HYPRE_Int hypre_PCGGetFlex ( void *pcg_vdata, HYPRE_Int *flex ); +HYPRE_Int hypre_PCGGetPrecond ( void *pcg_vdata, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int hypre_PCGSetPrecond ( void *pcg_vdata, + HYPRE_Int (*precond )(void*, void*, void*, void*), + HYPRE_Int (*precond_setup )(void*, void*, void*, void*), + void *precond_data ); +HYPRE_Int hypre_PCGSetPreconditioner ( void *pcg_vdata, void *precond_data ); +HYPRE_Int hypre_PCGSetPrintLevel ( void *pcg_vdata, HYPRE_Int level ); +HYPRE_Int hypre_PCGGetPrintLevel ( void *pcg_vdata, HYPRE_Int *level ); +HYPRE_Int hypre_PCGSetLogging ( void *pcg_vdata, HYPRE_Int level ); +HYPRE_Int hypre_PCGGetLogging ( void *pcg_vdata, HYPRE_Int *level ); +HYPRE_Int hypre_PCGSetHybrid ( void *pcg_vdata, HYPRE_Int level ); +HYPRE_Int hypre_PCGGetNumIterations ( void *pcg_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int hypre_PCGGetConverged ( void *pcg_vdata, HYPRE_Int *converged ); +HYPRE_Int hypre_PCGPrintLogging ( void *pcg_vdata, HYPRE_Int myid ); +HYPRE_Int hypre_PCGGetFinalRelativeResidualNorm ( void *pcg_vdata, + HYPRE_Real *relative_residual_norm ); #ifdef __cplusplus - } +} #endif #endif - diff --git a/external/hypre/src/krylov/lgmres.c b/external/hypre/src/krylov/lgmres.c index 7ddbf8b2..3ae5fad4 100644 --- a/external/hypre/src/krylov/lgmres.c +++ b/external/hypre/src/krylov/lgmres.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -38,11 +38,11 @@ hypre_LGMRESFunctionsCreate( HYPRE_Int (*Axpy) ( HYPRE_Complex alpha, void *x, void *y ), HYPRE_Int (*PrecondSetup) ( void *vdata, void *A, void *b, void *x ), HYPRE_Int (*Precond) ( void *vdata, void *A, void *b, void *x ) - ) +) { hypre_LGMRESFunctions * lgmres_functions; lgmres_functions = (hypre_LGMRESFunctions *) - CAlloc( 1, sizeof(hypre_LGMRESFunctions), HYPRE_MEMORY_HOST ); + CAlloc( 1, sizeof(hypre_LGMRESFunctions), HYPRE_MEMORY_HOST ); lgmres_functions->CAlloc = CAlloc; lgmres_functions->Free = Free; @@ -58,7 +58,7 @@ hypre_LGMRESFunctionsCreate( lgmres_functions->ClearVector = ClearVector; lgmres_functions->ScaleVector = ScaleVector; lgmres_functions->Axpy = Axpy; -/* default preconditioner must be set here but can be changed later... */ + /* default preconditioner must be set here but can be changed later... */ lgmres_functions->precond_setup = PrecondSetup; lgmres_functions->precond = Precond; @@ -123,29 +123,41 @@ hypre_LGMRESDestroy( void *lgmres_vdata ) if (lgmres_data) { hypre_LGMRESFunctions *lgmres_functions = lgmres_data->functions; - if ( (lgmres_data->logging>0) || (lgmres_data->print_level) > 0 ) + if ( (lgmres_data->logging > 0) || (lgmres_data->print_level) > 0 ) { if ( (lgmres_data -> norms) != NULL ) + { hypre_TFreeF( lgmres_data -> norms, lgmres_functions ); + } } if ( (lgmres_data -> matvec_data) != NULL ) + { (*(lgmres_functions->MatvecDestroy))(lgmres_data -> matvec_data); + } if ( (lgmres_data -> r) != NULL ) + { (*(lgmres_functions->DestroyVector))(lgmres_data -> r); + } if ( (lgmres_data -> w) != NULL ) + { (*(lgmres_functions->DestroyVector))(lgmres_data -> w); + } if ( (lgmres_data -> w_2) != NULL ) + { (*(lgmres_functions->DestroyVector))(lgmres_data -> w_2); + } if ( (lgmres_data -> p) != NULL ) { - for (i = 0; i < (lgmres_data -> k_dim+1); i++) + for (i = 0; i < (lgmres_data -> k_dim + 1); i++) { if ( (lgmres_data -> p)[i] != NULL ) - (*(lgmres_functions->DestroyVector))( (lgmres_data -> p) [i]); + { + (*(lgmres_functions->DestroyVector))( (lgmres_data -> p) [i]); + } } hypre_TFreeF( lgmres_data->p, lgmres_functions ); } @@ -156,7 +168,9 @@ hypre_LGMRESDestroy( void *lgmres_vdata ) for (i = 0; i < (lgmres_data -> aug_dim + 1); i++) { if ( (lgmres_data -> aug_vecs)[i] != NULL ) - (*(lgmres_functions->DestroyVector))( (lgmres_data -> aug_vecs) [i]); + { + (*(lgmres_functions->DestroyVector))( (lgmres_data -> aug_vecs) [i]); + } } hypre_TFreeF( lgmres_data->aug_vecs, lgmres_functions ); } @@ -165,7 +179,9 @@ hypre_LGMRESDestroy( void *lgmres_vdata ) for (i = 0; i < (lgmres_data -> aug_dim); i++) { if ( (lgmres_data -> a_aug_vecs)[i] != NULL ) - (*(lgmres_functions->DestroyVector))( (lgmres_data -> a_aug_vecs) [i]); + { + (*(lgmres_functions->DestroyVector))( (lgmres_data -> a_aug_vecs) [i]); + } } hypre_TFreeF( lgmres_data->a_aug_vecs, lgmres_functions ); } @@ -211,12 +227,12 @@ hypre_LGMRESSetup( void *lgmres_vdata, HYPRE_Int k_dim = (lgmres_data -> k_dim); HYPRE_Int max_iter = (lgmres_data -> max_iter); - HYPRE_Int (*precond_setup)(void*,void*,void*,void*) = (lgmres_functions->precond_setup); + HYPRE_Int (*precond_setup)(void*, void*, void*, void*) = (lgmres_functions->precond_setup); void *precond_data = (lgmres_data -> precond_data); HYPRE_Int rel_change = (lgmres_data -> rel_change); - /* lgmres mod */ + /* lgmres mod */ HYPRE_Int aug_dim = (lgmres_data -> aug_dim); HYPRE_ANNOTATE_FUNC_BEGIN; @@ -230,30 +246,48 @@ hypre_LGMRESSetup( void *lgmres_vdata, *--------------------------------------------------*/ if ((lgmres_data -> p) == NULL) - (lgmres_data -> p) = (void**)(*(lgmres_functions->CreateVectorArray))(k_dim+1,x); + { + (lgmres_data -> p) = (void**)(*(lgmres_functions->CreateVectorArray))(k_dim + 1, x); + } if ((lgmres_data -> r) == NULL) + { (lgmres_data -> r) = (*(lgmres_functions->CreateVector))(b); + } if ((lgmres_data -> w) == NULL) + { (lgmres_data -> w) = (*(lgmres_functions->CreateVector))(b); + } if (rel_change) { if ((lgmres_data -> w_2) == NULL) + { (lgmres_data -> w_2) = (*(lgmres_functions->CreateVector))(b); + } } /* lgmres mod */ if ((lgmres_data -> aug_vecs) == NULL) - (lgmres_data -> aug_vecs) = (void**)(*(lgmres_functions->CreateVectorArray))(aug_dim+1,x); /* one extra */ + { + (lgmres_data -> aug_vecs) = (void**)(*(lgmres_functions->CreateVectorArray))(aug_dim + 1, + x); /* one extra */ + } if ((lgmres_data -> a_aug_vecs) == NULL) - (lgmres_data -> a_aug_vecs) = (void**)(*(lgmres_functions->CreateVectorArray))(aug_dim,x); + { + (lgmres_data -> a_aug_vecs) = (void**)(*(lgmres_functions->CreateVectorArray))(aug_dim, x); + } if ((lgmres_data -> aug_order) == NULL) - (lgmres_data -> aug_order) = hypre_CTAllocF(HYPRE_Int,aug_dim,lgmres_functions, HYPRE_MEMORY_HOST); + { + (lgmres_data -> aug_order) = hypre_CTAllocF(HYPRE_Int, aug_dim, lgmres_functions, + HYPRE_MEMORY_HOST); + } /*---*/ if ((lgmres_data -> matvec_data) == NULL) + { (lgmres_data -> matvec_data) = (*(lgmres_functions->MatvecCreate))(A, x); + } precond_setup(precond_data, A, b, x); @@ -261,14 +295,20 @@ hypre_LGMRESSetup( void *lgmres_vdata, * Allocate space for log info *-----------------------------------------------------*/ - if ( (lgmres_data->logging)>0 || (lgmres_data->print_level) > 0 ) + if ( (lgmres_data->logging) > 0 || (lgmres_data->print_level) > 0 ) { if ((lgmres_data -> norms) == NULL) - (lgmres_data -> norms) = hypre_CTAllocF(HYPRE_Real, max_iter + 1,lgmres_functions, HYPRE_MEMORY_HOST); + { + (lgmres_data -> norms) = hypre_CTAllocF(HYPRE_Real, max_iter + 1, lgmres_functions, + HYPRE_MEMORY_HOST); + } } - if ( (lgmres_data->print_level) > 0 ) { + if ( (lgmres_data->print_level) > 0 ) + { if ((lgmres_data -> log_file_name) == NULL) - (lgmres_data -> log_file_name) = (char*)"lgmres.out.log"; + { + (lgmres_data -> log_file_name) = (char*)"lgmres.out.log"; + } } HYPRE_ANNOTATE_FUNC_END; @@ -285,17 +325,17 @@ hypre_LGMRESSetup( void *lgmres_vdata, HYPRE_Int hypre_LGMRESSolve(void *lgmres_vdata, - void *A, - void *b, - void *x) + void *A, + void *b, + void *x) { hypre_LGMRESData *lgmres_data = (hypre_LGMRESData *)lgmres_vdata; hypre_LGMRESFunctions *lgmres_functions = lgmres_data->functions; - HYPRE_Int k_dim = (lgmres_data -> k_dim); + HYPRE_Int k_dim = (lgmres_data -> k_dim); HYPRE_Int min_iter = (lgmres_data -> min_iter); - HYPRE_Int max_iter = (lgmres_data -> max_iter); - HYPRE_Real r_tol = (lgmres_data -> tol); - HYPRE_Real cf_tol = (lgmres_data -> cf_tol); + HYPRE_Int max_iter = (lgmres_data -> max_iter); + HYPRE_Real r_tol = (lgmres_data -> tol); + HYPRE_Real cf_tol = (lgmres_data -> cf_tol); HYPRE_Real a_tol = (lgmres_data -> a_tol); void *matvec_data = (lgmres_data -> matvec_data); @@ -310,14 +350,14 @@ hypre_LGMRESSolve(void *lgmres_vdata, void **a_aug_vecs = (lgmres_data ->a_aug_vecs); HYPRE_Int *aug_order = (lgmres_data->aug_order); HYPRE_Int aug_dim = (lgmres_data -> aug_dim); - HYPRE_Int approx_constant= (lgmres_data ->approx_constant); + HYPRE_Int approx_constant = (lgmres_data ->approx_constant); HYPRE_Int it_arnoldi, aug_ct, it_total, ii, order, it_aug; HYPRE_Int spot = 0; HYPRE_Real tmp_norm, r_norm_last; /*---*/ - HYPRE_Int (*precond)(void*,void*,void*,void*) = (lgmres_functions -> precond); - HYPRE_Int *precond_data = (HYPRE_Int*)(lgmres_data -> precond_data); + HYPRE_Int (*precond)(void*, void*, void*, void*) = (lgmres_functions -> precond); + HYPRE_Int *precond_data = (HYPRE_Int*)(lgmres_data -> precond_data); HYPRE_Int print_level = (lgmres_data -> print_level); HYPRE_Int logging = (lgmres_data -> logging); @@ -325,7 +365,7 @@ hypre_LGMRESSolve(void *lgmres_vdata, HYPRE_Real *norms = (lgmres_data -> norms); HYPRE_Int break_value = 0; - HYPRE_Int i, j, k; + HYPRE_Int i, j, k; HYPRE_Real *rs, **hh, *c, *s; HYPRE_Int iter; HYPRE_Int my_id, num_procs; @@ -350,8 +390,8 @@ hypre_LGMRESSolve(void *lgmres_vdata, * this. Perhaps it should be set to something non-zero (but small). *-----------------------------------------------------------------------*/ - (*(lgmres_functions->CommInfo))(A,&my_id,&num_procs); - if ( logging>0 || print_level>0 ) + (*(lgmres_functions->CommInfo))(A, &my_id, &num_procs); + if ( logging > 0 || print_level > 0 ) { norms = (lgmres_data -> norms); /* not used yet log_file_name = (lgmres_data -> log_file_name);*/ @@ -359,27 +399,27 @@ hypre_LGMRESSolve(void *lgmres_vdata, } /* initialize work arrays - lgmres includes aug_dim*/ - rs = hypre_CTAllocF(HYPRE_Real,k_dim+1+aug_dim,lgmres_functions, HYPRE_MEMORY_HOST); - c = hypre_CTAllocF(HYPRE_Real,k_dim+aug_dim,lgmres_functions, HYPRE_MEMORY_HOST); - s = hypre_CTAllocF(HYPRE_Real,k_dim+aug_dim,lgmres_functions, HYPRE_MEMORY_HOST); + rs = hypre_CTAllocF(HYPRE_Real, k_dim + 1 + aug_dim, lgmres_functions, HYPRE_MEMORY_HOST); + c = hypre_CTAllocF(HYPRE_Real, k_dim + aug_dim, lgmres_functions, HYPRE_MEMORY_HOST); + s = hypre_CTAllocF(HYPRE_Real, k_dim + aug_dim, lgmres_functions, HYPRE_MEMORY_HOST); /* lgmres mod. - need non-modified hessenberg to avoid aug_dim matvecs */ - hh = hypre_CTAllocF(HYPRE_Real*,k_dim+aug_dim+1,lgmres_functions, HYPRE_MEMORY_HOST); - for (i=0; i < k_dim+aug_dim+1; i++) + hh = hypre_CTAllocF(HYPRE_Real*, k_dim + aug_dim + 1, lgmres_functions, HYPRE_MEMORY_HOST); + for (i = 0; i < k_dim + aug_dim + 1; i++) { - hh[i] = hypre_CTAllocF(HYPRE_Real,k_dim+aug_dim,lgmres_functions, HYPRE_MEMORY_HOST); + hh[i] = hypre_CTAllocF(HYPRE_Real, k_dim + aug_dim, lgmres_functions, HYPRE_MEMORY_HOST); } - (*(lgmres_functions->CopyVector))(b,p[0]); + (*(lgmres_functions->CopyVector))(b, p[0]); /* compute initial residual */ - (*(lgmres_functions->Matvec))(matvec_data,-1.0, A, x, 1.0, p[0]); + (*(lgmres_functions->Matvec))(matvec_data, -1.0, A, x, 1.0, p[0]); - b_norm = sqrt((*(lgmres_functions->InnerProd))(b,b)); + b_norm = hypre_sqrt((*(lgmres_functions->InnerProd))(b, b)); - /* Since it is does not diminish performance, attempt to return an error flag + /* Since it does not diminish performance, attempt to return an error flag and notify users when they supply bad input. */ - if (b_norm != 0.) ieee_check = b_norm/b_norm; /* INF -> NaN conversion */ + if (b_norm != 0.) { ieee_check = b_norm / b_norm; } /* INF -> NaN conversion */ if (ieee_check != ieee_check) { /* ...INFs or NaNs in input can make ieee_check a NaN. This test @@ -389,11 +429,11 @@ hypre_LGMRESSolve(void *lgmres_vdata, found at http://HTTP.CS.Berkeley.EDU/~wkahan/ieee754status/IEEE754.PDF */ if (logging > 0 || print_level > 0) { - hypre_printf("\n\nERROR detected by Hypre ... BEGIN\n"); - hypre_printf("ERROR -- hypre_LGMRESSolve: INFs and/or NaNs detected in input.\n"); - hypre_printf("User probably placed non-numerics in supplied b.\n"); - hypre_printf("Returning error flag += 101. Program not terminated.\n"); - hypre_printf("ERROR detected by Hypre ... END\n\n\n"); + hypre_printf("\n\nERROR detected by Hypre ... BEGIN\n"); + hypre_printf("ERROR -- hypre_LGMRESSolve: INFs and/or NaNs detected in input.\n"); + hypre_printf("User probably placed non-numerics in supplied b.\n"); + hypre_printf("Returning error flag += 101. Program not terminated.\n"); + hypre_printf("ERROR detected by Hypre ... END\n\n\n"); } hypre_error(HYPRE_ERROR_GENERIC); HYPRE_ANNOTATE_FUNC_END; @@ -401,12 +441,12 @@ hypre_LGMRESSolve(void *lgmres_vdata, return hypre_error_flag; } - r_norm = sqrt((*(lgmres_functions->InnerProd))(p[0],p[0])); + r_norm = hypre_sqrt((*(lgmres_functions->InnerProd))(p[0], p[0])); r_norm_0 = r_norm; - /* Since it is does not diminish performance, attempt to return an error flag + /* Since it does not diminish performance, attempt to return an error flag and notify users when they supply bad input. */ - if (r_norm != 0.) ieee_check = r_norm/r_norm; /* INF -> NaN conversion */ + if (r_norm != 0.) { ieee_check = r_norm / r_norm; } /* INF -> NaN conversion */ if (ieee_check != ieee_check) { /* ...INFs or NaNs in input can make ieee_check a NaN. This test @@ -416,11 +456,11 @@ hypre_LGMRESSolve(void *lgmres_vdata, found at http://HTTP.CS.Berkeley.EDU/~wkahan/ieee754status/IEEE754.PDF */ if (logging > 0 || print_level > 0) { - hypre_printf("\n\nERROR detected by Hypre ... BEGIN\n"); - hypre_printf("ERROR -- hypre_LGMRESSolve: INFs and/or NaNs detected in input.\n"); - hypre_printf("User probably placed non-numerics in supplied A or x_0.\n"); - hypre_printf("Returning error flag += 101. Program not terminated.\n"); - hypre_printf("ERROR detected by Hypre ... END\n\n\n"); + hypre_printf("\n\nERROR detected by Hypre ... BEGIN\n"); + hypre_printf("ERROR -- hypre_LGMRESSolve: INFs and/or NaNs detected in input.\n"); + hypre_printf("User probably placed non-numerics in supplied A or x_0.\n"); + hypre_printf("Returning error flag += 101. Program not terminated.\n"); + hypre_printf("ERROR detected by Hypre ... END\n\n\n"); } hypre_error(HYPRE_ERROR_GENERIC); HYPRE_ANNOTATE_FUNC_END; @@ -428,14 +468,16 @@ hypre_LGMRESSolve(void *lgmres_vdata, return hypre_error_flag; } - if ( logging>0 || print_level > 0) + if ( logging > 0 || print_level > 0) { norms[0] = r_norm; - if ( print_level>1 && my_id == 0 ) + if ( print_level > 1 && my_id == 0 ) { - hypre_printf("L2 norm of b: %e\n", b_norm); + hypre_printf("L2 norm of b: %e\n", b_norm); if (b_norm == 0.0) + { hypre_printf("Rel_resid_norm actually contains the residual norm\n"); + } hypre_printf("Initial L2 norm of residual: %e\n", r_norm); } @@ -444,47 +486,50 @@ hypre_LGMRESSolve(void *lgmres_vdata, if (b_norm > 0.0) { -/* convergence criterion |r_i|/|b| <= accuracy if |b| > 0 */ - den_norm= b_norm; + /* convergence criterion |r_i|/|b| <= accuracy if |b| > 0 */ + den_norm = b_norm; } else { -/* convergence criterion |r_i|/|r0| <= accuracy if |b| = 0 */ - den_norm= r_norm; + /* convergence criterion |r_i|/|r0| <= accuracy if |b| = 0 */ + den_norm = r_norm; }; - /* convergence criteria: |r_i| <= max( a_tol, r_tol * den_norm) - den_norm = |r_0| or |b| - note: default for a_tol is 0.0, so relative residual criteria is used unless - user specifies a_tol, or sets r_tol = 0.0, which means absolute - tol only is checked */ + /* convergence criteria: |r_i| <= max( a_tol, r_tol * den_norm) + den_norm = |r_0| or |b| + note: default for a_tol is 0.0, so relative residual criteria is used unless + user specifies a_tol, or sets r_tol = 0.0, which means absolute + tol only is checked */ - epsilon = hypre_max(a_tol,r_tol*den_norm); + epsilon = hypre_max(a_tol, r_tol * den_norm); /* so now our stop criteria is |r_i| <= epsilon */ - if ( print_level>1 && my_id == 0 ) + if ( print_level > 1 && my_id == 0 ) { if (b_norm > 0.0) - {hypre_printf("=============================================\n\n"); - hypre_printf("Iters resid.norm conv.rate rel.res.norm\n"); - hypre_printf("----- ------------ ---------- ------------\n"); + { + hypre_printf("=============================================\n\n"); + hypre_printf("Iters resid.norm conv.rate rel.res.norm\n"); + hypre_printf("----- ------------ ---------- ------------\n"); - } + } else - {hypre_printf("=============================================\n\n"); - hypre_printf("Iters resid.norm conv.rate\n"); - hypre_printf("----- ------------ ----------\n"); + { + hypre_printf("=============================================\n\n"); + hypre_printf("Iters resid.norm conv.rate\n"); + hypre_printf("----- ------------ ----------\n"); - }; + }; } -/*lgmres initialization */ - for (ii=0; ii= min_iter) - { - (*(lgmres_functions->CopyVector))(b,r); - (*(lgmres_functions->Matvec))(matvec_data,-1.0,A,x,1.0,r); - r_norm = sqrt((*(lgmres_functions->InnerProd))(r,r)); - if (r_norm <= epsilon) - { - if ( print_level>1 && my_id == 0) - { - hypre_printf("\n\n"); - hypre_printf("Final L2 norm of residual: %e\n\n", r_norm); - } - break; - } - else - if ( print_level>0 && my_id == 0) - hypre_printf("false convergence 1\n"); - - } - - t = 1.0 / r_norm; - r_norm_last = r_norm; - - (*(lgmres_functions->ScaleVector))(t,p[0]); - i = 0; - - /* lgmres mod: determine number of arnoldi steps to take */ - /* if approx_constant then we keep the space the same size - even if we don't have the full number of aug vectors yet*/ - if (approx_constant) { - it_arnoldi = k_dim - aug_ct; - } else { - it_arnoldi = k_dim - aug_dim; - } - it_total = it_arnoldi + aug_ct; - it_aug = 0; /* keep track of augmented iterations */ - - - /***RESTART CYCLE (right-preconditioning) ***/ - while (i < it_total && iter < max_iter) - { - i++; - iter++; - (*(lgmres_functions->ClearVector))(r); - - - /*LGMRES_MOD: decide whether this is an arnoldi step or an aug step */ - if ( i <= it_arnoldi) - { /* Arnoldi */ - precond(precond_data, A, p[i-1], r); - (*(lgmres_functions->Matvec))(matvec_data, 1.0, A, r, 0.0, p[i]); - } else - { /*lgmres aug step */ - it_aug ++; - order = i - it_arnoldi - 1; /* which aug step (note i starts at 1) - aug order number at 0*/ - for (ii=0; iiCopyVector))(a_aug_vecs[spot],p[i]); - - /*note: an alternate implementation choice would be to only save the AUGVECS and - not A_AUGVEC and then apply the PC here to the augvec */ - } - /*---*/ - - /* modified Gram_Schmidt */ - for (j=0; j < i; j++) - { - hh[j][i-1] = (*(lgmres_functions->InnerProd))(p[j],p[i]); - (*(lgmres_functions->Axpy))(-hh[j][i-1],p[j],p[i]); - } - t = sqrt((*(lgmres_functions->InnerProd))(p[i],p[i])); - hh[i][i-1] = t; - if (t != 0.0) - { - t = 1.0/t; - (*(lgmres_functions->ScaleVector))(t,p[i]); - } - - - /* done with modified Gram_schmidt and Arnoldi step. - update factorization of hh */ - for (j = 1; j < i; j++) - { - t = hh[j-1][i-1]; - hh[j-1][i-1] = s[j-1]*hh[j][i-1] + c[j-1]*t; - hh[j][i-1] = -s[j-1]*t + c[j-1]*hh[j][i-1]; - } - t= hh[i][i-1]*hh[i][i-1]; - t+= hh[i-1][i-1]*hh[i-1][i-1]; - gamma = sqrt(t); - if (gamma == 0.0) gamma = epsmac; - c[i-1] = hh[i-1][i-1]/gamma; - s[i-1] = hh[i][i-1]/gamma; - rs[i] = -hh[i][i-1]*rs[i-1]; - rs[i]/= gamma; - rs[i-1] = c[i-1]*rs[i-1]; - /* determine residual norm */ - hh[i-1][i-1] = s[i-1]*hh[i][i-1] + c[i-1]*hh[i-1][i-1]; - r_norm = fabs(rs[i]); - - /* print ? */ - if ( print_level>0 ) - { - norms[iter] = r_norm; - if ( print_level>1 && my_id == 0 ) - { - if (b_norm > 0.0) - hypre_printf("% 5d %e %f %e\n", iter, - norms[iter],norms[iter]/norms[iter-1], - norms[iter]/b_norm); - else - hypre_printf("% 5d %e %f\n", iter, norms[iter], - norms[iter]/norms[iter-1]); - } - } - /*convergence factor tolerance */ - if (cf_tol > 0.0) - { - cf_ave_0 = cf_ave_1; - cf_ave_1 = pow( r_norm / r_norm_0, 1.0/(2.0*iter)); - - weight = fabs(cf_ave_1 - cf_ave_0); - weight = weight / hypre_max(cf_ave_1, cf_ave_0); - weight = 1.0 - weight; + /* initialize first term of hessenberg system */ + + rs[0] = r_norm; + if (r_norm == 0.0) + { + hypre_TFreeF(c, lgmres_functions); + hypre_TFreeF(s, lgmres_functions); + hypre_TFreeF(rs, lgmres_functions); + for (i = 0; i < k_dim + aug_dim + 1; i++) + { + hypre_TFreeF(hh[i], lgmres_functions); + } + + hypre_TFreeF(hh, lgmres_functions); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; + } + + /* see if we are already converged and + should print the final norm and exit */ + if (r_norm <= epsilon && iter >= min_iter) + { + (*(lgmres_functions->CopyVector))(b, r); + (*(lgmres_functions->Matvec))(matvec_data, -1.0, A, x, 1.0, r); + r_norm = hypre_sqrt((*(lgmres_functions->InnerProd))(r, r)); + if (r_norm <= epsilon) + { + if ( print_level > 1 && my_id == 0) + { + hypre_printf("\n\n"); + hypre_printf("Final L2 norm of residual: %e\n\n", r_norm); + } + break; + } + else if ( print_level > 0 && my_id == 0) + { + hypre_printf("false convergence 1\n"); + } + + } + + t = 1.0 / r_norm; + r_norm_last = r_norm; + + (*(lgmres_functions->ScaleVector))(t, p[0]); + i = 0; + + /* lgmres mod: determine number of arnoldi steps to take */ + /* if approx_constant then we keep the space the same size + even if we don't have the full number of aug vectors yet*/ + if (approx_constant) + { + it_arnoldi = k_dim - aug_ct; + } + else + { + it_arnoldi = k_dim - aug_dim; + } + it_total = it_arnoldi + aug_ct; + it_aug = 0; /* keep track of augmented iterations */ + + + /***RESTART CYCLE (right-preconditioning) ***/ + while (i < it_total && iter < max_iter) + { + i++; + iter++; + (*(lgmres_functions->ClearVector))(r); + + + /*LGMRES_MOD: decide whether this is an arnoldi step or an aug step */ + if ( i <= it_arnoldi) + { + /* Arnoldi */ + precond(precond_data, A, p[i - 1], r); + (*(lgmres_functions->Matvec))(matvec_data, 1.0, A, r, 0.0, p[i]); + } + else + { + /*lgmres aug step */ + it_aug ++; + order = i - it_arnoldi - 1; /* which aug step (note i starts at 1) - aug order number at 0*/ + for (ii = 0; ii < aug_dim; ii++) + { + if (aug_order[ii] == order) + { + spot = ii; + break; /* must have this because there will be duplicates before aug_ct = aug_dim */ + } + } + /* copy a_aug_vecs[spot] to p[i] */ + (*(lgmres_functions->CopyVector))(a_aug_vecs[spot], p[i]); + + /*note: an alternate implementation choice would be to only save the AUGVECS and + not A_AUGVEC and then apply the PC here to the augvec */ + } + /*---*/ + + /* modified Gram_Schmidt */ + for (j = 0; j < i; j++) + { + hh[j][i - 1] = (*(lgmres_functions->InnerProd))(p[j], p[i]); + (*(lgmres_functions->Axpy))(-hh[j][i - 1], p[j], p[i]); + } + t = hypre_sqrt((*(lgmres_functions->InnerProd))(p[i], p[i])); + hh[i][i - 1] = t; + if (t != 0.0) + { + t = 1.0 / t; + (*(lgmres_functions->ScaleVector))(t, p[i]); + } + + + /* done with modified Gram_schmidt and Arnoldi step. + update factorization of hh */ + for (j = 1; j < i; j++) + { + t = hh[j - 1][i - 1]; + hh[j - 1][i - 1] = s[j - 1] * hh[j][i - 1] + c[j - 1] * t; + hh[j][i - 1] = -s[j - 1] * t + c[j - 1] * hh[j][i - 1]; + } + t = hh[i][i - 1] * hh[i][i - 1]; + t += hh[i - 1][i - 1] * hh[i - 1][i - 1]; + gamma = hypre_sqrt(t); + if (gamma == 0.0) { gamma = epsmac; } + c[i - 1] = hh[i - 1][i - 1] / gamma; + s[i - 1] = hh[i][i - 1] / gamma; + rs[i] = -hh[i][i - 1] * rs[i - 1]; + rs[i] /= gamma; + rs[i - 1] = c[i - 1] * rs[i - 1]; + /* determine residual norm */ + hh[i - 1][i - 1] = s[i - 1] * hh[i][i - 1] + c[i - 1] * hh[i - 1][i - 1]; + r_norm = hypre_abs(rs[i]); + + /* print ? */ + if ( print_level > 0 ) + { + norms[iter] = r_norm; + if ( print_level > 1 && my_id == 0 ) + { + if (b_norm > 0.0) + hypre_printf("% 5d %e %f %e\n", iter, + norms[iter], norms[iter] / norms[iter - 1], + norms[iter] / b_norm); + else + hypre_printf("% 5d %e %f\n", iter, norms[iter], + norms[iter] / norms[iter - 1]); + } + } + /*convergence factor tolerance */ + if (cf_tol > 0.0) + { + cf_ave_0 = cf_ave_1; + cf_ave_1 = hypre_pow( r_norm / r_norm_0, 1.0 / (2.0 * iter)); + + weight = hypre_abs(cf_ave_1 - cf_ave_0); + weight = weight / hypre_max(cf_ave_1, cf_ave_0); + weight = 1.0 - weight; #if 0 - hypre_printf("I = %d: cf_new = %e, cf_old = %e, weight = %e\n", - i, cf_ave_1, cf_ave_0, weight ); + hypre_printf("I = %d: cf_new = %e, cf_old = %e, weight = %e\n", + i, cf_ave_1, cf_ave_0, weight ); #endif - if (weight * cf_ave_1 > cf_tol) - { - break_value = 1; - break; - } - } - /* should we exit the restart cycle? (conv. check) */ - if (r_norm <= epsilon && iter >= min_iter) - { - break; - } - - - } /*** end of restart cycle ***/ - - /* now compute solution, first solve upper triangular system */ - - if (break_value) break; - - rs[i-1] = rs[i-1]/hh[i-1][i-1]; - for (k = i-2; k >= 0; k--) - { - t = 0.0; - for (j = k+1; j < i; j++) - { - t -= hh[k][j]*rs[j]; - } - t+= rs[k]; - rs[k] = t/hh[k][k]; - } - /* form linear combination of p's to get solution */ - /* put the new aug_vector in aug_vecs[aug_dim] - a temp position*/ - /* i = number of iterations */ - /* it_aug = number of augmented iterations */ - /* it_arnoldi = number of arnoldi iterations */ - - - /*check if exited early before all arnoldi its */ - if (it_arnoldi > i) it_arnoldi = i; - - - if (!it_aug) - { - (*(lgmres_functions->CopyVector))(p[i-1],w); - (*(lgmres_functions->ScaleVector))(rs[i-1],w); - for (j = i-2; j >=0; j--) - (*(lgmres_functions->Axpy))(rs[j], p[j], w); - } - else /* need some of the augvecs */ - { - (*(lgmres_functions->CopyVector))(p[0],w); - (*(lgmres_functions->ScaleVector))(rs[0],w); - - /* reg. arnoldi directions */ - for (j = 1; j < it_arnoldi; j++) /*first one already done */ - { - (*(lgmres_functions->Axpy))(rs[j], p[j], w); - } - - /* augment directions */ - for (ii=0; ii cf_tol) + { + break_value = 1; + break; + } + } + /* should we exit the restart cycle? (conv. check) */ + if (r_norm <= epsilon && iter >= min_iter) + { + break; + } + + + } /*** end of restart cycle ***/ + + /* now compute solution, first solve upper triangular system */ + + if (break_value) { break; } + + rs[i - 1] = rs[i - 1] / hh[i - 1][i - 1]; + for (k = i - 2; k >= 0; k--) + { + t = 0.0; + for (j = k + 1; j < i; j++) + { + t -= hh[k][j] * rs[j]; + } + t += rs[k]; + rs[k] = t / hh[k][k]; + } + /* form linear combination of p's to get solution */ + /* put the new aug_vector in aug_vecs[aug_dim] - a temp position*/ + /* i = number of iterations */ + /* it_aug = number of augmented iterations */ + /* it_arnoldi = number of arnoldi iterations */ + + + /*check if exited early before all arnoldi its */ + if (it_arnoldi > i) { it_arnoldi = i; } + + + if (!it_aug) + { + (*(lgmres_functions->CopyVector))(p[i - 1], w); + (*(lgmres_functions->ScaleVector))(rs[i - 1], w); + for (j = i - 2; j >= 0; j--) + { + (*(lgmres_functions->Axpy))(rs[j], p[j], w); + } + } + else /* need some of the augvecs */ + { + (*(lgmres_functions->CopyVector))(p[0], w); + (*(lgmres_functions->ScaleVector))(rs[0], w); + + /* reg. arnoldi directions */ + for (j = 1; j < it_arnoldi; j++) /*first one already done */ + { + (*(lgmres_functions->Axpy))(rs[j], p[j], w); + } + + /* augment directions */ + for (ii = 0; ii < it_aug; ii++) + { + for (j = 0; j < aug_dim; j++) + { + if (aug_order[j] == ii) + { + spot = j; + break; /* must have this because there will be * duplicates before aug_ct = aug_dim */ - } - } - (*(lgmres_functions->Axpy))(rs[it_arnoldi+ii], aug_vecs[spot], w); - } - } - - - /* grab the new aug vector before the prec*/ - (*(lgmres_functions->CopyVector))(w,aug_vecs[aug_dim]); - - (*(lgmres_functions->ClearVector))(r); - /* find correction (in r) (un-wind precond.)*/ - precond(precond_data, A, w, r); - - /* update current solution x (in x) */ - (*(lgmres_functions->Axpy))(1.0,r,x); - - - /* check for convergence by evaluating the actual residual */ - if (r_norm <= epsilon && iter >= min_iter) - { - /* calculate actual residual norm*/ - (*(lgmres_functions->CopyVector))(b,r); - (*(lgmres_functions->Matvec))(matvec_data,-1.0,A,x,1.0,r); - r_norm = sqrt( (*(lgmres_functions->InnerProd))(r,r) ); - - if (r_norm <= epsilon) - { - if ( print_level>1 && my_id == 0 ) - { - hypre_printf("\n\n"); - hypre_printf("Final L2 norm of residual: %e\n\n", r_norm); - } - (lgmres_data -> converged) = 1; - break; - } - else /* conv. has not occurred, according to true residual */ - { - if ( print_level>0 && my_id == 0) - hypre_printf("false convergence 2\n"); - (*(lgmres_functions->CopyVector))(r,p[0]); - i = 0; - } - } /* end of convergence check */ - - /* compute residual vector and continue loop */ - - /* copy r0 (not scaled) to w*/ - (*(lgmres_functions->CopyVector))(p[0],w); - (*(lgmres_functions->ScaleVector))(r_norm_last,w); - - - for (j=i ; j > 0; j--) - { - rs[j-1] = -s[j-1]*rs[j]; - rs[j] = c[j-1]*rs[j]; - } - - if (i) (*(lgmres_functions->Axpy))(rs[i]-1.0,p[i],p[i]); - for (j=i-1 ; j > 0; j--) - (*(lgmres_functions->Axpy))(rs[j],p[j],p[i]); - - if (i) - { - (*(lgmres_functions->Axpy))(rs[0]-1.0,p[0],p[0]); - (*(lgmres_functions->Axpy))(1.0,p[i],p[0]); - } - - /* lgmres mod */ - /* collect aug vector and A*augvector for future restarts - - only if we will be restarting (i.e. this cycle performed it_total - iterations). ordering starts at 0.*/ - if (aug_dim > 0) - { - if (!aug_ct) - { - spot = 0; - aug_ct++; - } - else if (aug_ct < aug_dim) - { - spot = aug_ct; - aug_ct++; - } - else - { /* truncate - already have aug_dim number of vectors*/ - for (ii=0; iiCopyVector))(aug_vecs[aug_dim], aug_vecs[spot]); - /*need to normalize */ - tmp_norm = sqrt((*(lgmres_functions->InnerProd))(aug_vecs[spot], aug_vecs[spot])); - - tmp_norm = 1.0/tmp_norm; - (*(lgmres_functions->ScaleVector))(tmp_norm ,aug_vecs[spot]); - - /*set new aug vector to order 0 - move all others back one */ - for (ii=0; ii < aug_dim; ii++) - { - aug_order[ii]++; - } - aug_order[spot] = 0; - - /*now add the A*aug vector to A_AUGVEC(spot) - this is - * independ. of preconditioning type*/ - /* A*augvec = V*H*y = r0-rm (r0 is in w and rm is in p[0])*/ - (*(lgmres_functions->CopyVector))( w, a_aug_vecs[spot]); - (*(lgmres_functions->ScaleVector))(- 1.0, a_aug_vecs[spot]); /* -r0*/ - (*(lgmres_functions->Axpy))(1.0, p[0],a_aug_vecs[spot]); /* rm - r0 */ - (*(lgmres_functions->ScaleVector))(-tmp_norm, a_aug_vecs[spot]); /* r0-rm /norm */ - - } + } + } + (*(lgmres_functions->Axpy))(rs[it_arnoldi + ii], aug_vecs[spot], w); + } + } + + + /* grab the new aug vector before the prec*/ + (*(lgmres_functions->CopyVector))(w, aug_vecs[aug_dim]); + + (*(lgmres_functions->ClearVector))(r); + /* find correction (in r) (un-wind precond.)*/ + precond(precond_data, A, w, r); + + /* update current solution x (in x) */ + (*(lgmres_functions->Axpy))(1.0, r, x); + + + /* check for convergence by evaluating the actual residual */ + if (r_norm <= epsilon && iter >= min_iter) + { + /* calculate actual residual norm*/ + (*(lgmres_functions->CopyVector))(b, r); + (*(lgmres_functions->Matvec))(matvec_data, -1.0, A, x, 1.0, r); + r_norm = hypre_sqrt( (*(lgmres_functions->InnerProd))(r, r) ); + + if (r_norm <= epsilon) + { + if ( print_level > 1 && my_id == 0 ) + { + hypre_printf("\n\n"); + hypre_printf("Final L2 norm of residual: %e\n\n", r_norm); + } + (lgmres_data -> converged) = 1; + break; + } + else /* conv. has not occurred, according to true residual */ + { + if ( print_level > 0 && my_id == 0) + { + hypre_printf("false convergence 2\n"); + } + (*(lgmres_functions->CopyVector))(r, p[0]); + i = 0; + } + } /* end of convergence check */ + + /* compute residual vector and continue loop */ + + /* copy r0 (not scaled) to w*/ + (*(lgmres_functions->CopyVector))(p[0], w); + (*(lgmres_functions->ScaleVector))(r_norm_last, w); + + + for (j = i ; j > 0; j--) + { + rs[j - 1] = -s[j - 1] * rs[j]; + rs[j] = c[j - 1] * rs[j]; + } + + if (i) { (*(lgmres_functions->Axpy))(rs[i] - 1.0, p[i], p[i]); } + for (j = i - 1 ; j > 0; j--) + { + (*(lgmres_functions->Axpy))(rs[j], p[j], p[i]); + } + + if (i) + { + (*(lgmres_functions->Axpy))(rs[0] - 1.0, p[0], p[0]); + (*(lgmres_functions->Axpy))(1.0, p[i], p[0]); + } + + /* lgmres mod */ + /* collect aug vector and A*augvector for future restarts - + only if we will be restarting (i.e. this cycle performed it_total + iterations). ordering starts at 0.*/ + if (aug_dim > 0) + { + if (!aug_ct) + { + spot = 0; + aug_ct++; + } + else if (aug_ct < aug_dim) + { + spot = aug_ct; + aug_ct++; + } + else + { + /* truncate - already have aug_dim number of vectors*/ + for (ii = 0; ii < aug_dim; ii++) + { + if (aug_order[ii] == (aug_dim - 1)) + { + spot = ii; + } + } + } + /* aug_vecs[aug_dim] contains new aug vector */ + (*(lgmres_functions->CopyVector))(aug_vecs[aug_dim], aug_vecs[spot]); + /*need to normalize */ + tmp_norm = hypre_sqrt((*(lgmres_functions->InnerProd))(aug_vecs[spot], aug_vecs[spot])); + + tmp_norm = 1.0 / tmp_norm; + (*(lgmres_functions->ScaleVector))(tmp_norm, aug_vecs[spot]); + + /*set new aug vector to order 0 - move all others back one */ + for (ii = 0; ii < aug_dim; ii++) + { + aug_order[ii]++; + } + aug_order[spot] = 0; + + /*now add the A*aug vector to A_AUGVEC(spot) - this is + * independ. of preconditioning type*/ + /* A*augvec = V*H*y = r0-rm (r0 is in w and rm is in p[0])*/ + (*(lgmres_functions->CopyVector))( w, a_aug_vecs[spot]); + (*(lgmres_functions->ScaleVector))(- 1.0, a_aug_vecs[spot]); /* -r0*/ + (*(lgmres_functions->Axpy))(1.0, p[0], a_aug_vecs[spot]); /* rm - r0 */ + (*(lgmres_functions->ScaleVector))(-tmp_norm, a_aug_vecs[spot]); /* r0-rm /norm */ + + } } /* END of iteration while loop */ - if ( print_level>1 && my_id == 0 ) - hypre_printf("\n\n"); + if ( print_level > 1 && my_id == 0 ) + { + hypre_printf("\n\n"); + } (lgmres_data -> num_iterations) = iter; if (b_norm > 0.0) - (lgmres_data -> rel_residual_norm) = r_norm/b_norm; + { + (lgmres_data -> rel_residual_norm) = r_norm / b_norm; + } if (b_norm == 0.0) + { (lgmres_data -> rel_residual_norm) = r_norm; + } - if (iter >= max_iter && r_norm > epsilon && epsilon > 0) hypre_error(HYPRE_ERROR_CONV); + if (iter >= max_iter && r_norm > epsilon && epsilon > 0) { hypre_error(HYPRE_ERROR_CONV); } - hypre_TFreeF(c,lgmres_functions); - hypre_TFreeF(s,lgmres_functions); - hypre_TFreeF(rs,lgmres_functions); + hypre_TFreeF(c, lgmres_functions); + hypre_TFreeF(s, lgmres_functions); + hypre_TFreeF(rs, lgmres_functions); - for (i=0; i < k_dim+1+aug_dim; i++) + for (i = 0; i < k_dim + 1 + aug_dim; i++) { - hypre_TFreeF(hh[i],lgmres_functions); + hypre_TFreeF(hh[i], lgmres_functions); } - hypre_TFreeF(hh,lgmres_functions); + hypre_TFreeF(hh, lgmres_functions); HYPRE_ANNOTATE_FUNC_END; @@ -873,7 +939,7 @@ hypre_LGMRESSolve(void *lgmres_vdata, HYPRE_Int hypre_LGMRESSetKDim( void *lgmres_vdata, - HYPRE_Int k_dim ) + HYPRE_Int k_dim ) { hypre_LGMRESData *lgmres_data = (hypre_LGMRESData *)lgmres_vdata; @@ -886,7 +952,7 @@ hypre_LGMRESSetKDim( void *lgmres_vdata, HYPRE_Int hypre_LGMRESGetKDim( void *lgmres_vdata, - HYPRE_Int * k_dim ) + HYPRE_Int * k_dim ) { hypre_LGMRESData *lgmres_data = (hypre_LGMRESData *)lgmres_vdata; @@ -901,20 +967,20 @@ hypre_LGMRESGetKDim( void *lgmres_vdata, HYPRE_Int hypre_LGMRESSetAugDim( void *lgmres_vdata, - HYPRE_Int aug_dim ) + HYPRE_Int aug_dim ) { hypre_LGMRESData *lgmres_data = (hypre_LGMRESData *)lgmres_vdata; - if (aug_dim < 0) aug_dim = 0; /* must be positive */ + if (aug_dim < 0) { aug_dim = 0; } /* must be positive */ - if (aug_dim > (lgmres_data -> k_dim) -1) /* must be be <= (restart size-1) */ + if (aug_dim > (lgmres_data -> k_dim) - 1) /* must be be <= (restart size-1) */ { - while (aug_dim > (lgmres_data -> k_dim) -1) + while (aug_dim > (lgmres_data -> k_dim) - 1) { aug_dim--; } - aug_dim = (((0)<(aug_dim)) ? (aug_dim) : (0)); + aug_dim = (((0) < (aug_dim)) ? (aug_dim) : (0)); } (lgmres_data -> aug_dim) = aug_dim; @@ -941,7 +1007,7 @@ hypre_LGMRESGetAugDim( void *lgmres_vdata, HYPRE_Int hypre_LGMRESSetTol( void *lgmres_vdata, - HYPRE_Real tol ) + HYPRE_Real tol ) { hypre_LGMRESData *lgmres_data = (hypre_LGMRESData *)lgmres_vdata; @@ -953,7 +1019,7 @@ hypre_LGMRESSetTol( void *lgmres_vdata, HYPRE_Int hypre_LGMRESGetTol( void *lgmres_vdata, - HYPRE_Real * tol ) + HYPRE_Real * tol ) { hypre_LGMRESData *lgmres_data = (hypre_LGMRESData *)lgmres_vdata; @@ -968,7 +1034,7 @@ hypre_LGMRESGetTol( void *lgmres_vdata, HYPRE_Int hypre_LGMRESSetAbsoluteTol( void *lgmres_vdata, - HYPRE_Real a_tol ) + HYPRE_Real a_tol ) { hypre_LGMRESData *lgmres_data = (hypre_LGMRESData *)lgmres_vdata; @@ -980,7 +1046,7 @@ hypre_LGMRESSetAbsoluteTol( void *lgmres_vdata, HYPRE_Int hypre_LGMRESGetAbsoluteTol( void *lgmres_vdata, - HYPRE_Real * a_tol ) + HYPRE_Real * a_tol ) { hypre_LGMRESData *lgmres_data = (hypre_LGMRESData *)lgmres_vdata; @@ -995,7 +1061,7 @@ hypre_LGMRESGetAbsoluteTol( void *lgmres_vdata, HYPRE_Int hypre_LGMRESSetConvergenceFactorTol( void *lgmres_vdata, - HYPRE_Real cf_tol ) + HYPRE_Real cf_tol ) { hypre_LGMRESData *lgmres_data = (hypre_LGMRESData *)lgmres_vdata; @@ -1007,7 +1073,7 @@ hypre_LGMRESSetConvergenceFactorTol( void *lgmres_vdata, HYPRE_Int hypre_LGMRESGetConvergenceFactorTol( void *lgmres_vdata, - HYPRE_Real * cf_tol ) + HYPRE_Real * cf_tol ) { hypre_LGMRESData *lgmres_data = (hypre_LGMRESData *)lgmres_vdata; @@ -1023,7 +1089,7 @@ hypre_LGMRESGetConvergenceFactorTol( void *lgmres_vdata, HYPRE_Int hypre_LGMRESSetMinIter( void *lgmres_vdata, - HYPRE_Int min_iter ) + HYPRE_Int min_iter ) { hypre_LGMRESData *lgmres_data = (hypre_LGMRESData *)lgmres_vdata; @@ -1035,7 +1101,7 @@ hypre_LGMRESSetMinIter( void *lgmres_vdata, HYPRE_Int hypre_LGMRESGetMinIter( void *lgmres_vdata, - HYPRE_Int * min_iter ) + HYPRE_Int * min_iter ) { hypre_LGMRESData *lgmres_data = (hypre_LGMRESData *)lgmres_vdata; @@ -1051,7 +1117,7 @@ hypre_LGMRESGetMinIter( void *lgmres_vdata, HYPRE_Int hypre_LGMRESSetMaxIter( void *lgmres_vdata, - HYPRE_Int max_iter ) + HYPRE_Int max_iter ) { hypre_LGMRESData *lgmres_data = (hypre_LGMRESData *)lgmres_vdata; @@ -1063,7 +1129,7 @@ hypre_LGMRESSetMaxIter( void *lgmres_vdata, HYPRE_Int hypre_LGMRESGetMaxIter( void *lgmres_vdata, - HYPRE_Int * max_iter ) + HYPRE_Int * max_iter ) { hypre_LGMRESData *lgmres_data = (hypre_LGMRESData *)lgmres_vdata; @@ -1080,7 +1146,7 @@ hypre_LGMRESGetMaxIter( void *lgmres_vdata, HYPRE_Int hypre_LGMRESSetStopCrit( void *lgmres_vdata, - HYPRE_Int stop_crit ) + HYPRE_Int stop_crit ) { hypre_LGMRESData *lgmres_data = (hypre_LGMRESData *)lgmres_vdata; @@ -1092,7 +1158,7 @@ hypre_LGMRESSetStopCrit( void *lgmres_vdata, HYPRE_Int hypre_LGMRESGetStopCrit( void *lgmres_vdata, - HYPRE_Int * stop_crit ) + HYPRE_Int * stop_crit ) { hypre_LGMRESData *lgmres_data = (hypre_LGMRESData *)lgmres_vdata; @@ -1108,9 +1174,9 @@ hypre_LGMRESGetStopCrit( void *lgmres_vdata, HYPRE_Int hypre_LGMRESSetPrecond( void *lgmres_vdata, - HYPRE_Int (*precond)(void*,void*,void*,void*), - HYPRE_Int (*precond_setup)(void*,void*,void*,void*), - void *precond_data ) + HYPRE_Int (*precond)(void*, void*, void*, void*), + HYPRE_Int (*precond_setup)(void*, void*, void*, void*), + void *precond_data ) { hypre_LGMRESData *lgmres_data = (hypre_LGMRESData *)lgmres_vdata; hypre_LGMRESFunctions *lgmres_functions = lgmres_data->functions; @@ -1129,7 +1195,7 @@ hypre_LGMRESSetPrecond( void *lgmres_vdata, HYPRE_Int hypre_LGMRESGetPrecond( void *lgmres_vdata, - HYPRE_Solver *precond_data_ptr ) + HYPRE_Solver *precond_data_ptr ) { hypre_LGMRESData *lgmres_data = (hypre_LGMRESData *)lgmres_vdata; @@ -1145,7 +1211,7 @@ hypre_LGMRESGetPrecond( void *lgmres_vdata, HYPRE_Int hypre_LGMRESSetPrintLevel( void *lgmres_vdata, - HYPRE_Int level) + HYPRE_Int level) { hypre_LGMRESData *lgmres_data = (hypre_LGMRESData *)lgmres_vdata; @@ -1157,7 +1223,7 @@ hypre_LGMRESSetPrintLevel( void *lgmres_vdata, HYPRE_Int hypre_LGMRESGetPrintLevel( void *lgmres_vdata, - HYPRE_Int * level) + HYPRE_Int * level) { hypre_LGMRESData *lgmres_data = (hypre_LGMRESData *)lgmres_vdata; @@ -1173,7 +1239,7 @@ hypre_LGMRESGetPrintLevel( void *lgmres_vdata, HYPRE_Int hypre_LGMRESSetLogging( void *lgmres_vdata, - HYPRE_Int level) + HYPRE_Int level) { hypre_LGMRESData *lgmres_data = (hypre_LGMRESData *)lgmres_vdata; @@ -1185,7 +1251,7 @@ hypre_LGMRESSetLogging( void *lgmres_vdata, HYPRE_Int hypre_LGMRESGetLogging( void *lgmres_vdata, - HYPRE_Int * level) + HYPRE_Int * level) { hypre_LGMRESData *lgmres_data = (hypre_LGMRESData *)lgmres_vdata; @@ -1201,7 +1267,7 @@ hypre_LGMRESGetLogging( void *lgmres_vdata, HYPRE_Int hypre_LGMRESGetNumIterations( void *lgmres_vdata, - HYPRE_Int *num_iterations ) + HYPRE_Int *num_iterations ) { hypre_LGMRESData *lgmres_data = (hypre_LGMRESData *)lgmres_vdata; @@ -1217,7 +1283,7 @@ hypre_LGMRESGetNumIterations( void *lgmres_vdata, HYPRE_Int hypre_LGMRESGetConverged( void *lgmres_vdata, - HYPRE_Int *converged ) + HYPRE_Int *converged ) { hypre_LGMRESData *lgmres_data = (hypre_LGMRESData *)lgmres_vdata; @@ -1233,7 +1299,7 @@ hypre_LGMRESGetConverged( void *lgmres_vdata, HYPRE_Int hypre_LGMRESGetFinalRelativeResidualNorm( void *lgmres_vdata, - HYPRE_Real *relative_residual_norm ) + HYPRE_Real *relative_residual_norm ) { hypre_LGMRESData *lgmres_data = (hypre_LGMRESData *)lgmres_vdata; diff --git a/external/hypre/src/krylov/lgmres.h b/external/hypre/src/krylov/lgmres.h index c76478d9..610e7838 100644 --- a/external/hypre/src/krylov/lgmres.h +++ b/external/hypre/src/krylov/lgmres.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -84,13 +84,13 @@ typedef struct HYPRE_Real a_tol; HYPRE_Real rel_residual_norm; -/*lgmres specific stuff */ + /*lgmres specific stuff */ HYPRE_Int aug_dim; HYPRE_Int approx_constant; void **aug_vecs; HYPRE_Int *aug_order; void **a_aug_vecs; -/*---*/ + /*---*/ void *A; void *r; @@ -105,7 +105,7 @@ typedef struct /* log info (always logged) */ HYPRE_Int num_iterations; - + HYPRE_Int print_level; /* printing when print_level>0 */ HYPRE_Int logging; /* extra computations for logging when logging>0 */ HYPRE_Real *norms; @@ -150,7 +150,7 @@ hypre_LGMRESFunctionsCreate( HYPRE_Int (*Axpy) ( HYPRE_Complex alpha, void *x, void *y ), HYPRE_Int (*PrecondSetup) ( void *vdata, void *A, void *b, void *x ), HYPRE_Int (*Precond) ( void *vdata, void *A, void *b, void *x ) - ); +); /** * Description... diff --git a/external/hypre/src/krylov/lobpcg.c b/external/hypre/src/krylov/lobpcg.c index 5ea13469..5b5f807a 100644 --- a/external/hypre/src/krylov/lobpcg.c +++ b/external/hypre/src/krylov/lobpcg.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -21,967 +21,1063 @@ #include "multivector.h" static HYPRE_Int -lobpcg_chol( utilities_FortranMatrix* a, - HYPRE_Int (*dpotrf) (const char *uplo, HYPRE_Int *n, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Int *info) ) +lobpcg_chol( utilities_FortranMatrix* a, + HYPRE_Int (*dpotrf) (const char *uplo, HYPRE_Int *n, HYPRE_Real *a, HYPRE_Int *lda, + HYPRE_Int *info) ) { - HYPRE_Int lda, n; - HYPRE_Real* aval; - char uplo; - HYPRE_Int ierr; + HYPRE_Int lda, n; + HYPRE_Real* aval; + char uplo; + HYPRE_Int ierr; - lda = utilities_FortranMatrixGlobalHeight( a ); - n = utilities_FortranMatrixHeight( a ); - aval = utilities_FortranMatrixValues( a ); - uplo = 'U'; + lda = utilities_FortranMatrixGlobalHeight( a ); + n = utilities_FortranMatrixHeight( a ); + aval = utilities_FortranMatrixValues( a ); + uplo = 'U'; - (*dpotrf)( &uplo, &n, aval, &lda, &ierr ); + (*dpotrf)( &uplo, &n, aval, &lda, &ierr ); - return ierr; + return ierr; } static HYPRE_Int -lobpcg_solveGEVP( -utilities_FortranMatrix* mtxA, -utilities_FortranMatrix* mtxB, -utilities_FortranMatrix* eigVal, -HYPRE_Int (*dsygv) (HYPRE_Int *itype, char *jobz, char *uplo, HYPRE_Int * - n, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Real *b, HYPRE_Int *ldb, - HYPRE_Real *w, HYPRE_Real *work, HYPRE_Int *lwork, HYPRE_Int *info) -){ - - HYPRE_Int n, lda, ldb, itype, lwork, info; - char jobz, uplo; - HYPRE_Real* work; - HYPRE_Real* a; - HYPRE_Real* b; - HYPRE_Real* lmd; - - itype = 1; - jobz = 'V'; - uplo = 'L'; - - a = utilities_FortranMatrixValues( mtxA ); - b = utilities_FortranMatrixValues( mtxB ); - lmd = utilities_FortranMatrixValues( eigVal ); - - n = utilities_FortranMatrixHeight( mtxA ); - lda = utilities_FortranMatrixGlobalHeight( mtxA ); - ldb = utilities_FortranMatrixGlobalHeight( mtxB ); - lwork = 10*n; - - work = hypre_CTAlloc(HYPRE_Real, lwork, HYPRE_MEMORY_HOST); - - (*dsygv)( &itype, &jobz, &uplo, &n, - a, &lda, b, &ldb, - lmd, &work[0], &lwork, &info ); - - hypre_TFree( work ,HYPRE_MEMORY_HOST); - return info; +lobpcg_solveGEVP( + utilities_FortranMatrix* mtxA, + utilities_FortranMatrix* mtxB, + utilities_FortranMatrix* eigVal, + HYPRE_Int (*dsygv) (HYPRE_Int *itype, char *jobz, char *uplo, HYPRE_Int * + n, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Real *b, HYPRE_Int *ldb, + HYPRE_Real *w, HYPRE_Real *work, HYPRE_Int *lwork, HYPRE_Int *info) +) +{ + + HYPRE_Int n, lda, ldb, itype, lwork, info; + char jobz, uplo; + HYPRE_Real* work; + HYPRE_Real* a; + HYPRE_Real* b; + HYPRE_Real* lmd; + + itype = 1; + jobz = 'V'; + uplo = 'L'; + + a = utilities_FortranMatrixValues( mtxA ); + b = utilities_FortranMatrixValues( mtxB ); + lmd = utilities_FortranMatrixValues( eigVal ); + + n = utilities_FortranMatrixHeight( mtxA ); + lda = utilities_FortranMatrixGlobalHeight( mtxA ); + ldb = utilities_FortranMatrixGlobalHeight( mtxB ); + lwork = 10 * n; + + work = hypre_CTAlloc(HYPRE_Real, lwork, HYPRE_MEMORY_HOST); + + (*dsygv)( &itype, &jobz, &uplo, &n, + a, &lda, b, &ldb, + lmd, &work[0], &lwork, &info ); + + hypre_TFree( work, HYPRE_MEMORY_HOST); + return info; } static void lobpcg_MultiVectorByMultiVector( -mv_MultiVectorPtr x, -mv_MultiVectorPtr y, -utilities_FortranMatrix* xy -){ - mv_MultiVectorByMultiVector( x, y, - utilities_FortranMatrixGlobalHeight( xy ), - utilities_FortranMatrixHeight( xy ), - utilities_FortranMatrixWidth( xy ), - utilities_FortranMatrixValues( xy ) ); + mv_MultiVectorPtr x, + mv_MultiVectorPtr y, + utilities_FortranMatrix* xy +) +{ + mv_MultiVectorByMultiVector( x, y, + utilities_FortranMatrixGlobalHeight( xy ), + utilities_FortranMatrixHeight( xy ), + utilities_FortranMatrixWidth( xy ), + utilities_FortranMatrixValues( xy ) ); } static void lobpcg_MultiVectorByMatrix( -mv_MultiVectorPtr x, -utilities_FortranMatrix* r, -mv_MultiVectorPtr y -){ - mv_MultiVectorByMatrix( x, - utilities_FortranMatrixGlobalHeight( r ), - utilities_FortranMatrixHeight( r ), - utilities_FortranMatrixWidth( r ), - utilities_FortranMatrixValues( r ), - y ); + mv_MultiVectorPtr x, + utilities_FortranMatrix* r, + mv_MultiVectorPtr y +) +{ + mv_MultiVectorByMatrix( x, + utilities_FortranMatrixGlobalHeight( r ), + utilities_FortranMatrixHeight( r ), + utilities_FortranMatrixWidth( r ), + utilities_FortranMatrixValues( r ), + y ); } static HYPRE_Int -lobpcg_MultiVectorImplicitQR( -mv_MultiVectorPtr x, mv_MultiVectorPtr y, -utilities_FortranMatrix* r, -mv_MultiVectorPtr z, -HYPRE_Int (*dpotrf) (const char *uplo, HYPRE_Int *n, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Int *info) +lobpcg_MultiVectorImplicitQR( + mv_MultiVectorPtr x, mv_MultiVectorPtr y, + utilities_FortranMatrix* r, + mv_MultiVectorPtr z, + HYPRE_Int (*dpotrf) (const char *uplo, HYPRE_Int *n, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Int *info) -){ +) +{ - /* B-orthonormalizes x using y = B x */ + /* B-orthonormalizes x using y = B x */ - HYPRE_Int ierr; + HYPRE_Int ierr; - lobpcg_MultiVectorByMultiVector( x, y, r ); + lobpcg_MultiVectorByMultiVector( x, y, r ); - ierr = lobpcg_chol( r,dpotrf ); + ierr = lobpcg_chol( r, dpotrf ); - if ( ierr != 0 ) - return ierr; + if ( ierr != 0 ) + { + return ierr; + } - utilities_FortranMatrixUpperInv( r ); - utilities_FortranMatrixClearL( r ); + utilities_FortranMatrixUpperInv( r ); + utilities_FortranMatrixClearL( r ); - mv_MultiVectorCopy( x, z ); - lobpcg_MultiVectorByMatrix( z, r, x ); + mv_MultiVectorCopy( x, z ); + lobpcg_MultiVectorByMatrix( z, r, x ); - return 0; + return 0; } static void -lobpcg_sqrtVector( HYPRE_Int n, HYPRE_Int* mask, HYPRE_Real* v ) { +lobpcg_sqrtVector( HYPRE_Int n, HYPRE_Int* mask, HYPRE_Real* v ) +{ - HYPRE_Int i; + HYPRE_Int i; - for ( i = 0; i < n; i++ ) - if ( mask == NULL || mask[i] ) - v[i] = sqrt(v[i]); + for ( i = 0; i < n; i++ ) + if ( mask == NULL || mask[i] ) + { + v[i] = hypre_sqrt(v[i]); + } } static HYPRE_Int -lobpcg_checkResiduals( -utilities_FortranMatrix* resNorms, -utilities_FortranMatrix* lambda, -lobpcg_Tolerance tol, -HYPRE_Int* activeMask -){ - HYPRE_Int i, n; - HYPRE_Int notConverged; - HYPRE_Real atol; - HYPRE_Real rtol; - - n = utilities_FortranMatrixHeight( resNorms ); - - atol = tol.absolute; - rtol = tol.relative; - - notConverged = 0; - for ( i = 0; i < n; i++ ) { - if ( utilities_FortranMatrixValue( resNorms, i + 1, 1 ) > - utilities_FortranMatrixValue( lambda, i + 1, 1 )*rtol + atol - + HYPRE_REAL_EPSILON ) { - activeMask[i] = 1; - notConverged++; - } - else - activeMask[i] = 0; - } - return notConverged; +lobpcg_checkResiduals( + utilities_FortranMatrix* resNorms, + utilities_FortranMatrix* lambda, + lobpcg_Tolerance tol, + HYPRE_Int* activeMask +) +{ + HYPRE_Int i, n; + HYPRE_Int notConverged; + HYPRE_Real atol; + HYPRE_Real rtol; + + n = utilities_FortranMatrixHeight( resNorms ); + + atol = tol.absolute; + rtol = tol.relative; + + notConverged = 0; + for ( i = 0; i < n; i++ ) + { + if ( utilities_FortranMatrixValue( resNorms, i + 1, 1 ) > + utilities_FortranMatrixValue( lambda, i + 1, 1 )*rtol + atol + + HYPRE_REAL_EPSILON ) + { + activeMask[i] = 1; + notConverged++; + } + else + { + activeMask[i] = 0; + } + } + return notConverged; } static void lobpcg_errorMessage( HYPRE_Int verbosityLevel, const char* message ) { - if ( verbosityLevel ) { - hypre_fprintf( stderr, "Error in LOBPCG:\n" ); - hypre_fprintf( stderr, "%s", message ); - } + if ( verbosityLevel ) + { + hypre_fprintf( stderr, "Error in LOBPCG:\n" ); + hypre_fprintf( stderr, "%s", message ); + } } HYPRE_Int lobpcg_solve( mv_MultiVectorPtr blockVectorX, - void* operatorAData, - void (*operatorA)( void*, void*, void* ), - void* operatorBData, - void (*operatorB)( void*, void*, void* ), - void* operatorTData, - void (*operatorT)( void*, void*, void* ), - mv_MultiVectorPtr blockVectorY, + void* operatorAData, + void (*operatorA)( void*, void*, void* ), + void* operatorBData, + void (*operatorB)( void*, void*, void* ), + void* operatorTData, + void (*operatorT)( void*, void*, void* ), + mv_MultiVectorPtr blockVectorY, lobpcg_BLASLAPACKFunctions blap_fn, - lobpcg_Tolerance tolerance, - HYPRE_Int maxIterations, - HYPRE_Int verbosityLevel, - HYPRE_Int* iterationNumber, + lobpcg_Tolerance tolerance, + HYPRE_Int maxIterations, + HYPRE_Int verbosityLevel, + HYPRE_Int* iterationNumber, -/* eigenvalues; "lambda_values" should point to array containing doubles where is the width of multivector "blockVectorX" */ + /* eigenvalues; "lambda_values" should point to array containing doubles where is the width of multivector "blockVectorX" */ HYPRE_Real * lambda_values, -/* eigenvalues history; a pointer to the entries of the -by-(+1) matrix s -tored -in fortran-style. (i.e. column-wise) The matrix may be a submatrix of a larger matrix, see next -argument; If you don't need eigenvalues history, provide NULL in this entry */ + /* eigenvalues history; a pointer to the entries of the -by-(+1) matrix s + tored + in fortran-style. (i.e. column-wise) The matrix may be a submatrix of a larger matrix, see next + argument; If you don't need eigenvalues history, provide NULL in this entry */ HYPRE_Real * lambdaHistory_values, -/* global height of the matrix (stored in fotran-style) specified by previous argument */ - HYPRE_Int lambdaHistory_gh, + /* global height of the matrix (stored in fotran-style) specified by previous argument */ + HYPRE_BigInt lambdaHistory_gh, -/* residual norms; argument should point to array of doubles */ + /* residual norms; argument should point to array of doubles */ HYPRE_Real * residualNorms_values, -/* residual norms history; a pointer to the entries of the -by-(+1) matri -x -stored in fortran-style. (i.e. column-wise) The matrix may be a submatrix of a larger matrix, see -next -argument If you don't need residual norms history, provide NULL in this entry */ - HYPRE_Real * residualNormsHistory_values , + /* residual norms history; a pointer to the entries of the -by-(+1) matri + x + stored in fortran-style. (i.e. column-wise) The matrix may be a submatrix of a larger matrix, see + next + argument If you don't need residual norms history, provide NULL in this entry */ + HYPRE_Real * residualNormsHistory_values, -/* global height of the matrix (stored in fotran-style) specified by previous argument */ - HYPRE_Int residualNormsHistory_gh + /* global height of the matrix (stored in fotran-style) specified by previous argument */ + HYPRE_BigInt residualNormsHistory_gh -){ + ) +{ - HYPRE_Int sizeX; /* number of eigenvectors */ - HYPRE_Int sizeY; /* number of constraints */ - HYPRE_Int sizeR; /* number of residuals used */ - HYPRE_Int sizeP; /* number of conj. directions used */ - HYPRE_Int sizeA; /* size of the Gram matrix for A */ - HYPRE_Int sizeX3; /* 3*sizeX */ + HYPRE_Int sizeX; /* number of eigenvectors */ + HYPRE_Int sizeY; /* number of constraints */ + HYPRE_Int sizeR; /* number of residuals used */ + HYPRE_Int sizeP; /* number of conj. directions used */ + HYPRE_Int sizeA; /* size of the Gram matrix for A */ + HYPRE_Int sizeX3; /* 3*sizeX */ - HYPRE_Int firstR; /* first line of the Gram block - corresponding to residuals */ - HYPRE_Int lastR; /* last line of this block */ - HYPRE_Int firstP; /* same for conjugate directions */ - HYPRE_Int lastP; + HYPRE_Int firstR; /* first line of the Gram block + corresponding to residuals */ + HYPRE_Int lastR; /* last line of this block */ + HYPRE_Int firstP; /* same for conjugate directions */ + HYPRE_Int lastP; - HYPRE_Int noTFlag; /* nonzero: no preconditioner */ - HYPRE_Int noBFlag; /* nonzero: no operator B */ - HYPRE_Int noYFlag; /* nonzero: no constaints */ + HYPRE_Int noTFlag; /* nonzero: no preconditioner */ + HYPRE_Int noBFlag; /* nonzero: no operator B */ + HYPRE_Int noYFlag; /* nonzero: no constaints */ - HYPRE_Int exitFlag; /* 1: problem size is too small, - 2: block size < 1, - 3: linearly dependent constraints, - -1: requested accuracy not - achieved */ + HYPRE_Int exitFlag; /* 1: problem size is too small, + 2: block size < 1, + 3: linearly dependent constraints, + -1: requested accuracy not + achieved */ - HYPRE_Int* activeMask; /* soft locking mask */ + HYPRE_Int* activeMask; /* soft locking mask */ - HYPRE_Int i; /* short loop counter */ + HYPRE_Int i; /* short loop counter */ #if 0 - hypre_longint n; /* dimension 1 of X */ - /* had to remove because n is not available in some interfaces */ -#endif - - mv_MultiVectorPtr blockVectorR; /* residuals */ - mv_MultiVectorPtr blockVectorP; /* conjugate directions */ - - mv_MultiVectorPtr blockVectorW; /* auxiliary block vector */ - - mv_MultiVectorPtr blockVectorAX; /* A*X */ - mv_MultiVectorPtr blockVectorAR; /* A*R */ - mv_MultiVectorPtr blockVectorAP; /* A*P */ - - mv_MultiVectorPtr blockVectorBX; /* B*X */ - mv_MultiVectorPtr blockVectorBR; /* B*R */ - mv_MultiVectorPtr blockVectorBP; /* B*P */ - - mv_MultiVectorPtr blockVectorBY; /* B*Y */ - - utilities_FortranMatrix* gramA; /* Gram matrix for A */ - utilities_FortranMatrix* gramB; /* Gram matrix for B */ - utilities_FortranMatrix* lambdaAB; /* eigenvalues of - gramA u = lambda gram B u */ - utilities_FortranMatrix* lambdaX; /* first sizeX eigenvalues in - lambdaAB (ref) */ - - utilities_FortranMatrix* gramXAX; /* XX block of gramA (ref) */ - utilities_FortranMatrix* gramRAX; /* XR block of gramA (ref) */ - utilities_FortranMatrix* gramPAX; /* XP block of gramA (ref) */ - - utilities_FortranMatrix* gramRAR; /* RR block of gramA (ref) */ - utilities_FortranMatrix* gramPAR; /* RP block of gramA (ref) */ - - utilities_FortranMatrix* gramPAP; /* PP block of gramA (ref) */ - - utilities_FortranMatrix* gramXBX; /* XX block of gramB (ref) */ - utilities_FortranMatrix* gramRBX; /* XR block of gramB (ref) */ - utilities_FortranMatrix* gramPBX; /* XP block of gramB (ref) */ - - utilities_FortranMatrix* gramRBR; /* RR block of gramB (ref) */ - utilities_FortranMatrix* gramPBR; /* RP block of gramB (ref) */ - - utilities_FortranMatrix* gramPBP; /* PP block of gramB (ref) */ - - utilities_FortranMatrix* gramYBY; /* Matrices for constraints */ - utilities_FortranMatrix* gramYBX; - utilities_FortranMatrix* tempYBX; - utilities_FortranMatrix* gramYBR; /* ref. */ - utilities_FortranMatrix* tempYBR; /* ref. */ - - utilities_FortranMatrix* coordX; /* coordinates of the first sizeX - Ritz vectors in the XRP basis */ - utilities_FortranMatrix* coordXX; /* coordinates of the above in X */ - utilities_FortranMatrix* coordRX; /* coordinates of the above in R */ - utilities_FortranMatrix* coordPX; /* coordinates of the above in P */ - - utilities_FortranMatrix* upperR; /* R factor in QR-fact. (ref) */ - utilities_FortranMatrix* historyColumn; /* reference to a column - in history matrices */ - utilities_FortranMatrix* lambda; - utilities_FortranMatrix* lambdaHistory; - utilities_FortranMatrix* residualNorms; - utilities_FortranMatrix* residualNormsHistory; - - /* initialization */ - - exitFlag = 0; - *iterationNumber = 0; - noTFlag = operatorT == NULL; - noBFlag = operatorB == NULL; - - sizeY = mv_MultiVectorWidth( blockVectorY ); - noYFlag = sizeY == 0; - - sizeX = mv_MultiVectorWidth( blockVectorX ); - - lambda = utilities_FortranMatrixCreate(); - utilities_FortranMatrixWrap(lambda_values, sizeX, sizeX, 1, lambda); - -/* prepare to process eigenvalues history, if user has provided non-NULL as "lambdaHistory_values" a -rgument */ - if (lambdaHistory_values!=NULL) - { + hypre_longint n; /* dimension 1 of X */ + /* had to remove because n is not available in some interfaces */ +#endif + + mv_MultiVectorPtr blockVectorR; /* residuals */ + mv_MultiVectorPtr blockVectorP; /* conjugate directions */ + + mv_MultiVectorPtr blockVectorW; /* auxiliary block vector */ + + mv_MultiVectorPtr blockVectorAX; /* A*X */ + mv_MultiVectorPtr blockVectorAR; /* A*R */ + mv_MultiVectorPtr blockVectorAP; /* A*P */ + + mv_MultiVectorPtr blockVectorBX; /* B*X */ + mv_MultiVectorPtr blockVectorBR; /* B*R */ + mv_MultiVectorPtr blockVectorBP; /* B*P */ + + mv_MultiVectorPtr blockVectorBY = NULL; /* B*Y */ + + utilities_FortranMatrix* gramA; /* Gram matrix for A */ + utilities_FortranMatrix* gramB; /* Gram matrix for B */ + utilities_FortranMatrix* lambdaAB; /* eigenvalues of + gramA u = lambda gram B u */ + utilities_FortranMatrix* lambdaX; /* first sizeX eigenvalues in + lambdaAB (ref) */ + + utilities_FortranMatrix* gramXAX; /* XX block of gramA (ref) */ + utilities_FortranMatrix* gramRAX; /* XR block of gramA (ref) */ + utilities_FortranMatrix* gramPAX; /* XP block of gramA (ref) */ + + utilities_FortranMatrix* gramRAR; /* RR block of gramA (ref) */ + utilities_FortranMatrix* gramPAR; /* RP block of gramA (ref) */ + + utilities_FortranMatrix* gramPAP; /* PP block of gramA (ref) */ + + utilities_FortranMatrix* gramXBX; /* XX block of gramB (ref) */ + utilities_FortranMatrix* gramRBX; /* XR block of gramB (ref) */ + utilities_FortranMatrix* gramPBX; /* XP block of gramB (ref) */ + + utilities_FortranMatrix* gramRBR; /* RR block of gramB (ref) */ + utilities_FortranMatrix* gramPBR; /* RP block of gramB (ref) */ + + utilities_FortranMatrix* gramPBP; /* PP block of gramB (ref) */ + + utilities_FortranMatrix* gramYBY; /* Matrices for constraints */ + utilities_FortranMatrix* gramYBX; + utilities_FortranMatrix* tempYBX; + utilities_FortranMatrix* gramYBR; /* ref. */ + utilities_FortranMatrix* tempYBR; /* ref. */ + + utilities_FortranMatrix* coordX; /* coordinates of the first sizeX + Ritz vectors in the XRP basis */ + utilities_FortranMatrix* coordXX; /* coordinates of the above in X */ + utilities_FortranMatrix* coordRX; /* coordinates of the above in R */ + utilities_FortranMatrix* coordPX; /* coordinates of the above in P */ + + utilities_FortranMatrix* upperR; /* R factor in QR-fact. (ref) */ + utilities_FortranMatrix* historyColumn; /* reference to a column + in history matrices */ + utilities_FortranMatrix* lambda; + utilities_FortranMatrix* lambdaHistory; + utilities_FortranMatrix* residualNorms; + utilities_FortranMatrix* residualNormsHistory; + + /* initialization */ + + exitFlag = 0; + *iterationNumber = 0; + noTFlag = operatorT == NULL; + noBFlag = operatorB == NULL; + + sizeY = mv_MultiVectorWidth( blockVectorY ); + noYFlag = sizeY == 0; + + sizeX = mv_MultiVectorWidth( blockVectorX ); + + lambda = utilities_FortranMatrixCreate(); + utilities_FortranMatrixWrap(lambda_values, sizeX, sizeX, 1, lambda); + + /* prepare to process eigenvalues history, if user has provided non-NULL as "lambdaHistory_values" a + rgument */ + if (lambdaHistory_values != NULL) + { lambdaHistory = utilities_FortranMatrixCreate(); utilities_FortranMatrixWrap(lambdaHistory_values, lambdaHistory_gh, sizeX, - maxIterations+1, lambdaHistory); - } - else + maxIterations + 1, lambdaHistory); + } + else + { lambdaHistory = NULL; + } - residualNorms = utilities_FortranMatrixCreate(); - utilities_FortranMatrixWrap(residualNorms_values, sizeX, sizeX, 1, residualNorms); + residualNorms = utilities_FortranMatrixCreate(); + utilities_FortranMatrixWrap(residualNorms_values, sizeX, sizeX, 1, residualNorms); -/* prepare to process residuals history, if user has provided non-NULL as "residualNormsHistory_valu -es" argument */ - if (residualNormsHistory_values!=NULL) - { + /* prepare to process residuals history, if user has provided non-NULL as "residualNormsHistory_valu + es" argument */ + if (residualNormsHistory_values != NULL) + { residualNormsHistory = utilities_FortranMatrixCreate(); utilities_FortranMatrixWrap(residualNormsHistory_values, residualNormsHistory_gh, - sizeX, maxIterations+1,residualNormsHistory); - } - else + sizeX, maxIterations + 1, residualNormsHistory); + } + else + { residualNormsHistory = NULL; + } #if 0 - /* had to remove because n is not available in some interfaces */ - n = mv_MultiVectorHeight( blockVectorX ); - - if ( n < 5*sizeX ) { - exitFlag = PROBLEM_SIZE_TOO_SMALL; - lobpcg_errorMessage( verbosityLevel, - "Problem size too small compared to block size\n" ); - return exitFlag; - } + /* had to remove because n is not available in some interfaces */ + n = mv_MultiVectorHeight( blockVectorX ); + + if ( n < 5 * sizeX ) + { + exitFlag = PROBLEM_SIZE_TOO_SMALL; + lobpcg_errorMessage( verbosityLevel, + "Problem size too small compared to block size\n" ); + return exitFlag; + } #endif - - if ( sizeX < 1 ) { - exitFlag = WRONG_BLOCK_SIZE; - lobpcg_errorMessage( verbosityLevel, - "The bloc size is wrong.\n" ); - return exitFlag; - } - - gramYBY = utilities_FortranMatrixCreate(); - gramYBX = utilities_FortranMatrixCreate(); - tempYBX = utilities_FortranMatrixCreate(); - gramYBR = utilities_FortranMatrixCreate(); - tempYBR = utilities_FortranMatrixCreate(); - - blockVectorW = mv_MultiVectorCreateCopy( blockVectorX, 0 ); - - if ( !noYFlag ) { - utilities_FortranMatrixAllocateData( sizeY, sizeY, gramYBY ); - utilities_FortranMatrixAllocateData( sizeY, sizeX, gramYBX ); - utilities_FortranMatrixAllocateData( sizeY, sizeX, tempYBX ); - blockVectorBY = blockVectorY; - if ( !noBFlag ) { - blockVectorBY = mv_MultiVectorCreateCopy( blockVectorY, 0 ); - operatorB( operatorBData, mv_MultiVectorGetData(blockVectorY), - mv_MultiVectorGetData(blockVectorBY) ); - }; - - lobpcg_MultiVectorByMultiVector( blockVectorBY, blockVectorY, gramYBY ); - exitFlag = lobpcg_chol( gramYBY, blap_fn.dpotrf ); - if ( exitFlag != 0 ) { - if ( verbosityLevel ) - hypre_printf("Cannot handle linear dependent constraints\n"); - utilities_FortranMatrixDestroy( gramYBY ); - utilities_FortranMatrixDestroy( gramYBX ); - utilities_FortranMatrixDestroy( tempYBX ); - utilities_FortranMatrixDestroy( gramYBR ); - utilities_FortranMatrixDestroy( tempYBR ); + + if ( sizeX < 1 ) + { + exitFlag = WRONG_BLOCK_SIZE; + lobpcg_errorMessage( verbosityLevel, + "The bloc size is wrong.\n" ); + return exitFlag; + } + + gramYBY = utilities_FortranMatrixCreate(); + gramYBX = utilities_FortranMatrixCreate(); + tempYBX = utilities_FortranMatrixCreate(); + gramYBR = utilities_FortranMatrixCreate(); + tempYBR = utilities_FortranMatrixCreate(); + + blockVectorW = mv_MultiVectorCreateCopy( blockVectorX, 0 ); + + if ( !noYFlag ) + { + utilities_FortranMatrixAllocateData( sizeY, sizeY, gramYBY ); + utilities_FortranMatrixAllocateData( sizeY, sizeX, gramYBX ); + utilities_FortranMatrixAllocateData( sizeY, sizeX, tempYBX ); + blockVectorBY = blockVectorY; if ( !noBFlag ) - mv_MultiVectorDestroy( blockVectorBY ); - mv_MultiVectorDestroy( blockVectorW ); - return WRONG_CONSTRAINTS; - } - utilities_FortranMatrixUpperInv( gramYBY ); - utilities_FortranMatrixClearL( gramYBY ); - - /* apply the constraints to the initial X */ - lobpcg_MultiVectorByMultiVector( blockVectorBY, blockVectorX, gramYBX ); - utilities_FortranMatrixMultiply( gramYBY, 1, gramYBX, 0, tempYBX ); - utilities_FortranMatrixMultiply( gramYBY, 0, tempYBX, 0, gramYBX ); - lobpcg_MultiVectorByMatrix( blockVectorY, gramYBX, blockVectorW ); - mv_MultiVectorAxpy( -1.0, blockVectorW, blockVectorX ); - } - - if ( verbosityLevel ) { - hypre_printf("\nSolving "); - if ( noBFlag ) - hypre_printf("standard"); - else - hypre_printf("generalized"); - hypre_printf(" eigenvalue problem with"); - if ( noTFlag ) - hypre_printf("out"); - hypre_printf(" preconditioning\n\n"); - hypre_printf("block size %d\n\n", sizeX ); - if ( noYFlag ) - hypre_printf("No constraints\n\n"); - else { - if ( sizeY > 1 ) - hypre_printf("%d constraints\n\n", sizeY); + { + blockVectorBY = mv_MultiVectorCreateCopy( blockVectorY, 0 ); + operatorB( operatorBData, mv_MultiVectorGetData(blockVectorY), + mv_MultiVectorGetData(blockVectorBY) ); + }; + + lobpcg_MultiVectorByMultiVector( blockVectorBY, blockVectorY, gramYBY ); + exitFlag = lobpcg_chol( gramYBY, blap_fn.dpotrf ); + if ( exitFlag != 0 ) + { + if ( verbosityLevel ) + { + hypre_printf("Cannot handle linear dependent constraints\n"); + } + utilities_FortranMatrixDestroy( gramYBY ); + utilities_FortranMatrixDestroy( gramYBX ); + utilities_FortranMatrixDestroy( tempYBX ); + utilities_FortranMatrixDestroy( gramYBR ); + utilities_FortranMatrixDestroy( tempYBR ); + if ( !noBFlag ) + { + mv_MultiVectorDestroy( blockVectorBY ); + } + mv_MultiVectorDestroy( blockVectorW ); + return WRONG_CONSTRAINTS; + } + utilities_FortranMatrixUpperInv( gramYBY ); + utilities_FortranMatrixClearL( gramYBY ); + + /* apply the constraints to the initial X */ + lobpcg_MultiVectorByMultiVector( blockVectorBY, blockVectorX, gramYBX ); + utilities_FortranMatrixMultiply( gramYBY, 1, gramYBX, 0, tempYBX ); + utilities_FortranMatrixMultiply( gramYBY, 0, tempYBX, 0, gramYBX ); + lobpcg_MultiVectorByMatrix( blockVectorY, gramYBX, blockVectorW ); + mv_MultiVectorAxpy( -1.0, blockVectorW, blockVectorX ); + } + + if ( verbosityLevel ) + { + hypre_printf("\nSolving "); + if ( noBFlag ) + { + hypre_printf("standard"); + } + else + { + hypre_printf("generalized"); + } + hypre_printf(" eigenvalue problem with"); + if ( noTFlag ) + { + hypre_printf("out"); + } + hypre_printf(" preconditioning\n\n"); + hypre_printf("block size %d\n\n", sizeX ); + if ( noYFlag ) + { + hypre_printf("No constraints\n\n"); + } else - hypre_printf("%d constraint\n\n", sizeY); - } - } - - /* creating fortran matrix shells */ - - gramA = utilities_FortranMatrixCreate(); - gramB = utilities_FortranMatrixCreate(); - lambdaAB = utilities_FortranMatrixCreate(); - lambdaX = utilities_FortranMatrixCreate(); - - gramXAX = utilities_FortranMatrixCreate(); - gramRAX = utilities_FortranMatrixCreate(); - gramPAX = utilities_FortranMatrixCreate(); - - gramRAR = utilities_FortranMatrixCreate(); - gramPAR = utilities_FortranMatrixCreate(); - - gramPAP = utilities_FortranMatrixCreate(); - - gramXBX = utilities_FortranMatrixCreate(); - gramRBX = utilities_FortranMatrixCreate(); - gramPBX = utilities_FortranMatrixCreate(); - - gramRBR = utilities_FortranMatrixCreate(); - gramPBR = utilities_FortranMatrixCreate(); - - gramPBP = utilities_FortranMatrixCreate(); - - coordX = utilities_FortranMatrixCreate(); - coordXX = utilities_FortranMatrixCreate(); - coordRX = utilities_FortranMatrixCreate(); - coordPX = utilities_FortranMatrixCreate(); - - upperR = utilities_FortranMatrixCreate(); - historyColumn = utilities_FortranMatrixCreate(); - - /* initializing soft locking mask */ - activeMask = hypre_CTAlloc(HYPRE_Int, sizeX, HYPRE_MEMORY_HOST); - hypre_assert( activeMask != NULL ); - for ( i = 0; i < sizeX; i++ ) - activeMask[i] = 1; - - /* allocate memory for Gram matrices and the Ritz values */ - sizeX3 = 3*sizeX; - utilities_FortranMatrixAllocateData( sizeX3, sizeX3, gramA ); - utilities_FortranMatrixAllocateData( sizeX3, sizeX3, gramB ); - utilities_FortranMatrixAllocateData( sizeX3, 1, lambdaAB ); - - /* creating block vectors R, P, AX, AR, AP, BX, BR, BP and W */ - blockVectorR = mv_MultiVectorCreateCopy( blockVectorX, 0 ); - blockVectorP = mv_MultiVectorCreateCopy( blockVectorX, 0 ); - blockVectorAX = mv_MultiVectorCreateCopy( blockVectorX, 0 ); - blockVectorAR = mv_MultiVectorCreateCopy( blockVectorX, 0 ); - blockVectorAP = mv_MultiVectorCreateCopy( blockVectorX, 0 ); - - if ( !noBFlag ) { - blockVectorBX = mv_MultiVectorCreateCopy( blockVectorX, 0 ); - blockVectorBR = mv_MultiVectorCreateCopy( blockVectorX, 0 ); - blockVectorBP = mv_MultiVectorCreateCopy( blockVectorX, 0 ); - } - else { - blockVectorBX = blockVectorX; - blockVectorBR = blockVectorR; - blockVectorBP = blockVectorP; - } - - mv_MultiVectorSetMask( blockVectorR, activeMask ); - mv_MultiVectorSetMask( blockVectorP, activeMask ); - mv_MultiVectorSetMask( blockVectorAR, activeMask ); - mv_MultiVectorSetMask( blockVectorAP, activeMask ); - if ( !noBFlag ) { - mv_MultiVectorSetMask( blockVectorBR, activeMask ); - mv_MultiVectorSetMask( blockVectorBP, activeMask ); - } - mv_MultiVectorSetMask( blockVectorW, activeMask ); - - /* B-orthonormaliization of X */ - /* selecting a block in gramB for R factor upperR */ - utilities_FortranMatrixSelectBlock( gramB, 1, sizeX, 1, sizeX, upperR ); - if ( !noBFlag ) { - operatorB( operatorBData, mv_MultiVectorGetData(blockVectorX), - mv_MultiVectorGetData(blockVectorBX) ); - } - exitFlag = lobpcg_MultiVectorImplicitQR( blockVectorX, blockVectorBX, - upperR, blockVectorW,blap_fn.dpotrf ); - if ( exitFlag ) { - lobpcg_errorMessage( verbosityLevel, "Bad initial vectors: orthonormalization failed\n" ); - if ( verbosityLevel ) - hypre_printf("DPOTRF INFO = %d\n", exitFlag); - } - else { - - if ( !noBFlag ) { /* update BX */ - lobpcg_MultiVectorByMatrix( blockVectorBX, upperR, blockVectorW ); - mv_MultiVectorCopy( blockVectorW, blockVectorBX ); - } - - operatorA( operatorAData, mv_MultiVectorGetData(blockVectorX), - mv_MultiVectorGetData(blockVectorAX) ); - - /* gramXAX = X'*AX */ - utilities_FortranMatrixSelectBlock( gramA, 1, sizeX, 1, sizeX, gramXAX ); - lobpcg_MultiVectorByMultiVector( blockVectorX, blockVectorAX, gramXAX ); - utilities_FortranMatrixSymmetrize( gramXAX ); - - /* gramXBX = X'*X */ - utilities_FortranMatrixSelectBlock( gramB, 1, sizeX, 1, sizeX, gramXBX ); - lobpcg_MultiVectorByMultiVector( blockVectorX, blockVectorBX, gramXBX ); - utilities_FortranMatrixSymmetrize( gramXBX ); - /* utilities_FortranMatrixSetToIdentity( gramXBX );*/ /* X may be bad! */ - - if ( (exitFlag = lobpcg_solveGEVP( gramXAX, gramXBX, lambda,blap_fn.dsygv)) != 0 ) { - lobpcg_errorMessage( verbosityLevel, - "Bad problem: Rayleigh-Ritz in the initial subspace failed\n" ); + { + if ( sizeY > 1 ) + { + hypre_printf("%d constraints\n\n", sizeY); + } + else + { + hypre_printf("%d constraint\n\n", sizeY); + } + } + } + + /* creating fortran matrix shells */ + + gramA = utilities_FortranMatrixCreate(); + gramB = utilities_FortranMatrixCreate(); + lambdaAB = utilities_FortranMatrixCreate(); + lambdaX = utilities_FortranMatrixCreate(); + + gramXAX = utilities_FortranMatrixCreate(); + gramRAX = utilities_FortranMatrixCreate(); + gramPAX = utilities_FortranMatrixCreate(); + + gramRAR = utilities_FortranMatrixCreate(); + gramPAR = utilities_FortranMatrixCreate(); + + gramPAP = utilities_FortranMatrixCreate(); + + gramXBX = utilities_FortranMatrixCreate(); + gramRBX = utilities_FortranMatrixCreate(); + gramPBX = utilities_FortranMatrixCreate(); + + gramRBR = utilities_FortranMatrixCreate(); + gramPBR = utilities_FortranMatrixCreate(); + + gramPBP = utilities_FortranMatrixCreate(); + + coordX = utilities_FortranMatrixCreate(); + coordXX = utilities_FortranMatrixCreate(); + coordRX = utilities_FortranMatrixCreate(); + coordPX = utilities_FortranMatrixCreate(); + + upperR = utilities_FortranMatrixCreate(); + historyColumn = utilities_FortranMatrixCreate(); + + /* initializing soft locking mask */ + activeMask = hypre_CTAlloc(HYPRE_Int, sizeX, HYPRE_MEMORY_HOST); + hypre_assert( activeMask != NULL ); + for ( i = 0; i < sizeX; i++ ) + { + activeMask[i] = 1; + } + + /* allocate memory for Gram matrices and the Ritz values */ + sizeX3 = 3 * sizeX; + utilities_FortranMatrixAllocateData( sizeX3, sizeX3, gramA ); + utilities_FortranMatrixAllocateData( sizeX3, sizeX3, gramB ); + utilities_FortranMatrixAllocateData( sizeX3, 1, lambdaAB ); + + /* creating block vectors R, P, AX, AR, AP, BX, BR, BP and W */ + blockVectorR = mv_MultiVectorCreateCopy( blockVectorX, 0 ); + blockVectorP = mv_MultiVectorCreateCopy( blockVectorX, 0 ); + blockVectorAX = mv_MultiVectorCreateCopy( blockVectorX, 0 ); + blockVectorAR = mv_MultiVectorCreateCopy( blockVectorX, 0 ); + blockVectorAP = mv_MultiVectorCreateCopy( blockVectorX, 0 ); + + if ( !noBFlag ) + { + blockVectorBX = mv_MultiVectorCreateCopy( blockVectorX, 0 ); + blockVectorBR = mv_MultiVectorCreateCopy( blockVectorX, 0 ); + blockVectorBP = mv_MultiVectorCreateCopy( blockVectorX, 0 ); + } + else + { + blockVectorBX = blockVectorX; + blockVectorBR = blockVectorR; + blockVectorBP = blockVectorP; + } + + mv_MultiVectorSetMask( blockVectorR, activeMask ); + mv_MultiVectorSetMask( blockVectorP, activeMask ); + mv_MultiVectorSetMask( blockVectorAR, activeMask ); + mv_MultiVectorSetMask( blockVectorAP, activeMask ); + if ( !noBFlag ) + { + mv_MultiVectorSetMask( blockVectorBR, activeMask ); + mv_MultiVectorSetMask( blockVectorBP, activeMask ); + } + mv_MultiVectorSetMask( blockVectorW, activeMask ); + + /* B-orthonormaliization of X */ + /* selecting a block in gramB for R factor upperR */ + utilities_FortranMatrixSelectBlock( gramB, 1, sizeX, 1, sizeX, upperR ); + if ( !noBFlag ) + { + operatorB( operatorBData, mv_MultiVectorGetData(blockVectorX), + mv_MultiVectorGetData(blockVectorBX) ); + } + exitFlag = lobpcg_MultiVectorImplicitQR( blockVectorX, blockVectorBX, + upperR, blockVectorW, blap_fn.dpotrf ); + if ( exitFlag ) + { + lobpcg_errorMessage( verbosityLevel, "Bad initial vectors: orthonormalization failed\n" ); if ( verbosityLevel ) - hypre_printf("DSYGV INFO = %d\n", exitFlag); - } - else { - utilities_FortranMatrixSelectBlock( gramXAX, 1, sizeX, 1, sizeX, coordX ); + { + hypre_printf("DPOTRF INFO = %d\n", exitFlag); + } + } + else + { + + if ( !noBFlag ) /* update BX */ + { + lobpcg_MultiVectorByMatrix( blockVectorBX, upperR, blockVectorW ); + mv_MultiVectorCopy( blockVectorW, blockVectorBX ); + } - lobpcg_MultiVectorByMatrix( blockVectorX, coordX, blockVectorW ); - mv_MultiVectorCopy( blockVectorW, blockVectorX ); + operatorA( operatorAData, mv_MultiVectorGetData(blockVectorX), + mv_MultiVectorGetData(blockVectorAX) ); + + /* gramXAX = X'*AX */ + utilities_FortranMatrixSelectBlock( gramA, 1, sizeX, 1, sizeX, gramXAX ); + lobpcg_MultiVectorByMultiVector( blockVectorX, blockVectorAX, gramXAX ); + utilities_FortranMatrixSymmetrize( gramXAX ); + + /* gramXBX = X'*X */ + utilities_FortranMatrixSelectBlock( gramB, 1, sizeX, 1, sizeX, gramXBX ); + lobpcg_MultiVectorByMultiVector( blockVectorX, blockVectorBX, gramXBX ); + utilities_FortranMatrixSymmetrize( gramXBX ); + /* utilities_FortranMatrixSetToIdentity( gramXBX );*/ /* X may be bad! */ + + if ( (exitFlag = lobpcg_solveGEVP( gramXAX, gramXBX, lambda, blap_fn.dsygv)) != 0 ) + { + lobpcg_errorMessage( verbosityLevel, + "Bad problem: Rayleigh-Ritz in the initial subspace failed\n" ); + if ( verbosityLevel ) + { + hypre_printf("DSYGV INFO = %d\n", exitFlag); + } + } + else + { + utilities_FortranMatrixSelectBlock( gramXAX, 1, sizeX, 1, sizeX, coordX ); + + lobpcg_MultiVectorByMatrix( blockVectorX, coordX, blockVectorW ); + mv_MultiVectorCopy( blockVectorW, blockVectorX ); + + lobpcg_MultiVectorByMatrix( blockVectorAX, coordX, blockVectorW ); + mv_MultiVectorCopy( blockVectorW, blockVectorAX ); + + if ( !noBFlag ) + { + lobpcg_MultiVectorByMatrix( blockVectorBX, coordX, blockVectorW ); + mv_MultiVectorCopy( blockVectorW, blockVectorBX ); + } + + /* + lobpcg_MultiVectorByMultiVector( blockVectorBX, blockVectorX, upperR ); + utilities_FortranMatrixPrint( upperR, "xbx.dat" ); + utilities_FortranMatrixPrint( lambda, "lmd.dat" ); + */ + + mv_MultiVectorByDiagonal( blockVectorBX, + NULL, sizeX, + utilities_FortranMatrixValues( lambda ), + blockVectorR ); + + mv_MultiVectorAxpy( -1.0, blockVectorAX, blockVectorR ); + + mv_MultiVectorByMultiVectorDiag( blockVectorR, blockVectorR, + NULL, sizeX, + utilities_FortranMatrixValues( residualNorms ) ); + + lobpcg_sqrtVector( sizeX, NULL, + utilities_FortranMatrixValues( residualNorms ) ); + + if ( lambdaHistory != NULL ) + { + utilities_FortranMatrixSelectBlock( lambdaHistory, 1, sizeX, 1, 1, + historyColumn ); + utilities_FortranMatrixCopy( lambda, 0, historyColumn ); + } + + if ( residualNormsHistory != NULL ) + { + utilities_FortranMatrixSelectBlock( residualNormsHistory, 1, sizeX, 1, 1, + historyColumn ); + utilities_FortranMatrixCopy( residualNorms, 0, historyColumn ); + } + + if ( verbosityLevel == 2 ) + { + hypre_printf("\n"); + for (i = 1; i <= sizeX; i++ ) + hypre_printf("Initial eigenvalues lambda %22.14e\n", + utilities_FortranMatrixValue( lambda, i, 1) ); + for (i = 1; i <= sizeX; i++) + hypre_printf("Initial residuals %12.6e\n", + utilities_FortranMatrixValue( residualNorms, i, 1) ); + } + else if ( verbosityLevel == 1 ) + hypre_printf("\nInitial Max. Residual %22.14e\n", + utilities_FortranMatrixMaxValue( residualNorms ) ); + } + } - lobpcg_MultiVectorByMatrix( blockVectorAX, coordX, blockVectorW ); - mv_MultiVectorCopy( blockVectorW, blockVectorAX ); + for ( *iterationNumber = 1; exitFlag == 0 && *iterationNumber <= maxIterations; + (*iterationNumber)++ ) + { - if ( !noBFlag ) { - lobpcg_MultiVectorByMatrix( blockVectorBX, coordX, blockVectorW ); - mv_MultiVectorCopy( blockVectorW, blockVectorBX ); + sizeR = lobpcg_checkResiduals( residualNorms, lambda, tolerance, + activeMask ); + if ( sizeR < 1 ) + { + break; } - /* - lobpcg_MultiVectorByMultiVector( blockVectorBX, blockVectorX, upperR ); - utilities_FortranMatrixPrint( upperR, "xbx.dat" ); - utilities_FortranMatrixPrint( lambda, "lmd.dat" ); - */ + /* following code added by Ilya Lashuk on March 22, 2005; with current + multivector implementation mask needs to be reset after it has changed on each vector + mask applies to */ - mv_MultiVectorByDiagonal( blockVectorBX, - NULL, sizeX, - utilities_FortranMatrixValues( lambda ), - blockVectorR ); + mv_MultiVectorSetMask( blockVectorR, activeMask ); + mv_MultiVectorSetMask( blockVectorP, activeMask ); + mv_MultiVectorSetMask( blockVectorAR, activeMask ); + mv_MultiVectorSetMask( blockVectorAP, activeMask ); + if ( !noBFlag ) + { + mv_MultiVectorSetMask( blockVectorBR, activeMask ); + mv_MultiVectorSetMask( blockVectorBP, activeMask ); + } + mv_MultiVectorSetMask( blockVectorW, activeMask ); - mv_MultiVectorAxpy( -1.0, blockVectorAX, blockVectorR ); + /* ***** end of added code ***** */ - mv_MultiVectorByMultiVectorDiag( blockVectorR, blockVectorR, - NULL, sizeX, - utilities_FortranMatrixValues( residualNorms ) ); + if ( !noTFlag ) + { + operatorT( operatorTData, mv_MultiVectorGetData(blockVectorR), + mv_MultiVectorGetData(blockVectorW) ); + mv_MultiVectorCopy( blockVectorW, blockVectorR ); + } - lobpcg_sqrtVector( sizeX, NULL, - utilities_FortranMatrixValues( residualNorms ) ); + if ( !noYFlag ) /* apply the constraints to R */ + { + utilities_FortranMatrixSelectBlock( gramYBX, 1, sizeY, 1, sizeR, gramYBR ); + utilities_FortranMatrixSelectBlock( tempYBX, 1, sizeY, 1, sizeR, tempYBR ); - if ( lambdaHistory != NULL ) { - utilities_FortranMatrixSelectBlock( lambdaHistory, 1, sizeX, 1, 1, - historyColumn ); - utilities_FortranMatrixCopy( lambda, 0, historyColumn ); + lobpcg_MultiVectorByMultiVector( blockVectorBY, blockVectorR, gramYBR ); + utilities_FortranMatrixMultiply( gramYBY, 1, gramYBR, 0, tempYBR ); + utilities_FortranMatrixMultiply( gramYBY, 0, tempYBR, 0, gramYBR ); + lobpcg_MultiVectorByMatrix( blockVectorY, gramYBR, blockVectorW ); + mv_MultiVectorAxpy( -1.0, blockVectorW, blockVectorR ); } - - if ( residualNormsHistory != NULL ) { - utilities_FortranMatrixSelectBlock( residualNormsHistory, 1, sizeX, 1, 1, - historyColumn ); - utilities_FortranMatrixCopy( residualNorms, 0, historyColumn ); + + firstR = sizeX + 1; + lastR = sizeX + sizeR; + firstP = lastR + 1; + + utilities_FortranMatrixSelectBlock( gramB, firstR, lastR, firstR, lastR, upperR ); + + if ( !noBFlag ) + { + operatorB( operatorBData, mv_MultiVectorGetData(blockVectorR), + mv_MultiVectorGetData(blockVectorBR) ); } - - if ( verbosityLevel == 2 ) { - hypre_printf("\n"); - for (i = 1; i <= sizeX; i++ ) - hypre_printf("Initial eigenvalues lambda %22.14e\n", - utilities_FortranMatrixValue( lambda, i, 1) ); - for (i = 1; i <= sizeX; i++) - hypre_printf("Initial residuals %12.6e\n", - utilities_FortranMatrixValue( residualNorms, i, 1) ); + exitFlag = lobpcg_MultiVectorImplicitQR( blockVectorR, blockVectorBR, + upperR, blockVectorW, blap_fn.dpotrf ); + if ( exitFlag ) + { + lobpcg_errorMessage( verbosityLevel, "Orthonormalization of residuals failed\n" ); + if ( verbosityLevel ) + { + hypre_printf("DPOTRF INFO = %d\n", exitFlag); + } + break; } - else if ( verbosityLevel == 1 ) - hypre_printf("\nInitial Max. Residual %22.14e\n", - utilities_FortranMatrixMaxValue( residualNorms ) ); - } - } - - for ( *iterationNumber = 1; exitFlag == 0 && *iterationNumber <= maxIterations; - (*iterationNumber)++ ) { - - sizeR = lobpcg_checkResiduals( residualNorms, lambda, tolerance, - activeMask ); - if ( sizeR < 1 ) - break; - -/* following code added by Ilya Lashuk on March 22, 2005; with current - multivector implementation mask needs to be reset after it has changed on each vector - mask applies to */ - - mv_MultiVectorSetMask( blockVectorR, activeMask ); - mv_MultiVectorSetMask( blockVectorP, activeMask ); - mv_MultiVectorSetMask( blockVectorAR, activeMask ); - mv_MultiVectorSetMask( blockVectorAP, activeMask ); - if ( !noBFlag ) { - mv_MultiVectorSetMask( blockVectorBR, activeMask ); - mv_MultiVectorSetMask( blockVectorBP, activeMask ); - } - mv_MultiVectorSetMask( blockVectorW, activeMask ); - -/* ***** end of added code ***** */ - - if ( !noTFlag ) { - operatorT( operatorTData, mv_MultiVectorGetData(blockVectorR), - mv_MultiVectorGetData(blockVectorW) ); - mv_MultiVectorCopy( blockVectorW, blockVectorR ); - } - - if ( !noYFlag ) { /* apply the constraints to R */ - utilities_FortranMatrixSelectBlock( gramYBX, 1, sizeY, 1, sizeR, gramYBR ); - utilities_FortranMatrixSelectBlock( tempYBX, 1, sizeY, 1, sizeR, tempYBR ); - - lobpcg_MultiVectorByMultiVector( blockVectorBY, blockVectorR, gramYBR ); - utilities_FortranMatrixMultiply( gramYBY, 1, gramYBR, 0, tempYBR ); - utilities_FortranMatrixMultiply( gramYBY, 0, tempYBR, 0, gramYBR ); - lobpcg_MultiVectorByMatrix( blockVectorY, gramYBR, blockVectorW ); - mv_MultiVectorAxpy( -1.0, blockVectorW, blockVectorR ); - } - - firstR = sizeX + 1; - lastR = sizeX + sizeR; - firstP = lastR + 1; - - utilities_FortranMatrixSelectBlock( gramB, firstR, lastR, firstR, lastR, upperR ); - - if ( !noBFlag ) { - operatorB( operatorBData, mv_MultiVectorGetData(blockVectorR), - mv_MultiVectorGetData(blockVectorBR) ); - } - exitFlag = lobpcg_MultiVectorImplicitQR( blockVectorR, blockVectorBR, - upperR, blockVectorW,blap_fn.dpotrf ); - if ( exitFlag ) { - lobpcg_errorMessage( verbosityLevel, "Orthonormalization of residuals failed\n" ); - if ( verbosityLevel ) - hypre_printf("DPOTRF INFO = %d\n", exitFlag); - break; - } - - if ( !noBFlag ) { /* update BR */ - lobpcg_MultiVectorByMatrix( blockVectorBR, upperR, blockVectorW ); - mv_MultiVectorCopy( blockVectorW, blockVectorBR ); - } - - /* AR = A*R */ - operatorA( operatorAData, mv_MultiVectorGetData(blockVectorR), - mv_MultiVectorGetData(blockVectorAR) ); - - if ( *iterationNumber > 1 ) { - - sizeP = sizeR; - lastP = lastR + sizeP; - - utilities_FortranMatrixSelectBlock( gramB, firstP, lastP, firstP, lastP, upperR ); - - exitFlag = lobpcg_MultiVectorImplicitQR( blockVectorP, blockVectorBP, - upperR, blockVectorW,blap_fn.dpotrf ); - if ( exitFlag ) { - /* - lobpcg_errorMessage( verbosityLevel, "Orthonormalization of P failed\n" ); - if ( verbosityLevel ) - hypre_printf("DPOTRF INFO = %d\n", exitFlag); - */ - sizeP = 0; + + if ( !noBFlag ) /* update BR */ + { + lobpcg_MultiVectorByMatrix( blockVectorBR, upperR, blockVectorW ); + mv_MultiVectorCopy( blockVectorW, blockVectorBR ); + } + + /* AR = A*R */ + operatorA( operatorAData, mv_MultiVectorGetData(blockVectorR), + mv_MultiVectorGetData(blockVectorAR) ); + + if ( *iterationNumber > 1 ) + { + + sizeP = sizeR; + lastP = lastR + sizeP; + + utilities_FortranMatrixSelectBlock( gramB, firstP, lastP, firstP, lastP, upperR ); + + exitFlag = lobpcg_MultiVectorImplicitQR( blockVectorP, blockVectorBP, + upperR, blockVectorW, blap_fn.dpotrf ); + if ( exitFlag ) + { + /* + lobpcg_errorMessage( verbosityLevel, "Orthonormalization of P failed\n" ); + if ( verbosityLevel ) + hypre_printf("DPOTRF INFO = %d\n", exitFlag); + */ + sizeP = 0; + } + else + { + + if ( !noBFlag ) /* update BP */ + { + lobpcg_MultiVectorByMatrix( blockVectorBP, upperR, blockVectorW ); + mv_MultiVectorCopy( blockVectorW, blockVectorBP ); + } + + /* update AP */ + lobpcg_MultiVectorByMatrix( blockVectorAP, upperR, blockVectorW ); + mv_MultiVectorCopy( blockVectorW, blockVectorAP ); + } + } + else + { + + sizeP = 0; + lastP = lastR; + } + + sizeA = lastR + sizeP; + + utilities_FortranMatrixSelectBlock( gramA, 1, sizeX, 1, sizeX, gramXAX ); + utilities_FortranMatrixSelectBlock( gramA, firstR, lastR, 1, sizeX, + gramRAX ); + utilities_FortranMatrixSelectBlock( gramA, firstR, lastR, firstR, lastR, + gramRAR ); + + utilities_FortranMatrixSelectBlock( gramB, 1, sizeX, 1, sizeX, gramXBX ); + utilities_FortranMatrixSelectBlock( gramB, firstR, lastR, 1, sizeX, + gramRBX ); + utilities_FortranMatrixSelectBlock( gramB, firstR, lastR, firstR, lastR, + gramRBR ); + + utilities_FortranMatrixClear( gramXAX ); + utilities_FortranMatrixSetDiagonal( gramXAX, lambda ); + + lobpcg_MultiVectorByMultiVector( blockVectorR, blockVectorAX, gramRAX ); + + lobpcg_MultiVectorByMultiVector( blockVectorR, blockVectorAR, gramRAR ); + utilities_FortranMatrixSymmetrize( gramRAR ); + + utilities_FortranMatrixSetToIdentity( gramXBX ); + + lobpcg_MultiVectorByMultiVector( blockVectorR, blockVectorBX, gramRBX ); + + utilities_FortranMatrixSetToIdentity( gramRBR ); + + if ( *iterationNumber > 1 ) + { + + utilities_FortranMatrixSelectBlock( gramA, firstP, lastP, 1, sizeX, gramPAX ); + utilities_FortranMatrixSelectBlock( gramA, firstP, lastP, firstR, lastR, gramPAR ); + utilities_FortranMatrixSelectBlock( gramA, firstP, lastP, firstP, lastP, gramPAP ); + + utilities_FortranMatrixSelectBlock( gramB, firstP, lastP, 1, sizeX, gramPBX ); + utilities_FortranMatrixSelectBlock( gramB, firstP, lastP, firstR, lastR, gramPBR ); + utilities_FortranMatrixSelectBlock( gramB, firstP, lastP, firstP, lastP, gramPBP ); + + lobpcg_MultiVectorByMultiVector( blockVectorP, blockVectorAX, gramPAX ); + + lobpcg_MultiVectorByMultiVector( blockVectorP, blockVectorAR, gramPAR ); + + lobpcg_MultiVectorByMultiVector( blockVectorP, blockVectorAP, gramPAP ); + utilities_FortranMatrixSymmetrize( gramPAP ); + + lobpcg_MultiVectorByMultiVector( blockVectorP, blockVectorBX, gramPBX ); + + lobpcg_MultiVectorByMultiVector( blockVectorP, blockVectorBR, gramPBR ); + + utilities_FortranMatrixSetToIdentity( gramPBP ); } - else { - - if ( !noBFlag ) { /* update BP */ - lobpcg_MultiVectorByMatrix( blockVectorBP, upperR, blockVectorW ); - mv_MultiVectorCopy( blockVectorW, blockVectorBP ); - } - - /* update AP */ - lobpcg_MultiVectorByMatrix( blockVectorAP, upperR, blockVectorW ); - mv_MultiVectorCopy( blockVectorW, blockVectorAP ); + + utilities_FortranMatrixSelectBlock( gramA, 1, sizeA, 1, sizeA, gramXAX ); + utilities_FortranMatrixSelectBlock( gramB, 1, sizeA, 1, sizeA, gramXBX ); + + if ( (exitFlag = lobpcg_solveGEVP( gramXAX, gramXBX, lambdaAB, blap_fn.dsygv )) != 0 ) + { + lobpcg_errorMessage( verbosityLevel, "GEVP solver failure\n" ); + (*iterationNumber)--; + /* if ( verbosityLevel ) + hypre_printf("INFO = %d\n", exitFlag);*/ + break; } - } - else { - - sizeP = 0; - lastP = lastR; - } - - sizeA = lastR + sizeP; - - utilities_FortranMatrixSelectBlock( gramA, 1, sizeX, 1, sizeX, gramXAX ); - utilities_FortranMatrixSelectBlock( gramA, firstR, lastR, 1, sizeX, - gramRAX ); - utilities_FortranMatrixSelectBlock( gramA, firstR, lastR, firstR, lastR, - gramRAR ); - - utilities_FortranMatrixSelectBlock( gramB, 1, sizeX, 1, sizeX, gramXBX ); - utilities_FortranMatrixSelectBlock( gramB, firstR, lastR, 1, sizeX, - gramRBX ); - utilities_FortranMatrixSelectBlock( gramB, firstR, lastR, firstR, lastR, - gramRBR ); - - utilities_FortranMatrixClear( gramXAX ); - utilities_FortranMatrixSetDiagonal( gramXAX, lambda ); - - lobpcg_MultiVectorByMultiVector( blockVectorR, blockVectorAX, gramRAX ); - - lobpcg_MultiVectorByMultiVector( blockVectorR, blockVectorAR, gramRAR ); - utilities_FortranMatrixSymmetrize( gramRAR ); - - utilities_FortranMatrixSetToIdentity( gramXBX ); - - lobpcg_MultiVectorByMultiVector( blockVectorR, blockVectorBX, gramRBX ); - - utilities_FortranMatrixSetToIdentity( gramRBR ); - - if ( *iterationNumber > 1 ) { - - utilities_FortranMatrixSelectBlock( gramA, firstP, lastP, 1, sizeX, gramPAX ); - utilities_FortranMatrixSelectBlock( gramA, firstP, lastP, firstR, lastR, gramPAR ); - utilities_FortranMatrixSelectBlock( gramA, firstP, lastP, firstP, lastP, gramPAP ); - - utilities_FortranMatrixSelectBlock( gramB, firstP, lastP, 1, sizeX, gramPBX ); - utilities_FortranMatrixSelectBlock( gramB, firstP, lastP, firstR, lastR, gramPBR ); - utilities_FortranMatrixSelectBlock( gramB, firstP, lastP, firstP, lastP, gramPBP ); - - lobpcg_MultiVectorByMultiVector( blockVectorP, blockVectorAX, gramPAX ); - - lobpcg_MultiVectorByMultiVector( blockVectorP, blockVectorAR, gramPAR ); - - lobpcg_MultiVectorByMultiVector( blockVectorP, blockVectorAP, gramPAP ); - utilities_FortranMatrixSymmetrize( gramPAP ); - - lobpcg_MultiVectorByMultiVector( blockVectorP, blockVectorBX, gramPBX ); - - lobpcg_MultiVectorByMultiVector( blockVectorP, blockVectorBR, gramPBR ); - - utilities_FortranMatrixSetToIdentity( gramPBP ); - } - - utilities_FortranMatrixSelectBlock( gramA, 1, sizeA, 1, sizeA, gramXAX ); - utilities_FortranMatrixSelectBlock( gramB, 1, sizeA, 1, sizeA, gramXBX ); - - if ( (exitFlag = lobpcg_solveGEVP( gramXAX, gramXBX, lambdaAB, blap_fn.dsygv )) != 0 ) { - lobpcg_errorMessage( verbosityLevel, "GEVP solver failure\n" ); - (*iterationNumber)--; - /* if ( verbosityLevel ) - hypre_printf("INFO = %d\n", exitFlag);*/ - break; - } - - utilities_FortranMatrixSelectBlock( lambdaAB, 1, sizeX, 1, 1, lambdaX ); - utilities_FortranMatrixCopy( lambdaX, 0, lambda ); - - utilities_FortranMatrixSelectBlock( gramA, 1, sizeA, 1, sizeX, coordX ); - - utilities_FortranMatrixSelectBlock( coordX, 1, sizeX, 1, sizeX, coordXX ); - utilities_FortranMatrixSelectBlock( coordX, firstR, lastR, 1, sizeX, coordRX ); - - if ( *iterationNumber > 1 ) { - - utilities_FortranMatrixSelectBlock( coordX, firstP, lastP, 1, sizeX, coordPX ); + utilities_FortranMatrixSelectBlock( lambdaAB, 1, sizeX, 1, 1, lambdaX ); + utilities_FortranMatrixCopy( lambdaX, 0, lambda ); + + utilities_FortranMatrixSelectBlock( gramA, 1, sizeA, 1, sizeX, coordX ); + + utilities_FortranMatrixSelectBlock( coordX, 1, sizeX, 1, sizeX, coordXX ); + utilities_FortranMatrixSelectBlock( coordX, firstR, lastR, 1, sizeX, coordRX ); + + if ( *iterationNumber > 1 ) + { + + utilities_FortranMatrixSelectBlock( coordX, firstP, lastP, 1, sizeX, coordPX ); + + mv_MultiVectorSetMask( blockVectorW, NULL ); + lobpcg_MultiVectorByMatrix( blockVectorP, coordPX, blockVectorW ); + mv_MultiVectorSetMask( blockVectorP, NULL ); + mv_MultiVectorCopy( blockVectorW, blockVectorP ); + + lobpcg_MultiVectorByMatrix( blockVectorAP, coordPX, blockVectorW ); + mv_MultiVectorSetMask( blockVectorAP, NULL ); + mv_MultiVectorCopy( blockVectorW, blockVectorAP ); + + if ( !noBFlag ) + { + lobpcg_MultiVectorByMatrix( blockVectorBP, coordPX, blockVectorW ); + mv_MultiVectorSetMask( blockVectorBP, NULL ); + mv_MultiVectorCopy( blockVectorW, blockVectorBP ); + } + + lobpcg_MultiVectorByMatrix( blockVectorR, coordRX, blockVectorW ); + mv_MultiVectorAxpy( 1.0, blockVectorW, blockVectorP ); + + lobpcg_MultiVectorByMatrix( blockVectorAR, coordRX, blockVectorW ); + mv_MultiVectorAxpy( 1.0, blockVectorW, blockVectorAP ); + + if ( !noBFlag ) + { + lobpcg_MultiVectorByMatrix( blockVectorBR, coordRX, blockVectorW ); + mv_MultiVectorAxpy( 1.0, blockVectorW, blockVectorBP ); + } + + } + else + { + + mv_MultiVectorSetMask( blockVectorP, NULL ); + lobpcg_MultiVectorByMatrix( blockVectorR, coordRX, blockVectorP ); + + mv_MultiVectorSetMask( blockVectorAP, NULL ); + lobpcg_MultiVectorByMatrix( blockVectorAR, coordRX, blockVectorAP ); + + if ( !noBFlag ) + { + mv_MultiVectorSetMask( blockVectorBP, NULL ); + lobpcg_MultiVectorByMatrix( blockVectorBR, coordRX, blockVectorBP ); + } + + } + + /* follwing line is bug fix in Google Rev 8 of code, by ilya.lashuk Aug 29,2008 */ mv_MultiVectorSetMask( blockVectorW, NULL ); - lobpcg_MultiVectorByMatrix( blockVectorP, coordPX, blockVectorW ); - mv_MultiVectorSetMask( blockVectorP, NULL ); - mv_MultiVectorCopy( blockVectorW, blockVectorP ); - - lobpcg_MultiVectorByMatrix( blockVectorAP, coordPX, blockVectorW ); - mv_MultiVectorSetMask( blockVectorAP, NULL ); - mv_MultiVectorCopy( blockVectorW, blockVectorAP ); - - if ( !noBFlag ) { - lobpcg_MultiVectorByMatrix( blockVectorBP, coordPX, blockVectorW ); - mv_MultiVectorSetMask( blockVectorBP, NULL ); - mv_MultiVectorCopy( blockVectorW, blockVectorBP ); + + mv_MultiVectorCopy( blockVectorX, blockVectorW ); + lobpcg_MultiVectorByMatrix( blockVectorW, coordXX, blockVectorX ); + mv_MultiVectorAxpy( 1.0, blockVectorP, blockVectorX ); + + mv_MultiVectorCopy( blockVectorAX, blockVectorW ); + lobpcg_MultiVectorByMatrix( blockVectorW, coordXX, blockVectorAX ); + mv_MultiVectorAxpy( 1.0, blockVectorAP, blockVectorAX ); + + if ( !noBFlag ) + { + mv_MultiVectorCopy( blockVectorBX, blockVectorW ); + lobpcg_MultiVectorByMatrix( blockVectorW, coordXX, blockVectorBX ); + mv_MultiVectorAxpy( 1.0, blockVectorBP, blockVectorBX ); } - lobpcg_MultiVectorByMatrix( blockVectorR, coordRX, blockVectorW ); - mv_MultiVectorAxpy( 1.0, blockVectorW, blockVectorP ); - - lobpcg_MultiVectorByMatrix( blockVectorAR, coordRX, blockVectorW ); - mv_MultiVectorAxpy( 1.0, blockVectorW, blockVectorAP ); + mv_MultiVectorSetMask( blockVectorAX, activeMask ); + mv_MultiVectorSetMask( blockVectorBX, activeMask ); - if ( !noBFlag ) { - lobpcg_MultiVectorByMatrix( blockVectorBR, coordRX, blockVectorW ); - mv_MultiVectorAxpy( 1.0, blockVectorW, blockVectorBP ); + mv_MultiVectorByDiagonal( blockVectorBX, + activeMask, sizeX, + utilities_FortranMatrixValues( lambda ), + blockVectorR ); + + mv_MultiVectorAxpy( -1.0, blockVectorAX, blockVectorR ); + + mv_MultiVectorByMultiVectorDiag( blockVectorR, blockVectorR, + activeMask, sizeX, + utilities_FortranMatrixValues( residualNorms ) ); + lobpcg_sqrtVector( sizeX, activeMask, + utilities_FortranMatrixValues( residualNorms ) ); + + i = *iterationNumber + 1; + if ( lambdaHistory != NULL ) + { + utilities_FortranMatrixSelectBlock( lambdaHistory, 1, sizeX, i, i, + historyColumn ); + utilities_FortranMatrixCopy( lambda, 0, historyColumn ); + } + + if ( residualNormsHistory != NULL ) + { + utilities_FortranMatrixSelectBlock( residualNormsHistory, 1, sizeX, i, i, + historyColumn ); + utilities_FortranMatrixCopy( residualNorms, 0, historyColumn ); } - } - else { - - mv_MultiVectorSetMask( blockVectorP, NULL ); - lobpcg_MultiVectorByMatrix( blockVectorR, coordRX, blockVectorP ); - - mv_MultiVectorSetMask( blockVectorAP, NULL ); - lobpcg_MultiVectorByMatrix( blockVectorAR, coordRX, blockVectorAP ); - - if ( !noBFlag ) { - mv_MultiVectorSetMask( blockVectorBP, NULL ); - lobpcg_MultiVectorByMatrix( blockVectorBR, coordRX, blockVectorBP ); + if ( verbosityLevel == 2 ) + { + hypre_printf( "Iteration %d \tbsize %d\n", *iterationNumber, sizeR ); + for ( i = 1; i <= sizeX; i++ ) + hypre_printf("Eigenvalue lambda %22.14e\n", + utilities_FortranMatrixValue( lambda, i, 1) ); + for ( i = 1; i <= sizeX; i++ ) + hypre_printf("Residual %12.6e\n", + utilities_FortranMatrixValue( residualNorms, i, 1) ); + } + else if ( verbosityLevel == 1 ) + hypre_printf("Iteration %d \tbsize %d \tmaxres %22.14e\n", + *iterationNumber, sizeR, + utilities_FortranMatrixMaxValue( residualNorms ) ); + + mv_MultiVectorSetMask( blockVectorAX, NULL ); + mv_MultiVectorSetMask( blockVectorBX, NULL ); + mv_MultiVectorSetMask( blockVectorAP, activeMask ); + mv_MultiVectorSetMask( blockVectorBP, activeMask ); + mv_MultiVectorSetMask( blockVectorP, activeMask ); + mv_MultiVectorSetMask( blockVectorW, activeMask ); + + } + + if ( exitFlag != 0 || *iterationNumber > maxIterations ) + { + exitFlag = REQUESTED_ACCURACY_NOT_ACHIEVED; + } + + (*iterationNumber)--; + + if ( verbosityLevel == 1 ) + { + hypre_printf("\n"); + for ( i = 1; i <= sizeX; i++ ) + hypre_printf("Eigenvalue lambda %22.14e\n", + utilities_FortranMatrixValue( lambda, i, 1) ); + for ( i = 1; i <= sizeX; i++ ) + hypre_printf("Residual %22.14e\n", + utilities_FortranMatrixValue( residualNorms, i, 1) ); + hypre_printf("\n%d iterations\n", *iterationNumber ); + } + + mv_MultiVectorDestroy( blockVectorR ); + mv_MultiVectorDestroy( blockVectorP ); + mv_MultiVectorDestroy( blockVectorAX ); + mv_MultiVectorDestroy( blockVectorAR ); + mv_MultiVectorDestroy( blockVectorAP ); + if ( !noBFlag ) + { + mv_MultiVectorDestroy( blockVectorBX ); + mv_MultiVectorDestroy( blockVectorBR ); + mv_MultiVectorDestroy( blockVectorBP ); + if ( !noYFlag ) + { + mv_MultiVectorDestroy( blockVectorBY ); } - - } - -/* follwing line is bug fix in Google Rev 8 of code, by ilya.lashuk Aug 29,2008 */ - mv_MultiVectorSetMask( blockVectorW, NULL ); - - mv_MultiVectorCopy( blockVectorX, blockVectorW ); - lobpcg_MultiVectorByMatrix( blockVectorW, coordXX, blockVectorX ); - mv_MultiVectorAxpy( 1.0, blockVectorP, blockVectorX ); - - mv_MultiVectorCopy( blockVectorAX, blockVectorW ); - lobpcg_MultiVectorByMatrix( blockVectorW, coordXX, blockVectorAX ); - mv_MultiVectorAxpy( 1.0, blockVectorAP, blockVectorAX ); - - if ( !noBFlag ) { - mv_MultiVectorCopy( blockVectorBX, blockVectorW ); - lobpcg_MultiVectorByMatrix( blockVectorW, coordXX, blockVectorBX ); - mv_MultiVectorAxpy( 1.0, blockVectorBP, blockVectorBX ); - } - - mv_MultiVectorSetMask( blockVectorAX, activeMask ); - mv_MultiVectorSetMask( blockVectorBX, activeMask ); - - mv_MultiVectorByDiagonal( blockVectorBX, - activeMask, sizeX, - utilities_FortranMatrixValues( lambda ), - blockVectorR ); - - mv_MultiVectorAxpy( -1.0, blockVectorAX, blockVectorR ); - - mv_MultiVectorByMultiVectorDiag( blockVectorR, blockVectorR, - activeMask, sizeX, - utilities_FortranMatrixValues( residualNorms ) ); - lobpcg_sqrtVector( sizeX, activeMask, - utilities_FortranMatrixValues( residualNorms ) ); - - i = *iterationNumber + 1; - if ( lambdaHistory != NULL ) { - utilities_FortranMatrixSelectBlock( lambdaHistory, 1, sizeX, i, i, - historyColumn ); - utilities_FortranMatrixCopy( lambda, 0, historyColumn ); - } - - if ( residualNormsHistory != NULL ) { - utilities_FortranMatrixSelectBlock( residualNormsHistory, 1, sizeX, i, i, - historyColumn ); - utilities_FortranMatrixCopy( residualNorms, 0, historyColumn ); - } - - if ( verbosityLevel == 2 ) { - hypre_printf( "Iteration %d \tbsize %d\n", *iterationNumber, sizeR ); - for ( i = 1; i <= sizeX; i++ ) - hypre_printf("Eigenvalue lambda %22.14e\n", - utilities_FortranMatrixValue( lambda, i, 1) ); - for ( i = 1; i <= sizeX; i++ ) - hypre_printf("Residual %12.6e\n", - utilities_FortranMatrixValue( residualNorms, i, 1) ); - } - else if ( verbosityLevel == 1 ) - hypre_printf("Iteration %d \tbsize %d \tmaxres %22.14e\n", - *iterationNumber, sizeR, - utilities_FortranMatrixMaxValue( residualNorms ) ); - - mv_MultiVectorSetMask( blockVectorAX, NULL ); - mv_MultiVectorSetMask( blockVectorBX, NULL ); - mv_MultiVectorSetMask( blockVectorAP, activeMask ); - mv_MultiVectorSetMask( blockVectorBP, activeMask ); - mv_MultiVectorSetMask( blockVectorP, activeMask ); - mv_MultiVectorSetMask( blockVectorW, activeMask ); - - } - - if ( exitFlag != 0 || *iterationNumber > maxIterations ) - exitFlag = REQUESTED_ACCURACY_NOT_ACHIEVED; - - (*iterationNumber)--; - - if ( verbosityLevel == 1 ) { - hypre_printf("\n"); - for ( i = 1; i <= sizeX; i++ ) - hypre_printf("Eigenvalue lambda %22.14e\n", - utilities_FortranMatrixValue( lambda, i, 1) ); - for ( i = 1; i <= sizeX; i++ ) - hypre_printf("Residual %22.14e\n", - utilities_FortranMatrixValue( residualNorms, i, 1) ); - hypre_printf("\n%d iterations\n", *iterationNumber ); - } - - mv_MultiVectorDestroy( blockVectorR ); - mv_MultiVectorDestroy( blockVectorP ); - mv_MultiVectorDestroy( blockVectorAX ); - mv_MultiVectorDestroy( blockVectorAR ); - mv_MultiVectorDestroy( blockVectorAP ); - if ( !noBFlag ) { - mv_MultiVectorDestroy( blockVectorBX ); - mv_MultiVectorDestroy( blockVectorBR ); - mv_MultiVectorDestroy( blockVectorBP ); - if ( !noYFlag ) - mv_MultiVectorDestroy( blockVectorBY ); - } - mv_MultiVectorDestroy( blockVectorW ); - - utilities_FortranMatrixDestroy( gramA ); - utilities_FortranMatrixDestroy( gramB ); - utilities_FortranMatrixDestroy( lambdaAB ); - utilities_FortranMatrixDestroy( lambdaX ); - - utilities_FortranMatrixDestroy( gramXAX ); - utilities_FortranMatrixDestroy( gramRAX ); - utilities_FortranMatrixDestroy( gramPAX ); - utilities_FortranMatrixDestroy( gramRAR ); - utilities_FortranMatrixDestroy( gramPAR ); - utilities_FortranMatrixDestroy( gramPAP ); - - utilities_FortranMatrixDestroy( gramXBX ); - utilities_FortranMatrixDestroy( gramRBX ); - utilities_FortranMatrixDestroy( gramPBX ); - utilities_FortranMatrixDestroy( gramRBR ); - utilities_FortranMatrixDestroy( gramPBR ); - utilities_FortranMatrixDestroy( gramPBP ); - - utilities_FortranMatrixDestroy( gramYBY ); - utilities_FortranMatrixDestroy( gramYBX ); - utilities_FortranMatrixDestroy( tempYBX ); - utilities_FortranMatrixDestroy( gramYBR ); - utilities_FortranMatrixDestroy( tempYBR ); - - utilities_FortranMatrixDestroy( coordX ); - utilities_FortranMatrixDestroy( coordXX ); - utilities_FortranMatrixDestroy( coordRX ); - utilities_FortranMatrixDestroy( coordPX ); - - utilities_FortranMatrixDestroy( upperR ); - utilities_FortranMatrixDestroy( historyColumn ); - - utilities_FortranMatrixDestroy( lambda ); - utilities_FortranMatrixDestroy( lambdaHistory ); - utilities_FortranMatrixDestroy( residualNorms ); - utilities_FortranMatrixDestroy( residualNormsHistory ); - - hypre_TFree( activeMask ,HYPRE_MEMORY_HOST); - - return exitFlag; + } + mv_MultiVectorDestroy( blockVectorW ); + + utilities_FortranMatrixDestroy( gramA ); + utilities_FortranMatrixDestroy( gramB ); + utilities_FortranMatrixDestroy( lambdaAB ); + utilities_FortranMatrixDestroy( lambdaX ); + + utilities_FortranMatrixDestroy( gramXAX ); + utilities_FortranMatrixDestroy( gramRAX ); + utilities_FortranMatrixDestroy( gramPAX ); + utilities_FortranMatrixDestroy( gramRAR ); + utilities_FortranMatrixDestroy( gramPAR ); + utilities_FortranMatrixDestroy( gramPAP ); + + utilities_FortranMatrixDestroy( gramXBX ); + utilities_FortranMatrixDestroy( gramRBX ); + utilities_FortranMatrixDestroy( gramPBX ); + utilities_FortranMatrixDestroy( gramRBR ); + utilities_FortranMatrixDestroy( gramPBR ); + utilities_FortranMatrixDestroy( gramPBP ); + + utilities_FortranMatrixDestroy( gramYBY ); + utilities_FortranMatrixDestroy( gramYBX ); + utilities_FortranMatrixDestroy( tempYBX ); + utilities_FortranMatrixDestroy( gramYBR ); + utilities_FortranMatrixDestroy( tempYBR ); + + utilities_FortranMatrixDestroy( coordX ); + utilities_FortranMatrixDestroy( coordXX ); + utilities_FortranMatrixDestroy( coordRX ); + utilities_FortranMatrixDestroy( coordPX ); + + utilities_FortranMatrixDestroy( upperR ); + utilities_FortranMatrixDestroy( historyColumn ); + + utilities_FortranMatrixDestroy( lambda ); + utilities_FortranMatrixDestroy( lambdaHistory ); + utilities_FortranMatrixDestroy( residualNorms ); + utilities_FortranMatrixDestroy( residualNormsHistory ); + + hypre_TFree( activeMask, HYPRE_MEMORY_HOST); + + return exitFlag; } diff --git a/external/hypre/src/krylov/lobpcg.h b/external/hypre/src/krylov/lobpcg.h index f917bc9c..74fba256 100644 --- a/external/hypre/src/krylov/lobpcg.h +++ b/external/hypre/src/krylov/lobpcg.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -15,71 +15,73 @@ extern "C" { #endif -#define PROBLEM_SIZE_TOO_SMALL 1 -#define WRONG_BLOCK_SIZE 2 -#define WRONG_CONSTRAINTS 3 -#define REQUESTED_ACCURACY_NOT_ACHIEVED -1 +#define PROBLEM_SIZE_TOO_SMALL 1 +#define WRONG_BLOCK_SIZE 2 +#define WRONG_CONSTRAINTS 3 +#define REQUESTED_ACCURACY_NOT_ACHIEVED -1 -typedef struct { +typedef struct +{ - HYPRE_Real absolute; - HYPRE_Real relative; + HYPRE_Real absolute; + HYPRE_Real relative; } lobpcg_Tolerance; -typedef struct { +typedef struct +{ -/* these pointers should point to 2 functions providing standard lapack functionality */ + /* these pointers should point to 2 functions providing standard lapack functionality */ HYPRE_Int (*dpotrf) (const char *uplo, HYPRE_Int *n, HYPRE_Real *a, HYPRE_Int * - lda, HYPRE_Int *info); + lda, HYPRE_Int *info); HYPRE_Int (*dsygv) (HYPRE_Int *itype, char *jobz, char *uplo, HYPRE_Int * - n, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Real *b, HYPRE_Int *ldb, - HYPRE_Real *w, HYPRE_Real *work, HYPRE_Int *lwork, HYPRE_Int *info); + n, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Real *b, HYPRE_Int *ldb, + HYPRE_Real *w, HYPRE_Real *work, HYPRE_Int *lwork, HYPRE_Int *info); } lobpcg_BLASLAPACKFunctions; HYPRE_Int lobpcg_solve( mv_MultiVectorPtr blockVectorX, - void* operatorAData, - void (*operatorA)( void*, void*, void* ), - void* operatorBData, - void (*operatorB)( void*, void*, void* ), - void* operatorTData, - void (*operatorT)( void*, void*, void* ), - mv_MultiVectorPtr blockVectorY, + void* operatorAData, + void (*operatorA)( void*, void*, void* ), + void* operatorBData, + void (*operatorB)( void*, void*, void* ), + void* operatorTData, + void (*operatorT)( void*, void*, void* ), + mv_MultiVectorPtr blockVectorY, lobpcg_BLASLAPACKFunctions blap_fn, - lobpcg_Tolerance tolerance, - HYPRE_Int maxIterations, - HYPRE_Int verbosityLevel, - HYPRE_Int* iterationNumber, + lobpcg_Tolerance tolerance, + HYPRE_Int maxIterations, + HYPRE_Int verbosityLevel, + HYPRE_Int* iterationNumber, -/* eigenvalues; "lambda_values" should point to array containing doubles where is the width of multivector "blockVectorX" */ + /* eigenvalues; "lambda_values" should point to array containing doubles where is the width of multivector "blockVectorX" */ HYPRE_Real * lambda_values, -/* eigenvalues history; a pointer to the entries of the -by-(+1) matrix s -tored -in fortran-style. (i.e. column-wise) The matrix may be a submatrix of a larger matrix, see next -argument; If you don't need eigenvalues history, provide NULL in this entry */ + /* eigenvalues history; a pointer to the entries of the -by-(+1) matrix s + tored + in fortran-style. (i.e. column-wise) The matrix may be a submatrix of a larger matrix, see next + argument; If you don't need eigenvalues history, provide NULL in this entry */ HYPRE_Real * lambdaHistory_values, -/* global height of the matrix (stored in fotran-style) specified by previous argument */ - HYPRE_Int lambdaHistory_gh, + /* global height of the matrix (stored in fotran-style) specified by previous argument */ + HYPRE_BigInt lambdaHistory_gh, -/* residual norms; argument should point to array of doubles */ + /* residual norms; argument should point to array of doubles */ HYPRE_Real * residualNorms_values, -/* residual norms history; a pointer to the entries of the -by-(+1) matri -x -stored in fortran-style. (i.e. column-wise) The matrix may be a submatrix of a larger matrix, see -next -argument If you don't need residual norms history, provide NULL in this entry */ - HYPRE_Real * residualNormsHistory_values , + /* residual norms history; a pointer to the entries of the -by-(+1) matri + x + stored in fortran-style. (i.e. column-wise) The matrix may be a submatrix of a larger matrix, see + next + argument If you don't need residual norms history, provide NULL in this entry */ + HYPRE_Real * residualNormsHistory_values, -/* global height of the matrix (stored in fotran-style) specified by previous argument */ - HYPRE_Int residualNormsHistory_gh + /* global height of the matrix (stored in fotran-style) specified by previous argument */ + HYPRE_BigInt residualNormsHistory_gh -); + ); #ifdef __cplusplus } diff --git a/external/hypre/src/krylov/pcg.c b/external/hypre/src/krylov/pcg.c index 0d734ea4..37b59453 100644 --- a/external/hypre/src/krylov/pcg.c +++ b/external/hypre/src/krylov/pcg.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -46,11 +46,11 @@ hypre_PCGFunctionsCreate( HYPRE_Int (*Axpy) ( HYPRE_Complex alpha, void *x, void *y ), HYPRE_Int (*PrecondSetup) ( void *vdata, void *A, void *b, void *x ), HYPRE_Int (*Precond) ( void *vdata, void *A, void *b, void *x ) - ) +) { hypre_PCGFunctions * pcg_functions; pcg_functions = (hypre_PCGFunctions *) - CAlloc( 1, sizeof(hypre_PCGFunctions), HYPRE_MEMORY_HOST ); + CAlloc( 1, sizeof(hypre_PCGFunctions), HYPRE_MEMORY_HOST ); pcg_functions->CAlloc = CAlloc; pcg_functions->Free = Free; @@ -99,6 +99,7 @@ hypre_PCGCreate( hypre_PCGFunctions *pcg_functions ) (pcg_data -> recompute_residual) = 0; (pcg_data -> recompute_residual_p) = 0; (pcg_data -> stop_crit) = 0; + (pcg_data -> skip_break) = 0; (pcg_data -> converged) = 0; (pcg_data -> hybrid) = 0; (pcg_data -> owns_matvec_data ) = 1; @@ -111,6 +112,8 @@ hypre_PCGCreate( hypre_PCGFunctions *pcg_functions ) (pcg_data -> p) = NULL; (pcg_data -> s) = NULL; (pcg_data -> r) = NULL; + (pcg_data -> r_old) = NULL; + (pcg_data -> v) = NULL; HYPRE_ANNOTATE_FUNC_END; @@ -161,13 +164,23 @@ hypre_PCGDestroy( void *pcg_vdata ) (*(pcg_functions->DestroyVector))(pcg_data -> r); pcg_data -> r = NULL; } + if ( pcg_data -> r_old != NULL ) + { + (*(pcg_functions->DestroyVector))(pcg_data -> r_old); + pcg_data -> r_old = NULL; + } + if ( pcg_data -> v != NULL ) + { + (*(pcg_functions->DestroyVector))(pcg_data -> v); + pcg_data -> v = NULL; + } hypre_TFreeF( pcg_data, pcg_functions ); hypre_TFreeF( pcg_functions, pcg_functions ); } HYPRE_ANNOTATE_FUNC_END; - return(hypre_error_flag); + return (hypre_error_flag); } /*-------------------------------------------------------------------------- @@ -196,7 +209,11 @@ hypre_PCGSetup( void *pcg_vdata, hypre_PCGData *pcg_data = (hypre_PCGData *)pcg_vdata; hypre_PCGFunctions *pcg_functions = pcg_data->functions; HYPRE_Int max_iter = (pcg_data -> max_iter); - HYPRE_Int (*precond_setup)(void*,void*,void*,void*) = (pcg_functions -> precond_setup); + HYPRE_Int recompute_residual_p = (pcg_data -> recompute_residual_p); + HYPRE_Real rtol = (pcg_data -> rtol); + HYPRE_Int two_norm = (pcg_data -> two_norm); + HYPRE_Int flex = (pcg_data -> flex); + HYPRE_Int (*precond_setup)(void*, void*, void*, void*) = (pcg_functions -> precond_setup); void *precond_data = (pcg_data -> precond_data); HYPRE_ANNOTATE_FUNC_BEGIN; @@ -210,36 +227,66 @@ hypre_PCGSetup( void *pcg_vdata, *--------------------------------------------------*/ if ( pcg_data -> p != NULL ) + { (*(pcg_functions->DestroyVector))(pcg_data -> p); + } (pcg_data -> p) = (*(pcg_functions->CreateVector))(x); if ( pcg_data -> s != NULL ) + { (*(pcg_functions->DestroyVector))(pcg_data -> s); + } (pcg_data -> s) = (*(pcg_functions->CreateVector))(x); if ( pcg_data -> r != NULL ) + { (*(pcg_functions->DestroyVector))(pcg_data -> r); + } (pcg_data -> r) = (*(pcg_functions->CreateVector))(b); if ( pcg_data -> matvec_data != NULL && pcg_data->owns_matvec_data ) + { (*(pcg_functions->MatvecDestroy))(pcg_data -> matvec_data); + } (pcg_data -> matvec_data) = (*(pcg_functions->MatvecCreate))(A, x); + if (flex) + { + if ( pcg_data -> v != NULL ) + { + (*(pcg_functions->DestroyVector))(pcg_data -> r_old); + } + (pcg_data -> r_old) = (*(pcg_functions->CreateVector))(b); + } + + if (rtol && recompute_residual_p && (!two_norm)) + { + if ( pcg_data -> v != NULL ) + { + (*(pcg_functions->DestroyVector))(pcg_data -> v); + } + (pcg_data -> v) = (*(pcg_functions->CreateVector))(b); + } + precond_setup(precond_data, A, b, x); /*----------------------------------------------------- * Allocate space for log info *-----------------------------------------------------*/ - if ( (pcg_data->logging)>0 || (pcg_data->print_level)>0 ) + if ( (pcg_data->logging) > 0 || (pcg_data->print_level) > 0 ) { if ( (pcg_data -> norms) != NULL ) + { hypre_TFreeF( pcg_data -> norms, pcg_functions ); + } (pcg_data -> norms) = hypre_CTAllocF( HYPRE_Real, max_iter + 1, pcg_functions, HYPRE_MEMORY_HOST); if ( (pcg_data -> rel_norms) != NULL ) + { hypre_TFreeF( pcg_data -> rel_norms, pcg_functions ); + } (pcg_data -> rel_norms) = hypre_CTAllocF( HYPRE_Real, max_iter + 1, pcg_functions, HYPRE_MEMORY_HOST ); } @@ -288,14 +335,23 @@ hypre_PCGSolve( void *pcg_vdata, HYPRE_Int recompute_residual_p = (pcg_data -> recompute_residual_p); HYPRE_Int stop_crit = (pcg_data -> stop_crit); HYPRE_Int hybrid = (pcg_data -> hybrid); -/* - HYPRE_Int converged = (pcg_data -> converged); -*/ + HYPRE_Int skip_break = (pcg_data -> skip_break); + HYPRE_Int flex = (pcg_data -> flex); + /* flex replaces the generally used Fletcher-Reeves method for the + * parameter used to update the direction vector p, beta=/ + * with the Polak-Ribiere method, which is more flexible, can be more stable, + * and llows varying preconditioners, but requires an extra dot product + * beta = / */ + /* + HYPRE_Int converged = (pcg_data -> converged); + */ void *p = (pcg_data -> p); void *s = (pcg_data -> s); void *r = (pcg_data -> r); + void *r_old = (pcg_data -> r_old); + void *v = (pcg_data -> v); void *matvec_data = (pcg_data -> matvec_data); - HYPRE_Int (*precond)(void*,void*,void*,void*) = (pcg_functions -> precond); + HYPRE_Int (*precond)(void*, void*, void*, void*) = (pcg_functions -> precond); void *precond_data = (pcg_data -> precond_data); HYPRE_Int print_level = (pcg_data -> print_level); HYPRE_Int logging = (pcg_data -> logging); @@ -303,6 +359,7 @@ hypre_PCGSolve( void *pcg_vdata, HYPRE_Real *rel_norms = (pcg_data -> rel_norms); HYPRE_Real alpha, beta; + HYPRE_Real delta = 0.0; HYPRE_Real gamma, gamma_old; HYPRE_Real bi_prod, eps; HYPRE_Real pi_prod, xi_prod; @@ -326,7 +383,7 @@ hypre_PCGSolve( void *pcg_vdata, (pcg_data -> converged) = 0; - (*(pcg_functions->CommInfo))(A,&my_id,&num_procs); + (*(pcg_functions->CommInfo))(A, &my_id, &num_procs); /*----------------------------------------------------------------------- * With relative change convergence test on, it is possible to attempt @@ -347,7 +404,9 @@ hypre_PCGSolve( void *pcg_vdata, /* bi_prod = */ bi_prod = (*(pcg_functions->InnerProd))(b, b); if (print_level > 1 && my_id == 0) - hypre_printf(": %e\n",bi_prod); + { + hypre_printf(": %e\n", bi_prod); + } } else { @@ -356,12 +415,14 @@ hypre_PCGSolve( void *pcg_vdata, precond(precond_data, A, b, p); bi_prod = (*(pcg_functions->InnerProd))(p, b); if (print_level > 1 && my_id == 0) - hypre_printf(": %e\n",bi_prod); + { + hypre_printf(": %e\n", bi_prod); + } }; - /* Since it is does not diminish performance, attempt to return an error flag + /* Since it does not diminish performance, attempt to return an error flag and notify users when they supply bad input. */ - if (bi_prod != 0.) ieee_check = bi_prod/bi_prod; /* INF -> NaN conversion */ + if (bi_prod != 0.) { ieee_check = bi_prod / bi_prod; } /* INF -> NaN conversion */ if (ieee_check != ieee_check) { /* ...INFs or NaNs in input can make ieee_check a NaN. This test @@ -371,11 +432,11 @@ hypre_PCGSolve( void *pcg_vdata, found at http://HTTP.CS.Berkeley.EDU/~wkahan/ieee754status/IEEE754.PDF */ if (print_level > 0 || logging > 0) { - hypre_printf("\n\nERROR detected by Hypre ... BEGIN\n"); - hypre_printf("ERROR -- hypre_PCGSolve: INFs and/or NaNs detected in input.\n"); - hypre_printf("User probably placed non-numerics in supplied b.\n"); - hypre_printf("Returning error flag += 101. Program not terminated.\n"); - hypre_printf("ERROR detected by Hypre ... END\n\n\n"); + hypre_printf("\n\nERROR detected by Hypre ... BEGIN\n"); + hypre_printf("ERROR -- hypre_PCGSolve: INFs and/or NaNs detected in input.\n"); + hypre_printf("User probably placed non-numerics in supplied b.\n"); + hypre_printf("Returning error flag += 101. Program not terminated.\n"); + hypre_printf("ERROR detected by Hypre ... END\n\n\n"); } hypre_error(HYPRE_ERROR_GENERIC); HYPRE_ANNOTATE_FUNC_END; @@ -383,28 +444,28 @@ hypre_PCGSolve( void *pcg_vdata, return hypre_error_flag; } - eps = r_tol*r_tol; /* note: this may be re-assigned below */ + eps = r_tol * r_tol; /* note: this may be re-assigned below */ if ( bi_prod > 0.0 ) { - if ( stop_crit && !rel_change && atolf<=0 ) /* pure absolute tolerance */ + if ( stop_crit && !rel_change && atolf <= 0 ) /* pure absolute tolerance */ { eps = eps / bi_prod; /* Note: this section is obsolete. Aside from backwards comatability concerns, we could delete the stop_crit parameter and related code, using tol & atolf instead. */ } - else if ( atolf>0 ) /* mixed relative and absolute tolerance */ + else if ( atolf > 0 ) /* mixed relative and absolute tolerance */ { bi_prod += atolf; } else /* DEFAULT (stop_crit and atolf exist for backwards compatibilty and are not in the reference manual) */ { - /* convergence criteria: <= max( a_tol^2, r_tol^2 * ) - note: default for a_tol is 0.0, so relative residual criteria is used unless - user specifies a_tol, or sets r_tol = 0.0, which means absolute - tol only is checked */ - eps = hypre_max(r_tol*r_tol, a_tol*a_tol/bi_prod); + /* convergence criteria: <= max( a_tol^2, r_tol^2 * ) + note: default for a_tol is 0.0, so relative residual criteria is used unless + user specifies a_tol, or sets r_tol = 0.0, which means absolute + tol only is checked */ + eps = hypre_max(r_tol * r_tol, a_tol * a_tol / bi_prod); } } @@ -412,7 +473,7 @@ hypre_PCGSolve( void *pcg_vdata, { /* Set x equal to zero and return */ (*(pcg_functions->CopyVector))(b, x); - if (logging>0 || print_level>0) + if (logging > 0 || print_level > 0) { norms[0] = 0.0; rel_norms[i] = 0.0; @@ -434,12 +495,12 @@ hypre_PCGSolve( void *pcg_vdata, (*(pcg_functions->ClearVector))(p); precond(precond_data, A, r, p); - /* gamma = */ - gamma = (*(pcg_functions->InnerProd))(r,p); + /* gamma = = */ + gamma = (*(pcg_functions->InnerProd))(r, p); - /* Since it is does not diminish performance, attempt to return an error flag + /* Since it does not diminish performance, attempt to return an error flag and notify users when they supply bad input. */ - if (gamma != 0.) ieee_check = gamma/gamma; /* INF -> NaN conversion */ + if (gamma != 0.) { ieee_check = gamma / gamma; } /* INF -> NaN conversion */ if (ieee_check != ieee_check) { /* ...INFs or NaNs in input can make ieee_check a NaN. This test @@ -449,11 +510,11 @@ hypre_PCGSolve( void *pcg_vdata, found at http://HTTP.CS.Berkeley.EDU/~wkahan/ieee754status/IEEE754.PDF */ if (print_level > 0 || logging > 0) { - hypre_printf("\n\nERROR detected by Hypre ... BEGIN\n"); - hypre_printf("ERROR -- hypre_PCGSolve: INFs and/or NaNs detected in input.\n"); - hypre_printf("User probably placed non-numerics in supplied A or x_0.\n"); - hypre_printf("Returning error flag += 101. Program not terminated.\n"); - hypre_printf("ERROR detected by Hypre ... END\n\n\n"); + hypre_printf("\n\nERROR detected by Hypre ... BEGIN\n"); + hypre_printf("ERROR -- hypre_PCGSolve: INFs and/or NaNs detected in input.\n"); + hypre_printf("User probably placed non-numerics in supplied A or x_0.\n"); + hypre_printf("Returning error flag += 101. Program not terminated.\n"); + hypre_printf("ERROR detected by Hypre ... END\n\n\n"); } hypre_error(HYPRE_ERROR_GENERIC); HYPRE_ANNOTATE_FUNC_END; @@ -462,21 +523,25 @@ hypre_PCGSolve( void *pcg_vdata, } /* Set initial residual norm */ - if ( logging>0 || print_level > 0 || cf_tol > 0.0 ) + if ( logging > 0 || print_level > 0 || cf_tol > 0.0 ) { if (two_norm) - i_prod_0 = (*(pcg_functions->InnerProd))(r,r); + { + i_prod_0 = (*(pcg_functions->InnerProd))(r, r); + } else + { i_prod_0 = gamma; + } - if ( logging>0 || print_level>0 ) norms[0] = sqrt(i_prod_0); + if ( logging > 0 || print_level > 0 ) { norms[0] = hypre_sqrt(i_prod_0); } } - if ( print_level > 1 && my_id==0 ) + if ( print_level > 1 && my_id == 0 ) { hypre_printf("\n\n"); if (two_norm) { - if ( stop_crit && !rel_change && atolf==0 ) /* pure absolute tolerance */ + if ( stop_crit && !rel_change && atolf == 0 ) /* pure absolute tolerance */ { hypre_printf("Iters ||r||_2 conv.rate\n"); hypre_printf("----- ------------ ---------\n"); @@ -495,7 +560,7 @@ hypre_PCGSolve( void *pcg_vdata, /* hypre_printf("% 5d %e\n", i, norms[i]); */ } - while ((i+1) <= max_iter) + while ((i + 1) <= max_iter) { /*-------------------------------------------------------------------- * the core CG calculations... @@ -506,25 +571,61 @@ hypre_PCGSolve( void *pcg_vdata, r = b - A x (instead of using the recursive definition). Note that this is potentially expensive and can lead to degraded convergence (since it essentially a "restarted CG"). */ - recompute_true_residual = recompute_residual_p && !(i%recompute_residual_p); + recompute_true_residual = recompute_residual_p && !(i % recompute_residual_p); /* s = A*p */ (*(pcg_functions->Matvec))(matvec_data, 1.0, A, p, 0.0, s); /* alpha = gamma / */ sdotp = (*(pcg_functions->InnerProd))(s, p); - if ( sdotp==0.0 ) + if ( sdotp == 0.0 ) { hypre_error_w_msg(HYPRE_ERROR_CONV, "Zero sdotp value in PCG"); - if (i==1) i_prod=i_prod_0; + if (i == 1) { i_prod = i_prod_0; } break; } alpha = gamma / sdotp; - if (! (alpha > HYPRE_REAL_MIN) ) + /* alpha should always be greater zero for spd A, spd precond. and nonzero p, r*/ + /* alpha = / */ + /* for alpha close to 0 x and r will not change much unless x and/or r are close to 0 */ + if (alpha <= 0.0) + { + if (print_level > 1 && my_id == 0) + { + hypre_printf("alpha %e", alpha); + } + hypre_error_w_msg(HYPRE_ERROR_CONV, "Negative or zero alpha value in PCG"); + if (skip_break < 3) + { + if (i == 1) { i_prod = i_prod_0; } + break; + } + } + else if (! (alpha >= HYPRE_REAL_TRUE_MIN)) + { + hypre_error_w_msg(HYPRE_ERROR_CONV, "alpha value less than TRUE_MIN in PCG"); + if (print_level > 1 && my_id == 0) + { + hypre_printf("alpha %e", alpha); + } + if (skip_break < 2) + { + if (i == 1) { i_prod = i_prod_0; } + break; + } + } + else if (! (alpha >= HYPRE_REAL_MIN)) { hypre_error_w_msg(HYPRE_ERROR_CONV, "Subnormal alpha value in PCG"); - if (i==1) i_prod=i_prod_0; - break; + if (print_level > 1 && my_id == 0) + { + hypre_printf("alpha %e", alpha); + } + if (skip_break < 1) + { + if (i == 1) { i_prod = i_prod_0; } + break; + } } gamma_old = gamma; @@ -532,6 +633,11 @@ hypre_PCGSolve( void *pcg_vdata, /* x = x + alpha*p */ (*(pcg_functions->Axpy))(alpha, p, x); + if (flex) + { + (*(pcg_functions->CopyVector))(r, r_old); /*save old residual */ + } + /* r = r - alpha*s */ if ( !recompute_true_residual ) { @@ -543,22 +649,65 @@ hypre_PCGSolve( void *pcg_vdata, { hypre_printf("Recomputing the residual...\n"); } + (*(pcg_functions->CopyVector))(r, s); /*save old residual */ + if (flex) + { + (*(pcg_functions->CopyVector))(r, r_old); /*save old residual */ + } (*(pcg_functions->CopyVector))(b, r); (*(pcg_functions->Matvec))(matvec_data, -1.0, A, x, 1.0, r); + if (rtol) + { + /* compute s = r_old-r_new */ + (*(pcg_functions->Axpy))(-1.0, s, r); + if (two_norm) + /* residual-based stopping criteria: ||r_new-r_old|| < rtol ||b|| */ + { + HYPRE_Real drob2 = (*(pcg_functions->InnerProd))(s, s) / bi_prod; + if ( drob2 < rtol * rtol ) + { + if (print_level > 1 && my_id == 0) + { + hypre_printf("\n\n||r_old-r_new||/||b||: %e\n", hypre_sqrt(drob2)); + } + break; + } + } + else + /* residual-based stopping criteria: ||r_new-r_old||_C < rtol ||b||_C */ + { + HYPRE_Real r2ob2; + /* v = C*s = C*(r_old-r_new) */ + (*(pcg_functions->ClearVector))(v); + precond(precond_data, A, s, v); + /* */ + r2ob2 = (*(pcg_functions->InnerProd))(s, v) / bi_prod; + if ( r2ob2 < rtol * rtol ) + { + if (print_level > 1 && my_id == 0) + { + hypre_printf("\n\n||r_old-r_new||_C/||b||_C: %e\n", hypre_sqrt(r2ob2)); + } + break; + } + } + } } - /* residual-based stopping criteria: ||r_new-r_old|| < rtol ||b|| */ if (rtol && two_norm) { - /* use that r_new-r_old = alpha * s */ - HYPRE_Real drob2 = alpha*alpha*(*(pcg_functions->InnerProd))(s,s)/bi_prod; - if ( drob2 < rtol*rtol ) + if (!recompute_true_residual) { - if (print_level > 1 && my_id == 0) + /* use that r_new-r_old = alpha * s */ + HYPRE_Real drob2 = alpha * alpha * (*(pcg_functions->InnerProd))(s, s) / bi_prod; + if ( drob2 < rtol * rtol ) { - hypre_printf("\n\n||r_old-r_new||/||b||: %e\n", sqrt(drob2)); + if (print_level > 1 && my_id == 0) + { + hypre_printf("\n\n||r_old-r_new||/||b||: %e\n", hypre_sqrt(drob2)); + } + break; } - break; } } @@ -568,27 +717,39 @@ hypre_PCGSolve( void *pcg_vdata, /* gamma = */ gamma = (*(pcg_functions->InnerProd))(r, s); + if (flex) + { + delta = gamma - (*(pcg_functions->InnerProd))(r_old, s); + } /* residual-based stopping criteria: ||r_new-r_old||_C < rtol ||b||_C */ if (rtol && !two_norm) { - /* use that ||r_new-r_old||_C^2 = (r_new ,C r_new) + (r_old, C r_old) */ - HYPRE_Real r2ob2 = (gamma + gamma_old)/bi_prod; - if ( r2ob2 < rtol*rtol) + if (!recompute_true_residual) { - if (print_level > 1 && my_id == 0) + /* The following assumes that residuals are C-orthogonal: */ + /* use that ||r_new-r_old||_C^2 = (r_new ,C r_new) + (r_old, C r_old) */ + HYPRE_Real r2ob2 = (gamma + gamma_old) / bi_prod; + if ( r2ob2 < rtol * rtol) { - hypre_printf("\n\n||r_old-r_new||_C/||b||_C: %e\n", sqrt(r2ob2)); + if (print_level > 1 && my_id == 0) + { + hypre_printf("\n\n||r_old-r_new||_C/||b||_C: %e\n", hypre_sqrt(r2ob2)); + } + break; } - break; } } /* set i_prod for convergence test */ if (two_norm) - i_prod = (*(pcg_functions->InnerProd))(r,r); + { + i_prod = (*(pcg_functions->InnerProd))(r, r); + } else + { i_prod = gamma; + } /*-------------------------------------------------------------------- * optional output @@ -596,36 +757,37 @@ hypre_PCGSolve( void *pcg_vdata, #if 0 if (two_norm) hypre_printf("Iter (%d): ||r||_2 = %e, ||r||_2/||b||_2 = %e\n", - i, sqrt(i_prod), (bi_prod ? sqrt(i_prod/bi_prod) : 0)); + i, hypre_sqrt(i_prod), (bi_prod ? hypre_sqrt(i_prod / bi_prod) : 0)); else hypre_printf("Iter (%d): ||r||_C = %e, ||r||_C/||b||_C = %e\n", - i, sqrt(i_prod), (bi_prod ? sqrt(i_prod/bi_prod) : 0)); + i, hypre_sqrt(i_prod), (bi_prod ? hypre_sqrt(i_prod / bi_prod) : 0)); #endif /* print norm info */ - if ( logging>0 || print_level>0 ) + if ( logging > 0 || print_level > 0 ) { - norms[i] = sqrt(i_prod); - rel_norms[i] = bi_prod ? sqrt(i_prod/bi_prod) : 0; + norms[i] = hypre_sqrt(i_prod); + rel_norms[i] = bi_prod ? hypre_sqrt(i_prod / bi_prod) : 0; } - if ( print_level > 1 && my_id==0 ) + if ( print_level > 1 && my_id == 0 ) { if (two_norm) { - if ( stop_crit && !rel_change && atolf==0 ) { /* pure absolute tolerance */ + if ( stop_crit && !rel_change && atolf == 0 ) /* pure absolute tolerance */ + { hypre_printf("% 5d %e %f\n", i, norms[i], - norms[i]/norms[i-1] ); + norms[i] / norms[i - 1] ); } else { hypre_printf("% 5d %e %f %e\n", i, norms[i], - norms[i]/norms[i-1], rel_norms[i] ); + norms[i] / norms[i - 1], rel_norms[i] ); } } else { - hypre_printf("% 5d %e %f %e\n", i, norms[i], - norms[i]/norms[i-1], rel_norms[i] ); + hypre_printf("% 5d %e %f %e\n", i, norms[i], + norms[i] / norms[i - 1], rel_norms[i] ); } } @@ -634,10 +796,12 @@ hypre_PCGSolve( void *pcg_vdata, * check for convergence *--------------------------------------------------------------------*/ if (i_prod / bi_prod < eps) /* the basic convergence test */ - tentatively_converged = 1; + { + tentatively_converged = 1; + } if ( tentatively_converged && recompute_residual ) /* At user request, don't trust the convergence test until we've recomputed - the residual from scratch. This is expensive in the usual case where an + the residual from scratch. This is expensive in the usual case where the norm is the energy norm. This calculation is coded on the assumption that r's accuracy is only a concern for problems where CG takes many iterations. */ @@ -649,7 +813,7 @@ hypre_PCGSolve( void *pcg_vdata, /* set i_prod for convergence test */ if (two_norm) { - i_prod = (*(pcg_functions->InnerProd))(r,r); + i_prod = (*(pcg_functions->InnerProd))(r, r); } else { @@ -658,17 +822,18 @@ hypre_PCGSolve( void *pcg_vdata, precond(precond_data, A, r, s); /* iprod = gamma = */ i_prod = (*(pcg_functions->InnerProd))(r, s); + gamma = i_prod; } - if (i_prod / bi_prod >= eps) tentatively_converged = 0; + if (i_prod / bi_prod >= eps) { tentatively_converged = 0; } } if ( tentatively_converged && rel_change && (i_prod > guard_zero_residual )) /* At user request, don't treat this as converged unless x didn't change much in the last iteration. */ { - pi_prod = (*(pcg_functions->InnerProd))(p,p); - xi_prod = (*(pcg_functions->InnerProd))(x,x); - ratio = alpha*alpha*pi_prod/xi_prod; - if (ratio >= eps) tentatively_converged = 0; + pi_prod = (*(pcg_functions->InnerProd))(p, p); + xi_prod = (*(pcg_functions->InnerProd))(x, x); + ratio = alpha * alpha * pi_prod / xi_prod; + if (ratio >= eps) { tentatively_converged = 0; } } if ( tentatively_converged ) /* we've passed all the convergence tests, it's for real */ @@ -676,12 +841,45 @@ hypre_PCGSolve( void *pcg_vdata, (pcg_data -> converged) = 1; break; } - - if (! (gamma > HYPRE_REAL_MIN) ) + /* gamma should generally be greater than 0 for spd prec and nonzero r */ + if (gamma <= 0.0) + { + if (print_level > 1 && my_id == 0) + { + hypre_printf("gamma %e", gamma); + } + hypre_error_w_msg(HYPRE_ERROR_CONV, "Negative or zero gamma value in PCG"); + if (skip_break < 3) + { + if (i == 1) { i_prod = i_prod_0; } + break; + } + } + else if (! (gamma >= HYPRE_REAL_TRUE_MIN)) + { + hypre_error_w_msg(HYPRE_ERROR_CONV, "gamma value less than TRUE_MIN in PCG"); + if (print_level > 1 && my_id == 0) + { + hypre_printf("gamma %e", gamma); + } + if (skip_break < 2) + { + if (i == 1) { i_prod = i_prod_0; } + break; + } + } + else if (! (gamma >= HYPRE_REAL_MIN)) { hypre_error_w_msg(HYPRE_ERROR_CONV, "Subnormal gamma value in PCG"); - - break; + if (print_level > 1 && my_id == 0) + { + hypre_printf("gamma %e", gamma); + } + if (skip_break < 1) + { + if (i == 1) { i_prod = i_prod_0; } + break; + } } /* ... gamma should be >=0. IEEE subnormal numbers are < 2**(-1022)=2.2e-308 (and >= 2**(-1074)=4.9e-324). So a gamma this small means we're getting @@ -700,26 +898,56 @@ hypre_PCGSolve( void *pcg_vdata, if (cf_tol > 0.0) { cf_ave_0 = cf_ave_1; - if (! (i_prod_0 > HYPRE_REAL_MIN) ) + /* i_prod_0 is zero, or (almost) subnormal, yet i_prod wasn't small + enough to pass the convergence test. Therefore initial guess was good, + and we're just calculating garbage - time to bail out before the + next step, which will be a divide by zero (or close to it). */ + if (i_prod_0 <= 0.0) { - /* i_prod_0 is zero, or (almost) subnormal, yet i_prod wasn't small - enough to pass the convergence test. Therefore initial guess was good, - and we're just calculating garbage - time to bail out before the - next step, which will be a divide by zero (or close to it). */ - hypre_error_w_msg(HYPRE_ERROR_CONV, "Subnormal i_prod value in PCG"); - - break; + if (print_level > 1 && my_id == 0) + { + hypre_printf("i_prod_0 %e", i_prod_0); + } + hypre_error_w_msg(HYPRE_ERROR_CONV, "Negative or zero i_prod_0 value in PCG"); + if (skip_break < 3) + { + break; + } + } + else if (! (i_prod_0 >= HYPRE_REAL_TRUE_MIN)) + { + hypre_error_w_msg(HYPRE_ERROR_CONV, "i_prod_0 value less than TRUE_MIN in PCG"); + if (print_level > 1 && my_id == 0) + { + hypre_printf("i_prod_0 %e", i_prod_0); + } + if (skip_break < 2) + { + break; + } + } + else if (! (i_prod_0 >= HYPRE_REAL_MIN)) + { + hypre_error_w_msg(HYPRE_ERROR_CONV, "Subnormal i_prod_0 value in PCG"); + if (print_level > 1 && my_id == 0) + { + hypre_printf("i_prod_0 %e", i_prod_0); + } + if (skip_break < 1) + { + break; + } } - cf_ave_1 = pow( i_prod / i_prod_0, 1.0/(2.0*i) ); + cf_ave_1 = hypre_pow( i_prod / i_prod_0, 1.0 / (2.0 * i) ); - weight = fabs(cf_ave_1 - cf_ave_0); + weight = hypre_abs(cf_ave_1 - cf_ave_0); weight = weight / hypre_max(cf_ave_1, cf_ave_0); weight = 1.0 - weight; #if 0 hypre_printf("I = %d: cf_new = %e, cf_old = %e, weight = %e\n", i, cf_ave_1, cf_ave_0, weight ); #endif - if (weight * cf_ave_1 > cf_tol) break; + if (weight * cf_ave_1 > cf_tol) { break; } } /*-------------------------------------------------------------------- @@ -727,7 +955,14 @@ hypre_PCGSolve( void *pcg_vdata, *--------------------------------------------------------------------*/ /* beta = gamma / gamma_old */ - beta = gamma / gamma_old; + if (!flex) + { + beta = gamma / gamma_old; + } + else + { + beta = delta / gamma_old; + } /* p = s + beta p */ if ( !recompute_true_residual ) @@ -736,26 +971,36 @@ hypre_PCGSolve( void *pcg_vdata, (*(pcg_functions->Axpy))(1.0, s, p); } else + { (*(pcg_functions->CopyVector))(s, p); + } } /*-------------------------------------------------------------------- * Finish up with some outputs. *--------------------------------------------------------------------*/ - if ( print_level > 1 && my_id==0 ) + if ( print_level > 1 && my_id == 0 ) + { hypre_printf("\n\n"); + } - if (i >= max_iter && (i_prod/bi_prod) >= eps && eps > 0 && hybrid != -1) - { - hypre_error_w_msg(HYPRE_ERROR_CONV, "Reached max iterations in PCG before convergence"); - } + if (i >= max_iter && (i_prod / bi_prod) >= eps && eps > 0 && hybrid != -1) + { + char msg[1024]; + hypre_sprintf(msg, "Reached max iterations %d in PCG before convergence", max_iter); + hypre_error_w_msg(HYPRE_ERROR_CONV, msg); + } (pcg_data -> num_iterations) = i; if (bi_prod > 0.0) - (pcg_data -> rel_residual_norm) = sqrt(i_prod/bi_prod); + { + (pcg_data -> rel_residual_norm) = hypre_sqrt(i_prod / bi_prod); + } else /* actually, we'll never get here... */ + { (pcg_data -> rel_residual_norm) = 0.0; + } HYPRE_ANNOTATE_FUNC_END; @@ -793,7 +1038,7 @@ hypre_PCGGetTol( void *pcg_vdata, HYPRE_Int hypre_PCGSetAbsoluteTol( void *pcg_vdata, - HYPRE_Real a_tol ) + HYPRE_Real a_tol ) { hypre_PCGData *pcg_data = (hypre_PCGData *)pcg_vdata; @@ -804,7 +1049,7 @@ hypre_PCGSetAbsoluteTol( void *pcg_vdata, HYPRE_Int hypre_PCGGetAbsoluteTol( void *pcg_vdata, - HYPRE_Real * a_tol ) + HYPRE_Real * a_tol ) { hypre_PCGData *pcg_data = (hypre_PCGData *)pcg_vdata; @@ -980,7 +1225,7 @@ hypre_PCGGetRelChange( void *pcg_vdata, HYPRE_Int hypre_PCGSetRecomputeResidual( void *pcg_vdata, - HYPRE_Int recompute_residual ) + HYPRE_Int recompute_residual ) { hypre_PCGData *pcg_data = (hypre_PCGData *)pcg_vdata; @@ -992,7 +1237,7 @@ hypre_PCGSetRecomputeResidual( void *pcg_vdata, HYPRE_Int hypre_PCGGetRecomputeResidual( void *pcg_vdata, - HYPRE_Int * recompute_residual ) + HYPRE_Int * recompute_residual ) { hypre_PCGData *pcg_data = (hypre_PCGData *)pcg_vdata; @@ -1008,7 +1253,7 @@ hypre_PCGGetRecomputeResidual( void *pcg_vdata, HYPRE_Int hypre_PCGSetRecomputeResidualP( void *pcg_vdata, - HYPRE_Int recompute_residual_p ) + HYPRE_Int recompute_residual_p ) { hypre_PCGData *pcg_data = (hypre_PCGData *)pcg_vdata; @@ -1019,7 +1264,7 @@ hypre_PCGSetRecomputeResidualP( void *pcg_vdata, HYPRE_Int hypre_PCGGetRecomputeResidualP( void *pcg_vdata, - HYPRE_Int * recompute_residual_p ) + HYPRE_Int * recompute_residual_p ) { hypre_PCGData *pcg_data = (hypre_PCGData *)pcg_vdata; @@ -1034,7 +1279,7 @@ hypre_PCGGetRecomputeResidualP( void *pcg_vdata, HYPRE_Int hypre_PCGSetStopCrit( void *pcg_vdata, - HYPRE_Int stop_crit ) + HYPRE_Int stop_crit ) { hypre_PCGData *pcg_data = (hypre_PCGData *)pcg_vdata; @@ -1046,7 +1291,7 @@ hypre_PCGSetStopCrit( void *pcg_vdata, HYPRE_Int hypre_PCGGetStopCrit( void *pcg_vdata, - HYPRE_Int * stop_crit ) + HYPRE_Int * stop_crit ) { hypre_PCGData *pcg_data = (hypre_PCGData *)pcg_vdata; @@ -1056,6 +1301,62 @@ hypre_PCGGetStopCrit( void *pcg_vdata, return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_PCGSetSkipBreak, hypre_PCGGetSkipBreak + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGSetSkipBreak( void *pcg_vdata, + HYPRE_Int skip_break ) +{ + hypre_PCGData *pcg_data = (hypre_PCGData *)pcg_vdata; + + + (pcg_data -> skip_break) = skip_break; + + return hypre_error_flag; +} + +HYPRE_Int +hypre_PCGGetSkipBreak( void *pcg_vdata, + HYPRE_Int * skip_break ) +{ + hypre_PCGData *pcg_data = (hypre_PCGData *)pcg_vdata; + + + *skip_break = (pcg_data -> skip_break); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_PCGSetFlex, hypre_PCGGetFlex + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGSetFlex( void *pcg_vdata, + HYPRE_Int flex ) +{ + hypre_PCGData *pcg_data = (hypre_PCGData *)pcg_vdata; + + + (pcg_data -> flex) = flex; + + return hypre_error_flag; +} + +HYPRE_Int +hypre_PCGGetFlex( void *pcg_vdata, + HYPRE_Int * flex ) +{ + hypre_PCGData *pcg_data = (hypre_PCGData *)pcg_vdata; + + + *flex = (pcg_data -> flex); + + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- * hypre_PCGGetPrecond *--------------------------------------------------------------------------*/ @@ -1066,7 +1367,6 @@ hypre_PCGGetPrecond( void *pcg_vdata, { hypre_PCGData *pcg_data = (hypre_PCGData *)pcg_vdata; - *precond_data_ptr = (HYPRE_Solver)(pcg_data -> precond_data); return hypre_error_flag; @@ -1078,14 +1378,13 @@ hypre_PCGGetPrecond( void *pcg_vdata, HYPRE_Int hypre_PCGSetPrecond( void *pcg_vdata, - HYPRE_Int (*precond)(void*,void*,void*,void*), - HYPRE_Int (*precond_setup)(void*,void*,void*,void*), + HYPRE_Int (*precond)(void*, void*, void*, void*), + HYPRE_Int (*precond_setup)(void*, void*, void*, void*), void *precond_data ) { hypre_PCGData *pcg_data = (hypre_PCGData *)pcg_vdata; hypre_PCGFunctions *pcg_functions = pcg_data->functions; - (pcg_functions -> precond) = precond; (pcg_functions -> precond_setup) = precond_setup; (pcg_data -> precond_data) = precond_data; @@ -1093,6 +1392,28 @@ hypre_PCGSetPrecond( void *pcg_vdata, return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_PCGSetPreconditioner + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGSetPreconditioner(void *pcg_vdata, + void *precond_data ) +{ + hypre_PCGData *pcg_data = (hypre_PCGData*) pcg_vdata; + hypre_Solver *base = (hypre_Solver*) precond_data; + hypre_PCGFunctions *pcg_functions = pcg_data->functions; + + (pcg_data -> precond_data) = precond_data; + + (pcg_functions -> precond) = (HYPRE_Int (*)(void*, void*, void*, + void*)) hypre_SolverSolve(base); + (pcg_functions -> precond_setup) = (HYPRE_Int (*)(void*, void*, void*, + void*)) hypre_SolverSetup(base); + + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- * hypre_PCGSetPrintLevel, hypre_PCGGetPrintLevel *--------------------------------------------------------------------------*/ @@ -1127,7 +1448,7 @@ hypre_PCGGetPrintLevel( void *pcg_vdata, HYPRE_Int hypre_PCGSetLogging( void *pcg_vdata, - HYPRE_Int level) + HYPRE_Int level) { hypre_PCGData *pcg_data = (hypre_PCGData *)pcg_vdata; @@ -1138,7 +1459,7 @@ hypre_PCGSetLogging( void *pcg_vdata, HYPRE_Int hypre_PCGGetLogging( void *pcg_vdata, - HYPRE_Int * level) + HYPRE_Int * level) { hypre_PCGData *pcg_data = (hypre_PCGData *)pcg_vdata; @@ -1149,7 +1470,7 @@ hypre_PCGGetLogging( void *pcg_vdata, HYPRE_Int hypre_PCGSetHybrid( void *pcg_vdata, - HYPRE_Int level) + HYPRE_Int level) { hypre_PCGData *pcg_data = (hypre_PCGData *)pcg_vdata; @@ -1232,7 +1553,7 @@ hypre_PCGGetFinalRelativeResidualNorm( void *pcg_vdata, HYPRE_Real rel_residual_norm = (pcg_data -> rel_residual_norm); - *relative_residual_norm = rel_residual_norm; + *relative_residual_norm = rel_residual_norm; return hypre_error_flag; } diff --git a/external/hypre/src/krylov/pcg.h b/external/hypre/src/krylov/pcg.h index bde899d7..e9493207 100644 --- a/external/hypre/src/krylov/pcg.h +++ b/external/hypre/src/krylov/pcg.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -102,6 +102,7 @@ typedef struct every "recompute_residual_p" iterations. This can be expensive and degrade the convergence. Use it only if you have seen a problem with the regular residual computation. + - skip_break means that cg will not stop for very small alpha and gamma. default: 0 */ typedef struct @@ -119,12 +120,16 @@ typedef struct HYPRE_Int stop_crit; HYPRE_Int converged; HYPRE_Int hybrid; + HYPRE_Int skip_break; + HYPRE_Int flex; void *A; void *p; void *s; void *r; /* ...contains the residual. This is currently kept permanently. If that is ever changed, it still must be kept if logging>1 */ + void *r_old; /* old residual needed for flexible CG, PR method */ + void *v; /* work vector only needed if recompute_residual_p uis used */ HYPRE_Int owns_matvec_data; /* normally 1; if 0, don't delete it */ void *matvec_data; @@ -181,7 +186,7 @@ hypre_PCGFunctionsCreate( HYPRE_Int (*Axpy) ( HYPRE_Complex alpha, void *x, void *y ), HYPRE_Int (*PrecondSetup) ( void *vdata, void *A, void *b, void *x ), HYPRE_Int (*Precond) ( void *vdata, void *A, void *b, void *x ) - ); +); /** * Description... diff --git a/external/hypre/src/lapack/CMakeLists.txt b/external/hypre/src/lapack/CMakeLists.txt index 59b70647..f08f5633 100644 --- a/external/hypre/src/lapack/CMakeLists.txt +++ b/external/hypre/src/lapack/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/lapack/README b/external/hypre/src/lapack/README index b59c90bb..fc2e5d1e 100644 --- a/external/hypre/src/lapack/README +++ b/external/hypre/src/lapack/README @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/lapack/_hypre_lapack.h b/external/hypre/src/lapack/_hypre_lapack.h index f68ea60c..12932a68 100644 --- a/external/hypre/src/lapack/_hypre_lapack.h +++ b/external/hypre/src/lapack/_hypre_lapack.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/lapack/dbdsqr.c b/external/hypre/src/lapack/dbdsqr.c index d1437464..b97a8387 100644 --- a/external/hypre/src/lapack/dbdsqr.c +++ b/external/hypre/src/lapack/dbdsqr.c @@ -13,20 +13,13 @@ extern "C" { -lf2c -lm (in that order) */ -/* Table of constant values */ - -static doublereal c_b15 = -.125; -static integer c__1 = 1; -static doublereal c_b49 = 1.; -static doublereal c_b72 = -1.; - /* Subroutine */ integer dbdsqr_(const char *uplo, integer *n, integer *ncvt, integer * - nru, integer *ncc, doublereal *d__, doublereal *e, doublereal *vt, + nru, integer *ncc, doublereal *d__, doublereal *e, doublereal *vt, integer *ldvt, doublereal *u, integer *ldu, doublereal *c__, integer * ldc, doublereal *work, integer *info) { /* System generated locals */ - integer c_dim1, c_offset, u_dim1, u_offset, vt_dim1, vt_offset, i__1, + integer c_dim1, c_offset, u_dim1, u_offset, vt_dim1, vt_offset, i__1, i__2; doublereal d__1, d__2, d__3, d__4; @@ -35,181 +28,187 @@ static doublereal c_b72 = -1.; doublereal *, doublereal *); /* Local variables */ - static doublereal abse; - static integer idir; - static doublereal abss; - static integer oldm; - static doublereal cosl; - static integer isub, iter; - static doublereal unfl, sinl, cosr, smin, smax, sinr; - extern /* Subroutine */ integer drot_(integer *, doublereal *, integer *, + doublereal abse; + integer idir; + doublereal abss; + integer oldm; + doublereal cosl; + integer isub, iter; + doublereal unfl, sinl, cosr, smin, smax, sinr; + extern /* Subroutine */ integer drot_(integer *, doublereal *, integer *, doublereal *, integer *, doublereal *, doublereal *), dlas2_( - doublereal *, doublereal *, doublereal *, doublereal *, + doublereal *, doublereal *, doublereal *, doublereal *, doublereal *); - static doublereal f, g, h__; - static integer i__, j, m; - static doublereal r__; - extern /* Subroutine */ integer dscal_(integer *, doublereal *, doublereal *, + doublereal f, g, h__; + integer i__, j, m; + doublereal r__; + extern /* Subroutine */ integer dscal_(integer *, doublereal *, doublereal *, integer *); extern logical lsame_(const char *,const char *); - static doublereal oldcs; - extern /* Subroutine */ integer dlasr_(const char *,const char *,const char *, integer *, + doublereal oldcs; + extern /* Subroutine */ integer dlasr_(const char *,const char *,const char *, integer *, integer *, doublereal *, doublereal *, doublereal *, integer *); - static integer oldll; - static doublereal shift, sigmn, oldsn; - extern /* Subroutine */ integer dswap_(integer *, doublereal *, integer *, + integer oldll; + doublereal shift, sigmn, oldsn; + extern /* Subroutine */ integer dswap_(integer *, doublereal *, integer *, doublereal *, integer *); - static integer maxit; - static doublereal sminl, sigmx; - static logical lower; + integer maxit; + doublereal sminl, sigmx; + logical lower; extern /* Subroutine */ integer dlasq1_(integer *, doublereal *, doublereal *, - doublereal *, integer *), dlasv2_(doublereal *, doublereal *, - doublereal *, doublereal *, doublereal *, doublereal *, + doublereal *, integer *), dlasv2_(doublereal *, doublereal *, + doublereal *, doublereal *, doublereal *, doublereal *, doublereal *, doublereal *, doublereal *); - static doublereal cs; - static integer ll; + doublereal cs; + integer ll; extern doublereal dlamch_(const char *); - static doublereal sn, mu; - extern /* Subroutine */ integer dlartg_(doublereal *, doublereal *, - doublereal *, doublereal *, doublereal *), xerbla_(const char *, + doublereal sn, mu; + extern /* Subroutine */ integer dlartg_(doublereal *, doublereal *, + doublereal *, doublereal *, doublereal *), xerbla_(const char *, integer *); - static doublereal sminoa, thresh; - static logical rotate; - static integer nm1; - static doublereal tolmul; - static integer nm12, nm13, lll; - static doublereal eps, sll, tol; + doublereal sminoa, thresh; + logical rotate; + integer nm1; + doublereal tolmul; + integer nm12, nm13, lll; + doublereal eps, sll, tol; + + /* Table of constant values */ + doublereal c_b15 = -.125; + integer c__1 = 1; + doublereal c_b49 = 1.; + doublereal c_b72 = -1.; #define c___ref(a_1,a_2) c__[(a_2)*c_dim1 + a_1] #define u_ref(a_1,a_2) u[(a_2)*u_dim1 + a_1] #define vt_ref(a_1,a_2) vt[(a_2)*vt_dim1 + a_1] -/* -- LAPACK routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - October 31, 1999 - - - Purpose - ======= - - DBDSQR computes the singular value decomposition (SVD) of a real - N-by-N (upper or lower) bidiagonal matrix B: B = Q * S * P' (P' - denotes the transpose of P), where S is a diagonal matrix with - non-negative diagonal elements (the singular values of B), and Q - and P are orthogonal matrices. - - The routine computes S, and optionally computes U * Q, P' * VT, - or Q' * C, for given real input matrices U, VT, and C. - - See "Computing Small Singular Values of Bidiagonal Matrices With - Guaranteed High Relative Accuracy," by J. Demmel and W. Kahan, - LAPACK Working Note #3 (or SIAM J. Sci. Statist. Comput. vol. 11, - no. 5, pp. 873-912, Sept 1990) and - "Accurate singular values and differential qd algorithms," by - B. Parlett and V. Fernando, Technical Report CPAM-554, Mathematics - Department, University of California at Berkeley, July 1992 - for a detailed description of the algorithm. - - Arguments - ========= - - UPLO (input) CHARACTER*1 - = 'U': B is upper bidiagonal; - = 'L': B is lower bidiagonal. - - N (input) INTEGER - The order of the matrix B. N >= 0. - - NCVT (input) INTEGER - The number of columns of the matrix VT. NCVT >= 0. - - NRU (input) INTEGER - The number of rows of the matrix U. NRU >= 0. - - NCC (input) INTEGER - The number of columns of the matrix C. NCC >= 0. - - D (input/output) DOUBLE PRECISION array, dimension (N) - On entry, the n diagonal elements of the bidiagonal matrix B. - On exit, if INFO=0, the singular values of B in decreasing - order. - - E (input/output) DOUBLE PRECISION array, dimension (N) - On entry, the elements of E contain the - offdiagonal elements of the bidiagonal matrix whose SVD - is desired. On normal exit (INFO = 0), E is destroyed. - If the algorithm does not converge (INFO > 0), D and E - will contain the diagonal and superdiagonal elements of a - bidiagonal matrix orthogonally equivalent to the one given - as input. E(N) is used for workspace. - - VT (input/output) DOUBLE PRECISION array, dimension (LDVT, NCVT) - On entry, an N-by-NCVT matrix VT. - On exit, VT is overwritten by P' * VT. - VT is not referenced if NCVT = 0. - - LDVT (input) INTEGER - The leading dimension of the array VT. - LDVT >= max(1,N) if NCVT > 0; LDVT >= 1 if NCVT = 0. - - U (input/output) DOUBLE PRECISION array, dimension (LDU, N) - On entry, an NRU-by-N matrix U. - On exit, U is overwritten by U * Q. - U is not referenced if NRU = 0. - - LDU (input) INTEGER - The leading dimension of the array U. LDU >= max(1,NRU). - - C (input/output) DOUBLE PRECISION array, dimension (LDC, NCC) - On entry, an N-by-NCC matrix C. - On exit, C is overwritten by Q' * C. - C is not referenced if NCC = 0. - - LDC (input) INTEGER - The leading dimension of the array C. - LDC >= max(1,N) if NCC > 0; LDC >=1 if NCC = 0. - - WORK (workspace) DOUBLE PRECISION array, dimension (4*N) - - INFO (output) INTEGER - = 0: successful exit - < 0: If INFO = -i, the i-th argument had an illegal value - > 0: the algorithm did not converge; D and E contain the - elements of a bidiagonal matrix which is orthogonally - similar to the input matrix B; if INFO = i, i - elements of E have not converged to zero. - - Internal Parameters - =================== - - TOLMUL DOUBLE PRECISION, default = max(10,min(100,EPS**(-1/8))) - TOLMUL controls the convergence criterion of the QR loop. - If it is positive, TOLMUL*EPS is the desired relative - precision in the computed singular values. - If it is negative, abs(TOLMUL*EPS*sigma_max) is the - desired absolute accuracy in the computed singular - values (corresponds to relative accuracy - abs(TOLMUL*EPS) in the largest singular value. - abs(TOLMUL) should be between 1 and 1/EPS, and preferably - between 10 (for fast convergence) and .1/EPS - (for there to be some accuracy in the results). - Default is to lose at either one eighth or 2 of the - available decimal digits in each computed singular value - (whichever is smaller). - - MAXITR INTEGER, default = 6 - MAXITR controls the maximum number of passes of the - algorithm through its inner loop. The algorithms stops - (and so fails to converge) if the number of passes - through the inner loop exceeds MAXITR*N**2. - - ===================================================================== - - - Test the input parameters. +/* -- LAPACK routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + October 31, 1999 + + + Purpose + ======= + + DBDSQR computes the singular value decomposition (SVD) of a real + N-by-N (upper or lower) bidiagonal matrix B: B = Q * S * P' (P' + denotes the transpose of P), where S is a diagonal matrix with + non-negative diagonal elements (the singular values of B), and Q + and P are orthogonal matrices. + + The routine computes S, and optionally computes U * Q, P' * VT, + or Q' * C, for given real input matrices U, VT, and C. + + See "Computing Small Singular Values of Bidiagonal Matrices With + Guaranteed High Relative Accuracy," by J. Demmel and W. Kahan, + LAPACK Working Note #3 (or SIAM J. Sci. Statist. Comput. vol. 11, + no. 5, pp. 873-912, Sept 1990) and + "Accurate singular values and differential qd algorithms," by + B. Parlett and V. Fernando, Technical Report CPAM-554, Mathematics + Department, University of California at Berkeley, July 1992 + for a detailed description of the algorithm. + + Arguments + ========= + + UPLO (input) CHARACTER*1 + = 'U': B is upper bidiagonal; + = 'L': B is lower bidiagonal. + + N (input) INTEGER + The order of the matrix B. N >= 0. + + NCVT (input) INTEGER + The number of columns of the matrix VT. NCVT >= 0. + + NRU (input) INTEGER + The number of rows of the matrix U. NRU >= 0. + + NCC (input) INTEGER + The number of columns of the matrix C. NCC >= 0. + + D (input/output) DOUBLE PRECISION array, dimension (N) + On entry, the n diagonal elements of the bidiagonal matrix B. + On exit, if INFO=0, the singular values of B in decreasing + order. + + E (input/output) DOUBLE PRECISION array, dimension (N) + On entry, the elements of E contain the + offdiagonal elements of the bidiagonal matrix whose SVD + is desired. On normal exit (INFO = 0), E is destroyed. + If the algorithm does not converge (INFO > 0), D and E + will contain the diagonal and superdiagonal elements of a + bidiagonal matrix orthogonally equivalent to the one given + as input. E(N) is used for workspace. + + VT (input/output) DOUBLE PRECISION array, dimension (LDVT, NCVT) + On entry, an N-by-NCVT matrix VT. + On exit, VT is overwritten by P' * VT. + VT is not referenced if NCVT = 0. + + LDVT (input) INTEGER + The leading dimension of the array VT. + LDVT >= max(1,N) if NCVT > 0; LDVT >= 1 if NCVT = 0. + + U (input/output) DOUBLE PRECISION array, dimension (LDU, N) + On entry, an NRU-by-N matrix U. + On exit, U is overwritten by U * Q. + U is not referenced if NRU = 0. + + LDU (input) INTEGER + The leading dimension of the array U. LDU >= max(1,NRU). + + C (input/output) DOUBLE PRECISION array, dimension (LDC, NCC) + On entry, an N-by-NCC matrix C. + On exit, C is overwritten by Q' * C. + C is not referenced if NCC = 0. + + LDC (input) INTEGER + The leading dimension of the array C. + LDC >= max(1,N) if NCC > 0; LDC >=1 if NCC = 0. + + WORK (workspace) DOUBLE PRECISION array, dimension (4*N) + + INFO (output) INTEGER + = 0: successful exit + < 0: If INFO = -i, the i-th argument had an illegal value + > 0: the algorithm did not converge; D and E contain the + elements of a bidiagonal matrix which is orthogonally + similar to the input matrix B; if INFO = i, i + elements of E have not converged to zero. + + Internal Parameters + =================== + + TOLMUL DOUBLE PRECISION, default = max(10,min(100,EPS**(-1/8))) + TOLMUL controls the convergence criterion of the QR loop. + If it is positive, TOLMUL*EPS is the desired relative + precision in the computed singular values. + If it is negative, abs(TOLMUL*EPS*sigma_max) is the + desired absolute accuracy in the computed singular + values (corresponds to relative accuracy + abs(TOLMUL*EPS) in the largest singular value. + abs(TOLMUL) should be between 1 and 1/EPS, and preferably + between 10 (for fast convergence) and .1/EPS + (for there to be some accuracy in the results). + Default is to lose at either one eighth or 2 of the + available decimal digits in each computed singular value + (whichever is smaller). + + MAXITR INTEGER, default = 6 + MAXITR controls the maximum number of passes of the + algorithm through its inner loop. The algorithms stops + (and so fails to converge) if the number of passes + through the inner loop exceeds MAXITR*N**2. + + ===================================================================== + + + Test the input parameters. Parameter adjustments */ --d__; @@ -238,12 +237,12 @@ static doublereal c_b72 = -1.; *info = -4; } else if (*ncc < 0) { *info = -5; - } else if (((*ncvt == 0) && (*ldvt < 1)) || + } else if (((*ncvt == 0) && (*ldvt < 1)) || ((*ncvt > 0) && (*ldvt < max(1,*n)))) { *info = -9; } else if (*ldu < max(1,*nru)) { *info = -11; - } else if (((*ncc == 0) && (*ldc < 1)) || + } else if (((*ncc == 0) && (*ldc < 1)) || ((*ncc > 0) && (*ldc < max(1,*n)))) { *info = -13; } @@ -280,7 +279,7 @@ static doublereal c_b72 = -1.; eps = dlamch_("Epsilon"); unfl = dlamch_("Safe minimum"); -/* If matrix lower bidiagonal, rotate to be upper bidiagonal +/* If matrix lower bidiagonal, rotate to be upper bidiagonal by applying Givens rotations on the left */ if (lower) { @@ -298,7 +297,7 @@ static doublereal c_b72 = -1.; /* Update singular vectors if desired */ if (*nru > 0) { - dlasr_("R", "V", "F", nru, n, &work[1], &work[*n], &u[u_offset], + dlasr_("R", "V", "F", nru, n, &work[1], &work[*n], &u[u_offset], ldu); } if (*ncc > 0) { @@ -307,11 +306,11 @@ static doublereal c_b72 = -1.; } } -/* Compute singular values to relative accuracy TOL - (By setting TOL to be negative, algorithm will compute - singular values to absolute accuracy ABS(TOL)*norm(input matrix)) +/* Compute singular values to relative accuracy TOL + (By setting TOL to be negative, algorithm will compute + singular values to absolute accuracy ABS(TOL)*norm(input matrix)) - Computing MAX + Computing MAX Computing MIN */ d__3 = 100., d__4 = pow_dd(&eps, &c_b15); d__1 = 10., d__2 = min(d__3,d__4); @@ -362,15 +361,15 @@ static doublereal c_b72 = -1.; thresh = max(d__1,d__2); } else { -/* Absolute accuracy desired +/* Absolute accuracy desired Computing MAX */ d__1 = abs(tol) * smax, d__2 = *n * 6 * *n * unfl; thresh = max(d__1,d__2); } -/* Prepare for main iteration loop for the singular values - (MAXIT is the maximum number of passes through the inner +/* Prepare for main iteration loop for the singular values + (MAXIT is the maximum number of passes through the inner loop permitted before nonconvergence signalled.) */ maxit = *n * 6 * *n; @@ -466,7 +465,7 @@ static doublereal c_b72 = -1.; goto L60; } -/* If working on new submatrix, choose shift direction +/* If working on new submatrix, choose shift direction (from larger end diagonal element towards smaller) */ if (ll > oldm || m < oldll) { @@ -487,7 +486,7 @@ static doublereal c_b72 = -1.; if (idir == 1) { -/* Run convergence test in forward direction +/* Run convergence test in forward direction First apply standard test to bottom of matrix */ if ((d__2 = e[m - 1], abs(d__2)) <= abs(tol) * (d__1 = d__[m], abs( @@ -499,7 +498,7 @@ static doublereal c_b72 = -1.; if (tol >= 0.) { -/* If relative accuracy desired, +/* If relative accuracy desired, apply convergence criterion forward */ mu = (d__1 = d__[ll], abs(d__1)); @@ -519,7 +518,7 @@ static doublereal c_b72 = -1.; } else { -/* Run convergence test in backward direction +/* Run convergence test in backward direction First apply standard test to top of matrix */ if ((d__2 = e[ll], abs(d__2)) <= abs(tol) * (d__1 = d__[ll], abs(d__1) @@ -530,7 +529,7 @@ static doublereal c_b72 = -1.; if (tol >= 0.) { -/* If relative accuracy desired, +/* If relative accuracy desired, apply convergence criterion backward */ mu = (d__1 = d__[m], abs(d__1)); @@ -551,8 +550,8 @@ static doublereal c_b72 = -1.; oldll = ll; oldm = m; -/* Compute shift. First, test if shifting would ruin relative - accuracy, and if so set the shift to zero. +/* Compute shift. First, test if shifting would ruin relative + accuracy, and if so set the shift to zero. Computing MAX */ d__1 = eps, d__2 = tol * .01; @@ -593,7 +592,7 @@ static doublereal c_b72 = -1.; if (shift == 0.) { if (idir == 1) { -/* Chase bulge from top to bottom +/* Chase bulge from top to bottom Save cosines and sines for later singular vector updates */ cs = 1.; @@ -627,12 +626,12 @@ static doublereal c_b72 = -1.; } if (*nru > 0) { i__1 = m - ll + 1; - dlasr_("R", "V", "F", nru, &i__1, &work[nm12 + 1], &work[nm13 + dlasr_("R", "V", "F", nru, &i__1, &work[nm12 + 1], &work[nm13 + 1], &u_ref(1, ll), ldu); } if (*ncc > 0) { i__1 = m - ll + 1; - dlasr_("L", "V", "F", &i__1, ncc, &work[nm12 + 1], &work[nm13 + dlasr_("L", "V", "F", &i__1, ncc, &work[nm12 + 1], &work[nm13 + 1], &c___ref(ll, 1), ldc); } @@ -644,7 +643,7 @@ static doublereal c_b72 = -1.; } else { -/* Chase bulge from bottom to top +/* Chase bulge from bottom to top Save cosines and sines for later singular vector updates */ cs = 1.; @@ -699,7 +698,7 @@ static doublereal c_b72 = -1.; if (idir == 1) { -/* Chase bulge from top to bottom +/* Chase bulge from top to bottom Save cosines and sines for later singular vector updates */ f = ((d__1 = d__[ll], abs(d__1)) - shift) * (d_sign(&c_b49, &d__[ @@ -740,12 +739,12 @@ static doublereal c_b72 = -1.; } if (*nru > 0) { i__1 = m - ll + 1; - dlasr_("R", "V", "F", nru, &i__1, &work[nm12 + 1], &work[nm13 + dlasr_("R", "V", "F", nru, &i__1, &work[nm12 + 1], &work[nm13 + 1], &u_ref(1, ll), ldu); } if (*ncc > 0) { i__1 = m - ll + 1; - dlasr_("L", "V", "F", &i__1, ncc, &work[nm12 + 1], &work[nm13 + dlasr_("L", "V", "F", &i__1, ncc, &work[nm12 + 1], &work[nm13 + 1], &c___ref(ll, 1), ldc); } @@ -757,7 +756,7 @@ static doublereal c_b72 = -1.; } else { -/* Chase bulge from bottom to top +/* Chase bulge from bottom to top Save cosines and sines for later singular vector updates */ f = ((d__1 = d__[m], abs(d__1)) - shift) * (d_sign(&c_b49, &d__[m] @@ -836,7 +835,7 @@ static doublereal c_b72 = -1.; /* L170: */ } -/* Sort the singular values into decreasing order (insertion sort on +/* Sort the singular values into decreasing order (insertion sort on singular values, but only one transposition per singular vector) */ i__1 = *n - 1; diff --git a/external/hypre/src/lapack/dgebd2.c b/external/hypre/src/lapack/dgebd2.c index 180ec0d6..c9b5104b 100644 --- a/external/hypre/src/lapack/dgebd2.c +++ b/external/hypre/src/lapack/dgebd2.c @@ -12,137 +12,137 @@ extern "C" { lda, doublereal *d__, doublereal *e, doublereal *tauq, doublereal * taup, doublereal *work, integer *info) { -/* -- LAPACK routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - February 29, 1992 +/* -- LAPACK routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + February 29, 1992 - Purpose - ======= + Purpose + ======= - DGEBD2 reduces a real general m by n matrix A to upper or lower - bidiagonal form B by an orthogonal transformation: Q' * A * P = B. + DGEBD2 reduces a real general m by n matrix A to upper or lower + bidiagonal form B by an orthogonal transformation: Q' * A * P = B. - If m >= n, B is upper bidiagonal; if m < n, B is lower bidiagonal. + If m >= n, B is upper bidiagonal; if m < n, B is lower bidiagonal. - Arguments - ========= + Arguments + ========= - M (input) INTEGER - The number of rows in the matrix A. M >= 0. + M (input) INTEGER + The number of rows in the matrix A. M >= 0. - N (input) INTEGER - The number of columns in the matrix A. N >= 0. + N (input) INTEGER + The number of columns in the matrix A. N >= 0. - A (input/output) DOUBLE PRECISION array, dimension (LDA,N) - On entry, the m by n general matrix to be reduced. - On exit, - if m >= n, the diagonal and the first superdiagonal are - overwritten with the upper bidiagonal matrix B; the - elements below the diagonal, with the array TAUQ, represent - the orthogonal matrix Q as a product of elementary - reflectors, and the elements above the first superdiagonal, - with the array TAUP, represent the orthogonal matrix P as - a product of elementary reflectors; - if m < n, the diagonal and the first subdiagonal are - overwritten with the lower bidiagonal matrix B; the - elements below the first subdiagonal, with the array TAUQ, - represent the orthogonal matrix Q as a product of - elementary reflectors, and the elements above the diagonal, - with the array TAUP, represent the orthogonal matrix P as - a product of elementary reflectors. - See Further Details. + A (input/output) DOUBLE PRECISION array, dimension (LDA,N) + On entry, the m by n general matrix to be reduced. + On exit, + if m >= n, the diagonal and the first superdiagonal are + overwritten with the upper bidiagonal matrix B; the + elements below the diagonal, with the array TAUQ, represent + the orthogonal matrix Q as a product of elementary + reflectors, and the elements above the first superdiagonal, + with the array TAUP, represent the orthogonal matrix P as + a product of elementary reflectors; + if m < n, the diagonal and the first subdiagonal are + overwritten with the lower bidiagonal matrix B; the + elements below the first subdiagonal, with the array TAUQ, + represent the orthogonal matrix Q as a product of + elementary reflectors, and the elements above the diagonal, + with the array TAUP, represent the orthogonal matrix P as + a product of elementary reflectors. + See Further Details. - LDA (input) INTEGER - The leading dimension of the array A. LDA >= max(1,M). + LDA (input) INTEGER + The leading dimension of the array A. LDA >= max(1,M). - D (output) DOUBLE PRECISION array, dimension (min(M,N)) - The diagonal elements of the bidiagonal matrix B: - D(i) = A(i,i). + D (output) DOUBLE PRECISION array, dimension (min(M,N)) + The diagonal elements of the bidiagonal matrix B: + D(i) = A(i,i). - E (output) DOUBLE PRECISION array, dimension (min(M,N)-1) - The off-diagonal elements of the bidiagonal matrix B: - if m >= n, E(i) = A(i,i+1) for i = 1,2,...,n-1; - if m < n, E(i) = A(i+1,i) for i = 1,2,...,m-1. + E (output) DOUBLE PRECISION array, dimension (min(M,N)-1) + The off-diagonal elements of the bidiagonal matrix B: + if m >= n, E(i) = A(i,i+1) for i = 1,2,...,n-1; + if m < n, E(i) = A(i+1,i) for i = 1,2,...,m-1. - TAUQ (output) DOUBLE PRECISION array dimension (min(M,N)) - The scalar factors of the elementary reflectors which - represent the orthogonal matrix Q. See Further Details. + TAUQ (output) DOUBLE PRECISION array dimension (min(M,N)) + The scalar factors of the elementary reflectors which + represent the orthogonal matrix Q. See Further Details. - TAUP (output) DOUBLE PRECISION array, dimension (min(M,N)) - The scalar factors of the elementary reflectors which - represent the orthogonal matrix P. See Further Details. + TAUP (output) DOUBLE PRECISION array, dimension (min(M,N)) + The scalar factors of the elementary reflectors which + represent the orthogonal matrix P. See Further Details. - WORK (workspace) DOUBLE PRECISION array, dimension (max(M,N)) + WORK (workspace) DOUBLE PRECISION array, dimension (max(M,N)) - INFO (output) INTEGER - = 0: successful exit. - < 0: if INFO = -i, the i-th argument had an illegal value. + INFO (output) INTEGER + = 0: successful exit. + < 0: if INFO = -i, the i-th argument had an illegal value. - Further Details - =============== + Further Details + =============== - The matrices Q and P are represented as products of elementary - reflectors: + The matrices Q and P are represented as products of elementary + reflectors: - If m >= n, + If m >= n, - Q = H(1) H(2) . . . H(n) and P = G(1) G(2) . . . G(n-1) + Q = H(1) H(2) . . . H(n) and P = G(1) G(2) . . . G(n-1) - Each H(i) and G(i) has the form: + Each H(i) and G(i) has the form: - H(i) = I - tauq * v * v' and G(i) = I - taup * u * u' + H(i) = I - tauq * v * v' and G(i) = I - taup * u * u' - where tauq and taup are real scalars, and v and u are real vectors; - v(1:i-1) = 0, v(i) = 1, and v(i+1:m) is stored on exit in A(i+1:m,i); - u(1:i) = 0, u(i+1) = 1, and u(i+2:n) is stored on exit in A(i,i+2:n); - tauq is stored in TAUQ(i) and taup in TAUP(i). + where tauq and taup are real scalars, and v and u are real vectors; + v(1:i-1) = 0, v(i) = 1, and v(i+1:m) is stored on exit in A(i+1:m,i); + u(1:i) = 0, u(i+1) = 1, and u(i+2:n) is stored on exit in A(i,i+2:n); + tauq is stored in TAUQ(i) and taup in TAUP(i). - If m < n, + If m < n, - Q = H(1) H(2) . . . H(m-1) and P = G(1) G(2) . . . G(m) + Q = H(1) H(2) . . . H(m-1) and P = G(1) G(2) . . . G(m) - Each H(i) and G(i) has the form: + Each H(i) and G(i) has the form: - H(i) = I - tauq * v * v' and G(i) = I - taup * u * u' + H(i) = I - tauq * v * v' and G(i) = I - taup * u * u' - where tauq and taup are real scalars, and v and u are real vectors; - v(1:i) = 0, v(i+1) = 1, and v(i+2:m) is stored on exit in A(i+2:m,i); - u(1:i-1) = 0, u(i) = 1, and u(i+1:n) is stored on exit in A(i,i+1:n); - tauq is stored in TAUQ(i) and taup in TAUP(i). + where tauq and taup are real scalars, and v and u are real vectors; + v(1:i) = 0, v(i+1) = 1, and v(i+2:m) is stored on exit in A(i+2:m,i); + u(1:i-1) = 0, u(i) = 1, and u(i+1:n) is stored on exit in A(i,i+1:n); + tauq is stored in TAUQ(i) and taup in TAUP(i). - The contents of A on exit are illustrated by the following examples: + The contents of A on exit are illustrated by the following examples: - m = 6 and n = 5 (m > n): m = 5 and n = 6 (m < n): + m = 6 and n = 5 (m > n): m = 5 and n = 6 (m < n): - ( d e u1 u1 u1 ) ( d u1 u1 u1 u1 u1 ) - ( v1 d e u2 u2 ) ( e d u2 u2 u2 u2 ) - ( v1 v2 d e u3 ) ( v1 e d u3 u3 u3 ) - ( v1 v2 v3 d e ) ( v1 v2 e d u4 u4 ) - ( v1 v2 v3 v4 d ) ( v1 v2 v3 e d u5 ) - ( v1 v2 v3 v4 v5 ) + ( d e u1 u1 u1 ) ( d u1 u1 u1 u1 u1 ) + ( v1 d e u2 u2 ) ( e d u2 u2 u2 u2 ) + ( v1 v2 d e u3 ) ( v1 e d u3 u3 u3 ) + ( v1 v2 v3 d e ) ( v1 v2 e d u4 u4 ) + ( v1 v2 v3 v4 d ) ( v1 v2 v3 e d u5 ) + ( v1 v2 v3 v4 v5 ) - where d and e denote diagonal and off-diagonal elements of B, vi - denotes an element of the vector defining H(i), and ui an element of - the vector defining G(i). + where d and e denote diagonal and off-diagonal elements of B, vi + denotes an element of the vector defining H(i), and ui an element of + the vector defining G(i). - ===================================================================== + ===================================================================== - Test the input parameters + Test the input parameters Parameter adjustments */ /* Table of constant values */ - static integer c__1 = 1; - + integer c__1 = 1; + /* System generated locals */ integer a_dim1, a_offset, i__1, i__2, i__3, i__4; /* Local variables */ - static integer i__; - extern /* Subroutine */ integer dlarf_(const char *, integer *, integer *, - doublereal *, integer *, doublereal *, doublereal *, integer *, - doublereal *), dlarfg_(integer *, doublereal *, + integer i__; + extern /* Subroutine */ integer dlarf_(const char *, integer *, integer *, + doublereal *, integer *, doublereal *, doublereal *, integer *, + doublereal *), dlarfg_(integer *, doublereal *, doublereal *, integer *, doublereal *), xerbla_(const char *, integer *); #define a_ref(a_1,a_2) a[(a_2)*a_dim1 + a_1] @@ -178,7 +178,7 @@ extern "C" { i__1 = *n; for (i__ = 1; i__ <= i__1; ++i__) { -/* Generate elementary reflector H(i) to annihilate A(i+1:m,i) +/* Generate elementary reflector H(i) to annihilate A(i+1:m,i) Computing MIN */ i__2 = i__ + 1; @@ -192,14 +192,14 @@ extern "C" { i__2 = *m - i__ + 1; i__3 = *n - i__; - dlarf_("Left", &i__2, &i__3, &a_ref(i__, i__), &c__1, &tauq[i__], + dlarf_("Left", &i__2, &i__3, &a_ref(i__, i__), &c__1, &tauq[i__], &a_ref(i__, i__ + 1), lda, &work[1]); a_ref(i__, i__) = d__[i__]; if (i__ < *n) { -/* Generate elementary reflector G(i) to annihilate - A(i,i+2:n) +/* Generate elementary reflector G(i) to annihilate + A(i,i+2:n) Computing MIN */ i__2 = i__ + 2; @@ -228,7 +228,7 @@ extern "C" { i__1 = *m; for (i__ = 1; i__ <= i__1; ++i__) { -/* Generate elementary reflector G(i) to annihilate A(i,i+1:n) +/* Generate elementary reflector G(i) to annihilate A(i,i+1:n) Computing MIN */ i__2 = i__ + 1; @@ -238,7 +238,7 @@ extern "C" { d__[i__] = a_ref(i__, i__); a_ref(i__, i__) = 1.; -/* Apply G(i) to A(i+1:m,i:n) from the right +/* Apply G(i) to A(i+1:m,i:n) from the right Computing MIN */ i__2 = i__ + 1; @@ -250,8 +250,8 @@ extern "C" { if (i__ < *m) { -/* Generate elementary reflector H(i) to annihilate - A(i+2:m,i) +/* Generate elementary reflector H(i) to annihilate + A(i+2:m,i) Computing MIN */ i__2 = i__ + 2; diff --git a/external/hypre/src/lapack/dgebrd.c b/external/hypre/src/lapack/dgebrd.c index f1c79983..5f1f68c1 100644 --- a/external/hypre/src/lapack/dgebrd.c +++ b/external/hypre/src/lapack/dgebrd.c @@ -12,168 +12,168 @@ extern "C" { lda, doublereal *d__, doublereal *e, doublereal *tauq, doublereal * taup, doublereal *work, integer *lwork, integer *info) { -/* -- LAPACK routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - June 30, 1999 +/* -- LAPACK routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + June 30, 1999 - Purpose - ======= + Purpose + ======= - DGEBRD reduces a general real M-by-N matrix A to upper or lower - bidiagonal form B by an orthogonal transformation: Q**T * A * P = B. + DGEBRD reduces a general real M-by-N matrix A to upper or lower + bidiagonal form B by an orthogonal transformation: Q**T * A * P = B. - If m >= n, B is upper bidiagonal; if m < n, B is lower bidiagonal. + If m >= n, B is upper bidiagonal; if m < n, B is lower bidiagonal. - Arguments - ========= + Arguments + ========= - M (input) INTEGER - The number of rows in the matrix A. M >= 0. + M (input) INTEGER + The number of rows in the matrix A. M >= 0. - N (input) INTEGER - The number of columns in the matrix A. N >= 0. + N (input) INTEGER + The number of columns in the matrix A. N >= 0. - A (input/output) DOUBLE PRECISION array, dimension (LDA,N) - On entry, the M-by-N general matrix to be reduced. - On exit, - if m >= n, the diagonal and the first superdiagonal are - overwritten with the upper bidiagonal matrix B; the - elements below the diagonal, with the array TAUQ, represent - the orthogonal matrix Q as a product of elementary - reflectors, and the elements above the first superdiagonal, - with the array TAUP, represent the orthogonal matrix P as - a product of elementary reflectors; - if m < n, the diagonal and the first subdiagonal are - overwritten with the lower bidiagonal matrix B; the - elements below the first subdiagonal, with the array TAUQ, - represent the orthogonal matrix Q as a product of - elementary reflectors, and the elements above the diagonal, - with the array TAUP, represent the orthogonal matrix P as - a product of elementary reflectors. - See Further Details. + A (input/output) DOUBLE PRECISION array, dimension (LDA,N) + On entry, the M-by-N general matrix to be reduced. + On exit, + if m >= n, the diagonal and the first superdiagonal are + overwritten with the upper bidiagonal matrix B; the + elements below the diagonal, with the array TAUQ, represent + the orthogonal matrix Q as a product of elementary + reflectors, and the elements above the first superdiagonal, + with the array TAUP, represent the orthogonal matrix P as + a product of elementary reflectors; + if m < n, the diagonal and the first subdiagonal are + overwritten with the lower bidiagonal matrix B; the + elements below the first subdiagonal, with the array TAUQ, + represent the orthogonal matrix Q as a product of + elementary reflectors, and the elements above the diagonal, + with the array TAUP, represent the orthogonal matrix P as + a product of elementary reflectors. + See Further Details. - LDA (input) INTEGER - The leading dimension of the array A. LDA >= max(1,M). + LDA (input) INTEGER + The leading dimension of the array A. LDA >= max(1,M). - D (output) DOUBLE PRECISION array, dimension (min(M,N)) - The diagonal elements of the bidiagonal matrix B: - D(i) = A(i,i). + D (output) DOUBLE PRECISION array, dimension (min(M,N)) + The diagonal elements of the bidiagonal matrix B: + D(i) = A(i,i). - E (output) DOUBLE PRECISION array, dimension (min(M,N)-1) - The off-diagonal elements of the bidiagonal matrix B: - if m >= n, E(i) = A(i,i+1) for i = 1,2,...,n-1; - if m < n, E(i) = A(i+1,i) for i = 1,2,...,m-1. + E (output) DOUBLE PRECISION array, dimension (min(M,N)-1) + The off-diagonal elements of the bidiagonal matrix B: + if m >= n, E(i) = A(i,i+1) for i = 1,2,...,n-1; + if m < n, E(i) = A(i+1,i) for i = 1,2,...,m-1. - TAUQ (output) DOUBLE PRECISION array dimension (min(M,N)) - The scalar factors of the elementary reflectors which - represent the orthogonal matrix Q. See Further Details. + TAUQ (output) DOUBLE PRECISION array dimension (min(M,N)) + The scalar factors of the elementary reflectors which + represent the orthogonal matrix Q. See Further Details. - TAUP (output) DOUBLE PRECISION array, dimension (min(M,N)) - The scalar factors of the elementary reflectors which - represent the orthogonal matrix P. See Further Details. + TAUP (output) DOUBLE PRECISION array, dimension (min(M,N)) + The scalar factors of the elementary reflectors which + represent the orthogonal matrix P. See Further Details. - WORK (workspace/output) DOUBLE PRECISION array, dimension (LWORK) - On exit, if INFO = 0, WORK(1) returns the optimal LWORK. + WORK (workspace/output) DOUBLE PRECISION array, dimension (LWORK) + On exit, if INFO = 0, WORK(1) returns the optimal LWORK. - LWORK (input) INTEGER - The length of the array WORK. LWORK >= max(1,M,N). - For optimum performance LWORK >= (M+N)*NB, where NB - is the optimal blocksize. + LWORK (input) INTEGER + The length of the array WORK. LWORK >= max(1,M,N). + For optimum performance LWORK >= (M+N)*NB, where NB + is the optimal blocksize. - If LWORK = -1, then a workspace query is assumed; the routine - only calculates the optimal size of the WORK array, returns - this value as the first entry of the WORK array, and no error - message related to LWORK is issued by XERBLA. + If LWORK = -1, then a workspace query is assumed; the routine + only calculates the optimal size of the WORK array, returns + this value as the first entry of the WORK array, and no error + message related to LWORK is issued by XERBLA. - INFO (output) INTEGER - = 0: successful exit - < 0: if INFO = -i, the i-th argument had an illegal value. + INFO (output) INTEGER + = 0: successful exit + < 0: if INFO = -i, the i-th argument had an illegal value. - Further Details - =============== + Further Details + =============== - The matrices Q and P are represented as products of elementary - reflectors: + The matrices Q and P are represented as products of elementary + reflectors: - If m >= n, + If m >= n, - Q = H(1) H(2) . . . H(n) and P = G(1) G(2) . . . G(n-1) + Q = H(1) H(2) . . . H(n) and P = G(1) G(2) . . . G(n-1) - Each H(i) and G(i) has the form: + Each H(i) and G(i) has the form: - H(i) = I - tauq * v * v' and G(i) = I - taup * u * u' + H(i) = I - tauq * v * v' and G(i) = I - taup * u * u' - where tauq and taup are real scalars, and v and u are real vectors; - v(1:i-1) = 0, v(i) = 1, and v(i+1:m) is stored on exit in A(i+1:m,i); - u(1:i) = 0, u(i+1) = 1, and u(i+2:n) is stored on exit in A(i,i+2:n); - tauq is stored in TAUQ(i) and taup in TAUP(i). + where tauq and taup are real scalars, and v and u are real vectors; + v(1:i-1) = 0, v(i) = 1, and v(i+1:m) is stored on exit in A(i+1:m,i); + u(1:i) = 0, u(i+1) = 1, and u(i+2:n) is stored on exit in A(i,i+2:n); + tauq is stored in TAUQ(i) and taup in TAUP(i). - If m < n, + If m < n, - Q = H(1) H(2) . . . H(m-1) and P = G(1) G(2) . . . G(m) + Q = H(1) H(2) . . . H(m-1) and P = G(1) G(2) . . . G(m) - Each H(i) and G(i) has the form: + Each H(i) and G(i) has the form: - H(i) = I - tauq * v * v' and G(i) = I - taup * u * u' + H(i) = I - tauq * v * v' and G(i) = I - taup * u * u' - where tauq and taup are real scalars, and v and u are real vectors; - v(1:i) = 0, v(i+1) = 1, and v(i+2:m) is stored on exit in A(i+2:m,i); - u(1:i-1) = 0, u(i) = 1, and u(i+1:n) is stored on exit in A(i,i+1:n); - tauq is stored in TAUQ(i) and taup in TAUP(i). + where tauq and taup are real scalars, and v and u are real vectors; + v(1:i) = 0, v(i+1) = 1, and v(i+2:m) is stored on exit in A(i+2:m,i); + u(1:i-1) = 0, u(i) = 1, and u(i+1:n) is stored on exit in A(i,i+1:n); + tauq is stored in TAUQ(i) and taup in TAUP(i). - The contents of A on exit are illustrated by the following examples: + The contents of A on exit are illustrated by the following examples: - m = 6 and n = 5 (m > n): m = 5 and n = 6 (m < n): + m = 6 and n = 5 (m > n): m = 5 and n = 6 (m < n): - ( d e u1 u1 u1 ) ( d u1 u1 u1 u1 u1 ) - ( v1 d e u2 u2 ) ( e d u2 u2 u2 u2 ) - ( v1 v2 d e u3 ) ( v1 e d u3 u3 u3 ) - ( v1 v2 v3 d e ) ( v1 v2 e d u4 u4 ) - ( v1 v2 v3 v4 d ) ( v1 v2 v3 e d u5 ) - ( v1 v2 v3 v4 v5 ) + ( d e u1 u1 u1 ) ( d u1 u1 u1 u1 u1 ) + ( v1 d e u2 u2 ) ( e d u2 u2 u2 u2 ) + ( v1 v2 d e u3 ) ( v1 e d u3 u3 u3 ) + ( v1 v2 v3 d e ) ( v1 v2 e d u4 u4 ) + ( v1 v2 v3 v4 d ) ( v1 v2 v3 e d u5 ) + ( v1 v2 v3 v4 v5 ) - where d and e denote diagonal and off-diagonal elements of B, vi - denotes an element of the vector defining H(i), and ui an element of - the vector defining G(i). + where d and e denote diagonal and off-diagonal elements of B, vi + denotes an element of the vector defining H(i), and ui an element of + the vector defining G(i). - ===================================================================== + ===================================================================== - Test the input parameters + Test the input parameters Parameter adjustments */ /* Table of constant values */ - static integer c__1 = 1; - static integer c_n1 = -1; - static integer c__3 = 3; - static integer c__2 = 2; - static doublereal c_b21 = -1.; - static doublereal c_b22 = 1.; - + integer c__1 = 1; + integer c_n1 = -1; + integer c__3 = 3; + integer c__2 = 2; + doublereal c_b21 = -1.; + doublereal c_b22 = 1.; + /* System generated locals */ integer a_dim1, a_offset, i__1, i__2, i__3, i__4; /* Local variables */ - static integer i__, j; - extern /* Subroutine */ integer dgemm_(const char *,const char *, integer *, integer *, - integer *, doublereal *, doublereal *, integer *, doublereal *, + integer i__, j; + extern /* Subroutine */ integer dgemm_(const char *,const char *, integer *, integer *, + integer *, doublereal *, doublereal *, integer *, doublereal *, integer *, doublereal *, doublereal *, integer *); - static integer nbmin, iinfo, minmn; - extern /* Subroutine */ integer dgebd2_(integer *, integer *, doublereal *, + integer nbmin, iinfo, minmn; + extern /* Subroutine */ integer dgebd2_(integer *, integer *, doublereal *, integer *, doublereal *, doublereal *, doublereal *, doublereal *, doublereal *, integer *); - static integer nb; - extern /* Subroutine */ integer dlabrd_(integer *, integer *, integer *, + integer nb; + extern /* Subroutine */ integer dlabrd_(integer *, integer *, integer *, doublereal *, integer *, doublereal *, doublereal *, doublereal *, doublereal *, doublereal *, integer *, doublereal *, integer *); - static integer nx; - static doublereal ws; + integer nx; + doublereal ws; extern /* Subroutine */ integer xerbla_(const char *, integer *); - extern integer ilaenv_(integer *, const char *,const char *, integer *, integer *, + extern integer ilaenv_(integer *, const char *,const char *, integer *, integer *, integer *, integer *, ftnlen, ftnlen); - static integer ldwrkx, ldwrky, lwkopt; - static logical lquery; + integer ldwrkx, ldwrky, lwkopt; + logical lquery; #define a_ref(a_1,a_2) a[(a_2)*a_dim1 + a_1] @@ -230,7 +230,7 @@ extern "C" { if (nb > 1 && nb < minmn) { -/* Set the crossover point NX. +/* Set the crossover point NX. Computing MAX */ i__1 = nb, i__2 = ilaenv_(&c__3, "DGEBRD", " ", m, n, &c_n1, &c_n1, ( @@ -243,7 +243,7 @@ extern "C" { ws = (doublereal) ((*m + *n) * nb); if ((doublereal) (*lwork) < ws) { -/* Not enough work space for the optimal NB, consider using +/* Not enough work space for the optimal NB, consider using a smaller block size. */ nbmin = ilaenv_(&c__2, "DGEBRD", " ", m, n, &c_n1, &c_n1, ( @@ -264,17 +264,17 @@ extern "C" { i__2 = nb; for (i__ = 1; i__2 < 0 ? i__ >= i__1 : i__ <= i__1; i__ += i__2) { -/* Reduce rows and columns i:i+nb-1 to bidiagonal form and return - the matrices X and Y which are needed to update the unreduced +/* Reduce rows and columns i:i+nb-1 to bidiagonal form and return + the matrices X and Y which are needed to update the unreduced part of the matrix */ i__3 = *m - i__ + 1; i__4 = *n - i__ + 1; - dlabrd_(&i__3, &i__4, &nb, &a_ref(i__, i__), lda, &d__[i__], &e[i__], - &tauq[i__], &taup[i__], &work[1], &ldwrkx, &work[ldwrkx * nb + dlabrd_(&i__3, &i__4, &nb, &a_ref(i__, i__), lda, &d__[i__], &e[i__], + &tauq[i__], &taup[i__], &work[1], &ldwrkx, &work[ldwrkx * nb + 1], &ldwrky); -/* Update the trailing submatrix A(i+nb:m,i+nb:n), using an update +/* Update the trailing submatrix A(i+nb:m,i+nb:n), using an update of the form A := A - V*Y' - X*U' */ i__3 = *m - i__ - nb + 1; diff --git a/external/hypre/src/lapack/dgelq2.c b/external/hypre/src/lapack/dgelq2.c index 711d67d4..3a5d034b 100644 --- a/external/hypre/src/lapack/dgelq2.c +++ b/external/hypre/src/lapack/dgelq2.c @@ -77,12 +77,12 @@ extern "C" { /* System generated locals */ integer a_dim1, a_offset, i__1, i__2, i__3; /* Local variables */ - static integer i__, k; + integer i__, k; extern /* Subroutine */ integer dlarf_(const char *, integer *, integer *, doublereal *, integer *, doublereal *, doublereal *, integer *, doublereal *), dlarfg_(integer *, doublereal *, doublereal *, integer *, doublereal *), xerbla_(const char *, integer *); - static doublereal aii; + doublereal aii; #define a_ref(a_1,a_2) a[(a_2)*a_dim1 + a_1] a_dim1 = *lda; diff --git a/external/hypre/src/lapack/dgelqf.c b/external/hypre/src/lapack/dgelqf.c index f1a8eb68..9f6c9e7f 100644 --- a/external/hypre/src/lapack/dgelqf.c +++ b/external/hypre/src/lapack/dgelqf.c @@ -86,30 +86,30 @@ extern "C" { Parameter adjustments */ /* Table of constant values */ - static integer c__1 = 1; - static integer c_n1 = -1; - static integer c__3 = 3; - static integer c__2 = 2; + integer c__1 = 1; + integer c_n1 = -1; + integer c__3 = 3; + integer c__2 = 2; /* System generated locals */ integer a_dim1, a_offset, i__1, i__2, i__3, i__4; /* Local variables */ - static integer i__, k, nbmin, iinfo; + integer i__, k, nbmin, iinfo; extern /* Subroutine */ integer dgelq2_(integer *, integer *, doublereal *, integer *, doublereal *, doublereal *, integer *); - static integer ib, nb; + integer ib, nb; extern /* Subroutine */ integer dlarfb_(const char *,const char *,const char *,const char *, integer *, integer *, integer *, doublereal *, integer *, doublereal *, integer *, doublereal *, integer *, doublereal *, integer *); - static integer nx; + integer nx; extern /* Subroutine */ integer dlarft_(const char *,const char *, integer *, integer *, doublereal *, integer *, doublereal *, doublereal *, integer *), xerbla_(const char *, integer *); extern integer ilaenv_(integer *,const char *,const char *, integer *, integer *, integer *, integer *, ftnlen, ftnlen); - static integer ldwork, lwkopt; - static logical lquery; - static integer iws; + integer ldwork, lwkopt; + logical lquery; + integer iws; #define a_ref(a_1,a_2) a[(a_2)*a_dim1 + a_1] diff --git a/external/hypre/src/lapack/dgels.c b/external/hypre/src/lapack/dgels.c index 21c6448a..6a398190 100644 --- a/external/hypre/src/lapack/dgels.c +++ b/external/hypre/src/lapack/dgels.c @@ -9,163 +9,163 @@ extern "C" { #include "hypre_lapack.h" /* Subroutine */ integer dgels_(char *trans, integer *m, integer *n, integer * - nrhs, doublereal *a, integer *lda, doublereal *b, integer *ldb, + nrhs, doublereal *a, integer *lda, doublereal *b, integer *ldb, doublereal *work, integer *lwork, integer *info) { -/* -- LAPACK driver routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - June 30, 1999 - - - Purpose - ======= - - DGELS solves overdetermined or underdetermined real linear systems - involving an M-by-N matrix A, or its transpose, using a QR or LQ - factorization of A. It is assumed that A has full rank. - - The following options are provided: - - 1. If TRANS = 'N' and m >= n: find the least squares solution of - an overdetermined system, i.e., solve the least squares problem - minimize || B - A*X ||. - - 2. If TRANS = 'N' and m < n: find the minimum norm solution of - an underdetermined system A * X = B. - - 3. If TRANS = 'T' and m >= n: find the minimum norm solution of - an undetermined system A**T * X = B. - - 4. If TRANS = 'T' and m < n: find the least squares solution of - an overdetermined system, i.e., solve the least squares problem - minimize || B - A**T * X ||. - - Several right hand side vectors b and solution vectors x can be - handled in a single call; they are stored as the columns of the - M-by-NRHS right hand side matrix B and the N-by-NRHS solution - matrix X. - - Arguments - ========= - - TRANS (input) CHARACTER - = 'N': the linear system involves A; - = 'T': the linear system involves A**T. - - M (input) INTEGER - The number of rows of the matrix A. M >= 0. - - N (input) INTEGER - The number of columns of the matrix A. N >= 0. - - NRHS (input) INTEGER - The number of right hand sides, i.e., the number of - columns of the matrices B and X. NRHS >=0. - - A (input/output) DOUBLE PRECISION array, dimension (LDA,N) - On entry, the M-by-N matrix A. - On exit, - if M >= N, A is overwritten by details of its QR - factorization as returned by DGEQRF; - if M < N, A is overwritten by details of its LQ - factorization as returned by DGELQF. - - LDA (input) INTEGER - The leading dimension of the array A. LDA >= max(1,M). - - B (input/output) DOUBLE PRECISION array, dimension (LDB,NRHS) - On entry, the matrix B of right hand side vectors, stored - columnwise; B is M-by-NRHS if TRANS = 'N', or N-by-NRHS - if TRANS = 'T'. - On exit, B is overwritten by the solution vectors, stored - columnwise: - if TRANS = 'N' and m >= n, rows 1 to n of B contain the least - squares solution vectors; the residual sum of squares for the - solution in each column is given by the sum of squares of - elements N+1 to M in that column; - if TRANS = 'N' and m < n, rows 1 to N of B contain the - minimum norm solution vectors; - if TRANS = 'T' and m >= n, rows 1 to M of B contain the - minimum norm solution vectors; - if TRANS = 'T' and m < n, rows 1 to M of B contain the - least squares solution vectors; the residual sum of squares - for the solution in each column is given by the sum of - squares of elements M+1 to N in that column. - - LDB (input) INTEGER - The leading dimension of the array B. LDB >= MAX(1,M,N). - - WORK (workspace/output) DOUBLE PRECISION array, dimension (LWORK) - On exit, if INFO = 0, WORK(1) returns the optimal LWORK. - - LWORK (input) INTEGER - The dimension of the array WORK. - LWORK >= max( 1, MN + max( MN, NRHS ) ). - For optimal performance, - LWORK >= max( 1, MN + max( MN, NRHS )*NB ). - where MN = min(M,N) and NB is the optimum block size. - - If LWORK = -1, then a workspace query is assumed; the routine - only calculates the optimal size of the WORK array, returns - this value as the first entry of the WORK array, and no error - message related to LWORK is issued by XERBLA. - - INFO (output) INTEGER - = 0: successful exit - < 0: if INFO = -i, the i-th argument had an illegal value +/* -- LAPACK driver routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + June 30, 1999 + + + Purpose + ======= + + DGELS solves overdetermined or underdetermined real linear systems + involving an M-by-N matrix A, or its transpose, using a QR or LQ + factorization of A. It is assumed that A has full rank. + + The following options are provided: + + 1. If TRANS = 'N' and m >= n: find the least squares solution of + an overdetermined system, i.e., solve the least squares problem + minimize || B - A*X ||. + + 2. If TRANS = 'N' and m < n: find the minimum norm solution of + an underdetermined system A * X = B. + + 3. If TRANS = 'T' and m >= n: find the minimum norm solution of + an undetermined system A**T * X = B. + + 4. If TRANS = 'T' and m < n: find the least squares solution of + an overdetermined system, i.e., solve the least squares problem + minimize || B - A**T * X ||. + + Several right hand side vectors b and solution vectors x can be + handled in a single call; they are stored as the columns of the + M-by-NRHS right hand side matrix B and the N-by-NRHS solution + matrix X. + + Arguments + ========= + + TRANS (input) CHARACTER + = 'N': the linear system involves A; + = 'T': the linear system involves A**T. + + M (input) INTEGER + The number of rows of the matrix A. M >= 0. + + N (input) INTEGER + The number of columns of the matrix A. N >= 0. + + NRHS (input) INTEGER + The number of right hand sides, i.e., the number of + columns of the matrices B and X. NRHS >=0. + + A (input/output) DOUBLE PRECISION array, dimension (LDA,N) + On entry, the M-by-N matrix A. + On exit, + if M >= N, A is overwritten by details of its QR + factorization as returned by DGEQRF; + if M < N, A is overwritten by details of its LQ + factorization as returned by DGELQF. + + LDA (input) INTEGER + The leading dimension of the array A. LDA >= max(1,M). + + B (input/output) DOUBLE PRECISION array, dimension (LDB,NRHS) + On entry, the matrix B of right hand side vectors, stored + columnwise; B is M-by-NRHS if TRANS = 'N', or N-by-NRHS + if TRANS = 'T'. + On exit, B is overwritten by the solution vectors, stored + columnwise: + if TRANS = 'N' and m >= n, rows 1 to n of B contain the least + squares solution vectors; the residual sum of squares for the + solution in each column is given by the sum of squares of + elements N+1 to M in that column; + if TRANS = 'N' and m < n, rows 1 to N of B contain the + minimum norm solution vectors; + if TRANS = 'T' and m >= n, rows 1 to M of B contain the + minimum norm solution vectors; + if TRANS = 'T' and m < n, rows 1 to M of B contain the + least squares solution vectors; the residual sum of squares + for the solution in each column is given by the sum of + squares of elements M+1 to N in that column. + + LDB (input) INTEGER + The leading dimension of the array B. LDB >= MAX(1,M,N). + + WORK (workspace/output) DOUBLE PRECISION array, dimension (LWORK) + On exit, if INFO = 0, WORK(1) returns the optimal LWORK. + + LWORK (input) INTEGER + The dimension of the array WORK. + LWORK >= max( 1, MN + max( MN, NRHS ) ). + For optimal performance, + LWORK >= max( 1, MN + max( MN, NRHS )*NB ). + where MN = min(M,N) and NB is the optimum block size. + + If LWORK = -1, then a workspace query is assumed; the routine + only calculates the optimal size of the WORK array, returns + this value as the first entry of the WORK array, and no error + message related to LWORK is issued by XERBLA. + + INFO (output) INTEGER + = 0: successful exit + < 0: if INFO = -i, the i-th argument had an illegal value - ===================================================================== + ===================================================================== - Test the input arguments. + Test the input arguments. Parameter adjustments */ /* Table of constant values */ - static integer c__1 = 1; - static integer c_n1 = -1; - static doublereal c_b33 = 0.; - static integer c__0 = 0; - static doublereal c_b61 = 1.; - + integer c__1 = 1; + integer c_n1 = -1; + doublereal c_b33 = 0.; + integer c__0 = 0; + doublereal c_b61 = 1.; + /* System generated locals */ integer a_dim1, a_offset, b_dim1, b_offset, i__1, i__2; /* Local variables */ - static doublereal anrm, bnrm; - static integer brow; - static logical tpsd; - static integer i__, j, iascl, ibscl; + doublereal anrm, bnrm; + integer brow; + logical tpsd; + integer i__, j, iascl, ibscl; extern logical lsame_(const char *,const char *); - extern /* Subroutine */ integer dtrsm_(const char *,const char *,const char *,const char *, - integer *, integer *, doublereal *, doublereal *, integer *, + extern /* Subroutine */ integer dtrsm_(const char *,const char *,const char *,const char *, + integer *, integer *, doublereal *, doublereal *, integer *, doublereal *, integer *); - static integer wsize; - static doublereal rwork[1]; + integer wsize; + doublereal rwork[1]; extern /* Subroutine */ integer dlabad_(doublereal *, doublereal *); - static integer nb; - extern doublereal dlamch_(const char *), dlange_(const char *, integer *, + integer nb; + extern doublereal dlamch_(const char *), dlange_(const char *, integer *, integer *, doublereal *, integer *, doublereal *); - static integer mn; - extern /* Subroutine */ integer dgelqf_(integer *, integer *, doublereal *, - integer *, doublereal *, doublereal *, integer *, integer *), - dlascl_(const char *, integer *, integer *, doublereal *, doublereal *, + integer mn; + extern /* Subroutine */ integer dgelqf_(integer *, integer *, doublereal *, + integer *, doublereal *, doublereal *, integer *, integer *), + dlascl_(const char *, integer *, integer *, doublereal *, doublereal *, integer *, integer *, doublereal *, integer *, integer *), - dgeqrf_(integer *, integer *, doublereal *, integer *, + dgeqrf_(integer *, integer *, doublereal *, integer *, doublereal *, doublereal *, integer *, integer *), dlaset_(const char *, - integer *, integer *, doublereal *, doublereal *, doublereal *, + integer *, integer *, doublereal *, doublereal *, doublereal *, integer *), xerbla_(const char *, integer *); - extern integer ilaenv_(integer *,const char *,const char *, integer *, integer *, + extern integer ilaenv_(integer *,const char *,const char *, integer *, integer *, integer *, integer *, ftnlen, ftnlen); - static integer scllen; - static doublereal bignum; - extern /* Subroutine */ integer dormlq_(const char *,const char *, integer *, integer *, - integer *, doublereal *, integer *, doublereal *, doublereal *, - integer *, doublereal *, integer *, integer *), - dormqr_(const char *,const char *, integer *, integer *, integer *, - doublereal *, integer *, doublereal *, doublereal *, integer *, + integer scllen; + doublereal bignum; + extern /* Subroutine */ integer dormlq_(const char *,const char *, integer *, integer *, + integer *, doublereal *, integer *, doublereal *, doublereal *, + integer *, doublereal *, integer *, integer *), + dormqr_(const char *,const char *, integer *, integer *, integer *, + doublereal *, integer *, doublereal *, doublereal *, integer *, doublereal *, integer *, integer *); - static doublereal smlnum; - static logical lquery; + doublereal smlnum; + logical lquery; #define b_ref(a_1,a_2) b[(a_2)*b_dim1 + a_1] @@ -215,7 +215,7 @@ extern "C" { } if (*m >= *n) { - nb = ilaenv_(&c__1, "DGEQRF", " ", m, n, &c_n1, &c_n1, (ftnlen)6, + nb = ilaenv_(&c__1, "DGEQRF", " ", m, n, &c_n1, &c_n1, (ftnlen)6, (ftnlen)1); if (tpsd) { /* Computing MAX */ @@ -229,7 +229,7 @@ extern "C" { nb = max(i__1,i__2); } } else { - nb = ilaenv_(&c__1, "DGELQF", " ", m, n, &c_n1, &c_n1, (ftnlen)6, + nb = ilaenv_(&c__1, "DGELQF", " ", m, n, &c_n1, &c_n1, (ftnlen)6, (ftnlen)1); if (tpsd) { /* Computing MAX */ @@ -259,7 +259,7 @@ extern "C" { return 0; } -/* Quick return if possible +/* Quick return if possible Computing MIN */ i__1 = min(*m,*n); @@ -283,14 +283,14 @@ extern "C" { /* Scale matrix norm up to SMLNUM */ - dlascl_("G", &c__0, &c__0, &anrm, &smlnum, m, n, &a[a_offset], lda, + dlascl_("G", &c__0, &c__0, &anrm, &smlnum, m, n, &a[a_offset], lda, info); iascl = 1; } else if (anrm > bignum) { /* Scale matrix norm down to BIGNUM */ - dlascl_("G", &c__0, &c__0, &anrm, &bignum, m, n, &a[a_offset], lda, + dlascl_("G", &c__0, &c__0, &anrm, &bignum, m, n, &a[a_offset], lda, info); iascl = 2; } else if (anrm == 0.) { @@ -312,14 +312,14 @@ extern "C" { /* Scale matrix norm up to SMLNUM */ - dlascl_("G", &c__0, &c__0, &bnrm, &smlnum, &brow, nrhs, &b[b_offset], + dlascl_("G", &c__0, &c__0, &bnrm, &smlnum, &brow, nrhs, &b[b_offset], ldb, info); ibscl = 1; } else if (bnrm > bignum) { /* Scale matrix norm down to BIGNUM */ - dlascl_("G", &c__0, &c__0, &bnrm, &bignum, &brow, nrhs, &b[b_offset], + dlascl_("G", &c__0, &c__0, &bnrm, &bignum, &brow, nrhs, &b[b_offset], ldb, info); ibscl = 2; } @@ -336,7 +336,7 @@ extern "C" { if (! tpsd) { -/* Least-Squares Problem min || A * X - B || +/* Least-Squares Problem min || A * X - B || B(1:M,1:NRHS) := Q' * B(1:M,1:NRHS) */ @@ -344,7 +344,7 @@ extern "C" { dormqr_("Left", "Transpose", m, nrhs, n, &a[a_offset], lda, &work[ 1], &b[b_offset], ldb, &work[mn + 1], &i__1, info); -/* workspace at least NRHS, optimally NRHS*NB +/* workspace at least NRHS, optimally NRHS*NB B(1:N,1:NRHS) := inv(R) * B(1:N,1:NRHS) */ @@ -355,11 +355,11 @@ extern "C" { } else { -/* Overdetermined system of equations A' * X = B +/* Overdetermined system of equations A' * X = B B(1:N,1:NRHS) := inv(R') * B(1:N,1:NRHS) */ - dtrsm_("Left", "Upper", "Transpose", "Non-unit", n, nrhs, &c_b61, + dtrsm_("Left", "Upper", "Transpose", "Non-unit", n, nrhs, &c_b61, &a[a_offset], lda, &b[b_offset], ldb); /* B(N+1:M,1:NRHS) = ZERO */ @@ -398,7 +398,7 @@ extern "C" { if (! tpsd) { -/* underdetermined system of equations A * X = B +/* underdetermined system of equations A * X = B B(1:M,1:NRHS) := inv(L) * B(1:M,1:NRHS) */ @@ -429,7 +429,7 @@ extern "C" { } else { -/* overdetermined system min || A' * X - B || +/* overdetermined system min || A' * X - B || B(1:N,1:NRHS) := Q * B(1:N,1:NRHS) */ @@ -437,11 +437,11 @@ extern "C" { dormlq_("Left", "No transpose", n, nrhs, m, &a[a_offset], lda, & work[1], &b[b_offset], ldb, &work[mn + 1], &i__1, info); -/* workspace at least NRHS, optimally NRHS*NB +/* workspace at least NRHS, optimally NRHS*NB B(1:M,1:NRHS) := inv(L') * B(1:M,1:NRHS) */ - dtrsm_("Left", "Lower", "Transpose", "Non-unit", m, nrhs, &c_b61, + dtrsm_("Left", "Lower", "Transpose", "Non-unit", m, nrhs, &c_b61, &a[a_offset], lda, &b[b_offset], ldb); scllen = *m; diff --git a/external/hypre/src/lapack/dgeqr2.c b/external/hypre/src/lapack/dgeqr2.c index af98168f..716aab50 100644 --- a/external/hypre/src/lapack/dgeqr2.c +++ b/external/hypre/src/lapack/dgeqr2.c @@ -11,81 +11,81 @@ extern "C" { /* Subroutine */ integer dgeqr2_(integer *m, integer *n, doublereal *a, integer * lda, doublereal *tau, doublereal *work, integer *info) { -/* -- LAPACK routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - February 29, 1992 +/* -- LAPACK routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + February 29, 1992 - Purpose - ======= + Purpose + ======= - DGEQR2 computes a QR factorization of a real m by n matrix A: - A = Q * R. + DGEQR2 computes a QR factorization of a real m by n matrix A: + A = Q * R. - Arguments - ========= + Arguments + ========= - M (input) INTEGER - The number of rows of the matrix A. M >= 0. + M (input) INTEGER + The number of rows of the matrix A. M >= 0. - N (input) INTEGER - The number of columns of the matrix A. N >= 0. + N (input) INTEGER + The number of columns of the matrix A. N >= 0. - A (input/output) DOUBLE PRECISION array, dimension (LDA,N) - On entry, the m by n matrix A. - On exit, the elements on and above the diagonal of the array - contain the min(m,n) by n upper trapezoidal matrix R (R is - upper triangular if m >= n); the elements below the diagonal, - with the array TAU, represent the orthogonal matrix Q as a - product of elementary reflectors (see Further Details). + A (input/output) DOUBLE PRECISION array, dimension (LDA,N) + On entry, the m by n matrix A. + On exit, the elements on and above the diagonal of the array + contain the min(m,n) by n upper trapezoidal matrix R (R is + upper triangular if m >= n); the elements below the diagonal, + with the array TAU, represent the orthogonal matrix Q as a + product of elementary reflectors (see Further Details). - LDA (input) INTEGER - The leading dimension of the array A. LDA >= max(1,M). + LDA (input) INTEGER + The leading dimension of the array A. LDA >= max(1,M). - TAU (output) DOUBLE PRECISION array, dimension (min(M,N)) - The scalar factors of the elementary reflectors (see Further - Details). + TAU (output) DOUBLE PRECISION array, dimension (min(M,N)) + The scalar factors of the elementary reflectors (see Further + Details). - WORK (workspace) DOUBLE PRECISION array, dimension (N) + WORK (workspace) DOUBLE PRECISION array, dimension (N) - INFO (output) INTEGER - = 0: successful exit - < 0: if INFO = -i, the i-th argument had an illegal value + INFO (output) INTEGER + = 0: successful exit + < 0: if INFO = -i, the i-th argument had an illegal value - Further Details - =============== + Further Details + =============== - The matrix Q is represented as a product of elementary reflectors + The matrix Q is represented as a product of elementary reflectors - Q = H(1) H(2) . . . H(k), where k = min(m,n). + Q = H(1) H(2) . . . H(k), where k = min(m,n). - Each H(i) has the form + Each H(i) has the form - H(i) = I - tau * v * v' + H(i) = I - tau * v * v' - where tau is a real scalar, and v is a real vector with - v(1:i-1) = 0 and v(i) = 1; v(i+1:m) is stored on exit in A(i+1:m,i), - and tau in TAU(i). + where tau is a real scalar, and v is a real vector with + v(1:i-1) = 0 and v(i) = 1; v(i+1:m) is stored on exit in A(i+1:m,i), + and tau in TAU(i). - ===================================================================== + ===================================================================== - Test the input arguments + Test the input arguments Parameter adjustments */ /* Table of constant values */ - static integer c__1 = 1; - + integer c__1 = 1; + /* System generated locals */ integer a_dim1, a_offset, i__1, i__2, i__3; /* Local variables */ - static integer i__, k; - extern /* Subroutine */ integer dlarf_(const char *, integer *, integer *, - doublereal *, integer *, doublereal *, doublereal *, integer *, - doublereal *), dlarfg_(integer *, doublereal *, + integer i__, k; + extern /* Subroutine */ integer dlarf_(const char *, integer *, integer *, + doublereal *, integer *, doublereal *, doublereal *, integer *, + doublereal *), dlarfg_(integer *, doublereal *, doublereal *, integer *, doublereal *), xerbla_(const char *, integer *); - static doublereal aii; + doublereal aii; #define a_ref(a_1,a_2) a[(a_2)*a_dim1 + a_1] @@ -115,7 +115,7 @@ extern "C" { i__1 = k; for (i__ = 1; i__ <= i__1; ++i__) { -/* Generate elementary reflector H(i) to annihilate A(i+1:m,i) +/* Generate elementary reflector H(i) to annihilate A(i+1:m,i) Computing MIN */ i__2 = i__ + 1; diff --git a/external/hypre/src/lapack/dgeqrf.c b/external/hypre/src/lapack/dgeqrf.c index c460c1e8..c88bd9ab 100644 --- a/external/hypre/src/lapack/dgeqrf.c +++ b/external/hypre/src/lapack/dgeqrf.c @@ -11,106 +11,106 @@ extern "C" { /* Subroutine */ integer dgeqrf_(integer *m, integer *n, doublereal *a, integer * lda, doublereal *tau, doublereal *work, integer *lwork, integer *info) { -/* -- LAPACK routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - June 30, 1999 +/* -- LAPACK routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + June 30, 1999 - Purpose - ======= + Purpose + ======= - DGEQRF computes a QR factorization of a real M-by-N matrix A: - A = Q * R. + DGEQRF computes a QR factorization of a real M-by-N matrix A: + A = Q * R. - Arguments - ========= + Arguments + ========= - M (input) INTEGER - The number of rows of the matrix A. M >= 0. + M (input) INTEGER + The number of rows of the matrix A. M >= 0. - N (input) INTEGER - The number of columns of the matrix A. N >= 0. + N (input) INTEGER + The number of columns of the matrix A. N >= 0. - A (input/output) DOUBLE PRECISION array, dimension (LDA,N) - On entry, the M-by-N matrix A. - On exit, the elements on and above the diagonal of the array - contain the min(M,N)-by-N upper trapezoidal matrix R (R is - upper triangular if m >= n); the elements below the diagonal, - with the array TAU, represent the orthogonal matrix Q as a - product of min(m,n) elementary reflectors (see Further - Details). + A (input/output) DOUBLE PRECISION array, dimension (LDA,N) + On entry, the M-by-N matrix A. + On exit, the elements on and above the diagonal of the array + contain the min(M,N)-by-N upper trapezoidal matrix R (R is + upper triangular if m >= n); the elements below the diagonal, + with the array TAU, represent the orthogonal matrix Q as a + product of min(m,n) elementary reflectors (see Further + Details). - LDA (input) INTEGER - The leading dimension of the array A. LDA >= max(1,M). + LDA (input) INTEGER + The leading dimension of the array A. LDA >= max(1,M). - TAU (output) DOUBLE PRECISION array, dimension (min(M,N)) - The scalar factors of the elementary reflectors (see Further - Details). + TAU (output) DOUBLE PRECISION array, dimension (min(M,N)) + The scalar factors of the elementary reflectors (see Further + Details). - WORK (workspace/output) DOUBLE PRECISION array, dimension (LWORK) - On exit, if INFO = 0, WORK(1) returns the optimal LWORK. + WORK (workspace/output) DOUBLE PRECISION array, dimension (LWORK) + On exit, if INFO = 0, WORK(1) returns the optimal LWORK. - LWORK (input) INTEGER - The dimension of the array WORK. LWORK >= max(1,N). - For optimum performance LWORK >= N*NB, where NB is - the optimal blocksize. + LWORK (input) INTEGER + The dimension of the array WORK. LWORK >= max(1,N). + For optimum performance LWORK >= N*NB, where NB is + the optimal blocksize. - If LWORK = -1, then a workspace query is assumed; the routine - only calculates the optimal size of the WORK array, returns - this value as the first entry of the WORK array, and no error - message related to LWORK is issued by XERBLA. + If LWORK = -1, then a workspace query is assumed; the routine + only calculates the optimal size of the WORK array, returns + this value as the first entry of the WORK array, and no error + message related to LWORK is issued by XERBLA. - INFO (output) INTEGER - = 0: successful exit - < 0: if INFO = -i, the i-th argument had an illegal value + INFO (output) INTEGER + = 0: successful exit + < 0: if INFO = -i, the i-th argument had an illegal value - Further Details - =============== + Further Details + =============== - The matrix Q is represented as a product of elementary reflectors + The matrix Q is represented as a product of elementary reflectors - Q = H(1) H(2) . . . H(k), where k = min(m,n). + Q = H(1) H(2) . . . H(k), where k = min(m,n). - Each H(i) has the form + Each H(i) has the form - H(i) = I - tau * v * v' + H(i) = I - tau * v * v' - where tau is a real scalar, and v is a real vector with - v(1:i-1) = 0 and v(i) = 1; v(i+1:m) is stored on exit in A(i+1:m,i), - and tau in TAU(i). + where tau is a real scalar, and v is a real vector with + v(1:i-1) = 0 and v(i) = 1; v(i+1:m) is stored on exit in A(i+1:m,i), + and tau in TAU(i). - ===================================================================== + ===================================================================== - Test the input arguments + Test the input arguments Parameter adjustments */ /* Table of constant values */ - static integer c__1 = 1; - static integer c_n1 = -1; - static integer c__3 = 3; - static integer c__2 = 2; - + integer c__1 = 1; + integer c_n1 = -1; + integer c__3 = 3; + integer c__2 = 2; + /* System generated locals */ integer a_dim1, a_offset, i__1, i__2, i__3, i__4; /* Local variables */ - static integer i__, k, nbmin, iinfo; - extern /* Subroutine */ integer dgeqr2_(integer *, integer *, doublereal *, + integer i__, k, nbmin, iinfo; + extern /* Subroutine */ integer dgeqr2_(integer *, integer *, doublereal *, integer *, doublereal *, doublereal *, integer *); - static integer ib, nb; - extern /* Subroutine */ integer dlarfb_(const char *,const char *,const char *,const char *, - integer *, integer *, integer *, doublereal *, integer *, - doublereal *, integer *, doublereal *, integer *, doublereal *, + integer ib, nb; + extern /* Subroutine */ integer dlarfb_(const char *,const char *,const char *,const char *, + integer *, integer *, integer *, doublereal *, integer *, + doublereal *, integer *, doublereal *, integer *, doublereal *, integer *); - static integer nx; - extern /* Subroutine */ integer dlarft_(const char *,const char *, integer *, integer *, + integer nx; + extern /* Subroutine */ integer dlarft_(const char *,const char *, integer *, integer *, doublereal *, integer *, doublereal *, doublereal *, integer *), xerbla_(const char *, integer *); - extern integer ilaenv_(integer *,const char *,const char *, integer *, integer *, + extern integer ilaenv_(integer *,const char *,const char *, integer *, integer *, integer *, integer *, ftnlen, ftnlen); - static integer ldwork, lwkopt; - static logical lquery; - static integer iws; + integer ldwork, lwkopt; + logical lquery; + integer iws; #define a_ref(a_1,a_2) a[(a_2)*a_dim1 + a_1] @@ -157,7 +157,7 @@ extern "C" { iws = *n; if (nb > 1 && nb < k) { -/* Determine when to cross over from blocked to unblocked code. +/* Determine when to cross over from blocked to unblocked code. Computing MAX */ i__1 = 0, i__2 = ilaenv_(&c__3, "DGEQRF", " ", m, n, &c_n1, &c_n1, ( @@ -171,7 +171,7 @@ extern "C" { iws = ldwork * nb; if (*lwork < iws) { -/* Not enough workspace to use optimal NB: reduce NB and +/* Not enough workspace to use optimal NB: reduce NB and determine the minimum value of NB. */ nb = *lwork / ldwork; @@ -194,7 +194,7 @@ extern "C" { i__3 = k - i__ + 1; ib = min(i__3,nb); -/* Compute the QR factorization of the current block +/* Compute the QR factorization of the current block A(i:m,i:i+ib-1) */ i__3 = *m - i__ + 1; @@ -202,7 +202,7 @@ extern "C" { iinfo); if (i__ + ib <= *n) { -/* Form the triangular factor of the block reflector +/* Form the triangular factor of the block reflector H = H(i) H(i+1) . . . H(i+ib-1) */ i__3 = *m - i__ + 1; diff --git a/external/hypre/src/lapack/dgesvd.c b/external/hypre/src/lapack/dgesvd.c index 278b560c..223dfd72 100644 --- a/external/hypre/src/lapack/dgesvd.c +++ b/external/hypre/src/lapack/dgesvd.c @@ -13,210 +13,208 @@ extern "C" { -lf2c -lm (in that order) */ -/* Table of constant values */ - -static integer c__6 = 6; -static integer c__0 = 0; -static integer c__2 = 2; -static integer c__1 = 1; -static integer c_n1 = -1; -static doublereal c_b416 = 0.; -static doublereal c_b438 = 1.; - -/* Subroutine */ integer dgesvd_(char *jobu, char *jobvt, integer *m, integer *n, +/* Subroutine */ integer dgesvd_(char *jobu, char *jobvt, integer *m, integer *n, doublereal *a, integer *lda, doublereal *s, doublereal *u, integer * - ldu, doublereal *vt, integer *ldvt, doublereal *work, integer *lwork, + ldu, doublereal *vt, integer *ldvt, doublereal *work, integer *lwork, integer *info) { /* System generated locals */ address a__1[2]; - integer a_dim1, a_offset, u_dim1, u_offset, vt_dim1, vt_offset, i__1[2], + integer a_dim1, a_offset, u_dim1, u_offset, vt_dim1, vt_offset, i__1[2], i__2, i__3, i__4; char ch__1[2]; - /* Builtin functions + /* Builtin functions Subroutine */ integer s_cat(char *, char **, integer *, integer *, ftnlen); /* Local variables */ - static integer iscl; - static doublereal anrm; - static integer ierr, itau, ncvt, nrvt, i__; - extern /* Subroutine */ integer dgemm_(const char *,const char *, integer *, integer *, - integer *, doublereal *, doublereal *, integer *, doublereal *, + integer iscl; + doublereal anrm; + integer ierr, itau, ncvt, nrvt, i__; + extern /* Subroutine */ integer dgemm_(const char *,const char *, integer *, integer *, + integer *, doublereal *, doublereal *, integer *, doublereal *, integer *, doublereal *, doublereal *, integer *); extern logical lsame_(const char *,const char *); - static integer chunk, minmn, wrkbl, itaup, itauq, mnthr, iwork; - static logical wntua, wntva, wntun, wntuo, wntvn, wntvo, wntus, wntvs; - static integer ie; - extern /* Subroutine */ integer dgebrd_(integer *, integer *, doublereal *, + integer chunk, minmn, wrkbl = 0, itaup, itauq, mnthr, iwork; + logical wntua, wntva, wntun, wntuo, wntvn, wntvo, wntus, wntvs; + integer ie = 0; + extern /* Subroutine */ integer dgebrd_(integer *, integer *, doublereal *, integer *, doublereal *, doublereal *, doublereal *, doublereal *, doublereal *, integer *, integer *); - extern doublereal dlamch_(const char *), dlange_(const char *, integer *, + extern doublereal dlamch_(const char *), dlange_(const char *, integer *, integer *, doublereal *, integer *, doublereal *); - static integer ir, bdspac, iu; - extern /* Subroutine */ integer dgelqf_(integer *, integer *, doublereal *, - integer *, doublereal *, doublereal *, integer *, integer *), - dlascl_(const char *, integer *, integer *, doublereal *, doublereal *, + integer ir, bdspac = 0, iu; + extern /* Subroutine */ integer dgelqf_(integer *, integer *, doublereal *, + integer *, doublereal *, doublereal *, integer *, integer *), + dlascl_(const char *, integer *, integer *, doublereal *, doublereal *, integer *, integer *, doublereal *, integer *, integer *), - dgeqrf_(integer *, integer *, doublereal *, integer *, + dgeqrf_(integer *, integer *, doublereal *, integer *, doublereal *, doublereal *, integer *, integer *), dlacpy_(const char *, - integer *, integer *, doublereal *, integer *, doublereal *, - integer *), dlaset_(const char *, integer *, integer *, - doublereal *, doublereal *, doublereal *, integer *), - dbdsqr_(const char *, integer *, integer *, integer *, integer *, + integer *, integer *, doublereal *, integer *, doublereal *, + integer *), dlaset_(const char *, integer *, integer *, + doublereal *, doublereal *, doublereal *, integer *), + dbdsqr_(const char *, integer *, integer *, integer *, integer *, doublereal *, doublereal *, doublereal *, integer *, doublereal *, - integer *, doublereal *, integer *, doublereal *, integer *), dorgbr_(const char *, integer *, integer *, integer *, - doublereal *, integer *, doublereal *, doublereal *, integer *, + integer *, doublereal *, integer *, doublereal *, integer *), dorgbr_(const char *, integer *, integer *, integer *, + doublereal *, integer *, doublereal *, doublereal *, integer *, integer *); - static doublereal bignum; + doublereal bignum; extern /* Subroutine */ integer xerbla_(const char *, integer *); - extern integer ilaenv_(integer *,const char *,const char *, integer *, integer *, - integer *, integer *, ftnlen, ftnlen); - extern /* Subroutine */ integer dormbr_(const char *,const char *,const char *, integer *, - integer *, integer *, doublereal *, integer *, doublereal *, - doublereal *, integer *, doublereal *, integer *, integer *), dorglq_(integer *, integer *, integer *, - doublereal *, integer *, doublereal *, doublereal *, integer *, + extern integer ilaenv_(integer *,const char *,const char *, integer *, integer *, + integer *, integer *, ftnlen, ftnlen); + extern /* Subroutine */ integer dormbr_(const char *,const char *,const char *, integer *, + integer *, integer *, doublereal *, integer *, doublereal *, + doublereal *, integer *, doublereal *, integer *, integer *), dorglq_(integer *, integer *, integer *, + doublereal *, integer *, doublereal *, doublereal *, integer *, integer *), dorgqr_(integer *, integer *, integer *, doublereal *, - integer *, doublereal *, doublereal *, integer *, integer *); - static integer ldwrkr, minwrk, ldwrku, maxwrk; - static doublereal smlnum; - static logical lquery, wntuas, wntvas; - static integer blk, ncu; - static doublereal dum[1], eps; - static integer nru; - + integer *, doublereal *, doublereal *, integer *, integer *); + integer ldwrkr, minwrk, ldwrku, maxwrk; + doublereal smlnum; + logical lquery, wntuas, wntvas; + integer blk, ncu; + doublereal dum[1], eps; + integer nru; + + /* Table of constant values */ + integer c__6 = 6; + integer c__0 = 0; + integer c__2 = 2; + integer c__1 = 1; + integer c_n1 = -1; + doublereal c_b416 = 0.; + doublereal c_b438 = 1.; #define a_ref(a_1,a_2) a[(a_2)*a_dim1 + a_1] #define u_ref(a_1,a_2) u[(a_2)*u_dim1 + a_1] #define vt_ref(a_1,a_2) vt[(a_2)*vt_dim1 + a_1] -/* -- LAPACK driver routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - October 31, 1999 - - - Purpose - ======= - - DGESVD computes the singular value decomposition (SVD) of a real - M-by-N matrix A, optionally computing the left and/or right singular - vectors. The SVD is written - - A = U * SIGMA * transpose(V) - - where SIGMA is an M-by-N matrix which is zero except for its - min(m,n) diagonal elements, U is an M-by-M orthogonal matrix, and - V is an N-by-N orthogonal matrix. The diagonal elements of SIGMA - are the singular values of A; they are real and non-negative, and - are returned in descending order. The first min(m,n) columns of - U and V are the left and right singular vectors of A. - - Note that the routine returns V**T, not V. - - Arguments - ========= - - JOBU (input) CHARACTER*1 - Specifies options for computing all or part of the matrix U: - = 'A': all M columns of U are returned in array U: - = 'S': the first min(m,n) columns of U (the left singular - vectors) are returned in the array U; - = 'O': the first min(m,n) columns of U (the left singular - vectors) are overwritten on the array A; - = 'N': no columns of U (no left singular vectors) are - computed. - - JOBVT (input) CHARACTER*1 - Specifies options for computing all or part of the matrix - V**T: - = 'A': all N rows of V**T are returned in the array VT; - = 'S': the first min(m,n) rows of V**T (the right singular - vectors) are returned in the array VT; - = 'O': the first min(m,n) rows of V**T (the right singular - vectors) are overwritten on the array A; - = 'N': no rows of V**T (no right singular vectors) are - computed. - - JOBVT and JOBU cannot both be 'O'. - - M (input) INTEGER - The number of rows of the input matrix A. M >= 0. - - N (input) INTEGER - The number of columns of the input matrix A. N >= 0. - - A (input/output) DOUBLE PRECISION array, dimension (LDA,N) - On entry, the M-by-N matrix A. - On exit, - if JOBU = 'O', A is overwritten with the first min(m,n) - columns of U (the left singular vectors, - stored columnwise); - if JOBVT = 'O', A is overwritten with the first min(m,n) - rows of V**T (the right singular vectors, - stored rowwise); - if JOBU .ne. 'O' and JOBVT .ne. 'O', the contents of A - are destroyed. - - LDA (input) INTEGER - The leading dimension of the array A. LDA >= max(1,M). - - S (output) DOUBLE PRECISION array, dimension (min(M,N)) - The singular values of A, sorted so that S(i) >= S(i+1). - - U (output) DOUBLE PRECISION array, dimension (LDU,UCOL) - (LDU,M) if JOBU = 'A' or (LDU,min(M,N)) if JOBU = 'S'. - If JOBU = 'A', U contains the M-by-M orthogonal matrix U; - if JOBU = 'S', U contains the first min(m,n) columns of U - (the left singular vectors, stored columnwise); - if JOBU = 'N' or 'O', U is not referenced. - - LDU (input) INTEGER - The leading dimension of the array U. LDU >= 1; if - JOBU = 'S' or 'A', LDU >= M. - - VT (output) DOUBLE PRECISION array, dimension (LDVT,N) - If JOBVT = 'A', VT contains the N-by-N orthogonal matrix - V**T; - if JOBVT = 'S', VT contains the first min(m,n) rows of - V**T (the right singular vectors, stored rowwise); - if JOBVT = 'N' or 'O', VT is not referenced. - - LDVT (input) INTEGER - The leading dimension of the array VT. LDVT >= 1; if - JOBVT = 'A', LDVT >= N; if JOBVT = 'S', LDVT >= min(M,N). - - WORK (workspace/output) DOUBLE PRECISION array, dimension (LWORK) - On exit, if INFO = 0, WORK(1) returns the optimal LWORK; - if INFO > 0, WORK(2:MIN(M,N)) contains the unconverged - superdiagonal elements of an upper bidiagonal matrix B - whose diagonal is in S (not necessarily sorted). B - satisfies A = U * B * VT, so it has the same singular values - as A, and singular vectors related by U and VT. - - LWORK (input) INTEGER - The dimension of the array WORK. LWORK >= 1. - LWORK >= MAX(3*MIN(M,N)+MAX(M,N),5*MIN(M,N)). - For good performance, LWORK should generally be larger. - - If LWORK = -1, then a workspace query is assumed; the routine - only calculates the optimal size of the WORK array, returns - this value as the first entry of the WORK array, and no error - message related to LWORK is issued by XERBLA. - - INFO (output) INTEGER - = 0: successful exit. - < 0: if INFO = -i, the i-th argument had an illegal value. - > 0: if DBDSQR did not converge, INFO specifies how many - superdiagonals of an intermediate bidiagonal form B - did not converge to zero. See the description of WORK - above for details. - - ===================================================================== - - - Test the input arguments +/* -- LAPACK driver routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + October 31, 1999 + + + Purpose + ======= + + DGESVD computes the singular value decomposition (SVD) of a real + M-by-N matrix A, optionally computing the left and/or right singular + vectors. The SVD is written + + A = U * SIGMA * transpose(V) + + where SIGMA is an M-by-N matrix which is zero except for its + min(m,n) diagonal elements, U is an M-by-M orthogonal matrix, and + V is an N-by-N orthogonal matrix. The diagonal elements of SIGMA + are the singular values of A; they are real and non-negative, and + are returned in descending order. The first min(m,n) columns of + U and V are the left and right singular vectors of A. + + Note that the routine returns V**T, not V. + + Arguments + ========= + + JOBU (input) CHARACTER*1 + Specifies options for computing all or part of the matrix U: + = 'A': all M columns of U are returned in array U: + = 'S': the first min(m,n) columns of U (the left singular + vectors) are returned in the array U; + = 'O': the first min(m,n) columns of U (the left singular + vectors) are overwritten on the array A; + = 'N': no columns of U (no left singular vectors) are + computed. + + JOBVT (input) CHARACTER*1 + Specifies options for computing all or part of the matrix + V**T: + = 'A': all N rows of V**T are returned in the array VT; + = 'S': the first min(m,n) rows of V**T (the right singular + vectors) are returned in the array VT; + = 'O': the first min(m,n) rows of V**T (the right singular + vectors) are overwritten on the array A; + = 'N': no rows of V**T (no right singular vectors) are + computed. + + JOBVT and JOBU cannot both be 'O'. + + M (input) INTEGER + The number of rows of the input matrix A. M >= 0. + + N (input) INTEGER + The number of columns of the input matrix A. N >= 0. + + A (input/output) DOUBLE PRECISION array, dimension (LDA,N) + On entry, the M-by-N matrix A. + On exit, + if JOBU = 'O', A is overwritten with the first min(m,n) + columns of U (the left singular vectors, + stored columnwise); + if JOBVT = 'O', A is overwritten with the first min(m,n) + rows of V**T (the right singular vectors, + stored rowwise); + if JOBU .ne. 'O' and JOBVT .ne. 'O', the contents of A + are destroyed. + + LDA (input) INTEGER + The leading dimension of the array A. LDA >= max(1,M). + + S (output) DOUBLE PRECISION array, dimension (min(M,N)) + The singular values of A, sorted so that S(i) >= S(i+1). + + U (output) DOUBLE PRECISION array, dimension (LDU,UCOL) + (LDU,M) if JOBU = 'A' or (LDU,min(M,N)) if JOBU = 'S'. + If JOBU = 'A', U contains the M-by-M orthogonal matrix U; + if JOBU = 'S', U contains the first min(m,n) columns of U + (the left singular vectors, stored columnwise); + if JOBU = 'N' or 'O', U is not referenced. + + LDU (input) INTEGER + The leading dimension of the array U. LDU >= 1; if + JOBU = 'S' or 'A', LDU >= M. + + VT (output) DOUBLE PRECISION array, dimension (LDVT,N) + If JOBVT = 'A', VT contains the N-by-N orthogonal matrix + V**T; + if JOBVT = 'S', VT contains the first min(m,n) rows of + V**T (the right singular vectors, stored rowwise); + if JOBVT = 'N' or 'O', VT is not referenced. + + LDVT (input) INTEGER + The leading dimension of the array VT. LDVT >= 1; if + JOBVT = 'A', LDVT >= N; if JOBVT = 'S', LDVT >= min(M,N). + + WORK (workspace/output) DOUBLE PRECISION array, dimension (LWORK) + On exit, if INFO = 0, WORK(1) returns the optimal LWORK; + if INFO > 0, WORK(2:MIN(M,N)) contains the unconverged + superdiagonal elements of an upper bidiagonal matrix B + whose diagonal is in S (not necessarily sorted). B + satisfies A = U * B * VT, so it has the same singular values + as A, and singular vectors related by U and VT. + + LWORK (input) INTEGER + The dimension of the array WORK. LWORK >= 1. + LWORK >= MAX(3*MIN(M,N)+MAX(M,N),5*MIN(M,N)). + For good performance, LWORK should generally be larger. + + If LWORK = -1, then a workspace query is assumed; the routine + only calculates the optimal size of the WORK array, returns + this value as the first entry of the WORK array, and no error + message related to LWORK is issued by XERBLA. + + INFO (output) INTEGER + = 0: successful exit. + < 0: if INFO = -i, the i-th argument had an illegal value. + > 0: if DBDSQR did not converge, INFO specifies how many + superdiagonals of an intermediate bidiagonal form B + did not converge to zero. See the description of WORK + above for details. + + ===================================================================== + + + Test the input arguments Parameter adjustments */ a_dim1 = *lda; @@ -251,6 +249,7 @@ static doublereal c_b438 = 1.; wntvo = lsame_(jobvt, "O"); wntvn = lsame_(jobvt, "N"); minwrk = 1; + maxwrk = minwrk; lquery = *lwork == -1; if (! (wntua || wntus || wntuo || wntun)) { @@ -269,11 +268,11 @@ static doublereal c_b438 = 1.; *info = -11; } -/* Compute workspace - (Note: Comments in the code beginning "Workspace:" describe the - minimal amount of workspace needed at that point in the code, - as well as the preferred amount for good performance. - NB refers to the optimal block size for the immediately +/* Compute workspace + (Note: Comments in the code beginning "Workspace:" describe the + minimal amount of workspace needed at that point in the code, + as well as the preferred amount for good performance. + NB refers to the optimal block size for the immediately following subroutine, as returned by ILAENV.) */ if (*info == 0 && (*lwork >= 1 || lquery) && *m > 0 && *n > 0) { @@ -290,7 +289,7 @@ static doublereal c_b438 = 1.; maxwrk = *n + *n * ilaenv_(&c__1, "DGEQRF", " ", m, n, & c_n1, &c_n1, (ftnlen)6, (ftnlen)1); /* Computing MAX */ - i__2 = maxwrk, i__3 = *n * 3 + (*n << 1) * ilaenv_(&c__1, + i__2 = maxwrk, i__3 = *n * 3 + (*n << 1) * ilaenv_(&c__1, "DGEBRD", " ", n, n, &c_n1, &c_n1, (ftnlen)6, ( ftnlen)1); maxwrk = max(i__2,i__3); @@ -313,11 +312,11 @@ static doublereal c_b438 = 1.; wrkbl = *n + *n * ilaenv_(&c__1, "DGEQRF", " ", m, n, & c_n1, &c_n1, (ftnlen)6, (ftnlen)1); /* Computing MAX */ - i__2 = wrkbl, i__3 = *n + *n * ilaenv_(&c__1, "DORGQR", + i__2 = wrkbl, i__3 = *n + *n * ilaenv_(&c__1, "DORGQR", " ", m, n, n, &c_n1, (ftnlen)6, (ftnlen)1); wrkbl = max(i__2,i__3); /* Computing MAX */ - i__2 = wrkbl, i__3 = *n * 3 + (*n << 1) * ilaenv_(&c__1, + i__2 = wrkbl, i__3 = *n * 3 + (*n << 1) * ilaenv_(&c__1, "DGEBRD", " ", n, n, &c_n1, &c_n1, (ftnlen)6, ( ftnlen)1); wrkbl = max(i__2,i__3); @@ -335,17 +334,17 @@ static doublereal c_b438 = 1.; maxwrk = max(maxwrk,minwrk); } else if (wntuo && wntvas) { -/* Path 3 (M much larger than N, JOBU='O', JOBVT='S' or +/* Path 3 (M much larger than N, JOBU='O', JOBVT='S' or 'A') */ wrkbl = *n + *n * ilaenv_(&c__1, "DGEQRF", " ", m, n, & c_n1, &c_n1, (ftnlen)6, (ftnlen)1); /* Computing MAX */ - i__2 = wrkbl, i__3 = *n + *n * ilaenv_(&c__1, "DORGQR", + i__2 = wrkbl, i__3 = *n + *n * ilaenv_(&c__1, "DORGQR", " ", m, n, n, &c_n1, (ftnlen)6, (ftnlen)1); wrkbl = max(i__2,i__3); /* Computing MAX */ - i__2 = wrkbl, i__3 = *n * 3 + (*n << 1) * ilaenv_(&c__1, + i__2 = wrkbl, i__3 = *n * 3 + (*n << 1) * ilaenv_(&c__1, "DGEBRD", " ", n, n, &c_n1, &c_n1, (ftnlen)6, ( ftnlen)1); wrkbl = max(i__2,i__3); @@ -354,7 +353,7 @@ static doublereal c_b438 = 1.; , "Q", n, n, n, &c_n1, (ftnlen)6, (ftnlen)1); wrkbl = max(i__2,i__3); /* Computing MAX */ - i__2 = wrkbl, i__3 = *n * 3 + (*n - 1) * ilaenv_(&c__1, + i__2 = wrkbl, i__3 = *n * 3 + (*n - 1) * ilaenv_(&c__1, "DORGBR", "P", n, n, n, &c_n1, (ftnlen)6, (ftnlen) 1); wrkbl = max(i__2,i__3); @@ -373,11 +372,11 @@ static doublereal c_b438 = 1.; wrkbl = *n + *n * ilaenv_(&c__1, "DGEQRF", " ", m, n, & c_n1, &c_n1, (ftnlen)6, (ftnlen)1); /* Computing MAX */ - i__2 = wrkbl, i__3 = *n + *n * ilaenv_(&c__1, "DORGQR", + i__2 = wrkbl, i__3 = *n + *n * ilaenv_(&c__1, "DORGQR", " ", m, n, n, &c_n1, (ftnlen)6, (ftnlen)1); wrkbl = max(i__2,i__3); /* Computing MAX */ - i__2 = wrkbl, i__3 = *n * 3 + (*n << 1) * ilaenv_(&c__1, + i__2 = wrkbl, i__3 = *n * 3 + (*n << 1) * ilaenv_(&c__1, "DGEBRD", " ", n, n, &c_n1, &c_n1, (ftnlen)6, ( ftnlen)1); wrkbl = max(i__2,i__3); @@ -398,11 +397,11 @@ static doublereal c_b438 = 1.; wrkbl = *n + *n * ilaenv_(&c__1, "DGEQRF", " ", m, n, & c_n1, &c_n1, (ftnlen)6, (ftnlen)1); /* Computing MAX */ - i__2 = wrkbl, i__3 = *n + *n * ilaenv_(&c__1, "DORGQR", + i__2 = wrkbl, i__3 = *n + *n * ilaenv_(&c__1, "DORGQR", " ", m, n, n, &c_n1, (ftnlen)6, (ftnlen)1); wrkbl = max(i__2,i__3); /* Computing MAX */ - i__2 = wrkbl, i__3 = *n * 3 + (*n << 1) * ilaenv_(&c__1, + i__2 = wrkbl, i__3 = *n * 3 + (*n << 1) * ilaenv_(&c__1, "DGEBRD", " ", n, n, &c_n1, &c_n1, (ftnlen)6, ( ftnlen)1); wrkbl = max(i__2,i__3); @@ -411,7 +410,7 @@ static doublereal c_b438 = 1.; , "Q", n, n, n, &c_n1, (ftnlen)6, (ftnlen)1); wrkbl = max(i__2,i__3); /* Computing MAX */ - i__2 = wrkbl, i__3 = *n * 3 + (*n - 1) * ilaenv_(&c__1, + i__2 = wrkbl, i__3 = *n * 3 + (*n - 1) * ilaenv_(&c__1, "DORGBR", "P", n, n, n, &c_n1, (ftnlen)6, (ftnlen) 1); wrkbl = max(i__2,i__3); @@ -423,17 +422,17 @@ static doublereal c_b438 = 1.; maxwrk = max(maxwrk,minwrk); } else if (wntus && wntvas) { -/* Path 6 (M much larger than N, JOBU='S', JOBVT='S' or +/* Path 6 (M much larger than N, JOBU='S', JOBVT='S' or 'A') */ wrkbl = *n + *n * ilaenv_(&c__1, "DGEQRF", " ", m, n, & c_n1, &c_n1, (ftnlen)6, (ftnlen)1); /* Computing MAX */ - i__2 = wrkbl, i__3 = *n + *n * ilaenv_(&c__1, "DORGQR", + i__2 = wrkbl, i__3 = *n + *n * ilaenv_(&c__1, "DORGQR", " ", m, n, n, &c_n1, (ftnlen)6, (ftnlen)1); wrkbl = max(i__2,i__3); /* Computing MAX */ - i__2 = wrkbl, i__3 = *n * 3 + (*n << 1) * ilaenv_(&c__1, + i__2 = wrkbl, i__3 = *n * 3 + (*n << 1) * ilaenv_(&c__1, "DGEBRD", " ", n, n, &c_n1, &c_n1, (ftnlen)6, ( ftnlen)1); wrkbl = max(i__2,i__3); @@ -442,7 +441,7 @@ static doublereal c_b438 = 1.; , "Q", n, n, n, &c_n1, (ftnlen)6, (ftnlen)1); wrkbl = max(i__2,i__3); /* Computing MAX */ - i__2 = wrkbl, i__3 = *n * 3 + (*n - 1) * ilaenv_(&c__1, + i__2 = wrkbl, i__3 = *n * 3 + (*n - 1) * ilaenv_(&c__1, "DORGBR", "P", n, n, n, &c_n1, (ftnlen)6, (ftnlen) 1); wrkbl = max(i__2,i__3); @@ -459,11 +458,11 @@ static doublereal c_b438 = 1.; wrkbl = *n + *n * ilaenv_(&c__1, "DGEQRF", " ", m, n, & c_n1, &c_n1, (ftnlen)6, (ftnlen)1); /* Computing MAX */ - i__2 = wrkbl, i__3 = *n + *m * ilaenv_(&c__1, "DORGQR", + i__2 = wrkbl, i__3 = *n + *m * ilaenv_(&c__1, "DORGQR", " ", m, m, n, &c_n1, (ftnlen)6, (ftnlen)1); wrkbl = max(i__2,i__3); /* Computing MAX */ - i__2 = wrkbl, i__3 = *n * 3 + (*n << 1) * ilaenv_(&c__1, + i__2 = wrkbl, i__3 = *n * 3 + (*n << 1) * ilaenv_(&c__1, "DGEBRD", " ", n, n, &c_n1, &c_n1, (ftnlen)6, ( ftnlen)1); wrkbl = max(i__2,i__3); @@ -484,11 +483,11 @@ static doublereal c_b438 = 1.; wrkbl = *n + *n * ilaenv_(&c__1, "DGEQRF", " ", m, n, & c_n1, &c_n1, (ftnlen)6, (ftnlen)1); /* Computing MAX */ - i__2 = wrkbl, i__3 = *n + *m * ilaenv_(&c__1, "DORGQR", + i__2 = wrkbl, i__3 = *n + *m * ilaenv_(&c__1, "DORGQR", " ", m, m, n, &c_n1, (ftnlen)6, (ftnlen)1); wrkbl = max(i__2,i__3); /* Computing MAX */ - i__2 = wrkbl, i__3 = *n * 3 + (*n << 1) * ilaenv_(&c__1, + i__2 = wrkbl, i__3 = *n * 3 + (*n << 1) * ilaenv_(&c__1, "DGEBRD", " ", n, n, &c_n1, &c_n1, (ftnlen)6, ( ftnlen)1); wrkbl = max(i__2,i__3); @@ -497,7 +496,7 @@ static doublereal c_b438 = 1.; , "Q", n, n, n, &c_n1, (ftnlen)6, (ftnlen)1); wrkbl = max(i__2,i__3); /* Computing MAX */ - i__2 = wrkbl, i__3 = *n * 3 + (*n - 1) * ilaenv_(&c__1, + i__2 = wrkbl, i__3 = *n * 3 + (*n - 1) * ilaenv_(&c__1, "DORGBR", "P", n, n, n, &c_n1, (ftnlen)6, (ftnlen) 1); wrkbl = max(i__2,i__3); @@ -509,17 +508,17 @@ static doublereal c_b438 = 1.; maxwrk = max(maxwrk,minwrk); } else if (wntua && wntvas) { -/* Path 9 (M much larger than N, JOBU='A', JOBVT='S' or +/* Path 9 (M much larger than N, JOBU='A', JOBVT='S' or 'A') */ wrkbl = *n + *n * ilaenv_(&c__1, "DGEQRF", " ", m, n, & c_n1, &c_n1, (ftnlen)6, (ftnlen)1); /* Computing MAX */ - i__2 = wrkbl, i__3 = *n + *m * ilaenv_(&c__1, "DORGQR", + i__2 = wrkbl, i__3 = *n + *m * ilaenv_(&c__1, "DORGQR", " ", m, m, n, &c_n1, (ftnlen)6, (ftnlen)1); wrkbl = max(i__2,i__3); /* Computing MAX */ - i__2 = wrkbl, i__3 = *n * 3 + (*n << 1) * ilaenv_(&c__1, + i__2 = wrkbl, i__3 = *n * 3 + (*n << 1) * ilaenv_(&c__1, "DGEBRD", " ", n, n, &c_n1, &c_n1, (ftnlen)6, ( ftnlen)1); wrkbl = max(i__2,i__3); @@ -528,7 +527,7 @@ static doublereal c_b438 = 1.; , "Q", n, n, n, &c_n1, (ftnlen)6, (ftnlen)1); wrkbl = max(i__2,i__3); /* Computing MAX */ - i__2 = wrkbl, i__3 = *n * 3 + (*n - 1) * ilaenv_(&c__1, + i__2 = wrkbl, i__3 = *n * 3 + (*n - 1) * ilaenv_(&c__1, "DORGBR", "P", n, n, n, &c_n1, (ftnlen)6, (ftnlen) 1); wrkbl = max(i__2,i__3); @@ -559,7 +558,7 @@ static doublereal c_b438 = 1.; } if (! wntvn) { /* Computing MAX */ - i__2 = maxwrk, i__3 = *n * 3 + (*n - 1) * ilaenv_(&c__1, + i__2 = maxwrk, i__3 = *n * 3 + (*n - 1) * ilaenv_(&c__1, "DORGBR", "P", n, n, n, &c_n1, (ftnlen)6, (ftnlen) 1); maxwrk = max(i__2,i__3); @@ -583,13 +582,13 @@ static doublereal c_b438 = 1.; maxwrk = *m + *m * ilaenv_(&c__1, "DGELQF", " ", m, n, & c_n1, &c_n1, (ftnlen)6, (ftnlen)1); /* Computing MAX */ - i__2 = maxwrk, i__3 = *m * 3 + (*m << 1) * ilaenv_(&c__1, + i__2 = maxwrk, i__3 = *m * 3 + (*m << 1) * ilaenv_(&c__1, "DGEBRD", " ", m, m, &c_n1, &c_n1, (ftnlen)6, ( ftnlen)1); maxwrk = max(i__2,i__3); if (wntuo || wntuas) { /* Computing MAX */ - i__2 = maxwrk, i__3 = *m * 3 + *m * ilaenv_(&c__1, + i__2 = maxwrk, i__3 = *m * 3 + *m * ilaenv_(&c__1, "DORGBR", "Q", m, m, m, &c_n1, (ftnlen)6, ( ftnlen)1); maxwrk = max(i__2,i__3); @@ -606,16 +605,16 @@ static doublereal c_b438 = 1.; wrkbl = *m + *m * ilaenv_(&c__1, "DGELQF", " ", m, n, & c_n1, &c_n1, (ftnlen)6, (ftnlen)1); /* Computing MAX */ - i__2 = wrkbl, i__3 = *m + *m * ilaenv_(&c__1, "DORGLQ", + i__2 = wrkbl, i__3 = *m + *m * ilaenv_(&c__1, "DORGLQ", " ", m, n, m, &c_n1, (ftnlen)6, (ftnlen)1); wrkbl = max(i__2,i__3); /* Computing MAX */ - i__2 = wrkbl, i__3 = *m * 3 + (*m << 1) * ilaenv_(&c__1, + i__2 = wrkbl, i__3 = *m * 3 + (*m << 1) * ilaenv_(&c__1, "DGEBRD", " ", m, m, &c_n1, &c_n1, (ftnlen)6, ( ftnlen)1); wrkbl = max(i__2,i__3); /* Computing MAX */ - i__2 = wrkbl, i__3 = *m * 3 + (*m - 1) * ilaenv_(&c__1, + i__2 = wrkbl, i__3 = *m * 3 + (*m - 1) * ilaenv_(&c__1, "DORGBR", "P", m, m, m, &c_n1, (ftnlen)6, (ftnlen) 1); wrkbl = max(i__2,i__3); @@ -629,22 +628,22 @@ static doublereal c_b438 = 1.; maxwrk = max(maxwrk,minwrk); } else if (wntvo && wntuas) { -/* Path 3t(N much larger than M, JOBU='S' or 'A', +/* Path 3t(N much larger than M, JOBU='S' or 'A', JOBVT='O') */ wrkbl = *m + *m * ilaenv_(&c__1, "DGELQF", " ", m, n, & c_n1, &c_n1, (ftnlen)6, (ftnlen)1); /* Computing MAX */ - i__2 = wrkbl, i__3 = *m + *m * ilaenv_(&c__1, "DORGLQ", + i__2 = wrkbl, i__3 = *m + *m * ilaenv_(&c__1, "DORGLQ", " ", m, n, m, &c_n1, (ftnlen)6, (ftnlen)1); wrkbl = max(i__2,i__3); /* Computing MAX */ - i__2 = wrkbl, i__3 = *m * 3 + (*m << 1) * ilaenv_(&c__1, + i__2 = wrkbl, i__3 = *m * 3 + (*m << 1) * ilaenv_(&c__1, "DGEBRD", " ", m, m, &c_n1, &c_n1, (ftnlen)6, ( ftnlen)1); wrkbl = max(i__2,i__3); /* Computing MAX */ - i__2 = wrkbl, i__3 = *m * 3 + (*m - 1) * ilaenv_(&c__1, + i__2 = wrkbl, i__3 = *m * 3 + (*m - 1) * ilaenv_(&c__1, "DORGBR", "P", m, m, m, &c_n1, (ftnlen)6, (ftnlen) 1); wrkbl = max(i__2,i__3); @@ -667,16 +666,16 @@ static doublereal c_b438 = 1.; wrkbl = *m + *m * ilaenv_(&c__1, "DGELQF", " ", m, n, & c_n1, &c_n1, (ftnlen)6, (ftnlen)1); /* Computing MAX */ - i__2 = wrkbl, i__3 = *m + *m * ilaenv_(&c__1, "DORGLQ", + i__2 = wrkbl, i__3 = *m + *m * ilaenv_(&c__1, "DORGLQ", " ", m, n, m, &c_n1, (ftnlen)6, (ftnlen)1); wrkbl = max(i__2,i__3); /* Computing MAX */ - i__2 = wrkbl, i__3 = *m * 3 + (*m << 1) * ilaenv_(&c__1, + i__2 = wrkbl, i__3 = *m * 3 + (*m << 1) * ilaenv_(&c__1, "DGEBRD", " ", m, m, &c_n1, &c_n1, (ftnlen)6, ( ftnlen)1); wrkbl = max(i__2,i__3); /* Computing MAX */ - i__2 = wrkbl, i__3 = *m * 3 + (*m - 1) * ilaenv_(&c__1, + i__2 = wrkbl, i__3 = *m * 3 + (*m - 1) * ilaenv_(&c__1, "DORGBR", "P", m, m, m, &c_n1, (ftnlen)6, (ftnlen) 1); wrkbl = max(i__2,i__3); @@ -693,16 +692,16 @@ static doublereal c_b438 = 1.; wrkbl = *m + *m * ilaenv_(&c__1, "DGELQF", " ", m, n, & c_n1, &c_n1, (ftnlen)6, (ftnlen)1); /* Computing MAX */ - i__2 = wrkbl, i__3 = *m + *m * ilaenv_(&c__1, "DORGLQ", + i__2 = wrkbl, i__3 = *m + *m * ilaenv_(&c__1, "DORGLQ", " ", m, n, m, &c_n1, (ftnlen)6, (ftnlen)1); wrkbl = max(i__2,i__3); /* Computing MAX */ - i__2 = wrkbl, i__3 = *m * 3 + (*m << 1) * ilaenv_(&c__1, + i__2 = wrkbl, i__3 = *m * 3 + (*m << 1) * ilaenv_(&c__1, "DGEBRD", " ", m, m, &c_n1, &c_n1, (ftnlen)6, ( ftnlen)1); wrkbl = max(i__2,i__3); /* Computing MAX */ - i__2 = wrkbl, i__3 = *m * 3 + (*m - 1) * ilaenv_(&c__1, + i__2 = wrkbl, i__3 = *m * 3 + (*m - 1) * ilaenv_(&c__1, "DORGBR", "P", m, m, m, &c_n1, (ftnlen)6, (ftnlen) 1); wrkbl = max(i__2,i__3); @@ -718,22 +717,22 @@ static doublereal c_b438 = 1.; maxwrk = max(maxwrk,minwrk); } else if (wntvs && wntuas) { -/* Path 6t(N much larger than M, JOBU='S' or 'A', +/* Path 6t(N much larger than M, JOBU='S' or 'A', JOBVT='S') */ wrkbl = *m + *m * ilaenv_(&c__1, "DGELQF", " ", m, n, & c_n1, &c_n1, (ftnlen)6, (ftnlen)1); /* Computing MAX */ - i__2 = wrkbl, i__3 = *m + *m * ilaenv_(&c__1, "DORGLQ", + i__2 = wrkbl, i__3 = *m + *m * ilaenv_(&c__1, "DORGLQ", " ", m, n, m, &c_n1, (ftnlen)6, (ftnlen)1); wrkbl = max(i__2,i__3); /* Computing MAX */ - i__2 = wrkbl, i__3 = *m * 3 + (*m << 1) * ilaenv_(&c__1, + i__2 = wrkbl, i__3 = *m * 3 + (*m << 1) * ilaenv_(&c__1, "DGEBRD", " ", m, m, &c_n1, &c_n1, (ftnlen)6, ( ftnlen)1); wrkbl = max(i__2,i__3); /* Computing MAX */ - i__2 = wrkbl, i__3 = *m * 3 + (*m - 1) * ilaenv_(&c__1, + i__2 = wrkbl, i__3 = *m * 3 + (*m - 1) * ilaenv_(&c__1, "DORGBR", "P", m, m, m, &c_n1, (ftnlen)6, (ftnlen) 1); wrkbl = max(i__2,i__3); @@ -754,16 +753,16 @@ static doublereal c_b438 = 1.; wrkbl = *m + *m * ilaenv_(&c__1, "DGELQF", " ", m, n, & c_n1, &c_n1, (ftnlen)6, (ftnlen)1); /* Computing MAX */ - i__2 = wrkbl, i__3 = *m + *n * ilaenv_(&c__1, "DORGLQ", + i__2 = wrkbl, i__3 = *m + *n * ilaenv_(&c__1, "DORGLQ", " ", n, n, m, &c_n1, (ftnlen)6, (ftnlen)1); wrkbl = max(i__2,i__3); /* Computing MAX */ - i__2 = wrkbl, i__3 = *m * 3 + (*m << 1) * ilaenv_(&c__1, + i__2 = wrkbl, i__3 = *m * 3 + (*m << 1) * ilaenv_(&c__1, "DGEBRD", " ", m, m, &c_n1, &c_n1, (ftnlen)6, ( ftnlen)1); wrkbl = max(i__2,i__3); /* Computing MAX */ - i__2 = wrkbl, i__3 = *m * 3 + (*m - 1) * ilaenv_(&c__1, + i__2 = wrkbl, i__3 = *m * 3 + (*m - 1) * ilaenv_(&c__1, "DORGBR", "P", m, m, m, &c_n1, (ftnlen)6, (ftnlen) 1); wrkbl = max(i__2,i__3); @@ -780,16 +779,16 @@ static doublereal c_b438 = 1.; wrkbl = *m + *m * ilaenv_(&c__1, "DGELQF", " ", m, n, & c_n1, &c_n1, (ftnlen)6, (ftnlen)1); /* Computing MAX */ - i__2 = wrkbl, i__3 = *m + *n * ilaenv_(&c__1, "DORGLQ", + i__2 = wrkbl, i__3 = *m + *n * ilaenv_(&c__1, "DORGLQ", " ", n, n, m, &c_n1, (ftnlen)6, (ftnlen)1); wrkbl = max(i__2,i__3); /* Computing MAX */ - i__2 = wrkbl, i__3 = *m * 3 + (*m << 1) * ilaenv_(&c__1, + i__2 = wrkbl, i__3 = *m * 3 + (*m << 1) * ilaenv_(&c__1, "DGEBRD", " ", m, m, &c_n1, &c_n1, (ftnlen)6, ( ftnlen)1); wrkbl = max(i__2,i__3); /* Computing MAX */ - i__2 = wrkbl, i__3 = *m * 3 + (*m - 1) * ilaenv_(&c__1, + i__2 = wrkbl, i__3 = *m * 3 + (*m - 1) * ilaenv_(&c__1, "DORGBR", "P", m, m, m, &c_n1, (ftnlen)6, (ftnlen) 1); wrkbl = max(i__2,i__3); @@ -805,22 +804,22 @@ static doublereal c_b438 = 1.; maxwrk = max(maxwrk,minwrk); } else if (wntva && wntuas) { -/* Path 9t(N much larger than M, JOBU='S' or 'A', +/* Path 9t(N much larger than M, JOBU='S' or 'A', JOBVT='A') */ wrkbl = *m + *m * ilaenv_(&c__1, "DGELQF", " ", m, n, & c_n1, &c_n1, (ftnlen)6, (ftnlen)1); /* Computing MAX */ - i__2 = wrkbl, i__3 = *m + *n * ilaenv_(&c__1, "DORGLQ", + i__2 = wrkbl, i__3 = *m + *n * ilaenv_(&c__1, "DORGLQ", " ", n, n, m, &c_n1, (ftnlen)6, (ftnlen)1); wrkbl = max(i__2,i__3); /* Computing MAX */ - i__2 = wrkbl, i__3 = *m * 3 + (*m << 1) * ilaenv_(&c__1, + i__2 = wrkbl, i__3 = *m * 3 + (*m << 1) * ilaenv_(&c__1, "DGEBRD", " ", m, m, &c_n1, &c_n1, (ftnlen)6, ( ftnlen)1); wrkbl = max(i__2,i__3); /* Computing MAX */ - i__2 = wrkbl, i__3 = *m * 3 + (*m - 1) * ilaenv_(&c__1, + i__2 = wrkbl, i__3 = *m * 3 + (*m - 1) * ilaenv_(&c__1, "DORGBR", "P", m, m, m, &c_n1, (ftnlen)6, (ftnlen) 1); wrkbl = max(i__2,i__3); @@ -855,7 +854,7 @@ static doublereal c_b438 = 1.; } if (! wntun) { /* Computing MAX */ - i__2 = maxwrk, i__3 = *m * 3 + (*m - 1) * ilaenv_(&c__1, + i__2 = maxwrk, i__3 = *m * 3 + (*m - 1) * ilaenv_(&c__1, "DORGBR", "Q", m, m, m, &c_n1, (ftnlen)6, (ftnlen) 1); maxwrk = max(i__2,i__3); @@ -912,21 +911,21 @@ static doublereal c_b438 = 1.; if (*m >= *n) { -/* A has at least as many rows as columns. If A has sufficiently - more rows than columns, first reduce using the QR +/* A has at least as many rows as columns. If A has sufficiently + more rows than columns, first reduce using the QR decomposition (if sufficient workspace available) */ if (*m >= mnthr) { if (wntun) { -/* Path 1 (M much larger than N, JOBU='N') +/* Path 1 (M much larger than N, JOBU='N') No left singular vectors to be computed */ itau = 1; iwork = itau + *n; -/* Compute A=Q*R +/* Compute A=Q*R (Workspace: need 2*N, prefer N+N*NB) */ i__2 = *lwork - iwork + 1; @@ -937,14 +936,14 @@ static doublereal c_b438 = 1.; i__2 = *n - 1; i__3 = *n - 1; - dlaset_("L", &i__2, &i__3, &c_b416, &c_b416, &a_ref(2, 1), + dlaset_("L", &i__2, &i__3, &c_b416, &c_b416, &a_ref(2, 1), lda); ie = 1; itauq = ie + *n; itaup = itauq + *n; iwork = itaup + *n; -/* Bidiagonalize R in A +/* Bidiagonalize R in A (Workspace: need 4*N, prefer 3*N+2*N*NB) */ i__2 = *lwork - iwork + 1; @@ -953,7 +952,7 @@ static doublereal c_b438 = 1.; ncvt = 0; if (wntvo || wntvas) { -/* If right singular vectors desired, generate P'. +/* If right singular vectors desired, generate P'. (Workspace: need 4*N-1, prefer 3*N+(N-1)*NB) */ i__2 = *lwork - iwork + 1; @@ -963,26 +962,26 @@ static doublereal c_b438 = 1.; } iwork = ie + *n; -/* Perform bidiagonal QR iteration, computing right - singular vectors of A in A if desired +/* Perform bidiagonal QR iteration, computing right + singular vectors of A in A if desired (Workspace: need BDSPAC) */ dbdsqr_("U", n, &ncvt, &c__0, &c__0, &s[1], &work[ie], &a[ - a_offset], lda, dum, &c__1, dum, &c__1, &work[iwork], + a_offset], lda, dum, &c__1, dum, &c__1, &work[iwork], info); /* If right singular vectors desired in VT, copy them there */ if (wntvas) { - dlacpy_("F", n, n, &a[a_offset], lda, &vt[vt_offset], + dlacpy_("F", n, n, &a[a_offset], lda, &vt[vt_offset], ldvt); } } else if (wntuo && wntvn) { -/* Path 2 (M much larger than N, JOBU='O', JOBVT='N') - N left singular vectors to be overwritten on A and - no right singular vectors to be computed +/* Path 2 (M much larger than N, JOBU='O', JOBVT='N') + N left singular vectors to be overwritten on A and + no right singular vectors to be computed Computing MAX */ i__2 = *n << 2; @@ -1019,7 +1018,7 @@ static doublereal c_b438 = 1.; itau = ir + ldwrkr * *n; iwork = itau + *n; -/* Compute A=Q*R +/* Compute A=Q*R (Workspace: need N*N+2*N, prefer N*N+N+N*NB) */ i__2 = *lwork - iwork + 1; @@ -1034,7 +1033,7 @@ static doublereal c_b438 = 1.; dlaset_("L", &i__2, &i__3, &c_b416, &c_b416, &work[ir + 1] , &ldwrkr); -/* Generate Q in A +/* Generate Q in A (Workspace: need N*N+2*N, prefer N*N+N+N*NB) */ i__2 = *lwork - iwork + 1; @@ -1045,14 +1044,14 @@ static doublereal c_b438 = 1.; itaup = itauq + *n; iwork = itaup + *n; -/* Bidiagonalize R in WORK(IR) +/* Bidiagonalize R in WORK(IR) (Workspace: need N*N+4*N, prefer N*N+3*N+2*N*NB) */ i__2 = *lwork - iwork + 1; dgebrd_(n, n, &work[ir], &ldwrkr, &s[1], &work[ie], &work[ itauq], &work[itaup], &work[iwork], &i__2, &ierr); -/* Generate left vectors bidiagonalizing R +/* Generate left vectors bidiagonalizing R (Workspace: need N*N+4*N, prefer N*N+3*N+N*NB) */ i__2 = *lwork - iwork + 1; @@ -1060,8 +1059,8 @@ static doublereal c_b438 = 1.; work[iwork], &i__2, &ierr); iwork = ie + *n; -/* Perform bidiagonal QR iteration, computing left - singular vectors of R in WORK(IR) +/* Perform bidiagonal QR iteration, computing left + singular vectors of R in WORK(IR) (Workspace: need N*N+BDSPAC) */ dbdsqr_("U", n, &c__0, n, &c__0, &s[1], &work[ie], dum, & @@ -1069,8 +1068,8 @@ static doublereal c_b438 = 1.; , info); iu = ie + *n; -/* Multiply Q in A by left singular vectors of R in - WORK(IR), storing result in WORK(IU) and copying to A +/* Multiply Q in A by left singular vectors of R in + WORK(IR), storing result in WORK(IU) and copying to A (Workspace: need N*N+2*N, prefer N*N+M*N+N) */ i__2 = *m; @@ -1097,14 +1096,14 @@ static doublereal c_b438 = 1.; itaup = itauq + *n; iwork = itaup + *n; -/* Bidiagonalize A +/* Bidiagonalize A (Workspace: need 3*N+M, prefer 3*N+(M+N)*NB) */ i__3 = *lwork - iwork + 1; dgebrd_(m, n, &a[a_offset], lda, &s[1], &work[ie], &work[ itauq], &work[itaup], &work[iwork], &i__3, &ierr); -/* Generate left vectors bidiagonalizing A +/* Generate left vectors bidiagonalizing A (Workspace: need 4*N, prefer 3*N+N*NB) */ i__3 = *lwork - iwork + 1; @@ -1112,8 +1111,8 @@ static doublereal c_b438 = 1.; work[iwork], &i__3, &ierr); iwork = ie + *n; -/* Perform bidiagonal QR iteration, computing left - singular vectors of A in A +/* Perform bidiagonal QR iteration, computing left + singular vectors of A in A (Workspace: need BDSPAC) */ dbdsqr_("U", n, &c__0, m, &c__0, &s[1], &work[ie], dum, & @@ -1124,9 +1123,9 @@ static doublereal c_b438 = 1.; } else if (wntuo && wntvas) { -/* Path 3 (M much larger than N, JOBU='O', JOBVT='S' or 'A') - N left singular vectors to be overwritten on A and - N right singular vectors to be computed in VT +/* Path 3 (M much larger than N, JOBU='O', JOBVT='S' or 'A') + N left singular vectors to be overwritten on A and + N right singular vectors to be computed in VT Computing MAX */ i__3 = *n << 2; @@ -1163,7 +1162,7 @@ static doublereal c_b438 = 1.; itau = ir + ldwrkr * *n; iwork = itau + *n; -/* Compute A=Q*R +/* Compute A=Q*R (Workspace: need N*N+2*N, prefer N*N+N+N*NB) */ i__3 = *lwork - iwork + 1; @@ -1172,14 +1171,14 @@ static doublereal c_b438 = 1.; /* Copy R to VT, zeroing out below it */ - dlacpy_("U", n, n, &a[a_offset], lda, &vt[vt_offset], + dlacpy_("U", n, n, &a[a_offset], lda, &vt[vt_offset], ldvt); i__3 = *n - 1; i__2 = *n - 1; dlaset_("L", &i__3, &i__2, &c_b416, &c_b416, &vt_ref(2, 1) , ldvt); -/* Generate Q in A +/* Generate Q in A (Workspace: need N*N+2*N, prefer N*N+N+N*NB) */ i__3 = *lwork - iwork + 1; @@ -1190,7 +1189,7 @@ static doublereal c_b438 = 1.; itaup = itauq + *n; iwork = itaup + *n; -/* Bidiagonalize R in VT, copying result to WORK(IR) +/* Bidiagonalize R in VT, copying result to WORK(IR) (Workspace: need N*N+4*N, prefer N*N+3*N+2*N*NB) */ i__3 = *lwork - iwork + 1; @@ -1200,33 +1199,33 @@ static doublereal c_b438 = 1.; dlacpy_("L", n, n, &vt[vt_offset], ldvt, &work[ir], & ldwrkr); -/* Generate left vectors bidiagonalizing R in WORK(IR) +/* Generate left vectors bidiagonalizing R in WORK(IR) (Workspace: need N*N+4*N, prefer N*N+3*N+N*NB) */ i__3 = *lwork - iwork + 1; dorgbr_("Q", n, n, n, &work[ir], &ldwrkr, &work[itauq], & work[iwork], &i__3, &ierr); -/* Generate right vectors bidiagonalizing R in VT +/* Generate right vectors bidiagonalizing R in VT (Workspace: need N*N+4*N-1, prefer N*N+3*N+(N-1)*NB) */ i__3 = *lwork - iwork + 1; - dorgbr_("P", n, n, n, &vt[vt_offset], ldvt, &work[itaup], + dorgbr_("P", n, n, n, &vt[vt_offset], ldvt, &work[itaup], &work[iwork], &i__3, &ierr); iwork = ie + *n; -/* Perform bidiagonal QR iteration, computing left - singular vectors of R in WORK(IR) and computing right - singular vectors of R in VT +/* Perform bidiagonal QR iteration, computing left + singular vectors of R in WORK(IR) and computing right + singular vectors of R in VT (Workspace: need N*N+BDSPAC) */ dbdsqr_("U", n, n, n, &c__0, &s[1], &work[ie], &vt[ - vt_offset], ldvt, &work[ir], &ldwrkr, dum, &c__1, + vt_offset], ldvt, &work[ir], &ldwrkr, dum, &c__1, &work[iwork], info); iu = ie + *n; -/* Multiply Q in A by left singular vectors of R in - WORK(IR), storing result in WORK(IU) and copying to A +/* Multiply Q in A by left singular vectors of R in + WORK(IR), storing result in WORK(IU) and copying to A (Workspace: need N*N+2*N, prefer N*N+M*N+N) */ i__3 = *m; @@ -1251,7 +1250,7 @@ static doublereal c_b438 = 1.; itau = 1; iwork = itau + *n; -/* Compute A=Q*R +/* Compute A=Q*R (Workspace: need 2*N, prefer N+N*NB) */ i__2 = *lwork - iwork + 1; @@ -1260,14 +1259,14 @@ static doublereal c_b438 = 1.; /* Copy R to VT, zeroing out below it */ - dlacpy_("U", n, n, &a[a_offset], lda, &vt[vt_offset], + dlacpy_("U", n, n, &a[a_offset], lda, &vt[vt_offset], ldvt); i__2 = *n - 1; i__3 = *n - 1; dlaset_("L", &i__2, &i__3, &c_b416, &c_b416, &vt_ref(2, 1) , ldvt); -/* Generate Q in A +/* Generate Q in A (Workspace: need 2*N, prefer N+N*NB) */ i__2 = *lwork - iwork + 1; @@ -1278,7 +1277,7 @@ static doublereal c_b438 = 1.; itaup = itauq + *n; iwork = itaup + *n; -/* Bidiagonalize R in VT +/* Bidiagonalize R in VT (Workspace: need 4*N, prefer 3*N+2*N*NB) */ i__2 = *lwork - iwork + 1; @@ -1286,7 +1285,7 @@ static doublereal c_b438 = 1.; work[itauq], &work[itaup], &work[iwork], &i__2, & ierr); -/* Multiply Q in A by left vectors bidiagonalizing R +/* Multiply Q in A by left vectors bidiagonalizing R (Workspace: need 3*N+M, prefer 3*N+M*NB) */ i__2 = *lwork - iwork + 1; @@ -1294,17 +1293,17 @@ static doublereal c_b438 = 1.; work[itauq], &a[a_offset], lda, &work[iwork], & i__2, &ierr); -/* Generate right vectors bidiagonalizing R in VT +/* Generate right vectors bidiagonalizing R in VT (Workspace: need 4*N-1, prefer 3*N+(N-1)*NB) */ i__2 = *lwork - iwork + 1; - dorgbr_("P", n, n, n, &vt[vt_offset], ldvt, &work[itaup], + dorgbr_("P", n, n, n, &vt[vt_offset], ldvt, &work[itaup], &work[iwork], &i__2, &ierr); iwork = ie + *n; -/* Perform bidiagonal QR iteration, computing left - singular vectors of A in A and computing right - singular vectors of A in VT +/* Perform bidiagonal QR iteration, computing left + singular vectors of A in A and computing right + singular vectors of A in VT (Workspace: need BDSPAC) */ dbdsqr_("U", n, n, m, &c__0, &s[1], &work[ie], &vt[ @@ -1317,9 +1316,9 @@ static doublereal c_b438 = 1.; if (wntvn) { -/* Path 4 (M much larger than N, JOBU='S', JOBVT='N') - N left singular vectors to be computed in U and - no right singular vectors to be computed +/* Path 4 (M much larger than N, JOBU='S', JOBVT='N') + N left singular vectors to be computed in U and + no right singular vectors to be computed Computing MAX */ i__2 = *n << 2; @@ -1342,7 +1341,7 @@ static doublereal c_b438 = 1.; itau = ir + ldwrkr * *n; iwork = itau + *n; -/* Compute A=Q*R +/* Compute A=Q*R (Workspace: need N*N+2*N, prefer N*N+N+N*NB) */ i__2 = *lwork - iwork + 1; @@ -1355,10 +1354,10 @@ static doublereal c_b438 = 1.; ldwrkr); i__2 = *n - 1; i__3 = *n - 1; - dlaset_("L", &i__2, &i__3, &c_b416, &c_b416, &work[ir + dlaset_("L", &i__2, &i__3, &c_b416, &c_b416, &work[ir + 1], &ldwrkr); -/* Generate Q in A +/* Generate Q in A (Workspace: need N*N+2*N, prefer N*N+N+N*NB) */ i__2 = *lwork - iwork + 1; @@ -1369,7 +1368,7 @@ static doublereal c_b438 = 1.; itaup = itauq + *n; iwork = itaup + *n; -/* Bidiagonalize R in WORK(IR) +/* Bidiagonalize R in WORK(IR) (Workspace: need N*N+4*N, prefer N*N+3*N+2*N*NB) */ i__2 = *lwork - iwork + 1; @@ -1377,7 +1376,7 @@ static doublereal c_b438 = 1.; work[itauq], &work[itaup], &work[iwork], & i__2, &ierr); -/* Generate left vectors bidiagonalizing R in WORK(IR) +/* Generate left vectors bidiagonalizing R in WORK(IR) (Workspace: need N*N+4*N, prefer N*N+3*N+N*NB) */ i__2 = *lwork - iwork + 1; @@ -1385,20 +1384,20 @@ static doublereal c_b438 = 1.; , &work[iwork], &i__2, &ierr); iwork = ie + *n; -/* Perform bidiagonal QR iteration, computing left - singular vectors of R in WORK(IR) +/* Perform bidiagonal QR iteration, computing left + singular vectors of R in WORK(IR) (Workspace: need N*N+BDSPAC) */ - dbdsqr_("U", n, &c__0, n, &c__0, &s[1], &work[ie], + dbdsqr_("U", n, &c__0, n, &c__0, &s[1], &work[ie], dum, &c__1, &work[ir], &ldwrkr, dum, &c__1, & work[iwork], info); -/* Multiply Q in A by left singular vectors of R in - WORK(IR), storing result in U +/* Multiply Q in A by left singular vectors of R in + WORK(IR), storing result in U (Workspace: need N*N) */ - dgemm_("N", "N", m, n, n, &c_b438, &a[a_offset], lda, - &work[ir], &ldwrkr, &c_b416, &u[u_offset], + dgemm_("N", "N", m, n, n, &c_b438, &a[a_offset], lda, + &work[ir], &ldwrkr, &c_b416, &u[u_offset], ldu); } else { @@ -1408,16 +1407,16 @@ static doublereal c_b438 = 1.; itau = 1; iwork = itau + *n; -/* Compute A=Q*R, copying result to U +/* Compute A=Q*R, copying result to U (Workspace: need 2*N, prefer N+N*NB) */ i__2 = *lwork - iwork + 1; dgeqrf_(m, n, &a[a_offset], lda, &work[itau], &work[ iwork], &i__2, &ierr); - dlacpy_("L", m, n, &a[a_offset], lda, &u[u_offset], + dlacpy_("L", m, n, &a[a_offset], lda, &u[u_offset], ldu); -/* Generate Q in U +/* Generate Q in U (Workspace: need 2*N, prefer N+N*NB) */ i__2 = *lwork - iwork + 1; @@ -1435,7 +1434,7 @@ static doublereal c_b438 = 1.; dlaset_("L", &i__2, &i__3, &c_b416, &c_b416, &a_ref(2, 1), lda); -/* Bidiagonalize R in A +/* Bidiagonalize R in A (Workspace: need 4*N, prefer 3*N+2*N*NB) */ i__2 = *lwork - iwork + 1; @@ -1443,21 +1442,21 @@ static doublereal c_b438 = 1.; work[itauq], &work[itaup], &work[iwork], & i__2, &ierr); -/* Multiply Q in U by left vectors bidiagonalizing R +/* Multiply Q in U by left vectors bidiagonalizing R (Workspace: need 3*N+M, prefer 3*N+M*NB) */ i__2 = *lwork - iwork + 1; dormbr_("Q", "R", "N", m, n, n, &a[a_offset], lda, & - work[itauq], &u[u_offset], ldu, &work[iwork], + work[itauq], &u[u_offset], ldu, &work[iwork], &i__2, &ierr) ; iwork = ie + *n; -/* Perform bidiagonal QR iteration, computing left - singular vectors of A in U +/* Perform bidiagonal QR iteration, computing left + singular vectors of A in U (Workspace: need BDSPAC) */ - dbdsqr_("U", n, &c__0, m, &c__0, &s[1], &work[ie], + dbdsqr_("U", n, &c__0, m, &c__0, &s[1], &work[ie], dum, &c__1, &u[u_offset], ldu, dum, &c__1, & work[iwork], info); @@ -1465,9 +1464,9 @@ static doublereal c_b438 = 1.; } else if (wntvo) { -/* Path 5 (M much larger than N, JOBU='S', JOBVT='O') - N left singular vectors to be computed in U and - N right singular vectors to be overwritten on A +/* Path 5 (M much larger than N, JOBU='S', JOBVT='O') + N left singular vectors to be computed in U and + N right singular vectors to be overwritten on A Computing MAX */ i__2 = *n << 2; @@ -1501,7 +1500,7 @@ static doublereal c_b438 = 1.; itau = ir + ldwrkr * *n; iwork = itau + *n; -/* Compute A=Q*R +/* Compute A=Q*R (Workspace: need 2*N*N+2*N, prefer 2*N*N+N+N*NB) */ i__2 = *lwork - iwork + 1; @@ -1514,10 +1513,10 @@ static doublereal c_b438 = 1.; ldwrku); i__2 = *n - 1; i__3 = *n - 1; - dlaset_("L", &i__2, &i__3, &c_b416, &c_b416, &work[iu + dlaset_("L", &i__2, &i__3, &c_b416, &c_b416, &work[iu + 1], &ldwrku); -/* Generate Q in A +/* Generate Q in A (Workspace: need 2*N*N+2*N, prefer 2*N*N+N+N*NB) */ i__2 = *lwork - iwork + 1; @@ -1528,9 +1527,9 @@ static doublereal c_b438 = 1.; itaup = itauq + *n; iwork = itaup + *n; -/* Bidiagonalize R in WORK(IU), copying result to - WORK(IR) - (Workspace: need 2*N*N+4*N, +/* Bidiagonalize R in WORK(IU), copying result to + WORK(IR) + (Workspace: need 2*N*N+4*N, prefer 2*N*N+3*N+2*N*NB) */ i__2 = *lwork - iwork + 1; @@ -1540,15 +1539,15 @@ static doublereal c_b438 = 1.; dlacpy_("U", n, n, &work[iu], &ldwrku, &work[ir], & ldwrkr); -/* Generate left bidiagonalizing vectors in WORK(IU) +/* Generate left bidiagonalizing vectors in WORK(IU) (Workspace: need 2*N*N+4*N, prefer 2*N*N+3*N+N*NB) */ i__2 = *lwork - iwork + 1; dorgbr_("Q", n, n, n, &work[iu], &ldwrku, &work[itauq] , &work[iwork], &i__2, &ierr); -/* Generate right bidiagonalizing vectors in WORK(IR) - (Workspace: need 2*N*N+4*N-1, +/* Generate right bidiagonalizing vectors in WORK(IR) + (Workspace: need 2*N*N+4*N-1, prefer 2*N*N+3*N+(N-1)*NB) */ i__2 = *lwork - iwork + 1; @@ -1556,27 +1555,27 @@ static doublereal c_b438 = 1.; , &work[iwork], &i__2, &ierr); iwork = ie + *n; -/* Perform bidiagonal QR iteration, computing left - singular vectors of R in WORK(IU) and computing - right singular vectors of R in WORK(IR) +/* Perform bidiagonal QR iteration, computing left + singular vectors of R in WORK(IU) and computing + right singular vectors of R in WORK(IR) (Workspace: need 2*N*N+BDSPAC) */ dbdsqr_("U", n, n, n, &c__0, &s[1], &work[ie], &work[ - ir], &ldwrkr, &work[iu], &ldwrku, dum, &c__1, + ir], &ldwrkr, &work[iu], &ldwrku, dum, &c__1, &work[iwork], info); -/* Multiply Q in A by left singular vectors of R in - WORK(IU), storing result in U +/* Multiply Q in A by left singular vectors of R in + WORK(IU), storing result in U (Workspace: need N*N) */ - dgemm_("N", "N", m, n, n, &c_b438, &a[a_offset], lda, - &work[iu], &ldwrku, &c_b416, &u[u_offset], + dgemm_("N", "N", m, n, n, &c_b438, &a[a_offset], lda, + &work[iu], &ldwrku, &c_b416, &u[u_offset], ldu); -/* Copy right singular vectors of R to A +/* Copy right singular vectors of R to A (Workspace: need N*N) */ - dlacpy_("F", n, n, &work[ir], &ldwrkr, &a[a_offset], + dlacpy_("F", n, n, &work[ir], &ldwrkr, &a[a_offset], lda); } else { @@ -1586,16 +1585,16 @@ static doublereal c_b438 = 1.; itau = 1; iwork = itau + *n; -/* Compute A=Q*R, copying result to U +/* Compute A=Q*R, copying result to U (Workspace: need 2*N, prefer N+N*NB) */ i__2 = *lwork - iwork + 1; dgeqrf_(m, n, &a[a_offset], lda, &work[itau], &work[ iwork], &i__2, &ierr); - dlacpy_("L", m, n, &a[a_offset], lda, &u[u_offset], + dlacpy_("L", m, n, &a[a_offset], lda, &u[u_offset], ldu); -/* Generate Q in U +/* Generate Q in U (Workspace: need 2*N, prefer N+N*NB) */ i__2 = *lwork - iwork + 1; @@ -1613,7 +1612,7 @@ static doublereal c_b438 = 1.; dlaset_("L", &i__2, &i__3, &c_b416, &c_b416, &a_ref(2, 1), lda); -/* Bidiagonalize R in A +/* Bidiagonalize R in A (Workspace: need 4*N, prefer 3*N+2*N*NB) */ i__2 = *lwork - iwork + 1; @@ -1621,16 +1620,16 @@ static doublereal c_b438 = 1.; work[itauq], &work[itaup], &work[iwork], & i__2, &ierr); -/* Multiply Q in U by left vectors bidiagonalizing R +/* Multiply Q in U by left vectors bidiagonalizing R (Workspace: need 3*N+M, prefer 3*N+M*NB) */ i__2 = *lwork - iwork + 1; dormbr_("Q", "R", "N", m, n, n, &a[a_offset], lda, & - work[itauq], &u[u_offset], ldu, &work[iwork], + work[itauq], &u[u_offset], ldu, &work[iwork], &i__2, &ierr) ; -/* Generate right vectors bidiagonalizing R in A +/* Generate right vectors bidiagonalizing R in A (Workspace: need 4*N-1, prefer 3*N+(N-1)*NB) */ i__2 = *lwork - iwork + 1; @@ -1638,9 +1637,9 @@ static doublereal c_b438 = 1.; &work[iwork], &i__2, &ierr); iwork = ie + *n; -/* Perform bidiagonal QR iteration, computing left - singular vectors of A in U and computing right - singular vectors of A in A +/* Perform bidiagonal QR iteration, computing left + singular vectors of A in U and computing right + singular vectors of A in A (Workspace: need BDSPAC) */ dbdsqr_("U", n, n, m, &c__0, &s[1], &work[ie], &a[ @@ -1651,10 +1650,10 @@ static doublereal c_b438 = 1.; } else if (wntvas) { -/* Path 6 (M much larger than N, JOBU='S', JOBVT='S' - or 'A') - N left singular vectors to be computed in U and - N right singular vectors to be computed in VT +/* Path 6 (M much larger than N, JOBU='S', JOBVT='S' + or 'A') + N left singular vectors to be computed in U and + N right singular vectors to be computed in VT Computing MAX */ i__2 = *n << 2; @@ -1677,7 +1676,7 @@ static doublereal c_b438 = 1.; itau = iu + ldwrku * *n; iwork = itau + *n; -/* Compute A=Q*R +/* Compute A=Q*R (Workspace: need N*N+2*N, prefer N*N+N+N*NB) */ i__2 = *lwork - iwork + 1; @@ -1690,10 +1689,10 @@ static doublereal c_b438 = 1.; ldwrku); i__2 = *n - 1; i__3 = *n - 1; - dlaset_("L", &i__2, &i__3, &c_b416, &c_b416, &work[iu + dlaset_("L", &i__2, &i__3, &c_b416, &c_b416, &work[iu + 1], &ldwrku); -/* Generate Q in A +/* Generate Q in A (Workspace: need N*N+2*N, prefer N*N+N+N*NB) */ i__2 = *lwork - iwork + 1; @@ -1704,7 +1703,7 @@ static doublereal c_b438 = 1.; itaup = itauq + *n; iwork = itaup + *n; -/* Bidiagonalize R in WORK(IU), copying result to VT +/* Bidiagonalize R in WORK(IU), copying result to VT (Workspace: need N*N+4*N, prefer N*N+3*N+2*N*NB) */ i__2 = *lwork - iwork + 1; @@ -1714,15 +1713,15 @@ static doublereal c_b438 = 1.; dlacpy_("U", n, n, &work[iu], &ldwrku, &vt[vt_offset], ldvt); -/* Generate left bidiagonalizing vectors in WORK(IU) +/* Generate left bidiagonalizing vectors in WORK(IU) (Workspace: need N*N+4*N, prefer N*N+3*N+N*NB) */ i__2 = *lwork - iwork + 1; dorgbr_("Q", n, n, n, &work[iu], &ldwrku, &work[itauq] , &work[iwork], &i__2, &ierr); -/* Generate right bidiagonalizing vectors in VT - (Workspace: need N*N+4*N-1, +/* Generate right bidiagonalizing vectors in VT + (Workspace: need N*N+4*N-1, prefer N*N+3*N+(N-1)*NB) */ i__2 = *lwork - iwork + 1; @@ -1731,21 +1730,21 @@ static doublereal c_b438 = 1.; ; iwork = ie + *n; -/* Perform bidiagonal QR iteration, computing left - singular vectors of R in WORK(IU) and computing - right singular vectors of R in VT +/* Perform bidiagonal QR iteration, computing left + singular vectors of R in WORK(IU) and computing + right singular vectors of R in VT (Workspace: need N*N+BDSPAC) */ dbdsqr_("U", n, n, n, &c__0, &s[1], &work[ie], &vt[ vt_offset], ldvt, &work[iu], &ldwrku, dum, & c__1, &work[iwork], info); -/* Multiply Q in A by left singular vectors of R in - WORK(IU), storing result in U +/* Multiply Q in A by left singular vectors of R in + WORK(IU), storing result in U (Workspace: need N*N) */ - dgemm_("N", "N", m, n, n, &c_b438, &a[a_offset], lda, - &work[iu], &ldwrku, &c_b416, &u[u_offset], + dgemm_("N", "N", m, n, n, &c_b438, &a[a_offset], lda, + &work[iu], &ldwrku, &c_b416, &u[u_offset], ldu); } else { @@ -1755,16 +1754,16 @@ static doublereal c_b438 = 1.; itau = 1; iwork = itau + *n; -/* Compute A=Q*R, copying result to U +/* Compute A=Q*R, copying result to U (Workspace: need 2*N, prefer N+N*NB) */ i__2 = *lwork - iwork + 1; dgeqrf_(m, n, &a[a_offset], lda, &work[itau], &work[ iwork], &i__2, &ierr); - dlacpy_("L", m, n, &a[a_offset], lda, &u[u_offset], + dlacpy_("L", m, n, &a[a_offset], lda, &u[u_offset], ldu); -/* Generate Q in U +/* Generate Q in U (Workspace: need 2*N, prefer N+N*NB) */ i__2 = *lwork - iwork + 1; @@ -1773,7 +1772,7 @@ static doublereal c_b438 = 1.; /* Copy R to VT, zeroing out below it */ - dlacpy_("U", n, n, &a[a_offset], lda, &vt[vt_offset], + dlacpy_("U", n, n, &a[a_offset], lda, &vt[vt_offset], ldvt); i__2 = *n - 1; i__3 = *n - 1; @@ -1784,24 +1783,24 @@ static doublereal c_b438 = 1.; itaup = itauq + *n; iwork = itaup + *n; -/* Bidiagonalize R in VT +/* Bidiagonalize R in VT (Workspace: need 4*N, prefer 3*N+2*N*NB) */ i__2 = *lwork - iwork + 1; - dgebrd_(n, n, &vt[vt_offset], ldvt, &s[1], &work[ie], + dgebrd_(n, n, &vt[vt_offset], ldvt, &s[1], &work[ie], &work[itauq], &work[itaup], &work[iwork], & i__2, &ierr); -/* Multiply Q in U by left bidiagonalizing vectors - in VT +/* Multiply Q in U by left bidiagonalizing vectors + in VT (Workspace: need 3*N+M, prefer 3*N+M*NB) */ i__2 = *lwork - iwork + 1; - dormbr_("Q", "R", "N", m, n, n, &vt[vt_offset], ldvt, + dormbr_("Q", "R", "N", m, n, n, &vt[vt_offset], ldvt, &work[itauq], &u[u_offset], ldu, &work[iwork], &i__2, &ierr); -/* Generate right bidiagonalizing vectors in VT +/* Generate right bidiagonalizing vectors in VT (Workspace: need 4*N-1, prefer 3*N+(N-1)*NB) */ i__2 = *lwork - iwork + 1; @@ -1810,9 +1809,9 @@ static doublereal c_b438 = 1.; ; iwork = ie + *n; -/* Perform bidiagonal QR iteration, computing left - singular vectors of A in U and computing right - singular vectors of A in VT +/* Perform bidiagonal QR iteration, computing left + singular vectors of A in U and computing right + singular vectors of A in VT (Workspace: need BDSPAC) */ dbdsqr_("U", n, n, m, &c__0, &s[1], &work[ie], &vt[ @@ -1827,9 +1826,9 @@ static doublereal c_b438 = 1.; if (wntvn) { -/* Path 7 (M much larger than N, JOBU='A', JOBVT='N') - M left singular vectors to be computed in U and - no right singular vectors to be computed +/* Path 7 (M much larger than N, JOBU='A', JOBVT='N') + M left singular vectors to be computed in U and + no right singular vectors to be computed Computing MAX */ i__2 = *n + *m, i__3 = *n << 2, i__2 = max(i__2,i__3); @@ -1852,13 +1851,13 @@ static doublereal c_b438 = 1.; itau = ir + ldwrkr * *n; iwork = itau + *n; -/* Compute A=Q*R, copying result to U +/* Compute A=Q*R, copying result to U (Workspace: need N*N+2*N, prefer N*N+N+N*NB) */ i__2 = *lwork - iwork + 1; dgeqrf_(m, n, &a[a_offset], lda, &work[itau], &work[ iwork], &i__2, &ierr); - dlacpy_("L", m, n, &a[a_offset], lda, &u[u_offset], + dlacpy_("L", m, n, &a[a_offset], lda, &u[u_offset], ldu); /* Copy R to WORK(IR), zeroing out below it */ @@ -1867,10 +1866,10 @@ static doublereal c_b438 = 1.; ldwrkr); i__2 = *n - 1; i__3 = *n - 1; - dlaset_("L", &i__2, &i__3, &c_b416, &c_b416, &work[ir + dlaset_("L", &i__2, &i__3, &c_b416, &c_b416, &work[ir + 1], &ldwrkr); -/* Generate Q in U +/* Generate Q in U (Workspace: need N*N+N+M, prefer N*N+N+M*NB) */ i__2 = *lwork - iwork + 1; @@ -1881,7 +1880,7 @@ static doublereal c_b438 = 1.; itaup = itauq + *n; iwork = itaup + *n; -/* Bidiagonalize R in WORK(IR) +/* Bidiagonalize R in WORK(IR) (Workspace: need N*N+4*N, prefer N*N+3*N+2*N*NB) */ i__2 = *lwork - iwork + 1; @@ -1889,7 +1888,7 @@ static doublereal c_b438 = 1.; work[itauq], &work[itaup], &work[iwork], & i__2, &ierr); -/* Generate left bidiagonalizing vectors in WORK(IR) +/* Generate left bidiagonalizing vectors in WORK(IR) (Workspace: need N*N+4*N, prefer N*N+3*N+N*NB) */ i__2 = *lwork - iwork + 1; @@ -1897,25 +1896,25 @@ static doublereal c_b438 = 1.; , &work[iwork], &i__2, &ierr); iwork = ie + *n; -/* Perform bidiagonal QR iteration, computing left - singular vectors of R in WORK(IR) +/* Perform bidiagonal QR iteration, computing left + singular vectors of R in WORK(IR) (Workspace: need N*N+BDSPAC) */ - dbdsqr_("U", n, &c__0, n, &c__0, &s[1], &work[ie], + dbdsqr_("U", n, &c__0, n, &c__0, &s[1], &work[ie], dum, &c__1, &work[ir], &ldwrkr, dum, &c__1, & work[iwork], info); -/* Multiply Q in U by left singular vectors of R in - WORK(IR), storing result in A +/* Multiply Q in U by left singular vectors of R in + WORK(IR), storing result in A (Workspace: need N*N) */ - dgemm_("N", "N", m, n, n, &c_b438, &u[u_offset], ldu, - &work[ir], &ldwrkr, &c_b416, &a[a_offset], + dgemm_("N", "N", m, n, n, &c_b438, &u[u_offset], ldu, + &work[ir], &ldwrkr, &c_b416, &a[a_offset], lda); /* Copy left singular vectors of A from A to U */ - dlacpy_("F", m, n, &a[a_offset], lda, &u[u_offset], + dlacpy_("F", m, n, &a[a_offset], lda, &u[u_offset], ldu); } else { @@ -1925,16 +1924,16 @@ static doublereal c_b438 = 1.; itau = 1; iwork = itau + *n; -/* Compute A=Q*R, copying result to U +/* Compute A=Q*R, copying result to U (Workspace: need 2*N, prefer N+N*NB) */ i__2 = *lwork - iwork + 1; dgeqrf_(m, n, &a[a_offset], lda, &work[itau], &work[ iwork], &i__2, &ierr); - dlacpy_("L", m, n, &a[a_offset], lda, &u[u_offset], + dlacpy_("L", m, n, &a[a_offset], lda, &u[u_offset], ldu); -/* Generate Q in U +/* Generate Q in U (Workspace: need N+M, prefer N+M*NB) */ i__2 = *lwork - iwork + 1; @@ -1952,7 +1951,7 @@ static doublereal c_b438 = 1.; dlaset_("L", &i__2, &i__3, &c_b416, &c_b416, &a_ref(2, 1), lda); -/* Bidiagonalize R in A +/* Bidiagonalize R in A (Workspace: need 4*N, prefer 3*N+2*N*NB) */ i__2 = *lwork - iwork + 1; @@ -1960,22 +1959,22 @@ static doublereal c_b438 = 1.; work[itauq], &work[itaup], &work[iwork], & i__2, &ierr); -/* Multiply Q in U by left bidiagonalizing vectors - in A +/* Multiply Q in U by left bidiagonalizing vectors + in A (Workspace: need 3*N+M, prefer 3*N+M*NB) */ i__2 = *lwork - iwork + 1; dormbr_("Q", "R", "N", m, n, n, &a[a_offset], lda, & - work[itauq], &u[u_offset], ldu, &work[iwork], + work[itauq], &u[u_offset], ldu, &work[iwork], &i__2, &ierr) ; iwork = ie + *n; -/* Perform bidiagonal QR iteration, computing left - singular vectors of A in U +/* Perform bidiagonal QR iteration, computing left + singular vectors of A in U (Workspace: need BDSPAC) */ - dbdsqr_("U", n, &c__0, m, &c__0, &s[1], &work[ie], + dbdsqr_("U", n, &c__0, m, &c__0, &s[1], &work[ie], dum, &c__1, &u[u_offset], ldu, dum, &c__1, & work[iwork], info); @@ -1983,9 +1982,9 @@ static doublereal c_b438 = 1.; } else if (wntvo) { -/* Path 8 (M much larger than N, JOBU='A', JOBVT='O') - M left singular vectors to be computed in U and - N right singular vectors to be overwritten on A +/* Path 8 (M much larger than N, JOBU='A', JOBVT='O') + M left singular vectors to be computed in U and + N right singular vectors to be overwritten on A Computing MAX */ i__2 = *n + *m, i__3 = *n << 2, i__2 = max(i__2,i__3); @@ -2019,16 +2018,16 @@ static doublereal c_b438 = 1.; itau = ir + ldwrkr * *n; iwork = itau + *n; -/* Compute A=Q*R, copying result to U +/* Compute A=Q*R, copying result to U (Workspace: need 2*N*N+2*N, prefer 2*N*N+N+N*NB) */ i__2 = *lwork - iwork + 1; dgeqrf_(m, n, &a[a_offset], lda, &work[itau], &work[ iwork], &i__2, &ierr); - dlacpy_("L", m, n, &a[a_offset], lda, &u[u_offset], + dlacpy_("L", m, n, &a[a_offset], lda, &u[u_offset], ldu); -/* Generate Q in U +/* Generate Q in U (Workspace: need 2*N*N+N+M, prefer 2*N*N+N+M*NB) */ i__2 = *lwork - iwork + 1; @@ -2041,16 +2040,16 @@ static doublereal c_b438 = 1.; ldwrku); i__2 = *n - 1; i__3 = *n - 1; - dlaset_("L", &i__2, &i__3, &c_b416, &c_b416, &work[iu + dlaset_("L", &i__2, &i__3, &c_b416, &c_b416, &work[iu + 1], &ldwrku); ie = itau; itauq = ie + *n; itaup = itauq + *n; iwork = itaup + *n; -/* Bidiagonalize R in WORK(IU), copying result to - WORK(IR) - (Workspace: need 2*N*N+4*N, +/* Bidiagonalize R in WORK(IU), copying result to + WORK(IR) + (Workspace: need 2*N*N+4*N, prefer 2*N*N+3*N+2*N*NB) */ i__2 = *lwork - iwork + 1; @@ -2060,15 +2059,15 @@ static doublereal c_b438 = 1.; dlacpy_("U", n, n, &work[iu], &ldwrku, &work[ir], & ldwrkr); -/* Generate left bidiagonalizing vectors in WORK(IU) +/* Generate left bidiagonalizing vectors in WORK(IU) (Workspace: need 2*N*N+4*N, prefer 2*N*N+3*N+N*NB) */ i__2 = *lwork - iwork + 1; dorgbr_("Q", n, n, n, &work[iu], &ldwrku, &work[itauq] , &work[iwork], &i__2, &ierr); -/* Generate right bidiagonalizing vectors in WORK(IR) - (Workspace: need 2*N*N+4*N-1, +/* Generate right bidiagonalizing vectors in WORK(IR) + (Workspace: need 2*N*N+4*N-1, prefer 2*N*N+3*N+(N-1)*NB) */ i__2 = *lwork - iwork + 1; @@ -2076,31 +2075,31 @@ static doublereal c_b438 = 1.; , &work[iwork], &i__2, &ierr); iwork = ie + *n; -/* Perform bidiagonal QR iteration, computing left - singular vectors of R in WORK(IU) and computing - right singular vectors of R in WORK(IR) +/* Perform bidiagonal QR iteration, computing left + singular vectors of R in WORK(IU) and computing + right singular vectors of R in WORK(IR) (Workspace: need 2*N*N+BDSPAC) */ dbdsqr_("U", n, n, n, &c__0, &s[1], &work[ie], &work[ - ir], &ldwrkr, &work[iu], &ldwrku, dum, &c__1, + ir], &ldwrkr, &work[iu], &ldwrku, dum, &c__1, &work[iwork], info); -/* Multiply Q in U by left singular vectors of R in - WORK(IU), storing result in A +/* Multiply Q in U by left singular vectors of R in + WORK(IU), storing result in A (Workspace: need N*N) */ - dgemm_("N", "N", m, n, n, &c_b438, &u[u_offset], ldu, - &work[iu], &ldwrku, &c_b416, &a[a_offset], + dgemm_("N", "N", m, n, n, &c_b438, &u[u_offset], ldu, + &work[iu], &ldwrku, &c_b416, &a[a_offset], lda); /* Copy left singular vectors of A from A to U */ - dlacpy_("F", m, n, &a[a_offset], lda, &u[u_offset], + dlacpy_("F", m, n, &a[a_offset], lda, &u[u_offset], ldu); /* Copy right singular vectors of R from WORK(IR) to A */ - dlacpy_("F", n, n, &work[ir], &ldwrkr, &a[a_offset], + dlacpy_("F", n, n, &work[ir], &ldwrkr, &a[a_offset], lda); } else { @@ -2110,16 +2109,16 @@ static doublereal c_b438 = 1.; itau = 1; iwork = itau + *n; -/* Compute A=Q*R, copying result to U +/* Compute A=Q*R, copying result to U (Workspace: need 2*N, prefer N+N*NB) */ i__2 = *lwork - iwork + 1; dgeqrf_(m, n, &a[a_offset], lda, &work[itau], &work[ iwork], &i__2, &ierr); - dlacpy_("L", m, n, &a[a_offset], lda, &u[u_offset], + dlacpy_("L", m, n, &a[a_offset], lda, &u[u_offset], ldu); -/* Generate Q in U +/* Generate Q in U (Workspace: need N+M, prefer N+M*NB) */ i__2 = *lwork - iwork + 1; @@ -2137,7 +2136,7 @@ static doublereal c_b438 = 1.; dlaset_("L", &i__2, &i__3, &c_b416, &c_b416, &a_ref(2, 1), lda); -/* Bidiagonalize R in A +/* Bidiagonalize R in A (Workspace: need 4*N, prefer 3*N+2*N*NB) */ i__2 = *lwork - iwork + 1; @@ -2145,17 +2144,17 @@ static doublereal c_b438 = 1.; work[itauq], &work[itaup], &work[iwork], & i__2, &ierr); -/* Multiply Q in U by left bidiagonalizing vectors - in A +/* Multiply Q in U by left bidiagonalizing vectors + in A (Workspace: need 3*N+M, prefer 3*N+M*NB) */ i__2 = *lwork - iwork + 1; dormbr_("Q", "R", "N", m, n, n, &a[a_offset], lda, & - work[itauq], &u[u_offset], ldu, &work[iwork], + work[itauq], &u[u_offset], ldu, &work[iwork], &i__2, &ierr) ; -/* Generate right bidiagonalizing vectors in A +/* Generate right bidiagonalizing vectors in A (Workspace: need 4*N-1, prefer 3*N+(N-1)*NB) */ i__2 = *lwork - iwork + 1; @@ -2163,9 +2162,9 @@ static doublereal c_b438 = 1.; &work[iwork], &i__2, &ierr); iwork = ie + *n; -/* Perform bidiagonal QR iteration, computing left - singular vectors of A in U and computing right - singular vectors of A in A +/* Perform bidiagonal QR iteration, computing left + singular vectors of A in U and computing right + singular vectors of A in A (Workspace: need BDSPAC) */ dbdsqr_("U", n, n, m, &c__0, &s[1], &work[ie], &a[ @@ -2176,10 +2175,10 @@ static doublereal c_b438 = 1.; } else if (wntvas) { -/* Path 9 (M much larger than N, JOBU='A', JOBVT='S' - or 'A') - M left singular vectors to be computed in U and - N right singular vectors to be computed in VT +/* Path 9 (M much larger than N, JOBU='A', JOBVT='S' + or 'A') + M left singular vectors to be computed in U and + N right singular vectors to be computed in VT Computing MAX */ i__2 = *n + *m, i__3 = *n << 2, i__2 = max(i__2,i__3); @@ -2202,16 +2201,16 @@ static doublereal c_b438 = 1.; itau = iu + ldwrku * *n; iwork = itau + *n; -/* Compute A=Q*R, copying result to U +/* Compute A=Q*R, copying result to U (Workspace: need N*N+2*N, prefer N*N+N+N*NB) */ i__2 = *lwork - iwork + 1; dgeqrf_(m, n, &a[a_offset], lda, &work[itau], &work[ iwork], &i__2, &ierr); - dlacpy_("L", m, n, &a[a_offset], lda, &u[u_offset], + dlacpy_("L", m, n, &a[a_offset], lda, &u[u_offset], ldu); -/* Generate Q in U +/* Generate Q in U (Workspace: need N*N+N+M, prefer N*N+N+M*NB) */ i__2 = *lwork - iwork + 1; @@ -2224,14 +2223,14 @@ static doublereal c_b438 = 1.; ldwrku); i__2 = *n - 1; i__3 = *n - 1; - dlaset_("L", &i__2, &i__3, &c_b416, &c_b416, &work[iu + dlaset_("L", &i__2, &i__3, &c_b416, &c_b416, &work[iu + 1], &ldwrku); ie = itau; itauq = ie + *n; itaup = itauq + *n; iwork = itaup + *n; -/* Bidiagonalize R in WORK(IU), copying result to VT +/* Bidiagonalize R in WORK(IU), copying result to VT (Workspace: need N*N+4*N, prefer N*N+3*N+2*N*NB) */ i__2 = *lwork - iwork + 1; @@ -2241,15 +2240,15 @@ static doublereal c_b438 = 1.; dlacpy_("U", n, n, &work[iu], &ldwrku, &vt[vt_offset], ldvt); -/* Generate left bidiagonalizing vectors in WORK(IU) +/* Generate left bidiagonalizing vectors in WORK(IU) (Workspace: need N*N+4*N, prefer N*N+3*N+N*NB) */ i__2 = *lwork - iwork + 1; dorgbr_("Q", n, n, n, &work[iu], &ldwrku, &work[itauq] , &work[iwork], &i__2, &ierr); -/* Generate right bidiagonalizing vectors in VT - (Workspace: need N*N+4*N-1, +/* Generate right bidiagonalizing vectors in VT + (Workspace: need N*N+4*N-1, prefer N*N+3*N+(N-1)*NB) */ i__2 = *lwork - iwork + 1; @@ -2258,26 +2257,26 @@ static doublereal c_b438 = 1.; ; iwork = ie + *n; -/* Perform bidiagonal QR iteration, computing left - singular vectors of R in WORK(IU) and computing - right singular vectors of R in VT +/* Perform bidiagonal QR iteration, computing left + singular vectors of R in WORK(IU) and computing + right singular vectors of R in VT (Workspace: need N*N+BDSPAC) */ dbdsqr_("U", n, n, n, &c__0, &s[1], &work[ie], &vt[ vt_offset], ldvt, &work[iu], &ldwrku, dum, & c__1, &work[iwork], info); -/* Multiply Q in U by left singular vectors of R in - WORK(IU), storing result in A +/* Multiply Q in U by left singular vectors of R in + WORK(IU), storing result in A (Workspace: need N*N) */ - dgemm_("N", "N", m, n, n, &c_b438, &u[u_offset], ldu, - &work[iu], &ldwrku, &c_b416, &a[a_offset], + dgemm_("N", "N", m, n, n, &c_b438, &u[u_offset], ldu, + &work[iu], &ldwrku, &c_b416, &a[a_offset], lda); /* Copy left singular vectors of A from A to U */ - dlacpy_("F", m, n, &a[a_offset], lda, &u[u_offset], + dlacpy_("F", m, n, &a[a_offset], lda, &u[u_offset], ldu); } else { @@ -2287,16 +2286,16 @@ static doublereal c_b438 = 1.; itau = 1; iwork = itau + *n; -/* Compute A=Q*R, copying result to U +/* Compute A=Q*R, copying result to U (Workspace: need 2*N, prefer N+N*NB) */ i__2 = *lwork - iwork + 1; dgeqrf_(m, n, &a[a_offset], lda, &work[itau], &work[ iwork], &i__2, &ierr); - dlacpy_("L", m, n, &a[a_offset], lda, &u[u_offset], + dlacpy_("L", m, n, &a[a_offset], lda, &u[u_offset], ldu); -/* Generate Q in U +/* Generate Q in U (Workspace: need N+M, prefer N+M*NB) */ i__2 = *lwork - iwork + 1; @@ -2305,7 +2304,7 @@ static doublereal c_b438 = 1.; /* Copy R from A to VT, zeroing out below it */ - dlacpy_("U", n, n, &a[a_offset], lda, &vt[vt_offset], + dlacpy_("U", n, n, &a[a_offset], lda, &vt[vt_offset], ldvt); i__2 = *n - 1; i__3 = *n - 1; @@ -2316,24 +2315,24 @@ static doublereal c_b438 = 1.; itaup = itauq + *n; iwork = itaup + *n; -/* Bidiagonalize R in VT +/* Bidiagonalize R in VT (Workspace: need 4*N, prefer 3*N+2*N*NB) */ i__2 = *lwork - iwork + 1; - dgebrd_(n, n, &vt[vt_offset], ldvt, &s[1], &work[ie], + dgebrd_(n, n, &vt[vt_offset], ldvt, &s[1], &work[ie], &work[itauq], &work[itaup], &work[iwork], & i__2, &ierr); -/* Multiply Q in U by left bidiagonalizing vectors - in VT +/* Multiply Q in U by left bidiagonalizing vectors + in VT (Workspace: need 3*N+M, prefer 3*N+M*NB) */ i__2 = *lwork - iwork + 1; - dormbr_("Q", "R", "N", m, n, n, &vt[vt_offset], ldvt, + dormbr_("Q", "R", "N", m, n, n, &vt[vt_offset], ldvt, &work[itauq], &u[u_offset], ldu, &work[iwork], &i__2, &ierr); -/* Generate right bidiagonalizing vectors in VT +/* Generate right bidiagonalizing vectors in VT (Workspace: need 4*N-1, prefer 3*N+(N-1)*NB) */ i__2 = *lwork - iwork + 1; @@ -2342,9 +2341,9 @@ static doublereal c_b438 = 1.; ; iwork = ie + *n; -/* Perform bidiagonal QR iteration, computing left - singular vectors of A in U and computing right - singular vectors of A in VT +/* Perform bidiagonal QR iteration, computing left + singular vectors of A in U and computing right + singular vectors of A in VT (Workspace: need BDSPAC) */ dbdsqr_("U", n, n, m, &c__0, &s[1], &work[ie], &vt[ @@ -2359,9 +2358,9 @@ static doublereal c_b438 = 1.; } else { -/* M .LT. MNTHR +/* M .LT. MNTHR - Path 10 (M at least N, but not much larger) + Path 10 (M at least N, but not much larger) Reduce to bidiagonal form without QR decomposition */ ie = 1; @@ -2369,7 +2368,7 @@ static doublereal c_b438 = 1.; itaup = itauq + *n; iwork = itaup + *n; -/* Bidiagonalize A +/* Bidiagonalize A (Workspace: need 3*N+M, prefer 3*N+(M+N)*NB) */ i__2 = *lwork - iwork + 1; @@ -2377,8 +2376,8 @@ static doublereal c_b438 = 1.; work[itaup], &work[iwork], &i__2, &ierr); if (wntuas) { -/* If left singular vectors desired in U, copy result to U - and generate left bidiagonalizing vectors in U +/* If left singular vectors desired in U, copy result to U + and generate left bidiagonalizing vectors in U (Workspace: need 3*N+NCU, prefer 3*N+NCU*NB) */ dlacpy_("L", m, n, &a[a_offset], lda, &u[u_offset], ldu); @@ -2394,8 +2393,8 @@ static doublereal c_b438 = 1.; } if (wntvas) { -/* If right singular vectors desired in VT, copy result to - VT and generate right bidiagonalizing vectors in VT +/* If right singular vectors desired in VT, copy result to + VT and generate right bidiagonalizing vectors in VT (Workspace: need 4*N-1, prefer 3*N+(N-1)*NB) */ dlacpy_("U", n, n, &a[a_offset], lda, &vt[vt_offset], ldvt); @@ -2405,8 +2404,8 @@ static doublereal c_b438 = 1.; } if (wntuo) { -/* If left singular vectors desired in A, generate left - bidiagonalizing vectors in A +/* If left singular vectors desired in A, generate left + bidiagonalizing vectors in A (Workspace: need 4*N, prefer 3*N+N*NB) */ i__2 = *lwork - iwork + 1; @@ -2415,8 +2414,8 @@ static doublereal c_b438 = 1.; } if (wntvo) { -/* If right singular vectors desired in A, generate right - bidiagonalizing vectors in A +/* If right singular vectors desired in A, generate right + bidiagonalizing vectors in A (Workspace: need 4*N-1, prefer 3*N+(N-1)*NB) */ i__2 = *lwork - iwork + 1; @@ -2438,9 +2437,9 @@ static doublereal c_b438 = 1.; } if (! wntuo && ! wntvo) { -/* Perform bidiagonal QR iteration, if desired, computing - left singular vectors in U and computing right singular - vectors in VT +/* Perform bidiagonal QR iteration, if desired, computing + left singular vectors in U and computing right singular + vectors in VT (Workspace: need BDSPAC) */ dbdsqr_("U", n, &ncvt, &nru, &c__0, &s[1], &work[ie], &vt[ @@ -2448,9 +2447,9 @@ static doublereal c_b438 = 1.; work[iwork], info); } else if (! wntuo && wntvo) { -/* Perform bidiagonal QR iteration, if desired, computing - left singular vectors in U and computing right singular - vectors in A +/* Perform bidiagonal QR iteration, if desired, computing + left singular vectors in U and computing right singular + vectors in A (Workspace: need BDSPAC) */ dbdsqr_("U", n, &ncvt, &nru, &c__0, &s[1], &work[ie], &a[ @@ -2458,9 +2457,9 @@ static doublereal c_b438 = 1.; iwork], info); } else { -/* Perform bidiagonal QR iteration, if desired, computing - left singular vectors in A and computing right singular - vectors in VT +/* Perform bidiagonal QR iteration, if desired, computing + left singular vectors in A and computing right singular + vectors in VT (Workspace: need BDSPAC) */ dbdsqr_("U", n, &ncvt, &nru, &c__0, &s[1], &work[ie], &vt[ @@ -2472,21 +2471,21 @@ static doublereal c_b438 = 1.; } else { -/* A has more columns than rows. If A has sufficiently more - columns than rows, first reduce using the LQ decomposition (if +/* A has more columns than rows. If A has sufficiently more + columns than rows, first reduce using the LQ decomposition (if sufficient workspace available) */ if (*n >= mnthr) { if (wntvn) { -/* Path 1t(N much larger than M, JOBVT='N') +/* Path 1t(N much larger than M, JOBVT='N') No right singular vectors to be computed */ itau = 1; iwork = itau + *m; -/* Compute A=L*Q +/* Compute A=L*Q (Workspace: need 2*M, prefer M+M*NB) */ i__2 = *lwork - iwork + 1; @@ -2497,14 +2496,14 @@ static doublereal c_b438 = 1.; i__2 = *m - 1; i__3 = *m - 1; - dlaset_("U", &i__2, &i__3, &c_b416, &c_b416, &a_ref(1, 2), + dlaset_("U", &i__2, &i__3, &c_b416, &c_b416, &a_ref(1, 2), lda); ie = 1; itauq = ie + *m; itaup = itauq + *m; iwork = itaup + *m; -/* Bidiagonalize L in A +/* Bidiagonalize L in A (Workspace: need 4*M, prefer 3*M+2*M*NB) */ i__2 = *lwork - iwork + 1; @@ -2512,7 +2511,7 @@ static doublereal c_b438 = 1.; itauq], &work[itaup], &work[iwork], &i__2, &ierr); if (wntuo || wntuas) { -/* If left singular vectors desired, generate Q +/* If left singular vectors desired, generate Q (Workspace: need 4*M, prefer 3*M+M*NB) */ i__2 = *lwork - iwork + 1; @@ -2525,12 +2524,12 @@ static doublereal c_b438 = 1.; nru = *m; } -/* Perform bidiagonal QR iteration, computing left singular - vectors of A in A if desired +/* Perform bidiagonal QR iteration, computing left singular + vectors of A in A if desired (Workspace: need BDSPAC) */ dbdsqr_("U", m, &c__0, &nru, &c__0, &s[1], &work[ie], dum, & - c__1, &a[a_offset], lda, dum, &c__1, &work[iwork], + c__1, &a[a_offset], lda, dum, &c__1, &work[iwork], info); /* If left singular vectors desired in U, copy them there */ @@ -2541,9 +2540,9 @@ static doublereal c_b438 = 1.; } else if (wntvo && wntun) { -/* Path 2t(N much larger than M, JOBU='N', JOBVT='O') - M right singular vectors to be overwritten on A and - no left singular vectors to be computed +/* Path 2t(N much larger than M, JOBU='N', JOBVT='O') + M right singular vectors to be overwritten on A and + no left singular vectors to be computed Computing MAX */ i__2 = *m << 2; @@ -2583,7 +2582,7 @@ static doublereal c_b438 = 1.; itau = ir + ldwrkr * *m; iwork = itau + *m; -/* Compute A=L*Q +/* Compute A=L*Q (Workspace: need M*M+2*M, prefer M*M+M+M*NB) */ i__2 = *lwork - iwork + 1; @@ -2595,10 +2594,10 @@ static doublereal c_b438 = 1.; dlacpy_("L", m, m, &a[a_offset], lda, &work[ir], &ldwrkr); i__2 = *m - 1; i__3 = *m - 1; - dlaset_("U", &i__2, &i__3, &c_b416, &c_b416, &work[ir + + dlaset_("U", &i__2, &i__3, &c_b416, &c_b416, &work[ir + ldwrkr], &ldwrkr); -/* Generate Q in A +/* Generate Q in A (Workspace: need M*M+2*M, prefer M*M+M+M*NB) */ i__2 = *lwork - iwork + 1; @@ -2609,14 +2608,14 @@ static doublereal c_b438 = 1.; itaup = itauq + *m; iwork = itaup + *m; -/* Bidiagonalize L in WORK(IR) +/* Bidiagonalize L in WORK(IR) (Workspace: need M*M+4*M, prefer M*M+3*M+2*M*NB) */ i__2 = *lwork - iwork + 1; dgebrd_(m, m, &work[ir], &ldwrkr, &s[1], &work[ie], &work[ itauq], &work[itaup], &work[iwork], &i__2, &ierr); -/* Generate right vectors bidiagonalizing L +/* Generate right vectors bidiagonalizing L (Workspace: need M*M+4*M-1, prefer M*M+3*M+(M-1)*NB) */ i__2 = *lwork - iwork + 1; @@ -2624,8 +2623,8 @@ static doublereal c_b438 = 1.; work[iwork], &i__2, &ierr); iwork = ie + *m; -/* Perform bidiagonal QR iteration, computing right - singular vectors of L in WORK(IR) +/* Perform bidiagonal QR iteration, computing right + singular vectors of L in WORK(IR) (Workspace: need M*M+BDSPAC) */ dbdsqr_("U", m, m, &c__0, &c__0, &s[1], &work[ie], &work[ @@ -2633,8 +2632,8 @@ static doublereal c_b438 = 1.; , info); iu = ie + *m; -/* Multiply right singular vectors of L in WORK(IR) by Q - in A, storing result in WORK(IU) and copying to A +/* Multiply right singular vectors of L in WORK(IR) by Q + in A, storing result in WORK(IU) and copying to A (Workspace: need M*M+2*M, prefer M*M+M*N+M) */ i__2 = *n; @@ -2647,7 +2646,7 @@ static doublereal c_b438 = 1.; dgemm_("N", "N", m, &blk, m, &c_b438, &work[ir], & ldwrkr, &a_ref(1, i__), lda, &c_b416, &work[ iu], &ldwrku); - dlacpy_("F", m, &blk, &work[iu], &ldwrku, &a_ref(1, + dlacpy_("F", m, &blk, &work[iu], &ldwrku, &a_ref(1, i__), lda); /* L30: */ } @@ -2661,14 +2660,14 @@ static doublereal c_b438 = 1.; itaup = itauq + *m; iwork = itaup + *m; -/* Bidiagonalize A +/* Bidiagonalize A (Workspace: need 3*M+N, prefer 3*M+(M+N)*NB) */ i__3 = *lwork - iwork + 1; dgebrd_(m, n, &a[a_offset], lda, &s[1], &work[ie], &work[ itauq], &work[itaup], &work[iwork], &i__3, &ierr); -/* Generate right vectors bidiagonalizing A +/* Generate right vectors bidiagonalizing A (Workspace: need 4*M, prefer 3*M+M*NB) */ i__3 = *lwork - iwork + 1; @@ -2676,8 +2675,8 @@ static doublereal c_b438 = 1.; work[iwork], &i__3, &ierr); iwork = ie + *m; -/* Perform bidiagonal QR iteration, computing right - singular vectors of A in A +/* Perform bidiagonal QR iteration, computing right + singular vectors of A in A (Workspace: need BDSPAC) */ dbdsqr_("L", m, n, &c__0, &c__0, &s[1], &work[ie], &a[ @@ -2688,9 +2687,9 @@ static doublereal c_b438 = 1.; } else if (wntvo && wntuas) { -/* Path 3t(N much larger than M, JOBU='S' or 'A', JOBVT='O') - M right singular vectors to be overwritten on A and - M left singular vectors to be computed in U +/* Path 3t(N much larger than M, JOBU='S' or 'A', JOBVT='O') + M right singular vectors to be overwritten on A and + M left singular vectors to be computed in U Computing MAX */ i__3 = *m << 2; @@ -2730,7 +2729,7 @@ static doublereal c_b438 = 1.; itau = ir + ldwrkr * *m; iwork = itau + *m; -/* Compute A=L*Q +/* Compute A=L*Q (Workspace: need M*M+2*M, prefer M*M+M+M*NB) */ i__3 = *lwork - iwork + 1; @@ -2745,7 +2744,7 @@ static doublereal c_b438 = 1.; dlaset_("U", &i__3, &i__2, &c_b416, &c_b416, &u_ref(1, 2), ldu); -/* Generate Q in A +/* Generate Q in A (Workspace: need M*M+2*M, prefer M*M+M+M*NB) */ i__3 = *lwork - iwork + 1; @@ -2756,7 +2755,7 @@ static doublereal c_b438 = 1.; itaup = itauq + *m; iwork = itaup + *m; -/* Bidiagonalize L in U, copying result to WORK(IR) +/* Bidiagonalize L in U, copying result to WORK(IR) (Workspace: need M*M+4*M, prefer M*M+3*M+2*M*NB) */ i__3 = *lwork - iwork + 1; @@ -2764,14 +2763,14 @@ static doublereal c_b438 = 1.; itauq], &work[itaup], &work[iwork], &i__3, &ierr); dlacpy_("U", m, m, &u[u_offset], ldu, &work[ir], &ldwrkr); -/* Generate right vectors bidiagonalizing L in WORK(IR) +/* Generate right vectors bidiagonalizing L in WORK(IR) (Workspace: need M*M+4*M-1, prefer M*M+3*M+(M-1)*NB) */ i__3 = *lwork - iwork + 1; dorgbr_("P", m, m, m, &work[ir], &ldwrkr, &work[itaup], & work[iwork], &i__3, &ierr); -/* Generate left vectors bidiagonalizing L in U +/* Generate left vectors bidiagonalizing L in U (Workspace: need M*M+4*M, prefer M*M+3*M+M*NB) */ i__3 = *lwork - iwork + 1; @@ -2779,18 +2778,18 @@ static doublereal c_b438 = 1.; work[iwork], &i__3, &ierr); iwork = ie + *m; -/* Perform bidiagonal QR iteration, computing left - singular vectors of L in U, and computing right - singular vectors of L in WORK(IR) +/* Perform bidiagonal QR iteration, computing left + singular vectors of L in U, and computing right + singular vectors of L in WORK(IR) (Workspace: need M*M+BDSPAC) */ - dbdsqr_("U", m, m, m, &c__0, &s[1], &work[ie], &work[ir], + dbdsqr_("U", m, m, m, &c__0, &s[1], &work[ie], &work[ir], &ldwrkr, &u[u_offset], ldu, dum, &c__1, &work[ iwork], info); iu = ie + *m; -/* Multiply right singular vectors of L in WORK(IR) by Q - in A, storing result in WORK(IU) and copying to A +/* Multiply right singular vectors of L in WORK(IR) by Q + in A, storing result in WORK(IU) and copying to A (Workspace: need M*M+2*M, prefer M*M+M*N+M)) */ i__3 = *n; @@ -2803,7 +2802,7 @@ static doublereal c_b438 = 1.; dgemm_("N", "N", m, &blk, m, &c_b438, &work[ir], & ldwrkr, &a_ref(1, i__), lda, &c_b416, &work[ iu], &ldwrku); - dlacpy_("F", m, &blk, &work[iu], &ldwrku, &a_ref(1, + dlacpy_("F", m, &blk, &work[iu], &ldwrku, &a_ref(1, i__), lda); /* L40: */ } @@ -2815,7 +2814,7 @@ static doublereal c_b438 = 1.; itau = 1; iwork = itau + *m; -/* Compute A=L*Q +/* Compute A=L*Q (Workspace: need 2*M, prefer M+M*NB) */ i__2 = *lwork - iwork + 1; @@ -2830,7 +2829,7 @@ static doublereal c_b438 = 1.; dlaset_("U", &i__2, &i__3, &c_b416, &c_b416, &u_ref(1, 2), ldu); -/* Generate Q in A +/* Generate Q in A (Workspace: need 2*M, prefer M+M*NB) */ i__2 = *lwork - iwork + 1; @@ -2841,14 +2840,14 @@ static doublereal c_b438 = 1.; itaup = itauq + *m; iwork = itaup + *m; -/* Bidiagonalize L in U +/* Bidiagonalize L in U (Workspace: need 4*M, prefer 3*M+2*M*NB) */ i__2 = *lwork - iwork + 1; dgebrd_(m, m, &u[u_offset], ldu, &s[1], &work[ie], &work[ itauq], &work[itaup], &work[iwork], &i__2, &ierr); -/* Multiply right vectors bidiagonalizing L by Q in A +/* Multiply right vectors bidiagonalizing L by Q in A (Workspace: need 3*M+N, prefer 3*M+N*NB) */ i__2 = *lwork - iwork + 1; @@ -2856,7 +2855,7 @@ static doublereal c_b438 = 1.; itaup], &a[a_offset], lda, &work[iwork], &i__2, & ierr); -/* Generate left vectors bidiagonalizing L in U +/* Generate left vectors bidiagonalizing L in U (Workspace: need 4*M, prefer 3*M+M*NB) */ i__2 = *lwork - iwork + 1; @@ -2864,9 +2863,9 @@ static doublereal c_b438 = 1.; work[iwork], &i__2, &ierr); iwork = ie + *m; -/* Perform bidiagonal QR iteration, computing left - singular vectors of A in U and computing right - singular vectors of A in A +/* Perform bidiagonal QR iteration, computing left + singular vectors of A in U and computing right + singular vectors of A in A (Workspace: need BDSPAC) */ dbdsqr_("U", m, n, m, &c__0, &s[1], &work[ie], &a[ @@ -2879,9 +2878,9 @@ static doublereal c_b438 = 1.; if (wntun) { -/* Path 4t(N much larger than M, JOBU='N', JOBVT='S') - M right singular vectors to be computed in VT and - no left singular vectors to be computed +/* Path 4t(N much larger than M, JOBU='N', JOBVT='S') + M right singular vectors to be computed in VT and + no left singular vectors to be computed Computing MAX */ i__2 = *m << 2; @@ -2904,7 +2903,7 @@ static doublereal c_b438 = 1.; itau = ir + ldwrkr * *m; iwork = itau + *m; -/* Compute A=L*Q +/* Compute A=L*Q (Workspace: need M*M+2*M, prefer M*M+M+M*NB) */ i__2 = *lwork - iwork + 1; @@ -2917,10 +2916,10 @@ static doublereal c_b438 = 1.; ldwrkr); i__2 = *m - 1; i__3 = *m - 1; - dlaset_("U", &i__2, &i__3, &c_b416, &c_b416, &work[ir + dlaset_("U", &i__2, &i__3, &c_b416, &c_b416, &work[ir + ldwrkr], &ldwrkr); -/* Generate Q in A +/* Generate Q in A (Workspace: need M*M+2*M, prefer M*M+M+M*NB) */ i__2 = *lwork - iwork + 1; @@ -2931,7 +2930,7 @@ static doublereal c_b438 = 1.; itaup = itauq + *m; iwork = itaup + *m; -/* Bidiagonalize L in WORK(IR) +/* Bidiagonalize L in WORK(IR) (Workspace: need M*M+4*M, prefer M*M+3*M+2*M*NB) */ i__2 = *lwork - iwork + 1; @@ -2939,8 +2938,8 @@ static doublereal c_b438 = 1.; work[itauq], &work[itaup], &work[iwork], & i__2, &ierr); -/* Generate right vectors bidiagonalizing L in - WORK(IR) +/* Generate right vectors bidiagonalizing L in + WORK(IR) (Workspace: need M*M+4*M, prefer M*M+3*M+(M-1)*NB) */ i__2 = *lwork - iwork + 1; @@ -2948,20 +2947,20 @@ static doublereal c_b438 = 1.; , &work[iwork], &i__2, &ierr); iwork = ie + *m; -/* Perform bidiagonal QR iteration, computing right - singular vectors of L in WORK(IR) +/* Perform bidiagonal QR iteration, computing right + singular vectors of L in WORK(IR) (Workspace: need M*M+BDSPAC) */ dbdsqr_("U", m, m, &c__0, &c__0, &s[1], &work[ie], & work[ir], &ldwrkr, dum, &c__1, dum, &c__1, & work[iwork], info); -/* Multiply right singular vectors of L in WORK(IR) by - Q in A, storing result in VT +/* Multiply right singular vectors of L in WORK(IR) by + Q in A, storing result in VT (Workspace: need M*M) */ dgemm_("N", "N", m, n, m, &c_b438, &work[ir], &ldwrkr, - &a[a_offset], lda, &c_b416, &vt[vt_offset], + &a[a_offset], lda, &c_b416, &vt[vt_offset], ldvt); } else { @@ -2971,7 +2970,7 @@ static doublereal c_b438 = 1.; itau = 1; iwork = itau + *m; -/* Compute A=L*Q +/* Compute A=L*Q (Workspace: need 2*M, prefer M+M*NB) */ i__2 = *lwork - iwork + 1; @@ -2980,10 +2979,10 @@ static doublereal c_b438 = 1.; /* Copy result to VT */ - dlacpy_("U", m, n, &a[a_offset], lda, &vt[vt_offset], + dlacpy_("U", m, n, &a[a_offset], lda, &vt[vt_offset], ldvt); -/* Generate Q in VT +/* Generate Q in VT (Workspace: need 2*M, prefer M+M*NB) */ i__2 = *lwork - iwork + 1; @@ -3001,7 +3000,7 @@ static doublereal c_b438 = 1.; dlaset_("U", &i__2, &i__3, &c_b416, &c_b416, &a_ref(1, 2), lda); -/* Bidiagonalize L in A +/* Bidiagonalize L in A (Workspace: need 4*M, prefer 3*M+2*M*NB) */ i__2 = *lwork - iwork + 1; @@ -3009,7 +3008,7 @@ static doublereal c_b438 = 1.; work[itauq], &work[itaup], &work[iwork], & i__2, &ierr); -/* Multiply right vectors bidiagonalizing L by Q in VT +/* Multiply right vectors bidiagonalizing L by Q in VT (Workspace: need 3*M+N, prefer 3*M+N*NB) */ i__2 = *lwork - iwork + 1; @@ -3018,8 +3017,8 @@ static doublereal c_b438 = 1.; iwork], &i__2, &ierr); iwork = ie + *m; -/* Perform bidiagonal QR iteration, computing right - singular vectors of A in VT +/* Perform bidiagonal QR iteration, computing right + singular vectors of A in VT (Workspace: need BDSPAC) */ dbdsqr_("U", m, n, &c__0, &c__0, &s[1], &work[ie], & @@ -3030,9 +3029,9 @@ static doublereal c_b438 = 1.; } else if (wntuo) { -/* Path 5t(N much larger than M, JOBU='O', JOBVT='S') - M right singular vectors to be computed in VT and - M left singular vectors to be overwritten on A +/* Path 5t(N much larger than M, JOBU='O', JOBVT='S') + M right singular vectors to be computed in VT and + M left singular vectors to be overwritten on A Computing MAX */ i__2 = *m << 2; @@ -3066,7 +3065,7 @@ static doublereal c_b438 = 1.; itau = ir + ldwrkr * *m; iwork = itau + *m; -/* Compute A=L*Q +/* Compute A=L*Q (Workspace: need 2*M*M+2*M, prefer 2*M*M+M+M*NB) */ i__2 = *lwork - iwork + 1; @@ -3079,10 +3078,10 @@ static doublereal c_b438 = 1.; ldwrku); i__2 = *m - 1; i__3 = *m - 1; - dlaset_("U", &i__2, &i__3, &c_b416, &c_b416, &work[iu + dlaset_("U", &i__2, &i__3, &c_b416, &c_b416, &work[iu + ldwrku], &ldwrku); -/* Generate Q in A +/* Generate Q in A (Workspace: need 2*M*M+2*M, prefer 2*M*M+M+M*NB) */ i__2 = *lwork - iwork + 1; @@ -3093,9 +3092,9 @@ static doublereal c_b438 = 1.; itaup = itauq + *m; iwork = itaup + *m; -/* Bidiagonalize L in WORK(IU), copying result to - WORK(IR) - (Workspace: need 2*M*M+4*M, +/* Bidiagonalize L in WORK(IU), copying result to + WORK(IR) + (Workspace: need 2*M*M+4*M, prefer 2*M*M+3*M+2*M*NB) */ i__2 = *lwork - iwork + 1; @@ -3105,15 +3104,15 @@ static doublereal c_b438 = 1.; dlacpy_("L", m, m, &work[iu], &ldwrku, &work[ir], & ldwrkr); -/* Generate right bidiagonalizing vectors in WORK(IU) - (Workspace: need 2*M*M+4*M-1, +/* Generate right bidiagonalizing vectors in WORK(IU) + (Workspace: need 2*M*M+4*M-1, prefer 2*M*M+3*M+(M-1)*NB) */ i__2 = *lwork - iwork + 1; dorgbr_("P", m, m, m, &work[iu], &ldwrku, &work[itaup] , &work[iwork], &i__2, &ierr); -/* Generate left bidiagonalizing vectors in WORK(IR) +/* Generate left bidiagonalizing vectors in WORK(IR) (Workspace: need 2*M*M+4*M, prefer 2*M*M+3*M+M*NB) */ i__2 = *lwork - iwork + 1; @@ -3121,27 +3120,27 @@ static doublereal c_b438 = 1.; , &work[iwork], &i__2, &ierr); iwork = ie + *m; -/* Perform bidiagonal QR iteration, computing left - singular vectors of L in WORK(IR) and computing - right singular vectors of L in WORK(IU) +/* Perform bidiagonal QR iteration, computing left + singular vectors of L in WORK(IR) and computing + right singular vectors of L in WORK(IU) (Workspace: need 2*M*M+BDSPAC) */ dbdsqr_("U", m, m, m, &c__0, &s[1], &work[ie], &work[ - iu], &ldwrku, &work[ir], &ldwrkr, dum, &c__1, + iu], &ldwrku, &work[ir], &ldwrkr, dum, &c__1, &work[iwork], info); -/* Multiply right singular vectors of L in WORK(IU) by - Q in A, storing result in VT +/* Multiply right singular vectors of L in WORK(IU) by + Q in A, storing result in VT (Workspace: need M*M) */ dgemm_("N", "N", m, n, m, &c_b438, &work[iu], &ldwrku, - &a[a_offset], lda, &c_b416, &vt[vt_offset], + &a[a_offset], lda, &c_b416, &vt[vt_offset], ldvt); -/* Copy left singular vectors of L to A +/* Copy left singular vectors of L to A (Workspace: need M*M) */ - dlacpy_("F", m, m, &work[ir], &ldwrkr, &a[a_offset], + dlacpy_("F", m, m, &work[ir], &ldwrkr, &a[a_offset], lda); } else { @@ -3151,16 +3150,16 @@ static doublereal c_b438 = 1.; itau = 1; iwork = itau + *m; -/* Compute A=L*Q, copying result to VT +/* Compute A=L*Q, copying result to VT (Workspace: need 2*M, prefer M+M*NB) */ i__2 = *lwork - iwork + 1; dgelqf_(m, n, &a[a_offset], lda, &work[itau], &work[ iwork], &i__2, &ierr); - dlacpy_("U", m, n, &a[a_offset], lda, &vt[vt_offset], + dlacpy_("U", m, n, &a[a_offset], lda, &vt[vt_offset], ldvt); -/* Generate Q in VT +/* Generate Q in VT (Workspace: need 2*M, prefer M+M*NB) */ i__2 = *lwork - iwork + 1; @@ -3178,7 +3177,7 @@ static doublereal c_b438 = 1.; dlaset_("U", &i__2, &i__3, &c_b416, &c_b416, &a_ref(1, 2), lda); -/* Bidiagonalize L in A +/* Bidiagonalize L in A (Workspace: need 4*M, prefer 3*M+2*M*NB) */ i__2 = *lwork - iwork + 1; @@ -3186,7 +3185,7 @@ static doublereal c_b438 = 1.; work[itauq], &work[itaup], &work[iwork], & i__2, &ierr); -/* Multiply right vectors bidiagonalizing L by Q in VT +/* Multiply right vectors bidiagonalizing L by Q in VT (Workspace: need 3*M+N, prefer 3*M+N*NB) */ i__2 = *lwork - iwork + 1; @@ -3194,7 +3193,7 @@ static doublereal c_b438 = 1.; work[itaup], &vt[vt_offset], ldvt, &work[ iwork], &i__2, &ierr); -/* Generate left bidiagonalizing vectors of L in A +/* Generate left bidiagonalizing vectors of L in A (Workspace: need 4*M, prefer 3*M+M*NB) */ i__2 = *lwork - iwork + 1; @@ -3202,9 +3201,9 @@ static doublereal c_b438 = 1.; &work[iwork], &i__2, &ierr); iwork = ie + *m; -/* Perform bidiagonal QR iteration, compute left - singular vectors of A in A and compute right - singular vectors of A in VT +/* Perform bidiagonal QR iteration, compute left + singular vectors of A in A and compute right + singular vectors of A in VT (Workspace: need BDSPAC) */ dbdsqr_("U", m, n, m, &c__0, &s[1], &work[ie], &vt[ @@ -3215,10 +3214,10 @@ static doublereal c_b438 = 1.; } else if (wntuas) { -/* Path 6t(N much larger than M, JOBU='S' or 'A', - JOBVT='S') - M right singular vectors to be computed in VT and - M left singular vectors to be computed in U +/* Path 6t(N much larger than M, JOBU='S' or 'A', + JOBVT='S') + M right singular vectors to be computed in VT and + M left singular vectors to be computed in U Computing MAX */ i__2 = *m << 2; @@ -3241,7 +3240,7 @@ static doublereal c_b438 = 1.; itau = iu + ldwrku * *m; iwork = itau + *m; -/* Compute A=L*Q +/* Compute A=L*Q (Workspace: need M*M+2*M, prefer M*M+M+M*NB) */ i__2 = *lwork - iwork + 1; @@ -3254,10 +3253,10 @@ static doublereal c_b438 = 1.; ldwrku); i__2 = *m - 1; i__3 = *m - 1; - dlaset_("U", &i__2, &i__3, &c_b416, &c_b416, &work[iu + dlaset_("U", &i__2, &i__3, &c_b416, &c_b416, &work[iu + ldwrku], &ldwrku); -/* Generate Q in A +/* Generate Q in A (Workspace: need M*M+2*M, prefer M*M+M+M*NB) */ i__2 = *lwork - iwork + 1; @@ -3268,25 +3267,25 @@ static doublereal c_b438 = 1.; itaup = itauq + *m; iwork = itaup + *m; -/* Bidiagonalize L in WORK(IU), copying result to U +/* Bidiagonalize L in WORK(IU), copying result to U (Workspace: need M*M+4*M, prefer M*M+3*M+2*M*NB) */ i__2 = *lwork - iwork + 1; dgebrd_(m, m, &work[iu], &ldwrku, &s[1], &work[ie], & work[itauq], &work[itaup], &work[iwork], & i__2, &ierr); - dlacpy_("L", m, m, &work[iu], &ldwrku, &u[u_offset], + dlacpy_("L", m, m, &work[iu], &ldwrku, &u[u_offset], ldu); -/* Generate right bidiagonalizing vectors in WORK(IU) - (Workspace: need M*M+4*M-1, +/* Generate right bidiagonalizing vectors in WORK(IU) + (Workspace: need M*M+4*M-1, prefer M*M+3*M+(M-1)*NB) */ i__2 = *lwork - iwork + 1; dorgbr_("P", m, m, m, &work[iu], &ldwrku, &work[itaup] , &work[iwork], &i__2, &ierr); -/* Generate left bidiagonalizing vectors in U +/* Generate left bidiagonalizing vectors in U (Workspace: need M*M+4*M, prefer M*M+3*M+M*NB) */ i__2 = *lwork - iwork + 1; @@ -3294,21 +3293,21 @@ static doublereal c_b438 = 1.; &work[iwork], &i__2, &ierr); iwork = ie + *m; -/* Perform bidiagonal QR iteration, computing left - singular vectors of L in U and computing right - singular vectors of L in WORK(IU) +/* Perform bidiagonal QR iteration, computing left + singular vectors of L in U and computing right + singular vectors of L in WORK(IU) (Workspace: need M*M+BDSPAC) */ dbdsqr_("U", m, m, m, &c__0, &s[1], &work[ie], &work[ iu], &ldwrku, &u[u_offset], ldu, dum, &c__1, & work[iwork], info); -/* Multiply right singular vectors of L in WORK(IU) by - Q in A, storing result in VT +/* Multiply right singular vectors of L in WORK(IU) by + Q in A, storing result in VT (Workspace: need M*M) */ dgemm_("N", "N", m, n, m, &c_b438, &work[iu], &ldwrku, - &a[a_offset], lda, &c_b416, &vt[vt_offset], + &a[a_offset], lda, &c_b416, &vt[vt_offset], ldvt); } else { @@ -3318,16 +3317,16 @@ static doublereal c_b438 = 1.; itau = 1; iwork = itau + *m; -/* Compute A=L*Q, copying result to VT +/* Compute A=L*Q, copying result to VT (Workspace: need 2*M, prefer M+M*NB) */ i__2 = *lwork - iwork + 1; dgelqf_(m, n, &a[a_offset], lda, &work[itau], &work[ iwork], &i__2, &ierr); - dlacpy_("U", m, n, &a[a_offset], lda, &vt[vt_offset], + dlacpy_("U", m, n, &a[a_offset], lda, &vt[vt_offset], ldvt); -/* Generate Q in VT +/* Generate Q in VT (Workspace: need 2*M, prefer M+M*NB) */ i__2 = *lwork - iwork + 1; @@ -3336,7 +3335,7 @@ static doublereal c_b438 = 1.; /* Copy L to U, zeroing out above it */ - dlacpy_("L", m, m, &a[a_offset], lda, &u[u_offset], + dlacpy_("L", m, m, &a[a_offset], lda, &u[u_offset], ldu); i__2 = *m - 1; i__3 = *m - 1; @@ -3347,7 +3346,7 @@ static doublereal c_b438 = 1.; itaup = itauq + *m; iwork = itaup + *m; -/* Bidiagonalize L in U +/* Bidiagonalize L in U (Workspace: need 4*M, prefer 3*M+2*M*NB) */ i__2 = *lwork - iwork + 1; @@ -3355,8 +3354,8 @@ static doublereal c_b438 = 1.; work[itauq], &work[itaup], &work[iwork], & i__2, &ierr); -/* Multiply right bidiagonalizing vectors in U by Q - in VT +/* Multiply right bidiagonalizing vectors in U by Q + in VT (Workspace: need 3*M+N, prefer 3*M+N*NB) */ i__2 = *lwork - iwork + 1; @@ -3364,7 +3363,7 @@ static doublereal c_b438 = 1.; work[itaup], &vt[vt_offset], ldvt, &work[ iwork], &i__2, &ierr); -/* Generate left bidiagonalizing vectors in U +/* Generate left bidiagonalizing vectors in U (Workspace: need 4*M, prefer 3*M+M*NB) */ i__2 = *lwork - iwork + 1; @@ -3372,9 +3371,9 @@ static doublereal c_b438 = 1.; &work[iwork], &i__2, &ierr); iwork = ie + *m; -/* Perform bidiagonal QR iteration, computing left - singular vectors of A in U and computing right - singular vectors of A in VT +/* Perform bidiagonal QR iteration, computing left + singular vectors of A in U and computing right + singular vectors of A in VT (Workspace: need BDSPAC) */ dbdsqr_("U", m, n, m, &c__0, &s[1], &work[ie], &vt[ @@ -3389,9 +3388,9 @@ static doublereal c_b438 = 1.; if (wntun) { -/* Path 7t(N much larger than M, JOBU='N', JOBVT='A') - N right singular vectors to be computed in VT and - no left singular vectors to be computed +/* Path 7t(N much larger than M, JOBU='N', JOBVT='A') + N right singular vectors to be computed in VT and + no left singular vectors to be computed Computing MAX */ i__2 = *n + *m, i__3 = *m << 2, i__2 = max(i__2,i__3); @@ -3414,13 +3413,13 @@ static doublereal c_b438 = 1.; itau = ir + ldwrkr * *m; iwork = itau + *m; -/* Compute A=L*Q, copying result to VT +/* Compute A=L*Q, copying result to VT (Workspace: need M*M+2*M, prefer M*M+M+M*NB) */ i__2 = *lwork - iwork + 1; dgelqf_(m, n, &a[a_offset], lda, &work[itau], &work[ iwork], &i__2, &ierr); - dlacpy_("U", m, n, &a[a_offset], lda, &vt[vt_offset], + dlacpy_("U", m, n, &a[a_offset], lda, &vt[vt_offset], ldvt); /* Copy L to WORK(IR), zeroing out above it */ @@ -3429,10 +3428,10 @@ static doublereal c_b438 = 1.; ldwrkr); i__2 = *m - 1; i__3 = *m - 1; - dlaset_("U", &i__2, &i__3, &c_b416, &c_b416, &work[ir + dlaset_("U", &i__2, &i__3, &c_b416, &c_b416, &work[ir + ldwrkr], &ldwrkr); -/* Generate Q in VT +/* Generate Q in VT (Workspace: need M*M+M+N, prefer M*M+M+N*NB) */ i__2 = *lwork - iwork + 1; @@ -3443,7 +3442,7 @@ static doublereal c_b438 = 1.; itaup = itauq + *m; iwork = itaup + *m; -/* Bidiagonalize L in WORK(IR) +/* Bidiagonalize L in WORK(IR) (Workspace: need M*M+4*M, prefer M*M+3*M+2*M*NB) */ i__2 = *lwork - iwork + 1; @@ -3451,8 +3450,8 @@ static doublereal c_b438 = 1.; work[itauq], &work[itaup], &work[iwork], & i__2, &ierr); -/* Generate right bidiagonalizing vectors in WORK(IR) - (Workspace: need M*M+4*M-1, +/* Generate right bidiagonalizing vectors in WORK(IR) + (Workspace: need M*M+4*M-1, prefer M*M+3*M+(M-1)*NB) */ i__2 = *lwork - iwork + 1; @@ -3460,25 +3459,25 @@ static doublereal c_b438 = 1.; , &work[iwork], &i__2, &ierr); iwork = ie + *m; -/* Perform bidiagonal QR iteration, computing right - singular vectors of L in WORK(IR) +/* Perform bidiagonal QR iteration, computing right + singular vectors of L in WORK(IR) (Workspace: need M*M+BDSPAC) */ dbdsqr_("U", m, m, &c__0, &c__0, &s[1], &work[ie], & work[ir], &ldwrkr, dum, &c__1, dum, &c__1, & work[iwork], info); -/* Multiply right singular vectors of L in WORK(IR) by - Q in VT, storing result in A +/* Multiply right singular vectors of L in WORK(IR) by + Q in VT, storing result in A (Workspace: need M*M) */ dgemm_("N", "N", m, n, m, &c_b438, &work[ir], &ldwrkr, - &vt[vt_offset], ldvt, &c_b416, &a[a_offset], + &vt[vt_offset], ldvt, &c_b416, &a[a_offset], lda); /* Copy right singular vectors of A from A to VT */ - dlacpy_("F", m, n, &a[a_offset], lda, &vt[vt_offset], + dlacpy_("F", m, n, &a[a_offset], lda, &vt[vt_offset], ldvt); } else { @@ -3488,16 +3487,16 @@ static doublereal c_b438 = 1.; itau = 1; iwork = itau + *m; -/* Compute A=L*Q, copying result to VT +/* Compute A=L*Q, copying result to VT (Workspace: need 2*M, prefer M+M*NB) */ i__2 = *lwork - iwork + 1; dgelqf_(m, n, &a[a_offset], lda, &work[itau], &work[ iwork], &i__2, &ierr); - dlacpy_("U", m, n, &a[a_offset], lda, &vt[vt_offset], + dlacpy_("U", m, n, &a[a_offset], lda, &vt[vt_offset], ldvt); -/* Generate Q in VT +/* Generate Q in VT (Workspace: need M+N, prefer M+N*NB) */ i__2 = *lwork - iwork + 1; @@ -3515,7 +3514,7 @@ static doublereal c_b438 = 1.; dlaset_("U", &i__2, &i__3, &c_b416, &c_b416, &a_ref(1, 2), lda); -/* Bidiagonalize L in A +/* Bidiagonalize L in A (Workspace: need 4*M, prefer 3*M+2*M*NB) */ i__2 = *lwork - iwork + 1; @@ -3523,8 +3522,8 @@ static doublereal c_b438 = 1.; work[itauq], &work[itaup], &work[iwork], & i__2, &ierr); -/* Multiply right bidiagonalizing vectors in A by Q - in VT +/* Multiply right bidiagonalizing vectors in A by Q + in VT (Workspace: need 3*M+N, prefer 3*M+N*NB) */ i__2 = *lwork - iwork + 1; @@ -3533,8 +3532,8 @@ static doublereal c_b438 = 1.; iwork], &i__2, &ierr); iwork = ie + *m; -/* Perform bidiagonal QR iteration, computing right - singular vectors of A in VT +/* Perform bidiagonal QR iteration, computing right + singular vectors of A in VT (Workspace: need BDSPAC) */ dbdsqr_("U", m, n, &c__0, &c__0, &s[1], &work[ie], & @@ -3545,9 +3544,9 @@ static doublereal c_b438 = 1.; } else if (wntuo) { -/* Path 8t(N much larger than M, JOBU='O', JOBVT='A') - N right singular vectors to be computed in VT and - M left singular vectors to be overwritten on A +/* Path 8t(N much larger than M, JOBU='O', JOBVT='A') + N right singular vectors to be computed in VT and + M left singular vectors to be overwritten on A Computing MAX */ i__2 = *n + *m, i__3 = *m << 2, i__2 = max(i__2,i__3); @@ -3581,16 +3580,16 @@ static doublereal c_b438 = 1.; itau = ir + ldwrkr * *m; iwork = itau + *m; -/* Compute A=L*Q, copying result to VT +/* Compute A=L*Q, copying result to VT (Workspace: need 2*M*M+2*M, prefer 2*M*M+M+M*NB) */ i__2 = *lwork - iwork + 1; dgelqf_(m, n, &a[a_offset], lda, &work[itau], &work[ iwork], &i__2, &ierr); - dlacpy_("U", m, n, &a[a_offset], lda, &vt[vt_offset], + dlacpy_("U", m, n, &a[a_offset], lda, &vt[vt_offset], ldvt); -/* Generate Q in VT +/* Generate Q in VT (Workspace: need 2*M*M+M+N, prefer 2*M*M+M+N*NB) */ i__2 = *lwork - iwork + 1; @@ -3603,16 +3602,16 @@ static doublereal c_b438 = 1.; ldwrku); i__2 = *m - 1; i__3 = *m - 1; - dlaset_("U", &i__2, &i__3, &c_b416, &c_b416, &work[iu + dlaset_("U", &i__2, &i__3, &c_b416, &c_b416, &work[iu + ldwrku], &ldwrku); ie = itau; itauq = ie + *m; itaup = itauq + *m; iwork = itaup + *m; -/* Bidiagonalize L in WORK(IU), copying result to - WORK(IR) - (Workspace: need 2*M*M+4*M, +/* Bidiagonalize L in WORK(IU), copying result to + WORK(IR) + (Workspace: need 2*M*M+4*M, prefer 2*M*M+3*M+2*M*NB) */ i__2 = *lwork - iwork + 1; @@ -3622,15 +3621,15 @@ static doublereal c_b438 = 1.; dlacpy_("L", m, m, &work[iu], &ldwrku, &work[ir], & ldwrkr); -/* Generate right bidiagonalizing vectors in WORK(IU) - (Workspace: need 2*M*M+4*M-1, +/* Generate right bidiagonalizing vectors in WORK(IU) + (Workspace: need 2*M*M+4*M-1, prefer 2*M*M+3*M+(M-1)*NB) */ i__2 = *lwork - iwork + 1; dorgbr_("P", m, m, m, &work[iu], &ldwrku, &work[itaup] , &work[iwork], &i__2, &ierr); -/* Generate left bidiagonalizing vectors in WORK(IR) +/* Generate left bidiagonalizing vectors in WORK(IR) (Workspace: need 2*M*M+4*M, prefer 2*M*M+3*M+M*NB) */ i__2 = *lwork - iwork + 1; @@ -3638,31 +3637,31 @@ static doublereal c_b438 = 1.; , &work[iwork], &i__2, &ierr); iwork = ie + *m; -/* Perform bidiagonal QR iteration, computing left - singular vectors of L in WORK(IR) and computing - right singular vectors of L in WORK(IU) +/* Perform bidiagonal QR iteration, computing left + singular vectors of L in WORK(IR) and computing + right singular vectors of L in WORK(IU) (Workspace: need 2*M*M+BDSPAC) */ dbdsqr_("U", m, m, m, &c__0, &s[1], &work[ie], &work[ - iu], &ldwrku, &work[ir], &ldwrkr, dum, &c__1, + iu], &ldwrku, &work[ir], &ldwrkr, dum, &c__1, &work[iwork], info); -/* Multiply right singular vectors of L in WORK(IU) by - Q in VT, storing result in A +/* Multiply right singular vectors of L in WORK(IU) by + Q in VT, storing result in A (Workspace: need M*M) */ dgemm_("N", "N", m, n, m, &c_b438, &work[iu], &ldwrku, - &vt[vt_offset], ldvt, &c_b416, &a[a_offset], + &vt[vt_offset], ldvt, &c_b416, &a[a_offset], lda); /* Copy right singular vectors of A from A to VT */ - dlacpy_("F", m, n, &a[a_offset], lda, &vt[vt_offset], + dlacpy_("F", m, n, &a[a_offset], lda, &vt[vt_offset], ldvt); /* Copy left singular vectors of A from WORK(IR) to A */ - dlacpy_("F", m, m, &work[ir], &ldwrkr, &a[a_offset], + dlacpy_("F", m, m, &work[ir], &ldwrkr, &a[a_offset], lda); } else { @@ -3672,16 +3671,16 @@ static doublereal c_b438 = 1.; itau = 1; iwork = itau + *m; -/* Compute A=L*Q, copying result to VT +/* Compute A=L*Q, copying result to VT (Workspace: need 2*M, prefer M+M*NB) */ i__2 = *lwork - iwork + 1; dgelqf_(m, n, &a[a_offset], lda, &work[itau], &work[ iwork], &i__2, &ierr); - dlacpy_("U", m, n, &a[a_offset], lda, &vt[vt_offset], + dlacpy_("U", m, n, &a[a_offset], lda, &vt[vt_offset], ldvt); -/* Generate Q in VT +/* Generate Q in VT (Workspace: need M+N, prefer M+N*NB) */ i__2 = *lwork - iwork + 1; @@ -3699,7 +3698,7 @@ static doublereal c_b438 = 1.; dlaset_("U", &i__2, &i__3, &c_b416, &c_b416, &a_ref(1, 2), lda); -/* Bidiagonalize L in A +/* Bidiagonalize L in A (Workspace: need 4*M, prefer 3*M+2*M*NB) */ i__2 = *lwork - iwork + 1; @@ -3707,8 +3706,8 @@ static doublereal c_b438 = 1.; work[itauq], &work[itaup], &work[iwork], & i__2, &ierr); -/* Multiply right bidiagonalizing vectors in A by Q - in VT +/* Multiply right bidiagonalizing vectors in A by Q + in VT (Workspace: need 3*M+N, prefer 3*M+N*NB) */ i__2 = *lwork - iwork + 1; @@ -3716,7 +3715,7 @@ static doublereal c_b438 = 1.; work[itaup], &vt[vt_offset], ldvt, &work[ iwork], &i__2, &ierr); -/* Generate left bidiagonalizing vectors in A +/* Generate left bidiagonalizing vectors in A (Workspace: need 4*M, prefer 3*M+M*NB) */ i__2 = *lwork - iwork + 1; @@ -3724,9 +3723,9 @@ static doublereal c_b438 = 1.; &work[iwork], &i__2, &ierr); iwork = ie + *m; -/* Perform bidiagonal QR iteration, computing left - singular vectors of A in A and computing right - singular vectors of A in VT +/* Perform bidiagonal QR iteration, computing left + singular vectors of A in A and computing right + singular vectors of A in VT (Workspace: need BDSPAC) */ dbdsqr_("U", m, n, m, &c__0, &s[1], &work[ie], &vt[ @@ -3737,10 +3736,10 @@ static doublereal c_b438 = 1.; } else if (wntuas) { -/* Path 9t(N much larger than M, JOBU='S' or 'A', - JOBVT='A') - N right singular vectors to be computed in VT and - M left singular vectors to be computed in U +/* Path 9t(N much larger than M, JOBU='S' or 'A', + JOBVT='A') + N right singular vectors to be computed in VT and + M left singular vectors to be computed in U Computing MAX */ i__2 = *n + *m, i__3 = *m << 2, i__2 = max(i__2,i__3); @@ -3763,16 +3762,16 @@ static doublereal c_b438 = 1.; itau = iu + ldwrku * *m; iwork = itau + *m; -/* Compute A=L*Q, copying result to VT +/* Compute A=L*Q, copying result to VT (Workspace: need M*M+2*M, prefer M*M+M+M*NB) */ i__2 = *lwork - iwork + 1; dgelqf_(m, n, &a[a_offset], lda, &work[itau], &work[ iwork], &i__2, &ierr); - dlacpy_("U", m, n, &a[a_offset], lda, &vt[vt_offset], + dlacpy_("U", m, n, &a[a_offset], lda, &vt[vt_offset], ldvt); -/* Generate Q in VT +/* Generate Q in VT (Workspace: need M*M+M+N, prefer M*M+M+N*NB) */ i__2 = *lwork - iwork + 1; @@ -3785,31 +3784,31 @@ static doublereal c_b438 = 1.; ldwrku); i__2 = *m - 1; i__3 = *m - 1; - dlaset_("U", &i__2, &i__3, &c_b416, &c_b416, &work[iu + dlaset_("U", &i__2, &i__3, &c_b416, &c_b416, &work[iu + ldwrku], &ldwrku); ie = itau; itauq = ie + *m; itaup = itauq + *m; iwork = itaup + *m; -/* Bidiagonalize L in WORK(IU), copying result to U +/* Bidiagonalize L in WORK(IU), copying result to U (Workspace: need M*M+4*M, prefer M*M+3*M+2*M*NB) */ i__2 = *lwork - iwork + 1; dgebrd_(m, m, &work[iu], &ldwrku, &s[1], &work[ie], & work[itauq], &work[itaup], &work[iwork], & i__2, &ierr); - dlacpy_("L", m, m, &work[iu], &ldwrku, &u[u_offset], + dlacpy_("L", m, m, &work[iu], &ldwrku, &u[u_offset], ldu); -/* Generate right bidiagonalizing vectors in WORK(IU) +/* Generate right bidiagonalizing vectors in WORK(IU) (Workspace: need M*M+4*M, prefer M*M+3*M+(M-1)*NB) */ i__2 = *lwork - iwork + 1; dorgbr_("P", m, m, m, &work[iu], &ldwrku, &work[itaup] , &work[iwork], &i__2, &ierr); -/* Generate left bidiagonalizing vectors in U +/* Generate left bidiagonalizing vectors in U (Workspace: need M*M+4*M, prefer M*M+3*M+M*NB) */ i__2 = *lwork - iwork + 1; @@ -3817,26 +3816,26 @@ static doublereal c_b438 = 1.; &work[iwork], &i__2, &ierr); iwork = ie + *m; -/* Perform bidiagonal QR iteration, computing left - singular vectors of L in U and computing right - singular vectors of L in WORK(IU) +/* Perform bidiagonal QR iteration, computing left + singular vectors of L in U and computing right + singular vectors of L in WORK(IU) (Workspace: need M*M+BDSPAC) */ dbdsqr_("U", m, m, m, &c__0, &s[1], &work[ie], &work[ iu], &ldwrku, &u[u_offset], ldu, dum, &c__1, & work[iwork], info); -/* Multiply right singular vectors of L in WORK(IU) by - Q in VT, storing result in A +/* Multiply right singular vectors of L in WORK(IU) by + Q in VT, storing result in A (Workspace: need M*M) */ dgemm_("N", "N", m, n, m, &c_b438, &work[iu], &ldwrku, - &vt[vt_offset], ldvt, &c_b416, &a[a_offset], + &vt[vt_offset], ldvt, &c_b416, &a[a_offset], lda); /* Copy right singular vectors of A from A to VT */ - dlacpy_("F", m, n, &a[a_offset], lda, &vt[vt_offset], + dlacpy_("F", m, n, &a[a_offset], lda, &vt[vt_offset], ldvt); } else { @@ -3846,16 +3845,16 @@ static doublereal c_b438 = 1.; itau = 1; iwork = itau + *m; -/* Compute A=L*Q, copying result to VT +/* Compute A=L*Q, copying result to VT (Workspace: need 2*M, prefer M+M*NB) */ i__2 = *lwork - iwork + 1; dgelqf_(m, n, &a[a_offset], lda, &work[itau], &work[ iwork], &i__2, &ierr); - dlacpy_("U", m, n, &a[a_offset], lda, &vt[vt_offset], + dlacpy_("U", m, n, &a[a_offset], lda, &vt[vt_offset], ldvt); -/* Generate Q in VT +/* Generate Q in VT (Workspace: need M+N, prefer M+N*NB) */ i__2 = *lwork - iwork + 1; @@ -3864,7 +3863,7 @@ static doublereal c_b438 = 1.; /* Copy L to U, zeroing out above it */ - dlacpy_("L", m, m, &a[a_offset], lda, &u[u_offset], + dlacpy_("L", m, m, &a[a_offset], lda, &u[u_offset], ldu); i__2 = *m - 1; i__3 = *m - 1; @@ -3875,7 +3874,7 @@ static doublereal c_b438 = 1.; itaup = itauq + *m; iwork = itaup + *m; -/* Bidiagonalize L in U +/* Bidiagonalize L in U (Workspace: need 4*M, prefer 3*M+2*M*NB) */ i__2 = *lwork - iwork + 1; @@ -3883,8 +3882,8 @@ static doublereal c_b438 = 1.; work[itauq], &work[itaup], &work[iwork], & i__2, &ierr); -/* Multiply right bidiagonalizing vectors in U by Q - in VT +/* Multiply right bidiagonalizing vectors in U by Q + in VT (Workspace: need 3*M+N, prefer 3*M+N*NB) */ i__2 = *lwork - iwork + 1; @@ -3892,7 +3891,7 @@ static doublereal c_b438 = 1.; work[itaup], &vt[vt_offset], ldvt, &work[ iwork], &i__2, &ierr); -/* Generate left bidiagonalizing vectors in U +/* Generate left bidiagonalizing vectors in U (Workspace: need 4*M, prefer 3*M+M*NB) */ i__2 = *lwork - iwork + 1; @@ -3900,9 +3899,9 @@ static doublereal c_b438 = 1.; &work[iwork], &i__2, &ierr); iwork = ie + *m; -/* Perform bidiagonal QR iteration, computing left - singular vectors of A in U and computing right - singular vectors of A in VT +/* Perform bidiagonal QR iteration, computing left + singular vectors of A in U and computing right + singular vectors of A in VT (Workspace: need BDSPAC) */ dbdsqr_("U", m, n, m, &c__0, &s[1], &work[ie], &vt[ @@ -3917,9 +3916,9 @@ static doublereal c_b438 = 1.; } else { -/* N .LT. MNTHR +/* N .LT. MNTHR - Path 10t(N greater than M, but not much larger) + Path 10t(N greater than M, but not much larger) Reduce to bidiagonal form without LQ decomposition */ ie = 1; @@ -3927,7 +3926,7 @@ static doublereal c_b438 = 1.; itaup = itauq + *m; iwork = itaup + *m; -/* Bidiagonalize A +/* Bidiagonalize A (Workspace: need 3*M+N, prefer 3*M+(M+N)*NB) */ i__2 = *lwork - iwork + 1; @@ -3935,8 +3934,8 @@ static doublereal c_b438 = 1.; work[itaup], &work[iwork], &i__2, &ierr); if (wntuas) { -/* If left singular vectors desired in U, copy result to U - and generate left bidiagonalizing vectors in U +/* If left singular vectors desired in U, copy result to U + and generate left bidiagonalizing vectors in U (Workspace: need 4*M-1, prefer 3*M+(M-1)*NB) */ dlacpy_("L", m, m, &a[a_offset], lda, &u[u_offset], ldu); @@ -3946,8 +3945,8 @@ static doublereal c_b438 = 1.; } if (wntvas) { -/* If right singular vectors desired in VT, copy result to - VT and generate right bidiagonalizing vectors in VT +/* If right singular vectors desired in VT, copy result to + VT and generate right bidiagonalizing vectors in VT (Workspace: need 3*M+NRVT, prefer 3*M+NRVT*NB) */ dlacpy_("U", m, n, &a[a_offset], lda, &vt[vt_offset], ldvt); @@ -3958,13 +3957,13 @@ static doublereal c_b438 = 1.; nrvt = *m; } i__2 = *lwork - iwork + 1; - dorgbr_("P", &nrvt, n, m, &vt[vt_offset], ldvt, &work[itaup], + dorgbr_("P", &nrvt, n, m, &vt[vt_offset], ldvt, &work[itaup], &work[iwork], &i__2, &ierr); } if (wntuo) { -/* If left singular vectors desired in A, generate left - bidiagonalizing vectors in A +/* If left singular vectors desired in A, generate left + bidiagonalizing vectors in A (Workspace: need 4*M-1, prefer 3*M+(M-1)*NB) */ i__2 = *lwork - iwork + 1; @@ -3973,8 +3972,8 @@ static doublereal c_b438 = 1.; } if (wntvo) { -/* If right singular vectors desired in A, generate right - bidiagonalizing vectors in A +/* If right singular vectors desired in A, generate right + bidiagonalizing vectors in A (Workspace: need 4*M, prefer 3*M+M*NB) */ i__2 = *lwork - iwork + 1; @@ -3996,9 +3995,9 @@ static doublereal c_b438 = 1.; } if (! wntuo && ! wntvo) { -/* Perform bidiagonal QR iteration, if desired, computing - left singular vectors in U and computing right singular - vectors in VT +/* Perform bidiagonal QR iteration, if desired, computing + left singular vectors in U and computing right singular + vectors in VT (Workspace: need BDSPAC) */ dbdsqr_("L", m, &ncvt, &nru, &c__0, &s[1], &work[ie], &vt[ @@ -4006,9 +4005,9 @@ static doublereal c_b438 = 1.; work[iwork], info); } else if (! wntuo && wntvo) { -/* Perform bidiagonal QR iteration, if desired, computing - left singular vectors in U and computing right singular - vectors in A +/* Perform bidiagonal QR iteration, if desired, computing + left singular vectors in U and computing right singular + vectors in A (Workspace: need BDSPAC) */ dbdsqr_("L", m, &ncvt, &nru, &c__0, &s[1], &work[ie], &a[ @@ -4016,9 +4015,9 @@ static doublereal c_b438 = 1.; iwork], info); } else { -/* Perform bidiagonal QR iteration, if desired, computing - left singular vectors in A and computing right singular - vectors in VT +/* Perform bidiagonal QR iteration, if desired, computing + left singular vectors in A and computing right singular + vectors in VT (Workspace: need BDSPAC) */ dbdsqr_("L", m, &ncvt, &nru, &c__0, &s[1], &work[ie], &vt[ @@ -4030,7 +4029,7 @@ static doublereal c_b438 = 1.; } -/* If DBDSQR failed to converge, copy unconverged superdiagonals +/* If DBDSQR failed to converge, copy unconverged superdiagonals to WORK( 2:MINMN ) */ if (*info != 0) { diff --git a/external/hypre/src/lapack/dgetf2.c b/external/hypre/src/lapack/dgetf2.c index a36f6f2e..3e936a35 100644 --- a/external/hypre/src/lapack/dgetf2.c +++ b/external/hypre/src/lapack/dgetf2.c @@ -11,77 +11,77 @@ extern "C" { /* Subroutine */ integer dgetf2_(integer *m, integer *n, doublereal *a, integer * lda, integer *ipiv, integer *info) { -/* -- LAPACK routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - June 30, 1992 +/* -- LAPACK routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + June 30, 1992 - Purpose - ======= + Purpose + ======= - DGETF2 computes an LU factorization of a general m-by-n matrix A - using partial pivoting with row interchanges. + DGETF2 computes an LU factorization of a general m-by-n matrix A + using partial pivoting with row interchanges. - The factorization has the form - A = P * L * U - where P is a permutation matrix, L is lower triangular with unit - diagonal elements (lower trapezoidal if m > n), and U is upper - triangular (upper trapezoidal if m < n). + The factorization has the form + A = P * L * U + where P is a permutation matrix, L is lower triangular with unit + diagonal elements (lower trapezoidal if m > n), and U is upper + triangular (upper trapezoidal if m < n). - This is the right-looking Level 2 BLAS version of the algorithm. + This is the right-looking Level 2 BLAS version of the algorithm. - Arguments - ========= + Arguments + ========= - M (input) INTEGER - The number of rows of the matrix A. M >= 0. + M (input) INTEGER + The number of rows of the matrix A. M >= 0. - N (input) INTEGER - The number of columns of the matrix A. N >= 0. + N (input) INTEGER + The number of columns of the matrix A. N >= 0. - A (input/output) DOUBLE PRECISION array, dimension (LDA,N) - On entry, the m by n matrix to be factored. - On exit, the factors L and U from the factorization - A = P*L*U; the unit diagonal elements of L are not stored. + A (input/output) DOUBLE PRECISION array, dimension (LDA,N) + On entry, the m by n matrix to be factored. + On exit, the factors L and U from the factorization + A = P*L*U; the unit diagonal elements of L are not stored. - LDA (input) INTEGER - The leading dimension of the array A. LDA >= max(1,M). + LDA (input) INTEGER + The leading dimension of the array A. LDA >= max(1,M). - IPIV (output) INTEGER array, dimension (min(M,N)) - The pivot indices; for 1 <= i <= min(M,N), row i of the - matrix was interchanged with row IPIV(i). + IPIV (output) INTEGER array, dimension (min(M,N)) + The pivot indices; for 1 <= i <= min(M,N), row i of the + matrix was interchanged with row IPIV(i). - INFO (output) INTEGER - = 0: successful exit - < 0: if INFO = -k, the k-th argument had an illegal value - > 0: if INFO = k, U(k,k) is exactly zero. The factorization - has been completed, but the factor U is exactly - singular, and division by zero will occur if it is used - to solve a system of equations. + INFO (output) INTEGER + = 0: successful exit + < 0: if INFO = -k, the k-th argument had an illegal value + > 0: if INFO = k, U(k,k) is exactly zero. The factorization + has been completed, but the factor U is exactly + singular, and division by zero will occur if it is used + to solve a system of equations. - ===================================================================== + ===================================================================== - Test the input parameters. + Test the input parameters. Parameter adjustments */ /* Table of constant values */ - static integer c__1 = 1; - static doublereal c_b6 = -1.; - + integer c__1 = 1; + doublereal c_b6 = -1.; + /* System generated locals */ integer a_dim1, a_offset, i__1, i__2, i__3; doublereal d__1; /* Local variables */ - extern /* Subroutine */ integer dger_(integer *, integer *, doublereal *, - doublereal *, integer *, doublereal *, integer *, doublereal *, + extern /* Subroutine */ integer dger_(integer *, integer *, doublereal *, + doublereal *, integer *, doublereal *, integer *, doublereal *, integer *); - static integer j; - extern /* Subroutine */ integer dscal_(integer *, doublereal *, doublereal *, - integer *), dswap_(integer *, doublereal *, integer *, doublereal + integer j; + extern /* Subroutine */ integer dscal_(integer *, doublereal *, doublereal *, + integer *), dswap_(integer *, doublereal *, integer *, doublereal *, integer *); - static integer jp; + integer jp; extern integer idamax_(integer *, doublereal *, integer *); extern /* Subroutine */ integer xerbla_(const char *, integer *); #define a_ref(a_1,a_2) a[(a_2)*a_dim1 + a_1] @@ -148,7 +148,7 @@ extern "C" { i__2 = *m - j; i__3 = *n - j; - dger_(&i__2, &i__3, &c_b6, &a_ref(j + 1, j), &c__1, &a_ref(j, j + + dger_(&i__2, &i__3, &c_b6, &a_ref(j + 1, j), &c__1, &a_ref(j, j + 1), lda, &a_ref(j + 1, j + 1), lda); } /* L10: */ diff --git a/external/hypre/src/lapack/dgetrf.c b/external/hypre/src/lapack/dgetrf.c index ca796a65..77628c71 100644 --- a/external/hypre/src/lapack/dgetrf.c +++ b/external/hypre/src/lapack/dgetrf.c @@ -11,85 +11,85 @@ extern "C" { /* Subroutine */ integer dgetrf_(integer *m, integer *n, doublereal *a, integer * lda, integer *ipiv, integer *info) { -/* -- LAPACK routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - March 31, 1993 +/* -- LAPACK routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + March 31, 1993 - Purpose - ======= + Purpose + ======= - DGETRF computes an LU factorization of a general M-by-N matrix A - using partial pivoting with row interchanges. + DGETRF computes an LU factorization of a general M-by-N matrix A + using partial pivoting with row interchanges. - The factorization has the form - A = P * L * U - where P is a permutation matrix, L is lower triangular with unit - diagonal elements (lower trapezoidal if m > n), and U is upper - triangular (upper trapezoidal if m < n). + The factorization has the form + A = P * L * U + where P is a permutation matrix, L is lower triangular with unit + diagonal elements (lower trapezoidal if m > n), and U is upper + triangular (upper trapezoidal if m < n). - This is the right-looking Level 3 BLAS version of the algorithm. + This is the right-looking Level 3 BLAS version of the algorithm. - Arguments - ========= + Arguments + ========= - M (input) INTEGER - The number of rows of the matrix A. M >= 0. + M (input) INTEGER + The number of rows of the matrix A. M >= 0. - N (input) INTEGER - The number of columns of the matrix A. N >= 0. + N (input) INTEGER + The number of columns of the matrix A. N >= 0. - A (input/output) DOUBLE PRECISION array, dimension (LDA,N) - On entry, the M-by-N matrix to be factored. - On exit, the factors L and U from the factorization - A = P*L*U; the unit diagonal elements of L are not stored. + A (input/output) DOUBLE PRECISION array, dimension (LDA,N) + On entry, the M-by-N matrix to be factored. + On exit, the factors L and U from the factorization + A = P*L*U; the unit diagonal elements of L are not stored. - LDA (input) INTEGER - The leading dimension of the array A. LDA >= max(1,M). + LDA (input) INTEGER + The leading dimension of the array A. LDA >= max(1,M). - IPIV (output) INTEGER array, dimension (min(M,N)) - The pivot indices; for 1 <= i <= min(M,N), row i of the - matrix was interchanged with row IPIV(i). + IPIV (output) INTEGER array, dimension (min(M,N)) + The pivot indices; for 1 <= i <= min(M,N), row i of the + matrix was interchanged with row IPIV(i). - INFO (output) INTEGER - = 0: successful exit - < 0: if INFO = -i, the i-th argument had an illegal value - > 0: if INFO = i, U(i,i) is exactly zero. The factorization - has been completed, but the factor U is exactly - singular, and division by zero will occur if it is used - to solve a system of equations. + INFO (output) INTEGER + = 0: successful exit + < 0: if INFO = -i, the i-th argument had an illegal value + > 0: if INFO = i, U(i,i) is exactly zero. The factorization + has been completed, but the factor U is exactly + singular, and division by zero will occur if it is used + to solve a system of equations. - ===================================================================== + ===================================================================== - Test the input parameters. + Test the input parameters. Parameter adjustments */ /* Table of constant values */ - static integer c__1 = 1; - static integer c_n1 = -1; - static doublereal c_b16 = 1.; - static doublereal c_b19 = -1.; - + integer c__1 = 1; + integer c_n1 = -1; + doublereal c_b16 = 1.; + doublereal c_b19 = -1.; + /* System generated locals */ integer a_dim1, a_offset, i__1, i__2, i__3, i__4, i__5; /* Local variables */ - static integer i__, j; - extern /* Subroutine */ integer dgemm_(const char *,const char *, integer *, integer *, - integer *, doublereal *, doublereal *, integer *, doublereal *, + integer i__, j; + extern /* Subroutine */ integer dgemm_(const char *,const char *, integer *, integer *, + integer *, doublereal *, doublereal *, integer *, doublereal *, integer *, doublereal *, doublereal *, integer *); - static integer iinfo; - extern /* Subroutine */ integer dtrsm_(const char *,const char *,const char *,const char *, - integer *, integer *, doublereal *, doublereal *, integer *, + integer iinfo; + extern /* Subroutine */ integer dtrsm_(const char *,const char *,const char *,const char *, + integer *, integer *, doublereal *, doublereal *, integer *, doublereal *, integer *), dgetf2_( - integer *, integer *, doublereal *, integer *, integer *, integer + integer *, integer *, doublereal *, integer *, integer *, integer *); - static integer jb, nb; + integer jb, nb; extern /* Subroutine */ integer xerbla_(const char *, integer *); - extern integer ilaenv_(integer *,const char *,const char *, integer *, integer *, + extern integer ilaenv_(integer *,const char *,const char *, integer *, integer *, integer *, integer *, ftnlen, ftnlen); - extern /* Subroutine */ integer dlaswp_(integer *, doublereal *, integer *, + extern /* Subroutine */ integer dlaswp_(integer *, doublereal *, integer *, integer *, integer *, integer *, integer *); #define a_ref(a_1,a_2) a[(a_2)*a_dim1 + a_1] @@ -140,7 +140,7 @@ extern "C" { i__3 = min(*m,*n) - j + 1; jb = min(i__3,nb); -/* Factor diagonal and subdiagonal blocks and test for exact +/* Factor diagonal and subdiagonal blocks and test for exact singularity. */ i__3 = *m - j + 1; @@ -185,7 +185,7 @@ extern "C" { i__3 = *m - j - jb + 1; i__4 = *n - j - jb + 1; - dgemm_("No transpose", "No transpose", &i__3, &i__4, &jb, + dgemm_("No transpose", "No transpose", &i__3, &i__4, &jb, &c_b19, &a_ref(j + jb, j), lda, &a_ref(j, j + jb), lda, &c_b16, &a_ref(j + jb, j + jb), lda); } diff --git a/external/hypre/src/lapack/dgetri.c b/external/hypre/src/lapack/dgetri.c index 40ec79d1..2b1bbc5d 100644 --- a/external/hypre/src/lapack/dgetri.c +++ b/external/hypre/src/lapack/dgetri.c @@ -8,99 +8,99 @@ extern "C" { #include "f2c.h" #include "hypre_lapack.h" -/* Subroutine */ integer dgetri_(integer *n, doublereal *a, integer *lda, integer +/* Subroutine */ integer dgetri_(integer *n, doublereal *a, integer *lda, integer *ipiv, doublereal *work, integer *lwork, integer *info) { -/* -- LAPACK routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - June 30, 1999 +/* -- LAPACK routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + June 30, 1999 - Purpose - ======= + Purpose + ======= - DGETRI computes the inverse of a matrix using the LU factorization - computed by DGETRF. + DGETRI computes the inverse of a matrix using the LU factorization + computed by DGETRF. - This method inverts U and then computes inv(A) by solving the system - inv(A)*L = inv(U) for inv(A). + This method inverts U and then computes inv(A) by solving the system + inv(A)*L = inv(U) for inv(A). - Arguments - ========= + Arguments + ========= - N (input) INTEGER - The order of the matrix A. N >= 0. + N (input) INTEGER + The order of the matrix A. N >= 0. - A (input/output) DOUBLE PRECISION array, dimension (LDA,N) - On entry, the factors L and U from the factorization - A = P*L*U as computed by DGETRF. - On exit, if INFO = 0, the inverse of the original matrix A. + A (input/output) DOUBLE PRECISION array, dimension (LDA,N) + On entry, the factors L and U from the factorization + A = P*L*U as computed by DGETRF. + On exit, if INFO = 0, the inverse of the original matrix A. - LDA (input) INTEGER - The leading dimension of the array A. LDA >= max(1,N). + LDA (input) INTEGER + The leading dimension of the array A. LDA >= max(1,N). - IPIV (input) INTEGER array, dimension (N) - The pivot indices from DGETRF; for 1<=i<=N, row i of the - matrix was interchanged with row IPIV(i). + IPIV (input) INTEGER array, dimension (N) + The pivot indices from DGETRF; for 1<=i<=N, row i of the + matrix was interchanged with row IPIV(i). - WORK (workspace/output) DOUBLE PRECISION array, dimension (LWORK) - On exit, if INFO=0, then WORK(1) returns the optimal LWORK. + WORK (workspace/output) DOUBLE PRECISION array, dimension (LWORK) + On exit, if INFO=0, then WORK(1) returns the optimal LWORK. - LWORK (input) INTEGER - The dimension of the array WORK. LWORK >= max(1,N). - For optimal performance LWORK >= N*NB, where NB is - the optimal blocksize returned by ILAENV. + LWORK (input) INTEGER + The dimension of the array WORK. LWORK >= max(1,N). + For optimal performance LWORK >= N*NB, where NB is + the optimal blocksize returned by ILAENV. - If LWORK = -1, then a workspace query is assumed; the routine - only calculates the optimal size of the WORK array, returns - this value as the first entry of the WORK array, and no error - message related to LWORK is issued by XERBLA. + If LWORK = -1, then a workspace query is assumed; the routine + only calculates the optimal size of the WORK array, returns + this value as the first entry of the WORK array, and no error + message related to LWORK is issued by XERBLA. - INFO (output) INTEGER - = 0: successful exit - < 0: if INFO = -i, the i-th argument had an illegal value - > 0: if INFO = i, U(i,i) is exactly zero; the matrix is - singular and its inverse could not be computed. + INFO (output) INTEGER + = 0: successful exit + < 0: if INFO = -i, the i-th argument had an illegal value + > 0: if INFO = i, U(i,i) is exactly zero; the matrix is + singular and its inverse could not be computed. - ===================================================================== + ===================================================================== - Test the input parameters. + Test the input parameters. Parameter adjustments */ /* Table of constant values */ - static integer c__1 = 1; - static integer c_n1 = -1; - static integer c__2 = 2; - static doublereal c_b20 = -1.; - static doublereal c_b22 = 1.; - + integer c__1 = 1; + integer c_n1 = -1; + integer c__2 = 2; + doublereal c_b20 = -1.; + doublereal c_b22 = 1.; + /* System generated locals */ integer a_dim1, a_offset, i__1, i__2, i__3; /* Local variables */ - static integer i__, j; - extern /* Subroutine */ integer dgemm_(const char *, const char *, integer *, integer *, - integer *, doublereal *, doublereal *, integer *, doublereal *, + integer i__, j; + extern /* Subroutine */ integer dgemm_(const char *, const char *, integer *, integer *, + integer *, doublereal *, doublereal *, integer *, doublereal *, integer *, doublereal *, doublereal *, integer *), - dgemv_(const char *, integer *, integer *, doublereal *, doublereal *, - integer *, doublereal *, integer *, doublereal *, doublereal *, + dgemv_(const char *, integer *, integer *, doublereal *, doublereal *, + integer *, doublereal *, integer *, doublereal *, doublereal *, integer *); - static integer nbmin; - extern /* Subroutine */ integer dswap_(integer *, doublereal *, integer *, - doublereal *, integer *), dtrsm_(const char *, const char *, const char *, const char *, - integer *, integer *, doublereal *, doublereal *, integer *, + integer nbmin; + extern /* Subroutine */ integer dswap_(integer *, doublereal *, integer *, + doublereal *, integer *), dtrsm_(const char *, const char *, const char *, const char *, + integer *, integer *, doublereal *, doublereal *, integer *, doublereal *, integer *); - static integer jb, nb, jj, jp, nn; + integer jb, nb, jj, jp, nn; extern /* Subroutine */ integer xerbla_(const char *, integer *); - extern integer ilaenv_(integer *, const char *, const char *, integer *, integer *, + extern integer ilaenv_(integer *, const char *, const char *, integer *, integer *, integer *, integer *, ftnlen, ftnlen); - static integer ldwork; - extern /* Subroutine */ integer dtrtri_(const char *, const char *, integer *, doublereal + integer ldwork; + extern /* Subroutine */ integer dtrtri_(const char *, const char *, integer *, doublereal *, integer *, integer *); - static integer lwkopt; - static logical lquery; - static integer iws; + integer lwkopt; + logical lquery; + integer iws; #define a_ref(a_1,a_2) a[(a_2)*a_dim1 + a_1] @@ -138,7 +138,7 @@ extern "C" { return 0; } -/* Form inv(U). If INFO > 0 from DTRTRI, then U is singular, +/* Form inv(U). If INFO > 0 from DTRTRI, then U is singular, and the inverse is not computed. */ dtrtri_("Upper", "Non-unit", n, &a[a_offset], lda, info); @@ -184,7 +184,7 @@ extern "C" { if (j < *n) { i__1 = *n - j; - dgemv_("No transpose", n, &i__1, &c_b20, &a_ref(1, j + 1), + dgemv_("No transpose", n, &i__1, &c_b20, &a_ref(1, j + 1), lda, &work[j + 1], &c__1, &c_b22, &a_ref(1, j), &c__1); } /* L20: */ @@ -200,7 +200,7 @@ extern "C" { i__2 = nb, i__3 = *n - j + 1; jb = min(i__2,i__3); -/* Copy current block column of L to WORK and replace with +/* Copy current block column of L to WORK and replace with zeros. */ i__2 = j + jb - 1; @@ -218,7 +218,7 @@ extern "C" { if (j + jb <= *n) { i__2 = *n - j - jb + 1; - dgemm_("No transpose", "No transpose", n, &jb, &i__2, &c_b20, + dgemm_("No transpose", "No transpose", n, &jb, &i__2, &c_b20, &a_ref(1, j + jb), lda, &work[j + jb], &ldwork, & c_b22, &a_ref(1, j), lda); } @@ -250,4 +250,3 @@ extern "C" { #ifdef __cplusplus } #endif - diff --git a/external/hypre/src/lapack/dgetrs.c b/external/hypre/src/lapack/dgetrs.c index 80a31eff..9c11e947 100644 --- a/external/hypre/src/lapack/dgetrs.c +++ b/external/hypre/src/lapack/dgetrs.c @@ -8,83 +8,83 @@ extern "C" { #include "f2c.h" #include "hypre_lapack.h" -/* Subroutine */ integer dgetrs_(const char *trans, integer *n, integer *nrhs, +/* Subroutine */ integer dgetrs_(const char *trans, integer *n, integer *nrhs, doublereal *a, integer *lda, integer *ipiv, doublereal *b, integer * ldb, integer *info) { -/* -- LAPACK routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - March 31, 1993 +/* -- LAPACK routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + March 31, 1993 - Purpose - ======= + Purpose + ======= - DGETRS solves a system of linear equations - A * X = B or A' * X = B - with a general N-by-N matrix A using the LU factorization computed - by DGETRF. + DGETRS solves a system of linear equations + A * X = B or A' * X = B + with a general N-by-N matrix A using the LU factorization computed + by DGETRF. - Arguments - ========= + Arguments + ========= - TRANS (input) CHARACTER*1 - Specifies the form of the system of equations: - = 'N': A * X = B (No transpose) - = 'T': A'* X = B (Transpose) - = 'C': A'* X = B (Conjugate transpose = Transpose) + TRANS (input) CHARACTER*1 + Specifies the form of the system of equations: + = 'N': A * X = B (No transpose) + = 'T': A'* X = B (Transpose) + = 'C': A'* X = B (Conjugate transpose = Transpose) - N (input) INTEGER - The order of the matrix A. N >= 0. + N (input) INTEGER + The order of the matrix A. N >= 0. - NRHS (input) INTEGER - The number of right hand sides, i.e., the number of columns - of the matrix B. NRHS >= 0. + NRHS (input) INTEGER + The number of right hand sides, i.e., the number of columns + of the matrix B. NRHS >= 0. - A (input) DOUBLE PRECISION array, dimension (LDA,N) - The factors L and U from the factorization A = P*L*U - as computed by DGETRF. + A (input) DOUBLE PRECISION array, dimension (LDA,N) + The factors L and U from the factorization A = P*L*U + as computed by DGETRF. - LDA (input) INTEGER - The leading dimension of the array A. LDA >= max(1,N). + LDA (input) INTEGER + The leading dimension of the array A. LDA >= max(1,N). - IPIV (input) INTEGER array, dimension (N) - The pivot indices from DGETRF; for 1<=i<=N, row i of the - matrix was interchanged with row IPIV(i). + IPIV (input) INTEGER array, dimension (N) + The pivot indices from DGETRF; for 1<=i<=N, row i of the + matrix was interchanged with row IPIV(i). - B (input/output) DOUBLE PRECISION array, dimension (LDB,NRHS) - On entry, the right hand side matrix B. - On exit, the solution matrix X. + B (input/output) DOUBLE PRECISION array, dimension (LDB,NRHS) + On entry, the right hand side matrix B. + On exit, the solution matrix X. - LDB (input) INTEGER - The leading dimension of the array B. LDB >= max(1,N). + LDB (input) INTEGER + The leading dimension of the array B. LDB >= max(1,N). - INFO (output) INTEGER - = 0: successful exit - < 0: if INFO = -i, the i-th argument had an illegal value + INFO (output) INTEGER + = 0: successful exit + < 0: if INFO = -i, the i-th argument had an illegal value - ===================================================================== + ===================================================================== - Test the input parameters. + Test the input parameters. Parameter adjustments */ /* Table of constant values */ - static integer c__1 = 1; - static doublereal c_b12 = 1.; - static integer c_n1 = -1; - + integer c__1 = 1; + doublereal c_b12 = 1.; + integer c_n1 = -1; + /* System generated locals */ integer a_dim1, a_offset, b_dim1, b_offset, i__1; /* Local variables */ extern logical lsame_(const char *,const char *); - extern /* Subroutine */ integer dtrsm_(const char *,const char *,const char *,const char *, - integer *, integer *, doublereal *, doublereal *, integer *, + extern /* Subroutine */ integer dtrsm_(const char *,const char *,const char *,const char *, + integer *, integer *, doublereal *, doublereal *, integer *, doublereal *, integer *), xerbla_( - const char *, integer *), dlaswp_(integer *, doublereal *, + const char *, integer *), dlaswp_(integer *, doublereal *, integer *, integer *, integer *, integer *, integer *); - static logical notran; + logical notran; a_dim1 = *lda; @@ -124,7 +124,7 @@ extern "C" { if (notran) { -/* Solve A * X = B. +/* Solve A * X = B. Apply row interchanges to the right hand sides. */ @@ -141,7 +141,7 @@ extern "C" { a[a_offset], lda, &b[b_offset], ldb); } else { -/* Solve A' * X = B. +/* Solve A' * X = B. Solve U'*X = B, overwriting B with X. */ diff --git a/external/hypre/src/lapack/dlabrd.c b/external/hypre/src/lapack/dlabrd.c index 92f65f4d..b247c007 100644 --- a/external/hypre/src/lapack/dlabrd.c +++ b/external/hypre/src/lapack/dlabrd.c @@ -9,155 +9,155 @@ extern "C" { #include "hypre_lapack.h" /* Subroutine */ integer dlabrd_(integer *m, integer *n, integer *nb, doublereal * - a, integer *lda, doublereal *d__, doublereal *e, doublereal *tauq, - doublereal *taup, doublereal *x, integer *ldx, doublereal *y, integer + a, integer *lda, doublereal *d__, doublereal *e, doublereal *tauq, + doublereal *taup, doublereal *x, integer *ldx, doublereal *y, integer *ldy) { -/* -- LAPACK auxiliary routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - February 29, 1992 +/* -- LAPACK auxiliary routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + February 29, 1992 - Purpose - ======= + Purpose + ======= - DLABRD reduces the first NB rows and columns of a real general - m by n matrix A to upper or lower bidiagonal form by an orthogonal - transformation Q' * A * P, and returns the matrices X and Y which - are needed to apply the transformation to the unreduced part of A. + DLABRD reduces the first NB rows and columns of a real general + m by n matrix A to upper or lower bidiagonal form by an orthogonal + transformation Q' * A * P, and returns the matrices X and Y which + are needed to apply the transformation to the unreduced part of A. - If m >= n, A is reduced to upper bidiagonal form; if m < n, to lower - bidiagonal form. + If m >= n, A is reduced to upper bidiagonal form; if m < n, to lower + bidiagonal form. - This is an auxiliary routine called by DGEBRD + This is an auxiliary routine called by DGEBRD - Arguments - ========= + Arguments + ========= - M (input) INTEGER - The number of rows in the matrix A. + M (input) INTEGER + The number of rows in the matrix A. - N (input) INTEGER - The number of columns in the matrix A. + N (input) INTEGER + The number of columns in the matrix A. - NB (input) INTEGER - The number of leading rows and columns of A to be reduced. + NB (input) INTEGER + The number of leading rows and columns of A to be reduced. - A (input/output) DOUBLE PRECISION array, dimension (LDA,N) - On entry, the m by n general matrix to be reduced. - On exit, the first NB rows and columns of the matrix are - overwritten; the rest of the array is unchanged. - If m >= n, elements on and below the diagonal in the first NB - columns, with the array TAUQ, represent the orthogonal - matrix Q as a product of elementary reflectors; and - elements above the diagonal in the first NB rows, with the - array TAUP, represent the orthogonal matrix P as a product - of elementary reflectors. - If m < n, elements below the diagonal in the first NB - columns, with the array TAUQ, represent the orthogonal - matrix Q as a product of elementary reflectors, and - elements on and above the diagonal in the first NB rows, - with the array TAUP, represent the orthogonal matrix P as - a product of elementary reflectors. - See Further Details. + A (input/output) DOUBLE PRECISION array, dimension (LDA,N) + On entry, the m by n general matrix to be reduced. + On exit, the first NB rows and columns of the matrix are + overwritten; the rest of the array is unchanged. + If m >= n, elements on and below the diagonal in the first NB + columns, with the array TAUQ, represent the orthogonal + matrix Q as a product of elementary reflectors; and + elements above the diagonal in the first NB rows, with the + array TAUP, represent the orthogonal matrix P as a product + of elementary reflectors. + If m < n, elements below the diagonal in the first NB + columns, with the array TAUQ, represent the orthogonal + matrix Q as a product of elementary reflectors, and + elements on and above the diagonal in the first NB rows, + with the array TAUP, represent the orthogonal matrix P as + a product of elementary reflectors. + See Further Details. - LDA (input) INTEGER - The leading dimension of the array A. LDA >= max(1,M). + LDA (input) INTEGER + The leading dimension of the array A. LDA >= max(1,M). - D (output) DOUBLE PRECISION array, dimension (NB) - The diagonal elements of the first NB rows and columns of - the reduced matrix. D(i) = A(i,i). + D (output) DOUBLE PRECISION array, dimension (NB) + The diagonal elements of the first NB rows and columns of + the reduced matrix. D(i) = A(i,i). - E (output) DOUBLE PRECISION array, dimension (NB) - The off-diagonal elements of the first NB rows and columns of - the reduced matrix. + E (output) DOUBLE PRECISION array, dimension (NB) + The off-diagonal elements of the first NB rows and columns of + the reduced matrix. - TAUQ (output) DOUBLE PRECISION array dimension (NB) - The scalar factors of the elementary reflectors which - represent the orthogonal matrix Q. See Further Details. + TAUQ (output) DOUBLE PRECISION array dimension (NB) + The scalar factors of the elementary reflectors which + represent the orthogonal matrix Q. See Further Details. - TAUP (output) DOUBLE PRECISION array, dimension (NB) - The scalar factors of the elementary reflectors which - represent the orthogonal matrix P. See Further Details. + TAUP (output) DOUBLE PRECISION array, dimension (NB) + The scalar factors of the elementary reflectors which + represent the orthogonal matrix P. See Further Details. - X (output) DOUBLE PRECISION array, dimension (LDX,NB) - The m-by-nb matrix X required to update the unreduced part - of A. + X (output) DOUBLE PRECISION array, dimension (LDX,NB) + The m-by-nb matrix X required to update the unreduced part + of A. - LDX (input) INTEGER - The leading dimension of the array X. LDX >= M. + LDX (input) INTEGER + The leading dimension of the array X. LDX >= M. - Y (output) DOUBLE PRECISION array, dimension (LDY,NB) - The n-by-nb matrix Y required to update the unreduced part - of A. + Y (output) DOUBLE PRECISION array, dimension (LDY,NB) + The n-by-nb matrix Y required to update the unreduced part + of A. - LDY (output) INTEGER - The leading dimension of the array Y. LDY >= N. + LDY (output) INTEGER + The leading dimension of the array Y. LDY >= N. - Further Details - =============== + Further Details + =============== - The matrices Q and P are represented as products of elementary - reflectors: + The matrices Q and P are represented as products of elementary + reflectors: - Q = H(1) H(2) . . . H(nb) and P = G(1) G(2) . . . G(nb) + Q = H(1) H(2) . . . H(nb) and P = G(1) G(2) . . . G(nb) - Each H(i) and G(i) has the form: + Each H(i) and G(i) has the form: - H(i) = I - tauq * v * v' and G(i) = I - taup * u * u' + H(i) = I - tauq * v * v' and G(i) = I - taup * u * u' - where tauq and taup are real scalars, and v and u are real vectors. + where tauq and taup are real scalars, and v and u are real vectors. - If m >= n, v(1:i-1) = 0, v(i) = 1, and v(i:m) is stored on exit in - A(i:m,i); u(1:i) = 0, u(i+1) = 1, and u(i+1:n) is stored on exit in - A(i,i+1:n); tauq is stored in TAUQ(i) and taup in TAUP(i). + If m >= n, v(1:i-1) = 0, v(i) = 1, and v(i:m) is stored on exit in + A(i:m,i); u(1:i) = 0, u(i+1) = 1, and u(i+1:n) is stored on exit in + A(i,i+1:n); tauq is stored in TAUQ(i) and taup in TAUP(i). - If m < n, v(1:i) = 0, v(i+1) = 1, and v(i+1:m) is stored on exit in - A(i+2:m,i); u(1:i-1) = 0, u(i) = 1, and u(i:n) is stored on exit in - A(i,i+1:n); tauq is stored in TAUQ(i) and taup in TAUP(i). + If m < n, v(1:i) = 0, v(i+1) = 1, and v(i+1:m) is stored on exit in + A(i+2:m,i); u(1:i-1) = 0, u(i) = 1, and u(i:n) is stored on exit in + A(i,i+1:n); tauq is stored in TAUQ(i) and taup in TAUP(i). - The elements of the vectors v and u together form the m-by-nb matrix - V and the nb-by-n matrix U' which are needed, with X and Y, to apply - the transformation to the unreduced part of the matrix, using a block - update of the form: A := A - V*Y' - X*U'. + The elements of the vectors v and u together form the m-by-nb matrix + V and the nb-by-n matrix U' which are needed, with X and Y, to apply + the transformation to the unreduced part of the matrix, using a block + update of the form: A := A - V*Y' - X*U'. - The contents of A on exit are illustrated by the following examples - with nb = 2: + The contents of A on exit are illustrated by the following examples + with nb = 2: - m = 6 and n = 5 (m > n): m = 5 and n = 6 (m < n): + m = 6 and n = 5 (m > n): m = 5 and n = 6 (m < n): - ( 1 1 u1 u1 u1 ) ( 1 u1 u1 u1 u1 u1 ) - ( v1 1 1 u2 u2 ) ( 1 1 u2 u2 u2 u2 ) - ( v1 v2 a a a ) ( v1 1 a a a a ) - ( v1 v2 a a a ) ( v1 v2 a a a a ) - ( v1 v2 a a a ) ( v1 v2 a a a a ) - ( v1 v2 a a a ) + ( 1 1 u1 u1 u1 ) ( 1 u1 u1 u1 u1 u1 ) + ( v1 1 1 u2 u2 ) ( 1 1 u2 u2 u2 u2 ) + ( v1 v2 a a a ) ( v1 1 a a a a ) + ( v1 v2 a a a ) ( v1 v2 a a a a ) + ( v1 v2 a a a ) ( v1 v2 a a a a ) + ( v1 v2 a a a ) - where a denotes an element of the original matrix which is unchanged, - vi denotes an element of the vector defining H(i), and ui an element - of the vector defining G(i). + where a denotes an element of the original matrix which is unchanged, + vi denotes an element of the vector defining H(i), and ui an element + of the vector defining G(i). - ===================================================================== + ===================================================================== - Quick return if possible + Quick return if possible Parameter adjustments */ /* Table of constant values */ - static doublereal c_b4 = -1.; - static doublereal c_b5 = 1.; - static integer c__1 = 1; - static doublereal c_b16 = 0.; - + doublereal c_b4 = -1.; + doublereal c_b5 = 1.; + integer c__1 = 1; + doublereal c_b16 = 0.; + /* System generated locals */ - integer a_dim1, a_offset, x_dim1, x_offset, y_dim1, y_offset, i__1, i__2, + integer a_dim1, a_offset, x_dim1, x_offset, y_dim1, y_offset, i__1, i__2, i__3; /* Local variables */ - static integer i__; - extern /* Subroutine */ integer dscal_(integer *, doublereal *, doublereal *, - integer *), dgemv_(const char *, integer *, integer *, doublereal *, - doublereal *, integer *, doublereal *, integer *, doublereal *, + integer i__; + extern /* Subroutine */ integer dscal_(integer *, doublereal *, doublereal *, + integer *), dgemv_(const char *, integer *, integer *, doublereal *, + doublereal *, integer *, doublereal *, integer *, doublereal *, doublereal *, integer *), dlarfg_(integer *, doublereal *, doublereal *, integer *, doublereal *); #define a_ref(a_1,a_2) a[(a_2)*a_dim1 + a_1] @@ -202,7 +202,7 @@ extern "C" { dgemv_("No transpose", &i__2, &i__3, &c_b4, &x_ref(i__, 1), ldx, & a_ref(1, i__), &c__1, &c_b5, &a_ref(i__, i__), &c__1); -/* Generate reflection Q(i) to annihilate A(i+1:m,i) +/* Generate reflection Q(i) to annihilate A(i+1:m,i) Computing MIN */ i__2 = i__ + 1; @@ -222,23 +222,23 @@ extern "C" { i__), &c__1); i__2 = *m - i__ + 1; i__3 = i__ - 1; - dgemv_("Transpose", &i__2, &i__3, &c_b5, &a_ref(i__, 1), lda, + dgemv_("Transpose", &i__2, &i__3, &c_b5, &a_ref(i__, 1), lda, &a_ref(i__, i__), &c__1, &c_b16, &y_ref(1, i__), & c__1); i__2 = *n - i__; i__3 = i__ - 1; dgemv_("No transpose", &i__2, &i__3, &c_b4, &y_ref(i__ + 1, 1) - , ldy, &y_ref(1, i__), &c__1, &c_b5, &y_ref(i__ + 1, + , ldy, &y_ref(1, i__), &c__1, &c_b5, &y_ref(i__ + 1, i__), &c__1); i__2 = *m - i__ + 1; i__3 = i__ - 1; - dgemv_("Transpose", &i__2, &i__3, &c_b5, &x_ref(i__, 1), ldx, + dgemv_("Transpose", &i__2, &i__3, &c_b5, &x_ref(i__, 1), ldx, &a_ref(i__, i__), &c__1, &c_b16, &y_ref(1, i__), & c__1); i__2 = i__ - 1; i__3 = *n - i__; - dgemv_("Transpose", &i__2, &i__3, &c_b4, &a_ref(1, i__ + 1), - lda, &y_ref(1, i__), &c__1, &c_b5, &y_ref(i__ + 1, + dgemv_("Transpose", &i__2, &i__3, &c_b4, &a_ref(1, i__ + 1), + lda, &y_ref(1, i__), &c__1, &c_b5, &y_ref(i__ + 1, i__), &c__1); i__2 = *n - i__; dscal_(&i__2, &tauq[i__], &y_ref(i__ + 1, i__), &c__1); @@ -251,11 +251,11 @@ extern "C" { , lda); i__2 = i__ - 1; i__3 = *n - i__; - dgemv_("Transpose", &i__2, &i__3, &c_b4, &a_ref(1, i__ + 1), + dgemv_("Transpose", &i__2, &i__3, &c_b4, &a_ref(1, i__ + 1), lda, &x_ref(i__, 1), ldx, &c_b5, &a_ref(i__, i__ + 1), lda); -/* Generate reflection P(i) to annihilate A(i,i+2:n) +/* Generate reflection P(i) to annihilate A(i,i+2:n) Computing MIN */ i__2 = i__ + 2; @@ -269,26 +269,26 @@ extern "C" { i__2 = *m - i__; i__3 = *n - i__; - dgemv_("No transpose", &i__2, &i__3, &c_b5, &a_ref(i__ + 1, + dgemv_("No transpose", &i__2, &i__3, &c_b5, &a_ref(i__ + 1, i__ + 1), lda, &a_ref(i__, i__ + 1), lda, &c_b16, & x_ref(i__ + 1, i__), &c__1); i__2 = *n - i__; - dgemv_("Transpose", &i__2, &i__, &c_b5, &y_ref(i__ + 1, 1), + dgemv_("Transpose", &i__2, &i__, &c_b5, &y_ref(i__ + 1, 1), ldy, &a_ref(i__, i__ + 1), lda, &c_b16, &x_ref(1, i__) , &c__1); i__2 = *m - i__; dgemv_("No transpose", &i__2, &i__, &c_b4, &a_ref(i__ + 1, 1), - lda, &x_ref(1, i__), &c__1, &c_b5, &x_ref(i__ + 1, + lda, &x_ref(1, i__), &c__1, &c_b5, &x_ref(i__ + 1, i__), &c__1); i__2 = i__ - 1; i__3 = *n - i__; dgemv_("No transpose", &i__2, &i__3, &c_b5, &a_ref(1, i__ + 1) - , lda, &a_ref(i__, i__ + 1), lda, &c_b16, &x_ref(1, + , lda, &a_ref(i__, i__ + 1), lda, &c_b16, &x_ref(1, i__), &c__1); i__2 = *m - i__; i__3 = i__ - 1; dgemv_("No transpose", &i__2, &i__3, &c_b4, &x_ref(i__ + 1, 1) - , ldx, &x_ref(1, i__), &c__1, &c_b5, &x_ref(i__ + 1, + , ldx, &x_ref(1, i__), &c__1, &c_b5, &x_ref(i__ + 1, i__), &c__1); i__2 = *m - i__; dscal_(&i__2, &taup[i__], &x_ref(i__ + 1, i__), &c__1); @@ -313,7 +313,7 @@ extern "C" { dgemv_("Transpose", &i__2, &i__3, &c_b4, &a_ref(1, i__), lda, & x_ref(i__, 1), ldx, &c_b5, &a_ref(i__, i__), lda); -/* Generate reflection P(i) to annihilate A(i,i+1:n) +/* Generate reflection P(i) to annihilate A(i,i+1:n) Computing MIN */ i__2 = i__ + 1; @@ -328,27 +328,27 @@ extern "C" { i__2 = *m - i__; i__3 = *n - i__ + 1; - dgemv_("No transpose", &i__2, &i__3, &c_b5, &a_ref(i__ + 1, - i__), lda, &a_ref(i__, i__), lda, &c_b16, &x_ref(i__ + dgemv_("No transpose", &i__2, &i__3, &c_b5, &a_ref(i__ + 1, + i__), lda, &a_ref(i__, i__), lda, &c_b16, &x_ref(i__ + 1, i__), &c__1); i__2 = *n - i__ + 1; i__3 = i__ - 1; - dgemv_("Transpose", &i__2, &i__3, &c_b5, &y_ref(i__, 1), ldy, + dgemv_("Transpose", &i__2, &i__3, &c_b5, &y_ref(i__, 1), ldy, &a_ref(i__, i__), lda, &c_b16, &x_ref(1, i__), &c__1); i__2 = *m - i__; i__3 = i__ - 1; dgemv_("No transpose", &i__2, &i__3, &c_b4, &a_ref(i__ + 1, 1) - , lda, &x_ref(1, i__), &c__1, &c_b5, &x_ref(i__ + 1, + , lda, &x_ref(1, i__), &c__1, &c_b5, &x_ref(i__ + 1, i__), &c__1); i__2 = i__ - 1; i__3 = *n - i__ + 1; - dgemv_("No transpose", &i__2, &i__3, &c_b5, &a_ref(1, i__), + dgemv_("No transpose", &i__2, &i__3, &c_b5, &a_ref(1, i__), lda, &a_ref(i__, i__), lda, &c_b16, &x_ref(1, i__), & c__1); i__2 = *m - i__; i__3 = i__ - 1; dgemv_("No transpose", &i__2, &i__3, &c_b4, &x_ref(i__ + 1, 1) - , ldx, &x_ref(1, i__), &c__1, &c_b5, &x_ref(i__ + 1, + , ldx, &x_ref(1, i__), &c__1, &c_b5, &x_ref(i__ + 1, i__), &c__1); i__2 = *m - i__; dscal_(&i__2, &taup[i__], &x_ref(i__ + 1, i__), &c__1); @@ -358,14 +358,14 @@ extern "C" { i__2 = *m - i__; i__3 = i__ - 1; dgemv_("No transpose", &i__2, &i__3, &c_b4, &a_ref(i__ + 1, 1) - , lda, &y_ref(i__, 1), ldy, &c_b5, &a_ref(i__ + 1, + , lda, &y_ref(i__, 1), ldy, &c_b5, &a_ref(i__ + 1, i__), &c__1); i__2 = *m - i__; dgemv_("No transpose", &i__2, &i__, &c_b4, &x_ref(i__ + 1, 1), - ldx, &a_ref(1, i__), &c__1, &c_b5, &a_ref(i__ + 1, + ldx, &a_ref(1, i__), &c__1, &c_b5, &a_ref(i__ + 1, i__), &c__1); -/* Generate reflection Q(i) to annihilate A(i+2:m,i) +/* Generate reflection Q(i) to annihilate A(i+2:m,i) Computing MIN */ i__2 = i__ + 2; @@ -379,26 +379,26 @@ extern "C" { i__2 = *m - i__; i__3 = *n - i__; - dgemv_("Transpose", &i__2, &i__3, &c_b5, &a_ref(i__ + 1, i__ + dgemv_("Transpose", &i__2, &i__3, &c_b5, &a_ref(i__ + 1, i__ + 1), lda, &a_ref(i__ + 1, i__), &c__1, &c_b16, & y_ref(i__ + 1, i__), &c__1); i__2 = *m - i__; i__3 = i__ - 1; - dgemv_("Transpose", &i__2, &i__3, &c_b5, &a_ref(i__ + 1, 1), - lda, &a_ref(i__ + 1, i__), &c__1, &c_b16, &y_ref(1, + dgemv_("Transpose", &i__2, &i__3, &c_b5, &a_ref(i__ + 1, 1), + lda, &a_ref(i__ + 1, i__), &c__1, &c_b16, &y_ref(1, i__), &c__1); i__2 = *n - i__; i__3 = i__ - 1; dgemv_("No transpose", &i__2, &i__3, &c_b4, &y_ref(i__ + 1, 1) - , ldy, &y_ref(1, i__), &c__1, &c_b5, &y_ref(i__ + 1, + , ldy, &y_ref(1, i__), &c__1, &c_b5, &y_ref(i__ + 1, i__), &c__1); i__2 = *m - i__; - dgemv_("Transpose", &i__2, &i__, &c_b5, &x_ref(i__ + 1, 1), - ldx, &a_ref(i__ + 1, i__), &c__1, &c_b16, &y_ref(1, + dgemv_("Transpose", &i__2, &i__, &c_b5, &x_ref(i__ + 1, 1), + ldx, &a_ref(i__ + 1, i__), &c__1, &c_b16, &y_ref(1, i__), &c__1); i__2 = *n - i__; - dgemv_("Transpose", &i__, &i__2, &c_b4, &a_ref(1, i__ + 1), - lda, &y_ref(1, i__), &c__1, &c_b5, &y_ref(i__ + 1, + dgemv_("Transpose", &i__, &i__2, &c_b4, &a_ref(1, i__ + 1), + lda, &y_ref(1, i__), &c__1, &c_b5, &y_ref(i__ + 1, i__), &c__1); i__2 = *n - i__; dscal_(&i__2, &tauq[i__], &y_ref(i__ + 1, i__), &c__1); diff --git a/external/hypre/src/lapack/dlacpy.c b/external/hypre/src/lapack/dlacpy.c index 2bce9b0b..f1caf6fd 100644 --- a/external/hypre/src/lapack/dlacpy.c +++ b/external/hypre/src/lapack/dlacpy.c @@ -11,55 +11,55 @@ extern "C" { /* Subroutine */ integer dlacpy_(const char *uplo, integer *m, integer *n, doublereal * a, integer *lda, doublereal *b, integer *ldb) { -/* -- LAPACK auxiliary routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - February 29, 1992 +/* -- LAPACK auxiliary routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + February 29, 1992 - Purpose - ======= + Purpose + ======= - DLACPY copies all or part of a two-dimensional matrix A to another - matrix B. + DLACPY copies all or part of a two-dimensional matrix A to another + matrix B. - Arguments - ========= + Arguments + ========= - UPLO (input) CHARACTER*1 - Specifies the part of the matrix A to be copied to B. - = 'U': Upper triangular part - = 'L': Lower triangular part - Otherwise: All of the matrix A + UPLO (input) CHARACTER*1 + Specifies the part of the matrix A to be copied to B. + = 'U': Upper triangular part + = 'L': Lower triangular part + Otherwise: All of the matrix A - M (input) INTEGER - The number of rows of the matrix A. M >= 0. + M (input) INTEGER + The number of rows of the matrix A. M >= 0. - N (input) INTEGER - The number of columns of the matrix A. N >= 0. + N (input) INTEGER + The number of columns of the matrix A. N >= 0. - A (input) DOUBLE PRECISION array, dimension (LDA,N) - The m by n matrix A. If UPLO = 'U', only the upper triangle - or trapezoid is accessed; if UPLO = 'L', only the lower - triangle or trapezoid is accessed. + A (input) DOUBLE PRECISION array, dimension (LDA,N) + The m by n matrix A. If UPLO = 'U', only the upper triangle + or trapezoid is accessed; if UPLO = 'L', only the lower + triangle or trapezoid is accessed. - LDA (input) INTEGER - The leading dimension of the array A. LDA >= max(1,M). + LDA (input) INTEGER + The leading dimension of the array A. LDA >= max(1,M). - B (output) DOUBLE PRECISION array, dimension (LDB,N) - On exit, B = A in the locations specified by UPLO. + B (output) DOUBLE PRECISION array, dimension (LDB,N) + On exit, B = A in the locations specified by UPLO. - LDB (input) INTEGER - The leading dimension of the array B. LDB >= max(1,M). + LDB (input) INTEGER + The leading dimension of the array B. LDB >= max(1,M). - ===================================================================== + ===================================================================== Parameter adjustments */ /* System generated locals */ integer a_dim1, a_offset, b_dim1, b_offset, i__1, i__2; /* Local variables */ - static integer i__, j; + integer i__, j; extern logical lsame_(const char *,const char *); #define a_ref(a_1,a_2) a[(a_2)*a_dim1 + a_1] #define b_ref(a_1,a_2) b[(a_2)*b_dim1 + a_1] diff --git a/external/hypre/src/lapack/dlae2.c b/external/hypre/src/lapack/dlae2.c index 86f170f8..13a00759 100644 --- a/external/hypre/src/lapack/dlae2.c +++ b/external/hypre/src/lapack/dlae2.c @@ -8,64 +8,64 @@ extern "C" { #include "f2c.h" #include "hypre_lapack.h" -/* Subroutine */ integer dlae2_(doublereal *a, doublereal *b, doublereal *c__, +/* Subroutine */ integer dlae2_(doublereal *a, doublereal *b, doublereal *c__, doublereal *rt1, doublereal *rt2) { -/* -- LAPACK auxiliary routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - October 31, 1992 +/* -- LAPACK auxiliary routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + October 31, 1992 - Purpose - ======= + Purpose + ======= - DLAE2 computes the eigenvalues of a 2-by-2 symmetric matrix - [ A B ] - [ B C ]. - On return, RT1 is the eigenvalue of larger absolute value, and RT2 - is the eigenvalue of smaller absolute value. + DLAE2 computes the eigenvalues of a 2-by-2 symmetric matrix + [ A B ] + [ B C ]. + On return, RT1 is the eigenvalue of larger absolute value, and RT2 + is the eigenvalue of smaller absolute value. - Arguments - ========= + Arguments + ========= - A (input) DOUBLE PRECISION - The (1,1) element of the 2-by-2 matrix. + A (input) DOUBLE PRECISION + The (1,1) element of the 2-by-2 matrix. - B (input) DOUBLE PRECISION - The (1,2) and (2,1) elements of the 2-by-2 matrix. + B (input) DOUBLE PRECISION + The (1,2) and (2,1) elements of the 2-by-2 matrix. - C (input) DOUBLE PRECISION - The (2,2) element of the 2-by-2 matrix. + C (input) DOUBLE PRECISION + The (2,2) element of the 2-by-2 matrix. - RT1 (output) DOUBLE PRECISION - The eigenvalue of larger absolute value. + RT1 (output) DOUBLE PRECISION + The eigenvalue of larger absolute value. - RT2 (output) DOUBLE PRECISION - The eigenvalue of smaller absolute value. + RT2 (output) DOUBLE PRECISION + The eigenvalue of smaller absolute value. - Further Details - =============== + Further Details + =============== - RT1 is accurate to a few ulps barring over/underflow. + RT1 is accurate to a few ulps barring over/underflow. - RT2 may be inaccurate if there is massive cancellation in the - determinant A*C-B*B; higher precision or correctly rounded or - correctly truncated arithmetic would be needed to compute RT2 - accurately in all cases. + RT2 may be inaccurate if there is massive cancellation in the + determinant A*C-B*B; higher precision or correctly rounded or + correctly truncated arithmetic would be needed to compute RT2 + accurately in all cases. - Overflow is possible only if RT1 is within a factor of 5 of overflow. - Underflow is harmless if the input data is 0 or exceeds - underflow_threshold / macheps. + Overflow is possible only if RT1 is within a factor of 5 of overflow. + Underflow is harmless if the input data is 0 or exceeds + underflow_threshold / macheps. - ===================================================================== + ===================================================================== Compute the eigenvalues */ /* System generated locals */ doublereal d__1; /* Local variables */ - static doublereal acmn, acmx, ab, df, tb, sm, rt, adf; + doublereal acmn, acmx, ab, df, tb, sm, rt, adf; sm = *a + *c__; @@ -97,16 +97,16 @@ extern "C" { if (sm < 0.) { *rt1 = (sm - rt) * .5; -/* Order of execution important. - To get fully accurate smaller eigenvalue, +/* Order of execution important. + To get fully accurate smaller eigenvalue, next line needs to be executed in higher precision. */ *rt2 = acmx / *rt1 * acmn - *b / *rt1 * *b; } else if (sm > 0.) { *rt1 = (sm + rt) * .5; -/* Order of execution important. - To get fully accurate smaller eigenvalue, +/* Order of execution important. + To get fully accurate smaller eigenvalue, next line needs to be executed in higher precision. */ *rt2 = acmx / *rt1 * acmn - *b / *rt1 * *b; diff --git a/external/hypre/src/lapack/dlaev2.c b/external/hypre/src/lapack/dlaev2.c index 0102af81..5d4e133d 100644 --- a/external/hypre/src/lapack/dlaev2.c +++ b/external/hypre/src/lapack/dlaev2.c @@ -8,76 +8,76 @@ extern "C" { #include "f2c.h" #include "hypre_lapack.h" -/* Subroutine */ integer dlaev2_(doublereal *a, doublereal *b, doublereal *c__, +/* Subroutine */ integer dlaev2_(doublereal *a, doublereal *b, doublereal *c__, doublereal *rt1, doublereal *rt2, doublereal *cs1, doublereal *sn1) { -/* -- LAPACK auxiliary routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - October 31, 1992 +/* -- LAPACK auxiliary routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + October 31, 1992 - Purpose - ======= + Purpose + ======= - DLAEV2 computes the eigendecomposition of a 2-by-2 symmetric matrix - [ A B ] - [ B C ]. - On return, RT1 is the eigenvalue of larger absolute value, RT2 is the - eigenvalue of smaller absolute value, and (CS1,SN1) is the unit right - eigenvector for RT1, giving the decomposition + DLAEV2 computes the eigendecomposition of a 2-by-2 symmetric matrix + [ A B ] + [ B C ]. + On return, RT1 is the eigenvalue of larger absolute value, RT2 is the + eigenvalue of smaller absolute value, and (CS1,SN1) is the unit right + eigenvector for RT1, giving the decomposition - [ CS1 SN1 ] [ A B ] [ CS1 -SN1 ] = [ RT1 0 ] - [-SN1 CS1 ] [ B C ] [ SN1 CS1 ] [ 0 RT2 ]. + [ CS1 SN1 ] [ A B ] [ CS1 -SN1 ] = [ RT1 0 ] + [-SN1 CS1 ] [ B C ] [ SN1 CS1 ] [ 0 RT2 ]. - Arguments - ========= + Arguments + ========= - A (input) DOUBLE PRECISION - The (1,1) element of the 2-by-2 matrix. + A (input) DOUBLE PRECISION + The (1,1) element of the 2-by-2 matrix. - B (input) DOUBLE PRECISION - The (1,2) element and the conjugate of the (2,1) element of - the 2-by-2 matrix. + B (input) DOUBLE PRECISION + The (1,2) element and the conjugate of the (2,1) element of + the 2-by-2 matrix. - C (input) DOUBLE PRECISION - The (2,2) element of the 2-by-2 matrix. + C (input) DOUBLE PRECISION + The (2,2) element of the 2-by-2 matrix. - RT1 (output) DOUBLE PRECISION - The eigenvalue of larger absolute value. + RT1 (output) DOUBLE PRECISION + The eigenvalue of larger absolute value. - RT2 (output) DOUBLE PRECISION - The eigenvalue of smaller absolute value. + RT2 (output) DOUBLE PRECISION + The eigenvalue of smaller absolute value. - CS1 (output) DOUBLE PRECISION - SN1 (output) DOUBLE PRECISION - The vector (CS1, SN1) is a unit right eigenvector for RT1. + CS1 (output) DOUBLE PRECISION + SN1 (output) DOUBLE PRECISION + The vector (CS1, SN1) is a unit right eigenvector for RT1. - Further Details - =============== + Further Details + =============== - RT1 is accurate to a few ulps barring over/underflow. + RT1 is accurate to a few ulps barring over/underflow. - RT2 may be inaccurate if there is massive cancellation in the - determinant A*C-B*B; higher precision or correctly rounded or - correctly truncated arithmetic would be needed to compute RT2 - accurately in all cases. + RT2 may be inaccurate if there is massive cancellation in the + determinant A*C-B*B; higher precision or correctly rounded or + correctly truncated arithmetic would be needed to compute RT2 + accurately in all cases. - CS1 and SN1 are accurate to a few ulps barring over/underflow. + CS1 and SN1 are accurate to a few ulps barring over/underflow. - Overflow is possible only if RT1 is within a factor of 5 of overflow. - Underflow is harmless if the input data is 0 or exceeds - underflow_threshold / macheps. + Overflow is possible only if RT1 is within a factor of 5 of overflow. + Underflow is harmless if the input data is 0 or exceeds + underflow_threshold / macheps. - ===================================================================== + ===================================================================== Compute the eigenvalues */ /* System generated locals */ doublereal d__1; /* Local variables */ - static doublereal acmn, acmx, ab, df, cs, ct, tb, sm, tn, rt, adf, acs; - static integer sgn1, sgn2; + doublereal acmn, acmx, ab, df, cs, ct, tb, sm, tn, rt, adf, acs; + integer sgn1, sgn2; sm = *a + *c__; @@ -110,8 +110,8 @@ extern "C" { *rt1 = (sm - rt) * .5; sgn1 = -1; -/* Order of execution important. - To get fully accurate smaller eigenvalue, +/* Order of execution important. + To get fully accurate smaller eigenvalue, next line needs to be executed in higher precision. */ *rt2 = acmx / *rt1 * acmn - *b / *rt1 * *b; @@ -119,8 +119,8 @@ extern "C" { *rt1 = (sm + rt) * .5; sgn1 = 1; -/* Order of execution important. - To get fully accurate smaller eigenvalue, +/* Order of execution important. + To get fully accurate smaller eigenvalue, next line needs to be executed in higher precision. */ *rt2 = acmx / *rt1 * acmn - *b / *rt1 * *b; diff --git a/external/hypre/src/lapack/dlamch.c b/external/hypre/src/lapack/dlamch.c index f4715206..2bc9eb82 100644 --- a/external/hypre/src/lapack/dlamch.c +++ b/external/hypre/src/lapack/dlamch.c @@ -10,69 +10,69 @@ extern "C" { doublereal dlamch_(const char *cmach) { -/* -- LAPACK auxiliary routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - October 31, 1992 - - - Purpose - ======= - - DLAMCH determines doublereal precision machine parameters. - - Arguments - ========= - - CMACH (input) CHARACTER*1 - Specifies the value to be returned by DLAMCH: - = 'E' or 'e', DLAMCH := eps - = 'S' or 's , DLAMCH := sfmin - = 'B' or 'b', DLAMCH := base - = 'P' or 'p', DLAMCH := eps*base - = 'N' or 'n', DLAMCH := t - = 'R' or 'r', DLAMCH := rnd - = 'M' or 'm', DLAMCH := emin - = 'U' or 'u', DLAMCH := rmin - = 'L' or 'l', DLAMCH := emax - = 'O' or 'o', DLAMCH := rmax - - where - - eps = relative machine precision - sfmin = safe minimum, such that 1/sfmin does not overflow - base = base of the machine - prec = eps*base - t = number of (base) digits in the mantissa - rnd = 1.0 when rounding occurs in addition, 0.0 otherwise - emin = minimum exponent before (gradual) underflow - rmin = underflow threshold - base**(emin-1) - emax = largest exponent before overflow - rmax = overflow threshold - (base**emax)*(1-eps) - - ===================================================================== +/* -- LAPACK auxiliary routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + October 31, 1992 + + + Purpose + ======= + + DLAMCH determines doublereal precision machine parameters. + + Arguments + ========= + + CMACH (input) CHARACTER*1 + Specifies the value to be returned by DLAMCH: + = 'E' or 'e', DLAMCH := eps + = 'S' or 's , DLAMCH := sfmin + = 'B' or 'b', DLAMCH := base + = 'P' or 'p', DLAMCH := eps*base + = 'N' or 'n', DLAMCH := t + = 'R' or 'r', DLAMCH := rnd + = 'M' or 'm', DLAMCH := emin + = 'U' or 'u', DLAMCH := rmin + = 'L' or 'l', DLAMCH := emax + = 'O' or 'o', DLAMCH := rmax + + where + + eps = relative machine precision + sfmin = safe minimum, such that 1/sfmin does not overflow + base = base of the machine + prec = eps*base + t = number of (base) digits in the mantissa + rnd = 1.0 when rounding occurs in addition, 0.0 otherwise + emin = minimum exponent before (gradual) underflow + rmin = underflow threshold - base**(emin-1) + emax = largest exponent before overflow + rmax = overflow threshold - (base**emax)*(1-eps) + + ===================================================================== */ -/* >>Start of File<< +/* >>Start of File<< Initialized data */ - static logical first = TRUE_; + logical first = TRUE_; /* System generated locals */ integer i__1; doublereal ret_val; /* Builtin functions */ doublereal pow_di(doublereal *, integer *); /* Local variables */ - static doublereal base; - static integer beta; - static doublereal emin, prec, emax; - static integer imin, imax; - static logical lrnd; - static doublereal rmin, rmax, t, rmach; + doublereal base; + integer beta; + doublereal emin, prec, emax; + integer imin, imax; + logical lrnd; + doublereal rmin, rmax, t, rmach = 0.; extern logical lsame_(const char *,const char *); - static doublereal small, sfmin; - extern /* Subroutine */ integer dlamc2_(integer *, integer *, logical *, + doublereal small, sfmin; + extern /* Subroutine */ integer dlamc2_(integer *, integer *, logical *, doublereal *, integer *, doublereal *, integer *, doublereal *); - static integer it; - static doublereal rnd, eps; + integer it; + doublereal rnd, eps; @@ -98,7 +98,7 @@ doublereal dlamch_(const char *cmach) if (small >= sfmin) { /* Use SMALL plus a bit, to avoid the possibility of rou -nding +nding causing overflow when computing 1/sfmin. */ sfmin = small * (eps + 1.); @@ -134,71 +134,71 @@ nding } /* dlamch_ */ -/* Subroutine */ integer dlamc1_(integer *beta, integer *t, logical *rnd, logical +/* Subroutine */ integer dlamc1_(integer *beta, integer *t, logical *rnd, logical *ieee1) { -/* -- LAPACK auxiliary routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - October 31, 1992 +/* -- LAPACK auxiliary routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + October 31, 1992 - Purpose - ======= + Purpose + ======= - DLAMC1 determines the machine parameters given by BETA, T, RND, and - IEEE1. + DLAMC1 determines the machine parameters given by BETA, T, RND, and + IEEE1. - Arguments - ========= + Arguments + ========= - BETA (output) INTEGER - The base of the machine. + BETA (output) INTEGER + The base of the machine. - T (output) INTEGER - The number of ( BETA ) digits in the mantissa. + T (output) INTEGER + The number of ( BETA ) digits in the mantissa. - RND (output) LOGICAL - Specifies whether proper rounding ( RND = .TRUE. ) or - chopping ( RND = .FALSE. ) occurs in addition. This may not - - be a reliable guide to the way in which the machine performs - - its arithmetic. + RND (output) LOGICAL + Specifies whether proper rounding ( RND = .TRUE. ) or + chopping ( RND = .FALSE. ) occurs in addition. This may not - IEEE1 (output) LOGICAL - Specifies whether rounding appears to be done in the IEEE - 'round to nearest' style. + be a reliable guide to the way in which the machine performs - Further Details - =============== + its arithmetic. - The routine is based on the routine ENVRON by Malcolm and - incorporates suggestions by Gentleman and Marovich. See + IEEE1 (output) LOGICAL + Specifies whether rounding appears to be done in the IEEE + 'round to nearest' style. - Malcolm M. A. (1972) Algorithms to reveal properties of - floating-point arithmetic. Comms. of the ACM, 15, 949-951. + Further Details + =============== - Gentleman W. M. and Marovich S. B. (1974) More on algorithms - that reveal properties of floating point arithmetic units. - Comms. of the ACM, 17, 276-277. + The routine is based on the routine ENVRON by Malcolm and + incorporates suggestions by Gentleman and Marovich. See - ===================================================================== + Malcolm M. A. (1972) Algorithms to reveal properties of + floating-point arithmetic. Comms. of the ACM, 15, 949-951. + + Gentleman W. M. and Marovich S. B. (1974) More on algorithms + that reveal properties of floating point arithmetic units. + Comms. of the ACM, 17, 276-277. + + ===================================================================== */ /* Initialized data */ - static logical first = TRUE_; + logical first = TRUE_; /* System generated locals */ doublereal d__1, d__2; /* Local variables */ - static logical lrnd; - static doublereal a, b, c, f; - static integer lbeta; - static doublereal savec; + logical lrnd = FALSE_; + doublereal a, b, c, f; + integer lbeta = 0; + doublereal savec; extern doublereal dlamc3_(doublereal *, doublereal *); - static logical lieee1; - static doublereal t1, t2; - static integer lt; - static doublereal one, qtr; + logical lieee1 = FALSE_; + doublereal t1, t2; + integer lt = 0; + doublereal one, qtr; @@ -207,18 +207,18 @@ nding one = 1.; /* LBETA, LIEEE1, LT and LRND are the local values of BE -TA, - IEEE1, T and RND. +TA, + IEEE1, T and RND. Throughout this routine we use the function DLAMC3 to ens -ure - that relevant values are stored and not held in registers, - or - are not affected by optimizers. +ure + that relevant values are stored and not held in registers, + or + are not affected by optimizers. Compute a = 2.0**m with the smallest positive integer m s -uch - that +uch + that fl( a + 1.0 ) = a. */ @@ -234,11 +234,11 @@ uch c = dlamc3_(&c, &d__1); goto L10; } -/* + END WHILE +/* + END WHILE - Now compute b = 2.0**m with the smallest positive integer -m - such that + Now compute b = 2.0**m with the smallest positive integer +m + such that fl( a + b ) .gt. a. */ @@ -252,14 +252,14 @@ m c = dlamc3_(&a, &b); goto L20; } -/* + END WHILE +/* + END WHILE Now compute the base. a and c are neighbouring floating po -integer +integer numbers in the interval ( beta**t, beta**( t + 1 ) ) and - so + so their difference is beta. Adding 0.25 to c is to ensure that - it + it is truncated to beta and not ( beta - 1 ). */ qtr = one / 4; @@ -269,8 +269,8 @@ integer lbeta = (integer) (c + qtr); /* Now determine whether rounding or chopping occurs, by addin -g a - bit less than beta/2 and a bit more than beta/2 to +g a + bit less than beta/2 and a bit more than beta/2 to a. */ b = (doublereal) lbeta; @@ -292,13 +292,13 @@ g a } /* Try and decide whether rounding is done in the IEEE 'round - to - nearest' style. B/2 is half a unit in the last place of the -two - numbers A and SAVEC. Furthermore, A is even, i.e. has last -bit + to + nearest' style. B/2 is half a unit in the last place of the +two + numbers A and SAVEC. Furthermore, A is even, i.e. has last +bit zero, and SAVEC is odd. Thus adding B/2 to A should not cha -nge +nge A, but adding B/2 to SAVEC should change SAVEC. */ d__1 = b / 2; @@ -308,12 +308,12 @@ nge lieee1 = t1 == a && t2 > savec && lrnd; /* Now find the mantissa, t. It should be the integer part - of + of log to the base beta of a, however it is safer to determine - t - by powering. So we find t as the smallest positive integer -for - which + t + by powering. So we find t as the smallest positive integer +for + which fl( beta**t + 1.0 ) = 1.0. */ @@ -345,103 +345,103 @@ for } /* dlamc1_ */ -/* Subroutine */ integer dlamc2_(integer *beta, integer *t, logical *rnd, - doublereal *eps, integer *emin, doublereal *rmin, integer *emax, +/* Subroutine */ integer dlamc2_(integer *beta, integer *t, logical *rnd, + doublereal *eps, integer *emin, doublereal *rmin, integer *emax, doublereal *rmax) { -/* -- LAPACK auxiliary routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - October 31, 1992 +/* -- LAPACK auxiliary routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + October 31, 1992 + + + Purpose + ======= + + DLAMC2 determines the machine parameters specified in its argument + list. + Arguments + ========= - Purpose - ======= + BETA (output) INTEGER + The base of the machine. - DLAMC2 determines the machine parameters specified in its argument - list. + T (output) INTEGER + The number of ( BETA ) digits in the mantissa. - Arguments - ========= + RND (output) LOGICAL + Specifies whether proper rounding ( RND = .TRUE. ) or + chopping ( RND = .FALSE. ) occurs in addition. This may not - BETA (output) INTEGER - The base of the machine. + be a reliable guide to the way in which the machine performs - T (output) INTEGER - The number of ( BETA ) digits in the mantissa. + its arithmetic. - RND (output) LOGICAL - Specifies whether proper rounding ( RND = .TRUE. ) or - chopping ( RND = .FALSE. ) occurs in addition. This may not - - be a reliable guide to the way in which the machine performs - - its arithmetic. + EPS (output) DOUBLE PRECISION + The smallest positive number such that - EPS (output) DOUBLE PRECISION - The smallest positive number such that + fl( 1.0 - EPS ) .LT. 1.0, - fl( 1.0 - EPS ) .LT. 1.0, + where fl denotes the computed value. - where fl denotes the computed value. + EMIN (output) INTEGER + The minimum exponent before (gradual) underflow occurs. - EMIN (output) INTEGER - The minimum exponent before (gradual) underflow occurs. + RMIN (output) DOUBLE PRECISION + The smallest normalized number for the machine, given by + BASE**( EMIN - 1 ), where BASE is the floating point value - RMIN (output) DOUBLE PRECISION - The smallest normalized number for the machine, given by - BASE**( EMIN - 1 ), where BASE is the floating point value - - of BETA. + of BETA. - EMAX (output) INTEGER - The maximum exponent before overflow occurs. + EMAX (output) INTEGER + The maximum exponent before overflow occurs. - RMAX (output) DOUBLE PRECISION - The largest positive number for the machine, given by - BASE**EMAX * ( 1 - EPS ), where BASE is the floating point - - value of BETA. + RMAX (output) DOUBLE PRECISION + The largest positive number for the machine, given by + BASE**EMAX * ( 1 - EPS ), where BASE is the floating point - Further Details - =============== + value of BETA. - The computation of EPS is based on a routine PARANOIA by - W. Kahan of the University of California at Berkeley. + Further Details + =============== - ===================================================================== + The computation of EPS is based on a routine PARANOIA by + W. Kahan of the University of California at Berkeley. + + ===================================================================== */ /* Table of constant values */ -/***static integer c__1 = 1;***/ - +/*** integer c__1 = 1;***/ + /* Initialized data */ - static logical first = TRUE_; - static logical iwarn = FALSE_; + logical first = TRUE_; + logical iwarn = FALSE_; /* System generated locals */ integer i__1; doublereal d__1, d__2, d__3, d__4, d__5; /* Builtin functions */ doublereal pow_di(doublereal *, integer *); /* Local variables */ - static logical ieee; - static doublereal half; - static logical lrnd; - static doublereal leps, zero, a, b, c; - static integer i, lbeta; - static doublereal rbase; - static integer lemin, lemax, gnmin; - static doublereal small; - static integer gpmin; - static doublereal third, lrmin, lrmax, sixth; - extern /* Subroutine */ integer dlamc1_(integer *, integer *, logical *, + logical ieee; + doublereal half; + logical lrnd= FALSE_; + doublereal leps = 0., zero, a, b, c; + integer i, lbeta = 0; + doublereal rbase; + integer lemin = 0, lemax = 0, gnmin; + doublereal small; + integer gpmin; + doublereal third, lrmin = 0., lrmax = 0., sixth; + extern /* Subroutine */ integer dlamc1_(integer *, integer *, logical *, logical *); extern doublereal dlamc3_(doublereal *, doublereal *); - static logical lieee1; - extern /* Subroutine */ integer dlamc4_(integer *, doublereal *, integer *), - dlamc5_(integer *, integer *, integer *, logical *, integer *, + logical lieee1; + extern /* Subroutine */ integer dlamc4_(integer *, doublereal *, integer *), + dlamc5_(integer *, integer *, integer *, logical *, integer *, doublereal *); - static integer lt, ngnmin, ngpmin; - static doublereal one, two; + integer lt = 0, ngnmin, ngpmin; + doublereal one, two; @@ -452,16 +452,16 @@ for two = 2.; /* LBETA, LT, LRND, LEPS, LEMIN and LRMIN are the local values - of - BETA, T, RND, EPS, EMIN and RMIN. + of + BETA, T, RND, EPS, EMIN and RMIN. Throughout this routine we use the function DLAMC3 to ens -ure - that relevant values are stored and not held in registers, - or - are not affected by optimizers. +ure + that relevant values are stored and not held in registers, + or + are not affected by optimizers. - DLAMC1 returns the parameters LBETA, LT, LRND and LIEEE1. + DLAMC1 returns the parameters LBETA, LT, LRND and LIEEE1. */ dlamc1_(&lbeta, <, &lrnd, &lieee1); @@ -516,12 +516,12 @@ PS. */ leps = a; } -/* Computation of EPS complete. +/* Computation of EPS complete. Now find EMIN. Let A = + or - 1, and + or - (1 + BASE**(-3 -)). +)). Keep dividing A by BETA until (gradual) underflow occurs. T -his +his is detected when we cannot recover the previous A. */ rbase = one / lbeta; @@ -544,13 +544,13 @@ his if (ngpmin == gpmin) { lemin = ngpmin; /* ( Non twos-complement machines, no gradual under -flow; +flow; e.g., VAX ) */ } else if (gpmin - ngpmin == 3) { lemin = ngpmin - 1 + lt; ieee = TRUE_; /* ( Non twos-complement machines, with gradual und -erflow; +erflow; e.g., IEEE standard followers ) */ } else { lemin = min(ngpmin,gpmin); @@ -562,7 +562,7 @@ erflow; if ((i__1 = ngpmin - ngnmin, abs(i__1)) == 1) { lemin = max(ngpmin,ngnmin); /* ( Twos-complement machines, no gradual underflow -; +; e.g., CYBER 205 ) */ } else { lemin = min(ngpmin,ngnmin); @@ -575,7 +575,7 @@ erflow; if (gpmin - min(ngpmin,ngnmin) == 3) { lemin = max(ngpmin,ngnmin) - 1 + lt; /* ( Twos-complement machines with gradual underflo -w; +w; no known machine ) */ } else { lemin = min(ngpmin,ngnmin); @@ -590,33 +590,33 @@ w; /* ( A guess; no known machine ) */ iwarn = TRUE_; } -/* ** +/* ** Comment out this if block if EMIN is ok */ if (iwarn) { first = TRUE_; hypre_printf("\n\n WARNING. The value EMIN may be incorrect:- "); hypre_printf("EMIN = %8i\n",(integer)lemin); hypre_printf("If, after inspection, the value EMIN looks acceptable"); - hypre_printf("please comment out \n the IF block as marked within the"); - hypre_printf("code of routine DLAMC2, \n otherwise supply EMIN"); + hypre_printf("please comment out \n the IF block as marked within the"); + hypre_printf("code of routine DLAMC2, \n otherwise supply EMIN"); hypre_printf("explicitly.\n"); } -/* ** +/* ** Assume IEEE arithmetic if we found denormalised numbers abo -ve, +ve, or if arithmetic seems to round in the IEEE style, determi -ned +ned in routine DLAMC1. A true IEEE machine should have both thi -ngs +ngs true; however, faulty machines may have one or the other. */ ieee = ieee || lieee1; /* Compute RMIN by successive division by BETA. We could comp -ute +ute RMIN as BASE**( EMIN - 1 ), but some machines underflow dur -ing +ing this computation. */ lrmin = 1.; @@ -650,30 +650,30 @@ ing doublereal dlamc3_(doublereal *a, doublereal *b) { -/* -- LAPACK auxiliary routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - October 31, 1992 +/* -- LAPACK auxiliary routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + October 31, 1992 + + + Purpose + ======= + DLAMC3 is intended to force A and B to be stored prior to doing - Purpose - ======= + the addition of A and B , for use in situations where optimizers - DLAMC3 is intended to force A and B to be stored prior to doing - - the addition of A and B , for use in situations where optimizers - - might hold one of these in a register. + might hold one of these in a register. - Arguments - ========= + Arguments + ========= - A, B (input) DOUBLE PRECISION - The values A and B. + A, B (input) DOUBLE PRECISION + The values A and B. - ===================================================================== + ===================================================================== */ -/* >>Start of File<< +/* >>Start of File<< System generated locals */ doublereal ret_val; @@ -689,43 +689,43 @@ doublereal dlamc3_(doublereal *a, doublereal *b) /* Subroutine */ integer dlamc4_(integer *emin, doublereal *start, integer *base) { -/* -- LAPACK auxiliary routine (version 2.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - October 31, 1992 +/* -- LAPACK auxiliary routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + October 31, 1992 - Purpose - ======= + Purpose + ======= - DLAMC4 is a service routine for DLAMC2. + DLAMC4 is a service routine for DLAMC2. - Arguments - ========= + Arguments + ========= - EMIN (output) EMIN - The minimum exponent before (gradual) underflow, computed by - - setting A = START and dividing by BASE until the previous A - can not be recovered. + EMIN (output) EMIN + The minimum exponent before (gradual) underflow, computed by - START (input) DOUBLE PRECISION - The starting point for determining EMIN. + setting A = START and dividing by BASE until the previous A + can not be recovered. - BASE (input) INTEGER - The base of the machine. + START (input) DOUBLE PRECISION + The starting point for determining EMIN. - ===================================================================== + BASE (input) INTEGER + The base of the machine. + + ===================================================================== */ /* System generated locals */ /***integer i__1;***/ doublereal d__1; /* Local variables */ - static doublereal zero, a; - static integer i; - static doublereal rbase, b1, b2, c1, c2, d1, d2; + doublereal zero, a; + integer i; + doublereal rbase, b1, b2, c1, c2, d1, d2; extern doublereal dlamc3_(doublereal *, doublereal *); - static doublereal one; + doublereal one; @@ -740,7 +740,7 @@ doublereal dlamc3_(doublereal *a, doublereal *b) c2 = a; d1 = a; d2 = a; -/* + WHILE( ( C1.EQ.A ).AND.( C2.EQ.A ).AND. +/* + WHILE( ( C1.EQ.A ).AND.( C2.EQ.A ).AND. $ ( D1.EQ.A ).AND.( D2.EQ.A ) )LOOP */ L10: if (c1 == a && c2 == a && d1 == a && d2 == a) { @@ -776,72 +776,73 @@ doublereal dlamc3_(doublereal *a, doublereal *b) } /* dlamc4_ */ -/* Subroutine */ integer dlamc5_(integer *beta, integer *p, integer *emin, +/* Subroutine */ integer dlamc5_(integer *beta, integer *p, integer *emin, logical *ieee, integer *emax, doublereal *rmax) { -/* -- LAPACK auxiliary routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - October 31, 1992 +/* -- LAPACK auxiliary routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + October 31, 1992 + + + Purpose + ======= + DLAMC5 attempts to compute RMAX, the largest machine floating-point + number, without overflow. It assumes that EMAX + abs(EMIN) sum + approximately to a power of 2. It will fail on machines where this + assumption does not hold, for example, the Cyber 205 (EMIN = -28625, - Purpose - ======= + EMAX = 28718). It will also fail if the value supplied for EMIN is + too large (i.e. too close to zero), probably with overflow. - DLAMC5 attempts to compute RMAX, the largest machine floating-point - number, without overflow. It assumes that EMAX + abs(EMIN) sum - approximately to a power of 2. It will fail on machines where this - assumption does not hold, for example, the Cyber 205 (EMIN = -28625, - - EMAX = 28718). It will also fail if the value supplied for EMIN is - too large (i.e. too close to zero), probably with overflow. + Arguments + ========= - Arguments - ========= + BETA (input) INTEGER + The base of floating-point arithmetic. - BETA (input) INTEGER - The base of floating-point arithmetic. + P (input) INTEGER + The number of base BETA digits in the mantissa of a + floating-point value. - P (input) INTEGER - The number of base BETA digits in the mantissa of a - floating-point value. + EMIN (input) INTEGER + The minimum exponent before (gradual) underflow. - EMIN (input) INTEGER - The minimum exponent before (gradual) underflow. + IEEE (input) LOGICAL + A logical flag specifying whether or not the arithmetic + system is thought to comply with the IEEE standard. - IEEE (input) LOGICAL - A logical flag specifying whether or not the arithmetic - system is thought to comply with the IEEE standard. + EMAX (output) INTEGER + The largest exponent before overflow - EMAX (output) INTEGER - The largest exponent before overflow + RMAX (output) DOUBLE PRECISION + The largest machine floating-point number. - RMAX (output) DOUBLE PRECISION - The largest machine floating-point number. + ===================================================================== - ===================================================================== - - First compute LEXP and UEXP, two powers of 2 that bound - abs(EMIN). We then assume that EMAX + abs(EMIN) will sum - approximately to the bound that is closest to abs(EMIN). + First compute LEXP and UEXP, two powers of 2 that bound + abs(EMIN). We then assume that EMAX + abs(EMIN) will sum + approximately to the bound that is closest to abs(EMIN). (EMAX is the exponent of the required number RMAX). */ /* Table of constant values */ - static doublereal c_b5 = 0.; - + doublereal c_b5 = 0.; + /* System generated locals */ /***integer i__1;***/ doublereal d__1; /* Local variables */ - static integer lexp; - static doublereal oldy; - static integer uexp, i; - static doublereal y, z; - static integer nbits; + integer lexp; + doublereal oldy = 0.; + integer uexp, i; + doublereal z; + integer nbits; extern doublereal dlamc3_(doublereal *, doublereal *); - static doublereal recbas; - static integer exbits, expsum, try__; + doublereal recbas; + integer exbits, expsum, try__; + doublereal y; @@ -861,8 +862,8 @@ doublereal dlamc3_(doublereal *a, doublereal *b) ++exbits; } -/* Now -LEXP is less than or equal to EMIN, and -UEXP is greater - than or equal to EMIN. EXBITS is the number of bits needed to +/* Now -LEXP is less than or equal to EMIN, and -UEXP is greater + than or equal to EMIN. EXBITS is the number of bits needed to store the exponent. */ if (uexp + *emin > -lexp - *emin) { @@ -871,32 +872,32 @@ doublereal dlamc3_(doublereal *a, doublereal *b) expsum = uexp << 1; } -/* EXPSUM is the exponent range, approximately equal to +/* EXPSUM is the exponent range, approximately equal to EMAX - EMIN + 1 . */ *emax = expsum + *emin - 1; nbits = exbits + 1 + *p; -/* NBITS is the total number of bits needed to store a +/* NBITS is the total number of bits needed to store a floating-point number. */ if (nbits % 2 == 1 && *beta == 2) { -/* Either there are an odd number of bits used to store a - floating-point number, which is unlikely, or some bits are - +/* Either there are an odd number of bits used to store a + floating-point number, which is unlikely, or some bits are + not used in the representation of numbers, which is possible -, - (e.g. Cray machines) or the mantissa has an implicit bit, +, + (e.g. Cray machines) or the mantissa has an implicit bit, (e.g. IEEE machines, Dec Vax machines), which is perhaps the - - most likely. We have to assume the last alternative. - If this is true, then we need to reduce EMAX by one because - + + most likely. We have to assume the last alternative. + If this is true, then we need to reduce EMAX by one because + there must be some way of representing zero in an implicit-b -it - system. On machines like Cray, we are reducing EMAX by one - +it + system. On machines like Cray, we are reducing EMAX by one + unnecessarily. */ --(*emax); @@ -905,16 +906,16 @@ it if (*ieee) { /* Assume we are on an IEEE machine which reserves one exponent - + for infinity and NaN. */ --(*emax); } -/* Now create RMAX, the largest machine number, which should - be equal to (1.0 - BETA**(-P)) * BETA**EMAX . +/* Now create RMAX, the largest machine number, which should + be equal to (1.0 - BETA**(-P)) * BETA**EMAX . - First compute 1.0 - BETA**(-P), being careful that the + First compute 1.0 - BETA**(-P), being careful that the result is less than 1.0 . */ recbas = 1. / *beta; @@ -937,7 +938,7 @@ it /***i__1 = *emax;***/ for (i = 1; i <= *emax; ++i) { - d__1 = y * *beta; + d__1 = y * ((doublereal) *beta); y = dlamc3_(&d__1, &c_b5); /* L30: */ } diff --git a/external/hypre/src/lapack/dlange.c b/external/hypre/src/lapack/dlange.c index 64d4598e..267085e0 100644 --- a/external/hypre/src/lapack/dlange.c +++ b/external/hypre/src/lapack/dlange.c @@ -8,85 +8,85 @@ extern "C" { #include "f2c.h" #include "hypre_lapack.h" -doublereal dlange_(const char *norm, integer *m, integer *n, doublereal *a, integer +doublereal dlange_(const char *norm, integer *m, integer *n, doublereal *a, integer *lda, doublereal *work) { -/* -- LAPACK auxiliary routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - October 31, 1992 +/* -- LAPACK auxiliary routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + October 31, 1992 - Purpose - ======= + Purpose + ======= - DLANGE returns the value of the one norm, or the Frobenius norm, or - the infinity norm, or the element of largest absolute value of a - real matrix A. + DLANGE returns the value of the one norm, or the Frobenius norm, or + the infinity norm, or the element of largest absolute value of a + real matrix A. - Description - =========== + Description + =========== - DLANGE returns the value + DLANGE returns the value - DLANGE = ( max(abs(A(i,j))), NORM = 'M' or 'm' - ( - ( norm1(A), NORM = '1', 'O' or 'o' - ( - ( normI(A), NORM = 'I' or 'i' - ( - ( normF(A), NORM = 'F', 'f', 'E' or 'e' + DLANGE = ( max(abs(A(i,j))), NORM = 'M' or 'm' + ( + ( norm1(A), NORM = '1', 'O' or 'o' + ( + ( normI(A), NORM = 'I' or 'i' + ( + ( normF(A), NORM = 'F', 'f', 'E' or 'e' - where norm1 denotes the one norm of a matrix (maximum column sum), - normI denotes the infinity norm of a matrix (maximum row sum) and - normF denotes the Frobenius norm of a matrix (square root of sum of - squares). Note that max(abs(A(i,j))) is not a matrix norm. + where norm1 denotes the one norm of a matrix (maximum column sum), + normI denotes the infinity norm of a matrix (maximum row sum) and + normF denotes the Frobenius norm of a matrix (square root of sum of + squares). Note that max(abs(A(i,j))) is not a matrix norm. - Arguments - ========= + Arguments + ========= - NORM (input) CHARACTER*1 - Specifies the value to be returned in DLANGE as described - above. + NORM (input) CHARACTER*1 + Specifies the value to be returned in DLANGE as described + above. - M (input) INTEGER - The number of rows of the matrix A. M >= 0. When M = 0, - DLANGE is set to zero. + M (input) INTEGER + The number of rows of the matrix A. M >= 0. When M = 0, + DLANGE is set to zero. - N (input) INTEGER - The number of columns of the matrix A. N >= 0. When N = 0, - DLANGE is set to zero. + N (input) INTEGER + The number of columns of the matrix A. N >= 0. When N = 0, + DLANGE is set to zero. - A (input) DOUBLE PRECISION array, dimension (LDA,N) - The m by n matrix A. + A (input) DOUBLE PRECISION array, dimension (LDA,N) + The m by n matrix A. - LDA (input) INTEGER - The leading dimension of the array A. LDA >= max(M,1). + LDA (input) INTEGER + The leading dimension of the array A. LDA >= max(M,1). - WORK (workspace) DOUBLE PRECISION array, dimension (LWORK), - where LWORK >= M when NORM = 'I'; otherwise, WORK is not - referenced. + WORK (workspace) DOUBLE PRECISION array, dimension (LWORK), + where LWORK >= M when NORM = 'I'; otherwise, WORK is not + referenced. - ===================================================================== + ===================================================================== Parameter adjustments */ /* Table of constant values */ - static integer c__1 = 1; - + integer c__1 = 1; + /* System generated locals */ integer a_dim1, a_offset, i__1, i__2; doublereal ret_val, d__1, d__2, d__3; /* Builtin functions */ /*doublereal sqrt(doublereal);*/ /* Local variables */ - static integer i__, j; - static doublereal scale; + integer i__, j; + doublereal scale; extern logical lsame_(const char *,const char *); - static doublereal value; - extern /* Subroutine */ integer dlassq_(integer *, doublereal *, integer *, + doublereal value; + extern /* Subroutine */ integer dlassq_(integer *, doublereal *, integer *, doublereal *, doublereal *); - static doublereal sum; + doublereal sum; #define a_ref(a_1,a_2) a[(a_2)*a_dim1 + a_1] @@ -94,6 +94,7 @@ doublereal dlange_(const char *norm, integer *m, integer *n, doublereal *a, inte a_offset = 1 + a_dim1 * 1; a -= a_offset; --work; + value = 0.; /* Function Body */ if (min(*m,*n) == 0) { diff --git a/external/hypre/src/lapack/dlanst.c b/external/hypre/src/lapack/dlanst.c index 0a49c7f4..b5c55b52 100644 --- a/external/hypre/src/lapack/dlanst.c +++ b/external/hypre/src/lapack/dlanst.c @@ -10,76 +10,77 @@ extern "C" { doublereal dlanst_(const char *norm, integer *n, doublereal *d__, doublereal *e) { -/* -- LAPACK auxiliary routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - February 29, 1992 +/* -- LAPACK auxiliary routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + February 29, 1992 - Purpose - ======= + Purpose + ======= - DLANST returns the value of the one norm, or the Frobenius norm, or - the infinity norm, or the element of largest absolute value of a - real symmetric tridiagonal matrix A. + DLANST returns the value of the one norm, or the Frobenius norm, or + the infinity norm, or the element of largest absolute value of a + real symmetric tridiagonal matrix A. - Description - =========== + Description + =========== - DLANST returns the value + DLANST returns the value - DLANST = ( max(abs(A(i,j))), NORM = 'M' or 'm' - ( - ( norm1(A), NORM = '1', 'O' or 'o' - ( - ( normI(A), NORM = 'I' or 'i' - ( - ( normF(A), NORM = 'F', 'f', 'E' or 'e' + DLANST = ( max(abs(A(i,j))), NORM = 'M' or 'm' + ( + ( norm1(A), NORM = '1', 'O' or 'o' + ( + ( normI(A), NORM = 'I' or 'i' + ( + ( normF(A), NORM = 'F', 'f', 'E' or 'e' - where norm1 denotes the one norm of a matrix (maximum column sum), - normI denotes the infinity norm of a matrix (maximum row sum) and - normF denotes the Frobenius norm of a matrix (square root of sum of - squares). Note that max(abs(A(i,j))) is not a matrix norm. + where norm1 denotes the one norm of a matrix (maximum column sum), + normI denotes the infinity norm of a matrix (maximum row sum) and + normF denotes the Frobenius norm of a matrix (square root of sum of + squares). Note that max(abs(A(i,j))) is not a matrix norm. - Arguments - ========= + Arguments + ========= - NORM (input) CHARACTER*1 - Specifies the value to be returned in DLANST as described - above. + NORM (input) CHARACTER*1 + Specifies the value to be returned in DLANST as described + above. - N (input) INTEGER - The order of the matrix A. N >= 0. When N = 0, DLANST is - set to zero. + N (input) INTEGER + The order of the matrix A. N >= 0. When N = 0, DLANST is + set to zero. - D (input) DOUBLE PRECISION array, dimension (N) - The diagonal elements of A. + D (input) DOUBLE PRECISION array, dimension (N) + The diagonal elements of A. - E (input) DOUBLE PRECISION array, dimension (N-1) - The (n-1) sub-diagonal or super-diagonal elements of A. + E (input) DOUBLE PRECISION array, dimension (N-1) + The (n-1) sub-diagonal or super-diagonal elements of A. - ===================================================================== + ===================================================================== Parameter adjustments */ /* Table of constant values */ - static integer c__1 = 1; - + integer c__1 = 1; + /* System generated locals */ integer i__1; doublereal ret_val, d__1, d__2, d__3, d__4, d__5; /* Local variables */ - static integer i__; - static doublereal scale; + integer i__; + doublereal scale; extern logical lsame_(const char *,const char *); - static doublereal anorm; - extern /* Subroutine */ integer dlassq_(integer *, doublereal *, integer *, + doublereal anorm; + extern /* Subroutine */ integer dlassq_(integer *, doublereal *, integer *, doublereal *, doublereal *); - static doublereal sum; + doublereal sum; --e; --d__; + anorm = 0.; /* Function Body */ if (*n <= 0) { diff --git a/external/hypre/src/lapack/dlansy.c b/external/hypre/src/lapack/dlansy.c index 77ccf479..d482aded 100644 --- a/external/hypre/src/lapack/dlansy.c +++ b/external/hypre/src/lapack/dlansy.c @@ -8,94 +8,94 @@ extern "C" { #include "f2c.h" #include "hypre_lapack.h" -doublereal dlansy_(const char *norm,const char *uplo, integer *n, doublereal *a, integer +doublereal dlansy_(const char *norm,const char *uplo, integer *n, doublereal *a, integer *lda, doublereal *work) { -/* -- LAPACK auxiliary routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - October 31, 1992 +/* -- LAPACK auxiliary routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + October 31, 1992 - Purpose - ======= + Purpose + ======= - DLANSY returns the value of the one norm, or the Frobenius norm, or - the infinity norm, or the element of largest absolute value of a - real symmetric matrix A. + DLANSY returns the value of the one norm, or the Frobenius norm, or + the infinity norm, or the element of largest absolute value of a + real symmetric matrix A. - Description - =========== + Description + =========== - DLANSY returns the value + DLANSY returns the value - DLANSY = ( max(abs(A(i,j))), NORM = 'M' or 'm' - ( - ( norm1(A), NORM = '1', 'O' or 'o' - ( - ( normI(A), NORM = 'I' or 'i' - ( - ( normF(A), NORM = 'F', 'f', 'E' or 'e' + DLANSY = ( max(abs(A(i,j))), NORM = 'M' or 'm' + ( + ( norm1(A), NORM = '1', 'O' or 'o' + ( + ( normI(A), NORM = 'I' or 'i' + ( + ( normF(A), NORM = 'F', 'f', 'E' or 'e' - where norm1 denotes the one norm of a matrix (maximum column sum), - normI denotes the infinity norm of a matrix (maximum row sum) and - normF denotes the Frobenius norm of a matrix (square root of sum of - squares). Note that max(abs(A(i,j))) is not a matrix norm. + where norm1 denotes the one norm of a matrix (maximum column sum), + normI denotes the infinity norm of a matrix (maximum row sum) and + normF denotes the Frobenius norm of a matrix (square root of sum of + squares). Note that max(abs(A(i,j))) is not a matrix norm. - Arguments - ========= + Arguments + ========= - NORM (input) CHARACTER*1 - Specifies the value to be returned in DLANSY as described - above. + NORM (input) CHARACTER*1 + Specifies the value to be returned in DLANSY as described + above. - UPLO (input) CHARACTER*1 - Specifies whether the upper or lower triangular part of the - symmetric matrix A is to be referenced. - = 'U': Upper triangular part of A is referenced - = 'L': Lower triangular part of A is referenced + UPLO (input) CHARACTER*1 + Specifies whether the upper or lower triangular part of the + symmetric matrix A is to be referenced. + = 'U': Upper triangular part of A is referenced + = 'L': Lower triangular part of A is referenced - N (input) INTEGER - The order of the matrix A. N >= 0. When N = 0, DLANSY is - set to zero. + N (input) INTEGER + The order of the matrix A. N >= 0. When N = 0, DLANSY is + set to zero. - A (input) DOUBLE PRECISION array, dimension (LDA,N) - The symmetric matrix A. If UPLO = 'U', the leading n by n - upper triangular part of A contains the upper triangular part - of the matrix A, and the strictly lower triangular part of A - is not referenced. If UPLO = 'L', the leading n by n lower - triangular part of A contains the lower triangular part of - the matrix A, and the strictly upper triangular part of A is - not referenced. + A (input) DOUBLE PRECISION array, dimension (LDA,N) + The symmetric matrix A. If UPLO = 'U', the leading n by n + upper triangular part of A contains the upper triangular part + of the matrix A, and the strictly lower triangular part of A + is not referenced. If UPLO = 'L', the leading n by n lower + triangular part of A contains the lower triangular part of + the matrix A, and the strictly upper triangular part of A is + not referenced. - LDA (input) INTEGER - The leading dimension of the array A. LDA >= max(N,1). + LDA (input) INTEGER + The leading dimension of the array A. LDA >= max(N,1). - WORK (workspace) DOUBLE PRECISION array, dimension (LWORK), - where LWORK >= N when NORM = 'I' or '1' or 'O'; otherwise, - WORK is not referenced. + WORK (workspace) DOUBLE PRECISION array, dimension (LWORK), + where LWORK >= N when NORM = 'I' or '1' or 'O'; otherwise, + WORK is not referenced. - ===================================================================== + ===================================================================== Parameter adjustments */ /* Table of constant values */ - static integer c__1 = 1; - + integer c__1 = 1; + /* System generated locals */ integer a_dim1, a_offset, i__1, i__2; doublereal ret_val, d__1, d__2, d__3; /* Builtin functions */ /*doublereal sqrt(doublereal);*/ /* Local variables */ - static doublereal absa; - static integer i__, j; - static doublereal scale; + doublereal absa; + integer i__, j; + doublereal scale; extern logical lsame_(const char *,const char *); - static doublereal value; - extern /* Subroutine */ integer dlassq_(integer *, doublereal *, integer *, + doublereal value; + extern /* Subroutine */ integer dlassq_(integer *, doublereal *, integer *, doublereal *, doublereal *); - static doublereal sum; + doublereal sum; #define a_ref(a_1,a_2) a[(a_2)*a_dim1 + a_1] @@ -103,6 +103,7 @@ doublereal dlansy_(const char *norm,const char *uplo, integer *n, doublereal *a, a_offset = 1 + a_dim1 * 1; a -= a_offset; --work; + value = 0.; /* Function Body */ if (*n == 0) { diff --git a/external/hypre/src/lapack/dlapy2.c b/external/hypre/src/lapack/dlapy2.c index 64bc4314..d54a16b5 100644 --- a/external/hypre/src/lapack/dlapy2.c +++ b/external/hypre/src/lapack/dlapy2.c @@ -10,24 +10,24 @@ extern "C" { doublereal dlapy2_(doublereal *x, doublereal *y) { -/* -- LAPACK auxiliary routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - October 31, 1992 +/* -- LAPACK auxiliary routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + October 31, 1992 - Purpose - ======= + Purpose + ======= - DLAPY2 returns sqrt(x**2+y**2), taking care not to cause unnecessary - overflow. + DLAPY2 returns sqrt(x**2+y**2), taking care not to cause unnecessary + overflow. - Arguments - ========= + Arguments + ========= - X (input) DOUBLE PRECISION - Y (input) DOUBLE PRECISION - X and Y specify the values x and y. + X (input) DOUBLE PRECISION + Y (input) DOUBLE PRECISION + X and Y specify the values x and y. ===================================================================== */ /* System generated locals */ @@ -35,7 +35,7 @@ doublereal dlapy2_(doublereal *x, doublereal *y) /* Builtin functions */ /*doublereal sqrt(doublereal);*/ /* Local variables */ - static doublereal xabs, yabs, w, z__; + doublereal xabs, yabs, w, z__; diff --git a/external/hypre/src/lapack/dlarf.c b/external/hypre/src/lapack/dlarf.c index 1f1cc74a..f8792349 100644 --- a/external/hypre/src/lapack/dlarf.c +++ b/external/hypre/src/lapack/dlarf.c @@ -9,83 +9,83 @@ extern "C" { #include "hypre_lapack.h" /* Subroutine */ integer dlarf_(const char *side, integer *m, integer *n, doublereal *v, - integer *incv, doublereal *tau, doublereal *c__, integer *ldc, + integer *incv, doublereal *tau, doublereal *c__, integer *ldc, doublereal *work) { -/* -- LAPACK auxiliary routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - February 29, 1992 +/* -- LAPACK auxiliary routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + February 29, 1992 - Purpose - ======= + Purpose + ======= - DLARF applies a real elementary reflector H to a real m by n matrix - C, from either the left or the right. H is represented in the form + DLARF applies a real elementary reflector H to a real m by n matrix + C, from either the left or the right. H is represented in the form - H = I - tau * v * v' + H = I - tau * v * v' - where tau is a real scalar and v is a real vector. + where tau is a real scalar and v is a real vector. - If tau = 0, then H is taken to be the unit matrix. + If tau = 0, then H is taken to be the unit matrix. - Arguments - ========= + Arguments + ========= - SIDE (input) CHARACTER*1 - = 'L': form H * C - = 'R': form C * H + SIDE (input) CHARACTER*1 + = 'L': form H * C + = 'R': form C * H - M (input) INTEGER - The number of rows of the matrix C. + M (input) INTEGER + The number of rows of the matrix C. - N (input) INTEGER - The number of columns of the matrix C. + N (input) INTEGER + The number of columns of the matrix C. - V (input) DOUBLE PRECISION array, dimension - (1 + (M-1)*abs(INCV)) if SIDE = 'L' - or (1 + (N-1)*abs(INCV)) if SIDE = 'R' - The vector v in the representation of H. V is not used if - TAU = 0. + V (input) DOUBLE PRECISION array, dimension + (1 + (M-1)*abs(INCV)) if SIDE = 'L' + or (1 + (N-1)*abs(INCV)) if SIDE = 'R' + The vector v in the representation of H. V is not used if + TAU = 0. - INCV (input) INTEGER - The increment between elements of v. INCV <> 0. + INCV (input) INTEGER + The increment between elements of v. INCV <> 0. - TAU (input) DOUBLE PRECISION - The value tau in the representation of H. + TAU (input) DOUBLE PRECISION + The value tau in the representation of H. - C (input/output) DOUBLE PRECISION array, dimension (LDC,N) - On entry, the m by n matrix C. - On exit, C is overwritten by the matrix H * C if SIDE = 'L', - or C * H if SIDE = 'R'. + C (input/output) DOUBLE PRECISION array, dimension (LDC,N) + On entry, the m by n matrix C. + On exit, C is overwritten by the matrix H * C if SIDE = 'L', + or C * H if SIDE = 'R'. - LDC (input) INTEGER - The leading dimension of the array C. LDC >= max(1,M). + LDC (input) INTEGER + The leading dimension of the array C. LDC >= max(1,M). - WORK (workspace) DOUBLE PRECISION array, dimension - (N) if SIDE = 'L' - or (M) if SIDE = 'R' + WORK (workspace) DOUBLE PRECISION array, dimension + (N) if SIDE = 'L' + or (M) if SIDE = 'R' - ===================================================================== + ===================================================================== Parameter adjustments */ /* Table of constant values */ - static doublereal c_b4 = 1.; - static doublereal c_b5 = 0.; - static integer c__1 = 1; - + doublereal c_b4 = 1.; + doublereal c_b5 = 0.; + integer c__1 = 1; + /* System generated locals */ integer c_dim1, c_offset; doublereal d__1; /* Local variables */ - extern /* Subroutine */ integer dger_(integer *, integer *, doublereal *, - doublereal *, integer *, doublereal *, integer *, doublereal *, + extern /* Subroutine */ integer dger_(integer *, integer *, doublereal *, + doublereal *, integer *, doublereal *, integer *, doublereal *, integer *); extern logical lsame_(const char *,const char *); - extern /* Subroutine */ integer dgemv_(const char *, integer *, integer *, - doublereal *, doublereal *, integer *, doublereal *, integer *, + extern /* Subroutine */ integer dgemv_(const char *, integer *, integer *, + doublereal *, doublereal *, integer *, doublereal *, integer *, doublereal *, doublereal *, integer *); @@ -110,7 +110,7 @@ extern "C" { /* C := C - v * w' */ d__1 = -(*tau); - dger_(m, n, &d__1, &v[1], incv, &work[1], &c__1, &c__[c_offset], + dger_(m, n, &d__1, &v[1], incv, &work[1], &c__1, &c__[c_offset], ldc); } } else { @@ -121,13 +121,13 @@ extern "C" { /* w := C * v */ - dgemv_("No transpose", m, n, &c_b4, &c__[c_offset], ldc, &v[1], + dgemv_("No transpose", m, n, &c_b4, &c__[c_offset], ldc, &v[1], incv, &c_b5, &work[1], &c__1); /* C := C - w * v' */ d__1 = -(*tau); - dger_(m, n, &d__1, &work[1], &c__1, &v[1], incv, &c__[c_offset], + dger_(m, n, &d__1, &work[1], &c__1, &v[1], incv, &c__[c_offset], ldc); } } diff --git a/external/hypre/src/lapack/dlarfb.c b/external/hypre/src/lapack/dlarfb.c index ce7b3eb9..c48c3fe8 100644 --- a/external/hypre/src/lapack/dlarfb.c +++ b/external/hypre/src/lapack/dlarfb.c @@ -98,15 +98,15 @@ extern "C" { Parameter adjustments */ /* Table of constant values */ - static integer c__1 = 1; - static doublereal c_b14 = 1.; - static doublereal c_b25 = -1.; + integer c__1 = 1; + doublereal c_b14 = 1.; + doublereal c_b25 = -1.; /* System generated locals */ integer c_dim1, c_offset, t_dim1, t_offset, v_dim1, v_offset, work_dim1, work_offset, i__1, i__2; /* Local variables */ - static integer i__, j; + integer i__, j; extern /* Subroutine */ integer dgemm_(const char *,const char *, integer *, integer *, integer *, doublereal *, doublereal *, integer *, doublereal *, integer *, doublereal *, doublereal *, integer *); @@ -115,7 +115,7 @@ extern "C" { doublereal *, integer *), dtrmm_(const char *,const char *,const char *,const char *, integer *, integer *, doublereal *, doublereal *, integer *, doublereal *, integer *); - static char transt[1]; + char transt[1]; #define work_ref(a_1,a_2) work[(a_2)*work_dim1 + a_1] #define c___ref(a_1,a_2) c__[(a_2)*c_dim1 + a_1] #define v_ref(a_1,a_2) v[(a_2)*v_dim1 + a_1] diff --git a/external/hypre/src/lapack/dlarfg.c b/external/hypre/src/lapack/dlarfg.c index 99f8d8db..9686390f 100644 --- a/external/hypre/src/lapack/dlarfg.c +++ b/external/hypre/src/lapack/dlarfg.c @@ -8,60 +8,60 @@ extern "C" { #include "f2c.h" #include "hypre_lapack.h" -/* Subroutine */ integer dlarfg_(integer *n, doublereal *alpha, doublereal *x, +/* Subroutine */ integer dlarfg_(integer *n, doublereal *alpha, doublereal *x, integer *incx, doublereal *tau) { -/* -- LAPACK auxiliary routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - September 30, 1994 +/* -- LAPACK auxiliary routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + September 30, 1994 - Purpose - ======= + Purpose + ======= - DLARFG generates a real elementary reflector H of order n, such - that + DLARFG generates a real elementary reflector H of order n, such + that - H * ( alpha ) = ( beta ), H' * H = I. - ( x ) ( 0 ) + H * ( alpha ) = ( beta ), H' * H = I. + ( x ) ( 0 ) - where alpha and beta are scalars, and x is an (n-1)-element real - vector. H is represented in the form + where alpha and beta are scalars, and x is an (n-1)-element real + vector. H is represented in the form - H = I - tau * ( 1 ) * ( 1 v' ) , - ( v ) + H = I - tau * ( 1 ) * ( 1 v' ) , + ( v ) - where tau is a real scalar and v is a real (n-1)-element - vector. + where tau is a real scalar and v is a real (n-1)-element + vector. - If the elements of x are all zero, then tau = 0 and H is taken to be - the unit matrix. + If the elements of x are all zero, then tau = 0 and H is taken to be + the unit matrix. - Otherwise 1 <= tau <= 2. + Otherwise 1 <= tau <= 2. - Arguments - ========= + Arguments + ========= - N (input) INTEGER - The order of the elementary reflector. + N (input) INTEGER + The order of the elementary reflector. - ALPHA (input/output) DOUBLE PRECISION - On entry, the value alpha. - On exit, it is overwritten with the value beta. + ALPHA (input/output) DOUBLE PRECISION + On entry, the value alpha. + On exit, it is overwritten with the value beta. - X (input/output) DOUBLE PRECISION array, dimension - (1+(N-2)*abs(INCX)) - On entry, the vector x. - On exit, it is overwritten with the vector v. + X (input/output) DOUBLE PRECISION array, dimension + (1+(N-2)*abs(INCX)) + On entry, the vector x. + On exit, it is overwritten with the vector v. - INCX (input) INTEGER - The increment between elements of X. INCX > 0. + INCX (input) INTEGER + The increment between elements of X. INCX > 0. - TAU (output) DOUBLE PRECISION - The value tau. + TAU (output) DOUBLE PRECISION + The value tau. - ===================================================================== + ===================================================================== Parameter adjustments */ @@ -71,15 +71,15 @@ extern "C" { /* Builtin functions */ doublereal d_sign(doublereal *, doublereal *); /* Local variables */ - static doublereal beta; + doublereal beta; extern doublereal dnrm2_(integer *, doublereal *, integer *); - static integer j; - extern /* Subroutine */ integer dscal_(integer *, doublereal *, doublereal *, + integer j; + extern /* Subroutine */ integer dscal_(integer *, doublereal *, doublereal *, integer *); - static doublereal xnorm; + doublereal xnorm; extern doublereal dlapy2_(doublereal *, doublereal *), dlamch_(const char *); - static doublereal safmin, rsafmn; - static integer knt; + doublereal safmin, rsafmn; + integer knt; --x; diff --git a/external/hypre/src/lapack/dlarft.c b/external/hypre/src/lapack/dlarft.c index 3820cb34..361679f3 100644 --- a/external/hypre/src/lapack/dlarft.c +++ b/external/hypre/src/lapack/dlarft.c @@ -113,21 +113,21 @@ extern "C" { Parameter adjustments */ /* Table of constant values */ - static integer c__1 = 1; - static doublereal c_b8 = 0.; + integer c__1 = 1; + doublereal c_b8 = 0.; /* System generated locals */ integer t_dim1, t_offset, v_dim1, v_offset, i__1, i__2, i__3; doublereal d__1; /* Local variables */ - static integer i__, j; + integer i__, j; extern logical lsame_(const char *,const char *); extern /* Subroutine */ integer dgemv_(const char *, integer *, integer *, doublereal *, doublereal *, integer *, doublereal *, integer *, doublereal *, doublereal *, integer *), dtrmv_(const char *, const char *,const char *, integer *, doublereal *, integer *, doublereal *, integer *); - static doublereal vii; + doublereal vii; #define t_ref(a_1,a_2) t[(a_2)*t_dim1 + a_1] #define v_ref(a_1,a_2) v[(a_2)*v_dim1 + a_1] diff --git a/external/hypre/src/lapack/dlartg.c b/external/hypre/src/lapack/dlartg.c index 76315071..9fe4bc70 100644 --- a/external/hypre/src/lapack/dlartg.c +++ b/external/hypre/src/lapack/dlartg.c @@ -8,54 +8,54 @@ extern "C" { #include "f2c.h" #include "hypre_lapack.h" -/* Subroutine */ integer dlartg_(doublereal *f, doublereal *g, doublereal *cs, +/* Subroutine */ integer dlartg_(doublereal *f, doublereal *g, doublereal *cs, doublereal *sn, doublereal *r__) { -/* -- LAPACK auxiliary routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - September 30, 1994 +/* -- LAPACK auxiliary routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + September 30, 1994 - Purpose - ======= + Purpose + ======= - DLARTG generate a plane rotation so that + DLARTG generate a plane rotation so that - [ CS SN ] . [ F ] = [ R ] where CS**2 + SN**2 = 1. - [ -SN CS ] [ G ] [ 0 ] + [ CS SN ] . [ F ] = [ R ] where CS**2 + SN**2 = 1. + [ -SN CS ] [ G ] [ 0 ] - This is a slower, more accurate version of the BLAS1 routine DROTG, - with the following other differences: - F and G are unchanged on return. - If G=0, then CS=1 and SN=0. - If F=0 and (G .ne. 0), then CS=0 and SN=1 without doing any - floating point operations (saves work in DBDSQR when - there are zeros on the diagonal). + This is a slower, more accurate version of the BLAS1 routine DROTG, + with the following other differences: + F and G are unchanged on return. + If G=0, then CS=1 and SN=0. + If F=0 and (G .ne. 0), then CS=0 and SN=1 without doing any + floating point operations (saves work in DBDSQR when + there are zeros on the diagonal). - If F exceeds G in magnitude, CS will be positive. + If F exceeds G in magnitude, CS will be positive. - Arguments - ========= + Arguments + ========= - F (input) DOUBLE PRECISION - The first component of vector to be rotated. + F (input) DOUBLE PRECISION + The first component of vector to be rotated. - G (input) DOUBLE PRECISION - The second component of vector to be rotated. + G (input) DOUBLE PRECISION + The second component of vector to be rotated. - CS (output) DOUBLE PRECISION - The cosine of the rotation. + CS (output) DOUBLE PRECISION + The cosine of the rotation. - SN (output) DOUBLE PRECISION - The sine of the rotation. + SN (output) DOUBLE PRECISION + The sine of the rotation. - R (output) DOUBLE PRECISION - The nonzero component of the rotated vector. + R (output) DOUBLE PRECISION + The nonzero component of the rotated vector. ===================================================================== */ /* Initialized data */ - static logical first = TRUE_; + logical first = TRUE_; /* System generated locals */ integer i__1; doublereal d__1, d__2; @@ -63,12 +63,12 @@ extern "C" { // doublereal log(doublereal), pow_di(doublereal *, integer *), sqrt(doublereal); doublereal pow_di(doublereal *, integer *); /* Local variables */ - static integer i__; - static doublereal scale; - static integer count; - static doublereal f1, g1, safmn2, safmx2; + integer i__; + doublereal scale; + integer count; + doublereal f1, g1, safmn2, safmx2; extern doublereal dlamch_(const char *); -// static doublereal safmin, eps; +// doublereal safmin, eps; @@ -77,7 +77,7 @@ extern "C" { // safmin = dlamch_("S"); // eps = dlamch_("E"); d__1 = dlamch_("B"); -// i__1 = (integer) (log(safmin / eps) / log(dlamch_("B")) / +// i__1 = (integer) (log(safmin / eps) / log(dlamch_("B")) / // 2.); i__1 = HYPRE_REAL_MIN_EXP>>1; safmn2 = pow_di(&d__1, &i__1); diff --git a/external/hypre/src/lapack/dlas2.c b/external/hypre/src/lapack/dlas2.c index 55cca2a6..1e5d51a6 100644 --- a/external/hypre/src/lapack/dlas2.c +++ b/external/hypre/src/lapack/dlas2.c @@ -67,7 +67,7 @@ extern "C" { /* System generated locals */ doublereal d__1, d__2; /* Local variables */ - static doublereal fhmn, fhmx, c__, fa, ga, ha, as, at, au; + doublereal fhmn, fhmx, c__, fa, ga, ha, as, at, au; diff --git a/external/hypre/src/lapack/dlascl.c b/external/hypre/src/lapack/dlascl.c index 53bbbaa5..8c351eb8 100644 --- a/external/hypre/src/lapack/dlascl.c +++ b/external/hypre/src/lapack/dlascl.c @@ -8,94 +8,94 @@ extern "C" { #include "f2c.h" #include "hypre_lapack.h" -/* Subroutine */ integer dlascl_(const char *type__, integer *kl, integer *ku, - doublereal *cfrom, doublereal *cto, integer *m, integer *n, +/* Subroutine */ integer dlascl_(const char *type__, integer *kl, integer *ku, + doublereal *cfrom, doublereal *cto, integer *m, integer *n, doublereal *a, integer *lda, integer *info) { -/* -- LAPACK auxiliary routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - February 29, 1992 +/* -- LAPACK auxiliary routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + February 29, 1992 - Purpose - ======= + Purpose + ======= - DLASCL multiplies the M by N real matrix A by the real scalar - CTO/CFROM. This is done without over/underflow as long as the final - result CTO*A(I,J)/CFROM does not over/underflow. TYPE specifies that - A may be full, upper triangular, lower triangular, upper Hessenberg, - or banded. + DLASCL multiplies the M by N real matrix A by the real scalar + CTO/CFROM. This is done without over/underflow as long as the final + result CTO*A(I,J)/CFROM does not over/underflow. TYPE specifies that + A may be full, upper triangular, lower triangular, upper Hessenberg, + or banded. - Arguments - ========= + Arguments + ========= - TYPE (input) CHARACTER*1 - TYPE indices the storage type of the input matrix. - = 'G': A is a full matrix. - = 'L': A is a lower triangular matrix. - = 'U': A is an upper triangular matrix. - = 'H': A is an upper Hessenberg matrix. - = 'B': A is a symmetric band matrix with lower bandwidth KL - and upper bandwidth KU and with the only the lower - half stored. - = 'Q': A is a symmetric band matrix with lower bandwidth KL - and upper bandwidth KU and with the only the upper - half stored. - = 'Z': A is a band matrix with lower bandwidth KL and upper - bandwidth KU. + TYPE (input) CHARACTER*1 + TYPE indices the storage type of the input matrix. + = 'G': A is a full matrix. + = 'L': A is a lower triangular matrix. + = 'U': A is an upper triangular matrix. + = 'H': A is an upper Hessenberg matrix. + = 'B': A is a symmetric band matrix with lower bandwidth KL + and upper bandwidth KU and with the only the lower + half stored. + = 'Q': A is a symmetric band matrix with lower bandwidth KL + and upper bandwidth KU and with the only the upper + half stored. + = 'Z': A is a band matrix with lower bandwidth KL and upper + bandwidth KU. - KL (input) INTEGER - The lower bandwidth of A. Referenced only if TYPE = 'B', - 'Q' or 'Z'. + KL (input) INTEGER + The lower bandwidth of A. Referenced only if TYPE = 'B', + 'Q' or 'Z'. - KU (input) INTEGER - The upper bandwidth of A. Referenced only if TYPE = 'B', - 'Q' or 'Z'. + KU (input) INTEGER + The upper bandwidth of A. Referenced only if TYPE = 'B', + 'Q' or 'Z'. - CFROM (input) DOUBLE PRECISION - CTO (input) DOUBLE PRECISION - The matrix A is multiplied by CTO/CFROM. A(I,J) is computed - without over/underflow if the final result CTO*A(I,J)/CFROM - can be represented without over/underflow. CFROM must be - nonzero. + CFROM (input) DOUBLE PRECISION + CTO (input) DOUBLE PRECISION + The matrix A is multiplied by CTO/CFROM. A(I,J) is computed + without over/underflow if the final result CTO*A(I,J)/CFROM + can be represented without over/underflow. CFROM must be + nonzero. - M (input) INTEGER - The number of rows of the matrix A. M >= 0. + M (input) INTEGER + The number of rows of the matrix A. M >= 0. - N (input) INTEGER - The number of columns of the matrix A. N >= 0. + N (input) INTEGER + The number of columns of the matrix A. N >= 0. - A (input/output) DOUBLE PRECISION array, dimension (LDA,M) - The matrix to be multiplied by CTO/CFROM. See TYPE for the - storage type. + A (input/output) DOUBLE PRECISION array, dimension (LDA,M) + The matrix to be multiplied by CTO/CFROM. See TYPE for the + storage type. - LDA (input) INTEGER - The leading dimension of the array A. LDA >= max(1,M). + LDA (input) INTEGER + The leading dimension of the array A. LDA >= max(1,M). - INFO (output) INTEGER - 0 - successful exit - <0 - if INFO = -i, the i-th argument had an illegal value. + INFO (output) INTEGER + 0 - successful exit + <0 - if INFO = -i, the i-th argument had an illegal value. - ===================================================================== + ===================================================================== - Test the input arguments + Test the input arguments Parameter adjustments */ /* System generated locals */ integer a_dim1, a_offset, i__1, i__2, i__3, i__4, i__5; /* Local variables */ - static logical done; - static doublereal ctoc; - static integer i__, j; + logical done; + doublereal ctoc; + integer i__, j; extern logical lsame_(const char *,const char *); - static integer itype, k1, k2, k3, k4; - static doublereal cfrom1; + integer itype, k1, k2, k3, k4; + doublereal cfrom1; extern doublereal dlamch_(const char *); - static doublereal cfromc; + doublereal cfromc; extern /* Subroutine */ integer xerbla_(const char *, integer *); - static doublereal bignum, smlnum, mul, cto1; + doublereal bignum, smlnum, mul, cto1; #define a_ref(a_1,a_2) a[(a_2)*a_dim1 + a_1] a_dim1 = *lda; @@ -129,7 +129,7 @@ extern "C" { *info = -4; } else if (*m < 0) { *info = -6; - } else if ((*n < 0) || ((itype == 4) && (*n != *m)) || + } else if ((*n < 0) || ((itype == 4) && (*n != *m)) || ((itype == 5) && (*n != *m))) { *info = -7; } else if ((itype <= 3) && (*lda < max(1,*m))) { @@ -142,11 +142,11 @@ extern "C" { } else /* if(complicated condition) */ { /* Computing MAX */ i__1 = *n - 1; - if ((*ku < 0) || (*ku > max(i__1,0)) || (itype == 4) || + if ((*ku < 0) || (*ku > max(i__1,0)) || (itype == 4) || ((itype == 5) && (*kl != *ku))) { *info = -3; - } else if (((itype == 4) && (*lda < (*kl + 1))) || - ((itype == 5) && (*lda < (*ku + 1))) || + } else if (((itype == 4) && (*lda < (*kl + 1))) || + ((itype == 5) && (*lda < (*ku + 1))) || ((itype == 6) && (*lda < ((*kl << 1) + *ku + 1)))) { *info = -9; } diff --git a/external/hypre/src/lapack/dlaset.c b/external/hypre/src/lapack/dlaset.c index d72084ed..41675c22 100644 --- a/external/hypre/src/lapack/dlaset.c +++ b/external/hypre/src/lapack/dlaset.c @@ -11,61 +11,61 @@ extern "C" { /* Subroutine */ integer dlaset_(const char *uplo, integer *m, integer *n, doublereal * alpha, doublereal *beta, doublereal *a, integer *lda) { -/* -- LAPACK auxiliary routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - October 31, 1992 +/* -- LAPACK auxiliary routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + October 31, 1992 - Purpose - ======= + Purpose + ======= - DLASET initializes an m-by-n matrix A to BETA on the diagonal and - ALPHA on the offdiagonals. + DLASET initializes an m-by-n matrix A to BETA on the diagonal and + ALPHA on the offdiagonals. - Arguments - ========= + Arguments + ========= - UPLO (input) CHARACTER*1 - Specifies the part of the matrix A to be set. - = 'U': Upper triangular part is set; the strictly lower - triangular part of A is not changed. - = 'L': Lower triangular part is set; the strictly upper - triangular part of A is not changed. - Otherwise: All of the matrix A is set. + UPLO (input) CHARACTER*1 + Specifies the part of the matrix A to be set. + = 'U': Upper triangular part is set; the strictly lower + triangular part of A is not changed. + = 'L': Lower triangular part is set; the strictly upper + triangular part of A is not changed. + Otherwise: All of the matrix A is set. - M (input) INTEGER - The number of rows of the matrix A. M >= 0. + M (input) INTEGER + The number of rows of the matrix A. M >= 0. - N (input) INTEGER - The number of columns of the matrix A. N >= 0. + N (input) INTEGER + The number of columns of the matrix A. N >= 0. - ALPHA (input) DOUBLE PRECISION - The constant to which the offdiagonal elements are to be set. + ALPHA (input) DOUBLE PRECISION + The constant to which the offdiagonal elements are to be set. - BETA (input) DOUBLE PRECISION - The constant to which the diagonal elements are to be set. + BETA (input) DOUBLE PRECISION + The constant to which the diagonal elements are to be set. - A (input/output) DOUBLE PRECISION array, dimension (LDA,N) - On exit, the leading m-by-n submatrix of A is set as follows: + A (input/output) DOUBLE PRECISION array, dimension (LDA,N) + On exit, the leading m-by-n submatrix of A is set as follows: - if UPLO = 'U', A(i,j) = ALPHA, 1<=i<=j-1, 1<=j<=n, - if UPLO = 'L', A(i,j) = ALPHA, j+1<=i<=m, 1<=j<=n, - otherwise, A(i,j) = ALPHA, 1<=i<=m, 1<=j<=n, i.ne.j, + if UPLO = 'U', A(i,j) = ALPHA, 1<=i<=j-1, 1<=j<=n, + if UPLO = 'L', A(i,j) = ALPHA, j+1<=i<=m, 1<=j<=n, + otherwise, A(i,j) = ALPHA, 1<=i<=m, 1<=j<=n, i.ne.j, - and, for all UPLO, A(i,i) = BETA, 1<=i<=min(m,n). + and, for all UPLO, A(i,i) = BETA, 1<=i<=min(m,n). - LDA (input) INTEGER - The leading dimension of the array A. LDA >= max(1,M). + LDA (input) INTEGER + The leading dimension of the array A. LDA >= max(1,M). - ===================================================================== + ===================================================================== Parameter adjustments */ /* System generated locals */ integer a_dim1, a_offset, i__1, i__2, i__3; /* Local variables */ - static integer i__, j; + integer i__, j; extern logical lsame_(const char *,const char *); #define a_ref(a_1,a_2) a[(a_2)*a_dim1 + a_1] @@ -76,7 +76,7 @@ extern "C" { /* Function Body */ if (lsame_(uplo, "U")) { -/* Set the strictly upper triangular or trapezoidal part of the +/* Set the strictly upper triangular or trapezoidal part of the array to ALPHA. */ i__1 = *n; @@ -93,7 +93,7 @@ extern "C" { } else if (lsame_(uplo, "L")) { -/* Set the strictly lower triangular or trapezoidal part of the +/* Set the strictly lower triangular or trapezoidal part of the array to ALPHA. */ i__1 = min(*m,*n); diff --git a/external/hypre/src/lapack/dlasq1.c b/external/hypre/src/lapack/dlasq1.c index 3a996792..a6b53c26 100644 --- a/external/hypre/src/lapack/dlasq1.c +++ b/external/hypre/src/lapack/dlasq1.c @@ -13,13 +13,7 @@ extern "C" { -lf2c -lm (in that order) */ -/* Table of constant values */ - -static integer c__1 = 1; -static integer c__2 = 2; -static integer c__0 = 0; - -/* Subroutine */ integer dlasq1_(integer *n, doublereal *d__, doublereal *e, +/* Subroutine */ integer dlasq1_(integer *n, doublereal *d__, doublereal *e, doublereal *work, integer *info) { /* System generated locals */ @@ -27,77 +21,83 @@ static integer c__0 = 0; doublereal d__1, d__2, d__3; /* Local variables */ - extern /* Subroutine */ integer dlas2_(doublereal *, doublereal *, doublereal + extern /* Subroutine */ integer dlas2_(doublereal *, doublereal *, doublereal *, doublereal *, doublereal *); - static integer i__; - static doublereal scale; - static integer iinfo; - static doublereal sigmn; - extern /* Subroutine */ integer dcopy_(integer *, doublereal *, integer *, + integer i__; + doublereal scale; + integer iinfo; + doublereal sigmn; + extern /* Subroutine */ integer dcopy_(integer *, doublereal *, integer *, doublereal *, integer *); - static doublereal sigmx; + doublereal sigmx; extern /* Subroutine */ integer dlasq2_(integer *, doublereal *, integer *); extern doublereal dlamch_(const char *); - extern /* Subroutine */ integer dlascl_(const char *, integer *, integer *, - doublereal *, doublereal *, integer *, integer *, doublereal *, + extern /* Subroutine */ integer dlascl_(const char *, integer *, integer *, + doublereal *, doublereal *, integer *, integer *, doublereal *, integer *, integer *); - static doublereal safmin; + doublereal safmin; extern /* Subroutine */ integer xerbla_(const char *, integer *), dlasrt_( const char *, integer *, doublereal *, integer *); - static doublereal eps; + doublereal eps; + + /* Table of constant values */ + integer c__1 = 1; + integer c__2 = 2; + integer c__0 = 0; + -/* -- LAPACK routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - October 31, 1999 +/* -- LAPACK routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + October 31, 1999 - Purpose - ======= + Purpose + ======= - DLASQ1 computes the singular values of a real N-by-N bidiagonal - matrix with diagonal D and off-diagonal E. The singular values - are computed to high relative accuracy, in the absence of - denormalization, underflow and overflow. The algorithm was first - presented in + DLASQ1 computes the singular values of a real N-by-N bidiagonal + matrix with diagonal D and off-diagonal E. The singular values + are computed to high relative accuracy, in the absence of + denormalization, underflow and overflow. The algorithm was first + presented in - "Accurate singular values and differential qd algorithms" by K. V. - Fernando and B. N. Parlett, Numer. Math., Vol-67, No. 2, pp. 191-230, - 1994, + "Accurate singular values and differential qd algorithms" by K. V. + Fernando and B. N. Parlett, Numer. Math., Vol-67, No. 2, pp. 191-230, + 1994, - and the present implementation is described in "An implementation of - the dqds Algorithm (Positive Case)", LAPACK Working Note. + and the present implementation is described in "An implementation of + the dqds Algorithm (Positive Case)", LAPACK Working Note. - Arguments - ========= + Arguments + ========= - N (input) INTEGER - The number of rows and columns in the matrix. N >= 0. + N (input) INTEGER + The number of rows and columns in the matrix. N >= 0. - D (input/output) DOUBLE PRECISION array, dimension (N) - On entry, D contains the diagonal elements of the - bidiagonal matrix whose SVD is desired. On normal exit, - D contains the singular values in decreasing order. + D (input/output) DOUBLE PRECISION array, dimension (N) + On entry, D contains the diagonal elements of the + bidiagonal matrix whose SVD is desired. On normal exit, + D contains the singular values in decreasing order. - E (input/output) DOUBLE PRECISION array, dimension (N) - On entry, elements E(1:N-1) contain the off-diagonal elements - of the bidiagonal matrix whose SVD is desired. - On exit, E is overwritten. + E (input/output) DOUBLE PRECISION array, dimension (N) + On entry, elements E(1:N-1) contain the off-diagonal elements + of the bidiagonal matrix whose SVD is desired. + On exit, E is overwritten. - WORK (workspace) DOUBLE PRECISION array, dimension (4*N) + WORK (workspace) DOUBLE PRECISION array, dimension (4*N) - INFO (output) INTEGER - = 0: successful exit - < 0: if INFO = -i, the i-th argument had an illegal value - > 0: the algorithm failed - = 1, a split was marked by a positive value in E - = 2, current block of Z not diagonalized after 30*N - iterations (in inner while loop) - = 3, termination criterion of outer while loop not met - (program created more than N unreduced blocks) + INFO (output) INTEGER + = 0: successful exit + < 0: if INFO = -i, the i-th argument had an illegal value + > 0: the algorithm failed + = 1, a split was marked by a positive value in E + = 2, current block of Z not diagonalized after 30*N + iterations (in inner while loop) + = 3, termination criterion of outer while loop not met + (program created more than N unreduced blocks) - ===================================================================== + ===================================================================== Parameter adjustments */ @@ -152,7 +152,7 @@ static integer c__0 = 0; /* L20: */ } -/* Copy D and E into WORK (in the Z format) and scale (squaring the +/* Copy D and E into WORK (in the Z format) and scale (squaring the input data makes scaling by a power of the radix pointless). */ eps = dlamch_("Precision"); @@ -163,7 +163,7 @@ static integer c__0 = 0; dcopy_(&i__1, &e[1], &c__1, &work[2], &c__2); i__1 = (*n << 1) - 1; i__2 = (*n << 1) - 1; - dlascl_("G", &c__0, &c__0, &sigmx, &scale, &i__1, &c__1, &work[1], &i__2, + dlascl_("G", &c__0, &c__0, &sigmx, &scale, &i__1, &c__1, &work[1], &i__2, &iinfo); /* Compute the q's and e's. */ diff --git a/external/hypre/src/lapack/dlasq2.c b/external/hypre/src/lapack/dlasq2.c index b45f945c..ed1f3702 100644 --- a/external/hypre/src/lapack/dlasq2.c +++ b/external/hypre/src/lapack/dlasq2.c @@ -13,15 +13,6 @@ extern "C" { -lf2c -lm (in that order) */ -/* Table of constant values */ - -static integer c__1 = 1; -static integer c__2 = 2; -static integer c__10 = 10; -static integer c__3 = 3; -static integer c__4 = 4; -static integer c__11 = 11; - /* Subroutine */ integer dlasq2_(integer *n, doublereal *z__, integer *info) { /* System generated locals */ @@ -29,97 +20,105 @@ static integer c__11 = 11; doublereal d__1, d__2; /* Local variables */ - static logical ieee; - static integer nbig; - static doublereal dmin__, emin, emax; - static integer ndiv, iter; - static doublereal qmin, temp, qmax, zmax; - static integer splt; - static doublereal d__, e; - static integer k; - static doublereal s, t; - static integer nfail; - static doublereal desig, trace, sigma; - static integer iinfo, i0, i4, n0; - extern /* Subroutine */ integer dlasq3_(integer *, integer *, doublereal *, + logical ieee; + integer nbig; + doublereal dmin__, emin, emax; + integer ndiv, iter; + doublereal qmin, temp, qmax, zmax; + integer splt; + doublereal d__, e; + integer k; + doublereal s, t; + integer nfail; + doublereal desig, trace, sigma; + integer iinfo, i0, i4, n0; + extern /* Subroutine */ integer dlasq3_(integer *, integer *, doublereal *, integer *, doublereal *, doublereal *, doublereal *, doublereal *, integer *, integer *, integer *, logical *); extern doublereal dlamch_(const char *); - static integer pp, iwhila, iwhilb; - static doublereal oldemn, safmin; + integer pp, iwhila, iwhilb; + doublereal oldemn, safmin; extern /* Subroutine */ integer xerbla_(const char *, integer *); - extern integer ilaenv_(integer *,const char *,const char *, integer *, integer *, + extern integer ilaenv_(integer *,const char *,const char *, integer *, integer *, integer *, integer *, ftnlen, ftnlen); - extern /* Subroutine */ integer dlasrt_(const char *, integer *, doublereal *, + extern /* Subroutine */ integer dlasrt_(const char *, integer *, doublereal *, integer *); - static doublereal eps, tol; - static integer ipn4; - static doublereal tol2; - - -/* -- LAPACK routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - October 31, 1999 - - - Purpose - ======= - - DLASQ2 computes all the eigenvalues of the symmetric positive - definite tridiagonal matrix associated with the qd array Z to high - relative accuracy are computed to high relative accuracy, in the - absence of denormalization, underflow and overflow. - - To see the relation of Z to the tridiagonal matrix, let L be a - unit lower bidiagonal matrix with subdiagonals Z(2,4,6,,..) and - let U be an upper bidiagonal matrix with 1's above and diagonal - Z(1,3,5,,..). The tridiagonal is L*U or, if you prefer, the - symmetric tridiagonal to which it is similar. - - Note : DLASQ2 defines a logical variable, IEEE, which is true - on machines which follow ieee-754 floating-point standard in their - handling of infinities and NaNs, and false otherwise. This variable - is passed to DLASQ3. - - Arguments - ========= - - N (input) INTEGER - The number of rows and columns in the matrix. N >= 0. - - Z (workspace) DOUBLE PRECISION array, dimension ( 4*N ) - On entry Z holds the qd array. On exit, entries 1 to N hold - the eigenvalues in decreasing order, Z( 2*N+1 ) holds the - trace, and Z( 2*N+2 ) holds the sum of the eigenvalues. If - N > 2, then Z( 2*N+3 ) holds the iteration count, Z( 2*N+4 ) - holds NDIVS/NIN^2, and Z( 2*N+5 ) holds the percentage of - shifts that failed. - - INFO (output) INTEGER - = 0: successful exit - < 0: if the i-th argument is a scalar and had an illegal - value, then INFO = -i, if the i-th argument is an - array and the j-entry had an illegal value, then - INFO = -(i*100+j) - > 0: the algorithm failed - = 1, a split was marked by a positive value in E - = 2, current block of Z not diagonalized after 30*N - iterations (in inner while loop) - = 3, termination criterion of outer while loop not met - (program created more than N unreduced blocks) - - Further Details - =============== - Local Variables: I0:N0 defines a current unreduced segment of Z. - The shifts are accumulated in SIGMA. Iteration count is in ITER. - Ping-pong is controlled by PP (alternates between 0 and 1). - - ===================================================================== - - - Test the input arguments. - (in case DLASQ2 is not called by DLASQ1) + doublereal eps, tol; + integer ipn4; + doublereal tol2; + + /* Table of constant values */ + integer c__1 = 1; + integer c__2 = 2; + integer c__10 = 10; + integer c__3 = 3; + integer c__4 = 4; + integer c__11 = 11; + + +/* -- LAPACK routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + October 31, 1999 + + + Purpose + ======= + + DLASQ2 computes all the eigenvalues of the symmetric positive + definite tridiagonal matrix associated with the qd array Z to high + relative accuracy are computed to high relative accuracy, in the + absence of denormalization, underflow and overflow. + + To see the relation of Z to the tridiagonal matrix, let L be a + unit lower bidiagonal matrix with subdiagonals Z(2,4,6,,..) and + let U be an upper bidiagonal matrix with 1's above and diagonal + Z(1,3,5,,..). The tridiagonal is L*U or, if you prefer, the + symmetric tridiagonal to which it is similar. + + Note : DLASQ2 defines a logical variable, IEEE, which is true + on machines which follow ieee-754 floating-point standard in their + handling of infinities and NaNs, and false otherwise. This variable + is passed to DLASQ3. + + Arguments + ========= + + N (input) INTEGER + The number of rows and columns in the matrix. N >= 0. + + Z (workspace) DOUBLE PRECISION array, dimension ( 4*N ) + On entry Z holds the qd array. On exit, entries 1 to N hold + the eigenvalues in decreasing order, Z( 2*N+1 ) holds the + trace, and Z( 2*N+2 ) holds the sum of the eigenvalues. If + N > 2, then Z( 2*N+3 ) holds the iteration count, Z( 2*N+4 ) + holds NDIVS/NIN^2, and Z( 2*N+5 ) holds the percentage of + shifts that failed. + + INFO (output) INTEGER + = 0: successful exit + < 0: if the i-th argument is a scalar and had an illegal + value, then INFO = -i, if the i-th argument is an + array and the j-entry had an illegal value, then + INFO = -(i*100+j) + > 0: the algorithm failed + = 1, a split was marked by a positive value in E + = 2, current block of Z not diagonalized after 30*N + iterations (in inner while loop) + = 3, termination criterion of outer while loop not met + (program created more than N unreduced blocks) + + Further Details + =============== + Local Variables: I0:N0 defines a current unreduced segment of Z. + The shifts are accumulated in SIGMA. Iteration count is in ITER. + Ping-pong is controlled by PP (alternates between 0 and 1). + + ===================================================================== + + + Test the input arguments. + (in case DLASQ2 is not called by DLASQ1) Parameter adjustments */ --z__; @@ -310,7 +309,7 @@ static integer c__11 = 11; z__[i4 - (pp << 1) - 2] = d__; z__[i4 - (pp << 1)] = 0.; d__ = z__[i4 + 1]; - } else if (safmin * z__[i4 + 1] < z__[i4 - (pp << 1) - 2] && + } else if (safmin * z__[i4 + 1] < z__[i4 - (pp << 1) - 2] && safmin * z__[i4 - (pp << 1) - 2] < z__[i4 + 1]) { temp = z__[i4 + 1] / z__[i4 - (pp << 1) - 2]; z__[i4 - (pp << 1)] = z__[i4 - 1] * temp; @@ -354,9 +353,9 @@ static integer c__11 = 11; goto L150; } -/* While array unfinished do +/* While array unfinished do - E(N0) holds the value of SIGMA when submatrix in I0:N0 + E(N0) holds the value of SIGMA when submatrix in I0:N0 splits from the rest of the array, but is negated. */ desig = 0.; @@ -370,7 +369,7 @@ static integer c__11 = 11; return 0; } -/* Find last unreduced submatrix's top index I0, find QMAX and +/* Find last unreduced submatrix's top index I0, find QMAX and EMIN. Find Gershgorin-type bound if Q's much greater than E's. */ emax = 0.; @@ -410,7 +409,7 @@ static integer c__11 = 11; z__[(n0 << 2) - 1] = emin; -/* Put -(initial shift) into DMIN. +/* Put -(initial shift) into DMIN. Computing MAX */ d__1 = 0., d__2 = qmin - sqrt(qmin) * 2. * sqrt(emax); @@ -445,7 +444,7 @@ static integer c__11 = 11; oldemn = z__[i0 * 4]; i__3 = (n0 - 3) << 2; for (i4 = i0 << 2; i4 <= i__3; i4 += 4) { - if (z__[i4] <= tol2 * z__[i4 - 3] || z__[i4 - 1] <= + if (z__[i4] <= tol2 * z__[i4 - 3] || z__[i4 - 1] <= tol2 * sigma) { z__[i4 - 1] = -sigma; splt = i4 / 4; diff --git a/external/hypre/src/lapack/dlasq3.c b/external/hypre/src/lapack/dlasq3.c index f73c64e3..81d6f7e0 100644 --- a/external/hypre/src/lapack/dlasq3.c +++ b/external/hypre/src/lapack/dlasq3.c @@ -8,97 +8,97 @@ extern "C" { #include "f2c.h" #include "hypre_lapack.h" -/* Subroutine */ integer dlasq3_(integer *i0, integer *n0, doublereal *z__, +/* Subroutine */ integer dlasq3_(integer *i0, integer *n0, doublereal *z__, integer *pp, doublereal *dmin__, doublereal *sigma, doublereal *desig, - doublereal *qmax, integer *nfail, integer *iter, integer *ndiv, + doublereal *qmax, integer *nfail, integer *iter, integer *ndiv, logical *ieee) { -/* -- LAPACK auxiliary routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - May 17, 2000 +/* -- LAPACK auxiliary routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + May 17, 2000 - Purpose - ======= + Purpose + ======= - DLASQ3 checks for deflation, computes a shift (TAU) and calls dqds. - In case of failure it changes shifts, and tries again until output - is positive. + DLASQ3 checks for deflation, computes a shift (TAU) and calls dqds. + In case of failure it changes shifts, and tries again until output + is positive. - Arguments - ========= + Arguments + ========= - I0 (input) INTEGER - First index. + I0 (input) INTEGER + First index. - N0 (input) INTEGER - Last index. + N0 (input) INTEGER + Last index. - Z (input) DOUBLE PRECISION array, dimension ( 4*N ) - Z holds the qd array. + Z (input) DOUBLE PRECISION array, dimension ( 4*N ) + Z holds the qd array. - PP (input) INTEGER - PP=0 for ping, PP=1 for pong. + PP (input) INTEGER + PP=0 for ping, PP=1 for pong. - DMIN (output) DOUBLE PRECISION - Minimum value of d. + DMIN (output) DOUBLE PRECISION + Minimum value of d. - SIGMA (output) DOUBLE PRECISION - Sum of shifts used in current segment. + SIGMA (output) DOUBLE PRECISION + Sum of shifts used in current segment. - DESIG (input/output) DOUBLE PRECISION - Lower order part of SIGMA + DESIG (input/output) DOUBLE PRECISION + Lower order part of SIGMA - QMAX (input) DOUBLE PRECISION - Maximum value of q. + QMAX (input) DOUBLE PRECISION + Maximum value of q. - NFAIL (output) INTEGER - Number of times shift was too big. + NFAIL (output) INTEGER + Number of times shift was too big. - ITER (output) INTEGER - Number of iterations. + ITER (output) INTEGER + Number of iterations. - NDIV (output) INTEGER - Number of divisions. + NDIV (output) INTEGER + Number of divisions. - TTYPE (output) INTEGER - Shift type. + TTYPE (output) INTEGER + Shift type. - IEEE (input) LOGICAL - Flag for IEEE or non IEEE arithmetic (passed to DLASQ5). + IEEE (input) LOGICAL + Flag for IEEE or non IEEE arithmetic (passed to DLASQ5). - ===================================================================== + ===================================================================== Parameter adjustments */ /* Initialized data */ - static integer ttype = 0; - static doublereal dmin1 = 0.; - static doublereal dmin2 = 0.; - static doublereal dn = 0.; - static doublereal dn1 = 0.; - static doublereal dn2 = 0.; - static doublereal tau = 0.; + integer ttype = 0; + doublereal dmin1 = 0.; + doublereal dmin2 = 0.; + doublereal dn = 0.; + doublereal dn1 = 0.; + doublereal dn2 = 0.; + doublereal tau = 0.; /* System generated locals */ integer i__1; doublereal d__1, d__2; /* Local variables */ - static doublereal temp, s, t; - static integer j4; - extern /* Subroutine */ integer dlasq4_(integer *, integer *, doublereal *, - integer *, integer *, doublereal *, doublereal *, doublereal *, + doublereal temp, s, t; + integer j4; + extern /* Subroutine */ integer dlasq4_(integer *, integer *, doublereal *, + integer *, integer *, doublereal *, doublereal *, doublereal *, doublereal *, doublereal *, doublereal *, doublereal *, integer *) - , dlasq5_(integer *, integer *, doublereal *, integer *, - doublereal *, doublereal *, doublereal *, doublereal *, + , dlasq5_(integer *, integer *, doublereal *, integer *, + doublereal *, doublereal *, doublereal *, doublereal *, doublereal *, doublereal *, doublereal *, logical *), dlasq6_( - integer *, integer *, doublereal *, integer *, doublereal *, - doublereal *, doublereal *, doublereal *, doublereal *, + integer *, integer *, doublereal *, integer *, doublereal *, + doublereal *, doublereal *, doublereal *, doublereal *, doublereal *); extern doublereal dlamch_(const char *); - static integer nn; - static doublereal safmin, eps, tol; - static integer n0in, ipn4; - static doublereal tol2; + integer nn; + doublereal safmin, eps, tol; + integer n0in, ipn4; + doublereal tol2; --z__; @@ -129,7 +129,7 @@ extern "C" { /* Check whether E(N0-1) is negligible, 1 eigenvalue. */ - if (z__[nn - 5] > tol2 * (*sigma + z__[nn - 3]) && z__[nn - (*pp << 1) - + if (z__[nn - 5] > tol2 * (*sigma + z__[nn - 3]) && z__[nn - (*pp << 1) - 4] > tol2 * z__[nn - 7]) { goto L30; } @@ -219,7 +219,7 @@ extern "C" { } } -/* L70: +/* L70: Computing MIN */ d__1 = z__[(*n0 << 2) + *pp - 1], d__2 = z__[(*n0 << 2) + *pp - 9], d__1 = @@ -235,7 +235,7 @@ extern "C" { L80: - dlasq5_(i0, n0, &z__[1], pp, &tau, dmin__, &dmin1, &dmin2, &dn, &dn1, + dlasq5_(i0, n0, &z__[1], pp, &tau, dmin__, &dmin1, &dmin2, &dn, &dn1, &dn2, ieee); *ndiv += *n0 - *i0 + 2; @@ -249,7 +249,7 @@ extern "C" { goto L100; - } else if (*dmin__ < 0. && dmin1 > 0. && z__[((*n0 - 1) << 2) - *pp] < + } else if (*dmin__ < 0. && dmin1 > 0. && z__[((*n0 - 1) << 2) - *pp] < tol * (*sigma + dn1) && abs(dn) < tol * *sigma) { /* Convergence hidden by negative DN. */ diff --git a/external/hypre/src/lapack/dlasq4.c b/external/hypre/src/lapack/dlasq4.c index d5af3fee..aac71acb 100644 --- a/external/hypre/src/lapack/dlasq4.c +++ b/external/hypre/src/lapack/dlasq4.c @@ -13,88 +13,88 @@ extern "C" { -lf2c -lm (in that order) */ -/* Subroutine */ integer dlasq4_(integer *i0, integer *n0, doublereal *z__, - integer *pp, integer *n0in, doublereal *dmin__, doublereal *dmin1, - doublereal *dmin2, doublereal *dn, doublereal *dn1, doublereal *dn2, +/* Subroutine */ integer dlasq4_(integer *i0, integer *n0, doublereal *z__, + integer *pp, integer *n0in, doublereal *dmin__, doublereal *dmin1, + doublereal *dmin2, doublereal *dn, doublereal *dn1, doublereal *dn2, doublereal *tau, integer *ttype) { /* Initialized data */ - - static doublereal g = 0.; + doublereal g = 0.; /* System generated locals */ integer i__1; doublereal d__1, d__2; /* Local variables */ - static doublereal s, a2, b1, b2; - static integer i4, nn, np; - static doublereal gam, gap1, gap2; + doublereal s, a2, b1, b2; + integer i4, nn, np; + doublereal gam, gap1, gap2; -/* -- LAPACK auxiliary routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - October 31, 1999 +/* -- LAPACK auxiliary routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + October 31, 1999 - Purpose - ======= + Purpose + ======= - DLASQ4 computes an approximation TAU to the smallest eigenvalue - using values of d from the previous transform. + DLASQ4 computes an approximation TAU to the smallest eigenvalue + using values of d from the previous transform. - I0 (input) INTEGER - First index. + I0 (input) INTEGER + First index. - N0 (input) INTEGER - Last index. + N0 (input) INTEGER + Last index. - Z (input) DOUBLE PRECISION array, dimension ( 4*N ) - Z holds the qd array. + Z (input) DOUBLE PRECISION array, dimension ( 4*N ) + Z holds the qd array. - PP (input) INTEGER - PP=0 for ping, PP=1 for pong. + PP (input) INTEGER + PP=0 for ping, PP=1 for pong. - NOIN (input) INTEGER - The value of N0 at start of EIGTEST. + NOIN (input) INTEGER + The value of N0 at start of EIGTEST. - DMIN (input) DOUBLE PRECISION - Minimum value of d. + DMIN (input) DOUBLE PRECISION + Minimum value of d. - DMIN1 (input) DOUBLE PRECISION - Minimum value of d, excluding D( N0 ). + DMIN1 (input) DOUBLE PRECISION + Minimum value of d, excluding D( N0 ). - DMIN2 (input) DOUBLE PRECISION - Minimum value of d, excluding D( N0 ) and D( N0-1 ). + DMIN2 (input) DOUBLE PRECISION + Minimum value of d, excluding D( N0 ) and D( N0-1 ). - DN (input) DOUBLE PRECISION - d(N) + DN (input) DOUBLE PRECISION + d(N) - DN1 (input) DOUBLE PRECISION - d(N-1) + DN1 (input) DOUBLE PRECISION + d(N-1) - DN2 (input) DOUBLE PRECISION - d(N-2) + DN2 (input) DOUBLE PRECISION + d(N-2) - TAU (output) DOUBLE PRECISION - This is the shift. + TAU (output) DOUBLE PRECISION + This is the shift. - TTYPE (output) INTEGER - Shift type. + TTYPE (output) INTEGER + Shift type. - Further Details - =============== - CNST1 = 9/16 + Further Details + =============== + CNST1 = 9/16 - ===================================================================== + ===================================================================== Parameter adjustments */ --z__; + s = 0.; - /* Function Body + /* Function Body - A negative DMIN forces the shift to take that absolute value + A negative DMIN forces the shift to take that absolute value TTYPE records the type of shift. */ if (*dmin__ <= 0.) { @@ -321,7 +321,7 @@ extern "C" { } else if (*n0in == *n0 + 2) { -/* Two eigenvalues deflated. Use DMIN2, DN2 for DMIN and DN. +/* Two eigenvalues deflated. Use DMIN2, DN2 for DMIN and DN. Cases 10 and 11. */ diff --git a/external/hypre/src/lapack/dlasq5.c b/external/hypre/src/lapack/dlasq5.c index 869768c6..0a7147a5 100644 --- a/external/hypre/src/lapack/dlasq5.c +++ b/external/hypre/src/lapack/dlasq5.c @@ -8,64 +8,64 @@ extern "C" { #include "f2c.h" #include "hypre_lapack.h" -/* Subroutine */ integer dlasq5_(integer *i0, integer *n0, doublereal *z__, - integer *pp, doublereal *tau, doublereal *dmin__, doublereal *dmin1, +/* Subroutine */ integer dlasq5_(integer *i0, integer *n0, doublereal *z__, + integer *pp, doublereal *tau, doublereal *dmin__, doublereal *dmin1, doublereal *dmin2, doublereal *dn, doublereal *dnm1, doublereal *dnm2, logical *ieee) { -/* -- LAPACK auxiliary routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - May 17, 2000 +/* -- LAPACK auxiliary routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + May 17, 2000 - Purpose - ======= + Purpose + ======= - DLASQ5 computes one dqds transform in ping-pong form, one - version for IEEE machines another for non IEEE machines. + DLASQ5 computes one dqds transform in ping-pong form, one + version for IEEE machines another for non IEEE machines. - Arguments - ========= + Arguments + ========= - I0 (input) INTEGER - First index. + I0 (input) INTEGER + First index. - N0 (input) INTEGER - Last index. + N0 (input) INTEGER + Last index. - Z (input) DOUBLE PRECISION array, dimension ( 4*N ) - Z holds the qd array. EMIN is stored in Z(4*N0) to avoid - an extra argument. + Z (input) DOUBLE PRECISION array, dimension ( 4*N ) + Z holds the qd array. EMIN is stored in Z(4*N0) to avoid + an extra argument. - PP (input) INTEGER - PP=0 for ping, PP=1 for pong. + PP (input) INTEGER + PP=0 for ping, PP=1 for pong. - TAU (input) DOUBLE PRECISION - This is the shift. + TAU (input) DOUBLE PRECISION + This is the shift. - DMIN (output) DOUBLE PRECISION - Minimum value of d. + DMIN (output) DOUBLE PRECISION + Minimum value of d. - DMIN1 (output) DOUBLE PRECISION - Minimum value of d, excluding D( N0 ). + DMIN1 (output) DOUBLE PRECISION + Minimum value of d, excluding D( N0 ). - DMIN2 (output) DOUBLE PRECISION - Minimum value of d, excluding D( N0 ) and D( N0-1 ). + DMIN2 (output) DOUBLE PRECISION + Minimum value of d, excluding D( N0 ) and D( N0-1 ). - DN (output) DOUBLE PRECISION - d(N0), the last value of d. + DN (output) DOUBLE PRECISION + d(N0), the last value of d. - DNM1 (output) DOUBLE PRECISION - d(N0-1). + DNM1 (output) DOUBLE PRECISION + d(N0-1). - DNM2 (output) DOUBLE PRECISION - d(N0-2). + DNM2 (output) DOUBLE PRECISION + d(N0-2). - IEEE (input) LOGICAL - Flag for IEEE or non IEEE arithmetic. + IEEE (input) LOGICAL + Flag for IEEE or non IEEE arithmetic. - ===================================================================== + ===================================================================== Parameter adjustments */ @@ -73,8 +73,8 @@ extern "C" { integer i__1; doublereal d__1, d__2; /* Local variables */ - static doublereal emin, temp, d__; - static integer j4, j4p2; + doublereal emin, temp, d__; + integer j4, j4p2; --z__; diff --git a/external/hypre/src/lapack/dlasq6.c b/external/hypre/src/lapack/dlasq6.c index e72a7bc8..0d4b95ad 100644 --- a/external/hypre/src/lapack/dlasq6.c +++ b/external/hypre/src/lapack/dlasq6.c @@ -22,11 +22,11 @@ extern "C" { doublereal d__1, d__2; /* Local variables */ - static doublereal emin, temp, d__; - static integer j4; + doublereal emin, temp, d__; + integer j4; extern doublereal dlamch_(const char *); - static doublereal safmin; - static integer j4p2; + doublereal safmin; + integer j4p2; /* -- LAPACK auxiliary routine (version 3.0) -- diff --git a/external/hypre/src/lapack/dlasr.c b/external/hypre/src/lapack/dlasr.c index 62b2ba83..07d73f9d 100644 --- a/external/hypre/src/lapack/dlasr.c +++ b/external/hypre/src/lapack/dlasr.c @@ -12,114 +12,114 @@ extern "C" { integer *n, doublereal *c__, doublereal *s, doublereal *a, integer * lda) { -/* -- LAPACK auxiliary routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - October 31, 1992 +/* -- LAPACK auxiliary routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + October 31, 1992 - Purpose - ======= + Purpose + ======= - DLASR performs the transformation + DLASR performs the transformation - A := P*A, when SIDE = 'L' or 'l' ( Left-hand side ) + A := P*A, when SIDE = 'L' or 'l' ( Left-hand side ) - A := A*P', when SIDE = 'R' or 'r' ( Right-hand side ) + A := A*P', when SIDE = 'R' or 'r' ( Right-hand side ) - where A is an m by n real matrix and P is an orthogonal matrix, - consisting of a sequence of plane rotations determined by the - parameters PIVOT and DIRECT as follows ( z = m when SIDE = 'L' or 'l' - and z = n when SIDE = 'R' or 'r' ): + where A is an m by n real matrix and P is an orthogonal matrix, + consisting of a sequence of plane rotations determined by the + parameters PIVOT and DIRECT as follows ( z = m when SIDE = 'L' or 'l' + and z = n when SIDE = 'R' or 'r' ): - When DIRECT = 'F' or 'f' ( Forward sequence ) then + When DIRECT = 'F' or 'f' ( Forward sequence ) then - P = P( z - 1 )*...*P( 2 )*P( 1 ), + P = P( z - 1 )*...*P( 2 )*P( 1 ), - and when DIRECT = 'B' or 'b' ( Backward sequence ) then + and when DIRECT = 'B' or 'b' ( Backward sequence ) then - P = P( 1 )*P( 2 )*...*P( z - 1 ), + P = P( 1 )*P( 2 )*...*P( z - 1 ), - where P( k ) is a plane rotation matrix for the following planes: + where P( k ) is a plane rotation matrix for the following planes: - when PIVOT = 'V' or 'v' ( Variable pivot ), - the plane ( k, k + 1 ) + when PIVOT = 'V' or 'v' ( Variable pivot ), + the plane ( k, k + 1 ) - when PIVOT = 'T' or 't' ( Top pivot ), - the plane ( 1, k + 1 ) + when PIVOT = 'T' or 't' ( Top pivot ), + the plane ( 1, k + 1 ) - when PIVOT = 'B' or 'b' ( Bottom pivot ), - the plane ( k, z ) + when PIVOT = 'B' or 'b' ( Bottom pivot ), + the plane ( k, z ) - c( k ) and s( k ) must contain the cosine and sine that define the - matrix P( k ). The two by two plane rotation part of the matrix - P( k ), R( k ), is assumed to be of the form + c( k ) and s( k ) must contain the cosine and sine that define the + matrix P( k ). The two by two plane rotation part of the matrix + P( k ), R( k ), is assumed to be of the form - R( k ) = ( c( k ) s( k ) ). - ( -s( k ) c( k ) ) + R( k ) = ( c( k ) s( k ) ). + ( -s( k ) c( k ) ) - This version vectorises across rows of the array A when SIDE = 'L'. + This version vectorises across rows of the array A when SIDE = 'L'. - Arguments - ========= + Arguments + ========= - SIDE (input) CHARACTER*1 - Specifies whether the plane rotation matrix P is applied to - A on the left or the right. - = 'L': Left, compute A := P*A - = 'R': Right, compute A:= A*P' + SIDE (input) CHARACTER*1 + Specifies whether the plane rotation matrix P is applied to + A on the left or the right. + = 'L': Left, compute A := P*A + = 'R': Right, compute A:= A*P' - DIRECT (input) CHARACTER*1 - Specifies whether P is a forward or backward sequence of - plane rotations. - = 'F': Forward, P = P( z - 1 )*...*P( 2 )*P( 1 ) - = 'B': Backward, P = P( 1 )*P( 2 )*...*P( z - 1 ) + DIRECT (input) CHARACTER*1 + Specifies whether P is a forward or backward sequence of + plane rotations. + = 'F': Forward, P = P( z - 1 )*...*P( 2 )*P( 1 ) + = 'B': Backward, P = P( 1 )*P( 2 )*...*P( z - 1 ) - PIVOT (input) CHARACTER*1 - Specifies the plane for which P(k) is a plane rotation - matrix. - = 'V': Variable pivot, the plane (k,k+1) - = 'T': Top pivot, the plane (1,k+1) - = 'B': Bottom pivot, the plane (k,z) + PIVOT (input) CHARACTER*1 + Specifies the plane for which P(k) is a plane rotation + matrix. + = 'V': Variable pivot, the plane (k,k+1) + = 'T': Top pivot, the plane (1,k+1) + = 'B': Bottom pivot, the plane (k,z) - M (input) INTEGER - The number of rows of the matrix A. If m <= 1, an immediate - return is effected. + M (input) INTEGER + The number of rows of the matrix A. If m <= 1, an immediate + return is effected. - N (input) INTEGER - The number of columns of the matrix A. If n <= 1, an - immediate return is effected. + N (input) INTEGER + The number of columns of the matrix A. If n <= 1, an + immediate return is effected. - C, S (input) DOUBLE PRECISION arrays, dimension - (M-1) if SIDE = 'L' - (N-1) if SIDE = 'R' - c(k) and s(k) contain the cosine and sine that define the - matrix P(k). The two by two plane rotation part of the - matrix P(k), R(k), is assumed to be of the form - R( k ) = ( c( k ) s( k ) ). - ( -s( k ) c( k ) ) + C, S (input) DOUBLE PRECISION arrays, dimension + (M-1) if SIDE = 'L' + (N-1) if SIDE = 'R' + c(k) and s(k) contain the cosine and sine that define the + matrix P(k). The two by two plane rotation part of the + matrix P(k), R(k), is assumed to be of the form + R( k ) = ( c( k ) s( k ) ). + ( -s( k ) c( k ) ) - A (input/output) DOUBLE PRECISION array, dimension (LDA,N) - The m by n matrix A. On exit, A is overwritten by P*A if - SIDE = 'R' or by A*P' if SIDE = 'L'. + A (input/output) DOUBLE PRECISION array, dimension (LDA,N) + The m by n matrix A. On exit, A is overwritten by P*A if + SIDE = 'R' or by A*P' if SIDE = 'L'. - LDA (input) INTEGER - The leading dimension of the array A. LDA >= max(1,M). + LDA (input) INTEGER + The leading dimension of the array A. LDA >= max(1,M). - ===================================================================== + ===================================================================== - Test the input parameters + Test the input parameters Parameter adjustments */ /* System generated locals */ integer a_dim1, a_offset, i__1, i__2; /* Local variables */ - static integer info; - static doublereal temp; - static integer i__, j; + integer info; + doublereal temp; + integer i__, j; extern logical lsame_(const char *,const char *); - static doublereal ctemp, stemp; + doublereal ctemp, stemp; extern /* Subroutine */ integer xerbla_(const char *, integer *); #define a_ref(a_1,a_2) a[(a_2)*a_dim1 + a_1] @@ -133,10 +133,10 @@ extern "C" { info = 0; if (! (lsame_(side, "L") || lsame_(side, "R"))) { info = 1; - } else if (! (lsame_(pivot, "V") || lsame_(pivot, + } else if (! (lsame_(pivot, "V") || lsame_(pivot, "T") || lsame_(pivot, "B"))) { info = 2; - } else if (! (lsame_(direct, "F") || lsame_(direct, + } else if (! (lsame_(direct, "F") || lsame_(direct, "B"))) { info = 3; } else if (*m < 0) { @@ -172,7 +172,7 @@ extern "C" { temp = a_ref(j + 1, i__); a_ref(j + 1, i__) = ctemp * temp - stemp * a_ref( j, i__); - a_ref(j, i__) = stemp * temp + ctemp * a_ref(j, + a_ref(j, i__) = stemp * temp + ctemp * a_ref(j, i__); /* L10: */ } @@ -189,7 +189,7 @@ extern "C" { temp = a_ref(j + 1, i__); a_ref(j + 1, i__) = ctemp * temp - stemp * a_ref( j, i__); - a_ref(j, i__) = stemp * temp + ctemp * a_ref(j, + a_ref(j, i__) = stemp * temp + ctemp * a_ref(j, i__); /* L30: */ } @@ -207,9 +207,9 @@ extern "C" { i__2 = *n; for (i__ = 1; i__ <= i__2; ++i__) { temp = a_ref(j, i__); - a_ref(j, i__) = ctemp * temp - stemp * a_ref(1, + a_ref(j, i__) = ctemp * temp - stemp * a_ref(1, i__); - a_ref(1, i__) = stemp * temp + ctemp * a_ref(1, + a_ref(1, i__) = stemp * temp + ctemp * a_ref(1, i__); /* L50: */ } @@ -224,9 +224,9 @@ extern "C" { i__1 = *n; for (i__ = 1; i__ <= i__1; ++i__) { temp = a_ref(j, i__); - a_ref(j, i__) = ctemp * temp - stemp * a_ref(1, + a_ref(j, i__) = ctemp * temp - stemp * a_ref(1, i__); - a_ref(1, i__) = stemp * temp + ctemp * a_ref(1, + a_ref(1, i__) = stemp * temp + ctemp * a_ref(1, i__); /* L70: */ } @@ -244,9 +244,9 @@ extern "C" { i__2 = *n; for (i__ = 1; i__ <= i__2; ++i__) { temp = a_ref(j, i__); - a_ref(j, i__) = stemp * a_ref(*m, i__) + ctemp * + a_ref(j, i__) = stemp * a_ref(*m, i__) + ctemp * temp; - a_ref(*m, i__) = ctemp * a_ref(*m, i__) - stemp * + a_ref(*m, i__) = ctemp * a_ref(*m, i__) - stemp * temp; /* L90: */ } @@ -261,9 +261,9 @@ extern "C" { i__1 = *n; for (i__ = 1; i__ <= i__1; ++i__) { temp = a_ref(j, i__); - a_ref(j, i__) = stemp * a_ref(*m, i__) + ctemp * + a_ref(j, i__) = stemp * a_ref(*m, i__) + ctemp * temp; - a_ref(*m, i__) = ctemp * a_ref(*m, i__) - stemp * + a_ref(*m, i__) = ctemp * a_ref(*m, i__) - stemp * temp; /* L110: */ } @@ -288,7 +288,7 @@ extern "C" { temp = a_ref(i__, j + 1); a_ref(i__, j + 1) = ctemp * temp - stemp * a_ref( i__, j); - a_ref(i__, j) = stemp * temp + ctemp * a_ref(i__, + a_ref(i__, j) = stemp * temp + ctemp * a_ref(i__, j); /* L130: */ } @@ -305,7 +305,7 @@ extern "C" { temp = a_ref(i__, j + 1); a_ref(i__, j + 1) = ctemp * temp - stemp * a_ref( i__, j); - a_ref(i__, j) = stemp * temp + ctemp * a_ref(i__, + a_ref(i__, j) = stemp * temp + ctemp * a_ref(i__, j); /* L150: */ } @@ -323,9 +323,9 @@ extern "C" { i__2 = *m; for (i__ = 1; i__ <= i__2; ++i__) { temp = a_ref(i__, j); - a_ref(i__, j) = ctemp * temp - stemp * a_ref(i__, + a_ref(i__, j) = ctemp * temp - stemp * a_ref(i__, 1); - a_ref(i__, 1) = stemp * temp + ctemp * a_ref(i__, + a_ref(i__, 1) = stemp * temp + ctemp * a_ref(i__, 1); /* L170: */ } @@ -340,9 +340,9 @@ extern "C" { i__1 = *m; for (i__ = 1; i__ <= i__1; ++i__) { temp = a_ref(i__, j); - a_ref(i__, j) = ctemp * temp - stemp * a_ref(i__, + a_ref(i__, j) = ctemp * temp - stemp * a_ref(i__, 1); - a_ref(i__, 1) = stemp * temp + ctemp * a_ref(i__, + a_ref(i__, 1) = stemp * temp + ctemp * a_ref(i__, 1); /* L190: */ } @@ -360,9 +360,9 @@ extern "C" { i__2 = *m; for (i__ = 1; i__ <= i__2; ++i__) { temp = a_ref(i__, j); - a_ref(i__, j) = stemp * a_ref(i__, *n) + ctemp * + a_ref(i__, j) = stemp * a_ref(i__, *n) + ctemp * temp; - a_ref(i__, *n) = ctemp * a_ref(i__, *n) - stemp * + a_ref(i__, *n) = ctemp * a_ref(i__, *n) - stemp * temp; /* L210: */ } @@ -377,9 +377,9 @@ extern "C" { i__1 = *m; for (i__ = 1; i__ <= i__1; ++i__) { temp = a_ref(i__, j); - a_ref(i__, j) = stemp * a_ref(i__, *n) + ctemp * + a_ref(i__, j) = stemp * a_ref(i__, *n) + ctemp * temp; - a_ref(i__, *n) = ctemp * a_ref(i__, *n) - stemp * + a_ref(i__, *n) = ctemp * a_ref(i__, *n) - stemp * temp; /* L230: */ } diff --git a/external/hypre/src/lapack/dlasrt.c b/external/hypre/src/lapack/dlasrt.c index 70b85d8c..68a6c06f 100644 --- a/external/hypre/src/lapack/dlasrt.c +++ b/external/hypre/src/lapack/dlasrt.c @@ -11,58 +11,58 @@ extern "C" { /* Subroutine */ integer dlasrt_(const char *id, integer *n, doublereal *d__, integer * info) { -/* -- LAPACK routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - September 30, 1994 +/* -- LAPACK routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + September 30, 1994 - Purpose - ======= + Purpose + ======= - Sort the numbers in D in increasing order (if ID = 'I') or - in decreasing order (if ID = 'D' ). + Sort the numbers in D in increasing order (if ID = 'I') or + in decreasing order (if ID = 'D' ). - Use Quick Sort, reverting to Insertion sort on arrays of - size <= 20. Dimension of STACK limits N to about 2**32. + Use Quick Sort, reverting to Insertion sort on arrays of + size <= 20. Dimension of STACK limits N to about 2**32. - Arguments - ========= + Arguments + ========= - ID (input) CHARACTER*1 - = 'I': sort D in increasing order; - = 'D': sort D in decreasing order. + ID (input) CHARACTER*1 + = 'I': sort D in increasing order; + = 'D': sort D in decreasing order. - N (input) INTEGER - The length of the array D. + N (input) INTEGER + The length of the array D. - D (input/output) DOUBLE PRECISION array, dimension (N) - On entry, the array to be sorted. - On exit, D has been sorted into increasing order - (D(1) <= ... <= D(N) ) or into decreasing order - (D(1) >= ... >= D(N) ), depending on ID. + D (input/output) DOUBLE PRECISION array, dimension (N) + On entry, the array to be sorted. + On exit, D has been sorted into increasing order + (D(1) <= ... <= D(N) ) or into decreasing order + (D(1) >= ... >= D(N) ), depending on ID. - INFO (output) INTEGER - = 0: successful exit - < 0: if INFO = -i, the i-th argument had an illegal value + INFO (output) INTEGER + = 0: successful exit + < 0: if INFO = -i, the i-th argument had an illegal value - ===================================================================== + ===================================================================== - Test the input paramters. + Test the input paramters. Parameter adjustments */ /* System generated locals */ integer i__1, i__2; /* Local variables */ - static integer endd, i__, j; + integer endd, i__, j; extern logical lsame_(const char *,const char *); - static integer stack[64] /* was [2][32] */; - static doublereal dmnmx, d1, d2, d3; - static integer start; + integer stack[64] /* was [2][32] */; + doublereal dmnmx, d1, d2, d3; + integer start; extern /* Subroutine */ integer xerbla_(const char *, integer *); - static integer stkpnt, dir; - static doublereal tmp; + integer stkpnt, dir; + doublereal tmp; #define stack_ref(a_1,a_2) stack[(a_2)*2 + a_1 - 3] --d__; @@ -149,7 +149,7 @@ extern "C" { } else if (endd - start > 20) { -/* Partition D( START:ENDD ) and stack parts, largest one first +/* Partition D( START:ENDD ) and stack parts, largest one first Choose partition entry as median of 3 */ diff --git a/external/hypre/src/lapack/dlassq.c b/external/hypre/src/lapack/dlassq.c index 2eed9d3b..ba0e2c5f 100644 --- a/external/hypre/src/lapack/dlassq.c +++ b/external/hypre/src/lapack/dlassq.c @@ -8,57 +8,57 @@ extern "C" { #include "f2c.h" #include "hypre_lapack.h" -/* Subroutine */ integer dlassq_(integer *n, doublereal *x, integer *incx, +/* Subroutine */ integer dlassq_(integer *n, doublereal *x, integer *incx, doublereal *scale, doublereal *sumsq) { -/* -- LAPACK auxiliary routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - June 30, 1999 +/* -- LAPACK auxiliary routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + June 30, 1999 - Purpose - ======= + Purpose + ======= - DLASSQ returns the values scl and smsq such that + DLASSQ returns the values scl and smsq such that - ( scl**2 )*smsq = x( 1 )**2 +...+ x( n )**2 + ( scale**2 )*sumsq, + ( scl**2 )*smsq = x( 1 )**2 +...+ x( n )**2 + ( scale**2 )*sumsq, - where x( i ) = X( 1 + ( i - 1 )*INCX ). The value of sumsq is - assumed to be non-negative and scl returns the value + where x( i ) = X( 1 + ( i - 1 )*INCX ). The value of sumsq is + assumed to be non-negative and scl returns the value - scl = max( scale, abs( x( i ) ) ). + scl = max( scale, abs( x( i ) ) ). - scale and sumsq must be supplied in SCALE and SUMSQ and - scl and smsq are overwritten on SCALE and SUMSQ respectively. + scale and sumsq must be supplied in SCALE and SUMSQ and + scl and smsq are overwritten on SCALE and SUMSQ respectively. - The routine makes only one pass through the vector x. + The routine makes only one pass through the vector x. - Arguments - ========= + Arguments + ========= - N (input) INTEGER - The number of elements to be used from the vector X. + N (input) INTEGER + The number of elements to be used from the vector X. - X (input) DOUBLE PRECISION array, dimension (N) - The vector for which a scaled sum of squares is computed. - x( i ) = X( 1 + ( i - 1 )*INCX ), 1 <= i <= n. + X (input) DOUBLE PRECISION array, dimension (N) + The vector for which a scaled sum of squares is computed. + x( i ) = X( 1 + ( i - 1 )*INCX ), 1 <= i <= n. - INCX (input) INTEGER - The increment between successive values of the vector X. - INCX > 0. + INCX (input) INTEGER + The increment between successive values of the vector X. + INCX > 0. - SCALE (input/output) DOUBLE PRECISION - On entry, the value scale in the equation above. - On exit, SCALE is overwritten with scl , the scaling factor - for the sum of squares. + SCALE (input/output) DOUBLE PRECISION + On entry, the value scale in the equation above. + On exit, SCALE is overwritten with scl , the scaling factor + for the sum of squares. - SUMSQ (input/output) DOUBLE PRECISION - On entry, the value sumsq in the equation above. - On exit, SUMSQ is overwritten with smsq , the basic sum of - squares from which scl has been factored out. + SUMSQ (input/output) DOUBLE PRECISION + On entry, the value sumsq in the equation above. + On exit, SUMSQ is overwritten with smsq , the basic sum of + squares from which scl has been factored out. - ===================================================================== + ===================================================================== Parameter adjustments */ @@ -66,8 +66,8 @@ extern "C" { integer i__1, i__2; doublereal d__1; /* Local variables */ - static doublereal absxi; - static integer ix; + doublereal absxi; + integer ix; --x; diff --git a/external/hypre/src/lapack/dlasv2.c b/external/hypre/src/lapack/dlasv2.c index fe55cdd9..c00dfa23 100644 --- a/external/hypre/src/lapack/dlasv2.c +++ b/external/hypre/src/lapack/dlasv2.c @@ -8,97 +8,97 @@ extern "C" { #include "f2c.h" #include "hypre_lapack.h" -/* Subroutine */ integer dlasv2_(doublereal *f, doublereal *g, doublereal *h__, +/* Subroutine */ integer dlasv2_(doublereal *f, doublereal *g, doublereal *h__, doublereal *ssmin, doublereal *ssmax, doublereal *snr, doublereal * csr, doublereal *snl, doublereal *csl) { -/* -- LAPACK auxiliary routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - October 31, 1992 +/* -- LAPACK auxiliary routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + October 31, 1992 - Purpose - ======= + Purpose + ======= - DLASV2 computes the singular value decomposition of a 2-by-2 - triangular matrix - [ F G ] - [ 0 H ]. - On return, abs(SSMAX) is the larger singular value, abs(SSMIN) is the - smaller singular value, and (CSL,SNL) and (CSR,SNR) are the left and - right singular vectors for abs(SSMAX), giving the decomposition + DLASV2 computes the singular value decomposition of a 2-by-2 + triangular matrix + [ F G ] + [ 0 H ]. + On return, abs(SSMAX) is the larger singular value, abs(SSMIN) is the + smaller singular value, and (CSL,SNL) and (CSR,SNR) are the left and + right singular vectors for abs(SSMAX), giving the decomposition - [ CSL SNL ] [ F G ] [ CSR -SNR ] = [ SSMAX 0 ] - [-SNL CSL ] [ 0 H ] [ SNR CSR ] [ 0 SSMIN ]. + [ CSL SNL ] [ F G ] [ CSR -SNR ] = [ SSMAX 0 ] + [-SNL CSL ] [ 0 H ] [ SNR CSR ] [ 0 SSMIN ]. - Arguments - ========= + Arguments + ========= - F (input) DOUBLE PRECISION - The (1,1) element of the 2-by-2 matrix. + F (input) DOUBLE PRECISION + The (1,1) element of the 2-by-2 matrix. - G (input) DOUBLE PRECISION - The (1,2) element of the 2-by-2 matrix. + G (input) DOUBLE PRECISION + The (1,2) element of the 2-by-2 matrix. - H (input) DOUBLE PRECISION - The (2,2) element of the 2-by-2 matrix. + H (input) DOUBLE PRECISION + The (2,2) element of the 2-by-2 matrix. - SSMIN (output) DOUBLE PRECISION - abs(SSMIN) is the smaller singular value. + SSMIN (output) DOUBLE PRECISION + abs(SSMIN) is the smaller singular value. - SSMAX (output) DOUBLE PRECISION - abs(SSMAX) is the larger singular value. + SSMAX (output) DOUBLE PRECISION + abs(SSMAX) is the larger singular value. - SNL (output) DOUBLE PRECISION - CSL (output) DOUBLE PRECISION - The vector (CSL, SNL) is a unit left singular vector for the - singular value abs(SSMAX). + SNL (output) DOUBLE PRECISION + CSL (output) DOUBLE PRECISION + The vector (CSL, SNL) is a unit left singular vector for the + singular value abs(SSMAX). - SNR (output) DOUBLE PRECISION - CSR (output) DOUBLE PRECISION - The vector (CSR, SNR) is a unit right singular vector for the - singular value abs(SSMAX). + SNR (output) DOUBLE PRECISION + CSR (output) DOUBLE PRECISION + The vector (CSR, SNR) is a unit right singular vector for the + singular value abs(SSMAX). - Further Details - =============== + Further Details + =============== - Any input parameter may be aliased with any output parameter. + Any input parameter may be aliased with any output parameter. - Barring over/underflow and assuming a guard digit in subtraction, all - output quantities are correct to within a few units in the last - place (ulps). + Barring over/underflow and assuming a guard digit in subtraction, all + output quantities are correct to within a few units in the last + place (ulps). - In IEEE arithmetic, the code works correctly if one matrix element is - infinite. + In IEEE arithmetic, the code works correctly if one matrix element is + infinite. - Overflow will not occur unless the largest singular value itself - overflows or is within a few ulps of overflow. (On machines with - partial overflow, like the Cray, overflow may occur if the largest - singular value is within a factor of 2 of overflow.) + Overflow will not occur unless the largest singular value itself + overflows or is within a few ulps of overflow. (On machines with + partial overflow, like the Cray, overflow may occur if the largest + singular value is within a factor of 2 of overflow.) - Underflow is harmless if underflow is gradual. Otherwise, results - may correspond to a matrix modified by perturbations of size near - the underflow threshold. + Underflow is harmless if underflow is gradual. Otherwise, results + may correspond to a matrix modified by perturbations of size near + the underflow threshold. ===================================================================== */ /* Table of constant values */ - static doublereal c_b3 = 2.; - static doublereal c_b4 = 1.; - + doublereal c_b3 = 2.; + doublereal c_b4 = 1.; + /* System generated locals */ doublereal d__1; /* Builtin functions */ doublereal d_sign(doublereal *, doublereal *); /* Local variables */ - static integer pmax; - static doublereal temp; - static logical swap; - static doublereal a, d__, l, m, r__, s, t, tsign, fa, ga, ha; + integer pmax; + doublereal temp; + logical swap; + doublereal a, d__, l, m, r__, s, t, tsign, fa, ga, ha; extern doublereal dlamch_(const char *); - static doublereal ft, gt, ht, mm; - static logical gasmal; - static doublereal tt, clt, crt, slt, srt; + doublereal ft, gt, ht, mm; + logical gasmal; + doublereal tt, clt, crt, slt, srt; @@ -108,9 +108,9 @@ extern "C" { ht = *h__; ha = abs(*h__); -/* PMAX points to the maximum absolute element of matrix - PMAX = 1 if F largest in absolute values - PMAX = 2 if G largest in absolute values +/* PMAX points to the maximum absolute element of matrix + PMAX = 1 if F largest in absolute values + PMAX = 2 if G largest in absolute values PMAX = 3 if H largest in absolute values */ pmax = 1; diff --git a/external/hypre/src/lapack/dlaswp.c b/external/hypre/src/lapack/dlaswp.c index 1a35885b..0c7f889a 100644 --- a/external/hypre/src/lapack/dlaswp.c +++ b/external/hypre/src/lapack/dlaswp.c @@ -8,69 +8,69 @@ extern "C" { #include "f2c.h" #include "hypre_lapack.h" -/* Subroutine */ integer dlaswp_(integer *n, doublereal *a, integer *lda, integer +/* Subroutine */ integer dlaswp_(integer *n, doublereal *a, integer *lda, integer *k1, integer *k2, integer *ipiv, integer *incx) { -/* -- LAPACK auxiliary routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - June 30, 1999 +/* -- LAPACK auxiliary routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + June 30, 1999 - Purpose - ======= + Purpose + ======= - DLASWP performs a series of row interchanges on the matrix A. - One row interchange is initiated for each of rows K1 through K2 of A. + DLASWP performs a series of row interchanges on the matrix A. + One row interchange is initiated for each of rows K1 through K2 of A. - Arguments - ========= + Arguments + ========= - N (input) INTEGER - The number of columns of the matrix A. + N (input) INTEGER + The number of columns of the matrix A. - A (input/output) DOUBLE PRECISION array, dimension (LDA,N) - On entry, the matrix of column dimension N to which the row - interchanges will be applied. - On exit, the permuted matrix. + A (input/output) DOUBLE PRECISION array, dimension (LDA,N) + On entry, the matrix of column dimension N to which the row + interchanges will be applied. + On exit, the permuted matrix. - LDA (input) INTEGER - The leading dimension of the array A. + LDA (input) INTEGER + The leading dimension of the array A. - K1 (input) INTEGER - The first element of IPIV for which a row interchange will - be done. + K1 (input) INTEGER + The first element of IPIV for which a row interchange will + be done. - K2 (input) INTEGER - The last element of IPIV for which a row interchange will - be done. + K2 (input) INTEGER + The last element of IPIV for which a row interchange will + be done. - IPIV (input) INTEGER array, dimension (M*abs(INCX)) - The vector of pivot indices. Only the elements in positions - K1 through K2 of IPIV are accessed. - IPIV(K) = L implies rows K and L are to be interchanged. + IPIV (input) INTEGER array, dimension (M*abs(INCX)) + The vector of pivot indices. Only the elements in positions + K1 through K2 of IPIV are accessed. + IPIV(K) = L implies rows K and L are to be interchanged. - INCX (input) INTEGER - The increment between successive values of IPIV. If IPIV - is negative, the pivots are applied in reverse order. + INCX (input) INTEGER + The increment between successive values of IPIV. If IPIV + is negative, the pivots are applied in reverse order. - Further Details - =============== + Further Details + =============== - Modified by - R. C. Whaley, Computer Science Dept., Univ. of Tenn., Knoxville, USA + Modified by + R. C. Whaley, Computer Science Dept., Univ. of Tenn., Knoxville, USA - ===================================================================== + ===================================================================== - Interchange row I with row IPIV(I) for each of rows K1 through K2. + Interchange row I with row IPIV(I) for each of rows K1 through K2. Parameter adjustments */ /* System generated locals */ integer a_dim1, a_offset, i__1, i__2, i__3, i__4; /* Local variables */ - static doublereal temp; - static integer i__, j, k, i1, i2, n32, ip, ix, ix0, inc; + doublereal temp; + integer i__, j, k, i1, i2, n32, ip, ix, ix0, inc; #define a_ref(a_1,a_2) a[(a_2)*a_dim1 + a_1] a_dim1 = *lda; @@ -100,7 +100,7 @@ extern "C" { ix = ix0; i__2 = i2; i__3 = inc; - for (i__ = i1; i__3 < 0 ? i__ >= i__2 : i__ <= i__2; i__ += i__3) + for (i__ = i1; i__3 < 0 ? i__ >= i__2 : i__ <= i__2; i__ += i__3) { ip = ipiv[ix]; if (ip != i__) { diff --git a/external/hypre/src/lapack/dlatrd.c b/external/hypre/src/lapack/dlatrd.c index 0e82a9d6..0221988d 100644 --- a/external/hypre/src/lapack/dlatrd.c +++ b/external/hypre/src/lapack/dlatrd.c @@ -9,166 +9,166 @@ extern "C" { #include "hypre_lapack.h" /* Subroutine */ integer dlatrd_(const char *uplo, integer *n, integer *nb, doublereal * - a, integer *lda, doublereal *e, doublereal *tau, doublereal *w, + a, integer *lda, doublereal *e, doublereal *tau, doublereal *w, integer *ldw) { -/* -- LAPACK auxiliary routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - October 31, 1992 +/* -- LAPACK auxiliary routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + October 31, 1992 - Purpose - ======= + Purpose + ======= - DLATRD reduces NB rows and columns of a real symmetric matrix A to - symmetric tridiagonal form by an orthogonal similarity - transformation Q' * A * Q, and returns the matrices V and W which are - needed to apply the transformation to the unreduced part of A. + DLATRD reduces NB rows and columns of a real symmetric matrix A to + symmetric tridiagonal form by an orthogonal similarity + transformation Q' * A * Q, and returns the matrices V and W which are + needed to apply the transformation to the unreduced part of A. - If UPLO = 'U', DLATRD reduces the last NB rows and columns of a - matrix, of which the upper triangle is supplied; - if UPLO = 'L', DLATRD reduces the first NB rows and columns of a - matrix, of which the lower triangle is supplied. + If UPLO = 'U', DLATRD reduces the last NB rows and columns of a + matrix, of which the upper triangle is supplied; + if UPLO = 'L', DLATRD reduces the first NB rows and columns of a + matrix, of which the lower triangle is supplied. - This is an auxiliary routine called by DSYTRD. + This is an auxiliary routine called by DSYTRD. - Arguments - ========= + Arguments + ========= - UPLO (input) CHARACTER - Specifies whether the upper or lower triangular part of the - symmetric matrix A is stored: - = 'U': Upper triangular - = 'L': Lower triangular + UPLO (input) CHARACTER + Specifies whether the upper or lower triangular part of the + symmetric matrix A is stored: + = 'U': Upper triangular + = 'L': Lower triangular - N (input) INTEGER - The order of the matrix A. + N (input) INTEGER + The order of the matrix A. - NB (input) INTEGER - The number of rows and columns to be reduced. + NB (input) INTEGER + The number of rows and columns to be reduced. - A (input/output) DOUBLE PRECISION array, dimension (LDA,N) - On entry, the symmetric matrix A. If UPLO = 'U', the leading - n-by-n upper triangular part of A contains the upper - triangular part of the matrix A, and the strictly lower - triangular part of A is not referenced. If UPLO = 'L', the - leading n-by-n lower triangular part of A contains the lower - triangular part of the matrix A, and the strictly upper - triangular part of A is not referenced. - On exit: - if UPLO = 'U', the last NB columns have been reduced to - tridiagonal form, with the diagonal elements overwriting - the diagonal elements of A; the elements above the diagonal - with the array TAU, represent the orthogonal matrix Q as a - product of elementary reflectors; - if UPLO = 'L', the first NB columns have been reduced to - tridiagonal form, with the diagonal elements overwriting - the diagonal elements of A; the elements below the diagonal - with the array TAU, represent the orthogonal matrix Q as a - product of elementary reflectors. - See Further Details. + A (input/output) DOUBLE PRECISION array, dimension (LDA,N) + On entry, the symmetric matrix A. If UPLO = 'U', the leading + n-by-n upper triangular part of A contains the upper + triangular part of the matrix A, and the strictly lower + triangular part of A is not referenced. If UPLO = 'L', the + leading n-by-n lower triangular part of A contains the lower + triangular part of the matrix A, and the strictly upper + triangular part of A is not referenced. + On exit: + if UPLO = 'U', the last NB columns have been reduced to + tridiagonal form, with the diagonal elements overwriting + the diagonal elements of A; the elements above the diagonal + with the array TAU, represent the orthogonal matrix Q as a + product of elementary reflectors; + if UPLO = 'L', the first NB columns have been reduced to + tridiagonal form, with the diagonal elements overwriting + the diagonal elements of A; the elements below the diagonal + with the array TAU, represent the orthogonal matrix Q as a + product of elementary reflectors. + See Further Details. - LDA (input) INTEGER - The leading dimension of the array A. LDA >= (1,N). + LDA (input) INTEGER + The leading dimension of the array A. LDA >= (1,N). - E (output) DOUBLE PRECISION array, dimension (N-1) - If UPLO = 'U', E(n-nb:n-1) contains the superdiagonal - elements of the last NB columns of the reduced matrix; - if UPLO = 'L', E(1:nb) contains the subdiagonal elements of - the first NB columns of the reduced matrix. + E (output) DOUBLE PRECISION array, dimension (N-1) + If UPLO = 'U', E(n-nb:n-1) contains the superdiagonal + elements of the last NB columns of the reduced matrix; + if UPLO = 'L', E(1:nb) contains the subdiagonal elements of + the first NB columns of the reduced matrix. - TAU (output) DOUBLE PRECISION array, dimension (N-1) - The scalar factors of the elementary reflectors, stored in - TAU(n-nb:n-1) if UPLO = 'U', and in TAU(1:nb) if UPLO = 'L'. - See Further Details. + TAU (output) DOUBLE PRECISION array, dimension (N-1) + The scalar factors of the elementary reflectors, stored in + TAU(n-nb:n-1) if UPLO = 'U', and in TAU(1:nb) if UPLO = 'L'. + See Further Details. - W (output) DOUBLE PRECISION array, dimension (LDW,NB) - The n-by-nb matrix W required to update the unreduced part - of A. + W (output) DOUBLE PRECISION array, dimension (LDW,NB) + The n-by-nb matrix W required to update the unreduced part + of A. - LDW (input) INTEGER - The leading dimension of the array W. LDW >= max(1,N). + LDW (input) INTEGER + The leading dimension of the array W. LDW >= max(1,N). - Further Details - =============== + Further Details + =============== - If UPLO = 'U', the matrix Q is represented as a product of elementary - reflectors + If UPLO = 'U', the matrix Q is represented as a product of elementary + reflectors - Q = H(n) H(n-1) . . . H(n-nb+1). + Q = H(n) H(n-1) . . . H(n-nb+1). - Each H(i) has the form + Each H(i) has the form - H(i) = I - tau * v * v' + H(i) = I - tau * v * v' - where tau is a real scalar, and v is a real vector with - v(i:n) = 0 and v(i-1) = 1; v(1:i-1) is stored on exit in A(1:i-1,i), - and tau in TAU(i-1). + where tau is a real scalar, and v is a real vector with + v(i:n) = 0 and v(i-1) = 1; v(1:i-1) is stored on exit in A(1:i-1,i), + and tau in TAU(i-1). - If UPLO = 'L', the matrix Q is represented as a product of elementary - reflectors + If UPLO = 'L', the matrix Q is represented as a product of elementary + reflectors - Q = H(1) H(2) . . . H(nb). + Q = H(1) H(2) . . . H(nb). - Each H(i) has the form + Each H(i) has the form - H(i) = I - tau * v * v' + H(i) = I - tau * v * v' - where tau is a real scalar, and v is a real vector with - v(1:i) = 0 and v(i+1) = 1; v(i+1:n) is stored on exit in A(i+1:n,i), - and tau in TAU(i). + where tau is a real scalar, and v is a real vector with + v(1:i) = 0 and v(i+1) = 1; v(i+1:n) is stored on exit in A(i+1:n,i), + and tau in TAU(i). - The elements of the vectors v together form the n-by-nb matrix V - which is needed, with W, to apply the transformation to the unreduced - part of the matrix, using a symmetric rank-2k update of the form: - A := A - V*W' - W*V'. + The elements of the vectors v together form the n-by-nb matrix V + which is needed, with W, to apply the transformation to the unreduced + part of the matrix, using a symmetric rank-2k update of the form: + A := A - V*W' - W*V'. - The contents of A on exit are illustrated by the following examples - with n = 5 and nb = 2: + The contents of A on exit are illustrated by the following examples + with n = 5 and nb = 2: - if UPLO = 'U': if UPLO = 'L': + if UPLO = 'U': if UPLO = 'L': - ( a a a v4 v5 ) ( d ) - ( a a v4 v5 ) ( 1 d ) - ( a 1 v5 ) ( v1 1 a ) - ( d 1 ) ( v1 v2 a a ) - ( d ) ( v1 v2 a a a ) + ( a a a v4 v5 ) ( d ) + ( a a v4 v5 ) ( 1 d ) + ( a 1 v5 ) ( v1 1 a ) + ( d 1 ) ( v1 v2 a a ) + ( d ) ( v1 v2 a a a ) - where d denotes a diagonal element of the reduced matrix, a denotes - an element of the original matrix that is unchanged, and vi denotes - an element of the vector defining H(i). + where d denotes a diagonal element of the reduced matrix, a denotes + an element of the original matrix that is unchanged, and vi denotes + an element of the vector defining H(i). - ===================================================================== + ===================================================================== - Quick return if possible + Quick return if possible Parameter adjustments */ /* Table of constant values */ - static doublereal c_b5 = -1.; - static doublereal c_b6 = 1.; - static integer c__1 = 1; - static doublereal c_b16 = 0.; - + doublereal c_b5 = -1.; + doublereal c_b6 = 1.; + integer c__1 = 1; + doublereal c_b16 = 0.; + /* System generated locals */ integer a_dim1, a_offset, w_dim1, w_offset, i__1, i__2, i__3; /* Local variables */ - extern doublereal ddot_(integer *, doublereal *, integer *, doublereal *, + extern doublereal ddot_(integer *, doublereal *, integer *, doublereal *, integer *); - static integer i__; - static doublereal alpha; - extern /* Subroutine */ integer dscal_(integer *, doublereal *, doublereal *, + integer i__; + doublereal alpha; + extern /* Subroutine */ integer dscal_(integer *, doublereal *, doublereal *, integer *); extern logical lsame_(const char *,const char *); - extern /* Subroutine */ integer dgemv_(const char *, integer *, integer *, - doublereal *, doublereal *, integer *, doublereal *, integer *, - doublereal *, doublereal *, integer *), daxpy_(integer *, - doublereal *, doublereal *, integer *, doublereal *, integer *), - dsymv_(const char *, integer *, doublereal *, doublereal *, integer *, + extern /* Subroutine */ integer dgemv_(const char *, integer *, integer *, + doublereal *, doublereal *, integer *, doublereal *, integer *, + doublereal *, doublereal *, integer *), daxpy_(integer *, + doublereal *, doublereal *, integer *, doublereal *, integer *), + dsymv_(const char *, integer *, doublereal *, doublereal *, integer *, doublereal *, integer *, doublereal *, doublereal *, integer *), dlarfg_(integer *, doublereal *, doublereal *, integer *, doublereal *); - static integer iw; + integer iw; #define a_ref(a_1,a_2) a[(a_2)*a_dim1 + a_1] #define w_ref(a_1,a_2) w[(a_2)*w_dim1 + a_1] @@ -203,13 +203,13 @@ extern "C" { lda, &w_ref(i__, iw + 1), ldw, &c_b6, &a_ref(1, i__), &c__1); i__2 = *n - i__; - dgemv_("No transpose", &i__, &i__2, &c_b5, &w_ref(1, iw + 1), + dgemv_("No transpose", &i__, &i__2, &c_b5, &w_ref(1, iw + 1), ldw, &a_ref(i__, i__ + 1), lda, &c_b6, &a_ref(1, i__), &c__1); } if (i__ > 1) { -/* Generate elementary reflector H(i) to annihilate +/* Generate elementary reflector H(i) to annihilate A(1:i-2,i) */ i__2 = i__ - 1; @@ -221,27 +221,27 @@ extern "C" { /* Compute W(1:i-1,i) */ i__2 = i__ - 1; - dsymv_("Upper", &i__2, &c_b6, &a[a_offset], lda, &a_ref(1, + dsymv_("Upper", &i__2, &c_b6, &a[a_offset], lda, &a_ref(1, i__), &c__1, &c_b16, &w_ref(1, iw), &c__1); if (i__ < *n) { i__2 = i__ - 1; i__3 = *n - i__; dgemv_("Transpose", &i__2, &i__3, &c_b6, &w_ref(1, iw + 1) - , ldw, &a_ref(1, i__), &c__1, &c_b16, &w_ref(i__ + , ldw, &a_ref(1, i__), &c__1, &c_b16, &w_ref(i__ + 1, iw), &c__1); i__2 = i__ - 1; i__3 = *n - i__; - dgemv_("No transpose", &i__2, &i__3, &c_b5, &a_ref(1, i__ + dgemv_("No transpose", &i__2, &i__3, &c_b5, &a_ref(1, i__ + 1), lda, &w_ref(i__ + 1, iw), &c__1, &c_b6, & w_ref(1, iw), &c__1); i__2 = i__ - 1; i__3 = *n - i__; - dgemv_("Transpose", &i__2, &i__3, &c_b6, &a_ref(1, i__ + + dgemv_("Transpose", &i__2, &i__3, &c_b6, &a_ref(1, i__ + 1), lda, &a_ref(1, i__), &c__1, &c_b16, &w_ref( i__ + 1, iw), &c__1); i__2 = i__ - 1; i__3 = *n - i__; - dgemv_("No transpose", &i__2, &i__3, &c_b5, &w_ref(1, iw + dgemv_("No transpose", &i__2, &i__3, &c_b5, &w_ref(1, iw + 1), ldw, &w_ref(i__ + 1, iw), &c__1, &c_b6, & w_ref(1, iw), &c__1); } @@ -276,8 +276,8 @@ extern "C" { a_ref(i__, 1), lda, &c_b6, &a_ref(i__, i__), &c__1); if (i__ < *n) { -/* Generate elementary reflector H(i) to annihilate - A(i+2:n,i) +/* Generate elementary reflector H(i) to annihilate + A(i+2:n,i) Computing MIN */ i__2 = i__ + 2; @@ -291,27 +291,27 @@ extern "C" { i__2 = *n - i__; dsymv_("Lower", &i__2, &c_b6, &a_ref(i__ + 1, i__ + 1), lda, & - a_ref(i__ + 1, i__), &c__1, &c_b16, &w_ref(i__ + 1, + a_ref(i__ + 1, i__), &c__1, &c_b16, &w_ref(i__ + 1, i__), &c__1); i__2 = *n - i__; i__3 = i__ - 1; - dgemv_("Transpose", &i__2, &i__3, &c_b6, &w_ref(i__ + 1, 1), - ldw, &a_ref(i__ + 1, i__), &c__1, &c_b16, &w_ref(1, + dgemv_("Transpose", &i__2, &i__3, &c_b6, &w_ref(i__ + 1, 1), + ldw, &a_ref(i__ + 1, i__), &c__1, &c_b16, &w_ref(1, i__), &c__1); i__2 = *n - i__; i__3 = i__ - 1; dgemv_("No transpose", &i__2, &i__3, &c_b5, &a_ref(i__ + 1, 1) - , lda, &w_ref(1, i__), &c__1, &c_b6, &w_ref(i__ + 1, + , lda, &w_ref(1, i__), &c__1, &c_b6, &w_ref(i__ + 1, i__), &c__1); i__2 = *n - i__; i__3 = i__ - 1; - dgemv_("Transpose", &i__2, &i__3, &c_b6, &a_ref(i__ + 1, 1), - lda, &a_ref(i__ + 1, i__), &c__1, &c_b16, &w_ref(1, + dgemv_("Transpose", &i__2, &i__3, &c_b6, &a_ref(i__ + 1, 1), + lda, &a_ref(i__ + 1, i__), &c__1, &c_b16, &w_ref(1, i__), &c__1); i__2 = *n - i__; i__3 = i__ - 1; dgemv_("No transpose", &i__2, &i__3, &c_b5, &w_ref(i__ + 1, 1) - , ldw, &w_ref(1, i__), &c__1, &c_b6, &w_ref(i__ + 1, + , ldw, &w_ref(1, i__), &c__1, &c_b6, &w_ref(i__ + 1, i__), &c__1); i__2 = *n - i__; dscal_(&i__2, &tau[i__], &w_ref(i__ + 1, i__), &c__1); @@ -319,7 +319,7 @@ extern "C" { alpha = tau[i__] * -.5 * ddot_(&i__2, &w_ref(i__ + 1, i__), & c__1, &a_ref(i__ + 1, i__), &c__1); i__2 = *n - i__; - daxpy_(&i__2, &alpha, &a_ref(i__ + 1, i__), &c__1, &w_ref(i__ + daxpy_(&i__2, &alpha, &a_ref(i__ + 1, i__), &c__1, &w_ref(i__ + 1, i__), &c__1); } diff --git a/external/hypre/src/lapack/dorg2l.c b/external/hypre/src/lapack/dorg2l.c index 39f99b5b..acbd3c67 100644 --- a/external/hypre/src/lapack/dorg2l.c +++ b/external/hypre/src/lapack/dorg2l.c @@ -68,17 +68,17 @@ extern "C" { Parameter adjustments */ /* Table of constant values */ - static integer c__1 = 1; + integer c__1 = 1; /* System generated locals */ integer a_dim1, a_offset, i__1, i__2, i__3; doublereal d__1; /* Local variables */ - static integer i__, j, l; + integer i__, j, l; extern /* Subroutine */ integer dscal_(integer *, doublereal *, doublereal *, integer *), dlarf_(const char *, integer *, integer *, doublereal *, integer *, doublereal *, doublereal *, integer *, doublereal *); - static integer ii; + integer ii; extern /* Subroutine */ integer xerbla_(const char *, integer *); #define a_ref(a_1,a_2) a[(a_2)*a_dim1 + a_1] diff --git a/external/hypre/src/lapack/dorg2r.c b/external/hypre/src/lapack/dorg2r.c index b3a1314e..e06eb51f 100644 --- a/external/hypre/src/lapack/dorg2r.c +++ b/external/hypre/src/lapack/dorg2r.c @@ -11,72 +11,72 @@ extern "C" { /* Subroutine */ integer dorg2r_(integer *m, integer *n, integer *k, doublereal * a, integer *lda, doublereal *tau, doublereal *work, integer *info) { -/* -- LAPACK routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - February 29, 1992 +/* -- LAPACK routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + February 29, 1992 - Purpose - ======= + Purpose + ======= - DORG2R generates an m by n real matrix Q with orthonormal columns, - which is defined as the first n columns of a product of k elementary - reflectors of order m + DORG2R generates an m by n real matrix Q with orthonormal columns, + which is defined as the first n columns of a product of k elementary + reflectors of order m - Q = H(1) H(2) . . . H(k) + Q = H(1) H(2) . . . H(k) - as returned by DGEQRF. + as returned by DGEQRF. - Arguments - ========= + Arguments + ========= - M (input) INTEGER - The number of rows of the matrix Q. M >= 0. + M (input) INTEGER + The number of rows of the matrix Q. M >= 0. - N (input) INTEGER - The number of columns of the matrix Q. M >= N >= 0. + N (input) INTEGER + The number of columns of the matrix Q. M >= N >= 0. - K (input) INTEGER - The number of elementary reflectors whose product defines the - matrix Q. N >= K >= 0. + K (input) INTEGER + The number of elementary reflectors whose product defines the + matrix Q. N >= K >= 0. - A (input/output) DOUBLE PRECISION array, dimension (LDA,N) - On entry, the i-th column must contain the vector which - defines the elementary reflector H(i), for i = 1,2,...,k, as - returned by DGEQRF in the first k columns of its array - argument A. - On exit, the m-by-n matrix Q. + A (input/output) DOUBLE PRECISION array, dimension (LDA,N) + On entry, the i-th column must contain the vector which + defines the elementary reflector H(i), for i = 1,2,...,k, as + returned by DGEQRF in the first k columns of its array + argument A. + On exit, the m-by-n matrix Q. - LDA (input) INTEGER - The first dimension of the array A. LDA >= max(1,M). + LDA (input) INTEGER + The first dimension of the array A. LDA >= max(1,M). - TAU (input) DOUBLE PRECISION array, dimension (K) - TAU(i) must contain the scalar factor of the elementary - reflector H(i), as returned by DGEQRF. + TAU (input) DOUBLE PRECISION array, dimension (K) + TAU(i) must contain the scalar factor of the elementary + reflector H(i), as returned by DGEQRF. - WORK (workspace) DOUBLE PRECISION array, dimension (N) + WORK (workspace) DOUBLE PRECISION array, dimension (N) - INFO (output) INTEGER - = 0: successful exit - < 0: if INFO = -i, the i-th argument has an illegal value + INFO (output) INTEGER + = 0: successful exit + < 0: if INFO = -i, the i-th argument has an illegal value - ===================================================================== + ===================================================================== - Test the input arguments + Test the input arguments Parameter adjustments */ /* Table of constant values */ - static integer c__1 = 1; - + integer c__1 = 1; + /* System generated locals */ integer a_dim1, a_offset, i__1, i__2; doublereal d__1; /* Local variables */ - static integer i__, j, l; - extern /* Subroutine */ integer dscal_(integer *, doublereal *, doublereal *, - integer *), dlarf_(const char *, integer *, integer *, doublereal *, + integer i__, j, l; + extern /* Subroutine */ integer dscal_(integer *, doublereal *, doublereal *, + integer *), dlarf_(const char *, integer *, integer *, doublereal *, integer *, doublereal *, doublereal *, integer *, doublereal *), xerbla_(const char *, integer *); #define a_ref(a_1,a_2) a[(a_2)*a_dim1 + a_1] diff --git a/external/hypre/src/lapack/dorgbr.c b/external/hypre/src/lapack/dorgbr.c index 9e3c6b93..555309ef 100644 --- a/external/hypre/src/lapack/dorgbr.c +++ b/external/hypre/src/lapack/dorgbr.c @@ -8,123 +8,123 @@ extern "C" { #include "f2c.h" #include "hypre_lapack.h" -/* Subroutine */ integer dorgbr_(const char *vect, integer *m, integer *n, integer *k, - doublereal *a, integer *lda, doublereal *tau, doublereal *work, +/* Subroutine */ integer dorgbr_(const char *vect, integer *m, integer *n, integer *k, + doublereal *a, integer *lda, doublereal *tau, doublereal *work, integer *lwork, integer *info) { -/* -- LAPACK routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - June 30, 1999 - - - Purpose - ======= - - DORGBR generates one of the real orthogonal matrices Q or P**T - determined by DGEBRD when reducing a real matrix A to bidiagonal - form: A = Q * B * P**T. Q and P**T are defined as products of - elementary reflectors H(i) or G(i) respectively. - - If VECT = 'Q', A is assumed to have been an M-by-K matrix, and Q - is of order M: - if m >= k, Q = H(1) H(2) . . . H(k) and DORGBR returns the first n - columns of Q, where m >= n >= k; - if m < k, Q = H(1) H(2) . . . H(m-1) and DORGBR returns Q as an - M-by-M matrix. - - If VECT = 'P', A is assumed to have been a K-by-N matrix, and P**T - is of order N: - if k < n, P**T = G(k) . . . G(2) G(1) and DORGBR returns the first m - rows of P**T, where n >= m >= k; - if k >= n, P**T = G(n-1) . . . G(2) G(1) and DORGBR returns P**T as - an N-by-N matrix. - - Arguments - ========= - - VECT (input) CHARACTER*1 - Specifies whether the matrix Q or the matrix P**T is - required, as defined in the transformation applied by DGEBRD: - = 'Q': generate Q; - = 'P': generate P**T. - - M (input) INTEGER - The number of rows of the matrix Q or P**T to be returned. - M >= 0. - - N (input) INTEGER - The number of columns of the matrix Q or P**T to be returned. - N >= 0. - If VECT = 'Q', M >= N >= min(M,K); - if VECT = 'P', N >= M >= min(N,K). - - K (input) INTEGER - If VECT = 'Q', the number of columns in the original M-by-K - matrix reduced by DGEBRD. - If VECT = 'P', the number of rows in the original K-by-N - matrix reduced by DGEBRD. - K >= 0. - - A (input/output) DOUBLE PRECISION array, dimension (LDA,N) - On entry, the vectors which define the elementary reflectors, - as returned by DGEBRD. - On exit, the M-by-N matrix Q or P**T. - - LDA (input) INTEGER - The leading dimension of the array A. LDA >= max(1,M). - - TAU (input) DOUBLE PRECISION array, dimension - (min(M,K)) if VECT = 'Q' - (min(N,K)) if VECT = 'P' - TAU(i) must contain the scalar factor of the elementary - reflector H(i) or G(i), which determines Q or P**T, as - returned by DGEBRD in its array argument TAUQ or TAUP. - - WORK (workspace/output) DOUBLE PRECISION array, dimension (LWORK) - On exit, if INFO = 0, WORK(1) returns the optimal LWORK. - - LWORK (input) INTEGER - The dimension of the array WORK. LWORK >= max(1,min(M,N)). - For optimum performance LWORK >= min(M,N)*NB, where NB - is the optimal blocksize. - - If LWORK = -1, then a workspace query is assumed; the routine - only calculates the optimal size of the WORK array, returns - this value as the first entry of the WORK array, and no error - message related to LWORK is issued by XERBLA. - - INFO (output) INTEGER - = 0: successful exit - < 0: if INFO = -i, the i-th argument had an illegal value - - ===================================================================== - - - Test the input arguments +/* -- LAPACK routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + June 30, 1999 + + + Purpose + ======= + + DORGBR generates one of the real orthogonal matrices Q or P**T + determined by DGEBRD when reducing a real matrix A to bidiagonal + form: A = Q * B * P**T. Q and P**T are defined as products of + elementary reflectors H(i) or G(i) respectively. + + If VECT = 'Q', A is assumed to have been an M-by-K matrix, and Q + is of order M: + if m >= k, Q = H(1) H(2) . . . H(k) and DORGBR returns the first n + columns of Q, where m >= n >= k; + if m < k, Q = H(1) H(2) . . . H(m-1) and DORGBR returns Q as an + M-by-M matrix. + + If VECT = 'P', A is assumed to have been a K-by-N matrix, and P**T + is of order N: + if k < n, P**T = G(k) . . . G(2) G(1) and DORGBR returns the first m + rows of P**T, where n >= m >= k; + if k >= n, P**T = G(n-1) . . . G(2) G(1) and DORGBR returns P**T as + an N-by-N matrix. + + Arguments + ========= + + VECT (input) CHARACTER*1 + Specifies whether the matrix Q or the matrix P**T is + required, as defined in the transformation applied by DGEBRD: + = 'Q': generate Q; + = 'P': generate P**T. + + M (input) INTEGER + The number of rows of the matrix Q or P**T to be returned. + M >= 0. + + N (input) INTEGER + The number of columns of the matrix Q or P**T to be returned. + N >= 0. + If VECT = 'Q', M >= N >= min(M,K); + if VECT = 'P', N >= M >= min(N,K). + + K (input) INTEGER + If VECT = 'Q', the number of columns in the original M-by-K + matrix reduced by DGEBRD. + If VECT = 'P', the number of rows in the original K-by-N + matrix reduced by DGEBRD. + K >= 0. + + A (input/output) DOUBLE PRECISION array, dimension (LDA,N) + On entry, the vectors which define the elementary reflectors, + as returned by DGEBRD. + On exit, the M-by-N matrix Q or P**T. + + LDA (input) INTEGER + The leading dimension of the array A. LDA >= max(1,M). + + TAU (input) DOUBLE PRECISION array, dimension + (min(M,K)) if VECT = 'Q' + (min(N,K)) if VECT = 'P' + TAU(i) must contain the scalar factor of the elementary + reflector H(i) or G(i), which determines Q or P**T, as + returned by DGEBRD in its array argument TAUQ or TAUP. + + WORK (workspace/output) DOUBLE PRECISION array, dimension (LWORK) + On exit, if INFO = 0, WORK(1) returns the optimal LWORK. + + LWORK (input) INTEGER + The dimension of the array WORK. LWORK >= max(1,min(M,N)). + For optimum performance LWORK >= min(M,N)*NB, where NB + is the optimal blocksize. + + If LWORK = -1, then a workspace query is assumed; the routine + only calculates the optimal size of the WORK array, returns + this value as the first entry of the WORK array, and no error + message related to LWORK is issued by XERBLA. + + INFO (output) INTEGER + = 0: successful exit + < 0: if INFO = -i, the i-th argument had an illegal value + + ===================================================================== + + + Test the input arguments Parameter adjustments */ /* Table of constant values */ - static integer c__1 = 1; - static integer c_n1 = -1; - + integer c__1 = 1; + integer c_n1 = -1; + /* System generated locals */ integer a_dim1, a_offset, i__1, i__2, i__3; /* Local variables */ - static integer i__, j; + integer i__, j; extern logical lsame_(const char *,const char *); - static integer iinfo; - static logical wantq; - static integer nb, mn; + integer iinfo; + logical wantq; + integer nb, mn; extern /* Subroutine */ integer xerbla_(const char *, integer *); - extern integer ilaenv_(integer *,const char *,const char *, integer *, integer *, + extern integer ilaenv_(integer *,const char *,const char *, integer *, integer *, integer *, integer *, ftnlen, ftnlen); - extern /* Subroutine */ integer dorglq_(integer *, integer *, integer *, - doublereal *, integer *, doublereal *, doublereal *, integer *, + extern /* Subroutine */ integer dorglq_(integer *, integer *, integer *, + doublereal *, integer *, doublereal *, doublereal *, integer *, integer *), dorgqr_(integer *, integer *, integer *, doublereal *, integer *, doublereal *, doublereal *, integer *, integer *); - static integer lwkopt; - static logical lquery; + integer lwkopt; + logical lquery; #define a_ref(a_1,a_2) a[(a_2)*a_dim1 + a_1] @@ -143,7 +143,7 @@ extern "C" { *info = -1; } else if (*m < 0) { *info = -2; - } else if (*n < 0 || ((wantq) && (*n > *m || *n < min(*m,*k))) || + } else if (*n < 0 || ((wantq) && (*n > *m || *n < min(*m,*k))) || ((! wantq) && (*m > *n || *m < min(*n,*k)))) { *info = -3; } else if (*k < 0) { @@ -183,7 +183,7 @@ extern "C" { if (wantq) { -/* Form Q, determined by a call to DGEBRD to reduce an m-by-k +/* Form Q, determined by a call to DGEBRD to reduce an m-by-k matrix */ if (*m >= *k) { @@ -195,10 +195,10 @@ extern "C" { } else { -/* If m < k, assume m = n +/* If m < k, assume m = n - Shift the vectors which define the elementary reflectors one - column to the right, and set the first row and column of Q + Shift the vectors which define the elementary reflectors one + column to the right, and set the first row and column of Q to those of the unit matrix */ for (j = *m; j >= 2; --j) { @@ -229,7 +229,7 @@ extern "C" { } } else { -/* Form P', determined by a call to DGEBRD to reduce a k-by-n +/* Form P', determined by a call to DGEBRD to reduce a k-by-n matrix */ if (*k < *n) { @@ -241,10 +241,10 @@ extern "C" { } else { -/* If k >= n, assume m = n +/* If k >= n, assume m = n - Shift the vectors which define the elementary reflectors one - row downward, and set the first row and column of P' to + Shift the vectors which define the elementary reflectors one + row downward, and set the first row and column of P' to those of the unit matrix */ a_ref(1, 1) = 1.; diff --git a/external/hypre/src/lapack/dorgl2.c b/external/hypre/src/lapack/dorgl2.c index 39a61c34..6fa4209e 100644 --- a/external/hypre/src/lapack/dorgl2.c +++ b/external/hypre/src/lapack/dorgl2.c @@ -11,68 +11,68 @@ extern "C" { /* Subroutine */ integer dorgl2_(integer *m, integer *n, integer *k, doublereal * a, integer *lda, doublereal *tau, doublereal *work, integer *info) { -/* -- LAPACK routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - June 30, 1999 +/* -- LAPACK routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + June 30, 1999 - Purpose - ======= + Purpose + ======= - DORGL2 generates an m by n real matrix Q with orthonormal rows, - which is defined as the first m rows of a product of k elementary - reflectors of order n + DORGL2 generates an m by n real matrix Q with orthonormal rows, + which is defined as the first m rows of a product of k elementary + reflectors of order n - Q = H(k) . . . H(2) H(1) + Q = H(k) . . . H(2) H(1) - as returned by DGELQF. + as returned by DGELQF. - Arguments - ========= + Arguments + ========= - M (input) INTEGER - The number of rows of the matrix Q. M >= 0. + M (input) INTEGER + The number of rows of the matrix Q. M >= 0. - N (input) INTEGER - The number of columns of the matrix Q. N >= M. + N (input) INTEGER + The number of columns of the matrix Q. N >= M. - K (input) INTEGER - The number of elementary reflectors whose product defines the - matrix Q. M >= K >= 0. + K (input) INTEGER + The number of elementary reflectors whose product defines the + matrix Q. M >= K >= 0. - A (input/output) DOUBLE PRECISION array, dimension (LDA,N) - On entry, the i-th row must contain the vector which defines - the elementary reflector H(i), for i = 1,2,...,k, as returned - by DGELQF in the first k rows of its array argument A. - On exit, the m-by-n matrix Q. + A (input/output) DOUBLE PRECISION array, dimension (LDA,N) + On entry, the i-th row must contain the vector which defines + the elementary reflector H(i), for i = 1,2,...,k, as returned + by DGELQF in the first k rows of its array argument A. + On exit, the m-by-n matrix Q. - LDA (input) INTEGER - The first dimension of the array A. LDA >= max(1,M). + LDA (input) INTEGER + The first dimension of the array A. LDA >= max(1,M). - TAU (input) DOUBLE PRECISION array, dimension (K) - TAU(i) must contain the scalar factor of the elementary - reflector H(i), as returned by DGELQF. + TAU (input) DOUBLE PRECISION array, dimension (K) + TAU(i) must contain the scalar factor of the elementary + reflector H(i), as returned by DGELQF. - WORK (workspace) DOUBLE PRECISION array, dimension (M) + WORK (workspace) DOUBLE PRECISION array, dimension (M) - INFO (output) INTEGER - = 0: successful exit - < 0: if INFO = -i, the i-th argument has an illegal value + INFO (output) INTEGER + = 0: successful exit + < 0: if INFO = -i, the i-th argument has an illegal value - ===================================================================== + ===================================================================== - Test the input arguments + Test the input arguments Parameter adjustments */ /* System generated locals */ integer a_dim1, a_offset, i__1, i__2; doublereal d__1; /* Local variables */ - static integer i__, j, l; - extern /* Subroutine */ integer dscal_(integer *, doublereal *, doublereal *, - integer *), dlarf_(const char *, integer *, integer *, doublereal *, + integer i__, j, l; + extern /* Subroutine */ integer dscal_(integer *, doublereal *, doublereal *, + integer *), dlarf_(const char *, integer *, integer *, doublereal *, integer *, doublereal *, doublereal *, integer *, doublereal *), xerbla_(const char *, integer *); #define a_ref(a_1,a_2) a[(a_2)*a_dim1 + a_1] diff --git a/external/hypre/src/lapack/dorglq.c b/external/hypre/src/lapack/dorglq.c index 3c4cbf37..408648f5 100644 --- a/external/hypre/src/lapack/dorglq.c +++ b/external/hypre/src/lapack/dorglq.c @@ -9,100 +9,100 @@ extern "C" { #include "hypre_lapack.h" /* Subroutine */ integer dorglq_(integer *m, integer *n, integer *k, doublereal * - a, integer *lda, doublereal *tau, doublereal *work, integer *lwork, + a, integer *lda, doublereal *tau, doublereal *work, integer *lwork, integer *info) { -/* -- LAPACK routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - June 30, 1999 +/* -- LAPACK routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + June 30, 1999 - Purpose - ======= + Purpose + ======= - DORGLQ generates an M-by-N real matrix Q with orthonormal rows, - which is defined as the first M rows of a product of K elementary - reflectors of order N + DORGLQ generates an M-by-N real matrix Q with orthonormal rows, + which is defined as the first M rows of a product of K elementary + reflectors of order N - Q = H(k) . . . H(2) H(1) + Q = H(k) . . . H(2) H(1) - as returned by DGELQF. + as returned by DGELQF. - Arguments - ========= + Arguments + ========= - M (input) INTEGER - The number of rows of the matrix Q. M >= 0. + M (input) INTEGER + The number of rows of the matrix Q. M >= 0. - N (input) INTEGER - The number of columns of the matrix Q. N >= M. + N (input) INTEGER + The number of columns of the matrix Q. N >= M. - K (input) INTEGER - The number of elementary reflectors whose product defines the - matrix Q. M >= K >= 0. + K (input) INTEGER + The number of elementary reflectors whose product defines the + matrix Q. M >= K >= 0. - A (input/output) DOUBLE PRECISION array, dimension (LDA,N) - On entry, the i-th row must contain the vector which defines - the elementary reflector H(i), for i = 1,2,...,k, as returned - by DGELQF in the first k rows of its array argument A. - On exit, the M-by-N matrix Q. + A (input/output) DOUBLE PRECISION array, dimension (LDA,N) + On entry, the i-th row must contain the vector which defines + the elementary reflector H(i), for i = 1,2,...,k, as returned + by DGELQF in the first k rows of its array argument A. + On exit, the M-by-N matrix Q. - LDA (input) INTEGER - The first dimension of the array A. LDA >= max(1,M). + LDA (input) INTEGER + The first dimension of the array A. LDA >= max(1,M). - TAU (input) DOUBLE PRECISION array, dimension (K) - TAU(i) must contain the scalar factor of the elementary - reflector H(i), as returned by DGELQF. + TAU (input) DOUBLE PRECISION array, dimension (K) + TAU(i) must contain the scalar factor of the elementary + reflector H(i), as returned by DGELQF. - WORK (workspace/output) DOUBLE PRECISION array, dimension (LWORK) - On exit, if INFO = 0, WORK(1) returns the optimal LWORK. + WORK (workspace/output) DOUBLE PRECISION array, dimension (LWORK) + On exit, if INFO = 0, WORK(1) returns the optimal LWORK. - LWORK (input) INTEGER - The dimension of the array WORK. LWORK >= max(1,M). - For optimum performance LWORK >= M*NB, where NB is - the optimal blocksize. + LWORK (input) INTEGER + The dimension of the array WORK. LWORK >= max(1,M). + For optimum performance LWORK >= M*NB, where NB is + the optimal blocksize. - If LWORK = -1, then a workspace query is assumed; the routine - only calculates the optimal size of the WORK array, returns - this value as the first entry of the WORK array, and no error - message related to LWORK is issued by XERBLA. + If LWORK = -1, then a workspace query is assumed; the routine + only calculates the optimal size of the WORK array, returns + this value as the first entry of the WORK array, and no error + message related to LWORK is issued by XERBLA. - INFO (output) INTEGER - = 0: successful exit - < 0: if INFO = -i, the i-th argument has an illegal value + INFO (output) INTEGER + = 0: successful exit + < 0: if INFO = -i, the i-th argument has an illegal value - ===================================================================== + ===================================================================== - Test the input arguments + Test the input arguments Parameter adjustments */ /* Table of constant values */ - static integer c__1 = 1; - static integer c_n1 = -1; - static integer c__3 = 3; - static integer c__2 = 2; - + integer c__1 = 1; + integer c_n1 = -1; + integer c__3 = 3; + integer c__2 = 2; + /* System generated locals */ integer a_dim1, a_offset, i__1, i__2, i__3; /* Local variables */ - static integer i__, j, l, nbmin, iinfo; - extern /* Subroutine */ integer dorgl2_(integer *, integer *, integer *, + integer i__, j, l, nbmin, iinfo; + extern /* Subroutine */ integer dorgl2_(integer *, integer *, integer *, doublereal *, integer *, doublereal *, doublereal *, integer *); - static integer ib, nb, ki, kk; - extern /* Subroutine */ integer dlarfb_(const char *,const char *,const char *,const char *, - integer *, integer *, integer *, doublereal *, integer *, - doublereal *, integer *, doublereal *, integer *, doublereal *, + integer ib, nb, ki, kk; + extern /* Subroutine */ integer dlarfb_(const char *,const char *,const char *,const char *, + integer *, integer *, integer *, doublereal *, integer *, + doublereal *, integer *, doublereal *, integer *, doublereal *, integer *); - static integer nx; - extern /* Subroutine */ integer dlarft_(const char *,const char *, integer *, integer *, + integer nx; + extern /* Subroutine */ integer dlarft_(const char *,const char *, integer *, integer *, doublereal *, integer *, doublereal *, doublereal *, integer *), xerbla_(const char *, integer *); - extern integer ilaenv_(integer *,const char *,const char *, integer *, integer *, + extern integer ilaenv_(integer *,const char *,const char *, integer *, integer *, integer *, integer *, ftnlen, ftnlen); - static integer ldwork, lwkopt; - static logical lquery; - static integer iws; + integer ldwork, lwkopt; + logical lquery; + integer iws; #define a_ref(a_1,a_2) a[(a_2)*a_dim1 + a_1] @@ -149,7 +149,7 @@ extern "C" { iws = *m; if (nb > 1 && nb < *k) { -/* Determine when to cross over from blocked to unblocked code. +/* Determine when to cross over from blocked to unblocked code. Computing MAX */ i__1 = 0, i__2 = ilaenv_(&c__3, "DORGLQ", " ", m, n, k, &c_n1, ( @@ -163,7 +163,7 @@ extern "C" { iws = ldwork * nb; if (*lwork < iws) { -/* Not enough workspace to use optimal NB: reduce NB and +/* Not enough workspace to use optimal NB: reduce NB and determine the minimum value of NB. */ nb = *lwork / ldwork; @@ -177,7 +177,7 @@ extern "C" { if (nb >= nbmin && nb < *k && nx < *k) { -/* Use blocked code after the last block. +/* Use blocked code after the last block. The first kk rows are handled by the block method. */ ki = (*k - nx - 1) / nb * nb; @@ -221,11 +221,11 @@ extern "C" { ib = min(i__2,i__3); if (i__ + ib <= *m) { -/* Form the triangular factor of the block reflector +/* Form the triangular factor of the block reflector H = H(i) H(i+1) . . . H(i+ib-1) */ i__2 = *n - i__ + 1; - dlarft_("Forward", "Rowwise", &i__2, &ib, &a_ref(i__, i__), + dlarft_("Forward", "Rowwise", &i__2, &ib, &a_ref(i__, i__), lda, &tau[i__], &work[1], &ldwork); /* Apply H' to A(i+ib:m,i:n) from the right */ diff --git a/external/hypre/src/lapack/dorgql.c b/external/hypre/src/lapack/dorgql.c index 814f222c..f5c8f8d4 100644 --- a/external/hypre/src/lapack/dorgql.c +++ b/external/hypre/src/lapack/dorgql.c @@ -9,101 +9,101 @@ extern "C" { #include "hypre_lapack.h" /* Subroutine */ integer dorgql_(integer *m, integer *n, integer *k, doublereal * - a, integer *lda, doublereal *tau, doublereal *work, integer *lwork, + a, integer *lda, doublereal *tau, doublereal *work, integer *lwork, integer *info) { -/* -- LAPACK routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - June 30, 1999 +/* -- LAPACK routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + June 30, 1999 - Purpose - ======= + Purpose + ======= - DORGQL generates an M-by-N real matrix Q with orthonormal columns, - which is defined as the last N columns of a product of K elementary - reflectors of order M + DORGQL generates an M-by-N real matrix Q with orthonormal columns, + which is defined as the last N columns of a product of K elementary + reflectors of order M - Q = H(k) . . . H(2) H(1) + Q = H(k) . . . H(2) H(1) - as returned by DGEQLF. + as returned by DGEQLF. - Arguments - ========= + Arguments + ========= - M (input) INTEGER - The number of rows of the matrix Q. M >= 0. + M (input) INTEGER + The number of rows of the matrix Q. M >= 0. - N (input) INTEGER - The number of columns of the matrix Q. M >= N >= 0. + N (input) INTEGER + The number of columns of the matrix Q. M >= N >= 0. - K (input) INTEGER - The number of elementary reflectors whose product defines the - matrix Q. N >= K >= 0. + K (input) INTEGER + The number of elementary reflectors whose product defines the + matrix Q. N >= K >= 0. - A (input/output) DOUBLE PRECISION array, dimension (LDA,N) - On entry, the (n-k+i)-th column must contain the vector which - defines the elementary reflector H(i), for i = 1,2,...,k, as - returned by DGEQLF in the last k columns of its array - argument A. - On exit, the M-by-N matrix Q. + A (input/output) DOUBLE PRECISION array, dimension (LDA,N) + On entry, the (n-k+i)-th column must contain the vector which + defines the elementary reflector H(i), for i = 1,2,...,k, as + returned by DGEQLF in the last k columns of its array + argument A. + On exit, the M-by-N matrix Q. - LDA (input) INTEGER - The first dimension of the array A. LDA >= max(1,M). + LDA (input) INTEGER + The first dimension of the array A. LDA >= max(1,M). - TAU (input) DOUBLE PRECISION array, dimension (K) - TAU(i) must contain the scalar factor of the elementary - reflector H(i), as returned by DGEQLF. + TAU (input) DOUBLE PRECISION array, dimension (K) + TAU(i) must contain the scalar factor of the elementary + reflector H(i), as returned by DGEQLF. - WORK (workspace/output) DOUBLE PRECISION array, dimension (LWORK) - On exit, if INFO = 0, WORK(1) returns the optimal LWORK. + WORK (workspace/output) DOUBLE PRECISION array, dimension (LWORK) + On exit, if INFO = 0, WORK(1) returns the optimal LWORK. - LWORK (input) INTEGER - The dimension of the array WORK. LWORK >= max(1,N). - For optimum performance LWORK >= N*NB, where NB is the - optimal blocksize. + LWORK (input) INTEGER + The dimension of the array WORK. LWORK >= max(1,N). + For optimum performance LWORK >= N*NB, where NB is the + optimal blocksize. - If LWORK = -1, then a workspace query is assumed; the routine - only calculates the optimal size of the WORK array, returns - this value as the first entry of the WORK array, and no error - message related to LWORK is issued by XERBLA. + If LWORK = -1, then a workspace query is assumed; the routine + only calculates the optimal size of the WORK array, returns + this value as the first entry of the WORK array, and no error + message related to LWORK is issued by XERBLA. - INFO (output) INTEGER - = 0: successful exit - < 0: if INFO = -i, the i-th argument has an illegal value + INFO (output) INTEGER + = 0: successful exit + < 0: if INFO = -i, the i-th argument has an illegal value - ===================================================================== + ===================================================================== - Test the input arguments + Test the input arguments Parameter adjustments */ /* Table of constant values */ - static integer c__1 = 1; - static integer c_n1 = -1; - static integer c__3 = 3; - static integer c__2 = 2; - + integer c__1 = 1; + integer c_n1 = -1; + integer c__3 = 3; + integer c__2 = 2; + /* System generated locals */ integer a_dim1, a_offset, i__1, i__2, i__3, i__4; /* Local variables */ - static integer i__, j, l, nbmin, iinfo; - extern /* Subroutine */ integer dorg2l_(integer *, integer *, integer *, + integer i__, j, l, nbmin, iinfo; + extern /* Subroutine */ integer dorg2l_(integer *, integer *, integer *, doublereal *, integer *, doublereal *, doublereal *, integer *); - static integer ib, nb, kk; - extern /* Subroutine */ integer dlarfb_(const char *,const char *,const char *,const char *, - integer *, integer *, integer *, doublereal *, integer *, - doublereal *, integer *, doublereal *, integer *, doublereal *, + integer ib, nb, kk; + extern /* Subroutine */ integer dlarfb_(const char *,const char *,const char *,const char *, + integer *, integer *, integer *, doublereal *, integer *, + doublereal *, integer *, doublereal *, integer *, doublereal *, integer *); - static integer nx; - extern /* Subroutine */ integer dlarft_(const char *,const char *, integer *, integer *, + integer nx; + extern /* Subroutine */ integer dlarft_(const char *,const char *, integer *, integer *, doublereal *, integer *, doublereal *, doublereal *, integer *), xerbla_(const char *, integer *); - extern integer ilaenv_(integer *,const char *,const char *, integer *, integer *, + extern integer ilaenv_(integer *,const char *,const char *, integer *, integer *, integer *, integer *, ftnlen, ftnlen); - static integer ldwork, lwkopt; - static logical lquery; - static integer iws; + integer ldwork, lwkopt; + logical lquery; + integer iws; #define a_ref(a_1,a_2) a[(a_2)*a_dim1 + a_1] @@ -150,7 +150,7 @@ extern "C" { iws = *n; if (nb > 1 && nb < *k) { -/* Determine when to cross over from blocked to unblocked code. +/* Determine when to cross over from blocked to unblocked code. Computing MAX */ i__1 = 0, i__2 = ilaenv_(&c__3, "DORGQL", " ", m, n, k, &c_n1, ( @@ -164,7 +164,7 @@ extern "C" { iws = ldwork * nb; if (*lwork < iws) { -/* Not enough workspace to use optimal NB: reduce NB and +/* Not enough workspace to use optimal NB: reduce NB and determine the minimum value of NB. */ nb = *lwork / ldwork; @@ -178,8 +178,8 @@ extern "C" { if (nb >= nbmin && nb < *k && nx < *k) { -/* Use blocked code after the first block. - The last kk columns are handled by the block method. +/* Use blocked code after the first block. + The last kk columns are handled by the block method. Computing MIN */ i__1 = *k, i__2 = (*k - nx + nb - 1) / nb * nb; @@ -214,14 +214,14 @@ extern "C" { i__1 = *k; i__2 = nb; - for (i__ = *k - kk + 1; i__2 < 0 ? i__ >= i__1 : i__ <= i__1; i__ += + for (i__ = *k - kk + 1; i__2 < 0 ? i__ >= i__1 : i__ <= i__1; i__ += i__2) { /* Computing MIN */ i__3 = nb, i__4 = *k - i__ + 1; ib = min(i__3,i__4); if (*n - *k + i__ > 1) { -/* Form the triangular factor of the block reflector +/* Form the triangular factor of the block reflector H = H(i+ib-1) . . . H(i+1) H(i) */ i__3 = *m - *k + i__ + ib - 1; diff --git a/external/hypre/src/lapack/dorgqr.c b/external/hypre/src/lapack/dorgqr.c index 9fcd5e87..7e252a27 100644 --- a/external/hypre/src/lapack/dorgqr.c +++ b/external/hypre/src/lapack/dorgqr.c @@ -9,101 +9,101 @@ extern "C" { #include "hypre_lapack.h" /* Subroutine */ integer dorgqr_(integer *m, integer *n, integer *k, doublereal * - a, integer *lda, doublereal *tau, doublereal *work, integer *lwork, + a, integer *lda, doublereal *tau, doublereal *work, integer *lwork, integer *info) { -/* -- LAPACK routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - June 30, 1999 +/* -- LAPACK routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + June 30, 1999 - Purpose - ======= + Purpose + ======= - DORGQR generates an M-by-N real matrix Q with orthonormal columns, - which is defined as the first N columns of a product of K elementary - reflectors of order M + DORGQR generates an M-by-N real matrix Q with orthonormal columns, + which is defined as the first N columns of a product of K elementary + reflectors of order M - Q = H(1) H(2) . . . H(k) + Q = H(1) H(2) . . . H(k) - as returned by DGEQRF. + as returned by DGEQRF. - Arguments - ========= + Arguments + ========= - M (input) INTEGER - The number of rows of the matrix Q. M >= 0. + M (input) INTEGER + The number of rows of the matrix Q. M >= 0. - N (input) INTEGER - The number of columns of the matrix Q. M >= N >= 0. + N (input) INTEGER + The number of columns of the matrix Q. M >= N >= 0. - K (input) INTEGER - The number of elementary reflectors whose product defines the - matrix Q. N >= K >= 0. + K (input) INTEGER + The number of elementary reflectors whose product defines the + matrix Q. N >= K >= 0. - A (input/output) DOUBLE PRECISION array, dimension (LDA,N) - On entry, the i-th column must contain the vector which - defines the elementary reflector H(i), for i = 1,2,...,k, as - returned by DGEQRF in the first k columns of its array - argument A. - On exit, the M-by-N matrix Q. + A (input/output) DOUBLE PRECISION array, dimension (LDA,N) + On entry, the i-th column must contain the vector which + defines the elementary reflector H(i), for i = 1,2,...,k, as + returned by DGEQRF in the first k columns of its array + argument A. + On exit, the M-by-N matrix Q. - LDA (input) INTEGER - The first dimension of the array A. LDA >= max(1,M). + LDA (input) INTEGER + The first dimension of the array A. LDA >= max(1,M). - TAU (input) DOUBLE PRECISION array, dimension (K) - TAU(i) must contain the scalar factor of the elementary - reflector H(i), as returned by DGEQRF. + TAU (input) DOUBLE PRECISION array, dimension (K) + TAU(i) must contain the scalar factor of the elementary + reflector H(i), as returned by DGEQRF. - WORK (workspace/output) DOUBLE PRECISION array, dimension (LWORK) - On exit, if INFO = 0, WORK(1) returns the optimal LWORK. + WORK (workspace/output) DOUBLE PRECISION array, dimension (LWORK) + On exit, if INFO = 0, WORK(1) returns the optimal LWORK. - LWORK (input) INTEGER - The dimension of the array WORK. LWORK >= max(1,N). - For optimum performance LWORK >= N*NB, where NB is the - optimal blocksize. + LWORK (input) INTEGER + The dimension of the array WORK. LWORK >= max(1,N). + For optimum performance LWORK >= N*NB, where NB is the + optimal blocksize. - If LWORK = -1, then a workspace query is assumed; the routine - only calculates the optimal size of the WORK array, returns - this value as the first entry of the WORK array, and no error - message related to LWORK is issued by XERBLA. + If LWORK = -1, then a workspace query is assumed; the routine + only calculates the optimal size of the WORK array, returns + this value as the first entry of the WORK array, and no error + message related to LWORK is issued by XERBLA. - INFO (output) INTEGER - = 0: successful exit - < 0: if INFO = -i, the i-th argument has an illegal value + INFO (output) INTEGER + = 0: successful exit + < 0: if INFO = -i, the i-th argument has an illegal value - ===================================================================== + ===================================================================== - Test the input arguments + Test the input arguments Parameter adjustments */ /* Table of constant values */ - static integer c__1 = 1; - static integer c_n1 = -1; - static integer c__3 = 3; - static integer c__2 = 2; - + integer c__1 = 1; + integer c_n1 = -1; + integer c__3 = 3; + integer c__2 = 2; + /* System generated locals */ integer a_dim1, a_offset, i__1, i__2, i__3; /* Local variables */ - static integer i__, j, l, nbmin, iinfo; - extern /* Subroutine */ integer dorg2r_(integer *, integer *, integer *, + integer i__, j, l, nbmin, iinfo; + extern /* Subroutine */ integer dorg2r_(integer *, integer *, integer *, doublereal *, integer *, doublereal *, doublereal *, integer *); - static integer ib, nb, ki, kk; - extern /* Subroutine */ integer dlarfb_(const char *,const char *,const char *,const char *, - integer *, integer *, integer *, doublereal *, integer *, - doublereal *, integer *, doublereal *, integer *, doublereal *, + integer ib, nb, ki, kk; + extern /* Subroutine */ integer dlarfb_(const char *,const char *,const char *,const char *, + integer *, integer *, integer *, doublereal *, integer *, + doublereal *, integer *, doublereal *, integer *, doublereal *, integer *); - static integer nx; - extern /* Subroutine */ integer dlarft_(const char *,const char *, integer *, integer *, + integer nx; + extern /* Subroutine */ integer dlarft_(const char *,const char *, integer *, integer *, doublereal *, integer *, doublereal *, doublereal *, integer *), xerbla_(const char *, integer *); - extern integer ilaenv_(integer *,const char *,const char *, integer *, integer *, + extern integer ilaenv_(integer *,const char *,const char *, integer *, integer *, integer *, integer *, ftnlen, ftnlen); - static integer ldwork, lwkopt; - static logical lquery; - static integer iws; + integer ldwork, lwkopt; + logical lquery; + integer iws; #define a_ref(a_1,a_2) a[(a_2)*a_dim1 + a_1] @@ -150,7 +150,7 @@ extern "C" { iws = *n; if (nb > 1 && nb < *k) { -/* Determine when to cross over from blocked to unblocked code. +/* Determine when to cross over from blocked to unblocked code. Computing MAX */ i__1 = 0, i__2 = ilaenv_(&c__3, "DORGQR", " ", m, n, k, &c_n1, ( @@ -164,7 +164,7 @@ extern "C" { iws = ldwork * nb; if (*lwork < iws) { -/* Not enough workspace to use optimal NB: reduce NB and +/* Not enough workspace to use optimal NB: reduce NB and determine the minimum value of NB. */ nb = *lwork / ldwork; @@ -178,7 +178,7 @@ extern "C" { if (nb >= nbmin && nb < *k && nx < *k) { -/* Use blocked code after the last block. +/* Use blocked code after the last block. The first kk columns are handled by the block method. */ ki = (*k - nx - 1) / nb * nb; @@ -222,7 +222,7 @@ extern "C" { ib = min(i__2,i__3); if (i__ + ib <= *n) { -/* Form the triangular factor of the block reflector +/* Form the triangular factor of the block reflector H = H(i) H(i+1) . . . H(i+ib-1) */ i__2 = *m - i__ + 1; diff --git a/external/hypre/src/lapack/dorgtr.c b/external/hypre/src/lapack/dorgtr.c index 44a73828..152c1cfd 100644 --- a/external/hypre/src/lapack/dorgtr.c +++ b/external/hypre/src/lapack/dorgtr.c @@ -11,91 +11,91 @@ extern "C" { /* Subroutine */ integer dorgtr_(const char *uplo, integer *n, doublereal *a, integer * lda, doublereal *tau, doublereal *work, integer *lwork, integer *info) { -/* -- LAPACK routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - June 30, 1999 +/* -- LAPACK routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + June 30, 1999 - Purpose - ======= + Purpose + ======= - DORGTR generates a real orthogonal matrix Q which is defined as the - product of n-1 elementary reflectors of order N, as returned by - DSYTRD: + DORGTR generates a real orthogonal matrix Q which is defined as the + product of n-1 elementary reflectors of order N, as returned by + DSYTRD: - if UPLO = 'U', Q = H(n-1) . . . H(2) H(1), + if UPLO = 'U', Q = H(n-1) . . . H(2) H(1), - if UPLO = 'L', Q = H(1) H(2) . . . H(n-1). + if UPLO = 'L', Q = H(1) H(2) . . . H(n-1). - Arguments - ========= + Arguments + ========= - UPLO (input) CHARACTER*1 - = 'U': Upper triangle of A contains elementary reflectors - from DSYTRD; - = 'L': Lower triangle of A contains elementary reflectors - from DSYTRD. + UPLO (input) CHARACTER*1 + = 'U': Upper triangle of A contains elementary reflectors + from DSYTRD; + = 'L': Lower triangle of A contains elementary reflectors + from DSYTRD. - N (input) INTEGER - The order of the matrix Q. N >= 0. + N (input) INTEGER + The order of the matrix Q. N >= 0. - A (input/output) DOUBLE PRECISION array, dimension (LDA,N) - On entry, the vectors which define the elementary reflectors, - as returned by DSYTRD. - On exit, the N-by-N orthogonal matrix Q. + A (input/output) DOUBLE PRECISION array, dimension (LDA,N) + On entry, the vectors which define the elementary reflectors, + as returned by DSYTRD. + On exit, the N-by-N orthogonal matrix Q. - LDA (input) INTEGER - The leading dimension of the array A. LDA >= max(1,N). + LDA (input) INTEGER + The leading dimension of the array A. LDA >= max(1,N). - TAU (input) DOUBLE PRECISION array, dimension (N-1) - TAU(i) must contain the scalar factor of the elementary - reflector H(i), as returned by DSYTRD. + TAU (input) DOUBLE PRECISION array, dimension (N-1) + TAU(i) must contain the scalar factor of the elementary + reflector H(i), as returned by DSYTRD. - WORK (workspace/output) DOUBLE PRECISION array, dimension (LWORK) - On exit, if INFO = 0, WORK(1) returns the optimal LWORK. + WORK (workspace/output) DOUBLE PRECISION array, dimension (LWORK) + On exit, if INFO = 0, WORK(1) returns the optimal LWORK. - LWORK (input) INTEGER - The dimension of the array WORK. LWORK >= max(1,N-1). - For optimum performance LWORK >= (N-1)*NB, where NB is - the optimal blocksize. + LWORK (input) INTEGER + The dimension of the array WORK. LWORK >= max(1,N-1). + For optimum performance LWORK >= (N-1)*NB, where NB is + the optimal blocksize. - If LWORK = -1, then a workspace query is assumed; the routine - only calculates the optimal size of the WORK array, returns - this value as the first entry of the WORK array, and no error - message related to LWORK is issued by XERBLA. + If LWORK = -1, then a workspace query is assumed; the routine + only calculates the optimal size of the WORK array, returns + this value as the first entry of the WORK array, and no error + message related to LWORK is issued by XERBLA. - INFO (output) INTEGER - = 0: successful exit - < 0: if INFO = -i, the i-th argument had an illegal value + INFO (output) INTEGER + = 0: successful exit + < 0: if INFO = -i, the i-th argument had an illegal value - ===================================================================== + ===================================================================== - Test the input arguments + Test the input arguments Parameter adjustments */ /* Table of constant values */ - static integer c__1 = 1; - static integer c_n1 = -1; - + integer c__1 = 1; + integer c_n1 = -1; + /* System generated locals */ integer a_dim1, a_offset, i__1, i__2, i__3; /* Local variables */ - static integer i__, j; + integer i__, j; extern logical lsame_(const char *,const char *); - static integer iinfo; - static logical upper; - static integer nb; + integer iinfo; + logical upper; + integer nb; extern /* Subroutine */ integer xerbla_(const char *, integer *); - extern integer ilaenv_(integer *,const char *,const char *, integer *, integer *, + extern integer ilaenv_(integer *,const char *,const char *, integer *, integer *, integer *, integer *, ftnlen, ftnlen); - extern /* Subroutine */ integer dorgql_(integer *, integer *, integer *, - doublereal *, integer *, doublereal *, doublereal *, integer *, + extern /* Subroutine */ integer dorgql_(integer *, integer *, integer *, + doublereal *, integer *, doublereal *, doublereal *, integer *, integer *), dorgqr_(integer *, integer *, integer *, doublereal *, integer *, doublereal *, doublereal *, integer *, integer *); - static integer lwkopt; - static logical lquery; + integer lwkopt; + logical lquery; #define a_ref(a_1,a_2) a[(a_2)*a_dim1 + a_1] @@ -160,10 +160,10 @@ extern "C" { if (upper) { -/* Q was determined by a call to DSYTRD with UPLO = 'U' +/* Q was determined by a call to DSYTRD with UPLO = 'U' - Shift the vectors which define the elementary reflectors one - column to the left, and set the last row and column of Q to + Shift the vectors which define the elementary reflectors one + column to the left, and set the last row and column of Q to those of the unit matrix */ i__1 = *n - 1; @@ -188,15 +188,15 @@ extern "C" { i__1 = *n - 1; i__2 = *n - 1; i__3 = *n - 1; - dorgql_(&i__1, &i__2, &i__3, &a[a_offset], lda, &tau[1], &work[1], + dorgql_(&i__1, &i__2, &i__3, &a[a_offset], lda, &tau[1], &work[1], lwork, &iinfo); } else { -/* Q was determined by a call to DSYTRD with UPLO = 'L'. +/* Q was determined by a call to DSYTRD with UPLO = 'L'. - Shift the vectors which define the elementary reflectors one - column to the right, and set the first row and column of Q to + Shift the vectors which define the elementary reflectors one + column to the right, and set the first row and column of Q to those of the unit matrix */ for (j = *n; j >= 2; --j) { diff --git a/external/hypre/src/lapack/dorm2r.c b/external/hypre/src/lapack/dorm2r.c index 699a4abc..33370d52 100644 --- a/external/hypre/src/lapack/dorm2r.c +++ b/external/hypre/src/lapack/dorm2r.c @@ -99,21 +99,21 @@ extern "C" { Parameter adjustments */ /* Table of constant values */ - static integer c__1 = 1; + integer c__1 = 1; /* System generated locals */ integer a_dim1, a_offset, c_dim1, c_offset, i__1, i__2; /* Local variables */ - static logical left; - static integer i__; + logical left; + integer i__; extern /* Subroutine */ integer dlarf_(const char *, integer *, integer *, doublereal *, integer *, doublereal *, doublereal *, integer *, doublereal *); extern logical lsame_(const char *,const char *); - static integer i1, i2, i3, ic, jc, mi, ni, nq; + integer i1, i2, i3, ic, jc, mi, ni, nq; extern /* Subroutine */ integer xerbla_(const char *, integer *); - static logical notran; - static doublereal aii; + logical notran; + doublereal aii; #define a_ref(a_1,a_2) a[(a_2)*a_dim1 + a_1] #define c___ref(a_1,a_2) c__[(a_2)*c_dim1 + a_1] diff --git a/external/hypre/src/lapack/dormbr.c b/external/hypre/src/lapack/dormbr.c index 29336a45..d973db8b 100644 --- a/external/hypre/src/lapack/dormbr.c +++ b/external/hypre/src/lapack/dormbr.c @@ -8,156 +8,156 @@ extern "C" { #include "f2c.h" #include "hypre_lapack.h" -/* Subroutine */ integer dormbr_(const char *vect,const char *side,const char *trans, integer *m, - integer *n, integer *k, doublereal *a, integer *lda, doublereal *tau, - doublereal *c__, integer *ldc, doublereal *work, integer *lwork, +/* Subroutine */ integer dormbr_(const char *vect,const char *side,const char *trans, integer *m, + integer *n, integer *k, doublereal *a, integer *lda, doublereal *tau, + doublereal *c__, integer *ldc, doublereal *work, integer *lwork, integer *info) { -/* -- LAPACK routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - June 30, 1999 - - - Purpose - ======= - - If VECT = 'Q', DORMBR overwrites the general real M-by-N matrix C - with - SIDE = 'L' SIDE = 'R' - TRANS = 'N': Q * C C * Q - TRANS = 'T': Q**T * C C * Q**T +/* -- LAPACK routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + June 30, 1999 + + + Purpose + ======= + + If VECT = 'Q', DORMBR overwrites the general real M-by-N matrix C + with + SIDE = 'L' SIDE = 'R' + TRANS = 'N': Q * C C * Q + TRANS = 'T': Q**T * C C * Q**T - If VECT = 'P', DORMBR overwrites the general real M-by-N matrix C - with - SIDE = 'L' SIDE = 'R' - TRANS = 'N': P * C C * P - TRANS = 'T': P**T * C C * P**T + If VECT = 'P', DORMBR overwrites the general real M-by-N matrix C + with + SIDE = 'L' SIDE = 'R' + TRANS = 'N': P * C C * P + TRANS = 'T': P**T * C C * P**T - Here Q and P**T are the orthogonal matrices determined by DGEBRD when - reducing a real matrix A to bidiagonal form: A = Q * B * P**T. Q and - P**T are defined as products of elementary reflectors H(i) and G(i) - respectively. + Here Q and P**T are the orthogonal matrices determined by DGEBRD when + reducing a real matrix A to bidiagonal form: A = Q * B * P**T. Q and + P**T are defined as products of elementary reflectors H(i) and G(i) + respectively. - Let nq = m if SIDE = 'L' and nq = n if SIDE = 'R'. Thus nq is the - order of the orthogonal matrix Q or P**T that is applied. + Let nq = m if SIDE = 'L' and nq = n if SIDE = 'R'. Thus nq is the + order of the orthogonal matrix Q or P**T that is applied. - If VECT = 'Q', A is assumed to have been an NQ-by-K matrix: - if nq >= k, Q = H(1) H(2) . . . H(k); - if nq < k, Q = H(1) H(2) . . . H(nq-1). + If VECT = 'Q', A is assumed to have been an NQ-by-K matrix: + if nq >= k, Q = H(1) H(2) . . . H(k); + if nq < k, Q = H(1) H(2) . . . H(nq-1). - If VECT = 'P', A is assumed to have been a K-by-NQ matrix: - if k < nq, P = G(1) G(2) . . . G(k); - if k >= nq, P = G(1) G(2) . . . G(nq-1). + If VECT = 'P', A is assumed to have been a K-by-NQ matrix: + if k < nq, P = G(1) G(2) . . . G(k); + if k >= nq, P = G(1) G(2) . . . G(nq-1). - Arguments - ========= + Arguments + ========= - VECT (input) CHARACTER*1 - = 'Q': apply Q or Q**T; - = 'P': apply P or P**T. + VECT (input) CHARACTER*1 + = 'Q': apply Q or Q**T; + = 'P': apply P or P**T. - SIDE (input) CHARACTER*1 - = 'L': apply Q, Q**T, P or P**T from the Left; - = 'R': apply Q, Q**T, P or P**T from the Right. + SIDE (input) CHARACTER*1 + = 'L': apply Q, Q**T, P or P**T from the Left; + = 'R': apply Q, Q**T, P or P**T from the Right. - TRANS (input) CHARACTER*1 - = 'N': No transpose, apply Q or P; - = 'T': Transpose, apply Q**T or P**T. + TRANS (input) CHARACTER*1 + = 'N': No transpose, apply Q or P; + = 'T': Transpose, apply Q**T or P**T. - M (input) INTEGER - The number of rows of the matrix C. M >= 0. + M (input) INTEGER + The number of rows of the matrix C. M >= 0. - N (input) INTEGER - The number of columns of the matrix C. N >= 0. + N (input) INTEGER + The number of columns of the matrix C. N >= 0. - K (input) INTEGER - If VECT = 'Q', the number of columns in the original - matrix reduced by DGEBRD. - If VECT = 'P', the number of rows in the original - matrix reduced by DGEBRD. - K >= 0. + K (input) INTEGER + If VECT = 'Q', the number of columns in the original + matrix reduced by DGEBRD. + If VECT = 'P', the number of rows in the original + matrix reduced by DGEBRD. + K >= 0. - A (input) DOUBLE PRECISION array, dimension - (LDA,min(nq,K)) if VECT = 'Q' - (LDA,nq) if VECT = 'P' - The vectors which define the elementary reflectors H(i) and - G(i), whose products determine the matrices Q and P, as - returned by DGEBRD. + A (input) DOUBLE PRECISION array, dimension + (LDA,min(nq,K)) if VECT = 'Q' + (LDA,nq) if VECT = 'P' + The vectors which define the elementary reflectors H(i) and + G(i), whose products determine the matrices Q and P, as + returned by DGEBRD. - LDA (input) INTEGER - The leading dimension of the array A. - If VECT = 'Q', LDA >= max(1,nq); - if VECT = 'P', LDA >= max(1,min(nq,K)). + LDA (input) INTEGER + The leading dimension of the array A. + If VECT = 'Q', LDA >= max(1,nq); + if VECT = 'P', LDA >= max(1,min(nq,K)). - TAU (input) DOUBLE PRECISION array, dimension (min(nq,K)) - TAU(i) must contain the scalar factor of the elementary - reflector H(i) or G(i) which determines Q or P, as returned - by DGEBRD in the array argument TAUQ or TAUP. + TAU (input) DOUBLE PRECISION array, dimension (min(nq,K)) + TAU(i) must contain the scalar factor of the elementary + reflector H(i) or G(i) which determines Q or P, as returned + by DGEBRD in the array argument TAUQ or TAUP. - C (input/output) DOUBLE PRECISION array, dimension (LDC,N) - On entry, the M-by-N matrix C. - On exit, C is overwritten by Q*C or Q**T*C or C*Q**T or C*Q - or P*C or P**T*C or C*P or C*P**T. + C (input/output) DOUBLE PRECISION array, dimension (LDC,N) + On entry, the M-by-N matrix C. + On exit, C is overwritten by Q*C or Q**T*C or C*Q**T or C*Q + or P*C or P**T*C or C*P or C*P**T. - LDC (input) INTEGER - The leading dimension of the array C. LDC >= max(1,M). + LDC (input) INTEGER + The leading dimension of the array C. LDC >= max(1,M). - WORK (workspace/output) DOUBLE PRECISION array, dimension (LWORK) - On exit, if INFO = 0, WORK(1) returns the optimal LWORK. + WORK (workspace/output) DOUBLE PRECISION array, dimension (LWORK) + On exit, if INFO = 0, WORK(1) returns the optimal LWORK. - LWORK (input) INTEGER - The dimension of the array WORK. - If SIDE = 'L', LWORK >= max(1,N); - if SIDE = 'R', LWORK >= max(1,M). - For optimum performance LWORK >= N*NB if SIDE = 'L', and - LWORK >= M*NB if SIDE = 'R', where NB is the optimal - blocksize. + LWORK (input) INTEGER + The dimension of the array WORK. + If SIDE = 'L', LWORK >= max(1,N); + if SIDE = 'R', LWORK >= max(1,M). + For optimum performance LWORK >= N*NB if SIDE = 'L', and + LWORK >= M*NB if SIDE = 'R', where NB is the optimal + blocksize. - If LWORK = -1, then a workspace query is assumed; the routine - only calculates the optimal size of the WORK array, returns - this value as the first entry of the WORK array, and no error - message related to LWORK is issued by XERBLA. - - INFO (output) INTEGER - = 0: successful exit - < 0: if INFO = -i, the i-th argument had an illegal value - - ===================================================================== + If LWORK = -1, then a workspace query is assumed; the routine + only calculates the optimal size of the WORK array, returns + this value as the first entry of the WORK array, and no error + message related to LWORK is issued by XERBLA. + + INFO (output) INTEGER + = 0: successful exit + < 0: if INFO = -i, the i-th argument had an illegal value + + ===================================================================== - Test the input arguments + Test the input arguments Parameter adjustments */ /* Table of constant values */ - static integer c__1 = 1; - static integer c_n1 = -1; - static integer c__2 = 2; - + integer c__1 = 1; + integer c_n1 = -1; + integer c__2 = 2; + /* System generated locals */ address a__1[2]; integer a_dim1, a_offset, c_dim1, c_offset, i__1, i__2, i__3[2]; char ch__1[2]; - /* Builtin functions + /* Builtin functions Subroutine */ integer s_cat(char *, char **, integer *, integer *, ftnlen); /* Local variables */ - static logical left; + logical left; extern logical lsame_(const char *,const char *); - static integer iinfo, i1, i2, nb, mi, ni, nq, nw; + integer iinfo, i1, i2, nb, mi, ni, nq, nw; extern /* Subroutine */ integer xerbla_(const char *, integer *); - extern integer ilaenv_(integer *,const char *,const char *, integer *, integer *, + extern integer ilaenv_(integer *,const char *,const char *, integer *, integer *, integer *, integer *, ftnlen, ftnlen); - extern /* Subroutine */ integer dormlq_(const char *,const char *, integer *, integer *, - integer *, doublereal *, integer *, doublereal *, doublereal *, + extern /* Subroutine */ integer dormlq_(const char *,const char *, integer *, integer *, + integer *, doublereal *, integer *, doublereal *, doublereal *, integer *, doublereal *, integer *, integer *); - static logical notran; - extern /* Subroutine */ integer dormqr_(const char *,const char *, integer *, integer *, - integer *, doublereal *, integer *, doublereal *, doublereal *, + logical notran; + extern /* Subroutine */ integer dormqr_(const char *,const char *, integer *, integer *, + integer *, doublereal *, integer *, doublereal *, doublereal *, integer *, doublereal *, integer *, integer *); - static logical applyq; - static char transt[1]; - static integer lwkopt; - static logical lquery; + logical applyq; + char transt[1]; + integer lwkopt; + logical lquery; #define a_ref(a_1,a_2) a[(a_2)*a_dim1 + a_1] #define c___ref(a_1,a_2) c__[(a_2)*c_dim1 + a_1] @@ -202,7 +202,7 @@ extern "C" { } else /* if(complicated condition) */ { /* Computing MAX */ i__1 = 1, i__2 = min(nq,*k); - if (((applyq) && (*lda < max(1,nq))) || + if (((applyq) && (*lda < max(1,nq))) || ((! applyq) && (*lda < max(i__1,i__2)))) { *info = -8; } else if (*ldc < max(1,*m)) { @@ -299,7 +299,7 @@ extern "C" { i2 = 2; } i__1 = nq - 1; - dormqr_(side, trans, &mi, &ni, &i__1, &a_ref(2, 1), lda, &tau[1], + dormqr_(side, trans, &mi, &ni, &i__1, &a_ref(2, 1), lda, &tau[1], &c___ref(i1, i2), ldc, &work[1], lwork, &iinfo); } } else { diff --git a/external/hypre/src/lapack/dorml2.c b/external/hypre/src/lapack/dorml2.c index fff71a62..def6ce1f 100644 --- a/external/hypre/src/lapack/dorml2.c +++ b/external/hypre/src/lapack/dorml2.c @@ -8,109 +8,109 @@ extern "C" { #include "f2c.h" #include "hypre_lapack.h" -/* Subroutine */ integer dorml2_(const char *side,const char *trans, integer *m, integer *n, +/* Subroutine */ integer dorml2_(const char *side,const char *trans, integer *m, integer *n, integer *k, doublereal *a, integer *lda, doublereal *tau, doublereal * c__, integer *ldc, doublereal *work, integer *info) { -/* -- LAPACK routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - February 29, 1992 +/* -- LAPACK routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + February 29, 1992 - Purpose - ======= + Purpose + ======= - DORML2 overwrites the general real m by n matrix C with + DORML2 overwrites the general real m by n matrix C with - Q * C if SIDE = 'L' and TRANS = 'N', or + Q * C if SIDE = 'L' and TRANS = 'N', or - Q'* C if SIDE = 'L' and TRANS = 'T', or + Q'* C if SIDE = 'L' and TRANS = 'T', or - C * Q if SIDE = 'R' and TRANS = 'N', or + C * Q if SIDE = 'R' and TRANS = 'N', or - C * Q' if SIDE = 'R' and TRANS = 'T', + C * Q' if SIDE = 'R' and TRANS = 'T', - where Q is a real orthogonal matrix defined as the product of k - elementary reflectors + where Q is a real orthogonal matrix defined as the product of k + elementary reflectors - Q = H(k) . . . H(2) H(1) + Q = H(k) . . . H(2) H(1) - as returned by DGELQF. Q is of order m if SIDE = 'L' and of order n - if SIDE = 'R'. + as returned by DGELQF. Q is of order m if SIDE = 'L' and of order n + if SIDE = 'R'. - Arguments - ========= + Arguments + ========= - SIDE (input) CHARACTER*1 - = 'L': apply Q or Q' from the Left - = 'R': apply Q or Q' from the Right + SIDE (input) CHARACTER*1 + = 'L': apply Q or Q' from the Left + = 'R': apply Q or Q' from the Right - TRANS (input) CHARACTER*1 - = 'N': apply Q (No transpose) - = 'T': apply Q' (Transpose) + TRANS (input) CHARACTER*1 + = 'N': apply Q (No transpose) + = 'T': apply Q' (Transpose) - M (input) INTEGER - The number of rows of the matrix C. M >= 0. + M (input) INTEGER + The number of rows of the matrix C. M >= 0. - N (input) INTEGER - The number of columns of the matrix C. N >= 0. + N (input) INTEGER + The number of columns of the matrix C. N >= 0. - K (input) INTEGER - The number of elementary reflectors whose product defines - the matrix Q. - If SIDE = 'L', M >= K >= 0; - if SIDE = 'R', N >= K >= 0. + K (input) INTEGER + The number of elementary reflectors whose product defines + the matrix Q. + If SIDE = 'L', M >= K >= 0; + if SIDE = 'R', N >= K >= 0. - A (input) DOUBLE PRECISION array, dimension - (LDA,M) if SIDE = 'L', - (LDA,N) if SIDE = 'R' - The i-th row must contain the vector which defines the - elementary reflector H(i), for i = 1,2,...,k, as returned by - DGELQF in the first k rows of its array argument A. - A is modified by the routine but restored on exit. + A (input) DOUBLE PRECISION array, dimension + (LDA,M) if SIDE = 'L', + (LDA,N) if SIDE = 'R' + The i-th row must contain the vector which defines the + elementary reflector H(i), for i = 1,2,...,k, as returned by + DGELQF in the first k rows of its array argument A. + A is modified by the routine but restored on exit. - LDA (input) INTEGER - The leading dimension of the array A. LDA >= max(1,K). + LDA (input) INTEGER + The leading dimension of the array A. LDA >= max(1,K). - TAU (input) DOUBLE PRECISION array, dimension (K) - TAU(i) must contain the scalar factor of the elementary - reflector H(i), as returned by DGELQF. + TAU (input) DOUBLE PRECISION array, dimension (K) + TAU(i) must contain the scalar factor of the elementary + reflector H(i), as returned by DGELQF. - C (input/output) DOUBLE PRECISION array, dimension (LDC,N) - On entry, the m by n matrix C. - On exit, C is overwritten by Q*C or Q'*C or C*Q' or C*Q. + C (input/output) DOUBLE PRECISION array, dimension (LDC,N) + On entry, the m by n matrix C. + On exit, C is overwritten by Q*C or Q'*C or C*Q' or C*Q. - LDC (input) INTEGER - The leading dimension of the array C. LDC >= max(1,M). + LDC (input) INTEGER + The leading dimension of the array C. LDC >= max(1,M). - WORK (workspace) DOUBLE PRECISION array, dimension - (N) if SIDE = 'L', - (M) if SIDE = 'R' + WORK (workspace) DOUBLE PRECISION array, dimension + (N) if SIDE = 'L', + (M) if SIDE = 'R' - INFO (output) INTEGER - = 0: successful exit - < 0: if INFO = -i, the i-th argument had an illegal value + INFO (output) INTEGER + = 0: successful exit + < 0: if INFO = -i, the i-th argument had an illegal value - ===================================================================== + ===================================================================== - Test the input arguments + Test the input arguments Parameter adjustments */ /* System generated locals */ integer a_dim1, a_offset, c_dim1, c_offset, i__1, i__2; /* Local variables */ - static logical left; - static integer i__; - extern /* Subroutine */ integer dlarf_(const char *, integer *, integer *, - doublereal *, integer *, doublereal *, doublereal *, integer *, + logical left; + integer i__; + extern /* Subroutine */ integer dlarf_(const char *, integer *, integer *, + doublereal *, integer *, doublereal *, doublereal *, integer *, doublereal *); extern logical lsame_(const char *,const char *); - static integer i1, i2, i3, ic, jc, mi, ni, nq; + integer i1, i2, i3, ic, jc, mi, ni, nq; extern /* Subroutine */ integer xerbla_(const char *, integer *); - static logical notran; - static doublereal aii; + logical notran; + doublereal aii; #define a_ref(a_1,a_2) a[(a_2)*a_dim1 + a_1] #define c___ref(a_1,a_2) c__[(a_2)*c_dim1 + a_1] @@ -201,7 +201,7 @@ extern "C" { aii = a_ref(i__, i__); a_ref(i__, i__) = 1.; - dlarf_(side, &mi, &ni, &a_ref(i__, i__), lda, &tau[i__], &c___ref(ic, + dlarf_(side, &mi, &ni, &a_ref(i__, i__), lda, &tau[i__], &c___ref(ic, jc), ldc, &work[1]); a_ref(i__, i__) = aii; /* L10: */ diff --git a/external/hypre/src/lapack/dormlq.c b/external/hypre/src/lapack/dormlq.c index fc9781ac..9ac48784 100644 --- a/external/hypre/src/lapack/dormlq.c +++ b/external/hypre/src/lapack/dormlq.c @@ -8,142 +8,142 @@ extern "C" { #include "f2c.h" #include "hypre_lapack.h" -/* Subroutine */ integer dormlq_(const char *side,const char *trans, integer *m, integer *n, +/* Subroutine */ integer dormlq_(const char *side,const char *trans, integer *m, integer *n, integer *k, doublereal *a, integer *lda, doublereal *tau, doublereal * c__, integer *ldc, doublereal *work, integer *lwork, integer *info) { -/* -- LAPACK routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - June 30, 1999 +/* -- LAPACK routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + June 30, 1999 - Purpose - ======= + Purpose + ======= - DORMLQ overwrites the general real M-by-N matrix C with + DORMLQ overwrites the general real M-by-N matrix C with - SIDE = 'L' SIDE = 'R' - TRANS = 'N': Q * C C * Q - TRANS = 'T': Q**T * C C * Q**T + SIDE = 'L' SIDE = 'R' + TRANS = 'N': Q * C C * Q + TRANS = 'T': Q**T * C C * Q**T - where Q is a real orthogonal matrix defined as the product of k - elementary reflectors + where Q is a real orthogonal matrix defined as the product of k + elementary reflectors - Q = H(k) . . . H(2) H(1) + Q = H(k) . . . H(2) H(1) - as returned by DGELQF. Q is of order M if SIDE = 'L' and of order N - if SIDE = 'R'. + as returned by DGELQF. Q is of order M if SIDE = 'L' and of order N + if SIDE = 'R'. - Arguments - ========= + Arguments + ========= - SIDE (input) CHARACTER*1 - = 'L': apply Q or Q**T from the Left; - = 'R': apply Q or Q**T from the Right. + SIDE (input) CHARACTER*1 + = 'L': apply Q or Q**T from the Left; + = 'R': apply Q or Q**T from the Right. - TRANS (input) CHARACTER*1 - = 'N': No transpose, apply Q; - = 'T': Transpose, apply Q**T. + TRANS (input) CHARACTER*1 + = 'N': No transpose, apply Q; + = 'T': Transpose, apply Q**T. - M (input) INTEGER - The number of rows of the matrix C. M >= 0. + M (input) INTEGER + The number of rows of the matrix C. M >= 0. - N (input) INTEGER - The number of columns of the matrix C. N >= 0. + N (input) INTEGER + The number of columns of the matrix C. N >= 0. - K (input) INTEGER - The number of elementary reflectors whose product defines - the matrix Q. - If SIDE = 'L', M >= K >= 0; - if SIDE = 'R', N >= K >= 0. + K (input) INTEGER + The number of elementary reflectors whose product defines + the matrix Q. + If SIDE = 'L', M >= K >= 0; + if SIDE = 'R', N >= K >= 0. - A (input) DOUBLE PRECISION array, dimension - (LDA,M) if SIDE = 'L', - (LDA,N) if SIDE = 'R' - The i-th row must contain the vector which defines the - elementary reflector H(i), for i = 1,2,...,k, as returned by - DGELQF in the first k rows of its array argument A. - A is modified by the routine but restored on exit. + A (input) DOUBLE PRECISION array, dimension + (LDA,M) if SIDE = 'L', + (LDA,N) if SIDE = 'R' + The i-th row must contain the vector which defines the + elementary reflector H(i), for i = 1,2,...,k, as returned by + DGELQF in the first k rows of its array argument A. + A is modified by the routine but restored on exit. - LDA (input) INTEGER - The leading dimension of the array A. LDA >= max(1,K). + LDA (input) INTEGER + The leading dimension of the array A. LDA >= max(1,K). - TAU (input) DOUBLE PRECISION array, dimension (K) - TAU(i) must contain the scalar factor of the elementary - reflector H(i), as returned by DGELQF. + TAU (input) DOUBLE PRECISION array, dimension (K) + TAU(i) must contain the scalar factor of the elementary + reflector H(i), as returned by DGELQF. - C (input/output) DOUBLE PRECISION array, dimension (LDC,N) - On entry, the M-by-N matrix C. - On exit, C is overwritten by Q*C or Q**T*C or C*Q**T or C*Q. + C (input/output) DOUBLE PRECISION array, dimension (LDC,N) + On entry, the M-by-N matrix C. + On exit, C is overwritten by Q*C or Q**T*C or C*Q**T or C*Q. - LDC (input) INTEGER - The leading dimension of the array C. LDC >= max(1,M). + LDC (input) INTEGER + The leading dimension of the array C. LDC >= max(1,M). - WORK (workspace/output) DOUBLE PRECISION array, dimension (LWORK) - On exit, if INFO = 0, WORK(1) returns the optimal LWORK. + WORK (workspace/output) DOUBLE PRECISION array, dimension (LWORK) + On exit, if INFO = 0, WORK(1) returns the optimal LWORK. - LWORK (input) INTEGER - The dimension of the array WORK. - If SIDE = 'L', LWORK >= max(1,N); - if SIDE = 'R', LWORK >= max(1,M). - For optimum performance LWORK >= N*NB if SIDE = 'L', and - LWORK >= M*NB if SIDE = 'R', where NB is the optimal - blocksize. + LWORK (input) INTEGER + The dimension of the array WORK. + If SIDE = 'L', LWORK >= max(1,N); + if SIDE = 'R', LWORK >= max(1,M). + For optimum performance LWORK >= N*NB if SIDE = 'L', and + LWORK >= M*NB if SIDE = 'R', where NB is the optimal + blocksize. - If LWORK = -1, then a workspace query is assumed; the routine - only calculates the optimal size of the WORK array, returns - this value as the first entry of the WORK array, and no error - message related to LWORK is issued by XERBLA. + If LWORK = -1, then a workspace query is assumed; the routine + only calculates the optimal size of the WORK array, returns + this value as the first entry of the WORK array, and no error + message related to LWORK is issued by XERBLA. - INFO (output) INTEGER - = 0: successful exit - < 0: if INFO = -i, the i-th argument had an illegal value + INFO (output) INTEGER + = 0: successful exit + < 0: if INFO = -i, the i-th argument had an illegal value - ===================================================================== + ===================================================================== - Test the input arguments + Test the input arguments Parameter adjustments */ /* Table of constant values */ - static integer c__1 = 1; - static integer c_n1 = -1; - static integer c__2 = 2; - static integer c__65 = 65; - + integer c__1 = 1; + integer c_n1 = -1; + integer c__2 = 2; + integer c__65 = 65; + /* System generated locals */ address a__1[2]; - integer a_dim1, a_offset, c_dim1, c_offset, i__1, i__2, i__3[2], i__4, + integer a_dim1, a_offset, c_dim1, c_offset, i__1, i__2, i__3[2], i__4, i__5; char ch__1[2]; - /* Builtin functions + /* Builtin functions Subroutine */ integer s_cat(char *, char **, integer *, integer *, ftnlen); /* Local variables */ - static logical left; - static integer i__; - static doublereal t[4160] /* was [65][64] */; + logical left; + integer i__; + doublereal t[4160] /* was [65][64] */; extern logical lsame_(const char *,const char *); - static integer nbmin, iinfo, i1, i2, i3; - extern /* Subroutine */ integer dorml2_(const char *,const char *, integer *, integer *, - integer *, doublereal *, integer *, doublereal *, doublereal *, + integer nbmin, iinfo, i1, i2, i3; + extern /* Subroutine */ integer dorml2_(const char *,const char *, integer *, integer *, + integer *, doublereal *, integer *, doublereal *, doublereal *, integer *, doublereal *, integer *); - static integer ib, ic, jc, nb, mi, ni; - extern /* Subroutine */ integer dlarfb_(const char *,const char *,const char *,const char *, - integer *, integer *, integer *, doublereal *, integer *, - doublereal *, integer *, doublereal *, integer *, doublereal *, + integer ib, ic, jc, nb, mi, ni; + extern /* Subroutine */ integer dlarfb_(const char *,const char *,const char *,const char *, + integer *, integer *, integer *, doublereal *, integer *, + doublereal *, integer *, doublereal *, integer *, doublereal *, integer *); - static integer nq, nw; - extern /* Subroutine */ integer dlarft_(const char *,const char *, integer *, integer *, + integer nq, nw; + extern /* Subroutine */ integer dlarft_(const char *,const char *, integer *, integer *, doublereal *, integer *, doublereal *, doublereal *, integer *), xerbla_(const char *, integer *); - extern integer ilaenv_(integer *,const char *,const char *, integer *, integer *, + extern integer ilaenv_(integer *,const char *,const char *, integer *, integer *, integer *, integer *, ftnlen, ftnlen); - static logical notran; - static integer ldwork; - static char transt[1]; - static integer lwkopt; - static logical lquery; - static integer iws; + logical notran; + integer ldwork; + char transt[1]; + integer lwkopt; + logical lquery; + integer iws; #define a_ref(a_1,a_2) a[(a_2)*a_dim1 + a_1] #define c___ref(a_1,a_2) c__[(a_2)*c_dim1 + a_1] @@ -192,10 +192,10 @@ extern "C" { if (*info == 0) { -/* Determine the block size. NB may be at most NBMAX, where NBMAX - is used to define the local array T. +/* Determine the block size. NB may be at most NBMAX, where NBMAX + is used to define the local array T. - Computing MIN + Computing MIN Writing concatenation */ i__3[0] = 1, a__1[0] = (char*)side; i__3[1] = 1, a__1[1] = (char*)trans; @@ -228,7 +228,7 @@ extern "C" { iws = nw * nb; if (*lwork < iws) { nb = *lwork / ldwork; -/* Computing MAX +/* Computing MAX Writing concatenation */ i__3[0] = 1, a__1[0] =(char*) side; i__3[1] = 1, a__1[1] =(char*) trans; @@ -282,7 +282,7 @@ extern "C" { i__4 = nb, i__5 = *k - i__ + 1; ib = min(i__4,i__5); -/* Form the triangular factor of the block reflector +/* Form the triangular factor of the block reflector H = H(i) H(i+1) . . . H(i+ib-1) */ i__4 = nq - i__ + 1; diff --git a/external/hypre/src/lapack/dormqr.c b/external/hypre/src/lapack/dormqr.c index 44202875..879403fa 100644 --- a/external/hypre/src/lapack/dormqr.c +++ b/external/hypre/src/lapack/dormqr.c @@ -8,140 +8,140 @@ extern "C" { #include "f2c.h" #include "hypre_lapack.h" -/* Subroutine */ integer dormqr_(const char *side,const char *trans, integer *m, integer *n, +/* Subroutine */ integer dormqr_(const char *side,const char *trans, integer *m, integer *n, integer *k, doublereal *a, integer *lda, doublereal *tau, doublereal * c__, integer *ldc, doublereal *work, integer *lwork, integer *info) { -/* -- LAPACK routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - June 30, 1999 +/* -- LAPACK routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + June 30, 1999 - Purpose - ======= + Purpose + ======= - DORMQR overwrites the general real M-by-N matrix C with + DORMQR overwrites the general real M-by-N matrix C with - SIDE = 'L' SIDE = 'R' - TRANS = 'N': Q * C C * Q - TRANS = 'T': Q**T * C C * Q**T + SIDE = 'L' SIDE = 'R' + TRANS = 'N': Q * C C * Q + TRANS = 'T': Q**T * C C * Q**T - where Q is a real orthogonal matrix defined as the product of k - elementary reflectors + where Q is a real orthogonal matrix defined as the product of k + elementary reflectors - Q = H(1) H(2) . . . H(k) + Q = H(1) H(2) . . . H(k) - as returned by DGEQRF. Q is of order M if SIDE = 'L' and of order N - if SIDE = 'R'. + as returned by DGEQRF. Q is of order M if SIDE = 'L' and of order N + if SIDE = 'R'. - Arguments - ========= + Arguments + ========= - SIDE (input) CHARACTER*1 - = 'L': apply Q or Q**T from the Left; - = 'R': apply Q or Q**T from the Right. + SIDE (input) CHARACTER*1 + = 'L': apply Q or Q**T from the Left; + = 'R': apply Q or Q**T from the Right. - TRANS (input) CHARACTER*1 - = 'N': No transpose, apply Q; - = 'T': Transpose, apply Q**T. + TRANS (input) CHARACTER*1 + = 'N': No transpose, apply Q; + = 'T': Transpose, apply Q**T. - M (input) INTEGER - The number of rows of the matrix C. M >= 0. + M (input) INTEGER + The number of rows of the matrix C. M >= 0. - N (input) INTEGER - The number of columns of the matrix C. N >= 0. + N (input) INTEGER + The number of columns of the matrix C. N >= 0. - K (input) INTEGER - The number of elementary reflectors whose product defines - the matrix Q. - If SIDE = 'L', M >= K >= 0; - if SIDE = 'R', N >= K >= 0. + K (input) INTEGER + The number of elementary reflectors whose product defines + the matrix Q. + If SIDE = 'L', M >= K >= 0; + if SIDE = 'R', N >= K >= 0. - A (input) DOUBLE PRECISION array, dimension (LDA,K) - The i-th column must contain the vector which defines the - elementary reflector H(i), for i = 1,2,...,k, as returned by - DGEQRF in the first k columns of its array argument A. - A is modified by the routine but restored on exit. + A (input) DOUBLE PRECISION array, dimension (LDA,K) + The i-th column must contain the vector which defines the + elementary reflector H(i), for i = 1,2,...,k, as returned by + DGEQRF in the first k columns of its array argument A. + A is modified by the routine but restored on exit. - LDA (input) INTEGER - The leading dimension of the array A. - If SIDE = 'L', LDA >= max(1,M); - if SIDE = 'R', LDA >= max(1,N). + LDA (input) INTEGER + The leading dimension of the array A. + If SIDE = 'L', LDA >= max(1,M); + if SIDE = 'R', LDA >= max(1,N). - TAU (input) DOUBLE PRECISION array, dimension (K) - TAU(i) must contain the scalar factor of the elementary - reflector H(i), as returned by DGEQRF. + TAU (input) DOUBLE PRECISION array, dimension (K) + TAU(i) must contain the scalar factor of the elementary + reflector H(i), as returned by DGEQRF. - C (input/output) DOUBLE PRECISION array, dimension (LDC,N) - On entry, the M-by-N matrix C. - On exit, C is overwritten by Q*C or Q**T*C or C*Q**T or C*Q. + C (input/output) DOUBLE PRECISION array, dimension (LDC,N) + On entry, the M-by-N matrix C. + On exit, C is overwritten by Q*C or Q**T*C or C*Q**T or C*Q. - LDC (input) INTEGER - The leading dimension of the array C. LDC >= max(1,M). + LDC (input) INTEGER + The leading dimension of the array C. LDC >= max(1,M). - WORK (workspace/output) DOUBLE PRECISION array, dimension (LWORK) - On exit, if INFO = 0, WORK(1) returns the optimal LWORK. + WORK (workspace/output) DOUBLE PRECISION array, dimension (LWORK) + On exit, if INFO = 0, WORK(1) returns the optimal LWORK. - LWORK (input) INTEGER - The dimension of the array WORK. - If SIDE = 'L', LWORK >= max(1,N); - if SIDE = 'R', LWORK >= max(1,M). - For optimum performance LWORK >= N*NB if SIDE = 'L', and - LWORK >= M*NB if SIDE = 'R', where NB is the optimal - blocksize. + LWORK (input) INTEGER + The dimension of the array WORK. + If SIDE = 'L', LWORK >= max(1,N); + if SIDE = 'R', LWORK >= max(1,M). + For optimum performance LWORK >= N*NB if SIDE = 'L', and + LWORK >= M*NB if SIDE = 'R', where NB is the optimal + blocksize. - If LWORK = -1, then a workspace query is assumed; the routine - only calculates the optimal size of the WORK array, returns - this value as the first entry of the WORK array, and no error - message related to LWORK is issued by XERBLA. + If LWORK = -1, then a workspace query is assumed; the routine + only calculates the optimal size of the WORK array, returns + this value as the first entry of the WORK array, and no error + message related to LWORK is issued by XERBLA. - INFO (output) INTEGER - = 0: successful exit - < 0: if INFO = -i, the i-th argument had an illegal value + INFO (output) INTEGER + = 0: successful exit + < 0: if INFO = -i, the i-th argument had an illegal value - ===================================================================== + ===================================================================== - Test the input arguments + Test the input arguments Parameter adjustments */ /* Table of constant values */ - static integer c__1 = 1; - static integer c_n1 = -1; - static integer c__2 = 2; - static integer c__65 = 65; - + integer c__1 = 1; + integer c_n1 = -1; + integer c__2 = 2; + integer c__65 = 65; + /* System generated locals */ address a__1[2]; - integer a_dim1, a_offset, c_dim1, c_offset, i__1, i__2, i__3[2], i__4, + integer a_dim1, a_offset, c_dim1, c_offset, i__1, i__2, i__3[2], i__4, i__5; char ch__1[2]; - /* Builtin functions + /* Builtin functions Subroutine */ integer s_cat(char *, char **, integer *, integer *, ftnlen); /* Local variables */ - static logical left; - static integer i__; - static doublereal t[4160] /* was [65][64] */; + logical left; + integer i__; + doublereal t[4160] /* was [65][64] */; extern logical lsame_(const char *,const char *); - static integer nbmin, iinfo, i1, i2, i3; - extern /* Subroutine */ integer dorm2r_(const char *,const char *, integer *, integer *, - integer *, doublereal *, integer *, doublereal *, doublereal *, + integer nbmin, iinfo, i1, i2, i3; + extern /* Subroutine */ integer dorm2r_(const char *,const char *, integer *, integer *, + integer *, doublereal *, integer *, doublereal *, doublereal *, integer *, doublereal *, integer *); - static integer ib, ic, jc, nb, mi, ni; - extern /* Subroutine */ integer dlarfb_(const char *,const char *,const char *,const char *, - integer *, integer *, integer *, doublereal *, integer *, - doublereal *, integer *, doublereal *, integer *, doublereal *, + integer ib, ic, jc, nb, mi, ni; + extern /* Subroutine */ integer dlarfb_(const char *,const char *,const char *,const char *, + integer *, integer *, integer *, doublereal *, integer *, + doublereal *, integer *, doublereal *, integer *, doublereal *, integer *); - static integer nq, nw; - extern /* Subroutine */ integer dlarft_(const char *,const char *, integer *, integer *, + integer nq, nw; + extern /* Subroutine */ integer dlarft_(const char *,const char *, integer *, integer *, doublereal *, integer *, doublereal *, doublereal *, integer *), xerbla_(const char *, integer *); - extern integer ilaenv_(integer *,const char *,const char *, integer *, integer *, + extern integer ilaenv_(integer *,const char *,const char *, integer *, integer *, integer *, integer *, ftnlen, ftnlen); - static logical notran; - static integer ldwork, lwkopt; - static logical lquery; - static integer iws; + logical notran; + integer ldwork, lwkopt; + logical lquery; + integer iws; #define a_ref(a_1,a_2) a[(a_2)*a_dim1 + a_1] #define c___ref(a_1,a_2) c__[(a_2)*c_dim1 + a_1] @@ -190,10 +190,10 @@ extern "C" { if (*info == 0) { -/* Determine the block size. NB may be at most NBMAX, where NBMAX - is used to define the local array T. +/* Determine the block size. NB may be at most NBMAX, where NBMAX + is used to define the local array T. - Computing MIN + Computing MIN Writing concatenation */ i__3[0] = 1, a__1[0] = (char*) side; i__3[1] = 1, a__1[1] = (char*) trans; @@ -226,7 +226,7 @@ extern "C" { iws = nw * nb; if (*lwork < iws) { nb = *lwork / ldwork; -/* Computing MAX +/* Computing MAX Writing concatenation */ i__3[0] = 1, a__1[0] = (char*) side; i__3[1] = 1, a__1[1] = (char*) trans; @@ -274,11 +274,11 @@ extern "C" { i__4 = nb, i__5 = *k - i__ + 1; ib = min(i__4,i__5); -/* Form the triangular factor of the block reflector +/* Form the triangular factor of the block reflector H = H(i) H(i+1) . . . H(i+ib-1) */ i__4 = nq - i__ + 1; - dlarft_("Forward", "Columnwise", &i__4, &ib, &a_ref(i__, i__), + dlarft_("Forward", "Columnwise", &i__4, &ib, &a_ref(i__, i__), lda, &tau[i__], t, &c__65); if (left) { diff --git a/external/hypre/src/lapack/dpotf2.c b/external/hypre/src/lapack/dpotf2.c index bc17f3df..4ff26215 100644 --- a/external/hypre/src/lapack/dpotf2.c +++ b/external/hypre/src/lapack/dpotf2.c @@ -11,88 +11,88 @@ extern "C" { /* Subroutine */ integer dpotf2_(const char *uplo, integer *n, doublereal *a, integer * lda, integer *info) { -/* -- LAPACK routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - February 29, 1992 +/* -- LAPACK routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + February 29, 1992 - Purpose - ======= + Purpose + ======= - DPOTF2 computes the Cholesky factorization of a real symmetric - positive definite matrix A. + DPOTF2 computes the Cholesky factorization of a real symmetric + positive definite matrix A. - The factorization has the form - A = U' * U , if UPLO = 'U', or - A = L * L', if UPLO = 'L', - where U is an upper triangular matrix and L is lower triangular. + The factorization has the form + A = U' * U , if UPLO = 'U', or + A = L * L', if UPLO = 'L', + where U is an upper triangular matrix and L is lower triangular. - This is the unblocked version of the algorithm, calling Level 2 BLAS. + This is the unblocked version of the algorithm, calling Level 2 BLAS. - Arguments - ========= + Arguments + ========= - UPLO (input) CHARACTER*1 - Specifies whether the upper or lower triangular part of the - symmetric matrix A is stored. - = 'U': Upper triangular - = 'L': Lower triangular + UPLO (input) CHARACTER*1 + Specifies whether the upper or lower triangular part of the + symmetric matrix A is stored. + = 'U': Upper triangular + = 'L': Lower triangular - N (input) INTEGER - The order of the matrix A. N >= 0. + N (input) INTEGER + The order of the matrix A. N >= 0. - A (input/output) DOUBLE PRECISION array, dimension (LDA,N) - On entry, the symmetric matrix A. If UPLO = 'U', the leading - n by n upper triangular part of A contains the upper - triangular part of the matrix A, and the strictly lower - triangular part of A is not referenced. If UPLO = 'L', the - leading n by n lower triangular part of A contains the lower - triangular part of the matrix A, and the strictly upper - triangular part of A is not referenced. + A (input/output) DOUBLE PRECISION array, dimension (LDA,N) + On entry, the symmetric matrix A. If UPLO = 'U', the leading + n by n upper triangular part of A contains the upper + triangular part of the matrix A, and the strictly lower + triangular part of A is not referenced. If UPLO = 'L', the + leading n by n lower triangular part of A contains the lower + triangular part of the matrix A, and the strictly upper + triangular part of A is not referenced. - On exit, if INFO = 0, the factor U or L from the Cholesky - factorization A = U'*U or A = L*L'. + On exit, if INFO = 0, the factor U or L from the Cholesky + factorization A = U'*U or A = L*L'. - LDA (input) INTEGER - The leading dimension of the array A. LDA >= max(1,N). + LDA (input) INTEGER + The leading dimension of the array A. LDA >= max(1,N). - INFO (output) INTEGER - = 0: successful exit - < 0: if INFO = -k, the k-th argument had an illegal value - > 0: if INFO = k, the leading minor of order k is not - positive definite, and the factorization could not be - completed. + INFO (output) INTEGER + = 0: successful exit + < 0: if INFO = -k, the k-th argument had an illegal value + > 0: if INFO = k, the leading minor of order k is not + positive definite, and the factorization could not be + completed. - ===================================================================== + ===================================================================== - Test the input parameters. + Test the input parameters. Parameter adjustments */ /* Table of constant values */ - static integer c__1 = 1; - static doublereal c_b10 = -1.; - static doublereal c_b12 = 1.; - + integer c__1 = 1; + doublereal c_b10 = -1.; + doublereal c_b12 = 1.; + /* System generated locals */ integer a_dim1, a_offset, i__1, i__2, i__3; doublereal d__1; /* Builtin functions */ /*doublereal sqrt(doublereal);*/ /* Local variables */ - extern doublereal ddot_(integer *, doublereal *, integer *, doublereal *, + extern doublereal ddot_(integer *, doublereal *, integer *, doublereal *, integer *); - static integer j; - extern /* Subroutine */ integer dscal_(integer *, doublereal *, doublereal *, + integer j; + extern /* Subroutine */ integer dscal_(integer *, doublereal *, doublereal *, integer *); extern logical lsame_(const char *,const char *); - extern /* Subroutine */ integer dgemv_(const char *, integer *, integer *, - doublereal *, doublereal *, integer *, doublereal *, integer *, + extern /* Subroutine */ integer dgemv_(const char *, integer *, integer *, + doublereal *, doublereal *, integer *, doublereal *, integer *, doublereal *, doublereal *, integer *); - static logical upper; + logical upper; extern /* Subroutine */ integer xerbla_(const char *, integer *); - static doublereal ajj; + doublereal ajj; #define a_ref(a_1,a_2) a[(a_2)*a_dim1 + a_1] @@ -146,8 +146,8 @@ extern "C" { if (j < *n) { i__2 = j - 1; i__3 = *n - j; - dgemv_("Transpose", &i__2, &i__3, &c_b10, &a_ref(1, j + 1), - lda, &a_ref(1, j), &c__1, &c_b12, &a_ref(j, j + 1), + dgemv_("Transpose", &i__2, &i__3, &c_b10, &a_ref(1, j + 1), + lda, &a_ref(1, j), &c__1, &c_b12, &a_ref(j, j + 1), lda); i__2 = *n - j; d__1 = 1. / ajj; @@ -165,7 +165,7 @@ extern "C" { /* Compute L(J,J) and test for non-positive-definiteness. */ i__2 = j - 1; - ajj = a_ref(j, j) - ddot_(&i__2, &a_ref(j, 1), lda, &a_ref(j, 1), + ajj = a_ref(j, j) - ddot_(&i__2, &a_ref(j, 1), lda, &a_ref(j, 1), lda); if (ajj <= 0.) { a_ref(j, j) = ajj; diff --git a/external/hypre/src/lapack/dpotrf.c b/external/hypre/src/lapack/dpotrf.c index 2b5e67d5..7b0d2d75 100644 --- a/external/hypre/src/lapack/dpotrf.c +++ b/external/hypre/src/lapack/dpotrf.c @@ -11,88 +11,88 @@ extern "C" { /* Subroutine */ integer dpotrf_(const char *uplo, integer *n, doublereal *a, integer * lda, integer *info) { -/* -- LAPACK routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - March 31, 1993 +/* -- LAPACK routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + March 31, 1993 - Purpose - ======= + Purpose + ======= - DPOTRF computes the Cholesky factorization of a real symmetric - positive definite matrix A. + DPOTRF computes the Cholesky factorization of a real symmetric + positive definite matrix A. - The factorization has the form - A = U**T * U, if UPLO = 'U', or - A = L * L**T, if UPLO = 'L', - where U is an upper triangular matrix and L is lower triangular. + The factorization has the form + A = U**T * U, if UPLO = 'U', or + A = L * L**T, if UPLO = 'L', + where U is an upper triangular matrix and L is lower triangular. - This is the block version of the algorithm, calling Level 3 BLAS. + This is the block version of the algorithm, calling Level 3 BLAS. - Arguments - ========= + Arguments + ========= - UPLO (input) CHARACTER*1 - = 'U': Upper triangle of A is stored; - = 'L': Lower triangle of A is stored. + UPLO (input) CHARACTER*1 + = 'U': Upper triangle of A is stored; + = 'L': Lower triangle of A is stored. - N (input) INTEGER - The order of the matrix A. N >= 0. + N (input) INTEGER + The order of the matrix A. N >= 0. - A (input/output) DOUBLE PRECISION array, dimension (LDA,N) - On entry, the symmetric matrix A. If UPLO = 'U', the leading - N-by-N upper triangular part of A contains the upper - triangular part of the matrix A, and the strictly lower - triangular part of A is not referenced. If UPLO = 'L', the - leading N-by-N lower triangular part of A contains the lower - triangular part of the matrix A, and the strictly upper - triangular part of A is not referenced. + A (input/output) DOUBLE PRECISION array, dimension (LDA,N) + On entry, the symmetric matrix A. If UPLO = 'U', the leading + N-by-N upper triangular part of A contains the upper + triangular part of the matrix A, and the strictly lower + triangular part of A is not referenced. If UPLO = 'L', the + leading N-by-N lower triangular part of A contains the lower + triangular part of the matrix A, and the strictly upper + triangular part of A is not referenced. - On exit, if INFO = 0, the factor U or L from the Cholesky - factorization A = U**T*U or A = L*L**T. + On exit, if INFO = 0, the factor U or L from the Cholesky + factorization A = U**T*U or A = L*L**T. - LDA (input) INTEGER - The leading dimension of the array A. LDA >= max(1,N). + LDA (input) INTEGER + The leading dimension of the array A. LDA >= max(1,N). - INFO (output) INTEGER - = 0: successful exit - < 0: if INFO = -i, the i-th argument had an illegal value - > 0: if INFO = i, the leading minor of order i is not - positive definite, and the factorization could not be - completed. + INFO (output) INTEGER + = 0: successful exit + < 0: if INFO = -i, the i-th argument had an illegal value + > 0: if INFO = i, the leading minor of order i is not + positive definite, and the factorization could not be + completed. - ===================================================================== + ===================================================================== - Test the input parameters. + Test the input parameters. Parameter adjustments */ /* Table of constant values */ - static integer c__1 = 1; - static integer c_n1 = -1; - static doublereal c_b13 = -1.; - static doublereal c_b14 = 1.; - + integer c__1 = 1; + integer c_n1 = -1; + doublereal c_b13 = -1.; + doublereal c_b14 = 1.; + /* System generated locals */ integer a_dim1, a_offset, i__1, i__2, i__3, i__4; /* Local variables */ - static integer j; - extern /* Subroutine */ integer dgemm_(const char *,const char *, integer *, integer *, - integer *, doublereal *, doublereal *, integer *, doublereal *, + integer j; + extern /* Subroutine */ integer dgemm_(const char *,const char *, integer *, integer *, + integer *, doublereal *, doublereal *, integer *, doublereal *, integer *, doublereal *, doublereal *, integer *); extern logical lsame_(const char *,const char *); - extern /* Subroutine */ integer dtrsm_(const char *,const char *,const char *,const char *, - integer *, integer *, doublereal *, doublereal *, integer *, + extern /* Subroutine */ integer dtrsm_(const char *,const char *,const char *,const char *, + integer *, integer *, doublereal *, doublereal *, integer *, doublereal *, integer *); - static logical upper; - extern /* Subroutine */ integer dsyrk_(const char *,const char *, integer *, integer *, + logical upper; + extern /* Subroutine */ integer dsyrk_(const char *,const char *, integer *, integer *, doublereal *, doublereal *, integer *, doublereal *, doublereal *, - integer *), dpotf2_(const char *, integer *, + integer *), dpotf2_(const char *, integer *, doublereal *, integer *, integer *); - static integer jb, nb; + integer jb, nb; extern /* Subroutine */ integer xerbla_(const char *, integer *); - extern integer ilaenv_(integer *,const char *,const char *, integer *, integer *, + extern integer ilaenv_(integer *,const char *,const char *, integer *, integer *, integer *, integer *, ftnlen, ftnlen); #define a_ref(a_1,a_2) a[(a_2)*a_dim1 + a_1] @@ -144,8 +144,8 @@ extern "C" { i__2 = nb; for (j = 1; i__2 < 0 ? j >= i__1 : j <= i__1; j += i__2) { -/* Update and factorize the current diagonal block and test - for non-positive-definiteness. +/* Update and factorize the current diagonal block and test + for non-positive-definiteness. Computing MIN */ i__3 = nb, i__4 = *n - j + 1; @@ -165,7 +165,7 @@ extern "C" { i__3 = *n - j - jb + 1; i__4 = j - 1; dgemm_("Transpose", "No transpose", &jb, &i__3, &i__4, & - c_b13, &a_ref(1, j), lda, &a_ref(1, j + jb), lda, + c_b13, &a_ref(1, j), lda, &a_ref(1, j + jb), lda, &c_b14, &a_ref(j, j + jb), lda); i__3 = *n - j - jb + 1; dtrsm_("Left", "Upper", "Transpose", "Non-unit", &jb, & @@ -184,14 +184,14 @@ extern "C" { i__1 = nb; for (j = 1; i__1 < 0 ? j >= i__2 : j <= i__2; j += i__1) { -/* Update and factorize the current diagonal block and test - for non-positive-definiteness. +/* Update and factorize the current diagonal block and test + for non-positive-definiteness. Computing MIN */ i__3 = nb, i__4 = *n - j + 1; jb = min(i__3,i__4); i__3 = j - 1; - dsyrk_("Lower", "No transpose", &jb, &i__3, &c_b13, &a_ref(j, + dsyrk_("Lower", "No transpose", &jb, &i__3, &c_b13, &a_ref(j, 1), lda, &c_b14, &a_ref(j, j), lda); dpotf2_("Lower", &jb, &a_ref(j, j), lda, info); if (*info != 0) { @@ -204,11 +204,11 @@ extern "C" { i__3 = *n - j - jb + 1; i__4 = j - 1; dgemm_("No transpose", "Transpose", &i__3, &jb, &i__4, & - c_b13, &a_ref(j + jb, 1), lda, &a_ref(j, 1), lda, + c_b13, &a_ref(j + jb, 1), lda, &a_ref(j, 1), lda, &c_b14, &a_ref(j + jb, j), lda); i__3 = *n - j - jb + 1; dtrsm_("Right", "Lower", "Transpose", "Non-unit", &i__3, & - jb, &c_b14, &a_ref(j, j), lda, &a_ref(j + jb, j), + jb, &c_b14, &a_ref(j, j), lda, &a_ref(j + jb, j), lda); } /* L20: */ diff --git a/external/hypre/src/lapack/dpotrs.c b/external/hypre/src/lapack/dpotrs.c index 7aabc84d..eef3b3b4 100644 --- a/external/hypre/src/lapack/dpotrs.c +++ b/external/hypre/src/lapack/dpotrs.c @@ -8,72 +8,72 @@ extern "C" { #include "f2c.h" #include "hypre_lapack.h" -/* Subroutine */ integer dpotrs_(char *uplo, integer *n, integer *nrhs, +/* Subroutine */ integer dpotrs_(char *uplo, integer *n, integer *nrhs, doublereal *a, integer *lda, doublereal *b, integer *ldb, integer * info) { -/* -- LAPACK routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - March 31, 1993 +/* -- LAPACK routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + March 31, 1993 - Purpose - ======= + Purpose + ======= - DPOTRS solves a system of linear equations A*X = B with a symmetric - positive definite matrix A using the Cholesky factorization - A = U**T*U or A = L*L**T computed by DPOTRF. + DPOTRS solves a system of linear equations A*X = B with a symmetric + positive definite matrix A using the Cholesky factorization + A = U**T*U or A = L*L**T computed by DPOTRF. - Arguments - ========= + Arguments + ========= - UPLO (input) CHARACTER*1 - = 'U': Upper triangle of A is stored; - = 'L': Lower triangle of A is stored. + UPLO (input) CHARACTER*1 + = 'U': Upper triangle of A is stored; + = 'L': Lower triangle of A is stored. - N (input) INTEGER - The order of the matrix A. N >= 0. + N (input) INTEGER + The order of the matrix A. N >= 0. - NRHS (input) INTEGER - The number of right hand sides, i.e., the number of columns - of the matrix B. NRHS >= 0. + NRHS (input) INTEGER + The number of right hand sides, i.e., the number of columns + of the matrix B. NRHS >= 0. - A (input) DOUBLE PRECISION array, dimension (LDA,N) - The triangular factor U or L from the Cholesky factorization - A = U**T*U or A = L*L**T, as computed by DPOTRF. + A (input) DOUBLE PRECISION array, dimension (LDA,N) + The triangular factor U or L from the Cholesky factorization + A = U**T*U or A = L*L**T, as computed by DPOTRF. - LDA (input) INTEGER - The leading dimension of the array A. LDA >= max(1,N). + LDA (input) INTEGER + The leading dimension of the array A. LDA >= max(1,N). - B (input/output) DOUBLE PRECISION array, dimension (LDB,NRHS) - On entry, the right hand side matrix B. - On exit, the solution matrix X. + B (input/output) DOUBLE PRECISION array, dimension (LDB,NRHS) + On entry, the right hand side matrix B. + On exit, the solution matrix X. - LDB (input) INTEGER - The leading dimension of the array B. LDB >= max(1,N). + LDB (input) INTEGER + The leading dimension of the array B. LDB >= max(1,N). - INFO (output) INTEGER - = 0: successful exit - < 0: if INFO = -i, the i-th argument had an illegal value + INFO (output) INTEGER + = 0: successful exit + < 0: if INFO = -i, the i-th argument had an illegal value - ===================================================================== + ===================================================================== - Test the input parameters. + Test the input parameters. Parameter adjustments */ /* Table of constant values */ - static doublereal c_b9 = 1.; - + doublereal c_b9 = 1.; + /* System generated locals */ integer a_dim1, a_offset, b_dim1, b_offset, i__1; /* Local variables */ extern logical lsame_(const char *,const char *); - extern /* Subroutine */ integer dtrsm_(const char *,const char *,const char *,const char *, - integer *, integer *, doublereal *, doublereal *, integer *, + extern /* Subroutine */ integer dtrsm_(const char *,const char *,const char *,const char *, + integer *, integer *, doublereal *, doublereal *, integer *, doublereal *, integer *); - static logical upper; + logical upper; extern /* Subroutine */ integer xerbla_(const char *, integer *); @@ -112,7 +112,7 @@ extern "C" { if (upper) { -/* Solve A*X = B where A = U'*U. +/* Solve A*X = B where A = U'*U. Solve U'*X = B, overwriting B with X. */ @@ -125,7 +125,7 @@ extern "C" { a[a_offset], lda, &b[b_offset], ldb); } else { -/* Solve A*X = B where A = L*L'. +/* Solve A*X = B where A = L*L'. Solve L*X = B, overwriting B with X. */ diff --git a/external/hypre/src/lapack/dsteqr.c b/external/hypre/src/lapack/dsteqr.c index 0c3163a3..0cf6063c 100644 --- a/external/hypre/src/lapack/dsteqr.c +++ b/external/hypre/src/lapack/dsteqr.c @@ -8,136 +8,136 @@ extern "C" { #include "f2c.h" #include "hypre_lapack.h" -/* Subroutine */ integer dsteqr_(const char *compz, integer *n, doublereal *d__, - doublereal *e, doublereal *z__, integer *ldz, doublereal *work, +/* Subroutine */ integer dsteqr_(const char *compz, integer *n, doublereal *d__, + doublereal *e, doublereal *z__, integer *ldz, doublereal *work, integer *info) { -/* -- LAPACK routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - September 30, 1994 - - - Purpose - ======= - - DSTEQR computes all eigenvalues and, optionally, eigenvectors of a - symmetric tridiagonal matrix using the implicit QL or QR method. - The eigenvectors of a full or band symmetric matrix can also be found - if DSYTRD or DSPTRD or DSBTRD has been used to reduce this matrix to - tridiagonal form. - - Arguments - ========= - - COMPZ (input) CHARACTER*1 - = 'N': Compute eigenvalues only. - = 'V': Compute eigenvalues and eigenvectors of the original - symmetric matrix. On entry, Z must contain the - orthogonal matrix used to reduce the original matrix - to tridiagonal form. - = 'I': Compute eigenvalues and eigenvectors of the - tridiagonal matrix. Z is initialized to the identity - matrix. - - N (input) INTEGER - The order of the matrix. N >= 0. - - D (input/output) DOUBLE PRECISION array, dimension (N) - On entry, the diagonal elements of the tridiagonal matrix. - On exit, if INFO = 0, the eigenvalues in ascending order. - - E (input/output) DOUBLE PRECISION array, dimension (N-1) - On entry, the (n-1) subdiagonal elements of the tridiagonal - matrix. - On exit, E has been destroyed. - - Z (input/output) DOUBLE PRECISION array, dimension (LDZ, N) - On entry, if COMPZ = 'V', then Z contains the orthogonal - matrix used in the reduction to tridiagonal form. - On exit, if INFO = 0, then if COMPZ = 'V', Z contains the - orthonormal eigenvectors of the original symmetric matrix, - and if COMPZ = 'I', Z contains the orthonormal eigenvectors - of the symmetric tridiagonal matrix. - If COMPZ = 'N', then Z is not referenced. - - LDZ (input) INTEGER - The leading dimension of the array Z. LDZ >= 1, and if - eigenvectors are desired, then LDZ >= max(1,N). - - WORK (workspace) DOUBLE PRECISION array, dimension (max(1,2*N-2)) - If COMPZ = 'N', then WORK is not referenced. - - INFO (output) INTEGER - = 0: successful exit - < 0: if INFO = -i, the i-th argument had an illegal value - > 0: the algorithm has failed to find all the eigenvalues in - a total of 30*N iterations; if INFO = i, then i - elements of E have not converged to zero; on exit, D - and E contain the elements of a symmetric tridiagonal - matrix which is orthogonally similar to the original - matrix. - - ===================================================================== - - - Test the input parameters. +/* -- LAPACK routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + September 30, 1994 + + + Purpose + ======= + + DSTEQR computes all eigenvalues and, optionally, eigenvectors of a + symmetric tridiagonal matrix using the implicit QL or QR method. + The eigenvectors of a full or band symmetric matrix can also be found + if DSYTRD or DSPTRD or DSBTRD has been used to reduce this matrix to + tridiagonal form. + + Arguments + ========= + + COMPZ (input) CHARACTER*1 + = 'N': Compute eigenvalues only. + = 'V': Compute eigenvalues and eigenvectors of the original + symmetric matrix. On entry, Z must contain the + orthogonal matrix used to reduce the original matrix + to tridiagonal form. + = 'I': Compute eigenvalues and eigenvectors of the + tridiagonal matrix. Z is initialized to the identity + matrix. + + N (input) INTEGER + The order of the matrix. N >= 0. + + D (input/output) DOUBLE PRECISION array, dimension (N) + On entry, the diagonal elements of the tridiagonal matrix. + On exit, if INFO = 0, the eigenvalues in ascending order. + + E (input/output) DOUBLE PRECISION array, dimension (N-1) + On entry, the (n-1) subdiagonal elements of the tridiagonal + matrix. + On exit, E has been destroyed. + + Z (input/output) DOUBLE PRECISION array, dimension (LDZ, N) + On entry, if COMPZ = 'V', then Z contains the orthogonal + matrix used in the reduction to tridiagonal form. + On exit, if INFO = 0, then if COMPZ = 'V', Z contains the + orthonormal eigenvectors of the original symmetric matrix, + and if COMPZ = 'I', Z contains the orthonormal eigenvectors + of the symmetric tridiagonal matrix. + If COMPZ = 'N', then Z is not referenced. + + LDZ (input) INTEGER + The leading dimension of the array Z. LDZ >= 1, and if + eigenvectors are desired, then LDZ >= max(1,N). + + WORK (workspace) DOUBLE PRECISION array, dimension (max(1,2*N-2)) + If COMPZ = 'N', then WORK is not referenced. + + INFO (output) INTEGER + = 0: successful exit + < 0: if INFO = -i, the i-th argument had an illegal value + > 0: the algorithm has failed to find all the eigenvalues in + a total of 30*N iterations; if INFO = i, then i + elements of E have not converged to zero; on exit, D + and E contain the elements of a symmetric tridiagonal + matrix which is orthogonally similar to the original + matrix. + + ===================================================================== + + + Test the input parameters. Parameter adjustments */ /* Table of constant values */ - static doublereal c_b9 = 0.; - static doublereal c_b10 = 1.; - static integer c__0 = 0; - static integer c__1 = 1; - static integer c__2 = 2; - + doublereal c_b9 = 0.; + doublereal c_b10 = 1.; + integer c__0 = 0; + integer c__1 = 1; + integer c__2 = 2; + /* System generated locals */ integer z_dim1, z_offset, i__1, i__2; doublereal d__1, d__2; /* Builtin functions */ doublereal d_sign(doublereal *, doublereal *); /* Local variables */ - static integer lend, jtot; - extern /* Subroutine */ integer dlae2_(doublereal *, doublereal *, doublereal + integer lend, jtot; + extern /* Subroutine */ integer dlae2_(doublereal *, doublereal *, doublereal *, doublereal *, doublereal *); - static doublereal b, c__, f, g; - static integer i__, j, k, l, m; - static doublereal p, r__, s; + doublereal b, c__, f, g; + integer i__, j, k, l, m; + doublereal p, r__, s; extern logical lsame_(const char *,const char *); - extern /* Subroutine */ integer dlasr_(const char *,const char *,const char *, integer *, + extern /* Subroutine */ integer dlasr_(const char *,const char *,const char *, integer *, integer *, doublereal *, doublereal *, doublereal *, integer *); - static doublereal anorm; - extern /* Subroutine */ integer dswap_(integer *, doublereal *, integer *, + doublereal anorm; + extern /* Subroutine */ integer dswap_(integer *, doublereal *, integer *, doublereal *, integer *); - static integer l1; - extern /* Subroutine */ integer dlaev2_(doublereal *, doublereal *, - doublereal *, doublereal *, doublereal *, doublereal *, + integer l1; + extern /* Subroutine */ integer dlaev2_(doublereal *, doublereal *, + doublereal *, doublereal *, doublereal *, doublereal *, doublereal *); - static integer lendm1, lendp1; + integer lendm1, lendp1; extern doublereal dlapy2_(doublereal *, doublereal *); - static integer ii; + integer ii; extern doublereal dlamch_(const char *); - static integer mm, iscale; - extern /* Subroutine */ integer dlascl_(const char *, integer *, integer *, - doublereal *, doublereal *, integer *, integer *, doublereal *, - integer *, integer *), dlaset_(const char *, integer *, integer + integer mm, iscale; + extern /* Subroutine */ integer dlascl_(const char *, integer *, integer *, + doublereal *, doublereal *, integer *, integer *, doublereal *, + integer *, integer *), dlaset_(const char *, integer *, integer *, doublereal *, doublereal *, doublereal *, integer *); - static doublereal safmin; - extern /* Subroutine */ integer dlartg_(doublereal *, doublereal *, + doublereal safmin; + extern /* Subroutine */ integer dlartg_(doublereal *, doublereal *, doublereal *, doublereal *, doublereal *); - static doublereal safmax; + doublereal safmax; extern /* Subroutine */ integer xerbla_(const char *, integer *); extern doublereal dlanst_(const char *, integer *, doublereal *, doublereal *); - extern /* Subroutine */ integer dlasrt_(const char *, integer *, doublereal *, + extern /* Subroutine */ integer dlasrt_(const char *, integer *, doublereal *, integer *); - static integer lendsv; - static doublereal ssfmin; - static integer nmaxit, icompz; - static doublereal ssfmax; - static integer lm1, mm1, nm1; - static doublereal rt1, rt2, eps; - static integer lsv; - static doublereal tst, eps2; + integer lendsv; + doublereal ssfmin; + integer nmaxit, icompz; + doublereal ssfmax; + integer lm1, mm1, nm1; + doublereal rt1, rt2, eps; + integer lsv; + doublereal tst, eps2; #define z___ref(a_1,a_2) z__[(a_2)*z_dim1 + a_1] @@ -197,7 +197,7 @@ extern "C" { ssfmax = sqrt(safmax) / 3.; ssfmin = sqrt(safmin) / eps2; -/* Compute the eigenvalues and eigenvectors of the tridiagonal +/* Compute the eigenvalues and eigenvectors of the tridiagonal matrix. */ if (icompz == 2) { @@ -207,8 +207,8 @@ extern "C" { nmaxit = *n * 30; jtot = 0; -/* Determine where the matrix splits and choose QL or QR iteration - for each block, according to whether top or bottom diagonal +/* Determine where the matrix splits and choose QL or QR iteration + for each block, according to whether top or bottom diagonal element is smaller. */ l1 = 1; @@ -228,7 +228,7 @@ extern "C" { if (tst == 0.) { goto L30; } - if (tst <= sqrt((d__1 = d__[m], abs(d__1))) * sqrt((d__2 = d__[m + if (tst <= sqrt((d__1 = d__[m], abs(d__1))) * sqrt((d__2 = d__[m + 1], abs(d__2))) * eps) { e[m] = 0.; goto L30; @@ -259,18 +259,18 @@ extern "C" { if (anorm > ssfmax) { iscale = 1; i__1 = lend - l + 1; - dlascl_("G", &c__0, &c__0, &anorm, &ssfmax, &i__1, &c__1, &d__[l], n, + dlascl_("G", &c__0, &c__0, &anorm, &ssfmax, &i__1, &c__1, &d__[l], n, info); i__1 = lend - l; - dlascl_("G", &c__0, &c__0, &anorm, &ssfmax, &i__1, &c__1, &e[l], n, + dlascl_("G", &c__0, &c__0, &anorm, &ssfmax, &i__1, &c__1, &e[l], n, info); } else if (anorm < ssfmin) { iscale = 2; i__1 = lend - l + 1; - dlascl_("G", &c__0, &c__0, &anorm, &ssfmin, &i__1, &c__1, &d__[l], n, + dlascl_("G", &c__0, &c__0, &anorm, &ssfmin, &i__1, &c__1, &d__[l], n, info); i__1 = lend - l; - dlascl_("G", &c__0, &c__0, &anorm, &ssfmin, &i__1, &c__1, &e[l], n, + dlascl_("G", &c__0, &c__0, &anorm, &ssfmin, &i__1, &c__1, &e[l], n, info); } @@ -283,7 +283,7 @@ extern "C" { if (lend > l) { -/* QL Iteration +/* QL Iteration Look for small subdiagonal element. */ @@ -295,7 +295,7 @@ extern "C" { /* Computing 2nd power */ d__2 = (d__1 = e[m], abs(d__1)); tst = d__2 * d__2; - if (tst <= eps2 * (d__1 = d__[m], abs(d__1)) * (d__2 = d__[m + if (tst <= eps2 * (d__1 = d__[m], abs(d__1)) * (d__2 = d__[m + 1], abs(d__2)) + safmin) { goto L60; } @@ -314,7 +314,7 @@ extern "C" { goto L80; } -/* If remaining matrix is 2-by-2, use DLAE2 or SLAEV2 +/* If remaining matrix is 2-by-2, use DLAE2 or SLAEV2 to compute its eigensystem. */ if (m == l + 1) { @@ -404,7 +404,7 @@ extern "C" { } else { -/* QR Iteration +/* QR Iteration Look for small superdiagonal element. */ @@ -416,7 +416,7 @@ extern "C" { /* Computing 2nd power */ d__2 = (d__1 = e[m - 1], abs(d__1)); tst = d__2 * d__2; - if (tst <= eps2 * (d__1 = d__[m], abs(d__1)) * (d__2 = d__[m + if (tst <= eps2 * (d__1 = d__[m], abs(d__1)) * (d__2 = d__[m - 1], abs(d__2)) + safmin) { goto L110; } @@ -435,7 +435,7 @@ extern "C" { goto L130; } -/* If remaining matrix is 2-by-2, use DLAE2 or SLAEV2 +/* If remaining matrix is 2-by-2, use DLAE2 or SLAEV2 to compute its eigensystem. */ if (m == l - 1) { @@ -531,21 +531,21 @@ extern "C" { L140: if (iscale == 1) { i__1 = lendsv - lsv + 1; - dlascl_("G", &c__0, &c__0, &ssfmax, &anorm, &i__1, &c__1, &d__[lsv], + dlascl_("G", &c__0, &c__0, &ssfmax, &anorm, &i__1, &c__1, &d__[lsv], n, info); i__1 = lendsv - lsv; - dlascl_("G", &c__0, &c__0, &ssfmax, &anorm, &i__1, &c__1, &e[lsv], n, + dlascl_("G", &c__0, &c__0, &ssfmax, &anorm, &i__1, &c__1, &e[lsv], n, info); } else if (iscale == 2) { i__1 = lendsv - lsv + 1; - dlascl_("G", &c__0, &c__0, &ssfmin, &anorm, &i__1, &c__1, &d__[lsv], + dlascl_("G", &c__0, &c__0, &ssfmin, &anorm, &i__1, &c__1, &d__[lsv], n, info); i__1 = lendsv - lsv; - dlascl_("G", &c__0, &c__0, &ssfmin, &anorm, &i__1, &c__1, &e[lsv], n, + dlascl_("G", &c__0, &c__0, &ssfmin, &anorm, &i__1, &c__1, &e[lsv], n, info); } -/* Check for no convergence to an eigenvalue after a total +/* Check for no convergence to an eigenvalue after a total of N*MAXIT iterations. */ if (jtot < nmaxit) { diff --git a/external/hypre/src/lapack/dsterf.c b/external/hypre/src/lapack/dsterf.c index 80d25f58..7daab0ba 100644 --- a/external/hypre/src/lapack/dsterf.c +++ b/external/hypre/src/lapack/dsterf.c @@ -8,87 +8,87 @@ extern "C" { #include "f2c.h" #include "hypre_lapack.h" -/* Subroutine */ integer dsterf_(integer *n, doublereal *d__, doublereal *e, +/* Subroutine */ integer dsterf_(integer *n, doublereal *d__, doublereal *e, integer *info) { -/* -- LAPACK routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - June 30, 1999 +/* -- LAPACK routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + June 30, 1999 - Purpose - ======= + Purpose + ======= - DSTERF computes all eigenvalues of a symmetric tridiagonal matrix - using the Pal-Walker-Kahan variant of the QL or QR algorithm. + DSTERF computes all eigenvalues of a symmetric tridiagonal matrix + using the Pal-Walker-Kahan variant of the QL or QR algorithm. - Arguments - ========= + Arguments + ========= - N (input) INTEGER - The order of the matrix. N >= 0. + N (input) INTEGER + The order of the matrix. N >= 0. - D (input/output) DOUBLE PRECISION array, dimension (N) - On entry, the n diagonal elements of the tridiagonal matrix. - On exit, if INFO = 0, the eigenvalues in ascending order. + D (input/output) DOUBLE PRECISION array, dimension (N) + On entry, the n diagonal elements of the tridiagonal matrix. + On exit, if INFO = 0, the eigenvalues in ascending order. - E (input/output) DOUBLE PRECISION array, dimension (N-1) - On entry, the (n-1) subdiagonal elements of the tridiagonal - matrix. - On exit, E has been destroyed. + E (input/output) DOUBLE PRECISION array, dimension (N-1) + On entry, the (n-1) subdiagonal elements of the tridiagonal + matrix. + On exit, E has been destroyed. - INFO (output) INTEGER - = 0: successful exit - < 0: if INFO = -i, the i-th argument had an illegal value - > 0: the algorithm failed to find all of the eigenvalues in - a total of 30*N iterations; if INFO = i, then i - elements of E have not converged to zero. + INFO (output) INTEGER + = 0: successful exit + < 0: if INFO = -i, the i-th argument had an illegal value + > 0: the algorithm failed to find all of the eigenvalues in + a total of 30*N iterations; if INFO = i, then i + elements of E have not converged to zero. - ===================================================================== + ===================================================================== - Test the input parameters. + Test the input parameters. Parameter adjustments */ /* Table of constant values */ - static integer c__0 = 0; - static integer c__1 = 1; - static doublereal c_b32 = 1.; - + integer c__0 = 0; + integer c__1 = 1; + doublereal c_b32 = 1.; + /* System generated locals */ integer i__1; doublereal d__1, d__2, d__3; /* Builtin functions */ doublereal d_sign(doublereal *, doublereal *); /* Local variables */ - static doublereal oldc; - static integer lend, jtot; - extern /* Subroutine */ integer dlae2_(doublereal *, doublereal *, doublereal + doublereal oldc; + integer lend, jtot; + extern /* Subroutine */ integer dlae2_(doublereal *, doublereal *, doublereal *, doublereal *, doublereal *); - static doublereal c__; - static integer i__, l, m; - static doublereal p, gamma, r__, s, alpha, sigma, anorm; - static integer l1; + doublereal c__; + integer i__, l, m; + doublereal p, gamma, r__, s, alpha, sigma, anorm; + integer l1; extern doublereal dlapy2_(doublereal *, doublereal *); - static doublereal bb; + doublereal bb; extern doublereal dlamch_(const char *); - static integer iscale; - extern /* Subroutine */ integer dlascl_(const char *, integer *, integer *, - doublereal *, doublereal *, integer *, integer *, doublereal *, + integer iscale; + extern /* Subroutine */ integer dlascl_(const char *, integer *, integer *, + doublereal *, doublereal *, integer *, integer *, doublereal *, integer *, integer *); - static doublereal oldgam, safmin; + doublereal oldgam, safmin; extern /* Subroutine */ integer xerbla_(const char *, integer *); - static doublereal safmax; + doublereal safmax; extern doublereal dlanst_(const char *, integer *, doublereal *, doublereal *); - extern /* Subroutine */ integer dlasrt_(const char *, integer *, doublereal *, + extern /* Subroutine */ integer dlasrt_(const char *, integer *, doublereal *, integer *); - static integer lendsv; - static doublereal ssfmin; - static integer nmaxit; - static doublereal ssfmax, rt1, rt2, eps, rte; - static integer lsv; - static doublereal eps2; + integer lendsv; + doublereal ssfmin; + integer nmaxit; + doublereal ssfmax, rt1, rt2, eps, rte; + integer lsv; + doublereal eps2; --e; @@ -126,8 +126,8 @@ extern "C" { sigma = 0.; jtot = 0; -/* Determine where the matrix splits and choose QL or QR iteration - for each block, according to whether top or bottom diagonal +/* Determine where the matrix splits and choose QL or QR iteration + for each block, according to whether top or bottom diagonal element is smaller. */ l1 = 1; @@ -141,7 +141,7 @@ extern "C" { } i__1 = *n - 1; for (m = l1; m <= i__1; ++m) { - if ((d__3 = e[m], abs(d__3)) <= sqrt((d__1 = d__[m], abs(d__1))) * + if ((d__3 = e[m], abs(d__3)) <= sqrt((d__1 = d__[m], abs(d__1))) * sqrt((d__2 = d__[m + 1], abs(d__2))) * eps) { e[m] = 0.; goto L30; @@ -168,18 +168,18 @@ extern "C" { if (anorm > ssfmax) { iscale = 1; i__1 = lend - l + 1; - dlascl_("G", &c__0, &c__0, &anorm, &ssfmax, &i__1, &c__1, &d__[l], n, + dlascl_("G", &c__0, &c__0, &anorm, &ssfmax, &i__1, &c__1, &d__[l], n, info); i__1 = lend - l; - dlascl_("G", &c__0, &c__0, &anorm, &ssfmax, &i__1, &c__1, &e[l], n, + dlascl_("G", &c__0, &c__0, &anorm, &ssfmax, &i__1, &c__1, &e[l], n, info); } else if (anorm < ssfmin) { iscale = 2; i__1 = lend - l + 1; - dlascl_("G", &c__0, &c__0, &anorm, &ssfmin, &i__1, &c__1, &d__[l], n, + dlascl_("G", &c__0, &c__0, &anorm, &ssfmin, &i__1, &c__1, &d__[l], n, info); i__1 = lend - l; - dlascl_("G", &c__0, &c__0, &anorm, &ssfmin, &i__1, &c__1, &e[l], n, + dlascl_("G", &c__0, &c__0, &anorm, &ssfmin, &i__1, &c__1, &e[l], n, info); } @@ -200,7 +200,7 @@ extern "C" { if (lend >= l) { -/* QL Iteration +/* QL Iteration Look for small subdiagonal element. */ @@ -208,7 +208,7 @@ extern "C" { if (l != lend) { i__1 = lend - 1; for (m = l; m <= i__1; ++m) { - if ((d__2 = e[m], abs(d__2)) <= eps2 * (d__1 = d__[m] * d__[m + if ((d__2 = e[m], abs(d__2)) <= eps2 * (d__1 = d__[m] * d__[m + 1], abs(d__1))) { goto L70; } @@ -226,7 +226,7 @@ extern "C" { goto L90; } -/* If remaining matrix is 2 by 2, use DLAE2 to compute its +/* If remaining matrix is 2 by 2, use DLAE2 to compute its eigenvalues. */ if (m == l + 1) { @@ -300,14 +300,14 @@ extern "C" { } else { -/* QR Iteration +/* QR Iteration Look for small superdiagonal element. */ L100: i__1 = lend + 1; for (m = l; m >= i__1; --m) { - if ((d__2 = e[m - 1], abs(d__2)) <= eps2 * (d__1 = d__[m] * d__[m + if ((d__2 = e[m - 1], abs(d__2)) <= eps2 * (d__1 = d__[m] * d__[m - 1], abs(d__1))) { goto L120; } @@ -324,7 +324,7 @@ extern "C" { goto L140; } -/* If remaining matrix is 2 by 2, use DLAE2 to compute its +/* If remaining matrix is 2 by 2, use DLAE2 to compute its eigenvalues. */ if (m == l - 1) { @@ -403,16 +403,16 @@ extern "C" { L150: if (iscale == 1) { i__1 = lendsv - lsv + 1; - dlascl_("G", &c__0, &c__0, &ssfmax, &anorm, &i__1, &c__1, &d__[lsv], + dlascl_("G", &c__0, &c__0, &ssfmax, &anorm, &i__1, &c__1, &d__[lsv], n, info); } if (iscale == 2) { i__1 = lendsv - lsv + 1; - dlascl_("G", &c__0, &c__0, &ssfmin, &anorm, &i__1, &c__1, &d__[lsv], + dlascl_("G", &c__0, &c__0, &ssfmin, &anorm, &i__1, &c__1, &d__[lsv], n, info); } -/* Check for no convergence to an eigenvalue after a total +/* Check for no convergence to an eigenvalue after a total of N*MAXIT iterations. */ if (jtot < nmaxit) { diff --git a/external/hypre/src/lapack/dsyev.c b/external/hypre/src/lapack/dsyev.c index 5ac2fca9..937115ce 100644 --- a/external/hypre/src/lapack/dsyev.c +++ b/external/hypre/src/lapack/dsyev.c @@ -9,127 +9,127 @@ extern "C" { #include "hypre_lapack.h" /* Subroutine */ integer dsyev_(const char *jobz,const char *uplo, integer *n, doublereal *a, - integer *lda, doublereal *w, doublereal *work, integer *lwork, + integer *lda, doublereal *w, doublereal *work, integer *lwork, integer *info) { -/* -- LAPACK driver routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - June 30, 1999 +/* -- LAPACK driver routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + June 30, 1999 - Purpose - ======= + Purpose + ======= - DSYEV computes all eigenvalues and, optionally, eigenvectors of a - real symmetric matrix A. + DSYEV computes all eigenvalues and, optionally, eigenvectors of a + real symmetric matrix A. - Arguments - ========= + Arguments + ========= - JOBZ (input) CHARACTER*1 - = 'N': Compute eigenvalues only; - = 'V': Compute eigenvalues and eigenvectors. + JOBZ (input) CHARACTER*1 + = 'N': Compute eigenvalues only; + = 'V': Compute eigenvalues and eigenvectors. - UPLO (input) CHARACTER*1 - = 'U': Upper triangle of A is stored; - = 'L': Lower triangle of A is stored. + UPLO (input) CHARACTER*1 + = 'U': Upper triangle of A is stored; + = 'L': Lower triangle of A is stored. - N (input) INTEGER - The order of the matrix A. N >= 0. + N (input) INTEGER + The order of the matrix A. N >= 0. - A (input/output) DOUBLE PRECISION array, dimension (LDA, N) - On entry, the symmetric matrix A. If UPLO = 'U', the - leading N-by-N upper triangular part of A contains the - upper triangular part of the matrix A. If UPLO = 'L', - the leading N-by-N lower triangular part of A contains - the lower triangular part of the matrix A. - On exit, if JOBZ = 'V', then if INFO = 0, A contains the - orthonormal eigenvectors of the matrix A. - If JOBZ = 'N', then on exit the lower triangle (if UPLO='L') - or the upper triangle (if UPLO='U') of A, including the - diagonal, is destroyed. + A (input/output) DOUBLE PRECISION array, dimension (LDA, N) + On entry, the symmetric matrix A. If UPLO = 'U', the + leading N-by-N upper triangular part of A contains the + upper triangular part of the matrix A. If UPLO = 'L', + the leading N-by-N lower triangular part of A contains + the lower triangular part of the matrix A. + On exit, if JOBZ = 'V', then if INFO = 0, A contains the + orthonormal eigenvectors of the matrix A. + If JOBZ = 'N', then on exit the lower triangle (if UPLO='L') + or the upper triangle (if UPLO='U') of A, including the + diagonal, is destroyed. - LDA (input) INTEGER - The leading dimension of the array A. LDA >= max(1,N). + LDA (input) INTEGER + The leading dimension of the array A. LDA >= max(1,N). - W (output) DOUBLE PRECISION array, dimension (N) - If INFO = 0, the eigenvalues in ascending order. + W (output) DOUBLE PRECISION array, dimension (N) + If INFO = 0, the eigenvalues in ascending order. - WORK (workspace/output) DOUBLE PRECISION array, dimension (LWORK) - On exit, if INFO = 0, WORK(1) returns the optimal LWORK. + WORK (workspace/output) DOUBLE PRECISION array, dimension (LWORK) + On exit, if INFO = 0, WORK(1) returns the optimal LWORK. - LWORK (input) INTEGER - The length of the array WORK. LWORK >= max(1,3*N-1). - For optimal efficiency, LWORK >= (NB+2)*N, - where NB is the blocksize for DSYTRD returned by ILAENV. + LWORK (input) INTEGER + The length of the array WORK. LWORK >= max(1,3*N-1). + For optimal efficiency, LWORK >= (NB+2)*N, + where NB is the blocksize for DSYTRD returned by ILAENV. - If LWORK = -1, then a workspace query is assumed; the routine - only calculates the optimal size of the WORK array, returns - this value as the first entry of the WORK array, and no error - message related to LWORK is issued by XERBLA. + If LWORK = -1, then a workspace query is assumed; the routine + only calculates the optimal size of the WORK array, returns + this value as the first entry of the WORK array, and no error + message related to LWORK is issued by XERBLA. - INFO (output) INTEGER - = 0: successful exit - < 0: if INFO = -i, the i-th argument had an illegal value - > 0: if INFO = i, the algorithm failed to converge; i - off-diagonal elements of an intermediate tridiagonal - form did not converge to zero. + INFO (output) INTEGER + = 0: successful exit + < 0: if INFO = -i, the i-th argument had an illegal value + > 0: if INFO = i, the algorithm failed to converge; i + off-diagonal elements of an intermediate tridiagonal + form did not converge to zero. - ===================================================================== + ===================================================================== - Test the input parameters. + Test the input parameters. Parameter adjustments */ /* Table of constant values */ - static integer c__1 = 1; - static integer c_n1 = -1; - static integer c__0 = 0; - static doublereal c_b17 = 1.; - + integer c__1 = 1; + integer c_n1 = -1; + integer c__0 = 0; + doublereal c_b17 = 1.; + /* System generated locals */ integer a_dim1, a_offset, i__1, i__2; doublereal d__1; /* Local variables */ - static integer inde; - static doublereal anrm; - static integer imax; - static doublereal rmin, rmax; -/***static integer lopt;***/ - extern /* Subroutine */ integer dscal_(integer *, doublereal *, doublereal *, + integer inde; + doublereal anrm; + integer imax; + doublereal rmin, rmax; +/*** integer lopt;***/ + extern /* Subroutine */ integer dscal_(integer *, doublereal *, doublereal *, integer *); - static doublereal sigma; + doublereal sigma; extern logical lsame_(const char *,const char *); - static integer iinfo; - static logical lower, wantz; - static integer nb; + integer iinfo; + logical lower, wantz; + integer nb; extern doublereal dlamch_(const char *); - static integer iscale; - extern /* Subroutine */ integer dlascl_(const char *, integer *, integer *, - doublereal *, doublereal *, integer *, integer *, doublereal *, + integer iscale; + extern /* Subroutine */ integer dlascl_(const char *, integer *, integer *, + doublereal *, doublereal *, integer *, integer *, doublereal *, integer *, integer *); - static doublereal safmin; - extern integer ilaenv_(integer *,const char *,const char *, integer *, integer *, + doublereal safmin; + extern integer ilaenv_(integer *,const char *,const char *, integer *, integer *, integer *, integer *, ftnlen, ftnlen); extern /* Subroutine */ integer xerbla_(const char *, integer *); - static doublereal bignum; - static integer indtau; + doublereal bignum; + integer indtau; extern /* Subroutine */ integer dsterf_(integer *, doublereal *, doublereal *, integer *); - extern doublereal dlansy_(const char *,const char *, integer *, doublereal *, + extern doublereal dlansy_(const char *,const char *, integer *, doublereal *, integer *, doublereal *); - static integer indwrk; - extern /* Subroutine */ integer dorgtr_(const char *, integer *, doublereal *, - integer *, doublereal *, doublereal *, integer *, integer *), dsteqr_(const char *, integer *, doublereal *, doublereal *, - doublereal *, integer *, doublereal *, integer *), - dsytrd_(const char *, integer *, doublereal *, integer *, doublereal *, + integer indwrk; + extern /* Subroutine */ integer dorgtr_(const char *, integer *, doublereal *, + integer *, doublereal *, doublereal *, integer *, integer *), dsteqr_(const char *, integer *, doublereal *, doublereal *, + doublereal *, integer *, doublereal *, integer *), + dsytrd_(const char *, integer *, doublereal *, integer *, doublereal *, doublereal *, doublereal *, doublereal *, integer *, integer *); - static integer llwork; - static doublereal smlnum; - static integer lwkopt; - static logical lquery; - static doublereal eps; + integer llwork; + doublereal smlnum; + integer lwkopt; + logical lquery; + doublereal eps; #define a_ref(a_1,a_2) a[(a_2)*a_dim1 + a_1] @@ -215,7 +215,7 @@ extern "C" { sigma = rmax / anrm; } if (iscale == 1) { - dlascl_(uplo, &c__0, &c__0, &c_b17, &sigma, n, n, &a[a_offset], lda, + dlascl_(uplo, &c__0, &c__0, &c_b17, &sigma, n, n, &a[a_offset], lda, info); } @@ -229,7 +229,7 @@ extern "C" { work[indwrk], &llwork, &iinfo); /***lopt = (integer) ((*n << 1) + work[indwrk]);***/ -/* For eigenvalues only, call DSTERF. For eigenvectors, first call +/* For eigenvalues only, call DSTERF. For eigenvectors, first call DORGTR to generate the orthogonal matrix, then call DSTEQR. */ if (! wantz) { diff --git a/external/hypre/src/lapack/dsygs2.c b/external/hypre/src/lapack/dsygs2.c index af4c4ec4..66c1aff0 100644 --- a/external/hypre/src/lapack/dsygs2.c +++ b/external/hypre/src/lapack/dsygs2.c @@ -8,103 +8,103 @@ extern "C" { #include "f2c.h" #include "hypre_lapack.h" -/* Subroutine */ integer dsygs2_(integer *itype,const char *uplo, integer *n, +/* Subroutine */ integer dsygs2_(integer *itype,const char *uplo, integer *n, doublereal *a, integer *lda, doublereal *b, integer *ldb, integer * info) { -/* -- LAPACK routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - February 29, 1992 +/* -- LAPACK routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + February 29, 1992 - Purpose - ======= + Purpose + ======= - DSYGS2 reduces a real symmetric-definite generalized eigenproblem - to standard form. + DSYGS2 reduces a real symmetric-definite generalized eigenproblem + to standard form. - If ITYPE = 1, the problem is A*x = lambda*B*x, - and A is overwritten by inv(U')*A*inv(U) or inv(L)*A*inv(L') + If ITYPE = 1, the problem is A*x = lambda*B*x, + and A is overwritten by inv(U')*A*inv(U) or inv(L)*A*inv(L') - If ITYPE = 2 or 3, the problem is A*B*x = lambda*x or - B*A*x = lambda*x, and A is overwritten by U*A*U` or L'*A*L. + If ITYPE = 2 or 3, the problem is A*B*x = lambda*x or + B*A*x = lambda*x, and A is overwritten by U*A*U` or L'*A*L. - B must have been previously factorized as U'*U or L*L' by DPOTRF. + B must have been previously factorized as U'*U or L*L' by DPOTRF. - Arguments - ========= + Arguments + ========= - ITYPE (input) INTEGER - = 1: compute inv(U')*A*inv(U) or inv(L)*A*inv(L'); - = 2 or 3: compute U*A*U' or L'*A*L. + ITYPE (input) INTEGER + = 1: compute inv(U')*A*inv(U) or inv(L)*A*inv(L'); + = 2 or 3: compute U*A*U' or L'*A*L. - UPLO (input) CHARACTER - Specifies whether the upper or lower triangular part of the - symmetric matrix A is stored, and how B has been factorized. - = 'U': Upper triangular - = 'L': Lower triangular + UPLO (input) CHARACTER + Specifies whether the upper or lower triangular part of the + symmetric matrix A is stored, and how B has been factorized. + = 'U': Upper triangular + = 'L': Lower triangular - N (input) INTEGER - The order of the matrices A and B. N >= 0. + N (input) INTEGER + The order of the matrices A and B. N >= 0. - A (input/output) DOUBLE PRECISION array, dimension (LDA,N) - On entry, the symmetric matrix A. If UPLO = 'U', the leading - n by n upper triangular part of A contains the upper - triangular part of the matrix A, and the strictly lower - triangular part of A is not referenced. If UPLO = 'L', the - leading n by n lower triangular part of A contains the lower - triangular part of the matrix A, and the strictly upper - triangular part of A is not referenced. + A (input/output) DOUBLE PRECISION array, dimension (LDA,N) + On entry, the symmetric matrix A. If UPLO = 'U', the leading + n by n upper triangular part of A contains the upper + triangular part of the matrix A, and the strictly lower + triangular part of A is not referenced. If UPLO = 'L', the + leading n by n lower triangular part of A contains the lower + triangular part of the matrix A, and the strictly upper + triangular part of A is not referenced. - On exit, if INFO = 0, the transformed matrix, stored in the - same format as A. + On exit, if INFO = 0, the transformed matrix, stored in the + same format as A. - LDA (input) INTEGER - The leading dimension of the array A. LDA >= max(1,N). + LDA (input) INTEGER + The leading dimension of the array A. LDA >= max(1,N). - B (input) DOUBLE PRECISION array, dimension (LDB,N) - The triangular factor from the Cholesky factorization of B, - as returned by DPOTRF. + B (input) DOUBLE PRECISION array, dimension (LDB,N) + The triangular factor from the Cholesky factorization of B, + as returned by DPOTRF. - LDB (input) INTEGER - The leading dimension of the array B. LDB >= max(1,N). + LDB (input) INTEGER + The leading dimension of the array B. LDB >= max(1,N). - INFO (output) INTEGER - = 0: successful exit. - < 0: if INFO = -i, the i-th argument had an illegal value. + INFO (output) INTEGER + = 0: successful exit. + < 0: if INFO = -i, the i-th argument had an illegal value. - ===================================================================== + ===================================================================== - Test the input parameters. + Test the input parameters. Parameter adjustments */ /* Table of constant values */ - static doublereal c_b6 = -1.; - static integer c__1 = 1; - static doublereal c_b27 = 1.; - + doublereal c_b6 = -1.; + integer c__1 = 1; + doublereal c_b27 = 1.; + /* System generated locals */ integer a_dim1, a_offset, b_dim1, b_offset, i__1, i__2; doublereal d__1; /* Local variables */ - extern /* Subroutine */ integer dsyr2_(const char *, integer *, doublereal *, - doublereal *, integer *, doublereal *, integer *, doublereal *, + extern /* Subroutine */ integer dsyr2_(const char *, integer *, doublereal *, + doublereal *, integer *, doublereal *, integer *, doublereal *, integer *); - static integer k; - extern /* Subroutine */ integer dscal_(integer *, doublereal *, doublereal *, + integer k; + extern /* Subroutine */ integer dscal_(integer *, doublereal *, doublereal *, integer *); extern logical lsame_(const char *,const char *); - extern /* Subroutine */ integer daxpy_(integer *, doublereal *, doublereal *, + extern /* Subroutine */ integer daxpy_(integer *, doublereal *, doublereal *, integer *, doublereal *, integer *); - static logical upper; - extern /* Subroutine */ integer dtrmv_(const char *,const char *,const char *, integer *, - doublereal *, integer *, doublereal *, integer *), dtrsv_(const char *,const char *,const char *, integer *, doublereal *, + logical upper; + extern /* Subroutine */ integer dtrmv_(const char *,const char *,const char *, integer *, + doublereal *, integer *, doublereal *, integer *), dtrsv_(const char *,const char *,const char *, integer *, doublereal *, integer *, doublereal *, integer *); - static doublereal ct; + doublereal ct; extern /* Subroutine */ integer xerbla_(const char *, integer *); - static doublereal akk, bkk; + doublereal akk, bkk; #define a_ref(a_1,a_2) a[(a_2)*a_dim1 + a_1] #define b_ref(a_1,a_2) b[(a_2)*b_dim1 + a_1] @@ -193,16 +193,16 @@ extern "C" { dscal_(&i__2, &d__1, &a_ref(k + 1, k), &c__1); ct = akk * -.5; i__2 = *n - k; - daxpy_(&i__2, &ct, &b_ref(k + 1, k), &c__1, &a_ref(k + 1, + daxpy_(&i__2, &ct, &b_ref(k + 1, k), &c__1, &a_ref(k + 1, k), &c__1); i__2 = *n - k; dsyr2_(uplo, &i__2, &c_b6, &a_ref(k + 1, k), &c__1, & b_ref(k + 1, k), &c__1, &a_ref(k + 1, k + 1), lda); i__2 = *n - k; - daxpy_(&i__2, &ct, &b_ref(k + 1, k), &c__1, &a_ref(k + 1, + daxpy_(&i__2, &ct, &b_ref(k + 1, k), &c__1, &a_ref(k + 1, k), &c__1); i__2 = *n - k; - dtrsv_(uplo, "No transpose", "Non-unit", &i__2, &b_ref(k + dtrsv_(uplo, "No transpose", "Non-unit", &i__2, &b_ref(k + 1, k + 1), ldb, &a_ref(k + 1, k), &c__1); } /* L20: */ @@ -221,7 +221,7 @@ extern "C" { akk = a_ref(k, k); bkk = b_ref(k, k); i__2 = k - 1; - dtrmv_(uplo, "No transpose", "Non-unit", &i__2, &b[b_offset], + dtrmv_(uplo, "No transpose", "Non-unit", &i__2, &b[b_offset], ldb, &a_ref(1, k), &c__1); ct = akk * .5; i__2 = k - 1; @@ -250,13 +250,13 @@ extern "C" { akk = a_ref(k, k); bkk = b_ref(k, k); i__2 = k - 1; - dtrmv_(uplo, "Transpose", "Non-unit", &i__2, &b[b_offset], + dtrmv_(uplo, "Transpose", "Non-unit", &i__2, &b[b_offset], ldb, &a_ref(k, 1), lda); ct = akk * .5; i__2 = k - 1; daxpy_(&i__2, &ct, &b_ref(k, 1), ldb, &a_ref(k, 1), lda); i__2 = k - 1; - dsyr2_(uplo, &i__2, &c_b27, &a_ref(k, 1), lda, &b_ref(k, 1), + dsyr2_(uplo, &i__2, &c_b27, &a_ref(k, 1), lda, &b_ref(k, 1), ldb, &a[a_offset], lda); i__2 = k - 1; daxpy_(&i__2, &ct, &b_ref(k, 1), ldb, &a_ref(k, 1), lda); diff --git a/external/hypre/src/lapack/dsygst.c b/external/hypre/src/lapack/dsygst.c index 17b40629..6e101d16 100644 --- a/external/hypre/src/lapack/dsygst.c +++ b/external/hypre/src/lapack/dsygst.c @@ -8,110 +8,110 @@ extern "C" { #include "f2c.h" #include "hypre_lapack.h" -/* Subroutine */ integer dsygst_(integer *itype,const char *uplo, integer *n, +/* Subroutine */ integer dsygst_(integer *itype,const char *uplo, integer *n, doublereal *a, integer *lda, doublereal *b, integer *ldb, integer * info) { -/* -- LAPACK routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - September 30, 1994 +/* -- LAPACK routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + September 30, 1994 - Purpose - ======= + Purpose + ======= - DSYGST reduces a real symmetric-definite generalized eigenproblem - to standard form. + DSYGST reduces a real symmetric-definite generalized eigenproblem + to standard form. - If ITYPE = 1, the problem is A*x = lambda*B*x, - and A is overwritten by inv(U**T)*A*inv(U) or inv(L)*A*inv(L**T) + If ITYPE = 1, the problem is A*x = lambda*B*x, + and A is overwritten by inv(U**T)*A*inv(U) or inv(L)*A*inv(L**T) - If ITYPE = 2 or 3, the problem is A*B*x = lambda*x or - B*A*x = lambda*x, and A is overwritten by U*A*U**T or L**T*A*L. + If ITYPE = 2 or 3, the problem is A*B*x = lambda*x or + B*A*x = lambda*x, and A is overwritten by U*A*U**T or L**T*A*L. - B must have been previously factorized as U**T*U or L*L**T by DPOTRF. + B must have been previously factorized as U**T*U or L*L**T by DPOTRF. - Arguments - ========= + Arguments + ========= - ITYPE (input) INTEGER - = 1: compute inv(U**T)*A*inv(U) or inv(L)*A*inv(L**T); - = 2 or 3: compute U*A*U**T or L**T*A*L. + ITYPE (input) INTEGER + = 1: compute inv(U**T)*A*inv(U) or inv(L)*A*inv(L**T); + = 2 or 3: compute U*A*U**T or L**T*A*L. - UPLO (input) CHARACTER - = 'U': Upper triangle of A is stored and B is factored as - U**T*U; - = 'L': Lower triangle of A is stored and B is factored as - L*L**T. + UPLO (input) CHARACTER + = 'U': Upper triangle of A is stored and B is factored as + U**T*U; + = 'L': Lower triangle of A is stored and B is factored as + L*L**T. - N (input) INTEGER - The order of the matrices A and B. N >= 0. + N (input) INTEGER + The order of the matrices A and B. N >= 0. - A (input/output) DOUBLE PRECISION array, dimension (LDA,N) - On entry, the symmetric matrix A. If UPLO = 'U', the leading - N-by-N upper triangular part of A contains the upper - triangular part of the matrix A, and the strictly lower - triangular part of A is not referenced. If UPLO = 'L', the - leading N-by-N lower triangular part of A contains the lower - triangular part of the matrix A, and the strictly upper - triangular part of A is not referenced. + A (input/output) DOUBLE PRECISION array, dimension (LDA,N) + On entry, the symmetric matrix A. If UPLO = 'U', the leading + N-by-N upper triangular part of A contains the upper + triangular part of the matrix A, and the strictly lower + triangular part of A is not referenced. If UPLO = 'L', the + leading N-by-N lower triangular part of A contains the lower + triangular part of the matrix A, and the strictly upper + triangular part of A is not referenced. - On exit, if INFO = 0, the transformed matrix, stored in the - same format as A. + On exit, if INFO = 0, the transformed matrix, stored in the + same format as A. - LDA (input) INTEGER - The leading dimension of the array A. LDA >= max(1,N). + LDA (input) INTEGER + The leading dimension of the array A. LDA >= max(1,N). - B (input) DOUBLE PRECISION array, dimension (LDB,N) - The triangular factor from the Cholesky factorization of B, - as returned by DPOTRF. + B (input) DOUBLE PRECISION array, dimension (LDB,N) + The triangular factor from the Cholesky factorization of B, + as returned by DPOTRF. - LDB (input) INTEGER - The leading dimension of the array B. LDB >= max(1,N). + LDB (input) INTEGER + The leading dimension of the array B. LDB >= max(1,N). - INFO (output) INTEGER - = 0: successful exit - < 0: if INFO = -i, the i-th argument had an illegal value + INFO (output) INTEGER + = 0: successful exit + < 0: if INFO = -i, the i-th argument had an illegal value - ===================================================================== + ===================================================================== - Test the input parameters. + Test the input parameters. Parameter adjustments */ /* Table of constant values */ - static integer c__1 = 1; - static integer c_n1 = -1; - static doublereal c_b14 = 1.; - static doublereal c_b16 = -.5; - static doublereal c_b19 = -1.; - static doublereal c_b52 = .5; - + integer c__1 = 1; + integer c_n1 = -1; + doublereal c_b14 = 1.; + doublereal c_b16 = -.5; + doublereal c_b19 = -1.; + doublereal c_b52 = .5; + /* System generated locals */ integer a_dim1, a_offset, b_dim1, b_offset, i__1, i__2, i__3; /* Local variables */ - static integer k; + integer k; extern logical lsame_(const char *,const char *); - extern /* Subroutine */ integer dtrmm_(const char *,const char *,const char *,const char *, - integer *, integer *, doublereal *, doublereal *, integer *, + extern /* Subroutine */ integer dtrmm_(const char *,const char *,const char *,const char *, + integer *, integer *, doublereal *, doublereal *, integer *, doublereal *, integer *), dsymm_( - const char *,const char *, integer *, integer *, doublereal *, doublereal *, - integer *, doublereal *, integer *, doublereal *, doublereal *, + const char *,const char *, integer *, integer *, doublereal *, doublereal *, + integer *, doublereal *, integer *, doublereal *, doublereal *, integer *); - static logical upper; - extern /* Subroutine */ integer dtrsm_(const char *,const char *,const char *,const char *, - integer *, integer *, doublereal *, doublereal *, integer *, + logical upper; + extern /* Subroutine */ integer dtrsm_(const char *,const char *,const char *,const char *, + integer *, integer *, doublereal *, doublereal *, integer *, doublereal *, integer *), dsygs2_( - integer *,const char *, integer *, doublereal *, integer *, doublereal + integer *,const char *, integer *, doublereal *, integer *, doublereal *, integer *, integer *); - static integer kb; - extern /* Subroutine */ integer dsyr2k_(const char *,const char *, integer *, integer *, - doublereal *, doublereal *, integer *, doublereal *, integer *, + integer kb; + extern /* Subroutine */ integer dsyr2k_(const char *,const char *, integer *, integer *, + doublereal *, doublereal *, integer *, doublereal *, integer *, doublereal *, doublereal *, integer *); - static integer nb; + integer nb; extern /* Subroutine */ integer xerbla_(const char *, integer *); - extern integer ilaenv_(integer *,const char *,const char *, integer *, integer *, + extern integer ilaenv_(integer *,const char *,const char *, integer *, integer *, integer *, integer *, ftnlen, ftnlen); #define a_ref(a_1,a_2) a[(a_2)*a_dim1 + a_1] #define b_ref(a_1,a_2) b[(a_2)*b_dim1 + a_1] @@ -183,7 +183,7 @@ extern "C" { if (k + kb <= *n) { i__3 = *n - k - kb + 1; dtrsm_("Left", uplo, "Transpose", "Non-unit", &kb, & - i__3, &c_b14, &b_ref(k, k), ldb, &a_ref(k, k + i__3, &c_b14, &b_ref(k, k), ldb, &a_ref(k, k + kb), lda); i__3 = *n - k - kb + 1; dsymm_("Left", uplo, &kb, &i__3, &c_b16, &a_ref(k, k), @@ -221,7 +221,7 @@ extern "C" { ldb, info); if (k + kb <= *n) { i__3 = *n - k - kb + 1; - dtrsm_("Right", uplo, "Transpose", "Non-unit", &i__3, + dtrsm_("Right", uplo, "Transpose", "Non-unit", &i__3, &kb, &c_b14, &b_ref(k, k), ldb, &a_ref(k + kb, k), lda); i__3 = *n - k - kb + 1; @@ -238,7 +238,7 @@ extern "C" { k + kb, k), lda); i__3 = *n - k - kb + 1; dtrsm_("Left", uplo, "No transpose", "Non-unit", & - i__3, &kb, &c_b14, &b_ref(k + kb, k + kb), + i__3, &kb, &c_b14, &b_ref(k + kb, k + kb), ldb, &a_ref(k + kb, k), lda); } /* L20: */ @@ -262,14 +262,14 @@ extern "C" { dtrmm_("Left", uplo, "No transpose", "Non-unit", &i__3, & kb, &c_b14, &b[b_offset], ldb, &a_ref(1, k), lda); i__3 = k - 1; - dsymm_("Right", uplo, &i__3, &kb, &c_b52, &a_ref(k, k), + dsymm_("Right", uplo, &i__3, &kb, &c_b52, &a_ref(k, k), lda, &b_ref(1, k), ldb, &c_b14, &a_ref(1, k), lda); i__3 = k - 1; dsyr2k_(uplo, "No transpose", &i__3, &kb, &c_b14, &a_ref( 1, k), lda, &b_ref(1, k), ldb, &c_b14, &a[ a_offset], lda); i__3 = k - 1; - dsymm_("Right", uplo, &i__3, &kb, &c_b52, &a_ref(k, k), + dsymm_("Right", uplo, &i__3, &kb, &c_b52, &a_ref(k, k), lda, &b_ref(1, k), ldb, &c_b14, &a_ref(1, k), lda); i__3 = k - 1; dtrmm_("Right", uplo, "Transpose", "Non-unit", &i__3, &kb, @@ -293,20 +293,20 @@ extern "C" { i__3 = k - 1; dtrmm_("Right", uplo, "No transpose", "Non-unit", &kb, & - i__3, &c_b14, &b[b_offset], ldb, &a_ref(k, 1), + i__3, &c_b14, &b[b_offset], ldb, &a_ref(k, 1), lda); i__3 = k - 1; - dsymm_("Left", uplo, &kb, &i__3, &c_b52, &a_ref(k, k), + dsymm_("Left", uplo, &kb, &i__3, &c_b52, &a_ref(k, k), lda, &b_ref(k, 1), ldb, &c_b14, &a_ref(k, 1), lda); i__3 = k - 1; - dsyr2k_(uplo, "Transpose", &i__3, &kb, &c_b14, &a_ref(k, - 1), lda, &b_ref(k, 1), ldb, &c_b14, &a[a_offset], + dsyr2k_(uplo, "Transpose", &i__3, &kb, &c_b14, &a_ref(k, + 1), lda, &b_ref(k, 1), ldb, &c_b14, &a[a_offset], lda); i__3 = k - 1; - dsymm_("Left", uplo, &kb, &i__3, &c_b52, &a_ref(k, k), + dsymm_("Left", uplo, &kb, &i__3, &c_b52, &a_ref(k, k), lda, &b_ref(k, 1), ldb, &c_b14, &a_ref(k, 1), lda); i__3 = k - 1; - dtrmm_("Left", uplo, "Transpose", "Non-unit", &kb, &i__3, + dtrmm_("Left", uplo, "Transpose", "Non-unit", &kb, &i__3, &c_b14, &b_ref(k, k), ldb, &a_ref(k, 1), lda); dsygs2_(itype, uplo, &kb, &a_ref(k, k), lda, &b_ref(k, k), ldb, info); diff --git a/external/hypre/src/lapack/dsygv.c b/external/hypre/src/lapack/dsygv.c index bf8ef81c..8eaf18b2 100644 --- a/external/hypre/src/lapack/dsygv.c +++ b/external/hypre/src/lapack/dsygv.c @@ -115,35 +115,35 @@ extern "C" { Parameter adjustments */ /* Table of constant values */ - static integer c__1 = 1; - static integer c_n1 = -1; - static doublereal c_b16 = 1.; + integer c__1 = 1; + integer c_n1 = -1; + doublereal c_b16 = 1.; /* System generated locals */ integer a_dim1, a_offset, b_dim1, b_offset, i__1, i__2; /* Local variables */ - static integer neig; + integer neig; extern logical lsame_(const char *,const char *); extern /* Subroutine */ integer dtrmm_(const char *,const char *,const char *,const char *, integer *, integer *, doublereal *, doublereal *, integer *, doublereal *, integer *); - static char trans[1]; + char trans[1]; extern /* Subroutine */ integer dtrsm_(const char *,const char *,const char *,const char *, integer *, integer *, doublereal *, doublereal *, integer *, doublereal *, integer *); - static logical upper; + logical upper; extern /* Subroutine */ integer dsyev_(const char *,const char *, integer *, doublereal * , integer *, doublereal *, doublereal *, integer *, integer *); - static logical wantz; - static integer nb; + logical wantz; + integer nb; extern /* Subroutine */ integer xerbla_(const char *, integer *); extern integer ilaenv_(integer *,const char *,const char *, integer *, integer *, integer *, integer *, ftnlen, ftnlen); extern /* Subroutine */ integer dpotrf_(const char *, integer *, doublereal *, integer *, integer *), dsygst_(integer *,const char *, integer *, doublereal *, integer *, doublereal *, integer *, integer *); - static integer lwkopt; - static logical lquery; + integer lwkopt; + logical lquery; a_dim1 = *lda; diff --git a/external/hypre/src/lapack/dsytd2.c b/external/hypre/src/lapack/dsytd2.c index d63b4bf5..14911e28 100644 --- a/external/hypre/src/lapack/dsytd2.c +++ b/external/hypre/src/lapack/dsytd2.c @@ -11,139 +11,139 @@ extern "C" { /* Subroutine */ integer dsytd2_(const char *uplo, integer *n, doublereal *a, integer * lda, doublereal *d__, doublereal *e, doublereal *tau, integer *info) { -/* -- LAPACK routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - October 31, 1992 +/* -- LAPACK routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + October 31, 1992 - Purpose - ======= + Purpose + ======= - DSYTD2 reduces a real symmetric matrix A to symmetric tridiagonal - form T by an orthogonal similarity transformation: Q' * A * Q = T. + DSYTD2 reduces a real symmetric matrix A to symmetric tridiagonal + form T by an orthogonal similarity transformation: Q' * A * Q = T. - Arguments - ========= + Arguments + ========= - UPLO (input) CHARACTER*1 - Specifies whether the upper or lower triangular part of the - symmetric matrix A is stored: - = 'U': Upper triangular - = 'L': Lower triangular + UPLO (input) CHARACTER*1 + Specifies whether the upper or lower triangular part of the + symmetric matrix A is stored: + = 'U': Upper triangular + = 'L': Lower triangular - N (input) INTEGER - The order of the matrix A. N >= 0. + N (input) INTEGER + The order of the matrix A. N >= 0. - A (input/output) DOUBLE PRECISION array, dimension (LDA,N) - On entry, the symmetric matrix A. If UPLO = 'U', the leading - n-by-n upper triangular part of A contains the upper - triangular part of the matrix A, and the strictly lower - triangular part of A is not referenced. If UPLO = 'L', the - leading n-by-n lower triangular part of A contains the lower - triangular part of the matrix A, and the strictly upper - triangular part of A is not referenced. - On exit, if UPLO = 'U', the diagonal and first superdiagonal - of A are overwritten by the corresponding elements of the - tridiagonal matrix T, and the elements above the first - superdiagonal, with the array TAU, represent the orthogonal - matrix Q as a product of elementary reflectors; if UPLO - = 'L', the diagonal and first subdiagonal of A are over- - written by the corresponding elements of the tridiagonal - matrix T, and the elements below the first subdiagonal, with - the array TAU, represent the orthogonal matrix Q as a product - of elementary reflectors. See Further Details. + A (input/output) DOUBLE PRECISION array, dimension (LDA,N) + On entry, the symmetric matrix A. If UPLO = 'U', the leading + n-by-n upper triangular part of A contains the upper + triangular part of the matrix A, and the strictly lower + triangular part of A is not referenced. If UPLO = 'L', the + leading n-by-n lower triangular part of A contains the lower + triangular part of the matrix A, and the strictly upper + triangular part of A is not referenced. + On exit, if UPLO = 'U', the diagonal and first superdiagonal + of A are overwritten by the corresponding elements of the + tridiagonal matrix T, and the elements above the first + superdiagonal, with the array TAU, represent the orthogonal + matrix Q as a product of elementary reflectors; if UPLO + = 'L', the diagonal and first subdiagonal of A are over- + written by the corresponding elements of the tridiagonal + matrix T, and the elements below the first subdiagonal, with + the array TAU, represent the orthogonal matrix Q as a product + of elementary reflectors. See Further Details. - LDA (input) INTEGER - The leading dimension of the array A. LDA >= max(1,N). + LDA (input) INTEGER + The leading dimension of the array A. LDA >= max(1,N). - D (output) DOUBLE PRECISION array, dimension (N) - The diagonal elements of the tridiagonal matrix T: - D(i) = A(i,i). + D (output) DOUBLE PRECISION array, dimension (N) + The diagonal elements of the tridiagonal matrix T: + D(i) = A(i,i). - E (output) DOUBLE PRECISION array, dimension (N-1) - The off-diagonal elements of the tridiagonal matrix T: - E(i) = A(i,i+1) if UPLO = 'U', E(i) = A(i+1,i) if UPLO = 'L'. + E (output) DOUBLE PRECISION array, dimension (N-1) + The off-diagonal elements of the tridiagonal matrix T: + E(i) = A(i,i+1) if UPLO = 'U', E(i) = A(i+1,i) if UPLO = 'L'. - TAU (output) DOUBLE PRECISION array, dimension (N-1) - The scalar factors of the elementary reflectors (see Further - Details). + TAU (output) DOUBLE PRECISION array, dimension (N-1) + The scalar factors of the elementary reflectors (see Further + Details). - INFO (output) INTEGER - = 0: successful exit - < 0: if INFO = -i, the i-th argument had an illegal value. + INFO (output) INTEGER + = 0: successful exit + < 0: if INFO = -i, the i-th argument had an illegal value. - Further Details - =============== + Further Details + =============== - If UPLO = 'U', the matrix Q is represented as a product of elementary - reflectors + If UPLO = 'U', the matrix Q is represented as a product of elementary + reflectors - Q = H(n-1) . . . H(2) H(1). + Q = H(n-1) . . . H(2) H(1). - Each H(i) has the form + Each H(i) has the form - H(i) = I - tau * v * v' + H(i) = I - tau * v * v' - where tau is a real scalar, and v is a real vector with - v(i+1:n) = 0 and v(i) = 1; v(1:i-1) is stored on exit in - A(1:i-1,i+1), and tau in TAU(i). + where tau is a real scalar, and v is a real vector with + v(i+1:n) = 0 and v(i) = 1; v(1:i-1) is stored on exit in + A(1:i-1,i+1), and tau in TAU(i). - If UPLO = 'L', the matrix Q is represented as a product of elementary - reflectors + If UPLO = 'L', the matrix Q is represented as a product of elementary + reflectors - Q = H(1) H(2) . . . H(n-1). + Q = H(1) H(2) . . . H(n-1). - Each H(i) has the form + Each H(i) has the form - H(i) = I - tau * v * v' + H(i) = I - tau * v * v' - where tau is a real scalar, and v is a real vector with - v(1:i) = 0 and v(i+1) = 1; v(i+2:n) is stored on exit in A(i+2:n,i), - and tau in TAU(i). + where tau is a real scalar, and v is a real vector with + v(1:i) = 0 and v(i+1) = 1; v(i+2:n) is stored on exit in A(i+2:n,i), + and tau in TAU(i). - The contents of A on exit are illustrated by the following examples - with n = 5: + The contents of A on exit are illustrated by the following examples + with n = 5: - if UPLO = 'U': if UPLO = 'L': + if UPLO = 'U': if UPLO = 'L': - ( d e v2 v3 v4 ) ( d ) - ( d e v3 v4 ) ( e d ) - ( d e v4 ) ( v1 e d ) - ( d e ) ( v1 v2 e d ) - ( d ) ( v1 v2 v3 e d ) + ( d e v2 v3 v4 ) ( d ) + ( d e v3 v4 ) ( e d ) + ( d e v4 ) ( v1 e d ) + ( d e ) ( v1 v2 e d ) + ( d ) ( v1 v2 v3 e d ) - where d and e denote diagonal and off-diagonal elements of T, and vi - denotes an element of the vector defining H(i). + where d and e denote diagonal and off-diagonal elements of T, and vi + denotes an element of the vector defining H(i). - ===================================================================== + ===================================================================== - Test the input parameters + Test the input parameters Parameter adjustments */ /* Table of constant values */ - static integer c__1 = 1; - static doublereal c_b8 = 0.; - static doublereal c_b14 = -1.; - + integer c__1 = 1; + doublereal c_b8 = 0.; + doublereal c_b14 = -1.; + /* System generated locals */ integer a_dim1, a_offset, i__1, i__2, i__3; /* Local variables */ - extern doublereal ddot_(integer *, doublereal *, integer *, doublereal *, + extern doublereal ddot_(integer *, doublereal *, integer *, doublereal *, integer *); - static doublereal taui; - extern /* Subroutine */ integer dsyr2_(const char *, integer *, doublereal *, - doublereal *, integer *, doublereal *, integer *, doublereal *, + doublereal taui; + extern /* Subroutine */ integer dsyr2_(const char *, integer *, doublereal *, + doublereal *, integer *, doublereal *, integer *, doublereal *, integer *); - static integer i__; - static doublereal alpha; + integer i__; + doublereal alpha; extern logical lsame_(const char *,const char *); - extern /* Subroutine */ integer daxpy_(integer *, doublereal *, doublereal *, + extern /* Subroutine */ integer daxpy_(integer *, doublereal *, doublereal *, integer *, doublereal *, integer *); - static logical upper; - extern /* Subroutine */ integer dsymv_(const char *, integer *, doublereal *, - doublereal *, integer *, doublereal *, integer *, doublereal *, + logical upper; + extern /* Subroutine */ integer dsymv_(const char *, integer *, doublereal *, + doublereal *, integer *, doublereal *, integer *, doublereal *, doublereal *, integer *), dlarfg_(integer *, doublereal *, doublereal *, integer *, doublereal *), xerbla_(const char *, integer * ); @@ -185,7 +185,7 @@ extern "C" { for (i__ = *n - 1; i__ >= 1; --i__) { -/* Generate elementary reflector H(i) = I - tau * v * v' +/* Generate elementary reflector H(i) = I - tau * v * v' to annihilate A(1:i-1,i+1) */ dlarfg_(&i__, &a_ref(i__, i__ + 1), &a_ref(1, i__ + 1), &c__1, & @@ -200,17 +200,17 @@ extern "C" { /* Compute x := tau * A * v storing x in TAU(1:i) */ - dsymv_(uplo, &i__, &taui, &a[a_offset], lda, &a_ref(1, i__ + + dsymv_(uplo, &i__, &taui, &a[a_offset], lda, &a_ref(1, i__ + 1), &c__1, &c_b8, &tau[1], &c__1); /* Compute w := x - 1/2 * tau * (x'*v) * v */ - alpha = taui * -.5 * ddot_(&i__, &tau[1], &c__1, &a_ref(1, + alpha = taui * -.5 * ddot_(&i__, &tau[1], &c__1, &a_ref(1, i__ + 1), &c__1); daxpy_(&i__, &alpha, &a_ref(1, i__ + 1), &c__1, &tau[1], & c__1); -/* Apply the transformation as a rank-2 update: +/* Apply the transformation as a rank-2 update: A := A - v * w' - w * v' */ dsyr2_(uplo, &i__, &c_b14, &a_ref(1, i__ + 1), &c__1, &tau[1], @@ -230,8 +230,8 @@ extern "C" { i__1 = *n - 1; for (i__ = 1; i__ <= i__1; ++i__) { -/* Generate elementary reflector H(i) = I - tau * v * v' - to annihilate A(i+2:n,i) +/* Generate elementary reflector H(i) = I - tau * v * v' + to annihilate A(i+2:n,i) Computing MIN */ i__2 = i__ + 2; @@ -258,10 +258,10 @@ extern "C" { alpha = taui * -.5 * ddot_(&i__2, &tau[i__], &c__1, &a_ref( i__ + 1, i__), &c__1); i__2 = *n - i__; - daxpy_(&i__2, &alpha, &a_ref(i__ + 1, i__), &c__1, &tau[i__], + daxpy_(&i__2, &alpha, &a_ref(i__ + 1, i__), &c__1, &tau[i__], &c__1); -/* Apply the transformation as a rank-2 update: +/* Apply the transformation as a rank-2 update: A := A - v * w' - w * v' */ i__2 = *n - i__; diff --git a/external/hypre/src/lapack/dsytrd.c b/external/hypre/src/lapack/dsytrd.c index 827f5bf8..a87c5596 100644 --- a/external/hypre/src/lapack/dsytrd.c +++ b/external/hypre/src/lapack/dsytrd.c @@ -12,157 +12,157 @@ extern "C" { lda, doublereal *d__, doublereal *e, doublereal *tau, doublereal * work, integer *lwork, integer *info) { -/* -- LAPACK routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - June 30, 1999 +/* -- LAPACK routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + June 30, 1999 - Purpose - ======= + Purpose + ======= - DSYTRD reduces a real symmetric matrix A to real symmetric - tridiagonal form T by an orthogonal similarity transformation: - Q**T * A * Q = T. + DSYTRD reduces a real symmetric matrix A to real symmetric + tridiagonal form T by an orthogonal similarity transformation: + Q**T * A * Q = T. - Arguments - ========= + Arguments + ========= - UPLO (input) CHARACTER*1 - = 'U': Upper triangle of A is stored; - = 'L': Lower triangle of A is stored. + UPLO (input) CHARACTER*1 + = 'U': Upper triangle of A is stored; + = 'L': Lower triangle of A is stored. - N (input) INTEGER - The order of the matrix A. N >= 0. + N (input) INTEGER + The order of the matrix A. N >= 0. - A (input/output) DOUBLE PRECISION array, dimension (LDA,N) - On entry, the symmetric matrix A. If UPLO = 'U', the leading - N-by-N upper triangular part of A contains the upper - triangular part of the matrix A, and the strictly lower - triangular part of A is not referenced. If UPLO = 'L', the - leading N-by-N lower triangular part of A contains the lower - triangular part of the matrix A, and the strictly upper - triangular part of A is not referenced. - On exit, if UPLO = 'U', the diagonal and first superdiagonal - of A are overwritten by the corresponding elements of the - tridiagonal matrix T, and the elements above the first - superdiagonal, with the array TAU, represent the orthogonal - matrix Q as a product of elementary reflectors; if UPLO - = 'L', the diagonal and first subdiagonal of A are over- - written by the corresponding elements of the tridiagonal - matrix T, and the elements below the first subdiagonal, with - the array TAU, represent the orthogonal matrix Q as a product - of elementary reflectors. See Further Details. + A (input/output) DOUBLE PRECISION array, dimension (LDA,N) + On entry, the symmetric matrix A. If UPLO = 'U', the leading + N-by-N upper triangular part of A contains the upper + triangular part of the matrix A, and the strictly lower + triangular part of A is not referenced. If UPLO = 'L', the + leading N-by-N lower triangular part of A contains the lower + triangular part of the matrix A, and the strictly upper + triangular part of A is not referenced. + On exit, if UPLO = 'U', the diagonal and first superdiagonal + of A are overwritten by the corresponding elements of the + tridiagonal matrix T, and the elements above the first + superdiagonal, with the array TAU, represent the orthogonal + matrix Q as a product of elementary reflectors; if UPLO + = 'L', the diagonal and first subdiagonal of A are over- + written by the corresponding elements of the tridiagonal + matrix T, and the elements below the first subdiagonal, with + the array TAU, represent the orthogonal matrix Q as a product + of elementary reflectors. See Further Details. - LDA (input) INTEGER - The leading dimension of the array A. LDA >= max(1,N). + LDA (input) INTEGER + The leading dimension of the array A. LDA >= max(1,N). - D (output) DOUBLE PRECISION array, dimension (N) - The diagonal elements of the tridiagonal matrix T: - D(i) = A(i,i). + D (output) DOUBLE PRECISION array, dimension (N) + The diagonal elements of the tridiagonal matrix T: + D(i) = A(i,i). - E (output) DOUBLE PRECISION array, dimension (N-1) - The off-diagonal elements of the tridiagonal matrix T: - E(i) = A(i,i+1) if UPLO = 'U', E(i) = A(i+1,i) if UPLO = 'L'. + E (output) DOUBLE PRECISION array, dimension (N-1) + The off-diagonal elements of the tridiagonal matrix T: + E(i) = A(i,i+1) if UPLO = 'U', E(i) = A(i+1,i) if UPLO = 'L'. - TAU (output) DOUBLE PRECISION array, dimension (N-1) - The scalar factors of the elementary reflectors (see Further - Details). + TAU (output) DOUBLE PRECISION array, dimension (N-1) + The scalar factors of the elementary reflectors (see Further + Details). - WORK (workspace/output) DOUBLE PRECISION array, dimension (LWORK) - On exit, if INFO = 0, WORK(1) returns the optimal LWORK. + WORK (workspace/output) DOUBLE PRECISION array, dimension (LWORK) + On exit, if INFO = 0, WORK(1) returns the optimal LWORK. - LWORK (input) INTEGER - The dimension of the array WORK. LWORK >= 1. - For optimum performance LWORK >= N*NB, where NB is the - optimal blocksize. + LWORK (input) INTEGER + The dimension of the array WORK. LWORK >= 1. + For optimum performance LWORK >= N*NB, where NB is the + optimal blocksize. - If LWORK = -1, then a workspace query is assumed; the routine - only calculates the optimal size of the WORK array, returns - this value as the first entry of the WORK array, and no error - message related to LWORK is issued by XERBLA. + If LWORK = -1, then a workspace query is assumed; the routine + only calculates the optimal size of the WORK array, returns + this value as the first entry of the WORK array, and no error + message related to LWORK is issued by XERBLA. - INFO (output) INTEGER - = 0: successful exit - < 0: if INFO = -i, the i-th argument had an illegal value + INFO (output) INTEGER + = 0: successful exit + < 0: if INFO = -i, the i-th argument had an illegal value - Further Details - =============== + Further Details + =============== - If UPLO = 'U', the matrix Q is represented as a product of elementary - reflectors + If UPLO = 'U', the matrix Q is represented as a product of elementary + reflectors - Q = H(n-1) . . . H(2) H(1). + Q = H(n-1) . . . H(2) H(1). - Each H(i) has the form + Each H(i) has the form - H(i) = I - tau * v * v' + H(i) = I - tau * v * v' - where tau is a real scalar, and v is a real vector with - v(i+1:n) = 0 and v(i) = 1; v(1:i-1) is stored on exit in - A(1:i-1,i+1), and tau in TAU(i). + where tau is a real scalar, and v is a real vector with + v(i+1:n) = 0 and v(i) = 1; v(1:i-1) is stored on exit in + A(1:i-1,i+1), and tau in TAU(i). - If UPLO = 'L', the matrix Q is represented as a product of elementary - reflectors + If UPLO = 'L', the matrix Q is represented as a product of elementary + reflectors - Q = H(1) H(2) . . . H(n-1). + Q = H(1) H(2) . . . H(n-1). - Each H(i) has the form + Each H(i) has the form - H(i) = I - tau * v * v' + H(i) = I - tau * v * v' - where tau is a real scalar, and v is a real vector with - v(1:i) = 0 and v(i+1) = 1; v(i+2:n) is stored on exit in A(i+2:n,i), - and tau in TAU(i). + where tau is a real scalar, and v is a real vector with + v(1:i) = 0 and v(i+1) = 1; v(i+2:n) is stored on exit in A(i+2:n,i), + and tau in TAU(i). - The contents of A on exit are illustrated by the following examples - with n = 5: + The contents of A on exit are illustrated by the following examples + with n = 5: - if UPLO = 'U': if UPLO = 'L': + if UPLO = 'U': if UPLO = 'L': - ( d e v2 v3 v4 ) ( d ) - ( d e v3 v4 ) ( e d ) - ( d e v4 ) ( v1 e d ) - ( d e ) ( v1 v2 e d ) - ( d ) ( v1 v2 v3 e d ) + ( d e v2 v3 v4 ) ( d ) + ( d e v3 v4 ) ( e d ) + ( d e v4 ) ( v1 e d ) + ( d e ) ( v1 v2 e d ) + ( d ) ( v1 v2 v3 e d ) - where d and e denote diagonal and off-diagonal elements of T, and vi - denotes an element of the vector defining H(i). + where d and e denote diagonal and off-diagonal elements of T, and vi + denotes an element of the vector defining H(i). - ===================================================================== + ===================================================================== - Test the input parameters + Test the input parameters Parameter adjustments */ /* Table of constant values */ - static integer c__1 = 1; - static integer c_n1 = -1; - static integer c__3 = 3; - static integer c__2 = 2; - static doublereal c_b22 = -1.; - static doublereal c_b23 = 1.; - + integer c__1 = 1; + integer c_n1 = -1; + integer c__3 = 3; + integer c__2 = 2; + doublereal c_b22 = -1.; + doublereal c_b23 = 1.; + /* System generated locals */ integer a_dim1, a_offset, i__1, i__2, i__3; /* Local variables */ - static integer i__, j; + integer i__, j; extern logical lsame_(const char *,const char *); - static integer nbmin, iinfo; - static logical upper; - extern /* Subroutine */ integer dsytd2_(const char *, integer *, doublereal *, - integer *, doublereal *, doublereal *, doublereal *, integer *), dsyr2k_(const char *,const char *, integer *, integer *, doublereal + integer nbmin, iinfo; + logical upper; + extern /* Subroutine */ integer dsytd2_(const char *, integer *, doublereal *, + integer *, doublereal *, doublereal *, doublereal *, integer *), dsyr2k_(const char *,const char *, integer *, integer *, doublereal *, doublereal *, integer *, doublereal *, integer *, doublereal *, doublereal *, integer *); - static integer nb, kk, nx; - extern /* Subroutine */ integer dlatrd_(const char *, integer *, integer *, + integer nb, kk, nx; + extern /* Subroutine */ integer dlatrd_(const char *, integer *, integer *, doublereal *, integer *, doublereal *, doublereal *, doublereal *, integer *), xerbla_(const char *, integer *); - extern integer ilaenv_(integer *,const char *,const char *, integer *, integer *, + extern integer ilaenv_(integer *,const char *,const char *, integer *, integer *, integer *, integer *, ftnlen, ftnlen); - static integer ldwork, lwkopt; - static logical lquery; - static integer iws; + integer ldwork, lwkopt; + logical lquery; + integer iws; #define a_ref(a_1,a_2) a[(a_2)*a_dim1 + a_1] @@ -217,8 +217,8 @@ extern "C" { iws = 1; if (nb > 1 && nb < *n) { -/* Determine when to cross over from blocked to unblocked code - (last block is always handled by unblocked code). +/* Determine when to cross over from blocked to unblocked code + (last block is always handled by unblocked code). Computing MAX */ i__1 = nb, i__2 = ilaenv_(&c__3, "DSYTRD", uplo, n, &c_n1, &c_n1, & @@ -232,9 +232,9 @@ extern "C" { iws = ldwork * nb; if (*lwork < iws) { -/* Not enough workspace to use optimal NB: determine the - minimum value of NB, and reduce NB or force use of - unblocked code by setting NX = N. +/* Not enough workspace to use optimal NB: determine the + minimum value of NB, and reduce NB or force use of + unblocked code by setting NX = N. Computing MAX */ i__1 = *lwork / ldwork; @@ -254,31 +254,31 @@ extern "C" { if (upper) { -/* Reduce the upper triangle of A. +/* Reduce the upper triangle of A. Columns 1:kk are handled by the unblocked method. */ kk = *n - (*n - nx + nb - 1) / nb * nb; i__1 = kk + 1; i__2 = -nb; - for (i__ = *n - nb + 1; i__2 < 0 ? i__ >= i__1 : i__ <= i__1; i__ += + for (i__ = *n - nb + 1; i__2 < 0 ? i__ >= i__1 : i__ <= i__1; i__ += i__2) { -/* Reduce columns i:i+nb-1 to tridiagonal form and form the - matrix W which is needed to update the unreduced part of +/* Reduce columns i:i+nb-1 to tridiagonal form and form the + matrix W which is needed to update the unreduced part of the matrix */ i__3 = i__ + nb - 1; dlatrd_(uplo, &i__3, &nb, &a[a_offset], lda, &e[1], &tau[1], & work[1], &ldwork); -/* Update the unreduced submatrix A(1:i-1,1:i-1), using an +/* Update the unreduced submatrix A(1:i-1,1:i-1), using an update of the form: A := A - V*W' - W*V' */ i__3 = i__ - 1; - dsyr2k_(uplo, "No transpose", &i__3, &nb, &c_b22, &a_ref(1, i__), + dsyr2k_(uplo, "No transpose", &i__3, &nb, &c_b22, &a_ref(1, i__), lda, &work[1], &ldwork, &c_b23, &a[a_offset], lda); -/* Copy superdiagonal elements back into A, and diagonal +/* Copy superdiagonal elements back into A, and diagonal elements into D */ i__3 = i__ + nb - 1; @@ -301,23 +301,23 @@ extern "C" { i__1 = nb; for (i__ = 1; i__1 < 0 ? i__ >= i__2 : i__ <= i__2; i__ += i__1) { -/* Reduce columns i:i+nb-1 to tridiagonal form and form the - matrix W which is needed to update the unreduced part of +/* Reduce columns i:i+nb-1 to tridiagonal form and form the + matrix W which is needed to update the unreduced part of the matrix */ i__3 = *n - i__ + 1; dlatrd_(uplo, &i__3, &nb, &a_ref(i__, i__), lda, &e[i__], &tau[ i__], &work[1], &ldwork); -/* Update the unreduced submatrix A(i+ib:n,i+ib:n), using +/* Update the unreduced submatrix A(i+ib:n,i+ib:n), using an update of the form: A := A - V*W' - W*V' */ i__3 = *n - i__ - nb + 1; dsyr2k_(uplo, "No transpose", &i__3, &nb, &c_b22, &a_ref(i__ + nb, - i__), lda, &work[nb + 1], &ldwork, &c_b23, &a_ref(i__ + + i__), lda, &work[nb + 1], &ldwork, &c_b23, &a_ref(i__ + nb, i__ + nb), lda); -/* Copy subdiagonal elements back into A, and diagonal +/* Copy subdiagonal elements back into A, and diagonal elements into D */ i__3 = i__ + nb - 1; diff --git a/external/hypre/src/lapack/dtrti2.c b/external/hypre/src/lapack/dtrti2.c index 84bbf4a8..2237824c 100644 --- a/external/hypre/src/lapack/dtrti2.c +++ b/external/hypre/src/lapack/dtrti2.c @@ -11,78 +11,78 @@ extern "C" { /* Subroutine */ integer dtrti2_(const char *uplo, const char *diag, integer *n, doublereal * a, integer *lda, integer *info) { -/* -- LAPACK routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - February 29, 1992 +/* -- LAPACK routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + February 29, 1992 - Purpose - ======= + Purpose + ======= - DTRTI2 computes the inverse of a real upper or lower triangular - matrix. + DTRTI2 computes the inverse of a real upper or lower triangular + matrix. - This is the Level 2 BLAS version of the algorithm. + This is the Level 2 BLAS version of the algorithm. - Arguments - ========= + Arguments + ========= - UPLO (input) CHARACTER*1 - Specifies whether the matrix A is upper or lower triangular. - = 'U': Upper triangular - = 'L': Lower triangular + UPLO (input) CHARACTER*1 + Specifies whether the matrix A is upper or lower triangular. + = 'U': Upper triangular + = 'L': Lower triangular - DIAG (input) CHARACTER*1 - Specifies whether or not the matrix A is unit triangular. - = 'N': Non-unit triangular - = 'U': Unit triangular + DIAG (input) CHARACTER*1 + Specifies whether or not the matrix A is unit triangular. + = 'N': Non-unit triangular + = 'U': Unit triangular - N (input) INTEGER - The order of the matrix A. N >= 0. + N (input) INTEGER + The order of the matrix A. N >= 0. - A (input/output) DOUBLE PRECISION array, dimension (LDA,N) - On entry, the triangular matrix A. If UPLO = 'U', the - leading n by n upper triangular part of the array A contains - the upper triangular matrix, and the strictly lower - triangular part of A is not referenced. If UPLO = 'L', the - leading n by n lower triangular part of the array A contains - the lower triangular matrix, and the strictly upper - triangular part of A is not referenced. If DIAG = 'U', the - diagonal elements of A are also not referenced and are - assumed to be 1. + A (input/output) DOUBLE PRECISION array, dimension (LDA,N) + On entry, the triangular matrix A. If UPLO = 'U', the + leading n by n upper triangular part of the array A contains + the upper triangular matrix, and the strictly lower + triangular part of A is not referenced. If UPLO = 'L', the + leading n by n lower triangular part of the array A contains + the lower triangular matrix, and the strictly upper + triangular part of A is not referenced. If DIAG = 'U', the + diagonal elements of A are also not referenced and are + assumed to be 1. - On exit, the (triangular) inverse of the original matrix, in - the same storage format. + On exit, the (triangular) inverse of the original matrix, in + the same storage format. - LDA (input) INTEGER - The leading dimension of the array A. LDA >= max(1,N). + LDA (input) INTEGER + The leading dimension of the array A. LDA >= max(1,N). - INFO (output) INTEGER - = 0: successful exit - < 0: if INFO = -k, the k-th argument had an illegal value + INFO (output) INTEGER + = 0: successful exit + < 0: if INFO = -k, the k-th argument had an illegal value - ===================================================================== + ===================================================================== - Test the input parameters. + Test the input parameters. Parameter adjustments */ /* Table of constant values */ - static integer c__1 = 1; - + integer c__1 = 1; + /* System generated locals */ integer a_dim1, a_offset, i__1, i__2; /* Local variables */ - static integer j; - extern /* Subroutine */ integer dscal_(integer *, doublereal *, doublereal *, + integer j; + extern /* Subroutine */ integer dscal_(integer *, doublereal *, doublereal *, integer *); extern logical lsame_(const char *, const char *); - static logical upper; - extern /* Subroutine */ integer dtrmv_(const char *, const char *, const char *, integer *, + logical upper; + extern /* Subroutine */ integer dtrmv_(const char *, const char *, const char *, integer *, doublereal *, integer *, doublereal *, integer *), xerbla_(const char *, integer *); - static logical nounit; - static doublereal ajj; + logical nounit; + doublereal ajj; #define a_ref(a_1,a_2) a[(a_2)*a_dim1 + a_1] @@ -147,7 +147,7 @@ extern "C" { /* Compute elements j+1:n of j-th column. */ i__1 = *n - j; - dtrmv_("Lower", "No transpose", diag, &i__1, &a_ref(j + 1, j + dtrmv_("Lower", "No transpose", diag, &i__1, &a_ref(j + 1, j + 1), lda, &a_ref(j + 1, j), &c__1); i__1 = *n - j; dscal_(&i__1, &ajj, &a_ref(j + 1, j), &c__1); diff --git a/external/hypre/src/lapack/dtrtri.c b/external/hypre/src/lapack/dtrtri.c index 8a43ccce..cd859cae 100644 --- a/external/hypre/src/lapack/dtrtri.c +++ b/external/hypre/src/lapack/dtrtri.c @@ -68,11 +68,11 @@ extern "C" { Parameter adjustments */ /* Table of constant values */ - static integer c__1 = 1; - static integer c_n1 = -1; - static integer c__2 = 2; - static doublereal c_b18 = 1.; - static doublereal c_b22 = -1.; + integer c__1 = 1; + integer c_n1 = -1; + integer c__2 = 2; + doublereal c_b18 = 1.; + doublereal c_b22 = -1.; /* System generated locals */ address a__1[2]; @@ -81,21 +81,21 @@ extern "C" { /* Builtin functions Subroutine */ integer s_cat(char *, char **, integer *, integer *, ftnlen); /* Local variables */ - static integer j; + integer j; extern logical lsame_(const char *, const char *); extern /* Subroutine */ integer dtrmm_(const char *, const char *, const char *, const char *, integer *, integer *, doublereal *, doublereal *, integer *, doublereal *, integer *), dtrsm_( const char *, const char *, const char *, const char *, integer *, integer *, doublereal * , doublereal *, integer *, doublereal *, integer *); - static logical upper; + logical upper; extern /* Subroutine */ integer dtrti2_(const char *, const char *, integer *, doublereal *, integer *, integer *); - static integer jb, nb, nn; + integer jb, nb, nn; extern /* Subroutine */ integer xerbla_(const char *, integer *); extern integer ilaenv_(integer *, const char *, const char *, integer *, integer *, integer *, integer *, ftnlen, ftnlen); - static logical nounit; + logical nounit; #define a_ref(a_1,a_2) a[(a_2)*a_dim1 + a_1] diff --git a/external/hypre/src/lapack/f2c.h b/external/hypre/src/lapack/f2c.h index 5182c58b..f8353406 100644 --- a/external/hypre/src/lapack/f2c.h +++ b/external/hypre/src/lapack/f2c.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -22,11 +22,7 @@ #include "_hypre_utilities.h" #include "math.h" -#if defined(HYPRE_SINGLE) -#define sqrt sqrtf -#elif defined(HYPRE_LONG_DOUBLE) -#define sqrt sqrtl -#endif +#define sqrt hypre_sqrt #ifdef HYPRE_BIGINT typedef long long int HYPRE_LongInt; @@ -221,17 +217,17 @@ typedef shortlogical (*K_fp)(...); typedef /* Character */ VOID (*H_fp)(...); typedef /* Subroutine */ HYPRE_Int (*S_fp)(...); #else -typedef HYPRE_Int /* Unknown procedure type */ (*U_fp)(); -typedef shortint (*J_fp)(); -typedef integer (*I_fp)(); -typedef real (*R_fp)(); -typedef doublereal (*D_fp)(), (*E_fp)(); -typedef /* Complex */ VOID (*C_fp)(); -typedef /* Double Complex */ VOID (*Z_fp)(); -typedef logical (*L_fp)(); -typedef shortlogical (*K_fp)(); -typedef /* Character */ VOID (*H_fp)(); -typedef /* Subroutine */ HYPRE_Int (*S_fp)(); +typedef HYPRE_Int /* Unknown procedure type */ (*U_fp)(void); +typedef shortint (*J_fp)(void); +typedef integer (*I_fp)(void); +typedef real (*R_fp)(void); +typedef doublereal (*D_fp)(void), (*E_fp)(void); +typedef /* Complex */ VOID (*C_fp)(void); +typedef /* Double Complex */ VOID (*Z_fp)(void); +typedef logical (*L_fp)(void); +typedef shortlogical (*K_fp)(void); +typedef /* Character */ VOID (*H_fp)(void); +typedef /* Subroutine */ HYPRE_Int (*S_fp)(void); #endif /* E_fp is for real functions when -R is not specified */ typedef VOID C_f; /* complex function */ diff --git a/external/hypre/src/lapack/hypre_lapack.h b/external/hypre/src/lapack/hypre_lapack.h index 18c5fc4e..0fec7348 100644 --- a/external/hypre/src/lapack/hypre_lapack.h +++ b/external/hypre/src/lapack/hypre_lapack.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/lapack/ieeeck.c b/external/hypre/src/lapack/ieeeck.c index 809a7102..bad3a854 100644 --- a/external/hypre/src/lapack/ieeeck.c +++ b/external/hypre/src/lapack/ieeeck.c @@ -10,44 +10,44 @@ extern "C" { integer ieeeck_(integer *ispec, real *zero, real *one) { -/* -- LAPACK auxiliary routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - June 30, 1998 +/* -- LAPACK auxiliary routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + June 30, 1998 - Purpose - ======= + Purpose + ======= - IEEECK is called from the ILAENV to verify that Infinity and - possibly NaN arithmetic is safe (i.e. will not trap). + IEEECK is called from the ILAENV to verify that Infinity and + possibly NaN arithmetic is safe (i.e. will not trap). - Arguments - ========= + Arguments + ========= - ISPEC (input) INTEGER - Specifies whether to test just for inifinity arithmetic - or whether to test for infinity and NaN arithmetic. - = 0: Verify infinity arithmetic only. - = 1: Verify infinity and NaN arithmetic. + ISPEC (input) INTEGER + Specifies whether to test just for inifinity arithmetic + or whether to test for infinity and NaN arithmetic. + = 0: Verify infinity arithmetic only. + = 1: Verify infinity and NaN arithmetic. - ZERO (input) REAL - Must contain the value 0.0 - This is passed to prevent the compiler from optimizing - away this code. + ZERO (input) REAL + Must contain the value 0.0 + This is passed to prevent the compiler from optimizing + away this code. - ONE (input) REAL - Must contain the value 1.0 - This is passed to prevent the compiler from optimizing - away this code. + ONE (input) REAL + Must contain the value 1.0 + This is passed to prevent the compiler from optimizing + away this code. - RETURN VALUE: INTEGER - = 0: Arithmetic failed to produce the correct answers + RETURN VALUE: INTEGER + = 0: Arithmetic failed to produce the correct answers = 1: Arithmetic produced the correct answers */ /* System generated locals */ integer ret_val; /* Local variables */ - static real neginf, posinf, negzro, newzro, nan1, nan2, nan3, nan4, nan5, + real neginf, posinf, negzro, newzro, nan1, nan2, nan3, nan4, nan5, nan6; diff --git a/external/hypre/src/lapack/ilaenv.c b/external/hypre/src/lapack/ilaenv.c index b766e403..2186b452 100644 --- a/external/hypre/src/lapack/ilaenv.c +++ b/external/hypre/src/lapack/ilaenv.c @@ -8,114 +8,114 @@ extern "C" { #include "f2c.h" #include "hypre_lapack.h" -integer ilaenv_(integer *ispec,const char *name__,const char *opts, integer *n1, - integer *n2, integer *n3, integer *n4, ftnlen name_len, ftnlen +integer ilaenv_(integer *ispec,const char *name__,const char *opts, integer *n1, + integer *n2, integer *n3, integer *n4, ftnlen name_len, ftnlen opts_len) { -/* -- LAPACK auxiliary routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - June 30, 1999 - - - Purpose - ======= - - ILAENV is called from the LAPACK routines to choose problem-dependent - parameters for the local environment. See ISPEC for a description of - the parameters. - - This version provides a set of parameters which should give good, - but not optimal, performance on many of the currently available - computers. Users are encouraged to modify this subroutine to set - the tuning parameters for their particular machine using the option - and problem size information in the arguments. - - This routine will not function correctly if it is converted to all - lower case. Converting it to all upper case is allowed. - - Arguments - ========= - - ISPEC (input) INTEGER - Specifies the parameter to be returned as the value of - ILAENV. - = 1: the optimal blocksize; if this value is 1, an unblocked - algorithm will give the best performance. - = 2: the minimum block size for which the block routine - should be used; if the usable block size is less than - this value, an unblocked routine should be used. - = 3: the crossover point (in a block routine, for N less - than this value, an unblocked routine should be used) - = 4: the number of shifts, used in the nonsymmetric - eigenvalue routines - = 5: the minimum column dimension for blocking to be used; - rectangular blocks must have dimension at least k by m, - where k is given by ILAENV(2,...) and m by ILAENV(5,...) - = 6: the crossover point for the SVD (when reducing an m by n - matrix to bidiagonal form, if max(m,n)/min(m,n) exceeds - this value, a QR factorization is used first to reduce - the matrix to a triangular form.) - = 7: the number of processors - = 8: the crossover point for the multishift QR and QZ methods - for nonsymmetric eigenvalue problems. - = 9: maximum size of the subproblems at the bottom of the - computation tree in the divide-and-conquer algorithm - (used by xGELSD and xGESDD) - =10: ieee NaN arithmetic can be trusted not to trap - =11: infinity arithmetic can be trusted not to trap - - NAME (input) CHARACTER*(*) - The name of the calling subroutine, in either upper case or - lower case. - - OPTS (input) CHARACTER*(*) - The character options to the subroutine NAME, concatenated - into a single character string. For example, UPLO = 'U', - TRANS = 'T', and DIAG = 'N' for a triangular routine would - be specified as OPTS = 'UTN'. - - N1 (input) INTEGER - N2 (input) INTEGER - N3 (input) INTEGER - N4 (input) INTEGER - Problem dimensions for the subroutine NAME; these may not all - be required. - - (ILAENV) (output) INTEGER - >= 0: the value of the parameter specified by ISPEC - < 0: if ILAENV = -k, the k-th argument had an illegal value. - - Further Details - =============== - - The following conventions have been used when calling ILAENV from the - LAPACK routines: - 1) OPTS is a concatenation of all of the character options to - subroutine NAME, in the same order that they appear in the - argument list for NAME, even if they are not used in determining - the value of the parameter specified by ISPEC. - 2) The problem dimensions N1, N2, N3, N4 are specified in the order - that they appear in the argument list for NAME. N1 is used - first, N2 second, and so on, and unused problem dimensions are - passed a value of -1. - 3) The parameter value returned by ILAENV is checked for validity in - the calling subroutine. For example, ILAENV is used to retrieve - the optimal blocksize for STRTRI as follows: - - NB = ILAENV( 1, 'STRTRI', UPLO // DIAG, N, -1, -1, -1 ) - IF( NB.LE.1 ) NB = MAX( 1, N ) +/* -- LAPACK auxiliary routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + June 30, 1999 + + + Purpose + ======= + + ILAENV is called from the LAPACK routines to choose problem-dependent + parameters for the local environment. See ISPEC for a description of + the parameters. + + This version provides a set of parameters which should give good, + but not optimal, performance on many of the currently available + computers. Users are encouraged to modify this subroutine to set + the tuning parameters for their particular machine using the option + and problem size information in the arguments. + + This routine will not function correctly if it is converted to all + lower case. Converting it to all upper case is allowed. + + Arguments + ========= + + ISPEC (input) INTEGER + Specifies the parameter to be returned as the value of + ILAENV. + = 1: the optimal blocksize; if this value is 1, an unblocked + algorithm will give the best performance. + = 2: the minimum block size for which the block routine + should be used; if the usable block size is less than + this value, an unblocked routine should be used. + = 3: the crossover point (in a block routine, for N less + than this value, an unblocked routine should be used) + = 4: the number of shifts, used in the nonsymmetric + eigenvalue routines + = 5: the minimum column dimension for blocking to be used; + rectangular blocks must have dimension at least k by m, + where k is given by ILAENV(2,...) and m by ILAENV(5,...) + = 6: the crossover point for the SVD (when reducing an m by n + matrix to bidiagonal form, if max(m,n)/min(m,n) exceeds + this value, a QR factorization is used first to reduce + the matrix to a triangular form.) + = 7: the number of processors + = 8: the crossover point for the multishift QR and QZ methods + for nonsymmetric eigenvalue problems. + = 9: maximum size of the subproblems at the bottom of the + computation tree in the divide-and-conquer algorithm + (used by xGELSD and xGESDD) + =10: ieee NaN arithmetic can be trusted not to trap + =11: infinity arithmetic can be trusted not to trap + + NAME (input) CHARACTER*(*) + The name of the calling subroutine, in either upper case or + lower case. + + OPTS (input) CHARACTER*(*) + The character options to the subroutine NAME, concatenated + into a single character string. For example, UPLO = 'U', + TRANS = 'T', and DIAG = 'N' for a triangular routine would + be specified as OPTS = 'UTN'. + + N1 (input) INTEGER + N2 (input) INTEGER + N3 (input) INTEGER + N4 (input) INTEGER + Problem dimensions for the subroutine NAME; these may not all + be required. + + (ILAENV) (output) INTEGER + >= 0: the value of the parameter specified by ISPEC + < 0: if ILAENV = -k, the k-th argument had an illegal value. + + Further Details + =============== + + The following conventions have been used when calling ILAENV from the + LAPACK routines: + 1) OPTS is a concatenation of all of the character options to + subroutine NAME, in the same order that they appear in the + argument list for NAME, even if they are not used in determining + the value of the parameter specified by ISPEC. + 2) The problem dimensions N1, N2, N3, N4 are specified in the order + that they appear in the argument list for NAME. N1 is used + first, N2 second, and so on, and unused problem dimensions are + passed a value of -1. + 3) The parameter value returned by ILAENV is checked for validity in + the calling subroutine. For example, ILAENV is used to retrieve + the optimal blocksize for STRTRI as follows: + + NB = ILAENV( 1, 'STRTRI', UPLO // DIAG, N, -1, -1, -1 ) + IF( NB.LE.1 ) NB = MAX( 1, N ) ===================================================================== */ /* Table of constant values */ - static integer c__0 = 0; - static real c_b162 = 0.f; - static real c_b163 = 1.f; - static integer c__1 = 1; - + integer c__0 = 0; + real c_b162 = 0.f; + real c_b163 = 1.f; + integer c__1 = 1; + /* System generated locals */ integer ret_val; - /* Builtin functions + /* Builtin functions Subroutine */ /* Builtin functions */ @@ -123,15 +123,17 @@ integer ilaenv_(integer *ispec,const char *name__,const char *opts, integer *n1, integer s_cmp(char *, const char *, ftnlen, ftnlen); /* Local variables */ - static integer i__; - static logical cname, sname; - static integer nbmin; - static char c1[1], c2[2], c3[3], c4[2]; - static integer ic, nb; + integer i__; + logical cname, sname; + integer nbmin; + char c1[1], c2[2], c3[3], c4[2]; + integer ic, nb; extern integer ieeeck_(integer *, real *, real *); - static integer iz, nx; - static char subnam[6]; - + integer iz, nx; + char subnam[6]; + HYPRE_UNUSED_VAR(opts); + HYPRE_UNUSED_VAR(n3); + HYPRE_UNUSED_VAR(opts_len); @@ -181,14 +183,14 @@ integer ilaenv_(integer *ispec,const char *name__,const char *opts, integer *n1, /* EBCDIC character set */ - if (((ic >= 129) && (ic <= 137)) || - ((ic >= 145) && (ic <= 153)) || + if (((ic >= 129) && (ic <= 137)) || + ((ic >= 145) && (ic <= 153)) || ((ic >= 162) && (ic <= 169))) { *(unsigned char *)subnam = (char) (ic + 64); for (i__ = 2; i__ <= 6; ++i__) { ic = *(unsigned char *)&subnam[i__ - 1]; - if (((ic >= 129) && (ic <= 137)) || - ((ic >= 145) && (ic <= 153)) || + if (((ic >= 129) && (ic <= 137)) || + ((ic >= 145) && (ic <= 153)) || ((ic >= 162) && (ic <= 169))) { *(unsigned char *)&subnam[i__ - 1] = (char) (ic + 64); } @@ -230,10 +232,10 @@ integer ilaenv_(integer *ispec,const char *name__,const char *opts, integer *n1, L110: -/* ISPEC = 1: block size +/* ISPEC = 1: block size - In these examples, separate code is provided for setting NB for - real and complex. We assume that NB will take the same value in + In these examples, separate code is provided for setting NB for + real and complex. We assume that NB will take the same value in single or doublereal precision. */ nb = 1; @@ -245,9 +247,9 @@ integer ilaenv_(integer *ispec,const char *name__,const char *opts, integer *n1, } else { nb = 64; } - } else if (s_cmp(c3, "QRF", (ftnlen)3, (ftnlen)3) == 0 || s_cmp(c3, + } else if (s_cmp(c3, "QRF", (ftnlen)3, (ftnlen)3) == 0 || s_cmp(c3, "RQF", (ftnlen)3, (ftnlen)3) == 0 || s_cmp(c3, "LQF", (ftnlen) - 3, (ftnlen)3) == 0 || s_cmp(c3, "QLF", (ftnlen)3, (ftnlen)3) + 3, (ftnlen)3) == 0 || s_cmp(c3, "QLF", (ftnlen)3, (ftnlen)3) == 0) { if (sname) { nb = 32; @@ -303,7 +305,7 @@ integer ilaenv_(integer *ispec,const char *name__,const char *opts, integer *n1, } } else if (sname && s_cmp(c2, "OR", (ftnlen)2, (ftnlen)2) == 0) { if (*(unsigned char *)c3 == 'G') { - if (s_cmp(c4, "QR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "RQ", + if (s_cmp(c4, "QR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "RQ", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "LQ", (ftnlen)2, ( ftnlen)2) == 0 || s_cmp(c4, "QL", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "HR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp( @@ -312,7 +314,7 @@ integer ilaenv_(integer *ispec,const char *name__,const char *opts, integer *n1, nb = 32; } } else if (*(unsigned char *)c3 == 'M') { - if (s_cmp(c4, "QR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "RQ", + if (s_cmp(c4, "QR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "RQ", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "LQ", (ftnlen)2, ( ftnlen)2) == 0 || s_cmp(c4, "QL", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "HR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp( @@ -323,7 +325,7 @@ integer ilaenv_(integer *ispec,const char *name__,const char *opts, integer *n1, } } else if (cname && s_cmp(c2, "UN", (ftnlen)2, (ftnlen)2) == 0) { if (*(unsigned char *)c3 == 'G') { - if (s_cmp(c4, "QR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "RQ", + if (s_cmp(c4, "QR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "RQ", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "LQ", (ftnlen)2, ( ftnlen)2) == 0 || s_cmp(c4, "QL", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "HR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp( @@ -332,7 +334,7 @@ integer ilaenv_(integer *ispec,const char *name__,const char *opts, integer *n1, nb = 32; } } else if (*(unsigned char *)c3 == 'M') { - if (s_cmp(c4, "QR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "RQ", + if (s_cmp(c4, "QR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "RQ", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "LQ", (ftnlen)2, ( ftnlen)2) == 0 || s_cmp(c4, "QL", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "HR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp( @@ -447,7 +449,7 @@ integer ilaenv_(integer *ispec,const char *name__,const char *opts, integer *n1, } } else if (sname && s_cmp(c2, "OR", (ftnlen)2, (ftnlen)2) == 0) { if (*(unsigned char *)c3 == 'G') { - if (s_cmp(c4, "QR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "RQ", + if (s_cmp(c4, "QR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "RQ", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "LQ", (ftnlen)2, ( ftnlen)2) == 0 || s_cmp(c4, "QL", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "HR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp( @@ -456,7 +458,7 @@ integer ilaenv_(integer *ispec,const char *name__,const char *opts, integer *n1, nbmin = 2; } } else if (*(unsigned char *)c3 == 'M') { - if (s_cmp(c4, "QR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "RQ", + if (s_cmp(c4, "QR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "RQ", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "LQ", (ftnlen)2, ( ftnlen)2) == 0 || s_cmp(c4, "QL", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "HR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp( @@ -467,7 +469,7 @@ integer ilaenv_(integer *ispec,const char *name__,const char *opts, integer *n1, } } else if (cname && s_cmp(c2, "UN", (ftnlen)2, (ftnlen)2) == 0) { if (*(unsigned char *)c3 == 'G') { - if (s_cmp(c4, "QR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "RQ", + if (s_cmp(c4, "QR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "RQ", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "LQ", (ftnlen)2, ( ftnlen)2) == 0 || s_cmp(c4, "QL", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "HR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp( @@ -476,7 +478,7 @@ integer ilaenv_(integer *ispec,const char *name__,const char *opts, integer *n1, nbmin = 2; } } else if (*(unsigned char *)c3 == 'M') { - if (s_cmp(c4, "QR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "RQ", + if (s_cmp(c4, "QR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "RQ", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "LQ", (ftnlen)2, ( ftnlen)2) == 0 || s_cmp(c4, "QL", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "HR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp( @@ -527,7 +529,7 @@ integer ilaenv_(integer *ispec,const char *name__,const char *opts, integer *n1, } } else if (sname && s_cmp(c2, "OR", (ftnlen)2, (ftnlen)2) == 0) { if (*(unsigned char *)c3 == 'G') { - if (s_cmp(c4, "QR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "RQ", + if (s_cmp(c4, "QR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "RQ", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "LQ", (ftnlen)2, ( ftnlen)2) == 0 || s_cmp(c4, "QL", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "HR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp( @@ -538,7 +540,7 @@ integer ilaenv_(integer *ispec,const char *name__,const char *opts, integer *n1, } } else if (cname && s_cmp(c2, "UN", (ftnlen)2, (ftnlen)2) == 0) { if (*(unsigned char *)c3 == 'G') { - if (s_cmp(c4, "QR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "RQ", + if (s_cmp(c4, "QR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "RQ", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "LQ", (ftnlen)2, ( ftnlen)2) == 0 || s_cmp(c4, "QL", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "HR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp( @@ -588,8 +590,8 @@ integer ilaenv_(integer *ispec,const char *name__,const char *opts, integer *n1, L900: -/* ISPEC = 9: maximum size of the subproblems at the bottom of the - computation tree in the divide-and-conquer algorithm +/* ISPEC = 9: maximum size of the subproblems at the bottom of the + computation tree in the divide-and-conquer algorithm (used by xGELSD and xGESDD) */ ret_val = 25; @@ -597,7 +599,7 @@ integer ilaenv_(integer *ispec,const char *name__,const char *opts, integer *n1, L1000: -/* ISPEC = 10: ieee NaN arithmetic can be trusted not to trap +/* ISPEC = 10: ieee NaN arithmetic can be trusted not to trap ILAENV = 0 */ ret_val = 1; @@ -608,7 +610,7 @@ integer ilaenv_(integer *ispec,const char *name__,const char *opts, integer *n1, L1100: -/* ISPEC = 11: infinity arithmetic can be trusted not to trap +/* ISPEC = 11: infinity arithmetic can be trusted not to trap ILAENV = 0 */ ret_val = 1; diff --git a/external/hypre/src/lapack/lsame.c b/external/hypre/src/lapack/lsame.c index 51196653..5ac6f61e 100644 --- a/external/hypre/src/lapack/lsame.c +++ b/external/hypre/src/lapack/lsame.c @@ -10,34 +10,34 @@ extern "C" { logical lsame_(const char *ca,const char *cb) { -/* -- LAPACK auxiliary routine (version 3.0) -- - Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., - Courant Institute, Argonne National Lab, and Rice University - September 30, 1994 +/* -- LAPACK auxiliary routine (version 3.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + September 30, 1994 - Purpose - ======= + Purpose + ======= - LSAME returns .TRUE. if CA is the same letter as CB regardless of - case. + LSAME returns .TRUE. if CA is the same letter as CB regardless of + case. - Arguments - ========= + Arguments + ========= - CA (input) CHARACTER*1 - CB (input) CHARACTER*1 - CA and CB specify the single characters to be compared. + CA (input) CHARACTER*1 + CB (input) CHARACTER*1 + CA and CB specify the single characters to be compared. + + ===================================================================== - ===================================================================== - Test if the characters are equal */ /* System generated locals */ logical ret_val; /* Local variables */ - static integer inta, intb, zcode; + integer inta, intb, zcode; ret_val = *(unsigned char *)ca == *(unsigned char *)cb; @@ -49,9 +49,9 @@ logical lsame_(const char *ca,const char *cb) zcode = 'Z'; -/* Use 'Z' rather than 'A' so that ASCII can be detected on Prime - machines, on which ICHAR returns a value with bit 8 set. - ICHAR('A') on Prime machines returns 193 which is the same as +/* Use 'Z' rather than 'A' so that ASCII can be detected on Prime + machines, on which ICHAR returns a value with bit 8 set. + ICHAR('A') on Prime machines returns 193 which is the same as ICHAR('A') on an EBCDIC machine. */ inta = *(unsigned char *)ca; @@ -60,7 +60,7 @@ logical lsame_(const char *ca,const char *cb) if (zcode == 90 || zcode == 122) { /* ASCII is assumed - ZCODE is the ASCII code of either lower o -r +r upper case 'Z'. */ if (inta >= 97 && inta <= 122) { @@ -73,16 +73,16 @@ r } else if (zcode == 233 || zcode == 169) { /* EBCDIC is assumed - ZCODE is the EBCDIC code of either lower - or + or upper case 'Z'. */ - if (((inta >= 129) && (inta <= 137)) || - ((inta >= 145) && (inta <= 153)) || + if (((inta >= 129) && (inta <= 137)) || + ((inta >= 145) && (inta <= 153)) || ((inta >= 162) && (inta <= 169))) { inta += 64; } - if (((intb >= 129) && (intb <= 137)) || - ((intb >= 145) && (intb <= 153)) || + if (((intb >= 129) && (intb <= 137)) || + ((intb >= 145) && (intb <= 153)) || ((intb >= 162) && (intb <= 169))) { intb += 64; } @@ -90,7 +90,7 @@ r } else if (zcode == 218 || zcode == 250) { /* ASCII is assumed, on Prime machines - ZCODE is the ASCII cod -e +e plus 128 of either lower or upper case 'Z'. */ if (inta >= 225 && inta <= 250) { @@ -102,7 +102,7 @@ e } ret_val = inta == intb; -/* RETURN +/* RETURN End of LSAME */ diff --git a/external/hypre/src/matrix_matrix/CMakeLists.txt b/external/hypre/src/matrix_matrix/CMakeLists.txt index b1762f60..f47b69c7 100644 --- a/external/hypre/src/matrix_matrix/CMakeLists.txt +++ b/external/hypre/src/matrix_matrix/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/matrix_matrix/HYPRE_BuildIJMatrixFromDistributedMatrix.c b/external/hypre/src/matrix_matrix/HYPRE_BuildIJMatrixFromDistributedMatrix.c index 1d713044..99ce6deb 100644 --- a/external/hypre/src/matrix_matrix/HYPRE_BuildIJMatrixFromDistributedMatrix.c +++ b/external/hypre/src/matrix_matrix/HYPRE_BuildIJMatrixFromDistributedMatrix.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -30,15 +30,15 @@ #include "IJ_mv/HYPRE_IJ_mv.h" /* Local routine prototypes */ -HYPRE_Int HYPRE_IJMatrixSetLocalStorageType(HYPRE_IJMatrix ij_matrix, - HYPRE_Int local_storage_type ); +HYPRE_Int HYPRE_IJMatrixSetLocalStorageType(HYPRE_IJMatrix ij_matrix, + HYPRE_Int local_storage_type ); -HYPRE_Int HYPRE_IJMatrixSetLocalSize(HYPRE_IJMatrix ij_matrix, - HYPRE_Int row, HYPRE_Int col ); +HYPRE_Int HYPRE_IJMatrixSetLocalSize(HYPRE_IJMatrix ij_matrix, + HYPRE_Int row, HYPRE_Int col ); -HYPRE_Int HYPRE_IJMatrixInsertRow( HYPRE_IJMatrix ij_matrix, - HYPRE_Int size, HYPRE_BigInt i, HYPRE_BigInt *col_ind, - HYPRE_Real *values ); +HYPRE_Int HYPRE_IJMatrixInsertRow( HYPRE_IJMatrix ij_matrix, + HYPRE_Int size, HYPRE_BigInt i, HYPRE_BigInt *col_ind, + HYPRE_Real *values ); /*-------------------------------------------------------------------------- * HYPRE_BuildIJMatrixFromDistributedMatrix @@ -49,13 +49,13 @@ distributed_matrix and putting them into the IJMatrix. This routine does not effect the distributed matrix. In essence, it makes a copy of the input matrix in another format. NOTE: because this routine makes a copy and is not just a simple conversion, it is memory-expensive and should only be used in -low-memory requirement situations (such as unit-testing code). +low-memory requirement situations (such as unit-testing code). */ -HYPRE_Int +HYPRE_Int HYPRE_BuildIJMatrixFromDistributedMatrix( - HYPRE_DistributedMatrix DistributedMatrix, - HYPRE_IJMatrix *ij_matrix, - HYPRE_Int local_storage_type ) + HYPRE_DistributedMatrix DistributedMatrix, + HYPRE_IJMatrix *ij_matrix, + HYPRE_Int local_storage_type ) { HYPRE_Int ierr; MPI_Comm comm; @@ -69,32 +69,32 @@ HYPRE_BuildIJMatrixFromDistributedMatrix( - if (!DistributedMatrix) return(-1); + if (!DistributedMatrix) { return (-1); } comm = HYPRE_DistributedMatrixGetContext( DistributedMatrix ); ierr = HYPRE_DistributedMatrixGetDims( DistributedMatrix, &M, &N ); - ierr = HYPRE_DistributedMatrixGetLocalRange( DistributedMatrix, - &first_local_row, &last_local_row , - &first_local_col, &last_local_col ); + ierr = HYPRE_DistributedMatrixGetLocalRange( DistributedMatrix, + &first_local_row, &last_local_row, + &first_local_col, &last_local_col ); ierr = HYPRE_IJMatrixCreate( comm, first_local_row, last_local_row, first_local_col, last_local_col, ij_matrix ); - ierr = HYPRE_IJMatrixSetLocalStorageType( - *ij_matrix, local_storage_type ); + ierr = HYPRE_IJMatrixSetLocalStorageType( + *ij_matrix, local_storage_type ); /* if(ierr) return(ierr); */ - ierr = HYPRE_IJMatrixSetLocalSize( *ij_matrix, - last_local_row-first_local_row+1, - last_local_col-first_local_col+1 ); + ierr = HYPRE_IJMatrixSetLocalSize( *ij_matrix, + last_local_row - first_local_row + 1, + last_local_col - first_local_col + 1 ); ierr = HYPRE_IJMatrixInitialize( *ij_matrix ); /* if(ierr) return(ierr);*/ /* Loop through all locally stored rows and insert them into ij_matrix */ - for (i=first_local_row; i<= last_local_row; i++) + for (i = first_local_row; i <= last_local_row; i++) { ierr = HYPRE_DistributedMatrixGetRow( DistributedMatrix, i, &size, &col_ind, &values ); /* if( ierr ) return(ierr);*/ @@ -110,6 +110,6 @@ HYPRE_BuildIJMatrixFromDistributedMatrix( ierr = HYPRE_IJMatrixAssemble( *ij_matrix ); /* if(ierr) return(ierr); */ - return(ierr); + return (ierr); } diff --git a/external/hypre/src/matrix_matrix/HYPRE_ConvertPETScMatrixToDistributedMatrix.c b/external/hypre/src/matrix_matrix/HYPRE_ConvertPETScMatrixToDistributedMatrix.c index 7caae03e..81b83e38 100644 --- a/external/hypre/src/matrix_matrix/HYPRE_ConvertPETScMatrixToDistributedMatrix.c +++ b/external/hypre/src/matrix_matrix/HYPRE_ConvertPETScMatrixToDistributedMatrix.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -36,8 +36,8 @@ HYPRE_Int HYPRE_ConvertPETScMatrixToDistributedMatrix( - Mat PETSc_matrix, - HYPRE_DistributedMatrix *DistributedMatrix ) + Mat PETSc_matrix, + HYPRE_DistributedMatrix *DistributedMatrix ) { HYPRE_Int ierr; MPI_Comm hypre_MPI_Comm; @@ -48,7 +48,7 @@ HYPRE_ConvertPETScMatrixToDistributedMatrix( - if (!PETSc_matrix) return(-1); + if (!PETSc_matrix) { return (-1); } #ifdef HYPRE_TIMING timer = hypre_InitializeTiming( "ConvertPETScMatrixToDistributedMatrix"); @@ -62,7 +62,7 @@ HYPRE_ConvertPETScMatrixToDistributedMatrix( /* if(ierr) return(ierr); */ ierr = HYPRE_DistributedMatrixSetLocalStorageType( *DistributedMatrix, - HYPRE_PETSC ); + HYPRE_PETSC ); /* if(ierr) return(ierr);*/ ierr = HYPRE_DistributedMatrixInitialize( *DistributedMatrix ); @@ -76,7 +76,8 @@ HYPRE_ConvertPETScMatrixToDistributedMatrix( the latter is really a "just in case" option, and so if we don't *have* to use it, we won't.*/ - ierr = MatGetSize( PETSc_matrix, &M, &N); if(ierr) return(ierr); + ierr = MatGetSize( PETSc_matrix, &M, &N); + if (ierr) { return (ierr); } ierr = HYPRE_DistributedMatrixSetDims( *DistributedMatrix, M, N); ierr = HYPRE_DistributedMatrixAssemble( *DistributedMatrix ); @@ -87,7 +88,7 @@ HYPRE_ConvertPETScMatrixToDistributedMatrix( /* hypre_FinalizeTiming( timer ); */ #endif - return(0); + return (0); } #endif diff --git a/external/hypre/src/matrix_matrix/HYPRE_ConvertParCSRMatrixToDistributedMatrix.c b/external/hypre/src/matrix_matrix/HYPRE_ConvertParCSRMatrixToDistributedMatrix.c index c030abdb..f16f7304 100644 --- a/external/hypre/src/matrix_matrix/HYPRE_ConvertParCSRMatrixToDistributedMatrix.c +++ b/external/hypre/src/matrix_matrix/HYPRE_ConvertParCSRMatrixToDistributedMatrix.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/matrix_matrix/HYPRE_matrix_matrix_protos.h b/external/hypre/src/matrix_matrix/HYPRE_matrix_matrix_protos.h index 979c4d8b..5cb97266 100644 --- a/external/hypre/src/matrix_matrix/HYPRE_matrix_matrix_protos.h +++ b/external/hypre/src/matrix_matrix/HYPRE_matrix_matrix_protos.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -9,9 +9,11 @@ #ifdef PETSC_AVAILABLE /* HYPRE_ConvertPETScMatrixToDistributedMatrix.c */ -HYPRE_Int HYPRE_ConvertPETScMatrixToDistributedMatrix (Mat PETSc_matrix , HYPRE_DistributedMatrix *DistributedMatrix ); +HYPRE_Int HYPRE_ConvertPETScMatrixToDistributedMatrix (Mat PETSc_matrix, + HYPRE_DistributedMatrix *DistributedMatrix ); #endif /* HYPRE_ConvertParCSRMatrixToDistributedMatrix.c */ -HYPRE_Int HYPRE_ConvertParCSRMatrixToDistributedMatrix (HYPRE_ParCSRMatrix parcsr_matrix , HYPRE_DistributedMatrix *DistributedMatrix ); +HYPRE_Int HYPRE_ConvertParCSRMatrixToDistributedMatrix (HYPRE_ParCSRMatrix parcsr_matrix, + HYPRE_DistributedMatrix *DistributedMatrix ); diff --git a/external/hypre/src/matrix_matrix/internal_protos.h b/external/hypre/src/matrix_matrix/internal_protos.h index 9ce600c5..3df89435 100644 --- a/external/hypre/src/matrix_matrix/internal_protos.h +++ b/external/hypre/src/matrix_matrix/internal_protos.h @@ -1,9 +1,10 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ /* HYPRE_ConvertPETScMatrixToDistributedMatrix.c */ -HYPRE_Int HYPRE_ConvertPETScMatrixToDistributedMatrix (Mat PETSc_matrix , HYPRE_DistributedMatrix *DistributedMatrix ); +HYPRE_Int HYPRE_ConvertPETScMatrixToDistributedMatrix (Mat PETSc_matrix, + HYPRE_DistributedMatrix *DistributedMatrix ); diff --git a/external/hypre/src/multivector/CMakeLists.txt b/external/hypre/src/multivector/CMakeLists.txt index 0f298b99..ad396ed3 100644 --- a/external/hypre/src/multivector/CMakeLists.txt +++ b/external/hypre/src/multivector/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/multivector/backup.c b/external/hypre/src/multivector/backup.c index 4dec1cc7..12b8fdaf 100644 --- a/external/hypre/src/multivector/backup.c +++ b/external/hypre/src/multivector/backup.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -10,556 +10,637 @@ #include "temp_multivector.h" void* -hypre_TempMultiVectorCreateFromSampleVector( void* ii_, HYPRE_Int n, void* sample ) { +hypre_TempMultiVectorCreateFromSampleVector( void* ii_, HYPRE_Int n, void* sample ) +{ - HYPRE_Int i; - hypre_TempMultiVector* data; - HYPRE_InterfaceInterpreter* ii = (HYPRE_InterfaceInterpreter*)ii_; + HYPRE_Int i; + hypre_TempMultiVector* data; + HYPRE_InterfaceInterpreter* ii = (HYPRE_InterfaceInterpreter*)ii_; - data = hypre_TAlloc(hypre_TempMultiVector, 1, HYPRE_MEMORY_HOST); - hypre_assert( data != NULL ); + data = hypre_TAlloc(hypre_TempMultiVector, 1, HYPRE_MEMORY_HOST); + hypre_assert( data != NULL ); - data->interpreter = ii; - data->numVectors = n; + data->interpreter = ii; + data->numVectors = n; - data->vector = hypre_CTAlloc(void*, n, HYPRE_MEMORY_HOST); - hypre_assert( data->vector != NULL ); + data->vector = hypre_CTAlloc(void*, n, HYPRE_MEMORY_HOST); + hypre_assert( data->vector != NULL ); - data->ownsVectors = 1; - data->mask = NULL; - data->ownsMask = 0; + data->ownsVectors = 1; + data->mask = NULL; + data->ownsMask = 0; - for ( i = 0; i < n; i++ ) - data->vector[i] = (ii->CreateVector)(sample); + for ( i = 0; i < n; i++ ) + { + data->vector[i] = (ii->CreateVector)(sample); + } - return data; + return data; } void* -hypre_TempMultiVectorCreateCopy( void* src_, HYPRE_Int copyValues ) { +hypre_TempMultiVectorCreateCopy( void* src_, HYPRE_Int copyValues ) +{ - HYPRE_Int i, n; + HYPRE_Int i, n; - hypre_TempMultiVector* src; - hypre_TempMultiVector* dest; + hypre_TempMultiVector* src; + hypre_TempMultiVector* dest; - src = (hypre_TempMultiVector*)src_; - hypre_assert( src != NULL ); + src = (hypre_TempMultiVector*)src_; + hypre_assert( src != NULL ); - n = src->numVectors; + n = src->numVectors; - dest = hypre_TempMultiVectorCreateFromSampleVector( src->interpreter, - n, src->vector[0] ); - if ( copyValues ) - for ( i = 0; i < n; i++ ) { - (dest->interpreter->CopyVector)(src->vector[i],dest->vector[i]); - } + dest = hypre_TempMultiVectorCreateFromSampleVector( src->interpreter, + n, src->vector[0] ); + if ( copyValues ) + for ( i = 0; i < n; i++ ) + { + (dest->interpreter->CopyVector)(src->vector[i], dest->vector[i]); + } - return dest; + return dest; } void -hypre_TempMultiVectorDestroy( void* v_ ) { - - HYPRE_Int i; - hypre_TempMultiVector* data = (hypre_TempMultiVector*)v_; - - if ( data == NULL ) - return; - - if ( data->ownsVectors && data->vector != NULL ) { - for ( i = 0; i < data->numVectors; i++ ) - (data->interpreter->DestroyVector)(data->vector[i]); - hypre_TFree(data->vector, HYPRE_MEMORY_HOST); - } - if ( data->mask && data->ownsMask ) - hypre_TFree(data->mask, HYPRE_MEMORY_HOST); - hypre_TFree(data, HYPRE_MEMORY_HOST); +hypre_TempMultiVectorDestroy( void* v_ ) +{ + + HYPRE_Int i; + hypre_TempMultiVector* data = (hypre_TempMultiVector*)v_; + + if ( data == NULL ) + { + return; + } + + if ( data->ownsVectors && data->vector != NULL ) + { + for ( i = 0; i < data->numVectors; i++ ) + { + (data->interpreter->DestroyVector)(data->vector[i]); + } + hypre_TFree(data->vector, HYPRE_MEMORY_HOST); + } + if ( data->mask && data->ownsMask ) + { + hypre_TFree(data->mask, HYPRE_MEMORY_HOST); + } + hypre_TFree(data, HYPRE_MEMORY_HOST); } HYPRE_Int -hypre_TempMultiVectorWidth( void* v ) { +hypre_TempMultiVectorWidth( void* v ) +{ - hypre_TempMultiVector* data = (hypre_TempMultiVector*)v; + hypre_TempMultiVector* data = (hypre_TempMultiVector*)v; - if ( data == NULL ) - return 0; + if ( data == NULL ) + { + return 0; + } - return data->numVectors; + return data->numVectors; } HYPRE_Int -hypre_TempMultiVectorHeight( void* v ) { +hypre_TempMultiVectorHeight( void* v ) +{ - return 0; + return 0; } void -hypre_TempMultiVectorSetMask( void* v, HYPRE_Int* mask ) { +hypre_TempMultiVectorSetMask( void* v, HYPRE_Int* mask ) +{ - hypre_TempMultiVector* data = (hypre_TempMultiVector*)v; + hypre_TempMultiVector* data = (hypre_TempMultiVector*)v; - hypre_assert( data != NULL ); - data->mask = mask; - data->ownsMask = 0; + hypre_assert( data != NULL ); + data->mask = mask; + data->ownsMask = 0; } void -hypre_TempMultiVectorClear( void* v ) { +hypre_TempMultiVectorClear( void* v ) +{ - HYPRE_Int i; - hypre_TempMultiVector* data = (hypre_TempMultiVector*)v; + HYPRE_Int i; + hypre_TempMultiVector* data = (hypre_TempMultiVector*)v; - hypre_assert( data != NULL ); + hypre_assert( data != NULL ); - for ( i = 0; i < data->numVectors; i++ ) - if ( data->mask == NULL || (data->mask)[i] ) - (data->interpreter->ClearVector)(data->vector[i]); + for ( i = 0; i < data->numVectors; i++ ) + if ( data->mask == NULL || (data->mask)[i] ) + { + (data->interpreter->ClearVector)(data->vector[i]); + } } void -hypre_TempMultiVectorSetRandom( void* v, HYPRE_Int seed ) { - - HYPRE_Int i; - hypre_TempMultiVector* data = (hypre_TempMultiVector*)v; - - hypre_assert( data != NULL ); - - hypre_SeedRand( seed ); - for ( i = 0; i < data->numVectors; i++ ) { - if ( data->mask == NULL || (data->mask)[i] ) { - seed = hypre_RandI(); - (data->interpreter->SetRandomValues)(data->vector[i],seed); - } - } +hypre_TempMultiVectorSetRandom( void* v, HYPRE_Int seed ) +{ + + HYPRE_Int i; + hypre_TempMultiVector* data = (hypre_TempMultiVector*)v; + + hypre_assert( data != NULL ); + + hypre_SeedRand( seed ); + for ( i = 0; i < data->numVectors; i++ ) + { + if ( data->mask == NULL || (data->mask)[i] ) + { + seed = hypre_RandI(); + (data->interpreter->SetRandomValues)(data->vector[i], seed); + } + } } void -hypre_collectVectorPtr( HYPRE_Int* mask, hypre_TempMultiVector* x, void** px ) { - - HYPRE_Int ix, jx; - - if ( mask != NULL ) { - for ( ix = 0, jx = 0; ix < x->numVectors; ix++ ) - if ( mask[ix] ) - px[jx++] = x->vector[ix]; - } - else - for ( ix = 0; ix < x->numVectors; ix++ ) - px[ix] = x->vector[ix]; +hypre_collectVectorPtr( HYPRE_Int* mask, hypre_TempMultiVector* x, void** px ) +{ + + HYPRE_Int ix, jx; + + if ( mask != NULL ) + { + for ( ix = 0, jx = 0; ix < x->numVectors; ix++ ) + if ( mask[ix] ) + { + px[jx++] = x->vector[ix]; + } + } + else + for ( ix = 0; ix < x->numVectors; ix++ ) + { + px[ix] = x->vector[ix]; + } } void -hypre_TempMultiVectorCopy( void* src, void* dest ) { +hypre_TempMultiVectorCopy( void* src, void* dest ) +{ - HYPRE_Int i, ms, md; - void** ps; - void** pd; - hypre_TempMultiVector* srcData = (hypre_TempMultiVector*)src; - hypre_TempMultiVector* destData = (hypre_TempMultiVector*)dest; + HYPRE_Int i, ms, md; + void** ps; + void** pd; + hypre_TempMultiVector* srcData = (hypre_TempMultiVector*)src; + hypre_TempMultiVector* destData = (hypre_TempMultiVector*)dest; - hypre_assert( srcData != NULL && destData != NULL ); + hypre_assert( srcData != NULL && destData != NULL ); - ms = aux_maskCount( srcData->numVectors, srcData->mask ); - md = aux_maskCount( destData->numVectors, destData->mask ); - hypre_assert( ms == md ); + ms = aux_maskCount( srcData->numVectors, srcData->mask ); + md = aux_maskCount( destData->numVectors, destData->mask ); + hypre_assert( ms == md ); - ps = hypre_CTAlloc(void*, ms, HYPRE_MEMORY_HOST); - hypre_assert( ps != NULL ); - pd = hypre_CTAlloc(void*, md, HYPRE_MEMORY_HOST); - hypre_assert( pd != NULL ); + ps = hypre_CTAlloc(void*, ms, HYPRE_MEMORY_HOST); + hypre_assert( ps != NULL ); + pd = hypre_CTAlloc(void*, md, HYPRE_MEMORY_HOST); + hypre_assert( pd != NULL ); - hypre_collectVectorPtr( srcData->mask, srcData, ps ); - hypre_collectVectorPtr( destData->mask, destData, pd ); + hypre_collectVectorPtr( srcData->mask, srcData, ps ); + hypre_collectVectorPtr( destData->mask, destData, pd ); - for ( i = 0; i < ms; i++ ) - (srcData->interpreter->CopyVector)(ps[i],pd[i]); + for ( i = 0; i < ms; i++ ) + { + (srcData->interpreter->CopyVector)(ps[i], pd[i]); + } - hypre_TFree(ps, HYPRE_MEMORY_HOST); - hypre_TFree(pd, HYPRE_MEMORY_HOST); + hypre_TFree(ps, HYPRE_MEMORY_HOST); + hypre_TFree(pd, HYPRE_MEMORY_HOST); } void -hypre_TempMultiVectorAxpy( HYPRE_Complex a, void* x_, void* y_ ) { - - HYPRE_Int i, mx, my; - void** px; - void** py; - hypre_TempMultiVector* xData; - hypre_TempMultiVector* yData; - - xData = (hypre_TempMultiVector*)x_; - yData = (hypre_TempMultiVector*)y_; - hypre_assert( xData != NULL && yData != NULL ); - - mx = aux_maskCount( xData->numVectors, xData->mask ); - my = aux_maskCount( yData->numVectors, yData->mask ); - hypre_assert( mx == my ); - - px = hypre_CTAlloc(void*, mx, HYPRE_MEMORY_HOST); - hypre_assert( px != NULL ); - py = hypre_CTAlloc(void*, my, HYPRE_MEMORY_HOST); - hypre_assert( py != NULL ); - - hypre_collectVectorPtr( xData->mask, xData, px ); - hypre_collectVectorPtr( yData->mask, yData, py ); - - for ( i = 0; i < mx; i++ ) - (xData->interpreter->Axpy)(a,px[i],py[i]); - - hypre_TFree(px, HYPRE_MEMORY_HOST); - hypre_TFree(py, HYPRE_MEMORY_HOST); +hypre_TempMultiVectorAxpy( HYPRE_Complex a, void* x_, void* y_ ) +{ + + HYPRE_Int i, mx, my; + void** px; + void** py; + hypre_TempMultiVector* xData; + hypre_TempMultiVector* yData; + + xData = (hypre_TempMultiVector*)x_; + yData = (hypre_TempMultiVector*)y_; + hypre_assert( xData != NULL && yData != NULL ); + + mx = aux_maskCount( xData->numVectors, xData->mask ); + my = aux_maskCount( yData->numVectors, yData->mask ); + hypre_assert( mx == my ); + + px = hypre_CTAlloc(void*, mx, HYPRE_MEMORY_HOST); + hypre_assert( px != NULL ); + py = hypre_CTAlloc(void*, my, HYPRE_MEMORY_HOST); + hypre_assert( py != NULL ); + + hypre_collectVectorPtr( xData->mask, xData, px ); + hypre_collectVectorPtr( yData->mask, yData, py ); + + for ( i = 0; i < mx; i++ ) + { + (xData->interpreter->Axpy)(a, px[i], py[i]); + } + + hypre_TFree(px, HYPRE_MEMORY_HOST); + hypre_TFree(py, HYPRE_MEMORY_HOST); } void hypre_TempMultiVectorByMultiVector( void* x_, void* y_, HYPRE_Int xyGHeight, HYPRE_Int xyHeight, - HYPRE_Int xyWidth, HYPRE_Complex* xyVal ) { -/* xy = x'*y */ - - HYPRE_Int ix, iy, mx, my, jxy; - HYPRE_Complex* p; - void** px; - void** py; - hypre_TempMultiVector* xData; - hypre_TempMultiVector* yData; - - xData = (hypre_TempMultiVector*)x_; - yData = (hypre_TempMultiVector*)y_; - hypre_assert( xData != NULL && yData != NULL ); - - mx = aux_maskCount( xData->numVectors, xData->mask ); - hypre_assert( mx == xyHeight ); - - my = aux_maskCount( yData->numVectors, yData->mask ); - hypre_assert( my == xyWidth ); - - px = hypre_CTAlloc(void*, mx, HYPRE_MEMORY_HOST); - hypre_assert( px != NULL ); - py = hypre_CTAlloc(void*, my, HYPRE_MEMORY_HOST); - hypre_assert( py != NULL ); - - hypre_collectVectorPtr( xData->mask, xData, px ); - hypre_collectVectorPtr( yData->mask, yData, py ); - - jxy = xyGHeight - xyHeight; - for ( iy = 0, p = xyVal; iy < my; iy++ ) { - for ( ix = 0; ix < mx; ix++, p++ ) - *p = (xData->interpreter->InnerProd)(px[ix],py[iy]); - p += jxy; - } - - hypre_TFree(px, HYPRE_MEMORY_HOST); - hypre_TFree(py, HYPRE_MEMORY_HOST); + HYPRE_Int xyWidth, HYPRE_Complex* xyVal ) +{ + /* xy = x'*y */ + + HYPRE_Int ix, iy, mx, my, jxy; + HYPRE_Complex* p; + void** px; + void** py; + hypre_TempMultiVector* xData; + hypre_TempMultiVector* yData; + + xData = (hypre_TempMultiVector*)x_; + yData = (hypre_TempMultiVector*)y_; + hypre_assert( xData != NULL && yData != NULL ); + + mx = aux_maskCount( xData->numVectors, xData->mask ); + hypre_assert( mx == xyHeight ); + + my = aux_maskCount( yData->numVectors, yData->mask ); + hypre_assert( my == xyWidth ); + + px = hypre_CTAlloc(void*, mx, HYPRE_MEMORY_HOST); + hypre_assert( px != NULL ); + py = hypre_CTAlloc(void*, my, HYPRE_MEMORY_HOST); + hypre_assert( py != NULL ); + + hypre_collectVectorPtr( xData->mask, xData, px ); + hypre_collectVectorPtr( yData->mask, yData, py ); + + jxy = xyGHeight - xyHeight; + for ( iy = 0, p = xyVal; iy < my; iy++ ) + { + for ( ix = 0; ix < mx; ix++, p++ ) + { + *p = (xData->interpreter->InnerProd)(px[ix], py[iy]); + } + p += jxy; + } + + hypre_TFree(px, HYPRE_MEMORY_HOST); + hypre_TFree(py, HYPRE_MEMORY_HOST); } void hypre_TempMultiVectorByMultiVectorDiag( void* x_, void* y_, - HYPRE_Int* mask, HYPRE_Int n, HYPRE_Complex* diag ) { -/* diag = diag(x'*y) */ - - HYPRE_Int i, mx, my, m; - void** px; - void** py; - HYPRE_Int* index; - hypre_TempMultiVector* xData; - hypre_TempMultiVector* yData; - - xData = (hypre_TempMultiVector*)x_; - yData = (hypre_TempMultiVector*)y_; - hypre_assert( xData != NULL && yData != NULL ); - - mx = aux_maskCount( xData->numVectors, xData->mask ); - my = aux_maskCount( yData->numVectors, yData->mask ); - m = aux_maskCount( n, mask ); - hypre_assert( mx == my && mx == m ); - - px = hypre_CTAlloc(void*, mx, HYPRE_MEMORY_HOST); - hypre_assert( px != NULL ); - py = hypre_CTAlloc(void*, my, HYPRE_MEMORY_HOST); - hypre_assert( py != NULL ); - - hypre_collectVectorPtr( xData->mask, xData, px ); - hypre_collectVectorPtr( yData->mask, yData, py ); - - index = hypre_CTAlloc(HYPRE_Int, m, HYPRE_MEMORY_HOST); - aux_indexFromMask( n, mask, index ); - - for ( i = 0; i < m; i++ ) - *(diag+index[i]-1) = (xData->interpreter->InnerProd)(px[i],py[i]); - - hypre_TFree(index, HYPRE_MEMORY_HOST); - hypre_TFree(px, HYPRE_MEMORY_HOST); - hypre_TFree(py, HYPRE_MEMORY_HOST); + HYPRE_Int* mask, HYPRE_Int n, HYPRE_Complex* diag ) +{ + /* diag = diag(x'*y) */ + + HYPRE_Int i, mx, my, m; + void** px; + void** py; + HYPRE_Int* index; + hypre_TempMultiVector* xData; + hypre_TempMultiVector* yData; + + xData = (hypre_TempMultiVector*)x_; + yData = (hypre_TempMultiVector*)y_; + hypre_assert( xData != NULL && yData != NULL ); + + mx = aux_maskCount( xData->numVectors, xData->mask ); + my = aux_maskCount( yData->numVectors, yData->mask ); + m = aux_maskCount( n, mask ); + hypre_assert( mx == my && mx == m ); + + px = hypre_CTAlloc(void*, mx, HYPRE_MEMORY_HOST); + hypre_assert( px != NULL ); + py = hypre_CTAlloc(void*, my, HYPRE_MEMORY_HOST); + hypre_assert( py != NULL ); + + hypre_collectVectorPtr( xData->mask, xData, px ); + hypre_collectVectorPtr( yData->mask, yData, py ); + + index = hypre_CTAlloc(HYPRE_Int, m, HYPRE_MEMORY_HOST); + aux_indexFromMask( n, mask, index ); + + for ( i = 0; i < m; i++ ) + { + *(diag + index[i] - 1) = (xData->interpreter->InnerProd)(px[i], py[i]); + } + + hypre_TFree(index, HYPRE_MEMORY_HOST); + hypre_TFree(px, HYPRE_MEMORY_HOST); + hypre_TFree(py, HYPRE_MEMORY_HOST); } void hypre_TempMultiVectorByMatrix( void* x_, HYPRE_Int rGHeight, HYPRE_Int rHeight, HYPRE_Int rWidth, HYPRE_Complex* rVal, - void* y_ ) { - - HYPRE_Int i, j, jump; - HYPRE_Int mx, my; - HYPRE_Complex* p; - void** px; - void** py; - hypre_TempMultiVector* xData; - hypre_TempMultiVector* yData; - - xData = (hypre_TempMultiVector*)x_; - yData = (hypre_TempMultiVector*)y_; - hypre_assert( xData != NULL && yData != NULL ); - - mx = aux_maskCount( xData->numVectors, xData->mask ); - my = aux_maskCount( yData->numVectors, yData->mask ); - - hypre_assert( mx == rHeight && my == rWidth ); - - px = hypre_CTAlloc(void*, mx, HYPRE_MEMORY_HOST); - hypre_assert( px != NULL ); - py = hypre_CTAlloc(void*, my, HYPRE_MEMORY_HOST); - hypre_assert( py != NULL ); - - hypre_collectVectorPtr( xData->mask, xData, px ); - hypre_collectVectorPtr( yData->mask, yData, py ); - - jump = rGHeight - rHeight; - for ( j = 0, p = rVal; j < my; j++ ) { - (xData->interpreter->ClearVector)( py[j] ); - for ( i = 0; i < mx; i++, p++ ) - (xData->interpreter->Axpy)(*p,px[i],py[j]); - p += jump; - } - - hypre_TFree(px, HYPRE_MEMORY_HOST); - hypre_TFree(py, HYPRE_MEMORY_HOST); + void* y_ ) +{ + + HYPRE_Int i, j, jump; + HYPRE_Int mx, my; + HYPRE_Complex* p; + void** px; + void** py; + hypre_TempMultiVector* xData; + hypre_TempMultiVector* yData; + + xData = (hypre_TempMultiVector*)x_; + yData = (hypre_TempMultiVector*)y_; + hypre_assert( xData != NULL && yData != NULL ); + + mx = aux_maskCount( xData->numVectors, xData->mask ); + my = aux_maskCount( yData->numVectors, yData->mask ); + + hypre_assert( mx == rHeight && my == rWidth ); + + px = hypre_CTAlloc(void*, mx, HYPRE_MEMORY_HOST); + hypre_assert( px != NULL ); + py = hypre_CTAlloc(void*, my, HYPRE_MEMORY_HOST); + hypre_assert( py != NULL ); + + hypre_collectVectorPtr( xData->mask, xData, px ); + hypre_collectVectorPtr( yData->mask, yData, py ); + + jump = rGHeight - rHeight; + for ( j = 0, p = rVal; j < my; j++ ) + { + (xData->interpreter->ClearVector)( py[j] ); + for ( i = 0; i < mx; i++, p++ ) + { + (xData->interpreter->Axpy)(*p, px[i], py[j]); + } + p += jump; + } + + hypre_TFree(px, HYPRE_MEMORY_HOST); + hypre_TFree(py, HYPRE_MEMORY_HOST); } void hypre_TempMultiVectorXapy( void* x_, HYPRE_Int rGHeight, HYPRE_Int rHeight, HYPRE_Int rWidth, HYPRE_Complex* rVal, - void* y_ ) { - - HYPRE_Int i, j, jump; - HYPRE_Int mx, my; - HYPRE_Complex* p; - void** px; - void** py; - hypre_TempMultiVector* xData; - hypre_TempMultiVector* yData; - - xData = (hypre_TempMultiVector*)x_; - yData = (hypre_TempMultiVector*)y_; - hypre_assert( xData != NULL && yData != NULL ); - - mx = aux_maskCount( xData->numVectors, xData->mask ); - my = aux_maskCount( yData->numVectors, yData->mask ); - - hypre_assert( mx == rHeight && my == rWidth ); - - px = hypre_CTAlloc(void*, mx, HYPRE_MEMORY_HOST); - hypre_assert( px != NULL ); - py = hypre_CTAlloc(void*, my, HYPRE_MEMORY_HOST); - hypre_assert( py != NULL ); - - hypre_collectVectorPtr( xData->mask, xData, px ); - hypre_collectVectorPtr( yData->mask, yData, py ); - - jump = rGHeight - rHeight; - for ( j = 0, p = rVal; j < my; j++ ) { - for ( i = 0; i < mx; i++, p++ ) - (xData->interpreter->Axpy)(*p,px[i],py[j]); - p += jump; - } - - hypre_TFree(px, HYPRE_MEMORY_HOST); - hypre_TFree(py, HYPRE_MEMORY_HOST); + void* y_ ) +{ + + HYPRE_Int i, j, jump; + HYPRE_Int mx, my; + HYPRE_Complex* p; + void** px; + void** py; + hypre_TempMultiVector* xData; + hypre_TempMultiVector* yData; + + xData = (hypre_TempMultiVector*)x_; + yData = (hypre_TempMultiVector*)y_; + hypre_assert( xData != NULL && yData != NULL ); + + mx = aux_maskCount( xData->numVectors, xData->mask ); + my = aux_maskCount( yData->numVectors, yData->mask ); + + hypre_assert( mx == rHeight && my == rWidth ); + + px = hypre_CTAlloc(void*, mx, HYPRE_MEMORY_HOST); + hypre_assert( px != NULL ); + py = hypre_CTAlloc(void*, my, HYPRE_MEMORY_HOST); + hypre_assert( py != NULL ); + + hypre_collectVectorPtr( xData->mask, xData, px ); + hypre_collectVectorPtr( yData->mask, yData, py ); + + jump = rGHeight - rHeight; + for ( j = 0, p = rVal; j < my; j++ ) + { + for ( i = 0; i < mx; i++, p++ ) + { + (xData->interpreter->Axpy)(*p, px[i], py[j]); + } + p += jump; + } + + hypre_TFree(px, HYPRE_MEMORY_HOST); + hypre_TFree(py, HYPRE_MEMORY_HOST); } void hypre_TempMultiVectorByDiagonal( void* x_, HYPRE_Int* mask, HYPRE_Int n, HYPRE_Complex* diag, - void* y_ ) { - - HYPRE_Int j; - HYPRE_Int mx, my, m; - void** px; - void** py; - HYPRE_Int* index; - hypre_TempMultiVector* xData; - hypre_TempMultiVector* yData; - - xData = (hypre_TempMultiVector*)x_; - yData = (hypre_TempMultiVector*)y_; - hypre_assert( xData != NULL && yData != NULL ); - - mx = aux_maskCount( xData->numVectors, xData->mask ); - my = aux_maskCount( yData->numVectors, yData->mask ); - m = aux_maskCount( n, mask ); - - hypre_assert( mx == m && my == m ); - - if ( m < 1 ) - return; - - px = hypre_CTAlloc(void*, mx, HYPRE_MEMORY_HOST); - hypre_assert( px != NULL ); - py = hypre_CTAlloc(void*, my, HYPRE_MEMORY_HOST); - hypre_assert( py != NULL ); - - index = hypre_CTAlloc(HYPRE_Int, m, HYPRE_MEMORY_HOST); - aux_indexFromMask( n, mask, index ); - - hypre_collectVectorPtr( xData->mask, xData, px ); - hypre_collectVectorPtr( yData->mask, yData, py ); - - for ( j = 0; j < my; j++ ) { - (xData->interpreter->ClearVector)(py[j]); - (xData->interpreter->Axpy)(diag[index[j]-1],px[j],py[j]); - } - - hypre_TFree(px, HYPRE_MEMORY_HOST); - hypre_TFree(py, HYPRE_MEMORY_HOST); - hypre_TFree(index, HYPRE_MEMORY_HOST); + void* y_ ) +{ + + HYPRE_Int j; + HYPRE_Int mx, my, m; + void** px; + void** py; + HYPRE_Int* index; + hypre_TempMultiVector* xData; + hypre_TempMultiVector* yData; + + xData = (hypre_TempMultiVector*)x_; + yData = (hypre_TempMultiVector*)y_; + hypre_assert( xData != NULL && yData != NULL ); + + mx = aux_maskCount( xData->numVectors, xData->mask ); + my = aux_maskCount( yData->numVectors, yData->mask ); + m = aux_maskCount( n, mask ); + + hypre_assert( mx == m && my == m ); + + if ( m < 1 ) + { + return; + } + + px = hypre_CTAlloc(void*, mx, HYPRE_MEMORY_HOST); + hypre_assert( px != NULL ); + py = hypre_CTAlloc(void*, my, HYPRE_MEMORY_HOST); + hypre_assert( py != NULL ); + + index = hypre_CTAlloc(HYPRE_Int, m, HYPRE_MEMORY_HOST); + aux_indexFromMask( n, mask, index ); + + hypre_collectVectorPtr( xData->mask, xData, px ); + hypre_collectVectorPtr( yData->mask, yData, py ); + + for ( j = 0; j < my; j++ ) + { + (xData->interpreter->ClearVector)(py[j]); + (xData->interpreter->Axpy)(diag[index[j] - 1], px[j], py[j]); + } + + hypre_TFree(px, HYPRE_MEMORY_HOST); + hypre_TFree(py, HYPRE_MEMORY_HOST); + hypre_TFree(index, HYPRE_MEMORY_HOST); } void hypre_TempMultiVectorEval( void (*f)( void*, void*, void* ), void* par, - void* x_, void* y_ ) { - - HYPRE_Int i, mx, my; - void** px; - void** py; - hypre_TempMultiVector* x; - hypre_TempMultiVector* y; - - x = (hypre_TempMultiVector*)x_; - y = (hypre_TempMultiVector*)y_; - hypre_assert( x != NULL && y != NULL ); - - if ( f == NULL ) { - hypre_TempMultiVectorCopy( x, y ); - return; - } - - mx = aux_maskCount( x->numVectors, x->mask ); - my = aux_maskCount( y->numVectors, y->mask ); - hypre_assert( mx == my ); - - px = hypre_CTAlloc(void*, mx, HYPRE_MEMORY_HOST); - hypre_assert( px != NULL ); - py = hypre_CTAlloc(void*, my, HYPRE_MEMORY_HOST); - hypre_assert( py != NULL ); - - hypre_collectVectorPtr( x->mask, x, px ); - hypre_collectVectorPtr( y->mask, y, py ); - - for ( i = 0; i < mx; i++ ) - f( par, (void*)px[i], (void*)py[i] ); - - hypre_TFree(px, HYPRE_MEMORY_HOST); - hypre_TFree(py, HYPRE_MEMORY_HOST); + void* x_, void* y_ ) +{ + + HYPRE_Int i, mx, my; + void** px; + void** py; + hypre_TempMultiVector* x; + hypre_TempMultiVector* y; + + x = (hypre_TempMultiVector*)x_; + y = (hypre_TempMultiVector*)y_; + hypre_assert( x != NULL && y != NULL ); + + if ( f == NULL ) + { + hypre_TempMultiVectorCopy( x, y ); + return; + } + + mx = aux_maskCount( x->numVectors, x->mask ); + my = aux_maskCount( y->numVectors, y->mask ); + hypre_assert( mx == my ); + + px = hypre_CTAlloc(void*, mx, HYPRE_MEMORY_HOST); + hypre_assert( px != NULL ); + py = hypre_CTAlloc(void*, my, HYPRE_MEMORY_HOST); + hypre_assert( py != NULL ); + + hypre_collectVectorPtr( x->mask, x, px ); + hypre_collectVectorPtr( y->mask, y, py ); + + for ( i = 0; i < mx; i++ ) + { + f( par, (void*)px[i], (void*)py[i] ); + } + + hypre_TFree(px, HYPRE_MEMORY_HOST); + hypre_TFree(py, HYPRE_MEMORY_HOST); } HYPRE_Int -hypre_TempMultiVectorPrint( void* x_, const char* fileName ) { - - HYPRE_Int i, ierr; - hypre_TempMultiVector* x; - char fullName[128]; - - x = (hypre_TempMultiVector*)x_; - hypre_assert( x != NULL ); - if ( x->interpreter->PrintVector == NULL ) - return 1; - - ierr = 0; - for ( i = 0; i < x->numVectors; i++ ) { - hypre_sprintf( fullName, "%s.%d", fileName, i ); - ierr = ierr || - (x->interpreter->PrintVector)( x->vector[i], fullName ); - } - return ierr; +hypre_TempMultiVectorPrint( void* x_, const char* fileName ) +{ + + HYPRE_Int i, ierr; + hypre_TempMultiVector* x; + char fullName[128]; + + x = (hypre_TempMultiVector*)x_; + hypre_assert( x != NULL ); + if ( x->interpreter->PrintVector == NULL ) + { + return 1; + } + + ierr = 0; + for ( i = 0; i < x->numVectors; i++ ) + { + hypre_sprintf( fullName, "%s.%d", fileName, i ); + ierr = ierr || + (x->interpreter->PrintVector)( x->vector[i], fullName ); + } + return ierr; } void* -hypre_TempMultiVectorRead( MPI_Comm comm, void* ii_, const char* fileName ) { +hypre_TempMultiVectorRead( MPI_Comm comm, void* ii_, const char* fileName ) +{ - HYPRE_Int i, n, id; - FILE* fp; - char fullName[128]; - hypre_TempMultiVector* x; - HYPRE_InterfaceInterpreter* ii = (HYPRE_InterfaceInterpreter*)ii_; + HYPRE_Int i, n, id; + FILE* fp; + char fullName[128]; + hypre_TempMultiVector* x; + HYPRE_InterfaceInterpreter* ii = (HYPRE_InterfaceInterpreter*)ii_; - if ( ii->ReadVector == NULL ) - return NULL; + if ( ii->ReadVector == NULL ) + { + return NULL; + } - hypre_MPI_Comm_rank( comm, &id ); + hypre_MPI_Comm_rank( comm, &id ); - n = 0; - do { - hypre_sprintf( fullName, "%s.%d.%d", fileName, n, id ); - if ( (fp = fopen(fullName, "r")) ) { - n++; - fclose( fp ); - } - } while ( fp ); + n = 0; + do + { + hypre_sprintf( fullName, "%s.%d.%d", fileName, n, id ); + if ( (fp = fopen(fullName, "r")) ) + { + n++; + fclose( fp ); + } + } + while ( fp ); - x = hypre_TAlloc(hypre_TempMultiVector, 1, HYPRE_MEMORY_HOST); - hypre_assert( x != NULL ); + x = hypre_TAlloc(hypre_TempMultiVector, 1, HYPRE_MEMORY_HOST); + hypre_assert( x != NULL ); - x->interpreter = ii; + x->interpreter = ii; - x->numVectors = n; + x->numVectors = n; - x->vector = hypre_CTAlloc(void*, n, HYPRE_MEMORY_HOST); - hypre_assert( x->vector != NULL ); + x->vector = hypre_CTAlloc(void*, n, HYPRE_MEMORY_HOST); + hypre_assert( x->vector != NULL ); - x->ownsVectors = 1; + x->ownsVectors = 1; - for ( i = 0; i < n; i++ ) { - hypre_sprintf( fullName, "%s.%d", fileName, i ); - x->vector[i] = (ii->ReadVector)( comm, fullName ); - } + for ( i = 0; i < n; i++ ) + { + hypre_sprintf( fullName, "%s.%d", fileName, i ); + x->vector[i] = (ii->ReadVector)( comm, fullName ); + } - x->mask = NULL; - x->ownsMask = 0; + x->mask = NULL; + x->ownsMask = 0; - return x; + return x; } HYPRE_Int -aux_maskCount( HYPRE_Int n, HYPRE_Int* mask ) { +aux_maskCount( HYPRE_Int n, HYPRE_Int* mask ) +{ - HYPRE_Int i, m; + HYPRE_Int i, m; - if ( mask == NULL ) - return n; + if ( mask == NULL ) + { + return n; + } - for ( i = m = 0; i < n; i++ ) - if ( mask[i] ) - m++; + for ( i = m = 0; i < n; i++ ) + if ( mask[i] ) + { + m++; + } - return m; + return m; } void -aux_indexFromMask( HYPRE_Int n, HYPRE_Int* mask, HYPRE_Int* index ) { - - HYPRE_Int i, j; - - if ( mask != NULL ) { - for ( i = 0, j = 0; i < n; i++ ) - if ( mask[i] ) - index[j++] = i + 1; - } - else - for ( i = 0; i < n; i++ ) - index[i] = i + 1; +aux_indexFromMask( HYPRE_Int n, HYPRE_Int* mask, HYPRE_Int* index ) +{ + + HYPRE_Int i, j; + + if ( mask != NULL ) + { + for ( i = 0, j = 0; i < n; i++ ) + if ( mask[i] ) + { + index[j++] = i + 1; + } + } + else + for ( i = 0; i < n; i++ ) + { + index[i] = i + 1; + } } diff --git a/external/hypre/src/multivector/csr_matmultivec.c b/external/hypre/src/multivector/csr_matmultivec.c index 6975e1f2..192d7369 100644 --- a/external/hypre/src/multivector/csr_matmultivec.c +++ b/external/hypre/src/multivector/csr_matmultivec.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -34,11 +34,11 @@ hypre_CSRMatrixMatMultivec(HYPRE_Complex alpha, hypre_CSRMatrix *A, HYPRE_Int x_size = hypre_MultivectorSize(x); HYPRE_Int y_size = hypre_MultivectorSize(y); HYPRE_Int num_vectors = hypre_MultivectorNumVectors(x); - HYPRE_Int *x_active_ind= x->active_indices; - HYPRE_Int *y_active_ind= y->active_indices; + HYPRE_Int *x_active_ind = x->active_indices; + HYPRE_Int *y_active_ind = y->active_indices; HYPRE_Int num_active_vectors = x->num_active_vectors; HYPRE_Int i, j, jj, m, ierr = 0, optimize; - HYPRE_Complex temp, tempx, xpar=0.7, *xptr, *yptr; + HYPRE_Complex temp, tempx, xpar = 0.7, *xptr, *yptr; /*--------------------------------------------------------------------- * Check for size compatibility. Matvec returns ierr = 1 if @@ -51,27 +51,29 @@ hypre_CSRMatrixMatMultivec(HYPRE_Complex alpha, hypre_CSRMatrix *A, * is informational only. *--------------------------------------------------------------------*/ - hypre_assert(num_active_vectors == y->num_active_vectors); - if (num_cols != x_size) ierr = 1; - if (num_rows != y_size) ierr = 2; - if (num_cols != x_size && num_rows != y_size) ierr = 3; - optimize = 0; - if (num_active_vectors == num_vectors && num_vectors == y->num_vectors) - optimize = 1; + hypre_assert(num_active_vectors == y->num_active_vectors); + if (num_cols != x_size) { ierr = 1; } + if (num_rows != y_size) { ierr = 2; } + if (num_cols != x_size && num_rows != y_size) { ierr = 3; } + optimize = 0; + if (num_active_vectors == num_vectors && num_vectors == y->num_vectors) + { + optimize = 1; + } /*----------------------------------------------------------------------- * Do (alpha == 0.0) computation - RDF: USE MACHINE EPS *-----------------------------------------------------------------------*/ - if (alpha == 0.0) - { + if (alpha == 0.0) + { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i = 0; i < num_rows*num_vectors; i++) y_data[i] *= beta; + for (i = 0; i < num_rows * num_vectors; i++) { y_data[i] *= beta; } - return ierr; - } + return ierr; + } /*----------------------------------------------------------------------- * y = (beta/alpha)*y @@ -84,16 +86,16 @@ hypre_CSRMatrixMatMultivec(HYPRE_Complex alpha, hypre_CSRMatrix *A, if (temp == 0.0) { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i = 0; i < num_rows*num_vectors; i++) y_data[i] = 0.0; + for (i = 0; i < num_rows * num_vectors; i++) { y_data[i] = 0.0; } } else { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i = 0; i < num_rows*num_vectors; i++) y_data[i] *= temp; + for (i = 0; i < num_rows * num_vectors; i++) { y_data[i] *= temp; } } } @@ -101,13 +103,15 @@ hypre_CSRMatrixMatMultivec(HYPRE_Complex alpha, hypre_CSRMatrix *A, * y += A*x *-----------------------------------------------------------------*/ - if ( num_vectors==1 ) + if ( num_vectors == 1 ) { for (i = 0; i < num_rows; i++) { temp = y_data[i]; - for (jj = A_i[i]; jj < A_i[i+1]; jj++) + for (jj = A_i[i]; jj < A_i[i + 1]; jj++) + { temp += A_data[jj] * x_data[A_j[jj]]; + } y_data[i] = temp; } } @@ -117,13 +121,15 @@ hypre_CSRMatrixMatMultivec(HYPRE_Complex alpha, hypre_CSRMatrix *A, { for (i = 0; i < num_rows; i++) { - for (j=0; jactive_indices; - HYPRE_Int *y_active_ind= y->active_indices; + HYPRE_Int *x_active_ind = x->active_indices; + HYPRE_Int *y_active_ind = y->active_indices; HYPRE_Int num_active_vectors = x->num_active_vectors; HYPRE_Complex temp; HYPRE_Int i, jv, jj, size, ierr = 0; @@ -211,10 +221,10 @@ hypre_CSRMatrixMatMultivecT(HYPRE_Complex alpha, hypre_CSRMatrix *A, * is informational only. *--------------------------------------------------------------------*/ - hypre_assert(num_active_vectors == y->num_active_vectors); - if (num_rows != x_size) ierr = 1; - if (num_cols != y_size) ierr = 2; - if (num_rows != x_size && num_cols != y_size) ierr = 3; + hypre_assert(num_active_vectors == y->num_active_vectors); + if (num_rows != x_size) { ierr = 1; } + if (num_cols != y_size) { ierr = 2; } + if (num_rows != x_size && num_cols != y_size) { ierr = 3; } /*----------------------------------------------------------------------- * Do (alpha == 0.0) computation - RDF: USE MACHINE EPS @@ -223,9 +233,9 @@ hypre_CSRMatrixMatMultivecT(HYPRE_Complex alpha, hypre_CSRMatrix *A, if (alpha == 0.0) { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i = 0; i < num_cols*num_vectors; i++) y_data[i] *= beta; + for (i = 0; i < num_cols * num_vectors; i++) { y_data[i] *= beta; } return ierr; } @@ -240,16 +250,16 @@ hypre_CSRMatrixMatMultivecT(HYPRE_Complex alpha, hypre_CSRMatrix *A, if (temp == 0.0) { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i = 0; i < num_cols*num_vectors; i++) y_data[i] = 0.0; + for (i = 0; i < num_cols * num_vectors; i++) { y_data[i] = 0.0; } } else { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i = 0; i < num_cols*num_vectors; i++) y_data[i] *= temp; + for (i = 0; i < num_cols * num_vectors; i++) { y_data[i] *= temp; } } } @@ -257,20 +267,24 @@ hypre_CSRMatrixMatMultivecT(HYPRE_Complex alpha, hypre_CSRMatrix *A, * y += A^T*x *-----------------------------------------------------------------*/ - if ( num_vectors==1 ) + if ( num_vectors == 1 ) { for (i = 0; i < num_rows; i++) { - for (jj = A_i[i]; jj < A_i[i+1]; jj++) + for (jj = A_i[i]; jj < A_i[i + 1]; jj++) + { y_data[A_j[jj]] += A_data[jj] * x_data[i]; + } } } else { - for ( jv=0; jvdata; + hypre_assert (x != NULL); + return x->data; } mv_MultiVectorPtr mv_MultiVectorWrap( mv_InterfaceInterpreter* ii, void * data, HYPRE_Int ownsData ) { - mv_MultiVectorPtr x; + mv_MultiVectorPtr x; - x = hypre_TAlloc(struct mv_MultiVector, 1, HYPRE_MEMORY_HOST); - hypre_assert( x != NULL ); + x = hypre_TAlloc(struct mv_MultiVector, 1, HYPRE_MEMORY_HOST); + hypre_assert( x != NULL ); - x->interpreter = ii; - x->data = data; - x->ownsData = ownsData; + x->interpreter = ii; + x->data = data; + x->ownsData = ownsData; - return x; + return x; } mv_MultiVectorPtr -mv_MultiVectorCreateFromSampleVector( void* ii_, HYPRE_Int n, void* sample ) { +mv_MultiVectorCreateFromSampleVector( void* ii_, HYPRE_Int n, void* sample ) +{ - mv_MultiVectorPtr x; - mv_InterfaceInterpreter* ii = (mv_InterfaceInterpreter*)ii_; + mv_MultiVectorPtr x; + mv_InterfaceInterpreter* ii = (mv_InterfaceInterpreter*)ii_; - x = hypre_TAlloc(struct mv_MultiVector, 1, HYPRE_MEMORY_HOST); - hypre_assert( x != NULL ); + x = hypre_TAlloc(struct mv_MultiVector, 1, HYPRE_MEMORY_HOST); + hypre_assert( x != NULL ); - x->interpreter = ii; - x->data = (ii->CreateMultiVector)( ii, n, sample ); - x->ownsData = 1; + x->interpreter = ii; + x->data = (ii->CreateMultiVector)( ii, n, sample ); + x->ownsData = 1; - return x; + return x; } mv_MultiVectorPtr -mv_MultiVectorCreateCopy( mv_MultiVectorPtr x, HYPRE_Int copyValues ) { +mv_MultiVectorCreateCopy( mv_MultiVectorPtr x, HYPRE_Int copyValues ) +{ - mv_MultiVectorPtr y; - void* data; - mv_InterfaceInterpreter* ii; + mv_MultiVectorPtr y; + void* data; + mv_InterfaceInterpreter* ii; - hypre_assert( x != NULL ); - ii = x->interpreter; + hypre_assert( x != NULL ); + ii = x->interpreter; - y = hypre_TAlloc(struct mv_MultiVector, 1, HYPRE_MEMORY_HOST); - hypre_assert( y != NULL ); + y = hypre_TAlloc(struct mv_MultiVector, 1, HYPRE_MEMORY_HOST); + hypre_assert( y != NULL ); - data = (ii->CopyCreateMultiVector)( x->data, copyValues ); + data = (ii->CopyCreateMultiVector)( x->data, copyValues ); - y->interpreter = ii; - y->data = data; - y->ownsData = 1; + y->interpreter = ii; + y->data = data; + y->ownsData = 1; - return y; + return y; } void -mv_MultiVectorDestroy( mv_MultiVectorPtr v) { +mv_MultiVectorDestroy( mv_MultiVectorPtr v) +{ - if ( v == NULL ) - return; + if ( v == NULL ) + { + return; + } - if ( v->ownsData ) - (v->interpreter->DestroyMultiVector)( v->data ); - hypre_TFree( v ,HYPRE_MEMORY_HOST); + if ( v->ownsData ) + { + (v->interpreter->DestroyMultiVector)( v->data ); + } + hypre_TFree( v, HYPRE_MEMORY_HOST); } void -mv_MultiVectorSetMask( mv_MultiVectorPtr v, HYPRE_Int* mask ) { +mv_MultiVectorSetMask( mv_MultiVectorPtr v, HYPRE_Int* mask ) +{ - hypre_assert( v != NULL ); - (v->interpreter->SetMask)( v->data, mask ); + hypre_assert( v != NULL ); + (v->interpreter->SetMask)( v->data, mask ); } HYPRE_Int -mv_MultiVectorWidth( mv_MultiVectorPtr v ) { +mv_MultiVectorWidth( mv_MultiVectorPtr v ) +{ - if ( v == NULL ) - return 0; + if ( v == NULL ) + { + return 0; + } - return (v->interpreter->Width)( v->data ); + return (v->interpreter->Width)( v->data ); } HYPRE_Int -mv_MultiVectorHeight( mv_MultiVectorPtr v ) { +mv_MultiVectorHeight( mv_MultiVectorPtr v ) +{ - if ( v == NULL ) - return 0; + if ( v == NULL ) + { + return 0; + } - return (v->interpreter->Height)(v->data); + return (v->interpreter->Height)(v->data); } void -mv_MultiVectorClear( mv_MultiVectorPtr v ) { +mv_MultiVectorClear( mv_MultiVectorPtr v ) +{ - hypre_assert( v != NULL ); - (v->interpreter->ClearMultiVector)( v->data ); + hypre_assert( v != NULL ); + (v->interpreter->ClearMultiVector)( v->data ); } void -mv_MultiVectorSetRandom( mv_MultiVectorPtr v, HYPRE_Int seed ) { +mv_MultiVectorSetRandom( mv_MultiVectorPtr v, HYPRE_Int seed ) +{ - hypre_assert( v != NULL ); - (v->interpreter->SetRandomVectors)( v->data, seed ); + hypre_assert( v != NULL ); + (v->interpreter->SetRandomVectors)( v->data, seed ); } void -mv_MultiVectorCopy( mv_MultiVectorPtr src, mv_MultiVectorPtr dest ) { +mv_MultiVectorCopy( mv_MultiVectorPtr src, mv_MultiVectorPtr dest ) +{ - hypre_assert( src != NULL && dest != NULL ); - (src->interpreter->CopyMultiVector)( src->data, dest->data ); + hypre_assert( src != NULL && dest != NULL ); + (src->interpreter->CopyMultiVector)( src->data, dest->data ); } void -mv_MultiVectorAxpy( HYPRE_Complex a, mv_MultiVectorPtr x, mv_MultiVectorPtr y ) { +mv_MultiVectorAxpy( HYPRE_Complex a, mv_MultiVectorPtr x, mv_MultiVectorPtr y ) +{ - hypre_assert( x != NULL && y != NULL ); - (x->interpreter->MultiAxpy)( a, x->data, y->data ); + hypre_assert( x != NULL && y != NULL ); + (x->interpreter->MultiAxpy)( a, x->data, y->data ); } void mv_MultiVectorByMultiVector( mv_MultiVectorPtr x, mv_MultiVectorPtr y, - HYPRE_Int xyGHeight, HYPRE_Int xyHeight, - HYPRE_Int xyWidth, HYPRE_Real* xy ) { -/* xy = x'*y */ + HYPRE_BigInt xyGHeight, HYPRE_Int xyHeight, + HYPRE_Int xyWidth, HYPRE_Real* xy ) +{ + /* xy = x'*y */ - hypre_assert( x != NULL && y != NULL ); - (x->interpreter->MultiInnerProd) - ( x->data, y->data, xyGHeight, xyHeight, xyWidth, xy ); + hypre_assert( x != NULL && y != NULL ); + (x->interpreter->MultiInnerProd) + ( x->data, y->data, xyGHeight, xyHeight, xyWidth, xy ); } void mv_MultiVectorByMultiVectorDiag( mv_MultiVectorPtr x, mv_MultiVectorPtr y, - HYPRE_Int* mask, HYPRE_Int n, HYPRE_Real* d ) { -/* d = diag(x'*y) */ + HYPRE_Int* mask, HYPRE_Int n, HYPRE_Real* d ) +{ + /* d = diag(x'*y) */ - hypre_assert( x != NULL && y != NULL ); - (x->interpreter->MultiInnerProdDiag)( x->data, y->data, mask, n, d ); + hypre_assert( x != NULL && y != NULL ); + (x->interpreter->MultiInnerProdDiag)( x->data, y->data, mask, n, d ); } void mv_MultiVectorByMatrix( mv_MultiVectorPtr x, - HYPRE_Int rGHeight, HYPRE_Int rHeight, - HYPRE_Int rWidth, HYPRE_Complex* rVal, - mv_MultiVectorPtr y ) { + HYPRE_BigInt rGHeight, HYPRE_Int rHeight, + HYPRE_Int rWidth, HYPRE_Complex* rVal, + mv_MultiVectorPtr y ) +{ - /* y = x*r */ + /* y = x*r */ - hypre_assert( x != NULL && y != NULL ); - (x->interpreter->MultiVecMat) - ( x->data, rGHeight, rHeight, rWidth, rVal, y->data ); + hypre_assert( x != NULL && y != NULL ); + (x->interpreter->MultiVecMat) + ( x->data, rGHeight, rHeight, rWidth, rVal, y->data ); } void mv_MultiVectorXapy( mv_MultiVectorPtr x, - HYPRE_Int rGHeight, HYPRE_Int rHeight, - HYPRE_Int rWidth, HYPRE_Complex* rVal, - mv_MultiVectorPtr y ) { + HYPRE_BigInt rGHeight, HYPRE_Int rHeight, + HYPRE_Int rWidth, HYPRE_Complex* rVal, + mv_MultiVectorPtr y ) +{ - /* y = y + x*a */ + /* y = y + x*a */ - hypre_assert( x != NULL && y != NULL ); - (x->interpreter->MultiXapy) - ( x->data, rGHeight, rHeight, rWidth, rVal, y->data ); + hypre_assert( x != NULL && y != NULL ); + (x->interpreter->MultiXapy) + ( x->data, rGHeight, rHeight, rWidth, rVal, y->data ); } void mv_MultiVectorByDiagonal( mv_MultiVectorPtr x, - HYPRE_Int* mask, HYPRE_Int n, HYPRE_Complex* d, - mv_MultiVectorPtr y ) { + HYPRE_Int* mask, HYPRE_Int n, HYPRE_Complex* d, + mv_MultiVectorPtr y ) +{ - /* y = x*d */ + /* y = x*d */ - hypre_assert( x != NULL && y != NULL ); - (x->interpreter->MultiVecMatDiag)( x->data, mask, n, d, y->data ); + hypre_assert( x != NULL && y != NULL ); + (x->interpreter->MultiVecMatDiag)( x->data, mask, n, d, y->data ); } void mv_MultiVectorEval( void (*f)( void*, void*, void* ), void* par, - mv_MultiVectorPtr x, mv_MultiVectorPtr y ) { + mv_MultiVectorPtr x, mv_MultiVectorPtr y ) +{ - /* y = f(x) computed vector-wise */ + /* y = f(x) computed vector-wise */ - hypre_assert( x != NULL && y != NULL ); - (x->interpreter->Eval)( f, par, x->data, y->data ); + hypre_assert( x != NULL && y != NULL ); + (x->interpreter->Eval)( f, par, x->data, y->data ); } - - diff --git a/external/hypre/src/multivector/multivector.h b/external/hypre/src/multivector/multivector.h index 21c1a232..7fef6af3 100644 --- a/external/hypre/src/multivector/multivector.h +++ b/external/hypre/src/multivector/multivector.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -25,20 +25,20 @@ extern "C" { void * mv_MultiVectorGetData (mv_MultiVectorPtr x); - /* wraps our multivector structure around the data provided by user */ +/* wraps our multivector structure around the data provided by user */ mv_MultiVectorPtr mv_MultiVectorWrap( mv_InterfaceInterpreter* ii, void * data, HYPRE_Int ownsData ); - /* creates a multivector of width n using sample vector */ -mv_MultiVectorPtr +/* creates a multivector of width n using sample vector */ +mv_MultiVectorPtr mv_MultiVectorCreateFromSampleVector( void*, HYPRE_Int n, void* sample ); - /* creates a multivector of the same shape as x; copies values - if copyValues is non-zero */ -mv_MultiVectorPtr +/* creates a multivector of the same shape as x; copies values + if copyValues is non-zero */ +mv_MultiVectorPtr mv_MultiVectorCreateCopy( mv_MultiVectorPtr x, HYPRE_Int copyValues ); -void +void mv_MultiVectorDestroy( mv_MultiVectorPtr ); HYPRE_Int @@ -47,58 +47,58 @@ mv_MultiVectorWidth( mv_MultiVectorPtr v ); HYPRE_Int mv_MultiVectorHeight( mv_MultiVectorPtr v ); - /* sets mask for v; all the subsequent operations - apply only to masked vectors */ +/* sets mask for v; all the subsequent operations + apply only to masked vectors */ void mv_MultiVectorSetMask( mv_MultiVectorPtr v, HYPRE_Int* mask ); -void +void mv_MultiVectorClear( mv_MultiVectorPtr ); -void +void mv_MultiVectorSetRandom( mv_MultiVectorPtr v, HYPRE_Int seed ); -void +void mv_MultiVectorCopy( mv_MultiVectorPtr src, mv_MultiVectorPtr dest ); - /* computes y = a*x + y */ -void -mv_MultiVectorAxpy( HYPRE_Complex a, mv_MultiVectorPtr x, mv_MultiVectorPtr y ); +/* computes y = a*x + y */ +void +mv_MultiVectorAxpy( HYPRE_Complex a, mv_MultiVectorPtr x, mv_MultiVectorPtr y ); - /* computes the matrix v = x'*y stored in fortran style: gh is the leading dimension, - h the number of rows and w the number of columns (cf. blas or lapack) */ -void +/* computes the matrix v = x'*y stored in fortran style: gh is the leading dimension, + h the number of rows and w the number of columns (cf. blas or lapack) */ +void mv_MultiVectorByMultiVector( mv_MultiVectorPtr x, mv_MultiVectorPtr y, - HYPRE_Int gh, HYPRE_Int h, HYPRE_Int w, HYPRE_Real* v ); + HYPRE_BigInt gh, HYPRE_Int h, HYPRE_Int w, HYPRE_Real* v ); - /*computes the diagonal of x'*y stored in diag(mask) */ -void +/*computes the diagonal of x'*y stored in diag(mask) */ +void mv_MultiVectorByMultiVectorDiag( mv_MultiVectorPtr, mv_MultiVectorPtr, - HYPRE_Int* mask, HYPRE_Int n, HYPRE_Real* diag ); - - /* computes y = x*v, where v is stored in fortran style */ -void -mv_MultiVectorByMatrix( mv_MultiVectorPtr x, - HYPRE_Int gh, HYPRE_Int h, HYPRE_Int w, HYPRE_Complex* v, - mv_MultiVectorPtr y ); - - /* computes y = x*v + y, where v is stored in fortran style */ -void -mv_MultiVectorXapy( mv_MultiVectorPtr x, - HYPRE_Int gh, HYPRE_Int h, HYPRE_Int w, HYPRE_Complex* v, - mv_MultiVectorPtr y ); - - /* computes y = x*diag(mask) */ -void mv_MultiVectorByDiagonal( mv_MultiVectorPtr x, - HYPRE_Int* mask, HYPRE_Int n, HYPRE_Complex* diag, - mv_MultiVectorPtr y ); - - /* computes y = f(x) vector-by-vector */ -void -mv_MultiVectorEval( void (*f)( void*, void*, void* ), - void* par, - mv_MultiVectorPtr x, - mv_MultiVectorPtr y ); + HYPRE_Int* mask, HYPRE_Int n, HYPRE_Real* diag ); + +/* computes y = x*v, where v is stored in fortran style */ +void +mv_MultiVectorByMatrix( mv_MultiVectorPtr x, + HYPRE_BigInt gh, HYPRE_Int h, HYPRE_Int w, HYPRE_Complex* v, + mv_MultiVectorPtr y ); + +/* computes y = x*v + y, where v is stored in fortran style */ +void +mv_MultiVectorXapy( mv_MultiVectorPtr x, + HYPRE_BigInt gh, HYPRE_Int h, HYPRE_Int w, HYPRE_Complex* v, + mv_MultiVectorPtr y ); + +/* computes y = x*diag(mask) */ +void mv_MultiVectorByDiagonal( mv_MultiVectorPtr x, + HYPRE_Int* mask, HYPRE_Int n, HYPRE_Complex* diag, + mv_MultiVectorPtr y ); + +/* computes y = f(x) vector-by-vector */ +void +mv_MultiVectorEval( void (*f)( void*, void*, void* ), + void* par, + mv_MultiVectorPtr x, + mv_MultiVectorPtr y ); #ifdef __cplusplus } diff --git a/external/hypre/src/multivector/par_csr_matmultivec.c b/external/hypre/src/multivector/par_csr_matmultivec.c index a932bed2..0d10a8c3 100644 --- a/external/hypre/src/multivector/par_csr_matmultivec.c +++ b/external/hypre/src/multivector/par_csr_matmultivec.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -32,7 +32,7 @@ hypre_ParCSRMatrixMatMultiVec(HYPRE_Complex alpha, hypre_ParCSRMatrix *A, hypre_ParMultivector *x, HYPRE_Complex beta, hypre_ParMultivector *y) { - hypre_ParCSRCommMultiHandle *comm_handle; + hypre_ParCSRCommMultiHandle *comm_handle; hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); hypre_CSRMatrix *diag = hypre_ParCSRMatrixDiag(A); hypre_CSRMatrix *offd = hypre_ParCSRMatrixOffd(A); @@ -47,9 +47,9 @@ hypre_ParCSRMatrixMatMultiVec(HYPRE_Complex alpha, hypre_ParCSRMatrix *A, HYPRE_Int x_size = hypre_MultivectorSize(x_local); HYPRE_Int y_size = hypre_MultivectorSize(y_local); HYPRE_Int num_vectors = hypre_MultivectorNumVectors(x_local); - HYPRE_Int num_cols_offd = hypre_CSRMatrixNumCols(offd); + HYPRE_Int num_cols_offd = hypre_CSRMatrixNumCols(offd); HYPRE_Int ierr = 0, send_leng, num_vec_sends, endp1; - HYPRE_Int num_sends, i, j, jj, index, start, offset, length, jv; + HYPRE_Int num_sends, i, j, jj, index, start, offset, length, jv; HYPRE_Int num_active_vectors; HYPRE_Complex *x_tmp_data, *x_buf_data; @@ -61,8 +61,8 @@ hypre_ParCSRMatrixMatMultiVec(HYPRE_Complex alpha, hypre_ParCSRMatrix *A, num_active_vectors = x->num_active_vectors; hypre_assert(num_active_vectors == y->num_active_vectors); - if (x_active_ind == NULL) num_vec_sends = num_vectors; - else num_vec_sends = x->num_active_vectors; + if (x_active_ind == NULL) { num_vec_sends = num_vectors; } + else { num_vec_sends = x->num_active_vectors; } /*--------------------------------------------------------------------- * Check for size compatibility. ParMatvec returns ierr = 11 if @@ -75,9 +75,9 @@ hypre_ParCSRMatrixMatMultiVec(HYPRE_Complex alpha, hypre_ParCSRMatrix *A, * is informational only. *--------------------------------------------------------------------*/ - if (num_cols != x_size) ierr = 11; - if (num_rows != y_size) ierr = 12; - if (num_cols != x_size && num_rows != y_size) ierr = 13; + if (num_cols != x_size) { ierr = 11; } + if (num_rows != y_size) { ierr = 12; } + if (num_cols != x_size && num_rows != y_size) { ierr = 13; } /*--------------------------------------------------------------------- * If there exists no CommPkg for A, a CommPkg is generated using @@ -96,7 +96,7 @@ hypre_ParCSRMatrixMatMultiVec(HYPRE_Complex alpha, hypre_ParCSRMatrix *A, * allocate temporary and send buffers and communication handle *--------------------------------------------------------------------*/ - x_buf_data = hypre_CTAlloc(HYPRE_Complex, num_vec_sends*send_leng, HYPRE_MEMORY_HOST); + x_buf_data = hypre_CTAlloc(HYPRE_Complex, num_vec_sends * send_leng, HYPRE_MEMORY_HOST); x_tmp = hypre_SeqMultivectorCreate( num_cols_offd, num_vectors ); hypre_SeqMultivectorInitialize(x_tmp); x_tmp_data = hypre_MultivectorData(x_tmp); @@ -113,12 +113,12 @@ hypre_ParCSRMatrixMatMultiVec(HYPRE_Complex alpha, hypre_ParCSRMatrix *A, for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - endp1 = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); + endp1 = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); length = endp1 - start; for (j = start; j < endp1; j++) { - index = hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j); - x_buf_data[offset+j] = x_local_data[jj*x_size + index]; + index = hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j); + x_buf_data[offset + j] = x_local_data[jj * x_size + index]; } } offset += hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends); @@ -128,8 +128,8 @@ hypre_ParCSRMatrixMatMultiVec(HYPRE_Complex alpha, hypre_ParCSRMatrix *A, * initiate sending data *--------------------------------------------------------------------*/ - comm_handle = hypre_ParCSRCommMultiHandleCreate(1,comm_pkg,x_buf_data, - x_tmp_data, num_vec_sends); + comm_handle = hypre_ParCSRCommMultiHandleCreate(1, comm_pkg, x_buf_data, + x_tmp_data, num_vec_sends); hypre_CSRMatrixMatMultivec(alpha, diag, x_local, beta, y_local); @@ -138,7 +138,9 @@ hypre_ParCSRMatrixMatMultiVec(HYPRE_Complex alpha, hypre_ParCSRMatrix *A, hypre_TFree(comm_handle, HYPRE_MEMORY_HOST); if (num_cols_offd) + { hypre_CSRMatrixMultiMatvec(alpha, offd, x_tmp, 1.0, y_local); + } hypre_SeqMultivectorDestroy(x_tmp); x_tmp = NULL; @@ -159,7 +161,7 @@ hypre_ParCSRMatrixMultiMatVecT(HYPRE_Complex alpha, hypre_ParCSRMatrix *A, hypre_ParMultivector *x, HYPRE_Complex beta, hypre_ParMultivector *y) { - hypre_ParCSRCommMultiHandle *comm_handle; + hypre_ParCSRCommMultiHandle *comm_handle; hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); hypre_CSRMatrix *diag = hypre_ParCSRMatrixDiag(A); hypre_CSRMatrix *offd = hypre_ParCSRMatrixOffd(A); @@ -173,9 +175,9 @@ hypre_ParCSRMatrixMultiMatVecT(HYPRE_Complex alpha, hypre_ParCSRMatrix *A, HYPRE_Int x_size = hypre_MultivectorSize(x_local); HYPRE_Int y_size = hypre_MultivectorSize(y_local); HYPRE_Int num_vectors = hypre_MultivectorNumVectors(x_local); - HYPRE_Int num_cols_offd = hypre_CSRMatrixNumCols(offd); + HYPRE_Int num_cols_offd = hypre_CSRMatrixNumCols(offd); HYPRE_Int ierr = 0, send_leng, num_vec_sends, endp1; - HYPRE_Int num_sends, i, j, jj, index, start, offset, length, jv; + HYPRE_Int num_sends, i, j, jj, index, start, offset, length, jv; HYPRE_Int num_active_vectors; HYPRE_Complex *y_tmp_data, *y_buf_data; @@ -187,8 +189,8 @@ hypre_ParCSRMatrixMultiMatVecT(HYPRE_Complex alpha, hypre_ParCSRMatrix *A, num_active_vectors = x->num_active_vectors; hypre_assert(num_active_vectors == y->num_active_vectors); - if (x_active_ind == NULL) num_vec_sends = num_vectors; - else num_vec_sends = x->num_active_vectors; + if (x_active_ind == NULL) { num_vec_sends = num_vectors; } + else { num_vec_sends = x->num_active_vectors; } /*--------------------------------------------------------------------- * Check for size compatibility. MatvecT returns ierr = 1 if @@ -201,14 +203,14 @@ hypre_ParCSRMatrixMultiMatVecT(HYPRE_Complex alpha, hypre_ParCSRMatrix *A, * is informational only. *--------------------------------------------------------------------*/ - if (num_rows != x_size) ierr = 1; - if (num_cols != y_size) ierr = 2; - if (num_rows != x_size && num_cols != y_size) ierr = 3; + if (num_rows != x_size) { ierr = 1; } + if (num_cols != y_size) { ierr = 2; } + if (num_rows != x_size && num_cols != y_size) { ierr = 3; } - /*--------------------------------------------------------------------- - * If there exists no CommPkg for A, a CommPkg is generated using - * equally load balanced partitionings - *--------------------------------------------------------------------*/ + /*--------------------------------------------------------------------- + * If there exists no CommPkg for A, a CommPkg is generated using + * equally load balanced partitionings + *--------------------------------------------------------------------*/ if (!comm_pkg) { @@ -218,11 +220,11 @@ hypre_ParCSRMatrixMultiMatVecT(HYPRE_Complex alpha, hypre_ParCSRMatrix *A, num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); send_leng = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends); - /*--------------------------------------------------------------------- - * allocate temporary and send buffers and communication handle - *--------------------------------------------------------------------*/ + /*--------------------------------------------------------------------- + * allocate temporary and send buffers and communication handle + *--------------------------------------------------------------------*/ - y_buf_data = hypre_CTAlloc(HYPRE_Complex, num_vec_sends*send_leng, HYPRE_MEMORY_HOST); + y_buf_data = hypre_CTAlloc(HYPRE_Complex, num_vec_sends * send_leng, HYPRE_MEMORY_HOST); y_tmp = hypre_SeqMultivectorCreate( num_cols_offd, num_vectors ); hypre_SeqMultivectorInitialize(y_tmp); y_tmp_data = hypre_MultivectorData(y_tmp); @@ -239,12 +241,12 @@ hypre_ParCSRMatrixMultiMatVecT(HYPRE_Complex alpha, hypre_ParCSRMatrix *A, for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - endp1 = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); + endp1 = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); length = endp1 - start; for (j = start; j < endp1; j++) { - index = hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j); - y_buf_data[offset+j] = y_local_data[jj*y_size + index]; + index = hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j); + y_buf_data[offset + j] = y_local_data[jj * y_size + index]; } } offset += hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends); @@ -255,7 +257,7 @@ hypre_ParCSRMatrixMultiMatVecT(HYPRE_Complex alpha, hypre_ParCSRMatrix *A, *--------------------------------------------------------------------*/ comm_handle = hypre_ParCSRCommMultiHandleCreate(1, comm_pkg, - y_buf_data, y_tmp_data, num_vec_sends); + y_buf_data, y_tmp_data, num_vec_sends); hypre_CSRMatrixMultiMatvecT(alpha, diag, x_local, beta, y_local); @@ -264,7 +266,9 @@ hypre_ParCSRMatrixMultiMatVecT(HYPRE_Complex alpha, hypre_ParCSRMatrix *A, hypre_TFree(comm_handle, HYPRE_MEMORY_HOST); if (num_cols_offd) + { hypre_CSRMatrixMultiMatvecT(alpha, offd, y_tmp, 1.0, y_local); + } hypre_SeqMultivectorDestroy(y_tmp); y_tmp = NULL; diff --git a/external/hypre/src/multivector/par_csr_matmultivec.h b/external/hypre/src/multivector/par_csr_matmultivec.h index 7eaf6e75..74cc2c73 100644 --- a/external/hypre/src/multivector/par_csr_matmultivec.h +++ b/external/hypre/src/multivector/par_csr_matmultivec.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -22,13 +22,13 @@ extern "C" { #endif HYPRE_Int hypre_ParCSRMatrixMatMultiVec(HYPRE_Complex, hypre_ParCSRMatrix*, - hypre_ParMultiVector*, - HYPRE_Complex, hypre_ParMultiVector*); + hypre_ParMultiVector*, + HYPRE_Complex, hypre_ParMultiVector*); HYPRE_Int hypre_ParCSRMatrixMatMultiVecT(HYPRE_Complex, hypre_ParCSRMatrix*, - hypre_ParMultiVector*, - HYPRE_Complex, hypre_ParMultiVector*); + hypre_ParMultiVector*, + HYPRE_Complex, hypre_ParMultiVector*); #ifdef __cplusplus } diff --git a/external/hypre/src/multivector/par_csr_pmvcomm.c b/external/hypre/src/multivector/par_csr_pmvcomm.c index dbfbe5cb..75ca4bfd 100644 --- a/external/hypre/src/multivector/par_csr_pmvcomm.c +++ b/external/hypre/src/multivector/par_csr_pmvcomm.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -14,8 +14,8 @@ hypre_ParCSRCommMultiHandle * hypre_ParCSRCommMultiHandleCreate (HYPRE_Int job, hypre_ParCSRCommPkg *comm_pkg, - void *send_data, - void *recv_data, + void *send_data, + void *recv_data, HYPRE_Int num_vecs ) { HYPRE_Int num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); @@ -29,27 +29,27 @@ hypre_ParCSRCommMultiHandleCreate (HYPRE_Int job, HYPRE_Int i, j; HYPRE_Int my_id, num_procs; HYPRE_Int ip, vec_start, vec_len; - + /*-------------------------------------------------------------------- * hypre_Initialize sets up a communication handle, - * posts receives and initiates sends. It always requires num_sends, + * posts receives and initiates sends. It always requires num_sends, * num_recvs, recv_procs and send_procs to be set in comm_pkg. * There are different options for job: * job = 1 : is used to initialize communication exchange for the parts - * of vector needed to perform a Matvec, it requires send_data - * and recv_data to be doubles, recv_vec_starts and + * of vector needed to perform a Matvec, it requires send_data + * and recv_data to be doubles, recv_vec_starts and * send_map_starts need to be set in comm_pkg. * job = 2 : is used to initialize communication exchange for the parts - * of vector needed to perform a MatvecT, it requires send_data - * and recv_data to be doubles, recv_vec_starts and + * of vector needed to perform a MatvecT, it requires send_data + * and recv_data to be doubles, recv_vec_starts and * send_map_starts need to be set in comm_pkg. *--------------------------------------------------------------------*/ num_requests = num_sends + num_recvs; requests = hypre_CTAlloc(hypre_MPI_Request, num_requests, HYPRE_MEMORY_HOST); - - hypre_MPI_Comm_size(comm,&num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); j = 0; switch (job) @@ -60,18 +60,18 @@ hypre_ParCSRCommMultiHandleCreate (HYPRE_Int job, HYPRE_Complex *d_recv_data = (HYPRE_Complex *) recv_data; for (i = 0; i < num_recvs; i++) { - ip = hypre_ParCSRCommPkgRecvProc(comm_pkg, i); - vec_start = hypre_ParCSRCommPkgRecvVecStart(comm_pkg,i); - vec_len = hypre_ParCSRCommPkgRecvVecStart(comm_pkg,i+1)-vec_start; - hypre_MPI_Irecv(&d_recv_data[vec_start*num_vecs], vec_len*num_vecs, + ip = hypre_ParCSRCommPkgRecvProc(comm_pkg, i); + vec_start = hypre_ParCSRCommPkgRecvVecStart(comm_pkg, i); + vec_len = hypre_ParCSRCommPkgRecvVecStart(comm_pkg, i + 1) - vec_start; + hypre_MPI_Irecv(&d_recv_data[vec_start * num_vecs], vec_len * num_vecs, HYPRE_MPI_COMPLEX, ip, 0, comm, &requests[j++]); } for (i = 0; i < num_sends; i++) { vec_start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - vec_len = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1)-vec_start; - ip = hypre_ParCSRCommPkgSendProc(comm_pkg, i); - hypre_MPI_Isend(&d_send_data[vec_start*num_vecs], vec_len*num_vecs, + vec_len = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1) - vec_start; + ip = hypre_ParCSRCommPkgSendProc(comm_pkg, i); + hypre_MPI_Isend(&d_send_data[vec_start * num_vecs], vec_len * num_vecs, HYPRE_MPI_COMPLEX, ip, 0, comm, &requests[j++]); } break; @@ -83,17 +83,17 @@ hypre_ParCSRCommMultiHandleCreate (HYPRE_Int job, for (i = 0; i < num_sends; i++) { vec_start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - vec_len = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1) - vec_start; - ip = hypre_ParCSRCommPkgSendProc(comm_pkg, i); - hypre_MPI_Irecv(&d_recv_data[vec_start*num_vecs], vec_len*num_vecs, + vec_len = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1) - vec_start; + ip = hypre_ParCSRCommPkgSendProc(comm_pkg, i); + hypre_MPI_Irecv(&d_recv_data[vec_start * num_vecs], vec_len * num_vecs, HYPRE_MPI_COMPLEX, ip, 0, comm, &requests[j++]); } for (i = 0; i < num_recvs; i++) { - ip = hypre_ParCSRCommPkgRecvProc(comm_pkg, i); - vec_start = hypre_ParCSRCommPkgRecvVecStart(comm_pkg,i); - vec_len = hypre_ParCSRCommPkgRecvVecStart(comm_pkg,i+1)-vec_start; - hypre_MPI_Isend(&d_send_data[vec_start*num_vecs], vec_len*num_vecs, + ip = hypre_ParCSRCommPkgRecvProc(comm_pkg, i); + vec_start = hypre_ParCSRCommPkgRecvVecStart(comm_pkg, i); + vec_len = hypre_ParCSRCommPkgRecvVecStart(comm_pkg, i + 1) - vec_start; + hypre_MPI_Isend(&d_send_data[vec_start * num_vecs], vec_len * num_vecs, HYPRE_MPI_COMPLEX, ip, 0, comm, &requests[j++]); } break; @@ -123,7 +123,7 @@ hypre_ParCSRCommMultiHandleDestroy(hypre_ParCSRCommMultiHandle *comm_handle) if (hypre_ParCSRCommMultiHandleNumRequests(comm_handle)) { - status0 = hypre_CTAlloc(hypre_MPI_Status, + status0 = hypre_CTAlloc(hypre_MPI_Status, hypre_ParCSRCommMultiHandleNumRequests(comm_handle), HYPRE_MEMORY_HOST); hypre_MPI_Waitall(hypre_ParCSRCommMultiHandleNumRequests(comm_handle), hypre_ParCSRCommMultiHandleRequests(comm_handle), status0); diff --git a/external/hypre/src/multivector/par_csr_pmvcomm.h b/external/hypre/src/multivector/par_csr_pmvcomm.h index a3284dc0..fc8464dc 100644 --- a/external/hypre/src/multivector/par_csr_pmvcomm.h +++ b/external/hypre/src/multivector/par_csr_pmvcomm.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -21,8 +21,8 @@ extern "C" { typedef struct { hypre_ParCSRCommPkg *comm_pkg; - void *send_data; - void *recv_data; + void *send_data; + void *recv_data; HYPRE_Int num_requests; hypre_MPI_Request *requests; @@ -31,7 +31,7 @@ typedef struct /*-------------------------------------------------------------------------- * Accessor macros: hypre_ParCSRCommMultiHandle *--------------------------------------------------------------------------*/ - + #define hypre_ParCSRCommMultiHandleCommPkg(comm_handle) (comm_handle -> comm_pkg) #define hypre_ParCSRCommMultiHandleSendData(comm_handle) (comm_handle -> send_data) #define hypre_ParCSRCommMultiHandleRecvData(comm_handle) (comm_handle -> recv_data) @@ -40,11 +40,11 @@ typedef struct #define hypre_ParCSRCommMultiHandleRequest(comm_handle, i) (comm_handle -> requests[i]) hypre_ParCSRCommMultiHandle * -hypre_ParCSRCommMultiHandleCreate ( HYPRE_Int job, - hypre_ParCSRCommPkg *comm_pkg, - void *send_data, - void *recv_data, - HYPRE_Int nvecs ); +hypre_ParCSRCommMultiHandleCreate ( HYPRE_Int job, + hypre_ParCSRCommPkg *comm_pkg, + void *send_data, + void *recv_data, + HYPRE_Int nvecs ); HYPRE_Int @@ -54,4 +54,4 @@ hypre_ParCSRCommMultiHandleDestroy(hypre_ParCSRCommMultiHandle *comm_handle); } #endif -#endif /* HYPRE_PAR_CSR_MULTICOMMUNICATION_HEADER */ +#endif /* HYPRE_PAR_CSR_MULTICOMMUNICATION_HEADER */ diff --git a/external/hypre/src/multivector/par_multivector.c b/external/hypre/src/multivector/par_multivector.c index 227fa6d1..00f6d278 100644 --- a/external/hypre/src/multivector/par_multivector.c +++ b/external/hypre/src/multivector/par_multivector.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -46,11 +46,11 @@ hypre_ParMultiVectorCreate(MPI_Comm comm, HYPRE_Int global_size, HYPRE_Int *part hypre_ParMultiVectorNumVectors(vector) = num_vectors; hypre_ParMultiVectorLocalVector(vector) = - hypre_SeqMultivectorCreate((partitioning[my_id+1]-partitioning[my_id]), num_vectors); + hypre_SeqMultivectorCreate((partitioning[my_id + 1] - partitioning[my_id]), num_vectors); hypre_ParMultiVectorFirstIndex(vector) = partitioning[my_id]; - /* we set these 2 defaults exactly as in par_vector.c, although it's questionable */ + /* we set these 2 defaults exactly as in par_vector.c, although it's questionable */ hypre_ParMultiVectorOwnsData(vector) = 1; hypre_ParMultiVectorOwnsPartitioning(vector) = 1; @@ -64,13 +64,17 @@ hypre_ParMultiVectorCreate(MPI_Comm comm, HYPRE_Int global_size, HYPRE_Int *part HYPRE_Int hypre_ParMultiVectorDestroy( hypre_ParMultiVector *pm_vector ) { - if (NULL!=pm_vector) + if (NULL != pm_vector) { if ( hypre_ParMultiVectorOwnsData(pm_vector) ) + { hypre_SeqMultivectorDestroy(hypre_ParMultiVectorLocalVector(pm_vector)); + } if ( hypre_ParMultiVectorOwnsPartitioning(pm_vector) ) + { hypre_TFree(hypre_ParMultiVectorPartitioning(pm_vector), HYPRE_MEMORY_HOST); + } hypre_TFree(pm_vector, HYPRE_MEMORY_HOST); } @@ -87,7 +91,7 @@ hypre_ParMultiVectorInitialize( hypre_ParMultiVector *pm_vector ) HYPRE_Int ierr; ierr = hypre_SeqMultivectorInitialize( - hypre_ParMultiVectorLocalVector(pm_vector)); + hypre_ParMultiVectorLocalVector(pm_vector)); return ierr; } @@ -100,7 +104,7 @@ HYPRE_Int hypre_ParMultiVectorSetDataOwner( hypre_ParMultiVector *pm_vector, HYPRE_Int owns_data ) { - HYPRE_Int ierr=0; + HYPRE_Int ierr = 0; hypre_ParMultiVectorOwnsData(pm_vector) = owns_data; @@ -128,7 +132,7 @@ hypre_ParMultiVectorSetConstantValues( hypre_ParMultiVector *v, { hypre_Multivector *v_local = hypre_ParMultiVectorLocalVector(v); - return hypre_SeqMultivectorSetConstantValues(v_local,value); + return hypre_SeqMultivectorSetConstantValues(v_local, value); } /*-------------------------------------------------------------------------- @@ -141,12 +145,12 @@ hypre_ParMultiVectorSetRandomValues( hypre_ParMultiVector *v, HYPRE_Int seed) HYPRE_Int my_id; hypre_Multivector *v_local = hypre_ParMultiVectorLocalVector(v); - MPI_Comm comm = hypre_ParMultiVectorComm(v); - hypre_MPI_Comm_rank(comm,&my_id); + MPI_Comm comm = hypre_ParMultiVectorComm(v); + hypre_MPI_Comm_rank(comm, &my_id); - seed *= (my_id+1); + seed *= (my_id + 1); - return hypre_SeqMultivectorSetRandomValues(v_local,seed); + return hypre_SeqMultivectorSetRandomValues(v_local, seed); } /*-------------------------------------------------------------------------- @@ -216,7 +220,7 @@ hypre_ParMultiVectorByDiag(hypre_ParMultiVector *x, HYPRE_Int *mask, HYPRE_Int n HYPRE_Complex *alpha, hypre_ParMultiVector *y) { return hypre_SeqMultivectorByDiag(x->local_vector, mask, n, alpha, - y->local_vector); + y->local_vector); } /*-------------------------------------------------------------------------- @@ -230,10 +234,10 @@ hypre_ParMultiVectorInnerProd(hypre_ParMultiVector *x, hypre_ParMultiVector *y, MPI_Comm comm; HYPRE_Int count; HYPRE_Int ierr; -/* - * HYPRE_Int myid; - * HYPRE_Int i - */ + /* + * HYPRE_Int myid; + * HYPRE_Int i + */ /* assuming "results" and "workspace" are arrays of size ("n_active_x" by "n_active_y") n_active_x is the number of active vectors in multivector x @@ -250,16 +254,16 @@ hypre_ParMultiVectorInnerProd(hypre_ParMultiVector *x, hypre_ParMultiVector *y, hypre_MPI_SUM, comm); hypre_assert (ierr == hypre_MPI_SUCCESS); -/* debug */ + /* debug */ -/* - * hypre_MPI_Comm_rank(comm, &myid); - * if (myid==0) - * for (i=0; ilocal_vector, rGHeight, rHeight, - rWidth, rVal, y->local_vector); + rWidth, rVal, y->local_vector); } HYPRE_Int -hypre_ParMultiVectorXapy(hypre_ParMultiVector *x, HYPRE_Int rGHeight, HYPRE_Int rHeight, +hypre_ParMultiVectorXapy(hypre_ParMultiVector *x, HYPRE_BigInt rGHeight, HYPRE_Int rHeight, HYPRE_Int rWidth, HYPRE_Complex* rVal, hypre_ParMultiVector * y) { return hypre_SeqMultivectorXapy(x->local_vector, rGHeight, rHeight, - rWidth, rVal, y->local_vector); + rWidth, rVal, y->local_vector); } /* temporary function; allows to do "matvec" and preconditioner in vector-by-vector fashion */ HYPRE_Int hypre_ParMultiVectorEval(void (*f)( void*, void*, void* ), void* par, - hypre_ParMultiVector * x, hypre_ParMultiVector * y) + hypre_ParMultiVector * x, hypre_ParMultiVector * y) { hypre_ParVector *temp_x, *temp_y; HYPRE_Int i; @@ -317,19 +321,19 @@ hypre_ParMultiVectorEval(void (*f)( void*, void*, void* ), void* par, hypre_assert(x->local_vector->num_active_vectors == y->local_vector->num_active_vectors); hypre_assert(x->local_vector->size == y->local_vector->size); - temp_x=hypre_ParVectorCreate(x->comm,x->global_size, x->partitioning); - hypre_assert(temp_x!=NULL); - temp_x->local_vector->owns_data=0; + temp_x = hypre_ParVectorCreate(x->comm, x->global_size, x->partitioning); + hypre_assert(temp_x != NULL); + temp_x->local_vector->owns_data = 0; temp_x->local_vector->vecstride = temp_x->local_vector->size; temp_x->local_vector->idxstride = 1; -/* no initialization for temp_x needed! */ + /* no initialization for temp_x needed! */ - temp_y=hypre_ParVectorCreate(y->comm,y->global_size, y->partitioning); - hypre_assert(temp_y!=NULL); - temp_y->local_vector->owns_data=0; + temp_y = hypre_ParVectorCreate(y->comm, y->global_size, y->partitioning); + hypre_assert(temp_y != NULL); + temp_y->local_vector->owns_data = 0; temp_y->local_vector->vecstride = temp_y->local_vector->size; temp_y->local_vector->idxstride = 1; -/* no initialization for temp_y needed! */ + /* no initialization for temp_y needed! */ num_active_vectors = x->local_vector->num_active_vectors; x_active_indices = x->local_vector->active_indices; @@ -338,10 +342,10 @@ hypre_ParMultiVectorEval(void (*f)( void*, void*, void* ), void* par, y_data = y->local_vector->data; size = x->local_vector->size; - for ( i=0; ilocal_vector->data = x_data + x_active_indices[i]*size; - temp_y->local_vector->data = y_data + y_active_indices[i]*size; + temp_x->local_vector->data = x_data + x_active_indices[i] * size; + temp_y->local_vector->data = y_data + y_active_indices[i] * size; /*** here i make an assumption that "f" will treat temp_x and temp_y like "hypre_ParVector *" variables ***/ @@ -358,7 +362,7 @@ hypre_ParMultiVectorEval(void (*f)( void*, void*, void* ), void* par, hypre_ParMultiVector * hypre_ParMultiVectorTempRead(MPI_Comm comm, const char *fileName) - /* ***** temporary implementation ****** */ +/* ***** temporary implementation ****** */ { HYPRE_Int i, n, id; HYPRE_Complex * dest; @@ -372,48 +376,54 @@ hypre_ParMultiVectorTempRead(MPI_Comm comm, const char *fileName) /* calculate the number of files */ hypre_MPI_Comm_rank( comm, &id ); n = 0; - do { - hypre_sprintf( temp_string, "test -f %s.%d.%d", fileName, n, id ); - if (!(retcode=system(temp_string))) /* zero retcode mean file exists */ - n++; - } while (!retcode); + do + { + hypre_sprintf( temp_string, "test -f %s.%d.%d", fileName, n, id ); + if (!(retcode = system(temp_string))) /* zero retcode mean file exists */ + { + n++; + } + } + while (!retcode); - if ( n == 0 ) return NULL; + if ( n == 0 ) { return NULL; } /* now read the first vector using hypre_ParVectorRead into temp_vec */ - hypre_sprintf(temp_string,"%s.%d",fileName,0); + hypre_sprintf(temp_string, "%s.%d", fileName, 0); temp_vec = hypre_ParVectorRead(comm, temp_string); /* now create multivector using temp_vec as a sample */ x = hypre_ParMultiVectorCreate(hypre_ParVectorComm(temp_vec), - hypre_ParVectorGlobalSize(temp_vec),hypre_ParVectorPartitioning(temp_vec),n); + hypre_ParVectorGlobalSize(temp_vec), hypre_ParVectorPartitioning(temp_vec), n); hypre_ParMultiVectorInitialize(x); /* read data from first and all other vectors into "x" */ i = 0; - do { - /* copy data from current vector */ - dest = x->local_vector->data + i*(x->local_vector->size); + do + { + /* copy data from current vector */ + dest = x->local_vector->data + i * (x->local_vector->size); src = temp_vec->local_vector->data; count = temp_vec->local_vector->size; hypre_TMemcpy(dest, src, HYPRE_Complex, count, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); - /* destroy current vector */ + /* destroy current vector */ hypre_ParVectorDestroy(temp_vec); - /* read the data to new current vector, if there are more vectors to read */ - if (icomm,vector->global_size, vector->partitioning); - hypre_assert(temp_vec!=NULL); - temp_vec->local_vector->owns_data=0; + temp_vec = hypre_ParVectorCreate(vector->comm, vector->global_size, vector->partitioning); + hypre_assert(temp_vec != NULL); + temp_vec->local_vector->owns_data = 0; /* no initialization for temp_vec needed! */ ierr = 0; for ( i = 0; i < vector->local_vector->num_vectors; i++ ) { - hypre_sprintf( fullName, "%s.%d", fileName, i ); + hypre_sprintf( fullName, "%s.%d", fileName, i ); - temp_vec->local_vector->data=vector->local_vector->data + i * + temp_vec->local_vector->data = vector->local_vector->data + i * vector->local_vector->size; - ierr = ierr || hypre_ParVectorPrint(temp_vec, fullName); + ierr = ierr || hypre_ParVectorPrint(temp_vec, fullName); } ierr = ierr || hypre_ParVectorDestroy(temp_vec); diff --git a/external/hypre/src/multivector/par_multivector.h b/external/hypre/src/multivector/par_multivector.h index fcaecf52..358c01ea 100644 --- a/external/hypre/src/multivector/par_multivector.h +++ b/external/hypre/src/multivector/par_multivector.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -26,20 +26,20 @@ extern "C" { typedef struct { - MPI_Comm comm; + MPI_Comm comm; HYPRE_Int global_size; HYPRE_Int first_index; - HYPRE_Int *partitioning; - HYPRE_Int owns_data; - HYPRE_Int num_vectors; + HYPRE_Int *partitioning; + HYPRE_Int owns_data; + HYPRE_Int num_vectors; hypre_Multivector *local_vector; -/* using mask on "parallel" level seems to be inconvenient, so i (IL) moved it to - "sequential" level. Also i now store it as a number of active indices and an array of - active indices. hypre_ParMultiVectorSetMask converts user-provided "(1,1,0,1,...)" mask - to the format above. - HYPRE_Int *mask; -*/ + /* using mask on "parallel" level seems to be inconvenient, so i (IL) moved it to + "sequential" level. Also i now store it as a number of active indices and an array of + active indices. hypre_ParMultiVectorSetMask converts user-provided "(1,1,0,1,...)" mask + to the format above. + HYPRE_Int *mask; + */ } hypre_ParMultivector; @@ -73,30 +73,30 @@ HYPRE_Int hypre_ParMultiVectorCopy(hypre_ParMultiVector *, hypre_ParMultiVector HYPRE_Int hypre_ParMultiVectorScale(HYPRE_Complex, hypre_ParMultiVector *); HYPRE_Int hypre_ParMultiVectorMultiScale(HYPRE_Complex *, hypre_ParMultiVector *); HYPRE_Int hypre_ParMultiVectorAxpy(HYPRE_Complex, hypre_ParMultiVector *, - hypre_ParMultiVector *); + hypre_ParMultiVector *); HYPRE_Int hypre_ParMultiVectorByDiag( hypre_ParMultiVector *x, - HYPRE_Int *mask, - HYPRE_Int n, - HYPRE_Complex *alpha, - hypre_ParMultiVector *y); + HYPRE_Int *mask, + HYPRE_Int n, + HYPRE_Complex *alpha, + hypre_ParMultiVector *y); HYPRE_Int hypre_ParMultiVectorInnerProd(hypre_ParMultiVector *, - hypre_ParMultiVector *, HYPRE_Real *, HYPRE_Real *); + hypre_ParMultiVector *, HYPRE_Real *, HYPRE_Real *); HYPRE_Int hypre_ParMultiVectorInnerProdDiag(hypre_ParMultiVector *, - hypre_ParMultiVector *, HYPRE_Real *, HYPRE_Real *); + hypre_ParMultiVector *, HYPRE_Real *, HYPRE_Real *); HYPRE_Int hypre_ParMultiVectorCopyWithoutMask(hypre_ParMultiVector *x, hypre_ParMultiVector *y); HYPRE_Int -hypre_ParMultiVectorByMatrix(hypre_ParMultiVector *x, HYPRE_Int rGHeight, HYPRE_Int rHeight, - HYPRE_Int rWidth, HYPRE_Complex* rVal, hypre_ParMultiVector * y); +hypre_ParMultiVectorByMatrix(hypre_ParMultiVector *x, HYPRE_BigInt rGHeight, HYPRE_Int rHeight, + HYPRE_Int rWidth, HYPRE_Complex* rVal, hypre_ParMultiVector * y); HYPRE_Int -hypre_ParMultiVectorXapy(hypre_ParMultiVector *x, HYPRE_Int rGHeight, HYPRE_Int rHeight, - HYPRE_Int rWidth, HYPRE_Complex* rVal, hypre_ParMultiVector * y); +hypre_ParMultiVectorXapy(hypre_ParMultiVector *x, HYPRE_BigInt rGHeight, HYPRE_Int rHeight, + HYPRE_Int rWidth, HYPRE_Complex* rVal, hypre_ParMultiVector * y); HYPRE_Int hypre_ParMultiVectorEval(void (*f)( void*, void*, void* ), void* par, - hypre_ParMultiVector * x, hypre_ParMultiVector * y); + hypre_ParMultiVector * x, hypre_ParMultiVector * y); /* to be replaced by better implementation when format for multivector files established */ hypre_ParMultiVector * hypre_ParMultiVectorTempRead(MPI_Comm comm, const char *file_name); diff --git a/external/hypre/src/multivector/seq_multivector.c b/external/hypre/src/multivector/seq_multivector.c index 9525a020..970af418 100644 --- a/external/hypre/src/multivector/seq_multivector.c +++ b/external/hypre/src/multivector/seq_multivector.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -26,7 +26,7 @@ hypre_SeqMultivectorCreate( HYPRE_Int size, HYPRE_Int num_vectors ) { hypre_Multivector *mvector; - mvector = (hypre_Multivector *) hypre_MAlloc(sizeof(hypre_Multivector), HYPRE_MEMORY_HOST); + mvector = hypre_TAlloc(hypre_Multivector, 1, HYPRE_MEMORY_HOST); hypre_MultivectorNumVectors(mvector) = num_vectors; hypre_MultivectorSize(mvector) = size; @@ -34,8 +34,8 @@ hypre_SeqMultivectorCreate( HYPRE_Int size, HYPRE_Int num_vectors ) hypre_MultivectorOwnsData(mvector) = 1; hypre_MultivectorData(mvector) = NULL; - mvector->num_active_vectors=0; - mvector->active_indices=NULL; + mvector->num_active_vectors = 0; + mvector->active_indices = NULL; return mvector; } @@ -52,17 +52,17 @@ hypre_SeqMultivectorInitialize( hypre_Multivector *mvector ) size = hypre_MultivectorSize(mvector); num_vectors = hypre_MultivectorNumVectors(mvector); - if (NULL==hypre_MultivectorData(mvector)) + if (NULL == hypre_MultivectorData(mvector)) hypre_MultivectorData(mvector) = - (HYPRE_Complex *) hypre_MAlloc(sizeof(HYPRE_Complex)*size*num_vectors, HYPRE_MEMORY_HOST); + hypre_TAlloc(HYPRE_Complex, size * num_vectors, HYPRE_MEMORY_HOST); /* now we create a "mask" of "active" vectors; initially all active */ - if (NULL==mvector->active_indices) + if (NULL == mvector->active_indices) { - mvector->active_indices hypre_CTAlloc(HYPRE_Int, num_vectors, HYPRE_MEMORY_HOST); + mvector->active_indices hypre_CTAlloc(HYPRE_Int, num_vectors, HYPRE_MEMORY_HOST); - for (i=0; iactive_indices[i] = i; - mvector->num_active_vectors=num_vectors; + for (i = 0; i < num_vectors; i++) { mvector->active_indices[i] = i; } + mvector->num_active_vectors = num_vectors; } return ierr; } @@ -74,7 +74,7 @@ hypre_SeqMultivectorInitialize( hypre_Multivector *mvector ) HYPRE_Int hypre_SeqMultivectorSetDataOwner(hypre_Multivector *mvector, HYPRE_Int owns_data) { - HYPRE_Int ierr=0; + HYPRE_Int ierr = 0; hypre_MultivectorOwnsData(mvector) = owns_data; @@ -89,15 +89,19 @@ hypre_SeqMultivectorSetDataOwner(hypre_Multivector *mvector, HYPRE_Int owns_data HYPRE_Int hypre_SeqMultivectorDestroy(hypre_Multivector *mvector) { - HYPRE_Int ierr=0; + HYPRE_Int ierr = 0; - if (NULL!=mvector) + if (NULL != mvector) { - if (hypre_MultivectorOwnsData(mvector) && NULL!=hypre_MultivectorData(mvector)) - hypre_TFree( hypre_MultivectorData(mvector) , HYPRE_MEMORY_HOST); + if (hypre_MultivectorOwnsData(mvector) && NULL != hypre_MultivectorData(mvector)) + { + hypre_TFree( hypre_MultivectorData(mvector), HYPRE_MEMORY_HOST); + } - if (NULL!=mvector->active_indices) - hypre_TFree(mvector->active_indices, HYPRE_MEMORY_HOST); + if (NULL != mvector->active_indices) + { + hypre_TFree(mvector->active_indices, HYPRE_MEMORY_HOST); + } hypre_TFree(mvector, HYPRE_MEMORY_HOST); } @@ -115,23 +119,27 @@ hypre_SeqMultivectorSetMask(hypre_Multivector *mvector, HYPRE_Int * mask) { HYPRE_Int i, num_vectors = mvector->num_vectors; - if (mvector->active_indices != NULL) hypre_TFree(mvector->active_indices, HYPRE_MEMORY_HOST); - mvector->active_indices hypre_CTAlloc(HYPRE_Int, num_vectors, HYPRE_MEMORY_HOST); + if (mvector->active_indices != NULL) { hypre_TFree(mvector->active_indices, HYPRE_MEMORY_HOST); } + mvector->active_indices hypre_CTAlloc(HYPRE_Int, num_vectors, HYPRE_MEMORY_HOST); - mvector->num_active_vectors=0; + mvector->num_active_vectors = 0; - if (mask!=NULL) - for (i=0; iactive_indices[mvector->num_active_vectors++]=i; + { + mvector->active_indices[mvector->num_active_vectors++] = i; + } } else - for (i=0; iactive_indices[mvector->num_active_vectors++]=i; + for (i = 0; i < num_vectors; i++) + { + mvector->active_indices[mvector->num_active_vectors++] = i; + } return 0; - } +} /*-------------------------------------------------------------------------- * hypre_SeqMultivectorSetConstantValues @@ -147,21 +155,21 @@ hypre_SeqMultivectorSetConstantValues(hypre_Multivector *v, HYPRE_Complex value) if (v->num_active_vectors == v->num_vectors) { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(j) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(j) HYPRE_SMP_SCHEDULE #endif - for (j = 0; j < v->num_vectors*size; j++) vector_data[j] = value; + for (j = 0; j < v->num_vectors * size; j++) { vector_data[j] = value; } } else { for (i = 0; i < v->num_active_vectors; i++) { - start_offset = v->active_indices[i]*size; - end_offset = start_offset+size; + start_offset = v->active_indices[i] * size; + end_offset = start_offset + size; #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(j) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(j) HYPRE_SMP_SCHEDULE #endif - for (j = start_offset; j < end_offset; j++) vector_data[j]= value; + for (j = start_offset; j < end_offset; j++) { vector_data[j] = value; } } } return 0; @@ -187,17 +195,21 @@ hypre_SeqMultivectorSetRandomValues(hypre_Multivector *v, HYPRE_Int seed) if (v->num_active_vectors == v->num_vectors) { - for (j = 0; j < v->num_vectors*size; j++) + for (j = 0; j < v->num_vectors * size; j++) + { vector_data[j] = 2.0 * hypre_Rand() - 1.0; + } } else { for (i = 0; i < v->num_active_vectors; i++) { - start_offset = v->active_indices[i]*size; - end_offset = start_offset+size; + start_offset = v->active_indices[i] * size; + end_offset = start_offset + size; for (j = start_offset; j < end_offset; j++) - vector_data[j]= 2.0 * hypre_Rand() - 1.0; + { + vector_data[j] = 2.0 * hypre_Rand() - 1.0; + } } } return 0; @@ -221,8 +233,8 @@ hypre_SeqMultivectorCopy(hypre_Multivector *x, hypre_Multivector *y) size = x->size; x_data = x->data; y_data = y->data; - x_active_ind=x->active_indices; - y_active_ind=y->active_indices; + x_active_ind = x->active_indices; + y_active_ind = y->active_indices; if (x->num_active_vectors == x->num_vectors && y->num_active_vectors == y->num_vectors) @@ -233,25 +245,25 @@ hypre_SeqMultivectorCopy(hypre_Multivector *x, hypre_Multivector *y) else { num_bytes = size; - for (i=0; i < num_active_vectors; i++) + for (i = 0; i < num_active_vectors; i++) { - src=x_data + size * x_active_ind[i]; + src = x_data + size * x_active_ind[i]; dest = y_data + size * y_active_ind[i]; - hypre_Memcpy(dest, src, HYPRE_Complex, num_bytes, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + hypre_TMemcpy(dest, src, HYPRE_Complex, num_bytes, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); } } return 0; } HYPRE_Int -hypre_SeqMultivectorCopyWithoutMask(hypre_Multivector *x , +hypre_SeqMultivectorCopyWithoutMask(hypre_Multivector *x, hypre_Multivector *y) { HYPRE_Int byte_count; hypre_assert (x->size == y->size && x->num_vectors == y->num_vectors); byte_count = x->size * x->num_vectors; - hypre_Memcpy(y->data, x->data, HYPRE_Complex, byte_count, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + hypre_TMemcpy(y->data, x->data, HYPRE_Complex, byte_count, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); return 0; } @@ -278,20 +290,20 @@ hypre_SeqMultivectorAxpy(HYPRE_Complex alpha, hypre_Multivector *x, if (x->num_active_vectors == x->num_vectors && y->num_active_vectors == y->num_vectors) { - for(i = 0; i < x->num_vectors*size; i++) dest[i] += alpha * src[i]; + for (i = 0; i < x->num_vectors * size; i++) { dest[i] += alpha * src[i]; } } else { - for(i = 0; i < num_active_vectors; i++) + for (i = 0; i < num_active_vectors; i++) { - src = x_data + x_active_ind[i]*size; - dest = y_data + y_active_ind[i]*size; + src = x_data + x_active_ind[i] * size; + dest = y_data + y_active_ind[i] * size; #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(j) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(j) HYPRE_SMP_SCHEDULE #endif - for (j = 0; j < size; j++) dest[j] += alpha * src[j]; + for (j = 0; j < size; j++) { dest[j] += alpha * src[j]; } } } return 0; @@ -316,17 +328,21 @@ hypre_SeqMultivectorByDiag(hypre_Multivector *x, HYPRE_Int *mask, HYPRE_Int n, al_active_ind = hypre_TAlloc(HYPRE_Int, n, HYPRE_MEMORY_HOST); num_active_als = 0; - if (mask!=NULL) - for (i=0; inum_active_vectors); + hypre_assert (num_active_als == x->num_active_vectors); x_data = x->data; y_data = y->data; @@ -335,18 +351,20 @@ hypre_SeqMultivectorByDiag(hypre_Multivector *x, HYPRE_Int *mask, HYPRE_Int n, x_active_ind = x->active_indices; y_active_ind = y->active_indices; - for(i = 0; i < num_active_vectors; i++) + for (i = 0; i < num_active_vectors; i++) { - src = x_data + x_active_ind[i]*size; - dest = y_data + y_active_ind[i]*size; - current_alpha=alpha[ al_active_ind[i] ]; + src = x_data + x_active_ind[i] * size; + dest = y_data + y_active_ind[i] * size; + current_alpha = alpha[ al_active_ind[i] ]; #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(j) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(j) HYPRE_SMP_SCHEDULE #endif for (j = 0; j < size; j++) - dest[j] = current_alpha*src[j]; + { + dest[j] = current_alpha * src[j]; + } } hypre_TFree(al_active_ind, HYPRE_MEMORY_HOST); @@ -358,14 +376,14 @@ hypre_SeqMultivectorByDiag(hypre_Multivector *x, HYPRE_Int *mask, HYPRE_Int n, *--------------------------------------------------------------------------*/ HYPRE_Int hypre_SeqMultivectorInnerProd(hypre_Multivector *x, hypre_Multivector *y, - HYPRE_Real *results ) + HYPRE_Real *results ) { HYPRE_Int i, j, k, size, *x_active_ind, *y_active_ind; HYPRE_Int x_num_active_vectors, y_num_active_vectors; HYPRE_Complex *x_data, *y_data, *y_ptr, *x_ptr; HYPRE_Real current_product; - hypre_assert (x->size==y->size); + hypre_assert (x->size == y->size); x_data = x->data; y_data = y->data; @@ -373,27 +391,29 @@ HYPRE_Int hypre_SeqMultivectorInnerProd(hypre_Multivector *x, hypre_Multivector x_num_active_vectors = x->num_active_vectors; y_num_active_vectors = y->num_active_vectors; -/* we assume that "results" points to contiguous array of (x_num_active_vectors X - y_num_active_vectors) doubles */ + /* we assume that "results" points to contiguous array of (x_num_active_vectors X + y_num_active_vectors) doubles */ x_active_ind = x->active_indices; y_active_ind = y->active_indices; - for(j = 0; j < y_num_active_vectors; j++) + for (j = 0; j < y_num_active_vectors; j++) { - y_ptr = y_data + y_active_ind[j]*size; + y_ptr = y_data + y_active_ind[j] * size; for (i = 0; i < x_num_active_vectors; i++) { - x_ptr = x_data + x_active_ind[i]*size; + x_ptr = x_data + x_active_ind[i] * size; current_product = 0.0; #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(k) reduction(+:current_product) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(k) reduction(+:current_product) HYPRE_SMP_SCHEDULE #endif - for(k = 0; k < size; k++) + for (k = 0; k < size; k++) + { current_product += x_ptr[k] * hypre_conj(y_ptr[k]); + } /* column-wise storage for results */ *results++ = current_product; @@ -409,13 +429,13 @@ HYPRE_Int hypre_SeqMultivectorInnerProd(hypre_Multivector *x, hypre_Multivector *--------------------------------------------------------------------------*/ HYPRE_Int hypre_SeqMultivectorInnerProdDiag(hypre_Multivector *x, - hypre_Multivector *y, HYPRE_Real *diagResults) + hypre_Multivector *y, HYPRE_Real *diagResults) { HYPRE_Complex *x_data, *y_data, *y_ptr, *x_ptr; HYPRE_Real current_product; HYPRE_Int i, k, size, num_active_vectors, *x_active_ind, *y_active_ind; - hypre_assert(x->size==y->size && x->num_active_vectors == y->num_active_vectors); + hypre_assert(x->size == y->size && x->num_active_vectors == y->num_active_vectors); x_data = x->data; y_data = y->data; @@ -424,18 +444,20 @@ HYPRE_Int hypre_SeqMultivectorInnerProdDiag(hypre_Multivector *x, x_active_ind = x->active_indices; y_active_ind = y->active_indices; - for (i=0; i0); - hypre_assert (rHeight==x->num_active_vectors && rWidth==y->num_active_vectors); + hypre_assert(rHeight > 0); + hypre_assert(rHeight == x->num_active_vectors && rWidth == y->num_active_vectors); x_data = x->data; y_data = y->data; size = x->size; x_active_ind = x->active_indices; y_active_ind = y->active_indices; - gap = rGHeight - rHeight; + gap = rGHeight - (HYPRE_BigInt) rHeight; - for (j=0; jnum_active_vectors && rWidth==y->num_active_vectors); + hypre_assert(rHeight == x->num_active_vectors && rWidth == y->num_active_vectors); x_data = x->data; y_data = y->data; size = x->size; x_active_ind = x->active_indices; y_active_ind = y->active_indices; - gap = rGHeight - rHeight; + gap = rGHeight - (HYPRE_BigInt) rHeight; - for (j=0; jnumVectors; ix++ ) - if ( mask[ix] ) - px[jx++] = x->vector[ix]; - } - else - for ( ix = 0; ix < x->numVectors; ix++ ) - px[ix] = x->vector[ix]; +mv_collectVectorPtr( HYPRE_Int* mask, mv_TempMultiVector* x, void** px ) +{ + + HYPRE_Int ix, jx; + + if ( mask != NULL ) + { + for ( ix = 0, jx = 0; ix < x->numVectors; ix++ ) + if ( mask[ix] ) + { + px[jx++] = x->vector[ix]; + } + } + else + for ( ix = 0; ix < x->numVectors; ix++ ) + { + px[ix] = x->vector[ix]; + } } static HYPRE_Int -aux_maskCount( HYPRE_Int n, HYPRE_Int* mask ) { +aux_maskCount( HYPRE_Int n, HYPRE_Int* mask ) +{ - HYPRE_Int i, m; + HYPRE_Int i, m; - if ( mask == NULL ) - return n; + if ( mask == NULL ) + { + return n; + } - for ( i = m = 0; i < n; i++ ) - if ( mask[i] ) - m++; + for ( i = m = 0; i < n; i++ ) + if ( mask[i] ) + { + m++; + } - return m; + return m; } static void -aux_indexFromMask( HYPRE_Int n, HYPRE_Int* mask, HYPRE_Int* index ) { - - HYPRE_Int i, j; - - if ( mask != NULL ) { - for ( i = 0, j = 0; i < n; i++ ) - if ( mask[i] ) - index[j++] = i + 1; - } - else - for ( i = 0; i < n; i++ ) - index[i] = i + 1; +aux_indexFromMask( HYPRE_Int n, HYPRE_Int* mask, HYPRE_Int* index ) +{ + + HYPRE_Int i, j; + + if ( mask != NULL ) + { + for ( i = 0, j = 0; i < n; i++ ) + if ( mask[i] ) + { + index[j++] = i + 1; + } + } + else + for ( i = 0; i < n; i++ ) + { + index[i] = i + 1; + } } @@ -64,464 +81,524 @@ aux_indexFromMask( HYPRE_Int n, HYPRE_Int* mask, HYPRE_Int* index ) { static hypre_ulongint next = 1; /* RAND_MAX assumed to be 32767 */ -static HYPRE_Int myrand(void) { +static HYPRE_Int myrand(void) +{ next = next * 1103515245 + 12345; - return((unsigned)(next/65536) % 32768); + return ((unsigned)(next / 65536) % 32768); } -static void mysrand(unsigned seed) { +static void mysrand(unsigned seed) +{ next = seed; } void* -mv_TempMultiVectorCreateFromSampleVector( void* ii_, HYPRE_Int n, void* sample ) { +mv_TempMultiVectorCreateFromSampleVector( void* ii_, HYPRE_Int n, void* sample ) +{ - HYPRE_Int i; - mv_TempMultiVector* x; - mv_InterfaceInterpreter* ii = (mv_InterfaceInterpreter*)ii_; + HYPRE_Int i; + mv_TempMultiVector* x; + mv_InterfaceInterpreter* ii = (mv_InterfaceInterpreter*)ii_; - x = hypre_TAlloc(mv_TempMultiVector, 1, HYPRE_MEMORY_HOST); - hypre_assert( x != NULL ); + x = hypre_TAlloc(mv_TempMultiVector, 1, HYPRE_MEMORY_HOST); + hypre_assert( x != NULL ); - x->interpreter = ii; - x->numVectors = n; + x->interpreter = ii; + x->numVectors = n; - x->vector = hypre_CTAlloc(void*, n, HYPRE_MEMORY_HOST); - hypre_assert( x->vector != NULL ); + x->vector = hypre_CTAlloc(void*, n, HYPRE_MEMORY_HOST); + hypre_assert( x->vector != NULL ); - x->ownsVectors = 1; - x->mask = NULL; - x->ownsMask = 0; + x->ownsVectors = 1; + x->mask = NULL; + x->ownsMask = 0; - for ( i = 0; i < n; i++ ) - x->vector[i] = (ii->CreateVector)(sample); + for ( i = 0; i < n; i++ ) + { + x->vector[i] = (ii->CreateVector)(sample); + } - return x; + return x; } void* -mv_TempMultiVectorCreateCopy( void* src_, HYPRE_Int copyValues ) { +mv_TempMultiVectorCreateCopy( void* src_, HYPRE_Int copyValues ) +{ - HYPRE_Int i, n; + HYPRE_Int i, n; - mv_TempMultiVector* src; - mv_TempMultiVector* dest; + mv_TempMultiVector* src; + mv_TempMultiVector* dest; - src = (mv_TempMultiVector*)src_; - hypre_assert( src != NULL ); + src = (mv_TempMultiVector*)src_; + hypre_assert( src != NULL ); - n = src->numVectors; + n = src->numVectors; - dest = (mv_TempMultiVector*)mv_TempMultiVectorCreateFromSampleVector( src->interpreter, - n, src->vector[0] ); - if ( copyValues ) - for ( i = 0; i < n; i++ ) { - (dest->interpreter->CopyVector)(src->vector[i],dest->vector[i]); - } + dest = (mv_TempMultiVector*)mv_TempMultiVectorCreateFromSampleVector( src->interpreter, + n, src->vector[0] ); + if ( copyValues ) + for ( i = 0; i < n; i++ ) + { + (dest->interpreter->CopyVector)(src->vector[i], dest->vector[i]); + } - return dest; + return dest; } void -mv_TempMultiVectorDestroy( void* x_ ) { - - HYPRE_Int i; - mv_TempMultiVector* x = (mv_TempMultiVector*)x_; - - if ( x == NULL ) - return; - - if ( x->ownsVectors && x->vector != NULL ) { - for ( i = 0; i < x->numVectors; i++ ) - (x->interpreter->DestroyVector)(x->vector[i]); - hypre_TFree(x->vector,HYPRE_MEMORY_HOST); - } - if ( x->mask && x->ownsMask ) - hypre_TFree(x->mask,HYPRE_MEMORY_HOST); - hypre_TFree(x,HYPRE_MEMORY_HOST); +mv_TempMultiVectorDestroy( void* x_ ) +{ + + HYPRE_Int i; + mv_TempMultiVector* x = (mv_TempMultiVector*)x_; + + if ( x == NULL ) + { + return; + } + + if ( x->ownsVectors && x->vector != NULL ) + { + for ( i = 0; i < x->numVectors; i++ ) + { + (x->interpreter->DestroyVector)(x->vector[i]); + } + hypre_TFree(x->vector, HYPRE_MEMORY_HOST); + } + if ( x->mask && x->ownsMask ) + { + hypre_TFree(x->mask, HYPRE_MEMORY_HOST); + } + hypre_TFree(x, HYPRE_MEMORY_HOST); } HYPRE_Int -mv_TempMultiVectorWidth( void* x_ ) { +mv_TempMultiVectorWidth( void* x_ ) +{ - mv_TempMultiVector* x = (mv_TempMultiVector*)x_; + mv_TempMultiVector* x = (mv_TempMultiVector*)x_; - if ( x == NULL ) - return 0; + if ( x == NULL ) + { + return 0; + } - return x->numVectors; + return x->numVectors; } HYPRE_Int -mv_TempMultiVectorHeight( void* x_ ) { +mv_TempMultiVectorHeight( void* x_ ) +{ - mv_TempMultiVector* x = (mv_TempMultiVector*)x_; + mv_TempMultiVector* x = (mv_TempMultiVector*)x_; - if ( x == NULL ) - return 0; + if ( x == NULL ) + { + return 0; + } - return (x->interpreter->VectorSize)(x->vector[0]); + return (x->interpreter->VectorSize)(x->vector[0]); } /* this shallow copy of the mask is convenient but not safe; a proper copy should be considered */ void -mv_TempMultiVectorSetMask( void* x_, HYPRE_Int* mask ) { +mv_TempMultiVectorSetMask( void* x_, HYPRE_Int* mask ) +{ - mv_TempMultiVector* x = (mv_TempMultiVector*)x_; + mv_TempMultiVector* x = (mv_TempMultiVector*)x_; - hypre_assert( x != NULL ); - x->mask = mask; - x->ownsMask = 0; + hypre_assert( x != NULL ); + x->mask = mask; + x->ownsMask = 0; } void -mv_TempMultiVectorClear( void* x_ ) { +mv_TempMultiVectorClear( void* x_ ) +{ - HYPRE_Int i; - mv_TempMultiVector* x = (mv_TempMultiVector*)x_; + HYPRE_Int i; + mv_TempMultiVector* x = (mv_TempMultiVector*)x_; - hypre_assert( x != NULL ); + hypre_assert( x != NULL ); - for ( i = 0; i < x->numVectors; i++ ) - if ( x->mask == NULL || (x->mask)[i] ) - (x->interpreter->ClearVector)(x->vector[i]); + for ( i = 0; i < x->numVectors; i++ ) + if ( x->mask == NULL || (x->mask)[i] ) + { + (x->interpreter->ClearVector)(x->vector[i]); + } } void -mv_TempMultiVectorSetRandom( void* x_, HYPRE_Int seed ) { +mv_TempMultiVectorSetRandom( void* x_, HYPRE_Int seed ) +{ - HYPRE_Int i; - mv_TempMultiVector* x = (mv_TempMultiVector*)x_; + HYPRE_Int i; + mv_TempMultiVector* x = (mv_TempMultiVector*)x_; - hypre_assert( x != NULL ); + hypre_assert( x != NULL ); - mysrand(seed); + mysrand(seed); - for ( i = 0; i < x->numVectors; i++ ) { - if ( x->mask == NULL || (x->mask)[i] ) { - seed=myrand(); - (x->interpreter->SetRandomValues)(x->vector[i], seed); - } - } + for ( i = 0; i < x->numVectors; i++ ) + { + if ( x->mask == NULL || (x->mask)[i] ) + { + seed = myrand(); + (x->interpreter->SetRandomValues)(x->vector[i], seed); + } + } } void -mv_TempMultiVectorCopy( void* src_, void* dest_ ) { +mv_TempMultiVectorCopy( void* src_, void* dest_ ) +{ - HYPRE_Int i, ms, md; - void** ps; - void** pd; - mv_TempMultiVector* src = (mv_TempMultiVector*)src_; - mv_TempMultiVector* dest = (mv_TempMultiVector*)dest_; + HYPRE_Int i, ms, md; + void** ps; + void** pd; + mv_TempMultiVector* src = (mv_TempMultiVector*)src_; + mv_TempMultiVector* dest = (mv_TempMultiVector*)dest_; - hypre_assert( src != NULL && dest != NULL ); + hypre_assert( src != NULL && dest != NULL ); - ms = aux_maskCount( src->numVectors, src->mask ); - md = aux_maskCount( dest->numVectors, dest->mask ); - hypre_assert( ms == md ); + ms = aux_maskCount( src->numVectors, src->mask ); + md = aux_maskCount( dest->numVectors, dest->mask ); + hypre_assert( ms == md ); - ps = hypre_CTAlloc(void*, ms, HYPRE_MEMORY_HOST); - hypre_assert( ps != NULL ); - pd = hypre_CTAlloc(void*, md, HYPRE_MEMORY_HOST); - hypre_assert( pd != NULL ); + ps = hypre_CTAlloc(void*, ms, HYPRE_MEMORY_HOST); + hypre_assert( ps != NULL ); + pd = hypre_CTAlloc(void*, md, HYPRE_MEMORY_HOST); + hypre_assert( pd != NULL ); - mv_collectVectorPtr( src->mask, src, ps ); - mv_collectVectorPtr( dest->mask, dest, pd ); + mv_collectVectorPtr( src->mask, src, ps ); + mv_collectVectorPtr( dest->mask, dest, pd ); - for ( i = 0; i < ms; i++ ) - (src->interpreter->CopyVector)(ps[i],pd[i]); + for ( i = 0; i < ms; i++ ) + { + (src->interpreter->CopyVector)(ps[i], pd[i]); + } - hypre_TFree(ps,HYPRE_MEMORY_HOST); - hypre_TFree(pd,HYPRE_MEMORY_HOST); + hypre_TFree(ps, HYPRE_MEMORY_HOST); + hypre_TFree(pd, HYPRE_MEMORY_HOST); } void -mv_TempMultiVectorAxpy( HYPRE_Complex a, void* x_, void* y_ ) { - - HYPRE_Int i, mx, my; - void** px; - void** py; - mv_TempMultiVector* x; - mv_TempMultiVector* y; - - x = (mv_TempMultiVector*)x_; - y = (mv_TempMultiVector*)y_; - hypre_assert( x != NULL && y != NULL ); - - mx = aux_maskCount( x->numVectors, x->mask ); - my = aux_maskCount( y->numVectors, y->mask ); - hypre_assert( mx == my ); - - px = hypre_CTAlloc(void*, mx, HYPRE_MEMORY_HOST); - hypre_assert( px != NULL ); - py = hypre_CTAlloc(void*, my, HYPRE_MEMORY_HOST); - hypre_assert( py != NULL ); - - mv_collectVectorPtr( x->mask, x, px ); - mv_collectVectorPtr( y->mask, y, py ); - - for ( i = 0; i < mx; i++ ) - (x->interpreter->Axpy)(a,px[i],py[i]); - - hypre_TFree(px,HYPRE_MEMORY_HOST); - hypre_TFree(py,HYPRE_MEMORY_HOST); +mv_TempMultiVectorAxpy( HYPRE_Complex a, void* x_, void* y_ ) +{ + + HYPRE_Int i, mx, my; + void** px; + void** py; + mv_TempMultiVector* x; + mv_TempMultiVector* y; + + x = (mv_TempMultiVector*)x_; + y = (mv_TempMultiVector*)y_; + hypre_assert( x != NULL && y != NULL ); + + mx = aux_maskCount( x->numVectors, x->mask ); + my = aux_maskCount( y->numVectors, y->mask ); + hypre_assert( mx == my ); + + px = hypre_CTAlloc(void*, mx, HYPRE_MEMORY_HOST); + hypre_assert( px != NULL ); + py = hypre_CTAlloc(void*, my, HYPRE_MEMORY_HOST); + hypre_assert( py != NULL ); + + mv_collectVectorPtr( x->mask, x, px ); + mv_collectVectorPtr( y->mask, y, py ); + + for ( i = 0; i < mx; i++ ) + { + (x->interpreter->Axpy)(a, px[i], py[i]); + } + + hypre_TFree(px, HYPRE_MEMORY_HOST); + hypre_TFree(py, HYPRE_MEMORY_HOST); } void mv_TempMultiVectorByMultiVector( void* x_, void* y_, - HYPRE_Int xyGHeight, HYPRE_Int xyHeight, - HYPRE_Int xyWidth, HYPRE_Complex* xyVal ) { -/* xy = x'*y */ - - HYPRE_Int ix, iy, mx, my, jxy; - HYPRE_Complex* p; - void** px; - void** py; - mv_TempMultiVector* x; - mv_TempMultiVector* y; - - x = (mv_TempMultiVector*)x_; - y = (mv_TempMultiVector*)y_; - hypre_assert( x != NULL && y != NULL ); - - mx = aux_maskCount( x->numVectors, x->mask ); - hypre_assert( mx == xyHeight ); - - my = aux_maskCount( y->numVectors, y->mask ); - hypre_assert( my == xyWidth ); - - px = hypre_CTAlloc(void*, mx, HYPRE_MEMORY_HOST); - hypre_assert( px != NULL ); - py = hypre_CTAlloc(void*, my, HYPRE_MEMORY_HOST); - hypre_assert( py != NULL ); - - mv_collectVectorPtr( x->mask, x, px ); - mv_collectVectorPtr( y->mask, y, py ); - - jxy = xyGHeight - xyHeight; - for ( iy = 0, p = xyVal; iy < my; iy++ ) { - for ( ix = 0; ix < mx; ix++, p++ ) - *p = (x->interpreter->InnerProd)(px[ix],py[iy]); - p += jxy; - } - - hypre_TFree(px,HYPRE_MEMORY_HOST); - hypre_TFree(py,HYPRE_MEMORY_HOST); + HYPRE_BigInt xyGHeight, HYPRE_Int xyHeight, + HYPRE_Int xyWidth, HYPRE_Complex* xyVal ) +{ + /* xy = x'*y */ + + HYPRE_Int ix, iy, mx, my; + HYPRE_BigInt jxy; + HYPRE_Complex* p; + void** px; + void** py; + mv_TempMultiVector* x; + mv_TempMultiVector* y; + + x = (mv_TempMultiVector*)x_; + y = (mv_TempMultiVector*)y_; + hypre_assert( x != NULL && y != NULL ); + + mx = aux_maskCount( x->numVectors, x->mask ); + hypre_assert( mx == xyHeight ); + + my = aux_maskCount( y->numVectors, y->mask ); + hypre_assert( my == xyWidth ); + + px = hypre_CTAlloc(void*, mx, HYPRE_MEMORY_HOST); + hypre_assert( px != NULL ); + py = hypre_CTAlloc(void*, my, HYPRE_MEMORY_HOST); + hypre_assert( py != NULL ); + + mv_collectVectorPtr( x->mask, x, px ); + mv_collectVectorPtr( y->mask, y, py ); + + jxy = xyGHeight - (HYPRE_BigInt) xyHeight; + for ( iy = 0, p = xyVal; iy < my; iy++ ) + { + for ( ix = 0; ix < mx; ix++, p++ ) + { + *p = (x->interpreter->InnerProd)(px[ix], py[iy]); + } + p += jxy; + } + + hypre_TFree(px, HYPRE_MEMORY_HOST); + hypre_TFree(py, HYPRE_MEMORY_HOST); } void mv_TempMultiVectorByMultiVectorDiag( void* x_, void* y_, - HYPRE_Int* mask, HYPRE_Int n, HYPRE_Complex* diag ) { -/* diag = diag(x'*y) */ - - HYPRE_Int i, mx, my, m; - void** px; - void** py; - HYPRE_Int* index; - mv_TempMultiVector* x; - mv_TempMultiVector* y; - - x = (mv_TempMultiVector*)x_; - y = (mv_TempMultiVector*)y_; - hypre_assert( x != NULL && y != NULL ); - - mx = aux_maskCount( x->numVectors, x->mask ); - my = aux_maskCount( y->numVectors, y->mask ); - m = aux_maskCount( n, mask ); - hypre_assert( mx == my && mx == m ); - - px = hypre_CTAlloc(void*, mx, HYPRE_MEMORY_HOST); - hypre_assert( px != NULL ); - py = hypre_CTAlloc(void*, my, HYPRE_MEMORY_HOST); - hypre_assert( py != NULL ); - - mv_collectVectorPtr( x->mask, x, px ); - mv_collectVectorPtr( y->mask, y, py ); - - index = hypre_CTAlloc(HYPRE_Int, m, HYPRE_MEMORY_HOST); - aux_indexFromMask( n, mask, index ); - - for ( i = 0; i < m; i++ ) - *(diag+index[i]-1) = (x->interpreter->InnerProd)(px[i],py[i]); - - hypre_TFree(index,HYPRE_MEMORY_HOST); - hypre_TFree(px,HYPRE_MEMORY_HOST); - hypre_TFree(py,HYPRE_MEMORY_HOST); + HYPRE_Int* mask, HYPRE_Int n, HYPRE_Complex* diag ) +{ + /* diag = diag(x'*y) */ + + HYPRE_Int i, mx, my, m; + void** px; + void** py; + HYPRE_Int* index; + mv_TempMultiVector* x; + mv_TempMultiVector* y; + + x = (mv_TempMultiVector*)x_; + y = (mv_TempMultiVector*)y_; + hypre_assert( x != NULL && y != NULL ); + + mx = aux_maskCount( x->numVectors, x->mask ); + my = aux_maskCount( y->numVectors, y->mask ); + m = aux_maskCount( n, mask ); + hypre_assert( mx == my && mx == m ); + + px = hypre_CTAlloc(void*, mx, HYPRE_MEMORY_HOST); + hypre_assert( px != NULL ); + py = hypre_CTAlloc(void*, my, HYPRE_MEMORY_HOST); + hypre_assert( py != NULL ); + + mv_collectVectorPtr( x->mask, x, px ); + mv_collectVectorPtr( y->mask, y, py ); + + index = hypre_CTAlloc(HYPRE_Int, m, HYPRE_MEMORY_HOST); + aux_indexFromMask( n, mask, index ); + + for ( i = 0; i < m; i++ ) + { + *(diag + index[i] - 1) = (x->interpreter->InnerProd)(px[i], py[i]); + } + + hypre_TFree(index, HYPRE_MEMORY_HOST); + hypre_TFree(px, HYPRE_MEMORY_HOST); + hypre_TFree(py, HYPRE_MEMORY_HOST); } void mv_TempMultiVectorByMatrix( void* x_, - HYPRE_Int rGHeight, HYPRE_Int rHeight, - HYPRE_Int rWidth, HYPRE_Complex* rVal, - void* y_ ) { - - HYPRE_Int i, j, jump; - HYPRE_Int mx, my; - HYPRE_Complex* p; - void** px; - void** py; - mv_TempMultiVector* x; - mv_TempMultiVector* y; - - x = (mv_TempMultiVector*)x_; - y = (mv_TempMultiVector*)y_; - hypre_assert( x != NULL && y != NULL ); - - mx = aux_maskCount( x->numVectors, x->mask ); - my = aux_maskCount( y->numVectors, y->mask ); - - hypre_assert( mx == rHeight && my == rWidth ); - - px = hypre_CTAlloc(void*, mx, HYPRE_MEMORY_HOST); - hypre_assert( px != NULL ); - py = hypre_CTAlloc(void*, my, HYPRE_MEMORY_HOST); - hypre_assert( py != NULL ); - - mv_collectVectorPtr( x->mask, x, px ); - mv_collectVectorPtr( y->mask, y, py ); - - jump = rGHeight - rHeight; - for ( j = 0, p = rVal; j < my; j++ ) { - (x->interpreter->ClearVector)( py[j] ); - for ( i = 0; i < mx; i++, p++ ) - (x->interpreter->Axpy)(*p,px[i],py[j]); - p += jump; - } - - hypre_TFree(px,HYPRE_MEMORY_HOST); - hypre_TFree(py,HYPRE_MEMORY_HOST); + HYPRE_BigInt rGHeight, HYPRE_Int rHeight, + HYPRE_Int rWidth, HYPRE_Complex* rVal, + void* y_ ) +{ + + HYPRE_Int i, j; + HYPRE_BigInt jump; + HYPRE_Int mx, my; + HYPRE_Complex* p; + void** px; + void** py; + mv_TempMultiVector* x; + mv_TempMultiVector* y; + + x = (mv_TempMultiVector*)x_; + y = (mv_TempMultiVector*)y_; + hypre_assert( x != NULL && y != NULL ); + + mx = aux_maskCount( x->numVectors, x->mask ); + my = aux_maskCount( y->numVectors, y->mask ); + + hypre_assert( mx == rHeight && my == rWidth ); + + px = hypre_CTAlloc(void*, mx, HYPRE_MEMORY_HOST); + hypre_assert( px != NULL ); + py = hypre_CTAlloc(void*, my, HYPRE_MEMORY_HOST); + hypre_assert( py != NULL ); + + mv_collectVectorPtr( x->mask, x, px ); + mv_collectVectorPtr( y->mask, y, py ); + + jump = rGHeight - (HYPRE_BigInt) rHeight; + for ( j = 0, p = rVal; j < my; j++ ) + { + (x->interpreter->ClearVector)( py[j] ); + for ( i = 0; i < mx; i++, p++ ) + { + (x->interpreter->Axpy)(*p, px[i], py[j]); + } + p += jump; + } + + hypre_TFree(px, HYPRE_MEMORY_HOST); + hypre_TFree(py, HYPRE_MEMORY_HOST); } void mv_TempMultiVectorXapy( void* x_, - HYPRE_Int rGHeight, HYPRE_Int rHeight, - HYPRE_Int rWidth, HYPRE_Complex* rVal, - void* y_ ) { - - HYPRE_Int i, j, jump; - HYPRE_Int mx, my; - HYPRE_Complex* p; - void** px; - void** py; - mv_TempMultiVector* x; - mv_TempMultiVector* y; - - x = (mv_TempMultiVector*)x_; - y = (mv_TempMultiVector*)y_; - hypre_assert( x != NULL && y != NULL ); - - mx = aux_maskCount( x->numVectors, x->mask ); - my = aux_maskCount( y->numVectors, y->mask ); - - hypre_assert( mx == rHeight && my == rWidth ); - - px = hypre_CTAlloc(void*, mx, HYPRE_MEMORY_HOST); - hypre_assert( px != NULL ); - py = hypre_CTAlloc(void*, my, HYPRE_MEMORY_HOST); - hypre_assert( py != NULL ); - - mv_collectVectorPtr( x->mask, x, px ); - mv_collectVectorPtr( y->mask, y, py ); - - jump = rGHeight - rHeight; - for ( j = 0, p = rVal; j < my; j++ ) { - for ( i = 0; i < mx; i++, p++ ) - (x->interpreter->Axpy)(*p,px[i],py[j]); - p += jump; - } - - hypre_TFree(px,HYPRE_MEMORY_HOST); - hypre_TFree(py,HYPRE_MEMORY_HOST); + HYPRE_BigInt rGHeight, HYPRE_Int rHeight, + HYPRE_Int rWidth, HYPRE_Complex* rVal, + void* y_ ) +{ + + HYPRE_Int i, j; + HYPRE_BigInt jump; + HYPRE_Int mx, my; + HYPRE_Complex* p; + void** px; + void** py; + mv_TempMultiVector* x; + mv_TempMultiVector* y; + + x = (mv_TempMultiVector*)x_; + y = (mv_TempMultiVector*)y_; + hypre_assert( x != NULL && y != NULL ); + + mx = aux_maskCount( x->numVectors, x->mask ); + my = aux_maskCount( y->numVectors, y->mask ); + + hypre_assert( mx == rHeight && my == rWidth ); + + px = hypre_CTAlloc(void*, mx, HYPRE_MEMORY_HOST); + hypre_assert( px != NULL ); + py = hypre_CTAlloc(void*, my, HYPRE_MEMORY_HOST); + hypre_assert( py != NULL ); + + mv_collectVectorPtr( x->mask, x, px ); + mv_collectVectorPtr( y->mask, y, py ); + + jump = rGHeight - (HYPRE_BigInt) rHeight; + for ( j = 0, p = rVal; j < my; j++ ) + { + for ( i = 0; i < mx; i++, p++ ) + { + (x->interpreter->Axpy)(*p, px[i], py[j]); + } + p += jump; + } + + hypre_TFree(px, HYPRE_MEMORY_HOST); + hypre_TFree(py, HYPRE_MEMORY_HOST); } void mv_TempMultiVectorByDiagonal( void* x_, - HYPRE_Int* mask, HYPRE_Int n, HYPRE_Complex* diag, - void* y_ ) { - - HYPRE_Int j; - HYPRE_Int mx, my, m; - void** px; - void** py; - HYPRE_Int* index; - mv_TempMultiVector* x; - mv_TempMultiVector* y; - - x = (mv_TempMultiVector*)x_; - y = (mv_TempMultiVector*)y_; - hypre_assert( x != NULL && y != NULL ); - - mx = aux_maskCount( x->numVectors, x->mask ); - my = aux_maskCount( y->numVectors, y->mask ); - m = aux_maskCount( n, mask ); - - hypre_assert( mx == m && my == m ); - - if ( m < 1 ) - return; - - px = hypre_CTAlloc(void*, mx, HYPRE_MEMORY_HOST); - hypre_assert( px != NULL ); - py = hypre_CTAlloc(void*, my, HYPRE_MEMORY_HOST); - hypre_assert( py != NULL ); - - index = hypre_CTAlloc(HYPRE_Int, m, HYPRE_MEMORY_HOST); - aux_indexFromMask( n, mask, index ); - - mv_collectVectorPtr( x->mask, x, px ); - mv_collectVectorPtr( y->mask, y, py ); - - for ( j = 0; j < my; j++ ) { - (x->interpreter->ClearVector)(py[j]); - (x->interpreter->Axpy)(diag[index[j]-1],px[j],py[j]); - } - - hypre_TFree(px,HYPRE_MEMORY_HOST); - hypre_TFree(py,HYPRE_MEMORY_HOST); - hypre_TFree( index ,HYPRE_MEMORY_HOST); + HYPRE_Int* mask, HYPRE_Int n, HYPRE_Complex* diag, + void* y_ ) +{ + + HYPRE_Int j; + HYPRE_Int mx, my, m; + void** px; + void** py; + HYPRE_Int* index; + mv_TempMultiVector* x; + mv_TempMultiVector* y; + + x = (mv_TempMultiVector*)x_; + y = (mv_TempMultiVector*)y_; + hypre_assert( x != NULL && y != NULL ); + + mx = aux_maskCount( x->numVectors, x->mask ); + my = aux_maskCount( y->numVectors, y->mask ); + m = aux_maskCount( n, mask ); + + hypre_assert( mx == m && my == m ); + + if ( m < 1 ) + { + return; + } + + px = hypre_CTAlloc(void*, mx, HYPRE_MEMORY_HOST); + hypre_assert( px != NULL ); + py = hypre_CTAlloc(void*, my, HYPRE_MEMORY_HOST); + hypre_assert( py != NULL ); + + index = hypre_CTAlloc(HYPRE_Int, m, HYPRE_MEMORY_HOST); + aux_indexFromMask( n, mask, index ); + + mv_collectVectorPtr( x->mask, x, px ); + mv_collectVectorPtr( y->mask, y, py ); + + for ( j = 0; j < my; j++ ) + { + (x->interpreter->ClearVector)(py[j]); + (x->interpreter->Axpy)(diag[index[j] - 1], px[j], py[j]); + } + + hypre_TFree(px, HYPRE_MEMORY_HOST); + hypre_TFree(py, HYPRE_MEMORY_HOST); + hypre_TFree( index, HYPRE_MEMORY_HOST); } void mv_TempMultiVectorEval( void (*f)( void*, void*, void* ), void* par, - void* x_, void* y_ ) { - - HYPRE_Int i, mx, my; - void** px; - void** py; - mv_TempMultiVector* x; - mv_TempMultiVector* y; - - x = (mv_TempMultiVector*)x_; - y = (mv_TempMultiVector*)y_; - hypre_assert( x != NULL && y != NULL ); - - if ( f == NULL ) { - mv_TempMultiVectorCopy( x, y ); - return; - } - - mx = aux_maskCount( x->numVectors, x->mask ); - my = aux_maskCount( y->numVectors, y->mask ); - hypre_assert( mx == my ); - - px = hypre_CTAlloc(void*, mx, HYPRE_MEMORY_HOST); - hypre_assert( px != NULL ); - py = hypre_CTAlloc(void*, my, HYPRE_MEMORY_HOST); - hypre_assert( py != NULL ); - - mv_collectVectorPtr( x->mask, x, px ); - mv_collectVectorPtr( y->mask, y, py ); - - for ( i = 0; i < mx; i++ ) - f( par, (void*)px[i], (void*)py[i] ); - - hypre_TFree(px,HYPRE_MEMORY_HOST); - hypre_TFree(py,HYPRE_MEMORY_HOST); + void* x_, void* y_ ) +{ + + HYPRE_Int i, mx, my; + void** px; + void** py; + mv_TempMultiVector* x; + mv_TempMultiVector* y; + + x = (mv_TempMultiVector*)x_; + y = (mv_TempMultiVector*)y_; + hypre_assert( x != NULL && y != NULL ); + + if ( f == NULL ) + { + mv_TempMultiVectorCopy( x, y ); + return; + } + + mx = aux_maskCount( x->numVectors, x->mask ); + my = aux_maskCount( y->numVectors, y->mask ); + hypre_assert( mx == my ); + + px = hypre_CTAlloc(void*, mx, HYPRE_MEMORY_HOST); + hypre_assert( px != NULL ); + py = hypre_CTAlloc(void*, my, HYPRE_MEMORY_HOST); + hypre_assert( py != NULL ); + + mv_collectVectorPtr( x->mask, x, px ); + mv_collectVectorPtr( y->mask, y, py ); + + for ( i = 0; i < mx; i++ ) + { + f( par, (void*)px[i], (void*)py[i] ); + } + + hypre_TFree(px, HYPRE_MEMORY_HOST); + hypre_TFree(py, HYPRE_MEMORY_HOST); } diff --git a/external/hypre/src/multivector/temp_multivector.h b/external/hypre/src/multivector/temp_multivector.h index 2ebde545..fb2ee9e4 100644 --- a/external/hypre/src/multivector/temp_multivector.h +++ b/external/hypre/src/multivector/temp_multivector.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -12,13 +12,13 @@ typedef struct { - HYPRE_Int numVectors; - HYPRE_Int* mask; - void** vector; - HYPRE_Int ownsVectors; - HYPRE_Int ownsMask; + HYPRE_Int numVectors; + HYPRE_Int* mask; + void** vector; + HYPRE_Int ownsVectors; + HYPRE_Int ownsMask; - mv_InterfaceInterpreter* interpreter; + mv_InterfaceInterpreter* interpreter; } mv_TempMultiVector; @@ -109,29 +109,29 @@ mv_TempMultiVectorAxpy( HYPRE_Complex, void*, void* ); void mv_TempMultiVectorByMultiVector( void*, void*, - HYPRE_Int gh, HYPRE_Int h, HYPRE_Int w, HYPRE_Complex* v ); + HYPRE_BigInt gh, HYPRE_Int h, HYPRE_Int w, HYPRE_Complex* v ); void mv_TempMultiVectorByMultiVectorDiag( void* x, void* y, - HYPRE_Int* mask, HYPRE_Int n, HYPRE_Complex* diag ); + HYPRE_Int* mask, HYPRE_Int n, HYPRE_Complex* diag ); void mv_TempMultiVectorByMatrix( void*, - HYPRE_Int gh, HYPRE_Int h, HYPRE_Int w, HYPRE_Complex* v, - void* ); + HYPRE_BigInt gh, HYPRE_Int h, HYPRE_Int w, HYPRE_Complex* v, + void* ); void mv_TempMultiVectorXapy( void* x, - HYPRE_Int gh, HYPRE_Int h, HYPRE_Int w, HYPRE_Complex* v, - void* y ); + HYPRE_BigInt gh, HYPRE_Int h, HYPRE_Int w, HYPRE_Complex* v, + void* y ); void mv_TempMultiVectorByDiagonal( void* x, - HYPRE_Int* mask, HYPRE_Int n, HYPRE_Complex* diag, - void* y ); + HYPRE_Int* mask, HYPRE_Int n, HYPRE_Complex* diag, + void* y ); void mv_TempMultiVectorEval( void (*f)( void*, void*, void* ), void* par, - void* x, void* y ); + void* x, void* y ); #ifdef __cplusplus } diff --git a/external/hypre/src/nopoe b/external/hypre/src/nopoe old mode 100644 new mode 100755 diff --git a/external/hypre/src/parcsr_block_mv/CMakeLists.txt b/external/hypre/src/parcsr_block_mv/CMakeLists.txt index 3559fff8..d8e5685d 100644 --- a/external/hypre/src/parcsr_block_mv/CMakeLists.txt +++ b/external/hypre/src/parcsr_block_mv/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/parcsr_block_mv/_hypre_parcsr_block_mv.h b/external/hypre/src/parcsr_block_mv/_hypre_parcsr_block_mv.h index 72fe1265..5c9ddea3 100644 --- a/external/hypre/src/parcsr_block_mv/_hypre_parcsr_block_mv.h +++ b/external/hypre/src/parcsr_block_mv/_hypre_parcsr_block_mv.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -10,5 +10,5 @@ #include #include "csr_block_matrix.h" -#include "par_csr_block_matrix.h" +#include "par_csr_block_matrix.h" #include "_hypre_parcsr_ls.h" diff --git a/external/hypre/src/parcsr_block_mv/csr_block_matop.c b/external/hypre/src/parcsr_block_mv/csr_block_matop.c index 96485f4a..ce4ae00f 100644 --- a/external/hypre/src/parcsr_block_mv/csr_block_matop.c +++ b/external/hypre/src/parcsr_block_mv/csr_block_matop.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -16,7 +16,7 @@ * adds two CSR Matrices A and B and returns a CSR Matrix C; * Note: The routine does not check for 0-elements which might be generated * through cancellation of elements in A and B or already contained - in A and B. To remove those, use hypre_CSRMatrixDeleteZeros + in A and B. To remove those, use hypre_CSRMatrixDeleteZeros *--------------------------------------------------------------------------*/ hypre_CSRBlockMatrix * @@ -37,8 +37,8 @@ hypre_CSRBlockMatrixAdd(hypre_CSRBlockMatrix *A, hypre_CSRBlockMatrix *B) HYPRE_Int *C_i; HYPRE_Int *C_j; - HYPRE_Int block_size = hypre_CSRBlockMatrixBlockSize(A); - HYPRE_Int block_sizeB = hypre_CSRBlockMatrixBlockSize(B); + HYPRE_Int block_size = hypre_CSRBlockMatrixBlockSize(A); + HYPRE_Int block_sizeB = hypre_CSRBlockMatrixBlockSize(B); HYPRE_Int ia, ib, ic, ii, jcol, num_nonzeros, bnnz; HYPRE_Int pos; HYPRE_Int *marker; @@ -56,21 +56,21 @@ hypre_CSRBlockMatrixAdd(hypre_CSRBlockMatrix *A, hypre_CSRBlockMatrix *B) bnnz = block_size * block_size; marker = hypre_CTAlloc(HYPRE_Int, ncols_A, HYPRE_MEMORY_HOST); - C_i = hypre_CTAlloc(HYPRE_Int, nrows_A+1, HYPRE_MEMORY_HOST); + C_i = hypre_CTAlloc(HYPRE_Int, nrows_A + 1, HYPRE_MEMORY_HOST); - for (ia = 0; ia < ncols_A; ia++) marker[ia] = -1; + for (ia = 0; ia < ncols_A; ia++) { marker[ia] = -1; } num_nonzeros = 0; C_i[0] = 0; for (ic = 0; ic < nrows_A; ic++) { - for (ia = A_i[ic]; ia < A_i[ic+1]; ia++) + for (ia = A_i[ic]; ia < A_i[ic + 1]; ia++) { jcol = A_j[ia]; marker[jcol] = ic; num_nonzeros++; } - for (ib = B_i[ic]; ib < B_i[ic+1]; ib++) + for (ib = B_i[ic]; ib < B_i[ic + 1]; ib++) { jcol = B_j[ib]; if (marker[jcol] != ic) @@ -79,57 +79,63 @@ hypre_CSRBlockMatrixAdd(hypre_CSRBlockMatrix *A, hypre_CSRBlockMatrix *B) num_nonzeros++; } } - C_i[ic+1] = num_nonzeros; + C_i[ic + 1] = num_nonzeros; } - C = hypre_CSRBlockMatrixCreate(block_size,nrows_A,ncols_A,num_nonzeros); + C = hypre_CSRBlockMatrixCreate(block_size, nrows_A, ncols_A, num_nonzeros); hypre_CSRMatrixI(C) = C_i; hypre_CSRMatrixInitialize(C); C_j = hypre_CSRMatrixJ(C); C_data = hypre_CSRMatrixData(C); - for (ia = 0; ia < ncols_A; ia++) marker[ia] = -1; + for (ia = 0; ia < ncols_A; ia++) { marker[ia] = -1; } pos = 0; for (ic = 0; ic < nrows_A; ic++) { - for (ia = A_i[ic]; ia < A_i[ic+1]; ia++) + for (ia = A_i[ic]; ia < A_i[ic + 1]; ia++) { jcol = A_j[ia]; C_j[pos] = jcol; for (ii = 0; ii < bnnz; ii++) - C_data[pos*bnnz+ii] = A_data[ia*bnnz+ii]; + { + C_data[pos * bnnz + ii] = A_data[ia * bnnz + ii]; + } marker[jcol] = pos; pos++; } - for (ib = B_i[ic]; ib < B_i[ic+1]; ib++) + for (ib = B_i[ic]; ib < B_i[ic + 1]; ib++) { jcol = B_j[ib]; if (marker[jcol] < C_i[ic]) { C_j[pos] = jcol; for (ii = 0; ii < bnnz; ii++) - C_data[pos*bnnz+ii] = B_data[ib*bnnz+ii]; + { + C_data[pos * bnnz + ii] = B_data[ib * bnnz + ii]; + } marker[jcol] = pos; pos++; } - else + else { for (ii = 0; ii < bnnz; ii++) - C_data[marker[jcol]*bnnz+ii] = B_data[ib*bnnz+ii]; + { + C_data[marker[jcol]*bnnz + ii] = B_data[ib * bnnz + ii]; + } } } } hypre_TFree(marker, HYPRE_MEMORY_HOST); return C; -} +} /*-------------------------------------------------------------------------- * hypre_CSRMatrixMultiply * multiplies two CSR Matrices A and B and returns a CSR Matrix C; * Note: The routine does not check for 0-elements which might be generated * through cancellation of elements in A and B or already contained - in A and B. To remove those, use hypre_CSRMatrixDeleteZeros + in A and B. To remove those, use hypre_CSRMatrixDeleteZeros *--------------------------------------------------------------------------*/ hypre_CSRBlockMatrix * @@ -140,21 +146,21 @@ hypre_CSRBlockMatrixMultiply(hypre_CSRBlockMatrix *A, hypre_CSRBlockMatrix *B) HYPRE_Int *A_j = hypre_CSRMatrixJ(A); HYPRE_Int nrows_A = hypre_CSRMatrixNumRows(A); HYPRE_Int ncols_A = hypre_CSRMatrixNumCols(A); - HYPRE_Int block_size = hypre_CSRBlockMatrixBlockSize(A); + HYPRE_Int block_size = hypre_CSRBlockMatrixBlockSize(A); HYPRE_Complex *B_data = hypre_CSRMatrixData(B); HYPRE_Int *B_i = hypre_CSRMatrixI(B); HYPRE_Int *B_j = hypre_CSRMatrixJ(B); HYPRE_Int nrows_B = hypre_CSRMatrixNumRows(B); HYPRE_Int ncols_B = hypre_CSRMatrixNumCols(B); - HYPRE_Int block_sizeB = hypre_CSRBlockMatrixBlockSize(B); + HYPRE_Int block_sizeB = hypre_CSRBlockMatrixBlockSize(B); hypre_CSRMatrix *C; HYPRE_Complex *C_data; HYPRE_Int *C_i; HYPRE_Int *C_j; - HYPRE_Int ia, ib, ic, ja, jb, num_nonzeros=0, bnnz; + HYPRE_Int ia, ib, ic, ja, jb, num_nonzeros = 0, bnnz; HYPRE_Int row_start, counter; - HYPRE_Complex *a_entries, *b_entries, *c_entries, dzero=0.0, done=1.0; + HYPRE_Complex *a_entries, *b_entries, *c_entries, dzero = 0.0, done = 1.0; HYPRE_Int *B_marker; if (ncols_A != nrows_B) @@ -170,16 +176,16 @@ hypre_CSRBlockMatrixMultiply(hypre_CSRBlockMatrix *A, hypre_CSRBlockMatrix *B) bnnz = block_size * block_size; B_marker = hypre_CTAlloc(HYPRE_Int, ncols_B, HYPRE_MEMORY_HOST); - C_i = hypre_CTAlloc(HYPRE_Int, nrows_A+1, HYPRE_MEMORY_HOST); + C_i = hypre_CTAlloc(HYPRE_Int, nrows_A + 1, HYPRE_MEMORY_HOST); - for (ib = 0; ib < ncols_B; ib++) B_marker[ib] = -1; + for (ib = 0; ib < ncols_B; ib++) { B_marker[ib] = -1; } for (ic = 0; ic < nrows_A; ic++) { - for (ia = A_i[ic]; ia < A_i[ic+1]; ia++) + for (ia = A_i[ic]; ia < A_i[ic + 1]; ia++) { ja = A_j[ia]; - for (ib = B_i[ja]; ib < B_i[ja+1]; ib++) + for (ib = B_i[ja]; ib < B_i[ja + 1]; ib++) { jb = B_j[ib]; if (B_marker[jb] != ic) @@ -189,42 +195,42 @@ hypre_CSRBlockMatrixMultiply(hypre_CSRBlockMatrix *A, hypre_CSRBlockMatrix *B) } } } - C_i[ic+1] = num_nonzeros; + C_i[ic + 1] = num_nonzeros; } - C = hypre_CSRBlockMatrixCreate(block_size,nrows_A,ncols_B,num_nonzeros); + C = hypre_CSRBlockMatrixCreate(block_size, nrows_A, ncols_B, num_nonzeros); hypre_CSRMatrixI(C) = C_i; hypre_CSRMatrixInitialize(C); C_j = hypre_CSRMatrixJ(C); C_data = hypre_CSRMatrixData(C); - for (ib = 0; ib < ncols_B; ib++) B_marker[ib] = -1; + for (ib = 0; ib < ncols_B; ib++) { B_marker[ib] = -1; } counter = 0; for (ic = 0; ic < nrows_A; ic++) { row_start = C_i[ic]; - for (ia = A_i[ic]; ia < A_i[ic+1]; ia++) + for (ia = A_i[ic]; ia < A_i[ic + 1]; ia++) { ja = A_j[ia]; - a_entries = &(A_data[ia*bnnz]); - for (ib = B_i[ja]; ib < B_i[ja+1]; ib++) + a_entries = &(A_data[ia * bnnz]); + for (ib = B_i[ja]; ib < B_i[ja + 1]; ib++) { jb = B_j[ib]; - b_entries = &(B_data[ib*bnnz]); + b_entries = &(B_data[ib * bnnz]); if (B_marker[jb] < row_start) { B_marker[jb] = counter; C_j[B_marker[jb]] = jb; - c_entries = &(C_data[B_marker[jb]*bnnz]); - hypre_CSRBlockMatrixBlockMultAdd(a_entries,b_entries,dzero, + c_entries = &(C_data[B_marker[jb] * bnnz]); + hypre_CSRBlockMatrixBlockMultAdd(a_entries, b_entries, dzero, c_entries, block_size); counter++; } else { - c_entries = &(C_data[B_marker[jb]*bnnz]); - hypre_CSRBlockMatrixBlockMultAdd(a_entries,b_entries,done, + c_entries = &(C_data[B_marker[jb] * bnnz]); + hypre_CSRBlockMatrixBlockMultAdd(a_entries, b_entries, done, c_entries, block_size); } } @@ -232,5 +238,5 @@ hypre_CSRBlockMatrixMultiply(hypre_CSRBlockMatrix *A, hypre_CSRBlockMatrix *B) } hypre_TFree(B_marker, HYPRE_MEMORY_HOST); return C; -} +} diff --git a/external/hypre/src/parcsr_block_mv/csr_block_matrix.c b/external/hypre/src/parcsr_block_mv/csr_block_matrix.c index a1a2d17d..1cdf356b 100644 --- a/external/hypre/src/parcsr_block_mv/csr_block_matrix.c +++ b/external/hypre/src/parcsr_block_mv/csr_block_matrix.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -13,6 +13,8 @@ #include "_hypre_parcsr_block_mv.h" +#define LB_VERSION 0 + /*-------------------------------------------------------------------------- * hypre_CSRBlockMatrixCreate *--------------------------------------------------------------------------*/ @@ -46,10 +48,10 @@ hypre_CSRBlockMatrixCreate(HYPRE_Int block_size, * hypre_CSRBlockMatrixDestroy *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int hypre_CSRBlockMatrixDestroy(hypre_CSRBlockMatrix *matrix) { - HYPRE_Int ierr=0; + HYPRE_Int ierr = 0; if (matrix) { @@ -70,29 +72,37 @@ hypre_CSRBlockMatrixDestroy(hypre_CSRBlockMatrix *matrix) * hypre_CSRBlockMatrixInitialize *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int hypre_CSRBlockMatrixInitialize(hypre_CSRBlockMatrix *matrix) { HYPRE_Int block_size = hypre_CSRBlockMatrixBlockSize(matrix); HYPRE_Int num_rows = hypre_CSRBlockMatrixNumRows(matrix); HYPRE_Int num_nonzeros = hypre_CSRBlockMatrixNumNonzeros(matrix); - HYPRE_Int ierr=0, nnz; + HYPRE_Int ierr = 0, nnz; if ( ! hypre_CSRBlockMatrixI(matrix) ) + { hypre_TFree(hypre_CSRBlockMatrixI(matrix), HYPRE_MEMORY_HOST); + } if ( ! hypre_CSRBlockMatrixJ(matrix) ) + { hypre_TFree(hypre_CSRBlockMatrixJ(matrix), HYPRE_MEMORY_HOST); + } if ( ! hypre_CSRBlockMatrixBigJ(matrix) ) + { hypre_TFree(hypre_CSRBlockMatrixBigJ(matrix), HYPRE_MEMORY_HOST); + } if ( ! hypre_CSRBlockMatrixData(matrix) ) + { hypre_TFree(hypre_CSRBlockMatrixData(matrix), HYPRE_MEMORY_HOST); + } nnz = num_nonzeros * block_size * block_size; hypre_CSRBlockMatrixI(matrix) = hypre_CTAlloc(HYPRE_Int, num_rows + 1, HYPRE_MEMORY_HOST); - if (nnz) hypre_CSRBlockMatrixData(matrix) = hypre_CTAlloc(HYPRE_Complex, nnz, HYPRE_MEMORY_HOST); - else hypre_CSRBlockMatrixData(matrix) = NULL; - if (nnz) hypre_CSRBlockMatrixJ(matrix) = hypre_CTAlloc(HYPRE_Int, num_nonzeros, HYPRE_MEMORY_HOST); - else hypre_CSRBlockMatrixJ(matrix) = NULL; + if (nnz) { hypre_CSRBlockMatrixData(matrix) = hypre_CTAlloc(HYPRE_Complex, nnz, HYPRE_MEMORY_HOST); } + else { hypre_CSRBlockMatrixData(matrix) = NULL; } + if (nnz) { hypre_CSRBlockMatrixJ(matrix) = hypre_CTAlloc(HYPRE_Int, num_nonzeros, HYPRE_MEMORY_HOST); } + else { hypre_CSRBlockMatrixJ(matrix) = NULL; } return ierr; } @@ -101,29 +111,37 @@ hypre_CSRBlockMatrixInitialize(hypre_CSRBlockMatrix *matrix) * hypre_CSRBlockMatrixBigInitialize *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int hypre_CSRBlockMatrixBigInitialize(hypre_CSRBlockMatrix *matrix) { HYPRE_Int block_size = hypre_CSRBlockMatrixBlockSize(matrix); HYPRE_Int num_rows = hypre_CSRBlockMatrixNumRows(matrix); HYPRE_Int num_nonzeros = hypre_CSRBlockMatrixNumNonzeros(matrix); - HYPRE_Int ierr=0, nnz; + HYPRE_Int ierr = 0, nnz; if ( ! hypre_CSRBlockMatrixI(matrix) ) + { hypre_TFree(hypre_CSRBlockMatrixI(matrix), HYPRE_MEMORY_HOST); + } if ( ! hypre_CSRBlockMatrixJ(matrix) ) + { hypre_TFree(hypre_CSRBlockMatrixJ(matrix), HYPRE_MEMORY_HOST); + } if ( ! hypre_CSRBlockMatrixBigJ(matrix) ) + { hypre_TFree(hypre_CSRBlockMatrixBigJ(matrix), HYPRE_MEMORY_HOST); + } if ( ! hypre_CSRBlockMatrixData(matrix) ) + { hypre_TFree(hypre_CSRBlockMatrixData(matrix), HYPRE_MEMORY_HOST); + } nnz = num_nonzeros * block_size * block_size; hypre_CSRBlockMatrixI(matrix) = hypre_CTAlloc(HYPRE_Int, num_rows + 1, HYPRE_MEMORY_HOST); - if (nnz) hypre_CSRBlockMatrixData(matrix) = hypre_CTAlloc(HYPRE_Complex, nnz, HYPRE_MEMORY_HOST); - else hypre_CSRBlockMatrixData(matrix) = NULL; - if (nnz) hypre_CSRBlockMatrixBigJ(matrix) = hypre_CTAlloc(HYPRE_BigInt, num_nonzeros, HYPRE_MEMORY_HOST); - else hypre_CSRBlockMatrixJ(matrix) = NULL; + if (nnz) { hypre_CSRBlockMatrixData(matrix) = hypre_CTAlloc(HYPRE_Complex, nnz, HYPRE_MEMORY_HOST); } + else { hypre_CSRBlockMatrixData(matrix) = NULL; } + if (nnz) { hypre_CSRBlockMatrixBigJ(matrix) = hypre_CTAlloc(HYPRE_BigInt, num_nonzeros, HYPRE_MEMORY_HOST); } + else { hypre_CSRBlockMatrixJ(matrix) = NULL; } return ierr; } @@ -132,10 +150,10 @@ hypre_CSRBlockMatrixBigInitialize(hypre_CSRBlockMatrix *matrix) * hypre_CSRBlockMatrixSetDataOwner *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int hypre_CSRBlockMatrixSetDataOwner(hypre_CSRBlockMatrix *matrix, HYPRE_Int owns_data) { - HYPRE_Int ierr=0; + HYPRE_Int ierr = 0; hypre_CSRBlockMatrixOwnsData(matrix) = owns_data; @@ -160,21 +178,23 @@ hypre_CSRBlockMatrixCompress(hypre_CSRBlockMatrix *matrix) HYPRE_Int *matrix_C_i, *matrix_C_j, i, j, bnnz; HYPRE_Complex *matrix_C_data, ddata; - matrix_C = hypre_CSRMatrixCreate(num_rows,num_cols,num_nonzeros); + matrix_C = hypre_CSRMatrixCreate(num_rows, num_cols, num_nonzeros); hypre_CSRMatrixInitialize(matrix_C); matrix_C_i = hypre_CSRMatrixI(matrix_C); matrix_C_j = hypre_CSRMatrixJ(matrix_C); matrix_C_data = hypre_CSRMatrixData(matrix_C); bnnz = block_size * block_size; - for(i = 0; i < num_rows + 1; i++) matrix_C_i[i] = matrix_i[i]; - for(i = 0; i < num_nonzeros; i++) + for (i = 0; i < num_rows + 1; i++) { matrix_C_i[i] = matrix_i[i]; } + for (i = 0; i < num_nonzeros; i++) { matrix_C_j[i] = matrix_j[i]; ddata = 0.0; - for(j = 0; j < bnnz; j++) - ddata += matrix_data[i*bnnz+j] * matrix_data[i*bnnz+j]; - matrix_C_data[i] = sqrt(ddata); + for (j = 0; j < bnnz; j++) + { + ddata += matrix_data[i * bnnz + j] * matrix_data[i * bnnz + j]; + } + matrix_C_data[i] = hypre_sqrt(ddata); } return matrix_C; } @@ -203,36 +223,36 @@ hypre_CSRBlockMatrixConvertToCSRMatrix( hypre_CSRBlockMatrix *matrix ) new_nrows = num_rows * block_size; new_ncols = num_cols * block_size; new_num_nonzeros = block_size * block_size * num_nonzeros; - matrix_C = hypre_CSRMatrixCreate(new_nrows,new_ncols,new_num_nonzeros); + matrix_C = hypre_CSRMatrixCreate(new_nrows, new_ncols, new_num_nonzeros); hypre_CSRMatrixInitialize(matrix_C); matrix_C_i = hypre_CSRMatrixI(matrix_C); matrix_C_j = hypre_CSRMatrixJ(matrix_C); matrix_C_data = hypre_CSRMatrixData(matrix_C); - for(i = 0; i < num_rows; i++) + for (i = 0; i < num_rows; i++) { - for(j = 0; j < block_size; j++) - matrix_C_i[i*block_size + j] = matrix_i[i]*bnnz + - j * (matrix_i[i + 1] - matrix_i[i])*block_size; + for (j = 0; j < block_size; j++) + matrix_C_i[i * block_size + j] = matrix_i[i] * bnnz + + j * (matrix_i[i + 1] - matrix_i[i]) * block_size; } matrix_C_i[new_nrows] = matrix_i[num_rows] * bnnz; C_ii = 0; - for(i = 0; i < num_rows; i++) + for (i = 0; i < num_rows; i++) { - for(j = 0; j < block_size; j++) + for (j = 0; j < block_size; j++) { - for(ii = matrix_i[i]; ii < matrix_i[i + 1]; ii++) + for (ii = matrix_i[i]; ii < matrix_i[i + 1]; ii++) { k = j; - matrix_C_j[C_ii] = matrix_j[ii]*block_size + k; - matrix_C_data[C_ii] = matrix_data[ii*bnnz+j*block_size+k]; + matrix_C_j[C_ii] = matrix_j[ii] * block_size + k; + matrix_C_data[C_ii] = matrix_data[ii * bnnz + j * block_size + k]; C_ii++; - for(k = 0; k < block_size; k++) + for (k = 0; k < block_size; k++) { - if(j != k) + if (j != k) { - matrix_C_j[C_ii] = matrix_j[ii]*block_size + k; - matrix_C_data[C_ii] = matrix_data[ii*bnnz+j*block_size+k]; + matrix_C_j[C_ii] = matrix_j[ii] * block_size + k; + matrix_C_data[C_ii] = matrix_data[ii * bnnz + j * block_size + k]; C_ii++; } } @@ -251,7 +271,7 @@ hypre_CSRBlockMatrixConvertToCSRMatrix( hypre_CSRBlockMatrix *matrix ) *--------------------------------------------------------------------------*/ hypre_CSRBlockMatrix * -hypre_CSRBlockMatrixConvertFromCSRMatrix(hypre_CSRMatrix *matrix, +hypre_CSRBlockMatrixConvertFromCSRMatrix(hypre_CSRMatrix *matrix, HYPRE_Int matrix_C_block_size ) { HYPRE_Int num_rows = hypre_CSRMatrixNumRows(matrix); @@ -266,53 +286,53 @@ hypre_CSRBlockMatrixConvertFromCSRMatrix(hypre_CSRMatrix *matrix, HYPRE_Int matrix_C_num_rows, matrix_C_num_cols, matrix_C_num_nonzeros; HYPRE_Int i, j, ii, jj, s_jj, index, *counter; - matrix_C_num_rows = num_rows/matrix_C_block_size; - matrix_C_num_cols = num_cols/matrix_C_block_size; + matrix_C_num_rows = num_rows / matrix_C_block_size; + matrix_C_num_cols = num_cols / matrix_C_block_size; counter = hypre_CTAlloc(HYPRE_Int, matrix_C_num_cols, HYPRE_MEMORY_HOST); - for(i = 0; i < matrix_C_num_cols; i++) counter[i] = -1; + for (i = 0; i < matrix_C_num_cols; i++) { counter[i] = -1; } matrix_C_num_nonzeros = 0; - for(i = 0; i < matrix_C_num_rows; i++) + for (i = 0; i < matrix_C_num_rows; i++) { - for(j = 0; j < matrix_C_block_size; j++) + for (j = 0; j < matrix_C_block_size; j++) { - for(ii = matrix_i[i*matrix_C_block_size+j]; - ii < matrix_i[i*matrix_C_block_size+j+1]; ii++) + for (ii = matrix_i[i * matrix_C_block_size + j]; + ii < matrix_i[i * matrix_C_block_size + j + 1]; ii++) { - if(counter[matrix_j[ii]/matrix_C_block_size] < i) + if (counter[matrix_j[ii] / matrix_C_block_size] < i) { - counter[matrix_j[ii]/matrix_C_block_size] = i; + counter[matrix_j[ii] / matrix_C_block_size] = i; matrix_C_num_nonzeros++; } } } } - matrix_C = hypre_CSRBlockMatrixCreate(matrix_C_block_size, matrix_C_num_rows, - matrix_C_num_cols, matrix_C_num_nonzeros); + matrix_C = hypre_CSRBlockMatrixCreate(matrix_C_block_size, matrix_C_num_rows, + matrix_C_num_cols, matrix_C_num_nonzeros); hypre_CSRBlockMatrixInitialize(matrix_C); matrix_C_i = hypre_CSRBlockMatrixI(matrix_C); matrix_C_j = hypre_CSRBlockMatrixJ(matrix_C); matrix_C_data = hypre_CSRBlockMatrixData(matrix_C); - - for(i = 0; i < matrix_C_num_cols; i++) counter[i] = -1; + + for (i = 0; i < matrix_C_num_cols; i++) { counter[i] = -1; } jj = s_jj = 0; for (i = 0; i < matrix_C_num_rows; i++) { matrix_C_i[i] = jj; - for(j = 0; j < matrix_C_block_size; j++) + for (j = 0; j < matrix_C_block_size; j++) { - for(ii = matrix_i[i*matrix_C_block_size+j]; - ii < matrix_i[i*matrix_C_block_size+j+1]; ii++) + for (ii = matrix_i[i * matrix_C_block_size + j]; + ii < matrix_i[i * matrix_C_block_size + j + 1]; ii++) { - if(counter[matrix_j[ii]/matrix_C_block_size] < s_jj) + if (counter[matrix_j[ii] / matrix_C_block_size] < s_jj) { - counter[matrix_j[ii]/matrix_C_block_size] = jj; - matrix_C_j[jj] = matrix_j[ii]/matrix_C_block_size; + counter[matrix_j[ii] / matrix_C_block_size] = jj; + matrix_C_j[jj] = matrix_j[ii] / matrix_C_block_size; jj++; } - index = counter[matrix_j[ii]/matrix_C_block_size] * matrix_C_block_size * - matrix_C_block_size + j * matrix_C_block_size + - matrix_j[ii]%matrix_C_block_size; + index = counter[matrix_j[ii] / matrix_C_block_size] * matrix_C_block_size * + matrix_C_block_size + j * matrix_C_block_size + + matrix_j[ii] % matrix_C_block_size; matrix_C_data[index] = matrix_data[ii]; } } @@ -321,14 +341,14 @@ hypre_CSRBlockMatrixConvertFromCSRMatrix(hypre_CSRMatrix *matrix, matrix_C_i[matrix_C_num_rows] = matrix_C_num_nonzeros; hypre_TFree(counter, HYPRE_MEMORY_HOST); - + return matrix_C; } /*-------------------------------------------------------------------------- * hypre_CSRBlockMatrixBlockAdd - * (o = i1 + i2) + * (o = i1 + i2) *--------------------------------------------------------------------------*/ HYPRE_Int hypre_CSRBlockMatrixBlockAdd(HYPRE_Complex* i1, @@ -337,10 +357,12 @@ hypre_CSRBlockMatrixBlockAdd(HYPRE_Complex* i1, HYPRE_Int block_size) { HYPRE_Int i; - HYPRE_Int sz = block_size*block_size; - + HYPRE_Int sz = block_size * block_size; + for (i = 0; i < sz; i++) + { o[i] = i1[i] + i2[i]; + } return 0; } @@ -348,7 +370,7 @@ hypre_CSRBlockMatrixBlockAdd(HYPRE_Complex* i1, /*-------------------------------------------------------------------------- * hypre_CSRBlockMatrixBlockAddAccumulate - * (o = i1 + o) + * (o = i1 + o) *--------------------------------------------------------------------------*/ HYPRE_Int hypre_CSRBlockMatrixBlockAddAccumulate(HYPRE_Complex* i1, @@ -356,17 +378,19 @@ hypre_CSRBlockMatrixBlockAddAccumulate(HYPRE_Complex* i1, HYPRE_Int block_size) { HYPRE_Int i; - HYPRE_Int sz = block_size*block_size; - + HYPRE_Int sz = block_size * block_size; + for (i = 0; i < sz; i++) + { o[i] += i1[i]; + } return 0; } /*-------------------------------------------------------------------------- * hypre_CSRBlockMatrixBlockAddAccumulateDiag - * (diag(o) = diag(i1) + diag(o)) + * (diag(o) = diag(i1) + diag(o)) *--------------------------------------------------------------------------*/ HYPRE_Int hypre_CSRBlockMatrixBlockAddAccumulateDiag(HYPRE_Complex* i1, @@ -376,14 +400,16 @@ hypre_CSRBlockMatrixBlockAddAccumulateDiag(HYPRE_Complex* i1, HYPRE_Int i; for (i = 0; i < block_size; i++) - o[i*block_size+i] += i1[i*block_size+i]; + { + o[i * block_size + i] += i1[i * block_size + i]; + } return 0; } /*-------------------------------------------------------------------------- * hypre_CSRBlockMatrixBlockAddAccumulateDiagCheckSign * only add elements of sign*i1 that are negative (sign is size block_size) - * (diag(o) = diag(i1) + diag(o)) + * (diag(o) = diag(i1) + diag(o)) *--------------------------------------------------------------------------*/ HYPRE_Int hypre_CSRBlockMatrixBlockAddAccumulateDiagCheckSign(HYPRE_Complex* i1, @@ -396,18 +422,20 @@ hypre_CSRBlockMatrixBlockAddAccumulateDiagCheckSign(HYPRE_Complex* i1, for (i = 0; i < block_size; i++) { - tmp = (HYPRE_Real) i1[i*block_size+i]*sign[i]; - if (tmp < 0) - o[i*block_size+i] += i1[i*block_size+i]; + tmp = (HYPRE_Real) i1[i * block_size + i] * sign[i]; + if (tmp < 0) + { + o[i * block_size + i] += i1[i * block_size + i]; + } } - + return 0; } /*-------------------------------------------------------------------------- * hypre_CSRBlockMatrixComputeSign - * o = sign(diag(i1)) + * o = sign(diag(i1)) *--------------------------------------------------------------------------*/ HYPRE_Int hypre_CSRBlockMatrixComputeSign(HYPRE_Complex *i1, @@ -416,12 +444,16 @@ HYPRE_Int hypre_CSRBlockMatrixComputeSign(HYPRE_Complex *i1, { HYPRE_Int i; - for (i = 0; i < block_size; i++) + for (i = 0; i < block_size; i++) { - if ((HYPRE_Real) i1[i*block_size+i] < 0) + if ((HYPRE_Real) i1[i * block_size + i] < 0) + { o[i] = -1; + } else + { o[i] = 1; + } } return 0; @@ -430,7 +462,7 @@ HYPRE_Int hypre_CSRBlockMatrixComputeSign(HYPRE_Complex *i1, /*-------------------------------------------------------------------------- * hypre_CSRBlockMatrixBlockSetScalar - * (each entry in block o is set to beta ) + * (each entry in block o is set to beta ) *--------------------------------------------------------------------------*/ HYPRE_Int hypre_CSRBlockMatrixBlockSetScalar(HYPRE_Complex* o, @@ -438,10 +470,12 @@ hypre_CSRBlockMatrixBlockSetScalar(HYPRE_Complex* o, HYPRE_Int block_size) { HYPRE_Int i; - HYPRE_Int sz = block_size*block_size; - + HYPRE_Int sz = block_size * block_size; + for (i = 0; i < sz; i++) + { o[i] = beta; + } return 0; } @@ -449,7 +483,7 @@ hypre_CSRBlockMatrixBlockSetScalar(HYPRE_Complex* o, /*-------------------------------------------------------------------------- * hypre_CSRBlockMatrixBlockCopyData - * (o = beta*i1 ) + * (o = beta*i1 ) *--------------------------------------------------------------------------*/ HYPRE_Int hypre_CSRBlockMatrixBlockCopyData(HYPRE_Complex* i1, @@ -458,17 +492,19 @@ hypre_CSRBlockMatrixBlockCopyData(HYPRE_Complex* i1, HYPRE_Int block_size) { HYPRE_Int i; - HYPRE_Int sz = block_size*block_size; - + HYPRE_Int sz = block_size * block_size; + for (i = 0; i < sz; i++) - o[i] = beta*i1[i]; - + { + o[i] = beta * i1[i]; + } + return 0; } /*-------------------------------------------------------------------------- * hypre_CSRBlockMatrixBlockCopyDataDiag - zeros off-diag entries - * (o = beta*diag(i1)) + * (o = beta*diag(i1)) *--------------------------------------------------------------------------*/ HYPRE_Int hypre_CSRBlockMatrixBlockCopyDataDiag(HYPRE_Complex* i1, @@ -476,22 +512,26 @@ hypre_CSRBlockMatrixBlockCopyDataDiag(HYPRE_Complex* i1, HYPRE_Complex beta, HYPRE_Int block_size) { - HYPRE_Int i; + HYPRE_Int i; - HYPRE_Int sz = block_size*block_size; - - for (i = 0; i < sz; i++) - o[i] = 0.0; + HYPRE_Int sz = block_size * block_size; - for (i = 0; i < block_size; i++) - o[i*block_size+i] = beta*i1[i*block_size+i]; + for (i = 0; i < sz; i++) + { + o[i] = 0.0; + } + + for (i = 0; i < block_size; i++) + { + o[i * block_size + i] = beta * i1[i * block_size + i]; + } return 0; } /*-------------------------------------------------------------------------- * hypre_CSRBlockMatrixBlockTranspose - * (o = i1' ) + * (o = i1' ) *--------------------------------------------------------------------------*/ HYPRE_Int hypre_CSRBlockMatrixBlockTranspose(HYPRE_Complex* i1, @@ -502,31 +542,34 @@ hypre_CSRBlockMatrixBlockTranspose(HYPRE_Complex* i1, for (i = 0; i < block_size; i++) for (j = 0; j < block_size; j++) - o[i*block_size+j] = i1[j*block_size+i]; + { + o[i * block_size + j] = i1[j * block_size + i]; + } return 0; } /*-------------------------------------------------------------------------- * hypre_CSRBlockMatrixBlockNorm - * (out = norm(data) ) + * (out = norm(data) ) * * (note: these are not all actually "norms") - * + * *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_CSRBlockMatrixBlockNorm(HYPRE_Int norm_type, HYPRE_Complex* data, HYPRE_Real* out, HYPRE_Int block_size) +hypre_CSRBlockMatrixBlockNorm(HYPRE_Int norm_type, HYPRE_Complex* data, HYPRE_Real* out, + HYPRE_Int block_size) { HYPRE_Int ierr = 0; - HYPRE_Int i,j; + HYPRE_Int i, j; HYPRE_Real sum = 0.0; HYPRE_Real *totals; - HYPRE_Int sz = block_size*block_size; + HYPRE_Int sz = block_size * block_size; switch (norm_type) { case 6: /* sum of all elements in the block */ { - for(i = 0; i < sz; i++) + for (i = 0; i < sz; i++) { sum += (HYPRE_Real)(data[i]); } @@ -534,65 +577,65 @@ hypre_CSRBlockMatrixBlockNorm(HYPRE_Int norm_type, HYPRE_Complex* data, HYPRE_Re } case 5: /* one norm - max col sum*/ { - + totals = hypre_CTAlloc(HYPRE_Real, block_size, HYPRE_MEMORY_HOST); - for(i = 0; i < block_size; i++) /* row */ + for (i = 0; i < block_size; i++) /* row */ { - for(j = 0; j < block_size; j++) /* col */ + for (j = 0; j < block_size; j++) /* col */ { - totals[j] += hypre_cabs(data[i*block_size + j]); + totals[j] += hypre_cabs(data[i * block_size + j]); } } sum = totals[0]; - for(j = 1; j < block_size; j++) /* col */ + for (j = 1; j < block_size; j++) /* col */ { - if (totals[j] > sum) sum = totals[j]; + if (totals[j] > sum) { sum = totals[j]; } } hypre_TFree(totals, HYPRE_MEMORY_HOST); - + break; - + } case 4: /* inf norm - max row sum */ { - + totals = hypre_CTAlloc(HYPRE_Real, block_size, HYPRE_MEMORY_HOST); - for(i = 0; i < block_size; i++) /* row */ + for (i = 0; i < block_size; i++) /* row */ { - for(j = 0; j < block_size; j++) /* col */ + for (j = 0; j < block_size; j++) /* col */ { - totals[i] += hypre_cabs(data[i*block_size + j]); + totals[i] += hypre_cabs(data[i * block_size + j]); } } sum = totals[0]; - for(i = 1; i < block_size; i++) /* row */ + for (i = 1; i < block_size; i++) /* row */ { - if (totals[i] > sum) sum = totals[i]; + if (totals[i] > sum) { sum = totals[i]; } } hypre_TFree(totals, HYPRE_MEMORY_HOST); - + break; } case 3: /* largest element of block (return value includes sign) */ { - + sum = (HYPRE_Real)data[0]; - - for(i = 0; i < sz; i++) + + for (i = 0; i < sz; i++) { - if (hypre_cabs(data[i]) > hypre_cabs(sum)) sum = (HYPRE_Real)data[i]; + if (hypre_cabs(data[i]) > hypre_cabs(sum)) { sum = (HYPRE_Real)data[i]; } } - + break; } case 2: /* sum of abs values of all elements in the block */ { - for(i = 0; i < sz; i++) + for (i = 0; i < sz; i++) { - sum += hypre_cabs(data[i]); + sum += hypre_cabs(data[i]); } break; } @@ -600,27 +643,27 @@ hypre_CSRBlockMatrixBlockNorm(HYPRE_Int norm_type, HYPRE_Complex* data, HYPRE_Re default: /* 1 = frobenius*/ { - for(i = 0; i < sz; i++) - { - sum += ((HYPRE_Real)data[i])*((HYPRE_Real)data[i]); - } - sum = sqrt(sum); + for (i = 0; i < sz; i++) + { + sum += ((HYPRE_Real)data[i]) * ((HYPRE_Real)data[i]); + } + sum = hypre_sqrt(sum); } } - + *out = sum; - + return ierr; } /*-------------------------------------------------------------------------- * hypre_CSRBlockMatrixBlockMultAdd - * (o = i1 * i2 + beta * o) + * (o = i1 * i2 + beta * o) *--------------------------------------------------------------------------*/ HYPRE_Int hypre_CSRBlockMatrixBlockMultAdd(HYPRE_Complex* i1, HYPRE_Complex* i2, - HYPRE_Complex beta, + HYPRE_Complex beta, HYPRE_Complex* o, HYPRE_Int block_size) { @@ -628,8 +671,8 @@ hypre_CSRBlockMatrixBlockMultAdd(HYPRE_Complex* i1, #if LB_VERSION { HYPRE_Complex alp = 1.0; - dgemm_("N","N", &block_size, &block_size, &block_size, &alp, i2, &block_size, i1, - &block_size, &beta, o, &block_size); + dgemm_("N", "N", &block_size, &block_size, &block_size, &alp, i2, &block_size, i1, + &block_size, &beta, o, &block_size); } #else { @@ -645,40 +688,44 @@ hypre_CSRBlockMatrixBlockMultAdd(HYPRE_Complex* i1, ddata = 0.0; for (k = 0; k < block_size; k++) { - ddata += i1[i*block_size + k] * i2[k*block_size + j]; + ddata += i1[i * block_size + k] * i2[k * block_size + j]; } - o[i*block_size + j] = ddata; + o[i * block_size + j] = ddata; } } } else if (beta == 1.0) { - for(i = 0; i < block_size; i++) + for (i = 0; i < block_size; i++) { - for(j = 0; j < block_size; j++) + for (j = 0; j < block_size; j++) { - ddata = o[i*block_size + j]; - for(k = 0; k < block_size; k++) - ddata += i1[i*block_size + k] * i2[k*block_size + j]; - o[i*block_size + j] = ddata; + ddata = o[i * block_size + j]; + for (k = 0; k < block_size; k++) + { + ddata += i1[i * block_size + k] * i2[k * block_size + j]; + } + o[i * block_size + j] = ddata; } } } else { - for(i = 0; i < block_size; i++) + for (i = 0; i < block_size; i++) { - for(j = 0; j < block_size; j++) + for (j = 0; j < block_size; j++) { - ddata = beta * o[i*block_size + j]; - for(k = 0; k < block_size; k++) - ddata += i1[i*block_size + k] * i2[k*block_size + j]; - o[i*block_size + j] = ddata; + ddata = beta * o[i * block_size + j]; + for (k = 0; k < block_size; k++) + { + ddata += i1[i * block_size + k] * i2[k * block_size + j]; + } + o[i * block_size + j] = ddata; } } } } - + #endif return 0; @@ -687,12 +734,12 @@ hypre_CSRBlockMatrixBlockMultAdd(HYPRE_Complex* i1, /*-------------------------------------------------------------------------- * hypre_CSRBlockMatrixBlockMultAddDiag - * (diag(o) = diag(i1) * diag(i2) + beta * diag(o)) + * (diag(o) = diag(i1) * diag(i2) + beta * diag(o)) *--------------------------------------------------------------------------*/ HYPRE_Int hypre_CSRBlockMatrixBlockMultAddDiag(HYPRE_Complex* i1, HYPRE_Complex* i2, - HYPRE_Complex beta, + HYPRE_Complex beta, HYPRE_Complex* o, HYPRE_Int block_size) { @@ -702,21 +749,22 @@ hypre_CSRBlockMatrixBlockMultAddDiag(HYPRE_Complex* i1, { for (i = 0; i < block_size; i++) { - o[i*block_size + i] = i1[i*block_size + i] * i2[i*block_size + i]; + o[i * block_size + i] = i1[i * block_size + i] * i2[i * block_size + i]; } } else if (beta == 1.0) { - for(i = 0; i < block_size; i++) + for (i = 0; i < block_size; i++) { - o[i*block_size + i] = o[i*block_size + i] + i1[i*block_size + i] * i2[i*block_size + i]; + o[i * block_size + i] = o[i * block_size + i] + i1[i * block_size + i] * i2[i * block_size + i]; } } else { - for(i = 0; i < block_size; i++) + for (i = 0; i < block_size; i++) { - o[i*block_size + i] = beta* o[i*block_size + i] + i1[i*block_size + i] * i2[i*block_size + i]; + o[i * block_size + i] = beta * o[i * block_size + i] + i1[i * block_size + i] * i2[i * block_size + + i]; } } return 0; @@ -724,14 +772,14 @@ hypre_CSRBlockMatrixBlockMultAddDiag(HYPRE_Complex* i1, /*-------------------------------------------------------------------------- * hypre_CSRBlockMatrixBlockMultAddDiagCheckSign - * + * * only mult elements if sign*diag(i2) is negative - *(diag(o) = diag(i1) * diag(i2) + beta * diag(o)) + *(diag(o) = diag(i1) * diag(i2) + beta * diag(o)) *--------------------------------------------------------------------------*/ HYPRE_Int hypre_CSRBlockMatrixBlockMultAddDiagCheckSign(HYPRE_Complex *i1, HYPRE_Complex *i2, - HYPRE_Complex beta, + HYPRE_Complex beta, HYPRE_Complex *o, HYPRE_Int block_size, HYPRE_Real *sign) @@ -743,27 +791,34 @@ hypre_CSRBlockMatrixBlockMultAddDiagCheckSign(HYPRE_Complex *i1, { for (i = 0; i < block_size; i++) { - tmp = (HYPRE_Real) i2[i*block_size+i]*sign[i]; + tmp = (HYPRE_Real) i2[i * block_size + i] * sign[i]; if (tmp < 0) - o[i*block_size + i] = i1[i*block_size + i] * i2[i*block_size + i]; + { + o[i * block_size + i] = i1[i * block_size + i] * i2[i * block_size + i]; + } } } else if (beta == 1.0) { - for(i = 0; i < block_size; i++) + for (i = 0; i < block_size; i++) { - tmp = (HYPRE_Real) i2[i*block_size+i]*sign[i]; + tmp = (HYPRE_Real) i2[i * block_size + i] * sign[i]; if (tmp < 0) - o[i*block_size + i] = o[i*block_size + i] + i1[i*block_size + i] * i2[i*block_size + i]; + { + o[i * block_size + i] = o[i * block_size + i] + i1[i * block_size + i] * i2[i * block_size + i]; + } } } else { - for(i = 0; i < block_size; i++) + for (i = 0; i < block_size; i++) { - tmp = i2[i*block_size+i]*sign[i]; + tmp = i2[i * block_size + i] * sign[i]; if (tmp < 0) - o[i*block_size + i] = beta* o[i*block_size + i] + i1[i*block_size + i] * i2[i*block_size + i]; + { + o[i * block_size + i] = beta * o[i * block_size + i] + i1[i * block_size + i] * i2[i * block_size + + i]; + } } } return 0; @@ -771,12 +826,12 @@ hypre_CSRBlockMatrixBlockMultAddDiagCheckSign(HYPRE_Complex *i1, /*-------------------------------------------------------------------------- * hypre_CSRBlockMatrixBlockMultAddDiag2 (scales cols of il by diag of i2) - * ((o) = (i1) * diag(i2) + beta * (o)) + * ((o) = (i1) * diag(i2) + beta * (o)) *--------------------------------------------------------------------------*/ HYPRE_Int hypre_CSRBlockMatrixBlockMultAddDiag2(HYPRE_Complex* i1, HYPRE_Complex* i2, - HYPRE_Complex beta, + HYPRE_Complex beta, HYPRE_Complex* o, HYPRE_Int block_size) { @@ -788,8 +843,8 @@ hypre_CSRBlockMatrixBlockMultAddDiag2(HYPRE_Complex* i1, { for (j = 0; j < block_size; j++) { - o[i*block_size + j] = i1[i*block_size + j] * i2[j*block_size + j]; - + o[i * block_size + j] = i1[i * block_size + j] * i2[j * block_size + j]; + } } } @@ -799,8 +854,8 @@ hypre_CSRBlockMatrixBlockMultAddDiag2(HYPRE_Complex* i1, { for (j = 0; j < block_size; j++) { - o[i*block_size + j] = o[i*block_size + j] + i1[i*block_size + j] * i2[j*block_size + j]; - + o[i * block_size + j] = o[i * block_size + j] + i1[i * block_size + j] * i2[j * block_size + j]; + } } @@ -808,12 +863,13 @@ hypre_CSRBlockMatrixBlockMultAddDiag2(HYPRE_Complex* i1, } else { - for (i = 0; i < block_size; i++) + for (i = 0; i < block_size; i++) { for (j = 0; j < block_size; j++) { - o[i*block_size + j] = beta * o[i*block_size + j] + i1[i*block_size + j] * i2[j*block_size + j]; - + o[i * block_size + j] = beta * o[i * block_size + j] + i1[i * block_size + j] * i2[j * block_size + + j]; + } } } @@ -821,14 +877,14 @@ hypre_CSRBlockMatrixBlockMultAddDiag2(HYPRE_Complex* i1, } /*-------------------------------------------------------------------------- - * hypre_CSRBlockMatrixBlockMultAddDiag3 (scales cols of il by i2 - + * hypre_CSRBlockMatrixBlockMultAddDiag3 (scales cols of il by i2 - whose diag elements are row sums) - * ((o) = (i1) * diag(i2) + beta * (o)) + * ((o) = (i1) * diag(i2) + beta * (o)) *--------------------------------------------------------------------------*/ HYPRE_Int hypre_CSRBlockMatrixBlockMultAddDiag3(HYPRE_Complex* i1, HYPRE_Complex* i2, - HYPRE_Complex beta, + HYPRE_Complex beta, HYPRE_Complex* o, HYPRE_Int block_size) { @@ -838,21 +894,21 @@ hypre_CSRBlockMatrixBlockMultAddDiag3(HYPRE_Complex* i1, row_sum = hypre_CTAlloc(HYPRE_Complex, block_size, HYPRE_MEMORY_HOST); for (i = 0; i < block_size; i++) + { + for (j = 0; j < block_size; j++) { - for (j = 0; j < block_size; j++) - { - row_sum[i] += i2[i*block_size + j]; - } + row_sum[i] += i2[i * block_size + j]; } - + } + if (beta == 0.0) { for (i = 0; i < block_size; i++) { for (j = 0; j < block_size; j++) { - o[i*block_size + j] = i1[i*block_size + j] * row_sum[j]; - + o[i * block_size + j] = i1[i * block_size + j] * row_sum[j]; + } } } @@ -862,39 +918,39 @@ hypre_CSRBlockMatrixBlockMultAddDiag3(HYPRE_Complex* i1, { for (j = 0; j < block_size; j++) { - o[i*block_size + j] = o[i*block_size + j] + i1[i*block_size + j] * row_sum[j]; - + o[i * block_size + j] = o[i * block_size + j] + i1[i * block_size + j] * row_sum[j]; + } } } else { - for (i = 0; i < block_size; i++) + for (i = 0; i < block_size; i++) { for (j = 0; j < block_size; j++) { - o[i*block_size + j] = beta * o[i*block_size + j] + i1[i*block_size + j] * row_sum[j]; - + o[i * block_size + j] = beta * o[i * block_size + j] + i1[i * block_size + j] * row_sum[j]; + } } } hypre_TFree(row_sum, HYPRE_MEMORY_HOST); - + return 0; } /*-------------------------------------------------------------------------- * hypre_CSRBlockMatrixBlockMatvec * (ov = alpha* mat * v + beta * ov) - * mat is the matrix - size is block_size^2 + * mat is the matrix - size is block_size^2 * alpha and beta are scalars *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int hypre_CSRBlockMatrixBlockMatvec(HYPRE_Complex alpha, HYPRE_Complex* mat, HYPRE_Complex* v, - HYPRE_Complex beta, + HYPRE_Complex beta, HYPRE_Complex* ov, HYPRE_Int block_size) { @@ -907,7 +963,7 @@ hypre_CSRBlockMatrixBlockMatvec(HYPRE_Complex alpha, dgemv_("T", &block_size, &block_size, &alpha, mat, &block_size, v, &one, &beta, ov, &one); } - + #else { HYPRE_Int i, j; @@ -922,7 +978,7 @@ hypre_CSRBlockMatrixBlockMatvec(HYPRE_Complex alpha, } return ierr; } - + /* ov = (beta/alpha) * ov; */ ddata = beta / alpha; if (ddata != 1.0) @@ -934,7 +990,7 @@ hypre_CSRBlockMatrixBlockMatvec(HYPRE_Complex alpha, ov[j] = 0.0; } } - else + else { for (j = 0; j < block_size; j++) { @@ -942,18 +998,18 @@ hypre_CSRBlockMatrixBlockMatvec(HYPRE_Complex alpha, } } } - + /* ov = ov + mat*v */ for (i = 0; i < block_size; i++) { ddata = ov[i]; for (j = 0; j < block_size; j++) { - ddata += mat[i*block_size + j] * v[j]; + ddata += mat[i * block_size + j] * v[j]; } ov[i] = ddata; } - + /* ov = alpha*ov */ if (alpha != 1.0) { @@ -963,28 +1019,28 @@ hypre_CSRBlockMatrixBlockMatvec(HYPRE_Complex alpha, } } } - + #endif return ierr; - + } /*-------------------------------------------------------------------------- * hypre_CSRBlockMatrixBlockInvMatvec - * (ov = mat^{-1} * v) + * (ov = mat^{-1} * v) * o and v are vectors - * mat is the matrix - size is block_size^2 + * mat is the matrix - size is block_size^2 *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_CSRBlockMatrixBlockInvMatvec(HYPRE_Complex* mat, HYPRE_Complex* v, +hypre_CSRBlockMatrixBlockInvMatvec(HYPRE_Complex* mat, HYPRE_Complex* v, HYPRE_Complex* ov, HYPRE_Int block_size) { HYPRE_Int ierr = 0; HYPRE_Complex *mat_i; - mat_i = hypre_CTAlloc(HYPRE_Complex, block_size*block_size, HYPRE_MEMORY_HOST); + mat_i = hypre_CTAlloc(HYPRE_Complex, block_size * block_size, HYPRE_MEMORY_HOST); #if LB_VERSION { @@ -992,41 +1048,41 @@ hypre_CSRBlockMatrixBlockInvMatvec(HYPRE_Complex* mat, HYPRE_Complex* v, HYPRE_Int one, info; HYPRE_Int *piv; HYPRE_Int sz; - - + + one = 1; piv = hypre_CTAlloc(HYPRE_Int, block_size, HYPRE_MEMORY_HOST); - sz = block_size*block_size; - + sz = block_size * block_size; - /* copy v to ov and mat to mat_i*/ + + /* copy v to ov and mat to mat_i*/ dcopy_(&sz, mat, &one, mat_i, &one); dcopy_(&block_size, v, &one, ov, &one); - + /* writes over mat_i with LU */ - dgetrf_(&block_size,&block_size, mat_i, &block_size, piv , &info); - if (info) + dgetrf_(&block_size, &block_size, mat_i, &block_size, piv, &info); + if (info) { hypre_TFree(mat_i, HYPRE_MEMORY_HOST); hypre_TFree(piv, HYPRE_MEMORY_HOST); - return(-1); + return (-1); } - + /* writes over ov */ - dgetrs_("T", &block_size, &one , - mat_i, &block_size, piv, ov, &block_size, &info); - if (info) + dgetrs_("T", &block_size, &one, + mat_i, &block_size, piv, ov, &block_size, &info); + if (info) { hypre_TFree(mat_i, HYPRE_MEMORY_HOST); hypre_TFree(piv, HYPRE_MEMORY_HOST); - return(-1); + return (-1); } hypre_TFree(piv, HYPRE_MEMORY_HOST); } - + #else { HYPRE_Int m, j, k; @@ -1035,78 +1091,78 @@ hypre_CSRBlockMatrixBlockInvMatvec(HYPRE_Complex* mat, HYPRE_Complex* v, HYPRE_Complex factor; HYPRE_Complex piv, tmp; eps = 1.0e-6; - - if (block_size ==1 ) + + if (block_size == 1 ) { if (hypre_cabs(mat[0]) > 1e-10) { - ov[0] = v[0]/mat[0]; + ov[0] = v[0] / mat[0]; hypre_TFree(mat_i, HYPRE_MEMORY_HOST); - return(ierr); + return (ierr); } else { /* hypre_printf("GE zero pivot error\n"); */ hypre_TFree(mat_i, HYPRE_MEMORY_HOST); - return(-1); + return (-1); } } else { /* copy v to ov and mat to mat_i*/ - for (k = 0; k < block_size; k++) + for (k = 0; k < block_size; k++) { ov[k] = v[k]; - for (j=0; j hypre_cabs(piv)) + if (hypre_cabs(mat_i[j * block_size + k]) > hypre_cabs(piv)) { - piv = mat_i[j*block_size+k]; + piv = mat_i[j * block_size + k]; piv_row = j; } - + } - if (piv_row !=k) /* do a row exchange - rows k and piv_row*/ + if (piv_row != k) /* do a row exchange - rows k and piv_row*/ { - for (j=0; j < block_size; j++) + for (j = 0; j < block_size; j++) { - tmp = mat_i[k*block_size + j]; - mat_i[k*block_size + j] = mat_i[piv_row*block_size + j]; - mat_i[piv_row*block_size + j] = tmp; + tmp = mat_i[k * block_size + j]; + mat_i[k * block_size + j] = mat_i[piv_row * block_size + j]; + mat_i[piv_row * block_size + j] = tmp; } tmp = ov[k]; ov[k] = ov[piv_row]; ov[piv_row] = tmp; } /* end of pivoting */ - + if (hypre_cabs(piv) > eps) { /* now we can factor into U */ - for (j = k+1; j < block_size; j++) + for (j = k + 1; j < block_size; j++) { - factor = mat_i[j*block_size+k]/piv; - for (m = k+1; m < block_size; m++) + factor = mat_i[j * block_size + k] / piv; + for (m = k + 1; m < block_size; m++) { - mat_i[j*block_size+m] -= factor * mat_i[k*block_size+m]; + mat_i[j * block_size + m] -= factor * mat_i[k * block_size + m]; } - /* Elimination step for rhs */ + /* Elimination step for rhs */ ov[j] -= factor * ov[k]; } } @@ -1114,41 +1170,41 @@ hypre_CSRBlockMatrixBlockInvMatvec(HYPRE_Complex* mat, HYPRE_Complex* v, { /* hypre_printf("Block of matrix is nearly singular: zero pivot error\n"); */ hypre_TFree(mat_i, HYPRE_MEMORY_HOST); - return(-1); + return (-1); } } - /* we also need to check the pivot in the last row to see if it is zero */ + /* we also need to check the pivot in the last row to see if it is zero */ k = block_size - 1; /* last row */ - if ( hypre_cabs(mat_i[k*block_size+k]) < eps) + if ( hypre_cabs(mat_i[k * block_size + k]) < eps) { /* hypre_printf("Block of matrix is nearly singular: zero pivot error\n"); */ hypre_TFree(mat_i, HYPRE_MEMORY_HOST); - return(-1); + return (-1); } - + /* Back Substitution - do rhs (U is now in m_i1)*/ - for (k = block_size-1; k > 0; --k) + for (k = block_size - 1; k > 0; --k) { - ov[k] /= mat_i[k*block_size+k]; + ov[k] /= mat_i[k * block_size + k]; for (j = 0; j < k; j++) { - if (mat_i[j*block_size+k] != 0.0) + if (mat_i[j * block_size + k] != 0.0) { - ov[j] -= ov[k] * mat_i[j*block_size+k]; + ov[j] -= ov[k] * mat_i[j * block_size + k]; } } } ov[0] /= mat_i[0]; - + } - + } #endif - + hypre_TFree(mat_i, HYPRE_MEMORY_HOST); - + return (ierr); } @@ -1156,17 +1212,18 @@ hypre_CSRBlockMatrixBlockInvMatvec(HYPRE_Complex* mat, HYPRE_Complex* v, /*-------------------------------------------------------------------------- * hypre_CSRBlockMatrixBlockInvMult - * (o = i1^{-1} * i2) + * (o = i1^{-1} * i2) *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_CSRBlockMatrixBlockInvMult(HYPRE_Complex* i1, HYPRE_Complex* i2, HYPRE_Complex* o, HYPRE_Int block_size) +hypre_CSRBlockMatrixBlockInvMult(HYPRE_Complex* i1, HYPRE_Complex* i2, HYPRE_Complex* o, + HYPRE_Int block_size) { HYPRE_Int ierr = 0; HYPRE_Int i, j; HYPRE_Complex *m_i1; - m_i1 = hypre_CTAlloc(HYPRE_Complex, block_size*block_size, HYPRE_MEMORY_HOST); + m_i1 = hypre_CTAlloc(HYPRE_Complex, block_size * block_size, HYPRE_MEMORY_HOST); #if LB_VERSION { @@ -1174,63 +1231,63 @@ hypre_CSRBlockMatrixBlockInvMult(HYPRE_Complex* i1, HYPRE_Complex* i2, HYPRE_Com HYPRE_Int one, info; HYPRE_Int *piv; HYPRE_Int sz; - + HYPRE_Complex *i2_t; one = 1; - i2_t = hypre_CTAlloc(HYPRE_Complex, block_size*block_size, HYPRE_MEMORY_HOST); + i2_t = hypre_CTAlloc(HYPRE_Complex, block_size * block_size, HYPRE_MEMORY_HOST); piv = hypre_CTAlloc(HYPRE_Int, block_size, HYPRE_MEMORY_HOST); - - /* copy i1 to m_i1*/ - sz = block_size*block_size; + + /* copy i1 to m_i1*/ + sz = block_size * block_size; dcopy_(&sz, i1, &one, m_i1, &one); /* writes over m_i1 with LU */ - dgetrf_(&block_size, &block_size, m_i1, &block_size, piv , &info); - if (info) + dgetrf_(&block_size, &block_size, m_i1, &block_size, piv, &info); + if (info) { hypre_TFree(m_i1, HYPRE_MEMORY_HOST); hypre_TFree(i2_t, HYPRE_MEMORY_HOST); hypre_TFree(piv, HYPRE_MEMORY_HOST); return (-1); } - + /* need the transpose of i_2*/ - for (i=0; i < block_size; i++) - { - for (j=0; j< block_size; j++) - { - i2_t[i*block_size+j] = i2[j*block_size+i]; - } - } - + for (i = 0; i < block_size; i++) + { + for (j = 0; j < block_size; j++) + { + i2_t[i * block_size + j] = i2[j * block_size + i]; + } + } + /* writes over i2_t */ - dgetrs_("T", &block_size, &block_size, - m_i1, &block_size, piv, i2_t, &block_size, &info); - if (info) + dgetrs_("T", &block_size, &block_size, + m_i1, &block_size, piv, i2_t, &block_size, &info); + if (info) { hypre_TFree(m_i1, HYPRE_MEMORY_HOST); hypre_TFree(i2_t, HYPRE_MEMORY_HOST); hypre_TFree(piv, HYPRE_MEMORY_HOST); return (-1); } - + /* ans. is the transpose of i2_t*/ - for (i=0; i < block_size; i++) + for (i = 0; i < block_size; i++) { - for (j=0; j< block_size; j++) + for (j = 0; j < block_size; j++) { - o[i*block_size+j] = i2_t[j*block_size+i]; + o[i * block_size + j] = i2_t[j * block_size + i]; } } - + hypre_TFree(i2_t, HYPRE_MEMORY_HOST); hypre_TFree(piv, HYPRE_MEMORY_HOST); - + } - + #else { HYPRE_Int m, k; @@ -1238,87 +1295,87 @@ hypre_CSRBlockMatrixBlockInvMult(HYPRE_Complex* i1, HYPRE_Complex* i2, HYPRE_Com HYPRE_Real eps; HYPRE_Complex factor; HYPRE_Complex piv, tmp; - + eps = 1.0e-6; - - if (block_size ==1 ) + + if (block_size == 1 ) { if (hypre_cabs(m_i1[0]) > 1e-10) { - o[0] = i2[0]/i1[0]; + o[0] = i2[0] / i1[0]; hypre_TFree(m_i1, HYPRE_MEMORY_HOST); - return(ierr); + return (ierr); } else { /* hypre_printf("GE zero pivot error\n"); */ hypre_TFree(m_i1, HYPRE_MEMORY_HOST); - return(-1); + return (-1); } } else { /* copy i2 to o and i1 to m_i1*/ - for (k = 0; k < block_size*block_size; k++) + for (k = 0; k < block_size * block_size; k++) { o[k] = i2[k]; m_i1[k] = i1[k]; } - - - /* start ge - turning m_i1 into U factor (don't save L - just apply to + + + /* start ge - turning m_i1 into U factor (don't save L - just apply to rhs - which is o)*/ /* we do partial pivoting for size */ - - /* loop through the rows (row k) */ - for (k = 0; k < block_size-1; k++) + + /* loop through the rows (row k) */ + for (k = 0; k < block_size - 1; k++) { - piv = m_i1[k*block_size+k]; + piv = m_i1[k * block_size + k]; piv_row = k; - + /* find the largest pivot in position k*/ - for (j=k+1; j < block_size; j++) + for (j = k + 1; j < block_size; j++) { - if (hypre_cabs(m_i1[j*block_size+k]) > hypre_cabs(piv)) + if (hypre_cabs(m_i1[j * block_size + k]) > hypre_cabs(piv)) { - piv = m_i1[j*block_size+k]; + piv = m_i1[j * block_size + k]; piv_row = j; } - + } - if (piv_row !=k) /* do a row exchange - rows k and piv_row*/ + if (piv_row != k) /* do a row exchange - rows k and piv_row*/ { - for (j=0; j < block_size; j++) + for (j = 0; j < block_size; j++) { - tmp = m_i1[k*block_size + j]; - m_i1[k*block_size + j] = m_i1[piv_row*block_size + j]; - m_i1[piv_row*block_size + j] = tmp; - - tmp = o[k*block_size + j]; - o[k*block_size + j] = o[piv_row*block_size + j]; - o[piv_row*block_size + j] = tmp; - + tmp = m_i1[k * block_size + j]; + m_i1[k * block_size + j] = m_i1[piv_row * block_size + j]; + m_i1[piv_row * block_size + j] = tmp; + + tmp = o[k * block_size + j]; + o[k * block_size + j] = o[piv_row * block_size + j]; + o[piv_row * block_size + j] = tmp; + } } /* end of pivoting */ - - + + if (hypre_cabs(piv) > eps) { /* now we can factor into U */ - for (j = k+1; j < block_size; j++) + for (j = k + 1; j < block_size; j++) { - factor = m_i1[j*block_size+k]/piv; - for (m = k+1; m < block_size; m++) + factor = m_i1[j * block_size + k] / piv; + for (m = k + 1; m < block_size; m++) { - m_i1[j*block_size+m] -= factor * m_i1[k*block_size+m]; + m_i1[j * block_size + m] -= factor * m_i1[k * block_size + m]; } - /* Elimination step for rhs */ + /* Elimination step for rhs */ /* do for each of the "rhs" */ - for (i=0; i < block_size; i++) + for (i = 0; i < block_size; i++) { - /* o(row, col) = o(row*block_size + col) */ - o[j*block_size+i] -= factor * o[k*block_size + i]; + /* o(row, col) = o(row*block_size + col) */ + o[j * block_size + i] -= factor * o[k * block_size + i]; } } } @@ -1326,90 +1383,91 @@ hypre_CSRBlockMatrixBlockInvMult(HYPRE_Complex* i1, HYPRE_Complex* i2, HYPRE_Com { /* hypre_printf("Block of matrix is nearly singular: zero pivot error\n"); */ hypre_TFree(m_i1, HYPRE_MEMORY_HOST); - return(-1); + return (-1); } } - /* we also need to check the pivot in the last row to see if it is zero */ + /* we also need to check the pivot in the last row to see if it is zero */ k = block_size - 1; /* last row */ - if ( hypre_cabs(m_i1[k*block_size+k]) < eps) + if ( hypre_cabs(m_i1[k * block_size + k]) < eps) { /* hypre_printf("Block of matrix is nearly singular: zero pivot error\n"); */ hypre_TFree(m_i1, HYPRE_MEMORY_HOST); - return(-1); + return (-1); } - - + + /* Back Substitution - do for each "rhs" (U is now in m_i1)*/ - for (i=0; i < block_size; i++) + for (i = 0; i < block_size; i++) { - for (k = block_size-1; k > 0; --k) + for (k = block_size - 1; k > 0; --k) { - o[k*block_size + i] /= m_i1[k*block_size+k]; + o[k * block_size + i] /= m_i1[k * block_size + k]; for (j = 0; j < k; j++) { - if (m_i1[j*block_size+k] != 0.0) + if (m_i1[j * block_size + k] != 0.0) { - o[j*block_size + i] -= o[k*block_size + i] * m_i1[j*block_size+k]; + o[j * block_size + i] -= o[k * block_size + i] * m_i1[j * block_size + k]; } } } - o[0*block_size + i] /= m_i1[0]; + o[0 * block_size + i] /= m_i1[0]; } } } - + #endif hypre_TFree(m_i1, HYPRE_MEMORY_HOST); - + return ierr; } /*-------------------------------------------------------------------------- * hypre_CSRBlockMatrixBlockMultInv - * (o = i2*il^(-1)) + * (o = i2*il^(-1)) *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_CSRBlockMatrixBlockMultInv(HYPRE_Complex* i1, HYPRE_Complex* i2, HYPRE_Complex* o, HYPRE_Int block_size) +hypre_CSRBlockMatrixBlockMultInv(HYPRE_Complex* i1, HYPRE_Complex* i2, HYPRE_Complex* o, + HYPRE_Int block_size) { HYPRE_Int ierr = 0; - - + + #if LB_VERSION - + { - /* same as solving A^T C^T = B^T */ + /* same as solving A^T C^T = B^T */ HYPRE_Complex *m_i1; HYPRE_Int info; HYPRE_Int *piv; HYPRE_Int sz, one; - + piv = hypre_CTAlloc(HYPRE_Int, block_size, HYPRE_MEMORY_HOST); - m_i1 = hypre_CTAlloc(HYPRE_Complex, block_size*block_size, HYPRE_MEMORY_HOST); + m_i1 = hypre_CTAlloc(HYPRE_Complex, block_size * block_size, HYPRE_MEMORY_HOST); one = 1; - sz = block_size*block_size; + sz = block_size * block_size; - /* copy i1 to m_i1 and i2 to o*/ + /* copy i1 to m_i1 and i2 to o*/ dcopy_(&sz, i1, &one, m_i1, &one); dcopy_(&sz, i2, &one, o, &one); /* writes over m_i1 with LU */ - dgetrf_(&block_size, &block_size, m_i1, &block_size, piv , &info); - if (info) + dgetrf_(&block_size, &block_size, m_i1, &block_size, piv, &info); + if (info) { hypre_TFree(m_i1, HYPRE_MEMORY_HOST); hypre_TFree(piv, HYPRE_MEMORY_HOST); return (-1); } - /* writes over B */ - dgetrs_("N", &block_size, &block_size, - m_i1, &block_size, piv, o, &block_size, &info); - if (info) + /* writes over B */ + dgetrs_("N", &block_size, &block_size, + m_i1, &block_size, piv, o, &block_size, &info); + if (info) { hypre_TFree(m_i1, HYPRE_MEMORY_HOST); hypre_TFree(piv, HYPRE_MEMORY_HOST); @@ -1419,49 +1477,49 @@ hypre_CSRBlockMatrixBlockMultInv(HYPRE_Complex* i1, HYPRE_Complex* i2, HYPRE_Com hypre_TFree(m_i1, HYPRE_MEMORY_HOST); hypre_TFree(piv, HYPRE_MEMORY_HOST); } - + #else { HYPRE_Real eps; HYPRE_Complex *i1_t, *i2_t, *o_t; - + eps = 1.0e-12; - - if (block_size ==1 ) + + if (block_size == 1 ) { if (hypre_cabs(i1[0]) > eps) { - o[0] = i2[0]/i1[0]; - return(ierr); + o[0] = i2[0] / i1[0]; + return (ierr); } else { /* hypre_printf("GE zero pivot error\n"); */ - return(-1); + return (-1); } } else { - - i1_t = hypre_CTAlloc(HYPRE_Complex, block_size*block_size, HYPRE_MEMORY_HOST); - i2_t = hypre_CTAlloc(HYPRE_Complex, block_size*block_size, HYPRE_MEMORY_HOST); - o_t = hypre_CTAlloc(HYPRE_Complex, block_size*block_size, HYPRE_MEMORY_HOST); - - /* TO DO:: this could be done more efficiently! */ + + i1_t = hypre_CTAlloc(HYPRE_Complex, block_size * block_size, HYPRE_MEMORY_HOST); + i2_t = hypre_CTAlloc(HYPRE_Complex, block_size * block_size, HYPRE_MEMORY_HOST); + o_t = hypre_CTAlloc(HYPRE_Complex, block_size * block_size, HYPRE_MEMORY_HOST); + + /* TO DO:: this could be done more efficiently! */ hypre_CSRBlockMatrixBlockTranspose(i1, i1_t, block_size); hypre_CSRBlockMatrixBlockTranspose(i2, i2_t, block_size); ierr = hypre_CSRBlockMatrixBlockInvMult(i1_t, i2_t, o_t, block_size); - - if (!ierr) hypre_CSRBlockMatrixBlockTranspose(o_t, o, block_size); - + + if (!ierr) { hypre_CSRBlockMatrixBlockTranspose(o_t, o, block_size); } + hypre_TFree(i1_t, HYPRE_MEMORY_HOST); hypre_TFree(i2_t, HYPRE_MEMORY_HOST); hypre_TFree(o_t, HYPRE_MEMORY_HOST); - + } } - -#endif + +#endif return (ierr); } @@ -1469,43 +1527,47 @@ hypre_CSRBlockMatrixBlockMultInv(HYPRE_Complex* i1, HYPRE_Complex* i2, HYPRE_Com /*-------------------------------------------------------------------------- * hypre_CSRBlockMatrixBlockInvMultDiag - zeros off-d entires - * (o = diag(i1)^{-1} * diag(i2)) + * (o = diag(i1)^{-1} * diag(i2)) *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_CSRBlockMatrixBlockInvMultDiag(HYPRE_Complex* i1, HYPRE_Complex* i2, HYPRE_Complex* o, HYPRE_Int block_size) +hypre_CSRBlockMatrixBlockInvMultDiag(HYPRE_Complex* i1, HYPRE_Complex* i2, HYPRE_Complex* o, + HYPRE_Int block_size) { HYPRE_Int ierr = 0; HYPRE_Int i; - HYPRE_Int sz = block_size*block_size; + HYPRE_Int sz = block_size * block_size; HYPRE_Real eps = 1.0e-8; - + for (i = 0; i < sz; i++) + { o[i] = 0.0; - + } + for (i = 0; i < block_size; i++) { - if (hypre_cabs(i1[i*block_size + i]) > eps) + if (hypre_cabs(i1[i * block_size + i]) > eps) { - o[i*block_size + i] = i2[i*block_size + i] / i1[i*block_size + i]; + o[i * block_size + i] = i2[i * block_size + i] / i1[i * block_size + i]; } else { /* hypre_printf("GE zero pivot error\n"); */ - return(-1); + return (-1); } } - + return (ierr); } /*-------------------------------------------------------------------------- * hypre_CSRBlockMatrixBlockInvMultDiag2 - * (o = (i1)* diag(i2)^-1) - so this scales the cols of il by - the diag entries in i2 + * (o = (i1)* diag(i2)^-1) - so this scales the cols of il by + the diag entries in i2 *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_CSRBlockMatrixBlockInvMultDiag2(HYPRE_Complex* i1, HYPRE_Complex* i2, HYPRE_Complex* o, HYPRE_Int block_size) +hypre_CSRBlockMatrixBlockInvMultDiag2(HYPRE_Complex* i1, HYPRE_Complex* i2, HYPRE_Complex* o, + HYPRE_Int block_size) { HYPRE_Int ierr = 0; @@ -1513,50 +1575,51 @@ hypre_CSRBlockMatrixBlockInvMultDiag2(HYPRE_Complex* i1, HYPRE_Complex* i2, HYPR HYPRE_Real eps = 1.0e-8; HYPRE_Complex tmp; - + for (i = 0; i < block_size; i++) { - if (hypre_cabs(i2[i*block_size + i]) > eps) + if (hypre_cabs(i2[i * block_size + i]) > eps) { - tmp = 1 / i2[i*block_size + i]; + tmp = 1 / i2[i * block_size + i]; } else { tmp = 1.0; } - for (j=0; j< block_size; j++) /* this should be re-written to access by row (not col)! */ + for (j = 0; j < block_size; j++) /* this should be re-written to access by row (not col)! */ { - o[j*block_size + i] = i1[j*block_size + i] *tmp; + o[j * block_size + i] = i1[j * block_size + i] * tmp; } } - + return (ierr); } /*-------------------------------------------------------------------------- * hypre_CSRBlockMatrixBlockInvMultDiag3 - * (o = (i1)* diag(i2)^-1) - so this scales the cols of il by - the i2 whose diags are row sums + * (o = (i1)* diag(i2)^-1) - so this scales the cols of il by + the i2 whose diags are row sums *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_CSRBlockMatrixBlockInvMultDiag3(HYPRE_Complex* i1, HYPRE_Complex* i2, HYPRE_Complex* o, HYPRE_Int block_size) +hypre_CSRBlockMatrixBlockInvMultDiag3(HYPRE_Complex* i1, HYPRE_Complex* i2, HYPRE_Complex* o, + HYPRE_Int block_size) { HYPRE_Int ierr = 0; HYPRE_Int i, j; HYPRE_Real eps = 1.0e-8; HYPRE_Complex tmp, row_sum; - + for (i = 0; i < block_size; i++) { /* get row sum of i2, row i */ row_sum = 0.0; - for (j=0; j< block_size; j++) + for (j = 0; j < block_size; j++) { - row_sum += i2[i*block_size + j]; + row_sum += i2[i * block_size + j]; } - + /* invert */ if (hypre_cabs(row_sum) > eps) { @@ -1567,12 +1630,12 @@ hypre_CSRBlockMatrixBlockInvMultDiag3(HYPRE_Complex* i1, HYPRE_Complex* i2, HYPR tmp = 1.0; } /* scale col of i1 */ - for (j=0; j< block_size; j++) /* this should be re-written to access by row (not col)! */ + for (j = 0; j < block_size; j++) /* this should be re-written to access by row (not col)! */ { - o[j*block_size + i] = i1[j*block_size + i] *tmp; + o[j * block_size + i] = i1[j * block_size + i] * tmp; } } - + return (ierr); } @@ -1583,8 +1646,8 @@ hypre_CSRBlockMatrixBlockInvMultDiag3(HYPRE_Complex* i1, HYPRE_Complex* i2, HYPR * hypre_CSRBlockMatrixTranspose *--------------------------------------------------------------------------*/ -HYPRE_Int hypre_CSRBlockMatrixTranspose(hypre_CSRBlockMatrix *A, - hypre_CSRBlockMatrix **AT, HYPRE_Int data) +HYPRE_Int hypre_CSRBlockMatrixTranspose(hypre_CSRBlockMatrix *A, + hypre_CSRBlockMatrix **AT, HYPRE_Int data) { HYPRE_Complex *A_data = hypre_CSRBlockMatrixData(A); @@ -1605,35 +1668,35 @@ HYPRE_Int hypre_CSRBlockMatrixTranspose(hypre_CSRBlockMatrix *A, HYPRE_Int max_col; HYPRE_Int i, j, k, m, offset, bnnz; - /*-------------------------------------------------------------- - * First, ascertain that num_cols and num_nonzeros has been set. + /*-------------------------------------------------------------- + * First, ascertain that num_cols and num_nonzeros has been set. * If not, set them. *--------------------------------------------------------------*/ - if (! num_nonzerosA) num_nonzerosA = A_i[num_rowsA]; + if (! num_nonzerosA) { num_nonzerosA = A_i[num_rowsA]; } if (num_rowsA && ! num_colsA) { max_col = -1; for (i = 0; i < num_rowsA; ++i) - for (j = A_i[i]; j < A_i[i+1]; j++) - if (A_j[j] > max_col) max_col = A_j[j]; - num_colsA = max_col+1; + for (j = A_i[i]; j < A_i[i + 1]; j++) + if (A_j[j] > max_col) { max_col = A_j[j]; } + num_colsA = max_col + 1; } num_rowsAT = num_colsA; num_colsAT = num_rowsA; num_nonzerosAT = num_nonzerosA; bnnz = block_size * block_size; - *AT = hypre_CSRBlockMatrixCreate(block_size, num_rowsAT, num_colsAT, + *AT = hypre_CSRBlockMatrixCreate(block_size, num_rowsAT, num_colsAT, num_nonzerosAT); - AT_i = hypre_CTAlloc(HYPRE_Int, num_rowsAT+1, HYPRE_MEMORY_HOST); + AT_i = hypre_CTAlloc(HYPRE_Int, num_rowsAT + 1, HYPRE_MEMORY_HOST); AT_j = hypre_CTAlloc(HYPRE_Int, num_nonzerosAT, HYPRE_MEMORY_HOST); hypre_CSRBlockMatrixI(*AT) = AT_i; hypre_CSRBlockMatrixJ(*AT) = AT_j; - if (data) + if (data) { - AT_data = hypre_CTAlloc(HYPRE_Complex, num_nonzerosAT*bnnz, HYPRE_MEMORY_HOST); + AT_data = hypre_CTAlloc(HYPRE_Complex, num_nonzerosAT * bnnz, HYPRE_MEMORY_HOST); hypre_CSRBlockMatrixData(*AT) = AT_data; } @@ -1642,8 +1705,8 @@ HYPRE_Int hypre_CSRBlockMatrixTranspose(hypre_CSRBlockMatrix *A, * and fill the AT_i array. *-----------------------------------------------------------------*/ - for (i = 0; i < num_nonzerosA; i++) ++AT_i[A_j[i]+1]; - for (i = 2; i <= num_rowsAT; i++) AT_i[i] += AT_i[i-1]; + for (i = 0; i < num_nonzerosA; i++) { ++AT_i[A_j[i] + 1]; } + for (i = 2; i <= num_rowsAT; i++) { AT_i[i] += AT_i[i - 1]; } /*---------------------------------------------------------------- * Load the data and column numbers of AT @@ -1651,7 +1714,7 @@ HYPRE_Int hypre_CSRBlockMatrixTranspose(hypre_CSRBlockMatrix *A, for (i = 0; i < num_rowsA; i++) { - for (j = A_i[i]; j < A_i[i+1]; j++) + for (j = A_i[i]; j < A_i[i + 1]; j++) { AT_j[AT_i[A_j[j]]] = i; if (data) @@ -1659,8 +1722,8 @@ HYPRE_Int hypre_CSRBlockMatrixTranspose(hypre_CSRBlockMatrix *A, offset = AT_i[A_j[j]] * bnnz; for (k = 0; k < block_size; k++) for (m = 0; m < block_size; m++) - AT_data[offset+k*block_size+m] = - A_data[j*bnnz+m*block_size+k]; + AT_data[offset + k * block_size + m] = + A_data[j * bnnz + m * block_size + k]; } AT_i[A_j[j]]++; } @@ -1671,9 +1734,8 @@ HYPRE_Int hypre_CSRBlockMatrixTranspose(hypre_CSRBlockMatrix *A, * instead of the beginning. Restore AT_i to front of row. *------------------------------------------------------------*/ - for (i = num_rowsAT; i > 0; i--) AT_i[i] = AT_i[i-1]; + for (i = num_rowsAT; i > 0; i--) { AT_i[i] = AT_i[i - 1]; } AT_i[0] = 0; - return(0); + return (0); } - diff --git a/external/hypre/src/parcsr_block_mv/csr_block_matrix.h b/external/hypre/src/parcsr_block_mv/csr_block_matrix.h index 3f4bbdac..c05ba0d5 100644 --- a/external/hypre/src/parcsr_block_mv/csr_block_matrix.h +++ b/external/hypre/src/parcsr_block_mv/csr_block_matrix.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -31,15 +31,15 @@ extern "C" { typedef struct { - HYPRE_Complex *data; - HYPRE_Int *i; - HYPRE_Int *j; - HYPRE_BigInt *big_j; - HYPRE_Int block_size; - HYPRE_Int num_rows; - HYPRE_Int num_cols; - HYPRE_Int num_nonzeros; - HYPRE_Int owns_data; + HYPRE_Complex *data; + HYPRE_Int *i; + HYPRE_Int *j; + HYPRE_BigInt *big_j; + HYPRE_Int block_size; + HYPRE_Int num_rows; + HYPRE_Int num_cols; + HYPRE_Int num_nonzeros; + HYPRE_Int owns_data; } hypre_CSRBlockMatrix; @@ -61,81 +61,97 @@ typedef struct * other functions for the CSR Block Matrix structure *--------------------------------------------------------------------------*/ -hypre_CSRBlockMatrix - *hypre_CSRBlockMatrixCreate(HYPRE_Int, HYPRE_Int, HYPRE_Int, HYPRE_Int); +hypre_CSRBlockMatrix +*hypre_CSRBlockMatrixCreate(HYPRE_Int, HYPRE_Int, HYPRE_Int, HYPRE_Int); HYPRE_Int hypre_CSRBlockMatrixDestroy(hypre_CSRBlockMatrix *); HYPRE_Int hypre_CSRBlockMatrixInitialize(hypre_CSRBlockMatrix *); HYPRE_Int hypre_CSRBlockMatrixBigInitialize(hypre_CSRBlockMatrix *); HYPRE_Int hypre_CSRBlockMatrixSetDataOwner(hypre_CSRBlockMatrix *, HYPRE_Int); -hypre_CSRMatrix - *hypre_CSRBlockMatrixCompress(hypre_CSRBlockMatrix *); -hypre_CSRMatrix - *hypre_CSRBlockMatrixConvertToCSRMatrix(hypre_CSRBlockMatrix *); +hypre_CSRMatrix +*hypre_CSRBlockMatrixCompress(hypre_CSRBlockMatrix *); +hypre_CSRMatrix +*hypre_CSRBlockMatrixConvertToCSRMatrix(hypre_CSRBlockMatrix *); hypre_CSRBlockMatrix - *hypre_CSRBlockMatrixConvertFromCSRMatrix(hypre_CSRMatrix *, HYPRE_Int); +*hypre_CSRBlockMatrixConvertFromCSRMatrix(hypre_CSRMatrix *, HYPRE_Int); HYPRE_Int hypre_CSRBlockMatrixBlockAdd(HYPRE_Complex *, HYPRE_Complex *, HYPRE_Complex*, HYPRE_Int); -HYPRE_Int hypre_CSRBlockMatrixBlockMultAdd(HYPRE_Complex *, HYPRE_Complex *, HYPRE_Complex, HYPRE_Complex *, HYPRE_Int); -HYPRE_Int hypre_CSRBlockMatrixBlockMultAddDiag(HYPRE_Complex *, HYPRE_Complex *, HYPRE_Complex, HYPRE_Complex *, HYPRE_Int); +HYPRE_Int hypre_CSRBlockMatrixBlockMultAdd(HYPRE_Complex *, HYPRE_Complex *, HYPRE_Complex, + HYPRE_Complex *, HYPRE_Int); +HYPRE_Int hypre_CSRBlockMatrixBlockMultAddDiag(HYPRE_Complex *, HYPRE_Complex *, HYPRE_Complex, + HYPRE_Complex *, HYPRE_Int); HYPRE_Int -hypre_CSRBlockMatrixBlockMultAddDiag2(HYPRE_Complex* i1, HYPRE_Complex* i2, HYPRE_Complex beta, +hypre_CSRBlockMatrixBlockMultAddDiag2(HYPRE_Complex* i1, HYPRE_Complex* i2, HYPRE_Complex beta, HYPRE_Complex* o, HYPRE_Int block_size); HYPRE_Int -hypre_CSRBlockMatrixBlockMultAddDiag3(HYPRE_Complex* i1, HYPRE_Complex* i2, HYPRE_Complex beta, +hypre_CSRBlockMatrixBlockMultAddDiag3(HYPRE_Complex* i1, HYPRE_Complex* i2, HYPRE_Complex beta, HYPRE_Complex* o, HYPRE_Int block_size); - -HYPRE_Int hypre_CSRBlockMatrixBlockInvMult(HYPRE_Complex *, HYPRE_Complex *, HYPRE_Complex *, HYPRE_Int); -HYPRE_Int hypre_CSRBlockMatrixBlockInvMultDiag(HYPRE_Complex *, HYPRE_Complex *, HYPRE_Complex *, HYPRE_Int); + +HYPRE_Int hypre_CSRBlockMatrixBlockInvMult(HYPRE_Complex *, HYPRE_Complex *, HYPRE_Complex *, + HYPRE_Int); +HYPRE_Int hypre_CSRBlockMatrixBlockInvMultDiag(HYPRE_Complex *, HYPRE_Complex *, HYPRE_Complex *, + HYPRE_Int); HYPRE_Int -hypre_CSRBlockMatrixBlockInvMultDiag2(HYPRE_Complex* i1, HYPRE_Complex* i2, HYPRE_Complex* o, HYPRE_Int block_size); - +hypre_CSRBlockMatrixBlockInvMultDiag2(HYPRE_Complex* i1, HYPRE_Complex* i2, HYPRE_Complex* o, + HYPRE_Int block_size); + HYPRE_Int -hypre_CSRBlockMatrixBlockInvMultDiag3(HYPRE_Complex* i1, HYPRE_Complex* i2, HYPRE_Complex* o, HYPRE_Int block_size); - +hypre_CSRBlockMatrixBlockInvMultDiag3(HYPRE_Complex* i1, HYPRE_Complex* i2, HYPRE_Complex* o, + HYPRE_Int block_size); -HYPRE_Int hypre_CSRBlockMatrixBlockMultInv(HYPRE_Complex *, HYPRE_Complex *, HYPRE_Complex *, HYPRE_Int); + +HYPRE_Int hypre_CSRBlockMatrixBlockMultInv(HYPRE_Complex *, HYPRE_Complex *, HYPRE_Complex *, + HYPRE_Int); HYPRE_Int hypre_CSRBlockMatrixBlockTranspose(HYPRE_Complex *, HYPRE_Complex *, HYPRE_Int); HYPRE_Int hypre_CSRBlockMatrixTranspose(hypre_CSRBlockMatrix *A, - hypre_CSRBlockMatrix **AT, HYPRE_Int data); + hypre_CSRBlockMatrix **AT, HYPRE_Int data); -HYPRE_Int hypre_CSRBlockMatrixBlockCopyData(HYPRE_Complex*, HYPRE_Complex*, HYPRE_Complex, HYPRE_Int); -HYPRE_Int hypre_CSRBlockMatrixBlockCopyDataDiag(HYPRE_Complex*, HYPRE_Complex*, HYPRE_Complex, HYPRE_Int); +HYPRE_Int hypre_CSRBlockMatrixBlockCopyData(HYPRE_Complex*, HYPRE_Complex*, HYPRE_Complex, + HYPRE_Int); +HYPRE_Int hypre_CSRBlockMatrixBlockCopyDataDiag(HYPRE_Complex*, HYPRE_Complex*, HYPRE_Complex, + HYPRE_Int); HYPRE_Int hypre_CSRBlockMatrixBlockAddAccumulate(HYPRE_Complex*, HYPRE_Complex*, HYPRE_Int); -HYPRE_Int hypre_CSRBlockMatrixBlockAddAccumulateDiag(HYPRE_Complex* i1, HYPRE_Complex* o, HYPRE_Int block_size); - +HYPRE_Int hypre_CSRBlockMatrixBlockAddAccumulateDiag(HYPRE_Complex* i1, HYPRE_Complex* o, + HYPRE_Int block_size); + HYPRE_Int hypre_CSRBlockMatrixMatvec(HYPRE_Complex alpha, hypre_CSRBlockMatrix *A, hypre_Vector *x, HYPRE_Complex beta, hypre_Vector *y); - + HYPRE_Int hypre_CSRBlockMatrixMatvecT( HYPRE_Complex alpha, hypre_CSRBlockMatrix *A, hypre_Vector *x, HYPRE_Complex beta, hypre_Vector *y ); HYPRE_Int -hypre_CSRBlockMatrixBlockInvMatvec(HYPRE_Complex* mat, HYPRE_Complex* v, +hypre_CSRBlockMatrixBlockInvMatvec(HYPRE_Complex* mat, HYPRE_Complex* v, HYPRE_Complex* ov, HYPRE_Int block_size); - -HYPRE_Int -hypre_CSRBlockMatrixBlockMatvec(HYPRE_Complex alpha, HYPRE_Complex* mat, HYPRE_Complex* v, HYPRE_Complex beta, + +HYPRE_Int +hypre_CSRBlockMatrixBlockMatvec(HYPRE_Complex alpha, HYPRE_Complex* mat, HYPRE_Complex* v, + HYPRE_Complex beta, HYPRE_Complex* ov, HYPRE_Int block_size); - - -HYPRE_Int hypre_CSRBlockMatrixBlockNorm(HYPRE_Int norm_type, HYPRE_Complex* data, HYPRE_Real* out, HYPRE_Int block_size); - -HYPRE_Int hypre_CSRBlockMatrixBlockSetScalar(HYPRE_Complex* o, HYPRE_Complex beta, HYPRE_Int block_size); - -HYPRE_Int hypre_CSRBlockMatrixComputeSign(HYPRE_Complex *i1, HYPRE_Complex *o, HYPRE_Int block_size); -HYPRE_Int hypre_CSRBlockMatrixBlockAddAccumulateDiagCheckSign(HYPRE_Complex* i1, HYPRE_Complex* o, HYPRE_Int block_size, HYPRE_Real *sign); -HYPRE_Int hypre_CSRBlockMatrixBlockMultAddDiagCheckSign(HYPRE_Complex* i1, HYPRE_Complex* i2, HYPRE_Complex beta, HYPRE_Complex* o, HYPRE_Int block_size, HYPRE_Real *sign); + + +HYPRE_Int hypre_CSRBlockMatrixBlockNorm(HYPRE_Int norm_type, HYPRE_Complex* data, HYPRE_Real* out, + HYPRE_Int block_size); + +HYPRE_Int hypre_CSRBlockMatrixBlockSetScalar(HYPRE_Complex* o, HYPRE_Complex beta, + HYPRE_Int block_size); + +HYPRE_Int hypre_CSRBlockMatrixComputeSign(HYPRE_Complex *i1, HYPRE_Complex *o, + HYPRE_Int block_size); +HYPRE_Int hypre_CSRBlockMatrixBlockAddAccumulateDiagCheckSign(HYPRE_Complex* i1, HYPRE_Complex* o, + HYPRE_Int block_size, HYPRE_Real *sign); +HYPRE_Int hypre_CSRBlockMatrixBlockMultAddDiagCheckSign(HYPRE_Complex* i1, HYPRE_Complex* i2, + HYPRE_Complex beta, HYPRE_Complex* o, HYPRE_Int block_size, HYPRE_Real *sign); #ifdef __cplusplus } diff --git a/external/hypre/src/parcsr_block_mv/csr_block_matvec.c b/external/hypre/src/parcsr_block_mv/csr_block_matvec.c index c07e19d7..84c49478 100644 --- a/external/hypre/src/parcsr_block_mv/csr_block_matvec.c +++ b/external/hypre/src/parcsr_block_mv/csr_block_matvec.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -34,7 +34,7 @@ hypre_CSRBlockMatrixMatvec(HYPRE_Complex alpha, hypre_CSRBlockMatrix *A, HYPRE_Int x_size = hypre_VectorSize(x); HYPRE_Int y_size = hypre_VectorSize(y); - HYPRE_Int i, b1, b2, jj, bnnz=blk_size*blk_size; + HYPRE_Int i, b1, b2, jj, bnnz = blk_size * blk_size; HYPRE_Int ierr = 0; HYPRE_Complex temp; @@ -49,9 +49,9 @@ hypre_CSRBlockMatrixMatvec(HYPRE_Complex alpha, hypre_CSRBlockMatrix *A, * is informational only. *--------------------------------------------------------------------*/ - if (num_cols*blk_size != x_size) ierr = 1; - if (num_rows*blk_size != y_size) ierr = 2; - if (num_cols*blk_size != x_size && num_rows*blk_size != y_size) ierr = 3; + if (num_cols * blk_size != x_size) { ierr = 1; } + if (num_rows * blk_size != y_size) { ierr = 2; } + if (num_cols * blk_size != x_size && num_rows * blk_size != y_size) { ierr = 3; } /*----------------------------------------------------------------------- * Do (alpha == 0.0) computation - RDF: USE MACHINE EPS @@ -60,9 +60,9 @@ hypre_CSRBlockMatrixMatvec(HYPRE_Complex alpha, hypre_CSRBlockMatrix *A, if (alpha == 0.0) { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i = 0; i < num_rows*blk_size; i++) y_data[i] *= beta; + for (i = 0; i < num_rows * blk_size; i++) { y_data[i] *= beta; } return ierr; } @@ -78,18 +78,22 @@ hypre_CSRBlockMatrixMatvec(HYPRE_Complex alpha, hypre_CSRBlockMatrix *A, if (temp == 0.0) { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i = 0; i < num_rows*blk_size; i++) + for (i = 0; i < num_rows * blk_size; i++) + { y_data[i] = 0.0; + } } else { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i = 0; i < num_rows*blk_size; i++) + for (i = 0; i < num_rows * blk_size; i++) + { y_data[i] *= temp; + } } } @@ -98,19 +102,21 @@ hypre_CSRBlockMatrixMatvec(HYPRE_Complex alpha, hypre_CSRBlockMatrix *A, *-----------------------------------------------------------------*/ #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,jj,b1,b2,temp) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,jj,b1,b2,temp) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < num_rows; i++) { - for (jj = A_i[i]; jj < A_i[i+1]; jj++) + for (jj = A_i[i]; jj < A_i[i + 1]; jj++) { for (b1 = 0; b1 < blk_size; b1++) { - temp = y_data[i*blk_size+b1]; + temp = y_data[i * blk_size + b1]; for (b2 = 0; b2 < blk_size; b2++) - temp += A_data[jj*bnnz+b1*blk_size+b2] * x_data[A_j[jj]*blk_size+b2]; - y_data[i*blk_size+b1] = temp; + { + temp += A_data[jj * bnnz + b1 * blk_size + b2] * x_data[A_j[jj] * blk_size + b2]; + } + y_data[i * blk_size + b1] = temp; } } } @@ -122,10 +128,12 @@ hypre_CSRBlockMatrixMatvec(HYPRE_Complex alpha, hypre_CSRBlockMatrix *A, if (alpha != 1.0) { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i = 0; i < num_rows*blk_size; i++) + for (i = 0; i < num_rows * blk_size; i++) + { y_data[i] *= alpha; + } } return ierr; @@ -165,7 +173,7 @@ hypre_CSRBlockMatrixMatvecT( HYPRE_Complex alpha, HYPRE_Int b1, b2; HYPRE_Int blk_size = hypre_CSRBlockMatrixBlockSize(A); - HYPRE_Int bnnz=blk_size*blk_size; + HYPRE_Int bnnz = blk_size * blk_size; /*--------------------------------------------------------------------- * Check for size compatibility. MatvecT returns ierr = 1 if @@ -178,14 +186,20 @@ hypre_CSRBlockMatrixMatvecT( HYPRE_Complex alpha, * is informational only. *--------------------------------------------------------------------*/ - if (num_rows*blk_size != x_size) + if (num_rows * blk_size != x_size) + { ierr = 1; + } - if (num_cols*blk_size != y_size) + if (num_cols * blk_size != y_size) + { ierr = 2; + } - if (num_rows*blk_size != x_size && num_cols*blk_size != y_size) + if (num_rows * blk_size != x_size && num_cols * blk_size != y_size) + { ierr = 3; + } /*----------------------------------------------------------------------- * Do (alpha == 0.0) computation - RDF: USE MACHINE EPS *-----------------------------------------------------------------------*/ @@ -193,10 +207,12 @@ hypre_CSRBlockMatrixMatvecT( HYPRE_Complex alpha, if (alpha == 0.0) { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i = 0; i < num_cols*blk_size; i++) + for (i = 0; i < num_cols * blk_size; i++) + { y_data[i] *= beta; + } return ierr; } @@ -212,18 +228,22 @@ hypre_CSRBlockMatrixMatvecT( HYPRE_Complex alpha, if (temp == 0.0) { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i = 0; i < num_cols*blk_size; i++) + for (i = 0; i < num_cols * blk_size; i++) + { y_data[i] = 0.0; + } } else { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i = 0; i < num_cols*blk_size; i++) + for (i = 0; i < num_cols * blk_size; i++) + { y_data[i] *= temp; + } } } @@ -232,20 +252,20 @@ hypre_CSRBlockMatrixMatvecT( HYPRE_Complex alpha, *-----------------------------------------------------------------*/ #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i, jj,j, b1, b2) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i, jj,j, b1, b2) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < num_rows; i++) { - for (jj = A_i[i]; jj < A_i[i+1]; jj++) /*each nonzero in that row*/ + for (jj = A_i[i]; jj < A_i[i + 1]; jj++) /*each nonzero in that row*/ { for (b1 = 0; b1 < blk_size; b1++) /*row */ { for (b2 = 0; b2 < blk_size; b2++) /*col*/ { j = A_j[jj]; /*col */ - y_data[j*blk_size+b2] += - A_data[jj*bnnz+b1*blk_size+b2] * x_data[i*blk_size + b1]; + y_data[j * blk_size + b2] += + A_data[jj * bnnz + b1 * blk_size + b2] * x_data[i * blk_size + b1]; } } } @@ -258,10 +278,12 @@ hypre_CSRBlockMatrixMatvecT( HYPRE_Complex alpha, if (alpha != 1.0) { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i = 0; i < num_cols*blk_size; i++) + for (i = 0; i < num_cols * blk_size; i++) + { y_data[i] *= alpha; + } } return ierr; diff --git a/external/hypre/src/parcsr_block_mv/driver_matvec.c b/external/hypre/src/parcsr_block_mv/driver_matvec.c index cd2d8b32..8e88dc6c 100644 --- a/external/hypre/src/parcsr_block_mv/driver_matvec.c +++ b/external/hypre/src/parcsr_block_mv/driver_matvec.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -40,7 +40,7 @@ HYPRE_Int main( HYPRE_Int argc, char *argv[] ) HYPRE_Complex *data, ddata, *y_data; HYPRE_Int *row_starts, *col_starts, *rstarts, *cstarts; HYPRE_Int *row_starts2, *col_starts2; - HYPRE_Int block_size=2, bnnz=4, *index_set; + HYPRE_Int block_size = 2, bnnz = 4, *index_set; FILE *fp; /* --------------------------------------------- */ @@ -67,17 +67,17 @@ HYPRE_Int main( HYPRE_Int argc, char *argv[] ) /* build vector and apply matvec */ /* --------------------------------------------- */ - x = hypre_ParVectorCreate(hypre_MPI_COMM_WORLD,global_num_cols,col_starts); + x = hypre_ParVectorCreate(hypre_MPI_COMM_WORLD, global_num_cols, col_starts); hypre_ParVectorInitialize(x); x_local = hypre_ParVectorLocalVector(x); data = hypre_VectorData(x_local); - local_size = col_starts[mypid+1] - col_starts[mypid]; - for (ii = 0; ii < local_size; ii++) data[ii] = 1.0; - y = hypre_ParVectorCreate(hypre_MPI_COMM_WORLD,global_num_rows,row_starts); + local_size = col_starts[mypid + 1] - col_starts[mypid]; + for (ii = 0; ii < local_size; ii++) { data[ii] = 1.0; } + y = hypre_ParVectorCreate(hypre_MPI_COMM_WORLD, global_num_rows, row_starts); hypre_ParVectorInitialize(y); hypre_ParCSRMatrixMatvec (1.0, par_matrix, x, 0.0, y); ddata = hypre_ParVectorInnerProd(y, y); - if (mypid == 0) hypre_printf("y inner product = %e\n", ddata); + if (mypid == 0) { hypre_printf("y inner product = %e\n", ddata); } hypre_ParVectorDestroy(x); hypre_ParVectorDestroy(y); @@ -85,29 +85,29 @@ HYPRE_Int main( HYPRE_Int argc, char *argv[] ) /* build block matrix */ /* --------------------------------------------- */ - rstarts = hypre_CTAlloc(HYPRE_Int, nprocs+1, HYPRE_MEMORY_HOST); - for (ii = 0; ii <= nprocs; ii++) rstarts[ii] = row_starts[ii]; - cstarts = hypre_CTAlloc(HYPRE_Int, nprocs+1, HYPRE_MEMORY_HOST); - for (ii = 0; ii <= nprocs; ii++) cstarts[ii] = col_starts[ii]; + rstarts = hypre_CTAlloc(HYPRE_Int, nprocs + 1, HYPRE_MEMORY_HOST); + for (ii = 0; ii <= nprocs; ii++) { rstarts[ii] = row_starts[ii]; } + cstarts = hypre_CTAlloc(HYPRE_Int, nprocs + 1, HYPRE_MEMORY_HOST); + for (ii = 0; ii <= nprocs; ii++) { cstarts[ii] = col_starts[ii]; } - par_blk_matrix = hypre_ParCSRBlockMatrixCreate(hypre_MPI_COMM_WORLD,block_size, - global_num_rows, global_num_cols, rstarts, - cstarts, num_cols_offd, num_nonzeros_diag, - num_nonzeros_offd); + par_blk_matrix = hypre_ParCSRBlockMatrixCreate(hypre_MPI_COMM_WORLD, block_size, + global_num_rows, global_num_cols, rstarts, + cstarts, num_cols_offd, num_nonzeros_diag, + num_nonzeros_offd); colMap = hypre_ParCSRMatrixColMapOffd(par_matrix); - if (num_cols_offd > 0) colMap2 = hypre_CTAlloc(HYPRE_Int, num_cols_offd, HYPRE_MEMORY_HOST); - else colMap2 = NULL; - for (ii = 0; ii < num_cols_offd; ii++) colMap2[ii] = colMap[ii]; + if (num_cols_offd > 0) { colMap2 = hypre_CTAlloc(HYPRE_Int, num_cols_offd, HYPRE_MEMORY_HOST); } + else { colMap2 = NULL; } + for (ii = 0; ii < num_cols_offd; ii++) { colMap2[ii] = colMap[ii]; } hypre_ParCSRBlockMatrixColMapOffd(par_blk_matrix) = colMap2; diag_i = hypre_CSRMatrixI(hypre_ParCSRMatrixDiag(par_matrix)); diag_j = hypre_CSRMatrixJ(hypre_ParCSRMatrixDiag(par_matrix)); diag_d = hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(par_matrix)); diag = hypre_ParCSRBlockMatrixDiag(par_blk_matrix); - diag_i2 = hypre_CTAlloc(HYPRE_Int, local_size+1, HYPRE_MEMORY_HOST); + diag_i2 = hypre_CTAlloc(HYPRE_Int, local_size + 1, HYPRE_MEMORY_HOST); diag_j2 = hypre_CTAlloc(HYPRE_Int, num_nonzeros_diag, HYPRE_MEMORY_HOST); - diag_d2 = hypre_CTAlloc(HYPRE_Complex, num_nonzeros_diag*bnnz, HYPRE_MEMORY_HOST); - for (ii = 0; ii <= local_size; ii++) diag_i2[ii] = diag_i[ii]; - for (ii = 0; ii < num_nonzeros_diag; ii++) diag_j2[ii] = diag_j[ii]; + diag_d2 = hypre_CTAlloc(HYPRE_Complex, num_nonzeros_diag * bnnz, HYPRE_MEMORY_HOST); + for (ii = 0; ii <= local_size; ii++) { diag_i2[ii] = diag_i[ii]; } + for (ii = 0; ii < num_nonzeros_diag; ii++) { diag_j2[ii] = diag_j[ii]; } hypre_CSRBlockMatrixI(diag) = diag_i2; hypre_CSRBlockMatrixJ(diag) = diag_j2; for (ii = 0; ii < num_nonzeros_diag; ii++) @@ -116,9 +116,13 @@ HYPRE_Int main( HYPRE_Int argc, char *argv[] ) for (kk = 0; kk < block_size; kk++) { if (jj <= kk) - diag_d2[ii*bnnz+jj*block_size+kk] = diag_d[ii]; + { + diag_d2[ii * bnnz + jj * block_size + kk] = diag_d[ii]; + } else - diag_d2[ii*bnnz+jj*block_size+kk] = 0.0; + { + diag_d2[ii * bnnz + jj * block_size + kk] = 0.0; + } } } hypre_CSRBlockMatrixData(diag) = diag_d2; @@ -127,24 +131,28 @@ HYPRE_Int main( HYPRE_Int argc, char *argv[] ) offd_j = hypre_CSRMatrixJ(hypre_ParCSRMatrixOffd(par_matrix)); offd_d = hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(par_matrix)); offd = hypre_ParCSRBlockMatrixOffd(par_blk_matrix); - offd_i2 = hypre_CTAlloc(HYPRE_Int, local_size+1, HYPRE_MEMORY_HOST); - for (ii = 0; ii <= local_size; ii++) offd_i2[ii] = offd_i[ii]; + offd_i2 = hypre_CTAlloc(HYPRE_Int, local_size + 1, HYPRE_MEMORY_HOST); + for (ii = 0; ii <= local_size; ii++) { offd_i2[ii] = offd_i[ii]; } hypre_CSRBlockMatrixI(offd) = offd_i2; if (num_cols_offd) { offd_j2 = hypre_CTAlloc(HYPRE_Int, num_nonzeros_offd, HYPRE_MEMORY_HOST); - for (ii = 0; ii < num_nonzeros_offd; ii++) offd_j2[ii] = offd_j[ii]; + for (ii = 0; ii < num_nonzeros_offd; ii++) { offd_j2[ii] = offd_j[ii]; } hypre_CSRBlockMatrixJ(offd) = offd_j2; - offd_d2 = hypre_CTAlloc(HYPRE_Complex, num_nonzeros_offd*bnnz, HYPRE_MEMORY_HOST); + offd_d2 = hypre_CTAlloc(HYPRE_Complex, num_nonzeros_offd * bnnz, HYPRE_MEMORY_HOST); for (ii = 0; ii < num_nonzeros_offd; ii++) { for (jj = 0; jj < block_size; jj++) for (kk = 0; kk < block_size; kk++) { if (jj <= kk) - offd_d2[ii*bnnz+jj*block_size+kk] = offd_d[ii]; + { + offd_d2[ii * bnnz + jj * block_size + kk] = offd_d[ii]; + } else - offd_d2[ii*bnnz+jj*block_size+kk] = 0.0; + { + offd_d2[ii * bnnz + jj * block_size + kk] = 0.0; + } } } hypre_CSRBlockMatrixData(offd) = offd_d2; @@ -159,28 +167,28 @@ HYPRE_Int main( HYPRE_Int argc, char *argv[] ) /* build block matrix transpose */ /* --------------------------------------------- */ - rstarts = hypre_CTAlloc(HYPRE_Int, nprocs+1, HYPRE_MEMORY_HOST); - for (ii = 0; ii <= nprocs; ii++) rstarts[ii] = row_starts[ii]; - cstarts = hypre_CTAlloc(HYPRE_Int, nprocs+1, HYPRE_MEMORY_HOST); - for (ii = 0; ii <= nprocs; ii++) cstarts[ii] = col_starts[ii]; + rstarts = hypre_CTAlloc(HYPRE_Int, nprocs + 1, HYPRE_MEMORY_HOST); + for (ii = 0; ii <= nprocs; ii++) { rstarts[ii] = row_starts[ii]; } + cstarts = hypre_CTAlloc(HYPRE_Int, nprocs + 1, HYPRE_MEMORY_HOST); + for (ii = 0; ii <= nprocs; ii++) { cstarts[ii] = col_starts[ii]; } - par_blk_matrixT = hypre_ParCSRBlockMatrixCreate(hypre_MPI_COMM_WORLD,block_size, - global_num_rows, global_num_cols, rstarts, - cstarts, num_cols_offd, num_nonzeros_diag, - num_nonzeros_offd); + par_blk_matrixT = hypre_ParCSRBlockMatrixCreate(hypre_MPI_COMM_WORLD, block_size, + global_num_rows, global_num_cols, rstarts, + cstarts, num_cols_offd, num_nonzeros_diag, + num_nonzeros_offd); colMap = hypre_ParCSRMatrixColMapOffd(par_matrix); colMap2 = hypre_CTAlloc(HYPRE_Int, num_cols_offd, HYPRE_MEMORY_HOST); - for (ii = 0; ii < num_cols_offd; ii++) colMap2[ii] = colMap[ii]; + for (ii = 0; ii < num_cols_offd; ii++) { colMap2[ii] = colMap[ii]; } hypre_ParCSRBlockMatrixColMapOffd(par_blk_matrixT) = colMap2; diag_i = hypre_CSRMatrixI(hypre_ParCSRMatrixDiag(par_matrix)); diag_j = hypre_CSRMatrixJ(hypre_ParCSRMatrixDiag(par_matrix)); diag_d = hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(par_matrix)); diag = hypre_ParCSRBlockMatrixDiag(par_blk_matrixT); - diag_i2 = hypre_CTAlloc(HYPRE_Int, local_size+1, HYPRE_MEMORY_HOST); + diag_i2 = hypre_CTAlloc(HYPRE_Int, local_size + 1, HYPRE_MEMORY_HOST); diag_j2 = hypre_CTAlloc(HYPRE_Int, num_nonzeros_diag, HYPRE_MEMORY_HOST); - diag_d2 = hypre_CTAlloc(HYPRE_Complex, num_nonzeros_diag*bnnz, HYPRE_MEMORY_HOST); - for (ii = 0; ii <= local_size; ii++) diag_i2[ii] = diag_i[ii]; - for (ii = 0; ii < num_nonzeros_diag; ii++) diag_j2[ii] = diag_j[ii]; + diag_d2 = hypre_CTAlloc(HYPRE_Complex, num_nonzeros_diag * bnnz, HYPRE_MEMORY_HOST); + for (ii = 0; ii <= local_size; ii++) { diag_i2[ii] = diag_i[ii]; } + for (ii = 0; ii < num_nonzeros_diag; ii++) { diag_j2[ii] = diag_j[ii]; } hypre_CSRBlockMatrixI(diag) = diag_i2; hypre_CSRBlockMatrixJ(diag) = diag_j2; for (ii = 0; ii < num_nonzeros_diag; ii++) @@ -189,9 +197,13 @@ HYPRE_Int main( HYPRE_Int argc, char *argv[] ) for (kk = 0; kk < block_size; kk++) { if (jj >= kk) - diag_d2[ii*bnnz+jj*block_size+kk] = diag_d[ii]; + { + diag_d2[ii * bnnz + jj * block_size + kk] = diag_d[ii]; + } else - diag_d2[ii*bnnz+jj*block_size+kk] = 0.0; + { + diag_d2[ii * bnnz + jj * block_size + kk] = 0.0; + } } } hypre_CSRBlockMatrixData(diag) = diag_d2; @@ -200,24 +212,28 @@ HYPRE_Int main( HYPRE_Int argc, char *argv[] ) offd_j = hypre_CSRMatrixJ(hypre_ParCSRMatrixOffd(par_matrix)); offd_d = hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(par_matrix)); offd = hypre_ParCSRBlockMatrixOffd(par_blk_matrixT); - offd_i2 = hypre_CTAlloc(HYPRE_Int, local_size+1, HYPRE_MEMORY_HOST); - for (ii = 0; ii <= local_size; ii++) offd_i2[ii] = offd_i[ii]; + offd_i2 = hypre_CTAlloc(HYPRE_Int, local_size + 1, HYPRE_MEMORY_HOST); + for (ii = 0; ii <= local_size; ii++) { offd_i2[ii] = offd_i[ii]; } hypre_CSRBlockMatrixI(offd) = offd_i2; if (num_cols_offd) { offd_j2 = hypre_CTAlloc(HYPRE_Int, num_nonzeros_offd, HYPRE_MEMORY_HOST); - for (ii = 0; ii < num_nonzeros_offd; ii++) offd_j2[ii] = offd_j[ii]; + for (ii = 0; ii < num_nonzeros_offd; ii++) { offd_j2[ii] = offd_j[ii]; } hypre_CSRBlockMatrixJ(offd) = offd_j2; - offd_d2 = hypre_CTAlloc(HYPRE_Complex, num_nonzeros_offd*bnnz, HYPRE_MEMORY_HOST); + offd_d2 = hypre_CTAlloc(HYPRE_Complex, num_nonzeros_offd * bnnz, HYPRE_MEMORY_HOST); for (ii = 0; ii < num_nonzeros_offd; ii++) { for (jj = 0; jj < block_size; jj++) for (kk = 0; kk < block_size; kk++) { if (jj >= kk) - offd_d2[ii*bnnz+jj*block_size+kk] = offd_d[ii]; + { + offd_d2[ii * bnnz + jj * block_size + kk] = offd_d[ii]; + } else - offd_d2[ii*bnnz+jj*block_size+kk] = 0.0; + { + offd_d2[ii * bnnz + jj * block_size + kk] = 0.0; + } } } hypre_CSRBlockMatrixData(offd) = offd_d2; @@ -232,20 +248,24 @@ HYPRE_Int main( HYPRE_Int argc, char *argv[] ) /* block matvec */ /* --------------------------------------------- */ - col_starts2 = hypre_CTAlloc(HYPRE_Int, nprocs+1, HYPRE_MEMORY_HOST); + col_starts2 = hypre_CTAlloc(HYPRE_Int, nprocs + 1, HYPRE_MEMORY_HOST); for (ii = 0; ii <= nprocs; ii++) + { col_starts2[ii] = col_starts[ii] * block_size; - x = hypre_ParVectorCreate(hypre_MPI_COMM_WORLD,global_num_cols*block_size, + } + x = hypre_ParVectorCreate(hypre_MPI_COMM_WORLD, global_num_cols * block_size, col_starts2); hypre_ParVectorInitialize(x); x_local = hypre_ParVectorLocalVector(x); data = hypre_VectorData(x_local); - local_size = col_starts2[mypid+1] - col_starts2[mypid]; - for (ii=0; ii < local_size; ii++) data[ii] = 1.0; - row_starts2 = hypre_CTAlloc(HYPRE_Int, nprocs+1, HYPRE_MEMORY_HOST); + local_size = col_starts2[mypid + 1] - col_starts2[mypid]; + for (ii = 0; ii < local_size; ii++) { data[ii] = 1.0; } + row_starts2 = hypre_CTAlloc(HYPRE_Int, nprocs + 1, HYPRE_MEMORY_HOST); for (ii = 0; ii <= nprocs; ii++) + { row_starts2[ii] = row_starts[ii] * block_size; - y = hypre_ParVectorCreate(hypre_MPI_COMM_WORLD,global_num_rows*block_size, + } + y = hypre_ParVectorCreate(hypre_MPI_COMM_WORLD, global_num_rows * block_size, row_starts2); hypre_ParVectorInitialize(y); y_local = hypre_ParVectorLocalVector(y); @@ -253,10 +273,10 @@ HYPRE_Int main( HYPRE_Int argc, char *argv[] ) hypre_BlockMatvecCommPkgCreate(par_blk_matrix); ddata = hypre_ParVectorInnerProd(x, x); - if (mypid == 0) hypre_printf("block x inner product = %e\n", ddata); + if (mypid == 0) { hypre_printf("block x inner product = %e\n", ddata); } hypre_ParCSRBlockMatrixMatvec (1.0, par_blk_matrix, x, 0.0, y); ddata = hypre_ParVectorInnerProd(y, y); - if (mypid == 0) hypre_printf("block y inner product = %e\n", ddata); + if (mypid == 0) { hypre_printf("block y inner product = %e\n", ddata); } /* --------------------------------------------- */ /* RAP */ @@ -265,17 +285,17 @@ HYPRE_Int main( HYPRE_Int argc, char *argv[] ) hypre_printf("Verifying RAP\n"); hypre_ParCSRBlockMatrixRAP(par_blk_matrix, par_blk_matrix, par_blk_matrix, &rap_matrix); - for (ii = 0; ii < local_size; ii++) data[ii] = 1.0; + for (ii = 0; ii < local_size; ii++) { data[ii] = 1.0; } hypre_ParCSRBlockMatrixMatvec (1.0, par_blk_matrix, x, 0.0, y); hypre_ParCSRBlockMatrixMatvec (1.0, par_blk_matrix, y, 0.0, x); hypre_ParCSRBlockMatrixMatvec (1.0, par_blk_matrixT, x, 0.0, y); ddata = hypre_ParVectorInnerProd(y, y); - if (mypid == 0) hypre_printf("(1) A^2 block inner product = %e\n", ddata); - for (ii = 0; ii < local_size; ii++) data[ii] = 1.0; + if (mypid == 0) { hypre_printf("(1) A^2 block inner product = %e\n", ddata); } + for (ii = 0; ii < local_size; ii++) { data[ii] = 1.0; } hypre_ParCSRBlockMatrixMatvec (1.0, rap_matrix, x, 0.0, y); ddata = hypre_ParVectorInnerProd(y, y); - if (mypid == 0) hypre_printf("(2) A^2 block inner product = %e\n", ddata); - if (mypid == 0) hypre_printf("(1) and (2) should be equal.\n"); + if (mypid == 0) { hypre_printf("(2) A^2 block inner product = %e\n", ddata); } + if (mypid == 0) { hypre_printf("(1) and (2) should be equal.\n"); } #if 0 /* --------------------------------------------- */ @@ -286,21 +306,23 @@ HYPRE_Int main( HYPRE_Int argc, char *argv[] ) diag_j = hypre_CSRBlockMatrixJ(A_diag); diag_d = hypre_CSRBlockMatrixData(A_diag); for (ii = 0; ii < hypre_ParCSRMatrixNumRows(par_matrix); ii++) - for (jj = diag_i[ii]; jj < diag_i[ii+1]; jj++) - hypre_printf("A %4d %4d = %e\n",ii,diag_j[jj],diag_d[jj]); + for (jj = diag_i[ii]; jj < diag_i[ii + 1]; jj++) + { + hypre_printf("A %4d %4d = %e\n", ii, diag_j[jj], diag_d[jj]); + } diag = hypre_ParCSRBlockMatrixDiag(rap_matrix); diag_i = hypre_CSRBlockMatrixI(diag); diag_j = hypre_CSRBlockMatrixJ(diag); diag_d = hypre_CSRBlockMatrixData(diag); - hypre_printf("RAP block size = %d\n",hypre_ParCSRBlockMatrixBlockSize(rap_matrix)); - hypre_printf("RAP num rows = %d\n",hypre_ParCSRBlockMatrixNumRows(rap_matrix)); + hypre_printf("RAP block size = %d\n", hypre_ParCSRBlockMatrixBlockSize(rap_matrix)); + hypre_printf("RAP num rows = %d\n", hypre_ParCSRBlockMatrixNumRows(rap_matrix)); for (ii = 0; ii < hypre_ParCSRBlockMatrixNumRows(rap_matrix); ii++) for (row = 0; row < block_size; row++) - for (jj = diag_i[ii]; jj < diag_i[ii+1]; jj++) + for (jj = diag_i[ii]; jj < diag_i[ii + 1]; jj++) for (col = 0; col < block_size; col++) - hypre_printf("RAP %4d %4d = %e\n",ii*block_size+row, - diag_j[jj]*block_size+col,diag_d[(jj+row)*block_size+col]); + hypre_printf("RAP %4d %4d = %e\n", ii * block_size + row, + diag_j[jj]*block_size + col, diag_d[(jj + row)*block_size + col]); offd = hypre_ParCSRBlockMatrixOffd(rap_matrix); offd_i = hypre_CSRBlockMatrixI(offd); offd_j = hypre_CSRBlockMatrixJ(offd); @@ -309,10 +331,10 @@ HYPRE_Int main( HYPRE_Int argc, char *argv[] ) { for (ii = 0; ii < hypre_ParCSRBlockMatrixNumRows(rap_matrix); ii++) for (row = 0; row < block_size; row++) - for (jj = offd_i[ii]; jj < offd_i[ii+1]; jj++) + for (jj = offd_i[ii]; jj < offd_i[ii + 1]; jj++) for (col = 0; col < block_size; col++) - hypre_printf("RAPOFFD %4d %4d = %e\n",ii*block_size+row, - offd_j[jj]*block_size+col,offd_d[(jj+row)*block_size+col]); + hypre_printf("RAPOFFD %4d %4d = %e\n", ii * block_size + row, + offd_j[jj]*block_size + col, offd_d[(jj + row)*block_size + col]); } #endif hypre_ParVectorDestroy(x); @@ -331,16 +353,16 @@ HYPRE_Int main( HYPRE_Int argc, char *argv[] ) { fp = fopen("Amat_ee", "r"); hypre_fscanf(fp, "%d %d", &global_num_rows, &num_nonzeros_diag); - diag_i = hypre_TAlloc(HYPRE_Int, (global_num_rows+1) , HYPRE_MEMORY_HOST); - diag_j = hypre_TAlloc(HYPRE_Int, num_nonzeros_diag , HYPRE_MEMORY_HOST); - diag_d = hypre_TAlloc(HYPRE_Complex, num_nonzeros_diag , HYPRE_MEMORY_HOST); + diag_i = hypre_TAlloc(HYPRE_Int, (global_num_rows + 1), HYPRE_MEMORY_HOST); + diag_j = hypre_TAlloc(HYPRE_Int, num_nonzeros_diag, HYPRE_MEMORY_HOST); + diag_d = hypre_TAlloc(HYPRE_Complex, num_nonzeros_diag, HYPRE_MEMORY_HOST); row = 0; nnz = 0; diag_i[0] = 0; for (ii = 0; ii < num_nonzeros_diag; ii++) { hypre_fscanf(fp, "%d %d %lg", &jj, &col, &ddata); - if ((jj-1) != row) + if ((jj - 1) != row) { row++; diag_i[row] = nnz; @@ -350,17 +372,17 @@ HYPRE_Int main( HYPRE_Int argc, char *argv[] ) } diag_i[global_num_rows] = nnz; fclose(fp); - hypre_printf("nrows = %d, nnz = %d\n", row+1, nnz); + hypre_printf("nrows = %d, nnz = %d\n", row + 1, nnz); - row_starts = hypre_TAlloc(HYPRE_Int, 2 , HYPRE_MEMORY_HOST); - col_starts = hypre_TAlloc(HYPRE_Int, 2 , HYPRE_MEMORY_HOST); + row_starts = hypre_TAlloc(HYPRE_Int, 2, HYPRE_MEMORY_HOST); + col_starts = hypre_TAlloc(HYPRE_Int, 2, HYPRE_MEMORY_HOST); row_starts[0] = col_starts[0] = 0; row_starts[1] = col_starts[1] = global_num_rows; num_cols_offd = 0; num_nonzeros_offd = 0; - par_matrix = hypre_ParCSRMatrixCreate(hypre_MPI_COMM_WORLD,global_num_rows, - global_num_rows, row_starts, col_starts, num_cols_offd, - num_nonzeros_diag, num_nonzeros_offd); + par_matrix = hypre_ParCSRMatrixCreate(hypre_MPI_COMM_WORLD, global_num_rows, + global_num_rows, row_starts, col_starts, num_cols_offd, + num_nonzeros_diag, num_nonzeros_offd); A_diag = hypre_ParCSRMatrixDiag(par_matrix); hypre_CSRMatrixI(A_diag) = diag_i; hypre_CSRMatrixJ(A_diag) = diag_j; @@ -372,17 +394,17 @@ HYPRE_Int main( HYPRE_Int argc, char *argv[] ) fp = fopen("Gmat", "r"); hypre_fscanf(fp, "%d %d %d", &global_num_rows, &global_num_cols, - &num_nonzeros_diag); - diag_i = hypre_TAlloc(HYPRE_Int, (global_num_rows+1) , HYPRE_MEMORY_HOST); - diag_j = hypre_TAlloc(HYPRE_Int, num_nonzeros_diag , HYPRE_MEMORY_HOST); - diag_d = hypre_TAlloc(HYPRE_Complex, num_nonzeros_diag , HYPRE_MEMORY_HOST); + &num_nonzeros_diag); + diag_i = hypre_TAlloc(HYPRE_Int, (global_num_rows + 1), HYPRE_MEMORY_HOST); + diag_j = hypre_TAlloc(HYPRE_Int, num_nonzeros_diag, HYPRE_MEMORY_HOST); + diag_d = hypre_TAlloc(HYPRE_Complex, num_nonzeros_diag, HYPRE_MEMORY_HOST); row = 0; nnz = 0; diag_i[0] = 0; for (ii = 0; ii < num_nonzeros_diag; ii++) { hypre_fscanf(fp, "%d %d %lg", &jj, &col, &ddata); - if ((jj-1) != row) + if ((jj - 1) != row) { row++; diag_i[row] = nnz; @@ -393,16 +415,16 @@ HYPRE_Int main( HYPRE_Int argc, char *argv[] ) diag_i[global_num_rows] = nnz; fclose(fp); - row_starts = hypre_TAlloc(HYPRE_Int, 2 , HYPRE_MEMORY_HOST); - col_starts = hypre_TAlloc(HYPRE_Int, 2 , HYPRE_MEMORY_HOST); + row_starts = hypre_TAlloc(HYPRE_Int, 2, HYPRE_MEMORY_HOST); + col_starts = hypre_TAlloc(HYPRE_Int, 2, HYPRE_MEMORY_HOST); row_starts[0] = col_starts[0] = 0; row_starts[1] = global_num_rows; col_starts[1] = global_num_cols; num_cols_offd = 0; num_nonzeros_offd = 0; - g_matrix = hypre_ParCSRMatrixCreate(hypre_MPI_COMM_WORLD,global_num_rows, - global_num_cols, row_starts, col_starts, num_cols_offd, - num_nonzeros_diag, num_nonzeros_offd); + g_matrix = hypre_ParCSRMatrixCreate(hypre_MPI_COMM_WORLD, global_num_rows, + global_num_cols, row_starts, col_starts, num_cols_offd, + num_nonzeros_diag, num_nonzeros_offd); A_diag = hypre_ParCSRMatrixDiag(g_matrix); hypre_CSRMatrixI(A_diag) = diag_i; hypre_CSRMatrixJ(A_diag) = diag_j; @@ -433,33 +455,33 @@ HYPRE_Int main( HYPRE_Int argc, char *argv[] ) HYPRE_GMRESSetLogging(gmres_solver, 1); HYPRE_GMRESSetPrintLevel(gmres_solver, 2); HYPRE_BlockTridiagCreate(&precon); - HYPRE_BlockTridiagSetPrintLevel(precon,0); - HYPRE_BlockTridiagSetAMGNumSweeps(precon,1); - local_size = col_starts[mypid+1] - col_starts[mypid]; - index_set = hypre_CTAlloc(HYPRE_Int, local_size+1, HYPRE_MEMORY_HOST); + HYPRE_BlockTridiagSetPrintLevel(precon, 0); + HYPRE_BlockTridiagSetAMGNumSweeps(precon, 1); + local_size = col_starts[mypid + 1] - col_starts[mypid]; + index_set = hypre_CTAlloc(HYPRE_Int, local_size + 1, HYPRE_MEMORY_HOST); jj = 0; /* for (ii = 0; ii < local_size/2; ii++) index_set[jj++] = ii * 2; */ - for (ii = 0; ii < local_size/2; ii++) index_set[jj++] = ii; + for (ii = 0; ii < local_size / 2; ii++) { index_set[jj++] = ii; } HYPRE_BlockTridiagSetIndexSet(precon, jj, index_set); HYPRE_GMRESSetPrecond(gmres_solver, - (HYPRE_PtrToSolverFcn) HYPRE_BlockTridiagSolve, - (HYPRE_PtrToSolverFcn) HYPRE_BlockTridiagSetup, - precon); - col_starts2 = hypre_CTAlloc(HYPRE_Int, nprocs+1, HYPRE_MEMORY_HOST); - for (ii = 0; ii <= nprocs; ii++) col_starts2[ii] = col_starts[ii]; - x = hypre_ParVectorCreate(hypre_MPI_COMM_WORLD,global_num_cols,col_starts2); + (HYPRE_PtrToSolverFcn) HYPRE_BlockTridiagSolve, + (HYPRE_PtrToSolverFcn) HYPRE_BlockTridiagSetup, + precon); + col_starts2 = hypre_CTAlloc(HYPRE_Int, nprocs + 1, HYPRE_MEMORY_HOST); + for (ii = 0; ii <= nprocs; ii++) { col_starts2[ii] = col_starts[ii]; } + x = hypre_ParVectorCreate(hypre_MPI_COMM_WORLD, global_num_cols, col_starts2); hypre_ParVectorInitialize(x); x_local = hypre_ParVectorLocalVector(x); - local_size = col_starts2[mypid+1] - col_starts2[mypid]; + local_size = col_starts2[mypid + 1] - col_starts2[mypid]; data = hypre_VectorData(x_local); - for (ii=0; ii < local_size; ii++) data[ii] = 0.0; - row_starts2 = hypre_CTAlloc(HYPRE_Int, nprocs+1, HYPRE_MEMORY_HOST); - for (ii = 0; ii <= nprocs; ii++) row_starts2[ii] = row_starts[ii]; - y = hypre_ParVectorCreate(hypre_MPI_COMM_WORLD,global_num_rows,row_starts2); + for (ii = 0; ii < local_size; ii++) { data[ii] = 0.0; } + row_starts2 = hypre_CTAlloc(HYPRE_Int, nprocs + 1, HYPRE_MEMORY_HOST); + for (ii = 0; ii <= nprocs; ii++) { row_starts2[ii] = row_starts[ii]; } + y = hypre_ParVectorCreate(hypre_MPI_COMM_WORLD, global_num_rows, row_starts2); hypre_ParVectorInitialize(y); y_local = hypre_ParVectorLocalVector(y); data = hypre_VectorData(y_local); - for (ii = 0; ii < local_size; ii++) data[ii] = 1.0; + for (ii = 0; ii < local_size; ii++) { data[ii] = 1.0; } HYPRE_GMRESSetup(gmres_solver, (HYPRE_Matrix) par_matrix, (HYPRE_Vector) y, (HYPRE_Vector) x); @@ -504,8 +526,8 @@ HYPRE_Int MyBuildParLaplacian9pt(HYPRE_ParCSRMatrix *A_ptr) nx = 200; ny = 200; P = 2; - if (num_procs == 1) P = 1; - Q = num_procs/P; + if (num_procs == 1) { P = 1; } + Q = num_procs / P; /*----------------------------------------------------------- * Print driver parameters @@ -523,7 +545,7 @@ HYPRE_Int MyBuildParLaplacian9pt(HYPRE_ParCSRMatrix *A_ptr) *-----------------------------------------------------------*/ p = myid % P; - q = ( myid - p)/P; + q = ( myid - p) / P; /*----------------------------------------------------------- * Generate the matrix @@ -532,11 +554,11 @@ HYPRE_Int MyBuildParLaplacian9pt(HYPRE_ParCSRMatrix *A_ptr) values = hypre_CTAlloc(HYPRE_Complex, 2, HYPRE_MEMORY_HOST); values[1] = -1.; values[0] = 0.; - if (nx > 1) values[0] += 2.0; - if (ny > 1) values[0] += 2.0; - if (nx > 1 && ny > 1) values[0] += 4.0; + if (nx > 1) { values[0] += 2.0; } + if (ny > 1) { values[0] += 2.0; } + if (nx > 1 && ny > 1) { values[0] += 4.0; } A = (HYPRE_ParCSRMatrix) GenerateLaplacian9pt(hypre_MPI_COMM_WORLD, - nx, ny, P, Q, p, q, values); + nx, ny, P, Q, p, q, values); hypre_TFree(values, HYPRE_MEMORY_HOST); *A_ptr = A; return (0); diff --git a/external/hypre/src/parcsr_block_mv/par_block_nodal_systems.c b/external/hypre/src/parcsr_block_mv/par_block_nodal_systems.c index e4f88d99..5998b81c 100644 --- a/external/hypre/src/parcsr_block_mv/par_block_nodal_systems.c +++ b/external/hypre/src/parcsr_block_mv/par_block_nodal_systems.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -9,17 +9,17 @@ /*--------------------------------------------------------------------------- * hypre_BoomerAMGBlockCreateNodalA - - This is the block version of creating a nodal norm matrix. - - option: determine which type of "norm" (or other measurement) is used. - - 1 = frobenius - 2 = sum of abs. value of all elements - 3 = largest element (positive or negative) - 4 = 1-norm - 5 = inf - norm - 6 = sum of all elements + * + * This is the block version of creating a nodal norm matrix. + * + * Option: determine which type of "norm" (or other measurement) is used. + * + * 1 = frobenius + * 2 = sum of abs. value of all elements + * 3 = largest element (positive or negative) + * 4 = 1-norm + * 5 = inf - norm + * 6 = sum of all elements *--------------------------------------------------------------------------*/ HYPRE_Int @@ -34,7 +34,7 @@ hypre_BoomerAMGBlockCreateNodalA(hypre_ParCSRBlockMatrix *A, HYPRE_Real *A_diag_data = hypre_CSRBlockMatrixData(A_diag); HYPRE_Int block_size = hypre_CSRBlockMatrixBlockSize(A_diag); - HYPRE_Int bnnz = block_size*block_size; + HYPRE_Int bnnz = block_size * block_size; hypre_CSRBlockMatrix *A_offd = hypre_ParCSRMatrixOffd(A); HYPRE_Int *A_offd_i = hypre_CSRBlockMatrixI(A_offd); @@ -51,7 +51,7 @@ hypre_BoomerAMGBlockCreateNodalA(hypre_ParCSRBlockMatrix *A, hypre_ParCSRMatrix *AN; hypre_CSRMatrix *AN_diag; HYPRE_Int *AN_diag_i; - HYPRE_Int *AN_diag_j=NULL; + HYPRE_Int *AN_diag_j = NULL; HYPRE_Real *AN_diag_data = NULL; hypre_CSRMatrix *AN_offd; HYPRE_Int *AN_offd_i; @@ -89,7 +89,7 @@ hypre_BoomerAMGBlockCreateNodalA(hypre_ParCSRBlockMatrix *A, HYPRE_Real tmp; HYPRE_Real sum; - hypre_MPI_Comm_size(comm,&num_procs); + hypre_MPI_Comm_size(comm, &num_procs); if (!comm_pkg) { @@ -107,7 +107,7 @@ hypre_BoomerAMGBlockCreateNodalA(hypre_ParCSRBlockMatrix *A, /* the diag part */ num_nonzeros_diag = A_diag_i[num_nodes]; - AN_diag_i = hypre_CTAlloc(HYPRE_Int, num_nodes+1, HYPRE_MEMORY_HOST); + AN_diag_i = hypre_CTAlloc(HYPRE_Int, num_nodes + 1, HYPRE_MEMORY_HOST); for (i = 0; i <= num_nodes; i++) { @@ -125,7 +125,7 @@ hypre_BoomerAMGBlockCreateNodalA(hypre_ParCSRBlockMatrix *A, for (i = 0; i < num_nonzeros_diag; i++) { AN_diag_j[i] = A_diag_j[i]; - hypre_CSRBlockMatrixBlockNorm(norm_type, &A_diag_data[i*bnnz], + hypre_CSRBlockMatrixBlockNorm(norm_type, &A_diag_data[i * bnnz], &tmp, block_size); AN_diag_data[i] = tmp; } @@ -140,7 +140,7 @@ hypre_BoomerAMGBlockCreateNodalA(hypre_ParCSRBlockMatrix *A, { index = AN_diag_i[i]; sum = 0.0; - for (k = AN_diag_i[i]+1; k < AN_diag_i[i+1]; k++) + for (k = AN_diag_i[i] + 1; k < AN_diag_i[i + 1]; k++) { sum += AN_diag_data[k]; @@ -164,54 +164,50 @@ hypre_BoomerAMGBlockCreateNodalA(hypre_ParCSRBlockMatrix *A, /* copy the commpkg */ if (comm_pkg) { - comm_pkg_AN = hypre_CTAlloc(hypre_ParCSRCommPkg, 1, HYPRE_MEMORY_HOST); - hypre_ParCSRCommPkgComm(comm_pkg_AN) = comm; - - num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - hypre_ParCSRCommPkgNumSends(comm_pkg_AN) = num_sends; - num_recvs = hypre_ParCSRCommPkgNumRecvs(comm_pkg); - hypre_ParCSRCommPkgNumRecvs(comm_pkg_AN) = num_recvs; - + recv_procs = hypre_ParCSRCommPkgRecvProcs(comm_pkg); + recv_vec_starts = hypre_ParCSRCommPkgRecvVecStarts(comm_pkg); + num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); send_procs = hypre_ParCSRCommPkgSendProcs(comm_pkg); send_map_starts = hypre_ParCSRCommPkgSendMapStarts(comm_pkg); send_map_elmts = hypre_ParCSRCommPkgSendMapElmts(comm_pkg); + if (num_sends) { send_procs_AN = hypre_CTAlloc(HYPRE_Int, num_sends, HYPRE_MEMORY_HOST); - send_map_elmts_AN = hypre_CTAlloc(HYPRE_Int, send_map_starts[num_sends], HYPRE_MEMORY_HOST); + send_map_elmts_AN = hypre_CTAlloc(HYPRE_Int, send_map_starts[num_sends], + HYPRE_MEMORY_HOST); } - send_map_starts_AN = hypre_CTAlloc(HYPRE_Int, num_sends+1, HYPRE_MEMORY_HOST); - send_map_starts_AN[0] = 0; + send_map_starts_AN = hypre_CTAlloc(HYPRE_Int, num_sends + 1, HYPRE_MEMORY_HOST); for (i = 0; i < num_sends; i++) { send_procs_AN[i] = send_procs[i]; - send_map_starts_AN[i+1] = send_map_starts[i+1]; + send_map_starts_AN[i + 1] = send_map_starts[i + 1]; } + cnt = send_map_starts_AN[num_sends]; for (i = 0; i < cnt; i++) { send_map_elmts_AN[i] = send_map_elmts[i]; } - hypre_ParCSRCommPkgSendProcs(comm_pkg_AN) = send_procs_AN; - hypre_ParCSRCommPkgSendMapStarts(comm_pkg_AN) = send_map_starts_AN; - hypre_ParCSRCommPkgSendMapElmts(comm_pkg_AN) = send_map_elmts_AN; - - recv_procs = hypre_ParCSRCommPkgRecvProcs(comm_pkg); - recv_vec_starts = hypre_ParCSRCommPkgRecvVecStarts(comm_pkg); - recv_vec_starts_AN = hypre_CTAlloc(HYPRE_Int, num_recvs+1, HYPRE_MEMORY_HOST); - if (num_recvs) recv_procs_AN = hypre_CTAlloc(HYPRE_Int, num_recvs, HYPRE_MEMORY_HOST); - recv_vec_starts_AN[0] = recv_vec_starts[0]; + recv_vec_starts_AN = hypre_CTAlloc(HYPRE_Int, num_recvs + 1, HYPRE_MEMORY_HOST); + if (num_recvs) + { + recv_procs_AN = hypre_CTAlloc(HYPRE_Int, num_recvs, HYPRE_MEMORY_HOST); + } for (i = 0; i < num_recvs; i++) { recv_procs_AN[i] = recv_procs[i]; - recv_vec_starts_AN[i+1] = recv_vec_starts[i+1]; - + recv_vec_starts_AN[i + 1] = recv_vec_starts[i + 1]; } - hypre_ParCSRCommPkgRecvProcs(comm_pkg_AN) = recv_procs_AN; - hypre_ParCSRCommPkgRecvVecStarts(comm_pkg_AN) = recv_vec_starts_AN; + /* Create communication package */ + hypre_ParCSRCommPkgCreateAndFill(comm, + num_recvs, recv_procs_AN, recv_vec_starts_AN, + num_sends, send_procs_AN, send_map_starts_AN, + send_map_elmts_AN, + &comm_pkg_AN); } /* the off-diag part */ @@ -224,7 +220,7 @@ hypre_BoomerAMGBlockCreateNodalA(hypre_ParCSRBlockMatrix *A, } num_nonzeros_offd = A_offd_i[num_nodes]; - AN_offd_i = hypre_CTAlloc(HYPRE_Int, num_nodes+1, HYPRE_MEMORY_HOST); + AN_offd_i = hypre_CTAlloc(HYPRE_Int, num_nodes + 1, HYPRE_MEMORY_HOST); for (i = 0; i <= num_nodes; i++) { AN_offd_i[i] = A_offd_i[i]; @@ -236,7 +232,7 @@ hypre_BoomerAMGBlockCreateNodalA(hypre_ParCSRBlockMatrix *A, for (i = 0; i < num_nonzeros_offd; i++) { AN_offd_j[i] = A_offd_j[i]; - hypre_CSRBlockMatrixBlockNorm(norm_type, &A_offd_data[i*bnnz], + hypre_CSRBlockMatrixBlockNorm(norm_type, &A_offd_data[i * bnnz], &tmp, block_size); AN_offd_data[i] = tmp; } @@ -255,7 +251,7 @@ hypre_BoomerAMGBlockCreateNodalA(hypre_ParCSRBlockMatrix *A, for (i = 0; i < num_nodes; i++) { sum = 0.0; - for (k = AN_offd_i[i]; k < AN_offd_i[i+1]; k++) + for (k = AN_offd_i[i]; k < AN_offd_i[i + 1]; k++) { sum += AN_offd_data[k]; } diff --git a/external/hypre/src/parcsr_block_mv/par_csr_block_comm.c b/external/hypre/src/parcsr_block_mv/par_csr_block_comm.c index 195b10a0..af5c08f7 100644 --- a/external/hypre/src/parcsr_block_mv/par_csr_block_comm.c +++ b/external/hypre/src/parcsr_block_mv/par_csr_block_comm.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -44,8 +44,8 @@ hypre_ParCSRBlockCommHandleCreate(HYPRE_Int job, num_requests = num_sends + num_recvs; requests = hypre_CTAlloc(hypre_MPI_Request, num_requests, HYPRE_MEMORY_HOST); - hypre_MPI_Comm_size(comm,&num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); j = 0; @@ -56,19 +56,19 @@ hypre_ParCSRBlockCommHandleCreate(HYPRE_Int job, for (i = 0; i < num_recvs; i++) { ip = hypre_ParCSRCommPkgRecvProc(comm_pkg, i); - vec_start = hypre_ParCSRCommPkgRecvVecStart(comm_pkg,i); + vec_start = hypre_ParCSRCommPkgRecvVecStart(comm_pkg, i); vec_len = - (hypre_ParCSRCommPkgRecvVecStart(comm_pkg,i+1)-vec_start)*bnnz; - hypre_MPI_Irecv(&d_recv_data[vec_start*bnnz], vec_len, + (hypre_ParCSRCommPkgRecvVecStart(comm_pkg, i + 1) - vec_start) * bnnz; + hypre_MPI_Irecv(&d_recv_data[vec_start * bnnz], vec_len, HYPRE_MPI_COMPLEX, ip, 0, comm, &requests[j++]); } for (i = 0; i < num_sends; i++) { vec_start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); vec_len = - (hypre_ParCSRCommPkgSendMapStart(comm_pkg,i+1)-vec_start)*bnnz; + (hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1) - vec_start) * bnnz; ip = hypre_ParCSRCommPkgSendProc(comm_pkg, i); - hypre_MPI_Isend(&d_send_data[vec_start*bnnz], vec_len, + hypre_MPI_Isend(&d_send_data[vec_start * bnnz], vec_len, HYPRE_MPI_COMPLEX, ip, 0, comm, &requests[j++]); } break; @@ -80,18 +80,18 @@ hypre_ParCSRBlockCommHandleCreate(HYPRE_Int job, { vec_start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); vec_len = - (hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1) - vec_start)*bnnz; + (hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1) - vec_start) * bnnz; ip = hypre_ParCSRCommPkgSendProc(comm_pkg, i); - hypre_MPI_Irecv(&d_recv_data[vec_start*bnnz], vec_len, + hypre_MPI_Irecv(&d_recv_data[vec_start * bnnz], vec_len, HYPRE_MPI_COMPLEX, ip, 0, comm, &requests[j++]); } for (i = 0; i < num_recvs; i++) { ip = hypre_ParCSRCommPkgRecvProc(comm_pkg, i); - vec_start = hypre_ParCSRCommPkgRecvVecStart(comm_pkg,i); + vec_start = hypre_ParCSRCommPkgRecvVecStart(comm_pkg, i); vec_len = - (hypre_ParCSRCommPkgRecvVecStart(comm_pkg,i+1)-vec_start)*bnnz; - hypre_MPI_Isend(&d_send_data[vec_start*bnnz], vec_len, + (hypre_ParCSRCommPkgRecvVecStart(comm_pkg, i + 1) - vec_start) * bnnz; + hypre_MPI_Isend(&d_send_data[vec_start * bnnz], vec_len, HYPRE_MPI_COMPLEX, ip, 0, comm, &requests[j++]); } break; @@ -121,7 +121,7 @@ hypre_ParCSRBlockCommHandleDestroy(hypre_ParCSRCommHandle *comm_handle) { hypre_MPI_Status *status0; - if ( comm_handle==NULL ) return hypre_error_flag; + if ( comm_handle == NULL ) { return hypre_error_flag; } if (hypre_ParCSRCommHandleNumRequests(comm_handle)) { @@ -205,7 +205,7 @@ hypre_ParCSRBlockMatrixDestroyAssumedPartition( hypre_ParCSRBlockMatrix *matrix apart = hypre_ParCSRMatrixAssumedPartition(matrix); - if(apart->storage_length > 0) + if (apart->storage_length > 0) { hypre_TFree(apart->proc_list, HYPRE_MEMORY_HOST); hypre_TFree(apart->row_start_list, HYPRE_MEMORY_HOST); diff --git a/external/hypre/src/parcsr_block_mv/par_csr_block_interp.c b/external/hypre/src/parcsr_block_mv/par_csr_block_interp.c index 9c733ecb..b2d11201 100644 --- a/external/hypre/src/parcsr_block_mv/par_csr_block_interp.c +++ b/external/hypre/src/parcsr_block_mv/par_csr_block_interp.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -24,18 +24,19 @@ *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, - HYPRE_Int *CF_marker, - hypre_ParCSRMatrix *S, - HYPRE_BigInt *num_cpts_global, - HYPRE_Int num_functions, - HYPRE_Int *dof_func, - HYPRE_Int debug_flag, - HYPRE_Real trunc_factor, - HYPRE_Int max_elmts, - HYPRE_Int add_weak_to_diag, - hypre_ParCSRBlockMatrix **P_ptr ) +hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, + HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, + HYPRE_BigInt *num_cpts_global, + HYPRE_Int num_functions, + HYPRE_Int *dof_func, + HYPRE_Int debug_flag, + HYPRE_Real trunc_factor, + HYPRE_Int max_elmts, + HYPRE_Int add_weak_to_diag, + hypre_ParCSRBlockMatrix **P_ptr ) { + HYPRE_UNUSED_VAR(dof_func); MPI_Comm comm = hypre_ParCSRBlockMatrixComm(A); hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRBlockMatrixCommPkg(A); @@ -47,7 +48,7 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, HYPRE_Int *A_diag_j = hypre_CSRBlockMatrixJ(A_diag); HYPRE_Int block_size = hypre_CSRBlockMatrixBlockSize(A_diag); - HYPRE_Int bnnz = block_size*block_size; + HYPRE_Int bnnz = block_size * block_size; hypre_CSRBlockMatrix *A_offd = hypre_ParCSRBlockMatrixOffd(A); HYPRE_Real *A_offd_data = hypre_CSRBlockMatrixData(A_offd); @@ -70,8 +71,7 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, HYPRE_Int *CF_marker_offd = NULL; - hypre_CSRBlockMatrix *A_ext; - + hypre_CSRBlockMatrix *A_ext = NULL; HYPRE_Real *A_ext_data = NULL; HYPRE_Int *A_ext_i = NULL; HYPRE_BigInt *A_ext_j = NULL; @@ -90,10 +90,10 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, HYPRE_Int *P_marker, *P_marker_offd; - HYPRE_Int jj_counter,jj_counter_offd; + HYPRE_Int jj_counter, jj_counter_offd; HYPRE_Int *jj_count, *jj_count_offd = NULL; - HYPRE_Int jj_begin_row,jj_begin_row_offd; - HYPRE_Int jj_end_row,jj_end_row_offd; + HYPRE_Int jj_begin_row, jj_begin_row_offd; + HYPRE_Int jj_end_row, jj_end_row_offd; HYPRE_Int start_indexing = 0; /* start indexing for P_data at 0 */ @@ -110,8 +110,8 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, HYPRE_Int bd; - HYPRE_Int i,i1,i2; - HYPRE_Int j,jl,jj,jj1; + HYPRE_Int i, i1, i2; + HYPRE_Int j, jl, jj, jj1; HYPRE_Int kc; HYPRE_BigInt big_k; HYPRE_Int start; @@ -131,7 +131,7 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, HYPRE_Int local_numrows = hypre_CSRBlockMatrixNumRows(A_diag); HYPRE_BigInt col_n = col_1 + (HYPRE_BigInt)local_numrows; - HYPRE_Real wall_time; /* for debugging instrumentation */ + HYPRE_Real wall_time = 0.0; /* for debugging instrumentation */ HYPRE_Real *identity_block; HYPRE_Real *zero_block; @@ -140,19 +140,24 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, HYPRE_Real *distribute_block; hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_rank(comm, &my_id); /* num_threads = hypre_NumThreads(); */ num_threads = 1; + if (num_functions > 1) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Not implemented for num_functions > 1!"); + } + my_first_cpt = num_cpts_global[0]; - if (my_id == (num_procs -1)) total_global_cpts = num_cpts_global[1]; - hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); + if (my_id == (num_procs - 1)) { total_global_cpts = num_cpts_global[1]; } + hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); /*------------------------------------------------------------------- * Get the CF_marker data for the off-processor columns *-------------------------------------------------------------------*/ - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } CF_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); @@ -164,31 +169,29 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, } num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, - num_sends), HYPRE_MEMORY_HOST); + int_buf_data = hypre_CTAlloc(HYPRE_Int, + hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); index = 0; for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { int_buf_data[index++] - = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } - } /* we do not need the block version of comm handle - because CF_marker corresponds to the nodal matrix. This call populates CF_marker_offd */ - comm_handle = hypre_ParCSRCommHandleCreate( 11, comm_pkg, int_buf_data, - CF_marker_offd); - + comm_handle = hypre_ParCSRCommHandleCreate(11, comm_pkg, int_buf_data, + CF_marker_offd); hypre_ParCSRCommHandleDestroy(comm_handle); - - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Interp: Comm 1 CF_marker = %f\n", @@ -200,7 +203,7 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, * Get the ghost rows of A *---------------------------------------------------------------------*/ - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } if (num_procs > 1) { @@ -211,9 +214,9 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, } index = 0; - for (i=0; i < num_cols_A_offd; i++) + for (i = 0; i < num_cols_A_offd; i++) { - for (j=A_ext_i[i]; j < A_ext_i[i+1]; j++) + for (j = A_ext_i[i]; j < A_ext_i[i + 1]; j++) { big_k = A_ext_j[j]; if (big_k >= col_1 && big_k < col_n) @@ -222,7 +225,7 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, /* for the data field we must get all of the block data */ for (bd = 0; bd < bnnz; bd++) { - A_ext_data[index*bnnz + bd] = A_ext_data[j*bnnz + bd]; + A_ext_data[index * bnnz + bd] = A_ext_data[j * bnnz + bd]; } index++; } @@ -231,10 +234,10 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, kc = hypre_BigBinarySearch(col_map_offd, big_k, num_cols_A_offd); if (kc > -1) { - A_ext_j[index] = (HYPRE_BigInt)(-kc-1); + A_ext_j[index] = (HYPRE_BigInt)(-kc - 1); for (bd = 0; bd < bnnz; bd++) { - A_ext_data[index*bnnz + bd] = A_ext_data[j*bnnz + bd]; + A_ext_data[index * bnnz + bd] = A_ext_data[j * bnnz + bd]; } index++; } @@ -243,10 +246,12 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, A_ext_i[i] = index; } for (i = num_cols_A_offd; i > 0; i--) - A_ext_i[i] = A_ext_i[i-1]; - if (num_procs > 1) A_ext_i[0] = 0; + { + A_ext_i[i] = A_ext_i[i - 1]; + } + if (num_procs > 1) { A_ext_i[0] = 0; } - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Interp: Comm 2 Get A_ext = %f\n", @@ -269,7 +274,7 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, fine_to_coarse = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); - for (i = 0; i < n_fine; i++) fine_to_coarse[i] = -1; + for (i = 0; i < n_fine; i++) { fine_to_coarse[i] = -1; } jj_counter = start_indexing; jj_counter_offd = start_indexing; @@ -281,17 +286,17 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, for (j = 0; j < num_threads; j++) { - size = n_fine/num_threads; - rest = n_fine - size*num_threads; + size = n_fine / num_threads; + rest = n_fine - size * num_threads; if (j < rest) { - ns = j*size+j; - ne = (j+1)*size+j+1; + ns = j * size + j; + ne = (j + 1) * size + j + 1; } else { - ns = j*size+rest; - ne = (j+1)*size+rest; + ns = j * size + rest; + ne = (j + 1) * size + rest; } @@ -318,7 +323,7 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, else { - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) { i1 = S_diag_j[jj]; if (CF_marker[i1] >= 0) @@ -329,7 +334,7 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, if (num_procs > 1) { - for (jj = S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) { i1 = S_offd_j[jj]; if (CF_marker_offd[i1] >= 0) @@ -346,32 +351,32 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, * Allocate arrays. *-----------------------------------------------------------------------*/ - for (i=0; i < num_threads-1; i++) + for (i = 0; i < num_threads - 1; i++) { - coarse_counter[i+1] += coarse_counter[i]; - jj_count[i+1] += jj_count[i]; - jj_count_offd[i+1] += jj_count_offd[i]; + coarse_counter[i + 1] += coarse_counter[i]; + jj_count[i + 1] += jj_count[i]; + jj_count_offd[i + 1] += jj_count_offd[i]; } - i = num_threads-1; + i = num_threads - 1; jj_counter = jj_count[i]; jj_counter_offd = jj_count_offd[i]; P_diag_size = jj_counter; - P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, HYPRE_MEMORY_HOST); + P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, HYPRE_MEMORY_HOST); P_diag_j = hypre_CTAlloc(HYPRE_Int, P_diag_size, HYPRE_MEMORY_HOST); /* we need to include the size of the blocks in the data size */ - P_diag_data = hypre_CTAlloc(HYPRE_Real, P_diag_size*bnnz, HYPRE_MEMORY_HOST); + P_diag_data = hypre_CTAlloc(HYPRE_Real, P_diag_size * bnnz, HYPRE_MEMORY_HOST); P_diag_i[n_fine] = jj_counter; P_offd_size = jj_counter_offd; - P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, HYPRE_MEMORY_HOST); + P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, HYPRE_MEMORY_HOST); P_offd_j = hypre_CTAlloc(HYPRE_Int, P_offd_size, HYPRE_MEMORY_HOST); /* we need to include the size of the blocks in the data size */ - P_offd_data = hypre_CTAlloc(HYPRE_Real, P_offd_size*bnnz, HYPRE_MEMORY_HOST); + P_offd_data = hypre_CTAlloc(HYPRE_Real, P_offd_size * bnnz, HYPRE_MEMORY_HOST); /*----------------------------------------------------------------------- * Intialize some stuff. @@ -380,7 +385,7 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, jj_counter = start_indexing; jj_counter_offd = start_indexing; - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Interp: Internal work 1 = %f\n", @@ -392,9 +397,9 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, identity_block = hypre_CTAlloc(HYPRE_Real, bnnz, HYPRE_MEMORY_HOST); zero_block = hypre_CTAlloc(HYPRE_Real, bnnz, HYPRE_MEMORY_HOST); - for(i = 0; i < block_size; i++) + for (i = 0; i < block_size; i++) { - identity_block[i*block_size + i] = 1.0; + identity_block[i * block_size + i] = 1.0; } @@ -407,38 +412,40 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, * Send and receive fine_to_coarse info. *-----------------------------------------------------------------------*/ - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } fine_to_coarse_offd = hypre_CTAlloc(HYPRE_BigInt, num_cols_A_offd, HYPRE_MEMORY_HOST); big_buf_data = hypre_CTAlloc(HYPRE_BigInt, hypre_ParCSRCommPkgSendMapStart(comm_pkg, - num_sends), HYPRE_MEMORY_HOST); + num_sends), HYPRE_MEMORY_HOST); for (j = 0; j < num_threads; j++) { coarse_shift = 0; - if (j > 0) coarse_shift = coarse_counter[j-1]; - size = n_fine/num_threads; - rest = n_fine - size*num_threads; + if (j > 0) { coarse_shift = coarse_counter[j - 1]; } + size = n_fine / num_threads; + rest = n_fine - size * num_threads; if (j < rest) { - ns = j*size+j; - ne = (j+1)*size+j+1; + ns = j * size + j; + ne = (j + 1) * size + j + 1; } else { - ns = j*size+rest; - ne = (j+1)*size+rest; + ns = j * size + rest; + ne = (j + 1) * size + rest; } for (i = ns; i < ne; i++) + { fine_to_coarse[i] += coarse_shift; + } } index = 0; for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) big_buf_data[index++] - = my_first_cpt+fine_to_coarse[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + = my_first_cpt + fine_to_coarse[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } /* again, we do not need to use the block version of comm handle since @@ -449,7 +456,7 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, hypre_ParCSRCommHandleDestroy(comm_handle); - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Interp: Comm 4 FineToCoarse = %f\n", @@ -457,7 +464,7 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, fflush(NULL); } - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } /*----------------------------------------------------------------------- * Loop over fine grid points. @@ -465,22 +472,22 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, for (jl = 0; jl < num_threads; jl++) { - size = n_fine/num_threads; - rest = n_fine - size*num_threads; + size = n_fine / num_threads; + rest = n_fine - size * num_threads; if (jl < rest) { - ns = jl*size+jl; - ne = (jl+1)*size+jl+1; + ns = jl * size + jl; + ne = (jl + 1) * size + jl + 1; } else { - ns = jl*size+rest; - ne = (jl+1)*size+rest; + ns = jl * size + rest; + ne = (jl + 1) * size + rest; } jj_counter = 0; - if (jl > 0) jj_counter = jj_count[jl-1]; + if (jl > 0) { jj_counter = jj_count[jl - 1]; } jj_counter_offd = 0; - if (jl > 0) jj_counter_offd = jj_count_offd[jl-1]; + if (jl > 0) { jj_counter_offd = jj_count_offd[jl - 1]; } P_marker = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); P_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); @@ -508,7 +515,7 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, P_diag_j[jj_counter] = fine_to_coarse[i]; /* P_diag_data[jj_counter] = one; */ hypre_CSRBlockMatrixBlockCopyData(identity_block, - &P_diag_data[jj_counter*bnnz], + &P_diag_data[jj_counter * bnnz], 1.0, block_size); jj_counter++; } @@ -523,7 +530,7 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, P_diag_i[i] = jj_counter; jj_begin_row = jj_counter; - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) { i1 = S_diag_j[jj]; @@ -538,7 +545,7 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, P_diag_j[jj_counter] = fine_to_coarse[i1]; /* P_diag_data[jj_counter] = zero; */ hypre_CSRBlockMatrixBlockCopyData(zero_block, - &P_diag_data[jj_counter*bnnz], + &P_diag_data[jj_counter * bnnz], 1.0, block_size); jj_counter++; } @@ -562,7 +569,7 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, if (num_procs > 1) { - for (jj = S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) { i1 = S_offd_j[jj]; @@ -577,10 +584,10 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, P_offd_j[jj_counter_offd] = i1; /* P_offd_data[jj_counter_offd] = zero; */ hypre_CSRBlockMatrixBlockCopyData(zero_block, - &P_offd_data[jj_counter_offd*bnnz], + &P_offd_data[jj_counter_offd * bnnz], 1.0, block_size); - jj_counter_offd++; + jj_counter_offd++; } /*----------------------------------------------------------- @@ -609,7 +616,7 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, /* Loop over ith row of A. First, the diagonal part of A */ - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) { i1 = A_diag_j[jj]; @@ -621,7 +628,7 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, if (P_marker[i1] >= jj_begin_row) { /* P_diag_data[P_marker[i1]] += A_diag_data[jj]; */ - hypre_CSRBlockMatrixBlockAddAccumulate(&A_diag_data[jj*bnnz], + hypre_CSRBlockMatrixBlockAddAccumulate(&A_diag_data[jj * bnnz], &P_diag_data[P_marker[i1]*bnnz], block_size); @@ -647,14 +654,14 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, *-----------------------------------------------------------*/ /* Diagonal block part of row i1 */ - for (jj1 = A_diag_i[i1]; jj1 < A_diag_i[i1+1]; jj1++) + for (jj1 = A_diag_i[i1]; jj1 < A_diag_i[i1 + 1]; jj1++) { i2 = A_diag_j[jj1]; if (P_marker[i2] >= jj_begin_row) { /* add diag data to sum */ /* sum += A_diag_data[jj1]; */ - hypre_CSRBlockMatrixBlockAddAccumulate(&A_diag_data[jj1*bnnz], + hypre_CSRBlockMatrixBlockAddAccumulate(&A_diag_data[jj1 * bnnz], sum_block, block_size); } } @@ -662,14 +669,14 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, /* Off-Diagonal block part of row i1 */ if (num_procs > 1) { - for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1+1]; jj1++) + for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1 + 1]; jj1++) { i2 = A_offd_j[jj1]; if (P_marker_offd[i2] >= jj_begin_row_offd ) { /* add off diag data to sum */ /*sum += A_offd_data[jj1];*/ - hypre_CSRBlockMatrixBlockAddAccumulate(&A_offd_data[jj1*bnnz], + hypre_CSRBlockMatrixBlockAddAccumulate(&A_offd_data[jj1 * bnnz], sum_block, block_size); } @@ -683,7 +690,7 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, we do sum^(-1) * A_diag_data - but it seems to matter a little for very non-sym */ - if (hypre_CSRBlockMatrixBlockMultInv(sum_block, &A_diag_data[jj*bnnz], + if (hypre_CSRBlockMatrixBlockMultInv(sum_block, &A_diag_data[jj * bnnz], distribute_block, block_size) == 0) { @@ -693,7 +700,7 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, *-----------------------------------------------------------*/ /* Diagonal block part of row i1 */ - for (jj1 = A_diag_i[i1]; jj1 < A_diag_i[i1+1]; jj1++) + for (jj1 = A_diag_i[i1]; jj1 < A_diag_i[i1 + 1]; jj1++) { i2 = A_diag_j[jj1]; if (P_marker[i2] >= jj_begin_row ) @@ -704,7 +711,7 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, /* multiply - result in sum_block */ hypre_CSRBlockMatrixBlockMultAdd(distribute_block, - &A_diag_data[jj1*bnnz], 0.0, + &A_diag_data[jj1 * bnnz], 0.0, sum_block, block_size); @@ -719,7 +726,7 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, /* Off-Diagonal block part of row i1 */ if (num_procs > 1) { - for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1+1]; jj1++) + for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1 + 1]; jj1++) { i2 = A_offd_j[jj1]; if (P_marker_offd[i2] >= jj_begin_row_offd) @@ -729,7 +736,7 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, /* multiply - result in sum_block */ hypre_CSRBlockMatrixBlockMultAdd(distribute_block, - &A_offd_data[jj1*bnnz], 0.0, + &A_offd_data[jj1 * bnnz], 0.0, sum_block, block_size); @@ -744,9 +751,9 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, else /* sum block is all zeros (or almost singular) - just add to diagonal */ { /* diagonal += A_diag_data[jj]; */ - if (add_weak_to_diag) hypre_CSRBlockMatrixBlockAddAccumulate(&A_diag_data[jj*bnnz], - diagonal_block, - block_size); + if (add_weak_to_diag) hypre_CSRBlockMatrixBlockAddAccumulate(&A_diag_data[jj * bnnz], + diagonal_block, + block_size); } } @@ -759,7 +766,7 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, else if (CF_marker[i1] != -3 && add_weak_to_diag) { /* diagonal += A_diag_data[jj];*/ - hypre_CSRBlockMatrixBlockAddAccumulate(&A_diag_data[jj*bnnz], + hypre_CSRBlockMatrixBlockAddAccumulate(&A_diag_data[jj * bnnz], diagonal_block, block_size); @@ -775,7 +782,7 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, if (num_procs > 1) { - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { i1 = A_offd_j[jj]; @@ -787,7 +794,7 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, if (P_marker_offd[i1] >= jj_begin_row_offd) { /* P_offd_data[P_marker_offd[i1]] += A_offd_data[jj]; */ - hypre_CSRBlockMatrixBlockAddAccumulate( &A_offd_data[jj*bnnz], + hypre_CSRBlockMatrixBlockAddAccumulate( &A_offd_data[jj * bnnz], &P_offd_data[P_marker_offd[i1]*bnnz], block_size); } @@ -813,7 +820,7 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, /* find row number */ c_num = A_offd_j[jj]; - for (jj1 = A_ext_i[c_num]; jj1 < A_ext_i[c_num+1]; jj1++) + for (jj1 = A_ext_i[c_num]; jj1 < A_ext_i[c_num + 1]; jj1++) { i2 = (HYPRE_Int)A_ext_j[jj1]; @@ -823,17 +830,17 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, if (P_marker[i2] >= jj_begin_row) { /* sum += A_ext_data[jj1]; */ - hypre_CSRBlockMatrixBlockAddAccumulate(&A_ext_data[jj1*bnnz], + hypre_CSRBlockMatrixBlockAddAccumulate(&A_ext_data[jj1 * bnnz], sum_block, block_size); } } else { /* in the off_diagonal block */ - if (P_marker_offd[-i2-1] >= jj_begin_row_offd) + if (P_marker_offd[-i2 - 1] >= jj_begin_row_offd) { /* sum += A_ext_data[jj1]; */ - hypre_CSRBlockMatrixBlockAddAccumulate(&A_ext_data[jj1*bnnz], + hypre_CSRBlockMatrixBlockAddAccumulate(&A_ext_data[jj1 * bnnz], sum_block, block_size); } @@ -845,7 +852,7 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, /* distribute = A_offd_data[jj] / sum; */ /* here we want: A_offd_data * sum^(-1) */ - if (hypre_CSRBlockMatrixBlockMultInv(sum_block, &A_offd_data[jj*bnnz], + if (hypre_CSRBlockMatrixBlockMultInv(sum_block, &A_offd_data[jj * bnnz], distribute_block, block_size) == 0) { @@ -856,7 +863,7 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, /* Diagonal block part of row i1 */ - for (jj1 = A_ext_i[c_num]; jj1 < A_ext_i[c_num+1]; jj1++) + for (jj1 = A_ext_i[c_num]; jj1 < A_ext_i[c_num + 1]; jj1++) { i2 = (HYPRE_Int)A_ext_j[jj1]; @@ -869,7 +876,7 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, /* multiply - result in sum_block */ hypre_CSRBlockMatrixBlockMultAdd(distribute_block, - &A_ext_data[jj1*bnnz], 0.0, + &A_ext_data[jj1 * bnnz], 0.0, sum_block, block_size); @@ -883,7 +890,7 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, else { /* in the off_diagonal block */ - if (P_marker_offd[-i2-1] >= jj_begin_row_offd) + if (P_marker_offd[-i2 - 1] >= jj_begin_row_offd) /*P_offd_data[P_marker_offd[-i2-1]] += distribute * A_ext_data[jj1];*/ @@ -891,13 +898,13 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, /* multiply - result in sum_block */ hypre_CSRBlockMatrixBlockMultAdd(distribute_block, - &A_ext_data[jj1*bnnz], 0.0, + &A_ext_data[jj1 * bnnz], 0.0, sum_block, block_size); /* add result to p_offd_data */ hypre_CSRBlockMatrixBlockAddAccumulate(sum_block, - &P_offd_data[P_marker_offd[-i2-1]*bnnz], + &P_offd_data[P_marker_offd[-i2 - 1]*bnnz], block_size); } @@ -908,9 +915,9 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, else /* sum block is all zeros - just add to diagonal */ { /* diagonal += A_offd_data[jj]; */ - if (add_weak_to_diag) hypre_CSRBlockMatrixBlockAddAccumulate(&A_offd_data[jj*bnnz], - diagonal_block, - block_size); + if (add_weak_to_diag) hypre_CSRBlockMatrixBlockAddAccumulate(&A_offd_data[jj * bnnz], + diagonal_block, + block_size); } } @@ -923,7 +930,7 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, else if (CF_marker_offd[i1] != -3 && add_weak_to_diag) { /* diagonal += A_offd_data[jj]; */ - hypre_CSRBlockMatrixBlockAddAccumulate(&A_offd_data[jj*bnnz], + hypre_CSRBlockMatrixBlockAddAccumulate(&A_offd_data[jj * bnnz], diagonal_block, block_size); @@ -942,18 +949,18 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, /* want diagonal^(-1)*P_diag_data */ /* do division - put in sum_block */ - if ( hypre_CSRBlockMatrixBlockInvMult(diagonal_block, &P_diag_data[jj*bnnz], + if ( hypre_CSRBlockMatrixBlockInvMult(diagonal_block, &P_diag_data[jj * bnnz], sum_block, block_size) == 0) { /* now copy to P_diag_data[jj] and make negative */ - hypre_CSRBlockMatrixBlockCopyData(sum_block, &P_diag_data[jj*bnnz], + hypre_CSRBlockMatrixBlockCopyData(sum_block, &P_diag_data[jj * bnnz], -1.0, block_size); } else { /* hypre_printf(" Warning! singular diagonal block! Proc id %d row %d\n", my_id,i); */ /* just make P_diag_data negative since diagonal is singular) */ - hypre_CSRBlockMatrixBlockCopyData(&P_diag_data[jj*bnnz], &P_diag_data[jj*bnnz], + hypre_CSRBlockMatrixBlockCopyData(&P_diag_data[jj * bnnz], &P_diag_data[jj * bnnz], -1.0, block_size); } @@ -964,11 +971,11 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, /* P_offd_data[jj] /= -diagonal; */ /* do division - put in sum_block */ - hypre_CSRBlockMatrixBlockInvMult(diagonal_block, &P_offd_data[jj*bnnz], + hypre_CSRBlockMatrixBlockInvMult(diagonal_block, &P_offd_data[jj * bnnz], sum_block, block_size); /* now copy to P_offd_data[jj] and make negative */ - hypre_CSRBlockMatrixBlockCopyData(sum_block, &P_offd_data[jj*bnnz], + hypre_CSRBlockMatrixBlockCopyData(sum_block, &P_offd_data[jj * bnnz], -1.0, block_size); @@ -979,7 +986,7 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, strong_f_marker--; - P_offd_i[i+1] = jj_counter_offd; + P_offd_i[i + 1] = jj_counter_offd; } hypre_TFree(P_marker, HYPRE_MEMORY_HOST); hypre_TFree(P_marker_offd, HYPRE_MEMORY_HOST); @@ -1024,11 +1031,13 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, { P_marker = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); - for (i=0; i < num_cols_A_offd; i++) + for (i = 0; i < num_cols_A_offd; i++) + { P_marker[i] = 0; + } num_cols_P_offd = 0; - for (i=0; i < P_offd_size; i++) + for (i = 0; i < P_offd_size; i++) { index = P_offd_j[i]; if (!P_marker[index]) @@ -1042,21 +1051,21 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, tmp_map_offd = hypre_CTAlloc(HYPRE_Int, num_cols_P_offd, HYPRE_MEMORY_HOST); index = 0; - for (i=0; i < num_cols_P_offd; i++) + for (i = 0; i < num_cols_P_offd; i++) { - while (P_marker[index]==0) index++; + while (P_marker[index] == 0) { index++; } tmp_map_offd[i] = index++; } - for (i=0; i < P_offd_size; i++) + for (i = 0; i < P_offd_size; i++) P_offd_j[i] = hypre_BinarySearch(tmp_map_offd, P_offd_j[i], num_cols_P_offd); hypre_TFree(P_marker, HYPRE_MEMORY_HOST); } - for (i=0; i < n_fine; i++) - if (CF_marker[i] == -3) CF_marker[i] = -1; + for (i = 0; i < n_fine; i++) + if (CF_marker[i] == -3) { CF_marker[i] = -1; } if (num_cols_P_offd) { @@ -1065,7 +1074,7 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, } /* use block version */ - hypre_GetCommPkgBlockRTFromCommPkgBlockA(P,A, tmp_map_offd, fine_to_coarse_offd); + hypre_GetCommPkgBlockRTFromCommPkgBlockA(P, A, tmp_map_offd, fine_to_coarse_offd); *P_ptr = P; @@ -1087,7 +1096,7 @@ hypre_BoomerAMGBuildBlockInterp( hypre_ParCSRBlockMatrix *A, hypre_TFree(jj_count, HYPRE_MEMORY_HOST); hypre_TFree(jj_count_offd, HYPRE_MEMORY_HOST); - if (num_procs > 1) hypre_CSRBlockMatrixDestroy(A_ext); + if (num_procs > 1) { hypre_CSRBlockMatrixDestroy(A_ext); } return hypre_error_flag; } @@ -1116,7 +1125,7 @@ hypre_BoomerAMGBlockInterpTruncation( hypre_ParCSRBlockMatrix *P, HYPRE_Real *P_offd_data_new; HYPRE_Int block_size = hypre_CSRBlockMatrixBlockSize(P_diag); - HYPRE_Int bnnz = block_size*block_size; + HYPRE_Int bnnz = block_size * block_size; HYPRE_Int n_fine = hypre_CSRBlockMatrixNumRows(P_diag); HYPRE_Int num_cols = hypre_CSRBlockMatrixNumCols(P_diag); @@ -1151,16 +1160,16 @@ hypre_BoomerAMGBlockInterpTruncation( hypre_ParCSRBlockMatrix *P, max_coef = 0.0; /* diag */ - for (j = P_diag_i[i]; j < P_diag_i[i+1]; j++) + for (j = P_diag_i[i]; j < P_diag_i[i + 1]; j++) { - hypre_CSRBlockMatrixBlockNorm(1, &P_diag_data[j*bnnz] , &tmp, block_size); + hypre_CSRBlockMatrixBlockNorm(1, &P_diag_data[j * bnnz], &tmp, block_size); max_coef = (max_coef < tmp) ? tmp : max_coef; } /* off_diag */ - for (j = P_offd_i[i]; j < P_offd_i[i+1]; j++) + for (j = P_offd_i[i]; j < P_offd_i[i + 1]; j++) { - hypre_CSRBlockMatrixBlockNorm(1, &P_offd_data[j*bnnz], &tmp, block_size); + hypre_CSRBlockMatrixBlockNorm(1, &P_offd_data[j * bnnz], &tmp, block_size); max_coef = (max_coef < tmp) ? tmp : max_coef; } @@ -1173,12 +1182,12 @@ hypre_BoomerAMGBlockInterpTruncation( hypre_ParCSRBlockMatrix *P, hypre_CSRBlockMatrixBlockSetScalar(scale, 0.0, block_size); hypre_CSRBlockMatrixBlockSetScalar(row_sum, 0.0, block_size); - for (j = start_j; j < P_diag_i[i+1]; j++) + for (j = start_j; j < P_diag_i[i + 1]; j++) { /* row_sum += P_diag_data[now_checking];*/ - hypre_CSRBlockMatrixBlockAddAccumulate(&P_diag_data[now_checking*bnnz], row_sum, block_size); + hypre_CSRBlockMatrixBlockAddAccumulate(&P_diag_data[now_checking * bnnz], row_sum, block_size); - hypre_CSRBlockMatrixBlockNorm(1, &P_diag_data[now_checking*bnnz] , &tmp, block_size); + hypre_CSRBlockMatrixBlockNorm(1, &P_diag_data[now_checking * bnnz], &tmp, block_size); if ( tmp < max_coef) { @@ -1188,10 +1197,11 @@ hypre_BoomerAMGBlockInterpTruncation( hypre_ParCSRBlockMatrix *P, else { /* scale += P_diag_data[now_checking]; */ - hypre_CSRBlockMatrixBlockAddAccumulate(&P_diag_data[now_checking*bnnz], scale, block_size); + hypre_CSRBlockMatrixBlockAddAccumulate(&P_diag_data[now_checking * bnnz], scale, block_size); /* P_diag_data[next_open] = P_diag_data[now_checking]; */ - hypre_CSRBlockMatrixBlockCopyData( &P_diag_data[now_checking*bnnz], &P_diag_data[next_open*bnnz], + hypre_CSRBlockMatrixBlockCopyData( &P_diag_data[now_checking * bnnz], + &P_diag_data[next_open * bnnz], 1.0, block_size); P_diag_j[next_open] = P_diag_j[now_checking]; @@ -1203,12 +1213,12 @@ hypre_BoomerAMGBlockInterpTruncation( hypre_ParCSRBlockMatrix *P, start_j = P_offd_i[i]; P_offd_i[i] -= num_lost_offd; - for (j = start_j; j < P_offd_i[i+1]; j++) + for (j = start_j; j < P_offd_i[i + 1]; j++) { /* row_sum += P_offd_data[now_checking_offd]; */ - hypre_CSRBlockMatrixBlockAddAccumulate(&P_offd_data[now_checking_offd*bnnz], row_sum, block_size); + hypre_CSRBlockMatrixBlockAddAccumulate(&P_offd_data[now_checking_offd * bnnz], row_sum, block_size); - hypre_CSRBlockMatrixBlockNorm(1, &P_offd_data[now_checking_offd*bnnz] , &tmp, block_size); + hypre_CSRBlockMatrixBlockNorm(1, &P_offd_data[now_checking_offd * bnnz], &tmp, block_size); if ( tmp < max_coef) { @@ -1218,10 +1228,11 @@ hypre_BoomerAMGBlockInterpTruncation( hypre_ParCSRBlockMatrix *P, else { /* scale += P_offd_data[now_checking_offd]; */ - hypre_CSRBlockMatrixBlockAddAccumulate(&P_offd_data[now_checking_offd*bnnz], scale, block_size); + hypre_CSRBlockMatrixBlockAddAccumulate(&P_offd_data[now_checking_offd * bnnz], scale, block_size); /* P_offd_data[next_open_offd] = P_offd_data[now_checking_offd];*/ - hypre_CSRBlockMatrixBlockCopyData( &P_offd_data[now_checking_offd*bnnz], &P_offd_data[next_open_offd*bnnz], + hypre_CSRBlockMatrixBlockCopyData( &P_offd_data[now_checking_offd * bnnz], + &P_offd_data[next_open_offd * bnnz], 1.0, block_size); @@ -1236,27 +1247,27 @@ hypre_BoomerAMGBlockInterpTruncation( hypre_ParCSRBlockMatrix *P, if (hypre_CSRBlockMatrixBlockInvMult(scale, row_sum, out_block, block_size) == 0) { - for (j = P_diag_i[i]; j < (P_diag_i[i+1]-num_lost); j++) + for (j = P_diag_i[i]; j < (P_diag_i[i + 1] - num_lost); j++) { /* P_diag_data[j] *= out_block; */ /* put mult result in row_sum */ - hypre_CSRBlockMatrixBlockMultAdd(out_block, &P_diag_data[j*bnnz], 0.0, + hypre_CSRBlockMatrixBlockMultAdd(out_block, &P_diag_data[j * bnnz], 0.0, row_sum, block_size); /* add to P_diag_data */ - hypre_CSRBlockMatrixBlockAddAccumulate(row_sum, &P_diag_data[j*bnnz], block_size); + hypre_CSRBlockMatrixBlockAddAccumulate(row_sum, &P_diag_data[j * bnnz], block_size); } - for (j = P_offd_i[i]; j < (P_offd_i[i+1]-num_lost_offd); j++) + for (j = P_offd_i[i]; j < (P_offd_i[i + 1] - num_lost_offd); j++) { /* P_offd_data[j] *= out_block; */ /* put mult result in row_sum */ - hypre_CSRBlockMatrixBlockMultAdd(out_block, &P_offd_data[j*bnnz], 0.0, + hypre_CSRBlockMatrixBlockMultAdd(out_block, &P_offd_data[j * bnnz], 0.0, row_sum, block_size); /* add to to P_offd_data */ - hypre_CSRBlockMatrixBlockAddAccumulate(row_sum, &P_offd_data[j*bnnz], block_size); + hypre_CSRBlockMatrixBlockAddAccumulate(row_sum, &P_offd_data[j * bnnz], block_size); } @@ -1276,17 +1287,19 @@ hypre_BoomerAMGBlockInterpTruncation( hypre_ParCSRBlockMatrix *P, rowlength = 0; if (n_fine) - rowlength = P_diag_i[1]+P_offd_i[1]; + { + rowlength = P_diag_i[1] + P_offd_i[1]; + } P_mxnum = rowlength; - for (i=1; i P_mxnum) P_mxnum = rowlength; + rowlength = P_diag_i[i + 1] - P_diag_i[i] + P_offd_i[i + 1] - P_offd_i[i]; + if (rowlength > P_mxnum) { P_mxnum = rowlength; } } if (P_mxnum > max_elmts) { P_aux_j = hypre_CTAlloc(HYPRE_Int, P_mxnum, HYPRE_MEMORY_HOST); - P_aux_data = hypre_CTAlloc(HYPRE_Real, P_mxnum*bnnz, HYPRE_MEMORY_HOST); + P_aux_data = hypre_CTAlloc(HYPRE_Real, P_mxnum * bnnz, HYPRE_MEMORY_HOST); cnt_diag = 0; cnt_offd = 0; @@ -1295,48 +1308,48 @@ hypre_BoomerAMGBlockInterpTruncation( hypre_ParCSRBlockMatrix *P, hypre_CSRBlockMatrixBlockSetScalar(row_sum, 0.0, block_size); /*row_sum = 0; */ - num_elmts = P_diag_i[i+1]-P_diag_i[i]+P_offd_i[i+1]-P_offd_i[i]; + num_elmts = P_diag_i[i + 1] - P_diag_i[i] + P_offd_i[i + 1] - P_offd_i[i]; if (max_elmts < num_elmts) { cnt = 0; - for (j = P_diag_i[i]; j < P_diag_i[i+1]; j++) + for (j = P_diag_i[i]; j < P_diag_i[i + 1]; j++) { P_aux_j[cnt] = P_diag_j[j]; /*P_aux_data[cnt++] = P_diag_data[j];*/ - hypre_CSRBlockMatrixBlockCopyData(&P_diag_data[j*bnnz], - &P_aux_data[cnt*bnnz], + hypre_CSRBlockMatrixBlockCopyData(&P_diag_data[j * bnnz], + &P_aux_data[cnt * bnnz], 1.0, block_size); cnt++; /*row_sum += P_diag_data[j];*/ - hypre_CSRBlockMatrixBlockAddAccumulate(&P_diag_data[j*bnnz], row_sum, block_size); + hypre_CSRBlockMatrixBlockAddAccumulate(&P_diag_data[j * bnnz], row_sum, block_size); } num_lost += cnt; cnt1 = cnt; - for (j = P_offd_i[i]; j < P_offd_i[i+1]; j++) + for (j = P_offd_i[i]; j < P_offd_i[i + 1]; j++) { - P_aux_j[cnt] = P_offd_j[j]+num_cols; + P_aux_j[cnt] = P_offd_j[j] + num_cols; /*P_aux_data[cnt++] = P_offd_data[j];*/ - hypre_CSRBlockMatrixBlockCopyData(&P_offd_data[j*bnnz], - &P_aux_data[cnt*bnnz], + hypre_CSRBlockMatrixBlockCopyData(&P_offd_data[j * bnnz], + &P_aux_data[cnt * bnnz], 1.0, block_size); cnt++; /*row_sum += P_offd_data[j];*/ - hypre_CSRBlockMatrixBlockAddAccumulate(&P_offd_data[j*bnnz], row_sum, block_size); + hypre_CSRBlockMatrixBlockAddAccumulate(&P_offd_data[j * bnnz], row_sum, block_size); } - num_lost_offd += cnt-cnt1; + num_lost_offd += cnt - cnt1; /* sort data */ norm_array = hypre_CTAlloc(HYPRE_Real, cnt, HYPRE_MEMORY_HOST); - for (j=0; j< cnt; j++) + for (j = 0; j < cnt; j++) { - hypre_CSRBlockMatrixBlockNorm(1, &P_aux_data[j*bnnz] , &norm_array[j], block_size); + hypre_CSRBlockMatrixBlockNorm(1, &P_aux_data[j * bnnz], &norm_array[j], block_size); } - hypre_block_qsort(P_aux_j, norm_array, P_aux_data,block_size, 0,cnt-1); + hypre_block_qsort(P_aux_j, norm_array, P_aux_data, block_size, 0, cnt - 1); hypre_TFree(norm_array, HYPRE_MEMORY_HOST); @@ -1347,7 +1360,7 @@ hypre_BoomerAMGBlockInterpTruncation( hypre_ParCSRBlockMatrix *P, for (j = 0; j < max_elmts; j++) { /* scale += P_aux_data[j];*/ - hypre_CSRBlockMatrixBlockAddAccumulate(&P_aux_data[j*bnnz], + hypre_CSRBlockMatrixBlockAddAccumulate(&P_aux_data[j * bnnz], scale, block_size); @@ -1355,8 +1368,8 @@ hypre_BoomerAMGBlockInterpTruncation( hypre_ParCSRBlockMatrix *P, { P_diag_j[cnt_diag] = P_aux_j[j]; /*P_diag_data[cnt_diag++] = P_aux_data[j];*/ - hypre_CSRBlockMatrixBlockCopyData(&P_aux_data[j*bnnz], - &P_diag_data[cnt_diag*bnnz], + hypre_CSRBlockMatrixBlockCopyData(&P_aux_data[j * bnnz], + &P_diag_data[cnt_diag * bnnz], 1.0, block_size); cnt_diag++; @@ -1365,17 +1378,17 @@ hypre_BoomerAMGBlockInterpTruncation( hypre_ParCSRBlockMatrix *P, } else { - P_offd_j[cnt_offd] = P_aux_j[j]-num_cols; + P_offd_j[cnt_offd] = P_aux_j[j] - num_cols; /*P_offd_data[cnt_offd++] = P_aux_data[j];*/ - hypre_CSRBlockMatrixBlockCopyData(&P_aux_data[j*bnnz], - &P_offd_data[cnt_offd*bnnz], + hypre_CSRBlockMatrixBlockCopyData(&P_aux_data[j * bnnz], + &P_offd_data[cnt_offd * bnnz], 1.0, block_size); cnt_offd++; } } - num_lost -= cnt_diag-P_diag_i[i]; - num_lost_offd -= cnt_offd-P_offd_i[i]; + num_lost -= cnt_diag - P_diag_i[i]; + num_lost_offd -= cnt_offd - P_offd_i[i]; /* normalize row of P */ /* out_block = row_sum/scale; */ /*if (scale != 0.)*/ @@ -1389,10 +1402,10 @@ hypre_BoomerAMGBlockInterpTruncation( hypre_ParCSRBlockMatrix *P, /* P_diag_data[j] *= out_block; */ /* put mult result in row_sum */ - hypre_CSRBlockMatrixBlockMultAdd(out_block, &P_diag_data[j*bnnz], 0.0, + hypre_CSRBlockMatrixBlockMultAdd(out_block, &P_diag_data[j * bnnz], 0.0, row_sum, block_size); /* add to P_diag_data */ - hypre_CSRBlockMatrixBlockAddAccumulate(row_sum, &P_diag_data[j*bnnz], block_size); + hypre_CSRBlockMatrixBlockAddAccumulate(row_sum, &P_diag_data[j * bnnz], block_size); } for (j = P_offd_i[i]; j < cnt_offd; j++) @@ -1401,10 +1414,10 @@ hypre_BoomerAMGBlockInterpTruncation( hypre_ParCSRBlockMatrix *P, /* P_offd_data[j] *= out_block; */ /* put mult result in row_sum */ - hypre_CSRBlockMatrixBlockMultAdd(out_block, &P_offd_data[j*bnnz], 0.0, + hypre_CSRBlockMatrixBlockMultAdd(out_block, &P_offd_data[j * bnnz], 0.0, row_sum, block_size); /* add to to P_offd_data */ - hypre_CSRBlockMatrixBlockAddAccumulate(row_sum, &P_offd_data[j*bnnz], block_size); + hypre_CSRBlockMatrixBlockAddAccumulate(row_sum, &P_offd_data[j * bnnz], block_size); } @@ -1417,12 +1430,12 @@ hypre_BoomerAMGBlockInterpTruncation( hypre_ParCSRBlockMatrix *P, { start_j = P_diag_i[i]; P_diag_i[i] = cnt_diag; - for (j = start_j; j < P_diag_i[i+1]; j++) + for (j = start_j; j < P_diag_i[i + 1]; j++) { P_diag_j[cnt_diag] = P_diag_j[j]; /*P_diag_data[cnt_diag++] = P_diag_data[j];*/ - hypre_CSRBlockMatrixBlockCopyData(&P_diag_data[j*bnnz], - &P_diag_data[cnt_diag*bnnz], + hypre_CSRBlockMatrixBlockCopyData(&P_diag_data[j * bnnz], + &P_diag_data[cnt_diag * bnnz], 1.0, block_size); cnt_diag++; @@ -1430,24 +1443,28 @@ hypre_BoomerAMGBlockInterpTruncation( hypre_ParCSRBlockMatrix *P, } } else - cnt_diag += P_diag_i[i+1]-P_diag_i[i]; + { + cnt_diag += P_diag_i[i + 1] - P_diag_i[i]; + } if (P_offd_i[i] != cnt_offd) { start_j = P_offd_i[i]; P_offd_i[i] = cnt_offd; - for (j = start_j; j < P_offd_i[i+1]; j++) + for (j = start_j; j < P_offd_i[i + 1]; j++) { P_offd_j[cnt_offd] = P_offd_j[j]; /*P_offd_data[cnt_offd++] = P_offd_data[j];*/ - hypre_CSRBlockMatrixBlockCopyData(&P_offd_data[j*bnnz], - &P_offd_data[cnt_offd*bnnz], + hypre_CSRBlockMatrixBlockCopyData(&P_offd_data[j * bnnz], + &P_offd_data[cnt_offd * bnnz], 1.0, block_size); cnt_offd++; } } else - cnt_offd += P_offd_i[i+1]-P_offd_i[i]; + { + cnt_offd += P_offd_i[i + 1] - P_offd_i[i]; + } } } P_diag_i[n_fine] = cnt_diag; @@ -1464,13 +1481,13 @@ hypre_BoomerAMGBlockInterpTruncation( hypre_ParCSRBlockMatrix *P, { P_diag_size = P_diag_i[n_fine]; P_diag_j_new = hypre_CTAlloc(HYPRE_Int, P_diag_size, HYPRE_MEMORY_HOST); - P_diag_data_new = hypre_CTAlloc(HYPRE_Real, P_diag_size*bnnz, HYPRE_MEMORY_HOST); - for (i=0; i < P_diag_size; i++) + P_diag_data_new = hypre_CTAlloc(HYPRE_Real, P_diag_size * bnnz, HYPRE_MEMORY_HOST); + for (i = 0; i < P_diag_size; i++) { P_diag_j_new[i] = P_diag_j[i]; - for (k=0; k < bnnz; k++) + for (k = 0; k < bnnz; k++) { - P_diag_data_new[i*bnnz+k] = P_diag_data[i*bnnz+k]; + P_diag_data_new[i * bnnz + k] = P_diag_data[i * bnnz + k]; } } @@ -1484,13 +1501,13 @@ hypre_BoomerAMGBlockInterpTruncation( hypre_ParCSRBlockMatrix *P, { P_offd_size = P_offd_i[n_fine]; P_offd_j_new = hypre_CTAlloc(HYPRE_Int, P_offd_size, HYPRE_MEMORY_HOST); - P_offd_data_new = hypre_CTAlloc(HYPRE_Real, P_offd_size*bnnz, HYPRE_MEMORY_HOST); - for (i=0; i < P_offd_size; i++) + P_offd_data_new = hypre_CTAlloc(HYPRE_Real, P_offd_size * bnnz, HYPRE_MEMORY_HOST); + for (i = 0; i < P_offd_size; i++) { P_offd_j_new[i] = P_offd_j[i]; - for (k=0; k < bnnz; k++) + for (k = 0; k < bnnz; k++) { - P_offd_data_new[i*bnnz + k] = P_offd_data[i*bnnz + k]; + P_offd_data_new[i * bnnz + k] = P_offd_data[i * bnnz + k]; } } @@ -1521,12 +1538,14 @@ void hypre_block_qsort( HYPRE_Int *v, HYPRE_Int i, last; if (left >= right) + { return; + } - hypre_swap2( v, w, left, (left+right)/2); - hypre_swap_blk(blk_array, block_size, left, (left+right)/2); + hypre_swap2( v, w, left, (left + right) / 2); + hypre_swap_blk(blk_array, block_size, left, (left + right) / 2); last = left; - for (i = left+1; i <= right; i++) + for (i = left + 1; i <= right; i++) if (hypre_cabs(w[i]) > hypre_cabs(w[left])) { hypre_swap2(v, w, ++last, i); @@ -1534,26 +1553,26 @@ void hypre_block_qsort( HYPRE_Int *v, } hypre_swap2(v, w, left, last); hypre_swap_blk(blk_array, block_size, left, last); - hypre_block_qsort(v, w, blk_array, block_size, left, last-1); - hypre_block_qsort(v, w, blk_array, block_size, last+1, right); + hypre_block_qsort(v, w, blk_array, block_size, left, last - 1); + hypre_block_qsort(v, w, blk_array, block_size, last + 1, right); } void hypre_swap_blk( HYPRE_Complex *v, - HYPRE_Int block_size, - HYPRE_Int i, - HYPRE_Int j ) + HYPRE_Int block_size, + HYPRE_Int i, + HYPRE_Int j ) { - HYPRE_Int bnnz = block_size*block_size; + HYPRE_Int bnnz = block_size * block_size; HYPRE_Real *temp; temp = hypre_CTAlloc(HYPRE_Real, bnnz, HYPRE_MEMORY_HOST); /*temp = v[i];*/ - hypre_CSRBlockMatrixBlockCopyData(&v[i*bnnz],temp, 1.0, block_size); + hypre_CSRBlockMatrixBlockCopyData(&v[i * bnnz], temp, 1.0, block_size); /*v[i] = v[j];*/ - hypre_CSRBlockMatrixBlockCopyData(&v[j*bnnz],&v[i*bnnz], 1.0, block_size); + hypre_CSRBlockMatrixBlockCopyData(&v[j * bnnz], &v[i * bnnz], 1.0, block_size); /* v[j] = temp; */ - hypre_CSRBlockMatrixBlockCopyData(temp,&v[j*bnnz], 1.0, block_size); + hypre_CSRBlockMatrixBlockCopyData(temp, &v[j * bnnz], 1.0, block_size); hypre_TFree(temp, HYPRE_MEMORY_HOST); } @@ -1574,7 +1593,7 @@ void hypre_swap_blk( HYPRE_Complex *v, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, +hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, HYPRE_Int *CF_marker, hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, @@ -1584,8 +1603,9 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, HYPRE_Real trunc_factor, HYPRE_Int max_elmts, HYPRE_Int add_weak_to_diag, - hypre_ParCSRBlockMatrix **P_ptr) + hypre_ParCSRBlockMatrix **P_ptr) { + HYPRE_UNUSED_VAR(dof_func); MPI_Comm comm = hypre_ParCSRBlockMatrixComm(A); hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRBlockMatrixCommPkg(A); @@ -1597,7 +1617,7 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, HYPRE_Int *A_diag_j = hypre_CSRBlockMatrixJ(A_diag); HYPRE_Int block_size = hypre_CSRBlockMatrixBlockSize(A_diag); - HYPRE_Int bnnz = block_size*block_size; + HYPRE_Int bnnz = block_size * block_size; hypre_CSRBlockMatrix *A_offd = hypre_ParCSRBlockMatrixOffd(A); HYPRE_Real *A_offd_data = hypre_CSRBlockMatrixData(A_offd); @@ -1620,8 +1640,7 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, HYPRE_Int *CF_marker_offd = NULL; - hypre_CSRBlockMatrix *A_ext; - + hypre_CSRBlockMatrix *A_ext = NULL; HYPRE_Real *A_ext_data = NULL; HYPRE_Int *A_ext_i = NULL; HYPRE_BigInt *A_ext_j = NULL; @@ -1640,10 +1659,10 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, HYPRE_Int *P_marker, *P_marker_offd = NULL; - HYPRE_Int jj_counter,jj_counter_offd; + HYPRE_Int jj_counter, jj_counter_offd; HYPRE_Int *jj_count, *jj_count_offd = NULL; - HYPRE_Int jj_begin_row,jj_begin_row_offd; - HYPRE_Int jj_end_row,jj_end_row_offd; + HYPRE_Int jj_begin_row, jj_begin_row_offd; + HYPRE_Int jj_end_row, jj_end_row_offd; HYPRE_Int start_indexing = 0; /* start indexing for P_data at 0 */ @@ -1655,13 +1674,13 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, HYPRE_BigInt *fine_to_coarse_offd = NULL; HYPRE_Int *coarse_counter; HYPRE_Int coarse_shift; - HYPRE_BigInt total_global_cpts; - HYPRE_Int num_cols_P_offd, my_first_cpt; + HYPRE_BigInt my_first_cpt, total_global_cpts; + HYPRE_Int num_cols_P_offd; HYPRE_Int bd; - HYPRE_Int i,i1,i2; - HYPRE_Int j,jl,jj,jj1; + HYPRE_Int i, i1, i2; + HYPRE_Int j, jl, jj, jj1; HYPRE_Int kc; HYPRE_BigInt big_k; HYPRE_Int start; @@ -1681,7 +1700,7 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, HYPRE_Int local_numrows = hypre_CSRBlockMatrixNumRows(A_diag); HYPRE_BigInt col_n = col_1 + (HYPRE_BigInt)local_numrows; - HYPRE_Real wall_time; /* for debugging instrumentation */ + HYPRE_Real wall_time = 0.0; /* for debugging instrumentation */ HYPRE_Real *identity_block; @@ -1693,22 +1712,25 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, HYPRE_Real *sign; hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_rank(comm, &my_id); num_threads = hypre_NumThreads(); + if (num_functions > 1) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Not implemented for num_functions > 1!"); + } my_first_cpt = num_cpts_global[0]; - if (my_id == (num_procs -1)) total_global_cpts = num_cpts_global[1]; - hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); + if (my_id == (num_procs - 1)) { total_global_cpts = num_cpts_global[1]; } + hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); /*------------------------------------------------------------------- * Get the CF_marker data for the off-processor columns *-------------------------------------------------------------------*/ - if (debug_flag==4) wall_time = time_getWallclockSeconds(); - - CF_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } + CF_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); if (!comm_pkg) { @@ -1717,17 +1739,18 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, } num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, - num_sends), HYPRE_MEMORY_HOST); + int_buf_data = hypre_CTAlloc(HYPRE_Int, + hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); index = 0; for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { int_buf_data[index++] - = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } } @@ -1741,7 +1764,7 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, hypre_ParCSRCommHandleDestroy(comm_handle); - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Interp: Comm 1 CF_marker = %f\n", @@ -1753,7 +1776,7 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, * Get the ghost rows of A *---------------------------------------------------------------------*/ - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } if (num_procs > 1) { @@ -1764,9 +1787,9 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, } index = 0; - for (i=0; i < num_cols_A_offd; i++) + for (i = 0; i < num_cols_A_offd; i++) { - for (j=A_ext_i[i]; j < A_ext_i[i+1]; j++) + for (j = A_ext_i[i]; j < A_ext_i[i + 1]; j++) { big_k = A_ext_j[j]; if (big_k >= col_1 && big_k < col_n) @@ -1775,7 +1798,7 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, /* for the data field we must get all of the block data */ for (bd = 0; bd < bnnz; bd++) { - A_ext_data[index*bnnz + bd] = A_ext_data[j*bnnz + bd]; + A_ext_data[index * bnnz + bd] = A_ext_data[j * bnnz + bd]; } index++; } @@ -1784,10 +1807,10 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, kc = hypre_BigBinarySearch(col_map_offd, big_k, num_cols_A_offd); if (kc > -1) { - A_ext_j[index] = (HYPRE_BigInt)(-kc-1); + A_ext_j[index] = (HYPRE_BigInt)(-kc - 1); for (bd = 0; bd < bnnz; bd++) { - A_ext_data[index*bnnz + bd] = A_ext_data[j*bnnz + bd]; + A_ext_data[index * bnnz + bd] = A_ext_data[j * bnnz + bd]; } index++; } @@ -1796,10 +1819,12 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, A_ext_i[i] = index; } for (i = num_cols_A_offd; i > 0; i--) - A_ext_i[i] = A_ext_i[i-1]; - if (num_procs > 1) A_ext_i[0] = 0; + { + A_ext_i[i] = A_ext_i[i - 1]; + } + if (num_procs > 1) { A_ext_i[0] = 0; } - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Interp: Comm 2 Get A_ext = %f\n", @@ -1822,7 +1847,7 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, fine_to_coarse = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); - for (i = 0; i < n_fine; i++) fine_to_coarse[i] = -1; + for (i = 0; i < n_fine; i++) { fine_to_coarse[i] = -1; } jj_counter = start_indexing; jj_counter_offd = start_indexing; @@ -1834,17 +1859,17 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, for (j = 0; j < num_threads; j++) { - size = n_fine/num_threads; - rest = n_fine - size*num_threads; + size = n_fine / num_threads; + rest = n_fine - size * num_threads; if (j < rest) { - ns = j*size+j; - ne = (j+1)*size+j+1; + ns = j * size + j; + ne = (j + 1) * size + j + 1; } else { - ns = j*size+rest; - ne = (j+1)*size+rest; + ns = j * size + rest; + ne = (j + 1) * size + rest; } @@ -1871,7 +1896,7 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, else { - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) { i1 = S_diag_j[jj]; if (CF_marker[i1] >= 0) @@ -1882,7 +1907,7 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, if (num_procs > 1) { - for (jj = S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) { i1 = S_offd_j[jj]; if (CF_marker_offd[i1] >= 0) @@ -1899,32 +1924,32 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, * Allocate arrays. *-----------------------------------------------------------------------*/ - for (i=0; i < num_threads-1; i++) + for (i = 0; i < num_threads - 1; i++) { - coarse_counter[i+1] += coarse_counter[i]; - jj_count[i+1] += jj_count[i]; - jj_count_offd[i+1] += jj_count_offd[i]; + coarse_counter[i + 1] += coarse_counter[i]; + jj_count[i + 1] += jj_count[i]; + jj_count_offd[i + 1] += jj_count_offd[i]; } - i = num_threads-1; + i = num_threads - 1; jj_counter = jj_count[i]; jj_counter_offd = jj_count_offd[i]; P_diag_size = jj_counter; - P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, HYPRE_MEMORY_HOST); + P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, HYPRE_MEMORY_HOST); P_diag_j = hypre_CTAlloc(HYPRE_Int, P_diag_size, HYPRE_MEMORY_HOST); /* we need to include the size of the blocks in the data size */ - P_diag_data = hypre_CTAlloc(HYPRE_Real, P_diag_size*bnnz, HYPRE_MEMORY_HOST); + P_diag_data = hypre_CTAlloc(HYPRE_Real, P_diag_size * bnnz, HYPRE_MEMORY_HOST); P_diag_i[n_fine] = jj_counter; P_offd_size = jj_counter_offd; - P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, HYPRE_MEMORY_HOST); + P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, HYPRE_MEMORY_HOST); P_offd_j = hypre_CTAlloc(HYPRE_Int, P_offd_size, HYPRE_MEMORY_HOST); /* we need to include the size of the blocks in the data size */ - P_offd_data = hypre_CTAlloc(HYPRE_Real, P_offd_size*bnnz, HYPRE_MEMORY_HOST); + P_offd_data = hypre_CTAlloc(HYPRE_Real, P_offd_size * bnnz, HYPRE_MEMORY_HOST); /*----------------------------------------------------------------------- * Intialize some stuff. @@ -1933,7 +1958,7 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, jj_counter = start_indexing; jj_counter_offd = start_indexing; - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Interp: Internal work 1 = %f\n", @@ -1942,72 +1967,71 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, } /* we need a block identity and a block of zeros*/ - identity_block = hypre_CTAlloc(HYPRE_Real, bnnz, HYPRE_MEMORY_HOST); - zero_block = hypre_CTAlloc(HYPRE_Real, bnnz, HYPRE_MEMORY_HOST); - + identity_block = hypre_CTAlloc(HYPRE_Real, bnnz, HYPRE_MEMORY_HOST); + zero_block = hypre_CTAlloc(HYPRE_Real, bnnz, HYPRE_MEMORY_HOST); - - for(i = 0; i < block_size; i++) + for (i = 0; i < block_size; i++) { - identity_block[i*block_size + i] = 1.0; + identity_block[i * block_size + i] = 1.0; } - /* we also need a block to keep track of the diagonal values and a sum */ - diagonal_block = hypre_CTAlloc(HYPRE_Real, bnnz, HYPRE_MEMORY_HOST); - sum_block = hypre_CTAlloc(HYPRE_Real, bnnz, HYPRE_MEMORY_HOST); - distribute_block = hypre_CTAlloc(HYPRE_Real, bnnz, HYPRE_MEMORY_HOST); - + diagonal_block = hypre_CTAlloc(HYPRE_Real, bnnz, HYPRE_MEMORY_HOST); + sum_block = hypre_CTAlloc(HYPRE_Real, bnnz, HYPRE_MEMORY_HOST); + distribute_block = hypre_CTAlloc(HYPRE_Real, bnnz, HYPRE_MEMORY_HOST); - sign = hypre_CTAlloc(HYPRE_Real, block_size, HYPRE_MEMORY_HOST); + sign = hypre_CTAlloc(HYPRE_Real, block_size, HYPRE_MEMORY_HOST); /*----------------------------------------------------------------------- * Send and receive fine_to_coarse info. *-----------------------------------------------------------------------*/ - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } - fine_to_coarse_offd = hypre_CTAlloc(HYPRE_BigInt, num_cols_A_offd, HYPRE_MEMORY_HOST); - big_buf_data = hypre_CTAlloc(HYPRE_BigInt, hypre_ParCSRCommPkgSendMapStart(comm_pkg, - num_sends), HYPRE_MEMORY_HOST); + fine_to_coarse_offd = hypre_CTAlloc(HYPRE_BigInt, num_cols_A_offd, HYPRE_MEMORY_HOST); + big_buf_data = hypre_CTAlloc(HYPRE_BigInt, + hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); for (j = 0; j < num_threads; j++) { coarse_shift = 0; - if (j > 0) coarse_shift = coarse_counter[j-1]; - size = n_fine/num_threads; - rest = n_fine - size*num_threads; + if (j > 0) { coarse_shift = coarse_counter[j - 1]; } + size = n_fine / num_threads; + rest = n_fine - size * num_threads; if (j < rest) { - ns = j*size+j; - ne = (j+1)*size+j+1; + ns = j * size + j; + ne = (j + 1) * size + j + 1; } else { - ns = j*size+rest; - ne = (j+1)*size+rest; + ns = j * size + rest; + ne = (j + 1) * size + rest; } for (i = ns; i < ne; i++) + { fine_to_coarse[i] += coarse_shift; + } } index = 0; for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) + { big_buf_data[index++] = my_first_cpt - + fine_to_coarse[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + + fine_to_coarse[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; + } } /* again, we do not need to use the block version of comm handle since the fine to coarse mapping is size of the nodes */ - comm_handle = hypre_ParCSRCommHandleCreate( 21, comm_pkg, big_buf_data, - fine_to_coarse_offd); - + comm_handle = hypre_ParCSRCommHandleCreate(21, comm_pkg, big_buf_data, fine_to_coarse_offd); hypre_ParCSRCommHandleDestroy(comm_handle); - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Interp: Comm 4 FineToCoarse = %f\n", @@ -2015,7 +2039,7 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, fflush(NULL); } - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } /*----------------------------------------------------------------------- * Loop over fine grid points. @@ -2023,22 +2047,22 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, for (jl = 0; jl < num_threads; jl++) { - size = n_fine/num_threads; - rest = n_fine - size*num_threads; + size = n_fine / num_threads; + rest = n_fine - size * num_threads; if (jl < rest) { - ns = jl*size+jl; - ne = (jl+1)*size+jl+1; + ns = jl * size + jl; + ne = (jl + 1) * size + jl + 1; } else { - ns = jl*size+rest; - ne = (jl+1)*size+rest; + ns = jl * size + rest; + ne = (jl + 1) * size + rest; } jj_counter = 0; - if (jl > 0) jj_counter = jj_count[jl-1]; + if (jl > 0) { jj_counter = jj_count[jl - 1]; } jj_counter_offd = 0; - if (jl > 0) jj_counter_offd = jj_count_offd[jl-1]; + if (jl > 0) { jj_counter_offd = jj_count_offd[jl - 1]; } P_marker = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); P_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); @@ -2066,7 +2090,7 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, P_diag_j[jj_counter] = fine_to_coarse[i]; /* P_diag_data[jj_counter] = one; */ hypre_CSRBlockMatrixBlockCopyData(identity_block, - &P_diag_data[jj_counter*bnnz], + &P_diag_data[jj_counter * bnnz], 1.0, block_size); jj_counter++; } @@ -2081,7 +2105,7 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, P_diag_i[i] = jj_counter; jj_begin_row = jj_counter; - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) { i1 = S_diag_j[jj]; @@ -2096,7 +2120,7 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, P_diag_j[jj_counter] = fine_to_coarse[i1]; /* P_diag_data[jj_counter] = zero; */ hypre_CSRBlockMatrixBlockCopyData(zero_block, - &P_diag_data[jj_counter*bnnz], + &P_diag_data[jj_counter * bnnz], 1.0, block_size); jj_counter++; } @@ -2120,7 +2144,7 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, if (num_procs > 1) { - for (jj = S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) { i1 = S_offd_j[jj]; @@ -2135,7 +2159,7 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, P_offd_j[jj_counter_offd] = i1; /* P_offd_data[jj_counter_offd] = zero; */ hypre_CSRBlockMatrixBlockCopyData(zero_block, - &P_offd_data[jj_counter_offd*bnnz], + &P_offd_data[jj_counter_offd * bnnz], 1.0, block_size); jj_counter_offd++; @@ -2167,7 +2191,7 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, /* Loop over ith row of A. First, the diagonal part of A */ - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) { i1 = A_diag_j[jj]; @@ -2179,7 +2203,7 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, if (P_marker[i1] >= jj_begin_row) { /* P_diag_data[P_marker[i1]] += A_diag_data[jj]; */ - hypre_CSRBlockMatrixBlockAddAccumulateDiag(&A_diag_data[jj*bnnz], + hypre_CSRBlockMatrixBlockAddAccumulateDiag(&A_diag_data[jj * bnnz], &P_diag_data[P_marker[i1]*bnnz], block_size); @@ -2208,7 +2232,7 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, /* Diagonal block part of row i1 */ - for (jj1 = A_diag_i[i1]; jj1 < A_diag_i[i1+1]; jj1++) + for (jj1 = A_diag_i[i1]; jj1 < A_diag_i[i1 + 1]; jj1++) { i2 = A_diag_j[jj1]; if (P_marker[i2] >= jj_begin_row) @@ -2218,7 +2242,7 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, /* hypre_CSRBlockMatrixBlockAddAccumulateDiag(&A_diag_data[jj1*bnnz], sum_block, block_size);*/ - hypre_CSRBlockMatrixBlockAddAccumulateDiagCheckSign(&A_diag_data[jj1*bnnz], + hypre_CSRBlockMatrixBlockAddAccumulateDiagCheckSign(&A_diag_data[jj1 * bnnz], sum_block, block_size, sign); } } @@ -2226,7 +2250,7 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, /* Off-Diagonal block part of row i1 */ if (num_procs > 1) { - for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1+1]; jj1++) + for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1 + 1]; jj1++) { i2 = A_offd_j[jj1]; if (P_marker_offd[i2] >= jj_begin_row_offd ) @@ -2235,7 +2259,7 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, /*sum += A_offd_data[jj1];*/ /* hypre_CSRBlockMatrixBlockAddAccumulateDiag(&A_offd_data[jj1*bnnz], sum_block, block_size);*/ - hypre_CSRBlockMatrixBlockAddAccumulateDiagCheckSign(&A_offd_data[jj1*bnnz], + hypre_CSRBlockMatrixBlockAddAccumulateDiagCheckSign(&A_offd_data[jj1 * bnnz], sum_block, block_size, sign); } } @@ -2245,7 +2269,7 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, /* distribute = A_diag_data[jj] / sum;*/ /* here we want: A_diag_data * sum^(-1) */ - if (hypre_CSRBlockMatrixBlockInvMultDiag(sum_block, &A_diag_data[jj*bnnz], + if (hypre_CSRBlockMatrixBlockInvMultDiag(sum_block, &A_diag_data[jj * bnnz], distribute_block, block_size) == 0) { @@ -2255,7 +2279,7 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, *-----------------------------------------------------------*/ /* Diagonal block part of row i1 */ - for (jj1 = A_diag_i[i1]; jj1 < A_diag_i[i1+1]; jj1++) + for (jj1 = A_diag_i[i1]; jj1 < A_diag_i[i1 + 1]; jj1++) { i2 = A_diag_j[jj1]; if (P_marker[i2] >= jj_begin_row ) @@ -2273,7 +2297,7 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, &A_diag_data[jj1*bnnz], 0.0, sum_block, block_size);*/ hypre_CSRBlockMatrixBlockMultAddDiagCheckSign(distribute_block, - &A_diag_data[jj1*bnnz], 0.0, + &A_diag_data[jj1 * bnnz], 0.0, sum_block, block_size, sign); @@ -2288,7 +2312,7 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, /* Off-Diagonal block part of row i1 */ if (num_procs > 1) { - for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1+1]; jj1++) + for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1 + 1]; jj1++) { i2 = A_offd_j[jj1]; if (P_marker_offd[i2] >= jj_begin_row_offd) @@ -2305,7 +2329,7 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, sum_block, block_size); */ hypre_CSRBlockMatrixBlockMultAddDiagCheckSign(distribute_block, - &A_offd_data[jj1*bnnz], 0.0, + &A_offd_data[jj1 * bnnz], 0.0, sum_block, block_size, sign); @@ -2323,9 +2347,9 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, else /* sum block is all zeros (or almost singular) - just add to diagonal */ { /* diagonal += A_diag_data[jj]; */ - if (add_weak_to_diag) hypre_CSRBlockMatrixBlockAddAccumulateDiag(&A_diag_data[jj*bnnz], - diagonal_block, - block_size); + if (add_weak_to_diag) hypre_CSRBlockMatrixBlockAddAccumulateDiag(&A_diag_data[jj * bnnz], + diagonal_block, + block_size); } } @@ -2337,7 +2361,7 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, else if (CF_marker[i1] != -3 && add_weak_to_diag) { /* diagonal += A_diag_data[jj];*/ - hypre_CSRBlockMatrixBlockAddAccumulateDiag(&A_diag_data[jj*bnnz], + hypre_CSRBlockMatrixBlockAddAccumulateDiag(&A_diag_data[jj * bnnz], diagonal_block, block_size); } @@ -2351,7 +2375,7 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, if (num_procs > 1) { - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { i1 = A_offd_j[jj]; @@ -2363,7 +2387,7 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, if (P_marker_offd[i1] >= jj_begin_row_offd) { /* P_offd_data[P_marker_offd[i1]] += A_offd_data[jj]; */ - hypre_CSRBlockMatrixBlockAddAccumulateDiag( &A_offd_data[jj*bnnz], + hypre_CSRBlockMatrixBlockAddAccumulateDiag( &A_offd_data[jj * bnnz], &P_offd_data[P_marker_offd[i1]*bnnz], block_size); } @@ -2392,7 +2416,7 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, hypre_CSRBlockMatrixComputeSign(&A_ext_data[A_ext_i[c_num]*bnnz], sign, block_size); - for (jj1 = A_ext_i[c_num]; jj1 < A_ext_i[c_num+1]; jj1++) + for (jj1 = A_ext_i[c_num]; jj1 < A_ext_i[c_num + 1]; jj1++) { i2 = (HYPRE_Int)A_ext_j[jj1]; @@ -2404,19 +2428,19 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, /* sum += A_ext_data[jj1]; */ /* hypre_CSRBlockMatrixBlockAddAccumulateDiag(&A_ext_data[jj1*bnnz], sum_block, block_size);*/ - hypre_CSRBlockMatrixBlockAddAccumulateDiagCheckSign(&A_ext_data[jj1*bnnz], + hypre_CSRBlockMatrixBlockAddAccumulateDiagCheckSign(&A_ext_data[jj1 * bnnz], sum_block, block_size, sign); } } else { /* in the off_diagonal block */ - if (P_marker_offd[-i2-1] >= jj_begin_row_offd) + if (P_marker_offd[-i2 - 1] >= jj_begin_row_offd) { /* sum += A_ext_data[jj1]; */ /* hypre_CSRBlockMatrixBlockAddAccumulateDiag(&A_ext_data[jj1*bnnz], sum_block, block_size);*/ - hypre_CSRBlockMatrixBlockAddAccumulateDiagCheckSign(&A_ext_data[jj1*bnnz], + hypre_CSRBlockMatrixBlockAddAccumulateDiagCheckSign(&A_ext_data[jj1 * bnnz], sum_block, block_size, sign); } } @@ -2427,7 +2451,7 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, /* distribute = A_offd_data[jj] / sum; */ /* here we want: A_offd_data * sum^(-1) */ - if (hypre_CSRBlockMatrixBlockInvMultDiag(sum_block, &A_offd_data[jj*bnnz], + if (hypre_CSRBlockMatrixBlockInvMultDiag(sum_block, &A_offd_data[jj * bnnz], distribute_block, block_size) == 0) { @@ -2438,7 +2462,7 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, /* Diagonal block part of row i1 */ - for (jj1 = A_ext_i[c_num]; jj1 < A_ext_i[c_num+1]; jj1++) + for (jj1 = A_ext_i[c_num]; jj1 < A_ext_i[c_num + 1]; jj1++) { i2 = (HYPRE_Int)A_ext_j[jj1]; @@ -2457,7 +2481,7 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, sum_block, block_size); */ hypre_CSRBlockMatrixBlockMultAddDiagCheckSign(distribute_block, - &A_ext_data[jj1*bnnz], 0.0, + &A_ext_data[jj1 * bnnz], 0.0, sum_block, block_size, sign); /* add result to p_diag_data */ hypre_CSRBlockMatrixBlockAddAccumulateDiag(sum_block, @@ -2468,7 +2492,7 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, else { /* in the off_diagonal block */ - if (P_marker_offd[-i2-1] >= jj_begin_row_offd) + if (P_marker_offd[-i2 - 1] >= jj_begin_row_offd) /*P_offd_data[P_marker_offd[-i2-1]] += distribute * A_ext_data[jj1];*/ @@ -2482,11 +2506,11 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, sum_block, block_size);*/ hypre_CSRBlockMatrixBlockMultAddDiagCheckSign(distribute_block, - &A_ext_data[jj1*bnnz], 0.0, + &A_ext_data[jj1 * bnnz], 0.0, sum_block, block_size, sign); /* add result to p_offd_data */ hypre_CSRBlockMatrixBlockAddAccumulateDiag(sum_block, - &P_offd_data[P_marker_offd[-i2-1]*bnnz], + &P_offd_data[P_marker_offd[-i2 - 1]*bnnz], block_size); } } @@ -2495,9 +2519,9 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, else /* sum block is all zeros - just add to diagonal */ { /* diagonal += A_offd_data[jj]; */ - if (add_weak_to_diag) hypre_CSRBlockMatrixBlockAddAccumulateDiag(&A_offd_data[jj*bnnz], - diagonal_block, - block_size); + if (add_weak_to_diag) hypre_CSRBlockMatrixBlockAddAccumulateDiag(&A_offd_data[jj * bnnz], + diagonal_block, + block_size); } } @@ -2509,8 +2533,8 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, else if (CF_marker_offd[i1] != -3 && add_weak_to_diag) { /* diagonal += A_offd_data[jj]; */ - hypre_CSRBlockMatrixBlockAddAccumulateDiag(&A_offd_data[jj*bnnz], - diagonal_block, block_size); + hypre_CSRBlockMatrixBlockAddAccumulateDiag(&A_offd_data[jj * bnnz], + diagonal_block, block_size); } } } @@ -2526,18 +2550,18 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, /* want diagonal^(-1)*P_diag_data */ /* do division - put in sum_block */ - if ( hypre_CSRBlockMatrixBlockInvMultDiag(diagonal_block, &P_diag_data[jj*bnnz], + if ( hypre_CSRBlockMatrixBlockInvMultDiag(diagonal_block, &P_diag_data[jj * bnnz], sum_block, block_size) == 0) { /* now copy to P_diag_data[jj] and make negative */ - hypre_CSRBlockMatrixBlockCopyData(sum_block, &P_diag_data[jj*bnnz], - -1.0, block_size); + hypre_CSRBlockMatrixBlockCopyData(sum_block, &P_diag_data[jj * bnnz], + -1.0, block_size); } else { /* hypre_printf(" Warning! singular diagonal block! Proc id %d row %d\n", my_id,i); */ /* just make P_diag_data negative since diagonal is zero */ - hypre_CSRBlockMatrixBlockCopyData(&P_diag_data[jj*bnnz], &P_diag_data[jj*bnnz], + hypre_CSRBlockMatrixBlockCopyData(&P_diag_data[jj * bnnz], &P_diag_data[jj * bnnz], -1.0, block_size); } } @@ -2547,18 +2571,18 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, /* P_offd_data[jj] /= -diagonal; */ /* do division - put in sum_block */ - hypre_CSRBlockMatrixBlockInvMultDiag(diagonal_block, &P_offd_data[jj*bnnz], + hypre_CSRBlockMatrixBlockInvMultDiag(diagonal_block, &P_offd_data[jj * bnnz], sum_block, block_size); /* now copy to P_offd_data[jj] and make negative */ - hypre_CSRBlockMatrixBlockCopyData(sum_block, &P_offd_data[jj*bnnz], + hypre_CSRBlockMatrixBlockCopyData(sum_block, &P_offd_data[jj * bnnz], -1.0, block_size); } } strong_f_marker--; - P_offd_i[i+1] = jj_counter_offd; + P_offd_i[i + 1] = jj_counter_offd; } hypre_TFree(P_marker, HYPRE_MEMORY_HOST); hypre_TFree(P_marker_offd, HYPRE_MEMORY_HOST); @@ -2605,11 +2629,13 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, { P_marker = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); - for (i=0; i < num_cols_A_offd; i++) + for (i = 0; i < num_cols_A_offd; i++) + { P_marker[i] = 0; + } num_cols_P_offd = 0; - for (i=0; i < P_offd_size; i++) + for (i = 0; i < P_offd_size; i++) { index = P_offd_j[i]; if (!P_marker[index]) @@ -2623,21 +2649,21 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, col_map_offd_P = hypre_CTAlloc(HYPRE_BigInt, num_cols_P_offd, HYPRE_MEMORY_HOST); index = 0; - for (i=0; i < num_cols_P_offd; i++) + for (i = 0; i < num_cols_P_offd; i++) { - while (P_marker[index]==0) index++; + while (P_marker[index] == 0) { index++; } tmp_map_offd[i] = index++; } - for (i=0; i < P_offd_size; i++) + for (i = 0; i < P_offd_size; i++) P_offd_j[i] = hypre_BinarySearch(tmp_map_offd, P_offd_j[i], num_cols_P_offd); hypre_TFree(P_marker, HYPRE_MEMORY_HOST); } - for (i=0; i < n_fine; i++) - if (CF_marker[i] == -3) CF_marker[i] = -1; + for (i = 0; i < n_fine; i++) + if (CF_marker[i] == -3) { CF_marker[i] = -1; } if (num_cols_P_offd) { @@ -2646,7 +2672,7 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, } /* use block version */ - hypre_GetCommPkgBlockRTFromCommPkgBlockA(P,A, tmp_map_offd, fine_to_coarse_offd); + hypre_GetCommPkgBlockRTFromCommPkgBlockA(P, A, tmp_map_offd, fine_to_coarse_offd); *P_ptr = P; @@ -2670,9 +2696,9 @@ hypre_BoomerAMGBuildBlockInterpDiag( hypre_ParCSRBlockMatrix *A, hypre_TFree(jj_count, HYPRE_MEMORY_HOST); hypre_TFree(jj_count_offd, HYPRE_MEMORY_HOST); - if (num_procs > 1) hypre_CSRBlockMatrixDestroy(A_ext); + if (num_procs > 1) { hypre_CSRBlockMatrixDestroy(A_ext); } - return(0); + return (0); } @@ -2704,6 +2730,7 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, HYPRE_Int max_elmts, hypre_ParCSRBlockMatrix **P_ptr) { + HYPRE_UNUSED_VAR(dof_func); MPI_Comm comm = hypre_ParCSRBlockMatrixComm(A); hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRBlockMatrixCommPkg(A); @@ -2715,7 +2742,7 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, HYPRE_Int *A_diag_j = hypre_CSRBlockMatrixJ(A_diag); HYPRE_Int block_size = hypre_CSRBlockMatrixBlockSize(A_diag); - HYPRE_Int bnnz = block_size*block_size; + HYPRE_Int bnnz = block_size * block_size; hypre_CSRBlockMatrix *A_offd = hypre_ParCSRBlockMatrixOffd(A); HYPRE_Real *A_offd_data = hypre_CSRBlockMatrixData(A_offd); @@ -2738,8 +2765,7 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, HYPRE_Int *CF_marker_offd = NULL; - hypre_CSRBlockMatrix *A_ext; - + hypre_CSRBlockMatrix *A_ext = NULL; HYPRE_Real *A_ext_data = NULL; HYPRE_Int *A_ext_i = NULL; HYPRE_BigInt *A_ext_j = NULL; @@ -2758,10 +2784,10 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, HYPRE_Int *P_marker, *P_marker_offd = NULL; - HYPRE_Int jj_counter,jj_counter_offd; + HYPRE_Int jj_counter, jj_counter_offd; HYPRE_Int *jj_count, *jj_count_offd = NULL; - HYPRE_Int jj_begin_row,jj_begin_row_offd; - HYPRE_Int jj_end_row,jj_end_row_offd; + HYPRE_Int jj_begin_row, jj_begin_row_offd; + HYPRE_Int jj_end_row, jj_end_row_offd; HYPRE_Int start_indexing = 0; /* start indexing for P_data at 0 */ @@ -2779,8 +2805,8 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, HYPRE_Int bd; - HYPRE_Int i,i1,i2; - HYPRE_Int j,jl,jj,jj1; + HYPRE_Int i, i1, i2; + HYPRE_Int j, jl, jj, jj1; HYPRE_Int kc; HYPRE_BigInt big_k; HYPRE_Int start; @@ -2800,7 +2826,7 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, HYPRE_Int local_numrows = hypre_CSRBlockMatrixNumRows(A_diag); HYPRE_BigInt col_n = col_1 + (HYPRE_BigInt)local_numrows; - HYPRE_Real wall_time; /* for debugging instrumentation */ + HYPRE_Real wall_time = 0.0; /* for debugging instrumentation */ HYPRE_Real *identity_block; @@ -2810,18 +2836,23 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, HYPRE_Real *distribute_block; hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_rank(comm, &my_id); num_threads = hypre_NumThreads(); + if (num_functions > 1) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Not implemented for num_functions > 1!"); + } + my_first_cpt = num_cpts_global[0]; - if (my_id == (num_procs -1)) total_global_cpts = num_cpts_global[1]; - hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); + if (my_id == (num_procs - 1)) { total_global_cpts = num_cpts_global[1]; } + hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); /*------------------------------------------------------------------- * Get the CF_marker data for the off-processor columns *-------------------------------------------------------------------*/ - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } CF_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); @@ -2833,19 +2864,19 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, } num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, - num_sends), HYPRE_MEMORY_HOST); + int_buf_data = hypre_CTAlloc(HYPRE_Int, + hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); index = 0; for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { int_buf_data[index++] - = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } - } /* we do not need the block version of comm handle - because @@ -2857,7 +2888,7 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, hypre_ParCSRCommHandleDestroy(comm_handle); - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Interp: Comm 1 CF_marker = %f\n", @@ -2869,7 +2900,7 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, * Get the ghost rows of A *---------------------------------------------------------------------*/ - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } if (num_procs > 1) { @@ -2880,9 +2911,9 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, } index = 0; - for (i=0; i < num_cols_A_offd; i++) + for (i = 0; i < num_cols_A_offd; i++) { - for (j=A_ext_i[i]; j < A_ext_i[i+1]; j++) + for (j = A_ext_i[i]; j < A_ext_i[i + 1]; j++) { big_k = A_ext_j[j]; if (big_k >= col_1 && big_k < col_n) @@ -2891,7 +2922,7 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, /* for the data field we must get all of the blocbig_k data */ for (bd = 0; bd < bnnz; bd++) { - A_ext_data[index*bnnz + bd] = A_ext_data[j*bnnz + bd]; + A_ext_data[index * bnnz + bd] = A_ext_data[j * bnnz + bd]; } index++; } @@ -2900,10 +2931,10 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, kc = hypre_BigBinarySearch(col_map_offd, big_k, num_cols_A_offd); if (kc > -1) { - A_ext_j[index] = (HYPRE_BigInt)(-kc-1); + A_ext_j[index] = (HYPRE_BigInt)(-kc - 1); for (bd = 0; bd < bnnz; bd++) { - A_ext_data[index*bnnz + bd] = A_ext_data[j*bnnz + bd]; + A_ext_data[index * bnnz + bd] = A_ext_data[j * bnnz + bd]; } index++; } @@ -2912,10 +2943,12 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, A_ext_i[i] = index; } for (i = num_cols_A_offd; i > 0; i--) - A_ext_i[i] = A_ext_i[i-1]; - if (num_procs > 1) A_ext_i[0] = 0; + { + A_ext_i[i] = A_ext_i[i - 1]; + } + if (num_procs > 1) { A_ext_i[0] = 0; } - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Interp: Comm 2 Get A_ext = %f\n", @@ -2938,7 +2971,7 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, fine_to_coarse = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); - for (i = 0; i < n_fine; i++) fine_to_coarse[i] = -1; + for (i = 0; i < n_fine; i++) { fine_to_coarse[i] = -1; } jj_counter = start_indexing; jj_counter_offd = start_indexing; @@ -2949,17 +2982,17 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, for (j = 0; j < num_threads; j++) { - size = n_fine/num_threads; - rest = n_fine - size*num_threads; + size = n_fine / num_threads; + rest = n_fine - size * num_threads; if (j < rest) { - ns = j*size+j; - ne = (j+1)*size+j+1; + ns = j * size + j; + ne = (j + 1) * size + j + 1; } else { - ns = j*size+rest; - ne = (j+1)*size+rest; + ns = j * size + rest; + ne = (j + 1) * size + rest; } @@ -2986,7 +3019,7 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, else { - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) { i1 = S_diag_j[jj]; if (CF_marker[i1] >= 0) @@ -2997,7 +3030,7 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, if (num_procs > 1) { - for (jj = S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) { i1 = S_offd_j[jj]; if (CF_marker_offd[i1] >= 0) @@ -3014,32 +3047,32 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, * Allocate arrays. *-----------------------------------------------------------------------*/ - for (i=0; i < num_threads-1; i++) + for (i = 0; i < num_threads - 1; i++) { - coarse_counter[i+1] += coarse_counter[i]; - jj_count[i+1] += jj_count[i]; - jj_count_offd[i+1] += jj_count_offd[i]; + coarse_counter[i + 1] += coarse_counter[i]; + jj_count[i + 1] += jj_count[i]; + jj_count_offd[i + 1] += jj_count_offd[i]; } - i = num_threads-1; + i = num_threads - 1; jj_counter = jj_count[i]; jj_counter_offd = jj_count_offd[i]; P_diag_size = jj_counter; - P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, HYPRE_MEMORY_HOST); + P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, HYPRE_MEMORY_HOST); P_diag_j = hypre_CTAlloc(HYPRE_Int, P_diag_size, HYPRE_MEMORY_HOST); /* we need to include the size of the blocks in the data size */ - P_diag_data = hypre_CTAlloc(HYPRE_Real, P_diag_size*bnnz, HYPRE_MEMORY_HOST); + P_diag_data = hypre_CTAlloc(HYPRE_Real, P_diag_size * bnnz, HYPRE_MEMORY_HOST); P_diag_i[n_fine] = jj_counter; P_offd_size = jj_counter_offd; - P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, HYPRE_MEMORY_HOST); + P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, HYPRE_MEMORY_HOST); P_offd_j = hypre_CTAlloc(HYPRE_Int, P_offd_size, HYPRE_MEMORY_HOST); /* we need to include the size of the blocks in the data size */ - P_offd_data = hypre_CTAlloc(HYPRE_Real, P_offd_size*bnnz, HYPRE_MEMORY_HOST); + P_offd_data = hypre_CTAlloc(HYPRE_Real, P_offd_size * bnnz, HYPRE_MEMORY_HOST); /*----------------------------------------------------------------------- * Intialize some stuff. @@ -3048,7 +3081,7 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, jj_counter = start_indexing; jj_counter_offd = start_indexing; - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Interp: Internal work 1 = %f\n", @@ -3060,9 +3093,9 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, identity_block = hypre_CTAlloc(HYPRE_Real, bnnz, HYPRE_MEMORY_HOST); zero_block = hypre_CTAlloc(HYPRE_Real, bnnz, HYPRE_MEMORY_HOST); - for(i = 0; i < block_size; i++) + for (i = 0; i < block_size; i++) { - identity_block[i*block_size + i] = 1.0; + identity_block[i * block_size + i] = 1.0; } @@ -3075,38 +3108,40 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, * Send and receive fine_to_coarse info. *-----------------------------------------------------------------------*/ - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } fine_to_coarse_offd = hypre_CTAlloc(HYPRE_BigInt, num_cols_A_offd, HYPRE_MEMORY_HOST); big_buf_data = hypre_CTAlloc(HYPRE_BigInt, hypre_ParCSRCommPkgSendMapStart(comm_pkg, - num_sends), HYPRE_MEMORY_HOST); + num_sends), HYPRE_MEMORY_HOST); for (j = 0; j < num_threads; j++) { coarse_shift = 0; - if (j > 0) coarse_shift = coarse_counter[j-1]; - size = n_fine/num_threads; - rest = n_fine - size*num_threads; + if (j > 0) { coarse_shift = coarse_counter[j - 1]; } + size = n_fine / num_threads; + rest = n_fine - size * num_threads; if (j < rest) { - ns = j*size+j; - ne = (j+1)*size+j+1; + ns = j * size + j; + ne = (j + 1) * size + j + 1; } else { - ns = j*size+rest; - ne = (j+1)*size+rest; + ns = j * size + rest; + ne = (j + 1) * size + rest; } for (i = ns; i < ne; i++) + { fine_to_coarse[i] += coarse_shift; + } } index = 0; for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) big_buf_data[index++] = my_first_cpt - + fine_to_coarse[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + + fine_to_coarse[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } /* again, we do not need to use the block version of comm handle since @@ -3117,7 +3152,7 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, hypre_ParCSRCommHandleDestroy(comm_handle); - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Interp: Comm 4 FineToCoarse = %f\n", @@ -3125,9 +3160,9 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, fflush(NULL); } - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } - for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt; + for (i = 0; i < n_fine; i++) { fine_to_coarse[i] -= my_first_cpt; } /*----------------------------------------------------------------------- * Loop over fine grid points. @@ -3135,22 +3170,22 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, for (jl = 0; jl < num_threads; jl++) { - size = n_fine/num_threads; - rest = n_fine - size*num_threads; + size = n_fine / num_threads; + rest = n_fine - size * num_threads; if (jl < rest) { - ns = jl*size+jl; - ne = (jl+1)*size+jl+1; + ns = jl * size + jl; + ne = (jl + 1) * size + jl + 1; } else { - ns = jl*size+rest; - ne = (jl+1)*size+rest; + ns = jl * size + rest; + ne = (jl + 1) * size + rest; } jj_counter = 0; - if (jl > 0) jj_counter = jj_count[jl-1]; + if (jl > 0) { jj_counter = jj_count[jl - 1]; } jj_counter_offd = 0; - if (jl > 0) jj_counter_offd = jj_count_offd[jl-1]; + if (jl > 0) { jj_counter_offd = jj_count_offd[jl - 1]; } P_marker = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); P_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); @@ -3178,7 +3213,7 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, P_diag_j[jj_counter] = fine_to_coarse[i]; /* P_diag_data[jj_counter] = one; */ hypre_CSRBlockMatrixBlockCopyData(identity_block, - &P_diag_data[jj_counter*bnnz], + &P_diag_data[jj_counter * bnnz], 1.0, block_size); jj_counter++; } @@ -3193,7 +3228,7 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, P_diag_i[i] = jj_counter; jj_begin_row = jj_counter; - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) { i1 = S_diag_j[jj]; @@ -3208,7 +3243,7 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, P_diag_j[jj_counter] = fine_to_coarse[i1]; /* P_diag_data[jj_counter] = zero; */ hypre_CSRBlockMatrixBlockCopyData(zero_block, - &P_diag_data[jj_counter*bnnz], + &P_diag_data[jj_counter * bnnz], 1.0, block_size); jj_counter++; } @@ -3232,7 +3267,7 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, if (num_procs > 1) { - for (jj = S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) { i1 = S_offd_j[jj]; @@ -3247,7 +3282,7 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, P_offd_j[jj_counter_offd] = i1; /* P_offd_data[jj_counter_offd] = zero; */ hypre_CSRBlockMatrixBlockCopyData(zero_block, - &P_offd_data[jj_counter_offd*bnnz], + &P_offd_data[jj_counter_offd * bnnz], 1.0, block_size); jj_counter_offd++; @@ -3279,7 +3314,7 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, /* Loop over ith row of A. First, the diagonal part of A */ - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) { i1 = A_diag_j[jj]; @@ -3291,7 +3326,7 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, if (P_marker[i1] >= jj_begin_row) { /* P_diag_data[P_marker[i1]] += A_diag_data[jj]; */ - hypre_CSRBlockMatrixBlockAddAccumulate(&A_diag_data[jj*bnnz], + hypre_CSRBlockMatrixBlockAddAccumulate(&A_diag_data[jj * bnnz], &P_diag_data[P_marker[i1]*bnnz], block_size); @@ -3320,14 +3355,14 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, *-----------------------------------------------------------*/ /* Diagonal block part of row i1 */ - for (jj1 = A_diag_i[i1]; jj1 < A_diag_i[i1+1]; jj1++) + for (jj1 = A_diag_i[i1]; jj1 < A_diag_i[i1 + 1]; jj1++) { i2 = A_diag_j[jj1]; if (P_marker[i2] >= jj_begin_row) { /* add diag data to sum */ /* sum += A_diag_data[jj1]; */ - hypre_CSRBlockMatrixBlockAddAccumulateDiag(&A_diag_data[jj1*bnnz], + hypre_CSRBlockMatrixBlockAddAccumulateDiag(&A_diag_data[jj1 * bnnz], sum_block, block_size); } } @@ -3335,14 +3370,14 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, /* Off-Diagonal block part of row i1 */ if (num_procs > 1) { - for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1+1]; jj1++) + for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1 + 1]; jj1++) { i2 = A_offd_j[jj1]; if (P_marker_offd[i2] >= jj_begin_row_offd ) { /* add off diag data to sum */ /*sum += A_offd_data[jj1];*/ - hypre_CSRBlockMatrixBlockAddAccumulateDiag(&A_offd_data[jj1*bnnz], + hypre_CSRBlockMatrixBlockAddAccumulateDiag(&A_offd_data[jj1 * bnnz], sum_block, block_size); } @@ -3351,7 +3386,7 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, /* check whether sum_block is singular (NOW SUM IS A DIAG MATRIX)*/ /* distribute = A_diag_data[jj] / sum; (if a diag element is 0 then that col is scaled by 1 instead of 1/diag) - doesn'treturn 0*/ - if (hypre_CSRBlockMatrixBlockInvMultDiag2(&A_diag_data[jj*bnnz], sum_block, + if (hypre_CSRBlockMatrixBlockInvMultDiag2(&A_diag_data[jj * bnnz], sum_block, distribute_block, block_size) == 0) { @@ -3362,7 +3397,7 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, *-----------------------------------------------------------*/ /* Diagonal block part of row i1 */ - for (jj1 = A_diag_i[i1]; jj1 < A_diag_i[i1+1]; jj1++) + for (jj1 = A_diag_i[i1]; jj1 < A_diag_i[i1 + 1]; jj1++) { i2 = A_diag_j[jj1]; if (P_marker[i2] >= jj_begin_row ) @@ -3373,7 +3408,7 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, /* multiply - result in sum_block */ hypre_CSRBlockMatrixBlockMultAddDiag2(distribute_block, - &A_diag_data[jj1*bnnz], 0.0, + &A_diag_data[jj1 * bnnz], 0.0, sum_block, block_size); @@ -3388,7 +3423,7 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, /* Off-Diagonal block part of row i1 */ if (num_procs > 1) { - for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1+1]; jj1++) + for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1 + 1]; jj1++) { i2 = A_offd_j[jj1]; if (P_marker_offd[i2] >= jj_begin_row_offd) @@ -3398,7 +3433,7 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, /* multiply - result in sum_block */ hypre_CSRBlockMatrixBlockMultAddDiag2(distribute_block, - &A_offd_data[jj1*bnnz], 0.0, + &A_offd_data[jj1 * bnnz], 0.0, sum_block, block_size); @@ -3422,7 +3457,7 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, if (num_procs > 1) { - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { i1 = A_offd_j[jj]; @@ -3434,7 +3469,7 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, if (P_marker_offd[i1] >= jj_begin_row_offd) { /* P_offd_data[P_marker_offd[i1]] += A_offd_data[jj]; */ - hypre_CSRBlockMatrixBlockAddAccumulate( &A_offd_data[jj*bnnz], + hypre_CSRBlockMatrixBlockAddAccumulate( &A_offd_data[jj * bnnz], &P_offd_data[P_marker_offd[i1]*bnnz], block_size); } @@ -3464,7 +3499,7 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, /* find row number */ c_num = A_offd_j[jj]; - for (jj1 = A_ext_i[c_num]; jj1 < A_ext_i[c_num+1]; jj1++) + for (jj1 = A_ext_i[c_num]; jj1 < A_ext_i[c_num + 1]; jj1++) { i2 = (HYPRE_Int)A_ext_j[jj1]; @@ -3474,17 +3509,17 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, if (P_marker[i2] >= jj_begin_row) { /* sum += A_ext_data[jj1]; */ - hypre_CSRBlockMatrixBlockAddAccumulateDiag(&A_ext_data[jj1*bnnz], + hypre_CSRBlockMatrixBlockAddAccumulateDiag(&A_ext_data[jj1 * bnnz], sum_block, block_size); } } else { /* in the off_diagonal block */ - if (P_marker_offd[-i2-1] >= jj_begin_row_offd) + if (P_marker_offd[-i2 - 1] >= jj_begin_row_offd) { /* sum += A_ext_data[jj1]; */ - hypre_CSRBlockMatrixBlockAddAccumulateDiag(&A_ext_data[jj1*bnnz], + hypre_CSRBlockMatrixBlockAddAccumulateDiag(&A_ext_data[jj1 * bnnz], sum_block, block_size); } @@ -3496,7 +3531,7 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, /* distribute = A_offd_data[jj] / sum; */ /* here we want: A_offd_data * sum^(-1) */ - if (hypre_CSRBlockMatrixBlockInvMultDiag2(&A_offd_data[jj*bnnz], sum_block, + if (hypre_CSRBlockMatrixBlockInvMultDiag2(&A_offd_data[jj * bnnz], sum_block, distribute_block, block_size) == 0) { @@ -3510,7 +3545,7 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, /* Diagonal block part of row i1 */ - for (jj1 = A_ext_i[c_num]; jj1 < A_ext_i[c_num+1]; jj1++) + for (jj1 = A_ext_i[c_num]; jj1 < A_ext_i[c_num + 1]; jj1++) { i2 = (HYPRE_Int)A_ext_j[jj1]; @@ -3523,7 +3558,7 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, /* multiply - result in sum_block */ hypre_CSRBlockMatrixBlockMultAddDiag2(distribute_block, - &A_ext_data[jj1*bnnz], 0.0, + &A_ext_data[jj1 * bnnz], 0.0, sum_block, block_size); @@ -3537,7 +3572,7 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, else { /* in the off_diagonal block */ - if (P_marker_offd[-i2-1] >= jj_begin_row_offd) + if (P_marker_offd[-i2 - 1] >= jj_begin_row_offd) /*P_offd_data[P_marker_offd[-i2-1]] += distribute * A_ext_data[jj1];*/ @@ -3545,13 +3580,13 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, /* multiply - result in sum_block */ hypre_CSRBlockMatrixBlockMultAddDiag2(distribute_block, - &A_ext_data[jj1*bnnz], 0.0, + &A_ext_data[jj1 * bnnz], 0.0, sum_block, block_size); /* add result to p_offd_data */ hypre_CSRBlockMatrixBlockAddAccumulate(sum_block, - &P_offd_data[P_marker_offd[-i2-1]*bnnz], + &P_offd_data[P_marker_offd[-i2 - 1]*bnnz], block_size); } } @@ -3572,18 +3607,18 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, /* want diagonal^(-1)*P_diag_data */ /* do division - put in sum_block */ - if ( hypre_CSRBlockMatrixBlockInvMult(diagonal_block, &P_diag_data[jj*bnnz], + if ( hypre_CSRBlockMatrixBlockInvMult(diagonal_block, &P_diag_data[jj * bnnz], sum_block, block_size) == 0) { /* now copy to P_diag_data[jj] and make negative */ - hypre_CSRBlockMatrixBlockCopyData(sum_block, &P_diag_data[jj*bnnz], + hypre_CSRBlockMatrixBlockCopyData(sum_block, &P_diag_data[jj * bnnz], -1.0, block_size); } else { /* hypre_printf(" Warning! singular diagonal block! Proc id %d row %d\n", my_id,i); */ /* just make P_diag_data negative since diagonal is singular) */ - hypre_CSRBlockMatrixBlockCopyData(&P_diag_data[jj*bnnz], &P_diag_data[jj*bnnz], + hypre_CSRBlockMatrixBlockCopyData(&P_diag_data[jj * bnnz], &P_diag_data[jj * bnnz], -1.0, block_size); } @@ -3594,11 +3629,11 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, /* P_offd_data[jj] /= -diagonal; */ /* do division - put in sum_block */ - hypre_CSRBlockMatrixBlockInvMult(diagonal_block, &P_offd_data[jj*bnnz], + hypre_CSRBlockMatrixBlockInvMult(diagonal_block, &P_offd_data[jj * bnnz], sum_block, block_size); /* now copy to P_offd_data[jj] and make negative */ - hypre_CSRBlockMatrixBlockCopyData(sum_block, &P_offd_data[jj*bnnz], + hypre_CSRBlockMatrixBlockCopyData(sum_block, &P_offd_data[jj * bnnz], -1.0, block_size); @@ -3609,7 +3644,7 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, strong_f_marker--; - P_offd_i[i+1] = jj_counter_offd; + P_offd_i[i + 1] = jj_counter_offd; } hypre_TFree(P_marker, HYPRE_MEMORY_HOST); hypre_TFree(P_marker_offd, HYPRE_MEMORY_HOST); @@ -3656,11 +3691,13 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, P_marker = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); - for (i=0; i < num_cols_A_offd; i++) + for (i = 0; i < num_cols_A_offd; i++) + { P_marker[i] = 0; + } num_cols_P_offd = 0; - for (i=0; i < P_offd_size; i++) + for (i = 0; i < P_offd_size; i++) { index = P_offd_j[i]; if (!P_marker[index]) @@ -3674,21 +3711,21 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, tmp_map_offd = hypre_CTAlloc(HYPRE_Int, num_cols_P_offd, HYPRE_MEMORY_HOST); index = 0; - for (i=0; i < num_cols_P_offd; i++) + for (i = 0; i < num_cols_P_offd; i++) { - while (P_marker[index]==0) index++; + while (P_marker[index] == 0) { index++; } tmp_map_offd[i] = index++; } - for (i=0; i < P_offd_size; i++) + for (i = 0; i < P_offd_size; i++) P_offd_j[i] = hypre_BinarySearch(tmp_map_offd, P_offd_j[i], num_cols_P_offd); hypre_TFree(P_marker, HYPRE_MEMORY_HOST); } - for (i=0; i < n_fine; i++) - if (CF_marker[i] == -3) CF_marker[i] = -1; + for (i = 0; i < n_fine; i++) + if (CF_marker[i] == -3) { CF_marker[i] = -1; } if (num_cols_P_offd) { @@ -3697,7 +3734,7 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, } /* use block version */ - hypre_GetCommPkgBlockRTFromCommPkgBlockA(P,A, tmp_map_offd, fine_to_coarse_offd); + hypre_GetCommPkgBlockRTFromCommPkgBlockA(P, A, tmp_map_offd, fine_to_coarse_offd); *P_ptr = P; @@ -3719,9 +3756,9 @@ hypre_BoomerAMGBuildBlockInterpRV( hypre_ParCSRBlockMatrix *A, hypre_TFree(jj_count, HYPRE_MEMORY_HOST); hypre_TFree(jj_count_offd, HYPRE_MEMORY_HOST); - if (num_procs > 1) hypre_CSRBlockMatrixDestroy(A_ext); + if (num_procs > 1) { hypre_CSRBlockMatrixDestroy(A_ext); } - return(0); + return (0); } @@ -3750,6 +3787,8 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, HYPRE_Int max_elmts, hypre_ParCSRBlockMatrix **P_ptr) { + HYPRE_UNUSED_VAR(dof_func); + HYPRE_UNUSED_VAR(num_functions); MPI_Comm comm = hypre_ParCSRBlockMatrixComm(A); hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRBlockMatrixCommPkg(A); @@ -3761,7 +3800,7 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, HYPRE_Int *A_diag_j = hypre_CSRBlockMatrixJ(A_diag); HYPRE_Int block_size = hypre_CSRBlockMatrixBlockSize(A_diag); - HYPRE_Int bnnz = block_size*block_size; + HYPRE_Int bnnz = block_size * block_size; hypre_CSRBlockMatrix *A_offd = hypre_ParCSRBlockMatrixOffd(A); HYPRE_Real *A_offd_data = hypre_CSRBlockMatrixData(A_offd); @@ -3784,8 +3823,7 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, HYPRE_Int *CF_marker_offd = NULL; - hypre_CSRBlockMatrix *A_ext; - + hypre_CSRBlockMatrix *A_ext = NULL; HYPRE_Real *A_ext_data = NULL; HYPRE_Int *A_ext_i = NULL; HYPRE_BigInt *A_ext_j = NULL; @@ -3804,10 +3842,10 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, HYPRE_Int *P_marker, *P_marker_offd = NULL; - HYPRE_Int jj_counter,jj_counter_offd; + HYPRE_Int jj_counter, jj_counter_offd; HYPRE_Int *jj_count, *jj_count_offd = NULL; - HYPRE_Int jj_begin_row,jj_begin_row_offd; - HYPRE_Int jj_end_row,jj_end_row_offd; + HYPRE_Int jj_begin_row, jj_begin_row_offd; + HYPRE_Int jj_end_row, jj_end_row_offd; HYPRE_Int start_indexing = 0; /* start indexing for P_data at 0 */ @@ -3825,8 +3863,8 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, HYPRE_Int bd; - HYPRE_Int i,i1,i2; - HYPRE_Int j,jl,jj,jj1; + HYPRE_Int i, i1, i2; + HYPRE_Int j, jl, jj, jj1; HYPRE_Int kc; HYPRE_BigInt big_k; HYPRE_Int start; @@ -3846,7 +3884,7 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, HYPRE_Int local_numrows = hypre_CSRBlockMatrixNumRows(A_diag); HYPRE_BigInt col_n = col_1 + (HYPRE_BigInt)local_numrows; - HYPRE_Real wall_time; /* for debugging instrumentation */ + HYPRE_Real wall_time = 0.0; /* for debugging instrumentation */ HYPRE_Real *identity_block; @@ -3856,18 +3894,18 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, HYPRE_Real *distribute_block; hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_rank(comm, &my_id); num_threads = hypre_NumThreads(); my_first_cpt = num_cpts_global[0]; - if (my_id == (num_procs -1)) total_global_cpts = num_cpts_global[1]; - hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); + if (my_id == (num_procs - 1)) { total_global_cpts = num_cpts_global[1]; } + hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); /*------------------------------------------------------------------- * Get the CF_marker data for the off-processor columns *-------------------------------------------------------------------*/ - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } CF_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); @@ -3880,16 +3918,16 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, - num_sends), HYPRE_MEMORY_HOST); + num_sends), HYPRE_MEMORY_HOST); index = 0; for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { int_buf_data[index++] - = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } } @@ -3903,7 +3941,7 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, hypre_ParCSRCommHandleDestroy(comm_handle); - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Interp: Comm 1 CF_marker = %f\n", @@ -3915,7 +3953,7 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, * Get the ghost rows of A *---------------------------------------------------------------------*/ - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } if (num_procs > 1) { @@ -3926,9 +3964,9 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, } index = 0; - for (i=0; i < num_cols_A_offd; i++) + for (i = 0; i < num_cols_A_offd; i++) { - for (j=A_ext_i[i]; j < A_ext_i[i+1]; j++) + for (j = A_ext_i[i]; j < A_ext_i[i + 1]; j++) { big_k = A_ext_j[j]; if (big_k >= col_1 && big_k < col_n) @@ -3937,7 +3975,7 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, /* for the data field we must get all of the blocbig_k data */ for (bd = 0; bd < bnnz; bd++) { - A_ext_data[index*bnnz + bd] = A_ext_data[j*bnnz + bd]; + A_ext_data[index * bnnz + bd] = A_ext_data[j * bnnz + bd]; } index++; } @@ -3946,10 +3984,10 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, kc = hypre_BigBinarySearch(col_map_offd, big_k, num_cols_A_offd); if (kc > -1) { - A_ext_j[index] = (HYPRE_BigInt)(-kc-1); + A_ext_j[index] = (HYPRE_BigInt)(-kc - 1); for (bd = 0; bd < bnnz; bd++) { - A_ext_data[index*bnnz + bd] = A_ext_data[j*bnnz + bd]; + A_ext_data[index * bnnz + bd] = A_ext_data[j * bnnz + bd]; } index++; } @@ -3958,10 +3996,12 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, A_ext_i[i] = index; } for (i = num_cols_A_offd; i > 0; i--) - A_ext_i[i] = A_ext_i[i-1]; - if (num_procs > 1) A_ext_i[0] = 0; + { + A_ext_i[i] = A_ext_i[i - 1]; + } + if (num_procs > 1) { A_ext_i[0] = 0; } - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Interp: Comm 2 Get A_ext = %f\n", @@ -3984,7 +4024,7 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, fine_to_coarse = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); - for (i = 0; i < n_fine; i++) fine_to_coarse[i] = -1; + for (i = 0; i < n_fine; i++) { fine_to_coarse[i] = -1; } jj_counter = start_indexing; jj_counter_offd = start_indexing; @@ -3996,17 +4036,17 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, for (j = 0; j < num_threads; j++) { - size = n_fine/num_threads; - rest = n_fine - size*num_threads; + size = n_fine / num_threads; + rest = n_fine - size * num_threads; if (j < rest) { - ns = j*size+j; - ne = (j+1)*size+j+1; + ns = j * size + j; + ne = (j + 1) * size + j + 1; } else { - ns = j*size+rest; - ne = (j+1)*size+rest; + ns = j * size + rest; + ne = (j + 1) * size + rest; } @@ -4033,7 +4073,7 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, else { - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) { i1 = S_diag_j[jj]; if (CF_marker[i1] >= 0) @@ -4044,7 +4084,7 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, if (num_procs > 1) { - for (jj = S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) { i1 = S_offd_j[jj]; if (CF_marker_offd[i1] >= 0) @@ -4061,32 +4101,32 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, * Allocate arrays. *-----------------------------------------------------------------------*/ - for (i=0; i < num_threads-1; i++) + for (i = 0; i < num_threads - 1; i++) { - coarse_counter[i+1] += coarse_counter[i]; - jj_count[i+1] += jj_count[i]; - jj_count_offd[i+1] += jj_count_offd[i]; + coarse_counter[i + 1] += coarse_counter[i]; + jj_count[i + 1] += jj_count[i]; + jj_count_offd[i + 1] += jj_count_offd[i]; } - i = num_threads-1; + i = num_threads - 1; jj_counter = jj_count[i]; jj_counter_offd = jj_count_offd[i]; P_diag_size = jj_counter; - P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, HYPRE_MEMORY_HOST); + P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, HYPRE_MEMORY_HOST); P_diag_j = hypre_CTAlloc(HYPRE_Int, P_diag_size, HYPRE_MEMORY_HOST); /* we need to include the size of the blocks in the data size */ - P_diag_data = hypre_CTAlloc(HYPRE_Real, P_diag_size*bnnz, HYPRE_MEMORY_HOST); + P_diag_data = hypre_CTAlloc(HYPRE_Real, P_diag_size * bnnz, HYPRE_MEMORY_HOST); P_diag_i[n_fine] = jj_counter; P_offd_size = jj_counter_offd; - P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, HYPRE_MEMORY_HOST); + P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, HYPRE_MEMORY_HOST); P_offd_j = hypre_CTAlloc(HYPRE_Int, P_offd_size, HYPRE_MEMORY_HOST); /* we need to include the size of the blocks in the data size */ - P_offd_data = hypre_CTAlloc(HYPRE_Real, P_offd_size*bnnz, HYPRE_MEMORY_HOST); + P_offd_data = hypre_CTAlloc(HYPRE_Real, P_offd_size * bnnz, HYPRE_MEMORY_HOST); /*----------------------------------------------------------------------- * Intialize some stuff. @@ -4095,7 +4135,7 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, jj_counter = start_indexing; jj_counter_offd = start_indexing; - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Interp: Internal work 1 = %f\n", @@ -4107,9 +4147,9 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, identity_block = hypre_CTAlloc(HYPRE_Real, bnnz, HYPRE_MEMORY_HOST); zero_block = hypre_CTAlloc(HYPRE_Real, bnnz, HYPRE_MEMORY_HOST); - for(i = 0; i < block_size; i++) + for (i = 0; i < block_size; i++) { - identity_block[i*block_size + i] = 1.0; + identity_block[i * block_size + i] = 1.0; } @@ -4122,38 +4162,40 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, * Send and receive fine_to_coarse info. *-----------------------------------------------------------------------*/ - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } fine_to_coarse_offd = hypre_CTAlloc(HYPRE_BigInt, num_cols_A_offd, HYPRE_MEMORY_HOST); big_buf_data = hypre_CTAlloc(HYPRE_BigInt, hypre_ParCSRCommPkgSendMapStart(comm_pkg, - num_sends), HYPRE_MEMORY_HOST); + num_sends), HYPRE_MEMORY_HOST); for (j = 0; j < num_threads; j++) { coarse_shift = 0; - if (j > 0) coarse_shift = coarse_counter[j-1]; - size = n_fine/num_threads; - rest = n_fine - size*num_threads; + if (j > 0) { coarse_shift = coarse_counter[j - 1]; } + size = n_fine / num_threads; + rest = n_fine - size * num_threads; if (j < rest) { - ns = j*size+j; - ne = (j+1)*size+j+1; + ns = j * size + j; + ne = (j + 1) * size + j + 1; } else { - ns = j*size+rest; - ne = (j+1)*size+rest; + ns = j * size + rest; + ne = (j + 1) * size + rest; } for (i = ns; i < ne; i++) + { fine_to_coarse[i] += coarse_shift; + } } index = 0; for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) big_buf_data[index++] = my_first_cpt - + fine_to_coarse[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + + fine_to_coarse[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } /* again, we do not need to use the block version of comm handle since @@ -4164,7 +4206,7 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, hypre_ParCSRCommHandleDestroy(comm_handle); - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Interp: Comm 4 FineToCoarse = %f\n", @@ -4172,7 +4214,7 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, fflush(NULL); } - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } /*----------------------------------------------------------------------- @@ -4182,22 +4224,22 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, for (jl = 0; jl < num_threads; jl++) { - size = n_fine/num_threads; - rest = n_fine - size*num_threads; + size = n_fine / num_threads; + rest = n_fine - size * num_threads; if (jl < rest) { - ns = jl*size+jl; - ne = (jl+1)*size+jl+1; + ns = jl * size + jl; + ne = (jl + 1) * size + jl + 1; } else { - ns = jl*size+rest; - ne = (jl+1)*size+rest; + ns = jl * size + rest; + ne = (jl + 1) * size + rest; } jj_counter = 0; - if (jl > 0) jj_counter = jj_count[jl-1]; + if (jl > 0) { jj_counter = jj_count[jl - 1]; } jj_counter_offd = 0; - if (jl > 0) jj_counter_offd = jj_count_offd[jl-1]; + if (jl > 0) { jj_counter_offd = jj_count_offd[jl - 1]; } P_marker = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); P_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); @@ -4225,7 +4267,7 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, P_diag_j[jj_counter] = fine_to_coarse[i]; /* P_diag_data[jj_counter] = one; */ hypre_CSRBlockMatrixBlockCopyData(identity_block, - &P_diag_data[jj_counter*bnnz], + &P_diag_data[jj_counter * bnnz], 1.0, block_size); jj_counter++; } @@ -4240,7 +4282,7 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, P_diag_i[i] = jj_counter; jj_begin_row = jj_counter; - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) { i1 = S_diag_j[jj]; @@ -4255,7 +4297,7 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, P_diag_j[jj_counter] = fine_to_coarse[i1]; /* P_diag_data[jj_counter] = zero; */ hypre_CSRBlockMatrixBlockCopyData(zero_block, - &P_diag_data[jj_counter*bnnz], + &P_diag_data[jj_counter * bnnz], 1.0, block_size); jj_counter++; } @@ -4279,7 +4321,7 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, if (num_procs > 1) { - for (jj = S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) { i1 = S_offd_j[jj]; @@ -4294,7 +4336,7 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, P_offd_j[jj_counter_offd] = i1; /* P_offd_data[jj_counter_offd] = zero; */ hypre_CSRBlockMatrixBlockCopyData(zero_block, - &P_offd_data[jj_counter_offd*bnnz], + &P_offd_data[jj_counter_offd * bnnz], 1.0, block_size); jj_counter_offd++; @@ -4326,7 +4368,7 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, /* Loop over ith row of A. First, the diagonal part of A */ - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) { i1 = A_diag_j[jj]; @@ -4338,7 +4380,7 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, if (P_marker[i1] >= jj_begin_row) { /* P_diag_data[P_marker[i1]] += A_diag_data[jj]; */ - hypre_CSRBlockMatrixBlockAddAccumulate(&A_diag_data[jj*bnnz], + hypre_CSRBlockMatrixBlockAddAccumulate(&A_diag_data[jj * bnnz], &P_diag_data[P_marker[i1]*bnnz], block_size); @@ -4366,14 +4408,14 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, *-----------------------------------------------------------*/ /* Diagonal block part of row i1 */ - for (jj1 = A_diag_i[i1]; jj1 < A_diag_i[i1+1]; jj1++) + for (jj1 = A_diag_i[i1]; jj1 < A_diag_i[i1 + 1]; jj1++) { i2 = A_diag_j[jj1]; if (P_marker[i2] >= jj_begin_row) { /* add diag data to sum */ /* sum += A_diag_data[jj1]; */ - hypre_CSRBlockMatrixBlockAddAccumulateDiag(&A_diag_data[jj1*bnnz], + hypre_CSRBlockMatrixBlockAddAccumulateDiag(&A_diag_data[jj1 * bnnz], sum_block, block_size); } } @@ -4381,14 +4423,14 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, /* Off-Diagonal block part of row i1 */ if (num_procs > 1) { - for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1+1]; jj1++) + for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1 + 1]; jj1++) { i2 = A_offd_j[jj1]; if (P_marker_offd[i2] >= jj_begin_row_offd ) { /* add off diag data to sum */ /*sum += A_offd_data[jj1];*/ - hypre_CSRBlockMatrixBlockAddAccumulateDiag(&A_offd_data[jj1*bnnz], + hypre_CSRBlockMatrixBlockAddAccumulateDiag(&A_offd_data[jj1 * bnnz], sum_block, block_size); } } @@ -4397,7 +4439,7 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, ENTRIES ARE THE ROW SUMS)*/ /* distribute = A_diag_data[jj] / sum; (if a diag element is 0 then that col is scaled by 1 instead of 1/diag) - doesn'treturn 0*/ - if (hypre_CSRBlockMatrixBlockInvMultDiag3(&A_diag_data[jj*bnnz], sum_block, + if (hypre_CSRBlockMatrixBlockInvMultDiag3(&A_diag_data[jj * bnnz], sum_block, distribute_block, block_size) == 0) { @@ -4407,7 +4449,7 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, *-----------------------------------------------------------*/ /* Diagonal block part of row i1 */ - for (jj1 = A_diag_i[i1]; jj1 < A_diag_i[i1+1]; jj1++) + for (jj1 = A_diag_i[i1]; jj1 < A_diag_i[i1 + 1]; jj1++) { i2 = A_diag_j[jj1]; if (P_marker[i2] >= jj_begin_row ) @@ -4418,7 +4460,7 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, /* multiply - result in sum_block */ hypre_CSRBlockMatrixBlockMultAddDiag3(distribute_block, - &A_diag_data[jj1*bnnz], 0.0, + &A_diag_data[jj1 * bnnz], 0.0, sum_block, block_size); /* add result to p_diag_data */ @@ -4431,7 +4473,7 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, /* Off-Diagonal block part of row i1 */ if (num_procs > 1) { - for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1+1]; jj1++) + for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1 + 1]; jj1++) { i2 = A_offd_j[jj1]; if (P_marker_offd[i2] >= jj_begin_row_offd) @@ -4441,7 +4483,7 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, /* multiply - result in sum_block */ hypre_CSRBlockMatrixBlockMultAddDiag3(distribute_block, - &A_offd_data[jj1*bnnz], 0.0, + &A_offd_data[jj1 * bnnz], 0.0, sum_block, block_size); @@ -4464,7 +4506,7 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, if (num_procs > 1) { - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { i1 = A_offd_j[jj]; @@ -4476,7 +4518,7 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, if (P_marker_offd[i1] >= jj_begin_row_offd) { /* P_offd_data[P_marker_offd[i1]] += A_offd_data[jj]; */ - hypre_CSRBlockMatrixBlockAddAccumulate( &A_offd_data[jj*bnnz], + hypre_CSRBlockMatrixBlockAddAccumulate( &A_offd_data[jj * bnnz], &P_offd_data[P_marker_offd[i1]*bnnz], block_size); } @@ -4506,7 +4548,7 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, /* find row number */ c_num = A_offd_j[jj]; - for (jj1 = A_ext_i[c_num]; jj1 < A_ext_i[c_num+1]; jj1++) + for (jj1 = A_ext_i[c_num]; jj1 < A_ext_i[c_num + 1]; jj1++) { i2 = (HYPRE_Int)A_ext_j[jj1]; @@ -4516,17 +4558,17 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, if (P_marker[i2] >= jj_begin_row) { /* sum += A_ext_data[jj1]; */ - hypre_CSRBlockMatrixBlockAddAccumulateDiag(&A_ext_data[jj1*bnnz], + hypre_CSRBlockMatrixBlockAddAccumulateDiag(&A_ext_data[jj1 * bnnz], sum_block, block_size); } } else { /* in the off_diagonal block */ - if (P_marker_offd[-i2-1] >= jj_begin_row_offd) + if (P_marker_offd[-i2 - 1] >= jj_begin_row_offd) { /* sum += A_ext_data[jj1]; */ - hypre_CSRBlockMatrixBlockAddAccumulateDiag(&A_ext_data[jj1*bnnz], + hypre_CSRBlockMatrixBlockAddAccumulateDiag(&A_ext_data[jj1 * bnnz], sum_block, block_size); } @@ -4539,7 +4581,7 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, /* distribute = A_offd_data[jj] / sum; */ /* here we want: A_offd_data * sum^(-1) - use the row sums as the diag for sum*/ - if (hypre_CSRBlockMatrixBlockInvMultDiag3(&A_offd_data[jj*bnnz], sum_block, + if (hypre_CSRBlockMatrixBlockInvMultDiag3(&A_offd_data[jj * bnnz], sum_block, distribute_block, block_size) == 0) { @@ -4552,7 +4594,7 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, /* Diagonal block part of row i1 */ - for (jj1 = A_ext_i[c_num]; jj1 < A_ext_i[c_num+1]; jj1++) + for (jj1 = A_ext_i[c_num]; jj1 < A_ext_i[c_num + 1]; jj1++) { i2 = (HYPRE_Int)A_ext_j[jj1]; @@ -4565,7 +4607,7 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, /* multiply - result in sum_block */ hypre_CSRBlockMatrixBlockMultAddDiag3(distribute_block, - &A_ext_data[jj1*bnnz], 0.0, + &A_ext_data[jj1 * bnnz], 0.0, sum_block, block_size); @@ -4578,7 +4620,7 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, else { /* in the off_diagonal block */ - if (P_marker_offd[-i2-1] >= jj_begin_row_offd) + if (P_marker_offd[-i2 - 1] >= jj_begin_row_offd) /*P_offd_data[P_marker_offd[-i2-1]] += distribute * A_ext_data[jj1];*/ @@ -4586,12 +4628,12 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, /* multiply - result in sum_block */ hypre_CSRBlockMatrixBlockMultAddDiag3(distribute_block, - &A_ext_data[jj1*bnnz], 0.0, + &A_ext_data[jj1 * bnnz], 0.0, sum_block, block_size); /* add result to p_offd_data */ hypre_CSRBlockMatrixBlockAddAccumulate(sum_block, - &P_offd_data[P_marker_offd[-i2-1]*bnnz], + &P_offd_data[P_marker_offd[-i2 - 1]*bnnz], block_size); } } @@ -4612,18 +4654,18 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, /* want diagonal^(-1)*P_diag_data */ /* do division - put in sum_block */ - if ( hypre_CSRBlockMatrixBlockInvMult(diagonal_block, &P_diag_data[jj*bnnz], + if ( hypre_CSRBlockMatrixBlockInvMult(diagonal_block, &P_diag_data[jj * bnnz], sum_block, block_size) == 0) { /* now copy to P_diag_data[jj] and make negative */ - hypre_CSRBlockMatrixBlockCopyData(sum_block, &P_diag_data[jj*bnnz], + hypre_CSRBlockMatrixBlockCopyData(sum_block, &P_diag_data[jj * bnnz], -1.0, block_size); } else { /* hypre_printf(" Warning! singular diagonal block! Proc id %d row %d\n", my_id,i); */ /* just make P_diag_data negative since diagonal is singular) */ - hypre_CSRBlockMatrixBlockCopyData(&P_diag_data[jj*bnnz], &P_diag_data[jj*bnnz], + hypre_CSRBlockMatrixBlockCopyData(&P_diag_data[jj * bnnz], &P_diag_data[jj * bnnz], -1.0, block_size); } } @@ -4633,18 +4675,18 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, /* P_offd_data[jj] /= -diagonal; */ /* do division - put in sum_block */ - hypre_CSRBlockMatrixBlockInvMult(diagonal_block, &P_offd_data[jj*bnnz], + hypre_CSRBlockMatrixBlockInvMult(diagonal_block, &P_offd_data[jj * bnnz], sum_block, block_size); /* now copy to P_offd_data[jj] and make negative */ - hypre_CSRBlockMatrixBlockCopyData(sum_block, &P_offd_data[jj*bnnz], + hypre_CSRBlockMatrixBlockCopyData(sum_block, &P_offd_data[jj * bnnz], -1.0, block_size); } } strong_f_marker--; - P_offd_i[i+1] = jj_counter_offd; + P_offd_i[i + 1] = jj_counter_offd; } hypre_TFree(P_marker, HYPRE_MEMORY_HOST); hypre_TFree(P_marker_offd, HYPRE_MEMORY_HOST); @@ -4690,11 +4732,13 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, { P_marker = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); - for (i=0; i < num_cols_A_offd; i++) + for (i = 0; i < num_cols_A_offd; i++) + { P_marker[i] = 0; + } num_cols_P_offd = 0; - for (i=0; i < P_offd_size; i++) + for (i = 0; i < P_offd_size; i++) { index = P_offd_j[i]; if (!P_marker[index]) @@ -4708,21 +4752,21 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, col_map_offd_P = hypre_CTAlloc(HYPRE_BigInt, num_cols_P_offd, HYPRE_MEMORY_HOST); index = 0; - for (i=0; i < num_cols_P_offd; i++) + for (i = 0; i < num_cols_P_offd; i++) { - while (P_marker[index]==0) index++; + while (P_marker[index] == 0) { index++; } tmp_map_offd[i] = index++; } - for (i=0; i < P_offd_size; i++) + for (i = 0; i < P_offd_size; i++) P_offd_j[i] = hypre_BinarySearch(tmp_map_offd, P_offd_j[i], num_cols_P_offd); hypre_TFree(P_marker, HYPRE_MEMORY_HOST); } - for (i=0; i < n_fine; i++) - if (CF_marker[i] == -3) CF_marker[i] = -1; + for (i = 0; i < n_fine; i++) + if (CF_marker[i] == -3) { CF_marker[i] = -1; } if (num_cols_P_offd) { @@ -4731,7 +4775,7 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, } /* use block version */ - hypre_GetCommPkgBlockRTFromCommPkgBlockA(P,A, tmp_map_offd,fine_to_coarse_offd); + hypre_GetCommPkgBlockRTFromCommPkgBlockA(P, A, tmp_map_offd, fine_to_coarse_offd); *P_ptr = P; @@ -4753,9 +4797,9 @@ hypre_BoomerAMGBuildBlockInterpRV2( hypre_ParCSRBlockMatrix *A, hypre_TFree(jj_count, HYPRE_MEMORY_HOST); hypre_TFree(jj_count_offd, HYPRE_MEMORY_HOST); - if (num_procs > 1) hypre_CSRBlockMatrixDestroy(A_ext); + if (num_procs > 1) { hypre_CSRBlockMatrixDestroy(A_ext); } - return(0); + return (0); } @@ -4775,6 +4819,7 @@ hypre_BoomerAMGBuildBlockDirInterp( hypre_ParCSRBlockMatrix *A, HYPRE_Int max_elmts, hypre_ParCSRBlockMatrix **P_ptr) { + HYPRE_UNUSED_VAR(dof_func); MPI_Comm comm = hypre_ParCSRBlockMatrixComm(A); hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRBlockMatrixCommPkg(A); @@ -4786,7 +4831,7 @@ hypre_BoomerAMGBuildBlockDirInterp( hypre_ParCSRBlockMatrix *A, HYPRE_Int *A_diag_j = hypre_CSRBlockMatrixJ(A_diag); HYPRE_Int block_size = hypre_CSRBlockMatrixBlockSize(A_diag); - HYPRE_Int bnnz = block_size*block_size; + HYPRE_Int bnnz = block_size * block_size; hypre_CSRBlockMatrix *A_offd = hypre_ParCSRBlockMatrixOffd(A); @@ -4824,10 +4869,10 @@ hypre_BoomerAMGBuildBlockDirInterp( hypre_ParCSRBlockMatrix *A, HYPRE_Int *P_marker, *P_marker_offd = NULL; - HYPRE_Int jj_counter,jj_counter_offd; + HYPRE_Int jj_counter, jj_counter_offd; HYPRE_Int *jj_count, *jj_count_offd = NULL; - HYPRE_Int jj_begin_row,jj_begin_row_offd; - HYPRE_Int jj_end_row,jj_end_row_offd; + HYPRE_Int jj_begin_row, jj_begin_row_offd; + HYPRE_Int jj_end_row, jj_end_row_offd; HYPRE_Int start_indexing = 0; /* start indexing for P_data at 0 */ @@ -4841,8 +4886,8 @@ hypre_BoomerAMGBuildBlockDirInterp( hypre_ParCSRBlockMatrix *A, HYPRE_Int num_cols_P_offd; HYPRE_BigInt my_first_cpt; - HYPRE_Int i,i1; - HYPRE_Int j,jl,jj; + HYPRE_Int i, i1; + HYPRE_Int j, jl, jj; HYPRE_Int start; HYPRE_Int my_id; @@ -4854,7 +4899,7 @@ hypre_BoomerAMGBuildBlockDirInterp( hypre_ParCSRBlockMatrix *A, HYPRE_Int *int_buf_data = NULL; HYPRE_BigInt *big_buf_data = NULL; - HYPRE_Real wall_time; /* for debugging instrumentation */ + HYPRE_Real wall_time = 0.0; /* for debugging instrumentation */ HYPRE_Real *identity_block; HYPRE_Real *zero_block; @@ -4864,22 +4909,26 @@ hypre_BoomerAMGBuildBlockDirInterp( hypre_ParCSRBlockMatrix *A, HYPRE_Real *r_block; hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_rank(comm, &my_id); num_threads = hypre_NumThreads(); + if (num_functions > 1) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Not implemented for num_functions > 1!"); + } + my_first_cpt = num_cpts_global[0]; - if (my_id == (num_procs -1)) total_global_cpts = num_cpts_global[1]; - hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); + if (my_id == (num_procs - 1)) { total_global_cpts = num_cpts_global[1]; } + hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); /*------------------------------------------------------------------- * Get the CF_marker data for the off-processor columns *-------------------------------------------------------------------*/ - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } CF_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); - if (!comm_pkg) { hypre_BlockMatvecCommPkgCreate(A); @@ -4887,24 +4936,25 @@ hypre_BoomerAMGBuildBlockDirInterp( hypre_ParCSRBlockMatrix *A, } num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, - num_sends), HYPRE_MEMORY_HOST); + int_buf_data = hypre_CTAlloc(HYPRE_Int, + hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); index = 0; for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) + { int_buf_data[index++] - = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; + } } - comm_handle = hypre_ParCSRCommHandleCreate( 11, comm_pkg, int_buf_data, - CF_marker_offd); - + comm_handle = hypre_ParCSRCommHandleCreate(11, comm_pkg, int_buf_data, CF_marker_offd); hypre_ParCSRCommHandleDestroy(comm_handle); - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Interp: Comm 1 CF_marker = %f\n", @@ -4926,7 +4976,7 @@ hypre_BoomerAMGBuildBlockDirInterp( hypre_ParCSRBlockMatrix *A, fine_to_coarse = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); - for (i = 0; i < n_fine; i++) fine_to_coarse[i] = -1; + for (i = 0; i < n_fine; i++) { fine_to_coarse[i] = -1; } jj_counter = start_indexing; jj_counter_offd = start_indexing; @@ -4938,24 +4988,22 @@ hypre_BoomerAMGBuildBlockDirInterp( hypre_ParCSRBlockMatrix *A, for (j = 0; j < num_threads; j++) { - size = n_fine/num_threads; - rest = n_fine - size*num_threads; + size = n_fine / num_threads; + rest = n_fine - size * num_threads; if (j < rest) { - ns = j*size+j; - ne = (j+1)*size+j+1; + ns = j * size + j; + ne = (j + 1) * size + j + 1; } else { - ns = j*size+rest; - ne = (j+1)*size+rest; + ns = j * size + rest; + ne = (j + 1) * size + rest; } - /* loop over the fine grid points */ for (i = ns; i < ne; i++) { - /*-------------------------------------------------------------------- * If i is a C-point, interpolation is the identity. Also set up * mapping vector (fine_to_coarse is the mapping vector). @@ -4975,7 +5023,7 @@ hypre_BoomerAMGBuildBlockDirInterp( hypre_ParCSRBlockMatrix *A, else { - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) { i1 = S_diag_j[jj]; if (CF_marker[i1] > 0) @@ -4986,7 +5034,7 @@ hypre_BoomerAMGBuildBlockDirInterp( hypre_ParCSRBlockMatrix *A, if (num_procs > 1) { - for (jj = S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) { i1 = S_offd_j[jj]; if (CF_marker_offd[i1] > 0) @@ -5003,32 +5051,32 @@ hypre_BoomerAMGBuildBlockDirInterp( hypre_ParCSRBlockMatrix *A, * Allocate arrays. *-----------------------------------------------------------------------*/ - for (i=0; i < num_threads-1; i++) + for (i = 0; i < num_threads - 1; i++) { - coarse_counter[i+1] += coarse_counter[i]; - jj_count[i+1] += jj_count[i]; - jj_count_offd[i+1] += jj_count_offd[i]; + coarse_counter[i + 1] += coarse_counter[i]; + jj_count[i + 1] += jj_count[i]; + jj_count_offd[i + 1] += jj_count_offd[i]; } - i = num_threads-1; + i = num_threads - 1; jj_counter = jj_count[i]; jj_counter_offd = jj_count_offd[i]; P_diag_size = jj_counter; - P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, HYPRE_MEMORY_HOST); + P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, HYPRE_MEMORY_HOST); P_diag_j = hypre_CTAlloc(HYPRE_Int, P_diag_size, HYPRE_MEMORY_HOST); /* we need to include the size of the blocks in the data size */ - P_diag_data = hypre_CTAlloc(HYPRE_Real, P_diag_size*bnnz, HYPRE_MEMORY_HOST); + P_diag_data = hypre_CTAlloc(HYPRE_Real, P_diag_size * bnnz, HYPRE_MEMORY_HOST); P_diag_i[n_fine] = jj_counter; P_offd_size = jj_counter_offd; - P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, HYPRE_MEMORY_HOST); + P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, HYPRE_MEMORY_HOST); P_offd_j = hypre_CTAlloc(HYPRE_Int, P_offd_size, HYPRE_MEMORY_HOST); /* we need to include the size of the blocks in the data size */ - P_offd_data = hypre_CTAlloc(HYPRE_Real, P_offd_size*bnnz, HYPRE_MEMORY_HOST); + P_offd_data = hypre_CTAlloc(HYPRE_Real, P_offd_size * bnnz, HYPRE_MEMORY_HOST); /*----------------------------------------------------------------------- * Intialize some stuff. @@ -5037,7 +5085,7 @@ hypre_BoomerAMGBuildBlockDirInterp( hypre_ParCSRBlockMatrix *A, jj_counter = start_indexing; jj_counter_offd = start_indexing; - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Interp: Internal work 1 = %f\n", @@ -5049,9 +5097,9 @@ hypre_BoomerAMGBuildBlockDirInterp( hypre_ParCSRBlockMatrix *A, identity_block = hypre_CTAlloc(HYPRE_Real, bnnz, HYPRE_MEMORY_HOST); zero_block = hypre_CTAlloc(HYPRE_Real, bnnz, HYPRE_MEMORY_HOST); - for(i = 0; i < block_size; i++) + for (i = 0; i < block_size; i++) { - identity_block[i*block_size + i] = 1.0; + identity_block[i * block_size + i] = 1.0; } /* we also need a block to keep track of the diagonal values and a sum */ diagonal_block = hypre_CTAlloc(HYPRE_Real, bnnz, HYPRE_MEMORY_HOST); @@ -5063,46 +5111,49 @@ hypre_BoomerAMGBuildBlockDirInterp( hypre_ParCSRBlockMatrix *A, * Send and receive fine_to_coarse info. *-----------------------------------------------------------------------*/ - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } - fine_to_coarse_offd = hypre_CTAlloc(HYPRE_BigInt, num_cols_A_offd, HYPRE_MEMORY_HOST); - big_buf_data = hypre_CTAlloc(HYPRE_BigInt, hypre_ParCSRCommPkgSendMapStart(comm_pkg, - num_sends), HYPRE_MEMORY_HOST); + fine_to_coarse_offd = hypre_CTAlloc(HYPRE_BigInt, num_cols_A_offd, HYPRE_MEMORY_HOST); + big_buf_data = hypre_CTAlloc(HYPRE_BigInt, + hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); for (j = 0; j < num_threads; j++) { coarse_shift = 0; - if (j > 0) coarse_shift = coarse_counter[j-1]; - size = n_fine/num_threads; - rest = n_fine - size*num_threads; + if (j > 0) { coarse_shift = coarse_counter[j - 1]; } + size = n_fine / num_threads; + rest = n_fine - size * num_threads; if (j < rest) { - ns = j*size+j; - ne = (j+1)*size+j+1; + ns = j * size + j; + ne = (j + 1) * size + j + 1; } else { - ns = j*size+rest; - ne = (j+1)*size+rest; + ns = j * size + rest; + ne = (j + 1) * size + rest; } for (i = ns; i < ne; i++) + { fine_to_coarse[i] += coarse_shift; + } } index = 0; for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) + { big_buf_data[index++] = my_first_cpt - + fine_to_coarse[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + + fine_to_coarse[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; + } } - comm_handle = hypre_ParCSRCommHandleCreate( 21, comm_pkg, big_buf_data, - fine_to_coarse_offd); - + comm_handle = hypre_ParCSRCommHandleCreate(21, comm_pkg, big_buf_data, fine_to_coarse_offd); hypre_ParCSRCommHandleDestroy(comm_handle); - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Interp: Comm 4 FineToCoarse = %f\n", @@ -5110,7 +5161,7 @@ hypre_BoomerAMGBuildBlockDirInterp( hypre_ParCSRBlockMatrix *A, fflush(NULL); } - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } /*----------------------------------------------------------------------- * Loop over fine grid points. @@ -5118,22 +5169,22 @@ hypre_BoomerAMGBuildBlockDirInterp( hypre_ParCSRBlockMatrix *A, for (jl = 0; jl < num_threads; jl++) { - size = n_fine/num_threads; - rest = n_fine - size*num_threads; + size = n_fine / num_threads; + rest = n_fine - size * num_threads; if (jl < rest) { - ns = jl*size+jl; - ne = (jl+1)*size+jl+1; + ns = jl * size + jl; + ne = (jl + 1) * size + jl + 1; } else { - ns = jl*size+rest; - ne = (jl+1)*size+rest; + ns = jl * size + rest; + ne = (jl + 1) * size + rest; } jj_counter = 0; - if (jl > 0) jj_counter = jj_count[jl-1]; + if (jl > 0) { jj_counter = jj_count[jl - 1]; } jj_counter_offd = 0; - if (jl > 0) jj_counter_offd = jj_count_offd[jl-1]; + if (jl > 0) { jj_counter_offd = jj_count_offd[jl - 1]; } P_marker = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); P_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); @@ -5160,7 +5211,7 @@ hypre_BoomerAMGBuildBlockDirInterp( hypre_ParCSRBlockMatrix *A, P_diag_j[jj_counter] = fine_to_coarse[i]; /* P_diag_data[jj_counter] = one; */ hypre_CSRBlockMatrixBlockCopyData(identity_block, - &P_diag_data[jj_counter*bnnz], + &P_diag_data[jj_counter * bnnz], 1.0, block_size); jj_counter++; } @@ -5175,7 +5226,7 @@ hypre_BoomerAMGBuildBlockDirInterp( hypre_ParCSRBlockMatrix *A, P_diag_i[i] = jj_counter; jj_begin_row = jj_counter; - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) { i1 = S_diag_j[jj]; @@ -5190,7 +5241,7 @@ hypre_BoomerAMGBuildBlockDirInterp( hypre_ParCSRBlockMatrix *A, P_diag_j[jj_counter] = fine_to_coarse[i1]; /* P_diag_data[jj_counter] = zero; */ hypre_CSRBlockMatrixBlockCopyData(zero_block, - &P_diag_data[jj_counter*bnnz], + &P_diag_data[jj_counter * bnnz], 1.0, block_size); jj_counter++; } @@ -5205,7 +5256,7 @@ hypre_BoomerAMGBuildBlockDirInterp( hypre_ParCSRBlockMatrix *A, if (num_procs > 1) { - for (jj = S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) { i1 = S_offd_j[jj]; @@ -5220,7 +5271,7 @@ hypre_BoomerAMGBuildBlockDirInterp( hypre_ParCSRBlockMatrix *A, P_offd_j[jj_counter_offd] = i1; /* P_offd_data[jj_counter_offd] = zero; */ hypre_CSRBlockMatrixBlockCopyData(zero_block, - &P_offd_data[jj_counter_offd*bnnz], + &P_offd_data[jj_counter_offd * bnnz], 1.0, block_size); jj_counter_offd++; @@ -5246,7 +5297,7 @@ hypre_BoomerAMGBuildBlockDirInterp( hypre_ParCSRBlockMatrix *A, block_size); - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) { i1 = A_diag_j[jj]; @@ -5255,7 +5306,7 @@ hypre_BoomerAMGBuildBlockDirInterp( hypre_ParCSRBlockMatrix *A, else sum_N_neg += A_diag_data[jj];*/ - hypre_CSRBlockMatrixBlockAddAccumulate(&A_diag_data[jj*bnnz], + hypre_CSRBlockMatrixBlockAddAccumulate(&A_diag_data[jj * bnnz], sum_block_n, block_size); /*-------------------------------------------------------------- @@ -5268,7 +5319,7 @@ hypre_BoomerAMGBuildBlockDirInterp( hypre_ParCSRBlockMatrix *A, /* P_diag_data[P_marker[i1]] += A_diag_data[jj];*/ - hypre_CSRBlockMatrixBlockAddAccumulate(&A_diag_data[jj*bnnz], + hypre_CSRBlockMatrixBlockAddAccumulate(&A_diag_data[jj * bnnz], &P_diag_data[P_marker[i1]*bnnz], block_size); @@ -5277,7 +5328,7 @@ hypre_BoomerAMGBuildBlockDirInterp( hypre_ParCSRBlockMatrix *A, sum_P_pos += A_diag_data[jj]; else sum_P_neg += A_diag_data[jj];*/ - hypre_CSRBlockMatrixBlockAddAccumulate(&A_diag_data[jj*bnnz], + hypre_CSRBlockMatrixBlockAddAccumulate(&A_diag_data[jj * bnnz], sum_block_p, block_size); } @@ -5290,7 +5341,7 @@ hypre_BoomerAMGBuildBlockDirInterp( hypre_ParCSRBlockMatrix *A, if (num_procs > 1) { - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { i1 = A_offd_j[jj]; @@ -5298,7 +5349,7 @@ hypre_BoomerAMGBuildBlockDirInterp( hypre_ParCSRBlockMatrix *A, sum_N_pos += A_offd_data[jj]; else sum_N_neg += A_offd_data[jj];*/ - hypre_CSRBlockMatrixBlockAddAccumulate(&A_offd_data[jj*bnnz], + hypre_CSRBlockMatrixBlockAddAccumulate(&A_offd_data[jj * bnnz], sum_block_n, block_size); /*-------------------------------------------------------------- @@ -5309,14 +5360,14 @@ hypre_BoomerAMGBuildBlockDirInterp( hypre_ParCSRBlockMatrix *A, if (P_marker_offd[i1] >= jj_begin_row_offd) { /* P_offd_data[P_marker_offd[i1]] += A_offd_data[jj];*/ - hypre_CSRBlockMatrixBlockAddAccumulate( &A_offd_data[jj*bnnz], + hypre_CSRBlockMatrixBlockAddAccumulate( &A_offd_data[jj * bnnz], &P_offd_data[P_marker_offd[i1]*bnnz], block_size); /*if (A_offd_data[jj] > 0) sum_P_pos += A_offd_data[jj]; else sum_P_neg += A_offd_data[jj];*/ - hypre_CSRBlockMatrixBlockAddAccumulate(&A_offd_data[jj*bnnz], + hypre_CSRBlockMatrixBlockAddAccumulate(&A_offd_data[jj * bnnz], sum_block_p, block_size); } @@ -5346,12 +5397,12 @@ hypre_BoomerAMGBuildBlockDirInterp( hypre_ParCSRBlockMatrix *A, else P_diag_data[jj] *= -alfa;*/ - hypre_CSRBlockMatrixBlockCopyData( &P_diag_data[jj*bnnz], + hypre_CSRBlockMatrixBlockCopyData( &P_diag_data[jj * bnnz], r_block, -1.0, block_size); hypre_CSRBlockMatrixBlockMultAdd(sum_block_n, r_block, 0.0, - &P_diag_data[jj*bnnz], block_size); + &P_diag_data[jj * bnnz], block_size); } for (jj = jj_begin_row_offd; jj < jj_end_row_offd; jj++) @@ -5361,22 +5412,22 @@ hypre_BoomerAMGBuildBlockDirInterp( hypre_ParCSRBlockMatrix *A, else P_offd_data[jj] *= -alfa;*/ - hypre_CSRBlockMatrixBlockCopyData( &P_offd_data[jj*bnnz], + hypre_CSRBlockMatrixBlockCopyData( &P_offd_data[jj * bnnz], r_block, -1.0, block_size); hypre_CSRBlockMatrixBlockMultAdd(sum_block_n, r_block, 0.0, - &P_offd_data[jj*bnnz], block_size); + &P_offd_data[jj * bnnz], block_size); } } - P_offd_i[i+1] = jj_counter_offd; + P_offd_i[i + 1] = jj_counter_offd; } hypre_TFree(P_marker, HYPRE_MEMORY_HOST); hypre_TFree(P_marker_offd, HYPRE_MEMORY_HOST); } /* Now create P - as a block matrix */ - P = hypre_ParCSRBlockMatrixCreate(comm,block_size, + P = hypre_ParCSRBlockMatrixCreate(comm, block_size, hypre_ParCSRBlockMatrixGlobalNumRows(A), total_global_cpts, hypre_ParCSRBlockMatrixColStarts(A), @@ -5415,11 +5466,13 @@ hypre_BoomerAMGBuildBlockDirInterp( hypre_ParCSRBlockMatrix *A, { P_marker = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); - for (i=0; i < num_cols_A_offd; i++) + for (i = 0; i < num_cols_A_offd; i++) + { P_marker[i] = 0; + } num_cols_P_offd = 0; - for (i=0; i < P_offd_size; i++) + for (i = 0; i < P_offd_size; i++) { index = P_offd_j[i]; if (!P_marker[index]) @@ -5433,21 +5486,21 @@ hypre_BoomerAMGBuildBlockDirInterp( hypre_ParCSRBlockMatrix *A, tmp_map_offd = hypre_CTAlloc(HYPRE_Int, num_cols_P_offd, HYPRE_MEMORY_HOST); index = 0; - for (i=0; i < num_cols_P_offd; i++) + for (i = 0; i < num_cols_P_offd; i++) { - while (P_marker[index]==0) index++; + while (P_marker[index] == 0) { index++; } tmp_map_offd[i] = index++; } - for (i=0; i < P_offd_size; i++) + for (i = 0; i < P_offd_size; i++) P_offd_j[i] = hypre_BinarySearch(tmp_map_offd, P_offd_j[i], num_cols_P_offd); hypre_TFree(P_marker, HYPRE_MEMORY_HOST); } - for (i=0; i < n_fine; i++) - if (CF_marker[i] == -3) CF_marker[i] = -1; + for (i = 0; i < n_fine; i++) + if (CF_marker[i] == -3) { CF_marker[i] = -1; } if (num_cols_P_offd) { @@ -5455,7 +5508,7 @@ hypre_BoomerAMGBuildBlockDirInterp( hypre_ParCSRBlockMatrix *A, hypre_CSRBlockMatrixNumCols(P_offd) = num_cols_P_offd; } - hypre_GetCommPkgBlockRTFromCommPkgBlockA(P,A,tmp_map_offd,fine_to_coarse_offd); + hypre_GetCommPkgBlockRTFromCommPkgBlockA(P, A, tmp_map_offd, fine_to_coarse_offd); *P_ptr = P; @@ -5478,7 +5531,7 @@ hypre_BoomerAMGBuildBlockDirInterp( hypre_ParCSRBlockMatrix *A, hypre_TFree(jj_count, HYPRE_MEMORY_HOST); hypre_TFree(jj_count_offd, HYPRE_MEMORY_HOST); - return(0); + return (0); } @@ -5616,19 +5669,19 @@ hypre_BoomerAMGBuildBlockStdInterp(hypre_ParCSRBlockMatrix *A, HYPRE_Real *distribute_block; HYPRE_Int block_size = hypre_CSRBlockMatrixBlockSize(A_diag); - HYPRE_Int bnnz = block_size*block_size; + HYPRE_Int bnnz = block_size * block_size; - if (debug_flag== 4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } /* BEGIN */ hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_rank(comm, &my_id); my_first_cpt = num_cpts_global[0]; - if (my_id == (num_procs -1)) total_global_cpts = num_cpts_global[1]; - hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_INT, num_procs-1, comm); + if (my_id == (num_procs - 1)) { total_global_cpts = num_cpts_global[1]; } + hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_INT, num_procs - 1, comm); if (!comm_pkg) { @@ -5646,16 +5699,16 @@ hypre_BoomerAMGBuildBlockStdInterp(hypre_ParCSRBlockMatrix *A, * Get the off processors rows for A and S, associated with columns in * A_offd and S_offd. *---------------------------------------------------------------------*/ - A_ext = hypre_ParCSRBlockMatrixExtractBExt(A,A,1); + A_ext = hypre_ParCSRBlockMatrixExtractBExt(A, A, 1); A_ext_i = hypre_CSRBlockMatrixI(A_ext); A_ext_j = hypre_CSRBlockMatrixJ(A_ext); A_ext_data = hypre_CSRBlockMatrixData(A_ext); A_ext_rows = hypre_CSRBlockMatrixNumRows(A_ext); -/* FIX THIS! - Sop - block or ???*/ + /* FIX THIS! - Sop - block or ???*/ - Sop = hypre_ParCSRMatrixExtractBExt(S,A,0); + Sop = hypre_ParCSRMatrixExtractBExt(S, A, 0); Sop_i = hypre_CSRMatrixI(Sop); Sop_j = hypre_CSRMatrixJ(Sop); Soprows = hypre_CSRMatrixNumRows(Sop); @@ -5664,10 +5717,14 @@ hypre_BoomerAMGBuildBlockStdInterp(hypre_ParCSRBlockMatrix *A, newoff = new_offd_nodes(&found, A_ext_rows, A_ext_i, A_ext_j, Soprows, col_map_offd, col_1, col_n, Sop_i, Sop_j, CF_marker, comm_pkg); - if(newoff >= 0) + if (newoff >= 0) + { full_off_procNodes = newoff + num_cols_A_offd; + } else - return(1); + { + return (1); + } /* Possibly add new points and new processors to the comm_pkg, all * processors need new_comm_pkg */ @@ -5675,24 +5732,27 @@ hypre_BoomerAMGBuildBlockStdInterp(hypre_ParCSRBlockMatrix *A, /* AHB - create a new comm package just for extended info - this will work better with the assumed partition*/ -/* FIX THIS: Block version of this? */ + /* FIX THIS: Block version of this? */ hypre_ParCSRFindExtendCommPkg(A, newoff, found, &extend_comm_pkg); CF_marker_offd = hypre_CTAlloc(HYPRE_Int, full_off_procNodes, HYPRE_MEMORY_HOST); if (num_functions > 1 && full_off_procNodes > 0) + { dof_func_offd = hypre_CTAlloc(HYPRE_Int, full_off_procNodes, HYPRE_MEMORY_HOST); + } alt_insert_new_nodes(comm_pkg, extend_comm_pkg, CF_marker, full_off_procNodes, CF_marker_offd); - if(num_functions > 1) + if (num_functions > 1) + { alt_insert_new_nodes(comm_pkg, extend_comm_pkg, dof_func, full_off_procNodes, dof_func_offd); + } } - /*----------------------------------------------------------------------- * First Pass: Determine size of P and fill in fine_to_coarse mapping. *-----------------------------------------------------------------------*/ @@ -5700,15 +5760,15 @@ hypre_BoomerAMGBuildBlockStdInterp(hypre_ParCSRBlockMatrix *A, /*----------------------------------------------------------------------- * Intialize counters and allocate mapping vector. *-----------------------------------------------------------------------*/ - P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, HYPRE_MEMORY_HOST); - P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, HYPRE_MEMORY_HOST); + P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, HYPRE_MEMORY_HOST); + P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, HYPRE_MEMORY_HOST); fine_to_coarse = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); P_marker = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); -/* FIX THIS - figure out sizes - need bnnz? */ + /* FIX THIS - figure out sizes - need bnnz? */ if (full_off_procNodes) { P_marker_offd = hypre_CTAlloc(HYPRE_Int, full_off_procNodes, HYPRE_MEMORY_HOST); @@ -5726,17 +5786,15 @@ hypre_BoomerAMGBuildBlockStdInterp(hypre_ParCSRBlockMatrix *A, identity_block = hypre_CTAlloc(HYPRE_Real, bnnz, HYPRE_MEMORY_HOST); zero_block = hypre_CTAlloc(HYPRE_Real, bnnz, HYPRE_MEMORY_HOST); - for(i = 0; i < block_size; i++) + for (i = 0; i < block_size; i++) { - identity_block[i*block_size + i] = 1.0; + identity_block[i * block_size + i] = 1.0; } /* we also need a block to keep track of the diagonal values and a sum */ diagonal_block = hypre_CTAlloc(HYPRE_Real, bnnz, HYPRE_MEMORY_HOST); sum_block = hypre_CTAlloc(HYPRE_Real, bnnz, HYPRE_MEMORY_HOST); distribute_block = hypre_CTAlloc(HYPRE_Real, bnnz, HYPRE_MEMORY_HOST); - - jj_counter = start_indexing; jj_counter_offd = start_indexing; coarse_counter = 0; @@ -5749,7 +5807,9 @@ hypre_BoomerAMGBuildBlockStdInterp(hypre_ParCSRBlockMatrix *A, { P_diag_i[i] = jj_counter; if (num_procs > 1) + { P_offd_i[i] = jj_counter_offd; + } if (CF_marker[i] >= 0) { @@ -5765,11 +5825,12 @@ hypre_BoomerAMGBuildBlockStdInterp(hypre_ParCSRBlockMatrix *A, *--------------------------------------------------------------------*/ else if (CF_marker[i] != -3) { - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) { i1 = S_diag_j[jj]; if (CF_marker[i1] >= 0) - { /* i1 is a C point */ + { + /* i1 is a C point */ if (P_marker[i1] < P_diag_i[i]) { P_marker[i1] = jj_counter; @@ -5777,27 +5838,28 @@ hypre_BoomerAMGBuildBlockStdInterp(hypre_ParCSRBlockMatrix *A, } } else if (CF_marker[i1] != -3) - { /* i1 is a F point, loop through it's strong neighbors */ - for (kk = S_diag_i[i1]; kk < S_diag_i[i1+1]; kk++) + { + /* i1 is a F point, loop through it's strong neighbors */ + for (kk = S_diag_i[i1]; kk < S_diag_i[i1 + 1]; kk++) { k1 = S_diag_j[kk]; if (CF_marker[k1] >= 0) { - if(P_marker[k1] < P_diag_i[i]) + if (P_marker[k1] < P_diag_i[i]) { P_marker[k1] = jj_counter; jj_counter++; } } } - if(num_procs > 1) + if (num_procs > 1) { - for (kk = S_offd_i[i1]; kk < S_offd_i[i1+1]; kk++) + for (kk = S_offd_i[i1]; kk < S_offd_i[i1 + 1]; kk++) { k1 = S_offd_j[kk]; if (CF_marker_offd[k1] >= 0) { - if(P_marker_offd[k1] < P_offd_i[i]) + if (P_marker_offd[k1] < P_offd_i[i]) { tmp_CF_marker_offd[k1] = 1; P_marker_offd[k1] = jj_counter_offd; @@ -5811,12 +5873,12 @@ hypre_BoomerAMGBuildBlockStdInterp(hypre_ParCSRBlockMatrix *A, /* Look at off diag strong connections of i */ if (num_procs > 1) { - for (jj = S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) { i1 = S_offd_j[jj]; if (CF_marker_offd[i1] >= 0) { - if(P_marker_offd[i1] < P_offd_i[i]) + if (P_marker_offd[i1] < P_offd_i[i]) { tmp_CF_marker_offd[i1] = 1; P_marker_offd[i1] = jj_counter_offd; @@ -5824,18 +5886,20 @@ hypre_BoomerAMGBuildBlockStdInterp(hypre_ParCSRBlockMatrix *A, } } else if (CF_marker_offd[i1] != -3) - { /* F point; look at neighbors of i1. Sop contains global col - * numbers and entries that could be in S_diag or S_offd or - * neither. */ - for(kk = Sop_i[i1]; kk < Sop_i[i1+1]; kk++) + { + /* F point; look at neighbors of i1. Sop contains global col + * numbers and entries that could be in S_diag or S_offd or + * neither. */ + for (kk = Sop_i[i1]; kk < Sop_i[i1 + 1]; kk++) { k1 = Sop_j[kk]; - if(k1 >= col_1 && k1 < col_n) - { /* In S_diag */ - loc_col = k1-col_1; - if(CF_marker[loc_col] >= 0) + if (k1 >= col_1 && k1 < col_n) + { + /* In S_diag */ + loc_col = k1 - col_1; + if (CF_marker[loc_col] >= 0) { - if(P_marker[loc_col] < P_diag_i[i]) + if (P_marker[loc_col] < P_diag_i[i]) { P_marker[loc_col] = jj_counter; jj_counter++; @@ -5845,9 +5909,9 @@ hypre_BoomerAMGBuildBlockStdInterp(hypre_ParCSRBlockMatrix *A, else { loc_col = -k1 - 1; - if(CF_marker_offd[loc_col] >= 0) + if (CF_marker_offd[loc_col] >= 0) { - if(P_marker_offd[loc_col] < P_offd_i[i]) + if (P_marker_offd[loc_col] < P_offd_i[i]) { P_marker_offd[loc_col] = jj_counter_offd; tmp_CF_marker_offd[loc_col] = 1; @@ -5862,7 +5926,7 @@ hypre_BoomerAMGBuildBlockStdInterp(hypre_ParCSRBlockMatrix *A, } } - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d determine structure %f\n", @@ -5879,11 +5943,11 @@ hypre_BoomerAMGBuildBlockStdInterp(hypre_ParCSRBlockMatrix *A, P_diag_j = hypre_CTAlloc(HYPRE_Int, P_diag_size, HYPRE_MEMORY_HOST); /* we need to include the size of the blocks in the data size */ - P_diag_data = hypre_CTAlloc(HYPRE_Real, P_diag_size, HYPRE_MEMORY_HOST)*bnnz; + P_diag_data = hypre_CTAlloc(HYPRE_Real, P_diag_size, HYPRE_MEMORY_HOST) * bnnz; P_offd_j = hypre_CTAlloc(HYPRE_Int, P_offd_size, HYPRE_MEMORY_HOST); /* we need to include the size of the blocks in the data size */ - P_offd_data = hypre_CTAlloc(HYPRE_Real, P_offd_size*bnnz, HYPRE_MEMORY_HOST); + P_offd_data = hypre_CTAlloc(HYPRE_Real, P_offd_size * bnnz, HYPRE_MEMORY_HOST); P_diag_i[n_fine] = jj_counter; P_offd_i[n_fine] = jj_counter_offd; @@ -5892,29 +5956,34 @@ hypre_BoomerAMGBuildBlockStdInterp(hypre_ParCSRBlockMatrix *A, jj_counter_offd = start_indexing; /* Fine to coarse mapping */ - if(num_procs > 1) + if (num_procs > 1) { for (i = 0; i < n_fine; i++) + { fine_to_coarse[i] += my_first_cpt; + } alt_insert_new_nodes(comm_pkg, extend_comm_pkg, fine_to_coarse, full_off_procNodes, fine_to_coarse_offd); for (i = 0; i < n_fine; i++) + { fine_to_coarse[i] -= my_first_cpt; + } } /* Initialize ahat, which is a modification to a, used in the standard * interpolation routine. */ - ahat = hypre_CTAlloc(HYPRE_Real, n_fine*bnnz, HYPRE_MEMORY_HOST); /* this is data array */ + ahat = hypre_CTAlloc(HYPRE_Real, n_fine * bnnz, HYPRE_MEMORY_HOST); /* this is data array */ ihat = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); ipnt = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); if (full_off_procNodes) { - ahat_offd = hypre_CTAlloc(HYPRE_Real, full_off_procNodes*bnnz, HYPRE_MEMORY_HOST); /* this is data array */ + ahat_offd = hypre_CTAlloc(HYPRE_Real, full_off_procNodes * bnnz, + HYPRE_MEMORY_HOST); /* this is data array */ ihat_offd = hypre_CTAlloc(HYPRE_Int, full_off_procNodes, HYPRE_MEMORY_HOST); ipnt_offd = hypre_CTAlloc(HYPRE_Int, full_off_procNodes, HYPRE_MEMORY_HOST); } @@ -5938,8 +6007,10 @@ hypre_BoomerAMGBuildBlockStdInterp(hypre_ParCSRBlockMatrix *A, for (i = 0; i < n_fine; i++) { jj_begin_row = jj_counter; - if(num_procs > 1) + if (num_procs > 1) + { jj_begin_row_offd = jj_counter_offd; + } /*-------------------------------------------------------------------- * If i is a c-point, interpolation is the identity. @@ -5952,7 +6023,7 @@ hypre_BoomerAMGBuildBlockStdInterp(hypre_ParCSRBlockMatrix *A, /* P_diag_data[jj_counter] = one; */ hypre_CSRBlockMatrixBlockCopyData(identity_block, - &P_diag_data[jj_counter*bnnz], + &P_diag_data[jj_counter * bnnz], 1.0, block_size); jj_counter++; @@ -5964,9 +6035,9 @@ hypre_BoomerAMGBuildBlockStdInterp(hypre_ParCSRBlockMatrix *A, else if (CF_marker[i] != -3) { - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } strong_f_marker--; - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) { i1 = S_diag_j[jj]; @@ -5983,7 +6054,7 @@ hypre_BoomerAMGBuildBlockStdInterp(hypre_ParCSRBlockMatrix *A, P_diag_j[jj_counter] = i1; /* P_diag_data[jj_counter] = zero; */ hypre_CSRBlockMatrixBlockCopyData(zero_block, - &P_diag_data[jj_counter*bnnz], + &P_diag_data[jj_counter * bnnz], 1.0, block_size); jj_counter++; @@ -5992,38 +6063,38 @@ hypre_BoomerAMGBuildBlockStdInterp(hypre_ParCSRBlockMatrix *A, else if (CF_marker[i1] != -3) { P_marker[i1] = strong_f_marker; - for (kk = S_diag_i[i1]; kk < S_diag_i[i1+1]; kk++) + for (kk = S_diag_i[i1]; kk < S_diag_i[i1 + 1]; kk++) { k1 = S_diag_j[kk]; if (CF_marker[k1] >= 0) { - if(P_marker[k1] < jj_begin_row) + if (P_marker[k1] < jj_begin_row) { P_marker[k1] = jj_counter; P_diag_j[jj_counter] = k1; /* P_diag_data[jj_counter] = zero; */ hypre_CSRBlockMatrixBlockCopyData(zero_block, - &P_diag_data[jj_counter*bnnz], + &P_diag_data[jj_counter * bnnz], 1.0, block_size); jj_counter++; } } } - if(num_procs > 1) + if (num_procs > 1) { - for (kk = S_offd_i[i1]; kk < S_offd_i[i1+1]; kk++) + for (kk = S_offd_i[i1]; kk < S_offd_i[i1 + 1]; kk++) { k1 = S_offd_j[kk]; - if(CF_marker_offd[k1] >= 0) + if (CF_marker_offd[k1] >= 0) { - if(P_marker_offd[k1] < jj_begin_row_offd) + if (P_marker_offd[k1] < jj_begin_row_offd) { P_marker_offd[k1] = jj_counter_offd; P_offd_j[jj_counter_offd] = k1; /* P_offd_data[jj_counter_offd] = zero; */ hypre_CSRBlockMatrixBlockCopyData(zero_block, - &P_offd_data[jj_counter_offd*bnnz], + &P_offd_data[jj_counter_offd * bnnz], 1.0, block_size); jj_counter_offd++; @@ -6036,18 +6107,18 @@ hypre_BoomerAMGBuildBlockStdInterp(hypre_ParCSRBlockMatrix *A, if ( num_procs > 1) { - for (jj=S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) { i1 = S_offd_j[jj]; if ( CF_marker_offd[i1] >= 0) { - if(P_marker_offd[i1] < jj_begin_row_offd) + if (P_marker_offd[i1] < jj_begin_row_offd) { P_marker_offd[i1] = jj_counter_offd; - P_offd_j[jj_counter_offd]=i1; + P_offd_j[jj_counter_offd] = i1; /* P_offd_data[jj_counter_offd] = zero;*/ hypre_CSRBlockMatrixBlockCopyData(zero_block, - &P_offd_data[jj_counter_offd*bnnz], + &P_offd_data[jj_counter_offd * bnnz], 1.0, block_size); jj_counter_offd++; @@ -6056,21 +6127,21 @@ hypre_BoomerAMGBuildBlockStdInterp(hypre_ParCSRBlockMatrix *A, else if (CF_marker_offd[i1] != -3) { P_marker_offd[i1] = strong_f_marker; - for(kk = Sop_i[i1]; kk < Sop_i[i1+1]; kk++) + for (kk = Sop_i[i1]; kk < Sop_i[i1 + 1]; kk++) { k1 = Sop_j[kk]; - if(k1 >= col_1 && k1 < col_n) + if (k1 >= col_1 && k1 < col_n) { - loc_col = k1-col_1; - if(CF_marker[loc_col] >= 0) + loc_col = k1 - col_1; + if (CF_marker[loc_col] >= 0) { - if(P_marker[loc_col] < jj_begin_row) + if (P_marker[loc_col] < jj_begin_row) { P_marker[loc_col] = jj_counter; P_diag_j[jj_counter] = loc_col; /* P_diag_data[jj_counter] = zero;*/ hypre_CSRBlockMatrixBlockCopyData(zero_block, - &P_diag_data[jj_counter*bnnz], + &P_diag_data[jj_counter * bnnz], 1.0, block_size); jj_counter++; } @@ -6079,15 +6150,15 @@ hypre_BoomerAMGBuildBlockStdInterp(hypre_ParCSRBlockMatrix *A, else { loc_col = -k1 - 1; - if(CF_marker_offd[loc_col] >= 0) + if (CF_marker_offd[loc_col] >= 0) { - if(P_marker_offd[loc_col] < jj_begin_row_offd) + if (P_marker_offd[loc_col] < jj_begin_row_offd) { P_marker_offd[loc_col] = jj_counter_offd; - P_offd_j[jj_counter_offd]=loc_col; + P_offd_j[jj_counter_offd] = loc_col; /* P_offd_data[jj_counter_offd] = zero;*/ hypre_CSRBlockMatrixBlockCopyData(zero_block, - &P_offd_data[jj_counter_offd*bnnz], + &P_offd_data[jj_counter_offd * bnnz], 1.0, block_size); jj_counter_offd++; } @@ -6101,31 +6172,34 @@ hypre_BoomerAMGBuildBlockStdInterp(hypre_ParCSRBlockMatrix *A, jj_end_row = jj_counter; jj_end_row_offd = jj_counter_offd; - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; wall_1 += wall_time; fflush(NULL); } -/* FIX THIS - is a_hat - need to copy block data to ahat */ + /* FIX THIS - is a_hat - need to copy block data to ahat */ - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } cnt_c = 0; - cnt_f = jj_end_row-jj_begin_row; + cnt_f = jj_end_row - jj_begin_row; cnt_c_offd = 0; - cnt_f_offd = jj_end_row_offd-jj_begin_row_offd; + cnt_f_offd = jj_end_row_offd - jj_begin_row_offd; ihat[i] = cnt_f; ipnt[cnt_f] = i; ahat[cnt_f++] = A_diag_data[A_diag_i[i]]; - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) - { /* i1 is direct neighbor */ + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) + { + /* i1 is direct neighbor */ i1 = A_diag_j[jj]; if (P_marker[i1] != strong_f_marker) { indx = ihat[i1]; if (indx > -1) + { ahat[indx] += A_diag_data[jj]; + } else if (P_marker[i1] >= jj_begin_row) { ihat[i1] = cnt_c; @@ -6141,49 +6215,53 @@ hypre_BoomerAMGBuildBlockStdInterp(hypre_ParCSRBlockMatrix *A, } else { - if(num_functions == 1 || dof_func[i] == dof_func[i1]) + if (num_functions == 1 || dof_func[i] == dof_func[i1]) { - distribute = A_diag_data[jj]/A_diag_data[A_diag_i[i1]]; - for (kk = A_diag_i[i1]+1; kk < A_diag_i[i1+1]; kk++) + distribute = A_diag_data[jj] / A_diag_data[A_diag_i[i1]]; + for (kk = A_diag_i[i1] + 1; kk < A_diag_i[i1 + 1]; kk++) { k1 = A_diag_j[kk]; indx = ihat[k1]; if (indx > -1) - ahat[indx] -= A_diag_data[kk]*distribute; + { + ahat[indx] -= A_diag_data[kk] * distribute; + } else if (P_marker[k1] >= jj_begin_row) { ihat[k1] = cnt_c; ipnt[cnt_c] = k1; - ahat[cnt_c++] -= A_diag_data[kk]*distribute; + ahat[cnt_c++] -= A_diag_data[kk] * distribute; } else { ihat[k1] = cnt_f; ipnt[cnt_f] = k1; - ahat[cnt_f++] -= A_diag_data[kk]*distribute; + ahat[cnt_f++] -= A_diag_data[kk] * distribute; } } - if(num_procs > 1) + if (num_procs > 1) { - for (kk = A_offd_i[i1]; kk < A_offd_i[i1+1]; kk++) + for (kk = A_offd_i[i1]; kk < A_offd_i[i1 + 1]; kk++) { k1 = A_offd_j[kk]; indx = ihat_offd[k1]; - if(num_functions == 1 || dof_func[i1] == dof_func_offd[k1]) + if (num_functions == 1 || dof_func[i1] == dof_func_offd[k1]) { if (indx > -1) - ahat_offd[indx] -= A_offd_data[kk]*distribute; + { + ahat_offd[indx] -= A_offd_data[kk] * distribute; + } else if (P_marker_offd[k1] >= jj_begin_row_offd) { ihat_offd[k1] = cnt_c_offd; ipnt_offd[cnt_c_offd] = k1; - ahat_offd[cnt_c_offd++] -= A_offd_data[kk]*distribute; + ahat_offd[cnt_c_offd++] -= A_offd_data[kk] * distribute; } else { ihat_offd[k1] = cnt_f_offd; ipnt_offd[cnt_f_offd] = k1; - ahat_offd[cnt_f_offd++] -= A_offd_data[kk]*distribute; + ahat_offd[cnt_f_offd++] -= A_offd_data[kk] * distribute; } } } @@ -6191,16 +6269,18 @@ hypre_BoomerAMGBuildBlockStdInterp(hypre_ParCSRBlockMatrix *A, } } } - if(num_procs > 1) + if (num_procs > 1) { - for(jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { i1 = A_offd_j[jj]; - if(P_marker_offd[i1] != strong_f_marker) + if (P_marker_offd[i1] != strong_f_marker) { indx = ihat_offd[i1]; if (indx > -1) + { ahat_offd[indx] += A_offd_data[jj]; + } else if (P_marker_offd[i1] >= jj_begin_row_offd) { ihat_offd[i1] = cnt_c_offd; @@ -6216,51 +6296,56 @@ hypre_BoomerAMGBuildBlockStdInterp(hypre_ParCSRBlockMatrix *A, } else { - if(num_functions == 1 || dof_func[i] == dof_func_offd[i1]) + if (num_functions == 1 || dof_func[i] == dof_func_offd[i1]) { - distribute = A_offd_data[jj]/A_ext_data[A_ext_i[i1]]; - for (kk = A_ext_i[i1]+1; kk < A_ext_i[i1+1]; kk++) + distribute = A_offd_data[jj] / A_ext_data[A_ext_i[i1]]; + for (kk = A_ext_i[i1] + 1; kk < A_ext_i[i1 + 1]; kk++) { k1 = A_ext_j[kk]; - if(k1 >= col_1 && k1 < col_n) - { /*diag*/ + if (k1 >= col_1 && k1 < col_n) + { + /*diag*/ loc_col = k1 - col_1; indx = ihat[loc_col]; if (indx > -1) - ahat[indx] -= A_ext_data[kk]*distribute; + { + ahat[indx] -= A_ext_data[kk] * distribute; + } else if (P_marker[loc_col] >= jj_begin_row) { ihat[loc_col] = cnt_c; ipnt[cnt_c] = loc_col; - ahat[cnt_c++] -= A_ext_data[kk]*distribute; + ahat[cnt_c++] -= A_ext_data[kk] * distribute; } else { ihat[loc_col] = cnt_f; ipnt[cnt_f] = loc_col; - ahat[cnt_f++] -= A_ext_data[kk]*distribute; + ahat[cnt_f++] -= A_ext_data[kk] * distribute; } } else { loc_col = -k1 - 1; - if(num_functions == 1 || - dof_func_offd[loc_col] == dof_func_offd[i1]) + if (num_functions == 1 || + dof_func_offd[loc_col] == dof_func_offd[i1]) { indx = ihat_offd[loc_col]; if (indx > -1) - ahat_offd[indx] -= A_ext_data[kk]*distribute; - else if(P_marker_offd[loc_col] >= jj_begin_row_offd) + { + ahat_offd[indx] -= A_ext_data[kk] * distribute; + } + else if (P_marker_offd[loc_col] >= jj_begin_row_offd) { ihat_offd[loc_col] = cnt_c_offd; ipnt_offd[cnt_c_offd] = loc_col; - ahat_offd[cnt_c_offd++] -= A_ext_data[kk]*distribute; + ahat_offd[cnt_c_offd++] -= A_ext_data[kk] * distribute; } else { ihat_offd[loc_col] = cnt_f_offd; ipnt_offd[cnt_f_offd] = loc_col; - ahat_offd[cnt_f_offd++] -= A_ext_data[kk]*distribute; + ahat_offd[cnt_f_offd++] -= A_ext_data[kk] * distribute; } } } @@ -6269,14 +6354,14 @@ hypre_BoomerAMGBuildBlockStdInterp(hypre_ParCSRBlockMatrix *A, } } } - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; wall_2 += wall_time; fflush(NULL); } - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } diagonal = ahat[cnt_c]; ahat[cnt_c] = 0; sum_pos = 0; @@ -6285,9 +6370,9 @@ hypre_BoomerAMGBuildBlockStdInterp(hypre_ParCSRBlockMatrix *A, sum_neg_C = 0; sum = 0; sum_C = 0; - if(sep_weight == 1) + if (sep_weight == 1) { - for (jj=0; jj < cnt_c; jj++) + for (jj = 0; jj < cnt_c; jj++) { if (ahat[jj] > 0) { @@ -6298,9 +6383,9 @@ hypre_BoomerAMGBuildBlockStdInterp(hypre_ParCSRBlockMatrix *A, sum_neg_C += ahat[jj]; } } - if(num_procs > 1) + if (num_procs > 1) { - for (jj=0; jj < cnt_c_offd; jj++) + for (jj = 0; jj < cnt_c_offd; jj++) { if (ahat_offd[jj] > 0) { @@ -6314,7 +6399,7 @@ hypre_BoomerAMGBuildBlockStdInterp(hypre_ParCSRBlockMatrix *A, } sum_pos = sum_pos_C; sum_neg = sum_neg_C; - for (jj=cnt_c+1; jj < cnt_f; jj++) + for (jj = cnt_c + 1; jj < cnt_f; jj++) { if (ahat[jj] > 0) { @@ -6326,9 +6411,9 @@ hypre_BoomerAMGBuildBlockStdInterp(hypre_ParCSRBlockMatrix *A, } ahat[jj] = 0; } - if(num_procs > 1) + if (num_procs > 1) { - for (jj=cnt_c_offd; jj < cnt_f_offd; jj++) + for (jj = cnt_c_offd; jj < cnt_f_offd; jj++) { if (ahat_offd[jj] > 0) { @@ -6341,8 +6426,8 @@ hypre_BoomerAMGBuildBlockStdInterp(hypre_ParCSRBlockMatrix *A, ahat_offd[jj] = 0; } } - if (sum_neg_C) alfa = sum_neg/sum_neg_C/diagonal; - if (sum_pos_C) beta = sum_pos/sum_pos_C/diagonal; + if (sum_neg_C) { alfa = sum_neg / sum_neg_C / diagonal; } + if (sum_pos_C) { beta = sum_pos / sum_pos_C / diagonal; } /*----------------------------------------------------------------- * Set interpolation weight by dividing by the diagonal. @@ -6352,59 +6437,71 @@ hypre_BoomerAMGBuildBlockStdInterp(hypre_ParCSRBlockMatrix *A, { j1 = ihat[P_diag_j[jj]]; if (ahat[j1] > 0) - P_diag_data[jj] = -beta*ahat[j1]; + { + P_diag_data[jj] = -beta * ahat[j1]; + } else - P_diag_data[jj] = -alfa*ahat[j1]; + { + P_diag_data[jj] = -alfa * ahat[j1]; + } P_diag_j[jj] = fine_to_coarse[P_diag_j[jj]]; ahat[j1] = 0; } - for (jj=0; jj < cnt_f; jj++) + for (jj = 0; jj < cnt_f; jj++) + { ihat[ipnt[jj]] = -1; - if(num_procs > 1) + } + if (num_procs > 1) { for (jj = jj_begin_row_offd; jj < jj_end_row_offd; jj++) { j1 = ihat_offd[P_offd_j[jj]]; if (ahat_offd[j1] > 0) - P_offd_data[jj] = -beta*ahat_offd[j1]; + { + P_offd_data[jj] = -beta * ahat_offd[j1]; + } else - P_offd_data[jj] = -alfa*ahat_offd[j1]; + { + P_offd_data[jj] = -alfa * ahat_offd[j1]; + } ahat_offd[j1] = 0; } - for (jj=0; jj < cnt_f_offd; jj++) + for (jj = 0; jj < cnt_f_offd; jj++) + { ihat_offd[ipnt_offd[jj]] = -1; + } } } else { - for (jj=0; jj < cnt_c; jj++) + for (jj = 0; jj < cnt_c; jj++) { sum_C += ahat[jj]; } - if(num_procs > 1) + if (num_procs > 1) { - for (jj=0; jj < cnt_c_offd; jj++) + for (jj = 0; jj < cnt_c_offd; jj++) { sum_C += ahat_offd[jj]; } } sum = sum_C; - for (jj=cnt_c+1; jj < cnt_f; jj++) + for (jj = cnt_c + 1; jj < cnt_f; jj++) { sum += ahat[jj]; ahat[jj] = 0; } - if(num_procs > 1) + if (num_procs > 1) { - for (jj=cnt_c_offd; jj < cnt_f_offd; jj++) + for (jj = cnt_c_offd; jj < cnt_f_offd; jj++) { sum += ahat_offd[jj]; ahat_offd[jj] = 0; } } - if (sum_C) alfa = sum/sum_C/diagonal; + if (sum_C) { alfa = sum / sum_C / diagonal; } /*----------------------------------------------------------------- * Set interpolation weight by dividing by the diagonal. @@ -6413,25 +6510,29 @@ hypre_BoomerAMGBuildBlockStdInterp(hypre_ParCSRBlockMatrix *A, for (jj = jj_begin_row; jj < jj_end_row; jj++) { j1 = ihat[P_diag_j[jj]]; - P_diag_data[jj] = -alfa*ahat[j1]; + P_diag_data[jj] = -alfa * ahat[j1]; P_diag_j[jj] = fine_to_coarse[P_diag_j[jj]]; ahat[j1] = 0; } - for (jj=0; jj < cnt_f; jj++) + for (jj = 0; jj < cnt_f; jj++) + { ihat[ipnt[jj]] = -1; - if(num_procs > 1) + } + if (num_procs > 1) { for (jj = jj_begin_row_offd; jj < jj_end_row_offd; jj++) { j1 = ihat_offd[P_offd_j[jj]]; - P_offd_data[jj] = -alfa*ahat_offd[j1]; + P_offd_data[jj] = -alfa * ahat_offd[j1]; ahat_offd[j1] = 0; } - for (jj=0; jj < cnt_f_offd; jj++) + for (jj = 0; jj < cnt_f_offd; jj++) + { ihat_offd[ipnt_offd[jj]] = -1; + } } } - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; wall_3 += wall_time; @@ -6440,7 +6541,7 @@ hypre_BoomerAMGBuildBlockStdInterp(hypre_ParCSRBlockMatrix *A, } } - if (debug_flag==4) + if (debug_flag == 4) { hypre_printf("Proc = %d fill part 1 %f part 2 %f part 3 %f\n", my_id, wall_1, wall_2, wall_3); @@ -6481,21 +6582,23 @@ hypre_BoomerAMGBuildBlockStdInterp(hypre_ParCSRBlockMatrix *A, /* This builds col_map, col_map should be monotone increasing and contain * global numbers. */ num_cols_P_offd = 0; - if(P_offd_size) + if (P_offd_size) { hypre_TFree(P_marker, HYPRE_MEMORY_HOST); P_marker = hypre_CTAlloc(HYPRE_Int, full_off_procNodes, HYPRE_MEMORY_HOST); - for (i=0; i < full_off_procNodes; i++) + for (i = 0; i < full_off_procNodes; i++) + { P_marker[i] = 0; + } num_cols_P_offd = 0; - for (i=0; i < P_offd_size; i++) + for (i = 0; i < P_offd_size; i++) { index = P_offd_j[i]; if (!P_marker[index]) { - if(tmp_CF_marker_offd[index] >= 0) + if (tmp_CF_marker_offd[index] >= 0) { num_cols_P_offd++; P_marker[index] = 1; @@ -6506,35 +6609,37 @@ hypre_BoomerAMGBuildBlockStdInterp(hypre_ParCSRBlockMatrix *A, col_map_offd_P = hypre_CTAlloc(HYPRE_Int, num_cols_P_offd, HYPRE_MEMORY_HOST); index = 0; - for(i = 0; i < num_cols_P_offd; i++) + for (i = 0; i < num_cols_P_offd; i++) { - while( P_marker[index] == 0) index++; + while ( P_marker[index] == 0) { index++; } col_map_offd_P[i] = index++; } - for(i = 0; i < P_offd_size; i++) + for (i = 0; i < P_offd_size; i++) P_offd_j[i] = hypre_BinarySearch(col_map_offd_P, P_offd_j[i], num_cols_P_offd); index = 0; - for(i = 0; i < num_cols_P_offd; i++) + for (i = 0; i < num_cols_P_offd; i++) { - while (P_marker[index] == 0) index++; + while (P_marker[index] == 0) { index++; } col_map_offd_P[i] = fine_to_coarse_offd[index]; index++; } /* Sort the col_map_offd_P and P_offd_j correctly */ - for(i = 0; i < num_cols_P_offd; i++) + for (i = 0; i < num_cols_P_offd; i++) + { P_marker[i] = col_map_offd_P[i]; + } /* Check if sort actually changed anything */ - if(ssort(col_map_offd_P,num_cols_P_offd)) + if (ssort(col_map_offd_P, num_cols_P_offd)) { - for(i = 0; i < P_offd_size; i++) - for(j = 0; j < num_cols_P_offd; j++) - if(P_marker[P_offd_j[i]] == col_map_offd_P[j]) + for (i = 0; i < P_offd_size; i++) + for (j = 0; j < num_cols_P_offd; j++) + if (P_marker[P_offd_j[i]] == col_map_offd_P[j]) { P_offd_j[i] = j; j = num_cols_P_offd; @@ -6551,8 +6656,8 @@ hypre_BoomerAMGBuildBlockStdInterp(hypre_ParCSRBlockMatrix *A, hypre_MatvecCommPkgCreate(P); - for (i=0; i < n_fine; i++) - if (CF_marker[i] == -3) CF_marker[i] = -1; + for (i = 0; i < n_fine; i++) + if (CF_marker[i] == -3) { CF_marker[i] = -1; } *P_ptr = P; @@ -6578,8 +6683,10 @@ hypre_BoomerAMGBuildBlockStdInterp(hypre_ParCSRBlockMatrix *A, hypre_TFree(CF_marker_offd, HYPRE_MEMORY_HOST); hypre_TFree(tmp_CF_marker_offd, HYPRE_MEMORY_HOST); - if(num_functions > 1) + if (num_functions > 1) + { hypre_TFree(dof_func_offd, HYPRE_MEMORY_HOST); + } hypre_TFree(found, HYPRE_MEMORY_HOST); hypre_MatvecCommPkgDestroy(extend_comm_pkg); diff --git a/external/hypre/src/parcsr_block_mv/par_csr_block_matrix.c b/external/hypre/src/parcsr_block_mv/par_csr_block_matrix.c index 358529a5..8e2820f7 100644 --- a/external/hypre/src/parcsr_block_mv/par_csr_block_matrix.c +++ b/external/hypre/src/parcsr_block_mv/par_csr_block_matrix.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -66,9 +66,9 @@ hypre_ParCSRBlockMatrixCreate( MPI_Comm comm, /* row_starts[0] is start of local rows. row_starts[1] is start of next processor's rows */ first_row_index = row_starts[0]; - local_num_rows = (HYPRE_Int)(row_starts[1]-first_row_index) ; + local_num_rows = (HYPRE_Int)(row_starts[1] - first_row_index) ; first_col_diag = col_starts[0]; - local_num_cols = (HYPRE_Int)(col_starts[1]-first_col_diag); + local_num_cols = (HYPRE_Int)(col_starts[1] - first_col_diag); hypre_ParCSRBlockMatrixComm(matrix) = comm; hypre_ParCSRBlockMatrixDiag(matrix) = hypre_CSRBlockMatrixCreate(block_size, local_num_rows, @@ -114,15 +114,23 @@ hypre_ParCSRBlockMatrixDestroy( hypre_ParCSRBlockMatrix *matrix ) hypre_CSRBlockMatrixDestroy(hypre_ParCSRBlockMatrixDiag(matrix)); hypre_CSRBlockMatrixDestroy(hypre_ParCSRBlockMatrixOffd(matrix)); if (hypre_ParCSRBlockMatrixColMapOffd(matrix)) + { hypre_TFree(hypre_ParCSRBlockMatrixColMapOffd(matrix), HYPRE_MEMORY_HOST); + } if (hypre_ParCSRBlockMatrixCommPkg(matrix)) + { hypre_MatvecCommPkgDestroy(hypre_ParCSRBlockMatrixCommPkg(matrix)); + } if (hypre_ParCSRBlockMatrixCommPkgT(matrix)) + { hypre_MatvecCommPkgDestroy(hypre_ParCSRBlockMatrixCommPkgT(matrix)); + } } if (hypre_ParCSRBlockMatrixAssumedPartition(matrix)) + { hypre_ParCSRBlockMatrixDestroyAssumedPartition(matrix); + } hypre_TFree(matrix, HYPRE_MEMORY_HOST); } @@ -137,7 +145,7 @@ hypre_ParCSRBlockMatrixDestroy( hypre_ParCSRBlockMatrix *matrix ) HYPRE_Int hypre_ParCSRBlockMatrixInitialize( hypre_ParCSRBlockMatrix *matrix ) { - HYPRE_Int ierr=0; + HYPRE_Int ierr = 0; hypre_CSRBlockMatrixInitialize(hypre_ParCSRBlockMatrixDiag(matrix)); hypre_CSRBlockMatrixInitialize(hypre_ParCSRBlockMatrixOffd(matrix)); @@ -205,7 +213,7 @@ HYPRE_Int hypre_ParCSRBlockMatrixSetDataOwner( hypre_ParCSRBlockMatrix *matrix, HYPRE_Int owns_data ) { - HYPRE_Int ierr=0; + HYPRE_Int ierr = 0; hypre_ParCSRBlockMatrixOwnsData(matrix) = owns_data; @@ -235,7 +243,7 @@ hypre_ParCSRBlockMatrixCompress( hypre_ParCSRBlockMatrix *matrix ) HYPRE_Int i; matrix_C = hypre_ParCSRMatrixCreate(comm, global_num_rows, global_num_cols, - row_starts,col_starts,num_cols_offd,num_nonzeros_diag,num_nonzeros_offd); + row_starts, col_starts, num_cols_offd, num_nonzeros_diag, num_nonzeros_offd); hypre_ParCSRMatrixInitialize(matrix_C); hypre_CSRMatrixDestroy(hypre_ParCSRMatrixDiag(matrix_C)); @@ -243,7 +251,7 @@ hypre_ParCSRBlockMatrixCompress( hypre_ParCSRBlockMatrix *matrix ) hypre_CSRMatrixDestroy(hypre_ParCSRMatrixOffd(matrix_C)); hypre_ParCSRMatrixOffd(matrix_C) = hypre_CSRBlockMatrixCompress(offd); - for(i = 0; i < num_cols_offd; i++) + for (i = 0; i < num_cols_offd; i++) hypre_ParCSRMatrixColMapOffd(matrix_C)[i] = hypre_ParCSRBlockMatrixColMapOffd(matrix)[i]; return matrix_C; @@ -269,8 +277,8 @@ hypre_ParCSRBlockMatrixConvertToParCSRMatrix(hypre_ParCSRBlockMatrix *matrix) HYPRE_Int num_nonzeros_offd = hypre_CSRBlockMatrixNumNonzeros(offd); hypre_ParCSRMatrix *matrix_C; - HYPRE_BigInt *matrix_C_row_starts; - HYPRE_BigInt *matrix_C_col_starts; + HYPRE_BigInt matrix_C_row_starts[2]; + HYPRE_BigInt matrix_C_col_starts[2]; HYPRE_Int *counter, *new_j_map; HYPRE_Int size_j, size_map, index, new_num_cols, removed = 0; @@ -282,26 +290,22 @@ hypre_ParCSRBlockMatrixConvertToParCSRMatrix(hypre_ParCSRBlockMatrix *matrix) hypre_CSRMatrix *diag_nozeros, *offd_nozeros; - hypre_MPI_Comm_size(comm,&num_procs); + hypre_MPI_Comm_size(comm, &num_procs); - matrix_C_row_starts = hypre_CTAlloc(HYPRE_BigInt, 2, HYPRE_MEMORY_HOST); - matrix_C_col_starts = hypre_CTAlloc(HYPRE_BigInt, 2, HYPRE_MEMORY_HOST); - for(i = 0; i < 2; i++) + for (i = 0; i < 2; i++) { - matrix_C_row_starts[i] = row_starts[i]*(HYPRE_BigInt)block_size; - matrix_C_col_starts[i] = col_starts[i]*(HYPRE_BigInt)block_size; + matrix_C_row_starts[i] = row_starts[i] * (HYPRE_BigInt)block_size; + matrix_C_col_starts[i] = col_starts[i] * (HYPRE_BigInt)block_size; } - matrix_C = hypre_ParCSRMatrixCreate(comm, global_num_rows*(HYPRE_BigInt)block_size, - global_num_cols*(HYPRE_BigInt)block_size, + matrix_C = hypre_ParCSRMatrixCreate(comm, global_num_rows * (HYPRE_BigInt)block_size, + global_num_cols * (HYPRE_BigInt)block_size, matrix_C_row_starts, matrix_C_col_starts, - num_cols_offd*block_size, - num_nonzeros_diag*block_size*block_size, - num_nonzeros_offd*block_size*block_size); + num_cols_offd * block_size, + num_nonzeros_diag * block_size * block_size, + num_nonzeros_offd * block_size * block_size); hypre_ParCSRMatrixInitialize(matrix_C); - hypre_TFree(matrix_C_row_starts, HYPRE_MEMORY_HOST); - hypre_TFree(matrix_C_col_starts, HYPRE_MEMORY_HOST); /* DIAG */ hypre_CSRMatrixDestroy(hypre_ParCSRMatrixDiag(matrix_C)); @@ -310,8 +314,8 @@ hypre_ParCSRBlockMatrixConvertToParCSRMatrix(hypre_ParCSRBlockMatrix *matrix) /* AB - added to delete zeros */ diag_nozeros = hypre_CSRMatrixDeleteZeros( - hypre_ParCSRMatrixDiag(matrix_C), 1e-14); - if(diag_nozeros) + hypre_ParCSRMatrixDiag(matrix_C), 1e-14); + if (diag_nozeros) { hypre_CSRMatrixDestroy(hypre_ParCSRMatrixDiag(matrix_C)); hypre_ParCSRMatrixDiag(matrix_C) = diag_nozeros; @@ -324,8 +328,8 @@ hypre_ParCSRBlockMatrixConvertToParCSRMatrix(hypre_ParCSRBlockMatrix *matrix) /* AB - added to delete zeros - this just deletes from data and j arrays */ offd_nozeros = hypre_CSRMatrixDeleteZeros( - hypre_ParCSRMatrixOffd(matrix_C), 1e-14); - if(offd_nozeros) + hypre_ParCSRMatrixOffd(matrix_C), 1e-14); + if (offd_nozeros) { hypre_CSRMatrixDestroy(hypre_ParCSRMatrixOffd(matrix_C)); hypre_ParCSRMatrixOffd(matrix_C) = offd_nozeros; @@ -336,15 +340,15 @@ hypre_ParCSRBlockMatrixConvertToParCSRMatrix(hypre_ParCSRBlockMatrix *matrix) /* now convert the col_map_offd */ for (i = 0; i < num_cols_offd; i++) for (j = 0; j < block_size; j++) - hypre_ParCSRMatrixColMapOffd(matrix_C)[i*block_size + j] = - hypre_ParCSRBlockMatrixColMapOffd(matrix)[i]*(HYPRE_BigInt)block_size + (HYPRE_BigInt)j; + hypre_ParCSRMatrixColMapOffd(matrix_C)[i * block_size + j] = + hypre_ParCSRBlockMatrixColMapOffd(matrix)[i] * (HYPRE_BigInt)block_size + (HYPRE_BigInt)j; /* if we deleted zeros, then it is possible that col_map_offd can be compressed as well - this requires some amount of work that could be skipped... */ if (removed) { - size_map = num_cols_offd*block_size; + size_map = num_cols_offd * block_size; counter = hypre_CTAlloc(HYPRE_Int, size_map, HYPRE_MEMORY_HOST); new_j_map = hypre_CTAlloc(HYPRE_Int, size_map, HYPRE_MEMORY_HOST); @@ -353,30 +357,30 @@ hypre_ParCSRBlockMatrixConvertToParCSRMatrix(hypre_ParCSRBlockMatrix *matrix) size_j = hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixOffd(matrix_C)); /* mark which off_d entries are found in j */ - for (i=0; i < size_j; i++) + for (i = 0; i < size_j; i++) { counter[offd_j[i]] = 1; } /*now find new numbering for columns (we will delete the cols where counter = 0*/ index = 0; - for (i=0; i < size_map; i++) + for (i = 0; i < size_map; i++) { - if (counter[i]) new_j_map[i] = index++; + if (counter[i]) { new_j_map[i] = index++; } } new_num_cols = index; /* if there are some col entries to remove: */ if (!(index == size_map)) { /* go thru j and adjust entries */ - for (i=0; i < size_j; i++) + for (i = 0; i < size_j; i++) { offd_j[i] = new_j_map[offd_j[i]]; } /*now go thru col map and get rid of non-needed entries */ new_col_map_offd = hypre_CTAlloc(HYPRE_BigInt, new_num_cols, HYPRE_MEMORY_HOST); index = 0; - for (i=0; i < size_map; i++) + for (i = 0; i < size_map; i++) { if (counter[i]) { @@ -420,8 +424,8 @@ hypre_ParCSRBlockMatrixConvertFromParCSRMatrix(hypre_ParCSRMatrix *matrix, HYPRE_BigInt *col_starts = hypre_ParCSRMatrixColStarts(matrix); HYPRE_Int num_cols_offd = hypre_CSRMatrixNumCols(offd); HYPRE_BigInt *col_map_offd = hypre_ParCSRBlockMatrixColMapOffd(matrix); - HYPRE_BigInt *map_to_node=NULL; - HYPRE_Int *counter=NULL, *col_in_j_map=NULL; + HYPRE_BigInt *map_to_node = NULL; + HYPRE_Int *counter = NULL, *col_in_j_map = NULL; HYPRE_BigInt *matrix_C_col_map_offd = NULL; HYPRE_Int matrix_C_num_cols_offd; @@ -433,24 +437,22 @@ hypre_ParCSRBlockMatrixConvertFromParCSRMatrix(hypre_ParCSRMatrix *matrix, HYPRE_Complex * offd_data = hypre_CSRMatrixData(offd); hypre_ParCSRBlockMatrix *matrix_C; - HYPRE_BigInt *matrix_C_row_starts; - HYPRE_BigInt *matrix_C_col_starts; + HYPRE_BigInt matrix_C_row_starts[2]; + HYPRE_BigInt matrix_C_col_starts[2]; hypre_CSRBlockMatrix *matrix_C_diag; hypre_CSRBlockMatrix *matrix_C_offd; - HYPRE_Int *matrix_C_offd_i=NULL, *matrix_C_offd_j = NULL; + HYPRE_Int *matrix_C_offd_i = NULL, *matrix_C_offd_j = NULL; HYPRE_Complex *matrix_C_offd_data = NULL; HYPRE_Int num_procs, i, j, k, k_map, count, index, start_index, pos, row; - hypre_MPI_Comm_size(comm,&num_procs); + hypre_MPI_Comm_size(comm, &num_procs); - matrix_C_row_starts = hypre_CTAlloc(HYPRE_BigInt, 2, HYPRE_MEMORY_HOST); - matrix_C_col_starts = hypre_CTAlloc(HYPRE_BigInt, 2, HYPRE_MEMORY_HOST); - for(i = 0; i < 2; i++) + for (i = 0; i < 2; i++) { - matrix_C_row_starts[i] = row_starts[i]/(HYPRE_BigInt)matrix_C_block_size; - matrix_C_col_starts[i] = col_starts[i]/(HYPRE_BigInt)matrix_C_block_size; + matrix_C_row_starts[i] = row_starts[i] / (HYPRE_BigInt)matrix_C_block_size; + matrix_C_col_starts[i] = col_starts[i] / (HYPRE_BigInt)matrix_C_block_size; } /************* create the diagonal part ************/ @@ -466,7 +468,7 @@ hypre_ParCSRBlockMatrixConvertFromParCSRMatrix(hypre_ParCSRMatrix *matrix, /* figure out the new number of offd columns (num rows is same as diag) */ num_cols_offd = hypre_CSRMatrixNumCols(offd); num_rows = hypre_CSRMatrixNumRows(diag); - num_nodes = num_rows/matrix_C_block_size; + num_nodes = num_rows / matrix_C_block_size; matrix_C_offd_i = hypre_CTAlloc(HYPRE_Int, num_nodes + 1, HYPRE_MEMORY_HOST); @@ -478,11 +480,11 @@ hypre_ParCSRBlockMatrixConvertFromParCSRMatrix(hypre_ParCSRMatrix *matrix, { map_to_node = hypre_CTAlloc(HYPRE_BigInt, num_cols_offd, HYPRE_MEMORY_HOST); matrix_C_num_cols_offd = 1; - map_to_node[0] = col_map_offd[0]/(HYPRE_BigInt)matrix_C_block_size; - for (i=1; i < num_cols_offd; i++) + map_to_node[0] = col_map_offd[0] / (HYPRE_BigInt)matrix_C_block_size; + for (i = 1; i < num_cols_offd; i++) { - map_to_node[i] = col_map_offd[i]/(HYPRE_BigInt)matrix_C_block_size; - if (map_to_node[i] > map_to_node[i-1]) matrix_C_num_cols_offd++; + map_to_node[i] = col_map_offd[i] / (HYPRE_BigInt)matrix_C_block_size; + if (map_to_node[i] > map_to_node[i - 1]) { matrix_C_num_cols_offd++; } } matrix_C_col_map_offd = hypre_CTAlloc(HYPRE_BigInt, matrix_C_num_cols_offd, HYPRE_MEMORY_HOST); @@ -495,9 +497,9 @@ hypre_ParCSRBlockMatrixConvertFromParCSRMatrix(hypre_ParCSRMatrix *matrix, /* fill in the col_map_off_d - these are global numbers. Then we need to map these to j entries (these have local numbers) */ - for (i=1; i < num_cols_offd; i++) + for (i = 1; i < num_cols_offd; i++) { - if (map_to_node[i] > map_to_node[i-1]) + if (map_to_node[i] > map_to_node[i - 1]) { matrix_C_col_map_offd[count++] = map_to_node[i]; } @@ -507,16 +509,18 @@ hypre_ParCSRBlockMatrixConvertFromParCSRMatrix(hypre_ParCSRMatrix *matrix, /* now figure the nonzeros */ matrix_C_num_nonzeros_offd = 0; counter = hypre_CTAlloc(HYPRE_Int, matrix_C_num_cols_offd, HYPRE_MEMORY_HOST); - for (i=0; i < matrix_C_num_cols_offd; i++) + for (i = 0; i < matrix_C_num_cols_offd; i++) + { counter[i] = -1; + } - for (i=0; i < num_nodes; i++) /* for each block row */ + for (i = 0; i < num_nodes; i++) /* for each block row */ { matrix_C_offd_i[i] = matrix_C_num_nonzeros_offd; - for (j=0; j < matrix_C_block_size; j++) + for (j = 0; j < matrix_C_block_size; j++) { - row = i*matrix_C_block_size+j; - for (k=offd_i[row]; k < offd_i[row+1]; k++) /* go through single row */ + row = i * matrix_C_block_size + j; + for (k = offd_i[row]; k < offd_i[row + 1]; k++) /* go through single row */ { k_map = col_in_j_map[offd_j[k]]; /*nodal col - see if this has been in this block row (i) @@ -549,23 +553,25 @@ hypre_ParCSRBlockMatrixConvertFromParCSRMatrix(hypre_ParCSRMatrix *matrix, matrix_C_offd_j = hypre_CTAlloc(HYPRE_Int, matrix_C_num_nonzeros_offd, HYPRE_MEMORY_HOST); matrix_C_offd_data = hypre_CTAlloc(HYPRE_Complex, - matrix_C_num_nonzeros_offd*matrix_C_block_size* + matrix_C_num_nonzeros_offd * matrix_C_block_size * matrix_C_block_size, HYPRE_MEMORY_HOST); hypre_CSRBlockMatrixJ(matrix_C_offd) = matrix_C_offd_j; hypre_CSRMatrixData(matrix_C_offd) = matrix_C_offd_data; - for (i=0; i < matrix_C_num_cols_offd; i++) + for (i = 0; i < matrix_C_num_cols_offd; i++) + { counter[i] = -1; + } index = 0; /*keep track of entry in matrix_C_offd_j*/ start_index = 0; - for (i=0; i < num_nodes; i++) /* for each block row */ + for (i = 0; i < num_nodes; i++) /* for each block row */ { - for (j=0; j < matrix_C_block_size; j++) /* for each row in block */ + for (j = 0; j < matrix_C_block_size; j++) /* for each row in block */ { - row = i*matrix_C_block_size+j; - for (k=offd_i[row]; k < offd_i[row+1]; k++) /* go through single row's cols */ + row = i * matrix_C_block_size + j; + for (k = offd_i[row]; k < offd_i[row + 1]; k++) /* go through single row's cols */ { k_map = col_in_j_map[offd_j[k]]; /*nodal col for off_d */ if (counter[k_map] < start_index) /* not yet counted for this nodal row */ @@ -574,7 +580,7 @@ hypre_ParCSRBlockMatrixConvertFromParCSRMatrix(hypre_ParCSRMatrix *matrix, matrix_C_offd_j[index] = k_map; /*copy the data: which position (corresponds to j array) + which row + which col */ pos = (index * matrix_C_block_size * matrix_C_block_size) + (j * matrix_C_block_size) + - (HYPRE_Int)(col_map_offd[offd_j[k]]%(HYPRE_BigInt)matrix_C_block_size); + (HYPRE_Int)(col_map_offd[offd_j[k]] % (HYPRE_BigInt)matrix_C_block_size); matrix_C_offd_data[pos] = offd_data[k]; index ++; } @@ -582,8 +588,8 @@ hypre_ParCSRBlockMatrixConvertFromParCSRMatrix(hypre_ParCSRMatrix *matrix, { /*copy the data: which position (corresponds to j array) + which row + which col */ - pos = (counter[k_map]* matrix_C_block_size * matrix_C_block_size) + (j * matrix_C_block_size) + - (HYPRE_Int)(col_map_offd[offd_j[k]]%(HYPRE_BigInt)(matrix_C_block_size)); + pos = (counter[k_map] * matrix_C_block_size * matrix_C_block_size) + (j * matrix_C_block_size) + + (HYPRE_Int)(col_map_offd[offd_j[k]] % (HYPRE_BigInt)(matrix_C_block_size)); matrix_C_offd_data[pos] = offd_data[k]; } } @@ -594,8 +600,8 @@ hypre_ParCSRBlockMatrixConvertFromParCSRMatrix(hypre_ParCSRMatrix *matrix, /* *********create the new matrix *************/ matrix_C = hypre_ParCSRBlockMatrixCreate(comm, matrix_C_block_size, - global_num_rows/(HYPRE_BigInt)matrix_C_block_size, - global_num_cols/(HYPRE_BigInt)matrix_C_block_size, + global_num_rows / (HYPRE_BigInt)matrix_C_block_size, + global_num_cols / (HYPRE_BigInt)matrix_C_block_size, matrix_C_row_starts, matrix_C_col_starts, matrix_C_num_cols_offd, @@ -618,8 +624,6 @@ hypre_ParCSRBlockMatrixConvertFromParCSRMatrix(hypre_ParCSRMatrix *matrix, hypre_TFree(map_to_node, HYPRE_MEMORY_HOST); hypre_TFree(col_in_j_map, HYPRE_MEMORY_HOST); hypre_TFree(counter, HYPRE_MEMORY_HOST); - hypre_TFree(matrix_C_row_starts, HYPRE_MEMORY_HOST); - hypre_TFree(matrix_C_col_starts, HYPRE_MEMORY_HOST); return matrix_C; } @@ -631,11 +635,9 @@ hypre_ParCSRBlockMatrixConvertFromParCSRMatrix(hypre_ParCSRMatrix *matrix, HYPRE_Int hypre_BlockMatvecCommPkgCreate(hypre_ParCSRBlockMatrix *A) { - HYPRE_Int num_recvs, *recv_procs, *recv_vec_starts; - HYPRE_Int num_sends, *send_procs, *send_map_starts; - HYPRE_Int *send_map_elmts; + HYPRE_Int *send_map_elmts; HYPRE_Int num_cols_off_d; HYPRE_BigInt *col_map_off_d; @@ -643,10 +645,9 @@ hypre_BlockMatvecCommPkgCreate(hypre_ParCSRBlockMatrix *A) HYPRE_BigInt first_col_diag; HYPRE_BigInt global_num_cols; + MPI_Comm comm; - MPI_Comm comm; - - hypre_ParCSRCommPkg *comm_pkg; + hypre_ParCSRCommPkg *comm_pkg = NULL; hypre_IJAssumedPart *apart; /*----------------------------------------------------------- @@ -662,7 +663,7 @@ hypre_BlockMatvecCommPkgCreate(hypre_ParCSRBlockMatrix *A) first_col_diag = hypre_ParCSRBlockMatrixFirstColDiag(A); /* Create the assumed partition */ - if (hypre_ParCSRBlockMatrixAssumedPartition(A) == NULL) + if (hypre_ParCSRBlockMatrixAssumedPartition(A) == NULL) { hypre_ParCSRBlockMatrixCreateAssumedPartition(A); } @@ -696,18 +697,11 @@ hypre_BlockMatvecCommPkgCreate(hypre_ParCSRBlockMatrix *A) * setup commpkg *----------------------------------------------------------*/ - comm_pkg = hypre_CTAlloc(hypre_ParCSRCommPkg, 1, HYPRE_MEMORY_HOST); - - hypre_ParCSRCommPkgComm(comm_pkg) = comm; - - hypre_ParCSRCommPkgNumRecvs(comm_pkg) = num_recvs; - hypre_ParCSRCommPkgRecvProcs(comm_pkg) = recv_procs; - hypre_ParCSRCommPkgRecvVecStarts(comm_pkg) = recv_vec_starts; - - hypre_ParCSRCommPkgNumSends(comm_pkg) = num_sends; - hypre_ParCSRCommPkgSendProcs(comm_pkg) = send_procs; - hypre_ParCSRCommPkgSendMapStarts(comm_pkg) = send_map_starts; - hypre_ParCSRCommPkgSendMapElmts(comm_pkg) = send_map_elmts; + hypre_ParCSRCommPkgCreateAndFill(comm, + num_recvs, recv_procs, recv_vec_starts, + num_sends, send_procs, send_map_starts, + send_map_elmts, + &comm_pkg); hypre_ParCSRBlockMatrixCommPkg(A) = comm_pkg; @@ -737,7 +731,7 @@ hypre_ParCSRBlockMatrixExtractBExt(hypre_ParCSRBlockMatrix *B, HYPRE_Int *send_map_elmts = hypre_ParCSRCommPkgSendMapElmts(comm_pkg); hypre_ParCSRCommHandle *comm_handle; - hypre_ParCSRCommPkg *tmp_comm_pkg; + hypre_ParCSRCommPkg *tmp_comm_pkg = NULL; hypre_CSRBlockMatrix *diag = hypre_ParCSRBlockMatrixDiag(B); @@ -753,7 +747,7 @@ hypre_ParCSRBlockMatrixExtractBExt(hypre_ParCSRBlockMatrix *B, HYPRE_Int *B_int_i; HYPRE_BigInt *B_int_j; - HYPRE_Complex *B_int_data; + HYPRE_Complex *B_int_data = NULL; HYPRE_Int num_cols_B, num_nonzeros; HYPRE_Int num_rows_B_ext; @@ -763,7 +757,7 @@ hypre_ParCSRBlockMatrixExtractBExt(hypre_ParCSRBlockMatrix *B, HYPRE_Int *B_ext_i; HYPRE_BigInt *B_ext_j; - HYPRE_Complex *B_ext_data; + HYPRE_Complex *B_ext_data = NULL; HYPRE_Int *jdata_recv_vec_starts; HYPRE_Int *jdata_send_map_starts; @@ -772,122 +766,134 @@ hypre_ParCSRBlockMatrixExtractBExt(hypre_ParCSRBlockMatrix *B, HYPRE_Int start_index; HYPRE_Int j_cnt, jrow; - hypre_MPI_Comm_size(comm,&num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); bnnz = block_size * block_size; num_cols_B = hypre_ParCSRMatrixGlobalNumCols(B); num_rows_B_ext = recv_vec_starts[num_recvs]; - B_int_i = hypre_CTAlloc(HYPRE_Int, send_map_starts[num_sends]+1, HYPRE_MEMORY_HOST); - B_ext_i = hypre_CTAlloc(HYPRE_Int, num_rows_B_ext+1, HYPRE_MEMORY_HOST); -/*-------------------------------------------------------------------------- - * generate B_int_i through adding number of row-elements of offd and diag - * for corresponding rows. B_int_i[j+1] contains the number of elements of - * a row j (which is determined through send_map_elmts) - *--------------------------------------------------------------------------*/ + B_int_i = hypre_CTAlloc(HYPRE_Int, send_map_starts[num_sends] + 1, HYPRE_MEMORY_HOST); + B_ext_i = hypre_CTAlloc(HYPRE_Int, num_rows_B_ext + 1, HYPRE_MEMORY_HOST); + /*-------------------------------------------------------------------------- + * generate B_int_i through adding number of row-elements of offd and diag + * for corresponding rows. B_int_i[j+1] contains the number of elements of + * a row j (which is determined through send_map_elmts) + *--------------------------------------------------------------------------*/ B_int_i[0] = 0; j_cnt = 0; num_nonzeros = 0; - for (i=0; i < num_sends; i++) + for (i = 0; i < num_sends; i++) { - for (j = send_map_starts[i]; j < send_map_starts[i+1]; j++) + for (j = send_map_starts[i]; j < send_map_starts[i + 1]; j++) { jrow = send_map_elmts[j]; - B_int_i[++j_cnt] = offd_i[jrow+1] - offd_i[jrow] - + diag_i[jrow+1] - diag_i[jrow]; + B_int_i[++j_cnt] = offd_i[jrow + 1] - offd_i[jrow] + + diag_i[jrow + 1] - diag_i[jrow]; num_nonzeros += B_int_i[j_cnt]; } } -/*-------------------------------------------------------------------------- - * initialize communication - *--------------------------------------------------------------------------*/ - comm_handle = hypre_ParCSRCommHandleCreate(11,comm_pkg, - &B_int_i[1],&B_ext_i[1]); + /*-------------------------------------------------------------------------- + * initialize communication + *--------------------------------------------------------------------------*/ + comm_handle = hypre_ParCSRCommHandleCreate(11, comm_pkg, + &B_int_i[1], &B_ext_i[1]); B_int_j = hypre_CTAlloc(HYPRE_BigInt, num_nonzeros, HYPRE_MEMORY_HOST); - if (data) B_int_data = hypre_CTAlloc(HYPRE_Complex, num_nonzeros*bnnz, HYPRE_MEMORY_HOST); + if (data) { B_int_data = hypre_CTAlloc(HYPRE_Complex, num_nonzeros * bnnz, HYPRE_MEMORY_HOST); } - jdata_send_map_starts = hypre_CTAlloc(HYPRE_Int, num_sends+1, HYPRE_MEMORY_HOST); - jdata_recv_vec_starts = hypre_CTAlloc(HYPRE_Int, num_recvs+1, HYPRE_MEMORY_HOST); + jdata_send_map_starts = hypre_CTAlloc(HYPRE_Int, num_sends + 1, HYPRE_MEMORY_HOST); + jdata_recv_vec_starts = hypre_CTAlloc(HYPRE_Int, num_recvs + 1, HYPRE_MEMORY_HOST); start_index = B_int_i[0]; jdata_send_map_starts[0] = start_index; counter = 0; - for (i=0; i < num_sends; i++) + for (i = 0; i < num_sends; i++) { num_nonzeros = counter; - for (j = send_map_starts[i]; j < send_map_starts[i+1]; j++) + for (j = send_map_starts[i]; j < send_map_starts[i + 1]; j++) { jrow = send_map_elmts[j]; - for (k=diag_i[jrow]; k < diag_i[jrow+1]; k++) + for (k = diag_i[jrow]; k < diag_i[jrow + 1]; k++) { - B_int_j[counter] = (HYPRE_BigInt)diag_j[k]+first_col_diag; - if (data) { - for(l = 0; l < bnnz; l++) - B_int_data[counter*bnnz+ l] = diag_data[k*bnnz+ l]; + B_int_j[counter] = (HYPRE_BigInt)diag_j[k] + first_col_diag; + if (data) + { + for (l = 0; l < bnnz; l++) + { + B_int_data[counter * bnnz + l] = diag_data[k * bnnz + l]; + } } counter++; } - for (k=offd_i[jrow]; k < offd_i[jrow+1]; k++) + for (k = offd_i[jrow]; k < offd_i[jrow + 1]; k++) { B_int_j[counter] = col_map_offd[offd_j[k]]; - if (data) { - for(l = 0; l < bnnz; l++) - B_int_data[counter*bnnz+ l] = - offd_data[k*bnnz+ l]; + if (data) + { + for (l = 0; l < bnnz; l++) + B_int_data[counter * bnnz + l] = + offd_data[k * bnnz + l]; } counter++; } } num_nonzeros = counter - num_nonzeros; start_index += num_nonzeros; - jdata_send_map_starts[i+1] = start_index; + jdata_send_map_starts[i + 1] = start_index; } - tmp_comm_pkg = hypre_CTAlloc(hypre_ParCSRCommPkg, 1, HYPRE_MEMORY_HOST); - hypre_ParCSRCommPkgComm(tmp_comm_pkg) = comm; - hypre_ParCSRCommPkgNumSends(tmp_comm_pkg) = num_sends; - hypre_ParCSRCommPkgNumRecvs(tmp_comm_pkg) = num_recvs; - hypre_ParCSRCommPkgSendProcs(tmp_comm_pkg) = hypre_ParCSRCommPkgSendProcs(comm_pkg); - hypre_ParCSRCommPkgRecvProcs(tmp_comm_pkg) = hypre_ParCSRCommPkgRecvProcs(comm_pkg); - hypre_ParCSRCommPkgSendMapStarts(tmp_comm_pkg) = jdata_send_map_starts; + /* Create temporary communication package */ + hypre_ParCSRCommPkgCreateAndFill(comm, + num_recvs, + hypre_ParCSRCommPkgRecvProcs(comm_pkg), + jdata_recv_vec_starts, + num_sends, + hypre_ParCSRCommPkgSendProcs(comm_pkg), + jdata_send_map_starts, + NULL, + &tmp_comm_pkg); hypre_ParCSRCommHandleDestroy(comm_handle); comm_handle = NULL; -/*-------------------------------------------------------------------------- - * after communication exchange B_ext_i[j+1] contains the number of elements - * of a row j ! - * evaluate B_ext_i and compute num_nonzeros for B_ext - *--------------------------------------------------------------------------*/ + /*-------------------------------------------------------------------------- + * after communication exchange B_ext_i[j+1] contains the number of elements + * of a row j ! + * evaluate B_ext_i and compute num_nonzeros for B_ext + *--------------------------------------------------------------------------*/ - for (i=0; i < num_recvs; i++) - for (j = recv_vec_starts[i]; j < recv_vec_starts[i+1]; j++) - B_ext_i[j+1] += B_ext_i[j]; + for (i = 0; i < num_recvs; i++) + { + for (j = recv_vec_starts[i]; j < recv_vec_starts[i + 1]; j++) + { + B_ext_i[j + 1] += B_ext_i[j]; + } + } num_nonzeros = B_ext_i[num_rows_B_ext]; B_ext = hypre_CSRBlockMatrixCreate(block_size, num_rows_B_ext, num_cols_B, num_nonzeros); B_ext_j = hypre_CTAlloc(HYPRE_BigInt, num_nonzeros, HYPRE_MEMORY_HOST); - if (data) B_ext_data = hypre_CTAlloc(HYPRE_Complex, num_nonzeros*bnnz, HYPRE_MEMORY_HOST); + if (data) + { + B_ext_data = hypre_CTAlloc(HYPRE_Complex, num_nonzeros * bnnz, HYPRE_MEMORY_HOST); + } - for (i=0; i < num_recvs; i++) + for (i = 0; i < num_recvs; i++) { start_index = B_ext_i[recv_vec_starts[i]]; - num_nonzeros = B_ext_i[recv_vec_starts[i+1]]-start_index; - jdata_recv_vec_starts[i+1] = B_ext_i[recv_vec_starts[i+1]]; + num_nonzeros = B_ext_i[recv_vec_starts[i + 1]] - start_index; + jdata_recv_vec_starts[i + 1] = B_ext_i[recv_vec_starts[i + 1]]; } - hypre_ParCSRCommPkgRecvVecStarts(tmp_comm_pkg) = jdata_recv_vec_starts; - - comm_handle = hypre_ParCSRCommHandleCreate(21,tmp_comm_pkg,B_int_j,B_ext_j); + comm_handle = hypre_ParCSRCommHandleCreate(21, tmp_comm_pkg, B_int_j, B_ext_j); hypre_ParCSRCommHandleDestroy(comm_handle); comm_handle = NULL; if (data) { - comm_handle = hypre_ParCSRBlockCommHandleCreate(1, bnnz,tmp_comm_pkg, + comm_handle = hypre_ParCSRBlockCommHandleCreate(1, bnnz, tmp_comm_pkg, B_int_data, B_ext_data); hypre_ParCSRBlockCommHandleDestroy(comm_handle); comm_handle = NULL; @@ -895,17 +901,25 @@ hypre_ParCSRBlockMatrixExtractBExt(hypre_ParCSRBlockMatrix *B, hypre_CSRBlockMatrixI(B_ext) = B_ext_i; hypre_CSRBlockMatrixBigJ(B_ext) = B_ext_j; - if (data) hypre_CSRBlockMatrixData(B_ext) = B_ext_data; + if (data) + { + hypre_CSRBlockMatrixData(B_ext) = B_ext_data; + } - hypre_TFree(B_int_i, HYPRE_MEMORY_HOST); - hypre_TFree(B_int_j, HYPRE_MEMORY_HOST); - if (data) hypre_TFree(B_int_data, HYPRE_MEMORY_HOST); + /* Free memory */ hypre_TFree(jdata_send_map_starts, HYPRE_MEMORY_HOST); hypre_TFree(jdata_recv_vec_starts, HYPRE_MEMORY_HOST); hypre_TFree(tmp_comm_pkg, HYPRE_MEMORY_HOST); + hypre_TFree(B_int_i, HYPRE_MEMORY_HOST); + hypre_TFree(B_int_j, HYPRE_MEMORY_HOST); + if (data) + { + hypre_TFree(B_int_data, HYPRE_MEMORY_HOST); + } return B_ext; } + /*-------------------------------------------------------------------------- * hypre_ParVectorCreateFromBlock *--------------------------------------------------------------------------*/ @@ -921,11 +935,11 @@ hypre_ParVectorCreateFromBlock( MPI_Comm comm, HYPRE_BigInt new_partitioning[2]; /* need to create a new partitioning - son't want to write over what is passed in */ - global_size = p_global_size*(HYPRE_BigInt)block_size; + global_size = p_global_size * (HYPRE_BigInt)block_size; vector = hypre_CTAlloc(hypre_ParVector, 1, HYPRE_MEMORY_HOST); - hypre_MPI_Comm_rank(comm,&my_id); - hypre_MPI_Comm_size(comm,&num_procs); + hypre_MPI_Comm_rank(comm, &my_id); + hypre_MPI_Comm_size(comm, &num_procs); if (!p_partitioning) { @@ -933,8 +947,8 @@ hypre_ParVectorCreateFromBlock( MPI_Comm comm, } else /* adjust for block_size */ { - new_partitioning[0] = p_partitioning[0]*(HYPRE_BigInt)block_size; - new_partitioning[1] = p_partitioning[1]*(HYPRE_BigInt)block_size; + new_partitioning[0] = p_partitioning[0] * (HYPRE_BigInt)block_size; + new_partitioning[1] = p_partitioning[1] * (HYPRE_BigInt)block_size; } hypre_ParVectorComm(vector) = comm; @@ -944,7 +958,7 @@ hypre_ParVectorCreateFromBlock( MPI_Comm comm, hypre_ParVectorPartitioning(vector)[0] = new_partitioning[0]; hypre_ParVectorPartitioning(vector)[1] = new_partitioning[1]; hypre_ParVectorLocalVector(vector) = - hypre_SeqVectorCreate(new_partitioning[1]-new_partitioning[0]); + hypre_SeqVectorCreate(new_partitioning[1] - new_partitioning[0]); /* set defaults */ hypre_ParVectorOwnsData(vector) = 1; diff --git a/external/hypre/src/parcsr_block_mv/par_csr_block_matrix.h b/external/hypre/src/parcsr_block_mv/par_csr_block_matrix.h index b349dafa..b5acdedb 100644 --- a/external/hypre/src/parcsr_block_mv/par_csr_block_matrix.h +++ b/external/hypre/src/parcsr_block_mv/par_csr_block_matrix.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -37,15 +37,15 @@ typedef struct HYPRE_BigInt first_row_index; HYPRE_BigInt first_col_diag; - /* need to know entire local range in case row_starts and col_starts - are null */ + /* need to know entire local range in case row_starts and col_starts + are null */ HYPRE_BigInt last_row_index; HYPRE_BigInt last_col_diag; hypre_CSRBlockMatrix *diag; hypre_CSRBlockMatrix *offd; HYPRE_BigInt *col_map_offd; - /* maps columns of offd to global columns */ + /* maps columns of offd to global columns */ HYPRE_BigInt row_starts[2]; /* row_starts[0] is start of local rows row_starts[1] is start of next processor's rows */ @@ -294,9 +294,9 @@ void hypre_block_qsort( HYPRE_Int *v, void hypre_swap_blk( HYPRE_Complex *v, - HYPRE_Int block_size, - HYPRE_Int i, - HYPRE_Int j ); + HYPRE_Int block_size, + HYPRE_Int i, + HYPRE_Int j ); #ifdef __cplusplus diff --git a/external/hypre/src/parcsr_block_mv/par_csr_block_matvec.c b/external/hypre/src/parcsr_block_mv/par_csr_block_matvec.c index f4ef1db4..bc26eb58 100644 --- a/external/hypre/src/parcsr_block_mv/par_csr_block_matvec.c +++ b/external/hypre/src/parcsr_block_mv/par_csr_block_matvec.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -28,17 +28,17 @@ hypre_ParCSRBlockMatrixMatvec(HYPRE_Complex alpha, HYPRE_Complex beta, hypre_ParVector *y) { - hypre_ParCSRCommHandle *comm_handle; + hypre_ParCSRCommHandle *comm_handle = NULL; hypre_ParCSRCommPkg *comm_pkg; hypre_CSRBlockMatrix *diag, *offd; - hypre_Vector *x_local, *y_local, *x_tmp; + hypre_Vector *x_local, *y_local, *x_tmp = NULL; HYPRE_BigInt num_rows, num_cols; HYPRE_Int i, j, k, index; HYPRE_Int blk_size, size; HYPRE_BigInt x_size, y_size; HYPRE_Int num_cols_offd, start, finish, elem; HYPRE_Int ierr = 0, nprocs, num_sends, mypid; - HYPRE_Complex *x_tmp_data, *x_buf_data, *x_local_data; + HYPRE_Complex *x_tmp_data, *x_buf_data = NULL, *x_local_data; hypre_MPI_Comm_size(hypre_ParCSRBlockMatrixComm(A), &nprocs); hypre_MPI_Comm_rank(hypre_ParCSRBlockMatrixComm(A), &mypid); @@ -59,13 +59,13 @@ hypre_ParCSRBlockMatrixMatvec(HYPRE_Complex alpha, * Check for size compatibility. *--------------------------------------------------------------------*/ - if (num_cols*(HYPRE_BigInt)blk_size != x_size) ierr = 11; - if (num_rows*(HYPRE_BigInt)blk_size != y_size) ierr = 12; - if (num_cols*(HYPRE_BigInt)blk_size != x_size && num_rows*(HYPRE_BigInt)blk_size != y_size) ierr = 13; + if (num_cols * (HYPRE_BigInt)blk_size != x_size) { ierr = 11; } + if (num_rows * (HYPRE_BigInt)blk_size != y_size) { ierr = 12; } + if (num_cols * (HYPRE_BigInt)blk_size != x_size && num_rows * (HYPRE_BigInt)blk_size != y_size) { ierr = 13; } if (nprocs > 1) { - x_tmp = hypre_SeqVectorCreate(num_cols_offd*blk_size); + x_tmp = hypre_SeqVectorCreate(num_cols_offd * blk_size); hypre_SeqVectorInitialize(x_tmp); x_tmp_data = hypre_VectorData(x_tmp); @@ -75,21 +75,23 @@ hypre_ParCSRBlockMatrixMatvec(HYPRE_Complex alpha, comm_pkg = hypre_ParCSRBlockMatrixCommPkg(A); } num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - size = hypre_ParCSRCommPkgSendMapStart(comm_pkg,num_sends)*blk_size; + size = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends) * blk_size; x_buf_data = hypre_CTAlloc(HYPRE_Complex, size, HYPRE_MEMORY_HOST); index = 0; for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - finish = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); + finish = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); for (j = start; j < finish; j++) { - elem = hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)*blk_size; + elem = hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j) * blk_size; for (k = 0; k < blk_size; k++) + { x_buf_data[index++] = x_local_data[elem++]; + } } } - comm_handle = hypre_ParCSRBlockCommHandleCreate(1, blk_size,comm_pkg, + comm_handle = hypre_ParCSRBlockCommHandleCreate(1, blk_size, comm_pkg, x_buf_data, x_tmp_data); } hypre_CSRBlockMatrixMatvec(alpha, diag, x_local, beta, y_local); @@ -98,7 +100,9 @@ hypre_ParCSRBlockMatrixMatvec(HYPRE_Complex alpha, hypre_ParCSRBlockCommHandleDestroy(comm_handle); comm_handle = NULL; if (num_cols_offd) - hypre_CSRBlockMatrixMatvec(alpha,offd,x_tmp,1.0,y_local); + { + hypre_CSRBlockMatrixMatvec(alpha, offd, x_tmp, 1.0, y_local); + } hypre_SeqVectorDestroy(x_tmp); x_tmp = NULL; hypre_TFree(x_buf_data, HYPRE_MEMORY_HOST); @@ -157,19 +161,25 @@ hypre_ParCSRBlockMatrixMatvecT( HYPRE_Complex alpha, * is informational only. *--------------------------------------------------------------------*/ - if (num_rows*(HYPRE_BigInt)blk_size != x_size) + if (num_rows * (HYPRE_BigInt)blk_size != x_size) + { ierr = 1; + } - if (num_cols*(HYPRE_BigInt)blk_size != y_size) + if (num_cols * (HYPRE_BigInt)blk_size != y_size) + { ierr = 2; + } - if (num_rows*(HYPRE_BigInt)blk_size != x_size && num_cols*(HYPRE_BigInt)blk_size != y_size) + if (num_rows * (HYPRE_BigInt)blk_size != x_size && num_cols * (HYPRE_BigInt)blk_size != y_size) + { ierr = 3; + } /*----------------------------------------------------------------------- *-----------------------------------------------------------------------*/ - y_tmp = hypre_SeqVectorCreate(num_cols_offd*blk_size); + y_tmp = hypre_SeqVectorCreate(num_cols_offd * blk_size); hypre_SeqVectorInitialize(y_tmp); /*--------------------------------------------------------------------- @@ -183,16 +193,16 @@ hypre_ParCSRBlockMatrixMatvecT( HYPRE_Complex alpha, } num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - size = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends)*blk_size; + size = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends) * blk_size; y_buf_data = hypre_CTAlloc(HYPRE_Complex, size, HYPRE_MEMORY_HOST); y_tmp_data = hypre_VectorData(y_tmp); y_local_data = hypre_VectorData(y_local); - if (num_cols_offd) hypre_CSRBlockMatrixMatvecT(alpha, offd, x_local, 0.0, y_tmp); + if (num_cols_offd) { hypre_CSRBlockMatrixMatvecT(alpha, offd, x_local, 0.0, y_tmp); } comm_handle = hypre_ParCSRBlockCommHandleCreate - ( 2, blk_size, comm_pkg, y_tmp_data, y_buf_data); + ( 2, blk_size, comm_pkg, y_tmp_data, y_buf_data); hypre_CSRBlockMatrixMatvecT(alpha, diag, x_local, beta, y_local); @@ -205,15 +215,15 @@ hypre_ParCSRBlockMatrixMatvecT( HYPRE_Complex alpha, for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - finish = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); + finish = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); for (j = start; j < finish; j++) { - elem = hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)*blk_size; + elem = hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j) * blk_size; for (k = 0; k < blk_size; k++) { y_local_data[elem++] - += y_buf_data[index++]; + += y_buf_data[index++]; } } } diff --git a/external/hypre/src/parcsr_block_mv/par_csr_block_rap.c b/external/hypre/src/parcsr_block_mv/par_csr_block_rap.c index 2dd0bd89..40974ade 100644 --- a/external/hypre/src/parcsr_block_mv/par_csr_block_rap.c +++ b/external/hypre/src/parcsr_block_mv/par_csr_block_rap.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -32,7 +32,7 @@ hypre_ExchangeRAPBlockData(hypre_CSRBlockMatrix *RAP_int, HYPRE_Int *send_procs = hypre_ParCSRCommPkgSendProcs(comm_pkg_RT); HYPRE_Int *send_map_starts = hypre_ParCSRCommPkgSendMapStarts(comm_pkg_RT); -/* HYPRE_Int block_size = hypre_CSRBlockMatrixBlockSize(RAP_int); */ + /* HYPRE_Int block_size = hypre_CSRBlockMatrixBlockSize(RAP_int); */ hypre_CSRBlockMatrix *RAP_ext; @@ -41,7 +41,7 @@ hypre_ExchangeRAPBlockData(hypre_CSRBlockMatrix *RAP_int, HYPRE_Complex *RAP_ext_data = NULL; hypre_ParCSRCommHandle *comm_handle = NULL; - hypre_ParCSRCommPkg *tmp_comm_pkg; + hypre_ParCSRCommPkg *tmp_comm_pkg = NULL; HYPRE_Int *jdata_recv_vec_starts; HYPRE_Int *jdata_send_map_starts; @@ -51,20 +51,20 @@ hypre_ExchangeRAPBlockData(hypre_CSRBlockMatrix *RAP_int, HYPRE_Int i, j, bnnz; HYPRE_Int num_procs, my_id; - hypre_MPI_Comm_size(comm,&num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); bnnz = block_size * block_size; - RAP_ext_i = hypre_CTAlloc(HYPRE_Int, send_map_starts[num_sends]+1, HYPRE_MEMORY_HOST); - jdata_recv_vec_starts = hypre_CTAlloc(HYPRE_Int, num_recvs+1, HYPRE_MEMORY_HOST); - jdata_send_map_starts = hypre_CTAlloc(HYPRE_Int, num_sends+1, HYPRE_MEMORY_HOST); + RAP_ext_i = hypre_CTAlloc(HYPRE_Int, send_map_starts[num_sends] + 1, HYPRE_MEMORY_HOST); + jdata_recv_vec_starts = hypre_CTAlloc(HYPRE_Int, num_recvs + 1, HYPRE_MEMORY_HOST); + jdata_send_map_starts = hypre_CTAlloc(HYPRE_Int, num_sends + 1, HYPRE_MEMORY_HOST); -/*-------------------------------------------------------------------------- - * recompute RAP_int_i so that RAP_int_i[j+1] contains the number of - * elements of row j (to be determined through send_map_elmnts on the - * receiving end) - *--------------------------------------------------------------------------*/ + /*-------------------------------------------------------------------------- + * recompute RAP_int_i so that RAP_int_i[j+1] contains the number of + * elements of row j (to be determined through send_map_elmnts on the + * receiving end) + *--------------------------------------------------------------------------*/ if (num_recvs) { @@ -74,69 +74,79 @@ hypre_ExchangeRAPBlockData(hypre_CSRBlockMatrix *RAP_int, num_cols = hypre_CSRBlockMatrixNumCols(RAP_int); } jdata_recv_vec_starts[0] = 0; - for (i=0; i < num_recvs; i++) - jdata_recv_vec_starts[i+1] = RAP_int_i[recv_vec_starts[i+1]]; + for (i = 0; i < num_recvs; i++) + { + jdata_recv_vec_starts[i + 1] = RAP_int_i[recv_vec_starts[i + 1]]; + } - for (i=num_recvs; i > 0; i--) - for (j = recv_vec_starts[i]; j > recv_vec_starts[i-1]; j--) - RAP_int_i[j] -= RAP_int_i[j-1]; + for (i = num_recvs; i > 0; i--) + for (j = recv_vec_starts[i]; j > recv_vec_starts[i - 1]; j--) + { + RAP_int_i[j] -= RAP_int_i[j - 1]; + } -/*-------------------------------------------------------------------------- - * initialize communication - *--------------------------------------------------------------------------*/ + /*-------------------------------------------------------------------------- + * initialize communication + *--------------------------------------------------------------------------*/ if (num_recvs && num_sends) - comm_handle = hypre_ParCSRCommHandleCreate(12,comm_pkg_RT, + { + comm_handle = hypre_ParCSRCommHandleCreate(12, comm_pkg_RT, &RAP_int_i[1], &RAP_ext_i[1]); + } else if (num_recvs) - comm_handle = hypre_ParCSRCommHandleCreate(12,comm_pkg_RT, + { + comm_handle = hypre_ParCSRCommHandleCreate(12, comm_pkg_RT, &RAP_int_i[1], NULL); + } else if (num_sends) - comm_handle = hypre_ParCSRCommHandleCreate(12,comm_pkg_RT, + { + comm_handle = hypre_ParCSRCommHandleCreate(12, comm_pkg_RT, NULL, &RAP_ext_i[1]); + } - tmp_comm_pkg = hypre_CTAlloc(hypre_ParCSRCommPkg, 1, HYPRE_MEMORY_HOST); - hypre_ParCSRCommPkgComm(tmp_comm_pkg) = comm; - hypre_ParCSRCommPkgNumSends(tmp_comm_pkg) = num_recvs; - hypre_ParCSRCommPkgNumRecvs(tmp_comm_pkg) = num_sends; - hypre_ParCSRCommPkgSendProcs(tmp_comm_pkg) = recv_procs; - hypre_ParCSRCommPkgRecvProcs(tmp_comm_pkg) = send_procs; + /* Create temporary communication package - note: send and recv are reversed */ + hypre_ParCSRCommPkgCreateAndFill(comm, + num_sends, send_procs, jdata_send_map_starts, + num_recvs, recv_procs, jdata_recv_vec_starts, + NULL, &tmp_comm_pkg); hypre_ParCSRCommHandleDestroy(comm_handle); comm_handle = NULL; -/*-------------------------------------------------------------------------- - * compute num_nonzeros for RAP_ext - *--------------------------------------------------------------------------*/ + /*-------------------------------------------------------------------------- + * compute num_nonzeros for RAP_ext + *--------------------------------------------------------------------------*/ - for (i=0; i < num_sends; i++) - for (j = send_map_starts[i]; j < send_map_starts[i+1]; j++) - RAP_ext_i[j+1] += RAP_ext_i[j]; + for (i = 0; i < num_sends; i++) + { + for (j = send_map_starts[i]; j < send_map_starts[i + 1]; j++) + { + RAP_ext_i[j + 1] += RAP_ext_i[j]; + } + } num_rows = send_map_starts[num_sends]; num_nonzeros = RAP_ext_i[num_rows]; if (num_nonzeros) { RAP_ext_j = hypre_CTAlloc(HYPRE_BigInt, num_nonzeros, HYPRE_MEMORY_HOST); - RAP_ext_data = hypre_CTAlloc(HYPRE_Complex, num_nonzeros*bnnz, HYPRE_MEMORY_HOST); + RAP_ext_data = hypre_CTAlloc(HYPRE_Complex, num_nonzeros * bnnz, HYPRE_MEMORY_HOST); } - for (i=0; i < num_sends+1; i++) + for (i = 0; i < num_sends + 1; i++) { jdata_send_map_starts[i] = RAP_ext_i[send_map_starts[i]]; } - hypre_ParCSRCommPkgRecvVecStarts(tmp_comm_pkg) = jdata_send_map_starts; - hypre_ParCSRCommPkgSendMapStarts(tmp_comm_pkg) = jdata_recv_vec_starts; - comm_handle = hypre_ParCSRBlockCommHandleCreate(1, bnnz, tmp_comm_pkg, (void *) RAP_int_data, (void *) RAP_ext_data); hypre_ParCSRBlockCommHandleDestroy(comm_handle); comm_handle = NULL; - comm_handle = hypre_ParCSRCommHandleCreate(21,tmp_comm_pkg,RAP_int_j, + comm_handle = hypre_ParCSRCommHandleCreate(21, tmp_comm_pkg, RAP_int_j, RAP_ext_j); - RAP_ext = hypre_CSRBlockMatrixCreate(block_size,num_rows,num_cols, + RAP_ext = hypre_CSRBlockMatrixCreate(block_size, num_rows, num_cols, num_nonzeros); hypre_CSRBlockMatrixI(RAP_ext) = RAP_ext_i; @@ -146,12 +156,12 @@ hypre_ExchangeRAPBlockData(hypre_CSRBlockMatrix *RAP_int, hypre_CSRBlockMatrixData(RAP_ext) = RAP_ext_data; } - hypre_ParCSRCommHandleDestroy(comm_handle); - comm_handle = NULL; - + /* Free memory */ hypre_TFree(jdata_recv_vec_starts, HYPRE_MEMORY_HOST); hypre_TFree(jdata_send_map_starts, HYPRE_MEMORY_HOST); hypre_TFree(tmp_comm_pkg, HYPRE_MEMORY_HOST); + hypre_ParCSRCommHandleDestroy(comm_handle); + comm_handle = NULL; return RAP_ext; } @@ -176,7 +186,7 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, hypre_ParCSRCommPkg *comm_pkg_RT = hypre_ParCSRBlockMatrixCommPkg(RT); HYPRE_Int num_recvs_RT = 0; HYPRE_Int num_sends_RT = 0; - HYPRE_Int *send_map_starts_RT; + HYPRE_Int *send_map_starts_RT = NULL; HYPRE_Int *send_map_elmts_RT; hypre_CSRBlockMatrix *A_diag = hypre_ParCSRBlockMatrixDiag(A); @@ -213,34 +223,32 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, HYPRE_Int num_cols_diag_P = hypre_CSRBlockMatrixNumCols(P_diag); HYPRE_Int num_cols_offd_P = hypre_CSRBlockMatrixNumCols(P_offd); HYPRE_BigInt *coarse_partitioning = hypre_ParCSRBlockMatrixColStarts(P); - HYPRE_BigInt *row_starts, *col_starts; + HYPRE_BigInt row_starts[2], col_starts[2]; hypre_ParCSRBlockMatrix *RAP; - HYPRE_BigInt *col_map_offd_RAP; + HYPRE_BigInt *col_map_offd_RAP = NULL; - hypre_CSRBlockMatrix *RAP_int = NULL; + hypre_CSRBlockMatrix *RAP_int = NULL; HYPRE_Complex *RAP_int_data; HYPRE_Int *RAP_int_i; HYPRE_BigInt *RAP_int_j; - hypre_CSRBlockMatrix *RAP_ext; - - HYPRE_Complex *RAP_ext_data; - HYPRE_Int *RAP_ext_i; - HYPRE_BigInt *RAP_ext_j; + hypre_CSRBlockMatrix *RAP_ext = NULL; - hypre_CSRBlockMatrix *RAP_diag; + HYPRE_Complex *RAP_ext_data = NULL; + HYPRE_Int *RAP_ext_i = NULL; + HYPRE_BigInt *RAP_ext_j = NULL; - HYPRE_Complex *RAP_diag_data; - HYPRE_Int *RAP_diag_i; - HYPRE_Int *RAP_diag_j; + hypre_CSRBlockMatrix *RAP_diag; + HYPRE_Complex *RAP_diag_data = NULL; + HYPRE_Int *RAP_diag_i = NULL; + HYPRE_Int *RAP_diag_j = NULL; - hypre_CSRBlockMatrix *RAP_offd; - - HYPRE_Complex *RAP_offd_data; - HYPRE_Int *RAP_offd_i; - HYPRE_Int *RAP_offd_j; + hypre_CSRBlockMatrix *RAP_offd; + HYPRE_Complex *RAP_offd_data = NULL; + HYPRE_Int *RAP_offd_i = NULL; + HYPRE_Int *RAP_offd_j = NULL; HYPRE_Int RAP_size; HYPRE_Int RAP_ext_size; @@ -248,48 +256,45 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, HYPRE_Int RAP_offd_size; HYPRE_Int P_ext_diag_size; HYPRE_Int P_ext_offd_size; - HYPRE_Int first_col_diag_RAP; - HYPRE_Int last_col_diag_RAP; + HYPRE_BigInt first_col_diag_RAP; + HYPRE_BigInt last_col_diag_RAP; HYPRE_Int num_cols_offd_RAP = 0; - hypre_CSRBlockMatrix *R_diag; - - HYPRE_Complex *R_diag_data; - HYPRE_Int *R_diag_i; - HYPRE_Int *R_diag_j; - - hypre_CSRBlockMatrix *R_offd; - - HYPRE_Complex *R_offd_data; - HYPRE_Int *R_offd_i; - HYPRE_Int *R_offd_j; + hypre_CSRBlockMatrix *R_diag; + HYPRE_Complex *R_diag_data = NULL; + HYPRE_Int *R_diag_i = NULL; + HYPRE_Int *R_diag_j = NULL; - hypre_CSRBlockMatrix *Ps_ext; + hypre_CSRBlockMatrix *R_offd; + HYPRE_Complex *R_offd_data = NULL; + HYPRE_Int *R_offd_i = NULL; + HYPRE_Int *R_offd_j = NULL; - HYPRE_Complex *Ps_ext_data; - HYPRE_Int *Ps_ext_i; - HYPRE_BigInt *Ps_ext_j; + hypre_CSRBlockMatrix *Ps_ext = NULL; + HYPRE_Complex *Ps_ext_data = NULL; + HYPRE_Int *Ps_ext_i = NULL; + HYPRE_BigInt *Ps_ext_j = NULL; - HYPRE_Complex *P_ext_diag_data; - HYPRE_Int *P_ext_diag_i; - HYPRE_Int *P_ext_diag_j; + HYPRE_Complex *P_ext_diag_data = NULL; + HYPRE_Int *P_ext_diag_i = NULL; + HYPRE_Int *P_ext_diag_j = NULL; - HYPRE_Complex *P_ext_offd_data; - HYPRE_Int *P_ext_offd_i; - HYPRE_Int *P_ext_offd_j; + HYPRE_Complex *P_ext_offd_data = NULL; + HYPRE_Int *P_ext_offd_i = NULL; + HYPRE_Int *P_ext_offd_j = NULL; - HYPRE_BigInt *col_map_offd_Pext; - HYPRE_Int *map_P_to_Pext; - HYPRE_Int *map_P_to_RAP; - HYPRE_Int *map_Pext_to_RAP; + HYPRE_BigInt *col_map_offd_Pext = NULL; + HYPRE_Int *map_P_to_Pext = NULL; + HYPRE_Int *map_P_to_RAP = NULL; + HYPRE_Int *map_Pext_to_RAP = NULL; - HYPRE_Int *P_marker; + HYPRE_Int *P_marker = NULL; HYPRE_Int **P_mark_array; HYPRE_Int **A_mark_array; HYPRE_Int *A_marker; HYPRE_BigInt *temp = NULL; - HYPRE_Int n_coarse; + HYPRE_BigInt n_coarse; HYPRE_Int num_cols_offd_Pext = 0; HYPRE_Int ic, i, j, k, bnnz, kk; @@ -317,26 +322,26 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, * row-wise access to restriction . *-----------------------------------------------------------------------*/ - hypre_MPI_Comm_size(comm,&num_procs); + hypre_MPI_Comm_size(comm, &num_procs); /* num_threads = hypre_NumThreads(); */ num_threads = 1; bnnz = block_size * block_size; - r_a_products = hypre_TAlloc(HYPRE_Complex, bnnz , HYPRE_MEMORY_HOST); - r_a_p_products = hypre_TAlloc(HYPRE_Complex, bnnz , HYPRE_MEMORY_HOST); + r_a_products = hypre_TAlloc(HYPRE_Complex, bnnz, HYPRE_MEMORY_HOST); + r_a_p_products = hypre_TAlloc(HYPRE_Complex, bnnz, HYPRE_MEMORY_HOST); if (comm_pkg_RT) { num_recvs_RT = hypre_ParCSRCommPkgNumRecvs(comm_pkg_RT); num_sends_RT = hypre_ParCSRCommPkgNumSends(comm_pkg_RT); - send_map_starts_RT =hypre_ParCSRCommPkgSendMapStarts(comm_pkg_RT); + send_map_starts_RT = hypre_ParCSRCommPkgSendMapStarts(comm_pkg_RT); send_map_elmts_RT = hypre_ParCSRCommPkgSendMapElmts(comm_pkg_RT); } - hypre_CSRBlockMatrixTranspose(RT_diag,&R_diag,1); + hypre_CSRBlockMatrixTranspose(RT_diag, &R_diag, 1); if (num_cols_offd_RT) { - hypre_CSRBlockMatrixTranspose(RT_offd,&R_offd,1); + hypre_CSRBlockMatrixTranspose(RT_offd, &R_offd, 1); R_offd_data = hypre_CSRBlockMatrixData(R_offd); R_offd_i = hypre_CSRBlockMatrixI(R_offd); R_offd_j = hypre_CSRBlockMatrixJ(R_offd); @@ -361,77 +366,93 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, if (num_procs > 1) { - Ps_ext = hypre_ParCSRBlockMatrixExtractBExt(P,A,1); + Ps_ext = hypre_ParCSRBlockMatrixExtractBExt(P, A, 1); Ps_ext_data = hypre_CSRBlockMatrixData(Ps_ext); Ps_ext_i = hypre_CSRBlockMatrixI(Ps_ext); Ps_ext_j = hypre_CSRBlockMatrixBigJ(Ps_ext); } - P_ext_diag_i = hypre_CTAlloc(HYPRE_Int, num_cols_offd_A+1, HYPRE_MEMORY_HOST); - P_ext_offd_i = hypre_CTAlloc(HYPRE_Int, num_cols_offd_A+1, HYPRE_MEMORY_HOST); + P_ext_diag_i = hypre_CTAlloc(HYPRE_Int, num_cols_offd_A + 1, HYPRE_MEMORY_HOST); + P_ext_offd_i = hypre_CTAlloc(HYPRE_Int, num_cols_offd_A + 1, HYPRE_MEMORY_HOST); P_ext_diag_size = 0; P_ext_offd_size = 0; last_col_diag_P = first_col_diag_P + (HYPRE_BigInt)num_cols_diag_P - 1; - for (i=0; i < num_cols_offd_A; i++) + for (i = 0; i < num_cols_offd_A; i++) { - for (j=Ps_ext_i[i]; j < Ps_ext_i[i+1]; j++) + for (j = Ps_ext_i[i]; j < Ps_ext_i[i + 1]; j++) + { if (Ps_ext_j[j] < first_col_diag_P || Ps_ext_j[j] > last_col_diag_P) + { P_ext_offd_size++; + } else + { P_ext_diag_size++; - P_ext_diag_i[i+1] = P_ext_diag_size; - P_ext_offd_i[i+1] = P_ext_offd_size; + } + } + P_ext_diag_i[i + 1] = P_ext_diag_size; + P_ext_offd_i[i + 1] = P_ext_offd_size; } if (P_ext_diag_size) { P_ext_diag_j = hypre_CTAlloc(HYPRE_Int, P_ext_diag_size, HYPRE_MEMORY_HOST); - P_ext_diag_data = hypre_CTAlloc(HYPRE_Complex, P_ext_diag_size*bnnz, HYPRE_MEMORY_HOST); + P_ext_diag_data = hypre_CTAlloc(HYPRE_Complex, P_ext_diag_size * bnnz, HYPRE_MEMORY_HOST); } if (P_ext_offd_size) { P_ext_offd_j = hypre_CTAlloc(HYPRE_Int, P_ext_offd_size, HYPRE_MEMORY_HOST); - P_ext_offd_data = hypre_CTAlloc(HYPRE_Complex, P_ext_offd_size*bnnz, HYPRE_MEMORY_HOST); + P_ext_offd_data = hypre_CTAlloc(HYPRE_Complex, P_ext_offd_size * bnnz, HYPRE_MEMORY_HOST); } cnt_offd = 0; cnt_diag = 0; cnt = 0; - for (i=0; i < num_cols_offd_A; i++) + for (i = 0; i < num_cols_offd_A; i++) { - for (j=Ps_ext_i[i]; j < Ps_ext_i[i+1]; j++) + for (j = Ps_ext_i[i]; j < Ps_ext_i[i + 1]; j++) + { if (Ps_ext_j[j] < first_col_diag_P || Ps_ext_j[j] > last_col_diag_P) { Ps_ext_j[cnt_offd] = Ps_ext_j[j]; for (kk = 0; kk < bnnz; kk++) - P_ext_offd_data[cnt_offd*bnnz+kk] = Ps_ext_data[j*bnnz+kk]; + { + P_ext_offd_data[cnt_offd * bnnz + kk] = Ps_ext_data[j * bnnz + kk]; + } cnt_offd++; } else { P_ext_diag_j[cnt_diag] = (HYPRE_Int)(Ps_ext_j[j] - first_col_diag_P); for (kk = 0; kk < bnnz; kk++) - P_ext_diag_data[cnt_diag*bnnz+kk] = Ps_ext_data[j*bnnz+kk]; + { + P_ext_diag_data[cnt_diag * bnnz + kk] = Ps_ext_data[j * bnnz + kk]; + } cnt_diag++; } + } } if (P_ext_offd_size || num_cols_offd_P) { - temp = hypre_CTAlloc(HYPRE_BigInt, P_ext_offd_size+num_cols_offd_P, HYPRE_MEMORY_HOST); - for (i=0; i < P_ext_offd_size; i++) + temp = hypre_CTAlloc(HYPRE_BigInt, P_ext_offd_size + num_cols_offd_P, HYPRE_MEMORY_HOST); + for (i = 0; i < P_ext_offd_size; i++) + { temp[i] = Ps_ext_j[i]; + } cnt = P_ext_offd_size; - for (i=0; i < num_cols_offd_P; i++) + for (i = 0; i < num_cols_offd_P; i++) + { temp[cnt++] = col_map_offd_P[i]; + } } if (cnt) { - hypre_BigQsort0(temp, 0, cnt-1); + hypre_BigQsort0(temp, 0, cnt - 1); num_cols_offd_Pext = 1; value = temp[0]; - for (i=1; i < cnt; i++) + for (i = 1; i < cnt; i++) { if (temp[i] > value) { @@ -442,28 +463,37 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, } if (num_cols_offd_Pext) + { col_map_offd_Pext = hypre_CTAlloc(HYPRE_BigInt, num_cols_offd_Pext, HYPRE_MEMORY_HOST); + } - for (i=0; i < num_cols_offd_Pext; i++) + for (i = 0; i < num_cols_offd_Pext; i++) + { col_map_offd_Pext[i] = temp[i]; + } if (P_ext_offd_size || num_cols_offd_P) + { hypre_TFree(temp, HYPRE_MEMORY_HOST); + } - for (i=0 ; i < P_ext_offd_size; i++) + for (i = 0 ; i < P_ext_offd_size; i++) + { P_ext_offd_j[i] = hypre_BigBinarySearch(col_map_offd_Pext, - Ps_ext_j[i], - num_cols_offd_Pext); + Ps_ext_j[i], + num_cols_offd_Pext); + } + if (num_cols_offd_P) { map_P_to_Pext = hypre_CTAlloc(HYPRE_Int, num_cols_offd_P, HYPRE_MEMORY_HOST); cnt = 0; - for (i=0; i < num_cols_offd_Pext; i++) + for (i = 0; i < num_cols_offd_Pext; i++) if (col_map_offd_Pext[i] == col_map_offd_P[cnt]) { map_P_to_Pext[cnt++] = i; - if (cnt == num_cols_offd_P) break; + if (cnt == num_cols_offd_P) { break; } } } @@ -487,17 +517,17 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, for (ii = 0; ii < num_threads; ii++) { - size = num_cols_offd_RT/num_threads; - rest = num_cols_offd_RT - size*num_threads; + size = num_cols_offd_RT / num_threads; + rest = num_cols_offd_RT - size * num_threads; if (ii < rest) { - ns = ii*size+ii; - ne = (ii+1)*size+ii+1; + ns = ii * size + ii; + ne = (ii + 1) * size + ii + 1; } else { - ns = ii*size+rest; - ne = (ii+1)*size+rest; + ns = ii * size + rest; + ne = (ii + 1) * size + rest; } /*-------------------------------------------------------------------- @@ -506,7 +536,8 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, if (num_cols_offd_Pext || num_cols_diag_P) { - P_mark_array[ii] = hypre_CTAlloc(HYPRE_Int, num_cols_diag_P+num_cols_offd_Pext, HYPRE_MEMORY_HOST); + P_mark_array[ii] = hypre_CTAlloc(HYPRE_Int, num_cols_diag_P + num_cols_offd_Pext, + HYPRE_MEMORY_HOST); P_marker = P_mark_array[ii]; } A_mark_array[ii] = hypre_CTAlloc(HYPRE_Int, num_nz_cols_A, HYPRE_MEMORY_HOST); @@ -517,7 +548,7 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, *--------------------------------------------------------------------*/ jj_counter = start_indexing; - for (ic = 0; ic < num_cols_diag_P+num_cols_offd_Pext; ic++) + for (ic = 0; ic < num_cols_diag_P + num_cols_offd_Pext; ic++) { P_marker[ic] = -1; } @@ -539,7 +570,7 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, * Loop over entries in row ic of R_offd. *-----------------------------------------------------------------*/ - for (jj1 = R_offd_i[ic]; jj1 < R_offd_i[ic+1]; jj1++) + for (jj1 = R_offd_i[ic]; jj1 < R_offd_i[ic + 1]; jj1++) { i1 = R_offd_j[jj1]; @@ -547,7 +578,7 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, * Loop over entries in row i1 of A_offd. *--------------------------------------------------------------*/ - for (jj2 = A_offd_i[i1]; jj2 < A_offd_i[i1+1]; jj2++) + for (jj2 = A_offd_i[i1]; jj2 < A_offd_i[i1 + 1]; jj2++) { i2 = A_offd_j[jj2]; @@ -569,7 +600,7 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, * Loop over entries in row i2 of P_ext. *--------------------------------------------------------*/ - for (jj3=P_ext_diag_i[i2]; jj3 < P_ext_diag_i[i2+1]; jj3++) + for (jj3 = P_ext_diag_i[i2]; jj3 < P_ext_diag_i[i2 + 1]; jj3++) { i3 = P_ext_diag_j[jj3]; @@ -585,7 +616,7 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, jj_counter++; } } - for (jj3=P_ext_offd_i[i2]; jj3 < P_ext_offd_i[i2+1]; jj3++) + for (jj3 = P_ext_offd_i[i2]; jj3 < P_ext_offd_i[i2 + 1]; jj3++) { i3 = P_ext_offd_j[jj3] + num_cols_diag_P; @@ -607,7 +638,7 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, * Loop over entries in row i1 of A_diag. *--------------------------------------------------------------*/ - for (jj2 = A_diag_i[i1]; jj2 < A_diag_i[i1+1]; jj2++) + for (jj2 = A_diag_i[i1]; jj2 < A_diag_i[i1 + 1]; jj2++) { i2 = A_diag_j[jj2]; @@ -617,20 +648,20 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, * points. *-----------------------------------------------------------*/ - if (A_marker[i2+num_cols_offd_A] != ic) + if (A_marker[i2 + num_cols_offd_A] != ic) { /*-------------------------------------------------------- * Mark i2 as visited. *--------------------------------------------------------*/ - A_marker[i2+num_cols_offd_A] = ic; + A_marker[i2 + num_cols_offd_A] = ic; /*-------------------------------------------------------- * Loop over entries in row i2 of P_diag. *--------------------------------------------------------*/ - for (jj3 = P_diag_i[i2]; jj3 < P_diag_i[i2+1]; jj3++) + for (jj3 = P_diag_i[i2]; jj3 < P_diag_i[i2 + 1]; jj3++) { i3 = P_diag_j[jj3]; @@ -651,7 +682,7 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, * Loop over entries in row i2 of P_offd. *--------------------------------------------------------*/ - for (jj3 = P_offd_i[i2]; jj3 < P_offd_i[i2+1]; jj3++) + for (jj3 = P_offd_i[i2]; jj3 < P_offd_i[i2 + 1]; jj3++) { i3 = map_P_to_Pext[P_offd_j[jj3]] + num_cols_diag_P; @@ -678,11 +709,11 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, * Allocate RAP_int_data and RAP_int_j arrays. *-----------------------------------------------------------------------*/ - for (i = 0; i < num_threads-1; i++) jj_count[i+1] += jj_count[i]; + for (i = 0; i < num_threads - 1; i++) { jj_count[i + 1] += jj_count[i]; } - RAP_size = jj_count[num_threads-1]; - RAP_int_i = hypre_CTAlloc(HYPRE_Int, num_cols_offd_RT+1, HYPRE_MEMORY_HOST); - RAP_int_data = hypre_CTAlloc(HYPRE_Complex, RAP_size*bnnz, HYPRE_MEMORY_HOST); + RAP_size = jj_count[num_threads - 1]; + RAP_int_i = hypre_CTAlloc(HYPRE_Int, num_cols_offd_RT + 1, HYPRE_MEMORY_HOST); + RAP_int_data = hypre_CTAlloc(HYPRE_Complex, RAP_size * bnnz, HYPRE_MEMORY_HOST); RAP_int_j = hypre_CTAlloc(HYPRE_BigInt, RAP_size, HYPRE_MEMORY_HOST); RAP_int_i[num_cols_offd_RT] = RAP_size; @@ -692,17 +723,17 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, for (ii = 0; ii < num_threads; ii++) { - size = num_cols_offd_RT/num_threads; - rest = num_cols_offd_RT - size*num_threads; + size = num_cols_offd_RT / num_threads; + rest = num_cols_offd_RT - size * num_threads; if (ii < rest) { - ns = ii*size+ii; - ne = (ii+1)*size+ii+1; + ns = ii * size + ii; + ne = (ii + 1) * size + ii + 1; } else { - ns = ii*size+rest; - ne = (ii+1)*size+rest; + ns = ii * size + rest; + ne = (ii + 1) * size + rest; } /*-------------------------------------------------------------------- @@ -710,13 +741,15 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, *--------------------------------------------------------------------*/ if (num_cols_offd_Pext || num_cols_diag_P) + { P_marker = P_mark_array[ii]; + } A_marker = A_mark_array[ii]; jj_counter = start_indexing; - if (ii > 0) jj_counter = jj_count[ii-1]; + if (ii > 0) { jj_counter = jj_count[ii - 1]; } - for (ic = 0; ic < num_cols_diag_P+num_cols_offd_Pext; ic++) + for (ic = 0; ic < num_cols_diag_P + num_cols_offd_Pext; ic++) { P_marker[ic] = -1; } @@ -738,20 +771,20 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, * Loop over entries in row ic of R_offd. *-----------------------------------------------------------------*/ - for (jj1 = R_offd_i[ic]; jj1 < R_offd_i[ic+1]; jj1++) + for (jj1 = R_offd_i[ic]; jj1 < R_offd_i[ic + 1]; jj1++) { i1 = R_offd_j[jj1]; - r_entries = &(R_offd_data[jj1*bnnz]); + r_entries = &(R_offd_data[jj1 * bnnz]); /*-------------------------------------------------------------- * Loop over entries in row i1 of A_offd. *--------------------------------------------------------------*/ - for (jj2 = A_offd_i[i1]; jj2 < A_offd_i[i1+1]; jj2++) + for (jj2 = A_offd_i[i1]; jj2 < A_offd_i[i1 + 1]; jj2++) { i2 = A_offd_j[jj2]; hypre_CSRBlockMatrixBlockMultAdd(r_entries, - &(A_offd_data[jj2*bnnz]), zero, + &(A_offd_data[jj2 * bnnz]), zero, r_a_products, block_size); /*----------------------------------------------------------- @@ -771,11 +804,11 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, * Loop over entries in row i2 of P_ext. *--------------------------------------------------------*/ - for (jj3=P_ext_diag_i[i2]; jj3 < P_ext_diag_i[i2+1]; jj3++) + for (jj3 = P_ext_diag_i[i2]; jj3 < P_ext_diag_i[i2 + 1]; jj3++) { i3 = P_ext_diag_j[jj3]; hypre_CSRBlockMatrixBlockMultAdd(r_a_products, - &(P_ext_diag_data[jj3*bnnz]), zero, + &(P_ext_diag_data[jj3 * bnnz]), zero, r_a_p_products, block_size); /*----------------------------------------------------- @@ -788,7 +821,7 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, { P_marker[i3] = jj_counter; for (kk = 0; kk < bnnz; kk++) - RAP_int_data[jj_counter*bnnz+kk] = + RAP_int_data[jj_counter * bnnz + kk] = r_a_p_products[kk]; RAP_int_j[jj_counter] = i3 + first_col_diag_P; jj_counter++; @@ -796,15 +829,15 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, else { for (kk = 0; kk < bnnz; kk++) - RAP_int_data[P_marker[i3]*bnnz+kk] += + RAP_int_data[P_marker[i3]*bnnz + kk] += r_a_p_products[kk]; } } - for (jj3=P_ext_offd_i[i2]; jj3 < P_ext_offd_i[i2+1]; jj3++) + for (jj3 = P_ext_offd_i[i2]; jj3 < P_ext_offd_i[i2 + 1]; jj3++) { i3 = P_ext_offd_j[jj3] + num_cols_diag_P; hypre_CSRBlockMatrixBlockMultAdd(r_a_products, - &(P_ext_offd_data[jj3*bnnz]), zero, + &(P_ext_offd_data[jj3 * bnnz]), zero, r_a_p_products, block_size); /*-------------------------------------------------- @@ -817,16 +850,16 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, { P_marker[i3] = jj_counter; for (kk = 0; kk < bnnz; kk++) - RAP_int_data[jj_counter*bnnz+kk] = + RAP_int_data[jj_counter * bnnz + kk] = r_a_p_products[kk]; RAP_int_j[jj_counter] - = col_map_offd_Pext[i3-num_cols_diag_P]; + = col_map_offd_Pext[i3 - num_cols_diag_P]; jj_counter++; } else { for (kk = 0; kk < bnnz; kk++) - RAP_int_data[P_marker[i3]*bnnz+kk] += + RAP_int_data[P_marker[i3]*bnnz + kk] += r_a_p_products[kk]; } } @@ -839,25 +872,27 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, else { - for (jj3=P_ext_diag_i[i2]; jj3 < P_ext_diag_i[i2+1]; jj3++) + for (jj3 = P_ext_diag_i[i2]; jj3 < P_ext_diag_i[i2 + 1]; jj3++) { i3 = P_ext_diag_j[jj3]; hypre_CSRBlockMatrixBlockMultAdd(r_a_products, - &(P_ext_diag_data[jj3*bnnz]), zero, + &(P_ext_diag_data[jj3 * bnnz]), zero, r_a_p_products, block_size); for (kk = 0; kk < bnnz; kk++) - RAP_int_data[P_marker[i3]*bnnz+kk] += + RAP_int_data[P_marker[i3]*bnnz + kk] += r_a_p_products[kk]; } - for (jj3=P_ext_offd_i[i2]; jj3 < P_ext_offd_i[i2+1]; jj3++) + for (jj3 = P_ext_offd_i[i2]; jj3 < P_ext_offd_i[i2 + 1]; jj3++) { i3 = P_ext_offd_j[jj3] + num_cols_diag_P; hypre_CSRBlockMatrixBlockMultAdd(r_a_products, - &(P_ext_offd_data[jj3*bnnz]), zero, + &(P_ext_offd_data[jj3 * bnnz]), zero, r_a_p_products, block_size); ind = P_marker[i3] * bnnz; for (kk = 0; kk < bnnz; kk++) + { RAP_int_data[ind++] += r_a_p_products[kk]; + } } } } @@ -866,11 +901,11 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, * Loop over entries in row i1 of A_diag. *--------------------------------------------------------------*/ - for (jj2 = A_diag_i[i1]; jj2 < A_diag_i[i1+1]; jj2++) + for (jj2 = A_diag_i[i1]; jj2 < A_diag_i[i1 + 1]; jj2++) { i2 = A_diag_j[jj2]; hypre_CSRBlockMatrixBlockMultAdd(r_entries, - &(A_diag_data[jj2*bnnz]), zero, r_a_products, + &(A_diag_data[jj2 * bnnz]), zero, r_a_products, block_size); /*----------------------------------------------------------- @@ -878,24 +913,24 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, * visited. New entries in RAP only occur from unmarked points. *-----------------------------------------------------------*/ - if (A_marker[i2+num_cols_offd_A] != ic) + if (A_marker[i2 + num_cols_offd_A] != ic) { /*-------------------------------------------------------- * Mark i2 as visited. *--------------------------------------------------------*/ - A_marker[i2+num_cols_offd_A] = ic; + A_marker[i2 + num_cols_offd_A] = ic; /*-------------------------------------------------------- * Loop over entries in row i2 of P_diag. *--------------------------------------------------------*/ - for (jj3 = P_diag_i[i2]; jj3 < P_diag_i[i2+1]; jj3++) + for (jj3 = P_diag_i[i2]; jj3 < P_diag_i[i2 + 1]; jj3++) { i3 = P_diag_j[jj3]; hypre_CSRBlockMatrixBlockMultAdd(r_a_products, - &(P_diag_data[jj3*bnnz]), zero, + &(P_diag_data[jj3 * bnnz]), zero, r_a_p_products, block_size); /*----------------------------------------------------- @@ -909,7 +944,9 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, P_marker[i3] = jj_counter; ind = jj_counter * bnnz; for (kk = 0; kk < bnnz; kk++) + { RAP_int_data[ind++] = r_a_p_products[kk]; + } RAP_int_j[jj_counter] = (HYPRE_BigInt)i3 + first_col_diag_P; jj_counter++; } @@ -917,14 +954,16 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, { ind = P_marker[i3] * bnnz; for (kk = 0; kk < bnnz; kk++) + { RAP_int_data[ind++] += r_a_p_products[kk]; + } } } - for (jj3 = P_offd_i[i2]; jj3 < P_offd_i[i2+1]; jj3++) + for (jj3 = P_offd_i[i2]; jj3 < P_offd_i[i2 + 1]; jj3++) { i3 = map_P_to_Pext[P_offd_j[jj3]] + num_cols_diag_P; hypre_CSRBlockMatrixBlockMultAdd(r_a_products, - &(P_offd_data[jj3*bnnz]), zero, + &(P_offd_data[jj3 * bnnz]), zero, r_a_p_products, block_size); /*----------------------------------------------------- @@ -938,16 +977,20 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, P_marker[i3] = jj_counter; ind = jj_counter * bnnz; for (kk = 0; kk < bnnz; kk++) + { RAP_int_data[ind++] = r_a_p_products[kk]; + } RAP_int_j[jj_counter] = - col_map_offd_Pext[i3-num_cols_diag_P]; + col_map_offd_Pext[i3 - num_cols_diag_P]; jj_counter++; } else { ind = P_marker[i3] * bnnz; for (kk = 0; kk < bnnz; kk++) + { RAP_int_data[ind++] += r_a_p_products[kk]; + } } } } @@ -959,37 +1002,43 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, else { - for (jj3 = P_diag_i[i2]; jj3 < P_diag_i[i2+1]; jj3++) + for (jj3 = P_diag_i[i2]; jj3 < P_diag_i[i2 + 1]; jj3++) { i3 = P_diag_j[jj3]; hypre_CSRBlockMatrixBlockMultAdd(r_a_products, - &(P_diag_data[jj3*bnnz]), zero, + &(P_diag_data[jj3 * bnnz]), zero, r_a_p_products, block_size); ind = P_marker[i3] * bnnz; for (kk = 0; kk < bnnz; kk++) + { RAP_int_data[ind++] += r_a_p_products[kk]; + } } - for (jj3 = P_offd_i[i2]; jj3 < P_offd_i[i2+1]; jj3++) + for (jj3 = P_offd_i[i2]; jj3 < P_offd_i[i2 + 1]; jj3++) { i3 = map_P_to_Pext[P_offd_j[jj3]] + num_cols_diag_P; hypre_CSRBlockMatrixBlockMultAdd(r_a_products, - &(P_offd_data[jj3*bnnz]), zero, + &(P_offd_data[jj3 * bnnz]), zero, r_a_p_products, block_size); ind = P_marker[i3] * bnnz; for (kk = 0; kk < bnnz; kk++) + { RAP_int_data[ind++] += r_a_p_products[kk]; + } } } } } } if (num_cols_offd_Pext || num_cols_diag_P) + { hypre_TFree(P_mark_array[ii], HYPRE_MEMORY_HOST); + } hypre_TFree(A_mark_array[ii], HYPRE_MEMORY_HOST); } - RAP_int = hypre_CSRBlockMatrixCreate(block_size,num_cols_offd_RT, - num_rows_offd_RT,RAP_size); + RAP_int = hypre_CSRBlockMatrixCreate(block_size, num_cols_offd_RT, + num_rows_offd_RT, RAP_size); hypre_CSRBlockMatrixI(RAP_int) = RAP_int_i; hypre_CSRBlockMatrixBigJ(RAP_int) = RAP_int_j; hypre_CSRBlockMatrixData(RAP_int) = RAP_int_data; @@ -999,7 +1048,7 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, RAP_ext_size = 0; if (num_sends_RT || num_recvs_RT) { - RAP_ext = hypre_ExchangeRAPBlockData(RAP_int,comm_pkg_RT, block_size); + RAP_ext = hypre_ExchangeRAPBlockData(RAP_int, comm_pkg_RT, block_size); RAP_ext_i = hypre_CSRBlockMatrixI(RAP_ext); RAP_ext_j = hypre_CSRBlockMatrixBigJ(RAP_ext); RAP_ext_data = hypre_CSRBlockMatrixData(RAP_ext); @@ -1011,11 +1060,11 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, RAP_int = NULL; } - RAP_diag_i = hypre_CTAlloc(HYPRE_Int, num_cols_diag_P+1, HYPRE_MEMORY_HOST); - RAP_offd_i = hypre_CTAlloc(HYPRE_Int, num_cols_diag_P+1, HYPRE_MEMORY_HOST); + RAP_diag_i = hypre_CTAlloc(HYPRE_Int, num_cols_diag_P + 1, HYPRE_MEMORY_HOST); + RAP_offd_i = hypre_CTAlloc(HYPRE_Int, num_cols_diag_P + 1, HYPRE_MEMORY_HOST); first_col_diag_RAP = first_col_diag_P; - last_col_diag_RAP = first_col_diag_P + (HYPRE_BigInt)num_cols_diag_P - 1; + last_col_diag_RAP = first_col_diag_P + (HYPRE_BigInt) num_cols_diag_P - 1; /*----------------------------------------------------------------------- * check for new nonzero columns in RAP_offd generated through RAP_ext @@ -1023,21 +1072,26 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, if (RAP_ext_size || num_cols_offd_Pext) { - temp = hypre_CTAlloc(HYPRE_BigInt, RAP_ext_size+num_cols_offd_Pext, HYPRE_MEMORY_HOST); + temp = hypre_CTAlloc(HYPRE_BigInt, RAP_ext_size + num_cols_offd_Pext, HYPRE_MEMORY_HOST); cnt = 0; - for (i=0; i < RAP_ext_size; i++) - if (RAP_ext_j[i] < first_col_diag_RAP - || RAP_ext_j[i] > last_col_diag_RAP) + for (i = 0; i < RAP_ext_size; i++) + { + if (RAP_ext_j[i] < first_col_diag_RAP || RAP_ext_j[i] > last_col_diag_RAP) + { temp[cnt++] = RAP_ext_j[i]; - for (i=0; i < num_cols_offd_Pext; i++) + } + } + for (i = 0; i < num_cols_offd_Pext; i++) + { temp[cnt++] = col_map_offd_Pext[i]; + } if (cnt) { - hypre_BigQsort0(temp,0,cnt-1); + hypre_BigQsort0(temp, 0, cnt - 1); value = temp[0]; num_cols_offd_RAP = 1; - for (i=1; i < cnt; i++) + for (i = 1; i < cnt; i++) { if (temp[i] > value) { @@ -1049,10 +1103,14 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, /* now evaluate col_map_offd_RAP */ if (num_cols_offd_RAP) - col_map_offd_RAP = hypre_CTAlloc(HYPRE_BigInt, num_cols_offd_RAP, HYPRE_MEMORY_HOST); + { + col_map_offd_RAP = hypre_CTAlloc(HYPRE_BigInt, num_cols_offd_RAP, HYPRE_MEMORY_HOST); + } - for (i=0 ; i < num_cols_offd_RAP; i++) + for (i = 0 ; i < num_cols_offd_RAP; i++) + { col_map_offd_RAP[i] = temp[i]; + } hypre_TFree(temp, HYPRE_MEMORY_HOST); } @@ -1062,12 +1120,14 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, map_P_to_RAP = hypre_CTAlloc(HYPRE_Int, num_cols_offd_P, HYPRE_MEMORY_HOST); cnt = 0; - for (i=0; i < num_cols_offd_RAP; i++) + for (i = 0; i < num_cols_offd_RAP; i++) + { if (col_map_offd_RAP[i] == col_map_offd_P[cnt]) { map_P_to_RAP[cnt++] = i; - if (cnt == num_cols_offd_P) break; + if (cnt == num_cols_offd_P) { break; } } + } } if (num_cols_offd_Pext) @@ -1075,57 +1135,65 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, map_Pext_to_RAP = hypre_CTAlloc(HYPRE_Int, num_cols_offd_Pext, HYPRE_MEMORY_HOST); cnt = 0; - for (i=0; i < num_cols_offd_RAP; i++) + for (i = 0; i < num_cols_offd_RAP; i++) + { if (col_map_offd_RAP[i] == col_map_offd_Pext[cnt]) { map_Pext_to_RAP[cnt++] = i; - if (cnt == num_cols_offd_Pext) break; + if (cnt == num_cols_offd_Pext) { break; } } + } } /*----------------------------------------------------------------------- * Convert RAP_ext column indices *-----------------------------------------------------------------------*/ - for (i=0; i < RAP_ext_size; i++) - if (RAP_ext_j[i] < first_col_diag_RAP - || RAP_ext_j[i] > last_col_diag_RAP) + for (i = 0; i < RAP_ext_size; i++) + { + if (RAP_ext_j[i] < first_col_diag_RAP || RAP_ext_j[i] > last_col_diag_RAP) + { RAP_ext_j[i] = (HYPRE_BigInt)(num_cols_diag_P) - + hypre_BigBinarySearch(col_map_offd_RAP, - RAP_ext_j[i],num_cols_offd_RAP); + + hypre_BigBinarySearch(col_map_offd_RAP, + RAP_ext_j[i], num_cols_offd_RAP); + } else + { RAP_ext_j[i] -= first_col_diag_RAP; + } + } /*----------------------------------------------------------------------- * Initialize some stuff. *-----------------------------------------------------------------------*/ - jj_cnt_diag = hypre_CTAlloc(HYPRE_Int, num_threads, HYPRE_MEMORY_HOST); - jj_cnt_offd = hypre_CTAlloc(HYPRE_Int, num_threads, HYPRE_MEMORY_HOST); + jj_cnt_diag = hypre_CTAlloc(HYPRE_Int, num_threads, HYPRE_MEMORY_HOST); + jj_cnt_offd = hypre_CTAlloc(HYPRE_Int, num_threads, HYPRE_MEMORY_HOST); for (ii = 0; ii < num_threads; ii++) { - size = num_cols_diag_P/num_threads; - rest = num_cols_diag_P - size*num_threads; + size = num_cols_diag_P / num_threads; + rest = num_cols_diag_P - size * num_threads; if (ii < rest) { - ns = ii*size+ii; - ne = (ii+1)*size+ii+1; + ns = ii * size + ii; + ne = (ii + 1) * size + ii + 1; } else { - ns = ii*size+rest; - ne = (ii+1)*size+rest; + ns = ii * size + rest; + ne = (ii + 1) * size + rest; } - P_mark_array[ii] = hypre_CTAlloc(HYPRE_Int, num_cols_diag_P+num_cols_offd_RAP, HYPRE_MEMORY_HOST); + P_mark_array[ii] = hypre_CTAlloc(HYPRE_Int, num_cols_diag_P + num_cols_offd_RAP, + HYPRE_MEMORY_HOST); A_mark_array[ii] = hypre_CTAlloc(HYPRE_Int, num_nz_cols_A, HYPRE_MEMORY_HOST); P_marker = P_mark_array[ii]; A_marker = A_mark_array[ii]; jj_count_diag = start_indexing; jj_count_offd = start_indexing; - for (ic = 0; ic < num_cols_diag_P+num_cols_offd_RAP; ic++) + for (ic = 0; ic < num_cols_diag_P + num_cols_offd_RAP; ic++) { P_marker[ic] = -1; } @@ -1151,11 +1219,13 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, jj_row_begin_offd = jj_count_offd; jj_count_diag++; - for (i=0; i < num_sends_RT; i++) - for (j = send_map_starts_RT[i]; j < send_map_starts_RT[i+1]; j++) + for (i = 0; i < num_sends_RT; i++) + { + for (j = send_map_starts_RT[i]; j < send_map_starts_RT[i + 1]; j++) + { if (send_map_elmts_RT[j] == ic) { - for (k=RAP_ext_i[j]; k < RAP_ext_i[j+1]; k++) + for (k = RAP_ext_i[j]; k < RAP_ext_i[j + 1]; k++) { jcol = (HYPRE_Int)RAP_ext_j[k]; if (jcol < num_cols_diag_P) @@ -1177,12 +1247,14 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, } break; } + } + } /*----------------------------------------------------------------- * Loop over entries in row ic of R_diag. *-----------------------------------------------------------------*/ - for (jj1 = R_diag_i[ic]; jj1 < R_diag_i[ic+1]; jj1++) + for (jj1 = R_diag_i[ic]; jj1 < R_diag_i[ic + 1]; jj1++) { i1 = R_diag_j[jj1]; @@ -1192,7 +1264,7 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, if (num_cols_offd_A) { - for (jj2 = A_offd_i[i1]; jj2 < A_offd_i[i1+1]; jj2++) + for (jj2 = A_offd_i[i1]; jj2 < A_offd_i[i1 + 1]; jj2++) { i2 = A_offd_j[jj2]; @@ -1213,7 +1285,7 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, * Loop over entries in row i2 of P_ext. *--------------------------------------------------------*/ - for (jj3=P_ext_diag_i[i2]; jj3 < P_ext_diag_i[i2+1]; jj3++) + for (jj3 = P_ext_diag_i[i2]; jj3 < P_ext_diag_i[i2 + 1]; jj3++) { i3 = P_ext_diag_j[jj3]; @@ -1229,9 +1301,9 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, jj_count_diag++; } } - for (jj3=P_ext_offd_i[i2]; jj3 < P_ext_offd_i[i2+1]; jj3++) + for (jj3 = P_ext_offd_i[i2]; jj3 < P_ext_offd_i[i2 + 1]; jj3++) { - i3 = map_Pext_to_RAP[P_ext_offd_j[jj3]]+num_cols_diag_P; + i3 = map_Pext_to_RAP[P_ext_offd_j[jj3]] + num_cols_diag_P; /*----------------------------------------------------- * Check P_marker to see that RAP_{ic,i3} has not @@ -1253,7 +1325,7 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, * Loop over entries in row i1 of A_diag. *-----------------------------------------------------------------*/ - for (jj2 = A_diag_i[i1]; jj2 < A_diag_i[i1+1]; jj2++) + for (jj2 = A_diag_i[i1]; jj2 < A_diag_i[i1 + 1]; jj2++) { i2 = A_diag_j[jj2]; @@ -1262,20 +1334,20 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, * visited. New entries in RAP only occur from unmarked points. *--------------------------------------------------------------*/ - if (A_marker[i2+num_cols_offd_A] != ic) + if (A_marker[i2 + num_cols_offd_A] != ic) { /*----------------------------------------------------------- * Mark i2 as visited. *-----------------------------------------------------------*/ - A_marker[i2+num_cols_offd_A] = ic; + A_marker[i2 + num_cols_offd_A] = ic; /*----------------------------------------------------------- * Loop over entries in row i2 of P_diag. *-----------------------------------------------------------*/ - for (jj3 = P_diag_i[i2]; jj3 < P_diag_i[i2+1]; jj3++) + for (jj3 = P_diag_i[i2]; jj3 < P_diag_i[i2 + 1]; jj3++) { i3 = P_diag_j[jj3]; @@ -1298,7 +1370,7 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, if (num_cols_offd_P) { - for (jj3 = P_offd_i[i2]; jj3 < P_offd_i[i2+1]; jj3++) + for (jj3 = P_offd_i[i2]; jj3 < P_offd_i[i2 + 1]; jj3++) { i3 = map_P_to_RAP[P_offd_j[jj3]] + num_cols_diag_P; @@ -1327,14 +1399,14 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, jj_cnt_offd[ii] = jj_count_offd; } - for (i=0; i < num_threads-1; i++) + for (i = 0; i < num_threads - 1; i++) { - jj_cnt_diag[i+1] += jj_cnt_diag[i]; - jj_cnt_offd[i+1] += jj_cnt_offd[i]; + jj_cnt_diag[i + 1] += jj_cnt_diag[i]; + jj_cnt_offd[i + 1] += jj_cnt_offd[i]; } - jj_count_diag = jj_cnt_diag[num_threads-1]; - jj_count_offd = jj_cnt_offd[num_threads-1]; + jj_count_diag = jj_cnt_diag[num_threads - 1]; + jj_count_offd = jj_cnt_offd[num_threads - 1]; RAP_diag_i[num_cols_diag_P] = jj_count_diag; RAP_offd_i[num_cols_diag_P] = jj_count_offd; @@ -1347,14 +1419,14 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, RAP_diag_size = jj_count_diag; if (RAP_diag_size) { - RAP_diag_data = hypre_CTAlloc(HYPRE_Complex, RAP_diag_size*bnnz, HYPRE_MEMORY_HOST); + RAP_diag_data = hypre_CTAlloc(HYPRE_Complex, RAP_diag_size * bnnz, HYPRE_MEMORY_HOST); RAP_diag_j = hypre_CTAlloc(HYPRE_Int, RAP_diag_size, HYPRE_MEMORY_HOST); } RAP_offd_size = jj_count_offd; if (RAP_offd_size) { - RAP_offd_data = hypre_CTAlloc(HYPRE_Complex, RAP_offd_size*bnnz, HYPRE_MEMORY_HOST); + RAP_offd_data = hypre_CTAlloc(HYPRE_Complex, RAP_offd_size * bnnz, HYPRE_MEMORY_HOST); RAP_offd_j = hypre_CTAlloc(HYPRE_Int, RAP_offd_size, HYPRE_MEMORY_HOST); } @@ -1371,17 +1443,17 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, for (ii = 0; ii < num_threads; ii++) { - size = num_cols_diag_P/num_threads; - rest = num_cols_diag_P - size*num_threads; + size = num_cols_diag_P / num_threads; + rest = num_cols_diag_P - size * num_threads; if (ii < rest) { - ns = ii*size+ii; - ne = (ii+1)*size+ii+1; + ns = ii * size + ii; + ne = (ii + 1) * size + ii + 1; } else { - ns = ii*size+rest; - ne = (ii+1)*size+rest; + ns = ii * size + rest; + ne = (ii + 1) * size + rest; } /*----------------------------------------------------------------------- @@ -1390,7 +1462,7 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, P_marker = P_mark_array[ii]; A_marker = A_mark_array[ii]; - for (ic = 0; ic < num_cols_diag_P+num_cols_offd_RAP; ic++) + for (ic = 0; ic < num_cols_diag_P + num_cols_offd_RAP; ic++) { P_marker[ic] = -1; } @@ -1403,8 +1475,8 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, jj_count_offd = start_indexing; if (ii > 0) { - jj_count_diag = jj_cnt_diag[ii-1]; - jj_count_offd = jj_cnt_offd[ii-1]; + jj_count_diag = jj_cnt_diag[ii - 1]; + jj_count_offd = jj_cnt_offd[ii - 1]; } /*----------------------------------------------------------------------- @@ -1413,7 +1485,6 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, for (ic = ns; ic < ne; ic++) { - /*-------------------------------------------------------------------- * Create diagonal entry, RAP_{ic,ic} and add entries of RAP_ext *--------------------------------------------------------------------*/ @@ -1425,17 +1496,21 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, RAP_offd_i[ic] = jj_row_begin_offd; ind = jj_count_diag * bnnz; for (kk = 0; kk < bnnz; kk++) + { RAP_diag_data[ind++] = zero; + } RAP_diag_j[jj_count_diag] = ic; jj_count_diag++; - for (i=0; i < num_sends_RT; i++) - for (j = send_map_starts_RT[i]; j < send_map_starts_RT[i+1]; j++) + for (i = 0; i < num_sends_RT; i++) + { + for (j = send_map_starts_RT[i]; j < send_map_starts_RT[i + 1]; j++) + { if (send_map_elmts_RT[j] == ic) { - for (k=RAP_ext_i[j]; k < RAP_ext_i[j+1]; k++) + for (k = RAP_ext_i[j]; k < RAP_ext_i[j + 1]; k++) { - jcol = (HYPRE_Int)RAP_ext_j[k]; + jcol = (HYPRE_Int) RAP_ext_j[k]; if (jcol < num_cols_diag_P) { if (P_marker[jcol] < jj_row_begin_diag) @@ -1443,7 +1518,9 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, P_marker[jcol] = jj_count_diag; ind = jj_count_diag * bnnz; for (kk = 0; kk < bnnz; kk++) - RAP_diag_data[ind++] = RAP_ext_data[k*bnnz+kk]; + { + RAP_diag_data[ind++] = RAP_ext_data[k * bnnz + kk]; + } RAP_diag_j[jj_count_diag] = jcol; jj_count_diag++; } @@ -1451,7 +1528,9 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, { ind = P_marker[jcol] * bnnz; for (kk = 0; kk < bnnz; kk++) - RAP_diag_data[ind++] += RAP_ext_data[k*bnnz+kk]; + { + RAP_diag_data[ind++] += RAP_ext_data[k * bnnz + kk]; + } } } else @@ -1461,30 +1540,36 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, P_marker[jcol] = jj_count_offd; ind = jj_count_offd * bnnz; for (kk = 0; kk < bnnz; kk++) - RAP_offd_data[ind++] = RAP_ext_data[k*bnnz+kk]; + { + RAP_offd_data[ind++] = RAP_ext_data[k * bnnz + kk]; + } RAP_offd_j[jj_count_offd] - = jcol-num_cols_diag_P; + = jcol - num_cols_diag_P; jj_count_offd++; } else { ind = P_marker[jcol] * bnnz; for (kk = 0; kk < bnnz; kk++) - RAP_offd_data[ind++] += RAP_ext_data[k*bnnz+kk]; + { + RAP_offd_data[ind++] += RAP_ext_data[k * bnnz + kk]; + } } } } break; } + } + } /*-------------------------------------------------------------------- * Loop over entries in row ic of R_diag. *--------------------------------------------------------------------*/ - for (jj1 = R_diag_i[ic]; jj1 < R_diag_i[ic+1]; jj1++) + for (jj1 = R_diag_i[ic]; jj1 < R_diag_i[ic + 1]; jj1++) { i1 = R_diag_j[jj1]; - r_entries = &(R_diag_data[jj1*bnnz]); + r_entries = &(R_diag_data[jj1 * bnnz]); /*----------------------------------------------------------------- * Loop over entries in row i1 of A_offd. @@ -1492,11 +1577,11 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, if (num_cols_offd_A) { - for (jj2 = A_offd_i[i1]; jj2 < A_offd_i[i1+1]; jj2++) + for (jj2 = A_offd_i[i1]; jj2 < A_offd_i[i1 + 1]; jj2++) { i2 = A_offd_j[jj2]; hypre_CSRBlockMatrixBlockMultAdd(r_entries, - &(A_offd_data[jj2*bnnz]), zero, r_a_products, + &(A_offd_data[jj2 * bnnz]), zero, r_a_products, block_size); /*----------------------------------------------------------- @@ -1516,11 +1601,11 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, * Loop over entries in row i2 of P_ext. *--------------------------------------------------------*/ - for (jj3=P_ext_diag_i[i2]; jj3 < P_ext_diag_i[i2+1]; jj3++) + for (jj3 = P_ext_diag_i[i2]; jj3 < P_ext_diag_i[i2 + 1]; jj3++) { i3 = P_ext_diag_j[jj3]; hypre_CSRBlockMatrixBlockMultAdd(r_a_products, - &(P_ext_diag_data[jj3*bnnz]), zero, + &(P_ext_diag_data[jj3 * bnnz]), zero, r_a_p_products, block_size); /*----------------------------------------------------- @@ -1534,7 +1619,9 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, P_marker[i3] = jj_count_diag; ind = jj_count_diag * bnnz; for (kk = 0; kk < bnnz; kk++) + { RAP_diag_data[ind++] = r_a_p_products[kk]; + } RAP_diag_j[jj_count_diag] = i3; jj_count_diag++; } @@ -1542,14 +1629,16 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, { ind = P_marker[i3] * bnnz; for (kk = 0; kk < bnnz; kk++) + { RAP_diag_data[ind++] += r_a_p_products[kk]; + } } } - for (jj3=P_ext_offd_i[i2]; jj3 < P_ext_offd_i[i2+1]; jj3++) + for (jj3 = P_ext_offd_i[i2]; jj3 < P_ext_offd_i[i2 + 1]; jj3++) { - i3 = map_Pext_to_RAP[P_ext_offd_j[jj3]]+num_cols_diag_P; + i3 = map_Pext_to_RAP[P_ext_offd_j[jj3]] + num_cols_diag_P; hypre_CSRBlockMatrixBlockMultAdd(r_a_products, - &(P_ext_offd_data[jj3*bnnz]), + &(P_ext_offd_data[jj3 * bnnz]), zero, r_a_p_products, block_size); /*----------------------------------------------------- @@ -1562,7 +1651,9 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, P_marker[i3] = jj_count_offd; ind = jj_count_offd * bnnz; for (kk = 0; kk < bnnz; kk++) + { RAP_offd_data[ind++] = r_a_p_products[kk]; + } RAP_offd_j[jj_count_offd] = i3 - num_cols_diag_P; jj_count_offd++; } @@ -1570,7 +1661,9 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, { ind = P_marker[i3] * bnnz; for (kk = 0; kk < bnnz; kk++) + { RAP_offd_data[ind++] += r_a_p_products[kk]; + } } } } @@ -1581,25 +1674,29 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, *-----------------------------------------------------------*/ else { - for (jj3=P_ext_diag_i[i2]; jj3 < P_ext_diag_i[i2+1]; jj3++) + for (jj3 = P_ext_diag_i[i2]; jj3 < P_ext_diag_i[i2 + 1]; jj3++) { i3 = P_ext_diag_j[jj3]; hypre_CSRBlockMatrixBlockMultAdd(r_a_products, - &(P_ext_diag_data[jj3*bnnz]), zero, + &(P_ext_diag_data[jj3 * bnnz]), zero, r_a_p_products, block_size); ind = P_marker[i3] * bnnz; for (kk = 0; kk < bnnz; kk++) + { RAP_diag_data[ind++] += r_a_p_products[kk]; + } } - for (jj3=P_ext_offd_i[i2]; jj3 < P_ext_offd_i[i2+1]; jj3++) + for (jj3 = P_ext_offd_i[i2]; jj3 < P_ext_offd_i[i2 + 1]; jj3++) { - i3=map_Pext_to_RAP[P_ext_offd_j[jj3]] + num_cols_diag_P; + i3 = map_Pext_to_RAP[P_ext_offd_j[jj3]] + num_cols_diag_P; hypre_CSRBlockMatrixBlockMultAdd(r_a_products, - &(P_ext_offd_data[jj3*bnnz]), + &(P_ext_offd_data[jj3 * bnnz]), zero, r_a_p_products, block_size); ind = P_marker[i3] * bnnz; for (kk = 0; kk < bnnz; kk++) + { RAP_offd_data[ind++] += r_a_p_products[kk]; + } } } } @@ -1609,11 +1706,11 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, * Loop over entries in row i1 of A_diag. *-----------------------------------------------------------------*/ - for (jj2 = A_diag_i[i1]; jj2 < A_diag_i[i1+1]; jj2++) + for (jj2 = A_diag_i[i1]; jj2 < A_diag_i[i1 + 1]; jj2++) { i2 = A_diag_j[jj2]; hypre_CSRBlockMatrixBlockMultAdd(r_entries, - &(A_diag_data[jj2*bnnz]), + &(A_diag_data[jj2 * bnnz]), zero, r_a_products, block_size); /*-------------------------------------------------------------- @@ -1621,24 +1718,24 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, * visited. New entries in RAP only occur from unmarked points. *--------------------------------------------------------------*/ - if (A_marker[i2+num_cols_offd_A] != ic) + if (A_marker[i2 + num_cols_offd_A] != ic) { /*----------------------------------------------------------- * Mark i2 as visited. *-----------------------------------------------------------*/ - A_marker[i2+num_cols_offd_A] = ic; + A_marker[i2 + num_cols_offd_A] = ic; /*----------------------------------------------------------- * Loop over entries in row i2 of P_diag. *-----------------------------------------------------------*/ - for (jj3 = P_diag_i[i2]; jj3 < P_diag_i[i2+1]; jj3++) + for (jj3 = P_diag_i[i2]; jj3 < P_diag_i[i2 + 1]; jj3++) { i3 = P_diag_j[jj3]; hypre_CSRBlockMatrixBlockMultAdd(r_a_products, - &(P_diag_data[jj3*bnnz]), + &(P_diag_data[jj3 * bnnz]), zero, r_a_p_products, block_size); /*-------------------------------------------------------- @@ -1652,7 +1749,9 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, P_marker[i3] = jj_count_diag; ind = jj_count_diag * bnnz; for (kk = 0; kk < bnnz; kk++) + { RAP_diag_data[ind++] = r_a_p_products[kk]; + } RAP_diag_j[jj_count_diag] = P_diag_j[jj3]; jj_count_diag++; } @@ -1660,16 +1759,18 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, { ind = P_marker[i3] * bnnz; for (kk = 0; kk < bnnz; kk++) + { RAP_diag_data[ind++] += r_a_p_products[kk]; + } } } if (num_cols_offd_P) { - for (jj3 = P_offd_i[i2]; jj3 < P_offd_i[i2+1]; jj3++) + for (jj3 = P_offd_i[i2]; jj3 < P_offd_i[i2 + 1]; jj3++) { i3 = map_P_to_RAP[P_offd_j[jj3]] + num_cols_diag_P; hypre_CSRBlockMatrixBlockMultAdd(r_a_products, - &(P_offd_data[jj3*bnnz]), + &(P_offd_data[jj3 * bnnz]), zero, r_a_p_products, block_size); /*----------------------------------------------------- @@ -1683,7 +1784,9 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, P_marker[i3] = jj_count_offd; ind = jj_count_offd * bnnz; for (kk = 0; kk < bnnz; kk++) + { RAP_offd_data[ind++] = r_a_p_products[kk]; + } RAP_offd_j[jj_count_offd] = i3 - num_cols_diag_P; jj_count_offd++; } @@ -1691,7 +1794,9 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, { ind = P_marker[i3] * bnnz; for (kk = 0; kk < bnnz; kk++) + { RAP_offd_data[ind++] += r_a_p_products[kk]; + } } } } @@ -1704,27 +1809,31 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, else { - for (jj3 = P_diag_i[i2]; jj3 < P_diag_i[i2+1]; jj3++) + for (jj3 = P_diag_i[i2]; jj3 < P_diag_i[i2 + 1]; jj3++) { i3 = P_diag_j[jj3]; hypre_CSRBlockMatrixBlockMultAdd(r_a_products, - &(P_diag_data[jj3*bnnz]), + &(P_diag_data[jj3 * bnnz]), zero, r_a_p_products, block_size); ind = P_marker[i3] * bnnz; for (kk = 0; kk < bnnz; kk++) + { RAP_diag_data[ind++] += r_a_p_products[kk]; + } } if (num_cols_offd_P) { - for (jj3 = P_offd_i[i2]; jj3 < P_offd_i[i2+1]; jj3++) + for (jj3 = P_offd_i[i2]; jj3 < P_offd_i[i2 + 1]; jj3++) { i3 = map_P_to_RAP[P_offd_j[jj3]] + num_cols_diag_P; hypre_CSRBlockMatrixBlockMultAdd(r_a_products, - &(P_offd_data[jj3*bnnz]), + &(P_offd_data[jj3 * bnnz]), zero, r_a_p_products, block_size); ind = P_marker[i3] * bnnz; for (kk = 0; kk < bnnz; kk++) + { RAP_offd_data[ind++] += r_a_p_products[kk]; + } } } } @@ -1736,9 +1845,7 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, } - row_starts = hypre_CTAlloc(HYPRE_BigInt, 2, HYPRE_MEMORY_HOST); - col_starts = hypre_CTAlloc(HYPRE_BigInt, 2, HYPRE_MEMORY_HOST); - for (i = 0; i <= 1; i++) + for (i = 0; i < 2; i++) { row_starts[i] = col_starts[i] = coarse_partitioning[i]; } @@ -1815,10 +1922,8 @@ hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, hypre_TFree(P_ext_offd_j, HYPRE_MEMORY_HOST); } - hypre_TFree(r_a_products,HYPRE_MEMORY_HOST); - hypre_TFree(r_a_p_products,HYPRE_MEMORY_HOST); - hypre_TFree(row_starts,HYPRE_MEMORY_HOST); - hypre_TFree(col_starts,HYPRE_MEMORY_HOST); + hypre_TFree(r_a_products, HYPRE_MEMORY_HOST); + hypre_TFree(r_a_p_products, HYPRE_MEMORY_HOST); return hypre_error_flag; } diff --git a/external/hypre/src/parcsr_block_mv/par_csr_block_rap_communication.c b/external/hypre/src/parcsr_block_mv/par_csr_block_rap_communication.c index 135e58b2..5c6ef688 100644 --- a/external/hypre/src/parcsr_block_mv/par_csr_block_rap_communication.c +++ b/external/hypre/src/parcsr_block_mv/par_csr_block_rap_communication.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,9 +17,9 @@ the commpkg is not different for a block matrix.) */ HYPRE_Int hypre_GetCommPkgBlockRTFromCommPkgBlockA( hypre_ParCSRBlockMatrix *RT, - hypre_ParCSRBlockMatrix *A, - HYPRE_Int *tmp_map_offd, - HYPRE_BigInt *fine_to_coarse_offd) + hypre_ParCSRBlockMatrix *A, + HYPRE_Int *tmp_map_offd, + HYPRE_BigInt *fine_to_coarse_offd) { MPI_Comm comm = hypre_ParCSRBlockMatrixComm(RT); hypre_ParCSRCommPkg *comm_pkg_A = hypre_ParCSRBlockMatrixCommPkg(A); @@ -29,15 +29,15 @@ hypre_GetCommPkgBlockRTFromCommPkgBlockA( hypre_ParCSRBlockMatrix *RT, HYPRE_Int num_sends_A = hypre_ParCSRCommPkgNumSends(comm_pkg_A); HYPRE_Int *send_procs_A = hypre_ParCSRCommPkgSendProcs(comm_pkg_A); - hypre_ParCSRCommPkg *comm_pkg; + hypre_ParCSRCommPkg *comm_pkg = NULL; HYPRE_Int num_recvs_RT; - HYPRE_Int *recv_procs_RT; - HYPRE_Int *recv_vec_starts_RT; + HYPRE_Int *recv_procs_RT; + HYPRE_Int *recv_vec_starts_RT; HYPRE_Int num_sends_RT; - HYPRE_Int *send_procs_RT; - HYPRE_Int *send_map_starts_RT; - HYPRE_Int *send_map_elmts_RT; - HYPRE_BigInt *send_big_elmts = NULL; + HYPRE_Int *send_procs_RT; + HYPRE_Int *send_map_starts_RT; + HYPRE_Int *send_map_elmts_RT; + HYPRE_BigInt *send_big_elmts = NULL; HYPRE_BigInt *col_map_offd_RT = hypre_ParCSRBlockMatrixColMapOffd(RT); HYPRE_Int num_cols_offd_RT = hypre_CSRBlockMatrixNumCols( hypre_ParCSRMatrixOffd(RT)); @@ -46,159 +46,165 @@ hypre_GetCommPkgBlockRTFromCommPkgBlockA( hypre_ParCSRBlockMatrix *RT, HYPRE_Int i, j; HYPRE_Int vec_len, vec_start; HYPRE_Int num_procs, my_id; - HYPRE_Int ierr = 0; HYPRE_Int num_requests; HYPRE_Int offd_col, proc_num; - + HYPRE_Int *proc_mark; HYPRE_Int *change_array; hypre_MPI_Request *requests; hypre_MPI_Status *status; - hypre_MPI_Comm_size(comm,&num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); -/*-------------------------------------------------------------------------- - * determine num_recvs, recv_procs and recv_vec_starts for RT - *--------------------------------------------------------------------------*/ + /*-------------------------------------------------------------------------- + * determine num_recvs, recv_procs and recv_vec_starts for RT + *--------------------------------------------------------------------------*/ proc_mark = hypre_CTAlloc(HYPRE_Int, num_recvs_A, HYPRE_MEMORY_HOST); - for (i=0; i < num_recvs_A; i++) - proc_mark[i] = 0; + for (i = 0; i < num_recvs_A; i++) + { + proc_mark[i] = 0; + } proc_num = 0; num_recvs_RT = 0; if (num_cols_offd_RT) { - for (i=0; i < num_recvs_A; i++) + for (i = 0; i < num_recvs_A; i++) { - for (j=recv_vec_starts_A[i]; j 1) { - hypre_ParCSRBlockCommHandleDestroy(comm_handle); /* now Vext_data - is populated */ + hypre_ParCSRBlockCommHandleDestroy(comm_handle); /* now Vext_data is populated */ comm_handle = NULL; } /*----------------------------------------------------------------- @@ -261,24 +260,24 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, * If diagonal is nonzero, relax point i; otherwise, skip it. *-----------------------------------------------------------*/ - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - res_vec[k] = f_data[i*block_size+k]; + res_vec[k] = f_data[i * block_size + k]; } - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) { ii = A_diag_j[jj]; /* res -= A_diag_data[jj] * Vtemp_data[ii]; */ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj*bnnz], - &Vtemp_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj * bnnz], + &Vtemp_data[ii * block_size], 1.0, res_vec, block_size); } - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { ii = A_offd_j[jj]; /* res -= A_offd_data[jj] * Vext_data[ii]; */ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj*bnnz], - &Vext_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj * bnnz], + &Vext_data[ii * block_size], 1.0, res_vec, block_size); } @@ -286,10 +285,10 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, if (hypre_CSRBlockMatrixBlockInvMatvec( &A_diag_data[A_diag_i[i]*bnnz], res_vec, out_vec, block_size) == 0) { - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - u_data[i*block_size+k] *= one_minus_weight; - u_data[i*block_size+k] += relax_weight *out_vec[k]; + u_data[i * block_size + k] *= one_minus_weight; + u_data[i * block_size + k] += relax_weight * out_vec[k]; } } @@ -313,24 +312,24 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, if (cf_marker[i] == relax_points) { - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - res_vec[k] = f_data[i*block_size+k]; + res_vec[k] = f_data[i * block_size + k]; } - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) { ii = A_diag_j[jj]; /* res -= A_diag_data[jj] * Vtemp_data[ii]; */ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj*bnnz], - &Vtemp_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj * bnnz], + &Vtemp_data[ii * block_size], 1.0, res_vec, block_size); } - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { ii = A_offd_j[jj]; /* res -= A_offd_data[jj] * Vext_data[ii]; */ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj*bnnz], - &Vext_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj * bnnz], + &Vext_data[ii * block_size], 1.0, res_vec, block_size); } @@ -338,10 +337,10 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, if (hypre_CSRBlockMatrixBlockInvMatvec( &A_diag_data[A_diag_i[i]*bnnz], res_vec, out_vec, block_size) == 0) { - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - u_data[i*block_size+k] *= one_minus_weight; - u_data[i*block_size+k] += relax_weight *out_vec[k]; + u_data[i * block_size + k] *= one_minus_weight; + u_data[i * block_size + k] += relax_weight * out_vec[k]; } } @@ -356,19 +355,19 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, break; - } /* end case 20 */ + } /* end case 20 */ -/*--------------------------------------------------------------------------- - Hybrid: G-S on proc. and Jacobi off proc. - ---------------------------------------------------------------------------*/ + /*--------------------------------------------------------------------------- + Hybrid: G-S on proc. and Jacobi off proc. + ---------------------------------------------------------------------------*/ case 23: { if (num_procs > 1) { num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); v_buf_data = hypre_CTAlloc(HYPRE_Real, - hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends)*block_size, HYPRE_MEMORY_HOST); - Vext_data = hypre_CTAlloc(HYPRE_Real, num_cols_offd*block_size, HYPRE_MEMORY_HOST); + hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends) * block_size, HYPRE_MEMORY_HOST); + Vext_data = hypre_CTAlloc(HYPRE_Real, num_cols_offd * block_size, HYPRE_MEMORY_HOST); if (num_cols_offd) { A_offd_j = hypre_CSRBlockMatrixJ(A_offd); @@ -378,12 +377,12 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j=start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { for (k = 0; k < block_size; k++) { v_buf_data[index++] - = u_data[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)*block_size + k]; + = u_data[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j) * block_size + k]; } } } @@ -399,15 +398,14 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, *-----------------------------------------------------------------*/ - for (i = 0; i < n*block_size; i++) + for (i = 0; i < n * block_size; i++) { Vtemp_data[i] = u_data[i]; } if (num_procs > 1) { - hypre_ParCSRBlockCommHandleDestroy(comm_handle); /* now Vext_data - is populated */ + hypre_ParCSRBlockCommHandleDestroy(comm_handle); /* now Vext_data is populated */ comm_handle = NULL; } @@ -429,21 +427,23 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, tmp_data = hypre_CTAlloc(HYPRE_Real, n, HYPRE_MEMORY_HOST); for (i = 0; i < n; i++) + { tmp_data[i] = u_data[i]; + } for (j = 0; j < num_threads; j++) { - size = n/num_threads; - rest = n - size*num_threads; + size = n / num_threads; + rest = n - size * num_threads; if (j < rest) { - ns = j*size+j; - ne = (j+1)*size+j+1; + ns = j * size + j; + ne = (j + 1) * size + j + 1; } else { - ns = j*size+rest; - ne = (j+1)*size+rest; + ns = j * size + rest; + ne = (j + 1) * size + rest; } for (i = ns; i < ne; i++) /* interior points first */ { @@ -451,34 +451,34 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, * If diagonal is nonzero, relax point i; otherwise, skip it. *-----------------------------------------------------------*/ - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - res_vec[k] = f_data[i*block_size+k]; + res_vec[k] = f_data[i * block_size + k]; } - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) { ii = A_diag_j[jj]; if (ii >= ns && ii < ne) { /* res -= A_diag_data[jj] * u_data[ii]; */ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj*bnnz], - &u_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj * bnnz], + &u_data[ii * block_size], 1.0, res_vec, block_size); } else { /* res -= A_diag_data[jj] * tmp_data[ii]; */ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj*bnnz], - &tmp_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj * bnnz], + &tmp_data[ii * block_size], 1.0, res_vec, block_size); } } - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { ii = A_offd_j[jj]; /* res -= A_offd_data[jj] * Vext_data[ii];*/ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj*bnnz], - &Vext_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj * bnnz], + &Vext_data[ii * block_size], 1.0, res_vec, block_size); } @@ -487,9 +487,9 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, if (hypre_CSRBlockMatrixBlockInvMatvec( &A_diag_data[A_diag_i[i]*bnnz], res_vec, out_vec, block_size) == 0) { - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - u_data[i*block_size+k] = out_vec[k]; + u_data[i * block_size + k] = out_vec[k]; } } } /* for loop over points */ @@ -504,33 +504,33 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, /*----------------------------------------------------------- * If diagonal is nonzero, relax point i; otherwise, skip it. *-----------------------------------------------------------*/ - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - res_vec[k] = f_data[i*block_size+k]; + res_vec[k] = f_data[i * block_size + k]; } - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) { ii = A_diag_j[jj]; /* res -= A_diag_data[jj] * u_data[ii]; */ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj*bnnz], - &u_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj * bnnz], + &u_data[ii * block_size], 1.0, res_vec, block_size); } - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { ii = A_offd_j[jj]; /* res -= A_offd_data[jj] * Vext_data[ii]; */ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj*bnnz], - &Vext_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj * bnnz], + &Vext_data[ii * block_size], 1.0, res_vec, block_size); } /* u_data[i] = res / A_diag_data[A_diag_i[i]]; */ if (hypre_CSRBlockMatrixBlockInvMatvec( &A_diag_data[A_diag_i[i]*bnnz], res_vec, out_vec, block_size) == 0) { - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - u_data[i*block_size+k] = out_vec[k]; + u_data[i * block_size + k] = out_vec[k]; } } } /* for loop over points */ @@ -547,21 +547,23 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, tmp_data = hypre_CTAlloc(HYPRE_Real, n, HYPRE_MEMORY_HOST); for (i = 0; i < n; i++) + { tmp_data[i] = u_data[i]; + } for (j = 0; j < num_threads; j++) { - size = n/num_threads; - rest = n - size*num_threads; + size = n / num_threads; + rest = n - size * num_threads; if (j < rest) { - ns = j*size+j; - ne = (j+1)*size+j+1; + ns = j * size + j; + ne = (j + 1) * size + j + 1; } else { - ns = j*size+rest; - ne = (j+1)*size+rest; + ns = j * size + rest; + ne = (j + 1) * size + rest; } for (i = ns; i < ne; i++) /* relax interior points */ { @@ -571,34 +573,34 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, *-----------------------------------------------------------*/ if (cf_marker[i] == relax_points ) { - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - res_vec[k] = f_data[i*block_size+k]; + res_vec[k] = f_data[i * block_size + k]; } - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) { ii = A_diag_j[jj]; if (ii >= ns && ii < ne) { /* res -= A_diag_data[jj] * u_data[ii]; */ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj*bnnz], - &u_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj * bnnz], + &u_data[ii * block_size], 1.0, res_vec, block_size); } else { /* res -= A_diag_data[jj] * tmp_data[ii]; */ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj*bnnz], - &tmp_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj * bnnz], + &tmp_data[ii * block_size], 1.0, res_vec, block_size); } } - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { ii = A_offd_j[jj]; /* res -= A_offd_data[jj] * Vext_data[ii];*/ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj*bnnz], - &Vext_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj * bnnz], + &Vext_data[ii * block_size], 1.0, res_vec, block_size); } @@ -607,9 +609,9 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, if (hypre_CSRBlockMatrixBlockInvMatvec( &A_diag_data[A_diag_i[i]*bnnz], res_vec, out_vec, block_size) == 0) { - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - u_data[i*block_size+k] = out_vec[k]; + u_data[i * block_size + k] = out_vec[k]; } } } @@ -627,24 +629,24 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, *-----------------------------------------------------------*/ if (cf_marker[i] == relax_points ) { - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - res_vec[k] = f_data[i*block_size+k]; + res_vec[k] = f_data[i * block_size + k]; } - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) { ii = A_diag_j[jj]; /* res -= A_diag_data[jj] * u_data[ii]; */ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj*bnnz], - &u_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj * bnnz], + &u_data[ii * block_size], 1.0, res_vec, block_size); } - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { ii = A_offd_j[jj]; /* res -= A_offd_data[jj] * Vext_data[ii];*/ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj*bnnz], - &Vext_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj * bnnz], + &Vext_data[ii * block_size], 1.0, res_vec, block_size); } @@ -653,9 +655,9 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, if (hypre_CSRBlockMatrixBlockInvMatvec( &A_diag_data[A_diag_i[i]*bnnz], res_vec, out_vec, block_size) == 0) { - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - u_data[i*block_size+k] = out_vec[k]; + u_data[i * block_size + k] = out_vec[k]; } } } @@ -668,7 +670,7 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, /*----------------------------------------------------------------- * relax weight and omega do not = 1 *-----------------------------------------------------------------*/ - prod = (1.0-relax_weight*omega); + prod = (1.0 - relax_weight * omega); res0_vec = hypre_CTAlloc(HYPRE_Real, block_size, HYPRE_MEMORY_HOST); res2_vec = hypre_CTAlloc(HYPRE_Real, block_size, HYPRE_MEMORY_HOST); @@ -682,76 +684,78 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, { tmp_data = hypre_CTAlloc(HYPRE_Real, n, HYPRE_MEMORY_HOST); for (i = 0; i < n; i++) + { tmp_data[i] = u_data[i]; + } for (j = 0; j < num_threads; j++) { - size = n/num_threads; - rest = n - size*num_threads; + size = n / num_threads; + rest = n - size * num_threads; if (j < rest) { - ns = j*size+j; - ne = (j+1)*size+j+1; + ns = j * size + j; + ne = (j + 1) * size + j + 1; } else { - ns = j*size+rest; - ne = (j+1)*size+rest; + ns = j * size + rest; + ne = (j + 1) * size + rest; } for (i = ns; i < ne; i++) /* interior points first */ { /*----------------------------------------------------------- * If diagonal is nonzero, relax point i; otherwise, skip it. *-----------------------------------------------------------*/ - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - res_vec[k] = f_data[i*block_size+k]; + res_vec[k] = f_data[i * block_size + k]; res0_vec[k] = 0.0; res2_vec[k] = 0.0; } - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) { ii = A_diag_j[jj]; if (ii >= ns && ii < ne) { /* res0 -= A_diag_data[jj] * u_data[ii]; */ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj*bnnz], - &u_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj * bnnz], + &u_data[ii * block_size], 1.0, res0_vec, block_size); /* res2 += A_diag_data[jj] * Vtemp_data[ii];*/ - hypre_CSRBlockMatrixBlockMatvec(1.0, &A_diag_data[jj*bnnz], - &Vtemp_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(1.0, &A_diag_data[jj * bnnz], + &Vtemp_data[ii * block_size], 1.0, res2_vec, block_size); } else { /* res -= A_diag_data[jj] * tmp_data[ii]; */ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj*bnnz], - &tmp_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj * bnnz], + &tmp_data[ii * block_size], 1.0, res_vec, block_size); } } - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { ii = A_offd_j[jj]; /* res -= A_offd_data[jj] * Vext_data[ii];*/ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj*bnnz], - &Vext_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj * bnnz], + &Vext_data[ii * block_size], 1.0, res_vec, block_size); } /* u_data[i] *= prod; u_data[i] += relax_weight*(omega*res + res0 + one_minus_omega*res2) / A_diag_data[A_diag_i[i]];*/ - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - tmp_vec[k] = omega*res_vec[k] + res0_vec[k] + one_minus_omega*res2_vec[k]; + tmp_vec[k] = omega * res_vec[k] + res0_vec[k] + one_minus_omega * res2_vec[k]; } if (hypre_CSRBlockMatrixBlockInvMatvec( &A_diag_data[A_diag_i[i]*bnnz], tmp_vec, out_vec, block_size) == 0) { - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - u_data[i*block_size+k] *= prod; - u_data[i*block_size+k] += relax_weight *out_vec[k]; + u_data[i * block_size + k] *= prod; + u_data[i * block_size + k] += relax_weight * out_vec[k]; } } @@ -766,46 +770,46 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, /*----------------------------------------------------------- * If diagonal is nonzero, relax point i; otherwise, skip it. *-----------------------------------------------------------*/ - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - res_vec[k] = f_data[i*block_size+k]; + res_vec[k] = f_data[i * block_size + k]; res0_vec[k] = 0.0; res2_vec[k] = 0.0; } - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) { ii = A_diag_j[jj]; /* res0 -= A_diag_data[jj] * u_data[ii]; */ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj*bnnz], - &u_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj * bnnz], + &u_data[ii * block_size], 1.0, res0_vec, block_size); /* res2 += A_diag_data[jj] * Vtemp_data[ii];*/ - hypre_CSRBlockMatrixBlockMatvec(1.0, &A_diag_data[jj*bnnz], - &Vtemp_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(1.0, &A_diag_data[jj * bnnz], + &Vtemp_data[ii * block_size], 1.0, res2_vec, block_size); } - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { ii = A_offd_j[jj]; /* res -= A_offd_data[jj] * Vext_data[ii];*/ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj*bnnz], - &Vext_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj * bnnz], + &Vext_data[ii * block_size], 1.0, res_vec, block_size); } /* u_data[i] *= prod; u_data[i] += relax_weight*(omega*res + res0 + one_minus_omega*res2) / A_diag_data[A_diag_i[i]]; */ - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - tmp_vec[k] = omega*res_vec[k] + res0_vec[k] + one_minus_omega*res2_vec[k]; + tmp_vec[k] = omega * res_vec[k] + res0_vec[k] + one_minus_omega * res2_vec[k]; } if (hypre_CSRBlockMatrixBlockInvMatvec( &A_diag_data[A_diag_i[i]*bnnz], tmp_vec, out_vec, block_size) == 0) { - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - u_data[i*block_size+k] *= prod; - u_data[i*block_size+k] += relax_weight *out_vec[k]; + u_data[i * block_size + k] *= prod; + u_data[i * block_size + k] += relax_weight * out_vec[k]; } } } /* end of loop over points */ @@ -820,20 +824,22 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, { tmp_data = hypre_CTAlloc(HYPRE_Real, n, HYPRE_MEMORY_HOST); for (i = 0; i < n; i++) + { tmp_data[i] = u_data[i]; + } for (j = 0; j < num_threads; j++) { - size = n/num_threads; - rest = n - size*num_threads; + size = n / num_threads; + rest = n - size * num_threads; if (j < rest) { - ns = j*size+j; - ne = (j+1)*size+j+1; + ns = j * size + j; + ne = (j + 1) * size + j + 1; } else { - ns = j*size+rest; - ne = (j+1)*size+rest; + ns = j * size + rest; + ne = (j + 1) * size + rest; } for (i = ns; i < ne; i++) /* relax interior points */ { @@ -848,56 +854,56 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, /*----------------------------------------------------------- * If diagonal is nonzero, relax point i; otherwise, skip it. *-----------------------------------------------------------*/ - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - res_vec[k] = f_data[i*block_size+k]; + res_vec[k] = f_data[i * block_size + k]; res0_vec[k] = 0.0; res2_vec[k] = 0.0; } - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) { ii = A_diag_j[jj]; if (ii >= ns && ii < ne) { /* res0 -= A_diag_data[jj] * u_data[ii]; */ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj*bnnz], - &u_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj * bnnz], + &u_data[ii * block_size], 1.0, res0_vec, block_size); /* res2 += A_diag_data[jj] * Vtemp_data[ii];*/ - hypre_CSRBlockMatrixBlockMatvec(1.0, &A_diag_data[jj*bnnz], - &Vtemp_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(1.0, &A_diag_data[jj * bnnz], + &Vtemp_data[ii * block_size], 1.0, res2_vec, block_size); } else { /* res -= A_diag_data[jj] * tmp_data[ii]; */ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj*bnnz], - &tmp_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj * bnnz], + &tmp_data[ii * block_size], 1.0, res_vec, block_size); } } - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { ii = A_offd_j[jj]; /* res -= A_offd_data[jj] * Vext_data[ii];*/ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj*bnnz], - &Vext_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj * bnnz], + &Vext_data[ii * block_size], 1.0, res_vec, block_size); } /* u_data[i] *= prod; u_data[i] += relax_weight*(omega*res + res0 + one_minus_omega*res2) / A_diag_data[A_diag_i[i]];*/ - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - tmp_vec[k] = omega*res_vec[k] + res0_vec[k] + one_minus_omega*res2_vec[k]; + tmp_vec[k] = omega * res_vec[k] + res0_vec[k] + one_minus_omega * res2_vec[k]; } if (hypre_CSRBlockMatrixBlockInvMatvec( &A_diag_data[A_diag_i[i]*bnnz], tmp_vec, out_vec, block_size) == 0) { - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - u_data[i*block_size+k] *= prod; - u_data[i*block_size+k] += relax_weight *out_vec[k]; + u_data[i * block_size + k] *= prod; + u_data[i * block_size + k] += relax_weight * out_vec[k]; } } } /* end of if cf_marker */ @@ -920,46 +926,46 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, /*----------------------------------------------------------- * If diagonal is nonzero, relax point i; otherwise, skip it. *-----------------------------------------------------------*/ - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - res_vec[k] = f_data[i*block_size+k]; + res_vec[k] = f_data[i * block_size + k]; res0_vec[k] = 0.0; res2_vec[k] = 0.0; } - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) { ii = A_diag_j[jj]; /* res0 -= A_diag_data[jj] * u_data[ii]; */ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj*bnnz], - &u_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj * bnnz], + &u_data[ii * block_size], 1.0, res0_vec, block_size); /* res2 += A_diag_data[jj] * Vtemp_data[ii];*/ - hypre_CSRBlockMatrixBlockMatvec(1.0, &A_diag_data[jj*bnnz], - &Vtemp_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(1.0, &A_diag_data[jj * bnnz], + &Vtemp_data[ii * block_size], 1.0, res2_vec, block_size); } - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { ii = A_offd_j[jj]; /* res -= A_offd_data[jj] * Vext_data[ii];*/ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj*bnnz], - &Vext_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj * bnnz], + &Vext_data[ii * block_size], 1.0, res_vec, block_size); } /* u_data[i] *= prod; u_data[i] += relax_weight*(omega*res + res0 + one_minus_omega*res2) / A_diag_data[A_diag_i[i]];*/ - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - tmp_vec[k] = omega*res_vec[k] + res0_vec[k] + one_minus_omega*res2_vec[k]; + tmp_vec[k] = omega * res_vec[k] + res0_vec[k] + one_minus_omega * res2_vec[k]; } if (hypre_CSRBlockMatrixBlockInvMatvec( &A_diag_data[A_diag_i[i]*bnnz], tmp_vec, out_vec, block_size) == 0) { - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - u_data[i*block_size+k] *= prod; - u_data[i*block_size+k] += relax_weight *out_vec[k]; + u_data[i * block_size + k] *= prod; + u_data[i * block_size + k] += relax_weight * out_vec[k]; } } } /* end cf_marker */ @@ -982,11 +988,11 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, -/*----------------------------------------------------------------- - Hybrid: Jacobi off-processor, - Symm. Gauss-Seidel/ SSOR on-processor - with outer relaxation parameter - *-----------------------------------------------------------------*/ + /*----------------------------------------------------------------- + Hybrid: Jacobi off-processor, + Symm. Gauss-Seidel/ SSOR on-processor + with outer relaxation parameter + *-----------------------------------------------------------------*/ case 26: { @@ -996,9 +1002,9 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); v_buf_data = hypre_CTAlloc(HYPRE_Real, - hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends)*block_size, HYPRE_MEMORY_HOST); + hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends) * block_size, HYPRE_MEMORY_HOST); - Vext_data = hypre_CTAlloc(HYPRE_Real, num_cols_offd*block_size, HYPRE_MEMORY_HOST); + Vext_data = hypre_CTAlloc(HYPRE_Real, num_cols_offd * block_size, HYPRE_MEMORY_HOST); if (num_cols_offd) { @@ -1010,12 +1016,12 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j=start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg,i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { for (k = 0; k < block_size; k++) { v_buf_data[index++] - = u_data[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)*block_size + k]; + = u_data[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j) * block_size + k]; } } @@ -1043,20 +1049,22 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, { tmp_data = hypre_CTAlloc(HYPRE_Real, n, HYPRE_MEMORY_HOST); for (i = 0; i < n; i++) + { tmp_data[i] = u_data[i]; + } for (j = 0; j < num_threads; j++) { - size = n/num_threads; - rest = n - size*num_threads; + size = n / num_threads; + rest = n - size * num_threads; if (j < rest) { - ns = j*size+j; - ne = (j+1)*size+j+1; + ns = j * size + j; + ne = (j + 1) * size + j + 1; } else { - ns = j*size+rest; - ne = (j+1)*size+rest; + ns = j * size + rest; + ne = (j + 1) * size + rest; } for (i = ns; i < ne; i++) /* interior points first */ { @@ -1065,37 +1073,37 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, * If diagonal is nonzero, relax point i; otherwise, skip it. *-----------------------------------------------------------*/ - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - res_vec[k] = f_data[i*block_size+k]; + res_vec[k] = f_data[i * block_size + k]; } - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) { ii = A_diag_j[jj]; if (ii >= ns && ii < ne) { /* res -= A_diag_data[jj] * u_data[ii]; */ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj*bnnz], - &u_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj * bnnz], + &u_data[ii * block_size], 1.0, res_vec, block_size); } else { /* res -= A_diag_data[jj] * tmp_data[ii]; */ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj*bnnz], - &tmp_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj * bnnz], + &tmp_data[ii * block_size], 1.0, res_vec, block_size); } } - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { ii = A_offd_j[jj]; /* res -= A_offd_data[jj] * Vext_data[ii];*/ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj*bnnz], - &Vext_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj * bnnz], + &Vext_data[ii * block_size], 1.0, res_vec, block_size); } /* u_data[i] = res / A_diag_data[A_diag_i[i]]; */ @@ -1103,52 +1111,52 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, if (hypre_CSRBlockMatrixBlockInvMatvec( &A_diag_data[A_diag_i[i]*bnnz], res_vec, out_vec, block_size) == 0) { - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - u_data[i*block_size+k] = out_vec[k]; + u_data[i * block_size + k] = out_vec[k]; } } } /* end of interior points loop */ - for (i = ne-1; i > ns-1; i--) /* interior points first */ + for (i = ne - 1; i > ns - 1; i--) /* interior points first */ { /*----------------------------------------------------------- * If diagonal is nonzero, relax point i; otherwise, skip it. *-----------------------------------------------------------*/ - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - res_vec[k] = f_data[i*block_size+k]; + res_vec[k] = f_data[i * block_size + k]; } - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) { ii = A_diag_j[jj]; if (ii >= ns && ii < ne) { /* res -= A_diag_data[jj] * u_data[ii]; */ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj*bnnz], - &u_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj * bnnz], + &u_data[ii * block_size], 1.0, res_vec, block_size); } else { /* res -= A_diag_data[jj] * tmp_data[ii]; */ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj*bnnz], - &tmp_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj * bnnz], + &tmp_data[ii * block_size], 1.0, res_vec, block_size); } } - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { ii = A_offd_j[jj]; /* res -= A_offd_data[jj] * Vext_data[ii]; */ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj*bnnz], - &Vext_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj * bnnz], + &Vext_data[ii * block_size], 1.0, res_vec, block_size); } /* u_data[i] = res / A_diag_data[A_diag_i[i]]; */ @@ -1156,9 +1164,9 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, if (hypre_CSRBlockMatrixBlockInvMatvec( &A_diag_data[A_diag_i[i]*bnnz], res_vec, out_vec, block_size) == 0) { - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - u_data[i*block_size+k] = out_vec[k]; + u_data[i * block_size + k] = out_vec[k]; } } } /* end of loop over points */ @@ -1173,71 +1181,71 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, /*----------------------------------------------------------- * If diagonal is nonzero, relax point i; otherwise, skip it. *-----------------------------------------------------------*/ - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - res_vec[k] = f_data[i*block_size+k]; + res_vec[k] = f_data[i * block_size + k]; } - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) { ii = A_diag_j[jj]; /* res -= A_diag_data[jj] * u_data[ii]; */ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj*bnnz], - &u_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj * bnnz], + &u_data[ii * block_size], 1.0, res_vec, block_size); } - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { ii = A_offd_j[jj]; /* res -= A_offd_data[jj] * Vext_data[ii]; */ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj*bnnz], - &Vext_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj * bnnz], + &Vext_data[ii * block_size], 1.0, res_vec, block_size); } /* u_data[i] = res / A_diag_data[A_diag_i[i]]; */ if (hypre_CSRBlockMatrixBlockInvMatvec( &A_diag_data[A_diag_i[i]*bnnz], res_vec, out_vec, block_size) == 0) { - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - u_data[i*block_size+k] = out_vec[k]; + u_data[i * block_size + k] = out_vec[k]; } } } /* end of loop over points */ - for (i = n-1; i > -1; i--) /* interior points first */ + for (i = n - 1; i > -1; i--) /* interior points first */ { /*----------------------------------------------------------- * If diagonal is nonzero, relax point i; otherwise, skip it. *-----------------------------------------------------------*/ - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - res_vec[k] = f_data[i*block_size+k]; + res_vec[k] = f_data[i * block_size + k]; } - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) { ii = A_diag_j[jj]; /* res -= A_diag_data[jj] * u_data[ii]; */ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj*bnnz], - &u_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj * bnnz], + &u_data[ii * block_size], 1.0, res_vec, block_size); } - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { ii = A_offd_j[jj]; /* res -= A_offd_data[jj] * Vext_data[ii]; */ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj*bnnz], - &Vext_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj * bnnz], + &Vext_data[ii * block_size], 1.0, res_vec, block_size); } /* u_data[i] = res / A_diag_data[A_diag_i[i]]; */ if (hypre_CSRBlockMatrixBlockInvMatvec( &A_diag_data[A_diag_i[i]*bnnz], res_vec, out_vec, block_size) == 0) { - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - u_data[i*block_size+k] = out_vec[k]; + u_data[i * block_size + k] = out_vec[k]; } } @@ -1254,20 +1262,22 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, { tmp_data = hypre_CTAlloc(HYPRE_Real, n, HYPRE_MEMORY_HOST); for (i = 0; i < n; i++) + { tmp_data[i] = u_data[i]; + } for (j = 0; j < num_threads; j++) { - size = n/num_threads; - rest = n - size*num_threads; + size = n / num_threads; + rest = n - size * num_threads; if (j < rest) { - ns = j*size+j; - ne = (j+1)*size+j+1; + ns = j * size + j; + ne = (j + 1) * size + j + 1; } else { - ns = j*size+rest; - ne = (j+1)*size+rest; + ns = j * size + rest; + ne = (j + 1) * size + rest; } for (i = ns; i < ne; i++) /* relax interior points */ { @@ -1279,34 +1289,34 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, if (cf_marker[i] == relax_points) { - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - res_vec[k] = f_data[i*block_size+k]; + res_vec[k] = f_data[i * block_size + k]; } - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) { ii = A_diag_j[jj]; if (ii >= ns && ii < ne) { /* res -= A_diag_data[jj] * u_data[ii]; */ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj*bnnz], - &u_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj * bnnz], + &u_data[ii * block_size], 1.0, res_vec, block_size); } else { /* res -= A_diag_data[jj] * tmp_data[ii]; */ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj*bnnz], - &tmp_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj * bnnz], + &tmp_data[ii * block_size], 1.0, res_vec, block_size); } } - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { ii = A_offd_j[jj]; /* res -= A_offd_data[jj] * Vext_data[ii];*/ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj*bnnz], - &Vext_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj * bnnz], + &Vext_data[ii * block_size], 1.0, res_vec, block_size); } @@ -1315,15 +1325,15 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, if (hypre_CSRBlockMatrixBlockInvMatvec( &A_diag_data[A_diag_i[i]*bnnz], res_vec, out_vec, block_size) == 0) { - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - u_data[i*block_size+k] = out_vec[k]; + u_data[i * block_size + k] = out_vec[k]; } } } } - for (i = ne-1; i > ns-1; i--) /* relax interior points */ + for (i = ne - 1; i > ns - 1; i--) /* relax interior points */ { /*----------------------------------------------------------- @@ -1333,34 +1343,34 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, if (cf_marker[i] == relax_points) { - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - res_vec[k] = f_data[i*block_size+k]; + res_vec[k] = f_data[i * block_size + k]; } - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) { ii = A_diag_j[jj]; if (ii >= ns && ii < ne) { /* res -= A_diag_data[jj] * u_data[ii]; */ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj*bnnz], - &u_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj * bnnz], + &u_data[ii * block_size], 1.0, res_vec, block_size); } else { /* res -= A_diag_data[jj] * tmp_data[ii]; */ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj*bnnz], - &tmp_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj * bnnz], + &tmp_data[ii * block_size], 1.0, res_vec, block_size); } } - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { ii = A_offd_j[jj]; /* res -= A_offd_data[jj] * Vext_data[ii];*/ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj*bnnz], - &Vext_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj * bnnz], + &Vext_data[ii * block_size], 1.0, res_vec, block_size); } @@ -1369,9 +1379,9 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, if (hypre_CSRBlockMatrixBlockInvMatvec( &A_diag_data[A_diag_i[i]*bnnz], res_vec, out_vec, block_size) == 0) { - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - u_data[i*block_size+k] = out_vec[k]; + u_data[i * block_size + k] = out_vec[k]; } } } @@ -1392,24 +1402,24 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, if (cf_marker[i] == relax_points) { - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - res_vec[k] = f_data[i*block_size+k]; + res_vec[k] = f_data[i * block_size + k]; } - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) { ii = A_diag_j[jj]; /* res -= A_diag_data[jj] * u_data[ii]; */ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj*bnnz], - &u_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj * bnnz], + &u_data[ii * block_size], 1.0, res_vec, block_size); } - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { ii = A_offd_j[jj]; /* res -= A_offd_data[jj] * Vext_data[ii];*/ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj*bnnz], - &Vext_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj * bnnz], + &Vext_data[ii * block_size], 1.0, res_vec, block_size); } @@ -1418,14 +1428,14 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, if (hypre_CSRBlockMatrixBlockInvMatvec( &A_diag_data[A_diag_i[i]*bnnz], res_vec, out_vec, block_size) == 0) { - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - u_data[i*block_size+k] = out_vec[k]; + u_data[i * block_size + k] = out_vec[k]; } } } } - for (i = n-1; i > -1; i--) /* relax interior points */ + for (i = n - 1; i > -1; i--) /* relax interior points */ { /*----------------------------------------------------------- @@ -1436,24 +1446,24 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, if (cf_marker[i] == relax_points) { - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - res_vec[k] = f_data[i*block_size+k]; + res_vec[k] = f_data[i * block_size + k]; } - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) { ii = A_diag_j[jj]; /* res -= A_diag_data[jj] * u_data[ii]; */ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj*bnnz], - &u_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj * bnnz], + &u_data[ii * block_size], 1.0, res_vec, block_size); } - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { ii = A_offd_j[jj]; /* res -= A_offd_data[jj] * Vext_data[ii];*/ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj*bnnz], - &Vext_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj * bnnz], + &Vext_data[ii * block_size], 1.0, res_vec, block_size); } /* u_data[i] = res / A_diag_data[A_diag_i[i]]; */ @@ -1461,9 +1471,9 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, if (hypre_CSRBlockMatrixBlockInvMatvec( &A_diag_data[A_diag_i[i]*bnnz], res_vec, out_vec, block_size) == 0) { - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - u_data[i*block_size+k] = out_vec[k]; + u_data[i * block_size + k] = out_vec[k]; } } } @@ -1476,34 +1486,36 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, /*----------------------------------------------------------------- * relax weight and omega do not = 1 *-----------------------------------------------------------------*/ - prod = (1.0-relax_weight*omega); + prod = (1.0 - relax_weight * omega); res0_vec = hypre_CTAlloc(HYPRE_Real, block_size, HYPRE_MEMORY_HOST); res2_vec = hypre_CTAlloc(HYPRE_Real, block_size, HYPRE_MEMORY_HOST); for (i = 0; i < n; i++) { Vtemp_data[i] = u_data[i]; } - prod = (1.0-relax_weight*omega); + prod = (1.0 - relax_weight * omega); if (relax_points == 0) { if (num_threads > 1) { tmp_data = hypre_CTAlloc(HYPRE_Real, n, HYPRE_MEMORY_HOST); for (i = 0; i < n; i++) + { tmp_data[i] = u_data[i]; + } for (j = 0; j < num_threads; j++) { - size = n/num_threads; - rest = n - size*num_threads; + size = n / num_threads; + rest = n - size * num_threads; if (j < rest) { - ns = j*size+j; - ne = (j+1)*size+j+1; + ns = j * size + j; + ne = (j + 1) * size + j + 1; } else { - ns = j*size+rest; - ne = (j+1)*size+rest; + ns = j * size + rest; + ne = (j + 1) * size + rest; } for (i = ns; i < ne; i++) /* interior points first */ { @@ -1511,43 +1523,43 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, * If diagonal is nonzero, relax point i; otherwise, skip it. *-----------------------------------------------------------*/ - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - res_vec[k] = f_data[i*block_size+k]; + res_vec[k] = f_data[i * block_size + k]; res0_vec[k] = 0.0; res2_vec[k] = 0.0; } - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) { ii = A_diag_j[jj]; if (ii >= ns && ii < ne) { /* res0 -= A_diag_data[jj] * u_data[ii]; */ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj*bnnz], - &u_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj * bnnz], + &u_data[ii * block_size], 1.0, res0_vec, block_size); /* res2 += A_diag_data[jj] * Vtemp_data[ii];*/ - hypre_CSRBlockMatrixBlockMatvec(1.0, &A_diag_data[jj*bnnz], - &Vtemp_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(1.0, &A_diag_data[jj * bnnz], + &Vtemp_data[ii * block_size], 1.0, res2_vec, block_size); } else { /* res -= A_diag_data[jj] * tmp_data[ii]; */ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj*bnnz], - &tmp_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj * bnnz], + &tmp_data[ii * block_size], 1.0, res_vec, block_size); } } - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { ii = A_offd_j[jj]; /* res -= A_offd_data[jj] * Vext_data[ii]; */ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj*bnnz], - &Vext_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj * bnnz], + &Vext_data[ii * block_size], 1.0, res_vec, block_size); @@ -1555,78 +1567,78 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, /* u_data[i] *= prod; u_data[i] += relax_weight*(omega*res + res0 + one_minus_omega*res2) / A_diag_data[A_diag_i[i]];*/ - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - tmp_vec[k] = omega*res_vec[k] + res0_vec[k] + one_minus_omega*res2_vec[k]; + tmp_vec[k] = omega * res_vec[k] + res0_vec[k] + one_minus_omega * res2_vec[k]; } if (hypre_CSRBlockMatrixBlockInvMatvec( &A_diag_data[A_diag_i[i]*bnnz], tmp_vec, out_vec, block_size) == 0) { - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - u_data[i*block_size+k] *= prod; - u_data[i*block_size+k] += relax_weight *out_vec[k]; + u_data[i * block_size + k] *= prod; + u_data[i * block_size + k] += relax_weight * out_vec[k]; } } } - for (i = ne-1; i > ns-1; i--) /* interior points first */ + for (i = ne - 1; i > ns - 1; i--) /* interior points first */ { /*----------------------------------------------------------- * If diagonal is nonzero, relax point i; otherwise, skip it. *-----------------------------------------------------------*/ - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - res_vec[k] = f_data[i*block_size+k]; + res_vec[k] = f_data[i * block_size + k]; res0_vec[k] = 0.0; res2_vec[k] = 0.0; } - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) { ii = A_diag_j[jj]; if (ii >= ns && ii < ne) { /* res0 -= A_diag_data[jj] * u_data[ii]; */ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj*bnnz], - &u_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj * bnnz], + &u_data[ii * block_size], 1.0, res0_vec, block_size); /* res2 += A_diag_data[jj] * Vtemp_data[ii];*/ - hypre_CSRBlockMatrixBlockMatvec(1.0, &A_diag_data[jj*bnnz], - &Vtemp_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(1.0, &A_diag_data[jj * bnnz], + &Vtemp_data[ii * block_size], 1.0, res2_vec, block_size); } else { /* res -= A_diag_data[jj] * tmp_data[ii]; */ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj*bnnz], - &tmp_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj * bnnz], + &tmp_data[ii * block_size], 1.0, res_vec, block_size); } } - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { ii = A_offd_j[jj]; /* res -= A_offd_data[jj] * Vext_data[ii];*/ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj*bnnz], - &Vext_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj * bnnz], + &Vext_data[ii * block_size], 1.0, res_vec, block_size); } /* u_data[i] *= prod; u_data[i] += relax_weight*(omega*res + res0 + one_minus_omega*res2) / A_diag_data[A_diag_i[i]];*/ - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - tmp_vec[k] = omega*res_vec[k] + res0_vec[k] + one_minus_omega*res2_vec[k]; + tmp_vec[k] = omega * res_vec[k] + res0_vec[k] + one_minus_omega * res2_vec[k]; } if (hypre_CSRBlockMatrixBlockInvMatvec( &A_diag_data[A_diag_i[i]*bnnz], tmp_vec, out_vec, block_size) == 0) { - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - u_data[i*block_size+k] *= prod; - u_data[i*block_size+k] += relax_weight *out_vec[k]; + u_data[i * block_size + k] *= prod; + u_data[i * block_size + k] += relax_weight * out_vec[k]; } } } /* end of loop over points */ @@ -1641,95 +1653,95 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, /*----------------------------------------------------------- * If diagonal is nonzero, relax point i; otherwise, skip it. *-----------------------------------------------------------*/ - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - res_vec[k] = f_data[i*block_size+k]; + res_vec[k] = f_data[i * block_size + k]; res0_vec[k] = 0.0; res2_vec[k] = 0.0; } - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) { ii = A_diag_j[jj]; /* res0 -= A_diag_data[jj] * u_data[ii]; */ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj*bnnz], - &u_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj * bnnz], + &u_data[ii * block_size], 1.0, res0_vec, block_size); /* res2 += A_diag_data[jj] * Vtemp_data[ii];*/ - hypre_CSRBlockMatrixBlockMatvec(1.0, &A_diag_data[jj*bnnz], - &Vtemp_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(1.0, &A_diag_data[jj * bnnz], + &Vtemp_data[ii * block_size], 1.0, res2_vec, block_size); } - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { ii = A_offd_j[jj]; /* res -= A_offd_data[jj] * Vext_data[ii];*/ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj*bnnz], - &Vext_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj * bnnz], + &Vext_data[ii * block_size], 1.0, res_vec, block_size); } /* u_data[i] *= prod; u_data[i] += relax_weight*(omega*res + res0 + one_minus_omega*res2) / A_diag_data[A_diag_i[i]]; */ - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - tmp_vec[k] = omega*res_vec[k] + res0_vec[k] + one_minus_omega*res2_vec[k]; + tmp_vec[k] = omega * res_vec[k] + res0_vec[k] + one_minus_omega * res2_vec[k]; } if (hypre_CSRBlockMatrixBlockInvMatvec( &A_diag_data[A_diag_i[i]*bnnz], tmp_vec, out_vec, block_size) == 0) { - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - u_data[i*block_size+k] *= prod; - u_data[i*block_size+k] += relax_weight *out_vec[k]; + u_data[i * block_size + k] *= prod; + u_data[i * block_size + k] += relax_weight * out_vec[k]; } } } - for (i = n-1; i > -1; i--) /* interior points first */ + for (i = n - 1; i > -1; i--) /* interior points first */ { /*----------------------------------------------------------- * If diagonal is nonzero, relax point i; otherwise, skip it. *-----------------------------------------------------------*/ - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - res_vec[k] = f_data[i*block_size+k]; + res_vec[k] = f_data[i * block_size + k]; res0_vec[k] = 0.0; res2_vec[k] = 0.0; } - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) { ii = A_diag_j[jj]; /* res0 -= A_diag_data[jj] * u_data[ii]; */ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj*bnnz], - &u_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj * bnnz], + &u_data[ii * block_size], 1.0, res0_vec, block_size); /* res2 += A_diag_data[jj] * Vtemp_data[ii];*/ - hypre_CSRBlockMatrixBlockMatvec(1.0, &A_diag_data[jj*bnnz], - &Vtemp_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(1.0, &A_diag_data[jj * bnnz], + &Vtemp_data[ii * block_size], 1.0, res2_vec, block_size); } - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { ii = A_offd_j[jj]; /* res -= A_offd_data[jj] * Vext_data[ii];*/ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj*bnnz], - &Vext_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj * bnnz], + &Vext_data[ii * block_size], 1.0, res_vec, block_size); } /* u_data[i] *= prod; u_data[i] += relax_weight*(omega*res + res0 + one_minus_omega*res2) / A_diag_data[A_diag_i[i]]; */ - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - tmp_vec[k] = omega*res_vec[k] + res0_vec[k] + one_minus_omega*res2_vec[k]; + tmp_vec[k] = omega * res_vec[k] + res0_vec[k] + one_minus_omega * res2_vec[k]; } if (hypre_CSRBlockMatrixBlockInvMatvec( &A_diag_data[A_diag_i[i]*bnnz], tmp_vec, out_vec, block_size) == 0) { - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - u_data[i*block_size+k] *= prod; - u_data[i*block_size+k] += relax_weight *out_vec[k]; + u_data[i * block_size + k] *= prod; + u_data[i * block_size + k] += relax_weight * out_vec[k]; } } }/* end of loop over points */ @@ -1746,20 +1758,22 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, { tmp_data = hypre_CTAlloc(HYPRE_Real, n, HYPRE_MEMORY_HOST); for (i = 0; i < n; i++) + { tmp_data[i] = u_data[i]; + } for (j = 0; j < num_threads; j++) { - size = n/num_threads; - rest = n - size*num_threads; + size = n / num_threads; + rest = n - size * num_threads; if (j < rest) { - ns = j*size+j; - ne = (j+1)*size+j+1; + ns = j * size + j; + ne = (j + 1) * size + j + 1; } else { - ns = j*size+rest; - ne = (j+1)*size+rest; + ns = j * size + rest; + ne = (j + 1) * size + rest; } for (i = ns; i < ne; i++) /* relax interior points */ { @@ -1774,61 +1788,61 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, /*----------------------------------------------------------- * If diagonal is nonzero, relax point i; otherwise, skip it. *-----------------------------------------------------------*/ - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - res_vec[k] = f_data[i*block_size+k]; + res_vec[k] = f_data[i * block_size + k]; res0_vec[k] = 0.0; res2_vec[k] = 0.0; } - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) { ii = A_diag_j[jj]; if (ii >= ns && ii < ne) { /* res0 -= A_diag_data[jj] * u_data[ii]; */ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj*bnnz], - &u_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj * bnnz], + &u_data[ii * block_size], 1.0, res0_vec, block_size); /* res2 += A_diag_data[jj] * Vtemp_data[ii];*/ - hypre_CSRBlockMatrixBlockMatvec(1.0, &A_diag_data[jj*bnnz], - &Vtemp_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(1.0, &A_diag_data[jj * bnnz], + &Vtemp_data[ii * block_size], 1.0, res2_vec, block_size); } else { /* res -= A_diag_data[jj] * tmp_data[ii]; */ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj*bnnz], - &tmp_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj * bnnz], + &tmp_data[ii * block_size], 1.0, res_vec, block_size); } } - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { ii = A_offd_j[jj]; /* res -= A_offd_data[jj] * Vext_data[ii];*/ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj*bnnz], - &Vext_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj * bnnz], + &Vext_data[ii * block_size], 1.0, res_vec, block_size); } /* u_data[i] *= prod; u_data[i] += relax_weight*(omega*res + res0 + one_minus_omega*res2) / A_diag_data[A_diag_i[i]];*/ - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - tmp_vec[k] = omega*res_vec[k] + res0_vec[k] + one_minus_omega*res2_vec[k]; + tmp_vec[k] = omega * res_vec[k] + res0_vec[k] + one_minus_omega * res2_vec[k]; } if (hypre_CSRBlockMatrixBlockInvMatvec( &A_diag_data[A_diag_i[i]*bnnz], tmp_vec, out_vec, block_size) == 0) { - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - u_data[i*block_size+k] *= prod; - u_data[i*block_size+k] += relax_weight *out_vec[k]; + u_data[i * block_size + k] *= prod; + u_data[i * block_size + k] += relax_weight * out_vec[k]; } } } } - for (i = ne-1; i > ns-1; i--) /* relax interior points */ + for (i = ne - 1; i > ns - 1; i--) /* relax interior points */ { /*----------------------------------------------------------- * If i is of the right type ( C or F ) and diagonal is @@ -1840,56 +1854,56 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, /*----------------------------------------------------------- * If diagonal is nonzero, relax point i; otherwise, skip it. *-----------------------------------------------------------*/ - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - res_vec[k] = f_data[i*block_size+k]; + res_vec[k] = f_data[i * block_size + k]; res0_vec[k] = 0.0; res2_vec[k] = 0.0; } - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) { ii = A_diag_j[jj]; if (ii >= ns && ii < ne) { /* res0 -= A_diag_data[jj] * u_data[ii]; */ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj*bnnz], - &u_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj * bnnz], + &u_data[ii * block_size], 1.0, res0_vec, block_size); /* res2 += A_diag_data[jj] * Vtemp_data[ii];*/ - hypre_CSRBlockMatrixBlockMatvec(1.0, &A_diag_data[jj*bnnz], - &Vtemp_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(1.0, &A_diag_data[jj * bnnz], + &Vtemp_data[ii * block_size], 1.0, res2_vec, block_size); } else { /* res -= A_diag_data[jj] * tmp_data[ii]; */ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj*bnnz], - &tmp_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj * bnnz], + &tmp_data[ii * block_size], 1.0, res_vec, block_size); } } - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { ii = A_offd_j[jj]; /* res -= A_offd_data[jj] * Vext_data[ii];*/ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj*bnnz], - &Vext_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj * bnnz], + &Vext_data[ii * block_size], 1.0, res_vec, block_size); } /* u_data[i] *= prod; u_data[i] += relax_weight*(omega*res + res0 + one_minus_omega*res2) / A_diag_data[A_diag_i[i]];*/ - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - tmp_vec[k] = omega*res_vec[k] + res0_vec[k] + one_minus_omega*res2_vec[k]; + tmp_vec[k] = omega * res_vec[k] + res0_vec[k] + one_minus_omega * res2_vec[k]; } if (hypre_CSRBlockMatrixBlockInvMatvec( &A_diag_data[A_diag_i[i]*bnnz], tmp_vec, out_vec, block_size) == 0) { - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - u_data[i*block_size+k] *= prod; - u_data[i*block_size+k] += relax_weight *out_vec[k]; + u_data[i * block_size + k] *= prod; + u_data[i * block_size + k] += relax_weight * out_vec[k]; } } } @@ -1909,51 +1923,51 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, if (cf_marker[i] == relax_points ) { - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - res_vec[k] = f_data[i*block_size+k]; + res_vec[k] = f_data[i * block_size + k]; res0_vec[k] = 0.0; res2_vec[k] = 0.0; } - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) { ii = A_diag_j[jj]; /* res0 -= A_diag_data[jj] * u_data[ii]; */ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj*bnnz], - &u_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj * bnnz], + &u_data[ii * block_size], 1.0, res0_vec, block_size); /* res2 += A_diag_data[jj] * Vtemp_data[ii];*/ - hypre_CSRBlockMatrixBlockMatvec(1.0, &A_diag_data[jj*bnnz], - &Vtemp_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(1.0, &A_diag_data[jj * bnnz], + &Vtemp_data[ii * block_size], 1.0, res2_vec, block_size); } - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { ii = A_offd_j[jj]; /* res -= A_offd_data[jj] * Vext_data[ii];*/ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj*bnnz], - &Vext_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj * bnnz], + &Vext_data[ii * block_size], 1.0, res_vec, block_size); } /* u_data[i] *= prod; u_data[i] += relax_weight*(omega*res + res0 + one_minus_omega*res2) / A_diag_data[A_diag_i[i]];*/ - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - tmp_vec[k] = omega*res_vec[k] + res0_vec[k] + one_minus_omega*res2_vec[k]; + tmp_vec[k] = omega * res_vec[k] + res0_vec[k] + one_minus_omega * res2_vec[k]; } if (hypre_CSRBlockMatrixBlockInvMatvec( &A_diag_data[A_diag_i[i]*bnnz], tmp_vec, out_vec, block_size) == 0) { - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - u_data[i*block_size+k] *= prod; - u_data[i*block_size+k] += relax_weight *out_vec[k]; + u_data[i * block_size + k] *= prod; + u_data[i * block_size + k] += relax_weight * out_vec[k]; } } } } - for (i = n-1; i > -1; i--) /* relax interior points */ + for (i = n - 1; i > -1; i--) /* relax interior points */ { /*----------------------------------------------------------- @@ -1964,46 +1978,46 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, if (cf_marker[i] == relax_points ) { - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - res_vec[k] = f_data[i*block_size+k]; + res_vec[k] = f_data[i * block_size + k]; res0_vec[k] = 0.0; res2_vec[k] = 0.0; } - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) { ii = A_diag_j[jj]; /* res0 -= A_diag_data[jj] * u_data[ii]; */ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj*bnnz], - &u_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_diag_data[jj * bnnz], + &u_data[ii * block_size], 1.0, res0_vec, block_size); /* res2 += A_diag_data[jj] * Vtemp_data[ii];*/ - hypre_CSRBlockMatrixBlockMatvec(1.0, &A_diag_data[jj*bnnz], - &Vtemp_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(1.0, &A_diag_data[jj * bnnz], + &Vtemp_data[ii * block_size], 1.0, res2_vec, block_size); } - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { ii = A_offd_j[jj]; /* res -= A_offd_data[jj] * Vext_data[ii];*/ - hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj*bnnz], - &Vext_data[ii*block_size], + hypre_CSRBlockMatrixBlockMatvec(-1.0, &A_offd_data[jj * bnnz], + &Vext_data[ii * block_size], 1.0, res_vec, block_size); } /* u_data[i] *= prod; u_data[i] += relax_weight*(omega*res + res0 + one_minus_omega*res2) / A_diag_data[A_diag_i[i]];*/ - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - tmp_vec[k] = omega*res_vec[k] + res0_vec[k] + one_minus_omega*res2_vec[k]; + tmp_vec[k] = omega * res_vec[k] + res0_vec[k] + one_minus_omega * res2_vec[k]; } if (hypre_CSRBlockMatrixBlockInvMatvec( &A_diag_data[A_diag_i[i]*bnnz], tmp_vec, out_vec, block_size) == 0) { - for (k=0; k< block_size; k++) + for (k = 0; k < block_size; k++) { - u_data[i*block_size+k] *= prod; - u_data[i*block_size+k] += relax_weight *out_vec[k]; + u_data[i * block_size + k] *= prod; + u_data[i * block_size + k] += relax_weight * out_vec[k]; } } } @@ -2021,9 +2035,9 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, break; } -/*--------------------------------------------------------------------------- - * Direct solve: use gaussian elimination - *---------------------------------------------------------------------------*/ + /*--------------------------------------------------------------------------- + * Direct solve: use gaussian elimination + *---------------------------------------------------------------------------*/ case 29: { @@ -2049,7 +2063,7 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, A_CSR_data = hypre_CSRMatrixData(A_CSR); f_vector_data = hypre_VectorData(f_vector); - A_mat = hypre_CTAlloc(HYPRE_Real, n_small*n_small, HYPRE_MEMORY_HOST); + A_mat = hypre_CTAlloc(HYPRE_Real, n_small * n_small, HYPRE_MEMORY_HOST); b_vec = hypre_CTAlloc(HYPRE_Real, n_small, HYPRE_MEMORY_HOST); /* Load CSR matrix into A_mat. */ @@ -2057,23 +2071,23 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, for (i = 0; i < n_small; i++) { - for (jj = A_CSR_i[i]; jj < A_CSR_i[i+1]; jj++) + for (jj = A_CSR_i[i]; jj < A_CSR_i[i + 1]; jj++) { column = A_CSR_j[jj]; - A_mat[i*n_small+column] = A_CSR_data[jj]; + A_mat[i * n_small + column] = A_CSR_data[jj]; } b_vec[i] = f_vector_data[i]; } - relax_error = gselim_piv(A_mat,b_vec,n_small); + relax_error = gselim_piv(A_mat, b_vec, n_small); /* should check the relax error */ for (i = 0; i < n; i++) { - for (k=0; k < block_size; k++) + for (k = 0; k < block_size; k++) { - u_data[i*block_size + k] = b_vec[first_index+i*block_size + k]; + u_data[i * block_size + k] = b_vec[first_index + i * block_size + k]; } } @@ -2119,47 +2133,47 @@ HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, HYPRE_Int gselim_piv(HYPRE_Real *A, HYPRE_Real *x, HYPRE_Int n) { HYPRE_Int err_flag = 0; - HYPRE_Int j,k,m, piv_row; + HYPRE_Int j, k, m, piv_row; HYPRE_Real factor, piv, tmp; HYPRE_Real eps = 1e-8; - if (n==1) /* A is 1x1 */ + if (n == 1) /* A is 1x1 */ { - if (fabs(A[0]) > 1e-10) + if (hypre_abs(A[0]) > 1e-10) { - x[0] = x[0]/A[0]; - return(err_flag); + x[0] = x[0] / A[0]; + return (err_flag); } else { err_flag = 1; - return(err_flag); + return (err_flag); } } else /* A is nxn. Forward elimination */ { - for (k = 0; k < n-1; k++) + for (k = 0; k < n - 1; k++) { /* we do partial pivoting for size */ - piv = A[k*n+k]; + piv = A[k * n + k]; piv_row = k; /* find the largest pivot in position k*/ - for (j=k+1; j < n; j++) + for (j = k + 1; j < n; j++) { - if (fabs(A[j*n+k]) > fabs(piv)) + if (hypre_abs(A[j * n + k]) > hypre_abs(piv)) { - piv = A[j*n+k]; + piv = A[j * n + k]; piv_row = j; } } - if (piv_row !=k) /* do a row exchange - rows k and piv_row*/ + if (piv_row != k) /* do a row exchange - rows k and piv_row*/ { - for (j=0; j < n; j++) + for (j = 0; j < n; j++) { - tmp = A[k*n + j]; - A[k*n + j] = A[piv_row*n + j]; - A[piv_row*n + j] = tmp; + tmp = A[k * n + j]; + A[k * n + j] = A[piv_row * n + j]; + A[piv_row * n + j] = tmp; } tmp = x[k]; x[k] = x[piv_row]; @@ -2167,16 +2181,16 @@ HYPRE_Int gselim_piv(HYPRE_Real *A, HYPRE_Real *x, HYPRE_Int n) } - if (fabs(piv) > eps) + if (hypre_abs(piv) > eps) { - for (j = k+1; j < n; j++) + for (j = k + 1; j < n; j++) { - if (A[j*n+k] != 0.0) + if (A[j * n + k] != 0.0) { - factor = A[j*n+k]/A[k*n+k]; - for (m = k+1; m < n; m++) + factor = A[j * n + k] / A[k * n + k]; + for (m = k + 1; m < n; m++) { - A[j*n+m] -= factor * A[k*n+m]; + A[j * n + m] -= factor * A[k * n + m]; } /* Elimination step for rhs */ x[j] -= factor * x[k]; @@ -2186,30 +2200,30 @@ HYPRE_Int gselim_piv(HYPRE_Real *A, HYPRE_Real *x, HYPRE_Int n) else { /* hypre_printf("Matrix is nearly singular: zero pivot error\n"); */ - return(-1); + return (-1); } } /* we also need to check the pivot in the last row to see if it is zero */ k = n - 1; /* last row */ - if ( fabs(A[k*n+k]) < eps) + if ( hypre_abs(A[k * n + k]) < eps) { /* hypre_printf("Block of matrix is nearly singular: zero pivot error\n"); */ - return(-1); + return (-1); } /* Back Substitution */ - for (k = n-1; k > 0; --k) + for (k = n - 1; k > 0; --k) { - x[k] /= A[k*n+k]; + x[k] /= A[k * n + k]; for (j = 0; j < k; j++) { - if (A[j*n+k] != 0.0) + if (A[j * n + k] != 0.0) { - x[j] -= x[k] * A[j*n+k]; + x[j] -= x[k] * A[j * n + k]; } } } x[0] /= A[0]; - return(err_flag); + return (err_flag); } } diff --git a/external/hypre/src/parcsr_ls/CMakeLists.txt b/external/hypre/src/parcsr_ls/CMakeLists.txt index 9660e340..87148a24 100644 --- a/external/hypre/src/parcsr_ls/CMakeLists.txt +++ b/external/hypre/src/parcsr_ls/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -27,6 +27,8 @@ set(SRCS F90_HYPRE_parcsr_pcg.c F90_HYPRE_parcsr_pilut.c F90_HYPRE_parcsr_schwarz.c + F90_HYPRE_parcsr_mgr.c + F90_HYPRE_parcsr_ilu.c F90_HYPRE_ams.c gen_redcs_mat.c HYPRE_parcsr_amg.c @@ -47,6 +49,7 @@ set(SRCS HYPRE_parcsr_pcg.c HYPRE_parcsr_pilut.c HYPRE_parcsr_schwarz.c + HYPRE_parcsr_fsai.c HYPRE_ams.c HYPRE_ads.c HYPRE_ame.c @@ -73,21 +76,32 @@ set(SRCS par_cycle.c par_add_cycle.c par_difconv.c + par_fsai.c + par_fsai_device.c + par_fsai_setup.c + par_fsai_solve.c + par_fsai_device.c par_gauss_elim.c + par_ge_device.c par_gsmg.c par_indepset.c par_interp.c par_jacobi_interp.c par_krylov_func.c par_mod_lr_interp.c + par_mod_multi_interp.c par_multi_interp.c par_laplace_27pt.c par_laplace_9pt.c par_laplace.c par_lr_interp.c par_mgr.c + par_mgr_coarsen.c + par_mgr_interp.c + par_mgr_rap.c par_mgr_setup.c par_mgr_solve.c + par_mgr_stats.c par_nongalerkin.c par_nodal_systems.c par_rap.c @@ -118,7 +132,9 @@ set(SRCS par_mgr_solve.c par_ilu.c par_ilu_setup.c + par_ilu_setup_device.c par_ilu_solve.c + par_ilu_solve_device.c par_coarsen_device.c par_indepset_device.c par_interp_device.c @@ -130,25 +146,27 @@ set(SRCS par_amgdd_fac_cycle_device.c par_2s_interp_device.c par_relax_device.c + par_mod_multi_interp_device.c + par_mgr_device.c ) -if (HYPRE_USING_DSUPERLU) - list(APPEND SRCS dsuperlu.c) -endif() - target_sources(${PROJECT_NAME} PRIVATE ${SRCS} ${HDRS} ) -if (HYPRE_USING_CUDA) - set(CUDA_SRCS +if (HYPRE_USING_GPU) + set(GPU_SRCS ams.c ads.c ame.c + par_amg_setup.c + par_ge_device.c par_ilu.c par_ilu_setup.c + par_ilu_setup_device.c par_ilu_solve.c + par_ilu_solve_device.c par_coarsen_device.c par_coarse_parms_device.c par_indepset_device.c @@ -156,6 +174,7 @@ if (HYPRE_USING_CUDA) par_interp_trunc_device.c par_lr_interp_device.c par_lr_restr_device.c + par_mod_multi_interp_device.c par_strength_device.c par_strength2nd_device.c par_relax_more_device.c @@ -163,9 +182,12 @@ if (HYPRE_USING_CUDA) par_amgdd_fac_cycle_device.c par_2s_interp_device.c par_relax_device.c + par_mgr_device.c + par_fsai_device.c + dsuperlu.c ) - convert_filenames_to_full_paths(CUDA_SRCS) - set(HYPRE_CUDA_SOURCES ${HYPRE_CUDA_SOURCES} ${CUDA_SRCS} PARENT_SCOPE) + convert_filenames_to_full_paths(GPU_SRCS) + set(HYPRE_GPU_SOURCES ${HYPRE_GPU_SOURCES} ${GPU_SRCS} PARENT_SCOPE) endif () convert_filenames_to_full_paths(HDRS) diff --git a/external/hypre/src/parcsr_ls/Common.h b/external/hypre/src/parcsr_ls/Common.h index b8ff4fe5..6958ddc6 100644 --- a/external/hypre/src/parcsr_ls/Common.h +++ b/external/hypre/src/parcsr_ls/Common.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/parcsr_ls/F90_HYPRE_ams.c b/external/hypre/src/parcsr_ls/F90_HYPRE_ams.c index 33892ed4..2ede61ca 100644 --- a/external/hypre/src/parcsr_ls/F90_HYPRE_ams.c +++ b/external/hypre/src/parcsr_ls/F90_HYPRE_ams.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,19 +17,19 @@ #ifdef __cplusplus extern "C" { #endif - + /*-------------------------------------------------------------------------- * HYPRE_AMSCreate *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_amscreate, HYPRE_AMSCREATE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *ierr) +( hypre_F90_Obj *solver, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_AMSCreate( - hypre_F90_PassObjRef (HYPRE_Solver, solver) ) ); + ( HYPRE_AMSCreate( + hypre_F90_PassObjRef (HYPRE_Solver, solver) ) ); } /*-------------------------------------------------------------------------- @@ -38,12 +38,12 @@ hypre_F90_IFACE(hypre_amscreate, HYPRE_AMSCREATE) void hypre_F90_IFACE(hypre_amsdestroy, HYPRE_AMSDESTROY) - ( hypre_F90_Obj *solver, - hypre_F90_Int *ierr) +( hypre_F90_Obj *solver, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_AMSDestroy( - hypre_F90_PassObj (HYPRE_Solver, solver) ) ); + ( HYPRE_AMSDestroy( + hypre_F90_PassObj (HYPRE_Solver, solver) ) ); } /*-------------------------------------------------------------------------- @@ -52,18 +52,18 @@ hypre_F90_IFACE(hypre_amsdestroy, HYPRE_AMSDESTROY) void hypre_F90_IFACE(hypre_amssetup, HYPRE_AMSSETUP) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_AMSSetup( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), - hypre_F90_PassObj (HYPRE_ParVector, b), - hypre_F90_PassObj (HYPRE_ParVector, x) ) ); + ( HYPRE_AMSSetup( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), + hypre_F90_PassObj (HYPRE_ParVector, b), + hypre_F90_PassObj (HYPRE_ParVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -72,18 +72,18 @@ hypre_F90_IFACE(hypre_amssetup, HYPRE_AMSSETUP) void hypre_F90_IFACE(hypre_amssolve, HYPRE_AMSSOLVE) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_AMSSolve( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), - hypre_F90_PassObj (HYPRE_ParVector, b), - hypre_F90_PassObj (HYPRE_ParVector, x) ) ); + ( HYPRE_AMSSolve( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), + hypre_F90_PassObj (HYPRE_ParVector, b), + hypre_F90_PassObj (HYPRE_ParVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -92,14 +92,14 @@ hypre_F90_IFACE(hypre_amssolve, HYPRE_AMSSOLVE) void hypre_F90_IFACE(hypre_amssetdimension, HYPRE_AMSSETDIMENSION) - ( hypre_F90_Obj *solver, - hypre_F90_Int *dim, - hypre_F90_Int *ierr) +( hypre_F90_Obj *solver, + hypre_F90_Int *dim, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_AMSSetDimension( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (dim) ) ); + ( HYPRE_AMSSetDimension( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (dim) ) ); } /*-------------------------------------------------------------------------- @@ -108,14 +108,14 @@ hypre_F90_IFACE(hypre_amssetdimension, HYPRE_AMSSETDIMENSION) void hypre_F90_IFACE(hypre_amssetdiscretegradient, HYPRE_AMSSETDISCRETEGRADIENT) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *G, - hypre_F90_Int *ierr) +( hypre_F90_Obj *solver, + hypre_F90_Obj *G, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_AMSSetDiscreteGradient( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObj (HYPRE_ParCSRMatrix, G) ) ); + ( HYPRE_AMSSetDiscreteGradient( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObj (HYPRE_ParCSRMatrix, G) ) ); } /*-------------------------------------------------------------------------- @@ -124,18 +124,18 @@ hypre_F90_IFACE(hypre_amssetdiscretegradient, HYPRE_AMSSETDISCRETEGRADIENT) void hypre_F90_IFACE(hypre_amssetcoordinatevectors, HYPRE_AMSSETCOORDINATEVECTORS) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *x, - hypre_F90_Obj *y, - hypre_F90_Obj *z, - hypre_F90_Int *ierr) +( hypre_F90_Obj *solver, + hypre_F90_Obj *x, + hypre_F90_Obj *y, + hypre_F90_Obj *z, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_AMSSetCoordinateVectors( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObj (HYPRE_ParVector, x), - hypre_F90_PassObj (HYPRE_ParVector, y), - hypre_F90_PassObj (HYPRE_ParVector, z) ) ); + ( HYPRE_AMSSetCoordinateVectors( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObj (HYPRE_ParVector, x), + hypre_F90_PassObj (HYPRE_ParVector, y), + hypre_F90_PassObj (HYPRE_ParVector, z) ) ); } /*-------------------------------------------------------------------------- @@ -144,18 +144,18 @@ hypre_F90_IFACE(hypre_amssetcoordinatevectors, HYPRE_AMSSETCOORDINATEVECTORS) void hypre_F90_IFACE(hypre_amssetedgeconstantvectors, HYPRE_AMSSETEDGECONSTANTVECTORS) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *Gx, - hypre_F90_Obj *Gy, - hypre_F90_Obj *Gz, - hypre_F90_Int *ierr) +( hypre_F90_Obj *solver, + hypre_F90_Obj *Gx, + hypre_F90_Obj *Gy, + hypre_F90_Obj *Gz, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_AMSSetEdgeConstantVectors( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObj (HYPRE_ParVector, Gx), - hypre_F90_PassObj (HYPRE_ParVector, Gy), - hypre_F90_PassObj (HYPRE_ParVector, Gz) ) ); + ( HYPRE_AMSSetEdgeConstantVectors( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObj (HYPRE_ParVector, Gx), + hypre_F90_PassObj (HYPRE_ParVector, Gy), + hypre_F90_PassObj (HYPRE_ParVector, Gz) ) ); } /*-------------------------------------------------------------------------- @@ -164,14 +164,14 @@ hypre_F90_IFACE(hypre_amssetedgeconstantvectors, HYPRE_AMSSETEDGECONSTANTVECTORS void hypre_F90_IFACE(hypre_amssetalphapoissonmatrix, HYPRE_AMSSETALPHAPOISSONMATRIX) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A_alpha, - hypre_F90_Int *ierr) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A_alpha, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_AMSSetAlphaPoissonMatrix( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObj (HYPRE_ParCSRMatrix, A_alpha) ) ); + ( HYPRE_AMSSetAlphaPoissonMatrix( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObj (HYPRE_ParCSRMatrix, A_alpha) ) ); } /*-------------------------------------------------------------------------- @@ -180,14 +180,14 @@ hypre_F90_IFACE(hypre_amssetalphapoissonmatrix, HYPRE_AMSSETALPHAPOISSONMATRIX) void hypre_F90_IFACE(hypre_amssetbetapoissonmatrix, HYPRE_AMSSETBETAPOISSONMATRIX) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A_beta, - hypre_F90_Int *ierr) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A_beta, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_AMSSetBetaPoissonMatrix( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObj (HYPRE_ParCSRMatrix, A_beta) ) ); + ( HYPRE_AMSSetBetaPoissonMatrix( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObj (HYPRE_ParCSRMatrix, A_beta) ) ); } /*-------------------------------------------------------------------------- @@ -196,14 +196,14 @@ hypre_F90_IFACE(hypre_amssetbetapoissonmatrix, HYPRE_AMSSETBETAPOISSONMATRIX) void hypre_F90_IFACE(hypre_amssetmaxiter, HYPRE_AMSSETMAXITER) - ( hypre_F90_Obj *solver, - hypre_F90_Int *maxiter, - hypre_F90_Int *ierr) +( hypre_F90_Obj *solver, + hypre_F90_Int *maxiter, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_AMSSetMaxIter( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (maxiter) ) ); + ( HYPRE_AMSSetMaxIter( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (maxiter) ) ); } /*-------------------------------------------------------------------------- @@ -212,14 +212,14 @@ hypre_F90_IFACE(hypre_amssetmaxiter, HYPRE_AMSSETMAXITER) void hypre_F90_IFACE(hypre_amssettol, HYPRE_AMSSETTOL) - ( hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr) +( hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_AMSSetTol( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (tol) ) ); + ( HYPRE_AMSSetTol( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (tol) ) ); } /*-------------------------------------------------------------------------- @@ -228,14 +228,14 @@ hypre_F90_IFACE(hypre_amssettol, HYPRE_AMSSETTOL) void hypre_F90_IFACE(hypre_amssetcycletype, HYPRE_AMSSETCYCLETYPE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *cycle_type, - hypre_F90_Int *ierr) +( hypre_F90_Obj *solver, + hypre_F90_Int *cycle_type, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_AMSSetCycleType( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (cycle_type) ) ); + ( HYPRE_AMSSetCycleType( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (cycle_type) ) ); } /*-------------------------------------------------------------------------- @@ -244,14 +244,14 @@ hypre_F90_IFACE(hypre_amssetcycletype, HYPRE_AMSSETCYCLETYPE) void hypre_F90_IFACE(hypre_amssetprintlevel, HYPRE_AMSSETPRINTLEVEL) - ( hypre_F90_Obj *solver, - hypre_F90_Int *print_level, - hypre_F90_Int *ierr) +( hypre_F90_Obj *solver, + hypre_F90_Int *print_level, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_AMSSetPrintLevel( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (print_level) ) ); + ( HYPRE_AMSSetPrintLevel( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (print_level) ) ); } /*-------------------------------------------------------------------------- @@ -260,20 +260,20 @@ hypre_F90_IFACE(hypre_amssetprintlevel, HYPRE_AMSSETPRINTLEVEL) void hypre_F90_IFACE(hypre_amssetsmoothingoptions, HYPRE_AMSSETSMOOTHINGOPTIONS) - ( hypre_F90_Obj *solver, - hypre_F90_Int *relax_type, - hypre_F90_Int *relax_times, - hypre_F90_Real *relax_weight, - hypre_F90_Real *omega, - hypre_F90_Int *ierr) +( hypre_F90_Obj *solver, + hypre_F90_Int *relax_type, + hypre_F90_Int *relax_times, + hypre_F90_Real *relax_weight, + hypre_F90_Real *omega, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_AMSSetSmoothingOptions( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (relax_type), - hypre_F90_PassInt (relax_times), - hypre_F90_PassReal (relax_weight), - hypre_F90_PassReal (omega) ) ); + ( HYPRE_AMSSetSmoothingOptions( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (relax_type), + hypre_F90_PassInt (relax_times), + hypre_F90_PassReal (relax_weight), + hypre_F90_PassReal (omega) ) ); } /*-------------------------------------------------------------------------- @@ -282,25 +282,25 @@ hypre_F90_IFACE(hypre_amssetsmoothingoptions, HYPRE_AMSSETSMOOTHINGOPTIONS) void hypre_F90_IFACE(hypre_amssetalphaamgoptions, HYPRE_AMSSETALPHAAMGOPTIONS) - ( hypre_F90_Obj *solver, - hypre_F90_Int *alpha_coarsen_type, - hypre_F90_Int *alpha_agg_levels, - hypre_F90_Int *alpha_relax_type, - hypre_F90_Real *alpha_strength_threshold, - hypre_F90_Int *alpha_interp_type, - hypre_F90_Int *alpha_Pmax, - hypre_F90_Int *ierr) +( hypre_F90_Obj *solver, + hypre_F90_Int *alpha_coarsen_type, + hypre_F90_Int *alpha_agg_levels, + hypre_F90_Int *alpha_relax_type, + hypre_F90_Real *alpha_strength_threshold, + hypre_F90_Int *alpha_interp_type, + hypre_F90_Int *alpha_Pmax, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_AMSSetAlphaAMGOptions( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (alpha_coarsen_type), - hypre_F90_PassInt (alpha_agg_levels), - hypre_F90_PassInt (alpha_relax_type), - hypre_F90_PassReal (alpha_strength_threshold), - hypre_F90_PassInt (alpha_interp_type), - hypre_F90_PassInt (alpha_Pmax) ) ); + ( HYPRE_AMSSetAlphaAMGOptions( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (alpha_coarsen_type), + hypre_F90_PassInt (alpha_agg_levels), + hypre_F90_PassInt (alpha_relax_type), + hypre_F90_PassReal (alpha_strength_threshold), + hypre_F90_PassInt (alpha_interp_type), + hypre_F90_PassInt (alpha_Pmax) ) ); } /*-------------------------------------------------------------------------- @@ -309,25 +309,25 @@ hypre_F90_IFACE(hypre_amssetalphaamgoptions, HYPRE_AMSSETALPHAAMGOPTIONS) void hypre_F90_IFACE(hypre_amssetbetaamgoptions, HYPRE_AMSSETBETAAMGOPTIONS) - ( hypre_F90_Obj *solver, - hypre_F90_Int *beta_coarsen_type, - hypre_F90_Int *beta_agg_levels, - hypre_F90_Int *beta_relax_type, - hypre_F90_Real *beta_strength_threshold, - hypre_F90_Int *beta_interp_type, - hypre_F90_Int *beta_Pmax, - hypre_F90_Int *ierr) +( hypre_F90_Obj *solver, + hypre_F90_Int *beta_coarsen_type, + hypre_F90_Int *beta_agg_levels, + hypre_F90_Int *beta_relax_type, + hypre_F90_Real *beta_strength_threshold, + hypre_F90_Int *beta_interp_type, + hypre_F90_Int *beta_Pmax, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_AMSSetBetaAMGOptions( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (beta_coarsen_type), - hypre_F90_PassInt (beta_agg_levels), - hypre_F90_PassInt (beta_relax_type), - hypre_F90_PassReal (beta_strength_threshold), - hypre_F90_PassInt (beta_interp_type), - hypre_F90_PassInt (beta_Pmax) ) ); + ( HYPRE_AMSSetBetaAMGOptions( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (beta_coarsen_type), + hypre_F90_PassInt (beta_agg_levels), + hypre_F90_PassInt (beta_relax_type), + hypre_F90_PassReal (beta_strength_threshold), + hypre_F90_PassInt (beta_interp_type), + hypre_F90_PassInt (beta_Pmax) ) ); } /*-------------------------------------------------------------------------- @@ -336,14 +336,14 @@ hypre_F90_IFACE(hypre_amssetbetaamgoptions, HYPRE_AMSSETBETAAMGOPTIONS) void hypre_F90_IFACE(hypre_amsgetnumiterations, HYPRE_AMSGETNUMITERATIONS) - ( hypre_F90_Obj *solver, - hypre_F90_Int *num_iterations, - hypre_F90_Int *ierr) +( hypre_F90_Obj *solver, + hypre_F90_Int *num_iterations, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_AMSGetNumIterations( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntRef (num_iterations) ) ); + ( HYPRE_AMSGetNumIterations( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntRef (num_iterations) ) ); } /*-------------------------------------------------------------------------- @@ -352,14 +352,14 @@ hypre_F90_IFACE(hypre_amsgetnumiterations, HYPRE_AMSGETNUMITERATIONS) void hypre_F90_IFACE(hypre_amsgetfinalrelativeresidualnorm, HYPRE_AMSGETFINALRELATIVERESIDUALNORM) - ( hypre_F90_Obj *solver, - hypre_F90_Real *rel_resid_norm, - hypre_F90_Int *ierr) +( hypre_F90_Obj *solver, + hypre_F90_Real *rel_resid_norm, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_AMSGetFinalRelativeResidualNorm( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassRealRef (rel_resid_norm) ) ); + ( HYPRE_AMSGetFinalRelativeResidualNorm( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassRealRef (rel_resid_norm) ) ); } /*-------------------------------------------------------------------------- @@ -368,22 +368,22 @@ hypre_F90_IFACE(hypre_amsgetfinalrelativeresidualnorm, HYPRE_AMSGETFINALRELATIVE void hypre_F90_IFACE(hypre_amsconstructdiscretegradient, HYPRE_AMSCONSTRUCTDISCRETEGRADIENT) - ( hypre_F90_Obj *A, - hypre_F90_Obj *x_coord, - hypre_F90_BigIntArray *edge_vertex, - hypre_F90_Int *edge_orientation, - hypre_F90_Obj *G, - hypre_F90_Int *ierr) +( hypre_F90_Obj *A, + hypre_F90_Obj *x_coord, + hypre_F90_BigIntArray *edge_vertex, + hypre_F90_Int *edge_orientation, + hypre_F90_Obj *G, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_AMSConstructDiscreteGradient( - hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), - hypre_F90_PassObj (HYPRE_ParVector, x_coord), - hypre_F90_PassBigIntArray (edge_vertex), - hypre_F90_PassInt (edge_orientation), - hypre_F90_PassObjRef (HYPRE_ParCSRMatrix, G) ) ); + ( HYPRE_AMSConstructDiscreteGradient( + hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), + hypre_F90_PassObj (HYPRE_ParVector, x_coord), + hypre_F90_PassBigIntArray (edge_vertex), + hypre_F90_PassInt (edge_orientation), + hypre_F90_PassObjRef (HYPRE_ParCSRMatrix, G) ) ); } - + #ifdef __cplusplus } #endif diff --git a/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_Euclid.c b/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_Euclid.c index 2052fdce..6e1ce68a 100644 --- a/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_Euclid.c +++ b/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_Euclid.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,103 +17,103 @@ #ifdef __cplusplus extern "C" { #endif - + /*-------------------------------------------------------------------------- - * HYPRE_EuclidCreate - Return a Euclid "solver". + * HYPRE_EuclidCreate - Return a Euclid "solver". *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_euclidcreate, HYPRE_EUCLIDCREATE) - (hypre_F90_Comm *comm, - hypre_F90_Obj *solver, - hypre_F90_Int *ierr) +(hypre_F90_Comm *comm, + hypre_F90_Obj *solver, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) HYPRE_EuclidCreate( - hypre_F90_PassComm (comm), - hypre_F90_PassObjRef (HYPRE_Solver, solver) ); + hypre_F90_PassComm (comm), + hypre_F90_PassObjRef (HYPRE_Solver, solver) ); } /*-------------------------------------------------------------------------- * HYPRE_EuclidDestroy - Destroy a Euclid object. *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_eucliddestroy, HYPRE_EUCLIDDESTROY) - (hypre_F90_Obj *solver, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) HYPRE_EuclidDestroy( - hypre_F90_PassObj (HYPRE_Solver, solver) ); + hypre_F90_PassObj (HYPRE_Solver, solver) ); } /*-------------------------------------------------------------------------- * HYPRE_EuclidSetup - Set up function for Euclid. *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_euclidsetup, HYPRE_EUCLIDSETUP) - (hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) HYPRE_EuclidSetup( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), - hypre_F90_PassObj (HYPRE_ParVector, b), - hypre_F90_PassObj (HYPRE_ParVector, x) ); + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), + hypre_F90_PassObj (HYPRE_ParVector, b), + hypre_F90_PassObj (HYPRE_ParVector, x) ); } /*-------------------------------------------------------------------------- * HYPRE_EuclidSolve - Solve function for Euclid. *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_euclidsolve, HYPRE_EUCLIDSOLVE) - (hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) HYPRE_EuclidSolve( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), - hypre_F90_PassObj (HYPRE_ParVector, b), - hypre_F90_PassObj (HYPRE_ParVector, x) ); + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), + hypre_F90_PassObj (HYPRE_ParVector, b), + hypre_F90_PassObj (HYPRE_ParVector, x) ); } /*-------------------------------------------------------------------------- * HYPRE_EuclidSetParams *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_euclidsetparams, HYPRE_EUCLIDSETPARAMS) - (hypre_F90_Obj *solver, - hypre_F90_Int *argc, - char **argv, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *argc, + char **argv, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) HYPRE_EuclidSetParams( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (argc), - (char **) argv ); + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (argc), + (char **) argv ); } /*-------------------------------------------------------------------------- * HYPRE_EuclidSetParamsFromFile *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_euclidsetparamsfromfile, HYPRE_EUCLIDSETPARAMSFROMFILE) - (hypre_F90_Obj *solver, - char *filename, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + char *filename, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) HYPRE_EuclidSetParamsFromFile( - hypre_F90_PassObj (HYPRE_Solver, solver), - (char *) filename ); + hypre_F90_PassObj (HYPRE_Solver, solver), + (char *) filename ); } /*-------------------------------------------------------------------------- @@ -122,13 +122,13 @@ hypre_F90_IFACE(hypre_euclidsetparamsfromfile, HYPRE_EUCLIDSETPARAMSFROMFILE) void hypre_F90_IFACE(hypre_euclidsetlevel, HYPRE_EUCLIDSETLEVEL) - (hypre_F90_Obj *solver, - hypre_F90_Int *eu_level, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *eu_level, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) HYPRE_EuclidSetLevel( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (eu_level) ); + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (eu_level) ); } /*-------------------------------------------------------------------------- @@ -137,13 +137,13 @@ hypre_F90_IFACE(hypre_euclidsetlevel, HYPRE_EUCLIDSETLEVEL) void hypre_F90_IFACE(hypre_euclidsetbj, HYPRE_EUCLIDSETBJ) - (hypre_F90_Obj *solver, - hypre_F90_Int *bj, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *bj, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) HYPRE_EuclidSetBJ( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (bj) ); + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (bj) ); } /*-------------------------------------------------------------------------- @@ -152,13 +152,13 @@ hypre_F90_IFACE(hypre_euclidsetbj, HYPRE_EUCLIDSETBJ) void hypre_F90_IFACE(hypre_euclidsetstats, HYPRE_EUCLIDSETSTATS) - (hypre_F90_Obj *solver, - hypre_F90_Int *eu_stats, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *eu_stats, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) HYPRE_EuclidSetStats( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (eu_stats) ); + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (eu_stats) ); } /*-------------------------------------------------------------------------- @@ -167,13 +167,13 @@ hypre_F90_IFACE(hypre_euclidsetstats, HYPRE_EUCLIDSETSTATS) void hypre_F90_IFACE(hypre_euclidsetmem, HYPRE_EUCLIDSETMEM) - (hypre_F90_Obj *solver, - hypre_F90_Int *eu_mem, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *eu_mem, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) HYPRE_EuclidSetMem( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (eu_mem) ); + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (eu_mem) ); } /*-------------------------------------------------------------------------- @@ -182,13 +182,13 @@ hypre_F90_IFACE(hypre_euclidsetmem, HYPRE_EUCLIDSETMEM) void hypre_F90_IFACE(hypre_euclidsetsparsea, HYPRE_EUCLIDSETSPARSEA) - (hypre_F90_Obj *solver, - hypre_F90_Real *spa, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Real *spa, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) HYPRE_EuclidSetSparseA( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (spa) ); + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (spa) ); } /*-------------------------------------------------------------------------- @@ -197,13 +197,13 @@ hypre_F90_IFACE(hypre_euclidsetsparsea, HYPRE_EUCLIDSETSPARSEA) void hypre_F90_IFACE(hypre_euclidsetrowscale, HYPRE_EUCLIDSETROWSCALE) - (hypre_F90_Obj *solver, - hypre_F90_Int *row_scale, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *row_scale, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) HYPRE_EuclidSetRowScale( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (row_scale) ); + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (row_scale) ); } /*-------------------------------------------------------------------------- @@ -212,13 +212,13 @@ hypre_F90_IFACE(hypre_euclidsetrowscale, HYPRE_EUCLIDSETROWSCALE) void hypre_F90_IFACE(hypre_euclidsetilut, HYPRE_EUCLIDSETILUT) - (hypre_F90_Obj *solver, - hypre_F90_Real *drop_tol, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Real *drop_tol, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) HYPRE_EuclidSetILUT( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (drop_tol) ); + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (drop_tol) ); } #ifdef __cplusplus diff --git a/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_ParaSails.c b/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_ParaSails.c index fa5c468b..f072459a 100644 --- a/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_ParaSails.c +++ b/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_ParaSails.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,21 +17,21 @@ #ifdef __cplusplus extern "C" { #endif - + /*-------------------------------------------------------------------------- * HYPRE_ParaSailsCreate *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_parasailscreate, HYPRE_PARASAILSCREATE) - ( hypre_F90_Comm *comm, - hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Comm *comm, + hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParaSailsCreate( - hypre_F90_PassComm (comm), - hypre_F90_PassObjRef (HYPRE_Solver, solver) ) ); + ( HYPRE_ParaSailsCreate( + hypre_F90_PassComm (comm), + hypre_F90_PassObjRef (HYPRE_Solver, solver) ) ); } /*-------------------------------------------------------------------------- @@ -40,128 +40,128 @@ hypre_F90_IFACE(hypre_parasailscreate, HYPRE_PARASAILSCREATE) void hypre_F90_IFACE(hypre_parasailsdestroy, HYPRE_PARASAILSDESTROY) - ( hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParaSailsDestroy( - hypre_F90_PassObj (HYPRE_Solver, solver) ) ); + ( HYPRE_ParaSailsDestroy( + hypre_F90_PassObj (HYPRE_Solver, solver) ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParaSailsSetup *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_parasailssetup, HYPRE_PARASAILSSETUP) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParaSailsSetup( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), - hypre_F90_PassObj (HYPRE_ParVector, b), - hypre_F90_PassObj (HYPRE_ParVector, x) ) ); + ( HYPRE_ParaSailsSetup( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), + hypre_F90_PassObj (HYPRE_ParVector, b), + hypre_F90_PassObj (HYPRE_ParVector, x) ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParaSailsSolve *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_parasailssolve, HYPRE_PARASAILSSOLVE) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParaSailsSolve( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), - hypre_F90_PassObj (HYPRE_ParVector, b), - hypre_F90_PassObj (HYPRE_ParVector, x) ) ); + ( HYPRE_ParaSailsSolve( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), + hypre_F90_PassObj (HYPRE_ParVector, b), + hypre_F90_PassObj (HYPRE_ParVector, x) ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParaSailsSetParams *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_parasailssetparams, HYPRE_PARASAILSSETPARAMS) - ( hypre_F90_Obj *solver, - hypre_F90_Real *thresh, - hypre_F90_Int *nlevels, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *thresh, + hypre_F90_Int *nlevels, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParaSailsSetParams( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (thresh), - hypre_F90_PassInt (nlevels) ) ); + ( HYPRE_ParaSailsSetParams( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (thresh), + hypre_F90_PassInt (nlevels) ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParaSailsSetThresh, HYPRE_ParaSailsGetThresh *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_parasailssetthresh, HYPRE_PARASAILSSETTHRESH) - ( hypre_F90_Obj *solver, - hypre_F90_Real *thresh, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *thresh, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParaSailsSetThresh( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (thresh) ) ); + ( HYPRE_ParaSailsSetThresh( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (thresh) ) ); } -void +void hypre_F90_IFACE(hypre_parasailsgetthresh, HYPRE_PARASAILSGETTHRESH) - ( hypre_F90_Obj *solver, - hypre_F90_Real *thresh, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *thresh, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParaSailsGetThresh( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassRealRef (thresh) ) ); + ( HYPRE_ParaSailsGetThresh( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassRealRef (thresh) ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParaSailsSetNlevels, HYPRE_ParaSailsGetNlevels *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_parasailssetnlevels, HYPRE_PARASAILSSETNLEVELS) - ( hypre_F90_Obj *solver, - hypre_F90_Int *nlevels, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *nlevels, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParaSailsSetNlevels( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (nlevels)) ); + ( HYPRE_ParaSailsSetNlevels( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (nlevels)) ); } -void +void hypre_F90_IFACE(hypre_parasailsgetnlevels, HYPRE_PARASAILSGETNLEVELS) - ( hypre_F90_Obj *solver, - hypre_F90_Int *nlevels, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *nlevels, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParaSailsGetNlevels( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntRef (nlevels)) ); + ( HYPRE_ParaSailsGetNlevels( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntRef (nlevels)) ); } /*-------------------------------------------------------------------------- @@ -170,27 +170,27 @@ hypre_F90_IFACE(hypre_parasailsgetnlevels, HYPRE_PARASAILSGETNLEVELS) void hypre_F90_IFACE(hypre_parasailssetfilter, HYPRE_PARASAILSSETFILTER) - ( hypre_F90_Obj *solver, - hypre_F90_Real *filter, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *filter, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParaSailsSetFilter( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (filter) ) ); + ( HYPRE_ParaSailsSetFilter( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (filter) ) ); } void hypre_F90_IFACE(hypre_parasailsgetfilter, HYPRE_PARASAILSGETFILTER) - ( hypre_F90_Obj *solver, - hypre_F90_Real *filter, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *filter, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParaSailsGetFilter( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassRealRef (filter) ) ); + ( HYPRE_ParaSailsGetFilter( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassRealRef (filter) ) ); } /*-------------------------------------------------------------------------- @@ -199,26 +199,26 @@ hypre_F90_IFACE(hypre_parasailsgetfilter, HYPRE_PARASAILSGETFILTER) void hypre_F90_IFACE(hypre_parasailssetsym, HYPRE_PARASAILSSETSYM) - ( hypre_F90_Obj *solver, - hypre_F90_Int *sym, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *sym, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParaSailsSetSym( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (sym) ) ); + ( HYPRE_ParaSailsSetSym( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (sym) ) ); } void hypre_F90_IFACE(hypre_parasailsgetsym, HYPRE_PARASAILSGETSYM) - ( hypre_F90_Obj *solver, - hypre_F90_Int *sym, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *sym, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParaSailsGetSym( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntRef (sym) ) ); + ( HYPRE_ParaSailsGetSym( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntRef (sym) ) ); } /*-------------------------------------------------------------------------- @@ -227,26 +227,26 @@ hypre_F90_IFACE(hypre_parasailsgetsym, HYPRE_PARASAILSGETSYM) void hypre_F90_IFACE(hypre_parasailssetloadbal, HYPRE_PARASAILSSETLOADBAL) - ( hypre_F90_Obj *solver, - hypre_F90_Real *loadbal, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *loadbal, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParaSailsSetLoadbal( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (loadbal) ) ); + ( HYPRE_ParaSailsSetLoadbal( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (loadbal) ) ); } void hypre_F90_IFACE(hypre_parasailsgetloadbal, HYPRE_PARASAILSGETLOADBAL) - ( hypre_F90_Obj *solver, - hypre_F90_Real *loadbal, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *loadbal, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParaSailsGetLoadbal( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassRealRef (loadbal) ) ); + ( HYPRE_ParaSailsGetLoadbal( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassRealRef (loadbal) ) ); } /*-------------------------------------------------------------------------- @@ -255,26 +255,26 @@ hypre_F90_IFACE(hypre_parasailsgetloadbal, HYPRE_PARASAILSGETLOADBAL) void hypre_F90_IFACE(hypre_parasailssetreuse, HYPRE_PARASAILSSETREUSE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *reuse, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *reuse, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParaSailsSetReuse( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (reuse) ) ); + ( HYPRE_ParaSailsSetReuse( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (reuse) ) ); } void hypre_F90_IFACE(hypre_parasailsgetreuse, HYPRE_PARASAILSGETREUSE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *reuse, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *reuse, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParaSailsGetReuse( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntRef (reuse) ) ); + ( HYPRE_ParaSailsGetReuse( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntRef (reuse) ) ); } /*-------------------------------------------------------------------------- @@ -283,28 +283,28 @@ hypre_F90_IFACE(hypre_parasailsgetreuse, HYPRE_PARASAILSGETREUSE) void hypre_F90_IFACE(hypre_parasailssetlogging, HYPRE_PARASAILSSETLOGGING) - ( hypre_F90_Obj *solver, - hypre_F90_Int *logging, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *logging, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParaSailsSetLogging( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (logging) ) ); + ( HYPRE_ParaSailsSetLogging( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (logging) ) ); } void hypre_F90_IFACE(hypre_parasailsgetlogging, HYPRE_PARASAILSGETLOGGING) - ( hypre_F90_Obj *solver, - hypre_F90_Int *logging, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *logging, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParaSailsGetLogging( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntRef (logging) ) ); + ( HYPRE_ParaSailsGetLogging( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntRef (logging) ) ); } - + #ifdef __cplusplus } #endif diff --git a/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_amg.c b/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_amg.c index db490b91..82812091 100644 --- a/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_amg.c +++ b/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_amg.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -24,12 +24,12 @@ extern "C" { void hypre_F90_IFACE(hypre_boomeramgcreate, HYPRE_BOOMERAMGCREATE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGCreate( - hypre_F90_PassObjRef (HYPRE_Solver, solver)) ); + ( HYPRE_BoomerAMGCreate( + hypre_F90_PassObjRef (HYPRE_Solver, solver)) ); } /*-------------------------------------------------------------------------- @@ -38,12 +38,12 @@ hypre_F90_IFACE(hypre_boomeramgcreate, HYPRE_BOOMERAMGCREATE) void hypre_F90_IFACE(hypre_boomeramgdestroy, HYPRE_BOOMERAMGDESTROY) - ( hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGDestroy( - hypre_F90_PassObj (HYPRE_Solver, solver) ) ); + ( HYPRE_BoomerAMGDestroy( + hypre_F90_PassObj (HYPRE_Solver, solver) ) ); } /*-------------------------------------------------------------------------- @@ -52,18 +52,18 @@ hypre_F90_IFACE(hypre_boomeramgdestroy, HYPRE_BOOMERAMGDESTROY) void hypre_F90_IFACE(hypre_boomeramgsetup, HYPRE_BOOMERAMGSETUP) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetup( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), - hypre_F90_PassObj (HYPRE_ParVector, b), - hypre_F90_PassObj (HYPRE_ParVector, x) ) ); + ( HYPRE_BoomerAMGSetup( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), + hypre_F90_PassObj (HYPRE_ParVector, b), + hypre_F90_PassObj (HYPRE_ParVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -72,18 +72,18 @@ hypre_F90_IFACE(hypre_boomeramgsetup, HYPRE_BOOMERAMGSETUP) void hypre_F90_IFACE(hypre_boomeramgsolve, HYPRE_BOOMERAMGSOLVE) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSolve( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), - hypre_F90_PassObj (HYPRE_ParVector, b), - hypre_F90_PassObj (HYPRE_ParVector, x) ) ); + ( HYPRE_BoomerAMGSolve( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), + hypre_F90_PassObj (HYPRE_ParVector, b), + hypre_F90_PassObj (HYPRE_ParVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -92,18 +92,18 @@ hypre_F90_IFACE(hypre_boomeramgsolve, HYPRE_BOOMERAMGSOLVE) void hypre_F90_IFACE(hypre_boomeramgsolvet, HYPRE_BOOMERAMGSOLVET) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSolveT( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), - hypre_F90_PassObj (HYPRE_ParVector, b), - hypre_F90_PassObj (HYPRE_ParVector, x) ) ); + ( HYPRE_BoomerAMGSolveT( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), + hypre_F90_PassObj (HYPRE_ParVector, b), + hypre_F90_PassObj (HYPRE_ParVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -112,14 +112,14 @@ hypre_F90_IFACE(hypre_boomeramgsolvet, HYPRE_BOOMERAMGSOLVET) void hypre_F90_IFACE(hypre_boomeramgsetrestriction, HYPRE_BOOMERAMGSETRESTRICTION) - ( hypre_F90_Obj *solver, - hypre_F90_Int *restr_par, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *restr_par, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetRestriction( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (restr_par) ) ); + ( HYPRE_BoomerAMGSetRestriction( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (restr_par) ) ); } /*-------------------------------------------------------------------------- @@ -128,28 +128,28 @@ hypre_F90_IFACE(hypre_boomeramgsetrestriction, HYPRE_BOOMERAMGSETRESTRICTION) void hypre_F90_IFACE(hypre_boomeramgsetmaxlevels, HYPRE_BOOMERAMGSETMAXLEVELS) - ( hypre_F90_Obj *solver, - hypre_F90_Int *max_levels, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *max_levels, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetMaxLevels( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (max_levels) ) ); + ( HYPRE_BoomerAMGSetMaxLevels( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (max_levels) ) ); } void hypre_F90_IFACE(hypre_boomeramggetmaxlevels, HYPRE_BOOMERAMGGETMAXLEVELS) - ( hypre_F90_Obj *solver, - hypre_F90_Int *max_levels, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *max_levels, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGGetMaxLevels( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntRef (max_levels) ) ); + ( HYPRE_BoomerAMGGetMaxLevels( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntRef (max_levels) ) ); } /*-------------------------------------------------------------------------- @@ -159,28 +159,28 @@ hypre_F90_IFACE(hypre_boomeramggetmaxlevels, HYPRE_BOOMERAMGGETMAXLEVELS) void hypre_F90_IFACE(hypre_boomeramgsetmaxcoarsesize, HYPRE_BOOMERAMGSETMAXCOARSESIZE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *max_coarse_size, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *max_coarse_size, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetMaxCoarseSize( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (max_coarse_size) ) ); + ( HYPRE_BoomerAMGSetMaxCoarseSize( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (max_coarse_size) ) ); } void hypre_F90_IFACE(hypre_boomeramggetmaxcoarsesize, HYPRE_BOOMERAMGGETMAXCOARSESIZE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *max_coarse_size, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *max_coarse_size, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGGetMaxCoarseSize( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntRef (max_coarse_size) ) ); + ( HYPRE_BoomerAMGGetMaxCoarseSize( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntRef (max_coarse_size) ) ); } @@ -191,28 +191,28 @@ hypre_F90_IFACE(hypre_boomeramggetmaxcoarsesize, HYPRE_BOOMERAMGGETMAXCOARSESIZE void hypre_F90_IFACE(hypre_boomeramgsetmincoarsesize, HYPRE_BOOMERAMGSETMINCOARSESIZE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *min_coarse_size, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *min_coarse_size, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetMinCoarseSize( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (min_coarse_size) ) ); + ( HYPRE_BoomerAMGSetMinCoarseSize( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (min_coarse_size) ) ); } void hypre_F90_IFACE(hypre_boomeramggetmincoarsesize, HYPRE_BOOMERAMGGETMINCOARSESIZE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *min_coarse_size, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *min_coarse_size, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGGetMinCoarseSize( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntRef (min_coarse_size) ) ); + ( HYPRE_BoomerAMGGetMinCoarseSize( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntRef (min_coarse_size) ) ); } @@ -224,26 +224,26 @@ hypre_F90_IFACE(hypre_boomeramggetmincoarsesize, HYPRE_BOOMERAMGGETMINCOARSESIZE void hypre_F90_IFACE(hypre_boomeramgsetstrongthrshld, HYPRE_BOOMERAMGSETSTRONGTHRSHLD) - ( hypre_F90_Obj *solver, - hypre_F90_Real *strong_threshold, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *strong_threshold, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetStrongThreshold( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (strong_threshold) ) ); + ( HYPRE_BoomerAMGSetStrongThreshold( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (strong_threshold) ) ); } void hypre_F90_IFACE(hypre_boomeramggetstrongthrshld, HYPRE_BOOMERAMGGETSTRONGTHRSHLD) - ( hypre_F90_Obj *solver, - hypre_F90_Real *strong_threshold, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *strong_threshold, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGGetStrongThreshold( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassRealRef (strong_threshold) ) ); + ( HYPRE_BoomerAMGGetStrongThreshold( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassRealRef (strong_threshold) ) ); } /*-------------------------------------------------------------------------- @@ -252,26 +252,26 @@ hypre_F90_IFACE(hypre_boomeramggetstrongthrshld, HYPRE_BOOMERAMGGETSTRONGTHRSHLD void hypre_F90_IFACE(hypre_boomeramgsetmaxrowsum, HYPRE_BOOMERAMGSETMAXROWSUM) - ( hypre_F90_Obj *solver, - hypre_F90_Real *max_row_sum, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *max_row_sum, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetMaxRowSum( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (max_row_sum) ) ); + ( HYPRE_BoomerAMGSetMaxRowSum( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (max_row_sum) ) ); } void hypre_F90_IFACE(hypre_boomeramggetmaxrowsum, HYPRE_BOOMERAMGGETMAXROWSUM) - ( hypre_F90_Obj *solver, - hypre_F90_Real *max_row_sum, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *max_row_sum, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGGetMaxRowSum( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassRealRef (max_row_sum) ) ); + ( HYPRE_BoomerAMGGetMaxRowSum( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassRealRef (max_row_sum) ) ); } /*-------------------------------------------------------------------------- @@ -280,26 +280,26 @@ hypre_F90_IFACE(hypre_boomeramggetmaxrowsum, HYPRE_BOOMERAMGGETMAXROWSUM) void hypre_F90_IFACE(hypre_boomeramgsettruncfactor, HYPRE_BOOMERAMGSETTRUNCFACTOR) - ( hypre_F90_Obj *solver, - hypre_F90_Real *trunc_factor, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *trunc_factor, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetTruncFactor( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (trunc_factor) ) ); + ( HYPRE_BoomerAMGSetTruncFactor( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (trunc_factor) ) ); } void hypre_F90_IFACE(hypre_boomeramggettruncfactor, HYPRE_BOOMERAMGGETTRUNCFACTOR) - ( hypre_F90_Obj *solver, - hypre_F90_Real *trunc_factor, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *trunc_factor, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGGetTruncFactor( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassRealRef (trunc_factor) ) ); + ( HYPRE_BoomerAMGGetTruncFactor( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassRealRef (trunc_factor) ) ); } /*-------------------------------------------------------------------------- @@ -308,26 +308,26 @@ hypre_F90_IFACE(hypre_boomeramggettruncfactor, HYPRE_BOOMERAMGGETTRUNCFACTOR) void hypre_F90_IFACE(hypre_boomeramgsetpmaxelmts, HYPRE_BOOMERAMGSETPMAXELMTS) - ( hypre_F90_Obj *solver, - hypre_F90_Int *p_max_elmts, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *p_max_elmts, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetPMaxElmts( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (p_max_elmts) ) ); + ( HYPRE_BoomerAMGSetPMaxElmts( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (p_max_elmts) ) ); } void hypre_F90_IFACE(hypre_boomeramggetpmaxelmts, HYPRE_BOOMERAMGGETPMAXELMTS) - ( hypre_F90_Obj *solver, - hypre_F90_Int *p_max_elmts, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *p_max_elmts, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGGetPMaxElmts( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntRef (p_max_elmts) ) ); + ( HYPRE_BoomerAMGGetPMaxElmts( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntRef (p_max_elmts) ) ); } /*-------------------------------------------------------------------------- @@ -336,26 +336,26 @@ hypre_F90_IFACE(hypre_boomeramggetpmaxelmts, HYPRE_BOOMERAMGGETPMAXELMTS) void hypre_F90_IFACE(hypre_boomeramgsetjacobitrunc, HYPRE_BOOMERAMGSETJACOBITRUNC) - ( hypre_F90_Obj *solver, - hypre_F90_Real *trunc_factor, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *trunc_factor, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetJacobiTruncThreshold( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (trunc_factor) ) ); + ( HYPRE_BoomerAMGSetJacobiTruncThreshold( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (trunc_factor) ) ); } void hypre_F90_IFACE(hypre_boomeramggetjacobitrunc, HYPRE_BOOMERAMGGETJACOBITRUNC) - ( hypre_F90_Obj *solver, - hypre_F90_Real *trunc_factor, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *trunc_factor, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGGetJacobiTruncThreshold( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassRealRef (trunc_factor) ) ); + ( HYPRE_BoomerAMGGetJacobiTruncThreshold( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassRealRef (trunc_factor) ) ); } /*-------------------------------------------------------------------------- @@ -366,14 +366,14 @@ hypre_F90_IFACE(hypre_boomeramggetjacobitrunc, HYPRE_BOOMERAMGGETJACOBITRUNC) void hypre_F90_IFACE(hypre_boomeramgsetpostinterp, HYPRE_BOOMERAMGSETPOSTINTERP) - ( hypre_F90_Obj *solver, - hypre_F90_Int *type, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *type, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetPostInterpType( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (type) ) ); + ( HYPRE_BoomerAMGSetPostInterpType( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (type) ) ); } @@ -383,28 +383,28 @@ hypre_F90_IFACE(hypre_boomeramgsetpostinterp, HYPRE_BOOMERAMGSETPOSTINTERP) void hypre_F90_IFACE(hypre_boomeramgsetinterptype, HYPRE_BOOMERAMGSETINTERPTYPE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *interp_type, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *interp_type, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetInterpType( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (interp_type) ) ); + ( HYPRE_BoomerAMGSetInterpType( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (interp_type) ) ); } /*-------------------------------------------------------------------------- * HYPRE_BoomerAMGSetSepWeight *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_boomeramgsetsepweight, HYPRE_BOOMERAMGSETSEPWEIGHT) - ( hypre_F90_Obj *solver, - hypre_F90_Int *sep_weight, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *sep_weight, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetSepWeight( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (sep_weight) ) ); + ( HYPRE_BoomerAMGSetSepWeight( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (sep_weight) ) ); } /*-------------------------------------------------------------------------- @@ -413,14 +413,14 @@ hypre_F90_IFACE(hypre_boomeramgsetsepweight, HYPRE_BOOMERAMGSETSEPWEIGHT) void hypre_F90_IFACE(hypre_boomeramgsetminiter, HYPRE_BOOMERAMGSETMINITER) - ( hypre_F90_Obj *solver, - hypre_F90_Int *min_iter, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *min_iter, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetMinIter( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (min_iter) ) ); + ( HYPRE_BoomerAMGSetMinIter( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (min_iter) ) ); } /*-------------------------------------------------------------------------- @@ -429,26 +429,26 @@ hypre_F90_IFACE(hypre_boomeramgsetminiter, HYPRE_BOOMERAMGSETMINITER) void hypre_F90_IFACE(hypre_boomeramgsetmaxiter, HYPRE_BOOMERAMGSETMAXITER) - ( hypre_F90_Obj *solver, - hypre_F90_Int *max_iter, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *max_iter, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetMaxIter( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (max_iter) ) ); + ( HYPRE_BoomerAMGSetMaxIter( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (max_iter) ) ); } void hypre_F90_IFACE(hypre_boomeramggetmaxiter, HYPRE_BOOMERAMGGETMAXITER) - ( hypre_F90_Obj *solver, - hypre_F90_Int *max_iter, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *max_iter, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGGetMaxIter( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntRef (max_iter) ) ); + ( HYPRE_BoomerAMGGetMaxIter( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntRef (max_iter) ) ); } /*-------------------------------------------------------------------------- @@ -457,26 +457,26 @@ hypre_F90_IFACE(hypre_boomeramggetmaxiter, HYPRE_BOOMERAMGGETMAXITER) void hypre_F90_IFACE(hypre_boomeramgsetcoarsentype, HYPRE_BOOMERAMGSETCOARSENTYPE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *coarsen_type, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *coarsen_type, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetCoarsenType( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (coarsen_type) ) ); + ( HYPRE_BoomerAMGSetCoarsenType( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (coarsen_type) ) ); } void hypre_F90_IFACE(hypre_boomeramggetcoarsentype, HYPRE_BOOMERAMGGETCOARSENTYPE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *coarsen_type, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *coarsen_type, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGGetCoarsenType( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntRef (coarsen_type) ) ); + ( HYPRE_BoomerAMGGetCoarsenType( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntRef (coarsen_type) ) ); } /*-------------------------------------------------------------------------- @@ -485,26 +485,26 @@ hypre_F90_IFACE(hypre_boomeramggetcoarsentype, HYPRE_BOOMERAMGGETCOARSENTYPE) void hypre_F90_IFACE(hypre_boomeramgsetmeasuretype, HYPRE_BOOMERAMGSETMEASURETYPE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *measure_type, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *measure_type, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetMeasureType( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (measure_type) ) ); + ( HYPRE_BoomerAMGSetMeasureType( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (measure_type) ) ); } void hypre_F90_IFACE(hypre_boomeramggetmeasuretype, HYPRE_BOOMERAMGGETMEASURETYPE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *measure_type, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *measure_type, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGGetMeasureType( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntRef (measure_type) ) ); + ( HYPRE_BoomerAMGGetMeasureType( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntRef (measure_type) ) ); } /*-------------------------------------------------------------------------- @@ -513,12 +513,12 @@ hypre_F90_IFACE(hypre_boomeramggetmeasuretype, HYPRE_BOOMERAMGGETMEASURETYPE) void hypre_F90_IFACE(hypre_boomeramgsetolddefault, HYPRE_BOOMERAMGSETOLDDEFAULT) - ( hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetOldDefault( - hypre_F90_PassObj (HYPRE_Solver, solver) ) ); + ( HYPRE_BoomerAMGSetOldDefault( + hypre_F90_PassObj (HYPRE_Solver, solver) ) ); } /*-------------------------------------------------------------------------- @@ -527,14 +527,14 @@ hypre_F90_IFACE(hypre_boomeramgsetolddefault, HYPRE_BOOMERAMGSETOLDDEFAULT) void hypre_F90_IFACE(hypre_boomeramgsetsetuptype, HYPRE_BOOMERAMGSETSETUPTYPE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *setup_type, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *setup_type, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetSetupType( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (setup_type) ) ); + ( HYPRE_BoomerAMGSetSetupType( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (setup_type) ) ); } /*-------------------------------------------------------------------------- @@ -543,26 +543,26 @@ hypre_F90_IFACE(hypre_boomeramgsetsetuptype, HYPRE_BOOMERAMGSETSETUPTYPE) void hypre_F90_IFACE(hypre_boomeramgsetcycletype, HYPRE_BOOMERAMGSETCYCLETYPE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *cycle_type, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *cycle_type, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetCycleType( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (cycle_type) ) ); + ( HYPRE_BoomerAMGSetCycleType( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (cycle_type) ) ); } void hypre_F90_IFACE(hypre_boomeramggetcycletype, HYPRE_BOOMERAMGGETCYCLETYPE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *cycle_type, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *cycle_type, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGGetCycleType( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntRef (cycle_type) ) ); + ( HYPRE_BoomerAMGGetCycleType( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntRef (cycle_type) ) ); } /*-------------------------------------------------------------------------- @@ -571,26 +571,26 @@ hypre_F90_IFACE(hypre_boomeramggetcycletype, HYPRE_BOOMERAMGGETCYCLETYPE) void hypre_F90_IFACE(hypre_boomeramgsettol, HYPRE_BOOMERAMGSETTOL) - ( hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetTol( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (tol) ) ); + ( HYPRE_BoomerAMGSetTol( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (tol) ) ); } void hypre_F90_IFACE(hypre_boomeramggettol, HYPRE_BOOMERAMGGETTOL) - ( hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGGetTol( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassRealRef (tol) ) ); + ( HYPRE_BoomerAMGGetTol( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassRealRef (tol) ) ); } /*-------------------------------------------------------------------------- @@ -600,14 +600,14 @@ hypre_F90_IFACE(hypre_boomeramggettol, HYPRE_BOOMERAMGGETTOL) void hypre_F90_IFACE(hypre_boomeramgsetnumgridsweeps, HYPRE_BOOMERAMGSETNUMGRIDSWEEPS) - ( hypre_F90_Obj *solver, - hypre_F90_Int *num_grid_sweeps, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *num_grid_sweeps, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetNumGridSweeps( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntRef (num_grid_sweeps) ) ); + ( HYPRE_BoomerAMGSetNumGridSweeps( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntRef (num_grid_sweeps) ) ); } /*-------------------------------------------------------------------------- @@ -616,14 +616,14 @@ hypre_F90_IFACE(hypre_boomeramgsetnumgridsweeps, HYPRE_BOOMERAMGSETNUMGRIDSWEEPS void hypre_F90_IFACE(hypre_boomeramgsetnumsweeps, HYPRE_BOOMERAMGSETNUMSWEEPS) - ( hypre_F90_Obj *solver, - hypre_F90_Int *num_sweeps, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *num_sweeps, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetNumSweeps( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (num_sweeps) ) ); + ( HYPRE_BoomerAMGSetNumSweeps( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (num_sweeps) ) ); } /*-------------------------------------------------------------------------- @@ -632,30 +632,30 @@ hypre_F90_IFACE(hypre_boomeramgsetnumsweeps, HYPRE_BOOMERAMGSETNUMSWEEPS) void hypre_F90_IFACE(hypre_boomeramgsetcyclenumsweeps, HYPRE_BOOMERAMGSETCYCLENUMSWEEPS) - ( hypre_F90_Obj *solver, - hypre_F90_Int *num_sweeps, - hypre_F90_Int *k, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *num_sweeps, + hypre_F90_Int *k, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetCycleNumSweeps( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (num_sweeps), - hypre_F90_PassInt (k) ) ); + ( HYPRE_BoomerAMGSetCycleNumSweeps( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (num_sweeps), + hypre_F90_PassInt (k) ) ); } void hypre_F90_IFACE(hypre_boomeramggetcyclenumsweeps, HYPRE_BOOMERAMGGETCYCLENUMSWEEPS) - ( hypre_F90_Obj *solver, - hypre_F90_Int *num_sweeps, - hypre_F90_Int *k, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *num_sweeps, + hypre_F90_Int *k, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGGetCycleNumSweeps( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntRef (num_sweeps), - hypre_F90_PassInt (k) ) ); + ( HYPRE_BoomerAMGGetCycleNumSweeps( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntRef (num_sweeps), + hypre_F90_PassInt (k) ) ); } /*-------------------------------------------------------------------------- @@ -667,13 +667,13 @@ hypre_F90_IFACE(hypre_boomeramggetcyclenumsweeps, HYPRE_BOOMERAMGGETCYCLENUMSWEE void hypre_F90_IFACE(hypre_boomeramginitgridrelaxatn, HYPRE_BOOMERAMGINITGRIDRELAXATN) - ( hypre_F90_Obj *num_grid_sweeps, - hypre_F90_Obj *grid_relax_type, - hypre_F90_Obj *grid_relax_points, - hypre_F90_Int *coarsen_type, - hypre_F90_Obj *relax_weights, - hypre_F90_Int *max_levels, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *num_grid_sweeps, + hypre_F90_Obj *grid_relax_type, + hypre_F90_Obj *grid_relax_points, + hypre_F90_Int *coarsen_type, + hypre_F90_Obj *relax_weights, + hypre_F90_Int *max_levels, + hypre_F90_Int *ierr ) { *num_grid_sweeps = (hypre_F90_Obj) hypre_CTAlloc(HYPRE_Int*, 1, HYPRE_MEMORY_HOST); *grid_relax_type = (hypre_F90_Obj) hypre_CTAlloc(HYPRE_Int*, 1, HYPRE_MEMORY_HOST); @@ -681,13 +681,13 @@ hypre_F90_IFACE(hypre_boomeramginitgridrelaxatn, HYPRE_BOOMERAMGINITGRIDRELAXATN *relax_weights = (hypre_F90_Obj) hypre_CTAlloc(HYPRE_Real*, 1, HYPRE_MEMORY_HOST); *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGInitGridRelaxation( - (HYPRE_Int **) *num_grid_sweeps, - (HYPRE_Int **) *grid_relax_type, - (HYPRE_Int ***) *grid_relax_points, - hypre_F90_PassInt (coarsen_type), - (HYPRE_Real **) *relax_weights, - hypre_F90_PassInt (max_levels) ) ); + ( HYPRE_BoomerAMGInitGridRelaxation( + (HYPRE_Int **) *num_grid_sweeps, + (HYPRE_Int **) *grid_relax_type, + (HYPRE_Int ***) *grid_relax_points, + hypre_F90_PassInt (coarsen_type), + (HYPRE_Real **) *relax_weights, + hypre_F90_PassInt (max_levels) ) ); } /*-------------------------------------------------------------------------- @@ -699,11 +699,11 @@ hypre_F90_IFACE(hypre_boomeramginitgridrelaxatn, HYPRE_BOOMERAMGINITGRIDRELAXATN void hypre_F90_IFACE(hypre_boomeramgfingridrelaxatn, HYPRE_BOOMERAMGFINGRIDRELAXATN) - ( hypre_F90_Obj *num_grid_sweeps, - hypre_F90_Obj *grid_relax_type, - hypre_F90_Obj *grid_relax_points, - hypre_F90_Obj *relax_weights, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *num_grid_sweeps, + hypre_F90_Obj *grid_relax_type, + hypre_F90_Obj *grid_relax_points, + hypre_F90_Obj *relax_weights, + hypre_F90_Int *ierr ) { char *ptr_num_grid_sweeps = (char *) *num_grid_sweeps; char *ptr_grid_relax_type = (char *) *grid_relax_type; @@ -725,14 +725,14 @@ hypre_F90_IFACE(hypre_boomeramgfingridrelaxatn, HYPRE_BOOMERAMGFINGRIDRELAXATN) void hypre_F90_IFACE(hypre_boomeramgsetgridrelaxtype, HYPRE_BOOMERAMGSETGRIDRELAXTYPE) - ( hypre_F90_Obj *solver, - hypre_F90_IntArray *grid_relax_type, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_IntArray *grid_relax_type, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetGridRelaxType( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntArray (grid_relax_type) ) ); + ( HYPRE_BoomerAMGSetGridRelaxType( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntArray (grid_relax_type) ) ); } /*-------------------------------------------------------------------------- @@ -741,14 +741,14 @@ hypre_F90_IFACE(hypre_boomeramgsetgridrelaxtype, HYPRE_BOOMERAMGSETGRIDRELAXTYPE void hypre_F90_IFACE(hypre_boomeramgsetrelaxtype, HYPRE_BOOMERAMGSETRELAXTYPE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *relax_type, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *relax_type, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetRelaxType( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (relax_type) ) ); + ( HYPRE_BoomerAMGSetRelaxType( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (relax_type) ) ); } /*-------------------------------------------------------------------------- @@ -757,30 +757,30 @@ hypre_F90_IFACE(hypre_boomeramgsetrelaxtype, HYPRE_BOOMERAMGSETRELAXTYPE) void hypre_F90_IFACE(hypre_boomeramgsetcyclerelaxtype, HYPRE_BOOMERAMGSETCYCLERELAXTYPE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *relax_type, - hypre_F90_Int *k, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *relax_type, + hypre_F90_Int *k, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetCycleRelaxType( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (relax_type), - hypre_F90_PassInt (k) ) ); + ( HYPRE_BoomerAMGSetCycleRelaxType( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (relax_type), + hypre_F90_PassInt (k) ) ); } void hypre_F90_IFACE(hypre_boomeramggetcyclerelaxtype, HYPRE_BOOMERAMGGETCYCLERELAXTYPE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *relax_type, - hypre_F90_Int *k, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *relax_type, + hypre_F90_Int *k, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGGetCycleRelaxType( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntRef (relax_type), - hypre_F90_PassInt (k) ) ); + ( HYPRE_BoomerAMGGetCycleRelaxType( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntRef (relax_type), + hypre_F90_PassInt (k) ) ); } /*-------------------------------------------------------------------------- @@ -789,14 +789,14 @@ hypre_F90_IFACE(hypre_boomeramggetcyclerelaxtype, HYPRE_BOOMERAMGGETCYCLERELAXTY void hypre_F90_IFACE(hypre_boomeramgsetrelaxorder, HYPRE_BOOMERAMGSETRELAXORDER) - ( hypre_F90_Obj *solver, - hypre_F90_Int *relax_order, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *relax_order, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetRelaxOrder( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (relax_order) ) ); + ( HYPRE_BoomerAMGSetRelaxOrder( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (relax_order) ) ); } /*-------------------------------------------------------------------------- @@ -806,14 +806,14 @@ hypre_F90_IFACE(hypre_boomeramgsetrelaxorder, HYPRE_BOOMERAMGSETRELAXORDER) void hypre_F90_IFACE(hypre_boomeramgsetgridrelaxpnts, HYPRE_BOOMERAMGSETGRIDRELAXPNTS) - ( hypre_F90_Obj *solver, - HYPRE_Int **grid_relax_points, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + HYPRE_Int **grid_relax_points, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetGridRelaxPoints( - hypre_F90_PassObj (HYPRE_Solver, solver), - (HYPRE_Int **) grid_relax_points ) ); + ( HYPRE_BoomerAMGSetGridRelaxPoints( + hypre_F90_PassObj (HYPRE_Solver, solver), + (HYPRE_Int **) grid_relax_points ) ); } /*-------------------------------------------------------------------------- @@ -823,14 +823,14 @@ hypre_F90_IFACE(hypre_boomeramgsetgridrelaxpnts, HYPRE_BOOMERAMGSETGRIDRELAXPNTS void hypre_F90_IFACE(hypre_boomeramgsetrelaxweight, HYPRE_BOOMERAMGSETRELAXWEIGHT) - ( hypre_F90_Obj *solver, - hypre_F90_IntArray *relax_weights, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_IntArray *relax_weights, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetRelaxWeight( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassRealArray (relax_weights) ) ); + ( HYPRE_BoomerAMGSetRelaxWeight( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassRealArray (relax_weights) ) ); } /*-------------------------------------------------------------------------- @@ -839,14 +839,14 @@ hypre_F90_IFACE(hypre_boomeramgsetrelaxweight, HYPRE_BOOMERAMGSETRELAXWEIGHT) void hypre_F90_IFACE(hypre_boomeramgsetrelaxwt, HYPRE_BOOMERAMGSETRELAXWT) - ( hypre_F90_Obj *solver, - hypre_F90_Real *relax_weight, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *relax_weight, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetRelaxWt( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (relax_weight) ) ); + ( HYPRE_BoomerAMGSetRelaxWt( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (relax_weight) ) ); } /*-------------------------------------------------------------------------- @@ -855,16 +855,16 @@ hypre_F90_IFACE(hypre_boomeramgsetrelaxwt, HYPRE_BOOMERAMGSETRELAXWT) void hypre_F90_IFACE(hypre_boomeramgsetlevelrelaxwt, HYPRE_BOOMERAMGSETLEVELRELAXWT) - ( hypre_F90_Obj *solver, - hypre_F90_Real *relax_weight, - hypre_F90_Int *level, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *relax_weight, + hypre_F90_Int *level, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetLevelRelaxWt( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (relax_weight), - hypre_F90_PassInt (level) ) ); + ( HYPRE_BoomerAMGSetLevelRelaxWt( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (relax_weight), + hypre_F90_PassInt (level) ) ); } @@ -876,14 +876,14 @@ hypre_F90_IFACE(hypre_boomeramgsetlevelrelaxwt, HYPRE_BOOMERAMGSETLEVELRELAXWT) void hypre_F90_IFACE(hypre_boomeramgsetouterwt, HYPRE_BOOMERAMGSETOUTERWT) - ( hypre_F90_Obj *solver, - hypre_F90_Real *outer_wt, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *outer_wt, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetOuterWt( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (outer_wt) ) ); + ( HYPRE_BoomerAMGSetOuterWt( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (outer_wt) ) ); } /*-------------------------------------------------------------------------- @@ -892,16 +892,16 @@ hypre_F90_IFACE(hypre_boomeramgsetouterwt, HYPRE_BOOMERAMGSETOUTERWT) void hypre_F90_IFACE(hypre_boomeramgsetlevelouterwt, HYPRE_BOOMERAMGSETLEVELOUTERWT) - ( hypre_F90_Obj *solver, - hypre_F90_Real *outer_wt, - hypre_F90_Int *level, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *outer_wt, + hypre_F90_Int *level, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetLevelOuterWt( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (outer_wt), - hypre_F90_PassInt (level) ) ); + ( HYPRE_BoomerAMGSetLevelOuterWt( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (outer_wt), + hypre_F90_PassInt (level) ) ); } /*-------------------------------------------------------------------------- @@ -910,26 +910,26 @@ hypre_F90_IFACE(hypre_boomeramgsetlevelouterwt, HYPRE_BOOMERAMGSETLEVELOUTERWT) void hypre_F90_IFACE(hypre_boomeramgsetsmoothtype, HYPRE_BOOMERAMGSETSMOOTHTYPE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *smooth_type, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *smooth_type, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetSmoothType( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (smooth_type) ) ); + ( HYPRE_BoomerAMGSetSmoothType( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (smooth_type) ) ); } void hypre_F90_IFACE(hypre_boomeramggetsmoothtype, HYPRE_BOOMERAMGGETSMOOTHTYPE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *smooth_type, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *smooth_type, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGGetSmoothType( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntRef (smooth_type) ) ); + ( HYPRE_BoomerAMGGetSmoothType( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntRef (smooth_type) ) ); } /*-------------------------------------------------------------------------- @@ -938,26 +938,26 @@ hypre_F90_IFACE(hypre_boomeramggetsmoothtype, HYPRE_BOOMERAMGGETSMOOTHTYPE) void hypre_F90_IFACE(hypre_boomeramgsetsmoothnumlvls, HYPRE_BOOMERAMGSETSMOOTHNUMLVLS) - ( hypre_F90_Obj *solver, - hypre_F90_Int *smooth_num_levels, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *smooth_num_levels, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetSmoothNumLevels( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (smooth_num_levels) ) ); + ( HYPRE_BoomerAMGSetSmoothNumLevels( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (smooth_num_levels) ) ); } void hypre_F90_IFACE(hypre_boomeramggetsmoothnumlvls, HYPRE_BOOMERAMGGETSMOOTHNUMLVLS) - ( hypre_F90_Obj *solver, - hypre_F90_Int *smooth_num_levels, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *smooth_num_levels, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGGetSmoothNumLevels( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntRef (smooth_num_levels) ) ); + ( HYPRE_BoomerAMGGetSmoothNumLevels( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntRef (smooth_num_levels) ) ); } /*-------------------------------------------------------------------------- @@ -966,26 +966,26 @@ hypre_F90_IFACE(hypre_boomeramggetsmoothnumlvls, HYPRE_BOOMERAMGGETSMOOTHNUMLVLS void hypre_F90_IFACE(hypre_boomeramgsetsmoothnumswps, HYPRE_BOOMERAMGSETSMOOTHNUMSWPS) - ( hypre_F90_Obj *solver, - hypre_F90_Int *smooth_num_sweeps, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *smooth_num_sweeps, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetSmoothNumSweeps( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (smooth_num_sweeps) ) ); + ( HYPRE_BoomerAMGSetSmoothNumSweeps( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (smooth_num_sweeps) ) ); } void hypre_F90_IFACE(hypre_boomeramggetsmoothnumswps, HYPRE_BOOMERAMGGETSMOOTHNUMSWPS) - ( hypre_F90_Obj *solver, - hypre_F90_Int *smooth_num_sweeps, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *smooth_num_sweeps, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGGetSmoothNumSweeps( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntRef (smooth_num_sweeps) ) ); + ( HYPRE_BoomerAMGGetSmoothNumSweeps( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntRef (smooth_num_sweeps) ) ); } /*-------------------------------------------------------------------------- @@ -994,26 +994,26 @@ hypre_F90_IFACE(hypre_boomeramggetsmoothnumswps, HYPRE_BOOMERAMGGETSMOOTHNUMSWPS void hypre_F90_IFACE(hypre_boomeramgsetlogging, HYPRE_BOOMERAMGSETLOGGING) - ( hypre_F90_Obj *solver, - hypre_F90_Int *logging, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *logging, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetLogging( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (logging) ) ); + ( HYPRE_BoomerAMGSetLogging( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (logging) ) ); } void hypre_F90_IFACE(hypre_boomeramggetlogging, HYPRE_BOOMERAMGGETLOGGING) - ( hypre_F90_Obj *solver, - hypre_F90_Int *logging, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *logging, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGGetLogging( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntRef (logging) ) ); + ( HYPRE_BoomerAMGGetLogging( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntRef (logging) ) ); } /*-------------------------------------------------------------------------- @@ -1022,26 +1022,26 @@ hypre_F90_IFACE(hypre_boomeramggetlogging, HYPRE_BOOMERAMGGETLOGGING) void hypre_F90_IFACE(hypre_boomeramgsetprintlevel, HYPRE_BOOMERAMGSETPRINTLEVEL) - ( hypre_F90_Obj *solver, - hypre_F90_Int *print_level, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *print_level, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetPrintLevel( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (print_level) ) ); + ( HYPRE_BoomerAMGSetPrintLevel( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (print_level) ) ); } void hypre_F90_IFACE(hypre_boomeramggetprintlevel, HYPRE_BOOMERAMGGETPRINTLEVEL) - ( hypre_F90_Obj *solver, - hypre_F90_Int *print_level, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *print_level, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGGetPrintLevel( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntRef (print_level) ) ); + ( HYPRE_BoomerAMGGetPrintLevel( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntRef (print_level) ) ); } /*-------------------------------------------------------------------------- @@ -1050,14 +1050,14 @@ hypre_F90_IFACE(hypre_boomeramggetprintlevel, HYPRE_BOOMERAMGGETPRINTLEVEL) void hypre_F90_IFACE(hypre_boomeramgsetprintfilename, HYPRE_BOOMERAMGSETPRINTFILENAME) - ( hypre_F90_Obj *solver, - char *print_file_name, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + char *print_file_name, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetPrintFileName( - hypre_F90_PassObj (HYPRE_Solver, solver), - (char *) print_file_name ) ); + ( HYPRE_BoomerAMGSetPrintFileName( + hypre_F90_PassObj (HYPRE_Solver, solver), + (char *) print_file_name ) ); } /*-------------------------------------------------------------------------- @@ -1066,26 +1066,26 @@ hypre_F90_IFACE(hypre_boomeramgsetprintfilename, HYPRE_BOOMERAMGSETPRINTFILENAME void hypre_F90_IFACE(hypre_boomeramgsetdebugflag, HYPRE_BOOMERAMGSETDEBUGFLAG) - ( hypre_F90_Obj *solver, - hypre_F90_Int *debug_flag, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *debug_flag, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetDebugFlag( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (debug_flag) ) ); + ( HYPRE_BoomerAMGSetDebugFlag( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (debug_flag) ) ); } void hypre_F90_IFACE(hypre_boomeramggetdebugflag, HYPRE_BOOMERAMGGETDEBUGFLAG) - ( hypre_F90_Obj *solver, - hypre_F90_Int *debug_flag, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *debug_flag, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGGetDebugFlag( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntRef (debug_flag) ) ); + ( HYPRE_BoomerAMGGetDebugFlag( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntRef (debug_flag) ) ); } /*-------------------------------------------------------------------------- @@ -1094,14 +1094,14 @@ hypre_F90_IFACE(hypre_boomeramggetdebugflag, HYPRE_BOOMERAMGGETDEBUGFLAG) void hypre_F90_IFACE(hypre_boomeramggetnumiterations, HYPRE_BOOMERAMGGETNUMITERATIONS) - ( hypre_F90_Obj *solver, - hypre_F90_Int *num_iterations, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *num_iterations, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGGetNumIterations( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntRef (num_iterations) ) ); + ( HYPRE_BoomerAMGGetNumIterations( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntRef (num_iterations) ) ); } /*-------------------------------------------------------------------------- @@ -1110,14 +1110,14 @@ hypre_F90_IFACE(hypre_boomeramggetnumiterations, HYPRE_BOOMERAMGGETNUMITERATIONS void hypre_F90_IFACE(hypre_boomeramggetcumnumiterati, HYPRE_BOOMERAMGGETCUMNUMITERATI) - ( hypre_F90_Obj *solver, - hypre_F90_Int *cum_num_iterations, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *cum_num_iterations, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGGetCumNumIterations( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntRef (cum_num_iterations) ) ); + ( HYPRE_BoomerAMGGetCumNumIterations( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntRef (cum_num_iterations) ) ); } /*-------------------------------------------------------------------------- @@ -1126,14 +1126,14 @@ hypre_F90_IFACE(hypre_boomeramggetcumnumiterati, HYPRE_BOOMERAMGGETCUMNUMITERATI void hypre_F90_IFACE(hypre_boomeramggetresidual, HYPRE_BOOMERAMGGETRESIDUAL) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *residual, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *residual, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGGetResidual( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObjRef (HYPRE_ParVector, residual)) ); + ( HYPRE_BoomerAMGGetResidual( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObjRef (HYPRE_ParVector, residual)) ); } /*-------------------------------------------------------------------------- @@ -1142,14 +1142,14 @@ hypre_F90_IFACE(hypre_boomeramggetresidual, HYPRE_BOOMERAMGGETRESIDUAL) void hypre_F90_IFACE(hypre_boomeramggetfinalreltvres, HYPRE_BOOMERAMGGETFINALRELTVRES) - ( hypre_F90_Obj *solver, - hypre_F90_Real *rel_resid_norm, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *rel_resid_norm, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGGetFinalRelativeResidualNorm( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassRealRef (rel_resid_norm) ) ); + ( HYPRE_BoomerAMGGetFinalRelativeResidualNorm( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassRealRef (rel_resid_norm) ) ); } /*-------------------------------------------------------------------------- @@ -1158,26 +1158,26 @@ hypre_F90_IFACE(hypre_boomeramggetfinalreltvres, HYPRE_BOOMERAMGGETFINALRELTVRES void hypre_F90_IFACE(hypre_boomeramgsetvariant, HYPRE_BOOMERAMGSETVARIANT) - ( hypre_F90_Obj *solver, - hypre_F90_Int *variant, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *variant, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetVariant( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (variant) ) ); + ( HYPRE_BoomerAMGSetVariant( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (variant) ) ); } void hypre_F90_IFACE(hypre_boomeramggetvariant, HYPRE_BOOMERAMGGETVARIANT) - ( hypre_F90_Obj *solver, - hypre_F90_Int *variant, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *variant, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGGetVariant( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntRef (variant) ) ); + ( HYPRE_BoomerAMGGetVariant( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntRef (variant) ) ); } /*-------------------------------------------------------------------------- @@ -1186,26 +1186,26 @@ hypre_F90_IFACE(hypre_boomeramggetvariant, HYPRE_BOOMERAMGGETVARIANT) void hypre_F90_IFACE(hypre_boomeramgsetoverlap, HYPRE_BOOMERAMGSETOVERLAP) - ( hypre_F90_Obj *solver, - hypre_F90_Int *overlap, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *overlap, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetOverlap( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (overlap) ) ); + ( HYPRE_BoomerAMGSetOverlap( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (overlap) ) ); } void hypre_F90_IFACE(hypre_boomeramggetoverlap, HYPRE_BOOMERAMGGETOVERLAP) - ( hypre_F90_Obj *solver, - hypre_F90_Int *overlap, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *overlap, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGGetOverlap( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntRef (overlap) ) ); + ( HYPRE_BoomerAMGGetOverlap( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntRef (overlap) ) ); } /*-------------------------------------------------------------------------- @@ -1214,38 +1214,38 @@ hypre_F90_IFACE(hypre_boomeramggetoverlap, HYPRE_BOOMERAMGGETOVERLAP) void hypre_F90_IFACE(hypre_boomeramgsetdomaintype, HYPRE_BOOMERAMGSETDOMAINTYPE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *domain_type, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *domain_type, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetDomainType( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (domain_type) ) ); + ( HYPRE_BoomerAMGSetDomainType( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (domain_type) ) ); } void hypre_F90_IFACE(hypre_boomeramggetdomaintype, HYPRE_BOOMERAMGGETDOMAINTYPE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *domain_type, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *domain_type, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGGetDomainType( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntRef (domain_type) ) ); + ( HYPRE_BoomerAMGGetDomainType( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntRef (domain_type) ) ); } void hypre_F90_IFACE(hypre_boomeramgsetschwarznonsym, HYPRE_BOOMERAMGSETSCHWARZNONSYM) - ( hypre_F90_Obj *solver, - hypre_F90_Int *schwarz_non_symm, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *schwarz_non_symm, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetSchwarzUseNonSymm( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (schwarz_non_symm) ) ); + ( HYPRE_BoomerAMGSetSchwarzUseNonSymm( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (schwarz_non_symm) ) ); } /*-------------------------------------------------------------------------- @@ -1254,26 +1254,26 @@ hypre_F90_IFACE(hypre_boomeramgsetschwarznonsym, HYPRE_BOOMERAMGSETSCHWARZNONSYM void hypre_F90_IFACE(hypre_boomeramgsetschwarzrlxwt, HYPRE_BOOMERAMGSETSCHWARZRLXWT) - ( hypre_F90_Obj *solver, - hypre_F90_Real *schwarz_rlx_weight, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *schwarz_rlx_weight, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetSchwarzRlxWeight( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (schwarz_rlx_weight)) ); + ( HYPRE_BoomerAMGSetSchwarzRlxWeight( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (schwarz_rlx_weight)) ); } void hypre_F90_IFACE(hypre_boomeramggetschwarzrlxwt, HYPRE_BOOMERAMGGETSCHWARZRLXWT) - ( hypre_F90_Obj *solver, - hypre_F90_Real *schwarz_rlx_weight, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *schwarz_rlx_weight, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGGetSchwarzRlxWeight( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassRealRef (schwarz_rlx_weight)) ); + ( HYPRE_BoomerAMGGetSchwarzRlxWeight( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassRealRef (schwarz_rlx_weight)) ); } /*-------------------------------------------------------------------------- @@ -1282,14 +1282,14 @@ hypre_F90_IFACE(hypre_boomeramggetschwarzrlxwt, HYPRE_BOOMERAMGGETSCHWARZRLXWT) void hypre_F90_IFACE(hypre_boomeramgsetsym, HYPRE_BOOMERAMGSETSYM) - ( hypre_F90_Obj *solver, - hypre_F90_Int *sym, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *sym, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetSym( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (sym) ) ); + ( HYPRE_BoomerAMGSetSym( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (sym) ) ); } /*-------------------------------------------------------------------------- @@ -1298,14 +1298,14 @@ hypre_F90_IFACE(hypre_boomeramgsetsym, HYPRE_BOOMERAMGSETSYM) void hypre_F90_IFACE(hypre_boomeramgsetlevel, HYPRE_BOOMERAMGSETLEVEL) - ( hypre_F90_Obj *solver, - hypre_F90_Int *level, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *level, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetLevel( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (level) ) ); + ( HYPRE_BoomerAMGSetLevel( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (level) ) ); } /*-------------------------------------------------------------------------- @@ -1314,14 +1314,14 @@ hypre_F90_IFACE(hypre_boomeramgsetlevel, HYPRE_BOOMERAMGSETLEVEL) void hypre_F90_IFACE(hypre_boomeramgsetthreshold, HYPRE_BOOMERAMGSETTHRESHOLD) - ( hypre_F90_Obj *solver, - hypre_F90_Real *threshold, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *threshold, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetThreshold( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (threshold)) ); + ( HYPRE_BoomerAMGSetThreshold( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (threshold)) ); } /*-------------------------------------------------------------------------- @@ -1330,14 +1330,14 @@ hypre_F90_IFACE(hypre_boomeramgsetthreshold, HYPRE_BOOMERAMGSETTHRESHOLD) void hypre_F90_IFACE(hypre_boomeramgsetfilter, HYPRE_BOOMERAMGSETFILTER) - ( hypre_F90_Obj *solver, - hypre_F90_Real *filter, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *filter, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetFilter( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (filter)) ); + ( HYPRE_BoomerAMGSetFilter( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (filter)) ); } /*-------------------------------------------------------------------------- @@ -1346,14 +1346,14 @@ hypre_F90_IFACE(hypre_boomeramgsetfilter, HYPRE_BOOMERAMGSETFILTER) void hypre_F90_IFACE(hypre_boomeramgsetdroptol, HYPRE_BOOMERAMGSETDROPTOL) - ( hypre_F90_Obj *solver, - hypre_F90_Real *drop_tol, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *drop_tol, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetDropTol( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (drop_tol)) ); + ( HYPRE_BoomerAMGSetDropTol( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (drop_tol)) ); } /*-------------------------------------------------------------------------- @@ -1362,14 +1362,14 @@ hypre_F90_IFACE(hypre_boomeramgsetdroptol, HYPRE_BOOMERAMGSETDROPTOL) void hypre_F90_IFACE(hypre_boomeramgsetmaxnzperrow, HYPRE_BOOMERAMGSETMAXNZPERROW) - ( hypre_F90_Obj *solver, - hypre_F90_Int *max_nz_per_row, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *max_nz_per_row, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetMaxNzPerRow( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (max_nz_per_row) ) ); + ( HYPRE_BoomerAMGSetMaxNzPerRow( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (max_nz_per_row) ) ); } /*-------------------------------------------------------------------------- @@ -1378,14 +1378,14 @@ hypre_F90_IFACE(hypre_boomeramgsetmaxnzperrow, HYPRE_BOOMERAMGSETMAXNZPERROW) void hypre_F90_IFACE(hypre_boomeramgseteubj, HYPRE_BOOMERAMGSETEUBJ) - ( hypre_F90_Obj *solver, - hypre_F90_Int *eu_bj, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *eu_bj, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetEuBJ( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (eu_bj) ) ); + ( HYPRE_BoomerAMGSetEuBJ( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (eu_bj) ) ); } /*-------------------------------------------------------------------------- @@ -1394,14 +1394,14 @@ hypre_F90_IFACE(hypre_boomeramgseteubj, HYPRE_BOOMERAMGSETEUBJ) void hypre_F90_IFACE(hypre_boomeramgseteulevel, HYPRE_BOOMERAMGSETEULEVEL) - ( hypre_F90_Obj *solver, - hypre_F90_Int *eu_level, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *eu_level, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetEuLevel( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (eu_level) ) ); + ( HYPRE_BoomerAMGSetEuLevel( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (eu_level) ) ); } /*-------------------------------------------------------------------------- @@ -1410,14 +1410,14 @@ hypre_F90_IFACE(hypre_boomeramgseteulevel, HYPRE_BOOMERAMGSETEULEVEL) void hypre_F90_IFACE(hypre_boomeramgseteusparsea, HYPRE_BOOMERAMGSETEUSPARSEA) - ( hypre_F90_Obj *solver, - hypre_F90_Real *eu_sparse_a, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *eu_sparse_a, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetEuSparseA( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (eu_sparse_a)) ); + ( HYPRE_BoomerAMGSetEuSparseA( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (eu_sparse_a)) ); } /*-------------------------------------------------------------------------- @@ -1426,14 +1426,14 @@ hypre_F90_IFACE(hypre_boomeramgseteusparsea, HYPRE_BOOMERAMGSETEUSPARSEA) void hypre_F90_IFACE(hypre_boomeramgseteuclidfile, HYPRE_BOOMERAMGSETEUCLIDFILE) - ( hypre_F90_Obj *solver, - char *euclidfile, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + char *euclidfile, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetEuclidFile( - hypre_F90_PassObj (HYPRE_Solver, solver), - (char *) euclidfile ) ); + ( HYPRE_BoomerAMGSetEuclidFile( + hypre_F90_PassObj (HYPRE_Solver, solver), + (char *) euclidfile ) ); } /*-------------------------------------------------------------------------- @@ -1441,26 +1441,26 @@ hypre_F90_IFACE(hypre_boomeramgseteuclidfile, HYPRE_BOOMERAMGSETEUCLIDFILE) *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_boomeramgsetnumfunctions, HYPRE_BOOMERAMGSETNUMFUNCTIONS) - ( hypre_F90_Obj *solver, - hypre_F90_Int *num_functions, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *num_functions, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetNumFunctions( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (num_functions) ) ); + ( HYPRE_BoomerAMGSetNumFunctions( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (num_functions) ) ); } void hypre_F90_IFACE(hypre_boomeramggetnumfunctions, HYPRE_BOOMERAMGGETNUMFUNCTIONS) - ( hypre_F90_Obj *solver, - hypre_F90_Int *num_functions, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *num_functions, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGGetNumFunctions( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntRef (num_functions) ) ); + ( HYPRE_BoomerAMGGetNumFunctions( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntRef (num_functions) ) ); } /*-------------------------------------------------------------------------- @@ -1468,14 +1468,14 @@ hypre_F90_IFACE(hypre_boomeramggetnumfunctions, HYPRE_BOOMERAMGGETNUMFUNCTIONS) *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_boomeramgsetnodal, HYPRE_BOOMERAMGSETNODAL) - ( hypre_F90_Obj *solver, - hypre_F90_Int *nodal, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *nodal, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetNodal( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (nodal) ) ); + ( HYPRE_BoomerAMGSetNodal( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (nodal) ) ); } /*-------------------------------------------------------------------------- @@ -1483,14 +1483,14 @@ hypre_F90_IFACE(hypre_boomeramgsetnodal, HYPRE_BOOMERAMGSETNODAL) *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_boomeramgsetnodaldiag, HYPRE_BOOMERAMGSETNODALDIAG) - ( hypre_F90_Obj *solver, - hypre_F90_Int *nodal_diag, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *nodal_diag, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetNodalDiag( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (nodal_diag) ) ); + ( HYPRE_BoomerAMGSetNodalDiag( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (nodal_diag) ) ); } /*-------------------------------------------------------------------------- @@ -1499,14 +1499,14 @@ hypre_F90_IFACE(hypre_boomeramgsetnodaldiag, HYPRE_BOOMERAMGSETNODALDIAG) void hypre_F90_IFACE(hypre_boomeramgsetdoffunc, HYPRE_BOOMERAMGSETDOFFUNC) - ( hypre_F90_Obj *solver, - hypre_F90_IntArray *dof_func, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_IntArray *dof_func, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetDofFunc( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntArray (dof_func) ) ); + ( HYPRE_BoomerAMGSetDofFunc( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntArray (dof_func) ) ); } /*-------------------------------------------------------------------------- @@ -1515,14 +1515,14 @@ hypre_F90_IFACE(hypre_boomeramgsetdoffunc, HYPRE_BOOMERAMGSETDOFFUNC) void hypre_F90_IFACE(hypre_boomeramgsetnumpaths, HYPRE_BOOMERAMGSETNUMPATHS) - ( hypre_F90_Obj *solver, - hypre_F90_Int *num_paths, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *num_paths, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetNumPaths( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (num_paths) ) ); + ( HYPRE_BoomerAMGSetNumPaths( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (num_paths) ) ); } /*-------------------------------------------------------------------------- @@ -1531,14 +1531,14 @@ hypre_F90_IFACE(hypre_boomeramgsetnumpaths, HYPRE_BOOMERAMGSETNUMPATHS) void hypre_F90_IFACE(hypre_boomeramgsetaggnumlevels, HYPRE_BOOMERAMGSETAGGNUMLEVELS) - ( hypre_F90_Obj *solver, - hypre_F90_Int *agg_num_levels, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *agg_num_levels, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetAggNumLevels( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (agg_num_levels) ) ); + ( HYPRE_BoomerAMGSetAggNumLevels( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (agg_num_levels) ) ); } @@ -1549,14 +1549,14 @@ hypre_F90_IFACE(hypre_boomeramgsetaggnumlevels, HYPRE_BOOMERAMGSETAGGNUMLEVELS) void hypre_F90_IFACE(hypre_boomeramgsetagginterptype, HYPRE_BOOMERAMGSETAGGINTERPTYPE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *agg_interp_type, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *agg_interp_type, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetAggInterpType( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (agg_interp_type) ) ); + ( HYPRE_BoomerAMGSetAggInterpType( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (agg_interp_type) ) ); } /*-------------------------------------------------------------------------- @@ -1564,14 +1564,14 @@ hypre_F90_IFACE(hypre_boomeramgsetagginterptype, HYPRE_BOOMERAMGSETAGGINTERPTYPE *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_boomeramgsetaggtrfactor, HYPRE_BOOMERAMGSETAGGTRFACTOR) - ( hypre_F90_Obj *solver, - hypre_F90_Real *trunc_factor, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *trunc_factor, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetAggTruncFactor( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (trunc_factor) ) ); + ( HYPRE_BoomerAMGSetAggTruncFactor( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (trunc_factor) ) ); } /*-------------------------------------------------------------------------- @@ -1579,14 +1579,14 @@ hypre_F90_IFACE(hypre_boomeramgsetaggtrfactor, HYPRE_BOOMERAMGSETAGGTRFACTOR) *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_boomeramgsetaggp12trfac, HYPRE_BOOMERAMGSETAGGP12TRFAC) - ( hypre_F90_Obj *solver, - hypre_F90_Real *trunc_factor, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *trunc_factor, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetAggP12TruncFactor( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (trunc_factor) ) ); + ( HYPRE_BoomerAMGSetAggP12TruncFactor( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (trunc_factor) ) ); } /*-------------------------------------------------------------------------- @@ -1595,14 +1595,14 @@ hypre_F90_IFACE(hypre_boomeramgsetaggp12trfac, HYPRE_BOOMERAMGSETAGGP12TRFAC) void hypre_F90_IFACE(hypre_boomeramgsetaggpmaxelmts, HYPRE_BOOMERAMGSETAGGPMAXELMTS) - ( hypre_F90_Obj *solver, - hypre_F90_Int *p_max_elmts, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *p_max_elmts, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetAggPMaxElmts( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (p_max_elmts) ) ); + ( HYPRE_BoomerAMGSetAggPMaxElmts( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (p_max_elmts) ) ); } /*-------------------------------------------------------------------------- @@ -1611,14 +1611,14 @@ hypre_F90_IFACE(hypre_boomeramgsetaggpmaxelmts, HYPRE_BOOMERAMGSETAGGPMAXELMTS) void hypre_F90_IFACE(hypre_boomeramgsetaggp12maxelmt, HYPRE_BOOMERAMGSETAGGP12MAXELMT) - ( hypre_F90_Obj *solver, - hypre_F90_Int *p_max_elmts, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *p_max_elmts, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetAggP12MaxElmts( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (p_max_elmts) ) ); + ( HYPRE_BoomerAMGSetAggP12MaxElmts( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (p_max_elmts) ) ); } /*-------------------------------------------------------------------------- @@ -1627,16 +1627,16 @@ hypre_F90_IFACE(hypre_boomeramgsetaggp12maxelmt, HYPRE_BOOMERAMGSETAGGP12MAXELMT void hypre_F90_IFACE(hypre_boomeramgsetinterpvecs, HYPRE_BOOMERAMGSETINTERPVECS) - ( hypre_F90_Obj *solver, - hypre_F90_Int *num_vectors, - hypre_F90_Obj *interp_vectors, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *num_vectors, + hypre_F90_Obj *interp_vectors, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetInterpVectors( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (num_vectors) , - hypre_F90_PassObjRef (HYPRE_ParVector, interp_vectors) ) ); + ( HYPRE_BoomerAMGSetInterpVectors( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (num_vectors), + hypre_F90_PassObjRef (HYPRE_ParVector, interp_vectors) ) ); } /*-------------------------------------------------------------------------- @@ -1645,14 +1645,14 @@ hypre_F90_IFACE(hypre_boomeramgsetinterpvecs, HYPRE_BOOMERAMGSETINTERPVECS) void hypre_F90_IFACE(hypre_boomeramgsetinterpvecvar, HYPRE_BOOMERAMGSETINTERPVECVAR) - ( hypre_F90_Obj *solver, - hypre_F90_Int *var, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *var, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetInterpVecVariant( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (var) ) ); + ( HYPRE_BoomerAMGSetInterpVecVariant( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (var) ) ); } /*-------------------------------------------------------------------------- @@ -1661,14 +1661,14 @@ hypre_F90_IFACE(hypre_boomeramgsetinterpvecvar, HYPRE_BOOMERAMGSETINTERPVECVAR) void hypre_F90_IFACE(hypre_boomeramgsetinterpvecqmx, HYPRE_BOOMERAMGSETINTERPVECQMX) - ( hypre_F90_Obj *solver, - hypre_F90_Int *q_max, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *q_max, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetInterpVecQMax( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (q_max) ) ); + ( HYPRE_BoomerAMGSetInterpVecQMax( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (q_max) ) ); } /*-------------------------------------------------------------------------- @@ -1677,14 +1677,14 @@ hypre_F90_IFACE(hypre_boomeramgsetinterpvecqmx, HYPRE_BOOMERAMGSETINTERPVECQMX) void hypre_F90_IFACE(hypre_boomeramgsetinterpvecqtr, HYPRE_BOOMERAMGSETINTERPVECQTR) - ( hypre_F90_Obj *solver, - hypre_F90_Real *q_trunc, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *q_trunc, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetInterpVecAbsQTrunc( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (q_trunc) ) ); + ( HYPRE_BoomerAMGSetInterpVecAbsQTrunc( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (q_trunc) ) ); } /*-------------------------------------------------------------------------- @@ -1693,14 +1693,14 @@ hypre_F90_IFACE(hypre_boomeramgsetinterpvecqtr, HYPRE_BOOMERAMGSETINTERPVECQTR) void hypre_F90_IFACE(hypre_boomeramgsetchebyorder, HYPRE_BOOMERAMGSETCHEBYORDER) - ( hypre_F90_Obj *solver, - hypre_F90_Int *cheby_order, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *cheby_order, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetChebyOrder( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (cheby_order) ) ); + ( HYPRE_BoomerAMGSetChebyOrder( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (cheby_order) ) ); } /*-------------------------------------------------------------------------- @@ -1709,14 +1709,14 @@ hypre_F90_IFACE(hypre_boomeramgsetchebyorder, HYPRE_BOOMERAMGSETCHEBYORDER) void hypre_F90_IFACE(hypre_boomeramgsetchebyfract, HYPRE_BOOMERAMGSETCHEBYFRACT) - ( hypre_F90_Obj *solver, - hypre_F90_Real *cheby_fraction, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *cheby_fraction, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetChebyFraction( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (cheby_fraction) ) ); + ( HYPRE_BoomerAMGSetChebyFraction( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (cheby_fraction) ) ); } /*-------------------------------------------------------------------------- @@ -1725,14 +1725,14 @@ hypre_F90_IFACE(hypre_boomeramgsetchebyfract, HYPRE_BOOMERAMGSETCHEBYFRACT) void hypre_F90_IFACE(hypre_boomeramgsetchebyscale, HYPRE_BOOMERAMGSETCHEBYSCALE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *cheby_scale, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *cheby_scale, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetChebyScale( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (cheby_scale) ) ); + ( HYPRE_BoomerAMGSetChebyScale( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (cheby_scale) ) ); } /*-------------------------------------------------------------------------- @@ -1741,14 +1741,14 @@ hypre_F90_IFACE(hypre_boomeramgsetchebyscale, HYPRE_BOOMERAMGSETCHEBYSCALE) void hypre_F90_IFACE(hypre_boomeramgsetchebyvariant, HYPRE_BOOMERAMGSETCHEBYVARIANT) - ( hypre_F90_Obj *solver, - hypre_F90_Int *cheby_variant, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *cheby_variant, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetChebyVariant( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (cheby_variant) ) ); + ( HYPRE_BoomerAMGSetChebyVariant( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (cheby_variant) ) ); } /*-------------------------------------------------------------------------- @@ -1757,14 +1757,14 @@ hypre_F90_IFACE(hypre_boomeramgsetchebyvariant, HYPRE_BOOMERAMGSETCHEBYVARIANT) void hypre_F90_IFACE(hypre_boomeramgsetchebyeigest, HYPRE_BOOMERAMGSETCHEBYEIGEST) - ( hypre_F90_Obj *solver, - hypre_F90_Int *cheby_eig_est, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *cheby_eig_est, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetChebyEigEst( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (cheby_eig_est) ) ); + ( HYPRE_BoomerAMGSetChebyEigEst( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (cheby_eig_est) ) ); } /*-------------------------------------------------------------------------- @@ -1773,14 +1773,14 @@ hypre_F90_IFACE(hypre_boomeramgsetchebyeigest, HYPRE_BOOMERAMGSETCHEBYEIGEST) void hypre_F90_IFACE(hypre_boomeramgsetkeeptransp, HYPRE_BOOMERAMGSETKEEPTRANSP) - ( hypre_F90_Obj *solver, - hypre_F90_Int *keep_transpose, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *keep_transpose, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetKeepTranspose( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (keep_transpose) ) ); + ( HYPRE_BoomerAMGSetKeepTranspose( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (keep_transpose) ) ); } /*-------------------------------------------------------------------------- @@ -1789,14 +1789,14 @@ hypre_F90_IFACE(hypre_boomeramgsetkeeptransp, HYPRE_BOOMERAMGSETKEEPTRANSP) void hypre_F90_IFACE(hypre_boomeramgsetrap2, HYPRE_BOOMERAMGSETRAP2) - ( hypre_F90_Obj *solver, - hypre_F90_Int *rap2, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *rap2, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetRAP2( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (rap2) ) ); + ( HYPRE_BoomerAMGSetRAP2( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (rap2) ) ); } /*-------------------------------------------------------------------------- @@ -1805,26 +1805,26 @@ hypre_F90_IFACE(hypre_boomeramgsetrap2, HYPRE_BOOMERAMGSETRAP2) void hypre_F90_IFACE(hypre_boomeramgsetadditive, HYPRE_BOOMERAMGSETADDITIVE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *add_lvl, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *add_lvl, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetAdditive( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (add_lvl) ) ); + ( HYPRE_BoomerAMGSetAdditive( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (add_lvl) ) ); } void hypre_F90_IFACE(hypre_boomeramggetadditive, HYPRE_BOOMERAMGGETADDITIVE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *add_lvl, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *add_lvl, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGGetAdditive( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntRef (add_lvl) ) ); + ( HYPRE_BoomerAMGGetAdditive( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntRef (add_lvl) ) ); } /*-------------------------------------------------------------------------- @@ -1833,26 +1833,26 @@ hypre_F90_IFACE(hypre_boomeramggetadditive, HYPRE_BOOMERAMGGETADDITIVE) void hypre_F90_IFACE(hypre_boomeramgsetmultadd, HYPRE_BOOMERAMGSETMULTADD) - ( hypre_F90_Obj *solver, - hypre_F90_Int *add_lvl, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *add_lvl, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetMultAdditive( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (add_lvl) ) ); + ( HYPRE_BoomerAMGSetMultAdditive( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (add_lvl) ) ); } void hypre_F90_IFACE(hypre_boomeramggetmultadd, HYPRE_BOOMERAMGGETMULTADD) - ( hypre_F90_Obj *solver, - hypre_F90_Int *add_lvl, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *add_lvl, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGGetMultAdditive( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntRef (add_lvl) ) ); + ( HYPRE_BoomerAMGGetMultAdditive( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntRef (add_lvl) ) ); } /*-------------------------------------------------------------------------- @@ -1861,26 +1861,26 @@ hypre_F90_IFACE(hypre_boomeramggetmultadd, HYPRE_BOOMERAMGGETMULTADD) void hypre_F90_IFACE(hypre_boomeramgsetsimple, HYPRE_BOOMERAMGSETSIMPLE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *add_lvl, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *add_lvl, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetSimple( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (add_lvl) ) ); + ( HYPRE_BoomerAMGSetSimple( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (add_lvl) ) ); } void hypre_F90_IFACE(hypre_boomeramggetsimple, HYPRE_BOOMERAMGGETSIMPLE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *add_lvl, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *add_lvl, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGGetSimple( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntRef (add_lvl) ) ); + ( HYPRE_BoomerAMGGetSimple( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntRef (add_lvl) ) ); } /*-------------------------------------------------------------------------- @@ -1889,14 +1889,14 @@ hypre_F90_IFACE(hypre_boomeramggetsimple, HYPRE_BOOMERAMGGETSIMPLE) void hypre_F90_IFACE(hypre_boomeramgsetaddlastlvl, HYPRE_BOOMERAMGSETADDLASTLVL) - ( hypre_F90_Obj *solver, - hypre_F90_Int *add_last_lvl, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *add_last_lvl, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetAddLastLvl( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (add_last_lvl) ) ); + ( HYPRE_BoomerAMGSetAddLastLvl( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (add_last_lvl) ) ); } /*-------------------------------------------------------------------------- @@ -1905,14 +1905,14 @@ hypre_F90_IFACE(hypre_boomeramgsetaddlastlvl, HYPRE_BOOMERAMGSETADDLASTLVL) void hypre_F90_IFACE(hypre_boomeramgsetmultaddtrf, HYPRE_BOOMERAMGSETMULTADDTRF) - ( hypre_F90_Obj *solver, - hypre_F90_Real *add_tr, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *add_tr, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetMultAddTruncFactor( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (add_tr) ) ); + ( HYPRE_BoomerAMGSetMultAddTruncFactor( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (add_tr) ) ); } /*-------------------------------------------------------------------------- @@ -1921,14 +1921,14 @@ hypre_F90_IFACE(hypre_boomeramgsetmultaddtrf, HYPRE_BOOMERAMGSETMULTADDTRF) void hypre_F90_IFACE(hypre_boomeramgsetmultaddpmx, HYPRE_BOOMERAMGSETMULTADDPMX) - ( hypre_F90_Obj *solver, - hypre_F90_Int *add_pmx, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *add_pmx, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetMultAddPMaxElmts( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (add_pmx) ) ); + ( HYPRE_BoomerAMGSetMultAddPMaxElmts( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (add_pmx) ) ); } /*-------------------------------------------------------------------------- @@ -1937,14 +1937,14 @@ hypre_F90_IFACE(hypre_boomeramgsetmultaddpmx, HYPRE_BOOMERAMGSETMULTADDPMX) void hypre_F90_IFACE(hypre_boomeramgsetaddrlxtype, HYPRE_BOOMERAMGSETADDRLXTYPE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *add_rlx_type, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *add_rlx_type, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetAddRelaxType( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (add_rlx_type) ) ); + ( HYPRE_BoomerAMGSetAddRelaxType( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (add_rlx_type) ) ); } /*-------------------------------------------------------------------------- @@ -1953,14 +1953,14 @@ hypre_F90_IFACE(hypre_boomeramgsetaddrlxtype, HYPRE_BOOMERAMGSETADDRLXTYPE) void hypre_F90_IFACE(hypre_boomeramgsetaddrlxwt, HYPRE_BOOMERAMGSETADDRLXWT) - ( hypre_F90_Obj *solver, - hypre_F90_Real *add_rlx_wt, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *add_rlx_wt, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetAddRelaxWt( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (add_rlx_wt) ) ); + ( HYPRE_BoomerAMGSetAddRelaxWt( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (add_rlx_wt) ) ); } /*-------------------------------------------------------------------------- @@ -1969,14 +1969,14 @@ hypre_F90_IFACE(hypre_boomeramgsetaddrlxwt, HYPRE_BOOMERAMGSETADDRLXWT) void hypre_F90_IFACE(hypre_boomeramgsetseqthrshold, HYPRE_BOOMERAMGSETSEQTHRSHOLD) - ( hypre_F90_Obj *solver, - hypre_F90_Int *seq_th, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *seq_th, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetSeqThreshold( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (seq_th) ) ); + ( HYPRE_BoomerAMGSetSeqThreshold( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (seq_th) ) ); } #ifdef HYPRE_USING_DSUPERLU @@ -1986,14 +1986,14 @@ hypre_F90_IFACE(hypre_boomeramgsetseqthrshold, HYPRE_BOOMERAMGSETSEQTHRSHOLD) void hypre_F90_IFACE(hypre_boomeramgsetdsluthrshold, HYPRE_BOOMERAMGSETDSLUTHRSHOLD) - ( hypre_F90_Obj *solver, - hypre_F90_Int *dslu_th, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *dslu_th, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetDSLUThreshold( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (dslu_th) ) ); + ( HYPRE_BoomerAMGSetDSLUThreshold( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (dslu_th) ) ); } #endif @@ -2003,14 +2003,14 @@ hypre_F90_IFACE(hypre_boomeramgsetdsluthrshold, HYPRE_BOOMERAMGSETDSLUTHRSHOLD) void hypre_F90_IFACE(hypre_boomeramgsetredundant, HYPRE_BOOMERAMGSETREDUNDANT) - ( hypre_F90_Obj *solver, - hypre_F90_Int *redundant, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *redundant, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetRedundant( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (redundant) ) ); + ( HYPRE_BoomerAMGSetRedundant( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (redundant) ) ); } /*-------------------------------------------------------------------------- @@ -2019,14 +2019,14 @@ hypre_F90_IFACE(hypre_boomeramgsetredundant, HYPRE_BOOMERAMGSETREDUNDANT) void hypre_F90_IFACE(hypre_boomeramgsetnongaltol, HYPRE_BOOMERAMGSETNONGALTOL) - ( hypre_F90_Obj *solver, - hypre_F90_Real *nongal_tol, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *nongal_tol, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetNonGalerkinTol( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (nongal_tol) ) ); + ( HYPRE_BoomerAMGSetNonGalerkinTol( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (nongal_tol) ) ); } /*-------------------------------------------------------------------------- @@ -2035,16 +2035,16 @@ hypre_F90_IFACE(hypre_boomeramgsetnongaltol, HYPRE_BOOMERAMGSETNONGALTOL) void hypre_F90_IFACE(hypre_boomeramgsetlvlnongaltol, HYPRE_BOOMERAMGSETLVLNONGALTOL) - ( hypre_F90_Obj *solver, - hypre_F90_Real *nongal_tol, - hypre_F90_Int *level, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *nongal_tol, + hypre_F90_Int *level, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetLevelNonGalerkinTol( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (nongal_tol) , - hypre_F90_PassInt (level) ) ); + ( HYPRE_BoomerAMGSetLevelNonGalerkinTol( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (nongal_tol), + hypre_F90_PassInt (level) ) ); } /*-------------------------------------------------------------------------- @@ -2053,14 +2053,14 @@ hypre_F90_IFACE(hypre_boomeramgsetlvlnongaltol, HYPRE_BOOMERAMGSETLVLNONGALTOL) void hypre_F90_IFACE(hypre_boomeramgsetgsmg, HYPRE_BOOMERAMGSETGSMG) - ( hypre_F90_Obj *solver, - hypre_F90_Int *gsmg, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *gsmg, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetGSMG( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (gsmg) ) ); + ( HYPRE_BoomerAMGSetGSMG( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (gsmg) ) ); } /*-------------------------------------------------------------------------- @@ -2069,14 +2069,14 @@ hypre_F90_IFACE(hypre_boomeramgsetgsmg, HYPRE_BOOMERAMGSETGSMG) void hypre_F90_IFACE(hypre_boomeramgsetnumsamples, HYPRE_BOOMERAMGSETNUMSAMPLES) - ( hypre_F90_Obj *solver, - hypre_F90_Int *gsmg, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *gsmg, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetNumSamples( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (gsmg) ) ); + ( HYPRE_BoomerAMGSetNumSamples( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (gsmg) ) ); } /*-------------------------------------------------------------------------- @@ -2085,14 +2085,14 @@ hypre_F90_IFACE(hypre_boomeramgsetnumsamples, HYPRE_BOOMERAMGSETNUMSAMPLES) void hypre_F90_IFACE(hypre_boomeramgsetcgcits, HYPRE_BOOMERAMGSETCGCITS) - ( hypre_F90_Obj *solver, - hypre_F90_Int *its, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *its, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_BoomerAMGSetCGCIts( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (its) ) ); + ( HYPRE_BoomerAMGSetCGCIts( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (its) ) ); } #ifdef __cplusplus diff --git a/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_bicgstab.c b/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_bicgstab.c index b6b9e870..5a13a151 100644 --- a/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_bicgstab.c +++ b/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_bicgstab.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,75 +17,75 @@ #ifdef __cplusplus extern "C" { #endif - + /*-------------------------------------------------------------------------- * HYPRE_ParCSRBiCGSTABCreate *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_parcsrbicgstabcreate, HYPRE_PARCSRBICGSTABCREATE) - ( hypre_F90_Comm *comm, - hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Comm *comm, + hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRBiCGSTABCreate( - hypre_F90_PassComm (comm), - hypre_F90_PassObjRef (HYPRE_Solver, solver) ) ); + ( HYPRE_ParCSRBiCGSTABCreate( + hypre_F90_PassComm (comm), + hypre_F90_PassObjRef (HYPRE_Solver, solver) ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRBiCGSTABDestroy *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_parcsrbicgstabdestroy, HYPRE_PARCSRBICGSTABDESTROY) - ( hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRBiCGSTABDestroy( - hypre_F90_PassObj (HYPRE_Solver, solver) ) ); + ( HYPRE_ParCSRBiCGSTABDestroy( + hypre_F90_PassObj (HYPRE_Solver, solver) ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRBiCGSTABSetup *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_parcsrbicgstabsetup, HYPRE_PARCSRBICGSTABSETUP) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRBiCGSTABSetup( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), - hypre_F90_PassObj (HYPRE_ParVector, b), - hypre_F90_PassObj (HYPRE_ParVector, x) ) ); + ( HYPRE_ParCSRBiCGSTABSetup( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), + hypre_F90_PassObj (HYPRE_ParVector, b), + hypre_F90_PassObj (HYPRE_ParVector, x) ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRBiCGSTABSolve *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_parcsrbicgstabsolve, HYPRE_PARCSRBICGSTABSOLVE) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRBiCGSTABSolve( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), - hypre_F90_PassObj (HYPRE_ParVector, b), - hypre_F90_PassObj (HYPRE_ParVector, x) ) ); + ( HYPRE_ParCSRBiCGSTABSolve( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), + hypre_F90_PassObj (HYPRE_ParVector, b), + hypre_F90_PassObj (HYPRE_ParVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -94,14 +94,14 @@ hypre_F90_IFACE(hypre_parcsrbicgstabsolve, HYPRE_PARCSRBICGSTABSOLVE) void hypre_F90_IFACE(hypre_parcsrbicgstabsettol, HYPRE_PARCSRBICGSTABSETTOL) - ( hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRBiCGSTABSetTol( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (tol) ) ); + ( HYPRE_ParCSRBiCGSTABSetTol( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (tol) ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRBiCGSTABSetAbsoluteTol @@ -109,14 +109,14 @@ hypre_F90_IFACE(hypre_parcsrbicgstabsettol, HYPRE_PARCSRBICGSTABSETTOL) void hypre_F90_IFACE(hypre_parcsrbicgstabsetatol, HYPRE_PARCSRBICGSTABSETATOL) - ( hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRBiCGSTABSetAbsoluteTol( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (tol) ) ); + ( HYPRE_ParCSRBiCGSTABSetAbsoluteTol( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (tol) ) ); } @@ -127,14 +127,14 @@ hypre_F90_IFACE(hypre_parcsrbicgstabsetatol, HYPRE_PARCSRBICGSTABSETATOL) void hypre_F90_IFACE(hypre_parcsrbicgstabsetminiter, HYPRE_PARCSRBICGSTABSETMINITER) - ( hypre_F90_Obj *solver, - hypre_F90_Int *min_iter, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *min_iter, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRBiCGSTABSetMinIter( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (min_iter) ) ); + ( HYPRE_ParCSRBiCGSTABSetMinIter( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (min_iter) ) ); } /*-------------------------------------------------------------------------- @@ -143,14 +143,14 @@ hypre_F90_IFACE(hypre_parcsrbicgstabsetminiter, HYPRE_PARCSRBICGSTABSETMINITER) void hypre_F90_IFACE(hypre_parcsrbicgstabsetmaxiter, HYPRE_PARCSRBICGSTABSETMAXITER) - ( hypre_F90_Obj *solver, - hypre_F90_Int *max_iter, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *max_iter, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRBiCGSTABSetMaxIter( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (max_iter) ) ); + ( HYPRE_ParCSRBiCGSTABSetMaxIter( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (max_iter) ) ); } /*-------------------------------------------------------------------------- @@ -159,14 +159,14 @@ hypre_F90_IFACE(hypre_parcsrbicgstabsetmaxiter, HYPRE_PARCSRBICGSTABSETMAXITER) void hypre_F90_IFACE(hypre_parcsrbicgstabsetstopcrit, HYPRE_PARCSRBICGSTABSETSTOP) - ( hypre_F90_Obj *solver, - hypre_F90_Int *stop_crit, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *stop_crit, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRBiCGSTABSetStopCrit( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (stop_crit) ) ); + ( HYPRE_ParCSRBiCGSTABSetStopCrit( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (stop_crit) ) ); } /*-------------------------------------------------------------------------- @@ -175,10 +175,10 @@ hypre_F90_IFACE(hypre_parcsrbicgstabsetstopcrit, HYPRE_PARCSRBICGSTABSETSTOP) void hypre_F90_IFACE(hypre_parcsrbicgstabsetprecond, HYPRE_PARCSRBICGSTABSETPRECOND) - ( hypre_F90_Obj *solver, - hypre_F90_Int *precond_id, - hypre_F90_Obj *precond_solver, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *precond_id, + hypre_F90_Obj *precond_solver, + hypre_F90_Int *ierr ) { /*------------------------------------------------------------ * The precond_id flags mean : @@ -187,6 +187,9 @@ hypre_F90_IFACE(hypre_parcsrbicgstabsetprecond, HYPRE_PARCSRBICGSTABSETPRECOND) * 2 - set up an amg preconditioner * 3 - set up a pilut preconditioner * 4 - set up a parasails preconditioner + * 5 - set up a Euclid preconditioner + * 6 - set up a ILU preconditioner + * 7 - set up a MGR preconditioner *------------------------------------------------------------*/ if (*precond_id == 0) @@ -196,48 +199,66 @@ hypre_F90_IFACE(hypre_parcsrbicgstabsetprecond, HYPRE_PARCSRBICGSTABSETPRECOND) else if (*precond_id == 1) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRBiCGSTABSetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - HYPRE_ParCSRDiagScale, - HYPRE_ParCSRDiagScaleSetup, - NULL ) ); + ( HYPRE_ParCSRBiCGSTABSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_ParCSRDiagScale, + HYPRE_ParCSRDiagScaleSetup, + NULL ) ); } else if (*precond_id == 2) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRBiCGSTABSetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - HYPRE_BoomerAMGSolve, - HYPRE_BoomerAMGSetup, - (HYPRE_Solver) *precond_solver ) ); + ( HYPRE_ParCSRBiCGSTABSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_BoomerAMGSolve, + HYPRE_BoomerAMGSetup, + (HYPRE_Solver) * precond_solver ) ); } else if (*precond_id == 3) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRBiCGSTABSetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - HYPRE_ParCSRPilutSolve, - HYPRE_ParCSRPilutSetup, - (HYPRE_Solver) *precond_solver ) ); + ( HYPRE_ParCSRBiCGSTABSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_ParCSRPilutSolve, + HYPRE_ParCSRPilutSetup, + (HYPRE_Solver) * precond_solver ) ); } else if (*precond_id == 4) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRBiCGSTABSetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - HYPRE_ParCSRParaSailsSolve, - HYPRE_ParCSRParaSailsSetup, - (HYPRE_Solver) *precond_solver ) ); + ( HYPRE_ParCSRBiCGSTABSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_ParCSRParaSailsSolve, + HYPRE_ParCSRParaSailsSetup, + (HYPRE_Solver) * precond_solver ) ); } else if (*precond_id == 5) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRBiCGSTABSetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - HYPRE_EuclidSolve, - HYPRE_EuclidSetup, - (HYPRE_Solver) *precond_solver ) ); + ( HYPRE_ParCSRBiCGSTABSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_EuclidSolve, + HYPRE_EuclidSetup, + (HYPRE_Solver) * precond_solver ) ); + } + else if (*precond_id == 6) + { + *ierr = (hypre_F90_Int) + ( HYPRE_ParCSRBiCGSTABSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_ILUSolve, + HYPRE_ILUSetup, + (HYPRE_Solver) * precond_solver ) ); + } + else if (*precond_id == 7) + { + *ierr = (hypre_F90_Int) + ( HYPRE_ParCSRBiCGSTABSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_MGRSolve, + HYPRE_MGRSetup, + (HYPRE_Solver) * precond_solver ) ); } else { @@ -251,14 +272,14 @@ hypre_F90_IFACE(hypre_parcsrbicgstabsetprecond, HYPRE_PARCSRBICGSTABSETPRECOND) void hypre_F90_IFACE(hypre_parcsrbicgstabgetprecond, HYPRE_PARCSRBICGSTABGETPRECOND) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *precond_solver_ptr, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *precond_solver_ptr, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRBiCGSTABGetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObjRef (HYPRE_Solver, precond_solver_ptr) ) ); + ( HYPRE_ParCSRBiCGSTABGetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObjRef (HYPRE_Solver, precond_solver_ptr) ) ); } @@ -268,14 +289,14 @@ hypre_F90_IFACE(hypre_parcsrbicgstabgetprecond, HYPRE_PARCSRBICGSTABGETPRECOND) void hypre_F90_IFACE(hypre_parcsrbicgstabsetlogging, HYPRE_PARCSRBICGSTABSETLOGGING) - ( hypre_F90_Obj *solver, - hypre_F90_Int *logging, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *logging, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRBiCGSTABSetLogging( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (logging) ) ); + ( HYPRE_ParCSRBiCGSTABSetLogging( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (logging) ) ); } /*-------------------------------------------------------------------------- @@ -284,14 +305,14 @@ hypre_F90_IFACE(hypre_parcsrbicgstabsetlogging, HYPRE_PARCSRBICGSTABSETLOGGING) void hypre_F90_IFACE(hypre_parcsrbicgstabsetprintlev, HYPRE_PARCSRBICGSTABSETPRINTLEV) - ( hypre_F90_Obj *solver, - hypre_F90_Int *print_level, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *print_level, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRBiCGSTABSetPrintLevel( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (print_level) ) ); + ( HYPRE_ParCSRBiCGSTABSetPrintLevel( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (print_level) ) ); } /*-------------------------------------------------------------------------- @@ -300,14 +321,14 @@ hypre_F90_IFACE(hypre_parcsrbicgstabsetprintlev, HYPRE_PARCSRBICGSTABSETPRINTLEV void hypre_F90_IFACE(hypre_parcsrbicgstabgetnumiter, HYPRE_PARCSRBICGSTABGETNUMITER) - ( hypre_F90_Obj *solver, - hypre_F90_Int *num_iterations, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *num_iterations, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRBiCGSTABGetNumIterations( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntRef (num_iterations) ) ); + ( HYPRE_ParCSRBiCGSTABGetNumIterations( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntRef (num_iterations) ) ); } /*-------------------------------------------------------------------------- @@ -316,16 +337,16 @@ hypre_F90_IFACE(hypre_parcsrbicgstabgetnumiter, HYPRE_PARCSRBICGSTABGETNUMITER) void hypre_F90_IFACE(hypre_parcsrbicgstabgetfinalrel, HYPRE_PARCSRBICGSTABGETFINALREL) - ( hypre_F90_Obj *solver, - hypre_F90_Real *norm, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *norm, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRBiCGSTABGetFinalRelativeResidualNorm( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassRealRef (norm) ) ); + ( HYPRE_ParCSRBiCGSTABGetFinalRelativeResidualNorm( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassRealRef (norm) ) ); } - + #ifdef __cplusplus } #endif diff --git a/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_block.c b/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_block.c index 1f5e5d51..c1b9ca4c 100644 --- a/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_block.c +++ b/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_block.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -18,18 +18,18 @@ #ifdef __cplusplus extern "C" { #endif - + /*-------------------------------------------------------------------------- * HYPRE_BlockTridiagCreate *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_blocktridiagcreate, HYPRE_BLOCKTRIDIAGCREATE) - (hypre_F90_Obj *solver, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) HYPRE_BlockTridiagCreate( - hypre_F90_PassObjRef (HYPRE_Solver, solver)); + hypre_F90_PassObjRef (HYPRE_Solver, solver)); } /*-------------------------------------------------------------------------- @@ -38,11 +38,11 @@ hypre_F90_IFACE(hypre_blocktridiagcreate, HYPRE_BLOCKTRIDIAGCREATE) void hypre_F90_IFACE(hypre_blocktridiagdestroy, HYPRE_BLOCKTRIDIAGDESTROY) - (hypre_F90_Obj *solver, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) HYPRE_BlockTridiagDestroy( - hypre_F90_PassObj (HYPRE_Solver, solver)); + hypre_F90_PassObj (HYPRE_Solver, solver)); } /*-------------------------------------------------------------------------- @@ -51,17 +51,17 @@ hypre_F90_IFACE(hypre_blocktridiagdestroy, HYPRE_BLOCKTRIDIAGDESTROY) void hypre_F90_IFACE(hypre_blocktridiagsetup, HYPRE_BLOCKTRIDIAGSETUP) - (hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) HYPRE_BlockTridiagSetup( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), - hypre_F90_PassObj (HYPRE_ParVector, b), - hypre_F90_PassObj (HYPRE_ParVector, x)); + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), + hypre_F90_PassObj (HYPRE_ParVector, b), + hypre_F90_PassObj (HYPRE_ParVector, x)); } /*-------------------------------------------------------------------------- @@ -70,17 +70,17 @@ hypre_F90_IFACE(hypre_blocktridiagsetup, HYPRE_BLOCKTRIDIAGSETUP) void hypre_F90_IFACE(hypre_blocktridiagsolve, HYPRE_BLOCKTRIDIAGSOLVE) - (hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) HYPRE_BlockTridiagSolve( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), - hypre_F90_PassObj (HYPRE_ParVector, b), - hypre_F90_PassObj (HYPRE_ParVector, x)); + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), + hypre_F90_PassObj (HYPRE_ParVector, b), + hypre_F90_PassObj (HYPRE_ParVector, x)); } /*-------------------------------------------------------------------------- @@ -89,15 +89,15 @@ hypre_F90_IFACE(hypre_blocktridiagsolve, HYPRE_BLOCKTRIDIAGSOLVE) void hypre_F90_IFACE(hypre_blocktridiagsetindexset, HYPRE_BLOCKTRIDIAGSETINDEXSET) - (hypre_F90_Obj *solver, - hypre_F90_Int *n, - hypre_F90_IntArray *inds, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *n, + hypre_F90_IntArray *inds, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) HYPRE_BlockTridiagSetIndexSet( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (n), - hypre_F90_PassIntArray (inds)); + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (n), + hypre_F90_PassIntArray (inds)); } /*-------------------------------------------------------------------------- @@ -106,13 +106,13 @@ hypre_F90_IFACE(hypre_blocktridiagsetindexset, HYPRE_BLOCKTRIDIAGSETINDEXSET) void hypre_F90_IFACE(hypre_blocktridiagsetamgstrengt, HYPRE_BLOCKTRIDIAGSETAMGSTRENGT) - (hypre_F90_Obj *solver, - hypre_F90_Real *thresh, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Real *thresh, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) HYPRE_BlockTridiagSetAMGStrengthThreshold( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (thresh)); + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (thresh)); } /*-------------------------------------------------------------------------- @@ -121,13 +121,13 @@ hypre_F90_IFACE(hypre_blocktridiagsetamgstrengt, HYPRE_BLOCKTRIDIAGSETAMGSTRENGT void hypre_F90_IFACE(hypre_blocktridiagsetamgnumswee, HYPRE_BLOCKTRIDIAGSETAMGNUMSWEE) - (hypre_F90_Obj *solver, - hypre_F90_Int *num_sweeps, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *num_sweeps, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) HYPRE_BlockTridiagSetAMGNumSweeps( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (num_sweeps)); + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (num_sweeps)); } /*-------------------------------------------------------------------------- @@ -136,13 +136,13 @@ hypre_F90_IFACE(hypre_blocktridiagsetamgnumswee, HYPRE_BLOCKTRIDIAGSETAMGNUMSWEE void hypre_F90_IFACE(hypre_blocktridiagsetamgrelaxty, HYPRE_BLOCKTRIDIAGSETAMGRELAXTY) - (hypre_F90_Obj *solver, - hypre_F90_Int *relax_type, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *relax_type, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) HYPRE_BlockTridiagSetAMGRelaxType( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (relax_type)); + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (relax_type)); } /*-------------------------------------------------------------------------- @@ -151,15 +151,15 @@ hypre_F90_IFACE(hypre_blocktridiagsetamgrelaxty, HYPRE_BLOCKTRIDIAGSETAMGRELAXTY void hypre_F90_IFACE(hypre_blocktridiagsetprintlevel, HYPRE_BLOCKTRIDIAGSETPRINTLEVEL) - (hypre_F90_Obj *solver, - hypre_F90_Int *print_level, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *print_level, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) HYPRE_BlockTridiagSetPrintLevel( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (print_level)); + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (print_level)); } - + #ifdef __cplusplus } #endif diff --git a/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_cgnr.c b/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_cgnr.c index 0b509aac..da69cf0d 100644 --- a/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_cgnr.c +++ b/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_cgnr.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,76 +17,76 @@ #ifdef __cplusplus extern "C" { #endif - + /*-------------------------------------------------------------------------- * HYPRE_ParCSRCGNRCreate *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_parcsrcgnrcreate, HYPRE_PARCSRCGNRCREATE) - ( hypre_F90_Comm *comm, - hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Comm *comm, + hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRCGNRCreate( - hypre_F90_PassComm (comm), - hypre_F90_PassObjRef (HYPRE_Solver, solver) ) ); + ( HYPRE_ParCSRCGNRCreate( + hypre_F90_PassComm (comm), + hypre_F90_PassObjRef (HYPRE_Solver, solver) ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRCGNRDestroy *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_parcsrcgnrdestroy, HYPRE_PARCSRCGNRDESTROY) - ( hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRCGNRDestroy( - hypre_F90_PassObj (HYPRE_Solver, solver) ) ); + ( HYPRE_ParCSRCGNRDestroy( + hypre_F90_PassObj (HYPRE_Solver, solver) ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRCGNRSetup *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_parcsrcgnrsetup, HYPRE_PARCSRCGNRSETUP) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRCGNRSetup( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), - hypre_F90_PassObj (HYPRE_ParVector, b), - hypre_F90_PassObj (HYPRE_ParVector, x) ) ); + ( HYPRE_ParCSRCGNRSetup( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), + hypre_F90_PassObj (HYPRE_ParVector, b), + hypre_F90_PassObj (HYPRE_ParVector, x) ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRCGNRSolve *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_parcsrcgnrsolve, HYPRE_PARCSRCGNRSOLVE) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRCGNRSolve( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), - hypre_F90_PassObj (HYPRE_ParVector, b), - hypre_F90_PassObj (HYPRE_ParVector, x) ) ); + ( HYPRE_ParCSRCGNRSolve( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), + hypre_F90_PassObj (HYPRE_ParVector, b), + hypre_F90_PassObj (HYPRE_ParVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -95,14 +95,14 @@ hypre_F90_IFACE(hypre_parcsrcgnrsolve, HYPRE_PARCSRCGNRSOLVE) void hypre_F90_IFACE(hypre_parcsrcgnrsettol, HYPRE_PARCSRCGNRSETTOL) - ( hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRCGNRSetTol( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (tol) ) ); + ( HYPRE_ParCSRCGNRSetTol( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (tol) ) ); } /*-------------------------------------------------------------------------- @@ -111,14 +111,14 @@ hypre_F90_IFACE(hypre_parcsrcgnrsettol, HYPRE_PARCSRCGNRSETTOL) void hypre_F90_IFACE(hypre_parcsrcgnrsetminiter, HYPRE_PARCSRCGNRSETMINITER) - ( hypre_F90_Obj *solver, - hypre_F90_Int *min_iter, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *min_iter, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRCGNRSetMinIter( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (min_iter) ) ); + ( HYPRE_ParCSRCGNRSetMinIter( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (min_iter) ) ); } /*-------------------------------------------------------------------------- @@ -127,14 +127,14 @@ hypre_F90_IFACE(hypre_parcsrcgnrsetminiter, HYPRE_PARCSRCGNRSETMINITER) void hypre_F90_IFACE(hypre_parcsrcgnrsetmaxiter, HYPRE_PARCSRCGNRSETMAXITER) - ( hypre_F90_Obj *solver, - hypre_F90_Int *max_iter, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *max_iter, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRCGNRSetMaxIter( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (max_iter) ) ); + ( HYPRE_ParCSRCGNRSetMaxIter( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (max_iter) ) ); } /*-------------------------------------------------------------------------- @@ -143,14 +143,14 @@ hypre_F90_IFACE(hypre_parcsrcgnrsetmaxiter, HYPRE_PARCSRCGNRSETMAXITER) void hypre_F90_IFACE(hypre_parcsrcgnrsetstopcrit, HYPRE_PARCSRCGNRSETSTOPCRIT) - ( hypre_F90_Obj *solver, - hypre_F90_Int *stop_crit, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *stop_crit, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRCGNRSetStopCrit( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (stop_crit) ) ); + ( HYPRE_ParCSRCGNRSetStopCrit( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (stop_crit) ) ); } /*-------------------------------------------------------------------------- @@ -159,10 +159,10 @@ hypre_F90_IFACE(hypre_parcsrcgnrsetstopcrit, HYPRE_PARCSRCGNRSETSTOPCRIT) void hypre_F90_IFACE(hypre_parcsrcgnrsetprecond, HYPRE_PARCSRCGNRSETPRECOND) - ( hypre_F90_Obj *solver, - hypre_F90_Int *precond_id, - hypre_F90_Obj *precond_solver, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *precond_id, + hypre_F90_Obj *precond_solver, + hypre_F90_Int *ierr ) { /*------------------------------------------------------------ * The precond_id flags mean : @@ -170,6 +170,10 @@ hypre_F90_IFACE(hypre_parcsrcgnrsetprecond, HYPRE_PARCSRCGNRSETPRECOND) * 1 - set up a ds preconditioner * 2 - set up an amg preconditioner * 3 - set up a pilut preconditioner + * 4 - set up a ParaSails preconditioner + * 5 - set up a Euclid preconditioner + * 6 - set up a ILU preconditioner + * 7 - set up a MGR preconditioner *------------------------------------------------------------*/ if (*precond_id == 0) @@ -179,52 +183,72 @@ hypre_F90_IFACE(hypre_parcsrcgnrsetprecond, HYPRE_PARCSRCGNRSETPRECOND) else if (*precond_id == 1) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRCGNRSetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - HYPRE_ParCSRDiagScale, - HYPRE_ParCSRDiagScale, - HYPRE_ParCSRDiagScaleSetup, - NULL ) ); + ( HYPRE_ParCSRCGNRSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_ParCSRDiagScale, + HYPRE_ParCSRDiagScale, + HYPRE_ParCSRDiagScaleSetup, + NULL ) ); } else if (*precond_id == 2) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRCGNRSetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - HYPRE_BoomerAMGSolve, - HYPRE_BoomerAMGSolve, - HYPRE_BoomerAMGSetup, - (HYPRE_Solver) *precond_solver ) ); + ( HYPRE_ParCSRCGNRSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_BoomerAMGSolve, + HYPRE_BoomerAMGSolve, + HYPRE_BoomerAMGSetup, + (HYPRE_Solver) * precond_solver ) ); } if (*precond_id == 3) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRCGNRSetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - HYPRE_ParCSRPilutSolve, - HYPRE_ParCSRPilutSolve, - HYPRE_ParCSRPilutSetup, - (HYPRE_Solver) *precond_solver ) ); + ( HYPRE_ParCSRCGNRSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_ParCSRPilutSolve, + HYPRE_ParCSRPilutSolve, + HYPRE_ParCSRPilutSetup, + (HYPRE_Solver) * precond_solver ) ); } if (*precond_id == 4) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRCGNRSetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - HYPRE_ParCSRParaSailsSolve, - HYPRE_ParCSRParaSailsSolve, - HYPRE_ParCSRParaSailsSetup, - (HYPRE_Solver) *precond_solver ) ); + ( HYPRE_ParCSRCGNRSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_ParCSRParaSailsSolve, + HYPRE_ParCSRParaSailsSolve, + HYPRE_ParCSRParaSailsSetup, + (HYPRE_Solver) * precond_solver ) ); } if (*precond_id == 5) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRCGNRSetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - HYPRE_EuclidSolve, - HYPRE_EuclidSolve, - HYPRE_EuclidSetup, - (HYPRE_Solver) *precond_solver ) ); + ( HYPRE_ParCSRCGNRSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_EuclidSolve, + HYPRE_EuclidSolve, + HYPRE_EuclidSetup, + (HYPRE_Solver) * precond_solver ) ); + } + else if (*precond_id == 6) + { + *ierr = (hypre_F90_Int) + ( HYPRE_ParCSRCGNRSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_ILUSolve, + HYPRE_ILUSolve, + HYPRE_ILUSetup, + (HYPRE_Solver) * precond_solver ) ); + } + else if (*precond_id == 7) + { + *ierr = (hypre_F90_Int) + ( HYPRE_ParCSRCGNRSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_MGRSolve, + HYPRE_MGRSolve, + HYPRE_MGRSetup, + (HYPRE_Solver) * precond_solver ) ); } else { @@ -238,14 +262,14 @@ hypre_F90_IFACE(hypre_parcsrcgnrsetprecond, HYPRE_PARCSRCGNRSETPRECOND) void hypre_F90_IFACE(hypre_parcsrcgnrgetprecond, HYPRE_PARCSRCGNRGETPRECOND) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *precond_solver_ptr, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *precond_solver_ptr, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRCGNRGetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObjRef (HYPRE_Solver, precond_solver_ptr) ) ); + ( HYPRE_ParCSRCGNRGetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObjRef (HYPRE_Solver, precond_solver_ptr) ) ); } @@ -255,14 +279,14 @@ hypre_F90_IFACE(hypre_parcsrcgnrgetprecond, HYPRE_PARCSRCGNRGETPRECOND) void hypre_F90_IFACE(hypre_parcsrcgnrsetlogging, HYPRE_PARCSRCGNRSETLOGGING) - ( hypre_F90_Obj *solver, - hypre_F90_Int *logging, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *logging, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRCGNRSetLogging( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (logging) ) ); + ( HYPRE_ParCSRCGNRSetLogging( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (logging) ) ); } /*-------------------------------------------------------------------------- @@ -271,14 +295,14 @@ hypre_F90_IFACE(hypre_parcsrcgnrsetlogging, HYPRE_PARCSRCGNRSETLOGGING) void hypre_F90_IFACE(hypre_parcsrcgnrgetnumiteration, HYPRE_PARCSRCGNRGETNUMITERATION) - ( hypre_F90_Obj *solver, - hypre_F90_Int *num_iterations, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *num_iterations, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRCGNRGetNumIterations( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntRef (num_iterations) ) ); + ( HYPRE_ParCSRCGNRGetNumIterations( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntRef (num_iterations) ) ); } /*-------------------------------------------------------------------------- @@ -287,16 +311,16 @@ hypre_F90_IFACE(hypre_parcsrcgnrgetnumiteration, HYPRE_PARCSRCGNRGETNUMITERATION void hypre_F90_IFACE(hypre_parcsrcgnrgetfinalrelativ, HYPRE_PARCSRCGNRGETFINALRELATIV) - ( hypre_F90_Obj *solver, - hypre_F90_Real *norm, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *norm, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRCGNRGetFinalRelativeResidualNorm( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassRealRef (norm) ) ); + ( HYPRE_ParCSRCGNRGetFinalRelativeResidualNorm( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassRealRef (norm) ) ); } - + #ifdef __cplusplus } #endif diff --git a/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_cogmres.c b/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_cogmres.c index 28d1baf9..aed38a8f 100644 --- a/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_cogmres.c +++ b/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_cogmres.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,75 +17,75 @@ #ifdef __cplusplus extern "C" { #endif - + /*-------------------------------------------------------------------------- * HYPRE_ParCSRCOGMRESCreate *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_parcsrcogmrescreate, HYPRE_PARCSRCOGMRESCREATE) - ( hypre_F90_Comm *comm, - hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Comm *comm, + hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRCOGMRESCreate( - hypre_F90_PassComm (comm), - hypre_F90_PassObjRef (HYPRE_Solver, solver) ) ); + ( HYPRE_ParCSRCOGMRESCreate( + hypre_F90_PassComm (comm), + hypre_F90_PassObjRef (HYPRE_Solver, solver) ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRCOGMRESDestroy *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_parcsrcogmresdestroy, HYPRE_PARCSRCOGMRESDESTROY) - ( hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRCOGMRESDestroy( - hypre_F90_PassObj (HYPRE_Solver, solver) ) ); + ( HYPRE_ParCSRCOGMRESDestroy( + hypre_F90_PassObj (HYPRE_Solver, solver) ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRCOGMRESSetup *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_parcsrcogmressetup, HYPRE_PARCSRCOGMRESSETUP) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRCOGMRESSetup( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), - hypre_F90_PassObj (HYPRE_ParVector, b), - hypre_F90_PassObj (HYPRE_ParVector, x) ) ); + ( HYPRE_ParCSRCOGMRESSetup( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), + hypre_F90_PassObj (HYPRE_ParVector, b), + hypre_F90_PassObj (HYPRE_ParVector, x) ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRCOGMRESSolve *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_parcsrcogmressolve, HYPRE_PARCSRCOGMRESSOLVE) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRCOGMRESSolve( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), - hypre_F90_PassObj (HYPRE_ParVector, b), - hypre_F90_PassObj (HYPRE_ParVector, x) ) ); + ( HYPRE_ParCSRCOGMRESSolve( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), + hypre_F90_PassObj (HYPRE_ParVector, b), + hypre_F90_PassObj (HYPRE_ParVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -94,14 +94,14 @@ hypre_F90_IFACE(hypre_parcsrcogmressolve, HYPRE_PARCSRCOGMRESSOLVE) void hypre_F90_IFACE(hypre_parcsrcogmressetkdim, HYPRE_PARCSRCOGMRESSETKDIM) - ( hypre_F90_Obj *solver, - hypre_F90_Int *kdim, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *kdim, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRCOGMRESSetKDim( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (kdim) ) ); + ( HYPRE_ParCSRCOGMRESSetKDim( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (kdim) ) ); } /*-------------------------------------------------------------------------- @@ -110,14 +110,14 @@ hypre_F90_IFACE(hypre_parcsrcogmressetkdim, HYPRE_PARCSRCOGMRESSETKDIM) void hypre_F90_IFACE(hypre_parcsrcogmressetunroll, HYPRE_PARCSRCOGMRESSETUNROLL) - ( hypre_F90_Obj *solver, - hypre_F90_Int *unroll, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *unroll, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRCOGMRESSetUnroll( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (unroll) ) ); + ( HYPRE_ParCSRCOGMRESSetUnroll( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (unroll) ) ); } /*-------------------------------------------------------------------------- @@ -126,14 +126,14 @@ hypre_F90_IFACE(hypre_parcsrcogmressetunroll, HYPRE_PARCSRCOGMRESSETUNROLL) void hypre_F90_IFACE(hypre_parcsrcogmressetcgs, HYPRE_PARCSRCOGMRESSETCGS) - ( hypre_F90_Obj *solver, - hypre_F90_Int *cgs, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *cgs, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRCOGMRESSetCGS( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (cgs) ) ); + ( HYPRE_ParCSRCOGMRESSetCGS( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (cgs) ) ); } /*-------------------------------------------------------------------------- @@ -142,14 +142,14 @@ hypre_F90_IFACE(hypre_parcsrcogmressetcgs, HYPRE_PARCSRCOGMRESSETCGS) void hypre_F90_IFACE(hypre_parcsrcogmressettol, HYPRE_PARCSRCOGMRESSETTOL) - ( hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRCOGMRESSetTol( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (tol) ) ); + ( HYPRE_ParCSRCOGMRESSetTol( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (tol) ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRCOGMRESSetAbsoluteTol @@ -157,14 +157,14 @@ hypre_F90_IFACE(hypre_parcsrcogmressettol, HYPRE_PARCSRCOGMRESSETTOL) void hypre_F90_IFACE(hypre_parcsrcogmressetabsolutet, HYPRE_PARCSRCOGMRESSETABSOLUTET) - ( hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRCOGMRESSetAbsoluteTol( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (tol) ) ); + ( HYPRE_ParCSRCOGMRESSetAbsoluteTol( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (tol) ) ); } /*-------------------------------------------------------------------------- @@ -173,14 +173,14 @@ hypre_F90_IFACE(hypre_parcsrcogmressetabsolutet, HYPRE_PARCSRCOGMRESSETABSOLUTET void hypre_F90_IFACE(hypre_parcsrcogmressetminiter, HYPRE_PARCSRCOGMRESSETMINITER) - ( hypre_F90_Obj *solver, - hypre_F90_Int *min_iter, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *min_iter, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRCOGMRESSetMinIter( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (min_iter) ) ); + ( HYPRE_ParCSRCOGMRESSetMinIter( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (min_iter) ) ); } /*-------------------------------------------------------------------------- @@ -189,14 +189,14 @@ hypre_F90_IFACE(hypre_parcsrcogmressetminiter, HYPRE_PARCSRCOGMRESSETMINITER) void hypre_F90_IFACE(hypre_parcsrcogmressetmaxiter, HYPRE_PARCSRCOGMRESSETMAXITER) - ( hypre_F90_Obj *solver, - hypre_F90_Int *max_iter, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *max_iter, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRCOGMRESSetMaxIter( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (max_iter) ) ); + ( HYPRE_ParCSRCOGMRESSetMaxIter( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (max_iter) ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRCOGMRESSetPrecond @@ -204,20 +204,22 @@ hypre_F90_IFACE(hypre_parcsrcogmressetmaxiter, HYPRE_PARCSRCOGMRESSETMAXITER) void hypre_F90_IFACE(hypre_parcsrcogmressetprecond, HYPRE_PARCSRCOGMRESSETPRECOND) - ( hypre_F90_Obj *solver, - hypre_F90_Int *precond_id, - hypre_F90_Obj *precond_solver, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *precond_id, + hypre_F90_Obj *precond_solver, + hypre_F90_Int *ierr ) { -/*------------------------------------------------------------ - * The precond_id flags mean : - * 0 - no preconditioner - * 1 - set up a ds preconditioner - * 2 - set up an amg preconditioner - * 3 - set up a pilut preconditioner - * 4 - set up a parasails preconditioner - * 5 - set up a Euclid preconditioner - *------------------------------------------------------------*/ + /*------------------------------------------------------------ + * The precond_id flags mean : + * 0 - no preconditioner + * 1 - set up a ds preconditioner + * 2 - set up an amg preconditioner + * 3 - set up a pilut preconditioner + * 4 - set up a parasails preconditioner + * 5 - set up a Euclid preconditioner + * 6 - set up a ILU preconditioner + * 7 - set up a MGR preconditioner + *------------------------------------------------------------*/ if (*precond_id == 0) { @@ -226,48 +228,66 @@ hypre_F90_IFACE(hypre_parcsrcogmressetprecond, HYPRE_PARCSRCOGMRESSETPRECOND) else if (*precond_id == 1) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRCOGMRESSetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - HYPRE_ParCSRDiagScale, - HYPRE_ParCSRDiagScaleSetup, - NULL ) ); + ( HYPRE_ParCSRCOGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_ParCSRDiagScale, + HYPRE_ParCSRDiagScaleSetup, + NULL ) ); } else if (*precond_id == 2) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRCOGMRESSetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - HYPRE_BoomerAMGSolve, - HYPRE_BoomerAMGSetup, - (HYPRE_Solver) *precond_solver ) ); + ( HYPRE_ParCSRCOGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_BoomerAMGSolve, + HYPRE_BoomerAMGSetup, + (HYPRE_Solver) * precond_solver ) ); } else if (*precond_id == 3) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRCOGMRESSetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - HYPRE_ParCSRPilutSolve, - HYPRE_ParCSRPilutSetup, - (HYPRE_Solver) *precond_solver ) ); + ( HYPRE_ParCSRCOGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_ParCSRPilutSolve, + HYPRE_ParCSRPilutSetup, + (HYPRE_Solver) * precond_solver ) ); } else if (*precond_id == 4) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRCOGMRESSetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - HYPRE_ParCSRParaSailsSolve, - HYPRE_ParCSRParaSailsSetup, - (HYPRE_Solver) *precond_solver ) ); + ( HYPRE_ParCSRCOGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_ParCSRParaSailsSolve, + HYPRE_ParCSRParaSailsSetup, + (HYPRE_Solver) * precond_solver ) ); } else if (*precond_id == 5) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRCOGMRESSetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - HYPRE_EuclidSolve, - HYPRE_EuclidSetup, - (HYPRE_Solver) *precond_solver ) ); + ( HYPRE_ParCSRCOGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_EuclidSolve, + HYPRE_EuclidSetup, + (HYPRE_Solver) * precond_solver ) ); + } + else if (*precond_id == 6) + { + *ierr = (hypre_F90_Int) + ( HYPRE_ParCSRCOGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_ILUSolve, + HYPRE_ILUSetup, + (HYPRE_Solver) * precond_solver ) ); + } + else if (*precond_id == 7) + { + *ierr = (hypre_F90_Int) + ( HYPRE_ParCSRCOGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_MGRSolve, + HYPRE_MGRSetup, + (HYPRE_Solver) * precond_solver ) ); } else { @@ -281,14 +301,14 @@ hypre_F90_IFACE(hypre_parcsrcogmressetprecond, HYPRE_PARCSRCOGMRESSETPRECOND) void hypre_F90_IFACE(hypre_parcsrcogmresgetprecond, HYPRE_PARCSRCOGMRESGETPRECOND) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *precond_solver_ptr, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *precond_solver_ptr, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRCOGMRESGetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObjRef (HYPRE_Solver, precond_solver_ptr) ) ); + ( HYPRE_ParCSRCOGMRESGetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObjRef (HYPRE_Solver, precond_solver_ptr) ) ); } @@ -298,14 +318,14 @@ hypre_F90_IFACE(hypre_parcsrcogmresgetprecond, HYPRE_PARCSRCOGMRESGETPRECOND) void hypre_F90_IFACE(hypre_parcsrcogmressetlogging, HYPRE_PARCSRCOGMRESSETLOGGING) - ( hypre_F90_Obj *solver, - hypre_F90_Int *logging, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *logging, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRCOGMRESSetLogging( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (logging) ) ); + ( HYPRE_ParCSRCOGMRESSetLogging( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (logging) ) ); } /*-------------------------------------------------------------------------- @@ -314,14 +334,14 @@ hypre_F90_IFACE(hypre_parcsrcogmressetlogging, HYPRE_PARCSRCOGMRESSETLOGGING) void hypre_F90_IFACE(hypre_parcsrcogmressetprintleve, HYPRE_PARCSRCOGMRESSETPRINTLEVE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *print_level, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *print_level, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRCOGMRESSetPrintLevel( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (print_level) ) ); + ( HYPRE_ParCSRCOGMRESSetPrintLevel( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (print_level) ) ); } /*-------------------------------------------------------------------------- @@ -330,14 +350,14 @@ hypre_F90_IFACE(hypre_parcsrcogmressetprintleve, HYPRE_PARCSRCOGMRESSETPRINTLEVE void hypre_F90_IFACE(hypre_parcsrcogmresgetnumiterat, HYPRE_PARCSRCOGMRESGETNUMITERAT) - ( hypre_F90_Obj *solver, - hypre_F90_Int *num_iterations, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *num_iterations, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRCOGMRESGetNumIterations( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntRef (num_iterations) ) ); + ( HYPRE_ParCSRCOGMRESGetNumIterations( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntRef (num_iterations) ) ); } /*-------------------------------------------------------------------------- @@ -346,16 +366,16 @@ hypre_F90_IFACE(hypre_parcsrcogmresgetnumiterat, HYPRE_PARCSRCOGMRESGETNUMITERAT void hypre_F90_IFACE(hypre_parcsrcogmresgetfinalrela, HYPRE_PARCSRCOGMRESGETFINALRELA) - ( hypre_F90_Obj *solver, - hypre_F90_Real *norm, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *norm, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRCOGMRESGetFinalRelativeResidualNorm( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassRealRef (norm) ) ); + ( HYPRE_ParCSRCOGMRESGetFinalRelativeResidualNorm( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassRealRef (norm) ) ); } - + #ifdef __cplusplus } #endif diff --git a/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_flexgmres.c b/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_flexgmres.c index c27e3a02..567f2e7f 100644 --- a/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_flexgmres.c +++ b/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_flexgmres.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,75 +17,75 @@ #ifdef __cplusplus extern "C" { #endif - + /*-------------------------------------------------------------------------- * HYPRE_ParCSRFlexGMRESCreate *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_parcsrflexgmrescreate, HYPRE_PARCSRFLEXGMRESCREATE) - ( hypre_F90_Comm *comm, - hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Comm *comm, + hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRFlexGMRESCreate( - hypre_F90_PassComm (comm), - hypre_F90_PassObjRef (HYPRE_Solver, solver) ) ); + ( HYPRE_ParCSRFlexGMRESCreate( + hypre_F90_PassComm (comm), + hypre_F90_PassObjRef (HYPRE_Solver, solver) ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRFlexGMRESDestroy *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_parcsrflexgmresdestroy, HYPRE_PARCSRFLEXGMRESDESTROY) - ( hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRFlexGMRESDestroy( - hypre_F90_PassObj (HYPRE_Solver, solver) ) ); + ( HYPRE_ParCSRFlexGMRESDestroy( + hypre_F90_PassObj (HYPRE_Solver, solver) ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRFlexGMRESSetup *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_parcsrflexgmressetup, HYPRE_PARCSRFLEXGMRESSETUP) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRFlexGMRESSetup( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), - hypre_F90_PassObj (HYPRE_ParVector, b), - hypre_F90_PassObj (HYPRE_ParVector, x) ) ); + ( HYPRE_ParCSRFlexGMRESSetup( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), + hypre_F90_PassObj (HYPRE_ParVector, b), + hypre_F90_PassObj (HYPRE_ParVector, x) ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRFlexGMRESSolve *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_parcsrflexgmressolve, HYPRE_PARCSRFLEXGMRESSOLVE) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRFlexGMRESSolve( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), - hypre_F90_PassObj (HYPRE_ParVector, b), - hypre_F90_PassObj (HYPRE_ParVector, x) ) ); + ( HYPRE_ParCSRFlexGMRESSolve( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), + hypre_F90_PassObj (HYPRE_ParVector, b), + hypre_F90_PassObj (HYPRE_ParVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -94,14 +94,14 @@ hypre_F90_IFACE(hypre_parcsrflexgmressolve, HYPRE_PARCSRFLEXGMRESSOLVE) void hypre_F90_IFACE(hypre_parcsrflexgmressetkdim, HYPRE_PARCSRFLEXGMRESSETKDIM) - ( hypre_F90_Obj *solver, - hypre_F90_Int *kdim, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *kdim, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRFlexGMRESSetKDim( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (kdim) ) ); + ( HYPRE_ParCSRFlexGMRESSetKDim( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (kdim) ) ); } /*-------------------------------------------------------------------------- @@ -110,14 +110,14 @@ hypre_F90_IFACE(hypre_parcsrflexgmressetkdim, HYPRE_PARCSRFLEXGMRESSETKDIM) void hypre_F90_IFACE(hypre_parcsrflexgmressettol, HYPRE_PARCSRFLEXGMRESSETTOL) - ( hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRFlexGMRESSetTol( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (tol) ) ); + ( HYPRE_ParCSRFlexGMRESSetTol( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (tol) ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRFlexGMRESSetAbsoluteTol @@ -125,14 +125,14 @@ hypre_F90_IFACE(hypre_parcsrflexgmressettol, HYPRE_PARCSRFLEXGMRESSETTOL) void hypre_F90_IFACE(hypre_parcsrflexgmressetabsolutetol, HYPRE_PARCSRFLEXGMRESSETABSOLUTETOL) - ( hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRFlexGMRESSetAbsoluteTol( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (tol) ) ); + ( HYPRE_ParCSRFlexGMRESSetAbsoluteTol( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (tol) ) ); } /*-------------------------------------------------------------------------- @@ -141,14 +141,14 @@ hypre_F90_IFACE(hypre_parcsrflexgmressetabsolutetol, HYPRE_PARCSRFLEXGMRESSETABS void hypre_F90_IFACE(hypre_parcsrflexgmressetminiter, HYPRE_PARCSRFLEXGMRESSETMINITER) - ( hypre_F90_Obj *solver, - hypre_F90_Int *min_iter, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *min_iter, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRFlexGMRESSetMinIter( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (min_iter) ) ); + ( HYPRE_ParCSRFlexGMRESSetMinIter( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (min_iter) ) ); } /*-------------------------------------------------------------------------- @@ -157,14 +157,14 @@ hypre_F90_IFACE(hypre_parcsrflexgmressetminiter, HYPRE_PARCSRFLEXGMRESSETMINITER void hypre_F90_IFACE(hypre_parcsrflexgmressetmaxiter, HYPRE_PARCSRFLEXGMRESSETMAXITER) - ( hypre_F90_Obj *solver, - hypre_F90_Int *max_iter, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *max_iter, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRFlexGMRESSetMaxIter( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (max_iter) ) ); + ( HYPRE_ParCSRFlexGMRESSetMaxIter( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (max_iter) ) ); } /*-------------------------------------------------------------------------- @@ -173,10 +173,10 @@ hypre_F90_IFACE(hypre_parcsrflexgmressetmaxiter, HYPRE_PARCSRFLEXGMRESSETMAXITER void hypre_F90_IFACE(hypre_parcsrflexgmressetprecond, HYPRE_PARCSRFLEXGMRESSETPRECOND) - ( hypre_F90_Obj *solver, - hypre_F90_Int *precond_id, - hypre_F90_Obj *precond_solver, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *precond_id, + hypre_F90_Obj *precond_solver, + hypre_F90_Int *ierr ) { /*------------------------------------------------------------ * The precond_id flags mean : @@ -185,6 +185,9 @@ hypre_F90_IFACE(hypre_parcsrflexgmressetprecond, HYPRE_PARCSRFLEXGMRESSETPRECOND * 2 - set up an amg preconditioner * 3 - set up a pilut preconditioner * 4 - set up a parasails preconditioner + * 5 - set up a Euclid preconditioner + * 6 - set up a ILU preconditioner + * 7 - set up a MGR preconditioner *------------------------------------------------------------*/ if (*precond_id == 0) @@ -194,48 +197,66 @@ hypre_F90_IFACE(hypre_parcsrflexgmressetprecond, HYPRE_PARCSRFLEXGMRESSETPRECOND else if (*precond_id == 1) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRFlexGMRESSetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - HYPRE_ParCSRDiagScale, - HYPRE_ParCSRDiagScaleSetup, - NULL ) ); + ( HYPRE_ParCSRFlexGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_ParCSRDiagScale, + HYPRE_ParCSRDiagScaleSetup, + NULL ) ); } else if (*precond_id == 2) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRFlexGMRESSetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - HYPRE_BoomerAMGSolve, - HYPRE_BoomerAMGSetup, - (HYPRE_Solver) *precond_solver ) ); + ( HYPRE_ParCSRFlexGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_BoomerAMGSolve, + HYPRE_BoomerAMGSetup, + (HYPRE_Solver) * precond_solver ) ); } else if (*precond_id == 3) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRFlexGMRESSetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - HYPRE_ParCSRPilutSolve, - HYPRE_ParCSRPilutSetup, - (HYPRE_Solver) *precond_solver ) ); + ( HYPRE_ParCSRFlexGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_ParCSRPilutSolve, + HYPRE_ParCSRPilutSetup, + (HYPRE_Solver) * precond_solver ) ); } else if (*precond_id == 4) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRFlexGMRESSetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - HYPRE_ParCSRParaSailsSolve, - HYPRE_ParCSRParaSailsSetup, - (HYPRE_Solver) *precond_solver ) ); + ( HYPRE_ParCSRFlexGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_ParCSRParaSailsSolve, + HYPRE_ParCSRParaSailsSetup, + (HYPRE_Solver) * precond_solver ) ); } else if (*precond_id == 5) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRFlexGMRESSetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - HYPRE_EuclidSolve, - HYPRE_EuclidSetup, - (HYPRE_Solver) *precond_solver ) ); + ( HYPRE_ParCSRFlexGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_EuclidSolve, + HYPRE_EuclidSetup, + (HYPRE_Solver) * precond_solver ) ); + } + else if (*precond_id == 6) + { + *ierr = (hypre_F90_Int) + ( HYPRE_ParCSRFlexGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_ILUSolve, + HYPRE_ILUSetup, + (HYPRE_Solver) * precond_solver ) ); + } + else if (*precond_id == 7) + { + *ierr = (hypre_F90_Int) + ( HYPRE_ParCSRFlexGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_MGRSolve, + HYPRE_MGRSetup, + (HYPRE_Solver) * precond_solver ) ); } else { @@ -249,14 +270,14 @@ hypre_F90_IFACE(hypre_parcsrflexgmressetprecond, HYPRE_PARCSRFLEXGMRESSETPRECOND void hypre_F90_IFACE(hypre_parcsrflexgmresgetprecond, HYPRE_PARCSRFLEXGMRESGETPRECOND) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *precond_solver_ptr, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *precond_solver_ptr, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRFlexGMRESGetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObjRef (HYPRE_Solver, precond_solver_ptr) ) ); + ( HYPRE_ParCSRFlexGMRESGetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObjRef (HYPRE_Solver, precond_solver_ptr) ) ); } @@ -266,14 +287,14 @@ hypre_F90_IFACE(hypre_parcsrflexgmresgetprecond, HYPRE_PARCSRFLEXGMRESGETPRECOND void hypre_F90_IFACE(hypre_parcsrflexgmressetlogging, HYPRE_PARCSRFLEXGMRESSETLOGGING) - ( hypre_F90_Obj *solver, - hypre_F90_Int *logging, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *logging, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRFlexGMRESSetLogging( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (logging) ) ); + ( HYPRE_ParCSRFlexGMRESSetLogging( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (logging) ) ); } /*-------------------------------------------------------------------------- @@ -282,14 +303,14 @@ hypre_F90_IFACE(hypre_parcsrflexgmressetlogging, HYPRE_PARCSRFLEXGMRESSETLOGGING void hypre_F90_IFACE(hypre_parcsrflexgmressetprintlevel, HYPRE_PARCSRFLEXGMRESSETPRINTLEVEL) - ( hypre_F90_Obj *solver, - hypre_F90_Int *print_level, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *print_level, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRFlexGMRESSetPrintLevel( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (print_level) ) ); + ( HYPRE_ParCSRFlexGMRESSetPrintLevel( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (print_level) ) ); } /*-------------------------------------------------------------------------- @@ -298,14 +319,14 @@ hypre_F90_IFACE(hypre_parcsrflexgmressetprintlevel, HYPRE_PARCSRFLEXGMRESSETPRIN void hypre_F90_IFACE(hypre_parcsrflexgmresgetnumiteratio, HYPRE_PARCSRFLEXGMRESGETNUMITERATIO) - ( hypre_F90_Obj *solver, - hypre_F90_Int *num_iterations, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *num_iterations, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRFlexGMRESGetNumIterations( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntRef (num_iterations) ) ); + ( HYPRE_ParCSRFlexGMRESGetNumIterations( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntRef (num_iterations) ) ); } /*-------------------------------------------------------------------------- @@ -314,16 +335,16 @@ hypre_F90_IFACE(hypre_parcsrflexgmresgetnumiteratio, HYPRE_PARCSRFLEXGMRESGETNUM void hypre_F90_IFACE(hypre_parcsrflexgmresgetfinalrelati, HYPRE_PARCSRFLEXGMRESGETFINALRELATI) - ( hypre_F90_Obj *solver, - hypre_F90_Real *norm, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *norm, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRFlexGMRESGetFinalRelativeResidualNorm( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassRealRef (norm) ) ); + ( HYPRE_ParCSRFlexGMRESGetFinalRelativeResidualNorm( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassRealRef (norm) ) ); } - + #ifdef __cplusplus } #endif diff --git a/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_gmres.c b/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_gmres.c index 4d0578b8..30be183a 100644 --- a/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_gmres.c +++ b/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_gmres.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,75 +17,75 @@ #ifdef __cplusplus extern "C" { #endif - + /*-------------------------------------------------------------------------- * HYPRE_ParCSRGMRESCreate *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_parcsrgmrescreate, HYPRE_PARCSRGMRESCREATE) - ( hypre_F90_Comm *comm, - hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Comm *comm, + hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRGMRESCreate( - hypre_F90_PassComm (comm), - hypre_F90_PassObjRef (HYPRE_Solver, solver) ) ); + ( HYPRE_ParCSRGMRESCreate( + hypre_F90_PassComm (comm), + hypre_F90_PassObjRef (HYPRE_Solver, solver) ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRGMRESDestroy *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_parcsrgmresdestroy, HYPRE_PARCSRGMRESDESTROY) - ( hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRGMRESDestroy( - hypre_F90_PassObj (HYPRE_Solver, solver) ) ); + ( HYPRE_ParCSRGMRESDestroy( + hypre_F90_PassObj (HYPRE_Solver, solver) ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRGMRESSetup *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_parcsrgmressetup, HYPRE_PARCSRGMRESSETUP) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRGMRESSetup( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), - hypre_F90_PassObj (HYPRE_ParVector, b), - hypre_F90_PassObj (HYPRE_ParVector, x) ) ); + ( HYPRE_ParCSRGMRESSetup( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), + hypre_F90_PassObj (HYPRE_ParVector, b), + hypre_F90_PassObj (HYPRE_ParVector, x) ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRGMRESSolve *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_parcsrgmressolve, HYPRE_PARCSRGMRESSOLVE) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRGMRESSolve( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), - hypre_F90_PassObj (HYPRE_ParVector, b), - hypre_F90_PassObj (HYPRE_ParVector, x) ) ); + ( HYPRE_ParCSRGMRESSolve( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), + hypre_F90_PassObj (HYPRE_ParVector, b), + hypre_F90_PassObj (HYPRE_ParVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -94,14 +94,14 @@ hypre_F90_IFACE(hypre_parcsrgmressolve, HYPRE_PARCSRGMRESSOLVE) void hypre_F90_IFACE(hypre_parcsrgmressetkdim, HYPRE_PARCSRGMRESSETKDIM) - ( hypre_F90_Obj *solver, - hypre_F90_Int *kdim, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *kdim, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRGMRESSetKDim( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (kdim) ) ); + ( HYPRE_ParCSRGMRESSetKDim( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (kdim) ) ); } /*-------------------------------------------------------------------------- @@ -110,14 +110,14 @@ hypre_F90_IFACE(hypre_parcsrgmressetkdim, HYPRE_PARCSRGMRESSETKDIM) void hypre_F90_IFACE(hypre_parcsrgmressettol, HYPRE_PARCSRGMRESSETTOL) - ( hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRGMRESSetTol( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (tol) ) ); + ( HYPRE_ParCSRGMRESSetTol( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (tol) ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRGMRESSetAbsoluteTol @@ -125,14 +125,14 @@ hypre_F90_IFACE(hypre_parcsrgmressettol, HYPRE_PARCSRGMRESSETTOL) void hypre_F90_IFACE(hypre_parcsrgmressetabsolutetol, HYPRE_PARCSRGMRESSETABSOLUTETOL) - ( hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRGMRESSetAbsoluteTol( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (tol) ) ); + ( HYPRE_ParCSRGMRESSetAbsoluteTol( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (tol) ) ); } /*-------------------------------------------------------------------------- @@ -141,14 +141,14 @@ hypre_F90_IFACE(hypre_parcsrgmressetabsolutetol, HYPRE_PARCSRGMRESSETABSOLUTETOL void hypre_F90_IFACE(hypre_parcsrgmressetminiter, HYPRE_PARCSRGMRESSETMINITER) - ( hypre_F90_Obj *solver, - hypre_F90_Int *min_iter, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *min_iter, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRGMRESSetMinIter( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (min_iter) ) ); + ( HYPRE_ParCSRGMRESSetMinIter( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (min_iter) ) ); } /*-------------------------------------------------------------------------- @@ -157,14 +157,14 @@ hypre_F90_IFACE(hypre_parcsrgmressetminiter, HYPRE_PARCSRGMRESSETMINITER) void hypre_F90_IFACE(hypre_parcsrgmressetmaxiter, HYPRE_PARCSRGMRESSETMAXITER) - ( hypre_F90_Obj *solver, - hypre_F90_Int *max_iter, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *max_iter, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRGMRESSetMaxIter( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (max_iter) ) ); + ( HYPRE_ParCSRGMRESSetMaxIter( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (max_iter) ) ); } /*-------------------------------------------------------------------------- @@ -173,14 +173,14 @@ hypre_F90_IFACE(hypre_parcsrgmressetmaxiter, HYPRE_PARCSRGMRESSETMAXITER) void hypre_F90_IFACE(hypre_parcsrgmressetstopcrit, HYPRE_PARCSRGMRESSETSTOPCRIT) - ( hypre_F90_Obj *solver, - hypre_F90_Int *stop_crit, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *stop_crit, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRGMRESSetStopCrit( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (stop_crit) ) ); + ( HYPRE_ParCSRGMRESSetStopCrit( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (stop_crit) ) ); } /*-------------------------------------------------------------------------- @@ -189,10 +189,10 @@ hypre_F90_IFACE(hypre_parcsrgmressetstopcrit, HYPRE_PARCSRGMRESSETSTOPCRIT) void hypre_F90_IFACE(hypre_parcsrgmressetprecond, HYPRE_PARCSRGMRESSETPRECOND) - ( hypre_F90_Obj *solver, - hypre_F90_Int *precond_id, - hypre_F90_Obj *precond_solver, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *precond_id, + hypre_F90_Obj *precond_solver, + hypre_F90_Int *ierr ) { /*------------------------------------------------------------ * The precond_id flags mean : @@ -201,6 +201,9 @@ hypre_F90_IFACE(hypre_parcsrgmressetprecond, HYPRE_PARCSRGMRESSETPRECOND) * 2 - set up an amg preconditioner * 3 - set up a pilut preconditioner * 4 - set up a parasails preconditioner + * 5 - set up a Euclid preconditioner + * 6 - set up a ILU preconditioner + * 7 - set up a MGR preconditioner *------------------------------------------------------------*/ if (*precond_id == 0) @@ -210,49 +213,67 @@ hypre_F90_IFACE(hypre_parcsrgmressetprecond, HYPRE_PARCSRGMRESSETPRECOND) else if (*precond_id == 1) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRGMRESSetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - HYPRE_ParCSRDiagScale, - HYPRE_ParCSRDiagScaleSetup, - NULL ) ); + ( HYPRE_ParCSRGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_ParCSRDiagScale, + HYPRE_ParCSRDiagScaleSetup, + NULL ) ); } else if (*precond_id == 2) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRGMRESSetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - HYPRE_BoomerAMGSolve, - HYPRE_BoomerAMGSetup, - (HYPRE_Solver) *precond_solver ) ); + ( HYPRE_ParCSRGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_BoomerAMGSolve, + HYPRE_BoomerAMGSetup, + (HYPRE_Solver) * precond_solver ) ); } else if (*precond_id == 3) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRGMRESSetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - HYPRE_ParCSRPilutSolve, - HYPRE_ParCSRPilutSetup, - (HYPRE_Solver) *precond_solver ) ); + ( HYPRE_ParCSRGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_ParCSRPilutSolve, + HYPRE_ParCSRPilutSetup, + (HYPRE_Solver) * precond_solver ) ); } else if (*precond_id == 4) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRGMRESSetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - HYPRE_ParCSRParaSailsSolve, - HYPRE_ParCSRParaSailsSetup, - (HYPRE_Solver) *precond_solver ) ); - } + ( HYPRE_ParCSRGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_ParCSRParaSailsSolve, + HYPRE_ParCSRParaSailsSetup, + (HYPRE_Solver) * precond_solver ) ); + } else if (*precond_id == 5) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRGMRESSetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - HYPRE_EuclidSolve, - HYPRE_EuclidSetup, - (HYPRE_Solver) *precond_solver ) ); - } + ( HYPRE_ParCSRGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_EuclidSolve, + HYPRE_EuclidSetup, + (HYPRE_Solver) * precond_solver ) ); + } + else if (*precond_id == 6) + { + *ierr = (hypre_F90_Int) + ( HYPRE_ParCSRGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_ILUSolve, + HYPRE_ILUSetup, + (HYPRE_Solver) * precond_solver ) ); + } + else if (*precond_id == 7) + { + *ierr = (hypre_F90_Int) + ( HYPRE_ParCSRGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_MGRSolve, + HYPRE_MGRSetup, + (HYPRE_Solver) * precond_solver ) ); + } else { *ierr = -1; @@ -265,14 +286,14 @@ hypre_F90_IFACE(hypre_parcsrgmressetprecond, HYPRE_PARCSRGMRESSETPRECOND) void hypre_F90_IFACE(hypre_parcsrgmresgetprecond, HYPRE_PARCSRGMRESGETPRECOND) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *precond_solver_ptr, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *precond_solver_ptr, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRGMRESGetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObjRef (HYPRE_Solver, precond_solver_ptr) ) ); + ( HYPRE_ParCSRGMRESGetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObjRef (HYPRE_Solver, precond_solver_ptr) ) ); } @@ -282,14 +303,14 @@ hypre_F90_IFACE(hypre_parcsrgmresgetprecond, HYPRE_PARCSRGMRESGETPRECOND) void hypre_F90_IFACE(hypre_parcsrgmressetlogging, HYPRE_PARCSRGMRESSETLOGGING) - ( hypre_F90_Obj *solver, - hypre_F90_Int *logging, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *logging, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRGMRESSetLogging( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (logging) ) ); + ( HYPRE_ParCSRGMRESSetLogging( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (logging) ) ); } /*-------------------------------------------------------------------------- @@ -298,14 +319,14 @@ hypre_F90_IFACE(hypre_parcsrgmressetlogging, HYPRE_PARCSRGMRESSETLOGGING) void hypre_F90_IFACE(hypre_parcsrgmressetprintlevel, HYPRE_PARCSRGMRESSETPRINTLEVEL) - ( hypre_F90_Obj *solver, - hypre_F90_Int *print_level, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *print_level, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRGMRESSetPrintLevel( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (print_level) ) ); + ( HYPRE_ParCSRGMRESSetPrintLevel( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (print_level) ) ); } /*-------------------------------------------------------------------------- @@ -314,14 +335,14 @@ hypre_F90_IFACE(hypre_parcsrgmressetprintlevel, HYPRE_PARCSRGMRESSETPRINTLEVEL) void hypre_F90_IFACE(hypre_parcsrgmresgetnumiteratio, HYPRE_PARCSRGMRESGETNUMITERATIO) - ( hypre_F90_Obj *solver, - hypre_F90_Int *num_iterations, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *num_iterations, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRGMRESGetNumIterations( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntRef (num_iterations) ) ); + ( HYPRE_ParCSRGMRESGetNumIterations( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntRef (num_iterations) ) ); } /*-------------------------------------------------------------------------- @@ -330,16 +351,16 @@ hypre_F90_IFACE(hypre_parcsrgmresgetnumiteratio, HYPRE_PARCSRGMRESGETNUMITERATIO void hypre_F90_IFACE(hypre_parcsrgmresgetfinalrelati, HYPRE_PARCSRGMRESGETFINALRELATI) - ( hypre_F90_Obj *solver, - hypre_F90_Real *norm, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *norm, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRGMRESGetFinalRelativeResidualNorm( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassRealRef (norm) ) ); + ( HYPRE_ParCSRGMRESGetFinalRelativeResidualNorm( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassRealRef (norm) ) ); } - + #ifdef __cplusplus } #endif diff --git a/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_hybrid.c b/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_hybrid.c index 71bff34a..e9065d4c 100644 --- a/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_hybrid.c +++ b/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_hybrid.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,19 +17,19 @@ #ifdef __cplusplus extern "C" { #endif - + /*-------------------------------------------------------------------------- * HYPRE_ParCSRHybridCreate *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_parcsrhybridcreate, HYPRE_PARCSRHYBRIDCREATE) - (hypre_F90_Obj *solver, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridCreate( - hypre_F90_PassObjRef (HYPRE_Solver, solver) )); + (HYPRE_ParCSRHybridCreate( + hypre_F90_PassObjRef (HYPRE_Solver, solver) )); } /*-------------------------------------------------------------------------- @@ -38,12 +38,12 @@ hypre_F90_IFACE(hypre_parcsrhybridcreate, HYPRE_PARCSRHYBRIDCREATE) void hypre_F90_IFACE(hypre_parcsrhybriddestroy, HYPRE_PARCSRHYBRIDDESTROY) - (hypre_F90_Obj *solver, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridDestroy( - hypre_F90_PassObj (HYPRE_Solver, solver) ) ); + (HYPRE_ParCSRHybridDestroy( + hypre_F90_PassObj (HYPRE_Solver, solver) ) ); } /*-------------------------------------------------------------------------- @@ -52,18 +52,18 @@ hypre_F90_IFACE(hypre_parcsrhybriddestroy, HYPRE_PARCSRHYBRIDDESTROY) void hypre_F90_IFACE(hypre_parcsrhybridsetup, HYPRE_PARCSRHYBRIDSETUP) - (hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetup( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), - hypre_F90_PassObj (HYPRE_ParVector, b), - hypre_F90_PassObj (HYPRE_ParVector, x) ) ); + (HYPRE_ParCSRHybridSetup( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), + hypre_F90_PassObj (HYPRE_ParVector, b), + hypre_F90_PassObj (HYPRE_ParVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -72,18 +72,18 @@ hypre_F90_IFACE(hypre_parcsrhybridsetup, HYPRE_PARCSRHYBRIDSETUP) void hypre_F90_IFACE(hypre_parcsrhybridsolve, HYPRE_PARCSRHYBRIDSOLVE) - (hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSolve( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), - hypre_F90_PassObj (HYPRE_ParVector, b), - hypre_F90_PassObj (HYPRE_ParVector, x) ) ); + (HYPRE_ParCSRHybridSolve( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), + hypre_F90_PassObj (HYPRE_ParVector, b), + hypre_F90_PassObj (HYPRE_ParVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -92,14 +92,14 @@ hypre_F90_IFACE(hypre_parcsrhybridsolve, HYPRE_PARCSRHYBRIDSOLVE) void hypre_F90_IFACE(hypre_parcsrhybridsettol, HYPRE_PARCSRHYBRIDSETTOL) - (hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetTol( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (tol) ) ); + (HYPRE_ParCSRHybridSetTol( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (tol) ) ); } /*-------------------------------------------------------------------------- @@ -108,14 +108,14 @@ hypre_F90_IFACE(hypre_parcsrhybridsettol, HYPRE_PARCSRHYBRIDSETTOL) void hypre_F90_IFACE(hypre_parcsrhybridsetconvergenc, HYPRE_PARCSRHYBRIDSETCONVERGENC) - (hypre_F90_Obj *solver, - hypre_F90_Real *cf_tol, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Real *cf_tol, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetConvergenceTol( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (cf_tol) ) ); + (HYPRE_ParCSRHybridSetConvergenceTol( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (cf_tol) ) ); } /*-------------------------------------------------------------------------- @@ -124,14 +124,14 @@ hypre_F90_IFACE(hypre_parcsrhybridsetconvergenc, HYPRE_PARCSRHYBRIDSETCONVERGENC void hypre_F90_IFACE(hypre_parcsrhybridsetdscgmaxite, HYPRE_PARCSRHYBRIDSETDSCGMAXITE) - (hypre_F90_Obj *solver, - hypre_F90_Int *dscg_max_its, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *dscg_max_its, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetDSCGMaxIter( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (dscg_max_its) ) ); + (HYPRE_ParCSRHybridSetDSCGMaxIter( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (dscg_max_its) ) ); } /*-------------------------------------------------------------------------- @@ -140,14 +140,14 @@ hypre_F90_IFACE(hypre_parcsrhybridsetdscgmaxite, HYPRE_PARCSRHYBRIDSETDSCGMAXITE void hypre_F90_IFACE(hypre_parcsrhybridsetpcgmaxiter, HYPRE_PARCSRHYBRIDSETPCGMAXITER) - (hypre_F90_Obj *solver, - hypre_F90_Int *pcg_max_its, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *pcg_max_its, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetPCGMaxIter( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (pcg_max_its) ) ); + (HYPRE_ParCSRHybridSetPCGMaxIter( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (pcg_max_its) ) ); } /*-------------------------------------------------------------------------- @@ -156,14 +156,14 @@ hypre_F90_IFACE(hypre_parcsrhybridsetpcgmaxiter, HYPRE_PARCSRHYBRIDSETPCGMAXITER void hypre_F90_IFACE(hypre_parcsrhybridsetsolvertype, HYPRE_PARCSRHYBRIDSETSOLVERTYPE) - (hypre_F90_Obj *solver, - hypre_F90_Int *solver_type, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *solver_type, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetSolverType( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (solver_type) ) ); + (HYPRE_ParCSRHybridSetSolverType( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (solver_type) ) ); } /*-------------------------------------------------------------------------- @@ -172,14 +172,14 @@ hypre_F90_IFACE(hypre_parcsrhybridsetsolvertype, HYPRE_PARCSRHYBRIDSETSOLVERTYPE void hypre_F90_IFACE(hypre_parcsrhybridsetkdim, HYPRE_PARCSRHYBRIDSETKDIM) - (hypre_F90_Obj *solver, - hypre_F90_Int *kdim, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *kdim, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetKDim( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (kdim) ) ); + (HYPRE_ParCSRHybridSetKDim( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (kdim) ) ); } /*-------------------------------------------------------------------------- @@ -188,14 +188,14 @@ hypre_F90_IFACE(hypre_parcsrhybridsetkdim, HYPRE_PARCSRHYBRIDSETKDIM) void hypre_F90_IFACE(hypre_parcsrhybridsettwonorm, HYPRE_PARCSRHYBRIDSETTWONORM) - (hypre_F90_Obj *solver, - hypre_F90_Int *two_norm, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *two_norm, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetTwoNorm( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (two_norm) ) ); + (HYPRE_ParCSRHybridSetTwoNorm( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (two_norm) ) ); } /*-------------------------------------------------------------------------- @@ -204,14 +204,14 @@ hypre_F90_IFACE(hypre_parcsrhybridsettwonorm, HYPRE_PARCSRHYBRIDSETTWONORM) void hypre_F90_IFACE(hypre_parcsrhybridsetstopcrit, HYPRE_PARCSRHYBRIDSETSTOPCRIT) - (hypre_F90_Obj *solver, - hypre_F90_Int *stop_crit, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *stop_crit, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetStopCrit( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (stop_crit) ) ); + (HYPRE_ParCSRHybridSetStopCrit( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (stop_crit) ) ); } /*-------------------------------------------------------------------------- @@ -220,14 +220,14 @@ hypre_F90_IFACE(hypre_parcsrhybridsetstopcrit, HYPRE_PARCSRHYBRIDSETSTOPCRIT) void hypre_F90_IFACE(hypre_parcsrhybridsetrelchange, HYPRE_PARCSRHYBRIDSETRELCHANGE) - (hypre_F90_Obj *solver, - hypre_F90_Int *rel_change, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *rel_change, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetRelChange( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (rel_change) ) ); + (HYPRE_ParCSRHybridSetRelChange( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (rel_change) ) ); } /*-------------------------------------------------------------------------- @@ -236,10 +236,10 @@ hypre_F90_IFACE(hypre_parcsrhybridsetrelchange, HYPRE_PARCSRHYBRIDSETRELCHANGE) void hypre_F90_IFACE(hypre_parcsrhybridsetprecond, HYPRE_PARCSRHYBRIDSETPRECOND) - (hypre_F90_Obj *solver, - hypre_F90_Int *precond_id, - hypre_F90_Obj *precond_solver, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *precond_id, + hypre_F90_Obj *precond_solver, + hypre_F90_Int *ierr) { /*---------------------------------------------------------------- * precond_id definitions @@ -248,7 +248,11 @@ hypre_F90_IFACE(hypre_parcsrhybridsetprecond, HYPRE_PARCSRHYBRIDSETPRECOND) * 2 - use amg preconditioner * 3 - use pilut preconditioner * 4 - use parasails preconditioner + * 5 - use Euclid preconditioner + * 6 - use ILU preconditioner + * 7 - use MGR preconditioner *---------------------------------------------------------------*/ + if (*precond_id == 0) { *ierr = 0; @@ -256,52 +260,70 @@ hypre_F90_IFACE(hypre_parcsrhybridsetprecond, HYPRE_PARCSRHYBRIDSETPRECOND) else if (*precond_id == 1) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - HYPRE_ParCSRDiagScale, - HYPRE_ParCSRDiagScaleSetup, - NULL )); + (HYPRE_ParCSRHybridSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_ParCSRDiagScale, + HYPRE_ParCSRDiagScaleSetup, + NULL )); } else if (*precond_id == 2) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - HYPRE_BoomerAMGSolve, - HYPRE_BoomerAMGSetup, - (HYPRE_Solver) *precond_solver )); + (HYPRE_ParCSRHybridSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_BoomerAMGSolve, + HYPRE_BoomerAMGSetup, + (HYPRE_Solver) * precond_solver )); } else if (*precond_id == 3) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - HYPRE_ParCSRPilutSolve, - HYPRE_ParCSRPilutSetup, - (HYPRE_Solver) *precond_solver )); + (HYPRE_ParCSRHybridSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_ParCSRPilutSolve, + HYPRE_ParCSRPilutSetup, + (HYPRE_Solver) * precond_solver )); } else if (*precond_id == 4) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - HYPRE_ParCSRParaSailsSolve, - HYPRE_ParCSRParaSailsSetup, - (HYPRE_Solver) *precond_solver )); + (HYPRE_ParCSRHybridSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_ParCSRParaSailsSolve, + HYPRE_ParCSRParaSailsSetup, + (HYPRE_Solver) * precond_solver )); } else if (*precond_id == 5) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - HYPRE_EuclidSolve, - HYPRE_EuclidSetup, - (HYPRE_Solver) *precond_solver )); + (HYPRE_ParCSRHybridSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_EuclidSolve, + HYPRE_EuclidSetup, + (HYPRE_Solver) * precond_solver )); + } + else if (*precond_id == 6) + { + *ierr = (hypre_F90_Int) + ( HYPRE_ParCSRHybridSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_ILUSolve, + HYPRE_ILUSetup, + (HYPRE_Solver) * precond_solver ) ); + } + else if (*precond_id == 7) + { + *ierr = (hypre_F90_Int) + ( HYPRE_ParCSRHybridSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_MGRSolve, + HYPRE_MGRSetup, + (HYPRE_Solver) * precond_solver ) ); } else { *ierr = -1; - } + } } /*-------------------------------------------------------------------------- @@ -310,14 +332,14 @@ hypre_F90_IFACE(hypre_parcsrhybridsetprecond, HYPRE_PARCSRHYBRIDSETPRECOND) void hypre_F90_IFACE(hypre_parcsrhybridsetlogging, HYPRE_PARCSRHYBRIDSETLOGGING) - (hypre_F90_Obj *solver, - hypre_F90_Int *logging, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *logging, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetLogging( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (logging) ) ); + (HYPRE_ParCSRHybridSetLogging( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (logging) ) ); } /*-------------------------------------------------------------------------- @@ -326,14 +348,14 @@ hypre_F90_IFACE(hypre_parcsrhybridsetlogging, HYPRE_PARCSRHYBRIDSETLOGGING) void hypre_F90_IFACE(hypre_parcsrhybridsetprintlevel, HYPRE_PARCSRHYBRIDSETPRINTLEVEL) - (hypre_F90_Obj *solver, - hypre_F90_Int *print_level, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *print_level, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetPrintLevel( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (print_level) )); + (HYPRE_ParCSRHybridSetPrintLevel( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (print_level) )); } /*-------------------------------------------------------------------------- @@ -342,14 +364,14 @@ hypre_F90_IFACE(hypre_parcsrhybridsetprintlevel, HYPRE_PARCSRHYBRIDSETPRINTLEVEL void hypre_F90_IFACE(hypre_parcsrhybridsetstrongthre, HYPRE_PARCSRHYBRIDSETSTRONGTHRE) - (hypre_F90_Obj *solver, - hypre_F90_Real *strong_threshold, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Real *strong_threshold, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetStrongThreshold( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (strong_threshold) )); + (HYPRE_ParCSRHybridSetStrongThreshold( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (strong_threshold) )); } /*-------------------------------------------------------------------------- @@ -358,14 +380,14 @@ hypre_F90_IFACE(hypre_parcsrhybridsetstrongthre, HYPRE_PARCSRHYBRIDSETSTRONGTHRE void hypre_F90_IFACE(hypre_parcsrhybridsetmaxrowsum, HYPRE_PARCSRHYBRIDSETMAXROWSUM) - (hypre_F90_Obj *solver, - hypre_F90_Real *max_row_sum, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Real *max_row_sum, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetMaxRowSum( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (max_row_sum) )); + (HYPRE_ParCSRHybridSetMaxRowSum( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (max_row_sum) )); } /*-------------------------------------------------------------------------- @@ -374,14 +396,14 @@ hypre_F90_IFACE(hypre_parcsrhybridsetmaxrowsum, HYPRE_PARCSRHYBRIDSETMAXROWSUM) void hypre_F90_IFACE(hypre_parcsrhybridsettruncfacto, HYPRE_PARCSRHYBRIDSETTRUNCFACTO) - (hypre_F90_Obj *solver, - hypre_F90_Real *trunc_factor, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Real *trunc_factor, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetTruncFactor( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (trunc_factor) )); + (HYPRE_ParCSRHybridSetTruncFactor( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (trunc_factor) )); } /*-------------------------------------------------------------------------- @@ -390,14 +412,14 @@ hypre_F90_IFACE(hypre_parcsrhybridsettruncfacto, HYPRE_PARCSRHYBRIDSETTRUNCFACTO void hypre_F90_IFACE(hypre_parcsrhybridsetpmaxelmts, HYPRE_PARCSRHYBRIDSETPMAXELMTS) - (hypre_F90_Obj *solver, - hypre_F90_Int *p_max_elmts, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *p_max_elmts, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetPMaxElmts( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (p_max_elmts) )); + (HYPRE_ParCSRHybridSetPMaxElmts( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (p_max_elmts) )); } /*-------------------------------------------------------------------------- @@ -406,14 +428,14 @@ hypre_F90_IFACE(hypre_parcsrhybridsetpmaxelmts, HYPRE_PARCSRHYBRIDSETPMAXELMTS) void hypre_F90_IFACE(hypre_parcsrhybridsetmaxlevels, HYPRE_PARCSRHYBRIDSETMAXLEVELS) - (hypre_F90_Obj *solver, - hypre_F90_Int *max_levels, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *max_levels, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetMaxLevels( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (max_levels) )); + (HYPRE_ParCSRHybridSetMaxLevels( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (max_levels) )); } /*-------------------------------------------------------------------------- @@ -422,14 +444,14 @@ hypre_F90_IFACE(hypre_parcsrhybridsetmaxlevels, HYPRE_PARCSRHYBRIDSETMAXLEVELS) void hypre_F90_IFACE(hypre_parcsrhybridsetmeasuretyp, HYPRE_PARCSRHYBRIDSETMEASURETYP) - (hypre_F90_Obj *solver, - hypre_F90_Int *measure_type, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *measure_type, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetMeasureType( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (measure_type) )); + (HYPRE_ParCSRHybridSetMeasureType( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (measure_type) )); } /*-------------------------------------------------------------------------- @@ -438,14 +460,14 @@ hypre_F90_IFACE(hypre_parcsrhybridsetmeasuretyp, HYPRE_PARCSRHYBRIDSETMEASURETYP void hypre_F90_IFACE(hypre_parcsrhybridsetcoarsentyp, HYPRE_PARCSRHYBRIDSETCOARSENTYP) - (hypre_F90_Obj *solver, - hypre_F90_Int *coarsen_type, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *coarsen_type, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetCoarsenType( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (coarsen_type) )); + (HYPRE_ParCSRHybridSetCoarsenType( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (coarsen_type) )); } /*-------------------------------------------------------------------------- @@ -454,14 +476,14 @@ hypre_F90_IFACE(hypre_parcsrhybridsetcoarsentyp, HYPRE_PARCSRHYBRIDSETCOARSENTYP void hypre_F90_IFACE(hypre_parcsrhybridsetinterptyp, HYPRE_PARCSRHYBRIDSETINTERPTYP) - (hypre_F90_Obj *solver, - hypre_F90_Int *interp_type, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *interp_type, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetCoarsenType( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (interp_type) )); + (HYPRE_ParCSRHybridSetCoarsenType( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (interp_type) )); } /*-------------------------------------------------------------------------- @@ -470,14 +492,14 @@ hypre_F90_IFACE(hypre_parcsrhybridsetinterptyp, HYPRE_PARCSRHYBRIDSETINTERPTYP) void hypre_F90_IFACE(hypre_parcsrhybridsetcycletype, HYPRE_PARCSRHYBRIDSETCYCLETYPE) - (hypre_F90_Obj *solver, - hypre_F90_Int *cycle_type, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *cycle_type, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetCycleType( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (cycle_type) )); + (HYPRE_ParCSRHybridSetCycleType( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (cycle_type) )); } /*-------------------------------------------------------------------------- @@ -486,14 +508,14 @@ hypre_F90_IFACE(hypre_parcsrhybridsetcycletype, HYPRE_PARCSRHYBRIDSETCYCLETYPE) void hypre_F90_IFACE(hypre_parcsrhybridsetnumgridswe, HYPRE_PARCSRHYBRIDSETNUMGRIDSWE) - (hypre_F90_Obj *solver, - hypre_F90_IntArray *num_grid_sweeps, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_IntArray *num_grid_sweeps, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetNumGridSweeps( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntArray (num_grid_sweeps) )); + (HYPRE_ParCSRHybridSetNumGridSweeps( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntArray (num_grid_sweeps) )); } /*------------------------------------------------------------------------ @@ -502,14 +524,14 @@ hypre_F90_IFACE(hypre_parcsrhybridsetnumgridswe, HYPRE_PARCSRHYBRIDSETNUMGRIDSWE void hypre_F90_IFACE(hypre_parcsrhybridsetgridrelaxt, HYPRE_PARCSRHYBRIDSETGRIDRELAXT) - (hypre_F90_Obj *solver, - hypre_F90_IntArray *grid_relax_type, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_IntArray *grid_relax_type, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetGridRelaxType( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntArray (grid_relax_type) )); + (HYPRE_ParCSRHybridSetGridRelaxType( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntArray (grid_relax_type) )); } /*-------------------------------------------------------------------------- @@ -518,14 +540,14 @@ hypre_F90_IFACE(hypre_parcsrhybridsetgridrelaxt, HYPRE_PARCSRHYBRIDSETGRIDRELAXT void hypre_F90_IFACE(hypre_parcsrhybridsetgridrelaxp, HYPRE_PARCSRHYBRIDSETGRIDRELAXP) - (hypre_F90_Obj *solver, - hypre_F90_Int *grid_relax_points, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *grid_relax_points, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetGridRelaxPoints( - hypre_F90_PassObj (HYPRE_Solver, solver), - (HYPRE_Int **) grid_relax_points )); + (HYPRE_ParCSRHybridSetGridRelaxPoints( + hypre_F90_PassObj (HYPRE_Solver, solver), + (HYPRE_Int **) grid_relax_points )); } /*-------------------------------------------------------------------------- @@ -534,14 +556,14 @@ hypre_F90_IFACE(hypre_parcsrhybridsetgridrelaxp, HYPRE_PARCSRHYBRIDSETGRIDRELAXP void hypre_F90_IFACE(hypre_parcsrhybridsetnumsweeps, HYPRE_PARCSRHYBRIDSETNUMSWEEPS) - (hypre_F90_Obj *solver, - hypre_F90_Int *num_sweeps, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *num_sweeps, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetNumSweeps( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (num_sweeps) )); + (HYPRE_ParCSRHybridSetNumSweeps( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (num_sweeps) )); } /*-------------------------------------------------------------------------- @@ -550,16 +572,16 @@ hypre_F90_IFACE(hypre_parcsrhybridsetnumsweeps, HYPRE_PARCSRHYBRIDSETNUMSWEEPS) void hypre_F90_IFACE(hypre_parcsrhybridsetcyclenumsw, HYPRE_PARCSRHYBRIDSETCYCLENUMSW) - (hypre_F90_Obj *solver, - hypre_F90_Int *num_sweeps, - hypre_F90_Int *k, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *num_sweeps, + hypre_F90_Int *k, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetCycleNumSweeps( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (num_sweeps), - hypre_F90_PassInt (k) )); + (HYPRE_ParCSRHybridSetCycleNumSweeps( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (num_sweeps), + hypre_F90_PassInt (k) )); } /*-------------------------------------------------------------------------- @@ -568,14 +590,14 @@ hypre_F90_IFACE(hypre_parcsrhybridsetcyclenumsw, HYPRE_PARCSRHYBRIDSETCYCLENUMSW void hypre_F90_IFACE(hypre_parcsrhybridsetrelaxtype, HYPRE_PARCSRHYBRIDSETRELAXTYPE) - (hypre_F90_Obj *solver, - hypre_F90_Int *relax_type, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *relax_type, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetRelaxType( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (relax_type) )); + (HYPRE_ParCSRHybridSetRelaxType( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (relax_type) )); } /*-------------------------------------------------------------------------- @@ -584,16 +606,16 @@ hypre_F90_IFACE(hypre_parcsrhybridsetrelaxtype, HYPRE_PARCSRHYBRIDSETRELAXTYPE) void hypre_F90_IFACE(hypre_parcsrhybridsetcyclerelax, HYPRE_PARCSRHYBRIDSETCYCLERELAX) - (hypre_F90_Obj *solver, - hypre_F90_Int *relax_type, - hypre_F90_Int *k, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *relax_type, + hypre_F90_Int *k, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetCycleRelaxType( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (relax_type), - hypre_F90_PassInt (k) )); + (HYPRE_ParCSRHybridSetCycleRelaxType( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (relax_type), + hypre_F90_PassInt (k) )); } /*-------------------------------------------------------------------------- @@ -602,14 +624,14 @@ hypre_F90_IFACE(hypre_parcsrhybridsetcyclerelax, HYPRE_PARCSRHYBRIDSETCYCLERELAX void hypre_F90_IFACE(hypre_parcsrhybridsetaggnumlev, HYPRE_PARCSRHYBRIDSETAGGNUMLEV) - (hypre_F90_Obj *solver, - hypre_F90_Int *agg_nl, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *agg_nl, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetAggNumLevels( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (agg_nl) )); + (HYPRE_ParCSRHybridSetAggNumLevels( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (agg_nl) )); } /*-------------------------------------------------------------------------- @@ -618,14 +640,14 @@ hypre_F90_IFACE(hypre_parcsrhybridsetaggnumlev, HYPRE_PARCSRHYBRIDSETAGGNUMLEV) void hypre_F90_IFACE(hypre_parcsrhybridsetnumpaths, HYPRE_PARCSRHYBRIDSETNUMPATHS) - (hypre_F90_Obj *solver, - hypre_F90_Int *num_paths, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *num_paths, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetNumPaths( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (num_paths) )); + (HYPRE_ParCSRHybridSetNumPaths( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (num_paths) )); } /*-------------------------------------------------------------------------- @@ -634,14 +656,14 @@ hypre_F90_IFACE(hypre_parcsrhybridsetnumpaths, HYPRE_PARCSRHYBRIDSETNUMPATHS) void hypre_F90_IFACE(hypre_parcsrhybridsetnumfunc, HYPRE_PARCSRHYBRIDSETNUMFUNC) - (hypre_F90_Obj *solver, - hypre_F90_Int *num_fun, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *num_fun, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetNumFunctions( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (num_fun) )); + (HYPRE_ParCSRHybridSetNumFunctions( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (num_fun) )); } /*-------------------------------------------------------------------------- @@ -650,14 +672,14 @@ hypre_F90_IFACE(hypre_parcsrhybridsetnumfunc, HYPRE_PARCSRHYBRIDSETNUMFUNC) void hypre_F90_IFACE(hypre_parcsrhybridsetnodal, HYPRE_PARCSRHYBRIDSETNODAL) - (hypre_F90_Obj *solver, - hypre_F90_Int *nodal, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *nodal, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetNodal( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (nodal) )); + (HYPRE_ParCSRHybridSetNodal( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (nodal) )); } /*-------------------------------------------------------------------------- @@ -666,14 +688,14 @@ hypre_F90_IFACE(hypre_parcsrhybridsetnodal, HYPRE_PARCSRHYBRIDSETNODAL) void hypre_F90_IFACE(hypre_parcsrhybridsetkeeptrans, HYPRE_PARCSRHYBRIDSETKEEPTRANS) - (hypre_F90_Obj *solver, - hypre_F90_Int *keepT, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *keepT, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetKeepTranspose( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (keepT) )); + (HYPRE_ParCSRHybridSetKeepTranspose( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (keepT) )); } /*-------------------------------------------------------------------------- @@ -682,14 +704,14 @@ hypre_F90_IFACE(hypre_parcsrhybridsetkeeptrans, HYPRE_PARCSRHYBRIDSETKEEPTRANS) void hypre_F90_IFACE(hypre_parcsrhybridsetdoffunc, HYPRE_PARCSRHYBRIDSETDOFFUNC) - (hypre_F90_Obj *solver, - hypre_F90_IntArray *dof_func, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_IntArray *dof_func, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetDofFunc( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntArray (dof_func) )); + (HYPRE_ParCSRHybridSetDofFunc( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntArray (dof_func) )); } /*-------------------------------------------------------------------------- @@ -698,16 +720,16 @@ hypre_F90_IFACE(hypre_parcsrhybridsetdoffunc, HYPRE_PARCSRHYBRIDSETDOFFUNC) void hypre_F90_IFACE(hypre_parcsrhybridsetnongaltol, HYPRE_PARCSRHYBRIDSETNONGALTOL) - (hypre_F90_Obj *solver, - hypre_F90_Int *ng_num_tol, - hypre_F90_RealArray *nongal_tol, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *ng_num_tol, + hypre_F90_RealArray *nongal_tol, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetNonGalerkinTol( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (ng_num_tol), - hypre_F90_PassRealArray (nongal_tol) )); + (HYPRE_ParCSRHybridSetNonGalerkinTol( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (ng_num_tol), + hypre_F90_PassRealArray (nongal_tol) )); } /*-------------------------------------------------------------------------- @@ -716,14 +738,14 @@ hypre_F90_IFACE(hypre_parcsrhybridsetnongaltol, HYPRE_PARCSRHYBRIDSETNONGALTOL) void hypre_F90_IFACE(hypre_parcsrhybridsetrelaxorder, HYPRE_PARCSRHYBRIDSETRELAXORDER) - (hypre_F90_Obj *solver, - hypre_F90_Int *relax_order, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *relax_order, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetRelaxOrder( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (relax_order) )); + (HYPRE_ParCSRHybridSetRelaxOrder( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (relax_order) )); } /*-------------------------------------------------------------------------- @@ -732,14 +754,14 @@ hypre_F90_IFACE(hypre_parcsrhybridsetrelaxorder, HYPRE_PARCSRHYBRIDSETRELAXORDER void hypre_F90_IFACE(hypre_parcsrhybridsetrelaxwt, HYPRE_PARCSRHYBRIDSETRELAXWT) - (hypre_F90_Obj *solver, - hypre_F90_Real *relax_wt, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Real *relax_wt, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetRelaxWt( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (relax_wt) )); + (HYPRE_ParCSRHybridSetRelaxWt( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (relax_wt) )); } /*-------------------------------------------------------------------------- @@ -748,16 +770,16 @@ hypre_F90_IFACE(hypre_parcsrhybridsetrelaxwt, HYPRE_PARCSRHYBRIDSETRELAXWT) void hypre_F90_IFACE(hypre_parcsrhybridsetlevelrelax, HYPRE_PARCSRHYBRIDSETLEVELRELAX) - (hypre_F90_Obj *solver, - hypre_F90_Real *relax_wt, - hypre_F90_Int *level, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Real *relax_wt, + hypre_F90_Int *level, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetLevelRelaxWt( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (relax_wt), - hypre_F90_PassInt (level) )); + (HYPRE_ParCSRHybridSetLevelRelaxWt( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (relax_wt), + hypre_F90_PassInt (level) )); } /*-------------------------------------------------------------------------- @@ -766,14 +788,14 @@ hypre_F90_IFACE(hypre_parcsrhybridsetlevelrelax, HYPRE_PARCSRHYBRIDSETLEVELRELAX void hypre_F90_IFACE(hypre_parcsrhybridsetouterwt, HYPRE_PARCSRHYBRIDSETOUTERWT) - (hypre_F90_Obj *solver, - hypre_F90_Real *outer_wt, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Real *outer_wt, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetOuterWt( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (outer_wt) )); + (HYPRE_ParCSRHybridSetOuterWt( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (outer_wt) )); } /*-------------------------------------------------------------------------- @@ -782,16 +804,16 @@ hypre_F90_IFACE(hypre_parcsrhybridsetouterwt, HYPRE_PARCSRHYBRIDSETOUTERWT) void hypre_F90_IFACE(hypre_parcsrhybridsetlevelouter, HYPRE_PARCSRHYBRIDSETLEVELOUTER) - (hypre_F90_Obj *solver, - hypre_F90_Real *outer_wt, - hypre_F90_Int *level, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Real *outer_wt, + hypre_F90_Int *level, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetLevelOuterWt( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (outer_wt), - hypre_F90_PassInt (level) )); + (HYPRE_ParCSRHybridSetLevelOuterWt( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (outer_wt), + hypre_F90_PassInt (level) )); } /*-------------------------------------------------------------------------- @@ -800,14 +822,14 @@ hypre_F90_IFACE(hypre_parcsrhybridsetlevelouter, HYPRE_PARCSRHYBRIDSETLEVELOUTER void hypre_F90_IFACE(hypre_parcsrhybridsetrelaxweigh, HYPRE_PARCSRHYBRIDSETRELAXWEIGH) - (hypre_F90_Obj *solver, - hypre_F90_RealArray *relax_weight, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_RealArray *relax_weight, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetRelaxWeight( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassRealArray (relax_weight) )); + (HYPRE_ParCSRHybridSetRelaxWeight( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassRealArray (relax_weight) )); } /*-------------------------------------------------------------------------- @@ -816,14 +838,14 @@ hypre_F90_IFACE(hypre_parcsrhybridsetrelaxweigh, HYPRE_PARCSRHYBRIDSETRELAXWEIGH void hypre_F90_IFACE(hypre_parcsrhybridsetomega, HYPRE_PARCSRHYBRIDSETOMEGA) - (hypre_F90_Obj *solver, - hypre_F90_RealArray *omega, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_RealArray *omega, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridSetOmega( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassRealArray (omega) )); + (HYPRE_ParCSRHybridSetOmega( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassRealArray (omega) )); } /*-------------------------------------------------------------------------- @@ -832,14 +854,14 @@ hypre_F90_IFACE(hypre_parcsrhybridsetomega, HYPRE_PARCSRHYBRIDSETOMEGA) void hypre_F90_IFACE(hypre_parcsrhybridgetnumiterati, HYPRE_PARCSRHYBRIDGETNUMITERATI) - (hypre_F90_Obj *solver, - hypre_F90_Int *num_its, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *num_its, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridGetNumIterations( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntRef (num_its) )); + (HYPRE_ParCSRHybridGetNumIterations( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntRef (num_its) )); } /*-------------------------------------------------------------------------- @@ -848,14 +870,14 @@ hypre_F90_IFACE(hypre_parcsrhybridgetnumiterati, HYPRE_PARCSRHYBRIDGETNUMITERATI void hypre_F90_IFACE(hypre_parcsrhybridgetdscgnumite, HYPRE_PARCSRHYBRIDGETDSCGNUMITE) - (hypre_F90_Obj *solver, - hypre_F90_Int *dscg_num_its, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *dscg_num_its, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridGetDSCGNumIterations( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntRef (dscg_num_its) )); + (HYPRE_ParCSRHybridGetDSCGNumIterations( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntRef (dscg_num_its) )); } /*-------------------------------------------------------------------------- @@ -864,14 +886,14 @@ hypre_F90_IFACE(hypre_parcsrhybridgetdscgnumite, HYPRE_PARCSRHYBRIDGETDSCGNUMITE void hypre_F90_IFACE(hypre_parcsrhybridgetpcgnumiter, HYPRE_PARCSRHYBRIDGETPCGNUMITER) - (hypre_F90_Obj *solver, - hypre_F90_Int *pcg_num_its, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *pcg_num_its, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridGetPCGNumIterations( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntRef (pcg_num_its) )); + (HYPRE_ParCSRHybridGetPCGNumIterations( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntRef (pcg_num_its) )); } /*-------------------------------------------------------------------------- @@ -880,16 +902,16 @@ hypre_F90_IFACE(hypre_parcsrhybridgetpcgnumiter, HYPRE_PARCSRHYBRIDGETPCGNUMITER void hypre_F90_IFACE(hypre_parcsrhybridgetfinalrelat, HYPRE_PARCSRHYBRIDGETFINALRELAT) - (hypre_F90_Obj *solver, - hypre_F90_Real *norm, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Real *norm, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_ParCSRHybridGetFinalRelativeResidualNorm( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassRealRef (norm) )); + (HYPRE_ParCSRHybridGetFinalRelativeResidualNorm( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassRealRef (norm) )); } - + #ifdef __cplusplus } #endif diff --git a/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_ilu.c b/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_ilu.c new file mode 100644 index 00000000..381d513e --- /dev/null +++ b/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_ilu.c @@ -0,0 +1,316 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +/****************************************************************************** + * + * HYPRE_ILU Fortran interface + * + *****************************************************************************/ + +#include "_hypre_parcsr_ls.h" +#include "fortran.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*-------------------------------------------------------------------------- + * HYPRE_ILUCreate + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_ilucreate, HYPRE_ILUCREATE) +( hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_ILUCreate( + hypre_F90_PassObjRef (HYPRE_Solver, solver) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_ILUDestroy + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_iludestroy, HYPRE_ILUDESTROY) +( hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_ILUDestroy( + hypre_F90_PassObj (HYPRE_Solver, solver) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_ILUSetup + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_ilusetup, HYPRE_ILUSETUP) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_ILUSetup( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), + hypre_F90_PassObj (HYPRE_ParVector, b), + hypre_F90_PassObj (HYPRE_ParVector, x) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_ILUSolve + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_ilusolve, HYPRE_ILUSOLVE) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_ILUSolve( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), + hypre_F90_PassObj (HYPRE_ParVector, b), + hypre_F90_PassObj (HYPRE_ParVector, x) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_ILUSetPrintLevel + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_ilusetprintlevel, HYPRE_ILUSETPRINTLEVEL) +( hypre_F90_Obj *solver, + hypre_F90_Int *print_level, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_ILUSetPrintLevel( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (print_level) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_ILUSetLogging + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_ilusetlogging, HYPRE_ILUSETLOGGING) +( hypre_F90_Obj *solver, + hypre_F90_Int *logging, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_ILUSetLogging( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (logging) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_ILUSetMaxIter + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_ilusetmaxiter, HYPRE_ILUSETMAXITER) +( hypre_F90_Obj *solver, + hypre_F90_Int *max_iter, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_ILUSetMaxIter( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (max_iter) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_ILUSetTol + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_ilusettol, HYPRE_ILUSETTOL) +( hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_ILUSetTol( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (tol) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_ILUSetDropThreshold + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_ilusetdropthreshold, HYPRE_ILUSETDROPTHRESHOLD) +( hypre_F90_Obj *solver, + hypre_F90_Real *threshold, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_ILUSetDropThreshold( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (threshold) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_ILUSetDropThresholdArray + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_ilusetdropthresholdarray, HYPRE_ILUSETDROPTHRESHOLDARRAY) +( hypre_F90_Obj *solver, + hypre_F90_RealArray *threshold, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_ILUSetDropThresholdArray( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassRealArray (threshold) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_ILUSetNSHDropThreshold + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_ilusetnshdropthreshold, HYPRE_ILUSETNSHDROPTHRESHOLD) +( hypre_F90_Obj *solver, + hypre_F90_Real *threshold, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_ILUSetNSHDropThreshold( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (threshold) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_ILUSetSchurMaxIter + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_ilusetschurmaxiter, HYPRE_ILUSETSCHURMAXITER) +( hypre_F90_Obj *solver, + hypre_F90_Int *ss_max_iter, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_ILUSetMaxIter( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (ss_max_iter) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_ILUSetMaxNnzPerRow + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_ilusetmaxnnzperrow, HYPRE_ILUSETMAXNNZPERROW) +( hypre_F90_Obj *solver, + hypre_F90_Int *nzmax, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_ILUSetMaxNnzPerRow( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (nzmax) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_ILUSetLevelOfFill + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_ilusetleveloffill, HYPRE_ILUSETLEVELOFFILL) +( hypre_F90_Obj *solver, + hypre_F90_Int *lfil, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_ILUSetMaxNnzPerRow( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (lfil) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_ILUSetType + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_ilusettype, HYPRE_ILUSETTYPE) +( hypre_F90_Obj *solver, + hypre_F90_Int *ilu_type, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_ILUSetType( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (ilu_type) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_ILUSetLocalReordering + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_ilusetlocalreordering, HYPRE_ILUSETLOCALREORDERING) +( hypre_F90_Obj *solver, + hypre_F90_Int *ordering_type, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_ILUSetType( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (ordering_type) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_ILUGetNumIterations + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_ilugetnumiterations, HYPRE_ILUGETNUMITERATIONS) +( hypre_F90_Obj *solver, + hypre_F90_Int *num_iterations, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_ILUGetNumIterations( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntRef (num_iterations) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_ILUGetFinalRelResNorm + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_ilugetfinalrelresnorm, HYPRE_ILUGETFINALRELRESNORM) +( hypre_F90_Obj *solver, + hypre_F90_Real *res_norm, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_ILUGetFinalRelativeResidualNorm( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassRealRef (res_norm) ) ); +} + + +#ifdef __cplusplus +} +#endif diff --git a/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_int.c b/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_int.c index b5e510d6..ca76ca2f 100644 --- a/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_int.c +++ b/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_int.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,7 +17,7 @@ #ifdef __cplusplus extern "C" { #endif - + HYPRE_Int hypre_ParVectorSize( void *x ); HYPRE_Int aux_maskCount( HYPRE_Int n, hypre_F90_Int *mask ); void aux_indexFromMask( HYPRE_Int n, hypre_F90_Int *mask, hypre_F90_Int *index ); @@ -28,14 +28,14 @@ void aux_indexFromMask( HYPRE_Int n, hypre_F90_Int *mask, hypre_F90_Int *index ) void hypre_F90_IFACE(hypre_parsetrandomvalues, HYPRE_PARSETRANDOMVALUES) - (hypre_F90_Obj *v, - hypre_F90_Int *seed, - hypre_F90_Int *ierr) +(hypre_F90_Obj *v, + hypre_F90_Int *seed, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_ParVectorSetRandomValues( - hypre_F90_PassObj (HYPRE_ParVector, v), - hypre_F90_PassInt (seed))); + ( HYPRE_ParVectorSetRandomValues( + hypre_F90_PassObj (HYPRE_ParVector, v), + hypre_F90_PassInt (seed))); } /*-------------------------------------------------------------------------- @@ -44,14 +44,14 @@ hypre_F90_IFACE(hypre_parsetrandomvalues, HYPRE_PARSETRANDOMVALUES) void hypre_F90_IFACE(hypre_parprintvector, HYPRE_PARPRINTVECTOR) - (hypre_F90_Obj *v, - char *file, - hypre_F90_Int *ierr) +(hypre_F90_Obj *v, + char *file, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( hypre_ParVectorPrint( - (hypre_ParVector *) v, - (char *) file)); + ( hypre_ParVectorPrint( + (hypre_ParVector *) v, + (char *) file)); } /*-------------------------------------------------------------------------- @@ -60,15 +60,15 @@ hypre_F90_IFACE(hypre_parprintvector, HYPRE_PARPRINTVECTOR) void hypre_F90_IFACE(hypre_parreadvector, HYPRE_PARREADVECTOR) - (hypre_F90_Comm *comm, - char *file, - hypre_F90_Int *ierr) +(hypre_F90_Comm *comm, + char *file, + hypre_F90_Int *ierr) { *ierr = 0; hypre_ParReadVector( - hypre_F90_PassComm (comm), - (char *) file ); + hypre_F90_PassComm (comm), + (char *) file ); } /*-------------------------------------------------------------------------- @@ -77,12 +77,12 @@ hypre_F90_IFACE(hypre_parreadvector, HYPRE_PARREADVECTOR) void hypre_F90_IFACE(hypre_parvectorsize, HYPRE_PARVECTORSIZE) - (hypre_F90_Obj *x, - hypre_F90_Int *ierr) +(hypre_F90_Obj *x, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( hypre_ParVectorSize( - (void *) x) ); + ( hypre_ParVectorSize( + (void *) x) ); } /*-------------------------------------------------------------------------- @@ -91,14 +91,14 @@ hypre_F90_IFACE(hypre_parvectorsize, HYPRE_PARVECTORSIZE) void hypre_F90_IFACE(hypre_parcsrmultivectorprint, HYPRE_PARCSRMULTIVECTORPRINT) - (hypre_F90_Obj *x, - char *file, - hypre_F90_Int *ierr) +(hypre_F90_Obj *x, + char *file, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRMultiVectorPrint( - (void *) x, - (char *) file)); + ( HYPRE_ParCSRMultiVectorPrint( + (void *) x, + (char *) file)); } /*-------------------------------------------------------------------------- @@ -107,10 +107,10 @@ hypre_F90_IFACE(hypre_parcsrmultivectorprint, HYPRE_PARCSRMULTIVECTORPRINT) void hypre_F90_IFACE(hypre_parcsrmultivectorread, HYPRE_PARCSRMULTIVECTORREAD) - (hypre_F90_Comm *comm, - hypre_F90_Obj *ii, - char *file, - hypre_F90_Int *ierr) +(hypre_F90_Comm *comm, + hypre_F90_Obj *ii, + char *file, + hypre_F90_Int *ierr) { *ierr = 0; @@ -126,12 +126,12 @@ hypre_F90_IFACE(hypre_parcsrmultivectorread, HYPRE_PARCSRMULTIVECTORREAD) void hypre_F90_IFACE(hypre_tempparcsrsetupinterprete, HYPRE_TEMPPARCSRSETUPINTERPRETE) - (hypre_F90_Obj *i, - hypre_F90_Int *ierr) +(hypre_F90_Obj *i, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_TempParCSRSetupInterpreter( - (mv_InterfaceInterpreter *) i )); + ( HYPRE_TempParCSRSetupInterpreter( + (mv_InterfaceInterpreter *) i )); } /*-------------------------------------------------------------------------- @@ -140,12 +140,12 @@ hypre_F90_IFACE(hypre_tempparcsrsetupinterprete, HYPRE_TEMPPARCSRSETUPINTERPRETE void hypre_F90_IFACE(hypre_parcsrsetupinterpreter, HYPRE_PARCSRSETUPINTERPRETER) - (hypre_F90_Obj *i, - hypre_F90_Int *ierr) +(hypre_F90_Obj *i, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRSetupInterpreter( - (mv_InterfaceInterpreter *) i )); + ( HYPRE_ParCSRSetupInterpreter( + (mv_InterfaceInterpreter *) i )); } /*-------------------------------------------------------------------------- @@ -154,12 +154,12 @@ hypre_F90_IFACE(hypre_parcsrsetupinterpreter, HYPRE_PARCSRSETUPINTERPRETER) void hypre_F90_IFACE(hypre_parcsrsetupmatvec, HYPRE_PARCSRSETUPMATVEC) - (hypre_F90_Obj *mv, - hypre_F90_Int *ierr) +(hypre_F90_Obj *mv, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRSetupMatvec( - hypre_F90_PassObjRef (HYPRE_MatvecFunctions, mv))); + ( HYPRE_ParCSRSetupMatvec( + hypre_F90_PassObjRef (HYPRE_MatvecFunctions, mv))); } #ifdef __cplusplus } diff --git a/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_lgmres.c b/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_lgmres.c index 661bcaf0..18f4488c 100644 --- a/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_lgmres.c +++ b/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_lgmres.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,75 +17,75 @@ #ifdef __cplusplus extern "C" { #endif - + /*-------------------------------------------------------------------------- * HYPRE_ParCSRLGMRESCreate *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_parcsrlgmrescreate, HYPRE_PARCSRLGMRESCREATE) - ( hypre_F90_Comm *comm, - hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Comm *comm, + hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRLGMRESCreate( - hypre_F90_PassComm (comm), - hypre_F90_PassObjRef (HYPRE_Solver, solver) ) ); + ( HYPRE_ParCSRLGMRESCreate( + hypre_F90_PassComm (comm), + hypre_F90_PassObjRef (HYPRE_Solver, solver) ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRLGMRESDestroy *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_parcsrlgmresdestroy, HYPRE_PARCSRLGMRESDESTROY) - ( hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRLGMRESDestroy( - hypre_F90_PassObj (HYPRE_Solver, solver) ) ); + ( HYPRE_ParCSRLGMRESDestroy( + hypre_F90_PassObj (HYPRE_Solver, solver) ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRLGMRESSetup *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_parcsrlgmressetup, HYPRE_PARCSRLGMRESSETUP) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRLGMRESSetup( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), - hypre_F90_PassObj (HYPRE_ParVector, b), - hypre_F90_PassObj (HYPRE_ParVector, x) ) ); + ( HYPRE_ParCSRLGMRESSetup( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), + hypre_F90_PassObj (HYPRE_ParVector, b), + hypre_F90_PassObj (HYPRE_ParVector, x) ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRLGMRESSolve *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_parcsrlgmressolve, HYPRE_PARCSRLGMRESSOLVE) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRLGMRESSolve( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), - hypre_F90_PassObj (HYPRE_ParVector, b), - hypre_F90_PassObj (HYPRE_ParVector, x) ) ); + ( HYPRE_ParCSRLGMRESSolve( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), + hypre_F90_PassObj (HYPRE_ParVector, b), + hypre_F90_PassObj (HYPRE_ParVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -94,14 +94,14 @@ hypre_F90_IFACE(hypre_parcsrlgmressolve, HYPRE_PARCSRLGMRESSOLVE) void hypre_F90_IFACE(hypre_parcsrlgmressetkdim, HYPRE_PARCSRLGMRESSETKDIM) - ( hypre_F90_Obj *solver, - hypre_F90_Int *kdim, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *kdim, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRLGMRESSetKDim( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (kdim) ) ); + ( HYPRE_ParCSRLGMRESSetKDim( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (kdim) ) ); } /*-------------------------------------------------------------------------- @@ -110,14 +110,14 @@ hypre_F90_IFACE(hypre_parcsrlgmressetkdim, HYPRE_PARCSRLGMRESSETKDIM) void hypre_F90_IFACE(hypre_parcsrlgmressettol, HYPRE_PARCSRLGMRESSETTOL) - ( hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRLGMRESSetTol( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (tol) ) ); + ( HYPRE_ParCSRLGMRESSetTol( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (tol) ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRLGMRESSetAbsoluteTol @@ -125,14 +125,14 @@ hypre_F90_IFACE(hypre_parcsrlgmressettol, HYPRE_PARCSRLGMRESSETTOL) void hypre_F90_IFACE(hypre_parcsrlgmressetabsolutetol, HYPRE_PARCSRLGMRESSETABSOLUTETOL) - ( hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRLGMRESSetAbsoluteTol( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (tol) ) ); + ( HYPRE_ParCSRLGMRESSetAbsoluteTol( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (tol) ) ); } /*-------------------------------------------------------------------------- @@ -141,14 +141,14 @@ hypre_F90_IFACE(hypre_parcsrlgmressetabsolutetol, HYPRE_PARCSRLGMRESSETABSOLUTET void hypre_F90_IFACE(hypre_parcsrlgmressetminiter, HYPRE_PARCSRLGMRESSETMINITER) - ( hypre_F90_Obj *solver, - hypre_F90_Int *min_iter, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *min_iter, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRLGMRESSetMinIter( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (min_iter) ) ); + ( HYPRE_ParCSRLGMRESSetMinIter( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (min_iter) ) ); } /*-------------------------------------------------------------------------- @@ -157,14 +157,14 @@ hypre_F90_IFACE(hypre_parcsrlgmressetminiter, HYPRE_PARCSRLGMRESSETMINITER) void hypre_F90_IFACE(hypre_parcsrlgmressetmaxiter, HYPRE_PARCSRLGMRESSETMAXITER) - ( hypre_F90_Obj *solver, - hypre_F90_Int *max_iter, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *max_iter, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRLGMRESSetMaxIter( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (max_iter) ) ); + ( HYPRE_ParCSRLGMRESSetMaxIter( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (max_iter) ) ); } @@ -174,10 +174,10 @@ hypre_F90_IFACE(hypre_parcsrlgmressetmaxiter, HYPRE_PARCSRLGMRESSETMAXITER) void hypre_F90_IFACE(hypre_parcsrlgmressetprecond, HYPRE_PARCSRLGMRESSETPRECOND) - ( hypre_F90_Obj *solver, - hypre_F90_Int *precond_id, - hypre_F90_Obj *precond_solver, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *precond_id, + hypre_F90_Obj *precond_solver, + hypre_F90_Int *ierr ) { /*------------------------------------------------------------ * The precond_id flags mean : @@ -186,6 +186,9 @@ hypre_F90_IFACE(hypre_parcsrlgmressetprecond, HYPRE_PARCSRLGMRESSETPRECOND) * 2 - set up an amg preconditioner * 3 - set up a pilut preconditioner * 4 - set up a parasails preconditioner + * 5 - set up a Euclid preconditioner + * 6 - set up a ILU preconditioner + * 7 - set up a MGR preconditioner *------------------------------------------------------------*/ if (*precond_id == 0) @@ -195,48 +198,66 @@ hypre_F90_IFACE(hypre_parcsrlgmressetprecond, HYPRE_PARCSRLGMRESSETPRECOND) else if (*precond_id == 1) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRLGMRESSetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - HYPRE_ParCSRDiagScale, - HYPRE_ParCSRDiagScaleSetup, - NULL ) ); + ( HYPRE_ParCSRLGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_ParCSRDiagScale, + HYPRE_ParCSRDiagScaleSetup, + NULL ) ); } else if (*precond_id == 2) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRLGMRESSetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - HYPRE_BoomerAMGSolve, - HYPRE_BoomerAMGSetup, - (HYPRE_Solver) *precond_solver ) ); + ( HYPRE_ParCSRLGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_BoomerAMGSolve, + HYPRE_BoomerAMGSetup, + (HYPRE_Solver) * precond_solver ) ); } else if (*precond_id == 3) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRLGMRESSetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - HYPRE_ParCSRPilutSolve, - HYPRE_ParCSRPilutSetup, - (HYPRE_Solver) *precond_solver ) ); + ( HYPRE_ParCSRLGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_ParCSRPilutSolve, + HYPRE_ParCSRPilutSetup, + (HYPRE_Solver) * precond_solver ) ); } else if (*precond_id == 4) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRLGMRESSetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - HYPRE_ParCSRParaSailsSolve, - HYPRE_ParCSRParaSailsSetup, - (HYPRE_Solver) *precond_solver ) ); + ( HYPRE_ParCSRLGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_ParCSRParaSailsSolve, + HYPRE_ParCSRParaSailsSetup, + (HYPRE_Solver) * precond_solver ) ); } else if (*precond_id == 5) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRLGMRESSetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - HYPRE_EuclidSolve, - HYPRE_EuclidSetup, - (HYPRE_Solver) *precond_solver ) ); + ( HYPRE_ParCSRLGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_EuclidSolve, + HYPRE_EuclidSetup, + (HYPRE_Solver) * precond_solver ) ); + } + else if (*precond_id == 6) + { + *ierr = (hypre_F90_Int) + ( HYPRE_ParCSRLGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_ILUSolve, + HYPRE_ILUSetup, + (HYPRE_Solver) * precond_solver ) ); + } + else if (*precond_id == 7) + { + *ierr = (hypre_F90_Int) + ( HYPRE_ParCSRLGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_MGRSolve, + HYPRE_MGRSetup, + (HYPRE_Solver) * precond_solver ) ); } else { @@ -250,14 +271,14 @@ hypre_F90_IFACE(hypre_parcsrlgmressetprecond, HYPRE_PARCSRLGMRESSETPRECOND) void hypre_F90_IFACE(hypre_parcsrlgmresgetprecond, HYPRE_PARCSRLGMRESGETPRECOND) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *precond_solver_ptr, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *precond_solver_ptr, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRLGMRESGetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObjRef (HYPRE_Solver, precond_solver_ptr) ) ); + ( HYPRE_ParCSRLGMRESGetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObjRef (HYPRE_Solver, precond_solver_ptr) ) ); } @@ -267,14 +288,14 @@ hypre_F90_IFACE(hypre_parcsrlgmresgetprecond, HYPRE_PARCSRLGMRESGETPRECOND) void hypre_F90_IFACE(hypre_parcsrlgmressetlogging, HYPRE_PARCSRLGMRESSETLOGGING) - ( hypre_F90_Obj *solver, - hypre_F90_Int *logging, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *logging, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRLGMRESSetLogging( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (logging) ) ); + ( HYPRE_ParCSRLGMRESSetLogging( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (logging) ) ); } /*-------------------------------------------------------------------------- @@ -283,14 +304,14 @@ hypre_F90_IFACE(hypre_parcsrlgmressetlogging, HYPRE_PARCSRLGMRESSETLOGGING) void hypre_F90_IFACE(hypre_parcsrlgmressetprintlevel, HYPRE_PARCSRLGMRESSETPRINTLEVEL) - ( hypre_F90_Obj *solver, - hypre_F90_Int *print_level, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *print_level, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRLGMRESSetPrintLevel( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (print_level) ) ); + ( HYPRE_ParCSRLGMRESSetPrintLevel( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (print_level) ) ); } /*-------------------------------------------------------------------------- @@ -299,14 +320,14 @@ hypre_F90_IFACE(hypre_parcsrlgmressetprintlevel, HYPRE_PARCSRLGMRESSETPRINTLEVEL void hypre_F90_IFACE(hypre_parcsrlgmresgetnumiteratio, HYPRE_PARCSRLGMRESGETNUMITERATIO) - ( hypre_F90_Obj *solver, - hypre_F90_Int *num_iterations, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *num_iterations, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRLGMRESGetNumIterations( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntRef (num_iterations) ) ); + ( HYPRE_ParCSRLGMRESGetNumIterations( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntRef (num_iterations) ) ); } /*-------------------------------------------------------------------------- @@ -315,16 +336,16 @@ hypre_F90_IFACE(hypre_parcsrlgmresgetnumiteratio, HYPRE_PARCSRLGMRESGETNUMITERAT void hypre_F90_IFACE(hypre_parcsrlgmresgetfinalrelati, HYPRE_PARCSRLGMRESGETFINALRELATI) - ( hypre_F90_Obj *solver, - hypre_F90_Real *norm, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *norm, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRLGMRESGetFinalRelativeResidualNorm( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassRealRef (norm) ) ); + ( HYPRE_ParCSRLGMRESGetFinalRelativeResidualNorm( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassRealRef (norm) ) ); } - + #ifdef __cplusplus } #endif diff --git a/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_mgr.c b/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_mgr.c new file mode 100644 index 00000000..b3c0dccc --- /dev/null +++ b/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_mgr.c @@ -0,0 +1,807 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +/****************************************************************************** + * + * HYPRE_MGR Fortran interface + * + *****************************************************************************/ + +#include "_hypre_parcsr_ls.h" +#include "fortran.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*-------------------------------------------------------------------------- + * HYPRE_MGRCreate + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_mgrcreate, HYPRE_MGRCREATE) +( hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_MGRCreate( + hypre_F90_PassObjRef (HYPRE_Solver, solver) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRDestroy + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_mgrdestroy, HYPRE_MGRDESTROY) +( hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_MGRDestroy( + hypre_F90_PassObj (HYPRE_Solver, solver) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetup + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_mgrsetup, HYPRE_MGRSETUP) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_MGRSetup( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), + hypre_F90_PassObj (HYPRE_ParVector, b), + hypre_F90_PassObj (HYPRE_ParVector, x) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRSolve + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_mgrsolve, HYPRE_MGRSOLVE) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_MGRSolve( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), + hypre_F90_PassObj (HYPRE_ParVector, b), + hypre_F90_PassObj (HYPRE_ParVector, x) ) ); +} + +#ifdef HYPRE_USING_DSUPERLU + +/*-------------------------------------------------------------------------- + * HYPRE_MGRDirectSolverCreate + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_mgrdirectsolvercreate, HYPRE_MGRDIRECTSOLVERCREATE) +( hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_MGRDirectSolverCreate( + hypre_F90_PassObjRef (HYPRE_Solver, solver) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRDirectSolverDestroy + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_mgrdirectsolverdestroy, HYPRE_MGRDIRECTSOLVERDESTROY) +( hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_MGRDirectSolverDestroy( + hypre_F90_PassObj (HYPRE_Solver, solver) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRDirectSolverSetup + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_mgrdirectsolversetup, HYPRE_MGRDIRECTSOLVERSETUP) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_MGRDirectSolverSetup( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), + hypre_F90_PassObj (HYPRE_ParVector, b), + hypre_F90_PassObj (HYPRE_ParVector, x) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRDirectSolverSolve + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_mgrdirectsolversolve, HYPRE_MGRDIRECTSOLVERSOLVE) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_MGRDirectSolverSolve( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), + hypre_F90_PassObj (HYPRE_ParVector, b), + hypre_F90_PassObj (HYPRE_ParVector, x) ) ); +} + +#endif + +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetCptsByCtgBlock + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_mgrsetcptsbyctgblock, HYPRE_MGRSETCPTSBYCTGBLOCK) +( hypre_F90_Obj *solver, + hypre_F90_Int *block_size, + hypre_F90_Int *max_num_levels, + hypre_F90_BigIntArray *idx_array, + hypre_F90_IntArray *block_num_coarse_points, + hypre_F90_IntArrayArray *block_coarse_indexes, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_MGRSetCpointsByContiguousBlock( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (block_size), + hypre_F90_PassInt (max_num_levels), + hypre_F90_PassBigIntArray (idx_array), + hypre_F90_PassIntArray (block_num_coarse_points), + hypre_F90_PassIntArrayArray (block_coarse_indexes) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetCpointsByBlock + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_mgrsetcpointsbyblock, HYPRE_MGRSETCPOINTSBYBLOCK) +( hypre_F90_Obj *solver, + hypre_F90_Int *block_size, + hypre_F90_Int *max_num_levels, + hypre_F90_IntArray *block_num_coarse_points, + hypre_F90_IntArrayArray *block_coarse_indexes, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_MGRSetCpointsByBlock( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (block_size), + hypre_F90_PassInt (max_num_levels), + hypre_F90_PassIntArray (block_num_coarse_points), + hypre_F90_PassIntArrayArray (block_coarse_indexes) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetCptsByMarkerArray + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_mgrsetcptsbymarkerarray, HYPRE_MGRSETCPTSBYMARKERARRAY) +( hypre_F90_Obj *solver, + hypre_F90_Int *block_size, + hypre_F90_Int *max_num_levels, + hypre_F90_IntArray *num_block_coarse_points, + hypre_F90_IntArrayArray *lvl_block_coarse_indexes, + hypre_F90_IntArray *point_marker_array, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_MGRSetCpointsByPointMarkerArray( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (block_size), + hypre_F90_PassInt (max_num_levels), + hypre_F90_PassIntArray (num_block_coarse_points), + hypre_F90_PassIntArrayArray (lvl_block_coarse_indexes), + hypre_F90_PassIntArray (point_marker_array) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetNonCptsToFpts + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_mgrsetnoncptstofpts, HYPRE_MGRSETNONCPTSTOFPTS) +( hypre_F90_Obj *solver, + hypre_F90_Int *nonCptToFptFlag, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_MGRSetNonCpointsToFpoints( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (nonCptToFptFlag) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetFSolver + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_mgrsetfsolver, HYPRE_MGRSETFSOLVER) +( hypre_F90_Obj *solver, + hypre_F90_Int *fsolver_id, + hypre_F90_Obj *fsolver, + hypre_F90_Int *ierr ) +{ + /*------------------------------------------------------------ + * The fsolver_id flag means: + * 0 - do not setup a F-solver. + * 1 - BoomerAMG. + *------------------------------------------------------------*/ + + if (*fsolver_id == 0) + { + *ierr = 0; + } + else if (*fsolver_id == 1) + { + *ierr = (hypre_F90_Int) + ( HYPRE_MGRSetFSolver( + hypre_F90_PassObj (HYPRE_Solver, solver), + (HYPRE_PtrToParSolverFcn) HYPRE_BoomerAMGSolve, + (HYPRE_PtrToParSolverFcn) HYPRE_BoomerAMGSetup, + (HYPRE_Solver) * fsolver) ); + } + else + { + *ierr = -1; + } +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRBuildAff + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_mgrbuildaff, HYPRE_MGRBUILDAFF) +( hypre_F90_Obj *A, + hypre_F90_IntArray *CF_marker, + hypre_F90_Int *debug_flag, + hypre_F90_Obj *A_ff, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_MGRBuildAff( + hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), + hypre_F90_PassIntArray (CF_marker), + hypre_F90_PassInt (debug_flag), + hypre_F90_PassObjRef (HYPRE_ParCSRMatrix, A_ff) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetCoarseSolver + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_mgrsetcoarsesolver, HYPRE_MGRSETCOARSESOLVER) +( hypre_F90_Obj *solver, + hypre_F90_Int *csolver_id, + hypre_F90_Obj *csolver, + hypre_F90_Int *ierr ) +{ + /*------------------------------------------------------------ + * The csolver_id flag means: + * 0 - do not setup a coarse solver. + * 1 - BoomerAMG. + *------------------------------------------------------------*/ + + if (*csolver_id == 0) + { + *ierr = 0; + } + else if (*csolver_id == 1) + { + *ierr = (hypre_F90_Int) + ( HYPRE_MGRSetCoarseSolver( + hypre_F90_PassObj (HYPRE_Solver, solver), + (HYPRE_PtrToParSolverFcn) HYPRE_BoomerAMGSolve, + (HYPRE_PtrToParSolverFcn) HYPRE_BoomerAMGSetup, + (HYPRE_Solver) * csolver) ); + } + else + { + *ierr = -1; + } +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetMaxCoarseLevels + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_mgrsetmaxcoarselevels, HYPRE_MGRSETMAXCOARSELEVELS) +( hypre_F90_Obj *solver, + hypre_F90_Int *maxlev, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_MGRSetMaxCoarseLevels( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (maxlev) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetBlockSize + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_mgrsetblocksize, HYPRE_MGRSETBLOCKSIZE) +( hypre_F90_Obj *solver, + hypre_F90_Int *bsize, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_MGRSetBlockSize( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (bsize) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetReservedCoarseNodes + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_mgrsetreservedcoarsenodes, HYPRE_MGRSETRESERVEDCOARSENODES) +( hypre_F90_Obj *solver, + hypre_F90_Int *reserved_coarse_size, + hypre_F90_BigIntArray *reserved_coarse_indexes, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_MGRSetReservedCoarseNodes( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (reserved_coarse_size), + hypre_F90_PassBigIntArray (reserved_coarse_indexes) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetReservedCptsLevel + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_mgrsetreservedcptslevel, HYPRE_MGRSETRESERVEDCPTSLEVEL) +( hypre_F90_Obj *solver, + hypre_F90_Int *level, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_MGRSetReservedCpointsLevelToKeep( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (level) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetRestrictType + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_mgrsetrestricttype, HYPRE_MGRSETRESTRICTTYPE) +( hypre_F90_Obj *solver, + hypre_F90_Int *restrict_type, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_MGRSetRestrictType( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (restrict_type) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetLevelRestrictType + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_mgrsetlevelrestricttype, HYPRE_MGRSETLEVELRESTRICTTYPE) +( hypre_F90_Obj *solver, + hypre_F90_IntArray *restrict_type, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_MGRSetLevelRestrictType( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntArray (restrict_type) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetFRelaxMethod + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_mgrsetfrelaxmethod, HYPRE_MGRSETFRELAXMETHOD) +( hypre_F90_Obj *solver, + hypre_F90_Int *relax_method, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_MGRSetFRelaxMethod( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (relax_method) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetLevelFRelaxMethod + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_mgrsetlevelfrelaxmethod, HYPRE_MGRSETLEVELFRELAXMETHOD) +( hypre_F90_Obj *solver, + hypre_F90_IntArray *relax_method, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_MGRSetLevelFRelaxMethod( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntArray (relax_method) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetCoarseGridMethod + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_mgrsetcoarsegridmethod, HYPRE_MGRSETCOARSEGRIDMETHOD) +( hypre_F90_Obj *solver, + hypre_F90_IntArray *cg_method, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_MGRSetCoarseGridMethod( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntArray (cg_method) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetLevelFRelaxNumFunc + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_mgrsetlevelfrelaxnumfunc, HYPRE_MGRSETLEVELFRELAXNUMFUNC) +( hypre_F90_Obj *solver, + hypre_F90_IntArray *num_functions, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_MGRSetLevelFRelaxNumFunctions( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntArray (num_functions) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetRelaxType + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_mgrsetrelaxtype, HYPRE_MGRSETRELAXTYPE) +( hypre_F90_Obj *solver, + hypre_F90_Int *relax_type, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_MGRSetRelaxType( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (relax_type) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetNumRelaxSweeps + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_mgrsetnumrelaxsweeps, HYPRE_MGRSETNUMRELAXSWEEPS) +( hypre_F90_Obj *solver, + hypre_F90_Int *nsweeps, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_MGRSetNumRelaxSweeps( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (nsweeps) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetInterpType + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_mgrsetinterptype, HYPRE_MGRSETINTERPTYPE) +( hypre_F90_Obj *solver, + hypre_F90_Int *interpType, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_MGRSetInterpType( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (interpType) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetLevelInterpType + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_mgrsetlevelinterptype, HYPRE_MGRSETLEVELINTERPTYPE) +( hypre_F90_Obj *solver, + hypre_F90_IntArray *interpType, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_MGRSetLevelInterpType( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntArray (interpType) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetNumInterpSweeps + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_mgrsetnuminterpsweeps, HYPRE_MGRSETNUMINTERPSWEEPS) +( hypre_F90_Obj *solver, + hypre_F90_Int *nsweeps, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_MGRSetNumInterpSweeps( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (nsweeps) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetNumRestrictSweeps + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_mgrsetnumrestrictsweeps, HYPRE_MGRSETNUMRESTRICTSWEEPS) +( hypre_F90_Obj *solver, + hypre_F90_Int *nsweeps, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_MGRSetNumRestrictSweeps( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (nsweeps) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetCGridThreshold + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_mgrsetcgridthreshold, HYPRE_MGRSETCGRIDTHRESHOLD) +( hypre_F90_Obj *solver, + hypre_F90_Real *threshold, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_MGRSetTruncateCoarseGridThreshold( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (threshold) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetFrelaxPrintLevel + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_mgrsetfrelaxprintlevel, HYPRE_MGRSETFRELAXPRINTLEVEL) +( hypre_F90_Obj *solver, + hypre_F90_Int *print_level, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_MGRSetFrelaxPrintLevel( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (print_level) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetCgridPrintLevel + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_mgrsetcgridprintlevel, HYPRE_MGRSETCGRIDPRINTLEVEL) +( hypre_F90_Obj *solver, + hypre_F90_Int *print_level, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_MGRSetCoarseGridPrintLevel( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (print_level) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetPrintLevel + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_mgrsetprintlevel, HYPRE_MGRSETPRINTLEVEL) +( hypre_F90_Obj *solver, + hypre_F90_Int *print_level, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_MGRSetPrintLevel( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (print_level) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetLogging + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_mgrsetlogging, HYPRE_MGRSETLOGGING) +( hypre_F90_Obj *solver, + hypre_F90_Int *logging, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_MGRSetLogging( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (logging) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetMaxIter + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_mgrsetmaxiter, HYPRE_MGRSETMAXITER) +( hypre_F90_Obj *solver, + hypre_F90_Int *max_iter, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_MGRSetMaxIter( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (max_iter) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetTol + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_mgrsettol, HYPRE_MGRSETTOL) +( hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_MGRSetTol( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (tol) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetMaxGlobalsmoothIt + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_mgrsetmaxglobalsmoothit, HYPRE_MGRSETMAXGLOBALSMOOTHIT) +( hypre_F90_Obj *solver, + hypre_F90_Int *max_iter, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_MGRSetMaxGlobalSmoothIters( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (max_iter) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetGlobalsmoothType + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_mgrsetglobalsmoothtype, HYPRE_MGRSETGLOBALSMOOTHTYPE) +( hypre_F90_Obj *solver, + hypre_F90_Int *iter_type, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_MGRSetGlobalSmoothType( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (iter_type) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetPMaxElmts + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_mgrsetpmaxelmts, HYPRE_MGRSETPMAXELMTS) +( hypre_F90_Obj *solver, + hypre_F90_Int *P_max_elmts, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_MGRSetPMaxElmts( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (P_max_elmts) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRGetCoarseGridConvFac + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_mgrgetcoarsegridconvfac, HYPRE_MGRGETCOARSEGRIDCONVFAC) +( hypre_F90_Obj *solver, + hypre_F90_Real *conv_factor, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_MGRGetCoarseGridConvergenceFactor( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassRealRef (conv_factor) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRGetNumIterations + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_mgrgetnumiterations, HYPRE_MGRGETNUMITERATIONS) +( hypre_F90_Obj *solver, + hypre_F90_Int *num_iterations, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_MGRGetNumIterations( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntRef (num_iterations) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRGetFinalRelResNorm + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_mgrgetfinalrelresnorm, HYPRE_MGRGETFINALRELRESNORM) +( hypre_F90_Obj *solver, + hypre_F90_Real *res_norm, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) + ( HYPRE_MGRGetFinalRelativeResidualNorm( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassRealRef (res_norm) ) ); +} + +#ifdef __cplusplus +} +#endif diff --git a/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_pcg.c b/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_pcg.c index 15e1201d..bce3e16f 100644 --- a/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_pcg.c +++ b/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_pcg.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,75 +17,75 @@ #ifdef __cplusplus extern "C" { #endif - + /*-------------------------------------------------------------------------- * HYPRE_ParCSRPCGCreate *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_parcsrpcgcreate, HYPRE_PARCSRPCGCREATE) - ( hypre_F90_Comm *comm, - hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Comm *comm, + hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRPCGCreate( - hypre_F90_PassComm (comm), - hypre_F90_PassObjRef (HYPRE_Solver, solver) ) ); + ( HYPRE_ParCSRPCGCreate( + hypre_F90_PassComm (comm), + hypre_F90_PassObjRef (HYPRE_Solver, solver) ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRPCGDestroy *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_parcsrpcgdestroy, HYPRE_PARCSRPCGDESTROY) - ( hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRPCGDestroy( - hypre_F90_PassObj (HYPRE_Solver, solver) ) ); + ( HYPRE_ParCSRPCGDestroy( + hypre_F90_PassObj (HYPRE_Solver, solver) ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRPCGSetup *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_parcsrpcgsetup, HYPRE_PARCSRPCGSETUP) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRPCGSetup( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), - hypre_F90_PassObj (HYPRE_ParVector, b), - hypre_F90_PassObj (HYPRE_ParVector, x) ) ); + ( HYPRE_ParCSRPCGSetup( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), + hypre_F90_PassObj (HYPRE_ParVector, b), + hypre_F90_PassObj (HYPRE_ParVector, x) ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRPCGSolve *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_parcsrpcgsolve, HYPRE_PARCSRPCGSOLVE) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRPCGSolve( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), - hypre_F90_PassObj (HYPRE_ParVector, b), - hypre_F90_PassObj (HYPRE_ParVector, x) ) ); + ( HYPRE_ParCSRPCGSolve( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), + hypre_F90_PassObj (HYPRE_ParVector, b), + hypre_F90_PassObj (HYPRE_ParVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -94,14 +94,14 @@ hypre_F90_IFACE(hypre_parcsrpcgsolve, HYPRE_PARCSRPCGSOLVE) void hypre_F90_IFACE(hypre_parcsrpcgsettol, HYPRE_PARCSRPCGSETTOL) - ( hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRPCGSetTol( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (tol) ) ); + ( HYPRE_ParCSRPCGSetTol( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (tol) ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRPCGSetAbsoluteTol @@ -109,14 +109,14 @@ hypre_F90_IFACE(hypre_parcsrpcgsettol, HYPRE_PARCSRPCGSETTOL) void hypre_F90_IFACE(hypre_parcsrpcgsetatol, HYPRE_PARCSRPCGSETATOL) - ( hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRPCGSetAbsoluteTol( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (tol) ) ); + ( HYPRE_ParCSRPCGSetAbsoluteTol( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (tol) ) ); } @@ -126,14 +126,14 @@ hypre_F90_IFACE(hypre_parcsrpcgsetatol, HYPRE_PARCSRPCGSETATOL) void hypre_F90_IFACE(hypre_parcsrpcgsetmaxiter, HYPRE_PARCSRPCGSETMAXITER) - ( hypre_F90_Obj *solver, - hypre_F90_Int *max_iter, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *max_iter, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRPCGSetMaxIter( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (max_iter) ) ); + ( HYPRE_ParCSRPCGSetMaxIter( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (max_iter) ) ); } /*-------------------------------------------------------------------------- @@ -142,14 +142,14 @@ hypre_F90_IFACE(hypre_parcsrpcgsetmaxiter, HYPRE_PARCSRPCGSETMAXITER) void hypre_F90_IFACE(hypre_parcsrpcgsetstopcrit, HYPRE_PARCSRPCGSETSTOPCRIT) - ( hypre_F90_Obj *solver, - hypre_F90_Int *stop_crit, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *stop_crit, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRPCGSetStopCrit( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (stop_crit) ) ); + ( HYPRE_ParCSRPCGSetStopCrit( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (stop_crit) ) ); } /*-------------------------------------------------------------------------- @@ -158,14 +158,14 @@ hypre_F90_IFACE(hypre_parcsrpcgsetstopcrit, HYPRE_PARCSRPCGSETSTOPCRIT) void hypre_F90_IFACE(hypre_parcsrpcgsettwonorm, HYPRE_PARCSRPCGSETTWONORM) - ( hypre_F90_Obj *solver, - hypre_F90_Int *two_norm, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *two_norm, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRPCGSetTwoNorm( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (two_norm) ) ); + ( HYPRE_ParCSRPCGSetTwoNorm( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (two_norm) ) ); } /*-------------------------------------------------------------------------- @@ -174,14 +174,14 @@ hypre_F90_IFACE(hypre_parcsrpcgsettwonorm, HYPRE_PARCSRPCGSETTWONORM) void hypre_F90_IFACE(hypre_parcsrpcgsetrelchange, HYPRE_PARCSRPCGSETRELCHANGE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *rel_change, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *rel_change, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRPCGSetRelChange( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (rel_change) ) ); + ( HYPRE_ParCSRPCGSetRelChange( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (rel_change) ) ); } /*-------------------------------------------------------------------------- @@ -190,10 +190,10 @@ hypre_F90_IFACE(hypre_parcsrpcgsetrelchange, HYPRE_PARCSRPCGSETRELCHANGE) void hypre_F90_IFACE(hypre_parcsrpcgsetprecond, HYPRE_PARCSRPCGSETPRECOND) - ( hypre_F90_Obj *solver, - hypre_F90_Int *precond_id, - hypre_F90_Obj *precond_solver, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *precond_id, + hypre_F90_Obj *precond_solver, + hypre_F90_Int *ierr ) { /*------------------------------------------------------------ @@ -203,6 +203,9 @@ hypre_F90_IFACE(hypre_parcsrpcgsetprecond, HYPRE_PARCSRPCGSETPRECOND) * 2 - set up an amg preconditioner * 3 - set up a pilut preconditioner * 4 - set up a ParaSails preconditioner + * 5 - set up a Euclid preconditioner + * 6 - set up a ILU preconditioner + * 7 - set up a MGR preconditioner *------------------------------------------------------------*/ if (*precond_id == 0) @@ -212,47 +215,65 @@ hypre_F90_IFACE(hypre_parcsrpcgsetprecond, HYPRE_PARCSRPCGSETPRECOND) else if (*precond_id == 1) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRPCGSetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - HYPRE_ParCSRDiagScale, - HYPRE_ParCSRDiagScaleSetup, - NULL ) ); + ( HYPRE_ParCSRPCGSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_ParCSRDiagScale, + HYPRE_ParCSRDiagScaleSetup, + NULL ) ); } else if (*precond_id == 2) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRPCGSetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - HYPRE_BoomerAMGSolve, - HYPRE_BoomerAMGSetup, - (HYPRE_Solver) *precond_solver) ); + ( HYPRE_ParCSRPCGSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_BoomerAMGSolve, + HYPRE_BoomerAMGSetup, + (HYPRE_Solver) * precond_solver) ); } else if (*precond_id == 3) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRPCGSetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - HYPRE_ParCSRPilutSolve, - HYPRE_ParCSRPilutSetup, - (HYPRE_Solver) *precond_solver) ); + ( HYPRE_ParCSRPCGSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_ParCSRPilutSolve, + HYPRE_ParCSRPilutSetup, + (HYPRE_Solver) * precond_solver) ); } else if (*precond_id == 4) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRPCGSetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - HYPRE_ParaSailsSolve, - HYPRE_ParaSailsSetup, - (HYPRE_Solver) *precond_solver) ); + ( HYPRE_ParCSRPCGSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_ParaSailsSolve, + HYPRE_ParaSailsSetup, + (HYPRE_Solver) * precond_solver) ); } else if (*precond_id == 5) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRPCGSetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - HYPRE_EuclidSolve, - HYPRE_EuclidSetup, - (HYPRE_Solver) *precond_solver) ); + ( HYPRE_ParCSRPCGSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_EuclidSolve, + HYPRE_EuclidSetup, + (HYPRE_Solver) * precond_solver) ); + } + else if (*precond_id == 6) + { + *ierr = (hypre_F90_Int) + ( HYPRE_ParCSRPCGSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_ILUSolve, + HYPRE_ILUSetup, + (HYPRE_Solver) * precond_solver ) ); + } + else if (*precond_id == 7) + { + *ierr = (hypre_F90_Int) + ( HYPRE_ParCSRPCGSetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + HYPRE_MGRSolve, + HYPRE_MGRSetup, + (HYPRE_Solver) * precond_solver ) ); } else { @@ -266,14 +287,14 @@ hypre_F90_IFACE(hypre_parcsrpcgsetprecond, HYPRE_PARCSRPCGSETPRECOND) void hypre_F90_IFACE(hypre_parcsrpcggetprecond, HYPRE_PARCSRPCGGETPRECOND) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *precond_solver_ptr, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *precond_solver_ptr, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRPCGGetPrecond( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObjRef (HYPRE_Solver, precond_solver_ptr) ) ); + ( HYPRE_ParCSRPCGGetPrecond( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObjRef (HYPRE_Solver, precond_solver_ptr) ) ); } @@ -283,14 +304,14 @@ hypre_F90_IFACE(hypre_parcsrpcggetprecond, HYPRE_PARCSRPCGGETPRECOND) void hypre_F90_IFACE(hypre_parcsrpcgsetprintlevel, HYPRE_PARCSRPCGSETPRINTLEVEL) - ( hypre_F90_Obj *solver, - hypre_F90_Int *level, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *level, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRPCGSetPrintLevel( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (level) ) ); + ( HYPRE_ParCSRPCGSetPrintLevel( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (level) ) ); } /*-------------------------------------------------------------------------- @@ -299,14 +320,14 @@ hypre_F90_IFACE(hypre_parcsrpcgsetprintlevel, HYPRE_PARCSRPCGSETPRINTLEVEL) void hypre_F90_IFACE(hypre_parcsrpcgsetlogging, HYPRE_PARCSRPCGSETLOGGING) - ( hypre_F90_Obj *solver, - hypre_F90_Int *level, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *level, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRPCGSetLogging( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (level) ) ); + ( HYPRE_ParCSRPCGSetLogging( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (level) ) ); } /*-------------------------------------------------------------------------- @@ -315,14 +336,14 @@ hypre_F90_IFACE(hypre_parcsrpcgsetlogging, HYPRE_PARCSRPCGSETLOGGING) void hypre_F90_IFACE(hypre_parcsrpcggetnumiterations, HYPRE_PARCSRPCGGETNUMITERATIONS) - ( hypre_F90_Obj *solver, - hypre_F90_Int *num_iterations, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *num_iterations, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRPCGGetNumIterations( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntRef (num_iterations) ) ); + ( HYPRE_ParCSRPCGGetNumIterations( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntRef (num_iterations) ) ); } /*-------------------------------------------------------------------------- @@ -331,14 +352,14 @@ hypre_F90_IFACE(hypre_parcsrpcggetnumiterations, HYPRE_PARCSRPCGGETNUMITERATIONS void hypre_F90_IFACE(hypre_parcsrpcggetfinalrelative, HYPRE_PARCSRPCGGETFINALRELATIVE) - ( hypre_F90_Obj *solver, - hypre_F90_Real *norm, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *norm, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRPCGGetFinalRelativeResidualNorm( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassRealRef (norm) ) ); + ( HYPRE_ParCSRPCGGetFinalRelativeResidualNorm( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassRealRef (norm) ) ); } /*-------------------------------------------------------------------------- @@ -347,18 +368,18 @@ hypre_F90_IFACE(hypre_parcsrpcggetfinalrelative, HYPRE_PARCSRPCGGETFINALRELATIVE void hypre_F90_IFACE(hypre_parcsrdiagscalesetup, HYPRE_PARCSRDIAGSCALESETUP) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *y, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *y, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRDiagScaleSetup( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), - hypre_F90_PassObj (HYPRE_ParVector, y), - hypre_F90_PassObj (HYPRE_ParVector, x) ) ); + ( HYPRE_ParCSRDiagScaleSetup( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), + hypre_F90_PassObj (HYPRE_ParVector, y), + hypre_F90_PassObj (HYPRE_ParVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -367,20 +388,20 @@ hypre_F90_IFACE(hypre_parcsrdiagscalesetup, HYPRE_PARCSRDIAGSCALESETUP) void hypre_F90_IFACE(hypre_parcsrdiagscale, HYPRE_PARCSRDIAGSCALE) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *HA, - hypre_F90_Obj *Hy, - hypre_F90_Obj *Hx, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *HA, + hypre_F90_Obj *Hy, + hypre_F90_Obj *Hx, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRDiagScale( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObj (HYPRE_ParCSRMatrix, HA), - hypre_F90_PassObj (HYPRE_ParVector, Hy), - hypre_F90_PassObj (HYPRE_ParVector, Hx) ) ); + ( HYPRE_ParCSRDiagScale( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObj (HYPRE_ParCSRMatrix, HA), + hypre_F90_PassObj (HYPRE_ParVector, Hy), + hypre_F90_PassObj (HYPRE_ParVector, Hx) ) ); } - + #ifdef __cplusplus } #endif diff --git a/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_pilut.c b/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_pilut.c index ab61e0aa..e770faf8 100644 --- a/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_pilut.c +++ b/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_pilut.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,21 +17,21 @@ #ifdef __cplusplus extern "C" { #endif - + /*-------------------------------------------------------------------------- * HYPRE_ParCSRPilutCreate *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_parcsrpilutcreate, HYPRE_PARCSRPILUTCREATE) - ( hypre_F90_Comm *comm, - hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Comm *comm, + hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRPilutCreate( - hypre_F90_PassComm (comm), - hypre_F90_PassObjRef (HYPRE_Solver, solver) ) ); + ( HYPRE_ParCSRPilutCreate( + hypre_F90_PassComm (comm), + hypre_F90_PassObjRef (HYPRE_Solver, solver) ) ); } /*-------------------------------------------------------------------------- @@ -40,100 +40,100 @@ hypre_F90_IFACE(hypre_parcsrpilutcreate, HYPRE_PARCSRPILUTCREATE) void hypre_F90_IFACE(hypre_parcsrpilutdestroy, HYPRE_PARCSRPILUTDESTROY) - ( hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRPilutDestroy( - hypre_F90_PassObj (HYPRE_Solver, solver) ) ); + ( HYPRE_ParCSRPilutDestroy( + hypre_F90_PassObj (HYPRE_Solver, solver) ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRPilutSetup *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_parcsrpilutsetup, HYPRE_PARCSRPILUTSETUP) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRPilutSetup( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), - hypre_F90_PassObj (HYPRE_ParVector, b), - hypre_F90_PassObj (HYPRE_ParVector, x) ) ); + ( HYPRE_ParCSRPilutSetup( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), + hypre_F90_PassObj (HYPRE_ParVector, b), + hypre_F90_PassObj (HYPRE_ParVector, x) ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRPilutSolve *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_parcsrpilutsolve, HYPRE_PARCSRPILUTSOLVE) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRPilutSolve( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), - hypre_F90_PassObj (HYPRE_ParVector, b), - hypre_F90_PassObj (HYPRE_ParVector, x) ) ); + ( HYPRE_ParCSRPilutSolve( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), + hypre_F90_PassObj (HYPRE_ParVector, b), + hypre_F90_PassObj (HYPRE_ParVector, x) ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRPilutSetMaxIter *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_parcsrpilutsetmaxiter, HYPRE_PARCSRPILUTSETMAXITER) - ( hypre_F90_Obj *solver, - hypre_F90_Int *max_iter, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *max_iter, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRPilutSetMaxIter( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (max_iter) ) ); + ( HYPRE_ParCSRPilutSetMaxIter( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (max_iter) ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRPilutSetDropToleran *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_parcsrpilutsetdroptoleran, HYPRE_PARCSRPILUTSETDROPTOLERAN) - ( hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRPilutSetDropTolerance( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (tol) ) ); + ( HYPRE_ParCSRPilutSetDropTolerance( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (tol) ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRPilutSetFacRowSize *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_parcsrpilutsetfacrowsize, HYPRE_PARCSRPILUTSETFACROWSIZE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *size, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *size, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRPilutSetFactorRowSize( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (size) ) ); + ( HYPRE_ParCSRPilutSetFactorRowSize( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (size) ) ); } #ifdef __cplusplus diff --git a/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_schwarz.c b/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_schwarz.c index 6e5cc6b7..c5ffe99b 100644 --- a/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_schwarz.c +++ b/external/hypre/src/parcsr_ls/F90_HYPRE_parcsr_schwarz.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,19 +17,19 @@ #ifdef __cplusplus extern "C" { #endif - + /*-------------------------------------------------------------------------- * HYPRE_SchwarzCreate *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_schwarzcreate, HYPRE_SCHWARZCREATE) - (hypre_F90_Obj *solver, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SchwarzCreate( - hypre_F90_PassObjRef (HYPRE_Solver, solver))); + ( HYPRE_SchwarzCreate( + hypre_F90_PassObjRef (HYPRE_Solver, solver))); } /*-------------------------------------------------------------------------- @@ -38,12 +38,12 @@ hypre_F90_IFACE(hypre_schwarzcreate, HYPRE_SCHWARZCREATE) void hypre_F90_IFACE(hypre_schwarzdestroy, HYPRE_SCHWARZDESTROY) - (hypre_F90_Obj *solver, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SchwarzDestroy( - hypre_F90_PassObj (HYPRE_Solver, solver) )); + ( HYPRE_SchwarzDestroy( + hypre_F90_PassObj (HYPRE_Solver, solver) )); } /*-------------------------------------------------------------------------- @@ -52,18 +52,18 @@ hypre_F90_IFACE(hypre_schwarzdestroy, HYPRE_SCHWARZDESTROY) void hypre_F90_IFACE(hypre_schwarzsetup, HYPRE_SCHWARZSETUP) - (hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SchwarzSetup( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), - hypre_F90_PassObj (HYPRE_ParVector, b), - hypre_F90_PassObj (HYPRE_ParVector, x) )); + ( HYPRE_SchwarzSetup( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), + hypre_F90_PassObj (HYPRE_ParVector, b), + hypre_F90_PassObj (HYPRE_ParVector, x) )); } /*-------------------------------------------------------------------------- @@ -72,18 +72,18 @@ hypre_F90_IFACE(hypre_schwarzsetup, HYPRE_SCHWARZSETUP) void hypre_F90_IFACE(hypre_schwarzsolve, HYPRE_SCHWARZSOLVE) - (hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SchwarzSolve( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), - hypre_F90_PassObj (HYPRE_ParVector, b), - hypre_F90_PassObj (HYPRE_ParVector, x) )); + ( HYPRE_SchwarzSolve( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), + hypre_F90_PassObj (HYPRE_ParVector, b), + hypre_F90_PassObj (HYPRE_ParVector, x) )); } /*-------------------------------------------------------------------------- @@ -91,14 +91,14 @@ hypre_F90_IFACE(hypre_schwarzsolve, HYPRE_SCHWARZSOLVE) *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_schwarzsetvariant, HYPRE_SCHWARZSETVARIANT) - (hypre_F90_Obj *solver, - hypre_F90_Int *variant, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *variant, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SchwarzSetVariant( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (variant) )); + ( HYPRE_SchwarzSetVariant( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (variant) )); } /*-------------------------------------------------------------------------- @@ -107,14 +107,14 @@ hypre_F90_IFACE(hypre_schwarzsetvariant, HYPRE_SCHWARZSETVARIANT) void hypre_F90_IFACE(hypre_schwarzsetoverlap, HYPRE_SCHWARZSETOVERLAP) - (hypre_F90_Obj *solver, - hypre_F90_Int *overlap, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *overlap, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SchwarzSetOverlap( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (overlap))); + ( HYPRE_SchwarzSetOverlap( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (overlap))); } /*-------------------------------------------------------------------------- @@ -123,14 +123,14 @@ hypre_F90_IFACE(hypre_schwarzsetoverlap, HYPRE_SCHWARZSETOVERLAP) void hypre_F90_IFACE(hypre_schwarzsetdomaintype, HYPRE_SCHWARZSETDOMAINTYPE) - (hypre_F90_Obj *solver, - hypre_F90_Int *domain_type, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *domain_type, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SchwarzSetDomainType( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (domain_type) )); + ( HYPRE_SchwarzSetDomainType( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (domain_type) )); } /*-------------------------------------------------------------------------- @@ -139,14 +139,14 @@ hypre_F90_IFACE(hypre_schwarzsetdomaintype, HYPRE_SCHWARZSETDOMAINTYPE) void hypre_F90_IFACE(hypre_schwarzsetdomainstructure, HYPRE_SCHWARZSETDOMAINSTRUCTURE) - (hypre_F90_Obj *solver, - hypre_F90_Obj *domain_structure, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Obj *domain_structure, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SchwarzSetDomainStructure( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassObj (HYPRE_CSRMatrix, domain_structure))); + ( HYPRE_SchwarzSetDomainStructure( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassObj (HYPRE_CSRMatrix, domain_structure))); } /*-------------------------------------------------------------------------- @@ -155,14 +155,14 @@ hypre_F90_IFACE(hypre_schwarzsetdomainstructure, HYPRE_SCHWARZSETDOMAINSTRUCTURE void hypre_F90_IFACE(hypre_schwarzsetnumfunctions, HYPRE_SCHWARZSETNUMFUNCTIONS) - (hypre_F90_Obj *solver, - hypre_F90_Int *num_functions, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *num_functions, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SchwarzSetNumFunctions( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassInt (num_functions) )); + (HYPRE_SchwarzSetNumFunctions( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassInt (num_functions) )); } /*-------------------------------------------------------------------------- @@ -171,14 +171,14 @@ hypre_F90_IFACE(hypre_schwarzsetnumfunctions, HYPRE_SCHWARZSETNUMFUNCTIONS) void hypre_F90_IFACE(hypre_schwarzsetrelaxweight, HYPRE_SCHWARZSETRELAXWEIGHT) - (hypre_F90_Obj *solver, - hypre_F90_Real *relax_weight, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Real *relax_weight, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SchwarzSetRelaxWeight( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassReal (relax_weight))); + (HYPRE_SchwarzSetRelaxWeight( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassReal (relax_weight))); } /*-------------------------------------------------------------------------- @@ -187,14 +187,14 @@ hypre_F90_IFACE(hypre_schwarzsetrelaxweight, HYPRE_SCHWARZSETRELAXWEIGHT) void hypre_F90_IFACE(hypre_schwarzsetdoffunc, HYPRE_SCHWARZSETDOFFUNC) - (hypre_F90_Obj *solver, - hypre_F90_IntArray *dof_func, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_IntArray *dof_func, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SchwarzSetDofFunc( - hypre_F90_PassObj (HYPRE_Solver, solver), - hypre_F90_PassIntArray (dof_func) )); + (HYPRE_SchwarzSetDofFunc( + hypre_F90_PassObj (HYPRE_Solver, solver), + hypre_F90_PassIntArray (dof_func) )); } #ifdef __cplusplus } diff --git a/external/hypre/src/parcsr_ls/F90_hypre_laplace.c b/external/hypre/src/parcsr_ls/F90_hypre_laplace.c index 192c6964..4a4b0d6d 100644 --- a/external/hypre/src/parcsr_ls/F90_hypre_laplace.c +++ b/external/hypre/src/parcsr_ls/F90_hypre_laplace.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,41 +17,41 @@ #ifdef __cplusplus extern "C" { #endif - + /*-------------------------------------------------------------------------- * GenerateLaplacian *--------------------------------------------------------------------------*/ - + void hypre_F90_IFACE(hypre_generatelaplacian, HYPRE_GENERATELAPLACIAN) - ( hypre_F90_Comm *comm, - hypre_F90_Int *nx, - hypre_F90_Int *ny, - hypre_F90_Int *nz, - hypre_F90_Int *P, - hypre_F90_Int *Q, - hypre_F90_Int *R, - hypre_F90_Int *p, - hypre_F90_Int *q, - hypre_F90_Int *r, - hypre_F90_RealArray *value, - hypre_F90_Obj *matrix, - hypre_F90_Int *ierr ) +( hypre_F90_Comm *comm, + hypre_F90_Int *nx, + hypre_F90_Int *ny, + hypre_F90_Int *nz, + hypre_F90_Int *P, + hypre_F90_Int *Q, + hypre_F90_Int *R, + hypre_F90_Int *p, + hypre_F90_Int *q, + hypre_F90_Int *r, + hypre_F90_RealArray *value, + hypre_F90_Obj *matrix, + hypre_F90_Int *ierr ) { *matrix = (hypre_F90_Obj) - ( GenerateLaplacian( - hypre_F90_PassComm (comm), - hypre_F90_PassInt (nx), - hypre_F90_PassInt (ny), - hypre_F90_PassInt (nz), - hypre_F90_PassInt (P), - hypre_F90_PassInt (Q), - hypre_F90_PassInt (R), - hypre_F90_PassInt (p), - hypre_F90_PassInt (q), - hypre_F90_PassInt (r), - hypre_F90_PassRealArray (value) ) ); + ( GenerateLaplacian( + hypre_F90_PassComm (comm), + hypre_F90_PassInt (nx), + hypre_F90_PassInt (ny), + hypre_F90_PassInt (nz), + hypre_F90_PassInt (P), + hypre_F90_PassInt (Q), + hypre_F90_PassInt (R), + hypre_F90_PassInt (p), + hypre_F90_PassInt (q), + hypre_F90_PassInt (r), + hypre_F90_PassRealArray (value) ) ); *ierr = 0; } diff --git a/external/hypre/src/parcsr_ls/HYPRE_ads.c b/external/hypre/src/parcsr_ls/HYPRE_ads.c index fea04f6f..25e9b621 100644 --- a/external/hypre/src/parcsr_ls/HYPRE_ads.c +++ b/external/hypre/src/parcsr_ls/HYPRE_ads.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -183,7 +183,7 @@ HYPRE_Int HYPRE_ADSSetSmoothingOptions(HYPRE_Solver solver, HYPRE_Int HYPRE_ADSSetChebySmoothingOptions(HYPRE_Solver solver, HYPRE_Int cheby_order, - HYPRE_Int cheby_fraction) + HYPRE_Real cheby_fraction) { return hypre_ADSSetChebySmoothingOptions((void *) solver, cheby_order, diff --git a/external/hypre/src/parcsr_ls/HYPRE_ame.c b/external/hypre/src/parcsr_ls/HYPRE_ame.c index 6699ddd3..57418b91 100644 --- a/external/hypre/src/parcsr_ls/HYPRE_ame.c +++ b/external/hypre/src/parcsr_ls/HYPRE_ame.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -86,6 +86,16 @@ HYPRE_Int HYPRE_AMESetMaxIter(HYPRE_Solver esolver, return hypre_AMESetMaxIter((void *) esolver, maxit); } +/*-------------------------------------------------------------------------- + * HYPRE_AMESetMaxPCGIter + *--------------------------------------------------------------------------*/ + +HYPRE_Int HYPRE_AMESetMaxPCGIter(HYPRE_Solver esolver, + HYPRE_Int maxit) +{ + return hypre_AMESetMaxPCGIter((void *) esolver, maxit); +} + /*-------------------------------------------------------------------------- * HYPRE_AMESetTol *--------------------------------------------------------------------------*/ @@ -101,7 +111,7 @@ HYPRE_Int HYPRE_AMESetTol(HYPRE_Solver esolver, *--------------------------------------------------------------------------*/ HYPRE_Int HYPRE_AMESetRTol(HYPRE_Solver esolver, - HYPRE_Real tol) + HYPRE_Real tol) { return hypre_AMESetRTol((void *) esolver, tol); } diff --git a/external/hypre/src/parcsr_ls/HYPRE_ams.c b/external/hypre/src/parcsr_ls/HYPRE_ams.c index 3de3a7e6..b616e02c 100644 --- a/external/hypre/src/parcsr_ls/HYPRE_ams.c +++ b/external/hypre/src/parcsr_ls/HYPRE_ams.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -231,7 +231,7 @@ HYPRE_Int HYPRE_AMSSetSmoothingOptions(HYPRE_Solver solver, HYPRE_Int HYPRE_AMSSetChebySmoothingOptions(HYPRE_Solver solver, HYPRE_Int cheby_order, - HYPRE_Int cheby_fraction) + HYPRE_Real cheby_fraction) { return hypre_AMSSetChebySmoothingOptions((void *) solver, cheby_order, diff --git a/external/hypre/src/parcsr_ls/HYPRE_parcsr_Euclid.c b/external/hypre/src/parcsr_ls/HYPRE_parcsr_Euclid.c index 2e983baa..38bff44f 100644 --- a/external/hypre/src/parcsr_ls/HYPRE_parcsr_Euclid.c +++ b/external/hypre/src/parcsr_ls/HYPRE_parcsr_Euclid.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -37,32 +37,32 @@ hypre_MPI_Abort(comm_dh, -1); \ } - /* What is best to do here? - * What is HYPRE's error checking strategy? - * The shadow knows . . . - * - * Note: HYPRE_EUCLID_ERRCHKA macro is only used within this file. - * - * Note: "printErrorMsg(stderr)" is O.K. for debugging and - * development, possibly not for production. This - * call causes Euclid to print a function call stack - * trace that led to the error. (Potentially, each - * MPI task could print a trace.) - * - * Note: the __FUNC__ defines at the beginning of the function - * calls are used in Euclid's internal error-checking scheme. - * The "START_FUNC_DH" and "END_FUNC_VAL" macros are - * used for debugging: when "logFuncsToStderr == true" - * a function call trace is force-written to stderr; - * (useful for debugging over dial-up lines!) See - * src/distributed_ls/Euclid/macros_dh.h and - * src/distributed_ls/Euclid/src/globalObjects.c - * for further info. - */ +/* What is best to do here? + * What is HYPRE's error checking strategy? + * The shadow knows . . . + * + * Note: HYPRE_EUCLID_ERRCHKA macro is only used within this file. + * + * Note: "printErrorMsg(stderr)" is O.K. for debugging and + * development, possibly not for production. This + * call causes Euclid to print a function call stack + * trace that led to the error. (Potentially, each + * MPI task could print a trace.) + * + * Note: the __FUNC__ defines at the beginning of the function + * calls are used in Euclid's internal error-checking scheme. + * The "START_FUNC_DH" and "END_FUNC_VAL" macros are + * used for debugging: when "logFuncsToStderr == true" + * a function call trace is force-written to stderr; + * (useful for debugging over dial-up lines!) See + * src/distributed_ls/Euclid/macros_dh.h and + * src/distributed_ls/Euclid/src/globalObjects.c + * for further info. + */ /*-------------------------------------------------------------------------- - * debugging: if ENABLE_EUCLID_LOGGING is defined, each MPI task will open + * debugging: if ENABLE_EUCLID_LOGGING is defined, each MPI task will open * "logFile.id" for writing; also, function-call tracing is operational * (ie, you can set logFuncsToFile = true, logFuncsToSterr = true). * @@ -80,59 +80,64 @@ /*-------------------------------------------------------------------------- - * HYPRE_EuclidCreate - Return a Euclid "solver". + * HYPRE_EuclidCreate - Return a Euclid "solver". *--------------------------------------------------------------------------*/ #undef __FUNC__ #define __FUNC__ "HYPRE_EuclidCreate" -HYPRE_Int +HYPRE_Int HYPRE_EuclidCreate( MPI_Comm comm, HYPRE_Solver *solver ) { #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Euclid cannot be used in mixedint mode!"); - return hypre_error_flag; + HYPRE_UNUSED_VAR(comm); + HYPRE_UNUSED_VAR(solver); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Euclid cannot be used in mixedint mode!"); + return hypre_error_flag; #else - START_FUNC_DH - Euclid_dh eu; + START_FUNC_DH + Euclid_dh eu; - /*----------------------------------------------------------- - * create a few global objects (yuck!) for Euclid's use; - * these are all pointers, are initially NULL, and are be set - * back to NULL in HYPRE_EuclidDestroy() - * Global objects are defined in - * src/distributed_ls/Euclid/src/globalObjects.c - *-----------------------------------------------------------*/ + /*----------------------------------------------------------- + * create a few global objects (yuck!) for Euclid's use; + * these are all pointers, are initially NULL, and are be set + * back to NULL in HYPRE_EuclidDestroy() + * Global objects are defined in + * src/distributed_ls/Euclid/src/globalObjects.c + *-----------------------------------------------------------*/ - comm_dh = comm; - hypre_MPI_Comm_size(comm_dh, &np_dh); HYPRE_EUCLID_ERRCHKA; - hypre_MPI_Comm_rank(comm_dh, &myid_dh); HYPRE_EUCLID_ERRCHKA; + comm_dh = comm; + hypre_MPI_Comm_size(comm_dh, &np_dh); HYPRE_EUCLID_ERRCHKA; + hypre_MPI_Comm_rank(comm_dh, &myid_dh); HYPRE_EUCLID_ERRCHKA; #ifdef ENABLE_EUCLID_LOGGING - openLogfile_dh(0, NULL); HYPRE_EUCLID_ERRCHKA; + openLogfile_dh(0, NULL); HYPRE_EUCLID_ERRCHKA; #endif - if (mem_dh == NULL) { - Mem_dhCreate(&mem_dh); HYPRE_EUCLID_ERRCHKA; - } - - if (tlog_dh == NULL) { - TimeLog_dhCreate(&tlog_dh); HYPRE_EUCLID_ERRCHKA; - } - - if (parser_dh == NULL) { - Parser_dhCreate(&parser_dh); HYPRE_EUCLID_ERRCHKA; - } - Parser_dhInit(parser_dh, 0, NULL); HYPRE_EUCLID_ERRCHKA; - - /*----------------------------------------------------------- - * create and return a Euclid object - *-----------------------------------------------------------*/ - Euclid_dhCreate(&eu); HYPRE_EUCLID_ERRCHKA; - *solver = (HYPRE_Solver) eu; - - END_FUNC_VAL(0) + if (mem_dh == NULL) + { + Mem_dhCreate(&mem_dh); HYPRE_EUCLID_ERRCHKA; + } + + if (tlog_dh == NULL) + { + TimeLog_dhCreate(&tlog_dh); HYPRE_EUCLID_ERRCHKA; + } + + if (parser_dh == NULL) + { + Parser_dhCreate(&parser_dh); HYPRE_EUCLID_ERRCHKA; + } + Parser_dhInit(parser_dh, 0, NULL); HYPRE_EUCLID_ERRCHKA; + + /*----------------------------------------------------------- + * create and return a Euclid object + *-----------------------------------------------------------*/ + Euclid_dhCreate(&eu); HYPRE_EUCLID_ERRCHKA; + *solver = (HYPRE_Solver) eu; + + END_FUNC_VAL(0) #endif } @@ -142,102 +147,114 @@ HYPRE_EuclidCreate( MPI_Comm comm, #undef __FUNC__ #define __FUNC__ "HYPRE_EuclidDestroy" -HYPRE_Int +HYPRE_Int HYPRE_EuclidDestroy( HYPRE_Solver solver ) { #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Euclid cannot be used in mixedint mode!"); - return hypre_error_flag; + HYPRE_UNUSED_VAR(solver); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Euclid cannot be used in mixedint mode!"); + return hypre_error_flag; #else - START_FUNC_DH - Euclid_dh eu = (Euclid_dh)solver; - bool printMemReport = false; - bool printStats = false; - bool logging = eu->logging; - - /*---------------------------------------------------------------- - this block is for printing test data; this is used - for diffing in autotests. - *---------------------------------------------------------------- */ - if (Parser_dhHasSwitch(parser_dh, "-printTestData")) { - FILE *fp; - - /* get filename to which to write report */ - char fname[] = "test_data_dh.temp", *fnamePtr = fname; - Parser_dhReadString(parser_dh, "-printTestData", &fnamePtr); HYPRE_EUCLID_ERRCHKA; - if (!strcmp(fnamePtr, "1")) { /* in case usr didn't supply a name! */ - fnamePtr = fname; - } - - /* print the report */ - fp = openFile_dh(fnamePtr, "w"); HYPRE_EUCLID_ERRCHKA; - Euclid_dhPrintTestData(eu, fp); HYPRE_EUCLID_ERRCHKA; - closeFile_dh(fp); HYPRE_EUCLID_ERRCHKA; - - printf_dh("\n@@@@@ Euclid test data was printed to file: %s\n\n", fnamePtr); - } - - - /*---------------------------------------------------------------- - determine which of Euclid's internal reports to print - *----------------------------------------------------------------*/ - if (logging) { - printStats = true; - printMemReport = true; - } - if (parser_dh != NULL) { - if (Parser_dhHasSwitch(parser_dh, "-eu_stats")) { + START_FUNC_DH + Euclid_dh eu = (Euclid_dh)solver; + bool printMemReport = false; + bool printStats = false; + bool logging = eu->logging; + + /*---------------------------------------------------------------- + this block is for printing test data; this is used + for diffing in autotests. + *---------------------------------------------------------------- */ + if (Parser_dhHasSwitch(parser_dh, "-printTestData")) + { + FILE *fp; + + /* get filename to which to write report */ + char fname[] = "test_data_dh.temp", *fnamePtr = fname; + Parser_dhReadString(parser_dh, "-printTestData", &fnamePtr); HYPRE_EUCLID_ERRCHKA; + if (!strcmp(fnamePtr, "1")) /* in case usr didn't supply a name! */ + { + fnamePtr = fname; + } + + /* print the report */ + fp = openFile_dh(fnamePtr, "w"); HYPRE_EUCLID_ERRCHKA; + Euclid_dhPrintTestData(eu, fp); HYPRE_EUCLID_ERRCHKA; + closeFile_dh(fp); HYPRE_EUCLID_ERRCHKA; + + printf_dh("\n@@@@@ Euclid test data was printed to file: %s\n\n", fnamePtr); + } + + + /*---------------------------------------------------------------- + determine which of Euclid's internal reports to print + *----------------------------------------------------------------*/ + if (logging) + { printStats = true; - } - if (Parser_dhHasSwitch(parser_dh, "-eu_mem")) { printMemReport = true; - } - } - - /*------------------------------------------------------------------ - print Euclid's internal report, then destroy the Euclid object - *------------------------------------------------------------------ */ - if (printStats) { - Euclid_dhPrintHypreReport(eu, stdout); HYPRE_EUCLID_ERRCHKA; - } - Euclid_dhDestroy(eu); HYPRE_EUCLID_ERRCHKA; - - - /*------------------------------------------------------------------ - destroy all remaining Euclid library objects - (except the memory object) - *------------------------------------------------------------------ */ - /*if (parser_dh != NULL) { dah 3/16/06 */ - if (parser_dh != NULL && ref_counter == 0) { - Parser_dhDestroy(parser_dh); HYPRE_EUCLID_ERRCHKA; - parser_dh = NULL; - } - - /*if (tlog_dh != NULL) { dah 3/16/06 */ - if (tlog_dh != NULL && ref_counter == 0) { - TimeLog_dhDestroy(tlog_dh); HYPRE_EUCLID_ERRCHKA; - tlog_dh = NULL; - } - - /*------------------------------------------------------------------ - optionally print Euclid's memory report, - then destroy the memory object. - *------------------------------------------------------------------ */ - /*if (mem_dh != NULL) { dah 3/16/06 */ - if (mem_dh != NULL && ref_counter == 0) { - if (printMemReport) { - Mem_dhPrint(mem_dh, stdout, false); HYPRE_EUCLID_ERRCHKA; - } - Mem_dhDestroy(mem_dh); HYPRE_EUCLID_ERRCHKA; - mem_dh = NULL; - } + } + if (parser_dh != NULL) + { + if (Parser_dhHasSwitch(parser_dh, "-eu_stats")) + { + printStats = true; + } + if (Parser_dhHasSwitch(parser_dh, "-eu_mem")) + { + printMemReport = true; + } + } + + /*------------------------------------------------------------------ + print Euclid's internal report, then destroy the Euclid object + *------------------------------------------------------------------ */ + if (printStats) + { + Euclid_dhPrintHypreReport(eu, stdout); HYPRE_EUCLID_ERRCHKA; + } + Euclid_dhDestroy(eu); HYPRE_EUCLID_ERRCHKA; + + + /*------------------------------------------------------------------ + destroy all remaining Euclid library objects + (except the memory object) + *------------------------------------------------------------------ */ + /*if (parser_dh != NULL) { dah 3/16/06 */ + if (parser_dh != NULL && ref_counter == 0) + { + Parser_dhDestroy(parser_dh); HYPRE_EUCLID_ERRCHKA; + parser_dh = NULL; + } + + /*if (tlog_dh != NULL) { dah 3/16/06 */ + if (tlog_dh != NULL && ref_counter == 0) + { + TimeLog_dhDestroy(tlog_dh); HYPRE_EUCLID_ERRCHKA; + tlog_dh = NULL; + } + + /*------------------------------------------------------------------ + optionally print Euclid's memory report, + then destroy the memory object. + *------------------------------------------------------------------ */ + /*if (mem_dh != NULL) { dah 3/16/06 */ + if (mem_dh != NULL && ref_counter == 0) + { + if (printMemReport) + { + Mem_dhPrint(mem_dh, stdout, false); HYPRE_EUCLID_ERRCHKA; + } + Mem_dhDestroy(mem_dh); HYPRE_EUCLID_ERRCHKA; + mem_dh = NULL; + } #ifdef ENABLE_EUCLID_LOGGING - closeLogfile_dh(); HYPRE_EUCLID_ERRCHKA; + closeLogfile_dh(); HYPRE_EUCLID_ERRCHKA; #endif - END_FUNC_VAL(0) + END_FUNC_VAL(0) #endif } @@ -247,49 +264,54 @@ HYPRE_EuclidDestroy( HYPRE_Solver solver ) #undef __FUNC__ #define __FUNC__ "HYPRE_EuclidSetup" -HYPRE_Int +HYPRE_Int HYPRE_EuclidSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) { + HYPRE_UNUSED_VAR(b); + HYPRE_UNUSED_VAR(x); + #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Euclid cannot be used in mixedint mode!"); - return hypre_error_flag; + HYPRE_UNUSED_VAR(solver); + HYPRE_UNUSED_VAR(A); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Euclid cannot be used in mixedint mode!"); + return hypre_error_flag; #else - START_FUNC_DH - Euclid_dh eu = (Euclid_dh)solver; + START_FUNC_DH + Euclid_dh eu = (Euclid_dh)solver; #if 0 -for testing! - { - HYPRE_Int ierr; - HYPRE_Int m,n,rs,re,cs,ce; + for testing! +{ + HYPRE_Int ierr; + HYPRE_Int m, n, rs, re, cs, ce; HYPRE_DistributedMatrix mat; ierr = HYPRE_ConvertParCSRMatrixToDistributedMatrix( A, &mat ); - if (ierr) exit(-1); + if (ierr) { exit(-1); } - ierr = HYPRE_DistributedMatrixGetDims(mat, &m, &n); - ierr = HYPRE_DistributedMatrixGetLocalRange(mat, &rs, &re, - &cs, &ce); + ierr = HYPRE_DistributedMatrixGetDims(mat, &m, &n); + ierr = HYPRE_DistributedMatrixGetLocalRange(mat, &rs, &re, + &cs, &ce); - hypre_printf("\n### [%i] m= %i, n= %i, rs= %i, re= %i, cs= %i, ce= %i\n", - myid_dh, m, n, rs, re, cs, ce); + hypre_printf("\n### [%i] m= %i, n= %i, rs= %i, re= %i, cs= %i, ce= %i\n", + myid_dh, m, n, rs, re, cs, ce); - ierr = HYPRE_DistributedMatrixDestroy(mat); + ierr = HYPRE_DistributedMatrixDestroy(mat); - if (ierr) exit(-1); - } + if (ierr) { exit(-1); } + } #endif - Euclid_dhInputHypreMat(eu, A); HYPRE_EUCLID_ERRCHKA; - Euclid_dhSetup(eu); HYPRE_EUCLID_ERRCHKA; + Euclid_dhInputHypreMat(eu, A); HYPRE_EUCLID_ERRCHKA; + Euclid_dhSetup(eu); HYPRE_EUCLID_ERRCHKA; - END_FUNC_VAL(0) + END_FUNC_VAL(0) #endif } @@ -299,51 +321,60 @@ for testing! #undef __FUNC__ #define __FUNC__ "HYPRE_EuclidSolve" -HYPRE_Int -HYPRE_EuclidSolve( HYPRE_Solver solver, - HYPRE_ParCSRMatrix A, - HYPRE_ParVector bb, - HYPRE_ParVector xx ) +HYPRE_Int +HYPRE_EuclidSolve( HYPRE_Solver solver, + HYPRE_ParCSRMatrix A, + HYPRE_ParVector bb, + HYPRE_ParVector xx ) { + HYPRE_UNUSED_VAR(A); + #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Euclid cannot be used in mixedint mode!"); - return hypre_error_flag; + HYPRE_UNUSED_VAR(solver); + HYPRE_UNUSED_VAR(bb); + HYPRE_UNUSED_VAR(xx); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Euclid cannot be used in mixedint mode!"); + return hypre_error_flag; #else - START_FUNC_DH - Euclid_dh eu = (Euclid_dh)solver; - HYPRE_Real *b, *x; + START_FUNC_DH + Euclid_dh eu = (Euclid_dh)solver; + HYPRE_Real *b, *x; - x = hypre_VectorData(hypre_ParVectorLocalVector((hypre_ParVector *) bb)); - b = hypre_VectorData(hypre_ParVectorLocalVector((hypre_ParVector *) xx)); + x = hypre_VectorData(hypre_ParVectorLocalVector((hypre_ParVector *) bb)); + b = hypre_VectorData(hypre_ParVectorLocalVector((hypre_ParVector *) xx)); - Euclid_dhApply(eu, x, b); HYPRE_EUCLID_ERRCHKA; - END_FUNC_VAL(0) + Euclid_dhApply(eu, x, b); HYPRE_EUCLID_ERRCHKA; + END_FUNC_VAL(0) #endif } /*-------------------------------------------------------------------------- - * Insert command line (flag, value) pairs in Euclid's + * Insert command line (flag, value) pairs in Euclid's *--------------------------------------------------------------------------*/ #undef __FUNC__ #define __FUNC__ "HYPRE_EuclidSetParams" HYPRE_Int -HYPRE_EuclidSetParams(HYPRE_Solver solver, +HYPRE_EuclidSetParams(HYPRE_Solver solver, HYPRE_Int argc, char *argv[] ) { + HYPRE_UNUSED_VAR(solver); + #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Euclid cannot be used in mixedint mode!"); - return hypre_error_flag; + HYPRE_UNUSED_VAR(argc); + HYPRE_UNUSED_VAR(argv); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Euclid cannot be used in mixedint mode!"); + return hypre_error_flag; #else - START_FUNC_DH - Parser_dhInit(parser_dh, argc, argv); HYPRE_EUCLID_ERRCHKA; + START_FUNC_DH + Parser_dhInit(parser_dh, argc, argv); HYPRE_EUCLID_ERRCHKA; - /* maintainers note: even though Parser_dhInit() was called in - HYPRE_EuclidCreate(), it's O.K. to call it again. - */ - END_FUNC_VAL(0) + /* maintainers note: even though Parser_dhInit() was called in + HYPRE_EuclidCreate(), it's O.K. to call it again. + */ + END_FUNC_VAL(0) #endif } @@ -354,138 +385,161 @@ HYPRE_EuclidSetParams(HYPRE_Solver solver, #undef __FUNC__ #define __FUNC__ "HYPRE_EuclidSetParamsFromFile" HYPRE_Int -HYPRE_EuclidSetParamsFromFile(HYPRE_Solver solver, +HYPRE_EuclidSetParamsFromFile(HYPRE_Solver solver, char *filename ) { + HYPRE_UNUSED_VAR(solver); + #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Euclid cannot be used in mixedint mode!"); - return hypre_error_flag; + HYPRE_UNUSED_VAR(filename); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Euclid cannot be used in mixedint mode!"); + return hypre_error_flag; #else - START_FUNC_DH - Parser_dhUpdateFromFile(parser_dh, filename); HYPRE_EUCLID_ERRCHKA; - END_FUNC_VAL(0) + START_FUNC_DH + Parser_dhUpdateFromFile(parser_dh, filename); HYPRE_EUCLID_ERRCHKA; + END_FUNC_VAL(0) #endif } HYPRE_Int -HYPRE_EuclidSetLevel(HYPRE_Solver solver, +HYPRE_EuclidSetLevel(HYPRE_Solver solver, HYPRE_Int level) { + HYPRE_UNUSED_VAR(solver); + #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Euclid cannot be used in mixedint mode!"); - return hypre_error_flag; + HYPRE_UNUSED_VAR(level); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Euclid cannot be used in mixedint mode!"); + return hypre_error_flag; #else - char str_level[8]; - START_FUNC_DH - hypre_sprintf(str_level,"%d",level); - Parser_dhInsert(parser_dh, "-level", str_level); HYPRE_EUCLID_ERRCHKA; - END_FUNC_VAL(0) + char str_level[8]; + START_FUNC_DH + hypre_sprintf(str_level, "%d", level); + Parser_dhInsert(parser_dh, "-level", str_level); HYPRE_EUCLID_ERRCHKA; + END_FUNC_VAL(0) #endif } HYPRE_Int -HYPRE_EuclidSetBJ(HYPRE_Solver solver, +HYPRE_EuclidSetBJ(HYPRE_Solver solver, HYPRE_Int bj) { + HYPRE_UNUSED_VAR(solver); + #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Euclid cannot be used in mixedint mode!"); - return hypre_error_flag; + HYPRE_UNUSED_VAR(bj); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Euclid cannot be used in mixedint mode!"); + return hypre_error_flag; #else - char str_bj[8]; - START_FUNC_DH - hypre_sprintf(str_bj,"%d",bj); - Parser_dhInsert(parser_dh, "-bj", str_bj); HYPRE_EUCLID_ERRCHKA; - END_FUNC_VAL(0) + char str_bj[8]; + START_FUNC_DH + hypre_sprintf(str_bj, "%d", bj); + Parser_dhInsert(parser_dh, "-bj", str_bj); HYPRE_EUCLID_ERRCHKA; + END_FUNC_VAL(0) #endif } HYPRE_Int -HYPRE_EuclidSetStats(HYPRE_Solver solver, +HYPRE_EuclidSetStats(HYPRE_Solver solver, HYPRE_Int eu_stats) { + HYPRE_UNUSED_VAR(solver); + #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Euclid cannot be used in mixedint mode!"); - return hypre_error_flag; + HYPRE_UNUSED_VAR(eu_stats); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Euclid cannot be used in mixedint mode!"); + return hypre_error_flag; #else - char str_eu_stats[8]; - START_FUNC_DH - hypre_sprintf(str_eu_stats,"%d",eu_stats); - Parser_dhInsert(parser_dh, "-eu_stats", str_eu_stats); HYPRE_EUCLID_ERRCHKA; - END_FUNC_VAL(0) + char str_eu_stats[8]; + START_FUNC_DH + hypre_sprintf(str_eu_stats, "%d", eu_stats); + Parser_dhInsert(parser_dh, "-eu_stats", str_eu_stats); HYPRE_EUCLID_ERRCHKA; + END_FUNC_VAL(0) #endif } HYPRE_Int -HYPRE_EuclidSetMem(HYPRE_Solver solver, +HYPRE_EuclidSetMem(HYPRE_Solver solver, HYPRE_Int eu_mem) { + HYPRE_UNUSED_VAR(solver); + #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Euclid cannot be used in mixedint mode!"); - return hypre_error_flag; + HYPRE_UNUSED_VAR(eu_mem); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Euclid cannot be used in mixedint mode!"); + return hypre_error_flag; #else - char str_eu_mem[8]; - START_FUNC_DH - hypre_sprintf(str_eu_mem,"%d",eu_mem); - Parser_dhInsert(parser_dh, "-eu_mem", str_eu_mem); HYPRE_EUCLID_ERRCHKA; - END_FUNC_VAL(0) + char str_eu_mem[8]; + START_FUNC_DH + hypre_sprintf(str_eu_mem, "%d", eu_mem); + Parser_dhInsert(parser_dh, "-eu_mem", str_eu_mem); HYPRE_EUCLID_ERRCHKA; + END_FUNC_VAL(0) #endif } HYPRE_Int -HYPRE_EuclidSetSparseA(HYPRE_Solver solver, +HYPRE_EuclidSetSparseA(HYPRE_Solver solver, HYPRE_Real sparse_A) { + HYPRE_UNUSED_VAR(solver); + #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Euclid cannot be used in mixedint mode!"); - return hypre_error_flag; + HYPRE_UNUSED_VAR(sparse_A); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Euclid cannot be used in mixedint mode!"); + return hypre_error_flag; #else - char str_sparse_A[256]; - START_FUNC_DH - hypre_sprintf(str_sparse_A,"%f",sparse_A); - Parser_dhInsert(parser_dh, "-sparseA", str_sparse_A); - HYPRE_EUCLID_ERRCHKA; - END_FUNC_VAL(0) + char str_sparse_A[256]; + START_FUNC_DH + hypre_sprintf(str_sparse_A, "%f", sparse_A); + Parser_dhInsert(parser_dh, "-sparseA", str_sparse_A); + HYPRE_EUCLID_ERRCHKA; + END_FUNC_VAL(0) #endif } HYPRE_Int -HYPRE_EuclidSetRowScale(HYPRE_Solver solver, +HYPRE_EuclidSetRowScale(HYPRE_Solver solver, HYPRE_Int row_scale) { + HYPRE_UNUSED_VAR(solver); + #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Euclid cannot be used in mixedint mode!"); - return hypre_error_flag; + HYPRE_UNUSED_VAR(row_scale); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Euclid cannot be used in mixedint mode!"); + return hypre_error_flag; #else - char str_row_scale[8]; - START_FUNC_DH - hypre_sprintf(str_row_scale,"%d",row_scale); - Parser_dhInsert(parser_dh, "-rowScale", str_row_scale); - HYPRE_EUCLID_ERRCHKA; - END_FUNC_VAL(0) + char str_row_scale[8]; + START_FUNC_DH + hypre_sprintf(str_row_scale, "%d", row_scale); + Parser_dhInsert(parser_dh, "-rowScale", str_row_scale); + HYPRE_EUCLID_ERRCHKA; + END_FUNC_VAL(0) #endif } HYPRE_Int -HYPRE_EuclidSetILUT(HYPRE_Solver solver, +HYPRE_EuclidSetILUT(HYPRE_Solver solver, HYPRE_Real ilut) { + HYPRE_UNUSED_VAR(solver); + #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Euclid cannot be used in mixedint mode!"); - return hypre_error_flag; + HYPRE_UNUSED_VAR(ilut); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Euclid cannot be used in mixedint mode!"); + return hypre_error_flag; #else - char str_ilut[256]; - START_FUNC_DH - hypre_sprintf(str_ilut,"%f",ilut); - Parser_dhInsert(parser_dh, "-ilut", str_ilut); HYPRE_EUCLID_ERRCHKA; - END_FUNC_VAL(0) + char str_ilut[256]; + START_FUNC_DH + hypre_sprintf(str_ilut, "%f", ilut); + Parser_dhInsert(parser_dh, "-ilut", str_ilut); HYPRE_EUCLID_ERRCHKA; + END_FUNC_VAL(0) #endif } - diff --git a/external/hypre/src/parcsr_ls/HYPRE_parcsr_ParaSails.c b/external/hypre/src/parcsr_ls/HYPRE_parcsr_ParaSails.c index cfbdeec3..8e5a30c2 100644 --- a/external/hypre/src/parcsr_ls/HYPRE_parcsr_ParaSails.c +++ b/external/hypre/src/parcsr_ls/HYPRE_parcsr_ParaSails.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -35,7 +35,7 @@ /* AB 8/06 - replace header file */ /* #include "../parcsr_mv/par_vector.h" */ #include "../parcsr_mv/_hypre_parcsr_mv.h" - + /* If code is more mysterious, then it must be good */ typedef struct { @@ -49,22 +49,24 @@ typedef struct MPI_Comm comm; HYPRE_Int logging; } - Secret; +Secret; /*-------------------------------------------------------------------------- - * HYPRE_ParCSRParaSailsCreate - Return a ParaSails preconditioner object + * HYPRE_ParCSRParaSailsCreate - Return a ParaSails preconditioner object * "solver". The default parameters for the preconditioner are also set, * so a call to HYPRE_ParCSRParaSailsSetParams is not absolutely necessary. *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_ParCSRParaSailsCreate( MPI_Comm comm, HYPRE_Solver *solver ) { #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"ParaSails not usable in mixedint mode!"); + HYPRE_UNUSED_VAR(comm); + HYPRE_UNUSED_VAR(solver); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ParaSails not usable in mixedint mode!"); return hypre_error_flag; #else - + Secret *secret; secret = hypre_TAlloc(Secret, 1, HYPRE_MEMORY_HOST); @@ -96,20 +98,21 @@ HYPRE_ParCSRParaSailsCreate( MPI_Comm comm, HYPRE_Solver *solver ) * HYPRE_ParCSRParaSailsDestroy - Destroy a ParaSails object. *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_ParCSRParaSailsDestroy( HYPRE_Solver solver ) { #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"ParaSails not usable in mixedint mode!"); + HYPRE_UNUSED_VAR(solver); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ParaSails not usable in mixedint mode!"); return hypre_error_flag; #else - + Secret *secret; secret = (Secret *) solver; hypre_ParaSailsDestroy(secret->obj); - hypre_TFree(secret,HYPRE_MEMORY_HOST); + hypre_TFree(secret, HYPRE_MEMORY_HOST); return hypre_error_flag; #endif @@ -117,21 +120,26 @@ HYPRE_ParCSRParaSailsDestroy( HYPRE_Solver solver ) /*-------------------------------------------------------------------------- * HYPRE_ParCSRParaSailsSetup - Set up function for ParaSails. - * This function is not called on subsequent times if the preconditioner is + * This function is not called on subsequent times if the preconditioner is * being reused. *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_ParCSRParaSailsSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) { + HYPRE_UNUSED_VAR(b); + HYPRE_UNUSED_VAR(x); + #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"ParaSails not usable in mixedint mode!"); + HYPRE_UNUSED_VAR(solver); + HYPRE_UNUSED_VAR(A); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ParaSails not usable in mixedint mode!"); return hypre_error_flag; #else - + static HYPRE_Int virgin = 1; HYPRE_DistributedMatrix mat; Secret *secret = (Secret *) solver; @@ -139,7 +147,7 @@ HYPRE_ParCSRParaSailsSetup( HYPRE_Solver solver, /* The following call will also create the distributed matrix */ HYPRE_ConvertParCSRMatrixToDistributedMatrix( A, &mat ); - if (hypre_error_flag) return hypre_error_flag; + if (hypre_error_flag) { return hypre_error_flag; } if (virgin || secret->reuse == 0) /* call set up at least once */ { @@ -147,14 +155,14 @@ HYPRE_ParCSRParaSailsSetup( HYPRE_Solver solver, hypre_ParaSailsSetup( secret->obj, mat, secret->sym, secret->thresh, secret->nlevels, secret->filter, secret->loadbal, secret->logging); - if (hypre_error_flag) return hypre_error_flag; + if (hypre_error_flag) { return hypre_error_flag; } } else /* reuse is true; this is a subsequent call */ { /* reuse pattern: always use filter value of 0 and loadbal of 0 */ hypre_ParaSailsSetupValues(secret->obj, mat, 0.0, 0.0, secret->logging); - if (hypre_error_flag) return hypre_error_flag; + if (hypre_error_flag) { return hypre_error_flag; } } HYPRE_DistributedMatrixDestroy(mat); @@ -167,17 +175,23 @@ HYPRE_ParCSRParaSailsSetup( HYPRE_Solver solver, * HYPRE_ParCSRParaSailsSolve - Solve function for ParaSails. *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_ParCSRParaSailsSolve( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) { + HYPRE_UNUSED_VAR(A); + #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"ParaSails not usable in mixedint mode!"); + HYPRE_UNUSED_VAR(b); + HYPRE_UNUSED_VAR(x); + HYPRE_UNUSED_VAR(solver); + + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ParaSails not usable in mixedint mode!"); return hypre_error_flag; #else - + HYPRE_Real *rhs, *soln; Secret *secret = (Secret *) solver; @@ -196,15 +210,19 @@ HYPRE_ParCSRParaSailsSolve( HYPRE_Solver solver, *--------------------------------------------------------------------------*/ HYPRE_Int -HYPRE_ParCSRParaSailsSetParams(HYPRE_Solver solver, +HYPRE_ParCSRParaSailsSetParams(HYPRE_Solver solver, HYPRE_Real thresh, HYPRE_Int nlevels ) { #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"ParaSails not usable in mixedint mode!"); + HYPRE_UNUSED_VAR(solver); + HYPRE_UNUSED_VAR(thresh); + HYPRE_UNUSED_VAR(nlevels); + + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ParaSails not usable in mixedint mode!"); return hypre_error_flag; #else - + Secret *secret = (Secret *) solver; secret->thresh = thresh; @@ -220,14 +238,17 @@ HYPRE_ParCSRParaSailsSetParams(HYPRE_Solver solver, *--------------------------------------------------------------------------*/ HYPRE_Int -HYPRE_ParCSRParaSailsSetFilter(HYPRE_Solver solver, +HYPRE_ParCSRParaSailsSetFilter(HYPRE_Solver solver, HYPRE_Real filter ) { #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"ParaSails not usable in mixedint mode!"); + HYPRE_UNUSED_VAR(solver); + HYPRE_UNUSED_VAR(filter); + + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ParaSails not usable in mixedint mode!"); return hypre_error_flag; #else - + Secret *secret = (Secret *) solver; secret->filter = filter; @@ -237,14 +258,17 @@ HYPRE_ParCSRParaSailsSetFilter(HYPRE_Solver solver, } HYPRE_Int -HYPRE_ParCSRParaSailsGetFilter(HYPRE_Solver solver, +HYPRE_ParCSRParaSailsGetFilter(HYPRE_Solver solver, HYPRE_Real * filter ) { #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"ParaSails not usable in mixedint mode!"); + HYPRE_UNUSED_VAR(solver); + HYPRE_UNUSED_VAR(filter); + + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ParaSails not usable in mixedint mode!"); return hypre_error_flag; #else - + Secret *secret = (Secret *) solver; *filter = secret->filter; @@ -259,14 +283,17 @@ HYPRE_ParCSRParaSailsGetFilter(HYPRE_Solver solver, *--------------------------------------------------------------------------*/ HYPRE_Int -HYPRE_ParCSRParaSailsSetSym(HYPRE_Solver solver, +HYPRE_ParCSRParaSailsSetSym(HYPRE_Solver solver, HYPRE_Int sym ) { #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"ParaSails not usable in mixedint mode!"); + HYPRE_UNUSED_VAR(solver); + HYPRE_UNUSED_VAR(sym); + + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ParaSails not usable in mixedint mode!"); return hypre_error_flag; #else - + Secret *secret = (Secret *) solver; secret->sym = sym; @@ -280,14 +307,17 @@ HYPRE_ParCSRParaSailsSetSym(HYPRE_Solver solver, *--------------------------------------------------------------------------*/ HYPRE_Int -HYPRE_ParCSRParaSailsSetLoadbal(HYPRE_Solver solver, +HYPRE_ParCSRParaSailsSetLoadbal(HYPRE_Solver solver, HYPRE_Real loadbal ) { #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"ParaSails not usable in mixedint mode!"); + HYPRE_UNUSED_VAR(solver); + HYPRE_UNUSED_VAR(loadbal); + + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ParaSails not usable in mixedint mode!"); return hypre_error_flag; #else - + Secret *secret = (Secret *) solver; secret->loadbal = loadbal; @@ -297,14 +327,17 @@ HYPRE_ParCSRParaSailsSetLoadbal(HYPRE_Solver solver, } HYPRE_Int -HYPRE_ParCSRParaSailsGetLoadbal(HYPRE_Solver solver, +HYPRE_ParCSRParaSailsGetLoadbal(HYPRE_Solver solver, HYPRE_Real * loadbal ) { #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"ParaSails not usable in mixedint mode!"); + HYPRE_UNUSED_VAR(solver); + HYPRE_UNUSED_VAR(loadbal); + + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ParaSails not usable in mixedint mode!"); return hypre_error_flag; #else - + Secret *secret = (Secret *) solver; *loadbal = secret->loadbal; @@ -318,14 +351,17 @@ HYPRE_ParCSRParaSailsGetLoadbal(HYPRE_Solver solver, *--------------------------------------------------------------------------*/ HYPRE_Int -HYPRE_ParCSRParaSailsSetReuse(HYPRE_Solver solver, +HYPRE_ParCSRParaSailsSetReuse(HYPRE_Solver solver, HYPRE_Int reuse ) { #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"ParaSails not usable in mixedint mode!"); + HYPRE_UNUSED_VAR(solver); + HYPRE_UNUSED_VAR(reuse); + + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ParaSails not usable in mixedint mode!"); return hypre_error_flag; #else - + Secret *secret = (Secret *) solver; secret->reuse = reuse; @@ -339,14 +375,17 @@ HYPRE_ParCSRParaSailsSetReuse(HYPRE_Solver solver, *--------------------------------------------------------------------------*/ HYPRE_Int -HYPRE_ParCSRParaSailsSetLogging(HYPRE_Solver solver, +HYPRE_ParCSRParaSailsSetLogging(HYPRE_Solver solver, HYPRE_Int logging ) { #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"ParaSails not usable in mixedint mode!"); + HYPRE_UNUSED_VAR(solver); + HYPRE_UNUSED_VAR(logging); + + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ParaSails not usable in mixedint mode!"); return hypre_error_flag; #else - + Secret *secret = (Secret *) solver; secret->logging = logging; @@ -362,21 +401,24 @@ HYPRE_ParCSRParaSailsSetLogging(HYPRE_Solver solver, *****************************************************************************/ /*-------------------------------------------------------------------------- - * HYPRE_ParaSailsCreate - Return a ParaSails preconditioner object + * HYPRE_ParaSailsCreate - Return a ParaSails preconditioner object * "solver". The default parameters for the preconditioner are also set, * so a call to HYPRE_ParaSailsSetParams is not absolutely necessary. *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_ParaSailsCreate( MPI_Comm comm, HYPRE_Solver *solver ) { #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"ParaSails not usable in mixedint mode!"); + HYPRE_UNUSED_VAR(solver); + HYPRE_UNUSED_VAR(comm); + + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ParaSails not usable in mixedint mode!"); return hypre_error_flag; #else - + Secret *secret; - + secret = hypre_TAlloc(Secret, 1, HYPRE_MEMORY_HOST); if (secret == NULL) @@ -406,20 +448,22 @@ HYPRE_ParaSailsCreate( MPI_Comm comm, HYPRE_Solver *solver ) * HYPRE_ParaSailsDestroy - Destroy a ParaSails object. *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_ParaSailsDestroy( HYPRE_Solver solver ) { #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"ParaSails not usable in mixedint mode!"); + HYPRE_UNUSED_VAR(solver); + + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ParaSails not usable in mixedint mode!"); return hypre_error_flag; #else - + Secret *secret; secret = (Secret *) solver; hypre_ParaSailsDestroy(secret->obj); - hypre_TFree(secret,HYPRE_MEMORY_HOST); + hypre_TFree(secret, HYPRE_MEMORY_HOST); return hypre_error_flag; #endif @@ -427,21 +471,26 @@ HYPRE_ParaSailsDestroy( HYPRE_Solver solver ) /*-------------------------------------------------------------------------- * HYPRE_ParaSailsSetup - Set up function for ParaSails. - * This function is not called on subsequent times if the preconditioner is + * This function is not called on subsequent times if the preconditioner is * being reused. *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_ParaSailsSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) { + HYPRE_UNUSED_VAR(b); + HYPRE_UNUSED_VAR(x); + #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"ParaSails not usable in mixedint mode!"); + HYPRE_UNUSED_VAR(solver); + HYPRE_UNUSED_VAR(A); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ParaSails not usable in mixedint mode!"); return hypre_error_flag; #else - + static HYPRE_Int virgin = 1; HYPRE_DistributedMatrix mat; Secret *secret = (Secret *) solver; @@ -451,7 +500,7 @@ HYPRE_ParaSailsSetup( HYPRE_Solver solver, ierr = HYPRE_GetError(); HYPRE_ClearAllErrors(); HYPRE_ConvertParCSRMatrixToDistributedMatrix( A, &mat ); - if (hypre_error_flag) return hypre_error_flag |= ierr; + if (hypre_error_flag) { return hypre_error_flag |= ierr; } if (virgin || secret->reuse == 0) /* call set up at least once */ { @@ -459,14 +508,14 @@ HYPRE_ParaSailsSetup( HYPRE_Solver solver, hypre_ParaSailsSetup( secret->obj, mat, secret->sym, secret->thresh, secret->nlevels, secret->filter, secret->loadbal, secret->logging); - if (hypre_error_flag) return hypre_error_flag |= ierr; + if (hypre_error_flag) { return hypre_error_flag |= ierr; } } else /* reuse is true; this is a subsequent call */ { /* reuse pattern: always use filter value of 0 and loadbal of 0 */ hypre_ParaSailsSetupValues(secret->obj, mat, 0.0, 0.0, secret->logging); - if (hypre_error_flag) return hypre_error_flag |= ierr; + if (hypre_error_flag) { return hypre_error_flag |= ierr; } } HYPRE_DistributedMatrixDestroy(mat); @@ -478,17 +527,23 @@ HYPRE_ParaSailsSetup( HYPRE_Solver solver, * HYPRE_ParaSailsSolve - Solve function for ParaSails. *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_ParaSailsSolve( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) { + HYPRE_UNUSED_VAR(A); + #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"ParaSails not usable in mixedint mode!"); + HYPRE_UNUSED_VAR(solver); + HYPRE_UNUSED_VAR(b); + HYPRE_UNUSED_VAR(x); + + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ParaSails not usable in mixedint mode!"); return hypre_error_flag; #else - + HYPRE_Real *rhs, *soln; Secret *secret = (Secret *) solver; @@ -507,15 +562,19 @@ HYPRE_ParaSailsSolve( HYPRE_Solver solver, *--------------------------------------------------------------------------*/ HYPRE_Int -HYPRE_ParaSailsSetParams(HYPRE_Solver solver, +HYPRE_ParaSailsSetParams(HYPRE_Solver solver, HYPRE_Real thresh, HYPRE_Int nlevels ) { #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"ParaSails not usable in mixedint mode!"); + HYPRE_UNUSED_VAR(solver); + HYPRE_UNUSED_VAR(thresh); + HYPRE_UNUSED_VAR(nlevels); + + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ParaSails not usable in mixedint mode!"); return hypre_error_flag; #else - + Secret *secret = (Secret *) solver; secret->thresh = thresh; @@ -532,14 +591,17 @@ HYPRE_ParaSailsSetParams(HYPRE_Solver solver, *--------------------------------------------------------------------------*/ HYPRE_Int -HYPRE_ParaSailsSetThresh( HYPRE_Solver solver, +HYPRE_ParaSailsSetThresh( HYPRE_Solver solver, HYPRE_Real thresh ) { #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"ParaSails not usable in mixedint mode!"); + HYPRE_UNUSED_VAR(solver); + HYPRE_UNUSED_VAR(thresh); + + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ParaSails not usable in mixedint mode!"); return hypre_error_flag; #else - + Secret *secret = (Secret *) solver; secret->thresh = thresh; @@ -549,14 +611,17 @@ HYPRE_ParaSailsSetThresh( HYPRE_Solver solver, } HYPRE_Int -HYPRE_ParaSailsGetThresh( HYPRE_Solver solver, +HYPRE_ParaSailsGetThresh( HYPRE_Solver solver, HYPRE_Real * thresh ) { #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"ParaSails not usable in mixedint mode!"); + HYPRE_UNUSED_VAR(solver); + HYPRE_UNUSED_VAR(thresh); + + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ParaSails not usable in mixedint mode!"); return hypre_error_flag; #else - + Secret *secret = (Secret *) solver; *thresh = secret->thresh; @@ -572,14 +637,17 @@ HYPRE_ParaSailsGetThresh( HYPRE_Solver solver, *--------------------------------------------------------------------------*/ HYPRE_Int -HYPRE_ParaSailsSetNlevels( HYPRE_Solver solver, +HYPRE_ParaSailsSetNlevels( HYPRE_Solver solver, HYPRE_Int nlevels ) { #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"ParaSails not usable in mixedint mode!"); + HYPRE_UNUSED_VAR(solver); + HYPRE_UNUSED_VAR(nlevels); + + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ParaSails not usable in mixedint mode!"); return hypre_error_flag; #else - + Secret *secret = (Secret *) solver; secret->nlevels = nlevels; @@ -589,14 +657,17 @@ HYPRE_ParaSailsSetNlevels( HYPRE_Solver solver, } HYPRE_Int -HYPRE_ParaSailsGetNlevels( HYPRE_Solver solver, +HYPRE_ParaSailsGetNlevels( HYPRE_Solver solver, HYPRE_Int * nlevels ) { #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"ParaSails not usable in mixedint mode!"); + HYPRE_UNUSED_VAR(solver); + HYPRE_UNUSED_VAR(nlevels); + + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ParaSails not usable in mixedint mode!"); return hypre_error_flag; #else - + Secret *secret = (Secret *) solver; *nlevels = secret->nlevels; @@ -611,14 +682,17 @@ HYPRE_ParaSailsGetNlevels( HYPRE_Solver solver, *--------------------------------------------------------------------------*/ HYPRE_Int -HYPRE_ParaSailsSetFilter(HYPRE_Solver solver, +HYPRE_ParaSailsSetFilter(HYPRE_Solver solver, HYPRE_Real filter ) { #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"ParaSails not usable in mixedint mode!"); + HYPRE_UNUSED_VAR(solver); + HYPRE_UNUSED_VAR(filter); + + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ParaSails not usable in mixedint mode!"); return hypre_error_flag; #else - + Secret *secret = (Secret *) solver; secret->filter = filter; @@ -628,14 +702,17 @@ HYPRE_ParaSailsSetFilter(HYPRE_Solver solver, } HYPRE_Int -HYPRE_ParaSailsGetFilter(HYPRE_Solver solver, +HYPRE_ParaSailsGetFilter(HYPRE_Solver solver, HYPRE_Real * filter ) { #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"ParaSails not usable in mixedint mode!"); + HYPRE_UNUSED_VAR(solver); + HYPRE_UNUSED_VAR(filter); + + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ParaSails not usable in mixedint mode!"); return hypre_error_flag; #else - + Secret *secret = (Secret *) solver; *filter = secret->filter; @@ -651,14 +728,17 @@ HYPRE_ParaSailsGetFilter(HYPRE_Solver solver, *--------------------------------------------------------------------------*/ HYPRE_Int -HYPRE_ParaSailsSetSym(HYPRE_Solver solver, +HYPRE_ParaSailsSetSym(HYPRE_Solver solver, HYPRE_Int sym ) { #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"ParaSails not usable in mixedint mode!"); + HYPRE_UNUSED_VAR(solver); + HYPRE_UNUSED_VAR(sym); + + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ParaSails not usable in mixedint mode!"); return hypre_error_flag; #else - + Secret *secret = (Secret *) solver; secret->sym = sym; @@ -668,14 +748,17 @@ HYPRE_ParaSailsSetSym(HYPRE_Solver solver, } HYPRE_Int -HYPRE_ParaSailsGetSym(HYPRE_Solver solver, +HYPRE_ParaSailsGetSym(HYPRE_Solver solver, HYPRE_Int * sym ) { #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"ParaSails not usable in mixedint mode!"); + HYPRE_UNUSED_VAR(solver); + HYPRE_UNUSED_VAR(sym); + + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ParaSails not usable in mixedint mode!"); return hypre_error_flag; #else - + Secret *secret = (Secret *) solver; *sym = secret->sym; @@ -689,14 +772,17 @@ HYPRE_ParaSailsGetSym(HYPRE_Solver solver, *--------------------------------------------------------------------------*/ HYPRE_Int -HYPRE_ParaSailsSetLoadbal(HYPRE_Solver solver, +HYPRE_ParaSailsSetLoadbal(HYPRE_Solver solver, HYPRE_Real loadbal ) { #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"ParaSails not usable in mixedint mode!"); + HYPRE_UNUSED_VAR(solver); + HYPRE_UNUSED_VAR(loadbal); + + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ParaSails not usable in mixedint mode!"); return hypre_error_flag; #else - + Secret *secret = (Secret *) solver; secret->loadbal = loadbal; @@ -706,14 +792,17 @@ HYPRE_ParaSailsSetLoadbal(HYPRE_Solver solver, } HYPRE_Int -HYPRE_ParaSailsGetLoadbal(HYPRE_Solver solver, +HYPRE_ParaSailsGetLoadbal(HYPRE_Solver solver, HYPRE_Real * loadbal ) { #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"ParaSails not usable in mixedint mode!"); + HYPRE_UNUSED_VAR(solver); + HYPRE_UNUSED_VAR(loadbal); + + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ParaSails not usable in mixedint mode!"); return hypre_error_flag; #else - + Secret *secret = (Secret *) solver; *loadbal = secret->loadbal; @@ -728,14 +817,17 @@ HYPRE_ParaSailsGetLoadbal(HYPRE_Solver solver, *--------------------------------------------------------------------------*/ HYPRE_Int -HYPRE_ParaSailsSetReuse(HYPRE_Solver solver, +HYPRE_ParaSailsSetReuse(HYPRE_Solver solver, HYPRE_Int reuse ) { #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"ParaSails not usable in mixedint mode!"); + HYPRE_UNUSED_VAR(solver); + HYPRE_UNUSED_VAR(reuse); + + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ParaSails not usable in mixedint mode!"); return hypre_error_flag; #else - + Secret *secret = (Secret *) solver; secret->reuse = reuse; @@ -745,14 +837,17 @@ HYPRE_ParaSailsSetReuse(HYPRE_Solver solver, } HYPRE_Int -HYPRE_ParaSailsGetReuse(HYPRE_Solver solver, +HYPRE_ParaSailsGetReuse(HYPRE_Solver solver, HYPRE_Int * reuse ) { #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"ParaSails not usable in mixedint mode!"); + HYPRE_UNUSED_VAR(solver); + HYPRE_UNUSED_VAR(reuse); + + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ParaSails not usable in mixedint mode!"); return hypre_error_flag; #else - + Secret *secret = (Secret *) solver; *reuse = secret->reuse; @@ -766,14 +861,17 @@ HYPRE_ParaSailsGetReuse(HYPRE_Solver solver, *--------------------------------------------------------------------------*/ HYPRE_Int -HYPRE_ParaSailsSetLogging(HYPRE_Solver solver, +HYPRE_ParaSailsSetLogging(HYPRE_Solver solver, HYPRE_Int logging ) { #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"ParaSails not usable in mixedint mode!"); + HYPRE_UNUSED_VAR(solver); + HYPRE_UNUSED_VAR(logging); + + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ParaSails not usable in mixedint mode!"); return hypre_error_flag; #else - + Secret *secret = (Secret *) solver; secret->logging = logging; @@ -783,14 +881,17 @@ HYPRE_ParaSailsSetLogging(HYPRE_Solver solver, } HYPRE_Int -HYPRE_ParaSailsGetLogging(HYPRE_Solver solver, +HYPRE_ParaSailsGetLogging(HYPRE_Solver solver, HYPRE_Int * logging ) { #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"ParaSails not usable in mixedint mode!"); + HYPRE_UNUSED_VAR(solver); + HYPRE_UNUSED_VAR(logging); + + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ParaSails not usable in mixedint mode!"); return hypre_error_flag; #else - + Secret *secret = (Secret *) solver; *logging = secret->logging; @@ -806,14 +907,17 @@ HYPRE_Int HYPRE_ParaSailsBuildIJMatrix(HYPRE_Solver solver, HYPRE_IJMatrix *pij_A) { #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"ParaSails not usable in mixedint mode!"); + HYPRE_UNUSED_VAR(solver); + HYPRE_UNUSED_VAR(pij_A); + + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ParaSails not usable in mixedint mode!"); return hypre_error_flag; #else - + Secret *secret = (Secret *) solver; hypre_ParaSailsBuildIJMatrix(secret->obj, pij_A); - + return hypre_error_flag; #endif } diff --git a/external/hypre/src/parcsr_ls/HYPRE_parcsr_amg.c b/external/hypre/src/parcsr_ls/HYPRE_parcsr_amg.c index 6ed00417..5c8dfd45 100644 --- a/external/hypre/src/parcsr_ls/HYPRE_parcsr_amg.c +++ b/external/hypre/src/parcsr_ls/HYPRE_parcsr_amg.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -31,7 +31,7 @@ HYPRE_BoomerAMGCreate( HYPRE_Solver *solver) HYPRE_Int HYPRE_BoomerAMGDestroy( HYPRE_Solver solver ) { - return( hypre_BoomerAMGDestroy( (void *) solver ) ); + return ( hypre_BoomerAMGDestroy( (void *) solver ) ); } /*-------------------------------------------------------------------------- @@ -44,10 +44,16 @@ HYPRE_BoomerAMGSetup( HYPRE_Solver solver, HYPRE_ParVector b, HYPRE_ParVector x ) { - return( hypre_BoomerAMGSetup( (void *) solver, - (hypre_ParCSRMatrix *) A, - (hypre_ParVector *) b, - (hypre_ParVector *) x ) ); + if (!A) + { + hypre_error_in_arg(2); + return hypre_error_flag; + } + + return ( hypre_BoomerAMGSetup( (void *) solver, + (hypre_ParCSRMatrix *) A, + (hypre_ParVector *) b, + (hypre_ParVector *) x ) ); } /*-------------------------------------------------------------------------- @@ -60,12 +66,28 @@ HYPRE_BoomerAMGSolve( HYPRE_Solver solver, HYPRE_ParVector b, HYPRE_ParVector x ) { + if (!A) + { + hypre_error_in_arg(2); + return hypre_error_flag; + } + if (!b) + { + hypre_error_in_arg(3); + return hypre_error_flag; + } + + if (!x) + { + hypre_error_in_arg(4); + return hypre_error_flag; + } - return( hypre_BoomerAMGSolve( (void *) solver, - (hypre_ParCSRMatrix *) A, - (hypre_ParVector *) b, - (hypre_ParVector *) x ) ); + return ( hypre_BoomerAMGSolve( (void *) solver, + (hypre_ParCSRMatrix *) A, + (hypre_ParVector *) b, + (hypre_ParVector *) x ) ); } /*-------------------------------------------------------------------------- @@ -78,12 +100,28 @@ HYPRE_BoomerAMGSolveT( HYPRE_Solver solver, HYPRE_ParVector b, HYPRE_ParVector x ) { + if (!A) + { + hypre_error_in_arg(2); + return hypre_error_flag; + } + if (!b) + { + hypre_error_in_arg(3); + return hypre_error_flag; + } - return( hypre_BoomerAMGSolveT( (void *) solver, - (hypre_ParCSRMatrix *) A, - (hypre_ParVector *) b, - (hypre_ParVector *) x ) ); + if (!x) + { + hypre_error_in_arg(4); + return hypre_error_flag; + } + + return ( hypre_BoomerAMGSolveT( (void *) solver, + (hypre_ParCSRMatrix *) A, + (hypre_ParVector *) b, + (hypre_ParVector *) x ) ); } /*-------------------------------------------------------------------------- @@ -94,7 +132,7 @@ HYPRE_Int HYPRE_BoomerAMGSetRestriction( HYPRE_Solver solver, HYPRE_Int restr_par ) { - return( hypre_BoomerAMGSetRestriction( (void *) solver, restr_par ) ); + return ( hypre_BoomerAMGSetRestriction( (void *) solver, restr_par ) ); } /*-------------------------------------------------------------------------- @@ -105,7 +143,7 @@ HYPRE_Int HYPRE_BoomerAMGSetIsTriangular( HYPRE_Solver solver, HYPRE_Int is_triangular ) { - return( hypre_BoomerAMGSetIsTriangular( (void *) solver, is_triangular ) ); + return ( hypre_BoomerAMGSetIsTriangular( (void *) solver, is_triangular ) ); } /*-------------------------------------------------------------------------- @@ -116,7 +154,7 @@ HYPRE_Int HYPRE_BoomerAMGSetGMRESSwitchR( HYPRE_Solver solver, HYPRE_Int gmres_switch ) { - return( hypre_BoomerAMGSetGMRESSwitchR( (void *) solver, gmres_switch ) ); + return ( hypre_BoomerAMGSetGMRESSwitchR( (void *) solver, gmres_switch ) ); } /*-------------------------------------------------------------------------- @@ -127,14 +165,14 @@ HYPRE_Int HYPRE_BoomerAMGSetMaxLevels( HYPRE_Solver solver, HYPRE_Int max_levels ) { - return( hypre_BoomerAMGSetMaxLevels( (void *) solver, max_levels ) ); + return ( hypre_BoomerAMGSetMaxLevels( (void *) solver, max_levels ) ); } HYPRE_Int HYPRE_BoomerAMGGetMaxLevels( HYPRE_Solver solver, HYPRE_Int * max_levels ) { - return( hypre_BoomerAMGGetMaxLevels( (void *) solver, max_levels ) ); + return ( hypre_BoomerAMGGetMaxLevels( (void *) solver, max_levels ) ); } /*-------------------------------------------------------------------------- @@ -145,14 +183,14 @@ HYPRE_Int HYPRE_BoomerAMGSetMaxCoarseSize( HYPRE_Solver solver, HYPRE_Int max_coarse_size ) { - return( hypre_BoomerAMGSetMaxCoarseSize( (void *) solver, max_coarse_size ) ); + return ( hypre_BoomerAMGSetMaxCoarseSize( (void *) solver, max_coarse_size ) ); } HYPRE_Int HYPRE_BoomerAMGGetMaxCoarseSize( HYPRE_Solver solver, HYPRE_Int * max_coarse_size ) { - return( hypre_BoomerAMGGetMaxCoarseSize( (void *) solver, max_coarse_size ) ); + return ( hypre_BoomerAMGGetMaxCoarseSize( (void *) solver, max_coarse_size ) ); } /*-------------------------------------------------------------------------- @@ -163,14 +201,14 @@ HYPRE_Int HYPRE_BoomerAMGSetMinCoarseSize( HYPRE_Solver solver, HYPRE_Int min_coarse_size ) { - return( hypre_BoomerAMGSetMinCoarseSize( (void *) solver, min_coarse_size ) ); + return ( hypre_BoomerAMGSetMinCoarseSize( (void *) solver, min_coarse_size ) ); } HYPRE_Int HYPRE_BoomerAMGGetMinCoarseSize( HYPRE_Solver solver, HYPRE_Int * min_coarse_size ) { - return( hypre_BoomerAMGGetMinCoarseSize( (void *) solver, min_coarse_size ) ); + return ( hypre_BoomerAMGGetMinCoarseSize( (void *) solver, min_coarse_size ) ); } /*-------------------------------------------------------------------------- @@ -181,14 +219,14 @@ HYPRE_Int HYPRE_BoomerAMGSetSeqThreshold( HYPRE_Solver solver, HYPRE_Int seq_threshold ) { - return( hypre_BoomerAMGSetSeqThreshold( (void *) solver, seq_threshold ) ); + return ( hypre_BoomerAMGSetSeqThreshold( (void *) solver, seq_threshold ) ); } HYPRE_Int HYPRE_BoomerAMGGetSeqThreshold( HYPRE_Solver solver, HYPRE_Int * seq_threshold ) { - return( hypre_BoomerAMGGetSeqThreshold( (void *) solver, seq_threshold ) ); + return ( hypre_BoomerAMGGetSeqThreshold( (void *) solver, seq_threshold ) ); } /*-------------------------------------------------------------------------- @@ -197,16 +235,16 @@ HYPRE_BoomerAMGGetSeqThreshold( HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetRedundant( HYPRE_Solver solver, - HYPRE_Int redundant ) + HYPRE_Int redundant ) { - return( hypre_BoomerAMGSetRedundant( (void *) solver, redundant ) ); + return ( hypre_BoomerAMGSetRedundant( (void *) solver, redundant ) ); } HYPRE_Int HYPRE_BoomerAMGGetRedundant( HYPRE_Solver solver, - HYPRE_Int * redundant ) + HYPRE_Int * redundant ) { - return( hypre_BoomerAMGGetRedundant( (void *) solver, redundant ) ); + return ( hypre_BoomerAMGGetRedundant( (void *) solver, redundant ) ); } /*-------------------------------------------------------------------------- @@ -217,14 +255,14 @@ HYPRE_Int HYPRE_BoomerAMGSetCoarsenCutFactor( HYPRE_Solver solver, HYPRE_Int coarsen_cut_factor ) { - return( hypre_BoomerAMGSetCoarsenCutFactor( (void *) solver, coarsen_cut_factor ) ); + return ( hypre_BoomerAMGSetCoarsenCutFactor( (void *) solver, coarsen_cut_factor ) ); } HYPRE_Int HYPRE_BoomerAMGGetCoarsenCutFactor( HYPRE_Solver solver, HYPRE_Int *coarsen_cut_factor ) { - return( hypre_BoomerAMGGetCoarsenCutFactor( (void *) solver, coarsen_cut_factor ) ); + return ( hypre_BoomerAMGGetCoarsenCutFactor( (void *) solver, coarsen_cut_factor ) ); } /*-------------------------------------------------------------------------- @@ -235,48 +273,48 @@ HYPRE_Int HYPRE_BoomerAMGSetStrongThreshold( HYPRE_Solver solver, HYPRE_Real strong_threshold ) { - return( hypre_BoomerAMGSetStrongThreshold( (void *) solver, - strong_threshold ) ); + return ( hypre_BoomerAMGSetStrongThreshold( (void *) solver, + strong_threshold ) ); } HYPRE_Int HYPRE_BoomerAMGGetStrongThreshold( HYPRE_Solver solver, HYPRE_Real * strong_threshold ) { - return( hypre_BoomerAMGGetStrongThreshold( (void *) solver, - strong_threshold ) ); + return ( hypre_BoomerAMGGetStrongThreshold( (void *) solver, + strong_threshold ) ); } HYPRE_Int HYPRE_BoomerAMGSetStrongThresholdR( HYPRE_Solver solver, HYPRE_Real strong_threshold ) { - return( hypre_BoomerAMGSetStrongThresholdR( (void *) solver, - strong_threshold ) ); + return ( hypre_BoomerAMGSetStrongThresholdR( (void *) solver, + strong_threshold ) ); } HYPRE_Int HYPRE_BoomerAMGGetStrongThresholdR( HYPRE_Solver solver, HYPRE_Real * strong_threshold ) { - return( hypre_BoomerAMGGetStrongThresholdR( (void *) solver, - strong_threshold ) ); + return ( hypre_BoomerAMGGetStrongThresholdR( (void *) solver, + strong_threshold ) ); } HYPRE_Int HYPRE_BoomerAMGSetFilterThresholdR( HYPRE_Solver solver, HYPRE_Real filter_threshold ) { - return( hypre_BoomerAMGSetFilterThresholdR( (void *) solver, - filter_threshold ) ); + return ( hypre_BoomerAMGSetFilterThresholdR( (void *) solver, + filter_threshold ) ); } HYPRE_Int HYPRE_BoomerAMGGetFilterThresholdR( HYPRE_Solver solver, HYPRE_Real * filter_threshold ) { - return( hypre_BoomerAMGGetFilterThresholdR( (void *) solver, - filter_threshold ) ); + return ( hypre_BoomerAMGGetFilterThresholdR( (void *) solver, + filter_threshold ) ); } @@ -284,8 +322,8 @@ HYPRE_Int HYPRE_BoomerAMGSetSabs( HYPRE_Solver solver, HYPRE_Int Sabs ) { - return( hypre_BoomerAMGSetSabs( (void *) solver, - Sabs ) ); + return ( hypre_BoomerAMGSetSabs( (void *) solver, + Sabs ) ); } /*-------------------------------------------------------------------------- @@ -296,16 +334,16 @@ HYPRE_Int HYPRE_BoomerAMGSetMaxRowSum( HYPRE_Solver solver, HYPRE_Real max_row_sum ) { - return( hypre_BoomerAMGSetMaxRowSum( (void *) solver, - max_row_sum ) ); + return ( hypre_BoomerAMGSetMaxRowSum( (void *) solver, + max_row_sum ) ); } HYPRE_Int HYPRE_BoomerAMGGetMaxRowSum( HYPRE_Solver solver, HYPRE_Real * max_row_sum ) { - return( hypre_BoomerAMGGetMaxRowSum( (void *) solver, - max_row_sum ) ); + return ( hypre_BoomerAMGGetMaxRowSum( (void *) solver, + max_row_sum ) ); } /*-------------------------------------------------------------------------- @@ -316,16 +354,16 @@ HYPRE_Int HYPRE_BoomerAMGSetTruncFactor( HYPRE_Solver solver, HYPRE_Real trunc_factor ) { - return( hypre_BoomerAMGSetTruncFactor( (void *) solver, - trunc_factor ) ); + return ( hypre_BoomerAMGSetTruncFactor( (void *) solver, + trunc_factor ) ); } HYPRE_Int HYPRE_BoomerAMGGetTruncFactor( HYPRE_Solver solver, HYPRE_Real * trunc_factor ) { - return( hypre_BoomerAMGGetTruncFactor( (void *) solver, - trunc_factor ) ); + return ( hypre_BoomerAMGGetTruncFactor( (void *) solver, + trunc_factor ) ); } /*-------------------------------------------------------------------------- @@ -336,16 +374,16 @@ HYPRE_Int HYPRE_BoomerAMGSetPMaxElmts( HYPRE_Solver solver, HYPRE_Int P_max_elmts ) { - return( hypre_BoomerAMGSetPMaxElmts( (void *) solver, - P_max_elmts ) ); + return ( hypre_BoomerAMGSetPMaxElmts( (void *) solver, + P_max_elmts ) ); } HYPRE_Int HYPRE_BoomerAMGGetPMaxElmts( HYPRE_Solver solver, HYPRE_Int * P_max_elmts ) { - return( hypre_BoomerAMGGetPMaxElmts( (void *) solver, - P_max_elmts ) ); + return ( hypre_BoomerAMGGetPMaxElmts( (void *) solver, + P_max_elmts ) ); } /*-------------------------------------------------------------------------- @@ -356,16 +394,16 @@ HYPRE_Int HYPRE_BoomerAMGSetJacobiTruncThreshold( HYPRE_Solver solver, HYPRE_Real jacobi_trunc_threshold ) { - return( hypre_BoomerAMGSetJacobiTruncThreshold( (void *) solver, - jacobi_trunc_threshold ) ); + return ( hypre_BoomerAMGSetJacobiTruncThreshold( (void *) solver, + jacobi_trunc_threshold ) ); } HYPRE_Int HYPRE_BoomerAMGGetJacobiTruncThreshold( HYPRE_Solver solver, HYPRE_Real * jacobi_trunc_threshold ) { - return( hypre_BoomerAMGGetJacobiTruncThreshold( (void *) solver, - jacobi_trunc_threshold ) ); + return ( hypre_BoomerAMGGetJacobiTruncThreshold( (void *) solver, + jacobi_trunc_threshold ) ); } /*-------------------------------------------------------------------------- @@ -378,16 +416,16 @@ HYPRE_Int HYPRE_BoomerAMGSetPostInterpType( HYPRE_Solver solver, HYPRE_Int post_interp_type ) { - return( hypre_BoomerAMGSetPostInterpType( (void *) solver, - post_interp_type ) ); + return ( hypre_BoomerAMGSetPostInterpType( (void *) solver, + post_interp_type ) ); } HYPRE_Int HYPRE_BoomerAMGGetPostInterpType( HYPRE_Solver solver, HYPRE_Int * post_interp_type ) { - return( hypre_BoomerAMGGetPostInterpType( (void *) solver, - post_interp_type ) ); + return ( hypre_BoomerAMGGetPostInterpType( (void *) solver, + post_interp_type ) ); } @@ -399,6 +437,9 @@ HYPRE_Int HYPRE_BoomerAMGSetSCommPkgSwitch( HYPRE_Solver solver, HYPRE_Real S_commpkg_switch ) { + HYPRE_UNUSED_VAR(solver); + HYPRE_UNUSED_VAR(S_commpkg_switch); + return 0; } @@ -410,7 +451,7 @@ HYPRE_Int HYPRE_BoomerAMGSetInterpType( HYPRE_Solver solver, HYPRE_Int interp_type ) { - return( hypre_BoomerAMGSetInterpType( (void *) solver, interp_type ) ); + return ( hypre_BoomerAMGSetInterpType( (void *) solver, interp_type ) ); } /*-------------------------------------------------------------------------- @@ -421,7 +462,7 @@ HYPRE_Int HYPRE_BoomerAMGSetSepWeight( HYPRE_Solver solver, HYPRE_Int sep_weight ) { - return( hypre_BoomerAMGSetSepWeight( (void *) solver, sep_weight ) ); + return ( hypre_BoomerAMGSetSepWeight( (void *) solver, sep_weight ) ); } /*-------------------------------------------------------------------------- @@ -432,7 +473,7 @@ HYPRE_Int HYPRE_BoomerAMGSetMinIter( HYPRE_Solver solver, HYPRE_Int min_iter ) { - return( hypre_BoomerAMGSetMinIter( (void *) solver, min_iter ) ); + return ( hypre_BoomerAMGSetMinIter( (void *) solver, min_iter ) ); } /*-------------------------------------------------------------------------- @@ -443,14 +484,14 @@ HYPRE_Int HYPRE_BoomerAMGSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ) { - return( hypre_BoomerAMGSetMaxIter( (void *) solver, max_iter ) ); + return ( hypre_BoomerAMGSetMaxIter( (void *) solver, max_iter ) ); } HYPRE_Int HYPRE_BoomerAMGGetMaxIter( HYPRE_Solver solver, HYPRE_Int * max_iter ) { - return( hypre_BoomerAMGGetMaxIter( (void *) solver, max_iter ) ); + return ( hypre_BoomerAMGGetMaxIter( (void *) solver, max_iter ) ); } /*-------------------------------------------------------------------------- @@ -461,14 +502,14 @@ HYPRE_Int HYPRE_BoomerAMGSetCoarsenType( HYPRE_Solver solver, HYPRE_Int coarsen_type ) { - return( hypre_BoomerAMGSetCoarsenType( (void *) solver, coarsen_type ) ); + return ( hypre_BoomerAMGSetCoarsenType( (void *) solver, coarsen_type ) ); } HYPRE_Int HYPRE_BoomerAMGGetCoarsenType( HYPRE_Solver solver, HYPRE_Int * coarsen_type ) { - return( hypre_BoomerAMGGetCoarsenType( (void *) solver, coarsen_type ) ); + return ( hypre_BoomerAMGGetCoarsenType( (void *) solver, coarsen_type ) ); } /*-------------------------------------------------------------------------- @@ -479,14 +520,14 @@ HYPRE_Int HYPRE_BoomerAMGSetMeasureType( HYPRE_Solver solver, HYPRE_Int measure_type ) { - return( hypre_BoomerAMGSetMeasureType( (void *) solver, measure_type ) ); + return ( hypre_BoomerAMGSetMeasureType( (void *) solver, measure_type ) ); } HYPRE_Int HYPRE_BoomerAMGGetMeasureType( HYPRE_Solver solver, HYPRE_Int * measure_type ) { - return( hypre_BoomerAMGGetMeasureType( (void *) solver, measure_type ) ); + return ( hypre_BoomerAMGGetMeasureType( (void *) solver, measure_type ) ); } /*-------------------------------------------------------------------------- @@ -510,7 +551,7 @@ HYPRE_Int HYPRE_BoomerAMGSetSetupType( HYPRE_Solver solver, HYPRE_Int setup_type ) { - return( hypre_BoomerAMGSetSetupType( (void *) solver, setup_type ) ); + return ( hypre_BoomerAMGSetSetupType( (void *) solver, setup_type ) ); } /*-------------------------------------------------------------------------- @@ -521,14 +562,14 @@ HYPRE_Int HYPRE_BoomerAMGSetCycleType( HYPRE_Solver solver, HYPRE_Int cycle_type ) { - return( hypre_BoomerAMGSetCycleType( (void *) solver, cycle_type ) ); + return ( hypre_BoomerAMGSetCycleType( (void *) solver, cycle_type ) ); } HYPRE_Int HYPRE_BoomerAMGGetCycleType( HYPRE_Solver solver, HYPRE_Int * cycle_type ) { - return( hypre_BoomerAMGGetCycleType( (void *) solver, cycle_type ) ); + return ( hypre_BoomerAMGGetCycleType( (void *) solver, cycle_type ) ); } /*-------------------------------------------------------------------------- @@ -539,14 +580,14 @@ HYPRE_Int HYPRE_BoomerAMGSetFCycle( HYPRE_Solver solver, HYPRE_Int fcycle ) { - return( hypre_BoomerAMGSetFCycle( (void *) solver, fcycle ) ); + return ( hypre_BoomerAMGSetFCycle( (void *) solver, fcycle ) ); } HYPRE_Int HYPRE_BoomerAMGGetFCycle( HYPRE_Solver solver, HYPRE_Int *fcycle ) { - return( hypre_BoomerAMGGetFCycle( (void *) solver, fcycle ) ); + return ( hypre_BoomerAMGGetFCycle( (void *) solver, fcycle ) ); } /*-------------------------------------------------------------------------- @@ -557,14 +598,14 @@ HYPRE_Int HYPRE_BoomerAMGSetConvergeType( HYPRE_Solver solver, HYPRE_Int type ) { - return( hypre_BoomerAMGSetConvergeType( (void *) solver, type ) ); + return ( hypre_BoomerAMGSetConvergeType( (void *) solver, type ) ); } HYPRE_Int HYPRE_BoomerAMGGetConvergeType( HYPRE_Solver solver, HYPRE_Int *type ) { - return( hypre_BoomerAMGGetConvergeType( (void *) solver, type ) ); + return ( hypre_BoomerAMGGetConvergeType( (void *) solver, type ) ); } /*-------------------------------------------------------------------------- @@ -575,14 +616,14 @@ HYPRE_Int HYPRE_BoomerAMGSetTol( HYPRE_Solver solver, HYPRE_Real tol ) { - return( hypre_BoomerAMGSetTol( (void *) solver, tol ) ); + return ( hypre_BoomerAMGSetTol( (void *) solver, tol ) ); } HYPRE_Int HYPRE_BoomerAMGGetTol( HYPRE_Solver solver, HYPRE_Real * tol ) { - return( hypre_BoomerAMGGetTol( (void *) solver, tol ) ); + return ( hypre_BoomerAMGGetTol( (void *) solver, tol ) ); } /*-------------------------------------------------------------------------- @@ -596,7 +637,7 @@ HYPRE_Int HYPRE_BoomerAMGSetNumGridSweeps( HYPRE_Solver solver, HYPRE_Int *num_grid_sweeps ) { - return( hypre_BoomerAMGSetNumGridSweeps( (void *) solver, num_grid_sweeps ) ); + return ( hypre_BoomerAMGSetNumGridSweeps( (void *) solver, num_grid_sweeps ) ); } /*-------------------------------------------------------------------------- @@ -608,7 +649,7 @@ HYPRE_Int HYPRE_BoomerAMGSetNumSweeps( HYPRE_Solver solver, HYPRE_Int num_sweeps ) { - return( hypre_BoomerAMGSetNumSweeps( (void *) solver, num_sweeps ) ); + return ( hypre_BoomerAMGSetNumSweeps( (void *) solver, num_sweeps ) ); } /*-------------------------------------------------------------------------- @@ -619,14 +660,14 @@ HYPRE_Int HYPRE_BoomerAMGSetCycleNumSweeps( HYPRE_Solver solver, HYPRE_Int num_sweeps, HYPRE_Int k ) { - return( hypre_BoomerAMGSetCycleNumSweeps( (void *) solver, num_sweeps, k ) ); + return ( hypre_BoomerAMGSetCycleNumSweeps( (void *) solver, num_sweeps, k ) ); } HYPRE_Int HYPRE_BoomerAMGGetCycleNumSweeps( HYPRE_Solver solver, HYPRE_Int * num_sweeps, HYPRE_Int k ) { - return( hypre_BoomerAMGGetCycleNumSweeps( (void *) solver, num_sweeps, k ) ); + return ( hypre_BoomerAMGGetCycleNumSweeps( (void *) solver, num_sweeps, k ) ); } /*-------------------------------------------------------------------------- @@ -640,7 +681,8 @@ HYPRE_BoomerAMGInitGridRelaxation( HYPRE_Int **num_grid_sweeps_ptr, HYPRE_Int coarsen_type, HYPRE_Real **relax_weights_ptr, HYPRE_Int max_levels ) -{ HYPRE_Int i; +{ + HYPRE_Int i; HYPRE_Int *num_grid_sweeps; HYPRE_Int *grid_relax_type; HYPRE_Int **grid_relax_points; @@ -714,7 +756,9 @@ HYPRE_BoomerAMGInitGridRelaxation( HYPRE_Int **num_grid_sweeps_ptr, grid_relax_points[3][0] = 0; for (i = 0; i < max_levels; i++) + { relax_weights[i] = 1.; + } return hypre_error_flag; } @@ -730,7 +774,7 @@ HYPRE_Int HYPRE_BoomerAMGSetGridRelaxType( HYPRE_Solver solver, HYPRE_Int *grid_relax_type ) { - return( hypre_BoomerAMGSetGridRelaxType( (void *) solver, grid_relax_type ) ); + return ( hypre_BoomerAMGSetGridRelaxType( (void *) solver, grid_relax_type ) ); } /*-------------------------------------------------------------------------- @@ -741,7 +785,7 @@ HYPRE_Int HYPRE_BoomerAMGSetRelaxType( HYPRE_Solver solver, HYPRE_Int relax_type ) { - return( hypre_BoomerAMGSetRelaxType( (void *) solver, relax_type ) ); + return ( hypre_BoomerAMGSetRelaxType( (void *) solver, relax_type ) ); } /*-------------------------------------------------------------------------- @@ -752,14 +796,14 @@ HYPRE_Int HYPRE_BoomerAMGSetCycleRelaxType( HYPRE_Solver solver, HYPRE_Int relax_type, HYPRE_Int k ) { - return( hypre_BoomerAMGSetCycleRelaxType( (void *) solver, relax_type, k ) ); + return ( hypre_BoomerAMGSetCycleRelaxType( (void *) solver, relax_type, k ) ); } HYPRE_Int HYPRE_BoomerAMGGetCycleRelaxType( HYPRE_Solver solver, HYPRE_Int * relax_type, HYPRE_Int k ) { - return( hypre_BoomerAMGGetCycleRelaxType( (void *) solver, relax_type, k ) ); + return ( hypre_BoomerAMGGetCycleRelaxType( (void *) solver, relax_type, k ) ); } /*-------------------------------------------------------------------------- @@ -770,7 +814,7 @@ HYPRE_Int HYPRE_BoomerAMGSetRelaxOrder( HYPRE_Solver solver, HYPRE_Int relax_order) { - return( hypre_BoomerAMGSetRelaxOrder( (void *) solver, relax_order ) ); + return ( hypre_BoomerAMGSetRelaxOrder( (void *) solver, relax_order ) ); } /*-------------------------------------------------------------------------- @@ -784,7 +828,7 @@ HYPRE_Int HYPRE_BoomerAMGSetGridRelaxPoints( HYPRE_Solver solver, HYPRE_Int **grid_relax_points ) { - return( hypre_BoomerAMGSetGridRelaxPoints( (void *) solver, grid_relax_points ) ); + return ( hypre_BoomerAMGSetGridRelaxPoints( (void *) solver, grid_relax_points ) ); } /*-------------------------------------------------------------------------- @@ -798,7 +842,7 @@ HYPRE_Int HYPRE_BoomerAMGSetRelaxWeight( HYPRE_Solver solver, HYPRE_Real *relax_weight ) { - return( hypre_BoomerAMGSetRelaxWeight( (void *) solver, relax_weight ) ); + return ( hypre_BoomerAMGSetRelaxWeight( (void *) solver, relax_weight ) ); } /*-------------------------------------------------------------------------- @@ -809,7 +853,7 @@ HYPRE_Int HYPRE_BoomerAMGSetRelaxWt( HYPRE_Solver solver, HYPRE_Real relax_wt ) { - return( hypre_BoomerAMGSetRelaxWt( (void *) solver, relax_wt ) ); + return ( hypre_BoomerAMGSetRelaxWt( (void *) solver, relax_wt ) ); } /*-------------------------------------------------------------------------- @@ -819,9 +863,9 @@ HYPRE_BoomerAMGSetRelaxWt( HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetLevelRelaxWt( HYPRE_Solver solver, HYPRE_Real relax_wt, - HYPRE_Int level ) + HYPRE_Int level ) { - return( hypre_BoomerAMGSetLevelRelaxWt( (void *) solver, relax_wt, level ) ); + return ( hypre_BoomerAMGSetLevelRelaxWt( (void *) solver, relax_wt, level ) ); } /*-------------------------------------------------------------------------- @@ -832,7 +876,7 @@ HYPRE_Int HYPRE_BoomerAMGSetOmega( HYPRE_Solver solver, HYPRE_Real *omega ) { - return( hypre_BoomerAMGSetOmega( (void *) solver, omega ) ); + return ( hypre_BoomerAMGSetOmega( (void *) solver, omega ) ); } /*-------------------------------------------------------------------------- @@ -843,7 +887,7 @@ HYPRE_Int HYPRE_BoomerAMGSetOuterWt( HYPRE_Solver solver, HYPRE_Real outer_wt ) { - return( hypre_BoomerAMGSetOuterWt( (void *) solver, outer_wt ) ); + return ( hypre_BoomerAMGSetOuterWt( (void *) solver, outer_wt ) ); } /*-------------------------------------------------------------------------- @@ -853,9 +897,9 @@ HYPRE_BoomerAMGSetOuterWt( HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetLevelOuterWt( HYPRE_Solver solver, HYPRE_Real outer_wt, - HYPRE_Int level ) + HYPRE_Int level ) { - return( hypre_BoomerAMGSetLevelOuterWt( (void *) solver, outer_wt, level ) ); + return ( hypre_BoomerAMGSetLevelOuterWt( (void *) solver, outer_wt, level ) ); } /*-------------------------------------------------------------------------- @@ -866,14 +910,14 @@ HYPRE_Int HYPRE_BoomerAMGSetSmoothType( HYPRE_Solver solver, HYPRE_Int smooth_type ) { - return( hypre_BoomerAMGSetSmoothType( (void *) solver, smooth_type ) ); + return ( hypre_BoomerAMGSetSmoothType( (void *) solver, smooth_type ) ); } HYPRE_Int HYPRE_BoomerAMGGetSmoothType( HYPRE_Solver solver, HYPRE_Int * smooth_type ) { - return( hypre_BoomerAMGGetSmoothType( (void *) solver, smooth_type ) ); + return ( hypre_BoomerAMGGetSmoothType( (void *) solver, smooth_type ) ); } /*-------------------------------------------------------------------------- @@ -884,14 +928,14 @@ HYPRE_Int HYPRE_BoomerAMGSetSmoothNumLevels( HYPRE_Solver solver, HYPRE_Int smooth_num_levels ) { - return( hypre_BoomerAMGSetSmoothNumLevels((void *)solver,smooth_num_levels )); + return ( hypre_BoomerAMGSetSmoothNumLevels((void *)solver, smooth_num_levels )); } HYPRE_Int HYPRE_BoomerAMGGetSmoothNumLevels( HYPRE_Solver solver, HYPRE_Int * smooth_num_levels ) { - return( hypre_BoomerAMGGetSmoothNumLevels((void *)solver,smooth_num_levels )); + return ( hypre_BoomerAMGGetSmoothNumLevels((void *)solver, smooth_num_levels )); } /*-------------------------------------------------------------------------- @@ -902,14 +946,14 @@ HYPRE_Int HYPRE_BoomerAMGSetSmoothNumSweeps( HYPRE_Solver solver, HYPRE_Int smooth_num_sweeps ) { - return( hypre_BoomerAMGSetSmoothNumSweeps((void *)solver,smooth_num_sweeps )); + return ( hypre_BoomerAMGSetSmoothNumSweeps((void *)solver, smooth_num_sweeps )); } HYPRE_Int HYPRE_BoomerAMGGetSmoothNumSweeps( HYPRE_Solver solver, HYPRE_Int * smooth_num_sweeps ) { - return( hypre_BoomerAMGGetSmoothNumSweeps((void *)solver,smooth_num_sweeps )); + return ( hypre_BoomerAMGGetSmoothNumSweeps((void *)solver, smooth_num_sweeps )); } /*-------------------------------------------------------------------------- @@ -926,14 +970,14 @@ HYPRE_BoomerAMGSetLogging( HYPRE_Solver solver, It may be possible to support logging changes at other times, but there is little need. */ - return( hypre_BoomerAMGSetLogging( (void *) solver, logging ) ); + return ( hypre_BoomerAMGSetLogging( (void *) solver, logging ) ); } HYPRE_Int HYPRE_BoomerAMGGetLogging( HYPRE_Solver solver, HYPRE_Int * logging ) { - return( hypre_BoomerAMGGetLogging( (void *) solver, logging ) ); + return ( hypre_BoomerAMGGetLogging( (void *) solver, logging ) ); } /*-------------------------------------------------------------------------- @@ -944,14 +988,14 @@ HYPRE_Int HYPRE_BoomerAMGSetPrintLevel( HYPRE_Solver solver, HYPRE_Int print_level ) { - return( hypre_BoomerAMGSetPrintLevel( (void *) solver, print_level ) ); + return ( hypre_BoomerAMGSetPrintLevel( (void *) solver, print_level ) ); } HYPRE_Int HYPRE_BoomerAMGGetPrintLevel( HYPRE_Solver solver, HYPRE_Int * print_level ) { - return( hypre_BoomerAMGGetPrintLevel( (void *) solver, print_level ) ); + return ( hypre_BoomerAMGGetPrintLevel( (void *) solver, print_level ) ); } /*-------------------------------------------------------------------------- @@ -962,7 +1006,7 @@ HYPRE_Int HYPRE_BoomerAMGSetPrintFileName( HYPRE_Solver solver, const char *print_file_name ) { - return( hypre_BoomerAMGSetPrintFileName( (void *) solver, print_file_name ) ); + return ( hypre_BoomerAMGSetPrintFileName( (void *) solver, print_file_name ) ); } /*-------------------------------------------------------------------------- @@ -973,14 +1017,14 @@ HYPRE_Int HYPRE_BoomerAMGSetDebugFlag( HYPRE_Solver solver, HYPRE_Int debug_flag ) { - return( hypre_BoomerAMGSetDebugFlag( (void *) solver, debug_flag ) ); + return ( hypre_BoomerAMGSetDebugFlag( (void *) solver, debug_flag ) ); } HYPRE_Int HYPRE_BoomerAMGGetDebugFlag( HYPRE_Solver solver, HYPRE_Int * debug_flag ) { - return( hypre_BoomerAMGGetDebugFlag( (void *) solver, debug_flag ) ); + return ( hypre_BoomerAMGGetDebugFlag( (void *) solver, debug_flag ) ); } /*-------------------------------------------------------------------------- @@ -991,7 +1035,7 @@ HYPRE_Int HYPRE_BoomerAMGGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ) { - return( hypre_BoomerAMGGetNumIterations( (void *) solver, num_iterations ) ); + return ( hypre_BoomerAMGGetNumIterations( (void *) solver, num_iterations ) ); } /*-------------------------------------------------------------------------- @@ -1002,7 +1046,7 @@ HYPRE_Int HYPRE_BoomerAMGGetCumNumIterations( HYPRE_Solver solver, HYPRE_Int *cum_num_iterations ) { - return( hypre_BoomerAMGGetCumNumIterations( (void *) solver, cum_num_iterations ) ); + return ( hypre_BoomerAMGGetCumNumIterations( (void *) solver, cum_num_iterations ) ); } /*-------------------------------------------------------------------------- @@ -1025,7 +1069,7 @@ HYPRE_Int HYPRE_BoomerAMGGetFinalRelativeResidualNorm( HYPRE_Solver solver, HYPRE_Real *rel_resid_norm ) { - return( hypre_BoomerAMGGetRelResidualNorm( (void *) solver, rel_resid_norm ) ); + return ( hypre_BoomerAMGGetRelResidualNorm( (void *) solver, rel_resid_norm ) ); } /*-------------------------------------------------------------------------- @@ -1036,14 +1080,14 @@ HYPRE_Int HYPRE_BoomerAMGSetVariant( HYPRE_Solver solver, HYPRE_Int variant ) { - return( hypre_BoomerAMGSetVariant( (void *) solver, variant ) ); + return ( hypre_BoomerAMGSetVariant( (void *) solver, variant ) ); } HYPRE_Int HYPRE_BoomerAMGGetVariant( HYPRE_Solver solver, HYPRE_Int * variant ) { - return( hypre_BoomerAMGGetVariant( (void *) solver, variant ) ); + return ( hypre_BoomerAMGGetVariant( (void *) solver, variant ) ); } /*-------------------------------------------------------------------------- @@ -1054,14 +1098,14 @@ HYPRE_Int HYPRE_BoomerAMGSetOverlap( HYPRE_Solver solver, HYPRE_Int overlap ) { - return( hypre_BoomerAMGSetOverlap( (void *) solver, overlap ) ); + return ( hypre_BoomerAMGSetOverlap( (void *) solver, overlap ) ); } HYPRE_Int HYPRE_BoomerAMGGetOverlap( HYPRE_Solver solver, HYPRE_Int * overlap ) { - return( hypre_BoomerAMGGetOverlap( (void *) solver, overlap ) ); + return ( hypre_BoomerAMGGetOverlap( (void *) solver, overlap ) ); } /*-------------------------------------------------------------------------- @@ -1072,14 +1116,14 @@ HYPRE_Int HYPRE_BoomerAMGSetDomainType( HYPRE_Solver solver, HYPRE_Int domain_type ) { - return( hypre_BoomerAMGSetDomainType( (void *) solver, domain_type ) ); + return ( hypre_BoomerAMGSetDomainType( (void *) solver, domain_type ) ); } HYPRE_Int HYPRE_BoomerAMGGetDomainType( HYPRE_Solver solver, HYPRE_Int * domain_type ) { - return( hypre_BoomerAMGGetDomainType( (void *) solver, domain_type ) ); + return ( hypre_BoomerAMGGetDomainType( (void *) solver, domain_type ) ); } /*-------------------------------------------------------------------------- @@ -1090,16 +1134,16 @@ HYPRE_Int HYPRE_BoomerAMGSetSchwarzRlxWeight( HYPRE_Solver solver, HYPRE_Real schwarz_rlx_weight) { - return( hypre_BoomerAMGSetSchwarzRlxWeight( (void *) solver, - schwarz_rlx_weight ) ); + return ( hypre_BoomerAMGSetSchwarzRlxWeight( (void *) solver, + schwarz_rlx_weight ) ); } HYPRE_Int HYPRE_BoomerAMGGetSchwarzRlxWeight( HYPRE_Solver solver, HYPRE_Real * schwarz_rlx_weight) { - return( hypre_BoomerAMGGetSchwarzRlxWeight( (void *) solver, - schwarz_rlx_weight ) ); + return ( hypre_BoomerAMGGetSchwarzRlxWeight( (void *) solver, + schwarz_rlx_weight ) ); } /*-------------------------------------------------------------------------- * HYPRE_BoomerAMGSetSchwarzUseNonSymm @@ -1109,8 +1153,8 @@ HYPRE_Int HYPRE_BoomerAMGSetSchwarzUseNonSymm( HYPRE_Solver solver, HYPRE_Int use_nonsymm) { - return( hypre_BoomerAMGSetSchwarzUseNonSymm( (void *) solver, - use_nonsymm ) ); + return ( hypre_BoomerAMGSetSchwarzUseNonSymm( (void *) solver, + use_nonsymm ) ); } /*-------------------------------------------------------------------------- * HYPRE_BoomerAMGSym @@ -1120,7 +1164,7 @@ HYPRE_Int HYPRE_BoomerAMGSetSym( HYPRE_Solver solver, HYPRE_Int sym) { - return( hypre_BoomerAMGSetSym( (void *) solver, sym ) ); + return ( hypre_BoomerAMGSetSym( (void *) solver, sym ) ); } /*-------------------------------------------------------------------------- @@ -1131,7 +1175,7 @@ HYPRE_Int HYPRE_BoomerAMGSetLevel( HYPRE_Solver solver, HYPRE_Int level) { - return( hypre_BoomerAMGSetLevel( (void *) solver, level ) ); + return ( hypre_BoomerAMGSetLevel( (void *) solver, level ) ); } /*-------------------------------------------------------------------------- @@ -1142,7 +1186,7 @@ HYPRE_Int HYPRE_BoomerAMGSetThreshold( HYPRE_Solver solver, HYPRE_Real threshold ) { - return( hypre_BoomerAMGSetThreshold( (void *) solver, threshold ) ); + return ( hypre_BoomerAMGSetThreshold( (void *) solver, threshold ) ); } /*-------------------------------------------------------------------------- @@ -1153,7 +1197,7 @@ HYPRE_Int HYPRE_BoomerAMGSetFilter( HYPRE_Solver solver, HYPRE_Real filter ) { - return( hypre_BoomerAMGSetFilter( (void *) solver, filter ) ); + return ( hypre_BoomerAMGSetFilter( (void *) solver, filter ) ); } /*-------------------------------------------------------------------------- @@ -1164,7 +1208,7 @@ HYPRE_Int HYPRE_BoomerAMGSetDropTol( HYPRE_Solver solver, HYPRE_Real drop_tol ) { - return( hypre_BoomerAMGSetDropTol( (void *) solver, drop_tol ) ); + return ( hypre_BoomerAMGSetDropTol( (void *) solver, drop_tol ) ); } /*-------------------------------------------------------------------------- @@ -1175,7 +1219,7 @@ HYPRE_Int HYPRE_BoomerAMGSetMaxNzPerRow( HYPRE_Solver solver, HYPRE_Int max_nz_per_row ) { - return( hypre_BoomerAMGSetMaxNzPerRow( (void *) solver, max_nz_per_row ) ); + return ( hypre_BoomerAMGSetMaxNzPerRow( (void *) solver, max_nz_per_row ) ); } /*-------------------------------------------------------------------------- @@ -1186,7 +1230,7 @@ HYPRE_Int HYPRE_BoomerAMGSetEuclidFile( HYPRE_Solver solver, char *euclidfile) { - return( hypre_BoomerAMGSetEuclidFile( (void *) solver, euclidfile ) ); + return ( hypre_BoomerAMGSetEuclidFile( (void *) solver, euclidfile ) ); } /*-------------------------------------------------------------------------- @@ -1197,7 +1241,7 @@ HYPRE_Int HYPRE_BoomerAMGSetEuLevel( HYPRE_Solver solver, HYPRE_Int eu_level) { - return( hypre_BoomerAMGSetEuLevel( (void *) solver, eu_level ) ); + return ( hypre_BoomerAMGSetEuLevel( (void *) solver, eu_level ) ); } /*-------------------------------------------------------------------------- @@ -1208,7 +1252,7 @@ HYPRE_Int HYPRE_BoomerAMGSetEuSparseA( HYPRE_Solver solver, HYPRE_Real eu_sparse_A ) { - return( hypre_BoomerAMGSetEuSparseA( (void *) solver, eu_sparse_A ) ); + return ( hypre_BoomerAMGSetEuSparseA( (void *) solver, eu_sparse_A ) ); } /*-------------------------------------------------------------------------- @@ -1217,9 +1261,9 @@ HYPRE_BoomerAMGSetEuSparseA( HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetEuBJ( HYPRE_Solver solver, - HYPRE_Int eu_bj) + HYPRE_Int eu_bj) { - return( hypre_BoomerAMGSetEuBJ( (void *) solver, eu_bj ) ); + return ( hypre_BoomerAMGSetEuBJ( (void *) solver, eu_bj ) ); } /*-------------------------------------------------------------------------- @@ -1228,9 +1272,9 @@ HYPRE_BoomerAMGSetEuBJ( HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetILUType( HYPRE_Solver solver, - HYPRE_Int ilu_type) + HYPRE_Int ilu_type) { - return( hypre_BoomerAMGSetILUType( (void *) solver, ilu_type ) ); + return ( hypre_BoomerAMGSetILUType( (void *) solver, ilu_type ) ); } /*-------------------------------------------------------------------------- @@ -1239,9 +1283,9 @@ HYPRE_BoomerAMGSetILUType( HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetILULevel( HYPRE_Solver solver, - HYPRE_Int ilu_lfil) + HYPRE_Int ilu_lfil) { - return( hypre_BoomerAMGSetILULevel( (void *) solver, ilu_lfil ) ); + return ( hypre_BoomerAMGSetILULevel( (void *) solver, ilu_lfil ) ); } /*-------------------------------------------------------------------------- @@ -1250,9 +1294,9 @@ HYPRE_BoomerAMGSetILULevel( HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetILUMaxRowNnz( HYPRE_Solver solver, - HYPRE_Int ilu_max_row_nnz) + HYPRE_Int ilu_max_row_nnz) { - return( hypre_BoomerAMGSetILUMaxRowNnz( (void *) solver, ilu_max_row_nnz ) ); + return ( hypre_BoomerAMGSetILUMaxRowNnz( (void *) solver, ilu_max_row_nnz ) ); } /*-------------------------------------------------------------------------- @@ -1261,9 +1305,9 @@ HYPRE_BoomerAMGSetILUMaxRowNnz( HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetILUMaxIter( HYPRE_Solver solver, - HYPRE_Int ilu_max_iter) + HYPRE_Int ilu_max_iter) { - return( hypre_BoomerAMGSetILUMaxIter( (void *) solver, ilu_max_iter ) ); + return ( hypre_BoomerAMGSetILUMaxIter( (void *) solver, ilu_max_iter ) ); } /*-------------------------------------------------------------------------- @@ -1272,9 +1316,42 @@ HYPRE_BoomerAMGSetILUMaxIter( HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetILUDroptol( HYPRE_Solver solver, - HYPRE_Real ilu_droptol) + HYPRE_Real ilu_droptol) { - return( hypre_BoomerAMGSetILUDroptol( (void *) solver, ilu_droptol ) ); + return ( hypre_BoomerAMGSetILUDroptol( (void *) solver, ilu_droptol ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_BoomerAMGSetILUTriSolve + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetILUTriSolve( HYPRE_Solver solver, + HYPRE_Int ilu_tri_solve) +{ + return ( hypre_BoomerAMGSetILUTriSolve( (void *) solver, ilu_tri_solve ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_BoomerAMGSetILULowerJacobiIters + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetILULowerJacobiIters( HYPRE_Solver solver, + HYPRE_Int ilu_lower_jacobi_iters) +{ + return ( hypre_BoomerAMGSetILULowerJacobiIters( (void *) solver, ilu_lower_jacobi_iters ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_BoomerAMGSetILUUpperJacobiIters + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetILUUpperJacobiIters( HYPRE_Solver solver, + HYPRE_Int ilu_upper_jacobi_iters) +{ + return ( hypre_BoomerAMGSetILUUpperJacobiIters( (void *) solver, ilu_upper_jacobi_iters ) ); } /*-------------------------------------------------------------------------- @@ -1283,27 +1360,196 @@ HYPRE_BoomerAMGSetILUDroptol( HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetILULocalReordering( HYPRE_Solver solver, - HYPRE_Int ilu_reordering_type) + HYPRE_Int ilu_reordering_type) +{ + return ( hypre_BoomerAMGSetILULocalReordering( (void *) solver, ilu_reordering_type ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_BoomerAMGSetILUIterSetupType + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetILUIterSetupType( HYPRE_Solver solver, + HYPRE_Int ilu_iter_setup_type) +{ + return ( hypre_BoomerAMGSetILUIterSetupType( (void *) solver, ilu_iter_setup_type ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_BoomerAMGSetILUIterSetupOption + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetILUIterSetupOption( HYPRE_Solver solver, + HYPRE_Int ilu_iter_setup_option) +{ + return ( hypre_BoomerAMGSetILUIterSetupOption( (void *) solver, ilu_iter_setup_option ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_BoomerAMGSetILUIterSetupMaxIter + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetILUIterSetupMaxIter( HYPRE_Solver solver, + HYPRE_Int ilu_iter_setup_max_iter) +{ + return ( hypre_BoomerAMGSetILUIterSetupMaxIter( (void *) solver, ilu_iter_setup_max_iter ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_BoomerAMGSetILUIterSetupTolerance + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetILUIterSetupTolerance( HYPRE_Solver solver, + HYPRE_Real ilu_iter_setup_tolerance) +{ + return ( hypre_BoomerAMGSetILUIterSetupTolerance( (void *) solver, ilu_iter_setup_tolerance ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_BoomerAMGSetFSAIAlgoType + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetFSAIAlgoType( HYPRE_Solver solver, + HYPRE_Int algo_type ) +{ + return ( hypre_BoomerAMGSetFSAIAlgoType( (void *) solver, algo_type ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_BoomerAMGSetFSAILocalSolveType + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetFSAILocalSolveType( HYPRE_Solver solver, + HYPRE_Int local_solve_type ) +{ + return ( hypre_BoomerAMGSetFSAILocalSolveType( (void *) solver, local_solve_type ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_BoomerAMGSetFSAIMaxSteps + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetFSAIMaxSteps( HYPRE_Solver solver, + HYPRE_Int max_steps ) +{ + return ( hypre_BoomerAMGSetFSAIMaxSteps( (void *) solver, max_steps ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_BoomerAMGSetFSAIMaxStepSize + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetFSAIMaxStepSize( HYPRE_Solver solver, + HYPRE_Int max_step_size ) { - return( hypre_BoomerAMGSetILULocalReordering( (void *) solver, ilu_reordering_type ) ); + return ( hypre_BoomerAMGSetFSAIMaxStepSize( (void *) solver, max_step_size ) ); } /*-------------------------------------------------------------------------- - * HYPRE_BoomerAMGSetNumFunctions, HYPRE_BoomerAMGGetNumFunctions + * HYPRE_BoomerAMGSetFSAIMaxNnzRow + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetFSAIMaxNnzRow( HYPRE_Solver solver, + HYPRE_Int max_nnz_row ) +{ + return ( hypre_BoomerAMGSetFSAIMaxNnzRow( (void *) solver, max_nnz_row ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_BoomerAMGSetFSAINumLevels + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetFSAINumLevels( HYPRE_Solver solver, + HYPRE_Int num_levels ) +{ + return ( hypre_BoomerAMGSetFSAINumLevels( (void *) solver, num_levels ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_BoomerAMGSetFSAIThreshold + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetFSAIThreshold( HYPRE_Solver solver, + HYPRE_Real threshold ) +{ + return ( hypre_BoomerAMGSetFSAIThreshold( (void *) solver, threshold ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_BoomerAMGSetFSAIEigMaxIters + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetFSAIEigMaxIters( HYPRE_Solver solver, + HYPRE_Int eig_max_iters ) +{ + return ( hypre_BoomerAMGSetFSAIEigMaxIters( (void *) solver, eig_max_iters ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_BoomerAMGSetFSAIKapTolerance + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetFSAIKapTolerance( HYPRE_Solver solver, + HYPRE_Real kap_tolerance ) +{ + return ( hypre_BoomerAMGSetFSAIKapTolerance( (void *) solver, kap_tolerance ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_BoomerAMGSetNumFunctions *--------------------------------------------------------------------------*/ HYPRE_Int HYPRE_BoomerAMGSetNumFunctions( HYPRE_Solver solver, - HYPRE_Int num_functions ) + HYPRE_Int num_functions ) { - return( hypre_BoomerAMGSetNumFunctions( (void *) solver, num_functions ) ); + return ( hypre_BoomerAMGSetNumFunctions( (void *) solver, num_functions ) ); } +/*-------------------------------------------------------------------------- + * HYPRE_BoomerAMGGetNumFunctions + *--------------------------------------------------------------------------*/ + HYPRE_Int HYPRE_BoomerAMGGetNumFunctions( HYPRE_Solver solver, - HYPRE_Int * num_functions ) + HYPRE_Int *num_functions ) { - return( hypre_BoomerAMGGetNumFunctions( (void *) solver, num_functions ) ); + return ( hypre_BoomerAMGGetNumFunctions( (void *) solver, num_functions ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_BoomerAMGSetFilterFunctions + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetFilterFunctions( HYPRE_Solver solver, + HYPRE_Int filter_functions ) +{ + return ( hypre_BoomerAMGSetFilterFunctions( (void *) solver, filter_functions ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_BoomerAMGGetFilterFunctions + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetFilterFunctions( HYPRE_Solver solver, + HYPRE_Int *filter_functions ) +{ + return ( hypre_BoomerAMGGetFilterFunctions( (void *) solver, filter_functions ) ); } /*-------------------------------------------------------------------------- @@ -1314,7 +1560,7 @@ HYPRE_Int HYPRE_BoomerAMGSetNodal( HYPRE_Solver solver, HYPRE_Int nodal ) { - return( hypre_BoomerAMGSetNodal( (void *) solver, nodal ) ); + return ( hypre_BoomerAMGSetNodal( (void *) solver, nodal ) ); } /*-------------------------------------------------------------------------- * HYPRE_BoomerAMGSetNodalLevels @@ -1324,10 +1570,9 @@ HYPRE_Int HYPRE_BoomerAMGSetNodalLevels( HYPRE_Solver solver, HYPRE_Int nodal_levels ) { - return( hypre_BoomerAMGSetNodalLevels( (void *) solver, nodal_levels ) ); + return ( hypre_BoomerAMGSetNodalLevels( (void *) solver, nodal_levels ) ); } - /*-------------------------------------------------------------------------- * HYPRE_BoomerAMGSetNodalDiag *--------------------------------------------------------------------------*/ @@ -1336,7 +1581,7 @@ HYPRE_Int HYPRE_BoomerAMGSetNodalDiag( HYPRE_Solver solver, HYPRE_Int nodal ) { - return( hypre_BoomerAMGSetNodalDiag( (void *) solver, nodal ) ); + return ( hypre_BoomerAMGSetNodalDiag( (void *) solver, nodal ) ); } /*-------------------------------------------------------------------------- @@ -1347,7 +1592,7 @@ HYPRE_Int HYPRE_BoomerAMGSetKeepSameSign( HYPRE_Solver solver, HYPRE_Int keep_same_sign ) { - return( hypre_BoomerAMGSetKeepSameSign( (void *) solver, keep_same_sign ) ); + return ( hypre_BoomerAMGSetKeepSameSign( (void *) solver, keep_same_sign ) ); } /*-------------------------------------------------------------------------- * HYPRE_BoomerAMGSetDofFunc @@ -1362,7 +1607,7 @@ HYPRE_BoomerAMGSetDofFunc( HYPRE_Solver solver, dof_func by calling HYPRE_BoomerAMGSetDofFunc, this could be an unwanted surprise. As hypre is currently commonly used, this situation is likely to be rare. */ { - return( hypre_BoomerAMGSetDofFunc( (void *) solver, dof_func ) ); + return ( hypre_BoomerAMGSetDofFunc( (void *) solver, dof_func ) ); } /*-------------------------------------------------------------------------- @@ -1373,7 +1618,7 @@ HYPRE_Int HYPRE_BoomerAMGSetNumPaths( HYPRE_Solver solver, HYPRE_Int num_paths ) { - return( hypre_BoomerAMGSetNumPaths( (void *) solver, num_paths ) ); + return ( hypre_BoomerAMGSetNumPaths( (void *) solver, num_paths ) ); } /*-------------------------------------------------------------------------- @@ -1384,7 +1629,7 @@ HYPRE_Int HYPRE_BoomerAMGSetAggNumLevels( HYPRE_Solver solver, HYPRE_Int agg_num_levels ) { - return( hypre_BoomerAMGSetAggNumLevels( (void *) solver, agg_num_levels ) ); + return ( hypre_BoomerAMGSetAggNumLevels( (void *) solver, agg_num_levels ) ); } /*-------------------------------------------------------------------------- @@ -1395,7 +1640,7 @@ HYPRE_Int HYPRE_BoomerAMGSetAggInterpType( HYPRE_Solver solver, HYPRE_Int agg_interp_type ) { - return( hypre_BoomerAMGSetAggInterpType( (void *) solver, agg_interp_type ) ); + return ( hypre_BoomerAMGSetAggInterpType( (void *) solver, agg_interp_type ) ); } /*-------------------------------------------------------------------------- @@ -1406,7 +1651,7 @@ HYPRE_Int HYPRE_BoomerAMGSetAggTruncFactor( HYPRE_Solver solver, HYPRE_Real agg_trunc_factor ) { - return( hypre_BoomerAMGSetAggTruncFactor( (void *) solver, agg_trunc_factor ) ); + return ( hypre_BoomerAMGSetAggTruncFactor( (void *) solver, agg_trunc_factor ) ); } /*-------------------------------------------------------------------------- @@ -1417,7 +1662,7 @@ HYPRE_Int HYPRE_BoomerAMGSetAddTruncFactor( HYPRE_Solver solver, HYPRE_Real add_trunc_factor ) { - return( hypre_BoomerAMGSetMultAddTruncFactor( (void *) solver, add_trunc_factor ) ); + return ( hypre_BoomerAMGSetMultAddTruncFactor( (void *) solver, add_trunc_factor ) ); } /*-------------------------------------------------------------------------- @@ -1426,9 +1671,9 @@ HYPRE_BoomerAMGSetAddTruncFactor( HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetMultAddTruncFactor( HYPRE_Solver solver, - HYPRE_Real add_trunc_factor ) + HYPRE_Real add_trunc_factor ) { - return( hypre_BoomerAMGSetMultAddTruncFactor( (void *) solver, add_trunc_factor ) ); + return ( hypre_BoomerAMGSetMultAddTruncFactor( (void *) solver, add_trunc_factor ) ); } /*-------------------------------------------------------------------------- @@ -1437,9 +1682,9 @@ HYPRE_BoomerAMGSetMultAddTruncFactor( HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetAddRelaxWt( HYPRE_Solver solver, - HYPRE_Real add_rlx_wt ) + HYPRE_Real add_rlx_wt ) { - return( hypre_BoomerAMGSetAddRelaxWt( (void *) solver, add_rlx_wt ) ); + return ( hypre_BoomerAMGSetAddRelaxWt( (void *) solver, add_rlx_wt ) ); } /*-------------------------------------------------------------------------- @@ -1448,9 +1693,9 @@ HYPRE_BoomerAMGSetAddRelaxWt( HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetAddRelaxType( HYPRE_Solver solver, - HYPRE_Int add_rlx_type ) + HYPRE_Int add_rlx_type ) { - return( hypre_BoomerAMGSetAddRelaxType( (void *) solver, add_rlx_type ) ); + return ( hypre_BoomerAMGSetAddRelaxType( (void *) solver, add_rlx_type ) ); } /*-------------------------------------------------------------------------- * HYPRE_BoomerAMGSetAggP12TruncFactor @@ -1460,7 +1705,7 @@ HYPRE_Int HYPRE_BoomerAMGSetAggP12TruncFactor( HYPRE_Solver solver, HYPRE_Real agg_P12_trunc_factor ) { - return( hypre_BoomerAMGSetAggP12TruncFactor( (void *) solver, agg_P12_trunc_factor ) ); + return ( hypre_BoomerAMGSetAggP12TruncFactor( (void *) solver, agg_P12_trunc_factor ) ); } /*-------------------------------------------------------------------------- @@ -1471,7 +1716,7 @@ HYPRE_Int HYPRE_BoomerAMGSetAggPMaxElmts( HYPRE_Solver solver, HYPRE_Int agg_P_max_elmts ) { - return( hypre_BoomerAMGSetAggPMaxElmts( (void *) solver, agg_P_max_elmts ) ); + return ( hypre_BoomerAMGSetAggPMaxElmts( (void *) solver, agg_P_max_elmts ) ); } /*-------------------------------------------------------------------------- @@ -1482,7 +1727,7 @@ HYPRE_Int HYPRE_BoomerAMGSetAddPMaxElmts( HYPRE_Solver solver, HYPRE_Int add_P_max_elmts ) { - return( hypre_BoomerAMGSetMultAddPMaxElmts( (void *) solver, add_P_max_elmts ) ); + return ( hypre_BoomerAMGSetMultAddPMaxElmts( (void *) solver, add_P_max_elmts ) ); } /*-------------------------------------------------------------------------- @@ -1491,9 +1736,9 @@ HYPRE_BoomerAMGSetAddPMaxElmts( HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetMultAddPMaxElmts( HYPRE_Solver solver, - HYPRE_Int add_P_max_elmts ) + HYPRE_Int add_P_max_elmts ) { - return( hypre_BoomerAMGSetMultAddPMaxElmts( (void *) solver, add_P_max_elmts ) ); + return ( hypre_BoomerAMGSetMultAddPMaxElmts( (void *) solver, add_P_max_elmts ) ); } /*-------------------------------------------------------------------------- @@ -1504,7 +1749,7 @@ HYPRE_Int HYPRE_BoomerAMGSetAggP12MaxElmts( HYPRE_Solver solver, HYPRE_Int agg_P12_max_elmts ) { - return( hypre_BoomerAMGSetAggP12MaxElmts( (void *) solver, agg_P12_max_elmts ) ); + return ( hypre_BoomerAMGSetAggP12MaxElmts( (void *) solver, agg_P12_max_elmts ) ); } /*-------------------------------------------------------------------------- @@ -1515,7 +1760,7 @@ HYPRE_Int HYPRE_BoomerAMGSetNumCRRelaxSteps( HYPRE_Solver solver, HYPRE_Int num_CR_relax_steps ) { - return( hypre_BoomerAMGSetNumCRRelaxSteps( (void *) solver, num_CR_relax_steps ) ); + return ( hypre_BoomerAMGSetNumCRRelaxSteps( (void *) solver, num_CR_relax_steps ) ); } /*-------------------------------------------------------------------------- @@ -1526,7 +1771,7 @@ HYPRE_Int HYPRE_BoomerAMGSetCRRate( HYPRE_Solver solver, HYPRE_Real CR_rate ) { - return( hypre_BoomerAMGSetCRRate( (void *) solver, CR_rate ) ); + return ( hypre_BoomerAMGSetCRRate( (void *) solver, CR_rate ) ); } /*-------------------------------------------------------------------------- @@ -1537,21 +1782,21 @@ HYPRE_Int HYPRE_BoomerAMGSetCRStrongTh( HYPRE_Solver solver, HYPRE_Real CR_strong_th ) { - return( hypre_BoomerAMGSetCRStrongTh( (void *) solver, CR_strong_th ) ); + return ( hypre_BoomerAMGSetCRStrongTh( (void *) solver, CR_strong_th ) ); } HYPRE_Int HYPRE_BoomerAMGSetADropTol( HYPRE_Solver solver, HYPRE_Real A_drop_tol ) { - return( hypre_BoomerAMGSetADropTol( (void *) solver, A_drop_tol ) ); + return ( hypre_BoomerAMGSetADropTol( (void *) solver, A_drop_tol ) ); } HYPRE_Int HYPRE_BoomerAMGSetADropType( HYPRE_Solver solver, HYPRE_Int A_drop_type ) { - return( hypre_BoomerAMGSetADropType( (void *) solver, A_drop_type ) ); + return ( hypre_BoomerAMGSetADropType( (void *) solver, A_drop_type ) ); } /*-------------------------------------------------------------------------- * HYPRE_BoomerAMGSetISType @@ -1561,7 +1806,7 @@ HYPRE_Int HYPRE_BoomerAMGSetISType( HYPRE_Solver solver, HYPRE_Int IS_type ) { - return( hypre_BoomerAMGSetISType( (void *) solver, IS_type ) ); + return ( hypre_BoomerAMGSetISType( (void *) solver, IS_type ) ); } /*-------------------------------------------------------------------------- @@ -1572,7 +1817,7 @@ HYPRE_Int HYPRE_BoomerAMGSetCRUseCG( HYPRE_Solver solver, HYPRE_Int CR_use_CG ) { - return( hypre_BoomerAMGSetCRUseCG( (void *) solver, CR_use_CG ) ); + return ( hypre_BoomerAMGSetCRUseCG( (void *) solver, CR_use_CG ) ); } /*-------------------------------------------------------------------------- @@ -1583,7 +1828,7 @@ HYPRE_Int HYPRE_BoomerAMGSetGSMG( HYPRE_Solver solver, HYPRE_Int gsmg ) { - return( hypre_BoomerAMGSetGSMG( (void *) solver, gsmg ) ); + return ( hypre_BoomerAMGSetGSMG( (void *) solver, gsmg ) ); } /*-------------------------------------------------------------------------- @@ -1594,7 +1839,7 @@ HYPRE_Int HYPRE_BoomerAMGSetNumSamples( HYPRE_Solver solver, HYPRE_Int gsmg ) { - return( hypre_BoomerAMGSetNumSamples( (void *) solver, gsmg ) ); + return ( hypre_BoomerAMGSetNumSamples( (void *) solver, gsmg ) ); } /* BM Aug 25, 2006 */ @@ -1662,7 +1907,7 @@ HYPRE_BoomerAMGSetCoordinates (HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGGetGridHierarchy(HYPRE_Solver solver, - HYPRE_Int *cgrid ) + HYPRE_Int *cgrid ) { return (hypre_BoomerAMGGetGridHierarchy ( (void *) solver, cgrid ) ); } @@ -1675,7 +1920,7 @@ HYPRE_Int HYPRE_BoomerAMGSetChebyOrder( HYPRE_Solver solver, HYPRE_Int order ) { - return( hypre_BoomerAMGSetChebyOrder( (void *) solver, order ) ); + return ( hypre_BoomerAMGSetChebyOrder( (void *) solver, order ) ); } /*-------------------------------------------------------------------------- * HYPRE_BoomerAMGSetChebyFraction @@ -1685,7 +1930,7 @@ HYPRE_Int HYPRE_BoomerAMGSetChebyFraction( HYPRE_Solver solver, HYPRE_Real ratio ) { - return( hypre_BoomerAMGSetChebyFraction( (void *) solver, ratio ) ); + return ( hypre_BoomerAMGSetChebyFraction( (void *) solver, ratio ) ); } /*-------------------------------------------------------------------------- @@ -1694,9 +1939,9 @@ HYPRE_BoomerAMGSetChebyFraction( HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetChebyScale( HYPRE_Solver solver, - HYPRE_Int scale ) + HYPRE_Int scale ) { - return( hypre_BoomerAMGSetChebyScale( (void *) solver, scale ) ); + return ( hypre_BoomerAMGSetChebyScale( (void *) solver, scale ) ); } /*-------------------------------------------------------------------------- @@ -1705,9 +1950,9 @@ HYPRE_BoomerAMGSetChebyScale( HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetChebyVariant( HYPRE_Solver solver, - HYPRE_Int variant ) + HYPRE_Int variant ) { - return( hypre_BoomerAMGSetChebyVariant( (void *) solver, variant ) ); + return ( hypre_BoomerAMGSetChebyVariant( (void *) solver, variant ) ); } /*-------------------------------------------------------------------------- @@ -1716,9 +1961,9 @@ HYPRE_BoomerAMGSetChebyVariant( HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetChebyEigEst( HYPRE_Solver solver, - HYPRE_Int eig_est ) + HYPRE_Int eig_est ) { - return( hypre_BoomerAMGSetChebyEigEst( (void *) solver, eig_est ) ); + return ( hypre_BoomerAMGSetChebyEigEst( (void *) solver, eig_est ) ); } /*-------------------------------------------------------------------------- @@ -1750,8 +1995,8 @@ HYPRE_Int HYPRE_BoomerAMGSetInterpVecQMax( HYPRE_Solver solver, HYPRE_Int q_max ) { - return( hypre_BoomerAMGSetInterpVecQMax( (void *) solver, - q_max ) ); + return ( hypre_BoomerAMGSetInterpVecQMax( (void *) solver, + q_max ) ); } /*-------------------------------------------------------------------------- @@ -1761,8 +2006,8 @@ HYPRE_Int HYPRE_BoomerAMGSetInterpVecAbsQTrunc( HYPRE_Solver solver, HYPRE_Real q_trunc ) { - return( hypre_BoomerAMGSetInterpVecAbsQTrunc( (void *) solver, - q_trunc ) ); + return ( hypre_BoomerAMGSetInterpVecAbsQTrunc( (void *) solver, + q_trunc ) ); } /*-------------------------------------------------------------------------- * HYPRE_BoomerAMGSetSmoothInterpVectors @@ -1771,8 +2016,8 @@ HYPRE_Int HYPRE_BoomerAMGSetSmoothInterpVectors( HYPRE_Solver solver, HYPRE_Int smooth_interp_vectors ) { - return( hypre_BoomerAMGSetSmoothInterpVectors( (void *) solver, - smooth_interp_vectors) ); + return ( hypre_BoomerAMGSetSmoothInterpVectors( (void *) solver, + smooth_interp_vectors) ); } /*-------------------------------------------------------------------------- * HYPRE_BoomerAMGSetInterpRefine @@ -1781,8 +2026,8 @@ HYPRE_Int HYPRE_BoomerAMGSetInterpRefine( HYPRE_Solver solver, HYPRE_Int num_refine ) { - return( hypre_BoomerAMGSetInterpRefine( (void *) solver, - num_refine ) ); + return ( hypre_BoomerAMGSetInterpRefine( (void *) solver, + num_refine ) ); } /*-------------------------------------------------------------------------- * HYPRE_BoomerAMGSetInterpVecFirstLevel( @@ -1791,8 +2036,8 @@ HYPRE_Int HYPRE_BoomerAMGSetInterpVecFirstLevel( HYPRE_Solver solver, HYPRE_Int level ) { - return( hypre_BoomerAMGSetInterpVecFirstLevel( (void *) solver, - level ) ); + return ( hypre_BoomerAMGSetInterpVecFirstLevel( (void *) solver, + level ) ); } /*-------------------------------------------------------------------------- * HYPRE_BoomerAMGSetAdditive, HYPRE_BoomerAMGGetAdditive @@ -1802,14 +2047,14 @@ HYPRE_Int HYPRE_BoomerAMGSetAdditive( HYPRE_Solver solver, HYPRE_Int additive ) { - return( hypre_BoomerAMGSetAdditive( (void *) solver, additive ) ); + return ( hypre_BoomerAMGSetAdditive( (void *) solver, additive ) ); } HYPRE_Int HYPRE_BoomerAMGGetAdditive( HYPRE_Solver solver, HYPRE_Int * additive ) { - return( hypre_BoomerAMGGetAdditive( (void *) solver, additive ) ); + return ( hypre_BoomerAMGGetAdditive( (void *) solver, additive ) ); } /*-------------------------------------------------------------------------- @@ -1820,14 +2065,14 @@ HYPRE_Int HYPRE_BoomerAMGSetMultAdditive( HYPRE_Solver solver, HYPRE_Int mult_additive ) { - return( hypre_BoomerAMGSetMultAdditive( (void *) solver, mult_additive ) ); + return ( hypre_BoomerAMGSetMultAdditive( (void *) solver, mult_additive ) ); } HYPRE_Int HYPRE_BoomerAMGGetMultAdditive( HYPRE_Solver solver, HYPRE_Int *mult_additive ) { - return( hypre_BoomerAMGGetMultAdditive( (void *) solver, mult_additive ) ); + return ( hypre_BoomerAMGGetMultAdditive( (void *) solver, mult_additive ) ); } /*-------------------------------------------------------------------------- @@ -1838,14 +2083,14 @@ HYPRE_Int HYPRE_BoomerAMGSetSimple( HYPRE_Solver solver, HYPRE_Int simple ) { - return( hypre_BoomerAMGSetSimple( (void *) solver, simple ) ); + return ( hypre_BoomerAMGSetSimple( (void *) solver, simple ) ); } HYPRE_Int HYPRE_BoomerAMGGetSimple( HYPRE_Solver solver, HYPRE_Int *simple ) { - return( hypre_BoomerAMGGetSimple( (void *) solver, simple ) ); + return ( hypre_BoomerAMGGetSimple( (void *) solver, simple ) ); } /*-------------------------------------------------------------------------- @@ -1856,7 +2101,7 @@ HYPRE_Int HYPRE_BoomerAMGSetAddLastLvl( HYPRE_Solver solver, HYPRE_Int add_last_lvl ) { - return( hypre_BoomerAMGSetAddLastLvl( (void *) solver, add_last_lvl ) ); + return ( hypre_BoomerAMGSetAddLastLvl( (void *) solver, add_last_lvl ) ); } /*-------------------------------------------------------------------------- @@ -1879,7 +2124,7 @@ HYPRE_BoomerAMGSetLevelNonGalerkinTol (HYPRE_Solver solver, HYPRE_Real nongalerkin_tol, HYPRE_Int level) { - return (hypre_BoomerAMGSetLevelNonGalerkinTol ( (void *) solver, nongalerkin_tol , level ) ); + return (hypre_BoomerAMGSetLevelNonGalerkinTol ( (void *) solver, nongalerkin_tol, level ) ); } /*-------------------------------------------------------------------------- @@ -1891,7 +2136,7 @@ HYPRE_BoomerAMGSetNonGalerkTol (HYPRE_Solver solver, HYPRE_Int nongalerk_num_tol, HYPRE_Real *nongalerk_tol) { - return (hypre_BoomerAMGSetNonGalerkTol ( (void *) solver, nongalerk_num_tol , nongalerk_tol ) ); + return (hypre_BoomerAMGSetNonGalerkTol ( (void *) solver, nongalerk_num_tol, nongalerk_tol ) ); } /*-------------------------------------------------------------------------- @@ -1950,7 +2195,8 @@ HYPRE_BoomerAMGSetCpointsToKeep(HYPRE_Solver solver, HYPRE_Int num_cpt_coarse, HYPRE_BigInt *cpt_coarse_index) { - return (hypre_BoomerAMGSetCPoints( (void *) solver, cpt_coarse_level, num_cpt_coarse, cpt_coarse_index)); + return (hypre_BoomerAMGSetCPoints( (void *) solver, cpt_coarse_level, num_cpt_coarse, + cpt_coarse_index)); } /*-------------------------------------------------------------------------- @@ -1963,7 +2209,8 @@ HYPRE_BoomerAMGSetCPoints(HYPRE_Solver solver, HYPRE_Int num_cpt_coarse, HYPRE_BigInt *cpt_coarse_index) { - return (hypre_BoomerAMGSetCPoints( (void *) solver, cpt_coarse_level, num_cpt_coarse, cpt_coarse_index)); + return (hypre_BoomerAMGSetCPoints( (void *) solver, cpt_coarse_level, num_cpt_coarse, + cpt_coarse_index)); } /*-------------------------------------------------------------------------- @@ -1994,3 +2241,24 @@ HYPRE_BoomerAMGSetIsolatedFPoints(HYPRE_Solver solver, isolated_fpt_index) ); } +/*-------------------------------------------------------------------------- + * HYPRE_BoomerAMGSetCumNnzAP + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetCumNnzAP( HYPRE_Solver solver, + HYPRE_Real cum_nnz_AP ) +{ + return ( hypre_BoomerAMGSetCumNnzAP( (void *) solver, cum_nnz_AP ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_BoomerAMGGetCumNnzAP + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetCumNnzAP( HYPRE_Solver solver, + HYPRE_Real *cum_nnz_AP ) +{ + return ( hypre_BoomerAMGGetCumNnzAP( (void *) solver, cum_nnz_AP ) ); +} diff --git a/external/hypre/src/parcsr_ls/HYPRE_parcsr_amgdd.c b/external/hypre/src/parcsr_ls/HYPRE_parcsr_amgdd.c index 555b15a9..485d926e 100644 --- a/external/hypre/src/parcsr_ls/HYPRE_parcsr_amgdd.c +++ b/external/hypre/src/parcsr_ls/HYPRE_parcsr_amgdd.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -31,7 +31,7 @@ HYPRE_BoomerAMGDDCreate( HYPRE_Solver *solver) HYPRE_Int HYPRE_BoomerAMGDDDestroy( HYPRE_Solver solver ) { - return( hypre_BoomerAMGDDDestroy( (void *) solver ) ); + return ( hypre_BoomerAMGDDDestroy( (void *) solver ) ); } /*-------------------------------------------------------------------------- @@ -60,10 +60,10 @@ HYPRE_BoomerAMGDDSolve( HYPRE_Solver solver, HYPRE_ParVector b, HYPRE_ParVector x ) { - return( hypre_BoomerAMGDDSolve( (void *) solver, - (hypre_ParCSRMatrix *) A, - (hypre_ParVector *) b, - (hypre_ParVector *) x ) ); + return ( hypre_BoomerAMGDDSolve( (void *) solver, + (hypre_ParCSRMatrix *) A, + (hypre_ParVector *) b, + (hypre_ParVector *) x ) ); } /*------------------------------------------------------------------------- @@ -74,14 +74,14 @@ HYPRE_Int HYPRE_BoomerAMGDDSetStartLevel( HYPRE_Solver solver, HYPRE_Int start_level ) { - return( hypre_BoomerAMGDDSetStartLevel( (void *) solver, start_level ) ); + return ( hypre_BoomerAMGDDSetStartLevel( (void *) solver, start_level ) ); } HYPRE_Int HYPRE_BoomerAMGDDGetStartLevel( HYPRE_Solver solver, HYPRE_Int *start_level ) { - return( hypre_BoomerAMGDDGetStartLevel( (void *) solver, start_level ) ); + return ( hypre_BoomerAMGDDGetStartLevel( (void *) solver, start_level ) ); } /*------------------------------------------------------------------------- @@ -92,14 +92,14 @@ HYPRE_Int HYPRE_BoomerAMGDDSetFACNumRelax( HYPRE_Solver solver, HYPRE_Int amgdd_fac_num_relax ) { - return( hypre_BoomerAMGDDSetFACNumRelax( (void *) solver, amgdd_fac_num_relax ) ); + return ( hypre_BoomerAMGDDSetFACNumRelax( (void *) solver, amgdd_fac_num_relax ) ); } HYPRE_Int HYPRE_BoomerAMGDDGetFACNumRelax( HYPRE_Solver solver, HYPRE_Int *amgdd_fac_num_relax ) { - return( hypre_BoomerAMGDDGetFACNumRelax( (void *) solver, amgdd_fac_num_relax ) ); + return ( hypre_BoomerAMGDDGetFACNumRelax( (void *) solver, amgdd_fac_num_relax ) ); } /*------------------------------------------------------------------------- @@ -110,14 +110,14 @@ HYPRE_Int HYPRE_BoomerAMGDDSetFACNumCycles( HYPRE_Solver solver, HYPRE_Int amgdd_fac_num_cycles ) { - return( hypre_BoomerAMGDDSetFACNumCycles( (void *) solver, amgdd_fac_num_cycles ) ); + return ( hypre_BoomerAMGDDSetFACNumCycles( (void *) solver, amgdd_fac_num_cycles ) ); } HYPRE_Int HYPRE_BoomerAMGDDGetFACNumCycles( HYPRE_Solver solver, HYPRE_Int *amgdd_fac_num_cycles ) { - return( hypre_BoomerAMGDDGetFACNumCycles( (void *) solver, amgdd_fac_num_cycles ) ); + return ( hypre_BoomerAMGDDGetFACNumCycles( (void *) solver, amgdd_fac_num_cycles ) ); } /*-------------------------------------------------------------------------- @@ -128,14 +128,14 @@ HYPRE_Int HYPRE_BoomerAMGDDSetFACCycleType( HYPRE_Solver solver, HYPRE_Int amgdd_fac_cycle_type ) { - return( hypre_BoomerAMGDDSetFACCycleType( (void *) solver, amgdd_fac_cycle_type ) ); + return ( hypre_BoomerAMGDDSetFACCycleType( (void *) solver, amgdd_fac_cycle_type ) ); } HYPRE_Int HYPRE_BoomerAMGDDGetFACCycleType( HYPRE_Solver solver, HYPRE_Int *amgdd_fac_cycle_type ) { - return( hypre_BoomerAMGDDGetFACCycleType( (void *) solver, amgdd_fac_cycle_type ) ); + return ( hypre_BoomerAMGDDGetFACCycleType( (void *) solver, amgdd_fac_cycle_type ) ); } /*-------------------------------------------------------------------------- @@ -146,14 +146,14 @@ HYPRE_Int HYPRE_BoomerAMGDDSetFACRelaxType( HYPRE_Solver solver, HYPRE_Int amgdd_fac_relax_type ) { - return( hypre_BoomerAMGDDSetFACRelaxType( (void *) solver, amgdd_fac_relax_type ) ); + return ( hypre_BoomerAMGDDSetFACRelaxType( (void *) solver, amgdd_fac_relax_type ) ); } HYPRE_Int HYPRE_BoomerAMGDDGetFACRelaxType( HYPRE_Solver solver, HYPRE_Int *amgdd_fac_relax_type ) { - return( hypre_BoomerAMGDDGetFACRelaxType( (void *) solver, amgdd_fac_relax_type ) ); + return ( hypre_BoomerAMGDDGetFACRelaxType( (void *) solver, amgdd_fac_relax_type ) ); } /*-------------------------------------------------------------------------- @@ -164,14 +164,14 @@ HYPRE_Int HYPRE_BoomerAMGDDSetFACRelaxWeight( HYPRE_Solver solver, HYPRE_Real amgdd_fac_relax_weight ) { - return( hypre_BoomerAMGDDSetFACRelaxWeight( (void *) solver, amgdd_fac_relax_weight ) ); + return ( hypre_BoomerAMGDDSetFACRelaxWeight( (void *) solver, amgdd_fac_relax_weight ) ); } HYPRE_Int HYPRE_BoomerAMGDDGetFACRelaxWeight( HYPRE_Solver solver, HYPRE_Real *amgdd_fac_relax_weight ) { - return( hypre_BoomerAMGDDGetFACRelaxWeight( (void *) solver, amgdd_fac_relax_weight ) ); + return ( hypre_BoomerAMGDDGetFACRelaxWeight( (void *) solver, amgdd_fac_relax_weight ) ); } /*-------------------------------------------------------------------------- @@ -182,14 +182,14 @@ HYPRE_Int HYPRE_BoomerAMGDDSetPadding( HYPRE_Solver solver, HYPRE_Int padding ) { - return( hypre_BoomerAMGDDSetPadding( (void *) solver, padding ) ); + return ( hypre_BoomerAMGDDSetPadding( (void *) solver, padding ) ); } HYPRE_Int HYPRE_BoomerAMGDDGetPadding( HYPRE_Solver solver, HYPRE_Int *padding ) { - return( hypre_BoomerAMGDDGetPadding( (void *) solver, padding ) ); + return ( hypre_BoomerAMGDDGetPadding( (void *) solver, padding ) ); } /*-------------------------------------------------------------------------- @@ -200,14 +200,14 @@ HYPRE_Int HYPRE_BoomerAMGDDSetNumGhostLayers( HYPRE_Solver solver, HYPRE_Int num_ghost_layers ) { - return( hypre_BoomerAMGDDSetNumGhostLayers( (void *) solver, num_ghost_layers ) ); + return ( hypre_BoomerAMGDDSetNumGhostLayers( (void *) solver, num_ghost_layers ) ); } HYPRE_Int HYPRE_BoomerAMGDDGetNumGhostLayers( HYPRE_Solver solver, HYPRE_Int *num_ghost_layers ) { - return( hypre_BoomerAMGDDGetNumGhostLayers( (void *) solver, num_ghost_layers ) ); + return ( hypre_BoomerAMGDDGetNumGhostLayers( (void *) solver, num_ghost_layers ) ); } /*-------------------------------------------------------------------------- @@ -216,11 +216,11 @@ HYPRE_BoomerAMGDDGetNumGhostLayers( HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGDDSetUserFACRelaxation( HYPRE_Solver solver, - HYPRE_Int (*userFACRelaxation)( void *amgdd_vdata, - HYPRE_Int level, - HYPRE_Int cycle_param ) ) + HYPRE_Int (*userFACRelaxation)( void *amgdd_vdata, + HYPRE_Int level, + HYPRE_Int cycle_param ) ) { - return( hypre_BoomerAMGDDSetUserFACRelaxation( (void *) solver, userFACRelaxation ) ); + return ( hypre_BoomerAMGDDSetUserFACRelaxation( (void *) solver, userFACRelaxation ) ); } /*-------------------------------------------------------------------------- @@ -231,7 +231,7 @@ HYPRE_Int HYPRE_BoomerAMGDDGetAMG( HYPRE_Solver solver, HYPRE_Solver *amg_solver ) { - return( hypre_BoomerAMGDDGetAMG( (void *) solver, (void **) amg_solver ) ); + return ( hypre_BoomerAMGDDGetAMG( (void *) solver, (void **) amg_solver ) ); } /*-------------------------------------------------------------------------- @@ -245,7 +245,7 @@ HYPRE_BoomerAMGDDGetFinalRelativeResidualNorm( HYPRE_Solver solver, HYPRE_Solver amg_solver; HYPRE_BoomerAMGDDGetAMG(solver, &amg_solver); - return( hypre_BoomerAMGGetRelResidualNorm( (void *) amg_solver, rel_resid_norm ) ); + return ( hypre_BoomerAMGGetRelResidualNorm( (void *) amg_solver, rel_resid_norm ) ); } /*-------------------------------------------------------------------------- @@ -259,5 +259,5 @@ HYPRE_BoomerAMGDDGetNumIterations( HYPRE_Solver solver, HYPRE_Solver amg_solver; HYPRE_BoomerAMGDDGetAMG(solver, &amg_solver); - return( hypre_BoomerAMGGetNumIterations( (void *) amg_solver, num_iterations ) ); + return ( hypre_BoomerAMGGetNumIterations( (void *) amg_solver, num_iterations ) ); } diff --git a/external/hypre/src/parcsr_ls/HYPRE_parcsr_bicgstab.c b/external/hypre/src/parcsr_ls/HYPRE_parcsr_bicgstab.c index 6fbf0c91..edf31cf4 100644 --- a/external/hypre/src/parcsr_ls/HYPRE_parcsr_bicgstab.c +++ b/external/hypre/src/parcsr_ls/HYPRE_parcsr_bicgstab.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -14,6 +14,8 @@ HYPRE_Int HYPRE_ParCSRBiCGSTABCreate( MPI_Comm comm, HYPRE_Solver *solver ) { + HYPRE_UNUSED_VAR(comm); + hypre_BiCGSTABFunctions * bicgstab_functions; if (!solver) @@ -24,13 +26,18 @@ HYPRE_ParCSRBiCGSTABCreate( MPI_Comm comm, HYPRE_Solver *solver ) bicgstab_functions = hypre_BiCGSTABFunctionsCreate( hypre_ParKrylovCreateVector, - hypre_ParKrylovDestroyVector, hypre_ParKrylovMatvecCreate, - hypre_ParKrylovMatvec, hypre_ParKrylovMatvecDestroy, - hypre_ParKrylovInnerProd, hypre_ParKrylovCopyVector, + hypre_ParKrylovDestroyVector, + hypre_ParKrylovMatvecCreate, + hypre_ParKrylovMatvec, + hypre_ParKrylovMatvecDestroy, + hypre_ParKrylovInnerProd, + hypre_ParKrylovCopyVector, hypre_ParKrylovClearVector, - hypre_ParKrylovScaleVector, hypre_ParKrylovAxpy, + hypre_ParKrylovScaleVector, + hypre_ParKrylovAxpy, hypre_ParKrylovCommInfo, - hypre_ParKrylovIdentitySetup, hypre_ParKrylovIdentity ); + hypre_ParKrylovIdentitySetup, + hypre_ParKrylovIdentity ); *solver = ( (HYPRE_Solver) hypre_BiCGSTABCreate( bicgstab_functions) ); return hypre_error_flag; @@ -43,7 +50,7 @@ HYPRE_ParCSRBiCGSTABCreate( MPI_Comm comm, HYPRE_Solver *solver ) HYPRE_Int HYPRE_ParCSRBiCGSTABDestroy( HYPRE_Solver solver ) { - return( hypre_BiCGSTABDestroy( (void *) solver ) ); + return ( hypre_BiCGSTABDestroy( (void *) solver ) ); } /*-------------------------------------------------------------------------- @@ -56,10 +63,10 @@ HYPRE_ParCSRBiCGSTABSetup( HYPRE_Solver solver, HYPRE_ParVector b, HYPRE_ParVector x ) { - return( HYPRE_BiCGSTABSetup( solver, - (HYPRE_Matrix) A, - (HYPRE_Vector) b, - (HYPRE_Vector) x ) ); + return ( HYPRE_BiCGSTABSetup( solver, + (HYPRE_Matrix) A, + (HYPRE_Vector) b, + (HYPRE_Vector) x ) ); } /*-------------------------------------------------------------------------- @@ -72,10 +79,10 @@ HYPRE_ParCSRBiCGSTABSolve( HYPRE_Solver solver, HYPRE_ParVector b, HYPRE_ParVector x ) { - return( HYPRE_BiCGSTABSolve( solver, - (HYPRE_Matrix) A, - (HYPRE_Vector) b, - (HYPRE_Vector) x ) ); + return ( HYPRE_BiCGSTABSolve( solver, + (HYPRE_Matrix) A, + (HYPRE_Vector) b, + (HYPRE_Vector) x ) ); } /*-------------------------------------------------------------------------- @@ -86,7 +93,7 @@ HYPRE_Int HYPRE_ParCSRBiCGSTABSetTol( HYPRE_Solver solver, HYPRE_Real tol ) { - return( HYPRE_BiCGSTABSetTol( solver, tol ) ); + return ( HYPRE_BiCGSTABSetTol( solver, tol ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRBiCGSTABSetAbsoluteTol @@ -96,7 +103,7 @@ HYPRE_Int HYPRE_ParCSRBiCGSTABSetAbsoluteTol( HYPRE_Solver solver, HYPRE_Real a_tol ) { - return( HYPRE_BiCGSTABSetAbsoluteTol( solver, a_tol ) ); + return ( HYPRE_BiCGSTABSetAbsoluteTol( solver, a_tol ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRBiCGSTABSetMinIter @@ -106,7 +113,7 @@ HYPRE_Int HYPRE_ParCSRBiCGSTABSetMinIter( HYPRE_Solver solver, HYPRE_Int min_iter ) { - return( HYPRE_BiCGSTABSetMinIter( solver, min_iter ) ); + return ( HYPRE_BiCGSTABSetMinIter( solver, min_iter ) ); } /*-------------------------------------------------------------------------- @@ -117,7 +124,7 @@ HYPRE_Int HYPRE_ParCSRBiCGSTABSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ) { - return( HYPRE_BiCGSTABSetMaxIter( solver, max_iter ) ); + return ( HYPRE_BiCGSTABSetMaxIter( solver, max_iter ) ); } /*-------------------------------------------------------------------------- @@ -128,7 +135,7 @@ HYPRE_Int HYPRE_ParCSRBiCGSTABSetStopCrit( HYPRE_Solver solver, HYPRE_Int stop_crit ) { - return( HYPRE_BiCGSTABSetStopCrit( solver, stop_crit ) ); + return ( HYPRE_BiCGSTABSetStopCrit( solver, stop_crit ) ); } /*-------------------------------------------------------------------------- @@ -141,10 +148,10 @@ HYPRE_ParCSRBiCGSTABSetPrecond( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ) { - return( HYPRE_BiCGSTABSetPrecond( solver, - (HYPRE_PtrToSolverFcn) precond, - (HYPRE_PtrToSolverFcn) precond_setup, - precond_solver ) ); + return ( HYPRE_BiCGSTABSetPrecond( solver, + (HYPRE_PtrToSolverFcn) precond, + (HYPRE_PtrToSolverFcn) precond_setup, + precond_solver ) ); } /*-------------------------------------------------------------------------- @@ -155,7 +162,7 @@ HYPRE_Int HYPRE_ParCSRBiCGSTABGetPrecond( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ) { - return( HYPRE_BiCGSTABGetPrecond( solver, precond_data_ptr ) ); + return ( HYPRE_BiCGSTABGetPrecond( solver, precond_data_ptr ) ); } /*-------------------------------------------------------------------------- @@ -166,7 +173,7 @@ HYPRE_Int HYPRE_ParCSRBiCGSTABSetLogging( HYPRE_Solver solver, HYPRE_Int logging) { - return( HYPRE_BiCGSTABSetLogging( solver, logging ) ); + return ( HYPRE_BiCGSTABSetLogging( solver, logging ) ); } /*-------------------------------------------------------------------------- @@ -177,7 +184,7 @@ HYPRE_Int HYPRE_ParCSRBiCGSTABSetPrintLevel( HYPRE_Solver solver, HYPRE_Int print_level) { - return( HYPRE_BiCGSTABSetPrintLevel( solver, print_level ) ); + return ( HYPRE_BiCGSTABSetPrintLevel( solver, print_level ) ); } /*-------------------------------------------------------------------------- @@ -188,7 +195,7 @@ HYPRE_Int HYPRE_ParCSRBiCGSTABGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ) { - return( HYPRE_BiCGSTABGetNumIterations( solver, num_iterations ) ); + return ( HYPRE_BiCGSTABGetNumIterations( solver, num_iterations ) ); } /*-------------------------------------------------------------------------- @@ -199,7 +206,7 @@ HYPRE_Int HYPRE_ParCSRBiCGSTABGetFinalRelativeResidualNorm( HYPRE_Solver solver, HYPRE_Real *norm ) { - return( HYPRE_BiCGSTABGetFinalRelativeResidualNorm( solver, norm ) ); + return ( HYPRE_BiCGSTABGetFinalRelativeResidualNorm( solver, norm ) ); } /*-------------------------------------------------------------------------- @@ -210,5 +217,5 @@ HYPRE_Int HYPRE_ParCSRBiCGSTABGetResidual( HYPRE_Solver solver, HYPRE_ParVector *residual) { - return( HYPRE_BiCGSTABGetResidual( solver, (void *) residual ) ); + return ( HYPRE_BiCGSTABGetResidual( solver, (void *) residual ) ); } diff --git a/external/hypre/src/parcsr_ls/HYPRE_parcsr_block.c b/external/hypre/src/parcsr_ls/HYPRE_parcsr_block.c index e9c2e5e8..9dcd1125 100644 --- a/external/hypre/src/parcsr_ls/HYPRE_parcsr_block.c +++ b/external/hypre/src/parcsr_ls/HYPRE_parcsr_block.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -29,7 +29,7 @@ HYPRE_Int HYPRE_BlockTridiagCreate(HYPRE_Solver *solver) HYPRE_Int HYPRE_BlockTridiagDestroy(HYPRE_Solver solver) { - return(hypre_BlockTridiagDestroy((void *) solver )); + return (hypre_BlockTridiagDestroy((void *) solver )); } /*-------------------------------------------------------------------------- @@ -37,10 +37,10 @@ HYPRE_Int HYPRE_BlockTridiagDestroy(HYPRE_Solver solver) *--------------------------------------------------------------------------*/ HYPRE_Int HYPRE_BlockTridiagSetup(HYPRE_Solver solver, HYPRE_ParCSRMatrix A, - HYPRE_ParVector b, HYPRE_ParVector x) + HYPRE_ParVector b, HYPRE_ParVector x) { - return(hypre_BlockTridiagSetup((void *) solver, (hypre_ParCSRMatrix *) A, - (hypre_ParVector *) b, (hypre_ParVector *) x)); + return (hypre_BlockTridiagSetup((void *) solver, (hypre_ParCSRMatrix *) A, + (hypre_ParVector *) b, (hypre_ParVector *) x)); } /*-------------------------------------------------------------------------- @@ -48,28 +48,28 @@ HYPRE_Int HYPRE_BlockTridiagSetup(HYPRE_Solver solver, HYPRE_ParCSRMatrix A, *--------------------------------------------------------------------------*/ HYPRE_Int HYPRE_BlockTridiagSolve(HYPRE_Solver solver, HYPRE_ParCSRMatrix A, - HYPRE_ParVector b, HYPRE_ParVector x) + HYPRE_ParVector b, HYPRE_ParVector x) { - return(hypre_BlockTridiagSolve((void *) solver, (hypre_ParCSRMatrix *) A, - (hypre_ParVector *) b, (hypre_ParVector *) x)); + return (hypre_BlockTridiagSolve((void *) solver, (hypre_ParCSRMatrix *) A, + (hypre_ParVector *) b, (hypre_ParVector *) x)); } /*-------------------------------------------------------------------------- * HYPRE_BlockTridiagSetIndexSet *--------------------------------------------------------------------------*/ -HYPRE_Int HYPRE_BlockTridiagSetIndexSet(HYPRE_Solver solver,HYPRE_Int n, HYPRE_Int *inds) +HYPRE_Int HYPRE_BlockTridiagSetIndexSet(HYPRE_Solver solver, HYPRE_Int n, HYPRE_Int *inds) { - return(hypre_BlockTridiagSetIndexSet((void *) solver, n, inds)); + return (hypre_BlockTridiagSetIndexSet((void *) solver, n, inds)); } /*-------------------------------------------------------------------------- * HYPRE_BlockTridiagSetAMGStrengthThreshold *--------------------------------------------------------------------------*/ -HYPRE_Int HYPRE_BlockTridiagSetAMGStrengthThreshold(HYPRE_Solver solver,HYPRE_Real thresh) +HYPRE_Int HYPRE_BlockTridiagSetAMGStrengthThreshold(HYPRE_Solver solver, HYPRE_Real thresh) { - return(hypre_BlockTridiagSetAMGStrengthThreshold((void *) solver, thresh)); + return (hypre_BlockTridiagSetAMGStrengthThreshold((void *) solver, thresh)); } /*-------------------------------------------------------------------------- @@ -78,7 +78,7 @@ HYPRE_Int HYPRE_BlockTridiagSetAMGStrengthThreshold(HYPRE_Solver solver,HYPRE_Re HYPRE_Int HYPRE_BlockTridiagSetAMGNumSweeps(HYPRE_Solver solver, HYPRE_Int num_sweeps) { - return(hypre_BlockTridiagSetAMGNumSweeps((void *) solver,num_sweeps)); + return (hypre_BlockTridiagSetAMGNumSweeps((void *) solver, num_sweeps)); } /*-------------------------------------------------------------------------- @@ -87,7 +87,7 @@ HYPRE_Int HYPRE_BlockTridiagSetAMGNumSweeps(HYPRE_Solver solver, HYPRE_Int num_s HYPRE_Int HYPRE_BlockTridiagSetAMGRelaxType(HYPRE_Solver solver, HYPRE_Int relax_type) { - return(hypre_BlockTridiagSetAMGRelaxType( (void *) solver, relax_type)); + return (hypre_BlockTridiagSetAMGRelaxType( (void *) solver, relax_type)); } /*-------------------------------------------------------------------------- @@ -96,6 +96,6 @@ HYPRE_Int HYPRE_BlockTridiagSetAMGRelaxType(HYPRE_Solver solver, HYPRE_Int relax HYPRE_Int HYPRE_BlockTridiagSetPrintLevel(HYPRE_Solver solver, HYPRE_Int print_level) { - return(hypre_BlockTridiagSetPrintLevel( (void *) solver, print_level)); + return (hypre_BlockTridiagSetPrintLevel( (void *) solver, print_level)); } diff --git a/external/hypre/src/parcsr_ls/HYPRE_parcsr_cgnr.c b/external/hypre/src/parcsr_ls/HYPRE_parcsr_cgnr.c index 48b095ba..ca98f699 100644 --- a/external/hypre/src/parcsr_ls/HYPRE_parcsr_cgnr.c +++ b/external/hypre/src/parcsr_ls/HYPRE_parcsr_cgnr.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -14,6 +14,8 @@ HYPRE_Int HYPRE_ParCSRCGNRCreate( MPI_Comm comm, HYPRE_Solver *solver ) { + HYPRE_UNUSED_VAR(comm); + hypre_CGNRFunctions * cgnr_functions; if (!solver) @@ -25,15 +27,21 @@ HYPRE_ParCSRCGNRCreate( MPI_Comm comm, HYPRE_Solver *solver ) hypre_CGNRFunctionsCreate( hypre_ParKrylovCommInfo, hypre_ParKrylovCreateVector, - hypre_ParKrylovDestroyVector, hypre_ParKrylovMatvecCreate, - hypre_ParKrylovMatvec, hypre_ParKrylovMatvecT, + hypre_ParKrylovDestroyVector, + hypre_ParKrylovMatvecCreate, + hypre_ParKrylovMatvec, + hypre_ParKrylovMatvecT, hypre_ParKrylovMatvecDestroy, hypre_ParKrylovInnerProd, - hypre_ParKrylovCopyVector, hypre_ParKrylovClearVector, - hypre_ParKrylovScaleVector, hypre_ParKrylovAxpy, + hypre_ParKrylovCopyVector, + hypre_ParKrylovClearVector, + hypre_ParKrylovScaleVector, + hypre_ParKrylovAxpy, hypre_ParKrylovIdentitySetup, - hypre_ParKrylovIdentity, hypre_ParKrylovIdentity ); + hypre_ParKrylovIdentity, + hypre_ParKrylovIdentity ); *solver = ( (HYPRE_Solver) hypre_CGNRCreate( cgnr_functions) ); + return hypre_error_flag; } @@ -41,42 +49,42 @@ HYPRE_ParCSRCGNRCreate( MPI_Comm comm, HYPRE_Solver *solver ) * HYPRE_ParCSRCGNRDestroy *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_ParCSRCGNRDestroy( HYPRE_Solver solver ) { - return( hypre_CGNRDestroy( (void *) solver ) ); + return ( hypre_CGNRDestroy( (void *) solver ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRCGNRSetup *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_ParCSRCGNRSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) { - return( HYPRE_CGNRSetup( solver, - (HYPRE_Matrix) A, - (HYPRE_Vector) b, - (HYPRE_Vector) x ) ); + return ( HYPRE_CGNRSetup( solver, + (HYPRE_Matrix) A, + (HYPRE_Vector) b, + (HYPRE_Vector) x ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRCGNRSolve *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_ParCSRCGNRSolve( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) { - return( HYPRE_CGNRSolve( solver, - (HYPRE_Matrix) A, - (HYPRE_Vector) b, - (HYPRE_Vector) x ) ); + return ( HYPRE_CGNRSolve( solver, + (HYPRE_Matrix) A, + (HYPRE_Vector) b, + (HYPRE_Vector) x ) ); } /*-------------------------------------------------------------------------- @@ -87,7 +95,7 @@ HYPRE_Int HYPRE_ParCSRCGNRSetTol( HYPRE_Solver solver, HYPRE_Real tol ) { - return( HYPRE_CGNRSetTol( solver, tol ) ); + return ( HYPRE_CGNRSetTol( solver, tol ) ); } /*-------------------------------------------------------------------------- @@ -98,7 +106,7 @@ HYPRE_Int HYPRE_ParCSRCGNRSetMinIter( HYPRE_Solver solver, HYPRE_Int min_iter ) { - return( HYPRE_CGNRSetMinIter( solver, min_iter ) ); + return ( HYPRE_CGNRSetMinIter( solver, min_iter ) ); } /*-------------------------------------------------------------------------- @@ -109,7 +117,7 @@ HYPRE_Int HYPRE_ParCSRCGNRSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ) { - return( HYPRE_CGNRSetMaxIter( solver, max_iter ) ); + return ( HYPRE_CGNRSetMaxIter( solver, max_iter ) ); } /*-------------------------------------------------------------------------- @@ -120,7 +128,7 @@ HYPRE_Int HYPRE_ParCSRCGNRSetStopCrit( HYPRE_Solver solver, HYPRE_Int stop_crit ) { - return( HYPRE_CGNRSetStopCrit( solver, stop_crit ) ); + return ( HYPRE_CGNRSetStopCrit( solver, stop_crit ) ); } /*-------------------------------------------------------------------------- @@ -134,11 +142,11 @@ HYPRE_ParCSRCGNRSetPrecond( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ) { - return( HYPRE_CGNRSetPrecond( solver, - (HYPRE_PtrToSolverFcn) precond, - (HYPRE_PtrToSolverFcn) precondT, - (HYPRE_PtrToSolverFcn) precond_setup, - precond_solver ) ); + return ( HYPRE_CGNRSetPrecond( solver, + (HYPRE_PtrToSolverFcn) precond, + (HYPRE_PtrToSolverFcn) precondT, + (HYPRE_PtrToSolverFcn) precond_setup, + precond_solver ) ); } /*-------------------------------------------------------------------------- @@ -149,7 +157,7 @@ HYPRE_Int HYPRE_ParCSRCGNRGetPrecond( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ) { - return( HYPRE_CGNRGetPrecond( solver, precond_data_ptr ) ); + return ( HYPRE_CGNRGetPrecond( solver, precond_data_ptr ) ); } /*-------------------------------------------------------------------------- @@ -160,7 +168,7 @@ HYPRE_Int HYPRE_ParCSRCGNRSetLogging( HYPRE_Solver solver, HYPRE_Int logging) { - return( HYPRE_CGNRSetLogging( solver, logging ) ); + return ( HYPRE_CGNRSetLogging( solver, logging ) ); } /*-------------------------------------------------------------------------- @@ -171,7 +179,7 @@ HYPRE_Int HYPRE_ParCSRCGNRGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ) { - return( HYPRE_CGNRGetNumIterations( solver, num_iterations ) ); + return ( HYPRE_CGNRGetNumIterations( solver, num_iterations ) ); } /*-------------------------------------------------------------------------- @@ -182,5 +190,5 @@ HYPRE_Int HYPRE_ParCSRCGNRGetFinalRelativeResidualNorm( HYPRE_Solver solver, HYPRE_Real *norm ) { - return( HYPRE_CGNRGetFinalRelativeResidualNorm( solver, norm ) ); + return ( HYPRE_CGNRGetFinalRelativeResidualNorm( solver, norm ) ); } diff --git a/external/hypre/src/parcsr_ls/HYPRE_parcsr_cogmres.c b/external/hypre/src/parcsr_ls/HYPRE_parcsr_cogmres.c index fbdc6b47..be386c09 100644 --- a/external/hypre/src/parcsr_ls/HYPRE_parcsr_cogmres.c +++ b/external/hypre/src/parcsr_ls/HYPRE_parcsr_cogmres.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -14,6 +14,8 @@ HYPRE_Int HYPRE_ParCSRCOGMRESCreate( MPI_Comm comm, HYPRE_Solver *solver ) { + HYPRE_UNUSED_VAR(comm); + hypre_COGMRESFunctions * cogmres_functions; if (!solver) @@ -23,17 +25,26 @@ HYPRE_ParCSRCOGMRESCreate( MPI_Comm comm, HYPRE_Solver *solver ) } cogmres_functions = hypre_COGMRESFunctionsCreate( - hypre_ParKrylovCAlloc, hypre_ParKrylovFree, hypre_ParKrylovCommInfo, + hypre_ParKrylovCAlloc, + hypre_ParKrylovFree, + hypre_ParKrylovCommInfo, hypre_ParKrylovCreateVector, hypre_ParKrylovCreateVectorArray, - hypre_ParKrylovDestroyVector, hypre_ParKrylovMatvecCreate, - hypre_ParKrylovMatvec, hypre_ParKrylovMatvecDestroy, - hypre_ParKrylovInnerProd, hypre_ParKrylovMassInnerProd, - hypre_ParKrylovMassDotpTwo, hypre_ParKrylovCopyVector, + hypre_ParKrylovDestroyVector, + hypre_ParKrylovMatvecCreate, + hypre_ParKrylovMatvec, + hypre_ParKrylovMatvecDestroy, + hypre_ParKrylovInnerProd, + hypre_ParKrylovMassInnerProd, + hypre_ParKrylovMassDotpTwo, + hypre_ParKrylovCopyVector, //hypre_ParKrylovCopyVector, hypre_ParKrylovClearVector, - hypre_ParKrylovScaleVector, hypre_ParKrylovAxpy,hypre_ParKrylovMassAxpy, - hypre_ParKrylovIdentitySetup, hypre_ParKrylovIdentity ); + hypre_ParKrylovScaleVector, + hypre_ParKrylovAxpy, + hypre_ParKrylovMassAxpy, + hypre_ParKrylovIdentitySetup, + hypre_ParKrylovIdentity ); *solver = ( (HYPRE_Solver) hypre_COGMRESCreate( cogmres_functions ) ); return hypre_error_flag; @@ -43,42 +54,42 @@ HYPRE_ParCSRCOGMRESCreate( MPI_Comm comm, HYPRE_Solver *solver ) * HYPRE_ParCSRCOGMRESDestroy *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_ParCSRCOGMRESDestroy( HYPRE_Solver solver ) { - return( hypre_COGMRESDestroy( (void *) solver ) ); + return ( hypre_COGMRESDestroy( (void *) solver ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRCOGMRESSetup *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_ParCSRCOGMRESSetup( HYPRE_Solver solver, - HYPRE_ParCSRMatrix A, - HYPRE_ParVector b, - HYPRE_ParVector x ) + HYPRE_ParCSRMatrix A, + HYPRE_ParVector b, + HYPRE_ParVector x ) { - return( HYPRE_COGMRESSetup( solver, - (HYPRE_Matrix) A, - (HYPRE_Vector) b, - (HYPRE_Vector) x ) ); + return ( HYPRE_COGMRESSetup( solver, + (HYPRE_Matrix) A, + (HYPRE_Vector) b, + (HYPRE_Vector) x ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRCOGMRESSolve *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_ParCSRCOGMRESSolve( HYPRE_Solver solver, - HYPRE_ParCSRMatrix A, - HYPRE_ParVector b, - HYPRE_ParVector x ) + HYPRE_ParCSRMatrix A, + HYPRE_ParVector b, + HYPRE_ParVector x ) { - return( HYPRE_COGMRESSolve( solver, - (HYPRE_Matrix) A, - (HYPRE_Vector) b, - (HYPRE_Vector) x ) ); + return ( HYPRE_COGMRESSolve( solver, + (HYPRE_Matrix) A, + (HYPRE_Vector) b, + (HYPRE_Vector) x ) ); } /*-------------------------------------------------------------------------- @@ -87,9 +98,9 @@ HYPRE_ParCSRCOGMRESSolve( HYPRE_Solver solver, HYPRE_Int HYPRE_ParCSRCOGMRESSetKDim( HYPRE_Solver solver, - HYPRE_Int k_dim ) + HYPRE_Int k_dim ) { - return( HYPRE_COGMRESSetKDim( solver, k_dim ) ); + return ( HYPRE_COGMRESSetKDim( solver, k_dim ) ); } /*-------------------------------------------------------------------------- @@ -98,9 +109,9 @@ HYPRE_ParCSRCOGMRESSetKDim( HYPRE_Solver solver, HYPRE_Int HYPRE_ParCSRCOGMRESSetUnroll( HYPRE_Solver solver, - HYPRE_Int unroll ) + HYPRE_Int unroll ) { - return( HYPRE_COGMRESSetUnroll( solver, unroll ) ); + return ( HYPRE_COGMRESSetUnroll( solver, unroll ) ); } /*-------------------------------------------------------------------------- @@ -109,9 +120,9 @@ HYPRE_ParCSRCOGMRESSetUnroll( HYPRE_Solver solver, HYPRE_Int HYPRE_ParCSRCOGMRESSetCGS( HYPRE_Solver solver, - HYPRE_Int cgs ) + HYPRE_Int cgs ) { - return( HYPRE_COGMRESSetCGS( solver, cgs ) ); + return ( HYPRE_COGMRESSetCGS( solver, cgs ) ); } /*-------------------------------------------------------------------------- @@ -120,9 +131,9 @@ HYPRE_ParCSRCOGMRESSetCGS( HYPRE_Solver solver, HYPRE_Int HYPRE_ParCSRCOGMRESSetTol( HYPRE_Solver solver, - HYPRE_Real tol ) + HYPRE_Real tol ) { - return( HYPRE_COGMRESSetTol( solver, tol ) ); + return ( HYPRE_COGMRESSetTol( solver, tol ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRCOGMRESSetAbsoluteTol @@ -130,9 +141,9 @@ HYPRE_ParCSRCOGMRESSetTol( HYPRE_Solver solver, HYPRE_Int HYPRE_ParCSRCOGMRESSetAbsoluteTol( HYPRE_Solver solver, - HYPRE_Real a_tol ) + HYPRE_Real a_tol ) { - return( HYPRE_COGMRESSetAbsoluteTol( solver, a_tol ) ); + return ( HYPRE_COGMRESSetAbsoluteTol( solver, a_tol ) ); } /*-------------------------------------------------------------------------- @@ -141,9 +152,9 @@ HYPRE_ParCSRCOGMRESSetAbsoluteTol( HYPRE_Solver solver, HYPRE_Int HYPRE_ParCSRCOGMRESSetMinIter( HYPRE_Solver solver, - HYPRE_Int min_iter ) + HYPRE_Int min_iter ) { - return( HYPRE_COGMRESSetMinIter( solver, min_iter ) ); + return ( HYPRE_COGMRESSetMinIter( solver, min_iter ) ); } /*-------------------------------------------------------------------------- @@ -152,9 +163,9 @@ HYPRE_ParCSRCOGMRESSetMinIter( HYPRE_Solver solver, HYPRE_Int HYPRE_ParCSRCOGMRESSetMaxIter( HYPRE_Solver solver, - HYPRE_Int max_iter ) + HYPRE_Int max_iter ) { - return( HYPRE_COGMRESSetMaxIter( solver, max_iter ) ); + return ( HYPRE_COGMRESSetMaxIter( solver, max_iter ) ); } /*-------------------------------------------------------------------------- @@ -163,14 +174,14 @@ HYPRE_ParCSRCOGMRESSetMaxIter( HYPRE_Solver solver, HYPRE_Int HYPRE_ParCSRCOGMRESSetPrecond( HYPRE_Solver solver, - HYPRE_PtrToParSolverFcn precond, - HYPRE_PtrToParSolverFcn precond_setup, - HYPRE_Solver precond_solver ) + HYPRE_PtrToParSolverFcn precond, + HYPRE_PtrToParSolverFcn precond_setup, + HYPRE_Solver precond_solver ) { - return( HYPRE_COGMRESSetPrecond( solver, - (HYPRE_PtrToSolverFcn) precond, - (HYPRE_PtrToSolverFcn) precond_setup, - precond_solver ) ); + return ( HYPRE_COGMRESSetPrecond( solver, + (HYPRE_PtrToSolverFcn) precond, + (HYPRE_PtrToSolverFcn) precond_setup, + precond_solver ) ); } /*-------------------------------------------------------------------------- @@ -179,9 +190,9 @@ HYPRE_ParCSRCOGMRESSetPrecond( HYPRE_Solver solver, HYPRE_Int HYPRE_ParCSRCOGMRESGetPrecond( HYPRE_Solver solver, - HYPRE_Solver *precond_data_ptr ) + HYPRE_Solver *precond_data_ptr ) { - return( HYPRE_COGMRESGetPrecond( solver, precond_data_ptr ) ); + return ( HYPRE_COGMRESGetPrecond( solver, precond_data_ptr ) ); } /*-------------------------------------------------------------------------- @@ -190,9 +201,9 @@ HYPRE_ParCSRCOGMRESGetPrecond( HYPRE_Solver solver, HYPRE_Int HYPRE_ParCSRCOGMRESSetLogging( HYPRE_Solver solver, - HYPRE_Int logging) + HYPRE_Int logging) { - return( HYPRE_COGMRESSetLogging( solver, logging ) ); + return ( HYPRE_COGMRESSetLogging( solver, logging ) ); } /*-------------------------------------------------------------------------- @@ -201,9 +212,9 @@ HYPRE_ParCSRCOGMRESSetLogging( HYPRE_Solver solver, HYPRE_Int HYPRE_ParCSRCOGMRESSetPrintLevel( HYPRE_Solver solver, - HYPRE_Int print_level) + HYPRE_Int print_level) { - return( HYPRE_COGMRESSetPrintLevel( solver, print_level ) ); + return ( HYPRE_COGMRESSetPrintLevel( solver, print_level ) ); } /*-------------------------------------------------------------------------- @@ -212,9 +223,9 @@ HYPRE_ParCSRCOGMRESSetPrintLevel( HYPRE_Solver solver, HYPRE_Int HYPRE_ParCSRCOGMRESGetNumIterations( HYPRE_Solver solver, - HYPRE_Int *num_iterations ) + HYPRE_Int *num_iterations ) { - return( HYPRE_COGMRESGetNumIterations( solver, num_iterations ) ); + return ( HYPRE_COGMRESGetNumIterations( solver, num_iterations ) ); } /*-------------------------------------------------------------------------- @@ -223,9 +234,9 @@ HYPRE_ParCSRCOGMRESGetNumIterations( HYPRE_Solver solver, HYPRE_Int HYPRE_ParCSRCOGMRESGetFinalRelativeResidualNorm( HYPRE_Solver solver, - HYPRE_Real *norm ) + HYPRE_Real *norm ) { - return( HYPRE_COGMRESGetFinalRelativeResidualNorm( solver, norm ) ); + return ( HYPRE_COGMRESGetFinalRelativeResidualNorm( solver, norm ) ); } /*-------------------------------------------------------------------------- @@ -236,5 +247,5 @@ HYPRE_Int HYPRE_ParCSRCOGMRESGetResidual( HYPRE_Solver solver, HYPRE_ParVector *residual) { - return( HYPRE_COGMRESGetResidual( solver, (void *) residual ) ); + return ( HYPRE_COGMRESGetResidual( solver, (void *) residual ) ); } diff --git a/external/hypre/src/parcsr_ls/HYPRE_parcsr_flexgmres.c b/external/hypre/src/parcsr_ls/HYPRE_parcsr_flexgmres.c index c5a0cf90..ac8c824f 100644 --- a/external/hypre/src/parcsr_ls/HYPRE_parcsr_flexgmres.c +++ b/external/hypre/src/parcsr_ls/HYPRE_parcsr_flexgmres.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -14,6 +14,8 @@ HYPRE_Int HYPRE_ParCSRFlexGMRESCreate( MPI_Comm comm, HYPRE_Solver *solver ) { + HYPRE_UNUSED_VAR(comm); + hypre_FlexGMRESFunctions * fgmres_functions; if (!solver) @@ -23,15 +25,22 @@ HYPRE_ParCSRFlexGMRESCreate( MPI_Comm comm, HYPRE_Solver *solver ) } fgmres_functions = hypre_FlexGMRESFunctionsCreate( - hypre_ParKrylovCAlloc, hypre_ParKrylovFree, hypre_ParKrylovCommInfo, + hypre_ParKrylovCAlloc, + hypre_ParKrylovFree, + hypre_ParKrylovCommInfo, hypre_ParKrylovCreateVector, hypre_ParKrylovCreateVectorArray, - hypre_ParKrylovDestroyVector, hypre_ParKrylovMatvecCreate, - hypre_ParKrylovMatvec, hypre_ParKrylovMatvecDestroy, - hypre_ParKrylovInnerProd, hypre_ParKrylovCopyVector, + hypre_ParKrylovDestroyVector, + hypre_ParKrylovMatvecCreate, + hypre_ParKrylovMatvec, + hypre_ParKrylovMatvecDestroy, + hypre_ParKrylovInnerProd, + hypre_ParKrylovCopyVector, hypre_ParKrylovClearVector, - hypre_ParKrylovScaleVector, hypre_ParKrylovAxpy, - hypre_ParKrylovIdentitySetup, hypre_ParKrylovIdentity ); + hypre_ParKrylovScaleVector, + hypre_ParKrylovAxpy, + hypre_ParKrylovIdentitySetup, + hypre_ParKrylovIdentity ); *solver = ( (HYPRE_Solver) hypre_FlexGMRESCreate( fgmres_functions ) ); return hypre_error_flag; @@ -41,42 +50,42 @@ HYPRE_ParCSRFlexGMRESCreate( MPI_Comm comm, HYPRE_Solver *solver ) * HYPRE_ParCSRFlexGMRESDestroy *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_ParCSRFlexGMRESDestroy( HYPRE_Solver solver ) { - return( hypre_FlexGMRESDestroy( (void *) solver ) ); + return ( hypre_FlexGMRESDestroy( (void *) solver ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRFlexGMRESSetup *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_ParCSRFlexGMRESSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) { - return( HYPRE_FlexGMRESSetup( solver, - (HYPRE_Matrix) A, - (HYPRE_Vector) b, - (HYPRE_Vector) x ) ); + return ( HYPRE_FlexGMRESSetup( solver, + (HYPRE_Matrix) A, + (HYPRE_Vector) b, + (HYPRE_Vector) x ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRFlexGMRESSolve *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_ParCSRFlexGMRESSolve( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) { - return( HYPRE_FlexGMRESSolve( solver, - (HYPRE_Matrix) A, - (HYPRE_Vector) b, - (HYPRE_Vector) x ) ); + return ( HYPRE_FlexGMRESSolve( solver, + (HYPRE_Matrix) A, + (HYPRE_Vector) b, + (HYPRE_Vector) x ) ); } /*-------------------------------------------------------------------------- @@ -87,7 +96,7 @@ HYPRE_Int HYPRE_ParCSRFlexGMRESSetKDim( HYPRE_Solver solver, HYPRE_Int k_dim ) { - return( HYPRE_FlexGMRESSetKDim( solver, k_dim ) ); + return ( HYPRE_FlexGMRESSetKDim( solver, k_dim ) ); } /*-------------------------------------------------------------------------- @@ -98,7 +107,7 @@ HYPRE_Int HYPRE_ParCSRFlexGMRESSetTol( HYPRE_Solver solver, HYPRE_Real tol ) { - return( HYPRE_FlexGMRESSetTol( solver, tol ) ); + return ( HYPRE_FlexGMRESSetTol( solver, tol ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRFlexGMRESSetAbsoluteTol @@ -108,7 +117,7 @@ HYPRE_Int HYPRE_ParCSRFlexGMRESSetAbsoluteTol( HYPRE_Solver solver, HYPRE_Real a_tol ) { - return( HYPRE_FlexGMRESSetAbsoluteTol( solver, a_tol ) ); + return ( HYPRE_FlexGMRESSetAbsoluteTol( solver, a_tol ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRFlexGMRESSetMinIter @@ -118,7 +127,7 @@ HYPRE_Int HYPRE_ParCSRFlexGMRESSetMinIter( HYPRE_Solver solver, HYPRE_Int min_iter ) { - return( HYPRE_FlexGMRESSetMinIter( solver, min_iter ) ); + return ( HYPRE_FlexGMRESSetMinIter( solver, min_iter ) ); } /*-------------------------------------------------------------------------- @@ -129,7 +138,7 @@ HYPRE_Int HYPRE_ParCSRFlexGMRESSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ) { - return( HYPRE_FlexGMRESSetMaxIter( solver, max_iter ) ); + return ( HYPRE_FlexGMRESSetMaxIter( solver, max_iter ) ); } /*-------------------------------------------------------------------------- @@ -142,10 +151,10 @@ HYPRE_ParCSRFlexGMRESSetPrecond( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ) { - return( HYPRE_FlexGMRESSetPrecond( solver, - (HYPRE_PtrToSolverFcn) precond, - (HYPRE_PtrToSolverFcn) precond_setup, - precond_solver ) ); + return ( HYPRE_FlexGMRESSetPrecond( solver, + (HYPRE_PtrToSolverFcn) precond, + (HYPRE_PtrToSolverFcn) precond_setup, + precond_solver ) ); } /*-------------------------------------------------------------------------- @@ -156,7 +165,7 @@ HYPRE_Int HYPRE_ParCSRFlexGMRESGetPrecond( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ) { - return( HYPRE_FlexGMRESGetPrecond( solver, precond_data_ptr ) ); + return ( HYPRE_FlexGMRESGetPrecond( solver, precond_data_ptr ) ); } /*-------------------------------------------------------------------------- @@ -167,7 +176,7 @@ HYPRE_Int HYPRE_ParCSRFlexGMRESSetLogging( HYPRE_Solver solver, HYPRE_Int logging) { - return( HYPRE_FlexGMRESSetLogging( solver, logging ) ); + return ( HYPRE_FlexGMRESSetLogging( solver, logging ) ); } /*-------------------------------------------------------------------------- @@ -178,7 +187,7 @@ HYPRE_Int HYPRE_ParCSRFlexGMRESSetPrintLevel( HYPRE_Solver solver, HYPRE_Int print_level) { - return( HYPRE_FlexGMRESSetPrintLevel( solver, print_level ) ); + return ( HYPRE_FlexGMRESSetPrintLevel( solver, print_level ) ); } /*-------------------------------------------------------------------------- @@ -189,7 +198,7 @@ HYPRE_Int HYPRE_ParCSRFlexGMRESGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ) { - return( HYPRE_FlexGMRESGetNumIterations( solver, num_iterations ) ); + return ( HYPRE_FlexGMRESGetNumIterations( solver, num_iterations ) ); } /*-------------------------------------------------------------------------- @@ -200,7 +209,7 @@ HYPRE_Int HYPRE_ParCSRFlexGMRESGetFinalRelativeResidualNorm( HYPRE_Solver solver, HYPRE_Real *norm ) { - return( HYPRE_FlexGMRESGetFinalRelativeResidualNorm( solver, norm ) ); + return ( HYPRE_FlexGMRESGetFinalRelativeResidualNorm( solver, norm ) ); } /*-------------------------------------------------------------------------- @@ -211,13 +220,13 @@ HYPRE_Int HYPRE_ParCSRFlexGMRESGetResidual( HYPRE_Solver solver, HYPRE_ParVector *residual) { - return( HYPRE_FlexGMRESGetResidual( solver, (void *) residual ) ); + return ( HYPRE_FlexGMRESGetResidual( solver, (void *) residual ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRFlexGMRESSetModifyPC *--------------------------------------------------------------------------*/ - + HYPRE_Int HYPRE_ParCSRFlexGMRESSetModifyPC( HYPRE_Solver solver, HYPRE_PtrToModifyPCFcn modify_pc) @@ -225,6 +234,3 @@ HYPRE_Int HYPRE_ParCSRFlexGMRESSetModifyPC( HYPRE_Solver solver, return ( HYPRE_FlexGMRESSetModifyPC( solver, (HYPRE_PtrToModifyPCFcn) modify_pc)); } - - - diff --git a/external/hypre/src/parcsr_ls/HYPRE_parcsr_fsai.c b/external/hypre/src/parcsr_ls/HYPRE_parcsr_fsai.c new file mode 100644 index 00000000..88e654a2 --- /dev/null +++ b/external/hypre/src/parcsr_ls/HYPRE_parcsr_fsai.c @@ -0,0 +1,375 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#include "_hypre_parcsr_ls.h" + +/*-------------------------------------------------------------------------- + * HYPRE_FSAICreate + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAICreate( HYPRE_Solver *solver) +{ + if (!solver) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + *solver = (HYPRE_Solver) hypre_FSAICreate( ) ; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * HYPRE_FSAIDestroy + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAIDestroy( HYPRE_Solver solver ) +{ + return ( hypre_FSAIDestroy( (void *) solver ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_FSAISetup + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISetup( HYPRE_Solver solver, + HYPRE_ParCSRMatrix A, + HYPRE_ParVector b, + HYPRE_ParVector x ) +{ + return ( hypre_FSAISetup( (void *) solver, + (hypre_ParCSRMatrix *) A, + (hypre_ParVector *) b, + (hypre_ParVector *) x ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_FSAISolve + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISolve( HYPRE_Solver solver, + HYPRE_ParCSRMatrix A, + HYPRE_ParVector b, + HYPRE_ParVector x ) +{ + return ( hypre_FSAISolve( (void *) solver, + (hypre_ParCSRMatrix *) A, + (hypre_ParVector *) b, + (hypre_ParVector *) x ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_FSAISetAlgoType + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISetAlgoType( HYPRE_Solver solver, + HYPRE_Int algo_type ) +{ + return ( hypre_FSAISetAlgoType( (void *) solver, algo_type ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_FSAIGetAlgoType + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAIGetAlgoType( HYPRE_Solver solver, + HYPRE_Int *algo_type ) +{ + return ( hypre_FSAIGetAlgoType( (void *) solver, algo_type ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_FSAISetLocalSolveType + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISetLocalSolveType( HYPRE_Solver solver, + HYPRE_Int local_solve_type ) +{ + return ( hypre_FSAISetLocalSolveType( (void *) solver, local_solve_type ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_FSAIGetLocalSolveType + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAIGetLocalSolveType( HYPRE_Solver solver, + HYPRE_Int *local_solve_type ) +{ + return ( hypre_FSAIGetLocalSolveType( (void *) solver, local_solve_type ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_FSAISetMaxSteps + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISetMaxSteps( HYPRE_Solver solver, + HYPRE_Int max_steps ) +{ + return ( hypre_FSAISetMaxSteps( (void *) solver, max_steps ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_FSAIGetMaxSteps + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAIGetMaxSteps( HYPRE_Solver solver, + HYPRE_Int *max_steps ) +{ + return ( hypre_FSAIGetMaxSteps( (void *) solver, max_steps ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_FSAISetMaxNnzRow + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISetMaxNnzRow( HYPRE_Solver solver, + HYPRE_Int max_nnz_row ) +{ + return ( hypre_FSAISetMaxNnzRow( (void *) solver, max_nnz_row ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_FSAIGetMaxNnzRow + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAIGetMaxNnzRow( HYPRE_Solver solver, + HYPRE_Int *max_nnz_row ) +{ + return ( hypre_FSAIGetMaxNnzRow( (void *) solver, max_nnz_row ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_FSAISetMaxStepSize + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISetMaxStepSize( HYPRE_Solver solver, + HYPRE_Int max_step_size ) +{ + return ( hypre_FSAISetMaxStepSize( (void *) solver, max_step_size ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_FSAIGetMaxStepSize + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAIGetMaxStepSize( HYPRE_Solver solver, + HYPRE_Int *max_step_size ) +{ + return ( hypre_FSAIGetMaxStepSize( (void *) solver, max_step_size ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_FSAISetNumLevels + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISetNumLevels( HYPRE_Solver solver, + HYPRE_Int num_levels ) +{ + return ( hypre_FSAISetNumLevels( (void *) solver, num_levels ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_FSAIGetNumLevels + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAIGetNumLevels( HYPRE_Solver solver, + HYPRE_Int *num_levels ) +{ + return ( hypre_FSAIGetNumLevels( (void *) solver, num_levels ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_FSAISetThreshold + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISetThreshold( HYPRE_Solver solver, + HYPRE_Real threshold ) +{ + return ( hypre_FSAISetThreshold( (void *) solver, threshold ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_FSAIGetThreshold + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAIGetThreshold( HYPRE_Solver solver, + HYPRE_Real *threshold ) +{ + return ( hypre_FSAIGetThreshold( (void *) solver, threshold ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_FSAISetZeroGuess + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISetZeroGuess( HYPRE_Solver solver, + HYPRE_Int zero_guess ) +{ + return ( hypre_FSAISetZeroGuess( (void *) solver, zero_guess ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_FSAIGetZeroGuess + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAIGetZeroGuess( HYPRE_Solver solver, + HYPRE_Int *zero_guess ) +{ + return ( hypre_FSAIGetZeroGuess( (void *) solver, zero_guess ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_FSAISetKapTolerance + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISetKapTolerance( HYPRE_Solver solver, + HYPRE_Real kap_tolerance ) +{ + return ( hypre_FSAISetKapTolerance( (void *) solver, kap_tolerance ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_FSAIGetKapTolerance + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAIGetKapTolerance( HYPRE_Solver solver, + HYPRE_Real *kap_tolerance ) +{ + return ( hypre_FSAIGetKapTolerance( (void *) solver, kap_tolerance ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_FSAISetTolerance + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISetTolerance( HYPRE_Solver solver, + HYPRE_Real tolerance ) +{ + return ( hypre_FSAISetTolerance( (void *) solver, tolerance ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_FSAIGetTolerance + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAIGetTolerance( HYPRE_Solver solver, + HYPRE_Real *tolerance ) +{ + return ( hypre_FSAIGetTolerance( (void *) solver, tolerance ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_FSAISetOmega + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISetOmega( HYPRE_Solver solver, + HYPRE_Real omega ) +{ + return ( hypre_FSAISetOmega( (void *) solver, omega ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_FSAIGetOmega + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAIGetOmega( HYPRE_Solver solver, + HYPRE_Real *omega ) +{ + return ( hypre_FSAIGetOmega( (void *) solver, omega ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_FSAISetMaxIterations + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISetMaxIterations( HYPRE_Solver solver, + HYPRE_Int max_iterations ) +{ + return ( hypre_FSAISetMaxIterations( (void *) solver, max_iterations ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_FSAIGetMaxIterations + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAIGetMaxIterations( HYPRE_Solver solver, + HYPRE_Int *max_iterations ) +{ + return ( hypre_FSAIGetMaxIterations( (void *) solver, max_iterations ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_FSAISetEigMaxIters + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISetEigMaxIters( HYPRE_Solver solver, + HYPRE_Int eig_max_iters ) +{ + return ( hypre_FSAISetEigMaxIters( (void *) solver, eig_max_iters ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_FSAIGetEigMaxIters + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAIGetEigMaxIters( HYPRE_Solver solver, + HYPRE_Int *eig_max_iters ) +{ + return ( hypre_FSAIGetEigMaxIters( (void *) solver, eig_max_iters ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_FSAISetPrintLevel + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISetPrintLevel( HYPRE_Solver solver, + HYPRE_Int print_level ) +{ + return ( hypre_FSAISetPrintLevel( (void *) solver, print_level ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_FSAIGetPrintLevel + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAIGetPrintLevel( HYPRE_Solver solver, + HYPRE_Int *print_level ) +{ + return ( hypre_FSAIGetPrintLevel( (void *) solver, print_level ) ); +} diff --git a/external/hypre/src/parcsr_ls/HYPRE_parcsr_gmres.c b/external/hypre/src/parcsr_ls/HYPRE_parcsr_gmres.c index 7d77bcfd..dd7215e6 100644 --- a/external/hypre/src/parcsr_ls/HYPRE_parcsr_gmres.c +++ b/external/hypre/src/parcsr_ls/HYPRE_parcsr_gmres.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -14,6 +14,8 @@ HYPRE_Int HYPRE_ParCSRGMRESCreate( MPI_Comm comm, HYPRE_Solver *solver ) { + HYPRE_UNUSED_VAR(comm); + hypre_GMRESFunctions * gmres_functions; if (!solver) @@ -23,15 +25,22 @@ HYPRE_ParCSRGMRESCreate( MPI_Comm comm, HYPRE_Solver *solver ) } gmres_functions = hypre_GMRESFunctionsCreate( - hypre_ParKrylovCAlloc, hypre_ParKrylovFree, hypre_ParKrylovCommInfo, + hypre_ParKrylovCAlloc, + hypre_ParKrylovFree, + hypre_ParKrylovCommInfo, hypre_ParKrylovCreateVector, hypre_ParKrylovCreateVectorArray, - hypre_ParKrylovDestroyVector, hypre_ParKrylovMatvecCreate, - hypre_ParKrylovMatvec, hypre_ParKrylovMatvecDestroy, - hypre_ParKrylovInnerProd, hypre_ParKrylovCopyVector, + hypre_ParKrylovDestroyVector, + hypre_ParKrylovMatvecCreate, + hypre_ParKrylovMatvec, + hypre_ParKrylovMatvecDestroy, + hypre_ParKrylovInnerProd, + hypre_ParKrylovCopyVector, hypre_ParKrylovClearVector, - hypre_ParKrylovScaleVector, hypre_ParKrylovAxpy, - hypre_ParKrylovIdentitySetup, hypre_ParKrylovIdentity ); + hypre_ParKrylovScaleVector, + hypre_ParKrylovAxpy, + hypre_ParKrylovIdentitySetup, + hypre_ParKrylovIdentity ); *solver = ( (HYPRE_Solver) hypre_GMRESCreate( gmres_functions ) ); return hypre_error_flag; @@ -44,7 +53,7 @@ HYPRE_ParCSRGMRESCreate( MPI_Comm comm, HYPRE_Solver *solver ) HYPRE_Int HYPRE_ParCSRGMRESDestroy( HYPRE_Solver solver ) { - return( hypre_GMRESDestroy( (void *) solver ) ); + return ( hypre_GMRESDestroy( (void *) solver ) ); } /*-------------------------------------------------------------------------- @@ -57,10 +66,10 @@ HYPRE_ParCSRGMRESSetup( HYPRE_Solver solver, HYPRE_ParVector b, HYPRE_ParVector x ) { - return( HYPRE_GMRESSetup( solver, - (HYPRE_Matrix) A, - (HYPRE_Vector) b, - (HYPRE_Vector) x ) ); + return ( HYPRE_GMRESSetup( solver, + (HYPRE_Matrix) A, + (HYPRE_Vector) b, + (HYPRE_Vector) x ) ); } /*-------------------------------------------------------------------------- @@ -73,10 +82,10 @@ HYPRE_ParCSRGMRESSolve( HYPRE_Solver solver, HYPRE_ParVector b, HYPRE_ParVector x ) { - return( HYPRE_GMRESSolve( solver, - (HYPRE_Matrix) A, - (HYPRE_Vector) b, - (HYPRE_Vector) x ) ); + return ( HYPRE_GMRESSolve( solver, + (HYPRE_Matrix) A, + (HYPRE_Vector) b, + (HYPRE_Vector) x ) ); } /*-------------------------------------------------------------------------- @@ -87,7 +96,7 @@ HYPRE_Int HYPRE_ParCSRGMRESSetKDim( HYPRE_Solver solver, HYPRE_Int k_dim ) { - return( HYPRE_GMRESSetKDim( solver, k_dim ) ); + return ( HYPRE_GMRESSetKDim( solver, k_dim ) ); } /*-------------------------------------------------------------------------- @@ -98,7 +107,7 @@ HYPRE_Int HYPRE_ParCSRGMRESSetTol( HYPRE_Solver solver, HYPRE_Real tol ) { - return( HYPRE_GMRESSetTol( solver, tol ) ); + return ( HYPRE_GMRESSetTol( solver, tol ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRGMRESSetAbsoluteTol @@ -108,7 +117,7 @@ HYPRE_Int HYPRE_ParCSRGMRESSetAbsoluteTol( HYPRE_Solver solver, HYPRE_Real a_tol ) { - return( HYPRE_GMRESSetAbsoluteTol( solver, a_tol ) ); + return ( HYPRE_GMRESSetAbsoluteTol( solver, a_tol ) ); } /*-------------------------------------------------------------------------- @@ -119,7 +128,7 @@ HYPRE_Int HYPRE_ParCSRGMRESSetMinIter( HYPRE_Solver solver, HYPRE_Int min_iter ) { - return( HYPRE_GMRESSetMinIter( solver, min_iter ) ); + return ( HYPRE_GMRESSetMinIter( solver, min_iter ) ); } /*-------------------------------------------------------------------------- @@ -130,7 +139,7 @@ HYPRE_Int HYPRE_ParCSRGMRESSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ) { - return( HYPRE_GMRESSetMaxIter( solver, max_iter ) ); + return ( HYPRE_GMRESSetMaxIter( solver, max_iter ) ); } /*-------------------------------------------------------------------------- @@ -141,7 +150,7 @@ HYPRE_Int HYPRE_ParCSRGMRESSetStopCrit( HYPRE_Solver solver, HYPRE_Int stop_crit ) { - return( HYPRE_GMRESSetStopCrit( solver, stop_crit ) ); + return ( HYPRE_GMRESSetStopCrit( solver, stop_crit ) ); } /*-------------------------------------------------------------------------- @@ -154,10 +163,10 @@ HYPRE_ParCSRGMRESSetPrecond( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ) { - return( HYPRE_GMRESSetPrecond( solver, - (HYPRE_PtrToSolverFcn) precond, - (HYPRE_PtrToSolverFcn) precond_setup, - precond_solver ) ); + return ( HYPRE_GMRESSetPrecond( solver, + (HYPRE_PtrToSolverFcn) precond, + (HYPRE_PtrToSolverFcn) precond_setup, + precond_solver ) ); } /*-------------------------------------------------------------------------- @@ -168,7 +177,7 @@ HYPRE_Int HYPRE_ParCSRGMRESGetPrecond( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ) { - return( HYPRE_GMRESGetPrecond( solver, precond_data_ptr ) ); + return ( HYPRE_GMRESGetPrecond( solver, precond_data_ptr ) ); } /*-------------------------------------------------------------------------- @@ -179,7 +188,7 @@ HYPRE_Int HYPRE_ParCSRGMRESSetLogging( HYPRE_Solver solver, HYPRE_Int logging) { - return( HYPRE_GMRESSetLogging( solver, logging ) ); + return ( HYPRE_GMRESSetLogging( solver, logging ) ); } /*-------------------------------------------------------------------------- @@ -190,7 +199,7 @@ HYPRE_Int HYPRE_ParCSRGMRESSetPrintLevel( HYPRE_Solver solver, HYPRE_Int print_level) { - return( HYPRE_GMRESSetPrintLevel( solver, print_level ) ); + return ( HYPRE_GMRESSetPrintLevel( solver, print_level ) ); } /*-------------------------------------------------------------------------- @@ -201,7 +210,7 @@ HYPRE_Int HYPRE_ParCSRGMRESGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ) { - return( HYPRE_GMRESGetNumIterations( solver, num_iterations ) ); + return ( HYPRE_GMRESGetNumIterations( solver, num_iterations ) ); } /*-------------------------------------------------------------------------- @@ -212,7 +221,7 @@ HYPRE_Int HYPRE_ParCSRGMRESGetFinalRelativeResidualNorm( HYPRE_Solver solver, HYPRE_Real *norm ) { - return( HYPRE_GMRESGetFinalRelativeResidualNorm( solver, norm ) ); + return ( HYPRE_GMRESGetFinalRelativeResidualNorm( solver, norm ) ); } /*-------------------------------------------------------------------------- @@ -223,28 +232,35 @@ HYPRE_Int HYPRE_ParCSRGMRESGetResidual( HYPRE_Solver solver, HYPRE_ParVector *residual ) { - return( HYPRE_GMRESGetResidual( solver, (void *) residual ) ); + return ( HYPRE_GMRESGetResidual( solver, (void *) residual ) ); } /*-------------------------------------------------------------------------- * Setup routine for on-processor triangular solve as preconditioning. *--------------------------------------------------------------------------*/ -HYPRE_Int HYPRE_ParCSROnProcTriSetup(HYPRE_Solver solver, - HYPRE_ParCSRMatrix HA, - HYPRE_ParVector Hy, - HYPRE_ParVector Hx) + +HYPRE_Int +HYPRE_ParCSROnProcTriSetup(HYPRE_Solver solver, + HYPRE_ParCSRMatrix HA, + HYPRE_ParVector Hy, + HYPRE_ParVector Hx) { + HYPRE_UNUSED_VAR(solver); + HYPRE_UNUSED_VAR(Hy); + HYPRE_UNUSED_VAR(Hx); + hypre_ParCSRMatrix *A = (hypre_ParCSRMatrix *) HA; - // Check for and get topological ordering of matrix + /* Check for and get topological ordering of matrix */ if (!hypre_ParCSRMatrixProcOrdering(A)) { - hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); - HYPRE_Real *A_diag_data = hypre_CSRMatrixData(A_diag); - HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); - HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); - HYPRE_Int n = hypre_CSRMatrixNumRows(A_diag); - HYPRE_Int *proc_ordering = hypre_TAlloc(HYPRE_Int, n, HYPRE_MEMORY_HOST); + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + HYPRE_Real *A_diag_data = hypre_CSRMatrixData(A_diag); + HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); + HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); + HYPRE_Int n = hypre_CSRMatrixNumRows(A_diag); + HYPRE_Int *proc_ordering = hypre_TAlloc(HYPRE_Int, n, HYPRE_MEMORY_HOST); + hypre_topo_sort(A_diag_i, A_diag_j, A_diag_data, proc_ordering, n); hypre_ParCSRMatrixProcOrdering(A) = proc_ordering; } @@ -252,20 +268,24 @@ HYPRE_Int HYPRE_ParCSROnProcTriSetup(HYPRE_Solver solver, return 0; } - /*-------------------------------------------------------------------------- * Solve routine for on-processor triangular solve as preconditioning. *--------------------------------------------------------------------------*/ -HYPRE_Int HYPRE_ParCSROnProcTriSolve(HYPRE_Solver solver, - HYPRE_ParCSRMatrix HA, - HYPRE_ParVector Hy, - HYPRE_ParVector Hx) + +HYPRE_Int +HYPRE_ParCSROnProcTriSolve(HYPRE_Solver solver, + HYPRE_ParCSRMatrix HA, + HYPRE_ParVector Hy, + HYPRE_ParVector Hx) { + HYPRE_UNUSED_VAR(solver); + hypre_ParCSRMatrix *A = (hypre_ParCSRMatrix *) HA; hypre_ParVector *y = (hypre_ParVector *) Hy; hypre_ParVector *x = (hypre_ParVector *) Hx; - HYPRE_Int ierr = 0; - ierr = hypre_BoomerAMGRelax(A,y,NULL,10,0,1,1,NULL,x,NULL,NULL); + HYPRE_Int ierr = 0; + + ierr = hypre_BoomerAMGRelax(A, y, NULL, 10, 0, 1, 1, NULL, x, NULL, NULL); + return ierr; } - diff --git a/external/hypre/src/parcsr_ls/HYPRE_parcsr_hybrid.c b/external/hypre/src/parcsr_ls/HYPRE_parcsr_hybrid.c index a8ec2753..7c1e1c62 100644 --- a/external/hypre/src/parcsr_ls/HYPRE_parcsr_hybrid.c +++ b/external/hypre/src/parcsr_ls/HYPRE_parcsr_hybrid.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -27,42 +27,42 @@ HYPRE_ParCSRHybridCreate( HYPRE_Solver *solver ) * HYPRE_ParCSRHybridDestroy *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_ParCSRHybridDestroy( HYPRE_Solver solver ) { - return( hypre_AMGHybridDestroy( (void *) solver ) ); + return ( hypre_AMGHybridDestroy( (void *) solver ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRHybridSetup *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_ParCSRHybridSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) { - return( hypre_AMGHybridSetup( (void *) solver, - (hypre_ParCSRMatrix *) A, - (hypre_ParVector *) b, - (hypre_ParVector *) x ) ); + return ( hypre_AMGHybridSetup( (void *) solver, + (hypre_ParCSRMatrix *) A, + (hypre_ParVector *) b, + (hypre_ParVector *) x ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRHybridSolve *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_ParCSRHybridSolve( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) { - return( hypre_AMGHybridSolve( (void *) solver, - (hypre_ParCSRMatrix *) A, - (hypre_ParVector *) b, - (hypre_ParVector *) x ) ); + return ( hypre_AMGHybridSolve( (void *) solver, + (hypre_ParCSRMatrix *) A, + (hypre_ParVector *) b, + (hypre_ParVector *) x ) ); } /*-------------------------------------------------------------------------- @@ -73,7 +73,7 @@ HYPRE_Int HYPRE_ParCSRHybridSetTol( HYPRE_Solver solver, HYPRE_Real tol ) { - return( hypre_AMGHybridSetTol( (void *) solver, tol ) ); + return ( hypre_AMGHybridSetTol( (void *) solver, tol ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRHybridSetAbsoluteTol @@ -83,7 +83,7 @@ HYPRE_Int HYPRE_ParCSRHybridSetAbsoluteTol( HYPRE_Solver solver, HYPRE_Real tol ) { - return( hypre_AMGHybridSetAbsoluteTol( (void *) solver, tol ) ); + return ( hypre_AMGHybridSetAbsoluteTol( (void *) solver, tol ) ); } /*-------------------------------------------------------------------------- @@ -94,7 +94,7 @@ HYPRE_Int HYPRE_ParCSRHybridSetConvergenceTol( HYPRE_Solver solver, HYPRE_Real cf_tol ) { - return( hypre_AMGHybridSetConvergenceTol( (void *) solver, cf_tol ) ); + return ( hypre_AMGHybridSetConvergenceTol( (void *) solver, cf_tol ) ); } /*-------------------------------------------------------------------------- @@ -105,7 +105,7 @@ HYPRE_Int HYPRE_ParCSRHybridSetDSCGMaxIter( HYPRE_Solver solver, HYPRE_Int dscg_max_its ) { - return( hypre_AMGHybridSetDSCGMaxIter( (void *) solver, dscg_max_its ) ); + return ( hypre_AMGHybridSetDSCGMaxIter( (void *) solver, dscg_max_its ) ); } /*-------------------------------------------------------------------------- @@ -116,7 +116,7 @@ HYPRE_Int HYPRE_ParCSRHybridSetPCGMaxIter( HYPRE_Solver solver, HYPRE_Int pcg_max_its ) { - return( hypre_AMGHybridSetPCGMaxIter( (void *) solver, pcg_max_its ) ); + return ( hypre_AMGHybridSetPCGMaxIter( (void *) solver, pcg_max_its ) ); } /*-------------------------------------------------------------------------- @@ -127,7 +127,7 @@ HYPRE_Int HYPRE_ParCSRHybridSetSetupType( HYPRE_Solver solver, HYPRE_Int setup_type ) { - return( hypre_AMGHybridSetSetupType( (void *) solver, setup_type ) ); + return ( hypre_AMGHybridSetSetupType( (void *) solver, setup_type ) ); } /*-------------------------------------------------------------------------- @@ -138,7 +138,7 @@ HYPRE_Int HYPRE_ParCSRHybridSetSolverType( HYPRE_Solver solver, HYPRE_Int solver_type ) { - return( hypre_AMGHybridSetSolverType( (void *) solver, solver_type ) ); + return ( hypre_AMGHybridSetSolverType( (void *) solver, solver_type ) ); } /*-------------------------------------------------------------------------- @@ -148,14 +148,14 @@ HYPRE_Int HYPRE_ParCSRHybridSetRecomputeResidual( HYPRE_Solver solver, HYPRE_Int recompute_residual ) { - return( hypre_AMGHybridSetRecomputeResidual( (void *) solver, recompute_residual ) ); + return ( hypre_AMGHybridSetRecomputeResidual( (void *) solver, recompute_residual ) ); } HYPRE_Int HYPRE_ParCSRHybridGetRecomputeResidual( HYPRE_Solver solver, HYPRE_Int *recompute_residual ) { - return( hypre_AMGHybridGetRecomputeResidual( (void *) solver, recompute_residual ) ); + return ( hypre_AMGHybridGetRecomputeResidual( (void *) solver, recompute_residual ) ); } /*-------------------------------------------------------------------------- @@ -165,14 +165,14 @@ HYPRE_Int HYPRE_ParCSRHybridSetRecomputeResidualP( HYPRE_Solver solver, HYPRE_Int recompute_residual_p ) { - return( hypre_AMGHybridSetRecomputeResidualP( (void *) solver, recompute_residual_p ) ); + return ( hypre_AMGHybridSetRecomputeResidualP( (void *) solver, recompute_residual_p ) ); } HYPRE_Int HYPRE_ParCSRHybridGetRecomputeResidualP( HYPRE_Solver solver, HYPRE_Int *recompute_residual_p ) { - return( hypre_AMGHybridGetRecomputeResidualP( (void *) solver, recompute_residual_p ) ); + return ( hypre_AMGHybridGetRecomputeResidualP( (void *) solver, recompute_residual_p ) ); } /*-------------------------------------------------------------------------- @@ -183,7 +183,7 @@ HYPRE_Int HYPRE_ParCSRHybridSetKDim( HYPRE_Solver solver, HYPRE_Int k_dim ) { - return( hypre_AMGHybridSetKDim( (void *) solver, k_dim ) ); + return ( hypre_AMGHybridSetKDim( (void *) solver, k_dim ) ); } /*-------------------------------------------------------------------------- @@ -194,7 +194,7 @@ HYPRE_Int HYPRE_ParCSRHybridSetTwoNorm( HYPRE_Solver solver, HYPRE_Int two_norm ) { - return( hypre_AMGHybridSetTwoNorm( (void *) solver, two_norm ) ); + return ( hypre_AMGHybridSetTwoNorm( (void *) solver, two_norm ) ); } /*-------------------------------------------------------------------------- @@ -205,7 +205,7 @@ HYPRE_Int HYPRE_ParCSRHybridSetStopCrit( HYPRE_Solver solver, HYPRE_Int stop_crit ) { - return( hypre_AMGHybridSetStopCrit( (void *) solver, stop_crit ) ); + return ( hypre_AMGHybridSetStopCrit( (void *) solver, stop_crit ) ); } /*-------------------------------------------------------------------------- @@ -216,7 +216,7 @@ HYPRE_Int HYPRE_ParCSRHybridSetRelChange( HYPRE_Solver solver, HYPRE_Int rel_change ) { - return( hypre_AMGHybridSetRelChange( (void *) solver, rel_change ) ); + return ( hypre_AMGHybridSetRelChange( (void *) solver, rel_change ) ); } /*-------------------------------------------------------------------------- @@ -229,10 +229,10 @@ HYPRE_ParCSRHybridSetPrecond( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ) { - return( hypre_AMGHybridSetPrecond( (void *) solver, - (HYPRE_Int (*)(void*, void*, void*, void*) ) precond, - (HYPRE_Int (*)(void*, void*, void*, void*) ) precond_setup, - (void *) precond_solver ) ); + return ( hypre_AMGHybridSetPrecond( (void *) solver, + (HYPRE_Int (*)(void*, void*, void*, void*) ) precond, + (HYPRE_Int (*)(void*, void*, void*, void*) ) precond_setup, + (void *) precond_solver ) ); } /*-------------------------------------------------------------------------- @@ -243,7 +243,7 @@ HYPRE_Int HYPRE_ParCSRHybridSetLogging( HYPRE_Solver solver, HYPRE_Int logging ) { - return( hypre_AMGHybridSetLogging( (void *) solver, logging ) ); + return ( hypre_AMGHybridSetLogging( (void *) solver, logging ) ); } /*-------------------------------------------------------------------------- @@ -254,7 +254,7 @@ HYPRE_Int HYPRE_ParCSRHybridSetPrintLevel( HYPRE_Solver solver, HYPRE_Int print_level ) { - return( hypre_AMGHybridSetPrintLevel( (void *) solver, print_level ) ); + return ( hypre_AMGHybridSetPrintLevel( (void *) solver, print_level ) ); } /*-------------------------------------------------------------------------- @@ -265,8 +265,8 @@ HYPRE_Int HYPRE_ParCSRHybridSetStrongThreshold( HYPRE_Solver solver, HYPRE_Real strong_threshold ) { - return( hypre_AMGHybridSetStrongThreshold( (void *) solver, - strong_threshold ) ); + return ( hypre_AMGHybridSetStrongThreshold( (void *) solver, + strong_threshold ) ); } /*-------------------------------------------------------------------------- @@ -277,7 +277,7 @@ HYPRE_Int HYPRE_ParCSRHybridSetMaxRowSum( HYPRE_Solver solver, HYPRE_Real max_row_sum ) { - return( hypre_AMGHybridSetMaxRowSum( (void *) solver, max_row_sum ) ); + return ( hypre_AMGHybridSetMaxRowSum( (void *) solver, max_row_sum ) ); } /*-------------------------------------------------------------------------- @@ -288,7 +288,7 @@ HYPRE_Int HYPRE_ParCSRHybridSetTruncFactor( HYPRE_Solver solver, HYPRE_Real trunc_factor ) { - return( hypre_AMGHybridSetTruncFactor( (void *) solver, trunc_factor ) ); + return ( hypre_AMGHybridSetTruncFactor( (void *) solver, trunc_factor ) ); } /*-------------------------------------------------------------------------- @@ -299,7 +299,7 @@ HYPRE_Int HYPRE_ParCSRHybridSetPMaxElmts( HYPRE_Solver solver, HYPRE_Int p_max ) { - return( hypre_AMGHybridSetPMaxElmts( (void *) solver, p_max ) ); + return ( hypre_AMGHybridSetPMaxElmts( (void *) solver, p_max ) ); } /*-------------------------------------------------------------------------- @@ -310,7 +310,7 @@ HYPRE_Int HYPRE_ParCSRHybridSetMaxLevels( HYPRE_Solver solver, HYPRE_Int max_levels ) { - return( hypre_AMGHybridSetMaxLevels( (void *) solver, max_levels ) ); + return ( hypre_AMGHybridSetMaxLevels( (void *) solver, max_levels ) ); } /*-------------------------------------------------------------------------- @@ -321,7 +321,7 @@ HYPRE_Int HYPRE_ParCSRHybridSetMeasureType( HYPRE_Solver solver, HYPRE_Int measure_type ) { - return( hypre_AMGHybridSetMeasureType( (void *) solver, measure_type ) ); + return ( hypre_AMGHybridSetMeasureType( (void *) solver, measure_type ) ); } /*-------------------------------------------------------------------------- @@ -332,7 +332,7 @@ HYPRE_Int HYPRE_ParCSRHybridSetCoarsenType( HYPRE_Solver solver, HYPRE_Int coarsen_type ) { - return( hypre_AMGHybridSetCoarsenType( (void *) solver, coarsen_type ) ); + return ( hypre_AMGHybridSetCoarsenType( (void *) solver, coarsen_type ) ); } /*-------------------------------------------------------------------------- @@ -343,7 +343,7 @@ HYPRE_Int HYPRE_ParCSRHybridSetInterpType( HYPRE_Solver solver, HYPRE_Int interp_type ) { - return( hypre_AMGHybridSetInterpType( (void *) solver, interp_type ) ); + return ( hypre_AMGHybridSetInterpType( (void *) solver, interp_type ) ); } /*-------------------------------------------------------------------------- @@ -354,7 +354,7 @@ HYPRE_Int HYPRE_ParCSRHybridSetCycleType( HYPRE_Solver solver, HYPRE_Int cycle_type ) { - return( hypre_AMGHybridSetCycleType( (void *) solver, cycle_type ) ); + return ( hypre_AMGHybridSetCycleType( (void *) solver, cycle_type ) ); } /*-------------------------------------------------------------------------- @@ -365,7 +365,7 @@ HYPRE_Int HYPRE_ParCSRHybridSetNumGridSweeps( HYPRE_Solver solver, HYPRE_Int *num_grid_sweeps ) { - return( hypre_AMGHybridSetNumGridSweeps( (void *) solver, num_grid_sweeps ) ); + return ( hypre_AMGHybridSetNumGridSweeps( (void *) solver, num_grid_sweeps ) ); } /*-------------------------------------------------------------------------- @@ -376,7 +376,7 @@ HYPRE_Int HYPRE_ParCSRHybridSetGridRelaxType( HYPRE_Solver solver, HYPRE_Int *grid_relax_type ) { - return( hypre_AMGHybridSetGridRelaxType( (void *) solver, grid_relax_type ) ); + return ( hypre_AMGHybridSetGridRelaxType( (void *) solver, grid_relax_type ) ); } /*-------------------------------------------------------------------------- @@ -387,7 +387,7 @@ HYPRE_Int HYPRE_ParCSRHybridSetGridRelaxPoints( HYPRE_Solver solver, HYPRE_Int **grid_relax_points ) { - return( hypre_AMGHybridSetGridRelaxPoints( (void *) solver, grid_relax_points ) ); + return ( hypre_AMGHybridSetGridRelaxPoints( (void *) solver, grid_relax_points ) ); } /*-------------------------------------------------------------------------- @@ -398,7 +398,7 @@ HYPRE_Int HYPRE_ParCSRHybridSetNumSweeps( HYPRE_Solver solver, HYPRE_Int num_sweeps ) { - return( hypre_AMGHybridSetNumSweeps( (void *) solver, num_sweeps ) ); + return ( hypre_AMGHybridSetNumSweeps( (void *) solver, num_sweeps ) ); } /*-------------------------------------------------------------------------- @@ -407,10 +407,10 @@ HYPRE_ParCSRHybridSetNumSweeps( HYPRE_Solver solver, HYPRE_Int HYPRE_ParCSRHybridSetCycleNumSweeps( HYPRE_Solver solver, - HYPRE_Int num_sweeps , + HYPRE_Int num_sweeps, HYPRE_Int k ) { - return( hypre_AMGHybridSetCycleNumSweeps( (void *) solver, num_sweeps, k ) ); + return ( hypre_AMGHybridSetCycleNumSweeps( (void *) solver, num_sweeps, k ) ); } /*-------------------------------------------------------------------------- @@ -421,7 +421,7 @@ HYPRE_Int HYPRE_ParCSRHybridSetRelaxType( HYPRE_Solver solver, HYPRE_Int relax_type ) { - return( hypre_AMGHybridSetRelaxType( (void *) solver, relax_type ) ); + return ( hypre_AMGHybridSetRelaxType( (void *) solver, relax_type ) ); } /*-------------------------------------------------------------------------- @@ -430,10 +430,10 @@ HYPRE_ParCSRHybridSetRelaxType( HYPRE_Solver solver, HYPRE_Int HYPRE_ParCSRHybridSetCycleRelaxType( HYPRE_Solver solver, - HYPRE_Int relax_type , + HYPRE_Int relax_type, HYPRE_Int k ) { - return( hypre_AMGHybridSetCycleRelaxType( (void *) solver, relax_type, k ) ); + return ( hypre_AMGHybridSetCycleRelaxType( (void *) solver, relax_type, k ) ); } /*-------------------------------------------------------------------------- @@ -444,7 +444,7 @@ HYPRE_Int HYPRE_ParCSRHybridSetRelaxOrder( HYPRE_Solver solver, HYPRE_Int relax_order ) { - return( hypre_AMGHybridSetRelaxOrder( (void *) solver, relax_order ) ); + return ( hypre_AMGHybridSetRelaxOrder( (void *) solver, relax_order ) ); } /*-------------------------------------------------------------------------- @@ -453,9 +453,9 @@ HYPRE_ParCSRHybridSetRelaxOrder( HYPRE_Solver solver, HYPRE_Int HYPRE_ParCSRHybridSetKeepTranspose( HYPRE_Solver solver, - HYPRE_Int keepT ) + HYPRE_Int keepT ) { - return( hypre_AMGHybridSetKeepTranspose( (void *) solver, keepT ) ); + return ( hypre_AMGHybridSetKeepTranspose( (void *) solver, keepT ) ); } /*-------------------------------------------------------------------------- @@ -466,7 +466,7 @@ HYPRE_Int HYPRE_ParCSRHybridSetMaxCoarseSize( HYPRE_Solver solver, HYPRE_Int max_coarse_size ) { - return( hypre_AMGHybridSetMaxCoarseSize( (void *) solver, max_coarse_size ) ); + return ( hypre_AMGHybridSetMaxCoarseSize( (void *) solver, max_coarse_size ) ); } /*-------------------------------------------------------------------------- @@ -477,7 +477,7 @@ HYPRE_Int HYPRE_ParCSRHybridSetMinCoarseSize( HYPRE_Solver solver, HYPRE_Int min_coarse_size ) { - return( hypre_AMGHybridSetMinCoarseSize( (void *) solver, min_coarse_size ) ); + return ( hypre_AMGHybridSetMinCoarseSize( (void *) solver, min_coarse_size ) ); } /*-------------------------------------------------------------------------- @@ -488,7 +488,7 @@ HYPRE_Int HYPRE_ParCSRHybridSetSeqThreshold( HYPRE_Solver solver, HYPRE_Int seq_threshold ) { - return( hypre_AMGHybridSetSeqThreshold( (void *) solver, seq_threshold ) ); + return ( hypre_AMGHybridSetSeqThreshold( (void *) solver, seq_threshold ) ); } /*-------------------------------------------------------------------------- @@ -499,7 +499,7 @@ HYPRE_Int HYPRE_ParCSRHybridSetRelaxWt( HYPRE_Solver solver, HYPRE_Real relax_wt ) { - return( hypre_AMGHybridSetRelaxWt( (void *) solver, relax_wt ) ); + return ( hypre_AMGHybridSetRelaxWt( (void *) solver, relax_wt ) ); } /*-------------------------------------------------------------------------- @@ -511,7 +511,7 @@ HYPRE_ParCSRHybridSetLevelRelaxWt( HYPRE_Solver solver, HYPRE_Real relax_wt, HYPRE_Int level ) { - return( hypre_AMGHybridSetLevelRelaxWt( (void *) solver, relax_wt, level ) ); + return ( hypre_AMGHybridSetLevelRelaxWt( (void *) solver, relax_wt, level ) ); } /*-------------------------------------------------------------------------- @@ -522,7 +522,7 @@ HYPRE_Int HYPRE_ParCSRHybridSetOuterWt( HYPRE_Solver solver, HYPRE_Real outer_wt ) { - return( hypre_AMGHybridSetOuterWt( (void *) solver, outer_wt ) ); + return ( hypre_AMGHybridSetOuterWt( (void *) solver, outer_wt ) ); } /*-------------------------------------------------------------------------- @@ -534,7 +534,7 @@ HYPRE_ParCSRHybridSetLevelOuterWt( HYPRE_Solver solver, HYPRE_Real outer_wt, HYPRE_Int level ) { - return( hypre_AMGHybridSetLevelOuterWt( (void *) solver, outer_wt, level ) ); + return ( hypre_AMGHybridSetLevelOuterWt( (void *) solver, outer_wt, level ) ); } /*-------------------------------------------------------------------------- @@ -545,7 +545,7 @@ HYPRE_Int HYPRE_ParCSRHybridSetRelaxWeight( HYPRE_Solver solver, HYPRE_Real *relax_weight ) { - return( hypre_AMGHybridSetRelaxWeight( (void *) solver, relax_weight ) ); + return ( hypre_AMGHybridSetRelaxWeight( (void *) solver, relax_weight ) ); } /*-------------------------------------------------------------------------- @@ -556,7 +556,7 @@ HYPRE_Int HYPRE_ParCSRHybridSetOmega( HYPRE_Solver solver, HYPRE_Real *omega ) { - return( hypre_AMGHybridSetOmega( (void *) solver, omega ) ); + return ( hypre_AMGHybridSetOmega( (void *) solver, omega ) ); } /*-------------------------------------------------------------------------- @@ -567,7 +567,7 @@ HYPRE_Int HYPRE_ParCSRHybridSetAggNumLevels( HYPRE_Solver solver, HYPRE_Int agg_num_levels ) { - return( hypre_AMGHybridSetAggNumLevels( (void *) solver, agg_num_levels ) ); + return ( hypre_AMGHybridSetAggNumLevels( (void *) solver, agg_num_levels ) ); } /*-------------------------------------------------------------------------- @@ -578,7 +578,7 @@ HYPRE_Int HYPRE_ParCSRHybridSetAggInterpType( HYPRE_Solver solver, HYPRE_Int agg_interp_type ) { - return( hypre_AMGHybridSetAggInterpType( (void *) solver, agg_interp_type ) ); + return ( hypre_AMGHybridSetAggInterpType( (void *) solver, agg_interp_type ) ); } /*-------------------------------------------------------------------------- @@ -589,7 +589,7 @@ HYPRE_Int HYPRE_ParCSRHybridSetNumPaths( HYPRE_Solver solver, HYPRE_Int num_paths ) { - return( hypre_AMGHybridSetNumPaths( (void *) solver, num_paths ) ); + return ( hypre_AMGHybridSetNumPaths( (void *) solver, num_paths ) ); } /*-------------------------------------------------------------------------- @@ -600,7 +600,7 @@ HYPRE_Int HYPRE_ParCSRHybridSetNumFunctions( HYPRE_Solver solver, HYPRE_Int num_functions ) { - return( hypre_AMGHybridSetNumFunctions( (void *) solver, num_functions ) ); + return ( hypre_AMGHybridSetNumFunctions( (void *) solver, num_functions ) ); } /*-------------------------------------------------------------------------- @@ -611,7 +611,7 @@ HYPRE_Int HYPRE_ParCSRHybridSetNodal( HYPRE_Solver solver, HYPRE_Int nodal ) { - return( hypre_AMGHybridSetNodal( (void *) solver, nodal ) ); + return ( hypre_AMGHybridSetNodal( (void *) solver, nodal ) ); } /*-------------------------------------------------------------------------- @@ -622,7 +622,7 @@ HYPRE_Int HYPRE_ParCSRHybridSetDofFunc( HYPRE_Solver solver, HYPRE_Int *dof_func ) { - return( hypre_AMGHybridSetDofFunc( (void *) solver, dof_func ) ); + return ( hypre_AMGHybridSetDofFunc( (void *) solver, dof_func ) ); } /*-------------------------------------------------------------------------- @@ -631,10 +631,10 @@ HYPRE_ParCSRHybridSetDofFunc( HYPRE_Solver solver, HYPRE_Int HYPRE_ParCSRHybridSetNonGalerkinTol( HYPRE_Solver solver, - HYPRE_Int nongalerk_num_tol, - HYPRE_Real *nongalerkin_tol) + HYPRE_Int nongalerk_num_tol, + HYPRE_Real *nongalerkin_tol) { - return( hypre_AMGHybridSetNonGalerkinTol( (void *) solver, nongalerk_num_tol, nongalerkin_tol ) ); + return ( hypre_AMGHybridSetNonGalerkinTol( (void *) solver, nongalerk_num_tol, nongalerkin_tol ) ); } @@ -646,7 +646,7 @@ HYPRE_Int HYPRE_ParCSRHybridGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_its ) { - return( hypre_AMGHybridGetNumIterations( (void *) solver, num_its ) ); + return ( hypre_AMGHybridGetNumIterations( (void *) solver, num_its ) ); } /*-------------------------------------------------------------------------- @@ -657,7 +657,7 @@ HYPRE_Int HYPRE_ParCSRHybridGetDSCGNumIterations( HYPRE_Solver solver, HYPRE_Int *dscg_num_its ) { - return( hypre_AMGHybridGetDSCGNumIterations( (void *) solver, dscg_num_its ) ); + return ( hypre_AMGHybridGetDSCGNumIterations( (void *) solver, dscg_num_its ) ); } /*-------------------------------------------------------------------------- @@ -668,7 +668,7 @@ HYPRE_Int HYPRE_ParCSRHybridGetPCGNumIterations( HYPRE_Solver solver, HYPRE_Int *pcg_num_its ) { - return( hypre_AMGHybridGetPCGNumIterations( (void *) solver, pcg_num_its ) ); + return ( hypre_AMGHybridGetPCGNumIterations( (void *) solver, pcg_num_its ) ); } /*-------------------------------------------------------------------------- @@ -679,7 +679,7 @@ HYPRE_Int HYPRE_ParCSRHybridGetFinalRelativeResidualNorm( HYPRE_Solver solver, HYPRE_Real *norm ) { - return( hypre_AMGHybridGetFinalRelativeResidualNorm( (void *) solver, norm ) ); + return ( hypre_AMGHybridGetFinalRelativeResidualNorm( (void *) solver, norm ) ); } @@ -687,5 +687,5 @@ HYPRE_Int HYPRE_ParCSRHybridGetSetupSolveTime( HYPRE_Solver solver, HYPRE_Real *time ) { - return( hypre_AMGHybridGetSetupSolveTime( (void *) solver, time ) ); + return ( hypre_AMGHybridGetSetupSolveTime( (void *) solver, time ) ); } diff --git a/external/hypre/src/parcsr_ls/HYPRE_parcsr_ilu.c b/external/hypre/src/parcsr_ls/HYPRE_parcsr_ilu.c index 140775ac..68f355f0 100644 --- a/external/hypre/src/parcsr_ls/HYPRE_parcsr_ilu.c +++ b/external/hypre/src/parcsr_ls/HYPRE_parcsr_ilu.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -30,7 +30,7 @@ HYPRE_ILUCreate( HYPRE_Solver *solver ) HYPRE_Int HYPRE_ILUDestroy( HYPRE_Solver solver ) { - return( hypre_ILUDestroy( (void *) solver ) ); + return ( hypre_ILUDestroy( (void *) solver ) ); } /*-------------------------------------------------------------------------- @@ -39,14 +39,14 @@ HYPRE_ILUDestroy( HYPRE_Solver solver ) HYPRE_Int HYPRE_ILUSetup( HYPRE_Solver solver, - HYPRE_ParCSRMatrix A, - HYPRE_ParVector b, - HYPRE_ParVector x ) + HYPRE_ParCSRMatrix A, + HYPRE_ParVector b, + HYPRE_ParVector x ) { - return( hypre_ILUSetup( (void *) solver, - (hypre_ParCSRMatrix *) A, - (hypre_ParVector *) b, - (hypre_ParVector *) x ) ); + return ( hypre_ILUSetup( (void *) solver, + (hypre_ParCSRMatrix *) A, + (hypre_ParVector *) b, + (hypre_ParVector *) x ) ); } /*-------------------------------------------------------------------------- @@ -55,133 +55,232 @@ HYPRE_ILUSetup( HYPRE_Solver solver, HYPRE_Int HYPRE_ILUSolve( HYPRE_Solver solver, - HYPRE_ParCSRMatrix A, - HYPRE_ParVector b, - HYPRE_ParVector x ) + HYPRE_ParCSRMatrix A, + HYPRE_ParVector b, + HYPRE_ParVector x ) { - return( hypre_ILUSolve( (void *) solver, - (hypre_ParCSRMatrix *) A, - (hypre_ParVector *) b, - (hypre_ParVector *) x ) ); + return ( hypre_ILUSolve( (void *) solver, + (hypre_ParCSRMatrix *) A, + (hypre_ParVector *) b, + (hypre_ParVector *) x ) ); } /*-------------------------------------------------------------------------- * HYPRE_ILUSetPrintLevel *--------------------------------------------------------------------------*/ + HYPRE_Int HYPRE_ILUSetPrintLevel( HYPRE_Solver solver, HYPRE_Int print_level ) { return hypre_ILUSetPrintLevel( solver, print_level ); } + /*-------------------------------------------------------------------------- * HYPRE_ILUSetLogging *--------------------------------------------------------------------------*/ + HYPRE_Int HYPRE_ILUSetLogging( HYPRE_Solver solver, HYPRE_Int logging ) { return hypre_ILUSetLogging(solver, logging ); } + /*-------------------------------------------------------------------------- * HYPRE_ILUSetMaxIter *--------------------------------------------------------------------------*/ + HYPRE_Int HYPRE_ILUSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ) { return hypre_ILUSetMaxIter( solver, max_iter ); } + +/*-------------------------------------------------------------------------- + * HYPRE_ILUSetIterativeSetupType + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetIterativeSetupType( HYPRE_Solver solver, HYPRE_Int iter_setup_type ) +{ + return hypre_ILUSetIterativeSetupType( solver, iter_setup_type ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_ILUSetIterativeSetupOption + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetIterativeSetupOption( HYPRE_Solver solver, HYPRE_Int iter_setup_option ) +{ + return hypre_ILUSetIterativeSetupOption( solver, iter_setup_option ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_ILUSetIterativeSetupMaxIter + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetIterativeSetupMaxIter( HYPRE_Solver solver, HYPRE_Int iter_setup_max_iter ) +{ + return hypre_ILUSetIterativeSetupMaxIter( solver, iter_setup_max_iter ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_ILUSetIterativeSetupTolerance + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetIterativeSetupTolerance( HYPRE_Solver solver, HYPRE_Real iter_setup_tolerance ) +{ + return hypre_ILUSetIterativeSetupTolerance( solver, iter_setup_tolerance ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_ILUSetTriSolve + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetTriSolve( HYPRE_Solver solver, HYPRE_Int tri_solve ) +{ + return hypre_ILUSetTriSolve( solver, tri_solve ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_ILUSetLowerJacobiIters + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetLowerJacobiIters( HYPRE_Solver solver, HYPRE_Int lower_jacobi_iters ) +{ + return hypre_ILUSetLowerJacobiIters( solver, lower_jacobi_iters ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_ILUSetUpperJacobiIters + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetUpperJacobiIters( HYPRE_Solver solver, HYPRE_Int upper_jacobi_iters ) +{ + return hypre_ILUSetUpperJacobiIters( solver, upper_jacobi_iters ); +} + /*-------------------------------------------------------------------------- * HYPRE_ILUSetTol *--------------------------------------------------------------------------*/ + HYPRE_Int HYPRE_ILUSetTol( HYPRE_Solver solver, HYPRE_Real tol ) { return hypre_ILUSetTol( solver, tol ); } + /*-------------------------------------------------------------------------- * HYPRE_ILUSetDropThreshold *--------------------------------------------------------------------------*/ + HYPRE_Int HYPRE_ILUSetDropThreshold( HYPRE_Solver solver, HYPRE_Real threshold ) { return hypre_ILUSetDropThreshold( solver, threshold ); } + /*-------------------------------------------------------------------------- * HYPRE_ILUSetDropThresholdArray *--------------------------------------------------------------------------*/ + HYPRE_Int HYPRE_ILUSetDropThresholdArray( HYPRE_Solver solver, HYPRE_Real *threshold ) { return hypre_ILUSetDropThresholdArray( solver, threshold ); } + /*-------------------------------------------------------------------------- * HYPRE_ILUSetNSHDropThreshold *--------------------------------------------------------------------------*/ + HYPRE_Int HYPRE_ILUSetNSHDropThreshold( HYPRE_Solver solver, HYPRE_Real threshold ) { return hypre_ILUSetSchurNSHDropThreshold( solver, threshold ); } + /*-------------------------------------------------------------------------- * HYPRE_ILUSetNSHDropThresholdArray *--------------------------------------------------------------------------*/ + HYPRE_Int HYPRE_ILUSetNSHDropThresholdArray( HYPRE_Solver solver, HYPRE_Real *threshold ) { return hypre_ILUSetSchurNSHDropThresholdArray( solver, threshold ); } + /*-------------------------------------------------------------------------- * HYPRE_ILUSetSchurMaxIter *--------------------------------------------------------------------------*/ + HYPRE_Int HYPRE_ILUSetSchurMaxIter( HYPRE_Solver solver, HYPRE_Int ss_max_iter ) { return hypre_ILUSetSchurSolverMaxIter( solver, ss_max_iter ); } + /*-------------------------------------------------------------------------- * HYPRE_ILUSetMaxNnzPerRow *--------------------------------------------------------------------------*/ + HYPRE_Int HYPRE_ILUSetMaxNnzPerRow( HYPRE_Solver solver, HYPRE_Int nzmax ) { return hypre_ILUSetMaxNnzPerRow( solver, nzmax ); } + /*-------------------------------------------------------------------------- - * HYPRE_ILUSetFillLevel + * HYPRE_ILUSetLevelOfFill *--------------------------------------------------------------------------*/ + HYPRE_Int HYPRE_ILUSetLevelOfFill( HYPRE_Solver solver, HYPRE_Int lfil ) { return hypre_ILUSetLevelOfFill( solver, lfil ); } + /*-------------------------------------------------------------------------- * HYPRE_ILUSetType *--------------------------------------------------------------------------*/ + HYPRE_Int HYPRE_ILUSetType( HYPRE_Solver solver, HYPRE_Int ilu_type ) { return hypre_ILUSetType( solver, ilu_type ); } + +/*-------------------------------------------------------------------------- + * HYPRE_ILUSetLocalReordering + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetLocalReordering( HYPRE_Solver solver, HYPRE_Int ordering_type ) +{ + return hypre_ILUSetLocalReordering(solver, ordering_type); +} + /*-------------------------------------------------------------------------- * HYPRE_ILUGetNumIterations *--------------------------------------------------------------------------*/ + HYPRE_Int HYPRE_ILUGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ) { return hypre_ILUGetNumIterations( solver, num_iterations ); } + /*-------------------------------------------------------------------------- * HYPRE_ILUGetFinalRelativeResidualNorm *--------------------------------------------------------------------------*/ + HYPRE_Int HYPRE_ILUGetFinalRelativeResidualNorm( HYPRE_Solver solver, HYPRE_Real *res_norm ) { return hypre_ILUGetFinalRelativeResidualNorm(solver, res_norm); } -/*-------------------------------------------------------------------------- - * HYPRE_ILUSetLocalReordering - *--------------------------------------------------------------------------*/ -HYPRE_Int -HYPRE_ILUSetLocalReordering( HYPRE_Solver solver, HYPRE_Int ordering_type ) -{ - return hypre_ILUSetLocalReordering(solver, ordering_type); -} diff --git a/external/hypre/src/parcsr_ls/HYPRE_parcsr_int.c b/external/hypre/src/parcsr_ls/HYPRE_parcsr_int.c index 2744a29c..2ed1266e 100644 --- a/external/hypre/src/parcsr_ls/HYPRE_parcsr_int.c +++ b/external/hypre/src/parcsr_ls/HYPRE_parcsr_int.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -11,122 +11,147 @@ #include "temp_multivector.h" HYPRE_Int -hypre_ParSetRandomValues( void* v, HYPRE_Int seed ) { +hypre_ParSetRandomValues( void* v, HYPRE_Int seed ) +{ - HYPRE_ParVectorSetRandomValues( (HYPRE_ParVector)v, seed ); - return 0; + HYPRE_ParVectorSetRandomValues( (HYPRE_ParVector)v, seed ); + return 0; } HYPRE_Int -hypre_ParPrintVector( void* v, const char* file ) { +hypre_ParPrintVector( void* v, const char* file ) +{ - return hypre_ParVectorPrint( (hypre_ParVector*)v, file ); + return hypre_ParVectorPrint( (hypre_ParVector*)v, file ); } void* -hypre_ParReadVector( MPI_Comm comm, const char* file ) { +hypre_ParReadVector( MPI_Comm comm, const char* file ) +{ - return (void*)hypre_ParVectorRead( comm, file ); + return (void*)hypre_ParVectorRead( comm, file ); } HYPRE_Int hypre_ParVectorSize(void * x) { - return 0; + HYPRE_UNUSED_VAR(x); + + return 0; } HYPRE_Int -HYPRE_ParCSRMultiVectorPrint( void* x_, const char* fileName ) { - - HYPRE_Int i, ierr; - mv_TempMultiVector* x; - char fullName[128]; - - x = (mv_TempMultiVector*)x_; - hypre_assert( x != NULL ); - - ierr = 0; - for ( i = 0; i < x->numVectors; i++ ) { - hypre_sprintf( fullName, "%s.%d", fileName, i ); - ierr = ierr || - hypre_ParPrintVector( x->vector[i], fullName ); - } - return ierr; +HYPRE_ParCSRMultiVectorPrint( void* x_, const char* fileName ) +{ + + HYPRE_Int i, ierr; + mv_TempMultiVector* x; + char fullName[128]; + + x = (mv_TempMultiVector*)x_; + hypre_assert( x != NULL ); + + ierr = 0; + for ( i = 0; i < x->numVectors; i++ ) + { + hypre_sprintf( fullName, "%s.%d", fileName, i ); + ierr = ierr || + hypre_ParPrintVector( x->vector[i], fullName ); + } + return ierr; } void* -HYPRE_ParCSRMultiVectorRead( MPI_Comm comm, void* ii_, const char* fileName ) { +HYPRE_ParCSRMultiVectorRead( MPI_Comm comm, void* ii_, const char* fileName ) +{ - HYPRE_Int i, n, id; - FILE* fp; - char fullName[128]; - mv_TempMultiVector* x; - mv_InterfaceInterpreter* ii = (mv_InterfaceInterpreter*)ii_; + HYPRE_Int i, n, id; + FILE* fp; + char fullName[128]; + mv_TempMultiVector* x; + mv_InterfaceInterpreter* ii = (mv_InterfaceInterpreter*)ii_; - hypre_MPI_Comm_rank( comm, &id ); + hypre_MPI_Comm_rank( comm, &id ); - n = 0; - do { - hypre_sprintf( fullName, "%s.%d.%d", fileName, n, id ); - if ( (fp = fopen(fullName, "r")) ) { - n++; - fclose( fp ); - } - } while ( fp ); + n = 0; + do + { + hypre_sprintf( fullName, "%s.%d.%d", fileName, n, id ); + if ( (fp = fopen(fullName, "r")) ) + { + n++; + fclose( fp ); + } + } + while ( fp ); - if ( n == 0 ) - return NULL; + if ( n == 0 ) + { + return NULL; + } - x = hypre_TAlloc(mv_TempMultiVector, 1, HYPRE_MEMORY_HOST); - hypre_assert( x != NULL ); + x = hypre_TAlloc(mv_TempMultiVector, 1, HYPRE_MEMORY_HOST); + hypre_assert( x != NULL ); - x->interpreter = ii; + x->interpreter = ii; - x->numVectors = n; + x->numVectors = n; - x->vector = hypre_CTAlloc(void*, n, HYPRE_MEMORY_HOST); - hypre_assert( x->vector != NULL ); + x->vector = hypre_CTAlloc(void*, n, HYPRE_MEMORY_HOST); + hypre_assert( x->vector != NULL ); - x->ownsVectors = 1; + x->ownsVectors = 1; - for ( i = 0; i < n; i++ ) { - hypre_sprintf( fullName, "%s.%d", fileName, i ); - x->vector[i] = hypre_ParReadVector( comm, fullName ); - } + for ( i = 0; i < n; i++ ) + { + hypre_sprintf( fullName, "%s.%d", fileName, i ); + x->vector[i] = hypre_ParReadVector( comm, fullName ); + } - x->mask = NULL; - x->ownsMask = 0; + x->mask = NULL; + x->ownsMask = 0; - return x; + return x; } HYPRE_Int -aux_maskCount( HYPRE_Int n, HYPRE_Int* mask ) { +aux_maskCount( HYPRE_Int n, HYPRE_Int* mask ) +{ - HYPRE_Int i, m; + HYPRE_Int i, m; - if ( mask == NULL ) - return n; + if ( mask == NULL ) + { + return n; + } - for ( i = m = 0; i < n; i++ ) - if ( mask[i] ) - m++; + for ( i = m = 0; i < n; i++ ) + if ( mask[i] ) + { + m++; + } - return m; + return m; } void -aux_indexFromMask( HYPRE_Int n, HYPRE_Int* mask, HYPRE_Int* index ) { - - HYPRE_Int i, j; +aux_indexFromMask( HYPRE_Int n, HYPRE_Int* mask, HYPRE_Int* index ) +{ - if ( mask != NULL ) { - for ( i = 0, j = 0; i < n; i++ ) - if ( mask[i] ) - index[j++] = i + 1; - } - else - for ( i = 0; i < n; i++ ) - index[i] = i + 1; + HYPRE_Int i, j; + + if ( mask != NULL ) + { + for ( i = 0, j = 0; i < n; i++ ) + if ( mask[i] ) + { + index[j++] = i + 1; + } + } + else + for ( i = 0; i < n; i++ ) + { + index[i] = i + 1; + } } @@ -142,56 +167,56 @@ aux_indexFromMask( HYPRE_Int n, HYPRE_Int* mask, HYPRE_Int* index ) { HYPRE_Int HYPRE_TempParCSRSetupInterpreter( mv_InterfaceInterpreter *i ) { - /* Vector part */ - - i->CreateVector = hypre_ParKrylovCreateVector; - i->DestroyVector = hypre_ParKrylovDestroyVector; - i->InnerProd = hypre_ParKrylovInnerProd; - i->CopyVector = hypre_ParKrylovCopyVector; - i->ClearVector = hypre_ParKrylovClearVector; - i->SetRandomValues = hypre_ParSetRandomValues; - i->ScaleVector = hypre_ParKrylovScaleVector; - i->Axpy = hypre_ParKrylovAxpy; - - /* Multivector part */ - - i->CreateMultiVector = mv_TempMultiVectorCreateFromSampleVector; - i->CopyCreateMultiVector = mv_TempMultiVectorCreateCopy; - i->DestroyMultiVector = mv_TempMultiVectorDestroy; - - i->Width = mv_TempMultiVectorWidth; - i->Height = mv_TempMultiVectorHeight; - i->SetMask = mv_TempMultiVectorSetMask; - i->CopyMultiVector = mv_TempMultiVectorCopy; - i->ClearMultiVector = mv_TempMultiVectorClear; - i->SetRandomVectors = mv_TempMultiVectorSetRandom; - i->MultiInnerProd = mv_TempMultiVectorByMultiVector; - i->MultiInnerProdDiag = mv_TempMultiVectorByMultiVectorDiag; - i->MultiVecMat = mv_TempMultiVectorByMatrix; - i->MultiVecMatDiag = mv_TempMultiVectorByDiagonal; - i->MultiAxpy = mv_TempMultiVectorAxpy; - i->MultiXapy = mv_TempMultiVectorXapy; - i->Eval = mv_TempMultiVectorEval; - - return 0; + /* Vector part */ + + i->CreateVector = hypre_ParKrylovCreateVector; + i->DestroyVector = hypre_ParKrylovDestroyVector; + i->InnerProd = hypre_ParKrylovInnerProd; + i->CopyVector = hypre_ParKrylovCopyVector; + i->ClearVector = hypre_ParKrylovClearVector; + i->SetRandomValues = hypre_ParSetRandomValues; + i->ScaleVector = hypre_ParKrylovScaleVector; + i->Axpy = hypre_ParKrylovAxpy; + + /* Multivector part */ + + i->CreateMultiVector = mv_TempMultiVectorCreateFromSampleVector; + i->CopyCreateMultiVector = mv_TempMultiVectorCreateCopy; + i->DestroyMultiVector = mv_TempMultiVectorDestroy; + + i->Width = mv_TempMultiVectorWidth; + i->Height = mv_TempMultiVectorHeight; + i->SetMask = mv_TempMultiVectorSetMask; + i->CopyMultiVector = mv_TempMultiVectorCopy; + i->ClearMultiVector = mv_TempMultiVectorClear; + i->SetRandomVectors = mv_TempMultiVectorSetRandom; + i->MultiInnerProd = mv_TempMultiVectorByMultiVector; + i->MultiInnerProdDiag = mv_TempMultiVectorByMultiVectorDiag; + i->MultiVecMat = mv_TempMultiVectorByMatrix; + i->MultiVecMatDiag = mv_TempMultiVectorByDiagonal; + i->MultiAxpy = mv_TempMultiVectorAxpy; + i->MultiXapy = mv_TempMultiVectorXapy; + i->Eval = mv_TempMultiVectorEval; + + return 0; } HYPRE_Int HYPRE_ParCSRSetupInterpreter( mv_InterfaceInterpreter *i ) { - return HYPRE_TempParCSRSetupInterpreter( i ); + return HYPRE_TempParCSRSetupInterpreter( i ); } HYPRE_Int HYPRE_ParCSRSetupMatvec(HYPRE_MatvecFunctions * mv) { - mv->MatvecCreate = hypre_ParKrylovMatvecCreate; - mv->Matvec = hypre_ParKrylovMatvec; - mv->MatvecDestroy = hypre_ParKrylovMatvecDestroy; + mv->MatvecCreate = hypre_ParKrylovMatvecCreate; + mv->Matvec = hypre_ParKrylovMatvec; + mv->MatvecDestroy = hypre_ParKrylovMatvecDestroy; - mv->MatMultiVecCreate = NULL; - mv->MatMultiVec = NULL; - mv->MatMultiVecDestroy = NULL; + mv->MatMultiVecCreate = NULL; + mv->MatMultiVec = NULL; + mv->MatMultiVecDestroy = NULL; - return 0; + return 0; } diff --git a/external/hypre/src/parcsr_ls/HYPRE_parcsr_lgmres.c b/external/hypre/src/parcsr_ls/HYPRE_parcsr_lgmres.c index ff872c7b..ddfa88fc 100644 --- a/external/hypre/src/parcsr_ls/HYPRE_parcsr_lgmres.c +++ b/external/hypre/src/parcsr_ls/HYPRE_parcsr_lgmres.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -14,7 +14,9 @@ HYPRE_Int HYPRE_ParCSRLGMRESCreate( MPI_Comm comm, HYPRE_Solver *solver ) { - hypre_LGMRESFunctions * lgmres_functions; + HYPRE_UNUSED_VAR(comm); + + hypre_LGMRESFunctions *lgmres_functions; if (!solver) { @@ -23,15 +25,22 @@ HYPRE_ParCSRLGMRESCreate( MPI_Comm comm, HYPRE_Solver *solver ) } lgmres_functions = hypre_LGMRESFunctionsCreate( - hypre_ParKrylovCAlloc, hypre_ParKrylovFree, hypre_ParKrylovCommInfo, + hypre_ParKrylovCAlloc, + hypre_ParKrylovFree, + hypre_ParKrylovCommInfo, hypre_ParKrylovCreateVector, hypre_ParKrylovCreateVectorArray, - hypre_ParKrylovDestroyVector, hypre_ParKrylovMatvecCreate, - hypre_ParKrylovMatvec, hypre_ParKrylovMatvecDestroy, - hypre_ParKrylovInnerProd, hypre_ParKrylovCopyVector, + hypre_ParKrylovDestroyVector, + hypre_ParKrylovMatvecCreate, + hypre_ParKrylovMatvec, + hypre_ParKrylovMatvecDestroy, + hypre_ParKrylovInnerProd, + hypre_ParKrylovCopyVector, hypre_ParKrylovClearVector, - hypre_ParKrylovScaleVector, hypre_ParKrylovAxpy, - hypre_ParKrylovIdentitySetup, hypre_ParKrylovIdentity ); + hypre_ParKrylovScaleVector, + hypre_ParKrylovAxpy, + hypre_ParKrylovIdentitySetup, + hypre_ParKrylovIdentity ); *solver = ( (HYPRE_Solver) hypre_LGMRESCreate( lgmres_functions ) ); return hypre_error_flag; @@ -41,42 +50,42 @@ HYPRE_ParCSRLGMRESCreate( MPI_Comm comm, HYPRE_Solver *solver ) * HYPRE_ParCSRLGMRESDestroy *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_ParCSRLGMRESDestroy( HYPRE_Solver solver ) { - return( hypre_LGMRESDestroy( (void *) solver ) ); + return ( hypre_LGMRESDestroy( (void *) solver ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRLGMRESSetup *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_ParCSRLGMRESSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) { - return( HYPRE_LGMRESSetup( solver, - (HYPRE_Matrix) A, - (HYPRE_Vector) b, - (HYPRE_Vector) x ) ); + return ( HYPRE_LGMRESSetup( solver, + (HYPRE_Matrix) A, + (HYPRE_Vector) b, + (HYPRE_Vector) x ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRLGMRESSolve *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_ParCSRLGMRESSolve( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) { - return( HYPRE_LGMRESSolve( solver, - (HYPRE_Matrix) A, - (HYPRE_Vector) b, - (HYPRE_Vector) x ) ); + return ( HYPRE_LGMRESSolve( solver, + (HYPRE_Matrix) A, + (HYPRE_Vector) b, + (HYPRE_Vector) x ) ); } /*-------------------------------------------------------------------------- @@ -87,7 +96,7 @@ HYPRE_Int HYPRE_ParCSRLGMRESSetKDim( HYPRE_Solver solver, HYPRE_Int k_dim ) { - return( HYPRE_LGMRESSetKDim( solver, k_dim ) ); + return ( HYPRE_LGMRESSetKDim( solver, k_dim ) ); } /*-------------------------------------------------------------------------- @@ -98,7 +107,7 @@ HYPRE_Int HYPRE_ParCSRLGMRESSetAugDim( HYPRE_Solver solver, HYPRE_Int aug_dim ) { - return( HYPRE_LGMRESSetAugDim( solver, aug_dim ) ); + return ( HYPRE_LGMRESSetAugDim( solver, aug_dim ) ); } /*-------------------------------------------------------------------------- @@ -109,7 +118,7 @@ HYPRE_Int HYPRE_ParCSRLGMRESSetTol( HYPRE_Solver solver, HYPRE_Real tol ) { - return( HYPRE_LGMRESSetTol( solver, tol ) ); + return ( HYPRE_LGMRESSetTol( solver, tol ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRLGMRESSetAbsoluteTol @@ -119,7 +128,7 @@ HYPRE_Int HYPRE_ParCSRLGMRESSetAbsoluteTol( HYPRE_Solver solver, HYPRE_Real a_tol ) { - return( HYPRE_LGMRESSetAbsoluteTol( solver, a_tol ) ); + return ( HYPRE_LGMRESSetAbsoluteTol( solver, a_tol ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRLGMRESSetMinIter @@ -129,7 +138,7 @@ HYPRE_Int HYPRE_ParCSRLGMRESSetMinIter( HYPRE_Solver solver, HYPRE_Int min_iter ) { - return( HYPRE_LGMRESSetMinIter( solver, min_iter ) ); + return ( HYPRE_LGMRESSetMinIter( solver, min_iter ) ); } /*-------------------------------------------------------------------------- @@ -140,7 +149,7 @@ HYPRE_Int HYPRE_ParCSRLGMRESSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ) { - return( HYPRE_LGMRESSetMaxIter( solver, max_iter ) ); + return ( HYPRE_LGMRESSetMaxIter( solver, max_iter ) ); } /*-------------------------------------------------------------------------- @@ -153,10 +162,10 @@ HYPRE_ParCSRLGMRESSetPrecond( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ) { - return( HYPRE_LGMRESSetPrecond( solver, - (HYPRE_PtrToSolverFcn) precond, - (HYPRE_PtrToSolverFcn) precond_setup, - precond_solver ) ); + return ( HYPRE_LGMRESSetPrecond( solver, + (HYPRE_PtrToSolverFcn) precond, + (HYPRE_PtrToSolverFcn) precond_setup, + precond_solver ) ); } /*-------------------------------------------------------------------------- @@ -167,7 +176,7 @@ HYPRE_Int HYPRE_ParCSRLGMRESGetPrecond( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ) { - return( HYPRE_LGMRESGetPrecond( solver, precond_data_ptr ) ); + return ( HYPRE_LGMRESGetPrecond( solver, precond_data_ptr ) ); } /*-------------------------------------------------------------------------- @@ -178,7 +187,7 @@ HYPRE_Int HYPRE_ParCSRLGMRESSetLogging( HYPRE_Solver solver, HYPRE_Int logging) { - return( HYPRE_LGMRESSetLogging( solver, logging ) ); + return ( HYPRE_LGMRESSetLogging( solver, logging ) ); } /*-------------------------------------------------------------------------- @@ -189,7 +198,7 @@ HYPRE_Int HYPRE_ParCSRLGMRESSetPrintLevel( HYPRE_Solver solver, HYPRE_Int print_level) { - return( HYPRE_LGMRESSetPrintLevel( solver, print_level ) ); + return ( HYPRE_LGMRESSetPrintLevel( solver, print_level ) ); } /*-------------------------------------------------------------------------- @@ -200,7 +209,7 @@ HYPRE_Int HYPRE_ParCSRLGMRESGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ) { - return( HYPRE_LGMRESGetNumIterations( solver, num_iterations ) ); + return ( HYPRE_LGMRESGetNumIterations( solver, num_iterations ) ); } /*-------------------------------------------------------------------------- @@ -211,7 +220,7 @@ HYPRE_Int HYPRE_ParCSRLGMRESGetFinalRelativeResidualNorm( HYPRE_Solver solver, HYPRE_Real *norm ) { - return( HYPRE_LGMRESGetFinalRelativeResidualNorm( solver, norm ) ); + return ( HYPRE_LGMRESGetFinalRelativeResidualNorm( solver, norm ) ); } /*-------------------------------------------------------------------------- @@ -222,5 +231,5 @@ HYPRE_Int HYPRE_ParCSRLGMRESGetResidual( HYPRE_Solver solver, HYPRE_ParVector *residual) { - return( HYPRE_LGMRESGetResidual( solver, (void *) residual ) ); + return ( HYPRE_LGMRESGetResidual( solver, (void *) residual ) ); } diff --git a/external/hypre/src/parcsr_ls/HYPRE_parcsr_ls.h b/external/hypre/src/parcsr_ls/HYPRE_parcsr_ls.h index b3852ed7..5f0d0620 100644 --- a/external/hypre/src/parcsr_ls/HYPRE_parcsr_ls.h +++ b/external/hypre/src/parcsr_ls/HYPRE_parcsr_ls.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -24,10 +24,8 @@ extern "C" { /** * @defgroup ParCSRSolvers ParCSR Solvers * - * These solvers use matrix/vector storage schemes that are taylored - * for general sparse matrix systems. - * - * @memo Linear solvers for sparse matrix systems + * Linear solvers for sparse matrix systems. These solvers use matrix/vector + * storage schemes that are taylored for general sparse matrix systems. * * @{ **/ @@ -41,27 +39,20 @@ extern "C" { * @{ **/ -struct hypre_Solver_struct; /** * The solver object. **/ -#ifndef HYPRE_SOLVER_STRUCT -#define HYPRE_SOLVER_STRUCT -struct hypre_Solver_struct; -typedef struct hypre_Solver_struct *HYPRE_Solver; -#endif - typedef HYPRE_Int (*HYPRE_PtrToParSolverFcn)(HYPRE_Solver, - HYPRE_ParCSRMatrix, - HYPRE_ParVector, - HYPRE_ParVector); + HYPRE_ParCSRMatrix, + HYPRE_ParVector, + HYPRE_ParVector); #ifndef HYPRE_MODIFYPC #define HYPRE_MODIFYPC typedef HYPRE_Int (*HYPRE_PtrToModifyPCFcn)(HYPRE_Solver, - HYPRE_Int, - HYPRE_Real); + HYPRE_Int, + HYPRE_Real); #endif /**@}*/ @@ -155,6 +146,19 @@ HYPRE_Int HYPRE_BoomerAMGGetResidual(HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGGetNumIterations(HYPRE_Solver solver, HYPRE_Int *num_iterations); +/** + * Returns cumulative num of nonzeros for A and P operators + **/ +HYPRE_Int HYPRE_BoomerAMGGetCumNnzAP(HYPRE_Solver solver, + HYPRE_Real *cum_nnz_AP); + +/** + * Activates cumulative num of nonzeros for A and P operators. + * Needs to be set to a positive number for activation. + **/ +HYPRE_Int HYPRE_BoomerAMGSetCumNnzAP(HYPRE_Solver solver, + HYPRE_Real cum_nnz_AP); + /** * Returns the norm of the final relative residual. **/ @@ -166,7 +170,24 @@ HYPRE_Int HYPRE_BoomerAMGGetFinalRelativeResidualNorm(HYPRE_Solver solver, * The default is 1, i.e. a scalar system. **/ HYPRE_Int HYPRE_BoomerAMGSetNumFunctions(HYPRE_Solver solver, - HYPRE_Int num_functions); + HYPRE_Int num_functions); + +/** + * (Optional) Sets filtering for system of PDEs (\e num_functions > 1). + * + * \param filter_functions An integer flag to enable or disable filtering of inter-variable + * connections in the input matrix used for preconditioning. + * - A value of 0 (default) indicates no filtering, preserving all inter-variable connections. + * - A value of 1 enables filtering, removing inter-variable connections to lower + * operator and memory complexities. + * + * @note This option assumes that variables are stored in an interleaved format, + * where multiple variables are combined in a single vector. Enabling filtering + * can be beneficial when the problem has multiple coupled variables (functions) + * that are not strongly coupled. + **/ +HYPRE_Int HYPRE_BoomerAMGSetFilterFunctions(HYPRE_Solver solver, + HYPRE_Int filter_functions); /** * (Optional) Sets the mapping that assigns the function to each variable, @@ -312,7 +333,7 @@ HYPRE_Int HYPRE_BoomerAMGSetCoarsenType(HYPRE_Solver solver, * then can be used to change individual levels if desired **/ HYPRE_Int HYPRE_BoomerAMGSetNonGalerkinTol (HYPRE_Solver solver, - HYPRE_Real nongalerkin_tol); + HYPRE_Real nongalerkin_tol); /** * (Optional) Defines the level specific non-Galerkin drop-tolerances @@ -340,8 +361,8 @@ HYPRE_Int HYPRE_BoomerAMGSetNonGalerkinTol (HYPRE_Solver solver, * @param level [IN] level on which drop tolerance is used **/ HYPRE_Int HYPRE_BoomerAMGSetLevelNonGalerkinTol (HYPRE_Solver solver, - HYPRE_Real nongalerkin_tol, - HYPRE_Int level); + HYPRE_Real nongalerkin_tol, + HYPRE_Int level); /** * (Optional) Defines the non-Galerkin drop-tolerance (old version) @@ -520,8 +541,8 @@ HYPRE_Int HYPRE_BoomerAMGSetAggP12MaxElmts(HYPRE_Solver solver, * This can only be used in context with nodal coarsening and still * requires the user to choose an interpolation. **/ -HYPRE_Int HYPRE_BoomerAMGSetInterpVectors (HYPRE_Solver solver , - HYPRE_Int num_vectors , +HYPRE_Int HYPRE_BoomerAMGSetInterpVectors (HYPRE_Solver solver, + HYPRE_Int num_vectors, HYPRE_ParVector *interp_vectors ); /** @@ -624,7 +645,7 @@ HYPRE_Int HYPRE_BoomerAMGSetSimple(HYPRE_Solver solver, * Can only be used when AMG is used as a preconditioner !!! **/ HYPRE_Int HYPRE_BoomerAMGSetAddLastLvl(HYPRE_Solver solver, - HYPRE_Int add_last_lvl); + HYPRE_Int add_last_lvl); /** * (Optional) Defines the truncation factor for the @@ -632,7 +653,7 @@ HYPRE_Int HYPRE_BoomerAMGSetAddLastLvl(HYPRE_Solver solver, * The default is 0. **/ HYPRE_Int HYPRE_BoomerAMGSetMultAddTruncFactor(HYPRE_Solver solver, - HYPRE_Real add_trunc_factor); + HYPRE_Real add_trunc_factor); /** * (Optional) Defines the maximal number of elements per row for the @@ -640,7 +661,7 @@ HYPRE_Int HYPRE_BoomerAMGSetMultAddTruncFactor(HYPRE_Solver solver, * The default is 0. **/ HYPRE_Int HYPRE_BoomerAMGSetMultAddPMaxElmts(HYPRE_Solver solver, - HYPRE_Int add_P_max_elmts); + HYPRE_Int add_P_max_elmts); /** * (Optional) Defines the relaxation type used in the (mult)additive cycle * portion (also affects simple method.) @@ -658,7 +679,7 @@ HYPRE_Int HYPRE_BoomerAMGSetAddRelaxType(HYPRE_Solver solver, * The weight only affects the Jacobi method, and has no effect on L1-Jacobi **/ HYPRE_Int HYPRE_BoomerAMGSetAddRelaxWt(HYPRE_Solver solver, - HYPRE_Real add_rlx_wt); + HYPRE_Real add_rlx_wt); /** * (Optional) Sets maximal size for agglomeration or redundant coarse grid solve. @@ -730,22 +751,54 @@ HYPRE_Int HYPRE_BoomerAMGSetGridRelaxType(HYPRE_Solver solver, * - 4 : hybrid Gauss-Seidel or SOR, backward solve * - 5 : hybrid chaotic Gauss-Seidel (works only with OpenMP) * - 6 : hybrid symmetric Gauss-Seidel or SSOR + * - 7 : Jacobi (uses Matvec) * - 8 : \f$\ell_1\f$-scaled hybrid symmetric Gauss-Seidel * - 9 : Gaussian elimination (only on coarsest level) + * - 10 : On-processor direct forward solve for matrices with + * triangular structure + * - 11 : Two Stage approximation to GS. Uses the strict lower + * part of the diagonal matrix + * - 12 : Two Stage approximation to GS. Uses the strict lower + * part of the diagonal matrix and a second iteration + * for additional error approximation * - 13 : \f$\ell_1\f$ Gauss-Seidel, forward solve * - 14 : \f$\ell_1\f$ Gauss-Seidel, backward solve * - 15 : CG (warning - not a fixed smoother - may require FGMRES) * - 16 : Chebyshev * - 17 : FCF-Jacobi * - 18 : \f$\ell_1\f$-scaled jacobi + * - 19 : Gaussian elimination (old version) + * - 21 : The same as 8 except forcing serialization on CPU (#OMP-thread = 1) + * - 29 : Direct solve: use Gaussian elimination & BLAS + * (with pivoting) (old version) + * - 30 : Kaczmarz + * - 88: The same methods as 8 with a convergent l1-term + * - 89: Symmetric l1-hybrid Gauss-Seidel (i.e., 13 followed by 14) + * - 98 : LU with pivoting + * - 99 : LU with pivoting + * -199 : Matvec with the inverse **/ HYPRE_Int HYPRE_BoomerAMGSetRelaxType(HYPRE_Solver solver, HYPRE_Int relax_type); /** * (Optional) Defines the smoother at a given cycle. - * For options of \e relax_type see - * description of HYPRE_BoomerAMGSetRelaxType). Options for \e k are + * + * For options of \e relax_type see description of HYPRE_BoomerAMGSetRelaxType. + * In addition, the following options for \e relax_type are available when choosing + * the coarsest level solver (k = 3): + * + * For coarsest level systems formed via a sub-communicator defined with active ranks: + * - 9 : hypre's internal Gaussian elimination (host only). + * - 99 : LU factorization with pivoting. + * - 199 : explicit (dense) inverse. + * + * For coarsest level systems formed via hypre_DataExchangeList: + * - 19 : hypre's internal Gaussian elimination (host only). + * - 98 : LU factorization with pivoting. + * - 198 : explicit (dense) inverse. + * + * Options for \e k are * * - 1 : the down cycle * - 2 : the up cycle @@ -774,8 +827,7 @@ HYPRE_Int HYPRE_BoomerAMGSetRelaxOrder(HYPRE_Solver solver, /** * (Optional) Defines in which order the points are relaxed. * - * Note: This routine will be phased out!!!! - * Use HYPRE_BoomerAMGSetRelaxOrder instead. + * See also HYPRE_BoomerAMGSetRelaxOrder. **/ HYPRE_Int HYPRE_BoomerAMGSetGridRelaxPoints(HYPRE_Solver solver, HYPRE_Int **grid_relax_points); @@ -870,14 +922,14 @@ HYPRE_Int HYPRE_BoomerAMGSetChebyFraction (HYPRE_Solver solver, * The default is 1 (i.e., scaled). **/ HYPRE_Int HYPRE_BoomerAMGSetChebyScale (HYPRE_Solver solver, - HYPRE_Int scale); + HYPRE_Int scale); /** * (Optional) Defines which polynomial variant should be used. * The default is 0 (i.e., scaled). **/ HYPRE_Int HYPRE_BoomerAMGSetChebyVariant (HYPRE_Solver solver, - HYPRE_Int variant); + HYPRE_Int variant); /** * (Optional) Defines how to estimate eigenvalues. @@ -888,12 +940,16 @@ HYPRE_Int HYPRE_BoomerAMGSetChebyVariant (HYPRE_Solver solver, * determine the smallest and largest eigenvalue. **/ HYPRE_Int HYPRE_BoomerAMGSetChebyEigEst (HYPRE_Solver solver, - HYPRE_Int eig_est); + HYPRE_Int eig_est); /** * (Optional) Enables the use of more complex smoothers. * The following options exist for \e smooth_type: * + * - 4 : FSAI (routines needed to set: HYPRE_BoomerAMGSetFSAIMaxSteps, + * HYPRE_BoomerAMGSetFSAIMaxStepSize, HYPRE_BoomerAMGSetFSAIEigMaxIters, + * HYPRE_BoomerAMGSetFSAIKapTolerance) + * - 5 : ParILUK (routines needed to set: HYPRE_ILUSetLevelOfFill, HYPRE_ILUSetType) * - 6 : Schwarz (routines needed to set: HYPRE_BoomerAMGSetDomainType, * HYPRE_BoomerAMGSetOverlap, HYPRE_BoomerAMGSetVariant, * HYPRE_BoomerAMGSetSchwarzRlxWeight) @@ -903,7 +959,6 @@ HYPRE_Int HYPRE_BoomerAMGSetChebyEigEst (HYPRE_Solver solver, * HYPRE_BoomerAMGSetLevel, HYPRE_BoomerAMGSetFilter, * HYPRE_BoomerAMGSetThreshold) * - 9 : Euclid (routines needed to set: HYPRE_BoomerAMGSetEuclidFile) - * - 5 : ParILUK (routines needed to set: HYPRE_ILUSetLevelOfFill, HYPRE_ILUSetType) * * The default is 6. Also, if no smoother parameters are set via the routines * mentioned in the table above, default values are used. @@ -1056,35 +1111,155 @@ HYPRE_Int HYPRE_BoomerAMGSetEuBJ(HYPRE_Solver solver, * For further explanation see description of ILU. **/ HYPRE_Int HYPRE_BoomerAMGSetILUType( HYPRE_Solver solver, - HYPRE_Int ilu_type); + HYPRE_Int ilu_type); /** * Defines level k for ILU(k) smoother * For further explanation see description of ILU. **/ HYPRE_Int HYPRE_BoomerAMGSetILULevel( HYPRE_Solver solver, - HYPRE_Int ilu_lfil); + HYPRE_Int ilu_lfil); /** * Defines max row nonzeros for ILUT smoother * For further explanation see description of ILU. **/ HYPRE_Int HYPRE_BoomerAMGSetILUMaxRowNnz( HYPRE_Solver solver, - HYPRE_Int ilu_max_row_nnz); + HYPRE_Int ilu_max_row_nnz); /** * Defines number of iterations for ILU smoother on each level * For further explanation see description of ILU. **/ HYPRE_Int HYPRE_BoomerAMGSetILUMaxIter( HYPRE_Solver solver, - HYPRE_Int ilu_max_iter); + HYPRE_Int ilu_max_iter); /** * Defines drop tolorance for iLUT smoother * For further explanation see description of ILU. **/ HYPRE_Int HYPRE_BoomerAMGSetILUDroptol( HYPRE_Solver solver, - HYPRE_Real ilu_droptol); + HYPRE_Real ilu_droptol); + +/** + * (Optional) Defines triangular solver for ILU(k,T) smoother: 0-iterative, 1-direct (default) + * For further explanation see description of ILU. + **/ +HYPRE_Int HYPRE_BoomerAMGSetILUTriSolve( HYPRE_Solver solver, + HYPRE_Int ilu_tri_solve); + +/** + * (Optional) Defines number of lower Jacobi iterations for ILU(k,T) smoother triangular solve. + * For further explanation see description of ILU. + **/ +HYPRE_Int HYPRE_BoomerAMGSetILULowerJacobiIters( HYPRE_Solver solver, + HYPRE_Int ilu_lower_jacobi_iters); + +/** + * (Optional) Defines number of upper Jacobi iterations for ILU(k,T) smoother triangular solve. + * For further explanation see description of ILU. + **/ +HYPRE_Int HYPRE_BoomerAMGSetILUUpperJacobiIters( HYPRE_Solver solver, + HYPRE_Int ilu_upper_jacobi_iters); + +/** + * (Optional) Set Local Reordering paramter (1==RCM, 0==None) + * For further explanation see description of ILU. + **/ +HYPRE_Int HYPRE_BoomerAMGSetILULocalReordering( HYPRE_Solver solver, + HYPRE_Int ilu_reordering_type); + +/** + * (Optional) Set iterative ILU's algorithm type. + * For further explanation see \e HYPRE_ILUSetIterativeSetupType. + **/ +HYPRE_Int HYPRE_BoomerAMGSetILUIterSetupType( HYPRE_Solver solver, + HYPRE_Int ilu_iter_setup_type); + +/** + * (Optional) Set iterative ILU's option. + * For further explanation see \e HYPRE_ILUSetIterativeSetupOption. + **/ +HYPRE_Int HYPRE_BoomerAMGSetILUIterSetupOption( HYPRE_Solver solver, + HYPRE_Int ilu_iter_setup_option); + +/** + * (Optional) Set iterative ILU's max. number of iterations. + * For further explanation see \e HYPRE_ILUSetIterativeSetupMaxIter. + **/ +HYPRE_Int HYPRE_BoomerAMGSetILUIterSetupMaxIter( HYPRE_Solver solver, + HYPRE_Int ilu_iter_setup_max_iter); + +/** + * (Optional) Set iterative ILU's tolerance. + * For further explanation see \e HYPRE_ILUSetIterativeSetupTolerance. + **/ +HYPRE_Int HYPRE_BoomerAMGSetILUIterSetupTolerance( HYPRE_Solver solver, + HYPRE_Real ilu_iter_setup_tolerance); + +/** + * (Optional) Defines the algorithm type for setting up FSAI + * For further explanation see \e HYPRE_FSAISetAlgoType. + **/ +HYPRE_Int HYPRE_BoomerAMGSetFSAIAlgoType(HYPRE_Solver solver, + HYPRE_Int algo_type); + +/** + * (Optional) Sets the solver type for solving local linear systems in FSAI. + * For further explanation see \e HYPRE_FSAISetLocalSolveType. + **/ +HYPRE_Int HYPRE_BoomerAMGSetFSAILocalSolveType( HYPRE_Solver solver, + HYPRE_Int local_solve_type ); + +/** + * (Optional) Defines maximum number of steps for FSAI. + * For further explanation see \e HYPRE_FSAISetMaxSteps. + **/ +HYPRE_Int HYPRE_BoomerAMGSetFSAIMaxSteps(HYPRE_Solver solver, + HYPRE_Int max_steps); + +/** + * (Optional) Defines maximum step size for FSAI. + * For further explanation see \e HYPRE_FSAISetMaxStepSize. + **/ +HYPRE_Int HYPRE_BoomerAMGSetFSAIMaxStepSize(HYPRE_Solver solver, + HYPRE_Int max_step_size); + +/** + * (Optional) Defines maximum number of nonzero entries per row for FSAI. + * For further explanation see \e HYPRE_FSAISetMaxNnzRow. + **/ +HYPRE_Int HYPRE_BoomerAMGSetFSAIMaxNnzRow(HYPRE_Solver solver, + HYPRE_Int max_nnz_row); + +/** + * (Optional) Defines number of levels for computing the candidate pattern for FSAI + * For further explanation see \e HYPRE_FSAISetNumLevels. + **/ +HYPRE_Int HYPRE_BoomerAMGSetFSAINumLevels(HYPRE_Solver solver, + HYPRE_Int num_levels); + +/** + * (Optional) Defines the threshold for computing the candidate pattern for FSAI + * For further explanation see \e HYPRE_FSAISetThreshold. + **/ +HYPRE_Int HYPRE_BoomerAMGSetFSAIThreshold(HYPRE_Solver solver, + HYPRE_Real threshold); + +/** + * (Optional) Defines maximum number of iterations for estimating the + * largest eigenvalue of the FSAI preconditioned matrix (G^T * G * A). + * For further explanation see \e HYPRE_FSAISetEigMaxIters. + **/ +HYPRE_Int HYPRE_BoomerAMGSetFSAIEigMaxIters(HYPRE_Solver solver, + HYPRE_Int eig_max_iters); + +/** + * (Optional) Defines the kaporin dropping tolerance. + * For further explanation see \e HYPRE_FSAISetKapTolerance. + **/ +HYPRE_Int HYPRE_BoomerAMGSetFSAIKapTolerance(HYPRE_Solver solver, + HYPRE_Real kap_tolerance); /** * (Optional) Defines which parallel restriction operator is used. @@ -1157,7 +1332,7 @@ HYPRE_Int HYPRE_BoomerAMGSetPrintLevel(HYPRE_Solver solver, /** * (Optional) Requests additional computations for diagnostic and similar - * data to be logged by the user. Default to 0 for do nothing. The latest + * data to be logged by the user. Default to 0 to do nothing. The latest * residual will be available if logging > 1. **/ HYPRE_Int HYPRE_BoomerAMGSetLogging(HYPRE_Solver solver, @@ -1202,7 +1377,7 @@ HYPRE_Int HYPRE_BoomerAMGSetModuleRAP2(HYPRE_Solver solver, * (Recommended for efficient use on GPUs) **/ HYPRE_Int HYPRE_BoomerAMGSetKeepTranspose(HYPRE_Solver solver, - HYPRE_Int keepTranspose); + HYPRE_Int keepTranspose); /** * HYPRE_BoomerAMGSetPlotGrids @@ -1237,7 +1412,7 @@ HYPRE_Int HYPRE_BoomerAMGSetCoordinates (HYPRE_Solver solver, * @param cgrid [IN/ OUT] preallocated array. On return, contains grid hierarchy info. **/ HYPRE_Int HYPRE_BoomerAMGGetGridHierarchy(HYPRE_Solver solver, - HYPRE_Int *cgrid ); + HYPRE_Int *cgrid ); #ifdef HYPRE_USING_DSUPERLU /** @@ -1251,7 +1426,7 @@ HYPRE_Int HYPRE_BoomerAMGGetGridHierarchy(HYPRE_Solver solver, **/ HYPRE_Int HYPRE_BoomerAMGSetDSLUThreshold (HYPRE_Solver solver, - HYPRE_Int slu_threshold); + HYPRE_Int slu_threshold); #endif /** @@ -1271,8 +1446,8 @@ HYPRE_Int HYPRE_BoomerAMGSetCPoints(HYPRE_Solver solver, * (Optional) Deprecated function. Use HYPRE_BoomerAMGSetCPoints instead. **/ HYPRE_Int HYPRE_BoomerAMGSetCpointsToKeep(HYPRE_Solver solver, - HYPRE_Int cpt_coarse_level, - HYPRE_Int num_cpt_coarse, + HYPRE_Int cpt_coarse_level, + HYPRE_Int num_cpt_coarse, HYPRE_BigInt *cpt_coarse_index); /** @@ -1425,7 +1600,7 @@ HYPRE_BoomerAMGDDSetNumGhostLayers( HYPRE_Solver solver, **/ HYPRE_Int HYPRE_BoomerAMGDDSetUserFACRelaxation( HYPRE_Solver solver, - HYPRE_Int (*userFACRelaxation)( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ) ); + HYPRE_Int (*userFACRelaxation)( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ) ); /** * (Optional) Get the underlying AMG hierarchy as a HYPRE_Solver object. @@ -1450,6 +1625,180 @@ HYPRE_BoomerAMGDDGetNumIterations( HYPRE_Solver solver, /**@}*/ +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +/** + * @name ParCSR FSAI Solver and Preconditioner + * + * An adaptive factorized sparse approximate inverse solver/preconditioner/smoother + * that computes a sparse approximation G to the inverse of the lower cholesky + * factor of A such that M^{-1} \approx G^T * G. + * + * @{ + **/ + +/** + * Create a solver object. + **/ +HYPRE_Int HYPRE_FSAICreate( HYPRE_Solver *solver ); + +/** + * Destroy a solver object. + **/ +HYPRE_Int HYPRE_FSAIDestroy( HYPRE_Solver solver ); + +/** + * Set up the FSAI solver or preconditioner. + * If used as a preconditioner, this function should be passed + * to the iterative solver \e SetPrecond function. + * + * @param solver [IN] object to be set up. + * @param A [IN] ParCSR matrix used to construct the solver/preconditioner. + * @param b Ignored by this function. + * @param x Ignored by this function. + **/ +HYPRE_Int HYPRE_FSAISetup( HYPRE_Solver solver, + HYPRE_ParCSRMatrix A, + HYPRE_ParVector b, + HYPRE_ParVector x ); + +/** + * Solve the system or apply FSAI as a preconditioner. + * If used as a preconditioner, this function should be passed + * to the iterative solver \e SetPrecond function. + * + * @param solver [IN] solver or preconditioner object to be applied. + * @param A [IN] ParCSR matrix, matrix of the linear system to be solved + * @param b [IN] right hand side of the linear system to be solved + * @param x [OUT] approximated solution of the linear system to be solved + **/ +HYPRE_Int HYPRE_FSAISolve( HYPRE_Solver solver, + HYPRE_ParCSRMatrix A, + HYPRE_ParVector b, + HYPRE_ParVector x ); + +/** + * (Optional) Sets the algorithm type used to compute the lower triangular factor G + * + * - 1: Adaptive (can use OpenMP with static scheduling) + * - 2: Adaptive OpenMP with dynamic scheduling + * - 3: Static - power pattern + **/ +HYPRE_Int HYPRE_FSAISetAlgoType( HYPRE_Solver solver, + HYPRE_Int algo_type ); + +/** + * (Optional) Sets the solver type for solving local linear systems in FSAI. This + * option makes sense only for GPU runs. + * + * - 0: Gauss-Jordan solver + * - 1: Vendor solver (cuSOLVER/rocSOLVER) + * - 2: MAGMA solver + **/ +HYPRE_Int HYPRE_FSAISetLocalSolveType( HYPRE_Solver solver, + HYPRE_Int local_solve_type ); + +/** + * (Optional) Sets the maximum number of steps for computing the sparsity + * pattern of G. This input parameter makes sense when using adaptive FSAI, + * i.e., algorithm type 1 or 2. + **/ +HYPRE_Int HYPRE_FSAISetMaxSteps( HYPRE_Solver solver, + HYPRE_Int max_steps ); + +/** + * (Optional) Sets the maximum step size for computing the sparsity pattern of G. + * This input parameter makes sense when using adaptive FSAI, i.e., algorithm + * type 1 or 2. + **/ +HYPRE_Int HYPRE_FSAISetMaxStepSize( HYPRE_Solver solver, + HYPRE_Int max_step_size ); + +/** + * (Optional) Sets the maximum number of off-diagonal entries per row of G. + * This input parameter makes sense when using static FSAI, i.e., algorithm + * type 3. + **/ +HYPRE_Int HYPRE_FSAISetMaxNnzRow( HYPRE_Solver solver, + HYPRE_Int max_nnz_row ); + +/** + * (Optional) Sets the number of levels for computing the candidate pattern of G. + * This input parameter must be a positive integer and it makes sense + * when using static FSAI, i.e., algorithm type 3. + **/ +HYPRE_Int HYPRE_FSAISetNumLevels( HYPRE_Solver solver, + HYPRE_Int num_levels ); + +/** + * (Optional) Sets the threshold for computing the candidate pattern of G + * This input parameter makes sense when using static FSAI, i.e., algorithm + * type 3. + **/ +HYPRE_Int HYPRE_FSAISetThreshold( HYPRE_Solver solver, + HYPRE_Real threshold ); + +/** + * (Optional) Sets the kaporin gradient reduction factor for computing the + * sparsity pattern of G. This input parameter makes sense when using adaptive + * FSAI, i.e., algorithm types 1 or 2. + **/ +HYPRE_Int HYPRE_FSAISetKapTolerance( HYPRE_Solver solver, + HYPRE_Real kap_tolerance ); + +/** + * (Optional) Sets the relaxation factor for FSAI. This input parameter makes + * sense to all algorithm types for setting up FSAI. + **/ +HYPRE_Int HYPRE_FSAISetOmega( HYPRE_Solver solver, + HYPRE_Real omega ); + +/** + * (Optional) Sets the maximum number of iterations (sweeps) for FSAI. This + * input parameter makes sense to all algorithm types for setting up FSAI. + **/ +HYPRE_Int HYPRE_FSAISetMaxIterations( HYPRE_Solver solver, + HYPRE_Int max_iterations ); + +/** + * (Optional) Set number of iterations for computing maximum + * eigenvalue of the preconditioned operator. This input parameter makes + * sense to all algorithm types for setting up FSAI. + **/ +HYPRE_Int HYPRE_FSAISetEigMaxIters( HYPRE_Solver solver, + HYPRE_Int eig_max_iters ); + +/** + * (Optional) Set the convergence tolerance, if FSAI is used + * as a solver. This input parameter makes sense to all algorithm types + * for setting up FSAI. When using FSAI as a preconditioner, set the + * tolerance to 0.0. The default is \f$10^{-6}\f$. + **/ +HYPRE_Int HYPRE_FSAISetTolerance( HYPRE_Solver solver, + HYPRE_Real tolerance ); + +/** + * (Optional) Requests automatic printing of setup information. + * + * - 0 : no printout (default) + * - 1 : print setup information + **/ +HYPRE_Int HYPRE_FSAISetPrintLevel(HYPRE_Solver solver, + HYPRE_Int print_level); + +/** + * (Optional) Use a zero initial guess. This allows the solver to cut corners + * in the case where a zero initial guess is needed (e.g., for preconditioning) + * to reduce compuational cost. + **/ +HYPRE_Int HYPRE_FSAISetZeroGuess(HYPRE_Solver solver, + HYPRE_Int zero_guess); + + +/**@}*/ + + /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ @@ -2191,9 +2540,9 @@ HYPRE_Int HYPRE_ADSDestroy(HYPRE_Solver solver); * @param b Ignored by this function. * @param x Ignored by this function. **/ -HYPRE_Int HYPRE_ADSSetup(HYPRE_Solver solver , - HYPRE_ParCSRMatrix A , - HYPRE_ParVector b , +HYPRE_Int HYPRE_ADSSetup(HYPRE_Solver solver, + HYPRE_ParCSRMatrix A, + HYPRE_ParVector b, HYPRE_ParVector x); /** @@ -2206,32 +2555,32 @@ HYPRE_Int HYPRE_ADSSetup(HYPRE_Solver solver , * @param b [IN] right hand side of the linear system to be solved * @param x [OUT] approximated solution of the linear system to be solved **/ -HYPRE_Int HYPRE_ADSSolve(HYPRE_Solver solver , - HYPRE_ParCSRMatrix A , - HYPRE_ParVector b , +HYPRE_Int HYPRE_ADSSolve(HYPRE_Solver solver, + HYPRE_ParCSRMatrix A, + HYPRE_ParVector b, HYPRE_ParVector x); /** * Sets the discrete curl matrix \e C. * This function should be called before HYPRE_ADSSetup()! **/ -HYPRE_Int HYPRE_ADSSetDiscreteCurl(HYPRE_Solver solver , +HYPRE_Int HYPRE_ADSSetDiscreteCurl(HYPRE_Solver solver, HYPRE_ParCSRMatrix C); /** * Sets the discrete gradient matrix \e G. * This function should be called before HYPRE_ADSSetup()! **/ -HYPRE_Int HYPRE_ADSSetDiscreteGradient(HYPRE_Solver solver , +HYPRE_Int HYPRE_ADSSetDiscreteGradient(HYPRE_Solver solver, HYPRE_ParCSRMatrix G); /** * Sets the \e x, \e y and \e z coordinates of the vertices in the mesh. * This function should be called before HYPRE_ADSSetup()! **/ -HYPRE_Int HYPRE_ADSSetCoordinateVectors(HYPRE_Solver solver , - HYPRE_ParVector x , - HYPRE_ParVector y , +HYPRE_Int HYPRE_ADSSetCoordinateVectors(HYPRE_Solver solver, + HYPRE_ParVector x, + HYPRE_ParVector y, HYPRE_ParVector z); /** @@ -2282,7 +2631,7 @@ HYPRE_Int HYPRE_ADSSetInterpolations(HYPRE_Solver solver, * as a solver. To use ADS as a preconditioner, set the maximum * number of iterations to 1. The default is 20. **/ -HYPRE_Int HYPRE_ADSSetMaxIter(HYPRE_Solver solver , +HYPRE_Int HYPRE_ADSSetMaxIter(HYPRE_Solver solver, HYPRE_Int maxit); /** @@ -2290,7 +2639,7 @@ HYPRE_Int HYPRE_ADSSetMaxIter(HYPRE_Solver solver , * as a solver. When using ADS as a preconditioner, set the tolerance * to 0.0. The default is \f$10^{-6}\f$. **/ -HYPRE_Int HYPRE_ADSSetTol(HYPRE_Solver solver , +HYPRE_Int HYPRE_ADSSetTol(HYPRE_Solver solver, HYPRE_Real tol); /** @@ -2311,7 +2660,7 @@ HYPRE_Int HYPRE_ADSSetTol(HYPRE_Solver solver , * * The default is 1. See the user's manual for more details. **/ -HYPRE_Int HYPRE_ADSSetCycleType(HYPRE_Solver solver , +HYPRE_Int HYPRE_ADSSetCycleType(HYPRE_Solver solver, HYPRE_Int cycle_type); /** @@ -2319,7 +2668,7 @@ HYPRE_Int HYPRE_ADSSetCycleType(HYPRE_Solver solver , * solution iterations. * The default is 1 (print residual norm at each step). **/ -HYPRE_Int HYPRE_ADSSetPrintLevel(HYPRE_Solver solver , +HYPRE_Int HYPRE_ADSSetPrintLevel(HYPRE_Solver solver, HYPRE_Int print_level); /** @@ -2334,19 +2683,19 @@ HYPRE_Int HYPRE_ADSSetPrintLevel(HYPRE_Solver solver , * - 4 : truncated version of \f$\ell_1\f$-scaled block symmetric Gauss-Seidel/SSOR * - 16 : Chebyshev **/ -HYPRE_Int HYPRE_ADSSetSmoothingOptions(HYPRE_Solver solver , - HYPRE_Int relax_type , - HYPRE_Int relax_times , - HYPRE_Real relax_weight , +HYPRE_Int HYPRE_ADSSetSmoothingOptions(HYPRE_Solver solver, + HYPRE_Int relax_type, + HYPRE_Int relax_times, + HYPRE_Real relax_weight, HYPRE_Real omega); /** * (Optional) Sets parameters for Chebyshev relaxation. * The defaults are 2, 0.3. **/ -HYPRE_Int HYPRE_ADSSetChebySmoothingOptions(HYPRE_Solver solver , - HYPRE_Int cheby_order , - HYPRE_Int cheby_fraction); +HYPRE_Int HYPRE_ADSSetChebySmoothingOptions(HYPRE_Solver solver, + HYPRE_Int cheby_order, + HYPRE_Real cheby_fraction); /** * (Optional) Sets AMS parameters for \f$B_C\f$. @@ -2355,37 +2704,37 @@ HYPRE_Int HYPRE_ADSSetChebySmoothingOptions(HYPRE_Solver solver , * interface of HYPRE_ADSSetInterpolations is being used! * See the user's manual for more details. **/ -HYPRE_Int HYPRE_ADSSetAMSOptions(HYPRE_Solver solver , - HYPRE_Int cycle_type , - HYPRE_Int coarsen_type , - HYPRE_Int agg_levels , - HYPRE_Int relax_type , - HYPRE_Real strength_threshold , - HYPRE_Int interp_type , +HYPRE_Int HYPRE_ADSSetAMSOptions(HYPRE_Solver solver, + HYPRE_Int cycle_type, + HYPRE_Int coarsen_type, + HYPRE_Int agg_levels, + HYPRE_Int relax_type, + HYPRE_Real strength_threshold, + HYPRE_Int interp_type, HYPRE_Int Pmax); /** * (Optional) Sets AMG parameters for \f$B_\Pi\f$. * The defaults are 10, 1, 3, 0.25, 0, 0. See the user's manual for more details. **/ -HYPRE_Int HYPRE_ADSSetAMGOptions(HYPRE_Solver solver , - HYPRE_Int coarsen_type , - HYPRE_Int agg_levels , - HYPRE_Int relax_type , - HYPRE_Real strength_threshold , - HYPRE_Int interp_type , +HYPRE_Int HYPRE_ADSSetAMGOptions(HYPRE_Solver solver, + HYPRE_Int coarsen_type, + HYPRE_Int agg_levels, + HYPRE_Int relax_type, + HYPRE_Real strength_threshold, + HYPRE_Int interp_type, HYPRE_Int Pmax); /** * Returns the number of iterations taken. **/ -HYPRE_Int HYPRE_ADSGetNumIterations(HYPRE_Solver solver , +HYPRE_Int HYPRE_ADSGetNumIterations(HYPRE_Solver solver, HYPRE_Int *num_iterations); /** * Returns the norm of the final relative residual. **/ -HYPRE_Int HYPRE_ADSGetFinalRelativeResidualNorm(HYPRE_Solver solver , +HYPRE_Int HYPRE_ADSGetFinalRelativeResidualNorm(HYPRE_Solver solver, HYPRE_Real *rel_resid_norm); /**@}*/ @@ -2427,7 +2776,7 @@ HYPRE_Int HYPRE_ParCSRPCGSetTol(HYPRE_Solver solver, HYPRE_Real tol); HYPRE_Int HYPRE_ParCSRPCGSetAbsoluteTol(HYPRE_Solver solver, - HYPRE_Real tol); + HYPRE_Real tol); HYPRE_Int HYPRE_ParCSRPCGSetMaxIter(HYPRE_Solver solver, HYPRE_Int max_iter); @@ -2449,6 +2798,9 @@ HYPRE_Int HYPRE_ParCSRPCGSetPrecond(HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver); +HYPRE_Int HYPRE_ParCSRPCGSetPreconditioner(HYPRE_Solver solver, + HYPRE_Solver precond); + HYPRE_Int HYPRE_ParCSRPCGGetPrecond(HYPRE_Solver solver, HYPRE_Solver *precond_data); @@ -2485,13 +2837,17 @@ HYPRE_Int HYPRE_ParCSRDiagScale(HYPRE_Solver solver, HYPRE_ParVector Hy, HYPRE_ParVector Hx); -/* Setup routine for on-processor triangular solve as preconditioning. */ +/** + * Setup routine for on-processor triangular solve as preconditioning. + **/ HYPRE_Int HYPRE_ParCSROnProcTriSetup(HYPRE_Solver solver, HYPRE_ParCSRMatrix HA, HYPRE_ParVector Hy, HYPRE_ParVector Hx); -/* Solve routine for on-processor triangular solve as preconditioning. */ +/** + * Solve routine for on-processor triangular solve as preconditioning. + **/ HYPRE_Int HYPRE_ParCSROnProcTriSolve(HYPRE_Solver solver, HYPRE_ParCSRMatrix HA, HYPRE_ParVector Hy, @@ -2579,7 +2935,7 @@ HYPRE_Int HYPRE_ParCSRGMRESGetFinalRelativeResidualNorm(HYPRE_Solver solver, * Returns the residual. **/ HYPRE_Int HYPRE_ParCSRGMRESGetResidual(HYPRE_Solver solver, - HYPRE_ParVector *residual); + HYPRE_ParVector *residual); /* ParCSR CO-GMRES, author: KS */ @@ -2588,7 +2944,7 @@ HYPRE_Int HYPRE_ParCSRGMRESGetResidual(HYPRE_Solver solver, * Create a solver object. **/ HYPRE_Int HYPRE_ParCSRCOGMRESCreate(MPI_Comm comm, - HYPRE_Solver *solver); + HYPRE_Solver *solver); /** * Destroy a solver object. @@ -2596,64 +2952,64 @@ HYPRE_Int HYPRE_ParCSRCOGMRESCreate(MPI_Comm comm, HYPRE_Int HYPRE_ParCSRCOGMRESDestroy(HYPRE_Solver solver); HYPRE_Int HYPRE_ParCSRCOGMRESSetup(HYPRE_Solver solver, - HYPRE_ParCSRMatrix A, - HYPRE_ParVector b, - HYPRE_ParVector x); + HYPRE_ParCSRMatrix A, + HYPRE_ParVector b, + HYPRE_ParVector x); HYPRE_Int HYPRE_ParCSRCOGMRESSolve(HYPRE_Solver solver, - HYPRE_ParCSRMatrix A, - HYPRE_ParVector b, - HYPRE_ParVector x); + HYPRE_ParCSRMatrix A, + HYPRE_ParVector b, + HYPRE_ParVector x); HYPRE_Int HYPRE_ParCSRCOGMRESSetKDim(HYPRE_Solver solver, - HYPRE_Int k_dim); + HYPRE_Int k_dim); HYPRE_Int HYPRE_ParCSRCOGMRESSetUnroll(HYPRE_Solver solver, - HYPRE_Int unroll); + HYPRE_Int unroll); HYPRE_Int HYPRE_ParCSRCOGMRESSetCGS(HYPRE_Solver solver, - HYPRE_Int cgs); + HYPRE_Int cgs); HYPRE_Int HYPRE_ParCSRCOGMRESSetTol(HYPRE_Solver solver, - HYPRE_Real tol); + HYPRE_Real tol); HYPRE_Int HYPRE_ParCSRCOGMRESSetAbsoluteTol(HYPRE_Solver solver, - HYPRE_Real a_tol); + HYPRE_Real a_tol); /* * RE-VISIT **/ HYPRE_Int HYPRE_ParCSRCOGMRESSetMinIter(HYPRE_Solver solver, - HYPRE_Int min_iter); + HYPRE_Int min_iter); HYPRE_Int HYPRE_ParCSRCOGMRESSetMaxIter(HYPRE_Solver solver, - HYPRE_Int max_iter); + HYPRE_Int max_iter); HYPRE_Int HYPRE_ParCSRCOGMRESSetPrecond(HYPRE_Solver solver, - HYPRE_PtrToParSolverFcn precond, - HYPRE_PtrToParSolverFcn precond_setup, - HYPRE_Solver precond_solver); + HYPRE_PtrToParSolverFcn precond, + HYPRE_PtrToParSolverFcn precond_setup, + HYPRE_Solver precond_solver); HYPRE_Int HYPRE_ParCSRCOGMRESGetPrecond(HYPRE_Solver solver, - HYPRE_Solver *precond_data); + HYPRE_Solver *precond_data); HYPRE_Int HYPRE_ParCSRCOGMRESSetLogging(HYPRE_Solver solver, - HYPRE_Int logging); + HYPRE_Int logging); HYPRE_Int HYPRE_ParCSRCOGMRESSetPrintLevel(HYPRE_Solver solver, - HYPRE_Int print_level); + HYPRE_Int print_level); HYPRE_Int HYPRE_ParCSRCOGMRESGetNumIterations(HYPRE_Solver solver, - HYPRE_Int *num_iterations); + HYPRE_Int *num_iterations); HYPRE_Int HYPRE_ParCSRCOGMRESGetFinalRelativeResidualNorm(HYPRE_Solver solver, - HYPRE_Real *norm); + HYPRE_Real *norm); /** * Returns the residual. **/ HYPRE_Int HYPRE_ParCSRCOGMRESGetResidual(HYPRE_Solver solver, - HYPRE_ParVector *residual); + HYPRE_ParVector *residual); /* end of parCSR CO-GMRES */ @@ -2732,7 +3088,7 @@ HYPRE_Int HYPRE_ParCSRFlexGMRESGetFinalRelativeResidualNorm(HYPRE_Solver solver HYPRE_Real *norm); HYPRE_Int HYPRE_ParCSRFlexGMRESGetResidual(HYPRE_Solver solver, - HYPRE_ParVector *residual); + HYPRE_ParVector *residual); HYPRE_Int HYPRE_ParCSRFlexGMRESSetModifyPC( HYPRE_Solver solver, @@ -2815,7 +3171,7 @@ HYPRE_Int HYPRE_ParCSRLGMRESGetFinalRelativeResidualNorm(HYPRE_Solver solver, HYPRE_Real *norm); HYPRE_Int HYPRE_ParCSRLGMRESGetResidual(HYPRE_Solver solver, - HYPRE_ParVector *residual); + HYPRE_ParVector *residual); /**@}*/ @@ -2888,7 +3244,7 @@ HYPRE_Int HYPRE_ParCSRBiCGSTABGetFinalRelativeResidualNorm(HYPRE_Solver solver, HYPRE_Real *norm); HYPRE_Int HYPRE_ParCSRBiCGSTABGetResidual(HYPRE_Solver solver, - HYPRE_ParVector *residual); + HYPRE_ParVector *residual); /**@}*/ @@ -3347,7 +3703,7 @@ HYPRE_Int HYPRE_ParCSRHybridSetAggNumLevels(HYPRE_Solver solver, HYPRE_Int agg_num_levels); -/* +/** * (Optional) Defines the interpolation used on levels of aggressive coarsening * The default is 4, i.e. multipass interpolation. * The following options exist: @@ -3403,7 +3759,7 @@ HYPRE_ParCSRHybridSetNodal(HYPRE_Solver solver, **/ HYPRE_Int HYPRE_ParCSRHybridSetKeepTranspose(HYPRE_Solver solver, - HYPRE_Int keepT); + HYPRE_Int keepT); /** * (Optional) Sets whether to use non-Galerkin option @@ -3413,8 +3769,8 @@ HYPRE_ParCSRHybridSetKeepTranspose(HYPRE_Solver solver, **/ HYPRE_Int HYPRE_ParCSRHybridSetNonGalerkinTol(HYPRE_Solver solver, - HYPRE_Int num_levels, - HYPRE_Real *nongalerkin_tol); + HYPRE_Int num_levels, + HYPRE_Real *nongalerkin_tol); /** * Retrieves the total number of iterations. @@ -3577,29 +3933,30 @@ HYPRE_Int HYPRE_MGRDirectSolverCreate( HYPRE_Solver *solver ); HYPRE_Int HYPRE_MGRDirectSolverDestroy( HYPRE_Solver solver ); /** - * Setup the MGR direct solver using DSUPERLU + * Setup the MGR direct solver using SuperLU_dist + * * @param solver [IN] object to be set up. * @param A [IN] ParCSR matrix used to construct the solver/preconditioner. * @param b right-hand-side of the linear system to be solved (Ignored by this function). * @param x approximate solution of the linear system to be solved (Ignored by this function). **/ HYPRE_Int HYPRE_MGRDirectSolverSetup( HYPRE_Solver solver, - HYPRE_ParCSRMatrix A, - HYPRE_ParVector b, - HYPRE_ParVector x ); + HYPRE_ParCSRMatrix A, + HYPRE_ParVector b, + HYPRE_ParVector x ); - /** - * Solve the system using DSUPERLU. - * - * @param solver [IN] solver or preconditioner object to be applied. - * @param A [IN] ParCSR matrix, matrix of the linear system to be solved (Ignored by this function). - * @param b [IN] right hand side of the linear system to be solved - * @param x [OUT] approximated solution of the linear system to be solved - **/ +/** +* Solve the system using SuperLU_dist. +* +* @param solver [IN] solver or preconditioner object to be applied. +* @param A [IN] ParCSR matrix, matrix of the linear system to be solved (Ignored by this function). +* @param b [IN] right hand side of the linear system to be solved +* @param x [OUT] approximated solution of the linear system to be solved +**/ HYPRE_Int HYPRE_MGRDirectSolverSolve( HYPRE_Solver solver, - HYPRE_ParCSRMatrix A, - HYPRE_ParVector b, - HYPRE_ParVector x ); + HYPRE_ParCSRMatrix A, + HYPRE_ParVector b, + HYPRE_ParVector x ); #endif /** @@ -3623,24 +3980,24 @@ HYPRE_Int HYPRE_MGRDestroy( HYPRE_Solver solver ); * @param x approximate solution of the linear system to be solved (Ignored by this function). **/ HYPRE_Int HYPRE_MGRSetup( HYPRE_Solver solver, - HYPRE_ParCSRMatrix A, - HYPRE_ParVector b, - HYPRE_ParVector x ); - - /** - * Solve the system or apply MGR as a preconditioner. - * If used as a preconditioner, this function should be passed - * to the iterative solver \e SetPrecond function. - * - * @param solver [IN] solver or preconditioner object to be applied. - * @param A [IN] ParCSR matrix, matrix of the linear system to be solved - * @param b [IN] right hand side of the linear system to be solved - * @param x [OUT] approximated solution of the linear system to be solved - **/ + HYPRE_ParCSRMatrix A, + HYPRE_ParVector b, + HYPRE_ParVector x ); + +/** +* Solve the system or apply MGR as a preconditioner. +* If used as a preconditioner, this function should be passed +* to the iterative solver \e SetPrecond function. +* +* @param solver [IN] solver or preconditioner object to be applied. +* @param A [IN] ParCSR matrix, matrix of the linear system to be solved +* @param b [IN] right hand side of the linear system to be solved +* @param x [OUT] approximated solution of the linear system to be solved +**/ HYPRE_Int HYPRE_MGRSolve( HYPRE_Solver solver, - HYPRE_ParCSRMatrix A, - HYPRE_ParVector b, - HYPRE_ParVector x ); + HYPRE_ParCSRMatrix A, + HYPRE_ParVector b, + HYPRE_ParVector x ); /** * Set the block data assuming that the physical variables are ordered contiguously, @@ -3653,11 +4010,11 @@ HYPRE_Int HYPRE_MGRSolve( HYPRE_Solver solver, * @param block_coarse_indexes [IN] index for each block coarse point per level **/ HYPRE_Int HYPRE_MGRSetCpointsByContiguousBlock( HYPRE_Solver solver, - HYPRE_Int block_size, - HYPRE_Int max_num_levels, - HYPRE_BigInt *idx_array, - HYPRE_Int *num_block_coarse_points, - HYPRE_Int **block_coarse_indexes); + HYPRE_Int block_size, + HYPRE_Int max_num_levels, + HYPRE_BigInt *idx_array, + HYPRE_Int *num_block_coarse_points, + HYPRE_Int **block_coarse_indexes); /** * Set the block data (by grid points) and prescribe the coarse indexes per block @@ -3670,14 +4027,11 @@ HYPRE_Int HYPRE_MGRSetCpointsByContiguousBlock( HYPRE_Solver solver, * @param block_coarse_indexes [IN] index for each block coarse point per level **/ HYPRE_Int HYPRE_MGRSetCpointsByBlock( HYPRE_Solver solver, - HYPRE_Int block_size, - HYPRE_Int max_num_levels, - HYPRE_Int *num_block_coarse_points, - HYPRE_Int **block_coarse_indexes); + HYPRE_Int block_size, + HYPRE_Int max_num_levels, + HYPRE_Int *num_block_coarse_points, + HYPRE_Int **block_coarse_indexes); -/*-------------------------------------------------------------------------- - * HYPRE_Int HYPRE_MGRSetCpointsByPointMarkerArray - *--------------------------------------------------------------------------*/ /** * Set the coarse indices for the levels using an array of tags for all the * local degrees of freedom. @@ -3691,11 +4045,11 @@ HYPRE_Int HYPRE_MGRSetCpointsByBlock( HYPRE_Solver solver, * @param point_marker_array [IN] array of tags for the local degrees of freedom **/ HYPRE_Int HYPRE_MGRSetCpointsByPointMarkerArray( HYPRE_Solver solver, - HYPRE_Int block_size, - HYPRE_Int max_num_levels, - HYPRE_Int *num_block_coarse_points, - HYPRE_Int **lvl_block_coarse_indexes, - HYPRE_Int *point_marker_array); + HYPRE_Int block_size, + HYPRE_Int max_num_levels, + HYPRE_Int *num_block_coarse_points, + HYPRE_Int **lvl_block_coarse_indexes, + HYPRE_Int *point_marker_array); /** * (Optional) Set non C-points to F-points. @@ -3742,15 +4096,17 @@ HYPRE_MGRSetReservedCoarseNodes( HYPRE_Solver solver, HYPRE_Int reserved_coarse_size, HYPRE_BigInt *reserved_coarse_nodes ); -/* (Optional) Set the level for reducing the reserved Cpoints before the coarse +/** + * (Optional) Set the level for reducing the reserved Cpoints before the coarse * grid solve. This is necessary for some applications, such as phase transitions. * The default is 0 (no reduction, i.e. keep the reserved cpoints in the coarse grid solve). + * * The default setup for the reduction is as follows: - * interp_type = 2 - * restrict_type = 0 - * F-relax method = 99 - * Galerkin coarse grid -**/ + * - Interpolation type: Jacobi (2) + * - Restriction type: Injection (0) + * - F-relaxation type: LU factorization with pivoting (99) + * - Coarse grid type: galerkin (0) + **/ HYPRE_Int HYPRE_MGRSetReservedCpointsLevelToKeep( HYPRE_Solver solver, HYPRE_Int level); @@ -3758,7 +4114,8 @@ HYPRE_MGRSetReservedCpointsLevelToKeep( HYPRE_Solver solver, HYPRE_Int level); * (Optional) Set the relaxation type for F-relaxation. * Currently supports the following flavors of relaxation types * as described in the \e BoomerAMGSetRelaxType: - * \e relax_type 0 - 8, 13, 14, 18, 19, 98. + * \e relax_type 0, 3 - 8, 13, 14, 18. Also supports AMG (options 1 and 2) + * and direct solver variants (9, 99, 199). See \e HYPRE_MGRSetLevelFRelaxType for details. **/ HYPRE_Int HYPRE_MGRSetRelaxType(HYPRE_Solver solver, @@ -3770,23 +4127,72 @@ HYPRE_MGRSetRelaxType(HYPRE_Solver solver, * * - 0 : Single-level relaxation sweeps for F-relaxation as prescribed by \e MGRSetRelaxType * - 1 : Multi-level relaxation strategy for F-relaxation (V(1,0) cycle currently supported). + * + * NOTE: This function will be removed in favor of \e HYPRE_MGRSetLevelFRelaxType!! **/ HYPRE_Int HYPRE_MGRSetFRelaxMethod(HYPRE_Solver solver, HYPRE_Int relax_method ); +/** + * (Optional) This function is an extension of HYPRE_MGRSetFRelaxMethod. It allows setting + * the F-relaxation strategy for each MGR level. + **/ +HYPRE_Int +HYPRE_MGRSetLevelFRelaxMethod(HYPRE_Solver solver, + HYPRE_Int *relax_method ); + +/** + * (Optional) Set the relaxation type for F-relaxation at each level. + * This function takes precedence over, and will replace \e HYPRE_MGRSetFRelaxMethod + * and HYPRE_MGRSetRelaxType. + * Options for \e relax_type entries are: + * + * - 0, 3 - 8, 13, 14, 18: (as described in \e BoomerAMGSetRelaxType) + * - 1 : Multi-level relaxation strategy for F-relaxation (V(1,0) cycle currently supported). + * - 2 : AMG + * - 9, 99, 199 : Gaussian Elimination variants (GE, GE with pivoting, direct inversion respectively) + **/ HYPRE_Int -HYPRE_MGRSetLevelFRelaxMethod(HYPRE_Solver solver, HYPRE_Int *relax_method ); +HYPRE_MGRSetLevelFRelaxType(HYPRE_Solver solver, + HYPRE_Int *relax_type ); /** * (Optional) Set the strategy for coarse grid computation. * Options for \e cg_method are: * * - 0 : Galerkin coarse grid computation using RAP. - * - 1 : Non-Galerkin coarse grid computation with dropping strategy. + * - 1 - 5 : Non-Galerkin coarse grid computation with dropping strategy. + * - 1: inv(A_FF) approximated by its (block) diagonal inverse + * - 2: CPR-like approximation with inv(A_FF) approximated by its diagonal inverse + * - 3: CPR-like approximation with inv(A_FF) approximated by its block diagonal inverse + * - 4: inv(A_FF) approximated by sparse approximate inverse + * - 5: inv(A_FF) is an empty matrix and coarse level matrix is set to A_CC + **/ +HYPRE_Int +HYPRE_MGRSetCoarseGridMethod(HYPRE_Solver solver, + HYPRE_Int *cg_method ); + +/** + * (Optional) Set the maximum number of nonzeros per row of the coarse grid correction + * operator computed in the Non-Galerkin approach. Options for \e max_elmts are: + * + * - 0: keep only the (block) diagonal portion of the correction matrix (default). + * - k > 0: keep the (block) diagonal plus the k-th largest entries per row + * of the correction matrix. + **/ +HYPRE_Int +HYPRE_MGRSetNonGalerkinMaxElmts(HYPRE_Solver solver, + HYPRE_Int max_elmts); + +/** + * (Optional) Set the maximum number of nonzeros per row of the coarse grid correction + * operator computed in the Non-Galerkin approach at each MGR level. For options, see + * \e HYPRE_MGRSetNonGalerkinMaxElmts. **/ HYPRE_Int -HYPRE_MGRSetCoarseGridMethod(HYPRE_Solver solver, HYPRE_Int *cg_method ); +HYPRE_MGRSetLevelNonGalerkinMaxElmts(HYPRE_Solver solver, + HYPRE_Int *max_elmts); /** * (Optional) Set the number of functions for F-relaxation V-cycle. @@ -3795,7 +4201,8 @@ HYPRE_MGRSetCoarseGridMethod(HYPRE_Solver solver, HYPRE_Int *cg_method ); * to the number of scalar PDEs in the system. **/ HYPRE_Int -HYPRE_MGRSetLevelFRelaxNumFunctions(HYPRE_Solver solver, HYPRE_Int *num_functions); +HYPRE_MGRSetLevelFRelaxNumFunctions(HYPRE_Solver solver, + HYPRE_Int *num_functions); /** * (Optional) Set the strategy for computing the MGR restriction operator. @@ -3808,6 +4215,9 @@ HYPRE_MGRSetLevelFRelaxNumFunctions(HYPRE_Solver solver, HYPRE_Int *num_function * - 3 : approximate inverse * - 4 : pAIR distance 1 * - 5 : pAIR distance 2 + * - 12 : Block Jacobi + * - 13 : CPR-like restriction operator + * - 14 : (Block) Column-lumped restriction * - else : use classical modified interpolation * * The default is injection. @@ -3816,6 +4226,10 @@ HYPRE_Int HYPRE_MGRSetRestrictType( HYPRE_Solver solver, HYPRE_Int restrict_type); +/** + * (Optional) This function is an extension of \e HYPRE_MGRSetRestrictType. It allows setting + * the restriction operator strategy for each MGR level. + **/ HYPRE_Int HYPRE_MGRSetLevelRestrictType( HYPRE_Solver solver, HYPRE_Int *restrict_type); @@ -3833,10 +4247,11 @@ HYPRE_MGRSetNumRestrictSweeps( HYPRE_Solver solver, * Options for \e interp_type are: * * - 0 : injection \f$[0 I]^{T}\f$ - * - 1 : unscaled (not recommended) + * - 1 : L1-Jacobi * - 2 : diagonal scaling (Jacobi) * - 3 : classical modified interpolation * - 4 : approximate inverse + * - 12 : Block Jacobi * - else : classical modified interpolation * * The default is diagonal scaling. @@ -3845,6 +4260,10 @@ HYPRE_Int HYPRE_MGRSetInterpType( HYPRE_Solver solver, HYPRE_Int interp_type ); +/** + * (Optional) This function is an extension of \e HYPRE_MGRSetInterpType. It allows setting + * the prolongation (interpolation) operator strategy for each MGR level. + **/ HYPRE_Int HYPRE_MGRSetLevelInterpType( HYPRE_Solver solver, HYPRE_Int *interp_type ); @@ -3857,6 +4276,14 @@ HYPRE_Int HYPRE_MGRSetNumRelaxSweeps( HYPRE_Solver solver, HYPRE_Int nsweeps ); +/** + * (Optional) This function is an extension of \e HYPRE_MGRSetNumRelaxSweeps. It allows setting + * the number of single-level relaxation sweeps for each MGR level. + **/ +HYPRE_Int +HYPRE_MGRSetLevelNumRelaxSweeps( HYPRE_Solver solver, + HYPRE_Int *nsweeps ); + /** * (Optional) Set number of interpolation sweeps. * This option is for \e interp_type > 2. @@ -3865,67 +4292,121 @@ HYPRE_Int HYPRE_MGRSetNumInterpSweeps( HYPRE_Solver solver, HYPRE_Int nsweeps ); +/** + * (Optional) Set block size for block (global) smoother and interp/restriction. + * This option is for \e interp_type/restrict_type == 12, and + * \e smooth_type == 0 or 1. + **/ +HYPRE_Int +HYPRE_MGRSetBlockJacobiBlockSize( HYPRE_Solver solver, + HYPRE_Int blk_size ); -HYPRE_Int HYPRE_MGRSetFSolver(HYPRE_Solver solver, - HYPRE_PtrToParSolverFcn fine_grid_solver_solve, - HYPRE_PtrToParSolverFcn fine_grid_solver_setup, - HYPRE_Solver fsolver ); +/** + * (Optional) Set the fine grid solver. + * + * @param solver [IN] MGR solver/preconditioner object + * @param fine_grid_solver_solve [IN] solve routine + * @param fine_grid_solver_setup [IN] setup routine + * @param fine_grid_solver [IN] fine grid solver object + **/ +HYPRE_Int HYPRE_MGRSetFSolver(HYPRE_Solver solver, + HYPRE_PtrToParSolverFcn fine_grid_solver_solve, + HYPRE_PtrToParSolverFcn fine_grid_solver_setup, + HYPRE_Solver fsolver ); +/** + * (Optional) Set the F-relaxation solver at a given level. + * + * @param solver [IN] MGR solver/preconditioner object + * @param fsolver [IN] F-relaxation solver object + * @param level [IN] MGR solver level + **/ +HYPRE_Int HYPRE_MGRSetFSolverAtLevel(HYPRE_Solver solver, + HYPRE_Solver fsolver, + HYPRE_Int level ); + +/** + * (Optional) Extract A_FF block from matrix A. + * + * TODO (VPM): Does this need to be exposed? Move to parcsr_mv? + **/ HYPRE_Int HYPRE_MGRBuildAff(HYPRE_ParCSRMatrix A, - HYPRE_Int *CF_marker, - HYPRE_Int debug_flag, - HYPRE_ParCSRMatrix *A_ff); + HYPRE_Int *CF_marker, + HYPRE_Int debug_flag, + HYPRE_ParCSRMatrix *A_ff); /** * (Optional) Set the coarse grid solver. * Currently uses BoomerAMG. * The default, if not set, is BoomerAMG with default options. * - * @param solver [IN] solver or preconditioner object + * @param solver [IN] MGR solver/preconditioner object * @param coarse_grid_solver_solve [IN] solve routine for BoomerAMG * @param coarse_grid_solver_setup [IN] setup routine for BoomerAMG - * @param coarse_grid_solver [IN] BoomerAMG solver + * @param coarse_grid_solver [IN] coarse grid solver object **/ -HYPRE_Int HYPRE_MGRSetCoarseSolver(HYPRE_Solver solver, - HYPRE_PtrToParSolverFcn coarse_grid_solver_solve, - HYPRE_PtrToParSolverFcn coarse_grid_solver_setup, - HYPRE_Solver coarse_grid_solver ); +HYPRE_Int HYPRE_MGRSetCoarseSolver(HYPRE_Solver solver, + HYPRE_PtrToParSolverFcn coarse_grid_solver_solve, + HYPRE_PtrToParSolverFcn coarse_grid_solver_setup, + HYPRE_Solver coarse_grid_solver ); /** - * (Optional) Set the print level to print setup and solve information. + * @brief (Optional) Set the verbosity level for MGR. * - * - 0 : no printout (default) - * - 1 : print setup information - * - 2 : print solve information - * - 3 : print both setup and solve information + * @details Control what information gets printed by specifying the output levels + * using this function. Each option corresponds to a specific type of information, and you + * can activate several of them at the same time by summing their respective numeric codes, +* which are given below: + * + * - 1: Print MGR's setup information. + * - 2: Print MGR's solve information. + * - 4: Print MGR's parameters information. + * - 8: Set print mode for matrices and vectors to ASCII (binary mode is used by default) + * - 16: Print the finest level matrix to NP files where NP is the number of ranks. + * - 32: Print the finest level right-hand-side to NP files. + * - 64: Print the coarsest level matrix to NP files. + * - 128: Print the full MGR hierarchy (operator, interpolation, and restriction). + * + * @param solver [IN] The solver to configure. + * @param print_level [IN] The desired output level. + * + * @example To print setup information (1); fine matrix (16) and rhs (32) to binary files, + * set \c print_level to 49 (1 + 16 + 32). In the previous example, to use ASCII + * files for matrices and vectors, set \c print_level to 57 (1 + 8 + 16 + 32). + * + * @note The default print level is zero, which means no information will be + * printed by default. Options starting from 8 are intended for developers' usage. **/ HYPRE_Int HYPRE_MGRSetPrintLevel( HYPRE_Solver solver, HYPRE_Int print_level ); +/** + * (Optional) Set the print level of the F-relaxation solver + **/ HYPRE_Int HYPRE_MGRSetFrelaxPrintLevel( HYPRE_Solver solver, - HYPRE_Int print_level ); - + HYPRE_Int print_level ); + +/** + * (Optional) Set the print level of the coarse grid solver + **/ HYPRE_Int HYPRE_MGRSetCoarseGridPrintLevel( HYPRE_Solver solver, - HYPRE_Int print_level ); + HYPRE_Int print_level ); /** - * (Optional) Set the threshold to compress the coarse grid at each level - * Use threshold = 0.0 if no truncation is applied. Otherwise, set the threshold - * value for dropping entries for the coarse grid. - * The default is 0.0. + * (Optional) Set the threshold for dropping small entries on the coarse grid at each level. + * No dropping is applied if \e threshold = 0.0 (default). **/ HYPRE_Int HYPRE_MGRSetTruncateCoarseGridThreshold( HYPRE_Solver solver, - HYPRE_Real threshold); - + HYPRE_Real threshold); /** * (Optional) Requests logging of solver diagnostics. * Requests additional computations for diagnostic and similar - * data to be logged by the user. Default to 0 for do nothing. The latest + * data to be logged by the user. Default is 0, do nothing. The latest * residual will be available if logging > 1. **/ HYPRE_Int @@ -3953,27 +4434,100 @@ HYPRE_MGRSetTol( HYPRE_Solver solver, * Default is 0 (no global smoothing). **/ HYPRE_Int -HYPRE_MGRSetMaxGlobalsmoothIters( HYPRE_Solver solver, +HYPRE_MGRSetMaxGlobalSmoothIters( HYPRE_Solver solver, HYPRE_Int smooth_iter ); +/** + * (Optional) Determines how many sweeps of global smoothing to do on each level. + * Default is 0 (no global smoothing). + **/ +HYPRE_Int +HYPRE_MGRSetLevelSmoothIters( HYPRE_Solver solver, + HYPRE_Int *smooth_iters ); +/** + * (Optional) Set the cycle for global smoothing. + * Options for \e global_smooth_cycle are: + * - 1 : Pre-smoothing - Down cycle (default) + * - 2 : Post-smoothing - Up cycle + **/ +HYPRE_Int +HYPRE_MGRSetGlobalSmoothCycle( HYPRE_Solver solver, + HYPRE_Int global_smooth_cycle ); + /** * (Optional) Determines type of global smoother. * Options for \e smooth_type are: * - * - 0 : block Jacobi (default) - * - 1 : Jacobi - * - 2 : Gauss-Seidel, sequential (very slow!) - * - 3 : Gauss-Seidel, interior points in parallel, boundary sequential (slow!) - * - 4 : hybrid Gauss-Seidel or SOR, forward solve - * - 5 : hybrid Gauss-Seidel or SOR, backward solve - * - 6 : hybrid chaotic Gauss-Seidel (works only with OpenMP) - * - 7 : hybrid symmetric Gauss-Seidel or SSOR - * - 8 : Euclid (ILU) + * - 0 : block Jacobi (default) + * - 1 : block Gauss-Seidel + * - 2 : Jacobi + * - 3 : Gauss-Seidel, sequential (very slow!) + * - 4 : Gauss-Seidel, interior points in parallel, boundary sequential (slow!) + * - 5 : hybrid Gauss-Seidel or SOR, forward solve + * - 6 : hybrid Gauss-Seidel or SOR, backward solve + * - 8 : Euclid (ILU) + * - 16 : HYPRE_ILU + * - 18 : L1-Jacobi **/ HYPRE_Int -HYPRE_MGRSetGlobalsmoothType( HYPRE_Solver solver, +HYPRE_MGRSetGlobalSmoothType( HYPRE_Solver solver, HYPRE_Int smooth_type ); +/** + * @brief Sets the type of global smoother for each level in the multigrid reduction (MGR) solver. + * + * This function allows the user to specify the type of global smoother to be used at each level + * of the multigrid reduction process. The types of smoothers available can be found in the + * documentation for \e HYPRE_MGRSetGlobalSmoothType. The smoother type for each level is indicated + * by the \e smooth_type array, which should have a size equal to \e max_num_coarse_levels. + * + * @note This function does not take ownership of the \e smooth_type array. + * @note If \e smooth_type is a NULL pointer, a default global smoother (Jacobi) is used for all levels. + * @note This call is optional. It is intended for advanced users who need specific control over the + * smoothing process at different levels of the solver. If not called, the solver will proceed + * with default smoothing parameters. + * + * @param[in] \e solver The HYPRE solver object to configure. + * @param[in] \e smooth_type An array of integers where each value specifies the type of smoother to + * be used at the corresponding level. + * + * @return HYPRE_Int Error code (0 for success, non-zero for failure). + * + * @see HYPRE_MGRSetGlobalSmoothType for details on global smoother options. + */ + +HYPRE_Int +HYPRE_MGRSetLevelSmoothType(HYPRE_Solver solver, + HYPRE_Int *smooth_type); + +/** + * @brief Sets the global smoother method for a specified MGR level using a HYPRE solver object. + * + * This function enables solvers within hypre to be used as complex smoothers for a specific level + * within the multigrid reduction (MGR) scheme. Users can configure the solver options and pass the + * solver in as the smoother. Currently supported solver options via this interface are ILU and AMG. + * + * @note Unlike some other setup functions that might require an array to set options across multiple + * levels, this function focuses on a single level, identified by the \e level parameter. + * + * @warning The smoother passed to function takes precedence over the smoother type set for that level + * in the MGR hierarchy. + * + * @param[in,out] \e solver A pointer to the MGR solver object. This object is modified to include the + * specified smoother for the given level. + * @param[in] \e smoother The HYPRE solver object that specifies the global relaxation method to be used + * at the specified level. Currently available choices are BoomerAMG and ILU. + * @param[in] \e level The level identifier for which the global relaxation method is to be set. + * Must be within the range of the number of levels in the MGR solver. + * + * @return HYPRE_Int Returns an error code. Success is indicated by 0, while any non-zero value signifies an error. + */ + +HYPRE_Int +HYPRE_MGRSetGlobalSmootherAtLevel( HYPRE_Solver solver, + HYPRE_Solver smoother, + HYPRE_Int level ); + /** * (Optional) Return the number of MGR iterations. **/ @@ -3981,21 +4535,33 @@ HYPRE_Int HYPRE_MGRGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +/** + * (Optional) Return the relative residual for the coarse level system. + **/ +HYPRE_Int +HYPRE_MGRGetCoarseGridConvergenceFactor( HYPRE_Solver solver, + HYPRE_Real *conv_factor ); + +/** + * (Optional) Set the maximum number of nonzeros per row for interpolation operators. + **/ HYPRE_Int -HYPRE_MGRGetCoarseGridConvergenceFactor (HYPRE_Solver solver, HYPRE_Real *conv_factor ); +HYPRE_MGRSetPMaxElmts( HYPRE_Solver solver, + HYPRE_Int P_max_elmts ); /** - * (Optional) Set the number of maximum points for interpolation operator. + * (Optional) Set the maximum number of nonzeros per row for interpolation operators for each level. **/ HYPRE_Int -HYPRE_MGRSetPMaxElmts( HYPRE_Solver solver, HYPRE_Int P_max_elmts); +HYPRE_MGRSetLevelPMaxElmts( HYPRE_Solver solver, + HYPRE_Int *P_max_elmts ); /** * (Optional) Return the norm of the final relative residual. **/ HYPRE_Int -HYPRE_MGRGetFinalRelativeResidualNorm( HYPRE_Solver solver, - HYPRE_Real *res_norm ); +HYPRE_MGRGetFinalRelativeResidualNorm( HYPRE_Solver solver, + HYPRE_Real *res_norm ); /**@}*/ @@ -4004,7 +4570,7 @@ HYPRE_MGRGetFinalRelativeResidualNorm( HYPRE_Solver solver, /** * @name ParCSR ILU Solver * - * (Parallel) ILU smoother + * (Parallel) Incomplete LU factorization. * * @{ **/ @@ -4012,12 +4578,14 @@ HYPRE_MGRGetFinalRelativeResidualNorm( HYPRE_Solver solver, /** * Create a solver object **/ -HYPRE_Int HYPRE_ILUCreate( HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_ILUCreate( HYPRE_Solver *solver ); /** * Destroy a solver object **/ -HYPRE_Int HYPRE_ILUDestroy( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_ILUDestroy( HYPRE_Solver solver ); /** * Setup the ILU solver or preconditioner. @@ -4029,24 +4597,26 @@ HYPRE_Int HYPRE_ILUDestroy( HYPRE_Solver solver ); * @param b right-hand-side of the linear system to be solved (Ignored by this function). * @param x approximate solution of the linear system to be solved (Ignored by this function). **/ -HYPRE_Int HYPRE_ILUSetup( HYPRE_Solver solver, - HYPRE_ParCSRMatrix A, - HYPRE_ParVector b, - HYPRE_ParVector x ); - /** - * Solve the system or apply ILU as a preconditioner. - * If used as a preconditioner, this function should be passed - * to the iterative solver \e SetPrecond function. - * - * @param solver [IN] solver or preconditioner object to be applied. - * @param A [IN] ParCSR matrix, matrix of the linear system to be solved - * @param b [IN] right hand side of the linear system to be solved - * @param x [OUT] approximated solution of the linear system to be solved - **/ -HYPRE_Int HYPRE_ILUSolve( HYPRE_Solver solver, - HYPRE_ParCSRMatrix A, - HYPRE_ParVector b, - HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ILUSetup( HYPRE_Solver solver, + HYPRE_ParCSRMatrix A, + HYPRE_ParVector b, + HYPRE_ParVector x ); +/** +* Solve the system or apply ILU as a preconditioner. +* If used as a preconditioner, this function should be passed +* to the iterative solver \e SetPrecond function. +* +* @param solver [IN] solver or preconditioner object to be applied. +* @param A [IN] ParCSR matrix, matrix of the linear system to be solved +* @param b [IN] right hand side of the linear system to be solved +* @param x [OUT] approximated solution of the linear system to be solved +**/ +HYPRE_Int +HYPRE_ILUSolve( HYPRE_Solver solver, + HYPRE_ParCSRMatrix A, + HYPRE_ParVector b, + HYPRE_ParVector x ); /** * (Optional) Set maximum number of iterations if used as a solver. @@ -4056,7 +4626,82 @@ HYPRE_Int HYPRE_ILUSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ); /** - * (Optional) Set the convergence tolerance for the ILU smoother. + * (Optional) Set the algorithm type to compute the ILU factorization. Options are: + * + * - 0 : Non-iterative algorithm (default) + * - 1 : Asynchronous with in-place storage + * - 2 : Asynchronous with explicit storage splitting + * - 3 : Synchronous with explicit storage splitting + * - 4 : Semi-synchronous with explicit storage splitting + * + * Note: Iterative ILU is available only for zero fill-in and it depends on rocSPARSE. + **/ +HYPRE_Int +HYPRE_ILUSetIterativeSetupType( HYPRE_Solver solver, HYPRE_Int iter_setup_type ); + +/** + * (Optional) Set the compute option for iterative ILU in an additive fashion, i.e.; multiple + * options can be turned on by summing their respective numeric codes as given below: + * + * - 2: Use stopping tolerance to finish the algorithm + * - 4: Compute correction norms + * - 8: Compute residual norms + * - 16: Save convergence history + * - 32: Use rocSPARSE's internal COO format + * + * The iterative ILU algorithm can terminate based on the maximum number of iterations (default) + * or a target tolerance (option 2). In the tolerance-based case, the max. number of iterations + * is still used to terminate the algorithm in case it does not converge to the requested + * tolerance. In addition, the tolerance-based mode uses residual norms by default (option 8). + * To use correction norms instead, enable option 4. Lastly, the convergence history for + * computing the triangular factors can be saved and printed out by enabling option 16. + * + * Note: Iterative ILU is available only for zero fill-in, and it depends on rocSPARSE. + **/ +HYPRE_Int +HYPRE_ILUSetIterativeSetupOption( HYPRE_Solver solver, HYPRE_Int iter_setup_option ); + +/** + * (Optional) Set the max. number of iterations for the iterative ILU algorithm. + * + * Note: Iterative ILU is available only for zero fill-in and it depends on rocSPARSE. + **/ +HYPRE_Int +HYPRE_ILUSetIterativeSetupMaxIter( HYPRE_Solver solver, HYPRE_Int iter_setup_max_iter ); + +/** + * (Optional) Set the stop tolerance for the iterative ILU algorithm. + * + * Note: Iterative ILU is available only for zero fill-in and it depends on rocSPARSE. + **/ +HYPRE_Int +HYPRE_ILUSetIterativeSetupTolerance( HYPRE_Solver solver, HYPRE_Real iter_setup_tolerance ); + +/** + * (Optional) Set triangular solver type. Options are: + * + * - 0 : iterative + * - 1 : direct (default) + **/ +HYPRE_Int +HYPRE_ILUSetTriSolve( HYPRE_Solver solver, HYPRE_Int tri_solve ); + +/** + * (Optional) Set number of lower Jacobi iterations for the triangular L solves + * Set this to integer > 0 when using iterative tri_solve (0). The default is 5 iterations. + **/ +HYPRE_Int +HYPRE_ILUSetLowerJacobiIters( HYPRE_Solver solver, HYPRE_Int lower_jacobi_iterations ); + +/** + * (Optional) Set number of upper Jacobi iterations for the triangular U solves + * Set this to integer > 0 when using iterative tri_solve (0). The default is 5 iterations. + **/ +HYPRE_Int +HYPRE_ILUSetUpperJacobiIters( HYPRE_Solver solver, HYPRE_Int upper_jacobi_iterations ); + +/** + * (Optional) Set the convergence tolerance for ILU. * Use tol = 0.0 if ILU is used as a preconditioner. The default is 1.e-7. **/ HYPRE_Int @@ -4098,7 +4743,7 @@ HYPRE_Int HYPRE_ILUSetDropThresholdArray( HYPRE_Solver solver, HYPRE_Real *threshold ); /** - * (Optional) Set the threshold for dropping in Newton–Schulz–Hotelling iteration (NHS-ILU). + * (Optional) Set the threshold for dropping in Newton–Schulz–Hotelling iteration (NSH-ILU). * Any entries less than this threshold are dropped when forming the approximate inverse matrix. * The default is 1.0e-2. **/ @@ -4107,7 +4752,7 @@ HYPRE_ILUSetNSHDropThreshold( HYPRE_Solver solver, HYPRE_Real threshold ); /** * (Optional) Set the array of thresholds for dropping in Newton–Schulz–Hotelling - * iteration (for NHS-ILU). Any fill-in less than thresholds is dropped when + * iteration (for NSH-ILU). Any fill-in less than thresholds is dropped when * forming the approximate inverse matrix. * * - threshold[0] : threshold for Minimal Residual iteration (initial guess for NSH). @@ -4284,62 +4929,62 @@ GenerateRSVarDifConv(MPI_Comm comm, HYPRE_Int type); float* -GenerateCoordinates(MPI_Comm comm, - HYPRE_BigInt nx, - HYPRE_BigInt ny, - HYPRE_BigInt nz, - HYPRE_Int P, - HYPRE_Int Q, - HYPRE_Int R, - HYPRE_Int p, - HYPRE_Int q, - HYPRE_Int r, - HYPRE_Int coorddim); +hypre_GenerateCoordinates(MPI_Comm comm, + HYPRE_BigInt nx, + HYPRE_BigInt ny, + HYPRE_BigInt nz, + HYPRE_Int P, + HYPRE_Int Q, + HYPRE_Int R, + HYPRE_Int p, + HYPRE_Int q, + HYPRE_Int r, + HYPRE_Int coorddim); /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -/* +/** * (Optional) Switches on use of Jacobi interpolation after computing * an original interpolation **/ HYPRE_Int HYPRE_BoomerAMGSetPostInterpType(HYPRE_Solver solver, HYPRE_Int post_interp_type); -/* +/** * (Optional) Sets a truncation threshold for Jacobi interpolation. **/ HYPRE_Int HYPRE_BoomerAMGSetJacobiTruncThreshold(HYPRE_Solver solver, HYPRE_Real jacobi_trunc_threshold); -/* +/** * (Optional) Defines the number of relaxation steps for CR * The default is 2. **/ HYPRE_Int HYPRE_BoomerAMGSetNumCRRelaxSteps(HYPRE_Solver solver, HYPRE_Int num_CR_relax_steps); -/* +/** * (Optional) Defines convergence rate for CR * The default is 0.7. **/ HYPRE_Int HYPRE_BoomerAMGSetCRRate(HYPRE_Solver solver, HYPRE_Real CR_rate); -/* +/** * (Optional) Defines strong threshold for CR * The default is 0.0. **/ HYPRE_Int HYPRE_BoomerAMGSetCRStrongTh(HYPRE_Solver solver, HYPRE_Real CR_strong_th); -/* +/** * (Optional) Defines whether to use CG **/ HYPRE_Int HYPRE_BoomerAMGSetCRUseCG(HYPRE_Solver solver, HYPRE_Int CR_use_CG); -/* +/** * (Optional) Defines the Type of independent set algorithm used for CR **/ HYPRE_Int HYPRE_BoomerAMGSetISType(HYPRE_Solver solver, diff --git a/external/hypre/src/parcsr_ls/HYPRE_parcsr_mgr.c b/external/hypre/src/parcsr_ls/HYPRE_parcsr_mgr.c index 1c80a0d8..4123a6f6 100644 --- a/external/hypre/src/parcsr_ls/HYPRE_parcsr_mgr.c +++ b/external/hypre/src/parcsr_ls/HYPRE_parcsr_mgr.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -16,7 +16,7 @@ HYPRE_MGRCreate( HYPRE_Solver *solver ) { if (!solver) { - hypre_error_in_arg(2); + hypre_error_in_arg(1); return hypre_error_flag; } *solver = ( (HYPRE_Solver) hypre_MGRCreate( ) ); @@ -30,7 +30,7 @@ HYPRE_MGRCreate( HYPRE_Solver *solver ) HYPRE_Int HYPRE_MGRDestroy( HYPRE_Solver solver ) { - return( hypre_MGRDestroy( (void *) solver ) ); + return ( hypre_MGRDestroy( (void *) solver ) ); } /*-------------------------------------------------------------------------- @@ -39,14 +39,20 @@ HYPRE_MGRDestroy( HYPRE_Solver solver ) HYPRE_Int HYPRE_MGRSetup( HYPRE_Solver solver, - HYPRE_ParCSRMatrix A, - HYPRE_ParVector b, - HYPRE_ParVector x ) + HYPRE_ParCSRMatrix A, + HYPRE_ParVector b, + HYPRE_ParVector x ) { - return( hypre_MGRSetup( (void *) solver, - (hypre_ParCSRMatrix *) A, - (hypre_ParVector *) b, - (hypre_ParVector *) x ) ); + if (!A) + { + hypre_error_in_arg(2); + return hypre_error_flag; + } + + return ( hypre_MGRSetup( (void *) solver, + (hypre_ParCSRMatrix *) A, + (hypre_ParVector *) b, + (hypre_ParVector *) x ) ); } /*-------------------------------------------------------------------------- @@ -55,14 +61,32 @@ HYPRE_MGRSetup( HYPRE_Solver solver, HYPRE_Int HYPRE_MGRSolve( HYPRE_Solver solver, - HYPRE_ParCSRMatrix A, - HYPRE_ParVector b, - HYPRE_ParVector x ) + HYPRE_ParCSRMatrix A, + HYPRE_ParVector b, + HYPRE_ParVector x ) { - return( hypre_MGRSolve( (void *) solver, - (hypre_ParCSRMatrix *) A, - (hypre_ParVector *) b, - (hypre_ParVector *) x ) ); + if (!A) + { + hypre_error_in_arg(2); + return hypre_error_flag; + } + + if (!b) + { + hypre_error_in_arg(3); + return hypre_error_flag; + } + + if (!x) + { + hypre_error_in_arg(4); + return hypre_error_flag; + } + + return ( hypre_MGRSolve( (void *) solver, + (hypre_ParCSRMatrix *) A, + (hypre_ParVector *) b, + (hypre_ParVector *) x ) ); } #ifdef HYPRE_USING_DSUPERLU @@ -75,12 +99,13 @@ HYPRE_MGRDirectSolverCreate( HYPRE_Solver *solver ) { if (!solver) { - hypre_error_in_arg(2); + hypre_error_in_arg(1); return hypre_error_flag; } *solver = ( (HYPRE_Solver) hypre_MGRDirectSolverCreate( ) ); return hypre_error_flag; } + /*-------------------------------------------------------------------------- * HYPRE_MGRDirectSolverDestroy *--------------------------------------------------------------------------*/ @@ -88,7 +113,7 @@ HYPRE_MGRDirectSolverCreate( HYPRE_Solver *solver ) HYPRE_Int HYPRE_MGRDirectSolverDestroy( HYPRE_Solver solver ) { - return( hypre_MGRDirectSolverDestroy( (void *) solver ) ); + return ( hypre_MGRDirectSolverDestroy( (void *) solver ) ); } /*-------------------------------------------------------------------------- @@ -97,30 +122,30 @@ HYPRE_MGRDirectSolverDestroy( HYPRE_Solver solver ) HYPRE_Int HYPRE_MGRDirectSolverSetup( HYPRE_Solver solver, - HYPRE_ParCSRMatrix A, - HYPRE_ParVector b, - HYPRE_ParVector x ) + HYPRE_ParCSRMatrix A, + HYPRE_ParVector b, + HYPRE_ParVector x ) { - return( hypre_MGRDirectSolverSetup( (void *) solver, - (hypre_ParCSRMatrix *) A, - (hypre_ParVector *) b, - (hypre_ParVector *) x ) ); + return ( hypre_MGRDirectSolverSetup( (void *) solver, + (hypre_ParCSRMatrix *) A, + (hypre_ParVector *) b, + (hypre_ParVector *) x ) ); } /*-------------------------------------------------------------------------- - * HYPRE_MGRSolve + * HYPRE_MGRDirectSolverSolve *--------------------------------------------------------------------------*/ HYPRE_Int HYPRE_MGRDirectSolverSolve( HYPRE_Solver solver, - HYPRE_ParCSRMatrix A, - HYPRE_ParVector b, - HYPRE_ParVector x ) + HYPRE_ParCSRMatrix A, + HYPRE_ParVector b, + HYPRE_ParVector x ) { - return( hypre_MGRDirectSolverSolve( (void *) solver, - (hypre_ParCSRMatrix *) A, - (hypre_ParVector *) b, - (hypre_ParVector *) x ) ); + return ( hypre_MGRDirectSolverSolve( (void *) solver, + (hypre_ParCSRMatrix *) A, + (hypre_ParVector *) b, + (hypre_ParVector *) x ) ); } #endif @@ -130,13 +155,14 @@ HYPRE_MGRDirectSolverSolve( HYPRE_Solver solver, HYPRE_Int HYPRE_MGRSetCpointsByContiguousBlock( HYPRE_Solver solver, - HYPRE_Int block_size, - HYPRE_Int max_num_levels, - HYPRE_BigInt *idx_array, - HYPRE_Int *block_num_coarse_points, - HYPRE_Int **block_coarse_indexes) + HYPRE_Int block_size, + HYPRE_Int max_num_levels, + HYPRE_BigInt *idx_array, + HYPRE_Int *block_num_coarse_points, + HYPRE_Int **block_coarse_indexes) { - return( hypre_MGRSetCpointsByContiguousBlock( (void *) solver, block_size, max_num_levels, idx_array, block_num_coarse_points, block_coarse_indexes)); + return ( hypre_MGRSetCpointsByContiguousBlock( (void *) solver, block_size, max_num_levels, + idx_array, block_num_coarse_points, block_coarse_indexes)); } /*-------------------------------------------------------------------------- @@ -145,12 +171,13 @@ HYPRE_MGRSetCpointsByContiguousBlock( HYPRE_Solver solver, HYPRE_Int HYPRE_MGRSetCpointsByBlock( HYPRE_Solver solver, - HYPRE_Int block_size, - HYPRE_Int max_num_levels, - HYPRE_Int *block_num_coarse_points, - HYPRE_Int **block_coarse_indexes) + HYPRE_Int block_size, + HYPRE_Int max_num_levels, + HYPRE_Int *block_num_coarse_points, + HYPRE_Int **block_coarse_indexes) { - return( hypre_MGRSetCpointsByBlock( (void *) solver, block_size, max_num_levels, block_num_coarse_points, block_coarse_indexes)); + return ( hypre_MGRSetCpointsByBlock( (void *) solver, block_size, max_num_levels, + block_num_coarse_points, block_coarse_indexes)); } /*-------------------------------------------------------------------------- @@ -159,13 +186,14 @@ HYPRE_MGRSetCpointsByBlock( HYPRE_Solver solver, HYPRE_Int HYPRE_MGRSetCpointsByPointMarkerArray( HYPRE_Solver solver, - HYPRE_Int block_size, - HYPRE_Int max_num_levels, - HYPRE_Int *num_block_coarse_points, - HYPRE_Int **lvl_block_coarse_indexes, - HYPRE_Int *point_marker_array) + HYPRE_Int block_size, + HYPRE_Int max_num_levels, + HYPRE_Int *num_block_coarse_points, + HYPRE_Int **lvl_block_coarse_indexes, + HYPRE_Int *point_marker_array) { - return( hypre_MGRSetCpointsByPointMarkerArray( (void *) solver, block_size, max_num_levels, num_block_coarse_points, lvl_block_coarse_indexes, point_marker_array)); + return ( hypre_MGRSetCpointsByPointMarkerArray( (void *) solver, block_size, max_num_levels, + num_block_coarse_points, lvl_block_coarse_indexes, point_marker_array)); } /*-------------------------------------------------------------------------- @@ -183,21 +211,63 @@ HYPRE_MGRSetNonCpointsToFpoints( HYPRE_Solver solver, HYPRE_Int nonCptToFptFlag) *--------------------------------------------------------------------------*/ HYPRE_Int -HYPRE_MGRSetFSolver(HYPRE_Solver solver, +HYPRE_MGRSetFSolver(HYPRE_Solver solver, HYPRE_PtrToParSolverFcn fine_grid_solver_solve, HYPRE_PtrToParSolverFcn fine_grid_solver_setup, - HYPRE_Solver fsolver ) + HYPRE_Solver fsolver ) { - return( hypre_MGRSetFSolver( (void *) solver, - (HYPRE_Int (*)(void*, void*, void*, void*)) fine_grid_solver_solve, - (HYPRE_Int (*)(void*, void*, void*, void*)) fine_grid_solver_setup, - (void *) fsolver ) ); + if (!solver) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + else if (!fsolver) + { + hypre_error_in_arg(4); + return hypre_error_flag; + } + + + return ( hypre_MGRSetFSolver( (void *) solver, + (HYPRE_Int (*)(void*, void*, void*, void*)) fine_grid_solver_solve, + (HYPRE_Int (*)(void*, void*, void*, void*)) fine_grid_solver_setup, + (void *) fsolver ) ); } -HYPRE_Int HYPRE_MGRBuildAff(HYPRE_ParCSRMatrix A, - HYPRE_Int *CF_marker, - HYPRE_Int debug_flag, - HYPRE_ParCSRMatrix *A_ff) +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetFSolverAtLevel + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetFSolverAtLevel(HYPRE_Solver solver, + HYPRE_Solver fsolver, + HYPRE_Int level ) +{ + if (!solver) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + else if (!fsolver) + { + hypre_error_in_arg(2); + return hypre_error_flag; + } + + return ( hypre_MGRSetFSolverAtLevel( (void *) solver, + (void *) fsolver, + level ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRBuildAff + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRBuildAff(HYPRE_ParCSRMatrix A, + HYPRE_Int *CF_marker, + HYPRE_Int debug_flag, + HYPRE_ParCSRMatrix *A_ff) { return (hypre_MGRBuildAff(A, CF_marker, debug_flag, A_ff)); } @@ -207,258 +277,709 @@ HYPRE_Int HYPRE_MGRBuildAff(HYPRE_ParCSRMatrix A, *--------------------------------------------------------------------------*/ HYPRE_Int -HYPRE_MGRSetCoarseSolver(HYPRE_Solver solver, - HYPRE_PtrToParSolverFcn coarse_grid_solver_solve, - HYPRE_PtrToParSolverFcn coarse_grid_solver_setup, - HYPRE_Solver coarse_grid_solver ) +HYPRE_MGRSetCoarseSolver(HYPRE_Solver solver, + HYPRE_PtrToParSolverFcn coarse_grid_solver_solve, + HYPRE_PtrToParSolverFcn coarse_grid_solver_setup, + HYPRE_Solver coarse_grid_solver ) { - return( hypre_MGRSetCoarseSolver( (void *) solver, - (HYPRE_Int (*)(void*, void*, void*, void*)) coarse_grid_solver_solve, - (HYPRE_Int (*)(void*, void*, void*, void*)) coarse_grid_solver_setup, - (void *) coarse_grid_solver ) ); + if (!solver) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + else if (!coarse_grid_solver) + { + hypre_error_in_arg(4); + return hypre_error_flag; + } + + return ( hypre_MGRSetCoarseSolver( (void *) solver, + (HYPRE_Int (*)(void*, void*, void*, void*)) coarse_grid_solver_solve, + (HYPRE_Int (*)(void*, void*, void*, void*)) coarse_grid_solver_setup, + (void *) coarse_grid_solver ) ); } /*-------------------------------------------------------------------------- - * HYPRE_MGRSetMaxLevels + * HYPRE_MGRSetMaxCoarseLevels *--------------------------------------------------------------------------*/ + HYPRE_Int -HYPRE_MGRSetMaxCoarseLevels( HYPRE_Solver solver, HYPRE_Int maxlev ) +HYPRE_MGRSetMaxCoarseLevels( HYPRE_Solver solver, + HYPRE_Int maxlev ) { + if (!solver) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + return hypre_MGRSetMaxCoarseLevels(solver, maxlev); } + /*-------------------------------------------------------------------------- * HYPRE_MGRSetBlockSize *--------------------------------------------------------------------------*/ + HYPRE_Int -HYPRE_MGRSetBlockSize( HYPRE_Solver solver, HYPRE_Int bsize ) +HYPRE_MGRSetBlockSize( HYPRE_Solver solver, + HYPRE_Int bsize ) { + if (!solver) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + return hypre_MGRSetBlockSize(solver, bsize ); } + /*-------------------------------------------------------------------------- * HYPRE_MGRSetReservedCoarseNodes *--------------------------------------------------------------------------*/ + HYPRE_Int -HYPRE_MGRSetReservedCoarseNodes( HYPRE_Solver solver, HYPRE_Int reserved_coarse_size, HYPRE_BigInt *reserved_coarse_indexes ) +HYPRE_MGRSetReservedCoarseNodes( HYPRE_Solver solver, + HYPRE_Int reserved_coarse_size, + HYPRE_BigInt *reserved_coarse_indices ) { - return hypre_MGRSetReservedCoarseNodes(solver, reserved_coarse_size, reserved_coarse_indexes ); + if (!solver) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + else if (reserved_coarse_size < 0) + { + hypre_error_in_arg(2); + return hypre_error_flag; + } + else if (!reserved_coarse_indices) + { + hypre_error_in_arg(3); + return hypre_error_flag; + } + + return hypre_MGRSetReservedCoarseNodes(solver, reserved_coarse_size, reserved_coarse_indices); } /*-------------------------------------------------------------------------- * HYPRE_MGRSetReservedCpointsLevelToKeep *--------------------------------------------------------------------------*/ + HYPRE_Int -HYPRE_MGRSetReservedCpointsLevelToKeep( HYPRE_Solver solver, HYPRE_Int level) +HYPRE_MGRSetReservedCpointsLevelToKeep( HYPRE_Solver solver, + HYPRE_Int level) { + if (!solver) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + return hypre_MGRSetReservedCpointsLevelToKeep((void *) solver, level); } /*-------------------------------------------------------------------------- * HYPRE_MGRSetRestrictType *--------------------------------------------------------------------------*/ + HYPRE_Int -HYPRE_MGRSetRestrictType(HYPRE_Solver solver, HYPRE_Int restrict_type ) +HYPRE_MGRSetRestrictType(HYPRE_Solver solver, + HYPRE_Int restrict_type ) { + if (!solver) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + return hypre_MGRSetRestrictType(solver, restrict_type ); } +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetLevelRestrictType + *--------------------------------------------------------------------------*/ + HYPRE_Int -HYPRE_MGRSetLevelRestrictType( HYPRE_Solver solver, HYPRE_Int *restrict_type ) +HYPRE_MGRSetLevelRestrictType( HYPRE_Solver solver, + HYPRE_Int *restrict_type ) { + if (!solver) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + return hypre_MGRSetLevelRestrictType( solver, restrict_type ); } /*-------------------------------------------------------------------------- - * HYPRE_MGRSetRelaxMethod + * HYPRE_MGRSetFRelaxMethod *--------------------------------------------------------------------------*/ + HYPRE_Int -HYPRE_MGRSetFRelaxMethod(HYPRE_Solver solver, HYPRE_Int relax_method ) +HYPRE_MGRSetFRelaxMethod( HYPRE_Solver solver, + HYPRE_Int relax_method ) { + if (!solver) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + return hypre_MGRSetFRelaxMethod(solver, relax_method ); } +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetLevelFRelaxMethod + *--------------------------------------------------------------------------*/ + HYPRE_Int -HYPRE_MGRSetLevelFRelaxMethod( HYPRE_Solver solver, HYPRE_Int *relax_method ) +HYPRE_MGRSetLevelFRelaxMethod( HYPRE_Solver solver, + HYPRE_Int *relax_method ) { + if (!solver) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + return hypre_MGRSetLevelFRelaxMethod( solver, relax_method ); } +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetLevelFRelaxType + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetLevelFRelaxType( HYPRE_Solver solver, + HYPRE_Int *relax_type ) +{ + if (!solver) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + return hypre_MGRSetLevelFRelaxType( solver, relax_type ); +} + /*-------------------------------------------------------------------------- * HYPRE_MGRSetCoarseGridMethod *--------------------------------------------------------------------------*/ + HYPRE_Int HYPRE_MGRSetCoarseGridMethod( HYPRE_Solver solver, HYPRE_Int *cg_method ) { + if (!solver) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + return hypre_MGRSetCoarseGridMethod( solver, cg_method ); } /*-------------------------------------------------------------------------- - * HYPRE_MGRSetRelaxNumFunctions + * HYPRE_MGRSetNonGalerkinMaxElmts + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetNonGalerkinMaxElmts( HYPRE_Solver solver, HYPRE_Int max_elmts ) +{ + return hypre_MGRSetNonGalerkinMaxElmts( solver, max_elmts ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetLevelNonGalerkinMaxElmts *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetLevelNonGalerkinMaxElmts( HYPRE_Solver solver, HYPRE_Int *max_elmts ) +{ + return hypre_MGRSetLevelNonGalerkinMaxElmts( solver, max_elmts ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetLevelFRelaxNumFunctions + *--------------------------------------------------------------------------*/ + HYPRE_Int -HYPRE_MGRSetLevelFRelaxNumFunctions( HYPRE_Solver solver, HYPRE_Int *num_functions ) +HYPRE_MGRSetLevelFRelaxNumFunctions( HYPRE_Solver solver, + HYPRE_Int *num_functions ) { + if (!solver) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + return hypre_MGRSetLevelFRelaxNumFunctions( solver, num_functions ); } /*-------------------------------------------------------------------------- * HYPRE_MGRSetRelaxType *--------------------------------------------------------------------------*/ + HYPRE_Int -HYPRE_MGRSetRelaxType(HYPRE_Solver solver, HYPRE_Int relax_type ) +HYPRE_MGRSetRelaxType( HYPRE_Solver solver, + HYPRE_Int relax_type ) { + if (!solver) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + return hypre_MGRSetRelaxType(solver, relax_type ); } + /*-------------------------------------------------------------------------- * HYPRE_MGRSetNumRelaxSweeps *--------------------------------------------------------------------------*/ + HYPRE_Int -HYPRE_MGRSetNumRelaxSweeps( HYPRE_Solver solver, HYPRE_Int nsweeps ) +HYPRE_MGRSetNumRelaxSweeps( HYPRE_Solver solver, + HYPRE_Int nsweeps ) { + if (!solver) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + return hypre_MGRSetNumRelaxSweeps(solver, nsweeps); } + +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetLevelNumRelaxSweeps + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetLevelNumRelaxSweeps( HYPRE_Solver solver, + HYPRE_Int *nsweeps ) +{ + if (!solver) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + return hypre_MGRSetLevelNumRelaxSweeps(solver, nsweeps); +} + /*-------------------------------------------------------------------------- * HYPRE_MGRSetInterpType *--------------------------------------------------------------------------*/ + HYPRE_Int -HYPRE_MGRSetInterpType( HYPRE_Solver solver, HYPRE_Int interpType ) +HYPRE_MGRSetInterpType( HYPRE_Solver solver, + HYPRE_Int interpType ) { + if (!solver) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + return hypre_MGRSetInterpType(solver, interpType); } +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetLevelInterpType + *--------------------------------------------------------------------------*/ + HYPRE_Int -HYPRE_MGRSetLevelInterpType( HYPRE_Solver solver, HYPRE_Int *interpType ) +HYPRE_MGRSetLevelInterpType( HYPRE_Solver solver, + HYPRE_Int *interpType ) { + if (!solver) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + return hypre_MGRSetLevelInterpType(solver, interpType); } /*-------------------------------------------------------------------------- * HYPRE_MGRSetNumInterpSweeps *--------------------------------------------------------------------------*/ + HYPRE_Int -HYPRE_MGRSetNumInterpSweeps( HYPRE_Solver solver, HYPRE_Int nsweeps ) +HYPRE_MGRSetNumInterpSweeps( HYPRE_Solver solver, + HYPRE_Int nsweeps ) { + if (!solver) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + return hypre_MGRSetNumInterpSweeps(solver, nsweeps); } /*-------------------------------------------------------------------------- * HYPRE_MGRSetNumRestrictSweeps *--------------------------------------------------------------------------*/ + HYPRE_Int -HYPRE_MGRSetNumRestrictSweeps( HYPRE_Solver solver, HYPRE_Int nsweeps ) +HYPRE_MGRSetNumRestrictSweeps( HYPRE_Solver solver, + HYPRE_Int nsweeps ) { + if (!solver) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + return hypre_MGRSetNumRestrictSweeps(solver, nsweeps); } /*-------------------------------------------------------------------------- * HYPRE_MGRSetTruncateCoarseGridThreshold *--------------------------------------------------------------------------*/ + HYPRE_Int -HYPRE_MGRSetTruncateCoarseGridThreshold( HYPRE_Solver solver, HYPRE_Real threshold) +HYPRE_MGRSetTruncateCoarseGridThreshold( HYPRE_Solver solver, + HYPRE_Real threshold) { + if (!solver) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + return hypre_MGRSetTruncateCoarseGridThreshold( solver, threshold ); } +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetBlockJacobiBlockSize + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetBlockJacobiBlockSize( HYPRE_Solver solver, + HYPRE_Int blk_size ) +{ + if (!solver) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + else if (blk_size < 1) + { + hypre_error_in_arg(2); + return hypre_error_flag; + } + + return hypre_MGRSetBlockJacobiBlockSize(solver, blk_size); +} + /*-------------------------------------------------------------------------- * HYPRE_MGRSetFrelaxPrintLevel *--------------------------------------------------------------------------*/ + HYPRE_Int -HYPRE_MGRSetFrelaxPrintLevel( HYPRE_Solver solver, HYPRE_Int print_level ) +HYPRE_MGRSetFrelaxPrintLevel( HYPRE_Solver solver, + HYPRE_Int print_level ) { + if (!solver) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + return hypre_MGRSetFrelaxPrintLevel( solver, print_level ); } /*-------------------------------------------------------------------------- * HYPRE_MGRSetCoarseGridPrintLevel *--------------------------------------------------------------------------*/ + HYPRE_Int -HYPRE_MGRSetCoarseGridPrintLevel( HYPRE_Solver solver, HYPRE_Int print_level ) +HYPRE_MGRSetCoarseGridPrintLevel( HYPRE_Solver solver, + HYPRE_Int print_level ) { + if (!solver) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + return hypre_MGRSetCoarseGridPrintLevel( solver, print_level ); } /*-------------------------------------------------------------------------- * HYPRE_MGRSetPrintLevel *--------------------------------------------------------------------------*/ + HYPRE_Int -HYPRE_MGRSetPrintLevel( HYPRE_Solver solver, HYPRE_Int print_level ) +HYPRE_MGRSetPrintLevel( HYPRE_Solver solver, + HYPRE_Int print_level ) { + if (!solver) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + return hypre_MGRSetPrintLevel( solver, print_level ); } /*-------------------------------------------------------------------------- * HYPRE_MGRSetLogging *--------------------------------------------------------------------------*/ + HYPRE_Int -HYPRE_MGRSetLogging( HYPRE_Solver solver, HYPRE_Int logging ) +HYPRE_MGRSetLogging( HYPRE_Solver solver, + HYPRE_Int logging ) { + if (!solver) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + return hypre_MGRSetLogging(solver, logging ); } + /*-------------------------------------------------------------------------- * HYPRE_MGRSetMaxIter *--------------------------------------------------------------------------*/ + HYPRE_Int -HYPRE_MGRSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ) +HYPRE_MGRSetMaxIter( HYPRE_Solver solver, + HYPRE_Int max_iter ) { + if (!solver) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + else if (max_iter < 0) + { + hypre_error_in_arg(2); + return hypre_error_flag; + } + return hypre_MGRSetMaxIter( solver, max_iter ); } + /*-------------------------------------------------------------------------- * HYPRE_MGRSetTol *--------------------------------------------------------------------------*/ + HYPRE_Int -HYPRE_MGRSetTol( HYPRE_Solver solver, HYPRE_Real tol ) +HYPRE_MGRSetTol( HYPRE_Solver solver, + HYPRE_Real tol ) { + if (!solver) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + else if (tol < 0.0) + { + hypre_error_in_arg(2); + return hypre_error_flag; + } + return hypre_MGRSetTol( solver, tol ); } + /*-------------------------------------------------------------------------- * HYPRE_MGRSetMaxGlobalsmoothIters *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetMaxGlobalSmoothIters( HYPRE_Solver solver, + HYPRE_Int max_iter ) +{ + if (!solver) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + else if (max_iter < 0) + { + hypre_error_in_arg(2); + return hypre_error_flag; + } + + return hypre_MGRSetMaxGlobalSmoothIters(solver, max_iter); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetLevelsmoothIters + *--------------------------------------------------------------------------*/ + HYPRE_Int -HYPRE_MGRSetMaxGlobalsmoothIters( HYPRE_Solver solver, HYPRE_Int max_iter ) +HYPRE_MGRSetLevelSmoothIters( HYPRE_Solver solver, + HYPRE_Int *smooth_iters ) { - return hypre_MGRSetMaxGlobalsmoothIters(solver, max_iter); + if (!solver) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + return hypre_MGRSetLevelSmoothIters(solver, smooth_iters); } + /*-------------------------------------------------------------------------- * HYPRE_MGRSetGlobalsmoothType *--------------------------------------------------------------------------*/ HYPRE_Int -HYPRE_MGRSetGlobalsmoothType( HYPRE_Solver solver, HYPRE_Int iter_type ) +HYPRE_MGRSetGlobalSmoothType( HYPRE_Solver solver, + HYPRE_Int smooth_type ) +{ + if (!solver) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + return hypre_MGRSetGlobalSmoothType(solver, smooth_type); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetLevelsmoothType + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetLevelSmoothType( HYPRE_Solver solver, + HYPRE_Int *smooth_type ) +{ + if (!solver) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + return hypre_MGRSetLevelSmoothType(solver, smooth_type); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetGlobalSmoothCycle + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetGlobalSmoothCycle( HYPRE_Solver solver, + HYPRE_Int global_smooth_cycle ) +{ + if (!solver) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + return hypre_MGRSetGlobalSmoothCycle(solver, global_smooth_cycle); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetGlobalSmootherAtLevel + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetGlobalSmootherAtLevel( HYPRE_Solver solver, + HYPRE_Solver smoother, + HYPRE_Int level ) +{ + if (!solver) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + else if (!smoother) + { + hypre_error_in_arg(2); + return hypre_error_flag; + } + + return hypre_MGRSetGlobalSmootherAtLevel((void*) solver, smoother, level); +} + +/*-------------------------------------------------------------------------- + * HYPRE_MGRSetPMaxElmts + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetPMaxElmts( HYPRE_Solver solver, + HYPRE_Int P_max_elmts ) { - return hypre_MGRSetGlobalsmoothType(solver, iter_type); + if (!solver) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + return hypre_MGRSetPMaxElmts(solver, P_max_elmts); } /*-------------------------------------------------------------------------- - * HYPRE_MGRSetMaxPElmts + * HYPRE_MGRSetLevelPMaxElmts *--------------------------------------------------------------------------*/ + HYPRE_Int -HYPRE_MGRSetPMaxElmts( HYPRE_Solver solver, HYPRE_Int P_max_elmts ) +HYPRE_MGRSetLevelPMaxElmts( HYPRE_Solver solver, + HYPRE_Int *P_max_elmts ) { - return hypre_MGRSetPMaxElmts(solver, P_max_elmts); + if (!solver) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + return hypre_MGRSetLevelPMaxElmts(solver, P_max_elmts); } /*-------------------------------------------------------------------------- * HYPRE_MGRGetCoarseGridConvergenceFactor *--------------------------------------------------------------------------*/ + HYPRE_Int -HYPRE_MGRGetCoarseGridConvergenceFactor( HYPRE_Solver solver, HYPRE_Real *conv_factor ) +HYPRE_MGRGetCoarseGridConvergenceFactor( HYPRE_Solver solver, + HYPRE_Real *conv_factor ) { + if (!solver) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + return hypre_MGRGetCoarseGridConvergenceFactor( solver, conv_factor ); } - /*-------------------------------------------------------------------------- * HYPRE_MGRGetNumIterations *--------------------------------------------------------------------------*/ + HYPRE_Int -HYPRE_MGRGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ) +HYPRE_MGRGetNumIterations( HYPRE_Solver solver, + HYPRE_Int *num_iterations ) { + if (!solver) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + return hypre_MGRGetNumIterations( solver, num_iterations ); } + /*-------------------------------------------------------------------------- * HYPRE_MGRGetFinalRelativeResidualNorm *--------------------------------------------------------------------------*/ + HYPRE_Int -HYPRE_MGRGetFinalRelativeResidualNorm( HYPRE_Solver solver, HYPRE_Real *res_norm ) +HYPRE_MGRGetFinalRelativeResidualNorm( HYPRE_Solver solver, + HYPRE_Real *res_norm ) { + if (!solver) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + return hypre_MGRGetFinalRelativeResidualNorm(solver, res_norm); } diff --git a/external/hypre/src/parcsr_ls/HYPRE_parcsr_pcg.c b/external/hypre/src/parcsr_ls/HYPRE_parcsr_pcg.c index ff7aae64..33554980 100644 --- a/external/hypre/src/parcsr_ls/HYPRE_parcsr_pcg.c +++ b/external/hypre/src/parcsr_ls/HYPRE_parcsr_pcg.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -14,6 +14,8 @@ HYPRE_Int HYPRE_ParCSRPCGCreate( MPI_Comm comm, HYPRE_Solver *solver ) { + HYPRE_UNUSED_VAR(comm); + hypre_PCGFunctions * pcg_functions; if (!solver) @@ -43,7 +45,7 @@ HYPRE_ParCSRPCGCreate( MPI_Comm comm, HYPRE_Solver *solver ) HYPRE_Int HYPRE_ParCSRPCGDestroy( HYPRE_Solver solver ) { - return( hypre_PCGDestroy( (void *) solver ) ); + return ( hypre_PCGDestroy( (void *) solver ) ); } /*-------------------------------------------------------------------------- @@ -56,10 +58,10 @@ HYPRE_ParCSRPCGSetup( HYPRE_Solver solver, HYPRE_ParVector b, HYPRE_ParVector x ) { - return( HYPRE_PCGSetup( solver, - (HYPRE_Matrix) A, - (HYPRE_Vector) b, - (HYPRE_Vector) x ) ); + return ( HYPRE_PCGSetup( solver, + (HYPRE_Matrix) A, + (HYPRE_Vector) b, + (HYPRE_Vector) x ) ); } /*-------------------------------------------------------------------------- @@ -72,10 +74,10 @@ HYPRE_ParCSRPCGSolve( HYPRE_Solver solver, HYPRE_ParVector b, HYPRE_ParVector x ) { - return( HYPRE_PCGSolve( solver, - (HYPRE_Matrix) A, - (HYPRE_Vector) b, - (HYPRE_Vector) x ) ); + return ( HYPRE_PCGSolve( solver, + (HYPRE_Matrix) A, + (HYPRE_Vector) b, + (HYPRE_Vector) x ) ); } /*-------------------------------------------------------------------------- @@ -86,7 +88,7 @@ HYPRE_Int HYPRE_ParCSRPCGSetTol( HYPRE_Solver solver, HYPRE_Real tol ) { - return( HYPRE_PCGSetTol( solver, tol ) ); + return ( HYPRE_PCGSetTol( solver, tol ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRPCGSetAbsoluteTol @@ -96,7 +98,7 @@ HYPRE_Int HYPRE_ParCSRPCGSetAbsoluteTol( HYPRE_Solver solver, HYPRE_Real a_tol ) { - return( HYPRE_PCGSetAbsoluteTol( solver, a_tol ) ); + return ( HYPRE_PCGSetAbsoluteTol( solver, a_tol ) ); } /*-------------------------------------------------------------------------- @@ -107,7 +109,7 @@ HYPRE_Int HYPRE_ParCSRPCGSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ) { - return( HYPRE_PCGSetMaxIter( solver, max_iter ) ); + return ( HYPRE_PCGSetMaxIter( solver, max_iter ) ); } /*-------------------------------------------------------------------------- @@ -118,7 +120,7 @@ HYPRE_Int HYPRE_ParCSRPCGSetStopCrit( HYPRE_Solver solver, HYPRE_Int stop_crit ) { - return( HYPRE_PCGSetStopCrit( solver, stop_crit ) ); + return ( HYPRE_PCGSetStopCrit( solver, stop_crit ) ); } /*-------------------------------------------------------------------------- @@ -129,7 +131,7 @@ HYPRE_Int HYPRE_ParCSRPCGSetTwoNorm( HYPRE_Solver solver, HYPRE_Int two_norm ) { - return( HYPRE_PCGSetTwoNorm( solver, two_norm ) ); + return ( HYPRE_PCGSetTwoNorm( solver, two_norm ) ); } /*-------------------------------------------------------------------------- @@ -140,7 +142,7 @@ HYPRE_Int HYPRE_ParCSRPCGSetRelChange( HYPRE_Solver solver, HYPRE_Int rel_change ) { - return( HYPRE_PCGSetRelChange( solver, rel_change ) ); + return ( HYPRE_PCGSetRelChange( solver, rel_change ) ); } /*-------------------------------------------------------------------------- @@ -148,15 +150,26 @@ HYPRE_ParCSRPCGSetRelChange( HYPRE_Solver solver, *--------------------------------------------------------------------------*/ HYPRE_Int -HYPRE_ParCSRPCGSetPrecond( HYPRE_Solver solver, +HYPRE_ParCSRPCGSetPrecond( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, - HYPRE_Solver precond_solver ) + HYPRE_Solver precond_solver ) { - return( HYPRE_PCGSetPrecond( solver, - (HYPRE_PtrToSolverFcn) precond, - (HYPRE_PtrToSolverFcn) precond_setup, - precond_solver ) ); + return ( HYPRE_PCGSetPrecond( solver, + (HYPRE_PtrToSolverFcn) precond, + (HYPRE_PtrToSolverFcn) precond_setup, + precond_solver ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_ParCSRPCGSetPreconditioner + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPCGSetPreconditioner( HYPRE_Solver solver, + HYPRE_Solver precond ) +{ + return ( HYPRE_PCGSetPreconditioner( solver, precond ) ); } /*-------------------------------------------------------------------------- @@ -167,7 +180,7 @@ HYPRE_Int HYPRE_ParCSRPCGGetPrecond( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ) { - return( HYPRE_PCGGetPrecond( solver, precond_data_ptr ) ); + return ( HYPRE_PCGGetPrecond( solver, precond_data_ptr ) ); } /*-------------------------------------------------------------------------- @@ -179,7 +192,7 @@ HYPRE_Int HYPRE_ParCSRPCGSetPrintLevel( HYPRE_Solver solver, HYPRE_Int level ) { - return( HYPRE_PCGSetPrintLevel( solver, level ) ); + return ( HYPRE_PCGSetPrintLevel( solver, level ) ); } /*-------------------------------------------------------------------------- @@ -191,7 +204,7 @@ HYPRE_Int HYPRE_ParCSRPCGSetLogging( HYPRE_Solver solver, HYPRE_Int level ) { - return( HYPRE_PCGSetLogging( solver, level ) ); + return ( HYPRE_PCGSetLogging( solver, level ) ); } /*-------------------------------------------------------------------------- @@ -202,7 +215,7 @@ HYPRE_Int HYPRE_ParCSRPCGGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ) { - return( HYPRE_PCGGetNumIterations( solver, num_iterations ) ); + return ( HYPRE_PCGGetNumIterations( solver, num_iterations ) ); } /*-------------------------------------------------------------------------- @@ -213,7 +226,7 @@ HYPRE_Int HYPRE_ParCSRPCGGetFinalRelativeResidualNorm( HYPRE_Solver solver, HYPRE_Real *norm ) { - return( HYPRE_PCGGetFinalRelativeResidualNorm( solver, norm ) ); + return ( HYPRE_PCGGetFinalRelativeResidualNorm( solver, norm ) ); } @@ -223,9 +236,9 @@ HYPRE_ParCSRPCGGetFinalRelativeResidualNorm( HYPRE_Solver solver, HYPRE_Int HYPRE_ParCSRPCGGetResidual( HYPRE_Solver solver, - HYPRE_ParVector *residual ) + HYPRE_ParVector *residual ) { - return( HYPRE_PCGGetResidual( solver, (void *) residual ) ); + return ( HYPRE_PCGGetResidual( solver, (void *) residual ) ); } /*-------------------------------------------------------------------------- @@ -238,7 +251,12 @@ HYPRE_ParCSRDiagScaleSetup( HYPRE_Solver solver, HYPRE_ParVector y, HYPRE_ParVector x ) { - return 0; + HYPRE_UNUSED_VAR(solver); + HYPRE_UNUSED_VAR(A); + HYPRE_UNUSED_VAR(y); + HYPRE_UNUSED_VAR(x); + + return hypre_error_flag; } /*-------------------------------------------------------------------------- @@ -251,49 +269,9 @@ HYPRE_ParCSRDiagScale( HYPRE_Solver solver, HYPRE_ParVector Hy, HYPRE_ParVector Hx ) { - return hypre_ParCSRDiagScale(HA, Hy, Hx); -} + HYPRE_UNUSED_VAR(solver); -/*-------------------------------------------------------------------------- - * HYPRE_ParCSRSymPrecondSetup - *--------------------------------------------------------------------------*/ - -/* - -HYPRE_Int -HYPRE_ParCSRSymPrecondSetup( HYPRE_Solver solver, - HYPRE_ParCSRMatrix A, - HYPRE_ParVector b, - HYPRE_ParVector x ) -{ - hypre_ParCSRMatrix *A = (hypre_ParCSRMatrix *) A; - hypre_ParVector *y = (hypre_ParVector *) b; - hypre_ParVector *x = (hypre_ParVector *) x; - - HYPRE_Real *x_data = hypre_VectorData(hypre_ParVectorLocalVector(x)); - HYPRE_Real *y_data = hypre_VectorData(hypre_ParVectorLocalVector(y)); - HYPRE_Real *A_diag = hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(A)); - HYPRE_Real *A_offd = hypre_CSRMatrixData(hypre_ParCSRMatrixOffD(A)); - - HYPRE_Int i, ierr = 0; - hypre_ParCSRMatrix *Asym; - MPI_Comm comm; - HYPRE_Int global_num_rows; - HYPRE_Int global_num_cols; - HYPRE_Int *row_starts; - HYPRE_Int *col_starts; - HYPRE_Int num_cols_offd; - HYPRE_Int num_nonzeros_diag; - HYPRE_Int num_nonzeros_offd; - - Asym = hypre_ParCSRMatrixCreate(comm, global_num_rows, global_num_cols, - row_starts, col_starts, num_cols_offd, - num_nonzeros_diag, num_nonzeros_offd); - - for (i=0; i < hypre_VectorSize(hypre_ParVectorLocalVector(x)); i++) - { - x_data[i] = y_data[i]/A_data[A_i[i]]; - } - - return ierr; -} */ + return hypre_ParCSRDiagScaleVector((hypre_ParCSRMatrix *) HA, + (hypre_ParVector *) Hy, + (hypre_ParVector *) Hx); +} diff --git a/external/hypre/src/parcsr_ls/HYPRE_parcsr_pilut.c b/external/hypre/src/parcsr_ls/HYPRE_parcsr_pilut.c index c38bf70e..06416b10 100644 --- a/external/hypre/src/parcsr_ls/HYPRE_parcsr_pilut.c +++ b/external/hypre/src/parcsr_ls/HYPRE_parcsr_pilut.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -38,18 +38,21 @@ * HYPRE_ParCSRPilutCreate *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_ParCSRPilutCreate( MPI_Comm comm, HYPRE_Solver *solver ) { #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Pilut cannot be used in mixedint mode!"); + HYPRE_UNUSED_VAR(solver); + HYPRE_UNUSED_VAR(comm); + + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Pilut cannot be used in mixedint mode!"); return hypre_error_flag; #else - HYPRE_NewDistributedMatrixPilutSolver( comm, NULL, - (HYPRE_DistributedMatrixPilutSolver *) solver); + HYPRE_NewDistributedMatrixPilutSolver( comm, NULL, + (HYPRE_DistributedMatrixPilutSolver *) solver); - HYPRE_DistributedMatrixPilutSolverInitialize( + HYPRE_DistributedMatrixPilutSolverInitialize( (HYPRE_DistributedMatrixPilutSolver) solver ); return hypre_error_flag; @@ -60,17 +63,19 @@ HYPRE_ParCSRPilutCreate( MPI_Comm comm, HYPRE_Solver *solver ) * HYPRE_ParCSRPilutDestroy *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_ParCSRPilutDestroy( HYPRE_Solver solver ) { #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Pilut cannot be used in mixedint mode!"); + HYPRE_UNUSED_VAR(solver); + + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Pilut cannot be used in mixedint mode!"); return hypre_error_flag; #else HYPRE_DistributedMatrix mat = HYPRE_DistributedMatrixPilutSolverGetMatrix( - (HYPRE_DistributedMatrixPilutSolver) solver ); - if ( mat ) HYPRE_DistributedMatrixDestroy( mat ); + (HYPRE_DistributedMatrixPilutSolver) solver ); + if ( mat ) { HYPRE_DistributedMatrixDestroy( mat ); } HYPRE_FreeDistributedMatrixPilutSolver( (HYPRE_DistributedMatrixPilutSolver) solver ); @@ -83,23 +88,29 @@ HYPRE_ParCSRPilutDestroy( HYPRE_Solver solver ) * HYPRE_ParCSRPilutSetup *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_ParCSRPilutSetup( HYPRE_Solver solver, - HYPRE_ParCSRMatrix A, - HYPRE_ParVector b, - HYPRE_ParVector x ) + HYPRE_ParCSRMatrix A, + HYPRE_ParVector b, + HYPRE_ParVector x ) { + HYPRE_UNUSED_VAR(b); + HYPRE_UNUSED_VAR(x); + #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Pilut cannot be used in mixedint mode!"); + HYPRE_UNUSED_VAR(solver); + HYPRE_UNUSED_VAR(A); + + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Pilut cannot be used in mixedint mode!"); return hypre_error_flag; #else HYPRE_DistributedMatrix matrix; - HYPRE_DistributedMatrixPilutSolver distributed_solver = + HYPRE_DistributedMatrixPilutSolver distributed_solver = (HYPRE_DistributedMatrixPilutSolver) solver; HYPRE_ConvertParCSRMatrixToDistributedMatrix( - A, &matrix ); + A, &matrix ); HYPRE_DistributedMatrixPilutSolverSetMatrix( distributed_solver, matrix ); @@ -113,14 +124,20 @@ HYPRE_ParCSRPilutSetup( HYPRE_Solver solver, * HYPRE_ParCSRPilutSolve *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_ParCSRPilutSolve( HYPRE_Solver solver, - HYPRE_ParCSRMatrix A, - HYPRE_ParVector b, - HYPRE_ParVector x ) + HYPRE_ParCSRMatrix A, + HYPRE_ParVector b, + HYPRE_ParVector x ) { + HYPRE_UNUSED_VAR(A); + #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Pilut cannot be used in mixedint mode!"); + HYPRE_UNUSED_VAR(b); + HYPRE_UNUSED_VAR(x); + HYPRE_UNUSED_VAR(solver); + + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Pilut cannot be used in mixedint mode!"); return hypre_error_flag; #else @@ -143,14 +160,16 @@ HYPRE_ParCSRPilutSolve( HYPRE_Solver solver, HYPRE_Int HYPRE_ParCSRPilutSetMaxIter( HYPRE_Solver solver, - HYPRE_Int max_iter ) + HYPRE_Int max_iter ) { #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Pilut cannot be used in mixedint mode!"); + HYPRE_UNUSED_VAR(solver); + HYPRE_UNUSED_VAR(max_iter); + + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Pilut cannot be used in mixedint mode!"); return hypre_error_flag; #else - HYPRE_DistributedMatrixPilutSolverSetMaxIts( (HYPRE_DistributedMatrixPilutSolver) solver, max_iter ); @@ -164,10 +183,13 @@ HYPRE_ParCSRPilutSetMaxIter( HYPRE_Solver solver, HYPRE_Int HYPRE_ParCSRPilutSetDropTolerance( HYPRE_Solver solver, - HYPRE_Real tol ) + HYPRE_Real tol ) { #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Pilut cannot be used in mixedint mode!"); + HYPRE_UNUSED_VAR(solver); + HYPRE_UNUSED_VAR(tol); + + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Pilut cannot be used in mixedint mode!"); return hypre_error_flag; #else @@ -184,10 +206,13 @@ HYPRE_ParCSRPilutSetDropTolerance( HYPRE_Solver solver, HYPRE_Int HYPRE_ParCSRPilutSetFactorRowSize( HYPRE_Solver solver, - HYPRE_Int size ) + HYPRE_Int size ) { #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Pilut cannot be used in mixedint mode!"); + HYPRE_UNUSED_VAR(solver); + HYPRE_UNUSED_VAR(size); + + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Pilut cannot be used in mixedint mode!"); return hypre_error_flag; #else @@ -203,7 +228,10 @@ HYPRE_ParCSRPilutSetLogging( HYPRE_Solver solver, HYPRE_Int logging ) { #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Pilut cannot be used in mixedint mode!"); + HYPRE_UNUSED_VAR(solver); + HYPRE_UNUSED_VAR(logging); + + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Pilut cannot be used in mixedint mode!"); return hypre_error_flag; #else @@ -213,4 +241,3 @@ HYPRE_ParCSRPilutSetLogging( HYPRE_Solver solver, return hypre_error_flag; #endif } - diff --git a/external/hypre/src/parcsr_ls/HYPRE_parcsr_schwarz.c b/external/hypre/src/parcsr_ls/HYPRE_parcsr_schwarz.c index 45ef7c6d..64a6fb52 100644 --- a/external/hypre/src/parcsr_ls/HYPRE_parcsr_schwarz.c +++ b/external/hypre/src/parcsr_ls/HYPRE_parcsr_schwarz.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -27,33 +27,33 @@ HYPRE_SchwarzCreate( HYPRE_Solver *solver) * HYPRE_SchwarzDestroy *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_SchwarzDestroy( HYPRE_Solver solver ) { - return( hypre_SchwarzDestroy( (void *) solver ) ); + return ( hypre_SchwarzDestroy( (void *) solver ) ); } /*-------------------------------------------------------------------------- * HYPRE_SchwarzSetup *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_SchwarzSetup(HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) { - return( hypre_SchwarzSetup( (void *) solver, - (hypre_ParCSRMatrix *) A, - (hypre_ParVector *) b, - (hypre_ParVector *) x ) ); + return ( hypre_SchwarzSetup( (void *) solver, + (hypre_ParCSRMatrix *) A, + (hypre_ParVector *) b, + (hypre_ParVector *) x ) ); } /*-------------------------------------------------------------------------- * HYPRE_SchwarzSolve *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_SchwarzSolve( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, @@ -61,10 +61,10 @@ HYPRE_SchwarzSolve( HYPRE_Solver solver, { - return( hypre_SchwarzSolve( (void *) solver, - (hypre_ParCSRMatrix *) A, - (hypre_ParVector *) b, - (hypre_ParVector *) x ) ); + return ( hypre_SchwarzSolve( (void *) solver, + (hypre_ParCSRMatrix *) A, + (hypre_ParVector *) b, + (hypre_ParVector *) x ) ); } /*-------------------------------------------------------------------------- @@ -75,7 +75,7 @@ HYPRE_Int HYPRE_SchwarzSetVariant( HYPRE_Solver solver, HYPRE_Int variant ) { - return( hypre_SchwarzSetVariant( (void *) solver, variant ) ); + return ( hypre_SchwarzSetVariant( (void *) solver, variant ) ); } /*-------------------------------------------------------------------------- @@ -85,7 +85,7 @@ HYPRE_SchwarzSetVariant( HYPRE_Solver solver, HYPRE_Int HYPRE_SchwarzSetOverlap( HYPRE_Solver solver, HYPRE_Int overlap) { - return( hypre_SchwarzSetOverlap( (void *) solver, overlap ) ); + return ( hypre_SchwarzSetOverlap( (void *) solver, overlap ) ); } /*-------------------------------------------------------------------------- @@ -96,7 +96,7 @@ HYPRE_Int HYPRE_SchwarzSetDomainType( HYPRE_Solver solver, HYPRE_Int domain_type ) { - return( hypre_SchwarzSetDomainType( (void *) solver, domain_type ) ); + return ( hypre_SchwarzSetDomainType( (void *) solver, domain_type ) ); } /*-------------------------------------------------------------------------- @@ -107,8 +107,8 @@ HYPRE_Int HYPRE_SchwarzSetDomainStructure( HYPRE_Solver solver, HYPRE_CSRMatrix domain_structure ) { - return( hypre_SchwarzSetDomainStructure( - (void *) solver, (hypre_CSRMatrix *) domain_structure ) ); + return ( hypre_SchwarzSetDomainStructure( + (void *) solver, (hypre_CSRMatrix *) domain_structure ) ); } /*-------------------------------------------------------------------------- @@ -119,7 +119,7 @@ HYPRE_Int HYPRE_SchwarzSetNumFunctions( HYPRE_Solver solver, HYPRE_Int num_functions ) { - return( hypre_SchwarzSetNumFunctions( (void *) solver, num_functions ) ); + return ( hypre_SchwarzSetNumFunctions( (void *) solver, num_functions ) ); } /*-------------------------------------------------------------------------- @@ -130,7 +130,7 @@ HYPRE_Int HYPRE_SchwarzSetNonSymm( HYPRE_Solver solver, HYPRE_Int use_nonsymm ) { - return( hypre_SchwarzSetNonSymm( (void *) solver, use_nonsymm )); + return ( hypre_SchwarzSetNonSymm( (void *) solver, use_nonsymm )); } /*-------------------------------------------------------------------------- @@ -141,7 +141,7 @@ HYPRE_Int HYPRE_SchwarzSetRelaxWeight( HYPRE_Solver solver, HYPRE_Real relax_weight) { - return( hypre_SchwarzSetRelaxWeight((void *) solver,relax_weight)); + return ( hypre_SchwarzSetRelaxWeight((void *) solver, relax_weight)); } /*-------------------------------------------------------------------------- @@ -152,6 +152,6 @@ HYPRE_Int HYPRE_SchwarzSetDofFunc( HYPRE_Solver solver, HYPRE_Int *dof_func ) { - return( hypre_SchwarzSetDofFunc( (void *) solver, dof_func ) ); + return ( hypre_SchwarzSetDofFunc( (void *) solver, dof_func ) ); } diff --git a/external/hypre/src/parcsr_ls/_hypre_parcsr_ls.h b/external/hypre/src/parcsr_ls/_hypre_parcsr_ls.h index c2d46ebb..08ed2f37 100644 --- a/external/hypre/src/parcsr_ls/_hypre_parcsr_ls.h +++ b/external/hypre/src/parcsr_ls/_hypre_parcsr_ls.h @@ -17,7 +17,7 @@ extern "C" { typedef struct { HYPRE_Int prev; HYPRE_Int next; } Link; /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -36,7 +36,11 @@ typedef struct { HYPRE_Int prev; HYPRE_Int next; } Link; typedef struct { - HYPRE_MemoryLocation memory_location; /* memory location of matrices/vectors in AMGData */ + /* Base solver data structure */ + hypre_Solver base; + + /* Memory location of matrices/vectors in AMGData */ + HYPRE_MemoryLocation memory_location; /* setup params */ HYPRE_Int max_levels; @@ -106,6 +110,7 @@ typedef struct hypre_ParCSRMatrix *A; HYPRE_Int num_variables; HYPRE_Int num_functions; + HYPRE_Int filter_functions; HYPRE_Int nodal; HYPRE_Int nodal_levels; HYPRE_Int nodal_diag; @@ -155,13 +160,33 @@ typedef struct HYPRE_Real pi_drop_tol; HYPRE_Real eu_sparse_A; char *euclidfile; + + /* ILU parameters */ HYPRE_Int ilu_lfil; HYPRE_Int ilu_type; HYPRE_Int ilu_max_row_nnz; HYPRE_Int ilu_max_iter; HYPRE_Real ilu_droptol; + HYPRE_Int ilu_tri_solve; + HYPRE_Int ilu_lower_jacobi_iters; + HYPRE_Int ilu_upper_jacobi_iters; HYPRE_Int ilu_reordering_type; - + HYPRE_Int ilu_iter_setup_type; + HYPRE_Int ilu_iter_setup_option; + HYPRE_Int ilu_iter_setup_max_iter; + HYPRE_Real ilu_iter_setup_tolerance; + + /* FSAI parameters */ + HYPRE_Int fsai_algo_type; + HYPRE_Int fsai_local_solve_type; + HYPRE_Int fsai_max_steps; + HYPRE_Int fsai_max_step_size; + HYPRE_Int fsai_max_nnz_row; + HYPRE_Int fsai_num_levels; + HYPRE_Real fsai_threshold; + HYPRE_Int fsai_eig_max_iters; + HYPRE_Real fsai_kap_tolerance; + HYPRE_Real *max_eig_est; HYPRE_Real *min_eig_est; HYPRE_Int cheby_eig_est; @@ -172,6 +197,8 @@ typedef struct hypre_Vector **cheby_ds; HYPRE_Real **cheby_coefs; + HYPRE_Real cum_nnz_AP; + /* data needed for non-Galerkin option */ HYPRE_Int nongalerk_num_tol; HYPRE_Real *nongalerk_tol; @@ -234,10 +261,14 @@ typedef struct MPI_Comm new_comm; /* store matrix, vector and communication info for Gaussian elimination */ + HYPRE_MemoryLocation ge_memory_location; HYPRE_Int gs_setup; - HYPRE_Real *A_mat, *A_inv; - HYPRE_Real *b_vec; HYPRE_Int *comm_info; + HYPRE_Int *A_piv; + HYPRE_Real *A_mat; + HYPRE_Real *A_work; + HYPRE_Real *b_vec; + HYPRE_Real *u_vec; /* information for multiplication with Lambda - additive AMG */ HYPRE_Int additive; @@ -274,7 +305,7 @@ typedef struct HYPRE_BigInt *F_points_marker; #ifdef HYPRE_USING_DSUPERLU - /* Parameters and data for SuperLU_Dist */ + /* Parameters and data for SuperLU_Dist */ HYPRE_Int dslu_threshold; HYPRE_Solver dslu_solver; #endif @@ -286,7 +317,6 @@ typedef struct *--------------------------------------------------------------------------*/ /* setup params */ - #define hypre_ParAMGDataMemoryLocation(amg_data) ((amg_data) -> memory_location) #define hypre_ParAMGDataRestriction(amg_data) ((amg_data) -> restr_par) #define hypre_ParAMGDataIsTriangular(amg_data) ((amg_data) -> is_triangular) @@ -351,8 +381,9 @@ typedef struct #define hypre_ParAMGDataOuterWt(amg_data) ((amg_data)->outer_wt) /* problem data parameters */ -#define hypre_ParAMGDataNumVariables(amg_data) ((amg_data)->num_variables) +#define hypre_ParAMGDataNumVariables(amg_data) ((amg_data)->num_variables) #define hypre_ParAMGDataNumFunctions(amg_data) ((amg_data)->num_functions) +#define hypre_ParAMGDataFilterFunctions(amg_data) ((amg_data)->filter_functions) #define hypre_ParAMGDataNodal(amg_data) ((amg_data)->nodal) #define hypre_ParAMGDataNodalLevels(amg_data) ((amg_data)->nodal_levels) #define hypre_ParAMGDataNodalDiag(amg_data) ((amg_data)->nodal_diag) @@ -401,8 +432,24 @@ typedef struct #define hypre_ParAMGDataILULevel(amg_data) ((amg_data)->ilu_lfil) #define hypre_ParAMGDataILUMaxRowNnz(amg_data) ((amg_data)->ilu_max_row_nnz) #define hypre_ParAMGDataILUDroptol(amg_data) ((amg_data)->ilu_droptol) +#define hypre_ParAMGDataILUTriSolve(amg_data) ((amg_data)->ilu_tri_solve) +#define hypre_ParAMGDataILULowerJacobiIters(amg_data) ((amg_data)->ilu_lower_jacobi_iters) +#define hypre_ParAMGDataILUUpperJacobiIters(amg_data) ((amg_data)->ilu_upper_jacobi_iters) #define hypre_ParAMGDataILUMaxIter(amg_data) ((amg_data)->ilu_max_iter) #define hypre_ParAMGDataILULocalReordering(amg_data) ((amg_data)->ilu_reordering_type) +#define hypre_ParAMGDataILUIterSetupType(amg_data) ((amg_data)->ilu_iter_setup_type) +#define hypre_ParAMGDataILUIterSetupOption(amg_data) ((amg_data)->ilu_iter_setup_option) +#define hypre_ParAMGDataILUIterSetupMaxIter(amg_data) ((amg_data)->ilu_iter_setup_max_iter) +#define hypre_ParAMGDataILUIterSetupTolerance(amg_data) ((amg_data)->ilu_iter_setup_tolerance) +#define hypre_ParAMGDataFSAIAlgoType(amg_data) ((amg_data)->fsai_algo_type) +#define hypre_ParAMGDataFSAILocalSolveType(amg_data) ((amg_data)->fsai_local_solve_type) +#define hypre_ParAMGDataFSAIMaxSteps(amg_data) ((amg_data)->fsai_max_steps) +#define hypre_ParAMGDataFSAIMaxStepSize(amg_data) ((amg_data)->fsai_max_step_size) +#define hypre_ParAMGDataFSAIMaxNnzRow(amg_data) ((amg_data)->fsai_max_nnz_row) +#define hypre_ParAMGDataFSAINumLevels(amg_data) ((amg_data)->fsai_num_levels) +#define hypre_ParAMGDataFSAIThreshold(amg_data) ((amg_data)->fsai_threshold) +#define hypre_ParAMGDataFSAIEigMaxIters(amg_data) ((amg_data)->fsai_eig_max_iters) +#define hypre_ParAMGDataFSAIKapTolerance(amg_data) ((amg_data)->fsai_kap_tolerance) #define hypre_ParAMGDataMaxEigEst(amg_data) ((amg_data)->max_eig_est) #define hypre_ParAMGDataMinEigEst(amg_data) ((amg_data)->min_eig_est) @@ -414,6 +461,8 @@ typedef struct #define hypre_ParAMGDataChebyDS(amg_data) ((amg_data)->cheby_ds) #define hypre_ParAMGDataChebyCoefs(amg_data) ((amg_data)->cheby_coefs) +#define hypre_ParAMGDataCumNnzAP(amg_data) ((amg_data)->cum_nnz_AP) + /* block */ #define hypre_ParAMGDataABlockArray(amg_data) ((amg_data)->A_block_array) #define hypre_ParAMGDataPBlockArray(amg_data) ((amg_data)->P_block_array) @@ -479,9 +528,12 @@ typedef struct #define hypre_ParAMGDataParticipate(amg_data) ((amg_data)->participate) #define hypre_ParAMGDataGSSetup(amg_data) ((amg_data)->gs_setup) +#define hypre_ParAMGDataGEMemoryLocation(amg_data) ((amg_data)->ge_memory_location) #define hypre_ParAMGDataAMat(amg_data) ((amg_data)->A_mat) -#define hypre_ParAMGDataAInv(amg_data) ((amg_data)->A_inv) +#define hypre_ParAMGDataAWork(amg_data) ((amg_data)->A_work) +#define hypre_ParAMGDataAPiv(amg_data) ((amg_data)->A_piv) #define hypre_ParAMGDataBVec(amg_data) ((amg_data)->b_vec) +#define hypre_ParAMGDataUVec(amg_data) ((amg_data)->u_vec) #define hypre_ParAMGDataCommInfo(amg_data) ((amg_data)->comm_info) /* additive AMG parameters */ @@ -531,7 +583,7 @@ typedef struct #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -561,7 +613,8 @@ typedef struct HYPRE_Int ***num_recv_nodes; // number of nodes to recv on each composite level HYPRE_Int ****send_flag; // flags which nodes to send after composite grid is built - HYPRE_Int ****recv_map; // mapping from recv buffer to appropriate local indices on each comp grid + HYPRE_Int + ****recv_map; // mapping from recv buffer to appropriate local indices on each comp grid HYPRE_Int ****recv_red_marker; // marker indicating a redundant recv } hypre_AMGDDCommPkg; @@ -591,7 +644,8 @@ typedef struct { hypre_CSRMatrix *owned_diag; // Domain: owned domain of mat. Range: owned range of mat. hypre_CSRMatrix *owned_offd; // Domain: nonowned domain of mat. Range: owned range of mat. - hypre_CSRMatrix *nonowned_diag; // Domain: nonowned domain of mat. Range: nonowned range of mat. + hypre_CSRMatrix + *nonowned_diag; // Domain: nonowned domain of mat. Range: nonowned range of mat. hypre_CSRMatrix *nonowned_offd; // Domain: owned domain of mat. Range: nonowned range of mat. hypre_CSRMatrix *real_real; // Domain: nonowned real. Range: nonowned real. @@ -647,8 +701,8 @@ typedef struct HYPRE_Int level; HYPRE_MemoryLocation memory_location; /* memory location of matrices/vectors */ - HYPRE_Int first_global_index; - HYPRE_Int last_global_index; + HYPRE_BigInt first_global_index; + HYPRE_BigInt last_global_index; HYPRE_Int num_owned_nodes; HYPRE_Int num_nonowned_nodes; HYPRE_Int num_nonowned_real_nodes; @@ -723,7 +777,7 @@ typedef struct #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -754,7 +808,8 @@ typedef struct hypre_AMGDDCommPkg *amgdd_comm_pkg; hypre_ParVector *Ztemp; - HYPRE_Int (*amgddUserFACRelaxation)( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ); + HYPRE_Int (*amgddUserFACRelaxation)( void *amgdd_vdata, HYPRE_Int level, + HYPRE_Int cycle_param ); } hypre_ParAMGDDData; /*-------------------------------------------------------------------------- @@ -776,7 +831,630 @@ typedef struct #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#ifndef hypre_ParFSAI_DATA_HEADER +#define hypre_ParFSAI_DATA_HEADER + +//#define DEBUG_FSAI + +/*-------------------------------------------------------------------------- + * hypre_ParFSAIData + *--------------------------------------------------------------------------*/ + +typedef struct hypre_ParFSAIData_struct +{ + /* FSAI Setup input data */ + HYPRE_Int algo_type; /* FSAI algorithm type */ + HYPRE_Int local_solve_type; /* Local linear solver type */ + HYPRE_Int max_steps; /* Max. iterations run per row */ + HYPRE_Int max_step_size; /* Max. number of nonzeros added to a row of G per step */ + HYPRE_Int max_nnz_row; /* Max. number of nonzeros per row of G */ + HYPRE_Int num_levels; /* Number of levels for computing the candidate pattern */ + HYPRE_Real threshold; /* Filtering threshold for the candidate pattern */ + HYPRE_Real kap_tolerance; /* Min. amount of change between two steps */ + + /* FSAI Setup data */ + HYPRE_Real density; /* Density of matrix G wrt. A */ + hypre_ParCSRMatrix *Gmat; /* Matrix holding FSAI factor. M^(-1) = G'G */ + hypre_ParCSRMatrix *GTmat; /* Matrix holding the transpose of the FSAI factor */ + + /* Solver data */ + HYPRE_Int zero_guess; /* Flag indicating x0 = 0 */ + HYPRE_Int eig_max_iters; /* Iters for computing max. eigenvalue of G^T*G*A */ + HYPRE_Int max_iterations; /* Maximum iterations run for the solver */ + HYPRE_Int num_iterations; /* Number of iterations the solver ran */ + HYPRE_Real omega; /* Step size for Preconditioned Richardson Solver */ + HYPRE_Real tolerance; /* Tolerance for the solver */ + HYPRE_Real rel_resnorm; /* available if logging > 1 */ + + /* Work data */ + hypre_ParVector *r_work; /* work vector used to compute the residual */ + hypre_ParVector *z_work; /* work vector used for applying FSAI */ + + /* Log info data */ + HYPRE_Int logging; + HYPRE_Int print_level; +} hypre_ParFSAIData; + +/*-------------------------------------------------------------------------- + * Accessor functions for the hypre_ParFSAIData structure + *--------------------------------------------------------------------------*/ + +/* FSAI Setup input data */ +#define hypre_ParFSAIDataAlgoType(fsai_data) ((fsai_data) -> algo_type) +#define hypre_ParFSAIDataLocalSolveType(fsai_data) ((fsai_data) -> local_solve_type) +#define hypre_ParFSAIDataMaxSteps(fsai_data) ((fsai_data) -> max_steps) +#define hypre_ParFSAIDataMaxStepSize(fsai_data) ((fsai_data) -> max_step_size) +#define hypre_ParFSAIDataMaxNnzRow(fsai_data) ((fsai_data) -> max_nnz_row) +#define hypre_ParFSAIDataNumLevels(fsai_data) ((fsai_data) -> num_levels) +#define hypre_ParFSAIDataThreshold(fsai_data) ((fsai_data) -> threshold) +#define hypre_ParFSAIDataKapTolerance(fsai_data) ((fsai_data) -> kap_tolerance) + +/* FSAI Setup data */ +#define hypre_ParFSAIDataGmat(fsai_data) ((fsai_data) -> Gmat) +#define hypre_ParFSAIDataGTmat(fsai_data) ((fsai_data) -> GTmat) +#define hypre_ParFSAIDataDensity(fsai_data) ((fsai_data) -> density) + +/* Solver problem data */ +#define hypre_ParFSAIDataZeroGuess(fsai_data) ((fsai_data) -> zero_guess) +#define hypre_ParFSAIDataEigMaxIters(fsai_data) ((fsai_data) -> eig_max_iters) +#define hypre_ParFSAIDataMaxIterations(fsai_data) ((fsai_data) -> max_iterations) +#define hypre_ParFSAIDataNumIterations(fsai_data) ((fsai_data) -> num_iterations) +#define hypre_ParFSAIDataOmega(fsai_data) ((fsai_data) -> omega) +#define hypre_ParFSAIDataRelResNorm(fsai_data) ((fsai_data) -> rel_resnorm) +#define hypre_ParFSAIDataTolerance(fsai_data) ((fsai_data) -> tolerance) + +/* Work data */ +#define hypre_ParFSAIDataRWork(fsai_data) ((fsai_data) -> r_work) +#define hypre_ParFSAIDataZWork(fsai_data) ((fsai_data) -> z_work) + +/* Log info data */ +#define hypre_ParFSAIDataLogging(fsai_data) ((fsai_data) -> logging) +#define hypre_ParFSAIDataPrintLevel(fsai_data) ((fsai_data) -> print_level) + +#endif +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#ifndef hypre_AMS_DATA_HEADER +#define hypre_AMS_DATA_HEADER + +/*-------------------------------------------------------------------------- + * Auxiliary space Maxwell Solver data + *--------------------------------------------------------------------------*/ +typedef struct +{ + /* Space dimension (2 or 3) */ + HYPRE_Int dim; + + /* Edge element (ND1) stiffness matrix */ + hypre_ParCSRMatrix *A; + + /* Discrete gradient matrix (vertex-to-edge) */ + hypre_ParCSRMatrix *G; + /* Coarse grid matrix on the range of G^T */ + hypre_ParCSRMatrix *A_G; + /* AMG solver for A_G */ + HYPRE_Solver B_G; + /* Is the mass term coefficient zero? */ + HYPRE_Int beta_is_zero; + + /* Nedelec nodal interpolation matrix (vertex^dim-to-edge) */ + hypre_ParCSRMatrix *Pi; + /* Coarse grid matrix on the range of Pi^T */ + hypre_ParCSRMatrix *A_Pi; + /* AMG solver for A_Pi */ + HYPRE_Solver B_Pi; + + /* Components of the Nedelec interpolation matrix (vertex-to-edge each) */ + hypre_ParCSRMatrix *Pix, *Piy, *Piz; + /* Coarse grid matrices on the ranges of Pi{x,y,z}^T */ + hypre_ParCSRMatrix *A_Pix, *A_Piy, *A_Piz; + /* AMG solvers for A_Pi{x,y,z} */ + HYPRE_Solver B_Pix, B_Piy, B_Piz; + + /* Does the solver own the Nedelec interpolations? */ + HYPRE_Int owns_Pi; + /* Does the solver own the coarse grid matrices? */ + HYPRE_Int owns_A_G, owns_A_Pi; + + /* Coordinates of the vertices (z = 0 if dim == 2) */ + hypre_ParVector *x, *y, *z; + + /* Representations of the constant vectors in the Nedelec basis */ + hypre_ParVector *Gx, *Gy, *Gz; + + /* Nodes in the interior of the zero-conductivity region */ + hypre_ParVector *interior_nodes; + /* Discrete gradient matrix for the interior nodes only */ + hypre_ParCSRMatrix *G0; + /* Coarse grid matrix on the interior nodes */ + hypre_ParCSRMatrix *A_G0; + /* AMG solver for A_G0 */ + HYPRE_Solver B_G0; + /* How frequently to project the r.h.s. onto Ker(G0^T)? */ + HYPRE_Int projection_frequency; + /* Internal counter to use with projection_frequency in PCG */ + HYPRE_Int solve_counter; + + /* Solver options */ + HYPRE_Int maxit; + HYPRE_Real tol; + HYPRE_Int cycle_type; + HYPRE_Int print_level; + + /* Smoothing options for A */ + HYPRE_Int A_relax_type; + HYPRE_Int A_relax_times; + hypre_Vector *A_l1_norms; + HYPRE_Real A_relax_weight; + HYPRE_Real A_omega; + HYPRE_Real A_max_eig_est; + HYPRE_Real A_min_eig_est; + HYPRE_Int A_cheby_order; + HYPRE_Real A_cheby_fraction; + + /* AMG options for B_G */ + HYPRE_Int B_G_coarsen_type; + HYPRE_Int B_G_agg_levels; + HYPRE_Int B_G_relax_type; + HYPRE_Int B_G_coarse_relax_type; + HYPRE_Real B_G_theta; + HYPRE_Int B_G_interp_type; + HYPRE_Int B_G_Pmax; + + /* AMG options for B_Pi */ + HYPRE_Int B_Pi_coarsen_type; + HYPRE_Int B_Pi_agg_levels; + HYPRE_Int B_Pi_relax_type; + HYPRE_Int B_Pi_coarse_relax_type; + HYPRE_Real B_Pi_theta; + HYPRE_Int B_Pi_interp_type; + HYPRE_Int B_Pi_Pmax; + + /* Temporary vectors */ + hypre_ParVector *r0, *g0, *r1, *g1, *r2, *g2, *zz; + + /* Output log info */ + HYPRE_Int num_iterations; + HYPRE_Real rel_resid_norm; + +} hypre_AMSData; + +/* Space dimension */ +#define hypre_AMSDataDimension(ams_data) ((ams_data)->dim) + +/* Edge stiffness matrix */ +#define hypre_AMSDataA(ams_data) ((ams_data)->A) + +/* Vertex space data */ +#define hypre_AMSDataDiscreteGradient(ams_data) ((ams_data)->G) +#define hypre_AMSDataPoissonBeta(ams_data) ((ams_data)->A_G) +#define hypre_AMSDataPoissonBetaAMG(ams_data) ((ams_data)->B_G) +#define hypre_AMSDataOwnsPoissonBeta(ams_data) ((ams_data)->owns_A_G) +#define hypre_AMSDataBetaIsZero(ams_data) ((ams_data)->beta_is_zero) + +/* Vector vertex space data */ +#define hypre_AMSDataPiInterpolation(ams_data) ((ams_data)->Pi) +#define hypre_AMSDataOwnsPiInterpolation(ams_data) ((ams_data)->owns_Pi) +#define hypre_AMSDataPoissonAlpha(ams_data) ((ams_data)->A_Pi) +#define hypre_AMSDataPoissonAlphaAMG(ams_data) ((ams_data)->B_Pi) +#define hypre_AMSDataOwnsPoissonAlpha(ams_data) ((ams_data)->owns_A_Pi) + +/* Vector vertex components data */ +#define hypre_AMSDataPiXInterpolation(ams_data) ((ams_data)->Pix) +#define hypre_AMSDataPiYInterpolation(ams_data) ((ams_data)->Piy) +#define hypre_AMSDataPiZInterpolation(ams_data) ((ams_data)->Piz) +#define hypre_AMSDataPoissonAlphaX(ams_data) ((ams_data)->A_Pix) +#define hypre_AMSDataPoissonAlphaY(ams_data) ((ams_data)->A_Piy) +#define hypre_AMSDataPoissonAlphaZ(ams_data) ((ams_data)->A_Piz) +#define hypre_AMSDataPoissonAlphaXAMG(ams_data) ((ams_data)->B_Pix) +#define hypre_AMSDataPoissonAlphaYAMG(ams_data) ((ams_data)->B_Piy) +#define hypre_AMSDataPoissonAlphaZAMG(ams_data) ((ams_data)->B_Piz) + +/* Coordinates of the vertices */ +#define hypre_AMSDataVertexCoordinateX(ams_data) ((ams_data)->x) +#define hypre_AMSDataVertexCoordinateY(ams_data) ((ams_data)->y) +#define hypre_AMSDataVertexCoordinateZ(ams_data) ((ams_data)->z) + +/* Representations of the constant vectors in the Nedelec basis */ +#define hypre_AMSDataEdgeConstantX(ams_data) ((ams_data)->Gx) +#define hypre_AMSDataEdgeConstantY(ams_data) ((ams_data)->Gy) +#define hypre_AMSDataEdgeConstantZ(ams_data) ((ams_data)->Gz) + +/* Interior zero conductivity region */ +#define hypre_AMSDataInteriorNodes(ams_data) ((ams_data)->interior_nodes) +#define hypre_AMSDataInteriorDiscreteGradient(ams_data) ((ams_data)->G0) +#define hypre_AMSDataInteriorPoissonBeta(ams_data) ((ams_data)->A_G0) +#define hypre_AMSDataInteriorPoissonBetaAMG(ams_data) ((ams_data)->B_G0) +#define hypre_AMSDataInteriorProjectionFrequency(ams_data) ((ams_data)->projection_frequency) +#define hypre_AMSDataInteriorSolveCounter(ams_data) ((ams_data)->solve_counter) + +/* Solver options */ +#define hypre_AMSDataMaxIter(ams_data) ((ams_data)->maxit) +#define hypre_AMSDataTol(ams_data) ((ams_data)->tol) +#define hypre_AMSDataCycleType(ams_data) ((ams_data)->cycle_type) +#define hypre_AMSDataPrintLevel(ams_data) ((ams_data)->print_level) + +/* Smoothing and AMG options */ +#define hypre_AMSDataARelaxType(ams_data) ((ams_data)->A_relax_type) +#define hypre_AMSDataARelaxTimes(ams_data) ((ams_data)->A_relax_times) +#define hypre_AMSDataAL1Norms(ams_data) ((ams_data)->A_l1_norms) +#define hypre_AMSDataARelaxWeight(ams_data) ((ams_data)->A_relax_weight) +#define hypre_AMSDataAOmega(ams_data) ((ams_data)->A_omega) +#define hypre_AMSDataAMaxEigEst(ams_data) ((ams_data)->A_max_eig_est) +#define hypre_AMSDataAMinEigEst(ams_data) ((ams_data)->A_min_eig_est) +#define hypre_AMSDataAChebyOrder(ams_data) ((ams_data)->A_cheby_order) +#define hypre_AMSDataAChebyFraction(ams_data) ((ams_data)->A_cheby_fraction) + +#define hypre_AMSDataPoissonBetaAMGCoarsenType(ams_data) ((ams_data)->B_G_coarsen_type) +#define hypre_AMSDataPoissonBetaAMGAggLevels(ams_data) ((ams_data)->B_G_agg_levels) +#define hypre_AMSDataPoissonBetaAMGRelaxType(ams_data) ((ams_data)->B_G_relax_type) +#define hypre_AMSDataPoissonBetaAMGCoarseRelaxType(ams_data) ((ams_data)->B_G_coarse_relax_type) +#define hypre_AMSDataPoissonBetaAMGStrengthThreshold(ams_data) ((ams_data)->B_G_theta) +#define hypre_AMSDataPoissonBetaAMGInterpType(ams_data) ((ams_data)->B_G_interp_type) +#define hypre_AMSDataPoissonBetaAMGPMax(ams_data) ((ams_data)->B_G_Pmax) + +#define hypre_AMSDataPoissonAlphaAMGCoarsenType(ams_data) ((ams_data)->B_Pi_coarsen_type) +#define hypre_AMSDataPoissonAlphaAMGAggLevels(ams_data) ((ams_data)->B_Pi_agg_levels) +#define hypre_AMSDataPoissonAlphaAMGRelaxType(ams_data) ((ams_data)->B_Pi_relax_type) +#define hypre_AMSDataPoissonAlphaAMGCoarseRelaxType(ams_data) ((ams_data)->B_Pi_coarse_relax_type) +#define hypre_AMSDataPoissonAlphaAMGStrengthThreshold(ams_data) ((ams_data)->B_Pi_theta) +#define hypre_AMSDataPoissonAlphaAMGInterpType(ams_data) ((ams_data)->B_Pi_interp_type) +#define hypre_AMSDataPoissonAlphaAMGPMax(ams_data) ((ams_data)->B_Pi_Pmax) + +/* Temporary vectors */ +#define hypre_AMSDataTempEdgeVectorR(ams_data) ((ams_data)->r0) +#define hypre_AMSDataTempEdgeVectorG(ams_data) ((ams_data)->g0) +#define hypre_AMSDataTempVertexVectorR(ams_data) ((ams_data)->r1) +#define hypre_AMSDataTempVertexVectorG(ams_data) ((ams_data)->g1) +#define hypre_AMSDataTempVecVertexVectorR(ams_data) ((ams_data)->r2) +#define hypre_AMSDataTempVecVertexVectorG(ams_data) ((ams_data)->g2) +#define hypre_AMSDataTempVecVertexVectorZZ(ams_data) ((ams_data)->zz) + +/* Output log info */ +#define hypre_AMSDataNumIterations(ams_data) ((ams_data)->num_iterations) +#define hypre_AMSDataResidualNorm(ams_data) ((ams_data)->rel_resid_norm) + +#endif +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#ifndef hypre_ParILU_DATA_HEADER +#define hypre_ParILU_DATA_HEADER + +/*-------------------------------------------------------------------------- + * hypre_ParILUData + *--------------------------------------------------------------------------*/ + +typedef struct hypre_ParILUData_struct +{ + /* Base solver data structure */ + hypre_Solver base; + + /* General data */ + HYPRE_Int global_solver; + hypre_ParCSRMatrix *matA; + hypre_ParCSRMatrix *matL; + HYPRE_Real *matD; + hypre_ParCSRMatrix *matU; + hypre_ParCSRMatrix *matmL; + HYPRE_Real *matmD; + hypre_ParCSRMatrix *matmU; + hypre_ParCSRMatrix *matS; + HYPRE_Real *droptol; /* Array of 3 elements, for B, (E and F), S respectively */ + HYPRE_Int lfil; + HYPRE_Int maxRowNnz; + HYPRE_Int *CF_marker_array; + HYPRE_Int *perm; + HYPRE_Int *qperm; + HYPRE_Real tol_ddPQ; + hypre_ParVector *F; + hypre_ParVector *U; + hypre_ParVector *residual; + HYPRE_Real *rel_res_norms; + HYPRE_Int num_iterations; + HYPRE_Real *l1_norms; + HYPRE_Real final_rel_residual_norm; + HYPRE_Real tol; + HYPRE_Real operator_complexity; + HYPRE_Int logging; + HYPRE_Int print_level; + HYPRE_Int max_iter; + HYPRE_Int tri_solve; + HYPRE_Int lower_jacobi_iters; + HYPRE_Int upper_jacobi_iters; + HYPRE_Int ilu_type; + HYPRE_Int nLU; + HYPRE_Int nI; + HYPRE_Int *u_end; /* used when schur block is formed */ + + /* Iterative ILU parameters */ + HYPRE_Int iter_setup_type; + HYPRE_Int iter_setup_option; + HYPRE_Int setup_max_iter; + HYPRE_Int setup_num_iter; + HYPRE_Real setup_tolerance; + HYPRE_Complex *setup_history; + + /* temp vectors for solve phase */ + hypre_ParVector *Utemp; + hypre_ParVector *Ftemp; + hypre_ParVector *Xtemp; + hypre_ParVector *Ytemp; + hypre_ParVector *Ztemp; + HYPRE_Real *uext; + HYPRE_Real *fext; + + /* On GPU, we have to form E and F explicitly, since we don't have much control to it */ +#if defined(HYPRE_USING_GPU) + hypre_CSRMatrix *matALU_d; /* Matrix holding ILU of A (for A-smoothing) */ + hypre_CSRMatrix *matBLU_d; /* Matrix holding ILU of B */ + hypre_CSRMatrix *matSLU_d; /* Matrix holding ILU of S */ + hypre_CSRMatrix *matE_d; + hypre_CSRMatrix *matF_d; + hypre_ParCSRMatrix *Aperm; + hypre_ParCSRMatrix *R; + hypre_ParCSRMatrix *P; + hypre_Vector *Ftemp_upper; + hypre_Vector *Utemp_lower; + hypre_Vector *Adiag_diag; + hypre_Vector *Sdiag_diag; +#endif + + /* data structure sor solving Schur System */ + HYPRE_Solver schur_solver; + HYPRE_Solver schur_precond; + hypre_ParVector *rhs; + hypre_ParVector *x; + + /* Schur solver data */ + HYPRE_Int ss_logging; + HYPRE_Int ss_print_level; + + /* Schur-GMRES */ + HYPRE_Int ss_kDim; /* max number of iterations for GMRES */ + HYPRE_Int ss_max_iter; /* max number of iterations for GMRES solve */ + HYPRE_Real ss_tol; /* stop iteration tol for GMRES */ + HYPRE_Real ss_absolute_tol; /* absolute tol for GMRES or tol for NSH solve */ + HYPRE_Int ss_rel_change; + + /* Schur-NSH */ + HYPRE_Int ss_nsh_setup_max_iter; /* number of iterations for NSH inverse */ + HYPRE_Int ss_nsh_solve_max_iter; /* max number of iterations for NSH solve */ + HYPRE_Real ss_nsh_setup_tol; /* stop iteration tol for NSH inverse */ + HYPRE_Real ss_nsh_solve_tol; /* absolute tol for NSH solve */ + HYPRE_Int ss_nsh_max_row_nnz; /* max rows of nonzeros for NSH */ + HYPRE_Int ss_nsh_mr_col_version; /* MR column version setting in NSH */ + HYPRE_Int ss_nsh_mr_max_row_nnz; /* max rows for MR */ + HYPRE_Real *ss_nsh_droptol; /* droptol array for NSH */ + HYPRE_Int ss_nsh_mr_max_iter; /* max MR iteration */ + HYPRE_Real ss_nsh_mr_tol; + + /* Schur precond data */ + HYPRE_Int sp_ilu_type; /* ilu type is use ILU */ + HYPRE_Int sp_ilu_lfil; /* level of fill in for ILUK */ + HYPRE_Int sp_ilu_max_row_nnz; /* max rows for ILUT */ + /* droptol for ILUT or MR + * ILUT: [0], [1], [2] B, E&F, S respectively + * NSH: [0] for MR, [1] for NSH + */ + HYPRE_Real *sp_ilu_droptol; /* droptol array for ILUT */ + HYPRE_Int sp_print_level; + HYPRE_Int sp_max_iter; /* max precond iter or max MR iteration */ + HYPRE_Int sp_tri_solve; + HYPRE_Int sp_lower_jacobi_iters; + HYPRE_Int sp_upper_jacobi_iters; + HYPRE_Real sp_tol; + HYPRE_Int test_opt; /* TODO (VPM): change this to something more descriptive*/ + + /* local reordering */ + HYPRE_Int reordering_type; +} hypre_ParILUData; + +#define hypre_ParILUDataTestOption(ilu_data) ((ilu_data) -> test_opt) + +#if defined(HYPRE_USING_GPU) +#define hypre_ParILUDataMatAILUDevice(ilu_data) ((ilu_data) -> matALU_d) +#define hypre_ParILUDataMatBILUDevice(ilu_data) ((ilu_data) -> matBLU_d) +#define hypre_ParILUDataMatSILUDevice(ilu_data) ((ilu_data) -> matSLU_d) +#define hypre_ParILUDataMatEDevice(ilu_data) ((ilu_data) -> matE_d) +#define hypre_ParILUDataMatFDevice(ilu_data) ((ilu_data) -> matF_d) +#define hypre_ParILUDataAperm(ilu_data) ((ilu_data) -> Aperm) +#define hypre_ParILUDataR(ilu_data) ((ilu_data) -> R) +#define hypre_ParILUDataP(ilu_data) ((ilu_data) -> P) +#define hypre_ParILUDataFTempUpper(ilu_data) ((ilu_data) -> Ftemp_upper) +#define hypre_ParILUDataUTempLower(ilu_data) ((ilu_data) -> Utemp_lower) +#define hypre_ParILUDataADiagDiag(ilu_data) ((ilu_data) -> Adiag_diag) +#define hypre_ParILUDataSDiagDiag(ilu_data) ((ilu_data) -> Sdiag_diag) +#endif + +#define hypre_ParILUDataGlobalSolver(ilu_data) ((ilu_data) -> global_solver) +#define hypre_ParILUDataMatA(ilu_data) ((ilu_data) -> matA) +#define hypre_ParILUDataMatL(ilu_data) ((ilu_data) -> matL) +#define hypre_ParILUDataMatD(ilu_data) ((ilu_data) -> matD) +#define hypre_ParILUDataMatU(ilu_data) ((ilu_data) -> matU) +#define hypre_ParILUDataMatLModified(ilu_data) ((ilu_data) -> matmL) +#define hypre_ParILUDataMatDModified(ilu_data) ((ilu_data) -> matmD) +#define hypre_ParILUDataMatUModified(ilu_data) ((ilu_data) -> matmU) +#define hypre_ParILUDataMatS(ilu_data) ((ilu_data) -> matS) +#define hypre_ParILUDataDroptol(ilu_data) ((ilu_data) -> droptol) +#define hypre_ParILUDataLfil(ilu_data) ((ilu_data) -> lfil) +#define hypre_ParILUDataMaxRowNnz(ilu_data) ((ilu_data) -> maxRowNnz) +#define hypre_ParILUDataCFMarkerArray(ilu_data) ((ilu_data) -> CF_marker_array) +#define hypre_ParILUDataPerm(ilu_data) ((ilu_data) -> perm) +#define hypre_ParILUDataPPerm(ilu_data) ((ilu_data) -> perm) +#define hypre_ParILUDataQPerm(ilu_data) ((ilu_data) -> qperm) +#define hypre_ParILUDataTolDDPQ(ilu_data) ((ilu_data) -> tol_ddPQ) +#define hypre_ParILUDataF(ilu_data) ((ilu_data) -> F) +#define hypre_ParILUDataU(ilu_data) ((ilu_data) -> U) +#define hypre_ParILUDataResidual(ilu_data) ((ilu_data) -> residual) +#define hypre_ParILUDataRelResNorms(ilu_data) ((ilu_data) -> rel_res_norms) +#define hypre_ParILUDataNumIterations(ilu_data) ((ilu_data) -> num_iterations) +#define hypre_ParILUDataL1Norms(ilu_data) ((ilu_data) -> l1_norms) +#define hypre_ParILUDataFinalRelResidualNorm(ilu_data) ((ilu_data) -> final_rel_residual_norm) +#define hypre_ParILUDataTol(ilu_data) ((ilu_data) -> tol) +#define hypre_ParILUDataOperatorComplexity(ilu_data) ((ilu_data) -> operator_complexity) +#define hypre_ParILUDataLogging(ilu_data) ((ilu_data) -> logging) +#define hypre_ParILUDataPrintLevel(ilu_data) ((ilu_data) -> print_level) +#define hypre_ParILUDataMaxIter(ilu_data) ((ilu_data) -> max_iter) +#define hypre_ParILUDataTriSolve(ilu_data) ((ilu_data) -> tri_solve) +#define hypre_ParILUDataLowerJacobiIters(ilu_data) ((ilu_data) -> lower_jacobi_iters) +#define hypre_ParILUDataUpperJacobiIters(ilu_data) ((ilu_data) -> upper_jacobi_iters) +#define hypre_ParILUDataIluType(ilu_data) ((ilu_data) -> ilu_type) +#define hypre_ParILUDataNLU(ilu_data) ((ilu_data) -> nLU) +#define hypre_ParILUDataNI(ilu_data) ((ilu_data) -> nI) +#define hypre_ParILUDataUEnd(ilu_data) ((ilu_data) -> u_end) +#define hypre_ParILUDataUTemp(ilu_data) ((ilu_data) -> Utemp) +#define hypre_ParILUDataFTemp(ilu_data) ((ilu_data) -> Ftemp) +#define hypre_ParILUDataXTemp(ilu_data) ((ilu_data) -> Xtemp) +#define hypre_ParILUDataYTemp(ilu_data) ((ilu_data) -> Ytemp) +#define hypre_ParILUDataZTemp(ilu_data) ((ilu_data) -> Ztemp) +#define hypre_ParILUDataUExt(ilu_data) ((ilu_data) -> uext) +#define hypre_ParILUDataFExt(ilu_data) ((ilu_data) -> fext) +#define hypre_ParILUDataSchurSolver(ilu_data) ((ilu_data) -> schur_solver) +#define hypre_ParILUDataSchurPrecond(ilu_data) ((ilu_data) -> schur_precond) +#define hypre_ParILUDataRhs(ilu_data) ((ilu_data) -> rhs) +#define hypre_ParILUDataX(ilu_data) ((ilu_data) -> x) +#define hypre_ParILUDataReorderingType(ilu_data) ((ilu_data) -> reordering_type) + +/* Iterative ILU setup */ +#define hypre_ParILUDataIterativeSetupType(ilu_data) ((ilu_data) -> iter_setup_type) +#define hypre_ParILUDataIterativeSetupOption(ilu_data) ((ilu_data) -> iter_setup_option) +#define hypre_ParILUDataIterativeSetupMaxIter(ilu_data) ((ilu_data) -> setup_max_iter) +#define hypre_ParILUDataIterativeSetupNumIter(ilu_data) ((ilu_data) -> setup_num_iter) +#define hypre_ParILUDataIterativeSetupTolerance(ilu_data) ((ilu_data) -> setup_tolerance) +#define hypre_ParILUDataIterativeSetupHistory(ilu_data) ((ilu_data) -> setup_history) +#define hypre_ParILUDataIterSetupCorrectionNorm(ilu_data,i) ((ilu_data) -> setup_history[i]) +#define hypre_ParILUDataIterSetupResidualNorm(ilu_data,i) (((ilu_data) -> setup_history + \ + (ilu_data) -> setup_num_iter)[i]) + +/* Schur System */ +#define hypre_ParILUDataSchurGMRESKDim(ilu_data) ((ilu_data) -> ss_kDim) +#define hypre_ParILUDataSchurGMRESMaxIter(ilu_data) ((ilu_data) -> ss_max_iter) +#define hypre_ParILUDataSchurGMRESTol(ilu_data) ((ilu_data) -> ss_tol) +#define hypre_ParILUDataSchurGMRESAbsoluteTol(ilu_data) ((ilu_data) -> ss_absolute_tol) +#define hypre_ParILUDataSchurGMRESRelChange(ilu_data) ((ilu_data) -> ss_rel_change) +#define hypre_ParILUDataSchurPrecondIluType(ilu_data) ((ilu_data) -> sp_ilu_type) +#define hypre_ParILUDataSchurPrecondIluLfil(ilu_data) ((ilu_data) -> sp_ilu_lfil) +#define hypre_ParILUDataSchurPrecondIluMaxRowNnz(ilu_data) ((ilu_data) -> sp_ilu_max_row_nnz) +#define hypre_ParILUDataSchurPrecondIluDroptol(ilu_data) ((ilu_data) -> sp_ilu_droptol) +#define hypre_ParILUDataSchurPrecondPrintLevel(ilu_data) ((ilu_data) -> sp_print_level) +#define hypre_ParILUDataSchurPrecondMaxIter(ilu_data) ((ilu_data) -> sp_max_iter) +#define hypre_ParILUDataSchurPrecondTriSolve(ilu_data) ((ilu_data) -> sp_tri_solve) +#define hypre_ParILUDataSchurPrecondLowerJacobiIters(ilu_data) ((ilu_data) -> sp_lower_jacobi_iters) +#define hypre_ParILUDataSchurPrecondUpperJacobiIters(ilu_data) ((ilu_data) -> sp_upper_jacobi_iters) +#define hypre_ParILUDataSchurPrecondTol(ilu_data) ((ilu_data) -> sp_tol) + +#define hypre_ParILUDataSchurNSHMaxNumIter(ilu_data) ((ilu_data) -> ss_nsh_setup_max_iter) +#define hypre_ParILUDataSchurNSHSolveMaxIter(ilu_data) ((ilu_data) -> ss_nsh_solve_max_iter) +#define hypre_ParILUDataSchurNSHTol(ilu_data) ((ilu_data) -> ss_nsh_setup_tol) +#define hypre_ParILUDataSchurNSHSolveTol(ilu_data) ((ilu_data) -> ss_nsh_solve_tol) +#define hypre_ParILUDataSchurNSHMaxRowNnz(ilu_data) ((ilu_data) -> ss_nsh_max_row_nnz) +#define hypre_ParILUDataSchurMRColVersion(ilu_data) ((ilu_data) -> ss_nsh_mr_col_version) +#define hypre_ParILUDataSchurMRMaxRowNnz(ilu_data) ((ilu_data) -> ss_nsh_mr_max_row_nnz) +#define hypre_ParILUDataSchurNSHDroptol(ilu_data) ((ilu_data) -> ss_nsh_droptol) +#define hypre_ParILUDataSchurMRMaxIter(ilu_data) ((ilu_data) -> ss_nsh_mr_max_iter) +#define hypre_ParILUDataSchurMRTol(ilu_data) ((ilu_data) -> ss_nsh_mr_tol) + +#define hypre_ParILUDataSchurSolverLogging(ilu_data) ((ilu_data) -> ss_logging) +#define hypre_ParILUDataSchurSolverPrintLevel(ilu_data) ((ilu_data) -> ss_print_level) + +#define FMRK -1 +#define CMRK 1 +#define UMRK 0 +#define S_CMRK 2 + +#define FPT(i, bsize) (((i) % (bsize)) == FMRK) +#define CPT(i, bsize) (((i) % (bsize)) == CMRK) + +#define MAT_TOL 1e-14 +#define EXPAND_FACT 1.3 + +/* NSH data structure */ + +typedef struct hypre_ParNSHData_struct +{ + /* solver information */ + HYPRE_Int global_solver; + hypre_ParCSRMatrix *matA; + hypre_ParCSRMatrix *matM; + hypre_ParVector *F; + hypre_ParVector *U; + hypre_ParVector *residual; + HYPRE_Real *rel_res_norms; + HYPRE_Int num_iterations; + HYPRE_Real *l1_norms; + HYPRE_Real final_rel_residual_norm; + HYPRE_Real tol; + HYPRE_Real operator_complexity; + HYPRE_Int logging; + HYPRE_Int print_level; + HYPRE_Int max_iter; + + /* common data slots */ + HYPRE_Real *droptol; /* 2 drop torelances for {MR, NSH}*/ + HYPRE_Int own_droptol_data; + + /* temp vectors for solve phase */ + hypre_ParVector *Utemp; + hypre_ParVector *Ftemp; + + /* data slots for local MR */ + HYPRE_Int mr_max_iter; + HYPRE_Real mr_tol; + HYPRE_Int mr_max_row_nnz; + HYPRE_Int mr_col_version; /* global version or column version MR */ + + /* data slots for global NSH */ + HYPRE_Int nsh_max_iter; + HYPRE_Real nsh_tol; + HYPRE_Int nsh_max_row_nnz; +} hypre_ParNSHData; + +#define hypre_ParNSHDataGlobalSolver(nsh_data) ((nsh_data) -> global_solver) +#define hypre_ParNSHDataMatA(nsh_data) ((nsh_data) -> matA) +#define hypre_ParNSHDataMatM(nsh_data) ((nsh_data) -> matM) +#define hypre_ParNSHDataF(nsh_data) ((nsh_data) -> F) +#define hypre_ParNSHDataU(nsh_data) ((nsh_data) -> U) +#define hypre_ParNSHDataResidual(nsh_data) ((nsh_data) -> residual) +#define hypre_ParNSHDataRelResNorms(nsh_data) ((nsh_data) -> rel_res_norms) +#define hypre_ParNSHDataNumIterations(nsh_data) ((nsh_data) -> num_iterations) +#define hypre_ParNSHDataL1Norms(nsh_data) ((nsh_data) -> l1_norms) +#define hypre_ParNSHDataFinalRelResidualNorm(nsh_data) ((nsh_data) -> final_rel_residual_norm) +#define hypre_ParNSHDataTol(nsh_data) ((nsh_data) -> tol) +#define hypre_ParNSHDataOperatorComplexity(nsh_data) ((nsh_data) -> operator_complexity) +#define hypre_ParNSHDataLogging(nsh_data) ((nsh_data) -> logging) +#define hypre_ParNSHDataPrintLevel(nsh_data) ((nsh_data) -> print_level) +#define hypre_ParNSHDataMaxIter(nsh_data) ((nsh_data) -> max_iter) +#define hypre_ParNSHDataDroptol(nsh_data) ((nsh_data) -> droptol) +#define hypre_ParNSHDataOwnDroptolData(nsh_data) ((nsh_data) -> own_droptol_data) +#define hypre_ParNSHDataUTemp(nsh_data) ((nsh_data) -> Utemp) +#define hypre_ParNSHDataFTemp(nsh_data) ((nsh_data) -> Ftemp) +#define hypre_ParNSHDataMRMaxIter(nsh_data) ((nsh_data) -> mr_max_iter) +#define hypre_ParNSHDataMRTol(nsh_data) ((nsh_data) -> mr_tol) +#define hypre_ParNSHDataMRMaxRowNnz(nsh_data) ((nsh_data) -> mr_max_row_nnz) +#define hypre_ParNSHDataMRColVersion(nsh_data) ((nsh_data) -> mr_col_version) +#define hypre_ParNSHDataNSHMaxIter(nsh_data) ((nsh_data) -> nsh_max_iter) +#define hypre_ParNSHDataNSHTol(nsh_data) ((nsh_data) -> nsh_tol) +#define hypre_ParNSHDataNSHMaxRowNnz(nsh_data) ((nsh_data) -> nsh_max_row_nnz) + +#endif /* #ifndef hypre_ParILU_DATA_HEADER */ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -785,756 +1463,1004 @@ typedef struct /* ads.c */ void *hypre_ADSCreate ( void ); HYPRE_Int hypre_ADSDestroy ( void *solver ); -HYPRE_Int hypre_ADSSetDiscreteCurl ( void *solver , hypre_ParCSRMatrix *C ); -HYPRE_Int hypre_ADSSetDiscreteGradient ( void *solver , hypre_ParCSRMatrix *G ); -HYPRE_Int hypre_ADSSetCoordinateVectors ( void *solver , hypre_ParVector *x , hypre_ParVector *y , hypre_ParVector *z ); -HYPRE_Int hypre_ADSSetInterpolations ( void *solver , hypre_ParCSRMatrix *RT_Pi , hypre_ParCSRMatrix *RT_Pix , hypre_ParCSRMatrix *RT_Piy , hypre_ParCSRMatrix *RT_Piz , hypre_ParCSRMatrix *ND_Pi , hypre_ParCSRMatrix *ND_Pix , hypre_ParCSRMatrix *ND_Piy , hypre_ParCSRMatrix *ND_Piz ); -HYPRE_Int hypre_ADSSetMaxIter ( void *solver , HYPRE_Int maxit ); -HYPRE_Int hypre_ADSSetTol ( void *solver , HYPRE_Real tol ); -HYPRE_Int hypre_ADSSetCycleType ( void *solver , HYPRE_Int cycle_type ); -HYPRE_Int hypre_ADSSetPrintLevel ( void *solver , HYPRE_Int print_level ); -HYPRE_Int hypre_ADSSetSmoothingOptions ( void *solver , HYPRE_Int A_relax_type , HYPRE_Int A_relax_times , HYPRE_Real A_relax_weight , HYPRE_Real A_omega ); -HYPRE_Int hypre_ADSSetChebySmoothingOptions ( void *solver , HYPRE_Int A_cheby_order , HYPRE_Int A_cheby_fraction ); -HYPRE_Int hypre_ADSSetAMSOptions ( void *solver , HYPRE_Int B_C_cycle_type , HYPRE_Int B_C_coarsen_type , HYPRE_Int B_C_agg_levels , HYPRE_Int B_C_relax_type , HYPRE_Real B_C_theta , HYPRE_Int B_C_interp_type , HYPRE_Int B_C_Pmax ); -HYPRE_Int hypre_ADSSetAMGOptions ( void *solver , HYPRE_Int B_Pi_coarsen_type , HYPRE_Int B_Pi_agg_levels , HYPRE_Int B_Pi_relax_type , HYPRE_Real B_Pi_theta , HYPRE_Int B_Pi_interp_type , HYPRE_Int B_Pi_Pmax ); -HYPRE_Int hypre_ADSComputePi ( hypre_ParCSRMatrix *A , hypre_ParCSRMatrix *C , hypre_ParCSRMatrix *G , hypre_ParVector *x , hypre_ParVector *y , hypre_ParVector *z , hypre_ParCSRMatrix *PiNDx , hypre_ParCSRMatrix *PiNDy , hypre_ParCSRMatrix *PiNDz , hypre_ParCSRMatrix **Pi_ptr ); -HYPRE_Int hypre_ADSComputePixyz ( hypre_ParCSRMatrix *A , hypre_ParCSRMatrix *C , hypre_ParCSRMatrix *G , hypre_ParVector *x , hypre_ParVector *y , hypre_ParVector *z , hypre_ParCSRMatrix *PiNDx , hypre_ParCSRMatrix *PiNDy , hypre_ParCSRMatrix *PiNDz , hypre_ParCSRMatrix **Pix_ptr , hypre_ParCSRMatrix **Piy_ptr , hypre_ParCSRMatrix **Piz_ptr ); -HYPRE_Int hypre_ADSSetup ( void *solver , hypre_ParCSRMatrix *A , hypre_ParVector *b , hypre_ParVector *x ); -HYPRE_Int hypre_ADSSolve ( void *solver , hypre_ParCSRMatrix *A , hypre_ParVector *b , hypre_ParVector *x ); -HYPRE_Int hypre_ADSGetNumIterations ( void *solver , HYPRE_Int *num_iterations ); -HYPRE_Int hypre_ADSGetFinalRelativeResidualNorm ( void *solver , HYPRE_Real *rel_resid_norm ); +HYPRE_Int hypre_ADSSetDiscreteCurl ( void *solver, hypre_ParCSRMatrix *C ); +HYPRE_Int hypre_ADSSetDiscreteGradient ( void *solver, hypre_ParCSRMatrix *G ); +HYPRE_Int hypre_ADSSetCoordinateVectors ( void *solver, hypre_ParVector *x, hypre_ParVector *y, + hypre_ParVector *z ); +HYPRE_Int hypre_ADSSetInterpolations ( void *solver, hypre_ParCSRMatrix *RT_Pi, + hypre_ParCSRMatrix *RT_Pix, hypre_ParCSRMatrix *RT_Piy, + hypre_ParCSRMatrix *RT_Piz, hypre_ParCSRMatrix *ND_Pi, + hypre_ParCSRMatrix *ND_Pix, hypre_ParCSRMatrix *ND_Piy, + hypre_ParCSRMatrix *ND_Piz ); +HYPRE_Int hypre_ADSSetMaxIter ( void *solver, HYPRE_Int maxit ); +HYPRE_Int hypre_ADSSetTol ( void *solver, HYPRE_Real tol ); +HYPRE_Int hypre_ADSSetCycleType ( void *solver, HYPRE_Int cycle_type ); +HYPRE_Int hypre_ADSSetPrintLevel ( void *solver, HYPRE_Int print_level ); +HYPRE_Int hypre_ADSSetSmoothingOptions ( void *solver, HYPRE_Int A_relax_type, + HYPRE_Int A_relax_times, HYPRE_Real A_relax_weight, HYPRE_Real A_omega ); +HYPRE_Int hypre_ADSSetChebySmoothingOptions ( void *solver, HYPRE_Int A_cheby_order, + HYPRE_Real A_cheby_fraction ); +HYPRE_Int hypre_ADSSetAMSOptions ( void *solver, HYPRE_Int B_C_cycle_type, + HYPRE_Int B_C_coarsen_type, HYPRE_Int B_C_agg_levels, HYPRE_Int B_C_relax_type, + HYPRE_Real B_C_theta, HYPRE_Int B_C_interp_type, HYPRE_Int B_C_Pmax ); +HYPRE_Int hypre_ADSSetAMGOptions ( void *solver, HYPRE_Int B_Pi_coarsen_type, + HYPRE_Int B_Pi_agg_levels, HYPRE_Int B_Pi_relax_type, HYPRE_Real B_Pi_theta, + HYPRE_Int B_Pi_interp_type, HYPRE_Int B_Pi_Pmax ); +HYPRE_Int hypre_ADSComputePi ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *C, hypre_ParCSRMatrix *G, + hypre_ParVector *x, hypre_ParVector *y, hypre_ParVector *z, hypre_ParCSRMatrix *PiNDx, + hypre_ParCSRMatrix *PiNDy, hypre_ParCSRMatrix *PiNDz, hypre_ParCSRMatrix **Pi_ptr ); +HYPRE_Int hypre_ADSComputePixyz ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *C, + hypre_ParCSRMatrix *G, hypre_ParVector *x, hypre_ParVector *y, hypre_ParVector *z, + hypre_ParCSRMatrix *PiNDx, hypre_ParCSRMatrix *PiNDy, hypre_ParCSRMatrix *PiNDz, + hypre_ParCSRMatrix **Pix_ptr, hypre_ParCSRMatrix **Piy_ptr, hypre_ParCSRMatrix **Piz_ptr ); +HYPRE_Int hypre_ADSSetup ( void *solver, hypre_ParCSRMatrix *A, hypre_ParVector *b, + hypre_ParVector *x ); +HYPRE_Int hypre_ADSSolve ( void *solver, hypre_ParCSRMatrix *A, hypre_ParVector *b, + hypre_ParVector *x ); +HYPRE_Int hypre_ADSGetNumIterations ( void *solver, HYPRE_Int *num_iterations ); +HYPRE_Int hypre_ADSGetFinalRelativeResidualNorm ( void *solver, HYPRE_Real *rel_resid_norm ); /* ame.c */ void *hypre_AMECreate ( void ); HYPRE_Int hypre_AMEDestroy ( void *esolver ); -HYPRE_Int hypre_AMESetAMSSolver ( void *esolver , void *ams_solver ); -HYPRE_Int hypre_AMESetMassMatrix ( void *esolver , hypre_ParCSRMatrix *M ); -HYPRE_Int hypre_AMESetBlockSize ( void *esolver , HYPRE_Int block_size ); -HYPRE_Int hypre_AMESetMaxIter ( void *esolver , HYPRE_Int maxit ); -HYPRE_Int hypre_AMESetTol ( void *esolver , HYPRE_Real tol ); -HYPRE_Int hypre_AMESetRTol ( void *esolver , HYPRE_Real tol ); -HYPRE_Int hypre_AMESetPrintLevel ( void *esolver , HYPRE_Int print_level ); +HYPRE_Int hypre_AMESetAMSSolver ( void *esolver, void *ams_solver ); +HYPRE_Int hypre_AMESetMassMatrix ( void *esolver, hypre_ParCSRMatrix *M ); +HYPRE_Int hypre_AMESetBlockSize ( void *esolver, HYPRE_Int block_size ); +HYPRE_Int hypre_AMESetMaxIter ( void *esolver, HYPRE_Int maxit ); +HYPRE_Int hypre_AMESetMaxPCGIter ( void *esolver, HYPRE_Int maxit ); +HYPRE_Int hypre_AMESetTol ( void *esolver, HYPRE_Real tol ); +HYPRE_Int hypre_AMESetRTol ( void *esolver, HYPRE_Real tol ); +HYPRE_Int hypre_AMESetPrintLevel ( void *esolver, HYPRE_Int print_level ); HYPRE_Int hypre_AMESetup ( void *esolver ); -HYPRE_Int hypre_AMEDiscrDivFreeComponent ( void *esolver , hypre_ParVector *b ); -void hypre_AMEOperatorA ( void *data , void *x , void *y ); -void hypre_AMEMultiOperatorA ( void *data , void *x , void *y ); -void hypre_AMEOperatorM ( void *data , void *x , void *y ); -void hypre_AMEMultiOperatorM ( void *data , void *x , void *y ); -void hypre_AMEOperatorB ( void *data , void *x , void *y ); -void hypre_AMEMultiOperatorB ( void *data , void *x , void *y ); +HYPRE_Int hypre_AMEDiscrDivFreeComponent ( void *esolver, hypre_ParVector *b ); +void hypre_AMEOperatorA ( void *data, void *x, void *y ); +void hypre_AMEMultiOperatorA ( void *data, void *x, void *y ); +void hypre_AMEOperatorM ( void *data, void *x, void *y ); +void hypre_AMEMultiOperatorM ( void *data, void *x, void *y ); +void hypre_AMEOperatorB ( void *data, void *x, void *y ); +void hypre_AMEMultiOperatorB ( void *data, void *x, void *y ); HYPRE_Int hypre_AMESolve ( void *esolver ); -HYPRE_Int hypre_AMEGetEigenvectors ( void *esolver , HYPRE_ParVector **eigenvectors_ptr ); -HYPRE_Int hypre_AMEGetEigenvalues ( void *esolver , HYPRE_Real **eigenvalues_ptr ); +HYPRE_Int hypre_AMEGetEigenvectors ( void *esolver, HYPRE_ParVector **eigenvectors_ptr ); +HYPRE_Int hypre_AMEGetEigenvalues ( void *esolver, HYPRE_Real **eigenvalues_ptr ); /* amg_hybrid.c */ void *hypre_AMGHybridCreate ( void ); HYPRE_Int hypre_AMGHybridDestroy ( void *AMGhybrid_vdata ); -HYPRE_Int hypre_AMGHybridSetTol ( void *AMGhybrid_vdata , HYPRE_Real tol ); -HYPRE_Int hypre_AMGHybridSetAbsoluteTol ( void *AMGhybrid_vdata , HYPRE_Real a_tol ); -HYPRE_Int hypre_AMGHybridSetConvergenceTol ( void *AMGhybrid_vdata , HYPRE_Real cf_tol ); -HYPRE_Int hypre_AMGHybridSetNonGalerkinTol ( void *AMGhybrid_vdata , HYPRE_Int nongalerk_num_tol, HYPRE_Real *nongalerkin_tol ); -HYPRE_Int hypre_AMGHybridSetDSCGMaxIter ( void *AMGhybrid_vdata , HYPRE_Int dscg_max_its ); -HYPRE_Int hypre_AMGHybridSetPCGMaxIter ( void *AMGhybrid_vdata , HYPRE_Int pcg_max_its ); -HYPRE_Int hypre_AMGHybridSetSetupType ( void *AMGhybrid_vdata , HYPRE_Int setup_type ); -HYPRE_Int hypre_AMGHybridSetSolverType ( void *AMGhybrid_vdata , HYPRE_Int solver_type ); -HYPRE_Int hypre_AMGHybridSetRecomputeResidual ( void *AMGhybrid_vdata , HYPRE_Int recompute_residual ); -HYPRE_Int hypre_AMGHybridGetRecomputeResidual ( void *AMGhybrid_vdata , HYPRE_Int *recompute_residual ); -HYPRE_Int hypre_AMGHybridSetRecomputeResidualP ( void *AMGhybrid_vdata , HYPRE_Int recompute_residual_p ); -HYPRE_Int hypre_AMGHybridGetRecomputeResidualP ( void *AMGhybrid_vdata , HYPRE_Int *recompute_residual_p ); -HYPRE_Int hypre_AMGHybridSetKDim ( void *AMGhybrid_vdata , HYPRE_Int k_dim ); -HYPRE_Int hypre_AMGHybridSetStopCrit ( void *AMGhybrid_vdata , HYPRE_Int stop_crit ); -HYPRE_Int hypre_AMGHybridSetTwoNorm ( void *AMGhybrid_vdata , HYPRE_Int two_norm ); -HYPRE_Int hypre_AMGHybridSetRelChange ( void *AMGhybrid_vdata , HYPRE_Int rel_change ); -HYPRE_Int hypre_AMGHybridSetPrecond ( void *pcg_vdata , HYPRE_Int (*pcg_precond_solve )(void*,void*,void*,void*), HYPRE_Int (*pcg_precond_setup )(void*,void*,void*,void*), void *pcg_precond ); -HYPRE_Int hypre_AMGHybridSetLogging ( void *AMGhybrid_vdata , HYPRE_Int logging ); -HYPRE_Int hypre_AMGHybridSetPrintLevel ( void *AMGhybrid_vdata , HYPRE_Int print_level ); -HYPRE_Int hypre_AMGHybridSetStrongThreshold ( void *AMGhybrid_vdata , HYPRE_Real strong_threshold ); -HYPRE_Int hypre_AMGHybridSetMaxRowSum ( void *AMGhybrid_vdata , HYPRE_Real max_row_sum ); -HYPRE_Int hypre_AMGHybridSetTruncFactor ( void *AMGhybrid_vdata , HYPRE_Real trunc_factor ); -HYPRE_Int hypre_AMGHybridSetPMaxElmts ( void *AMGhybrid_vdata , HYPRE_Int P_max_elmts ); -HYPRE_Int hypre_AMGHybridSetMaxLevels ( void *AMGhybrid_vdata , HYPRE_Int max_levels ); -HYPRE_Int hypre_AMGHybridSetMeasureType ( void *AMGhybrid_vdata , HYPRE_Int measure_type ); -HYPRE_Int hypre_AMGHybridSetCoarsenType ( void *AMGhybrid_vdata , HYPRE_Int coarsen_type ); -HYPRE_Int hypre_AMGHybridSetInterpType ( void *AMGhybrid_vdata , HYPRE_Int interp_type ); -HYPRE_Int hypre_AMGHybridSetCycleType ( void *AMGhybrid_vdata , HYPRE_Int cycle_type ); -HYPRE_Int hypre_AMGHybridSetNumSweeps ( void *AMGhybrid_vdata , HYPRE_Int num_sweeps ); -HYPRE_Int hypre_AMGHybridSetCycleNumSweeps ( void *AMGhybrid_vdata , HYPRE_Int num_sweeps , HYPRE_Int k ); -HYPRE_Int hypre_AMGHybridSetRelaxType ( void *AMGhybrid_vdata , HYPRE_Int relax_type ); -HYPRE_Int hypre_AMGHybridSetKeepTranspose ( void *AMGhybrid_vdata , HYPRE_Int keepT ); -HYPRE_Int hypre_AMGHybridSetSplittingStrategy( void *AMGhybrid_vdata , HYPRE_Int splitting_strategy ); -HYPRE_Int hypre_AMGHybridSetCycleRelaxType ( void *AMGhybrid_vdata , HYPRE_Int relax_type , HYPRE_Int k ); -HYPRE_Int hypre_AMGHybridSetRelaxOrder ( void *AMGhybrid_vdata , HYPRE_Int relax_order ); -HYPRE_Int hypre_AMGHybridSetMaxCoarseSize ( void *AMGhybrid_vdata , HYPRE_Int max_coarse_size ); -HYPRE_Int hypre_AMGHybridSetMinCoarseSize ( void *AMGhybrid_vdata , HYPRE_Int min_coarse_size ); -HYPRE_Int hypre_AMGHybridSetSeqThreshold ( void *AMGhybrid_vdata , HYPRE_Int seq_threshold ); -HYPRE_Int hypre_AMGHybridSetNumGridSweeps ( void *AMGhybrid_vdata , HYPRE_Int *num_grid_sweeps ); -HYPRE_Int hypre_AMGHybridSetGridRelaxType ( void *AMGhybrid_vdata , HYPRE_Int *grid_relax_type ); -HYPRE_Int hypre_AMGHybridSetGridRelaxPoints ( void *AMGhybrid_vdata , HYPRE_Int **grid_relax_points ); -HYPRE_Int hypre_AMGHybridSetRelaxWeight ( void *AMGhybrid_vdata , HYPRE_Real *relax_weight ); -HYPRE_Int hypre_AMGHybridSetOmega ( void *AMGhybrid_vdata , HYPRE_Real *omega ); -HYPRE_Int hypre_AMGHybridSetRelaxWt ( void *AMGhybrid_vdata , HYPRE_Real relax_wt ); -HYPRE_Int hypre_AMGHybridSetLevelRelaxWt ( void *AMGhybrid_vdata , HYPRE_Real relax_wt , HYPRE_Int level ); -HYPRE_Int hypre_AMGHybridSetOuterWt ( void *AMGhybrid_vdata , HYPRE_Real outer_wt ); -HYPRE_Int hypre_AMGHybridSetLevelOuterWt ( void *AMGhybrid_vdata , HYPRE_Real outer_wt , HYPRE_Int level ); -HYPRE_Int hypre_AMGHybridSetNumPaths ( void *AMGhybrid_vdata , HYPRE_Int num_paths ); -HYPRE_Int hypre_AMGHybridSetDofFunc ( void *AMGhybrid_vdata , HYPRE_Int *dof_func ); -HYPRE_Int hypre_AMGHybridSetAggNumLevels ( void *AMGhybrid_vdata , HYPRE_Int agg_num_levels ); -HYPRE_Int hypre_AMGHybridSetAggInterpType ( void *AMGhybrid_vdata , HYPRE_Int agg_interp_type ); -HYPRE_Int hypre_AMGHybridSetNumFunctions ( void *AMGhybrid_vdata , HYPRE_Int num_functions ); -HYPRE_Int hypre_AMGHybridSetNodal ( void *AMGhybrid_vdata , HYPRE_Int nodal ); +HYPRE_Int hypre_AMGHybridSetTol ( void *AMGhybrid_vdata, HYPRE_Real tol ); +HYPRE_Int hypre_AMGHybridSetAbsoluteTol ( void *AMGhybrid_vdata, HYPRE_Real a_tol ); +HYPRE_Int hypre_AMGHybridSetConvergenceTol ( void *AMGhybrid_vdata, HYPRE_Real cf_tol ); +HYPRE_Int hypre_AMGHybridSetNonGalerkinTol ( void *AMGhybrid_vdata, HYPRE_Int nongalerk_num_tol, + HYPRE_Real *nongalerkin_tol ); +HYPRE_Int hypre_AMGHybridSetDSCGMaxIter ( void *AMGhybrid_vdata, HYPRE_Int dscg_max_its ); +HYPRE_Int hypre_AMGHybridSetPCGMaxIter ( void *AMGhybrid_vdata, HYPRE_Int pcg_max_its ); +HYPRE_Int hypre_AMGHybridSetSetupType ( void *AMGhybrid_vdata, HYPRE_Int setup_type ); +HYPRE_Int hypre_AMGHybridSetSolverType ( void *AMGhybrid_vdata, HYPRE_Int solver_type ); +HYPRE_Int hypre_AMGHybridSetRecomputeResidual ( void *AMGhybrid_vdata, + HYPRE_Int recompute_residual ); +HYPRE_Int hypre_AMGHybridGetRecomputeResidual ( void *AMGhybrid_vdata, + HYPRE_Int *recompute_residual ); +HYPRE_Int hypre_AMGHybridSetRecomputeResidualP ( void *AMGhybrid_vdata, + HYPRE_Int recompute_residual_p ); +HYPRE_Int hypre_AMGHybridGetRecomputeResidualP ( void *AMGhybrid_vdata, + HYPRE_Int *recompute_residual_p ); +HYPRE_Int hypre_AMGHybridSetKDim ( void *AMGhybrid_vdata, HYPRE_Int k_dim ); +HYPRE_Int hypre_AMGHybridSetStopCrit ( void *AMGhybrid_vdata, HYPRE_Int stop_crit ); +HYPRE_Int hypre_AMGHybridSetTwoNorm ( void *AMGhybrid_vdata, HYPRE_Int two_norm ); +HYPRE_Int hypre_AMGHybridSetRelChange ( void *AMGhybrid_vdata, HYPRE_Int rel_change ); +HYPRE_Int hypre_AMGHybridSetPrecond ( void *pcg_vdata, HYPRE_Int (*pcg_precond_solve )(void*, void*, + void*, void*), HYPRE_Int (*pcg_precond_setup )(void*, void*, void*, void*), void *pcg_precond ); +HYPRE_Int hypre_AMGHybridSetLogging ( void *AMGhybrid_vdata, HYPRE_Int logging ); +HYPRE_Int hypre_AMGHybridSetPrintLevel ( void *AMGhybrid_vdata, HYPRE_Int print_level ); +HYPRE_Int hypre_AMGHybridSetStrongThreshold ( void *AMGhybrid_vdata, HYPRE_Real strong_threshold ); +HYPRE_Int hypre_AMGHybridSetMaxRowSum ( void *AMGhybrid_vdata, HYPRE_Real max_row_sum ); +HYPRE_Int hypre_AMGHybridSetTruncFactor ( void *AMGhybrid_vdata, HYPRE_Real trunc_factor ); +HYPRE_Int hypre_AMGHybridSetPMaxElmts ( void *AMGhybrid_vdata, HYPRE_Int P_max_elmts ); +HYPRE_Int hypre_AMGHybridSetMaxLevels ( void *AMGhybrid_vdata, HYPRE_Int max_levels ); +HYPRE_Int hypre_AMGHybridSetMeasureType ( void *AMGhybrid_vdata, HYPRE_Int measure_type ); +HYPRE_Int hypre_AMGHybridSetCoarsenType ( void *AMGhybrid_vdata, HYPRE_Int coarsen_type ); +HYPRE_Int hypre_AMGHybridSetInterpType ( void *AMGhybrid_vdata, HYPRE_Int interp_type ); +HYPRE_Int hypre_AMGHybridSetCycleType ( void *AMGhybrid_vdata, HYPRE_Int cycle_type ); +HYPRE_Int hypre_AMGHybridSetNumSweeps ( void *AMGhybrid_vdata, HYPRE_Int num_sweeps ); +HYPRE_Int hypre_AMGHybridSetCycleNumSweeps ( void *AMGhybrid_vdata, HYPRE_Int num_sweeps, + HYPRE_Int k ); +HYPRE_Int hypre_AMGHybridSetRelaxType ( void *AMGhybrid_vdata, HYPRE_Int relax_type ); +HYPRE_Int hypre_AMGHybridSetKeepTranspose ( void *AMGhybrid_vdata, HYPRE_Int keepT ); +HYPRE_Int hypre_AMGHybridSetSplittingStrategy( void *AMGhybrid_vdata, + HYPRE_Int splitting_strategy ); +HYPRE_Int hypre_AMGHybridSetCycleRelaxType ( void *AMGhybrid_vdata, HYPRE_Int relax_type, + HYPRE_Int k ); +HYPRE_Int hypre_AMGHybridSetRelaxOrder ( void *AMGhybrid_vdata, HYPRE_Int relax_order ); +HYPRE_Int hypre_AMGHybridSetMaxCoarseSize ( void *AMGhybrid_vdata, HYPRE_Int max_coarse_size ); +HYPRE_Int hypre_AMGHybridSetMinCoarseSize ( void *AMGhybrid_vdata, HYPRE_Int min_coarse_size ); +HYPRE_Int hypre_AMGHybridSetSeqThreshold ( void *AMGhybrid_vdata, HYPRE_Int seq_threshold ); +HYPRE_Int hypre_AMGHybridSetNumGridSweeps ( void *AMGhybrid_vdata, HYPRE_Int *num_grid_sweeps ); +HYPRE_Int hypre_AMGHybridSetGridRelaxType ( void *AMGhybrid_vdata, HYPRE_Int *grid_relax_type ); +HYPRE_Int hypre_AMGHybridSetGridRelaxPoints ( void *AMGhybrid_vdata, + HYPRE_Int **grid_relax_points ); +HYPRE_Int hypre_AMGHybridSetRelaxWeight ( void *AMGhybrid_vdata, HYPRE_Real *relax_weight ); +HYPRE_Int hypre_AMGHybridSetOmega ( void *AMGhybrid_vdata, HYPRE_Real *omega ); +HYPRE_Int hypre_AMGHybridSetRelaxWt ( void *AMGhybrid_vdata, HYPRE_Real relax_wt ); +HYPRE_Int hypre_AMGHybridSetLevelRelaxWt ( void *AMGhybrid_vdata, HYPRE_Real relax_wt, + HYPRE_Int level ); +HYPRE_Int hypre_AMGHybridSetOuterWt ( void *AMGhybrid_vdata, HYPRE_Real outer_wt ); +HYPRE_Int hypre_AMGHybridSetLevelOuterWt ( void *AMGhybrid_vdata, HYPRE_Real outer_wt, + HYPRE_Int level ); +HYPRE_Int hypre_AMGHybridSetNumPaths ( void *AMGhybrid_vdata, HYPRE_Int num_paths ); +HYPRE_Int hypre_AMGHybridSetDofFunc ( void *AMGhybrid_vdata, HYPRE_Int *dof_func ); +HYPRE_Int hypre_AMGHybridSetAggNumLevels ( void *AMGhybrid_vdata, HYPRE_Int agg_num_levels ); +HYPRE_Int hypre_AMGHybridSetAggInterpType ( void *AMGhybrid_vdata, HYPRE_Int agg_interp_type ); +HYPRE_Int hypre_AMGHybridSetNumFunctions ( void *AMGhybrid_vdata, HYPRE_Int num_functions ); +HYPRE_Int hypre_AMGHybridSetNodal ( void *AMGhybrid_vdata, HYPRE_Int nodal ); HYPRE_Int hypre_AMGHybridGetSetupSolveTime( void *AMGhybrid_vdata, HYPRE_Real *time ); -HYPRE_Int hypre_AMGHybridGetNumIterations ( void *AMGhybrid_vdata , HYPRE_Int *num_its ); -HYPRE_Int hypre_AMGHybridGetDSCGNumIterations ( void *AMGhybrid_vdata , HYPRE_Int *dscg_num_its ); -HYPRE_Int hypre_AMGHybridGetPCGNumIterations ( void *AMGhybrid_vdata , HYPRE_Int *pcg_num_its ); -HYPRE_Int hypre_AMGHybridGetFinalRelativeResidualNorm ( void *AMGhybrid_vdata , HYPRE_Real *final_rel_res_norm ); -HYPRE_Int hypre_AMGHybridSetup ( void *AMGhybrid_vdata , hypre_ParCSRMatrix *A , hypre_ParVector *b , hypre_ParVector *x ); -HYPRE_Int hypre_AMGHybridSolve ( void *AMGhybrid_vdata , hypre_ParCSRMatrix *A , hypre_ParVector *b , hypre_ParVector *x ); +HYPRE_Int hypre_AMGHybridGetNumIterations ( void *AMGhybrid_vdata, HYPRE_Int *num_its ); +HYPRE_Int hypre_AMGHybridGetDSCGNumIterations ( void *AMGhybrid_vdata, HYPRE_Int *dscg_num_its ); +HYPRE_Int hypre_AMGHybridGetPCGNumIterations ( void *AMGhybrid_vdata, HYPRE_Int *pcg_num_its ); +HYPRE_Int hypre_AMGHybridGetFinalRelativeResidualNorm ( void *AMGhybrid_vdata, + HYPRE_Real *final_rel_res_norm ); +HYPRE_Int hypre_AMGHybridSetup ( void *AMGhybrid_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *b, + hypre_ParVector *x ); +HYPRE_Int hypre_AMGHybridSolve ( void *AMGhybrid_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *b, + hypre_ParVector *x ); /* ams.c */ -HYPRE_Int hypre_ParCSRRelax ( hypre_ParCSRMatrix *A , hypre_ParVector *f , HYPRE_Int relax_type , HYPRE_Int relax_times , HYPRE_Real *l1_norms , HYPRE_Real relax_weight , HYPRE_Real omega , HYPRE_Real max_eig_est , HYPRE_Real min_eig_est , HYPRE_Int cheby_order , HYPRE_Real cheby_fraction , hypre_ParVector *u , hypre_ParVector *v , hypre_ParVector *z ); +HYPRE_Int hypre_ParCSRRelax ( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int relax_type, + HYPRE_Int relax_times, HYPRE_Real *l1_norms, HYPRE_Real relax_weight, HYPRE_Real omega, + HYPRE_Real max_eig_est, HYPRE_Real min_eig_est, HYPRE_Int cheby_order, HYPRE_Real cheby_fraction, + hypre_ParVector *u, hypre_ParVector *v, hypre_ParVector *z ); hypre_ParVector *hypre_ParVectorInRangeOf ( hypre_ParCSRMatrix *A ); hypre_ParVector *hypre_ParVectorInDomainOf ( hypre_ParCSRMatrix *A ); -HYPRE_Int hypre_ParVectorBlockSplit ( hypre_ParVector *x , hypre_ParVector *x_ [3 ], HYPRE_Int dim ); -HYPRE_Int hypre_ParVectorBlockGather ( hypre_ParVector *x , hypre_ParVector *x_ [3 ], HYPRE_Int dim ); -HYPRE_Int hypre_BoomerAMGBlockSolve ( void *B , hypre_ParCSRMatrix *A , hypre_ParVector *b , hypre_ParVector *x ); +HYPRE_Int hypre_ParVectorBlockSplit ( hypre_ParVector *x, hypre_ParVector *x_ [3 ], HYPRE_Int dim ); +HYPRE_Int hypre_ParVectorBlockGather ( hypre_ParVector *x, hypre_ParVector *x_ [3 ], + HYPRE_Int dim ); +HYPRE_Int hypre_BoomerAMGBlockSolve ( void *B, hypre_ParCSRMatrix *A, hypre_ParVector *b, + hypre_ParVector *x ); HYPRE_Int hypre_ParCSRMatrixFixZeroRows ( hypre_ParCSRMatrix *A ); -HYPRE_Int hypre_ParCSRComputeL1Norms ( hypre_ParCSRMatrix *A , HYPRE_Int option , HYPRE_Int *cf_marker , HYPRE_Real **l1_norm_ptr ); -HYPRE_Int hypre_ParCSRMatrixSetDiagRows ( hypre_ParCSRMatrix *A , HYPRE_Real d ); +HYPRE_Int hypre_ParCSRComputeL1Norms ( hypre_ParCSRMatrix *A, HYPRE_Int option, + HYPRE_Int *cf_marker, HYPRE_Real **l1_norm_ptr ); +HYPRE_Int hypre_ParCSRMatrixSetDiagRows ( hypre_ParCSRMatrix *A, HYPRE_Real d ); void *hypre_AMSCreate ( void ); HYPRE_Int hypre_AMSDestroy ( void *solver ); -HYPRE_Int hypre_AMSSetDimension ( void *solver , HYPRE_Int dim ); -HYPRE_Int hypre_AMSSetDiscreteGradient ( void *solver , hypre_ParCSRMatrix *G ); -HYPRE_Int hypre_AMSSetCoordinateVectors ( void *solver , hypre_ParVector *x , hypre_ParVector *y , hypre_ParVector *z ); -HYPRE_Int hypre_AMSSetEdgeConstantVectors ( void *solver , hypre_ParVector *Gx , hypre_ParVector *Gy , hypre_ParVector *Gz ); -HYPRE_Int hypre_AMSSetInterpolations ( void *solver , hypre_ParCSRMatrix *Pi , hypre_ParCSRMatrix *Pix , hypre_ParCSRMatrix *Piy , hypre_ParCSRMatrix *Piz ); -HYPRE_Int hypre_AMSSetAlphaPoissonMatrix ( void *solver , hypre_ParCSRMatrix *A_Pi ); -HYPRE_Int hypre_AMSSetBetaPoissonMatrix ( void *solver , hypre_ParCSRMatrix *A_G ); -HYPRE_Int hypre_AMSSetInteriorNodes ( void *solver , hypre_ParVector *interior_nodes ); -HYPRE_Int hypre_AMSSetProjectionFrequency ( void *solver , HYPRE_Int projection_frequency ); -HYPRE_Int hypre_AMSSetMaxIter ( void *solver , HYPRE_Int maxit ); -HYPRE_Int hypre_AMSSetTol ( void *solver , HYPRE_Real tol ); -HYPRE_Int hypre_AMSSetCycleType ( void *solver , HYPRE_Int cycle_type ); -HYPRE_Int hypre_AMSSetPrintLevel ( void *solver , HYPRE_Int print_level ); -HYPRE_Int hypre_AMSSetSmoothingOptions ( void *solver , HYPRE_Int A_relax_type , HYPRE_Int A_relax_times , HYPRE_Real A_relax_weight , HYPRE_Real A_omega ); -HYPRE_Int hypre_AMSSetChebySmoothingOptions ( void *solver , HYPRE_Int A_cheby_order , HYPRE_Int A_cheby_fraction ); -HYPRE_Int hypre_AMSSetAlphaAMGOptions ( void *solver , HYPRE_Int B_Pi_coarsen_type , HYPRE_Int B_Pi_agg_levels , HYPRE_Int B_Pi_relax_type , HYPRE_Real B_Pi_theta , HYPRE_Int B_Pi_interp_type , HYPRE_Int B_Pi_Pmax ); -HYPRE_Int hypre_AMSSetAlphaAMGCoarseRelaxType ( void *solver , HYPRE_Int B_Pi_coarse_relax_type ); -HYPRE_Int hypre_AMSSetBetaAMGOptions ( void *solver , HYPRE_Int B_G_coarsen_type , HYPRE_Int B_G_agg_levels , HYPRE_Int B_G_relax_type , HYPRE_Real B_G_theta , HYPRE_Int B_G_interp_type , HYPRE_Int B_G_Pmax ); -HYPRE_Int hypre_AMSSetBetaAMGCoarseRelaxType ( void *solver , HYPRE_Int B_G_coarse_relax_type ); -HYPRE_Int hypre_AMSComputePi ( hypre_ParCSRMatrix *A , hypre_ParCSRMatrix *G , hypre_ParVector *Gx , hypre_ParVector *Gy , hypre_ParVector *Gz , HYPRE_Int dim , hypre_ParCSRMatrix **Pi_ptr ); -HYPRE_Int hypre_AMSComputePixyz ( hypre_ParCSRMatrix *A , hypre_ParCSRMatrix *G , hypre_ParVector *Gx , hypre_ParVector *Gy , hypre_ParVector *Gz , HYPRE_Int dim , hypre_ParCSRMatrix **Pix_ptr , hypre_ParCSRMatrix **Piy_ptr , hypre_ParCSRMatrix **Piz_ptr ); -HYPRE_Int hypre_AMSComputeGPi ( hypre_ParCSRMatrix *A , hypre_ParCSRMatrix *G , hypre_ParVector *Gx , hypre_ParVector *Gy , hypre_ParVector *Gz , HYPRE_Int dim , hypre_ParCSRMatrix **GPi_ptr ); -HYPRE_Int hypre_AMSSetup ( void *solver , hypre_ParCSRMatrix *A , hypre_ParVector *b , hypre_ParVector *x ); -HYPRE_Int hypre_AMSSolve ( void *solver , hypre_ParCSRMatrix *A , hypre_ParVector *b , hypre_ParVector *x ); -HYPRE_Int hypre_ParCSRSubspacePrec ( hypre_ParCSRMatrix *A0 , HYPRE_Int A0_relax_type , HYPRE_Int A0_relax_times , HYPRE_Real *A0_l1_norms , HYPRE_Real A0_relax_weight , HYPRE_Real A0_omega , HYPRE_Real A0_max_eig_est , HYPRE_Real A0_min_eig_est , HYPRE_Int A0_cheby_order , HYPRE_Real A0_cheby_fraction , hypre_ParCSRMatrix **A , HYPRE_Solver *B , HYPRE_PtrToSolverFcn *HB , hypre_ParCSRMatrix **P , hypre_ParVector **r , hypre_ParVector **g , hypre_ParVector *x , hypre_ParVector *y , hypre_ParVector *r0 , hypre_ParVector *g0 , char *cycle , hypre_ParVector *z ); -HYPRE_Int hypre_AMSGetNumIterations ( void *solver , HYPRE_Int *num_iterations ); -HYPRE_Int hypre_AMSGetFinalRelativeResidualNorm ( void *solver , HYPRE_Real *rel_resid_norm ); -HYPRE_Int hypre_AMSProjectOutGradients ( void *solver , hypre_ParVector *x ); -HYPRE_Int hypre_AMSConstructDiscreteGradient ( hypre_ParCSRMatrix *A , hypre_ParVector *x_coord , HYPRE_BigInt *edge_vertex , HYPRE_Int edge_orientation , hypre_ParCSRMatrix **G_ptr ); -HYPRE_Int hypre_AMSFEISetup ( void *solver , hypre_ParCSRMatrix *A , hypre_ParVector *b , hypre_ParVector *x , HYPRE_Int num_vert , HYPRE_Int num_local_vert , HYPRE_BigInt *vert_number , HYPRE_Real *vert_coord , HYPRE_Int num_edges , HYPRE_BigInt *edge_vertex ); +HYPRE_Int hypre_AMSSetDimension ( void *solver, HYPRE_Int dim ); +HYPRE_Int hypre_AMSSetDiscreteGradient ( void *solver, hypre_ParCSRMatrix *G ); +HYPRE_Int hypre_AMSSetCoordinateVectors ( void *solver, hypre_ParVector *x, hypre_ParVector *y, + hypre_ParVector *z ); +HYPRE_Int hypre_AMSSetEdgeConstantVectors ( void *solver, hypre_ParVector *Gx, hypre_ParVector *Gy, + hypre_ParVector *Gz ); +HYPRE_Int hypre_AMSSetInterpolations ( void *solver, hypre_ParCSRMatrix *Pi, + hypre_ParCSRMatrix *Pix, hypre_ParCSRMatrix *Piy, hypre_ParCSRMatrix *Piz ); +HYPRE_Int hypre_AMSSetAlphaPoissonMatrix ( void *solver, hypre_ParCSRMatrix *A_Pi ); +HYPRE_Int hypre_AMSSetBetaPoissonMatrix ( void *solver, hypre_ParCSRMatrix *A_G ); +HYPRE_Int hypre_AMSSetInteriorNodes ( void *solver, hypre_ParVector *interior_nodes ); +HYPRE_Int hypre_AMSSetProjectionFrequency ( void *solver, HYPRE_Int projection_frequency ); +HYPRE_Int hypre_AMSSetMaxIter ( void *solver, HYPRE_Int maxit ); +HYPRE_Int hypre_AMSSetTol ( void *solver, HYPRE_Real tol ); +HYPRE_Int hypre_AMSSetCycleType ( void *solver, HYPRE_Int cycle_type ); +HYPRE_Int hypre_AMSSetPrintLevel ( void *solver, HYPRE_Int print_level ); +HYPRE_Int hypre_AMSSetSmoothingOptions ( void *solver, HYPRE_Int A_relax_type, + HYPRE_Int A_relax_times, HYPRE_Real A_relax_weight, HYPRE_Real A_omega ); +HYPRE_Int hypre_AMSSetChebySmoothingOptions ( void *solver, HYPRE_Int A_cheby_order, + HYPRE_Real A_cheby_fraction ); +HYPRE_Int hypre_AMSSetAlphaAMGOptions ( void *solver, HYPRE_Int B_Pi_coarsen_type, + HYPRE_Int B_Pi_agg_levels, HYPRE_Int B_Pi_relax_type, HYPRE_Real B_Pi_theta, + HYPRE_Int B_Pi_interp_type, HYPRE_Int B_Pi_Pmax ); +HYPRE_Int hypre_AMSSetAlphaAMGCoarseRelaxType ( void *solver, HYPRE_Int B_Pi_coarse_relax_type ); +HYPRE_Int hypre_AMSSetBetaAMGOptions ( void *solver, HYPRE_Int B_G_coarsen_type, + HYPRE_Int B_G_agg_levels, HYPRE_Int B_G_relax_type, HYPRE_Real B_G_theta, HYPRE_Int B_G_interp_type, + HYPRE_Int B_G_Pmax ); +HYPRE_Int hypre_AMSSetBetaAMGCoarseRelaxType ( void *solver, HYPRE_Int B_G_coarse_relax_type ); +HYPRE_Int hypre_AMSComputePi ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *G, hypre_ParVector *Gx, + hypre_ParVector *Gy, hypre_ParVector *Gz, HYPRE_Int dim, hypre_ParCSRMatrix **Pi_ptr ); +HYPRE_Int hypre_AMSComputePixyz ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *G, hypre_ParVector *Gx, + hypre_ParVector *Gy, hypre_ParVector *Gz, HYPRE_Int dim, hypre_ParCSRMatrix **Pix_ptr, + hypre_ParCSRMatrix **Piy_ptr, hypre_ParCSRMatrix **Piz_ptr ); +HYPRE_Int hypre_AMSComputeGPi ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *G, hypre_ParVector *Gx, + hypre_ParVector *Gy, hypre_ParVector *Gz, HYPRE_Int dim, hypre_ParCSRMatrix **GPi_ptr ); +HYPRE_Int hypre_AMSSetup ( void *solver, hypre_ParCSRMatrix *A, hypre_ParVector *b, + hypre_ParVector *x ); +HYPRE_Int hypre_AMSSolve ( void *solver, hypre_ParCSRMatrix *A, hypre_ParVector *b, + hypre_ParVector *x ); +HYPRE_Int hypre_ParCSRSubspacePrec ( hypre_ParCSRMatrix *A0, HYPRE_Int A0_relax_type, + HYPRE_Int A0_relax_times, HYPRE_Real *A0_l1_norms, HYPRE_Real A0_relax_weight, HYPRE_Real A0_omega, + HYPRE_Real A0_max_eig_est, HYPRE_Real A0_min_eig_est, HYPRE_Int A0_cheby_order, + HYPRE_Real A0_cheby_fraction, hypre_ParCSRMatrix **A, HYPRE_Solver *B, HYPRE_PtrToSolverFcn *HB, + hypre_ParCSRMatrix **P, hypre_ParVector **r, hypre_ParVector **g, hypre_ParVector *x, + hypre_ParVector *y, hypre_ParVector *r0, hypre_ParVector *g0, char *cycle, hypre_ParVector *z ); +HYPRE_Int hypre_AMSGetNumIterations ( void *solver, HYPRE_Int *num_iterations ); +HYPRE_Int hypre_AMSGetFinalRelativeResidualNorm ( void *solver, HYPRE_Real *rel_resid_norm ); +HYPRE_Int hypre_AMSProjectOutGradients ( void *solver, hypre_ParVector *x ); +HYPRE_Int hypre_AMSConstructDiscreteGradient ( hypre_ParCSRMatrix *A, hypre_ParVector *x_coord, + HYPRE_BigInt *edge_vertex, HYPRE_Int edge_orientation, hypre_ParCSRMatrix **G_ptr ); +HYPRE_Int hypre_AMSFEISetup ( void *solver, hypre_ParCSRMatrix *A, hypre_ParVector *b, + hypre_ParVector *x, HYPRE_Int num_vert, HYPRE_Int num_local_vert, HYPRE_BigInt *vert_number, + HYPRE_Real *vert_coord, HYPRE_Int num_edges, HYPRE_BigInt *edge_vertex ); HYPRE_Int hypre_AMSFEIDestroy ( void *solver ); -HYPRE_Int hypre_ParCSRComputeL1NormsThreads ( hypre_ParCSRMatrix *A , HYPRE_Int option , HYPRE_Int num_threads , HYPRE_Int *cf_marker , HYPRE_Real **l1_norm_ptr ); +HYPRE_Int hypre_ParCSRComputeL1NormsThreads ( hypre_ParCSRMatrix *A, HYPRE_Int option, + HYPRE_Int num_threads, HYPRE_Int *cf_marker, HYPRE_Real **l1_norm_ptr ); /* aux_interp.c */ -HYPRE_Int hypre_alt_insert_new_nodes ( hypre_ParCSRCommPkg *comm_pkg , hypre_ParCSRCommPkg *extend_comm_pkg , HYPRE_Int *IN_marker , HYPRE_Int full_off_procNodes , HYPRE_Int *OUT_marker ); -HYPRE_Int hypre_big_insert_new_nodes ( hypre_ParCSRCommPkg *comm_pkg , hypre_ParCSRCommPkg *extend_comm_pkg , HYPRE_Int *IN_marker , HYPRE_Int full_off_procNodes , HYPRE_BigInt offset , HYPRE_BigInt *OUT_marker ); -HYPRE_Int hypre_ssort ( HYPRE_BigInt *data , HYPRE_Int n ); -HYPRE_Int hypre_index_of_minimum ( HYPRE_BigInt *data , HYPRE_Int n ); -void hypre_swap_int ( HYPRE_BigInt *data , HYPRE_Int a , HYPRE_Int b ); -void hypre_initialize_vecs ( HYPRE_Int diag_n , HYPRE_Int offd_n , HYPRE_Int *diag_ftc , HYPRE_BigInt *offd_ftc , HYPRE_Int *diag_pm , HYPRE_Int *offd_pm , HYPRE_Int *tmp_CF ); +HYPRE_Int hypre_alt_insert_new_nodes ( hypre_ParCSRCommPkg *comm_pkg, + hypre_ParCSRCommPkg *extend_comm_pkg, HYPRE_Int *IN_marker, HYPRE_Int full_off_procNodes, + HYPRE_Int *OUT_marker ); +HYPRE_Int hypre_big_insert_new_nodes ( hypre_ParCSRCommPkg *comm_pkg, + hypre_ParCSRCommPkg *extend_comm_pkg, HYPRE_Int *IN_marker, HYPRE_Int full_off_procNodes, + HYPRE_BigInt offset, HYPRE_BigInt *OUT_marker ); +HYPRE_Int hypre_ssort ( HYPRE_BigInt *data, HYPRE_Int n ); +HYPRE_Int hypre_index_of_minimum ( HYPRE_BigInt *data, HYPRE_Int n ); +void hypre_swap_int ( HYPRE_BigInt *data, HYPRE_Int a, HYPRE_Int b ); +void hypre_initialize_vecs ( HYPRE_Int diag_n, HYPRE_Int offd_n, HYPRE_Int *diag_ftc, + HYPRE_BigInt *offd_ftc, HYPRE_Int *diag_pm, HYPRE_Int *offd_pm, HYPRE_Int *tmp_CF ); /*HYPRE_Int hypre_new_offd_nodes(HYPRE_Int **found , HYPRE_Int num_cols_A_offd , HYPRE_Int *A_ext_i , HYPRE_Int *A_ext_j, HYPRE_Int num_cols_S_offd, HYPRE_Int *col_map_offd, HYPRE_Int col_1, HYPRE_Int col_n, HYPRE_Int *Sop_i, HYPRE_Int *Sop_j, HYPRE_Int *CF_marker_offd );*/ -HYPRE_Int hypre_exchange_marker(hypre_ParCSRCommPkg *comm_pkg, HYPRE_Int *IN_marker, HYPRE_Int *OUT_marker); -HYPRE_Int hypre_exchange_interp_data( HYPRE_Int **CF_marker_offd, HYPRE_Int **dof_func_offd, hypre_CSRMatrix **A_ext, HYPRE_Int *full_off_procNodes, hypre_CSRMatrix **Sop, hypre_ParCSRCommPkg **extend_comm_pkg, hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, hypre_ParCSRMatrix *S, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int skip_fine_or_same_sign); -void hypre_build_interp_colmap(hypre_ParCSRMatrix *P, HYPRE_Int full_off_procNodes, HYPRE_Int *tmp_CF_marker_offd, HYPRE_BigInt *fine_to_coarse_offd); +HYPRE_Int hypre_exchange_marker(hypre_ParCSRCommPkg *comm_pkg, HYPRE_Int *IN_marker, + HYPRE_Int *OUT_marker); +HYPRE_Int hypre_exchange_interp_data( HYPRE_Int **CF_marker_offd, HYPRE_Int **dof_func_offd, + hypre_CSRMatrix **A_ext, HYPRE_Int *full_off_procNodes, hypre_CSRMatrix **Sop, + hypre_ParCSRCommPkg **extend_comm_pkg, hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int skip_fine_or_same_sign); +void hypre_build_interp_colmap(hypre_ParCSRMatrix *P, HYPRE_Int full_off_procNodes, + HYPRE_Int *tmp_CF_marker_offd, HYPRE_BigInt *fine_to_coarse_offd); /* block_tridiag.c */ void *hypre_BlockTridiagCreate ( void ); HYPRE_Int hypre_BlockTridiagDestroy ( void *data ); -HYPRE_Int hypre_BlockTridiagSetup ( void *data , hypre_ParCSRMatrix *A , hypre_ParVector *b , hypre_ParVector *x ); -HYPRE_Int hypre_BlockTridiagSolve ( void *data , hypre_ParCSRMatrix *A , hypre_ParVector *b , hypre_ParVector *x ); -HYPRE_Int hypre_BlockTridiagSetIndexSet ( void *data , HYPRE_Int n , HYPRE_Int *inds ); -HYPRE_Int hypre_BlockTridiagSetAMGStrengthThreshold ( void *data , HYPRE_Real thresh ); -HYPRE_Int hypre_BlockTridiagSetAMGNumSweeps ( void *data , HYPRE_Int nsweeps ); -HYPRE_Int hypre_BlockTridiagSetAMGRelaxType ( void *data , HYPRE_Int relax_type ); -HYPRE_Int hypre_BlockTridiagSetPrintLevel ( void *data , HYPRE_Int print_level ); +HYPRE_Int hypre_BlockTridiagSetup ( void *data, hypre_ParCSRMatrix *A, hypre_ParVector *b, + hypre_ParVector *x ); +HYPRE_Int hypre_BlockTridiagSolve ( void *data, hypre_ParCSRMatrix *A, hypre_ParVector *b, + hypre_ParVector *x ); +HYPRE_Int hypre_BlockTridiagSetIndexSet ( void *data, HYPRE_Int n, HYPRE_Int *inds ); +HYPRE_Int hypre_BlockTridiagSetAMGStrengthThreshold ( void *data, HYPRE_Real thresh ); +HYPRE_Int hypre_BlockTridiagSetAMGNumSweeps ( void *data, HYPRE_Int nsweeps ); +HYPRE_Int hypre_BlockTridiagSetAMGRelaxType ( void *data, HYPRE_Int relax_type ); +HYPRE_Int hypre_BlockTridiagSetPrintLevel ( void *data, HYPRE_Int print_level ); /* driver.c */ -HYPRE_Int BuildParFromFile ( HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildParLaplacian ( HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildParDifConv ( HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildParFromOneFile ( HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildRhsParFromOneFile ( HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix A , HYPRE_ParVector *b_ptr ); -HYPRE_Int BuildParLaplacian9pt ( HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildParLaplacian27pt ( HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildParFromFile ( HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildParLaplacian ( HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildParDifConv ( HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildParFromOneFile ( HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildRhsParFromOneFile ( HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix A, HYPRE_ParVector *b_ptr ); +HYPRE_Int BuildParLaplacian9pt ( HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildParLaplacian27pt ( HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr ); /* gen_redcs_mat.c */ -HYPRE_Int hypre_seqAMGSetup ( hypre_ParAMGData *amg_data , HYPRE_Int p_level , HYPRE_Int coarse_threshold ); -HYPRE_Int hypre_seqAMGCycle ( hypre_ParAMGData *amg_data , HYPRE_Int p_level , hypre_ParVector **Par_F_array , hypre_ParVector **Par_U_array ); -HYPRE_Int hypre_GenerateSubComm ( MPI_Comm comm , HYPRE_Int participate , MPI_Comm *new_comm_ptr ); -void hypre_merge_lists ( HYPRE_Int *list1 , HYPRE_Int *list2 , hypre_int *np1 , hypre_MPI_Datatype *dptr ); +HYPRE_Int hypre_seqAMGSetup ( hypre_ParAMGData *amg_data, HYPRE_Int p_level, + HYPRE_Int coarse_threshold ); +HYPRE_Int hypre_seqAMGCycle ( hypre_ParAMGData *amg_data, HYPRE_Int p_level, + hypre_ParVector **Par_F_array, hypre_ParVector **Par_U_array ); +HYPRE_Int hypre_GenerateSubComm ( MPI_Comm comm, HYPRE_Int participate, MPI_Comm *new_comm_ptr ); +void hypre_merge_lists ( HYPRE_Int *list1, HYPRE_Int *list2, hypre_int *np1, + hypre_MPI_Datatype *dptr ); /* HYPRE_ads.c */ HYPRE_Int HYPRE_ADSCreate ( HYPRE_Solver *solver ); HYPRE_Int HYPRE_ADSDestroy ( HYPRE_Solver solver ); -HYPRE_Int HYPRE_ADSSetup ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ADSSolve ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ADSSetDiscreteCurl ( HYPRE_Solver solver , HYPRE_ParCSRMatrix C ); -HYPRE_Int HYPRE_ADSSetDiscreteGradient ( HYPRE_Solver solver , HYPRE_ParCSRMatrix G ); -HYPRE_Int HYPRE_ADSSetCoordinateVectors ( HYPRE_Solver solver , HYPRE_ParVector x , HYPRE_ParVector y , HYPRE_ParVector z ); -HYPRE_Int HYPRE_ADSSetInterpolations ( HYPRE_Solver solver , HYPRE_ParCSRMatrix RT_Pi , HYPRE_ParCSRMatrix RT_Pix , HYPRE_ParCSRMatrix RT_Piy , HYPRE_ParCSRMatrix RT_Piz , HYPRE_ParCSRMatrix ND_Pi , HYPRE_ParCSRMatrix ND_Pix , HYPRE_ParCSRMatrix ND_Piy , HYPRE_ParCSRMatrix ND_Piz ); -HYPRE_Int HYPRE_ADSSetMaxIter ( HYPRE_Solver solver , HYPRE_Int maxit ); -HYPRE_Int HYPRE_ADSSetTol ( HYPRE_Solver solver , HYPRE_Real tol ); -HYPRE_Int HYPRE_ADSSetCycleType ( HYPRE_Solver solver , HYPRE_Int cycle_type ); -HYPRE_Int HYPRE_ADSSetPrintLevel ( HYPRE_Solver solver , HYPRE_Int print_level ); -HYPRE_Int HYPRE_ADSSetSmoothingOptions ( HYPRE_Solver solver , HYPRE_Int relax_type , HYPRE_Int relax_times , HYPRE_Real relax_weight , HYPRE_Real omega ); -HYPRE_Int HYPRE_ADSSetChebySmoothingOptions ( HYPRE_Solver solver , HYPRE_Int cheby_order , HYPRE_Int cheby_fraction ); -HYPRE_Int HYPRE_ADSSetAMSOptions ( HYPRE_Solver solver , HYPRE_Int cycle_type , HYPRE_Int coarsen_type , HYPRE_Int agg_levels , HYPRE_Int relax_type , HYPRE_Real strength_threshold , HYPRE_Int interp_type , HYPRE_Int Pmax ); -HYPRE_Int HYPRE_ADSSetAMGOptions ( HYPRE_Solver solver , HYPRE_Int coarsen_type , HYPRE_Int agg_levels , HYPRE_Int relax_type , HYPRE_Real strength_threshold , HYPRE_Int interp_type , HYPRE_Int Pmax ); -HYPRE_Int HYPRE_ADSGetNumIterations ( HYPRE_Solver solver , HYPRE_Int *num_iterations ); -HYPRE_Int HYPRE_ADSGetFinalRelativeResidualNorm ( HYPRE_Solver solver , HYPRE_Real *rel_resid_norm ); +HYPRE_Int HYPRE_ADSSetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ADSSolve ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ADSSetDiscreteCurl ( HYPRE_Solver solver, HYPRE_ParCSRMatrix C ); +HYPRE_Int HYPRE_ADSSetDiscreteGradient ( HYPRE_Solver solver, HYPRE_ParCSRMatrix G ); +HYPRE_Int HYPRE_ADSSetCoordinateVectors ( HYPRE_Solver solver, HYPRE_ParVector x, HYPRE_ParVector y, + HYPRE_ParVector z ); +HYPRE_Int HYPRE_ADSSetInterpolations ( HYPRE_Solver solver, HYPRE_ParCSRMatrix RT_Pi, + HYPRE_ParCSRMatrix RT_Pix, HYPRE_ParCSRMatrix RT_Piy, HYPRE_ParCSRMatrix RT_Piz, + HYPRE_ParCSRMatrix ND_Pi, HYPRE_ParCSRMatrix ND_Pix, HYPRE_ParCSRMatrix ND_Piy, + HYPRE_ParCSRMatrix ND_Piz ); +HYPRE_Int HYPRE_ADSSetMaxIter ( HYPRE_Solver solver, HYPRE_Int maxit ); +HYPRE_Int HYPRE_ADSSetTol ( HYPRE_Solver solver, HYPRE_Real tol ); +HYPRE_Int HYPRE_ADSSetCycleType ( HYPRE_Solver solver, HYPRE_Int cycle_type ); +HYPRE_Int HYPRE_ADSSetPrintLevel ( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int HYPRE_ADSSetSmoothingOptions ( HYPRE_Solver solver, HYPRE_Int relax_type, + HYPRE_Int relax_times, HYPRE_Real relax_weight, HYPRE_Real omega ); +HYPRE_Int HYPRE_ADSSetChebySmoothingOptions ( HYPRE_Solver solver, HYPRE_Int cheby_order, + HYPRE_Real cheby_fraction ); +HYPRE_Int HYPRE_ADSSetAMSOptions ( HYPRE_Solver solver, HYPRE_Int cycle_type, + HYPRE_Int coarsen_type, HYPRE_Int agg_levels, HYPRE_Int relax_type, HYPRE_Real strength_threshold, + HYPRE_Int interp_type, HYPRE_Int Pmax ); +HYPRE_Int HYPRE_ADSSetAMGOptions ( HYPRE_Solver solver, HYPRE_Int coarsen_type, + HYPRE_Int agg_levels, HYPRE_Int relax_type, HYPRE_Real strength_threshold, HYPRE_Int interp_type, + HYPRE_Int Pmax ); +HYPRE_Int HYPRE_ADSGetNumIterations ( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int HYPRE_ADSGetFinalRelativeResidualNorm ( HYPRE_Solver solver, HYPRE_Real *rel_resid_norm ); /* HYPRE_ame.c */ HYPRE_Int HYPRE_AMECreate ( HYPRE_Solver *esolver ); HYPRE_Int HYPRE_AMEDestroy ( HYPRE_Solver esolver ); HYPRE_Int HYPRE_AMESetup ( HYPRE_Solver esolver ); HYPRE_Int HYPRE_AMESolve ( HYPRE_Solver esolver ); -HYPRE_Int HYPRE_AMESetAMSSolver ( HYPRE_Solver esolver , HYPRE_Solver ams_solver ); -HYPRE_Int HYPRE_AMESetMassMatrix ( HYPRE_Solver esolver , HYPRE_ParCSRMatrix M ); -HYPRE_Int HYPRE_AMESetBlockSize ( HYPRE_Solver esolver , HYPRE_Int block_size ); -HYPRE_Int HYPRE_AMESetMaxIter ( HYPRE_Solver esolver , HYPRE_Int maxit ); -HYPRE_Int HYPRE_AMESetTol ( HYPRE_Solver esolver , HYPRE_Real tol ); -HYPRE_Int HYPRE_AMESetRTol ( HYPRE_Solver esolver , HYPRE_Real tol ); -HYPRE_Int HYPRE_AMESetPrintLevel ( HYPRE_Solver esolver , HYPRE_Int print_level ); -HYPRE_Int HYPRE_AMEGetEigenvalues ( HYPRE_Solver esolver , HYPRE_Real **eigenvalues ); -HYPRE_Int HYPRE_AMEGetEigenvectors ( HYPRE_Solver esolver , HYPRE_ParVector **eigenvectors ); +HYPRE_Int HYPRE_AMESetAMSSolver ( HYPRE_Solver esolver, HYPRE_Solver ams_solver ); +HYPRE_Int HYPRE_AMESetMassMatrix ( HYPRE_Solver esolver, HYPRE_ParCSRMatrix M ); +HYPRE_Int HYPRE_AMESetBlockSize ( HYPRE_Solver esolver, HYPRE_Int block_size ); +HYPRE_Int HYPRE_AMESetMaxIter ( HYPRE_Solver esolver, HYPRE_Int maxit ); +HYPRE_Int HYPRE_AMESetMaxPCGIter ( HYPRE_Solver esolver, HYPRE_Int maxit ); +HYPRE_Int HYPRE_AMESetTol ( HYPRE_Solver esolver, HYPRE_Real tol ); +HYPRE_Int HYPRE_AMESetRTol ( HYPRE_Solver esolver, HYPRE_Real tol ); +HYPRE_Int HYPRE_AMESetPrintLevel ( HYPRE_Solver esolver, HYPRE_Int print_level ); +HYPRE_Int HYPRE_AMEGetEigenvalues ( HYPRE_Solver esolver, HYPRE_Real **eigenvalues ); +HYPRE_Int HYPRE_AMEGetEigenvectors ( HYPRE_Solver esolver, HYPRE_ParVector **eigenvectors ); /* HYPRE_ams.c */ HYPRE_Int HYPRE_AMSCreate ( HYPRE_Solver *solver ); HYPRE_Int HYPRE_AMSDestroy ( HYPRE_Solver solver ); -HYPRE_Int HYPRE_AMSSetup ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_AMSSolve ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_AMSSetDimension ( HYPRE_Solver solver , HYPRE_Int dim ); -HYPRE_Int HYPRE_AMSSetDiscreteGradient ( HYPRE_Solver solver , HYPRE_ParCSRMatrix G ); -HYPRE_Int HYPRE_AMSSetCoordinateVectors ( HYPRE_Solver solver , HYPRE_ParVector x , HYPRE_ParVector y , HYPRE_ParVector z ); -HYPRE_Int HYPRE_AMSSetEdgeConstantVectors ( HYPRE_Solver solver , HYPRE_ParVector Gx , HYPRE_ParVector Gy , HYPRE_ParVector Gz ); -HYPRE_Int HYPRE_AMSSetInterpolations ( HYPRE_Solver solver , HYPRE_ParCSRMatrix Pi , HYPRE_ParCSRMatrix Pix , HYPRE_ParCSRMatrix Piy , HYPRE_ParCSRMatrix Piz ); -HYPRE_Int HYPRE_AMSSetAlphaPoissonMatrix ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A_alpha ); -HYPRE_Int HYPRE_AMSSetBetaPoissonMatrix ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A_beta ); -HYPRE_Int HYPRE_AMSSetInteriorNodes ( HYPRE_Solver solver , HYPRE_ParVector interior_nodes ); -HYPRE_Int HYPRE_AMSSetProjectionFrequency ( HYPRE_Solver solver , HYPRE_Int projection_frequency ); -HYPRE_Int HYPRE_AMSSetMaxIter ( HYPRE_Solver solver , HYPRE_Int maxit ); -HYPRE_Int HYPRE_AMSSetTol ( HYPRE_Solver solver , HYPRE_Real tol ); -HYPRE_Int HYPRE_AMSSetCycleType ( HYPRE_Solver solver , HYPRE_Int cycle_type ); -HYPRE_Int HYPRE_AMSSetPrintLevel ( HYPRE_Solver solver , HYPRE_Int print_level ); -HYPRE_Int HYPRE_AMSSetSmoothingOptions ( HYPRE_Solver solver , HYPRE_Int relax_type , HYPRE_Int relax_times , HYPRE_Real relax_weight , HYPRE_Real omega ); -HYPRE_Int HYPRE_AMSSetChebySmoothingOptions ( HYPRE_Solver solver , HYPRE_Int cheby_order , HYPRE_Int cheby_fraction ); -HYPRE_Int HYPRE_AMSSetAlphaAMGOptions ( HYPRE_Solver solver , HYPRE_Int alpha_coarsen_type , HYPRE_Int alpha_agg_levels , HYPRE_Int alpha_relax_type , HYPRE_Real alpha_strength_threshold , HYPRE_Int alpha_interp_type , HYPRE_Int alpha_Pmax ); -HYPRE_Int HYPRE_AMSSetAlphaAMGCoarseRelaxType ( HYPRE_Solver solver , HYPRE_Int alpha_coarse_relax_type ); -HYPRE_Int HYPRE_AMSSetBetaAMGOptions ( HYPRE_Solver solver , HYPRE_Int beta_coarsen_type , HYPRE_Int beta_agg_levels , HYPRE_Int beta_relax_type , HYPRE_Real beta_strength_threshold , HYPRE_Int beta_interp_type , HYPRE_Int beta_Pmax ); -HYPRE_Int HYPRE_AMSSetBetaAMGCoarseRelaxType ( HYPRE_Solver solver , HYPRE_Int beta_coarse_relax_type ); -HYPRE_Int HYPRE_AMSGetNumIterations ( HYPRE_Solver solver , HYPRE_Int *num_iterations ); -HYPRE_Int HYPRE_AMSGetFinalRelativeResidualNorm ( HYPRE_Solver solver , HYPRE_Real *rel_resid_norm ); -HYPRE_Int HYPRE_AMSProjectOutGradients ( HYPRE_Solver solver , HYPRE_ParVector x ); -HYPRE_Int HYPRE_AMSConstructDiscreteGradient ( HYPRE_ParCSRMatrix A , HYPRE_ParVector x_coord , HYPRE_BigInt *edge_vertex , HYPRE_Int edge_orientation , HYPRE_ParCSRMatrix *G ); -HYPRE_Int HYPRE_AMSFEISetup ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x , HYPRE_BigInt *EdgeNodeList_ , HYPRE_BigInt *NodeNumbers_ , HYPRE_Int numEdges_ , HYPRE_Int numLocalNodes_ , HYPRE_Int numNodes_ , HYPRE_Real *NodalCoord_ ); +HYPRE_Int HYPRE_AMSSetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_AMSSolve ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_AMSSetDimension ( HYPRE_Solver solver, HYPRE_Int dim ); +HYPRE_Int HYPRE_AMSSetDiscreteGradient ( HYPRE_Solver solver, HYPRE_ParCSRMatrix G ); +HYPRE_Int HYPRE_AMSSetCoordinateVectors ( HYPRE_Solver solver, HYPRE_ParVector x, HYPRE_ParVector y, + HYPRE_ParVector z ); +HYPRE_Int HYPRE_AMSSetEdgeConstantVectors ( HYPRE_Solver solver, HYPRE_ParVector Gx, + HYPRE_ParVector Gy, HYPRE_ParVector Gz ); +HYPRE_Int HYPRE_AMSSetInterpolations ( HYPRE_Solver solver, HYPRE_ParCSRMatrix Pi, + HYPRE_ParCSRMatrix Pix, HYPRE_ParCSRMatrix Piy, HYPRE_ParCSRMatrix Piz ); +HYPRE_Int HYPRE_AMSSetAlphaPoissonMatrix ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A_alpha ); +HYPRE_Int HYPRE_AMSSetBetaPoissonMatrix ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A_beta ); +HYPRE_Int HYPRE_AMSSetInteriorNodes ( HYPRE_Solver solver, HYPRE_ParVector interior_nodes ); +HYPRE_Int HYPRE_AMSSetProjectionFrequency ( HYPRE_Solver solver, HYPRE_Int projection_frequency ); +HYPRE_Int HYPRE_AMSSetMaxIter ( HYPRE_Solver solver, HYPRE_Int maxit ); +HYPRE_Int HYPRE_AMSSetTol ( HYPRE_Solver solver, HYPRE_Real tol ); +HYPRE_Int HYPRE_AMSSetCycleType ( HYPRE_Solver solver, HYPRE_Int cycle_type ); +HYPRE_Int HYPRE_AMSSetPrintLevel ( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int HYPRE_AMSSetSmoothingOptions ( HYPRE_Solver solver, HYPRE_Int relax_type, + HYPRE_Int relax_times, HYPRE_Real relax_weight, HYPRE_Real omega ); +HYPRE_Int HYPRE_AMSSetChebySmoothingOptions ( HYPRE_Solver solver, HYPRE_Int cheby_order, + HYPRE_Real cheby_fraction ); +HYPRE_Int HYPRE_AMSSetAlphaAMGOptions ( HYPRE_Solver solver, HYPRE_Int alpha_coarsen_type, + HYPRE_Int alpha_agg_levels, HYPRE_Int alpha_relax_type, HYPRE_Real alpha_strength_threshold, + HYPRE_Int alpha_interp_type, HYPRE_Int alpha_Pmax ); +HYPRE_Int HYPRE_AMSSetAlphaAMGCoarseRelaxType ( HYPRE_Solver solver, + HYPRE_Int alpha_coarse_relax_type ); +HYPRE_Int HYPRE_AMSSetBetaAMGOptions ( HYPRE_Solver solver, HYPRE_Int beta_coarsen_type, + HYPRE_Int beta_agg_levels, HYPRE_Int beta_relax_type, HYPRE_Real beta_strength_threshold, + HYPRE_Int beta_interp_type, HYPRE_Int beta_Pmax ); +HYPRE_Int HYPRE_AMSSetBetaAMGCoarseRelaxType ( HYPRE_Solver solver, + HYPRE_Int beta_coarse_relax_type ); +HYPRE_Int HYPRE_AMSGetNumIterations ( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int HYPRE_AMSGetFinalRelativeResidualNorm ( HYPRE_Solver solver, HYPRE_Real *rel_resid_norm ); +HYPRE_Int HYPRE_AMSProjectOutGradients ( HYPRE_Solver solver, HYPRE_ParVector x ); +HYPRE_Int HYPRE_AMSConstructDiscreteGradient ( HYPRE_ParCSRMatrix A, HYPRE_ParVector x_coord, + HYPRE_BigInt *edge_vertex, HYPRE_Int edge_orientation, HYPRE_ParCSRMatrix *G ); +HYPRE_Int HYPRE_AMSFEISetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x, HYPRE_BigInt *EdgeNodeList_, HYPRE_BigInt *NodeNumbers_, HYPRE_Int numEdges_, + HYPRE_Int numLocalNodes_, HYPRE_Int numNodes_, HYPRE_Real *NodalCoord_ ); HYPRE_Int HYPRE_AMSFEIDestroy ( HYPRE_Solver solver ); /* HYPRE_parcsr_amg.c */ HYPRE_Int HYPRE_BoomerAMGCreate ( HYPRE_Solver *solver ); HYPRE_Int HYPRE_BoomerAMGDestroy ( HYPRE_Solver solver ); -HYPRE_Int HYPRE_BoomerAMGSetup ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_BoomerAMGSolve ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_BoomerAMGSolveT ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_BoomerAMGSetRestriction ( HYPRE_Solver solver , HYPRE_Int restr_par ); -HYPRE_Int HYPRE_BoomerAMGSetIsTriangular ( HYPRE_Solver solver , HYPRE_Int is_triangular ); -HYPRE_Int HYPRE_BoomerAMGSetGMRESSwitchR ( HYPRE_Solver solver , HYPRE_Int gmres_switch ); -HYPRE_Int HYPRE_BoomerAMGSetMaxLevels ( HYPRE_Solver solver , HYPRE_Int max_levels ); -HYPRE_Int HYPRE_BoomerAMGGetMaxLevels ( HYPRE_Solver solver , HYPRE_Int *max_levels ); -HYPRE_Int HYPRE_BoomerAMGSetMaxCoarseSize ( HYPRE_Solver solver , HYPRE_Int max_coarse_size ); -HYPRE_Int HYPRE_BoomerAMGGetMaxCoarseSize ( HYPRE_Solver solver , HYPRE_Int *max_coarse_size ); -HYPRE_Int HYPRE_BoomerAMGSetMinCoarseSize ( HYPRE_Solver solver , HYPRE_Int min_coarse_size ); -HYPRE_Int HYPRE_BoomerAMGGetMinCoarseSize ( HYPRE_Solver solver , HYPRE_Int *min_coarse_size ); -HYPRE_Int HYPRE_BoomerAMGSetSeqThreshold ( HYPRE_Solver solver , HYPRE_Int seq_threshold ); -HYPRE_Int HYPRE_BoomerAMGGetSeqThreshold ( HYPRE_Solver solver , HYPRE_Int *seq_threshold ); -HYPRE_Int HYPRE_BoomerAMGSetRedundant ( HYPRE_Solver solver , HYPRE_Int redundant ); -HYPRE_Int HYPRE_BoomerAMGGetRedundant ( HYPRE_Solver solver , HYPRE_Int *redundant ); +HYPRE_Int HYPRE_BoomerAMGSetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_BoomerAMGSolve ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_BoomerAMGSolveT ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_BoomerAMGSetRestriction ( HYPRE_Solver solver, HYPRE_Int restr_par ); +HYPRE_Int HYPRE_BoomerAMGSetIsTriangular ( HYPRE_Solver solver, HYPRE_Int is_triangular ); +HYPRE_Int HYPRE_BoomerAMGSetGMRESSwitchR ( HYPRE_Solver solver, HYPRE_Int gmres_switch ); +HYPRE_Int HYPRE_BoomerAMGSetMaxLevels ( HYPRE_Solver solver, HYPRE_Int max_levels ); +HYPRE_Int HYPRE_BoomerAMGGetMaxLevels ( HYPRE_Solver solver, HYPRE_Int *max_levels ); +HYPRE_Int HYPRE_BoomerAMGSetMaxCoarseSize ( HYPRE_Solver solver, HYPRE_Int max_coarse_size ); +HYPRE_Int HYPRE_BoomerAMGGetMaxCoarseSize ( HYPRE_Solver solver, HYPRE_Int *max_coarse_size ); +HYPRE_Int HYPRE_BoomerAMGSetMinCoarseSize ( HYPRE_Solver solver, HYPRE_Int min_coarse_size ); +HYPRE_Int HYPRE_BoomerAMGGetMinCoarseSize ( HYPRE_Solver solver, HYPRE_Int *min_coarse_size ); +HYPRE_Int HYPRE_BoomerAMGSetSeqThreshold ( HYPRE_Solver solver, HYPRE_Int seq_threshold ); +HYPRE_Int HYPRE_BoomerAMGGetSeqThreshold ( HYPRE_Solver solver, HYPRE_Int *seq_threshold ); +HYPRE_Int HYPRE_BoomerAMGSetRedundant ( HYPRE_Solver solver, HYPRE_Int redundant ); +HYPRE_Int HYPRE_BoomerAMGGetRedundant ( HYPRE_Solver solver, HYPRE_Int *redundant ); HYPRE_Int HYPRE_BoomerAMGSetCoarsenCutFactor( HYPRE_Solver solver, HYPRE_Int coarsen_cut_factor ); HYPRE_Int HYPRE_BoomerAMGGetCoarsenCutFactor( HYPRE_Solver solver, HYPRE_Int *coarsen_cut_factor ); -HYPRE_Int HYPRE_BoomerAMGSetStrongThreshold ( HYPRE_Solver solver , HYPRE_Real strong_threshold ); -HYPRE_Int HYPRE_BoomerAMGGetStrongThreshold ( HYPRE_Solver solver , HYPRE_Real *strong_threshold ); -HYPRE_Int HYPRE_BoomerAMGSetStrongThresholdR ( HYPRE_Solver solver , HYPRE_Real strong_threshold ); -HYPRE_Int HYPRE_BoomerAMGGetStrongThresholdR ( HYPRE_Solver solver , HYPRE_Real *strong_threshold ); -HYPRE_Int HYPRE_BoomerAMGSetFilterThresholdR ( HYPRE_Solver solver , HYPRE_Real filter_threshold ); -HYPRE_Int HYPRE_BoomerAMGGetFilterThresholdR ( HYPRE_Solver solver , HYPRE_Real *filter_threshold ); -HYPRE_Int HYPRE_BoomerAMGSetGMRESSwitchR ( HYPRE_Solver solver , HYPRE_Int gmres_switch ); -HYPRE_Int HYPRE_BoomerAMGSetSabs ( HYPRE_Solver solver , HYPRE_Int Sabs ); -HYPRE_Int HYPRE_BoomerAMGSetMaxRowSum ( HYPRE_Solver solver , HYPRE_Real max_row_sum ); -HYPRE_Int HYPRE_BoomerAMGGetMaxRowSum ( HYPRE_Solver solver , HYPRE_Real *max_row_sum ); -HYPRE_Int HYPRE_BoomerAMGSetTruncFactor ( HYPRE_Solver solver , HYPRE_Real trunc_factor ); -HYPRE_Int HYPRE_BoomerAMGGetTruncFactor ( HYPRE_Solver solver , HYPRE_Real *trunc_factor ); -HYPRE_Int HYPRE_BoomerAMGSetPMaxElmts ( HYPRE_Solver solver , HYPRE_Int P_max_elmts ); -HYPRE_Int HYPRE_BoomerAMGGetPMaxElmts ( HYPRE_Solver solver , HYPRE_Int *P_max_elmts ); -HYPRE_Int HYPRE_BoomerAMGSetJacobiTruncThreshold ( HYPRE_Solver solver , HYPRE_Real jacobi_trunc_threshold ); -HYPRE_Int HYPRE_BoomerAMGGetJacobiTruncThreshold ( HYPRE_Solver solver , HYPRE_Real *jacobi_trunc_threshold ); -HYPRE_Int HYPRE_BoomerAMGSetPostInterpType ( HYPRE_Solver solver , HYPRE_Int post_interp_type ); -HYPRE_Int HYPRE_BoomerAMGGetPostInterpType ( HYPRE_Solver solver , HYPRE_Int *post_interp_type ); -HYPRE_Int HYPRE_BoomerAMGSetSCommPkgSwitch ( HYPRE_Solver solver , HYPRE_Real S_commpkg_switch ); -HYPRE_Int HYPRE_BoomerAMGSetInterpType ( HYPRE_Solver solver , HYPRE_Int interp_type ); -HYPRE_Int HYPRE_BoomerAMGSetSepWeight ( HYPRE_Solver solver , HYPRE_Int sep_weight ); -HYPRE_Int HYPRE_BoomerAMGSetMinIter ( HYPRE_Solver solver , HYPRE_Int min_iter ); -HYPRE_Int HYPRE_BoomerAMGSetMaxIter ( HYPRE_Solver solver , HYPRE_Int max_iter ); -HYPRE_Int HYPRE_BoomerAMGGetMaxIter ( HYPRE_Solver solver , HYPRE_Int *max_iter ); -HYPRE_Int HYPRE_BoomerAMGSetCoarsenType ( HYPRE_Solver solver , HYPRE_Int coarsen_type ); -HYPRE_Int HYPRE_BoomerAMGGetCoarsenType ( HYPRE_Solver solver , HYPRE_Int *coarsen_type ); -HYPRE_Int HYPRE_BoomerAMGSetMeasureType ( HYPRE_Solver solver , HYPRE_Int measure_type ); -HYPRE_Int HYPRE_BoomerAMGGetMeasureType ( HYPRE_Solver solver , HYPRE_Int *measure_type ); -HYPRE_Int HYPRE_BoomerAMGSetSetupType ( HYPRE_Solver solver , HYPRE_Int setup_type ); +HYPRE_Int HYPRE_BoomerAMGSetStrongThreshold ( HYPRE_Solver solver, HYPRE_Real strong_threshold ); +HYPRE_Int HYPRE_BoomerAMGGetStrongThreshold ( HYPRE_Solver solver, HYPRE_Real *strong_threshold ); +HYPRE_Int HYPRE_BoomerAMGSetStrongThresholdR ( HYPRE_Solver solver, HYPRE_Real strong_threshold ); +HYPRE_Int HYPRE_BoomerAMGGetStrongThresholdR ( HYPRE_Solver solver, HYPRE_Real *strong_threshold ); +HYPRE_Int HYPRE_BoomerAMGSetFilterThresholdR ( HYPRE_Solver solver, HYPRE_Real filter_threshold ); +HYPRE_Int HYPRE_BoomerAMGGetFilterThresholdR ( HYPRE_Solver solver, HYPRE_Real *filter_threshold ); +HYPRE_Int HYPRE_BoomerAMGSetGMRESSwitchR ( HYPRE_Solver solver, HYPRE_Int gmres_switch ); +HYPRE_Int HYPRE_BoomerAMGSetSabs ( HYPRE_Solver solver, HYPRE_Int Sabs ); +HYPRE_Int HYPRE_BoomerAMGSetMaxRowSum ( HYPRE_Solver solver, HYPRE_Real max_row_sum ); +HYPRE_Int HYPRE_BoomerAMGGetMaxRowSum ( HYPRE_Solver solver, HYPRE_Real *max_row_sum ); +HYPRE_Int HYPRE_BoomerAMGSetTruncFactor ( HYPRE_Solver solver, HYPRE_Real trunc_factor ); +HYPRE_Int HYPRE_BoomerAMGGetTruncFactor ( HYPRE_Solver solver, HYPRE_Real *trunc_factor ); +HYPRE_Int HYPRE_BoomerAMGSetPMaxElmts ( HYPRE_Solver solver, HYPRE_Int P_max_elmts ); +HYPRE_Int HYPRE_BoomerAMGGetPMaxElmts ( HYPRE_Solver solver, HYPRE_Int *P_max_elmts ); +HYPRE_Int HYPRE_BoomerAMGSetJacobiTruncThreshold ( HYPRE_Solver solver, + HYPRE_Real jacobi_trunc_threshold ); +HYPRE_Int HYPRE_BoomerAMGGetJacobiTruncThreshold ( HYPRE_Solver solver, + HYPRE_Real *jacobi_trunc_threshold ); +HYPRE_Int HYPRE_BoomerAMGSetPostInterpType ( HYPRE_Solver solver, HYPRE_Int post_interp_type ); +HYPRE_Int HYPRE_BoomerAMGGetPostInterpType ( HYPRE_Solver solver, HYPRE_Int *post_interp_type ); +HYPRE_Int HYPRE_BoomerAMGSetSCommPkgSwitch ( HYPRE_Solver solver, HYPRE_Real S_commpkg_switch ); +HYPRE_Int HYPRE_BoomerAMGSetInterpType ( HYPRE_Solver solver, HYPRE_Int interp_type ); +HYPRE_Int HYPRE_BoomerAMGSetSepWeight ( HYPRE_Solver solver, HYPRE_Int sep_weight ); +HYPRE_Int HYPRE_BoomerAMGSetMinIter ( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int HYPRE_BoomerAMGSetMaxIter ( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int HYPRE_BoomerAMGGetMaxIter ( HYPRE_Solver solver, HYPRE_Int *max_iter ); +HYPRE_Int HYPRE_BoomerAMGSetCoarsenType ( HYPRE_Solver solver, HYPRE_Int coarsen_type ); +HYPRE_Int HYPRE_BoomerAMGGetCoarsenType ( HYPRE_Solver solver, HYPRE_Int *coarsen_type ); +HYPRE_Int HYPRE_BoomerAMGSetMeasureType ( HYPRE_Solver solver, HYPRE_Int measure_type ); +HYPRE_Int HYPRE_BoomerAMGGetMeasureType ( HYPRE_Solver solver, HYPRE_Int *measure_type ); +HYPRE_Int HYPRE_BoomerAMGSetSetupType ( HYPRE_Solver solver, HYPRE_Int setup_type ); HYPRE_Int HYPRE_BoomerAMGSetOldDefault ( HYPRE_Solver solver ); -HYPRE_Int HYPRE_BoomerAMGSetFCycle ( HYPRE_Solver solver , HYPRE_Int fcycle ); -HYPRE_Int HYPRE_BoomerAMGGetFCycle ( HYPRE_Solver solver , HYPRE_Int *fcycle ); -HYPRE_Int HYPRE_BoomerAMGSetCycleType ( HYPRE_Solver solver , HYPRE_Int cycle_type ); -HYPRE_Int HYPRE_BoomerAMGGetCycleType ( HYPRE_Solver solver , HYPRE_Int *cycle_type ); -HYPRE_Int HYPRE_BoomerAMGSetConvergeType ( HYPRE_Solver solver , HYPRE_Int type ); -HYPRE_Int HYPRE_BoomerAMGGetConvergeType ( HYPRE_Solver solver , HYPRE_Int *type ); -HYPRE_Int HYPRE_BoomerAMGSetTol ( HYPRE_Solver solver , HYPRE_Real tol ); -HYPRE_Int HYPRE_BoomerAMGGetTol ( HYPRE_Solver solver , HYPRE_Real *tol ); -HYPRE_Int HYPRE_BoomerAMGSetNumGridSweeps ( HYPRE_Solver solver , HYPRE_Int *num_grid_sweeps ); -HYPRE_Int HYPRE_BoomerAMGSetNumSweeps ( HYPRE_Solver solver , HYPRE_Int num_sweeps ); -HYPRE_Int HYPRE_BoomerAMGSetCycleNumSweeps ( HYPRE_Solver solver , HYPRE_Int num_sweeps , HYPRE_Int k ); -HYPRE_Int HYPRE_BoomerAMGGetCycleNumSweeps ( HYPRE_Solver solver , HYPRE_Int *num_sweeps , HYPRE_Int k ); -HYPRE_Int HYPRE_BoomerAMGInitGridRelaxation ( HYPRE_Int **num_grid_sweeps_ptr , HYPRE_Int **grid_relax_type_ptr , HYPRE_Int ***grid_relax_points_ptr , HYPRE_Int coarsen_type , HYPRE_Real **relax_weights_ptr , HYPRE_Int max_levels ); -HYPRE_Int HYPRE_BoomerAMGSetGridRelaxType ( HYPRE_Solver solver , HYPRE_Int *grid_relax_type ); -HYPRE_Int HYPRE_BoomerAMGSetRelaxType ( HYPRE_Solver solver , HYPRE_Int relax_type ); -HYPRE_Int HYPRE_BoomerAMGSetCycleRelaxType ( HYPRE_Solver solver , HYPRE_Int relax_type , HYPRE_Int k ); -HYPRE_Int HYPRE_BoomerAMGGetCycleRelaxType ( HYPRE_Solver solver , HYPRE_Int *relax_type , HYPRE_Int k ); -HYPRE_Int HYPRE_BoomerAMGSetRelaxOrder ( HYPRE_Solver solver , HYPRE_Int relax_order ); -HYPRE_Int HYPRE_BoomerAMGSetGridRelaxPoints ( HYPRE_Solver solver , HYPRE_Int **grid_relax_points ); -HYPRE_Int HYPRE_BoomerAMGSetRelaxWeight ( HYPRE_Solver solver , HYPRE_Real *relax_weight ); -HYPRE_Int HYPRE_BoomerAMGSetRelaxWt ( HYPRE_Solver solver , HYPRE_Real relax_wt ); -HYPRE_Int HYPRE_BoomerAMGSetLevelRelaxWt ( HYPRE_Solver solver , HYPRE_Real relax_wt , HYPRE_Int level ); -HYPRE_Int HYPRE_BoomerAMGSetOmega ( HYPRE_Solver solver , HYPRE_Real *omega ); -HYPRE_Int HYPRE_BoomerAMGSetOuterWt ( HYPRE_Solver solver , HYPRE_Real outer_wt ); -HYPRE_Int HYPRE_BoomerAMGSetLevelOuterWt ( HYPRE_Solver solver , HYPRE_Real outer_wt , HYPRE_Int level ); -HYPRE_Int HYPRE_BoomerAMGSetSmoothType ( HYPRE_Solver solver , HYPRE_Int smooth_type ); -HYPRE_Int HYPRE_BoomerAMGGetSmoothType ( HYPRE_Solver solver , HYPRE_Int *smooth_type ); -HYPRE_Int HYPRE_BoomerAMGSetSmoothNumLevels ( HYPRE_Solver solver , HYPRE_Int smooth_num_levels ); -HYPRE_Int HYPRE_BoomerAMGGetSmoothNumLevels ( HYPRE_Solver solver , HYPRE_Int *smooth_num_levels ); -HYPRE_Int HYPRE_BoomerAMGSetSmoothNumSweeps ( HYPRE_Solver solver , HYPRE_Int smooth_num_sweeps ); -HYPRE_Int HYPRE_BoomerAMGGetSmoothNumSweeps ( HYPRE_Solver solver , HYPRE_Int *smooth_num_sweeps ); -HYPRE_Int HYPRE_BoomerAMGSetLogging ( HYPRE_Solver solver , HYPRE_Int logging ); -HYPRE_Int HYPRE_BoomerAMGGetLogging ( HYPRE_Solver solver , HYPRE_Int *logging ); -HYPRE_Int HYPRE_BoomerAMGSetPrintLevel ( HYPRE_Solver solver , HYPRE_Int print_level ); -HYPRE_Int HYPRE_BoomerAMGGetPrintLevel ( HYPRE_Solver solver , HYPRE_Int *print_level ); -HYPRE_Int HYPRE_BoomerAMGSetPrintFileName ( HYPRE_Solver solver , const char *print_file_name ); -HYPRE_Int HYPRE_BoomerAMGSetDebugFlag ( HYPRE_Solver solver , HYPRE_Int debug_flag ); -HYPRE_Int HYPRE_BoomerAMGGetDebugFlag ( HYPRE_Solver solver , HYPRE_Int *debug_flag ); -HYPRE_Int HYPRE_BoomerAMGGetNumIterations ( HYPRE_Solver solver , HYPRE_Int *num_iterations ); -HYPRE_Int HYPRE_BoomerAMGGetCumNumIterations ( HYPRE_Solver solver , HYPRE_Int *cum_num_iterations ); -HYPRE_Int HYPRE_BoomerAMGGetResidual ( HYPRE_Solver solver , HYPRE_ParVector *residual ); -HYPRE_Int HYPRE_BoomerAMGGetFinalRelativeResidualNorm ( HYPRE_Solver solver , HYPRE_Real *rel_resid_norm ); -HYPRE_Int HYPRE_BoomerAMGSetVariant ( HYPRE_Solver solver , HYPRE_Int variant ); -HYPRE_Int HYPRE_BoomerAMGGetVariant ( HYPRE_Solver solver , HYPRE_Int *variant ); -HYPRE_Int HYPRE_BoomerAMGSetOverlap ( HYPRE_Solver solver , HYPRE_Int overlap ); -HYPRE_Int HYPRE_BoomerAMGGetOverlap ( HYPRE_Solver solver , HYPRE_Int *overlap ); -HYPRE_Int HYPRE_BoomerAMGSetDomainType ( HYPRE_Solver solver , HYPRE_Int domain_type ); -HYPRE_Int HYPRE_BoomerAMGGetDomainType ( HYPRE_Solver solver , HYPRE_Int *domain_type ); -HYPRE_Int HYPRE_BoomerAMGSetSchwarzRlxWeight ( HYPRE_Solver solver , HYPRE_Real schwarz_rlx_weight ); -HYPRE_Int HYPRE_BoomerAMGGetSchwarzRlxWeight ( HYPRE_Solver solver , HYPRE_Real *schwarz_rlx_weight ); -HYPRE_Int HYPRE_BoomerAMGSetSchwarzUseNonSymm ( HYPRE_Solver solver , HYPRE_Int use_nonsymm ); -HYPRE_Int HYPRE_BoomerAMGSetSym ( HYPRE_Solver solver , HYPRE_Int sym ); -HYPRE_Int HYPRE_BoomerAMGSetLevel ( HYPRE_Solver solver , HYPRE_Int level ); -HYPRE_Int HYPRE_BoomerAMGSetThreshold ( HYPRE_Solver solver , HYPRE_Real threshold ); -HYPRE_Int HYPRE_BoomerAMGSetFilter ( HYPRE_Solver solver , HYPRE_Real filter ); -HYPRE_Int HYPRE_BoomerAMGSetDropTol ( HYPRE_Solver solver , HYPRE_Real drop_tol ); -HYPRE_Int HYPRE_BoomerAMGSetMaxNzPerRow ( HYPRE_Solver solver , HYPRE_Int max_nz_per_row ); -HYPRE_Int HYPRE_BoomerAMGSetEuclidFile ( HYPRE_Solver solver , char *euclidfile ); -HYPRE_Int HYPRE_BoomerAMGSetEuLevel ( HYPRE_Solver solver , HYPRE_Int eu_level ); -HYPRE_Int HYPRE_BoomerAMGSetEuSparseA ( HYPRE_Solver solver , HYPRE_Real eu_sparse_A ); -HYPRE_Int HYPRE_BoomerAMGSetEuBJ ( HYPRE_Solver solver , HYPRE_Int eu_bj ); +HYPRE_Int HYPRE_BoomerAMGSetFCycle ( HYPRE_Solver solver, HYPRE_Int fcycle ); +HYPRE_Int HYPRE_BoomerAMGGetFCycle ( HYPRE_Solver solver, HYPRE_Int *fcycle ); +HYPRE_Int HYPRE_BoomerAMGSetCycleType ( HYPRE_Solver solver, HYPRE_Int cycle_type ); +HYPRE_Int HYPRE_BoomerAMGGetCycleType ( HYPRE_Solver solver, HYPRE_Int *cycle_type ); +HYPRE_Int HYPRE_BoomerAMGSetConvergeType ( HYPRE_Solver solver, HYPRE_Int type ); +HYPRE_Int HYPRE_BoomerAMGGetConvergeType ( HYPRE_Solver solver, HYPRE_Int *type ); +HYPRE_Int HYPRE_BoomerAMGSetTol ( HYPRE_Solver solver, HYPRE_Real tol ); +HYPRE_Int HYPRE_BoomerAMGGetTol ( HYPRE_Solver solver, HYPRE_Real *tol ); +HYPRE_Int HYPRE_BoomerAMGSetNumGridSweeps ( HYPRE_Solver solver, HYPRE_Int *num_grid_sweeps ); +HYPRE_Int HYPRE_BoomerAMGSetNumSweeps ( HYPRE_Solver solver, HYPRE_Int num_sweeps ); +HYPRE_Int HYPRE_BoomerAMGSetCycleNumSweeps ( HYPRE_Solver solver, HYPRE_Int num_sweeps, + HYPRE_Int k ); +HYPRE_Int HYPRE_BoomerAMGGetCycleNumSweeps ( HYPRE_Solver solver, HYPRE_Int *num_sweeps, + HYPRE_Int k ); +HYPRE_Int HYPRE_BoomerAMGInitGridRelaxation ( HYPRE_Int **num_grid_sweeps_ptr, + HYPRE_Int **grid_relax_type_ptr, HYPRE_Int ***grid_relax_points_ptr, HYPRE_Int coarsen_type, + HYPRE_Real **relax_weights_ptr, HYPRE_Int max_levels ); +HYPRE_Int HYPRE_BoomerAMGSetGridRelaxType ( HYPRE_Solver solver, HYPRE_Int *grid_relax_type ); +HYPRE_Int HYPRE_BoomerAMGSetRelaxType ( HYPRE_Solver solver, HYPRE_Int relax_type ); +HYPRE_Int HYPRE_BoomerAMGSetCycleRelaxType ( HYPRE_Solver solver, HYPRE_Int relax_type, + HYPRE_Int k ); +HYPRE_Int HYPRE_BoomerAMGGetCycleRelaxType ( HYPRE_Solver solver, HYPRE_Int *relax_type, + HYPRE_Int k ); +HYPRE_Int HYPRE_BoomerAMGSetRelaxOrder ( HYPRE_Solver solver, HYPRE_Int relax_order ); +HYPRE_Int HYPRE_BoomerAMGSetGridRelaxPoints ( HYPRE_Solver solver, HYPRE_Int **grid_relax_points ); +HYPRE_Int HYPRE_BoomerAMGSetRelaxWeight ( HYPRE_Solver solver, HYPRE_Real *relax_weight ); +HYPRE_Int HYPRE_BoomerAMGSetRelaxWt ( HYPRE_Solver solver, HYPRE_Real relax_wt ); +HYPRE_Int HYPRE_BoomerAMGSetLevelRelaxWt ( HYPRE_Solver solver, HYPRE_Real relax_wt, + HYPRE_Int level ); +HYPRE_Int HYPRE_BoomerAMGSetOmega ( HYPRE_Solver solver, HYPRE_Real *omega ); +HYPRE_Int HYPRE_BoomerAMGSetOuterWt ( HYPRE_Solver solver, HYPRE_Real outer_wt ); +HYPRE_Int HYPRE_BoomerAMGSetLevelOuterWt ( HYPRE_Solver solver, HYPRE_Real outer_wt, + HYPRE_Int level ); +HYPRE_Int HYPRE_BoomerAMGSetSmoothType ( HYPRE_Solver solver, HYPRE_Int smooth_type ); +HYPRE_Int HYPRE_BoomerAMGGetSmoothType ( HYPRE_Solver solver, HYPRE_Int *smooth_type ); +HYPRE_Int HYPRE_BoomerAMGSetSmoothNumLevels ( HYPRE_Solver solver, HYPRE_Int smooth_num_levels ); +HYPRE_Int HYPRE_BoomerAMGGetSmoothNumLevels ( HYPRE_Solver solver, HYPRE_Int *smooth_num_levels ); +HYPRE_Int HYPRE_BoomerAMGSetSmoothNumSweeps ( HYPRE_Solver solver, HYPRE_Int smooth_num_sweeps ); +HYPRE_Int HYPRE_BoomerAMGGetSmoothNumSweeps ( HYPRE_Solver solver, HYPRE_Int *smooth_num_sweeps ); +HYPRE_Int HYPRE_BoomerAMGSetLogging ( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int HYPRE_BoomerAMGGetLogging ( HYPRE_Solver solver, HYPRE_Int *logging ); +HYPRE_Int HYPRE_BoomerAMGSetPrintLevel ( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int HYPRE_BoomerAMGGetPrintLevel ( HYPRE_Solver solver, HYPRE_Int *print_level ); +HYPRE_Int HYPRE_BoomerAMGSetPrintFileName ( HYPRE_Solver solver, const char *print_file_name ); +HYPRE_Int HYPRE_BoomerAMGSetDebugFlag ( HYPRE_Solver solver, HYPRE_Int debug_flag ); +HYPRE_Int HYPRE_BoomerAMGGetDebugFlag ( HYPRE_Solver solver, HYPRE_Int *debug_flag ); +HYPRE_Int HYPRE_BoomerAMGGetNumIterations ( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int HYPRE_BoomerAMGGetCumNumIterations ( HYPRE_Solver solver, HYPRE_Int *cum_num_iterations ); +HYPRE_Int HYPRE_BoomerAMGGetResidual ( HYPRE_Solver solver, HYPRE_ParVector *residual ); +HYPRE_Int HYPRE_BoomerAMGGetFinalRelativeResidualNorm ( HYPRE_Solver solver, + HYPRE_Real *rel_resid_norm ); +HYPRE_Int HYPRE_BoomerAMGSetVariant ( HYPRE_Solver solver, HYPRE_Int variant ); +HYPRE_Int HYPRE_BoomerAMGGetVariant ( HYPRE_Solver solver, HYPRE_Int *variant ); +HYPRE_Int HYPRE_BoomerAMGSetOverlap ( HYPRE_Solver solver, HYPRE_Int overlap ); +HYPRE_Int HYPRE_BoomerAMGGetOverlap ( HYPRE_Solver solver, HYPRE_Int *overlap ); +HYPRE_Int HYPRE_BoomerAMGSetDomainType ( HYPRE_Solver solver, HYPRE_Int domain_type ); +HYPRE_Int HYPRE_BoomerAMGGetDomainType ( HYPRE_Solver solver, HYPRE_Int *domain_type ); +HYPRE_Int HYPRE_BoomerAMGSetSchwarzRlxWeight ( HYPRE_Solver solver, HYPRE_Real schwarz_rlx_weight ); +HYPRE_Int HYPRE_BoomerAMGGetSchwarzRlxWeight ( HYPRE_Solver solver, + HYPRE_Real *schwarz_rlx_weight ); +HYPRE_Int HYPRE_BoomerAMGSetSchwarzUseNonSymm ( HYPRE_Solver solver, HYPRE_Int use_nonsymm ); +HYPRE_Int HYPRE_BoomerAMGSetSym ( HYPRE_Solver solver, HYPRE_Int sym ); +HYPRE_Int HYPRE_BoomerAMGSetLevel ( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int HYPRE_BoomerAMGSetThreshold ( HYPRE_Solver solver, HYPRE_Real threshold ); +HYPRE_Int HYPRE_BoomerAMGSetFilter ( HYPRE_Solver solver, HYPRE_Real filter ); +HYPRE_Int HYPRE_BoomerAMGSetDropTol ( HYPRE_Solver solver, HYPRE_Real drop_tol ); +HYPRE_Int HYPRE_BoomerAMGSetMaxNzPerRow ( HYPRE_Solver solver, HYPRE_Int max_nz_per_row ); +HYPRE_Int HYPRE_BoomerAMGSetEuclidFile ( HYPRE_Solver solver, char *euclidfile ); +HYPRE_Int HYPRE_BoomerAMGSetEuLevel ( HYPRE_Solver solver, HYPRE_Int eu_level ); +HYPRE_Int HYPRE_BoomerAMGSetEuSparseA ( HYPRE_Solver solver, HYPRE_Real eu_sparse_A ); +HYPRE_Int HYPRE_BoomerAMGSetEuBJ ( HYPRE_Solver solver, HYPRE_Int eu_bj ); HYPRE_Int HYPRE_BoomerAMGSetILUType( HYPRE_Solver solver, HYPRE_Int ilu_type); HYPRE_Int HYPRE_BoomerAMGSetILULevel( HYPRE_Solver solver, HYPRE_Int ilu_lfil); HYPRE_Int HYPRE_BoomerAMGSetILUMaxRowNnz( HYPRE_Solver solver, HYPRE_Int ilu_max_row_nnz); HYPRE_Int HYPRE_BoomerAMGSetILUMaxIter( HYPRE_Solver solver, HYPRE_Int ilu_max_iter); HYPRE_Int HYPRE_BoomerAMGSetILUDroptol( HYPRE_Solver solver, HYPRE_Real ilu_droptol); +HYPRE_Int HYPRE_BoomerAMGSetILUTriSolve( HYPRE_Solver solver, HYPRE_Int ilu_tri_solve); +HYPRE_Int HYPRE_BoomerAMGSetILULowerJacobiIters( HYPRE_Solver solver, + HYPRE_Int ilu_lower_jacobi_iters); +HYPRE_Int HYPRE_BoomerAMGSetILUUpperJacobiIters( HYPRE_Solver solver, + HYPRE_Int ilu_upper_jacobi_iters); HYPRE_Int HYPRE_BoomerAMGSetILULocalReordering( HYPRE_Solver solver, HYPRE_Int ilu_reordering_type); -HYPRE_Int HYPRE_BoomerAMGSetNumFunctions ( HYPRE_Solver solver , HYPRE_Int num_functions ); -HYPRE_Int HYPRE_BoomerAMGGetNumFunctions ( HYPRE_Solver solver , HYPRE_Int *num_functions ); -HYPRE_Int HYPRE_BoomerAMGSetNodal ( HYPRE_Solver solver , HYPRE_Int nodal ); -HYPRE_Int HYPRE_BoomerAMGSetNodalLevels ( HYPRE_Solver solver , HYPRE_Int nodal_levels ); -HYPRE_Int HYPRE_BoomerAMGSetNodalDiag ( HYPRE_Solver solver , HYPRE_Int nodal ); -HYPRE_Int HYPRE_BoomerAMGSetKeepSameSign ( HYPRE_Solver solver , HYPRE_Int keep_same_sign ); -HYPRE_Int HYPRE_BoomerAMGSetDofFunc ( HYPRE_Solver solver , HYPRE_Int *dof_func ); -HYPRE_Int HYPRE_BoomerAMGSetNumPaths ( HYPRE_Solver solver , HYPRE_Int num_paths ); -HYPRE_Int HYPRE_BoomerAMGSetAggNumLevels ( HYPRE_Solver solver , HYPRE_Int agg_num_levels ); -HYPRE_Int HYPRE_BoomerAMGSetAggInterpType ( HYPRE_Solver solver , HYPRE_Int agg_interp_type ); -HYPRE_Int HYPRE_BoomerAMGSetAggTruncFactor ( HYPRE_Solver solver , HYPRE_Real agg_trunc_factor ); -HYPRE_Int HYPRE_BoomerAMGSetAddTruncFactor ( HYPRE_Solver solver , HYPRE_Real add_trunc_factor ); -HYPRE_Int HYPRE_BoomerAMGSetMultAddTruncFactor ( HYPRE_Solver solver , HYPRE_Real add_trunc_factor ); -HYPRE_Int HYPRE_BoomerAMGSetAggP12TruncFactor ( HYPRE_Solver solver , HYPRE_Real agg_P12_trunc_factor ); -HYPRE_Int HYPRE_BoomerAMGSetAggPMaxElmts ( HYPRE_Solver solver , HYPRE_Int agg_P_max_elmts ); -HYPRE_Int HYPRE_BoomerAMGSetAddPMaxElmts ( HYPRE_Solver solver , HYPRE_Int add_P_max_elmts ); -HYPRE_Int HYPRE_BoomerAMGSetMultAddPMaxElmts ( HYPRE_Solver solver , HYPRE_Int add_P_max_elmts ); -HYPRE_Int HYPRE_BoomerAMGSetAddRelaxType ( HYPRE_Solver solver , HYPRE_Int add_rlx_type ); -HYPRE_Int HYPRE_BoomerAMGSetAddRelaxWt ( HYPRE_Solver solver , HYPRE_Real add_rlx_wt ); -HYPRE_Int HYPRE_BoomerAMGSetAggP12MaxElmts ( HYPRE_Solver solver , HYPRE_Int agg_P12_max_elmts ); -HYPRE_Int HYPRE_BoomerAMGSetNumCRRelaxSteps ( HYPRE_Solver solver , HYPRE_Int num_CR_relax_steps ); -HYPRE_Int HYPRE_BoomerAMGSetCRRate ( HYPRE_Solver solver , HYPRE_Real CR_rate ); -HYPRE_Int HYPRE_BoomerAMGSetCRStrongTh ( HYPRE_Solver solver , HYPRE_Real CR_strong_th ); +HYPRE_Int HYPRE_BoomerAMGSetFSAIAlgoType ( HYPRE_Solver solver, HYPRE_Int algo_type ); +HYPRE_Int HYPRE_BoomerAMGSetFSAILocalSolveType ( HYPRE_Solver solver, HYPRE_Int local_solve_type ); +HYPRE_Int HYPRE_BoomerAMGSetFSAIMaxSteps ( HYPRE_Solver solver, HYPRE_Int max_steps ); +HYPRE_Int HYPRE_BoomerAMGSetFSAIMaxStepSize ( HYPRE_Solver solver, HYPRE_Int max_step_size ); +HYPRE_Int HYPRE_BoomerAMGSetFSAIMaxNnzRow ( HYPRE_Solver solver, HYPRE_Int max_nnz_row ); +HYPRE_Int HYPRE_BoomerAMGSetFSAINumLevels ( HYPRE_Solver solver, HYPRE_Int num_levels ); +HYPRE_Int HYPRE_BoomerAMGSetFSAIEigMaxIters ( HYPRE_Solver solver, HYPRE_Int eig_max_iters ); +HYPRE_Int HYPRE_BoomerAMGSetFSAIThreshold ( HYPRE_Solver solver, HYPRE_Real threshold ); +HYPRE_Int HYPRE_BoomerAMGSetFSAIKapTolerance ( HYPRE_Solver solver, HYPRE_Real kap_tolerance ); +HYPRE_Int HYPRE_BoomerAMGSetNumFunctions ( HYPRE_Solver solver, HYPRE_Int num_functions ); +HYPRE_Int HYPRE_BoomerAMGGetNumFunctions ( HYPRE_Solver solver, HYPRE_Int *num_functions ); +HYPRE_Int HYPRE_BoomerAMGSetFilterFunctions ( HYPRE_Solver solver, HYPRE_Int filter_functions ); +HYPRE_Int HYPRE_BoomerAMGGetFilterFunctions ( HYPRE_Solver solver, HYPRE_Int *filter_functions ); +HYPRE_Int HYPRE_BoomerAMGSetNodal ( HYPRE_Solver solver, HYPRE_Int nodal ); +HYPRE_Int HYPRE_BoomerAMGSetNodalLevels ( HYPRE_Solver solver, HYPRE_Int nodal_levels ); +HYPRE_Int HYPRE_BoomerAMGSetNodalDiag ( HYPRE_Solver solver, HYPRE_Int nodal ); +HYPRE_Int HYPRE_BoomerAMGSetKeepSameSign ( HYPRE_Solver solver, HYPRE_Int keep_same_sign ); +HYPRE_Int HYPRE_BoomerAMGSetDofFunc ( HYPRE_Solver solver, HYPRE_Int *dof_func ); +HYPRE_Int HYPRE_BoomerAMGSetNumPaths ( HYPRE_Solver solver, HYPRE_Int num_paths ); +HYPRE_Int HYPRE_BoomerAMGSetAggNumLevels ( HYPRE_Solver solver, HYPRE_Int agg_num_levels ); +HYPRE_Int HYPRE_BoomerAMGSetAggInterpType ( HYPRE_Solver solver, HYPRE_Int agg_interp_type ); +HYPRE_Int HYPRE_BoomerAMGSetAggTruncFactor ( HYPRE_Solver solver, HYPRE_Real agg_trunc_factor ); +HYPRE_Int HYPRE_BoomerAMGSetAddTruncFactor ( HYPRE_Solver solver, HYPRE_Real add_trunc_factor ); +HYPRE_Int HYPRE_BoomerAMGSetMultAddTruncFactor ( HYPRE_Solver solver, HYPRE_Real add_trunc_factor ); +HYPRE_Int HYPRE_BoomerAMGSetAggP12TruncFactor ( HYPRE_Solver solver, + HYPRE_Real agg_P12_trunc_factor ); +HYPRE_Int HYPRE_BoomerAMGSetAggPMaxElmts ( HYPRE_Solver solver, HYPRE_Int agg_P_max_elmts ); +HYPRE_Int HYPRE_BoomerAMGSetAddPMaxElmts ( HYPRE_Solver solver, HYPRE_Int add_P_max_elmts ); +HYPRE_Int HYPRE_BoomerAMGSetMultAddPMaxElmts ( HYPRE_Solver solver, HYPRE_Int add_P_max_elmts ); +HYPRE_Int HYPRE_BoomerAMGSetAddRelaxType ( HYPRE_Solver solver, HYPRE_Int add_rlx_type ); +HYPRE_Int HYPRE_BoomerAMGSetAddRelaxWt ( HYPRE_Solver solver, HYPRE_Real add_rlx_wt ); +HYPRE_Int HYPRE_BoomerAMGSetAggP12MaxElmts ( HYPRE_Solver solver, HYPRE_Int agg_P12_max_elmts ); +HYPRE_Int HYPRE_BoomerAMGSetNumCRRelaxSteps ( HYPRE_Solver solver, HYPRE_Int num_CR_relax_steps ); +HYPRE_Int HYPRE_BoomerAMGSetCRRate ( HYPRE_Solver solver, HYPRE_Real CR_rate ); +HYPRE_Int HYPRE_BoomerAMGSetCRStrongTh ( HYPRE_Solver solver, HYPRE_Real CR_strong_th ); HYPRE_Int HYPRE_BoomerAMGSetADropTol( HYPRE_Solver solver, HYPRE_Real A_drop_tol ); HYPRE_Int HYPRE_BoomerAMGSetADropType( HYPRE_Solver solver, HYPRE_Int A_drop_type ); -HYPRE_Int HYPRE_BoomerAMGSetISType ( HYPRE_Solver solver , HYPRE_Int IS_type ); -HYPRE_Int HYPRE_BoomerAMGSetCRUseCG ( HYPRE_Solver solver , HYPRE_Int CR_use_CG ); -HYPRE_Int HYPRE_BoomerAMGSetGSMG ( HYPRE_Solver solver , HYPRE_Int gsmg ); -HYPRE_Int HYPRE_BoomerAMGSetNumSamples ( HYPRE_Solver solver , HYPRE_Int gsmg ); -HYPRE_Int HYPRE_BoomerAMGSetCGCIts ( HYPRE_Solver solver , HYPRE_Int its ); -HYPRE_Int HYPRE_BoomerAMGSetPlotGrids ( HYPRE_Solver solver , HYPRE_Int plotgrids ); -HYPRE_Int HYPRE_BoomerAMGSetPlotFileName ( HYPRE_Solver solver , const char *plotfilename ); -HYPRE_Int HYPRE_BoomerAMGSetCoordDim ( HYPRE_Solver solver , HYPRE_Int coorddim ); -HYPRE_Int HYPRE_BoomerAMGSetCoordinates ( HYPRE_Solver solver , float *coordinates ); +HYPRE_Int HYPRE_BoomerAMGSetISType ( HYPRE_Solver solver, HYPRE_Int IS_type ); +HYPRE_Int HYPRE_BoomerAMGSetCRUseCG ( HYPRE_Solver solver, HYPRE_Int CR_use_CG ); +HYPRE_Int HYPRE_BoomerAMGSetGSMG ( HYPRE_Solver solver, HYPRE_Int gsmg ); +HYPRE_Int HYPRE_BoomerAMGSetNumSamples ( HYPRE_Solver solver, HYPRE_Int gsmg ); +HYPRE_Int HYPRE_BoomerAMGSetCGCIts ( HYPRE_Solver solver, HYPRE_Int its ); +HYPRE_Int HYPRE_BoomerAMGSetPlotGrids ( HYPRE_Solver solver, HYPRE_Int plotgrids ); +HYPRE_Int HYPRE_BoomerAMGSetPlotFileName ( HYPRE_Solver solver, const char *plotfilename ); +HYPRE_Int HYPRE_BoomerAMGSetCoordDim ( HYPRE_Solver solver, HYPRE_Int coorddim ); +HYPRE_Int HYPRE_BoomerAMGSetCoordinates ( HYPRE_Solver solver, float *coordinates ); HYPRE_Int HYPRE_BoomerAMGGetGridHierarchy(HYPRE_Solver solver, HYPRE_Int *cgrid ); -HYPRE_Int HYPRE_BoomerAMGSetChebyOrder ( HYPRE_Solver solver , HYPRE_Int order ); -HYPRE_Int HYPRE_BoomerAMGSetChebyFraction ( HYPRE_Solver solver , HYPRE_Real ratio ); -HYPRE_Int HYPRE_BoomerAMGSetChebyEigEst ( HYPRE_Solver solver , HYPRE_Int eig_est ); -HYPRE_Int HYPRE_BoomerAMGSetChebyVariant ( HYPRE_Solver solver , HYPRE_Int variant ); -HYPRE_Int HYPRE_BoomerAMGSetChebyScale ( HYPRE_Solver solver , HYPRE_Int scale ); -HYPRE_Int HYPRE_BoomerAMGSetInterpVectors ( HYPRE_Solver solver , HYPRE_Int num_vectors , HYPRE_ParVector *vectors ); -HYPRE_Int HYPRE_BoomerAMGSetInterpVecVariant ( HYPRE_Solver solver , HYPRE_Int num ); -HYPRE_Int HYPRE_BoomerAMGSetInterpVecQMax ( HYPRE_Solver solver , HYPRE_Int q_max ); -HYPRE_Int HYPRE_BoomerAMGSetInterpVecAbsQTrunc ( HYPRE_Solver solver , HYPRE_Real q_trunc ); -HYPRE_Int HYPRE_BoomerAMGSetSmoothInterpVectors ( HYPRE_Solver solver , HYPRE_Int smooth_interp_vectors ); -HYPRE_Int HYPRE_BoomerAMGSetInterpRefine ( HYPRE_Solver solver , HYPRE_Int num_refine ); -HYPRE_Int HYPRE_BoomerAMGSetInterpVecFirstLevel ( HYPRE_Solver solver , HYPRE_Int level ); -HYPRE_Int HYPRE_BoomerAMGSetAdditive ( HYPRE_Solver solver , HYPRE_Int additive ); -HYPRE_Int HYPRE_BoomerAMGGetAdditive ( HYPRE_Solver solver , HYPRE_Int *additive ); -HYPRE_Int HYPRE_BoomerAMGSetMultAdditive ( HYPRE_Solver solver , HYPRE_Int mult_additive ); -HYPRE_Int HYPRE_BoomerAMGGetMultAdditive ( HYPRE_Solver solver , HYPRE_Int *mult_additive ); -HYPRE_Int HYPRE_BoomerAMGSetSimple ( HYPRE_Solver solver , HYPRE_Int simple ); -HYPRE_Int HYPRE_BoomerAMGGetSimple ( HYPRE_Solver solver , HYPRE_Int *simple ); -HYPRE_Int HYPRE_BoomerAMGSetAddLastLvl ( HYPRE_Solver solver , HYPRE_Int add_last_lvl ); -HYPRE_Int HYPRE_BoomerAMGSetNonGalerkinTol ( HYPRE_Solver solver , HYPRE_Real nongalerkin_tol ); -HYPRE_Int HYPRE_BoomerAMGSetLevelNonGalerkinTol ( HYPRE_Solver solver , HYPRE_Real nongalerkin_tol , HYPRE_Int level ); -HYPRE_Int HYPRE_BoomerAMGSetNonGalerkTol ( HYPRE_Solver solver , HYPRE_Int nongalerk_num_tol , HYPRE_Real *nongalerk_tol ); -HYPRE_Int HYPRE_BoomerAMGSetRAP2 ( HYPRE_Solver solver , HYPRE_Int rap2 ); -HYPRE_Int HYPRE_BoomerAMGSetModuleRAP2 ( HYPRE_Solver solver , HYPRE_Int mod_rap2 ); -HYPRE_Int HYPRE_BoomerAMGSetKeepTranspose ( HYPRE_Solver solver , HYPRE_Int keepTranspose ); +HYPRE_Int HYPRE_BoomerAMGSetChebyOrder ( HYPRE_Solver solver, HYPRE_Int order ); +HYPRE_Int HYPRE_BoomerAMGSetChebyFraction ( HYPRE_Solver solver, HYPRE_Real ratio ); +HYPRE_Int HYPRE_BoomerAMGSetChebyEigEst ( HYPRE_Solver solver, HYPRE_Int eig_est ); +HYPRE_Int HYPRE_BoomerAMGSetChebyVariant ( HYPRE_Solver solver, HYPRE_Int variant ); +HYPRE_Int HYPRE_BoomerAMGSetChebyScale ( HYPRE_Solver solver, HYPRE_Int scale ); +HYPRE_Int HYPRE_BoomerAMGSetInterpVectors ( HYPRE_Solver solver, HYPRE_Int num_vectors, + HYPRE_ParVector *vectors ); +HYPRE_Int HYPRE_BoomerAMGSetInterpVecVariant ( HYPRE_Solver solver, HYPRE_Int num ); +HYPRE_Int HYPRE_BoomerAMGSetInterpVecQMax ( HYPRE_Solver solver, HYPRE_Int q_max ); +HYPRE_Int HYPRE_BoomerAMGSetInterpVecAbsQTrunc ( HYPRE_Solver solver, HYPRE_Real q_trunc ); +HYPRE_Int HYPRE_BoomerAMGSetSmoothInterpVectors ( HYPRE_Solver solver, + HYPRE_Int smooth_interp_vectors ); +HYPRE_Int HYPRE_BoomerAMGSetInterpRefine ( HYPRE_Solver solver, HYPRE_Int num_refine ); +HYPRE_Int HYPRE_BoomerAMGSetInterpVecFirstLevel ( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int HYPRE_BoomerAMGSetAdditive ( HYPRE_Solver solver, HYPRE_Int additive ); +HYPRE_Int HYPRE_BoomerAMGGetAdditive ( HYPRE_Solver solver, HYPRE_Int *additive ); +HYPRE_Int HYPRE_BoomerAMGSetMultAdditive ( HYPRE_Solver solver, HYPRE_Int mult_additive ); +HYPRE_Int HYPRE_BoomerAMGGetMultAdditive ( HYPRE_Solver solver, HYPRE_Int *mult_additive ); +HYPRE_Int HYPRE_BoomerAMGSetSimple ( HYPRE_Solver solver, HYPRE_Int simple ); +HYPRE_Int HYPRE_BoomerAMGGetSimple ( HYPRE_Solver solver, HYPRE_Int *simple ); +HYPRE_Int HYPRE_BoomerAMGSetAddLastLvl ( HYPRE_Solver solver, HYPRE_Int add_last_lvl ); +HYPRE_Int HYPRE_BoomerAMGSetNonGalerkinTol ( HYPRE_Solver solver, HYPRE_Real nongalerkin_tol ); +HYPRE_Int HYPRE_BoomerAMGSetLevelNonGalerkinTol ( HYPRE_Solver solver, HYPRE_Real nongalerkin_tol, + HYPRE_Int level ); +HYPRE_Int HYPRE_BoomerAMGSetNonGalerkTol ( HYPRE_Solver solver, HYPRE_Int nongalerk_num_tol, + HYPRE_Real *nongalerk_tol ); +HYPRE_Int HYPRE_BoomerAMGSetRAP2 ( HYPRE_Solver solver, HYPRE_Int rap2 ); +HYPRE_Int HYPRE_BoomerAMGSetModuleRAP2 ( HYPRE_Solver solver, HYPRE_Int mod_rap2 ); +HYPRE_Int HYPRE_BoomerAMGSetKeepTranspose ( HYPRE_Solver solver, HYPRE_Int keepTranspose ); #ifdef HYPRE_USING_DSUPERLU -HYPRE_Int HYPRE_BoomerAMGSetDSLUThreshold ( HYPRE_Solver solver , HYPRE_Int slu_threshold ); +HYPRE_Int HYPRE_BoomerAMGSetDSLUThreshold ( HYPRE_Solver solver, HYPRE_Int slu_threshold ); #endif -HYPRE_Int HYPRE_BoomerAMGSetCpointsToKeep( HYPRE_Solver solver, HYPRE_Int cpt_coarse_level, HYPRE_Int num_cpt_coarse, HYPRE_BigInt *cpt_coarse_index); -HYPRE_Int HYPRE_BoomerAMGSetCPoints( HYPRE_Solver solver, HYPRE_Int cpt_coarse_level, HYPRE_Int num_cpt_coarse, HYPRE_BigInt *cpt_coarse_index); -HYPRE_Int HYPRE_BoomerAMGSetIsolatedFPoints( HYPRE_Solver solver, HYPRE_Int num_isolated_fpt, HYPRE_BigInt *isolated_fpt_index ); -HYPRE_Int HYPRE_BoomerAMGSetFPoints( HYPRE_Solver solver, HYPRE_Int num_fpt, HYPRE_BigInt *fpt_index ); +HYPRE_Int HYPRE_BoomerAMGSetCpointsToKeep( HYPRE_Solver solver, HYPRE_Int cpt_coarse_level, + HYPRE_Int num_cpt_coarse, HYPRE_BigInt *cpt_coarse_index); +HYPRE_Int HYPRE_BoomerAMGSetCPoints( HYPRE_Solver solver, HYPRE_Int cpt_coarse_level, + HYPRE_Int num_cpt_coarse, HYPRE_BigInt *cpt_coarse_index); +HYPRE_Int HYPRE_BoomerAMGSetIsolatedFPoints( HYPRE_Solver solver, HYPRE_Int num_isolated_fpt, + HYPRE_BigInt *isolated_fpt_index ); +HYPRE_Int HYPRE_BoomerAMGSetFPoints( HYPRE_Solver solver, HYPRE_Int num_fpt, + HYPRE_BigInt *fpt_index ); +HYPRE_Int HYPRE_BoomerAMGSetCumNnzAP ( HYPRE_Solver solver, HYPRE_Real cum_nnz_AP ); +HYPRE_Int HYPRE_BoomerAMGGetCumNnzAP ( HYPRE_Solver solver, HYPRE_Real *cum_nnz_AP ); /* HYPRE_parcsr_amgdd.c */ -HYPRE_Int HYPRE_BoomerAMGDDSetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); -HYPRE_Int HYPRE_BoomerAMGDDSolve ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); -HYPRE_Int HYPRE_BoomerAMGDDSetStartLevel ( HYPRE_Solver solver , HYPRE_Int start_level ); -HYPRE_Int HYPRE_BoomerAMGDDGetStartLevel ( HYPRE_Solver solver , HYPRE_Int *start_level ); -HYPRE_Int HYPRE_BoomerAMGDDSetFACNumCycles ( HYPRE_Solver solver , HYPRE_Int fac_num_cycles ); -HYPRE_Int HYPRE_BoomerAMGDDGetFACNumCycles ( HYPRE_Solver solver , HYPRE_Int *fac_num_cycles ); -HYPRE_Int HYPRE_BoomerAMGDDSetFACCycleType ( HYPRE_Solver solver , HYPRE_Int fac_cycle_type ); -HYPRE_Int HYPRE_BoomerAMGDDGetFACCycleType ( HYPRE_Solver solver , HYPRE_Int *fac_cycle_type ); -HYPRE_Int HYPRE_BoomerAMGDDSetFACNumRelax ( HYPRE_Solver solver , HYPRE_Int fac_num_relax ); -HYPRE_Int HYPRE_BoomerAMGDDGetFACNumRelax ( HYPRE_Solver solver , HYPRE_Int *fac_num_relax ); -HYPRE_Int HYPRE_BoomerAMGDDSetFACRelaxType ( HYPRE_Solver solver , HYPRE_Int fac_relax_type ); -HYPRE_Int HYPRE_BoomerAMGDDGetFACRelaxType ( HYPRE_Solver solver , HYPRE_Int *fac_relax_type ); -HYPRE_Int HYPRE_BoomerAMGDDSetFACRelaxWeight ( HYPRE_Solver solver , HYPRE_Real fac_relax_weight ); -HYPRE_Int HYPRE_BoomerAMGDDGetFACRelaxWeight ( HYPRE_Solver solver , HYPRE_Real *fac_relax_weight ); -HYPRE_Int HYPRE_BoomerAMGDDSetPadding ( HYPRE_Solver solver , HYPRE_Int padding ); -HYPRE_Int HYPRE_BoomerAMGDDGetPadding ( HYPRE_Solver solver , HYPRE_Int *padding ); -HYPRE_Int HYPRE_BoomerAMGDDSetNumGhostLayers ( HYPRE_Solver solver , HYPRE_Int num_ghost_layers ); -HYPRE_Int HYPRE_BoomerAMGDDGetNumGhostLayers ( HYPRE_Solver solver , HYPRE_Int *num_ghost_layers ); -HYPRE_Int HYPRE_BoomerAMGDDSetUserFACRelaxation( HYPRE_Solver solver, HYPRE_Int (*userFACRelaxation)( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ) ); -HYPRE_Int HYPRE_BoomerAMGDDGetAMG ( HYPRE_Solver solver , HYPRE_Solver *amg_solver ); +HYPRE_Int HYPRE_BoomerAMGDDSetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_BoomerAMGDDSolve ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_BoomerAMGDDSetStartLevel ( HYPRE_Solver solver, HYPRE_Int start_level ); +HYPRE_Int HYPRE_BoomerAMGDDGetStartLevel ( HYPRE_Solver solver, HYPRE_Int *start_level ); +HYPRE_Int HYPRE_BoomerAMGDDSetFACNumCycles ( HYPRE_Solver solver, HYPRE_Int fac_num_cycles ); +HYPRE_Int HYPRE_BoomerAMGDDGetFACNumCycles ( HYPRE_Solver solver, HYPRE_Int *fac_num_cycles ); +HYPRE_Int HYPRE_BoomerAMGDDSetFACCycleType ( HYPRE_Solver solver, HYPRE_Int fac_cycle_type ); +HYPRE_Int HYPRE_BoomerAMGDDGetFACCycleType ( HYPRE_Solver solver, HYPRE_Int *fac_cycle_type ); +HYPRE_Int HYPRE_BoomerAMGDDSetFACNumRelax ( HYPRE_Solver solver, HYPRE_Int fac_num_relax ); +HYPRE_Int HYPRE_BoomerAMGDDGetFACNumRelax ( HYPRE_Solver solver, HYPRE_Int *fac_num_relax ); +HYPRE_Int HYPRE_BoomerAMGDDSetFACRelaxType ( HYPRE_Solver solver, HYPRE_Int fac_relax_type ); +HYPRE_Int HYPRE_BoomerAMGDDGetFACRelaxType ( HYPRE_Solver solver, HYPRE_Int *fac_relax_type ); +HYPRE_Int HYPRE_BoomerAMGDDSetFACRelaxWeight ( HYPRE_Solver solver, HYPRE_Real fac_relax_weight ); +HYPRE_Int HYPRE_BoomerAMGDDGetFACRelaxWeight ( HYPRE_Solver solver, HYPRE_Real *fac_relax_weight ); +HYPRE_Int HYPRE_BoomerAMGDDSetPadding ( HYPRE_Solver solver, HYPRE_Int padding ); +HYPRE_Int HYPRE_BoomerAMGDDGetPadding ( HYPRE_Solver solver, HYPRE_Int *padding ); +HYPRE_Int HYPRE_BoomerAMGDDSetNumGhostLayers ( HYPRE_Solver solver, HYPRE_Int num_ghost_layers ); +HYPRE_Int HYPRE_BoomerAMGDDGetNumGhostLayers ( HYPRE_Solver solver, HYPRE_Int *num_ghost_layers ); +HYPRE_Int HYPRE_BoomerAMGDDSetUserFACRelaxation( HYPRE_Solver solver, + HYPRE_Int (*userFACRelaxation)( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ) ); +HYPRE_Int HYPRE_BoomerAMGDDGetAMG ( HYPRE_Solver solver, HYPRE_Solver *amg_solver ); /* HYPRE_parcsr_bicgstab.c */ -HYPRE_Int HYPRE_ParCSRBiCGSTABCreate ( MPI_Comm comm , HYPRE_Solver *solver ); +HYPRE_Int HYPRE_ParCSRBiCGSTABCreate ( MPI_Comm comm, HYPRE_Solver *solver ); HYPRE_Int HYPRE_ParCSRBiCGSTABDestroy ( HYPRE_Solver solver ); -HYPRE_Int HYPRE_ParCSRBiCGSTABSetup ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParCSRBiCGSTABSolve ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParCSRBiCGSTABSetTol ( HYPRE_Solver solver , HYPRE_Real tol ); -HYPRE_Int HYPRE_ParCSRBiCGSTABSetAbsoluteTol ( HYPRE_Solver solver , HYPRE_Real a_tol ); -HYPRE_Int HYPRE_ParCSRBiCGSTABSetMinIter ( HYPRE_Solver solver , HYPRE_Int min_iter ); -HYPRE_Int HYPRE_ParCSRBiCGSTABSetMaxIter ( HYPRE_Solver solver , HYPRE_Int max_iter ); -HYPRE_Int HYPRE_ParCSRBiCGSTABSetStopCrit ( HYPRE_Solver solver , HYPRE_Int stop_crit ); -HYPRE_Int HYPRE_ParCSRBiCGSTABSetPrecond ( HYPRE_Solver solver , HYPRE_PtrToParSolverFcn precond , HYPRE_PtrToParSolverFcn precond_setup , HYPRE_Solver precond_solver ); -HYPRE_Int HYPRE_ParCSRBiCGSTABGetPrecond ( HYPRE_Solver solver , HYPRE_Solver *precond_data_ptr ); -HYPRE_Int HYPRE_ParCSRBiCGSTABSetLogging ( HYPRE_Solver solver , HYPRE_Int logging ); -HYPRE_Int HYPRE_ParCSRBiCGSTABSetPrintLevel ( HYPRE_Solver solver , HYPRE_Int print_level ); -HYPRE_Int HYPRE_ParCSRBiCGSTABGetNumIterations ( HYPRE_Solver solver , HYPRE_Int *num_iterations ); -HYPRE_Int HYPRE_ParCSRBiCGSTABGetFinalRelativeResidualNorm ( HYPRE_Solver solver , HYPRE_Real *norm ); -HYPRE_Int HYPRE_ParCSRBiCGSTABGetResidual ( HYPRE_Solver solver , HYPRE_ParVector *residual ); +HYPRE_Int HYPRE_ParCSRBiCGSTABSetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParCSRBiCGSTABSolve ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParCSRBiCGSTABSetTol ( HYPRE_Solver solver, HYPRE_Real tol ); +HYPRE_Int HYPRE_ParCSRBiCGSTABSetAbsoluteTol ( HYPRE_Solver solver, HYPRE_Real a_tol ); +HYPRE_Int HYPRE_ParCSRBiCGSTABSetMinIter ( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int HYPRE_ParCSRBiCGSTABSetMaxIter ( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int HYPRE_ParCSRBiCGSTABSetStopCrit ( HYPRE_Solver solver, HYPRE_Int stop_crit ); +HYPRE_Int HYPRE_ParCSRBiCGSTABSetPrecond ( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, + HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int HYPRE_ParCSRBiCGSTABGetPrecond ( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int HYPRE_ParCSRBiCGSTABSetLogging ( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int HYPRE_ParCSRBiCGSTABSetPrintLevel ( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int HYPRE_ParCSRBiCGSTABGetNumIterations ( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int HYPRE_ParCSRBiCGSTABGetFinalRelativeResidualNorm ( HYPRE_Solver solver, + HYPRE_Real *norm ); +HYPRE_Int HYPRE_ParCSRBiCGSTABGetResidual ( HYPRE_Solver solver, HYPRE_ParVector *residual ); /* HYPRE_parcsr_block.c */ HYPRE_Int HYPRE_BlockTridiagCreate ( HYPRE_Solver *solver ); HYPRE_Int HYPRE_BlockTridiagDestroy ( HYPRE_Solver solver ); -HYPRE_Int HYPRE_BlockTridiagSetup ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_BlockTridiagSolve ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_BlockTridiagSetIndexSet ( HYPRE_Solver solver , HYPRE_Int n , HYPRE_Int *inds ); -HYPRE_Int HYPRE_BlockTridiagSetAMGStrengthThreshold ( HYPRE_Solver solver , HYPRE_Real thresh ); -HYPRE_Int HYPRE_BlockTridiagSetAMGNumSweeps ( HYPRE_Solver solver , HYPRE_Int num_sweeps ); -HYPRE_Int HYPRE_BlockTridiagSetAMGRelaxType ( HYPRE_Solver solver , HYPRE_Int relax_type ); -HYPRE_Int HYPRE_BlockTridiagSetPrintLevel ( HYPRE_Solver solver , HYPRE_Int print_level ); +HYPRE_Int HYPRE_BlockTridiagSetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_BlockTridiagSolve ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_BlockTridiagSetIndexSet ( HYPRE_Solver solver, HYPRE_Int n, HYPRE_Int *inds ); +HYPRE_Int HYPRE_BlockTridiagSetAMGStrengthThreshold ( HYPRE_Solver solver, HYPRE_Real thresh ); +HYPRE_Int HYPRE_BlockTridiagSetAMGNumSweeps ( HYPRE_Solver solver, HYPRE_Int num_sweeps ); +HYPRE_Int HYPRE_BlockTridiagSetAMGRelaxType ( HYPRE_Solver solver, HYPRE_Int relax_type ); +HYPRE_Int HYPRE_BlockTridiagSetPrintLevel ( HYPRE_Solver solver, HYPRE_Int print_level ); /* HYPRE_parcsr_cgnr.c */ -HYPRE_Int HYPRE_ParCSRCGNRCreate ( MPI_Comm comm , HYPRE_Solver *solver ); +HYPRE_Int HYPRE_ParCSRCGNRCreate ( MPI_Comm comm, HYPRE_Solver *solver ); HYPRE_Int HYPRE_ParCSRCGNRDestroy ( HYPRE_Solver solver ); -HYPRE_Int HYPRE_ParCSRCGNRSetup ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParCSRCGNRSolve ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParCSRCGNRSetTol ( HYPRE_Solver solver , HYPRE_Real tol ); -HYPRE_Int HYPRE_ParCSRCGNRSetMinIter ( HYPRE_Solver solver , HYPRE_Int min_iter ); -HYPRE_Int HYPRE_ParCSRCGNRSetMaxIter ( HYPRE_Solver solver , HYPRE_Int max_iter ); -HYPRE_Int HYPRE_ParCSRCGNRSetStopCrit ( HYPRE_Solver solver , HYPRE_Int stop_crit ); -HYPRE_Int HYPRE_ParCSRCGNRSetPrecond ( HYPRE_Solver solver , HYPRE_PtrToParSolverFcn precond , HYPRE_PtrToParSolverFcn precondT , HYPRE_PtrToParSolverFcn precond_setup , HYPRE_Solver precond_solver ); -HYPRE_Int HYPRE_ParCSRCGNRGetPrecond ( HYPRE_Solver solver , HYPRE_Solver *precond_data_ptr ); -HYPRE_Int HYPRE_ParCSRCGNRSetLogging ( HYPRE_Solver solver , HYPRE_Int logging ); -HYPRE_Int HYPRE_ParCSRCGNRGetNumIterations ( HYPRE_Solver solver , HYPRE_Int *num_iterations ); -HYPRE_Int HYPRE_ParCSRCGNRGetFinalRelativeResidualNorm ( HYPRE_Solver solver , HYPRE_Real *norm ); +HYPRE_Int HYPRE_ParCSRCGNRSetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParCSRCGNRSolve ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParCSRCGNRSetTol ( HYPRE_Solver solver, HYPRE_Real tol ); +HYPRE_Int HYPRE_ParCSRCGNRSetMinIter ( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int HYPRE_ParCSRCGNRSetMaxIter ( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int HYPRE_ParCSRCGNRSetStopCrit ( HYPRE_Solver solver, HYPRE_Int stop_crit ); +HYPRE_Int HYPRE_ParCSRCGNRSetPrecond ( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, + HYPRE_PtrToParSolverFcn precondT, HYPRE_PtrToParSolverFcn precond_setup, + HYPRE_Solver precond_solver ); +HYPRE_Int HYPRE_ParCSRCGNRGetPrecond ( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int HYPRE_ParCSRCGNRSetLogging ( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int HYPRE_ParCSRCGNRGetNumIterations ( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int HYPRE_ParCSRCGNRGetFinalRelativeResidualNorm ( HYPRE_Solver solver, HYPRE_Real *norm ); /* HYPRE_parcsr_Euclid.c */ -HYPRE_Int HYPRE_EuclidCreate ( MPI_Comm comm , HYPRE_Solver *solver ); +HYPRE_Int HYPRE_EuclidCreate ( MPI_Comm comm, HYPRE_Solver *solver ); HYPRE_Int HYPRE_EuclidDestroy ( HYPRE_Solver solver ); -HYPRE_Int HYPRE_EuclidSetup ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_EuclidSolve ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector bb , HYPRE_ParVector xx ); -HYPRE_Int HYPRE_EuclidSetParams ( HYPRE_Solver solver , HYPRE_Int argc , char *argv []); -HYPRE_Int HYPRE_EuclidSetParamsFromFile ( HYPRE_Solver solver , char *filename ); -HYPRE_Int HYPRE_EuclidSetLevel ( HYPRE_Solver solver , HYPRE_Int level ); -HYPRE_Int HYPRE_EuclidSetBJ ( HYPRE_Solver solver , HYPRE_Int bj ); -HYPRE_Int HYPRE_EuclidSetStats ( HYPRE_Solver solver , HYPRE_Int eu_stats ); -HYPRE_Int HYPRE_EuclidSetMem ( HYPRE_Solver solver , HYPRE_Int eu_mem ); -HYPRE_Int HYPRE_EuclidSetSparseA ( HYPRE_Solver solver , HYPRE_Real sparse_A ); -HYPRE_Int HYPRE_EuclidSetRowScale ( HYPRE_Solver solver , HYPRE_Int row_scale ); -HYPRE_Int HYPRE_EuclidSetILUT ( HYPRE_Solver solver , HYPRE_Real ilut ); +HYPRE_Int HYPRE_EuclidSetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_EuclidSolve ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector bb, + HYPRE_ParVector xx ); +HYPRE_Int HYPRE_EuclidSetParams ( HYPRE_Solver solver, HYPRE_Int argc, char *argv []); +HYPRE_Int HYPRE_EuclidSetParamsFromFile ( HYPRE_Solver solver, char *filename ); +HYPRE_Int HYPRE_EuclidSetLevel ( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int HYPRE_EuclidSetBJ ( HYPRE_Solver solver, HYPRE_Int bj ); +HYPRE_Int HYPRE_EuclidSetStats ( HYPRE_Solver solver, HYPRE_Int eu_stats ); +HYPRE_Int HYPRE_EuclidSetMem ( HYPRE_Solver solver, HYPRE_Int eu_mem ); +HYPRE_Int HYPRE_EuclidSetSparseA ( HYPRE_Solver solver, HYPRE_Real sparse_A ); +HYPRE_Int HYPRE_EuclidSetRowScale ( HYPRE_Solver solver, HYPRE_Int row_scale ); +HYPRE_Int HYPRE_EuclidSetILUT ( HYPRE_Solver solver, HYPRE_Real ilut ); /* HYPRE_parcsr_flexgmres.c */ -HYPRE_Int HYPRE_ParCSRFlexGMRESCreate ( MPI_Comm comm , HYPRE_Solver *solver ); +HYPRE_Int HYPRE_ParCSRFlexGMRESCreate ( MPI_Comm comm, HYPRE_Solver *solver ); HYPRE_Int HYPRE_ParCSRFlexGMRESDestroy ( HYPRE_Solver solver ); -HYPRE_Int HYPRE_ParCSRFlexGMRESSetup ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParCSRFlexGMRESSolve ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParCSRFlexGMRESSetKDim ( HYPRE_Solver solver , HYPRE_Int k_dim ); -HYPRE_Int HYPRE_ParCSRFlexGMRESSetTol ( HYPRE_Solver solver , HYPRE_Real tol ); -HYPRE_Int HYPRE_ParCSRFlexGMRESSetAbsoluteTol ( HYPRE_Solver solver , HYPRE_Real a_tol ); -HYPRE_Int HYPRE_ParCSRFlexGMRESSetMinIter ( HYPRE_Solver solver , HYPRE_Int min_iter ); -HYPRE_Int HYPRE_ParCSRFlexGMRESSetMaxIter ( HYPRE_Solver solver , HYPRE_Int max_iter ); -HYPRE_Int HYPRE_ParCSRFlexGMRESSetPrecond ( HYPRE_Solver solver , HYPRE_PtrToParSolverFcn precond , HYPRE_PtrToParSolverFcn precond_setup , HYPRE_Solver precond_solver ); -HYPRE_Int HYPRE_ParCSRFlexGMRESGetPrecond ( HYPRE_Solver solver , HYPRE_Solver *precond_data_ptr ); -HYPRE_Int HYPRE_ParCSRFlexGMRESSetLogging ( HYPRE_Solver solver , HYPRE_Int logging ); -HYPRE_Int HYPRE_ParCSRFlexGMRESSetPrintLevel ( HYPRE_Solver solver , HYPRE_Int print_level ); -HYPRE_Int HYPRE_ParCSRFlexGMRESGetNumIterations ( HYPRE_Solver solver , HYPRE_Int *num_iterations ); -HYPRE_Int HYPRE_ParCSRFlexGMRESGetFinalRelativeResidualNorm ( HYPRE_Solver solver , HYPRE_Real *norm ); -HYPRE_Int HYPRE_ParCSRFlexGMRESGetResidual ( HYPRE_Solver solver , HYPRE_ParVector *residual ); -HYPRE_Int HYPRE_ParCSRFlexGMRESSetModifyPC ( HYPRE_Solver solver , HYPRE_PtrToModifyPCFcn modify_pc ); +HYPRE_Int HYPRE_ParCSRFlexGMRESSetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParCSRFlexGMRESSolve ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParCSRFlexGMRESSetKDim ( HYPRE_Solver solver, HYPRE_Int k_dim ); +HYPRE_Int HYPRE_ParCSRFlexGMRESSetTol ( HYPRE_Solver solver, HYPRE_Real tol ); +HYPRE_Int HYPRE_ParCSRFlexGMRESSetAbsoluteTol ( HYPRE_Solver solver, HYPRE_Real a_tol ); +HYPRE_Int HYPRE_ParCSRFlexGMRESSetMinIter ( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int HYPRE_ParCSRFlexGMRESSetMaxIter ( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int HYPRE_ParCSRFlexGMRESSetPrecond ( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, + HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int HYPRE_ParCSRFlexGMRESGetPrecond ( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int HYPRE_ParCSRFlexGMRESSetLogging ( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int HYPRE_ParCSRFlexGMRESSetPrintLevel ( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int HYPRE_ParCSRFlexGMRESGetNumIterations ( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int HYPRE_ParCSRFlexGMRESGetFinalRelativeResidualNorm ( HYPRE_Solver solver, + HYPRE_Real *norm ); +HYPRE_Int HYPRE_ParCSRFlexGMRESGetResidual ( HYPRE_Solver solver, HYPRE_ParVector *residual ); +HYPRE_Int HYPRE_ParCSRFlexGMRESSetModifyPC ( HYPRE_Solver solver, + HYPRE_PtrToModifyPCFcn modify_pc ); /* HYPRE_parcsr_gmres.c */ -HYPRE_Int HYPRE_ParCSRGMRESCreate ( MPI_Comm comm , HYPRE_Solver *solver ); +HYPRE_Int HYPRE_ParCSRGMRESCreate ( MPI_Comm comm, HYPRE_Solver *solver ); HYPRE_Int HYPRE_ParCSRGMRESDestroy ( HYPRE_Solver solver ); -HYPRE_Int HYPRE_ParCSRGMRESSetup ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParCSRGMRESSolve ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParCSRGMRESSetKDim ( HYPRE_Solver solver , HYPRE_Int k_dim ); -HYPRE_Int HYPRE_ParCSRGMRESSetTol ( HYPRE_Solver solver , HYPRE_Real tol ); -HYPRE_Int HYPRE_ParCSRGMRESSetAbsoluteTol ( HYPRE_Solver solver , HYPRE_Real a_tol ); -HYPRE_Int HYPRE_ParCSRGMRESSetMinIter ( HYPRE_Solver solver , HYPRE_Int min_iter ); -HYPRE_Int HYPRE_ParCSRGMRESSetMaxIter ( HYPRE_Solver solver , HYPRE_Int max_iter ); -HYPRE_Int HYPRE_ParCSRGMRESSetStopCrit ( HYPRE_Solver solver , HYPRE_Int stop_crit ); -HYPRE_Int HYPRE_ParCSRGMRESSetPrecond ( HYPRE_Solver solver , HYPRE_PtrToParSolverFcn precond , HYPRE_PtrToParSolverFcn precond_setup , HYPRE_Solver precond_solver ); -HYPRE_Int HYPRE_ParCSRGMRESGetPrecond ( HYPRE_Solver solver , HYPRE_Solver *precond_data_ptr ); -HYPRE_Int HYPRE_ParCSRGMRESSetLogging ( HYPRE_Solver solver , HYPRE_Int logging ); -HYPRE_Int HYPRE_ParCSRGMRESSetPrintLevel ( HYPRE_Solver solver , HYPRE_Int print_level ); -HYPRE_Int HYPRE_ParCSRGMRESGetNumIterations ( HYPRE_Solver solver , HYPRE_Int *num_iterations ); -HYPRE_Int HYPRE_ParCSRGMRESGetFinalRelativeResidualNorm ( HYPRE_Solver solver , HYPRE_Real *norm ); -HYPRE_Int HYPRE_ParCSRGMRESGetResidual ( HYPRE_Solver solver , HYPRE_ParVector *residual ); +HYPRE_Int HYPRE_ParCSRGMRESSetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParCSRGMRESSolve ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParCSRGMRESSetKDim ( HYPRE_Solver solver, HYPRE_Int k_dim ); +HYPRE_Int HYPRE_ParCSRGMRESSetTol ( HYPRE_Solver solver, HYPRE_Real tol ); +HYPRE_Int HYPRE_ParCSRGMRESSetAbsoluteTol ( HYPRE_Solver solver, HYPRE_Real a_tol ); +HYPRE_Int HYPRE_ParCSRGMRESSetMinIter ( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int HYPRE_ParCSRGMRESSetMaxIter ( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int HYPRE_ParCSRGMRESSetStopCrit ( HYPRE_Solver solver, HYPRE_Int stop_crit ); +HYPRE_Int HYPRE_ParCSRGMRESSetPrecond ( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, + HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int HYPRE_ParCSRGMRESGetPrecond ( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int HYPRE_ParCSRGMRESSetLogging ( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int HYPRE_ParCSRGMRESSetPrintLevel ( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int HYPRE_ParCSRGMRESGetNumIterations ( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int HYPRE_ParCSRGMRESGetFinalRelativeResidualNorm ( HYPRE_Solver solver, HYPRE_Real *norm ); +HYPRE_Int HYPRE_ParCSRGMRESGetResidual ( HYPRE_Solver solver, HYPRE_ParVector *residual ); /*HYPRE_parcsr_cogmres.c*/ -HYPRE_Int HYPRE_ParCSRCOGMRESCreate ( MPI_Comm comm , HYPRE_Solver *solver ); +HYPRE_Int HYPRE_ParCSRCOGMRESCreate ( MPI_Comm comm, HYPRE_Solver *solver ); HYPRE_Int HYPRE_ParCSRCOGMRESDestroy ( HYPRE_Solver solver ); -HYPRE_Int HYPRE_ParCSRCOGMRESSetup ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParCSRCOGMRESSolve ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParCSRCOGMRESSetKDim ( HYPRE_Solver solver , HYPRE_Int k_dim ); -HYPRE_Int HYPRE_ParCSRCOGMRESSetCGS2 ( HYPRE_Solver solver , HYPRE_Int cgs2 ); -HYPRE_Int HYPRE_ParCSRCOGMRESSetTol ( HYPRE_Solver solver , HYPRE_Real tol ); -HYPRE_Int HYPRE_ParCSRCOGMRESSetAbsoluteTol ( HYPRE_Solver solver , HYPRE_Real a_tol ); -HYPRE_Int HYPRE_ParCSRCOGMRESSetMinIter ( HYPRE_Solver solver , HYPRE_Int min_iter ); -HYPRE_Int HYPRE_ParCSRCOGMRESSetMaxIter ( HYPRE_Solver solver , HYPRE_Int max_iter ); -HYPRE_Int HYPRE_ParCSRCOGMRESSetPrecond ( HYPRE_Solver solver , HYPRE_PtrToParSolverFcn precond , HYPRE_PtrToParSolverFcn precond_setup , HYPRE_Solver precond_solver ); -HYPRE_Int HYPRE_ParCSRCOGMRESGetPrecond ( HYPRE_Solver solver , HYPRE_Solver *precond_data_ptr ); -HYPRE_Int HYPRE_ParCSRCOGMRESSetLogging ( HYPRE_Solver solver , HYPRE_Int logging ); -HYPRE_Int HYPRE_ParCSRCOGMRESSetPrintLevel ( HYPRE_Solver solver , HYPRE_Int print_level ); -HYPRE_Int HYPRE_ParCSRCOGMRESGetNumIterations ( HYPRE_Solver solver , HYPRE_Int *num_iterations ); -HYPRE_Int HYPRE_ParCSRCOGMRESGetFinalRelativeResidualNorm ( HYPRE_Solver solver , HYPRE_Real *norm ); -HYPRE_Int HYPRE_ParCSRCOGMRESGetResidual ( HYPRE_Solver solver , HYPRE_ParVector *residual ); +HYPRE_Int HYPRE_ParCSRCOGMRESSetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParCSRCOGMRESSolve ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParCSRCOGMRESSetKDim ( HYPRE_Solver solver, HYPRE_Int k_dim ); +HYPRE_Int HYPRE_ParCSRCOGMRESSetCGS2 ( HYPRE_Solver solver, HYPRE_Int cgs2 ); +HYPRE_Int HYPRE_ParCSRCOGMRESSetTol ( HYPRE_Solver solver, HYPRE_Real tol ); +HYPRE_Int HYPRE_ParCSRCOGMRESSetAbsoluteTol ( HYPRE_Solver solver, HYPRE_Real a_tol ); +HYPRE_Int HYPRE_ParCSRCOGMRESSetMinIter ( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int HYPRE_ParCSRCOGMRESSetMaxIter ( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int HYPRE_ParCSRCOGMRESSetPrecond ( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, + HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int HYPRE_ParCSRCOGMRESGetPrecond ( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int HYPRE_ParCSRCOGMRESSetLogging ( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int HYPRE_ParCSRCOGMRESSetPrintLevel ( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int HYPRE_ParCSRCOGMRESGetNumIterations ( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int HYPRE_ParCSRCOGMRESGetFinalRelativeResidualNorm ( HYPRE_Solver solver, HYPRE_Real *norm ); +HYPRE_Int HYPRE_ParCSRCOGMRESGetResidual ( HYPRE_Solver solver, HYPRE_ParVector *residual ); /* HYPRE_parcsr_hybrid.c */ HYPRE_Int HYPRE_ParCSRHybridCreate ( HYPRE_Solver *solver ); HYPRE_Int HYPRE_ParCSRHybridDestroy ( HYPRE_Solver solver ); -HYPRE_Int HYPRE_ParCSRHybridSetup ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParCSRHybridSolve ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParCSRHybridSetTol ( HYPRE_Solver solver , HYPRE_Real tol ); -HYPRE_Int HYPRE_ParCSRHybridSetAbsoluteTol ( HYPRE_Solver solver , HYPRE_Real tol ); -HYPRE_Int HYPRE_ParCSRHybridSetConvergenceTol ( HYPRE_Solver solver , HYPRE_Real cf_tol ); -HYPRE_Int HYPRE_ParCSRHybridSetDSCGMaxIter ( HYPRE_Solver solver , HYPRE_Int dscg_max_its ); -HYPRE_Int HYPRE_ParCSRHybridSetPCGMaxIter ( HYPRE_Solver solver , HYPRE_Int pcg_max_its ); -HYPRE_Int HYPRE_ParCSRHybridSetSetupType ( HYPRE_Solver solver , HYPRE_Int setup_type ); -HYPRE_Int HYPRE_ParCSRHybridSetSolverType ( HYPRE_Solver solver , HYPRE_Int solver_type ); -HYPRE_Int HYPRE_ParCSRHybridSetKDim ( HYPRE_Solver solver , HYPRE_Int k_dim ); -HYPRE_Int HYPRE_ParCSRHybridSetTwoNorm ( HYPRE_Solver solver , HYPRE_Int two_norm ); -HYPRE_Int HYPRE_ParCSRHybridSetStopCrit ( HYPRE_Solver solver , HYPRE_Int stop_crit ); -HYPRE_Int HYPRE_ParCSRHybridSetRelChange ( HYPRE_Solver solver , HYPRE_Int rel_change ); -HYPRE_Int HYPRE_ParCSRHybridSetPrecond ( HYPRE_Solver solver , HYPRE_PtrToParSolverFcn precond , HYPRE_PtrToParSolverFcn precond_setup , HYPRE_Solver precond_solver ); -HYPRE_Int HYPRE_ParCSRHybridSetLogging ( HYPRE_Solver solver , HYPRE_Int logging ); -HYPRE_Int HYPRE_ParCSRHybridSetPrintLevel ( HYPRE_Solver solver , HYPRE_Int print_level ); -HYPRE_Int HYPRE_ParCSRHybridSetStrongThreshold ( HYPRE_Solver solver , HYPRE_Real strong_threshold ); -HYPRE_Int HYPRE_ParCSRHybridSetMaxRowSum ( HYPRE_Solver solver , HYPRE_Real max_row_sum ); -HYPRE_Int HYPRE_ParCSRHybridSetTruncFactor ( HYPRE_Solver solver , HYPRE_Real trunc_factor ); -HYPRE_Int HYPRE_ParCSRHybridSetPMaxElmts ( HYPRE_Solver solver , HYPRE_Int p_max ); -HYPRE_Int HYPRE_ParCSRHybridSetMaxLevels ( HYPRE_Solver solver , HYPRE_Int max_levels ); -HYPRE_Int HYPRE_ParCSRHybridSetMeasureType ( HYPRE_Solver solver , HYPRE_Int measure_type ); -HYPRE_Int HYPRE_ParCSRHybridSetCoarsenType ( HYPRE_Solver solver , HYPRE_Int coarsen_type ); -HYPRE_Int HYPRE_ParCSRHybridSetInterpType ( HYPRE_Solver solver , HYPRE_Int interp_type ); -HYPRE_Int HYPRE_ParCSRHybridSetCycleType ( HYPRE_Solver solver , HYPRE_Int cycle_type ); -HYPRE_Int HYPRE_ParCSRHybridSetNumGridSweeps ( HYPRE_Solver solver , HYPRE_Int *num_grid_sweeps ); -HYPRE_Int HYPRE_ParCSRHybridSetGridRelaxType ( HYPRE_Solver solver , HYPRE_Int *grid_relax_type ); -HYPRE_Int HYPRE_ParCSRHybridSetGridRelaxPoints ( HYPRE_Solver solver , HYPRE_Int **grid_relax_points ); -HYPRE_Int HYPRE_ParCSRHybridSetNumSweeps ( HYPRE_Solver solver , HYPRE_Int num_sweeps ); -HYPRE_Int HYPRE_ParCSRHybridSetCycleNumSweeps ( HYPRE_Solver solver , HYPRE_Int num_sweeps , HYPRE_Int k ); -HYPRE_Int HYPRE_ParCSRHybridSetRelaxType ( HYPRE_Solver solver , HYPRE_Int relax_type ); -HYPRE_Int HYPRE_ParCSRHybridSetKeepTranspose ( HYPRE_Solver solver , HYPRE_Int keepT ); -HYPRE_Int HYPRE_ParCSRHybridSetCycleRelaxType ( HYPRE_Solver solver , HYPRE_Int relax_type , HYPRE_Int k ); -HYPRE_Int HYPRE_ParCSRHybridSetRelaxOrder ( HYPRE_Solver solver , HYPRE_Int relax_order ); -HYPRE_Int HYPRE_ParCSRHybridSetMaxCoarseSize ( HYPRE_Solver solver , HYPRE_Int max_coarse_size ); -HYPRE_Int HYPRE_ParCSRHybridSetMinCoarseSize ( HYPRE_Solver solver , HYPRE_Int min_coarse_size ); -HYPRE_Int HYPRE_ParCSRHybridSetSeqThreshold ( HYPRE_Solver solver , HYPRE_Int seq_threshold ); -HYPRE_Int HYPRE_ParCSRHybridSetRelaxWt ( HYPRE_Solver solver , HYPRE_Real relax_wt ); -HYPRE_Int HYPRE_ParCSRHybridSetLevelRelaxWt ( HYPRE_Solver solver , HYPRE_Real relax_wt , HYPRE_Int level ); -HYPRE_Int HYPRE_ParCSRHybridSetOuterWt ( HYPRE_Solver solver , HYPRE_Real outer_wt ); -HYPRE_Int HYPRE_ParCSRHybridSetLevelOuterWt ( HYPRE_Solver solver , HYPRE_Real outer_wt , HYPRE_Int level ); -HYPRE_Int HYPRE_ParCSRHybridSetRelaxWeight ( HYPRE_Solver solver , HYPRE_Real *relax_weight ); -HYPRE_Int HYPRE_ParCSRHybridSetOmega ( HYPRE_Solver solver , HYPRE_Real *omega ); -HYPRE_Int HYPRE_ParCSRHybridSetAggNumLevels ( HYPRE_Solver solver , HYPRE_Int agg_num_levels ); -HYPRE_Int HYPRE_ParCSRHybridSetNumPaths ( HYPRE_Solver solver , HYPRE_Int num_paths ); -HYPRE_Int HYPRE_ParCSRHybridSetNumFunctions ( HYPRE_Solver solver , HYPRE_Int num_functions ); -HYPRE_Int HYPRE_ParCSRHybridSetNodal ( HYPRE_Solver solver , HYPRE_Int nodal ); -HYPRE_Int HYPRE_ParCSRHybridSetDofFunc ( HYPRE_Solver solver , HYPRE_Int *dof_func ); -HYPRE_Int HYPRE_ParCSRHybridSetNonGalerkinTol ( HYPRE_Solver solver , HYPRE_Int nongalerk_num_tol, HYPRE_Real *nongalerkin_tol ); -HYPRE_Int HYPRE_ParCSRHybridGetNumIterations ( HYPRE_Solver solver , HYPRE_Int *num_its ); -HYPRE_Int HYPRE_ParCSRHybridGetDSCGNumIterations ( HYPRE_Solver solver , HYPRE_Int *dscg_num_its ); -HYPRE_Int HYPRE_ParCSRHybridGetPCGNumIterations ( HYPRE_Solver solver , HYPRE_Int *pcg_num_its ); -HYPRE_Int HYPRE_ParCSRHybridGetFinalRelativeResidualNorm ( HYPRE_Solver solver , HYPRE_Real *norm ); +HYPRE_Int HYPRE_ParCSRHybridSetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParCSRHybridSolve ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParCSRHybridSetTol ( HYPRE_Solver solver, HYPRE_Real tol ); +HYPRE_Int HYPRE_ParCSRHybridSetAbsoluteTol ( HYPRE_Solver solver, HYPRE_Real tol ); +HYPRE_Int HYPRE_ParCSRHybridSetConvergenceTol ( HYPRE_Solver solver, HYPRE_Real cf_tol ); +HYPRE_Int HYPRE_ParCSRHybridSetDSCGMaxIter ( HYPRE_Solver solver, HYPRE_Int dscg_max_its ); +HYPRE_Int HYPRE_ParCSRHybridSetPCGMaxIter ( HYPRE_Solver solver, HYPRE_Int pcg_max_its ); +HYPRE_Int HYPRE_ParCSRHybridSetSetupType ( HYPRE_Solver solver, HYPRE_Int setup_type ); +HYPRE_Int HYPRE_ParCSRHybridSetSolverType ( HYPRE_Solver solver, HYPRE_Int solver_type ); +HYPRE_Int HYPRE_ParCSRHybridSetKDim ( HYPRE_Solver solver, HYPRE_Int k_dim ); +HYPRE_Int HYPRE_ParCSRHybridSetTwoNorm ( HYPRE_Solver solver, HYPRE_Int two_norm ); +HYPRE_Int HYPRE_ParCSRHybridSetStopCrit ( HYPRE_Solver solver, HYPRE_Int stop_crit ); +HYPRE_Int HYPRE_ParCSRHybridSetRelChange ( HYPRE_Solver solver, HYPRE_Int rel_change ); +HYPRE_Int HYPRE_ParCSRHybridSetPrecond ( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, + HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int HYPRE_ParCSRHybridSetLogging ( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int HYPRE_ParCSRHybridSetPrintLevel ( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int HYPRE_ParCSRHybridSetStrongThreshold ( HYPRE_Solver solver, HYPRE_Real strong_threshold ); +HYPRE_Int HYPRE_ParCSRHybridSetMaxRowSum ( HYPRE_Solver solver, HYPRE_Real max_row_sum ); +HYPRE_Int HYPRE_ParCSRHybridSetTruncFactor ( HYPRE_Solver solver, HYPRE_Real trunc_factor ); +HYPRE_Int HYPRE_ParCSRHybridSetPMaxElmts ( HYPRE_Solver solver, HYPRE_Int p_max ); +HYPRE_Int HYPRE_ParCSRHybridSetMaxLevels ( HYPRE_Solver solver, HYPRE_Int max_levels ); +HYPRE_Int HYPRE_ParCSRHybridSetMeasureType ( HYPRE_Solver solver, HYPRE_Int measure_type ); +HYPRE_Int HYPRE_ParCSRHybridSetCoarsenType ( HYPRE_Solver solver, HYPRE_Int coarsen_type ); +HYPRE_Int HYPRE_ParCSRHybridSetInterpType ( HYPRE_Solver solver, HYPRE_Int interp_type ); +HYPRE_Int HYPRE_ParCSRHybridSetCycleType ( HYPRE_Solver solver, HYPRE_Int cycle_type ); +HYPRE_Int HYPRE_ParCSRHybridSetNumGridSweeps ( HYPRE_Solver solver, HYPRE_Int *num_grid_sweeps ); +HYPRE_Int HYPRE_ParCSRHybridSetGridRelaxType ( HYPRE_Solver solver, HYPRE_Int *grid_relax_type ); +HYPRE_Int HYPRE_ParCSRHybridSetGridRelaxPoints ( HYPRE_Solver solver, + HYPRE_Int **grid_relax_points ); +HYPRE_Int HYPRE_ParCSRHybridSetNumSweeps ( HYPRE_Solver solver, HYPRE_Int num_sweeps ); +HYPRE_Int HYPRE_ParCSRHybridSetCycleNumSweeps ( HYPRE_Solver solver, HYPRE_Int num_sweeps, + HYPRE_Int k ); +HYPRE_Int HYPRE_ParCSRHybridSetRelaxType ( HYPRE_Solver solver, HYPRE_Int relax_type ); +HYPRE_Int HYPRE_ParCSRHybridSetKeepTranspose ( HYPRE_Solver solver, HYPRE_Int keepT ); +HYPRE_Int HYPRE_ParCSRHybridSetCycleRelaxType ( HYPRE_Solver solver, HYPRE_Int relax_type, + HYPRE_Int k ); +HYPRE_Int HYPRE_ParCSRHybridSetRelaxOrder ( HYPRE_Solver solver, HYPRE_Int relax_order ); +HYPRE_Int HYPRE_ParCSRHybridSetMaxCoarseSize ( HYPRE_Solver solver, HYPRE_Int max_coarse_size ); +HYPRE_Int HYPRE_ParCSRHybridSetMinCoarseSize ( HYPRE_Solver solver, HYPRE_Int min_coarse_size ); +HYPRE_Int HYPRE_ParCSRHybridSetSeqThreshold ( HYPRE_Solver solver, HYPRE_Int seq_threshold ); +HYPRE_Int HYPRE_ParCSRHybridSetRelaxWt ( HYPRE_Solver solver, HYPRE_Real relax_wt ); +HYPRE_Int HYPRE_ParCSRHybridSetLevelRelaxWt ( HYPRE_Solver solver, HYPRE_Real relax_wt, + HYPRE_Int level ); +HYPRE_Int HYPRE_ParCSRHybridSetOuterWt ( HYPRE_Solver solver, HYPRE_Real outer_wt ); +HYPRE_Int HYPRE_ParCSRHybridSetLevelOuterWt ( HYPRE_Solver solver, HYPRE_Real outer_wt, + HYPRE_Int level ); +HYPRE_Int HYPRE_ParCSRHybridSetRelaxWeight ( HYPRE_Solver solver, HYPRE_Real *relax_weight ); +HYPRE_Int HYPRE_ParCSRHybridSetOmega ( HYPRE_Solver solver, HYPRE_Real *omega ); +HYPRE_Int HYPRE_ParCSRHybridSetAggNumLevels ( HYPRE_Solver solver, HYPRE_Int agg_num_levels ); +HYPRE_Int HYPRE_ParCSRHybridSetNumPaths ( HYPRE_Solver solver, HYPRE_Int num_paths ); +HYPRE_Int HYPRE_ParCSRHybridSetNumFunctions ( HYPRE_Solver solver, HYPRE_Int num_functions ); +HYPRE_Int HYPRE_ParCSRHybridSetNodal ( HYPRE_Solver solver, HYPRE_Int nodal ); +HYPRE_Int HYPRE_ParCSRHybridSetDofFunc ( HYPRE_Solver solver, HYPRE_Int *dof_func ); +HYPRE_Int HYPRE_ParCSRHybridSetNonGalerkinTol ( HYPRE_Solver solver, HYPRE_Int nongalerk_num_tol, + HYPRE_Real *nongalerkin_tol ); +HYPRE_Int HYPRE_ParCSRHybridGetNumIterations ( HYPRE_Solver solver, HYPRE_Int *num_its ); +HYPRE_Int HYPRE_ParCSRHybridGetDSCGNumIterations ( HYPRE_Solver solver, HYPRE_Int *dscg_num_its ); +HYPRE_Int HYPRE_ParCSRHybridGetPCGNumIterations ( HYPRE_Solver solver, HYPRE_Int *pcg_num_its ); +HYPRE_Int HYPRE_ParCSRHybridGetFinalRelativeResidualNorm ( HYPRE_Solver solver, HYPRE_Real *norm ); HYPRE_Int HYPRE_ParCSRHybridGetSetupSolveTime( HYPRE_Solver solver, HYPRE_Real *time ); /* HYPRE_parcsr_int.c */ -HYPRE_Int hypre_ParSetRandomValues ( void *v , HYPRE_Int seed ); -HYPRE_Int hypre_ParPrintVector ( void *v , const char *file ); -void *hypre_ParReadVector ( MPI_Comm comm , const char *file ); +HYPRE_Int hypre_ParSetRandomValues ( void *v, HYPRE_Int seed ); +HYPRE_Int hypre_ParPrintVector ( void *v, const char *file ); +void *hypre_ParReadVector ( MPI_Comm comm, const char *file ); HYPRE_Int hypre_ParVectorSize ( void *x ); -HYPRE_Int HYPRE_ParCSRMultiVectorPrint ( void *x_ , const char *fileName ); -void *HYPRE_ParCSRMultiVectorRead ( MPI_Comm comm , void *ii_ , const char *fileName ); -HYPRE_Int aux_maskCount ( HYPRE_Int n , HYPRE_Int *mask ); -void aux_indexFromMask ( HYPRE_Int n , HYPRE_Int *mask , HYPRE_Int *index ); +HYPRE_Int HYPRE_ParCSRMultiVectorPrint ( void *x_, const char *fileName ); +void *HYPRE_ParCSRMultiVectorRead ( MPI_Comm comm, void *ii_, const char *fileName ); +HYPRE_Int aux_maskCount ( HYPRE_Int n, HYPRE_Int *mask ); +void aux_indexFromMask ( HYPRE_Int n, HYPRE_Int *mask, HYPRE_Int *index ); HYPRE_Int HYPRE_TempParCSRSetupInterpreter ( mv_InterfaceInterpreter *i ); HYPRE_Int HYPRE_ParCSRSetupInterpreter ( mv_InterfaceInterpreter *i ); HYPRE_Int HYPRE_ParCSRSetupMatvec ( HYPRE_MatvecFunctions *mv ); /* HYPRE_parcsr_lgmres.c */ -HYPRE_Int HYPRE_ParCSRLGMRESCreate ( MPI_Comm comm , HYPRE_Solver *solver ); +HYPRE_Int HYPRE_ParCSRLGMRESCreate ( MPI_Comm comm, HYPRE_Solver *solver ); HYPRE_Int HYPRE_ParCSRLGMRESDestroy ( HYPRE_Solver solver ); -HYPRE_Int HYPRE_ParCSRLGMRESSetup ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParCSRLGMRESSolve ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParCSRLGMRESSetKDim ( HYPRE_Solver solver , HYPRE_Int k_dim ); -HYPRE_Int HYPRE_ParCSRLGMRESSetAugDim ( HYPRE_Solver solver , HYPRE_Int aug_dim ); -HYPRE_Int HYPRE_ParCSRLGMRESSetTol ( HYPRE_Solver solver , HYPRE_Real tol ); -HYPRE_Int HYPRE_ParCSRLGMRESSetAbsoluteTol ( HYPRE_Solver solver , HYPRE_Real a_tol ); -HYPRE_Int HYPRE_ParCSRLGMRESSetMinIter ( HYPRE_Solver solver , HYPRE_Int min_iter ); -HYPRE_Int HYPRE_ParCSRLGMRESSetMaxIter ( HYPRE_Solver solver , HYPRE_Int max_iter ); -HYPRE_Int HYPRE_ParCSRLGMRESSetPrecond ( HYPRE_Solver solver , HYPRE_PtrToParSolverFcn precond , HYPRE_PtrToParSolverFcn precond_setup , HYPRE_Solver precond_solver ); -HYPRE_Int HYPRE_ParCSRLGMRESGetPrecond ( HYPRE_Solver solver , HYPRE_Solver *precond_data_ptr ); -HYPRE_Int HYPRE_ParCSRLGMRESSetLogging ( HYPRE_Solver solver , HYPRE_Int logging ); -HYPRE_Int HYPRE_ParCSRLGMRESSetPrintLevel ( HYPRE_Solver solver , HYPRE_Int print_level ); -HYPRE_Int HYPRE_ParCSRLGMRESGetNumIterations ( HYPRE_Solver solver , HYPRE_Int *num_iterations ); -HYPRE_Int HYPRE_ParCSRLGMRESGetFinalRelativeResidualNorm ( HYPRE_Solver solver , HYPRE_Real *norm ); -HYPRE_Int HYPRE_ParCSRLGMRESGetResidual ( HYPRE_Solver solver , HYPRE_ParVector *residual ); +HYPRE_Int HYPRE_ParCSRLGMRESSetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParCSRLGMRESSolve ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParCSRLGMRESSetKDim ( HYPRE_Solver solver, HYPRE_Int k_dim ); +HYPRE_Int HYPRE_ParCSRLGMRESSetAugDim ( HYPRE_Solver solver, HYPRE_Int aug_dim ); +HYPRE_Int HYPRE_ParCSRLGMRESSetTol ( HYPRE_Solver solver, HYPRE_Real tol ); +HYPRE_Int HYPRE_ParCSRLGMRESSetAbsoluteTol ( HYPRE_Solver solver, HYPRE_Real a_tol ); +HYPRE_Int HYPRE_ParCSRLGMRESSetMinIter ( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int HYPRE_ParCSRLGMRESSetMaxIter ( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int HYPRE_ParCSRLGMRESSetPrecond ( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, + HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int HYPRE_ParCSRLGMRESGetPrecond ( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int HYPRE_ParCSRLGMRESSetLogging ( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int HYPRE_ParCSRLGMRESSetPrintLevel ( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int HYPRE_ParCSRLGMRESGetNumIterations ( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int HYPRE_ParCSRLGMRESGetFinalRelativeResidualNorm ( HYPRE_Solver solver, HYPRE_Real *norm ); +HYPRE_Int HYPRE_ParCSRLGMRESGetResidual ( HYPRE_Solver solver, HYPRE_ParVector *residual ); /* HYPRE_parcsr_ParaSails.c */ -HYPRE_Int HYPRE_ParCSRParaSailsCreate ( MPI_Comm comm , HYPRE_Solver *solver ); +HYPRE_Int HYPRE_ParCSRParaSailsCreate ( MPI_Comm comm, HYPRE_Solver *solver ); HYPRE_Int HYPRE_ParCSRParaSailsDestroy ( HYPRE_Solver solver ); -HYPRE_Int HYPRE_ParCSRParaSailsSetup ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParCSRParaSailsSolve ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParCSRParaSailsSetParams ( HYPRE_Solver solver , HYPRE_Real thresh , HYPRE_Int nlevels ); -HYPRE_Int HYPRE_ParCSRParaSailsSetFilter ( HYPRE_Solver solver , HYPRE_Real filter ); -HYPRE_Int HYPRE_ParCSRParaSailsGetFilter ( HYPRE_Solver solver , HYPRE_Real *filter ); -HYPRE_Int HYPRE_ParCSRParaSailsSetSym ( HYPRE_Solver solver , HYPRE_Int sym ); -HYPRE_Int HYPRE_ParCSRParaSailsSetLoadbal ( HYPRE_Solver solver , HYPRE_Real loadbal ); -HYPRE_Int HYPRE_ParCSRParaSailsGetLoadbal ( HYPRE_Solver solver , HYPRE_Real *loadbal ); -HYPRE_Int HYPRE_ParCSRParaSailsSetReuse ( HYPRE_Solver solver , HYPRE_Int reuse ); -HYPRE_Int HYPRE_ParCSRParaSailsSetLogging ( HYPRE_Solver solver , HYPRE_Int logging ); -HYPRE_Int HYPRE_ParaSailsCreate ( MPI_Comm comm , HYPRE_Solver *solver ); +HYPRE_Int HYPRE_ParCSRParaSailsSetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParCSRParaSailsSolve ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParCSRParaSailsSetParams ( HYPRE_Solver solver, HYPRE_Real thresh, + HYPRE_Int nlevels ); +HYPRE_Int HYPRE_ParCSRParaSailsSetFilter ( HYPRE_Solver solver, HYPRE_Real filter ); +HYPRE_Int HYPRE_ParCSRParaSailsGetFilter ( HYPRE_Solver solver, HYPRE_Real *filter ); +HYPRE_Int HYPRE_ParCSRParaSailsSetSym ( HYPRE_Solver solver, HYPRE_Int sym ); +HYPRE_Int HYPRE_ParCSRParaSailsSetLoadbal ( HYPRE_Solver solver, HYPRE_Real loadbal ); +HYPRE_Int HYPRE_ParCSRParaSailsGetLoadbal ( HYPRE_Solver solver, HYPRE_Real *loadbal ); +HYPRE_Int HYPRE_ParCSRParaSailsSetReuse ( HYPRE_Solver solver, HYPRE_Int reuse ); +HYPRE_Int HYPRE_ParCSRParaSailsSetLogging ( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int HYPRE_ParaSailsCreate ( MPI_Comm comm, HYPRE_Solver *solver ); HYPRE_Int HYPRE_ParaSailsDestroy ( HYPRE_Solver solver ); -HYPRE_Int HYPRE_ParaSailsSetup ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParaSailsSolve ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParaSailsSetParams ( HYPRE_Solver solver , HYPRE_Real thresh , HYPRE_Int nlevels ); -HYPRE_Int HYPRE_ParaSailsSetThresh ( HYPRE_Solver solver , HYPRE_Real thresh ); -HYPRE_Int HYPRE_ParaSailsGetThresh ( HYPRE_Solver solver , HYPRE_Real *thresh ); -HYPRE_Int HYPRE_ParaSailsSetNlevels ( HYPRE_Solver solver , HYPRE_Int nlevels ); -HYPRE_Int HYPRE_ParaSailsGetNlevels ( HYPRE_Solver solver , HYPRE_Int *nlevels ); -HYPRE_Int HYPRE_ParaSailsSetFilter ( HYPRE_Solver solver , HYPRE_Real filter ); -HYPRE_Int HYPRE_ParaSailsGetFilter ( HYPRE_Solver solver , HYPRE_Real *filter ); -HYPRE_Int HYPRE_ParaSailsSetSym ( HYPRE_Solver solver , HYPRE_Int sym ); -HYPRE_Int HYPRE_ParaSailsGetSym ( HYPRE_Solver solver , HYPRE_Int *sym ); -HYPRE_Int HYPRE_ParaSailsSetLoadbal ( HYPRE_Solver solver , HYPRE_Real loadbal ); -HYPRE_Int HYPRE_ParaSailsGetLoadbal ( HYPRE_Solver solver , HYPRE_Real *loadbal ); -HYPRE_Int HYPRE_ParaSailsSetReuse ( HYPRE_Solver solver , HYPRE_Int reuse ); -HYPRE_Int HYPRE_ParaSailsGetReuse ( HYPRE_Solver solver , HYPRE_Int *reuse ); -HYPRE_Int HYPRE_ParaSailsSetLogging ( HYPRE_Solver solver , HYPRE_Int logging ); -HYPRE_Int HYPRE_ParaSailsGetLogging ( HYPRE_Solver solver , HYPRE_Int *logging ); -HYPRE_Int HYPRE_ParaSailsBuildIJMatrix ( HYPRE_Solver solver , HYPRE_IJMatrix *pij_A ); +HYPRE_Int HYPRE_ParaSailsSetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParaSailsSolve ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParaSailsSetParams ( HYPRE_Solver solver, HYPRE_Real thresh, HYPRE_Int nlevels ); +HYPRE_Int HYPRE_ParaSailsSetThresh ( HYPRE_Solver solver, HYPRE_Real thresh ); +HYPRE_Int HYPRE_ParaSailsGetThresh ( HYPRE_Solver solver, HYPRE_Real *thresh ); +HYPRE_Int HYPRE_ParaSailsSetNlevels ( HYPRE_Solver solver, HYPRE_Int nlevels ); +HYPRE_Int HYPRE_ParaSailsGetNlevels ( HYPRE_Solver solver, HYPRE_Int *nlevels ); +HYPRE_Int HYPRE_ParaSailsSetFilter ( HYPRE_Solver solver, HYPRE_Real filter ); +HYPRE_Int HYPRE_ParaSailsGetFilter ( HYPRE_Solver solver, HYPRE_Real *filter ); +HYPRE_Int HYPRE_ParaSailsSetSym ( HYPRE_Solver solver, HYPRE_Int sym ); +HYPRE_Int HYPRE_ParaSailsGetSym ( HYPRE_Solver solver, HYPRE_Int *sym ); +HYPRE_Int HYPRE_ParaSailsSetLoadbal ( HYPRE_Solver solver, HYPRE_Real loadbal ); +HYPRE_Int HYPRE_ParaSailsGetLoadbal ( HYPRE_Solver solver, HYPRE_Real *loadbal ); +HYPRE_Int HYPRE_ParaSailsSetReuse ( HYPRE_Solver solver, HYPRE_Int reuse ); +HYPRE_Int HYPRE_ParaSailsGetReuse ( HYPRE_Solver solver, HYPRE_Int *reuse ); +HYPRE_Int HYPRE_ParaSailsSetLogging ( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int HYPRE_ParaSailsGetLogging ( HYPRE_Solver solver, HYPRE_Int *logging ); +HYPRE_Int HYPRE_ParaSailsBuildIJMatrix ( HYPRE_Solver solver, HYPRE_IJMatrix *pij_A ); + +/* HYPRE_parcsr_fsai.c */ +HYPRE_Int HYPRE_FSAICreate ( HYPRE_Solver *solver); +HYPRE_Int HYPRE_FSAIDestroy ( HYPRE_Solver solver ); +HYPRE_Int HYPRE_FSAISetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_FSAISolve ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_FSAISetAlgoType ( HYPRE_Solver solver, HYPRE_Int algo_type ); +HYPRE_Int HYPRE_FSAIGetAlgoType ( HYPRE_Solver solver, HYPRE_Int *algo_type ); +HYPRE_Int HYPRE_FSAISetLocalSolveType ( HYPRE_Solver solver, HYPRE_Int local_solve_type ); +HYPRE_Int HYPRE_FSAIGetLocalSolveType ( HYPRE_Solver solver, HYPRE_Int *local_solve_type ); +HYPRE_Int HYPRE_FSAISetMaxSteps ( HYPRE_Solver solver, HYPRE_Int max_steps ); +HYPRE_Int HYPRE_FSAIGetMaxSteps ( HYPRE_Solver solver, HYPRE_Int *max_steps ); +HYPRE_Int HYPRE_FSAISetMaxStepSize ( HYPRE_Solver solver, HYPRE_Int max_step_size ); +HYPRE_Int HYPRE_FSAIGetMaxStepSize ( HYPRE_Solver solver, HYPRE_Int *max_step_size ); +HYPRE_Int HYPRE_FSAISetMaxNnzRow ( HYPRE_Solver solver, HYPRE_Int max_nnz_row ); +HYPRE_Int HYPRE_FSAIGetMaxNnzRow ( HYPRE_Solver solver, HYPRE_Int *max_nnz_row ); +HYPRE_Int HYPRE_FSAISetNumLevels ( HYPRE_Solver solver, HYPRE_Int num_levels ); +HYPRE_Int HYPRE_FSAIGetNumLevels ( HYPRE_Solver solver, HYPRE_Int *num_levels ); +HYPRE_Int HYPRE_FSAISetThreshold ( HYPRE_Solver solver, HYPRE_Real threshold ); +HYPRE_Int HYPRE_FSAIGetThreshold ( HYPRE_Solver solver, HYPRE_Real *threshold ); +HYPRE_Int HYPRE_FSAISetKapTolerance ( HYPRE_Solver solver, HYPRE_Real kap_tolerance ); +HYPRE_Int HYPRE_FSAIGetKapTolerance ( HYPRE_Solver solver, HYPRE_Real *kap_tolerance ); +HYPRE_Int HYPRE_FSAISetTolerance ( HYPRE_Solver solver, HYPRE_Real tolerance ); +HYPRE_Int HYPRE_FSAIGetTolerance ( HYPRE_Solver solver, HYPRE_Real *tolerance ); +HYPRE_Int HYPRE_FSAISetOmega ( HYPRE_Solver solver, HYPRE_Real omega ); +HYPRE_Int HYPRE_FSAIGetOmega ( HYPRE_Solver solver, HYPRE_Real *omega ); +HYPRE_Int HYPRE_FSAISetMaxIterations ( HYPRE_Solver solver, HYPRE_Int max_iterations ); +HYPRE_Int HYPRE_FSAIGetMaxIterations ( HYPRE_Solver solver, HYPRE_Int *max_iterations ); +HYPRE_Int HYPRE_FSAISetEigMaxIters ( HYPRE_Solver solver, HYPRE_Int eig_max_iters ); +HYPRE_Int HYPRE_FSAIGetEigMaxIters ( HYPRE_Solver solver, HYPRE_Int *eig_max_iters ); +HYPRE_Int HYPRE_FSAISetZeroGuess ( HYPRE_Solver solver, HYPRE_Int zero_guess ); +HYPRE_Int HYPRE_FSAIGetZeroGuess ( HYPRE_Solver solver, HYPRE_Int *zero_guess ); +HYPRE_Int HYPRE_FSAISetPrintLevel ( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int HYPRE_FSAIGetPrintLevel ( HYPRE_Solver solver, HYPRE_Int *print_level ); /* HYPRE_parcsr_pcg.c */ -HYPRE_Int HYPRE_ParCSRPCGCreate ( MPI_Comm comm , HYPRE_Solver *solver ); +HYPRE_Int HYPRE_ParCSRPCGCreate ( MPI_Comm comm, HYPRE_Solver *solver ); HYPRE_Int HYPRE_ParCSRPCGDestroy ( HYPRE_Solver solver ); -HYPRE_Int HYPRE_ParCSRPCGSetup ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParCSRPCGSolve ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParCSRPCGSetTol ( HYPRE_Solver solver , HYPRE_Real tol ); -HYPRE_Int HYPRE_ParCSRPCGSetAbsoluteTol ( HYPRE_Solver solver , HYPRE_Real a_tol ); -HYPRE_Int HYPRE_ParCSRPCGSetMaxIter ( HYPRE_Solver solver , HYPRE_Int max_iter ); -HYPRE_Int HYPRE_ParCSRPCGSetStopCrit ( HYPRE_Solver solver , HYPRE_Int stop_crit ); -HYPRE_Int HYPRE_ParCSRPCGSetTwoNorm ( HYPRE_Solver solver , HYPRE_Int two_norm ); -HYPRE_Int HYPRE_ParCSRPCGSetRelChange ( HYPRE_Solver solver , HYPRE_Int rel_change ); -HYPRE_Int HYPRE_ParCSRPCGSetPrecond ( HYPRE_Solver solver , HYPRE_PtrToParSolverFcn precond , HYPRE_PtrToParSolverFcn precond_setup , HYPRE_Solver precond_solver ); -HYPRE_Int HYPRE_ParCSRPCGGetPrecond ( HYPRE_Solver solver , HYPRE_Solver *precond_data_ptr ); -HYPRE_Int HYPRE_ParCSRPCGSetPrintLevel ( HYPRE_Solver solver , HYPRE_Int level ); -HYPRE_Int HYPRE_ParCSRPCGSetLogging ( HYPRE_Solver solver , HYPRE_Int level ); -HYPRE_Int HYPRE_ParCSRPCGGetNumIterations ( HYPRE_Solver solver , HYPRE_Int *num_iterations ); -HYPRE_Int HYPRE_ParCSRPCGGetFinalRelativeResidualNorm ( HYPRE_Solver solver , HYPRE_Real *norm ); -HYPRE_Int HYPRE_ParCSRPCGGetResidual ( HYPRE_Solver solver , HYPRE_ParVector *residual ); -HYPRE_Int HYPRE_ParCSRDiagScaleSetup ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector y , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParCSRDiagScale ( HYPRE_Solver solver , HYPRE_ParCSRMatrix HA , HYPRE_ParVector Hy , HYPRE_ParVector Hx ); -HYPRE_Int HYPRE_ParCSROnProcTriSetup ( HYPRE_Solver solver , HYPRE_ParCSRMatrix HA , HYPRE_ParVector Hy , HYPRE_ParVector Hx ); -HYPRE_Int HYPRE_ParCSROnProcTriSolve ( HYPRE_Solver solver , HYPRE_ParCSRMatrix HA , HYPRE_ParVector Hy , HYPRE_ParVector Hx ); +HYPRE_Int HYPRE_ParCSRPCGSetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParCSRPCGSolve ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParCSRPCGSetTol ( HYPRE_Solver solver, HYPRE_Real tol ); +HYPRE_Int HYPRE_ParCSRPCGSetAbsoluteTol ( HYPRE_Solver solver, HYPRE_Real a_tol ); +HYPRE_Int HYPRE_ParCSRPCGSetMaxIter ( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int HYPRE_ParCSRPCGSetStopCrit ( HYPRE_Solver solver, HYPRE_Int stop_crit ); +HYPRE_Int HYPRE_ParCSRPCGSetTwoNorm ( HYPRE_Solver solver, HYPRE_Int two_norm ); +HYPRE_Int HYPRE_ParCSRPCGSetRelChange ( HYPRE_Solver solver, HYPRE_Int rel_change ); +HYPRE_Int HYPRE_ParCSRPCGSetPrecond ( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, + HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int HYPRE_ParCSRPCGGetPrecond ( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int HYPRE_ParCSRPCGSetPrintLevel ( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int HYPRE_ParCSRPCGSetLogging ( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int HYPRE_ParCSRPCGGetNumIterations ( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int HYPRE_ParCSRPCGGetFinalRelativeResidualNorm ( HYPRE_Solver solver, HYPRE_Real *norm ); +HYPRE_Int HYPRE_ParCSRPCGGetResidual ( HYPRE_Solver solver, HYPRE_ParVector *residual ); +HYPRE_Int HYPRE_ParCSRDiagScaleSetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector y, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParCSRDiagScale ( HYPRE_Solver solver, HYPRE_ParCSRMatrix HA, HYPRE_ParVector Hy, + HYPRE_ParVector Hx ); +HYPRE_Int HYPRE_ParCSROnProcTriSetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix HA, + HYPRE_ParVector Hy, HYPRE_ParVector Hx ); +HYPRE_Int HYPRE_ParCSROnProcTriSolve ( HYPRE_Solver solver, HYPRE_ParCSRMatrix HA, + HYPRE_ParVector Hy, HYPRE_ParVector Hx ); /* HYPRE_parcsr_pilut.c */ -HYPRE_Int HYPRE_ParCSRPilutCreate ( MPI_Comm comm , HYPRE_Solver *solver ); +HYPRE_Int HYPRE_ParCSRPilutCreate ( MPI_Comm comm, HYPRE_Solver *solver ); HYPRE_Int HYPRE_ParCSRPilutDestroy ( HYPRE_Solver solver ); -HYPRE_Int HYPRE_ParCSRPilutSetup ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParCSRPilutSolve ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParCSRPilutSetMaxIter ( HYPRE_Solver solver , HYPRE_Int max_iter ); -HYPRE_Int HYPRE_ParCSRPilutSetDropTolerance ( HYPRE_Solver solver , HYPRE_Real tol ); -HYPRE_Int HYPRE_ParCSRPilutSetFactorRowSize ( HYPRE_Solver solver , HYPRE_Int size ); +HYPRE_Int HYPRE_ParCSRPilutSetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParCSRPilutSolve ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParCSRPilutSetMaxIter ( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int HYPRE_ParCSRPilutSetDropTolerance ( HYPRE_Solver solver, HYPRE_Real tol ); +HYPRE_Int HYPRE_ParCSRPilutSetFactorRowSize ( HYPRE_Solver solver, HYPRE_Int size ); /* HYPRE_parcsr_schwarz.c */ HYPRE_Int HYPRE_SchwarzCreate ( HYPRE_Solver *solver ); HYPRE_Int HYPRE_SchwarzDestroy ( HYPRE_Solver solver ); -HYPRE_Int HYPRE_SchwarzSetup ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_SchwarzSolve ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_SchwarzSetVariant ( HYPRE_Solver solver , HYPRE_Int variant ); -HYPRE_Int HYPRE_SchwarzSetOverlap ( HYPRE_Solver solver , HYPRE_Int overlap ); -HYPRE_Int HYPRE_SchwarzSetDomainType ( HYPRE_Solver solver , HYPRE_Int domain_type ); -HYPRE_Int HYPRE_SchwarzSetDomainStructure ( HYPRE_Solver solver , HYPRE_CSRMatrix domain_structure ); -HYPRE_Int HYPRE_SchwarzSetNumFunctions ( HYPRE_Solver solver , HYPRE_Int num_functions ); -HYPRE_Int HYPRE_SchwarzSetNonSymm ( HYPRE_Solver solver , HYPRE_Int use_nonsymm ); -HYPRE_Int HYPRE_SchwarzSetRelaxWeight ( HYPRE_Solver solver , HYPRE_Real relax_weight ); -HYPRE_Int HYPRE_SchwarzSetDofFunc ( HYPRE_Solver solver , HYPRE_Int *dof_func ); +HYPRE_Int HYPRE_SchwarzSetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_SchwarzSolve ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_SchwarzSetVariant ( HYPRE_Solver solver, HYPRE_Int variant ); +HYPRE_Int HYPRE_SchwarzSetOverlap ( HYPRE_Solver solver, HYPRE_Int overlap ); +HYPRE_Int HYPRE_SchwarzSetDomainType ( HYPRE_Solver solver, HYPRE_Int domain_type ); +HYPRE_Int HYPRE_SchwarzSetDomainStructure ( HYPRE_Solver solver, HYPRE_CSRMatrix domain_structure ); +HYPRE_Int HYPRE_SchwarzSetNumFunctions ( HYPRE_Solver solver, HYPRE_Int num_functions ); +HYPRE_Int HYPRE_SchwarzSetNonSymm ( HYPRE_Solver solver, HYPRE_Int use_nonsymm ); +HYPRE_Int HYPRE_SchwarzSetRelaxWeight ( HYPRE_Solver solver, HYPRE_Real relax_weight ); +HYPRE_Int HYPRE_SchwarzSetDofFunc ( HYPRE_Solver solver, HYPRE_Int *dof_func ); /* par_add_cycle.c */ HYPRE_Int hypre_BoomerAMGAdditiveCycle ( void *amg_vdata ); @@ -1544,596 +2470,1082 @@ HYPRE_Int hypre_CreateDinv ( void *amg_vdata ); /* par_amg.c */ void *hypre_BoomerAMGCreate ( void ); HYPRE_Int hypre_BoomerAMGDestroy ( void *data ); -HYPRE_Int hypre_BoomerAMGSetRestriction ( void *data , HYPRE_Int restr_par ); -HYPRE_Int hypre_BoomerAMGSetIsTriangular ( void *data , HYPRE_Int is_triangular ); -HYPRE_Int hypre_BoomerAMGSetGMRESSwitchR ( void *data , HYPRE_Int gmres_switch ); -HYPRE_Int hypre_BoomerAMGSetMaxLevels ( void *data , HYPRE_Int max_levels ); -HYPRE_Int hypre_BoomerAMGGetMaxLevels ( void *data , HYPRE_Int *max_levels ); -HYPRE_Int hypre_BoomerAMGSetMaxCoarseSize ( void *data , HYPRE_Int max_coarse_size ); -HYPRE_Int hypre_BoomerAMGGetMaxCoarseSize ( void *data , HYPRE_Int *max_coarse_size ); -HYPRE_Int hypre_BoomerAMGSetMinCoarseSize ( void *data , HYPRE_Int min_coarse_size ); -HYPRE_Int hypre_BoomerAMGGetMinCoarseSize ( void *data , HYPRE_Int *min_coarse_size ); -HYPRE_Int hypre_BoomerAMGSetSeqThreshold ( void *data , HYPRE_Int seq_threshold ); -HYPRE_Int hypre_BoomerAMGGetSeqThreshold ( void *data , HYPRE_Int *seq_threshold ); +HYPRE_Int hypre_BoomerAMGSetRestriction ( void *data, HYPRE_Int restr_par ); +HYPRE_Int hypre_BoomerAMGSetIsTriangular ( void *data, HYPRE_Int is_triangular ); +HYPRE_Int hypre_BoomerAMGSetGMRESSwitchR ( void *data, HYPRE_Int gmres_switch ); +HYPRE_Int hypre_BoomerAMGSetMaxLevels ( void *data, HYPRE_Int max_levels ); +HYPRE_Int hypre_BoomerAMGGetMaxLevels ( void *data, HYPRE_Int *max_levels ); +HYPRE_Int hypre_BoomerAMGSetMaxCoarseSize ( void *data, HYPRE_Int max_coarse_size ); +HYPRE_Int hypre_BoomerAMGGetMaxCoarseSize ( void *data, HYPRE_Int *max_coarse_size ); +HYPRE_Int hypre_BoomerAMGSetMinCoarseSize ( void *data, HYPRE_Int min_coarse_size ); +HYPRE_Int hypre_BoomerAMGGetMinCoarseSize ( void *data, HYPRE_Int *min_coarse_size ); +HYPRE_Int hypre_BoomerAMGSetSeqThreshold ( void *data, HYPRE_Int seq_threshold ); +HYPRE_Int hypre_BoomerAMGGetSeqThreshold ( void *data, HYPRE_Int *seq_threshold ); HYPRE_Int hypre_BoomerAMGSetCoarsenCutFactor( void *data, HYPRE_Int coarsen_cut_factor ); HYPRE_Int hypre_BoomerAMGGetCoarsenCutFactor( void *data, HYPRE_Int *coarsen_cut_factor ); -HYPRE_Int hypre_BoomerAMGSetRedundant ( void *data , HYPRE_Int redundant ); -HYPRE_Int hypre_BoomerAMGGetRedundant ( void *data , HYPRE_Int *redundant ); -HYPRE_Int hypre_BoomerAMGSetStrongThreshold ( void *data , HYPRE_Real strong_threshold ); -HYPRE_Int hypre_BoomerAMGGetStrongThreshold ( void *data , HYPRE_Real *strong_threshold ); -HYPRE_Int hypre_BoomerAMGSetStrongThresholdR ( void *data , HYPRE_Real strong_threshold ); -HYPRE_Int hypre_BoomerAMGGetStrongThresholdR ( void *data , HYPRE_Real *strong_threshold ); -HYPRE_Int hypre_BoomerAMGSetFilterThresholdR ( void *data , HYPRE_Real filter_threshold ); -HYPRE_Int hypre_BoomerAMGGetFilterThresholdR ( void *data , HYPRE_Real *filter_threshold ); -HYPRE_Int hypre_BoomerAMGSetSabs ( void *data , HYPRE_Int Sabs ); -HYPRE_Int hypre_BoomerAMGSetMaxRowSum ( void *data , HYPRE_Real max_row_sum ); -HYPRE_Int hypre_BoomerAMGGetMaxRowSum ( void *data , HYPRE_Real *max_row_sum ); -HYPRE_Int hypre_BoomerAMGSetTruncFactor ( void *data , HYPRE_Real trunc_factor ); -HYPRE_Int hypre_BoomerAMGGetTruncFactor ( void *data , HYPRE_Real *trunc_factor ); -HYPRE_Int hypre_BoomerAMGSetPMaxElmts ( void *data , HYPRE_Int P_max_elmts ); -HYPRE_Int hypre_BoomerAMGGetPMaxElmts ( void *data , HYPRE_Int *P_max_elmts ); -HYPRE_Int hypre_BoomerAMGSetJacobiTruncThreshold ( void *data , HYPRE_Real jacobi_trunc_threshold ); -HYPRE_Int hypre_BoomerAMGGetJacobiTruncThreshold ( void *data , HYPRE_Real *jacobi_trunc_threshold ); -HYPRE_Int hypre_BoomerAMGSetPostInterpType ( void *data , HYPRE_Int post_interp_type ); -HYPRE_Int hypre_BoomerAMGGetPostInterpType ( void *data , HYPRE_Int *post_interp_type ); -HYPRE_Int hypre_BoomerAMGSetInterpType ( void *data , HYPRE_Int interp_type ); -HYPRE_Int hypre_BoomerAMGGetInterpType ( void *data , HYPRE_Int *interp_type ); -HYPRE_Int hypre_BoomerAMGSetSepWeight ( void *data , HYPRE_Int sep_weight ); -HYPRE_Int hypre_BoomerAMGSetMinIter ( void *data , HYPRE_Int min_iter ); -HYPRE_Int hypre_BoomerAMGGetMinIter ( void *data , HYPRE_Int *min_iter ); -HYPRE_Int hypre_BoomerAMGSetMaxIter ( void *data , HYPRE_Int max_iter ); -HYPRE_Int hypre_BoomerAMGGetMaxIter ( void *data , HYPRE_Int *max_iter ); -HYPRE_Int hypre_BoomerAMGSetCoarsenType ( void *data , HYPRE_Int coarsen_type ); -HYPRE_Int hypre_BoomerAMGGetCoarsenType ( void *data , HYPRE_Int *coarsen_type ); -HYPRE_Int hypre_BoomerAMGSetMeasureType ( void *data , HYPRE_Int measure_type ); -HYPRE_Int hypre_BoomerAMGGetMeasureType ( void *data , HYPRE_Int *measure_type ); -HYPRE_Int hypre_BoomerAMGSetSetupType ( void *data , HYPRE_Int setup_type ); -HYPRE_Int hypre_BoomerAMGGetSetupType ( void *data , HYPRE_Int *setup_type ); -HYPRE_Int hypre_BoomerAMGSetFCycle ( void *data , HYPRE_Int fcycle ); -HYPRE_Int hypre_BoomerAMGGetFCycle ( void *data , HYPRE_Int *fcycle ); -HYPRE_Int hypre_BoomerAMGSetCycleType ( void *data , HYPRE_Int cycle_type ); -HYPRE_Int hypre_BoomerAMGGetCycleType ( void *data , HYPRE_Int *cycle_type ); -HYPRE_Int hypre_BoomerAMGSetConvergeType ( void *data , HYPRE_Int type ); -HYPRE_Int hypre_BoomerAMGGetConvergeType ( void *data , HYPRE_Int *type ); -HYPRE_Int hypre_BoomerAMGSetTol ( void *data , HYPRE_Real tol ); -HYPRE_Int hypre_BoomerAMGGetTol ( void *data , HYPRE_Real *tol ); -HYPRE_Int hypre_BoomerAMGSetNumSweeps ( void *data , HYPRE_Int num_sweeps ); -HYPRE_Int hypre_BoomerAMGSetCycleNumSweeps ( void *data , HYPRE_Int num_sweeps , HYPRE_Int k ); -HYPRE_Int hypre_BoomerAMGGetCycleNumSweeps ( void *data , HYPRE_Int *num_sweeps , HYPRE_Int k ); -HYPRE_Int hypre_BoomerAMGSetNumGridSweeps ( void *data , HYPRE_Int *num_grid_sweeps ); -HYPRE_Int hypre_BoomerAMGGetNumGridSweeps ( void *data , HYPRE_Int **num_grid_sweeps ); -HYPRE_Int hypre_BoomerAMGSetRelaxType ( void *data , HYPRE_Int relax_type ); -HYPRE_Int hypre_BoomerAMGSetCycleRelaxType ( void *data , HYPRE_Int relax_type , HYPRE_Int k ); -HYPRE_Int hypre_BoomerAMGGetCycleRelaxType ( void *data , HYPRE_Int *relax_type , HYPRE_Int k ); -HYPRE_Int hypre_BoomerAMGSetRelaxOrder ( void *data , HYPRE_Int relax_order ); -HYPRE_Int hypre_BoomerAMGGetRelaxOrder ( void *data , HYPRE_Int *relax_order ); -HYPRE_Int hypre_BoomerAMGSetGridRelaxType ( void *data , HYPRE_Int *grid_relax_type ); -HYPRE_Int hypre_BoomerAMGGetGridRelaxType ( void *data , HYPRE_Int **grid_relax_type ); -HYPRE_Int hypre_BoomerAMGSetGridRelaxPoints ( void *data , HYPRE_Int **grid_relax_points ); -HYPRE_Int hypre_BoomerAMGGetGridRelaxPoints ( void *data , HYPRE_Int ***grid_relax_points ); -HYPRE_Int hypre_BoomerAMGSetRelaxWeight ( void *data , HYPRE_Real *relax_weight ); -HYPRE_Int hypre_BoomerAMGGetRelaxWeight ( void *data , HYPRE_Real **relax_weight ); -HYPRE_Int hypre_BoomerAMGSetRelaxWt ( void *data , HYPRE_Real relax_weight ); -HYPRE_Int hypre_BoomerAMGSetLevelRelaxWt ( void *data , HYPRE_Real relax_weight , HYPRE_Int level ); -HYPRE_Int hypre_BoomerAMGGetLevelRelaxWt ( void *data , HYPRE_Real *relax_weight , HYPRE_Int level ); -HYPRE_Int hypre_BoomerAMGSetOmega ( void *data , HYPRE_Real *omega ); -HYPRE_Int hypre_BoomerAMGGetOmega ( void *data , HYPRE_Real **omega ); -HYPRE_Int hypre_BoomerAMGSetOuterWt ( void *data , HYPRE_Real omega ); -HYPRE_Int hypre_BoomerAMGSetLevelOuterWt ( void *data , HYPRE_Real omega , HYPRE_Int level ); -HYPRE_Int hypre_BoomerAMGGetLevelOuterWt ( void *data , HYPRE_Real *omega , HYPRE_Int level ); -HYPRE_Int hypre_BoomerAMGSetSmoothType ( void *data , HYPRE_Int smooth_type ); -HYPRE_Int hypre_BoomerAMGGetSmoothType ( void *data , HYPRE_Int *smooth_type ); -HYPRE_Int hypre_BoomerAMGSetSmoothNumLevels ( void *data , HYPRE_Int smooth_num_levels ); -HYPRE_Int hypre_BoomerAMGGetSmoothNumLevels ( void *data , HYPRE_Int *smooth_num_levels ); -HYPRE_Int hypre_BoomerAMGSetSmoothNumSweeps ( void *data , HYPRE_Int smooth_num_sweeps ); -HYPRE_Int hypre_BoomerAMGGetSmoothNumSweeps ( void *data , HYPRE_Int *smooth_num_sweeps ); -HYPRE_Int hypre_BoomerAMGSetLogging ( void *data , HYPRE_Int logging ); -HYPRE_Int hypre_BoomerAMGGetLogging ( void *data , HYPRE_Int *logging ); -HYPRE_Int hypre_BoomerAMGSetPrintLevel ( void *data , HYPRE_Int print_level ); -HYPRE_Int hypre_BoomerAMGGetPrintLevel ( void *data , HYPRE_Int *print_level ); -HYPRE_Int hypre_BoomerAMGSetPrintFileName ( void *data , const char *print_file_name ); -HYPRE_Int hypre_BoomerAMGGetPrintFileName ( void *data , char **print_file_name ); -HYPRE_Int hypre_BoomerAMGSetNumIterations ( void *data , HYPRE_Int num_iterations ); -HYPRE_Int hypre_BoomerAMGSetDebugFlag ( void *data , HYPRE_Int debug_flag ); -HYPRE_Int hypre_BoomerAMGGetDebugFlag ( void *data , HYPRE_Int *debug_flag ); -HYPRE_Int hypre_BoomerAMGSetGSMG ( void *data , HYPRE_Int par ); -HYPRE_Int hypre_BoomerAMGSetNumSamples ( void *data , HYPRE_Int par ); -HYPRE_Int hypre_BoomerAMGSetCGCIts ( void *data , HYPRE_Int its ); -HYPRE_Int hypre_BoomerAMGSetPlotGrids ( void *data , HYPRE_Int plotgrids ); -HYPRE_Int hypre_BoomerAMGSetPlotFileName ( void *data , const char *plot_file_name ); -HYPRE_Int hypre_BoomerAMGSetCoordDim ( void *data , HYPRE_Int coorddim ); -HYPRE_Int hypre_BoomerAMGSetCoordinates ( void *data , float *coordinates ); +HYPRE_Int hypre_BoomerAMGSetRedundant ( void *data, HYPRE_Int redundant ); +HYPRE_Int hypre_BoomerAMGGetRedundant ( void *data, HYPRE_Int *redundant ); +HYPRE_Int hypre_BoomerAMGSetStrongThreshold ( void *data, HYPRE_Real strong_threshold ); +HYPRE_Int hypre_BoomerAMGGetStrongThreshold ( void *data, HYPRE_Real *strong_threshold ); +HYPRE_Int hypre_BoomerAMGSetStrongThresholdR ( void *data, HYPRE_Real strong_threshold ); +HYPRE_Int hypre_BoomerAMGGetStrongThresholdR ( void *data, HYPRE_Real *strong_threshold ); +HYPRE_Int hypre_BoomerAMGSetFilterThresholdR ( void *data, HYPRE_Real filter_threshold ); +HYPRE_Int hypre_BoomerAMGGetFilterThresholdR ( void *data, HYPRE_Real *filter_threshold ); +HYPRE_Int hypre_BoomerAMGSetSabs ( void *data, HYPRE_Int Sabs ); +HYPRE_Int hypre_BoomerAMGSetMaxRowSum ( void *data, HYPRE_Real max_row_sum ); +HYPRE_Int hypre_BoomerAMGGetMaxRowSum ( void *data, HYPRE_Real *max_row_sum ); +HYPRE_Int hypre_BoomerAMGSetTruncFactor ( void *data, HYPRE_Real trunc_factor ); +HYPRE_Int hypre_BoomerAMGGetTruncFactor ( void *data, HYPRE_Real *trunc_factor ); +HYPRE_Int hypre_BoomerAMGSetPMaxElmts ( void *data, HYPRE_Int P_max_elmts ); +HYPRE_Int hypre_BoomerAMGGetPMaxElmts ( void *data, HYPRE_Int *P_max_elmts ); +HYPRE_Int hypre_BoomerAMGSetJacobiTruncThreshold ( void *data, HYPRE_Real jacobi_trunc_threshold ); +HYPRE_Int hypre_BoomerAMGGetJacobiTruncThreshold ( void *data, HYPRE_Real *jacobi_trunc_threshold ); +HYPRE_Int hypre_BoomerAMGSetPostInterpType ( void *data, HYPRE_Int post_interp_type ); +HYPRE_Int hypre_BoomerAMGGetPostInterpType ( void *data, HYPRE_Int *post_interp_type ); +HYPRE_Int hypre_BoomerAMGSetInterpType ( void *data, HYPRE_Int interp_type ); +HYPRE_Int hypre_BoomerAMGGetInterpType ( void *data, HYPRE_Int *interp_type ); +HYPRE_Int hypre_BoomerAMGSetSepWeight ( void *data, HYPRE_Int sep_weight ); +HYPRE_Int hypre_BoomerAMGSetMinIter ( void *data, HYPRE_Int min_iter ); +HYPRE_Int hypre_BoomerAMGGetMinIter ( void *data, HYPRE_Int *min_iter ); +HYPRE_Int hypre_BoomerAMGSetMaxIter ( void *data, HYPRE_Int max_iter ); +HYPRE_Int hypre_BoomerAMGGetMaxIter ( void *data, HYPRE_Int *max_iter ); +HYPRE_Int hypre_BoomerAMGSetCoarsenType ( void *data, HYPRE_Int coarsen_type ); +HYPRE_Int hypre_BoomerAMGGetCoarsenType ( void *data, HYPRE_Int *coarsen_type ); +HYPRE_Int hypre_BoomerAMGSetMeasureType ( void *data, HYPRE_Int measure_type ); +HYPRE_Int hypre_BoomerAMGGetMeasureType ( void *data, HYPRE_Int *measure_type ); +HYPRE_Int hypre_BoomerAMGSetSetupType ( void *data, HYPRE_Int setup_type ); +HYPRE_Int hypre_BoomerAMGGetSetupType ( void *data, HYPRE_Int *setup_type ); +HYPRE_Int hypre_BoomerAMGSetFCycle ( void *data, HYPRE_Int fcycle ); +HYPRE_Int hypre_BoomerAMGGetFCycle ( void *data, HYPRE_Int *fcycle ); +HYPRE_Int hypre_BoomerAMGSetCycleType ( void *data, HYPRE_Int cycle_type ); +HYPRE_Int hypre_BoomerAMGGetCycleType ( void *data, HYPRE_Int *cycle_type ); +HYPRE_Int hypre_BoomerAMGSetConvergeType ( void *data, HYPRE_Int type ); +HYPRE_Int hypre_BoomerAMGGetConvergeType ( void *data, HYPRE_Int *type ); +HYPRE_Int hypre_BoomerAMGSetTol ( void *data, HYPRE_Real tol ); +HYPRE_Int hypre_BoomerAMGGetTol ( void *data, HYPRE_Real *tol ); +HYPRE_Int hypre_BoomerAMGSetNumSweeps ( void *data, HYPRE_Int num_sweeps ); +HYPRE_Int hypre_BoomerAMGSetCycleNumSweeps ( void *data, HYPRE_Int num_sweeps, HYPRE_Int k ); +HYPRE_Int hypre_BoomerAMGGetCycleNumSweeps ( void *data, HYPRE_Int *num_sweeps, HYPRE_Int k ); +HYPRE_Int hypre_BoomerAMGSetNumGridSweeps ( void *data, HYPRE_Int *num_grid_sweeps ); +HYPRE_Int hypre_BoomerAMGGetNumGridSweeps ( void *data, HYPRE_Int **num_grid_sweeps ); +HYPRE_Int hypre_BoomerAMGSetRelaxType ( void *data, HYPRE_Int relax_type ); +HYPRE_Int hypre_BoomerAMGSetCycleRelaxType ( void *data, HYPRE_Int relax_type, HYPRE_Int k ); +HYPRE_Int hypre_BoomerAMGGetCycleRelaxType ( void *data, HYPRE_Int *relax_type, HYPRE_Int k ); +HYPRE_Int hypre_BoomerAMGSetRelaxOrder ( void *data, HYPRE_Int relax_order ); +HYPRE_Int hypre_BoomerAMGGetRelaxOrder ( void *data, HYPRE_Int *relax_order ); +HYPRE_Int hypre_BoomerAMGSetGridRelaxType ( void *data, HYPRE_Int *grid_relax_type ); +HYPRE_Int hypre_BoomerAMGGetGridRelaxType ( void *data, HYPRE_Int **grid_relax_type ); +HYPRE_Int hypre_BoomerAMGSetGridRelaxPoints ( void *data, HYPRE_Int **grid_relax_points ); +HYPRE_Int hypre_BoomerAMGGetGridRelaxPoints ( void *data, HYPRE_Int ***grid_relax_points ); +HYPRE_Int hypre_BoomerAMGSetRelaxWeight ( void *data, HYPRE_Real *relax_weight ); +HYPRE_Int hypre_BoomerAMGGetRelaxWeight ( void *data, HYPRE_Real **relax_weight ); +HYPRE_Int hypre_BoomerAMGSetRelaxWt ( void *data, HYPRE_Real relax_weight ); +HYPRE_Int hypre_BoomerAMGSetLevelRelaxWt ( void *data, HYPRE_Real relax_weight, HYPRE_Int level ); +HYPRE_Int hypre_BoomerAMGGetLevelRelaxWt ( void *data, HYPRE_Real *relax_weight, HYPRE_Int level ); +HYPRE_Int hypre_BoomerAMGSetOmega ( void *data, HYPRE_Real *omega ); +HYPRE_Int hypre_BoomerAMGGetOmega ( void *data, HYPRE_Real **omega ); +HYPRE_Int hypre_BoomerAMGSetOuterWt ( void *data, HYPRE_Real omega ); +HYPRE_Int hypre_BoomerAMGSetLevelOuterWt ( void *data, HYPRE_Real omega, HYPRE_Int level ); +HYPRE_Int hypre_BoomerAMGGetLevelOuterWt ( void *data, HYPRE_Real *omega, HYPRE_Int level ); +HYPRE_Int hypre_BoomerAMGSetSmoothType ( void *data, HYPRE_Int smooth_type ); +HYPRE_Int hypre_BoomerAMGGetSmoothType ( void *data, HYPRE_Int *smooth_type ); +HYPRE_Int hypre_BoomerAMGSetSmoothNumLevels ( void *data, HYPRE_Int smooth_num_levels ); +HYPRE_Int hypre_BoomerAMGGetSmoothNumLevels ( void *data, HYPRE_Int *smooth_num_levels ); +HYPRE_Int hypre_BoomerAMGSetSmoothNumSweeps ( void *data, HYPRE_Int smooth_num_sweeps ); +HYPRE_Int hypre_BoomerAMGGetSmoothNumSweeps ( void *data, HYPRE_Int *smooth_num_sweeps ); +HYPRE_Int hypre_BoomerAMGSetLogging ( void *data, HYPRE_Int logging ); +HYPRE_Int hypre_BoomerAMGGetLogging ( void *data, HYPRE_Int *logging ); +HYPRE_Int hypre_BoomerAMGSetPrintLevel ( void *data, HYPRE_Int print_level ); +HYPRE_Int hypre_BoomerAMGGetPrintLevel ( void *data, HYPRE_Int *print_level ); +HYPRE_Int hypre_BoomerAMGSetPrintFileName ( void *data, const char *print_file_name ); +HYPRE_Int hypre_BoomerAMGGetPrintFileName ( void *data, char **print_file_name ); +HYPRE_Int hypre_BoomerAMGSetNumIterations ( void *data, HYPRE_Int num_iterations ); +HYPRE_Int hypre_BoomerAMGSetDebugFlag ( void *data, HYPRE_Int debug_flag ); +HYPRE_Int hypre_BoomerAMGGetDebugFlag ( void *data, HYPRE_Int *debug_flag ); +HYPRE_Int hypre_BoomerAMGSetGSMG ( void *data, HYPRE_Int par ); +HYPRE_Int hypre_BoomerAMGSetNumSamples ( void *data, HYPRE_Int par ); +HYPRE_Int hypre_BoomerAMGSetCGCIts ( void *data, HYPRE_Int its ); +HYPRE_Int hypre_BoomerAMGSetPlotGrids ( void *data, HYPRE_Int plotgrids ); +HYPRE_Int hypre_BoomerAMGSetPlotFileName ( void *data, const char *plot_file_name ); +HYPRE_Int hypre_BoomerAMGSetCoordDim ( void *data, HYPRE_Int coorddim ); +HYPRE_Int hypre_BoomerAMGSetCoordinates ( void *data, float *coordinates ); HYPRE_Int hypre_BoomerAMGGetGridHierarchy(void *data, HYPRE_Int *cgrid ); -HYPRE_Int hypre_BoomerAMGSetNumFunctions ( void *data , HYPRE_Int num_functions ); -HYPRE_Int hypre_BoomerAMGGetNumFunctions ( void *data , HYPRE_Int *num_functions ); -HYPRE_Int hypre_BoomerAMGSetNodal ( void *data , HYPRE_Int nodal ); -HYPRE_Int hypre_BoomerAMGSetNodalLevels ( void *data , HYPRE_Int nodal_levels ); -HYPRE_Int hypre_BoomerAMGSetNodalDiag ( void *data , HYPRE_Int nodal ); -HYPRE_Int hypre_BoomerAMGSetKeepSameSign ( void *data , HYPRE_Int keep_same_sign ); -HYPRE_Int hypre_BoomerAMGSetNumPaths ( void *data , HYPRE_Int num_paths ); -HYPRE_Int hypre_BoomerAMGSetAggNumLevels ( void *data , HYPRE_Int agg_num_levels ); -HYPRE_Int hypre_BoomerAMGSetAggInterpType ( void *data , HYPRE_Int agg_interp_type ); -HYPRE_Int hypre_BoomerAMGSetAggPMaxElmts ( void *data , HYPRE_Int agg_P_max_elmts ); -HYPRE_Int hypre_BoomerAMGSetMultAddPMaxElmts ( void *data , HYPRE_Int add_P_max_elmts ); -HYPRE_Int hypre_BoomerAMGSetAddRelaxType ( void *data , HYPRE_Int add_rlx_type ); -HYPRE_Int hypre_BoomerAMGSetAddRelaxWt ( void *data , HYPRE_Real add_rlx_wt ); -HYPRE_Int hypre_BoomerAMGSetAggP12MaxElmts ( void *data , HYPRE_Int agg_P12_max_elmts ); -HYPRE_Int hypre_BoomerAMGSetAggTruncFactor ( void *data , HYPRE_Real agg_trunc_factor ); -HYPRE_Int hypre_BoomerAMGSetMultAddTruncFactor ( void *data , HYPRE_Real add_trunc_factor ); -HYPRE_Int hypre_BoomerAMGSetAggP12TruncFactor ( void *data , HYPRE_Real agg_P12_trunc_factor ); -HYPRE_Int hypre_BoomerAMGSetNumCRRelaxSteps ( void *data , HYPRE_Int num_CR_relax_steps ); -HYPRE_Int hypre_BoomerAMGSetCRRate ( void *data , HYPRE_Real CR_rate ); -HYPRE_Int hypre_BoomerAMGSetCRStrongTh ( void *data , HYPRE_Real CR_strong_th ); +HYPRE_Int hypre_BoomerAMGSetNumFunctions ( void *data, HYPRE_Int num_functions ); +HYPRE_Int hypre_BoomerAMGGetNumFunctions ( void *data, HYPRE_Int *num_functions ); +HYPRE_Int hypre_BoomerAMGSetFilterFunctions ( void *data, HYPRE_Int filter_functions ); +HYPRE_Int hypre_BoomerAMGGetFilterFunctions ( void *data, HYPRE_Int *filter_functions ); +HYPRE_Int hypre_BoomerAMGSetNodal ( void *data, HYPRE_Int nodal ); +HYPRE_Int hypre_BoomerAMGSetNodalLevels ( void *data, HYPRE_Int nodal_levels ); +HYPRE_Int hypre_BoomerAMGSetNodalDiag ( void *data, HYPRE_Int nodal ); +HYPRE_Int hypre_BoomerAMGSetKeepSameSign ( void *data, HYPRE_Int keep_same_sign ); +HYPRE_Int hypre_BoomerAMGSetNumPaths ( void *data, HYPRE_Int num_paths ); +HYPRE_Int hypre_BoomerAMGSetAggNumLevels ( void *data, HYPRE_Int agg_num_levels ); +HYPRE_Int hypre_BoomerAMGSetAggInterpType ( void *data, HYPRE_Int agg_interp_type ); +HYPRE_Int hypre_BoomerAMGSetAggPMaxElmts ( void *data, HYPRE_Int agg_P_max_elmts ); +HYPRE_Int hypre_BoomerAMGSetMultAddPMaxElmts ( void *data, HYPRE_Int add_P_max_elmts ); +HYPRE_Int hypre_BoomerAMGSetAddRelaxType ( void *data, HYPRE_Int add_rlx_type ); +HYPRE_Int hypre_BoomerAMGSetAddRelaxWt ( void *data, HYPRE_Real add_rlx_wt ); +HYPRE_Int hypre_BoomerAMGSetAggP12MaxElmts ( void *data, HYPRE_Int agg_P12_max_elmts ); +HYPRE_Int hypre_BoomerAMGSetAggTruncFactor ( void *data, HYPRE_Real agg_trunc_factor ); +HYPRE_Int hypre_BoomerAMGSetMultAddTruncFactor ( void *data, HYPRE_Real add_trunc_factor ); +HYPRE_Int hypre_BoomerAMGSetAggP12TruncFactor ( void *data, HYPRE_Real agg_P12_trunc_factor ); +HYPRE_Int hypre_BoomerAMGSetNumCRRelaxSteps ( void *data, HYPRE_Int num_CR_relax_steps ); +HYPRE_Int hypre_BoomerAMGSetCRRate ( void *data, HYPRE_Real CR_rate ); +HYPRE_Int hypre_BoomerAMGSetCRStrongTh ( void *data, HYPRE_Real CR_strong_th ); HYPRE_Int hypre_BoomerAMGSetADropTol( void *data, HYPRE_Real A_drop_tol ); HYPRE_Int hypre_BoomerAMGSetADropType( void *data, HYPRE_Int A_drop_type ); -HYPRE_Int hypre_BoomerAMGSetISType ( void *data , HYPRE_Int IS_type ); -HYPRE_Int hypre_BoomerAMGSetCRUseCG ( void *data , HYPRE_Int CR_use_CG ); -HYPRE_Int hypre_BoomerAMGSetNumPoints ( void *data , HYPRE_Int num_points ); -HYPRE_Int hypre_BoomerAMGSetDofFunc ( void *data , HYPRE_Int *dof_func ); -HYPRE_Int hypre_BoomerAMGSetPointDofMap ( void *data , HYPRE_Int *point_dof_map ); -HYPRE_Int hypre_BoomerAMGSetDofPoint ( void *data , HYPRE_Int *dof_point ); -HYPRE_Int hypre_BoomerAMGGetNumIterations ( void *data , HYPRE_Int *num_iterations ); -HYPRE_Int hypre_BoomerAMGGetCumNumIterations ( void *data , HYPRE_Int *cum_num_iterations ); -HYPRE_Int hypre_BoomerAMGGetResidual ( void *data , hypre_ParVector **resid ); -HYPRE_Int hypre_BoomerAMGGetRelResidualNorm ( void *data , HYPRE_Real *rel_resid_norm ); -HYPRE_Int hypre_BoomerAMGSetVariant ( void *data , HYPRE_Int variant ); -HYPRE_Int hypre_BoomerAMGGetVariant ( void *data , HYPRE_Int *variant ); -HYPRE_Int hypre_BoomerAMGSetOverlap ( void *data , HYPRE_Int overlap ); -HYPRE_Int hypre_BoomerAMGGetOverlap ( void *data , HYPRE_Int *overlap ); -HYPRE_Int hypre_BoomerAMGSetDomainType ( void *data , HYPRE_Int domain_type ); -HYPRE_Int hypre_BoomerAMGGetDomainType ( void *data , HYPRE_Int *domain_type ); -HYPRE_Int hypre_BoomerAMGSetSchwarzRlxWeight ( void *data , HYPRE_Real schwarz_rlx_weight ); -HYPRE_Int hypre_BoomerAMGGetSchwarzRlxWeight ( void *data , HYPRE_Real *schwarz_rlx_weight ); -HYPRE_Int hypre_BoomerAMGSetSchwarzUseNonSymm ( void *data , HYPRE_Int use_nonsymm ); -HYPRE_Int hypre_BoomerAMGSetSym ( void *data , HYPRE_Int sym ); -HYPRE_Int hypre_BoomerAMGSetLevel ( void *data , HYPRE_Int level ); -HYPRE_Int hypre_BoomerAMGSetThreshold ( void *data , HYPRE_Real thresh ); -HYPRE_Int hypre_BoomerAMGSetFilter ( void *data , HYPRE_Real filter ); -HYPRE_Int hypre_BoomerAMGSetDropTol ( void *data , HYPRE_Real drop_tol ); -HYPRE_Int hypre_BoomerAMGSetMaxNzPerRow ( void *data , HYPRE_Int max_nz_per_row ); -HYPRE_Int hypre_BoomerAMGSetEuclidFile ( void *data , char *euclidfile ); -HYPRE_Int hypre_BoomerAMGSetEuLevel ( void *data , HYPRE_Int eu_level ); -HYPRE_Int hypre_BoomerAMGSetEuSparseA ( void *data , HYPRE_Real eu_sparse_A ); -HYPRE_Int hypre_BoomerAMGSetEuBJ ( void *data , HYPRE_Int eu_bj ); -HYPRE_Int hypre_BoomerAMGSetILUType( void *data, HYPRE_Int ilu_type); -HYPRE_Int hypre_BoomerAMGSetILULevel( void *data, HYPRE_Int ilu_lfil); -HYPRE_Int hypre_BoomerAMGSetILUDroptol( void *data, HYPRE_Real ilu_droptol); -HYPRE_Int hypre_BoomerAMGSetILUMaxIter( void *data, HYPRE_Int ilu_max_iter); -HYPRE_Int hypre_BoomerAMGSetILUMaxRowNnz( void *data, HYPRE_Int ilu_max_row_nnz); -HYPRE_Int hypre_BoomerAMGSetILULocalReordering( void *data, HYPRE_Int ilu_reordering_type); -HYPRE_Int hypre_BoomerAMGSetChebyOrder ( void *data , HYPRE_Int order ); -HYPRE_Int hypre_BoomerAMGSetChebyFraction ( void *data , HYPRE_Real ratio ); -HYPRE_Int hypre_BoomerAMGSetChebyEigEst ( void *data , HYPRE_Int eig_est ); -HYPRE_Int hypre_BoomerAMGSetChebyVariant ( void *data , HYPRE_Int variant ); -HYPRE_Int hypre_BoomerAMGSetChebyScale ( void *data , HYPRE_Int scale ); -HYPRE_Int hypre_BoomerAMGSetInterpVectors ( void *solver , HYPRE_Int num_vectors , hypre_ParVector **interp_vectors ); -HYPRE_Int hypre_BoomerAMGSetInterpVecVariant ( void *solver , HYPRE_Int var ); -HYPRE_Int hypre_BoomerAMGSetInterpVecQMax ( void *data , HYPRE_Int q_max ); -HYPRE_Int hypre_BoomerAMGSetInterpVecAbsQTrunc ( void *data , HYPRE_Real q_trunc ); -HYPRE_Int hypre_BoomerAMGSetSmoothInterpVectors ( void *solver , HYPRE_Int smooth_interp_vectors ); -HYPRE_Int hypre_BoomerAMGSetInterpRefine ( void *data , HYPRE_Int num_refine ); -HYPRE_Int hypre_BoomerAMGSetInterpVecFirstLevel ( void *data , HYPRE_Int level ); -HYPRE_Int hypre_BoomerAMGSetAdditive ( void *data , HYPRE_Int additive ); -HYPRE_Int hypre_BoomerAMGGetAdditive ( void *data , HYPRE_Int *additive ); -HYPRE_Int hypre_BoomerAMGSetMultAdditive ( void *data , HYPRE_Int mult_additive ); -HYPRE_Int hypre_BoomerAMGGetMultAdditive ( void *data , HYPRE_Int *mult_additive ); -HYPRE_Int hypre_BoomerAMGSetSimple ( void *data , HYPRE_Int simple ); -HYPRE_Int hypre_BoomerAMGGetSimple ( void *data , HYPRE_Int *simple ); -HYPRE_Int hypre_BoomerAMGSetAddLastLvl ( void *data , HYPRE_Int add_last_lvl ); -HYPRE_Int hypre_BoomerAMGSetNonGalerkinTol ( void *data , HYPRE_Real nongalerkin_tol ); -HYPRE_Int hypre_BoomerAMGSetLevelNonGalerkinTol ( void *data , HYPRE_Real nongalerkin_tol , HYPRE_Int level ); -HYPRE_Int hypre_BoomerAMGSetNonGalerkTol ( void *data , HYPRE_Int nongalerk_num_tol , HYPRE_Real *nongalerk_tol ); -HYPRE_Int hypre_BoomerAMGSetRAP2 ( void *data , HYPRE_Int rap2 ); -HYPRE_Int hypre_BoomerAMGSetModuleRAP2 ( void *data , HYPRE_Int mod_rap2 ); -HYPRE_Int hypre_BoomerAMGSetKeepTranspose ( void *data , HYPRE_Int keepTranspose ); +HYPRE_Int hypre_BoomerAMGSetISType ( void *data, HYPRE_Int IS_type ); +HYPRE_Int hypre_BoomerAMGSetCRUseCG ( void *data, HYPRE_Int CR_use_CG ); +HYPRE_Int hypre_BoomerAMGSetNumPoints ( void *data, HYPRE_Int num_points ); +HYPRE_Int hypre_BoomerAMGSetDofFunc ( void *data, HYPRE_Int *dof_func ); +HYPRE_Int hypre_BoomerAMGSetPointDofMap ( void *data, HYPRE_Int *point_dof_map ); +HYPRE_Int hypre_BoomerAMGSetDofPoint ( void *data, HYPRE_Int *dof_point ); +HYPRE_Int hypre_BoomerAMGGetNumIterations ( void *data, HYPRE_Int *num_iterations ); +HYPRE_Int hypre_BoomerAMGGetCumNumIterations ( void *data, HYPRE_Int *cum_num_iterations ); +HYPRE_Int hypre_BoomerAMGGetResidual ( void *data, hypre_ParVector **resid ); +HYPRE_Int hypre_BoomerAMGGetRelResidualNorm ( void *data, HYPRE_Real *rel_resid_norm ); +HYPRE_Int hypre_BoomerAMGSetVariant ( void *data, HYPRE_Int variant ); +HYPRE_Int hypre_BoomerAMGGetVariant ( void *data, HYPRE_Int *variant ); +HYPRE_Int hypre_BoomerAMGSetOverlap ( void *data, HYPRE_Int overlap ); +HYPRE_Int hypre_BoomerAMGGetOverlap ( void *data, HYPRE_Int *overlap ); +HYPRE_Int hypre_BoomerAMGSetDomainType ( void *data, HYPRE_Int domain_type ); +HYPRE_Int hypre_BoomerAMGGetDomainType ( void *data, HYPRE_Int *domain_type ); +HYPRE_Int hypre_BoomerAMGSetSchwarzRlxWeight ( void *data, HYPRE_Real schwarz_rlx_weight ); +HYPRE_Int hypre_BoomerAMGGetSchwarzRlxWeight ( void *data, HYPRE_Real *schwarz_rlx_weight ); +HYPRE_Int hypre_BoomerAMGSetSchwarzUseNonSymm ( void *data, HYPRE_Int use_nonsymm ); +HYPRE_Int hypre_BoomerAMGSetSym ( void *data, HYPRE_Int sym ); +HYPRE_Int hypre_BoomerAMGSetLevel ( void *data, HYPRE_Int level ); +HYPRE_Int hypre_BoomerAMGSetThreshold ( void *data, HYPRE_Real thresh ); +HYPRE_Int hypre_BoomerAMGSetFilter ( void *data, HYPRE_Real filter ); +HYPRE_Int hypre_BoomerAMGSetDropTol ( void *data, HYPRE_Real drop_tol ); +HYPRE_Int hypre_BoomerAMGSetMaxNzPerRow ( void *data, HYPRE_Int max_nz_per_row ); +HYPRE_Int hypre_BoomerAMGSetEuclidFile ( void *data, char *euclidfile ); +HYPRE_Int hypre_BoomerAMGSetEuLevel ( void *data, HYPRE_Int eu_level ); +HYPRE_Int hypre_BoomerAMGSetEuSparseA ( void *data, HYPRE_Real eu_sparse_A ); +HYPRE_Int hypre_BoomerAMGSetEuBJ ( void *data, HYPRE_Int eu_bj ); +HYPRE_Int hypre_BoomerAMGSetILUType( void *data, HYPRE_Int ilu_type ); +HYPRE_Int hypre_BoomerAMGSetILULevel( void *data, HYPRE_Int ilu_lfil ); +HYPRE_Int hypre_BoomerAMGSetILUDroptol( void *data, HYPRE_Real ilu_droptol ); +HYPRE_Int hypre_BoomerAMGSetILUTriSolve( void *data, HYPRE_Int ilu_tri_solve ); +HYPRE_Int hypre_BoomerAMGSetILULowerJacobiIters( void *data, HYPRE_Int ilu_lower_jacobi_iters ); +HYPRE_Int hypre_BoomerAMGSetILUUpperJacobiIters( void *data, HYPRE_Int ilu_upper_jacobi_iters ); +HYPRE_Int hypre_BoomerAMGSetILUMaxIter( void *data, HYPRE_Int ilu_max_iter ); +HYPRE_Int hypre_BoomerAMGSetILUMaxRowNnz( void *data, HYPRE_Int ilu_max_row_nnz ); +HYPRE_Int hypre_BoomerAMGSetILULocalReordering( void *data, HYPRE_Int ilu_reordering_type ); +HYPRE_Int hypre_BoomerAMGSetILUIterSetupType( void *data, HYPRE_Int ilu_iter_setup_type ); +HYPRE_Int hypre_BoomerAMGSetILUIterSetupOption( void *data, HYPRE_Int ilu_iter_setup_option ); +HYPRE_Int hypre_BoomerAMGSetILUIterSetupMaxIter( void *data, HYPRE_Int ilu_iter_setup_max_iter ); +HYPRE_Int hypre_BoomerAMGSetILUIterSetupTolerance( void *data, + HYPRE_Real ilu_iter_setup_tolerance ); +HYPRE_Int hypre_BoomerAMGSetFSAIAlgoType ( void *data, HYPRE_Int fsai_algo_type ); +HYPRE_Int hypre_BoomerAMGSetFSAILocalSolveType ( void *data, HYPRE_Int local_solve_type ); +HYPRE_Int hypre_BoomerAMGSetFSAIMaxSteps ( void *data, HYPRE_Int fsai_max_steps ); +HYPRE_Int hypre_BoomerAMGSetFSAIMaxStepSize ( void *data, HYPRE_Int fsai_max_step_size ); +HYPRE_Int hypre_BoomerAMGSetFSAIMaxNnzRow ( void *data, HYPRE_Int fsai_max_nnz_row ); +HYPRE_Int hypre_BoomerAMGSetFSAINumLevels ( void *data, HYPRE_Int fsai_num_levels ); +HYPRE_Int hypre_BoomerAMGSetFSAIEigMaxIters ( void *data, HYPRE_Int fsai_eig_max_iters ); +HYPRE_Int hypre_BoomerAMGSetFSAIThreshold ( void *data, HYPRE_Real fsai_threshold ); +HYPRE_Int hypre_BoomerAMGSetFSAIKapTolerance ( void *data, HYPRE_Real fsai_kap_tolerance ); +HYPRE_Int hypre_BoomerAMGSetChebyOrder ( void *data, HYPRE_Int order ); +HYPRE_Int hypre_BoomerAMGSetChebyFraction ( void *data, HYPRE_Real ratio ); +HYPRE_Int hypre_BoomerAMGSetChebyEigEst ( void *data, HYPRE_Int eig_est ); +HYPRE_Int hypre_BoomerAMGSetChebyVariant ( void *data, HYPRE_Int variant ); +HYPRE_Int hypre_BoomerAMGSetChebyScale ( void *data, HYPRE_Int scale ); +HYPRE_Int hypre_BoomerAMGSetInterpVectors ( void *solver, HYPRE_Int num_vectors, + hypre_ParVector **interp_vectors ); +HYPRE_Int hypre_BoomerAMGSetInterpVecVariant ( void *solver, HYPRE_Int var ); +HYPRE_Int hypre_BoomerAMGSetInterpVecQMax ( void *data, HYPRE_Int q_max ); +HYPRE_Int hypre_BoomerAMGSetInterpVecAbsQTrunc ( void *data, HYPRE_Real q_trunc ); +HYPRE_Int hypre_BoomerAMGSetSmoothInterpVectors ( void *solver, HYPRE_Int smooth_interp_vectors ); +HYPRE_Int hypre_BoomerAMGSetInterpRefine ( void *data, HYPRE_Int num_refine ); +HYPRE_Int hypre_BoomerAMGSetInterpVecFirstLevel ( void *data, HYPRE_Int level ); +HYPRE_Int hypre_BoomerAMGSetAdditive ( void *data, HYPRE_Int additive ); +HYPRE_Int hypre_BoomerAMGGetAdditive ( void *data, HYPRE_Int *additive ); +HYPRE_Int hypre_BoomerAMGSetMultAdditive ( void *data, HYPRE_Int mult_additive ); +HYPRE_Int hypre_BoomerAMGGetMultAdditive ( void *data, HYPRE_Int *mult_additive ); +HYPRE_Int hypre_BoomerAMGSetSimple ( void *data, HYPRE_Int simple ); +HYPRE_Int hypre_BoomerAMGGetSimple ( void *data, HYPRE_Int *simple ); +HYPRE_Int hypre_BoomerAMGSetAddLastLvl ( void *data, HYPRE_Int add_last_lvl ); +HYPRE_Int hypre_BoomerAMGSetNonGalerkinTol ( void *data, HYPRE_Real nongalerkin_tol ); +HYPRE_Int hypre_BoomerAMGSetLevelNonGalerkinTol ( void *data, HYPRE_Real nongalerkin_tol, + HYPRE_Int level ); +HYPRE_Int hypre_BoomerAMGSetNonGalerkTol ( void *data, HYPRE_Int nongalerk_num_tol, + HYPRE_Real *nongalerk_tol ); +HYPRE_Int hypre_BoomerAMGSetRAP2 ( void *data, HYPRE_Int rap2 ); +HYPRE_Int hypre_BoomerAMGSetModuleRAP2 ( void *data, HYPRE_Int mod_rap2 ); +HYPRE_Int hypre_BoomerAMGSetKeepTranspose ( void *data, HYPRE_Int keepTranspose ); #ifdef HYPRE_USING_DSUPERLU -HYPRE_Int hypre_BoomerAMGSetDSLUThreshold ( void *data , HYPRE_Int slu_threshold ); +HYPRE_Int hypre_BoomerAMGSetDSLUThreshold ( void *data, HYPRE_Int slu_threshold ); #endif -HYPRE_Int hypre_BoomerAMGSetCPoints( void *data, HYPRE_Int cpt_coarse_level, HYPRE_Int num_cpt_coarse, HYPRE_BigInt *cpt_coarse_index ); -HYPRE_Int hypre_BoomerAMGSetFPoints( void *data, HYPRE_Int isolated, HYPRE_Int num_points, HYPRE_BigInt *indices ); +HYPRE_Int hypre_BoomerAMGSetCPoints( void *data, HYPRE_Int cpt_coarse_level, + HYPRE_Int num_cpt_coarse, HYPRE_BigInt *cpt_coarse_index ); +HYPRE_Int hypre_BoomerAMGSetFPoints( void *data, HYPRE_Int isolated, HYPRE_Int num_points, + HYPRE_BigInt *indices ); +HYPRE_Int hypre_BoomerAMGSetCumNnzAP ( void *data, HYPRE_Real cum_nnz_AP ); +HYPRE_Int hypre_BoomerAMGGetCumNnzAP ( void *data, HYPRE_Real *cum_nnz_AP ); /* par_amg_setup.c */ -HYPRE_Int hypre_BoomerAMGSetup ( void *amg_vdata , hypre_ParCSRMatrix *A , hypre_ParVector *f , hypre_ParVector *u ); +HYPRE_Int hypre_BoomerAMGSetup ( void *amg_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, + hypre_ParVector *u ); /* par_amg_solve.c */ -HYPRE_Int hypre_BoomerAMGSolve ( void *amg_vdata , hypre_ParCSRMatrix *A , hypre_ParVector *f , hypre_ParVector *u ); +HYPRE_Int hypre_BoomerAMGSolve ( void *amg_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, + hypre_ParVector *u ); /* par_amg_solveT.c */ -HYPRE_Int hypre_BoomerAMGSolveT ( void *amg_vdata , hypre_ParCSRMatrix *A , hypre_ParVector *f , hypre_ParVector *u ); -HYPRE_Int hypre_BoomerAMGCycleT ( void *amg_vdata , hypre_ParVector **F_array , hypre_ParVector **U_array ); -HYPRE_Int hypre_BoomerAMGRelaxT ( hypre_ParCSRMatrix *A , hypre_ParVector *f , HYPRE_Int *cf_marker , HYPRE_Int relax_type , HYPRE_Int relax_points , HYPRE_Real relax_weight , hypre_ParVector *u , hypre_ParVector *Vtemp ); +HYPRE_Int hypre_BoomerAMGSolveT ( void *amg_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, + hypre_ParVector *u ); +HYPRE_Int hypre_BoomerAMGCycleT ( void *amg_vdata, hypre_ParVector **F_array, + hypre_ParVector **U_array ); +HYPRE_Int hypre_BoomerAMGRelaxT ( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, + HYPRE_Int relax_type, HYPRE_Int relax_points, HYPRE_Real relax_weight, hypre_ParVector *u, + hypre_ParVector *Vtemp ); /* par_cgc_coarsen.c */ -HYPRE_Int hypre_BoomerAMGCoarsenCGCb ( hypre_ParCSRMatrix *S , hypre_ParCSRMatrix *A , HYPRE_Int measure_type , HYPRE_Int coarsen_type , HYPRE_Int cgc_its , HYPRE_Int debug_flag , hypre_IntArray **CF_marker_ptr ); -HYPRE_Int hypre_BoomerAMGCoarsenCGC ( hypre_ParCSRMatrix *S , HYPRE_Int numberofgrids , HYPRE_Int coarsen_type , HYPRE_Int *CF_marker ); -HYPRE_Int hypre_AmgCGCPrepare ( hypre_ParCSRMatrix *S , HYPRE_Int nlocal , HYPRE_Int *CF_marker , HYPRE_Int **CF_marker_offd , HYPRE_Int coarsen_type , HYPRE_Int **vrange ); +HYPRE_Int hypre_BoomerAMGCoarsenCGCb ( hypre_ParCSRMatrix *S, hypre_ParCSRMatrix *A, + HYPRE_Int measure_type, HYPRE_Int coarsen_type, HYPRE_Int cgc_its, HYPRE_Int debug_flag, + hypre_IntArray **CF_marker_ptr ); +HYPRE_Int hypre_BoomerAMGCoarsenCGC ( hypre_ParCSRMatrix *S, HYPRE_Int numberofgrids, + HYPRE_Int coarsen_type, HYPRE_Int *CF_marker ); +HYPRE_Int hypre_AmgCGCPrepare ( hypre_ParCSRMatrix *S, HYPRE_Int nlocal, HYPRE_Int *CF_marker, + HYPRE_Int **CF_marker_offd, HYPRE_Int coarsen_type, HYPRE_Int **vrange ); //HYPRE_Int hypre_AmgCGCPrepare ( hypre_ParCSRMatrix *S , HYPRE_Int nlocal , HYPRE_Int *CF_marker , HYPRE_BigInt **CF_marker_offd , HYPRE_Int coarsen_type , HYPRE_BigInt **vrange ); -HYPRE_Int hypre_AmgCGCGraphAssemble ( hypre_ParCSRMatrix *S , HYPRE_Int *vertexrange , HYPRE_Int *CF_marker, HYPRE_Int *CF_marker_offd , HYPRE_Int coarsen_type , HYPRE_IJMatrix *ijG ); -HYPRE_Int hypre_AmgCGCChoose ( hypre_CSRMatrix *G , HYPRE_Int *vertexrange , HYPRE_Int mpisize , HYPRE_Int **coarse ); -HYPRE_Int hypre_AmgCGCBoundaryFix ( hypre_ParCSRMatrix *S , HYPRE_Int *CF_marker , HYPRE_Int *CF_marker_offd ); +HYPRE_Int hypre_AmgCGCGraphAssemble ( hypre_ParCSRMatrix *S, HYPRE_Int *vertexrange, + HYPRE_Int *CF_marker, HYPRE_Int *CF_marker_offd, HYPRE_Int coarsen_type, HYPRE_IJMatrix *ijG ); +HYPRE_Int hypre_AmgCGCChoose ( hypre_CSRMatrix *G, HYPRE_Int *vertexrange, HYPRE_Int mpisize, + HYPRE_Int **coarse ); +HYPRE_Int hypre_AmgCGCBoundaryFix ( hypre_ParCSRMatrix *S, HYPRE_Int *CF_marker, + HYPRE_Int *CF_marker_offd ); /* par_cg_relax_wt.c */ -HYPRE_Int hypre_BoomerAMGCGRelaxWt ( void *amg_vdata , HYPRE_Int level , HYPRE_Int num_cg_sweeps , HYPRE_Real *rlx_wt_ptr ); -HYPRE_Int hypre_Bisection ( HYPRE_Int n , HYPRE_Real *diag , HYPRE_Real *offd , HYPRE_Real y , HYPRE_Real z , HYPRE_Real tol , HYPRE_Int k , HYPRE_Real *ev_ptr ); +HYPRE_Int hypre_BoomerAMGCGRelaxWt ( void *amg_vdata, HYPRE_Int level, HYPRE_Int num_cg_sweeps, + HYPRE_Real *rlx_wt_ptr ); +HYPRE_Int hypre_Bisection ( HYPRE_Int n, HYPRE_Real *diag, HYPRE_Real *offd, HYPRE_Real y, + HYPRE_Real z, HYPRE_Real tol, HYPRE_Int k, HYPRE_Real *ev_ptr ); /* par_cheby.c */ -HYPRE_Int hypre_ParCSRRelax_Cheby_Setup ( hypre_ParCSRMatrix *A , HYPRE_Real max_eig , HYPRE_Real min_eig , HYPRE_Real fraction , HYPRE_Int order , HYPRE_Int scale , HYPRE_Int variant , HYPRE_Real **coefs_ptr , HYPRE_Real **ds_ptr ); -HYPRE_Int hypre_ParCSRRelax_Cheby_Solve ( hypre_ParCSRMatrix *A , hypre_ParVector *f , HYPRE_Real *ds_data , HYPRE_Real *coefs , HYPRE_Int order , HYPRE_Int scale , HYPRE_Int variant , hypre_ParVector *u , hypre_ParVector *v , hypre_ParVector *r , hypre_ParVector *orig_u_vec, hypre_ParVector *tmp_vec); - -HYPRE_Int hypre_ParCSRRelax_Cheby_SolveHost ( hypre_ParCSRMatrix *A , hypre_ParVector *f , HYPRE_Real *ds_data , HYPRE_Real *coefs , HYPRE_Int order , HYPRE_Int scale , HYPRE_Int variant , hypre_ParVector *u , hypre_ParVector *v , hypre_ParVector *r, hypre_ParVector *orig_u_vec, hypre_ParVector *tmp_vec); +HYPRE_Int hypre_ParCSRRelax_Cheby_Setup ( hypre_ParCSRMatrix *A, HYPRE_Real max_eig, + HYPRE_Real min_eig, HYPRE_Real fraction, HYPRE_Int order, HYPRE_Int scale, HYPRE_Int variant, + HYPRE_Real **coefs_ptr, HYPRE_Real **ds_ptr ); +HYPRE_Int hypre_ParCSRRelax_Cheby_Solve ( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Real *ds_data, HYPRE_Real *coefs, HYPRE_Int order, HYPRE_Int scale, HYPRE_Int variant, + hypre_ParVector *u, hypre_ParVector *v, hypre_ParVector *r, hypre_ParVector *orig_u_vec, + hypre_ParVector *tmp_vec); + +HYPRE_Int hypre_ParCSRRelax_Cheby_SolveHost ( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Real *ds_data, HYPRE_Real *coefs, HYPRE_Int order, HYPRE_Int scale, HYPRE_Int variant, + hypre_ParVector *u, hypre_ParVector *v, hypre_ParVector *r, hypre_ParVector *orig_u_vec, + hypre_ParVector *tmp_vec); /* par_cheby_device.c */ -HYPRE_Int hypre_ParCSRRelax_Cheby_SolveDevice ( hypre_ParCSRMatrix *A , hypre_ParVector *f , HYPRE_Real *ds_data , HYPRE_Real *coefs , HYPRE_Int order , HYPRE_Int scale , HYPRE_Int variant , hypre_ParVector *u , hypre_ParVector *v , hypre_ParVector *r, hypre_ParVector *orig_u_vec, hypre_ParVector *tmp_vec); +HYPRE_Int hypre_ParCSRRelax_Cheby_SolveDevice ( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Real *ds_data, HYPRE_Real *coefs, HYPRE_Int order, HYPRE_Int scale, HYPRE_Int variant, + hypre_ParVector *u, hypre_ParVector *v, hypre_ParVector *r, hypre_ParVector *orig_u_vec, + hypre_ParVector *tmp_vec); /* par_coarsen.c */ -HYPRE_Int hypre_BoomerAMGCoarsen ( hypre_ParCSRMatrix *S , hypre_ParCSRMatrix *A , HYPRE_Int CF_init , HYPRE_Int debug_flag , hypre_IntArray **CF_marker_ptr ); -HYPRE_Int hypre_BoomerAMGCoarsenRuge ( hypre_ParCSRMatrix *S , hypre_ParCSRMatrix *A , HYPRE_Int measure_type , HYPRE_Int coarsen_type , HYPRE_Int cut_factor , HYPRE_Int debug_flag , hypre_IntArray **CF_marker_ptr ); -HYPRE_Int hypre_BoomerAMGCoarsenFalgout ( hypre_ParCSRMatrix *S , hypre_ParCSRMatrix *A , HYPRE_Int measure_type , HYPRE_Int cut_factor , HYPRE_Int debug_flag , hypre_IntArray **CF_marker_ptr ); -HYPRE_Int hypre_BoomerAMGCoarsenHMIS ( hypre_ParCSRMatrix *S , hypre_ParCSRMatrix *A , HYPRE_Int measure_type , HYPRE_Int cut_factor , HYPRE_Int debug_flag , hypre_IntArray **CF_marker_ptr ); -HYPRE_Int hypre_BoomerAMGCoarsenPMIS ( hypre_ParCSRMatrix *S , hypre_ParCSRMatrix *A , HYPRE_Int CF_init , HYPRE_Int debug_flag , hypre_IntArray **CF_marker_ptr ); -HYPRE_Int hypre_BoomerAMGCoarsenPMISHost ( hypre_ParCSRMatrix *S , hypre_ParCSRMatrix *A , HYPRE_Int CF_init , HYPRE_Int debug_flag , hypre_IntArray **CF_marker_ptr ); - -HYPRE_Int hypre_BoomerAMGCoarsenPMISDevice( hypre_ParCSRMatrix *S, hypre_ParCSRMatrix *A, HYPRE_Int CF_init, HYPRE_Int debug_flag, hypre_IntArray **CF_marker_ptr ); +HYPRE_Int hypre_BoomerAMGCoarsen ( hypre_ParCSRMatrix *S, hypre_ParCSRMatrix *A, HYPRE_Int CF_init, + HYPRE_Int debug_flag, hypre_IntArray **CF_marker_ptr ); +HYPRE_Int hypre_BoomerAMGCoarsenRuge ( hypre_ParCSRMatrix *S, hypre_ParCSRMatrix *A, + HYPRE_Int measure_type, HYPRE_Int coarsen_type, HYPRE_Int cut_factor, HYPRE_Int debug_flag, + hypre_IntArray **CF_marker_ptr ); +HYPRE_Int hypre_BoomerAMGCoarsenFalgout ( hypre_ParCSRMatrix *S, hypre_ParCSRMatrix *A, + HYPRE_Int measure_type, HYPRE_Int cut_factor, HYPRE_Int debug_flag, + hypre_IntArray **CF_marker_ptr ); +HYPRE_Int hypre_BoomerAMGCoarsenHMIS ( hypre_ParCSRMatrix *S, hypre_ParCSRMatrix *A, + HYPRE_Int measure_type, HYPRE_Int cut_factor, HYPRE_Int debug_flag, + hypre_IntArray **CF_marker_ptr ); +HYPRE_Int hypre_BoomerAMGCoarsenPMIS ( hypre_ParCSRMatrix *S, hypre_ParCSRMatrix *A, + HYPRE_Int CF_init, HYPRE_Int debug_flag, hypre_IntArray **CF_marker_ptr ); +HYPRE_Int hypre_BoomerAMGCoarsenPMISHost ( hypre_ParCSRMatrix *S, hypre_ParCSRMatrix *A, + HYPRE_Int CF_init, HYPRE_Int debug_flag, hypre_IntArray **CF_marker_ptr ); + +HYPRE_Int hypre_BoomerAMGCoarsenPMISDevice( hypre_ParCSRMatrix *S, hypre_ParCSRMatrix *A, + HYPRE_Int CF_init, HYPRE_Int debug_flag, hypre_IntArray **CF_marker_ptr ); /* par_coarsen_device.c */ -HYPRE_Int hypre_GetGlobalMeasureDevice( hypre_ParCSRMatrix *S, hypre_ParCSRCommPkg *comm_pkg, HYPRE_Int CF_init, HYPRE_Int aug_rand, HYPRE_Real *measure_diag, HYPRE_Real *measure_offd, HYPRE_Real *real_send_buf ); +HYPRE_Int hypre_GetGlobalMeasureDevice( hypre_ParCSRMatrix *S, hypre_ParCSRCommPkg *comm_pkg, + HYPRE_Int CF_init, HYPRE_Int aug_rand, HYPRE_Real *measure_diag, HYPRE_Real *measure_offd, + HYPRE_Real *real_send_buf ); /* par_coarse_parms.c */ -HYPRE_Int hypre_BoomerAMGCoarseParms ( MPI_Comm comm , HYPRE_Int local_num_variables , HYPRE_Int num_functions , hypre_IntArray *dof_func , hypre_IntArray *CF_marker , hypre_IntArray **coarse_dof_func_ptr , HYPRE_BigInt **coarse_pnts_global_ptr ); -HYPRE_Int hypre_BoomerAMGCoarseParmsHost ( MPI_Comm comm , HYPRE_Int local_num_variables , HYPRE_Int num_functions , hypre_IntArray *dof_func , hypre_IntArray *CF_marker , hypre_IntArray **coarse_dof_func_ptr , HYPRE_BigInt **coarse_pnts_global_ptr ); -HYPRE_Int hypre_BoomerAMGCoarseParmsDevice ( MPI_Comm comm , HYPRE_Int local_num_variables , HYPRE_Int num_functions , hypre_IntArray *dof_func , hypre_IntArray *CF_marker , hypre_IntArray **coarse_dof_func_ptr , HYPRE_BigInt **coarse_pnts_global_ptr ); -HYPRE_Int hypre_BoomerAMGInitDofFuncDevice( HYPRE_Int *dof_func, HYPRE_Int local_size, HYPRE_Int offset, HYPRE_Int num_functions ); +HYPRE_Int hypre_BoomerAMGCoarseParms ( MPI_Comm comm, HYPRE_Int local_num_variables, + HYPRE_Int num_functions, hypre_IntArray *dof_func, hypre_IntArray *CF_marker, + hypre_IntArray **coarse_dof_func_ptr, HYPRE_BigInt *coarse_pnts_global ); +HYPRE_Int hypre_BoomerAMGCoarseParmsHost ( MPI_Comm comm, HYPRE_Int local_num_variables, + HYPRE_Int num_functions, hypre_IntArray *dof_func, hypre_IntArray *CF_marker, + hypre_IntArray **coarse_dof_func_ptr, HYPRE_BigInt *coarse_pnts_global ); +HYPRE_Int hypre_BoomerAMGCoarseParmsDevice ( MPI_Comm comm, HYPRE_Int local_num_variables, + HYPRE_Int num_functions, hypre_IntArray *dof_func, hypre_IntArray *CF_marker, + hypre_IntArray **coarse_dof_func_ptr, HYPRE_BigInt *coarse_pnts_global ); +HYPRE_Int hypre_BoomerAMGInitDofFuncDevice( HYPRE_Int *dof_func, HYPRE_Int local_size, + HYPRE_Int offset, HYPRE_Int num_functions ); /* par_coordinates.c */ -float *GenerateCoordinates ( MPI_Comm comm , HYPRE_BigInt nx , HYPRE_BigInt ny , HYPRE_BigInt nz , HYPRE_Int P , HYPRE_Int Q , HYPRE_Int R , HYPRE_Int p , HYPRE_Int q , HYPRE_Int r , HYPRE_Int coorddim ); +float *hypre_GenerateCoordinates ( MPI_Comm comm, HYPRE_BigInt nx, HYPRE_BigInt ny, + HYPRE_BigInt nz, HYPRE_Int P, HYPRE_Int Q, HYPRE_Int R, + HYPRE_Int p, HYPRE_Int q, HYPRE_Int r, HYPRE_Int coorddim ); /* par_cr.c */ -HYPRE_Int hypre_BoomerAMGCoarsenCR1 ( hypre_ParCSRMatrix *A , hypre_IntArray **CF_marker_ptr , HYPRE_BigInt *coarse_size_ptr , HYPRE_Int num_CR_relax_steps , HYPRE_Int IS_type , HYPRE_Int CRaddCpoints ); -HYPRE_Int hypre_cr ( HYPRE_Int *A_i , HYPRE_Int *A_j , HYPRE_Real *A_data , HYPRE_Int n , HYPRE_Int *cf , HYPRE_Int rlx , HYPRE_Real omega , HYPRE_Real tg , HYPRE_Int mu ); -HYPRE_Int hypre_GraphAdd ( Link *list , HYPRE_Int *head , HYPRE_Int *tail , HYPRE_Int index , HYPRE_Int istack ); -HYPRE_Int hypre_GraphRemove ( Link *list , HYPRE_Int *head , HYPRE_Int *tail , HYPRE_Int index ); -HYPRE_Int hypre_IndepSetGreedy ( HYPRE_Int *A_i , HYPRE_Int *A_j , HYPRE_Int n , HYPRE_Int *cf ); -HYPRE_Int hypre_IndepSetGreedyS ( HYPRE_Int *A_i , HYPRE_Int *A_j , HYPRE_Int n , HYPRE_Int *cf ); -HYPRE_Int hypre_fptjaccr ( HYPRE_Int *cf , HYPRE_Int *A_i , HYPRE_Int *A_j , HYPRE_Real *A_data , HYPRE_Int n , HYPRE_Real *e0 , HYPRE_Real omega , HYPRE_Real *e1 ); -HYPRE_Int hypre_fptgscr ( HYPRE_Int *cf , HYPRE_Int *A_i , HYPRE_Int *A_j , HYPRE_Real *A_data , HYPRE_Int n , HYPRE_Real *e0 , HYPRE_Real *e1 ); -HYPRE_Int hypre_formu ( HYPRE_Int *cf , HYPRE_Int n , HYPRE_Real *e1 , HYPRE_Int *A_i , HYPRE_Real rho ); -HYPRE_Int hypre_BoomerAMGIndepRS ( hypre_ParCSRMatrix *S , HYPRE_Int measure_type , HYPRE_Int debug_flag , HYPRE_Int *CF_marker ); -HYPRE_Int hypre_BoomerAMGIndepRSa ( hypre_ParCSRMatrix *S , HYPRE_Int measure_type , HYPRE_Int debug_flag , HYPRE_Int *CF_marker ); -HYPRE_Int hypre_BoomerAMGIndepHMIS ( hypre_ParCSRMatrix *S , HYPRE_Int measure_type , HYPRE_Int debug_flag , HYPRE_Int *CF_marker ); -HYPRE_Int hypre_BoomerAMGIndepHMISa ( hypre_ParCSRMatrix *S , HYPRE_Int measure_type , HYPRE_Int debug_flag , HYPRE_Int *CF_marker ); -HYPRE_Int hypre_BoomerAMGIndepPMIS ( hypre_ParCSRMatrix *S , HYPRE_Int CF_init , HYPRE_Int debug_flag , HYPRE_Int *CF_marker ); -HYPRE_Int hypre_BoomerAMGIndepPMISa ( hypre_ParCSRMatrix *S , HYPRE_Int CF_init , HYPRE_Int debug_flag , HYPRE_Int *CF_marker ); -HYPRE_Int hypre_BoomerAMGCoarsenCR ( hypre_ParCSRMatrix *A , hypre_IntArray **CF_marker_ptr , HYPRE_BigInt *coarse_size_ptr , HYPRE_Int num_CR_relax_steps , HYPRE_Int IS_type , HYPRE_Int num_functions , HYPRE_Int rlx_type , HYPRE_Real relax_weight , HYPRE_Real omega , HYPRE_Real theta , HYPRE_Solver smoother , hypre_ParCSRMatrix *AN , HYPRE_Int useCG , hypre_ParCSRMatrix *S ); +HYPRE_Int hypre_BoomerAMGCoarsenCR1 ( hypre_ParCSRMatrix *A, hypre_IntArray **CF_marker_ptr, + HYPRE_BigInt *coarse_size_ptr, HYPRE_Int num_CR_relax_steps, HYPRE_Int IS_type, + HYPRE_Int CRaddCpoints ); +HYPRE_Int hypre_cr ( HYPRE_Int *A_i, HYPRE_Int *A_j, HYPRE_Real *A_data, HYPRE_Int n, HYPRE_Int *cf, + HYPRE_Int rlx, HYPRE_Real omega, HYPRE_Real tg, HYPRE_Int mu ); +HYPRE_Int hypre_GraphAdd ( Link *list, HYPRE_Int *head, HYPRE_Int *tail, HYPRE_Int index, + HYPRE_Int istack ); +HYPRE_Int hypre_GraphRemove ( Link *list, HYPRE_Int *head, HYPRE_Int *tail, HYPRE_Int index ); +HYPRE_Int hypre_IndepSetGreedy ( HYPRE_Int *A_i, HYPRE_Int *A_j, HYPRE_Int n, HYPRE_Int *cf ); +HYPRE_Int hypre_IndepSetGreedyS ( HYPRE_Int *A_i, HYPRE_Int *A_j, HYPRE_Int n, HYPRE_Int *cf ); +HYPRE_Int hypre_fptjaccr ( HYPRE_Int *cf, HYPRE_Int *A_i, HYPRE_Int *A_j, HYPRE_Real *A_data, + HYPRE_Int n, HYPRE_Real *e0, HYPRE_Real omega, HYPRE_Real *e1 ); +HYPRE_Int hypre_fptgscr ( HYPRE_Int *cf, HYPRE_Int *A_i, HYPRE_Int *A_j, HYPRE_Real *A_data, + HYPRE_Int n, HYPRE_Real *e0, HYPRE_Real *e1 ); +HYPRE_Int hypre_formu ( HYPRE_Int *cf, HYPRE_Int n, HYPRE_Real *e1, HYPRE_Int *A_i, + HYPRE_Real rho ); +HYPRE_Int hypre_BoomerAMGIndepRS ( hypre_ParCSRMatrix *S, HYPRE_Int measure_type, + HYPRE_Int debug_flag, HYPRE_Int *CF_marker ); +HYPRE_Int hypre_BoomerAMGIndepRSa ( hypre_ParCSRMatrix *S, HYPRE_Int measure_type, + HYPRE_Int debug_flag, HYPRE_Int *CF_marker ); +HYPRE_Int hypre_BoomerAMGIndepHMIS ( hypre_ParCSRMatrix *S, HYPRE_Int measure_type, + HYPRE_Int debug_flag, HYPRE_Int *CF_marker ); +HYPRE_Int hypre_BoomerAMGIndepHMISa ( hypre_ParCSRMatrix *S, HYPRE_Int measure_type, + HYPRE_Int debug_flag, HYPRE_Int *CF_marker ); +HYPRE_Int hypre_BoomerAMGIndepPMIS ( hypre_ParCSRMatrix *S, HYPRE_Int CF_init, HYPRE_Int debug_flag, + HYPRE_Int *CF_marker ); +HYPRE_Int hypre_BoomerAMGIndepPMISa ( hypre_ParCSRMatrix *S, HYPRE_Int CF_init, + HYPRE_Int debug_flag, HYPRE_Int *CF_marker ); +HYPRE_Int hypre_BoomerAMGCoarsenCR ( hypre_ParCSRMatrix *A, hypre_IntArray **CF_marker_ptr, + HYPRE_BigInt *coarse_size_ptr, HYPRE_Int num_CR_relax_steps, HYPRE_Int IS_type, + HYPRE_Int num_functions, HYPRE_Int rlx_type, HYPRE_Real relax_weight, HYPRE_Real omega, + HYPRE_Real theta, HYPRE_Solver smoother, hypre_ParCSRMatrix *AN, HYPRE_Int useCG, + hypre_ParCSRMatrix *S ); /* par_cycle.c */ -HYPRE_Int hypre_BoomerAMGCycle ( void *amg_vdata , hypre_ParVector **F_array , hypre_ParVector **U_array ); +HYPRE_Int hypre_BoomerAMGCycle ( void *amg_vdata, hypre_ParVector **F_array, + hypre_ParVector **U_array ); /* par_difconv.c */ -HYPRE_ParCSRMatrix GenerateDifConv ( MPI_Comm comm , HYPRE_BigInt nx , HYPRE_BigInt ny , HYPRE_BigInt nz , HYPRE_Int P , HYPRE_Int Q , HYPRE_Int R , HYPRE_Int p , HYPRE_Int q , HYPRE_Int r , HYPRE_Real *value ); +HYPRE_ParCSRMatrix GenerateDifConv ( MPI_Comm comm, HYPRE_BigInt nx, HYPRE_BigInt ny, + HYPRE_BigInt nz, HYPRE_Int P, HYPRE_Int Q, HYPRE_Int R, HYPRE_Int p, HYPRE_Int q, HYPRE_Int r, + HYPRE_Real *value ); /* par_gsmg.c */ -HYPRE_Int hypre_ParCSRMatrixFillSmooth ( HYPRE_Int nsamples , HYPRE_Real *samples , hypre_ParCSRMatrix *S , hypre_ParCSRMatrix *A , HYPRE_Int num_functions , HYPRE_Int *dof_func ); +HYPRE_Int hypre_ParCSRMatrixFillSmooth ( HYPRE_Int nsamples, HYPRE_Real *samples, + hypre_ParCSRMatrix *S, hypre_ParCSRMatrix *A, HYPRE_Int num_functions, HYPRE_Int *dof_func ); HYPRE_Real hypre_ParCSRMatrixChooseThresh ( hypre_ParCSRMatrix *S ); -HYPRE_Int hypre_ParCSRMatrixThreshold ( hypre_ParCSRMatrix *A , HYPRE_Real thresh ); -HYPRE_Int hypre_BoomerAMGCreateSmoothVecs ( void *data , hypre_ParCSRMatrix *A , HYPRE_Int num_sweeps , HYPRE_Int level , HYPRE_Real **SmoothVecs_p ); -HYPRE_Int hypre_BoomerAMGCreateSmoothDirs ( void *data , hypre_ParCSRMatrix *A , HYPRE_Real *SmoothVecs , HYPRE_Real thresh , HYPRE_Int num_functions , HYPRE_Int *dof_func , hypre_ParCSRMatrix **S_ptr ); -HYPRE_Int hypre_BoomerAMGNormalizeVecs ( HYPRE_Int n , HYPRE_Int num , HYPRE_Real *V ); -HYPRE_Int hypre_BoomerAMGFitVectors ( HYPRE_Int ip , HYPRE_Int n , HYPRE_Int num , const HYPRE_Real *V , HYPRE_Int nc , const HYPRE_Int *ind , HYPRE_Real *val ); -HYPRE_Int hypre_BoomerAMGBuildInterpLS ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int num_smooth , HYPRE_Real *SmoothVecs , hypre_ParCSRMatrix **P_ptr ); -HYPRE_Int hypre_BoomerAMGBuildInterpGSMG ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_ParCSRMatrixThreshold ( hypre_ParCSRMatrix *A, HYPRE_Real thresh ); +HYPRE_Int hypre_BoomerAMGCreateSmoothVecs ( void *data, hypre_ParCSRMatrix *A, HYPRE_Int num_sweeps, + HYPRE_Int level, HYPRE_Real **SmoothVecs_p ); +HYPRE_Int hypre_BoomerAMGCreateSmoothDirs ( void *data, hypre_ParCSRMatrix *A, + HYPRE_Real *SmoothVecs, HYPRE_Real thresh, HYPRE_Int num_functions, HYPRE_Int *dof_func, + hypre_ParCSRMatrix **S_ptr ); +HYPRE_Int hypre_BoomerAMGNormalizeVecs ( HYPRE_Int n, HYPRE_Int num, HYPRE_Real *V ); +HYPRE_Int hypre_BoomerAMGFitVectors ( HYPRE_Int ip, HYPRE_Int n, HYPRE_Int num, const HYPRE_Real *V, + HYPRE_Int nc, const HYPRE_Int *ind, HYPRE_Real *val ); +HYPRE_Int hypre_BoomerAMGBuildInterpLS ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int num_smooth, HYPRE_Real *SmoothVecs, + hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGBuildInterpGSMG ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, HYPRE_Real trunc_factor, hypre_ParCSRMatrix **P_ptr ); /* par_indepset.c */ -HYPRE_Int hypre_BoomerAMGIndepSetInit ( hypre_ParCSRMatrix *S , HYPRE_Real *measure_array , HYPRE_Int seq_rand ); -HYPRE_Int hypre_BoomerAMGIndepSet ( hypre_ParCSRMatrix *S , HYPRE_Real *measure_array , HYPRE_Int *graph_array , HYPRE_Int graph_array_size , HYPRE_Int *graph_array_offd , HYPRE_Int graph_array_offd_size , HYPRE_Int *IS_marker , HYPRE_Int *IS_marker_offd ); +HYPRE_Int hypre_BoomerAMGIndepSetInit ( hypre_ParCSRMatrix *S, HYPRE_Real *measure_array, + HYPRE_Int seq_rand ); +HYPRE_Int hypre_BoomerAMGIndepSet ( hypre_ParCSRMatrix *S, HYPRE_Real *measure_array, + HYPRE_Int *graph_array, HYPRE_Int graph_array_size, HYPRE_Int *graph_array_offd, + HYPRE_Int graph_array_offd_size, HYPRE_Int *IS_marker, HYPRE_Int *IS_marker_offd ); -HYPRE_Int hypre_BoomerAMGIndepSetInitDevice( hypre_ParCSRMatrix *S, HYPRE_Real *measure_array, HYPRE_Int aug_rand); +HYPRE_Int hypre_BoomerAMGIndepSetInitDevice( hypre_ParCSRMatrix *S, HYPRE_Real *measure_array, + HYPRE_Int aug_rand); -HYPRE_Int hypre_BoomerAMGIndepSetDevice( hypre_ParCSRMatrix *S, HYPRE_Real *measure_diag, HYPRE_Real *measure_offd, HYPRE_Int graph_diag_size, HYPRE_Int *graph_diag, HYPRE_Int *IS_marker_diag, HYPRE_Int *IS_marker_offd, hypre_ParCSRCommPkg *comm_pkg, HYPRE_Int *int_send_buf ); +HYPRE_Int hypre_BoomerAMGIndepSetDevice( hypre_ParCSRMatrix *S, HYPRE_Real *measure_diag, + HYPRE_Real *measure_offd, HYPRE_Int graph_diag_size, HYPRE_Int *graph_diag, + HYPRE_Int *IS_marker_diag, HYPRE_Int *IS_marker_offd, hypre_ParCSRCommPkg *comm_pkg, + HYPRE_Int *int_send_buf ); /* par_interp.c */ -HYPRE_Int hypre_BoomerAMGBuildInterp ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int max_elmts , hypre_ParCSRMatrix **P_ptr ); -HYPRE_Int hypre_BoomerAMGBuildInterpHE ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int max_elmts , hypre_ParCSRMatrix **P_ptr ); -HYPRE_Int hypre_BoomerAMGBuildDirInterp ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int max_elmts , HYPRE_Int interp_type, hypre_ParCSRMatrix **P_ptr ); -HYPRE_Int hypre_BoomerAMGBuildDirInterpDevice( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int max_elmts , HYPRE_Int interp_type, hypre_ParCSRMatrix **P_ptr ); - -HYPRE_Int hypre_BoomerAMGInterpTruncation ( hypre_ParCSRMatrix *P, HYPRE_Real trunc_factor, HYPRE_Int max_elmts ); -HYPRE_Int hypre_BoomerAMGInterpTruncationDevice( hypre_ParCSRMatrix *P, HYPRE_Real trunc_factor, HYPRE_Int max_elmts ); - -HYPRE_Int hypre_BoomerAMGBuildInterpModUnk ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int max_elmts , hypre_ParCSRMatrix **P_ptr ); -HYPRE_Int hypre_BoomerAMGTruncandBuild ( hypre_ParCSRMatrix *P , HYPRE_Real trunc_factor , HYPRE_Int max_elmts ); -hypre_ParCSRMatrix *hypre_CreateC ( hypre_ParCSRMatrix *A , HYPRE_Real w ); - -HYPRE_Int hypre_BoomerAMGBuildInterpOnePntHost( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int debug_flag, hypre_ParCSRMatrix **P_ptr); -HYPRE_Int hypre_BoomerAMGBuildInterpOnePntDevice( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int debug_flag, hypre_ParCSRMatrix **P_ptr); -HYPRE_Int hypre_BoomerAMGBuildInterpOnePnt( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int debug_flag, hypre_ParCSRMatrix **P_ptr); +HYPRE_Int hypre_BoomerAMGBuildInterp ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGBuildInterpHE ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGBuildDirInterp ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int max_elmts, HYPRE_Int interp_type, + hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGBuildDirInterpDevice( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int max_elmts, HYPRE_Int interp_type, + hypre_ParCSRMatrix **P_ptr ); + +HYPRE_Int hypre_BoomerAMGInterpTruncation ( hypre_ParCSRMatrix *P, HYPRE_Real trunc_factor, + HYPRE_Int max_elmts ); +HYPRE_Int hypre_BoomerAMGInterpTruncationDevice( hypre_ParCSRMatrix *P, HYPRE_Real trunc_factor, + HYPRE_Int max_elmts ); + +HYPRE_Int hypre_BoomerAMGBuildInterpModUnk ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGTruncandBuild ( hypre_ParCSRMatrix *P, HYPRE_Real trunc_factor, + HYPRE_Int max_elmts ); +hypre_ParCSRMatrix *hypre_CreateC ( hypre_ParCSRMatrix *A, HYPRE_Real w ); + +HYPRE_Int hypre_BoomerAMGBuildInterpOnePntHost( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, hypre_ParCSRMatrix **P_ptr); +HYPRE_Int hypre_BoomerAMGBuildInterpOnePntDevice( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, hypre_ParCSRMatrix **P_ptr); +HYPRE_Int hypre_BoomerAMGBuildInterpOnePnt( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, hypre_ParCSRMatrix **P_ptr); /* par_jacobi_interp.c */ -void hypre_BoomerAMGJacobiInterp ( hypre_ParCSRMatrix *A , hypre_ParCSRMatrix **P , hypre_ParCSRMatrix *S , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int *CF_marker , HYPRE_Int level , HYPRE_Real truncation_threshold , HYPRE_Real truncation_threshold_minus ); -void hypre_BoomerAMGJacobiInterp_1 ( hypre_ParCSRMatrix *A , hypre_ParCSRMatrix **P , hypre_ParCSRMatrix *S , HYPRE_Int *CF_marker , HYPRE_Int level , HYPRE_Real truncation_threshold , HYPRE_Real truncation_threshold_minus , HYPRE_Int *dof_func , HYPRE_Int *dof_func_offd , HYPRE_Real weight_AF ); -void hypre_BoomerAMGTruncateInterp ( hypre_ParCSRMatrix *P , HYPRE_Real eps , HYPRE_Real dlt , HYPRE_Int *CF_marker ); -HYPRE_Int hypre_ParCSRMatrix_dof_func_offd ( hypre_ParCSRMatrix *A , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int **dof_func_offd ); +void hypre_BoomerAMGJacobiInterp ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **P, + hypre_ParCSRMatrix *S, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int *CF_marker, + HYPRE_Int level, HYPRE_Real truncation_threshold, HYPRE_Real truncation_threshold_minus ); +void hypre_BoomerAMGJacobiInterp_1 ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **P, + hypre_ParCSRMatrix *S, HYPRE_Int *CF_marker, HYPRE_Int level, HYPRE_Real truncation_threshold, + HYPRE_Real truncation_threshold_minus, HYPRE_Int *dof_func, HYPRE_Int *dof_func_offd, + HYPRE_Real weight_AF ); +void hypre_BoomerAMGTruncateInterp ( hypre_ParCSRMatrix *P, HYPRE_Real eps, HYPRE_Real dlt, + HYPRE_Int *CF_marker ); +HYPRE_Int hypre_ParCSRMatrix_dof_func_offd ( hypre_ParCSRMatrix *A, HYPRE_Int num_functions, + HYPRE_Int *dof_func, HYPRE_Int **dof_func_offd ); /* par_laplace_27pt.c */ -HYPRE_ParCSRMatrix GenerateLaplacian27pt ( MPI_Comm comm , HYPRE_BigInt nx , HYPRE_BigInt ny , HYPRE_BigInt nz , HYPRE_Int P , HYPRE_Int Q , HYPRE_Int R , HYPRE_Int p , HYPRE_Int q , HYPRE_Int r , HYPRE_Real *value ); -HYPRE_Int hypre_map3 ( HYPRE_BigInt ix , HYPRE_BigInt iy , HYPRE_BigInt iz , HYPRE_Int p , HYPRE_Int q , HYPRE_Int r , HYPRE_Int P , HYPRE_Int Q , HYPRE_Int R , HYPRE_BigInt *nx_part , HYPRE_BigInt *ny_part , HYPRE_BigInt *nz_part ); +HYPRE_ParCSRMatrix GenerateLaplacian27pt ( MPI_Comm comm, HYPRE_BigInt nx, HYPRE_BigInt ny, + HYPRE_BigInt nz, HYPRE_Int P, HYPRE_Int Q, HYPRE_Int R, HYPRE_Int p, HYPRE_Int q, HYPRE_Int r, + HYPRE_Real *value ); +HYPRE_Int hypre_map3 ( HYPRE_BigInt ix, HYPRE_BigInt iy, HYPRE_BigInt iz, HYPRE_Int p, HYPRE_Int q, + HYPRE_Int r, HYPRE_Int P, HYPRE_Int Q, HYPRE_Int R, HYPRE_BigInt *nx_part, HYPRE_BigInt *ny_part, + HYPRE_BigInt *nz_part ); /* par_laplace_9pt.c */ -HYPRE_ParCSRMatrix GenerateLaplacian9pt ( MPI_Comm comm , HYPRE_BigInt nx , HYPRE_BigInt ny , HYPRE_Int P , HYPRE_Int Q , HYPRE_Int p , HYPRE_Int q , HYPRE_Real *value ); -HYPRE_BigInt hypre_map2 ( HYPRE_BigInt ix , HYPRE_BigInt iy , HYPRE_Int p , HYPRE_Int q , HYPRE_BigInt nx , HYPRE_BigInt *nx_part , HYPRE_BigInt *ny_part ); +HYPRE_ParCSRMatrix GenerateLaplacian9pt ( MPI_Comm comm, HYPRE_BigInt nx, HYPRE_BigInt ny, + HYPRE_Int P, HYPRE_Int Q, HYPRE_Int p, HYPRE_Int q, HYPRE_Real *value ); +HYPRE_BigInt hypre_map2 ( HYPRE_BigInt ix, HYPRE_BigInt iy, HYPRE_Int p, HYPRE_Int q, + HYPRE_BigInt nx, HYPRE_BigInt *nx_part, HYPRE_BigInt *ny_part ); /* par_laplace.c */ -HYPRE_ParCSRMatrix GenerateLaplacian ( MPI_Comm comm , HYPRE_BigInt ix , HYPRE_BigInt ny , HYPRE_BigInt nz , HYPRE_Int P , HYPRE_Int Q , HYPRE_Int R , HYPRE_Int p , HYPRE_Int q , HYPRE_Int r , HYPRE_Real *value ); -HYPRE_BigInt hypre_map ( HYPRE_BigInt ix , HYPRE_BigInt iy , HYPRE_BigInt iz , HYPRE_Int p, HYPRE_Int q, HYPRE_Int r, HYPRE_BigInt nx , HYPRE_BigInt ny, HYPRE_BigInt *nx_part, HYPRE_BigInt *ny_part, HYPRE_BigInt *nz_part ); -HYPRE_ParCSRMatrix GenerateSysLaplacian ( MPI_Comm comm , HYPRE_BigInt nx , HYPRE_BigInt ny , HYPRE_BigInt nz , HYPRE_Int P , HYPRE_Int Q , HYPRE_Int R , HYPRE_Int p , HYPRE_Int q , HYPRE_Int r , HYPRE_Int num_fun , HYPRE_Real *mtrx , HYPRE_Real *value ); -HYPRE_ParCSRMatrix GenerateSysLaplacianVCoef ( MPI_Comm comm , HYPRE_BigInt nx , HYPRE_BigInt ny , HYPRE_BigInt nz , HYPRE_Int P , HYPRE_Int Q , HYPRE_Int R , HYPRE_Int p , HYPRE_Int q , HYPRE_Int r , HYPRE_Int num_fun , HYPRE_Real *mtrx , HYPRE_Real *value ); +HYPRE_ParCSRMatrix GenerateLaplacian ( MPI_Comm comm, HYPRE_BigInt ix, HYPRE_BigInt ny, + HYPRE_BigInt nz, HYPRE_Int P, HYPRE_Int Q, HYPRE_Int R, HYPRE_Int p, HYPRE_Int q, HYPRE_Int r, + HYPRE_Real *value ); +HYPRE_BigInt hypre_map ( HYPRE_BigInt ix, HYPRE_BigInt iy, HYPRE_BigInt iz, HYPRE_Int p, + HYPRE_Int q, HYPRE_Int r, HYPRE_BigInt nx, HYPRE_BigInt ny, HYPRE_BigInt *nx_part, + HYPRE_BigInt *ny_part, HYPRE_BigInt *nz_part ); +HYPRE_ParCSRMatrix GenerateSysLaplacian ( MPI_Comm comm, HYPRE_BigInt nx, HYPRE_BigInt ny, + HYPRE_BigInt nz, HYPRE_Int P, HYPRE_Int Q, HYPRE_Int R, HYPRE_Int p, HYPRE_Int q, HYPRE_Int r, + HYPRE_Int num_fun, HYPRE_Real *mtrx, HYPRE_Real *value ); +HYPRE_ParCSRMatrix GenerateSysLaplacianVCoef ( MPI_Comm comm, HYPRE_BigInt nx, HYPRE_BigInt ny, + HYPRE_BigInt nz, HYPRE_Int P, HYPRE_Int Q, HYPRE_Int R, HYPRE_Int p, HYPRE_Int q, HYPRE_Int r, + HYPRE_Int num_fun, HYPRE_Real *mtrx, HYPRE_Real *value ); /* par_lr_interp.c */ -HYPRE_Int hypre_BoomerAMGBuildStdInterp ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int max_elmts , HYPRE_Int sep_weight , hypre_ParCSRMatrix **P_ptr ); -HYPRE_Int hypre_BoomerAMGBuildExtPIInterp ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int max_elmts , hypre_ParCSRMatrix **P_ptr ); -HYPRE_Int hypre_BoomerAMGBuildExtPIInterpHost ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int max_elmts , hypre_ParCSRMatrix **P_ptr ); -HYPRE_Int hypre_BoomerAMGBuildExtPICCInterp ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int max_elmts , hypre_ParCSRMatrix **P_ptr ); -HYPRE_Int hypre_BoomerAMGBuildFFInterp ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int max_elmts , hypre_ParCSRMatrix **P_ptr ); -HYPRE_Int hypre_BoomerAMGBuildFF1Interp ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int max_elmts , hypre_ParCSRMatrix **P_ptr ); -HYPRE_Int hypre_BoomerAMGBuildExtInterp ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int max_elmts , hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypreDevice_extendWtoP ( HYPRE_Int P_nr_of_rows, HYPRE_Int W_nr_of_rows, + HYPRE_Int W_nr_of_cols, HYPRE_Int *CF_marker, + HYPRE_Int W_diag_nnz, HYPRE_Int *W_diag_i, + HYPRE_Int *W_diag_j, HYPRE_Complex *W_diag_data, + HYPRE_Int *P_diag_i, HYPRE_Int *P_diag_j, + HYPRE_Complex *P_diag_data, HYPRE_Int *W_offd_i, + HYPRE_Int *P_offd_i ); +HYPRE_Int hypre_BoomerAMGBuildStdInterp ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, + HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, HYPRE_Real trunc_factor, + HYPRE_Int max_elmts, HYPRE_Int sep_weight, + hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGBuildExtPIInterp ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, + HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, HYPRE_Real trunc_factor, + HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGBuildExtPIInterpHost ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, + HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, HYPRE_Real trunc_factor, + HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGBuildExtPICCInterp ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, + HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, HYPRE_Real trunc_factor, + HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGBuildFFInterp ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, + HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, HYPRE_Real trunc_factor, + HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGBuildFF1Interp ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, + HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, HYPRE_Real trunc_factor, + HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGBuildExtInterp ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, + HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, HYPRE_Real trunc_factor, + HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); /* par_lr_interp_device.c */ -HYPRE_Int hypre_BoomerAMGBuildExtInterpDevice(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr); -HYPRE_Int hypre_BoomerAMGBuildExtPIInterpDevice( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr); -HYPRE_Int hypre_BoomerAMGBuildExtPEInterpDevice(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr); +HYPRE_Int hypre_BoomerAMGBuildExtInterpDevice(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, + HYPRE_Int *dof_func, HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int max_elmts, + hypre_ParCSRMatrix **P_ptr); +HYPRE_Int hypre_BoomerAMGBuildExtPIInterpDevice( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr); +HYPRE_Int hypre_BoomerAMGBuildExtPEInterpDevice(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, + HYPRE_Int *dof_func, HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int max_elmts, + hypre_ParCSRMatrix **P_ptr); /* par_mod_lr_interp.c */ -HYPRE_Int hypre_BoomerAMGBuildModExtInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr); -HYPRE_Int hypre_BoomerAMGBuildModExtPIInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr); -HYPRE_Int hypre_BoomerAMGBuildModExtPEInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr); +HYPRE_Int hypre_BoomerAMGBuildModExtInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr); +HYPRE_Int hypre_BoomerAMGBuildModExtPIInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr); +HYPRE_Int hypre_BoomerAMGBuildModExtPEInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr); /* par_2s_interp.c */ -HYPRE_Int hypre_BoomerAMGBuildModPartialExtInterpHost ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_BigInt *num_old_cpts_global , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int max_elmts , hypre_ParCSRMatrix **P_ptr ); -HYPRE_Int hypre_BoomerAMGBuildModPartialExtInterpDevice ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_BigInt *num_old_cpts_global , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int max_elmts , hypre_ParCSRMatrix **P_ptr ); -HYPRE_Int hypre_BoomerAMGBuildModPartialExtInterp ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_BigInt *num_old_cpts_global , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int max_elmts , hypre_ParCSRMatrix **P_ptr ); -HYPRE_Int hypre_BoomerAMGBuildModPartialExtPEInterpHost ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_BigInt *num_old_cpts_global , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int max_elmts , hypre_ParCSRMatrix **P_ptr ); -HYPRE_Int hypre_BoomerAMGBuildModPartialExtPEInterpDevice ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_BigInt *num_old_cpts_global , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int max_elmts , hypre_ParCSRMatrix **P_ptr ); -HYPRE_Int hypre_BoomerAMGBuildModPartialExtPEInterp ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_BigInt *num_old_cpts_global , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int max_elmts , hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGBuildModPartialExtInterpHost ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_BigInt *num_old_cpts_global, + HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int debug_flag, HYPRE_Real trunc_factor, + HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGBuildModPartialExtInterpDevice ( hypre_ParCSRMatrix *A, + HYPRE_Int *CF_marker, hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, + HYPRE_BigInt *num_old_cpts_global, HYPRE_Int debug_flag, HYPRE_Real trunc_factor, + HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGBuildModPartialExtInterp ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_BigInt *num_old_cpts_global, + HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int debug_flag, HYPRE_Real trunc_factor, + HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGBuildModPartialExtPEInterpHost ( hypre_ParCSRMatrix *A, + HYPRE_Int *CF_marker, hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, + HYPRE_BigInt *num_old_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGBuildModPartialExtPEInterpDevice ( hypre_ParCSRMatrix *A, + HYPRE_Int *CF_marker, hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, + HYPRE_BigInt *num_old_cpts_global, HYPRE_Int debug_flag, HYPRE_Real trunc_factor, + HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGBuildModPartialExtPEInterp ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_BigInt *num_old_cpts_global, + HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int debug_flag, HYPRE_Real trunc_factor, + HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); + +/* par_mod_multi_interp.c */ +HYPRE_Int hypre_BoomerAMGBuildModMultipass ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Real trunc_factor, + HYPRE_Int P_max_elmts, HYPRE_Int interp_type, HYPRE_Int num_functions, HYPRE_Int *dof_func, + hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGBuildModMultipassHost ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Real trunc_factor, + HYPRE_Int P_max_elmts, HYPRE_Int interp_type, HYPRE_Int num_functions, HYPRE_Int *dof_func, + hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_GenerateMultipassPi ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *S, + HYPRE_BigInt *c_pts_starts, HYPRE_Int *pass_order, HYPRE_Int *pass_marker, + HYPRE_Int *pass_marker_offd, HYPRE_Int num_points, HYPRE_Int color, HYPRE_Real *row_sums, + hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_GenerateMultiPi ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *S, + hypre_ParCSRMatrix *P, HYPRE_BigInt *c_pts_starts, HYPRE_Int *pass_order, HYPRE_Int *pass_marker, + HYPRE_Int *pass_marker_offd, HYPRE_Int num_points, HYPRE_Int color, HYPRE_Int num_functions, + HYPRE_Int *dof_func, HYPRE_Int *dof_func_offd, hypre_ParCSRMatrix **Pi_ptr ); +HYPRE_Int hypre_BoomerAMGBuildModMultipassDevice ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Real trunc_factor, + HYPRE_Int P_max_elmts, HYPRE_Int interp_type, HYPRE_Int num_functions, HYPRE_Int *dof_func, + hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_GenerateMultipassPiDevice ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *S, + HYPRE_BigInt *c_pts_starts, HYPRE_Int *pass_order, HYPRE_Int *pass_marker, + HYPRE_Int *pass_marker_offd, HYPRE_Int num_points, HYPRE_Int color, HYPRE_Real *row_sums, + hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_GenerateMultiPiDevice ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *S, + hypre_ParCSRMatrix *P, HYPRE_BigInt *c_pts_starts, HYPRE_Int *pass_order, HYPRE_Int *pass_marker, + HYPRE_Int *pass_marker_offd, HYPRE_Int num_points, HYPRE_Int color, HYPRE_Int num_functions, + HYPRE_Int *dof_func, HYPRE_Int *dof_func_offd, hypre_ParCSRMatrix **Pi_ptr ); /* par_multi_interp.c */ -HYPRE_Int hypre_BoomerAMGBuildMultipass ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int P_max_elmts , HYPRE_Int weight_option , hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGBuildMultipass ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int P_max_elmts, HYPRE_Int weight_option, + hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGBuildMultipassHost ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int P_max_elmts, HYPRE_Int weight_option, + hypre_ParCSRMatrix **P_ptr ); /* par_nodal_systems.c */ -HYPRE_Int hypre_BoomerAMGCreateNodalA ( hypre_ParCSRMatrix *A , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int option , HYPRE_Int diag_option , hypre_ParCSRMatrix **AN_ptr ); -HYPRE_Int hypre_BoomerAMGCreateScalarCFS ( hypre_ParCSRMatrix *SN , hypre_ParCSRMatrix *A , HYPRE_Int *CFN_marker , HYPRE_Int num_functions , HYPRE_Int nodal , HYPRE_Int keep_same_sign , hypre_IntArray **dof_func_ptr , hypre_IntArray **CF_marker_ptr , hypre_ParCSRMatrix **S_ptr ); -HYPRE_Int hypre_BoomerAMGCreateScalarCF ( HYPRE_Int *CFN_marker , HYPRE_Int num_functions , HYPRE_Int num_nodes , hypre_IntArray **dof_func_ptr , hypre_IntArray **CF_marker_ptr ); +HYPRE_Int hypre_BoomerAMGCreateNodalA ( hypre_ParCSRMatrix *A, HYPRE_Int num_functions, + HYPRE_Int *dof_func, HYPRE_Int option, HYPRE_Int diag_option, hypre_ParCSRMatrix **AN_ptr ); +HYPRE_Int hypre_BoomerAMGCreateScalarCFS ( hypre_ParCSRMatrix *SN, hypre_ParCSRMatrix *A, + HYPRE_Int *CFN_marker, HYPRE_Int num_functions, HYPRE_Int nodal, HYPRE_Int keep_same_sign, + hypre_IntArray **dof_func_ptr, hypre_IntArray **CF_marker_ptr, hypre_ParCSRMatrix **S_ptr ); +HYPRE_Int hypre_BoomerAMGCreateScalarCF ( HYPRE_Int *CFN_marker, HYPRE_Int num_functions, + HYPRE_Int num_nodes, hypre_IntArray **dof_func_ptr, hypre_IntArray **CF_marker_ptr ); /* par_nongalerkin.c */ -HYPRE_Int hypre_GrabSubArray ( HYPRE_Int *indices , HYPRE_Int start , HYPRE_Int end , HYPRE_BigInt *array , HYPRE_BigInt *output ); -HYPRE_Int hypre_IntersectTwoArrays ( HYPRE_Int *x , HYPRE_Real *x_data , HYPRE_Int x_length , HYPRE_Int *y , HYPRE_Int y_length , HYPRE_Int *z , HYPRE_Real *output_x_data , HYPRE_Int *intersect_length ); -HYPRE_Int hypre_IntersectTwoBigArrays ( HYPRE_BigInt *x , HYPRE_Real *x_data , HYPRE_Int x_length , HYPRE_BigInt *y , HYPRE_Int y_length , HYPRE_BigInt *z , HYPRE_Real *output_x_data , HYPRE_Int *intersect_length ); -HYPRE_Int hypre_SortedCopyParCSRData ( hypre_ParCSRMatrix *A , hypre_ParCSRMatrix *B ); -HYPRE_Int hypre_BoomerAMG_MyCreateS ( hypre_ParCSRMatrix *A , HYPRE_Real strength_threshold , HYPRE_Real max_row_sum , HYPRE_Int num_functions , HYPRE_Int *dof_func , hypre_ParCSRMatrix **S_ptr ); -HYPRE_Int hypre_BoomerAMGCreateSFromCFMarker(hypre_ParCSRMatrix *A, HYPRE_Real strength_threshold, HYPRE_Real max_row_sum, HYPRE_Int *CF_marker, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int SMRK, hypre_ParCSRMatrix **S_ptr); -HYPRE_Int hypre_NonGalerkinIJBufferInit ( HYPRE_Int *ijbuf_cnt , HYPRE_Int *ijbuf_rowcounter , HYPRE_Int *ijbuf_numcols ); -HYPRE_Int hypre_NonGalerkinIJBigBufferInit ( HYPRE_Int *ijbuf_cnt , HYPRE_Int *ijbuf_rowcounter , HYPRE_BigInt *ijbuf_numcols ); -HYPRE_Int hypre_NonGalerkinIJBufferNewRow ( HYPRE_BigInt *ijbuf_rownums , HYPRE_Int *ijbuf_numcols , HYPRE_Int *ijbuf_rowcounter , HYPRE_BigInt new_row ); -HYPRE_Int hypre_NonGalerkinIJBufferCompressRow ( HYPRE_Int *ijbuf_cnt , HYPRE_Int ijbuf_rowcounter , HYPRE_Real *ijbuf_data , HYPRE_BigInt *ijbuf_cols , HYPRE_BigInt *ijbuf_rownums , HYPRE_Int *ijbuf_numcols ); -HYPRE_Int hypre_NonGalerkinIJBufferCompress ( HYPRE_Int ijbuf_size , HYPRE_Int *ijbuf_cnt , HYPRE_Int *ijbuf_rowcounter , HYPRE_Real **ijbuf_data , HYPRE_BigInt **ijbuf_cols , HYPRE_BigInt **ijbuf_rownums , HYPRE_Int **ijbuf_numcols ); -HYPRE_Int hypre_NonGalerkinIJBufferWrite ( HYPRE_IJMatrix B , HYPRE_Int *ijbuf_cnt , HYPRE_Int ijbuf_size , HYPRE_Int *ijbuf_rowcounter , HYPRE_Real **ijbuf_data , HYPRE_BigInt **ijbuf_cols , HYPRE_BigInt **ijbuf_rownums , HYPRE_Int **ijbuf_numcols , HYPRE_BigInt row_to_write , HYPRE_BigInt col_to_write , HYPRE_Real val_to_write ); -HYPRE_Int hypre_NonGalerkinIJBufferEmpty ( HYPRE_IJMatrix B , HYPRE_Int ijbuf_size , HYPRE_Int *ijbuf_cnt , HYPRE_Int ijbuf_rowcounter , HYPRE_Real **ijbuf_data , HYPRE_BigInt **ijbuf_cols , HYPRE_BigInt **ijbuf_rownums , HYPRE_Int **ijbuf_numcols ); -hypre_ParCSRMatrix * hypre_NonGalerkinSparsityPattern(hypre_ParCSRMatrix *R_IAP, hypre_ParCSRMatrix *RAP, HYPRE_Int * CF_marker, HYPRE_Real droptol, HYPRE_Int sym_collapse, HYPRE_Int collapse_beta ); -HYPRE_Int hypre_BoomerAMGBuildNonGalerkinCoarseOperator( hypre_ParCSRMatrix **RAP_ptr, hypre_ParCSRMatrix *AP, HYPRE_Real strong_threshold, HYPRE_Real max_row_sum, HYPRE_Int num_functions, HYPRE_Int * dof_func_value, HYPRE_Int * CF_marker, HYPRE_Real droptol, HYPRE_Int sym_collapse, HYPRE_Real lump_percent, HYPRE_Int collapse_beta ); +HYPRE_Int hypre_GrabSubArray ( HYPRE_Int *indices, HYPRE_Int start, HYPRE_Int end, + HYPRE_BigInt *array, HYPRE_BigInt *output ); +HYPRE_Int hypre_IntersectTwoArrays ( HYPRE_Int *x, HYPRE_Real *x_data, HYPRE_Int x_length, + HYPRE_Int *y, HYPRE_Int y_length, HYPRE_Int *z, HYPRE_Real *output_x_data, + HYPRE_Int *intersect_length ); +HYPRE_Int hypre_IntersectTwoBigArrays ( HYPRE_BigInt *x, HYPRE_Real *x_data, HYPRE_Int x_length, + HYPRE_BigInt *y, HYPRE_Int y_length, HYPRE_BigInt *z, HYPRE_Real *output_x_data, + HYPRE_Int *intersect_length ); +HYPRE_Int hypre_SortedCopyParCSRData ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B ); +HYPRE_Int hypre_BoomerAMG_MyCreateS ( hypre_ParCSRMatrix *A, HYPRE_Real strength_threshold, + HYPRE_Real max_row_sum, HYPRE_Int num_functions, HYPRE_Int *dof_func, hypre_ParCSRMatrix **S_ptr ); +HYPRE_Int hypre_BoomerAMGCreateSFromCFMarker(hypre_ParCSRMatrix *A, + HYPRE_Real strength_threshold, HYPRE_Real max_row_sum, HYPRE_Int *CF_marker, + HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int SMRK, hypre_ParCSRMatrix **S_ptr); +HYPRE_Int hypre_NonGalerkinIJBufferInit ( HYPRE_Int *ijbuf_cnt, HYPRE_Int *ijbuf_rowcounter, + HYPRE_Int *ijbuf_numcols ); +HYPRE_Int hypre_NonGalerkinIJBigBufferInit ( HYPRE_Int *ijbuf_cnt, HYPRE_Int *ijbuf_rowcounter, + HYPRE_BigInt *ijbuf_numcols ); +HYPRE_Int hypre_NonGalerkinIJBufferNewRow ( HYPRE_BigInt *ijbuf_rownums, HYPRE_Int *ijbuf_numcols, + HYPRE_Int *ijbuf_rowcounter, HYPRE_BigInt new_row ); +HYPRE_Int hypre_NonGalerkinIJBufferCompressRow ( HYPRE_Int *ijbuf_cnt, HYPRE_Int ijbuf_rowcounter, + HYPRE_Real *ijbuf_data, HYPRE_BigInt *ijbuf_cols, HYPRE_BigInt *ijbuf_rownums, + HYPRE_Int *ijbuf_numcols ); +HYPRE_Int hypre_NonGalerkinIJBufferCompress ( HYPRE_MemoryLocation memory_location, + HYPRE_Int ijbuf_size, HYPRE_Int *ijbuf_cnt, + HYPRE_Int *ijbuf_rowcounter, HYPRE_Real **ijbuf_data, HYPRE_BigInt **ijbuf_cols, + HYPRE_BigInt **ijbuf_rownums, HYPRE_Int **ijbuf_numcols ); +HYPRE_Int hypre_NonGalerkinIJBufferWrite ( HYPRE_IJMatrix B, HYPRE_Int *ijbuf_cnt, + HYPRE_Int ijbuf_size, HYPRE_Int *ijbuf_rowcounter, HYPRE_Real **ijbuf_data, + HYPRE_BigInt **ijbuf_cols, HYPRE_BigInt **ijbuf_rownums, HYPRE_Int **ijbuf_numcols, + HYPRE_BigInt row_to_write, HYPRE_BigInt col_to_write, HYPRE_Real val_to_write ); +HYPRE_Int hypre_NonGalerkinIJBufferEmpty ( HYPRE_IJMatrix B, HYPRE_Int ijbuf_size, + HYPRE_Int *ijbuf_cnt, HYPRE_Int ijbuf_rowcounter, HYPRE_Real **ijbuf_data, + HYPRE_BigInt **ijbuf_cols, HYPRE_BigInt **ijbuf_rownums, HYPRE_Int **ijbuf_numcols ); +hypre_ParCSRMatrix * hypre_NonGalerkinSparsityPattern(hypre_ParCSRMatrix *R_IAP, + hypre_ParCSRMatrix *RAP, HYPRE_Int * CF_marker, HYPRE_Real droptol, HYPRE_Int sym_collapse, + HYPRE_Int collapse_beta ); +HYPRE_Int hypre_BoomerAMGBuildNonGalerkinCoarseOperator( hypre_ParCSRMatrix **RAP_ptr, + hypre_ParCSRMatrix *AP, HYPRE_Real strong_threshold, HYPRE_Real max_row_sum, + HYPRE_Int num_functions, HYPRE_Int * dof_func_value, HYPRE_Int * CF_marker, HYPRE_Real droptol, + HYPRE_Int sym_collapse, HYPRE_Real lump_percent, HYPRE_Int collapse_beta ); /* par_rap.c */ -HYPRE_Int hypre_BoomerAMGBuildCoarseOperator ( hypre_ParCSRMatrix *RT , hypre_ParCSRMatrix *A , hypre_ParCSRMatrix *P , hypre_ParCSRMatrix **RAP_ptr ); -HYPRE_Int hypre_BoomerAMGBuildCoarseOperatorKT ( hypre_ParCSRMatrix *RT , hypre_ParCSRMatrix *A , hypre_ParCSRMatrix *P , HYPRE_Int keepTranspose, hypre_ParCSRMatrix **RAP_ptr ); +HYPRE_Int hypre_BoomerAMGBuildCoarseOperator ( hypre_ParCSRMatrix *RT, hypre_ParCSRMatrix *A, + hypre_ParCSRMatrix *P, hypre_ParCSRMatrix **RAP_ptr ); +HYPRE_Int hypre_BoomerAMGBuildCoarseOperatorKT ( hypre_ParCSRMatrix *RT, hypre_ParCSRMatrix *A, + hypre_ParCSRMatrix *P, HYPRE_Int keepTranspose, hypre_ParCSRMatrix **RAP_ptr ); /* par_rap_communication.c */ -HYPRE_Int hypre_GetCommPkgRTFromCommPkgA ( hypre_ParCSRMatrix *RT , hypre_ParCSRMatrix *A , HYPRE_Int *fine_to_coarse, HYPRE_Int *tmp_map_offd ); -HYPRE_Int hypre_GenerateSendMapAndCommPkg ( MPI_Comm comm , HYPRE_Int num_sends , HYPRE_Int num_recvs , HYPRE_Int *recv_procs , HYPRE_Int *send_procs , HYPRE_Int *recv_vec_starts , hypre_ParCSRMatrix *A ); +HYPRE_Int hypre_GetCommPkgRTFromCommPkgA ( hypre_ParCSRMatrix *RT, hypre_ParCSRMatrix *A, + HYPRE_Int *fine_to_coarse, HYPRE_Int *tmp_map_offd ); +HYPRE_Int hypre_GenerateSendMapAndCommPkg ( MPI_Comm comm, HYPRE_Int num_sends, HYPRE_Int num_recvs, + HYPRE_Int *recv_procs, HYPRE_Int *send_procs, HYPRE_Int *recv_vec_starts, hypre_ParCSRMatrix *A ); + +/* par_ge_device.c */ +HYPRE_Int hypre_GaussElimSetupDevice ( hypre_ParAMGData *amg_data, HYPRE_Int level, + HYPRE_Int solver_type ); +HYPRE_Int hypre_GaussElimSolveDevice ( hypre_ParAMGData *amg_data, HYPRE_Int level, + HYPRE_Int solver_type ); + +/* par_gauss_elim.c */ +HYPRE_Int hypre_GaussElimSetup ( hypre_ParAMGData *amg_data, HYPRE_Int level, + HYPRE_Int solver_type ); +HYPRE_Int hypre_GaussElimSolve ( hypre_ParAMGData *amg_data, HYPRE_Int level, + HYPRE_Int solver_type ); /* par_relax.c */ -HYPRE_Int hypre_BoomerAMGRelax ( hypre_ParCSRMatrix *A , hypre_ParVector *f , HYPRE_Int *cf_marker , HYPRE_Int relax_type , HYPRE_Int relax_points , HYPRE_Real relax_weight , HYPRE_Real omega , HYPRE_Real *l1_norms , hypre_ParVector *u , hypre_ParVector *Vtemp , hypre_ParVector *Ztemp ); -HYPRE_Int hypre_GaussElimSetup ( hypre_ParAMGData *amg_data , HYPRE_Int level , HYPRE_Int relax_type ); -HYPRE_Int hypre_GaussElimSolve ( hypre_ParAMGData *amg_data , HYPRE_Int level , HYPRE_Int relax_type ); -HYPRE_Int hypre_BoomerAMGRelaxHybridGaussSeidel_core( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, HYPRE_Real *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp, HYPRE_Int GS_order, HYPRE_Int Symm, HYPRE_Int Skip_diag, HYPRE_Int forced_seq, HYPRE_Int Topo_order ); -HYPRE_Int hypre_BoomerAMGRelax0WeightedJacobi( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, hypre_ParVector *u, hypre_ParVector *Vtemp ); - -HYPRE_Int hypre_BoomerAMGRelax1GaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_ParVector *u ); - -HYPRE_Int hypre_BoomerAMGRelax2GaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_ParVector *u ); - -HYPRE_Int hypre_BoomerAMGRelax5ChaoticHybridGaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_ParVector *u ); - -HYPRE_Int hypre_BoomerAMGRelax3HybridGaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); - -HYPRE_Int hypre_BoomerAMGRelax4HybridGaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); - -HYPRE_Int hypre_BoomerAMGRelax6HybridSSOR( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); - -HYPRE_Int hypre_BoomerAMGRelax7Jacobi( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp ); - -HYPRE_Int hypre_BoomerAMGRelax8HybridL1SSOR( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, HYPRE_Real *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); - -HYPRE_Int hypre_BoomerAMGRelax10TopoOrderedGaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); - -HYPRE_Int hypre_BoomerAMGRelax13HybridL1GaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, HYPRE_Real *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); - -HYPRE_Int hypre_BoomerAMGRelax14HybridL1GaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, HYPRE_Real *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); - -HYPRE_Int hypre_BoomerAMGRelax18WeightedL1Jacobi( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp ); - -HYPRE_Int hypre_BoomerAMGRelax19GaussElim( hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); - -HYPRE_Int hypre_BoomerAMGRelax98GaussElimPivot( hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); - -HYPRE_Int hypre_BoomerAMGRelaxKaczmarz( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Real omega, HYPRE_Real *l1_norms, hypre_ParVector *u ); - -HYPRE_Int hypre_BoomerAMGRelaxTwoStageGaussSeidelDevice ( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Real relax_weight, HYPRE_Real omega, hypre_ParVector *u, hypre_ParVector *r, hypre_ParVector *z, HYPRE_Int choice); - -HYPRE_Int hypre_BoomerAMGRelaxTwoStageGaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp, HYPRE_Int num_inner_iters ); - -HYPRE_Int hypre_BoomerAMGRelax11TwoStageGaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); - -HYPRE_Int hypre_BoomerAMGRelax12TwoStageGaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); - -/* par_realx_device.c */ -HYPRE_Int hypre_BoomerAMGRelaxHybridGaussSeidelDevice( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, HYPRE_Real *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp, HYPRE_Int GS_order, HYPRE_Int Symm ); +HYPRE_Int hypre_BoomerAMGRelax ( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, + HYPRE_Int relax_type, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, + HYPRE_Real *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); +HYPRE_Int hypre_BoomerAMGRelaxHybridGaussSeidel_core( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, + HYPRE_Real *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp, + HYPRE_Int GS_order, HYPRE_Int Symm, HYPRE_Int Skip_diag, HYPRE_Int forced_seq, + HYPRE_Int Topo_order ); +HYPRE_Int hypre_BoomerAMGRelax0WeightedJacobi( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, hypre_ParVector *u, + hypre_ParVector *Vtemp ); + +HYPRE_Int hypre_BoomerAMGRelaxHybridSOR( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, + HYPRE_Real *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp, + HYPRE_Int direction, HYPRE_Int symm, HYPRE_Int skip_diag, HYPRE_Int force_seq ); + +HYPRE_Int hypre_BoomerAMGRelax1GaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_ParVector *u ); + +HYPRE_Int hypre_BoomerAMGRelax2GaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_ParVector *u ); + +HYPRE_Int hypre_BoomerAMGRelax5ChaoticHybridGaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_ParVector *u ); + +HYPRE_Int hypre_BoomerAMGRelax3HybridGaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, + hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); + +HYPRE_Int hypre_BoomerAMGRelax4HybridGaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, + hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); + +HYPRE_Int hypre_BoomerAMGRelax6HybridSSOR( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, + hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); + +HYPRE_Int hypre_BoomerAMGRelax7Jacobi( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real *l1_norms, + hypre_ParVector *u, hypre_ParVector *Vtemp ); + +HYPRE_Int hypre_BoomerAMGRelax8HybridL1SSOR( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, + HYPRE_Real *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); + +HYPRE_Int hypre_BoomerAMGRelax10TopoOrderedGaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, + hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); + +HYPRE_Int hypre_BoomerAMGRelax13HybridL1GaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, + HYPRE_Real *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); + +HYPRE_Int hypre_BoomerAMGRelax14HybridL1GaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, + HYPRE_Real *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); + +HYPRE_Int hypre_BoomerAMGRelax88HybridL1SSOR( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, + HYPRE_Real *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); + +HYPRE_Int hypre_BoomerAMGRelax89HybridL1SSOR( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, + HYPRE_Real *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); + +HYPRE_Int hypre_BoomerAMGRelax18WeightedL1Jacobi( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real *l1_norms, + hypre_ParVector *u, hypre_ParVector *Vtemp ); + +HYPRE_Int hypre_BoomerAMGRelaxKaczmarz( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Real omega, + HYPRE_Real *l1_norms, hypre_ParVector *u ); + +HYPRE_Int hypre_BoomerAMGRelaxTwoStageGaussSeidelDevice ( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Real relax_weight, HYPRE_Real omega, + HYPRE_Real *A_diag_diag, hypre_ParVector *u, + hypre_ParVector *r, hypre_ParVector *z, + HYPRE_Int choice ); + +HYPRE_Int hypre_BoomerAMGRelax11TwoStageGaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *cf_marker, HYPRE_Int relax_points, + HYPRE_Real relax_weight, HYPRE_Real omega, + HYPRE_Real *A_diag_diag, hypre_ParVector *u, + hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); + +HYPRE_Int hypre_BoomerAMGRelax12TwoStageGaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *cf_marker, HYPRE_Int relax_points, + HYPRE_Real relax_weight, HYPRE_Real omega, + HYPRE_Real *A_diag_diag, hypre_ParVector *u, + hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); + +HYPRE_Int hypre_BoomerAMGRelaxComputeL1Norms( hypre_ParCSRMatrix *A, HYPRE_Int relax_type, + HYPRE_Int relax_order, HYPRE_Int coarsest_lvl, + hypre_IntArray *CF_marker, + HYPRE_Real **l1_norms_data_ptr ); + +/* par_relax_device.c */ +HYPRE_Int hypre_BoomerAMGRelaxHybridGaussSeidelDevice( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *cf_marker, HYPRE_Int relax_points, + HYPRE_Real relax_weight, HYPRE_Real omega, + HYPRE_Real *l1_norms, hypre_ParVector *u, + hypre_ParVector *Vtemp, hypre_ParVector *Ztemp, + HYPRE_Int GS_order, HYPRE_Int Symm ); /* par_relax_interface.c */ -HYPRE_Int hypre_BoomerAMGRelaxIF ( hypre_ParCSRMatrix *A , hypre_ParVector *f , HYPRE_Int *cf_marker , HYPRE_Int relax_type , HYPRE_Int relax_order , HYPRE_Int cycle_type , HYPRE_Real relax_weight , HYPRE_Real omega , HYPRE_Real *l1_norms , hypre_ParVector *u , hypre_ParVector *Vtemp , hypre_ParVector *Ztemp ); +HYPRE_Int hypre_BoomerAMGRelaxIF ( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, + HYPRE_Int relax_type, HYPRE_Int relax_order, HYPRE_Int cycle_type, HYPRE_Real relax_weight, + HYPRE_Real omega, HYPRE_Real *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, + hypre_ParVector *Ztemp ); /* par_relax_more.c */ -HYPRE_Int hypre_ParCSRMaxEigEstimate ( hypre_ParCSRMatrix *A , HYPRE_Int scale , HYPRE_Real *max_eig, HYPRE_Real *min_eig ); -HYPRE_Int hypre_ParCSRMaxEigEstimateHost ( hypre_ParCSRMatrix *A , HYPRE_Int scale , HYPRE_Real *max_eig, HYPRE_Real *min_eig ); -HYPRE_Int hypre_ParCSRMaxEigEstimateCG ( hypre_ParCSRMatrix *A , HYPRE_Int scale , HYPRE_Int max_iter , HYPRE_Real *max_eig , HYPRE_Real *min_eig ); -HYPRE_Int hypre_ParCSRMaxEigEstimateCGHost ( hypre_ParCSRMatrix *A , HYPRE_Int scale , HYPRE_Int max_iter , HYPRE_Real *max_eig , HYPRE_Real *min_eig ); -HYPRE_Int hypre_ParCSRRelax_Cheby ( hypre_ParCSRMatrix *A , hypre_ParVector *f , HYPRE_Real max_eig , HYPRE_Real min_eig , HYPRE_Real fraction , HYPRE_Int order , HYPRE_Int scale , HYPRE_Int variant , hypre_ParVector *u , hypre_ParVector *v , hypre_ParVector *r ); -HYPRE_Int hypre_BoomerAMGRelax_FCFJacobi ( hypre_ParCSRMatrix *A , hypre_ParVector *f , HYPRE_Int *cf_marker , HYPRE_Real relax_weight , hypre_ParVector *u , hypre_ParVector *Vtemp ); -HYPRE_Int hypre_ParCSRRelax_CG ( HYPRE_Solver solver , hypre_ParCSRMatrix *A , hypre_ParVector *f , hypre_ParVector *u , HYPRE_Int num_its ); -HYPRE_Int hypre_LINPACKcgtql1 ( HYPRE_Int *n , HYPRE_Real *d , HYPRE_Real *e , HYPRE_Int *ierr ); -HYPRE_Real hypre_LINPACKcgpthy ( HYPRE_Real *a , HYPRE_Real *b ); -HYPRE_Int hypre_ParCSRRelax_L1_Jacobi ( hypre_ParCSRMatrix *A , hypre_ParVector *f , HYPRE_Int *cf_marker , HYPRE_Int relax_points , HYPRE_Real relax_weight , HYPRE_Real *l1_norms , hypre_ParVector *u , hypre_ParVector *Vtemp ); -HYPRE_Int hypre_LINPACKcgtql1(HYPRE_Int*,HYPRE_Real *,HYPRE_Real *,HYPRE_Int *); +HYPRE_Int hypre_ParCSRMaxEigEstimate ( hypre_ParCSRMatrix *A, HYPRE_Int scale, HYPRE_Real *max_eig, + HYPRE_Real *min_eig ); +HYPRE_Int hypre_ParCSRMaxEigEstimateHost ( hypre_ParCSRMatrix *A, HYPRE_Int scale, + HYPRE_Real *max_eig, HYPRE_Real *min_eig ); +HYPRE_Int hypre_ParCSRMaxEigEstimateCG ( hypre_ParCSRMatrix *A, HYPRE_Int scale, HYPRE_Int max_iter, + HYPRE_Real *max_eig, HYPRE_Real *min_eig ); +HYPRE_Int hypre_ParCSRMaxEigEstimateCGHost ( hypre_ParCSRMatrix *A, HYPRE_Int scale, + HYPRE_Int max_iter, HYPRE_Real *max_eig, HYPRE_Real *min_eig ); +HYPRE_Int hypre_ParCSRRelax_Cheby ( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Real max_eig, + HYPRE_Real min_eig, HYPRE_Real fraction, HYPRE_Int order, HYPRE_Int scale, HYPRE_Int variant, + hypre_ParVector *u, hypre_ParVector *v, hypre_ParVector *r ); +HYPRE_Int hypre_BoomerAMGRelax_FCFJacobi ( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *cf_marker, HYPRE_Real relax_weight, + hypre_ParVector *u, hypre_ParVector *Vtemp ); +HYPRE_Int hypre_ParCSRRelax_CG ( HYPRE_Solver solver, hypre_ParCSRMatrix *A, hypre_ParVector *f, + hypre_ParVector *u, HYPRE_Int num_its ); +HYPRE_Int hypre_LINPACKcgtql1 ( HYPRE_Int *n, HYPRE_Real *d, HYPRE_Real *e, HYPRE_Int *ierr ); +HYPRE_Real hypre_LINPACKcgpthy ( HYPRE_Real *a, HYPRE_Real *b ); +HYPRE_Int hypre_ParCSRRelax_L1_Jacobi ( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real *l1_norms, + hypre_ParVector *u, hypre_ParVector *Vtemp ); +HYPRE_Int hypre_LINPACKcgtql1(HYPRE_Int*, HYPRE_Real *, HYPRE_Real *, HYPRE_Int *); HYPRE_Real hypre_LINPACKcgpthy(HYPRE_Real*, HYPRE_Real*); /* par_relax_more_device.c */ -HYPRE_Int hypre_ParCSRMaxEigEstimateDevice ( hypre_ParCSRMatrix *A , HYPRE_Int scale , HYPRE_Real *max_eig , HYPRE_Real *min_eig ); -HYPRE_Int hypre_ParCSRMaxEigEstimateCGDevice ( hypre_ParCSRMatrix *A , HYPRE_Int scale , HYPRE_Int max_iter , HYPRE_Real *max_eig , HYPRE_Real *min_eig ); +HYPRE_Int hypre_ParCSRMaxEigEstimateDevice ( hypre_ParCSRMatrix *A, HYPRE_Int scale, + HYPRE_Real *max_eig, HYPRE_Real *min_eig ); +HYPRE_Int hypre_ParCSRMaxEigEstimateCGDevice ( hypre_ParCSRMatrix *A, HYPRE_Int scale, + HYPRE_Int max_iter, HYPRE_Real *max_eig, HYPRE_Real *min_eig ); /* par_rotate_7pt.c */ -HYPRE_ParCSRMatrix GenerateRotate7pt ( MPI_Comm comm , HYPRE_BigInt nx , HYPRE_BigInt ny , HYPRE_Int P , HYPRE_Int Q , HYPRE_Int p , HYPRE_Int q , HYPRE_Real alpha , HYPRE_Real eps ); +HYPRE_ParCSRMatrix GenerateRotate7pt ( MPI_Comm comm, HYPRE_BigInt nx, HYPRE_BigInt ny, HYPRE_Int P, + HYPRE_Int Q, HYPRE_Int p, HYPRE_Int q, HYPRE_Real alpha, HYPRE_Real eps ); /* par_scaled_matnorm.c */ -HYPRE_Int hypre_ParCSRMatrixScaledNorm ( hypre_ParCSRMatrix *A , HYPRE_Real *scnorm ); +HYPRE_Int hypre_ParCSRMatrixScaledNorm ( hypre_ParCSRMatrix *A, HYPRE_Real *scnorm ); /* par_schwarz.c */ void *hypre_SchwarzCreate ( void ); HYPRE_Int hypre_SchwarzDestroy ( void *data ); -HYPRE_Int hypre_SchwarzSetup ( void *schwarz_vdata , hypre_ParCSRMatrix *A , hypre_ParVector *f , hypre_ParVector *u ); -HYPRE_Int hypre_SchwarzSolve ( void *schwarz_vdata , hypre_ParCSRMatrix *A , hypre_ParVector *f , hypre_ParVector *u ); -HYPRE_Int hypre_SchwarzCFSolve ( void *schwarz_vdata , hypre_ParCSRMatrix *A , hypre_ParVector *f , hypre_ParVector *u , HYPRE_Int *CF_marker , HYPRE_Int rlx_pt ); -HYPRE_Int hypre_SchwarzSetVariant ( void *data , HYPRE_Int variant ); -HYPRE_Int hypre_SchwarzSetDomainType ( void *data , HYPRE_Int domain_type ); -HYPRE_Int hypre_SchwarzSetOverlap ( void *data , HYPRE_Int overlap ); -HYPRE_Int hypre_SchwarzSetNumFunctions ( void *data , HYPRE_Int num_functions ); -HYPRE_Int hypre_SchwarzSetNonSymm ( void *data , HYPRE_Int value ); -HYPRE_Int hypre_SchwarzSetRelaxWeight ( void *data , HYPRE_Real relax_weight ); -HYPRE_Int hypre_SchwarzSetDomainStructure ( void *data , hypre_CSRMatrix *domain_structure ); -HYPRE_Int hypre_SchwarzSetScale ( void *data , HYPRE_Real *scale ); -HYPRE_Int hypre_SchwarzReScale ( void *data , HYPRE_Int size , HYPRE_Real value ); -HYPRE_Int hypre_SchwarzSetDofFunc ( void *data , HYPRE_Int *dof_func ); +HYPRE_Int hypre_SchwarzSetup ( void *schwarz_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, + hypre_ParVector *u ); +HYPRE_Int hypre_SchwarzSolve ( void *schwarz_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, + hypre_ParVector *u ); +HYPRE_Int hypre_SchwarzCFSolve ( void *schwarz_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, + hypre_ParVector *u, HYPRE_Int *CF_marker, HYPRE_Int rlx_pt ); +HYPRE_Int hypre_SchwarzSetVariant ( void *data, HYPRE_Int variant ); +HYPRE_Int hypre_SchwarzSetDomainType ( void *data, HYPRE_Int domain_type ); +HYPRE_Int hypre_SchwarzSetOverlap ( void *data, HYPRE_Int overlap ); +HYPRE_Int hypre_SchwarzSetNumFunctions ( void *data, HYPRE_Int num_functions ); +HYPRE_Int hypre_SchwarzSetNonSymm ( void *data, HYPRE_Int value ); +HYPRE_Int hypre_SchwarzSetRelaxWeight ( void *data, HYPRE_Real relax_weight ); +HYPRE_Int hypre_SchwarzSetDomainStructure ( void *data, hypre_CSRMatrix *domain_structure ); +HYPRE_Int hypre_SchwarzSetScale ( void *data, HYPRE_Real *scale ); +HYPRE_Int hypre_SchwarzReScale ( void *data, HYPRE_Int size, HYPRE_Real value ); +HYPRE_Int hypre_SchwarzSetDofFunc ( void *data, HYPRE_Int *dof_func ); /* par_stats.c */ -HYPRE_Int hypre_BoomerAMGSetupStats ( void *amg_vdata , hypre_ParCSRMatrix *A ); +HYPRE_Int hypre_BoomerAMGSetupStats ( void *amg_vdata, hypre_ParCSRMatrix *A ); HYPRE_Int hypre_BoomerAMGWriteSolverParams ( void *data ); +const char* hypre_BoomerAMGGetProlongationName( hypre_ParAMGData *amg_data ); +const char* hypre_BoomerAMGGetAggProlongationName( hypre_ParAMGData *amg_data ); +const char* hypre_BoomerAMGGetCoarseningName( hypre_ParAMGData *amg_data ); +const char* hypre_BoomerAMGGetCycleName( hypre_ParAMGData *amg_data ); +HYPRE_Int hypre_BoomerAMGPrintGeneralInfo( hypre_ParAMGData *amg_data, HYPRE_Int shift ); /* par_strength.c */ -HYPRE_Int hypre_BoomerAMGCreateS ( hypre_ParCSRMatrix *A , HYPRE_Real strength_threshold , HYPRE_Real max_row_sum , HYPRE_Int num_functions , HYPRE_Int *dof_func , hypre_ParCSRMatrix **S_ptr ); -HYPRE_Int hypre_BoomerAMGCreateSabs ( hypre_ParCSRMatrix *A , HYPRE_Real strength_threshold , HYPRE_Real max_row_sum , HYPRE_Int num_functions , HYPRE_Int *dof_func , hypre_ParCSRMatrix **S_ptr ); -HYPRE_Int hypre_BoomerAMGCreateSCommPkg ( hypre_ParCSRMatrix *A , hypre_ParCSRMatrix *S , HYPRE_Int **col_offd_S_to_A_ptr ); -HYPRE_Int hypre_BoomerAMGCreate2ndS ( hypre_ParCSRMatrix *S , HYPRE_Int *CF_marker , HYPRE_Int num_paths , HYPRE_BigInt *coarse_row_starts , hypre_ParCSRMatrix **C_ptr ); -HYPRE_Int hypre_BoomerAMGCorrectCFMarker ( hypre_IntArray *CF_marker , hypre_IntArray *new_CF_marker ); -HYPRE_Int hypre_BoomerAMGCorrectCFMarkerHost ( hypre_IntArray *CF_marker , hypre_IntArray *new_CF_marker ); -HYPRE_Int hypre_BoomerAMGCorrectCFMarkerDevice ( hypre_IntArray *CF_marker , hypre_IntArray *new_CF_marker ); -HYPRE_Int hypre_BoomerAMGCorrectCFMarker2 ( hypre_IntArray *CF_marker , hypre_IntArray *new_CF_marker ); -HYPRE_Int hypre_BoomerAMGCorrectCFMarker2Host ( hypre_IntArray *CF_marker , hypre_IntArray *new_CF_marker ); -HYPRE_Int hypre_BoomerAMGCorrectCFMarker2Device ( hypre_IntArray *CF_marker , hypre_IntArray *new_CF_marker ); -HYPRE_Int hypre_BoomerAMGCreateSHost(hypre_ParCSRMatrix *A, HYPRE_Real strength_threshold, HYPRE_Real max_row_sum, HYPRE_Int num_functions, HYPRE_Int *dof_func, hypre_ParCSRMatrix **S_ptr); -HYPRE_Int hypre_BoomerAMGCreateSDevice(hypre_ParCSRMatrix *A, HYPRE_Int abs_soc, HYPRE_Real strength_threshold, HYPRE_Real max_row_sum, HYPRE_Int num_functions, HYPRE_Int *dof_func, hypre_ParCSRMatrix **S_ptr); -HYPRE_Int hypre_BoomerAMGCreateSabsHost ( hypre_ParCSRMatrix *A , HYPRE_Real strength_threshold , HYPRE_Real max_row_sum , HYPRE_Int num_functions , HYPRE_Int *dof_func , hypre_ParCSRMatrix **S_ptr ); -HYPRE_Int hypre_BoomerAMGCreate2ndSDevice( hypre_ParCSRMatrix *S, HYPRE_Int *CF_marker, HYPRE_Int num_paths, HYPRE_BigInt *coarse_row_starts, hypre_ParCSRMatrix **C_ptr); +HYPRE_Int hypre_BoomerAMGCreateS ( hypre_ParCSRMatrix *A, HYPRE_Real strength_threshold, + HYPRE_Real max_row_sum, HYPRE_Int num_functions, HYPRE_Int *dof_func, hypre_ParCSRMatrix **S_ptr ); +HYPRE_Int hypre_BoomerAMGCreateSabs ( hypre_ParCSRMatrix *A, HYPRE_Real strength_threshold, + HYPRE_Real max_row_sum, HYPRE_Int num_functions, HYPRE_Int *dof_func, hypre_ParCSRMatrix **S_ptr ); +HYPRE_Int hypre_BoomerAMGCreateSCommPkg ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *S, + HYPRE_Int **col_offd_S_to_A_ptr ); +HYPRE_Int hypre_BoomerAMGCreate2ndS ( hypre_ParCSRMatrix *S, HYPRE_Int *CF_marker, + HYPRE_Int num_paths, HYPRE_BigInt *coarse_row_starts, hypre_ParCSRMatrix **C_ptr ); +HYPRE_Int hypre_BoomerAMGCorrectCFMarker ( hypre_IntArray *CF_marker, + hypre_IntArray *new_CF_marker ); +HYPRE_Int hypre_BoomerAMGCorrectCFMarkerHost ( hypre_IntArray *CF_marker, + hypre_IntArray *new_CF_marker ); +HYPRE_Int hypre_BoomerAMGCorrectCFMarkerDevice ( hypre_IntArray *CF_marker, + hypre_IntArray *new_CF_marker ); +HYPRE_Int hypre_BoomerAMGCorrectCFMarker2 ( hypre_IntArray *CF_marker, + hypre_IntArray *new_CF_marker ); +HYPRE_Int hypre_BoomerAMGCorrectCFMarker2Host ( hypre_IntArray *CF_marker, + hypre_IntArray *new_CF_marker ); +HYPRE_Int hypre_BoomerAMGCorrectCFMarker2Device ( hypre_IntArray *CF_marker, + hypre_IntArray *new_CF_marker ); +HYPRE_Int hypre_BoomerAMGCreateSHost(hypre_ParCSRMatrix *A, HYPRE_Real strength_threshold, + HYPRE_Real max_row_sum, HYPRE_Int num_functions, HYPRE_Int *dof_func, hypre_ParCSRMatrix **S_ptr); +HYPRE_Int hypre_BoomerAMGCreateSDevice(hypre_ParCSRMatrix *A, HYPRE_Int abs_soc, + HYPRE_Real strength_threshold, HYPRE_Real max_row_sum, HYPRE_Int num_functions, HYPRE_Int *dof_func, + hypre_ParCSRMatrix **S_ptr); +HYPRE_Int hypre_BoomerAMGCreateSabsHost ( hypre_ParCSRMatrix *A, HYPRE_Real strength_threshold, + HYPRE_Real max_row_sum, HYPRE_Int num_functions, HYPRE_Int *dof_func, hypre_ParCSRMatrix **S_ptr ); +HYPRE_Int hypre_BoomerAMGCreate2ndSDevice( hypre_ParCSRMatrix *S, HYPRE_Int *CF_marker, + HYPRE_Int num_paths, HYPRE_BigInt *coarse_row_starts, hypre_ParCSRMatrix **C_ptr); HYPRE_Int hypre_BoomerAMGMakeSocFromSDevice( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *S); /* par_sv_interp.c */ -HYPRE_Int hypre_BoomerAMGSmoothInterpVectors ( hypre_ParCSRMatrix *A , HYPRE_Int num_smooth_vecs , hypre_ParVector **smooth_vecs , HYPRE_Int smooth_steps ); -HYPRE_Int hypre_BoomerAMGCoarsenInterpVectors ( hypre_ParCSRMatrix *P , HYPRE_Int num_smooth_vecs , hypre_ParVector **smooth_vecs , HYPRE_Int *CF_marker , hypre_ParVector ***new_smooth_vecs , HYPRE_Int expand_level , HYPRE_Int num_functions ); -HYPRE_Int hypre_BoomerAMG_GMExpandInterp ( hypre_ParCSRMatrix *A , hypre_ParCSRMatrix **P , HYPRE_Int num_smooth_vecs , hypre_ParVector **smooth_vecs , HYPRE_Int *nf , HYPRE_Int *dof_func , hypre_IntArray **coarse_dof_func , HYPRE_Int variant , HYPRE_Int level , HYPRE_Real abs_trunc , HYPRE_Real *weights , HYPRE_Int q_max , HYPRE_Int *CF_marker , HYPRE_Int interp_vec_first_level ); -HYPRE_Int hypre_BoomerAMGRefineInterp ( hypre_ParCSRMatrix *A , hypre_ParCSRMatrix *P , HYPRE_BigInt *num_cpts_global , HYPRE_Int *nf , HYPRE_Int *dof_func , HYPRE_Int *CF_marker , HYPRE_Int level ); +HYPRE_Int hypre_BoomerAMGSmoothInterpVectors ( hypre_ParCSRMatrix *A, HYPRE_Int num_smooth_vecs, + hypre_ParVector **smooth_vecs, HYPRE_Int smooth_steps ); +HYPRE_Int hypre_BoomerAMGCoarsenInterpVectors ( hypre_ParCSRMatrix *P, HYPRE_Int num_smooth_vecs, + hypre_ParVector **smooth_vecs, HYPRE_Int *CF_marker, hypre_ParVector ***new_smooth_vecs, + HYPRE_Int expand_level, HYPRE_Int num_functions ); +HYPRE_Int hypre_BoomerAMG_GMExpandInterp ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **P, + HYPRE_Int num_smooth_vecs, hypre_ParVector **smooth_vecs, HYPRE_Int *nf, HYPRE_Int *dof_func, + hypre_IntArray **coarse_dof_func, HYPRE_Int variant, HYPRE_Int level, HYPRE_Real abs_trunc, + HYPRE_Real *weights, HYPRE_Int q_max, HYPRE_Int *CF_marker, HYPRE_Int interp_vec_first_level ); +HYPRE_Int hypre_BoomerAMGRefineInterp ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P, + HYPRE_BigInt *num_cpts_global, HYPRE_Int *nf, HYPRE_Int *dof_func, HYPRE_Int *CF_marker, + HYPRE_Int level ); /* par_sv_interp_ln.c */ -HYPRE_Int hypre_BoomerAMG_LNExpandInterp ( hypre_ParCSRMatrix *A , hypre_ParCSRMatrix **P , HYPRE_BigInt *num_cpts_global , HYPRE_Int *nf , HYPRE_Int *dof_func , hypre_IntArray **coarse_dof_func , HYPRE_Int *CF_marker , HYPRE_Int level , HYPRE_Real *weights , HYPRE_Int num_smooth_vecs , hypre_ParVector **smooth_vecs , HYPRE_Real abs_trunc , HYPRE_Int q_max , HYPRE_Int interp_vec_first_level ); +HYPRE_Int hypre_BoomerAMG_LNExpandInterp ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **P, + HYPRE_BigInt *num_cpts_global, HYPRE_Int *nf, HYPRE_Int *dof_func, hypre_IntArray **coarse_dof_func, + HYPRE_Int *CF_marker, HYPRE_Int level, HYPRE_Real *weights, HYPRE_Int num_smooth_vecs, + hypre_ParVector **smooth_vecs, HYPRE_Real abs_trunc, HYPRE_Int q_max, + HYPRE_Int interp_vec_first_level ); /* par_sv_interp_lsfit.c */ -HYPRE_Int hypre_BoomerAMGFitInterpVectors ( hypre_ParCSRMatrix *A , hypre_ParCSRMatrix **P , HYPRE_Int num_smooth_vecs , hypre_ParVector **smooth_vecs , hypre_ParVector **coarse_smooth_vecs , HYPRE_Real delta , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int *CF_marker , HYPRE_Int max_elmts , HYPRE_Real trunc_factor , HYPRE_Int variant , HYPRE_Int level ); +HYPRE_Int hypre_BoomerAMGFitInterpVectors ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **P, + HYPRE_Int num_smooth_vecs, hypre_ParVector **smooth_vecs, hypre_ParVector **coarse_smooth_vecs, + HYPRE_Real delta, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int *CF_marker, + HYPRE_Int max_elmts, HYPRE_Real trunc_factor, HYPRE_Int variant, HYPRE_Int level ); /* partial.c */ -HYPRE_Int hypre_BoomerAMGBuildPartialExtPIInterp ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_BigInt *num_old_cpts_global , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int max_elmts , hypre_ParCSRMatrix **P_ptr ); -HYPRE_Int hypre_BoomerAMGBuildPartialStdInterp ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_BigInt *num_old_cpts_global , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int max_elmts , HYPRE_Int sep_weight , hypre_ParCSRMatrix **P_ptr ); -HYPRE_Int hypre_BoomerAMGBuildPartialExtInterp ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_BigInt *num_old_cpts_global , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int max_elmts , hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGBuildPartialExtPIInterp ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_BigInt *num_old_cpts_global, + HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int debug_flag, HYPRE_Real trunc_factor, + HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGBuildPartialStdInterp ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_BigInt *num_old_cpts_global, + HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int debug_flag, HYPRE_Real trunc_factor, + HYPRE_Int max_elmts, HYPRE_Int sep_weight, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGBuildPartialExtInterp ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_BigInt *num_old_cpts_global, + HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int debug_flag, HYPRE_Real trunc_factor, + HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); /* par_vardifconv.c */ -HYPRE_ParCSRMatrix GenerateVarDifConv ( MPI_Comm comm , HYPRE_BigInt nx , HYPRE_BigInt ny , HYPRE_BigInt nz , HYPRE_Int P , HYPRE_Int Q , HYPRE_Int R , HYPRE_Int p , HYPRE_Int q , HYPRE_Int r , HYPRE_Real eps , HYPRE_ParVector *rhs_ptr ); -HYPRE_Real afun ( HYPRE_Real xx , HYPRE_Real yy , HYPRE_Real zz ); -HYPRE_Real bfun ( HYPRE_Real xx , HYPRE_Real yy , HYPRE_Real zz ); -HYPRE_Real cfun ( HYPRE_Real xx , HYPRE_Real yy , HYPRE_Real zz ); -HYPRE_Real dfun ( HYPRE_Real xx , HYPRE_Real yy , HYPRE_Real zz ); -HYPRE_Real efun ( HYPRE_Real xx , HYPRE_Real yy , HYPRE_Real zz ); -HYPRE_Real ffun ( HYPRE_Real xx , HYPRE_Real yy , HYPRE_Real zz ); -HYPRE_Real gfun ( HYPRE_Real xx , HYPRE_Real yy , HYPRE_Real zz ); -HYPRE_Real rfun ( HYPRE_Real xx , HYPRE_Real yy , HYPRE_Real zz ); -HYPRE_Real bndfun ( HYPRE_Real xx , HYPRE_Real yy , HYPRE_Real zz ); +HYPRE_ParCSRMatrix GenerateVarDifConv ( MPI_Comm comm, HYPRE_BigInt nx, HYPRE_BigInt ny, + HYPRE_BigInt nz, HYPRE_Int P, HYPRE_Int Q, HYPRE_Int R, HYPRE_Int p, HYPRE_Int q, HYPRE_Int r, + HYPRE_Real eps, HYPRE_ParVector *rhs_ptr ); +HYPRE_Real afun ( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ); +HYPRE_Real bfun ( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ); +HYPRE_Real cfun ( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ); +HYPRE_Real dfun ( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ); +HYPRE_Real efun ( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ); +HYPRE_Real ffun ( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ); +HYPRE_Real gfun ( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ); +HYPRE_Real rfun ( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ); +HYPRE_Real bndfun ( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ); /* par_vardifconv_rs.c */ -HYPRE_ParCSRMatrix GenerateRSVarDifConv ( MPI_Comm comm , HYPRE_BigInt nx , HYPRE_BigInt ny , HYPRE_BigInt nz , HYPRE_Int P , HYPRE_Int Q , HYPRE_Int R , HYPRE_Int p , HYPRE_Int q , HYPRE_Int r , HYPRE_Real eps , HYPRE_ParVector *rhs_ptr, HYPRE_Int type ); -HYPRE_Real afun_rs ( HYPRE_Real xx , HYPRE_Real yy , HYPRE_Real zz ); -HYPRE_Real bfun_rs ( HYPRE_Real xx , HYPRE_Real yy , HYPRE_Real zz ); -HYPRE_Real cfun_rs ( HYPRE_Real xx , HYPRE_Real yy , HYPRE_Real zz ); -HYPRE_Real dfun_rs ( HYPRE_Real xx , HYPRE_Real yy , HYPRE_Real zz ); -HYPRE_Real efun_rs ( HYPRE_Real xx , HYPRE_Real yy , HYPRE_Real zz ); -HYPRE_Real ffun_rs ( HYPRE_Real xx , HYPRE_Real yy , HYPRE_Real zz ); -HYPRE_Real gfun_rs ( HYPRE_Real xx , HYPRE_Real yy , HYPRE_Real zz ); -HYPRE_Real rfun_rs ( HYPRE_Real xx , HYPRE_Real yy , HYPRE_Real zz ); -HYPRE_Real bndfun_rs ( HYPRE_Real xx , HYPRE_Real yy , HYPRE_Real zz ); +HYPRE_ParCSRMatrix GenerateRSVarDifConv ( MPI_Comm comm, HYPRE_BigInt nx, HYPRE_BigInt ny, + HYPRE_BigInt nz, HYPRE_Int P, HYPRE_Int Q, HYPRE_Int R, HYPRE_Int p, HYPRE_Int q, HYPRE_Int r, + HYPRE_Real eps, HYPRE_ParVector *rhs_ptr, HYPRE_Int type ); +HYPRE_Real afun_rs ( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ); +HYPRE_Real bfun_rs ( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ); +HYPRE_Real cfun_rs ( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ); +HYPRE_Real dfun_rs ( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ); +HYPRE_Real efun_rs ( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ); +HYPRE_Real ffun_rs ( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ); +HYPRE_Real gfun_rs ( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ); +HYPRE_Real rfun_rs ( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ); +HYPRE_Real bndfun_rs ( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ); /* pcg_par.c */ -void *hypre_ParKrylovCAlloc ( size_t count , size_t elt_size, HYPRE_MemoryLocation location ); +void *hypre_ParKrylovCAlloc ( size_t count, size_t elt_size, HYPRE_MemoryLocation location ); HYPRE_Int hypre_ParKrylovFree ( void *ptr ); void *hypre_ParKrylovCreateVector ( void *vvector ); -void *hypre_ParKrylovCreateVectorArray ( HYPRE_Int n , void *vvector ); +void *hypre_ParKrylovCreateVectorArray ( HYPRE_Int n, void *vvector ); HYPRE_Int hypre_ParKrylovDestroyVector ( void *vvector ); -void *hypre_ParKrylovMatvecCreate ( void *A , void *x ); -HYPRE_Int hypre_ParKrylovMatvec ( void *matvec_data , HYPRE_Complex alpha , void *A , void *x , HYPRE_Complex beta , void *y ); -HYPRE_Int hypre_ParKrylovMatvecT ( void *matvec_data , HYPRE_Complex alpha , void *A , void *x , HYPRE_Complex beta , void *y ); +void *hypre_ParKrylovMatvecCreate ( void *A, void *x ); +HYPRE_Int hypre_ParKrylovMatvec ( void *matvec_data, HYPRE_Complex alpha, void *A, void *x, + HYPRE_Complex beta, void *y ); +HYPRE_Int hypre_ParKrylovMatvecT ( void *matvec_data, HYPRE_Complex alpha, void *A, void *x, + HYPRE_Complex beta, void *y ); HYPRE_Int hypre_ParKrylovMatvecDestroy ( void *matvec_data ); -HYPRE_Real hypre_ParKrylovInnerProd ( void *x , void *y ); -HYPRE_Int hypre_ParKrylovMassInnerProd ( void *x , void **y, HYPRE_Int k, HYPRE_Int unroll, void *result ); -HYPRE_Int hypre_ParKrylovMassDotpTwo ( void *x , void *y , void **z, HYPRE_Int k, HYPRE_Int unroll, void *result_x, void *result_y ); -HYPRE_Int hypre_ParKrylovMassAxpy( HYPRE_Complex *alpha, void **x, void *y, HYPRE_Int k, HYPRE_Int unroll); -HYPRE_Int hypre_ParKrylovCopyVector ( void *x , void *y ); +HYPRE_Real hypre_ParKrylovInnerProd ( void *x, void *y ); +HYPRE_Int hypre_ParKrylovMassInnerProd ( void *x, void **y, HYPRE_Int k, HYPRE_Int unroll, + void *result ); +HYPRE_Int hypre_ParKrylovMassDotpTwo ( void *x, void *y, void **z, HYPRE_Int k, HYPRE_Int unroll, + void *result_x, void *result_y ); +HYPRE_Int hypre_ParKrylovMassAxpy( HYPRE_Complex *alpha, void **x, void *y, HYPRE_Int k, + HYPRE_Int unroll); +HYPRE_Int hypre_ParKrylovCopyVector ( void *x, void *y ); HYPRE_Int hypre_ParKrylovClearVector ( void *x ); -HYPRE_Int hypre_ParKrylovScaleVector ( HYPRE_Complex alpha , void *x ); -HYPRE_Int hypre_ParKrylovAxpy ( HYPRE_Complex alpha , void *x , void *y ); -HYPRE_Int hypre_ParKrylovCommInfo ( void *A , HYPRE_Int *my_id , HYPRE_Int *num_procs ); -HYPRE_Int hypre_ParKrylovIdentitySetup ( void *vdata , void *A , void *b , void *x ); -HYPRE_Int hypre_ParKrylovIdentity ( void *vdata , void *A , void *b , void *x ); +HYPRE_Int hypre_ParKrylovScaleVector ( HYPRE_Complex alpha, void *x ); +HYPRE_Int hypre_ParKrylovAxpy ( HYPRE_Complex alpha, void *x, void *y ); +HYPRE_Int hypre_ParKrylovCommInfo ( void *A, HYPRE_Int *my_id, HYPRE_Int *num_procs ); +HYPRE_Int hypre_ParKrylovIdentitySetup ( void *vdata, void *A, void *b, void *x ); +HYPRE_Int hypre_ParKrylovIdentity ( void *vdata, void *A, void *b, void *x ); /* schwarz.c */ -HYPRE_Int hypre_AMGNodalSchwarzSmoother ( hypre_CSRMatrix *A , HYPRE_Int num_functions , HYPRE_Int option , hypre_CSRMatrix **domain_structure_pointer ); -HYPRE_Int hypre_ParMPSchwarzSolve ( hypre_ParCSRMatrix *par_A , hypre_CSRMatrix *A_boundary , hypre_ParVector *rhs_vector , hypre_CSRMatrix *domain_structure , hypre_ParVector *par_x , HYPRE_Real relax_wt , HYPRE_Real *scale , hypre_ParVector *Vtemp , HYPRE_Int *pivots , HYPRE_Int use_nonsymm ); -HYPRE_Int hypre_MPSchwarzSolve ( hypre_ParCSRMatrix *par_A , hypre_Vector *rhs_vector , hypre_CSRMatrix *domain_structure , hypre_ParVector *par_x , HYPRE_Real relax_wt , hypre_Vector *aux_vector , HYPRE_Int *pivots , HYPRE_Int use_nonsymm ); -HYPRE_Int hypre_MPSchwarzCFSolve ( hypre_ParCSRMatrix *par_A , hypre_Vector *rhs_vector , hypre_CSRMatrix *domain_structure , hypre_ParVector *par_x , HYPRE_Real relax_wt , hypre_Vector *aux_vector , HYPRE_Int *CF_marker , HYPRE_Int rlx_pt , HYPRE_Int *pivots , HYPRE_Int use_nonsymm ); -HYPRE_Int hypre_MPSchwarzFWSolve ( hypre_ParCSRMatrix *par_A , hypre_Vector *rhs_vector , hypre_CSRMatrix *domain_structure , hypre_ParVector *par_x , HYPRE_Real relax_wt , hypre_Vector *aux_vector , HYPRE_Int *pivots , HYPRE_Int use_nonsymm ); -HYPRE_Int hypre_MPSchwarzCFFWSolve ( hypre_ParCSRMatrix *par_A , hypre_Vector *rhs_vector , hypre_CSRMatrix *domain_structure , hypre_ParVector *par_x , HYPRE_Real relax_wt , hypre_Vector *aux_vector , HYPRE_Int *CF_marker , HYPRE_Int rlx_pt , HYPRE_Int *pivots , HYPRE_Int use_nonsymm ); -HYPRE_Int transpose_matrix_create ( HYPRE_Int **i_face_element_pointer , HYPRE_Int **j_face_element_pointer , HYPRE_Int *i_element_face , HYPRE_Int *j_element_face , HYPRE_Int num_elements , HYPRE_Int num_faces ); -HYPRE_Int matrix_matrix_product ( HYPRE_Int **i_element_edge_pointer , HYPRE_Int **j_element_edge_pointer , HYPRE_Int *i_element_face , HYPRE_Int *j_element_face , HYPRE_Int *i_face_edge , HYPRE_Int *j_face_edge , HYPRE_Int num_elements , HYPRE_Int num_faces , HYPRE_Int num_edges ); -HYPRE_Int hypre_AMGCreateDomainDof ( hypre_CSRMatrix *A , HYPRE_Int domain_type , HYPRE_Int overlap , HYPRE_Int num_functions , HYPRE_Int *dof_func , hypre_CSRMatrix **domain_structure_pointer , HYPRE_Int **piv_pointer , HYPRE_Int use_nonsymm ); -HYPRE_Int hypre_AMGeAgglomerate ( HYPRE_Int *i_AE_element , HYPRE_Int *j_AE_element , HYPRE_Int *i_face_face , HYPRE_Int *j_face_face , HYPRE_Int *w_face_face , HYPRE_Int *i_face_element , HYPRE_Int *j_face_element , HYPRE_Int *i_element_face , HYPRE_Int *j_element_face , HYPRE_Int *i_face_to_prefer_weight , HYPRE_Int *i_face_weight , HYPRE_Int num_faces , HYPRE_Int num_elements , HYPRE_Int *num_AEs_pointer ); -HYPRE_Int hypre_update_entry ( HYPRE_Int weight , HYPRE_Int *weight_max , HYPRE_Int *previous , HYPRE_Int *next , HYPRE_Int *first , HYPRE_Int *last , HYPRE_Int head , HYPRE_Int tail , HYPRE_Int i ); -HYPRE_Int hypre_remove_entry ( HYPRE_Int weight , HYPRE_Int *weight_max , HYPRE_Int *previous , HYPRE_Int *next , HYPRE_Int *first , HYPRE_Int *last , HYPRE_Int head , HYPRE_Int tail , HYPRE_Int i ); -HYPRE_Int hypre_move_entry ( HYPRE_Int weight , HYPRE_Int *weight_max , HYPRE_Int *previous , HYPRE_Int *next , HYPRE_Int *first , HYPRE_Int *last , HYPRE_Int head , HYPRE_Int tail , HYPRE_Int i ); -HYPRE_Int hypre_matinv ( HYPRE_Real *x , HYPRE_Real *a , HYPRE_Int k ); -HYPRE_Int hypre_parCorrRes ( hypre_ParCSRMatrix *A , hypre_ParVector *x , hypre_Vector *rhs , hypre_Vector **tmp_ptr ); -HYPRE_Int hypre_AdSchwarzSolve ( hypre_ParCSRMatrix *par_A , hypre_ParVector *par_rhs , hypre_CSRMatrix *domain_structure , HYPRE_Real *scale , hypre_ParVector *par_x , hypre_ParVector *par_aux , HYPRE_Int *pivots , HYPRE_Int use_nonsymm ); -HYPRE_Int hypre_AdSchwarzCFSolve ( hypre_ParCSRMatrix *par_A , hypre_ParVector *par_rhs , hypre_CSRMatrix *domain_structure , HYPRE_Real *scale , hypre_ParVector *par_x , hypre_ParVector *par_aux , HYPRE_Int *CF_marker , HYPRE_Int rlx_pt , HYPRE_Int *pivots , HYPRE_Int use_nonsymm ); -HYPRE_Int hypre_GenerateScale ( hypre_CSRMatrix *domain_structure , HYPRE_Int num_variables , HYPRE_Real relaxation_weight , HYPRE_Real **scale_pointer ); -HYPRE_Int hypre_ParAdSchwarzSolve ( hypre_ParCSRMatrix *A , hypre_ParVector *F , hypre_CSRMatrix *domain_structure , HYPRE_Real *scale , hypre_ParVector *X , hypre_ParVector *Vtemp , HYPRE_Int *pivots , HYPRE_Int use_nonsymm ); -HYPRE_Int hypre_ParAMGCreateDomainDof ( hypre_ParCSRMatrix *A , HYPRE_Int domain_type , HYPRE_Int overlap , HYPRE_Int num_functions , HYPRE_Int *dof_func , hypre_CSRMatrix **domain_structure_pointer , HYPRE_Int **piv_pointer , HYPRE_Int use_nonsymm ); -HYPRE_Int hypre_ParGenerateScale ( hypre_ParCSRMatrix *A , hypre_CSRMatrix *domain_structure , HYPRE_Real relaxation_weight , HYPRE_Real **scale_pointer ); -HYPRE_Int hypre_ParGenerateHybridScale ( hypre_ParCSRMatrix *A , hypre_CSRMatrix *domain_structure , hypre_CSRMatrix **A_boundary_pointer , HYPRE_Real **scale_pointer ); +HYPRE_Int hypre_AMGNodalSchwarzSmoother ( hypre_CSRMatrix *A, HYPRE_Int num_functions, + HYPRE_Int option, hypre_CSRMatrix **domain_structure_pointer ); +HYPRE_Int hypre_ParMPSchwarzSolve ( hypre_ParCSRMatrix *par_A, hypre_CSRMatrix *A_boundary, + hypre_ParVector *rhs_vector, hypre_CSRMatrix *domain_structure, hypre_ParVector *par_x, + HYPRE_Real relax_wt, HYPRE_Real *scale, hypre_ParVector *Vtemp, HYPRE_Int *pivots, + HYPRE_Int use_nonsymm ); +HYPRE_Int hypre_MPSchwarzSolve ( hypre_ParCSRMatrix *par_A, hypre_Vector *rhs_vector, + hypre_CSRMatrix *domain_structure, hypre_ParVector *par_x, HYPRE_Real relax_wt, + hypre_Vector *aux_vector, HYPRE_Int *pivots, HYPRE_Int use_nonsymm ); +HYPRE_Int hypre_MPSchwarzCFSolve ( hypre_ParCSRMatrix *par_A, hypre_Vector *rhs_vector, + hypre_CSRMatrix *domain_structure, hypre_ParVector *par_x, HYPRE_Real relax_wt, + hypre_Vector *aux_vector, HYPRE_Int *CF_marker, HYPRE_Int rlx_pt, HYPRE_Int *pivots, + HYPRE_Int use_nonsymm ); +HYPRE_Int hypre_MPSchwarzFWSolve ( hypre_ParCSRMatrix *par_A, hypre_Vector *rhs_vector, + hypre_CSRMatrix *domain_structure, hypre_ParVector *par_x, HYPRE_Real relax_wt, + hypre_Vector *aux_vector, HYPRE_Int *pivots, HYPRE_Int use_nonsymm ); +HYPRE_Int hypre_MPSchwarzCFFWSolve ( hypre_ParCSRMatrix *par_A, hypre_Vector *rhs_vector, + hypre_CSRMatrix *domain_structure, hypre_ParVector *par_x, HYPRE_Real relax_wt, + hypre_Vector *aux_vector, HYPRE_Int *CF_marker, HYPRE_Int rlx_pt, HYPRE_Int *pivots, + HYPRE_Int use_nonsymm ); +HYPRE_Int transpose_matrix_create ( HYPRE_Int **i_face_element_pointer, + HYPRE_Int **j_face_element_pointer, HYPRE_Int *i_element_face, HYPRE_Int *j_element_face, + HYPRE_Int num_elements, HYPRE_Int num_faces ); +HYPRE_Int matrix_matrix_product ( HYPRE_Int **i_element_edge_pointer, + HYPRE_Int **j_element_edge_pointer, HYPRE_Int *i_element_face, HYPRE_Int *j_element_face, + HYPRE_Int *i_face_edge, HYPRE_Int *j_face_edge, HYPRE_Int num_elements, HYPRE_Int num_faces, + HYPRE_Int num_edges ); +HYPRE_Int hypre_AMGCreateDomainDof ( hypre_CSRMatrix *A, HYPRE_Int domain_type, HYPRE_Int overlap, + HYPRE_Int num_functions, HYPRE_Int *dof_func, hypre_CSRMatrix **domain_structure_pointer, + HYPRE_Int **piv_pointer, HYPRE_Int use_nonsymm ); +HYPRE_Int hypre_AMGeAgglomerate ( HYPRE_Int *i_AE_element, HYPRE_Int *j_AE_element, + HYPRE_Int *i_face_face, HYPRE_Int *j_face_face, HYPRE_Int *w_face_face, HYPRE_Int *i_face_element, + HYPRE_Int *j_face_element, HYPRE_Int *i_element_face, HYPRE_Int *j_element_face, + HYPRE_Int *i_face_to_prefer_weight, HYPRE_Int *i_face_weight, HYPRE_Int num_faces, + HYPRE_Int num_elements, HYPRE_Int *num_AEs_pointer ); +HYPRE_Int hypre_update_entry ( HYPRE_Int weight, HYPRE_Int *weight_max, HYPRE_Int *previous, + HYPRE_Int *next, HYPRE_Int *first, HYPRE_Int *last, HYPRE_Int head, HYPRE_Int tail, HYPRE_Int i ); +HYPRE_Int hypre_remove_entry ( HYPRE_Int weight, HYPRE_Int *weight_max, HYPRE_Int *previous, + HYPRE_Int *next, HYPRE_Int *first, HYPRE_Int *last, HYPRE_Int head, HYPRE_Int tail, HYPRE_Int i ); +HYPRE_Int hypre_move_entry ( HYPRE_Int weight, HYPRE_Int *weight_max, HYPRE_Int *previous, + HYPRE_Int *next, HYPRE_Int *first, HYPRE_Int *last, HYPRE_Int head, HYPRE_Int tail, HYPRE_Int i ); +HYPRE_Int hypre_matinv ( HYPRE_Real *x, HYPRE_Real *a, HYPRE_Int k ); +HYPRE_Int hypre_parCorrRes ( hypre_ParCSRMatrix *A, hypre_ParVector *x, hypre_Vector *rhs, + hypre_Vector **tmp_ptr ); +HYPRE_Int hypre_AdSchwarzSolve ( hypre_ParCSRMatrix *par_A, hypre_ParVector *par_rhs, + hypre_CSRMatrix *domain_structure, HYPRE_Real *scale, hypre_ParVector *par_x, + hypre_ParVector *par_aux, HYPRE_Int *pivots, HYPRE_Int use_nonsymm ); +HYPRE_Int hypre_AdSchwarzCFSolve ( hypre_ParCSRMatrix *par_A, hypre_ParVector *par_rhs, + hypre_CSRMatrix *domain_structure, HYPRE_Real *scale, hypre_ParVector *par_x, + hypre_ParVector *par_aux, HYPRE_Int *CF_marker, HYPRE_Int rlx_pt, HYPRE_Int *pivots, + HYPRE_Int use_nonsymm ); +HYPRE_Int hypre_GenerateScale ( hypre_CSRMatrix *domain_structure, HYPRE_Int num_variables, + HYPRE_Real relaxation_weight, HYPRE_Real **scale_pointer ); +HYPRE_Int hypre_ParAdSchwarzSolve ( hypre_ParCSRMatrix *A, hypre_ParVector *F, + hypre_CSRMatrix *domain_structure, HYPRE_Real *scale, hypre_ParVector *X, hypre_ParVector *Vtemp, + HYPRE_Int *pivots, HYPRE_Int use_nonsymm ); +HYPRE_Int hypre_ParAMGCreateDomainDof ( hypre_ParCSRMatrix *A, HYPRE_Int domain_type, + HYPRE_Int overlap, HYPRE_Int num_functions, HYPRE_Int *dof_func, + hypre_CSRMatrix **domain_structure_pointer, HYPRE_Int **piv_pointer, HYPRE_Int use_nonsymm ); +HYPRE_Int hypre_ParGenerateScale ( hypre_ParCSRMatrix *A, hypre_CSRMatrix *domain_structure, + HYPRE_Real relaxation_weight, HYPRE_Real **scale_pointer ); +HYPRE_Int hypre_ParGenerateHybridScale ( hypre_ParCSRMatrix *A, hypre_CSRMatrix *domain_structure, + hypre_CSRMatrix **A_boundary_pointer, HYPRE_Real **scale_pointer ); /* par_restr.c, par_lr_restr.c */ -HYPRE_Int hypre_BoomerAMGBuildRestrAIR( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Real filter_thresholdR, HYPRE_Int debug_flag, hypre_ParCSRMatrix **R_ptr, HYPRE_Int is_triangular, HYPRE_Int gmres_switch); -HYPRE_Int hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Real filter_thresholdR, HYPRE_Int debug_flag, hypre_ParCSRMatrix **R_ptr, HYPRE_Int AIR1_5, HYPRE_Int is_triangular, HYPRE_Int gmres_switch); -HYPRE_Int hypre_BoomerAMGBuildRestrNeumannAIR( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int NeumannDeg, HYPRE_Real strong_thresholdR, HYPRE_Real filter_thresholdR, HYPRE_Int debug_flag, hypre_ParCSRMatrix **R_ptr); -HYPRE_Int hypre_BoomerAMGBuildRestrNeumannAIRDevice( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int NeumannDeg, HYPRE_Real strong_thresholdR, HYPRE_Real filter_thresholdR, HYPRE_Int debug_flag, hypre_ParCSRMatrix **R_ptr); +HYPRE_Int hypre_BoomerAMGBuildRestrAIR( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Real filter_thresholdR, HYPRE_Int debug_flag, hypre_ParCSRMatrix **R_ptr, + HYPRE_Int is_triangular, HYPRE_Int gmres_switch); +HYPRE_Int hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Real filter_thresholdR, HYPRE_Int debug_flag, hypre_ParCSRMatrix **R_ptr, HYPRE_Int AIR1_5, + HYPRE_Int is_triangular, HYPRE_Int gmres_switch); +HYPRE_Int hypre_BoomerAMGBuildRestrNeumannAIR( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int NeumannDeg, + HYPRE_Real strong_thresholdR, HYPRE_Real filter_thresholdR, HYPRE_Int debug_flag, + hypre_ParCSRMatrix **R_ptr); +HYPRE_Int hypre_BoomerAMGBuildRestrNeumannAIRDevice( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int NeumannDeg, + HYPRE_Real strong_thresholdR, HYPRE_Real filter_thresholdR, HYPRE_Int debug_flag, + hypre_ParCSRMatrix **R_ptr); HYPRE_Int hypre_BoomerAMGCFMarkerTo1minus1Device( HYPRE_Int *CF_marker, HYPRE_Int size ); #ifdef HYPRE_USING_DSUPERLU @@ -2147,46 +3559,101 @@ HYPRE_Int hypre_SLUDistDestroy( void* solver); void *hypre_MGRCreate ( void ); HYPRE_Int hypre_MGRDestroy ( void *mgr_vdata ); HYPRE_Int hypre_MGRCycle( void *mgr_vdata, hypre_ParVector **F_array, hypre_ParVector **U_array ); -void *hypre_MGRCreateFrelaxVcycleData(); +void *hypre_MGRCreateFrelaxVcycleData( void ); HYPRE_Int hypre_MGRDestroyFrelaxVcycleData( void *mgr_vdata ); -HYPRE_Int hypre_MGRSetupFrelaxVcycleData( void *mgr_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int level); +void *hypre_MGRCreateGSElimData( void ); +HYPRE_Int hypre_MGRDestroyGSElimData( void *mgr_vdata ); +HYPRE_Int hypre_MGRSetupFrelaxVcycleData( void *mgr_vdata, hypre_ParCSRMatrix *A, + hypre_ParVector *f, hypre_ParVector *u, + HYPRE_Int level ); HYPRE_Int hypre_MGRFrelaxVcycle ( void *mgr_vdata, hypre_ParVector *f, hypre_ParVector *u ); -HYPRE_Int hypre_MGRSetCpointsByBlock( void *mgr_vdata, HYPRE_Int block_size, HYPRE_Int max_num_levels, HYPRE_Int *block_num_coarse_points, HYPRE_Int **block_coarse_indexes); -HYPRE_Int hypre_MGRSetCpointsByContiguousBlock( void *mgr_vdata, HYPRE_Int block_size, HYPRE_Int max_num_levels, HYPRE_BigInt *begin_idx_array, HYPRE_Int *block_num_coarse_points, HYPRE_Int **block_coarse_indexes); -HYPRE_Int hypre_MGRSetCpointsByPointMarkerArray( void *mgr_vdata, HYPRE_Int block_size, HYPRE_Int max_num_levels, HYPRE_Int *block_num_coarse_points, HYPRE_Int **block_coarse_indexes, HYPRE_Int *point_marker_array); -HYPRE_Int hypre_MGRCoarsen(hypre_ParCSRMatrix *S, hypre_ParCSRMatrix *A,HYPRE_Int final_coarse_size,HYPRE_Int *final_coarse_indexes,HYPRE_Int debug_flag,hypre_IntArray **CF_marker,HYPRE_Int last_level); -HYPRE_Int hypre_MGRSetReservedCoarseNodes(void *mgr_vdata, HYPRE_Int reserved_coarse_size, HYPRE_BigInt *reserved_coarse_nodes); -HYPRE_Int hypre_MGRSetReservedCpointsLevelToKeep( void *mgr_vdata, HYPRE_Int level); -HYPRE_Int hypre_MGRSetMaxGlobalsmoothIters( void *mgr_vdata, HYPRE_Int max_iter ); -HYPRE_Int hypre_MGRSetGlobalsmoothType( void *mgr_vdata, HYPRE_Int iter_type ); -HYPRE_Int hypre_MGRSetNonCpointsToFpoints( void *mgr_vdata, HYPRE_Int nonCptToFptFlag); - +HYPRE_Int hypre_MGRSetCpointsByBlock( void *mgr_vdata, HYPRE_Int block_size, + HYPRE_Int max_num_levels, + HYPRE_Int *block_num_coarse_points, + HYPRE_Int **block_coarse_indexes ); +HYPRE_Int hypre_MGRSetCpointsByContiguousBlock( void *mgr_vdata, HYPRE_Int block_size, + HYPRE_Int max_num_levels, + HYPRE_BigInt *begin_idx_array, + HYPRE_Int *block_num_coarse_points, + HYPRE_Int **block_coarse_indexes ); +HYPRE_Int hypre_MGRSetCpointsByPointMarkerArray( void *mgr_vdata, HYPRE_Int block_size, + HYPRE_Int max_num_levels, + HYPRE_Int *block_num_coarse_points, + HYPRE_Int **block_coarse_indexes, + HYPRE_Int *point_marker_array ); +HYPRE_Int hypre_MGRCoarsen( hypre_ParCSRMatrix *S, hypre_ParCSRMatrix *A, + HYPRE_Int final_coarse_size, HYPRE_Int *final_coarse_indexes, + HYPRE_Int debug_flag, hypre_IntArray **CF_marker, + HYPRE_Int last_level ); +HYPRE_Int hypre_MGRSetReservedCoarseNodes( void *mgr_vdata, HYPRE_Int reserved_coarse_size, + HYPRE_BigInt *reserved_coarse_nodes ); +HYPRE_Int hypre_MGRSetReservedCpointsLevelToKeep( void *mgr_vdata, HYPRE_Int level ); +HYPRE_Int hypre_MGRSetMaxGlobalSmoothIters( void *mgr_vdata, HYPRE_Int max_iter ); +HYPRE_Int hypre_MGRSetGlobalSmoothType( void *mgr_vdata, HYPRE_Int iter_type ); +HYPRE_Int hypre_MGRSetNonCpointsToFpoints( void *mgr_vdata, HYPRE_Int nonCptToFptFlag ); //HYPRE_Int hypre_MGRInitCFMarker(HYPRE_Int num_variables, HYPRE_Int *CF_marker, HYPRE_Int initial_coarse_size,HYPRE_Int *initial_coarse_indexes); //HYPRE_Int hypre_MGRUpdateCoarseIndexes(HYPRE_Int num_variables, HYPRE_Int *CF_marker, HYPRE_Int initial_coarse_size,HYPRE_Int *initial_coarse_indexes); -HYPRE_Int hypre_MGRBuildInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P, HYPRE_Int method, HYPRE_Int numsweeps); -HYPRE_Int hypre_MGRBuildRestrict(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int max_elmts, HYPRE_Real strong_threshold, HYPRE_Real max_row_sum, hypre_ParCSRMatrix **RT, HYPRE_Int method, HYPRE_Int numsweeps); -//HYPRE_Int hypre_MGRBuildRestrictionToper(hypre_ParCSRMatrix *AT, HYPRE_Int *CF_marker, hypre_ParCSRMatrix *ST, HYPRE_Int *num_cpts_global,HYPRE_Int num_functions,HYPRE_Int *dof_func,HYPRE_Int debug_flag,HYPRE_Real trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **RT,HYPRE_Int last_level,HYPRE_Int level, HYPRE_Int numsweeps); -//HYPRE_Int hypre_BoomerAMGBuildInjectionInterp( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, HYPRE_Int *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int debug_flag,HYPRE_Int init_data,hypre_ParCSRMatrix **P_ptr); -HYPRE_Int hypre_MGRSetCoarseSolver( void *mgr_vdata, HYPRE_Int (*coarse_grid_solver_solve)(void*,void*,void*,void*), HYPRE_Int (*coarse_grid_solver_setup)(void*,void*,void*,void*), void *coarse_grid_solver ); -HYPRE_Int hypre_MGRSetFSolver( void *mgr_vdata, HYPRE_Int (*fine_grid_solver_solve)(void*,void*,void*,void*), HYPRE_Int (*fine_grid_solver_setup)(void*,void*,void*,void*), void *fsolver ); -HYPRE_Int hypre_MGRSetup( void *mgr_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); -HYPRE_Int hypre_MGRSolve( void *mgr_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); -HYPRE_Int hypre_block_jacobi_scaling(hypre_ParCSRMatrix *A,hypre_ParCSRMatrix **B_ptr,void *mgr_vdata,HYPRE_Int debug_flag); -HYPRE_Int hypre_blockRelax_solve(hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Real blk_size, HYPRE_Int n_block, HYPRE_Int left_size, HYPRE_Int method, HYPRE_Real *diaginv, hypre_ParVector *Vtemp); -HYPRE_Int hypre_blockRelax_setup(hypre_ParCSRMatrix *A,HYPRE_Int blk_size, HYPRE_Int reserved_coarse_size, HYPRE_Real **diaginvptr); -HYPRE_Int hypre_blockRelax(hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int blk_size, HYPRE_Int reserved_coarse_size, HYPRE_Int method, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp); - +HYPRE_Int hypre_ParCSRMatrixExtractBlockDiagHost( hypre_ParCSRMatrix *par_A, HYPRE_Int blk_size, + HYPRE_Int num_points, HYPRE_Int point_type, + HYPRE_Int *CF_marker, HYPRE_Int diag_size, + HYPRE_Int diag_type, HYPRE_Real *diag_data ); +HYPRE_Int hypre_ParCSRMatrixBlockDiagMatrix( hypre_ParCSRMatrix *A, HYPRE_Int blk_size, + HYPRE_Int point_type, HYPRE_Int *CF_marker, + HYPRE_Int diag_type, hypre_ParCSRMatrix **B_ptr ); +HYPRE_Int hypre_ParCSRMatrixBlockDiagMatrixHost( hypre_ParCSRMatrix *A, HYPRE_Int blk_size, + HYPRE_Int point_type, HYPRE_Int *CF_marker, + HYPRE_Int diag_type, + hypre_ParCSRMatrix **B_ptr ); +HYPRE_Int hypre_MGRSetCoarseSolver( void *mgr_vdata, + HYPRE_Int (*cgrid_solver_solve)(void*, void*, void*, void*), + HYPRE_Int (*cgrid_solver_setup)(void*, void*, void*, void*), + void *coarse_grid_solver ); +HYPRE_Int hypre_MGRSetFSolver( void *mgr_vdata, + HYPRE_Int (*fine_grid_solver_solve)(void*, void*, void*, void*), + HYPRE_Int (*fine_grid_solver_setup)(void*, void*, void*, void*), + void *fsolver ); +HYPRE_Int hypre_MGRSetFSolverAtLevel( void *mgr_vdata, void *fsolver, HYPRE_Int level ); +HYPRE_Int hypre_MGRSetup( void *mgr_vdata, hypre_ParCSRMatrix *A, + hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int hypre_MGRSolve( void *mgr_vdata, hypre_ParCSRMatrix *A, + hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int hypre_block_jacobi_scaling( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **B_ptr, + void *mgr_vdata, HYPRE_Int debug_flag ); +HYPRE_Int hypre_MGRBlockRelaxSolveDevice( hypre_ParCSRMatrix *B, hypre_ParCSRMatrix *A, + hypre_ParVector *f, hypre_ParVector *u, + hypre_ParVector *Vtemp, HYPRE_Real relax_weight ); +HYPRE_Int hypre_MGRBlockRelaxSolve( hypre_ParCSRMatrix *A, hypre_ParVector *f, + hypre_ParVector *u, HYPRE_Int blk_size, + HYPRE_Int n_block, HYPRE_Int left_size, + HYPRE_Int method, HYPRE_Real *diaginv, + hypre_ParVector *Vtemp ); +HYPRE_Int hypre_BlockDiagInvLapack( HYPRE_Real *diag, HYPRE_Int N, HYPRE_Int blk_size ); +HYPRE_Int hypre_MGRBlockRelaxSetup( hypre_ParCSRMatrix *A, HYPRE_Int blk_size, + HYPRE_Real **diaginvptr ); +//HYPRE_Int hypre_blockRelax(hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, +// HYPRE_Int blk_size, HYPRE_Int reserved_coarse_size, HYPRE_Int method, hypre_ParVector *Vtemp, +// hypre_ParVector *Ztemp); +HYPRE_Int hypre_block_jacobi_solve( hypre_ParCSRMatrix *A, hypre_ParVector *f, + hypre_ParVector *u, HYPRE_Int blk_size, + HYPRE_Int method, HYPRE_Real *diaginv, + hypre_ParVector *Vtemp ); //HYPRE_Int hypre_MGRBuildAffRAP( MPI_Comm comm, HYPRE_Int local_num_variables, HYPRE_Int num_functions, //HYPRE_Int *dof_func, HYPRE_Int *CF_marker, HYPRE_Int **coarse_dof_func_ptr, HYPRE_BigInt **coarse_pnts_global_ptr, //hypre_ParCSRMatrix *A, HYPRE_Int debug_flag, hypre_ParCSRMatrix **P_f_ptr, hypre_ParCSRMatrix **A_ff_ptr ); -HYPRE_Int hypre_MGRGetSubBlock( hypre_ParCSRMatrix *A, HYPRE_Int *row_cf_marker, HYPRE_Int *col_cf_marker, HYPRE_Int debug_flag, hypre_ParCSRMatrix **A_ff_ptr ); -HYPRE_Int hypre_MGRBuildAff( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, HYPRE_Int debug_flag, hypre_ParCSRMatrix **A_ff_ptr ); -HYPRE_Int hypre_MGRApproximateInverse(hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **A_inv); -HYPRE_Int hypre_MGRAddVectorP ( HYPRE_Int *CF_marker, HYPRE_Int point_type, HYPRE_Real a, hypre_ParVector *fromVector, HYPRE_Real b, hypre_ParVector **toVector ); -HYPRE_Int hypre_MGRAddVectorR ( HYPRE_Int *CF_marker, HYPRE_Int point_type, HYPRE_Real a, hypre_ParVector *fromVector, HYPRE_Real b, hypre_ParVector **toVector ); -HYPRE_Int hypre_MGRComputeNonGalerkinCoarseGrid(hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P, hypre_ParCSRMatrix *RT, HYPRE_Int bsize, HYPRE_Int ordering, HYPRE_Int method, HYPRE_Int Pmax, HYPRE_Int keep_stencil, HYPRE_Int *CF_marker, hypre_ParCSRMatrix **A_h_ptr); - -HYPRE_Int hypre_MGRWriteSolverParams(void *mgr_vdata); +HYPRE_Int hypre_MGRGetSubBlock( hypre_ParCSRMatrix *A, HYPRE_Int *row_cf_marker, + HYPRE_Int *col_cf_marker, HYPRE_Int debug_flag, + hypre_ParCSRMatrix **A_ff_ptr ); +HYPRE_Int hypre_MGRBuildAff( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, HYPRE_Int debug_flag, + hypre_ParCSRMatrix **A_ff_ptr ); +HYPRE_Int hypre_MGRApproximateInverse( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **A_inv ); +HYPRE_Int hypre_MGRAddVectorP( hypre_IntArray *CF_marker, HYPRE_Int point_type, HYPRE_Real a, + hypre_ParVector *fromVector, HYPRE_Real b, + hypre_ParVector **toVector ); +HYPRE_Int hypre_MGRAddVectorR( hypre_IntArray *CF_marker, HYPRE_Int point_type, HYPRE_Real a, + hypre_ParVector *fromVector, HYPRE_Real b, + hypre_ParVector **toVector ); +HYPRE_Int hypre_MGRTruncateAcfCPRDevice( hypre_ParCSRMatrix *A_CF, + hypre_ParCSRMatrix **A_CF_new_ptr ); HYPRE_Int hypre_MGRSetAffSolverType( void *systg_vdata, HYPRE_Int *aff_solver_type ); HYPRE_Int hypre_MGRSetCoarseSolverType( void *systg_vdata, HYPRE_Int coarse_solver_type ); HYPRE_Int hypre_MGRSetCoarseSolverIter( void *systg_vdata, HYPRE_Int coarse_solver_iter ); @@ -2195,30 +3662,43 @@ HYPRE_Int hypre_MGRSetFineSolverMaxLevels( void *systg_vdata, HYPRE_Int fine_sol HYPRE_Int hypre_MGRSetMaxCoarseLevels( void *mgr_vdata, HYPRE_Int maxlev ); HYPRE_Int hypre_MGRSetBlockSize( void *mgr_vdata, HYPRE_Int bsize ); HYPRE_Int hypre_MGRSetRelaxType( void *mgr_vdata, HYPRE_Int relax_type ); -HYPRE_Int hypre_MGRSetFRelaxMethod( void *mgr_vdata, HYPRE_Int relax_method); -HYPRE_Int hypre_MGRSetLevelFRelaxMethod( void *mgr_vdata, HYPRE_Int *relax_method); -HYPRE_Int hypre_MGRSetLevelFRelaxNumFunctions( void *mgr_vdata, HYPRE_Int *num_functions); -HYPRE_Int hypre_MGRSetCoarseGridMethod( void *mgr_vdata, HYPRE_Int *cg_method); -HYPRE_Int hypre_MGRSetRestrictType( void *mgr_vdata, HYPRE_Int restrictType); -HYPRE_Int hypre_MGRSetLevelRestrictType( void *mgr_vdata, HYPRE_Int *restrictType); -HYPRE_Int hypre_MGRSetInterpType( void *mgr_vdata, HYPRE_Int interpType); -HYPRE_Int hypre_MGRSetLevelInterpType( void *mgr_vdata, HYPRE_Int *interpType); +HYPRE_Int hypre_MGRSetFRelaxMethod( void *mgr_vdata, HYPRE_Int relax_method ); +HYPRE_Int hypre_MGRSetLevelFRelaxMethod( void *mgr_vdata, HYPRE_Int *relax_method ); +HYPRE_Int hypre_MGRSetLevelFRelaxType( void *mgr_vdata, HYPRE_Int *relax_type ); +HYPRE_Int hypre_MGRSetLevelFRelaxNumFunctions( void *mgr_vdata, HYPRE_Int *num_functions ); +HYPRE_Int hypre_MGRSetCoarseGridMethod( void *mgr_vdata, HYPRE_Int *cg_method ); +HYPRE_Int hypre_MGRSetNonGalerkinMaxElmts( void *mgr_vdata, HYPRE_Int max_elmts ); +HYPRE_Int hypre_MGRSetLevelNonGalerkinMaxElmts( void *mgr_vdata, HYPRE_Int *max_elmts ); +HYPRE_Int hypre_MGRSetRestrictType( void *mgr_vdata, HYPRE_Int restrictType ); +HYPRE_Int hypre_MGRSetLevelRestrictType( void *mgr_vdata, HYPRE_Int *restrictType ); +HYPRE_Int hypre_MGRSetInterpType( void *mgr_vdata, HYPRE_Int interpType ); +HYPRE_Int hypre_MGRSetLevelInterpType( void *mgr_vdata, HYPRE_Int *interpType ); HYPRE_Int hypre_MGRSetNumRelaxSweeps( void *mgr_vdata, HYPRE_Int nsweeps ); +HYPRE_Int hypre_MGRSetLevelNumRelaxSweeps( void *mgr_vdata, HYPRE_Int *nsweeps ); HYPRE_Int hypre_MGRSetNumInterpSweeps( void *mgr_vdata, HYPRE_Int nsweeps ); HYPRE_Int hypre_MGRSetNumRestrictSweeps( void *mgr_vdata, HYPRE_Int nsweeps ); +HYPRE_Int hypre_MGRSetLevelSmoothType( void *mgr_vdata, HYPRE_Int *level_smooth_type ); +HYPRE_Int hypre_MGRSetLevelSmoothIters( void *mgr_vdata, HYPRE_Int *level_smooth_iters ); +HYPRE_Int hypre_MGRSetGlobalSmoothCycle( void *mgr_vdata, HYPRE_Int global_smooth_cycle ); +HYPRE_Int hypre_MGRSetGlobalSmootherAtLevel( void *mgr_vdata, HYPRE_Solver smoother, + HYPRE_Int level ); HYPRE_Int hypre_MGRSetPrintLevel( void *mgr_vdata, HYPRE_Int print_level ); HYPRE_Int hypre_MGRSetFrelaxPrintLevel( void *mgr_vdata, HYPRE_Int print_level ); HYPRE_Int hypre_MGRSetCoarseGridPrintLevel( void *mgr_vdata, HYPRE_Int print_level ); -HYPRE_Int hypre_MGRSetTruncateCoarseGridThreshold( void *mgr_vdata, HYPRE_Real threshold); +HYPRE_Int hypre_MGRSetTruncateCoarseGridThreshold( void *mgr_vdata, HYPRE_Real threshold ); +HYPRE_Int hypre_MGRSetBlockJacobiBlockSize( void *mgr_vdata, HYPRE_Int blk_size ); HYPRE_Int hypre_MGRSetLogging( void *mgr_vdata, HYPRE_Int logging ); HYPRE_Int hypre_MGRSetMaxIter( void *mgr_vdata, HYPRE_Int max_iter ); -HYPRE_Int hypre_MGRSetPMaxElmts( void *mgr_vdata, HYPRE_Int P_max_elmts); +HYPRE_Int hypre_MGRSetPMaxElmts( void *mgr_vdata, HYPRE_Int P_max_elmts ); +HYPRE_Int hypre_MGRSetLevelPMaxElmts( void *mgr_vdata, HYPRE_Int *P_max_elmts ); HYPRE_Int hypre_MGRSetTol( void *mgr_vdata, HYPRE_Real tol ); -HYPRE_Int hypre_MGRSetAffInv( void *mgr_vdata, hypre_ParCSRMatrix *A_ff_inv); +HYPRE_Int hypre_MGRDataPrint(void *mgr_vdata); #ifdef HYPRE_USING_DSUPERLU void *hypre_MGRDirectSolverCreate( void ); -HYPRE_Int hypre_MGRDirectSolverSetup( void *solver, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u); -HYPRE_Int hypre_MGRDirectSolverSolve( void *solver, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u); +HYPRE_Int hypre_MGRDirectSolverSetup( void *solver, hypre_ParCSRMatrix *A, + hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int hypre_MGRDirectSolverSolve( void *solver, hypre_ParCSRMatrix *A, + hypre_ParVector *f, hypre_ParVector *u ); HYPRE_Int hypre_MGRDirectSolverDestroy( void *solver ); #endif // Accessor functions @@ -2226,6 +3706,89 @@ HYPRE_Int hypre_MGRGetNumIterations( void *mgr_vdata, HYPRE_Int *num_iterations HYPRE_Int hypre_MGRGetFinalRelativeResidualNorm( void *mgr_vdata, HYPRE_Real *res_norm ); HYPRE_Int hypre_MGRGetCoarseGridConvergenceFactor( void *mgr_data, HYPRE_Real *conv_factor ); +/* par_mgr_interp.c */ +HYPRE_Int hypre_MGRBuildInterp( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *A_FF, + hypre_ParCSRMatrix *A_FC, hypre_ParCSRMatrix *S, + hypre_IntArray *CF_marker, HYPRE_BigInt *num_cpts_global, + HYPRE_Real trunc_factor, HYPRE_Int max_elmts, + HYPRE_Int block_jacobi_bsize, HYPRE_Int method, + HYPRE_Int num_sweeps_post, hypre_ParCSRMatrix **Wp_ptr, + hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_MGRBuildRestrict( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *A_FF, + hypre_ParCSRMatrix *A_FC, hypre_ParCSRMatrix *A_CF, + hypre_IntArray *CF_marker, HYPRE_BigInt *num_cpts_global, + HYPRE_Real trunc_factor, HYPRE_Int max_elmts, + HYPRE_Real strong_threshold, HYPRE_Real max_row_sum, + HYPRE_Int blk_size, HYPRE_Int method, + hypre_ParCSRMatrix **W_ptr, hypre_ParCSRMatrix **R_ptr, + hypre_ParCSRMatrix **RT_ptr ); +HYPRE_Int hypre_MGRBuildPFromWp( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *Wp, + HYPRE_Int *CF_marker, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_MGRBuildPFromWpHost( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *Wp, + HYPRE_Int *CF_marker, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_MGRBuildBlockJacobiWp( hypre_ParCSRMatrix *A_FF, hypre_ParCSRMatrix *A_FC, + HYPRE_Int blk_size, hypre_ParCSRMatrix **Wp_ptr ); +HYPRE_Int hypre_MGRBuildBlockJacobiP( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *A_FF, + hypre_ParCSRMatrix *A_FC, hypre_ParCSRMatrix *Wp, + HYPRE_Int blk_size, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_MGRBuildP( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + HYPRE_BigInt *num_cpts_global, HYPRE_Int method, + HYPRE_Int debug_flag, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_MGRBuildPHost( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *A_FF, + hypre_ParCSRMatrix *A_FC, HYPRE_Int *CF_marker, + HYPRE_BigInt *num_cpts_global, HYPRE_Int method, + hypre_ParCSRMatrix **Wp_ptr, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_MGRBuildInterpApproximateInverse( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + HYPRE_BigInt *num_cpts_global, + hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_MGRTruncateAcfCPR( hypre_ParCSRMatrix *A_CF, hypre_ParCSRMatrix **A_CF_new_ptr ); +HYPRE_Int hypre_MGRBuildRFromWr( hypre_IntArray *C_map, hypre_IntArray *F_map, + HYPRE_BigInt global_num_rows_R, HYPRE_BigInt global_num_cols_R, + HYPRE_BigInt *row_starts_R, HYPRE_BigInt *col_starts_R, + hypre_ParCSRMatrix *Wr, hypre_ParCSRMatrix **R_ptr ); +HYPRE_Int hypre_MGRBlockColLumpedRestrict( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *A_FF, + hypre_ParCSRMatrix *A_CF, hypre_IntArray *CF_marker, + HYPRE_Int blk_dim, hypre_ParCSRMatrix **Wr_ptr, + hypre_ParCSRMatrix **R_ptr); +HYPRE_Int hypre_MGRColLumpedRestrict(hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *A_FF, + hypre_ParCSRMatrix *A_CF, hypre_IntArray *CF_marker, + hypre_ParCSRMatrix **Wr_ptr, hypre_ParCSRMatrix **R_ptr); + +/* par_mgr_rap.c */ +HYPRE_Int hypre_MGRBuildCoarseOperator(void *mgr_data, hypre_ParCSRMatrix *A_FF, + hypre_ParCSRMatrix *A_FC, hypre_ParCSRMatrix *A_CF, + hypre_ParCSRMatrix **A_CC_ptr, hypre_ParCSRMatrix *Wp, + hypre_ParCSRMatrix *Wr, HYPRE_Int level); + +/* par_mgr_coarsen.c */ +HYPRE_Int hypre_MGRCoarseParms( MPI_Comm comm, HYPRE_Int num_rows, hypre_IntArray *CF_marker, + HYPRE_BigInt *row_starts_cpts, HYPRE_BigInt *row_starts_fpts ); + +/* par_mgr_device.c */ +HYPRE_Int hypre_MGRRelaxL1JacobiDevice( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *CF_marker_host, HYPRE_Int relax_points, + HYPRE_Real relax_weight, HYPRE_Real *l1_norms, + hypre_ParVector *u, hypre_ParVector *Vtemp ); +HYPRE_Int hypre_MGRBuildPFromWpDevice( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *Wp, + HYPRE_Int *CF_marker, hypre_ParCSRMatrix **P_ptr); +HYPRE_Int hypre_MGRBuildPDevice( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + HYPRE_BigInt *num_cpts_global, HYPRE_Int method, + hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_ParCSRMatrixExtractBlockDiagDevice( hypre_ParCSRMatrix *A, HYPRE_Int blk_size, + HYPRE_Int num_points, HYPRE_Int point_type, + HYPRE_Int *CF_marker, HYPRE_Int diag_size, + HYPRE_Int diag_type, HYPRE_Int *B_diag_i, + HYPRE_Int *B_diag_j, + HYPRE_Complex *B_diag_data ); +HYPRE_Int hypre_ParCSRMatrixBlockDiagMatrixDevice( hypre_ParCSRMatrix *A, HYPRE_Int blk_size, + HYPRE_Int point_type, HYPRE_Int *CF_marker, + HYPRE_Int diag_type, + hypre_ParCSRMatrix **B_ptr ); + +/* par_mgr_stats.c */ +HYPRE_Int hypre_MGRSetupStats( void *mgr_vdata ); + /* par_ilu.c */ void *hypre_ILUCreate ( void ); HYPRE_Int hypre_ILUDestroy ( void *ilu_vdata ); @@ -2236,12 +3799,18 @@ HYPRE_Int hypre_ILUSetDropThresholdArray( void *ilu_vdata, HYPRE_Real *threshold HYPRE_Int hypre_ILUSetType( void *ilu_vdata, HYPRE_Int ilu_type ); HYPRE_Int hypre_ILUSetMaxIter( void *ilu_vdata, HYPRE_Int max_iter ); HYPRE_Int hypre_ILUSetTol( void *ilu_vdata, HYPRE_Real tol ); -HYPRE_Int hypre_ILUSetup( void *ilu_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); -HYPRE_Int hypre_ILUSolve( void *ilu_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int hypre_ILUSetIterativeSetupType( void *ilu_vdata, HYPRE_Int iter_setup_type ); +HYPRE_Int hypre_ILUSetIterativeSetupOption( void *ilu_vdata, HYPRE_Int iter_setup_option ); +HYPRE_Int hypre_ILUSetIterativeSetupMaxIter( void *ilu_vdata, HYPRE_Int iter_setup_max_iter ); +HYPRE_Int hypre_ILUSetIterativeSetupTolerance( void *ilu_vdata, HYPRE_Real iter_setup_tolerance ); +HYPRE_Int hypre_ILUGetIterativeSetupHistory( void *ilu_vdata, + HYPRE_Complex **iter_setup_history ); +HYPRE_Int hypre_ILUSetTriSolve( void *ilu_vdata, HYPRE_Int tri_solve ); +HYPRE_Int hypre_ILUSetLowerJacobiIters( void *ilu_vdata, HYPRE_Int lower_jacobi_iters ); +HYPRE_Int hypre_ILUSetUpperJacobiIters( void *ilu_vdata, HYPRE_Int upper_jacobi_iters ); HYPRE_Int hypre_ILUSetPrintLevel( void *ilu_vdata, HYPRE_Int print_level ); HYPRE_Int hypre_ILUSetLogging( void *ilu_vdata, HYPRE_Int logging ); HYPRE_Int hypre_ILUSetLocalReordering( void *ilu_vdata, HYPRE_Int ordering_type ); -HYPRE_Int hypre_ILUSetSchurSolverKDIM( void *ilu_vdata, HYPRE_Int ss_kDim ); HYPRE_Int hypre_ILUSetSchurSolverMaxIter( void *ilu_vdata, HYPRE_Int ss_max_iter ); HYPRE_Int hypre_ILUSetSchurSolverTol( void *ilu_vdata, HYPRE_Real ss_tol ); HYPRE_Int hypre_ILUSetSchurSolverAbsoluteTol( void *ilu_vdata, HYPRE_Real ss_absolute_tol ); @@ -2250,70 +3819,98 @@ HYPRE_Int hypre_ILUSetSchurSolverPrintLevel( void *ilu_vdata, HYPRE_Int ss_print HYPRE_Int hypre_ILUSetSchurSolverRelChange( void *ilu_vdata, HYPRE_Int ss_rel_change ); HYPRE_Int hypre_ILUSetSchurPrecondILUType( void *ilu_vdata, HYPRE_Int sp_ilu_type ); HYPRE_Int hypre_ILUSetSchurPrecondILULevelOfFill( void *ilu_vdata, HYPRE_Int sp_ilu_lfil ); -HYPRE_Int hypre_ILUSetSchurPrecondILUMaxNnzPerRow( void *ilu_vdata, HYPRE_Int sp_ilu_max_row_nnz ); +HYPRE_Int hypre_ILUSetSchurPrecondILUMaxNnzPerRow( void *ilu_vdata, + HYPRE_Int sp_ilu_max_row_nnz ); HYPRE_Int hypre_ILUSetSchurPrecondILUDropThreshold( void *ilu_vdata, HYPRE_Real sp_ilu_droptol ); -HYPRE_Int hypre_ILUSetSchurPrecondILUDropThresholdArray( void *ilu_vdata, HYPRE_Real *sp_ilu_droptol ); +HYPRE_Int hypre_ILUSetSchurPrecondILUDropThresholdArray( void *ilu_vdata, + HYPRE_Real *sp_ilu_droptol ); HYPRE_Int hypre_ILUSetSchurPrecondPrintLevel( void *ilu_vdata, HYPRE_Int sp_print_level ); HYPRE_Int hypre_ILUSetSchurPrecondMaxIter( void *ilu_vdata, HYPRE_Int sp_max_iter ); +HYPRE_Int hypre_ILUSetSchurPrecondTriSolve( void *ilu_vdata, HYPRE_Int sp_tri_solve ); +HYPRE_Int hypre_ILUSetSchurPrecondLowerJacobiIters( void *ilu_vdata, + HYPRE_Int sp_lower_jacobi_iters ); +HYPRE_Int hypre_ILUSetSchurPrecondUpperJacobiIters( void *ilu_vdata, + HYPRE_Int sp_upper_jacobi_iters ); HYPRE_Int hypre_ILUSetSchurPrecondTol( void *ilu_vdata, HYPRE_Int sp_tol ); -HYPRE_Int hypre_ILUMinHeapAddI(HYPRE_Int *heap, HYPRE_Int len); -HYPRE_Int hypre_ILUMinHeapAddIIIi(HYPRE_Int *heap, HYPRE_Int *I1, HYPRE_Int *Ii1, HYPRE_Int len); -HYPRE_Int hypre_ILUMinHeapAddIRIi(HYPRE_Int *heap, HYPRE_Real *I1, HYPRE_Int *Ii1, HYPRE_Int len); -HYPRE_Int hypre_ILUMaxHeapAddRabsIIi(HYPRE_Real *heap, HYPRE_Int *I1, HYPRE_Int *Ii1, HYPRE_Int len); -HYPRE_Int hypre_ILUMaxrHeapAddRabsI(HYPRE_Real *heap, HYPRE_Int *I1, HYPRE_Int len); -HYPRE_Int hypre_ILUMinHeapRemoveI(HYPRE_Int *heap, HYPRE_Int len); -HYPRE_Int hypre_ILUMinHeapRemoveIIIi(HYPRE_Int *heap, HYPRE_Int *I1, HYPRE_Int *Ii1, HYPRE_Int len); -HYPRE_Int hypre_ILUMinHeapRemoveIRIi(HYPRE_Int *heap, HYPRE_Real *I1, HYPRE_Int *Ii1, HYPRE_Int len); -HYPRE_Int hypre_ILUMaxHeapRemoveRabsIIi(HYPRE_Real *heap, HYPRE_Int *I1, HYPRE_Int *Ii1, HYPRE_Int len); -HYPRE_Int hypre_ILUMaxrHeapRemoveRabsI(HYPRE_Real *heap, HYPRE_Int *I1, HYPRE_Int len); -HYPRE_Int hypre_ILUMaxQSplitRI(HYPRE_Real *array, HYPRE_Int *I1, HYPRE_Int left, HYPRE_Int bound, HYPRE_Int right); -HYPRE_Int hypre_ILUMaxQSplitRabsI(HYPRE_Real *array, HYPRE_Int *I1, HYPRE_Int left, HYPRE_Int bound, HYPRE_Int right); -//HYPRE_Int hypre_quickSortIR (HYPRE_Int *a, HYPRE_Real *b, HYPRE_Int *iw, const HYPRE_Int lo, const HYPRE_Int hi); -HYPRE_Int hypre_ILUSortOffdColmap(hypre_ParCSRMatrix *A); -HYPRE_Int hypre_ILUMaxRabs(HYPRE_Real *array_data, HYPRE_Int *array_j, HYPRE_Int start, HYPRE_Int end, HYPRE_Int nLU, HYPRE_Int *rperm, HYPRE_Real *value, HYPRE_Int *index, HYPRE_Real *l1_norm, HYPRE_Int *nnz); -HYPRE_Int hypre_ILUGetPermddPQPre(HYPRE_Int n, HYPRE_Int nLU, HYPRE_Int *A_diag_i, HYPRE_Int *A_diag_j, HYPRE_Real *A_diag_data, HYPRE_Real tol, HYPRE_Int *perm, HYPRE_Int *rperm, HYPRE_Int *pperm_pre, HYPRE_Int *qperm_pre, HYPRE_Int *nB); -HYPRE_Int hypre_ILUGetPermddPQ(hypre_ParCSRMatrix *A, HYPRE_Int **pperm, HYPRE_Int **qperm, HYPRE_Real tol, HYPRE_Int *nB, HYPRE_Int *nI, HYPRE_Int reordering_type); -HYPRE_Int hypre_ILUGetInteriorExteriorPerm(hypre_ParCSRMatrix *A, HYPRE_Int **perm, HYPRE_Int *nLU, HYPRE_Int reordering_type); -HYPRE_Int hypre_ILUGetLocalPerm(hypre_ParCSRMatrix *A, HYPRE_Int **perm, HYPRE_Int *nLU, HYPRE_Int reordering_type); -HYPRE_Int hypre_ILUWriteSolverParams(void *ilu_vdata); -HYPRE_Int hypre_ILUBuildRASExternalMatrix(hypre_ParCSRMatrix *A, HYPRE_Int *rperm, HYPRE_Int **E_i, HYPRE_Int **E_j, HYPRE_Real **E_data); -HYPRE_Int hypre_ILUSetupILU0(hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int *qperm, HYPRE_Int nLU, HYPRE_Int nI, hypre_ParCSRMatrix **Lptr, HYPRE_Real** Dptr, hypre_ParCSRMatrix **Uptr, hypre_ParCSRMatrix **Sptr, HYPRE_Int **u_end); -HYPRE_Int hypre_ILUSetupMILU0(hypre_ParCSRMatrix *A, HYPRE_Int *permp, HYPRE_Int *qpermp, HYPRE_Int nLU, HYPRE_Int nI, hypre_ParCSRMatrix **Lptr, HYPRE_Real** Dptr, hypre_ParCSRMatrix **Uptr, hypre_ParCSRMatrix **Sptr, HYPRE_Int **u_end, HYPRE_Int modified); -HYPRE_Int hypre_ILUSetupILUK(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *permp, HYPRE_Int *qpermp, HYPRE_Int nLU, HYPRE_Int nI, hypre_ParCSRMatrix **Lptr, HYPRE_Real** Dptr, hypre_ParCSRMatrix **Uptr, hypre_ParCSRMatrix **Sptr, HYPRE_Int **u_end); -HYPRE_Int hypre_ILUSetupILUKSymbolic(HYPRE_Int n, HYPRE_Int *A_diag_i, HYPRE_Int *A_diag_j, HYPRE_Int lfil, HYPRE_Int *perm, HYPRE_Int *rperm, HYPRE_Int *iw, HYPRE_Int nLU, HYPRE_Int *L_diag_i, HYPRE_Int *U_diag_i, HYPRE_Int *S_diag_i, HYPRE_Int **L_diag_j, HYPRE_Int **U_diag_j, HYPRE_Int **S_diag_j, HYPRE_Int **u_end); -HYPRE_Int hypre_ILUSetupILUT(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, HYPRE_Int *permp, HYPRE_Int *qpermp, HYPRE_Int nLU, HYPRE_Int nI, hypre_ParCSRMatrix **Lptr, HYPRE_Real** Dptr, hypre_ParCSRMatrix **Uptr, hypre_ParCSRMatrix **Sptr, HYPRE_Int **u_end); -HYPRE_Int hypre_ILUSetupILU0RAS(hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int nLU, hypre_ParCSRMatrix **Lptr, HYPRE_Real** Dptr, hypre_ParCSRMatrix **Uptr); -HYPRE_Int hypre_ILUSetupILUKRASSymbolic(HYPRE_Int n, HYPRE_Int *A_diag_i, HYPRE_Int *A_diag_j, HYPRE_Int *A_offd_i, HYPRE_Int *A_offd_j, HYPRE_Int *E_i, HYPRE_Int *E_j, HYPRE_Int ext, HYPRE_Int lfil, HYPRE_Int *perm, HYPRE_Int *rperm, HYPRE_Int *iw, HYPRE_Int nLU, HYPRE_Int *L_diag_i, HYPRE_Int *U_diag_i, HYPRE_Int **L_diag_j, HYPRE_Int **U_diag_j); -HYPRE_Int hypre_ILUSetupILUKRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *perm, HYPRE_Int nLU, hypre_ParCSRMatrix **Lptr, HYPRE_Real** Dptr, hypre_ParCSRMatrix **Uptr); -HYPRE_Int hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, HYPRE_Int *perm, HYPRE_Int nLU, hypre_ParCSRMatrix **Lptr, HYPRE_Real** Dptr, hypre_ParCSRMatrix **Uptr); -HYPRE_Int hypre_ILUSolveLU(hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int *perm, HYPRE_Int nLU, hypre_ParCSRMatrix *L, HYPRE_Real* D, hypre_ParCSRMatrix *U, hypre_ParVector *utemp, hypre_ParVector *ftemp); -HYPRE_Int hypre_ILUSolveSchurGMRES(hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int *perm, HYPRE_Int *qperm, HYPRE_Int nLU, hypre_ParCSRMatrix *L, HYPRE_Real* D, hypre_ParCSRMatrix *U, hypre_ParCSRMatrix *S, hypre_ParVector *ftemp, hypre_ParVector *utemp, HYPRE_Solver schur_solver, HYPRE_Solver schur_precond, hypre_ParVector *rhs, hypre_ParVector *x, HYPRE_Int *u_end); -HYPRE_Int hypre_ILUSolveSchurNSH(hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int *perm, HYPRE_Int nLU, hypre_ParCSRMatrix *L, HYPRE_Real* D, hypre_ParCSRMatrix *U, hypre_ParCSRMatrix *S, hypre_ParVector *ftemp, hypre_ParVector *utemp, HYPRE_Solver schur_solver, hypre_ParVector *rhs, hypre_ParVector *x, HYPRE_Int *u_end); -HYPRE_Int hypre_ILUSolveLURAS(hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int *perm, hypre_ParCSRMatrix *L, HYPRE_Real* D, hypre_ParCSRMatrix *U, hypre_ParVector *ftemp, hypre_ParVector *utemp, HYPRE_Real *fext, HYPRE_Real *uext); -HYPRE_Int hypre_ILUSetSchurNSHDropThreshold( void *ilu_vdata, HYPRE_Real threshold); -HYPRE_Int hypre_ILUSetSchurNSHDropThresholdArray( void *ilu_vdata, HYPRE_Real *threshold); -HYPRE_Int hypre_ILUSetupRAPILU0(hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int n, HYPRE_Int nLU, hypre_ParCSRMatrix **Lptr, HYPRE_Real **Dptr, hypre_ParCSRMatrix **Uptr, hypre_ParCSRMatrix **mLptr, HYPRE_Real **mDptr, hypre_ParCSRMatrix **mUptr, HYPRE_Int **u_end); -HYPRE_Int hypre_ILUSolveRAPGMRESHOST(hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int *perm, HYPRE_Int nLU, hypre_ParCSRMatrix *L, HYPRE_Real *D, hypre_ParCSRMatrix *U, hypre_ParCSRMatrix *mL, HYPRE_Real *mD, hypre_ParCSRMatrix *mU, hypre_ParVector *ftemp, hypre_ParVector *utemp,hypre_ParVector *xtemp, hypre_ParVector *ytemp, HYPRE_Solver schur_solver, HYPRE_Solver schur_precond, hypre_ParVector *rhs, hypre_ParVector *x, HYPRE_Int *u_end); -HYPRE_Int hypre_ParILURAPSchurGMRESSolveH( void *ilu_vdata, void *ilu_vdata2, hypre_ParVector *f, hypre_ParVector *u ); -HYPRE_Int hypre_ParILURAPSchurGMRESDummySetupH(void *a, void *b, void *c, void *d); -HYPRE_Int hypre_ParILURAPSchurGMRESCommInfoH( void *ilu_vdata, HYPRE_Int *my_id, HYPRE_Int *num_procs); -void *hypre_ParILURAPSchurGMRESMatvecCreateH(void *ilu_vdata, void *x); -HYPRE_Int hypre_ParILURAPSchurGMRESMatvecH(void *matvec_data, HYPRE_Complex alpha, void *ilu_vdata, void *x, HYPRE_Complex beta, void *y); -HYPRE_Int hypre_ParILURAPSchurGMRESMatvecDestroyH(void *matvec_data ); -HYPRE_Int hypre_ILULocalRCM( hypre_CSRMatrix *A, HYPRE_Int start, HYPRE_Int end, HYPRE_Int **permp, HYPRE_Int **qpermp, HYPRE_Int sym); -HYPRE_Int hypre_ILULocalRCMNumbering(hypre_CSRMatrix *A, HYPRE_Int root, HYPRE_Int *marker, HYPRE_Int *perm, HYPRE_Int *current_nump); -HYPRE_Int hypre_ILULocalRCMFindPPNode( hypre_CSRMatrix *A, HYPRE_Int *rootp, HYPRE_Int *marker); -HYPRE_Int hypre_ILULocalRCMMindegree(HYPRE_Int n, HYPRE_Int *degree, HYPRE_Int *marker, HYPRE_Int *rootp); -HYPRE_Int hypre_ILULocalRCMOrder( hypre_CSRMatrix *A, HYPRE_Int *perm); -HYPRE_Int hypre_ILULocalRCMBuildLevel(hypre_CSRMatrix *A, HYPRE_Int root, HYPRE_Int *marker, HYPRE_Int *level_i, HYPRE_Int *level_j, HYPRE_Int *nlevp); -HYPRE_Int hypre_ILULocalRCMQsort(HYPRE_Int *perm, HYPRE_Int start, HYPRE_Int end, HYPRE_Int *degree); -HYPRE_Int hypre_ILULocalRCMReverse(HYPRE_Int *perm, HYPRE_Int start, HYPRE_Int end); -// Newton-Schultz-Hotelling (NSH) functions -void * hypre_NSHCreate(); +HYPRE_Int hypre_ILUSetSchurNSHDropThreshold( void *ilu_vdata, HYPRE_Real threshold ); +HYPRE_Int hypre_ILUSetSchurNSHDropThresholdArray( void *ilu_vdata, HYPRE_Real *threshold ); +HYPRE_Int hypre_ILUGetNumIterations( void *ilu_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int hypre_ILUGetFinalRelativeResidualNorm( void *ilu_vdata, HYPRE_Real *res_norm ); +HYPRE_Int hypre_ILUWriteSolverParams( void *ilu_vdata ); + +HYPRE_Int hypre_ILUMinHeapAddI( HYPRE_Int *heap, HYPRE_Int len ); +HYPRE_Int hypre_ILUMinHeapAddIIIi( HYPRE_Int *heap, HYPRE_Int *I1, + HYPRE_Int *Ii1, HYPRE_Int len ); +HYPRE_Int hypre_ILUMinHeapAddIRIi( HYPRE_Int *heap, HYPRE_Real *I1, + HYPRE_Int *Ii1, HYPRE_Int len ); +HYPRE_Int hypre_ILUMaxrHeapAddRabsI( HYPRE_Real *heap, HYPRE_Int *I1, HYPRE_Int len ); +HYPRE_Int hypre_ILUMinHeapRemoveI( HYPRE_Int *heap, HYPRE_Int len ); +HYPRE_Int hypre_ILUMinHeapRemoveIIIi( HYPRE_Int *heap, HYPRE_Int *I1, + HYPRE_Int *Ii1, HYPRE_Int len ); +HYPRE_Int hypre_ILUMinHeapRemoveIRIi( HYPRE_Int *heap, HYPRE_Real *I1, + HYPRE_Int *Ii1, HYPRE_Int len ); +HYPRE_Int hypre_ILUMaxrHeapRemoveRabsI( HYPRE_Real *heap, HYPRE_Int *I1, HYPRE_Int len ); +HYPRE_Int hypre_ILUMaxQSplitRabsI( HYPRE_Real *arrayR, HYPRE_Int *arrayI, HYPRE_Int left, + HYPRE_Int bound, HYPRE_Int right ); +HYPRE_Int hypre_ILUMaxRabs( HYPRE_Real *array_data, HYPRE_Int *array_j, HYPRE_Int start, + HYPRE_Int end, HYPRE_Int nLU, HYPRE_Int *rperm, HYPRE_Real *value, + HYPRE_Int *index, HYPRE_Real *l1_norm, HYPRE_Int *nnz ); + +HYPRE_Int hypre_ILUGetPermddPQPre( HYPRE_Int n, HYPRE_Int nLU, HYPRE_Int *A_diag_i, + HYPRE_Int *A_diag_j, HYPRE_Real *A_diag_data, + HYPRE_Real tol, HYPRE_Int *perm, HYPRE_Int *rperm, + HYPRE_Int *pperm_pre, HYPRE_Int *qperm_pre, HYPRE_Int *nB ); +HYPRE_Int hypre_ILUGetPermddPQ( hypre_ParCSRMatrix *A, HYPRE_Int **io_pperm, HYPRE_Int **io_qperm, + HYPRE_Real tol, HYPRE_Int *nB, HYPRE_Int *nI, + HYPRE_Int reordering_type ); +HYPRE_Int hypre_ILUGetInteriorExteriorPerm( hypre_ParCSRMatrix *A, + HYPRE_MemoryLocation memory_location, + HYPRE_Int **perm, HYPRE_Int *nLU, + HYPRE_Int reordering_type ); +HYPRE_Int hypre_ILUGetLocalPerm( hypre_ParCSRMatrix *A, HYPRE_Int **perm_ptr, + HYPRE_Int *nLU, HYPRE_Int reordering_type ); +HYPRE_Int hypre_ILUBuildRASExternalMatrix( hypre_ParCSRMatrix *A, HYPRE_Int *rperm, + HYPRE_Int **E_i, HYPRE_Int **E_j, HYPRE_Real **E_data ); +HYPRE_Int hypre_ILUSortOffdColmap( hypre_ParCSRMatrix *A ); +HYPRE_Int hypre_ILULocalRCMBuildFinalPerm( HYPRE_Int start, HYPRE_Int end, + HYPRE_Int * G_perm, HYPRE_Int *perm, HYPRE_Int *qperm, + HYPRE_Int **permp, HYPRE_Int **qpermp ); +HYPRE_Int hypre_ILULocalRCM( hypre_CSRMatrix *A, HYPRE_Int start, HYPRE_Int end, + HYPRE_Int **permp, HYPRE_Int **qpermp, HYPRE_Int sym ); +HYPRE_Int hypre_ILULocalRCMMindegree( HYPRE_Int n, HYPRE_Int *degree, + HYPRE_Int *marker, HYPRE_Int *rootp ); +HYPRE_Int hypre_ILULocalRCMOrder( hypre_CSRMatrix *A, HYPRE_Int *perm ); +HYPRE_Int hypre_ILULocalRCMFindPPNode( hypre_CSRMatrix *A, HYPRE_Int *rootp, HYPRE_Int *marker ); +HYPRE_Int hypre_ILULocalRCMBuildLevel( hypre_CSRMatrix *A, HYPRE_Int root, HYPRE_Int *marker, + HYPRE_Int *level_i, HYPRE_Int *level_j, HYPRE_Int *nlevp ); +HYPRE_Int hypre_ILULocalRCMNumbering( hypre_CSRMatrix *A, HYPRE_Int root, HYPRE_Int *marker, + HYPRE_Int *perm, HYPRE_Int *current_nump ); +HYPRE_Int hypre_ILULocalRCMQsort( HYPRE_Int *perm, HYPRE_Int start, HYPRE_Int end, + HYPRE_Int *degree ); +HYPRE_Int hypre_ILULocalRCMReverse( HYPRE_Int *perm, HYPRE_Int start, HYPRE_Int end ); + +#if defined(HYPRE_USING_GPU) +HYPRE_Int hypre_ParILUSchurGMRESDummySolveDevice( void *ilu_vdata, void *ilu_vdata2, + hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int hypre_ParILUSchurGMRESCommInfoDevice( void *ilu_vdata, HYPRE_Int *my_id, + HYPRE_Int *num_procs ); +HYPRE_Int hypre_ParILURAPSchurGMRESSolveDevice( void *ilu_vdata, void *ilu_vdata2, + hypre_ParVector *par_f, hypre_ParVector *par_u ); +HYPRE_Int hypre_ParILURAPSchurGMRESMatvecDevice( void *matvec_data, HYPRE_Complex alpha, + void *ilu_vdata, void *x, + HYPRE_Complex beta, void *y ); +#endif +HYPRE_Int hypre_ParILURAPSchurGMRESCommInfoHost( void *ilu_vdata, HYPRE_Int *my_id, + HYPRE_Int *num_procs ); +HYPRE_Int hypre_ParILURAPSchurGMRESSolveHost( void *ilu_vdata, void *ilu_vdata2, + hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int hypre_ParILURAPSchurGMRESMatvecHost( void *matvec_data, HYPRE_Complex alpha, + void *ilu_vdata, void *x, + HYPRE_Complex beta, void *y ); + +void * hypre_NSHCreate( void ); HYPRE_Int hypre_NSHDestroy( void *data ); -HYPRE_Int hypre_NSHSetup( void *nsh_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); -HYPRE_Int hypre_NSHSolve( void *nsh_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); -HYPRE_Int hypre_NSHWriteSolverParams(void *nsh_vdata); +HYPRE_Int hypre_NSHWriteSolverParams( void *nsh_vdata ); HYPRE_Int hypre_NSHSetPrintLevel( void *nsh_vdata, HYPRE_Int print_level ); HYPRE_Int hypre_NSHSetLogging( void *nsh_vdata, HYPRE_Int logging ); HYPRE_Int hypre_NSHSetMaxIter( void *nsh_vdata, HYPRE_Int max_iter ); @@ -2328,112 +3925,428 @@ HYPRE_Int hypre_NSHSetColVersion( void *nsh_vdata, HYPRE_Int mr_col_version ); HYPRE_Int hypre_NSHSetNSHMaxIter( void *nsh_vdata, HYPRE_Int nsh_max_iter ); HYPRE_Int hypre_NSHSetNSHTol( void *nsh_vdata, HYPRE_Real nsh_tol ); HYPRE_Int hypre_NSHSetNSHMaxRowNnz( void *nsh_vdata, HYPRE_Int nsh_max_row_nnz ); -HYPRE_Int hypre_CSRMatrixNormFro(hypre_CSRMatrix *A, HYPRE_Real *norm_io); -HYPRE_Int hypre_CSRMatrixResNormFro(hypre_CSRMatrix *A, HYPRE_Real *norm_io); -HYPRE_Int hypre_ParCSRMatrixNormFro(hypre_ParCSRMatrix *A, HYPRE_Real *norm_io); -HYPRE_Int hypre_ParCSRMatrixResNormFro(hypre_ParCSRMatrix *A, HYPRE_Real *norm_io); -HYPRE_Int hypre_CSRMatrixTrace(hypre_CSRMatrix *A, HYPRE_Real *trace_io); -HYPRE_Int hypre_CSRMatrixDropInplace(hypre_CSRMatrix *A, HYPRE_Real droptol, HYPRE_Int max_row_nnz); -HYPRE_Int hypre_ILUCSRMatrixInverseSelfPrecondMRGlobal(hypre_CSRMatrix *matA, hypre_CSRMatrix **M, HYPRE_Real droptol, HYPRE_Real tol, HYPRE_Real eps_tol, HYPRE_Int max_row_nnz, HYPRE_Int max_iter, HYPRE_Int print_level ); -HYPRE_Int hypre_ILUParCSRInverseNSH(hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **M, HYPRE_Real *droptol, HYPRE_Real mr_tol, HYPRE_Real nsh_tol, HYPRE_Real eps_tol, HYPRE_Int mr_max_row_nnz, HYPRE_Int nsh_max_row_nnz, HYPRE_Int mr_max_iter, HYPRE_Int nsh_max_iter, HYPRE_Int mr_col_version, HYPRE_Int print_level); -HYPRE_Int hypre_NSHSolveInverse(hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, hypre_ParCSRMatrix *M, hypre_ParVector *ftemp, hypre_ParVector *utemp); -// Accessor functions -HYPRE_Int hypre_ILUGetNumIterations( void *ilu_vdata, HYPRE_Int *num_iterations ); -HYPRE_Int hypre_ILUGetFinalRelativeResidualNorm( void *ilu_vdata, HYPRE_Real *res_norm ); +HYPRE_Int hypre_CSRMatrixNormFro( hypre_CSRMatrix *A, HYPRE_Real *norm_io); +HYPRE_Int hypre_CSRMatrixResNormFro( hypre_CSRMatrix *A, HYPRE_Real *norm_io); +HYPRE_Int hypre_ParCSRMatrixNormFro( hypre_ParCSRMatrix *A, HYPRE_Real *norm_io); +HYPRE_Int hypre_ParCSRMatrixResNormFro( hypre_ParCSRMatrix *A, HYPRE_Real *norm_io); +HYPRE_Int hypre_CSRMatrixTrace( hypre_CSRMatrix *A, HYPRE_Real *trace_io); +HYPRE_Int hypre_CSRMatrixDropInplace( hypre_CSRMatrix *A, HYPRE_Real droptol, + HYPRE_Int max_row_nnz ); +HYPRE_Int hypre_ILUCSRMatrixInverseSelfPrecondMRGlobal( hypre_CSRMatrix *matA, + hypre_CSRMatrix **M, + HYPRE_Real droptol, HYPRE_Real tol, + HYPRE_Real eps_tol, HYPRE_Int max_row_nnz, + HYPRE_Int max_iter, + HYPRE_Int print_level ); +HYPRE_Int hypre_ILUParCSRInverseNSH( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **M, + HYPRE_Real *droptol, HYPRE_Real mr_tol, + HYPRE_Real nsh_tol, HYPRE_Real eps_tol, + HYPRE_Int mr_max_row_nnz, HYPRE_Int nsh_max_row_nnz, + HYPRE_Int mr_max_iter, HYPRE_Int nsh_max_iter, + HYPRE_Int mr_col_version, HYPRE_Int print_level ); + +/* par_ilu_setup.c */ +HYPRE_Int hypre_ILUSetup( void *ilu_vdata, hypre_ParCSRMatrix *A, + hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int hypre_ParILUExtractEBFC( hypre_CSRMatrix *A_diag, HYPRE_Int nLU, + hypre_CSRMatrix **Bp, hypre_CSRMatrix **Cp, + hypre_CSRMatrix **Ep, hypre_CSRMatrix **Fp ); +HYPRE_Int hypre_ParILURAPReorder( hypre_ParCSRMatrix *A, HYPRE_Int *perm, + HYPRE_Int *rqperm, hypre_ParCSRMatrix **A_pq ); +HYPRE_Int hypre_ILUSetupLDUtoCusparse( hypre_ParCSRMatrix *L, HYPRE_Real *D, + hypre_ParCSRMatrix *U, hypre_ParCSRMatrix **LDUp ); +HYPRE_Int hypre_ILUSetupRAPMILU0( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **ALUp, + HYPRE_Int modified ); +HYPRE_Int hypre_ILUSetupRAPILU0Device( hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int n, + HYPRE_Int nLU, hypre_ParCSRMatrix **Apermptr, + hypre_ParCSRMatrix **matSptr, hypre_CSRMatrix **ALUptr, + hypre_CSRMatrix **BLUptr, hypre_CSRMatrix **CLUptr, + hypre_CSRMatrix **Eptr, hypre_CSRMatrix **Fptr, + HYPRE_Int test_opt ); +HYPRE_Int hypre_ILUSetupRAPILU0( hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int n, + HYPRE_Int nLU, hypre_ParCSRMatrix **Lptr, HYPRE_Real **Dptr, + hypre_ParCSRMatrix **Uptr, hypre_ParCSRMatrix **mLptr, + HYPRE_Real **mDptr, hypre_ParCSRMatrix **mUptr, + HYPRE_Int **u_end ); +HYPRE_Int hypre_ILUSetupILU0( hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int *qperm, + HYPRE_Int nLU, HYPRE_Int nI, hypre_ParCSRMatrix **Lptr, + HYPRE_Real **Dptr, hypre_ParCSRMatrix **Uptr, + hypre_ParCSRMatrix **Sptr, HYPRE_Int **u_end ); +HYPRE_Int hypre_ILUSetupMILU0( hypre_ParCSRMatrix *A, HYPRE_Int *permp, + HYPRE_Int *qpermp, HYPRE_Int nLU, HYPRE_Int nI, + hypre_ParCSRMatrix **Lptr, HYPRE_Real **Dptr, + hypre_ParCSRMatrix **Uptr, hypre_ParCSRMatrix **Sptr, + HYPRE_Int **u_end, HYPRE_Int modified ); +HYPRE_Int hypre_ILUSetupILUKSymbolic( HYPRE_Int n, HYPRE_Int *A_diag_i, HYPRE_Int *A_diag_j, + HYPRE_Int lfil, HYPRE_Int *perm, HYPRE_Int *rperm, + HYPRE_Int *iw, HYPRE_Int nLU, HYPRE_Int *L_diag_i, + HYPRE_Int *U_diag_i, HYPRE_Int *S_diag_i, + HYPRE_Int **L_diag_j, HYPRE_Int **U_diag_j, + HYPRE_Int **S_diag_j, HYPRE_Int **u_end ); +HYPRE_Int hypre_ILUSetupILUK( hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *permp, + HYPRE_Int *qpermp, HYPRE_Int nLU, HYPRE_Int nI, + hypre_ParCSRMatrix **Lptr, HYPRE_Real **Dptr, + hypre_ParCSRMatrix **Uptr, hypre_ParCSRMatrix **Sptr, + HYPRE_Int **u_end ); +HYPRE_Int hypre_ILUSetupILUT( hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, + HYPRE_Int *permp, HYPRE_Int *qpermp, HYPRE_Int nLU, + HYPRE_Int nI, hypre_ParCSRMatrix **Lptr, HYPRE_Real **Dptr, + hypre_ParCSRMatrix **Uptr, hypre_ParCSRMatrix **Sptr, + HYPRE_Int **u_end ); +HYPRE_Int hypre_NSHSetup( void *nsh_vdata, hypre_ParCSRMatrix *A, + hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int hypre_ILUSetupILU0RAS( hypre_ParCSRMatrix *A, HYPRE_Int *perm, + HYPRE_Int nLU, hypre_ParCSRMatrix **Lptr, + HYPRE_Real **Dptr, hypre_ParCSRMatrix **Uptr ); +HYPRE_Int hypre_ILUSetupILUKRASSymbolic( HYPRE_Int n, HYPRE_Int *A_diag_i, HYPRE_Int *A_diag_j, + HYPRE_Int *A_offd_i, HYPRE_Int *A_offd_j, + HYPRE_Int *E_i, HYPRE_Int *E_j, HYPRE_Int ext, + HYPRE_Int lfil, HYPRE_Int *perm, HYPRE_Int *rperm, + HYPRE_Int *iw, HYPRE_Int nLU, HYPRE_Int *L_diag_i, + HYPRE_Int *U_diag_i, HYPRE_Int **L_diag_j, + HYPRE_Int **U_diag_j ); +HYPRE_Int hypre_ILUSetupILUKRAS( hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *perm, + HYPRE_Int nLU, hypre_ParCSRMatrix **Lptr, + HYPRE_Real **Dptr, hypre_ParCSRMatrix **Uptr ); +HYPRE_Int hypre_ILUSetupILUTRAS( hypre_ParCSRMatrix *A, HYPRE_Int lfil, + HYPRE_Real *tol, HYPRE_Int *perm, HYPRE_Int nLU, + hypre_ParCSRMatrix **Lptr, HYPRE_Real **Dptr, + hypre_ParCSRMatrix **Uptr ); + +/* par_ilu_setup_device.c */ +#if defined(HYPRE_USING_GPU) +HYPRE_Int hypre_ILUSetupDevice(hypre_ParILUData *ilu_data, hypre_ParCSRMatrix *A, + HYPRE_Int *perm_data, HYPRE_Int *qperm_data, + HYPRE_Int n, HYPRE_Int nLU, hypre_CSRMatrix **BLUptr, + hypre_ParCSRMatrix **matSptr, hypre_CSRMatrix **Eptr, + hypre_CSRMatrix **Fptr); +HYPRE_Int hypre_ILUSetupIterativeILU0Device( hypre_CSRMatrix *A, HYPRE_Int type, + HYPRE_Int option, HYPRE_Int max_iter, + HYPRE_Real tolerance, HYPRE_Int *num_iter_ptr, + HYPRE_Real **history_ptr ); +#endif + +/* par_ilu_solve.c */ +HYPRE_Int hypre_ILUSolve( void *ilu_vdata, hypre_ParCSRMatrix *A, + hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int hypre_ILUSolveSchurGMRES( hypre_ParCSRMatrix *A, hypre_ParVector *f, + hypre_ParVector *u, HYPRE_Int *perm, + HYPRE_Int *qperm, HYPRE_Int nLU, + hypre_ParCSRMatrix *L, HYPRE_Real *D, + hypre_ParCSRMatrix *U, hypre_ParCSRMatrix *S, + hypre_ParVector *ftemp, hypre_ParVector *utemp, + HYPRE_Solver schur_solver, HYPRE_Solver schur_precond, + hypre_ParVector *rhs, hypre_ParVector *x, HYPRE_Int *u_end ); +HYPRE_Int hypre_ILUSolveSchurNSH( hypre_ParCSRMatrix *A, hypre_ParVector *f, + hypre_ParVector *u, HYPRE_Int *perm, HYPRE_Int nLU, + hypre_ParCSRMatrix *L, HYPRE_Real *D, + hypre_ParCSRMatrix *U, hypre_ParCSRMatrix *S, + hypre_ParVector *ftemp, hypre_ParVector *utemp, + HYPRE_Solver schur_solver, hypre_ParVector *rhs, + hypre_ParVector *x, HYPRE_Int *u_end ); +HYPRE_Int hypre_ILUSolveLU( hypre_ParCSRMatrix *A, hypre_ParVector *f, + hypre_ParVector *u, HYPRE_Int *perm, HYPRE_Int nLU, + hypre_ParCSRMatrix *L, HYPRE_Real *D, hypre_ParCSRMatrix *U, + hypre_ParVector *ftemp, hypre_ParVector *utemp ); +HYPRE_Int hypre_ILUSolveLUIter( hypre_ParCSRMatrix *A, hypre_ParVector *f, + hypre_ParVector *u, HYPRE_Int *perm, HYPRE_Int nLU, + hypre_ParCSRMatrix *L, HYPRE_Real *D, hypre_ParCSRMatrix *U, + hypre_ParVector *ftemp, hypre_ParVector *utemp, + HYPRE_Int lower_jacobi_iters, HYPRE_Int upper_jacobi_iters ); +HYPRE_Int hypre_ILUSolveLURAS( hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, + HYPRE_Int *perm, hypre_ParCSRMatrix *L, HYPRE_Real *D, + hypre_ParCSRMatrix *U, hypre_ParVector *ftemp, + hypre_ParVector *utemp, HYPRE_Real *fext, HYPRE_Real *uext ); +HYPRE_Int hypre_ILUSolveRAPGMRESHost( hypre_ParCSRMatrix *A, hypre_ParVector *f, + hypre_ParVector *u, HYPRE_Int *perm, HYPRE_Int nLU, + hypre_ParCSRMatrix *L, HYPRE_Real *D, hypre_ParCSRMatrix *U, + hypre_ParCSRMatrix *mL, HYPRE_Real *mD, + hypre_ParCSRMatrix *mU, hypre_ParVector *ftemp, + hypre_ParVector *utemp, hypre_ParVector *xtemp, + hypre_ParVector *ytemp, HYPRE_Solver schur_solver, + HYPRE_Solver schur_precond, hypre_ParVector *rhs, + hypre_ParVector *x, HYPRE_Int *u_end ); +HYPRE_Int hypre_NSHSolve( void *nsh_vdata, hypre_ParCSRMatrix *A, + hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int hypre_NSHSolveInverse( hypre_ParCSRMatrix *A, hypre_ParVector *f, + hypre_ParVector *u, hypre_ParCSRMatrix *M, + hypre_ParVector *ftemp, hypre_ParVector *utemp ); + +/* par_ilu_solve_device.c */ +#if defined(HYPRE_USING_GPU) +HYPRE_Int hypre_ILUSolveLUDevice( hypre_ParCSRMatrix *A, hypre_CSRMatrix *matLU_d, + hypre_ParVector *f, hypre_ParVector *u, + HYPRE_Int *perm, hypre_ParVector *ftemp, + hypre_ParVector *utemp ); +HYPRE_Int hypre_ILUApplyLowerJacIterDevice( hypre_CSRMatrix *A, hypre_Vector *input, + hypre_Vector *work, hypre_Vector *output, + HYPRE_Int lower_jacobi_iters ); +HYPRE_Int hypre_ILUApplyUpperJacIterDevice( hypre_CSRMatrix *A, hypre_Vector *input, + hypre_Vector *work, hypre_Vector *output, + hypre_Vector *diag, HYPRE_Int upper_jacobi_iters ); +HYPRE_Int hypre_ILUApplyLowerUpperJacIterDevice( hypre_CSRMatrix *A, hypre_Vector *work1, + hypre_Vector *work2, hypre_Vector *inout, + hypre_Vector *diag, HYPRE_Int lower_jacobi_iters, + HYPRE_Int upper_jacobi_iters ); +HYPRE_Int hypre_ILUSolveLUIterDevice( hypre_ParCSRMatrix *A, hypre_CSRMatrix *matLU, + hypre_ParVector *f, hypre_ParVector *u, + HYPRE_Int *perm, hypre_ParVector *ftemp, + hypre_ParVector *utemp, hypre_ParVector *xtemp, + hypre_Vector **diag_ptr, HYPRE_Int lower_jacobi_iters, + HYPRE_Int upper_jacobi_iters ); +HYPRE_Int hypre_ParILUSchurGMRESMatvecDevice( void *matvec_data, HYPRE_Complex alpha, + void *ilu_vdata, void *x, + HYPRE_Complex beta, void *y ); +HYPRE_Int hypre_ILUSolveSchurGMRESDevice( hypre_ParCSRMatrix *A, hypre_ParVector *f, + hypre_ParVector *u, HYPRE_Int *perm, + HYPRE_Int nLU, hypre_ParCSRMatrix *S, + hypre_ParVector *ftemp, hypre_ParVector *utemp, + HYPRE_Solver schur_solver, HYPRE_Solver schur_precond, + hypre_ParVector *rhs, hypre_ParVector *x, + HYPRE_Int *u_end, hypre_CSRMatrix *matBLU_d, + hypre_CSRMatrix *matE_d, hypre_CSRMatrix *matF_d ); +HYPRE_Int hypre_ILUSolveSchurGMRESJacIterDevice( hypre_ParCSRMatrix *A, hypre_ParVector *f, + hypre_ParVector *u, HYPRE_Int *perm, + HYPRE_Int nLU, hypre_ParCSRMatrix *S, + hypre_ParVector *ftemp, hypre_ParVector *utemp, + HYPRE_Solver schur_solver, + HYPRE_Solver schur_precond, + hypre_ParVector *rhs, hypre_ParVector *x, + HYPRE_Int *u_end, hypre_CSRMatrix *matBLU_d, + hypre_CSRMatrix *matE_d, hypre_CSRMatrix *matF_d, + hypre_ParVector *ztemp, + hypre_Vector **Adiag_diag, + hypre_Vector **Sdiag_diag, + HYPRE_Int lower_jacobi_iters, + HYPRE_Int upper_jacobi_iters ); +HYPRE_Int hypre_ParILUSchurGMRESMatvecJacIterDevice( void *matvec_data, HYPRE_Complex alpha, + void *ilu_vdata, void *x, HYPRE_Complex beta, + void *y ); +HYPRE_Int hypre_ILUSolveRAPGMRESDevice( hypre_ParCSRMatrix *A, hypre_ParVector *f, + hypre_ParVector *u, HYPRE_Int *perm, HYPRE_Int nLU, + hypre_ParCSRMatrix *S, hypre_ParVector *ftemp, + hypre_ParVector *utemp, hypre_ParVector *xtemp, + hypre_ParVector *ytemp, HYPRE_Solver schur_solver, + HYPRE_Solver schur_precond, hypre_ParVector *rhs, + hypre_ParVector *x, HYPRE_Int *u_end, + hypre_ParCSRMatrix *Aperm, hypre_CSRMatrix *matALU_d, + hypre_CSRMatrix *matBLU_d, hypre_CSRMatrix *matE_d, + hypre_CSRMatrix *matF_d, HYPRE_Int test_opt ); +#endif /* par_amgdd.c */ void *hypre_BoomerAMGDDCreate ( void ); HYPRE_Int hypre_BoomerAMGDDDestroy ( void *data ); -HYPRE_Int hypre_BoomerAMGDDSetStartLevel ( void *data , HYPRE_Int start_level ); -HYPRE_Int hypre_BoomerAMGDDGetStartLevel ( void *data , HYPRE_Int *start_level ); -HYPRE_Int hypre_BoomerAMGDDSetFACNumCycles ( void *data , HYPRE_Int fac_num_cycles ); -HYPRE_Int hypre_BoomerAMGDDGetFACNumCycles ( void *data , HYPRE_Int *fac_num_cycles ); -HYPRE_Int hypre_BoomerAMGDDSetFACCycleType ( void *data , HYPRE_Int fac_cycle_type ); -HYPRE_Int hypre_BoomerAMGDDGetFACCycleType ( void *data , HYPRE_Int *fac_cycle_type ); -HYPRE_Int hypre_BoomerAMGDDSetFACNumRelax ( void *data , HYPRE_Int fac_num_relax ); -HYPRE_Int hypre_BoomerAMGDDGetFACNumRelax ( void *data , HYPRE_Int *fac_num_relax ); -HYPRE_Int hypre_BoomerAMGDDSetFACRelaxType ( void *data , HYPRE_Int fac_relax_type ); -HYPRE_Int hypre_BoomerAMGDDGetFACRelaxType ( void *data , HYPRE_Int *fac_relax_type ); -HYPRE_Int hypre_BoomerAMGDDSetFACRelaxWeight ( void *data , HYPRE_Real fac_relax_weight ); -HYPRE_Int hypre_BoomerAMGDDGetFACRelaxWeight ( void *data , HYPRE_Real *fac_relax_weight ); -HYPRE_Int hypre_BoomerAMGDDSetPadding ( void *data , HYPRE_Int padding ); -HYPRE_Int hypre_BoomerAMGDDGetPadding ( void *data , HYPRE_Int *padding ); -HYPRE_Int hypre_BoomerAMGDDSetNumGhostLayers ( void *data , HYPRE_Int num_ghost_layers ); -HYPRE_Int hypre_BoomerAMGDDGetNumGhostLayers ( void *data , HYPRE_Int *num_ghost_layers ); -HYPRE_Int hypre_BoomerAMGDDSetUserFACRelaxation( void *data , HYPRE_Int (*userFACRelaxation)( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ) ); -HYPRE_Int hypre_BoomerAMGDDGetAMG ( void *data , void **amg_solver ); +HYPRE_Int hypre_BoomerAMGDDSetStartLevel ( void *data, HYPRE_Int start_level ); +HYPRE_Int hypre_BoomerAMGDDGetStartLevel ( void *data, HYPRE_Int *start_level ); +HYPRE_Int hypre_BoomerAMGDDSetFACNumCycles ( void *data, HYPRE_Int fac_num_cycles ); +HYPRE_Int hypre_BoomerAMGDDGetFACNumCycles ( void *data, HYPRE_Int *fac_num_cycles ); +HYPRE_Int hypre_BoomerAMGDDSetFACCycleType ( void *data, HYPRE_Int fac_cycle_type ); +HYPRE_Int hypre_BoomerAMGDDGetFACCycleType ( void *data, HYPRE_Int *fac_cycle_type ); +HYPRE_Int hypre_BoomerAMGDDSetFACNumRelax ( void *data, HYPRE_Int fac_num_relax ); +HYPRE_Int hypre_BoomerAMGDDGetFACNumRelax ( void *data, HYPRE_Int *fac_num_relax ); +HYPRE_Int hypre_BoomerAMGDDSetFACRelaxType ( void *data, HYPRE_Int fac_relax_type ); +HYPRE_Int hypre_BoomerAMGDDGetFACRelaxType ( void *data, HYPRE_Int *fac_relax_type ); +HYPRE_Int hypre_BoomerAMGDDSetFACRelaxWeight ( void *data, HYPRE_Real fac_relax_weight ); +HYPRE_Int hypre_BoomerAMGDDGetFACRelaxWeight ( void *data, HYPRE_Real *fac_relax_weight ); +HYPRE_Int hypre_BoomerAMGDDSetPadding ( void *data, HYPRE_Int padding ); +HYPRE_Int hypre_BoomerAMGDDGetPadding ( void *data, HYPRE_Int *padding ); +HYPRE_Int hypre_BoomerAMGDDSetNumGhostLayers ( void *data, HYPRE_Int num_ghost_layers ); +HYPRE_Int hypre_BoomerAMGDDGetNumGhostLayers ( void *data, HYPRE_Int *num_ghost_layers ); +HYPRE_Int hypre_BoomerAMGDDSetUserFACRelaxation( void *data, + HYPRE_Int (*userFACRelaxation)( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ) ); +HYPRE_Int hypre_BoomerAMGDDGetAMG ( void *data, void **amg_solver ); /* par_amgdd_solve.c */ -HYPRE_Int hypre_BoomerAMGDDSolve ( void *solver, hypre_ParCSRMatrix *A, hypre_ParVector *b,hypre_ParVector *x ); +HYPRE_Int hypre_BoomerAMGDDSolve ( void *solver, hypre_ParCSRMatrix *A, hypre_ParVector *b, + hypre_ParVector *x ); HYPRE_Int hypre_BoomerAMGDD_Cycle ( hypre_ParAMGDDData *amgdd_data ); HYPRE_Int hypre_BoomerAMGDD_ResidualCommunication ( hypre_ParAMGDDData *amgdd_data ); -HYPRE_Complex* hypre_BoomerAMGDD_PackResidualBuffer ( hypre_AMGDDCompGrid **compGrid, hypre_AMGDDCommPkg *compGridCommPkg, HYPRE_Int current_level, HYPRE_Int proc ); -HYPRE_Int hypre_BoomerAMGDD_UnpackResidualBuffer ( HYPRE_Complex *buffer, hypre_AMGDDCompGrid **compGrid, hypre_AMGDDCommPkg *compGridCommPkg, HYPRE_Int current_level, HYPRE_Int proc ); +HYPRE_Complex* hypre_BoomerAMGDD_PackResidualBuffer ( hypre_AMGDDCompGrid **compGrid, + hypre_AMGDDCommPkg *compGridCommPkg, HYPRE_Int current_level, HYPRE_Int proc ); +HYPRE_Int hypre_BoomerAMGDD_UnpackResidualBuffer ( HYPRE_Complex *buffer, + hypre_AMGDDCompGrid **compGrid, hypre_AMGDDCommPkg *compGridCommPkg, HYPRE_Int current_level, + HYPRE_Int proc ); /* par_amgdd_setup.c */ -HYPRE_Int hypre_BoomerAMGDDSetup ( void *amgdd_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ); +HYPRE_Int hypre_BoomerAMGDDSetup ( void *amgdd_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *b, + hypre_ParVector *x ); /* par_amgdd_fac_cycle.c */ HYPRE_Int hypre_BoomerAMGDD_FAC ( void *amgdd_vdata, HYPRE_Int first_iteration ); -HYPRE_Int hypre_BoomerAMGDD_FAC_Cycle ( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_type, HYPRE_Int first_iteration ); +HYPRE_Int hypre_BoomerAMGDD_FAC_Cycle ( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_type, + HYPRE_Int first_iteration ); HYPRE_Int hypre_BoomerAMGDD_FAC_FCycle ( void *amgdd_vdata, HYPRE_Int first_iteration ); -HYPRE_Int hypre_BoomerAMGDD_FAC_Interpolate ( hypre_AMGDDCompGrid *compGrid_f, hypre_AMGDDCompGrid *compGrid_c ); -HYPRE_Int hypre_BoomerAMGDD_FAC_Restrict ( hypre_AMGDDCompGrid *compGrid_f, hypre_AMGDDCompGrid *compGrid_c, HYPRE_Int first_iteration ); +HYPRE_Int hypre_BoomerAMGDD_FAC_Interpolate ( hypre_AMGDDCompGrid *compGrid_f, + hypre_AMGDDCompGrid *compGrid_c ); +HYPRE_Int hypre_BoomerAMGDD_FAC_Restrict ( hypre_AMGDDCompGrid *compGrid_f, + hypre_AMGDDCompGrid *compGrid_c, HYPRE_Int first_iteration ); HYPRE_Int hypre_BoomerAMGDD_FAC_Relax ( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ); -HYPRE_Int hypre_BoomerAMGDD_FAC_CFL1JacobiHost ( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int relax_set ); -HYPRE_Int hypre_BoomerAMGDD_FAC_Jacobi ( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ); +HYPRE_Int hypre_BoomerAMGDD_FAC_CFL1JacobiHost ( void *amgdd_vdata, HYPRE_Int level, + HYPRE_Int relax_set ); +HYPRE_Int hypre_BoomerAMGDD_FAC_Jacobi ( void *amgdd_vdata, HYPRE_Int level, + HYPRE_Int cycle_param ); HYPRE_Int hypre_BoomerAMGDD_FAC_JacobiHost ( void *amgdd_vdata, HYPRE_Int level ); -HYPRE_Int hypre_BoomerAMGDD_FAC_GaussSeidel ( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ); -HYPRE_Int hypre_BoomerAMGDD_FAC_CFL1Jacobi ( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ); -HYPRE_Int hypre_BoomerAMGDD_FAC_OrderedGaussSeidel ( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ); +HYPRE_Int hypre_BoomerAMGDD_FAC_GaussSeidel ( void *amgdd_vdata, HYPRE_Int level, + HYPRE_Int cycle_param ); +HYPRE_Int hypre_BoomerAMGDD_FAC_CFL1Jacobi ( void *amgdd_vdata, HYPRE_Int level, + HYPRE_Int cycle_param ); +HYPRE_Int hypre_BoomerAMGDD_FAC_OrderedGaussSeidel ( void *amgdd_vdata, HYPRE_Int level, + HYPRE_Int cycle_param ); /* par_amgdd_fac_cycles_device.c */ HYPRE_Int hypre_BoomerAMGDD_FAC_JacobiDevice ( void *amgdd_vdata, HYPRE_Int level ); -HYPRE_Int hypre_BoomerAMGDD_FAC_CFL1JacobiDevice ( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int relax_set ); +HYPRE_Int hypre_BoomerAMGDD_FAC_CFL1JacobiDevice ( void *amgdd_vdata, HYPRE_Int level, + HYPRE_Int relax_set ); /* par_amgdd_comp_grid.c */ -hypre_AMGDDCompGridMatrix* hypre_AMGDDCompGridMatrixCreate(); +hypre_AMGDDCompGridMatrix* hypre_AMGDDCompGridMatrixCreate( void ); HYPRE_Int hypre_AMGDDCompGridMatrixDestroy ( hypre_AMGDDCompGridMatrix *matrix ); -HYPRE_Int hypre_AMGDDCompGridMatvec ( HYPRE_Complex alpha, hypre_AMGDDCompGridMatrix *A, hypre_AMGDDCompGridVector *x, HYPRE_Complex beta, hypre_AMGDDCompGridVector *y ); -HYPRE_Int hypre_AMGDDCompGridRealMatvec ( HYPRE_Complex alpha, hypre_AMGDDCompGridMatrix *A, hypre_AMGDDCompGridVector *x, HYPRE_Complex beta, hypre_AMGDDCompGridVector *y ); -hypre_AMGDDCompGridVector* hypre_AMGDDCompGridVectorCreate(); -HYPRE_Int hypre_AMGDDCompGridVectorInitialize ( hypre_AMGDDCompGridVector *vector, HYPRE_Int num_owned, HYPRE_Int num_nonowned, HYPRE_Int num_real ); +HYPRE_Int hypre_AMGDDCompGridMatvec ( HYPRE_Complex alpha, hypre_AMGDDCompGridMatrix *A, + hypre_AMGDDCompGridVector *x, HYPRE_Complex beta, hypre_AMGDDCompGridVector *y ); +HYPRE_Int hypre_AMGDDCompGridRealMatvec ( HYPRE_Complex alpha, hypre_AMGDDCompGridMatrix *A, + hypre_AMGDDCompGridVector *x, HYPRE_Complex beta, hypre_AMGDDCompGridVector *y ); +hypre_AMGDDCompGridVector* hypre_AMGDDCompGridVectorCreate( void ); +HYPRE_Int hypre_AMGDDCompGridVectorInitialize ( hypre_AMGDDCompGridVector *vector, + HYPRE_Int num_owned, HYPRE_Int num_nonowned, HYPRE_Int num_real ); HYPRE_Int hypre_AMGDDCompGridVectorDestroy ( hypre_AMGDDCompGridVector *vector ); -HYPRE_Real hypre_AMGDDCompGridVectorInnerProd ( hypre_AMGDDCompGridVector *x, hypre_AMGDDCompGridVector *y ); -HYPRE_Real hypre_AMGDDCompGridVectorRealInnerProd ( hypre_AMGDDCompGridVector *x, hypre_AMGDDCompGridVector *y ); +HYPRE_Real hypre_AMGDDCompGridVectorInnerProd ( hypre_AMGDDCompGridVector *x, + hypre_AMGDDCompGridVector *y ); +HYPRE_Real hypre_AMGDDCompGridVectorRealInnerProd ( hypre_AMGDDCompGridVector *x, + hypre_AMGDDCompGridVector *y ); HYPRE_Int hypre_AMGDDCompGridVectorScale ( HYPRE_Complex alpha, hypre_AMGDDCompGridVector *x ); HYPRE_Int hypre_AMGDDCompGridVectorRealScale ( HYPRE_Complex alpha, hypre_AMGDDCompGridVector *x ); -HYPRE_Int hypre_AMGDDCompGridVectorAxpy ( HYPRE_Complex alpha, hypre_AMGDDCompGridVector *x, hypre_AMGDDCompGridVector *y ); -HYPRE_Int hypre_AMGDDCompGridVectorRealAxpy ( HYPRE_Complex alpha, hypre_AMGDDCompGridVector *x, hypre_AMGDDCompGridVector *y ); -HYPRE_Int hypre_AMGDDCompGridVectorSetConstantValues ( hypre_AMGDDCompGridVector *vector, HYPRE_Complex value ); -HYPRE_Int hypre_AMGDDCompGridVectorRealSetConstantValues ( hypre_AMGDDCompGridVector *vector, HYPRE_Complex value ); -HYPRE_Int hypre_AMGDDCompGridVectorCopy ( hypre_AMGDDCompGridVector *x, hypre_AMGDDCompGridVector *y ); -HYPRE_Int hypre_AMGDDCompGridVectorRealCopy ( hypre_AMGDDCompGridVector *x, hypre_AMGDDCompGridVector *y ); -hypre_AMGDDCompGrid *hypre_AMGDDCompGridCreate(); +HYPRE_Int hypre_AMGDDCompGridVectorAxpy ( HYPRE_Complex alpha, hypre_AMGDDCompGridVector *x, + hypre_AMGDDCompGridVector *y ); +HYPRE_Int hypre_AMGDDCompGridVectorRealAxpy ( HYPRE_Complex alpha, hypre_AMGDDCompGridVector *x, + hypre_AMGDDCompGridVector *y ); +HYPRE_Int hypre_AMGDDCompGridVectorSetConstantValues ( hypre_AMGDDCompGridVector *vector, + HYPRE_Complex value ); +HYPRE_Int hypre_AMGDDCompGridVectorRealSetConstantValues ( hypre_AMGDDCompGridVector *vector, + HYPRE_Complex value ); +HYPRE_Int hypre_AMGDDCompGridVectorCopy ( hypre_AMGDDCompGridVector *x, + hypre_AMGDDCompGridVector *y ); +HYPRE_Int hypre_AMGDDCompGridVectorRealCopy ( hypre_AMGDDCompGridVector *x, + hypre_AMGDDCompGridVector *y ); +hypre_AMGDDCompGrid *hypre_AMGDDCompGridCreate( void ); HYPRE_Int hypre_AMGDDCompGridDestroy ( hypre_AMGDDCompGrid *compGrid ); -HYPRE_Int hypre_AMGDDCompGridInitialize ( hypre_ParAMGDDData *amgdd_data, HYPRE_Int padding, HYPRE_Int level ); +HYPRE_Int hypre_AMGDDCompGridInitialize ( hypre_ParAMGDDData *amgdd_data, HYPRE_Int padding, + HYPRE_Int level ); HYPRE_Int hypre_AMGDDCompGridSetupRelax ( hypre_ParAMGDDData *amgdd_data ); HYPRE_Int hypre_AMGDDCompGridFinalize ( hypre_ParAMGDDData *amgdd_data ); -HYPRE_Int hypre_AMGDDCompGridSetupRealDofMarker ( hypre_AMGDDCompGrid **compGrid, HYPRE_Int num_levels, HYPRE_Int num_ghost_layers ); -HYPRE_Int hypre_AMGDDCompGridResize ( hypre_AMGDDCompGrid *compGrid, HYPRE_Int new_size, HYPRE_Int need_coarse_info ); -HYPRE_Int hypre_AMGDDCompGridSetupLocalIndices ( hypre_AMGDDCompGrid **compGrid, HYPRE_Int *num_added_nodes, HYPRE_Int ****recv_map, HYPRE_Int num_recv_procs, HYPRE_Int **A_tmp_info, HYPRE_Int start_level, HYPRE_Int num_levels ); +HYPRE_Int hypre_AMGDDCompGridSetupRealDofMarker ( hypre_AMGDDCompGrid **compGrid, + HYPRE_Int num_levels, HYPRE_Int num_ghost_layers ); +HYPRE_Int hypre_AMGDDCompGridResize ( hypre_AMGDDCompGrid *compGrid, HYPRE_Int new_size, + HYPRE_Int need_coarse_info ); +HYPRE_Int hypre_AMGDDCompGridSetupLocalIndices ( hypre_AMGDDCompGrid **compGrid, + HYPRE_Int *num_added_nodes, HYPRE_Int ****recv_map, HYPRE_Int num_recv_procs, + HYPRE_Int **A_tmp_info, HYPRE_Int start_level, HYPRE_Int num_levels ); HYPRE_Int hypre_AMGDDCompGridSetupLocalIndicesP ( hypre_ParAMGDDData *amgdd_data ); hypre_AMGDDCommPkg *hypre_AMGDDCommPkgCreate ( HYPRE_Int num_levels ); -HYPRE_Int hypre_AMGDDCommPkgSendLevelDestroy ( hypre_AMGDDCommPkg *amgddCommPkg, HYPRE_Int level, HYPRE_Int proc ); -HYPRE_Int hypre_AMGDDCommPkgRecvLevelDestroy ( hypre_AMGDDCommPkg *amgddCommPkg, HYPRE_Int level, HYPRE_Int proc ); +HYPRE_Int hypre_AMGDDCommPkgSendLevelDestroy ( hypre_AMGDDCommPkg *amgddCommPkg, HYPRE_Int level, + HYPRE_Int proc ); +HYPRE_Int hypre_AMGDDCommPkgRecvLevelDestroy ( hypre_AMGDDCommPkg *amgddCommPkg, HYPRE_Int level, + HYPRE_Int proc ); HYPRE_Int hypre_AMGDDCommPkgDestroy ( hypre_AMGDDCommPkg *compGridCommPkg ); -HYPRE_Int hypre_AMGDDCommPkgFinalize ( hypre_ParAMGData* amg_data, hypre_AMGDDCommPkg *compGridCommPkg, hypre_AMGDDCompGrid **compGrid ); +HYPRE_Int hypre_AMGDDCommPkgFinalize ( hypre_ParAMGData* amg_data, + hypre_AMGDDCommPkg *compGridCommPkg, hypre_AMGDDCompGrid **compGrid ); /* par_amgdd_helpers.c */ -HYPRE_Int hypre_BoomerAMGDD_SetupNearestProcessorNeighbors ( hypre_ParCSRMatrix *A, hypre_AMGDDCommPkg *compGridCommPkg, HYPRE_Int level, HYPRE_Int *padding, HYPRE_Int num_ghost_layers ); -HYPRE_Int hypre_BoomerAMGDD_RecursivelyBuildPsiComposite ( HYPRE_Int node, HYPRE_Int m, hypre_AMGDDCompGrid *compGrid, HYPRE_Int *add_flag, HYPRE_Int use_sort ); -HYPRE_Int hypre_BoomerAMGDD_MarkCoarse ( HYPRE_Int *list, HYPRE_Int *marker, HYPRE_Int *owned_coarse_indices, HYPRE_Int *nonowned_coarse_indices, HYPRE_Int *sort_map, HYPRE_Int num_owned, HYPRE_Int total_num_nodes, HYPRE_Int num_owned_coarse, HYPRE_Int list_size, HYPRE_Int dist, HYPRE_Int use_sort, HYPRE_Int *nodes_to_add ); -HYPRE_Int hypre_BoomerAMGDD_UnpackRecvBuffer ( hypre_ParAMGDDData *amgdd_data, HYPRE_Int *recv_buffer, HYPRE_Int **A_tmp_info, HYPRE_Int *recv_map_send_buffer_size, HYPRE_Int *nodes_added_on_level, HYPRE_Int current_level, HYPRE_Int buffer_number ); -HYPRE_Int* hypre_BoomerAMGDD_PackSendBuffer ( hypre_ParAMGDDData *amgdd_data, HYPRE_Int proc, HYPRE_Int current_level, HYPRE_Int *padding, HYPRE_Int *send_flag_buffer_size ); -HYPRE_Int hypre_BoomerAMGDD_PackRecvMapSendBuffer ( HYPRE_Int *recv_map_send_buffer, HYPRE_Int **recv_red_marker, HYPRE_Int *num_recv_nodes, HYPRE_Int *recv_buffer_size, HYPRE_Int current_level, HYPRE_Int num_levels ); -HYPRE_Int hypre_BoomerAMGDD_UnpackSendFlagBuffer ( hypre_AMGDDCompGrid **compGrid, HYPRE_Int *send_flag_buffer, HYPRE_Int **send_flag, HYPRE_Int *num_send_nodes, HYPRE_Int *send_buffer_size, HYPRE_Int current_level, HYPRE_Int num_levels ); +HYPRE_Int hypre_BoomerAMGDD_SetupNearestProcessorNeighbors ( hypre_ParCSRMatrix *A, + hypre_AMGDDCommPkg *compGridCommPkg, HYPRE_Int level, HYPRE_Int *padding, + HYPRE_Int num_ghost_layers ); +HYPRE_Int hypre_BoomerAMGDD_RecursivelyBuildPsiComposite ( HYPRE_Int node, HYPRE_Int m, + hypre_AMGDDCompGrid *compGrid, HYPRE_Int *add_flag, HYPRE_Int use_sort ); +HYPRE_Int hypre_BoomerAMGDD_MarkCoarse ( HYPRE_Int *list, HYPRE_Int *marker, + HYPRE_Int *owned_coarse_indices, HYPRE_Int *nonowned_coarse_indices, HYPRE_Int *sort_map, + HYPRE_Int num_owned, HYPRE_Int total_num_nodes, HYPRE_Int num_owned_coarse, HYPRE_Int list_size, + HYPRE_Int dist, HYPRE_Int use_sort, HYPRE_Int *nodes_to_add ); +HYPRE_Int hypre_BoomerAMGDD_UnpackRecvBuffer ( hypre_ParAMGDDData *amgdd_data, + HYPRE_Int *recv_buffer, HYPRE_Int **A_tmp_info, HYPRE_Int *recv_map_send_buffer_size, + HYPRE_Int *nodes_added_on_level, HYPRE_Int current_level, HYPRE_Int buffer_number ); +HYPRE_Int* hypre_BoomerAMGDD_PackSendBuffer ( hypre_ParAMGDDData *amgdd_data, HYPRE_Int proc, + HYPRE_Int current_level, HYPRE_Int *padding, HYPRE_Int *send_flag_buffer_size ); +HYPRE_Int hypre_BoomerAMGDD_PackRecvMapSendBuffer ( HYPRE_Int *recv_map_send_buffer, + HYPRE_Int **recv_red_marker, HYPRE_Int *num_recv_nodes, HYPRE_Int *recv_buffer_size, + HYPRE_Int current_level, HYPRE_Int num_levels ); +HYPRE_Int hypre_BoomerAMGDD_UnpackSendFlagBuffer ( hypre_AMGDDCompGrid **compGrid, + HYPRE_Int *send_flag_buffer, HYPRE_Int **send_flag, HYPRE_Int *num_send_nodes, + HYPRE_Int *send_buffer_size, HYPRE_Int current_level, HYPRE_Int num_levels ); HYPRE_Int hypre_BoomerAMGDD_CommunicateRemainingMatrixInfo ( hypre_ParAMGDDData* amgdd_data ); -HYPRE_Int hypre_BoomerAMGDD_FixUpRecvMaps ( hypre_AMGDDCompGrid **compGrid, hypre_AMGDDCommPkg *compGridCommPkg, HYPRE_Int start_level, HYPRE_Int num_levels ); +HYPRE_Int hypre_BoomerAMGDD_FixUpRecvMaps ( hypre_AMGDDCompGrid **compGrid, + hypre_AMGDDCommPkg *compGridCommPkg, HYPRE_Int start_level, HYPRE_Int num_levels ); + +/* par_fsai.c */ +void* hypre_FSAICreate( void ); +HYPRE_Int hypre_FSAIDestroy ( void *data ); +HYPRE_Int hypre_FSAISetAlgoType ( void *data, HYPRE_Int algo_type ); +HYPRE_Int hypre_FSAISetLocalSolveType ( void *data, HYPRE_Int local_solve_type ); +HYPRE_Int hypre_FSAISetMaxSteps ( void *data, HYPRE_Int max_steps ); +HYPRE_Int hypre_FSAISetMaxStepSize ( void *data, HYPRE_Int max_step_size ); +HYPRE_Int hypre_FSAISetMaxNnzRow ( void *data, HYPRE_Int max_nnz_row ); +HYPRE_Int hypre_FSAISetNumLevels ( void *data, HYPRE_Int num_levels ); +HYPRE_Int hypre_FSAISetThreshold ( void *data, HYPRE_Real threshold ); +HYPRE_Int hypre_FSAISetKapTolerance ( void *data, HYPRE_Real kap_tolerance ); +HYPRE_Int hypre_FSAISetMaxIterations ( void *data, HYPRE_Int max_iterations ); +HYPRE_Int hypre_FSAISetEigMaxIters ( void *data, HYPRE_Int eig_max_iters ); +HYPRE_Int hypre_FSAISetZeroGuess ( void *data, HYPRE_Int zero_guess ); +HYPRE_Int hypre_FSAISetTolerance ( void *data, HYPRE_Real tolerance ); +HYPRE_Int hypre_FSAISetOmega ( void *data, HYPRE_Real omega ); +HYPRE_Int hypre_FSAISetLogging ( void *data, HYPRE_Int logging ); +HYPRE_Int hypre_FSAISetNumIterations ( void *data, HYPRE_Int num_iterations ); +HYPRE_Int hypre_FSAISetPrintLevel ( void *data, HYPRE_Int print_level ); +HYPRE_Int hypre_FSAIGetAlgoType ( void *data, HYPRE_Int *algo_type ); +HYPRE_Int hypre_FSAIGetLocalSolveType ( void *data, HYPRE_Int *local_solve_type ); +HYPRE_Int hypre_FSAIGetMaxSteps ( void *data, HYPRE_Int *max_steps ); +HYPRE_Int hypre_FSAIGetMaxStepSize ( void *data, HYPRE_Int *max_step_size ); +HYPRE_Int hypre_FSAIGetMaxNnzRow ( void *data, HYPRE_Int *max_nnz_row ); +HYPRE_Int hypre_FSAIGetNumLevels ( void *data, HYPRE_Int *num_levels ); +HYPRE_Int hypre_FSAIGetThreshold ( void *data, HYPRE_Real *threshold ); +HYPRE_Int hypre_FSAIGetKapTolerance ( void *data, HYPRE_Real *kap_tolerance ); +HYPRE_Int hypre_FSAIGetMaxIterations ( void *data, HYPRE_Int *max_iterations ); +HYPRE_Int hypre_FSAIGetEigMaxIters ( void *data, HYPRE_Int *eig_max_iters ); +HYPRE_Int hypre_FSAIGetZeroGuess ( void *data, HYPRE_Int *zero_guess ); +HYPRE_Int hypre_FSAIGetTolerance ( void *data, HYPRE_Real *tolerance ); +HYPRE_Int hypre_FSAIGetOmega ( void *data, HYPRE_Real *omega ); +HYPRE_Int hypre_FSAIGetLogging ( void *data, HYPRE_Int *logging ); +HYPRE_Int hypre_FSAIGetNumIterations ( void *data, HYPRE_Int *num_iterations ); +HYPRE_Int hypre_FSAIGetPrintLevel ( void *data, HYPRE_Int *print_level ); + +/* par_fsai_setup.c */ +HYPRE_Int hypre_CSRMatrixExtractDenseMat ( hypre_CSRMatrix *A, hypre_Vector *A_sub, + HYPRE_Int *S_Pattern, HYPRE_Int S_nnz, + HYPRE_Int *marker ); +HYPRE_Int hypre_CSRMatrixExtractDenseRow ( hypre_CSRMatrix *A, hypre_Vector *A_subrow, + HYPRE_Int *marker, HYPRE_Int row_num ); +HYPRE_Int hypre_FindKapGrad ( hypre_CSRMatrix *A_diag, hypre_Vector *kaporin_gradient, + HYPRE_Int *kap_grad_nonzeros, hypre_Vector *G_temp, + HYPRE_Int *S_Pattern, HYPRE_Int S_nnz, + HYPRE_Int max_row_size, HYPRE_Int row_num, HYPRE_Int *kg_marker ); +HYPRE_Int hypre_AddToPattern ( hypre_Vector *kaporin_gradient, HYPRE_Int *kap_grad_nonzeros, + HYPRE_Int *S_Pattern, HYPRE_Int *S_nnz, HYPRE_Int *kg_marker, + HYPRE_Int max_step_size ); +HYPRE_Int hypre_FSAISetup ( void *fsai_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, + hypre_ParVector *u ); +HYPRE_Int hypre_FSAISetupNative ( void *fsai_vdata, hypre_ParCSRMatrix *A, + hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int hypre_FSAISetupOMPDyn ( void *fsai_vdata, hypre_ParCSRMatrix *A, + hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int hypre_FSAIPrintStats ( void *fsai_vdata, hypre_ParCSRMatrix *A ); +HYPRE_Int hypre_FSAIComputeOmega ( void *fsai_vdata, hypre_ParCSRMatrix *A ); +void hypre_swap2_ci ( HYPRE_Complex *v, HYPRE_Int *w, HYPRE_Int i, HYPRE_Int j ); +void hypre_qsort2_ci ( HYPRE_Complex *v, HYPRE_Int *w, HYPRE_Int left, HYPRE_Int right ); +HYPRE_Int hypre_FSAIDumpLocalLSDense ( void *fsai_vdata, const char *filename, + hypre_ParCSRMatrix *A ); + +/* par_fsai_solve.c */ +HYPRE_Int hypre_FSAISolve ( void *fsai_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *b, + hypre_ParVector *x ); +HYPRE_Int hypre_FSAIApply ( void *fsai_vdata, HYPRE_Complex alpha, hypre_ParVector *b, + hypre_ParVector *x ); + +/* par_fsai_device.c */ +HYPRE_Int hypre_FSAISetupDevice( void *fsai_vdata, hypre_ParCSRMatrix *A, + hypre_ParVector *f, hypre_ParVector *u ); #ifdef __cplusplus } diff --git a/external/hypre/src/parcsr_ls/ads.c b/external/hypre/src/parcsr_ls/ads.c index 63a2c0f3..b0849e30 100644 --- a/external/hypre/src/parcsr_ls/ads.c +++ b/external/hypre/src/parcsr_ls/ads.c @@ -1,20 +1,40 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ +#include "_hypre_onedpl.hpp" #include "_hypre_parcsr_ls.h" #include "float.h" #include "ams.h" #include "ads.h" #include "_hypre_utilities.hpp" -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) -__global__ void hypreCUDAKernel_AMSComputePi_copy1(HYPRE_Int nnz, HYPRE_Int dim, HYPRE_Int *j_in, HYPRE_Int *j_out); -__global__ void hypreCUDAKernel_AMSComputePi_copy2(HYPRE_Int nrows, HYPRE_Int dim, HYPRE_Int *i_in, HYPRE_Real *data_in, HYPRE_Real *Gx_data, HYPRE_Real *Gy_data, HYPRE_Real *Gz_data, HYPRE_Real *data_out); -__global__ void hypreCUDAKernel_AMSComputePixyz_copy(HYPRE_Int nrows, HYPRE_Int dim, HYPRE_Int *i_in, HYPRE_Real *data_in, HYPRE_Real *Gx_data, HYPRE_Real *Gy_data, HYPRE_Real *Gz_data, HYPRE_Real *data_x_out, HYPRE_Real *data_y_out, HYPRE_Real *data_z_out ); +#if defined(HYPRE_USING_GPU) +#if defined(HYPRE_USING_SYCL) +SYCL_EXTERNAL +#endif +__global__ void hypreGPUKernel_AMSComputePi_copy1(hypre_DeviceItem &item, HYPRE_Int nnz, + HYPRE_Int dim, + HYPRE_Int *j_in, + HYPRE_Int *j_out); +#if defined(HYPRE_USING_SYCL) +SYCL_EXTERNAL +#endif +__global__ void hypreGPUKernel_AMSComputePi_copy2(hypre_DeviceItem &item, HYPRE_Int nrows, + HYPRE_Int dim, + HYPRE_Int *i_in, + HYPRE_Real *data_in, HYPRE_Real *Gx_data, HYPRE_Real *Gy_data, HYPRE_Real *Gz_data, + HYPRE_Real *data_out); +#if defined(HYPRE_USING_SYCL) +SYCL_EXTERNAL +#endif +__global__ void hypreGPUKernel_AMSComputePixyz_copy(hypre_DeviceItem &item, HYPRE_Int nrows, + HYPRE_Int dim, + HYPRE_Int *i_in, HYPRE_Real *data_in, HYPRE_Real *Gx_data, HYPRE_Real *Gy_data, HYPRE_Real *Gz_data, + HYPRE_Real *data_x_out, HYPRE_Real *data_y_out, HYPRE_Real *data_z_out ); #endif /*-------------------------------------------------------------------------- @@ -23,7 +43,7 @@ __global__ void hypreCUDAKernel_AMSComputePixyz_copy(HYPRE_Int nrows, HYPRE_Int * Allocate the ADS solver structure. *--------------------------------------------------------------------------*/ -void * hypre_ADSCreate() +void * hypre_ADSCreate(void) { hypre_ADSData *ads_data; @@ -118,57 +138,101 @@ HYPRE_Int hypre_ADSDestroy(void *solver) } if (ads_data -> A_C) + { hypre_ParCSRMatrixDestroy(ads_data -> A_C); + } if (ads_data -> B_C) + { HYPRE_AMSDestroy(ads_data -> B_C); + } if (ads_data -> owns_Pi && ads_data -> Pi) + { hypre_ParCSRMatrixDestroy(ads_data -> Pi); + } if (ads_data -> A_Pi) + { hypre_ParCSRMatrixDestroy(ads_data -> A_Pi); + } if (ads_data -> B_Pi) + { HYPRE_BoomerAMGDestroy(ads_data -> B_Pi); + } if (ads_data -> owns_Pi && ads_data -> Pix) + { hypre_ParCSRMatrixDestroy(ads_data -> Pix); + } if (ads_data -> A_Pix) + { hypre_ParCSRMatrixDestroy(ads_data -> A_Pix); + } if (ads_data -> B_Pix) + { HYPRE_BoomerAMGDestroy(ads_data -> B_Pix); + } if (ads_data -> owns_Pi && ads_data -> Piy) + { hypre_ParCSRMatrixDestroy(ads_data -> Piy); + } if (ads_data -> A_Piy) + { hypre_ParCSRMatrixDestroy(ads_data -> A_Piy); + } if (ads_data -> B_Piy) + { HYPRE_BoomerAMGDestroy(ads_data -> B_Piy); + } if (ads_data -> owns_Pi && ads_data -> Piz) + { hypre_ParCSRMatrixDestroy(ads_data -> Piz); + } if (ads_data -> A_Piz) + { hypre_ParCSRMatrixDestroy(ads_data -> A_Piz); + } if (ads_data -> B_Piz) + { HYPRE_BoomerAMGDestroy(ads_data -> B_Piz); + } if (ads_data -> r0) + { hypre_ParVectorDestroy(ads_data -> r0); + } if (ads_data -> g0) + { hypre_ParVectorDestroy(ads_data -> g0); + } if (ads_data -> r1) + { hypre_ParVectorDestroy(ads_data -> r1); + } if (ads_data -> g1) + { hypre_ParVectorDestroy(ads_data -> g1); + } if (ads_data -> r2) + { hypre_ParVectorDestroy(ads_data -> r2); + } if (ads_data -> g2) + { hypre_ParVectorDestroy(ads_data -> g2); + } if (ads_data -> zz) + { hypre_ParVectorDestroy(ads_data -> zz); + } hypre_SeqVectorDestroy(ads_data -> A_l1_norms); /* C, G, x, y and z are not destroyed */ if (ads_data) + { hypre_TFree(ads_data, HYPRE_MEMORY_HOST); + } return hypre_error_flag; } @@ -384,7 +448,7 @@ HYPRE_Int hypre_ADSSetSmoothingOptions(void *solver, HYPRE_Int hypre_ADSSetChebySmoothingOptions(void *solver, HYPRE_Int A_cheby_order, - HYPRE_Int A_cheby_fraction) + HYPRE_Real A_cheby_fraction) { hypre_ADSData *ads_data = (hypre_ADSData *) solver; ads_data -> A_cheby_order = A_cheby_order; @@ -471,8 +535,10 @@ HYPRE_Int hypre_ADSComputePi(hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *PiNDz, hypre_ParCSRMatrix **Pi_ptr) { -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(A) ); +#else + HYPRE_UNUSED_VAR(A); #endif hypre_ParCSRMatrix *Pi; @@ -509,7 +575,7 @@ HYPRE_Int hypre_ADSComputePi(hypre_ParCSRMatrix *A, /* Each component of Pi has the sparsity pattern of the topological face-to-vertex matrix. */ hypre_ParCSRMatrix *F2V; -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if (exec == HYPRE_EXEC_DEVICE) { F2V = hypre_ParCSRMatMat(C, G); @@ -524,18 +590,20 @@ HYPRE_Int hypre_ADSComputePi(hypre_ParCSRMatrix *A, { MPI_Comm comm = hypre_ParCSRMatrixComm(F2V); HYPRE_BigInt global_num_rows = hypre_ParCSRMatrixGlobalNumRows(F2V); - HYPRE_BigInt global_num_cols = 3*hypre_ParCSRMatrixGlobalNumCols(F2V); + HYPRE_BigInt global_num_cols = 3 * hypre_ParCSRMatrixGlobalNumCols(F2V); HYPRE_BigInt *row_starts = hypre_ParCSRMatrixRowStarts(F2V); HYPRE_BigInt *col_starts; HYPRE_Int col_starts_size; - HYPRE_Int num_cols_offd = 3*hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(F2V)); - HYPRE_Int num_nonzeros_diag = 3*hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixDiag(F2V)); - HYPRE_Int num_nonzeros_offd = 3*hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixOffd(F2V)); + HYPRE_Int num_cols_offd = 3 * hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(F2V)); + HYPRE_Int num_nonzeros_diag = 3 * hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixDiag(F2V)); + HYPRE_Int num_nonzeros_offd = 3 * hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixOffd(F2V)); HYPRE_BigInt *col_starts_F2V = hypre_ParCSRMatrixColStarts(F2V); col_starts_size = 2; col_starts = hypre_TAlloc(HYPRE_BigInt, col_starts_size, HYPRE_MEMORY_HOST); for (i = 0; i < col_starts_size; i++) + { col_starts[i] = 3 * col_starts_F2V[i]; + } Pi = hypre_ParCSRMatrixCreate(comm, global_num_rows, @@ -564,39 +632,39 @@ HYPRE_Int hypre_ADSComputePi(hypre_ParCSRMatrix *A, HYPRE_Int *Pi_diag_J = hypre_CSRMatrixJ(Pi_diag); HYPRE_Real *Pi_diag_data = hypre_CSRMatrixData(Pi_diag); -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if (exec == HYPRE_EXEC_DEVICE) { - HYPRE_THRUST_CALL( transform, - F2V_diag_I, - F2V_diag_I + F2V_diag_nrows + 1, - Pi_diag_I, - 3 * _1 ); + hypreDevice_IntScalen( F2V_diag_I, F2V_diag_nrows + 1, Pi_diag_I, 3); - dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(F2V_diag_nnz, "thread", bDim); + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(F2V_diag_nnz, "thread", bDim); - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_AMSComputePi_copy1, gDim, bDim, - F2V_diag_nnz, 3, F2V_diag_J, Pi_diag_J ); + HYPRE_GPU_LAUNCH( hypreGPUKernel_AMSComputePi_copy1, gDim, bDim, + F2V_diag_nnz, 3, F2V_diag_J, Pi_diag_J ); - gDim = hypre_GetDefaultCUDAGridDimension(F2V_diag_nrows, "warp", bDim); + gDim = hypre_GetDefaultDeviceGridDimension(F2V_diag_nrows, "warp", bDim); - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_AMSComputePi_copy2, gDim, bDim, - F2V_diag_nrows, 3, F2V_diag_I, NULL, RT100_data, RT010_data, RT001_data, - Pi_diag_data ); + HYPRE_GPU_LAUNCH( hypreGPUKernel_AMSComputePi_copy2, gDim, bDim, + F2V_diag_nrows, 3, F2V_diag_I, NULL, RT100_data, RT010_data, RT001_data, + Pi_diag_data ); } else #endif { - for (i = 0; i < F2V_diag_nrows+1; i++) + for (i = 0; i < F2V_diag_nrows + 1; i++) + { Pi_diag_I[i] = 3 * F2V_diag_I[i]; + } for (i = 0; i < F2V_diag_nnz; i++) for (d = 0; d < 3; d++) - Pi_diag_J[3*i+d] = 3*F2V_diag_J[i]+d; + { + Pi_diag_J[3 * i + d] = 3 * F2V_diag_J[i] + d; + } for (i = 0; i < F2V_diag_nrows; i++) - for (j = F2V_diag_I[i]; j < F2V_diag_I[i+1]; j++) + for (j = F2V_diag_I[i]; j < F2V_diag_I[i + 1]; j++) { *Pi_diag_data++ = RT100_data[i]; *Pi_diag_data++ = RT010_data[i]; @@ -623,43 +691,43 @@ HYPRE_Int hypre_ADSComputePi(hypre_ParCSRMatrix *A, HYPRE_BigInt *F2V_cmap = hypre_ParCSRMatrixColMapOffd(F2V); HYPRE_BigInt *Pi_cmap = hypre_ParCSRMatrixColMapOffd(Pi); -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if (exec == HYPRE_EXEC_DEVICE) { if (F2V_offd_ncols) { - HYPRE_THRUST_CALL( transform, - F2V_offd_I, - F2V_offd_I + F2V_offd_nrows + 1, - Pi_offd_I, - 3 * _1 ); + hypreDevice_IntScalen( F2V_offd_I, F2V_offd_nrows + 1, Pi_offd_I, 3 ); } - dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(F2V_offd_nnz, "thread", bDim); + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(F2V_offd_nnz, "thread", bDim); - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_AMSComputePi_copy1, gDim, bDim, - F2V_offd_nnz, 3, F2V_offd_J, Pi_offd_J ); + HYPRE_GPU_LAUNCH( hypreGPUKernel_AMSComputePi_copy1, gDim, bDim, + F2V_offd_nnz, 3, F2V_offd_J, Pi_offd_J ); - gDim = hypre_GetDefaultCUDAGridDimension(F2V_offd_nrows, "warp", bDim); + gDim = hypre_GetDefaultDeviceGridDimension(F2V_offd_nrows, "warp", bDim); - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_AMSComputePi_copy2, gDim, bDim, - F2V_offd_nrows, 3, F2V_offd_I, NULL, RT100_data, RT010_data, RT001_data, - Pi_offd_data ); + HYPRE_GPU_LAUNCH( hypreGPUKernel_AMSComputePi_copy2, gDim, bDim, + F2V_offd_nrows, 3, F2V_offd_I, NULL, RT100_data, RT010_data, RT001_data, + Pi_offd_data ); } else #endif { if (F2V_offd_ncols) - for (i = 0; i < F2V_offd_nrows+1; i++) + for (i = 0; i < F2V_offd_nrows + 1; i++) + { Pi_offd_I[i] = 3 * F2V_offd_I[i]; + } for (i = 0; i < F2V_offd_nnz; i++) for (d = 0; d < 3; d++) - Pi_offd_J[3*i+d] = 3*F2V_offd_J[i]+d; + { + Pi_offd_J[3 * i + d] = 3 * F2V_offd_J[i] + d; + } for (i = 0; i < F2V_offd_nrows; i++) - for (j = F2V_offd_I[i]; j < F2V_offd_I[i+1]; j++) + for (j = F2V_offd_I[i]; j < F2V_offd_I[i + 1]; j++) { *Pi_offd_data++ = RT100_data[i]; *Pi_offd_data++ = RT010_data[i]; @@ -669,7 +737,9 @@ HYPRE_Int hypre_ADSComputePi(hypre_ParCSRMatrix *A, for (i = 0; i < F2V_offd_ncols; i++) for (d = 0; d < 3; d++) - Pi_cmap[3*i+d] = 3*F2V_cmap[i]+(HYPRE_BigInt)d; + { + Pi_cmap[3 * i + d] = 3 * F2V_cmap[i] + (HYPRE_BigInt)d; + } } hypre_ParCSRMatrixDestroy(F2V); @@ -713,8 +783,10 @@ HYPRE_Int hypre_ADSComputePixyz(hypre_ParCSRMatrix *A, { hypre_ParCSRMatrix *Pix, *Piy, *Piz; -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(A) ); +#else + HYPRE_UNUSED_VAR(A); #endif /* Compute the representations of the coordinate vectors, RT100, RT010 and @@ -750,7 +822,7 @@ HYPRE_Int hypre_ADSComputePixyz(hypre_ParCSRMatrix *A, face-to-vertex matrix. */ hypre_ParCSRMatrix *F2V; -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if (exec == HYPRE_EXEC_DEVICE) { F2V = hypre_ParCSRMatMat(C, G); @@ -830,9 +902,20 @@ HYPRE_Int hypre_ADSComputePixyz(hypre_ParCSRMatrix *A, HYPRE_Int *Piz_diag_J = hypre_CSRMatrixJ(Piz_diag); HYPRE_Real *Piz_diag_data = hypre_CSRMatrixData(Piz_diag); -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if (exec == HYPRE_EXEC_DEVICE) { +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::copy_n, + oneapi::dpl::make_zip_iterator(F2V_diag_I, F2V_diag_I, F2V_diag_I), + F2V_diag_nrows + 1, + oneapi::dpl::make_zip_iterator(Pix_diag_I, Piy_diag_I, Piz_diag_I) ); + + HYPRE_ONEDPL_CALL( std::copy_n, + oneapi::dpl::make_zip_iterator(F2V_diag_J, F2V_diag_J, F2V_diag_J), + F2V_diag_nnz, + oneapi::dpl::make_zip_iterator(Pix_diag_J, Piy_diag_J, Piz_diag_J) ); +#else HYPRE_THRUST_CALL( copy_n, thrust::make_zip_iterator(thrust::make_tuple(F2V_diag_I, F2V_diag_I, F2V_diag_I)), F2V_diag_nrows + 1, @@ -842,18 +925,19 @@ HYPRE_Int hypre_ADSComputePixyz(hypre_ParCSRMatrix *A, thrust::make_zip_iterator(thrust::make_tuple(F2V_diag_J, F2V_diag_J, F2V_diag_J)), F2V_diag_nnz, thrust::make_zip_iterator(thrust::make_tuple(Pix_diag_J, Piy_diag_J, Piz_diag_J)) ); +#endif - dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(F2V_diag_nrows, "warp", bDim); + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(F2V_diag_nrows, "warp", bDim); - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_AMSComputePixyz_copy, gDim, bDim, - F2V_diag_nrows, 3, F2V_diag_I, NULL, RT100_data, RT010_data, RT001_data, - Pix_diag_data, Piy_diag_data, Piz_diag_data ); + HYPRE_GPU_LAUNCH( hypreGPUKernel_AMSComputePixyz_copy, gDim, bDim, + F2V_diag_nrows, 3, F2V_diag_I, NULL, RT100_data, RT010_data, RT001_data, + Pix_diag_data, Piy_diag_data, Piz_diag_data ); } else #endif { - for (i = 0; i < F2V_diag_nrows+1; i++) + for (i = 0; i < F2V_diag_nrows + 1; i++) { Pix_diag_I[i] = F2V_diag_I[i]; Piy_diag_I[i] = F2V_diag_I[i]; @@ -868,7 +952,7 @@ HYPRE_Int hypre_ADSComputePixyz(hypre_ParCSRMatrix *A, } for (i = 0; i < F2V_diag_nrows; i++) - for (j = F2V_diag_I[i]; j < F2V_diag_I[i+1]; j++) + for (j = F2V_diag_I[i]; j < F2V_diag_I[i + 1]; j++) { *Pix_diag_data++ = RT100_data[i]; *Piy_diag_data++ = RT010_data[i]; @@ -907,9 +991,23 @@ HYPRE_Int hypre_ADSComputePixyz(hypre_ParCSRMatrix *A, HYPRE_BigInt *Piy_cmap = hypre_ParCSRMatrixColMapOffd(Piy); HYPRE_BigInt *Piz_cmap = hypre_ParCSRMatrixColMapOffd(Piz); -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if (exec == HYPRE_EXEC_DEVICE) { +#if defined(HYPRE_USING_SYCL) + if (F2V_offd_ncols) + { + HYPRE_ONEDPL_CALL( std::copy_n, + oneapi::dpl::make_zip_iterator(F2V_offd_I, F2V_offd_I, F2V_offd_I), + F2V_offd_nrows + 1, + oneapi::dpl::make_zip_iterator(Pix_offd_I, Piy_offd_I, Piz_offd_I) ); + } + + HYPRE_ONEDPL_CALL( std::copy_n, + oneapi::dpl::make_zip_iterator(F2V_offd_J, F2V_offd_J, F2V_offd_J), + F2V_offd_nnz, + oneapi::dpl::make_zip_iterator(Pix_offd_J, Piy_offd_J, Piz_offd_J) ); +#else if (F2V_offd_ncols) { HYPRE_THRUST_CALL( copy_n, @@ -922,19 +1020,20 @@ HYPRE_Int hypre_ADSComputePixyz(hypre_ParCSRMatrix *A, thrust::make_zip_iterator(thrust::make_tuple(F2V_offd_J, F2V_offd_J, F2V_offd_J)), F2V_offd_nnz, thrust::make_zip_iterator(thrust::make_tuple(Pix_offd_J, Piy_offd_J, Piz_offd_J)) ); +#endif - dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(F2V_offd_nrows, "warp", bDim); + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(F2V_offd_nrows, "warp", bDim); - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_AMSComputePixyz_copy, gDim, bDim, - F2V_offd_nrows, 3, F2V_offd_I, NULL, RT100_data, RT010_data, RT001_data, - Pix_offd_data, Piy_offd_data, Piz_offd_data ); + HYPRE_GPU_LAUNCH( hypreGPUKernel_AMSComputePixyz_copy, gDim, bDim, + F2V_offd_nrows, 3, F2V_offd_I, NULL, RT100_data, RT010_data, RT001_data, + Pix_offd_data, Piy_offd_data, Piz_offd_data ); } else #endif { if (F2V_offd_ncols) - for (i = 0; i < F2V_offd_nrows+1; i++) + for (i = 0; i < F2V_offd_nrows + 1; i++) { Pix_offd_I[i] = F2V_offd_I[i]; Piy_offd_I[i] = F2V_offd_I[i]; @@ -949,7 +1048,7 @@ HYPRE_Int hypre_ADSComputePixyz(hypre_ParCSRMatrix *A, } for (i = 0; i < F2V_offd_nrows; i++) - for (j = F2V_offd_I[i]; j < F2V_offd_I[i+1]; j++) + for (j = F2V_offd_I[i]; j < F2V_offd_I[i + 1]; j++) { *Pix_offd_data++ = RT100_data[i]; *Piy_offd_data++ = RT010_data[i]; @@ -966,9 +1065,13 @@ HYPRE_Int hypre_ADSComputePixyz(hypre_ParCSRMatrix *A, } if (HYPRE_AssumedPartitionCheck()) + { hypre_ParCSRMatrixDestroy(F2V); + } else + { hypre_ParCSRBooleanMatrixDestroy((hypre_ParCSRBooleanMatrix*)F2V); + } } hypre_ParVectorDestroy(RT100); @@ -993,12 +1096,16 @@ HYPRE_Int hypre_ADSComputePixyz(hypre_ParCSRMatrix *A, * - hypre_ADSSetCoordinateVectors() *--------------------------------------------------------------------------*/ -HYPRE_Int hypre_ADSSetup(void *solver, - hypre_ParCSRMatrix *A, - hypre_ParVector *b, - hypre_ParVector *x) +HYPRE_Int +hypre_ADSSetup(void *solver, + hypre_ParCSRMatrix *A, + hypre_ParVector *b, + hypre_ParVector *x) { -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + HYPRE_UNUSED_VAR(b); + HYPRE_UNUSED_VAR(x); + +#if defined(HYPRE_USING_GPU) HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(A) ); #endif @@ -1019,7 +1126,8 @@ HYPRE_Int hypre_ADSSetup(void *solver, ads_data -> A_l1_norms = hypre_SeqVectorCreate(hypre_ParCSRMatrixNumRows(ads_data -> A)); hypre_VectorData(ads_data -> A_l1_norms) = l1_norm_data; - hypre_SeqVectorInitialize_v2(ads_data -> A_l1_norms, hypre_ParCSRMatrixMemoryLocation(ads_data -> A)); + hypre_SeqVectorInitialize_v2(ads_data -> A_l1_norms, + hypre_ParCSRMatrixMemoryLocation(ads_data -> A)); } /* Chebyshev? */ @@ -1100,7 +1208,7 @@ HYPRE_Int hypre_ADSSetup(void *solver, hypre_MatvecCommPkgCreate(ads_data -> A); } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if (exec == HYPRE_EXEC_DEVICE) { ads_data -> A_C = hypre_ParCSRMatrixRAPKT(ads_data -> C, @@ -1129,6 +1237,7 @@ HYPRE_Int hypre_ADSSetup(void *solver, if (ads_data -> Pi == NULL && ads_data -> Pix == NULL) { if (ads_data -> cycle_type > 10) + { /* Construct Pi{x,y,z} instead of Pi = [Pix,Piy,Piz] */ hypre_ADSComputePixyz(ads_data -> A, ads_data -> C, @@ -1142,7 +1251,9 @@ HYPRE_Int hypre_ADSSetup(void *solver, &ads_data -> Pix, &ads_data -> Piy, &ads_data -> Piz); + } else + { /* Construct the Pi interpolation matrix */ hypre_ADSComputePi(ads_data -> A, ads_data -> C, @@ -1154,10 +1265,11 @@ HYPRE_Int hypre_ADSSetup(void *solver, ams_data -> Piy, ams_data -> Piz, &ads_data -> Pi); + } } if (ads_data -> cycle_type > 10) - /* Create the AMG solvers on the range of Pi{x,y,z}^T */ + /* Create the AMG solvers on the range of Pi{x,y,z}^T */ { HYPRE_BoomerAMGCreate(&ads_data -> B_Pix); HYPRE_BoomerAMGSetCoarsenType(ads_data -> B_Pix, ads_data -> B_Pi_coarsen_type); @@ -1209,7 +1321,7 @@ HYPRE_Int hypre_ADSSetup(void *solver, hypre_MatvecCommPkgCreate(ads_data -> Pix); } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if (exec == HYPRE_EXEC_DEVICE) { ads_data -> A_Pix = hypre_ParCSRMatrixRAPKT(ads_data -> Pix, @@ -1234,7 +1346,7 @@ HYPRE_Int hypre_ADSSetup(void *solver, hypre_MatvecCommPkgCreate(ads_data -> Piy); } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if (exec == HYPRE_EXEC_DEVICE) { ads_data -> A_Piy = hypre_ParCSRMatrixRAPKT(ads_data -> Piy, @@ -1259,7 +1371,7 @@ HYPRE_Int hypre_ADSSetup(void *solver, hypre_MatvecCommPkgCreate(ads_data -> Piz); } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if (exec == HYPRE_EXEC_DEVICE) { ads_data -> A_Piz = hypre_ParCSRMatrixRAPKT(ads_data -> Piz, @@ -1280,8 +1392,8 @@ HYPRE_Int hypre_ADSSetup(void *solver, NULL, NULL); } else - /* Create the AMG solver on the range of Pi^T */ { + /* Create the AMG solver on the range of Pi^T */ HYPRE_BoomerAMGCreate(&ads_data -> B_Pi); HYPRE_BoomerAMGSetCoarsenType(ads_data -> B_Pi, ads_data -> B_Pi_coarsen_type); HYPRE_BoomerAMGSetAggNumLevels(ads_data -> B_Pi, ads_data -> B_Pi_agg_levels); @@ -1313,7 +1425,7 @@ HYPRE_Int hypre_ADSSetup(void *solver, hypre_MatvecCommPkgCreate(ads_data -> A); } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if (exec == HYPRE_EXEC_DEVICE) { ads_data -> A_Pi = hypre_ParCSRMatrixRAPKT(ads_data -> Pi, @@ -1373,8 +1485,11 @@ HYPRE_Int hypre_ADSSolve(void *solver, { hypre_ADSData *ads_data = (hypre_ADSData *) solver; - HYPRE_Int i, my_id = -1; - HYPRE_Real r0_norm, r_norm, b_norm, relative_resid = 0, old_resid; + HYPRE_Int i, my_id = -1; + HYPRE_Real r0_norm = 1.0; + HYPRE_Real r_norm = 1.0; + HYPRE_Real b_norm = 1.0; + HYPRE_Real relative_resid = 0, old_resid; char cycle[30]; hypre_ParCSRMatrix *Ai[5], *Pi[5]; @@ -1403,15 +1518,17 @@ HYPRE_Int hypre_ADSSolve(void *solver, ri[3] = ads_data -> r2; gi[3] = ads_data -> g2; ri[4] = ads_data -> r2; gi[4] = ads_data -> g2; -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(A) ); #endif /* may need to create an additional temporary vector for relaxation */ -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if (exec == HYPRE_EXEC_DEVICE) { - needZ = ads_data -> A_relax_type == 2 || ads_data -> A_relax_type == 4 || ads_data -> A_relax_type == 16; + needZ = ads_data -> A_relax_type == 2 || + ads_data -> A_relax_type == 4 || + ads_data -> A_relax_type == 16; } else #endif @@ -1429,49 +1546,63 @@ HYPRE_Int hypre_ADSSolve(void *solver, } if (ads_data -> print_level > 0) + { hypre_MPI_Comm_rank(hypre_ParCSRMatrixComm(A), &my_id); + } switch (ads_data -> cycle_type) { case 1: default: - hypre_sprintf(cycle,"%s","01210"); + hypre_sprintf(cycle, "%s", "01210"); break; + case 2: - hypre_sprintf(cycle,"%s","(0+1+2)"); + hypre_sprintf(cycle, "%s", "(0+1+2)"); break; + case 3: - hypre_sprintf(cycle,"%s","02120"); + hypre_sprintf(cycle, "%s", "02120"); break; + case 4: - hypre_sprintf(cycle,"%s","(010+2)"); + hypre_sprintf(cycle, "%s", "(010+2)"); break; + case 5: - hypre_sprintf(cycle,"%s","0102010"); + hypre_sprintf(cycle, "%s", "0102010"); break; + case 6: - hypre_sprintf(cycle,"%s","(020+1)"); + hypre_sprintf(cycle, "%s", "(020+1)"); break; + case 7: - hypre_sprintf(cycle,"%s","0201020"); + hypre_sprintf(cycle, "%s", "0201020"); break; + case 8: - hypre_sprintf(cycle,"%s","0(+1+2)0"); + hypre_sprintf(cycle, "%s", "0(+1+2)0"); break; + case 9: - hypre_sprintf(cycle,"%s","01210"); + hypre_sprintf(cycle, "%s", "01210"); break; + case 11: - hypre_sprintf(cycle,"%s","013454310"); + hypre_sprintf(cycle, "%s", "013454310"); break; + case 12: - hypre_sprintf(cycle,"%s","(0+1+3+4+5)"); + hypre_sprintf(cycle, "%s", "(0+1+3+4+5)"); break; + case 13: - hypre_sprintf(cycle,"%s","034515430"); + hypre_sprintf(cycle, "%s", "034515430"); break; + case 14: - hypre_sprintf(cycle,"%s","01(+3+4+5)10"); + hypre_sprintf(cycle, "%s", "01(+3+4+5)10"); break; } @@ -1482,13 +1613,17 @@ HYPRE_Int hypre_ADSSolve(void *solver, { hypre_ParVectorCopy(b, ads_data -> r0); hypre_ParCSRMatrixMatvec(-1.0, ads_data -> A, x, 1.0, ads_data -> r0); - r_norm = sqrt(hypre_ParVectorInnerProd(ads_data -> r0,ads_data -> r0)); + r_norm = hypre_sqrt(hypre_ParVectorInnerProd(ads_data -> r0, ads_data -> r0)); r0_norm = r_norm; - b_norm = sqrt(hypre_ParVectorInnerProd(b, b)); + b_norm = hypre_sqrt(hypre_ParVectorInnerProd(b, b)); if (b_norm) + { relative_resid = r_norm / b_norm; + } else + { relative_resid = r_norm; + } if (my_id == 0 && ads_data -> print_level > 0) { hypre_printf(" relative\n"); @@ -1523,14 +1658,18 @@ HYPRE_Int hypre_ADSSolve(void *solver, old_resid = r_norm; hypre_ParVectorCopy(b, ads_data -> r0); hypre_ParCSRMatrixMatvec(-1.0, ads_data -> A, x, 1.0, ads_data -> r0); - r_norm = sqrt(hypre_ParVectorInnerProd(ads_data -> r0,ads_data -> r0)); + r_norm = hypre_sqrt(hypre_ParVectorInnerProd(ads_data -> r0, ads_data -> r0)); if (b_norm) + { relative_resid = r_norm / b_norm; + } else + { relative_resid = r_norm; + } if (my_id == 0 && ads_data -> print_level > 0) hypre_printf(" Cycle %2d %e %f %e \n", - i+1, r_norm, r_norm / old_resid, relative_resid); + i + 1, r_norm, r_norm / old_resid, relative_resid); } if (relative_resid < ads_data -> tol) @@ -1541,14 +1680,18 @@ HYPRE_Int hypre_ADSSolve(void *solver, } if (my_id == 0 && ads_data -> print_level > 0 && ads_data -> maxit > 1) + { hypre_printf("\n\n Average Convergence Factor = %f\n\n", - pow((r_norm/r0_norm),(1.0/(HYPRE_Real) i))); + hypre_pow((r_norm / r0_norm), (1.0 / (HYPRE_Real) i))); + } ads_data -> num_iterations = i; ads_data -> rel_resid_norm = relative_resid; if (ads_data -> num_iterations == ads_data -> maxit && ads_data -> tol > 0.0) + { hypre_error(HYPRE_ERROR_CONV); + } return hypre_error_flag; } diff --git a/external/hypre/src/parcsr_ls/ads.h b/external/hypre/src/parcsr_ls/ads.h index c9c946c9..793e7543 100644 --- a/external/hypre/src/parcsr_ls/ads.h +++ b/external/hypre/src/parcsr_ls/ads.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/parcsr_ls/ame.c b/external/hypre/src/parcsr_ls/ame.c index fd34f4e1..fc7832ab 100644 --- a/external/hypre/src/parcsr_ls/ame.c +++ b/external/hypre/src/parcsr_ls/ame.c @@ -1,10 +1,11 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ +#include "_hypre_onedpl.hpp" #include "_hypre_parcsr_ls.h" #include "float.h" #include "ams.h" @@ -19,7 +20,7 @@ * Allocate the AMS eigensolver structure. *--------------------------------------------------------------------------*/ -void * hypre_AMECreate() +void * hypre_AMECreate(void) { hypre_AMEData *ame_data; @@ -28,6 +29,7 @@ void * hypre_AMECreate() /* Default parameters */ ame_data -> block_size = 1; /* compute 1 eigenvector */ + ame_data -> pcg_maxit = 20; /* perform at most 20 PCG-AMG */ ame_data -> maxit = 100; /* perform at most 100 iterations */ ame_data -> atol = 1e-6; /* absolute convergence tolerance */ ame_data -> rtol = 1e-6; /* relative convergence tolerance */ @@ -84,32 +86,52 @@ HYPRE_Int hypre_AMEDestroy(void *esolver) } if (ame_data -> G) + { hypre_ParCSRMatrixDestroy(ame_data -> G); + } if (ame_data -> A_G) + { hypre_ParCSRMatrixDestroy(ame_data -> A_G); + } if (ame_data -> B1_G) + { HYPRE_BoomerAMGDestroy(ame_data -> B1_G); + } if (ame_data -> B2_G) + { HYPRE_ParCSRPCGDestroy(ame_data -> B2_G); + } if (ame_data -> eigenvalues) + { hypre_TFree(ame_data -> eigenvalues, HYPRE_MEMORY_HOST); + } if (eigenvectors) + { mv_MultiVectorDestroy(eigenvectors); + } if (interpreter) + { hypre_TFree(interpreter, HYPRE_MEMORY_HOST); + } if (ams_data -> beta_is_zero) { if (ame_data -> t1) + { hypre_ParVectorDestroy(ame_data -> t1); + } if (ame_data -> t2) + { hypre_ParVectorDestroy(ame_data -> t2); + } } if (ame_data) + { hypre_TFree(ame_data, HYPRE_MEMORY_HOST); + } /* Fields initialized using the Set functions are not destroyed */ @@ -175,6 +197,20 @@ HYPRE_Int hypre_AMESetMaxIter(void *esolver, return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_AMESetMaxPCGIter + * + * Set the maximum number of iterations. The default value is 20. + *--------------------------------------------------------------------------*/ + +HYPRE_Int hypre_AMESetMaxPCGIter(void *esolver, + HYPRE_Int maxit) +{ + hypre_AMEData *ame_data = (hypre_AMEData *) esolver; + ame_data -> pcg_maxit = maxit; + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- * hypre_AMESetTol * @@ -227,27 +263,28 @@ HYPRE_Int hypre_AMESetPrintLevel(void *esolver, * - hypre_AMESetAMSSolver() * - hypre_AMESetMassMatrix() *--------------------------------------------------------------------------*/ -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) __global__ void -hypreCUDAKernel_GtEliminateBoundary( HYPRE_Int nrows, - HYPRE_Int *Gt_diag_i, - HYPRE_Int *Gt_diag_j, - HYPRE_Complex *Gt_diag_data, - HYPRE_Int *Gt_offd_i, - HYPRE_Int *Gt_offd_j, - HYPRE_Complex *Gt_offd_data, - HYPRE_Int *edge_bc, - HYPRE_Int *edge_bc_offd) +hypreGPUKernel_GtEliminateBoundary( hypre_DeviceItem &item, + HYPRE_Int nrows, + HYPRE_Int *Gt_diag_i, + HYPRE_Int *Gt_diag_j, + HYPRE_Complex *Gt_diag_data, + HYPRE_Int *Gt_offd_i, + HYPRE_Int *Gt_offd_j, + HYPRE_Complex *Gt_offd_data, + HYPRE_Int *edge_bc, + HYPRE_Int *edge_bc_offd) { - HYPRE_Int row_i = hypre_cuda_get_grid_warp_id<1,1>(); + HYPRE_Int row_i = hypre_gpu_get_grid_warp_id<1, 1>(item); if (row_i >= nrows) { return; } - HYPRE_Int lane = hypre_cuda_get_lane_id<1>(); - HYPRE_Int p1, q1, p2 = 0, q2 = 0; + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); + HYPRE_Int p1 = 0, q1, p2 = 0, q2 = 0; bool nonempty_offd = Gt_offd_j != NULL; bool bdr = false; @@ -260,18 +297,19 @@ hypreCUDAKernel_GtEliminateBoundary( HYPRE_Int nrows, } } - q1 = __shfl_sync(HYPRE_WARP_FULL_MASK, p1, 1); - p1 = __shfl_sync(HYPRE_WARP_FULL_MASK, p1, 0); + q1 = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p1, 1); + p1 = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p1, 0); if (nonempty_offd) { - q2 = __shfl_sync(HYPRE_WARP_FULL_MASK, p2, 1); - p2 = __shfl_sync(HYPRE_WARP_FULL_MASK, p2, 0); + q2 = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p2, 1); + p2 = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p2, 0); } - for (HYPRE_Int j = p1 + lane; __any_sync(HYPRE_WARP_FULL_MASK, j < q1); j += HYPRE_WARP_SIZE) + for (HYPRE_Int j = p1 + lane; warp_any_sync(item, HYPRE_WARP_FULL_MASK, j < q1); + j += HYPRE_WARP_SIZE) { const hypre_int k = j < q1 && read_only_load(&edge_bc[read_only_load(&Gt_diag_j[j])]) != 0; - if ( __any_sync(HYPRE_WARP_FULL_MASK, k) ) + if ( warp_any_sync(item, HYPRE_WARP_FULL_MASK, k) ) { bdr = true; break; @@ -280,10 +318,11 @@ hypreCUDAKernel_GtEliminateBoundary( HYPRE_Int nrows, if (!bdr) { - for (HYPRE_Int j = p2 + lane; __any_sync(HYPRE_WARP_FULL_MASK, j < q2); j += HYPRE_WARP_SIZE) + for (HYPRE_Int j = p2 + lane; warp_any_sync(item, HYPRE_WARP_FULL_MASK, j < q2); + j += HYPRE_WARP_SIZE) { const hypre_int k = j < q2 && read_only_load(&edge_bc_offd[read_only_load(&Gt_offd_j[j])]) != 0; - if ( __any_sync(HYPRE_WARP_FULL_MASK, k) ) + if ( warp_any_sync(item, HYPRE_WARP_FULL_MASK, k) ) { bdr = true; break; @@ -325,7 +364,7 @@ HYPRE_Int hypre_AMESetup(void *esolver) ame_data -> t3 = ams_data -> r0; HYPRE_MemoryLocation memory_location = hypre_ParCSRMatrixMemoryLocation(ams_data -> A); -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1(memory_location); #endif @@ -355,27 +394,44 @@ HYPRE_Int hypre_AMESetup(void *esolver) /* A row (edge) is boundary if its off-diag l1 norm is less than eps */ HYPRE_Real eps = DBL_EPSILON * 1e+4; -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if (exec == HYPRE_EXEC_DEVICE) { HYPRE_Real *l1norm_arr = hypre_TAlloc(HYPRE_Real, ne, memory_location); hypre_CSRMatrixExtractDiagonalDevice(Ad, l1norm_arr, 1); +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::transform, + l1norm_arr, + l1norm_arr + ne, + l1norm_arr, + std::negate() ); +#else HYPRE_THRUST_CALL( transform, l1norm_arr, l1norm_arr + ne, l1norm_arr, thrust::negate() ); +#endif hypre_CSRMatrixComputeRowSumDevice(Ad, NULL, NULL, l1norm_arr, 1, 1.0, "add"); if (AoA) { hypre_CSRMatrixComputeRowSumDevice(Ao, NULL, NULL, l1norm_arr, 1, 1.0, "add"); } +#if defined(HYPRE_USING_SYCL) + hypreSycl_transform_if( edge_bc, + edge_bc + ne, + l1norm_arr, + edge_bc, + [] (const auto & x) {return 1;}, + less_than(eps) ); +#else HYPRE_THRUST_CALL( replace_if, edge_bc, edge_bc + ne, l1norm_arr, less_than(eps), 1 ); +#endif hypre_TFree(l1norm_arr, memory_location); } else @@ -385,14 +441,20 @@ HYPRE_Int hypre_AMESetup(void *esolver) for (i = 0; i < ne; i++) { l1_norm = 0.0; - for (j = AdI[i]; j < AdI[i+1]; j++) + for (j = AdI[i]; j < AdI[i + 1]; j++) if (AdJ[j] != i) - l1_norm += fabs(AdA[j]); + { + l1_norm += hypre_abs(AdA[j]); + } if (AoI) - for (j = AoI[i]; j < AoI[i+1]; j++) - l1_norm += fabs(AoA[j]); + for (j = AoI[i]; j < AoI[i + 1]; j++) + { + l1_norm += hypre_abs(AoA[j]); + } if (l1_norm < eps) + { edge_bc[i] = 1; + } } } } @@ -409,24 +471,43 @@ HYPRE_Int hypre_AMESetup(void *esolver) HYPRE_Int num_sends, *int_buf_data; HYPRE_Int index, start; - offd_edge_bc = hypre_TAlloc(HYPRE_Int, hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(Gt)), memory_location); + offd_edge_bc = hypre_TAlloc(HYPRE_Int, hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(Gt)), + memory_location); hypre_MatvecCommPkgCreate(Gt); comm_pkg = hypre_ParCSRMatrixCommPkg(Gt); num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - int_buf_data = hypre_TAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), memory_location ); + int_buf_data = hypre_TAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + memory_location ); -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if (exec == HYPRE_EXEC_DEVICE) { hypre_ParCSRCommPkgCopySendMapElmtsToDevice(comm_pkg); +#if defined(HYPRE_USING_SYCL) + hypreSycl_gather( hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + hypre_ParCSRCommPkgSendMapStart(comm_pkg, + num_sends), + edge_bc, + int_buf_data ); +#else HYPRE_THRUST_CALL( gather, hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), - hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + hypre_ParCSRCommPkgSendMapStart(comm_pkg, + num_sends), edge_bc, int_buf_data ); +#endif + +#if defined(HYPRE_USING_THRUST_NOSYNC) + /* RL: make sure int_buf_data is ready before issuing GPU-GPU MPI */ + if (hypre_GetGpuAwareMPI()) + { + hypre_ForceSyncComputeStream(); + } +#endif } else #endif @@ -435,13 +516,14 @@ HYPRE_Int hypre_AMESetup(void *esolver) for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { - k = hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j); + k = hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j); int_buf_data[index++] = edge_bc[k]; } } } + comm_handle = hypre_ParCSRCommHandleCreate_v2(11, comm_pkg, memory_location, int_buf_data, memory_location, offd_edge_bc); @@ -462,13 +544,13 @@ HYPRE_Int hypre_AMESetup(void *esolver) HYPRE_Int bdr; -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if (exec == HYPRE_EXEC_DEVICE) { - dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(nv, "warp", bDim); - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_GtEliminateBoundary, gDim, bDim, - nv, GtdI, GtdJ, GtdA, GtoI, GtoJ, GtoA, edge_bc, offd_edge_bc ); + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(nv, "warp", bDim); + HYPRE_GPU_LAUNCH( hypreGPUKernel_GtEliminateBoundary, gDim, bDim, + nv, GtdI, GtdJ, GtdA, GtoI, GtoJ, GtoA, edge_bc, offd_edge_bc ); } else #endif @@ -477,21 +559,25 @@ HYPRE_Int hypre_AMESetup(void *esolver) { bdr = 0; /* A vertex is boundary if it belongs to a boundary edge */ - for (j = GtdI[i]; j < GtdI[i+1]; j++) + for (j = GtdI[i]; j < GtdI[i + 1]; j++) if (edge_bc[GtdJ[j]]) { bdr = 1; break; } if (!bdr && GtoI) - for (j = GtoI[i]; j < GtoI[i+1]; j++) + for (j = GtoI[i]; j < GtoI[i + 1]; j++) if (offd_edge_bc[GtoJ[j]]) { bdr = 1; break; } if (bdr) { - for (j = GtdI[i]; j < GtdI[i+1]; j++) + for (j = GtdI[i]; j < GtdI[i + 1]; j++) /* if (!edge_bc[GtdJ[j]]) */ + { GtdA[j] = 0.0; + } if (GtoI) - for (j = GtoI[i]; j < GtoI[i+1]; j++) + for (j = GtoI[i]; j < GtoI[i + 1]; j++) /* if (!offd_edge_bc[GtoJ[j]]) */ + { GtoA[j] = 0.0; + } } } } @@ -506,24 +592,28 @@ HYPRE_Int hypre_AMESetup(void *esolver) /* Compute G^t M G */ { if (!hypre_ParCSRMatrixCommPkg(ame_data -> G)) + { hypre_MatvecCommPkgCreate(ame_data -> G); + } if (!hypre_ParCSRMatrixCommPkg(ame_data -> M)) + { hypre_MatvecCommPkgCreate(ame_data -> M); + } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - if (exec == HYPRE_EXEC_DEVICE) - { - ame_data -> A_G = hypre_ParCSRMatrixRAPKT(ame_data -> G, ame_data -> M, ame_data -> G, 1); - } - else +#if defined(HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_DEVICE) + { + ame_data -> A_G = hypre_ParCSRMatrixRAPKT(ame_data -> G, ame_data -> M, ame_data -> G, 1); + } + else #endif - { - hypre_BoomerAMGBuildCoarseOperator(ame_data -> G, - ame_data -> M, - ame_data -> G, - &ame_data -> A_G); - } + { + hypre_BoomerAMGBuildCoarseOperator(ame_data -> G, + ame_data -> M, + ame_data -> G, + &ame_data -> A_G); + } hypre_ParCSRMatrixFixZeroRows(ame_data -> A_G); } @@ -548,7 +638,7 @@ HYPRE_Int hypre_AMESetup(void *esolver) &ame_data -> B2_G); HYPRE_PCGSetPrintLevel(ame_data -> B2_G, 0); HYPRE_PCGSetTol(ame_data -> B2_G, 1e-12); - HYPRE_PCGSetMaxIter(ame_data -> B2_G, 20); + HYPRE_PCGSetMaxIter(ame_data -> B2_G, ame_data -> pcg_maxit); HYPRE_PCGSetPrecond(ame_data -> B2_G, (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, @@ -594,22 +684,33 @@ HYPRE_Int hypre_AMESetup(void *esolver) { vi = (hypre_ParVector*) v[i]; data = hypre_VectorData(hypre_ParVectorLocalVector(vi)); -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if (exec == HYPRE_EXEC_DEVICE) { +#if defined(HYPRE_USING_SYCL) + hypreSycl_transform_if( data, + data + ne, + edge_bc, + data, + [] (const auto & x) {return 0.0;}, + [] (const auto & x) {return x;} ); +#else HYPRE_THRUST_CALL( replace_if, data, data + ne, edge_bc, thrust::identity(), 0.0 ); +#endif } else #endif { for (j = 0; j < ne; j++) if (edge_bc[j]) + { data[j] = 0.0; + } } hypre_AMEDiscrDivFreeComponent(esolver, vi); } @@ -671,7 +772,7 @@ void hypre_AMEMultiOperatorA(void *data, void* x, void* y) { hypre_AMEData *ame_data = (hypre_AMEData *) data; mv_InterfaceInterpreter* - interpreter = (mv_InterfaceInterpreter*) ame_data -> interpreter; + interpreter = (mv_InterfaceInterpreter*) ame_data -> interpreter; interpreter -> Eval(hypre_AMEOperatorA, data, x, y); } @@ -692,7 +793,7 @@ void hypre_AMEMultiOperatorM(void *data, void* x, void* y) { hypre_AMEData *ame_data = (hypre_AMEData *) data; mv_InterfaceInterpreter* - interpreter = (mv_InterfaceInterpreter*) ame_data -> interpreter; + interpreter = (mv_InterfaceInterpreter*) ame_data -> interpreter; interpreter -> Eval(hypre_AMEOperatorM, data, x, y); } @@ -709,7 +810,7 @@ void hypre_AMEOperatorB(void *data, void* x, void* y) hypre_AMSData *ams_data = ame_data -> precond; hypre_ParVectorSetConstantValues((hypre_ParVector*)y, 0.0); - hypre_AMSSolve(ame_data -> precond, ams_data -> A,(hypre_ParVector*) x,(hypre_ParVector*) y); + hypre_AMSSolve(ame_data -> precond, ams_data -> A, (hypre_ParVector*) x, (hypre_ParVector*) y); hypre_AMEDiscrDivFreeComponent(data, (hypre_ParVector *)y); } @@ -718,7 +819,7 @@ void hypre_AMEMultiOperatorB(void *data, void* x, void* y) { hypre_AMEData *ame_data = (hypre_AMEData *) data; mv_InterfaceInterpreter* - interpreter = (mv_InterfaceInterpreter*) ame_data -> interpreter; + interpreter = (mv_InterfaceInterpreter*) ame_data -> interpreter; interpreter -> Eval(hypre_AMEOperatorB, data, x, y); } @@ -771,7 +872,7 @@ HYPRE_Int hypre_AMEGetEigenvectors(void *esolver, { hypre_AMEData *ame_data = (hypre_AMEData *) esolver; mv_MultiVectorPtr - eigenvectors = (mv_MultiVectorPtr) ame_data -> eigenvectors; + eigenvectors = (mv_MultiVectorPtr) ame_data -> eigenvectors; mv_TempMultiVector* tmp = (mv_TempMultiVector*) mv_MultiVectorGetData(eigenvectors); *eigenvectors_ptr = (HYPRE_ParVector*)(tmp -> vector); diff --git a/external/hypre/src/parcsr_ls/ame.h b/external/hypre/src/parcsr_ls/ame.h index 03c5fe47..70089e50 100644 --- a/external/hypre/src/parcsr_ls/ame.h +++ b/external/hypre/src/parcsr_ls/ame.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -34,6 +34,7 @@ typedef struct HYPRE_Real *eigenvalues; /* Eigensolver (LOBPCG) options */ + HYPRE_Int pcg_maxit; HYPRE_Int maxit; HYPRE_Real atol; HYPRE_Real rtol; diff --git a/external/hypre/src/parcsr_ls/amg_hybrid.c b/external/hypre/src/parcsr_ls/amg_hybrid.c index 208b4e79..5c509cf3 100644 --- a/external/hypre/src/parcsr_ls/amg_hybrid.c +++ b/external/hypre/src/parcsr_ls/amg_hybrid.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -32,8 +32,8 @@ typedef struct HYPRE_Int k_dim; HYPRE_Int pcg_default; /* boolean */ - HYPRE_Int (*pcg_precond_solve)(void*,void*,void*,void*); - HYPRE_Int (*pcg_precond_setup)(void*,void*,void*,void*); + HYPRE_Int (*pcg_precond_solve)(void*, void*, void*, void*); + HYPRE_Int (*pcg_precond_setup)(void*, void*, void*, void*); void *pcg_precond; void *pcg_solver; @@ -92,7 +92,7 @@ typedef struct *--------------------------------------------------------------------------*/ void * -hypre_AMGHybridCreate( ) +hypre_AMGHybridCreate( void ) { hypre_AMGHybridData *AMGhybrid_data; @@ -177,43 +177,43 @@ hypre_AMGHybridDestroy( void *AMGhybrid_vdata ) void *pcg_solver = (AMGhybrid_data -> pcg_solver); void *pcg_precond = (AMGhybrid_data -> pcg_precond); - if (pcg_precond) hypre_BoomerAMGDestroy(pcg_precond); - if (solver_type == 1) hypre_PCGDestroy(pcg_solver); - if (solver_type == 2) hypre_GMRESDestroy(pcg_solver); - if (solver_type == 3) hypre_BiCGSTABDestroy(pcg_solver); + if (pcg_precond) { hypre_BoomerAMGDestroy(pcg_precond); } + if (solver_type == 1) { hypre_PCGDestroy(pcg_solver); } + if (solver_type == 2) { hypre_GMRESDestroy(pcg_solver); } + if (solver_type == 3) { hypre_BiCGSTABDestroy(pcg_solver); } if (AMGhybrid_data -> num_grid_sweeps) { - hypre_TFree( (AMGhybrid_data -> num_grid_sweeps) , HYPRE_MEMORY_HOST); + hypre_TFree( (AMGhybrid_data -> num_grid_sweeps), HYPRE_MEMORY_HOST); (AMGhybrid_data -> num_grid_sweeps) = NULL; } if (AMGhybrid_data -> grid_relax_type) { - hypre_TFree( (AMGhybrid_data -> grid_relax_type) , HYPRE_MEMORY_HOST); + hypre_TFree( (AMGhybrid_data -> grid_relax_type), HYPRE_MEMORY_HOST); (AMGhybrid_data -> grid_relax_type) = NULL; } if (AMGhybrid_data -> grid_relax_points) { - for (i=0; i < 4; i++) + for (i = 0; i < 4; i++) { - hypre_TFree( (AMGhybrid_data -> grid_relax_points)[i] , HYPRE_MEMORY_HOST); + hypre_TFree( (AMGhybrid_data -> grid_relax_points)[i], HYPRE_MEMORY_HOST); } - hypre_TFree( (AMGhybrid_data -> grid_relax_points) , HYPRE_MEMORY_HOST); + hypre_TFree( (AMGhybrid_data -> grid_relax_points), HYPRE_MEMORY_HOST); (AMGhybrid_data -> grid_relax_points) = NULL; } if (AMGhybrid_data -> relax_weight) { - hypre_TFree( (AMGhybrid_data -> relax_weight) , HYPRE_MEMORY_HOST); + hypre_TFree( (AMGhybrid_data -> relax_weight), HYPRE_MEMORY_HOST); (AMGhybrid_data -> relax_weight) = NULL; } if (AMGhybrid_data -> omega) { - hypre_TFree( (AMGhybrid_data -> omega) , HYPRE_MEMORY_HOST); + hypre_TFree( (AMGhybrid_data -> omega), HYPRE_MEMORY_HOST); (AMGhybrid_data -> omega) = NULL; } if (AMGhybrid_data -> dof_func) { - hypre_TFree( (AMGhybrid_data -> dof_func) , HYPRE_MEMORY_HOST); + hypre_TFree( (AMGhybrid_data -> dof_func), HYPRE_MEMORY_HOST); (AMGhybrid_data -> dof_func) = NULL; } hypre_TFree(AMGhybrid_data, HYPRE_MEMORY_HOST); @@ -230,7 +230,7 @@ HYPRE_Int hypre_AMGHybridSetTol( void *AMGhybrid_vdata, HYPRE_Real tol ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; if (!AMGhybrid_data) { @@ -254,7 +254,7 @@ HYPRE_Int hypre_AMGHybridSetAbsoluteTol( void *AMGhybrid_vdata, HYPRE_Real a_tol ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; if (!AMGhybrid_data) { @@ -278,7 +278,7 @@ HYPRE_Int hypre_AMGHybridSetConvergenceTol( void *AMGhybrid_vdata, HYPRE_Real cf_tol ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; if (!AMGhybrid_data) { hypre_error_in_arg(1); @@ -304,7 +304,7 @@ hypre_AMGHybridSetNonGalerkinTol( void *AMGhybrid_vdata, HYPRE_Int nongalerk_num_tol, HYPRE_Real *nongalerkin_tol ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; if (!AMGhybrid_data) { hypre_error_in_arg(1); @@ -330,7 +330,7 @@ HYPRE_Int hypre_AMGHybridSetDSCGMaxIter( void *AMGhybrid_vdata, HYPRE_Int dscg_max_its ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; if (!AMGhybrid_data) { hypre_error_in_arg(1); @@ -355,7 +355,7 @@ HYPRE_Int hypre_AMGHybridSetPCGMaxIter( void *AMGhybrid_vdata, HYPRE_Int pcg_max_its ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; if (!AMGhybrid_data) { hypre_error_in_arg(1); @@ -380,7 +380,7 @@ HYPRE_Int hypre_AMGHybridSetSetupType( void *AMGhybrid_vdata, HYPRE_Int setup_type ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; if (!AMGhybrid_data) { hypre_error_in_arg(1); @@ -400,7 +400,7 @@ HYPRE_Int hypre_AMGHybridSetSolverType( void *AMGhybrid_vdata, HYPRE_Int solver_type ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; if (!AMGhybrid_data) { hypre_error_in_arg(1); @@ -492,7 +492,7 @@ HYPRE_Int hypre_AMGHybridSetKDim( void *AMGhybrid_vdata, HYPRE_Int k_dim ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; if (!AMGhybrid_data) { hypre_error_in_arg(1); @@ -517,7 +517,7 @@ HYPRE_Int hypre_AMGHybridSetStopCrit( void *AMGhybrid_vdata, HYPRE_Int stop_crit ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; if (!AMGhybrid_data) { hypre_error_in_arg(1); @@ -537,7 +537,7 @@ HYPRE_Int hypre_AMGHybridSetTwoNorm( void *AMGhybrid_vdata, HYPRE_Int two_norm ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; if (!AMGhybrid_data) { hypre_error_in_arg(1); @@ -557,7 +557,7 @@ HYPRE_Int hypre_AMGHybridSetRelChange( void *AMGhybrid_vdata, HYPRE_Int rel_change ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; if (!AMGhybrid_data) { hypre_error_in_arg(1); @@ -575,11 +575,11 @@ hypre_AMGHybridSetRelChange( void *AMGhybrid_vdata, HYPRE_Int hypre_AMGHybridSetPrecond( void *pcg_vdata, - HYPRE_Int (*pcg_precond_solve)(void*,void*,void*,void*), - HYPRE_Int (*pcg_precond_setup)(void*,void*,void*,void*), + HYPRE_Int (*pcg_precond_solve)(void*, void*, void*, void*), + HYPRE_Int (*pcg_precond_setup)(void*, void*, void*, void*), void *pcg_precond ) { - hypre_AMGHybridData *pcg_data =(hypre_AMGHybridData *) pcg_vdata; + hypre_AMGHybridData *pcg_data = (hypre_AMGHybridData *) pcg_vdata; if (!pcg_data) { hypre_error_in_arg(1); @@ -602,7 +602,7 @@ HYPRE_Int hypre_AMGHybridSetLogging( void *AMGhybrid_vdata, HYPRE_Int logging ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; if (!AMGhybrid_data) { hypre_error_in_arg(1); @@ -622,7 +622,7 @@ HYPRE_Int hypre_AMGHybridSetPrintLevel( void *AMGhybrid_vdata, HYPRE_Int print_level ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; if (!AMGhybrid_data) { hypre_error_in_arg(1); @@ -642,7 +642,7 @@ HYPRE_Int hypre_AMGHybridSetStrongThreshold( void *AMGhybrid_vdata, HYPRE_Real strong_threshold) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; if (!AMGhybrid_data) { hypre_error_in_arg(1); @@ -667,7 +667,7 @@ HYPRE_Int hypre_AMGHybridSetMaxRowSum( void *AMGhybrid_vdata, HYPRE_Real max_row_sum ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; if (!AMGhybrid_data) { hypre_error_in_arg(1); @@ -692,7 +692,7 @@ HYPRE_Int hypre_AMGHybridSetTruncFactor( void *AMGhybrid_vdata, HYPRE_Real trunc_factor ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; if (!AMGhybrid_data) { hypre_error_in_arg(1); @@ -718,7 +718,7 @@ hypre_AMGHybridSetPMaxElmts( void *AMGhybrid_vdata, HYPRE_Int P_max_elmts ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; if (!AMGhybrid_data) { hypre_error_in_arg(1); @@ -744,7 +744,7 @@ HYPRE_Int hypre_AMGHybridSetMaxLevels( void *AMGhybrid_vdata, HYPRE_Int max_levels ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; if (!AMGhybrid_data) { hypre_error_in_arg(1); @@ -769,7 +769,7 @@ HYPRE_Int hypre_AMGHybridSetMeasureType( void *AMGhybrid_vdata, HYPRE_Int measure_type ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; if (!AMGhybrid_data) { hypre_error_in_arg(1); @@ -789,7 +789,7 @@ HYPRE_Int hypre_AMGHybridSetCoarsenType( void *AMGhybrid_vdata, HYPRE_Int coarsen_type ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; if (!AMGhybrid_data) { hypre_error_in_arg(1); @@ -809,7 +809,7 @@ HYPRE_Int hypre_AMGHybridSetInterpType( void *AMGhybrid_vdata, HYPRE_Int interp_type ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; if (!AMGhybrid_data) { hypre_error_in_arg(1); @@ -834,7 +834,7 @@ HYPRE_Int hypre_AMGHybridSetCycleType( void *AMGhybrid_vdata, HYPRE_Int cycle_type ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; if (!AMGhybrid_data) { hypre_error_in_arg(1); @@ -859,7 +859,7 @@ HYPRE_Int hypre_AMGHybridSetNumSweeps( void *AMGhybrid_vdata, HYPRE_Int num_sweeps ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; HYPRE_Int *num_grid_sweeps; HYPRE_Int i; if (!AMGhybrid_data) @@ -878,7 +878,7 @@ hypre_AMGHybridSetNumSweeps( void *AMGhybrid_vdata, (AMGhybrid_data -> num_grid_sweeps) = hypre_CTAlloc(HYPRE_Int, 4, HYPRE_MEMORY_HOST); } num_grid_sweeps = (AMGhybrid_data -> num_grid_sweeps); - for (i=0; i < 3; i++) + for (i = 0; i < 3; i++) { num_grid_sweeps[i] = num_sweeps; } @@ -895,7 +895,7 @@ hypre_AMGHybridSetCycleNumSweeps( void *AMGhybrid_vdata, HYPRE_Int num_sweeps, HYPRE_Int k) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; HYPRE_Int *num_grid_sweeps; HYPRE_Int i; @@ -924,7 +924,7 @@ hypre_AMGHybridSetCycleNumSweeps( void *AMGhybrid_vdata, { (AMGhybrid_data -> num_grid_sweeps) = hypre_CTAlloc(HYPRE_Int, 4, HYPRE_MEMORY_HOST); num_grid_sweeps = (AMGhybrid_data -> num_grid_sweeps); - for (i=0; i < 4; i++) + for (i = 0; i < 4; i++) { num_grid_sweeps[i] = 1; } @@ -941,7 +941,7 @@ HYPRE_Int hypre_AMGHybridSetRelaxType( void *AMGhybrid_vdata, HYPRE_Int relax_type ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; HYPRE_Int *grid_relax_type; HYPRE_Int i; if (!AMGhybrid_data) @@ -955,7 +955,7 @@ hypre_AMGHybridSetRelaxType( void *AMGhybrid_vdata, (AMGhybrid_data -> grid_relax_type) = hypre_CTAlloc(HYPRE_Int, 4, HYPRE_MEMORY_HOST); } grid_relax_type = (AMGhybrid_data -> grid_relax_type); - for (i=0; i < 3; i++) + for (i = 0; i < 3; i++) { grid_relax_type[i] = relax_type; } @@ -973,7 +973,7 @@ hypre_AMGHybridSetCycleRelaxType( void *AMGhybrid_vdata, HYPRE_Int relax_type, HYPRE_Int k ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; HYPRE_Int *grid_relax_type; if (!AMGhybrid_data) { @@ -981,7 +981,7 @@ hypre_AMGHybridSetCycleRelaxType( void *AMGhybrid_vdata, return hypre_error_flag; } - if (k<1 || k > 3) + if (k < 1 || k > 3) { if (AMGhybrid_data -> print_level) { @@ -1014,7 +1014,7 @@ HYPRE_Int hypre_AMGHybridSetRelaxOrder( void *AMGhybrid_vdata, HYPRE_Int relax_order ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; if (!AMGhybrid_data) { hypre_error_in_arg(1); @@ -1034,7 +1034,7 @@ HYPRE_Int hypre_AMGHybridSetKeepTranspose( void *AMGhybrid_vdata, HYPRE_Int keepT ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; if (!AMGhybrid_data) { hypre_error_in_arg(1); @@ -1054,7 +1054,7 @@ HYPRE_Int hypre_AMGHybridSetMaxCoarseSize( void *AMGhybrid_vdata, HYPRE_Int max_coarse_size ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; if (!AMGhybrid_data) { hypre_error_in_arg(1); @@ -1079,7 +1079,7 @@ HYPRE_Int hypre_AMGHybridSetMinCoarseSize( void *AMGhybrid_vdata, HYPRE_Int min_coarse_size ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; if (!AMGhybrid_data) { hypre_error_in_arg(1); @@ -1104,7 +1104,7 @@ HYPRE_Int hypre_AMGHybridSetSeqThreshold( void *AMGhybrid_vdata, HYPRE_Int seq_threshold ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; if (!AMGhybrid_data) { hypre_error_in_arg(1); @@ -1129,7 +1129,7 @@ HYPRE_Int hypre_AMGHybridSetNumGridSweeps( void *AMGhybrid_vdata, HYPRE_Int *num_grid_sweeps ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; if (!AMGhybrid_data) { hypre_error_in_arg(1); @@ -1158,7 +1158,7 @@ HYPRE_Int hypre_AMGHybridSetGridRelaxType( void *AMGhybrid_vdata, HYPRE_Int *grid_relax_type ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; if (!AMGhybrid_data) { hypre_error_in_arg(1); @@ -1187,7 +1187,7 @@ HYPRE_Int hypre_AMGHybridSetGridRelaxPoints( void *AMGhybrid_vdata, HYPRE_Int **grid_relax_points ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; if (!AMGhybrid_data) { hypre_error_in_arg(1); @@ -1216,7 +1216,7 @@ HYPRE_Int hypre_AMGHybridSetRelaxWeight( void *AMGhybrid_vdata, HYPRE_Real *relax_weight ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; if (!AMGhybrid_data) { hypre_error_in_arg(1); @@ -1245,7 +1245,7 @@ HYPRE_Int hypre_AMGHybridSetOmega( void *AMGhybrid_vdata, HYPRE_Real *omega ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; if (!AMGhybrid_data) { hypre_error_in_arg(1); @@ -1274,8 +1274,8 @@ HYPRE_Int hypre_AMGHybridSetRelaxWt( void *AMGhybrid_vdata, HYPRE_Real relax_wt ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; - HYPRE_Int i , num_levels; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; + HYPRE_Int i, num_levels; HYPRE_Real *relax_wt_array; if (!AMGhybrid_data) { @@ -1290,7 +1290,7 @@ hypre_AMGHybridSetRelaxWt( void *AMGhybrid_vdata, relax_wt_array = hypre_CTAlloc(HYPRE_Real, num_levels, HYPRE_MEMORY_HOST); (AMGhybrid_data -> relax_weight) = relax_wt_array; } - for (i=0; i < num_levels; i++) + for (i = 0; i < num_levels; i++) { relax_wt_array[i] = relax_wt; } @@ -1307,8 +1307,8 @@ hypre_AMGHybridSetLevelRelaxWt( void *AMGhybrid_vdata, HYPRE_Real relax_wt, HYPRE_Int level ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; - HYPRE_Int i , num_levels; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; + HYPRE_Int i, num_levels; HYPRE_Real *relax_wt_array; if (!AMGhybrid_data) { @@ -1317,7 +1317,7 @@ hypre_AMGHybridSetLevelRelaxWt( void *AMGhybrid_vdata, } num_levels = (AMGhybrid_data -> max_levels); - if (level > num_levels-1) + if (level > num_levels - 1) { if (AMGhybrid_data -> print_level) { @@ -1330,7 +1330,7 @@ hypre_AMGHybridSetLevelRelaxWt( void *AMGhybrid_vdata, if (relax_wt_array == NULL) { relax_wt_array = hypre_CTAlloc(HYPRE_Real, num_levels, HYPRE_MEMORY_HOST); - for (i=0; i < num_levels; i++) + for (i = 0; i < num_levels; i++) { relax_wt_array[i] = 1.0; } @@ -1349,8 +1349,8 @@ HYPRE_Int hypre_AMGHybridSetOuterWt( void *AMGhybrid_vdata, HYPRE_Real outer_wt ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; - HYPRE_Int i , num_levels; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; + HYPRE_Int i, num_levels; HYPRE_Real *outer_wt_array; if (!AMGhybrid_data) { @@ -1365,7 +1365,7 @@ hypre_AMGHybridSetOuterWt( void *AMGhybrid_vdata, outer_wt_array = hypre_CTAlloc(HYPRE_Real, num_levels, HYPRE_MEMORY_HOST); (AMGhybrid_data -> omega) = outer_wt_array; } - for (i=0; i < num_levels; i++) + for (i = 0; i < num_levels; i++) { outer_wt_array[i] = outer_wt; } @@ -1382,8 +1382,8 @@ hypre_AMGHybridSetLevelOuterWt( void *AMGhybrid_vdata, HYPRE_Real outer_wt, HYPRE_Int level ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; - HYPRE_Int i , num_levels; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; + HYPRE_Int i, num_levels; HYPRE_Real *outer_wt_array; if (!AMGhybrid_data) { @@ -1392,7 +1392,7 @@ hypre_AMGHybridSetLevelOuterWt( void *AMGhybrid_vdata, } num_levels = (AMGhybrid_data -> max_levels); - if (level > num_levels-1) + if (level > num_levels - 1) { if (AMGhybrid_data -> print_level) { @@ -1405,7 +1405,7 @@ hypre_AMGHybridSetLevelOuterWt( void *AMGhybrid_vdata, if (outer_wt_array == NULL) { outer_wt_array = hypre_CTAlloc(HYPRE_Real, num_levels, HYPRE_MEMORY_HOST); - for (i=0; i < num_levels; i++) + for (i = 0; i < num_levels; i++) { outer_wt_array[i] = 1.0; } @@ -1424,7 +1424,7 @@ HYPRE_Int hypre_AMGHybridSetNumPaths( void *AMGhybrid_vdata, HYPRE_Int num_paths ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; if (!AMGhybrid_data) { hypre_error_in_arg(1); @@ -1449,7 +1449,7 @@ HYPRE_Int hypre_AMGHybridSetDofFunc( void *AMGhybrid_vdata, HYPRE_Int *dof_func ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; if (!AMGhybrid_data) { hypre_error_in_arg(1); @@ -1478,7 +1478,7 @@ HYPRE_Int hypre_AMGHybridSetAggNumLevels( void *AMGhybrid_vdata, HYPRE_Int agg_num_levels ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; if (!AMGhybrid_data) { hypre_error_in_arg(1); @@ -1523,7 +1523,7 @@ HYPRE_Int hypre_AMGHybridSetNumFunctions( void *AMGhybrid_vdata, HYPRE_Int num_functions ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; if (!AMGhybrid_data) { hypre_error_in_arg(1); @@ -1548,7 +1548,7 @@ HYPRE_Int hypre_AMGHybridSetNodal( void *AMGhybrid_vdata, HYPRE_Int nodal ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; if (!AMGhybrid_data) { hypre_error_in_arg(1); @@ -1567,7 +1567,7 @@ HYPRE_Int hypre_AMGHybridGetSetupSolveTime( void *AMGhybrid_vdata, HYPRE_Real *time ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; if (!AMGhybrid_data) { hypre_error_in_arg(1); @@ -1591,7 +1591,7 @@ HYPRE_Int hypre_AMGHybridGetNumIterations( void *AMGhybrid_vdata, HYPRE_Int *num_its ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; if (!AMGhybrid_data) { hypre_error_in_arg(1); @@ -1611,7 +1611,7 @@ HYPRE_Int hypre_AMGHybridGetDSCGNumIterations( void *AMGhybrid_vdata, HYPRE_Int *dscg_num_its ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; if (!AMGhybrid_data) { hypre_error_in_arg(1); @@ -1631,7 +1631,7 @@ HYPRE_Int hypre_AMGHybridGetPCGNumIterations( void *AMGhybrid_vdata, HYPRE_Int *pcg_num_its ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; if (!AMGhybrid_data) { hypre_error_in_arg(1); @@ -1651,7 +1651,7 @@ HYPRE_Int hypre_AMGHybridGetFinalRelativeResidualNorm( void *AMGhybrid_vdata, HYPRE_Real *final_rel_res_norm ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; if (!AMGhybrid_data) { hypre_error_in_arg(1); @@ -1668,12 +1668,17 @@ hypre_AMGHybridGetFinalRelativeResidualNorm( void *AMGhybrid_vdata, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_AMGHybridSetup( void *AMGhybrid_vdata, - hypre_ParCSRMatrix *A, - hypre_ParVector *b, - hypre_ParVector *x ) +hypre_AMGHybridSetup( void *AMGhybrid_vdata, + hypre_ParCSRMatrix *A, + hypre_ParVector *b, + hypre_ParVector *x ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + HYPRE_UNUSED_VAR(A); + HYPRE_UNUSED_VAR(b); + HYPRE_UNUSED_VAR(x); + + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; + if (!AMGhybrid_data) { hypre_error_in_arg(1); @@ -1700,7 +1705,7 @@ hypre_AMGHybridSolve( void *AMGhybrid_vdata, hypre_ParVector *b, hypre_ParVector *x ) { - hypre_AMGHybridData *AMGhybrid_data =(hypre_AMGHybridData *) AMGhybrid_vdata; + hypre_AMGHybridData *AMGhybrid_data = (hypre_AMGHybridData *) AMGhybrid_vdata; HYPRE_Real tol; HYPRE_Real a_tol; @@ -1749,8 +1754,8 @@ hypre_AMGHybridSolve( void *AMGhybrid_vdata, HYPRE_Real *boom_omega; HYPRE_Int pcg_default; - HYPRE_Int (*pcg_precond_solve)(void*,void*,void*,void*); - HYPRE_Int (*pcg_precond_setup)(void*,void*,void*,void*); + HYPRE_Int (*pcg_precond_solve)(void*, void*, void*, void*); + HYPRE_Int (*pcg_precond_setup)(void*, void*, void*, void*); void *pcg_precond; void *pcg_solver; @@ -1758,9 +1763,9 @@ hypre_AMGHybridSolve( void *AMGhybrid_vdata, hypre_GMRESFunctions *gmres_functions; hypre_BiCGSTABFunctions *bicgstab_functions; - HYPRE_Int dscg_num_its=0; - HYPRE_Int pcg_num_its=0; - HYPRE_Int converged=0; + HYPRE_Int dscg_num_its = 0; + HYPRE_Int pcg_num_its = 0; + HYPRE_Int converged = 0; HYPRE_Int num_variables = hypre_VectorSize(hypre_ParVectorLocalVector(b)); HYPRE_Real res_norm; @@ -1850,8 +1855,8 @@ hypre_AMGHybridSolve( void *AMGhybrid_vdata, } /* print_level definitions: xy, sol_print_level = y, pre_print_level = x */ - pre_print_level = print_level/10; - sol_print_level = print_level - pre_print_level*10; + pre_print_level = print_level / 10; + sol_print_level = print_level - pre_print_level * 10; pcg_solver = (AMGhybrid_data -> pcg_solver); pcg_precond = (AMGhybrid_data -> pcg_precond); @@ -1895,7 +1900,7 @@ hypre_AMGHybridSolve( void *AMGhybrid_vdata, hypre_PCGSetRecomputeResidualP(pcg_solver, recompute_residual_p); hypre_PCGSetLogging(pcg_solver, logging); hypre_PCGSetPrintLevel(pcg_solver, sol_print_level); - hypre_PCGSetHybrid(pcg_solver,-1); + hypre_PCGSetHybrid(pcg_solver, -1); pcg_precond = NULL; } @@ -1960,7 +1965,7 @@ hypre_AMGHybridSolve( void *AMGhybrid_vdata, hypre_GMRESSetRelChange(pcg_solver, rel_change); hypre_GMRESSetLogging(pcg_solver, logging); hypre_GMRESSetPrintLevel(pcg_solver, sol_print_level); - hypre_GMRESSetHybrid(pcg_solver,-1); + hypre_GMRESSetHybrid(pcg_solver, -1); pcg_precond = NULL; } @@ -2021,7 +2026,7 @@ hypre_AMGHybridSolve( void *AMGhybrid_vdata, hypre_BiCGSTABSetStopCrit(pcg_solver, stop_crit); hypre_BiCGSTABSetLogging(pcg_solver, logging); hypre_BiCGSTABSetPrintLevel(pcg_solver, sol_print_level); - hypre_BiCGSTABSetHybrid(pcg_solver,-1); + hypre_BiCGSTABSetHybrid(pcg_solver, -1); pcg_precond = NULL; } @@ -2130,7 +2135,7 @@ hypre_AMGHybridSolve( void *AMGhybrid_vdata, if (grid_relax_type) { boom_grt = hypre_CTAlloc(HYPRE_Int, 4, HYPRE_MEMORY_HOST); - for (i=0; i < 4; i++) + for (i = 0; i < 4; i++) { boom_grt[i] = grid_relax_type[i]; } @@ -2152,31 +2157,39 @@ hypre_AMGHybridSolve( void *AMGhybrid_vdata, if (relax_weight) { boom_rlxw = hypre_CTAlloc(HYPRE_Real, max_levels, HYPRE_MEMORY_HOST); - for (i=0; i < max_levels; i++) + for (i = 0; i < max_levels; i++) + { boom_rlxw[i] = relax_weight[i]; + } hypre_BoomerAMGSetRelaxWeight(pcg_precond, boom_rlxw); } if (omega) { boom_omega = hypre_CTAlloc(HYPRE_Real, max_levels, HYPRE_MEMORY_HOST); - for (i=0; i < max_levels; i++) + for (i = 0; i < max_levels; i++) + { boom_omega[i] = omega[i]; + } hypre_BoomerAMGSetOmega(pcg_precond, boom_omega); } if (num_grid_sweeps) { boom_ngs = hypre_CTAlloc(HYPRE_Int, 4, HYPRE_MEMORY_HOST); - for (i=0; i < 4; i++) + for (i = 0; i < 4; i++) + { boom_ngs[i] = num_grid_sweeps[i]; + } hypre_BoomerAMGSetNumGridSweeps(pcg_precond, boom_ngs); if (grid_relax_points) { boom_grp = hypre_CTAlloc(HYPRE_Int*, 4, HYPRE_MEMORY_HOST); - for (i=0; i < 4; i++) + for (i = 0; i < 4; i++) { boom_grp[i] = hypre_CTAlloc(HYPRE_Int, num_grid_sweeps[i], HYPRE_MEMORY_HOST); - for (j=0; j < num_grid_sweeps[i]; j++) + for (j = 0; j < num_grid_sweeps[i]; j++) + { boom_grp[i][j] = grid_relax_points[i][j]; + } } hypre_BoomerAMGSetGridRelaxPoints(pcg_precond, boom_grp); } @@ -2184,8 +2197,10 @@ hypre_AMGHybridSolve( void *AMGhybrid_vdata, if (dof_func) { boom_dof_func = hypre_CTAlloc(HYPRE_Int, num_variables, HYPRE_MEMORY_HOST); - for (i=0; i < num_variables; i++) + for (i = 0; i < num_variables; i++) + { boom_dof_func[i] = dof_func[i]; + } hypre_BoomerAMGSetDofFunc(pcg_precond, boom_dof_func); } pcg_precond_solve = (HYPRE_Int (*)(void*, void*, void*, void*)) hypre_BoomerAMGSolve; @@ -2296,4 +2311,3 @@ hypre_AMGHybridSolve( void *AMGhybrid_vdata, return hypre_error_flag; } - diff --git a/external/hypre/src/parcsr_ls/ams.c b/external/hypre/src/parcsr_ls/ams.c index 7262ae02..e7eb6b3e 100644 --- a/external/hypre/src/parcsr_ls/ams.c +++ b/external/hypre/src/parcsr_ls/ams.c @@ -1,10 +1,11 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ +#include "_hypre_onedpl.hpp" #include "_hypre_parcsr_ls.h" #include "float.h" #include "ams.h" @@ -53,19 +54,8 @@ hypre_ParCSRRelax( hypre_ParCSRMatrix *A, /* matrix to relax with * else if (relax_type == 2 || relax_type == 4) /* offd-l1-scaled block GS */ { /* !!! Note: relax_weight and omega flipped !!! */ -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(A) ); - if (exec == HYPRE_EXEC_DEVICE) - { - hypre_BoomerAMGRelaxHybridGaussSeidelDevice(A, f, NULL, 0, omega, relax_weight, l1_norms, u, v, z, - 1, 1 /* symm */); - } - else -#endif - { - hypre_BoomerAMGRelaxHybridGaussSeidel_core(A, f, NULL, 0, omega, relax_weight, l1_norms, u, v, z, - 1, 1 /* symm */, 0 /* skip diag */, 1, 0); - } + hypre_BoomerAMGRelaxHybridSOR(A, f, NULL, 0, omega, + relax_weight, l1_norms, u, v, z, 1, 1, 0, 1); } else if (relax_type == 3) /* Kaczmarz */ { @@ -133,17 +123,18 @@ hypre_ParVector *hypre_ParVectorInDomainOf(hypre_ParCSRMatrix *A) * Extract the dim sub-vectors x_0,...,x_{dim-1} composing a parallel * block vector x. It is assumed that &x[i] = [x_0[i],...,x_{dim-1}[i]]. *--------------------------------------------------------------------------*/ -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) template __global__ void -hypreCUDAKernel_ParVectorBlockSplitGather(HYPRE_Int size, - HYPRE_Int dim, - HYPRE_Real *x0, - HYPRE_Real *x1, - HYPRE_Real *x2, - HYPRE_Real *x) +hypreGPUKernel_ParVectorBlockSplitGather(hypre_DeviceItem &item, + HYPRE_Int size, + HYPRE_Int dim, + HYPRE_Real *x0, + HYPRE_Real *x1, + HYPRE_Real *x2, + HYPRE_Real *x) { - const HYPRE_Int i = hypre_cuda_get_grid_thread_id<1,1>(); + const HYPRE_Int i = hypre_gpu_get_grid_thread_id<1, 1>(item); if (i >= size * dim) { @@ -170,14 +161,15 @@ hypreCUDAKernel_ParVectorBlockSplitGather(HYPRE_Int size, } #endif -HYPRE_Int hypre_ParVectorBlockSplit(hypre_ParVector *x, - hypre_ParVector *x_[3], - HYPRE_Int dim) +HYPRE_Int +hypre_ParVectorBlockSplit(hypre_ParVector *x, + hypre_ParVector *x_[3], + HYPRE_Int dim) { HYPRE_Int i, d, size_; HYPRE_Real *x_data, *x_data_[3]; -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParVectorMemoryLocation(x) ); #endif @@ -185,22 +177,28 @@ HYPRE_Int hypre_ParVectorBlockSplit(hypre_ParVector *x, x_data = hypre_VectorData(hypre_ParVectorLocalVector(x)); for (d = 0; d < dim; d++) + { x_data_[d] = hypre_VectorData(hypre_ParVectorLocalVector(x_[d])); + } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if (exec == HYPRE_EXEC_DEVICE) { - dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(size_ * dim, "thread", bDim); - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_ParVectorBlockSplitGather<0>, gDim, bDim, - size_, dim, x_data_[0], x_data_[1], x_data_[2], x_data); + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(size_ * dim, "thread", bDim); + HYPRE_GPU_LAUNCH( hypreGPUKernel_ParVectorBlockSplitGather<0>, gDim, bDim, + size_, dim, x_data_[0], x_data_[1], x_data_[2], x_data); } else #endif { for (i = 0; i < size_; i++) + { for (d = 0; d < dim; d++) - x_data_[d][i] = x_data[dim*i+d]; + { + x_data_[d][i] = x_data[dim * i + d]; + } + } } return hypre_error_flag; @@ -213,14 +211,15 @@ HYPRE_Int hypre_ParVectorBlockSplit(hypre_ParVector *x, * x_0,...,x_{dim-1}, such that &x[i] = [x_0[i],...,x_{dim-1}[i]]. *--------------------------------------------------------------------------*/ -HYPRE_Int hypre_ParVectorBlockGather(hypre_ParVector *x, - hypre_ParVector *x_[3], - HYPRE_Int dim) +HYPRE_Int +hypre_ParVectorBlockGather(hypre_ParVector *x, + hypre_ParVector *x_[3], + HYPRE_Int dim) { HYPRE_Int i, d, size_; HYPRE_Real *x_data, *x_data_[3]; -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParVectorMemoryLocation(x) ); #endif @@ -228,22 +227,28 @@ HYPRE_Int hypre_ParVectorBlockGather(hypre_ParVector *x, x_data = hypre_VectorData(hypre_ParVectorLocalVector(x)); for (d = 0; d < dim; d++) + { x_data_[d] = hypre_VectorData(hypre_ParVectorLocalVector(x_[d])); + } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if (exec == HYPRE_EXEC_DEVICE) { - dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(size_ * dim, "thread", bDim); - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_ParVectorBlockSplitGather<1>, gDim, bDim, - size_, dim, x_data_[0], x_data_[1], x_data_[2], x_data); + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(size_ * dim, "thread", bDim); + HYPRE_GPU_LAUNCH( hypreGPUKernel_ParVectorBlockSplitGather<1>, gDim, bDim, + size_, dim, x_data_[0], x_data_[1], x_data_[2], x_data); } else #endif { for (i = 0; i < size_; i++) + { for (d = 0; d < dim; d++) - x_data[dim*i+d] = x_data_[d][i]; + { + x_data[dim * i + d] = x_data_[d][i]; + } + } } return hypre_error_flag; @@ -264,8 +269,8 @@ HYPRE_Int hypre_BoomerAMGBlockSolve(void *B, { HYPRE_Int d, dim = 1; - hypre_ParVector *b_[3]; - hypre_ParVector *x_[3]; + hypre_ParVector *b_[3] = {NULL, NULL, NULL}; + hypre_ParVector *x_[3] = {NULL, NULL, NULL}; dim = hypre_ParVectorGlobalSize(x) / hypre_ParCSRMatrixGlobalNumRows(A); @@ -285,7 +290,9 @@ HYPRE_Int hypre_BoomerAMGBlockSolve(void *B, hypre_ParVectorBlockSplit(x, x_, dim); for (d = 0; d < dim; d++) + { hypre_BoomerAMGSolve(B, A, b_[d], x_[d]); + } hypre_ParVectorBlockGather(x, x_, dim); @@ -326,49 +333,60 @@ HYPRE_Int hypre_ParCSRMatrixFixZeroRowsHost(hypre_ParCSRMatrix *A) for (i = 0; i < num_rows; i++) { l1_norm = 0.0; - for (j = A_diag_I[i]; j < A_diag_I[i+1]; j++) - l1_norm += fabs(A_diag_data[j]); + for (j = A_diag_I[i]; j < A_diag_I[i + 1]; j++) + { + l1_norm += hypre_abs(A_diag_data[j]); + } if (num_cols_offd) - for (j = A_offd_I[i]; j < A_offd_I[i+1]; j++) - l1_norm += fabs(A_offd_data[j]); + for (j = A_offd_I[i]; j < A_offd_I[i + 1]; j++) + { + l1_norm += hypre_abs(A_offd_data[j]); + } if (l1_norm <= eps) { - for (j = A_diag_I[i]; j < A_diag_I[i+1]; j++) + for (j = A_diag_I[i]; j < A_diag_I[i + 1]; j++) if (A_diag_J[j] == i) + { A_diag_data[j] = 1.0; + } else + { A_diag_data[j] = 0.0; + } if (num_cols_offd) - for (j = A_offd_I[i]; j < A_offd_I[i+1]; j++) + for (j = A_offd_I[i]; j < A_offd_I[i + 1]; j++) + { A_offd_data[j] = 0.0; + } } } return hypre_error_flag; } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) __global__ void -hypreCUDAKernel_ParCSRMatrixFixZeroRows( HYPRE_Int nrows, - HYPRE_Int *A_diag_i, - HYPRE_Int *A_diag_j, - HYPRE_Complex *A_diag_data, - HYPRE_Int *A_offd_i, - HYPRE_Complex *A_offd_data, - HYPRE_Int num_cols_offd) +hypreGPUKernel_ParCSRMatrixFixZeroRows( hypre_DeviceItem &item, + HYPRE_Int nrows, + HYPRE_Int *A_diag_i, + HYPRE_Int *A_diag_j, + HYPRE_Complex *A_diag_data, + HYPRE_Int *A_offd_i, + HYPRE_Complex *A_offd_data, + HYPRE_Int num_cols_offd) { - HYPRE_Int row_i = hypre_cuda_get_grid_warp_id<1,1>(); + HYPRE_Int row_i = hypre_gpu_get_grid_warp_id<1, 1>(item); if (row_i >= nrows) { return; } - HYPRE_Int lane = hypre_cuda_get_lane_id<1>(); + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); HYPRE_Real eps = 0.0; /* DBL_EPSILON * 1e+4; */ HYPRE_Real l1_norm = 0.0; - HYPRE_Int p1, q1, p2 = 0, q2 = 0; + HYPRE_Int p1 = 0, q1, p2 = 0, q2 = 0; if (lane < 2) { @@ -379,25 +397,25 @@ hypreCUDAKernel_ParCSRMatrixFixZeroRows( HYPRE_Int nrows, } } - q1 = __shfl_sync(HYPRE_WARP_FULL_MASK, p1, 1); - p1 = __shfl_sync(HYPRE_WARP_FULL_MASK, p1, 0); + q1 = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p1, 1); + p1 = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p1, 0); if (num_cols_offd) { - q2 = __shfl_sync(HYPRE_WARP_FULL_MASK, p2, 1); - p2 = __shfl_sync(HYPRE_WARP_FULL_MASK, p2, 0); + q2 = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p2, 1); + p2 = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p2, 0); } for (HYPRE_Int j = p1 + lane; j < q1; j += HYPRE_WARP_SIZE) { - l1_norm += fabs(A_diag_data[j]); + l1_norm += hypre_abs(A_diag_data[j]); } for (HYPRE_Int j = p2 + lane; j < q2; j += HYPRE_WARP_SIZE) { - l1_norm += fabs(A_offd_data[j]); + l1_norm += hypre_abs(A_offd_data[j]); } - l1_norm = warp_allreduce_sum(l1_norm); + l1_norm = warp_allreduce_sum(item, l1_norm); if (l1_norm <= eps) { @@ -431,15 +449,14 @@ HYPRE_Int hypre_ParCSRMatrixFixZeroRowsDevice(hypre_ParCSRMatrix *A) HYPRE_Real *A_offd_data = hypre_CSRMatrixData(A_offd); HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); HYPRE_Int num_cols_offd = hypre_CSRMatrixNumCols(A_offd); - dim3 bDim, gDim; - bDim = hypre_GetDefaultCUDABlockDimension(); - gDim = hypre_GetDefaultCUDAGridDimension(nrows, "warp", bDim); + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(nrows, "warp", bDim); - HYPRE_CUDA_LAUNCH(hypreCUDAKernel_ParCSRMatrixFixZeroRows, gDim, bDim, - nrows, A_diag_i, A_diag_j, A_diag_data, A_offd_i, A_offd_data, num_cols_offd); + HYPRE_GPU_LAUNCH(hypreGPUKernel_ParCSRMatrixFixZeroRows, gDim, bDim, + nrows, A_diag_i, A_diag_j, A_diag_data, A_offd_i, A_offd_data, num_cols_offd); - //hypre_SyncCudaComputeStream(hypre_handle()); + //hypre_SyncComputeStream(); return hypre_error_flag; } @@ -447,7 +464,7 @@ HYPRE_Int hypre_ParCSRMatrixFixZeroRowsDevice(hypre_ParCSRMatrix *A) HYPRE_Int hypre_ParCSRMatrixFixZeroRows(hypre_ParCSRMatrix *A) { -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(A) ); if (exec == HYPRE_EXEC_DEVICE) { @@ -477,13 +494,32 @@ HYPRE_Int hypre_ParCSRMatrixFixZeroRows(hypre_ParCSRMatrix *A) * cf_marker is not NULL. *--------------------------------------------------------------------------*/ -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) +#if defined(HYPRE_USING_SYCL) +struct l1_norm_op1 +#else struct l1_norm_op1 : public thrust::binary_function +#endif { __host__ __device__ - HYPRE_Complex operator()(HYPRE_Complex &x, HYPRE_Complex &y) const + HYPRE_Complex operator()(const HYPRE_Complex &x, const HYPRE_Complex &y) const { - return x <= 4.0/3.0 * y ? y : x; + return x <= 4.0 / 3.0 * y ? y : x; + } +}; +#endif + +#if defined(HYPRE_USING_GPU) +#if defined(HYPRE_USING_SYCL) +struct l1_norm_op6 +#else +struct l1_norm_op6 : public thrust::binary_function +#endif +{ + __host__ __device__ + HYPRE_Complex operator()(const HYPRE_Complex &d, const HYPRE_Complex &l) const + { + return (l + d + sqrt(l * l + d * d)) * 0.5; } }; #endif @@ -514,7 +550,9 @@ HYPRE_Int hypre_ParCSRComputeL1Norms(hypre_ParCSRMatrix *A, HYPRE_Real *l1_norm = hypre_TAlloc(HYPRE_Real, num_rows, memory_location_l1); - HYPRE_MemoryLocation memory_location_tmp = exec == HYPRE_EXEC_HOST ? HYPRE_MEMORY_HOST : HYPRE_MEMORY_DEVICE; + HYPRE_MemoryLocation memory_location_tmp = + exec == HYPRE_EXEC_HOST ? HYPRE_MEMORY_HOST : HYPRE_MEMORY_DEVICE; + HYPRE_Real *diag_tmp = NULL; HYPRE_Int *cf_marker_offd = NULL; @@ -538,15 +576,32 @@ HYPRE_Int hypre_ParCSRComputeL1Norms(hypre_ParCSRMatrix *A, int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), memory_location_tmp); } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if (exec == HYPRE_EXEC_DEVICE) { hypre_ParCSRCommPkgCopySendMapElmtsToDevice(comm_pkg); +#if defined(HYPRE_USING_SYCL) + hypreSycl_gather( hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + hypre_ParCSRCommPkgSendMapStart(comm_pkg, + num_sends), + cf_marker, + int_buf_data ); +#else HYPRE_THRUST_CALL( gather, hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), - hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + hypre_ParCSRCommPkgSendMapStart(comm_pkg, + num_sends), cf_marker, int_buf_data ); +#endif + +#if defined(HYPRE_USING_THRUST_NOSYNC) + /* RL: make sure int_buf_data is ready before issuing GPU-GPU MPI */ + if (hypre_GetGpuAwareMPI()) + { + hypre_ForceSyncComputeStream(); + } +#endif } else #endif @@ -557,15 +612,15 @@ HYPRE_Int hypre_ParCSRComputeL1Norms(hypre_ParCSRMatrix *A, for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { - int_buf_data[index++] = cf_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + int_buf_data[index++] = cf_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } } } comm_handle = hypre_ParCSRCommHandleCreate_v2(11, comm_pkg, memory_location_tmp, int_buf_data, - memory_location_tmp, cf_marker_offd); + memory_location_tmp, cf_marker_offd); hypre_ParCSRCommHandleDestroy(comm_handle); hypre_TFree(int_buf_data, memory_location_tmp); } @@ -616,17 +671,21 @@ HYPRE_Int hypre_ParCSRComputeL1Norms(hypre_ParCSRMatrix *A, } /* Truncate according to Remark 6.2 */ -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if (exec == HYPRE_EXEC_DEVICE) { +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::transform, l1_norm, l1_norm + num_rows, diag_tmp, l1_norm, l1_norm_op1() ); +#else HYPRE_THRUST_CALL( transform, l1_norm, l1_norm + num_rows, diag_tmp, l1_norm, l1_norm_op1() ); +#endif } else #endif { for (i = 0; i < num_rows; i++) { - if (l1_norm[i] <= 4.0/3.0 * diag_tmp[i]) + if (l1_norm[i] <= 4.0 / 3.0 * diag_tmp[i]) { l1_norm[i] = diag_tmp[i]; } @@ -638,11 +697,16 @@ HYPRE_Int hypre_ParCSRComputeL1Norms(hypre_ParCSRMatrix *A, /* Set the diag element */ hypre_CSRMatrixExtractDiagonal(A_diag, l1_norm, 0); -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if ( exec == HYPRE_EXEC_DEVICE) { +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::replace_if, l1_norm, l1_norm + num_rows, [] (const auto & x) {return !x;}, + 1.0 ); +#else thrust::identity identity; - HYPRE_THRUST_CALL( replace_if, l1_norm, l1_norm + num_rows, thrust::not1(identity), 1.0 ); + HYPRE_THRUST_CALL( replace_if, l1_norm, l1_norm + num_rows, HYPRE_THRUST_NOT(identity), 1.0 ); +#endif } else #endif @@ -660,6 +724,35 @@ HYPRE_Int hypre_ParCSRComputeL1Norms(hypre_ParCSRMatrix *A, return hypre_error_flag; } + else if (option == 6) + { + /* Set the abs(diag) element */ + hypre_CSRMatrixExtractDiagonal(A_diag, l1_norm, 1); + /* Add the scaled l1 norm of the offd part */ + if (num_cols_offd) + { + diag_tmp = hypre_TAlloc(HYPRE_Real, num_rows, memory_location_tmp); + hypre_CSRMatrixComputeRowSum(A_offd, cf_marker, cf_marker_offd, diag_tmp, 1, 1.0, "set"); +#if defined(HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_DEVICE) + { +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::transform, l1_norm, l1_norm + num_rows, diag_tmp, l1_norm, l1_norm_op6() ); +#else + HYPRE_THRUST_CALL( transform, l1_norm, l1_norm + num_rows, diag_tmp, l1_norm, l1_norm_op6() ); +#endif + } + else +#endif + { + for (i = 0; i < num_rows; i++) + { + l1_norm[i] = 0.5 * (diag_tmp[i] + l1_norm[i] + + hypre_sqrt(hypre_squared(diag_tmp[i]) + hypre_squared(l1_norm[i]))); + } + } + } + } /* Handle negative definite matrices */ if (!diag_tmp) @@ -670,13 +763,22 @@ HYPRE_Int hypre_ParCSRComputeL1Norms(hypre_ParCSRMatrix *A, /* Set the diag element */ hypre_CSRMatrixExtractDiagonal(A_diag, diag_tmp, 0); -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if (exec == HYPRE_EXEC_DEVICE) { - HYPRE_THRUST_CALL( transform_if, l1_norm, l1_norm + num_rows, diag_tmp, l1_norm, thrust::negate(), +#if defined(HYPRE_USING_SYCL) + hypreSycl_transform_if( l1_norm, l1_norm + num_rows, diag_tmp, l1_norm, + std::negate(), + is_negative() ); + bool any_zero = 0.0 == HYPRE_ONEDPL_CALL( std::reduce, l1_norm, l1_norm + num_rows, 1.0, + oneapi::dpl::minimum() ); +#else + HYPRE_THRUST_CALL( transform_if, l1_norm, l1_norm + num_rows, diag_tmp, l1_norm, + thrust::negate(), is_negative() ); - //bool any_zero = HYPRE_THRUST_CALL( any_of, l1_norm, l1_norm + num_rows, thrust::not1(thrust::identity()) ); - bool any_zero = 0.0 == HYPRE_THRUST_CALL( reduce, l1_norm, l1_norm + num_rows, 1.0, thrust::minimum() ); + bool any_zero = 0.0 == HYPRE_THRUST_CALL( reduce, l1_norm, l1_norm + num_rows, 1.0, + thrust::minimum() ); +#endif if ( any_zero ) { hypre_error_in_arg(1); @@ -695,8 +797,8 @@ HYPRE_Int hypre_ParCSRComputeL1Norms(hypre_ParCSRMatrix *A, for (i = 0; i < num_rows; i++) { - /* if (fabs(l1_norm[i]) < DBL_EPSILON) */ - if (fabs(l1_norm[i]) == 0.0) + /* if (hypre_abs(l1_norm[i]) < DBL_EPSILON) */ + if (hypre_abs(l1_norm[i]) == 0.0) { hypre_error_in_arg(1); break; @@ -717,17 +819,18 @@ HYPRE_Int hypre_ParCSRComputeL1Norms(hypre_ParCSRMatrix *A, * * For every row containing only a diagonal element: set it to d. *--------------------------------------------------------------------------*/ -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) __global__ void -hypreCUDAKernel_ParCSRMatrixSetDiagRows(HYPRE_Int nrows, - HYPRE_Int *A_diag_I, - HYPRE_Int *A_diag_J, - HYPRE_Complex *A_diag_data, - HYPRE_Int *A_offd_I, - HYPRE_Int num_cols_offd, - HYPRE_Real d) +hypreGPUKernel_ParCSRMatrixSetDiagRows(hypre_DeviceItem &item, + HYPRE_Int nrows, + HYPRE_Int *A_diag_I, + HYPRE_Int *A_diag_J, + HYPRE_Complex *A_diag_data, + HYPRE_Int *A_offd_I, + HYPRE_Int num_cols_offd, + HYPRE_Real d) { - const HYPRE_Int i = hypre_cuda_get_grid_thread_id<1,1>(); + const HYPRE_Int i = hypre_gpu_get_grid_thread_id<1, 1>(item); if (i >= nrows) { return; @@ -735,8 +838,8 @@ hypreCUDAKernel_ParCSRMatrixSetDiagRows(HYPRE_Int nrows, HYPRE_Int j = read_only_load(&A_diag_I[i]); - if ( (read_only_load(&A_diag_I[i+1]) == j+1) && (read_only_load(&A_diag_J[j]) == i) && - (!num_cols_offd || (read_only_load(&A_offd_I[i+1]) == read_only_load(&A_offd_I[i]))) ) + if ( (read_only_load(&A_diag_I[i + 1]) == j + 1) && (read_only_load(&A_diag_J[j]) == i) && + (!num_cols_offd || (read_only_load(&A_offd_I[i + 1]) == read_only_load(&A_offd_I[i]))) ) { A_diag_data[j] = d; } @@ -757,14 +860,14 @@ HYPRE_Int hypre_ParCSRMatrixSetDiagRows(hypre_ParCSRMatrix *A, HYPRE_Real d) HYPRE_Int *A_offd_I = hypre_CSRMatrixI(A_offd); HYPRE_Int num_cols_offd = hypre_CSRMatrixNumCols(A_offd); -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(A) ); if (exec == HYPRE_EXEC_DEVICE) { - dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(num_rows, "thread", bDim); - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_ParCSRMatrixSetDiagRows, gDim, bDim, - num_rows, A_diag_I, A_diag_J, A_diag_data, A_offd_I, num_cols_offd, d); + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(num_rows, "thread", bDim); + HYPRE_GPU_LAUNCH( hypreGPUKernel_ParCSRMatrixSetDiagRows, gDim, bDim, + num_rows, A_diag_I, A_diag_J, A_diag_data, A_offd_I, num_cols_offd, d); } else #endif @@ -772,8 +875,8 @@ HYPRE_Int hypre_ParCSRMatrixSetDiagRows(hypre_ParCSRMatrix *A, HYPRE_Real d) for (i = 0; i < num_rows; i++) { j = A_diag_I[i]; - if ((A_diag_I[i+1] == j+1) && (A_diag_J[j] == i) && - (!num_cols_offd || (A_offd_I[i+1] == A_offd_I[i]))) + if ((A_diag_I[i + 1] == j + 1) && (A_diag_J[j] == i) && + (!num_cols_offd || (A_offd_I[i + 1] == A_offd_I[i]))) { A_diag_data[j] = d; } @@ -789,7 +892,7 @@ HYPRE_Int hypre_ParCSRMatrixSetDiagRows(hypre_ParCSRMatrix *A, HYPRE_Real d) * Allocate the AMS solver structure. *--------------------------------------------------------------------------*/ -void * hypre_AMSCreate() +void * hypre_AMSCreate(void) { hypre_AMSData *ams_data; @@ -897,61 +1000,111 @@ HYPRE_Int hypre_AMSDestroy(void *solver) if (ams_data -> owns_A_G) if (ams_data -> A_G) + { hypre_ParCSRMatrixDestroy(ams_data -> A_G); + } if (!ams_data -> beta_is_zero) if (ams_data -> B_G) + { HYPRE_BoomerAMGDestroy(ams_data -> B_G); + } if (ams_data -> owns_Pi && ams_data -> Pi) + { hypre_ParCSRMatrixDestroy(ams_data -> Pi); + } if (ams_data -> owns_A_Pi) if (ams_data -> A_Pi) + { hypre_ParCSRMatrixDestroy(ams_data -> A_Pi); + } if (ams_data -> B_Pi) + { HYPRE_BoomerAMGDestroy(ams_data -> B_Pi); + } if (ams_data -> owns_Pi && ams_data -> Pix) + { hypre_ParCSRMatrixDestroy(ams_data -> Pix); + } if (ams_data -> A_Pix) + { hypre_ParCSRMatrixDestroy(ams_data -> A_Pix); + } if (ams_data -> B_Pix) + { HYPRE_BoomerAMGDestroy(ams_data -> B_Pix); + } if (ams_data -> owns_Pi && ams_data -> Piy) + { hypre_ParCSRMatrixDestroy(ams_data -> Piy); + } if (ams_data -> A_Piy) + { hypre_ParCSRMatrixDestroy(ams_data -> A_Piy); + } if (ams_data -> B_Piy) + { HYPRE_BoomerAMGDestroy(ams_data -> B_Piy); + } if (ams_data -> owns_Pi && ams_data -> Piz) + { hypre_ParCSRMatrixDestroy(ams_data -> Piz); + } if (ams_data -> A_Piz) + { hypre_ParCSRMatrixDestroy(ams_data -> A_Piz); + } if (ams_data -> B_Piz) + { HYPRE_BoomerAMGDestroy(ams_data -> B_Piz); + } if (ams_data -> r0) + { hypre_ParVectorDestroy(ams_data -> r0); + } if (ams_data -> g0) + { hypre_ParVectorDestroy(ams_data -> g0); + } if (ams_data -> r1) + { hypre_ParVectorDestroy(ams_data -> r1); + } if (ams_data -> g1) + { hypre_ParVectorDestroy(ams_data -> g1); + } if (ams_data -> r2) + { hypre_ParVectorDestroy(ams_data -> r2); + } if (ams_data -> g2) + { hypre_ParVectorDestroy(ams_data -> g2); + } if (ams_data -> zz) + { hypre_ParVectorDestroy(ams_data -> zz); + } if (ams_data -> G0) + { hypre_ParCSRMatrixDestroy(ams_data -> A); + } if (ams_data -> G0) + { hypre_ParCSRMatrixDestroy(ams_data -> G0); + } if (ams_data -> A_G0) + { hypre_ParCSRMatrixDestroy(ams_data -> A_G0); + } if (ams_data -> B_G0) + { HYPRE_BoomerAMGDestroy(ams_data -> B_G0); + } hypre_SeqVectorDestroy(ams_data -> A_l1_norms); @@ -977,7 +1130,9 @@ HYPRE_Int hypre_AMSSetDimension(void *solver, hypre_AMSData *ams_data = (hypre_AMSData *) solver; if (dim != 1 && dim != 2 && dim != 3) + { hypre_error_in_arg(2); + } ams_data -> dim = dim; return hypre_error_flag; @@ -1131,7 +1286,9 @@ HYPRE_Int hypre_AMSSetBetaPoissonMatrix(void *solver, hypre_AMSData *ams_data = (hypre_AMSData *) solver; ams_data -> A_G = A_G; if (!A_G) + { ams_data -> beta_is_zero = 1; + } else { /* Penalize the eliminated degrees of freedom */ @@ -1282,9 +1439,10 @@ HYPRE_Int hypre_AMSSetSmoothingOptions(void *solver, * Set parameters for chebyshev smoother for A. Default values: 2,.3. *--------------------------------------------------------------------------*/ -HYPRE_Int hypre_AMSSetChebySmoothingOptions(void *solver, - HYPRE_Int A_cheby_order, - HYPRE_Int A_cheby_fraction) +HYPRE_Int +hypre_AMSSetChebySmoothingOptions(void *solver, + HYPRE_Int A_cheby_order, + HYPRE_Real A_cheby_fraction) { hypre_AMSData *ams_data = (hypre_AMSData *) solver; ams_data -> A_cheby_order = A_cheby_order; @@ -1379,14 +1537,15 @@ HYPRE_Int hypre_AMSSetBetaAMGCoarseRelaxType(void *solver, * can be computed from the vectors Gx, Gy, Gz. *--------------------------------------------------------------------------*/ -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) __global__ void -hypreCUDAKernel_AMSComputePi_copy1(HYPRE_Int nnz, - HYPRE_Int dim, - HYPRE_Int *j_in, - HYPRE_Int *j_out) +hypreGPUKernel_AMSComputePi_copy1(hypre_DeviceItem &item, + HYPRE_Int nnz, + HYPRE_Int dim, + HYPRE_Int *j_in, + HYPRE_Int *j_out) { - const HYPRE_Int i = hypre_cuda_get_grid_thread_id<1,1>(); + const HYPRE_Int i = hypre_gpu_get_grid_thread_id<1, 1>(item); if (i < nnz) { @@ -1394,30 +1553,31 @@ hypreCUDAKernel_AMSComputePi_copy1(HYPRE_Int nnz, for (HYPRE_Int d = 0; d < dim; d++) { - j_out[j+d] = dim * read_only_load(&j_in[i]) + d; + j_out[j + d] = dim * read_only_load(&j_in[i]) + d; } } } __global__ void -hypreCUDAKernel_AMSComputePi_copy2(HYPRE_Int nrows, - HYPRE_Int dim, - HYPRE_Int *i_in, - HYPRE_Real *data_in, - HYPRE_Real *Gx_data, - HYPRE_Real *Gy_data, - HYPRE_Real *Gz_data, - HYPRE_Real *data_out) +hypreGPUKernel_AMSComputePi_copy2(hypre_DeviceItem &item, + HYPRE_Int nrows, + HYPRE_Int dim, + HYPRE_Int *i_in, + HYPRE_Real *data_in, + HYPRE_Real *Gx_data, + HYPRE_Real *Gy_data, + HYPRE_Real *Gz_data, + HYPRE_Real *data_out) { - const HYPRE_Int i = hypre_cuda_get_grid_warp_id<1,1>(); + const HYPRE_Int i = hypre_gpu_get_grid_warp_id<1, 1>(item); if (i >= nrows) { return; } - const HYPRE_Int lane_id = hypre_cuda_get_lane_id<1>(); - HYPRE_Int j, istart, iend; + const HYPRE_Int lane_id = hypre_gpu_get_lane_id<1>(item); + HYPRE_Int j = 0, istart, iend; HYPRE_Real t, G[3], *Gdata[3]; Gdata[0] = Gx_data; @@ -1429,8 +1589,8 @@ hypreCUDAKernel_AMSComputePi_copy2(HYPRE_Int nrows, j = read_only_load(i_in + i + lane_id); } - istart = __shfl_sync(HYPRE_WARP_FULL_MASK, j, 0); - iend = __shfl_sync(HYPRE_WARP_FULL_MASK, j, 1); + istart = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, j, 0); + iend = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, j, 1); if (lane_id < dim) { @@ -1439,54 +1599,53 @@ hypreCUDAKernel_AMSComputePi_copy2(HYPRE_Int nrows, for (HYPRE_Int d = 0; d < dim; d++) { - G[d] = __shfl_sync(HYPRE_WARP_FULL_MASK, t, d); + G[d] = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, t, d); } for (j = istart + lane_id; j < iend; j += HYPRE_WARP_SIZE) { - const HYPRE_Real v = data_in ? fabs(read_only_load(&data_in[j])) * 0.5 : 1.0; + const HYPRE_Real v = data_in ? hypre_abs(read_only_load(&data_in[j])) * 0.5 : 1.0; const HYPRE_Int k = j * dim; for (HYPRE_Int d = 0; d < dim; d++) { - data_out[k+d] = v * G[d]; + data_out[k + d] = v * G[d]; } } } #endif -HYPRE_Int hypre_AMSComputePi(hypre_ParCSRMatrix *A, - hypre_ParCSRMatrix *G, - hypre_ParVector *Gx, - hypre_ParVector *Gy, - hypre_ParVector *Gz, - HYPRE_Int dim, - hypre_ParCSRMatrix **Pi_ptr) +HYPRE_Int +hypre_AMSComputePi(hypre_ParCSRMatrix *A, + hypre_ParCSRMatrix *G, + hypre_ParVector *Gx, + hypre_ParVector *Gy, + hypre_ParVector *Gz, + HYPRE_Int dim, + hypre_ParCSRMatrix **Pi_ptr) { + HYPRE_UNUSED_VAR(A); + hypre_ParCSRMatrix *Pi; /* Compute Pi = [Pi_x, Pi_y, Pi_z] */ { HYPRE_Int i, j, d; - HYPRE_Real *Gx_data, *Gy_data, *Gz_data; + HYPRE_Real *Gx_data, *Gy_data = NULL, *Gz_data = NULL; MPI_Comm comm = hypre_ParCSRMatrixComm(G); + HYPRE_BigInt *col_starts_G = hypre_ParCSRMatrixColStarts(G); HYPRE_BigInt global_num_rows = hypre_ParCSRMatrixGlobalNumRows(G); - HYPRE_BigInt global_num_cols = dim*hypre_ParCSRMatrixGlobalNumCols(G); + HYPRE_BigInt global_num_cols = dim * hypre_ParCSRMatrixGlobalNumCols(G); HYPRE_BigInt *row_starts = hypre_ParCSRMatrixRowStarts(G); - HYPRE_BigInt *col_starts; - HYPRE_Int col_starts_size; - HYPRE_Int num_cols_offd = dim*hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(G)); - HYPRE_Int num_nonzeros_diag = dim*hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixDiag(G)); - HYPRE_Int num_nonzeros_offd = dim*hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixOffd(G)); - HYPRE_BigInt *col_starts_G = hypre_ParCSRMatrixColStarts(G); - - col_starts_size = 2; - col_starts = hypre_TAlloc(HYPRE_BigInt, col_starts_size, HYPRE_MEMORY_HOST); - for (i = 0; i < col_starts_size; i++) - col_starts[i] = (HYPRE_BigInt)dim * col_starts_G[i]; + HYPRE_BigInt col_starts[2] = {(HYPRE_BigInt)dim * col_starts_G[0], + (HYPRE_BigInt)dim * col_starts_G[1] + }; + HYPRE_Int num_cols_offd = dim * hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(G)); + HYPRE_Int num_nonzeros_diag = dim * hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixDiag(G)); + HYPRE_Int num_nonzeros_offd = dim * hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixOffd(G)); Pi = hypre_ParCSRMatrixCreate(comm, global_num_rows, @@ -1499,15 +1658,18 @@ HYPRE_Int hypre_AMSComputePi(hypre_ParCSRMatrix *A, hypre_ParCSRMatrixOwnsData(Pi) = 1; hypre_ParCSRMatrixInitialize(Pi); - hypre_TFree(col_starts, HYPRE_MEMORY_HOST); Gx_data = hypre_VectorData(hypre_ParVectorLocalVector(Gx)); if (dim >= 2) + { Gy_data = hypre_VectorData(hypre_ParVectorLocalVector(Gy)); + } if (dim == 3) + { Gz_data = hypre_VectorData(hypre_ParVectorLocalVector(Gz)); + } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy2( hypre_ParCSRMatrixMemoryLocation(G), hypre_ParCSRMatrixMemoryLocation(Pi) ); #endif @@ -1527,45 +1689,49 @@ HYPRE_Int hypre_AMSComputePi(hypre_ParCSRMatrix *A, HYPRE_Int *Pi_diag_J = hypre_CSRMatrixJ(Pi_diag); HYPRE_Real *Pi_diag_data = hypre_CSRMatrixData(Pi_diag); -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if (exec == HYPRE_EXEC_DEVICE) { - HYPRE_THRUST_CALL( transform, - G_diag_I, - G_diag_I + G_diag_nrows + 1, - Pi_diag_I, - dim * _1 ); + hypreDevice_IntScalen( G_diag_I, G_diag_nrows + 1, Pi_diag_I, dim ); - dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(G_diag_nnz, "thread", bDim); + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(G_diag_nnz, "thread", bDim); - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_AMSComputePi_copy1, gDim, bDim, - G_diag_nnz, dim, G_diag_J, Pi_diag_J ); + HYPRE_GPU_LAUNCH( hypreGPUKernel_AMSComputePi_copy1, gDim, bDim, + G_diag_nnz, dim, G_diag_J, Pi_diag_J ); - gDim = hypre_GetDefaultCUDAGridDimension(G_diag_nrows, "warp", bDim); + gDim = hypre_GetDefaultDeviceGridDimension(G_diag_nrows, "warp", bDim); - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_AMSComputePi_copy2, gDim, bDim, - G_diag_nrows, dim, G_diag_I, G_diag_data, Gx_data, Gy_data, Gz_data, - Pi_diag_data ); + HYPRE_GPU_LAUNCH( hypreGPUKernel_AMSComputePi_copy2, gDim, bDim, + G_diag_nrows, dim, G_diag_I, G_diag_data, Gx_data, Gy_data, Gz_data, + Pi_diag_data ); } else #endif { - for (i = 0; i < G_diag_nrows+1; i++) + for (i = 0; i < G_diag_nrows + 1; i++) + { Pi_diag_I[i] = dim * G_diag_I[i]; + } for (i = 0; i < G_diag_nnz; i++) for (d = 0; d < dim; d++) - Pi_diag_J[dim*i+d] = dim*G_diag_J[i]+d; + { + Pi_diag_J[dim * i + d] = dim * G_diag_J[i] + d; + } for (i = 0; i < G_diag_nrows; i++) - for (j = G_diag_I[i]; j < G_diag_I[i+1]; j++) + for (j = G_diag_I[i]; j < G_diag_I[i + 1]; j++) { - *Pi_diag_data++ = fabs(G_diag_data[j]) * 0.5 * Gx_data[i]; + *Pi_diag_data++ = hypre_abs(G_diag_data[j]) * 0.5 * Gx_data[i]; if (dim >= 2) - *Pi_diag_data++ = fabs(G_diag_data[j]) * 0.5 * Gy_data[i]; + { + *Pi_diag_data++ = hypre_abs(G_diag_data[j]) * 0.5 * Gy_data[i]; + } if (dim == 3) - *Pi_diag_data++ = fabs(G_diag_data[j]) * 0.5 * Gz_data[i]; + { + *Pi_diag_data++ = hypre_abs(G_diag_data[j]) * 0.5 * Gz_data[i]; + } } } } @@ -1589,55 +1755,61 @@ HYPRE_Int hypre_AMSComputePi(hypre_ParCSRMatrix *A, HYPRE_BigInt *G_cmap = hypre_ParCSRMatrixColMapOffd(G); HYPRE_BigInt *Pi_cmap = hypre_ParCSRMatrixColMapOffd(Pi); -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if (exec == HYPRE_EXEC_DEVICE) { if (G_offd_ncols) { - HYPRE_THRUST_CALL( transform, - G_offd_I, - G_offd_I + G_offd_nrows + 1, - Pi_offd_I, - dim * _1 ); + hypreDevice_IntScalen( G_offd_I, G_offd_nrows + 1, Pi_offd_I, dim ); } - dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(G_offd_nnz, "thread", bDim); + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(G_offd_nnz, "thread", bDim); - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_AMSComputePi_copy1, gDim, bDim, - G_offd_nnz, dim, G_offd_J, Pi_offd_J ); + HYPRE_GPU_LAUNCH( hypreGPUKernel_AMSComputePi_copy1, gDim, bDim, + G_offd_nnz, dim, G_offd_J, Pi_offd_J ); - gDim = hypre_GetDefaultCUDAGridDimension(G_offd_nrows, "warp", bDim); + gDim = hypre_GetDefaultDeviceGridDimension(G_offd_nrows, "warp", bDim); - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_AMSComputePi_copy2, gDim, bDim, - G_offd_nrows, dim, G_offd_I, G_offd_data, Gx_data, Gy_data, Gz_data, - Pi_offd_data ); + HYPRE_GPU_LAUNCH( hypreGPUKernel_AMSComputePi_copy2, gDim, bDim, + G_offd_nrows, dim, G_offd_I, G_offd_data, Gx_data, Gy_data, Gz_data, + Pi_offd_data ); } else #endif { if (G_offd_ncols) - for (i = 0; i < G_offd_nrows+1; i++) + for (i = 0; i < G_offd_nrows + 1; i++) + { Pi_offd_I[i] = dim * G_offd_I[i]; + } for (i = 0; i < G_offd_nnz; i++) for (d = 0; d < dim; d++) - Pi_offd_J[dim*i+d] = dim*G_offd_J[i]+d; + { + Pi_offd_J[dim * i + d] = dim * G_offd_J[i] + d; + } for (i = 0; i < G_offd_nrows; i++) - for (j = G_offd_I[i]; j < G_offd_I[i+1]; j++) + for (j = G_offd_I[i]; j < G_offd_I[i + 1]; j++) { - *Pi_offd_data++ = fabs(G_offd_data[j]) * 0.5 * Gx_data[i]; + *Pi_offd_data++ = hypre_abs(G_offd_data[j]) * 0.5 * Gx_data[i]; if (dim >= 2) - *Pi_offd_data++ = fabs(G_offd_data[j]) * 0.5 * Gy_data[i]; + { + *Pi_offd_data++ = hypre_abs(G_offd_data[j]) * 0.5 * Gy_data[i]; + } if (dim == 3) - *Pi_offd_data++ = fabs(G_offd_data[j]) * 0.5 * Gz_data[i]; + { + *Pi_offd_data++ = hypre_abs(G_offd_data[j]) * 0.5 * Gz_data[i]; + } } } for (i = 0; i < G_offd_ncols; i++) for (d = 0; d < dim; d++) - Pi_cmap[dim*i+d] = (HYPRE_BigInt)dim * G_cmap[i] + (HYPRE_BigInt)d; + { + Pi_cmap[dim * i + d] = (HYPRE_BigInt)dim * G_cmap[i] + (HYPRE_BigInt)d; + } } } @@ -1658,28 +1830,29 @@ HYPRE_Int hypre_AMSComputePi(hypre_ParCSRMatrix *A, * Gx, Gy, Gz. *--------------------------------------------------------------------------*/ -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) __global__ void -hypreCUDAKernel_AMSComputePixyz_copy(HYPRE_Int nrows, - HYPRE_Int dim, - HYPRE_Int *i_in, - HYPRE_Real *data_in, - HYPRE_Real *Gx_data, - HYPRE_Real *Gy_data, - HYPRE_Real *Gz_data, - HYPRE_Real *data_x_out, - HYPRE_Real *data_y_out, - HYPRE_Real *data_z_out ) +hypreGPUKernel_AMSComputePixyz_copy(hypre_DeviceItem &item, + HYPRE_Int nrows, + HYPRE_Int dim, + HYPRE_Int *i_in, + HYPRE_Real *data_in, + HYPRE_Real *Gx_data, + HYPRE_Real *Gy_data, + HYPRE_Real *Gz_data, + HYPRE_Real *data_x_out, + HYPRE_Real *data_y_out, + HYPRE_Real *data_z_out ) { - const HYPRE_Int i = hypre_cuda_get_grid_warp_id<1,1>(); + const HYPRE_Int i = hypre_gpu_get_grid_warp_id<1, 1>(item); if (i >= nrows) { return; } - const HYPRE_Int lane_id = hypre_cuda_get_lane_id<1>(); - HYPRE_Int j, istart, iend; + const HYPRE_Int lane_id = hypre_gpu_get_lane_id<1>(item); + HYPRE_Int j = 0, istart, iend; HYPRE_Real t, G[3], *Gdata[3], *Odata[3]; Gdata[0] = Gx_data; @@ -1695,8 +1868,8 @@ hypreCUDAKernel_AMSComputePixyz_copy(HYPRE_Int nrows, j = read_only_load(i_in + i + lane_id); } - istart = __shfl_sync(HYPRE_WARP_FULL_MASK, j, 0); - iend = __shfl_sync(HYPRE_WARP_FULL_MASK, j, 1); + istart = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, j, 0); + iend = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, j, 1); if (lane_id < dim) { @@ -1705,12 +1878,12 @@ hypreCUDAKernel_AMSComputePixyz_copy(HYPRE_Int nrows, for (HYPRE_Int d = 0; d < dim; d++) { - G[d] = __shfl_sync(HYPRE_WARP_FULL_MASK, t, d); + G[d] = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, t, d); } for (j = istart + lane_id; j < iend; j += HYPRE_WARP_SIZE) { - const HYPRE_Real v = data_in ? fabs(read_only_load(&data_in[j])) * 0.5 : 1.0; + const HYPRE_Real v = data_in ? hypre_abs(read_only_load(&data_in[j])) * 0.5 : 1.0; for (HYPRE_Int d = 0; d < dim; d++) { @@ -1720,19 +1893,22 @@ hypreCUDAKernel_AMSComputePixyz_copy(HYPRE_Int nrows, } #endif -HYPRE_Int hypre_AMSComputePixyz(hypre_ParCSRMatrix *A, - hypre_ParCSRMatrix *G, - hypre_ParVector *Gx, - hypre_ParVector *Gy, - hypre_ParVector *Gz, - HYPRE_Int dim, - hypre_ParCSRMatrix **Pix_ptr, - hypre_ParCSRMatrix **Piy_ptr, - hypre_ParCSRMatrix **Piz_ptr) +HYPRE_Int +hypre_AMSComputePixyz(hypre_ParCSRMatrix *A, + hypre_ParCSRMatrix *G, + hypre_ParVector *Gx, + hypre_ParVector *Gy, + hypre_ParVector *Gz, + HYPRE_Int dim, + hypre_ParCSRMatrix **Pix_ptr, + hypre_ParCSRMatrix **Piy_ptr, + hypre_ParCSRMatrix **Piz_ptr) { - hypre_ParCSRMatrix *Pix, *Piy, *Piz; + HYPRE_UNUSED_VAR(A); -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + hypre_ParCSRMatrix *Pix, *Piy = NULL, *Piz = NULL; + +#if defined(HYPRE_USING_GPU) HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(G) ); #endif @@ -1792,9 +1968,13 @@ HYPRE_Int hypre_AMSComputePixyz(hypre_ParCSRMatrix *A, Gx_data = hypre_VectorData(hypre_ParVectorLocalVector(Gx)); if (dim >= 2) + { Gy_data = hypre_VectorData(hypre_ParVectorLocalVector(Gy)); + } if (dim == 3) + { Gz_data = hypre_VectorData(hypre_ParVectorLocalVector(Gz)); + } /* Fill-in the diagonal part */ if (dim == 3) @@ -1822,9 +2002,20 @@ HYPRE_Int hypre_AMSComputePixyz(hypre_ParCSRMatrix *A, HYPRE_Int *Piz_diag_J = hypre_CSRMatrixJ(Piz_diag); HYPRE_Real *Piz_diag_data = hypre_CSRMatrixData(Piz_diag); -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if (exec == HYPRE_EXEC_DEVICE) { +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::copy_n, + oneapi::dpl::make_zip_iterator(G_diag_I, G_diag_I, G_diag_I), + G_diag_nrows + 1, + oneapi::dpl::make_zip_iterator(Pix_diag_I, Piy_diag_I, Piz_diag_I) ); + + HYPRE_ONEDPL_CALL( std::copy_n, + oneapi::dpl::make_zip_iterator(G_diag_J, G_diag_J, G_diag_J), + G_diag_nnz, + oneapi::dpl::make_zip_iterator(Pix_diag_J, Piy_diag_J, Piz_diag_J) ); +#else HYPRE_THRUST_CALL( copy_n, thrust::make_zip_iterator(thrust::make_tuple(G_diag_I, G_diag_I, G_diag_I)), G_diag_nrows + 1, @@ -1834,18 +2025,19 @@ HYPRE_Int hypre_AMSComputePixyz(hypre_ParCSRMatrix *A, thrust::make_zip_iterator(thrust::make_tuple(G_diag_J, G_diag_J, G_diag_J)), G_diag_nnz, thrust::make_zip_iterator(thrust::make_tuple(Pix_diag_J, Piy_diag_J, Piz_diag_J)) ); +#endif - dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(G_diag_nrows, "warp", bDim); + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(G_diag_nrows, "warp", bDim); - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_AMSComputePixyz_copy, gDim, bDim, - G_diag_nrows, dim, G_diag_I, G_diag_data, Gx_data, Gy_data, Gz_data, - Pix_diag_data, Piy_diag_data, Piz_diag_data ); + HYPRE_GPU_LAUNCH( hypreGPUKernel_AMSComputePixyz_copy, gDim, bDim, + G_diag_nrows, dim, G_diag_I, G_diag_data, Gx_data, Gy_data, Gz_data, + Pix_diag_data, Piy_diag_data, Piz_diag_data ); } else #endif { - for (i = 0; i < G_diag_nrows+1; i++) + for (i = 0; i < G_diag_nrows + 1; i++) { Pix_diag_I[i] = G_diag_I[i]; Piy_diag_I[i] = G_diag_I[i]; @@ -1860,12 +2052,14 @@ HYPRE_Int hypre_AMSComputePixyz(hypre_ParCSRMatrix *A, } for (i = 0; i < G_diag_nrows; i++) - for (j = G_diag_I[i]; j < G_diag_I[i+1]; j++) + { + for (j = G_diag_I[i]; j < G_diag_I[i + 1]; j++) { - *Pix_diag_data++ = fabs(G_diag_data[j]) * 0.5 * Gx_data[i]; - *Piy_diag_data++ = fabs(G_diag_data[j]) * 0.5 * Gy_data[i]; - *Piz_diag_data++ = fabs(G_diag_data[j]) * 0.5 * Gz_data[i]; + *Pix_diag_data++ = hypre_abs(G_diag_data[j]) * 0.5 * Gx_data[i]; + *Piy_diag_data++ = hypre_abs(G_diag_data[j]) * 0.5 * Gy_data[i]; + *Piz_diag_data++ = hypre_abs(G_diag_data[j]) * 0.5 * Gz_data[i]; } + } } } else if (dim == 2) @@ -1888,9 +2082,20 @@ HYPRE_Int hypre_AMSComputePixyz(hypre_ParCSRMatrix *A, HYPRE_Int *Piy_diag_J = hypre_CSRMatrixJ(Piy_diag); HYPRE_Real *Piy_diag_data = hypre_CSRMatrixData(Piy_diag); -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if (exec == HYPRE_EXEC_DEVICE) { +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::copy_n, + oneapi::dpl::make_zip_iterator(G_diag_I, G_diag_I), + G_diag_nrows + 1, + oneapi::dpl::make_zip_iterator(Pix_diag_I, Piy_diag_I) ); + + HYPRE_ONEDPL_CALL( std::copy_n, + oneapi::dpl::make_zip_iterator(G_diag_J, G_diag_J), + G_diag_nnz, + oneapi::dpl::make_zip_iterator(Pix_diag_J, Piy_diag_J) ); +#else HYPRE_THRUST_CALL( copy_n, thrust::make_zip_iterator(thrust::make_tuple(G_diag_I, G_diag_I)), G_diag_nrows + 1, @@ -1900,18 +2105,19 @@ HYPRE_Int hypre_AMSComputePixyz(hypre_ParCSRMatrix *A, thrust::make_zip_iterator(thrust::make_tuple(G_diag_J, G_diag_J)), G_diag_nnz, thrust::make_zip_iterator(thrust::make_tuple(Pix_diag_J, Piy_diag_J)) ); +#endif - dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(G_diag_nrows, "warp", bDim); + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(G_diag_nrows, "warp", bDim); - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_AMSComputePixyz_copy, gDim, bDim, - G_diag_nrows, dim, G_diag_I, G_diag_data, Gx_data, Gy_data, NULL, - Pix_diag_data, Piy_diag_data, NULL ); + HYPRE_GPU_LAUNCH( hypreGPUKernel_AMSComputePixyz_copy, gDim, bDim, + G_diag_nrows, dim, G_diag_I, G_diag_data, Gx_data, Gy_data, NULL, + Pix_diag_data, Piy_diag_data, NULL ); } else #endif { - for (i = 0; i < G_diag_nrows+1; i++) + for (i = 0; i < G_diag_nrows + 1; i++) { Pix_diag_I[i] = G_diag_I[i]; Piy_diag_I[i] = G_diag_I[i]; @@ -1924,10 +2130,10 @@ HYPRE_Int hypre_AMSComputePixyz(hypre_ParCSRMatrix *A, } for (i = 0; i < G_diag_nrows; i++) - for (j = G_diag_I[i]; j < G_diag_I[i+1]; j++) + for (j = G_diag_I[i]; j < G_diag_I[i + 1]; j++) { - *Pix_diag_data++ = fabs(G_diag_data[j]) * 0.5 * Gx_data[i]; - *Piy_diag_data++ = fabs(G_diag_data[j]) * 0.5 * Gy_data[i]; + *Pix_diag_data++ = hypre_abs(G_diag_data[j]) * 0.5 * Gx_data[i]; + *Piy_diag_data++ = hypre_abs(G_diag_data[j]) * 0.5 * Gy_data[i]; } } } @@ -1946,9 +2152,20 @@ HYPRE_Int hypre_AMSComputePixyz(hypre_ParCSRMatrix *A, HYPRE_Int *Pix_diag_J = hypre_CSRMatrixJ(Pix_diag); HYPRE_Real *Pix_diag_data = hypre_CSRMatrixData(Pix_diag); -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if (exec == HYPRE_EXEC_DEVICE) { +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::copy_n, + G_diag_I, + G_diag_nrows + 1, + Pix_diag_I ); + + HYPRE_ONEDPL_CALL( std::copy_n, + G_diag_J, + G_diag_nnz, + Pix_diag_J ); +#else HYPRE_THRUST_CALL( copy_n, G_diag_I, G_diag_nrows + 1, @@ -1958,18 +2175,19 @@ HYPRE_Int hypre_AMSComputePixyz(hypre_ParCSRMatrix *A, G_diag_J, G_diag_nnz, Pix_diag_J ); +#endif - dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(G_diag_nrows, "warp", bDim); + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(G_diag_nrows, "warp", bDim); - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_AMSComputePixyz_copy, gDim, bDim, - G_diag_nrows, dim, G_diag_I, G_diag_data, Gx_data, NULL, NULL, - Pix_diag_data, NULL, NULL ); + HYPRE_GPU_LAUNCH( hypreGPUKernel_AMSComputePixyz_copy, gDim, bDim, + G_diag_nrows, dim, G_diag_I, G_diag_data, Gx_data, NULL, NULL, + Pix_diag_data, NULL, NULL ); } else #endif { - for (i = 0; i < G_diag_nrows+1; i++) + for (i = 0; i < G_diag_nrows + 1; i++) { Pix_diag_I[i] = G_diag_I[i]; } @@ -1980,9 +2198,9 @@ HYPRE_Int hypre_AMSComputePixyz(hypre_ParCSRMatrix *A, } for (i = 0; i < G_diag_nrows; i++) - for (j = G_diag_I[i]; j < G_diag_I[i+1]; j++) + for (j = G_diag_I[i]; j < G_diag_I[i + 1]; j++) { - *Pix_diag_data++ = fabs(G_diag_data[j]) * 0.5 * Gx_data[i]; + *Pix_diag_data++ = hypre_abs(G_diag_data[j]) * 0.5 * Gx_data[i]; } } } @@ -2020,9 +2238,23 @@ HYPRE_Int hypre_AMSComputePixyz(hypre_ParCSRMatrix *A, HYPRE_BigInt *Piy_cmap = hypre_ParCSRMatrixColMapOffd(Piy); HYPRE_BigInt *Piz_cmap = hypre_ParCSRMatrixColMapOffd(Piz); -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if (exec == HYPRE_EXEC_DEVICE) { +#if defined(HYPRE_USING_SYCL) + if (G_offd_ncols) + { + HYPRE_ONEDPL_CALL( std::copy_n, + oneapi::dpl::make_zip_iterator(G_offd_I, G_offd_I, G_offd_I), + G_offd_nrows + 1, + oneapi::dpl::make_zip_iterator(Pix_offd_I, Piy_offd_I, Piz_offd_I) ); + } + + HYPRE_ONEDPL_CALL( std::copy_n, + oneapi::dpl::make_zip_iterator(G_offd_J, G_offd_J, G_offd_J), + G_offd_nnz, + oneapi::dpl::make_zip_iterator(Pix_offd_J, Piy_offd_J, Piz_offd_J) ); +#else if (G_offd_ncols) { HYPRE_THRUST_CALL( copy_n, @@ -2035,19 +2267,20 @@ HYPRE_Int hypre_AMSComputePixyz(hypre_ParCSRMatrix *A, thrust::make_zip_iterator(thrust::make_tuple(G_offd_J, G_offd_J, G_offd_J)), G_offd_nnz, thrust::make_zip_iterator(thrust::make_tuple(Pix_offd_J, Piy_offd_J, Piz_offd_J)) ); +#endif - dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(G_offd_nrows, "warp", bDim); + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(G_offd_nrows, "warp", bDim); - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_AMSComputePixyz_copy, gDim, bDim, - G_offd_nrows, dim, G_offd_I, G_offd_data, Gx_data, Gy_data, Gz_data, - Pix_offd_data, Piy_offd_data, Piz_offd_data ); + HYPRE_GPU_LAUNCH( hypreGPUKernel_AMSComputePixyz_copy, gDim, bDim, + G_offd_nrows, dim, G_offd_I, G_offd_data, Gx_data, Gy_data, Gz_data, + Pix_offd_data, Piy_offd_data, Piz_offd_data ); } else #endif { if (G_offd_ncols) - for (i = 0; i < G_offd_nrows+1; i++) + for (i = 0; i < G_offd_nrows + 1; i++) { Pix_offd_I[i] = G_offd_I[i]; Piy_offd_I[i] = G_offd_I[i]; @@ -2062,11 +2295,11 @@ HYPRE_Int hypre_AMSComputePixyz(hypre_ParCSRMatrix *A, } for (i = 0; i < G_offd_nrows; i++) - for (j = G_offd_I[i]; j < G_offd_I[i+1]; j++) + for (j = G_offd_I[i]; j < G_offd_I[i + 1]; j++) { - *Pix_offd_data++ = fabs(G_offd_data[j]) * 0.5 * Gx_data[i]; - *Piy_offd_data++ = fabs(G_offd_data[j]) * 0.5 * Gy_data[i]; - *Piz_offd_data++ = fabs(G_offd_data[j]) * 0.5 * Gz_data[i]; + *Pix_offd_data++ = hypre_abs(G_offd_data[j]) * 0.5 * Gx_data[i]; + *Piy_offd_data++ = hypre_abs(G_offd_data[j]) * 0.5 * Gy_data[i]; + *Piz_offd_data++ = hypre_abs(G_offd_data[j]) * 0.5 * Gz_data[i]; } } @@ -2102,9 +2335,23 @@ HYPRE_Int hypre_AMSComputePixyz(hypre_ParCSRMatrix *A, HYPRE_BigInt *Pix_cmap = hypre_ParCSRMatrixColMapOffd(Pix); HYPRE_BigInt *Piy_cmap = hypre_ParCSRMatrixColMapOffd(Piy); -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if (exec == HYPRE_EXEC_DEVICE) { +#if defined(HYPRE_USING_SYCL) + if (G_offd_ncols) + { + HYPRE_ONEDPL_CALL( std::copy_n, + oneapi::dpl::make_zip_iterator(G_offd_I, G_offd_I), + G_offd_nrows + 1, + oneapi::dpl::make_zip_iterator(Pix_offd_I, Piy_offd_I) ); + } + + HYPRE_ONEDPL_CALL( std::copy_n, + oneapi::dpl::make_zip_iterator(G_offd_J, G_offd_J), + G_offd_nnz, + oneapi::dpl::make_zip_iterator(Pix_offd_J, Piy_offd_J) ); +#else if (G_offd_ncols) { HYPRE_THRUST_CALL( copy_n, @@ -2117,23 +2364,26 @@ HYPRE_Int hypre_AMSComputePixyz(hypre_ParCSRMatrix *A, thrust::make_zip_iterator(thrust::make_tuple(G_offd_J, G_offd_J)), G_offd_nnz, thrust::make_zip_iterator(thrust::make_tuple(Pix_offd_J, Piy_offd_J)) ); +#endif - dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(G_offd_nrows, "warp", bDim); + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(G_offd_nrows, "warp", bDim); - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_AMSComputePixyz_copy, gDim, bDim, - G_offd_nrows, dim, G_offd_I, G_offd_data, Gx_data, Gy_data, NULL, - Pix_offd_data, Piy_offd_data, NULL ); + HYPRE_GPU_LAUNCH( hypreGPUKernel_AMSComputePixyz_copy, gDim, bDim, + G_offd_nrows, dim, G_offd_I, G_offd_data, Gx_data, Gy_data, NULL, + Pix_offd_data, Piy_offd_data, NULL ); } else #endif { if (G_offd_ncols) - for (i = 0; i < G_offd_nrows+1; i++) + { + for (i = 0; i < G_offd_nrows + 1; i++) { Pix_offd_I[i] = G_offd_I[i]; Piy_offd_I[i] = G_offd_I[i]; } + } for (i = 0; i < G_offd_nnz; i++) { @@ -2142,11 +2392,13 @@ HYPRE_Int hypre_AMSComputePixyz(hypre_ParCSRMatrix *A, } for (i = 0; i < G_offd_nrows; i++) - for (j = G_offd_I[i]; j < G_offd_I[i+1]; j++) + { + for (j = G_offd_I[i]; j < G_offd_I[i + 1]; j++) { - *Pix_offd_data++ = fabs(G_offd_data[j]) * 0.5 * Gx_data[i]; - *Piy_offd_data++ = fabs(G_offd_data[j]) * 0.5 * Gy_data[i]; + *Pix_offd_data++ = hypre_abs(G_offd_data[j]) * 0.5 * Gx_data[i]; + *Piy_offd_data++ = hypre_abs(G_offd_data[j]) * 0.5 * Gy_data[i]; } + } } for (i = 0; i < G_offd_ncols; i++) @@ -2174,9 +2426,23 @@ HYPRE_Int hypre_AMSComputePixyz(hypre_ParCSRMatrix *A, HYPRE_BigInt *G_cmap = hypre_ParCSRMatrixColMapOffd(G); HYPRE_BigInt *Pix_cmap = hypre_ParCSRMatrixColMapOffd(Pix); -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if (exec == HYPRE_EXEC_DEVICE) { +#if defined(HYPRE_USING_SYCL) + if (G_offd_ncols) + { + HYPRE_ONEDPL_CALL( std::copy_n, + G_offd_I, + G_offd_nrows + 1, + Pix_offd_I ); + } + + HYPRE_ONEDPL_CALL( std::copy_n, + G_offd_J, + G_offd_nnz, + Pix_offd_J ); +#else if (G_offd_ncols) { HYPRE_THRUST_CALL( copy_n, @@ -2189,19 +2455,20 @@ HYPRE_Int hypre_AMSComputePixyz(hypre_ParCSRMatrix *A, G_offd_J, G_offd_nnz, Pix_offd_J ); +#endif - dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(G_offd_nrows, "warp", bDim); + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(G_offd_nrows, "warp", bDim); - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_AMSComputePixyz_copy, gDim, bDim, - G_offd_nrows, dim, G_offd_I, G_offd_data, Gx_data, NULL, NULL, - Pix_offd_data, NULL, NULL ); + HYPRE_GPU_LAUNCH( hypreGPUKernel_AMSComputePixyz_copy, gDim, bDim, + G_offd_nrows, dim, G_offd_I, G_offd_data, Gx_data, NULL, NULL, + Pix_offd_data, NULL, NULL ); } else #endif { if (G_offd_ncols) - for (i = 0; i < G_offd_nrows+1; i++) + for (i = 0; i < G_offd_nrows + 1; i++) { Pix_offd_I[i] = G_offd_I[i]; } @@ -2212,9 +2479,9 @@ HYPRE_Int hypre_AMSComputePixyz(hypre_ParCSRMatrix *A, } for (i = 0; i < G_offd_nrows; i++) - for (j = G_offd_I[i]; j < G_offd_I[i+1]; j++) + for (j = G_offd_I[i]; j < G_offd_I[i + 1]; j++) { - *Pix_offd_data++ = fabs(G_offd_data[j]) * 0.5 * Gx_data[i]; + *Pix_offd_data++ = hypre_abs(G_offd_data[j]) * 0.5 * Gx_data[i]; } } @@ -2227,33 +2494,38 @@ HYPRE_Int hypre_AMSComputePixyz(hypre_ParCSRMatrix *A, *Pix_ptr = Pix; if (dim >= 2) + { *Piy_ptr = Piy; + } if (dim == 3) + { *Piz_ptr = Piz; + } return hypre_error_flag; } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) __global__ void -hypreCUDAKernel_AMSComputeGPi_copy2(HYPRE_Int nrows, - HYPRE_Int dim, - HYPRE_Int *i_in, - HYPRE_Real *data_in, - HYPRE_Real *Gx_data, - HYPRE_Real *Gy_data, - HYPRE_Real *Gz_data, - HYPRE_Real *data_out) +hypreGPUKernel_AMSComputeGPi_copy2(hypre_DeviceItem &item, + HYPRE_Int nrows, + HYPRE_Int dim, + HYPRE_Int *i_in, + HYPRE_Real *data_in, + HYPRE_Real *Gx_data, + HYPRE_Real *Gy_data, + HYPRE_Real *Gz_data, + HYPRE_Real *data_out) { - const HYPRE_Int i = hypre_cuda_get_grid_warp_id<1,1>(); + const HYPRE_Int i = hypre_gpu_get_grid_warp_id<1, 1>(item); if (i >= nrows) { return; } - const HYPRE_Int lane_id = hypre_cuda_get_lane_id<1>(); - HYPRE_Int j, istart, iend; + const HYPRE_Int lane_id = hypre_gpu_get_lane_id<1>(item); + HYPRE_Int j = 0, istart, iend; HYPRE_Real t, G[3], *Gdata[3]; Gdata[0] = Gx_data; @@ -2265,8 +2537,8 @@ hypreCUDAKernel_AMSComputeGPi_copy2(HYPRE_Int nrows, j = read_only_load(i_in + i + lane_id); } - istart = __shfl_sync(HYPRE_WARP_FULL_MASK, j, 0); - iend = __shfl_sync(HYPRE_WARP_FULL_MASK, j, 1); + istart = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, j, 0); + iend = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, j, 1); if (lane_id < dim - 1) { @@ -2275,19 +2547,19 @@ hypreCUDAKernel_AMSComputeGPi_copy2(HYPRE_Int nrows, for (HYPRE_Int d = 0; d < dim - 1; d++) { - G[d] = __shfl_sync(HYPRE_WARP_FULL_MASK, t, d); + G[d] = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, t, d); } for (j = istart + lane_id; j < iend; j += HYPRE_WARP_SIZE) { const HYPRE_Real u = read_only_load(&data_in[j]); - const HYPRE_Real v = fabs(u) * 0.5; + const HYPRE_Real v = hypre_abs(u) * 0.5; const HYPRE_Int k = j * dim; data_out[k] = u; for (HYPRE_Int d = 0; d < dim - 1; d++) { - data_out[k+d+1] = v * G[d]; + data_out[k + d + 1] = v * G[d]; } } } @@ -2301,14 +2573,17 @@ hypreCUDAKernel_AMSComputeGPi_copy2(HYPRE_Int nrows, * to the edge finite elements space. *--------------------------------------------------------------------------*/ -HYPRE_Int hypre_AMSComputeGPi(hypre_ParCSRMatrix *A, - hypre_ParCSRMatrix *G, - hypre_ParVector *Gx, - hypre_ParVector *Gy, - hypre_ParVector *Gz, - HYPRE_Int dim, - hypre_ParCSRMatrix **GPi_ptr) +HYPRE_Int +hypre_AMSComputeGPi(hypre_ParCSRMatrix *A, + hypre_ParCSRMatrix *G, + hypre_ParVector *Gx, + hypre_ParVector *Gy, + hypre_ParVector *Gz, + HYPRE_Int dim, + hypre_ParCSRMatrix **GPi_ptr) { + HYPRE_UNUSED_VAR(A); + hypre_ParCSRMatrix *GPi; /* Take into account G */ @@ -2318,22 +2593,19 @@ HYPRE_Int hypre_AMSComputeGPi(hypre_ParCSRMatrix *A, { HYPRE_Int i, j, d; - HYPRE_Real *Gx_data, *Gy_data, *Gz_data; + HYPRE_Real *Gx_data, *Gy_data = NULL, *Gz_data = NULL; MPI_Comm comm = hypre_ParCSRMatrixComm(G); + HYPRE_BigInt *col_starts_G = hypre_ParCSRMatrixColStarts(G); HYPRE_BigInt global_num_rows = hypre_ParCSRMatrixGlobalNumRows(G); - HYPRE_BigInt global_num_cols = dim*hypre_ParCSRMatrixGlobalNumCols(G); + HYPRE_BigInt global_num_cols = dim * hypre_ParCSRMatrixGlobalNumCols(G); HYPRE_BigInt *row_starts = hypre_ParCSRMatrixRowStarts(G); - HYPRE_BigInt *col_starts; - HYPRE_Int col_starts_size; - HYPRE_Int num_cols_offd = dim*hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(G)); - HYPRE_Int num_nonzeros_diag = dim*hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixDiag(G)); - HYPRE_Int num_nonzeros_offd = dim*hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixOffd(G)); - HYPRE_BigInt *col_starts_G = hypre_ParCSRMatrixColStarts(G); - col_starts_size = 2; - col_starts = hypre_TAlloc(HYPRE_BigInt, col_starts_size, HYPRE_MEMORY_HOST); - for (i = 0; i < col_starts_size; i++) - col_starts[i] = (HYPRE_BigInt) dim * col_starts_G[i]; + HYPRE_BigInt col_starts[2] = {(HYPRE_BigInt)dim * col_starts_G[0], + (HYPRE_BigInt)dim * col_starts_G[1] + }; + HYPRE_Int num_cols_offd = dim * hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(G)); + HYPRE_Int num_nonzeros_diag = dim * hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixDiag(G)); + HYPRE_Int num_nonzeros_offd = dim * hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixOffd(G)); GPi = hypre_ParCSRMatrixCreate(comm, global_num_rows, @@ -2349,11 +2621,15 @@ HYPRE_Int hypre_AMSComputeGPi(hypre_ParCSRMatrix *A, Gx_data = hypre_VectorData(hypre_ParVectorLocalVector(Gx)); if (dim >= 3) + { Gy_data = hypre_VectorData(hypre_ParVectorLocalVector(Gy)); + } if (dim == 4) + { Gz_data = hypre_VectorData(hypre_ParVectorLocalVector(Gz)); + } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy2( hypre_ParCSRMatrixMemoryLocation(G), hypre_ParCSRMatrixMemoryLocation(GPi) ); #endif @@ -2373,46 +2649,50 @@ HYPRE_Int hypre_AMSComputeGPi(hypre_ParCSRMatrix *A, HYPRE_Int *GPi_diag_J = hypre_CSRMatrixJ(GPi_diag); HYPRE_Real *GPi_diag_data = hypre_CSRMatrixData(GPi_diag); -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if (exec == HYPRE_EXEC_DEVICE) { - HYPRE_THRUST_CALL( transform, - G_diag_I, - G_diag_I + G_diag_nrows + 1, - GPi_diag_I, - dim * _1 ); + hypreDevice_IntScalen( G_diag_I, G_diag_nrows + 1, GPi_diag_I, dim ); - dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(G_diag_nnz, "thread", bDim); + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(G_diag_nnz, "thread", bDim); - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_AMSComputePi_copy1, gDim, bDim, - G_diag_nnz, dim, G_diag_J, GPi_diag_J ); + HYPRE_GPU_LAUNCH( hypreGPUKernel_AMSComputePi_copy1, gDim, bDim, + G_diag_nnz, dim, G_diag_J, GPi_diag_J ); - gDim = hypre_GetDefaultCUDAGridDimension(G_diag_nrows, "warp", bDim); + gDim = hypre_GetDefaultDeviceGridDimension(G_diag_nrows, "warp", bDim); - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_AMSComputeGPi_copy2, gDim, bDim, - G_diag_nrows, dim, G_diag_I, G_diag_data, Gx_data, Gy_data, Gz_data, - GPi_diag_data ); + HYPRE_GPU_LAUNCH( hypreGPUKernel_AMSComputeGPi_copy2, gDim, bDim, + G_diag_nrows, dim, G_diag_I, G_diag_data, Gx_data, Gy_data, Gz_data, + GPi_diag_data ); } else #endif { - for (i = 0; i < G_diag_nrows+1; i++) + for (i = 0; i < G_diag_nrows + 1; i++) + { GPi_diag_I[i] = dim * G_diag_I[i]; + } for (i = 0; i < G_diag_nnz; i++) for (d = 0; d < dim; d++) - GPi_diag_J[dim*i+d] = dim*G_diag_J[i]+d; + { + GPi_diag_J[dim * i + d] = dim * G_diag_J[i] + d; + } for (i = 0; i < G_diag_nrows; i++) - for (j = G_diag_I[i]; j < G_diag_I[i+1]; j++) + for (j = G_diag_I[i]; j < G_diag_I[i + 1]; j++) { *GPi_diag_data++ = G_diag_data[j]; - *GPi_diag_data++ = fabs(G_diag_data[j]) * 0.5 * Gx_data[i]; + *GPi_diag_data++ = hypre_abs(G_diag_data[j]) * 0.5 * Gx_data[i]; if (dim >= 3) - *GPi_diag_data++ = fabs(G_diag_data[j]) * 0.5 * Gy_data[i]; + { + *GPi_diag_data++ = hypre_abs(G_diag_data[j]) * 0.5 * Gy_data[i]; + } if (dim == 4) - *GPi_diag_data++ = fabs(G_diag_data[j]) * 0.5 * Gz_data[i]; + { + *GPi_diag_data++ = hypre_abs(G_diag_data[j]) * 0.5 * Gz_data[i]; + } } } } @@ -2436,56 +2716,62 @@ HYPRE_Int hypre_AMSComputeGPi(hypre_ParCSRMatrix *A, HYPRE_BigInt *G_cmap = hypre_ParCSRMatrixColMapOffd(G); HYPRE_BigInt *GPi_cmap = hypre_ParCSRMatrixColMapOffd(GPi); -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if (exec == HYPRE_EXEC_DEVICE) { if (G_offd_ncols) { - HYPRE_THRUST_CALL( transform, - G_offd_I, - G_offd_I + G_offd_nrows + 1, - GPi_offd_I, - dim * _1 ); + hypreDevice_IntScalen( G_offd_I, G_offd_nrows + 1, GPi_offd_I, dim ); } - dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(G_offd_nnz, "thread", bDim); + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(G_offd_nnz, "thread", bDim); - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_AMSComputePi_copy1, gDim, bDim, - G_offd_nnz, dim, G_offd_J, GPi_offd_J ); + HYPRE_GPU_LAUNCH( hypreGPUKernel_AMSComputePi_copy1, gDim, bDim, + G_offd_nnz, dim, G_offd_J, GPi_offd_J ); - gDim = hypre_GetDefaultCUDAGridDimension(G_offd_nrows, "warp", bDim); + gDim = hypre_GetDefaultDeviceGridDimension(G_offd_nrows, "warp", bDim); - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_AMSComputeGPi_copy2, gDim, bDim, - G_offd_nrows, dim, G_offd_I, G_offd_data, Gx_data, Gy_data, Gz_data, - GPi_offd_data ); + HYPRE_GPU_LAUNCH( hypreGPUKernel_AMSComputeGPi_copy2, gDim, bDim, + G_offd_nrows, dim, G_offd_I, G_offd_data, Gx_data, Gy_data, Gz_data, + GPi_offd_data ); } else #endif { if (G_offd_ncols) - for (i = 0; i < G_offd_nrows+1; i++) + for (i = 0; i < G_offd_nrows + 1; i++) + { GPi_offd_I[i] = dim * G_offd_I[i]; + } for (i = 0; i < G_offd_nnz; i++) for (d = 0; d < dim; d++) - GPi_offd_J[dim*i+d] = dim*G_offd_J[i]+d; + { + GPi_offd_J[dim * i + d] = dim * G_offd_J[i] + d; + } for (i = 0; i < G_offd_nrows; i++) - for (j = G_offd_I[i]; j < G_offd_I[i+1]; j++) + for (j = G_offd_I[i]; j < G_offd_I[i + 1]; j++) { *GPi_offd_data++ = G_offd_data[j]; - *GPi_offd_data++ = fabs(G_offd_data[j]) * 0.5 * Gx_data[i]; + *GPi_offd_data++ = hypre_abs(G_offd_data[j]) * 0.5 * Gx_data[i]; if (dim >= 3) - *GPi_offd_data++ = fabs(G_offd_data[j]) * 0.5 * Gy_data[i]; + { + *GPi_offd_data++ = hypre_abs(G_offd_data[j]) * 0.5 * Gy_data[i]; + } if (dim == 4) - *GPi_offd_data++ = fabs(G_offd_data[j]) * 0.5 * Gz_data[i]; + { + *GPi_offd_data++ = hypre_abs(G_offd_data[j]) * 0.5 * Gz_data[i]; + } } } for (i = 0; i < G_offd_ncols; i++) for (d = 0; d < dim; d++) - GPi_cmap[dim*i+d] = dim*G_cmap[i]+d; + { + GPi_cmap[dim * i + d] = dim * G_cmap[i] + d; + } } } @@ -2505,23 +2791,24 @@ HYPRE_Int hypre_AMSComputeGPi(hypre_ParCSRMatrix *A, * - hypre_AMSSetDiscreteGradient() * - hypre_AMSSetCoordinateVectors() or hypre_AMSSetEdgeConstantVectors *--------------------------------------------------------------------------*/ -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) __global__ void -hypreCUDAKernel_FixInterNodes( HYPRE_Int nrows, - HYPRE_Int *G0t_diag_i, - HYPRE_Complex *G0t_diag_data, - HYPRE_Int *G0t_offd_i, - HYPRE_Complex *G0t_offd_data, - HYPRE_Real *interior_nodes_data) +hypreGPUKernel_FixInterNodes( hypre_DeviceItem &item, + HYPRE_Int nrows, + HYPRE_Int *G0t_diag_i, + HYPRE_Complex *G0t_diag_data, + HYPRE_Int *G0t_offd_i, + HYPRE_Complex *G0t_offd_data, + HYPRE_Real *interior_nodes_data) { - HYPRE_Int row_i = hypre_cuda_get_grid_warp_id<1,1>(); + HYPRE_Int row_i = hypre_gpu_get_grid_warp_id<1, 1>(item); if (row_i >= nrows) { return; } - HYPRE_Int lane = hypre_cuda_get_lane_id<1>(); + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); HYPRE_Int not1 = 0; if (lane == 0) @@ -2529,14 +2816,14 @@ hypreCUDAKernel_FixInterNodes( HYPRE_Int nrows, not1 = read_only_load(&interior_nodes_data[row_i]) != 1.0; } - not1 = __shfl_sync(HYPRE_WARP_FULL_MASK, not1, 0); + not1 = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, not1, 0); if (!not1) { return; } - HYPRE_Int p1, q1, p2 = 0, q2 = 0; + HYPRE_Int p1 = 0, q1, p2 = 0, q2 = 0; bool nonempty_offd = G0t_offd_data != NULL; if (lane < 2) @@ -2548,12 +2835,12 @@ hypreCUDAKernel_FixInterNodes( HYPRE_Int nrows, } } - q1 = __shfl_sync(HYPRE_WARP_FULL_MASK, p1, 1); - p1 = __shfl_sync(HYPRE_WARP_FULL_MASK, p1, 0); + q1 = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p1, 1); + p1 = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p1, 0); if (nonempty_offd) { - q2 = __shfl_sync(HYPRE_WARP_FULL_MASK, p2, 1); - p2 = __shfl_sync(HYPRE_WARP_FULL_MASK, p2, 0); + q2 = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p2, 1); + p2 = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p2, 0); } for (HYPRE_Int j = p1 + lane; j < q1; j += HYPRE_WARP_SIZE) @@ -2567,33 +2854,34 @@ hypreCUDAKernel_FixInterNodes( HYPRE_Int nrows, } __global__ void -hypreCUDAKernel_AMSSetupScaleGGt( HYPRE_Int Gt_num_rows, - HYPRE_Int *Gt_diag_i, - HYPRE_Int *Gt_diag_j, - HYPRE_Real *Gt_diag_data, - HYPRE_Int *Gt_offd_i, - HYPRE_Real *Gt_offd_data, - HYPRE_Real *Gx_data, - HYPRE_Real *Gy_data, - HYPRE_Real *Gz_data ) +hypreGPUKernel_AMSSetupScaleGGt( hypre_DeviceItem &item, + HYPRE_Int Gt_num_rows, + HYPRE_Int *Gt_diag_i, + HYPRE_Int *Gt_diag_j, + HYPRE_Real *Gt_diag_data, + HYPRE_Int *Gt_offd_i, + HYPRE_Real *Gt_offd_data, + HYPRE_Real *Gx_data, + HYPRE_Real *Gy_data, + HYPRE_Real *Gz_data ) { - HYPRE_Int row_i = hypre_cuda_get_grid_warp_id<1,1>(); + HYPRE_Int row_i = hypre_gpu_get_grid_warp_id<1, 1>(item); if (row_i >= Gt_num_rows) { return; } - HYPRE_Int lane = hypre_cuda_get_lane_id<1>(); + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); HYPRE_Real h2 = 0.0; - HYPRE_Int ne, p1, q1, p2 = 0, q2 = 0; + HYPRE_Int ne, p1 = 0, q1, p2 = 0, q2 = 0; if (lane < 2) { p1 = read_only_load(Gt_diag_i + row_i + lane); } - q1 = __shfl_sync(HYPRE_WARP_FULL_MASK, p1, 1); - p1 = __shfl_sync(HYPRE_WARP_FULL_MASK, p1, 0); + q1 = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p1, 1); + p1 = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p1, 0); ne = q1 - p1; if (ne == 0) @@ -2607,8 +2895,8 @@ hypreCUDAKernel_AMSSetupScaleGGt( HYPRE_Int Gt_num_rows, { p2 = read_only_load(Gt_offd_i + row_i + lane); } - q2 = __shfl_sync(HYPRE_WARP_FULL_MASK, p2, 1); - p2 = __shfl_sync(HYPRE_WARP_FULL_MASK, p2, 0); + q2 = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p2, 1); + p2 = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p2, 0); } for (HYPRE_Int j = p1 + lane; j < q1; j += HYPRE_WARP_SIZE) @@ -2618,10 +2906,10 @@ hypreCUDAKernel_AMSSetupScaleGGt( HYPRE_Int Gt_num_rows, const HYPRE_Real Gy = read_only_load(&Gy_data[k]); const HYPRE_Real Gz = read_only_load(&Gz_data[k]); - h2 += Gx*Gx + Gy*Gy + Gz*Gz; + h2 += Gx * Gx + Gy * Gy + Gz * Gz; } - h2 = warp_allreduce_sum(h2) / ne; + h2 = warp_allreduce_sum(item, h2) / ne; for (HYPRE_Int j = p1 + lane; j < q1; j += HYPRE_WARP_SIZE) { @@ -2635,12 +2923,16 @@ hypreCUDAKernel_AMSSetupScaleGGt( HYPRE_Int Gt_num_rows, } #endif -HYPRE_Int hypre_AMSSetup(void *solver, - hypre_ParCSRMatrix *A, - hypre_ParVector *b, - hypre_ParVector *x) +HYPRE_Int +hypre_AMSSetup(void *solver, + hypre_ParCSRMatrix *A, + hypre_ParVector *b, + hypre_ParVector *x) { -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + HYPRE_UNUSED_VAR(b); + HYPRE_UNUSED_VAR(x); + +#if defined(HYPRE_USING_GPU) HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(A) ); #endif @@ -2673,16 +2965,16 @@ HYPRE_Int hypre_AMSSetup(void *solver, hypre_CSRMatrix *G0to = hypre_ParCSRMatrixOffd(G0t); HYPRE_Int *G0toI = hypre_CSRMatrixI(G0to); HYPRE_Real *G0toA = hypre_CSRMatrixData(G0to); - HYPRE_Real *interior_nodes_data=hypre_VectorData( - hypre_ParVectorLocalVector((hypre_ParVector*) ams_data -> interior_nodes)); + HYPRE_Real *interior_nodes_data = hypre_VectorData( + hypre_ParVectorLocalVector((hypre_ParVector*) ams_data -> interior_nodes)); -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if (exec == HYPRE_EXEC_DEVICE) { - dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(nv, "warp", bDim); - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_FixInterNodes, gDim, bDim, - nv, G0tdI, G0tdA, G0toI, G0toA, interior_nodes_data ); + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(nv, "warp", bDim); + HYPRE_GPU_LAUNCH( hypreGPUKernel_FixInterNodes, gDim, bDim, + nv, G0tdI, G0tdA, G0toI, G0toA, interior_nodes_data ); } else #endif @@ -2691,11 +2983,15 @@ HYPRE_Int hypre_AMSSetup(void *solver, { if (interior_nodes_data[i] != 1) { - for (j = G0tdI[i]; j < G0tdI[i+1]; j++) + for (j = G0tdI[i]; j < G0tdI[i + 1]; j++) + { G0tdA[j] = 0.0; + } if (G0toI) - for (j = G0toI[i]; j < G0toI[i+1]; j++) + for (j = G0toI[i]; j < G0toI[i + 1]; j++) + { G0toA[j] = 0.0; + } } } } @@ -2703,7 +2999,7 @@ HYPRE_Int hypre_AMSSetup(void *solver, hypre_ParCSRMatrixTranspose(G0t, & ams_data -> G0, 1); /* Construct the subspace matrix A_G0 = G0^T G0 */ -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if (exec == HYPRE_EXEC_DEVICE) { ams_data -> A_G0 = hypre_ParCSRMatMat(G0t, ams_data -> G0); @@ -2738,7 +3034,7 @@ HYPRE_Int hypre_AMSSetup(void *solver, NOTE: this can be optimized significantly by taking into account that the sparsity pattern of A is subset of the sparsity pattern of G0 G0^T */ { -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) hypre_ParCSRMatrix *A; if (exec == HYPRE_EXEC_DEVICE) { @@ -2762,7 +3058,7 @@ HYPRE_Int hypre_AMSSetup(void *solver, HYPRE_Int *B_diag_i = hypre_CSRMatrixI(hypre_ParCSRMatrixDiag(B)); HYPRE_Int *B_offd_i = hypre_CSRMatrixI(hypre_ParCSRMatrixOffd(B)); lfactor = -1; -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if (exec == HYPRE_EXEC_DEVICE) { HYPRE_Int nnz_diag = hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixDiag(B)); @@ -2774,6 +3070,26 @@ HYPRE_Int hypre_AMSSetup(void *solver, hypre_TMemcpy(&nnz, &B_offd_i[B_num_rows], HYPRE_Int, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); hypre_assert(nnz == nnz_offd); #endif +#if defined(HYPRE_USING_SYCL) + if (nnz_diag) + { + lfactor = HYPRE_ONEDPL_CALL( std::reduce, + oneapi::dpl::make_transform_iterator(B_diag_data, absolute_value()), + oneapi::dpl::make_transform_iterator(B_diag_data + nnz_diag, absolute_value()), + -1.0, + sycl::maximum() ); + } + + if (nnz_offd) + { + lfactor = HYPRE_ONEDPL_CALL( std::reduce, + oneapi::dpl::make_transform_iterator(B_offd_data, absolute_value()), + oneapi::dpl::make_transform_iterator(B_offd_data + nnz_offd, absolute_value()), + lfactor, + sycl::maximum() ); + + } +#else if (nnz_diag) { lfactor = HYPRE_THRUST_CALL( reduce, @@ -2792,16 +3108,21 @@ HYPRE_Int hypre_AMSSetup(void *solver, thrust::maximum() ); } +#endif } else #endif { for (i = 0; i < B_diag_i[B_num_rows]; i++) - if (fabs(B_diag_data[i]) > lfactor) - lfactor = fabs(B_diag_data[i]); + if (hypre_abs(B_diag_data[i]) > lfactor) + { + lfactor = hypre_abs(B_diag_data[i]); + } for (i = 0; i < B_offd_i[B_num_rows]; i++) - if (fabs(B_offd_data[i]) > lfactor) - lfactor = fabs(B_offd_data[i]); + if (hypre_abs(B_offd_data[i]) > lfactor) + { + lfactor = hypre_abs(B_offd_data[i]); + } } lfactor *= 1e-10; /* scaling factor: max|A_ij|*1e-10 */ @@ -2835,8 +3156,8 @@ HYPRE_Int hypre_AMSSetup(void *solver, HYPRE_Real factor, lfactor; lfactor = -1; for (i = 0; i < nnzB; i++) - if (fabs(dataB[i]) > lfactor) - lfactor = fabs(dataB[i]); + if (hypre_abs(dataB[i]) > lfactor) + lfactor = hypre_abs(dataB[i]); lfactor *= 1e-10; hypre_MPI_Allreduce(&lfactor, &factor, 1, HYPRE_MPI_REAL, hypre_MPI_MAX, hypre_ParCSRMatrixComm(A)); @@ -2887,7 +3208,8 @@ HYPRE_Int hypre_AMSSetup(void *solver, ams_data -> A_l1_norms = hypre_SeqVectorCreate(hypre_ParCSRMatrixNumRows(ams_data -> A)); hypre_VectorData(ams_data -> A_l1_norms) = l1_norm_data; - hypre_SeqVectorInitialize_v2(ams_data -> A_l1_norms, hypre_ParCSRMatrixMemoryLocation(ams_data -> A)); + hypre_SeqVectorInitialize_v2(ams_data -> A_l1_norms, + hypre_ParCSRMatrixMemoryLocation(ams_data -> A)); } /* Chebyshev? */ @@ -2903,12 +3225,16 @@ HYPRE_Int hypre_AMSSetup(void *solver, if (ams_data -> x != NULL && (ams_data -> dim == 1 || ams_data -> y != NULL) && (ams_data -> dim <= 2 || ams_data -> z != NULL)) + { input_info = 1; + } if (ams_data -> Gx != NULL && (ams_data -> dim == 1 || ams_data -> Gy != NULL) && (ams_data -> dim <= 2 || ams_data -> Gz != NULL)) + { input_info = 2; + } if (input_info == 1) { @@ -2966,9 +3292,13 @@ HYPRE_Int hypre_AMSSetup(void *solver, { hypre_ParVectorDestroy(ams_data -> Gx); if (ams_data -> dim >= 2) + { hypre_ParVectorDestroy(ams_data -> Gy); + } if (ams_data -> dim == 3) + { hypre_ParVectorDestroy(ams_data -> Gz); + } } /* Create the AMG solver on the range of G^T */ @@ -2991,7 +3321,9 @@ HYPRE_Int hypre_AMSSetup(void *solver, HYPRE_BoomerAMGSetCycleRelaxType(ams_data -> B_G, ams_data -> B_G_coarse_relax_type, 3); if (ams_data -> cycle_type == 0) + { HYPRE_BoomerAMGSetMaxLevels(ams_data -> B_G, 2); + } /* If not given, construct the coarse space matrix by RAP */ if (!ams_data -> A_G) @@ -3006,7 +3338,7 @@ HYPRE_Int hypre_AMSSetup(void *solver, hypre_MatvecCommPkgCreate(ams_data -> A); } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if (exec == HYPRE_EXEC_DEVICE) { ams_data -> A_G = hypre_ParCSRMatrixRAPKT(ams_data -> G, @@ -3034,7 +3366,7 @@ HYPRE_Int hypre_AMSSetup(void *solver, } if (ams_data -> cycle_type > 10 && ams_data -> cycle_type != 20) - /* Create the AMG solvers on the range of Pi{x,y,z}^T */ + /* Create the AMG solvers on the range of Pi{x,y,z}^T */ { HYPRE_BoomerAMGCreate(&ams_data -> B_Pix); HYPRE_BoomerAMGSetCoarsenType(ams_data -> B_Pix, ams_data -> B_Pi_coarsen_type); @@ -3093,7 +3425,7 @@ HYPRE_Int hypre_AMSSetup(void *solver, hypre_MatvecCommPkgCreate(ams_data -> Pix); } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if (exec == HYPRE_EXEC_DEVICE) { ams_data -> A_Pix = hypre_ParCSRMatrixRAPKT(ams_data -> Pix, ams_data -> A, ams_data -> Pix, 1); @@ -3122,7 +3454,7 @@ HYPRE_Int hypre_AMSSetup(void *solver, hypre_MatvecCommPkgCreate(ams_data -> Piy); } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if (exec == HYPRE_EXEC_DEVICE) { ams_data -> A_Piy = hypre_ParCSRMatrixRAPKT(ams_data -> Piy, @@ -3154,7 +3486,7 @@ HYPRE_Int hypre_AMSSetup(void *solver, hypre_MatvecCommPkgCreate(ams_data -> Piz); } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if (exec == HYPRE_EXEC_DEVICE) { ams_data -> A_Piz = hypre_ParCSRMatrixRAPKT(ams_data -> Piz, @@ -3180,7 +3512,7 @@ HYPRE_Int hypre_AMSSetup(void *solver, } } else - /* Create the AMG solver on the range of Pi^T */ + /* Create the AMG solver on the range of Pi^T */ { HYPRE_BoomerAMGCreate(&ams_data -> B_Pi); HYPRE_BoomerAMGSetCoarsenType(ams_data -> B_Pi, ams_data -> B_Pi_coarsen_type); @@ -3199,7 +3531,9 @@ HYPRE_Int hypre_AMSSetup(void *solver, HYPRE_BoomerAMGSetCycleRelaxType(ams_data -> B_Pi, ams_data -> B_Pi_coarse_relax_type, 3); if (ams_data -> cycle_type == 0) + { HYPRE_BoomerAMGSetMaxLevels(ams_data -> B_Pi, 2); + } /* If not given, construct the coarse space matrix by RAP and notify BoomerAMG that this is a dim x dim block system. */ @@ -3219,7 +3553,7 @@ HYPRE_Int hypre_AMSSetup(void *solver, { /* Add a discrete divergence term to A before computing Pi^t A Pi */ { - hypre_ParCSRMatrix *Gt, *GGt, *ApGGt; + hypre_ParCSRMatrix *Gt, *GGt = NULL, *ApGGt; hypre_ParCSRMatrixTranspose(ams_data -> G, &Gt, 1); /* scale GGt by h^2 */ @@ -3241,14 +3575,14 @@ HYPRE_Int hypre_AMSSetup(void *solver, HYPRE_Real *Gy_data = hypre_VectorData(hypre_ParVectorLocalVector(ams_data -> Gy)); HYPRE_Real *Gz_data = hypre_VectorData(hypre_ParVectorLocalVector(ams_data -> Gz)); -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if (exec == HYPRE_EXEC_DEVICE) { - dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(Gt_num_rows, "warp", bDim); - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_AMSSetupScaleGGt, gDim, bDim, - Gt_num_rows, Gt_diag_I, Gt_diag_J, Gt_diag_data, Gt_offd_I, Gt_offd_data, - Gx_data, Gy_data, Gz_data ); + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(Gt_num_rows, "warp", bDim); + HYPRE_GPU_LAUNCH( hypreGPUKernel_AMSSetupScaleGGt, gDim, bDim, + Gt_num_rows, Gt_diag_I, Gt_diag_J, Gt_diag_data, Gt_offd_I, Gt_offd_data, + Gx_data, Gy_data, Gz_data ); } else #endif @@ -3258,20 +3592,24 @@ HYPRE_Int hypre_AMSSetup(void *solver, /* determine the characteristic mesh size for vertex i */ h2 = 0.0; ne = 0; - for (j = Gt_diag_I[i]; j < Gt_diag_I[i+1]; j++) + for (j = Gt_diag_I[i]; j < Gt_diag_I[i + 1]; j++) { k = Gt_diag_J[j]; - h2 += Gx_data[k]*Gx_data[k]+Gy_data[k]*Gy_data[k]+Gz_data[k]*Gz_data[k]; + h2 += Gx_data[k] * Gx_data[k] + Gy_data[k] * Gy_data[k] + Gz_data[k] * Gz_data[k]; ne++; } if (ne != 0) { h2 /= ne; - for (j = Gt_diag_I[i]; j < Gt_diag_I[i+1]; j++) + for (j = Gt_diag_I[i]; j < Gt_diag_I[i + 1]; j++) + { Gt_diag_data[j] *= h2; - for (j = Gt_offd_I[i]; j < Gt_offd_I[i+1]; j++) + } + for (j = Gt_offd_I[i]; j < Gt_offd_I[i + 1]; j++) + { Gt_offd_data[j] *= h2; + } } } } @@ -3282,18 +3620,22 @@ HYPRE_Int hypre_AMSSetup(void *solver, { hypre_ParVectorDestroy(ams_data -> Gx); if (ams_data -> dim >= 2) + { hypre_ParVectorDestroy(ams_data -> Gy); + } if (ams_data -> dim == 3) + { hypre_ParVectorDestroy(ams_data -> Gz); + } } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if (exec == HYPRE_EXEC_DEVICE) { GGt = hypre_ParCSRMatMat(ams_data -> G, Gt); } -#endif else +#endif { GGt = hypre_ParMatmul(ams_data -> G, Gt); } @@ -3347,7 +3689,7 @@ HYPRE_Int hypre_AMSSetup(void *solver, hypre_ParCSRMatrixDestroy(GGt); -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if (exec == HYPRE_EXEC_DEVICE) { ams_data -> A_Pi = hypre_ParCSRMatrixRAPKT(ams_data -> Pi, ApGGt, ams_data -> Pi, 1); @@ -3364,7 +3706,7 @@ HYPRE_Int hypre_AMSSetup(void *solver, } else { -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if (exec == HYPRE_EXEC_DEVICE) { ams_data -> A_Pi = hypre_ParCSRMatrixRAPKT(ams_data -> Pi, ams_data -> A, ams_data -> Pi, 1); @@ -3382,9 +3724,13 @@ HYPRE_Int hypre_AMSSetup(void *solver, ams_data -> owns_A_Pi = 1; if (ams_data -> cycle_type != 20) + { HYPRE_BoomerAMGSetNumFunctions(ams_data -> B_Pi, ams_data -> dim); + } else + { HYPRE_BoomerAMGSetNumFunctions(ams_data -> B_Pi, ams_data -> dim + 1); + } /* HYPRE_BoomerAMGSetNodal(ams_data -> B_Pi, 1); */ } @@ -3432,8 +3778,11 @@ HYPRE_Int hypre_AMSSolve(void *solver, { hypre_AMSData *ams_data = (hypre_AMSData *) solver; - HYPRE_Int i, my_id = -1; - HYPRE_Real r0_norm, r_norm, b_norm, relative_resid = 0, old_resid; + HYPRE_Int i, my_id = -1; + HYPRE_Real r0_norm = 1.0; + HYPRE_Real r_norm = 1.0; + HYPRE_Real b_norm = 1.0; + HYPRE_Real relative_resid = 0, old_resid; char cycle[30]; hypre_ParCSRMatrix *Ai[5], *Pi[5]; @@ -3463,12 +3812,13 @@ HYPRE_Int hypre_AMSSolve(void *solver, ri[4] = ams_data -> r1; gi[4] = ams_data -> g1; /* may need to create an additional temporary vector for relaxation */ -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(A) ); if (exec == HYPRE_EXEC_DEVICE) { - needZ = ams_data -> A_relax_type == 2 || ams_data -> A_relax_type == 4 || ams_data -> A_relax_type == 16; + needZ = ams_data -> A_relax_type == 2 || ams_data -> A_relax_type == 4 || + ams_data -> A_relax_type == 16; } else #endif @@ -3486,7 +3836,9 @@ HYPRE_Int hypre_AMSSolve(void *solver, } if (ams_data -> print_level > 0) + { hypre_MPI_Comm_rank(hypre_ParCSRMatrixComm(A), &my_id); + } /* Compatible subspace projection for problems with zero-conductivity regions. Note that this modifies the input (r.h.s.) vector b! */ @@ -3502,30 +3854,35 @@ HYPRE_Int hypre_AMSSolve(void *solver, switch (ams_data -> cycle_type) { case 0: - hypre_sprintf(cycle,"%s","0"); + hypre_sprintf(cycle, "%s", "0"); break; + case 1: case 3: case 5: case 7: default: - hypre_sprintf(cycle,"%s","020"); + hypre_sprintf(cycle, "%s", "020"); break; + case 2: case 4: case 6: case 8: - hypre_sprintf(cycle,"%s","(0+2)"); + hypre_sprintf(cycle, "%s", "(0+2)"); break; + case 11: case 13: - hypre_sprintf(cycle,"%s","0345430"); + hypre_sprintf(cycle, "%s", "0345430"); break; + case 12: - hypre_sprintf(cycle,"%s","(0+3+4+5)"); + hypre_sprintf(cycle, "%s", "(0+3+4+5)"); break; + case 14: - hypre_sprintf(cycle,"%s","0(+3+4+5)0"); + hypre_sprintf(cycle, "%s", "0(+3+4+5)0"); break; } } @@ -3534,50 +3891,63 @@ HYPRE_Int hypre_AMSSolve(void *solver, switch (ams_data -> cycle_type) { case 0: - hypre_sprintf(cycle,"%s","010"); + hypre_sprintf(cycle, "%s", "010"); break; case 1: default: - hypre_sprintf(cycle,"%s","01210"); + hypre_sprintf(cycle, "%s", "01210"); break; + case 2: - hypre_sprintf(cycle,"%s","(0+1+2)"); + hypre_sprintf(cycle, "%s", "(0+1+2)"); break; + case 3: - hypre_sprintf(cycle,"%s","02120"); + hypre_sprintf(cycle, "%s", "02120"); break; + case 4: - hypre_sprintf(cycle,"%s","(010+2)"); + hypre_sprintf(cycle, "%s", "(010+2)"); break; + case 5: - hypre_sprintf(cycle,"%s","0102010"); + hypre_sprintf(cycle, "%s", "0102010"); break; + case 6: - hypre_sprintf(cycle,"%s","(020+1)"); + hypre_sprintf(cycle, "%s", "(020+1)"); break; + case 7: - hypre_sprintf(cycle,"%s","0201020"); + hypre_sprintf(cycle, "%s", "0201020"); break; + case 8: - hypre_sprintf(cycle,"%s","0(+1+2)0"); + hypre_sprintf(cycle, "%s", "0(+1+2)0"); break; + case 9: - hypre_sprintf(cycle,"%s","01210"); + hypre_sprintf(cycle, "%s", "01210"); break; + case 11: - hypre_sprintf(cycle,"%s","013454310"); + hypre_sprintf(cycle, "%s", "013454310"); break; + case 12: - hypre_sprintf(cycle,"%s","(0+1+3+4+5)"); + hypre_sprintf(cycle, "%s", "(0+1+3+4+5)"); break; + case 13: - hypre_sprintf(cycle,"%s","034515430"); + hypre_sprintf(cycle, "%s", "034515430"); break; + case 14: - hypre_sprintf(cycle,"%s","01(+3+4+5)10"); + hypre_sprintf(cycle, "%s", "01(+3+4+5)10"); break; + case 20: - hypre_sprintf(cycle,"%s","020"); + hypre_sprintf(cycle, "%s", "020"); break; } } @@ -3589,13 +3959,17 @@ HYPRE_Int hypre_AMSSolve(void *solver, { hypre_ParVectorCopy(b, ams_data -> r0); hypre_ParCSRMatrixMatvec(-1.0, ams_data -> A, x, 1.0, ams_data -> r0); - r_norm = sqrt(hypre_ParVectorInnerProd(ams_data -> r0,ams_data -> r0)); + r_norm = hypre_sqrt(hypre_ParVectorInnerProd(ams_data -> r0, ams_data -> r0)); r0_norm = r_norm; - b_norm = sqrt(hypre_ParVectorInnerProd(b, b)); + b_norm = hypre_sqrt(hypre_ParVectorInnerProd(b, b)); if (b_norm) + { relative_resid = r_norm / b_norm; + } else + { relative_resid = r_norm; + } if (my_id == 0 && ams_data -> print_level > 0) { hypre_printf(" relative\n"); @@ -3630,14 +4004,18 @@ HYPRE_Int hypre_AMSSolve(void *solver, old_resid = r_norm; hypre_ParVectorCopy(b, ams_data -> r0); hypre_ParCSRMatrixMatvec(-1.0, ams_data -> A, x, 1.0, ams_data -> r0); - r_norm = sqrt(hypre_ParVectorInnerProd(ams_data -> r0,ams_data -> r0)); + r_norm = hypre_sqrt(hypre_ParVectorInnerProd(ams_data -> r0, ams_data -> r0)); if (b_norm) + { relative_resid = r_norm / b_norm; + } else + { relative_resid = r_norm; + } if (my_id == 0 && ams_data -> print_level > 0) hypre_printf(" Cycle %2d %e %f %e \n", - i+1, r_norm, r_norm / old_resid, relative_resid); + i + 1, r_norm, r_norm / old_resid, relative_resid); } if (relative_resid < ams_data -> tol) @@ -3648,14 +4026,18 @@ HYPRE_Int hypre_AMSSolve(void *solver, } if (my_id == 0 && ams_data -> print_level > 0 && ams_data -> maxit > 1) + { hypre_printf("\n\n Average Convergence Factor = %f\n\n", - pow((r_norm/r0_norm),(1.0/(HYPRE_Real) i))); + hypre_pow((r_norm / r0_norm), (1.0 / (HYPRE_Real) i))); + } ams_data -> num_iterations = i; ams_data -> rel_resid_norm = relative_resid; if (ams_data -> num_iterations == ams_data -> maxit && ams_data -> tol > 0.0) + { hypre_error(HYPRE_ERROR_CONV); + } return hypre_error_flag; } @@ -3674,39 +4056,39 @@ HYPRE_Int hypre_AMSSolve(void *solver, *--------------------------------------------------------------------------*/ HYPRE_Int hypre_ParCSRSubspacePrec(/* fine space matrix */ - hypre_ParCSRMatrix *A0, - /* relaxation parameters */ - HYPRE_Int A0_relax_type, - HYPRE_Int A0_relax_times, - HYPRE_Real *A0_l1_norms, - HYPRE_Real A0_relax_weight, - HYPRE_Real A0_omega, - HYPRE_Real A0_max_eig_est, - HYPRE_Real A0_min_eig_est, - HYPRE_Int A0_cheby_order, - HYPRE_Real A0_cheby_fraction, - /* subspace matrices */ - hypre_ParCSRMatrix **A, - /* subspace preconditioners */ - HYPRE_Solver *B, - /* hypre solver functions for B */ - HYPRE_PtrToSolverFcn *HB, - /* subspace interpolations */ - hypre_ParCSRMatrix **P, - /* temporary subspace vectors */ - hypre_ParVector **r, - hypre_ParVector **g, - /* right-hand side */ - hypre_ParVector *x, - /* current approximation */ - hypre_ParVector *y, - /* current residual */ - hypre_ParVector *r0, - /* temporary vector */ - hypre_ParVector *g0, - char *cycle, - /* temporary vector */ - hypre_ParVector *z) + hypre_ParCSRMatrix *A0, + /* relaxation parameters */ + HYPRE_Int A0_relax_type, + HYPRE_Int A0_relax_times, + HYPRE_Real *A0_l1_norms, + HYPRE_Real A0_relax_weight, + HYPRE_Real A0_omega, + HYPRE_Real A0_max_eig_est, + HYPRE_Real A0_min_eig_est, + HYPRE_Int A0_cheby_order, + HYPRE_Real A0_cheby_fraction, + /* subspace matrices */ + hypre_ParCSRMatrix **A, + /* subspace preconditioners */ + HYPRE_Solver *B, + /* hypre solver functions for B */ + HYPRE_PtrToSolverFcn *HB, + /* subspace interpolations */ + hypre_ParCSRMatrix **P, + /* temporary subspace vectors */ + hypre_ParVector **r, + hypre_ParVector **g, + /* right-hand side */ + hypre_ParVector *x, + /* current approximation */ + hypre_ParVector *y, + /* current residual */ + hypre_ParVector *r0, + /* temporary vector */ + hypre_ParVector *g0, + char *cycle, + /* temporary vector */ + hypre_ParVector *z) { char *op; HYPRE_Int use_saved_residual = 0; @@ -3715,12 +4097,14 @@ HYPRE_Int hypre_ParCSRSubspacePrec(/* fine space matrix */ { /* do nothing */ if (*op == ')') + { continue; + } /* compute the residual: r = x - Ay */ else if (*op == '(') { - hypre_ParVectorCopy(x,r0); + hypre_ParVectorCopy(x, r0); hypre_ParCSRMatrixMatvec(-1.0, A0, y, 1.0, r0); } @@ -3752,10 +4136,12 @@ HYPRE_Int hypre_ParCSRSubspacePrec(/* fine space matrix */ { HYPRE_Int i = *op - '1'; if (i < 0) + { hypre_error_in_arg(16); + } /* skip empty subspaces */ - if (!A[i]) continue; + if (!A[i]) { continue; } /* compute the residual? */ if (use_saved_residual) @@ -3765,7 +4151,7 @@ HYPRE_Int hypre_ParCSRSubspacePrec(/* fine space matrix */ } else { - hypre_ParVectorCopy(x,g0); + hypre_ParVectorCopy(x, g0); hypre_ParCSRMatrixMatvec(-1.0, A0, y, 1.0, g0); hypre_ParCSRMatrixMatvecT(1.0, P[i], g0, 0.0, r[i]); } @@ -3871,38 +4257,40 @@ HYPRE_Int hypre_AMSConstructDiscreteGradient(hypre_ParCSRMatrix *A, /* Construct the local part of G based on edge_vertex and the edge and vertex partitionings from A and x_coord */ { - HYPRE_Int i, *I = hypre_CTAlloc(HYPRE_Int, nedges+1, HYPRE_MEMORY_HOST); - HYPRE_Real *data = hypre_CTAlloc(HYPRE_Real, 2*nedges, HYPRE_MEMORY_HOST); + HYPRE_Int i, *I = hypre_CTAlloc(HYPRE_Int, nedges + 1, HYPRE_MEMORY_HOST); + HYPRE_Real *data = hypre_CTAlloc(HYPRE_Real, 2 * nedges, HYPRE_MEMORY_HOST); hypre_CSRMatrix *local = hypre_CSRMatrixCreate (nedges, hypre_ParVectorGlobalSize(x_coord), - 2*nedges); + 2 * nedges); for (i = 0; i <= nedges; i++) - I[i] = 2*i; + { + I[i] = 2 * i; + } if (edge_orientation == 1) { /* Assume that the edges are already oriented */ - for (i = 0; i < 2*nedges; i+=2) + for (i = 0; i < 2 * nedges; i += 2) { data[i] = -1.0; - data[i+1] = 1.0; + data[i + 1] = 1.0; } } else if (edge_orientation == 2) { /* Assume that the edge orientation is based on the vertex indexes */ - for (i = 0; i < 2*nedges; i+=2) + for (i = 0; i < 2 * nedges; i += 2) { - if (edge_vertex[i] < edge_vertex[i+1]) + if (edge_vertex[i] < edge_vertex[i + 1]) { data[i] = -1.0; - data[i+1] = 1.0; + data[i + 1] = 1.0; } else { data[i] = 1.0; - data[i+1] = -1.0; + data[i + 1] = -1.0; } } } @@ -3972,17 +4360,21 @@ HYPRE_Int hypre_AMSConstructDiscreteGradient(hypre_ParCSRMatrix *A, * be called before hypre_AMSSetup(). *--------------------------------------------------------------------------*/ -HYPRE_Int hypre_AMSFEISetup(void *solver, - hypre_ParCSRMatrix *A, - hypre_ParVector *b, - hypre_ParVector *x, - HYPRE_Int num_vert, - HYPRE_Int num_local_vert, - HYPRE_BigInt *vert_number, - HYPRE_Real *vert_coord, - HYPRE_Int num_edges, - HYPRE_BigInt *edge_vertex) +HYPRE_Int +hypre_AMSFEISetup(void *solver, + hypre_ParCSRMatrix *A, + hypre_ParVector *b, + hypre_ParVector *x, + HYPRE_Int num_vert, + HYPRE_Int num_local_vert, + HYPRE_BigInt *vert_number, + HYPRE_Real *vert_coord, + HYPRE_Int num_edges, + HYPRE_BigInt *edge_vertex) { + HYPRE_UNUSED_VAR(b); + HYPRE_UNUSED_VAR(x); + hypre_AMSData *ams_data = (hypre_AMSData *) solver; HYPRE_Int i, j; @@ -3992,12 +4384,11 @@ HYPRE_Int hypre_AMSFEISetup(void *solver, HYPRE_Real *x_data, *y_data, *z_data; MPI_Comm comm = hypre_ParCSRMatrixComm(A); - HYPRE_BigInt *vert_part, num_global_vert; + HYPRE_BigInt vert_part[2], num_global_vert; HYPRE_BigInt vert_start, vert_end; HYPRE_BigInt big_local_vert = (HYPRE_BigInt) num_local_vert; /* Find the processor partitioning of the vertices */ - vert_part = hypre_TAlloc(HYPRE_BigInt, 2, HYPRE_MEMORY_HOST); hypre_MPI_Scan(&big_local_vert, &vert_part[1], 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); vert_part[0] = vert_part[1] - big_local_vert; hypre_MPI_Allreduce(&big_local_vert, &num_global_vert, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); @@ -4027,33 +4418,37 @@ HYPRE_Int hypre_AMSFEISetup(void *solver, if (vert_number[i] >= vert_start && vert_number[i] <= vert_end) { j = (HYPRE_Int)(vert_number[i] - vert_start); - x_data[j] = vert_coord[3*i]; - y_data[j] = vert_coord[3*i+1]; - z_data[j] = vert_coord[3*i+2]; + x_data[j] = vert_coord[3 * i]; + y_data[j] = vert_coord[3 * i + 1]; + z_data[j] = vert_coord[3 * i + 2]; } } /* Change vertex numbers from local to global */ - for (i = 0; i < 2*num_edges; i++) + for (i = 0; i < 2 * num_edges; i++) + { edge_vertex[i] = vert_number[edge_vertex[i]]; + } /* Construct the local part of G based on edge_vertex */ { /* HYPRE_Int num_edges = hypre_ParCSRMatrixNumRows(A); */ - HYPRE_Int *I = hypre_CTAlloc(HYPRE_Int, num_edges+1, HYPRE_MEMORY_HOST); - HYPRE_Real *data = hypre_CTAlloc(HYPRE_Real, 2*num_edges, HYPRE_MEMORY_HOST); + HYPRE_Int *I = hypre_CTAlloc(HYPRE_Int, num_edges + 1, HYPRE_MEMORY_HOST); + HYPRE_Real *data = hypre_CTAlloc(HYPRE_Real, 2 * num_edges, HYPRE_MEMORY_HOST); hypre_CSRMatrix *local = hypre_CSRMatrixCreate (num_edges, num_global_vert, - 2*num_edges); + 2 * num_edges); for (i = 0; i <= num_edges; i++) - I[i] = 2*i; + { + I[i] = 2 * i; + } /* Assume that the edge orientation is based on the vertex indexes */ - for (i = 0; i < 2*num_edges; i+=2) + for (i = 0; i < 2 * num_edges; i += 2) { data[i] = 1.0; - data[i+1] = -1.0; + data[i + 1] = -1.0; } hypre_CSRMatrixI(local) = I; @@ -4100,14 +4495,22 @@ HYPRE_Int hypre_AMSFEIDestroy(void *solver) hypre_AMSData *ams_data = (hypre_AMSData *) solver; if (ams_data -> G) + { hypre_ParCSRMatrixDestroy(ams_data -> G); + } if (ams_data -> x) + { hypre_ParVectorDestroy(ams_data -> x); + } if (ams_data -> y) + { hypre_ParVectorDestroy(ams_data -> y); + } if (ams_data -> z) + { hypre_ParVectorDestroy(ams_data -> z); + } return hypre_error_flag; } @@ -4129,11 +4532,12 @@ HYPRE_Int hypre_AMSFEIDestroy(void *solver) * cf_marker is not NULL. *--------------------------------------------------------------------------*/ -HYPRE_Int hypre_ParCSRComputeL1NormsThreads(hypre_ParCSRMatrix *A, - HYPRE_Int option, - HYPRE_Int num_threads, - HYPRE_Int *cf_marker, - HYPRE_Real **l1_norm_ptr) +HYPRE_Int +hypre_ParCSRComputeL1NormsThreads(hypre_ParCSRMatrix *A, + HYPRE_Int option, + HYPRE_Int num_threads, + HYPRE_Int *cf_marker, + HYPRE_Real **l1_norm_ptr) { HYPRE_Int i, j, k; HYPRE_Int num_rows = hypre_ParCSRMatrixNumRows(A); @@ -4149,7 +4553,7 @@ HYPRE_Int hypre_ParCSRComputeL1NormsThreads(hypre_ParCSRMatrix *A, HYPRE_Real *A_offd_data = hypre_CSRMatrixData(A_offd); HYPRE_Int num_cols_offd = hypre_CSRMatrixNumCols(A_offd); - HYPRE_Real diag; + HYPRE_Real diag = 0.0; HYPRE_Real *l1_norm = hypre_TAlloc(HYPRE_Real, num_rows, hypre_ParCSRMatrixMemoryLocation(A)); HYPRE_Int ii, ns, ne, rest, size; @@ -4168,18 +4572,21 @@ HYPRE_Int hypre_ParCSRComputeL1NormsThreads(hypre_ParCSRMatrix *A, hypre_ParCSRCommHandle *comm_handle; if (num_cols_offd) + { cf_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_offd, HYPRE_MEMORY_HOST); + } num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); if (hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends)) int_buf_data = hypre_CTAlloc(HYPRE_Int, - hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), HYPRE_MEMORY_HOST); + hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); index = 0; for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { - int_buf_data[index++] = cf_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + int_buf_data[index++] = cf_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } } comm_handle = hypre_ParCSRCommHandleCreate(11, comm_pkg, int_buf_data, @@ -4189,21 +4596,21 @@ HYPRE_Int hypre_ParCSRComputeL1NormsThreads(hypre_ParCSRMatrix *A, } #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,ii,j,k,ns,ne,rest,size,diag,cf_diag) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,ii,j,k,ns,ne,rest,size,diag,cf_diag) HYPRE_SMP_SCHEDULE #endif for (k = 0; k < num_threads; k++) { - size = num_rows/num_threads; - rest = num_rows - size*num_threads; + size = num_rows / num_threads; + rest = num_rows - size * num_threads; if (k < rest) { - ns = k*size+k; - ne = (k+1)*size+k+1; + ns = k * size + k; + ne = (k + 1) * size + k + 1; } else { - ns = k*size+rest; - ne = (k+1)*size+rest; + ns = k * size + rest; + ne = (k + 1) * size + rest; } if (option == 1) @@ -4214,28 +4621,36 @@ HYPRE_Int hypre_ParCSRComputeL1NormsThreads(hypre_ParCSRMatrix *A, if (cf_marker == NULL) { /* Add the l1 norm of the diag part of the ith row */ - for (j = A_diag_I[i]; j < A_diag_I[i+1]; j++) - l1_norm[i] += fabs(A_diag_data[j]); + for (j = A_diag_I[i]; j < A_diag_I[i + 1]; j++) + { + l1_norm[i] += hypre_abs(A_diag_data[j]); + } /* Add the l1 norm of the offd part of the ith row */ if (num_cols_offd) { - for (j = A_offd_I[i]; j < A_offd_I[i+1]; j++) - l1_norm[i] += fabs(A_offd_data[j]); + for (j = A_offd_I[i]; j < A_offd_I[i + 1]; j++) + { + l1_norm[i] += hypre_abs(A_offd_data[j]); + } } } else { cf_diag = cf_marker[i]; /* Add the CF l1 norm of the diag part of the ith row */ - for (j = A_diag_I[i]; j < A_diag_I[i+1]; j++) + for (j = A_diag_I[i]; j < A_diag_I[i + 1]; j++) if (cf_diag == cf_marker[A_diag_J[j]]) - l1_norm[i] += fabs(A_diag_data[j]); + { + l1_norm[i] += hypre_abs(A_diag_data[j]); + } /* Add the CF l1 norm of the offd part of the ith row */ if (num_cols_offd) { - for (j = A_offd_I[i]; j < A_offd_I[i+1]; j++) + for (j = A_offd_I[i]; j < A_offd_I[i + 1]; j++) if (cf_diag == cf_marker_offd[A_offd_J[j]]) - l1_norm[i] += fabs(A_offd_data[j]); + { + l1_norm[i] += hypre_abs(A_offd_data[j]); + } } } } @@ -4248,36 +4663,46 @@ HYPRE_Int hypre_ParCSRComputeL1NormsThreads(hypre_ParCSRMatrix *A, if (cf_marker == NULL) { /* Add the diagonal and the local off-thread part of the ith row */ - for (j = A_diag_I[i]; j < A_diag_I[i+1]; j++) + for (j = A_diag_I[i]; j < A_diag_I[i + 1]; j++) { ii = A_diag_J[j]; if (ii == i || ii < ns || ii >= ne) - l1_norm[i] += fabs(A_diag_data[j]); + { + l1_norm[i] += hypre_abs(A_diag_data[j]); + } } /* Add the l1 norm of the offd part of the ith row */ if (num_cols_offd) { - for (j = A_offd_I[i]; j < A_offd_I[i+1]; j++) - l1_norm[i] += fabs(A_offd_data[j]); + for (j = A_offd_I[i]; j < A_offd_I[i + 1]; j++) + { + l1_norm[i] += hypre_abs(A_offd_data[j]); + } } } else { cf_diag = cf_marker[i]; /* Add the diagonal and the local off-thread part of the ith row */ - for (j = A_diag_I[i]; j < A_diag_I[i+1]; j++) + for (j = A_diag_I[i]; j < A_diag_I[i + 1]; j++) { ii = A_diag_J[j]; if ((ii == i || ii < ns || ii >= ne) && (cf_diag == cf_marker[A_diag_J[j]])) - l1_norm[i] += fabs(A_diag_data[j]); + { + l1_norm[i] += hypre_abs(A_diag_data[j]); + } } /* Add the CF l1 norm of the offd part of the ith row */ if (num_cols_offd) { - for (j = A_offd_I[i]; j < A_offd_I[i+1]; j++) + for (j = A_offd_I[i]; j < A_offd_I[i + 1]; j++) + { if (cf_diag == cf_marker_offd[A_offd_J[j]]) - l1_norm[i] += fabs(A_offd_data[j]); + { + l1_norm[i] += hypre_abs(A_offd_data[j]); + } + } } } } @@ -4287,11 +4712,17 @@ HYPRE_Int hypre_ParCSRComputeL1NormsThreads(hypre_ParCSRMatrix *A, for (i = ns; i < ne; i++) { l1_norm[i] = 0.0; - for (j = A_diag_I[i]; j < A_diag_I[i+1]; j++) + for (j = A_diag_I[i]; j < A_diag_I[i + 1]; j++) + { l1_norm[i] += A_diag_data[j] * A_diag_data[j]; + } if (num_cols_offd) - for (j = A_offd_I[i]; j < A_offd_I[i+1]; j++) + { + for (j = A_offd_I[i]; j < A_offd_I[i + 1]; j++) + { l1_norm[i] += A_offd_data[j] * A_offd_data[j]; + } + } } } else if (option == 4) @@ -4302,32 +4733,39 @@ HYPRE_Int hypre_ParCSRComputeL1NormsThreads(hypre_ParCSRMatrix *A, if (cf_marker == NULL) { /* Add the diagonal and the local off-thread part of the ith row */ - for (j = A_diag_I[i]; j < A_diag_I[i+1]; j++) + diag = 0.0; + for (j = A_diag_I[i]; j < A_diag_I[i + 1]; j++) { ii = A_diag_J[j]; if (ii == i || ii < ns || ii >= ne) { if (ii == i) { - diag = fabs(A_diag_data[j]); - l1_norm[i] += fabs(A_diag_data[j]); + diag = hypre_abs(A_diag_data[j]); + l1_norm[i] += hypre_abs(A_diag_data[j]); } else - l1_norm[i] += 0.5*fabs(A_diag_data[j]); + { + l1_norm[i] += 0.5 * hypre_abs(A_diag_data[j]); + } } } + /* Add the l1 norm of the offd part of the ith row */ if (num_cols_offd) { - for (j = A_offd_I[i]; j < A_offd_I[i+1]; j++) - l1_norm[i] += 0.5*fabs(A_offd_data[j]); + for (j = A_offd_I[i]; j < A_offd_I[i + 1]; j++) + { + l1_norm[i] += 0.5 * hypre_abs(A_offd_data[j]); + } } } else { cf_diag = cf_marker[i]; /* Add the diagonal and the local off-thread part of the ith row */ - for (j = A_diag_I[i]; j < A_diag_I[i+1]; j++) + diag = 0.0; + for (j = A_diag_I[i]; j < A_diag_I[i + 1]; j++) { ii = A_diag_J[j]; if ((ii == i || ii < ns || ii >= ne) && @@ -4335,35 +4773,116 @@ HYPRE_Int hypre_ParCSRComputeL1NormsThreads(hypre_ParCSRMatrix *A, { if (ii == i) { - diag = fabs(A_diag_data[j]); - l1_norm[i] += fabs(A_diag_data[j]); + diag = hypre_abs(A_diag_data[j]); + l1_norm[i] += hypre_abs(A_diag_data[j]); } else - l1_norm[i] += 0.5*fabs(A_diag_data[j]); + { + l1_norm[i] += 0.5 * hypre_abs(A_diag_data[j]); + } } } + /* Add the CF l1 norm of the offd part of the ith row */ if (num_cols_offd) { - for (j = A_offd_I[i]; j < A_offd_I[i+1]; j++) + for (j = A_offd_I[i]; j < A_offd_I[i + 1]; j++) + { if (cf_diag == cf_marker_offd[A_offd_J[j]]) - l1_norm[i] += 0.5*fabs(A_offd_data[j]); + { + l1_norm[i] += 0.5 * hypre_abs(A_offd_data[j]); + } + } } } /* Truncate according to Remark 6.2 */ - if (l1_norm[i] <= 4.0/3.0*diag) + if (l1_norm[i] <= (4.0 / 3.0) * diag) + { l1_norm[i] = diag; + } } } - else if (option == 5) /*stores diagonal of A for Jacobi using matvec, rlx 7 */ { /* Set the diag element */ for (i = ns; i < ne; i++) { l1_norm[i] = A_diag_data[A_diag_I[i]]; - if (l1_norm[i] == 0) l1_norm[i] = 1.0; + if (l1_norm[i] == 0) { l1_norm[i] = 1.0; } + } + } + else if (option == 6) + { + for (i = ns; i < ne; i++) + { + l1_norm[i] = 0.0; + + if (cf_marker == NULL) + { + /* Add the diagonal and the local off-thread part of the ith row */ + diag = 0.0; + for (j = A_diag_I[i]; j < A_diag_I[i + 1]; j++) + { + ii = A_diag_J[j]; + if (ii == i || ii < ns || ii >= ne) + { + if (ii == i) + { + diag = hypre_abs(A_diag_data[j]); + } + else + { + l1_norm[i] += 0.5 * hypre_abs(A_diag_data[j]); + } + } + } + /* Add the l1 norm of the offd part of the ith row */ + if (num_cols_offd) + { + for (j = A_offd_I[i]; j < A_offd_I[i + 1]; j++) + { + l1_norm[i] += 0.5 * hypre_abs(A_offd_data[j]); + } + } + + l1_norm[i] = (diag + l1_norm[i] + hypre_sqrt(diag * diag + l1_norm[i] * l1_norm[i])) * 0.5; + } + else + { + cf_diag = cf_marker[i]; + /* Add the diagonal and the local off-thread part of the ith row */ + diag = 0.0; + for (j = A_diag_I[i]; j < A_diag_I[i + 1]; j++) + { + ii = A_diag_J[j]; + if ((ii == i || ii < ns || ii >= ne) && + (cf_diag == cf_marker[A_diag_J[j]])) + { + if (ii == i) + { + diag = hypre_abs(A_diag_data[j]); + } + else + { + l1_norm[i] += 0.5 * hypre_abs(A_diag_data[j]); + } + } + } + /* Add the CF l1 norm of the offd part of the ith row */ + if (num_cols_offd) + { + for (j = A_offd_I[i]; j < A_offd_I[i + 1]; j++) + { + if (cf_diag == cf_marker_offd[A_offd_J[j]]) + { + l1_norm[i] += 0.5 * hypre_abs(A_offd_data[j]); + } + } + } + + l1_norm[i] = (diag + l1_norm[i] + hypre_sqrt(diag * diag + l1_norm[i] * l1_norm[i])) * 0.5; + } } } @@ -4372,11 +4891,13 @@ HYPRE_Int hypre_ParCSRComputeL1NormsThreads(hypre_ParCSRMatrix *A, /* Handle negative definite matrices */ for (i = ns; i < ne; i++) if (A_diag_data[A_diag_I[i]] < 0) + { l1_norm[i] = -l1_norm[i]; + } for (i = ns; i < ne; i++) - /* if (fabs(l1_norm[i]) < DBL_EPSILON) */ - if (fabs(l1_norm[i]) == 0.0) + /* if (hypre_abs(l1_norm[i]) < DBL_EPSILON) */ + if (hypre_abs(l1_norm[i]) == 0.0) { hypre_error_in_arg(1); break; diff --git a/external/hypre/src/parcsr_ls/ams.h b/external/hypre/src/parcsr_ls/ams.h index 3f5d1f84..f03c4bbf 100644 --- a/external/hypre/src/parcsr_ls/ams.h +++ b/external/hypre/src/parcsr_ls/ams.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -130,6 +130,17 @@ typedef struct #define hypre_AMSDataPoissonAlphaAMG(ams_data) ((ams_data)->B_Pi) #define hypre_AMSDataOwnsPoissonAlpha(ams_data) ((ams_data)->owns_A_Pi) +/* Vector vertex components data */ +#define hypre_AMSDataPiXInterpolation(ams_data) ((ams_data)->Pix) +#define hypre_AMSDataPiYInterpolation(ams_data) ((ams_data)->Piy) +#define hypre_AMSDataPiZInterpolation(ams_data) ((ams_data)->Piz) +#define hypre_AMSDataPoissonAlphaX(ams_data) ((ams_data)->A_Pix) +#define hypre_AMSDataPoissonAlphaY(ams_data) ((ams_data)->A_Piy) +#define hypre_AMSDataPoissonAlphaZ(ams_data) ((ams_data)->A_Piz) +#define hypre_AMSDataPoissonAlphaXAMG(ams_data) ((ams_data)->B_Pix) +#define hypre_AMSDataPoissonAlphaYAMG(ams_data) ((ams_data)->B_Piy) +#define hypre_AMSDataPoissonAlphaZAMG(ams_data) ((ams_data)->B_Piz) + /* Coordinates of the vertices */ #define hypre_AMSDataVertexCoordinateX(ams_data) ((ams_data)->x) #define hypre_AMSDataVertexCoordinateY(ams_data) ((ams_data)->y) @@ -140,6 +151,14 @@ typedef struct #define hypre_AMSDataEdgeConstantY(ams_data) ((ams_data)->Gy) #define hypre_AMSDataEdgeConstantZ(ams_data) ((ams_data)->Gz) +/* Interior zero conductivity region */ +#define hypre_AMSDataInteriorNodes(ams_data) ((ams_data)->interior_nodes) +#define hypre_AMSDataInteriorDiscreteGradient(ams_data) ((ams_data)->G0) +#define hypre_AMSDataInteriorPoissonBeta(ams_data) ((ams_data)->A_G0) +#define hypre_AMSDataInteriorPoissonBetaAMG(ams_data) ((ams_data)->B_G0) +#define hypre_AMSDataInteriorProjectionFrequency(ams_data) ((ams_data)->projection_frequency) +#define hypre_AMSDataInteriorSolveCounter(ams_data) ((ams_data)->solve_counter) + /* Solver options */ #define hypre_AMSDataMaxIter(ams_data) ((ams_data)->maxit) #define hypre_AMSDataTol(ams_data) ((ams_data)->tol) @@ -157,15 +176,21 @@ typedef struct #define hypre_AMSDataAChebyOrder(ams_data) ((ams_data)->A_cheby_order) #define hypre_AMSDataAChebyFraction(ams_data) ((ams_data)->A_cheby_fraction) -#define hypre_AMSDataPoissonAlphaAMGCoarsenType(ams_data) ((ams_data)->B_Pi_coarsen_type) -#define hypre_AMSDataPoissonAlphaAMGAggLevels(ams_data) ((ams_data)->B_Pi_agg_levels) -#define hypre_AMSDataPoissonAlphaAMGRelaxType(ams_data) ((ams_data)->B_Pi_relax_type) -#define hypre_AMSDataPoissonAlphaAMGStrengthThreshold(ams_data) ((ams_data)->B_Pi_theta) - #define hypre_AMSDataPoissonBetaAMGCoarsenType(ams_data) ((ams_data)->B_G_coarsen_type) #define hypre_AMSDataPoissonBetaAMGAggLevels(ams_data) ((ams_data)->B_G_agg_levels) #define hypre_AMSDataPoissonBetaAMGRelaxType(ams_data) ((ams_data)->B_G_relax_type) +#define hypre_AMSDataPoissonBetaAMGCoarseRelaxType(ams_data) ((ams_data)->B_G_coarse_relax_type) #define hypre_AMSDataPoissonBetaAMGStrengthThreshold(ams_data) ((ams_data)->B_G_theta) +#define hypre_AMSDataPoissonBetaAMGInterpType(ams_data) ((ams_data)->B_G_interp_type) +#define hypre_AMSDataPoissonBetaAMGPMax(ams_data) ((ams_data)->B_G_Pmax) + +#define hypre_AMSDataPoissonAlphaAMGCoarsenType(ams_data) ((ams_data)->B_Pi_coarsen_type) +#define hypre_AMSDataPoissonAlphaAMGAggLevels(ams_data) ((ams_data)->B_Pi_agg_levels) +#define hypre_AMSDataPoissonAlphaAMGRelaxType(ams_data) ((ams_data)->B_Pi_relax_type) +#define hypre_AMSDataPoissonAlphaAMGCoarseRelaxType(ams_data) ((ams_data)->B_Pi_coarse_relax_type) +#define hypre_AMSDataPoissonAlphaAMGStrengthThreshold(ams_data) ((ams_data)->B_Pi_theta) +#define hypre_AMSDataPoissonAlphaAMGInterpType(ams_data) ((ams_data)->B_Pi_interp_type) +#define hypre_AMSDataPoissonAlphaAMGPMax(ams_data) ((ams_data)->B_Pi_Pmax) /* Temporary vectors */ #define hypre_AMSDataTempEdgeVectorR(ams_data) ((ams_data)->r0) @@ -174,5 +199,10 @@ typedef struct #define hypre_AMSDataTempVertexVectorG(ams_data) ((ams_data)->g1) #define hypre_AMSDataTempVecVertexVectorR(ams_data) ((ams_data)->r2) #define hypre_AMSDataTempVecVertexVectorG(ams_data) ((ams_data)->g2) +#define hypre_AMSDataTempVecVertexVectorZZ(ams_data) ((ams_data)->zz) + +/* Output log info */ +#define hypre_AMSDataNumIterations(ams_data) ((ams_data)->num_iterations) +#define hypre_AMSDataResidualNorm(ams_data) ((ams_data)->rel_resid_norm) #endif diff --git a/external/hypre/src/parcsr_ls/aux_interp.c b/external/hypre/src/parcsr_ls/aux_interp.c index 4c1a61c6..c102bcbd 100644 --- a/external/hypre/src/parcsr_ls/aux_interp.c +++ b/external/hypre/src/parcsr_ls/aux_interp.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -19,656 +19,765 @@ offd nodes from comm_pkg take up first chunk of CF_marker_offd, offd nodes from extend_comm_pkg take up the second chunk of CF_marker_offd. */ - - -HYPRE_Int hypre_alt_insert_new_nodes(hypre_ParCSRCommPkg *comm_pkg, - hypre_ParCSRCommPkg *extend_comm_pkg, - HYPRE_Int *IN_marker, - HYPRE_Int full_off_procNodes, - HYPRE_Int *OUT_marker) +HYPRE_Int +hypre_alt_insert_new_nodes(hypre_ParCSRCommPkg *comm_pkg, + hypre_ParCSRCommPkg *extend_comm_pkg, + HYPRE_Int *IN_marker, + HYPRE_Int full_off_procNodes, + HYPRE_Int *OUT_marker) { - hypre_ParCSRCommHandle *comm_handle; - - HYPRE_Int i, index, shift; - - HYPRE_Int num_sends, num_recvs; - - HYPRE_Int *recv_vec_starts; + HYPRE_UNUSED_VAR(full_off_procNodes); - HYPRE_Int e_num_sends; + hypre_ParCSRCommHandle *comm_handle; - HYPRE_Int *int_buf_data; - HYPRE_Int *e_out_marker; + HYPRE_Int i, index, shift; + HYPRE_Int num_sends, num_recvs; + HYPRE_Int *recv_vec_starts; + HYPRE_Int e_num_sends; + HYPRE_Int *int_buf_data; + HYPRE_Int *e_out_marker; + num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); + num_recvs = hypre_ParCSRCommPkgNumRecvs(comm_pkg); + recv_vec_starts = hypre_ParCSRCommPkgRecvVecStarts(comm_pkg); - num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - num_recvs = hypre_ParCSRCommPkgNumRecvs(comm_pkg); - recv_vec_starts = hypre_ParCSRCommPkgRecvVecStarts(comm_pkg); + e_num_sends = hypre_ParCSRCommPkgNumSends(extend_comm_pkg); - e_num_sends = hypre_ParCSRCommPkgNumSends(extend_comm_pkg); + index = hypre_max(hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + hypre_ParCSRCommPkgSendMapStart(extend_comm_pkg, e_num_sends)); - index = hypre_max(hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), - hypre_ParCSRCommPkgSendMapStart(extend_comm_pkg, e_num_sends)); + int_buf_data = hypre_CTAlloc(HYPRE_Int, index, HYPRE_MEMORY_HOST); - int_buf_data = hypre_CTAlloc(HYPRE_Int, index, HYPRE_MEMORY_HOST); + /* orig commpkg data*/ + index = 0; - /* orig commpkg data*/ - index = 0; - - HYPRE_Int begin = hypre_ParCSRCommPkgSendMapStart(comm_pkg, 0); - HYPRE_Int end = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends); + HYPRE_Int begin = hypre_ParCSRCommPkgSendMapStart(comm_pkg, 0); + HYPRE_Int end = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for HYPRE_SMP_SCHEDULE + #pragma omp parallel for HYPRE_SMP_SCHEDULE #endif - for (i = begin; i < end; ++i) { - int_buf_data[i - begin] = - IN_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, i)]; - } + for (i = begin; i < end; ++i) + { + int_buf_data[i - begin] = + IN_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, i)]; + } - comm_handle = hypre_ParCSRCommHandleCreate( 11, comm_pkg, int_buf_data, - OUT_marker); + comm_handle = hypre_ParCSRCommHandleCreate( 11, comm_pkg, int_buf_data, + OUT_marker); - hypre_ParCSRCommHandleDestroy(comm_handle); - comm_handle = NULL; + hypre_ParCSRCommHandleDestroy(comm_handle); + comm_handle = NULL; - /* now do the extend commpkg */ + /* now do the extend commpkg */ - /* first we need to shift our position in the OUT_marker */ - shift = recv_vec_starts[num_recvs]; - e_out_marker = OUT_marker + shift; + /* first we need to shift our position in the OUT_marker */ + shift = recv_vec_starts[num_recvs]; + e_out_marker = OUT_marker + shift; - index = 0; + index = 0; - begin = hypre_ParCSRCommPkgSendMapStart(extend_comm_pkg, 0); - end = hypre_ParCSRCommPkgSendMapStart(extend_comm_pkg, e_num_sends); + begin = hypre_ParCSRCommPkgSendMapStart(extend_comm_pkg, 0); + end = hypre_ParCSRCommPkgSendMapStart(extend_comm_pkg, e_num_sends); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for HYPRE_SMP_SCHEDULE + #pragma omp parallel for HYPRE_SMP_SCHEDULE #endif - for (i = begin; i < end; ++i) { - int_buf_data[i - begin] = - IN_marker[hypre_ParCSRCommPkgSendMapElmt(extend_comm_pkg, i)]; - } + for (i = begin; i < end; ++i) + { + int_buf_data[i - begin] = + IN_marker[hypre_ParCSRCommPkgSendMapElmt(extend_comm_pkg, i)]; + } - comm_handle = hypre_ParCSRCommHandleCreate( 11, extend_comm_pkg, int_buf_data, - e_out_marker); + comm_handle = hypre_ParCSRCommHandleCreate( 11, extend_comm_pkg, int_buf_data, + e_out_marker); - hypre_ParCSRCommHandleDestroy(comm_handle); - comm_handle = NULL; + hypre_ParCSRCommHandleDestroy(comm_handle); + comm_handle = NULL; - hypre_TFree(int_buf_data, HYPRE_MEMORY_HOST); + hypre_TFree(int_buf_data, HYPRE_MEMORY_HOST); - return hypre_error_flag; + return hypre_error_flag; } -HYPRE_Int hypre_big_insert_new_nodes(hypre_ParCSRCommPkg *comm_pkg, - hypre_ParCSRCommPkg *extend_comm_pkg, - HYPRE_Int *IN_marker, - HYPRE_Int full_off_procNodes, - HYPRE_BigInt offset, - HYPRE_BigInt *OUT_marker) -{ - hypre_ParCSRCommHandle *comm_handle; - - HYPRE_Int i, index, shift; - - HYPRE_Int num_sends, num_recvs; - - HYPRE_Int *recv_vec_starts; - - HYPRE_Int e_num_sends; - - HYPRE_BigInt *int_buf_data; - HYPRE_BigInt *e_out_marker; +/*-------------------------------------------------------------------------- + * hypre_big_insert_new_nodes + *--------------------------------------------------------------------------*/ +HYPRE_Int +hypre_big_insert_new_nodes(hypre_ParCSRCommPkg *comm_pkg, + hypre_ParCSRCommPkg *extend_comm_pkg, + HYPRE_Int *IN_marker, + HYPRE_Int full_off_procNodes, + HYPRE_BigInt offset, + HYPRE_BigInt *OUT_marker) +{ + HYPRE_UNUSED_VAR(full_off_procNodes); - num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - num_recvs = hypre_ParCSRCommPkgNumRecvs(comm_pkg); - recv_vec_starts = hypre_ParCSRCommPkgRecvVecStarts(comm_pkg); + hypre_ParCSRCommHandle *comm_handle; - e_num_sends = hypre_ParCSRCommPkgNumSends(extend_comm_pkg); + HYPRE_Int i, index, shift; + HYPRE_Int num_sends, num_recvs; + HYPRE_Int *recv_vec_starts; + HYPRE_Int e_num_sends; + HYPRE_BigInt *int_buf_data; + HYPRE_BigInt *e_out_marker; + num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); + num_recvs = hypre_ParCSRCommPkgNumRecvs(comm_pkg); + recv_vec_starts = hypre_ParCSRCommPkgRecvVecStarts(comm_pkg); - index = hypre_max(hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), - hypre_ParCSRCommPkgSendMapStart(extend_comm_pkg, e_num_sends)); + e_num_sends = hypre_ParCSRCommPkgNumSends(extend_comm_pkg); - int_buf_data = hypre_CTAlloc(HYPRE_BigInt, index, HYPRE_MEMORY_HOST); + index = hypre_max(hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + hypre_ParCSRCommPkgSendMapStart(extend_comm_pkg, e_num_sends)); + int_buf_data = hypre_CTAlloc(HYPRE_BigInt, index, HYPRE_MEMORY_HOST); - /* orig commpkg data*/ - index = 0; + /* orig commpkg data*/ + index = 0; - HYPRE_Int begin = hypre_ParCSRCommPkgSendMapStart(comm_pkg, 0); - HYPRE_Int end = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends); + HYPRE_Int begin = hypre_ParCSRCommPkgSendMapStart(comm_pkg, 0); + HYPRE_Int end = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for HYPRE_SMP_SCHEDULE + #pragma omp parallel for HYPRE_SMP_SCHEDULE #endif - for (i = begin; i < end; ++i) { - int_buf_data[i - begin] = offset + - (HYPRE_BigInt) IN_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, i)]; - } - - comm_handle = hypre_ParCSRCommHandleCreate( 21, comm_pkg, int_buf_data, - OUT_marker); + for (i = begin; i < end; ++i) + { + int_buf_data[i - begin] = offset + + (HYPRE_BigInt) IN_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, i)]; + } - hypre_ParCSRCommHandleDestroy(comm_handle); - comm_handle = NULL; + comm_handle = hypre_ParCSRCommHandleCreate(21, comm_pkg, int_buf_data, OUT_marker); - /* now do the extend commpkg */ + hypre_ParCSRCommHandleDestroy(comm_handle); + comm_handle = NULL; - /* first we need to shift our position in the OUT_marker */ - shift = recv_vec_starts[num_recvs]; - e_out_marker = OUT_marker + shift; + /* now do the extend commpkg */ - index = 0; + /* first we need to shift our position in the OUT_marker */ + shift = recv_vec_starts[num_recvs]; + e_out_marker = OUT_marker + shift; - begin = hypre_ParCSRCommPkgSendMapStart(extend_comm_pkg, 0); - end = hypre_ParCSRCommPkgSendMapStart(extend_comm_pkg, e_num_sends); + index = 0; + begin = hypre_ParCSRCommPkgSendMapStart(extend_comm_pkg, 0); + end = hypre_ParCSRCommPkgSendMapStart(extend_comm_pkg, e_num_sends); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for HYPRE_SMP_SCHEDULE + #pragma omp parallel for HYPRE_SMP_SCHEDULE #endif - for (i = begin; i < end; ++i) { - int_buf_data[i - begin] = offset + - (HYPRE_BigInt) IN_marker[hypre_ParCSRCommPkgSendMapElmt(extend_comm_pkg, i)]; - } + for (i = begin; i < end; ++i) + { + int_buf_data[i - begin] = offset + + (HYPRE_BigInt) IN_marker[hypre_ParCSRCommPkgSendMapElmt(extend_comm_pkg, i)]; + } - comm_handle = hypre_ParCSRCommHandleCreate( 21, extend_comm_pkg, int_buf_data, - e_out_marker); + comm_handle = hypre_ParCSRCommHandleCreate( 21, extend_comm_pkg, int_buf_data, + e_out_marker); - hypre_ParCSRCommHandleDestroy(comm_handle); - comm_handle = NULL; + hypre_ParCSRCommHandleDestroy(comm_handle); + comm_handle = NULL; - hypre_TFree(int_buf_data, HYPRE_MEMORY_HOST); + hypre_TFree(int_buf_data, HYPRE_MEMORY_HOST); - return hypre_error_flag; + return hypre_error_flag; } -/* sort for non-ordered arrays */ -HYPRE_Int hypre_ssort(HYPRE_BigInt *data, HYPRE_Int n) +/*-------------------------------------------------------------------------- + * hypre_ssort + * + * Sort for non-ordered arrays + * + * TODO (VPM): move this to utilities? + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ssort(HYPRE_BigInt *data, + HYPRE_Int n) { - HYPRE_Int i,si; - HYPRE_Int change = 0; + HYPRE_Int i, si; + HYPRE_Int change = 0; - if(n > 0) - for(i = n-1; i > 0; i--){ - si = hypre_index_of_minimum(data,i+1); - if(i != si) + if (n > 0) + { + for (i = n - 1; i > 0; i--) { - hypre_swap_int(data, i, si); - change = 1; + si = hypre_index_of_minimum(data, i + 1); + if (i != si) + { + hypre_swap_int(data, i, si); + change = 1; + } } - } - return change; + } + + return change; } -/* Auxilary function for hypre_ssort */ -HYPRE_Int hypre_index_of_minimum(HYPRE_BigInt *data, HYPRE_Int n) +/*-------------------------------------------------------------------------- + * hypre_index_of_minimum + * + * TODO (VPM): move this to utilities? + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_index_of_minimum(HYPRE_BigInt *data, + HYPRE_Int n) { - HYPRE_Int answer; - HYPRE_Int i; + HYPRE_Int answer; + HYPRE_Int i; - answer = 0; - for(i = 1; i < n; i++) - if(data[answer] < data[i]) - answer = i; + answer = 0; + for (i = 1; i < n; i++) + { + if (data[answer] < data[i]) + { + answer = i; + } + } - return answer; + return answer; } -void hypre_swap_int(HYPRE_BigInt *data, HYPRE_Int a, HYPRE_Int b) +/*-------------------------------------------------------------------------- + * hypre_swap_int + * + * TODO (VPM): move this to utilities? + *--------------------------------------------------------------------------*/ + +void +hypre_swap_int(HYPRE_BigInt *data, + HYPRE_Int a, + HYPRE_Int b) { - HYPRE_BigInt temp; + HYPRE_BigInt temp; - temp = data[a]; - data[a] = data[b]; - data[b] = temp; + temp = data[a]; + data[a] = data[b]; + data[b] = temp; - return; + return; } -/* Initialize CF_marker_offd, CF_marker, P_marker, P_marker_offd, tmp */ -void hypre_initialize_vecs(HYPRE_Int diag_n, HYPRE_Int offd_n, HYPRE_Int *diag_ftc, HYPRE_BigInt *offd_ftc, - HYPRE_Int *diag_pm, HYPRE_Int *offd_pm, HYPRE_Int *tmp_CF) +/*-------------------------------------------------------------------------- + * hypre_initialize_vecs + * + * Initialize CF_marker_offd, CF_marker, P_marker, P_marker_offd, tmp + *--------------------------------------------------------------------------*/ + +void +hypre_initialize_vecs(HYPRE_Int diag_n, + HYPRE_Int offd_n, + HYPRE_Int *diag_ftc, + HYPRE_BigInt *offd_ftc, + HYPRE_Int *diag_pm, + HYPRE_Int *offd_pm, + HYPRE_Int *tmp_CF) { - HYPRE_Int i; + HYPRE_Int i; - /* Quicker initialization */ - if(offd_n < diag_n) - { + /* Quicker initialization */ + if (offd_n < diag_n) + { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for HYPRE_SMP_SCHEDULE + #pragma omp parallel for HYPRE_SMP_SCHEDULE #endif - for(i = 0; i < offd_n; i++) - { - diag_ftc[i] = -1; - offd_ftc[i] = -1; - tmp_CF[i] = -1; - if(diag_pm != NULL) - { diag_pm[i] = -1; } - if(offd_pm != NULL) - { offd_pm[i] = -1;} - } + for (i = 0; i < offd_n; i++) + { + diag_ftc[i] = -1; + offd_ftc[i] = -1; + tmp_CF[i] = -1; + if (diag_pm != NULL) + { + diag_pm[i] = -1; + } + if (offd_pm != NULL) + { + offd_pm[i] = -1; + } + } #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for HYPRE_SMP_SCHEDULE + #pragma omp parallel for HYPRE_SMP_SCHEDULE #endif - for(i = offd_n; i < diag_n; i++) - { - diag_ftc[i] = -1; - if(diag_pm != NULL) - { diag_pm[i] = -1; } - } - } - else - { + for (i = offd_n; i < diag_n; i++) + { + diag_ftc[i] = -1; + if (diag_pm != NULL) + { + diag_pm[i] = -1; + } + } + } + else + { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for HYPRE_SMP_SCHEDULE + #pragma omp parallel for HYPRE_SMP_SCHEDULE #endif - for(i = 0; i < diag_n; i++) - { - diag_ftc[i] = -1; - offd_ftc[i] = -1; - tmp_CF[i] = -1; - if(diag_pm != NULL) - { diag_pm[i] = -1;} - if(offd_pm != NULL) - { offd_pm[i] = -1;} - } + for (i = 0; i < diag_n; i++) + { + diag_ftc[i] = -1; + offd_ftc[i] = -1; + tmp_CF[i] = -1; + if (diag_pm != NULL) + { + diag_pm[i] = -1; + } + if (offd_pm != NULL) + { + offd_pm[i] = -1; + } + } #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for HYPRE_SMP_SCHEDULE + #pragma omp parallel for HYPRE_SMP_SCHEDULE #endif - for(i = diag_n; i < offd_n; i++) - { - offd_ftc[i] = -1; - tmp_CF[i] = -1; - if(offd_pm != NULL) - { offd_pm[i] = -1;} - } - } - return; + for (i = diag_n; i < offd_n; i++) + { + offd_ftc[i] = -1; + tmp_CF[i] = -1; + if (offd_pm != NULL) + { + offd_pm[i] = -1; + } + } + } + return; } -/* Find nodes that are offd and are not contained in original offd - * (neighbors of neighbors) */ -static HYPRE_Int hypre_new_offd_nodes(HYPRE_BigInt **found, HYPRE_Int num_cols_A_offd, - HYPRE_Int *A_ext_i, HYPRE_BigInt *A_ext_j, - HYPRE_Int num_cols_S_offd, HYPRE_BigInt *col_map_offd, HYPRE_BigInt col_1, - HYPRE_BigInt col_n, HYPRE_Int *Sop_i, HYPRE_BigInt *Sop_j, - HYPRE_Int *CF_marker_offd) +/*-------------------------------------------------------------------------- + * hypre_new_offd_nodes + * + * Find nodes that are offd and are not contained in original offd + * (neighbors of neighbors) + *--------------------------------------------------------------------------*/ + +static HYPRE_Int +hypre_new_offd_nodes(HYPRE_BigInt **found, + HYPRE_Int num_cols_A_offd, + HYPRE_Int *A_ext_i, + HYPRE_BigInt *A_ext_j, + HYPRE_Int num_cols_S_offd, + HYPRE_BigInt *col_map_offd, + HYPRE_BigInt col_1, + HYPRE_BigInt col_n, + HYPRE_Int *Sop_i, + HYPRE_BigInt *Sop_j, + HYPRE_Int *CF_marker_offd) { + HYPRE_UNUSED_VAR(num_cols_S_offd); + #ifdef HYPRE_PROFILE - hypre_profile_times[HYPRE_TIMER_ID_RENUMBER_COLIDX] -= hypre_MPI_Wtime(); + hypre_profile_times[HYPRE_TIMER_ID_RENUMBER_COLIDX] -= hypre_MPI_Wtime(); #endif - HYPRE_BigInt big_i1, big_k1; - HYPRE_Int i, j, kk; - HYPRE_Int got_loc, loc_col; + HYPRE_BigInt big_i1, big_k1; + HYPRE_Int i, j, kk; + HYPRE_Int got_loc, loc_col; - /*HYPRE_Int min;*/ - HYPRE_Int newoff = 0; + /*HYPRE_Int min;*/ + HYPRE_Int newoff = 0; #ifdef HYPRE_CONCURRENT_HOPSCOTCH - hypre_UnorderedBigIntMap col_map_offd_inverse; - hypre_UnorderedBigIntMapCreate(&col_map_offd_inverse, 2*num_cols_A_offd, 16*hypre_NumThreads()); - -#pragma omp parallel for HYPRE_SMP_SCHEDULE - for (i = 0; i < num_cols_A_offd; i++) - { - hypre_UnorderedBigIntMapPutIfAbsent(&col_map_offd_inverse, col_map_offd[i], i); - } - - /* Find nodes that will be added to the off diag list */ - HYPRE_Int size_offP = A_ext_i[num_cols_A_offd]; - hypre_UnorderedBigIntSet set; - hypre_UnorderedBigIntSetCreate(&set, size_offP, 16*hypre_NumThreads()); - -#pragma omp parallel private(i,j,big_i1) - { -#pragma omp for HYPRE_SMP_SCHEDULE - for (i = 0; i < num_cols_A_offd; i++) - { - if (CF_marker_offd[i] < 0) - { - for (j = A_ext_i[i]; j < A_ext_i[i+1]; j++) - { - big_i1 = A_ext_j[j]; - if(big_i1 < col_1 || big_i1 >= col_n) - { - if (!hypre_UnorderedBigIntSetContains(&set, big_i1)) - { - HYPRE_Int k = hypre_UnorderedBigIntMapGet(&col_map_offd_inverse, big_i1); - if (-1 == k) - { - hypre_UnorderedBigIntSetPut(&set, big_i1); - } - else - { - A_ext_j[j] = -k - 1; - } - } - } - } - for (j = Sop_i[i]; j < Sop_i[i+1]; j++) + hypre_UnorderedBigIntMap col_map_offd_inverse; + hypre_UnorderedBigIntMapCreate(&col_map_offd_inverse, + 2 * num_cols_A_offd, + 16 * hypre_NumThreads()); + + #pragma omp parallel for HYPRE_SMP_SCHEDULE + for (i = 0; i < num_cols_A_offd; i++) + { + hypre_UnorderedBigIntMapPutIfAbsent(&col_map_offd_inverse, col_map_offd[i], i); + } + + /* Find nodes that will be added to the off diag list */ + HYPRE_Int size_offP = A_ext_i[num_cols_A_offd]; + hypre_UnorderedBigIntSet set; + hypre_UnorderedBigIntSetCreate(&set, size_offP, 16 * hypre_NumThreads()); + + #pragma omp parallel private(i,j,big_i1) + { + #pragma omp for HYPRE_SMP_SCHEDULE + for (i = 0; i < num_cols_A_offd; i++) { - big_i1 = Sop_j[j]; - if(big_i1 < col_1 || big_i1 >= col_n) - { - if (!hypre_UnorderedBigIntSetContains(&set, big_i1)) - { - HYPRE_Int k = hypre_UnorderedBigIntMapGet(&col_map_offd_inverse, big_i1); - if (-1 == k) + if (CF_marker_offd[i] < 0) + { + for (j = A_ext_i[i]; j < A_ext_i[i + 1]; j++) { - hypre_UnorderedBigIntSetPut(&set, big_i1); + big_i1 = A_ext_j[j]; + if (big_i1 < col_1 || big_i1 >= col_n) + { + if (!hypre_UnorderedBigIntSetContains(&set, big_i1)) + { + HYPRE_Int k = hypre_UnorderedBigIntMapGet(&col_map_offd_inverse, big_i1); + if (-1 == k) + { + hypre_UnorderedBigIntSetPut(&set, big_i1); + } + else + { + A_ext_j[j] = -k - 1; + } + } + } } - else + for (j = Sop_i[i]; j < Sop_i[i + 1]; j++) { - Sop_j[j] = -k - 1; + big_i1 = Sop_j[j]; + if (big_i1 < col_1 || big_i1 >= col_n) + { + if (!hypre_UnorderedBigIntSetContains(&set, big_i1)) + { + HYPRE_Int k = hypre_UnorderedBigIntMapGet(&col_map_offd_inverse, big_i1); + if (-1 == k) + { + hypre_UnorderedBigIntSetPut(&set, big_i1); + } + else + { + Sop_j[j] = -k - 1; + } + } + } } - } - } - } - } /* CF_marker_offd[i] < 0 */ - } /* for each row */ - } /* omp parallel */ + } /* CF_marker_offd[i] < 0 */ + } /* for each row */ + } /* omp parallel */ - hypre_UnorderedBigIntMapDestroy(&col_map_offd_inverse); - HYPRE_BigInt *tmp_found = hypre_UnorderedBigIntSetCopyToArray(&set, &newoff); - hypre_UnorderedBigIntSetDestroy(&set); + hypre_UnorderedBigIntMapDestroy(&col_map_offd_inverse); + HYPRE_BigInt *tmp_found = hypre_UnorderedBigIntSetCopyToArray(&set, &newoff); + hypre_UnorderedBigIntSetDestroy(&set); - /* Put found in monotone increasing order */ + /* Put found in monotone increasing order */ #ifdef HYPRE_PROFILE - hypre_profile_times[HYPRE_TIMER_ID_MERGE] -= hypre_MPI_Wtime(); + hypre_profile_times[HYPRE_TIMER_ID_MERGE] -= hypre_MPI_Wtime(); #endif - hypre_UnorderedBigIntMap tmp_found_inverse; - if (newoff > 0) - { - hypre_big_sort_and_create_inverse_map(tmp_found, newoff, &tmp_found, &tmp_found_inverse); - } + hypre_UnorderedBigIntMap tmp_found_inverse; + if (newoff > 0) + { + hypre_big_sort_and_create_inverse_map(tmp_found, newoff, &tmp_found, &tmp_found_inverse); + } #ifdef HYPRE_PROFILE - hypre_profile_times[HYPRE_TIMER_ID_MERGE] += hypre_MPI_Wtime(); + hypre_profile_times[HYPRE_TIMER_ID_MERGE] += hypre_MPI_Wtime(); #endif - /* Set column indices for Sop and A_ext such that offd nodes are - * negatively indexed */ -#pragma omp parallel for private(kk,big_k1,got_loc,loc_col) HYPRE_SMP_SCHEDULE - for(i = 0; i < num_cols_A_offd; i++) - { - if (CF_marker_offd[i] < 0) + /* Set column indices for Sop and A_ext such that offd nodes are + * negatively indexed */ + #pragma omp parallel for private(kk,big_k1,got_loc,loc_col) HYPRE_SMP_SCHEDULE + for (i = 0; i < num_cols_A_offd; i++) { - for(kk = Sop_i[i]; kk < Sop_i[i+1]; kk++) - { - big_k1 = Sop_j[kk]; - if(big_k1 > -1 && (big_k1 < col_1 || big_k1 >= col_n)) - { - got_loc = hypre_UnorderedBigIntMapGet(&tmp_found_inverse, big_k1); - loc_col = got_loc + num_cols_A_offd; - Sop_j[kk] = (HYPRE_BigInt)(-loc_col - 1); - } - } - for (kk = A_ext_i[i]; kk < A_ext_i[i+1]; kk++) - { - big_k1 = A_ext_j[kk]; - if(big_k1 > -1 && (big_k1 < col_1 || big_k1 >= col_n)) - { - got_loc = hypre_UnorderedBigIntMapGet(&tmp_found_inverse, big_k1); - loc_col = got_loc + num_cols_A_offd; - A_ext_j[kk] = (HYPRE_BigInt)(-loc_col - 1); - } - } + if (CF_marker_offd[i] < 0) + { + for (kk = Sop_i[i]; kk < Sop_i[i + 1]; kk++) + { + big_k1 = Sop_j[kk]; + if (big_k1 > -1 && (big_k1 < col_1 || big_k1 >= col_n)) + { + got_loc = hypre_UnorderedBigIntMapGet(&tmp_found_inverse, big_k1); + loc_col = got_loc + num_cols_A_offd; + Sop_j[kk] = (HYPRE_BigInt)(-loc_col - 1); + } + } + for (kk = A_ext_i[i]; kk < A_ext_i[i + 1]; kk++) + { + big_k1 = A_ext_j[kk]; + if (big_k1 > -1 && (big_k1 < col_1 || big_k1 >= col_n)) + { + got_loc = hypre_UnorderedBigIntMapGet(&tmp_found_inverse, big_k1); + loc_col = got_loc + num_cols_A_offd; + A_ext_j[kk] = (HYPRE_BigInt)(-loc_col - 1); + } + } + } + } + if (newoff) + { + hypre_UnorderedBigIntMapDestroy(&tmp_found_inverse); } - } - if (newoff) - { - hypre_UnorderedBigIntMapDestroy(&tmp_found_inverse); - } #else /* !HYPRE_CONCURRENT_HOPSCOTCH */ - HYPRE_Int size_offP; + HYPRE_Int size_offP; - HYPRE_BigInt *tmp_found; - HYPRE_Int min; - HYPRE_Int ifound; + HYPRE_BigInt *tmp_found; + HYPRE_Int min; + HYPRE_Int ifound; + HYPRE_BigInt ifound_big; - size_offP = A_ext_i[num_cols_A_offd]+Sop_i[num_cols_A_offd]; - tmp_found = hypre_CTAlloc(HYPRE_BigInt, size_offP, HYPRE_MEMORY_HOST); + size_offP = A_ext_i[num_cols_A_offd] + Sop_i[num_cols_A_offd]; + tmp_found = hypre_CTAlloc(HYPRE_BigInt, size_offP, HYPRE_MEMORY_HOST); - /* Find nodes that will be added to the off diag list */ - for (i = 0; i < num_cols_A_offd; i++) - { - if (CF_marker_offd[i] < 0) + /* Find nodes that will be added to the off diag list */ + for (i = 0; i < num_cols_A_offd; i++) { - for (j = A_ext_i[i]; j < A_ext_i[i+1]; j++) - { - big_i1 = A_ext_j[j]; - if(big_i1 < col_1 || big_i1 >= col_n) + if (CF_marker_offd[i] < 0) { - ifound = hypre_BigBinarySearch(col_map_offd,big_i1,num_cols_A_offd); - if(ifound == -1) + for (j = A_ext_i[i]; j < A_ext_i[i + 1]; j++) { - tmp_found[newoff]=big_i1; - newoff++; + big_i1 = A_ext_j[j]; + if (big_i1 < col_1 || big_i1 >= col_n) + { + ifound = hypre_BigBinarySearch(col_map_offd, big_i1, num_cols_A_offd); + if (ifound == -1) + { + tmp_found[newoff] = big_i1; + newoff++; + } + else + { + A_ext_j[j] = (HYPRE_BigInt)(-ifound - 1); + } + } } - else + for (j = Sop_i[i]; j < Sop_i[i + 1]; j++) { - A_ext_j[j] = (HYPRE_BigInt)(-ifound-1); + big_i1 = Sop_j[j]; + if (big_i1 < col_1 || big_i1 >= col_n) + { + ifound = hypre_BigBinarySearch(col_map_offd, big_i1, num_cols_A_offd); + if (ifound == -1) + { + tmp_found[newoff] = big_i1; + newoff++; + } + else + { + Sop_j[j] = (HYPRE_BigInt)(-ifound - 1); + } + } } } - } - for (j = Sop_i[i]; j < Sop_i[i+1]; j++) - { - big_i1 = Sop_j[j]; - if(big_i1 < col_1 || big_i1 >= col_n) + } + /* Put found in monotone increasing order */ + if (newoff > 0) + { + hypre_BigQsort0(tmp_found, 0, newoff - 1); + ifound_big = tmp_found[0]; + min = 1; + for (i = 1; i < newoff; i++) { - ifound = hypre_BigBinarySearch(col_map_offd,big_i1,num_cols_A_offd); - if(ifound == -1) - { - tmp_found[newoff]=big_i1; - newoff++; - } - else + if (tmp_found[i] > ifound_big) { - Sop_j[j] = (HYPRE_BigInt)(-ifound-1); + ifound_big = tmp_found[i]; + tmp_found[min++] = ifound_big; } } - } + newoff = min; } - } - /* Put found in monotone increasing order */ - if (newoff > 0) - { - hypre_BigQsort0(tmp_found,0,newoff-1); - ifound = tmp_found[0]; - min = 1; - for (i=1; i < newoff; i++) - { - if (tmp_found[i] > ifound) - { - ifound = tmp_found[i]; - tmp_found[min++] = ifound; - } - } - newoff = min; - } - - /* Set column indices for Sop and A_ext such that offd nodes are - * negatively indexed */ - for(i = 0; i < num_cols_A_offd; i++) - { - if (CF_marker_offd[i] < 0) + + /* Set column indices for Sop and A_ext such that offd nodes are + * negatively indexed */ + for (i = 0; i < num_cols_A_offd; i++) { - for(kk = Sop_i[i]; kk < Sop_i[i+1]; kk++) - { - big_k1 = Sop_j[kk]; - if(big_k1 > -1 && (big_k1 < col_1 || big_k1 >= col_n)) - { - got_loc = hypre_BigBinarySearch(tmp_found,big_k1,newoff); - if(got_loc > -1) - loc_col = got_loc + num_cols_A_offd; - Sop_j[kk] = (HYPRE_BigInt)(-loc_col - 1); - } - } - for (kk = A_ext_i[i]; kk < A_ext_i[i+1]; kk++) - { - big_k1 = A_ext_j[kk]; - if(big_k1 > -1 && (big_k1 < col_1 || big_k1 >= col_n)) - { - got_loc = hypre_BigBinarySearch(tmp_found,big_k1,newoff); - loc_col = got_loc + num_cols_A_offd; - A_ext_j[kk] = (HYPRE_BigInt)(-loc_col - 1); - } - } + if (CF_marker_offd[i] < 0) + { + for (kk = Sop_i[i]; kk < Sop_i[i + 1]; kk++) + { + big_k1 = Sop_j[kk]; + if (big_k1 > -1 && (big_k1 < col_1 || big_k1 >= col_n)) + { + got_loc = hypre_BigBinarySearch(tmp_found, big_k1, newoff); + if (got_loc > -1) + { + loc_col = got_loc + num_cols_A_offd; + Sop_j[kk] = (HYPRE_BigInt)(-loc_col - 1); + } + } + } + for (kk = A_ext_i[i]; kk < A_ext_i[i + 1]; kk++) + { + big_k1 = A_ext_j[kk]; + if (big_k1 > -1 && (big_k1 < col_1 || big_k1 >= col_n)) + { + got_loc = hypre_BigBinarySearch(tmp_found, big_k1, newoff); + if (got_loc > -1) + { + loc_col = got_loc + num_cols_A_offd; + A_ext_j[kk] = (HYPRE_BigInt)(-loc_col - 1); + } + } + } + } } - } #endif /* !HYPRE_CONCURRENT_HOPSCOTCH */ - *found = tmp_found; + *found = tmp_found; #ifdef HYPRE_PROFILE - hypre_profile_times[HYPRE_TIMER_ID_RENUMBER_COLIDX] += hypre_MPI_Wtime(); + hypre_profile_times[HYPRE_TIMER_ID_RENUMBER_COLIDX] += hypre_MPI_Wtime(); #endif - return newoff; + return newoff; } -HYPRE_Int hypre_exchange_marker(hypre_ParCSRCommPkg *comm_pkg, - HYPRE_Int *IN_marker, - HYPRE_Int *OUT_marker) +/*-------------------------------------------------------------------------- + * hypre_exchange_marker + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_exchange_marker(hypre_ParCSRCommPkg *comm_pkg, + HYPRE_Int *IN_marker, + HYPRE_Int *OUT_marker) { - HYPRE_Int num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - HYPRE_Int begin = hypre_ParCSRCommPkgSendMapStart(comm_pkg, 0); - HYPRE_Int end = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends); - HYPRE_Int *int_buf_data = hypre_CTAlloc(HYPRE_Int, end, HYPRE_MEMORY_HOST); + HYPRE_Int num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); + HYPRE_Int begin = hypre_ParCSRCommPkgSendMapStart(comm_pkg, 0); + HYPRE_Int end = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends); + HYPRE_Int *int_buf_data = hypre_CTAlloc(HYPRE_Int, end, HYPRE_MEMORY_HOST); + + hypre_ParCSRCommHandle *comm_handle; + HYPRE_Int i; + - HYPRE_Int i; #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for HYPRE_SMP_SCHEDULE + #pragma omp parallel for HYPRE_SMP_SCHEDULE #endif - for (i = begin; i < end; ++i) { - int_buf_data[i - begin] = - IN_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, i)]; - } - - hypre_ParCSRCommHandle *comm_handle = hypre_ParCSRCommHandleCreate( 11, comm_pkg, int_buf_data, - OUT_marker); + for (i = begin; i < end; ++i) + { + int_buf_data[i - begin] = IN_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, i)]; + } - hypre_ParCSRCommHandleDestroy(comm_handle); - hypre_TFree(int_buf_data, HYPRE_MEMORY_HOST); + comm_handle = hypre_ParCSRCommHandleCreate(11, comm_pkg, int_buf_data, OUT_marker); + hypre_ParCSRCommHandleDestroy(comm_handle); + hypre_TFree(int_buf_data, HYPRE_MEMORY_HOST); - return hypre_error_flag; + return hypre_error_flag; } -HYPRE_Int hypre_exchange_interp_data( - HYPRE_Int **CF_marker_offd, - HYPRE_Int **dof_func_offd, - hypre_CSRMatrix **A_ext, - HYPRE_Int *full_off_procNodes, - hypre_CSRMatrix **Sop, - hypre_ParCSRCommPkg **extend_comm_pkg, - hypre_ParCSRMatrix *A, - HYPRE_Int *CF_marker, - hypre_ParCSRMatrix *S, - HYPRE_Int num_functions, - HYPRE_Int *dof_func, - HYPRE_Int skip_fine_or_same_sign) // skip_fine_or_same_sign if we want to skip fine points in S and nnz with the same sign as diagonal in A +/*-------------------------------------------------------------------------- + * hypre_exchange_interp_data + * + * skip_fine_or_same_sign: if we want to skip fine points in S and nnz with + * the same sign as diagonal in A + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_exchange_interp_data(HYPRE_Int **CF_marker_offd, + HYPRE_Int **dof_func_offd, + hypre_CSRMatrix **A_ext, + HYPRE_Int *full_off_procNodes, + hypre_CSRMatrix **Sop, + hypre_ParCSRCommPkg **extend_comm_pkg, + hypre_ParCSRMatrix *A, + HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, + HYPRE_Int num_functions, + HYPRE_Int *dof_func, + HYPRE_Int skip_fine_or_same_sign) { #ifdef HYPRE_PROFILE - hypre_profile_times[HYPRE_TIMER_ID_EXCHANGE_INTERP_DATA] -= hypre_MPI_Wtime(); + hypre_profile_times[HYPRE_TIMER_ID_EXCHANGE_INTERP_DATA] -= hypre_MPI_Wtime(); #endif - hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); - hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); - hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); - HYPRE_Int num_cols_A_offd = hypre_CSRMatrixNumCols(A_offd); - HYPRE_BigInt *col_map_offd = hypre_ParCSRMatrixColMapOffd(A); - HYPRE_BigInt col_1 = hypre_ParCSRMatrixFirstRowIndex(A); - HYPRE_Int local_numrows = hypre_CSRMatrixNumRows(A_diag); - HYPRE_BigInt col_n = col_1 + (HYPRE_BigInt)local_numrows; - HYPRE_BigInt *found = NULL; - - /*---------------------------------------------------------------------- - * Get the off processors rows for A and S, associated with columns in - * A_offd and S_offd. - *---------------------------------------------------------------------*/ - *CF_marker_offd = hypre_TAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); - hypre_exchange_marker(comm_pkg, CF_marker, *CF_marker_offd); - - hypre_ParCSRCommHandle *comm_handle_a_idx, *comm_handle_a_data; - *A_ext = hypre_ParCSRMatrixExtractBExt_Overlap(A,A,1,&comm_handle_a_idx,&comm_handle_a_data,CF_marker,*CF_marker_offd,skip_fine_or_same_sign,skip_fine_or_same_sign); - HYPRE_Int *A_ext_i = hypre_CSRMatrixI(*A_ext); - HYPRE_BigInt *A_ext_j = hypre_CSRMatrixBigJ(*A_ext); - HYPRE_Int A_ext_rows = hypre_CSRMatrixNumRows(*A_ext); - - hypre_ParCSRCommHandle *comm_handle_s_idx; - *Sop = hypre_ParCSRMatrixExtractBExt_Overlap(S,A,0,&comm_handle_s_idx,NULL,CF_marker,*CF_marker_offd,skip_fine_or_same_sign,0); - HYPRE_Int *Sop_i = hypre_CSRMatrixI(*Sop); - HYPRE_BigInt *Sop_j = hypre_CSRMatrixBigJ(*Sop); - HYPRE_Int Soprows = hypre_CSRMatrixNumRows(*Sop); - - HYPRE_Int *send_idx = (HYPRE_Int *)comm_handle_s_idx->send_data; - hypre_ParCSRCommHandleDestroy(comm_handle_s_idx); - hypre_TFree(send_idx, HYPRE_MEMORY_HOST); - - send_idx = (HYPRE_Int *)comm_handle_a_idx->send_data; - hypre_ParCSRCommHandleDestroy(comm_handle_a_idx); - hypre_TFree(send_idx, HYPRE_MEMORY_HOST); - - /* Find nodes that are neighbors of neighbors, not found in offd */ + hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); + HYPRE_Int num_cols_A_offd = hypre_CSRMatrixNumCols(A_offd); + HYPRE_BigInt *col_map_offd = hypre_ParCSRMatrixColMapOffd(A); + HYPRE_BigInt col_1 = hypre_ParCSRMatrixFirstRowIndex(A); + HYPRE_Int local_numrows = hypre_CSRMatrixNumRows(A_diag); + HYPRE_BigInt col_n = col_1 + (HYPRE_BigInt) local_numrows; + + HYPRE_BigInt *found = NULL; + hypre_ParCSRCommHandle *comm_handle_s_idx; + + /*---------------------------------------------------------------------- + * Get the off processors rows for A and S, associated with columns in + * A_offd and S_offd. + *---------------------------------------------------------------------*/ + *CF_marker_offd = hypre_TAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); + hypre_exchange_marker(comm_pkg, CF_marker, *CF_marker_offd); + + hypre_ParCSRCommHandle *comm_handle_a_idx, *comm_handle_a_data; + *A_ext = hypre_ParCSRMatrixExtractBExt_Overlap(A, A, 1, &comm_handle_a_idx, + &comm_handle_a_data, + CF_marker, *CF_marker_offd, + skip_fine_or_same_sign, + skip_fine_or_same_sign); + HYPRE_Int *A_ext_i = hypre_CSRMatrixI(*A_ext); + HYPRE_BigInt *A_ext_j = hypre_CSRMatrixBigJ(*A_ext); + HYPRE_Int A_ext_rows = hypre_CSRMatrixNumRows(*A_ext); + + *Sop = hypre_ParCSRMatrixExtractBExt_Overlap(S, A, 0, &comm_handle_s_idx, NULL, CF_marker, + *CF_marker_offd, skip_fine_or_same_sign, 0); + + HYPRE_Int *Sop_i = hypre_CSRMatrixI(*Sop); + HYPRE_BigInt *Sop_j = hypre_CSRMatrixBigJ(*Sop); + HYPRE_Int Soprows = hypre_CSRMatrixNumRows(*Sop); + HYPRE_Int *send_idx = (HYPRE_Int *) comm_handle_s_idx->send_data; + + hypre_ParCSRCommHandleDestroy(comm_handle_s_idx); + hypre_TFree(send_idx, HYPRE_MEMORY_HOST); + + send_idx = (HYPRE_Int *)comm_handle_a_idx->send_data; + hypre_ParCSRCommHandleDestroy(comm_handle_a_idx); + hypre_TFree(send_idx, HYPRE_MEMORY_HOST); + + /* Find nodes that are neighbors of neighbors, not found in offd */ #ifdef HYPRE_PROFILE - hypre_profile_times[HYPRE_TIMER_ID_EXCHANGE_INTERP_DATA] += hypre_MPI_Wtime(); + hypre_profile_times[HYPRE_TIMER_ID_EXCHANGE_INTERP_DATA] += hypre_MPI_Wtime(); #endif - HYPRE_Int newoff = hypre_new_offd_nodes(&found, A_ext_rows, A_ext_i, A_ext_j, - Soprows, col_map_offd, col_1, col_n, - Sop_i, Sop_j, *CF_marker_offd); + HYPRE_Int newoff = hypre_new_offd_nodes(&found, A_ext_rows, A_ext_i, A_ext_j, + Soprows, col_map_offd, col_1, col_n, + Sop_i, Sop_j, *CF_marker_offd); #ifdef HYPRE_PROFILE - hypre_profile_times[HYPRE_TIMER_ID_EXCHANGE_INTERP_DATA] -= hypre_MPI_Wtime(); + hypre_profile_times[HYPRE_TIMER_ID_EXCHANGE_INTERP_DATA] -= hypre_MPI_Wtime(); #endif - if(newoff >= 0) - *full_off_procNodes = newoff + num_cols_A_offd; - else - { - return hypre_error_flag; - } - - /* Possibly add new points and new processors to the comm_pkg, all - * processors need new_comm_pkg */ - - /* AHB - create a new comm package just for extended info - - this will work better with the assumed partition*/ - hypre_ParCSRFindExtendCommPkg(hypre_ParCSRMatrixComm(A), - hypre_ParCSRMatrixGlobalNumCols(A), - hypre_ParCSRMatrixFirstColDiag(A), - hypre_CSRMatrixNumCols(A_diag), - hypre_ParCSRMatrixColStarts(A), - hypre_ParCSRMatrixAssumedPartition(A), - newoff, - found, - extend_comm_pkg); - - *CF_marker_offd = hypre_TReAlloc(*CF_marker_offd, HYPRE_Int, *full_off_procNodes, HYPRE_MEMORY_HOST); - hypre_exchange_marker(*extend_comm_pkg, CF_marker, *CF_marker_offd + A_ext_rows); - - if(num_functions > 1) - { - if (*full_off_procNodes > 0) - *dof_func_offd = hypre_CTAlloc(HYPRE_Int, *full_off_procNodes, HYPRE_MEMORY_HOST); - - hypre_alt_insert_new_nodes(comm_pkg, *extend_comm_pkg, dof_func, - *full_off_procNodes, *dof_func_offd); - } - - hypre_TFree(found, HYPRE_MEMORY_HOST); - - HYPRE_Real *send_data = (HYPRE_Real *)comm_handle_a_data->send_data; - hypre_ParCSRCommHandleDestroy(comm_handle_a_data); - hypre_TFree(send_data, HYPRE_MEMORY_HOST); + if (newoff >= 0) + { + *full_off_procNodes = newoff + num_cols_A_offd; + } + else + { + return hypre_error_flag; + } + + /* Possibly add new points and new processors to the comm_pkg, all + * processors need new_comm_pkg */ + + /* AHB - create a new comm package just for extended info - + this will work better with the assumed partition*/ + hypre_ParCSRFindExtendCommPkg(hypre_ParCSRMatrixComm(A), + hypre_ParCSRMatrixGlobalNumCols(A), + hypre_ParCSRMatrixFirstColDiag(A), + hypre_CSRMatrixNumCols(A_diag), + hypre_ParCSRMatrixColStarts(A), + hypre_ParCSRMatrixAssumedPartition(A), + newoff, + found, + extend_comm_pkg); + + *CF_marker_offd = hypre_TReAlloc(*CF_marker_offd, HYPRE_Int, *full_off_procNodes, + HYPRE_MEMORY_HOST); + hypre_exchange_marker(*extend_comm_pkg, CF_marker, *CF_marker_offd + A_ext_rows); + + if (num_functions > 1) + { + if (*full_off_procNodes > 0) + { + *dof_func_offd = hypre_CTAlloc(HYPRE_Int, *full_off_procNodes, HYPRE_MEMORY_HOST); + } + + hypre_alt_insert_new_nodes(comm_pkg, *extend_comm_pkg, dof_func, + *full_off_procNodes, *dof_func_offd); + } + + hypre_TFree(found, HYPRE_MEMORY_HOST); + + HYPRE_Real *send_data = (HYPRE_Real *)comm_handle_a_data->send_data; + hypre_ParCSRCommHandleDestroy(comm_handle_a_data); + hypre_TFree(send_data, HYPRE_MEMORY_HOST); #ifdef HYPRE_PROFILE - hypre_profile_times[HYPRE_TIMER_ID_EXCHANGE_INTERP_DATA] += hypre_MPI_Wtime(); + hypre_profile_times[HYPRE_TIMER_ID_EXCHANGE_INTERP_DATA] += hypre_MPI_Wtime(); #endif - return hypre_error_flag; + return hypre_error_flag; } -void hypre_build_interp_colmap(hypre_ParCSRMatrix *P, HYPRE_Int full_off_procNodes, HYPRE_Int *tmp_CF_marker_offd, HYPRE_BigInt *fine_to_coarse_offd) +/*-------------------------------------------------------------------------- + * hypre_build_interp_colmap + *--------------------------------------------------------------------------*/ + +void +hypre_build_interp_colmap(hypre_ParCSRMatrix *P, + HYPRE_Int full_off_procNodes, + HYPRE_Int *tmp_CF_marker_offd, + HYPRE_BigInt *fine_to_coarse_offd) { #ifdef HYPRE_PROFILE hypre_profile_times[HYPRE_TIMER_ID_RENUMBER_COLIDX] -= hypre_MPI_Wtime(); @@ -690,7 +799,7 @@ void hypre_build_interp_colmap(hypre_ParCSRMatrix *P, HYPRE_Int full_off_procNod prefix_sum_workspace = hypre_TAlloc(HYPRE_Int, hypre_NumThreads() + 1, HYPRE_MEMORY_HOST); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < full_off_procNodes; i++) { @@ -701,7 +810,7 @@ void hypre_build_interp_colmap(hypre_ParCSRMatrix *P, HYPRE_Int full_off_procNod * tmp_CF_marker_offd has i marked. num_cols_P_offd is then set to the * total number of times P_marker is set */ #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,index) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,index) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < P_offd_size; i++) { @@ -713,7 +822,7 @@ void hypre_build_interp_colmap(hypre_ParCSRMatrix *P, HYPRE_Int full_off_procNod } #ifdef HYPRE_USING_OPENMP -#pragma omp parallel private(i) + #pragma omp parallel private(i) #endif { HYPRE_Int i_begin, i_end; @@ -722,13 +831,13 @@ void hypre_build_interp_colmap(hypre_ParCSRMatrix *P, HYPRE_Int full_off_procNod HYPRE_Int local_num_cols_P_offd = 0; for (i = i_begin; i < i_end; i++) { - if (P_marker[i] == 1) local_num_cols_P_offd++; + if (P_marker[i] == 1) { local_num_cols_P_offd++; } } hypre_prefix_sum(&local_num_cols_P_offd, &num_cols_P_offd, prefix_sum_workspace); #ifdef HYPRE_USING_OPENMP -#pragma omp master + #pragma omp master #endif { if (num_cols_P_offd) @@ -737,24 +846,25 @@ void hypre_build_interp_colmap(hypre_ParCSRMatrix *P, HYPRE_Int full_off_procNod } } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif for (i = i_begin; i < i_end; i++) { if (P_marker[i] == 1) { - col_map_offd_P[local_num_cols_P_offd++] = fine_to_coarse_offd[i]; + col_map_offd_P[local_num_cols_P_offd++] = fine_to_coarse_offd[i]; } } } hypre_UnorderedBigIntMap col_map_offd_P_inverse; - hypre_big_sort_and_create_inverse_map(col_map_offd_P, num_cols_P_offd, &col_map_offd_P, &col_map_offd_P_inverse); + hypre_big_sort_and_create_inverse_map(col_map_offd_P, num_cols_P_offd, &col_map_offd_P, + &col_map_offd_P_inverse); // find old idx -> new idx map #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for + #pragma omp parallel for #endif for (i = 0; i < full_off_procNodes; i++) { @@ -767,9 +877,9 @@ void hypre_build_interp_colmap(hypre_ParCSRMatrix *P, HYPRE_Int full_off_procNod } #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for + #pragma omp parallel for #endif - for(i = 0; i < P_offd_size; i++) + for (i = 0; i < P_offd_size; i++) { P_offd_j[i] = P_marker[P_offd_j[i]]; } diff --git a/external/hypre/src/parcsr_ls/aux_interp.h b/external/hypre/src/parcsr_ls/aux_interp.h index 99fe9cda..c2fa6ab1 100644 --- a/external/hypre/src/parcsr_ls/aux_interp.h +++ b/external/hypre/src/parcsr_ls/aux_interp.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -11,38 +11,39 @@ extern "C" { void hypre_ParCSRCommExtendA(hypre_ParCSRMatrix *A, HYPRE_Int newoff, HYPRE_Int *found, - HYPRE_Int *p_num_recvs, HYPRE_Int **p_recv_procs, - HYPRE_Int **p_recv_vec_starts, HYPRE_Int *p_num_sends, - HYPRE_Int **p_send_procs, HYPRE_Int **p_send_map_starts, - HYPRE_Int **p_send_map_elmts, HYPRE_Int **p_node_add); + HYPRE_Int *p_num_recvs, HYPRE_Int **p_recv_procs, + HYPRE_Int **p_recv_vec_starts, HYPRE_Int *p_num_sends, + HYPRE_Int **p_send_procs, HYPRE_Int **p_send_map_starts, + HYPRE_Int **p_send_map_elmts, HYPRE_Int **p_node_add); -HYPRE_Int alt_insert_new_nodes(hypre_ParCSRCommPkg *comm_pkg, - hypre_ParCSRCommPkg *extend_comm_pkg, - HYPRE_Int *IN_marker, - HYPRE_Int full_off_procNodes, - HYPRE_Int *OUT_marker); +HYPRE_Int alt_insert_new_nodes(hypre_ParCSRCommPkg *comm_pkg, + hypre_ParCSRCommPkg *extend_comm_pkg, + HYPRE_Int *IN_marker, + HYPRE_Int full_off_procNodes, + HYPRE_Int *OUT_marker); HYPRE_Int hypre_ssort(HYPRE_BigInt *data, HYPRE_Int n); HYPRE_Int index_of_minimum(HYPRE_BigInt *data, HYPRE_Int n); void swap_int(HYPRE_BigInt *data, HYPRE_Int a, HYPRE_Int b); -void initialize_vecs(HYPRE_Int diag_n, HYPRE_Int offd_n, HYPRE_Int *diag_ftc, HYPRE_Int *offd_ftc, - HYPRE_Int *diag_pm, HYPRE_Int *offd_pm, HYPRE_Int *tmp_CF); +void initialize_vecs(HYPRE_Int diag_n, HYPRE_Int offd_n, HYPRE_Int *diag_ftc, HYPRE_Int *offd_ftc, + HYPRE_Int *diag_pm, HYPRE_Int *offd_pm, HYPRE_Int *tmp_CF); HYPRE_Int exchange_interp_data( - HYPRE_Int **CF_marker_offd, - HYPRE_Int **dof_func_offd, - hypre_CSRMatrix **A_ext, - HYPRE_Int *full_off_procNodes, - hypre_CSRMatrix **Sop, - hypre_ParCSRCommPkg **extend_comm_pkg, - hypre_ParCSRMatrix *A, - HYPRE_Int *CF_marker, - hypre_ParCSRMatrix *S, - HYPRE_Int num_functions, - HYPRE_Int *dof_func, - HYPRE_Int skip_fine_or_same_sign); + HYPRE_Int **CF_marker_offd, + HYPRE_Int **dof_func_offd, + hypre_CSRMatrix **A_ext, + HYPRE_Int *full_off_procNodes, + hypre_CSRMatrix **Sop, + hypre_ParCSRCommPkg **extend_comm_pkg, + hypre_ParCSRMatrix *A, + HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, + HYPRE_Int num_functions, + HYPRE_Int *dof_func, + HYPRE_Int skip_fine_or_same_sign); -void build_interp_colmap(hypre_ParCSRMatrix *P, HYPRE_Int full_off_procNodes, HYPRE_Int *tmp_CF_marker_offd, HYPRE_Int *fine_to_coarse_offd); +void build_interp_colmap(hypre_ParCSRMatrix *P, HYPRE_Int full_off_procNodes, + HYPRE_Int *tmp_CF_marker_offd, HYPRE_Int *fine_to_coarse_offd); #ifdef __cplusplus } diff --git a/external/hypre/src/parcsr_ls/block_tridiag.c b/external/hypre/src/parcsr_ls/block_tridiag.c index 1677fa0d..b8d7660e 100644 --- a/external/hypre/src/parcsr_ls/block_tridiag.c +++ b/external/hypre/src/parcsr_ls/block_tridiag.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -21,7 +21,7 @@ * hypre_BlockTridiagCreate *--------------------------------------------------------------------------*/ -void *hypre_BlockTridiagCreate() +void *hypre_BlockTridiagCreate(void) { hypre_BlockTridiagData *b_data; b_data = hypre_CTAlloc(hypre_BlockTridiagData, 1, HYPRE_MEMORY_HOST); @@ -114,19 +114,25 @@ HYPRE_Int hypre_BlockTridiagDestroy(void *data) * Routines to setup the preconditioner *--------------------------------------------------------------------------*/ -HYPRE_Int hypre_BlockTridiagSetup(void *data, hypre_ParCSRMatrix *A, - hypre_ParVector *b, hypre_ParVector *x) +HYPRE_Int +hypre_BlockTridiagSetup(void *data, + hypre_ParCSRMatrix *A, + hypre_ParVector *b, + hypre_ParVector *x) { - HYPRE_Int i, j, *index_set1, print_level, nsweeps, relax_type; - HYPRE_Int nrows, nrows1, nrows2, start1, start2, *index_set2; - HYPRE_Int count, ierr; - HYPRE_Real threshold; - hypre_ParCSRMatrix **submatrices; - HYPRE_Solver precon1; - HYPRE_Solver precon2; - HYPRE_IJVector ij_u1, ij_u2, ij_f1, ij_f2; - hypre_ParVector *vector; - MPI_Comm comm; + HYPRE_UNUSED_VAR(b); + HYPRE_UNUSED_VAR(x); + + HYPRE_Int i, j, *index_set1, print_level, nsweeps, relax_type; + HYPRE_Int nrows, nrows1, nrows2, start1, start2, *index_set2; + HYPRE_Int count, ierr; + HYPRE_Real threshold; + hypre_ParCSRMatrix **submatrices; + HYPRE_Solver precon1; + HYPRE_Solver precon2; + HYPRE_IJVector ij_u1, ij_u2, ij_f1, ij_f2; + hypre_ParVector *vector; + MPI_Comm comm; hypre_BlockTridiagData *b_data = (hypre_BlockTridiagData *) data; HYPRE_ParCSRMatrixGetComm((HYPRE_ParCSRMatrix) A, &comm); @@ -134,39 +140,41 @@ HYPRE_Int hypre_BlockTridiagSetup(void *data, hypre_ParCSRMatrix *A, nrows1 = index_set1[0]; nrows = hypre_ParCSRMatrixNumRows(A); nrows2 = nrows - nrows1; - b_data->index_set2 = hypre_CTAlloc(HYPRE_Int, nrows2+1, HYPRE_MEMORY_HOST); + b_data->index_set2 = hypre_CTAlloc(HYPRE_Int, nrows2 + 1, HYPRE_MEMORY_HOST); index_set2 = b_data->index_set2; index_set2[0] = nrows2; count = 1; - for (i = 0; i < index_set1[1]; i++) index_set2[count++] = i; - for (i = 1; i < nrows1; i++) - for (j = index_set1[i]+1; j < index_set1[i+1]; j++) + for (i = 0; i < index_set1[1]; i++) { index_set2[count++] = i; } + for (i = 1; i < nrows1; i++) + for (j = index_set1[i] + 1; j < index_set1[i + 1]; j++) + { index_set2[count++] = j; - for (i = index_set1[nrows1]+1; i < nrows; i++) index_set2[count++] = i; + } + for (i = index_set1[nrows1] + 1; i < nrows; i++) { index_set2[count++] = i; } submatrices = hypre_CTAlloc(hypre_ParCSRMatrix *, 4, HYPRE_MEMORY_HOST); hypre_ParCSRMatrixExtractSubmatrices(A, index_set1, &submatrices); nrows1 = hypre_ParCSRMatrixNumRows(submatrices[0]); - nrows2 = hypre_ParCSRMatrixNumRows(submatrices[3]); + nrows2 = hypre_ParCSRMatrixNumRows(submatrices[3]); start1 = hypre_ParCSRMatrixFirstRowIndex(submatrices[0]); start2 = hypre_ParCSRMatrixFirstRowIndex(submatrices[3]); - HYPRE_IJVectorCreate(comm, start1, start1+nrows1-1, &ij_u1); + HYPRE_IJVectorCreate(comm, start1, start1 + nrows1 - 1, &ij_u1); HYPRE_IJVectorSetObjectType(ij_u1, HYPRE_PARCSR); ierr = HYPRE_IJVectorInitialize(ij_u1); ierr += HYPRE_IJVectorAssemble(ij_u1); hypre_assert(!ierr); - HYPRE_IJVectorCreate(comm, start1, start1+nrows1-1, &ij_f1); + HYPRE_IJVectorCreate(comm, start1, start1 + nrows1 - 1, &ij_f1); HYPRE_IJVectorSetObjectType(ij_f1, HYPRE_PARCSR); ierr = HYPRE_IJVectorInitialize(ij_f1); ierr += HYPRE_IJVectorAssemble(ij_f1); hypre_assert(!ierr); - HYPRE_IJVectorCreate(comm, start2, start2+nrows2-1, &ij_u2); + HYPRE_IJVectorCreate(comm, start2, start2 + nrows2 - 1, &ij_u2); HYPRE_IJVectorSetObjectType(ij_u2, HYPRE_PARCSR); ierr = HYPRE_IJVectorInitialize(ij_u2); ierr += HYPRE_IJVectorAssemble(ij_u2); hypre_assert(!ierr); - HYPRE_IJVectorCreate(comm, start2, start2+nrows1-1, &ij_f2); + HYPRE_IJVectorCreate(comm, start2, start2 + nrows1 - 1, &ij_f2); HYPRE_IJVectorSetObjectType(ij_f2, HYPRE_PARCSR); ierr = HYPRE_IJVectorInitialize(ij_f2); ierr += HYPRE_IJVectorAssemble(ij_f2); @@ -228,16 +236,21 @@ HYPRE_Int hypre_BlockTridiagSetup(void *data, hypre_ParCSRMatrix *A, * Routines to solve the preconditioner *--------------------------------------------------------------------------*/ -HYPRE_Int hypre_BlockTridiagSolve(void *data, hypre_ParCSRMatrix *A, - hypre_ParVector *b, hypre_ParVector *x) +HYPRE_Int +hypre_BlockTridiagSolve(void *data, + hypre_ParCSRMatrix *A, + hypre_ParVector *b, + hypre_ParVector *x) { + HYPRE_UNUSED_VAR(A); + HYPRE_Int i, ind, nrows1, nrows2, *index_set1, *index_set2; - HYPRE_Real *ffv, *uuv, *f1v, *f2v, *u1v, *u2v; - HYPRE_ParCSRMatrix A21, A11, A22; - hypre_ParVector *F1, *U1, *F2, *U2; - HYPRE_Solver precon1, precon2; - hypre_BlockTridiagData *b_data = (hypre_BlockTridiagData *) data; - + HYPRE_Real *ffv, *uuv, *f1v, *f2v, *u1v, *u2v; + HYPRE_ParCSRMatrix A21, A11, A22; + hypre_ParVector *F1, *U1, *F2, *U2; + HYPRE_Solver precon1, precon2; + hypre_BlockTridiagData *b_data = (hypre_BlockTridiagData *) data; + index_set1 = b_data->index_set1; index_set2 = b_data->index_set2; nrows1 = index_set1[0]; @@ -259,30 +272,30 @@ HYPRE_Int hypre_BlockTridiagSolve(void *data, hypre_ParCSRMatrix *A, u2v = hypre_VectorData(hypre_ParVectorLocalVector(U2)); for (i = 0; i < nrows1; i++) { - ind = index_set1[i+1]; + ind = index_set1[i + 1]; f1v[i] = ffv[ind]; u1v[i] = 0.0; } - HYPRE_BoomerAMGSolve(precon1, A11, (HYPRE_ParVector) F1, + HYPRE_BoomerAMGSolve(precon1, A11, (HYPRE_ParVector) F1, (HYPRE_ParVector) U1); for (i = 0; i < nrows2; i++) { - ind = index_set2[i+1]; + ind = index_set2[i + 1]; f2v[i] = ffv[ind]; u2v[i] = 0.0; } - HYPRE_ParCSRMatrixMatvec(-1.0,A21,(HYPRE_ParVector) U1,1.0, + HYPRE_ParCSRMatrixMatvec(-1.0, A21, (HYPRE_ParVector) U1, 1.0, (HYPRE_ParVector) F2); - HYPRE_BoomerAMGSolve(precon2, A22, (HYPRE_ParVector) F2, + HYPRE_BoomerAMGSolve(precon2, A22, (HYPRE_ParVector) F2, (HYPRE_ParVector) U2); for (i = 0; i < nrows1; i++) { - ind = index_set1[i+1]; + ind = index_set1[i + 1]; uuv[ind] = u1v[i]; } for (i = 0; i < nrows2; i++) { - ind = index_set2[i+1]; + ind = index_set2[i + 1]; uuv[ind] = u2v[i]; } return (0); @@ -294,14 +307,14 @@ HYPRE_Int hypre_BlockTridiagSolve(void *data, hypre_ParCSRMatrix *A, HYPRE_Int hypre_BlockTridiagSetIndexSet(void *data, HYPRE_Int n, HYPRE_Int *inds) { - HYPRE_Int i, ierr=0, *indices; + HYPRE_Int i, ierr = 0, *indices; hypre_BlockTridiagData *b_data = (hypre_BlockTridiagData *) data; - if (n <= 0 || inds == NULL) ierr = 1; - b_data->index_set1 = hypre_CTAlloc(HYPRE_Int, n+1, HYPRE_MEMORY_HOST); + if (n <= 0 || inds == NULL) { ierr = 1; } + b_data->index_set1 = hypre_CTAlloc(HYPRE_Int, n + 1, HYPRE_MEMORY_HOST); indices = b_data->index_set1; indices[0] = n; - for (i = 0; i < n; i++) indices[i+1] = inds[i]; + for (i = 0; i < n; i++) { indices[i + 1] = inds[i]; } return (ierr); } @@ -311,7 +324,7 @@ HYPRE_Int hypre_BlockTridiagSetIndexSet(void *data, HYPRE_Int n, HYPRE_Int *inds HYPRE_Int hypre_BlockTridiagSetAMGStrengthThreshold(void *data, HYPRE_Real thresh) { - hypre_BlockTridiagData *b_data = (hypre_BlockTridiagData *) data; + hypre_BlockTridiagData *b_data = (hypre_BlockTridiagData *) data; b_data->threshold = thresh; return (0); } @@ -348,4 +361,3 @@ HYPRE_Int hypre_BlockTridiagSetPrintLevel(void *data, HYPRE_Int print_level) b_data->print_level = print_level; return (0); } - diff --git a/external/hypre/src/parcsr_ls/block_tridiag.h b/external/hypre/src/parcsr_ls/block_tridiag.h index 6e77cfd4..3e4b7b07 100644 --- a/external/hypre/src/parcsr_ls/block_tridiag.h +++ b/external/hypre/src/parcsr_ls/block_tridiag.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,8 +17,8 @@ typedef struct { - HYPRE_Int num_sweeps; - HYPRE_Int relax_type; + HYPRE_Int num_sweeps; + HYPRE_Int relax_type; HYPRE_Int *index_set1, *index_set2; HYPRE_Int print_level; HYPRE_Real threshold; @@ -32,12 +32,12 @@ typedef struct * functions for hypre_BlockTridiag *--------------------------------------------------------------------------*/ -void *hypre_BlockTridiagCreate(); +void *hypre_BlockTridiagCreate(void); HYPRE_Int hypre_BlockTridiagDestroy(void *); -HYPRE_Int hypre_BlockTridiagSetup(void * , hypre_ParCSRMatrix *, - hypre_ParVector *, hypre_ParVector *); -HYPRE_Int hypre_BlockTridiagSolve(void * , hypre_ParCSRMatrix *, - hypre_ParVector *, hypre_ParVector *); +HYPRE_Int hypre_BlockTridiagSetup(void *, hypre_ParCSRMatrix *, + hypre_ParVector *, hypre_ParVector *); +HYPRE_Int hypre_BlockTridiagSolve(void *, hypre_ParCSRMatrix *, + hypre_ParVector *, hypre_ParVector *); HYPRE_Int hypre_BlockTridiagSetIndexSet(void *, HYPRE_Int, HYPRE_Int *); HYPRE_Int hypre_BlockTridiagSetAMGStrengthThreshold(void *, HYPRE_Real); HYPRE_Int hypre_BlockTridiagSetAMGNumSweeps(void *, HYPRE_Int); diff --git a/external/hypre/src/parcsr_ls/csr_block_matrix.h b/external/hypre/src/parcsr_ls/csr_block_matrix.h index 3f4bbdac..c05ba0d5 100644 --- a/external/hypre/src/parcsr_ls/csr_block_matrix.h +++ b/external/hypre/src/parcsr_ls/csr_block_matrix.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -31,15 +31,15 @@ extern "C" { typedef struct { - HYPRE_Complex *data; - HYPRE_Int *i; - HYPRE_Int *j; - HYPRE_BigInt *big_j; - HYPRE_Int block_size; - HYPRE_Int num_rows; - HYPRE_Int num_cols; - HYPRE_Int num_nonzeros; - HYPRE_Int owns_data; + HYPRE_Complex *data; + HYPRE_Int *i; + HYPRE_Int *j; + HYPRE_BigInt *big_j; + HYPRE_Int block_size; + HYPRE_Int num_rows; + HYPRE_Int num_cols; + HYPRE_Int num_nonzeros; + HYPRE_Int owns_data; } hypre_CSRBlockMatrix; @@ -61,81 +61,97 @@ typedef struct * other functions for the CSR Block Matrix structure *--------------------------------------------------------------------------*/ -hypre_CSRBlockMatrix - *hypre_CSRBlockMatrixCreate(HYPRE_Int, HYPRE_Int, HYPRE_Int, HYPRE_Int); +hypre_CSRBlockMatrix +*hypre_CSRBlockMatrixCreate(HYPRE_Int, HYPRE_Int, HYPRE_Int, HYPRE_Int); HYPRE_Int hypre_CSRBlockMatrixDestroy(hypre_CSRBlockMatrix *); HYPRE_Int hypre_CSRBlockMatrixInitialize(hypre_CSRBlockMatrix *); HYPRE_Int hypre_CSRBlockMatrixBigInitialize(hypre_CSRBlockMatrix *); HYPRE_Int hypre_CSRBlockMatrixSetDataOwner(hypre_CSRBlockMatrix *, HYPRE_Int); -hypre_CSRMatrix - *hypre_CSRBlockMatrixCompress(hypre_CSRBlockMatrix *); -hypre_CSRMatrix - *hypre_CSRBlockMatrixConvertToCSRMatrix(hypre_CSRBlockMatrix *); +hypre_CSRMatrix +*hypre_CSRBlockMatrixCompress(hypre_CSRBlockMatrix *); +hypre_CSRMatrix +*hypre_CSRBlockMatrixConvertToCSRMatrix(hypre_CSRBlockMatrix *); hypre_CSRBlockMatrix - *hypre_CSRBlockMatrixConvertFromCSRMatrix(hypre_CSRMatrix *, HYPRE_Int); +*hypre_CSRBlockMatrixConvertFromCSRMatrix(hypre_CSRMatrix *, HYPRE_Int); HYPRE_Int hypre_CSRBlockMatrixBlockAdd(HYPRE_Complex *, HYPRE_Complex *, HYPRE_Complex*, HYPRE_Int); -HYPRE_Int hypre_CSRBlockMatrixBlockMultAdd(HYPRE_Complex *, HYPRE_Complex *, HYPRE_Complex, HYPRE_Complex *, HYPRE_Int); -HYPRE_Int hypre_CSRBlockMatrixBlockMultAddDiag(HYPRE_Complex *, HYPRE_Complex *, HYPRE_Complex, HYPRE_Complex *, HYPRE_Int); +HYPRE_Int hypre_CSRBlockMatrixBlockMultAdd(HYPRE_Complex *, HYPRE_Complex *, HYPRE_Complex, + HYPRE_Complex *, HYPRE_Int); +HYPRE_Int hypre_CSRBlockMatrixBlockMultAddDiag(HYPRE_Complex *, HYPRE_Complex *, HYPRE_Complex, + HYPRE_Complex *, HYPRE_Int); HYPRE_Int -hypre_CSRBlockMatrixBlockMultAddDiag2(HYPRE_Complex* i1, HYPRE_Complex* i2, HYPRE_Complex beta, +hypre_CSRBlockMatrixBlockMultAddDiag2(HYPRE_Complex* i1, HYPRE_Complex* i2, HYPRE_Complex beta, HYPRE_Complex* o, HYPRE_Int block_size); HYPRE_Int -hypre_CSRBlockMatrixBlockMultAddDiag3(HYPRE_Complex* i1, HYPRE_Complex* i2, HYPRE_Complex beta, +hypre_CSRBlockMatrixBlockMultAddDiag3(HYPRE_Complex* i1, HYPRE_Complex* i2, HYPRE_Complex beta, HYPRE_Complex* o, HYPRE_Int block_size); - -HYPRE_Int hypre_CSRBlockMatrixBlockInvMult(HYPRE_Complex *, HYPRE_Complex *, HYPRE_Complex *, HYPRE_Int); -HYPRE_Int hypre_CSRBlockMatrixBlockInvMultDiag(HYPRE_Complex *, HYPRE_Complex *, HYPRE_Complex *, HYPRE_Int); + +HYPRE_Int hypre_CSRBlockMatrixBlockInvMult(HYPRE_Complex *, HYPRE_Complex *, HYPRE_Complex *, + HYPRE_Int); +HYPRE_Int hypre_CSRBlockMatrixBlockInvMultDiag(HYPRE_Complex *, HYPRE_Complex *, HYPRE_Complex *, + HYPRE_Int); HYPRE_Int -hypre_CSRBlockMatrixBlockInvMultDiag2(HYPRE_Complex* i1, HYPRE_Complex* i2, HYPRE_Complex* o, HYPRE_Int block_size); - +hypre_CSRBlockMatrixBlockInvMultDiag2(HYPRE_Complex* i1, HYPRE_Complex* i2, HYPRE_Complex* o, + HYPRE_Int block_size); + HYPRE_Int -hypre_CSRBlockMatrixBlockInvMultDiag3(HYPRE_Complex* i1, HYPRE_Complex* i2, HYPRE_Complex* o, HYPRE_Int block_size); - +hypre_CSRBlockMatrixBlockInvMultDiag3(HYPRE_Complex* i1, HYPRE_Complex* i2, HYPRE_Complex* o, + HYPRE_Int block_size); -HYPRE_Int hypre_CSRBlockMatrixBlockMultInv(HYPRE_Complex *, HYPRE_Complex *, HYPRE_Complex *, HYPRE_Int); + +HYPRE_Int hypre_CSRBlockMatrixBlockMultInv(HYPRE_Complex *, HYPRE_Complex *, HYPRE_Complex *, + HYPRE_Int); HYPRE_Int hypre_CSRBlockMatrixBlockTranspose(HYPRE_Complex *, HYPRE_Complex *, HYPRE_Int); HYPRE_Int hypre_CSRBlockMatrixTranspose(hypre_CSRBlockMatrix *A, - hypre_CSRBlockMatrix **AT, HYPRE_Int data); + hypre_CSRBlockMatrix **AT, HYPRE_Int data); -HYPRE_Int hypre_CSRBlockMatrixBlockCopyData(HYPRE_Complex*, HYPRE_Complex*, HYPRE_Complex, HYPRE_Int); -HYPRE_Int hypre_CSRBlockMatrixBlockCopyDataDiag(HYPRE_Complex*, HYPRE_Complex*, HYPRE_Complex, HYPRE_Int); +HYPRE_Int hypre_CSRBlockMatrixBlockCopyData(HYPRE_Complex*, HYPRE_Complex*, HYPRE_Complex, + HYPRE_Int); +HYPRE_Int hypre_CSRBlockMatrixBlockCopyDataDiag(HYPRE_Complex*, HYPRE_Complex*, HYPRE_Complex, + HYPRE_Int); HYPRE_Int hypre_CSRBlockMatrixBlockAddAccumulate(HYPRE_Complex*, HYPRE_Complex*, HYPRE_Int); -HYPRE_Int hypre_CSRBlockMatrixBlockAddAccumulateDiag(HYPRE_Complex* i1, HYPRE_Complex* o, HYPRE_Int block_size); - +HYPRE_Int hypre_CSRBlockMatrixBlockAddAccumulateDiag(HYPRE_Complex* i1, HYPRE_Complex* o, + HYPRE_Int block_size); + HYPRE_Int hypre_CSRBlockMatrixMatvec(HYPRE_Complex alpha, hypre_CSRBlockMatrix *A, hypre_Vector *x, HYPRE_Complex beta, hypre_Vector *y); - + HYPRE_Int hypre_CSRBlockMatrixMatvecT( HYPRE_Complex alpha, hypre_CSRBlockMatrix *A, hypre_Vector *x, HYPRE_Complex beta, hypre_Vector *y ); HYPRE_Int -hypre_CSRBlockMatrixBlockInvMatvec(HYPRE_Complex* mat, HYPRE_Complex* v, +hypre_CSRBlockMatrixBlockInvMatvec(HYPRE_Complex* mat, HYPRE_Complex* v, HYPRE_Complex* ov, HYPRE_Int block_size); - -HYPRE_Int -hypre_CSRBlockMatrixBlockMatvec(HYPRE_Complex alpha, HYPRE_Complex* mat, HYPRE_Complex* v, HYPRE_Complex beta, + +HYPRE_Int +hypre_CSRBlockMatrixBlockMatvec(HYPRE_Complex alpha, HYPRE_Complex* mat, HYPRE_Complex* v, + HYPRE_Complex beta, HYPRE_Complex* ov, HYPRE_Int block_size); - - -HYPRE_Int hypre_CSRBlockMatrixBlockNorm(HYPRE_Int norm_type, HYPRE_Complex* data, HYPRE_Real* out, HYPRE_Int block_size); - -HYPRE_Int hypre_CSRBlockMatrixBlockSetScalar(HYPRE_Complex* o, HYPRE_Complex beta, HYPRE_Int block_size); - -HYPRE_Int hypre_CSRBlockMatrixComputeSign(HYPRE_Complex *i1, HYPRE_Complex *o, HYPRE_Int block_size); -HYPRE_Int hypre_CSRBlockMatrixBlockAddAccumulateDiagCheckSign(HYPRE_Complex* i1, HYPRE_Complex* o, HYPRE_Int block_size, HYPRE_Real *sign); -HYPRE_Int hypre_CSRBlockMatrixBlockMultAddDiagCheckSign(HYPRE_Complex* i1, HYPRE_Complex* i2, HYPRE_Complex beta, HYPRE_Complex* o, HYPRE_Int block_size, HYPRE_Real *sign); + + +HYPRE_Int hypre_CSRBlockMatrixBlockNorm(HYPRE_Int norm_type, HYPRE_Complex* data, HYPRE_Real* out, + HYPRE_Int block_size); + +HYPRE_Int hypre_CSRBlockMatrixBlockSetScalar(HYPRE_Complex* o, HYPRE_Complex beta, + HYPRE_Int block_size); + +HYPRE_Int hypre_CSRBlockMatrixComputeSign(HYPRE_Complex *i1, HYPRE_Complex *o, + HYPRE_Int block_size); +HYPRE_Int hypre_CSRBlockMatrixBlockAddAccumulateDiagCheckSign(HYPRE_Complex* i1, HYPRE_Complex* o, + HYPRE_Int block_size, HYPRE_Real *sign); +HYPRE_Int hypre_CSRBlockMatrixBlockMultAddDiagCheckSign(HYPRE_Complex* i1, HYPRE_Complex* i2, + HYPRE_Complex beta, HYPRE_Complex* o, HYPRE_Int block_size, HYPRE_Real *sign); #ifdef __cplusplus } diff --git a/external/hypre/src/parcsr_ls/driver.c b/external/hypre/src/parcsr_ls/driver.c index 2397320e..0a0aabbd 100644 --- a/external/hypre/src/parcsr_ls/driver.c +++ b/external/hypre/src/parcsr_ls/driver.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -11,7 +11,7 @@ * Test driver for unstructured matrix interfoace (parcsr storage). * Do `driver -help' for usage info. *--------------------------------------------------------------------------*/ - + HYPRE_Int main( HYPRE_Int argc, char *argv[] ) @@ -25,9 +25,9 @@ main( HYPRE_Int argc, HYPRE_Int solver_id; HYPRE_Int ioutdat; HYPRE_Int debug_flag; - HYPRE_Int ierr,i; + HYPRE_Int ierr, i; HYPRE_Int max_levels = 25; - HYPRE_Int num_iterations; + HYPRE_Int num_iterations; HYPRE_Real norm; HYPRE_Real final_res_norm; @@ -44,7 +44,7 @@ main( HYPRE_Int argc, HYPRE_Int global_m, global_n; HYPRE_Int *partitioning; - HYPRE_Int time_index; + HYPRE_Int time_index; /* parameters for BoomerAMG */ HYPRE_Real strong_threshold; @@ -53,11 +53,11 @@ main( HYPRE_Int argc, HYPRE_Int coarsen_type = 0; HYPRE_Int hybrid = 1; HYPRE_Int measure_type = 0; - HYPRE_Int *num_grid_sweeps; - HYPRE_Int *grid_relax_type; + HYPRE_Int *num_grid_sweeps; + HYPRE_Int *grid_relax_type; HYPRE_Int **grid_relax_points; HYPRE_Int relax_default; - HYPRE_Real *relax_weight; + HYPRE_Real *relax_weight; HYPRE_Real tol = 1.0e-6; /* parameters for PILUT */ @@ -65,7 +65,7 @@ main( HYPRE_Int argc, HYPRE_Int nonzeros_to_keep = -1; /* parameters for GMRES */ - HYPRE_Int k_dim; + HYPRE_Int k_dim; /*----------------------------------------------------------- * Initialize some stuff @@ -80,7 +80,7 @@ main( HYPRE_Int argc, /*----------------------------------------------------------- * Set defaults *-----------------------------------------------------------*/ - + build_matrix_type = 1; build_matrix_arg_index = argc; build_rhs_type = 0; @@ -95,7 +95,7 @@ main( HYPRE_Int argc, /*----------------------------------------------------------- * Parse command line *-----------------------------------------------------------*/ - + print_usage = 0; arg_index = 1; @@ -153,59 +153,59 @@ main( HYPRE_Int argc, arg_index++; build_rhs_type = 2; build_rhs_arg_index = arg_index; - } + } else if ( strcmp(argv[arg_index], "-rhsrand") == 0 ) { arg_index++; build_rhs_type = 3; build_rhs_arg_index = arg_index; - } + } else if ( strcmp(argv[arg_index], "-ruge") == 0 ) { arg_index++; coarsen_type = 1; - } + } else if ( strcmp(argv[arg_index], "-ruge2b") == 0 ) { arg_index++; coarsen_type = 2; - } + } else if ( strcmp(argv[arg_index], "-ruge3") == 0 ) { arg_index++; coarsen_type = 3; - } + } else if ( strcmp(argv[arg_index], "-ruge3c") == 0 ) { arg_index++; coarsen_type = 4; - } + } else if ( strcmp(argv[arg_index], "-rugerlx") == 0 ) { arg_index++; coarsen_type = 5; - } + } else if ( strcmp(argv[arg_index], "-falgout") == 0 ) { arg_index++; coarsen_type = 6; - } + } else if ( strcmp(argv[arg_index], "-nohybrid") == 0 ) { arg_index++; hybrid = -1; - } + } else if ( strcmp(argv[arg_index], "-gm") == 0 ) { arg_index++; measure_type = 1; - } + } else if ( strcmp(argv[arg_index], "-xisone") == 0 ) { arg_index++; build_rhs_type = 4; build_rhs_arg_index = arg_index; - } + } else if ( strcmp(argv[arg_index], "-rlx") == 0 ) { arg_index++; @@ -228,7 +228,7 @@ main( HYPRE_Int argc, /* for CGNR preconditioned with Boomeramg, only relaxation scheme 2 is implemented, i.e. Jacobi relaxation with Matvec */ - if (solver_id == 5) relax_default = 2; + if (solver_id == 5) { relax_default = 2; } /* defaults for BoomerAMG */ strong_threshold = 0.25; @@ -240,56 +240,58 @@ main( HYPRE_Int argc, grid_relax_points = hypre_CTAlloc(HYPRE_Int *, 4, HYPRE_MEMORY_HOST); relax_weight = hypre_CTAlloc(HYPRE_Real, max_levels, HYPRE_MEMORY_HOST); - for (i=0; i < max_levels; i++) - relax_weight[i] = 0.0; + for (i = 0; i < max_levels; i++) + { + relax_weight[i] = 0.0; + } if (coarsen_type == 5) { /* fine grid */ num_grid_sweeps[0] = 3; - grid_relax_type[0] = relax_default; - grid_relax_points[0] = hypre_CTAlloc(HYPRE_Int, 4, HYPRE_MEMORY_HOST); + grid_relax_type[0] = relax_default; + grid_relax_points[0] = hypre_CTAlloc(HYPRE_Int, 4, HYPRE_MEMORY_HOST); grid_relax_points[0][0] = -2; grid_relax_points[0][1] = -1; grid_relax_points[0][2] = 1; - + /* down cycle */ num_grid_sweeps[1] = 4; - grid_relax_type[1] = relax_default; - grid_relax_points[1] = hypre_CTAlloc(HYPRE_Int, 4, HYPRE_MEMORY_HOST); + grid_relax_type[1] = relax_default; + grid_relax_points[1] = hypre_CTAlloc(HYPRE_Int, 4, HYPRE_MEMORY_HOST); grid_relax_points[1][0] = -1; grid_relax_points[1][1] = 1; grid_relax_points[1][2] = -2; grid_relax_points[1][3] = -2; - + /* up cycle */ num_grid_sweeps[2] = 4; - grid_relax_type[2] = relax_default; - grid_relax_points[2] = hypre_CTAlloc(HYPRE_Int, 4, HYPRE_MEMORY_HOST); + grid_relax_type[2] = relax_default; + grid_relax_points[2] = hypre_CTAlloc(HYPRE_Int, 4, HYPRE_MEMORY_HOST); grid_relax_points[2][0] = -2; grid_relax_points[2][1] = -2; grid_relax_points[2][2] = 1; grid_relax_points[2][3] = -1; } else - { + { /* fine grid */ num_grid_sweeps[0] = 2; - grid_relax_type[0] = relax_default; - grid_relax_points[0] = hypre_CTAlloc(HYPRE_Int, 2, HYPRE_MEMORY_HOST); + grid_relax_type[0] = relax_default; + grid_relax_points[0] = hypre_CTAlloc(HYPRE_Int, 2, HYPRE_MEMORY_HOST); grid_relax_points[0][0] = 1; grid_relax_points[0][1] = -1; - + /* down cycle */ num_grid_sweeps[1] = 2; - grid_relax_type[1] = relax_default; - grid_relax_points[1] = hypre_CTAlloc(HYPRE_Int, 2, HYPRE_MEMORY_HOST); + grid_relax_type[1] = relax_default; + grid_relax_points[1] = hypre_CTAlloc(HYPRE_Int, 2, HYPRE_MEMORY_HOST); grid_relax_points[1][0] = 1; grid_relax_points[1][1] = -1; - + /* up cycle */ num_grid_sweeps[2] = 2; - grid_relax_type[2] = relax_default; - grid_relax_points[2] = hypre_CTAlloc(HYPRE_Int, 2, HYPRE_MEMORY_HOST); + grid_relax_type[2] = relax_default; + grid_relax_points[2] = hypre_CTAlloc(HYPRE_Int, 2, HYPRE_MEMORY_HOST); grid_relax_points[2][0] = -1; grid_relax_points[2][1] = 1; } @@ -315,8 +317,10 @@ main( HYPRE_Int argc, { arg_index++; relax_weight[0] = atof(argv[arg_index++]); - for (i=1; i < max_levels; i++) - relax_weight[i] = relax_weight[0]; + for (i = 1; i < max_levels; i++) + { + relax_weight[i] = relax_weight[0]; + } } else if ( strcmp(argv[arg_index], "-th") == 0 ) { @@ -357,7 +361,7 @@ main( HYPRE_Int argc, /*----------------------------------------------------------- * Print usage info *-----------------------------------------------------------*/ - + if ( (print_usage) && (myid == 0) ) { hypre_printf("\n"); @@ -382,9 +386,9 @@ main( HYPRE_Int argc, hypre_printf("\n"); hypre_printf(" -solver : solver ID\n"); hypre_printf(" 1=AMG-PCG 2=DS-PCG \n"); - hypre_printf(" 3=AMG-GMRES 4=DS-GMRES \n"); - hypre_printf(" 5=AMG-CGNR 6=DS-CGNR \n"); - hypre_printf(" 7=PILUT-GMRES \n"); + hypre_printf(" 3=AMG-GMRES 4=DS-GMRES \n"); + hypre_printf(" 5=AMG-CGNR 6=DS-CGNR \n"); + hypre_printf(" 7=PILUT-GMRES \n"); hypre_printf("\n"); hypre_printf(" -ruge : Ruge coarsening (local)\n"); hypre_printf(" -ruge3 : third pass on boundary\n"); @@ -398,20 +402,20 @@ main( HYPRE_Int argc, hypre_printf(" -rlx : relaxation type\n"); hypre_printf(" 0=Weighted Jacobi \n"); hypre_printf(" 3=Hybrid Jacobi/Gauss-Seidel \n"); - hypre_printf("\n"); + hypre_printf("\n"); hypre_printf(" -th : set AMG threshold Theta = val \n"); hypre_printf(" -tr : set AMG interpolation truncation factor = val \n"); hypre_printf(" -tol : set AMG convergence tolerance to val\n"); hypre_printf(" -w : set Jacobi relax weight = val\n"); hypre_printf(" -k : dimension Krylov space for GMRES\n"); - hypre_printf("\n"); + hypre_printf("\n"); hypre_printf(" -drop_tol : set threshold for dropping in PILUT\n"); hypre_printf(" -nonzeros_to_keep : number of nonzeros in each row to keep\n"); - hypre_printf("\n"); + hypre_printf("\n"); hypre_printf(" -iout : set output flag\n"); - hypre_printf(" 0=no output 1=matrix stats\n"); - hypre_printf(" 2=cycle stats 3=matrix & cycle stats\n"); - hypre_printf("\n"); + hypre_printf(" 0=no output 1=matrix stats\n"); + hypre_printf(" 2=cycle stats 3=matrix & cycle stats\n"); + hypre_printf("\n"); hypre_printf(" -dbg : set debug flag\n"); hypre_printf(" 0=no debugging\n 1=internal timing\n 2=interpolation truncation\n 3=more detailed timing in coarsening routine\n"); exit(1); @@ -424,7 +428,7 @@ main( HYPRE_Int argc, /*----------------------------------------------------------- * Print driver parameters *-----------------------------------------------------------*/ - + if (myid == 0) { hypre_printf("Running with these driver parameters:\n"); @@ -473,11 +477,11 @@ main( HYPRE_Int argc, hypre_printf("Rhs from file not yet implemented. Defaults to b=0\n"); HYPRE_ParCSRMatrixGetRowPartitioning(A, &partitioning); HYPRE_ParCSRMatrixGetDims(A, &global_m, &global_n); - HYPRE_ParVectorCreate(hypre_MPI_COMM_WORLD, global_m, partitioning,&b); + HYPRE_ParVectorCreate(hypre_MPI_COMM_WORLD, global_m, partitioning, &b); HYPRE_ParVectorInitialize(b); HYPRE_ParVectorSetConstantValues(b, 0.0); - HYPRE_ParVectorCreate(hypre_MPI_COMM_WORLD, global_n, partitioning,&x); + HYPRE_ParVectorCreate(hypre_MPI_COMM_WORLD, global_n, partitioning, &x); HYPRE_ParVectorInitialize(x); HYPRE_ParVectorSetConstantValues(x, 1.0); } @@ -487,50 +491,50 @@ main( HYPRE_Int argc, HYPRE_ParCSRMatrixGetRowPartitioning(A, &partitioning); HYPRE_ParCSRMatrixGetDims(A, &global_m, &global_n); - HYPRE_ParVectorCreate(hypre_MPI_COMM_WORLD, global_n, partitioning,&x); + HYPRE_ParVectorCreate(hypre_MPI_COMM_WORLD, global_n, partitioning, &x); HYPRE_ParVectorInitialize(x); - HYPRE_ParVectorSetConstantValues(x, 0.0); + HYPRE_ParVectorSetConstantValues(x, 0.0); } else if ( build_rhs_type == 3 ) { HYPRE_ParCSRMatrixGetRowPartitioning(A, &partitioning); HYPRE_ParCSRMatrixGetDims(A, &global_m, &global_n); - HYPRE_ParVectorCreate(hypre_MPI_COMM_WORLD, global_m, partitioning,&b); + HYPRE_ParVectorCreate(hypre_MPI_COMM_WORLD, global_m, partitioning, &b); HYPRE_ParVectorInitialize(b); HYPRE_ParVectorSetRandomValues(b, 22775); - HYPRE_ParVectorInnerProd(b,b,&norm); - norm = 1.0/sqrt(norm); - ierr = HYPRE_ParVectorScale(norm, b); + HYPRE_ParVectorInnerProd(b, b, &norm); + norm = 1.0 / hypre_sqrt(norm); + ierr = HYPRE_ParVectorScale(norm, b); - HYPRE_ParVectorCreate(hypre_MPI_COMM_WORLD, global_n, partitioning,&x); + HYPRE_ParVectorCreate(hypre_MPI_COMM_WORLD, global_n, partitioning, &x); HYPRE_ParVectorInitialize(x); - HYPRE_ParVectorSetConstantValues(x, 0.0); + HYPRE_ParVectorSetConstantValues(x, 0.0); } else if ( build_rhs_type == 4 ) { HYPRE_ParCSRMatrixGetRowPartitioning(A, &partitioning); HYPRE_ParCSRMatrixGetDims(A, &global_m, &global_n); - HYPRE_ParVectorCreate(hypre_MPI_COMM_WORLD, global_n, partitioning,&x); + HYPRE_ParVectorCreate(hypre_MPI_COMM_WORLD, global_n, partitioning, &x); HYPRE_ParVectorInitialize(x); - HYPRE_ParVectorSetConstantValues(x, 1.0); + HYPRE_ParVectorSetConstantValues(x, 1.0); - HYPRE_ParVectorCreate(hypre_MPI_COMM_WORLD, global_m, partitioning,&b); + HYPRE_ParVectorCreate(hypre_MPI_COMM_WORLD, global_m, partitioning, &b); HYPRE_ParVectorInitialize(b); - HYPRE_ParCSRMatrixMatvec(1.0,A,x,0.0,b); + HYPRE_ParCSRMatrixMatvec(1.0, A, x, 0.0, b); - HYPRE_ParVectorSetConstantValues(x, 0.0); + HYPRE_ParVectorSetConstantValues(x, 0.0); } else /* if ( build_rhs_type == 0 ) */ { HYPRE_ParCSRMatrixGetRowPartitioning(A, &partitioning); HYPRE_ParCSRMatrixGetDims(A, &global_m, &global_n); - HYPRE_ParVectorCreate(hypre_MPI_COMM_WORLD, global_m, partitioning,&b); + HYPRE_ParVectorCreate(hypre_MPI_COMM_WORLD, global_m, partitioning, &b); HYPRE_ParVectorInitialize(b); HYPRE_ParVectorSetConstantValues(b, 0.0); - HYPRE_ParVectorCreate(hypre_MPI_COMM_WORLD, global_n, partitioning,&x); + HYPRE_ParVectorCreate(hypre_MPI_COMM_WORLD, global_n, partitioning, &x); HYPRE_ParVectorInitialize(x); HYPRE_ParVectorSetConstantValues(x, 1.0); } @@ -543,8 +547,8 @@ main( HYPRE_Int argc, time_index = hypre_InitializeTiming("BoomerAMG Setup"); hypre_BeginTiming(time_index); - HYPRE_BoomerAMGCreate(&amg_solver); - HYPRE_BoomerAMGSetCoarsenType(amg_solver, (hybrid*coarsen_type)); + HYPRE_BoomerAMGCreate(&amg_solver); + HYPRE_BoomerAMGSetCoarsenType(amg_solver, (hybrid * coarsen_type)); HYPRE_BoomerAMGSetMeasureType(amg_solver, measure_type); HYPRE_BoomerAMGSetTol(amg_solver, tol); HYPRE_BoomerAMGSetStrongThreshold(amg_solver, strong_threshold); @@ -565,7 +569,7 @@ main( HYPRE_Int argc, hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); - + time_index = hypre_InitializeTiming("BoomerAMG Solve"); hypre_BeginTiming(time_index); @@ -580,26 +584,26 @@ main( HYPRE_Int argc, } /*----------------------------------------------------------- - * Solve the system using PCG + * Solve the system using PCG *-----------------------------------------------------------*/ if (solver_id == 1 || solver_id == 2) { time_index = hypre_InitializeTiming("PCG Setup"); hypre_BeginTiming(time_index); - + HYPRE_ParCSRPCGCreate(hypre_MPI_COMM_WORLD, &pcg_solver); HYPRE_ParCSRPCGSetMaxIter(pcg_solver, 500); HYPRE_ParCSRPCGSetTol(pcg_solver, tol); HYPRE_ParCSRPCGSetTwoNorm(pcg_solver, 1); HYPRE_ParCSRPCGSetRelChange(pcg_solver, 0); HYPRE_ParCSRPCGSetPrintLevel(pcg_solver, 1); - + if (solver_id == 1) { /* use BoomerAMG as preconditioner */ - HYPRE_BoomerAMGCreate(&pcg_precond); - HYPRE_BoomerAMGSetCoarsenType(pcg_precond, (hybrid*coarsen_type)); + HYPRE_BoomerAMGCreate(&pcg_precond); + HYPRE_BoomerAMGSetCoarsenType(pcg_precond, (hybrid * coarsen_type)); HYPRE_BoomerAMGSetMeasureType(pcg_precond, measure_type); HYPRE_BoomerAMGSetStrongThreshold(pcg_precond, strong_threshold); HYPRE_BoomerAMGSetPrintLevel(pcg_precond, ioutdat); @@ -627,28 +631,28 @@ main( HYPRE_Int argc, HYPRE_ParCSRDiagScaleSetup, pcg_precond); } - + HYPRE_ParCSRPCGSetup(pcg_solver, A, b, x); - + hypre_EndTiming(time_index); hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); - + time_index = hypre_InitializeTiming("PCG Solve"); hypre_BeginTiming(time_index); - + HYPRE_ParCSRPCGSolve(pcg_solver, A, b, x); - + hypre_EndTiming(time_index); hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); - + HYPRE_ParCSRPCGGetNumIterations(pcg_solver, &num_iterations); HYPRE_ParCSRPCGGetFinalRelativeResidualNorm(pcg_solver, &final_res_norm); HYPRE_ParCSRPCGDestroy(pcg_solver); - + if (solver_id == 1) { HYPRE_BoomerAMGDestroy(pcg_precond); @@ -660,30 +664,30 @@ main( HYPRE_Int argc, hypre_printf("Final Relative Residual Norm = %e\n", final_res_norm); hypre_printf("\n"); } - + } /*----------------------------------------------------------- - * Solve the system using GMRES + * Solve the system using GMRES *-----------------------------------------------------------*/ if (solver_id == 3 || solver_id == 4 || solver_id == 7) { time_index = hypre_InitializeTiming("GMRES Setup"); hypre_BeginTiming(time_index); - + HYPRE_ParCSRGMRESCreate(hypre_MPI_COMM_WORLD, &pcg_solver); HYPRE_ParCSRGMRESSetKDim(pcg_solver, k_dim); HYPRE_ParCSRGMRESSetMaxIter(pcg_solver, 100); HYPRE_ParCSRGMRESSetTol(pcg_solver, tol); HYPRE_ParCSRGMRESSetLogging(pcg_solver, 1); - + if (solver_id == 3) { /* use BoomerAMG as preconditioner */ - HYPRE_BoomerAMGCreate(&pcg_precond); - HYPRE_BoomerAMGSetCoarsenType(pcg_precond, (hybrid*coarsen_type)); + HYPRE_BoomerAMGCreate(&pcg_precond); + HYPRE_BoomerAMGSetCoarsenType(pcg_precond, (hybrid * coarsen_type)); HYPRE_BoomerAMGSetMeasureType(pcg_precond, measure_type); HYPRE_BoomerAMGSetStrongThreshold(pcg_precond, strong_threshold); HYPRE_BoomerAMGSetPrintLevel(pcg_precond, ioutdat); @@ -696,9 +700,9 @@ main( HYPRE_Int argc, HYPRE_BoomerAMGSetGridRelaxPoints(pcg_precond, grid_relax_points); HYPRE_BoomerAMGSetMaxLevels(pcg_precond, max_levels); HYPRE_ParCSRGMRESSetPrecond(pcg_solver, - HYPRE_BoomerAMGSolve, - HYPRE_BoomerAMGSetup, - pcg_precond); + HYPRE_BoomerAMGSolve, + HYPRE_BoomerAMGSetup, + pcg_precond); } else if (solver_id == 4) { @@ -707,53 +711,54 @@ main( HYPRE_Int argc, pcg_precond = NULL; HYPRE_ParCSRGMRESSetPrecond(pcg_solver, - HYPRE_ParCSRDiagScale, - HYPRE_ParCSRDiagScaleSetup, - pcg_precond); + HYPRE_ParCSRDiagScale, + HYPRE_ParCSRDiagScaleSetup, + pcg_precond); } else if (solver_id == 7) { /* use PILUT as preconditioner */ - ierr = HYPRE_ParCSRPilutCreate( hypre_MPI_COMM_WORLD, &pcg_precond ); - if (ierr) { - hypre_printf("Error in ParPilutCreate\n"); + ierr = HYPRE_ParCSRPilutCreate( hypre_MPI_COMM_WORLD, &pcg_precond ); + if (ierr) + { + hypre_printf("Error in ParPilutCreate\n"); } HYPRE_ParCSRGMRESSetPrecond(pcg_solver, - HYPRE_ParCSRPilutSolve, - HYPRE_ParCSRPilutSetup, - pcg_precond); + HYPRE_ParCSRPilutSolve, + HYPRE_ParCSRPilutSetup, + pcg_precond); if (drop_tol >= 0 ) HYPRE_ParCSRPilutSetDropTolerance( pcg_precond, - drop_tol ); + drop_tol ); if (nonzeros_to_keep >= 0 ) HYPRE_ParCSRPilutSetFactorRowSize( pcg_precond, - nonzeros_to_keep ); + nonzeros_to_keep ); } - + HYPRE_ParCSRGMRESSetup(pcg_solver, A, b, x); - + hypre_EndTiming(time_index); hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); - + time_index = hypre_InitializeTiming("GMRES Solve"); hypre_BeginTiming(time_index); - + HYPRE_ParCSRGMRESSolve(pcg_solver, A, b, x); - + hypre_EndTiming(time_index); hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); - + HYPRE_ParCSRGMRESGetNumIterations(pcg_solver, &num_iterations); - HYPRE_ParCSRGMRESGetFinalRelativeResidualNorm(pcg_solver,&final_res_norm); + HYPRE_ParCSRGMRESGetFinalRelativeResidualNorm(pcg_solver, &final_res_norm); HYPRE_ParCSRGMRESDestroy(pcg_solver); - + if (solver_id == 3) { HYPRE_BoomerAMGDestroy(pcg_precond); @@ -773,24 +778,24 @@ main( HYPRE_Int argc, } } /*----------------------------------------------------------- - * Solve the system using CGNR + * Solve the system using CGNR *-----------------------------------------------------------*/ if (solver_id == 5 || solver_id == 6) { time_index = hypre_InitializeTiming("CGNR Setup"); hypre_BeginTiming(time_index); - + HYPRE_ParCSRCGNRCreate(hypre_MPI_COMM_WORLD, &pcg_solver); HYPRE_ParCSRCGNRSetMaxIter(pcg_solver, 1000); HYPRE_ParCSRCGNRSetTol(pcg_solver, tol); HYPRE_ParCSRCGNRSetLogging(pcg_solver, 1); - + if (solver_id == 5) { /* use BoomerAMG as preconditioner */ - HYPRE_BoomerAMGCreate(&pcg_precond); - HYPRE_BoomerAMGSetCoarsenType(pcg_precond, (hybrid*coarsen_type)); + HYPRE_BoomerAMGCreate(&pcg_precond); + HYPRE_BoomerAMGSetCoarsenType(pcg_precond, (hybrid * coarsen_type)); HYPRE_BoomerAMGSetMeasureType(pcg_precond, measure_type); HYPRE_BoomerAMGSetStrongThreshold(pcg_precond, strong_threshold); HYPRE_BoomerAMGSetPrintLevel(pcg_precond, ioutdat); @@ -803,10 +808,10 @@ main( HYPRE_Int argc, HYPRE_BoomerAMGSetGridRelaxPoints(pcg_precond, grid_relax_points); HYPRE_BoomerAMGSetMaxLevels(pcg_precond, max_levels); HYPRE_ParCSRCGNRSetPrecond(pcg_solver, - HYPRE_BoomerAMGSolve, - HYPRE_BoomerAMGSolveT, - HYPRE_BoomerAMGSetup, - pcg_precond); + HYPRE_BoomerAMGSolve, + HYPRE_BoomerAMGSolveT, + HYPRE_BoomerAMGSetup, + pcg_precond); } else if (solver_id == 6) { @@ -815,33 +820,33 @@ main( HYPRE_Int argc, pcg_precond = NULL; HYPRE_ParCSRCGNRSetPrecond(pcg_solver, - HYPRE_ParCSRDiagScale, - HYPRE_ParCSRDiagScale, - HYPRE_ParCSRDiagScaleSetup, - pcg_precond); + HYPRE_ParCSRDiagScale, + HYPRE_ParCSRDiagScale, + HYPRE_ParCSRDiagScaleSetup, + pcg_precond); } - + HYPRE_ParCSRCGNRSetup(pcg_solver, A, b, x); - + hypre_EndTiming(time_index); hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); - + time_index = hypre_InitializeTiming("CGNR Solve"); hypre_BeginTiming(time_index); - + HYPRE_ParCSRCGNRSolve(pcg_solver, A, b, x); - + hypre_EndTiming(time_index); hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); - + HYPRE_ParCSRCGNRGetNumIterations(pcg_solver, &num_iterations); - HYPRE_ParCSRCGNRGetFinalRelativeResidualNorm(pcg_solver,&final_res_norm); + HYPRE_ParCSRCGNRGetFinalRelativeResidualNorm(pcg_solver, &final_res_norm); HYPRE_ParCSRCGNRDestroy(pcg_solver); - + if (solver_id == 5) { HYPRE_BoomerAMGDestroy(pcg_precond); @@ -921,16 +926,16 @@ BuildParFromFile( HYPRE_Int argc, /*----------------------------------------------------------- * Print driver parameters *-----------------------------------------------------------*/ - + if (myid == 0) { hypre_printf(" FromFile: %s\n", filename); } /*----------------------------------------------------------- - * Generate the matrix + * Generate the matrix *-----------------------------------------------------------*/ - + A = HYPRE_ParCSRMatrixRead(hypre_MPI_COMM_WORLD, filename); *A_ptr = A; @@ -969,7 +974,7 @@ BuildParLaplacian( HYPRE_Int argc, /*----------------------------------------------------------- * Set defaults *-----------------------------------------------------------*/ - + nx = 10; ny = 10; nz = 10; @@ -1019,7 +1024,7 @@ BuildParLaplacian( HYPRE_Int argc, * Check a few things *-----------------------------------------------------------*/ - if ((P*Q*R) != num_procs) + if ((P * Q * R) != num_procs) { hypre_printf("Error: Invalid number of processors or processor topology \n"); exit(1); @@ -1028,7 +1033,7 @@ BuildParLaplacian( HYPRE_Int argc, /*----------------------------------------------------------- * Print driver parameters *-----------------------------------------------------------*/ - + if (myid == 0) { hypre_printf(" Laplacian:\n"); @@ -1043,13 +1048,13 @@ BuildParLaplacian( HYPRE_Int argc, /* compute p,q,r from P,Q,R and myid */ p = myid % P; - q = (( myid - p)/P) % Q; - r = ( myid - p - P*q)/( P*Q ); + q = (( myid - p) / P) % Q; + r = ( myid - p - P * q) / ( P * Q ); /*----------------------------------------------------------- - * Generate the matrix + * Generate the matrix *-----------------------------------------------------------*/ - + values = hypre_CTAlloc(HYPRE_Real, 4, HYPRE_MEMORY_HOST); values[1] = -cx; @@ -1059,19 +1064,19 @@ BuildParLaplacian( HYPRE_Int argc, values[0] = 0.0; if (nx > 1) { - values[0] += 2.0*cx; + values[0] += 2.0 * cx; } if (ny > 1) { - values[0] += 2.0*cy; + values[0] += 2.0 * cy; } if (nz > 1) { - values[0] += 2.0*cz; + values[0] += 2.0 * cz; } - A = (HYPRE_ParCSRMatrix) - GenerateLaplacian(hypre_MPI_COMM_WORLD, nx, ny, nz, P, Q, R, p, q, r, values); + A = (HYPRE_ParCSRMatrix) + GenerateLaplacian(hypre_MPI_COMM_WORLD, nx, ny, nz, P, Q, R, p, q, r, values); hypre_TFree(values, HYPRE_MEMORY_HOST); @@ -1081,7 +1086,7 @@ BuildParLaplacian( HYPRE_Int argc, } /*---------------------------------------------------------------------- - * Build standard 7-point convection-diffusion operator + * Build standard 7-point convection-diffusion operator * Parameters given in command line. * Operator: * @@ -1099,7 +1104,7 @@ BuildParDifConv( HYPRE_Int argc, HYPRE_Int P, Q, R; HYPRE_Real cx, cy, cz; HYPRE_Real ax, ay, az; - HYPRE_Real hinx,hiny,hinz; + HYPRE_Real hinx, hiny, hinz; HYPRE_ParCSRMatrix A; @@ -1117,14 +1122,14 @@ BuildParDifConv( HYPRE_Int argc, /*----------------------------------------------------------- * Set defaults *-----------------------------------------------------------*/ - + nx = 10; ny = 10; nz = 10; - hinx = 1.0/(nx+1); - hiny = 1.0/(ny+1); - hinz = 1.0/(nz+1); + hinx = 1.0 / (nx + 1); + hiny = 1.0 / (ny + 1); + hinz = 1.0 / (nz + 1); P = 1; Q = num_procs; @@ -1182,7 +1187,7 @@ BuildParDifConv( HYPRE_Int argc, * Check a few things *-----------------------------------------------------------*/ - if ((P*Q*R) != num_procs) + if ((P * Q * R) != num_procs) { hypre_printf("Error: Invalid number of processors or processor topology \n"); exit(1); @@ -1191,11 +1196,11 @@ BuildParDifConv( HYPRE_Int argc, /*----------------------------------------------------------- * Print driver parameters *-----------------------------------------------------------*/ - + if (myid == 0) { hypre_printf(" Convection-Diffusion: \n"); - hypre_printf(" -cx Dxx - cy Dyy - cz Dzz + ax Dx + ay Dy + az Dz = f\n"); + hypre_printf(" -cx Dxx - cy Dyy - cz Dzz + ax Dx + ay Dy + az Dz = f\n"); hypre_printf(" (nx, ny, nz) = (%d, %d, %d)\n", nx, ny, nz); hypre_printf(" (Px, Py, Pz) = (%d, %d, %d)\n", P, Q, R); hypre_printf(" (cx, cy, cz) = (%f, %f, %f)\n", cx, cy, cz); @@ -1208,38 +1213,38 @@ BuildParDifConv( HYPRE_Int argc, /* compute p,q,r from P,Q,R and myid */ p = myid % P; - q = (( myid - p)/P) % Q; - r = ( myid - p - P*q)/( P*Q ); + q = (( myid - p) / P) % Q; + r = ( myid - p - P * q) / ( P * Q ); /*----------------------------------------------------------- - * Generate the matrix + * Generate the matrix *-----------------------------------------------------------*/ - + values = hypre_CTAlloc(HYPRE_Real, 7, HYPRE_MEMORY_HOST); - values[1] = -cx/(hinx*hinx); - values[2] = -cy/(hiny*hiny); - values[3] = -cz/(hinz*hinz); - values[4] = -cx/(hinx*hinx) + ax/hinx; - values[5] = -cy/(hiny*hiny) + ay/hiny; - values[6] = -cz/(hinz*hinz) + az/hinz; + values[1] = -cx / (hinx * hinx); + values[2] = -cy / (hiny * hiny); + values[3] = -cz / (hinz * hinz); + values[4] = -cx / (hinx * hinx) + ax / hinx; + values[5] = -cy / (hiny * hiny) + ay / hiny; + values[6] = -cz / (hinz * hinz) + az / hinz; values[0] = 0.0; if (nx > 1) { - values[0] += 2.0*cx/(hinx*hinx) - 1.0*ax/hinx; + values[0] += 2.0 * cx / (hinx * hinx) - 1.0 * ax / hinx; } if (ny > 1) { - values[0] += 2.0*cy/(hiny*hiny) - 1.0*ay/hiny; + values[0] += 2.0 * cy / (hiny * hiny) - 1.0 * ay / hiny; } if (nz > 1) { - values[0] += 2.0*cz/(hinz*hinz) - 1.0*az/hinz; + values[0] += 2.0 * cz / (hinz * hinz) - 1.0 * az / hinz; } A = (HYPRE_ParCSRMatrix) GenerateDifConv(hypre_MPI_COMM_WORLD, - nx, ny, nz, P, Q, R, p, q, r, values); + nx, ny, nz, P, Q, R, p, q, r, values); hypre_TFree(values, HYPRE_MEMORY_HOST); @@ -1291,15 +1296,15 @@ BuildParFromOneFile( HYPRE_Int argc, /*----------------------------------------------------------- * Print driver parameters *-----------------------------------------------------------*/ - + if (myid == 0) { hypre_printf(" FromFile: %s\n", filename); /*----------------------------------------------------------- - * Generate the matrix + * Generate the matrix *-----------------------------------------------------------*/ - + A_CSR = HYPRE_CSRMatrixRead(filename); } A = HYPRE_CSRMatrixToParCSRMatrix(hypre_MPI_COMM_WORLD, A_CSR, NULL, NULL); @@ -1312,7 +1317,7 @@ BuildParFromOneFile( HYPRE_Int argc, } /*---------------------------------------------------------------------- - * Build Rhs from one file on Proc. 0. Distributes vector across processors + * Build Rhs from one file on Proc. 0. Distributes vector across processors * giving each about using the distribution of the matrix A. *----------------------------------------------------------------------*/ @@ -1329,7 +1334,7 @@ BuildRhsParFromOneFile( HYPRE_Int argc, HYPRE_Vector b_CSR; HYPRE_Int myid; - HYPRE_Int *partitioning; + HYPRE_Int *partitioning; /*----------------------------------------------------------- * Initialize some stuff @@ -1354,15 +1359,15 @@ BuildRhsParFromOneFile( HYPRE_Int argc, /*----------------------------------------------------------- * Print driver parameters *-----------------------------------------------------------*/ - + if (myid == 0) { hypre_printf(" Rhs FromFile: %s\n", filename); /*----------------------------------------------------------- - * Generate the matrix + * Generate the matrix *-----------------------------------------------------------*/ - + b_CSR = HYPRE_VectorRead(filename); } HYPRE_ParCSRMatrixGetRowPartitioning(A, &partitioning); @@ -1405,7 +1410,7 @@ BuildParLaplacian9pt( HYPRE_Int argc, /*----------------------------------------------------------- * Set defaults *-----------------------------------------------------------*/ - + nx = 10; ny = 10; @@ -1440,7 +1445,7 @@ BuildParLaplacian9pt( HYPRE_Int argc, * Check a few things *-----------------------------------------------------------*/ - if ((P*Q) != num_procs) + if ((P * Q) != num_procs) { hypre_printf("Error: Invalid number of processors or processor topology \n"); exit(1); @@ -1449,7 +1454,7 @@ BuildParLaplacian9pt( HYPRE_Int argc, /*----------------------------------------------------------- * Print driver parameters *-----------------------------------------------------------*/ - + if (myid == 0) { hypre_printf(" Laplacian 9pt:\n"); @@ -1463,12 +1468,12 @@ BuildParLaplacian9pt( HYPRE_Int argc, /* compute p,q from P,Q and myid */ p = myid % P; - q = ( myid - p)/P; + q = ( myid - p) / P; /*----------------------------------------------------------- - * Generate the matrix + * Generate the matrix *-----------------------------------------------------------*/ - + values = hypre_CTAlloc(HYPRE_Real, 2, HYPRE_MEMORY_HOST); values[1] = -1.0; @@ -1488,7 +1493,7 @@ BuildParLaplacian9pt( HYPRE_Int argc, } A = (HYPRE_ParCSRMatrix) GenerateLaplacian9pt(hypre_MPI_COMM_WORLD, - nx, ny, P, Q, p, q, values); + nx, ny, P, Q, p, q, values); hypre_TFree(values, HYPRE_MEMORY_HOST); @@ -1497,7 +1502,7 @@ BuildParLaplacian9pt( HYPRE_Int argc, return (0); } /*---------------------------------------------------------------------- - * Build 27-point laplacian in 3D, + * Build 27-point laplacian in 3D, * Parameters given in command line. *----------------------------------------------------------------------*/ @@ -1526,7 +1531,7 @@ BuildParLaplacian27pt( HYPRE_Int argc, /*----------------------------------------------------------- * Set defaults *-----------------------------------------------------------*/ - + nx = 10; ny = 10; nz = 10; @@ -1565,7 +1570,7 @@ BuildParLaplacian27pt( HYPRE_Int argc, * Check a few things *-----------------------------------------------------------*/ - if ((P*Q*R) != num_procs) + if ((P * Q * R) != num_procs) { hypre_printf("Error: Invalid number of processors or processor topology \n"); exit(1); @@ -1574,7 +1579,7 @@ BuildParLaplacian27pt( HYPRE_Int argc, /*----------------------------------------------------------- * Print driver parameters *-----------------------------------------------------------*/ - + if (myid == 0) { hypre_printf(" Laplacian_27pt:\n"); @@ -1588,24 +1593,28 @@ BuildParLaplacian27pt( HYPRE_Int argc, /* compute p,q,r from P,Q,R and myid */ p = myid % P; - q = (( myid - p)/P) % Q; - r = ( myid - p - P*q)/( P*Q ); + q = (( myid - p) / P) % Q; + r = ( myid - p - P * q) / ( P * Q ); /*----------------------------------------------------------- - * Generate the matrix + * Generate the matrix *-----------------------------------------------------------*/ - + values = hypre_CTAlloc(HYPRE_Real, 2, HYPRE_MEMORY_HOST); values[0] = 26.0; if (nx == 1 || ny == 1 || nz == 1) - values[0] = 8.0; - if (nx*ny == 1 || nx*nz == 1 || ny*nz == 1) - values[0] = 2.0; + { + values[0] = 8.0; + } + if (nx * ny == 1 || nx * nz == 1 || ny * nz == 1) + { + values[0] = 2.0; + } values[1] = -1.0; A = (HYPRE_ParCSRMatrix) GenerateLaplacian27pt(hypre_MPI_COMM_WORLD, - nx, ny, nz, P, Q, R, p, q, r, values); + nx, ny, nz, P, Q, R, p, q, r, values); hypre_TFree(values, HYPRE_MEMORY_HOST); diff --git a/external/hypre/src/parcsr_ls/dsuperlu.c b/external/hypre/src/parcsr_ls/dsuperlu.c index 535fe330..3e044aec 100644 --- a/external/hypre/src/parcsr_ls/dsuperlu.c +++ b/external/hypre/src/parcsr_ls/dsuperlu.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -33,72 +33,135 @@ hypre_DSLUData; #endif */ -HYPRE_Int hypre_SLUDistSetup( HYPRE_Solver *solver, hypre_ParCSRMatrix *A, HYPRE_Int print_level) + +/*-------------------------------------------------------------------------- + * hypre_SLUDistSetup + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SLUDistSetup(HYPRE_Solver *solver, + hypre_ParCSRMatrix *A, + HYPRE_Int print_level) { - /* Par Data Structure variables */ - HYPRE_BigInt global_num_rows = hypre_ParCSRMatrixGlobalNumRows(A); - MPI_Comm comm = hypre_ParCSRMatrixComm(A); - hypre_CSRMatrix *A_local; - HYPRE_Int num_rows; - HYPRE_Int num_procs, my_id; - HYPRE_Int pcols=1, prows=1; - HYPRE_BigInt *big_rowptr = NULL; - hypre_DSLUData *dslu_data = NULL; - - HYPRE_Int info = 0; - HYPRE_Int nrhs = 0; + /* Par Data Structure variables */ + HYPRE_BigInt global_num_rows = hypre_ParCSRMatrixGlobalNumRows(A); + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + hypre_CSRMatrix *A_local; + + HYPRE_Int pcols = 1; + HYPRE_Int prows = 1; + hypre_DSLUData *dslu_data = NULL; + HYPRE_Int nrhs = 0; + + HYPRE_Int num_rows; + HYPRE_Int num_procs, my_id; + HYPRE_Int i; + + /* SuperLU_Dist variables. Note it uses "int_t" to denote integer types */ + hypre_int slu_info = 0; + int_t *slu_rowptr; + int_t *slu_colidx; + hypre_double *slu_data; hypre_MPI_Comm_size(comm, &num_procs); hypre_MPI_Comm_rank(comm, &my_id); + /* destroy solver if already setup */ + // if (solver != NULL) { hypre_SLUDistDestroy(solver); } + /* allocate memory for new solver */ dslu_data = hypre_CTAlloc(hypre_DSLUData, 1, HYPRE_MEMORY_HOST); /* Merge diag and offd into one matrix (global ids) */ A_local = hypre_MergeDiagAndOffd(A); +#if defined(HYPRE_USING_GPU) + if (hypre_GetActualMemLocation(hypre_CSRMatrixMemoryLocation(A_local)) != hypre_MEMORY_HOST) + { + hypre_CSRMatrixMigrate(A_local, HYPRE_MEMORY_HOST); + } +#endif num_rows = hypre_CSRMatrixNumRows(A_local); - /* Now convert hypre matrix to a SuperMatrix */ -#ifdef HYPRE_MIXEDINT + + /* SuperLU uses int_t to denote its integer type. Hence, the conversion/checks below: */ + if (sizeof(int_t) != sizeof(HYPRE_Int)) { - HYPRE_Int *rowptr = NULL; - HYPRE_Int i; - rowptr = hypre_CSRMatrixI(A_local); - big_rowptr = hypre_CTAlloc(HYPRE_BigInt, (num_rows+1), HYPRE_MEMORY_HOST); - for(i=0; i<(num_rows+1); i++) + slu_rowptr = hypre_CTAlloc(int_t, (num_rows + 1), hypre_CSRMatrixMemoryLocation(A_local)); + for (i = 0; i < num_rows + 1; i++) { - big_rowptr[i] = (HYPRE_BigInt)rowptr[i]; + slu_rowptr[i] = (int_t) hypre_CSRMatrixI(A_local)[i]; } } -#else - big_rowptr = hypre_CSRMatrixI(A_local); -#endif + else + { + slu_rowptr = (int_t*) hypre_CSRMatrixI(A_local); + } + + if (sizeof(int_t) != sizeof(HYPRE_BigInt)) + { + slu_colidx = hypre_CTAlloc(int_t, hypre_CSRMatrixNumNonzeros(A_local), + hypre_CSRMatrixMemoryLocation(A_local)); + for (i = 0; i < hypre_CSRMatrixNumNonzeros(A_local); i++) + { + slu_colidx[i] = (int_t) hypre_CSRMatrixBigJ(A_local)[i]; + } + } + else + { + slu_colidx = (int_t*) hypre_CSRMatrixBigJ(A_local); + } + + /* SuperLU uses dbl to denote its floating point type. Hence, the conversion/checks below: */ + if (sizeof(hypre_double) != sizeof(HYPRE_Complex)) + { + slu_data = hypre_CTAlloc(hypre_double, hypre_CSRMatrixNumNonzeros(A_local), + hypre_CSRMatrixMemoryLocation(A_local)); + for (i = 0; i < hypre_CSRMatrixNumNonzeros(A_local); i++) + { + slu_data[i] = (hypre_double) hypre_CSRMatrixData(A_local)[i]; + } + } + else + { + slu_data = (hypre_double*) hypre_CSRMatrixData(A_local); + } + + /* Now convert hypre matrix to a SuperMatrix */ dCreate_CompRowLoc_Matrix_dist( - &(dslu_data->A_dslu),global_num_rows,global_num_rows, - hypre_CSRMatrixNumNonzeros(A_local), - num_rows, - hypre_ParCSRMatrixFirstRowIndex(A), - hypre_CSRMatrixData(A_local), - hypre_CSRMatrixBigJ(A_local),big_rowptr, - SLU_NR_loc, SLU_D, SLU_GE); + &(dslu_data->A_dslu), + (int_t) global_num_rows, + (int_t) global_num_rows, + (int_t) hypre_CSRMatrixNumNonzeros(A_local), + (int_t) num_rows, + (int_t) hypre_ParCSRMatrixFirstRowIndex(A), + slu_data, + slu_colidx, + slu_rowptr, + SLU_NR_loc, SLU_D, SLU_GE); /* DOK: SuperLU frees assigned data, so set them to null before - * calling hypre_CSRMatrixdestroy on A_local to avoid memory errors. - */ -#ifndef HYPRE_MIXEDINT - hypre_CSRMatrixI(A_local) = NULL; -#endif - hypre_CSRMatrixData(A_local) = NULL; - hypre_CSRMatrixBigJ(A_local) = NULL; + calling hypre_CSRMatrixdestroy on A_local to avoid memory errors. */ + if ((void*) slu_rowptr == (void*) hypre_CSRMatrixI(A_local)) + { + hypre_CSRMatrixI(A_local) = NULL; + } + if ((void*) slu_colidx == (void*) hypre_CSRMatrixBigJ(A_local)) + { + hypre_CSRMatrixBigJ(A_local) = NULL; + } + if ((void*) slu_data == (void*) hypre_CSRMatrixData(A_local)) + { + hypre_CSRMatrixData(A_local) = NULL; + } hypre_CSRMatrixDestroy(A_local); - /*Create process grid */ - while (prows*pcols <= num_procs) ++prows; + /* Create process grid */ + while (prows * pcols <= num_procs) { ++prows; } --prows; - pcols = num_procs/prows; - while (prows*pcols != num_procs) + pcols = num_procs / prows; + while (prows * pcols != num_procs) { prows -= 1; - pcols = num_procs/prows; + pcols = num_procs / prows; } //hypre_printf(" prows %d pcols %d\n", prows, pcols); @@ -107,7 +170,7 @@ HYPRE_Int hypre_SLUDistSetup( HYPRE_Solver *solver, hypre_ParCSRMatrix *A, HYPRE set_default_options_dist(&(dslu_data->dslu_options)); dslu_data->dslu_options.Fact = DOFACT; - if (print_level == 0 || print_level == 2) dslu_data->dslu_options.PrintStat = NO; + if (print_level == 0 || print_level == 2) { dslu_data->dslu_options.PrintStat = NO; } /*dslu_data->dslu_options.IterRefine = SLU_DOUBLE; dslu_data->dslu_options.ColPerm = MMD_AT_PLUS_A; dslu_data->dslu_options.DiagPivotThresh = 1.0; @@ -125,47 +188,119 @@ HYPRE_Int hypre_SLUDistSetup( HYPRE_Solver *solver, hypre_ParCSRMatrix *A, HYPRE dslu_data->berr[0] = 0.0; pdgssvx(&(dslu_data->dslu_options), &(dslu_data->A_dslu), - &(dslu_data->dslu_ScalePermstruct), NULL, num_rows, nrhs, - &(dslu_data->dslu_data_grid), &(dslu_data->dslu_data_LU), - &(dslu_data->dslu_solve), dslu_data->berr, &(dslu_data->dslu_data_stat), &info); + &(dslu_data->dslu_ScalePermstruct), NULL, num_rows, nrhs, + &(dslu_data->dslu_data_grid), &(dslu_data->dslu_data_LU), + &(dslu_data->dslu_solve), dslu_data->berr, &(dslu_data->dslu_data_stat), &slu_info); dslu_data->dslu_options.Fact = FACTORED; *solver = (HYPRE_Solver) dslu_data; + return hypre_error_flag; } -HYPRE_Int hypre_SLUDistSolve( void* solver, hypre_ParVector *b, hypre_ParVector *x) +/*-------------------------------------------------------------------------- + * hypre_SLUDistSolve + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SLUDistSolve(void *solver, + hypre_ParVector *b, + hypre_ParVector *x) { - hypre_DSLUData *dslu_data = (hypre_DSLUData *) solver; - HYPRE_Int info = 0; - HYPRE_Real *B = hypre_VectorData(hypre_ParVectorLocalVector(x)); - HYPRE_Int size = hypre_VectorSize(hypre_ParVectorLocalVector(x)); - HYPRE_Int nrhs = 1; + hypre_DSLUData *dslu_data = (hypre_DSLUData *) solver; + HYPRE_Real *x_data; + HYPRE_Int size = hypre_VectorSize(hypre_ParVectorLocalVector(x)); + HYPRE_Int nrhs = 1; + HYPRE_Int i; - hypre_ParVectorCopy(b,x); + hypre_int slu_info; + hypre_double *slu_data; - pdgssvx(&(dslu_data->dslu_options), &(dslu_data->A_dslu), - &(dslu_data->dslu_ScalePermstruct), B, size, nrhs, - &(dslu_data->dslu_data_grid), &(dslu_data->dslu_data_LU), - &(dslu_data->dslu_solve), dslu_data->berr, &(dslu_data->dslu_data_stat), &info); + hypre_ParVectorCopy(b, x); + +#if defined(HYPRE_USING_GPU) + hypre_ParVector *x_host = NULL; + + if (hypre_GetActualMemLocation(hypre_ParVectorMemoryLocation(x)) != hypre_MEMORY_HOST) + { + x_host = hypre_ParVectorCloneDeep_v2(x, HYPRE_MEMORY_HOST); + x_data = hypre_VectorData(hypre_ParVectorLocalVector(x_host)); + } + else +#endif + { + x_data = hypre_VectorData(hypre_ParVectorLocalVector(x)); + } + + /* SuperLU uses sbl to denote its floating point type. Hence, the conversion/checks below: */ + if (sizeof(hypre_double) != sizeof(HYPRE_Complex)) + { + slu_data = hypre_CTAlloc(hypre_double, size, HYPRE_MEMORY_HOST); + for (i = 0; i < size; i++) + { + slu_data[i] = (hypre_double) x_data[i]; + } + } + else + { + slu_data = (hypre_double*) x_data; + } + + pdgssvx(&(dslu_data->dslu_options), + &(dslu_data->A_dslu), + &(dslu_data->dslu_ScalePermstruct), + slu_data, + (int_t) size, + (int_t) nrhs, + &(dslu_data->dslu_data_grid), + &(dslu_data->dslu_data_LU), + &(dslu_data->dslu_solve), + dslu_data->berr, + &(dslu_data->dslu_data_stat), + &slu_info); + + /* Free memory */ + if ((void*) slu_data != (void*) x_data) + { + hypre_TFree(slu_data, HYPRE_MEMORY_HOST); + } + +#if defined(HYPRE_USING_GPU) + if (x_host) + { + hypre_ParVectorCopy(x_host, x); + hypre_ParVectorDestroy(x_host); + } +#endif return hypre_error_flag; } -HYPRE_Int hypre_SLUDistDestroy( void* solver) +/*-------------------------------------------------------------------------- + * hypre_SLUDistDestroy + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SLUDistDestroy(void* solver) { hypre_DSLUData *dslu_data = (hypre_DSLUData *) solver; PStatFree(&(dslu_data->dslu_data_stat)); Destroy_CompRowLoc_Matrix_dist(&(dslu_data->A_dslu)); dScalePermstructFree(&(dslu_data->dslu_ScalePermstruct)); - dDestroy_LU(dslu_data->global_num_rows, &(dslu_data->dslu_data_grid), &(dslu_data->dslu_data_LU)); + dDestroy_LU(dslu_data->global_num_rows, + &(dslu_data->dslu_data_grid), + &(dslu_data->dslu_data_LU)); dLUstructFree(&(dslu_data->dslu_data_LU)); if (dslu_data->dslu_options.SolveInitialized) + { dSolveFinalize(&(dslu_data->dslu_options), &(dslu_data->dslu_solve)); + } superlu_gridexit(&(dslu_data->dslu_data_grid)); hypre_TFree(dslu_data->berr, HYPRE_MEMORY_HOST); hypre_TFree(dslu_data, HYPRE_MEMORY_HOST); + return hypre_error_flag; } + #endif diff --git a/external/hypre/src/parcsr_ls/dsuperlu.h b/external/hypre/src/parcsr_ls/dsuperlu.h index 4f2e40c2..74781b39 100644 --- a/external/hypre/src/parcsr_ls/dsuperlu.h +++ b/external/hypre/src/parcsr_ls/dsuperlu.h @@ -1,28 +1,30 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ - + #ifndef hypre_DSLU_DATA_HEADER #define hypre_DSLU_DATA_HEADER #include "superlu_ddefs.h" + /*-------------------------------------------------------------------------- * hypre_DSLUData *--------------------------------------------------------------------------*/ + typedef struct { - HYPRE_BigInt global_num_rows; - SuperMatrix A_dslu; - HYPRE_Real *berr; - dLUstruct_t dslu_data_LU; - SuperLUStat_t dslu_data_stat; - superlu_dist_options_t dslu_options; - gridinfo_t dslu_data_grid; - dScalePermstruct_t dslu_ScalePermstruct; - dSOLVEstruct_t dslu_solve; + HYPRE_BigInt global_num_rows; + SuperMatrix A_dslu; + hypre_double *berr; + dLUstruct_t dslu_data_LU; + SuperLUStat_t dslu_data_stat; + superlu_dist_options_t dslu_options; + gridinfo_t dslu_data_grid; + dScalePermstruct_t dslu_ScalePermstruct; + dSOLVEstruct_t dslu_solve; } hypre_DSLUData; diff --git a/external/hypre/src/parcsr_ls/gen_redcs_mat.c b/external/hypre/src/parcsr_ls/gen_redcs_mat.c index 3218f085..a8189028 100644 --- a/external/hypre/src/parcsr_ls/gen_redcs_mat.c +++ b/external/hypre/src/parcsr_ls/gen_redcs_mat.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -19,6 +19,7 @@ hypre_seqAMGSetup( hypre_ParAMGData *amg_data, HYPRE_Int p_level, HYPRE_Int coarse_threshold) { + HYPRE_UNUSED_VAR(coarse_threshold); /* Par Data Structure variables */ hypre_ParCSRMatrix **Par_A_array = hypre_ParAMGDataAArray(amg_data); @@ -57,6 +58,8 @@ hypre_seqAMGSetup( hypre_ParAMGData *amg_data, /* convert A at this level to sequential */ A = Par_A_array[level]; + HYPRE_MemoryLocation memory_location = hypre_ParCSRMatrixMemoryLocation(A); + { HYPRE_Real *A_seq_data = NULL; HYPRE_Int *A_seq_i = NULL; @@ -71,7 +74,7 @@ hypre_seqAMGSetup( hypre_ParAMGData *amg_data, HYPRE_Int *info = NULL; HYPRE_Int *displs = NULL; HYPRE_Int *displs2 = NULL; - HYPRE_Int i, j, size, num_nonzeros, total_nnz, cnt; + HYPRE_Int i, j, size, num_nonzeros, total_nnz = 0, cnt; hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); @@ -121,90 +124,98 @@ hypre_seqAMGSetup( hypre_ParAMGData *amg_data, info = hypre_CTAlloc(HYPRE_Int, new_num_procs, HYPRE_MEMORY_HOST); if (redundant) + { hypre_MPI_Allgather(&num_rows, 1, HYPRE_MPI_INT, info, 1, HYPRE_MPI_INT, new_comm); + } else + { hypre_MPI_Gather(&num_rows, 1, HYPRE_MPI_INT, info, 1, HYPRE_MPI_INT, 0, new_comm); + } /* alloc space in seq data structure only for participating procs*/ if (redundant || my_id == 0) { HYPRE_BoomerAMGCreate(&coarse_solver); HYPRE_BoomerAMGSetMaxRowSum(coarse_solver, - hypre_ParAMGDataMaxRowSum(amg_data)); + hypre_ParAMGDataMaxRowSum(amg_data)); HYPRE_BoomerAMGSetStrongThreshold(coarse_solver, - hypre_ParAMGDataStrongThreshold(amg_data)); + hypre_ParAMGDataStrongThreshold(amg_data)); HYPRE_BoomerAMGSetCoarsenType(coarse_solver, - hypre_ParAMGDataCoarsenType(amg_data)); + hypre_ParAMGDataCoarsenType(amg_data)); HYPRE_BoomerAMGSetInterpType(coarse_solver, - hypre_ParAMGDataInterpType(amg_data)); + hypre_ParAMGDataInterpType(amg_data)); HYPRE_BoomerAMGSetTruncFactor(coarse_solver, - hypre_ParAMGDataTruncFactor(amg_data)); + hypre_ParAMGDataTruncFactor(amg_data)); HYPRE_BoomerAMGSetPMaxElmts(coarse_solver, - hypre_ParAMGDataPMaxElmts(amg_data)); + hypre_ParAMGDataPMaxElmts(amg_data)); if (hypre_ParAMGDataUserRelaxType(amg_data) > -1) HYPRE_BoomerAMGSetRelaxType(coarse_solver, - hypre_ParAMGDataUserRelaxType(amg_data)); + hypre_ParAMGDataUserRelaxType(amg_data)); HYPRE_BoomerAMGSetRelaxOrder(coarse_solver, - hypre_ParAMGDataRelaxOrder(amg_data)); + hypre_ParAMGDataRelaxOrder(amg_data)); HYPRE_BoomerAMGSetRelaxWt(coarse_solver, - hypre_ParAMGDataUserRelaxWeight(amg_data)); + hypre_ParAMGDataUserRelaxWeight(amg_data)); if (hypre_ParAMGDataUserNumSweeps(amg_data) > -1) HYPRE_BoomerAMGSetNumSweeps(coarse_solver, - hypre_ParAMGDataUserNumSweeps(amg_data)); + hypre_ParAMGDataUserNumSweeps(amg_data)); HYPRE_BoomerAMGSetNumFunctions(coarse_solver, - num_functions); + num_functions); HYPRE_BoomerAMGSetMaxIter(coarse_solver, 1); HYPRE_BoomerAMGSetTol(coarse_solver, 0); } /* Create CSR Matrix, will be Diag part of new matrix */ - A_tmp_i = hypre_CTAlloc(HYPRE_Int, num_rows+1, HYPRE_MEMORY_HOST); + A_tmp_i = hypre_CTAlloc(HYPRE_Int, num_rows + 1, HYPRE_MEMORY_HOST); A_tmp_i[0] = 0; - for (i=1; i < num_rows+1; i++) - A_tmp_i[i] = A_diag_i[i]-A_diag_i[i-1]+A_offd_i[i]-A_offd_i[i-1]; + for (i = 1; i < num_rows + 1; i++) + { + A_tmp_i[i] = A_diag_i[i] - A_diag_i[i - 1] + A_offd_i[i] - A_offd_i[i - 1]; + } - num_nonzeros = A_offd_i[num_rows]+A_diag_i[num_rows]; + num_nonzeros = A_offd_i[num_rows] + A_diag_i[num_rows]; A_tmp_j = hypre_CTAlloc(HYPRE_Int, num_nonzeros, HYPRE_MEMORY_HOST); A_tmp_data = hypre_CTAlloc(HYPRE_Real, num_nonzeros, HYPRE_MEMORY_HOST); cnt = 0; - for (i=0; i < num_rows; i++) + for (i = 0; i < num_rows; i++) { - for (j=A_diag_i[i]; j < A_diag_i[i+1]; j++) + for (j = A_diag_i[i]; j < A_diag_i[i + 1]; j++) { - A_tmp_j[cnt] = A_diag_j[j]+(HYPRE_Int)first_row_index; + A_tmp_j[cnt] = A_diag_j[j] + (HYPRE_Int)first_row_index; A_tmp_data[cnt++] = A_diag_data[j]; } - for (j=A_offd_i[i]; j < A_offd_i[i+1]; j++) + for (j = A_offd_i[i]; j < A_offd_i[i + 1]; j++) { A_tmp_j[cnt] = (HYPRE_Int)col_map_offd[A_offd_j[j]]; A_tmp_data[cnt++] = A_offd_data[j]; } } - displs = hypre_CTAlloc(HYPRE_Int, new_num_procs+1, HYPRE_MEMORY_HOST); + displs = hypre_CTAlloc(HYPRE_Int, new_num_procs + 1, HYPRE_MEMORY_HOST); displs[0] = 0; - for (i=1; i < new_num_procs+1; i++) - displs[i] = displs[i-1]+info[i-1]; + for (i = 1; i < new_num_procs + 1; i++) + { + displs[i] = displs[i - 1] + info[i - 1]; + } size = displs[new_num_procs]; if (redundant || my_id == 0) { - A_seq_i = hypre_CTAlloc(HYPRE_Int, size+1, HYPRE_MEMORY_DEVICE); - A_seq_offd_i = hypre_CTAlloc(HYPRE_Int, size+1, HYPRE_MEMORY_DEVICE); - if (num_functions > 1) seq_dof_func = hypre_CTAlloc(HYPRE_Int, size, HYPRE_MEMORY_DEVICE); + A_seq_i = hypre_CTAlloc(HYPRE_Int, size + 1, memory_location); + A_seq_offd_i = hypre_CTAlloc(HYPRE_Int, size + 1, memory_location); + if (num_functions > 1) { seq_dof_func = hypre_CTAlloc(HYPRE_Int, size, memory_location); } } if (redundant) { hypre_MPI_Allgatherv ( &A_tmp_i[1], num_rows, HYPRE_MPI_INT, &A_seq_i[1], info, - displs, HYPRE_MPI_INT, new_comm ); + displs, HYPRE_MPI_INT, new_comm ); if (num_functions > 1) { hypre_MPI_Allgatherv ( hypre_IntArrayData(dof_func_array[level]), num_rows, HYPRE_MPI_INT, - seq_dof_func, info, displs, HYPRE_MPI_INT, new_comm ); + seq_dof_func, info, displs, HYPRE_MPI_INT, new_comm ); HYPRE_BoomerAMGSetDofFunc(coarse_solver, seq_dof_func); } } @@ -212,64 +223,66 @@ hypre_seqAMGSetup( hypre_ParAMGData *amg_data, { if (A_seq_i) hypre_MPI_Gatherv ( &A_tmp_i[1], num_rows, HYPRE_MPI_INT, &A_seq_i[1], info, - displs, HYPRE_MPI_INT, 0, new_comm ); + displs, HYPRE_MPI_INT, 0, new_comm ); else hypre_MPI_Gatherv ( &A_tmp_i[1], num_rows, HYPRE_MPI_INT, A_seq_i, info, - displs, HYPRE_MPI_INT, 0, new_comm ); + displs, HYPRE_MPI_INT, 0, new_comm ); if (num_functions > 1) { hypre_MPI_Gatherv ( hypre_IntArrayData(dof_func_array[level]), num_rows, HYPRE_MPI_INT, - seq_dof_func, info, displs, HYPRE_MPI_INT, 0, new_comm ); - if (my_id == 0) HYPRE_BoomerAMGSetDofFunc(coarse_solver, seq_dof_func); + seq_dof_func, info, displs, HYPRE_MPI_INT, 0, new_comm ); + if (my_id == 0) { HYPRE_BoomerAMGSetDofFunc(coarse_solver, seq_dof_func); } } } if (redundant || my_id == 0) { - displs2 = hypre_CTAlloc(HYPRE_Int, new_num_procs+1, HYPRE_MEMORY_HOST); + displs2 = hypre_CTAlloc(HYPRE_Int, new_num_procs + 1, HYPRE_MEMORY_HOST); A_seq_i[0] = 0; displs2[0] = 0; - for (j=1; j < displs[1]; j++) - A_seq_i[j] = A_seq_i[j]+A_seq_i[j-1]; - for (i=1; i < new_num_procs; i++) + for (j = 1; j < displs[1]; j++) + { + A_seq_i[j] = A_seq_i[j] + A_seq_i[j - 1]; + } + for (i = 1; i < new_num_procs; i++) { - for (j=displs[i]; j < displs[i+1]; j++) + for (j = displs[i]; j < displs[i + 1]; j++) { - A_seq_i[j] = A_seq_i[j]+A_seq_i[j-1]; + A_seq_i[j] = A_seq_i[j] + A_seq_i[j - 1]; } } - A_seq_i[size] = A_seq_i[size]+A_seq_i[size-1]; + A_seq_i[size] = A_seq_i[size] + A_seq_i[size - 1]; displs2[new_num_procs] = A_seq_i[size]; - for (i=1; i < new_num_procs+1; i++) + for (i = 1; i < new_num_procs + 1; i++) { displs2[i] = A_seq_i[displs[i]]; - info[i-1] = displs2[i] - displs2[i-1]; + info[i - 1] = displs2[i] - displs2[i - 1]; } total_nnz = displs2[new_num_procs]; - A_seq_j = hypre_CTAlloc(HYPRE_Int, total_nnz, HYPRE_MEMORY_DEVICE); - A_seq_data = hypre_CTAlloc(HYPRE_Real, total_nnz, HYPRE_MEMORY_DEVICE); + A_seq_j = hypre_CTAlloc(HYPRE_Int, total_nnz, memory_location); + A_seq_data = hypre_CTAlloc(HYPRE_Real, total_nnz, memory_location); } if (redundant) { hypre_MPI_Allgatherv ( A_tmp_j, num_nonzeros, HYPRE_MPI_INT, - A_seq_j, info, displs2, - HYPRE_MPI_INT, new_comm ); + A_seq_j, info, displs2, + HYPRE_MPI_INT, new_comm ); hypre_MPI_Allgatherv ( A_tmp_data, num_nonzeros, HYPRE_MPI_REAL, - A_seq_data, info, displs2, - HYPRE_MPI_REAL, new_comm ); + A_seq_data, info, displs2, + HYPRE_MPI_REAL, new_comm ); } else { hypre_MPI_Gatherv ( A_tmp_j, num_nonzeros, HYPRE_MPI_INT, - A_seq_j, info, displs2, - HYPRE_MPI_INT, 0, new_comm ); + A_seq_j, info, displs2, + HYPRE_MPI_INT, 0, new_comm ); hypre_MPI_Gatherv ( A_tmp_data, num_nonzeros, HYPRE_MPI_REAL, - A_seq_data, info, displs2, - HYPRE_MPI_REAL, 0, new_comm ); + A_seq_data, info, displs2, + HYPRE_MPI_REAL, 0, new_comm ); } hypre_TFree(info, HYPRE_MEMORY_HOST); @@ -288,9 +301,9 @@ hypre_seqAMGSetup( hypre_ParAMGData *amg_data, /* Create 1 proc communicator */ seq_comm = hypre_MPI_COMM_SELF; - A_seq = hypre_ParCSRMatrixCreate(seq_comm,size,size, - row_starts, row_starts, - 0,total_nnz,0); + A_seq = hypre_ParCSRMatrixCreate(seq_comm, size, size, + row_starts, row_starts, + 0, total_nnz, 0); A_seq_diag = hypre_ParCSRMatrixDiag(A_seq); A_seq_offd = hypre_ParCSRMatrixOffd(A_seq); @@ -305,7 +318,7 @@ hypre_seqAMGSetup( hypre_ParAMGData *amg_data, hypre_ParVectorInitialize(F_seq); hypre_ParVectorInitialize(U_seq); - hypre_BoomerAMGSetup(coarse_solver,A_seq,F_seq,U_seq); + hypre_BoomerAMGSetup(coarse_solver, A_seq, F_seq, U_seq); hypre_ParAMGDataCoarseSolver(amg_data) = coarse_solver; hypre_ParAMGDataACoarse(amg_data) = A_seq; @@ -386,16 +399,22 @@ hypre_seqAMGCycle( hypre_ParAMGData *amg_data, info = hypre_CTAlloc(HYPRE_Int, new_num_procs, HYPRE_MEMORY_HOST); local_info = nf; if (redundant) + { hypre_MPI_Allgather(&local_info, 1, HYPRE_MPI_INT, info, 1, HYPRE_MPI_INT, new_comm); + } else + { hypre_MPI_Gather(&local_info, 1, HYPRE_MPI_INT, info, 1, HYPRE_MPI_INT, 0, new_comm); + } - if (redundant || my_id ==0) + if (redundant || my_id == 0) { - displs = hypre_CTAlloc(HYPRE_Int, new_num_procs+1, HYPRE_MEMORY_HOST); + displs = hypre_CTAlloc(HYPRE_Int, new_num_procs + 1, HYPRE_MEMORY_HOST); displs[0] = 0; - for (i=1; i < new_num_procs+1; i++) - displs[i] = displs[i-1]+info[i-1]; + for (i = 1; i < new_num_procs + 1; i++) + { + displs[i] = displs[i - 1] + info[i - 1]; + } if (F_coarse) { @@ -406,14 +425,14 @@ hypre_seqAMGCycle( hypre_ParAMGData *amg_data, if (redundant) hypre_MPI_Allgatherv ( f_data, nf, HYPRE_MPI_REAL, - recv_buf, info, displs, - HYPRE_MPI_REAL, new_comm ); + recv_buf, info, displs, + HYPRE_MPI_REAL, new_comm ); else hypre_MPI_Gatherv ( f_data, nf, HYPRE_MPI_REAL, - recv_buf, info, displs, - HYPRE_MPI_REAL, 0, new_comm ); + recv_buf, info, displs, + HYPRE_MPI_REAL, 0, new_comm ); - if (redundant || my_id ==0) + if (redundant || my_id == 0) { tmp_vec = hypre_ParVectorLocalVector(U_coarse); recv_buf = hypre_VectorData(tmp_vec); @@ -423,18 +442,18 @@ hypre_seqAMGCycle( hypre_ParAMGData *amg_data, if (redundant) { hypre_MPI_Allgatherv ( u_data, n, HYPRE_MPI_REAL, - recv_buf, info, displs, - HYPRE_MPI_REAL, new_comm ); + recv_buf, info, displs, + HYPRE_MPI_REAL, new_comm ); hypre_TFree(displs, HYPRE_MEMORY_HOST); hypre_TFree(info, HYPRE_MEMORY_HOST); } else hypre_MPI_Gatherv ( u_data, n, HYPRE_MPI_REAL, - recv_buf, info, displs, - HYPRE_MPI_REAL, 0, new_comm ); + recv_buf, info, displs, + HYPRE_MPI_REAL, 0, new_comm ); /* clean up */ - if (redundant || my_id ==0) + if (redundant || my_id == 0) { hypre_BoomerAMGSolve(coarse_solver, A_coarse, F_coarse, U_coarse); } @@ -448,39 +467,48 @@ hypre_seqAMGCycle( hypre_ParAMGData *amg_data, for (i = 0; i < n; i++) { - u_data[i] = local_data[first_index+i]; + u_data[i] = local_data[first_index + i]; } } else { - HYPRE_Real *local_data=NULL; + HYPRE_Real *local_data = NULL; if (my_id == 0) + { local_data = hypre_VectorData(hypre_ParVectorLocalVector(U_coarse)); + } hypre_MPI_Scatterv ( local_data, info, displs, HYPRE_MPI_REAL, - u_data, n, HYPRE_MPI_REAL, 0, new_comm ); + u_data, n, HYPRE_MPI_REAL, 0, new_comm ); /*if (my_id == 0) local_data = hypre_VectorData(hypre_ParVectorLocalVector(F_coarse)); hypre_MPI_Scatterv ( local_data, info, displs, HYPRE_MPI_REAL, f_data, n, HYPRE_MPI_REAL, 0, new_comm );*/ - if (my_id == 0) hypre_TFree(displs, HYPRE_MEMORY_HOST); + if (my_id == 0) { hypre_TFree(displs, HYPRE_MEMORY_HOST); } hypre_TFree(info, HYPRE_MEMORY_HOST); } } - return(Solve_err_flag); + return (Solve_err_flag); } -/* generate sub communicator, which contains no idle processors */ +/*-------------------------------------------------------------------------- + * hypre_GenerateSubComm + * + * generate sub communicator, which contains no idle processors + *--------------------------------------------------------------------------*/ -HYPRE_Int hypre_GenerateSubComm(MPI_Comm comm, HYPRE_Int participate, MPI_Comm *new_comm_ptr) +HYPRE_Int +hypre_GenerateSubComm(MPI_Comm comm, + HYPRE_Int participate, + MPI_Comm *new_comm_ptr) { - MPI_Comm new_comm; - hypre_MPI_Group orig_group, new_group; - hypre_MPI_Op hypre_MPI_MERGE; - HYPRE_Int *info, *ranks, new_num_procs, my_info, my_id, num_procs; - HYPRE_Int *list_len; + MPI_Comm new_comm; + hypre_MPI_Group orig_group, new_group; + hypre_MPI_Op hypre_MPI_MERGE; + HYPRE_Int *info, *ranks, new_num_procs, my_info, my_id, num_procs; + HYPRE_Int *list_len; hypre_MPI_Comm_rank(comm, &my_id); @@ -499,10 +527,11 @@ HYPRE_Int hypre_GenerateSubComm(MPI_Comm comm, HYPRE_Int participate, MPI_Comm * { new_comm = hypre_MPI_COMM_NULL; *new_comm_ptr = new_comm; - return 0; + + return hypre_error_flag; } - ranks = hypre_CTAlloc(HYPRE_Int, new_num_procs+2, HYPRE_MEMORY_HOST); + ranks = hypre_CTAlloc(HYPRE_Int, new_num_procs + 2, HYPRE_MEMORY_HOST); if (new_num_procs == 1) { @@ -514,7 +543,7 @@ HYPRE_Int hypre_GenerateSubComm(MPI_Comm comm, HYPRE_Int participate, MPI_Comm * } else { - info = hypre_CTAlloc(HYPRE_Int, new_num_procs+2, HYPRE_MEMORY_HOST); + info = hypre_CTAlloc(HYPRE_Int, new_num_procs + 2, HYPRE_MEMORY_HOST); list_len = hypre_CTAlloc(HYPRE_Int, 1, HYPRE_MEMORY_HOST); if (participate) @@ -551,12 +580,21 @@ HYPRE_Int hypre_GenerateSubComm(MPI_Comm comm, HYPRE_Int participate, MPI_Comm * *new_comm_ptr = new_comm; - return 0; + return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_merge_lists + *--------------------------------------------------------------------------*/ -void hypre_merge_lists (HYPRE_Int *list1, HYPRE_Int* list2, hypre_int *np1, hypre_MPI_Datatype *dptr) +void +hypre_merge_lists(HYPRE_Int *list1, + HYPRE_Int *list2, + hypre_int *np1, + hypre_MPI_Datatype *dptr) { + HYPRE_UNUSED_VAR(dptr); + HYPRE_Int i, len1, len2, indx1, indx2; if (list1[0] == 0) @@ -568,14 +606,14 @@ void hypre_merge_lists (HYPRE_Int *list1, HYPRE_Int* list2, hypre_int *np1, hypr list2[0] = 1; len1 = list1[1]; len2 = list2[1]; - list2[1] = len1+len2; - if ((hypre_int)(list2[1]) > *np1+2) // RL:??? + list2[1] = len1 + len2; + if ((hypre_int)(list2[1]) > *np1 + 2) // RL:??? { printf("segfault in MPI User function merge_list\n"); } - indx1 = len1+1; - indx2 = len2+1; - for (i=len1+len2+1; i > 1; i--) + indx1 = len1 + 1; + indx2 = len2 + 1; + for (i = len1 + len2 + 1; i > 1; i--) { if (indx2 > 1 && indx1 > 1 && list1[indx1] > list2[indx2]) { diff --git a/external/hypre/src/parcsr_ls/headers b/external/hypre/src/parcsr_ls/headers old mode 100644 new mode 100755 index 29309e5a..4c7a5dc7 --- a/external/hypre/src/parcsr_ls/headers +++ b/external/hypre/src/parcsr_ls/headers @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -34,6 +34,9 @@ typedef struct { HYPRE_Int prev; HYPRE_Int next; } Link; cat par_amg.h >> $INTERNAL_HEADER cat par_amgdd_comp_grid.h >> $INTERNAL_HEADER cat par_amgdd.h >> $INTERNAL_HEADER +cat par_fsai.h >> $INTERNAL_HEADER +cat ams.h >> $INTERNAL_HEADER +cat par_ilu.h >> $INTERNAL_HEADER cat protos.h >> $INTERNAL_HEADER #=========================================================================== @@ -55,4 +58,3 @@ cat >> $INTERNAL_HEADER <<@ #endif @ - diff --git a/external/hypre/src/parcsr_ls/par_2s_interp.c b/external/hypre/src/parcsr_ls/par_2s_interp.c index ec4f703a..05594b70 100644 --- a/external/hypre/src/parcsr_ls/par_2s_interp.c +++ b/external/hypre/src/parcsr_ls/par_2s_interp.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -24,6 +24,10 @@ hypre_BoomerAMGBuildModPartialExtInterpHost( hypre_ParCSRMatrix *A, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ) { + HYPRE_UNUSED_VAR(num_functions); + HYPRE_UNUSED_VAR(dof_func); + HYPRE_UNUSED_VAR(debug_flag); + /* Communication Variables */ MPI_Comm comm = hypre_ParCSRMatrixComm(A); HYPRE_MemoryLocation memory_location_P = hypre_ParCSRMatrixMemoryLocation(A); @@ -125,14 +129,14 @@ hypre_BoomerAMGBuildModPartialExtInterpHost( hypre_ParCSRMatrix *A, /* BEGIN */ hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_rank(comm, &my_id); - if (my_id == (num_procs -1)) total_global_cpts = num_cpts_global[1]; - if (my_id == (num_procs -1)) total_old_global_cpts = num_old_cpts_global[1]; - hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); - hypre_MPI_Bcast(&total_old_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); - n_Cpts = num_cpts_global[1]-num_cpts_global[0]; - n_old_Cpts = num_old_cpts_global[1]-num_old_cpts_global[0]; + if (my_id == (num_procs - 1)) { total_global_cpts = num_cpts_global[1]; } + if (my_id == (num_procs - 1)) { total_old_global_cpts = num_old_cpts_global[1]; } + hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); + hypre_MPI_Bcast(&total_old_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); + n_Cpts = num_cpts_global[1] - num_cpts_global[0]; + n_old_Cpts = num_old_cpts_global[1] - num_old_cpts_global[0]; hypre_ParCSRMatrixGenerateFFFC3(A, CF_marker, num_cpts_global, S, &As_FC, &As_FF); @@ -160,27 +164,27 @@ hypre_BoomerAMGBuildModPartialExtInterpHost( hypre_ParCSRMatrix *A, D_w = hypre_CTAlloc(HYPRE_Real, n_new_Fpts, memory_location_P); cpt_array = hypre_CTAlloc(HYPRE_Int, num_threads, HYPRE_MEMORY_HOST); new_fpt_array = hypre_CTAlloc(HYPRE_Int, num_threads, HYPRE_MEMORY_HOST); - start_array = hypre_CTAlloc(HYPRE_Int, num_threads+1, HYPRE_MEMORY_HOST); + start_array = hypre_CTAlloc(HYPRE_Int, num_threads + 1, HYPRE_MEMORY_HOST); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel private(i,j,start,stop,startf,stopf,startnewf,stopnewf,row,fpt) + #pragma omp parallel private(i,j,start,stop,startf,stopf,startnewf,stopnewf,row,fpt) #endif { HYPRE_Int my_thread_num = hypre_GetThreadNum(); HYPRE_Real beta, gamma; - start = (n_fine/num_threads)*my_thread_num; - if (my_thread_num == num_threads-1) + start = (n_fine / num_threads) * my_thread_num; + if (my_thread_num == num_threads - 1) { stop = n_fine; } else { - stop = (n_fine/num_threads)*(my_thread_num+1); + stop = (n_fine / num_threads) * (my_thread_num + 1); } - start_array[my_thread_num+1] = stop; + start_array[my_thread_num + 1] = stop; row = 0; - for (i=start; i < stop; i++) + for (i = start; i < stop; i++) { if (CF_marker[i] > 0) { @@ -193,14 +197,14 @@ hypre_BoomerAMGBuildModPartialExtInterpHost( hypre_ParCSRMatrix *A, } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif if (my_thread_num == 0) { - for (i=1; i < num_threads; i++) + for (i = 1; i < num_threads; i++) { - cpt_array[i] += cpt_array[i-1]; - new_fpt_array[i] += new_fpt_array[i-1]; + cpt_array[i] += cpt_array[i - 1]; + new_fpt_array[i] += new_fpt_array[i - 1]; } /*if (num_functions > 1) { @@ -225,18 +229,18 @@ hypre_BoomerAMGBuildModPartialExtInterpHost( hypre_ParCSRMatrix *A, }*/ } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif if (my_thread_num > 0) { - startf = start - cpt_array[my_thread_num-1]; + startf = start - cpt_array[my_thread_num - 1]; } else { startf = 0; } - if (my_thread_num < num_threads-1) + if (my_thread_num < num_threads - 1) { stopf = stop - cpt_array[my_thread_num]; } @@ -246,22 +250,22 @@ hypre_BoomerAMGBuildModPartialExtInterpHost( hypre_ParCSRMatrix *A, } /* Create D_q = D_beta */ - for (i=startf; i < stopf; i++) + for (i = startf; i < stopf; i++) { - for (j=As_FC_diag_i[i]; j < As_FC_diag_i[i+1]; j++) + for (j = As_FC_diag_i[i]; j < As_FC_diag_i[i + 1]; j++) { D_q[i] += As_FC_diag_data[j]; } - for (j=As_FC_offd_i[i]; j < As_FC_offd_i[i+1]; j++) + for (j = As_FC_offd_i[i]; j < As_FC_offd_i[i + 1]; j++) { D_q[i] += As_FC_offd_data[j]; } } row = 0; - if (my_thread_num) row = new_fpt_array[my_thread_num-1]; + if (my_thread_num) { row = new_fpt_array[my_thread_num - 1]; } fpt = startf; - for (i=start; i < stop; i++) + for (i = start; i < stop; i++) { if (CF_marker[i] == -2) { @@ -273,10 +277,10 @@ hypre_BoomerAMGBuildModPartialExtInterpHost( hypre_ParCSRMatrix *A, } } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif - if (my_thread_num == 0) - { + if (my_thread_num == 0) + { if (num_cols_A_FF_offd) { D_q_offd = hypre_CTAlloc(HYPRE_Real, num_cols_A_FF_offd, memory_location_P); @@ -289,28 +293,29 @@ hypre_BoomerAMGBuildModPartialExtInterpHost( hypre_ParCSRMatrix *A, comm_pkg = hypre_ParCSRMatrixCommPkg(As_FF); } num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - buf_data = hypre_CTAlloc(HYPRE_Real, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), memory_location_P); + buf_data = hypre_CTAlloc(HYPRE_Real, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + memory_location_P); for (i = 0; i < num_sends; i++) { startc = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = startc; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = startc; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { - buf_data[index++] = D_q[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + buf_data[index++] = D_q[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } } comm_handle = hypre_ParCSRCommHandleCreate( 1, comm_pkg, buf_data, D_q_offd); hypre_ParCSRCommHandleDestroy(comm_handle); - } + } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif /* Create D_w = D_alpha + D_gamma */ row = 0; - if (my_thread_num) row = new_fpt_array[my_thread_num-1]; - for (i=start; i < stop; i++) + if (my_thread_num) { row = new_fpt_array[my_thread_num - 1]; } + for (i = start; i < stop; i++) { if (CF_marker[i] == -2) { @@ -365,21 +370,21 @@ hypre_BoomerAMGBuildModPartialExtInterpHost( hypre_ParCSRMatrix *A, } else*/ { - for (j=A_diag_i[i]; j < A_diag_i[i+1]; j++) + for (j = A_diag_i[i]; j < A_diag_i[i + 1]; j++) { D_w[row] += A_diag_data[j]; } - for (j=A_offd_i[i]; j < A_offd_i[i+1]; j++) + for (j = A_offd_i[i]; j < A_offd_i[i + 1]; j++) { D_w[row] += A_offd_data[j]; } - for (j=As_FF_diag_i[row]+1; j < As_FF_diag_i[row+1]; j++) + for (j = As_FF_diag_i[row] + 1; j < As_FF_diag_i[row + 1]; j++) { - if (D_q[As_FF_diag_j[j]]) D_w[row] -= As_FF_diag_data[j]; + if (D_q[As_FF_diag_j[j]]) { D_w[row] -= As_FF_diag_data[j]; } } - for (j=As_FF_offd_i[row]; j < As_FF_offd_i[row+1]; j++) + for (j = As_FF_offd_i[row]; j < As_FF_offd_i[row + 1]; j++) { - if (D_q_offd[As_FF_offd_j[j]]) D_w[row] -= As_FF_offd_data[j]; + if (D_q_offd[As_FF_offd_j[j]]) { D_w[row] -= As_FF_offd_data[j]; } } D_w[row] -= D_q[new_fine_to_fine[row]]; row++; @@ -389,32 +394,40 @@ hypre_BoomerAMGBuildModPartialExtInterpHost( hypre_ParCSRMatrix *A, #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif startnewf = 0; - if (my_thread_num) startnewf = new_fpt_array[my_thread_num-1]; + if (my_thread_num) { startnewf = new_fpt_array[my_thread_num - 1]; } stopnewf = new_fpt_array[my_thread_num]; - for (i=startnewf; i 0) - c_pt = cpt_array[my_thread_num-1]; + { + c_pt = cpt_array[my_thread_num - 1]; + } else + { c_pt = 0; + } row = 0; - if (my_thread_num) row = new_fpt_array[my_thread_num-1]; + if (my_thread_num) { row = new_fpt_array[my_thread_num - 1]; } rowp = row; - if (my_thread_num > 0) rowp = row+cpt_array[my_thread_num-1]; - cnt_diag = W_diag_i[row]+c_pt; + if (my_thread_num > 0) { rowp = row + cpt_array[my_thread_num - 1]; } + cnt_diag = W_diag_i[row] + c_pt; cnt_offd = W_offd_i[row]; - for (i=start; i < stop; i++) + for (i = start; i < stop; i++) { if (CF_marker[i] > 0) { @@ -482,12 +499,12 @@ hypre_BoomerAMGBuildModPartialExtInterpHost( hypre_ParCSRMatrix *A, else if (CF_marker[i] == -2) { rowp++; - for (j=W_diag_i[row]; j < W_diag_i[row+1]; j++) + for (j = W_diag_i[row]; j < W_diag_i[row + 1]; j++) { P_diag_j[cnt_diag] = W_diag_j[j]; P_diag_data[cnt_diag++] = W_diag_data[j]; } - for (j=W_offd_i[row]; j < W_offd_i[row+1]; j++) + for (j = W_offd_i[row]; j < W_offd_i[row + 1]; j++) { P_offd_j[cnt_offd] = W_offd_j[j]; P_offd_data[cnt_offd++] = W_offd_data[j]; @@ -504,13 +521,13 @@ hypre_BoomerAMGBuildModPartialExtInterpHost( hypre_ParCSRMatrix *A, *-----------------------------------------------------------------------*/ P = hypre_ParCSRMatrixCreate(comm, - total_old_global_cpts, - total_global_cpts, - num_old_cpts_global, - num_cpts_global, - num_cols_P_offd, - P_diag_i[n_old_Cpts], - P_offd_i[n_old_Cpts]); + total_old_global_cpts, + total_global_cpts, + num_old_cpts_global, + num_cpts_global, + num_cols_P_offd, + P_diag_i[n_old_Cpts], + P_offd_i[n_old_Cpts]); P_diag = hypre_ParCSRMatrixDiag(P); hypre_CSRMatrixData(P_diag) = P_diag_data; @@ -544,20 +561,20 @@ hypre_BoomerAMGBuildModPartialExtInterpHost( hypre_ParCSRMatrix *A, if (num_cols_P_offd) { P_marker = hypre_CTAlloc(HYPRE_Int, num_cols_P_offd, HYPRE_MEMORY_HOST); - for (i=0; i < P_offd_size; i++) + for (i = 0; i < P_offd_size; i++) { P_marker[P_offd_j[i]] = 1; } new_ncols_P_offd = 0; - for (i=0; i < num_cols_P_offd; i++) - if (P_marker[i]) new_ncols_P_offd++; + for (i = 0; i < num_cols_P_offd; i++) + if (P_marker[i]) { new_ncols_P_offd++; } new_col_map_offd = hypre_CTAlloc(HYPRE_BigInt, new_ncols_P_offd, HYPRE_MEMORY_HOST); map = hypre_CTAlloc(HYPRE_Int, new_ncols_P_offd, HYPRE_MEMORY_HOST); index = 0; - for (i=0; i < num_cols_P_offd; i++) + for (i = 0; i < num_cols_P_offd; i++) if (P_marker[i]) { new_col_map_offd[index] = col_map_offd_P[i]; @@ -567,12 +584,12 @@ hypre_BoomerAMGBuildModPartialExtInterpHost( hypre_ParCSRMatrix *A, #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i=0; i < P_offd_size; i++) + for (i = 0; i < P_offd_size; i++) { P_offd_j[i] = hypre_BinarySearch(map, P_offd_j[i], - new_ncols_P_offd); + new_ncols_P_offd); } hypre_TFree(col_map_offd_P, HYPRE_MEMORY_HOST); hypre_ParCSRMatrixColMapOffd(P) = new_col_map_offd; @@ -615,31 +632,28 @@ hypre_BoomerAMGBuildModPartialExtInterp( hypre_ParCSRMatrix *A, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ) { -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_GpuProfilingPushRange("PartialExtInterp"); -#endif - - HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(A) ); HYPRE_Int ierr = 0; - if (exec == HYPRE_EXEC_HOST) +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(A) ); + if (exec == HYPRE_EXEC_DEVICE) { - ierr = hypre_BoomerAMGBuildModPartialExtInterpHost(A, CF_marker, S, num_cpts_global, num_old_cpts_global, - num_functions, dof_func, - debug_flag, trunc_factor, max_elmts, P_ptr); + ierr = hypre_BoomerAMGBuildModPartialExtInterpDevice(A, CF_marker, S, num_cpts_global, + num_old_cpts_global, + debug_flag, trunc_factor, max_elmts, P_ptr); } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) else +#endif { - ierr = hypre_BoomerAMGBuildModPartialExtInterpDevice(A, CF_marker, S, num_cpts_global, num_old_cpts_global, - debug_flag, trunc_factor, max_elmts, P_ptr); + ierr = hypre_BoomerAMGBuildModPartialExtInterpHost(A, CF_marker, S, num_cpts_global, + num_old_cpts_global, + num_functions, dof_func, + debug_flag, trunc_factor, max_elmts, P_ptr); } -#endif -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_GpuProfilingPopRange(); -#endif return ierr; } @@ -657,6 +671,8 @@ hypre_BoomerAMGBuildModPartialExtPEInterpHost( hypre_ParCSRMatrix *A, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr) { + HYPRE_UNUSED_VAR(debug_flag); + /* Communication Variables */ MPI_Comm comm = hypre_ParCSRMatrixComm(A); HYPRE_MemoryLocation memory_location_P = hypre_ParCSRMatrixMemoryLocation(A); @@ -758,14 +774,14 @@ hypre_BoomerAMGBuildModPartialExtPEInterpHost( hypre_ParCSRMatrix *A, /* BEGIN */ hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_rank(comm, &my_id); - if (my_id == (num_procs -1)) total_global_cpts = num_cpts_global[1]; - if (my_id == (num_procs -1)) total_old_global_cpts = num_old_cpts_global[1]; - hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); - hypre_MPI_Bcast(&total_old_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); - n_Cpts = num_cpts_global[1]-num_cpts_global[0]; - n_old_Cpts = num_old_cpts_global[1]-num_old_cpts_global[0]; + if (my_id == (num_procs - 1)) { total_global_cpts = num_cpts_global[1]; } + if (my_id == (num_procs - 1)) { total_old_global_cpts = num_old_cpts_global[1]; } + hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); + hypre_MPI_Bcast(&total_old_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); + n_Cpts = num_cpts_global[1] - num_cpts_global[0]; + n_old_Cpts = num_old_cpts_global[1] - num_old_cpts_global[0]; hypre_ParCSRMatrixGenerateFFFCD3(A, CF_marker, num_cpts_global, S, &As_FC, &As_FF, &D_lambda); @@ -795,27 +811,27 @@ hypre_BoomerAMGBuildModPartialExtPEInterpHost( hypre_ParCSRMatrix *A, D_tau = hypre_CTAlloc(HYPRE_Real, n_new_Fpts, memory_location_P); cpt_array = hypre_CTAlloc(HYPRE_Int, num_threads, HYPRE_MEMORY_HOST); new_fpt_array = hypre_CTAlloc(HYPRE_Int, num_threads, HYPRE_MEMORY_HOST); - start_array = hypre_CTAlloc(HYPRE_Int, num_threads+1, HYPRE_MEMORY_HOST); + start_array = hypre_CTAlloc(HYPRE_Int, num_threads + 1, HYPRE_MEMORY_HOST); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel private(i,j,start,stop,startf,stopf,startnewf,stopnewf,row,fpt,index) + #pragma omp parallel private(i,j,start,stop,startf,stopf,startnewf,stopnewf,row,fpt,index) #endif { HYPRE_Int my_thread_num = hypre_GetThreadNum(); HYPRE_Real beta, gamma; - start = (n_fine/num_threads)*my_thread_num; - if (my_thread_num == num_threads-1) + start = (n_fine / num_threads) * my_thread_num; + if (my_thread_num == num_threads - 1) { stop = n_fine; } else { - stop = (n_fine/num_threads)*(my_thread_num+1); + stop = (n_fine / num_threads) * (my_thread_num + 1); } - start_array[my_thread_num+1] = stop; + start_array[my_thread_num + 1] = stop; row = 0; - for (i=start; i < stop; i++) + for (i = start; i < stop; i++) { if (CF_marker[i] > 0) { @@ -828,14 +844,14 @@ hypre_BoomerAMGBuildModPartialExtPEInterpHost( hypre_ParCSRMatrix *A, } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif if (my_thread_num == 0) { - for (i=1; i < num_threads; i++) + for (i = 1; i < num_threads; i++) { - cpt_array[i] += cpt_array[i-1]; - new_fpt_array[i] += new_fpt_array[i-1]; + cpt_array[i] += cpt_array[i - 1]; + new_fpt_array[i] += new_fpt_array[i - 1]; } if (num_functions > 1) { @@ -845,13 +861,14 @@ hypre_BoomerAMGBuildModPartialExtPEInterpHost( hypre_ParCSRMatrix *A, dof_func_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, memory_location_P); index = 0; num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), memory_location_P); + int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + memory_location_P); for (i = 0; i < num_sends; i++) { startc = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = startc; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = startc; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { - int_buf_data[index++] = dof_func[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + int_buf_data[index++] = dof_func[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } } comm_handle = hypre_ParCSRCommHandleCreate( 11, comm_pkg, int_buf_data, dof_func_offd); @@ -860,18 +877,18 @@ hypre_BoomerAMGBuildModPartialExtPEInterpHost( hypre_ParCSRMatrix *A, } } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif if (my_thread_num > 0) { - startf = start - cpt_array[my_thread_num-1]; + startf = start - cpt_array[my_thread_num - 1]; } else { startf = 0; } - if (my_thread_num < num_threads-1) + if (my_thread_num < num_threads - 1) { stopf = stop - cpt_array[my_thread_num]; } @@ -881,23 +898,23 @@ hypre_BoomerAMGBuildModPartialExtPEInterpHost( hypre_ParCSRMatrix *A, } /* Create D_q = D_beta, D_inv = 1/(D_q+D_lambda) */ - for (i=startf; i < stopf; i++) + for (i = startf; i < stopf; i++) { - for (j=As_FC_diag_i[i]; j < As_FC_diag_i[i+1]; j++) + for (j = As_FC_diag_i[i]; j < As_FC_diag_i[i + 1]; j++) { D_q[i] += As_FC_diag_data[j]; } - for (j=As_FC_offd_i[i]; j < As_FC_offd_i[i+1]; j++) + for (j = As_FC_offd_i[i]; j < As_FC_offd_i[i + 1]; j++) { D_q[i] += As_FC_offd_data[j]; } - if (D_q[i]+D_lambda[i]) D_inv[i] = 1.0/(D_q[i]+D_lambda[i]); + if (D_q[i] + D_lambda[i]) { D_inv[i] = 1.0 / (D_q[i] + D_lambda[i]); } } row = 0; - if (my_thread_num) row = new_fpt_array[my_thread_num-1]; + if (my_thread_num) { row = new_fpt_array[my_thread_num - 1]; } fpt = startf; - for (i=start; i < stop; i++) + for (i = start; i < stop; i++) { if (CF_marker[i] == -2) { @@ -909,10 +926,10 @@ hypre_BoomerAMGBuildModPartialExtPEInterpHost( hypre_ParCSRMatrix *A, } } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif - if (my_thread_num == 0) - { + if (my_thread_num == 0) + { if (num_cols_A_FF_offd) { D_lambda_offd = hypre_CTAlloc(HYPRE_Real, num_cols_A_FF_offd, memory_location_P); @@ -926,13 +943,14 @@ hypre_BoomerAMGBuildModPartialExtPEInterpHost( hypre_ParCSRMatrix *A, comm_pkg = hypre_ParCSRMatrixCommPkg(As_FF); } num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - buf_data = hypre_CTAlloc(HYPRE_Real, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), memory_location_P); + buf_data = hypre_CTAlloc(HYPRE_Real, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + memory_location_P); for (i = 0; i < num_sends; i++) { startc = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = startc; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = startc; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { - buf_data[index++] = D_lambda[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + buf_data[index++] = D_lambda[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } } @@ -943,45 +961,45 @@ hypre_BoomerAMGBuildModPartialExtPEInterpHost( hypre_ParCSRMatrix *A, for (i = 0; i < num_sends; i++) { startc = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = startc; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = startc; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { - buf_data[index++] = D_inv[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + buf_data[index++] = D_inv[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } } comm_handle = hypre_ParCSRCommHandleCreate( 1, comm_pkg, buf_data, D_inv_offd); hypre_ParCSRCommHandleDestroy(comm_handle); - } + } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif /* Create D_tau */ startnewf = 0; - if (my_thread_num) startnewf = new_fpt_array[my_thread_num-1]; + if (my_thread_num) { startnewf = new_fpt_array[my_thread_num - 1]; } stopnewf = new_fpt_array[my_thread_num]; - for (i=startnewf; i 0) - c_pt = cpt_array[my_thread_num-1]; + { + c_pt = cpt_array[my_thread_num - 1]; + } else + { c_pt = 0; + } row = 0; - if (my_thread_num) row = new_fpt_array[my_thread_num-1]; + if (my_thread_num) { row = new_fpt_array[my_thread_num - 1]; } rowp = row; - if (my_thread_num > 0) rowp = row+cpt_array[my_thread_num-1]; - cnt_diag = W_diag_i[row]+c_pt; + if (my_thread_num > 0) { rowp = row + cpt_array[my_thread_num - 1]; } + cnt_diag = W_diag_i[row] + c_pt; cnt_offd = W_offd_i[row]; - for (i=start; i < stop; i++) + for (i = start; i < stop; i++) { if (CF_marker[i] > 0) { @@ -1153,12 +1191,12 @@ hypre_BoomerAMGBuildModPartialExtPEInterpHost( hypre_ParCSRMatrix *A, else if (CF_marker[i] == -2) { rowp++; - for (j=W_diag_i[row]; j < W_diag_i[row+1]; j++) + for (j = W_diag_i[row]; j < W_diag_i[row + 1]; j++) { P_diag_j[cnt_diag] = W_diag_j[j]; P_diag_data[cnt_diag++] = W_diag_data[j]; } - for (j=W_offd_i[row]; j < W_offd_i[row+1]; j++) + for (j = W_offd_i[row]; j < W_offd_i[row + 1]; j++) { P_offd_j[cnt_offd] = W_offd_j[j]; P_offd_data[cnt_offd++] = W_offd_data[j]; @@ -1175,13 +1213,13 @@ hypre_BoomerAMGBuildModPartialExtPEInterpHost( hypre_ParCSRMatrix *A, *-----------------------------------------------------------------------*/ P = hypre_ParCSRMatrixCreate(comm, - total_old_global_cpts, - total_global_cpts, - num_old_cpts_global, - num_cpts_global, - num_cols_P_offd, - P_diag_i[n_old_Cpts], - P_offd_i[n_old_Cpts]); + total_old_global_cpts, + total_global_cpts, + num_old_cpts_global, + num_cpts_global, + num_cols_P_offd, + P_diag_i[n_old_Cpts], + P_offd_i[n_old_Cpts]); P_diag = hypre_ParCSRMatrixDiag(P); hypre_CSRMatrixData(P_diag) = P_diag_data; @@ -1215,13 +1253,13 @@ hypre_BoomerAMGBuildModPartialExtPEInterpHost( hypre_ParCSRMatrix *A, if (num_cols_P_offd) { P_marker = hypre_CTAlloc(HYPRE_Int, num_cols_P_offd, HYPRE_MEMORY_HOST); - for (i=0; i < P_offd_size; i++) + for (i = 0; i < P_offd_size; i++) { P_marker[P_offd_j[i]] = 1; } new_ncols_P_offd = 0; - for (i=0; i < num_cols_P_offd; i++) + for (i = 0; i < num_cols_P_offd; i++) { if (P_marker[i]) { @@ -1233,7 +1271,7 @@ hypre_BoomerAMGBuildModPartialExtPEInterpHost( hypre_ParCSRMatrix *A, map = hypre_CTAlloc(HYPRE_Int, new_ncols_P_offd, HYPRE_MEMORY_HOST); index = 0; - for (i=0; i < num_cols_P_offd; i++) + for (i = 0; i < num_cols_P_offd; i++) { if (P_marker[i]) { @@ -1246,9 +1284,9 @@ hypre_BoomerAMGBuildModPartialExtPEInterpHost( hypre_ParCSRMatrix *A, #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i=0; i < P_offd_size; i++) + for (i = 0; i < P_offd_size; i++) { P_offd_j[i] = hypre_BinarySearch(map, P_offd_j[i], new_ncols_P_offd); } @@ -1297,31 +1335,28 @@ hypre_BoomerAMGBuildModPartialExtPEInterp( hypre_ParCSRMatrix *A, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ) { -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_GpuProfilingPushRange("PartialExtPEInterp"); -#endif - - HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(A) ); HYPRE_Int ierr = 0; - if (exec == HYPRE_EXEC_HOST) +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(A) ); + if (exec == HYPRE_EXEC_DEVICE) { - ierr = hypre_BoomerAMGBuildModPartialExtPEInterpHost(A, CF_marker, S, num_cpts_global, num_old_cpts_global, - num_functions, dof_func, - debug_flag, trunc_factor, max_elmts, P_ptr); + ierr = hypre_BoomerAMGBuildModPartialExtPEInterpDevice(A, CF_marker, S, num_cpts_global, + num_old_cpts_global, + debug_flag, trunc_factor, max_elmts, P_ptr); } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) else +#endif { - ierr = hypre_BoomerAMGBuildModPartialExtPEInterpDevice(A, CF_marker, S, num_cpts_global, num_old_cpts_global, - debug_flag, trunc_factor, max_elmts, P_ptr); + ierr = hypre_BoomerAMGBuildModPartialExtPEInterpHost(A, CF_marker, S, num_cpts_global, + num_old_cpts_global, + num_functions, dof_func, + debug_flag, trunc_factor, max_elmts, P_ptr); } -#endif -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_GpuProfilingPopRange(); -#endif return ierr; } diff --git a/external/hypre/src/parcsr_ls/par_2s_interp_device.c b/external/hypre/src/parcsr_ls/par_2s_interp_device.c index eab19cdd..a5b92556 100644 --- a/external/hypre/src/parcsr_ls/par_2s_interp_device.c +++ b/external/hypre/src/parcsr_ls/par_2s_interp_device.c @@ -1,24 +1,43 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ +#include "_hypre_onedpl.hpp" #include "_hypre_parcsr_ls.h" #include "_hypre_utilities.hpp" -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - -__global__ void hypreCUDAKernel_compute_weak_rowsums( HYPRE_Int nr_of_rows, bool has_offd, HYPRE_Int *CF_marker, HYPRE_Int *A_diag_i, HYPRE_Complex *A_diag_a, HYPRE_Int *S_diag_j, HYPRE_Int *A_offd_i, HYPRE_Complex *A_offd_a, HYPRE_Int *S_offd_j, HYPRE_Real *rs, HYPRE_Int flag ); - -__global__ void hypreCUDAKernel_MMInterpScaleAFF( HYPRE_Int AFF_nrows, HYPRE_Int *AFF_diag_i, HYPRE_Int *AFF_diag_j, HYPRE_Complex *AFF_diag_a, HYPRE_Int *AFF_offd_i, HYPRE_Int *AFF_offd_j, HYPRE_Complex *AFF_offd_a, HYPRE_Complex *beta_diag, HYPRE_Complex *beta_offd, HYPRE_Int *F2_to_F, HYPRE_Real *rsW ); - -__global__ void hypreCUDAKernel_compute_dlam_dtmp( HYPRE_Int nr_of_rows, HYPRE_Int *AFF_diag_i, HYPRE_Int *AFF_diag_j, HYPRE_Complex *AFF_diag_data, HYPRE_Int *AFF_offd_i, HYPRE_Complex *AFF_offd_data, HYPRE_Complex *rsFC, HYPRE_Complex *dlam, HYPRE_Complex *dtmp ); - -__global__ void hypreCUDAKernel_MMPEInterpScaleAFF( HYPRE_Int AFF_nrows, HYPRE_Int *AFF_diag_i, HYPRE_Int *AFF_diag_j, HYPRE_Complex *AFF_diag_a, HYPRE_Int *AFF_offd_i, HYPRE_Int *AFF_offd_j, HYPRE_Complex *AFF_offd_a, HYPRE_Complex *tmp_diag, HYPRE_Complex *tmp_offd, HYPRE_Complex *lam_diag, HYPRE_Complex *lam_offd, HYPRE_Int *F2_to_F, HYPRE_Real *rsW ); - -void hypreDevice_extendWtoP( HYPRE_Int P_nr_of_rows, HYPRE_Int W_nr_of_rows, HYPRE_Int W_nr_of_cols, HYPRE_Int *CF_marker, HYPRE_Int W_diag_nnz, HYPRE_Int *W_diag_i, HYPRE_Int *W_diag_j, HYPRE_Complex *W_diag_data, HYPRE_Int *P_diag_i, HYPRE_Int *P_diag_j, HYPRE_Complex *P_diag_data, HYPRE_Int *W_offd_i, HYPRE_Int *P_offd_i ); +#if defined(HYPRE_USING_GPU) + +#if defined(HYPRE_USING_SYCL) +SYCL_EXTERNAL +#endif +__global__ void hypreGPUKernel_compute_weak_rowsums( hypre_DeviceItem &item, HYPRE_Int nr_of_rows, + bool has_offd, + HYPRE_Int *CF_marker, HYPRE_Int *A_diag_i, HYPRE_Complex *A_diag_a, HYPRE_Int *S_diag_j, + HYPRE_Int *A_offd_i, HYPRE_Complex *A_offd_a, HYPRE_Int *S_offd_j, HYPRE_Real *rs, HYPRE_Int flag ); + +__global__ void hypreGPUKernel_MMInterpScaleAFF( hypre_DeviceItem &item, HYPRE_Int AFF_nrows, + HYPRE_Int *AFF_diag_i, + HYPRE_Int *AFF_diag_j, HYPRE_Complex *AFF_diag_a, HYPRE_Int *AFF_offd_i, HYPRE_Int *AFF_offd_j, + HYPRE_Complex *AFF_offd_a, HYPRE_Complex *beta_diag, HYPRE_Complex *beta_offd, HYPRE_Int *F2_to_F, + HYPRE_Real *rsW ); + +#if defined(HYPRE_USING_SYCL) +SYCL_EXTERNAL +#endif +__global__ void hypreGPUKernel_compute_dlam_dtmp( hypre_DeviceItem &item, HYPRE_Int nr_of_rows, + HYPRE_Int *AFF_diag_i, + HYPRE_Int *AFF_diag_j, HYPRE_Complex *AFF_diag_data, HYPRE_Int *AFF_offd_i, + HYPRE_Complex *AFF_offd_data, HYPRE_Complex *rsFC, HYPRE_Complex *dlam, HYPRE_Complex *dtmp ); + +__global__ void hypreGPUKernel_MMPEInterpScaleAFF( hypre_DeviceItem &item, HYPRE_Int AFF_nrows, + HYPRE_Int *AFF_diag_i, + HYPRE_Int *AFF_diag_j, HYPRE_Complex *AFF_diag_a, HYPRE_Int *AFF_offd_i, HYPRE_Int *AFF_offd_j, + HYPRE_Complex *AFF_offd_a, HYPRE_Complex *tmp_diag, HYPRE_Complex *tmp_offd, + HYPRE_Complex *lam_diag, HYPRE_Complex *lam_offd, HYPRE_Int *F2_to_F, HYPRE_Real *rsW ); /*--------------------------------------------------------------------------------------*/ HYPRE_Int @@ -32,6 +51,8 @@ hypre_BoomerAMGBuildModPartialExtInterpDevice( hypre_ParCSRMatrix *A, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ) { + HYPRE_UNUSED_VAR(debug_flag); + HYPRE_Int A_nr_local = hypre_ParCSRMatrixNumRows(A); hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); HYPRE_Complex *A_diag_data = hypre_CSRMatrixData(A_diag); @@ -40,7 +61,6 @@ hypre_BoomerAMGBuildModPartialExtInterpDevice( hypre_ParCSRMatrix *A, HYPRE_Complex *A_offd_data = hypre_CSRMatrixData(A_offd); HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); HYPRE_Int A_offd_nnz = hypre_CSRMatrixNumNonzeros(A_offd); - HYPRE_Int *CF_marker_dev; HYPRE_Complex *Dbeta, *Dbeta_offd, *rsWA, *rsW; hypre_ParCSRMatrix *As_F2F, *As_FC, *W, *P; @@ -49,10 +69,6 @@ hypre_BoomerAMGBuildModPartialExtInterpDevice( hypre_ParCSRMatrix *A, HYPRE_Int *Soc_diag_j = hypre_ParCSRMatrixSocDiagJ(S); HYPRE_Int *Soc_offd_j = hypre_ParCSRMatrixSocOffdJ(S); - CF_marker_dev = hypre_TAlloc(HYPRE_Int, A_nr_local, HYPRE_MEMORY_DEVICE); - hypre_TMemcpy(CF_marker_dev, CF_marker, HYPRE_Int, A_nr_local, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - - //TODO use CF_marker_dev /* As_F2F = As_{F2, F}, As_FC = As_{F, C2} */ hypre_ParCSRMatrixGenerateFFFC3Device(A, CF_marker, num_cpts_global, S, &As_FC, &As_F2F); @@ -72,48 +88,74 @@ hypre_BoomerAMGBuildModPartialExtInterpDevice( hypre_ParCSRMatrix *A, hypre_MatvecCommPkgCreate(As_F2F); comm_pkg = hypre_ParCSRMatrixCommPkg(As_F2F); } - Dbeta_offd = hypre_TAlloc(HYPRE_Complex, hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(As_F2F)), HYPRE_MEMORY_DEVICE); + Dbeta_offd = hypre_TAlloc(HYPRE_Complex, hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(As_F2F)), + HYPRE_MEMORY_DEVICE); HYPRE_Int num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); HYPRE_Int num_elmts_send = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends); HYPRE_Complex *send_buf = hypre_TAlloc(HYPRE_Complex, num_elmts_send, HYPRE_MEMORY_DEVICE); hypre_ParCSRCommPkgCopySendMapElmtsToDevice(comm_pkg); +#if defined(HYPRE_USING_SYCL) + hypreSycl_gather( hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + num_elmts_send, + Dbeta, + send_buf ); +#else HYPRE_THRUST_CALL( gather, hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + num_elmts_send, Dbeta, send_buf ); - comm_handle = hypre_ParCSRCommHandleCreate_v2(1, comm_pkg, HYPRE_MEMORY_DEVICE, send_buf, HYPRE_MEMORY_DEVICE, Dbeta_offd); +#endif + +#if defined(HYPRE_USING_THRUST_NOSYNC) + /* RL: make sure send_buf is ready before issuing GPU-GPU MPI */ + if (hypre_GetGpuAwareMPI()) + { + hypre_ForceSyncComputeStream(); + } +#endif + + comm_handle = hypre_ParCSRCommHandleCreate_v2(1, comm_pkg, HYPRE_MEMORY_DEVICE, send_buf, + HYPRE_MEMORY_DEVICE, Dbeta_offd); hypre_ParCSRCommHandleDestroy(comm_handle); hypre_TFree(send_buf, HYPRE_MEMORY_DEVICE); /* weak row sum and diagonal, i.e., DF2F2 + Dgamma */ rsWA = hypre_TAlloc(HYPRE_Complex, A_nr_local, HYPRE_MEMORY_DEVICE); - dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(A_nr_local, "warp", bDim); + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(A_nr_local, "warp", bDim); /* only for rows corresponding to F2 (notice flag == -1) */ - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_compute_weak_rowsums, - gDim, bDim, - A_nr_local, - A_offd_nnz > 0, - CF_marker_dev, - A_diag_i, - A_diag_data, - Soc_diag_j, - A_offd_i, - A_offd_data, - Soc_offd_j, - rsWA, - -1 ); + HYPRE_GPU_LAUNCH( hypreGPUKernel_compute_weak_rowsums, + gDim, bDim, + A_nr_local, + A_offd_nnz > 0, + CF_marker, + A_diag_i, + A_diag_data, + Soc_diag_j, + A_offd_i, + A_offd_data, + Soc_offd_j, + rsWA, + -1 ); rsW = hypre_TAlloc(HYPRE_Complex, AF2F_nr_local, HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_SYCL) + HYPRE_Complex *new_end = hypreSycl_copy_if( rsWA, + rsWA + A_nr_local, + CF_marker, + rsW, + equal(-2) ); +#else HYPRE_Complex *new_end = HYPRE_THRUST_CALL( copy_if, rsWA, rsWA + A_nr_local, - CF_marker_dev, + CF_marker, rsW, equal(-2) ); +#endif hypre_assert(new_end - rsW == AF2F_nr_local); @@ -121,20 +163,36 @@ hypre_BoomerAMGBuildModPartialExtInterpDevice( hypre_ParCSRMatrix *A, /* map from F2 to F */ HYPRE_Int *map_to_F = hypre_TAlloc(HYPRE_Int, A_nr_local, HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::exclusive_scan, + oneapi::dpl::make_transform_iterator(CF_marker, is_negative()), + oneapi::dpl::make_transform_iterator(CF_marker + A_nr_local, is_negative()), + map_to_F, + HYPRE_Int(0) );/* *MUST* pass init value since input and output types diff. */ +#else HYPRE_THRUST_CALL( exclusive_scan, - thrust::make_transform_iterator(CF_marker_dev, is_negative()), - thrust::make_transform_iterator(CF_marker_dev + A_nr_local, is_negative()), + thrust::make_transform_iterator(CF_marker, is_negative()), + thrust::make_transform_iterator(CF_marker + A_nr_local, is_negative()), map_to_F, HYPRE_Int(0) );/* *MUST* pass init value since input and output types diff. */ +#endif HYPRE_Int *map_F2_to_F = hypre_TAlloc(HYPRE_Int, AF2F_nr_local, HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_SYCL) + HYPRE_Int *tmp_end = hypreSycl_copy_if( map_to_F, + map_to_F + A_nr_local, + CF_marker, + map_F2_to_F, + equal(-2) ); +#else HYPRE_Int *tmp_end = HYPRE_THRUST_CALL( copy_if, map_to_F, map_to_F + A_nr_local, - CF_marker_dev, + CF_marker, map_F2_to_F, equal(-2) ); +#endif hypre_assert(tmp_end - map_F2_to_F == AF2F_nr_local); @@ -142,21 +200,27 @@ hypre_BoomerAMGBuildModPartialExtInterpDevice( hypre_ParCSRMatrix *A, /* add to rsW those in AF2F that correspond to Dbeta == 0 * diagnoally scale As_F2F (from both sides) and replace the diagonal */ - gDim = hypre_GetDefaultCUDAGridDimension(AF2F_nr_local, "warp", bDim); - - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_MMInterpScaleAFF, - gDim, bDim, - AF2F_nr_local, - hypre_CSRMatrixI(hypre_ParCSRMatrixDiag(As_F2F)), - hypre_CSRMatrixJ(hypre_ParCSRMatrixDiag(As_F2F)), - hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(As_F2F)), - hypre_CSRMatrixI(hypre_ParCSRMatrixOffd(As_F2F)), - hypre_CSRMatrixJ(hypre_ParCSRMatrixOffd(As_F2F)), - hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(As_F2F)), - Dbeta, - Dbeta_offd, - map_F2_to_F, - rsW ); + gDim = hypre_GetDefaultDeviceGridDimension(AF2F_nr_local, "warp", bDim); + + HYPRE_Int *As_F2F_diag_i = hypre_CSRMatrixI(hypre_ParCSRMatrixDiag(As_F2F)); + HYPRE_Int *As_F2F_diag_j = hypre_CSRMatrixJ(hypre_ParCSRMatrixDiag(As_F2F)); + HYPRE_Complex *As_F2F_diag_data = hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(As_F2F)); + HYPRE_Int *As_F2F_offd_i = hypre_CSRMatrixI(hypre_ParCSRMatrixOffd(As_F2F)); + HYPRE_Int *As_F2F_offd_j = hypre_CSRMatrixJ(hypre_ParCSRMatrixOffd(As_F2F)); + HYPRE_Complex *As_F2F_offd_data = hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(As_F2F)); + HYPRE_GPU_LAUNCH( hypreGPUKernel_MMInterpScaleAFF, + gDim, bDim, + AF2F_nr_local, + As_F2F_diag_i, + As_F2F_diag_j, + As_F2F_diag_data, + As_F2F_offd_i, + As_F2F_offd_j, + As_F2F_offd_data, + Dbeta, + Dbeta_offd, + map_F2_to_F, + rsW ); hypre_TFree(Dbeta, HYPRE_MEMORY_DEVICE); hypre_TFree(Dbeta_offd, HYPRE_MEMORY_DEVICE); @@ -184,17 +248,23 @@ hypre_BoomerAMGBuildModPartialExtInterpDevice( hypre_ParCSRMatrix *A, P_offd_i = hypre_TAlloc(HYPRE_Int, P_nr_local + 1, HYPRE_MEMORY_DEVICE); HYPRE_Int *C2F2_marker = hypre_TAlloc(HYPRE_Int, P_nr_local, HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_SYCL) + tmp_end = hypreSycl_copy_if( CF_marker, + CF_marker + A_nr_local, + CF_marker, + C2F2_marker, + out_of_range(-1, 0) /* -2 or 1 */ ); +#else tmp_end = HYPRE_THRUST_CALL( copy_if, - CF_marker_dev, - CF_marker_dev + A_nr_local, - CF_marker_dev, + CF_marker, + CF_marker + A_nr_local, + CF_marker, C2F2_marker, out_of_range(-1, 0) /* -2 or 1 */ ); +#endif hypre_assert(tmp_end - C2F2_marker == P_nr_local); - hypre_TFree(CF_marker_dev, HYPRE_MEMORY_DEVICE); - hypreDevice_extendWtoP( P_nr_local, AF2F_nr_local, hypre_ParCSRMatrixNumCols(W), @@ -267,6 +337,8 @@ hypre_BoomerAMGBuildModPartialExtPEInterpDevice( hypre_ParCSRMatrix *A, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ) { + HYPRE_UNUSED_VAR(debug_flag); + HYPRE_Int A_nr_local = hypre_ParCSRMatrixNumRows(A); hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); HYPRE_Complex *A_diag_data = hypre_CSRMatrixData(A_diag); @@ -275,7 +347,6 @@ hypre_BoomerAMGBuildModPartialExtPEInterpDevice( hypre_ParCSRMatrix *A, HYPRE_Complex *A_offd_data = hypre_CSRMatrixData(A_offd); HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); HYPRE_Int A_offd_nnz = hypre_CSRMatrixNumNonzeros(A_offd); - HYPRE_Int *CF_marker_dev; HYPRE_Complex *Dbeta, *rsWA, *rsW, *dlam, *dlam_offd, *dtmp, *dtmp_offd; hypre_ParCSRMatrix *As_F2F, *As_FF, *As_FC, *W, *P; @@ -284,10 +355,6 @@ hypre_BoomerAMGBuildModPartialExtPEInterpDevice( hypre_ParCSRMatrix *A, HYPRE_Int *Soc_diag_j = hypre_ParCSRMatrixSocDiagJ(S); HYPRE_Int *Soc_offd_j = hypre_ParCSRMatrixSocOffdJ(S); - CF_marker_dev = hypre_TAlloc(HYPRE_Int, A_nr_local, HYPRE_MEMORY_DEVICE); - hypre_TMemcpy(CF_marker_dev, CF_marker, HYPRE_Int, A_nr_local, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - - //TODO use CF_marker_dev /* As_F2F = As_{F2, F}, As_FC = As_{F, C2} */ hypre_ParCSRMatrixGenerateFFFC3Device(A, CF_marker, num_cpts_global, S, &As_FC, &As_F2F); @@ -304,32 +371,39 @@ hypre_BoomerAMGBuildModPartialExtPEInterpDevice( hypre_ParCSRMatrix *A, hypre_assert(AFC_nr_local == hypre_ParCSRMatrixNumRows(As_FF)); - dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(AFC_nr_local, "warp", bDim); + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(AFC_nr_local, "warp", bDim); /* Generate D_lambda in the paper: D_beta + (row sum of AFF without diagonal elements / row_nnz) */ /* Generate D_tmp, i.e., D_mu / D_lambda */ dlam = hypre_TAlloc(HYPRE_Complex, AFC_nr_local, HYPRE_MEMORY_DEVICE); dtmp = hypre_TAlloc(HYPRE_Complex, AFC_nr_local, HYPRE_MEMORY_DEVICE); - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_compute_dlam_dtmp, - gDim, bDim, - AFC_nr_local, - hypre_CSRMatrixI(hypre_ParCSRMatrixDiag(As_FF)), - hypre_CSRMatrixJ(hypre_ParCSRMatrixDiag(As_FF)), - hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(As_FF)), - hypre_CSRMatrixI(hypre_ParCSRMatrixOffd(As_FF)), - hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(As_FF)), - Dbeta, - dlam, - dtmp ); + HYPRE_Int *As_FF_diag_i = hypre_CSRMatrixI(hypre_ParCSRMatrixDiag(As_FF)); + HYPRE_Int *As_FF_diag_j = hypre_CSRMatrixJ(hypre_ParCSRMatrixDiag(As_FF)); + HYPRE_Complex *As_FF_diag_data = hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(As_FF)); + HYPRE_Int *As_FF_offd_i = hypre_CSRMatrixI(hypre_ParCSRMatrixOffd(As_FF)); + HYPRE_Complex *As_FF_offd_data = hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(As_FF)); + HYPRE_GPU_LAUNCH( hypreGPUKernel_compute_dlam_dtmp, + gDim, bDim, + AFC_nr_local, + As_FF_diag_i, + As_FF_diag_j, + As_FF_diag_data, + As_FF_offd_i, + As_FF_offd_data, + Dbeta, + dlam, + dtmp ); hypre_ParCSRMatrixDestroy(As_FF); hypre_TFree(Dbeta, HYPRE_MEMORY_DEVICE); /* collect off-processor dtmp and dlam */ - dtmp_offd = hypre_TAlloc(HYPRE_Complex, hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(As_F2F)), HYPRE_MEMORY_DEVICE); - dlam_offd = hypre_TAlloc(HYPRE_Complex, hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(As_F2F)), HYPRE_MEMORY_DEVICE); + dtmp_offd = hypre_TAlloc(HYPRE_Complex, hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(As_F2F)), + HYPRE_MEMORY_DEVICE); + dlam_offd = hypre_TAlloc(HYPRE_Complex, hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(As_F2F)), + HYPRE_MEMORY_DEVICE); hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(As_F2F); hypre_ParCSRCommHandle *comm_handle; @@ -343,20 +417,54 @@ hypre_BoomerAMGBuildModPartialExtPEInterpDevice( hypre_ParCSRMatrix *A, HYPRE_Complex *send_buf = hypre_TAlloc(HYPRE_Complex, num_elmts_send, HYPRE_MEMORY_DEVICE); hypre_ParCSRCommPkgCopySendMapElmtsToDevice(comm_pkg); +#if defined(HYPRE_USING_SYCL) + hypreSycl_gather( hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + num_elmts_send, + dtmp, + send_buf ); +#else HYPRE_THRUST_CALL( gather, hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + num_elmts_send, dtmp, send_buf ); - comm_handle = hypre_ParCSRCommHandleCreate_v2(1, comm_pkg, HYPRE_MEMORY_DEVICE, send_buf, HYPRE_MEMORY_DEVICE, dtmp_offd); +#endif + +#if defined(HYPRE_USING_THRUST_NOSYNC) + /* RL: make sure send_buf is ready before issuing GPU-GPU MPI */ + if (hypre_GetGpuAwareMPI()) + { + hypre_ForceSyncComputeStream(); + } +#endif + + comm_handle = hypre_ParCSRCommHandleCreate_v2(1, comm_pkg, HYPRE_MEMORY_DEVICE, send_buf, + HYPRE_MEMORY_DEVICE, dtmp_offd); hypre_ParCSRCommHandleDestroy(comm_handle); +#if defined(HYPRE_USING_SYCL) + hypreSycl_gather( hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + num_elmts_send, + dlam, + send_buf ); +#else HYPRE_THRUST_CALL( gather, hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + num_elmts_send, dlam, send_buf ); - comm_handle = hypre_ParCSRCommHandleCreate_v2(1, comm_pkg, HYPRE_MEMORY_DEVICE, send_buf, HYPRE_MEMORY_DEVICE, dlam_offd); +#endif + +#if defined(HYPRE_USING_THRUST_NOSYNC) + /* RL: make sure send_buf is ready before issuing GPU-GPU MPI */ + if (hypre_GetGpuAwareMPI()) + { + hypre_ForceSyncComputeStream(); + } +#endif + + comm_handle = hypre_ParCSRCommHandleCreate_v2(1, comm_pkg, HYPRE_MEMORY_DEVICE, send_buf, + HYPRE_MEMORY_DEVICE, dlam_offd); hypre_ParCSRCommHandleDestroy(comm_handle); hypre_TFree(send_buf, HYPRE_MEMORY_DEVICE); @@ -364,30 +472,38 @@ hypre_BoomerAMGBuildModPartialExtPEInterpDevice( hypre_ParCSRMatrix *A, /* weak row sum and diagonal, i.e., DFF + Dgamma */ rsWA = hypre_TAlloc(HYPRE_Complex, A_nr_local, HYPRE_MEMORY_DEVICE); - gDim = hypre_GetDefaultCUDAGridDimension(A_nr_local, "warp", bDim); + gDim = hypre_GetDefaultDeviceGridDimension(A_nr_local, "warp", bDim); /* only for rows corresponding to F2 (notice flag == -1) */ - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_compute_weak_rowsums, - gDim, bDim, - A_nr_local, - A_offd_nnz > 0, - CF_marker_dev, - A_diag_i, - A_diag_data, - Soc_diag_j, - A_offd_i, - A_offd_data, - Soc_offd_j, - rsWA, - -1 ); + HYPRE_GPU_LAUNCH( hypreGPUKernel_compute_weak_rowsums, + gDim, bDim, + A_nr_local, + A_offd_nnz > 0, + CF_marker, + A_diag_i, + A_diag_data, + Soc_diag_j, + A_offd_i, + A_offd_data, + Soc_offd_j, + rsWA, + -1 ); rsW = hypre_TAlloc(HYPRE_Complex, AF2F_nr_local, HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_SYCL) + HYPRE_Complex *new_end = hypreSycl_copy_if( rsWA, + rsWA + A_nr_local, + CF_marker, + rsW, + equal(-2) ); +#else HYPRE_Complex *new_end = HYPRE_THRUST_CALL( copy_if, rsWA, rsWA + A_nr_local, - CF_marker_dev, + CF_marker, rsW, equal(-2) ); +#endif hypre_assert(new_end - rsW == AF2F_nr_local); @@ -395,19 +511,35 @@ hypre_BoomerAMGBuildModPartialExtPEInterpDevice( hypre_ParCSRMatrix *A, /* map from F2 to F */ HYPRE_Int *map_to_F = hypre_TAlloc(HYPRE_Int, A_nr_local, HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::exclusive_scan, + oneapi::dpl::make_transform_iterator(CF_marker, is_negative()), + oneapi::dpl::make_transform_iterator(CF_marker + A_nr_local, is_negative()), + map_to_F, + HYPRE_Int(0) ); /* *MUST* pass init value since input and output types diff. */ +#else HYPRE_THRUST_CALL( exclusive_scan, - thrust::make_transform_iterator(CF_marker_dev, is_negative()), - thrust::make_transform_iterator(CF_marker_dev + A_nr_local, is_negative()), + thrust::make_transform_iterator(CF_marker, is_negative()), + thrust::make_transform_iterator(CF_marker + A_nr_local, is_negative()), map_to_F, HYPRE_Int(0) ); /* *MUST* pass init value since input and output types diff. */ +#endif HYPRE_Int *map_F2_to_F = hypre_TAlloc(HYPRE_Int, AF2F_nr_local, HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_SYCL) + HYPRE_Int *tmp_end = hypreSycl_copy_if( map_to_F, + map_to_F + A_nr_local, + CF_marker, + map_F2_to_F, + equal(-2) ); +#else HYPRE_Int *tmp_end = HYPRE_THRUST_CALL( copy_if, map_to_F, map_to_F + A_nr_local, - CF_marker_dev, + CF_marker, map_F2_to_F, equal(-2) ); +#endif hypre_assert(tmp_end - map_F2_to_F == AF2F_nr_local); @@ -415,23 +547,29 @@ hypre_BoomerAMGBuildModPartialExtPEInterpDevice( hypre_ParCSRMatrix *A, /* add to rsW those in AFF that correspond to lam == 0 * diagnoally scale As_F2F (from both sides) and replace the diagonal */ - gDim = hypre_GetDefaultCUDAGridDimension(AF2F_nr_local, "warp", bDim); - - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_MMPEInterpScaleAFF, - gDim, bDim, - AF2F_nr_local, - hypre_CSRMatrixI(hypre_ParCSRMatrixDiag(As_F2F)), - hypre_CSRMatrixJ(hypre_ParCSRMatrixDiag(As_F2F)), - hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(As_F2F)), - hypre_CSRMatrixI(hypre_ParCSRMatrixOffd(As_F2F)), - hypre_CSRMatrixJ(hypre_ParCSRMatrixOffd(As_F2F)), - hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(As_F2F)), - dtmp, - dtmp_offd, - dlam, - dlam_offd, - map_F2_to_F, - rsW ); + gDim = hypre_GetDefaultDeviceGridDimension(AF2F_nr_local, "warp", bDim); + + HYPRE_Int *As_F2F_diag_i = hypre_CSRMatrixI(hypre_ParCSRMatrixDiag(As_F2F)); + HYPRE_Int *As_F2F_diag_j = hypre_CSRMatrixJ(hypre_ParCSRMatrixDiag(As_F2F)); + HYPRE_Complex *As_F2F_diag_data = hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(As_F2F)); + HYPRE_Int *As_F2F_offd_i = hypre_CSRMatrixI(hypre_ParCSRMatrixOffd(As_F2F)); + HYPRE_Int *As_F2F_offd_j = hypre_CSRMatrixJ(hypre_ParCSRMatrixOffd(As_F2F)); + HYPRE_Complex *As_F2F_offd_data = hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(As_F2F)); + HYPRE_GPU_LAUNCH( hypreGPUKernel_MMPEInterpScaleAFF, + gDim, bDim, + AF2F_nr_local, + As_F2F_diag_i, + As_F2F_diag_j, + As_F2F_diag_data, + As_F2F_offd_i, + As_F2F_offd_j, + As_F2F_offd_data, + dtmp, + dtmp_offd, + dlam, + dlam_offd, + map_F2_to_F, + rsW ); hypre_TFree(dlam, HYPRE_MEMORY_DEVICE); hypre_TFree(dlam_offd, HYPRE_MEMORY_DEVICE); @@ -461,17 +599,23 @@ hypre_BoomerAMGBuildModPartialExtPEInterpDevice( hypre_ParCSRMatrix *A, P_offd_i = hypre_TAlloc(HYPRE_Int, P_nr_local + 1, HYPRE_MEMORY_DEVICE); HYPRE_Int *C2F2_marker = hypre_TAlloc(HYPRE_Int, P_nr_local, HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_SYCL) + tmp_end = hypreSycl_copy_if( CF_marker, + CF_marker + A_nr_local, + CF_marker, + C2F2_marker, + out_of_range(-1, 0) /* -2 or 1 */ ); +#else tmp_end = HYPRE_THRUST_CALL( copy_if, - CF_marker_dev, - CF_marker_dev + A_nr_local, - CF_marker_dev, + CF_marker, + CF_marker + A_nr_local, + CF_marker, C2F2_marker, out_of_range(-1, 0) /* -2 or 1 */ ); +#endif hypre_assert(tmp_end - C2F2_marker == P_nr_local); - hypre_TFree(CF_marker_dev, HYPRE_MEMORY_DEVICE); - hypreDevice_extendWtoP( P_nr_local, AF2F_nr_local, hypre_ParCSRMatrixNumCols(W), @@ -534,45 +678,47 @@ hypre_BoomerAMGBuildModPartialExtPEInterpDevice( hypre_ParCSRMatrix *A, //----------------------------------------------------------------------- __global__ -void hypreCUDAKernel_MMInterpScaleAFF( HYPRE_Int AFF_nrows, - HYPRE_Int *AFF_diag_i, - HYPRE_Int *AFF_diag_j, - HYPRE_Complex *AFF_diag_a, - HYPRE_Int *AFF_offd_i, - HYPRE_Int *AFF_offd_j, - HYPRE_Complex *AFF_offd_a, - HYPRE_Complex *beta_diag, - HYPRE_Complex *beta_offd, - HYPRE_Int *F2_to_F, - HYPRE_Real *rsW ) +void hypreGPUKernel_MMInterpScaleAFF( hypre_DeviceItem &item, + HYPRE_Int AFF_nrows, + HYPRE_Int *AFF_diag_i, + HYPRE_Int *AFF_diag_j, + HYPRE_Complex *AFF_diag_a, + HYPRE_Int *AFF_offd_i, + HYPRE_Int *AFF_offd_j, + HYPRE_Complex *AFF_offd_a, + HYPRE_Complex *beta_diag, + HYPRE_Complex *beta_offd, + HYPRE_Int *F2_to_F, + HYPRE_Real *rsW ) { - HYPRE_Int row = hypre_cuda_get_grid_warp_id<1,1>(); + HYPRE_Int row = hypre_gpu_get_grid_warp_id<1, 1>(item); if (row >= AFF_nrows) { return; } - HYPRE_Int lane = hypre_cuda_get_lane_id<1>(); - HYPRE_Int ib_diag, ie_diag; - HYPRE_Int rowF; + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); + HYPRE_Int ib_diag = 0, ie_diag; + HYPRE_Int rowF = 0; if (lane == 0) { rowF = read_only_load(&F2_to_F[row]); } - rowF = __shfl_sync(HYPRE_WARP_FULL_MASK, rowF, 0); + rowF = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, rowF, 0); if (lane < 2) { ib_diag = read_only_load(AFF_diag_i + row + lane); } - ie_diag = __shfl_sync(HYPRE_WARP_FULL_MASK, ib_diag, 1); - ib_diag = __shfl_sync(HYPRE_WARP_FULL_MASK, ib_diag, 0); + ie_diag = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, ib_diag, 1); + ib_diag = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, ib_diag, 0); HYPRE_Complex rl = 0.0; - for (HYPRE_Int i = ib_diag + lane; __any_sync(HYPRE_WARP_FULL_MASK, i < ie_diag); i += HYPRE_WARP_SIZE) + for (HYPRE_Int i = ib_diag + lane; warp_any_sync(item, HYPRE_WARP_FULL_MASK, i < ie_diag); + i += HYPRE_WARP_SIZE) { if (i < ie_diag) { @@ -602,16 +748,17 @@ void hypreCUDAKernel_MMInterpScaleAFF( HYPRE_Int AFF_nrows, } } - HYPRE_Int ib_offd, ie_offd; + HYPRE_Int ib_offd = 0, ie_offd; if (lane < 2) { ib_offd = read_only_load(AFF_offd_i + row + lane); } - ie_offd = __shfl_sync(HYPRE_WARP_FULL_MASK, ib_offd, 1); - ib_offd = __shfl_sync(HYPRE_WARP_FULL_MASK, ib_offd, 0); + ie_offd = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, ib_offd, 1); + ib_offd = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, ib_offd, 0); - for (HYPRE_Int i = ib_offd + lane; __any_sync(HYPRE_WARP_FULL_MASK, i < ie_offd); i += HYPRE_WARP_SIZE) + for (HYPRE_Int i = ib_offd + lane; warp_any_sync(item, HYPRE_WARP_FULL_MASK, i < ie_offd); + i += HYPRE_WARP_SIZE) { if (i < ie_offd) { @@ -631,7 +778,7 @@ void hypreCUDAKernel_MMInterpScaleAFF( HYPRE_Int AFF_nrows, } } - rl = warp_reduce_sum(rl); + rl = warp_reduce_sum(item, rl); if (lane == 0) { @@ -639,9 +786,10 @@ void hypreCUDAKernel_MMInterpScaleAFF( HYPRE_Int AFF_nrows, rl = rl == 0.0 ? 0.0 : -1.0 / rl; } - rl = __shfl_sync(HYPRE_WARP_FULL_MASK, rl, 0); + rl = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, rl, 0); - for (HYPRE_Int i = ib_diag + lane; __any_sync(HYPRE_WARP_FULL_MASK, i < ie_diag); i += HYPRE_WARP_SIZE) + for (HYPRE_Int i = ib_diag + lane; warp_any_sync(item, HYPRE_WARP_FULL_MASK, i < ie_diag); + i += HYPRE_WARP_SIZE) { if (i < ie_diag) { @@ -649,7 +797,8 @@ void hypreCUDAKernel_MMInterpScaleAFF( HYPRE_Int AFF_nrows, } } - for (HYPRE_Int i = ib_offd + lane; __any_sync(HYPRE_WARP_FULL_MASK, i < ie_offd); i += HYPRE_WARP_SIZE) + for (HYPRE_Int i = ib_offd + lane; warp_any_sync(item, HYPRE_WARP_FULL_MASK, i < ie_offd); + i += HYPRE_WARP_SIZE) { if (i < ie_offd) { @@ -660,47 +809,49 @@ void hypreCUDAKernel_MMInterpScaleAFF( HYPRE_Int AFF_nrows, //----------------------------------------------------------------------- __global__ -void hypreCUDAKernel_MMPEInterpScaleAFF( HYPRE_Int AFF_nrows, - HYPRE_Int *AFF_diag_i, - HYPRE_Int *AFF_diag_j, - HYPRE_Complex *AFF_diag_a, - HYPRE_Int *AFF_offd_i, - HYPRE_Int *AFF_offd_j, - HYPRE_Complex *AFF_offd_a, - HYPRE_Complex *tmp_diag, - HYPRE_Complex *tmp_offd, - HYPRE_Complex *lam_diag, - HYPRE_Complex *lam_offd, - HYPRE_Int *F2_to_F, - HYPRE_Real *rsW ) +void hypreGPUKernel_MMPEInterpScaleAFF( hypre_DeviceItem &item, + HYPRE_Int AFF_nrows, + HYPRE_Int *AFF_diag_i, + HYPRE_Int *AFF_diag_j, + HYPRE_Complex *AFF_diag_a, + HYPRE_Int *AFF_offd_i, + HYPRE_Int *AFF_offd_j, + HYPRE_Complex *AFF_offd_a, + HYPRE_Complex *tmp_diag, + HYPRE_Complex *tmp_offd, + HYPRE_Complex *lam_diag, + HYPRE_Complex *lam_offd, + HYPRE_Int *F2_to_F, + HYPRE_Real *rsW ) { - HYPRE_Int row = hypre_cuda_get_grid_warp_id<1,1>(); + HYPRE_Int row = hypre_gpu_get_grid_warp_id<1, 1>(item); if (row >= AFF_nrows) { return; } - HYPRE_Int lane = hypre_cuda_get_lane_id<1>(); - HYPRE_Int ib_diag, ie_diag; - HYPRE_Int rowF; + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); + HYPRE_Int ib_diag = 0, ie_diag; + HYPRE_Int rowF = 0; if (lane == 0) { rowF = read_only_load(&F2_to_F[row]); } - rowF = __shfl_sync(HYPRE_WARP_FULL_MASK, rowF, 0); + rowF = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, rowF, 0); if (lane < 2) { ib_diag = read_only_load(AFF_diag_i + row + lane); } - ie_diag = __shfl_sync(HYPRE_WARP_FULL_MASK, ib_diag, 1); - ib_diag = __shfl_sync(HYPRE_WARP_FULL_MASK, ib_diag, 0); + ie_diag = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, ib_diag, 1); + ib_diag = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, ib_diag, 0); HYPRE_Complex rl = 0.0; - for (HYPRE_Int i = ib_diag + lane; __any_sync(HYPRE_WARP_FULL_MASK, i < ie_diag); i += HYPRE_WARP_SIZE) + for (HYPRE_Int i = ib_diag + lane; warp_any_sync(item, HYPRE_WARP_FULL_MASK, i < ie_diag); + i += HYPRE_WARP_SIZE) { if (i < ie_diag) { @@ -731,16 +882,17 @@ void hypreCUDAKernel_MMPEInterpScaleAFF( HYPRE_Int AFF_nrows, } } - HYPRE_Int ib_offd, ie_offd; + HYPRE_Int ib_offd = 0, ie_offd; if (lane < 2) { ib_offd = read_only_load(AFF_offd_i + row + lane); } - ie_offd = __shfl_sync(HYPRE_WARP_FULL_MASK, ib_offd, 1); - ib_offd = __shfl_sync(HYPRE_WARP_FULL_MASK, ib_offd, 0); + ie_offd = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, ib_offd, 1); + ib_offd = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, ib_offd, 0); - for (HYPRE_Int i = ib_offd + lane; __any_sync(HYPRE_WARP_FULL_MASK, i < ie_offd); i += HYPRE_WARP_SIZE) + for (HYPRE_Int i = ib_offd + lane; warp_any_sync(item, HYPRE_WARP_FULL_MASK, i < ie_offd); + i += HYPRE_WARP_SIZE) { if (i < ie_offd) { @@ -761,7 +913,7 @@ void hypreCUDAKernel_MMPEInterpScaleAFF( HYPRE_Int AFF_nrows, } } - rl = warp_reduce_sum(rl); + rl = warp_reduce_sum(item, rl); if (lane == 0) { @@ -769,9 +921,10 @@ void hypreCUDAKernel_MMPEInterpScaleAFF( HYPRE_Int AFF_nrows, rl = rl == 0.0 ? 0.0 : -1.0 / rl; } - rl = __shfl_sync(HYPRE_WARP_FULL_MASK, rl, 0); + rl = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, rl, 0); - for (HYPRE_Int i = ib_diag + lane; __any_sync(HYPRE_WARP_FULL_MASK, i < ie_diag); i += HYPRE_WARP_SIZE) + for (HYPRE_Int i = ib_diag + lane; warp_any_sync(item, HYPRE_WARP_FULL_MASK, i < ie_diag); + i += HYPRE_WARP_SIZE) { if (i < ie_diag) { @@ -779,7 +932,8 @@ void hypreCUDAKernel_MMPEInterpScaleAFF( HYPRE_Int AFF_nrows, } } - for (HYPRE_Int i = ib_offd + lane; __any_sync(HYPRE_WARP_FULL_MASK, i < ie_offd); i += HYPRE_WARP_SIZE) + for (HYPRE_Int i = ib_offd + lane; warp_any_sync(item, HYPRE_WARP_FULL_MASK, i < ie_offd); + i += HYPRE_WARP_SIZE) { if (i < ie_offd) { @@ -788,4 +942,4 @@ void hypreCUDAKernel_MMPEInterpScaleAFF( HYPRE_Int AFF_nrows, } } -#endif /* #if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) */ +#endif /* #if defined(HYPRE_USING_GPU) */ diff --git a/external/hypre/src/parcsr_ls/par_add_cycle.c b/external/hypre/src/parcsr_ls/par_add_cycle.c index cabf0be9..265adbbd 100644 --- a/external/hypre/src/parcsr_ls/par_add_cycle.c +++ b/external/hypre/src/parcsr_ls/par_add_cycle.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -48,7 +48,7 @@ hypre_BoomerAMGAdditiveCycle( void *amg_vdata) HYPRE_Int n_global; HYPRE_Int rlx_order; - /* Local variables */ + /* Local variables */ HYPRE_Int Solve_err_flag = 0; HYPRE_Int level; HYPRE_Int coarse_grid; @@ -107,8 +107,8 @@ hypre_BoomerAMGAdditiveCycle( void *amg_vdata) addlvl = hypre_max(additive, mult_additive); addlvl = hypre_max(addlvl, simple); - if (add_last_lvl == -1 ) add_end = num_levels-1; - else add_end = add_last_lvl; + if (add_last_lvl == -1 ) { add_end = num_levels - 1; } + else { add_end = add_last_lvl; } Solve_err_flag = 0; /*--------------------------------------------------------------------- @@ -119,7 +119,7 @@ hypre_BoomerAMGAdditiveCycle( void *amg_vdata) rlx_down = grid_relax_type[1]; rlx_up = grid_relax_type[2]; rlx_coarse = grid_relax_type[3]; - for (level = 0; level < num_levels-1; level++) + for (level = 0; level < num_levels - 1; level++) { HYPRE_ANNOTATE_MGLEVEL_BEGIN(level); @@ -141,14 +141,16 @@ hypre_BoomerAMGAdditiveCycle( void *amg_vdata) HYPRE_Real *A_data = hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(A_array[fine_grid])); HYPRE_Int *A_i = hypre_CSRMatrixI(hypre_ParCSRMatrixDiag(A_array[fine_grid])); num_rows = hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(A_array[fine_grid])); - for (j=0; j < num_grid_sweeps[1]; j++) + for (j = 0; j < num_grid_sweeps[1]; j++) { - hypre_ParVectorCopy(F_array[fine_grid],Vtemp); + hypre_ParVectorCopy(F_array[fine_grid], Vtemp); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i = 0; i < num_rows; i++) - u_data[i] = relax_weight[level]*v_data[i] / A_data[A_i[i]]; + for (i = 0; i < num_rows; i++) + { + u_data[i] = relax_weight[level] * v_data[i] / A_data[A_i[i]]; + } } } @@ -156,24 +158,24 @@ hypre_BoomerAMGAdditiveCycle( void *amg_vdata) { /*hypre_BoomerAMGRelax(A_array[fine_grid],F_array[fine_grid],NULL,rlx_down,0,*/ CF_marker = hypre_IntArrayData(CF_marker_array[fine_grid]); - for (j=0; j < num_grid_sweeps[1]; j++) + for (j = 0; j < num_grid_sweeps[1]; j++) { - hypre_BoomerAMGRelaxIF(A_array[fine_grid],F_array[fine_grid], - CF_marker, rlx_down,rlx_order,1, + hypre_BoomerAMGRelaxIF(A_array[fine_grid], F_array[fine_grid], + CF_marker, rlx_down, rlx_order, 1, relax_weight[fine_grid], omega[fine_grid], l1_norms[level] ? hypre_VectorData(l1_norms[level]) : NULL, U_array[fine_grid], Vtemp, Ztemp); - hypre_ParVectorCopy(F_array[fine_grid],Vtemp); + hypre_ParVectorCopy(F_array[fine_grid], Vtemp); } } else { num_rows = hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(A_array[fine_grid])); - for (j=0; j < num_grid_sweeps[1]; j++) + for (j = 0; j < num_grid_sweeps[1]; j++) { - hypre_ParVectorCopy(F_array[fine_grid],Vtemp); + hypre_ParVectorCopy(F_array[fine_grid], Vtemp); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < num_rows; i++) { @@ -185,25 +187,25 @@ hypre_BoomerAMGAdditiveCycle( void *amg_vdata) alpha = -1.0; beta = 1.0; hypre_ParCSRMatrixMatvec(alpha, A_array[fine_grid], U_array[fine_grid], - beta, Vtemp); + beta, Vtemp); alpha = 1.0; beta = 0.0; - hypre_ParCSRMatrixMatvecT(alpha,R_array[fine_grid],Vtemp, - beta,F_array[coarse_grid]); + hypre_ParCSRMatrixMatvecT(alpha, R_array[fine_grid], Vtemp, + beta, F_array[coarse_grid]); } else /* additive version */ { - hypre_ParVectorCopy(F_array[fine_grid],Vtemp); + hypre_ParVectorCopy(F_array[fine_grid], Vtemp); if (level == 0) /* compute residual */ { hypre_ParVectorCopy(Vtemp, Rtilde); - hypre_ParVectorCopy(U_array[fine_grid],Xtilde); + hypre_ParVectorCopy(U_array[fine_grid], Xtilde); } alpha = 1.0; beta = 0.0; - hypre_ParCSRMatrixMatvecT(alpha,R_array[fine_grid],Vtemp, - beta,F_array[coarse_grid]); + hypre_ParCSRMatrixMatvecT(alpha, R_array[fine_grid], Vtemp, + beta, F_array[coarse_grid]); } HYPRE_ANNOTATE_MGLEVEL_END(level); @@ -219,10 +221,12 @@ hypre_BoomerAMGAdditiveCycle( void *amg_vdata) r_global = hypre_VectorData(hypre_ParVectorLocalVector(Rtilde)); n_global = hypre_VectorSize(hypre_ParVectorLocalVector(Xtilde)); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i=0; i < n_global; i++) - x_global[i] += D_inv[i]*r_global[i]; + for (i = 0; i < n_global; i++) + { + x_global[i] += D_inv[i] * r_global[i]; + } } else { @@ -235,27 +239,27 @@ hypre_BoomerAMGAdditiveCycle( void *amg_vdata) hypre_ParVectorLocalVector(Tmptilde) = Tmptilde_local; hypre_ParVectorOwnsData(Tmptilde) = 1; hypre_ParCSRMatrixMatvec(1.0, Lambda, Rtilde, 0.0, Tmptilde); - hypre_ParVectorScale(2.0,Rtilde); + hypre_ParVectorScale(2.0, Rtilde); hypre_ParCSRMatrixMatvec(-1.0, Atilde, Tmptilde, 1.0, Rtilde); hypre_ParVectorDestroy(Tmptilde); } hypre_ParCSRMatrixMatvec(1.0, Lambda, Rtilde, 1.0, Xtilde); } - if (addlvl == 0) hypre_ParVectorCopy(Xtilde, U_array[0]); + if (addlvl == 0) { hypre_ParVectorCopy(Xtilde, U_array[0]); } } - if (add_end < num_levels -1) + if (add_end < num_levels - 1) { - fine_grid = num_levels -1; - for (j=0; j < num_grid_sweeps[3]; j++) + fine_grid = num_levels - 1; + for (j = 0; j < num_grid_sweeps[3]; j++) if (rlx_coarse == 18) hypre_ParCSRRelax(A_array[fine_grid], F_array[fine_grid], 1, 1, l1_norms[fine_grid] ? hypre_VectorData(l1_norms[fine_grid]) : NULL, - 1.0, 1.0 ,0,0,0,0, + 1.0, 1.0, 0.0, 0.0, 0, 0.0, U_array[fine_grid], Vtemp, Ztemp); else - hypre_BoomerAMGRelaxIF(A_array[fine_grid],F_array[fine_grid], - NULL, rlx_coarse,0,0, + hypre_BoomerAMGRelaxIF(A_array[fine_grid], F_array[fine_grid], + NULL, rlx_coarse, 0, 0, relax_weight[fine_grid], omega[fine_grid], l1_norms[fine_grid] ? hypre_VectorData(l1_norms[fine_grid]) : NULL, U_array[fine_grid], Vtemp, Ztemp); @@ -263,29 +267,29 @@ hypre_BoomerAMGAdditiveCycle( void *amg_vdata) HYPRE_ANNOTATE_MGLEVEL_END(num_levels - 1); /* up cycle */ - for (level = num_levels-1; level > 0; level--) + for (level = num_levels - 1; level > 0; level--) { HYPRE_ANNOTATE_MGLEVEL_BEGIN(level); fine_grid = level - 1; coarse_grid = level; - if (level <= addlvl || level > add_end+1) /* multiplicative version */ + if (level <= addlvl || level > add_end + 1) /* multiplicative version */ { alpha = 1.0; beta = 1.0; hypre_ParCSRMatrixMatvec(alpha, P_array[fine_grid], - U_array[coarse_grid], - beta, U_array[fine_grid]); + U_array[coarse_grid], + beta, U_array[fine_grid]); if (rlx_up != 18) { /*hypre_BoomerAMGRelax(A_array[fine_grid],F_array[fine_grid],NULL,rlx_up,0,*/ CF_marker = hypre_IntArrayData(CF_marker_array[fine_grid]); - for (j=0; j < num_grid_sweeps[2]; j++) + for (j = 0; j < num_grid_sweeps[2]; j++) { - hypre_BoomerAMGRelaxIF(A_array[fine_grid],F_array[fine_grid], + hypre_BoomerAMGRelaxIF(A_array[fine_grid], F_array[fine_grid], CF_marker, - rlx_up,rlx_order,2, + rlx_up, rlx_order, 2, relax_weight[fine_grid], omega[fine_grid], l1_norms[fine_grid] ? hypre_VectorData(l1_norms[fine_grid]) : NULL, U_array[fine_grid], Vtemp, Ztemp); @@ -297,34 +301,36 @@ hypre_BoomerAMGAdditiveCycle( void *amg_vdata) HYPRE_Int loc_relax_points[2]; loc_relax_points[0] = -1; loc_relax_points[1] = 1; - for (j=0; j < num_grid_sweeps[2]; j++) + for (j = 0; j < num_grid_sweeps[2]; j++) { - for (i=0; i < 2; i++) + for (i = 0; i < 2; i++) { - hypre_ParCSRRelax_L1_Jacobi(A_array[fine_grid],F_array[fine_grid], - CF_marker, - loc_relax_points[i], - 1.0, - l1_norms[fine_grid] ? hypre_VectorData(l1_norms[fine_grid]) : NULL, - U_array[fine_grid], Vtemp); + hypre_ParCSRRelax_L1_Jacobi(A_array[fine_grid], F_array[fine_grid], + CF_marker, + loc_relax_points[i], + 1.0, + l1_norms[fine_grid] ? hypre_VectorData(l1_norms[fine_grid]) : NULL, + U_array[fine_grid], Vtemp); } } } else - for (j=0; j < num_grid_sweeps[2]; j++) - hypre_ParCSRRelax(A_array[fine_grid], F_array[fine_grid], - 1, 1, - l1_norms[fine_grid] ? hypre_VectorData(l1_norms[fine_grid]) : NULL, - 1.0, 1.0 ,0,0,0,0, - U_array[fine_grid], Vtemp, Ztemp); + for (j = 0; j < num_grid_sweeps[2]; j++) + { + hypre_ParCSRRelax(A_array[fine_grid], F_array[fine_grid], + 1, 1, + l1_norms[fine_grid] ? hypre_VectorData(l1_norms[fine_grid]) : NULL, + 1.0, 1.0, 0.0, 0.0, 0, 0.0, + U_array[fine_grid], Vtemp, Ztemp); + } } else /* additive version */ { alpha = 1.0; beta = 1.0; hypre_ParCSRMatrixMatvec(alpha, P_array[fine_grid], - U_array[coarse_grid], - beta, U_array[fine_grid]); + U_array[coarse_grid], + beta, U_array[fine_grid]); } HYPRE_ANNOTATE_MGLEVEL_END(level); @@ -332,7 +338,7 @@ hypre_BoomerAMGAdditiveCycle( void *amg_vdata) HYPRE_ANNOTATE_FUNC_END; - return(Solve_err_flag); + return (Solve_err_flag); } @@ -351,10 +357,10 @@ HYPRE_Int hypre_CreateLambda(void *amg_vdata) hypre_CSRMatrix *L_diag; hypre_CSRMatrix *L_offd; hypre_ParCSRMatrix *Atilde; - hypre_CSRMatrix *Atilde_diag; - hypre_CSRMatrix *Atilde_offd; - HYPRE_Real *Atilde_diag_data; - HYPRE_Real *Atilde_offd_data; + hypre_CSRMatrix *Atilde_diag = NULL; + hypre_CSRMatrix *Atilde_offd = NULL; + HYPRE_Real *Atilde_diag_data = NULL; + HYPRE_Real *Atilde_offd_data = NULL; hypre_CSRMatrix *A_tmp_diag; hypre_CSRMatrix *A_tmp_offd; hypre_ParVector *Xtilde; @@ -364,25 +370,25 @@ HYPRE_Int hypre_CreateLambda(void *amg_vdata) hypre_ParCSRCommPkg *comm_pkg; hypre_ParCSRCommPkg *L_comm_pkg = NULL; hypre_ParCSRCommHandle *comm_handle; - HYPRE_Real *L_diag_data; - HYPRE_Real *L_offd_data; + HYPRE_Real *L_diag_data = NULL; + HYPRE_Real *L_offd_data = NULL; HYPRE_Real *buf_data = NULL; HYPRE_Real *tmp_data; HYPRE_Real *x_data; HYPRE_Real *r_data; hypre_Vector *l1_norms; - HYPRE_Real *A_tmp_diag_data; - HYPRE_Real *A_tmp_offd_data; + HYPRE_Real *A_tmp_diag_data = NULL; + HYPRE_Real *A_tmp_offd_data = NULL; HYPRE_Real *D_data = NULL; HYPRE_Real *D_data_offd = NULL; HYPRE_Int *L_diag_i; - HYPRE_Int *L_diag_j; + HYPRE_Int *L_diag_j = NULL; HYPRE_Int *L_offd_i; - HYPRE_Int *L_offd_j; - HYPRE_Int *Atilde_diag_i; - HYPRE_Int *Atilde_diag_j; - HYPRE_Int *Atilde_offd_i; - HYPRE_Int *Atilde_offd_j; + HYPRE_Int *L_offd_j = NULL; + HYPRE_Int *Atilde_diag_i = NULL; + HYPRE_Int *Atilde_diag_j = NULL; + HYPRE_Int *Atilde_offd_i = NULL; + HYPRE_Int *Atilde_offd_j = NULL; HYPRE_Int *A_tmp_diag_i; HYPRE_Int *A_tmp_offd_i; HYPRE_Int *A_tmp_diag_j; @@ -394,8 +400,8 @@ HYPRE_Int hypre_CreateLambda(void *amg_vdata) HYPRE_Int *L_send_map_elmts = NULL; HYPRE_Int *recv_procs; HYPRE_Int *send_procs; - HYPRE_Int *send_map_elmts; - HYPRE_Int *send_map_starts; + HYPRE_Int *send_map_elmts = NULL; + HYPRE_Int *send_map_starts = NULL; HYPRE_Int *recv_vec_starts; HYPRE_Int *all_send_procs = NULL; HYPRE_Int *all_recv_procs = NULL; @@ -425,7 +431,7 @@ HYPRE_Int hypre_CreateLambda(void *amg_vdata) HYPRE_Int max_sends, max_recvs; HYPRE_Int ns; - /* Local variables */ + /* Local variables */ HYPRE_Int Solve_err_flag = 0; HYPRE_Int num_nonzeros_diag; HYPRE_Int num_nonzeros_offd; @@ -453,16 +459,16 @@ HYPRE_Int hypre_CreateLambda(void *amg_vdata) add_rlx_wt = hypre_ParAMGDataAddRelaxWt(amg_data); ns = hypre_ParAMGDataNumGridSweeps(amg_data)[1]; - hypre_MPI_Comm_size(comm,&num_procs); + hypre_MPI_Comm_size(comm, &num_procs); l1_norms_ptr = hypre_ParAMGDataL1Norms(amg_data); addlvl = hypre_max(additive, mult_additive); - if (add_last_lvl != -1) add_end = add_last_lvl+1; - else add_end = num_levels; - num_add_lvls = add_end+1-addlvl; + if (add_last_lvl != -1) { add_end = add_last_lvl + 1; } + else { add_end = num_levels; } + num_add_lvls = add_end + 1 - addlvl; - level_start = hypre_CTAlloc(HYPRE_Int, num_add_lvls+1, HYPRE_MEMORY_HOST); + level_start = hypre_CTAlloc(HYPRE_Int, num_add_lvls + 1, HYPRE_MEMORY_HOST); send_data_L = 0; num_rows_L = 0; num_cols_offd_L = 0; @@ -472,7 +478,7 @@ HYPRE_Int hypre_CreateLambda(void *amg_vdata) cnt = 1; max_sends = 0; max_recvs = 0; - for (i=addlvl; i < add_end; i++) + for (i = addlvl; i < add_end; i++) { A_tmp = A_array[i]; A_tmp_diag = hypre_ParCSRMatrixDiag(A_tmp); @@ -482,7 +488,7 @@ HYPRE_Int hypre_CreateLambda(void *amg_vdata) num_rows_tmp = hypre_CSRMatrixNumRows(A_tmp_diag); num_cols_offd = hypre_CSRMatrixNumCols(A_tmp_offd); num_rows_L += num_rows_tmp; - level_start[cnt] = level_start[cnt-1] + num_rows_tmp; + level_start[cnt] = level_start[cnt - 1] + num_rows_tmp; cnt++; num_cols_offd_L += num_cols_offd; num_nonzeros_diag += A_tmp_diag_i[num_rows_tmp]; @@ -493,17 +499,19 @@ HYPRE_Int hypre_CreateLambda(void *amg_vdata) num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); max_sends += num_sends; if (num_sends) - send_data_L += hypre_ParCSRCommPkgSendMapStart(comm_pkg,num_sends); + { + send_data_L += hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends); + } max_recvs += hypre_ParCSRCommPkgNumRecvs(comm_pkg); } } - if (max_sends >= num_procs ||max_recvs >= num_procs) + if (max_sends >= num_procs || max_recvs >= num_procs) { - max_sends = num_procs; - max_recvs = num_procs; + max_sends = num_procs; + max_recvs = num_procs; } - if (max_sends) all_send_procs = hypre_CTAlloc(HYPRE_Int, max_sends, HYPRE_MEMORY_HOST); - if (max_recvs) all_recv_procs = hypre_CTAlloc(HYPRE_Int, max_recvs, HYPRE_MEMORY_HOST); + if (max_sends) { all_send_procs = hypre_CTAlloc(HYPRE_Int, max_sends, HYPRE_MEMORY_HOST); } + if (max_recvs) { all_recv_procs = hypre_CTAlloc(HYPRE_Int, max_recvs, HYPRE_MEMORY_HOST); } cnt_send = 0; cnt_recv = 0; @@ -511,7 +519,7 @@ HYPRE_Int hypre_CreateLambda(void *amg_vdata) { if (max_sends < num_procs && max_recvs < num_procs) { - for (i=addlvl; i < add_end; i++) + for (i = addlvl; i < add_end; i++) { A_tmp = A_array[i]; comm_pkg = hypre_ParCSRMatrixCommPkg(A_tmp); @@ -522,17 +530,21 @@ HYPRE_Int hypre_CreateLambda(void *amg_vdata) send_procs = hypre_ParCSRCommPkgSendProcs(comm_pkg); recv_procs = hypre_ParCSRCommPkgRecvProcs(comm_pkg); for (j = 0; j < num_sends; j++) + { all_send_procs[cnt_send++] = send_procs[j]; + } for (j = 0; j < num_recvs; j++) + { all_recv_procs[cnt_recv++] = recv_procs[j]; + } } } if (max_sends) { - hypre_qsort0(all_send_procs, 0, max_sends-1); + hypre_qsort0(all_send_procs, 0, max_sends - 1); num_sends_L = 1; this_proc = all_send_procs[0]; - for (i=1; i < max_sends; i++) + for (i = 1; i < max_sends; i++) { if (all_send_procs[i] > this_proc) { @@ -541,16 +553,18 @@ HYPRE_Int hypre_CreateLambda(void *amg_vdata) } } L_send_procs = hypre_CTAlloc(HYPRE_Int, num_sends_L, HYPRE_MEMORY_HOST); - for (j=0; j < num_sends_L; j++) + for (j = 0; j < num_sends_L; j++) + { L_send_procs[j] = all_send_procs[j]; + } hypre_TFree(all_send_procs, HYPRE_MEMORY_HOST); } if (max_recvs) { - hypre_qsort0(all_recv_procs, 0, max_recvs-1); + hypre_qsort0(all_recv_procs, 0, max_recvs - 1); num_recvs_L = 1; this_proc = all_recv_procs[0]; - for (i=1; i < max_recvs; i++) + for (i = 1; i < max_recvs; i++) { if (all_recv_procs[i] > this_proc) { @@ -559,15 +573,17 @@ HYPRE_Int hypre_CreateLambda(void *amg_vdata) } } L_recv_procs = hypre_CTAlloc(HYPRE_Int, num_recvs_L, HYPRE_MEMORY_HOST); - for (j=0; j < num_recvs_L; j++) + for (j = 0; j < num_recvs_L; j++) + { L_recv_procs[j] = all_recv_procs[j]; + } hypre_TFree(all_recv_procs, HYPRE_MEMORY_HOST); } - L_recv_ptr = hypre_CTAlloc(HYPRE_Int, num_recvs_L+1, HYPRE_MEMORY_HOST); - L_send_ptr = hypre_CTAlloc(HYPRE_Int, num_sends_L+1, HYPRE_MEMORY_HOST); + L_recv_ptr = hypre_CTAlloc(HYPRE_Int, num_recvs_L + 1, HYPRE_MEMORY_HOST); + L_send_ptr = hypre_CTAlloc(HYPRE_Int, num_sends_L + 1, HYPRE_MEMORY_HOST); - for (i=addlvl; i < add_end; i++) + for (i = addlvl; i < add_end; i++) { A_tmp = A_array[i]; comm_pkg = hypre_ParCSRMatrixCommPkg(A_tmp); @@ -587,29 +603,33 @@ HYPRE_Int hypre_CreateLambda(void *amg_vdata) } for (k = 0; k < num_sends; k++) { - this_proc = hypre_BinarySearch(L_send_procs,send_procs[k],num_sends_L); - L_send_ptr[this_proc+1] += send_map_starts[k+1]-send_map_starts[k]; + this_proc = hypre_BinarySearch(L_send_procs, send_procs[k], num_sends_L); + L_send_ptr[this_proc + 1] += send_map_starts[k + 1] - send_map_starts[k]; } for (k = 0; k < num_recvs; k++) { - this_proc = hypre_BinarySearch(L_recv_procs,recv_procs[k],num_recvs_L); - L_recv_ptr[this_proc+1] += recv_vec_starts[k+1]-recv_vec_starts[k]; + this_proc = hypre_BinarySearch(L_recv_procs, recv_procs[k], num_recvs_L); + L_recv_ptr[this_proc + 1] += recv_vec_starts[k + 1] - recv_vec_starts[k]; } } L_recv_ptr[0] = 0; - for (i=1; i < num_recvs_L; i++) - L_recv_ptr[i+1] += L_recv_ptr[i]; + for (i = 1; i < num_recvs_L; i++) + { + L_recv_ptr[i + 1] += L_recv_ptr[i]; + } L_send_ptr[0] = 0; - for (i=1; i < num_sends_L; i++) - L_send_ptr[i+1] += L_send_ptr[i]; + for (i = 1; i < num_sends_L; i++) + { + L_send_ptr[i + 1] += L_send_ptr[i]; + } } else { num_recvs_L = 0; num_sends_L = 0; - for (i=addlvl; i < add_end; i++) + for (i = addlvl; i < add_end; i++) { A_tmp = A_array[i]; comm_pkg = hypre_ParCSRMatrixCommPkg(A_tmp); @@ -625,52 +645,56 @@ HYPRE_Int hypre_CreateLambda(void *amg_vdata) { this_proc = send_procs[j]; if (all_send_procs[this_proc] == 0) + { num_sends_L++; - all_send_procs[this_proc] += send_map_starts[j+1]-send_map_starts[j]; + } + all_send_procs[this_proc] += send_map_starts[j + 1] - send_map_starts[j]; } for (j = 0; j < num_recvs; j++) { this_proc = recv_procs[j]; if (all_recv_procs[this_proc] == 0) + { num_recvs_L++; - all_recv_procs[this_proc] += recv_vec_starts[j+1]-recv_vec_starts[j]; + } + all_recv_procs[this_proc] += recv_vec_starts[j + 1] - recv_vec_starts[j]; } } } if (max_sends) { L_send_procs = hypre_CTAlloc(HYPRE_Int, num_sends_L, HYPRE_MEMORY_HOST); - L_send_ptr = hypre_CTAlloc(HYPRE_Int, num_sends_L+1, HYPRE_MEMORY_HOST); + L_send_ptr = hypre_CTAlloc(HYPRE_Int, num_sends_L + 1, HYPRE_MEMORY_HOST); num_sends_L = 0; - for (j=0; j < num_procs; j++) + for (j = 0; j < num_procs; j++) { this_proc = all_send_procs[j]; if (this_proc) { L_send_procs[num_sends_L++] = j; - L_send_ptr[num_sends_L] = this_proc + L_send_ptr[num_sends_L-1]; + L_send_ptr[num_sends_L] = this_proc + L_send_ptr[num_sends_L - 1]; } } } if (max_recvs) { L_recv_procs = hypre_CTAlloc(HYPRE_Int, num_recvs_L, HYPRE_MEMORY_HOST); - L_recv_ptr = hypre_CTAlloc(HYPRE_Int, num_recvs_L+1, HYPRE_MEMORY_HOST); + L_recv_ptr = hypre_CTAlloc(HYPRE_Int, num_recvs_L + 1, HYPRE_MEMORY_HOST); num_recvs_L = 0; - for (j=0; j < num_procs; j++) + for (j = 0; j < num_procs; j++) { this_proc = all_recv_procs[j]; if (this_proc) { L_recv_procs[num_recvs_L++] = j; - L_recv_ptr[num_recvs_L] = this_proc + L_recv_ptr[num_recvs_L-1]; + L_recv_ptr[num_recvs_L] = this_proc + L_recv_ptr[num_recvs_L - 1]; } } } } } - if (max_sends) hypre_TFree(all_send_procs, HYPRE_MEMORY_HOST); - if (max_recvs) hypre_TFree(all_recv_procs, HYPRE_MEMORY_HOST); + if (max_sends) { hypre_TFree(all_send_procs, HYPRE_MEMORY_HOST); } + if (max_recvs) { hypre_TFree(all_recv_procs, HYPRE_MEMORY_HOST); } L_diag = hypre_CSRMatrixCreate(num_rows_L, num_rows_L, num_nonzeros_diag); L_offd = hypre_CSRMatrixCreate(num_rows_L, num_cols_offd_L, num_nonzeros_offd); @@ -710,7 +734,7 @@ HYPRE_Int hypre_CreateLambda(void *amg_vdata) Atilde_offd_i = hypre_CSRMatrixI(Atilde_offd); } - if (num_rows_L) D_data = hypre_CTAlloc(HYPRE_Real, num_rows_L, HYPRE_MEMORY_HOST); + if (num_rows_L) { D_data = hypre_CTAlloc(HYPRE_Real, num_rows_L, HYPRE_MEMORY_HOST); } if (send_data_L) { L_send_map_elmts = hypre_CTAlloc(HYPRE_Int, send_data_L, HYPRE_MEMORY_HOST); @@ -752,7 +776,7 @@ HYPRE_Int hypre_CreateLambda(void *amg_vdata) Atilde_diag_i[0] = 0; Atilde_offd_i[0] = 0; } - for (level=addlvl; level < add_end; level++) + for (level = addlvl; level < add_end; level++) { row_start = level_start[cnt_level]; if (level != 0) @@ -775,8 +799,8 @@ HYPRE_Int hypre_CreateLambda(void *amg_vdata) } cnt_level++; - start_diag = L_diag_i[cnt_row-1]; - start_offd = L_offd_i[cnt_row-1]; + start_diag = L_diag_i[cnt_row - 1]; + start_offd = L_offd_i[cnt_row - 1]; A_tmp = A_array[level]; A_tmp_diag = hypre_ParCSRMatrixDiag(A_tmp); A_tmp_offd = hypre_ParCSRMatrixOffd(A_tmp); @@ -805,11 +829,11 @@ HYPRE_Int hypre_CreateLambda(void *amg_vdata) } /* Compute new combined communication package */ - for (i=0; i < num_sends; i++) + for (i = 0; i < num_sends; i++) { - this_proc = hypre_BinarySearch(L_send_procs,send_procs[i],num_sends_L); + this_proc = hypre_BinarySearch(L_send_procs, send_procs[i], num_sends_L); indx = L_send_ptr[this_proc]; - for (j=send_map_starts[i]; j < send_map_starts[i+1]; j++) + for (j = send_map_starts[i]; j < send_map_starts[i + 1]; j++) { L_send_map_elmts[indx++] = row_start + send_map_elmts[j]; } @@ -819,9 +843,9 @@ HYPRE_Int hypre_CreateLambda(void *amg_vdata) cnt_map = 0; for (i = 0; i < num_recvs; i++) { - this_proc = hypre_BinarySearch(L_recv_procs,recv_procs[i],num_recvs_L); + this_proc = hypre_BinarySearch(L_recv_procs, recv_procs[i], num_recvs_L); indx = L_recv_ptr[this_proc]; - for (j=recv_vec_starts[i]; j < recv_vec_starts[i+1]; j++) + for (j = recv_vec_starts[i]; j < recv_vec_starts[i + 1]; j++) { remap[cnt_map++] = indx++; } @@ -831,41 +855,41 @@ HYPRE_Int hypre_CreateLambda(void *amg_vdata) /* Compute Lambda */ if (add_rlx == 0) { - /*HYPRE_Real rlx_wt = relax_weight[level];*/ + /*HYPRE_Real rlx_wt = relax_weight[level];*/ #ifdef HYPRE_USING_OPENMP -#pragma omp for private(i) HYPRE_SMP_SCHEDULE + #pragma omp for private(i) HYPRE_SMP_SCHEDULE #endif - for (i=0; i < num_rows_tmp; i++) + for (i = 0; i < num_rows_tmp; i++) { - D_data[i] = add_rlx_wt/A_tmp_diag_data[A_tmp_diag_i[i]]; - L_diag_i[cnt_row+i] = start_diag + A_tmp_diag_i[i+1]; - L_offd_i[cnt_row+i] = start_offd + A_tmp_offd_i[i+1]; + D_data[i] = add_rlx_wt / A_tmp_diag_data[A_tmp_diag_i[i]]; + L_diag_i[cnt_row + i] = start_diag + A_tmp_diag_i[i + 1]; + L_offd_i[cnt_row + i] = start_offd + A_tmp_offd_i[i + 1]; } if (ns > 1) - for (i=0; i < num_rows_tmp; i++) - { - Atilde_diag_i[cnt_row+i] = start_diag + A_tmp_diag_i[i+1]; - Atilde_offd_i[cnt_row+i] = start_offd + A_tmp_offd_i[i+1]; - } + for (i = 0; i < num_rows_tmp; i++) + { + Atilde_diag_i[cnt_row + i] = start_diag + A_tmp_diag_i[i + 1]; + Atilde_offd_i[cnt_row + i] = start_offd + A_tmp_offd_i[i + 1]; + } } else { l1_norms = l1_norms_ptr[level]; #ifdef HYPRE_USING_OPENMP -#pragma omp for private(i) HYPRE_SMP_SCHEDULE + #pragma omp for private(i) HYPRE_SMP_SCHEDULE #endif - for (i=0; i < num_rows_tmp; i++) + for (i = 0; i < num_rows_tmp; i++) { D_data[i] = 1.0 / hypre_VectorData(l1_norms)[i]; - L_diag_i[cnt_row+i] = start_diag + A_tmp_diag_i[i+1]; - L_offd_i[cnt_row+i] = start_offd + A_tmp_offd_i[i+1]; + L_diag_i[cnt_row + i] = start_diag + A_tmp_diag_i[i + 1]; + L_offd_i[cnt_row + i] = start_offd + A_tmp_offd_i[i + 1]; } if (ns > 1) { - for (i=0; i < num_rows_tmp; i++) + for (i = 0; i < num_rows_tmp; i++) { - Atilde_diag_i[cnt_row+i] = start_diag + A_tmp_diag_i[i+1]; - Atilde_offd_i[cnt_row+i] = start_offd + A_tmp_offd_i[i+1]; + Atilde_diag_i[cnt_row + i] = start_diag + A_tmp_diag_i[i + 1]; + Atilde_offd_i[cnt_row + i] = start_offd + A_tmp_offd_i[i + 1]; } } } @@ -873,15 +897,17 @@ HYPRE_Int hypre_CreateLambda(void *amg_vdata) if (num_procs > 1) { index = 0; - for (i=0; i < num_sends; i++) + for (i = 0; i < num_sends; i++) { start = send_map_starts[i]; - for (j=start; j < send_map_starts[i+1]; j++) - buf_data[index++] = D_data[send_map_elmts[j]]; + for (j = start; j < send_map_starts[i + 1]; j++) + { + buf_data[index++] = D_data[send_map_elmts[j]]; + } } comm_handle = hypre_ParCSRCommHandleCreate(1, comm_pkg, - buf_data, D_data_offd); + buf_data, D_data_offd); hypre_ParCSRCommHandleDestroy(comm_handle); } @@ -891,31 +917,31 @@ HYPRE_Int hypre_CreateLambda(void *amg_vdata) if (ns > 1) { Atilde_diag_data[A_cnt_diag] = A_tmp_diag_data[j_indx]; - Atilde_diag_j[A_cnt_diag++] = i+row_start; + Atilde_diag_j[A_cnt_diag++] = i + row_start; } - L_diag_data[cnt_diag] = (2.0 - A_tmp_diag_data[j_indx]*D_data[i])*D_data[i]; - L_diag_j[cnt_diag++] = i+row_start; - for (j=A_tmp_diag_i[i]+1; j < A_tmp_diag_i[i+1]; j++) + L_diag_data[cnt_diag] = (2.0 - A_tmp_diag_data[j_indx] * D_data[i]) * D_data[i]; + L_diag_j[cnt_diag++] = i + row_start; + for (j = A_tmp_diag_i[i] + 1; j < A_tmp_diag_i[i + 1]; j++) { - j_indx = A_tmp_diag_j[j]; - L_diag_data[cnt_diag] = (- A_tmp_diag_data[j]*D_data[j_indx])*D_data[i]; - L_diag_j[cnt_diag++] = j_indx+row_start; + j_indx = A_tmp_diag_j[j]; + L_diag_data[cnt_diag] = (- A_tmp_diag_data[j] * D_data[j_indx]) * D_data[i]; + L_diag_j[cnt_diag++] = j_indx + row_start; } - for (j=A_tmp_offd_i[i]; j < A_tmp_offd_i[i+1]; j++) + for (j = A_tmp_offd_i[i]; j < A_tmp_offd_i[i + 1]; j++) { - j_indx = A_tmp_offd_j[j]; - L_offd_data[cnt_offd] = (- A_tmp_offd_data[j]*D_data_offd[j_indx])*D_data[i]; - L_offd_j[cnt_offd++] = remap[j_indx]; + j_indx = A_tmp_offd_j[j]; + L_offd_data[cnt_offd] = (- A_tmp_offd_data[j] * D_data_offd[j_indx]) * D_data[i]; + L_offd_j[cnt_offd++] = remap[j_indx]; } if (ns > 1) { - for (j=A_tmp_diag_i[i]+1; j < A_tmp_diag_i[i+1]; j++) + for (j = A_tmp_diag_i[i] + 1; j < A_tmp_diag_i[i + 1]; j++) { j_indx = A_tmp_diag_j[j]; Atilde_diag_data[A_cnt_diag] = A_tmp_diag_data[j]; - Atilde_diag_j[A_cnt_diag++] = j_indx+row_start; + Atilde_diag_j[A_cnt_diag++] = j_indx + row_start; } - for (j=A_tmp_offd_i[i]; j < A_tmp_offd_i[i+1]; j++) + for (j = A_tmp_offd_i[i]; j < A_tmp_offd_i[i + 1]; j++) { j_indx = A_tmp_offd_j[j]; Atilde_offd_data[A_cnt_offd] = A_tmp_offd_data[j]; @@ -928,35 +954,38 @@ HYPRE_Int hypre_CreateLambda(void *amg_vdata) if (L_send_ptr) { - for (i=num_sends_L-1; i > 0; i--) - L_send_ptr[i] = L_send_ptr[i-1]; + for (i = num_sends_L - 1; i > 0; i--) + { + L_send_ptr[i] = L_send_ptr[i - 1]; + } L_send_ptr[0] = 0; } else + { L_send_ptr = hypre_CTAlloc(HYPRE_Int, 1, HYPRE_MEMORY_HOST); + } if (L_recv_ptr) { - for (i=num_recvs_L-1; i > 0; i--) - L_recv_ptr[i] = L_recv_ptr[i-1]; + for (i = num_recvs_L - 1; i > 0; i--) + { + L_recv_ptr[i] = L_recv_ptr[i - 1]; + } L_recv_ptr[0] = 0; } else + { L_recv_ptr = hypre_CTAlloc(HYPRE_Int, 1, HYPRE_MEMORY_HOST); + } - L_comm_pkg = hypre_CTAlloc(hypre_ParCSRCommPkg, 1, HYPRE_MEMORY_HOST); - - hypre_ParCSRCommPkgNumRecvs(L_comm_pkg) = num_recvs_L; - hypre_ParCSRCommPkgNumSends(L_comm_pkg) = num_sends_L; - hypre_ParCSRCommPkgRecvProcs(L_comm_pkg) = L_recv_procs; - hypre_ParCSRCommPkgSendProcs(L_comm_pkg) = L_send_procs; - hypre_ParCSRCommPkgRecvVecStarts(L_comm_pkg) = L_recv_ptr; - hypre_ParCSRCommPkgSendMapStarts(L_comm_pkg) = L_send_ptr; - hypre_ParCSRCommPkgSendMapElmts(L_comm_pkg) = L_send_map_elmts; - hypre_ParCSRCommPkgComm(L_comm_pkg) = comm; - + /* Create and fill communication package */ + hypre_ParCSRCommPkgCreateAndFill(comm, + num_recvs_L, L_recv_procs, L_recv_ptr, + num_sends_L, L_send_procs, L_send_ptr, + L_send_map_elmts, + &L_comm_pkg); - Lambda = hypre_CTAlloc(hypre_ParCSRMatrix, 1, HYPRE_MEMORY_HOST); + Lambda = hypre_CTAlloc(hypre_ParCSRMatrix, 1, HYPRE_MEMORY_HOST); hypre_ParCSRMatrixDiag(Lambda) = L_diag; hypre_ParCSRMatrixOffd(Lambda) = L_offd; hypre_ParCSRMatrixCommPkg(Lambda) = L_comm_pkg; @@ -965,41 +994,6 @@ HYPRE_Int hypre_CreateLambda(void *amg_vdata) if (ns > 1) { - /*hypre_ParCSRCommPkg *A_comm_pkg = NULL; - HYPRE_Int *A_recv_ptr = NULL; - HYPRE_Int *A_send_ptr = NULL; - HYPRE_Int *A_recv_procs = NULL; - HYPRE_Int *A_send_procs = NULL; - HYPRE_Int *A_send_map_elmts = NULL; - - A_comm_pkg = hypre_CTAlloc(hypre_ParCSRCommPkg, 1, HYPRE_MEMORY_HOST); - - A_recv_ptr = hypre_CTAlloc(HYPRE_Int, num_recvs+1, HYPRE_MEMORY_HOST); - A_send_ptr = hypre_CTAlloc(HYPRE_Int, num_sends+1, HYPRE_MEMORY_HOST); - A_recv_procs = hypre_CTAlloc(HYPRE_Int, num_recvs_L, HYPRE_MEMORY_HOST); - A_send_procs = hypre_CTAlloc(HYPRE_Int, num_sends_L, HYPRE_MEMORY_HOST); - A_send_map_elmts = hypre_CTAlloc(HYPRE_Int, L_send_ptr[num_sends_L], HYPRE_MEMORY_HOST); - - for (i=0; i 1) hypre_TFree(buf_data, HYPRE_MEMORY_HOST); + if (num_procs > 1) { hypre_TFree(buf_data, HYPRE_MEMORY_HOST); } hypre_TFree(remap, HYPRE_MEMORY_HOST); hypre_TFree(buf_data, HYPRE_MEMORY_HOST); hypre_TFree(level_start, HYPRE_MEMORY_HOST); @@ -1054,7 +1048,7 @@ HYPRE_Int hypre_CreateDinv(void *amg_vdata) HYPRE_Real add_rlx_wt; HYPRE_Int add_last_lvl, add_end; - /* Local variables */ + /* Local variables */ HYPRE_Int Solve_err_flag = 0; hypre_Vector **l1_norms_ptr = NULL; @@ -1076,11 +1070,11 @@ HYPRE_Int hypre_CreateDinv(void *amg_vdata) l1_norms_ptr = hypre_ParAMGDataL1Norms(amg_data); /* smooth_option = hypre_ParAMGDataSmoothOption(amg_data); */ - if (add_last_lvl == -1 ) add_end = num_levels; - else add_end = add_last_lvl; + if (add_last_lvl == -1 ) { add_end = num_levels; } + else { add_end = add_last_lvl; } num_rows_L = 0; - for (i=addlvl; i < add_end; i++) + for (i = addlvl; i < add_end; i++) { A_tmp = A_array[i]; A_tmp_diag = hypre_ParCSRMatrixDiag(A_tmp); @@ -1105,7 +1099,7 @@ HYPRE_Int hypre_CreateDinv(void *amg_vdata) D_inv = hypre_CTAlloc(HYPRE_Real, num_rows_L, HYPRE_MEMORY_HOST); l1_start = 0; - for (level=addlvl; level < add_end; level++) + for (level = addlvl; level < add_end; level++) { if (level != 0) { @@ -1136,22 +1130,22 @@ HYPRE_Int hypre_CreateDinv(void *amg_vdata) HYPRE_Int *A_tmp_diag_i = hypre_CSRMatrixI(A_tmp_diag); HYPRE_Real *A_tmp_diag_data = hypre_CSRMatrixData(A_tmp_diag); #ifdef HYPRE_USING_OPENMP -#pragma omp for private(i) HYPRE_SMP_SCHEDULE + #pragma omp for private(i) HYPRE_SMP_SCHEDULE #endif - for (i=0; i < num_rows_tmp; i++) + for (i = 0; i < num_rows_tmp; i++) { - D_inv[l1_start+i] = add_rlx_wt/A_tmp_diag_data[A_tmp_diag_i[i]]; + D_inv[l1_start + i] = add_rlx_wt / A_tmp_diag_data[A_tmp_diag_i[i]]; } } else { l1_norms = l1_norms_ptr[level]; #ifdef HYPRE_USING_OPENMP -#pragma omp for private(i) HYPRE_SMP_SCHEDULE + #pragma omp for private(i) HYPRE_SMP_SCHEDULE #endif - for (i=0; i < num_rows_tmp; i++) + for (i = 0; i < num_rows_tmp; i++) { - D_inv[l1_start+i] = 1.0 / hypre_VectorData(l1_norms)[i]; + D_inv[l1_start + i] = 1.0 / hypre_VectorData(l1_norms)[i]; } } l1_start += num_rows_tmp; diff --git a/external/hypre/src/parcsr_ls/par_amg.c b/external/hypre/src/parcsr_ls/par_amg.c index 501b1c96..b10876e1 100644 --- a/external/hypre/src/parcsr_ls/par_amg.c +++ b/external/hypre/src/parcsr_ls/par_amg.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -12,19 +12,16 @@ *****************************************************************************/ #include "_hypre_parcsr_ls.h" -#include "par_amg.h" -#ifdef HYPRE_USING_DSUPERLU -#include -#include "superlu_ddefs.h" -#endif + /*-------------------------------------------------------------------------- * hypre_BoomerAMGCreate *--------------------------------------------------------------------------*/ void * -hypre_BoomerAMGCreate() +hypre_BoomerAMGCreate( void ) { hypre_ParAMGData *amg_data; + hypre_Solver *base; /* setup params */ HYPRE_Int max_levels; @@ -51,6 +48,7 @@ hypre_BoomerAMGCreate() HYPRE_Int setup_type; HYPRE_Int P_max_elmts; HYPRE_Int num_functions; + HYPRE_Int filter_functions; HYPRE_Int nodal, nodal_levels, nodal_diag; HYPRE_Int keep_same_sign; HYPRE_Int num_paths; @@ -104,7 +102,24 @@ hypre_BoomerAMGCreate() HYPRE_Int ilu_max_row_nnz; HYPRE_Int ilu_max_iter; HYPRE_Real ilu_droptol; + HYPRE_Int ilu_tri_solve; + HYPRE_Int ilu_lower_jacobi_iters; + HYPRE_Int ilu_upper_jacobi_iters; HYPRE_Int ilu_reordering_type; + HYPRE_Int ilu_iter_setup_type; + HYPRE_Int ilu_iter_setup_option; + HYPRE_Int ilu_iter_setup_max_iter; + HYPRE_Real ilu_iter_setup_tolerance; + + HYPRE_Int fsai_algo_type; + HYPRE_Int fsai_local_solve_type; + HYPRE_Int fsai_max_steps; + HYPRE_Int fsai_max_step_size; + HYPRE_Int fsai_max_nnz_row; + HYPRE_Int fsai_num_levels; + HYPRE_Real fsai_threshold; + HYPRE_Int fsai_eig_maxiter; + HYPRE_Real fsai_kap_tolerance; HYPRE_Int cheby_order; HYPRE_Int cheby_eig_est; @@ -126,6 +141,7 @@ hypre_BoomerAMGCreate() /* log info */ HYPRE_Int num_iterations; HYPRE_Int cum_num_iterations; + HYPRE_Real cum_nnz_AP; /* output params */ HYPRE_Int print_level; @@ -136,6 +152,8 @@ hypre_BoomerAMGCreate() char plot_file_name[251] = {0}; + HYPRE_MemoryLocation memory_location = hypre_HandleMemoryLocation(hypre_handle()); + /*----------------------------------------------------------------------- * Setup default values for parameters *-----------------------------------------------------------------------*/ @@ -165,6 +183,7 @@ hypre_BoomerAMGCreate() agg_P_max_elmts = 0; agg_P12_max_elmts = 0; num_functions = 1; + filter_functions = 0; nodal = 0; nodal_levels = max_levels; nodal_diag = 0; @@ -206,7 +225,34 @@ hypre_BoomerAMGCreate() ilu_max_row_nnz = 20; ilu_max_iter = 1; ilu_droptol = 0.01; + ilu_tri_solve = 1; + ilu_lower_jacobi_iters = 5; + ilu_upper_jacobi_iters = 5; ilu_reordering_type = 1; + ilu_iter_setup_type = 0; + ilu_iter_setup_option = 10; + ilu_iter_setup_max_iter = 20; + ilu_iter_setup_tolerance = 1.e-3; + + /* FSAI smoother params */ +#if defined (HYPRE_USING_CUDA) || defined (HYPRE_USING_HIP) + if (hypre_GetExecPolicy1(memory_location) == HYPRE_EXEC_DEVICE) + { + fsai_algo_type = 3; + } + else +#endif + { + fsai_algo_type = hypre_NumThreads() > 4 ? 2 : 1; + } + fsai_local_solve_type = 0; + fsai_max_steps = 4; + fsai_max_step_size = 2; + fsai_max_nnz_row = 8; + fsai_num_levels = 1; + fsai_threshold = 0.01; + fsai_eig_maxiter = 5; + fsai_kap_tolerance = 0.001; /* solve params */ min_iter = 0; @@ -244,6 +290,7 @@ hypre_BoomerAMGCreate() /* log info */ num_iterations = 0; cum_num_iterations = 0; + cum_nnz_AP = -1.0; /* output params */ print_level = 0; @@ -258,14 +305,15 @@ hypre_BoomerAMGCreate() keepT = 0; modu_rap = 0; -#if defined(HYPRE_USING_GPU) - keepT = 1; - modu_rap = 1; - coarsen_type = 8; - relax_down = 18; - relax_up = 18; - agg_interp_type = 7; -#endif + if (hypre_GetExecPolicy1(memory_location) == HYPRE_EXEC_DEVICE) + { + keepT = 1; + modu_rap = 1; + coarsen_type = 8; + relax_down = 18; + relax_up = 18; + agg_interp_type = 7; + } HYPRE_ANNOTATE_FUNC_BEGIN; @@ -274,8 +322,15 @@ hypre_BoomerAMGCreate() *-----------------------------------------------------------------------*/ amg_data = hypre_CTAlloc(hypre_ParAMGData, 1, HYPRE_MEMORY_HOST); + base = (hypre_Solver*) amg_data; - hypre_ParAMGDataMemoryLocation(amg_data) = HYPRE_MEMORY_UNDEFINED; + /* Set base solver function pointers */ + hypre_SolverSetup(base) = (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup; + hypre_SolverSolve(base) = (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve; + hypre_SolverDestroy(base) = (HYPRE_PtrToDestroyFcn) HYPRE_BoomerAMGDestroy; + + /* memory location will be reset at the setup */ + hypre_ParAMGDataMemoryLocation(amg_data) = memory_location; hypre_ParAMGDataPartialCycleCoarsestLevel(amg_data) = -1; hypre_ParAMGDataPartialCycleControl(amg_data) = -1; @@ -306,6 +361,7 @@ hypre_BoomerAMGCreate() hypre_BoomerAMGSetAggPMaxElmts(amg_data, agg_P_max_elmts); hypre_BoomerAMGSetAggP12MaxElmts(amg_data, agg_P12_max_elmts); hypre_BoomerAMGSetNumFunctions(amg_data, num_functions); + hypre_BoomerAMGSetFilterFunctions(amg_data, filter_functions); hypre_BoomerAMGSetNodal(amg_data, nodal); hypre_BoomerAMGSetNodalLevels(amg_data, nodal_levels); hypre_BoomerAMGSetNodal(amg_data, nodal_diag); @@ -341,8 +397,24 @@ hypre_BoomerAMGCreate() hypre_BoomerAMGSetILULevel(amg_data, ilu_lfil); hypre_BoomerAMGSetILUMaxRowNnz(amg_data, ilu_max_row_nnz); hypre_BoomerAMGSetILUDroptol(amg_data, ilu_droptol); + hypre_BoomerAMGSetILUTriSolve(amg_data, ilu_tri_solve); + hypre_BoomerAMGSetILULowerJacobiIters(amg_data, ilu_lower_jacobi_iters); + hypre_BoomerAMGSetILUUpperJacobiIters(amg_data, ilu_upper_jacobi_iters); hypre_BoomerAMGSetILUMaxIter(amg_data, ilu_max_iter); hypre_BoomerAMGSetILULocalReordering(amg_data, ilu_reordering_type); + hypre_BoomerAMGSetILUIterSetupType(amg_data, ilu_iter_setup_type); + hypre_BoomerAMGSetILUIterSetupOption(amg_data, ilu_iter_setup_option); + hypre_BoomerAMGSetILUIterSetupMaxIter(amg_data, ilu_iter_setup_max_iter); + hypre_BoomerAMGSetILUIterSetupTolerance(amg_data, ilu_iter_setup_tolerance); + hypre_BoomerAMGSetFSAIAlgoType(amg_data, fsai_algo_type); + hypre_BoomerAMGSetFSAILocalSolveType(amg_data, fsai_local_solve_type); + hypre_BoomerAMGSetFSAIMaxSteps(amg_data, fsai_max_steps); + hypre_BoomerAMGSetFSAIMaxStepSize(amg_data, fsai_max_step_size); + hypre_BoomerAMGSetFSAIMaxNnzRow(amg_data, fsai_max_nnz_row); + hypre_BoomerAMGSetFSAINumLevels(amg_data, fsai_num_levels); + hypre_BoomerAMGSetFSAIThreshold(amg_data, fsai_threshold); + hypre_BoomerAMGSetFSAIEigMaxIters(amg_data, fsai_eig_maxiter); + hypre_BoomerAMGSetFSAIKapTolerance(amg_data, fsai_kap_tolerance); hypre_BoomerAMGSetMinIter(amg_data, min_iter); hypre_BoomerAMGSetMaxIter(amg_data, max_iter); @@ -435,7 +507,7 @@ hypre_BoomerAMGCreate() hypre_ParAMGDataCoordDim(amg_data) = 0; hypre_ParAMGDataCoordinates(amg_data) = NULL; - /* for fitting vectors for interp */ + /* for fitting vectors for interp */ hypre_BoomerAMGSetInterpVecVariant(amg_data, 0); hypre_BoomerAMGSetInterpVectors(amg_data, 0, NULL); hypre_ParAMGNumLevelsInterpVectors(amg_data) = max_levels; @@ -458,11 +530,14 @@ hypre_BoomerAMGCreate() hypre_ParAMGDataNewComm(amg_data) = hypre_MPI_COMM_NULL; /* for Gaussian elimination coarse grid solve */ - hypre_ParAMGDataGSSetup(amg_data) = 0; - hypre_ParAMGDataAMat(amg_data) = NULL; - hypre_ParAMGDataAInv(amg_data) = NULL; - hypre_ParAMGDataBVec(amg_data) = NULL; - hypre_ParAMGDataCommInfo(amg_data) = NULL; + hypre_ParAMGDataGSSetup(amg_data) = 0; + hypre_ParAMGDataGEMemoryLocation(amg_data) = HYPRE_MEMORY_UNDEFINED; + hypre_ParAMGDataCommInfo(amg_data) = NULL; + hypre_ParAMGDataAMat(amg_data) = NULL; + hypre_ParAMGDataAWork(amg_data) = NULL; + hypre_ParAMGDataAPiv(amg_data) = NULL; + hypre_ParAMGDataBVec(amg_data) = NULL; + hypre_ParAMGDataUVec(amg_data) = NULL; hypre_ParAMGDataNonGalerkinTol(amg_data) = nongalerkin_tol; hypre_ParAMGDataNonGalTolArray(amg_data) = NULL; @@ -481,6 +556,8 @@ hypre_BoomerAMGCreate() hypre_ParAMGDataIsolatedFPointsMarker(amg_data) = NULL; hypre_ParAMGDataNumIsolatedFPoints(amg_data) = 0; + hypre_ParAMGDataCumNnzAP(amg_data) = cum_nnz_AP; + #ifdef HYPRE_USING_DSUPERLU hypre_ParAMGDataDSLUThreshold(amg_data) = 0; hypre_ParAMGDataDSLUSolver(amg_data) = NULL; @@ -499,333 +576,352 @@ HYPRE_Int hypre_BoomerAMGDestroy( void *data ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; - HYPRE_Int num_levels = hypre_ParAMGDataNumLevels(amg_data); - HYPRE_Int smooth_num_levels = hypre_ParAMGDataSmoothNumLevels(amg_data); - HYPRE_Solver *smoother = hypre_ParAMGDataSmoother(amg_data); - void *amg = hypre_ParAMGDataCoarseSolver(amg_data); - MPI_Comm new_comm = hypre_ParAMGDataNewComm(amg_data); - HYPRE_Int i; - HYPRE_Int *grid_relax_type = hypre_ParAMGDataGridRelaxType(amg_data); HYPRE_ANNOTATE_FUNC_BEGIN; + if (amg_data) + { + HYPRE_Int num_levels = hypre_ParAMGDataNumLevels(amg_data); + HYPRE_Int smooth_num_levels = hypre_ParAMGDataSmoothNumLevels(amg_data); + HYPRE_Solver *smoother = hypre_ParAMGDataSmoother(amg_data); + void *amg = hypre_ParAMGDataCoarseSolver(amg_data); + MPI_Comm new_comm = hypre_ParAMGDataNewComm(amg_data); + HYPRE_Int *grid_relax_type = hypre_ParAMGDataGridRelaxType(amg_data); + HYPRE_Int i; + HYPRE_MemoryLocation memory_location = hypre_ParAMGDataMemoryLocation(amg_data); #ifdef HYPRE_USING_DSUPERLU -// if (hypre_ParAMGDataDSLUThreshold(amg_data) > 0) - if (hypre_ParAMGDataDSLUSolver(amg_data) != NULL) - { - hypre_SLUDistDestroy(hypre_ParAMGDataDSLUSolver(amg_data)); - hypre_ParAMGDataDSLUSolver(amg_data) = NULL; - } + // if (hypre_ParAMGDataDSLUThreshold(amg_data) > 0) + if (hypre_ParAMGDataDSLUSolver(amg_data) != NULL) + { + hypre_SLUDistDestroy(hypre_ParAMGDataDSLUSolver(amg_data)); + hypre_ParAMGDataDSLUSolver(amg_data) = NULL; + } #endif - if (hypre_ParAMGDataMaxEigEst(amg_data)) - { - hypre_TFree(hypre_ParAMGDataMaxEigEst(amg_data), HYPRE_MEMORY_HOST); - hypre_ParAMGDataMaxEigEst(amg_data) = NULL; - } - if (hypre_ParAMGDataMinEigEst(amg_data)) - { - hypre_TFree(hypre_ParAMGDataMinEigEst(amg_data), HYPRE_MEMORY_HOST); - hypre_ParAMGDataMinEigEst(amg_data) = NULL; - } - if (hypre_ParAMGDataNumGridSweeps(amg_data)) - { - hypre_TFree(hypre_ParAMGDataNumGridSweeps(amg_data), HYPRE_MEMORY_HOST); - hypre_ParAMGDataNumGridSweeps(amg_data) = NULL; - } - if (grid_relax_type) - { - HYPRE_Int num_levels = hypre_ParAMGDataNumLevels(amg_data); - if (grid_relax_type[1] == 15 || grid_relax_type[3] == 15 ) + if (hypre_ParAMGDataMaxEigEst(amg_data)) + { + hypre_TFree(hypre_ParAMGDataMaxEigEst(amg_data), HYPRE_MEMORY_HOST); + hypre_ParAMGDataMaxEigEst(amg_data) = NULL; + } + if (hypre_ParAMGDataMinEigEst(amg_data)) + { + hypre_TFree(hypre_ParAMGDataMinEigEst(amg_data), HYPRE_MEMORY_HOST); + hypre_ParAMGDataMinEigEst(amg_data) = NULL; + } + if (hypre_ParAMGDataNumGridSweeps(amg_data)) { - if (grid_relax_type[1] == 15) - for (i=0; i < num_levels; i++) - HYPRE_ParCSRPCGDestroy(smoother[i]); - if (grid_relax_type[3] == 15 && grid_relax_type[1] != 15) - HYPRE_ParCSRPCGDestroy(smoother[num_levels-1]); - hypre_TFree(smoother, HYPRE_MEMORY_HOST); + hypre_TFree(hypre_ParAMGDataNumGridSweeps(amg_data), HYPRE_MEMORY_HOST); + hypre_ParAMGDataNumGridSweeps(amg_data) = NULL; } + if (grid_relax_type) + { + HYPRE_Int num_levels = hypre_ParAMGDataNumLevels(amg_data); + if (grid_relax_type[1] == 15 || grid_relax_type[3] == 15 ) + { + if (grid_relax_type[1] == 15) + { + for (i = 0; i < num_levels; i++) + { + HYPRE_ParCSRPCGDestroy(smoother[i]); + } + } + if (grid_relax_type[3] == 15 && grid_relax_type[1] != 15) + { + HYPRE_ParCSRPCGDestroy(smoother[num_levels - 1]); + } + hypre_TFree(smoother, HYPRE_MEMORY_HOST); + } - hypre_TFree(hypre_ParAMGDataGridRelaxType(amg_data), HYPRE_MEMORY_HOST); - hypre_ParAMGDataGridRelaxType(amg_data) = NULL; - } - if (hypre_ParAMGDataRelaxWeight(amg_data)) - { - hypre_TFree(hypre_ParAMGDataRelaxWeight(amg_data), HYPRE_MEMORY_HOST); - hypre_ParAMGDataRelaxWeight(amg_data) = NULL; - } - if (hypre_ParAMGDataOmega(amg_data)) - { - hypre_TFree(hypre_ParAMGDataOmega(amg_data), HYPRE_MEMORY_HOST); - hypre_ParAMGDataOmega(amg_data) = NULL; - } - if (hypre_ParAMGDataNonGalTolArray(amg_data)) - { - hypre_TFree(hypre_ParAMGDataNonGalTolArray(amg_data), HYPRE_MEMORY_HOST); - hypre_ParAMGDataNonGalTolArray(amg_data) = NULL; - } - if (hypre_ParAMGDataDofFunc(amg_data)) - { - hypre_IntArrayDestroy(hypre_ParAMGDataDofFunc(amg_data)); - hypre_ParAMGDataDofFunc(amg_data) = NULL; - } - for (i=1; i < num_levels; i++) - { - hypre_ParVectorDestroy(hypre_ParAMGDataFArray(amg_data)[i]); - hypre_ParVectorDestroy(hypre_ParAMGDataUArray(amg_data)[i]); + hypre_TFree(hypre_ParAMGDataGridRelaxType(amg_data), HYPRE_MEMORY_HOST); + hypre_ParAMGDataGridRelaxType(amg_data) = NULL; + } + if (hypre_ParAMGDataRelaxWeight(amg_data)) + { + hypre_TFree(hypre_ParAMGDataRelaxWeight(amg_data), HYPRE_MEMORY_HOST); + hypre_ParAMGDataRelaxWeight(amg_data) = NULL; + } + if (hypre_ParAMGDataOmega(amg_data)) + { + hypre_TFree(hypre_ParAMGDataOmega(amg_data), HYPRE_MEMORY_HOST); + hypre_ParAMGDataOmega(amg_data) = NULL; + } + if (hypre_ParAMGDataNonGalTolArray(amg_data)) + { + hypre_TFree(hypre_ParAMGDataNonGalTolArray(amg_data), HYPRE_MEMORY_HOST); + hypre_ParAMGDataNonGalTolArray(amg_data) = NULL; + } + if (hypre_ParAMGDataDofFunc(amg_data)) + { + hypre_IntArrayDestroy(hypre_ParAMGDataDofFunc(amg_data)); + hypre_ParAMGDataDofFunc(amg_data) = NULL; + } + for (i = 1; i < num_levels; i++) + { + hypre_ParVectorDestroy(hypre_ParAMGDataFArray(amg_data)[i]); + hypre_ParVectorDestroy(hypre_ParAMGDataUArray(amg_data)[i]); - if (hypre_ParAMGDataAArray(amg_data)[i]) - hypre_ParCSRMatrixDestroy(hypre_ParAMGDataAArray(amg_data)[i]); + if (hypre_ParAMGDataAArray(amg_data)[i]) + { + hypre_ParCSRMatrixDestroy(hypre_ParAMGDataAArray(amg_data)[i]); + } - if (hypre_ParAMGDataPArray(amg_data)[i-1]) - hypre_ParCSRMatrixDestroy(hypre_ParAMGDataPArray(amg_data)[i-1]); + if (hypre_ParAMGDataPArray(amg_data)[i - 1]) + { + hypre_ParCSRMatrixDestroy(hypre_ParAMGDataPArray(amg_data)[i - 1]); + } - if (hypre_ParAMGDataRestriction(amg_data)) - { - if (hypre_ParAMGDataRArray(amg_data)[i-1]) + if (hypre_ParAMGDataRestriction(amg_data)) { - hypre_ParCSRMatrixDestroy(hypre_ParAMGDataRArray(amg_data)[i-1]); + if (hypre_ParAMGDataRArray(amg_data)[i - 1]) + { + hypre_ParCSRMatrixDestroy(hypre_ParAMGDataRArray(amg_data)[i - 1]); + } } - } - hypre_IntArrayDestroy(hypre_ParAMGDataCFMarkerArray(amg_data)[i-1]); + hypre_IntArrayDestroy(hypre_ParAMGDataCFMarkerArray(amg_data)[i - 1]); - /* get rid of any block structures */ - if (hypre_ParAMGDataABlockArray(amg_data)[i]) - hypre_ParCSRBlockMatrixDestroy(hypre_ParAMGDataABlockArray(amg_data)[i]); + /* get rid of any block structures */ + if (hypre_ParAMGDataABlockArray(amg_data)[i]) + { + hypre_ParCSRBlockMatrixDestroy(hypre_ParAMGDataABlockArray(amg_data)[i]); + } - if (hypre_ParAMGDataPBlockArray(amg_data)[i-1]) - hypre_ParCSRBlockMatrixDestroy(hypre_ParAMGDataPBlockArray(amg_data)[i-1]); + if (hypre_ParAMGDataPBlockArray(amg_data)[i - 1]) + { + hypre_ParCSRBlockMatrixDestroy(hypre_ParAMGDataPBlockArray(amg_data)[i - 1]); + } - /* RL */ - if (hypre_ParAMGDataRestriction(amg_data)) + /* RL */ + if (hypre_ParAMGDataRestriction(amg_data)) + { + if (hypre_ParAMGDataRBlockArray(amg_data)[i - 1]) + { + hypre_ParCSRBlockMatrixDestroy(hypre_ParAMGDataRBlockArray(amg_data)[i - 1]); + } + } + } + if (hypre_ParAMGDataGridRelaxPoints(amg_data)) { - if (hypre_ParAMGDataRBlockArray(amg_data)[i-1]) + for (i = 0; i < 4; i++) { - hypre_ParCSRBlockMatrixDestroy(hypre_ParAMGDataRBlockArray(amg_data)[i-1]); + hypre_TFree(hypre_ParAMGDataGridRelaxPoints(amg_data)[i], HYPRE_MEMORY_HOST); } + hypre_TFree(hypre_ParAMGDataGridRelaxPoints(amg_data), HYPRE_MEMORY_HOST); + hypre_ParAMGDataGridRelaxPoints(amg_data) = NULL; } - } - if (hypre_ParAMGDataGridRelaxPoints(amg_data)) - { - for (i=0; i < 4; i++) - hypre_TFree(hypre_ParAMGDataGridRelaxPoints(amg_data)[i], HYPRE_MEMORY_HOST); - hypre_TFree(hypre_ParAMGDataGridRelaxPoints(amg_data), HYPRE_MEMORY_HOST); - hypre_ParAMGDataGridRelaxPoints(amg_data) = NULL; - } - if (hypre_ParAMGDataLambda(amg_data)) - { hypre_ParCSRMatrixDestroy(hypre_ParAMGDataLambda(amg_data)); - } - if (hypre_ParAMGDataAtilde(amg_data)) - { - hypre_ParCSRMatrix *Atilde = hypre_ParAMGDataAtilde(amg_data); - hypre_CSRMatrixDestroy(hypre_ParCSRMatrixDiag(Atilde)); - hypre_CSRMatrixDestroy(hypre_ParCSRMatrixOffd(Atilde)); - hypre_TFree(Atilde, HYPRE_MEMORY_HOST); - } + if (hypre_ParAMGDataAtilde(amg_data)) + { + hypre_ParCSRMatrix *Atilde = hypre_ParAMGDataAtilde(amg_data); + hypre_CSRMatrixDestroy(hypre_ParCSRMatrixDiag(Atilde)); + hypre_CSRMatrixDestroy(hypre_ParCSRMatrixOffd(Atilde)); + hypre_TFree(Atilde, HYPRE_MEMORY_HOST); + } - if (hypre_ParAMGDataXtilde(amg_data)) hypre_ParVectorDestroy(hypre_ParAMGDataXtilde(amg_data)); - - if (hypre_ParAMGDataRtilde(amg_data)) hypre_ParVectorDestroy(hypre_ParAMGDataRtilde(amg_data)); - if (hypre_ParAMGDataL1Norms(amg_data)) - { - for (i = 0; i < num_levels; i++) + if (hypre_ParAMGDataL1Norms(amg_data)) { - hypre_SeqVectorDestroy(hypre_ParAMGDataL1Norms(amg_data)[i]); + for (i = 0; i < num_levels; i++) + { + hypre_SeqVectorDestroy(hypre_ParAMGDataL1Norms(amg_data)[i]); + } + hypre_TFree(hypre_ParAMGDataL1Norms(amg_data), HYPRE_MEMORY_HOST); } - hypre_TFree(hypre_ParAMGDataL1Norms(amg_data), HYPRE_MEMORY_HOST); - } - if (hypre_ParAMGDataChebyCoefs(amg_data)) - { - for (i=0; i < num_levels; i++) - if (hypre_ParAMGDataChebyCoefs(amg_data)[i]) - hypre_TFree(hypre_ParAMGDataChebyCoefs(amg_data)[i], HYPRE_MEMORY_HOST); - hypre_TFree(hypre_ParAMGDataChebyCoefs(amg_data), HYPRE_MEMORY_HOST); - } + if (hypre_ParAMGDataChebyCoefs(amg_data)) + { + for (i = 0; i < num_levels; i++) + { + if (hypre_ParAMGDataChebyCoefs(amg_data)[i]) + { + hypre_TFree(hypre_ParAMGDataChebyCoefs(amg_data)[i], HYPRE_MEMORY_HOST); + } + } + hypre_TFree(hypre_ParAMGDataChebyCoefs(amg_data), HYPRE_MEMORY_HOST); + } - if (hypre_ParAMGDataChebyDS(amg_data)) - { - for (i=0; i < num_levels; i++) - hypre_SeqVectorDestroy(hypre_ParAMGDataChebyDS(amg_data)[i]); - hypre_TFree(hypre_ParAMGDataChebyDS(amg_data), HYPRE_MEMORY_HOST); - } + if (hypre_ParAMGDataChebyDS(amg_data)) + { + for (i = 0; i < num_levels; i++) + { + hypre_SeqVectorDestroy(hypre_ParAMGDataChebyDS(amg_data)[i]); + } + hypre_TFree(hypre_ParAMGDataChebyDS(amg_data), HYPRE_MEMORY_HOST); + } - if (hypre_ParAMGDataDinv(amg_data)) hypre_TFree(hypre_ParAMGDataDinv(amg_data), HYPRE_MEMORY_HOST); - /* get rid of a fine level block matrix */ - if (hypre_ParAMGDataABlockArray(amg_data)) - if (hypre_ParAMGDataABlockArray(amg_data)[0]) - hypre_ParCSRBlockMatrixDestroy(hypre_ParAMGDataABlockArray(amg_data)[0]); - + /* get rid of a fine level block matrix */ + if (hypre_ParAMGDataABlockArray(amg_data)) + { + if (hypre_ParAMGDataABlockArray(amg_data)[0]) + { + hypre_ParCSRBlockMatrixDestroy(hypre_ParAMGDataABlockArray(amg_data)[0]); + } + } - /* see comments in par_coarsen.c regarding special case for CF_marker */ - if (num_levels == 1) - { - hypre_IntArrayDestroy(hypre_ParAMGDataCFMarkerArray(amg_data)[0]); - } - hypre_ParVectorDestroy(hypre_ParAMGDataVtemp(amg_data)); - hypre_TFree(hypre_ParAMGDataFArray(amg_data), HYPRE_MEMORY_HOST); - hypre_TFree(hypre_ParAMGDataUArray(amg_data), HYPRE_MEMORY_HOST); - hypre_TFree(hypre_ParAMGDataAArray(amg_data), HYPRE_MEMORY_HOST); - hypre_TFree(hypre_ParAMGDataABlockArray(amg_data), HYPRE_MEMORY_HOST); - hypre_TFree(hypre_ParAMGDataPBlockArray(amg_data), HYPRE_MEMORY_HOST); - hypre_TFree(hypre_ParAMGDataPArray(amg_data), HYPRE_MEMORY_HOST); - hypre_TFree(hypre_ParAMGDataCFMarkerArray(amg_data), HYPRE_MEMORY_HOST); + /* see comments in par_coarsen.c regarding special case for CF_marker */ + if (num_levels == 1) + { + hypre_IntArrayDestroy(hypre_ParAMGDataCFMarkerArray(amg_data)[0]); + } - if (hypre_ParAMGDataRtemp(amg_data)) + hypre_ParVectorDestroy(hypre_ParAMGDataVtemp(amg_data)); + hypre_TFree(hypre_ParAMGDataFArray(amg_data), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_ParAMGDataUArray(amg_data), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_ParAMGDataAArray(amg_data), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_ParAMGDataABlockArray(amg_data), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_ParAMGDataPBlockArray(amg_data), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_ParAMGDataPArray(amg_data), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_ParAMGDataCFMarkerArray(amg_data), HYPRE_MEMORY_HOST); hypre_ParVectorDestroy(hypre_ParAMGDataRtemp(amg_data)); - if (hypre_ParAMGDataPtemp(amg_data)) hypre_ParVectorDestroy(hypre_ParAMGDataPtemp(amg_data)); - if (hypre_ParAMGDataZtemp(amg_data)) hypre_ParVectorDestroy(hypre_ParAMGDataZtemp(amg_data)); - if (hypre_ParAMGDataDofFuncArray(amg_data)) - { - for (i=1; i < num_levels; i++) - hypre_IntArrayDestroy(hypre_ParAMGDataDofFuncArray(amg_data)[i]); - hypre_TFree(hypre_ParAMGDataDofFuncArray(amg_data), HYPRE_MEMORY_HOST); - hypre_ParAMGDataDofFuncArray(amg_data) = NULL; - } - if (hypre_ParAMGDataRestriction(amg_data)) - { - hypre_TFree(hypre_ParAMGDataRBlockArray(amg_data),HYPRE_MEMORY_HOST); - hypre_TFree(hypre_ParAMGDataRArray(amg_data),HYPRE_MEMORY_HOST); - hypre_ParAMGDataRArray(amg_data) = NULL; - } - if (hypre_ParAMGDataDofPointArray(amg_data)) - { - for (i=0; i < num_levels; i++) - hypre_TFree(hypre_ParAMGDataDofPointArray(amg_data)[i], HYPRE_MEMORY_HOST); - hypre_TFree(hypre_ParAMGDataDofPointArray(amg_data), HYPRE_MEMORY_HOST); - hypre_ParAMGDataDofPointArray(amg_data) = NULL; - } - if (hypre_ParAMGDataPointDofMapArray(amg_data)) - { - for (i=0; i < num_levels; i++) - hypre_TFree(hypre_ParAMGDataPointDofMapArray(amg_data)[i], HYPRE_MEMORY_HOST); - hypre_TFree(hypre_ParAMGDataPointDofMapArray(amg_data), HYPRE_MEMORY_HOST); - hypre_ParAMGDataPointDofMapArray(amg_data) = NULL; - } - - if (smooth_num_levels) - { - if (hypre_ParAMGDataSmoothType(amg_data) == 7 || hypre_ParAMGDataSmoothType(amg_data) == 17) + if (hypre_ParAMGDataDofFuncArray(amg_data)) { - for (i=0; i < smooth_num_levels; i++) + for (i = 1; i < num_levels; i++) { - HYPRE_ParCSRPilutDestroy(smoother[i]); + hypre_IntArrayDestroy(hypre_ParAMGDataDofFuncArray(amg_data)[i]); } + hypre_TFree(hypre_ParAMGDataDofFuncArray(amg_data), HYPRE_MEMORY_HOST); + hypre_ParAMGDataDofFuncArray(amg_data) = NULL; } - else if (hypre_ParAMGDataSmoothType(amg_data) == 8 || hypre_ParAMGDataSmoothType(amg_data) == 18) + if (hypre_ParAMGDataRestriction(amg_data)) { - for (i=0; i < smooth_num_levels; i++) - { - HYPRE_ParCSRParaSailsDestroy(smoother[i]); - } + hypre_TFree(hypre_ParAMGDataRBlockArray(amg_data), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_ParAMGDataRArray(amg_data), HYPRE_MEMORY_HOST); + hypre_ParAMGDataRArray(amg_data) = NULL; } - else if (hypre_ParAMGDataSmoothType(amg_data) == 9 || hypre_ParAMGDataSmoothType(amg_data) == 19 ) + if (hypre_ParAMGDataDofPointArray(amg_data)) { - for (i=0; i < smooth_num_levels; i++) + for (i = 0; i < num_levels; i++) { - HYPRE_EuclidDestroy(smoother[i]); + hypre_TFree(hypre_ParAMGDataDofPointArray(amg_data)[i], HYPRE_MEMORY_HOST); } + hypre_TFree(hypre_ParAMGDataDofPointArray(amg_data), HYPRE_MEMORY_HOST); + hypre_ParAMGDataDofPointArray(amg_data) = NULL; } - else if (hypre_ParAMGDataSmoothType(amg_data) == 5 || hypre_ParAMGDataSmoothType(amg_data) == 15 ) + if (hypre_ParAMGDataPointDofMapArray(amg_data)) { - for (i=0; i < smooth_num_levels; i++) + for (i = 0; i < num_levels; i++) { - HYPRE_ILUDestroy(smoother[i]); + hypre_TFree(hypre_ParAMGDataPointDofMapArray(amg_data)[i], HYPRE_MEMORY_HOST); } + hypre_TFree(hypre_ParAMGDataPointDofMapArray(amg_data), HYPRE_MEMORY_HOST); + hypre_ParAMGDataPointDofMapArray(amg_data) = NULL; } - else if (hypre_ParAMGDataSmoothType(amg_data) == 6 || hypre_ParAMGDataSmoothType(amg_data) == 16) + + if (smooth_num_levels) { - for (i=0; i < smooth_num_levels; i++) + if ( hypre_ParAMGDataSmoothType(amg_data) == 7 || + hypre_ParAMGDataSmoothType(amg_data) == 17 ) + { + for (i = 0; i < smooth_num_levels; i++) + { + HYPRE_ParCSRPilutDestroy(smoother[i]); + } + } + else if ( hypre_ParAMGDataSmoothType(amg_data) == 8 || + hypre_ParAMGDataSmoothType(amg_data) == 18 ) + { + for (i = 0; i < smooth_num_levels; i++) + { + HYPRE_ParCSRParaSailsDestroy(smoother[i]); + } + } + else if ( hypre_ParAMGDataSmoothType(amg_data) == 9 || + hypre_ParAMGDataSmoothType(amg_data) == 19 ) + { + for (i = 0; i < smooth_num_levels; i++) + { + HYPRE_EuclidDestroy(smoother[i]); + } + } + else if ( hypre_ParAMGDataSmoothType(amg_data) == 4 ) + { + for (i = 0; i < smooth_num_levels; i++) + { + HYPRE_FSAIDestroy(smoother[i]); + } + } + else if ( hypre_ParAMGDataSmoothType(amg_data) == 5 || + hypre_ParAMGDataSmoothType(amg_data) == 15 ) + { + for (i = 0; i < smooth_num_levels; i++) + { + HYPRE_ILUDestroy(smoother[i]); + } + } + else if ( hypre_ParAMGDataSmoothType(amg_data) == 6 || + hypre_ParAMGDataSmoothType(amg_data) == 16 ) { - HYPRE_SchwarzDestroy(smoother[i]); + for (i = 0; i < smooth_num_levels; i++) + { + HYPRE_SchwarzDestroy(smoother[i]); + } } + hypre_TFree(hypre_ParAMGDataSmoother(amg_data), HYPRE_MEMORY_HOST); } - hypre_TFree(hypre_ParAMGDataSmoother(amg_data), HYPRE_MEMORY_HOST); - } - if ( hypre_ParAMGDataResidual(amg_data) ) { - /* jfp: was... hypre_TFree( hypre_ParAMGDataResidual(amg_data) );*/ - hypre_ParVectorDestroy( hypre_ParAMGDataResidual(amg_data) ); + hypre_ParVectorDestroy(hypre_ParAMGDataResidual(amg_data)); hypre_ParAMGDataResidual(amg_data) = NULL; - } + if ( hypre_ParAMGInterpVecVariant(amg_data) > 0 && + hypre_ParAMGNumInterpVectors(amg_data) > 0) + { + HYPRE_Int num_vecs = hypre_ParAMGNumInterpVectors(amg_data); + hypre_ParVector **sm_vecs; + HYPRE_Int j, num_il; - if (hypre_ParAMGInterpVecVariant(amg_data) > 0 - && hypre_ParAMGNumInterpVectors(amg_data) > 0) - { - - HYPRE_Int j; - HYPRE_Int num_vecs = hypre_ParAMGNumInterpVectors(amg_data); - hypre_ParVector **sm_vecs; - HYPRE_Int num_il; - num_il = hypre_min(hypre_ParAMGNumLevelsInterpVectors(amg_data),num_levels); + num_il = hypre_min(hypre_ParAMGNumLevelsInterpVectors(amg_data), num_levels); - /* don't destroy lev = 0 - this was user input */ - for (i = 1; i< num_il; i++) - { - sm_vecs = hypre_ParAMGInterpVectorsArray(amg_data)[i]; - for (j = 0; j< num_vecs; j++) + /* don't destroy lev = 0 - this was user input */ + for (i = 1; i < num_il; i++) { - hypre_ParVectorDestroy(sm_vecs[j]); + sm_vecs = hypre_ParAMGInterpVectorsArray(amg_data)[i]; + for (j = 0; j < num_vecs; j++) + { + hypre_ParVectorDestroy(sm_vecs[j]); + } + hypre_TFree(sm_vecs, HYPRE_MEMORY_HOST); } - hypre_TFree(sm_vecs, HYPRE_MEMORY_HOST); + hypre_TFree(hypre_ParAMGInterpVectorsArray(amg_data), HYPRE_MEMORY_HOST); } - hypre_TFree( hypre_ParAMGInterpVectorsArray(amg_data), HYPRE_MEMORY_HOST); - } - - if (amg) hypre_BoomerAMGDestroy(amg); - - if (hypre_ParAMGDataACoarse(amg_data)) + hypre_BoomerAMGDestroy(amg); hypre_ParCSRMatrixDestroy(hypre_ParAMGDataACoarse(amg_data)); - - if (hypre_ParAMGDataUCoarse(amg_data)) hypre_ParVectorDestroy(hypre_ParAMGDataUCoarse(amg_data)); - - if (hypre_ParAMGDataFCoarse(amg_data)) hypre_ParVectorDestroy(hypre_ParAMGDataFCoarse(amg_data)); - /* destroy input CF_marker data */ - if (hypre_ParAMGDataCPointsMarker(amg_data)) - { - hypre_TFree(hypre_ParAMGDataCPointsMarker(amg_data), HYPRE_MEMORY_HOST); - } - if (hypre_ParAMGDataCPointsLocalMarker(amg_data)) - { - hypre_TFree(hypre_ParAMGDataCPointsLocalMarker(amg_data), HYPRE_MEMORY_HOST); - } - if (hypre_ParAMGDataFPointsMarker(amg_data)) - { + /* destroy input CF_marker data */ + hypre_TFree(hypre_ParAMGDataCPointsMarker(amg_data), memory_location); + hypre_TFree(hypre_ParAMGDataCPointsLocalMarker(amg_data), memory_location); hypre_TFree(hypre_ParAMGDataFPointsMarker(amg_data), HYPRE_MEMORY_HOST); - } - if (hypre_ParAMGDataIsolatedFPointsMarker(amg_data)) - { hypre_TFree(hypre_ParAMGDataIsolatedFPointsMarker(amg_data), HYPRE_MEMORY_HOST); - } - - if (hypre_ParAMGDataAMat(amg_data)) hypre_TFree(hypre_ParAMGDataAMat(amg_data), HYPRE_MEMORY_HOST); - if (hypre_ParAMGDataAInv(amg_data)) hypre_TFree(hypre_ParAMGDataAInv(amg_data), HYPRE_MEMORY_HOST); - if (hypre_ParAMGDataBVec(amg_data)) hypre_TFree(hypre_ParAMGDataBVec(amg_data), HYPRE_MEMORY_HOST); - if (hypre_ParAMGDataCommInfo(amg_data)) hypre_TFree(hypre_ParAMGDataCommInfo(amg_data), HYPRE_MEMORY_HOST); - if (new_comm != hypre_MPI_COMM_NULL) - { - hypre_MPI_Comm_free (&new_comm); - } + /* Direct solver for the coarsest level */ +#if defined(HYPRE_USING_MAGMA) + hypre_TFree(hypre_ParAMGDataAPiv(amg_data), HYPRE_MEMORY_HOST); +#else + hypre_TFree(hypre_ParAMGDataAPiv(amg_data), hypre_ParAMGDataGEMemoryLocation(amg_data)); +#endif + hypre_TFree(hypre_ParAMGDataAMat(amg_data), hypre_ParAMGDataGEMemoryLocation(amg_data)); + hypre_TFree(hypre_ParAMGDataAWork(amg_data), hypre_ParAMGDataGEMemoryLocation(amg_data)); + hypre_TFree(hypre_ParAMGDataBVec(amg_data), hypre_ParAMGDataGEMemoryLocation(amg_data)); + hypre_TFree(hypre_ParAMGDataUVec(amg_data), hypre_ParAMGDataGEMemoryLocation(amg_data)); + hypre_TFree(hypre_ParAMGDataCommInfo(amg_data), HYPRE_MEMORY_HOST); - hypre_TFree(amg_data, HYPRE_MEMORY_HOST); + if (new_comm != hypre_MPI_COMM_NULL) + { + hypre_MPI_Comm_free(&new_comm); + } + hypre_TFree(amg_data, HYPRE_MEMORY_HOST); + } HYPRE_ANNOTATE_FUNC_END; return hypre_error_flag; @@ -900,7 +996,7 @@ hypre_BoomerAMGSetGMRESSwitchR(void *data, HYPRE_Int hypre_BoomerAMGSetMaxLevels( void *data, - HYPRE_Int max_levels ) + HYPRE_Int max_levels ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; HYPRE_Int old_max_levels; @@ -927,8 +1023,10 @@ hypre_BoomerAMGSetMaxLevels( void *data, { relax_wt = hypre_ParAMGDataUserRelaxWeight(amg_data); relax_weight = hypre_TReAlloc(relax_weight, HYPRE_Real, max_levels, HYPRE_MEMORY_HOST); - for (i=old_max_levels; i < max_levels; i++) + for (i = old_max_levels; i < max_levels; i++) + { relax_weight[i] = relax_wt; + } hypre_ParAMGDataRelaxWeight(amg_data) = relax_weight; } omega = hypre_ParAMGDataOmega(amg_data); @@ -936,8 +1034,10 @@ hypre_BoomerAMGSetMaxLevels( void *data, { outer_wt = hypre_ParAMGDataOuterWt(amg_data); omega = hypre_TReAlloc(omega, HYPRE_Real, max_levels, HYPRE_MEMORY_HOST); - for (i=old_max_levels; i < max_levels; i++) + for (i = old_max_levels; i < max_levels; i++) + { omega[i] = outer_wt; + } hypre_ParAMGDataOmega(amg_data) = omega; } nongal_tol_array = hypre_ParAMGDataNonGalTolArray(amg_data); @@ -945,8 +1045,10 @@ hypre_BoomerAMGSetMaxLevels( void *data, { nongalerkin_tol = hypre_ParAMGDataNonGalerkinTol(amg_data); nongal_tol_array = hypre_TReAlloc(nongal_tol_array, HYPRE_Real, max_levels, HYPRE_MEMORY_HOST); - for (i=old_max_levels; i < max_levels; i++) + for (i = old_max_levels; i < max_levels; i++) + { nongal_tol_array[i] = nongalerkin_tol; + } hypre_ParAMGDataNonGalTolArray(amg_data) = nongal_tol_array; } } @@ -974,7 +1076,7 @@ hypre_BoomerAMGGetMaxLevels( void *data, HYPRE_Int hypre_BoomerAMGSetMaxCoarseSize( void *data, - HYPRE_Int max_coarse_size ) + HYPRE_Int max_coarse_size ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -997,7 +1099,7 @@ hypre_BoomerAMGSetMaxCoarseSize( void *data, HYPRE_Int hypre_BoomerAMGGetMaxCoarseSize( void *data, - HYPRE_Int * max_coarse_size ) + HYPRE_Int * max_coarse_size ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -1014,7 +1116,7 @@ hypre_BoomerAMGGetMaxCoarseSize( void *data, HYPRE_Int hypre_BoomerAMGSetMinCoarseSize( void *data, - HYPRE_Int min_coarse_size ) + HYPRE_Int min_coarse_size ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -1037,7 +1139,7 @@ hypre_BoomerAMGSetMinCoarseSize( void *data, HYPRE_Int hypre_BoomerAMGGetMinCoarseSize( void *data, - HYPRE_Int * min_coarse_size ) + HYPRE_Int * min_coarse_size ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -1054,7 +1156,7 @@ hypre_BoomerAMGGetMinCoarseSize( void *data, HYPRE_Int hypre_BoomerAMGSetSeqThreshold( void *data, - HYPRE_Int seq_threshold ) + HYPRE_Int seq_threshold ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -1077,7 +1179,7 @@ hypre_BoomerAMGSetSeqThreshold( void *data, HYPRE_Int hypre_BoomerAMGGetSeqThreshold( void *data, - HYPRE_Int * seq_threshold ) + HYPRE_Int * seq_threshold ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -1094,7 +1196,7 @@ hypre_BoomerAMGGetSeqThreshold( void *data, HYPRE_Int hypre_BoomerAMGSetRedundant( void *data, - HYPRE_Int redundant ) + HYPRE_Int redundant ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -1174,7 +1276,7 @@ hypre_BoomerAMGGetCoarsenCutFactor( void *data, HYPRE_Int hypre_BoomerAMGSetStrongThreshold( void *data, - HYPRE_Real strong_threshold ) + HYPRE_Real strong_threshold ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -1197,7 +1299,7 @@ hypre_BoomerAMGSetStrongThreshold( void *data, HYPRE_Int hypre_BoomerAMGGetStrongThreshold( void *data, - HYPRE_Real * strong_threshold ) + HYPRE_Real * strong_threshold ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -1311,7 +1413,7 @@ hypre_BoomerAMGSetSabs( void *data, HYPRE_Int hypre_BoomerAMGSetMaxRowSum( void *data, - HYPRE_Real max_row_sum ) + HYPRE_Real max_row_sum ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -1334,7 +1436,7 @@ hypre_BoomerAMGSetMaxRowSum( void *data, HYPRE_Int hypre_BoomerAMGGetMaxRowSum( void *data, - HYPRE_Real * max_row_sum ) + HYPRE_Real * max_row_sum ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -1351,7 +1453,7 @@ hypre_BoomerAMGGetMaxRowSum( void *data, HYPRE_Int hypre_BoomerAMGSetTruncFactor( void *data, - HYPRE_Real trunc_factor ) + HYPRE_Real trunc_factor ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -1374,7 +1476,7 @@ hypre_BoomerAMGSetTruncFactor( void *data, HYPRE_Int hypre_BoomerAMGGetTruncFactor( void *data, - HYPRE_Real * trunc_factor ) + HYPRE_Real * trunc_factor ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -1391,7 +1493,7 @@ hypre_BoomerAMGGetTruncFactor( void *data, HYPRE_Int hypre_BoomerAMGSetPMaxElmts( void *data, - HYPRE_Int P_max_elmts ) + HYPRE_Int P_max_elmts ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -1414,7 +1516,7 @@ hypre_BoomerAMGSetPMaxElmts( void *data, HYPRE_Int hypre_BoomerAMGGetPMaxElmts( void *data, - HYPRE_Int * P_max_elmts ) + HYPRE_Int * P_max_elmts ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -1431,7 +1533,7 @@ hypre_BoomerAMGGetPMaxElmts( void *data, HYPRE_Int hypre_BoomerAMGSetJacobiTruncThreshold( void *data, - HYPRE_Real jacobi_trunc_threshold ) + HYPRE_Real jacobi_trunc_threshold ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -1454,7 +1556,7 @@ hypre_BoomerAMGSetJacobiTruncThreshold( void *data, HYPRE_Int hypre_BoomerAMGGetJacobiTruncThreshold( void *data, - HYPRE_Real * jacobi_trunc_threshold ) + HYPRE_Real * jacobi_trunc_threshold ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -1511,7 +1613,7 @@ hypre_BoomerAMGGetPostInterpType( void *data, HYPRE_Int hypre_BoomerAMGSetInterpType( void *data, - HYPRE_Int interp_type ) + HYPRE_Int interp_type ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -1536,7 +1638,7 @@ hypre_BoomerAMGSetInterpType( void *data, HYPRE_Int hypre_BoomerAMGGetInterpType( void *data, - HYPRE_Int * interp_type ) + HYPRE_Int * interp_type ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -1553,7 +1655,7 @@ hypre_BoomerAMGGetInterpType( void *data, HYPRE_Int hypre_BoomerAMGSetSepWeight( void *data, - HYPRE_Int sep_weight ) + HYPRE_Int sep_weight ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -1570,7 +1672,7 @@ hypre_BoomerAMGSetSepWeight( void *data, HYPRE_Int hypre_BoomerAMGSetMinIter( void *data, - HYPRE_Int min_iter ) + HYPRE_Int min_iter ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -1587,7 +1689,7 @@ hypre_BoomerAMGSetMinIter( void *data, HYPRE_Int hypre_BoomerAMGGetMinIter( void *data, - HYPRE_Int * min_iter ) + HYPRE_Int * min_iter ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -1604,7 +1706,7 @@ hypre_BoomerAMGGetMinIter( void *data, HYPRE_Int hypre_BoomerAMGSetMaxIter( void *data, - HYPRE_Int max_iter ) + HYPRE_Int max_iter ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -1627,7 +1729,7 @@ hypre_BoomerAMGSetMaxIter( void *data, HYPRE_Int hypre_BoomerAMGGetMaxIter( void *data, - HYPRE_Int * max_iter ) + HYPRE_Int * max_iter ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -1644,7 +1746,7 @@ hypre_BoomerAMGGetMaxIter( void *data, HYPRE_Int hypre_BoomerAMGSetCoarsenType( void *data, - HYPRE_Int coarsen_type ) + HYPRE_Int coarsen_type ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -1661,7 +1763,7 @@ hypre_BoomerAMGSetCoarsenType( void *data, HYPRE_Int hypre_BoomerAMGGetCoarsenType( void *data, - HYPRE_Int * coarsen_type ) + HYPRE_Int * coarsen_type ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -1678,7 +1780,7 @@ hypre_BoomerAMGGetCoarsenType( void *data, HYPRE_Int hypre_BoomerAMGSetMeasureType( void *data, - HYPRE_Int measure_type ) + HYPRE_Int measure_type ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -1695,7 +1797,7 @@ hypre_BoomerAMGSetMeasureType( void *data, HYPRE_Int hypre_BoomerAMGGetMeasureType( void *data, - HYPRE_Int * measure_type ) + HYPRE_Int * measure_type ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -1746,7 +1848,7 @@ hypre_BoomerAMGGetSetupType( void *data, HYPRE_Int hypre_BoomerAMGSetCycleType( void *data, - HYPRE_Int cycle_type ) + HYPRE_Int cycle_type ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -1769,7 +1871,7 @@ hypre_BoomerAMGSetCycleType( void *data, HYPRE_Int hypre_BoomerAMGGetCycleType( void *data, - HYPRE_Int * cycle_type ) + HYPRE_Int * cycle_type ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -1888,7 +1990,7 @@ hypre_BoomerAMGSetTol( void *data, HYPRE_Int hypre_BoomerAMGGetTol( void *data, - HYPRE_Real * tol ) + HYPRE_Real * tol ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -1906,7 +2008,7 @@ hypre_BoomerAMGGetTol( void *data, /* The "Get" function for SetNumSweeps is GetCycleNumSweeps. */ HYPRE_Int hypre_BoomerAMGSetNumSweeps( void *data, - HYPRE_Int num_sweeps ) + HYPRE_Int num_sweeps ) { HYPRE_Int i; HYPRE_Int *num_grid_sweeps; @@ -1925,12 +2027,16 @@ hypre_BoomerAMGSetNumSweeps( void *data, } if (hypre_ParAMGDataNumGridSweeps(amg_data) == NULL) - hypre_ParAMGDataNumGridSweeps(amg_data) = hypre_CTAlloc(HYPRE_Int, 4, HYPRE_MEMORY_HOST); + { + hypre_ParAMGDataNumGridSweeps(amg_data) = hypre_CTAlloc(HYPRE_Int, 4, HYPRE_MEMORY_HOST); + } num_grid_sweeps = hypre_ParAMGDataNumGridSweeps(amg_data); - for (i=0; i < 3; i++) + for (i = 0; i < 3; i++) + { num_grid_sweeps[i] = num_sweeps; + } num_grid_sweeps[3] = 1; hypre_ParAMGDataUserNumSweeps(amg_data) = num_sweeps; @@ -1967,10 +2073,12 @@ hypre_BoomerAMGSetCycleNumSweeps( void *data, if (hypre_ParAMGDataNumGridSweeps(amg_data) == NULL) { - num_grid_sweeps = hypre_CTAlloc(HYPRE_Int, 4, HYPRE_MEMORY_HOST); - for (i=0; i < 4; i++) - num_grid_sweeps[i] = 1; - hypre_ParAMGDataNumGridSweeps(amg_data) = num_grid_sweeps; + num_grid_sweeps = hypre_CTAlloc(HYPRE_Int, 4, HYPRE_MEMORY_HOST); + for (i = 0; i < 4; i++) + { + num_grid_sweeps[i] = 1; + } + hypre_ParAMGDataNumGridSweeps(amg_data) = num_grid_sweeps; } hypre_ParAMGDataNumGridSweeps(amg_data)[k] = num_sweeps; @@ -2009,7 +2117,7 @@ hypre_BoomerAMGGetCycleNumSweeps( void *data, HYPRE_Int hypre_BoomerAMGSetNumGridSweeps( void *data, - HYPRE_Int *num_grid_sweeps ) + HYPRE_Int *num_grid_sweeps ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -2025,7 +2133,9 @@ hypre_BoomerAMGSetNumGridSweeps( void *data, } if (hypre_ParAMGDataNumGridSweeps(amg_data)) + { hypre_TFree(hypre_ParAMGDataNumGridSweeps(amg_data), HYPRE_MEMORY_HOST); + } hypre_ParAMGDataNumGridSweeps(amg_data) = num_grid_sweeps; return hypre_error_flag; @@ -2033,7 +2143,7 @@ hypre_BoomerAMGSetNumGridSweeps( void *data, HYPRE_Int hypre_BoomerAMGGetNumGridSweeps( void *data, - HYPRE_Int ** num_grid_sweeps ) + HYPRE_Int ** num_grid_sweeps ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -2050,7 +2160,7 @@ hypre_BoomerAMGGetNumGridSweeps( void *data, /* The "Get" function for SetRelaxType is GetCycleRelaxType. */ HYPRE_Int hypre_BoomerAMGSetRelaxType( void *data, - HYPRE_Int relax_type ) + HYPRE_Int relax_type ) { HYPRE_Int i; HYPRE_Int *grid_relax_type; @@ -2068,11 +2178,15 @@ hypre_BoomerAMGSetRelaxType( void *data, } if (hypre_ParAMGDataGridRelaxType(amg_data) == NULL) - hypre_ParAMGDataGridRelaxType(amg_data) = hypre_CTAlloc(HYPRE_Int, 4, HYPRE_MEMORY_HOST); + { + hypre_ParAMGDataGridRelaxType(amg_data) = hypre_CTAlloc(HYPRE_Int, 4, HYPRE_MEMORY_HOST); + } grid_relax_type = hypre_ParAMGDataGridRelaxType(amg_data); - for (i=0; i < 3; i++) + for (i = 0; i < 3; i++) + { grid_relax_type[i] = relax_type; + } grid_relax_type[3] = 9; hypre_ParAMGDataUserCoarseRelaxType(amg_data) = 9; hypre_ParAMGDataUserRelaxType(amg_data) = relax_type; @@ -2108,7 +2222,7 @@ hypre_BoomerAMGSetCycleRelaxType( void *data, if (hypre_ParAMGDataGridRelaxType(amg_data) == NULL) { grid_relax_type = hypre_CTAlloc(HYPRE_Int, 4, HYPRE_MEMORY_HOST); - for (i=0; i < 3; i++) + for (i = 0; i < 3; i++) { grid_relax_type[i] = 3; } @@ -2188,7 +2302,7 @@ hypre_BoomerAMGGetRelaxOrder( void *data, HYPRE_Int hypre_BoomerAMGSetGridRelaxType( void *data, - HYPRE_Int *grid_relax_type ) + HYPRE_Int *grid_relax_type ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -2204,7 +2318,9 @@ hypre_BoomerAMGSetGridRelaxType( void *data, } if (hypre_ParAMGDataGridRelaxType(amg_data)) + { hypre_TFree(hypre_ParAMGDataGridRelaxType(amg_data), HYPRE_MEMORY_HOST); + } hypre_ParAMGDataGridRelaxType(amg_data) = grid_relax_type; hypre_ParAMGDataUserCoarseRelaxType(amg_data) = grid_relax_type[3]; @@ -2213,7 +2329,7 @@ hypre_BoomerAMGSetGridRelaxType( void *data, HYPRE_Int hypre_BoomerAMGGetGridRelaxType( void *data, - HYPRE_Int ** grid_relax_type ) + HYPRE_Int ** grid_relax_type ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -2229,7 +2345,7 @@ hypre_BoomerAMGGetGridRelaxType( void *data, HYPRE_Int hypre_BoomerAMGSetGridRelaxPoints( void *data, - HYPRE_Int **grid_relax_points ) + HYPRE_Int **grid_relax_points ) { HYPRE_Int i; hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -2247,8 +2363,10 @@ hypre_BoomerAMGSetGridRelaxPoints( void *data, if (hypre_ParAMGDataGridRelaxPoints(amg_data)) { - for (i=0; i < 4; i++) - hypre_TFree(hypre_ParAMGDataGridRelaxPoints(amg_data)[i], HYPRE_MEMORY_HOST); + for (i = 0; i < 4; i++) + { + hypre_TFree(hypre_ParAMGDataGridRelaxPoints(amg_data)[i], HYPRE_MEMORY_HOST); + } hypre_TFree(hypre_ParAMGDataGridRelaxPoints(amg_data), HYPRE_MEMORY_HOST); } hypre_ParAMGDataGridRelaxPoints(amg_data) = grid_relax_points; @@ -2258,7 +2376,7 @@ hypre_BoomerAMGSetGridRelaxPoints( void *data, HYPRE_Int hypre_BoomerAMGGetGridRelaxPoints( void *data, - HYPRE_Int *** grid_relax_points ) + HYPRE_Int *** grid_relax_points ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -2290,7 +2408,9 @@ hypre_BoomerAMGSetRelaxWeight( void *data, } if (hypre_ParAMGDataRelaxWeight(amg_data)) + { hypre_TFree(hypre_ParAMGDataRelaxWeight(amg_data), HYPRE_MEMORY_HOST); + } hypre_ParAMGDataRelaxWeight(amg_data) = relax_weight; return hypre_error_flag; @@ -2327,11 +2447,15 @@ hypre_BoomerAMGSetRelaxWt( void *data, } num_levels = hypre_ParAMGDataMaxLevels(amg_data); if (hypre_ParAMGDataRelaxWeight(amg_data) == NULL) + { hypre_ParAMGDataRelaxWeight(amg_data) = hypre_CTAlloc(HYPRE_Real, num_levels, HYPRE_MEMORY_HOST); + } relax_weight_array = hypre_ParAMGDataRelaxWeight(amg_data); - for (i=0; i < num_levels; i++) + for (i = 0; i < num_levels; i++) + { relax_weight_array[i] = relax_weight; + } hypre_ParAMGDataUserRelaxWeight(amg_data) = relax_weight; @@ -2351,7 +2475,7 @@ hypre_BoomerAMGSetLevelRelaxWt( void *data, return hypre_error_flag; } num_levels = hypre_ParAMGDataMaxLevels(amg_data); - if (level > num_levels-1 || level < 0) + if (level > num_levels - 1 || level < 0) { hypre_error_in_arg(3); return hypre_error_flag; @@ -2359,8 +2483,10 @@ hypre_BoomerAMGSetLevelRelaxWt( void *data, if (hypre_ParAMGDataRelaxWeight(amg_data) == NULL) { hypre_ParAMGDataRelaxWeight(amg_data) = hypre_CTAlloc(HYPRE_Real, num_levels, HYPRE_MEMORY_HOST); - for (i=0; i < num_levels; i++) + for (i = 0; i < num_levels; i++) + { hypre_ParAMGDataRelaxWeight(amg_data)[i] = 1.0; + } } hypre_ParAMGDataRelaxWeight(amg_data)[level] = relax_weight; @@ -2381,7 +2507,7 @@ hypre_BoomerAMGGetLevelRelaxWt( void *data, return hypre_error_flag; } num_levels = hypre_ParAMGDataMaxLevels(amg_data); - if (level > num_levels-1 || level < 0) + if (level > num_levels - 1 || level < 0) { hypre_error_in_arg(3); return hypre_error_flag; @@ -2414,7 +2540,9 @@ hypre_BoomerAMGSetOmega( void *data, return hypre_error_flag; } if (hypre_ParAMGDataOmega(amg_data)) + { hypre_TFree(hypre_ParAMGDataOmega(amg_data), HYPRE_MEMORY_HOST); + } hypre_ParAMGDataOmega(amg_data) = omega; return hypre_error_flag; @@ -2451,11 +2579,15 @@ hypre_BoomerAMGSetOuterWt( void *data, } num_levels = hypre_ParAMGDataMaxLevels(amg_data); if (hypre_ParAMGDataOmega(amg_data) == NULL) + { hypre_ParAMGDataOmega(amg_data) = hypre_CTAlloc(HYPRE_Real, num_levels, HYPRE_MEMORY_HOST); + } omega_array = hypre_ParAMGDataOmega(amg_data); - for (i=0; i < num_levels; i++) + for (i = 0; i < num_levels; i++) + { omega_array[i] = omega; + } hypre_ParAMGDataOuterWt(amg_data) = omega; return hypre_error_flag; @@ -2474,7 +2606,7 @@ hypre_BoomerAMGSetLevelOuterWt( void *data, return hypre_error_flag; } num_levels = hypre_ParAMGDataMaxLevels(amg_data); - if (level > num_levels-1) + if (level > num_levels - 1) { hypre_error_in_arg(3); return hypre_error_flag; @@ -2482,8 +2614,10 @@ hypre_BoomerAMGSetLevelOuterWt( void *data, if (hypre_ParAMGDataOmega(amg_data) == NULL) { hypre_ParAMGDataOmega(amg_data) = hypre_CTAlloc(HYPRE_Real, num_levels, HYPRE_MEMORY_HOST); - for (i=0; i < num_levels; i++) + for (i = 0; i < num_levels; i++) + { hypre_ParAMGDataOmega(amg_data)[i] = 1.0; + } } hypre_ParAMGDataOmega(amg_data)[level] = omega; @@ -2504,7 +2638,7 @@ hypre_BoomerAMGGetLevelOuterWt( void *data, return hypre_error_flag; } num_levels = hypre_ParAMGDataMaxLevels(amg_data); - if (level > num_levels-1) + if (level > num_levels - 1) { hypre_error_in_arg(3); return hypre_error_flag; @@ -2554,7 +2688,7 @@ hypre_BoomerAMGGetSmoothType( void *data, HYPRE_Int hypre_BoomerAMGSetSmoothNumLevels( void *data, - HYPRE_Int smooth_num_levels ) + HYPRE_Int smooth_num_levels ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -2575,7 +2709,7 @@ hypre_BoomerAMGSetSmoothNumLevels( void *data, HYPRE_Int hypre_BoomerAMGGetSmoothNumLevels( void *data, - HYPRE_Int * smooth_num_levels ) + HYPRE_Int * smooth_num_levels ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -2591,7 +2725,7 @@ hypre_BoomerAMGGetSmoothNumLevels( void *data, HYPRE_Int hypre_BoomerAMGSetSmoothNumSweeps( void *data, - HYPRE_Int smooth_num_sweeps ) + HYPRE_Int smooth_num_sweeps ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -2612,7 +2746,7 @@ hypre_BoomerAMGSetSmoothNumSweeps( void *data, HYPRE_Int hypre_BoomerAMGGetSmoothNumSweeps( void *data, - HYPRE_Int * smooth_num_sweeps ) + HYPRE_Int * smooth_num_sweeps ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -2628,7 +2762,7 @@ hypre_BoomerAMGGetSmoothNumSweeps( void *data, HYPRE_Int hypre_BoomerAMGSetLogging( void *data, - HYPRE_Int logging ) + HYPRE_Int logging ) { /* This function should be called before Setup. Logging changes may require allocation or freeing of arrays, which is presently @@ -2650,7 +2784,7 @@ hypre_BoomerAMGSetLogging( void *data, HYPRE_Int hypre_BoomerAMGGetLogging( void *data, - HYPRE_Int * logging ) + HYPRE_Int * logging ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -2666,7 +2800,7 @@ hypre_BoomerAMGGetLogging( void *data, HYPRE_Int hypre_BoomerAMGSetPrintLevel( void *data, - HYPRE_Int print_level ) + HYPRE_Int print_level ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -2682,7 +2816,7 @@ hypre_BoomerAMGSetPrintLevel( void *data, HYPRE_Int hypre_BoomerAMGGetPrintLevel( void *data, - HYPRE_Int * print_level ) + HYPRE_Int * print_level ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -2698,7 +2832,7 @@ hypre_BoomerAMGGetPrintLevel( void *data, HYPRE_Int hypre_BoomerAMGSetPrintFileName( void *data, - const char *print_file_name ) + const char *print_file_name ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*)data; if (!amg_data) @@ -2735,7 +2869,7 @@ hypre_BoomerAMGGetPrintFileName( void *data, HYPRE_Int hypre_BoomerAMGSetNumIterations( void *data, - HYPRE_Int num_iterations ) + HYPRE_Int num_iterations ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -2751,7 +2885,7 @@ hypre_BoomerAMGSetNumIterations( void *data, HYPRE_Int hypre_BoomerAMGSetDebugFlag( void *data, - HYPRE_Int debug_flag ) + HYPRE_Int debug_flag ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -2767,7 +2901,7 @@ hypre_BoomerAMGSetDebugFlag( void *data, HYPRE_Int hypre_BoomerAMGGetDebugFlag( void *data, - HYPRE_Int * debug_flag ) + HYPRE_Int * debug_flag ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -2807,7 +2941,7 @@ hypre_BoomerAMGSetGSMG( void *data, HYPRE_Int hypre_BoomerAMGSetNumSamples( void *data, - HYPRE_Int par ) + HYPRE_Int par ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -2827,28 +2961,28 @@ HYPRE_Int hypre_BoomerAMGSetCGCIts( void *data, HYPRE_Int its) { - HYPRE_Int ierr = 0; - hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; + HYPRE_Int ierr = 0; + hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; - hypre_ParAMGDataCGCIts(amg_data) = its; - return (ierr); + hypre_ParAMGDataCGCIts(amg_data) = its; + return (ierr); } /* BM Oct 22, 2006 */ HYPRE_Int hypre_BoomerAMGSetPlotGrids( void *data, - HYPRE_Int plotgrids) + HYPRE_Int plotgrids) { - HYPRE_Int ierr = 0; - hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; + HYPRE_Int ierr = 0; + hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; - hypre_ParAMGDataPlotGrids(amg_data) = plotgrids; - return (ierr); + hypre_ParAMGDataPlotGrids(amg_data) = plotgrids; + return (ierr); } HYPRE_Int hypre_BoomerAMGSetPlotFileName( void *data, - const char *plot_file_name ) + const char *plot_file_name ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; if (!amg_data) @@ -2856,15 +2990,19 @@ hypre_BoomerAMGSetPlotFileName( void *data, hypre_error_in_arg(1); return hypre_error_flag; } - if ( strlen(plot_file_name)>251 ) + if ( strlen(plot_file_name) > 251 ) { hypre_error_in_arg(2); return hypre_error_flag; } - if (strlen(plot_file_name)==0 ) - hypre_sprintf(hypre_ParAMGDataPlotFileName(amg_data), "%s", "AMGgrids.CF.dat"); + if (strlen(plot_file_name) == 0 ) + { + hypre_sprintf(hypre_ParAMGDataPlotFileName(amg_data), "%s", "AMGgrids.CF.dat"); + } else - hypre_sprintf(hypre_ParAMGDataPlotFileName(amg_data), "%s", plot_file_name); + { + hypre_sprintf(hypre_ParAMGDataPlotFileName(amg_data), "%s", plot_file_name); + } return hypre_error_flag; } @@ -2874,7 +3012,7 @@ hypre_BoomerAMGSetPlotFileName( void *data, */ HYPRE_Int hypre_BoomerAMGGetGridHierarchy( void *data, - HYPRE_Int *cgrid ) + HYPRE_Int *cgrid ) { HYPRE_Int *ibuff = NULL; HYPRE_Int *wbuff, *cbuff, *tmp; @@ -2897,13 +3035,13 @@ hypre_BoomerAMGGetGridHierarchy( void *data, block_mode = hypre_ParAMGDataBlockMode(amg_data); - if( block_mode) + if ( block_mode) { hypre_ParCSRBlockMatrix **A_block_array; A_block_array = hypre_ParAMGDataABlockArray(amg_data); - if(A_block_array == NULL) + if (A_block_array == NULL) { - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Invalid AMG data. AMG setup has not been called!!\n"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Invalid AMG data. AMG setup has not been called!!\n"); return hypre_error_flag; } @@ -2918,7 +3056,8 @@ hypre_BoomerAMGGetGridHierarchy( void *data, { /* get the CF marker array on the host */ CF_marker_array = hypre_ParAMGDataCFMarkerArray(amg_data)[level]; - if (hypre_GetActualMemLocation(hypre_IntArrayMemoryLocation(CF_marker_array)) == hypre_MEMORY_DEVICE) + if (hypre_GetActualMemLocation(hypre_IntArrayMemoryLocation(CF_marker_array)) == + hypre_MEMORY_DEVICE) { CF_marker_array_host = hypre_IntArrayCloneDeep_v2(CF_marker_array, HYPRE_MEMORY_HOST); } @@ -2947,7 +3086,8 @@ hypre_BoomerAMGGetGridHierarchy( void *data, } /* destroy copy host copy if necessary */ - if (hypre_GetActualMemLocation(hypre_IntArrayMemoryLocation(CF_marker_array)) == hypre_MEMORY_DEVICE) + if (hypre_GetActualMemLocation(hypre_IntArrayMemoryLocation(CF_marker_array)) == + hypre_MEMORY_DEVICE) { hypre_IntArrayDestroy(CF_marker_array_host); } @@ -2957,9 +3097,9 @@ hypre_BoomerAMGGetGridHierarchy( void *data, { hypre_ParCSRMatrix **A_array; A_array = hypre_ParAMGDataAArray(amg_data); - if(A_array == NULL) + if (A_array == NULL) { - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Invalid AMG data. AMG setup has not been called!!\n"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Invalid AMG data. AMG setup has not been called!!\n"); return hypre_error_flag; } @@ -2973,7 +3113,8 @@ hypre_BoomerAMGGetGridHierarchy( void *data, { /* get the CF marker array on the host */ CF_marker_array = hypre_ParAMGDataCFMarkerArray(amg_data)[level]; - if (hypre_GetActualMemLocation(hypre_IntArrayMemoryLocation(CF_marker_array)) == hypre_MEMORY_DEVICE) + if (hypre_GetActualMemLocation(hypre_IntArrayMemoryLocation(CF_marker_array)) == + hypre_MEMORY_DEVICE) { CF_marker_array_host = hypre_IntArrayCloneDeep_v2(CF_marker_array, HYPRE_MEMORY_HOST); } @@ -3000,7 +3141,8 @@ hypre_BoomerAMGGetGridHierarchy( void *data, } } /* destroy copy host copy if necessary */ - if (hypre_GetActualMemLocation(hypre_IntArrayMemoryLocation(CF_marker_array)) == hypre_MEMORY_DEVICE) + if (hypre_GetActualMemLocation(hypre_IntArrayMemoryLocation(CF_marker_array)) == + hypre_MEMORY_DEVICE) { hypre_IntArrayDestroy(CF_marker_array_host); } @@ -3017,24 +3159,24 @@ hypre_BoomerAMGGetGridHierarchy( void *data, /* BM Oct 17, 2006 */ HYPRE_Int hypre_BoomerAMGSetCoordDim( void *data, - HYPRE_Int coorddim) + HYPRE_Int coorddim) { - HYPRE_Int ierr = 0; - hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; + HYPRE_Int ierr = 0; + hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; - hypre_ParAMGDataCoordDim(amg_data) = coorddim; - return (ierr); + hypre_ParAMGDataCoordDim(amg_data) = coorddim; + return (ierr); } HYPRE_Int hypre_BoomerAMGSetCoordinates( void *data, - float *coordinates) + float *coordinates) { - HYPRE_Int ierr = 0; - hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; + HYPRE_Int ierr = 0; + hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; - hypre_ParAMGDataCoordinates(amg_data) = coordinates; - return (ierr); + hypre_ParAMGDataCoordinates(amg_data) = coordinates; + return (ierr); } /*-------------------------------------------------------------------------- @@ -3043,7 +3185,7 @@ hypre_BoomerAMGSetCoordinates( void *data, HYPRE_Int hypre_BoomerAMGSetNumFunctions( void *data, - HYPRE_Int num_functions ) + HYPRE_Int num_functions ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -3062,9 +3204,13 @@ hypre_BoomerAMGSetNumFunctions( void *data, return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_BoomerAMGGetNumFunctions + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_BoomerAMGGetNumFunctions( void *data, - HYPRE_Int * num_functions ) +hypre_BoomerAMGGetNumFunctions( void *data, + HYPRE_Int *num_functions ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -3079,12 +3225,12 @@ hypre_BoomerAMGGetNumFunctions( void *data, } /*-------------------------------------------------------------------------- - * Indicate whether to use nodal systems function + * hypre_BoomerAMGSetFilterFunctions *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_BoomerAMGSetNodal( void *data, - HYPRE_Int nodal ) +hypre_BoomerAMGSetFilterFunctions( void *data, + HYPRE_Int filter_functions ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -3093,17 +3239,23 @@ hypre_BoomerAMGSetNodal( void *data, hypre_error_in_arg(1); return hypre_error_flag; } - hypre_ParAMGDataNodal(amg_data) = nodal; + if (filter_functions < 0 || filter_functions > 1) + { + hypre_error_in_arg(2); + return hypre_error_flag; + } + hypre_ParAMGDataFilterFunctions(amg_data) = filter_functions; return hypre_error_flag; } + /*-------------------------------------------------------------------------- - * Indicate number of levels for nodal coarsening + * hypre_BoomerAMGGetFilterFunctions *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_BoomerAMGSetNodalLevels( void *data, - HYPRE_Int nodal_levels ) +hypre_BoomerAMGGetFilterFunctions( void *data, + HYPRE_Int *filter_functions ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -3112,7 +3264,46 @@ hypre_BoomerAMGSetNodalLevels( void *data, hypre_error_in_arg(1); return hypre_error_flag; } - hypre_ParAMGDataNodalLevels(amg_data) = nodal_levels; + *filter_functions = hypre_ParAMGDataFilterFunctions(amg_data); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Indicate whether to use nodal systems function + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetNodal( void *data, + HYPRE_Int nodal ) +{ + hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; + + if (!amg_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + hypre_ParAMGDataNodal(amg_data) = nodal; + + return hypre_error_flag; +} +/*-------------------------------------------------------------------------- + * Indicate number of levels for nodal coarsening + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetNodalLevels( void *data, + HYPRE_Int nodal_levels ) +{ + hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; + + if (!amg_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + hypre_ParAMGDataNodalLevels(amg_data) = nodal_levels; return hypre_error_flag; } @@ -3124,7 +3315,7 @@ hypre_BoomerAMGSetNodalLevels( void *data, HYPRE_Int hypre_BoomerAMGSetNodalDiag( void *data, - HYPRE_Int nodal ) + HYPRE_Int nodal ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -3138,7 +3329,7 @@ hypre_BoomerAMGSetNodalDiag( void *data, return hypre_error_flag; } /*-------------------------------------------------------------------------- - * Indicate whether to discard same sign coefficients in S for nodal>0 + * Indicate whether to discard same sign coefficients in S for nodal>0 *--------------------------------------------------------------------------*/ HYPRE_Int @@ -3187,7 +3378,7 @@ hypre_BoomerAMGSetNumPaths( void *data, HYPRE_Int hypre_BoomerAMGSetAggNumLevels( void *data, - HYPRE_Int agg_num_levels ) + HYPRE_Int agg_num_levels ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -3212,7 +3403,7 @@ hypre_BoomerAMGSetAggNumLevels( void *data, HYPRE_Int hypre_BoomerAMGSetAggInterpType( void *data, - HYPRE_Int agg_interp_type ) + HYPRE_Int agg_interp_type ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -3221,7 +3412,7 @@ hypre_BoomerAMGSetAggInterpType( void *data, hypre_error_in_arg(1); return hypre_error_flag; } - if (agg_interp_type < 0 || agg_interp_type > 7) + if (agg_interp_type < 0 || agg_interp_type > 9) { hypre_error_in_arg(2); return hypre_error_flag; @@ -3238,7 +3429,7 @@ hypre_BoomerAMGSetAggInterpType( void *data, HYPRE_Int hypre_BoomerAMGSetAggPMaxElmts( void *data, - HYPRE_Int agg_P_max_elmts ) + HYPRE_Int agg_P_max_elmts ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -3264,7 +3455,7 @@ hypre_BoomerAMGSetAggPMaxElmts( void *data, HYPRE_Int hypre_BoomerAMGSetMultAddPMaxElmts( void *data, - HYPRE_Int add_P_max_elmts ) + HYPRE_Int add_P_max_elmts ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -3289,7 +3480,7 @@ hypre_BoomerAMGSetMultAddPMaxElmts( void *data, HYPRE_Int hypre_BoomerAMGSetAddRelaxType( void *data, - HYPRE_Int add_rlx_type ) + HYPRE_Int add_rlx_type ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -3309,7 +3500,7 @@ hypre_BoomerAMGSetAddRelaxType( void *data, HYPRE_Int hypre_BoomerAMGSetAddRelaxWt( void *data, - HYPRE_Real add_rlx_wt ) + HYPRE_Real add_rlx_wt ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -3330,7 +3521,7 @@ hypre_BoomerAMGSetAddRelaxWt( void *data, HYPRE_Int hypre_BoomerAMGSetAggP12MaxElmts( void *data, - HYPRE_Int agg_P12_max_elmts ) + HYPRE_Int agg_P12_max_elmts ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -3355,7 +3546,7 @@ hypre_BoomerAMGSetAggP12MaxElmts( void *data, HYPRE_Int hypre_BoomerAMGSetAggTruncFactor( void *data, - HYPRE_Real agg_trunc_factor ) + HYPRE_Real agg_trunc_factor ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -3381,7 +3572,7 @@ hypre_BoomerAMGSetAggTruncFactor( void *data, HYPRE_Int hypre_BoomerAMGSetMultAddTruncFactor( void *data, - HYPRE_Real add_trunc_factor ) + HYPRE_Real add_trunc_factor ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -3407,7 +3598,7 @@ hypre_BoomerAMGSetMultAddTruncFactor( void *data, HYPRE_Int hypre_BoomerAMGSetAggP12TruncFactor( void *data, - HYPRE_Real agg_P12_trunc_factor ) + HYPRE_Real agg_P12_trunc_factor ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -3432,7 +3623,7 @@ hypre_BoomerAMGSetAggP12TruncFactor( void *data, HYPRE_Int hypre_BoomerAMGSetNumCRRelaxSteps( void *data, - HYPRE_Int num_CR_relax_steps ) + HYPRE_Int num_CR_relax_steps ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -3532,7 +3723,7 @@ hypre_BoomerAMGSetADropType( void *data, HYPRE_Int hypre_BoomerAMGSetISType( void *data, - HYPRE_Int IS_type ) + HYPRE_Int IS_type ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -3557,7 +3748,7 @@ hypre_BoomerAMGSetISType( void *data, HYPRE_Int hypre_BoomerAMGSetCRUseCG( void *data, - HYPRE_Int CR_use_CG ) + HYPRE_Int CR_use_CG ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -3573,7 +3764,7 @@ hypre_BoomerAMGSetCRUseCG( void *data, HYPRE_Int hypre_BoomerAMGSetNumPoints( void *data, - HYPRE_Int num_points ) + HYPRE_Int num_points ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -3599,8 +3790,7 @@ hypre_BoomerAMGSetDofFunc( void *data, return hypre_error_flag; } hypre_IntArrayDestroy(hypre_ParAMGDataDofFunc(amg_data)); - /* NOTE: size of hypre_IntArray will be set during AMG setup - * the memory location is assumed to be host */ + /* NOTE: size and memory location of hypre_IntArray will be set during AMG setup */ if (dof_func == NULL) { hypre_ParAMGDataDofFunc(amg_data) = NULL; @@ -3608,7 +3798,6 @@ hypre_BoomerAMGSetDofFunc( void *data, else { hypre_ParAMGDataDofFunc(amg_data) = hypre_IntArrayCreate(-1); - hypre_IntArrayMemoryLocation(hypre_ParAMGDataDofFunc(amg_data)) = HYPRE_MEMORY_DEVICE; hypre_IntArrayData(hypre_ParAMGDataDofFunc(amg_data)) = dof_func; } @@ -3617,7 +3806,7 @@ hypre_BoomerAMGSetDofFunc( void *data, HYPRE_Int hypre_BoomerAMGSetPointDofMap( void *data, - HYPRE_Int *point_dof_map ) + HYPRE_Int *point_dof_map ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -3634,7 +3823,7 @@ hypre_BoomerAMGSetPointDofMap( void *data, HYPRE_Int hypre_BoomerAMGSetDofPoint( void *data, - HYPRE_Int *dof_point ) + HYPRE_Int *dof_point ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -3651,7 +3840,7 @@ hypre_BoomerAMGSetDofPoint( void *data, HYPRE_Int hypre_BoomerAMGGetNumIterations( void *data, - HYPRE_Int *num_iterations ) + HYPRE_Int *num_iterations ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -3699,7 +3888,7 @@ hypre_BoomerAMGGetResidual( void * data, hypre_ParVector ** resid ) HYPRE_Int hypre_BoomerAMGGetRelResidualNorm( void *data, - HYPRE_Real *rel_resid_norm ) + HYPRE_Real *rel_resid_norm ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -3715,7 +3904,7 @@ hypre_BoomerAMGGetRelResidualNorm( void *data, HYPRE_Int hypre_BoomerAMGSetVariant( void *data, - HYPRE_Int variant) + HYPRE_Int variant) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -3736,7 +3925,7 @@ hypre_BoomerAMGSetVariant( void *data, HYPRE_Int hypre_BoomerAMGGetVariant( void *data, - HYPRE_Int * variant) + HYPRE_Int * variant) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -3752,7 +3941,7 @@ hypre_BoomerAMGGetVariant( void *data, HYPRE_Int hypre_BoomerAMGSetOverlap( void *data, - HYPRE_Int overlap) + HYPRE_Int overlap) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -3773,7 +3962,7 @@ hypre_BoomerAMGSetOverlap( void *data, HYPRE_Int hypre_BoomerAMGGetOverlap( void *data, - HYPRE_Int * overlap) + HYPRE_Int * overlap) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -3789,7 +3978,7 @@ hypre_BoomerAMGGetOverlap( void *data, HYPRE_Int hypre_BoomerAMGSetDomainType( void *data, - HYPRE_Int domain_type) + HYPRE_Int domain_type) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -3810,7 +3999,7 @@ hypre_BoomerAMGSetDomainType( void *data, HYPRE_Int hypre_BoomerAMGGetDomainType( void *data, - HYPRE_Int * domain_type) + HYPRE_Int * domain_type) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -3826,7 +4015,7 @@ hypre_BoomerAMGGetDomainType( void *data, HYPRE_Int hypre_BoomerAMGSetSchwarzRlxWeight( void *data, - HYPRE_Real schwarz_rlx_weight) + HYPRE_Real schwarz_rlx_weight) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*)data; @@ -3842,7 +4031,7 @@ hypre_BoomerAMGSetSchwarzRlxWeight( void *data, HYPRE_Int hypre_BoomerAMGGetSchwarzRlxWeight( void *data, - HYPRE_Real * schwarz_rlx_weight) + HYPRE_Real * schwarz_rlx_weight) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -3874,7 +4063,7 @@ hypre_BoomerAMGSetSchwarzUseNonSymm( void *data, HYPRE_Int hypre_BoomerAMGSetSym( void *data, - HYPRE_Int sym) + HYPRE_Int sym) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -3890,7 +4079,7 @@ hypre_BoomerAMGSetSym( void *data, HYPRE_Int hypre_BoomerAMGSetLevel( void *data, - HYPRE_Int level) + HYPRE_Int level) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -3991,7 +4180,7 @@ hypre_BoomerAMGSetEuclidFile( void *data, HYPRE_Int hypre_BoomerAMGSetEuLevel( void *data, - HYPRE_Int eu_level) + HYPRE_Int eu_level) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -4021,6 +4210,7 @@ hypre_BoomerAMGSetEuSparseA( void *data, return hypre_error_flag; } + HYPRE_Int hypre_BoomerAMGSetEuBJ( void *data, HYPRE_Int eu_bj) @@ -4036,9 +4226,10 @@ hypre_BoomerAMGSetEuBJ( void *data, return hypre_error_flag; } + HYPRE_Int hypre_BoomerAMGSetILUType( void *data, - HYPRE_Int ilu_type) + HYPRE_Int ilu_type) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -4051,9 +4242,10 @@ hypre_BoomerAMGSetILUType( void *data, return hypre_error_flag; } + HYPRE_Int hypre_BoomerAMGSetILULevel( void *data, - HYPRE_Int ilu_lfil) + HYPRE_Int ilu_lfil) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -4066,9 +4258,10 @@ hypre_BoomerAMGSetILULevel( void *data, return hypre_error_flag; } + HYPRE_Int hypre_BoomerAMGSetILUDroptol( void *data, - HYPRE_Real ilu_droptol) + HYPRE_Real ilu_droptol) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -4081,9 +4274,58 @@ hypre_BoomerAMGSetILUDroptol( void *data, return hypre_error_flag; } + +HYPRE_Int +hypre_BoomerAMGSetILUTriSolve( void *data, + HYPRE_Int ilu_tri_solve) +{ + hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; + + if (!amg_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + hypre_ParAMGDataILUTriSolve(amg_data) = ilu_tri_solve; + + return hypre_error_flag; +} + +HYPRE_Int +hypre_BoomerAMGSetILULowerJacobiIters( void *data, + HYPRE_Int ilu_lower_jacobi_iters) +{ + hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; + + if (!amg_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + hypre_ParAMGDataILULowerJacobiIters(amg_data) = ilu_lower_jacobi_iters; + + return hypre_error_flag; +} + +HYPRE_Int +hypre_BoomerAMGSetILUUpperJacobiIters( void *data, + HYPRE_Int ilu_upper_jacobi_iters) +{ + hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; + + if (!amg_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + hypre_ParAMGDataILUUpperJacobiIters(amg_data) = ilu_upper_jacobi_iters; + + return hypre_error_flag; +} + HYPRE_Int hypre_BoomerAMGSetILUMaxIter( void *data, - HYPRE_Int ilu_max_iter) + HYPRE_Int ilu_max_iter) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -4096,9 +4338,10 @@ hypre_BoomerAMGSetILUMaxIter( void *data, return hypre_error_flag; } + HYPRE_Int hypre_BoomerAMGSetILUMaxRowNnz( void *data, - HYPRE_Int ilu_max_row_nnz) + HYPRE_Int ilu_max_row_nnz) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -4111,9 +4354,10 @@ hypre_BoomerAMGSetILUMaxRowNnz( void *data, return hypre_error_flag; } + HYPRE_Int hypre_BoomerAMGSetILULocalReordering( void *data, - HYPRE_Int ilu_reordering_type) + HYPRE_Int ilu_reordering_type) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -4126,6 +4370,215 @@ hypre_BoomerAMGSetILULocalReordering( void *data, return hypre_error_flag; } + +HYPRE_Int +hypre_BoomerAMGSetILUIterSetupType( void *data, + HYPRE_Int ilu_iter_setup_type) +{ + hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; + + if (!amg_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + hypre_ParAMGDataILUIterSetupType(amg_data) = ilu_iter_setup_type; + + return hypre_error_flag; +} + +HYPRE_Int +hypre_BoomerAMGSetILUIterSetupOption( void *data, + HYPRE_Int ilu_iter_setup_option) +{ + hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; + + if (!amg_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + hypre_ParAMGDataILUIterSetupOption(amg_data) = ilu_iter_setup_option; + + return hypre_error_flag; +} + +HYPRE_Int +hypre_BoomerAMGSetILUIterSetupMaxIter( void *data, + HYPRE_Int ilu_iter_setup_max_iter) +{ + hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; + + if (!amg_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + hypre_ParAMGDataILUIterSetupMaxIter(amg_data) = ilu_iter_setup_max_iter; + + return hypre_error_flag; +} + +HYPRE_Int +hypre_BoomerAMGSetILUIterSetupTolerance( void *data, + HYPRE_Real ilu_iter_setup_tolerance) +{ + hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; + + if (!amg_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + hypre_ParAMGDataILUIterSetupTolerance(amg_data) = ilu_iter_setup_tolerance; + + return hypre_error_flag; +} + +HYPRE_Int +hypre_BoomerAMGSetFSAIAlgoType( void *data, + HYPRE_Int fsai_algo_type) +{ + hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; + + if (!amg_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + hypre_ParAMGDataFSAIAlgoType(amg_data) = fsai_algo_type; + + return hypre_error_flag; +} + +HYPRE_Int +hypre_BoomerAMGSetFSAILocalSolveType( void *data, + HYPRE_Int fsai_local_solve_type) +{ + hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; + + if (!amg_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + hypre_ParAMGDataFSAILocalSolveType(amg_data) = fsai_local_solve_type; + + return hypre_error_flag; +} + +HYPRE_Int +hypre_BoomerAMGSetFSAIMaxSteps( void *data, + HYPRE_Int fsai_max_steps) +{ + hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; + + if (!amg_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + hypre_ParAMGDataFSAIMaxSteps(amg_data) = fsai_max_steps; + + return hypre_error_flag; +} + +HYPRE_Int +hypre_BoomerAMGSetFSAIMaxStepSize( void *data, + HYPRE_Int fsai_max_step_size) +{ + hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; + + if (!amg_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + hypre_ParAMGDataFSAIMaxStepSize(amg_data) = fsai_max_step_size; + + return hypre_error_flag; +} + +HYPRE_Int +hypre_BoomerAMGSetFSAIMaxNnzRow( void *data, + HYPRE_Int fsai_max_nnz_row) +{ + hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; + + if (!amg_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + hypre_ParAMGDataFSAIMaxNnzRow(amg_data) = fsai_max_nnz_row; + + return hypre_error_flag; +} + +HYPRE_Int +hypre_BoomerAMGSetFSAINumLevels( void *data, + HYPRE_Int fsai_num_levels) +{ + hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; + + if (!amg_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + hypre_ParAMGDataFSAINumLevels(amg_data) = fsai_num_levels; + + return hypre_error_flag; +} + +HYPRE_Int +hypre_BoomerAMGSetFSAIThreshold( void *data, + HYPRE_Real fsai_threshold) +{ + hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; + + if (!amg_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + hypre_ParAMGDataFSAIThreshold(amg_data) = fsai_threshold; + + return hypre_error_flag; +} + +HYPRE_Int +hypre_BoomerAMGSetFSAIEigMaxIters( void *data, + HYPRE_Int fsai_eig_max_iters) +{ + hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; + + if (!amg_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + hypre_ParAMGDataFSAIEigMaxIters(amg_data) = fsai_eig_max_iters; + + return hypre_error_flag; +} + +HYPRE_Int +hypre_BoomerAMGSetFSAIKapTolerance( void *data, + HYPRE_Real fsai_kap_tolerance) +{ + hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; + + if (!amg_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + hypre_ParAMGDataFSAIKapTolerance(amg_data) = fsai_kap_tolerance; + + return hypre_error_flag; +} + HYPRE_Int hypre_BoomerAMGSetChebyOrder( void *data, HYPRE_Int order) @@ -4168,7 +4621,7 @@ hypre_BoomerAMGSetChebyFraction( void *data, } HYPRE_Int hypre_BoomerAMGSetChebyEigEst( void *data, - HYPRE_Int cheby_eig_est) + HYPRE_Int cheby_eig_est) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -4188,7 +4641,7 @@ hypre_BoomerAMGSetChebyEigEst( void *data, } HYPRE_Int hypre_BoomerAMGSetChebyVariant( void *data, - HYPRE_Int cheby_variant) + HYPRE_Int cheby_variant) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -4224,8 +4677,8 @@ hypre_BoomerAMGSetChebyScale( void *data, *--------------------------------------------------------------------------*/ HYPRE_Int hypre_BoomerAMGSetInterpVectors(void *solver, - HYPRE_Int num_vectors, - hypre_ParVector **interp_vectors) + HYPRE_Int num_vectors, + hypre_ParVector **interp_vectors) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) solver; @@ -4265,7 +4718,7 @@ HYPRE_Int hypre_BoomerAMGSetInterpVectors(void *solver, }*/ HYPRE_Int hypre_BoomerAMGSetInterpVecVariant(void *solver, - HYPRE_Int var) + HYPRE_Int var) { @@ -4277,9 +4730,13 @@ HYPRE_Int hypre_BoomerAMGSetInterpVecVariant(void *solver, } if (var < 1) + { var = 0; + } if (var > 3) + { var = 3; + } hypre_ParAMGInterpVecVariant(amg_data) = var; @@ -4320,7 +4777,7 @@ hypre_BoomerAMGSetInterpVecAbsQTrunc( void *data, } HYPRE_Int hypre_BoomerAMGSetSmoothInterpVectors(void *solver, - HYPRE_Int smooth_interp_vectors) + HYPRE_Int smooth_interp_vectors) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) solver; @@ -4371,7 +4828,7 @@ hypre_BoomerAMGSetInterpVecFirstLevel( void *data, HYPRE_Int hypre_BoomerAMGSetAdditive( void *data, - HYPRE_Int additive ) + HYPRE_Int additive ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -4388,7 +4845,7 @@ hypre_BoomerAMGSetAdditive( void *data, HYPRE_Int hypre_BoomerAMGGetAdditive( void *data, - HYPRE_Int * additive ) + HYPRE_Int * additive ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -4405,7 +4862,7 @@ hypre_BoomerAMGGetAdditive( void *data, HYPRE_Int hypre_BoomerAMGSetMultAdditive( void *data, - HYPRE_Int mult_additive ) + HYPRE_Int mult_additive ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -4422,7 +4879,7 @@ hypre_BoomerAMGSetMultAdditive( void *data, HYPRE_Int hypre_BoomerAMGGetMultAdditive( void *data, - HYPRE_Int * mult_additive ) + HYPRE_Int * mult_additive ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -4456,7 +4913,7 @@ hypre_BoomerAMGSetSimple( void *data, HYPRE_Int hypre_BoomerAMGGetSimple( void *data, - HYPRE_Int * simple ) + HYPRE_Int * simple ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -4473,7 +4930,7 @@ hypre_BoomerAMGGetSimple( void *data, HYPRE_Int hypre_BoomerAMGSetAddLastLvl( void *data, - HYPRE_Int add_last_lvl ) + HYPRE_Int add_last_lvl ) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -4490,7 +4947,7 @@ hypre_BoomerAMGSetAddLastLvl( void *data, HYPRE_Int hypre_BoomerAMGSetNonGalerkinTol( void *data, - HYPRE_Real nongalerkin_tol) + HYPRE_Real nongalerkin_tol) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; HYPRE_Int i, max_num_levels; @@ -4516,16 +4973,18 @@ hypre_BoomerAMGSetNonGalerkinTol( void *data, } hypre_ParAMGDataNonGalerkinTol(amg_data) = nongalerkin_tol; - for (i=0; i < max_num_levels; i++) + for (i = 0; i < max_num_levels; i++) + { nongal_tol_array[i] = nongalerkin_tol; + } return hypre_error_flag; } HYPRE_Int hypre_BoomerAMGSetLevelNonGalerkinTol( void *data, - HYPRE_Real nongalerkin_tol, - HYPRE_Int level) + HYPRE_Real nongalerkin_tol, + HYPRE_Int level) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; HYPRE_Real *nongal_tol_array; @@ -4552,7 +5011,7 @@ hypre_BoomerAMGSetLevelNonGalerkinTol( void *data, hypre_ParAMGDataNonGalTolArray(amg_data) = nongal_tol_array; } - if (level+1 > max_num_levels) + if (level + 1 > max_num_levels) { hypre_error_in_arg(3); return hypre_error_flag; @@ -4564,24 +5023,24 @@ hypre_BoomerAMGSetLevelNonGalerkinTol( void *data, HYPRE_Int hypre_BoomerAMGSetNonGalerkTol( void *data, - HYPRE_Int nongalerk_num_tol, - HYPRE_Real *nongalerk_tol) + HYPRE_Int nongalerk_num_tol, + HYPRE_Real *nongalerk_tol) { - hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; + hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; - hypre_ParAMGDataNonGalerkNumTol(amg_data) = nongalerk_num_tol; - hypre_ParAMGDataNonGalerkTol(amg_data) = nongalerk_tol; - return hypre_error_flag; + hypre_ParAMGDataNonGalerkNumTol(amg_data) = nongalerk_num_tol; + hypre_ParAMGDataNonGalerkTol(amg_data) = nongalerk_tol; + return hypre_error_flag; } HYPRE_Int hypre_BoomerAMGSetRAP2( void *data, HYPRE_Int rap2 ) { - hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; + hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; - hypre_ParAMGDataRAP2(amg_data) = rap2; - return hypre_error_flag; + hypre_ParAMGDataRAP2(amg_data) = rap2; + return hypre_error_flag; } @@ -4589,31 +5048,31 @@ HYPRE_Int hypre_BoomerAMGSetModuleRAP2( void *data, HYPRE_Int mod_rap2 ) { - hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; + hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; - hypre_ParAMGDataModularizedMatMat(amg_data) = mod_rap2; - return hypre_error_flag; + hypre_ParAMGDataModularizedMatMat(amg_data) = mod_rap2; + return hypre_error_flag; } HYPRE_Int hypre_BoomerAMGSetKeepTranspose( void *data, HYPRE_Int keepTranspose) { - hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; + hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; - hypre_ParAMGDataKeepTranspose(amg_data) = keepTranspose; - return hypre_error_flag; + hypre_ParAMGDataKeepTranspose(amg_data) = keepTranspose; + return hypre_error_flag; } #ifdef HYPRE_USING_DSUPERLU HYPRE_Int hypre_BoomerAMGSetDSLUThreshold( void *data, - HYPRE_Int dslu_threshold) + HYPRE_Int dslu_threshold) { - hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; + hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; - hypre_ParAMGDataDSLUThreshold(amg_data) = dslu_threshold; - return hypre_error_flag; + hypre_ParAMGDataDSLUThreshold(amg_data) = dslu_threshold; + return hypre_error_flag; } #endif @@ -4628,7 +5087,6 @@ hypre_BoomerAMGSetCPoints(void *data, HYPRE_BigInt *C_points_marker = NULL; HYPRE_Int *C_points_local_marker = NULL; HYPRE_Int cpt_level; - HYPRE_Int i; if (!amg_data) { @@ -4649,13 +5107,13 @@ hypre_BoomerAMGSetCPoints(void *data, return hypre_error_flag; } + HYPRE_MemoryLocation memory_location = hypre_ParAMGDataMemoryLocation(amg_data); + /* free data not previously destroyed */ if (hypre_ParAMGDataCPointsLevel(amg_data)) { - hypre_TFree(hypre_ParAMGDataCPointsMarker(amg_data), HYPRE_MEMORY_HOST); - hypre_TFree(hypre_ParAMGDataCPointsLocalMarker(amg_data), HYPRE_MEMORY_HOST); - hypre_ParAMGDataCPointsMarker(amg_data) = NULL; - hypre_ParAMGDataCPointsLocalMarker(amg_data) = NULL; + hypre_TFree(hypre_ParAMGDataCPointsMarker(amg_data), memory_location); + hypre_TFree(hypre_ParAMGDataCPointsLocalMarker(amg_data), memory_location); } /* set Cpoint data */ @@ -4670,14 +5128,11 @@ hypre_BoomerAMGSetCPoints(void *data, if (cpt_level) { - C_points_marker = hypre_CTAlloc(HYPRE_BigInt, num_cpt_coarse, HYPRE_MEMORY_HOST); - C_points_local_marker = hypre_CTAlloc(HYPRE_Int, num_cpt_coarse, HYPRE_MEMORY_HOST); + C_points_marker = hypre_CTAlloc(HYPRE_BigInt, num_cpt_coarse, memory_location); + C_points_local_marker = hypre_CTAlloc(HYPRE_Int, num_cpt_coarse, memory_location); - /* copy Cpoints indexes */ - for (i = 0; i < num_cpt_coarse; i++) - { - C_points_marker[i] = cpt_coarse_index[i]; - } + hypre_TMemcpy(C_points_marker, cpt_coarse_index, HYPRE_BigInt, num_cpt_coarse, memory_location, + HYPRE_MEMORY_HOST); } hypre_ParAMGDataCPointsMarker(amg_data) = C_points_marker; hypre_ParAMGDataCPointsLocalMarker(amg_data) = C_points_local_marker; @@ -4756,3 +5211,36 @@ hypre_BoomerAMGSetFPoints(void *data, return hypre_error_flag; } + +HYPRE_Int +hypre_BoomerAMGSetCumNnzAP( void *data, + HYPRE_Real cum_nnz_AP ) +{ + hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; + + if (!amg_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + hypre_ParAMGDataCumNnzAP(amg_data) = cum_nnz_AP; + + return hypre_error_flag; +} + + +HYPRE_Int +hypre_BoomerAMGGetCumNnzAP( void *data, + HYPRE_Real *cum_nnz_AP ) +{ + hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; + + if (!amg_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + *cum_nnz_AP = hypre_ParAMGDataCumNnzAP(amg_data); + + return hypre_error_flag; +} diff --git a/external/hypre/src/parcsr_ls/par_amg.h b/external/hypre/src/parcsr_ls/par_amg.h index e46c0e9a..715cf32c 100644 --- a/external/hypre/src/parcsr_ls/par_amg.h +++ b/external/hypre/src/parcsr_ls/par_amg.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -18,7 +18,11 @@ typedef struct { - HYPRE_MemoryLocation memory_location; /* memory location of matrices/vectors in AMGData */ + /* Base solver data structure */ + hypre_Solver base; + + /* Memory location of matrices/vectors in AMGData */ + HYPRE_MemoryLocation memory_location; /* setup params */ HYPRE_Int max_levels; @@ -88,6 +92,7 @@ typedef struct hypre_ParCSRMatrix *A; HYPRE_Int num_variables; HYPRE_Int num_functions; + HYPRE_Int filter_functions; HYPRE_Int nodal; HYPRE_Int nodal_levels; HYPRE_Int nodal_diag; @@ -137,13 +142,33 @@ typedef struct HYPRE_Real pi_drop_tol; HYPRE_Real eu_sparse_A; char *euclidfile; + + /* ILU parameters */ HYPRE_Int ilu_lfil; HYPRE_Int ilu_type; HYPRE_Int ilu_max_row_nnz; HYPRE_Int ilu_max_iter; HYPRE_Real ilu_droptol; + HYPRE_Int ilu_tri_solve; + HYPRE_Int ilu_lower_jacobi_iters; + HYPRE_Int ilu_upper_jacobi_iters; HYPRE_Int ilu_reordering_type; - + HYPRE_Int ilu_iter_setup_type; + HYPRE_Int ilu_iter_setup_option; + HYPRE_Int ilu_iter_setup_max_iter; + HYPRE_Real ilu_iter_setup_tolerance; + + /* FSAI parameters */ + HYPRE_Int fsai_algo_type; + HYPRE_Int fsai_local_solve_type; + HYPRE_Int fsai_max_steps; + HYPRE_Int fsai_max_step_size; + HYPRE_Int fsai_max_nnz_row; + HYPRE_Int fsai_num_levels; + HYPRE_Real fsai_threshold; + HYPRE_Int fsai_eig_max_iters; + HYPRE_Real fsai_kap_tolerance; + HYPRE_Real *max_eig_est; HYPRE_Real *min_eig_est; HYPRE_Int cheby_eig_est; @@ -154,6 +179,8 @@ typedef struct hypre_Vector **cheby_ds; HYPRE_Real **cheby_coefs; + HYPRE_Real cum_nnz_AP; + /* data needed for non-Galerkin option */ HYPRE_Int nongalerk_num_tol; HYPRE_Real *nongalerk_tol; @@ -216,10 +243,14 @@ typedef struct MPI_Comm new_comm; /* store matrix, vector and communication info for Gaussian elimination */ + HYPRE_MemoryLocation ge_memory_location; HYPRE_Int gs_setup; - HYPRE_Real *A_mat, *A_inv; - HYPRE_Real *b_vec; HYPRE_Int *comm_info; + HYPRE_Int *A_piv; + HYPRE_Real *A_mat; + HYPRE_Real *A_work; + HYPRE_Real *b_vec; + HYPRE_Real *u_vec; /* information for multiplication with Lambda - additive AMG */ HYPRE_Int additive; @@ -256,7 +287,7 @@ typedef struct HYPRE_BigInt *F_points_marker; #ifdef HYPRE_USING_DSUPERLU - /* Parameters and data for SuperLU_Dist */ + /* Parameters and data for SuperLU_Dist */ HYPRE_Int dslu_threshold; HYPRE_Solver dslu_solver; #endif @@ -268,7 +299,6 @@ typedef struct *--------------------------------------------------------------------------*/ /* setup params */ - #define hypre_ParAMGDataMemoryLocation(amg_data) ((amg_data) -> memory_location) #define hypre_ParAMGDataRestriction(amg_data) ((amg_data) -> restr_par) #define hypre_ParAMGDataIsTriangular(amg_data) ((amg_data) -> is_triangular) @@ -333,8 +363,9 @@ typedef struct #define hypre_ParAMGDataOuterWt(amg_data) ((amg_data)->outer_wt) /* problem data parameters */ -#define hypre_ParAMGDataNumVariables(amg_data) ((amg_data)->num_variables) +#define hypre_ParAMGDataNumVariables(amg_data) ((amg_data)->num_variables) #define hypre_ParAMGDataNumFunctions(amg_data) ((amg_data)->num_functions) +#define hypre_ParAMGDataFilterFunctions(amg_data) ((amg_data)->filter_functions) #define hypre_ParAMGDataNodal(amg_data) ((amg_data)->nodal) #define hypre_ParAMGDataNodalLevels(amg_data) ((amg_data)->nodal_levels) #define hypre_ParAMGDataNodalDiag(amg_data) ((amg_data)->nodal_diag) @@ -383,8 +414,24 @@ typedef struct #define hypre_ParAMGDataILULevel(amg_data) ((amg_data)->ilu_lfil) #define hypre_ParAMGDataILUMaxRowNnz(amg_data) ((amg_data)->ilu_max_row_nnz) #define hypre_ParAMGDataILUDroptol(amg_data) ((amg_data)->ilu_droptol) +#define hypre_ParAMGDataILUTriSolve(amg_data) ((amg_data)->ilu_tri_solve) +#define hypre_ParAMGDataILULowerJacobiIters(amg_data) ((amg_data)->ilu_lower_jacobi_iters) +#define hypre_ParAMGDataILUUpperJacobiIters(amg_data) ((amg_data)->ilu_upper_jacobi_iters) #define hypre_ParAMGDataILUMaxIter(amg_data) ((amg_data)->ilu_max_iter) #define hypre_ParAMGDataILULocalReordering(amg_data) ((amg_data)->ilu_reordering_type) +#define hypre_ParAMGDataILUIterSetupType(amg_data) ((amg_data)->ilu_iter_setup_type) +#define hypre_ParAMGDataILUIterSetupOption(amg_data) ((amg_data)->ilu_iter_setup_option) +#define hypre_ParAMGDataILUIterSetupMaxIter(amg_data) ((amg_data)->ilu_iter_setup_max_iter) +#define hypre_ParAMGDataILUIterSetupTolerance(amg_data) ((amg_data)->ilu_iter_setup_tolerance) +#define hypre_ParAMGDataFSAIAlgoType(amg_data) ((amg_data)->fsai_algo_type) +#define hypre_ParAMGDataFSAILocalSolveType(amg_data) ((amg_data)->fsai_local_solve_type) +#define hypre_ParAMGDataFSAIMaxSteps(amg_data) ((amg_data)->fsai_max_steps) +#define hypre_ParAMGDataFSAIMaxStepSize(amg_data) ((amg_data)->fsai_max_step_size) +#define hypre_ParAMGDataFSAIMaxNnzRow(amg_data) ((amg_data)->fsai_max_nnz_row) +#define hypre_ParAMGDataFSAINumLevels(amg_data) ((amg_data)->fsai_num_levels) +#define hypre_ParAMGDataFSAIThreshold(amg_data) ((amg_data)->fsai_threshold) +#define hypre_ParAMGDataFSAIEigMaxIters(amg_data) ((amg_data)->fsai_eig_max_iters) +#define hypre_ParAMGDataFSAIKapTolerance(amg_data) ((amg_data)->fsai_kap_tolerance) #define hypre_ParAMGDataMaxEigEst(amg_data) ((amg_data)->max_eig_est) #define hypre_ParAMGDataMinEigEst(amg_data) ((amg_data)->min_eig_est) @@ -396,6 +443,8 @@ typedef struct #define hypre_ParAMGDataChebyDS(amg_data) ((amg_data)->cheby_ds) #define hypre_ParAMGDataChebyCoefs(amg_data) ((amg_data)->cheby_coefs) +#define hypre_ParAMGDataCumNnzAP(amg_data) ((amg_data)->cum_nnz_AP) + /* block */ #define hypre_ParAMGDataABlockArray(amg_data) ((amg_data)->A_block_array) #define hypre_ParAMGDataPBlockArray(amg_data) ((amg_data)->P_block_array) @@ -461,9 +510,12 @@ typedef struct #define hypre_ParAMGDataParticipate(amg_data) ((amg_data)->participate) #define hypre_ParAMGDataGSSetup(amg_data) ((amg_data)->gs_setup) +#define hypre_ParAMGDataGEMemoryLocation(amg_data) ((amg_data)->ge_memory_location) #define hypre_ParAMGDataAMat(amg_data) ((amg_data)->A_mat) -#define hypre_ParAMGDataAInv(amg_data) ((amg_data)->A_inv) +#define hypre_ParAMGDataAWork(amg_data) ((amg_data)->A_work) +#define hypre_ParAMGDataAPiv(amg_data) ((amg_data)->A_piv) #define hypre_ParAMGDataBVec(amg_data) ((amg_data)->b_vec) +#define hypre_ParAMGDataUVec(amg_data) ((amg_data)->u_vec) #define hypre_ParAMGDataCommInfo(amg_data) ((amg_data)->comm_info) /* additive AMG parameters */ diff --git a/external/hypre/src/parcsr_ls/par_amg_setup.c b/external/hypre/src/parcsr_ls/par_amg_setup.c index d9bbf286..544bdd66 100644 --- a/external/hypre/src/parcsr_ls/par_amg_setup.c +++ b/external/hypre/src/parcsr_ls/par_amg_setup.c @@ -1,27 +1,29 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ +#include "_hypre_onedpl.hpp" #include "_hypre_parcsr_ls.h" #include "par_amg.h" #include "../parcsr_block_mv/par_csr_block_matrix.h" +#include "_hypre_utilities.hpp" #define DEBUG 0 #define PRINT_CF 0 - #define DEBUG_SAVE_ALL_OPS 0 + /***************************************************************************** * * Routine for driving the setup phase of AMG * *****************************************************************************/ -/***************************************************************************** +/*-------------------------------------------------------------------------- * hypre_BoomerAMGSetup - *****************************************************************************/ + *--------------------------------------------------------------------------*/ HYPRE_Int hypre_BoomerAMGSetup( void *amg_vdata, @@ -29,10 +31,12 @@ hypre_BoomerAMGSetup( void *amg_vdata, hypre_ParVector *f, hypre_ParVector *u ) { - MPI_Comm comm = hypre_ParCSRMatrixComm(A); - hypre_ParAMGData *amg_data = (hypre_ParAMGData*) amg_vdata; + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + hypre_ParAMGData *amg_data = (hypre_ParAMGData*) amg_vdata; + hypre_ParCSRMatrix *A_tilde = A; /* Data Structure variables */ + HYPRE_Int num_vectors; hypre_ParCSRMatrix **A_array; hypre_ParVector **F_array; hypre_ParVector **U_array; @@ -85,10 +89,13 @@ hypre_BoomerAMGSetup( void *amg_vdata, hypre_ParCSRBlockMatrix **A_block_array, **P_block_array, **R_block_array; HYPRE_MemoryLocation memory_location = hypre_ParCSRMatrixMemoryLocation(A); + hypre_ParAMGDataMemoryLocation(amg_data) = memory_location; +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1(memory_location); +#endif /* Local variables */ HYPRE_Int *CF_marker; - hypre_IntArray *CF_marker_host; hypre_IntArray *CFN_marker = NULL; hypre_IntArray *CF2_marker = NULL; hypre_IntArray *CF3_marker = NULL; @@ -118,18 +125,18 @@ hypre_BoomerAMGSetup( void *amg_vdata, HYPRE_Int setup_type; HYPRE_BigInt fine_size; HYPRE_Int offset; - HYPRE_Real size; HYPRE_Int not_finished_coarsening = 1; HYPRE_Int coarse_threshold = hypre_ParAMGDataMaxCoarseSize(amg_data); HYPRE_Int min_coarse_size = hypre_ParAMGDataMinCoarseSize(amg_data); HYPRE_Int seq_threshold = hypre_ParAMGDataSeqThreshold(amg_data); HYPRE_Int j, k; - HYPRE_Int num_procs,my_id; -#if !defined(HYPRE_USING_CUDA) && !defined(HYPRE_USING_HIP) + HYPRE_Int num_procs, my_id; +#if !defined(HYPRE_USING_GPU) HYPRE_Int num_threads = hypre_NumThreads(); #endif HYPRE_Int *grid_relax_type = hypre_ParAMGDataGridRelaxType(amg_data); HYPRE_Int num_functions = hypre_ParAMGDataNumFunctions(amg_data); + HYPRE_Int filter_functions = hypre_ParAMGDataFilterFunctions(amg_data); HYPRE_Int nodal = hypre_ParAMGDataNodal(amg_data); HYPRE_Int nodal_levels = hypre_ParAMGDataNodalLevels(amg_data); HYPRE_Int nodal_diag = hypre_ParAMGDataNodalDiag(amg_data); @@ -138,14 +145,14 @@ hypre_BoomerAMGSetup( void *amg_vdata, HYPRE_Int agg_interp_type = hypre_ParAMGDataAggInterpType(amg_data); HYPRE_Int sep_weight = hypre_ParAMGDataSepWeight(amg_data); hypre_IntArray *coarse_dof_func = NULL; - HYPRE_BigInt *coarse_pnts_global = NULL; - HYPRE_BigInt *coarse_pnts_global1 = NULL; + HYPRE_BigInt coarse_pnts_global[2]; + HYPRE_BigInt coarse_pnts_global1[2]; HYPRE_Int num_cg_sweeps; HYPRE_Real *max_eig_est = NULL; HYPRE_Real *min_eig_est = NULL; - HYPRE_Solver *smoother = NULL; + HYPRE_Solver *smoother = hypre_ParAMGDataSmoother(amg_data); HYPRE_Int smooth_type = hypre_ParAMGDataSmoothType(amg_data); HYPRE_Int smooth_num_levels = hypre_ParAMGDataSmoothNumLevels(amg_data); HYPRE_Int sym; @@ -162,8 +169,20 @@ hypre_BoomerAMGSetup( void *amg_vdata, HYPRE_Int ilu_lfil; HYPRE_Int ilu_max_row_nnz; HYPRE_Int ilu_max_iter; + HYPRE_Int ilu_tri_solve; + HYPRE_Int ilu_lower_jacobi_iters; + HYPRE_Int ilu_upper_jacobi_iters; HYPRE_Real ilu_droptol; HYPRE_Int ilu_reordering_type; + HYPRE_Int fsai_algo_type; + HYPRE_Int fsai_local_solve_type; + HYPRE_Int fsai_max_steps; + HYPRE_Int fsai_max_step_size; + HYPRE_Int fsai_max_nnz_row; + HYPRE_Int fsai_num_levels; + HYPRE_Real fsai_threshold; + HYPRE_Int fsai_eig_max_iters; + HYPRE_Real fsai_kap_tolerance; HYPRE_Int needZ = 0; HYPRE_Int interp_type, restri_type; @@ -172,15 +191,15 @@ hypre_BoomerAMGSetup( void *amg_vdata, /*for fittting interp vectors */ /*HYPRE_Int smooth_interp_vectors= hypre_ParAMGSmoothInterpVectors(amg_data); */ - HYPRE_Real abs_q_trunc= hypre_ParAMGInterpVecAbsQTrunc(amg_data); + HYPRE_Real abs_q_trunc = hypre_ParAMGInterpVecAbsQTrunc(amg_data); HYPRE_Int q_max = hypre_ParAMGInterpVecQMax(amg_data); - HYPRE_Int num_interp_vectors= hypre_ParAMGNumInterpVectors(amg_data); + HYPRE_Int num_interp_vectors = hypre_ParAMGNumInterpVectors(amg_data); HYPRE_Int num_levels_interp_vectors = hypre_ParAMGNumLevelsInterpVectors(amg_data); hypre_ParVector **interp_vectors = hypre_ParAMGInterpVectors(amg_data); - hypre_ParVector ***interp_vectors_array= hypre_ParAMGInterpVectorsArray(amg_data); - HYPRE_Int interp_vec_variant= hypre_ParAMGInterpVecVariant(amg_data); - HYPRE_Int interp_refine= hypre_ParAMGInterpRefine(amg_data); - HYPRE_Int interp_vec_first_level= hypre_ParAMGInterpVecFirstLevel(amg_data); + hypre_ParVector ***interp_vectors_array = hypre_ParAMGInterpVectorsArray(amg_data); + HYPRE_Int interp_vec_variant = hypre_ParAMGInterpVecVariant(amg_data); + HYPRE_Int interp_refine = hypre_ParAMGInterpRefine(amg_data); + HYPRE_Int interp_vec_first_level = hypre_ParAMGInterpVecFirstLevel(amg_data); HYPRE_Real *expandp_weights = hypre_ParAMGDataExpandPWeights(amg_data); /* parameters for non-Galerkin stuff */ @@ -209,22 +228,29 @@ hypre_BoomerAMGSetup( void *amg_vdata, HYPRE_Int *num_grid_sweeps = hypre_ParAMGDataNumGridSweeps(amg_data); HYPRE_Int ns = num_grid_sweeps[1]; - HYPRE_Real wall_time; /* for debugging instrumentation */ + HYPRE_Real wall_time = 0.0; /* for debugging instrumentation */ HYPRE_Int add_end; #ifdef HYPRE_USING_DSUPERLU HYPRE_Int dslu_threshold = hypre_ParAMGDataDSLUThreshold(amg_data); #endif + char nvtx_name[1024]; + + HYPRE_Real cum_nnz_AP = hypre_ParAMGDataCumNnzAP(amg_data); + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("AMGsetup"); + hypre_MemoryPrintUsage(comm, hypre_HandleLogLevel(hypre_handle()), "BoomerAMG setup begin", 0); hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_rank(comm, &my_id); /*A_new = hypre_CSRMatrixDeleteZeros(hypre_ParCSRMatrixDiag(A), 1.e-16); hypre_CSRMatrixPrint(A_new, "Atestnew"); */ old_num_levels = hypre_ParAMGDataNumLevels(amg_data); max_levels = hypre_ParAMGDataMaxLevels(amg_data); - add_end = hypre_min(add_last_lvl, max_levels-1); - if (add_end == -1) add_end = max_levels-1; + add_end = hypre_min(add_last_lvl, max_levels - 1); + if (add_end == -1) { add_end = max_levels - 1; } amg_logging = hypre_ParAMGDataLogging(amg_data); amg_print_level = hypre_ParAMGDataPrintLevel(amg_data); coarsen_type = hypre_ParAMGDataCoarsenType(amg_data); @@ -247,8 +273,20 @@ hypre_BoomerAMGSetup( void *amg_vdata, ilu_lfil = hypre_ParAMGDataILULevel(amg_data); ilu_max_row_nnz = hypre_ParAMGDataILUMaxRowNnz(amg_data); ilu_droptol = hypre_ParAMGDataILUDroptol(amg_data); + ilu_tri_solve = hypre_ParAMGDataILUTriSolve(amg_data); + ilu_lower_jacobi_iters = hypre_ParAMGDataILULowerJacobiIters(amg_data); + ilu_upper_jacobi_iters = hypre_ParAMGDataILUUpperJacobiIters(amg_data); ilu_max_iter = hypre_ParAMGDataILUMaxIter(amg_data); ilu_reordering_type = hypre_ParAMGDataILULocalReordering(amg_data); + fsai_algo_type = hypre_ParAMGDataFSAIAlgoType(amg_data); + fsai_local_solve_type = hypre_ParAMGDataFSAILocalSolveType(amg_data); + fsai_max_steps = hypre_ParAMGDataFSAIMaxSteps(amg_data); + fsai_max_step_size = hypre_ParAMGDataFSAIMaxStepSize(amg_data); + fsai_max_nnz_row = hypre_ParAMGDataFSAIMaxNnzRow(amg_data); + fsai_num_levels = hypre_ParAMGDataFSAINumLevels(amg_data); + fsai_threshold = hypre_ParAMGDataFSAIThreshold(amg_data); + fsai_eig_max_iters = hypre_ParAMGDataFSAIEigMaxIters(amg_data); + fsai_kap_tolerance = hypre_ParAMGDataFSAIKapTolerance(amg_data); interp_type = hypre_ParAMGDataInterpType(amg_data); restri_type = hypre_ParAMGDataRestriction(amg_data); /* RL */ post_interp_type = hypre_ParAMGDataPostInterpType(amg_data); @@ -264,8 +302,8 @@ hypre_BoomerAMGSetup( void *amg_vdata, hypre_ParCSRMatrixSetDNumNonzeros(A); hypre_ParAMGDataNumVariables(amg_data) = hypre_ParCSRMatrixNumRows(A); - if (num_procs == 1) seq_threshold = 0; - if (setup_type == 0) return hypre_error_flag; + if (num_procs == 1) { seq_threshold = 0; } + if (setup_type == 0) { return hypre_error_flag; } S = NULL; @@ -282,6 +320,7 @@ hypre_BoomerAMGSetup( void *amg_vdata, if (dof_func && hypre_IntArraySize(dof_func) < 0) { hypre_IntArraySize(dof_func) = local_size; + hypre_IntArrayMemoryLocation(dof_func) = memory_location; } A_block_array = hypre_ParAMGDataABlockArray(amg_data); @@ -290,7 +329,21 @@ hypre_BoomerAMGSetup( void *amg_vdata, grid_relax_type[3] = hypre_ParAMGDataUserCoarseRelaxType(amg_data); - HYPRE_ANNOTATE_FUNC_BEGIN; + /* Get the number of vector components when LHS/RHS are passed in */ + if ((f != NULL) && (u != NULL)) + { + /* Verify that the number of vectors held by f and u match */ + if (hypre_ParVectorNumVectors(f) != hypre_ParVectorNumVectors(u)) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Error: num_vectors for RHS and LHS do not match!\n"); + return hypre_error_flag; + } + num_vectors = hypre_ParVectorNumVectors(f); + } + else + { + num_vectors = 1; + } /* change in definition of standard and multipass interpolation, by eliminating interp_type 9 and 5 and setting sep_weight instead @@ -312,54 +365,61 @@ hypre_BoomerAMGSetup( void *amg_vdata, if (interp_vec_variant > 0 && nodal < 1) { nodal = 1; - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"WARNING: Changing to node-based coarsening because LN of GM interpolation has been specified via HYPRE_BoomerAMGSetInterpVecVariant.\n"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "WARNING: Changing to node-based coarsening because LN of GM interpolation has been specified via HYPRE_BoomerAMGSetInterpVecVariant.\n"); } - /* Verify that settings are correct for solving systmes */ + /* Verify that settings are correct for solving systems */ /* If the user has specified either a block interpolation or a block relaxation then - we need to make sure the other has been choosen as well - so we can be + we need to make sure the other has been chosen as well - so we can be in "block mode" - storing only block matrices on the coarse levels*/ /* Furthermore, if we are using systems and nodal = 0, then we will change nodal to 1 */ - /* probably should disable stuff like smooth num levels at some point */ + /* probably should disable stuff like smooth number levels at some point */ - if (grid_relax_type[0] >= 20) /* block relaxation choosen */ + if (grid_relax_type[0] >= 20 && grid_relax_type[0] != 30 && + grid_relax_type[0] != 88 && grid_relax_type[0] != 89) { - + /* block relaxation chosen */ if (!((interp_type >= 20 && interp_type != 100) || interp_type == 11 || interp_type == 10 ) ) { hypre_ParAMGDataInterpType(amg_data) = 20; interp_type = hypre_ParAMGDataInterpType(amg_data) ; } - for (i=1; i < 3; i++) + for (i = 1; i < 3; i++) { if (grid_relax_type[i] < 20) { grid_relax_type[i] = 23; } - } - if (grid_relax_type[3] < 20) grid_relax_type[3] = 29; /* GE */ + if (grid_relax_type[3] < 20) + { + grid_relax_type[3] = 29; /* GE */ + } block_mode = 1; } - if ((interp_type >= 20 && interp_type != 100) || interp_type == 11 || interp_type == 10 ) /* block interp choosen */ + if ((interp_type >= 20 && interp_type != 100) || interp_type == 11 || + interp_type == 10 ) /* block interp choosen */ { if (!(nodal)) { hypre_ParAMGDataNodal(amg_data) = 1; nodal = hypre_ParAMGDataNodal(amg_data); } - for (i=0; i < 3; i++) + for (i = 0; i < 3; i++) { if (grid_relax_type[i] < 20) + { grid_relax_type[i] = 23; + } } - if (grid_relax_type[3] < 20) grid_relax_type[3] = 29; /* GE */ + if (grid_relax_type[3] < 20) { grid_relax_type[3] = 29; } /* GE */ block_mode = 1; @@ -389,11 +449,11 @@ hypre_BoomerAMGSetup( void *amg_vdata, A_block_array[j] = NULL; } - hypre_IntArrayDestroy(dof_func_array[i]); - dof_func_array[i] = NULL; + hypre_IntArrayDestroy(dof_func_array[j]); + dof_func_array[j] = NULL; } - for (j = 0; j < old_num_levels-1; j++) + for (j = 0; j < old_num_levels - 1; j++) { if (P_array[j]) { @@ -425,7 +485,7 @@ hypre_BoomerAMGSetup( void *amg_vdata, hypre_IntArrayDestroy(CF_marker_array[0]); CF_marker_array[0] = NULL; - for (j = 1; j < old_num_levels-1; j++) + for (j = 1; j < old_num_levels - 1; j++) { hypre_IntArrayDestroy(CF_marker_array[j]); CF_marker_array[j] = NULL; @@ -469,9 +529,15 @@ hypre_BoomerAMGSetup( void *amg_vdata, hypre_ParAMGDataFCoarse(amg_data) = NULL; } - hypre_TFree(hypre_ParAMGDataAMat(amg_data), HYPRE_MEMORY_HOST); - hypre_TFree(hypre_ParAMGDataAInv(amg_data), HYPRE_MEMORY_HOST); - hypre_TFree(hypre_ParAMGDataBVec(amg_data), HYPRE_MEMORY_HOST); +#if defined(HYPRE_USING_MAGMA) + hypre_TFree(hypre_ParAMGDataAPiv(amg_data), HYPRE_MEMORY_HOST); +#else + hypre_TFree(hypre_ParAMGDataAPiv(amg_data), hypre_ParAMGDataGEMemoryLocation(amg_data)); +#endif + hypre_TFree(hypre_ParAMGDataAMat(amg_data), hypre_ParAMGDataGEMemoryLocation(amg_data)); + hypre_TFree(hypre_ParAMGDataAWork(amg_data), hypre_ParAMGDataGEMemoryLocation(amg_data)); + hypre_TFree(hypre_ParAMGDataBVec(amg_data), hypre_ParAMGDataGEMemoryLocation(amg_data)); + hypre_TFree(hypre_ParAMGDataUVec(amg_data), hypre_ParAMGDataGEMemoryLocation(amg_data)); hypre_TFree(hypre_ParAMGDataCommInfo(amg_data), HYPRE_MEMORY_HOST); if (new_comm != hypre_MPI_COMM_NULL) @@ -489,6 +555,24 @@ hypre_BoomerAMGSetup( void *amg_vdata, hypre_TFree(hypre_ParAMGDataMaxEigEst(amg_data), HYPRE_MEMORY_HOST); hypre_TFree(hypre_ParAMGDataMinEigEst(amg_data), HYPRE_MEMORY_HOST); + if (hypre_ParAMGDataChebyDS(amg_data)) + { + for (i = 0; i < old_num_levels; i++) + { + hypre_SeqVectorDestroy(hypre_ParAMGDataChebyDS(amg_data)[i]); + } + hypre_TFree(hypre_ParAMGDataChebyDS(amg_data), HYPRE_MEMORY_HOST); + } + + if (hypre_ParAMGDataChebyCoefs(amg_data)) + { + for (i = 0; i < old_num_levels; i++) + { + hypre_TFree(hypre_ParAMGDataChebyCoefs(amg_data)[i], HYPRE_MEMORY_HOST); + } + hypre_TFree(hypre_ParAMGDataChebyCoefs(amg_data), HYPRE_MEMORY_HOST); + } + if (hypre_ParAMGDataL1Norms(amg_data)) { for (i = 0; i < old_num_levels; i++) @@ -499,13 +583,14 @@ hypre_BoomerAMGSetup( void *amg_vdata, } if (smooth_num_levels && smoother) { - if (smooth_num_levels > old_num_levels-1) + if (smooth_num_levels > 1 && + smooth_num_levels > old_num_levels - 1) { - smooth_num_levels = old_num_levels -1; + smooth_num_levels = old_num_levels - 1; } if (hypre_ParAMGDataSmoothType(amg_data) == 7) { - for (i=0; i < smooth_num_levels; i++) + for (i = 0; i < smooth_num_levels; i++) { if (smoother[i]) { @@ -516,7 +601,7 @@ hypre_BoomerAMGSetup( void *amg_vdata, } else if (hypre_ParAMGDataSmoothType(amg_data) == 8) { - for (i=0; i < smooth_num_levels; i++) + for (i = 0; i < smooth_num_levels; i++) { if (smoother[i]) { @@ -527,7 +612,7 @@ hypre_BoomerAMGSetup( void *amg_vdata, } else if (hypre_ParAMGDataSmoothType(amg_data) == 9) { - for (i=0; i < smooth_num_levels; i++) + for (i = 0; i < smooth_num_levels; i++) { if (smoother[i]) { @@ -536,9 +621,20 @@ hypre_BoomerAMGSetup( void *amg_vdata, } } } + else if (hypre_ParAMGDataSmoothType(amg_data) == 4) + { + for (i = 0; i < smooth_num_levels; i++) + { + if (smoother[i]) + { + HYPRE_FSAIDestroy(smoother[i]); + smoother[i] = NULL; + } + } + } else if (hypre_ParAMGDataSmoothType(amg_data) == 5) { - for (i=0; i < smooth_num_levels; i++) + for (i = 0; i < smooth_num_levels; i++) { if (smoother[i]) { @@ -549,7 +645,7 @@ hypre_BoomerAMGSetup( void *amg_vdata, } else if (hypre_ParAMGDataSmoothType(amg_data) == 6) { - for (i=0; i < smooth_num_levels; i++) + for (i = 0; i < smooth_num_levels; i++) { if (smoother[i]) { @@ -578,11 +674,11 @@ hypre_BoomerAMGSetup( void *amg_vdata, if (P_array == NULL && max_levels > 1) { - P_array = hypre_CTAlloc(hypre_ParCSRMatrix*, max_levels-1, HYPRE_MEMORY_HOST); + P_array = hypre_CTAlloc(hypre_ParCSRMatrix*, max_levels - 1, HYPRE_MEMORY_HOST); } if (P_block_array == NULL && max_levels > 1) { - P_block_array = hypre_CTAlloc(hypre_ParCSRBlockMatrix*, max_levels-1, HYPRE_MEMORY_HOST); + P_block_array = hypre_CTAlloc(hypre_ParCSRBlockMatrix*, max_levels - 1, HYPRE_MEMORY_HOST); } /* RL: if retri_type != 0, R != P^T, allocate R matrices */ @@ -590,11 +686,11 @@ hypre_BoomerAMGSetup( void *amg_vdata, { if (R_array == NULL && max_levels > 1) { - R_array = hypre_CTAlloc(hypre_ParCSRMatrix*, max_levels-1, HYPRE_MEMORY_HOST); + R_array = hypre_CTAlloc(hypre_ParCSRMatrix*, max_levels - 1, HYPRE_MEMORY_HOST); } if (R_block_array == NULL && max_levels > 1) { - R_block_array = hypre_CTAlloc(hypre_ParCSRBlockMatrix*, max_levels-1, HYPRE_MEMORY_HOST); + R_block_array = hypre_CTAlloc(hypre_ParCSRBlockMatrix*, max_levels - 1, HYPRE_MEMORY_HOST); } } @@ -605,16 +701,47 @@ hypre_BoomerAMGSetup( void *amg_vdata, if (num_C_points_coarse > 0) { - k = 0; - for (j = 0; j < num_C_points_coarse; j++) +#if defined(HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_DEVICE) + { +#if defined(HYPRE_USING_SYCL) + HYPRE_Int *new_end = + hypreSycl_copy_if( C_points_marker, + C_points_marker + num_C_points_coarse, + C_points_marker, + C_points_local_marker, + in_range(first_local_row, first_local_row + local_size - 1) ); + HYPRE_ONEDPL_CALL( std::transform, + C_points_local_marker, + C_points_local_marker + num_C_points_coarse, + C_points_local_marker, + [first_local_row = first_local_row] (const auto & x) {return x - first_local_row;} ); +#else + HYPRE_Int *new_end = + HYPRE_THRUST_CALL( copy_if, + thrust::make_transform_iterator(C_points_marker, _1 - first_local_row), + thrust::make_transform_iterator(C_points_marker + num_C_points_coarse, _1 - first_local_row), + C_points_marker, + C_points_local_marker, + in_range(first_local_row, first_local_row + local_size - 1) ); +#endif + + num_C_points_coarse = new_end - C_points_local_marker; + } + else +#endif /* defined(HYPRE_USING_GPU) */ { - row = (HYPRE_Int) (C_points_marker[j] - first_local_row); - if ((row >= 0) && (row < local_size)) + k = 0; + for (j = 0; j < num_C_points_coarse; j++) { - C_points_local_marker[k++] = row; + row = (HYPRE_Int) (C_points_marker[j] - first_local_row); + if ((row >= 0) && (row < local_size)) + { + C_points_local_marker[k++] = row; + } } + num_C_points_coarse = k; } - num_C_points_coarse = k; } if (dof_func_array == NULL) @@ -625,21 +752,32 @@ hypre_BoomerAMGSetup( void *amg_vdata, if (num_functions > 1 && dof_func == NULL) { dof_func = hypre_IntArrayCreate(local_size); - hypre_IntArrayInitialize(dof_func); + hypre_IntArrayInitialize_v2(dof_func, memory_location); offset = (HYPRE_Int) ( first_local_row % ((HYPRE_BigInt) num_functions) ); -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - hypre_BoomerAMGInitDofFuncDevice(hypre_IntArrayData(dof_func), local_size, offset, num_functions); -#else - for (i = 0; i < local_size; i++) +#if defined(HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_DEVICE) { - hypre_IntArrayData(dof_func)[i] = (i + offset) % num_functions; + hypre_BoomerAMGInitDofFuncDevice(hypre_IntArrayData(dof_func), local_size, offset, num_functions); + } + else +#endif /* defined(HYPRE_USING_GPU) */ + { + for (i = 0; i < local_size; i++) + { + hypre_IntArrayData(dof_func)[i] = (i + offset) % num_functions; + } } -#endif /* defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) */ } - A_array[0] = A; + /* Eliminate inter-variable connections among functions for preconditioning purposes */ + if (num_functions > 1 && filter_functions) + { + hypre_ParCSRMatrixBlkFilter(A, num_functions, &A_tilde); + } + + A_array[0] = A_tilde; /* interp vectors setup */ if (interp_vec_variant == 1) @@ -647,11 +785,12 @@ hypre_BoomerAMGSetup( void *amg_vdata, num_levels_interp_vectors = interp_vec_first_level + 1; hypre_ParAMGNumLevelsInterpVectors(amg_data) = num_levels_interp_vectors; } - if ( interp_vec_variant > 0 && num_interp_vectors > 0) + if (interp_vec_variant > 0 && num_interp_vectors > 0) { - interp_vectors_array = hypre_CTAlloc(hypre_ParVector**, num_levels_interp_vectors, HYPRE_MEMORY_HOST); + interp_vectors_array = hypre_CTAlloc(hypre_ParVector**, num_levels_interp_vectors, + HYPRE_MEMORY_HOST); interp_vectors_array[0] = interp_vectors; - hypre_ParAMGInterpVectorsArray(amg_data)= interp_vectors_array; + hypre_ParAMGInterpVectorsArray(amg_data) = interp_vectors_array; } if (block_mode) @@ -704,6 +843,7 @@ hypre_BoomerAMGSetup( void *amg_vdata, Vtemp = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A_array[0]), hypre_ParCSRMatrixGlobalNumRows(A_array[0]), hypre_ParCSRMatrixRowStarts(A_array[0])); + hypre_ParVectorNumVectors(Vtemp) = num_vectors; hypre_ParVectorInitialize_v2(Vtemp, memory_location); hypre_ParAMGDataVtemp(amg_data) = Vtemp; @@ -711,11 +851,13 @@ hypre_BoomerAMGSetup( void *amg_vdata, * If cheby_scale is false, only need one, otherwise need two */ if ((smooth_num_levels > 0 && smooth_type > 9) || relax_weight[0] < 0 || omega[0] < 0 || hypre_ParAMGDataSchwarzRlxWeight(amg_data) < 0 || - (grid_relax_type[0] == 16 || grid_relax_type[1] == 16 || grid_relax_type[2] == 16 || grid_relax_type[3] == 16)) + (grid_relax_type[0] == 16 || grid_relax_type[1] == 16 || grid_relax_type[2] == 16 || + grid_relax_type[3] == 16)) { Ptemp = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A_array[0]), hypre_ParCSRMatrixGlobalNumRows(A_array[0]), hypre_ParCSRMatrixRowStarts(A_array[0])); + hypre_ParVectorNumVectors(Ptemp) = num_vectors; hypre_ParVectorInitialize_v2(Ptemp, memory_location); hypre_ParAMGDataPtemp(amg_data) = Ptemp; @@ -727,24 +869,27 @@ hypre_BoomerAMGSetup( void *amg_vdata, Rtemp = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A_array[0]), hypre_ParCSRMatrixGlobalNumRows(A_array[0]), hypre_ParCSRMatrixRowStarts(A_array[0])); + hypre_ParVectorNumVectors(Rtemp) = num_vectors; hypre_ParVectorInitialize_v2(Rtemp, memory_location); hypre_ParAMGDataRtemp(amg_data) = Rtemp; } } /* See if we need the Ztemp vector */ - if ( (smooth_num_levels > 0 && smooth_type > 6) || relax_weight[0] < 0 || omega[0] < 0 || hypre_ParAMGDataSchwarzRlxWeight(amg_data) < 0 ) + if ( (smooth_num_levels > 0 && smooth_type > 6) || relax_weight[0] < 0 || omega[0] < 0 || + hypre_ParAMGDataSchwarzRlxWeight(amg_data) < 0 ) { needZ = hypre_max(needZ, 1); } - if ( grid_relax_type[0] == 16 || grid_relax_type[1] == 16 || grid_relax_type[2] == 16 || grid_relax_type[3] == 16 ) + if ( grid_relax_type[0] == 16 || grid_relax_type[1] == 16 || grid_relax_type[2] == 16 || + grid_relax_type[3] == 16 ) { /* Chebyshev */ needZ = hypre_max(needZ, 1); } -#if !defined(HYPRE_USING_CUDA) && !defined(HYPRE_USING_HIP) +#if !defined(HYPRE_USING_GPU) /* GPU impl. needs Z */ if (num_threads > 1) #endif @@ -754,7 +899,8 @@ hypre_BoomerAMGSetup( void *amg_vdata, { if (grid_relax_type[j] == 3 || grid_relax_type[j] == 4 || grid_relax_type[j] == 6 || grid_relax_type[j] == 8 || grid_relax_type[j] == 13 || grid_relax_type[j] == 14 || - grid_relax_type[j] == 11 || grid_relax_type[j] == 12) + grid_relax_type[j] == 11 || grid_relax_type[j] == 12 || grid_relax_type[j] == 88 || + grid_relax_type[j] == 89) { needZ = hypre_max(needZ, 1); break; @@ -767,7 +913,7 @@ hypre_BoomerAMGSetup( void *amg_vdata, Ztemp = hypre_ParMultiVectorCreate(hypre_ParCSRMatrixComm(A_array[0]), hypre_ParCSRMatrixGlobalNumRows(A_array[0]), hypre_ParCSRMatrixRowStarts(A_array[0]), - needZ); + num_vectors); hypre_ParVectorInitialize_v2(Ztemp, memory_location); hypre_ParAMGDataZtemp(amg_data) = Ztemp; } @@ -815,6 +961,9 @@ hypre_BoomerAMGSetup( void *amg_vdata, level = 0; HYPRE_ANNOTATE_MGLEVEL_BEGIN(level); + hypre_sprintf(nvtx_name, "%s-%d", "AMG Level", level); + hypre_GpuProfilingPushRange(nvtx_name); + strong_threshold = hypre_ParAMGDataStrongThreshold(amg_data); coarsen_cut_factor = hypre_ParAMGDataCoarsenCutFactor(amg_data); useSabs = hypre_ParAMGDataSabs(amg_data); @@ -827,6 +976,7 @@ hypre_BoomerAMGSetup( void *amg_vdata, agg_P_max_elmts = hypre_ParAMGDataAggPMaxElmts(amg_data); agg_P12_max_elmts = hypre_ParAMGDataAggP12MaxElmts(amg_data); jacobi_trunc_threshold = hypre_ParAMGDataJacobiTruncThreshold(amg_data); + smooth_num_levels = hypre_ParAMGDataSmoothNumLevels(amg_data); if (smooth_num_levels > level) { smoother = hypre_CTAlloc(HYPRE_Solver, smooth_num_levels, HYPRE_MEMORY_HOST); @@ -880,12 +1030,14 @@ hypre_BoomerAMGSetup( void *amg_vdata, hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A_array[level]), hypre_ParCSRMatrixGlobalNumRows(A_array[level]), hypre_ParCSRMatrixRowStarts(A_array[level])); + hypre_ParVectorNumVectors(F_array[level]) = num_vectors; hypre_ParVectorInitialize_v2(F_array[level], memory_location); U_array[level] = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A_array[level]), hypre_ParCSRMatrixGlobalNumRows(A_array[level]), hypre_ParCSRMatrixRowStarts(A_array[level])); + hypre_ParVectorNumVectors(U_array[level]) = num_vectors; hypre_ParVectorInitialize_v2(U_array[level], memory_location); } } @@ -901,18 +1053,17 @@ hypre_BoomerAMGSetup( void *amg_vdata, dof_func_data = hypre_IntArrayData(dof_func_array[level]); } - if (debug_flag==1) wall_time = time_getWallclockSeconds(); - if (debug_flag==3) + if (debug_flag == 1) { wall_time = time_getWallclockSeconds(); } + if (debug_flag == 3) { - hypre_printf("\n ===== Proc = %d Level = %d =====\n", - my_id, level); - fflush(NULL); + hypre_printf("\n ===== Proc = %d Level = %d =====\n", + my_id, level); + fflush(NULL); } if (max_levels == 1) { S = NULL; - coarse_pnts_global = NULL; CF_marker_array[level] = hypre_IntArrayCreate(local_size); hypre_IntArrayInitialize(CF_marker_array[level]); hypre_IntArraySetConstantValues(CF_marker_array[level], 1); @@ -934,8 +1085,8 @@ hypre_BoomerAMGSetup( void *amg_vdata, hypre_ParAMGDataInterpType(amg_data) == 1) { hypre_BoomerAMGCreateSmoothVecs(amg_data, A_array[level], - hypre_ParAMGDataNumGridSweeps(amg_data)[1], - level, &SmoothVecs); + hypre_ParAMGDataNumGridSweeps(amg_data)[1], + level, &SmoothVecs); } /**** Get the Strength Matrix ****/ @@ -953,7 +1104,7 @@ hypre_BoomerAMGSetup( void *amg_vdata, } else { - hypre_BoomerAMGCreateNodalA(A_array[level],num_functions, + hypre_BoomerAMGCreateNodalA(A_array[level], num_functions, dof_func_data, hypre_abs(nodal), nodal_diag, &AN); } @@ -1024,33 +1175,45 @@ hypre_BoomerAMGSetup( void *amg_vdata, first_local_row = hypre_ParCSRMatrixFirstRowIndex(A_array[level]); } - /* copy CF_marker to the host if needed */ - if (hypre_GetActualMemLocation(hypre_IntArrayMemoryLocation(CF_marker_array[level])) == hypre_MEMORY_DEVICE) +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_IntArrayMemoryLocation( + CF_marker_array[level]) ); + + if (exec == HYPRE_EXEC_DEVICE) { - CF_marker_host = hypre_IntArrayCloneDeep_v2(CF_marker_array[level], HYPRE_MEMORY_HOST); +#if defined(HYPRE_USING_SYCL) + auto perm_it = oneapi::dpl::make_permutation_iterator( + hypre_IntArrayData(CF_marker_array[level]), + oneapi::dpl::make_transform_iterator( isolated_F_points_marker, + [first_local_row = first_local_row] (const auto & x) {return x - first_local_row;} ) ); + hypreSycl_transform_if( perm_it, + perm_it + num_isolated_F_points, + isolated_F_points_marker, + perm_it, + [] (const auto & x) {return -3;}, + in_range(first_local_row, first_local_row + local_size - 1) ); +#else + HYPRE_THRUST_CALL( scatter_if, + thrust::make_constant_iterator(-3), + thrust::make_constant_iterator(-3) + num_isolated_F_points, + thrust::make_transform_iterator(isolated_F_points_marker, _1 - first_local_row), + isolated_F_points_marker, + hypre_IntArrayData(CF_marker_array[level]), + in_range(first_local_row, first_local_row + local_size - 1) ); +#endif } else +#endif { - CF_marker_host = CF_marker_array[level]; - } - - for (j = 0; j < num_isolated_F_points; j++) - { - row = (HYPRE_Int) (isolated_F_points_marker[j] - first_local_row); - if ((row >= 0) && (row < local_size)) + for (j = 0; j < num_isolated_F_points; j++) { - hypre_IntArrayData(CF_marker_host)[row] = -3; // Assumes SF_PT == -3 + row = (HYPRE_Int) (isolated_F_points_marker[j] - first_local_row); + if ((row >= 0) && (row < local_size)) + { + hypre_IntArrayData(CF_marker_array[level])[row] = -3; // Assumes SF_PT == -3 + } } } - - /* copy back to device and destroy host copy */ - if (hypre_GetActualMemLocation(hypre_IntArrayMemoryLocation(CF_marker_array[level])) == hypre_MEMORY_DEVICE) - { - hypre_IntArrayCopy(CF_marker_host, CF_marker_array[level]); - hypre_IntArrayDestroy(CF_marker_host); - } - - } /**** Do the appropriate coarsening ****/ @@ -1076,132 +1239,56 @@ hypre_BoomerAMGSetup( void *amg_vdata, else if (coarsen_type == 21 || coarsen_type == 22) { #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"CGC coarsening is not available in mixedint mode!"); - return hypre_error_flag; + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "CGC coarsening is not available in mixedint mode!"); + return hypre_error_flag; #endif - hypre_BoomerAMGCoarsenCGCb(S, A_array[level], measure_type, coarsen_type, - cgc_its, debug_flag, &(CF_marker_array[level])); + hypre_BoomerAMGCoarsenCGCb(S, A_array[level], measure_type, coarsen_type, + cgc_its, debug_flag, &(CF_marker_array[level])); } else if (coarsen_type == 98) - hypre_BoomerAMGCoarsenCR1(A_array[level], &(CF_marker_array[level]), - &coarse_size, num_CR_relax_steps, IS_type, 0); + hypre_BoomerAMGCoarsenCR1(A_array[level], &(CF_marker_array[level]), + &coarse_size, num_CR_relax_steps, IS_type, 0); else if (coarsen_type == 99) { hypre_BoomerAMGCreateS(A_array[level], CR_strong_th, 1, - num_functions, dof_func_data,&SCR); + num_functions, dof_func_data, &SCR); hypre_BoomerAMGCoarsenCR(A_array[level], &(CF_marker_array[level]), &coarse_size, num_CR_relax_steps, IS_type, 1, grid_relax_type[0], relax_weight[level], omega[level], CR_rate, - NULL,NULL,CR_use_CG,SCR); + NULL, NULL, CR_use_CG, SCR); hypre_ParCSRMatrixDestroy(SCR); } -#if DEBUG - else if (coarsen_type == 999) + else if (coarsen_type) { - /* RL_DEBUG: read C/F splitting from files */ - /* read from file */ + hypre_BoomerAMGCoarsenRuge(S, A_array[level], measure_type, coarsen_type, + coarsen_cut_factor, debug_flag, &(CF_marker_array[level])); + /* DEBUG: SAVE CF the splitting HYPRE_Int my_id; MPI_Comm comm = hypre_ParCSRMatrixComm(A_array[level]); hypre_MPI_Comm_rank(comm, &my_id); - HYPRE_Int first_local_row = hypre_ParCSRMatrixFirstRowIndex(A_array[level]); - HYPRE_Int local_size = hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(A_array[level])); - char CFfile[256], line[1024]; - hypre_sprintf(CFfile, "CF_%d.txt", level); - hypre_printf("myid %d: level %d, read C/F from file %s, first_row %d, local_size %d\n", - my_id, level, CFfile, first_local_row, local_size); - FILE *fp; - if ((fp = fopen(CFfile, "r")) == NULL) - { - hypre_printf("cannot open file %s\n", CFfile); - exit(0); - } - HYPRE_Int i; - for (i=0; i 0) { @@ -1290,11 +1379,17 @@ hypre_BoomerAMGSetup( void *amg_vdata, hypre_BoomerAMGCoarsenFalgout(SN, SN, measure_type, coarsen_cut_factor, debug_flag, &CFN_marker); else if (coarsen_type == 7) + { hypre_BoomerAMGCoarsen(SN, SN, 2, debug_flag, &CFN_marker); + } else if (coarsen_type == 8) + { hypre_BoomerAMGCoarsenPMIS(SN, SN, 0, debug_flag, &CFN_marker); + } else if (coarsen_type == 9) + { hypre_BoomerAMGCoarsenPMIS(SN, SN, 2, debug_flag, &CFN_marker); + } else if (coarsen_type == 10) hypre_BoomerAMGCoarsenHMIS(SN, SN, measure_type, coarsen_cut_factor, debug_flag, &CFN_marker); @@ -1309,14 +1404,14 @@ hypre_BoomerAMGSetup( void *amg_vdata, debug_flag, &CFN_marker); if (level < agg_num_levels) { - hypre_BoomerAMGCoarseParms(comm, local_num_vars/num_functions, + hypre_BoomerAMGCoarseParms(comm, local_num_vars / num_functions, 1, dof_func_array[level], CFN_marker, - &coarse_dof_func,&coarse_pnts_global1); + &coarse_dof_func, coarse_pnts_global1); hypre_BoomerAMGCreate2ndS(SN, hypre_IntArrayData(CFN_marker), num_paths, coarse_pnts_global1, &S2); if (coarsen_type == 10) { - hypre_BoomerAMGCoarsenHMIS(S2, S2, measure_type+3, coarsen_cut_factor, + hypre_BoomerAMGCoarsenHMIS(S2, S2, measure_type + 3, coarsen_cut_factor, debug_flag, &CF2_marker); } else if (coarsen_type == 8) @@ -1374,24 +1469,45 @@ hypre_BoomerAMGSetup( void *amg_vdata, /**************************************************/ /*********Set the fixed index to CF_marker*********/ /* copy CF_marker to the host if needed */ - if (hypre_GetActualMemLocation(hypre_IntArrayMemoryLocation(CF_marker_array[level])) == hypre_MEMORY_DEVICE) - { - CF_marker_host = hypre_IntArrayCloneDeep_v2(CF_marker_array[level], HYPRE_MEMORY_HOST); - } - else - { - CF_marker_host = CF_marker_array[level]; - } - /* Set fine points (F_PT) given by the user */ - if ((num_F_points > 0) && (level == 0)) - { - for (j = 0; j < num_F_points; j++) + if ( (num_F_points > 0) && (level == 0) ) + { +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_IntArrayMemoryLocation( + CF_marker_array[level]) ); + if (exec == HYPRE_EXEC_DEVICE) + { +#if defined(HYPRE_USING_SYCL) + auto perm_it = oneapi::dpl::make_permutation_iterator( + hypre_IntArrayData(CF_marker_array[level]), + oneapi::dpl::make_transform_iterator( F_points_marker, + [first_local_row = first_local_row] (const auto & x) {return x - first_local_row;} ) ); + hypreSycl_transform_if( perm_it, + perm_it + num_F_points, + F_points_marker, + perm_it, + [] (const auto & x) {return -1;}, + in_range(first_local_row, first_local_row + local_size - 1) ); +#else + HYPRE_THRUST_CALL( scatter_if, + thrust::make_constant_iterator(-1), + thrust::make_constant_iterator(-1) + num_F_points, + thrust::make_transform_iterator(F_points_marker, _1 - first_local_row), + F_points_marker, + hypre_IntArrayData(CF_marker_array[level]), + in_range(first_local_row, first_local_row + local_size - 1) ); +#endif + } + else +#endif { - row = (HYPRE_Int) (F_points_marker[j] - first_local_row); - if ((row >= 0) && (row < local_size)) + for (j = 0; j < num_F_points; j++) { - hypre_IntArrayData(CF_marker_host)[row] = -1; // Assumes F_PT == -1 + row = (HYPRE_Int) (F_points_marker[j] - first_local_row); + if ((row >= 0) && (row < local_size)) + { + hypre_IntArrayData(CF_marker_array[level])[row] = -1; // Assumes F_PT == -1 + } } } } @@ -1405,59 +1521,137 @@ hypre_BoomerAMGSetup( void *amg_vdata, } else if (level < hypre_ParAMGDataCPointsLevel(amg_data)) { - for (j = 0; j < num_C_points_coarse; j++) - { - hypre_IntArrayData(CF_marker_host)[C_points_local_marker[j]] = 2; - } +#if defined(HYPRE_USING_GPU) + HYPRE_MemoryLocation memory_location = hypre_IntArrayMemoryLocation(CF_marker_array[level]); + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1(memory_location); + if (exec == HYPRE_EXEC_DEVICE) + { +#if defined(HYPRE_USING_SYCL) + auto perm_it = oneapi::dpl::make_permutation_iterator(hypre_IntArrayData(CF_marker_array[level]), + C_points_local_marker); + HYPRE_ONEDPL_CALL( std::transform, + perm_it, + perm_it + num_C_points_coarse, + perm_it, + [] (const auto & x) {return 2;} ); +#else + HYPRE_THRUST_CALL( scatter, + thrust::make_constant_iterator(2), + thrust::make_constant_iterator(2) + num_C_points_coarse, + C_points_local_marker, + hypre_IntArrayData(CF_marker_array[level]) ); +#endif - local_coarse_size = 0; - k = 0; - for (j = 0; j < local_num_vars; j ++) + if ( level + 1 < hypre_ParAMGDataCPointsLevel(amg_data) ) + { + HYPRE_Int *tmp = hypre_TAlloc(HYPRE_Int, local_num_vars, memory_location); +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::exclusive_scan, + oneapi::dpl::make_transform_iterator(hypre_IntArrayData(CF_marker_array[level]), + in_range(1, 2)), + oneapi::dpl::make_transform_iterator(hypre_IntArrayData(CF_marker_array[level]) + local_num_vars, + in_range(1, 2)), + tmp, + HYPRE_Int(0) ); + + /* RL: total local_coarse_size is not computed. I don't think it's needed */ + hypreSycl_copy_if( tmp, + tmp + local_num_vars, + hypre_IntArrayData(CF_marker_array[level]), + C_points_local_marker, + equal(2) ); +#else + HYPRE_THRUST_CALL( exclusive_scan, + thrust::make_transform_iterator(hypre_IntArrayData(CF_marker_array[level]), + in_range(1, 2)), + thrust::make_transform_iterator(hypre_IntArrayData(CF_marker_array[level]) + local_num_vars, + in_range(1, 2)), + tmp, + HYPRE_Int(0) ); + + /* RL: total local_coarse_size is not computed. I don't think it's needed */ + HYPRE_THRUST_CALL( copy_if, + tmp, + tmp + local_num_vars, + hypre_IntArrayData(CF_marker_array[level]), + C_points_local_marker, + equal(2) ); +#endif + + hypre_TFree(tmp, memory_location); + } + +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::replace, + hypre_IntArrayData(CF_marker_array[level]), + hypre_IntArrayData(CF_marker_array[level]) + local_num_vars, + 2, + 1 ); +#else + HYPRE_THRUST_CALL( replace, + hypre_IntArrayData(CF_marker_array[level]), + hypre_IntArrayData(CF_marker_array[level]) + local_num_vars, + 2, + 1 ); +#endif + } + else +#endif { - if (hypre_IntArrayData(CF_marker_host)[j] == 1) + for (j = 0; j < num_C_points_coarse; j++) { - local_coarse_size++; + hypre_IntArrayData(CF_marker_array[level])[C_points_local_marker[j]] = 2; } - else if (hypre_IntArrayData(CF_marker_host)[j] == 2) + + local_coarse_size = 0; + k = 0; + for (j = 0; j < local_num_vars; j ++) { - if ((level + 1) < hypre_ParAMGDataCPointsLevel(amg_data)) + if (hypre_IntArrayData(CF_marker_array[level])[j] == 1) + { + local_coarse_size++; + } + else if (hypre_IntArrayData(CF_marker_array[level])[j] == 2) { - C_points_local_marker[k++] = local_coarse_size; + if ((level + 1) < hypre_ParAMGDataCPointsLevel(amg_data)) + { + C_points_local_marker[k++] = local_coarse_size; + } + local_coarse_size++; + hypre_IntArrayData(CF_marker_array[level])[j] = 1; } - local_coarse_size++; - hypre_IntArrayData(CF_marker_host)[j] = 1; } + // RL: so k is not used after this? update num_C_points_coarse? } } } - /* copy back to device and destroy host copy */ - if (hypre_GetActualMemLocation(hypre_IntArrayMemoryLocation(CF_marker_array[level])) == hypre_MEMORY_DEVICE) - { - hypre_IntArrayCopy(CF_marker_host, CF_marker_array[level]); - hypre_IntArrayDestroy(CF_marker_host); - } - /*****xxxxxxxxxxxxx changes for min_coarse_size */ /* here we will determine the coarse grid size to be able to determine if it is not smaller than requested minimal size */ + hypre_GpuProfilingPushRange("CheckMinSize"); + if (level >= agg_num_levels) { if (block_mode) { hypre_BoomerAMGCoarseParms(comm, hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(AN)), - 1, NULL, CF_marker_array[level], NULL, &coarse_pnts_global); + 1, NULL, CF_marker_array[level], NULL, coarse_pnts_global); } else { hypre_BoomerAMGCoarseParms(comm, local_num_vars, num_functions, dof_func_array[level], CF_marker_array[level], - &coarse_dof_func, &coarse_pnts_global); + &coarse_dof_func, coarse_pnts_global); + } + if (my_id == num_procs - 1) + { + coarse_size = coarse_pnts_global[1]; } - if (my_id == (num_procs -1)) coarse_size = coarse_pnts_global[1]; - hypre_MPI_Bcast(&coarse_size, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); + hypre_MPI_Bcast(&coarse_size, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); + /* if no coarse-grid, stop coarsening, and set the * coarsest solve to be a single sweep of default smoother or smoother set by user */ if ((coarse_size == 0) || (coarse_size == fine_size)) @@ -1469,11 +1663,11 @@ hypre_BoomerAMGSetup( void *amg_vdata, { grid_relax_type[3] = grid_relax_type[0]; num_grid_sweeps[3] = 1; - if (grid_relax_points) grid_relax_points[3][0] = 0; + if (grid_relax_points) { grid_relax_points[3][0] = 0; } } - if (S) hypre_ParCSRMatrixDestroy(S); - if (SN) hypre_ParCSRMatrixDestroy(SN); - if (AN) hypre_ParCSRMatrixDestroy(AN); + if (S) { hypre_ParCSRMatrixDestroy(S); } + if (SN) { hypre_ParCSRMatrixDestroy(SN); } + if (AN) { hypre_ParCSRMatrixDestroy(AN); } //hypre_TFree(CF_marker, HYPRE_MEMORY_HOST); if (level > 0) { @@ -1492,19 +1686,28 @@ hypre_BoomerAMGSetup( void *amg_vdata, Sabs = NULL; } + if (coarse_dof_func) + { + hypre_IntArrayDestroy(coarse_dof_func); + coarse_dof_func = NULL; + } + HYPRE_ANNOTATE_REGION_END("%s", "Coarsening"); break; } if (coarse_size < min_coarse_size) { - if (S) hypre_ParCSRMatrixDestroy(S); - if (SN) hypre_ParCSRMatrixDestroy(SN); - if (AN) hypre_ParCSRMatrixDestroy(AN); - if (num_functions > 1) hypre_IntArrayDestroy(coarse_dof_func); + if (S) { hypre_ParCSRMatrixDestroy(S); } + if (SN) { hypre_ParCSRMatrixDestroy(SN); } + if (AN) { hypre_ParCSRMatrixDestroy(AN); } + if (num_functions > 1) + { + hypre_IntArrayDestroy(coarse_dof_func); + coarse_dof_func = NULL; + } hypre_IntArrayDestroy(CF_marker_array[level]); CF_marker_array[level] = NULL; - hypre_TFree(coarse_pnts_global, HYPRE_MEMORY_HOST); if (level > 0) { hypre_ParVectorDestroy(F_array[level]); @@ -1523,6 +1726,8 @@ hypre_BoomerAMGSetup( void *amg_vdata, } } + hypre_GpuProfilingPopRange(); + /*****xxxxxxxxxxxxx changes for min_coarse_size end */ HYPRE_ANNOTATE_REGION_END("%s", "Coarsening"); HYPRE_ANNOTATE_REGION_BEGIN("%s", "Interpolation"); @@ -1563,48 +1768,68 @@ hypre_BoomerAMGSetup( void *amg_vdata, else if (agg_interp_type == 6) { hypre_BoomerAMGBuildModExtPIInterp(A_array[level], - CF_marker, S, coarse_pnts_global1, - num_functions, dof_func_data, - debug_flag, - agg_P12_trunc_factor, agg_P12_max_elmts, &P1); + CF_marker, S, coarse_pnts_global1, + num_functions, dof_func_data, + debug_flag, + agg_P12_trunc_factor, agg_P12_max_elmts, &P1); } else if (agg_interp_type == 7) { hypre_BoomerAMGBuildModExtPEInterp(A_array[level], - CF_marker, S, coarse_pnts_global1, - num_functions, dof_func_data, - debug_flag, - agg_P12_trunc_factor, agg_P12_max_elmts, &P1); + CF_marker, S, coarse_pnts_global1, + num_functions, dof_func_data, + debug_flag, + agg_P12_trunc_factor, agg_P12_max_elmts, &P1); } if (agg_interp_type == 4) { - hypre_BoomerAMGCorrectCFMarker (CF_marker_array[level], CFN_marker); - /*hypre_TFree(coarse_dof_func); - coarse_dof_func = NULL;*/ + hypre_BoomerAMGCorrectCFMarker(CF_marker_array[level], CFN_marker); hypre_IntArrayDestroy(CFN_marker); CFN_marker = NULL; hypre_BoomerAMGCoarseParms(comm, local_num_vars, num_functions, dof_func_array[level], CF_marker_array[level], - &coarse_dof_func,&coarse_pnts_global); + &coarse_dof_func, coarse_pnts_global); hypre_BoomerAMGBuildMultipass(A_array[level], CF_marker, S, coarse_pnts_global, num_functions, dof_func_data, debug_flag, agg_trunc_factor, agg_P_max_elmts, sep_weight, &P); } + else if (agg_interp_type == 8) + { + hypre_BoomerAMGCorrectCFMarker(CF_marker_array[level], CFN_marker); + hypre_IntArrayDestroy(CFN_marker); + CFN_marker = NULL; + hypre_BoomerAMGCoarseParms(comm, local_num_vars, + num_functions, dof_func_array[level], CF_marker_array[level], + &coarse_dof_func, coarse_pnts_global); + hypre_BoomerAMGBuildModMultipass(A_array[level], + CF_marker, S, coarse_pnts_global, + agg_trunc_factor, agg_P_max_elmts, 8, + num_functions, dof_func_data, &P); + } + else if (agg_interp_type == 9) + { + hypre_BoomerAMGCorrectCFMarker(CF_marker_array[level], CFN_marker); + hypre_IntArrayDestroy(CFN_marker); + CFN_marker = NULL; + hypre_BoomerAMGCoarseParms(comm, local_num_vars, + num_functions, dof_func_array[level], CF_marker_array[level], + &coarse_dof_func, coarse_pnts_global); + hypre_BoomerAMGBuildModMultipass(A_array[level], + CF_marker, S, coarse_pnts_global, + agg_trunc_factor, agg_P_max_elmts, 9, + num_functions, dof_func_data, &P); + } else { hypre_BoomerAMGCorrectCFMarker2 (CF_marker_array[level], (CFN_marker)); hypre_IntArrayDestroy(CFN_marker); CFN_marker = NULL; - /*hypre_TFree(coarse_dof_func); - coarse_dof_func = NULL;*/ hypre_BoomerAMGCoarseParms(comm, local_num_vars, num_functions, dof_func_array[level], CF_marker_array[level], - &coarse_dof_func,&coarse_pnts_global); - /*if (num_functions > 1 && nodal > -1 && (!block_mode) ) - dof_func_array[level+1] = coarse_dof_func;*/ + &coarse_dof_func, coarse_pnts_global); if (agg_interp_type == 1 || agg_interp_type == 6 ) { hypre_BoomerAMGBuildPartialExtPIInterp(A_array[level], @@ -1648,7 +1873,6 @@ hypre_BoomerAMGSetup( void *amg_vdata, agg_P12_trunc_factor, agg_P12_max_elmts, &P2); } - if (hypre_ParAMGDataModularizedMatMat(amg_data)) { P = hypre_ParCSRMatMat(P1, P2); @@ -1660,6 +1884,12 @@ hypre_BoomerAMGSetup( void *amg_vdata, hypre_BoomerAMGInterpTruncation(P, agg_trunc_factor, agg_P_max_elmts); + if (agg_trunc_factor != 0.0 || agg_P_max_elmts > 0 || + agg_P12_trunc_factor != 0.0 || agg_P12_max_elmts > 0) + { + hypre_ParCSRMatrixCompressOffdMap(P); + } + hypre_MatvecCommPkgCreate(P); hypre_ParCSRMatrixDestroy(P1); hypre_ParCSRMatrixDestroy(P2); @@ -1669,10 +1899,9 @@ hypre_BoomerAMGSetup( void *amg_vdata, { if (agg_interp_type == 4) { - hypre_BoomerAMGCorrectCFMarker (CFN_marker, CF2_marker); + hypre_BoomerAMGCorrectCFMarker(CFN_marker, CF2_marker); hypre_IntArrayDestroy(CF2_marker); CF2_marker = NULL; - hypre_TFree(coarse_pnts_global1, HYPRE_MEMORY_HOST); hypre_BoomerAMGCreateScalarCFS(SN, A_array[level], hypre_IntArrayData(CFN_marker), num_functions, nodal, keep_same_sign, @@ -1681,13 +1910,51 @@ hypre_BoomerAMGSetup( void *amg_vdata, CFN_marker = NULL; hypre_BoomerAMGCoarseParms(comm, local_num_vars, num_functions, dof_func_array[level], CF_marker_array[level], - &coarse_dof_func,&coarse_pnts_global); + &coarse_dof_func, coarse_pnts_global); hypre_BoomerAMGBuildMultipass(A_array[level], CF_marker, S, coarse_pnts_global, num_functions, dof_func_data, debug_flag, agg_trunc_factor, agg_P_max_elmts, sep_weight, &P); } + else if (agg_interp_type == 8) + { + hypre_BoomerAMGCorrectCFMarker(CFN_marker, CF2_marker); + hypre_IntArrayDestroy(CF2_marker); + CF2_marker = NULL; + + hypre_BoomerAMGCreateScalarCFS(SN, A_array[level], hypre_IntArrayData(CFN_marker), + num_functions, nodal, keep_same_sign, + &dof_func, &(CF_marker_array[level]), &S); + hypre_IntArrayDestroy(CFN_marker); + CFN_marker = NULL; + hypre_BoomerAMGCoarseParms(comm, local_num_vars, + num_functions, dof_func_array[level], CF_marker_array[level], + &coarse_dof_func, coarse_pnts_global); + hypre_BoomerAMGBuildModMultipass(A_array[level], + CF_marker, S, coarse_pnts_global, + agg_trunc_factor, agg_P_max_elmts, 8, + num_functions, dof_func_data, &P); + } + else if (agg_interp_type == 9) + { + hypre_BoomerAMGCorrectCFMarker(CFN_marker, CF2_marker); + hypre_IntArrayDestroy(CF2_marker); + CF2_marker = NULL; + + hypre_BoomerAMGCreateScalarCFS(SN, A_array[level], hypre_IntArrayData(CFN_marker), + num_functions, nodal, keep_same_sign, + &dof_func, &(CF_marker_array[level]), &S); + hypre_IntArrayDestroy(CFN_marker); + CFN_marker = NULL; + hypre_BoomerAMGCoarseParms(comm, local_num_vars, + num_functions, dof_func_array[level], CF_marker_array[level], + &coarse_dof_func, coarse_pnts_global); + hypre_BoomerAMGBuildModMultipass(A_array[level], + CF_marker, S, coarse_pnts_global, + agg_trunc_factor, agg_P_max_elmts, 9, + num_functions, dof_func_data, &P); + } else { hypre_BoomerAMGCreateScalarCFS(SN, A_array[level], hypre_IntArrayData(CFN_marker), @@ -1721,26 +1988,26 @@ hypre_BoomerAMGSetup( void *amg_vdata, else if (agg_interp_type == 5) { hypre_BoomerAMGBuildModExtInterp(A_array[level], - hypre_IntArrayData(CF3_marker), S, coarse_pnts_global1, - num_functions, dof_func_data, - debug_flag, - agg_P12_trunc_factor, agg_P12_max_elmts, &P1); + hypre_IntArrayData(CF3_marker), S, coarse_pnts_global1, + num_functions, dof_func_data, + debug_flag, + agg_P12_trunc_factor, agg_P12_max_elmts, &P1); } else if (agg_interp_type == 6) { hypre_BoomerAMGBuildModExtPIInterp(A_array[level], - hypre_IntArrayData(CF3_marker), S, coarse_pnts_global1, - num_functions, dof_func_data, - debug_flag, - agg_P12_trunc_factor, agg_P12_max_elmts, &P1); + hypre_IntArrayData(CF3_marker), S, coarse_pnts_global1, + num_functions, dof_func_data, + debug_flag, + agg_P12_trunc_factor, agg_P12_max_elmts, &P1); } else if (agg_interp_type == 7 ) { hypre_BoomerAMGBuildModExtPEInterp(A_array[level], - hypre_IntArrayData(CF3_marker), S, coarse_pnts_global1, - num_functions, dof_func_data, - debug_flag, - agg_P12_trunc_factor, agg_P12_max_elmts, &P1); + hypre_IntArrayData(CF3_marker), S, coarse_pnts_global1, + num_functions, dof_func_data, + debug_flag, + agg_P12_trunc_factor, agg_P12_max_elmts, &P1); } hypre_BoomerAMGCorrectCFMarker2 (CFN_marker, CF2_marker); @@ -1757,9 +2024,7 @@ hypre_BoomerAMGSetup( void *amg_vdata, CFN_marker = NULL; hypre_BoomerAMGCoarseParms(comm, local_num_vars, num_functions, dof_func_array[level], CF_marker_array[level], - &coarse_dof_func,&coarse_pnts_global); - /*if (num_functions > 1 && nodal > -1 && (!block_mode) ) - dof_func_array[level+1] = coarse_dof_func;*/ + &coarse_dof_func, coarse_pnts_global); if (agg_interp_type == 1 || agg_interp_type == 6) { hypre_BoomerAMGBuildPartialExtPIInterp(A_array[level], @@ -1787,18 +2052,18 @@ hypre_BoomerAMGSetup( void *amg_vdata, else if (agg_interp_type == 5) { hypre_BoomerAMGBuildModPartialExtInterp(A_array[level], - CF_marker, S, coarse_pnts_global, coarse_pnts_global1, - num_functions, dof_func_data, - debug_flag, - agg_P12_trunc_factor, agg_P12_max_elmts, &P2); + CF_marker, S, coarse_pnts_global, coarse_pnts_global1, + num_functions, dof_func_data, + debug_flag, + agg_P12_trunc_factor, agg_P12_max_elmts, &P2); } else if (agg_interp_type == 7) { hypre_BoomerAMGBuildModPartialExtPEInterp(A_array[level], - CF_marker, S, coarse_pnts_global, coarse_pnts_global1, - num_functions, dof_func_data, - debug_flag, - agg_P12_trunc_factor, agg_P12_max_elmts, &P2); + CF_marker, S, coarse_pnts_global, coarse_pnts_global1, + num_functions, dof_func_data, + debug_flag, + agg_P12_trunc_factor, agg_P12_max_elmts, &P2); } if (hypre_ParAMGDataModularizedMatMat(amg_data)) @@ -1809,8 +2074,16 @@ hypre_BoomerAMGSetup( void *amg_vdata, { P = hypre_ParMatmul(P1, P2); } + hypre_BoomerAMGInterpTruncation(P, agg_trunc_factor, agg_P_max_elmts); + + if (agg_trunc_factor != 0.0 || agg_P_max_elmts > 0 || + agg_P12_trunc_factor != 0.0 || agg_P12_max_elmts > 0) + { + hypre_ParCSRMatrixCompressOffdMap(P); + } + hypre_MatvecCommPkgCreate(P); hypre_ParCSRMatrixDestroy(P1); hypre_ParCSRMatrixDestroy(P2); @@ -1826,33 +2099,36 @@ hypre_BoomerAMGSetup( void *amg_vdata, } AN = NULL; } - if (my_id == (num_procs -1)) coarse_size = coarse_pnts_global[1]; - hypre_MPI_Bcast(&coarse_size, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); + if (my_id == (num_procs - 1)) + { + coarse_size = coarse_pnts_global[1]; + } + hypre_MPI_Bcast(&coarse_size, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); } else /* no aggressive coarsening */ { /**** Get the coarse parameters ****/ -/* xxxxxxxxxxxxxxxxxxxxxxxxx change for min_coarse_size - if (block_mode ) - { - hypre_BoomerAMGCoarseParms(comm, - hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(AN)), - 1, NULL, CF_marker, NULL, &coarse_pnts_global); - } - else - { - hypre_BoomerAMGCoarseParms(comm, local_num_vars, - num_functions, dof_func_array[level], CF_marker, - &coarse_dof_func,&coarse_pnts_global); - } - if (my_id == (num_procs -1)) coarse_size = coarse_pnts_global[1]; - hypre_MPI_Bcast(&coarse_size, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); - xxxxxxxxxxxxxxxxxxxxxxxxx change for min_coarse_size */ - if (debug_flag==1) + /* xxxxxxxxxxxxxxxxxxxxxxxxx change for min_coarse_size + if (block_mode ) + { + hypre_BoomerAMGCoarseParms(comm, + hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(AN)), + 1, NULL, CF_marker, NULL, coarse_pnts_global); + } + else + { + hypre_BoomerAMGCoarseParms(comm, local_num_vars, + num_functions, dof_func_array[level], CF_marker, + &coarse_dof_func, coarse_pnts_global); + } + if (my_id == (num_procs -1)) coarse_size = coarse_pnts_global[1]; + hypre_MPI_Bcast(&coarse_size, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); + xxxxxxxxxxxxxxxxxxxxxxxxx change for min_coarse_size */ + if (debug_flag == 1) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Level = %d Coarsen Time = %f\n", - my_id,level, wall_time); + my_id, level, wall_time); fflush(NULL); } @@ -1864,10 +2140,13 @@ hypre_BoomerAMGSetup( void *amg_vdata, HYPRE_Int is_triangular = hypre_ParAMGDataIsTriangular(amg_data); HYPRE_Int gmres_switch = hypre_ParAMGDataGMRESSwitchR(amg_data); /* !!! RL: ensure that CF_marker contains -1 or 1 !!! */ -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - if (hypre_IntArrayMemoryLocation(CF_marker_array[level]) == HYPRE_MEMORY_DEVICE) +#if defined(HYPRE_USING_GPU) + HYPRE_MemoryLocation memory_location = hypre_IntArrayMemoryLocation(CF_marker_array[level]); + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1(memory_location); + if (exec == HYPRE_EXEC_DEVICE) { - hypre_BoomerAMGCFMarkerTo1minus1Device(CF_marker, hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(A_array[level]))); + hypre_BoomerAMGCFMarkerTo1minus1Device(CF_marker, + hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(A_array[level]))); } else #endif @@ -1919,7 +2198,7 @@ hypre_BoomerAMGSetup( void *amg_vdata, } } - if (debug_flag==1) wall_time = time_getWallclockSeconds(); + if (debug_flag == 1) { wall_time = time_getWallclockSeconds(); } if (interp_type == 4) { @@ -1974,16 +2253,16 @@ hypre_BoomerAMGSetup( void *amg_vdata, else if (interp_type == 17) /*Extended+i MM interpolation */ { hypre_BoomerAMGBuildModExtPIInterp(A_array[level], CF_marker, - S, coarse_pnts_global, - num_functions, dof_func_data, - debug_flag, trunc_factor, P_max_elmts, &P); + S, coarse_pnts_global, + num_functions, dof_func_data, + debug_flag, trunc_factor, P_max_elmts, &P); } else if (interp_type == 18) /*Extended+e MM interpolation */ { hypre_BoomerAMGBuildModExtPEInterp(A_array[level], CF_marker, - S, coarse_pnts_global, - num_functions, dof_func_data, - debug_flag, trunc_factor, P_max_elmts, &P); + S, coarse_pnts_global, + num_functions, dof_func_data, + debug_flag, trunc_factor, P_max_elmts, &P); } else if (interp_type == 7) /*Extended+i (if no common C) interpolation */ @@ -2029,197 +2308,196 @@ hypre_BoomerAMGSetup( void *amg_vdata, /* convert A to a block matrix if there isn't already a block matrix - there should be one already*/ - if (!(A_block_array[level])) - { - A_block_array[level] = hypre_ParCSRBlockMatrixConvertFromParCSRMatrix( - A_array[level], num_functions); - } - - /* note that the current CF_marker is nodal */ - if (interp_type == 11) - { - hypre_BoomerAMGBuildBlockInterpDiag( A_block_array[level], CF_marker, - SN, - coarse_pnts_global, 1, - NULL, - debug_flag, - trunc_factor, P_max_elmts,1, - &P_block_array[level]); + if (!(A_block_array[level])) + { + A_block_array[level] = hypre_ParCSRBlockMatrixConvertFromParCSRMatrix( + A_array[level], num_functions); + } + /* note that the current CF_marker is nodal */ + if (interp_type == 11) + { + hypre_BoomerAMGBuildBlockInterpDiag( A_block_array[level], CF_marker, + SN, + coarse_pnts_global, 1, + NULL, + debug_flag, + trunc_factor, P_max_elmts, 1, + &P_block_array[level]); - } - else if (interp_type == 22) - { - hypre_BoomerAMGBuildBlockInterpRV( A_block_array[level], CF_marker, - SN, - coarse_pnts_global, 1, - NULL, - debug_flag, - trunc_factor, P_max_elmts, - &P_block_array[level]); - } - else if (interp_type == 23) - { - hypre_BoomerAMGBuildBlockInterpRV( A_block_array[level], CF_marker, - SN, - coarse_pnts_global, 1, - NULL, - debug_flag, - trunc_factor, P_max_elmts, - &P_block_array[level]); - } - else if (interp_type == 20) - { - hypre_BoomerAMGBuildBlockInterp( A_block_array[level], CF_marker, - SN, - coarse_pnts_global, 1, - NULL, - debug_flag, - trunc_factor, P_max_elmts, 0, - &P_block_array[level]); - } - else if (interp_type == 21) - { - hypre_BoomerAMGBuildBlockInterpDiag( A_block_array[level], CF_marker, - SN, - coarse_pnts_global, 1, - NULL, - debug_flag, - trunc_factor, P_max_elmts, 0, - &P_block_array[level]); - } - else if (interp_type == 24) - { - hypre_BoomerAMGBuildBlockDirInterp( A_block_array[level], CF_marker, + } + else if (interp_type == 22) + { + hypre_BoomerAMGBuildBlockInterpRV( A_block_array[level], CF_marker, SN, coarse_pnts_global, 1, NULL, debug_flag, trunc_factor, P_max_elmts, &P_block_array[level]); - } + } + else if (interp_type == 23) + { + hypre_BoomerAMGBuildBlockInterpRV( A_block_array[level], CF_marker, + SN, + coarse_pnts_global, 1, + NULL, + debug_flag, + trunc_factor, P_max_elmts, + &P_block_array[level]); + } + else if (interp_type == 20) + { + hypre_BoomerAMGBuildBlockInterp( A_block_array[level], CF_marker, + SN, + coarse_pnts_global, 1, + NULL, + debug_flag, + trunc_factor, P_max_elmts, 0, + &P_block_array[level]); - else /* interp_type ==10 */ - { + } + else if (interp_type == 21) + { + hypre_BoomerAMGBuildBlockInterpDiag( A_block_array[level], CF_marker, + SN, + coarse_pnts_global, 1, + NULL, + debug_flag, + trunc_factor, P_max_elmts, 0, + &P_block_array[level]); + } + else if (interp_type == 24) + { + hypre_BoomerAMGBuildBlockDirInterp( A_block_array[level], CF_marker, + SN, + coarse_pnts_global, 1, + NULL, + debug_flag, + trunc_factor, P_max_elmts, + &P_block_array[level]); + } - hypre_BoomerAMGBuildBlockInterp( A_block_array[level], CF_marker, - SN, - coarse_pnts_global, 1, - NULL, - debug_flag, - trunc_factor, P_max_elmts, 1, - &P_block_array[level]); - - } - - /* we need to set the global number of cols in P, as this was - not done in the interp - (which calls the matrix create) since we didn't - have the global partition */ - /* this has to be done before converting from block to non-block*/ - hypre_ParCSRBlockMatrixGlobalNumCols(P_block_array[level]) = coarse_size; - - /* if we don't do nodal relaxation, we need a CF_array that is - not nodal - right now we don't allow this to happen though*/ - /* - if (grid_relax_type[0] < 20 ) - { - hypre_BoomerAMGCreateScalarCF(CFN_marker, num_functions, - hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(AN)), - &dof_func1, &CF_marker); - - dof_func_array[level+1] = dof_func1; - hypre_TFree(CFN_marker, HYPRE_MEMORY_HOST); - CF_marker_array[level] = CF_marker; - } - */ - - /* clean up other things */ - hypre_ParCSRMatrixDestroy(AN); - hypre_ParCSRMatrixDestroy(SN); - - } - else /* not block mode - use default interp (interp_type = 0) */ - { - if (nodal > -1) /* non-systems, or systems with unknown approach interpolation*/ - { - /* if systems, do we want to use an interp. that uses the full strength matrix?*/ - - if ( (num_functions > 1) && (interp_type == 19 || interp_type == 18 || interp_type == 17 || interp_type == 16)) + else /* interp_type ==10 */ + { + + hypre_BoomerAMGBuildBlockInterp( A_block_array[level], CF_marker, + SN, + coarse_pnts_global, 1, + NULL, + debug_flag, + trunc_factor, P_max_elmts, 1, + &P_block_array[level]); + + } + + /* we need to set the global number of cols in P, as this was + not done in the interp + (which calls the matrix create) since we didn't + have the global partition */ + /* this has to be done before converting from block to non-block*/ + hypre_ParCSRBlockMatrixGlobalNumCols(P_block_array[level]) = coarse_size; + + /* if we don't do nodal relaxation, we need a CF_array that is + not nodal - right now we don't allow this to happen though*/ + /* + if (grid_relax_type[0] < 20 ) { - /* so create a second strength matrix and build interp with with num_functions = 1 */ - hypre_BoomerAMGCreateS(A_array[level], - strong_threshold, max_row_sum, - 1, dof_func_data,&S2); - switch (interp_type) - { - - case 19: - dbg_flg = debug_flag; - if (amg_print_level) dbg_flg = -debug_flag; - hypre_BoomerAMGBuildInterp(A_array[level], CF_marker, - S2, coarse_pnts_global, 1, - dof_func_data, - dbg_flg, trunc_factor, P_max_elmts, &P); - break; - - case 18: - hypre_BoomerAMGBuildStdInterp(A_array[level], CF_marker, - S2, coarse_pnts_global, 1, dof_func_data, - debug_flag, trunc_factor, P_max_elmts, 0, &P); - - break; - - case 17: - hypre_BoomerAMGBuildExtPIInterp(A_array[level], CF_marker, - S2, coarse_pnts_global, 1, dof_func_data, - debug_flag, trunc_factor, P_max_elmts, &P); - break; - case 16: - dbg_flg = debug_flag; - if (amg_print_level) dbg_flg = -debug_flag; - hypre_BoomerAMGBuildInterpModUnk(A_array[level], CF_marker, - S2, coarse_pnts_global, num_functions, dof_func_data, - dbg_flg, trunc_factor, P_max_elmts, &P); - break; - - } - - - hypre_ParCSRMatrixDestroy(S2); + hypre_BoomerAMGCreateScalarCF(CFN_marker, num_functions, + hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(AN)), + &dof_func1, &CF_marker); + dof_func_array[level+1] = dof_func1; + hypre_TFree(CFN_marker, HYPRE_MEMORY_HOST); + CF_marker_array[level] = CF_marker; } - else /* one function only or unknown-based interpolation- */ - { - dbg_flg = debug_flag; - if (amg_print_level) dbg_flg = -debug_flag; + */ - hypre_BoomerAMGBuildInterp(A_array[level], CF_marker, - S, coarse_pnts_global, num_functions, - dof_func_data, - dbg_flg, trunc_factor, P_max_elmts, &P); + /* clean up other things */ + hypre_ParCSRMatrixDestroy(AN); + hypre_ParCSRMatrixDestroy(SN); + + } + else /* not block mode - use default interp (interp_type = 0) */ + { + if (nodal > -1) /* non-systems, or systems with unknown approach interpolation*/ + { + /* if systems, do we want to use an interp. that uses the full strength matrix?*/ + if ( (num_functions > 1) && (interp_type == 19 || interp_type == 18 || interp_type == 17 || + interp_type == 16)) + { + /* so create a second strength matrix and build interp with with num_functions = 1 */ + hypre_BoomerAMGCreateS(A_array[level], + strong_threshold, max_row_sum, + 1, dof_func_data, &S2); + switch (interp_type) + { + + case 19: + dbg_flg = debug_flag; + if (amg_print_level) { dbg_flg = -debug_flag; } + hypre_BoomerAMGBuildInterp(A_array[level], CF_marker, + S2, coarse_pnts_global, 1, + dof_func_data, + dbg_flg, trunc_factor, P_max_elmts, &P); + break; + + case 18: + hypre_BoomerAMGBuildStdInterp(A_array[level], CF_marker, + S2, coarse_pnts_global, 1, dof_func_data, + debug_flag, trunc_factor, P_max_elmts, 0, &P); + + break; + + case 17: + hypre_BoomerAMGBuildExtPIInterp(A_array[level], CF_marker, + S2, coarse_pnts_global, 1, dof_func_data, + debug_flag, trunc_factor, P_max_elmts, &P); + break; + case 16: + dbg_flg = debug_flag; + if (amg_print_level) { dbg_flg = -debug_flag; } + hypre_BoomerAMGBuildInterpModUnk(A_array[level], CF_marker, + S2, coarse_pnts_global, num_functions, dof_func_data, + dbg_flg, trunc_factor, P_max_elmts, &P); + break; + + } + + + hypre_ParCSRMatrixDestroy(S2); - } - } - } - } - else - { - hypre_BoomerAMGBuildInterpGSMG(NULL, CF_marker, S, - coarse_pnts_global, num_functions, dof_func_data, - debug_flag, trunc_factor, &P); - } - } /* end of no aggressive coarsening */ + } + else /* one function only or unknown-based interpolation- */ + { + dbg_flg = debug_flag; + if (amg_print_level) { dbg_flg = -debug_flag; } - /*dof_func_array[level+1] = NULL; - if (num_functions > 1 && nodal > -1 && (!block_mode) ) - dof_func_array[level+1] = coarse_dof_func;*/ + hypre_BoomerAMGBuildInterp(A_array[level], CF_marker, + S, coarse_pnts_global, num_functions, + dof_func_data, + dbg_flg, trunc_factor, P_max_elmts, &P); - dof_func_array[level+1] = NULL; + + } + } + } + } + else + { + hypre_BoomerAMGBuildInterpGSMG(NULL, CF_marker, S, + coarse_pnts_global, num_functions, dof_func_data, + debug_flag, trunc_factor, &P); + } + } /* end of no aggressive coarsening */ + + dof_func_array[level + 1] = NULL; if (num_functions > 1 && nodal > -1 && (!block_mode) ) - dof_func_array[level+1] = coarse_dof_func; + { + dof_func_array[level + 1] = coarse_dof_func; + } HYPRE_ANNOTATE_REGION_END("%s", "Interpolation"); } /* end of if max_levels > 1 */ @@ -2229,20 +2507,24 @@ hypre_BoomerAMGSetup( void *amg_vdata, if ( (coarse_size == 0) || (coarse_size == fine_size) ) { HYPRE_Int *num_grid_sweeps = - hypre_ParAMGDataNumGridSweeps(amg_data); + hypre_ParAMGDataNumGridSweeps(amg_data); HYPRE_Int **grid_relax_points = - hypre_ParAMGDataGridRelaxPoints(amg_data); + hypre_ParAMGDataGridRelaxPoints(amg_data); if (grid_relax_type[3] == 9 || grid_relax_type[3] == 99 || grid_relax_type[3] == 19 || grid_relax_type[3] == 98) { grid_relax_type[3] = grid_relax_type[0]; num_grid_sweeps[3] = 1; - if (grid_relax_points) grid_relax_points[3][0] = 0; + if (grid_relax_points) { grid_relax_points[3][0] = 0; } } if (S) + { hypre_ParCSRMatrixDestroy(S); + } if (P) + { hypre_ParCSRMatrixDestroy(P); + } if (level > 0) { /* note special case treatment of CF_marker is necessary @@ -2252,15 +2534,24 @@ hypre_BoomerAMGSetup( void *amg_vdata, hypre_ParVectorDestroy(F_array[level]); hypre_ParVectorDestroy(U_array[level]); } + if (level + 1 < max_levels) + { + hypre_IntArrayDestroy(dof_func_array[level + 1]); + dof_func_array[level + 1] = NULL; + } break; } if (level < agg_num_levels && coarse_size < min_coarse_size) { if (S) + { hypre_ParCSRMatrixDestroy(S); + } if (P) + { hypre_ParCSRMatrixDestroy(P); + } if (level > 0) { hypre_IntArrayDestroy(CF_marker_array[level]); @@ -2268,6 +2559,8 @@ hypre_BoomerAMGSetup( void *amg_vdata, hypre_ParVectorDestroy(F_array[level]); hypre_ParVectorDestroy(U_array[level]); } + hypre_IntArrayDestroy(dof_func_array[level + 1]); + dof_func_array[level + 1] = NULL; coarse_size = fine_size; break; @@ -2304,7 +2597,7 @@ hypre_BoomerAMGSetup( void *amg_vdata, num_interp_vectors, interp_vectors_array[level], hypre_IntArrayData(CF_marker_array[level]), - &interp_vectors_array[level+1], + &interp_vectors_array[level + 1], 0, num_functions); } @@ -2326,7 +2619,7 @@ hypre_BoomerAMGSetup( void *amg_vdata, interp_vectors_array[level], &num_functions, dof_func_data, - &dof_func_array[level+1], + &dof_func_array[level + 1], interp_vec_variant, level, abs_q_trunc, expandp_weights, @@ -2341,7 +2634,7 @@ hypre_BoomerAMGSetup( void *amg_vdata, coarse_pnts_global, &num_functions, dof_func_data, - &dof_func_array[level+1], + &dof_func_array[level + 1], hypre_IntArrayData(CF_marker_array[level]), level, expandp_weights, @@ -2364,27 +2657,31 @@ hypre_BoomerAMGSetup( void *amg_vdata, hypre_Vector *Vtemp_local = hypre_ParVectorLocalVector(Vtemp); hypre_TFree(hypre_VectorData(Vtemp_local), memory_location); hypre_VectorSize(Vtemp_local) = local_P_sz; - hypre_VectorData(Vtemp_local) = hypre_CTAlloc(HYPRE_Complex, local_P_sz, memory_location); + hypre_VectorData(Vtemp_local) = hypre_CTAlloc(HYPRE_Complex, local_P_sz * num_vectors, + memory_location); if (Ztemp) { hypre_Vector *Ztemp_local = hypre_ParVectorLocalVector(Ztemp); hypre_TFree(hypre_VectorData(Ztemp_local), memory_location); hypre_VectorSize(Ztemp_local) = local_P_sz; - hypre_VectorData(Ztemp_local) = hypre_CTAlloc(HYPRE_Complex, local_P_sz, memory_location); + hypre_VectorData(Ztemp_local) = hypre_CTAlloc(HYPRE_Complex, local_P_sz * num_vectors, + memory_location); } if (Ptemp) { hypre_Vector *Ptemp_local = hypre_ParVectorLocalVector(Ptemp); hypre_TFree(hypre_VectorData(Ptemp_local), memory_location); hypre_VectorSize(Ptemp_local) = local_P_sz; - hypre_VectorData(Ptemp_local) = hypre_CTAlloc(HYPRE_Complex, local_P_sz, memory_location); + hypre_VectorData(Ptemp_local) = hypre_CTAlloc(HYPRE_Complex, local_P_sz * num_vectors, + memory_location); } if (Rtemp) { hypre_Vector *Rtemp_local = hypre_ParVectorLocalVector(Rtemp); hypre_TFree(hypre_VectorData(Rtemp_local), memory_location); hypre_VectorSize(Rtemp_local) = local_P_sz; - hypre_VectorData(Rtemp_local) = hypre_CTAlloc(HYPRE_Complex, local_P_sz, memory_location); + hypre_VectorData(Rtemp_local) = hypre_CTAlloc(HYPRE_Complex, local_P_sz * num_vectors, + memory_location); } } /*if (hypre_ParCSRMatrixGlobalNumRows(A_array[0]) < hypre_ParCSRMatrixGlobalNumCols(P)) @@ -2407,13 +2704,15 @@ hypre_BoomerAMGSetup( void *amg_vdata, HYPRE_Int expand_level = 0; if (level == interp_vec_first_level) + { expand_level = 1; + } hypre_BoomerAMGCoarsenInterpVectors( P, num_interp_vectors, interp_vectors_array[level], hypre_IntArrayData(CF_marker_array[level]), - &interp_vectors_array[level+1], + &interp_vectors_array[level + 1], expand_level, num_functions); } } /* end apply variant */ @@ -2425,13 +2724,13 @@ hypre_BoomerAMGSetup( void *amg_vdata, hypre_BoomerAMGJacobiInterp( A_array[level], &P, S, num_functions, dof_func_data, hypre_IntArrayData(CF_marker_array[level]), - level, jacobi_trunc_threshold, 0.5*jacobi_trunc_threshold ); + level, jacobi_trunc_threshold, 0.5 * jacobi_trunc_threshold ); } dof_func_data = NULL; - if (dof_func_array[level+1]) + if (dof_func_array[level + 1]) { - dof_func_data = hypre_IntArrayData(dof_func_array[level+1]); + dof_func_data = hypre_IntArrayData(dof_func_array[level + 1]); } @@ -2454,7 +2753,7 @@ hypre_BoomerAMGSetup( void *amg_vdata, HYPRE_Real w_inv = 1.0 / add_rlx_wt; /*HYPRE_Real w_inv = 1.0/hypre_ParAMGDataRelaxWeight(amg_data)[level];*/ hypre_SeqVectorInitialize_v2(d_diag, HYPRE_MEMORY_HOST); - for (i=0; i < lvl_nrows; i++) + for (i = 0; i < lvl_nrows; i++) { hypre_VectorData(d_diag)[i] = lvl_data[lvl_i[i]] * w_inv; } @@ -2493,22 +2792,24 @@ hypre_BoomerAMGSetup( void *amg_vdata, /*hypre_ParCSRMatrixDestroy(P); */ hypre_SeqVectorDestroy(d_diag); /* Set NonGalerkin drop tol on each level */ - if (level < nongalerk_num_tol) nongalerk_tol_l = nongalerk_tol[level]; - if (nongal_tol_array) nongalerk_tol_l = nongal_tol_array[level]; + if (level < nongalerk_num_tol) { nongalerk_tol_l = nongalerk_tol[level]; } + if (nongal_tol_array) { nongalerk_tol_l = nongal_tol_array[level]; } if (nongalerk_tol_l > 0.0) { /* Build Non-Galerkin Coarse Grid */ hypre_ParCSRMatrix *Q = NULL; hypre_BoomerAMGBuildNonGalerkinCoarseOperator(&A_H, Q, - 0.333*strong_threshold, max_row_sum, num_functions, - dof_func_data, hypre_IntArrayData(CF_marker_array[level]), - /* nongalerk_tol, sym_collapse, lump_percent, beta );*/ - nongalerk_tol_l, 1, 0.5, 1.0 ); + 0.333 * strong_threshold, max_row_sum, num_functions, + dof_func_data, hypre_IntArrayData(CF_marker_array[level]), + /* nongalerk_tol, sym_collapse, lump_percent, beta );*/ + nongalerk_tol_l, 1, 0.5, 1.0 ); hypre_ParCSRMatrixColStarts(P_array[level])[0] = hypre_ParCSRMatrixRowStarts(A_H)[0]; hypre_ParCSRMatrixColStarts(P_array[level])[1] = hypre_ParCSRMatrixRowStarts(A_H)[1]; if (!hypre_ParCSRMatrixCommPkg(A_H)) + { hypre_MatvecCommPkgCreate(A_H); + } } hypre_ParCSRMatrixDestroy(Q); } @@ -2519,8 +2820,10 @@ hypre_BoomerAMGSetup( void *amg_vdata, hypre_ParCSRMatrix *Ptmp = NULL; /* Set NonGalerkin drop tol on each level */ if (level < nongalerk_num_tol) - nongalerk_tol_l = nongalerk_tol[level]; - if (nongal_tol_array) nongalerk_tol_l = nongal_tol_array[level]; + { + nongalerk_tol_l = nongalerk_tol[level]; + } + if (nongal_tol_array) { nongalerk_tol_l = nongal_tol_array[level]; } if (nongalerk_tol_l > 0.0) { @@ -2543,10 +2846,10 @@ hypre_BoomerAMGSetup( void *amg_vdata, /* Build Non-Galerkin Coarse Grid */ hypre_BoomerAMGBuildNonGalerkinCoarseOperator(&A_H, Q, - 0.333*strong_threshold, max_row_sum, num_functions, - dof_func_data, hypre_IntArrayData(CF_marker_array[level]), - /* nongalerk_tol, sym_collapse, lump_percent, beta );*/ - nongalerk_tol_l, 1, 0.5, 1.0 ); + 0.333 * strong_threshold, max_row_sum, num_functions, + dof_func_data, hypre_IntArrayData(CF_marker_array[level]), + /* nongalerk_tol, sym_collapse, lump_percent, beta );*/ + nongalerk_tol_l, 1, 0.5, 1.0 ); if (!hypre_ParCSRMatrixCommPkg(A_H)) { @@ -2587,7 +2890,7 @@ hypre_BoomerAMGSetup( void *amg_vdata, } else { - hypre_BoomerAMGBuildCoarseOperatorKT(P, A_array[level] , P, + hypre_BoomerAMGBuildCoarseOperatorKT(P, A_array[level], P, keepTranspose, &A_H); } } @@ -2608,11 +2911,11 @@ hypre_BoomerAMGSetup( void *amg_vdata, Ptmp = NULL; if (hypre_ParAMGDataModularizedMatMat(amg_data)) { - Ptmp = hypre_ParCSRMatMat(C,Pnew); + Ptmp = hypre_ParCSRMatMat(C, Pnew); } else { - Ptmp = hypre_ParMatmul(C,Pnew); + Ptmp = hypre_ParMatmul(C, Pnew); } if (ns_tmp < ns) { @@ -2628,7 +2931,7 @@ hypre_BoomerAMGSetup( void *amg_vdata, if (add_P_max_elmts || add_trunc_factor) { - hypre_BoomerAMGTruncandBuild(P_array[level], add_trunc_factor,add_P_max_elmts); + hypre_BoomerAMGTruncandBuild(P_array[level], add_trunc_factor, add_P_max_elmts); } /*else hypre_MatvecCommPkgCreate(P_array[level]); */ @@ -2653,11 +2956,11 @@ hypre_BoomerAMGSetup( void *amg_vdata, hypre_TFree(SmoothVecs, HYPRE_MEMORY_HOST); - if (debug_flag==1) + if (debug_flag == 1) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Level = %d Build Interp Time = %f\n", - my_id,level, wall_time); + my_id, level, wall_time); fflush(NULL); } @@ -2666,7 +2969,7 @@ hypre_BoomerAMGSetup( void *amg_vdata, *--------------------------------------------------------------*/ HYPRE_ANNOTATE_REGION_BEGIN("%s", "RAP"); - if (debug_flag==1) wall_time = time_getWallclockSeconds(); + if (debug_flag == 1) { wall_time = time_getWallclockSeconds(); } if (block_mode) { @@ -2676,7 +2979,7 @@ hypre_BoomerAMGSetup( void *amg_vdata, hypre_ParCSRBlockMatrixSetNumNonzeros(A_H_block); hypre_ParCSRBlockMatrixSetDNumNonzeros(A_H_block); - A_block_array[level+1] = A_H_block; + A_block_array[level + 1] = A_H_block; } else if (mult_addlvl == -1 || level < mult_addlvl || level > add_end) { @@ -2696,19 +2999,19 @@ hypre_BoomerAMGSetup( void *amg_vdata, hypre_ParCSRMatrix *Q = NULL; if (hypre_ParAMGDataModularizedMatMat(amg_data)) { - Q = hypre_ParCSRMatMat(A_array[level],P_array[level]); - A_H = hypre_ParCSRTMatMatKT(P_array[level],Q,keepTranspose); + Q = hypre_ParCSRMatMat(A_array[level], P_array[level]); + A_H = hypre_ParCSRTMatMatKT(P_array[level], Q, keepTranspose); } else { - Q = hypre_ParMatmul(A_array[level],P_array[level]); - A_H = hypre_ParTMatmul(P_array[level],Q); + Q = hypre_ParMatmul(A_array[level], P_array[level]); + A_H = hypre_ParTMatmul(P_array[level], Q); } - if (num_procs > 1) hypre_MatvecCommPkgCreate(A_H); + if (num_procs > 1) { hypre_MatvecCommPkgCreate(A_H); } /* Build Non-Galerkin Coarse Grid */ hypre_BoomerAMGBuildNonGalerkinCoarseOperator(&A_H, Q, - 0.333*strong_threshold, max_row_sum, num_functions, + 0.333 * strong_threshold, max_row_sum, num_functions, dof_func_data, hypre_IntArrayData(CF_marker_array[level]), /* nongalerk_tol, sym_collapse, lump_percent, beta );*/ nongalerk_tol_l, 1, 0.5, 1.0 ); @@ -2741,16 +3044,6 @@ hypre_BoomerAMGSetup( void *amg_vdata, } /* Delete AP */ hypre_ParCSRMatrixDestroy(AP); - -#if DEBUG_SAVE_ALL_OPS - if (level == 0) - { - hypre_ParCSRMatrixPrintIJ(A_array[0], 1, 1, "A_0.mtx"); - } - char file[256]; - hypre_sprintf(file, "A_%d.mtx", level+1); - hypre_ParCSRMatrixPrintIJ(A_H, 1, 1, file); -#endif } else if (rap2) { @@ -2763,8 +3056,8 @@ hypre_BoomerAMGSetup( void *amg_vdata, } else { - Q = hypre_ParMatmul(A_array[level],P_array[level]); - A_H = hypre_ParTMatmul(P_array[level],Q); + Q = hypre_ParMatmul(A_array[level], P_array[level]); + A_H = hypre_ParTMatmul(P_array[level], Q); } if (num_procs > 1) { @@ -2783,11 +3076,11 @@ hypre_BoomerAMGSetup( void *amg_vdata, } else { - hypre_BoomerAMGBuildCoarseOperatorKT(P_array[level], A_array[level] , + hypre_BoomerAMGBuildCoarseOperatorKT(P_array[level], A_array[level], P_array[level], keepTranspose, &A_H); } - if (Pnew && ns==1) + if (Pnew && ns == 1) { hypre_ParCSRMatrixDestroy(P); P_array[level] = Pnew; @@ -2795,18 +3088,34 @@ hypre_BoomerAMGSetup( void *amg_vdata, } } +#if DEBUG_SAVE_ALL_OPS + if (level == 0) + { + hypre_ParCSRMatrixPrintIJ(A_array[0], 0, 0, "A_00.IJ.out"); + } + char file[256]; + hypre_sprintf(file, "A_%02d.IJ.out", level + 1); + hypre_ParCSRMatrixPrintIJ(A_H, 0, 0, file); + + hypre_sprintf(file, "P_%02d.IJ.out", level); + hypre_ParCSRMatrixPrintIJ(P_array[level], 0, 0, file); +#endif + HYPRE_ANNOTATE_REGION_END("%s", "RAP"); - if (debug_flag==1) + if (debug_flag == 1) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Level = %d Build Coarse Operator Time = %f\n", - my_id,level, wall_time); + my_id, level, wall_time); fflush(NULL); } HYPRE_ANNOTATE_MGLEVEL_END(level); + hypre_GpuProfilingPopRange(); ++level; HYPRE_ANNOTATE_MGLEVEL_BEGIN(level); + hypre_sprintf(nvtx_name, "%s-%d", "AMG Level", level); + hypre_GpuProfilingPushRange(nvtx_name); if (!block_mode) { @@ -2827,50 +3136,56 @@ hypre_BoomerAMGSetup( void *amg_vdata, A_array[level] = A_H; } - size = ((HYPRE_Real) fine_size )*.75; - if (coarsen_type > 0 && coarse_size >= (HYPRE_BigInt) size) +#if defined(HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_HOST) +#endif { - coarsen_type = 0; + HYPRE_Real size = ((HYPRE_Real)fine_size) * .75; + if (coarsen_type > 0 && coarse_size >= (HYPRE_BigInt)size) + { + coarsen_type = 0; + } } { HYPRE_Int max_thresh = hypre_max(coarse_threshold, seq_threshold); -#ifdef HYPRE_USING_DSUPERLU +#if defined(HYPRE_USING_DSUPERLU) max_thresh = hypre_max(max_thresh, dslu_threshold); #endif - if ( (level == max_levels-1) || (coarse_size <= (HYPRE_BigInt) max_thresh) ) + if ( (level == max_levels - 1) || (coarse_size <= (HYPRE_BigInt) max_thresh) ) { not_finished_coarsening = 0; } } } /* end of coarsening loop: while (not_finished_coarsening) */ - HYPRE_ANNOTATE_REGION_BEGIN("%s", "Coarse solve"); - /* free memory */ - hypre_TFree(coarse_pnts_global, HYPRE_MEMORY_HOST); - hypre_TFree(coarse_pnts_global1, HYPRE_MEMORY_HOST); + HYPRE_ANNOTATE_REGION_BEGIN("%s", "Coarse solve"); /* redundant coarse grid solve */ if ((seq_threshold >= coarse_threshold) && (coarse_size > (HYPRE_BigInt) coarse_threshold) && - (level != max_levels-1)) + (level != max_levels - 1)) { hypre_seqAMGSetup(amg_data, level, coarse_threshold); } -#ifdef HYPRE_USING_DSUPERLU +#if defined(HYPRE_USING_DSUPERLU) else if ((dslu_threshold >= coarse_threshold) && (coarse_size > (HYPRE_BigInt)coarse_threshold) && - (level != max_levels-1)) + (level != max_levels - 1)) { HYPRE_Solver dslu_solver; hypre_SLUDistSetup(&dslu_solver, A_array[level], amg_print_level); hypre_ParAMGDataDSLUSolver(amg_data) = dslu_solver; } #endif - else if (grid_relax_type[3] == 9 || - grid_relax_type[3] == 99 || - grid_relax_type[3] == 199 ) /*use of Gaussian elimination on coarsest level */ + else if (grid_relax_type[3] == 9 || + grid_relax_type[3] == 19 || + grid_relax_type[3] == 98 || + grid_relax_type[3] == 99 || + grid_relax_type[3] == 198 || + grid_relax_type[3] == 199) { + /* Gaussian elimination on the coarsest level */ if (coarse_size <= coarse_threshold) { hypre_GaussElimSetup(amg_data, level, grid_relax_type[3]); @@ -2880,15 +3195,9 @@ hypre_BoomerAMGSetup( void *amg_vdata, grid_relax_type[3] = grid_relax_type[1]; } } - else if (grid_relax_type[3] == 19 || grid_relax_type[3] == 98) /*use of Gaussian elimination on coarsest level */ - { - if (coarse_size > coarse_threshold) - { - grid_relax_type[3] = grid_relax_type[1]; - } - } HYPRE_ANNOTATE_REGION_END("%s", "Coarse solve"); HYPRE_ANNOTATE_MGLEVEL_END(level); + hypre_GpuProfilingPopRange(); if (level > 0) { @@ -2915,12 +3224,14 @@ hypre_BoomerAMGSetup( void *amg_vdata, hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A_array[level]), hypre_ParCSRMatrixGlobalNumRows(A_array[level]), hypre_ParCSRMatrixRowStarts(A_array[level])); + hypre_ParVectorNumVectors(F_array[level]) = num_vectors; hypre_ParVectorInitialize_v2(F_array[level], memory_location); U_array[level] = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A_array[level]), hypre_ParCSRMatrixGlobalNumRows(A_array[level]), hypre_ParCSRMatrixRowStarts(A_array[level])); + hypre_ParVectorNumVectors(U_array[level]) = num_vectors; hypre_ParVectorInitialize_v2(U_array[level], memory_location); } } @@ -2930,9 +3241,9 @@ hypre_BoomerAMGSetup( void *amg_vdata, * for levels 1 through coarsest, into amg_data data structure *-----------------------------------------------------------------------*/ - num_levels = level+1; + num_levels = level + 1; hypre_ParAMGDataNumLevels(amg_data) = num_levels; - if (hypre_ParAMGDataSmoothNumLevels(amg_data) > num_levels-1) + if (hypre_ParAMGDataSmoothNumLevels(amg_data) > num_levels - 1) { hypre_ParAMGDataSmoothNumLevels(amg_data) = num_levels; } @@ -2942,12 +3253,18 @@ hypre_BoomerAMGSetup( void *amg_vdata, * Setup of special smoothers when needed *-----------------------------------------------------------------------*/ + hypre_GpuProfilingPushRange("Relaxation"); if (addlvl > -1 || grid_relax_type[1] == 7 || grid_relax_type[2] == 7 || grid_relax_type[3] == 7 || grid_relax_type[1] == 8 || grid_relax_type[2] == 8 || grid_relax_type[3] == 8 || + grid_relax_type[1] == 11 || grid_relax_type[2] == 11 || grid_relax_type[3] == 11 || + grid_relax_type[1] == 12 || grid_relax_type[2] == 12 || grid_relax_type[3] == 12 || grid_relax_type[1] == 13 || grid_relax_type[2] == 13 || grid_relax_type[3] == 13 || grid_relax_type[1] == 14 || grid_relax_type[2] == 14 || grid_relax_type[3] == 14 || - grid_relax_type[1] == 18 || grid_relax_type[2] == 18 || grid_relax_type[3] == 18) + grid_relax_type[1] == 18 || grid_relax_type[2] == 18 || grid_relax_type[3] == 18 || + grid_relax_type[1] == 30 || grid_relax_type[2] == 30 || grid_relax_type[3] == 30 || + grid_relax_type[1] == 88 || grid_relax_type[2] == 88 || grid_relax_type[3] == 88 || + grid_relax_type[1] == 89 || grid_relax_type[2] == 89 || grid_relax_type[3] == 89) { l1_norms = hypre_CTAlloc(hypre_Vector*, num_levels, HYPRE_MEMORY_HOST); hypre_ParAMGDataL1Norms(amg_data) = l1_norms; @@ -2986,10 +3303,17 @@ hypre_BoomerAMGSetup( void *amg_vdata, HYPRE_ANNOTATE_MGLEVEL_BEGIN(j); HYPRE_ANNOTATE_REGION_BEGIN("%s", "Relaxation"); + hypre_sprintf(nvtx_name, "%s-%d", "AMG Level", level); + hypre_GpuProfilingPushRange(nvtx_name); - if (j < num_levels-1 && - (grid_relax_type[1] == 8 || grid_relax_type[1] == 13 || grid_relax_type[1] == 14 || - grid_relax_type[2] == 8 || grid_relax_type[2] == 13 || grid_relax_type[2] == 14)) + hypre_sprintf(nvtx_name, "%s-%d", "Relaxation", j); + hypre_GpuProfilingPushRange(nvtx_name); + + if (j < num_levels - 1 && + (grid_relax_type[1] == 8 || grid_relax_type[1] == 89 || + grid_relax_type[1] == 13 || grid_relax_type[1] == 14 || + grid_relax_type[2] == 8 || grid_relax_type[2] == 89 || + grid_relax_type[2] == 13 || grid_relax_type[2] == 14)) { if (relax_order) { @@ -3000,13 +3324,46 @@ hypre_BoomerAMGSetup( void *amg_vdata, hypre_ParCSRComputeL1Norms(A_array[j], 4, NULL, &l1_norm_data); } } - else if (j == num_levels-1 && - (grid_relax_type[3] == 8 || grid_relax_type[3] == 13 || grid_relax_type[3] == 14)) + else if (j == num_levels - 1 && + (grid_relax_type[3] == 8 || grid_relax_type[3] == 89 || + grid_relax_type[3] == 13 || grid_relax_type[3] == 14)) { hypre_ParCSRComputeL1Norms(A_array[j], 4, NULL, &l1_norm_data); } - if (j < num_levels-1 && (grid_relax_type[1] == 18 || grid_relax_type[2] == 18)) + if (j < num_levels - 1 && (grid_relax_type[1] == 30 || grid_relax_type[2] == 30)) + { + if (relax_order) + { + hypre_ParCSRComputeL1Norms(A_array[j], 3, hypre_IntArrayData(CF_marker_array[j]), &l1_norm_data); + } + else + { + hypre_ParCSRComputeL1Norms(A_array[j], 3, NULL, &l1_norm_data); + } + } + else if (j == num_levels - 1 && grid_relax_type[3] == 30) + { + hypre_ParCSRComputeL1Norms(A_array[j], 3, NULL, &l1_norm_data); + } + + if (j < num_levels - 1 && (grid_relax_type[1] == 88 || grid_relax_type[2] == 88 )) + { + if (relax_order) + { + hypre_ParCSRComputeL1Norms(A_array[j], 6, hypre_IntArrayData(CF_marker_array[j]), &l1_norm_data); + } + else + { + hypre_ParCSRComputeL1Norms(A_array[j], 6, NULL, &l1_norm_data); + } + } + else if (j == num_levels - 1 && (grid_relax_type[3] == 88)) + { + hypre_ParCSRComputeL1Norms(A_array[j], 6, NULL, &l1_norm_data); + } + + if (j < num_levels - 1 && (grid_relax_type[1] == 18 || grid_relax_type[2] == 18)) { if (relax_order) { @@ -3017,7 +3374,7 @@ hypre_BoomerAMGSetup( void *amg_vdata, hypre_ParCSRComputeL1Norms(A_array[j], 1, NULL, &l1_norm_data); } } - else if (j == num_levels-1 && grid_relax_type[3] == 18) + else if (j == num_levels - 1 && grid_relax_type[3] == 18) { hypre_ParCSRComputeL1Norms(A_array[j], 1, NULL, &l1_norm_data); } @@ -3031,9 +3388,11 @@ hypre_BoomerAMGSetup( void *amg_vdata, HYPRE_ANNOTATE_REGION_END("%s", "Relaxation"); HYPRE_ANNOTATE_MGLEVEL_END(j); + hypre_GpuProfilingPopRange(); + hypre_GpuProfilingPopRange(); } - for (j = addlvl; j < hypre_min(add_end+1, num_levels) ; j++) + for (j = addlvl; j < hypre_min(add_end + 1, num_levels) ; j++) { if (add_rlx == 18 ) { @@ -3041,6 +3400,11 @@ hypre_BoomerAMGSetup( void *amg_vdata, HYPRE_ANNOTATE_MGLEVEL_BEGIN(j); HYPRE_ANNOTATE_REGION_BEGIN("%s", "Relaxation"); + hypre_sprintf(nvtx_name, "%s-%d", "AMG Level", level); + hypre_GpuProfilingPushRange(nvtx_name); + + hypre_sprintf(nvtx_name, "%s-%d", "Relaxation", j); + hypre_GpuProfilingPushRange(nvtx_name); hypre_ParCSRComputeL1Norms(A_array[j], 1, NULL, &l1_norm_data); @@ -3050,44 +3414,56 @@ hypre_BoomerAMGSetup( void *amg_vdata, HYPRE_ANNOTATE_REGION_END("%s", "Relaxation"); HYPRE_ANNOTATE_MGLEVEL_END(j); + hypre_GpuProfilingPopRange(); + hypre_GpuProfilingPopRange(); } } - for (j = add_end+1; j < num_levels; j++) + for (j = add_end + 1; j < num_levels; j++) { HYPRE_Real *l1_norm_data = NULL; HYPRE_ANNOTATE_MGLEVEL_BEGIN(j); HYPRE_ANNOTATE_REGION_BEGIN("%s", "Relaxation"); + hypre_sprintf(nvtx_name, "%s-%d", "AMG Level", level); + hypre_GpuProfilingPushRange(nvtx_name); + + hypre_sprintf(nvtx_name, "%s-%d", "Relaxation", j); + hypre_GpuProfilingPushRange(nvtx_name); - if (j < num_levels-1 && (grid_relax_type[1] == 8 || grid_relax_type[1] == 13 || grid_relax_type[1] == 14 || - grid_relax_type[2] == 8 || grid_relax_type[2] == 13 || grid_relax_type[2] == 14)) + + if (j < num_levels - 1 && + (grid_relax_type[1] == 8 || grid_relax_type[1] == 13 || grid_relax_type[1] == 14 || + grid_relax_type[2] == 8 || grid_relax_type[2] == 13 || grid_relax_type[2] == 14)) { if (relax_order) { - hypre_ParCSRComputeL1Norms(A_array[j], 4, hypre_IntArrayData(CF_marker_array[j]), &l1_norm_data); + hypre_ParCSRComputeL1Norms(A_array[j], 4, hypre_IntArrayData(CF_marker_array[j]), + &l1_norm_data); } else { hypre_ParCSRComputeL1Norms(A_array[j], 4, NULL, &l1_norm_data); } } - else if ((grid_relax_type[3] == 8 || grid_relax_type[3] == 13 || grid_relax_type[3] == 14) && j == num_levels-1) + else if ((grid_relax_type[3] == 8 || grid_relax_type[3] == 13 || grid_relax_type[3] == 14) && + j == num_levels - 1) { hypre_ParCSRComputeL1Norms(A_array[j], 4, NULL, &l1_norm_data); } - if ((grid_relax_type[1] == 18 || grid_relax_type[2] == 18) && j < num_levels-1) + if ((grid_relax_type[1] == 18 || grid_relax_type[2] == 18) && j < num_levels - 1) { if (relax_order) { - hypre_ParCSRComputeL1Norms(A_array[j], 1, hypre_IntArrayData(CF_marker_array[j]), &l1_norm_data); + hypre_ParCSRComputeL1Norms(A_array[j], 1, hypre_IntArrayData(CF_marker_array[j]), + &l1_norm_data); } else { hypre_ParCSRComputeL1Norms(A_array[j], 1, NULL, &l1_norm_data); } } - else if (grid_relax_type[3] == 18 && j == num_levels-1) + else if (grid_relax_type[3] == 18 && j == num_levels - 1) { hypre_ParCSRComputeL1Norms(A_array[j], 1, NULL, &l1_norm_data); } @@ -3101,14 +3477,28 @@ hypre_BoomerAMGSetup( void *amg_vdata, HYPRE_ANNOTATE_REGION_END("%s", "Relaxation"); HYPRE_ANNOTATE_MGLEVEL_END(j); + hypre_GpuProfilingPopRange(); + hypre_GpuProfilingPopRange(); } for (j = 0; j < num_levels; j++) { HYPRE_ANNOTATE_MGLEVEL_BEGIN(j); HYPRE_ANNOTATE_REGION_BEGIN("%s", "Relaxation"); + hypre_sprintf(nvtx_name, "%s-%d", "AMG Level", level); + hypre_GpuProfilingPushRange(nvtx_name); + + hypre_sprintf(nvtx_name, "%s-%d", "Relaxation", j); + hypre_GpuProfilingPushRange(nvtx_name); + + if ( grid_relax_type[1] == 7 || grid_relax_type[2] == 7 || + (grid_relax_type[3] == 7 && j == (num_levels - 1)) || + + grid_relax_type[1] == 11 || grid_relax_type[2] == 11 || + (grid_relax_type[3] == 11 && j == (num_levels - 1)) || - if (grid_relax_type[1] == 7 || grid_relax_type[2] == 7 || (grid_relax_type[3] == 7 && j == (num_levels-1))) + grid_relax_type[1] == 12 || grid_relax_type[2] == 12 || + (grid_relax_type[3] == 12 && j == (num_levels - 1)) ) { HYPRE_Real *l1_norm_data = NULL; @@ -3118,7 +3508,8 @@ hypre_BoomerAMGSetup( void *amg_vdata, hypre_VectorData(l1_norms[j]) = l1_norm_data; hypre_SeqVectorInitialize_v2(l1_norms[j], hypre_ParCSRMatrixMemoryLocation(A_array[j])); } - else if (grid_relax_type[1] == 16 || grid_relax_type[2] == 16 || (grid_relax_type[3] == 16 && j== (num_levels-1))) + else if (grid_relax_type[1] == 16 || grid_relax_type[2] == 16 || + (grid_relax_type[3] == 16 && j == (num_levels - 1))) { HYPRE_Int scale = hypre_ParAMGDataChebyScale(amg_data); /* If the full array is being considered, create the relevant temp vectors */ @@ -3141,7 +3532,7 @@ hypre_BoomerAMGSetup( void *amg_vdata, max_eig_est[j] = max_eig; min_eig_est[j] = min_eig; - cheby_ds[j] = hypre_SeqVectorCreate(hypre_ParCSRMatrixNumRows(A_array[j])); + cheby_ds[j] = hypre_SeqVectorCreate(hypre_ParCSRMatrixNumRows(A_array[j])); hypre_VectorVectorStride(cheby_ds[j]) = hypre_ParCSRMatrixNumRows(A_array[j]); hypre_VectorIndexStride(cheby_ds[j]) = 1; hypre_VectorMemoryLocation(cheby_ds[j]) = hypre_ParCSRMatrixMemoryLocation(A_array[j]); @@ -3157,7 +3548,7 @@ hypre_BoomerAMGSetup( void *amg_vdata, &hypre_VectorData(cheby_ds[j])); cheby_coefs[j] = coefs; } - else if (grid_relax_type[1] == 15 || (grid_relax_type[3] == 15 && j == (num_levels-1)) ) + else if (grid_relax_type[1] == 15 || (grid_relax_type[3] == 15 && j == (num_levels - 1)) ) { HYPRE_ParCSRPCGCreate(comm, &smoother[j]); @@ -3173,23 +3564,35 @@ hypre_BoomerAMGSetup( void *amg_vdata, (HYPRE_ParCSRMatrix) A_array[j], (HYPRE_ParVector) F_array[j], (HYPRE_ParVector) U_array[j]); - - } + if (relax_weight[j] == 0.0) { hypre_ParCSRMatrixScaledNorm(A_array[j], &relax_weight[j]); if (relax_weight[j] != 0.0) - relax_weight[j] = 4.0/3.0/relax_weight[j]; + { + relax_weight[j] = 4.0 / 3.0 / relax_weight[j]; + } else - hypre_error_w_msg(HYPRE_ERROR_GENERIC," Warning ! Matrix norm is zero !!!"); + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, " Warning ! Matrix norm is zero !!!"); + } } + if ((smooth_type == 6 || smooth_type == 16) && smooth_num_levels > j) { + /* Sanity check */ + if (num_vectors > 1) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "Schwarz smoothing doesn't support multicomponent vectors"); + return hypre_error_flag; + } + schwarz_relax_wt = hypre_ParAMGDataSchwarzRlxWeight(amg_data); HYPRE_SchwarzCreate(&smoother[j]); - HYPRE_SchwarzSetNumFunctions(smoother[j],num_functions); + HYPRE_SchwarzSetNumFunctions(smoother[j], num_functions); HYPRE_SchwarzSetVariant(smoother[j], hypre_ParAMGDataVariant(amg_data)); HYPRE_SchwarzSetOverlap(smoother[j], @@ -3199,7 +3602,9 @@ hypre_BoomerAMGSetup( void *amg_vdata, HYPRE_SchwarzSetNonSymm(smoother[j], hypre_ParAMGDataSchwarzUseNonSymm(amg_data)); if (schwarz_relax_wt > 0) - HYPRE_SchwarzSetRelaxWeight(smoother[j],schwarz_relax_wt); + { + HYPRE_SchwarzSetRelaxWeight(smoother[j], schwarz_relax_wt); + } HYPRE_SchwarzSetup(smoother[j], (HYPRE_ParCSRMatrix) A_array[j], (HYPRE_ParVector) f, @@ -3221,35 +3626,100 @@ hypre_BoomerAMGSetup( void *amg_vdata, } else if ((smooth_type == 9 || smooth_type == 19) && smooth_num_levels > j) { + /* Sanity checks */ #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Euclid smoothing is not available in mixedint mode!"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "Euclid smoothing is not available in mixedint mode!"); return hypre_error_flag; #endif + + if (num_vectors > 1) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "Euclid smoothing doesn't support multicomponent vectors"); + return hypre_error_flag; + } + HYPRE_EuclidCreate(comm, &smoother[j]); if (euclidfile) - HYPRE_EuclidSetParamsFromFile(smoother[j],euclidfile); - HYPRE_EuclidSetLevel(smoother[j],eu_level); + { + HYPRE_EuclidSetParamsFromFile(smoother[j], euclidfile); + } + HYPRE_EuclidSetLevel(smoother[j], eu_level); if (eu_bj) - HYPRE_EuclidSetBJ(smoother[j],eu_bj); + { + HYPRE_EuclidSetBJ(smoother[j], eu_bj); + } if (eu_sparse_A) - HYPRE_EuclidSetSparseA(smoother[j],eu_sparse_A); + { + HYPRE_EuclidSetSparseA(smoother[j], eu_sparse_A); + } HYPRE_EuclidSetup(smoother[j], (HYPRE_ParCSRMatrix) A_array[j], (HYPRE_ParVector) F_array[j], (HYPRE_ParVector) U_array[j]); } + else if ((smooth_type == 4 || smooth_type == 14) && smooth_num_levels > j) + { + /* Sanity check */ + if (num_vectors > 1) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "FSAI smoothing doesn't support multicomponent vectors"); + return hypre_error_flag; + } + + HYPRE_FSAICreate(&smoother[j]); + HYPRE_FSAISetAlgoType(smoother[j], fsai_algo_type); + HYPRE_FSAISetLocalSolveType(smoother[j], fsai_local_solve_type); + HYPRE_FSAISetMaxSteps(smoother[j], fsai_max_steps); + HYPRE_FSAISetMaxStepSize(smoother[j], fsai_max_step_size); + HYPRE_FSAISetMaxNnzRow(smoother[j], fsai_max_nnz_row); + HYPRE_FSAISetNumLevels(smoother[j], fsai_num_levels); + HYPRE_FSAISetThreshold(smoother[j], fsai_threshold); + HYPRE_FSAISetKapTolerance(smoother[j], fsai_kap_tolerance); + HYPRE_FSAISetTolerance(smoother[j], 0.0); + HYPRE_FSAISetOmega(smoother[j], relax_weight[level]); + HYPRE_FSAISetEigMaxIters(smoother[j], fsai_eig_max_iters); + HYPRE_FSAISetPrintLevel(smoother[j], (amg_print_level >= 1) ? 1 : 0); + + HYPRE_FSAISetup(smoother[j], + (HYPRE_ParCSRMatrix) A_array[j], + (HYPRE_ParVector) F_array[j], + (HYPRE_ParVector) U_array[j]); + +#if DEBUG_SAVE_ALL_OPS + { + char filename[256]; + hypre_sprintf(filename, "G_%02d.IJ.out", j); + hypre_ParCSRMatrixPrintIJ(hypre_ParFSAIDataGmat((hypre_ParFSAIData*) smoother[j]), + 0, 0, filename); + } +#endif + } else if ((smooth_type == 5 || smooth_type == 15) && smooth_num_levels > j) { - HYPRE_ILUCreate( &smoother[j]); - HYPRE_ILUSetType( smoother[j], ilu_type); + /* Sanity check */ + if (num_vectors > 1) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "ILU smoothing doesn't support multicomponent vectors"); + return hypre_error_flag; + } + + HYPRE_ILUCreate(&smoother[j]); + HYPRE_ILUSetType(smoother[j], ilu_type); HYPRE_ILUSetLocalReordering( smoother[j], ilu_reordering_type); HYPRE_ILUSetMaxIter(smoother[j], ilu_max_iter); + HYPRE_ILUSetTriSolve(smoother[j], ilu_tri_solve); + HYPRE_ILUSetLowerJacobiIters(smoother[j], ilu_lower_jacobi_iters); + HYPRE_ILUSetUpperJacobiIters(smoother[j], ilu_upper_jacobi_iters); HYPRE_ILUSetTol(smoother[j], 0.); HYPRE_ILUSetDropThreshold(smoother[j], ilu_droptol); HYPRE_ILUSetLogging(smoother[j], 0); HYPRE_ILUSetPrintLevel(smoother[j], 0); HYPRE_ILUSetLevelOfFill(smoother[j], ilu_lfil); - HYPRE_ILUSetMaxNnzPerRow(smoother[j],ilu_max_row_nnz); + HYPRE_ILUSetMaxNnzPerRow(smoother[j], ilu_max_row_nnz); HYPRE_ILUSetup(smoother[j], (HYPRE_ParCSRMatrix) A_array[j], (HYPRE_ParVector) F_array[j], @@ -3257,14 +3727,24 @@ hypre_BoomerAMGSetup( void *amg_vdata, } else if ((smooth_type == 8 || smooth_type == 18) && smooth_num_levels > j) { + /* Sanity checks */ #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"ParaSails smoothing is not available in mixedint mode!"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "ParaSails smoothing is not available in mixedint mode!"); return hypre_error_flag; #endif + + if (num_vectors > 1) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "ParaSails smoothing doesn't support multicomponent vectors"); + return hypre_error_flag; + } + HYPRE_ParCSRParaSailsCreate(comm, &smoother[j]); - HYPRE_ParCSRParaSailsSetParams(smoother[j],thresh,nlevel); - HYPRE_ParCSRParaSailsSetFilter(smoother[j],filter); - HYPRE_ParCSRParaSailsSetSym(smoother[j],sym); + HYPRE_ParCSRParaSailsSetParams(smoother[j], thresh, nlevel); + HYPRE_ParCSRParaSailsSetFilter(smoother[j], filter); + HYPRE_ParCSRParaSailsSetSym(smoother[j], sym); HYPRE_ParCSRParaSailsSetup(smoother[j], (HYPRE_ParCSRMatrix) A_array[j], (HYPRE_ParVector) F_array[j], @@ -3272,21 +3752,32 @@ hypre_BoomerAMGSetup( void *amg_vdata, } else if ((smooth_type == 7 || smooth_type == 17) && smooth_num_levels > j) { + /* Sanity checks */ #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"pilut smoothing is not available in mixedint mode!"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "Pilut smoothing is not available in mixedint mode!"); return hypre_error_flag; #endif + + if (num_vectors > 1) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "Pilut smoothing doesn't support multicomponent vectors"); + return hypre_error_flag; + } + HYPRE_ParCSRPilutCreate(comm, &smoother[j]); HYPRE_ParCSRPilutSetup(smoother[j], (HYPRE_ParCSRMatrix) A_array[j], (HYPRE_ParVector) F_array[j], (HYPRE_ParVector) U_array[j]); - HYPRE_ParCSRPilutSetDropTolerance(smoother[j],drop_tol); - HYPRE_ParCSRPilutSetFactorRowSize(smoother[j],max_nz_per_row); + HYPRE_ParCSRPilutSetDropTolerance(smoother[j], drop_tol); + HYPRE_ParCSRPilutSetFactorRowSize(smoother[j], max_nz_per_row); } - else if ( (j < num_levels-1) || ((j == num_levels-1) && - (grid_relax_type[3] != 9 && grid_relax_type[3] != 99 && - grid_relax_type[3] != 19 && grid_relax_type[3] != 98) && coarse_size > 9) ) + else if ( (j < num_levels - 1) || + ((j == num_levels - 1) && + (grid_relax_type[3] != 9 && grid_relax_type[3] != 99 && + grid_relax_type[3] != 19 && grid_relax_type[3] != 98) && coarse_size > 9) ) { if (relax_weight[j] < 0) { @@ -3302,7 +3793,10 @@ hypre_BoomerAMGSetup( void *amg_vdata, HYPRE_ANNOTATE_REGION_END("%s", "Relaxation"); HYPRE_ANNOTATE_MGLEVEL_END(j); + hypre_GpuProfilingPopRange(); + hypre_GpuProfilingPopRange(); } /* end of levels loop */ + hypre_GpuProfilingPopRange(); /* Relaxation */ if (amg_logging > 1) { @@ -3327,17 +3821,35 @@ hypre_BoomerAMGSetup( void *amg_vdata, hypre_CreateLambda(amg_data); } + if (cum_nnz_AP > 0.0) + { + cum_nnz_AP = hypre_ParCSRMatrixDNumNonzeros(A_array[0]); + for (j = 0; j < num_levels - 1; j++) + { + hypre_ParCSRMatrixSetDNumNonzeros(P_array[j]); + cum_nnz_AP += hypre_ParCSRMatrixDNumNonzeros(P_array[j]); + cum_nnz_AP += hypre_ParCSRMatrixDNumNonzeros(A_array[j + 1]); + } + hypre_ParAMGDataCumNnzAP(amg_data) = cum_nnz_AP; + } + /*----------------------------------------------------------------------- * Print some stuff *-----------------------------------------------------------------------*/ if (amg_print_level == 1 || amg_print_level == 3) { - hypre_BoomerAMGSetupStats(amg_data,A); + hypre_BoomerAMGSetupStats(amg_data, A); } - /* print out CF info to plot grids in matlab (see 'tools/AMGgrids.m') */ + /* Destroy filtered matrix */ + if (A_tilde != A) + { + hypre_ParCSRMatrixDestroy(A_tilde); + A_array[0] = A; + } + /* Print out CF info to plot grids in matlab (see 'tools/AMGgrids.m') */ if (hypre_ParAMGDataPlotGrids(amg_data)) { HYPRE_Int *CF, *CFc, *itemp; @@ -3346,7 +3858,7 @@ hypre_BoomerAMGSetup( void *amg_vdata, HYPRE_Int coorddim = hypre_ParAMGDataCoordDim (amg_data); float *coordinates = hypre_ParAMGDataCoordinates (amg_data); - if (!coordinates) coorddim=0; + if (!coordinates) { coorddim = 0; } if (block_mode) { @@ -3377,7 +3889,8 @@ hypre_BoomerAMGSetup( void *amg_vdata, /* copy CF_marker to the host if needed */ hypre_IntArray *CF_marker_host; - if (hypre_GetActualMemLocation(hypre_IntArrayMemoryLocation(CF_marker_array[level])) == hypre_MEMORY_DEVICE) + if (hypre_GetActualMemLocation(hypre_IntArrayMemoryLocation(CF_marker_array[level])) == + hypre_MEMORY_DEVICE) { CF_marker_host = hypre_IntArrayCloneDeep_v2(CF_marker_array[level], HYPRE_MEMORY_HOST); } @@ -3399,7 +3912,8 @@ hypre_BoomerAMGSetup( void *amg_vdata, } /* copy back to device and destroy host copy */ - if (hypre_GetActualMemLocation(hypre_IntArrayMemoryLocation(CF_marker_array[level])) == hypre_MEMORY_DEVICE) + if (hypre_GetActualMemLocation(hypre_IntArrayMemoryLocation(CF_marker_array[level])) == + hypre_MEMORY_DEVICE) { hypre_IntArrayCopy(CF_marker_host, CF_marker_array[level]); hypre_IntArrayDestroy(CF_marker_host); @@ -3413,14 +3927,14 @@ hypre_BoomerAMGSetup( void *amg_vdata, { local_size = hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(A)); } - hypre_sprintf (filename,"%s.%05d",hypre_ParAMGDataPlotFileName (amg_data),my_id); + hypre_sprintf (filename, "%s.%05d", hypre_ParAMGDataPlotFileName (amg_data), my_id); fp = fopen(filename, "w"); for (i = 0; i < local_size; i++) { for (j = 0; j < coorddim; j++) { - hypre_fprintf (fp,"% f ",coordinates[coorddim*i+j]); + hypre_fprintf (fp, "% f ", (HYPRE_Real) coordinates[coorddim * i + j]); } hypre_fprintf(fp, "%d\n", CF[i]); } @@ -3432,99 +3946,101 @@ hypre_BoomerAMGSetup( void *amg_vdata, /* print out matrices on all levels */ #if DEBUG -{ - char filename[256]; - - if (block_mode) { - hypre_ParCSRMatrix *temp_A; + char filename[256]; - for (level = 0; level < num_levels; level++) + if (block_mode) { - hypre_sprintf(filename, "BoomerAMG.out.A_blk.%02d.ij", level); - temp_A = hypre_ParCSRBlockMatrixConvertToParCSRMatrix( - A_block_array[level]); - hypre_ParCSRMatrixPrintIJ(temp_A, 0, 0, filename); - hypre_ParCSRMatrixDestroy(temp_A); - } + hypre_ParCSRMatrix *temp_A; + + for (level = 0; level < num_levels; level++) + { + hypre_sprintf(filename, "BoomerAMG.out.A_blk.%02d.ij", level); + temp_A = hypre_ParCSRBlockMatrixConvertToParCSRMatrix( + A_block_array[level]); + hypre_ParCSRMatrixPrintIJ(temp_A, 0, 0, filename); + hypre_ParCSRMatrixDestroy(temp_A); + } - } - else - { - for (level = 0; level < num_levels; level++) - { - hypre_sprintf(filename, "BoomerAMG.out.A.%02d.ij", level); - hypre_ParCSRMatrixPrintIJ(A_array[level], 0, 0, filename); } - for (level = 0; level < (num_levels-1); level++) + else { - hypre_sprintf(filename, "BoomerAMG.out.P.%02d.ij", level); - hypre_ParCSRMatrixPrintIJ(P_array[level], 0, 0, filename); + for (level = 0; level < num_levels; level++) + { + hypre_sprintf(filename, "BoomerAMG.out.A.%02d.ij", level); + hypre_ParCSRMatrixPrintIJ(A_array[level], 0, 0, filename); + } + for (level = 0; level < (num_levels - 1); level++) + { + hypre_sprintf(filename, "BoomerAMG.out.P.%02d.ij", level); + hypre_ParCSRMatrixPrintIJ(P_array[level], 0, 0, filename); + } } } -} #endif -/* run compatible relaxation on all levels and print results */ + /* run compatible relaxation on all levels and print results */ #if 0 -{ - hypre_ParVector *u_vec, *f_vec; - HYPRE_Real *u, rho0, rho1, rho; - HYPRE_Int n; - - for (level = 0; level < (num_levels-1); level++) { - u_vec = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A_array[level]), - hypre_ParCSRMatrixGlobalNumRows(A_array[level]), - hypre_ParCSRMatrixRowStarts(A_array[level])); - hypre_ParVectorInitialize(u_vec); - f_vec = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A_array[level]), - hypre_ParCSRMatrixGlobalNumRows(A_array[level]), - hypre_ParCSRMatrixRowStarts(A_array[level])); - hypre_ParVectorInitialize(f_vec); - - hypre_ParVectorSetRandomValues(u_vec, 99); - hypre_ParVectorSetConstantValues(f_vec, 0.0); + hypre_ParVector *u_vec, *f_vec; + HYPRE_Real *u, rho0, rho1, rho; + HYPRE_Int n; - /* set C-pt values to zero */ - n = hypre_VectorSize(hypre_ParVectorLocalVector(u_vec)); - u = hypre_VectorData(hypre_ParVectorLocalVector(u_vec)); - for (i = 0; i < n; i++) + for (level = 0; level < (num_levels - 1); level++) { - if (CF_marker_array[level][i] == 1) + u_vec = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A_array[level]), + hypre_ParCSRMatrixGlobalNumRows(A_array[level]), + hypre_ParCSRMatrixRowStarts(A_array[level])); + hypre_ParVectorInitialize(u_vec); + f_vec = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A_array[level]), + hypre_ParCSRMatrixGlobalNumRows(A_array[level]), + hypre_ParCSRMatrixRowStarts(A_array[level])); + hypre_ParVectorInitialize(f_vec); + + hypre_ParVectorSetRandomValues(u_vec, 99); + hypre_ParVectorSetConstantValues(f_vec, 0.0); + + /* set C-pt values to zero */ + n = hypre_VectorSize(hypre_ParVectorLocalVector(u_vec)); + u = hypre_VectorData(hypre_ParVectorLocalVector(u_vec)); + for (i = 0; i < n; i++) { - u[i] = 0.0; + if (CF_marker_array[level][i] == 1) + { + u[i] = 0.0; + } } - } - rho1 = hypre_ParVectorInnerProd(u_vec, u_vec); - for (i = 0; i < 5; i++) - { - rho0 = rho1; - hypre_BoomerAMGRelax(A_array[level], f_vec, CF_marker_array[level], - grid_relax_type[0], -1, - relax_weight[level], omega[level], l1_norms[level], - u_vec, Vtemp, Ztemp); - rho1 = hypre_ParVectorInnerProd(u_vec,u_vec); - rho = sqrt(rho1/rho0); - if (rho < 0.01) + rho1 = hypre_ParVectorInnerProd(u_vec, u_vec); + for (i = 0; i < 5; i++) { - break; + rho0 = rho1; + hypre_BoomerAMGRelax(A_array[level], f_vec, CF_marker_array[level], + grid_relax_type[0], -1, + relax_weight[level], omega[level], l1_norms[level], + u_vec, Vtemp, Ztemp); + rho1 = hypre_ParVectorInnerProd(u_vec, u_vec); + rho = hypre_sqrt(rho1 / rho0); + if (rho < 0.01) + { + break; + } } - } - hypre_ParVectorDestroy(u_vec); - hypre_ParVectorDestroy(f_vec); + hypre_ParVectorDestroy(u_vec); + hypre_ParVectorDestroy(f_vec); - if (my_id == 0) - { - hypre_printf("level = %d, rhocr = %f\n", level, rho); + if (my_id == 0) + { + hypre_printf("level = %d, rhocr = %f\n", level, rho); + } } } -} #endif + hypre_MemoryPrintUsage(comm, hypre_HandleLogLevel(hypre_handle()), "BoomerAMG setup end", 0); + hypre_GpuProfilingPopRange(); HYPRE_ANNOTATE_FUNC_END; - return(hypre_error_flag); + return (hypre_error_flag); } diff --git a/external/hypre/src/parcsr_ls/par_amg_solve.c b/external/hypre/src/parcsr_ls/par_amg_solve.c index 99c732f1..2ac04b30 100644 --- a/external/hypre/src/parcsr_ls/par_amg_solve.c +++ b/external/hypre/src/parcsr_ls/par_amg_solve.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -20,26 +20,26 @@ HYPRE_Int hypre_BoomerAMGSolve( void *amg_vdata, - hypre_ParCSRMatrix *A, - hypre_ParVector *f, - hypre_ParVector *u ) + hypre_ParCSRMatrix *A, + hypre_ParVector *f, + hypre_ParVector *u ) { - MPI_Comm comm = hypre_ParCSRMatrixComm(A); - - hypre_ParAMGData *amg_data = (hypre_ParAMGData*) amg_vdata; + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + hypre_ParAMGData *amg_data = (hypre_ParAMGData*) amg_vdata; /* Data Structure variables */ - - HYPRE_Int amg_print_level; - HYPRE_Int amg_logging; - HYPRE_Int cycle_count; - HYPRE_Int num_levels; - /* HYPRE_Int num_unknowns; */ - HYPRE_Int converge_type; - HYPRE_Real tol; - - HYPRE_Int block_mode; - + HYPRE_Int amg_print_level; + HYPRE_Int amg_logging; + HYPRE_Int cycle_count; + HYPRE_Int num_levels; + HYPRE_Int converge_type; + HYPRE_Int block_mode; + HYPRE_Int additive; + HYPRE_Int mult_additive; + HYPRE_Int simple; + HYPRE_Int min_iter; + HYPRE_Int max_iter; + HYPRE_Real tol; hypre_ParCSRMatrix **A_array; hypre_ParVector **F_array; @@ -47,48 +47,45 @@ hypre_BoomerAMGSolve( void *amg_vdata, hypre_ParCSRBlockMatrix **A_block_array; - /* Local variables */ - - HYPRE_Int j; - HYPRE_Int Solve_err_flag; - HYPRE_Int min_iter; - HYPRE_Int max_iter; - HYPRE_Int num_procs, my_id; - HYPRE_Int additive; - HYPRE_Int mult_additive; - HYPRE_Int simple; - - HYPRE_Real alpha = 1.0; - HYPRE_Real beta = -1.0; - HYPRE_Real cycle_op_count; - HYPRE_Real total_coeffs; - HYPRE_Real total_variables; - HYPRE_Real *num_coeffs; - HYPRE_Real *num_variables; - HYPRE_Real cycle_cmplxty = 0.0; - HYPRE_Real operat_cmplxty; - HYPRE_Real grid_cmplxty; - HYPRE_Real conv_factor = 0.0; - HYPRE_Real resid_nrm = 1.0; - HYPRE_Real resid_nrm_init = 0.0; - HYPRE_Real relative_resid; - HYPRE_Real rhs_norm = 0.0; - HYPRE_Real old_resid; - HYPRE_Real ieee_check = 0.; - - hypre_ParVector *Vtemp; - hypre_ParVector *Residual; + HYPRE_Int j; + HYPRE_Int Solve_err_flag; + HYPRE_Int num_procs, my_id; + HYPRE_Int num_vectors; + HYPRE_Real alpha = 1.0; + HYPRE_Real beta = -1.0; + HYPRE_Real cycle_op_count; + HYPRE_Real total_coeffs; + HYPRE_Real total_variables; + HYPRE_Real *num_coeffs; + HYPRE_Real *num_variables; + HYPRE_Real cycle_cmplxty = 0.0; + HYPRE_Real operat_cmplxty; + HYPRE_Real grid_cmplxty; + HYPRE_Real conv_factor = 0.0; + HYPRE_Real resid_nrm = 1.0; + HYPRE_Real resid_nrm_init = 0.0; + HYPRE_Real relative_resid; + HYPRE_Real rhs_norm = 0.0; + HYPRE_Real old_resid; + HYPRE_Real ieee_check = 0.; + + hypre_ParVector *Vtemp; + hypre_ParVector *Rtemp; + hypre_ParVector *Ptemp; + hypre_ParVector *Ztemp; + hypre_ParVector *Residual = NULL; HYPRE_ANNOTATE_FUNC_BEGIN; hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_rank(comm, &my_id); amg_print_level = hypre_ParAMGDataPrintLevel(amg_data); amg_logging = hypre_ParAMGDataLogging(amg_data); - if ( amg_logging > 1 ) + if (amg_logging > 1) + { Residual = hypre_ParAMGDataResidual(amg_data); - /* num_unknowns = hypre_ParAMGDataNumUnknowns(amg_data); */ + } num_levels = hypre_ParAMGDataNumLevels(amg_data); A_array = hypre_ParAMGDataAArray(amg_data); F_array = hypre_ParAMGDataFArray(amg_data); @@ -101,23 +98,40 @@ hypre_BoomerAMGSolve( void *amg_vdata, additive = hypre_ParAMGDataAdditive(amg_data); simple = hypre_ParAMGDataSimple(amg_data); mult_additive = hypre_ParAMGDataMultAdditive(amg_data); + block_mode = hypre_ParAMGDataBlockMode(amg_data); + A_block_array = hypre_ParAMGDataABlockArray(amg_data); + Vtemp = hypre_ParAMGDataVtemp(amg_data); + Rtemp = hypre_ParAMGDataRtemp(amg_data); + Ptemp = hypre_ParAMGDataPtemp(amg_data); + Ztemp = hypre_ParAMGDataZtemp(amg_data); + num_vectors = hypre_ParVectorNumVectors(f); A_array[0] = A; F_array[0] = f; U_array[0] = u; - block_mode = hypre_ParAMGDataBlockMode(amg_data); - - A_block_array = hypre_ParAMGDataABlockArray(amg_data); - + /* Verify that the number of vectors held by f and u match */ + if (hypre_ParVectorNumVectors(f) != + hypre_ParVectorNumVectors(u)) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Error: num_vectors for RHS and LHS do not match!\n"); + return hypre_error_flag; + } - /* Vtemp = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A_array[0]), - hypre_ParCSRMatrixGlobalNumRows(A_array[0]), - hypre_ParCSRMatrixRowStarts(A_array[0])); - hypre_ParVectorInitialize(Vtemp); - hypre_ParAMGDataVtemp(amg_data) = Vtemp; - */ - Vtemp = hypre_ParAMGDataVtemp(amg_data); + /* Update work vectors */ + hypre_ParVectorResize(Vtemp, num_vectors); + hypre_ParVectorResize(Rtemp, num_vectors); + hypre_ParVectorResize(Ptemp, num_vectors); + hypre_ParVectorResize(Ztemp, num_vectors); + if (amg_logging > 1) + { + hypre_ParVectorResize(Residual, num_vectors); + } + for (j = 1; j < num_levels; j++) + { + hypre_ParVectorResize(F_array[j], num_vectors); + hypre_ParVectorResize(U_array[j], num_vectors); + } /*----------------------------------------------------------------------- * Write the solver parameters @@ -145,8 +159,9 @@ hypre_BoomerAMGSolve( void *amg_vdata, *-----------------------------------------------------------------------*/ if (my_id == 0 && amg_print_level > 1 && tol > 0.) + { hypre_printf("\n\nAMG SOLUTION INFO:\n"); - + } /*----------------------------------------------------------------------- * Compute initial fine-grid residual and print @@ -156,12 +171,12 @@ hypre_BoomerAMGSolve( void *amg_vdata, { if ( amg_logging > 1 ) { - hypre_ParVectorCopy(F_array[0], Residual ); + hypre_ParVectorCopy(F_array[0], Residual); if (tol > 0) { - hypre_ParCSRMatrixMatvec(alpha, A_array[0], U_array[0], beta, Residual ); + hypre_ParCSRMatrixMatvec(alpha, A_array[0], U_array[0], beta, Residual); } - resid_nrm = sqrt(hypre_ParVectorInnerProd( Residual, Residual )); + resid_nrm = hypre_sqrt(hypre_ParVectorInnerProd( Residual, Residual )); } else { @@ -170,14 +185,14 @@ hypre_BoomerAMGSolve( void *amg_vdata, { hypre_ParCSRMatrixMatvec(alpha, A_array[0], U_array[0], beta, Vtemp); } - resid_nrm = sqrt(hypre_ParVectorInnerProd(Vtemp, Vtemp)); + resid_nrm = hypre_sqrt(hypre_ParVectorInnerProd(Vtemp, Vtemp)); } - /* Since it is does not diminish performance, attempt to return an error flag + /* Since it does not diminish performance, attempt to return an error flag and notify users when they supply bad input. */ if (resid_nrm != 0.) { - ieee_check = resid_nrm/resid_nrm; /* INF -> NaN conversion */ + ieee_check = resid_nrm / resid_nrm; /* INF -> NaN conversion */ } if (ieee_check != ieee_check) @@ -205,7 +220,7 @@ hypre_BoomerAMGSolve( void *amg_vdata, if (0 == converge_type) { - rhs_norm = sqrt(hypre_ParVectorInnerProd(f, f)); + rhs_norm = hypre_sqrt(hypre_ParVectorInnerProd(f, f)); if (rhs_norm) { relative_resid = resid_nrm_init / rhs_norm; @@ -232,7 +247,7 @@ hypre_BoomerAMGSolve( void *amg_vdata, hypre_printf(" residual factor residual\n"); hypre_printf(" -------- ------ --------\n"); hypre_printf(" Initial %e %e\n", resid_nrm_init, - relative_resid); + relative_resid); } /*----------------------------------------------------------------------- @@ -251,6 +266,9 @@ hypre_BoomerAMGSolve( void *amg_vdata, } else { + /* RL TODO: for now, force u's all-zero flag to be FALSE */ + hypre_ParVectorAllZeros(u) = 0; + hypre_BoomerAMGAdditiveCycle(amg_data); } @@ -262,15 +280,17 @@ hypre_BoomerAMGSolve( void *amg_vdata, { old_resid = resid_nrm; - if ( amg_logging > 1 ) + if (amg_logging > 1) { - hypre_ParCSRMatrixMatvecOutOfPlace(alpha, A_array[0], U_array[0], beta, F_array[0], Residual ); - resid_nrm = sqrt(hypre_ParVectorInnerProd( Residual, Residual )); + hypre_ParCSRMatrixMatvecOutOfPlace(alpha, A_array[0], U_array[0], beta, F_array[0], + Residual); + resid_nrm = hypre_sqrt(hypre_ParVectorInnerProd(Residual, Residual)); } else { - hypre_ParCSRMatrixMatvecOutOfPlace(alpha, A_array[0], U_array[0], beta, F_array[0], Vtemp); - resid_nrm = sqrt(hypre_ParVectorInnerProd(Vtemp, Vtemp)); + hypre_ParCSRMatrixMatvecOutOfPlace(alpha, A_array[0], U_array[0], beta, F_array[0], + Vtemp); + resid_nrm = hypre_sqrt(hypre_ParVectorInnerProd(Vtemp, Vtemp)); } if (old_resid) @@ -311,7 +331,7 @@ hypre_BoomerAMGSolve( void *amg_vdata, if (my_id == 0 && amg_print_level > 1) { hypre_printf(" Cycle %2d %e %f %e \n", cycle_count, - resid_nrm, conv_factor, relative_resid); + resid_nrm, conv_factor, relative_resid); } } @@ -326,9 +346,13 @@ hypre_BoomerAMGSolve( void *amg_vdata, *-----------------------------------------------------------------------*/ if (cycle_count > 0 && resid_nrm_init) - conv_factor = pow((resid_nrm/resid_nrm_init),(1.0/(HYPRE_Real) cycle_count)); + { + conv_factor = hypre_pow((resid_nrm / resid_nrm_init), (1.0 / (HYPRE_Real) cycle_count)); + } else + { conv_factor = 1.; + } if (amg_print_level > 1) { @@ -358,7 +382,7 @@ hypre_BoomerAMGSolve( void *amg_vdata, } - for (j=0;j1 ) + if ( amg_logging > 1 ) + { Residual = hypre_ParAMGDataResidual(amg_data); + } /* num_unknowns = hypre_ParAMGDataNumUnknowns(amg_data); */ num_levels = hypre_ParAMGDataNumLevels(amg_data); A_array = hypre_ParAMGDataAArray(amg_data); @@ -99,12 +101,12 @@ hypre_BoomerAMGSolveT( void *amg_vdata, HYPRE_ANNOTATE_FUNC_BEGIN; -/* Vtemp = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A_array[0]), - hypre_ParCSRMatrixGlobalNumRows(A_array[0]), - hypre_ParCSRMatrixRowStarts(A_array[0])); - hypre_ParVectorInitialize(Vtemp); - hypre_ParAMGDataVtemp(amg_data) = Vtemp; -*/ + /* Vtemp = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A_array[0]), + hypre_ParCSRMatrixGlobalNumRows(A_array[0]), + hypre_ParCSRMatrixRowStarts(A_array[0])); + hypre_ParVectorInitialize(Vtemp); + hypre_ParAMGDataVtemp(amg_data) = Vtemp; + */ Vtemp = hypre_ParAMGDataVtemp(amg_data); for (j = 1; j < num_levels; j++) { @@ -118,7 +120,9 @@ hypre_BoomerAMGSolveT( void *amg_vdata, if (my_id == 0 && amg_print_level > 1) + { hypre_BoomerAMGWriteSolverParams(amg_data); + } @@ -150,33 +154,35 @@ hypre_BoomerAMGSolveT( void *amg_vdata, * Compute initial fine-grid residual and print to logfile *-----------------------------------------------------------------------*/ - if ( amg_logging > 1 ) { + if ( amg_logging > 1 ) + { hypre_ParVectorCopy(F_array[0], Residual ); hypre_ParCSRMatrixMatvecT(alpha, A_array[0], U_array[0], beta, Residual ); - resid_nrm = sqrt(hypre_ParVectorInnerProd( Residual, Residual )); + resid_nrm = hypre_sqrt(hypre_ParVectorInnerProd( Residual, Residual )); } - else { + else + { hypre_ParVectorCopy(F_array[0], Vtemp); hypre_ParCSRMatrixMatvecT(alpha, A_array[0], U_array[0], beta, Vtemp); - resid_nrm = sqrt(hypre_ParVectorInnerProd(Vtemp, Vtemp)); + resid_nrm = hypre_sqrt(hypre_ParVectorInnerProd(Vtemp, Vtemp)); } resid_nrm_init = resid_nrm; - rhs_norm = sqrt(hypre_ParVectorInnerProd(f, f)); + rhs_norm = hypre_sqrt(hypre_ParVectorInnerProd(f, f)); relative_resid = 9999; if (rhs_norm) { relative_resid = resid_nrm_init / rhs_norm; } - if (my_id ==0 && (amg_print_level > 1)) + if (my_id == 0 && (amg_print_level > 1)) { hypre_printf(" relative\n"); hypre_printf(" residual factor residual\n"); hypre_printf(" -------- ------ --------\n"); - hypre_printf(" Initial %e %e\n",resid_nrm_init, - relative_resid); + hypre_printf(" Initial %e %e\n", resid_nrm_init, + relative_resid); } /*----------------------------------------------------------------------- @@ -198,15 +204,17 @@ hypre_BoomerAMGSolveT( void *amg_vdata, * Compute fine-grid residual and residual norm *----------------------------------------------------------------*/ - if ( amg_logging > 1 ) { + if ( amg_logging > 1 ) + { hypre_ParVectorCopy(F_array[0], Residual ); hypre_ParCSRMatrixMatvecT(alpha, A_array[0], U_array[0], beta, Residual ); - resid_nrm = sqrt(hypre_ParVectorInnerProd( Residual, Residual )); + resid_nrm = hypre_sqrt(hypre_ParVectorInnerProd( Residual, Residual )); } - else { + else + { hypre_ParVectorCopy(F_array[0], Vtemp); hypre_ParCSRMatrixMatvecT(alpha, A_array[0], U_array[0], beta, Vtemp); - resid_nrm = sqrt(hypre_ParVectorInnerProd(Vtemp, Vtemp)); + resid_nrm = hypre_sqrt(hypre_ParVectorInnerProd(Vtemp, Vtemp)); } conv_factor = resid_nrm / old_resid; @@ -226,20 +234,20 @@ hypre_BoomerAMGSolveT( void *amg_vdata, if (my_id == 0 && (amg_print_level > 1)) { hypre_printf(" Cycle %2d %e %f %e \n", cycle_count, - resid_nrm, conv_factor, relative_resid); + resid_nrm, conv_factor, relative_resid); } } - if (cycle_count == max_iter) Solve_err_flag = 1; + if (cycle_count == max_iter) { Solve_err_flag = 1; } /*----------------------------------------------------------------------- * Compute closing statistics *-----------------------------------------------------------------------*/ - conv_factor = pow((resid_nrm/resid_nrm_init),(1.0/((HYPRE_Real) cycle_count))); + conv_factor = hypre_pow((resid_nrm / resid_nrm_init), (1.0 / ((HYPRE_Real) cycle_count))); - for (j=0;j= 0 && level != num_levels-1) + if (lev_counter[level] >= 0 && level != num_levels - 1) { /*--------------------------------------------------------------- @@ -523,24 +541,24 @@ hypre_BoomerAMGCycleT( void *amg_vdata, hypre_ParVectorSetConstantValues(U_array[coarse_grid], 0.0); - hypre_ParVectorCopy(F_array[fine_grid],Vtemp); + hypre_ParVectorCopy(F_array[fine_grid], Vtemp); alpha = -1.0; beta = 1.0; hypre_ParCSRMatrixMatvecT(alpha, A_array[fine_grid], U_array[fine_grid], - beta, Vtemp); + beta, Vtemp); alpha = 1.0; beta = 0.0; - hypre_ParCSRMatrixMatvecT(alpha,P_array[fine_grid],Vtemp, - beta,F_array[coarse_grid]); + hypre_ParCSRMatrixMatvecT(alpha, P_array[fine_grid], Vtemp, + beta, F_array[coarse_grid]); HYPRE_ANNOTATE_MGLEVEL_END(level); ++level; - lev_counter[level] = hypre_max(lev_counter[level],cycle_type); + lev_counter[level] = hypre_max(lev_counter[level], cycle_type); cycle_param = 1; - if (level == num_levels-1) cycle_param = 3; + if (level == num_levels - 1) { cycle_param = 3; } HYPRE_ANNOTATE_MGLEVEL_BEGIN(level); } @@ -561,13 +579,13 @@ hypre_BoomerAMGCycleT( void *amg_vdata, beta = 1.0; hypre_ParCSRMatrixMatvec(alpha, R_array[fine_grid], U_array[coarse_grid], - beta, U_array[fine_grid]); + beta, U_array[fine_grid]); HYPRE_ANNOTATE_MGLEVEL_END(level); --level; cycle_param = 2; - if (level == 0) cycle_param = 0; + if (level == 0) { cycle_param = 0; } HYPRE_ANNOTATE_MGLEVEL_BEGIN(level); } @@ -585,7 +603,7 @@ hypre_BoomerAMGCycleT( void *amg_vdata, HYPRE_ANNOTATE_FUNC_END; - return(Solve_err_flag); + return (Solve_err_flag); } /****************************************************************************** @@ -598,15 +616,19 @@ hypre_BoomerAMGCycleT( void *amg_vdata, * hypre_BoomerAMGRelaxT *--------------------------------------------------------------------------*/ -HYPRE_Int hypre_BoomerAMGRelaxT( hypre_ParCSRMatrix *A, - hypre_ParVector *f, - HYPRE_Int *cf_marker, - HYPRE_Int relax_type, - HYPRE_Int relax_points, - HYPRE_Real relax_weight, - hypre_ParVector *u, - hypre_ParVector *Vtemp ) +HYPRE_Int +hypre_BoomerAMGRelaxT( hypre_ParCSRMatrix *A, + hypre_ParVector *f, + HYPRE_Int *cf_marker, + HYPRE_Int relax_type, + HYPRE_Int relax_points, + HYPRE_Real relax_weight, + hypre_ParVector *u, + hypre_ParVector *Vtemp ) { + HYPRE_UNUSED_VAR(cf_marker); + HYPRE_UNUSED_VAR(relax_points); + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); HYPRE_Real *A_diag_data = hypre_CSRMatrixData(A_diag); HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); @@ -622,12 +644,12 @@ HYPRE_Int hypre_BoomerAMGRelaxT( hypre_ParCSRMatrix *A, HYPRE_Real *Vtemp_data = hypre_VectorData(Vtemp_local); hypre_CSRMatrix *A_CSR; - HYPRE_Int *A_CSR_i; - HYPRE_Int *A_CSR_j; - HYPRE_Real *A_CSR_data; + HYPRE_Int *A_CSR_i; + HYPRE_Int *A_CSR_j; + HYPRE_Real *A_CSR_data; hypre_Vector *f_vector; - HYPRE_Real *f_vector_data; + HYPRE_Real *f_vector_data; HYPRE_Int i; HYPRE_Int jj; @@ -657,26 +679,26 @@ HYPRE_Int hypre_BoomerAMGRelaxT( hypre_ParCSRMatrix *A, * Copy f into temporary vector. *-----------------------------------------------------------------*/ - hypre_ParVectorCopy(f,Vtemp); + hypre_ParVectorCopy(f, Vtemp); /*----------------------------------------------------------------- * Perform MatvecT Vtemp=f-A^Tu *-----------------------------------------------------------------*/ - hypre_ParCSRMatrixMatvecT(-1.0,A, u, 1.0, Vtemp); - for (i = 0; i < n; i++) - { + hypre_ParCSRMatrixMatvecT(-1.0, A, u, 1.0, Vtemp); + for (i = 0; i < n; i++) + { - /*----------------------------------------------------------- - * If diagonal is nonzero, relax point i; otherwise, skip it. - *-----------------------------------------------------------*/ + /*----------------------------------------------------------- + * If diagonal is nonzero, relax point i; otherwise, skip it. + *-----------------------------------------------------------*/ - if (A_diag_data[A_diag_i[i]] != zero) - { - u_data[i] += relax_weight * Vtemp_data[i] - / A_diag_data[A_diag_i[i]]; - } + if (A_diag_data[A_diag_i[i]] != zero) + { + u_data[i] += relax_weight * Vtemp_data[i] + / A_diag_data[A_diag_i[i]]; } + } } break; @@ -689,16 +711,16 @@ HYPRE_Int hypre_BoomerAMGRelaxT( hypre_ParCSRMatrix *A, * Generate CSR matrix from ParCSRMatrix A *-----------------------------------------------------------------*/ - if (n) - { - A_CSR = hypre_ParCSRMatrixToCSRMatrixAll(A); - f_vector = hypre_ParVectorToVectorAll(f); - A_CSR_i = hypre_CSRMatrixI(A_CSR); - A_CSR_j = hypre_CSRMatrixJ(A_CSR); - A_CSR_data = hypre_CSRMatrixData(A_CSR); - f_vector_data = hypre_VectorData(f_vector); + A_CSR = hypre_ParCSRMatrixToCSRMatrixAll(A); + f_vector = hypre_ParVectorToVectorAll(f); + if (n) + { + A_CSR_i = hypre_CSRMatrixI(A_CSR); + A_CSR_j = hypre_CSRMatrixJ(A_CSR); + A_CSR_data = hypre_CSRMatrixData(A_CSR); + f_vector_data = hypre_VectorData(f_vector); - A_mat = hypre_CTAlloc(HYPRE_Real, n_global*n_global, HYPRE_MEMORY_HOST); + A_mat = hypre_CTAlloc(HYPRE_Real, n_global * n_global, HYPRE_MEMORY_HOST); b_vec = hypre_CTAlloc(HYPRE_Real, n_global, HYPRE_MEMORY_HOST); /*--------------------------------------------------------------- @@ -707,10 +729,10 @@ HYPRE_Int hypre_BoomerAMGRelaxT( hypre_ParCSRMatrix *A, for (i = 0; i < n_global; i++) { - for (jj = A_CSR_i[i]; jj < A_CSR_i[i+1]; jj++) + for (jj = A_CSR_i[i]; jj < A_CSR_i[i + 1]; jj++) { column = A_CSR_j[jj]; - A_mat[column*n_global+i] = A_CSR_data[jj]; + A_mat[column * n_global + i] = A_CSR_data[jj]; } b_vec[i] = f_vector_data[i]; } @@ -719,10 +741,10 @@ HYPRE_Int hypre_BoomerAMGRelaxT( hypre_ParCSRMatrix *A, for (i = 0; i < n; i++) { - u_data[i] = b_vec[first_index+i]; + u_data[i] = b_vec[first_index + i]; } - hypre_TFree(A_mat, HYPRE_MEMORY_HOST); + hypre_TFree(A_mat, HYPRE_MEMORY_HOST); hypre_TFree(b_vec, HYPRE_MEMORY_HOST); hypre_CSRMatrixDestroy(A_CSR); A_CSR = NULL; @@ -736,5 +758,5 @@ HYPRE_Int hypre_BoomerAMGRelaxT( hypre_ParCSRMatrix *A, HYPRE_ANNOTATE_FUNC_END; - return(relax_error); + return (relax_error); } diff --git a/external/hypre/src/parcsr_ls/par_amgdd.c b/external/hypre/src/parcsr_ls/par_amgdd.c index 2ddf87e3..80b67c24 100644 --- a/external/hypre/src/parcsr_ls/par_amgdd.c +++ b/external/hypre/src/parcsr_ls/par_amgdd.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -18,7 +18,7 @@ *--------------------------------------------------------------------------*/ void * -hypre_BoomerAMGDDCreate() +hypre_BoomerAMGDDCreate( void ) { hypre_ParAMGDDData *amgdd_data = hypre_CTAlloc(hypre_ParAMGDDData, 1, HYPRE_MEMORY_HOST); @@ -360,7 +360,7 @@ hypre_BoomerAMGDDGetNumGhostLayers( void *data, HYPRE_Int hypre_BoomerAMGDDSetUserFACRelaxation( void *data, - HYPRE_Int (*userFACRelaxation)( void *amgdd_vdata , HYPRE_Int level, HYPRE_Int cycle_param )) + HYPRE_Int (*userFACRelaxation)( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param )) { hypre_ParAMGDDData *amgdd_data = (hypre_ParAMGDDData*) data; diff --git a/external/hypre/src/parcsr_ls/par_amgdd.h b/external/hypre/src/parcsr_ls/par_amgdd.h index 45896f9b..e37ff59b 100644 --- a/external/hypre/src/parcsr_ls/par_amgdd.h +++ b/external/hypre/src/parcsr_ls/par_amgdd.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -30,7 +30,8 @@ typedef struct hypre_AMGDDCommPkg *amgdd_comm_pkg; hypre_ParVector *Ztemp; - HYPRE_Int (*amgddUserFACRelaxation)( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ); + HYPRE_Int (*amgddUserFACRelaxation)( void *amgdd_vdata, HYPRE_Int level, + HYPRE_Int cycle_param ); } hypre_ParAMGDDData; /*-------------------------------------------------------------------------- diff --git a/external/hypre/src/parcsr_ls/par_amgdd_comp_grid.c b/external/hypre/src/parcsr_ls/par_amgdd_comp_grid.c index bbd41359..81217e5e 100644 --- a/external/hypre/src/parcsr_ls/par_amgdd_comp_grid.c +++ b/external/hypre/src/parcsr_ls/par_amgdd_comp_grid.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -51,7 +51,7 @@ hypre_AMGDDCompGridLocalIndexBinarySearch( hypre_AMGDDCompGrid *compGrid, return -1; } -hypre_AMGDDCompGridMatrix* hypre_AMGDDCompGridMatrixCreate() +hypre_AMGDDCompGridMatrix* hypre_AMGDDCompGridMatrixCreate( void ) { hypre_AMGDDCompGridMatrix *matrix = hypre_CTAlloc(hypre_AMGDDCompGridMatrix, 1, HYPRE_MEMORY_HOST); @@ -81,12 +81,21 @@ hypre_AMGDDCompGridMatrixDestroy( hypre_AMGDDCompGridMatrix *matrix ) } else if (hypre_AMGDDCompGridMatrixOwnsOffdColIndices(matrix)) { + HYPRE_MemoryLocation memory_location = hypre_CSRMatrixMemoryLocation( + hypre_AMGDDCompGridMatrixOwnedOffd(matrix)); + if (hypre_CSRMatrixJ(hypre_AMGDDCompGridMatrixOwnedOffd(matrix))) { - hypre_TFree(hypre_CSRMatrixJ(hypre_AMGDDCompGridMatrixOwnedOffd(matrix)), - hypre_CSRMatrixMemoryLocation(hypre_AMGDDCompGridMatrixOwnedOffd(matrix))); + hypre_TFree(hypre_CSRMatrixJ(hypre_AMGDDCompGridMatrixOwnedOffd(matrix)), memory_location); } +#if defined(HYPRE_USING_CUSPARSE) || defined(HYPRE_USING_ROCSPARSE) || defined(HYPRE_USING_ONEMKLSPARSE) + hypre_TFree(hypre_CSRMatrixSortedData(hypre_AMGDDCompGridMatrixOwnedOffd(matrix)), memory_location); + hypre_TFree(hypre_CSRMatrixSortedJ(hypre_AMGDDCompGridMatrixOwnedOffd(matrix)), memory_location); + hypre_CsrsvDataDestroy(hypre_CSRMatrixCsrsvData(hypre_AMGDDCompGridMatrixOwnedOffd(matrix))); + hypre_GpuMatDataDestroy(hypre_CSRMatrixGPUMatData(hypre_AMGDDCompGridMatrixOwnedOffd(matrix))); +#endif + hypre_TFree(hypre_AMGDDCompGridMatrixOwnedOffd(matrix), HYPRE_MEMORY_HOST); } @@ -138,20 +147,20 @@ hypre_AMGDDCompGridMatrixSetupRealMatvec( hypre_AMGDDCompGridMatrix *A ) { A_rri[i] = A_real_real_nnz; A_rgi[i] = A_real_ghost_nnz; - for (j = A_i[i]; j < A_i[i+1]; j++) + for (j = A_i[i]; j < A_i[i + 1]; j++) { col_ind = A_j[j]; if (col_ind < num_real) { - A_rrj[A_real_real_nnz] = col_ind; - A_rrdata[A_real_real_nnz] = A_data[j]; - A_real_real_nnz++; + A_rrj[A_real_real_nnz] = col_ind; + A_rrdata[A_real_real_nnz] = A_data[j]; + A_real_real_nnz++; } else { - A_rgj[A_real_ghost_nnz] = col_ind; - A_rgdata[A_real_ghost_nnz] = A_data[j]; - A_real_ghost_nnz++; + A_rgj[A_real_ghost_nnz] = col_ind; + A_rgdata[A_real_ghost_nnz] = A_data[j]; + A_real_ghost_nnz++; } } } @@ -241,7 +250,7 @@ hypre_AMGDDCompGridRealMatvec( HYPRE_Complex alpha, return hypre_error_flag; } -hypre_AMGDDCompGridVector *hypre_AMGDDCompGridVectorCreate() +hypre_AMGDDCompGridVector *hypre_AMGDDCompGridVectorCreate( void ) { hypre_AMGDDCompGridVector *vector = hypre_CTAlloc(hypre_AMGDDCompGridVector, 1, HYPRE_MEMORY_HOST); @@ -479,7 +488,7 @@ hypre_AMGDDCompGridVectorRealCopy( hypre_AMGDDCompGridVector *x, return hypre_error_flag; } -hypre_AMGDDCompGrid *hypre_AMGDDCompGridCreate () +hypre_AMGDDCompGrid *hypre_AMGDDCompGridCreate ( void ) { hypre_AMGDDCompGrid *compGrid; @@ -614,20 +623,23 @@ hypre_AMGDDCompGridInitialize( hypre_ParAMGDDData *amgdd_data, hypre_AMGDDCompGridLevel(compGrid) = level; hypre_AMGDDCompGridFirstGlobalIndex(compGrid) = hypre_ParVectorFirstIndex(F_array[level]); hypre_AMGDDCompGridLastGlobalIndex(compGrid) = hypre_ParVectorLastIndex(F_array[level]); - hypre_AMGDDCompGridNumOwnedNodes(compGrid) = hypre_VectorSize(hypre_ParVectorLocalVector(F_array[level])); + hypre_AMGDDCompGridNumOwnedNodes(compGrid) = hypre_VectorSize(hypre_ParVectorLocalVector( + F_array[level])); hypre_AMGDDCompGridNumNonOwnedNodes(compGrid) = hypre_CSRMatrixNumCols(A_offd_original); hypre_AMGDDCompGridNumMissingColIndices(compGrid) = 0; - hypre_AMGDDCompGridMemoryLocation(compGrid) = hypre_ParCSRMatrixMemoryLocation(A_array[level]); + hypre_AMGDDCompGridMemoryLocation(compGrid) = hypre_ParCSRMatrixMemoryLocation( + A_array[level]); memory_location = hypre_AMGDDCompGridMemoryLocation(compGrid); num_owned_nodes = hypre_AMGDDCompGridNumOwnedNodes(compGrid); // !!! Check on how good a guess this is for eventual size of the nononwed dofs and nnz max_nonowned = 2 * (padding + hypre_ParAMGDDDataNumGhostLayers(amgdd_data)) * - hypre_CSRMatrixNumCols(A_offd_original); + hypre_CSRMatrixNumCols(A_offd_original); avg_nnz_per_row = 0; if (hypre_CSRMatrixNumRows(A_diag_original)) { - avg_nnz_per_row = (HYPRE_Int) (hypre_CSRMatrixNumNonzeros(A_diag_original) / hypre_CSRMatrixNumRows(A_diag_original)); + avg_nnz_per_row = (HYPRE_Int) (hypre_CSRMatrixNumNonzeros(A_diag_original) / hypre_CSRMatrixNumRows( + A_diag_original)); } max_nonowned_diag_nnz = max_nonowned * avg_nnz_per_row; max_nonowned_offd_nnz = hypre_CSRMatrixNumNonzeros(A_offd_original); @@ -658,7 +670,8 @@ hypre_AMGDDCompGridInitialize( hypre_ParAMGDDData *amgdd_data, // Use original rowptr and data from P, but need to use new col indices (init to global index, then setup local indices later) P_offd_original = hypre_ParCSRMatrixOffd(P_array[level] ); - hypre_AMGDDCompGridMatrixOwnedOffd(P) = hypre_CSRMatrixCreate(hypre_CSRMatrixNumRows(P_offd_original), + hypre_AMGDDCompGridMatrixOwnedOffd(P) = hypre_CSRMatrixCreate(hypre_CSRMatrixNumRows( + P_offd_original), hypre_CSRMatrixNumCols(P_offd_original), hypre_CSRMatrixNumNonzeros(P_offd_original)); hypre_CSRMatrixI(hypre_AMGDDCompGridMatrixOwnedOffd(P)) = hypre_CSRMatrixI(P_offd_original); @@ -670,7 +683,8 @@ hypre_AMGDDCompGridInitialize( hypre_ParAMGDDData *amgdd_data, // Initialize P owned offd col ind to their global indices for (i = 0; i < hypre_CSRMatrixNumNonzeros(hypre_AMGDDCompGridMatrixOwnedOffd(P)); i++) { - hypre_CSRMatrixJ(hypre_AMGDDCompGridMatrixOwnedOffd(P))[i] = hypre_ParCSRMatrixColMapOffd(P_array[level])[ hypre_CSRMatrixJ(P_offd_original)[i] ]; + hypre_CSRMatrixJ(hypre_AMGDDCompGridMatrixOwnedOffd(P))[i] = hypre_ParCSRMatrixColMapOffd( + P_array[level])[ hypre_CSRMatrixJ(P_offd_original)[i] ]; } hypre_AMGDDCompGridMatrixOwnsOwnedMatrices(P) = 0; @@ -684,7 +698,8 @@ hypre_AMGDDCompGridInitialize( hypre_ParAMGDDData *amgdd_data, // Use original rowptr and data from R, but need to use new col indices (init to global index, then setup local indices later) R_offd_original = hypre_ParCSRMatrixOffd(R_array[level]); - hypre_AMGDDCompGridMatrixOwnedOffd(R) = hypre_CSRMatrixCreate(hypre_CSRMatrixNumRows(R_offd_original), + hypre_AMGDDCompGridMatrixOwnedOffd(R) = hypre_CSRMatrixCreate(hypre_CSRMatrixNumRows( + R_offd_original), hypre_CSRMatrixNumCols(R_offd_original), hypre_CSRMatrixNumNonzeros(R_offd_original)); hypre_CSRMatrixI(hypre_AMGDDCompGridMatrixOwnedOffd(R)) = hypre_CSRMatrixI(R_offd_original); @@ -696,7 +711,8 @@ hypre_AMGDDCompGridInitialize( hypre_ParAMGDDData *amgdd_data, // Initialize R owned offd col ind to their global indices for (i = 0; i < hypre_CSRMatrixNumNonzeros(hypre_AMGDDCompGridMatrixOwnedOffd(R)); i++) { - hypre_CSRMatrixJ(hypre_AMGDDCompGridMatrixOwnedOffd(R))[i] = hypre_ParCSRMatrixColMapOffd(R_array[level])[ hypre_CSRMatrixJ(R_offd_original)[i] ]; + hypre_CSRMatrixJ(hypre_AMGDDCompGridMatrixOwnedOffd(R))[i] = hypre_ParCSRMatrixColMapOffd( + R_array[level])[ hypre_CSRMatrixJ(R_offd_original)[i] ]; } hypre_AMGDDCompGridMatrixOwnsOwnedMatrices(R) = 0; @@ -706,24 +722,32 @@ hypre_AMGDDCompGridInitialize( hypre_ParAMGDDData *amgdd_data, } // Allocate some extra arrays used during AMG-DD setup - hypre_AMGDDCompGridNonOwnedGlobalIndices(compGrid) = hypre_CTAlloc(HYPRE_Int, max_nonowned, memory_location); - hypre_AMGDDCompGridNonOwnedRealMarker(compGrid) = hypre_CTAlloc(HYPRE_Int, max_nonowned, memory_location); - hypre_AMGDDCompGridNonOwnedSort(compGrid) = hypre_CTAlloc(HYPRE_Int, max_nonowned, memory_location); - hypre_AMGDDCompGridNonOwnedInvSort(compGrid) = hypre_CTAlloc(HYPRE_Int, max_nonowned, memory_location); + hypre_AMGDDCompGridNonOwnedGlobalIndices(compGrid) = hypre_CTAlloc(HYPRE_Int, max_nonowned, + memory_location); + hypre_AMGDDCompGridNonOwnedRealMarker(compGrid) = hypre_CTAlloc(HYPRE_Int, max_nonowned, + memory_location); + hypre_AMGDDCompGridNonOwnedSort(compGrid) = hypre_CTAlloc(HYPRE_Int, max_nonowned, + memory_location); + hypre_AMGDDCompGridNonOwnedInvSort(compGrid) = hypre_CTAlloc(HYPRE_Int, max_nonowned, + memory_location); // Initialize nonowned global indices, real marker, and the sort and invsort arrays for (i = 0; i < hypre_CSRMatrixNumCols(A_offd_original); i++) { - hypre_AMGDDCompGridNonOwnedGlobalIndices(compGrid)[i] = hypre_ParCSRMatrixColMapOffd(A_array[level])[i]; + hypre_AMGDDCompGridNonOwnedGlobalIndices(compGrid)[i] = hypre_ParCSRMatrixColMapOffd( + A_array[level])[i]; hypre_AMGDDCompGridNonOwnedSort(compGrid)[i] = i; hypre_AMGDDCompGridNonOwnedInvSort(compGrid)[i] = i; - hypre_AMGDDCompGridNonOwnedRealMarker(compGrid)[i] = 1; // NOTE: Assume that padding is at least 1, i.e. first layer of points are real + hypre_AMGDDCompGridNonOwnedRealMarker(compGrid)[i] = + 1; // NOTE: Assume that padding is at least 1, i.e. first layer of points are real } if (level != hypre_ParAMGDataNumLevels(amg_data) - 1) { - hypre_AMGDDCompGridNonOwnedCoarseIndices(compGrid) = hypre_CTAlloc(HYPRE_Int, max_nonowned, memory_location); - hypre_AMGDDCompGridOwnedCoarseIndices(compGrid) = hypre_CTAlloc(HYPRE_Int, num_owned_nodes, memory_location); + hypre_AMGDDCompGridNonOwnedCoarseIndices(compGrid) = hypre_CTAlloc(HYPRE_Int, max_nonowned, + memory_location); + hypre_AMGDDCompGridOwnedCoarseIndices(compGrid) = hypre_CTAlloc(HYPRE_Int, num_owned_nodes, + memory_location); // Setup the owned coarse indices if ( CF_marker_array ) @@ -784,37 +808,42 @@ HYPRE_Int hypre_AMGDDCompGridSetupRelax( hypre_ParAMGDDData *amgdd_data ) } else { - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"WARNING: unknown AMGDD FAC relaxation type. Defaulting to CFL1 Jacobi.\n"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "WARNING: unknown AMGDD FAC relaxation type. Defaulting to CFL1 Jacobi.\n"); hypre_ParAMGDDDataUserFACRelaxation(amgdd_data) = hypre_BoomerAMGDD_FAC_CFL1Jacobi; hypre_ParAMGDDDataFACRelaxType(amgdd_data) = 3; } if (hypre_ParAMGDDDataFACRelaxType(amgdd_data) == 3) { - for (level = hypre_ParAMGDDDataStartLevel(amgdd_data); level < hypre_ParAMGDataNumLevels(amg_data); level++) + for (level = hypre_ParAMGDDDataStartLevel(amgdd_data); level < hypre_ParAMGDataNumLevels(amg_data); + level++) { compGrid = hypre_ParAMGDDDataCompGrid(amgdd_data)[level]; // Calculate l1_norms - total_num_nodes = hypre_AMGDDCompGridNumOwnedNodes(compGrid) + hypre_AMGDDCompGridNumNonOwnedNodes(compGrid); - hypre_AMGDDCompGridL1Norms(compGrid) = hypre_CTAlloc(HYPRE_Real, total_num_nodes, hypre_AMGDDCompGridMemoryLocation(compGrid)); + total_num_nodes = hypre_AMGDDCompGridNumOwnedNodes(compGrid) + hypre_AMGDDCompGridNumNonOwnedNodes( + compGrid); + hypre_AMGDDCompGridL1Norms(compGrid) = hypre_CTAlloc(HYPRE_Real, total_num_nodes, + hypre_AMGDDCompGridMemoryLocation(compGrid)); diag = hypre_AMGDDCompGridMatrixOwnedDiag(hypre_AMGDDCompGridA(compGrid)); offd = hypre_AMGDDCompGridMatrixOwnedOffd(hypre_AMGDDCompGridA(compGrid)); for (i = 0; i < hypre_AMGDDCompGridNumOwnedNodes(compGrid); i++) { cf_diag = hypre_AMGDDCompGridCFMarkerArray(compGrid)[i]; - for (j = hypre_CSRMatrixI(diag)[i]; j < hypre_CSRMatrixI(diag)[i+1]; j++) + for (j = hypre_CSRMatrixI(diag)[i]; j < hypre_CSRMatrixI(diag)[i + 1]; j++) { if (hypre_AMGDDCompGridCFMarkerArray(compGrid)[ hypre_CSRMatrixJ(diag)[j] ] == cf_diag) { - hypre_AMGDDCompGridL1Norms(compGrid)[i] += fabs(hypre_CSRMatrixData(diag)[j]); + hypre_AMGDDCompGridL1Norms(compGrid)[i] += hypre_cabs(hypre_CSRMatrixData(diag)[j]); } } - for (j = hypre_CSRMatrixI(offd)[i]; j < hypre_CSRMatrixI(offd)[i+1]; j++) + for (j = hypre_CSRMatrixI(offd)[i]; j < hypre_CSRMatrixI(offd)[i + 1]; j++) { - if (hypre_AMGDDCompGridCFMarkerArray(compGrid)[ hypre_CSRMatrixJ(offd)[j] + hypre_AMGDDCompGridNumOwnedNodes(compGrid) ] == cf_diag) + if (hypre_AMGDDCompGridCFMarkerArray(compGrid)[ hypre_CSRMatrixJ(offd)[j] + + hypre_AMGDDCompGridNumOwnedNodes(compGrid) ] == cf_diag) { - hypre_AMGDDCompGridL1Norms(compGrid)[i] += fabs(hypre_CSRMatrixData(offd)[j]); + hypre_AMGDDCompGridL1Norms(compGrid)[i] += hypre_cabs(hypre_CSRMatrixData(offd)[j]); } } } @@ -823,19 +852,23 @@ HYPRE_Int hypre_AMGDDCompGridSetupRelax( hypre_ParAMGDDData *amgdd_data ) offd = hypre_AMGDDCompGridMatrixNonOwnedOffd(hypre_AMGDDCompGridA(compGrid)); for (i = 0; i < hypre_AMGDDCompGridNumNonOwnedNodes(compGrid); i++) { - cf_diag = hypre_AMGDDCompGridCFMarkerArray(compGrid)[i + hypre_AMGDDCompGridNumOwnedNodes(compGrid)]; - for (j = hypre_CSRMatrixI(diag)[i]; j < hypre_CSRMatrixI(diag)[i+1]; j++) + cf_diag = hypre_AMGDDCompGridCFMarkerArray(compGrid)[i + hypre_AMGDDCompGridNumOwnedNodes( + compGrid)]; + for (j = hypre_CSRMatrixI(diag)[i]; j < hypre_CSRMatrixI(diag)[i + 1]; j++) { - if (hypre_AMGDDCompGridCFMarkerArray(compGrid)[ hypre_CSRMatrixJ(diag)[j] + hypre_AMGDDCompGridNumOwnedNodes(compGrid) ] == cf_diag) + if (hypre_AMGDDCompGridCFMarkerArray(compGrid)[ hypre_CSRMatrixJ(diag)[j] + + hypre_AMGDDCompGridNumOwnedNodes(compGrid) ] == cf_diag) { - hypre_AMGDDCompGridL1Norms(compGrid)[i + hypre_AMGDDCompGridNumOwnedNodes(compGrid)] += fabs(hypre_CSRMatrixData(diag)[j]); + hypre_AMGDDCompGridL1Norms(compGrid)[i + hypre_AMGDDCompGridNumOwnedNodes(compGrid)] += hypre_cabs( + hypre_CSRMatrixData(diag)[j]); } } - for (j = hypre_CSRMatrixI(offd)[i]; j < hypre_CSRMatrixI(offd)[i+1]; j++) + for (j = hypre_CSRMatrixI(offd)[i]; j < hypre_CSRMatrixI(offd)[i + 1]; j++) { if (hypre_AMGDDCompGridCFMarkerArray(compGrid)[ hypre_CSRMatrixJ(offd)[j]] == cf_diag) { - hypre_AMGDDCompGridL1Norms(compGrid)[i + hypre_AMGDDCompGridNumOwnedNodes(compGrid)] += fabs(hypre_CSRMatrixData(offd)[j]); + hypre_AMGDDCompGridL1Norms(compGrid)[i + hypre_AMGDDCompGridNumOwnedNodes(compGrid)] += hypre_cabs( + hypre_CSRMatrixData(offd)[j]); } } } @@ -875,27 +908,27 @@ HYPRE_Int hypre_AMGDDCompGridFinalize( hypre_ParAMGDDData *amgdd_data ) hypre_CSRMatrix *P_offd; HYPRE_Int P_diag_nnz; - HYPRE_Int *new_P_diag_rowPtr; - HYPRE_Int *new_P_diag_colInd; + HYPRE_Int *new_P_diag_rowPtr = NULL; + HYPRE_Int *new_P_diag_colInd = NULL; HYPRE_Complex *new_P_diag_data; HYPRE_Int P_offd_nnz; - HYPRE_Int *new_P_offd_rowPtr; - HYPRE_Int *new_P_offd_colInd; + HYPRE_Int *new_P_offd_rowPtr = NULL; + HYPRE_Int *new_P_offd_colInd = NULL; HYPRE_Complex *new_P_offd_data; - hypre_CSRMatrix *R_diag; - hypre_CSRMatrix *R_offd; + hypre_CSRMatrix *R_diag = NULL; + hypre_CSRMatrix *R_offd = NULL; HYPRE_Int R_diag_nnz; - HYPRE_Int *new_R_diag_rowPtr; - HYPRE_Int *new_R_diag_colInd; - HYPRE_Complex *new_R_diag_data; + HYPRE_Int *new_R_diag_rowPtr = NULL; + HYPRE_Int *new_R_diag_colInd = NULL; + HYPRE_Complex *new_R_diag_data = NULL; HYPRE_Int R_offd_nnz; - HYPRE_Int *new_R_offd_rowPtr; - HYPRE_Int *new_R_offd_colInd; - HYPRE_Complex *new_R_offd_data; + HYPRE_Int *new_R_offd_rowPtr = NULL; + HYPRE_Int *new_R_offd_colInd = NULL; + HYPRE_Complex *new_R_offd_data = NULL; HYPRE_Int A_diag_cnt; HYPRE_Int A_offd_cnt; @@ -964,7 +997,8 @@ HYPRE_Int hypre_AMGDDCompGridFinalize( hypre_ParAMGDDData *amgdd_data ) if (hypre_AMGDDCommPkgSendFlag(amgddCommPkg)[outer_level][proc][level][i] >= num_owned) { hypre_AMGDDCommPkgSendFlag(amgddCommPkg)[outer_level][proc][level][new_num_send_nodes++] = - new_indices[ hypre_AMGDDCommPkgSendFlag(amgddCommPkg)[outer_level][proc][level][i] - num_owned ] + num_owned; + new_indices[ hypre_AMGDDCommPkgSendFlag(amgddCommPkg)[outer_level][proc][level][i] - num_owned ] + + num_owned; } else if (hypre_AMGDDCommPkgSendFlag(amgddCommPkg)[outer_level][proc][level][i] >= 0) { @@ -993,8 +1027,9 @@ HYPRE_Int hypre_AMGDDCompGridFinalize( hypre_ParAMGDDData *amgdd_data ) } // Setup CF marker array - hypre_AMGDDCompGridCFMarkerArray(compGrid[level]) = hypre_CTAlloc(HYPRE_Int, num_owned + num_nonowned, memory_location); - if (level != num_levels-1) + hypre_AMGDDCompGridCFMarkerArray(compGrid[level]) = hypre_CTAlloc(HYPRE_Int, + num_owned + num_nonowned, memory_location); + if (level != num_levels - 1) { // Setup CF marker array for (i = 0; i < num_owned; i++) @@ -1033,45 +1068,45 @@ HYPRE_Int hypre_AMGDDCompGridFinalize( hypre_ParAMGDDData *amgdd_data ) A_offd = hypre_AMGDDCompGridMatrixNonOwnedOffd(hypre_AMGDDCompGridA(compGrid[level])); A_diag_nnz = hypre_CSRMatrixI(A_diag)[num_nonowned]; - new_A_diag_rowPtr = hypre_CTAlloc(HYPRE_Int, num_nonowned+1, memory_location); + new_A_diag_rowPtr = hypre_CTAlloc(HYPRE_Int, num_nonowned + 1, memory_location); new_A_diag_colInd = hypre_CTAlloc(HYPRE_Int, A_diag_nnz, memory_location); new_A_diag_data = hypre_CTAlloc(HYPRE_Complex, A_diag_nnz, memory_location); A_offd_nnz = hypre_CSRMatrixI(A_offd)[num_nonowned]; - new_A_offd_rowPtr = hypre_CTAlloc(HYPRE_Int, num_nonowned+1, memory_location); + new_A_offd_rowPtr = hypre_CTAlloc(HYPRE_Int, num_nonowned + 1, memory_location); new_A_offd_colInd = hypre_CTAlloc(HYPRE_Int, A_offd_nnz, memory_location); new_A_offd_data = hypre_CTAlloc(HYPRE_Complex, A_offd_nnz, memory_location); A_real_real_nnz = 0; A_real_ghost_nnz = 0; - if (level != num_levels-1 && num_nonowned) + if (level != num_levels - 1 && num_nonowned) { P_diag = hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridP(compGrid[level])); P_offd = hypre_AMGDDCompGridMatrixNonOwnedOffd(hypre_AMGDDCompGridP(compGrid[level])); P_diag_nnz = hypre_CSRMatrixI(P_diag)[num_nonowned]; - new_P_diag_rowPtr = hypre_CTAlloc(HYPRE_Int, num_nonowned+1, memory_location); + new_P_diag_rowPtr = hypre_CTAlloc(HYPRE_Int, num_nonowned + 1, memory_location); new_P_diag_colInd = hypre_CTAlloc(HYPRE_Int, P_diag_nnz, memory_location); new_P_diag_data = hypre_CTAlloc(HYPRE_Complex, P_diag_nnz, memory_location); P_offd_nnz = hypre_CSRMatrixI(P_offd)[num_nonowned]; - new_P_offd_rowPtr = hypre_CTAlloc(HYPRE_Int, num_nonowned+1, memory_location); + new_P_offd_rowPtr = hypre_CTAlloc(HYPRE_Int, num_nonowned + 1, memory_location); new_P_offd_colInd = hypre_CTAlloc(HYPRE_Int, P_offd_nnz, memory_location); new_P_offd_data = hypre_CTAlloc(HYPRE_Complex, P_offd_nnz, memory_location); } if (hypre_ParAMGDataRestriction(amg_data) && level != 0 && num_nonowned) { - R_diag = hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridR(compGrid[level-1])); - R_offd = hypre_AMGDDCompGridMatrixNonOwnedOffd(hypre_AMGDDCompGridR(compGrid[level-1])); + R_diag = hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridR(compGrid[level - 1])); + R_offd = hypre_AMGDDCompGridMatrixNonOwnedOffd(hypre_AMGDDCompGridR(compGrid[level - 1])); R_diag_nnz = hypre_CSRMatrixI(R_diag)[num_nonowned]; - new_R_diag_rowPtr = hypre_CTAlloc(HYPRE_Int, num_nonowned+1, memory_location); + new_R_diag_rowPtr = hypre_CTAlloc(HYPRE_Int, num_nonowned + 1, memory_location); new_R_diag_colInd = hypre_CTAlloc(HYPRE_Int, R_diag_nnz, memory_location); new_R_diag_data = hypre_CTAlloc(HYPRE_Complex, R_diag_nnz, memory_location); R_offd_nnz = hypre_CSRMatrixI(R_offd)[num_nonowned]; - new_R_offd_rowPtr = hypre_CTAlloc(HYPRE_Int, num_nonowned+1, memory_location); + new_R_offd_rowPtr = hypre_CTAlloc(HYPRE_Int, num_nonowned + 1, memory_location); new_R_offd_colInd = hypre_CTAlloc(HYPRE_Int, R_offd_nnz, memory_location); new_R_offd_data = hypre_CTAlloc(HYPRE_Complex, R_offd_nnz, memory_location); } @@ -1089,7 +1124,7 @@ HYPRE_Int hypre_AMGDDCompGridFinalize( hypre_ParAMGDDData *amgdd_data ) if (hypre_AMGDDCompGridNonOwnedRealMarker(compGrid[level])[i]) { new_A_diag_rowPtr[node_cnt] = A_diag_cnt; - for (j = hypre_CSRMatrixI(A_diag)[i]; j < hypre_CSRMatrixI(A_diag)[i+1]; j++) + for (j = hypre_CSRMatrixI(A_diag)[i]; j < hypre_CSRMatrixI(A_diag)[i + 1]; j++) { if (hypre_CSRMatrixJ(A_diag)[j] >= 0) { @@ -1099,16 +1134,16 @@ HYPRE_Int hypre_AMGDDCompGridFinalize( hypre_ParAMGDDData *amgdd_data ) A_diag_cnt++; if (new_col_ind < num_nonowned_real_nodes) { - A_real_real_nnz++; + A_real_real_nnz++; } else { - A_real_ghost_nnz++; + A_real_ghost_nnz++; } } } new_A_offd_rowPtr[node_cnt] = A_offd_cnt; - for (j = hypre_CSRMatrixI(A_offd)[i]; j < hypre_CSRMatrixI(A_offd)[i+1]; j++) + for (j = hypre_CSRMatrixI(A_offd)[i]; j < hypre_CSRMatrixI(A_offd)[i + 1]; j++) { if (hypre_CSRMatrixJ(A_offd)[j] >= 0) { @@ -1118,10 +1153,10 @@ HYPRE_Int hypre_AMGDDCompGridFinalize( hypre_ParAMGDDData *amgdd_data ) } } - if (level != num_levels-1) + if (level != num_levels - 1) { new_P_diag_rowPtr[node_cnt] = P_diag_cnt; - for (j = hypre_CSRMatrixI(P_diag)[i]; j < hypre_CSRMatrixI(P_diag)[i+1]; j++) + for (j = hypre_CSRMatrixI(P_diag)[i]; j < hypre_CSRMatrixI(P_diag)[i + 1]; j++) { if (hypre_CSRMatrixJ(P_diag)[j] >= 0) { @@ -1131,7 +1166,7 @@ HYPRE_Int hypre_AMGDDCompGridFinalize( hypre_ParAMGDDData *amgdd_data ) } } new_P_offd_rowPtr[node_cnt] = P_offd_cnt; - for (j = hypre_CSRMatrixI(P_offd)[i]; j < hypre_CSRMatrixI(P_offd)[i+1]; j++) + for (j = hypre_CSRMatrixI(P_offd)[i]; j < hypre_CSRMatrixI(P_offd)[i + 1]; j++) { if (hypre_CSRMatrixJ(P_offd)[j] >= 0) { @@ -1144,7 +1179,7 @@ HYPRE_Int hypre_AMGDDCompGridFinalize( hypre_ParAMGDDData *amgdd_data ) if (hypre_ParAMGDataRestriction(amg_data) && level != 0) { new_R_diag_rowPtr[node_cnt] = R_diag_cnt; - for (j = hypre_CSRMatrixI(R_diag)[i]; j < hypre_CSRMatrixI(R_diag)[i+1]; j++) + for (j = hypre_CSRMatrixI(R_diag)[i]; j < hypre_CSRMatrixI(R_diag)[i + 1]; j++) { if (hypre_CSRMatrixJ(R_diag)[j] >= 0) { @@ -1154,7 +1189,7 @@ HYPRE_Int hypre_AMGDDCompGridFinalize( hypre_ParAMGDDData *amgdd_data ) } } new_R_offd_rowPtr[node_cnt] = R_offd_cnt; - for (j = hypre_CSRMatrixI(R_offd)[i]; j < hypre_CSRMatrixI(R_offd)[i+1]; j++) + for (j = hypre_CSRMatrixI(R_offd)[i]; j < hypre_CSRMatrixI(R_offd)[i + 1]; j++) { if (hypre_CSRMatrixJ(R_offd)[j] >= 0) { @@ -1173,7 +1208,7 @@ HYPRE_Int hypre_AMGDDCompGridFinalize( hypre_ParAMGDDData *amgdd_data ) if (!hypre_AMGDDCompGridNonOwnedRealMarker(compGrid[level])[i]) { new_A_diag_rowPtr[node_cnt] = A_diag_cnt; - for (j = hypre_CSRMatrixI(A_diag)[i]; j < hypre_CSRMatrixI(A_diag)[i+1]; j++) + for (j = hypre_CSRMatrixI(A_diag)[i]; j < hypre_CSRMatrixI(A_diag)[i + 1]; j++) { if (hypre_CSRMatrixJ(A_diag)[j] >= 0) { @@ -1183,7 +1218,7 @@ HYPRE_Int hypre_AMGDDCompGridFinalize( hypre_ParAMGDDData *amgdd_data ) } } new_A_offd_rowPtr[node_cnt] = A_offd_cnt; - for (j = hypre_CSRMatrixI(A_offd)[i]; j < hypre_CSRMatrixI(A_offd)[i+1]; j++) + for (j = hypre_CSRMatrixI(A_offd)[i]; j < hypre_CSRMatrixI(A_offd)[i + 1]; j++) { if (hypre_CSRMatrixJ(A_offd)[j] >= 0) { @@ -1193,10 +1228,10 @@ HYPRE_Int hypre_AMGDDCompGridFinalize( hypre_ParAMGDDData *amgdd_data ) } } - if (level != num_levels-1) + if (level != num_levels - 1) { new_P_diag_rowPtr[node_cnt] = P_diag_cnt; - for (j = hypre_CSRMatrixI(P_diag)[i]; j < hypre_CSRMatrixI(P_diag)[i+1]; j++) + for (j = hypre_CSRMatrixI(P_diag)[i]; j < hypre_CSRMatrixI(P_diag)[i + 1]; j++) { if (hypre_CSRMatrixJ(P_diag)[j] >= 0) { @@ -1206,7 +1241,7 @@ HYPRE_Int hypre_AMGDDCompGridFinalize( hypre_ParAMGDDData *amgdd_data ) } } new_P_offd_rowPtr[node_cnt] = P_offd_cnt; - for (j = hypre_CSRMatrixI(P_offd)[i]; j < hypre_CSRMatrixI(P_offd)[i+1]; j++) + for (j = hypre_CSRMatrixI(P_offd)[i]; j < hypre_CSRMatrixI(P_offd)[i + 1]; j++) { if (hypre_CSRMatrixJ(P_offd)[j] >= 0) { @@ -1219,7 +1254,7 @@ HYPRE_Int hypre_AMGDDCompGridFinalize( hypre_ParAMGDDData *amgdd_data ) if (hypre_ParAMGDataRestriction(amg_data) && level != 0) { new_R_diag_rowPtr[node_cnt] = R_diag_cnt; - for (j = hypre_CSRMatrixI(R_diag)[i]; j < hypre_CSRMatrixI(R_diag)[i+1]; j++) + for (j = hypre_CSRMatrixI(R_diag)[i]; j < hypre_CSRMatrixI(R_diag)[i + 1]; j++) { if (hypre_CSRMatrixJ(R_diag)[j] >= 0) { @@ -1229,7 +1264,7 @@ HYPRE_Int hypre_AMGDDCompGridFinalize( hypre_ParAMGDDData *amgdd_data ) } } new_R_offd_rowPtr[node_cnt] = R_offd_cnt; - for (j = hypre_CSRMatrixI(R_offd)[i]; j < hypre_CSRMatrixI(R_offd)[i+1]; j++) + for (j = hypre_CSRMatrixI(R_offd)[i]; j < hypre_CSRMatrixI(R_offd)[i + 1]; j++) { if (hypre_CSRMatrixJ(R_offd)[j] >= 0) { @@ -1246,11 +1281,13 @@ HYPRE_Int hypre_AMGDDCompGridFinalize( hypre_ParAMGDDData *amgdd_data ) new_A_offd_rowPtr[num_nonowned] = A_offd_cnt; // Create these matrices, but don't initialize (will be allocated later if necessary) - hypre_AMGDDCompGridMatrixRealReal(hypre_AMGDDCompGridA(compGrid[level])) = hypre_CSRMatrixCreate(num_nonowned_real_nodes, num_nonowned_real_nodes, A_real_real_nnz); - hypre_AMGDDCompGridMatrixRealGhost(hypre_AMGDDCompGridA(compGrid[level])) = hypre_CSRMatrixCreate(num_nonowned_real_nodes, num_nonowned, A_real_ghost_nnz); + hypre_AMGDDCompGridMatrixRealReal(hypre_AMGDDCompGridA(compGrid[level])) = hypre_CSRMatrixCreate( + num_nonowned_real_nodes, num_nonowned_real_nodes, A_real_real_nnz); + hypre_AMGDDCompGridMatrixRealGhost(hypre_AMGDDCompGridA(compGrid[level])) = hypre_CSRMatrixCreate( + num_nonowned_real_nodes, num_nonowned, A_real_ghost_nnz); - if (level != num_levels-1 && num_nonowned) + if (level != num_levels - 1 && num_nonowned) { new_P_diag_rowPtr[num_nonowned] = P_diag_cnt; new_P_offd_rowPtr[num_nonowned] = P_offd_cnt; @@ -1262,28 +1299,33 @@ HYPRE_Int hypre_AMGDDCompGridFinalize( hypre_ParAMGDDData *amgdd_data ) } // Fix up P col indices on finer level - if (level != start_level && hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[level-1])) + if (level != start_level && hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[level - 1])) { - P_diag = hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridP(compGrid[level-1])); - P_offd = hypre_AMGDDCompGridMatrixOwnedOffd(hypre_AMGDDCompGridP(compGrid[level-1])); + P_diag = hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridP(compGrid[level - 1])); + P_offd = hypre_AMGDDCompGridMatrixOwnedOffd(hypre_AMGDDCompGridP(compGrid[level - 1])); - for (i = 0; i < hypre_CSRMatrixI(P_diag)[ hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[level-1]) ]; i++) + for (i = 0; + i < hypre_CSRMatrixI(P_diag)[ hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[level - 1]) ]; + i++) { hypre_CSRMatrixJ(P_diag)[i] = new_indices[ hypre_CSRMatrixJ(P_diag)[i] ]; } // Also fix up owned offd col indices - for (i = 0; i < hypre_CSRMatrixI(P_offd)[ hypre_AMGDDCompGridNumOwnedNodes(compGrid[level-1]) ]; i++) + for (i = 0; i < hypre_CSRMatrixI(P_offd)[ hypre_AMGDDCompGridNumOwnedNodes(compGrid[level - 1]) ]; + i++) { hypre_CSRMatrixJ(P_offd)[i] = new_indices[ hypre_CSRMatrixJ(P_offd)[i] ]; } } // Fix up R col indices on this level - if (hypre_ParAMGDataRestriction(amg_data) && level != num_levels-1 && num_nonowned) + if (hypre_ParAMGDataRestriction(amg_data) && level != num_levels - 1 && num_nonowned) { R_diag = hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridR(compGrid[level])); R_offd = hypre_AMGDDCompGridMatrixOwnedOffd(hypre_AMGDDCompGridR(compGrid[level])); - for (i = 0; i < hypre_CSRMatrixI(R_diag)[ hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[level+1]) ]; i++) + for (i = 0; + i < hypre_CSRMatrixI(R_diag)[ hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[level + 1]) ]; + i++) { if (hypre_CSRMatrixJ(R_diag)[i] >= 0) { @@ -1291,7 +1333,8 @@ HYPRE_Int hypre_AMGDDCompGridFinalize( hypre_ParAMGDDData *amgdd_data ) } } // Also fix up owned offd col indices - for (i = 0; i < hypre_CSRMatrixI(R_offd)[ hypre_AMGDDCompGridNumOwnedNodes(compGrid[level+1]) ]; i++) + for (i = 0; i < hypre_CSRMatrixI(R_offd)[ hypre_AMGDDCompGridNumOwnedNodes(compGrid[level + 1]) ]; + i++) { if (hypre_CSRMatrixJ(R_offd)[i] >= 0) { @@ -1323,7 +1366,7 @@ HYPRE_Int hypre_AMGDDCompGridFinalize( hypre_ParAMGDDData *amgdd_data ) hypre_CSRMatrixNumCols(A_offd) = hypre_AMGDDCompGridNumOwnedNodes(compGrid[level]); hypre_CSRMatrixNumNonzeros(A_offd) = hypre_CSRMatrixI(A_offd)[num_nonowned]; - if (level != num_levels-1 && num_nonowned) + if (level != num_levels - 1 && num_nonowned) { P_diag = hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridP(compGrid[level])); P_offd = hypre_AMGDDCompGridMatrixNonOwnedOffd(hypre_AMGDDCompGridP(compGrid[level])); @@ -1336,7 +1379,7 @@ HYPRE_Int hypre_AMGDDCompGridFinalize( hypre_ParAMGDDData *amgdd_data ) hypre_CSRMatrixData(P_diag) = new_P_diag_data; hypre_CSRMatrixNumRows(P_diag) = num_nonowned; hypre_CSRMatrixNumRownnz(P_diag) = num_nonowned; - hypre_CSRMatrixNumCols(P_diag) = hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[level+1]); + hypre_CSRMatrixNumCols(P_diag) = hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[level + 1]); hypre_CSRMatrixNumNonzeros(P_diag) = hypre_CSRMatrixI(P_diag)[num_nonowned]; hypre_TFree(hypre_CSRMatrixI(P_offd), memory_location); @@ -1347,15 +1390,16 @@ HYPRE_Int hypre_AMGDDCompGridFinalize( hypre_ParAMGDDData *amgdd_data ) hypre_CSRMatrixData(P_offd) = new_P_offd_data; hypre_CSRMatrixNumRows(P_offd) = num_nonowned; hypre_CSRMatrixNumRownnz(P_offd) = num_nonowned; - hypre_CSRMatrixNumCols(P_offd) = hypre_AMGDDCompGridNumOwnedNodes(compGrid[level+1]); + hypre_CSRMatrixNumCols(P_offd) = hypre_AMGDDCompGridNumOwnedNodes(compGrid[level + 1]); hypre_CSRMatrixNumNonzeros(P_offd) = hypre_CSRMatrixI(P_offd)[num_nonowned]; - hypre_CSRMatrixNumCols(hypre_AMGDDCompGridMatrixOwnedOffd(hypre_AMGDDCompGridP(compGrid[level]))) = hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[level+1]); + hypre_CSRMatrixNumCols(hypre_AMGDDCompGridMatrixOwnedOffd(hypre_AMGDDCompGridP( + compGrid[level]))) = hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[level + 1]); } if (hypre_ParAMGDataRestriction(amg_data) && level != 0 && num_nonowned) { - R_diag = hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridR(compGrid[level-1])); - R_offd = hypre_AMGDDCompGridMatrixNonOwnedOffd(hypre_AMGDDCompGridR(compGrid[level-1])); + R_diag = hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridR(compGrid[level - 1])); + R_offd = hypre_AMGDDCompGridMatrixNonOwnedOffd(hypre_AMGDDCompGridR(compGrid[level - 1])); hypre_TFree(hypre_CSRMatrixI(R_diag), memory_location); hypre_TFree(hypre_CSRMatrixJ(R_diag), memory_location); @@ -1365,7 +1409,7 @@ HYPRE_Int hypre_AMGDDCompGridFinalize( hypre_ParAMGDDData *amgdd_data ) hypre_CSRMatrixData(R_diag) = new_R_diag_data; hypre_CSRMatrixNumRows(R_diag) = num_nonowned; hypre_CSRMatrixNumRownnz(R_diag) = num_nonowned; - hypre_CSRMatrixNumCols(R_diag) = hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[level-1]); + hypre_CSRMatrixNumCols(R_diag) = hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[level - 1]); hypre_CSRMatrixNumNonzeros(R_diag) = hypre_CSRMatrixI(R_diag)[num_nonowned]; hypre_TFree(hypre_CSRMatrixI(R_offd), memory_location); @@ -1376,37 +1420,45 @@ HYPRE_Int hypre_AMGDDCompGridFinalize( hypre_ParAMGDDData *amgdd_data ) hypre_CSRMatrixData(R_offd) = new_R_offd_data; hypre_CSRMatrixNumRows(R_offd) = num_nonowned; hypre_CSRMatrixNumRownnz(R_offd) = num_nonowned; - hypre_CSRMatrixNumCols(R_offd) = hypre_AMGDDCompGridNumOwnedNodes(compGrid[level-1]); + hypre_CSRMatrixNumCols(R_offd) = hypre_AMGDDCompGridNumOwnedNodes(compGrid[level - 1]); hypre_CSRMatrixNumNonzeros(R_offd) = hypre_CSRMatrixI(R_offd)[num_nonowned]; - hypre_CSRMatrixNumCols(hypre_AMGDDCompGridMatrixOwnedOffd(hypre_AMGDDCompGridR(compGrid[level-1]))) = hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[level-1]); + hypre_CSRMatrixNumCols(hypre_AMGDDCompGridMatrixOwnedOffd(hypre_AMGDDCompGridR( + compGrid[level - 1]))) = hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[level - 1]); } // Setup comp grid vectors hypre_AMGDDCompGridU(compGrid[level]) = hypre_AMGDDCompGridVectorCreate(); - hypre_AMGDDCompGridVectorOwned(hypre_AMGDDCompGridU(compGrid[level])) = hypre_ParVectorLocalVector( hypre_ParAMGDataUArray(amg_data)[level] ); + hypre_AMGDDCompGridVectorOwned(hypre_AMGDDCompGridU(compGrid[level])) = hypre_ParVectorLocalVector( + hypre_ParAMGDataUArray(amg_data)[level] ); hypre_AMGDDCompGridVectorOwnsOwnedVector(hypre_AMGDDCompGridU(compGrid[level])) = 0; hypre_AMGDDCompGridVectorNumReal(hypre_AMGDDCompGridU(compGrid[level])) = num_nonowned_real_nodes; - hypre_AMGDDCompGridVectorNonOwned(hypre_AMGDDCompGridU(compGrid[level])) = hypre_SeqVectorCreate(num_nonowned); + hypre_AMGDDCompGridVectorNonOwned(hypre_AMGDDCompGridU(compGrid[level])) = hypre_SeqVectorCreate( + num_nonowned); hypre_SeqVectorInitialize(hypre_AMGDDCompGridVectorNonOwned(hypre_AMGDDCompGridU(compGrid[level]))); hypre_AMGDDCompGridF(compGrid[level]) = hypre_AMGDDCompGridVectorCreate(); - hypre_AMGDDCompGridVectorOwned(hypre_AMGDDCompGridF(compGrid[level])) = hypre_ParVectorLocalVector( hypre_ParAMGDataFArray(amg_data)[level] ); + hypre_AMGDDCompGridVectorOwned(hypre_AMGDDCompGridF(compGrid[level])) = hypre_ParVectorLocalVector( + hypre_ParAMGDataFArray(amg_data)[level] ); hypre_AMGDDCompGridVectorOwnsOwnedVector(hypre_AMGDDCompGridF(compGrid[level])) = 0; hypre_AMGDDCompGridVectorNumReal(hypre_AMGDDCompGridF(compGrid[level])) = num_nonowned_real_nodes; - hypre_AMGDDCompGridVectorNonOwned(hypre_AMGDDCompGridF(compGrid[level])) = hypre_SeqVectorCreate(num_nonowned); + hypre_AMGDDCompGridVectorNonOwned(hypre_AMGDDCompGridF(compGrid[level])) = hypre_SeqVectorCreate( + num_nonowned); hypre_SeqVectorInitialize(hypre_AMGDDCompGridVectorNonOwned(hypre_AMGDDCompGridF(compGrid[level]))); hypre_AMGDDCompGridTemp(compGrid[level]) = hypre_AMGDDCompGridVectorCreate(); - hypre_AMGDDCompGridVectorInitialize(hypre_AMGDDCompGridTemp(compGrid[level]), num_owned, num_nonowned, num_nonowned_real_nodes); + hypre_AMGDDCompGridVectorInitialize(hypre_AMGDDCompGridTemp(compGrid[level]), num_owned, + num_nonowned, num_nonowned_real_nodes); if (level < num_levels) { hypre_AMGDDCompGridS(compGrid[level]) = hypre_AMGDDCompGridVectorCreate(); - hypre_AMGDDCompGridVectorInitialize(hypre_AMGDDCompGridS(compGrid[level]), num_owned, num_nonowned, num_nonowned_real_nodes); + hypre_AMGDDCompGridVectorInitialize(hypre_AMGDDCompGridS(compGrid[level]), num_owned, num_nonowned, + num_nonowned_real_nodes); hypre_AMGDDCompGridT(compGrid[level]) = hypre_AMGDDCompGridVectorCreate(); - hypre_AMGDDCompGridVectorInitialize(hypre_AMGDDCompGridT(compGrid[level]), num_owned, num_nonowned, num_nonowned_real_nodes); + hypre_AMGDDCompGridVectorInitialize(hypre_AMGDDCompGridT(compGrid[level]), num_owned, num_nonowned, + num_nonowned_real_nodes); } // Free up arrays we no longer need @@ -1446,7 +1498,7 @@ HYPRE_Int hypre_AMGDDCompGridFinalize( hypre_ParAMGDDData *amgdd_data ) // Setup R = P^T if R not specified if (!hypre_ParAMGDataRestriction(amg_data)) { - for (level = start_level; level < num_levels-1; level++) + for (level = start_level; level < num_levels - 1; level++) { // !!! TODO: if BoomerAMG explicitly stores R = P^T, use those matrices in hypre_AMGDDCompGridR(compGrid[level]) = hypre_AMGDDCompGridMatrixCreate(); @@ -1456,7 +1508,8 @@ HYPRE_Int hypre_AMGDDCompGridFinalize( hypre_ParAMGDDData *amgdd_data ) if (hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[level])) { - hypre_CSRMatrixTranspose(hypre_AMGDDCompGridMatrixNonOwnedOffd(hypre_AMGDDCompGridP(compGrid[level])), + hypre_CSRMatrixTranspose(hypre_AMGDDCompGridMatrixNonOwnedOffd(hypre_AMGDDCompGridP( + compGrid[level])), &hypre_AMGDDCompGridMatrixOwnedOffd(hypre_AMGDDCompGridR(compGrid[level])), 1); } @@ -1465,7 +1518,8 @@ HYPRE_Int hypre_AMGDDCompGridFinalize( hypre_ParAMGDDData *amgdd_data ) if (hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[level])) { - hypre_CSRMatrixTranspose(hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridP(compGrid[level])), + hypre_CSRMatrixTranspose(hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridP( + compGrid[level])), &hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridR(compGrid[level])), 1); } } @@ -1483,15 +1537,19 @@ HYPRE_Int hypre_AMGDDCompGridFinalize( hypre_ParAMGDDData *amgdd_data ) hypre_AMGDDCommPkgSendBufferSize(amgddCommPkg)[outer_level][new_num_send_procs] = 0; for (level = outer_level; level < num_levels; level++) { - hypre_AMGDDCommPkgSendBufferSize(amgddCommPkg)[outer_level][new_num_send_procs] += hypre_AMGDDCommPkgNumSendNodes(amgddCommPkg)[outer_level][proc][level]; + hypre_AMGDDCommPkgSendBufferSize(amgddCommPkg)[outer_level][new_num_send_procs] += + hypre_AMGDDCommPkgNumSendNodes(amgddCommPkg)[outer_level][proc][level]; } if (hypre_AMGDDCommPkgSendBufferSize(amgddCommPkg)[outer_level][new_num_send_procs]) { - hypre_AMGDDCommPkgSendProcs(amgddCommPkg)[outer_level][new_num_send_procs] = hypre_AMGDDCommPkgSendProcs(amgddCommPkg)[outer_level][proc]; + hypre_AMGDDCommPkgSendProcs(amgddCommPkg)[outer_level][new_num_send_procs] = + hypre_AMGDDCommPkgSendProcs(amgddCommPkg)[outer_level][proc]; for (level = outer_level; level < num_levels; level++) { - hypre_AMGDDCommPkgNumSendNodes(amgddCommPkg)[outer_level][new_num_send_procs][level] = hypre_AMGDDCommPkgNumSendNodes(amgddCommPkg)[outer_level][proc][level]; - hypre_AMGDDCommPkgSendFlag(amgddCommPkg)[outer_level][new_num_send_procs][level] = hypre_AMGDDCommPkgSendFlag(amgddCommPkg)[outer_level][proc][level]; + hypre_AMGDDCommPkgNumSendNodes(amgddCommPkg)[outer_level][new_num_send_procs][level] = + hypre_AMGDDCommPkgNumSendNodes(amgddCommPkg)[outer_level][proc][level]; + hypre_AMGDDCommPkgSendFlag(amgddCommPkg)[outer_level][new_num_send_procs][level] = + hypre_AMGDDCommPkgSendFlag(amgddCommPkg)[outer_level][proc][level]; } new_num_send_procs++; } @@ -1513,15 +1571,19 @@ HYPRE_Int hypre_AMGDDCompGridFinalize( hypre_ParAMGDDData *amgdd_data ) hypre_AMGDDCommPkgRecvBufferSize(amgddCommPkg)[outer_level][new_num_recv_procs] = 0; for (level = outer_level; level < num_levels; level++) { - hypre_AMGDDCommPkgRecvBufferSize(amgddCommPkg)[outer_level][new_num_recv_procs] += hypre_AMGDDCommPkgNumRecvNodes(amgddCommPkg)[outer_level][proc][level]; + hypre_AMGDDCommPkgRecvBufferSize(amgddCommPkg)[outer_level][new_num_recv_procs] += + hypre_AMGDDCommPkgNumRecvNodes(amgddCommPkg)[outer_level][proc][level]; } if (hypre_AMGDDCommPkgRecvBufferSize(amgddCommPkg)[outer_level][new_num_recv_procs]) { - hypre_AMGDDCommPkgRecvProcs(amgddCommPkg)[outer_level][new_num_recv_procs] = hypre_AMGDDCommPkgRecvProcs(amgddCommPkg)[outer_level][proc]; + hypre_AMGDDCommPkgRecvProcs(amgddCommPkg)[outer_level][new_num_recv_procs] = + hypre_AMGDDCommPkgRecvProcs(amgddCommPkg)[outer_level][proc]; for (level = outer_level; level < num_levels; level++) { - hypre_AMGDDCommPkgNumRecvNodes(amgddCommPkg)[outer_level][new_num_recv_procs][level] = hypre_AMGDDCommPkgNumRecvNodes(amgddCommPkg)[outer_level][proc][level]; - hypre_AMGDDCommPkgRecvMap(amgddCommPkg)[outer_level][new_num_recv_procs][level] = hypre_AMGDDCommPkgRecvMap(amgddCommPkg)[outer_level][proc][level]; + hypre_AMGDDCommPkgNumRecvNodes(amgddCommPkg)[outer_level][new_num_recv_procs][level] = + hypre_AMGDDCommPkgNumRecvNodes(amgddCommPkg)[outer_level][proc][level]; + hypre_AMGDDCommPkgRecvMap(amgddCommPkg)[outer_level][new_num_recv_procs][level] = + hypre_AMGDDCommPkgRecvMap(amgddCommPkg)[outer_level][proc][level]; } new_num_recv_procs++; } @@ -1552,19 +1614,28 @@ hypre_AMGDDCompGridResize( hypre_AMGDDCompGrid *compGrid, hypre_CSRMatrix *nonowned_offd; HYPRE_Int old_size = hypre_AMGDDCompGridNumNonOwnedNodes(compGrid); - hypre_AMGDDCompGridNonOwnedGlobalIndices(compGrid) = hypre_TReAlloc_v2(hypre_AMGDDCompGridNonOwnedGlobalIndices(compGrid), HYPRE_Int, old_size, HYPRE_Int, new_size, memory_location); - hypre_AMGDDCompGridNonOwnedRealMarker(compGrid) = hypre_TReAlloc_v2(hypre_AMGDDCompGridNonOwnedRealMarker(compGrid), HYPRE_Int, old_size, HYPRE_Int, new_size, memory_location); - hypre_AMGDDCompGridNonOwnedSort(compGrid) = hypre_TReAlloc_v2(hypre_AMGDDCompGridNonOwnedSort(compGrid), HYPRE_Int, old_size, HYPRE_Int, new_size, memory_location); - hypre_AMGDDCompGridNonOwnedInvSort(compGrid) = hypre_TReAlloc_v2(hypre_AMGDDCompGridNonOwnedInvSort(compGrid), HYPRE_Int, old_size, HYPRE_Int, new_size, memory_location); + hypre_AMGDDCompGridNonOwnedGlobalIndices(compGrid) = hypre_TReAlloc_v2( + hypre_AMGDDCompGridNonOwnedGlobalIndices(compGrid), HYPRE_Int, old_size, HYPRE_Int, new_size, + memory_location); + hypre_AMGDDCompGridNonOwnedRealMarker(compGrid) = hypre_TReAlloc_v2( + hypre_AMGDDCompGridNonOwnedRealMarker(compGrid), HYPRE_Int, old_size, HYPRE_Int, new_size, + memory_location); + hypre_AMGDDCompGridNonOwnedSort(compGrid) = hypre_TReAlloc_v2(hypre_AMGDDCompGridNonOwnedSort( + compGrid), HYPRE_Int, old_size, HYPRE_Int, new_size, memory_location); + hypre_AMGDDCompGridNonOwnedInvSort(compGrid) = hypre_TReAlloc_v2(hypre_AMGDDCompGridNonOwnedInvSort( + compGrid), HYPRE_Int, old_size, HYPRE_Int, new_size, memory_location); nonowned_diag = hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridA(compGrid)); nonowned_offd = hypre_AMGDDCompGridMatrixNonOwnedOffd(hypre_AMGDDCompGridA(compGrid)); hypre_CSRMatrixResize(nonowned_diag, new_size, new_size, hypre_CSRMatrixNumNonzeros(nonowned_diag)); - hypre_CSRMatrixResize(nonowned_offd, new_size, hypre_CSRMatrixNumCols(nonowned_offd), hypre_CSRMatrixNumNonzeros(nonowned_offd)); + hypre_CSRMatrixResize(nonowned_offd, new_size, hypre_CSRMatrixNumCols(nonowned_offd), + hypre_CSRMatrixNumNonzeros(nonowned_offd)); if (need_coarse_info) { - hypre_AMGDDCompGridNonOwnedCoarseIndices(compGrid) = hypre_TReAlloc_v2(hypre_AMGDDCompGridNonOwnedCoarseIndices(compGrid), HYPRE_Int, old_size, HYPRE_Int, new_size, memory_location); + hypre_AMGDDCompGridNonOwnedCoarseIndices(compGrid) = hypre_TReAlloc_v2( + hypre_AMGDDCompGridNonOwnedCoarseIndices(compGrid), HYPRE_Int, old_size, HYPRE_Int, new_size, + memory_location); } return hypre_error_flag; @@ -1588,11 +1659,11 @@ hypre_AMGDDCompGridSetupLocalIndices( hypre_AMGDDCompGrid **compGrid, hypre_CSRMatrix *nonowned_offd = hypre_AMGDDCompGridMatrixNonOwnedOffd(A); // On current_level, need to deal with A_tmp_info - HYPRE_Int row = hypre_CSRMatrixNumCols(owned_offd)+1; + HYPRE_Int row = hypre_CSRMatrixNumCols(owned_offd) + 1; HYPRE_Int diag_rowptr = hypre_CSRMatrixI(nonowned_diag)[ hypre_CSRMatrixNumCols(owned_offd) ]; HYPRE_Int offd_rowptr = hypre_CSRMatrixI(nonowned_offd)[ hypre_CSRMatrixNumCols(owned_offd) ]; - HYPRE_Int level,proc, i, j, cnt; + HYPRE_Int level, proc, i, j, cnt; HYPRE_Int global_index, local_index, coarse_index; HYPRE_Int remaining_dofs; HYPRE_Int row_size; @@ -1615,7 +1686,7 @@ hypre_AMGDDCompGridSetupLocalIndices( hypre_AMGDDCompGrid **compGrid, // Incoming is a global index (could be owned or nonowned) if (incoming_index < 0) { - incoming_index = -(incoming_index+1); + incoming_index = -(incoming_index + 1); // See whether global index is owned on this proc (if so, can directly setup appropriate local index) if ( incoming_index >= hypre_AMGDDCompGridFirstGlobalIndex(compGrid[current_level]) && incoming_index <= hypre_AMGDDCompGridLastGlobalIndex(compGrid[current_level] )) @@ -1626,9 +1697,10 @@ hypre_AMGDDCompGridSetupLocalIndices( hypre_AMGDDCompGrid **compGrid, hypre_CSRMatrixResize(nonowned_offd, hypre_CSRMatrixNumRows(nonowned_offd), hypre_CSRMatrixNumCols(nonowned_offd), - ceil(1.5*hypre_CSRMatrixNumNonzeros(nonowned_offd))); + (HYPRE_Int)hypre_ceil(1.5 * hypre_CSRMatrixNumNonzeros(nonowned_offd))); } - hypre_CSRMatrixJ(nonowned_offd)[offd_rowptr++] = incoming_index - hypre_AMGDDCompGridFirstGlobalIndex(compGrid[current_level]); + hypre_CSRMatrixJ(nonowned_offd)[offd_rowptr++] = incoming_index - + hypre_AMGDDCompGridFirstGlobalIndex(compGrid[current_level]); } else { @@ -1640,13 +1712,17 @@ hypre_AMGDDCompGridSetupLocalIndices( hypre_AMGDDCompGrid **compGrid, HYPRE_Int, hypre_CSRMatrixNumNonzeros(nonowned_diag), HYPRE_Int, - ceil(1.5*hypre_CSRMatrixNumNonzeros(nonowned_diag)), + (HYPRE_Int)hypre_ceil(1.5 * hypre_CSRMatrixNumNonzeros(nonowned_diag)), hypre_AMGDDCompGridMemoryLocation(compGrid[current_level])); - hypre_CSRMatrixResize(nonowned_diag, hypre_CSRMatrixNumRows(nonowned_diag), hypre_CSRMatrixNumCols(nonowned_diag), ceil(1.5*hypre_CSRMatrixNumNonzeros(nonowned_diag))); + hypre_CSRMatrixResize(nonowned_diag, hypre_CSRMatrixNumRows(nonowned_diag), + hypre_CSRMatrixNumCols(nonowned_diag), + (HYPRE_Int)hypre_ceil(1.5 * hypre_CSRMatrixNumNonzeros(nonowned_diag))); } // If we dof not found in comp grid, then mark this as a missing connection - hypre_AMGDDCompGridNonOwnedDiagMissingColIndices(compGrid[current_level])[ hypre_AMGDDCompGridNumMissingColIndices(compGrid[current_level])++ ] = diag_rowptr; - hypre_CSRMatrixJ(nonowned_diag)[diag_rowptr++] = -(incoming_index+1); + hypre_AMGDDCompGridNonOwnedDiagMissingColIndices( + compGrid[current_level])[ hypre_AMGDDCompGridNumMissingColIndices(compGrid[current_level])++ ] = + diag_rowptr; + hypre_CSRMatrixJ(nonowned_diag)[diag_rowptr++] = -(incoming_index + 1); } } // Incoming is an index to dofs within the buffer (by construction, nonowned) @@ -1660,20 +1736,21 @@ hypre_AMGDDCompGridSetupLocalIndices( hypre_AMGDDCompGrid **compGrid, HYPRE_Int, hypre_CSRMatrixNumNonzeros(nonowned_diag), HYPRE_Int, - ceil(1.5*hypre_CSRMatrixNumNonzeros(nonowned_diag)), + (HYPRE_Int)hypre_ceil(1.5 * hypre_CSRMatrixNumNonzeros(nonowned_diag)), hypre_AMGDDCompGridMemoryLocation(compGrid[current_level])); hypre_CSRMatrixResize(nonowned_diag, hypre_CSRMatrixNumRows(nonowned_diag), hypre_CSRMatrixNumCols(nonowned_diag), - ceil(1.5*hypre_CSRMatrixNumNonzeros(nonowned_diag))); + (HYPRE_Int)hypre_ceil(1.5 * hypre_CSRMatrixNumNonzeros(nonowned_diag))); } local_index = recv_map[current_level][proc][current_level][ incoming_index ]; if (local_index < 0) { local_index = -(local_index + 1); } - hypre_CSRMatrixJ(nonowned_diag)[diag_rowptr++] = local_index - hypre_AMGDDCompGridNumOwnedNodes(compGrid[current_level]); + hypre_CSRMatrixJ(nonowned_diag)[diag_rowptr++] = local_index - hypre_AMGDDCompGridNumOwnedNodes( + compGrid[current_level]); } } @@ -1702,20 +1779,21 @@ hypre_AMGDDCompGridSetupLocalIndices( hypre_AMGDDCompGrid **compGrid, { j = hypre_AMGDDCompGridNonOwnedDiagMissingColIndices(compGrid[level])[i]; global_index = hypre_CSRMatrixJ(nonowned_diag)[ j ]; - global_index = -(global_index+1); + global_index = -(global_index + 1); local_index = hypre_AMGDDCompGridLocalIndexBinarySearch(compGrid[level], global_index); // If we dof not found in comp grid, then mark this as a missing connection if (local_index == -1) { - local_index = -(global_index+1); - hypre_AMGDDCompGridNonOwnedDiagMissingColIndices(compGrid[level])[ hypre_AMGDDCompGridNumMissingColIndices(compGrid[level])++ ] = j; + local_index = -(global_index + 1); + hypre_AMGDDCompGridNonOwnedDiagMissingColIndices( + compGrid[level])[ hypre_AMGDDCompGridNumMissingColIndices(compGrid[level])++ ] = j; } hypre_CSRMatrixJ(nonowned_diag)[ j ] = local_index; } } // if we are not on the coarsest level - if (level != num_levels-1) + if (level != num_levels - 1) { // loop over indices of non-owned nodes on this level // No guarantee that previous ghost dofs converted to real dofs have coarse local indices setup... @@ -1730,8 +1808,8 @@ hypre_AMGDDCompGridSetupLocalIndices( hypre_AMGDDCompGrid **compGrid, // setup coarse local index if necessary if (coarse_index < -1 && is_real) { - coarse_index = -(coarse_index+2); // Map back to regular global index - local_index = hypre_AMGDDCompGridLocalIndexBinarySearch(compGrid[level+1], coarse_index); + coarse_index = -(coarse_index + 2); // Map back to regular global index + local_index = hypre_AMGDDCompGridLocalIndexBinarySearch(compGrid[level + 1], coarse_index); hypre_AMGDDCompGridNonOwnedCoarseIndices(compGrid[level])[i] = local_index; } } @@ -1754,14 +1832,16 @@ HYPRE_Int hypre_AMGDDCompGridSetupLocalIndicesP( hypre_ParAMGDDData *amgdd_data HYPRE_Int i, level; HYPRE_Int local_index; - for (level = start_level; level < num_levels-1; level++) + for (level = start_level; level < num_levels - 1; level++) { // Setup owned offd col indices owned_offd = hypre_AMGDDCompGridMatrixOwnedOffd(hypre_AMGDDCompGridP(compGrid[level])); - for (i = 0; i < hypre_CSRMatrixI(owned_offd)[hypre_AMGDDCompGridNumOwnedNodes(compGrid[level])]; i++) + for (i = 0; i < hypre_CSRMatrixI(owned_offd)[hypre_AMGDDCompGridNumOwnedNodes(compGrid[level])]; + i++) { - local_index = hypre_AMGDDCompGridLocalIndexBinarySearch(compGrid[level+1], hypre_CSRMatrixJ(owned_offd)[i]); + local_index = hypre_AMGDDCompGridLocalIndexBinarySearch(compGrid[level + 1], + hypre_CSRMatrixJ(owned_offd)[i]); if (local_index == -1) { hypre_CSRMatrixJ(owned_offd)[i] = -(hypre_CSRMatrixJ(owned_offd)[i] + 1); @@ -1775,30 +1855,34 @@ HYPRE_Int hypre_AMGDDCompGridSetupLocalIndicesP( hypre_ParAMGDDData *amgdd_data // Setup nonowned diag col indices nonowned_diag = hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridP(compGrid[level])); - for (i = 0; i < hypre_CSRMatrixI(nonowned_diag)[hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[level])]; i++) + for (i = 0; + i < hypre_CSRMatrixI(nonowned_diag)[hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[level])]; i++) { - local_index = hypre_AMGDDCompGridLocalIndexBinarySearch(compGrid[level+1], hypre_CSRMatrixJ(nonowned_diag)[i]); + local_index = hypre_AMGDDCompGridLocalIndexBinarySearch(compGrid[level + 1], + hypre_CSRMatrixJ(nonowned_diag)[i]); if (local_index == -1) { hypre_CSRMatrixJ(nonowned_diag)[i] = -(hypre_CSRMatrixJ(nonowned_diag)[i] + 1); } else { - hypre_CSRMatrixJ(nonowned_diag)[i] = local_index; + hypre_CSRMatrixJ(nonowned_diag)[i] = local_index; } } } if (hypre_ParAMGDataRestriction(amg_data)) { - for (level = start_level; level < num_levels-1; level++) + for (level = start_level; level < num_levels - 1; level++) { // Setup owned offd col indices owned_offd = hypre_AMGDDCompGridMatrixOwnedOffd(hypre_AMGDDCompGridR(compGrid[level])); - for (i = 0; i < hypre_CSRMatrixI(owned_offd)[hypre_AMGDDCompGridNumOwnedNodes(compGrid[level+1])]; i++) + for (i = 0; i < hypre_CSRMatrixI(owned_offd)[hypre_AMGDDCompGridNumOwnedNodes(compGrid[level + 1])]; + i++) { - local_index = hypre_AMGDDCompGridLocalIndexBinarySearch(compGrid[level], hypre_CSRMatrixJ(owned_offd)[i]); + local_index = hypre_AMGDDCompGridLocalIndexBinarySearch(compGrid[level], + hypre_CSRMatrixJ(owned_offd)[i]); if (local_index == -1) { hypre_CSRMatrixJ(owned_offd)[i] = -(hypre_CSRMatrixJ(owned_offd)[i] + 1); @@ -1812,9 +1896,11 @@ HYPRE_Int hypre_AMGDDCompGridSetupLocalIndicesP( hypre_ParAMGDDData *amgdd_data // Setup nonowned diag col indices nonowned_diag = hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridR(compGrid[level])); - for (i = 0; i < hypre_CSRMatrixI(nonowned_diag)[hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[level+1])]; i++) + for (i = 0; + i < hypre_CSRMatrixI(nonowned_diag)[hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[level + 1])]; i++) { - local_index = hypre_AMGDDCompGridLocalIndexBinarySearch(compGrid[level], hypre_CSRMatrixJ(nonowned_diag)[i]); + local_index = hypre_AMGDDCompGridLocalIndexBinarySearch(compGrid[level], + hypre_CSRMatrixJ(nonowned_diag)[i]); if (local_index == -1) { hypre_CSRMatrixJ(nonowned_diag)[i] = -(hypre_CSRMatrixJ(nonowned_diag)[i] + 1); @@ -1838,17 +1924,28 @@ hypre_AMGDDCommPkg* hypre_AMGDDCommPkgCreate(HYPRE_Int num_levels) hypre_AMGDDCommPkgNumLevels(amgddCommPkg) = num_levels; - hypre_AMGDDCommPkgNumSendProcs(amgddCommPkg) = hypre_CTAlloc(HYPRE_Int, num_levels, HYPRE_MEMORY_HOST); - hypre_AMGDDCommPkgNumRecvProcs(amgddCommPkg) = hypre_CTAlloc(HYPRE_Int, num_levels, HYPRE_MEMORY_HOST); - hypre_AMGDDCommPkgSendProcs(amgddCommPkg) = hypre_CTAlloc(HYPRE_Int *, num_levels, HYPRE_MEMORY_HOST); - hypre_AMGDDCommPkgRecvProcs(amgddCommPkg) = hypre_CTAlloc(HYPRE_Int *, num_levels, HYPRE_MEMORY_HOST); - hypre_AMGDDCommPkgSendBufferSize(amgddCommPkg) = hypre_CTAlloc(HYPRE_Int *, num_levels, HYPRE_MEMORY_HOST); - hypre_AMGDDCommPkgRecvBufferSize(amgddCommPkg) = hypre_CTAlloc(HYPRE_Int *, num_levels, HYPRE_MEMORY_HOST); - hypre_AMGDDCommPkgNumSendNodes(amgddCommPkg) = hypre_CTAlloc(HYPRE_Int **, num_levels, HYPRE_MEMORY_HOST); - hypre_AMGDDCommPkgNumRecvNodes(amgddCommPkg) = hypre_CTAlloc(HYPRE_Int **, num_levels, HYPRE_MEMORY_HOST); - hypre_AMGDDCommPkgSendFlag(amgddCommPkg) = hypre_CTAlloc(HYPRE_Int ***, num_levels, HYPRE_MEMORY_HOST); - hypre_AMGDDCommPkgRecvMap(amgddCommPkg) = hypre_CTAlloc(HYPRE_Int ***, num_levels, HYPRE_MEMORY_HOST); - hypre_AMGDDCommPkgRecvRedMarker(amgddCommPkg) = hypre_CTAlloc(HYPRE_Int ***, num_levels, HYPRE_MEMORY_HOST); + hypre_AMGDDCommPkgNumSendProcs(amgddCommPkg) = hypre_CTAlloc(HYPRE_Int, num_levels, + HYPRE_MEMORY_HOST); + hypre_AMGDDCommPkgNumRecvProcs(amgddCommPkg) = hypre_CTAlloc(HYPRE_Int, num_levels, + HYPRE_MEMORY_HOST); + hypre_AMGDDCommPkgSendProcs(amgddCommPkg) = hypre_CTAlloc(HYPRE_Int *, num_levels, + HYPRE_MEMORY_HOST); + hypre_AMGDDCommPkgRecvProcs(amgddCommPkg) = hypre_CTAlloc(HYPRE_Int *, num_levels, + HYPRE_MEMORY_HOST); + hypre_AMGDDCommPkgSendBufferSize(amgddCommPkg) = hypre_CTAlloc(HYPRE_Int *, num_levels, + HYPRE_MEMORY_HOST); + hypre_AMGDDCommPkgRecvBufferSize(amgddCommPkg) = hypre_CTAlloc(HYPRE_Int *, num_levels, + HYPRE_MEMORY_HOST); + hypre_AMGDDCommPkgNumSendNodes(amgddCommPkg) = hypre_CTAlloc(HYPRE_Int **, num_levels, + HYPRE_MEMORY_HOST); + hypre_AMGDDCommPkgNumRecvNodes(amgddCommPkg) = hypre_CTAlloc(HYPRE_Int **, num_levels, + HYPRE_MEMORY_HOST); + hypre_AMGDDCommPkgSendFlag(amgddCommPkg) = hypre_CTAlloc(HYPRE_Int ***, num_levels, + HYPRE_MEMORY_HOST); + hypre_AMGDDCommPkgRecvMap(amgddCommPkg) = hypre_CTAlloc(HYPRE_Int ***, num_levels, + HYPRE_MEMORY_HOST); + hypre_AMGDDCommPkgRecvRedMarker(amgddCommPkg) = hypre_CTAlloc(HYPRE_Int ***, num_levels, + HYPRE_MEMORY_HOST); return amgddCommPkg; } diff --git a/external/hypre/src/parcsr_ls/par_amgdd_comp_grid.h b/external/hypre/src/parcsr_ls/par_amgdd_comp_grid.h index 81d9c4df..29898cb1 100644 --- a/external/hypre/src/parcsr_ls/par_amgdd_comp_grid.h +++ b/external/hypre/src/parcsr_ls/par_amgdd_comp_grid.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -29,7 +29,8 @@ typedef struct HYPRE_Int ***num_recv_nodes; // number of nodes to recv on each composite level HYPRE_Int ****send_flag; // flags which nodes to send after composite grid is built - HYPRE_Int ****recv_map; // mapping from recv buffer to appropriate local indices on each comp grid + HYPRE_Int + ****recv_map; // mapping from recv buffer to appropriate local indices on each comp grid HYPRE_Int ****recv_red_marker; // marker indicating a redundant recv } hypre_AMGDDCommPkg; @@ -59,7 +60,8 @@ typedef struct { hypre_CSRMatrix *owned_diag; // Domain: owned domain of mat. Range: owned range of mat. hypre_CSRMatrix *owned_offd; // Domain: nonowned domain of mat. Range: owned range of mat. - hypre_CSRMatrix *nonowned_diag; // Domain: nonowned domain of mat. Range: nonowned range of mat. + hypre_CSRMatrix + *nonowned_diag; // Domain: nonowned domain of mat. Range: nonowned range of mat. hypre_CSRMatrix *nonowned_offd; // Domain: owned domain of mat. Range: nonowned range of mat. hypre_CSRMatrix *real_real; // Domain: nonowned real. Range: nonowned real. @@ -115,8 +117,8 @@ typedef struct HYPRE_Int level; HYPRE_MemoryLocation memory_location; /* memory location of matrices/vectors */ - HYPRE_Int first_global_index; - HYPRE_Int last_global_index; + HYPRE_BigInt first_global_index; + HYPRE_BigInt last_global_index; HYPRE_Int num_owned_nodes; HYPRE_Int num_nonowned_nodes; HYPRE_Int num_nonowned_real_nodes; diff --git a/external/hypre/src/parcsr_ls/par_amgdd_fac_cycle.c b/external/hypre/src/parcsr_ls/par_amgdd_fac_cycle.c index 4c34477b..a1c3d6f5 100644 --- a/external/hypre/src/parcsr_ls/par_amgdd_fac_cycle.c +++ b/external/hypre/src/parcsr_ls/par_amgdd_fac_cycle.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -24,7 +24,8 @@ hypre_BoomerAMGDD_FAC( void *amgdd_vdata, HYPRE_Int first_iteration ) } else { - hypre_error_w_msg(HYPRE_ERROR_GENERIC, "WARNING: unknown AMG-DD FAC cycle type. Defaulting to 1 (V-cycle).\n"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "WARNING: unknown AMG-DD FAC cycle type. Defaulting to 1 (V-cycle).\n"); hypre_ParAMGDDDataFACCycleType(amgdd_data) = 1; hypre_BoomerAMGDD_FAC_Cycle(amgdd_vdata, start_level, 1, first_iteration); } @@ -51,23 +52,23 @@ hypre_BoomerAMGDD_FAC_Cycle( void *amgdd_vdata, // Restrict the residual at all fine points (real and ghost) and set residual at coarse points not under the fine grid if (num_levels > 1) { - hypre_BoomerAMGDD_FAC_Restrict(compGrid[level], compGrid[level+1], first_iteration); + hypre_BoomerAMGDD_FAC_Restrict(compGrid[level], compGrid[level + 1], first_iteration); hypre_AMGDDCompGridVectorSetConstantValues(hypre_AMGDDCompGridS(compGrid[level]), 0.0); hypre_AMGDDCompGridVectorSetConstantValues(hypre_AMGDDCompGridT(compGrid[level]), 0.0); // Either solve on the coarse level or recurse - if (level+1 == num_levels-1) + if (level + 1 == num_levels - 1) { - hypre_BoomerAMGDD_FAC_Relax(amgdd_vdata, num_levels-1, 3); + hypre_BoomerAMGDD_FAC_Relax(amgdd_vdata, num_levels - 1, 3); } else for (i = 0; i < cycle_type; i++) - { - hypre_BoomerAMGDD_FAC_Cycle(amgdd_vdata, level+1, cycle_type, first_iteration); - first_iteration = 0; - } + { + hypre_BoomerAMGDD_FAC_Cycle(amgdd_vdata, level + 1, cycle_type, first_iteration); + first_iteration = 0; + } // Interpolate up and relax - hypre_BoomerAMGDD_FAC_Interpolate(compGrid[level], compGrid[level+1]); + hypre_BoomerAMGDD_FAC_Interpolate(compGrid[level], compGrid[level + 1]); } hypre_BoomerAMGDD_FAC_Relax(amgdd_vdata, level, 2); @@ -76,8 +77,8 @@ hypre_BoomerAMGDD_FAC_Cycle( void *amgdd_vdata, } HYPRE_Int - hypre_BoomerAMGDD_FAC_FCycle( void *amgdd_vdata, - HYPRE_Int first_iteration ) +hypre_BoomerAMGDD_FAC_FCycle( void *amgdd_vdata, + HYPRE_Int first_iteration ) { hypre_ParAMGDDData *amgdd_data = (hypre_ParAMGDDData*) amgdd_vdata; hypre_ParAMGData *amg_data = hypre_ParAMGDDDataAMG(amgdd_data); @@ -91,20 +92,20 @@ HYPRE_Int { for (level = hypre_ParAMGDDDataStartLevel(amgdd_data); level < num_levels - 1; level++) { - hypre_BoomerAMGDD_FAC_Restrict(compGrid[level], compGrid[level+1], 0); + hypre_BoomerAMGDD_FAC_Restrict(compGrid[level], compGrid[level + 1], 0); hypre_AMGDDCompGridVectorSetConstantValues(hypre_AMGDDCompGridS(compGrid[level]), 0.0); hypre_AMGDDCompGridVectorSetConstantValues(hypre_AMGDDCompGridT(compGrid[level]), 0.0); } } // ... solve on coarsest level ... - hypre_BoomerAMGDD_FAC_Relax(amgdd_vdata, num_levels-1, 3); + hypre_BoomerAMGDD_FAC_Relax(amgdd_vdata, num_levels - 1, 3); // ... and work back up to the finest for (level = num_levels - 2; level > -1; level--) { // Interpolate up and relax - hypre_BoomerAMGDD_FAC_Interpolate(compGrid[level], compGrid[level+1]); + hypre_BoomerAMGDD_FAC_Interpolate(compGrid[level], compGrid[level + 1]); // V-cycle hypre_BoomerAMGDD_FAC_Cycle(amgdd_vdata, level, 1, 0); @@ -118,7 +119,7 @@ hypre_BoomerAMGDD_FAC_Interpolate( hypre_AMGDDCompGrid *compGrid_f, hypre_AMGDDCompGrid *compGrid_c ) { hypre_AMGDDCompGridMatvec(1.0, hypre_AMGDDCompGridP(compGrid_f), - hypre_AMGDDCompGridU(compGrid_c), + hypre_AMGDDCompGridU(compGrid_c), 1.0, hypre_AMGDDCompGridU(compGrid_f)); return hypre_error_flag; } @@ -132,31 +133,32 @@ hypre_BoomerAMGDD_FAC_Restrict( hypre_AMGDDCompGrid *compGrid_f, if (!first_iteration) { hypre_AMGDDCompGridMatvec(-1.0, hypre_AMGDDCompGridA(compGrid_c), - hypre_AMGDDCompGridU(compGrid_c), - 1.0, hypre_AMGDDCompGridF(compGrid_c)); + hypre_AMGDDCompGridU(compGrid_c), + 1.0, hypre_AMGDDCompGridF(compGrid_c)); } // Get update: s_l <- A_lt_l + s_l hypre_AMGDDCompGridMatvec(1.0, hypre_AMGDDCompGridA(compGrid_f), - hypre_AMGDDCompGridT(compGrid_f), + hypre_AMGDDCompGridT(compGrid_f), 1.0, hypre_AMGDDCompGridS(compGrid_f)); // If we need to preserve the updates on the next level if (hypre_AMGDDCompGridS(compGrid_c)) { hypre_AMGDDCompGridMatvec(1.0, hypre_AMGDDCompGridR(compGrid_f), - hypre_AMGDDCompGridS(compGrid_f), + hypre_AMGDDCompGridS(compGrid_f), 0.0, hypre_AMGDDCompGridS(compGrid_c)); // Subtract restricted update from recalculated residual: f_{l+1} <- f_{l+1} - s_{l+1} - hypre_AMGDDCompGridVectorAxpy(-1.0, hypre_AMGDDCompGridS(compGrid_c), hypre_AMGDDCompGridF(compGrid_c)); + hypre_AMGDDCompGridVectorAxpy(-1.0, hypre_AMGDDCompGridS(compGrid_c), + hypre_AMGDDCompGridF(compGrid_c)); } else { // Restrict and subtract update from recalculated residual: f_{l+1} <- f_{l+1} - P_l^Ts_l hypre_AMGDDCompGridMatvec(-1.0, hypre_AMGDDCompGridR(compGrid_f), - hypre_AMGDDCompGridS(compGrid_f), - 1.0, hypre_AMGDDCompGridF(compGrid_c)); + hypre_AMGDDCompGridS(compGrid_f), + 1.0, hypre_AMGDDCompGridF(compGrid_c)); } // Zero out initial guess on coarse grid @@ -215,7 +217,9 @@ hypre_BoomerAMGDD_FAC_Jacobi( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ) { -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + HYPRE_UNUSED_VAR(cycle_param); + +#if defined(HYPRE_USING_GPU) hypre_ParAMGDDData *amgdd_data = (hypre_ParAMGDDData*) amgdd_vdata; hypre_AMGDDCompGrid *compGrid = hypre_ParAMGDDDataCompGrid(amgdd_data)[level]; HYPRE_MemoryLocation memory_location = hypre_AMGDDCompGridMemoryLocation(compGrid); @@ -262,9 +266,9 @@ hypre_BoomerAMGDD_FAC_JacobiHost( void *amgdd_vdata, diag = hypre_AMGDDCompGridMatrixOwnedDiag(A); for (i = 0; i < hypre_AMGDDCompGridNumOwnedNodes(compGrid); i++) { - for (j = hypre_CSRMatrixI(diag)[i]; j < hypre_CSRMatrixI(diag)[i+1]; j++) + for (j = hypre_CSRMatrixI(diag)[i]; j < hypre_CSRMatrixI(diag)[i + 1]; j++) { - // hypre_AMGDDCompGridL1Norms(compGrid)[i] += fabs(hypre_CSRMatrixData(diag)[j]); + // hypre_AMGDDCompGridL1Norms(compGrid)[i] += hypre_abs(hypre_CSRMatrixData(diag)[j]); if (hypre_CSRMatrixJ(diag)[j] == i) { hypre_AMGDDCompGridL1Norms(compGrid)[i] = hypre_CSRMatrixData(diag)[j]; @@ -275,12 +279,13 @@ hypre_BoomerAMGDD_FAC_JacobiHost( void *amgdd_vdata, diag = hypre_AMGDDCompGridMatrixNonOwnedDiag(A); for (i = 0; i < hypre_AMGDDCompGridNumNonOwnedRealNodes(compGrid); i++) { - for (j = hypre_CSRMatrixI(diag)[i]; j < hypre_CSRMatrixI(diag)[i+1]; j++) + for (j = hypre_CSRMatrixI(diag)[i]; j < hypre_CSRMatrixI(diag)[i + 1]; j++) { - // hypre_AMGDDCompGridL1Norms(compGrid)[i + hypre_AMGDDCompGridNumOwnedNodes(compGrid)] += fabs(hypre_CSRMatrixData(diag)[j]); + // hypre_AMGDDCompGridL1Norms(compGrid)[i + hypre_AMGDDCompGridNumOwnedNodes(compGrid)] += hypre_abs(hypre_CSRMatrixData(diag)[j]); if (hypre_CSRMatrixJ(diag)[j] == i) { - hypre_AMGDDCompGridL1Norms(compGrid)[i + hypre_AMGDDCompGridNumOwnedNodes(compGrid)] = hypre_CSRMatrixData(diag)[j]; + hypre_AMGDDCompGridL1Norms(compGrid)[i + hypre_AMGDDCompGridNumOwnedNodes( + compGrid)] = hypre_CSRMatrixData(diag)[j]; } } } @@ -321,6 +326,8 @@ hypre_BoomerAMGDD_FAC_GaussSeidel( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ) { + HYPRE_UNUSED_VAR(cycle_param); + hypre_ParAMGDDData *amgdd_data = (hypre_ParAMGDDData*) amgdd_vdata; hypre_AMGDDCompGrid *compGrid = hypre_ParAMGDDDataCompGrid(amgdd_data)[level]; @@ -348,7 +355,7 @@ hypre_BoomerAMGDD_FAC_GaussSeidel( void *amgdd_vdata, diagonal = 0.0; // Loop over diag entries - for (j = hypre_CSRMatrixI(owned_diag)[i]; j < hypre_CSRMatrixI(owned_diag)[i+1]; j++) + for (j = hypre_CSRMatrixI(owned_diag)[i]; j < hypre_CSRMatrixI(owned_diag)[i + 1]; j++) { if (hypre_CSRMatrixJ(owned_diag)[j] == i) { @@ -356,20 +363,23 @@ hypre_BoomerAMGDD_FAC_GaussSeidel( void *amgdd_vdata, } else { - u_owned_data[i] -= hypre_CSRMatrixData(owned_diag)[j] * u_owned_data[ hypre_CSRMatrixJ(owned_diag)[j] ]; + u_owned_data[i] -= hypre_CSRMatrixData(owned_diag)[j] * u_owned_data[ hypre_CSRMatrixJ( + owned_diag)[j] ]; } } // Loop over offd entries - for (j = hypre_CSRMatrixI(owned_offd)[i]; j < hypre_CSRMatrixI(owned_offd)[i+1]; j++) + for (j = hypre_CSRMatrixI(owned_offd)[i]; j < hypre_CSRMatrixI(owned_offd)[i + 1]; j++) { - u_owned_data[i] -= hypre_CSRMatrixData(owned_offd)[j] * u_nonowned_data[ hypre_CSRMatrixJ(owned_offd)[j] ]; + u_owned_data[i] -= hypre_CSRMatrixData(owned_offd)[j] * u_nonowned_data[ hypre_CSRMatrixJ( + owned_offd)[j] ]; } // Divide by diagonal if (diagonal == 0.0) { - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"WARNING: Divide by zero diagonal in hypre_BoomerAMGDD_FAC_GaussSeidel().\n"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "WARNING: Divide by zero diagonal in hypre_BoomerAMGDD_FAC_GaussSeidel().\n"); } u_owned_data[i] /= diagonal; } @@ -382,7 +392,7 @@ hypre_BoomerAMGDD_FAC_GaussSeidel( void *amgdd_vdata, diagonal = 0.0; // Loop over diag entries - for (j = hypre_CSRMatrixI(nonowned_diag)[i]; j < hypre_CSRMatrixI(nonowned_diag)[i+1]; j++) + for (j = hypre_CSRMatrixI(nonowned_diag)[i]; j < hypre_CSRMatrixI(nonowned_diag)[i + 1]; j++) { if (hypre_CSRMatrixJ(nonowned_diag)[j] == i) { @@ -390,20 +400,23 @@ hypre_BoomerAMGDD_FAC_GaussSeidel( void *amgdd_vdata, } else { - u_nonowned_data[i] -= hypre_CSRMatrixData(nonowned_diag)[j] * u_nonowned_data[ hypre_CSRMatrixJ(nonowned_diag)[j] ]; + u_nonowned_data[i] -= hypre_CSRMatrixData(nonowned_diag)[j] * u_nonowned_data[ hypre_CSRMatrixJ( + nonowned_diag)[j] ]; } } // Loop over offd entries - for (j = hypre_CSRMatrixI(nonowned_offd)[i]; j < hypre_CSRMatrixI(nonowned_offd)[i+1]; j++) + for (j = hypre_CSRMatrixI(nonowned_offd)[i]; j < hypre_CSRMatrixI(nonowned_offd)[i + 1]; j++) { - u_nonowned_data[i] -= hypre_CSRMatrixData(nonowned_offd)[j] * u_owned_data[ hypre_CSRMatrixJ(nonowned_offd)[j] ]; + u_nonowned_data[i] -= hypre_CSRMatrixData(nonowned_offd)[j] * u_owned_data[ hypre_CSRMatrixJ( + nonowned_offd)[j] ]; } // Divide by diagonal if (diagonal == 0.0) { - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"WARNING: Divide by zero diagonal in hypre_BoomerAMGDD_FAC_GaussSeidel().\n"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "WARNING: Divide by zero diagonal in hypre_BoomerAMGDD_FAC_GaussSeidel().\n"); } u_nonowned_data[i] /= diagonal; } @@ -416,6 +429,8 @@ hypre_BoomerAMGDD_FAC_OrderedGaussSeidel( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ) { + HYPRE_UNUSED_VAR(cycle_param); + hypre_ParAMGDDData *amgdd_data = (hypre_ParAMGDDData*) amgdd_vdata; hypre_AMGDDCompGrid *compGrid = hypre_ParAMGDDDataCompGrid(amgdd_data)[level]; @@ -431,7 +446,8 @@ hypre_BoomerAMGDD_FAC_OrderedGaussSeidel( void *amgdd_vdata, hypre_AMGDDCompGridOwnedRelaxOrdering(compGrid) = hypre_CTAlloc(HYPRE_Int, hypre_AMGDDCompGridNumOwnedNodes(compGrid), hypre_AMGDDCompGridMemoryLocation(compGrid)); - hypre_topo_sort(hypre_CSRMatrixI(hypre_AMGDDCompGridMatrixOwnedDiag(hypre_AMGDDCompGridA(compGrid))), + hypre_topo_sort(hypre_CSRMatrixI(hypre_AMGDDCompGridMatrixOwnedDiag(hypre_AMGDDCompGridA( + compGrid))), hypre_CSRMatrixJ(hypre_AMGDDCompGridMatrixOwnedDiag(hypre_AMGDDCompGridA(compGrid))), hypre_CSRMatrixData(hypre_AMGDDCompGridMatrixOwnedDiag(hypre_AMGDDCompGridA(compGrid))), hypre_AMGDDCompGridOwnedRelaxOrdering(compGrid), @@ -443,7 +459,8 @@ hypre_BoomerAMGDD_FAC_OrderedGaussSeidel( void *amgdd_vdata, hypre_AMGDDCompGridNonOwnedRelaxOrdering(compGrid) = hypre_CTAlloc(HYPRE_Int, hypre_AMGDDCompGridNumNonOwnedNodes(compGrid), hypre_AMGDDCompGridMemoryLocation(compGrid)); - hypre_topo_sort(hypre_CSRMatrixI(hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridA(compGrid))), + hypre_topo_sort(hypre_CSRMatrixI(hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridA( + compGrid))), hypre_CSRMatrixJ(hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridA(compGrid))), hypre_CSRMatrixData(hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridA(compGrid))), hypre_AMGDDCompGridNonOwnedRelaxOrdering(compGrid), @@ -461,7 +478,8 @@ hypre_BoomerAMGDD_FAC_OrderedGaussSeidel( void *amgdd_vdata, hypre_CSRMatrix *nonowned_offd = hypre_AMGDDCompGridMatrixNonOwnedOffd(A); // Do Gauss-Seidel relaxation on the nonowned real nodes - for (unordered_i = 0; unordered_i < hypre_AMGDDCompGridNumNonOwnedRealNodes(compGrid); unordered_i++) + for (unordered_i = 0; unordered_i < hypre_AMGDDCompGridNumNonOwnedRealNodes(compGrid); + unordered_i++) { i = hypre_AMGDDCompGridNonOwnedRelaxOrdering(compGrid)[unordered_i]; @@ -470,7 +488,7 @@ hypre_BoomerAMGDD_FAC_OrderedGaussSeidel( void *amgdd_vdata, diagonal = 0.0; // Loop over diag entries - for (j = hypre_CSRMatrixI(nonowned_diag)[i]; j < hypre_CSRMatrixI(nonowned_diag)[i+1]; j++) + for (j = hypre_CSRMatrixI(nonowned_diag)[i]; j < hypre_CSRMatrixI(nonowned_diag)[i + 1]; j++) { if (hypre_CSRMatrixJ(nonowned_diag)[j] == i) { @@ -478,20 +496,23 @@ hypre_BoomerAMGDD_FAC_OrderedGaussSeidel( void *amgdd_vdata, } else { - u_nonowned_data[i] -= hypre_CSRMatrixData(nonowned_diag)[j] * u_nonowned_data[ hypre_CSRMatrixJ(nonowned_diag)[j] ]; + u_nonowned_data[i] -= hypre_CSRMatrixData(nonowned_diag)[j] * u_nonowned_data[ hypre_CSRMatrixJ( + nonowned_diag)[j] ]; } } // Loop over offd entries - for (j = hypre_CSRMatrixI(nonowned_offd)[i]; j < hypre_CSRMatrixI(nonowned_offd)[i+1]; j++) + for (j = hypre_CSRMatrixI(nonowned_offd)[i]; j < hypre_CSRMatrixI(nonowned_offd)[i + 1]; j++) { - u_nonowned_data[i] -= hypre_CSRMatrixData(nonowned_offd)[j] * u_owned_data[ hypre_CSRMatrixJ(nonowned_offd)[j] ]; + u_nonowned_data[i] -= hypre_CSRMatrixData(nonowned_offd)[j] * u_owned_data[ hypre_CSRMatrixJ( + nonowned_offd)[j] ]; } // Divide by diagonal if (diagonal == 0.0) { - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"WARNING: Divide by zero diagonal in hypre_BoomerAMGDD_FAC_OrderedGaussSeidel().\n"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "WARNING: Divide by zero diagonal in hypre_BoomerAMGDD_FAC_OrderedGaussSeidel().\n"); } u_nonowned_data[i] /= diagonal; } @@ -506,7 +527,7 @@ hypre_BoomerAMGDD_FAC_OrderedGaussSeidel( void *amgdd_vdata, diagonal = 0.0; // Loop over diag entries - for (j = hypre_CSRMatrixI(owned_diag)[i]; j < hypre_CSRMatrixI(owned_diag)[i+1]; j++) + for (j = hypre_CSRMatrixI(owned_diag)[i]; j < hypre_CSRMatrixI(owned_diag)[i + 1]; j++) { if (hypre_CSRMatrixJ(owned_diag)[j] == i) { @@ -514,20 +535,23 @@ hypre_BoomerAMGDD_FAC_OrderedGaussSeidel( void *amgdd_vdata, } else { - u_owned_data[i] -= hypre_CSRMatrixData(owned_diag)[j] * u_owned_data[ hypre_CSRMatrixJ(owned_diag)[j] ]; + u_owned_data[i] -= hypre_CSRMatrixData(owned_diag)[j] * u_owned_data[ hypre_CSRMatrixJ( + owned_diag)[j] ]; } } // Loop over offd entries - for (j = hypre_CSRMatrixI(owned_offd)[i]; j < hypre_CSRMatrixI(owned_offd)[i+1]; j++) + for (j = hypre_CSRMatrixI(owned_offd)[i]; j < hypre_CSRMatrixI(owned_offd)[i + 1]; j++) { - u_owned_data[i] -= hypre_CSRMatrixData(owned_offd)[j] * u_nonowned_data[ hypre_CSRMatrixJ(owned_offd)[j] ]; + u_owned_data[i] -= hypre_CSRMatrixData(owned_offd)[j] * u_nonowned_data[ hypre_CSRMatrixJ( + owned_offd)[j] ]; } // Divide by diagonal if (diagonal == 0.0) { - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"WARNING: Divide by zero diagonal in hypre_BoomerAMGDD_FAC_OrderedGaussSeidel().\n"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "WARNING: Divide by zero diagonal in hypre_BoomerAMGDD_FAC_OrderedGaussSeidel().\n"); } u_owned_data[i] /= diagonal; } @@ -540,7 +564,7 @@ hypre_BoomerAMGDD_FAC_CFL1Jacobi( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ) { -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) hypre_ParAMGDDData *amgdd_data = (hypre_ParAMGDDData*) amgdd_vdata; hypre_AMGDDCompGrid *compGrid = hypre_ParAMGDDDataCompGrid(amgdd_data)[level]; HYPRE_MemoryLocation memory_location = hypre_AMGDDCompGridMemoryLocation(compGrid); @@ -595,15 +619,23 @@ hypre_BoomerAMGDD_FAC_CFL1JacobiHost( void *amgdd_vdata, hypre_AMGDDCompGrid *compGrid = hypre_ParAMGDDDataCompGrid(amgdd_data)[level]; HYPRE_Real relax_weight = hypre_ParAMGDDDataFACRelaxWeight(amgdd_data); - hypre_CSRMatrix *owned_diag = hypre_AMGDDCompGridMatrixOwnedDiag(hypre_AMGDDCompGridA(compGrid)); - hypre_CSRMatrix *owned_offd = hypre_AMGDDCompGridMatrixOwnedOffd(hypre_AMGDDCompGridA(compGrid)); - hypre_CSRMatrix *nonowned_diag = hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridA(compGrid)); - hypre_CSRMatrix *nonowned_offd = hypre_AMGDDCompGridMatrixNonOwnedOffd(hypre_AMGDDCompGridA(compGrid)); - - HYPRE_Complex *owned_u = hypre_VectorData(hypre_AMGDDCompGridVectorOwned(hypre_AMGDDCompGridU(compGrid))); - HYPRE_Complex *nonowned_u = hypre_VectorData(hypre_AMGDDCompGridVectorNonOwned(hypre_AMGDDCompGridU(compGrid))); - HYPRE_Complex *owned_f = hypre_VectorData(hypre_AMGDDCompGridVectorOwned(hypre_AMGDDCompGridF(compGrid))); - HYPRE_Complex *nonowned_f = hypre_VectorData(hypre_AMGDDCompGridVectorNonOwned(hypre_AMGDDCompGridF(compGrid))); + hypre_CSRMatrix *owned_diag = hypre_AMGDDCompGridMatrixOwnedDiag(hypre_AMGDDCompGridA( + compGrid)); + hypre_CSRMatrix *owned_offd = hypre_AMGDDCompGridMatrixOwnedOffd(hypre_AMGDDCompGridA( + compGrid)); + hypre_CSRMatrix *nonowned_diag = hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridA( + compGrid)); + hypre_CSRMatrix *nonowned_offd = hypre_AMGDDCompGridMatrixNonOwnedOffd(hypre_AMGDDCompGridA( + compGrid)); + + HYPRE_Complex *owned_u = hypre_VectorData(hypre_AMGDDCompGridVectorOwned( + hypre_AMGDDCompGridU(compGrid))); + HYPRE_Complex *nonowned_u = hypre_VectorData(hypre_AMGDDCompGridVectorNonOwned( + hypre_AMGDDCompGridU(compGrid))); + HYPRE_Complex *owned_f = hypre_VectorData(hypre_AMGDDCompGridVectorOwned( + hypre_AMGDDCompGridF(compGrid))); + HYPRE_Complex *nonowned_f = hypre_VectorData(hypre_AMGDDCompGridVectorNonOwned( + hypre_AMGDDCompGridF(compGrid))); HYPRE_Real *l1_norms = hypre_AMGDDCompGridL1Norms(compGrid); HYPRE_Int *cf_marker = hypre_AMGDDCompGridCFMarkerArray(compGrid); @@ -614,9 +646,9 @@ hypre_BoomerAMGDD_FAC_CFL1JacobiHost( void *amgdd_vdata, HYPRE_Int i, j; HYPRE_Real res; - /*----------------------------------------------------------------- - * Create and initialize Temp2 vector if not done before. - *-----------------------------------------------------------------*/ + /*----------------------------------------------------------------- + * Create and initialize Temp2 vector if not done before. + *-----------------------------------------------------------------*/ if (!hypre_AMGDDCompGridTemp2(compGrid)) { @@ -627,14 +659,15 @@ hypre_BoomerAMGDD_FAC_CFL1JacobiHost( void *amgdd_vdata, hypre_AMGDDCompGridNumNonOwnedRealNodes(compGrid)); } owned_tmp = hypre_VectorData(hypre_AMGDDCompGridVectorOwned(hypre_AMGDDCompGridTemp2(compGrid))); - nonowned_tmp = hypre_VectorData(hypre_AMGDDCompGridVectorNonOwned(hypre_AMGDDCompGridTemp2(compGrid))); + nonowned_tmp = hypre_VectorData(hypre_AMGDDCompGridVectorNonOwned(hypre_AMGDDCompGridTemp2( + compGrid))); - /*----------------------------------------------------------------- - * Copy current approximation into temporary vector. - *-----------------------------------------------------------------*/ + /*----------------------------------------------------------------- + * Copy current approximation into temporary vector. + *-----------------------------------------------------------------*/ #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < hypre_AMGDDCompGridNumOwnedNodes(compGrid); i++) { @@ -642,7 +675,7 @@ hypre_BoomerAMGDD_FAC_CFL1JacobiHost( void *amgdd_vdata, } #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < hypre_AMGDDCompGridNumNonOwnedNodes(compGrid); i++) { @@ -654,22 +687,22 @@ hypre_BoomerAMGDD_FAC_CFL1JacobiHost( void *amgdd_vdata, *-----------------------------------------------------------------*/ #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,j,res) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,j,res) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < hypre_AMGDDCompGridNumOwnedNodes(compGrid); i++) { if (cf_marker[i] == relax_set) { res = owned_f[i]; - for (j = hypre_CSRMatrixI(owned_diag)[i]; j < hypre_CSRMatrixI(owned_diag)[i+1]; j++) + for (j = hypre_CSRMatrixI(owned_diag)[i]; j < hypre_CSRMatrixI(owned_diag)[i + 1]; j++) { res -= hypre_CSRMatrixData(owned_diag)[j] * owned_tmp[ hypre_CSRMatrixJ(owned_diag)[j] ]; } - for (j = hypre_CSRMatrixI(owned_offd)[i]; j < hypre_CSRMatrixI(owned_offd)[i+1]; j++) + for (j = hypre_CSRMatrixI(owned_offd)[i]; j < hypre_CSRMatrixI(owned_offd)[i + 1]; j++) { res -= hypre_CSRMatrixData(owned_offd)[j] * nonowned_tmp[ hypre_CSRMatrixJ(owned_offd)[j] ]; } - owned_u[i] += (relax_weight * res)/l1_norms[i]; + owned_u[i] += (relax_weight * res) / l1_norms[i]; } } for (i = 0; i < hypre_AMGDDCompGridNumNonOwnedRealNodes(compGrid); i++) @@ -677,15 +710,15 @@ hypre_BoomerAMGDD_FAC_CFL1JacobiHost( void *amgdd_vdata, if (cf_marker[i + hypre_AMGDDCompGridNumOwnedNodes(compGrid)] == relax_set) { res = nonowned_f[i]; - for (j = hypre_CSRMatrixI(nonowned_diag)[i]; j < hypre_CSRMatrixI(nonowned_diag)[i+1]; j++) + for (j = hypre_CSRMatrixI(nonowned_diag)[i]; j < hypre_CSRMatrixI(nonowned_diag)[i + 1]; j++) { res -= hypre_CSRMatrixData(nonowned_diag)[j] * nonowned_tmp[ hypre_CSRMatrixJ(nonowned_diag)[j] ]; } - for (j = hypre_CSRMatrixI(nonowned_offd)[i]; j < hypre_CSRMatrixI(nonowned_offd)[i+1]; j++) + for (j = hypre_CSRMatrixI(nonowned_offd)[i]; j < hypre_CSRMatrixI(nonowned_offd)[i + 1]; j++) { res -= hypre_CSRMatrixData(nonowned_offd)[j] * owned_tmp[ hypre_CSRMatrixJ(nonowned_offd)[j] ]; } - nonowned_u[i] += (relax_weight * res)/l1_norms[i + hypre_AMGDDCompGridNumOwnedNodes(compGrid)]; + nonowned_u[i] += (relax_weight * res) / l1_norms[i + hypre_AMGDDCompGridNumOwnedNodes(compGrid)]; } } diff --git a/external/hypre/src/parcsr_ls/par_amgdd_fac_cycle_device.c b/external/hypre/src/parcsr_ls/par_amgdd_fac_cycle_device.c index 1217720e..58f352eb 100644 --- a/external/hypre/src/parcsr_ls/par_amgdd_fac_cycle_device.c +++ b/external/hypre/src/parcsr_ls/par_amgdd_fac_cycle_device.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -8,7 +8,7 @@ #include "_hypre_parcsr_ls.h" #include "_hypre_utilities.hpp" -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) HYPRE_Int hypre_BoomerAMGDD_FAC_JacobiDevice( void *amgdd_vdata, @@ -39,9 +39,9 @@ hypre_BoomerAMGDD_FAC_JacobiDevice( void *amgdd_vdata, for (i = 0; i < hypre_AMGDDCompGridNumOwnedNodes(compGrid); i++) { - for (j = hypre_CSRMatrixI(diag)[i]; j < hypre_CSRMatrixI(diag)[i+1]; j++) + for (j = hypre_CSRMatrixI(diag)[i]; j < hypre_CSRMatrixI(diag)[i + 1]; j++) { - // hypre_AMGDDCompGridL1Norms(compGrid)[i] += fabs(hypre_CSRMatrixData(diag)[j]); + // hypre_AMGDDCompGridL1Norms(compGrid)[i] += hypre_abs(hypre_CSRMatrixData(diag)[j]); if (hypre_CSRMatrixJ(diag)[j] == i) { hypre_AMGDDCompGridL1Norms(compGrid)[i] = hypre_CSRMatrixData(diag)[j]; @@ -52,12 +52,13 @@ hypre_BoomerAMGDD_FAC_JacobiDevice( void *amgdd_vdata, diag = hypre_AMGDDCompGridMatrixNonOwnedDiag(A); for (i = 0; i < hypre_AMGDDCompGridNumNonOwnedRealNodes(compGrid); i++) { - for (j = hypre_CSRMatrixI(diag)[i]; j < hypre_CSRMatrixI(diag)[i+1]; j++) + for (j = hypre_CSRMatrixI(diag)[i]; j < hypre_CSRMatrixI(diag)[i + 1]; j++) { - // hypre_AMGDDCompGridL1Norms(compGrid)[i + hypre_AMGDDCompGridNumOwnedNodes(compGrid)] += fabs(hypre_CSRMatrixData(diag)[j]); + // hypre_AMGDDCompGridL1Norms(compGrid)[i + hypre_AMGDDCompGridNumOwnedNodes(compGrid)] += hypre_abs(hypre_CSRMatrixData(diag)[j]); if (hypre_CSRMatrixJ(diag)[j] == i) { - hypre_AMGDDCompGridL1Norms(compGrid)[i + hypre_AMGDDCompGridNumOwnedNodes(compGrid)] = hypre_CSRMatrixData(diag)[j]; + hypre_AMGDDCompGridL1Norms(compGrid)[i + hypre_AMGDDCompGridNumOwnedNodes( + compGrid)] = hypre_CSRMatrixData(diag)[j]; } } } @@ -98,8 +99,10 @@ hypre_BoomerAMGDD_FAC_CFL1JacobiDevice( void *amgdd_vdata, hypre_ParAMGDDData *amgdd_data = (hypre_ParAMGDDData*) amgdd_vdata; hypre_AMGDDCompGrid *compGrid = hypre_ParAMGDDDataCompGrid(amgdd_data)[level]; HYPRE_Real relax_weight = hypre_ParAMGDDDataFACRelaxWeight(amgdd_data); - hypre_Vector *owned_u = hypre_AMGDDCompGridVectorOwned(hypre_AMGDDCompGridU(compGrid)); - hypre_Vector *nonowned_u = hypre_AMGDDCompGridVectorNonOwned(hypre_AMGDDCompGridU(compGrid)); + hypre_Vector *owned_u = hypre_AMGDDCompGridVectorOwned(hypre_AMGDDCompGridU( + compGrid)); + hypre_Vector *nonowned_u = hypre_AMGDDCompGridVectorNonOwned(hypre_AMGDDCompGridU( + compGrid)); HYPRE_Int num_owned = hypre_AMGDDCompGridNumOwnedNodes(compGrid); HYPRE_Int num_nonowned = hypre_AMGDDCompGridNumNonOwnedNodes(compGrid); HYPRE_Int num_nonowned_r = hypre_AMGDDCompGridNumNonOwnedRealNodes(compGrid); @@ -146,4 +149,4 @@ hypre_BoomerAMGDD_FAC_CFL1JacobiDevice( void *amgdd_vdata, return hypre_error_flag; } -#endif // defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#endif // defined(HYPRE_USING_GPU) diff --git a/external/hypre/src/parcsr_ls/par_amgdd_helpers.c b/external/hypre/src/parcsr_ls/par_amgdd_helpers.c index 75b71ffa..26645f35 100644 --- a/external/hypre/src/parcsr_ls/par_amgdd_helpers.c +++ b/external/hypre/src/parcsr_ls/par_amgdd_helpers.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -20,7 +20,8 @@ hypre_BoomerAMGDD_LocalToGlobalIndex( hypre_AMGDDCompGrid *compGrid, { local_index = -(local_index + 1); } - else if (local_index >= hypre_AMGDDCompGridNumOwnedNodes(compGrid) + hypre_AMGDDCompGridNumNonOwnedNodes(compGrid)) + else if (local_index >= hypre_AMGDDCompGridNumOwnedNodes(compGrid) + + hypre_AMGDDCompGridNumNonOwnedNodes(compGrid)) { local_index -= hypre_AMGDDCompGridNumOwnedNodes(compGrid) + hypre_AMGDDCompGridNumNonOwnedNodes(compGrid); @@ -32,7 +33,8 @@ hypre_BoomerAMGDD_LocalToGlobalIndex( hypre_AMGDDCompGrid *compGrid, } else { - return hypre_AMGDDCompGridNonOwnedGlobalIndices(compGrid)[local_index - hypre_AMGDDCompGridNumOwnedNodes(compGrid)]; + return hypre_AMGDDCompGridNonOwnedGlobalIndices(compGrid)[local_index - + hypre_AMGDDCompGridNumOwnedNodes(compGrid)]; } } @@ -46,8 +48,8 @@ hypre_BoomerAMGDD_GetDofRecvProc( HYPRE_Int neighbor_local_index, HYPRE_Int i; for (i = 0; i < hypre_ParCSRCommPkgNumRecvs(commPkg); i++) { - if (neighbor_local_index >= hypre_ParCSRCommPkgRecvVecStart(commPkg,i) && - neighbor_local_index < hypre_ParCSRCommPkgRecvVecStart(commPkg,i+1)) + if (neighbor_local_index >= hypre_ParCSRCommPkgRecvVecStart(commPkg, i) && + neighbor_local_index < hypre_ParCSRCommPkgRecvVecStart(commPkg, i + 1)) { /* recv_proc = hypre_ParCSRCommPkgRecvProc(commPkg,i); */ recv_proc = i; @@ -72,7 +74,7 @@ hypre_BoomerAMGDD_RecursivelyFindNeighborNodes( HYPRE_Int dof_index, HYPRE_Int i; // Look at diag neighbors - for (i = hypre_CSRMatrixI(diag)[dof_index]; i < hypre_CSRMatrixI(diag)[dof_index+1]; i++) + for (i = hypre_CSRMatrixI(diag)[dof_index]; i < hypre_CSRMatrixI(diag)[dof_index + 1]; i++) { // Get the index of the neighbor neighbor_index = hypre_CSRMatrixJ(diag)[i]; @@ -86,13 +88,14 @@ hypre_BoomerAMGDD_RecursivelyFindNeighborNodes( HYPRE_Int dof_index, add_flag[neighbor_index] = distance; if (distance - 1 > 0) { - hypre_BoomerAMGDD_RecursivelyFindNeighborNodes(neighbor_index, distance-1, A, add_flag, add_flag_requests); + hypre_BoomerAMGDD_RecursivelyFindNeighborNodes(neighbor_index, distance - 1, A, add_flag, + add_flag_requests); } } } // Look at offd neighbors - for (i = hypre_CSRMatrixI(offd)[dof_index]; i < hypre_CSRMatrixI(offd)[dof_index+1]; i++) + for (i = hypre_CSRMatrixI(offd)[dof_index]; i < hypre_CSRMatrixI(offd)[dof_index + 1]; i++) { neighbor_index = hypre_CSRMatrixJ(offd)[i]; @@ -130,7 +133,8 @@ hypre_BoomerAMGDD_AddToSendAndRequestDofs( hypre_ParCSRMatrix *A, { if (add_flag[i]) { - idx = hypre_UnorderedIntMapGet(send_dof_maps[send_proc], i); // Recall: key = local owned dof idx, data = idx into sendflag array + idx = hypre_UnorderedIntMapGet(send_dof_maps[send_proc], + i); // Recall: key = local owned dof idx, data = idx into sendflag array if (idx == -1) { idx = hypre_AMGDDCommPkgNumSendNodes(compGridCommPkg)[level][send_proc][level]++; @@ -138,9 +142,11 @@ hypre_BoomerAMGDD_AddToSendAndRequestDofs( hypre_ParCSRMatrix *A, if (idx == send_dof_capacities[send_proc]) { send_dof_capacities[send_proc] *= 2; - hypre_AMGDDCommPkgSendFlag(compGridCommPkg)[level][send_proc][level] = hypre_TReAlloc(hypre_AMGDDCommPkgSendFlag(compGridCommPkg)[level][send_proc][level], - HYPRE_Int, send_dof_capacities[send_proc], HYPRE_MEMORY_HOST); - distances[send_proc] = hypre_TReAlloc(distances[send_proc], HYPRE_Int, send_dof_capacities[send_proc], HYPRE_MEMORY_HOST); + hypre_AMGDDCommPkgSendFlag(compGridCommPkg)[level][send_proc][level] = hypre_TReAlloc( + hypre_AMGDDCommPkgSendFlag(compGridCommPkg)[level][send_proc][level], + HYPRE_Int, send_dof_capacities[send_proc], HYPRE_MEMORY_HOST); + distances[send_proc] = hypre_TReAlloc(distances[send_proc], HYPRE_Int, + send_dof_capacities[send_proc], HYPRE_MEMORY_HOST); } hypre_AMGDDCommPkgSendFlag(compGridCommPkg)[level][send_proc][level][idx] = i; distances[send_proc][idx] = add_flag[i]; @@ -163,7 +169,8 @@ hypre_BoomerAMGDD_AddToSendAndRequestDofs( hypre_ParCSRMatrix *A, if (add_flag_requests[i]) { recv_proc = hypre_BoomerAMGDD_GetDofRecvProc(i, A); - if (hypre_AMGDDCommPkgRecvProcs(compGridCommPkg)[level][recv_proc] != hypre_AMGDDCommPkgSendProcs(compGridCommPkg)[level][send_proc]) + if (hypre_AMGDDCommPkgRecvProcs(compGridCommPkg)[level][recv_proc] != hypre_AMGDDCommPkgSendProcs( + compGridCommPkg)[level][send_proc]) { num_req_dofs[recv_proc][send_proc]++; } @@ -175,13 +182,16 @@ hypre_BoomerAMGDD_AddToSendAndRequestDofs( hypre_ParCSRMatrix *A, { if (req_dofs[i][send_proc]) { - req_dofs[i][send_proc] = hypre_TReAlloc(req_dofs[i][send_proc], HYPRE_Int, num_req_dofs[i][send_proc], HYPRE_MEMORY_HOST); - req_dof_dist[i][send_proc] = hypre_TReAlloc(req_dof_dist[i][send_proc], HYPRE_Int, num_req_dofs[i][send_proc], HYPRE_MEMORY_HOST); + req_dofs[i][send_proc] = hypre_TReAlloc(req_dofs[i][send_proc], HYPRE_Int, + num_req_dofs[i][send_proc], HYPRE_MEMORY_HOST); + req_dof_dist[i][send_proc] = hypre_TReAlloc(req_dof_dist[i][send_proc], HYPRE_Int, + num_req_dofs[i][send_proc], HYPRE_MEMORY_HOST); } else { req_dofs[i][send_proc] = hypre_CTAlloc(HYPRE_Int, num_req_dofs[i][send_proc], HYPRE_MEMORY_HOST); - req_dof_dist[i][send_proc] = hypre_CTAlloc(HYPRE_Int, num_req_dofs[i][send_proc], HYPRE_MEMORY_HOST); + req_dof_dist[i][send_proc] = hypre_CTAlloc(HYPRE_Int, num_req_dofs[i][send_proc], + HYPRE_MEMORY_HOST); } } } @@ -192,7 +202,8 @@ hypre_BoomerAMGDD_AddToSendAndRequestDofs( hypre_ParCSRMatrix *A, { neighbor_global_index = hypre_ParCSRMatrixColMapOffd(A)[i]; recv_proc = hypre_BoomerAMGDD_GetDofRecvProc(i, A); - if (hypre_AMGDDCommPkgRecvProcs(compGridCommPkg)[level][recv_proc] != hypre_AMGDDCommPkgSendProcs(compGridCommPkg)[level][send_proc]) + if (hypre_AMGDDCommPkgRecvProcs(compGridCommPkg)[level][recv_proc] != hypre_AMGDDCommPkgSendProcs( + compGridCommPkg)[level][send_proc]) { req_dofs[recv_proc][send_proc][ req_cnt[recv_proc] ] = neighbor_global_index; req_dof_dist[recv_proc][send_proc][ req_cnt[recv_proc] ] = add_flag_requests[i]; @@ -239,13 +250,17 @@ hypre_BoomerAMGDD_FindNeighborProcessors( hypre_ParCSRMatrix *A, HYPRE_Int ***req_dof_dist = hypre_CTAlloc(HYPRE_Int**, csr_num_recvs, HYPRE_MEMORY_HOST); for (i = 0; i < csr_num_recvs; i++) { - num_req_dofs[i] = hypre_CTAlloc(HYPRE_Int, hypre_AMGDDCommPkgNumSendProcs(compGridCommPkg)[level], HYPRE_MEMORY_HOST); - req_dofs[i] = hypre_CTAlloc(HYPRE_Int*, hypre_AMGDDCommPkgNumSendProcs(compGridCommPkg)[level], HYPRE_MEMORY_HOST); - req_dof_dist[i] = hypre_CTAlloc(HYPRE_Int*, hypre_AMGDDCommPkgNumSendProcs(compGridCommPkg)[level], HYPRE_MEMORY_HOST); + num_req_dofs[i] = hypre_CTAlloc(HYPRE_Int, hypre_AMGDDCommPkgNumSendProcs(compGridCommPkg)[level], + HYPRE_MEMORY_HOST); + req_dofs[i] = hypre_CTAlloc(HYPRE_Int*, hypre_AMGDDCommPkgNumSendProcs(compGridCommPkg)[level], + HYPRE_MEMORY_HOST); + req_dof_dist[i] = hypre_CTAlloc(HYPRE_Int*, hypre_AMGDDCommPkgNumSendProcs(compGridCommPkg)[level], + HYPRE_MEMORY_HOST); } HYPRE_Int *add_flag = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRMatrixNumRows(A), HYPRE_MEMORY_HOST); - HYPRE_Int *add_flag_requests = hypre_CTAlloc(HYPRE_Int, hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(A)), HYPRE_MEMORY_HOST); + HYPRE_Int *add_flag_requests = hypre_CTAlloc(HYPRE_Int, + hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(A)), HYPRE_MEMORY_HOST); // Recursively search through the operator stencil to find longer distance neighboring dofs // Loop over longdistance send procs @@ -265,17 +280,19 @@ hypre_BoomerAMGDD_FindNeighborProcessors( hypre_ParCSRMatrix *A, { HYPRE_Int idx = starting_dofs[i][j]; HYPRE_Int send_dof = hypre_AMGDDCommPkgSendFlag(compGridCommPkg)[level][i][level][idx]; - hypre_BoomerAMGDD_RecursivelyFindNeighborNodes(send_dof, distances[i][idx]-1, A, add_flag, add_flag_requests); + hypre_BoomerAMGDD_RecursivelyFindNeighborNodes(send_dof, distances[i][idx] - 1, A, add_flag, + add_flag_requests); } num_starting_dofs[i] = 0; hypre_TFree(starting_dofs[i], HYPRE_MEMORY_HOST); starting_dofs[i] = NULL; // Update the send flag and request dofs hypre_BoomerAMGDD_AddToSendAndRequestDofs(A, add_flag, add_flag_requests, level, i, compGridCommPkg, - distances, send_dof_maps, send_dof_capacities, csr_num_recvs, num_req_dofs, req_dofs, req_dof_dist); + distances, send_dof_maps, send_dof_capacities, csr_num_recvs, num_req_dofs, req_dofs, req_dof_dist); // Reset add flags hypre_Memset(add_flag, 0, sizeof(HYPRE_Int)*hypre_ParCSRMatrixNumRows(A), HYPRE_MEMORY_HOST); - hypre_Memset(add_flag_requests, 0, sizeof(HYPRE_Int)*hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(A)), HYPRE_MEMORY_HOST); + hypre_Memset(add_flag_requests, 0, + sizeof(HYPRE_Int)*hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(A)), HYPRE_MEMORY_HOST); } } hypre_TFree(add_flag, HYPRE_MEMORY_HOST); @@ -288,16 +305,24 @@ hypre_BoomerAMGDD_FindNeighborProcessors( hypre_ParCSRMatrix *A, ////////////////////////////////////////////////// // Get the sizes - hypre_MPI_Request *requests = hypre_CTAlloc(hypre_MPI_Request, hypre_AMGDDCommPkgNumSendProcs(compGridCommPkg)[level] + hypre_AMGDDCommPkgNumRecvProcs(compGridCommPkg)[level], HYPRE_MEMORY_HOST); - hypre_MPI_Status *statuses = hypre_CTAlloc(hypre_MPI_Status, hypre_AMGDDCommPkgNumSendProcs(compGridCommPkg)[level] + hypre_AMGDDCommPkgNumRecvProcs(compGridCommPkg)[level], HYPRE_MEMORY_HOST); + hypre_MPI_Request *requests = hypre_CTAlloc(hypre_MPI_Request, + hypre_AMGDDCommPkgNumSendProcs(compGridCommPkg)[level] + hypre_AMGDDCommPkgNumRecvProcs( + compGridCommPkg)[level], HYPRE_MEMORY_HOST); + hypre_MPI_Status *statuses = hypre_CTAlloc(hypre_MPI_Status, + hypre_AMGDDCommPkgNumSendProcs(compGridCommPkg)[level] + hypre_AMGDDCommPkgNumRecvProcs( + compGridCommPkg)[level], HYPRE_MEMORY_HOST); HYPRE_Int request_cnt = 0; - HYPRE_Int *recv_sizes = hypre_CTAlloc(HYPRE_Int, hypre_AMGDDCommPkgNumRecvProcs(compGridCommPkg)[level], HYPRE_MEMORY_HOST); + HYPRE_Int *recv_sizes = hypre_CTAlloc(HYPRE_Int, + hypre_AMGDDCommPkgNumRecvProcs(compGridCommPkg)[level], HYPRE_MEMORY_HOST); for (i = 0; i < hypre_AMGDDCommPkgNumRecvProcs(compGridCommPkg)[level]; i++) { - hypre_MPI_Irecv(&(recv_sizes[i]), 1, HYPRE_MPI_INT, hypre_AMGDDCommPkgRecvProcs(compGridCommPkg)[level][i], 6, hypre_MPI_COMM_WORLD, &(requests[request_cnt++])); + hypre_MPI_Irecv(&(recv_sizes[i]), 1, HYPRE_MPI_INT, + hypre_AMGDDCommPkgRecvProcs(compGridCommPkg)[level][i], 6, hypre_MPI_COMM_WORLD, + &(requests[request_cnt++])); } - HYPRE_Int *send_sizes = hypre_CTAlloc(HYPRE_Int, hypre_AMGDDCommPkgNumSendProcs(compGridCommPkg)[level], HYPRE_MEMORY_HOST); + HYPRE_Int *send_sizes = hypre_CTAlloc(HYPRE_Int, + hypre_AMGDDCommPkgNumSendProcs(compGridCommPkg)[level], HYPRE_MEMORY_HOST); for (i = 0; i < hypre_AMGDDCommPkgNumSendProcs(compGridCommPkg)[level]; i++) { for (j = 0; j < csr_num_recvs; j++) @@ -307,26 +332,37 @@ hypre_BoomerAMGDD_FindNeighborProcessors( hypre_ParCSRMatrix *A, send_sizes[i]++; } } - hypre_MPI_Isend(&(send_sizes[i]), 1, HYPRE_MPI_INT, hypre_AMGDDCommPkgSendProcs(compGridCommPkg)[level][i], 6, hypre_MPI_COMM_WORLD, &(requests[request_cnt++])); + hypre_MPI_Isend(&(send_sizes[i]), 1, HYPRE_MPI_INT, + hypre_AMGDDCommPkgSendProcs(compGridCommPkg)[level][i], 6, hypre_MPI_COMM_WORLD, + &(requests[request_cnt++])); } // Wait - hypre_MPI_Waitall(hypre_AMGDDCommPkgNumSendProcs(compGridCommPkg)[level] + hypre_AMGDDCommPkgNumRecvProcs(compGridCommPkg)[level], requests, statuses); + hypre_MPI_Waitall(hypre_AMGDDCommPkgNumSendProcs(compGridCommPkg)[level] + + hypre_AMGDDCommPkgNumRecvProcs(compGridCommPkg)[level], requests, statuses); hypre_TFree(requests, HYPRE_MEMORY_HOST); hypre_TFree(statuses, HYPRE_MEMORY_HOST); - requests = hypre_CTAlloc(hypre_MPI_Request, hypre_AMGDDCommPkgNumSendProcs(compGridCommPkg)[level] + hypre_AMGDDCommPkgNumRecvProcs(compGridCommPkg)[level], HYPRE_MEMORY_HOST); - statuses = hypre_CTAlloc(hypre_MPI_Status, hypre_AMGDDCommPkgNumSendProcs(compGridCommPkg)[level] + hypre_AMGDDCommPkgNumRecvProcs(compGridCommPkg)[level], HYPRE_MEMORY_HOST); + requests = hypre_CTAlloc(hypre_MPI_Request, + hypre_AMGDDCommPkgNumSendProcs(compGridCommPkg)[level] + hypre_AMGDDCommPkgNumRecvProcs( + compGridCommPkg)[level], HYPRE_MEMORY_HOST); + statuses = hypre_CTAlloc(hypre_MPI_Status, + hypre_AMGDDCommPkgNumSendProcs(compGridCommPkg)[level] + hypre_AMGDDCommPkgNumRecvProcs( + compGridCommPkg)[level], HYPRE_MEMORY_HOST); request_cnt = 0; // Allocate and post the recvs - HYPRE_Int **recv_buffers = hypre_CTAlloc(HYPRE_Int*, hypre_AMGDDCommPkgNumRecvProcs(compGridCommPkg)[level], HYPRE_MEMORY_HOST); + HYPRE_Int **recv_buffers = hypre_CTAlloc(HYPRE_Int*, + hypre_AMGDDCommPkgNumRecvProcs(compGridCommPkg)[level], HYPRE_MEMORY_HOST); for (i = 0; i < hypre_AMGDDCommPkgNumRecvProcs(compGridCommPkg)[level]; i++) { recv_buffers[i] = hypre_CTAlloc(HYPRE_Int, recv_sizes[i], HYPRE_MEMORY_HOST); - hypre_MPI_Irecv(recv_buffers[i], recv_sizes[i], HYPRE_MPI_INT, hypre_AMGDDCommPkgRecvProcs(compGridCommPkg)[level][i], 7, hypre_MPI_COMM_WORLD, &(requests[request_cnt++])); + hypre_MPI_Irecv(recv_buffers[i], recv_sizes[i], HYPRE_MPI_INT, + hypre_AMGDDCommPkgRecvProcs(compGridCommPkg)[level][i], 7, hypre_MPI_COMM_WORLD, + &(requests[request_cnt++])); } // Setup and send the send buffers - HYPRE_Int **send_buffers = hypre_CTAlloc(HYPRE_Int*, hypre_AMGDDCommPkgNumSendProcs(compGridCommPkg)[level], HYPRE_MEMORY_HOST); + HYPRE_Int **send_buffers = hypre_CTAlloc(HYPRE_Int*, + hypre_AMGDDCommPkgNumSendProcs(compGridCommPkg)[level], HYPRE_MEMORY_HOST); for (i = 0; i < hypre_AMGDDCommPkgNumSendProcs(compGridCommPkg)[level]; i++) { send_buffers[i] = hypre_CTAlloc(HYPRE_Int, send_sizes[i], HYPRE_MEMORY_HOST); @@ -339,11 +375,14 @@ hypre_BoomerAMGDD_FindNeighborProcessors( hypre_ParCSRMatrix *A, } } - hypre_MPI_Isend(send_buffers[i], send_sizes[i], HYPRE_MPI_INT, hypre_AMGDDCommPkgSendProcs(compGridCommPkg)[level][i], 7, hypre_MPI_COMM_WORLD, &(requests[request_cnt++])); + hypre_MPI_Isend(send_buffers[i], send_sizes[i], HYPRE_MPI_INT, + hypre_AMGDDCommPkgSendProcs(compGridCommPkg)[level][i], 7, hypre_MPI_COMM_WORLD, + &(requests[request_cnt++])); } // Wait - hypre_MPI_Waitall(hypre_AMGDDCommPkgNumSendProcs(compGridCommPkg)[level] + hypre_AMGDDCommPkgNumRecvProcs(compGridCommPkg)[level], requests, statuses); + hypre_MPI_Waitall(hypre_AMGDDCommPkgNumSendProcs(compGridCommPkg)[level] + + hypre_AMGDDCommPkgNumRecvProcs(compGridCommPkg)[level], requests, statuses); hypre_TFree(requests, HYPRE_MEMORY_HOST); hypre_TFree(statuses, HYPRE_MEMORY_HOST); @@ -370,9 +409,11 @@ hypre_BoomerAMGDD_FindNeighborProcessors( hypre_ParCSRMatrix *A, if (hypre_AMGDDCommPkgNumRecvProcs(compGridCommPkg)[level] == recv_proc_capacity) { recv_proc_capacity *= 2; - hypre_AMGDDCommPkgRecvProcs(compGridCommPkg)[level] = hypre_TReAlloc(hypre_AMGDDCommPkgRecvProcs(compGridCommPkg)[level], HYPRE_Int, recv_proc_capacity, HYPRE_MEMORY_HOST); + hypre_AMGDDCommPkgRecvProcs(compGridCommPkg)[level] = hypre_TReAlloc(hypre_AMGDDCommPkgRecvProcs( + compGridCommPkg)[level], HYPRE_Int, recv_proc_capacity, HYPRE_MEMORY_HOST); } - hypre_AMGDDCommPkgRecvProcs(compGridCommPkg)[level][ hypre_AMGDDCommPkgNumRecvProcs(compGridCommPkg)[level]++ ] = recv_buffers[i][j]; + hypre_AMGDDCommPkgRecvProcs(compGridCommPkg)[level][ hypre_AMGDDCommPkgNumRecvProcs( + compGridCommPkg)[level]++ ] = recv_buffers[i][j]; } } } @@ -407,7 +448,8 @@ hypre_BoomerAMGDD_FindNeighborProcessors( hypre_ParCSRMatrix *A, request_cnt = 0; for (i = 0; i < csr_num_sends; i++) { - hypre_MPI_Irecv(&(recv_sizes[i]), 1, HYPRE_MPI_INT, hypre_ParCSRCommPkgSendProc(commPkg,i), 4, hypre_MPI_COMM_WORLD, &(requests[request_cnt++])); + hypre_MPI_Irecv(&(recv_sizes[i]), 1, HYPRE_MPI_INT, hypre_ParCSRCommPkgSendProc(commPkg, i), 4, + hypre_MPI_COMM_WORLD, &(requests[request_cnt++])); } for (i = 0; i < csr_num_recvs; i++) { @@ -416,10 +458,11 @@ hypre_BoomerAMGDD_FindNeighborProcessors( hypre_ParCSRMatrix *A, { if (num_req_dofs[i][j]) { - send_sizes[i] += 2 + 2*num_req_dofs[i][j]; + send_sizes[i] += 2 + 2 * num_req_dofs[i][j]; } } - hypre_MPI_Isend(&(send_sizes[i]), 1, HYPRE_MPI_INT, hypre_ParCSRCommPkgRecvProc(commPkg,i), 4, hypre_MPI_COMM_WORLD, &(requests[request_cnt++])); + hypre_MPI_Isend(&(send_sizes[i]), 1, HYPRE_MPI_INT, hypre_ParCSRCommPkgRecvProc(commPkg, i), 4, + hypre_MPI_COMM_WORLD, &(requests[request_cnt++])); } // Wait on the recv sizes, then free and re-allocate the requests and statuses @@ -435,7 +478,8 @@ hypre_BoomerAMGDD_FindNeighborProcessors( hypre_ParCSRMatrix *A, for (i = 0; i < csr_num_sends; i++) { recv_buffers[i] = hypre_CTAlloc(HYPRE_Int, recv_sizes[i], HYPRE_MEMORY_HOST); - hypre_MPI_Irecv(recv_buffers[i], recv_sizes[i], HYPRE_MPI_INT, hypre_ParCSRCommPkgSendProc(commPkg,i), 5, hypre_MPI_COMM_WORLD, &(requests[request_cnt++])); + hypre_MPI_Irecv(recv_buffers[i], recv_sizes[i], HYPRE_MPI_INT, hypre_ParCSRCommPkgSendProc(commPkg, + i), 5, hypre_MPI_COMM_WORLD, &(requests[request_cnt++])); } // Setup the send buffer and post the sends @@ -458,7 +502,8 @@ hypre_BoomerAMGDD_FindNeighborProcessors( hypre_ParCSRMatrix *A, } } } - hypre_MPI_Isend(send_buffers[i], send_sizes[i], HYPRE_MPI_INT, hypre_ParCSRCommPkgRecvProc(commPkg,i), 5, hypre_MPI_COMM_WORLD, &(requests[request_cnt++])); + hypre_MPI_Isend(send_buffers[i], send_sizes[i], HYPRE_MPI_INT, hypre_ParCSRCommPkgRecvProc(commPkg, + i), 5, hypre_MPI_COMM_WORLD, &(requests[request_cnt++])); } // Free the req dof info for (i = 0; i < csr_num_recvs; i++) @@ -515,24 +560,35 @@ hypre_BoomerAMGDD_FindNeighborProcessors( hypre_ParCSRMatrix *A, if (p_idx == send_proc_capacity) { send_proc_capacity *= 2; - hypre_AMGDDCommPkgSendProcs(compGridCommPkg)[level] = hypre_TReAlloc(hypre_AMGDDCommPkgSendProcs(compGridCommPkg)[level], HYPRE_Int, send_proc_capacity, HYPRE_MEMORY_HOST); - hypre_AMGDDCommPkgSendFlag(compGridCommPkg)[level] = hypre_TReAlloc(hypre_AMGDDCommPkgSendFlag(compGridCommPkg)[level], HYPRE_Int**, send_proc_capacity, HYPRE_MEMORY_HOST); - hypre_AMGDDCommPkgNumSendNodes(compGridCommPkg)[level] = hypre_TReAlloc(hypre_AMGDDCommPkgNumSendNodes(compGridCommPkg)[level], HYPRE_Int*, send_proc_capacity, HYPRE_MEMORY_HOST); + hypre_AMGDDCommPkgSendProcs(compGridCommPkg)[level] = hypre_TReAlloc(hypre_AMGDDCommPkgSendProcs( + compGridCommPkg)[level], HYPRE_Int, send_proc_capacity, HYPRE_MEMORY_HOST); + hypre_AMGDDCommPkgSendFlag(compGridCommPkg)[level] = hypre_TReAlloc(hypre_AMGDDCommPkgSendFlag( + compGridCommPkg)[level], HYPRE_Int**, send_proc_capacity, HYPRE_MEMORY_HOST); + hypre_AMGDDCommPkgNumSendNodes(compGridCommPkg)[level] = hypre_TReAlloc( + hypre_AMGDDCommPkgNumSendNodes(compGridCommPkg)[level], HYPRE_Int*, send_proc_capacity, + HYPRE_MEMORY_HOST); starting_dofs = hypre_TReAlloc(starting_dofs, HYPRE_Int*, send_proc_capacity, HYPRE_MEMORY_HOST); - num_starting_dofs = hypre_TReAlloc(num_starting_dofs, HYPRE_Int, send_proc_capacity, HYPRE_MEMORY_HOST); - send_dof_capacities = hypre_TReAlloc(send_dof_capacities, HYPRE_Int, send_proc_capacity, HYPRE_MEMORY_HOST); - distances = hypre_TReAlloc(distances , HYPRE_Int*, send_proc_capacity, HYPRE_MEMORY_HOST); - send_dof_maps = hypre_TReAlloc(send_dof_maps, hypre_UnorderedIntMap*, send_proc_capacity, HYPRE_MEMORY_HOST); + num_starting_dofs = hypre_TReAlloc(num_starting_dofs, HYPRE_Int, send_proc_capacity, + HYPRE_MEMORY_HOST); + send_dof_capacities = hypre_TReAlloc(send_dof_capacities, HYPRE_Int, send_proc_capacity, + HYPRE_MEMORY_HOST); + distances = hypre_TReAlloc(distances, HYPRE_Int*, send_proc_capacity, HYPRE_MEMORY_HOST); + send_dof_maps = hypre_TReAlloc(send_dof_maps, hypre_UnorderedIntMap*, send_proc_capacity, + HYPRE_MEMORY_HOST); } hypre_AMGDDCommPkgNumSendProcs(compGridCommPkg)[level]++; hypre_AMGDDCommPkgSendProcs(compGridCommPkg)[level][p_idx] = proc_id; - hypre_AMGDDCommPkgSendFlag(compGridCommPkg)[level][p_idx] = hypre_CTAlloc(HYPRE_Int*, hypre_AMGDDCommPkgNumLevels(compGridCommPkg), HYPRE_MEMORY_HOST); - hypre_AMGDDCommPkgNumSendNodes(compGridCommPkg)[level][p_idx] = hypre_CTAlloc(HYPRE_Int, hypre_AMGDDCommPkgNumLevels(compGridCommPkg), HYPRE_MEMORY_HOST); + hypre_AMGDDCommPkgSendFlag(compGridCommPkg)[level][p_idx] = hypre_CTAlloc(HYPRE_Int*, + hypre_AMGDDCommPkgNumLevels(compGridCommPkg), HYPRE_MEMORY_HOST); + hypre_AMGDDCommPkgNumSendNodes(compGridCommPkg)[level][p_idx] = hypre_CTAlloc(HYPRE_Int, + hypre_AMGDDCommPkgNumLevels(compGridCommPkg), HYPRE_MEMORY_HOST); send_dof_capacities[p_idx] = num_requested_dofs; - hypre_AMGDDCommPkgSendFlag(compGridCommPkg)[level][p_idx][level] = hypre_CTAlloc(HYPRE_Int, send_dof_capacities[p_idx], HYPRE_MEMORY_HOST); + hypre_AMGDDCommPkgSendFlag(compGridCommPkg)[level][p_idx][level] = hypre_CTAlloc(HYPRE_Int, + send_dof_capacities[p_idx], HYPRE_MEMORY_HOST); distances[p_idx] = hypre_CTAlloc(HYPRE_Int, send_dof_capacities[p_idx], HYPRE_MEMORY_HOST); send_dof_maps[p_idx] = hypre_CTAlloc(hypre_UnorderedIntMap, 1, HYPRE_MEMORY_HOST); - hypre_UnorderedIntMapCreate(send_dof_maps[p_idx], 2*max_distance*num_requested_dofs, 16*hypre_NumThreads()); // !!! Is this a "safe" upper bound on map size? + hypre_UnorderedIntMapCreate(send_dof_maps[p_idx], 2 * max_distance * num_requested_dofs, + 16 * hypre_NumThreads()); // !!! Is this a "safe" upper bound on map size? starting_dofs[p_idx] = hypre_CTAlloc(HYPRE_Int, num_requested_dofs, HYPRE_MEMORY_HOST); num_starting_dofs[p_idx] = 0; } @@ -540,7 +596,8 @@ hypre_BoomerAMGDD_FindNeighborProcessors( hypre_ParCSRMatrix *A, { if (starting_dofs[p_idx]) { - starting_dofs[p_idx] = hypre_TReAlloc(starting_dofs[p_idx], HYPRE_Int, num_starting_dofs[p_idx] + num_requested_dofs, HYPRE_MEMORY_HOST); + starting_dofs[p_idx] = hypre_TReAlloc(starting_dofs[p_idx], HYPRE_Int, + num_starting_dofs[p_idx] + num_requested_dofs, HYPRE_MEMORY_HOST); } else { @@ -570,9 +627,11 @@ hypre_BoomerAMGDD_FindNeighborProcessors( hypre_ParCSRMatrix *A, if (d_idx == send_dof_capacities[p_idx]) { send_dof_capacities[p_idx] *= 2; - hypre_AMGDDCommPkgSendFlag(compGridCommPkg)[level][p_idx][level] = hypre_TReAlloc(hypre_AMGDDCommPkgSendFlag(compGridCommPkg)[level][p_idx][level], - HYPRE_Int, send_dof_capacities[p_idx], HYPRE_MEMORY_HOST); - distances[p_idx] = hypre_TReAlloc(distances[p_idx], HYPRE_Int, send_dof_capacities[p_idx], HYPRE_MEMORY_HOST); + hypre_AMGDDCommPkgSendFlag(compGridCommPkg)[level][p_idx][level] = hypre_TReAlloc( + hypre_AMGDDCommPkgSendFlag(compGridCommPkg)[level][p_idx][level], + HYPRE_Int, send_dof_capacities[p_idx], HYPRE_MEMORY_HOST); + distances[p_idx] = hypre_TReAlloc(distances[p_idx], HYPRE_Int, send_dof_capacities[p_idx], + HYPRE_MEMORY_HOST); } hypre_AMGDDCommPkgNumSendNodes(compGridCommPkg)[level][p_idx][level]++; hypre_AMGDDCommPkgSendFlag(compGridCommPkg)[level][p_idx][level][d_idx] = req_dof_local_index; @@ -643,36 +702,43 @@ hypre_BoomerAMGDD_SetupNearestProcessorNeighbors( hypre_ParCSRMatrix *A, { // Initialize send info (send procs, send dofs, starting dofs, distances, map for lookups in send dofs) hypre_AMGDDCommPkgNumSendProcs(compGridCommPkg)[level] = csr_num_sends; - HYPRE_Int send_proc_capacity = 2*csr_num_sends; - hypre_AMGDDCommPkgSendProcs(compGridCommPkg)[level] = hypre_CTAlloc(HYPRE_Int, send_proc_capacity, HYPRE_MEMORY_HOST); - hypre_AMGDDCommPkgNumSendNodes(compGridCommPkg)[level] = hypre_CTAlloc(HYPRE_Int*, send_proc_capacity, HYPRE_MEMORY_HOST); - hypre_AMGDDCommPkgSendFlag(compGridCommPkg)[level] = hypre_CTAlloc(HYPRE_Int**, send_proc_capacity, HYPRE_MEMORY_HOST); + HYPRE_Int send_proc_capacity = 2 * csr_num_sends; + hypre_AMGDDCommPkgSendProcs(compGridCommPkg)[level] = hypre_CTAlloc(HYPRE_Int, send_proc_capacity, + HYPRE_MEMORY_HOST); + hypre_AMGDDCommPkgNumSendNodes(compGridCommPkg)[level] = hypre_CTAlloc(HYPRE_Int*, + send_proc_capacity, HYPRE_MEMORY_HOST); + hypre_AMGDDCommPkgSendFlag(compGridCommPkg)[level] = hypre_CTAlloc(HYPRE_Int**, send_proc_capacity, + HYPRE_MEMORY_HOST); HYPRE_Int *num_starting_dofs = hypre_CTAlloc(HYPRE_Int, send_proc_capacity, HYPRE_MEMORY_HOST); HYPRE_Int *send_dof_capacities = hypre_CTAlloc(HYPRE_Int, send_proc_capacity, HYPRE_MEMORY_HOST); HYPRE_Int **starting_dofs = hypre_CTAlloc(HYPRE_Int*, send_proc_capacity, HYPRE_MEMORY_HOST); HYPRE_Int **distances = hypre_CTAlloc(HYPRE_Int*, send_proc_capacity, HYPRE_MEMORY_HOST); - hypre_UnorderedIntMap **send_dof_maps = hypre_CTAlloc(hypre_UnorderedIntMap*, send_proc_capacity, HYPRE_MEMORY_HOST); + hypre_UnorderedIntMap **send_dof_maps = hypre_CTAlloc(hypre_UnorderedIntMap*, send_proc_capacity, + HYPRE_MEMORY_HOST); for (i = 0; i < csr_num_sends; i++) { - hypre_AMGDDCommPkgSendProcs(compGridCommPkg)[level][i] = hypre_ParCSRCommPkgSendProc(commPkg,i); - start = hypre_ParCSRCommPkgSendMapStart(commPkg,i); - finish = hypre_ParCSRCommPkgSendMapStart(commPkg,i+1); + hypre_AMGDDCommPkgSendProcs(compGridCommPkg)[level][i] = hypre_ParCSRCommPkgSendProc(commPkg, i); + start = hypre_ParCSRCommPkgSendMapStart(commPkg, i); + finish = hypre_ParCSRCommPkgSendMapStart(commPkg, i + 1); HYPRE_Int num_send_dofs = finish - start; - send_dof_capacities[i] = max_distance*num_send_dofs; + send_dof_capacities[i] = max_distance * num_send_dofs; num_starting_dofs[i] = num_send_dofs; - hypre_AMGDDCommPkgNumSendNodes(compGridCommPkg)[level][i] = hypre_CTAlloc(HYPRE_Int, num_levels, HYPRE_MEMORY_HOST); + hypre_AMGDDCommPkgNumSendNodes(compGridCommPkg)[level][i] = hypre_CTAlloc(HYPRE_Int, num_levels, + HYPRE_MEMORY_HOST); hypre_AMGDDCommPkgNumSendNodes(compGridCommPkg)[level][i][level] = num_send_dofs; - hypre_AMGDDCommPkgSendFlag(compGridCommPkg)[level][i] = hypre_CTAlloc(HYPRE_Int*, num_levels, HYPRE_MEMORY_HOST); - hypre_AMGDDCommPkgSendFlag(compGridCommPkg)[level][i][level] = hypre_CTAlloc(HYPRE_Int, send_dof_capacities[i], HYPRE_MEMORY_HOST); + hypre_AMGDDCommPkgSendFlag(compGridCommPkg)[level][i] = hypre_CTAlloc(HYPRE_Int*, num_levels, + HYPRE_MEMORY_HOST); + hypre_AMGDDCommPkgSendFlag(compGridCommPkg)[level][i][level] = hypre_CTAlloc(HYPRE_Int, + send_dof_capacities[i], HYPRE_MEMORY_HOST); starting_dofs[i] = hypre_CTAlloc(HYPRE_Int, num_send_dofs, HYPRE_MEMORY_HOST); distances[i] = hypre_CTAlloc(HYPRE_Int, send_dof_capacities[i], HYPRE_MEMORY_HOST); send_dof_maps[i] = hypre_CTAlloc(hypre_UnorderedIntMap, 1, HYPRE_MEMORY_HOST); hypre_UnorderedIntMapCreate(send_dof_maps[i], - 2*max_distance*num_send_dofs, // !!! Is this a "safe" upper bound on the map size? - 16*hypre_NumThreads()); + 2 * max_distance * num_send_dofs, // !!! Is this a "safe" upper bound on the map size? + 16 * hypre_NumThreads()); for (j = start; j < finish; j++) { - HYPRE_Int send_dof = hypre_ParCSRCommPkgSendMapElmt(commPkg,j); + HYPRE_Int send_dof = hypre_ParCSRCommPkgSendMapElmt(commPkg, j); hypre_AMGDDCommPkgSendFlag(compGridCommPkg)[level][i][level][j - start] = send_dof; starting_dofs[i][j - start] = j - start; distances[i][j - start] = max_distance; @@ -682,11 +748,12 @@ hypre_BoomerAMGDD_SetupNearestProcessorNeighbors( hypre_ParCSRMatrix *A, //Initialize the recv_procs hypre_AMGDDCommPkgNumRecvProcs(compGridCommPkg)[level] = csr_num_recvs; - HYPRE_Int recv_proc_capacity = 2*csr_num_recvs; - hypre_AMGDDCommPkgRecvProcs(compGridCommPkg)[level] = hypre_CTAlloc(HYPRE_Int, recv_proc_capacity, HYPRE_MEMORY_HOST); + HYPRE_Int recv_proc_capacity = 2 * csr_num_recvs; + hypre_AMGDDCommPkgRecvProcs(compGridCommPkg)[level] = hypre_CTAlloc(HYPRE_Int, recv_proc_capacity, + HYPRE_MEMORY_HOST); for (i = 0; i < csr_num_recvs; i++) { - hypre_AMGDDCommPkgRecvProcs(compGridCommPkg)[level][i] = hypre_ParCSRCommPkgRecvProc(commPkg,i); + hypre_AMGDDCommPkgRecvProcs(compGridCommPkg)[level][i] = hypre_ParCSRCommPkgRecvProc(commPkg, i); } // Iteratively communicate with longer and longer distance neighbors to grow the communication stencils @@ -709,15 +776,18 @@ hypre_BoomerAMGDD_SetupNearestProcessorNeighbors( hypre_ParCSRMatrix *A, HYPRE_Int num_orig_sends = 0; if (i < csr_num_sends) { - num_orig_sends = hypre_ParCSRCommPkgSendMapStart(commPkg,i+1) - hypre_ParCSRCommPkgSendMapStart(commPkg,i); + num_orig_sends = hypre_ParCSRCommPkgSendMapStart(commPkg, + i + 1) - hypre_ParCSRCommPkgSendMapStart(commPkg, i); } - hypre_qsort0(hypre_AMGDDCommPkgSendFlag(compGridCommPkg)[level][i][level], num_orig_sends, hypre_AMGDDCommPkgNumSendNodes(compGridCommPkg)[level][i][level] - 1); + hypre_qsort0(hypre_AMGDDCommPkgSendFlag(compGridCommPkg)[level][i][level], num_orig_sends, + hypre_AMGDDCommPkgNumSendNodes(compGridCommPkg)[level][i][level] - 1); for (j = num_orig_sends; j < hypre_AMGDDCommPkgNumSendNodes(compGridCommPkg)[level][i][level]; j++) { if (distances[i][j] <= num_ghost_layers) { - hypre_AMGDDCommPkgSendFlag(compGridCommPkg)[level][i][level][j] = -(hypre_AMGDDCommPkgSendFlag(compGridCommPkg)[level][i][level][j] + 1 ); + hypre_AMGDDCommPkgSendFlag(compGridCommPkg)[level][i][level][j] = -(hypre_AMGDDCommPkgSendFlag( + compGridCommPkg)[level][i][level][j] + 1 ); } } } @@ -763,7 +833,8 @@ hypre_BoomerAMGDD_UnpackRecvBuffer( hypre_ParAMGDDData *amgdd_data, hypre_ParAMGData *amg_data = hypre_ParAMGDDDataAMG(amgdd_data); hypre_AMGDDCompGrid **compGrid = hypre_ParAMGDDDataCompGrid(amgdd_data); hypre_AMGDDCommPkg *compGridCommPkg = hypre_ParAMGDDDataCommPkg(amgdd_data); - hypre_ParCSRCommPkg *commPkg = hypre_ParCSRMatrixCommPkg(hypre_ParAMGDataAArray(amg_data)[current_level]); + hypre_ParCSRCommPkg *commPkg = hypre_ParCSRMatrixCommPkg(hypre_ParAMGDataAArray( + amg_data)[current_level]); HYPRE_Int num_levels = hypre_ParAMGDataNumLevels(amg_data); HYPRE_Int ****recv_map = hypre_AMGDDCommPkgRecvMap(compGridCommPkg); @@ -802,34 +873,44 @@ hypre_BoomerAMGDD_UnpackRecvBuffer( hypre_ParAMGDDData *amgdd_data, HYPRE_Int start_extra_dofs = hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[current_level]); if (num_recv_nodes[current_level][buffer_number][current_level] + start_extra_dofs > max_nonowned) { - HYPRE_Int new_size = ceil(1.5*max_nonowned); + HYPRE_Int new_size = (HYPRE_Int)hypre_ceil(1.5 * max_nonowned); if (new_size < num_recv_nodes[current_level][buffer_number][current_level] + start_extra_dofs) + { new_size = num_recv_nodes[current_level][buffer_number][current_level] + start_extra_dofs; - hypre_AMGDDCompGridResize(compGrid[current_level], new_size, current_level != num_levels-1); // !!! Is there a better way to manage memory? !!! + } + hypre_AMGDDCompGridResize(compGrid[current_level], new_size, + current_level != num_levels - 1); // !!! Is there a better way to manage memory? !!! } // Get the original number of recv dofs in the ParCSRCommPkg (if this proc was recv'd from in original) HYPRE_Int num_original_recv_dofs = 0; if (commPkg) if (buffer_number < hypre_ParCSRCommPkgNumRecvs(commPkg)) - num_original_recv_dofs = hypre_ParCSRCommPkgRecvVecStart(commPkg, buffer_number+1) - hypre_ParCSRCommPkgRecvVecStart(commPkg, buffer_number); + { + num_original_recv_dofs = hypre_ParCSRCommPkgRecvVecStart(commPkg, + buffer_number + 1) - hypre_ParCSRCommPkgRecvVecStart(commPkg, buffer_number); + } // Skip over original commPkg recv dofs !!! Optimization: can avoid sending GIDs here - HYPRE_Int remaining_dofs = num_recv_nodes[current_level][buffer_number][current_level] - num_original_recv_dofs; + HYPRE_Int remaining_dofs = num_recv_nodes[current_level][buffer_number][current_level] - + num_original_recv_dofs; cnt += num_original_recv_dofs; // Setup the recv map on current level - recv_map[current_level][buffer_number][current_level] = hypre_CTAlloc(HYPRE_Int, num_recv_nodes[current_level][buffer_number][current_level], HYPRE_MEMORY_HOST); + recv_map[current_level][buffer_number][current_level] = hypre_CTAlloc(HYPRE_Int, + num_recv_nodes[current_level][buffer_number][current_level], HYPRE_MEMORY_HOST); for (i = 0; i < num_original_recv_dofs; i++) { - recv_map[current_level][buffer_number][current_level][i] = i + hypre_ParCSRCommPkgRecvVecStart(commPkg, buffer_number) + hypre_AMGDDCompGridNumOwnedNodes(compGrid[current_level]); + recv_map[current_level][buffer_number][current_level][i] = i + hypre_ParCSRCommPkgRecvVecStart( + commPkg, buffer_number) + hypre_AMGDDCompGridNumOwnedNodes(compGrid[current_level]); } // Unpack global indices and setup sort and invsort hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[current_level]) += remaining_dofs; HYPRE_Int *sort_map = hypre_AMGDDCompGridNonOwnedSort(compGrid[current_level]); HYPRE_Int *inv_sort_map = hypre_AMGDDCompGridNonOwnedInvSort(compGrid[current_level]); - HYPRE_Int *new_inv_sort_map = hypre_CTAlloc(HYPRE_Int, hypre_CSRMatrixNumRows(nonowned_diag), hypre_AMGDDCompGridMemoryLocation(compGrid[current_level])); + HYPRE_Int *new_inv_sort_map = hypre_CTAlloc(HYPRE_Int, hypre_CSRMatrixNumRows(nonowned_diag), + hypre_AMGDDCompGridMemoryLocation(compGrid[current_level])); HYPRE_Int sort_cnt = 0; HYPRE_Int compGrid_cnt = 0; HYPRE_Int incoming_cnt = 0; @@ -837,7 +918,8 @@ hypre_BoomerAMGDD_UnpackRecvBuffer( hypre_ParAMGDDData *amgdd_data, { // !!! Optimization: don't have to do these assignments every time... probably doesn't save much (i.e. only update incoming_global_index when necessary, etc.) HYPRE_Int incoming_global_index = recv_buffer[cnt]; - HYPRE_Int compGrid_global_index = hypre_AMGDDCompGridNonOwnedGlobalIndices(compGrid[current_level])[ inv_sort_map[compGrid_cnt] ]; + HYPRE_Int compGrid_global_index = hypre_AMGDDCompGridNonOwnedGlobalIndices( + compGrid[current_level])[ inv_sort_map[compGrid_cnt] ]; HYPRE_Int incoming_is_real = 1; if (incoming_global_index < 0) @@ -849,13 +931,21 @@ hypre_BoomerAMGDD_UnpackRecvBuffer( hypre_ParAMGDDData *amgdd_data, if (incoming_global_index < compGrid_global_index) { // Set global index and real marker for incoming extra dof - hypre_AMGDDCompGridNonOwnedGlobalIndices(compGrid[current_level])[ incoming_cnt + start_extra_dofs ] = incoming_global_index; - hypre_AMGDDCompGridNonOwnedRealMarker(compGrid[current_level])[ incoming_cnt + start_extra_dofs ] = incoming_is_real; + hypre_AMGDDCompGridNonOwnedGlobalIndices(compGrid[current_level])[ incoming_cnt + start_extra_dofs ] + = incoming_global_index; + hypre_AMGDDCompGridNonOwnedRealMarker(compGrid[current_level])[ incoming_cnt + start_extra_dofs ] = + incoming_is_real; if (incoming_is_real) - recv_map[current_level][buffer_number][current_level][incoming_cnt + num_original_recv_dofs] = incoming_cnt + start_extra_dofs + hypre_AMGDDCompGridNumOwnedNodes(compGrid[current_level]); + { + recv_map[current_level][buffer_number][current_level][incoming_cnt + num_original_recv_dofs] = + incoming_cnt + start_extra_dofs + hypre_AMGDDCompGridNumOwnedNodes(compGrid[current_level]); + } else - recv_map[current_level][buffer_number][current_level][incoming_cnt + num_original_recv_dofs] = -(incoming_cnt + start_extra_dofs + hypre_AMGDDCompGridNumOwnedNodes(compGrid[current_level]) + 1); + { + recv_map[current_level][buffer_number][current_level][incoming_cnt + num_original_recv_dofs] = - + (incoming_cnt + start_extra_dofs + hypre_AMGDDCompGridNumOwnedNodes(compGrid[current_level]) + 1); + } sort_map[ incoming_cnt + start_extra_dofs ] = sort_cnt; new_inv_sort_map[sort_cnt] = incoming_cnt + start_extra_dofs; @@ -881,13 +971,21 @@ hypre_BoomerAMGDD_UnpackRecvBuffer( hypre_ParAMGDDData *amgdd_data, incoming_is_real = 0; } - hypre_AMGDDCompGridNonOwnedGlobalIndices(compGrid[current_level])[ incoming_cnt + start_extra_dofs ] = incoming_global_index; - hypre_AMGDDCompGridNonOwnedRealMarker(compGrid[current_level])[ incoming_cnt + start_extra_dofs ] = incoming_is_real; + hypre_AMGDDCompGridNonOwnedGlobalIndices(compGrid[current_level])[ incoming_cnt + start_extra_dofs ] + = incoming_global_index; + hypre_AMGDDCompGridNonOwnedRealMarker(compGrid[current_level])[ incoming_cnt + start_extra_dofs ] = + incoming_is_real; if (incoming_is_real) - recv_map[current_level][buffer_number][current_level][incoming_cnt + num_original_recv_dofs] = incoming_cnt + start_extra_dofs + hypre_AMGDDCompGridNumOwnedNodes(compGrid[current_level]); + { + recv_map[current_level][buffer_number][current_level][incoming_cnt + num_original_recv_dofs] = + incoming_cnt + start_extra_dofs + hypre_AMGDDCompGridNumOwnedNodes(compGrid[current_level]); + } else - recv_map[current_level][buffer_number][current_level][incoming_cnt + num_original_recv_dofs] = -(incoming_cnt + start_extra_dofs + hypre_AMGDDCompGridNumOwnedNodes(compGrid[current_level]) + 1); + { + recv_map[current_level][buffer_number][current_level][incoming_cnt + num_original_recv_dofs] = - + (incoming_cnt + start_extra_dofs + hypre_AMGDDCompGridNumOwnedNodes(compGrid[current_level]) + 1); + } sort_map[ incoming_cnt + start_extra_dofs ] = sort_cnt; new_inv_sort_map[sort_cnt] = incoming_cnt + start_extra_dofs; @@ -908,19 +1006,21 @@ hypre_BoomerAMGDD_UnpackRecvBuffer( hypre_ParAMGDDData *amgdd_data, // Unpack coarse global indices (need these for original commPkg recvs as well). // NOTE: store global indices for now, will be adjusted to local indices during SetupLocalIndices - if (current_level != num_levels-1) + if (current_level != num_levels - 1) { for (i = 0; i < num_original_recv_dofs; i++) { HYPRE_Int coarse_index = recv_buffer[cnt++]; - if (coarse_index != -1) coarse_index = -(coarse_index+2); // Marking coarse indices that need setup by negative mapping - hypre_AMGDDCompGridNonOwnedCoarseIndices(compGrid[current_level])[i + hypre_ParCSRCommPkgRecvVecStart(commPkg, buffer_number)] = coarse_index; + if (coarse_index != -1) { coarse_index = -(coarse_index + 2); } // Marking coarse indices that need setup by negative mapping + hypre_AMGDDCompGridNonOwnedCoarseIndices(compGrid[current_level])[i + + hypre_ParCSRCommPkgRecvVecStart(commPkg, buffer_number)] = coarse_index; } for (i = 0; i < remaining_dofs; i++) { HYPRE_Int coarse_index = recv_buffer[cnt++]; - if (coarse_index != -1) coarse_index = -(coarse_index+2); // Marking coarse indices that need setup by negative mapping - hypre_AMGDDCompGridNonOwnedCoarseIndices(compGrid[current_level])[i + start_extra_dofs] = coarse_index; + if (coarse_index != -1) { coarse_index = -(coarse_index + 2); } // Marking coarse indices that need setup by negative mapping + hypre_AMGDDCompGridNonOwnedCoarseIndices(compGrid[current_level])[i + start_extra_dofs] = + coarse_index; } } @@ -931,8 +1031,10 @@ hypre_BoomerAMGDD_UnpackRecvBuffer( hypre_ParAMGDDData *amgdd_data, // Setup col indices for original commPkg dofs for (i = 0; i < num_original_recv_dofs; i++) { - HYPRE_Int diag_rowptr = hypre_CSRMatrixI(nonowned_diag)[ hypre_ParCSRCommPkgRecvVecStart(commPkg, buffer_number) + i ]; - HYPRE_Int offd_rowptr = hypre_CSRMatrixI(nonowned_offd)[ hypre_ParCSRCommPkgRecvVecStart(commPkg, buffer_number) + i ]; + HYPRE_Int diag_rowptr = hypre_CSRMatrixI(nonowned_diag)[ hypre_ParCSRCommPkgRecvVecStart(commPkg, + buffer_number) + i ]; + HYPRE_Int offd_rowptr = hypre_CSRMatrixI(nonowned_offd)[ hypre_ParCSRCommPkgRecvVecStart(commPkg, + buffer_number) + i ]; HYPRE_Int row_size = recv_buffer[ i + row_sizes_start ]; for (j = 0; j < row_size; j++) @@ -942,25 +1044,39 @@ hypre_BoomerAMGDD_UnpackRecvBuffer( hypre_ParAMGDDData *amgdd_data, // Incoming is a global index (could be owned or nonowned) if (incoming_index < 0) { - incoming_index = -(incoming_index+1); + incoming_index = -(incoming_index + 1); // See whether global index is owned on this proc (if so, can directly setup appropriate local index) - if (incoming_index >= hypre_AMGDDCompGridFirstGlobalIndex(compGrid[current_level]) && incoming_index <= hypre_AMGDDCompGridLastGlobalIndex(compGrid[current_level])) + if (incoming_index >= hypre_AMGDDCompGridFirstGlobalIndex(compGrid[current_level]) && + incoming_index <= hypre_AMGDDCompGridLastGlobalIndex(compGrid[current_level])) { // Add to offd if (offd_rowptr >= hypre_CSRMatrixNumNonzeros(nonowned_offd)) - hypre_CSRMatrixResize(nonowned_offd, hypre_CSRMatrixNumRows(nonowned_offd), hypre_CSRMatrixNumCols(nonowned_offd), ceil(1.5*hypre_CSRMatrixNumNonzeros(nonowned_offd) + 1)); - hypre_CSRMatrixJ(nonowned_offd)[offd_rowptr++] = incoming_index - hypre_AMGDDCompGridFirstGlobalIndex(compGrid[current_level]); + { + hypre_CSRMatrixResize(nonowned_offd, hypre_CSRMatrixNumRows(nonowned_offd), + hypre_CSRMatrixNumCols(nonowned_offd), + (HYPRE_Int)hypre_ceil(1.5 * hypre_CSRMatrixNumNonzeros(nonowned_offd) + 1)); + } + hypre_CSRMatrixJ(nonowned_offd)[offd_rowptr++] = incoming_index - + hypre_AMGDDCompGridFirstGlobalIndex(compGrid[current_level]); } else { // Add to diag (global index, not in buffer, so we store global index and get a local index during SetupLocalIndices) if (diag_rowptr >= hypre_CSRMatrixNumNonzeros(nonowned_diag)) { - hypre_AMGDDCompGridNonOwnedDiagMissingColIndices(compGrid[current_level]) = hypre_TReAlloc_v2(hypre_AMGDDCompGridNonOwnedDiagMissingColIndices(compGrid[current_level]), HYPRE_Int, hypre_CSRMatrixNumNonzeros(nonowned_diag), HYPRE_Int, ceil(1.5*hypre_CSRMatrixNumNonzeros(nonowned_diag) + 1), hypre_AMGDDCompGridMemoryLocation(compGrid[current_level])); - hypre_CSRMatrixResize(nonowned_diag, hypre_CSRMatrixNumRows(nonowned_diag), hypre_CSRMatrixNumCols(nonowned_diag), ceil(1.5*hypre_CSRMatrixNumNonzeros(nonowned_diag) + 1)); + hypre_AMGDDCompGridNonOwnedDiagMissingColIndices(compGrid[current_level]) = hypre_TReAlloc_v2( + hypre_AMGDDCompGridNonOwnedDiagMissingColIndices(compGrid[current_level]), HYPRE_Int, + hypre_CSRMatrixNumNonzeros(nonowned_diag), HYPRE_Int, + (HYPRE_Int)hypre_ceil(1.5 * hypre_CSRMatrixNumNonzeros(nonowned_diag) + 1), + hypre_AMGDDCompGridMemoryLocation(compGrid[current_level])); + hypre_CSRMatrixResize(nonowned_diag, hypre_CSRMatrixNumRows(nonowned_diag), + hypre_CSRMatrixNumCols(nonowned_diag), + (HYPRE_Int)hypre_ceil(1.5 * hypre_CSRMatrixNumNonzeros(nonowned_diag) + 1)); } - hypre_AMGDDCompGridNonOwnedDiagMissingColIndices(compGrid[current_level])[ hypre_AMGDDCompGridNumMissingColIndices(compGrid[current_level])++ ] = diag_rowptr; - hypre_CSRMatrixJ(nonowned_diag)[diag_rowptr++] = -(incoming_index+1); + hypre_AMGDDCompGridNonOwnedDiagMissingColIndices( + compGrid[current_level])[ hypre_AMGDDCompGridNumMissingColIndices(compGrid[current_level])++ ] = + diag_rowptr; + hypre_CSRMatrixJ(nonowned_diag)[diag_rowptr++] = -(incoming_index + 1); } } // Incoming is an index to dofs within the buffer (by construction, nonowned) @@ -969,36 +1085,51 @@ hypre_BoomerAMGDD_UnpackRecvBuffer( hypre_ParAMGDDData *amgdd_data, // Add to diag (index is within buffer, so we can directly go to local index) if (diag_rowptr >= hypre_CSRMatrixNumNonzeros(nonowned_diag)) { - hypre_AMGDDCompGridNonOwnedDiagMissingColIndices(compGrid[current_level]) = hypre_TReAlloc_v2(hypre_AMGDDCompGridNonOwnedDiagMissingColIndices(compGrid[current_level]), HYPRE_Int, hypre_CSRMatrixNumNonzeros(nonowned_diag), HYPRE_Int, ceil(1.5*hypre_CSRMatrixNumNonzeros(nonowned_diag) + 1), hypre_AMGDDCompGridMemoryLocation(compGrid[current_level])); - hypre_CSRMatrixResize(nonowned_diag, hypre_CSRMatrixNumRows(nonowned_diag), hypre_CSRMatrixNumCols(nonowned_diag), ceil(1.5*hypre_CSRMatrixNumNonzeros(nonowned_diag) + 1)); + hypre_AMGDDCompGridNonOwnedDiagMissingColIndices(compGrid[current_level]) = hypre_TReAlloc_v2( + hypre_AMGDDCompGridNonOwnedDiagMissingColIndices(compGrid[current_level]), HYPRE_Int, + hypre_CSRMatrixNumNonzeros(nonowned_diag), HYPRE_Int, + (HYPRE_Int)hypre_ceil(1.5 * hypre_CSRMatrixNumNonzeros(nonowned_diag) + 1), + hypre_AMGDDCompGridMemoryLocation(compGrid[current_level])); + hypre_CSRMatrixResize(nonowned_diag, hypre_CSRMatrixNumRows(nonowned_diag), + hypre_CSRMatrixNumCols(nonowned_diag), + (HYPRE_Int)hypre_ceil(1.5 * hypre_CSRMatrixNumNonzeros(nonowned_diag) + 1)); } if (incoming_index < num_original_recv_dofs) - hypre_CSRMatrixJ(nonowned_diag)[diag_rowptr++] = incoming_index + hypre_ParCSRCommPkgRecvVecStart(commPkg, buffer_number); + { + hypre_CSRMatrixJ(nonowned_diag)[diag_rowptr++] = incoming_index + hypre_ParCSRCommPkgRecvVecStart( + commPkg, buffer_number); + } else { - hypre_CSRMatrixJ(nonowned_diag)[diag_rowptr++] = incoming_index - num_original_recv_dofs + start_extra_dofs; + hypre_CSRMatrixJ(nonowned_diag)[diag_rowptr++] = incoming_index - num_original_recv_dofs + + start_extra_dofs; } } } // Update row pointers - hypre_CSRMatrixI(nonowned_diag)[ hypre_ParCSRCommPkgRecvVecStart(commPkg, buffer_number) + i + 1 ] = diag_rowptr; - hypre_CSRMatrixI(nonowned_offd)[ hypre_ParCSRCommPkgRecvVecStart(commPkg, buffer_number) + i + 1 ] = offd_rowptr; + hypre_CSRMatrixI(nonowned_diag)[ hypre_ParCSRCommPkgRecvVecStart(commPkg, + buffer_number) + i + 1 ] = diag_rowptr; + hypre_CSRMatrixI(nonowned_offd)[ hypre_ParCSRCommPkgRecvVecStart(commPkg, + buffer_number) + i + 1 ] = offd_rowptr; } // Temporary storage for extra comp grid dofs on this level (will be setup after all recv's during SetupLocalIndices) // A_tmp_info[buffer_number] = [ size, [row], size, [row], ... ] HYPRE_Int A_tmp_info_size = 1 + remaining_dofs; - for (i = num_original_recv_dofs; i < num_recv_nodes[current_level][buffer_number][current_level]; i++) + for (i = num_original_recv_dofs; i < num_recv_nodes[current_level][buffer_number][current_level]; + i++) { HYPRE_Int row_size = recv_buffer[ i + row_sizes_start ]; A_tmp_info_size += row_size; } - A_tmp_info[buffer_number] = hypre_CTAlloc(HYPRE_Int, A_tmp_info_size, hypre_AMGDDCompGridMemoryLocation(compGrid[current_level])); + A_tmp_info[buffer_number] = hypre_CTAlloc(HYPRE_Int, A_tmp_info_size, + hypre_AMGDDCompGridMemoryLocation(compGrid[current_level])); HYPRE_Int A_tmp_info_cnt = 0; A_tmp_info[buffer_number][A_tmp_info_cnt++] = remaining_dofs; - for (i = num_original_recv_dofs; i < num_recv_nodes[current_level][buffer_number][current_level]; i++) + for (i = num_original_recv_dofs; i < num_recv_nodes[current_level][buffer_number][current_level]; + i++) { HYPRE_Int row_size = recv_buffer[ i + row_sizes_start ]; A_tmp_info[buffer_number][A_tmp_info_cnt++] = row_size; @@ -1012,7 +1143,7 @@ hypre_BoomerAMGDD_UnpackRecvBuffer( hypre_ParAMGDDData *amgdd_data, // loop over coarser psi levels //////////////////////////////////////////////////////////////////// - for (level = current_level+1; level < current_level + num_psi_levels; level++) + for (level = current_level + 1; level < current_level + num_psi_levels; level++) { // get the number of nodes on this level num_recv_nodes[current_level][buffer_number][level] = recv_buffer[cnt++]; @@ -1031,27 +1162,35 @@ hypre_BoomerAMGDD_UnpackRecvBuffer( hypre_ParAMGDDData *amgdd_data, add_node_cnt = 0; // NOTE: Don't free incoming_dest because we set that as recv_map and use it outside this function - HYPRE_Int *incoming_dest = hypre_CTAlloc(HYPRE_Int, num_recv_nodes[current_level][buffer_number][level], HYPRE_MEMORY_HOST); - recv_red_marker[current_level][buffer_number][level] = hypre_CTAlloc(HYPRE_Int, num_recv_nodes[current_level][buffer_number][level], HYPRE_MEMORY_HOST); + HYPRE_Int *incoming_dest = hypre_CTAlloc(HYPRE_Int, + num_recv_nodes[current_level][buffer_number][level], HYPRE_MEMORY_HOST); + recv_red_marker[current_level][buffer_number][level] = hypre_CTAlloc(HYPRE_Int, + num_recv_nodes[current_level][buffer_number][level], HYPRE_MEMORY_HOST); // if necessary, reallocate more space for compGrid - if (num_recv_nodes[current_level][buffer_number][level] + num_nonowned > hypre_CSRMatrixNumRows(nonowned_diag)) + if (num_recv_nodes[current_level][buffer_number][level] + num_nonowned > hypre_CSRMatrixNumRows( + nonowned_diag)) { - HYPRE_Int new_size = ceil(1.5*hypre_CSRMatrixNumRows(nonowned_diag)); + HYPRE_Int new_size = (HYPRE_Int)hypre_ceil(1.5 * hypre_CSRMatrixNumRows(nonowned_diag)); if (new_size < num_recv_nodes[current_level][buffer_number][level] + num_nonowned) + { new_size = num_recv_nodes[current_level][buffer_number][level] + num_nonowned; - hypre_AMGDDCompGridResize(compGrid[level], new_size, level != num_levels-1); // !!! Is there a better way to manage memory? !!! + } + hypre_AMGDDCompGridResize(compGrid[level], new_size, + level != num_levels - 1); // !!! Is there a better way to manage memory? !!! } sort_map = hypre_AMGDDCompGridNonOwnedSort(compGrid[level]); inv_sort_map = hypre_AMGDDCompGridNonOwnedInvSort(compGrid[level]); - new_inv_sort_map = hypre_CTAlloc(HYPRE_Int, hypre_CSRMatrixNumRows(nonowned_diag), hypre_AMGDDCompGridMemoryLocation(compGrid[level])); + new_inv_sort_map = hypre_CTAlloc(HYPRE_Int, hypre_CSRMatrixNumRows(nonowned_diag), + hypre_AMGDDCompGridMemoryLocation(compGrid[level])); sort_cnt = 0; compGrid_cnt = 0; incoming_cnt = 0; HYPRE_Int dest = num_nonowned; - while (incoming_cnt < num_recv_nodes[current_level][buffer_number][level] && compGrid_cnt < num_nonowned) + while (incoming_cnt < num_recv_nodes[current_level][buffer_number][level] && + compGrid_cnt < num_nonowned) { HYPRE_Int incoming_global_index = recv_buffer[cnt]; HYPRE_Int incoming_is_real = 1; @@ -1062,29 +1201,41 @@ hypre_BoomerAMGDD_UnpackRecvBuffer( hypre_ParAMGDDData *amgdd_data, } // If incoming is owned, go on to the next - if (incoming_global_index >= hypre_AMGDDCompGridFirstGlobalIndex(compGrid[level]) && incoming_global_index <= hypre_AMGDDCompGridLastGlobalIndex(compGrid[level])) + if (incoming_global_index >= hypre_AMGDDCompGridFirstGlobalIndex(compGrid[level]) && + incoming_global_index <= hypre_AMGDDCompGridLastGlobalIndex(compGrid[level])) { recv_red_marker[current_level][buffer_number][level][incoming_cnt] = 1; if (incoming_is_real) - incoming_dest[incoming_cnt] = incoming_global_index - hypre_AMGDDCompGridFirstGlobalIndex(compGrid[level]); // Save location info for use below + { + incoming_dest[incoming_cnt] = incoming_global_index - hypre_AMGDDCompGridFirstGlobalIndex( + compGrid[level]); // Save location info for use below + } else - incoming_dest[incoming_cnt] = -(incoming_global_index - hypre_AMGDDCompGridFirstGlobalIndex(compGrid[level]) + 1); // Save location info for use below + { + incoming_dest[incoming_cnt] = -(incoming_global_index - hypre_AMGDDCompGridFirstGlobalIndex( + compGrid[level]) + 1); // Save location info for use below + } incoming_cnt++; cnt++; } // Otherwise, merge else { - HYPRE_Int compGrid_global_index = hypre_AMGDDCompGridNonOwnedGlobalIndices(compGrid[level])[ inv_sort_map[compGrid_cnt] ]; + HYPRE_Int compGrid_global_index = hypre_AMGDDCompGridNonOwnedGlobalIndices( + compGrid[level])[ inv_sort_map[compGrid_cnt] ]; if (incoming_global_index < compGrid_global_index) { sort_map[dest] = sort_cnt; new_inv_sort_map[sort_cnt] = dest; if (incoming_is_real) + { incoming_dest[incoming_cnt] = dest + hypre_AMGDDCompGridNumOwnedNodes(compGrid[level]); + } else + { incoming_dest[incoming_cnt] = -(dest + hypre_AMGDDCompGridNumOwnedNodes(compGrid[level]) + 1); + } sort_cnt++; incoming_cnt++; dest++; @@ -1100,10 +1251,12 @@ hypre_BoomerAMGDD_UnpackRecvBuffer( hypre_ParAMGDDData *amgdd_data, } else { - if (incoming_is_real && !hypre_AMGDDCompGridNonOwnedRealMarker(compGrid[level])[ inv_sort_map[compGrid_cnt] ]) + if (incoming_is_real && + !hypre_AMGDDCompGridNonOwnedRealMarker(compGrid[level])[ inv_sort_map[compGrid_cnt] ]) { hypre_AMGDDCompGridNonOwnedRealMarker(compGrid[level])[ inv_sort_map[compGrid_cnt] ] = 1; - incoming_dest[incoming_cnt] = inv_sort_map[compGrid_cnt] + hypre_AMGDDCompGridNumOwnedNodes(compGrid[level]); // Incoming real dof received to existing ghost location + incoming_dest[incoming_cnt] = inv_sort_map[compGrid_cnt] + hypre_AMGDDCompGridNumOwnedNodes( + compGrid[level]); // Incoming real dof received to existing ghost location incoming_cnt++; cnt++; } @@ -1111,9 +1264,15 @@ hypre_BoomerAMGDD_UnpackRecvBuffer( hypre_ParAMGDDData *amgdd_data, { recv_red_marker[current_level][buffer_number][level][incoming_cnt] = 1; if (incoming_is_real) - incoming_dest[incoming_cnt] = inv_sort_map[compGrid_cnt] + hypre_AMGDDCompGridNumOwnedNodes(compGrid[level]); // Save location info for use below + { + incoming_dest[incoming_cnt] = inv_sort_map[compGrid_cnt] + hypre_AMGDDCompGridNumOwnedNodes( + compGrid[level]); // Save location info for use below + } else - incoming_dest[incoming_cnt] = -(inv_sort_map[compGrid_cnt] + hypre_AMGDDCompGridNumOwnedNodes(compGrid[level]) + 1); // Save location info for use below + { + incoming_dest[incoming_cnt] = -(inv_sort_map[compGrid_cnt] + hypre_AMGDDCompGridNumOwnedNodes( + compGrid[level]) + 1); // Save location info for use below + } incoming_cnt++; cnt++; } @@ -1131,13 +1290,20 @@ hypre_BoomerAMGDD_UnpackRecvBuffer( hypre_ParAMGDDData *amgdd_data, } // If incoming is owned, go on to the next - if (incoming_global_index >= hypre_AMGDDCompGridFirstGlobalIndex(compGrid[level]) && incoming_global_index <= hypre_AMGDDCompGridLastGlobalIndex(compGrid[level])) + if (incoming_global_index >= hypre_AMGDDCompGridFirstGlobalIndex(compGrid[level]) && + incoming_global_index <= hypre_AMGDDCompGridLastGlobalIndex(compGrid[level])) { recv_red_marker[current_level][buffer_number][level][incoming_cnt] = 1; if (incoming_is_real) - incoming_dest[incoming_cnt] = incoming_global_index - hypre_AMGDDCompGridFirstGlobalIndex(compGrid[level]); // Save location info for use below + { + incoming_dest[incoming_cnt] = incoming_global_index - hypre_AMGDDCompGridFirstGlobalIndex( + compGrid[level]); // Save location info for use below + } else - incoming_dest[incoming_cnt] = -(incoming_global_index - hypre_AMGDDCompGridFirstGlobalIndex(compGrid[level]) + 1); // Save location info for use below + { + incoming_dest[incoming_cnt] = -(incoming_global_index - hypre_AMGDDCompGridFirstGlobalIndex( + compGrid[level]) + 1); // Save location info for use below + } incoming_cnt++; cnt++; } @@ -1146,9 +1312,13 @@ hypre_BoomerAMGDD_UnpackRecvBuffer( hypre_ParAMGDDData *amgdd_data, sort_map[dest] = sort_cnt; new_inv_sort_map[sort_cnt] = dest; if (incoming_is_real) + { incoming_dest[incoming_cnt] = dest + hypre_AMGDDCompGridNumOwnedNodes(compGrid[level]); + } else + { incoming_dest[incoming_cnt] = -(dest + hypre_AMGDDCompGridNumOwnedNodes(compGrid[level]) + 1); + } sort_cnt++; incoming_cnt++; dest++; @@ -1180,7 +1350,7 @@ hypre_BoomerAMGDD_UnpackRecvBuffer( hypre_ParAMGDDData *amgdd_data, if (!recv_red_marker[current_level][buffer_number][level][i]) { dest = incoming_dest[i]; - if (dest < 0) dest = -(dest+1); + if (dest < 0) { dest = -(dest + 1); } dest -= hypre_AMGDDCompGridNumOwnedNodes(compGrid[level]); HYPRE_Int global_index = recv_buffer[cnt]; if (global_index < 0) @@ -1188,22 +1358,22 @@ hypre_BoomerAMGDD_UnpackRecvBuffer( hypre_ParAMGDDData *amgdd_data, global_index = -(global_index + 1); hypre_AMGDDCompGridNonOwnedRealMarker(compGrid[level])[ dest ] = 0; } - else hypre_AMGDDCompGridNonOwnedRealMarker(compGrid[level])[ dest ] = 1; + else { hypre_AMGDDCompGridNonOwnedRealMarker(compGrid[level])[ dest ] = 1; } hypre_AMGDDCompGridNonOwnedGlobalIndices(compGrid[level])[ dest ] = global_index; } cnt++; } - if (level != num_levels-1) + if (level != num_levels - 1) { for (i = 0; i < num_recv_nodes[current_level][buffer_number][level]; i++) { if (!recv_red_marker[current_level][buffer_number][level][i]) { dest = incoming_dest[i]; - if (dest < 0) dest = -(dest+1); + if (dest < 0) { dest = -(dest + 1); } dest -= hypre_AMGDDCompGridNumOwnedNodes(compGrid[level]); HYPRE_Int coarse_index = recv_buffer[cnt]; - if (coarse_index != -1) coarse_index = -(coarse_index+2); // Marking coarse indices that need setup by negative mapping + if (coarse_index != -1) { coarse_index = -(coarse_index + 2); } // Marking coarse indices that need setup by negative mapping hypre_AMGDDCompGridNonOwnedCoarseIndices(compGrid[level])[ dest ] = coarse_index; } cnt++; @@ -1219,7 +1389,7 @@ hypre_BoomerAMGDD_UnpackRecvBuffer( hypre_ParAMGDDData *amgdd_data, // !!! Optimization: (probably small gain) right now, I disregard incoming info for real overwriting ghost (internal buf connectivity could be used to avoid a few binary searches later) dest = incoming_dest[i]; - if (dest < 0) dest = -(dest+1); + if (dest < 0) { dest = -(dest + 1); } dest -= hypre_AMGDDCompGridNumOwnedNodes(compGrid[level]); if (dest >= num_nonowned) @@ -1231,39 +1401,56 @@ hypre_BoomerAMGDD_UnpackRecvBuffer( hypre_ParAMGDDData *amgdd_data, // Incoming is a global index (could be owned or nonowned) if (incoming_index < 0) { - incoming_index = -(incoming_index+1); + incoming_index = -(incoming_index + 1); // See whether global index is owned on this proc (if so, can directly setup appropriate local index) - if (incoming_index >= hypre_AMGDDCompGridFirstGlobalIndex(compGrid[level]) && incoming_index <= hypre_AMGDDCompGridLastGlobalIndex(compGrid[level])) + if (incoming_index >= hypre_AMGDDCompGridFirstGlobalIndex(compGrid[level]) && + incoming_index <= hypre_AMGDDCompGridLastGlobalIndex(compGrid[level])) { // Add to offd if (offd_rowptr >= hypre_CSRMatrixNumNonzeros(nonowned_offd)) - hypre_CSRMatrixResize(nonowned_offd, hypre_CSRMatrixNumRows(nonowned_offd), hypre_CSRMatrixNumCols(nonowned_offd), ceil(1.5*hypre_CSRMatrixNumNonzeros(nonowned_offd) + 1)); - hypre_CSRMatrixJ(nonowned_offd)[offd_rowptr++] = incoming_index - hypre_AMGDDCompGridFirstGlobalIndex(compGrid[level]); + { + hypre_CSRMatrixResize(nonowned_offd, hypre_CSRMatrixNumRows(nonowned_offd), + hypre_CSRMatrixNumCols(nonowned_offd), + (HYPRE_Int)hypre_ceil(1.5 * hypre_CSRMatrixNumNonzeros(nonowned_offd) + 1)); + } + hypre_CSRMatrixJ(nonowned_offd)[offd_rowptr++] = incoming_index - + hypre_AMGDDCompGridFirstGlobalIndex(compGrid[level]); } else { // Add to diag (global index, not in buffer, so we store global index and get a local index during SetupLocalIndices) if (diag_rowptr >= hypre_CSRMatrixNumNonzeros(nonowned_diag)) { - hypre_AMGDDCompGridNonOwnedDiagMissingColIndices(compGrid[level]) = hypre_TReAlloc_v2(hypre_AMGDDCompGridNonOwnedDiagMissingColIndices(compGrid[level]), HYPRE_Int, hypre_CSRMatrixNumNonzeros(nonowned_diag), HYPRE_Int, ceil(1.5*hypre_CSRMatrixNumNonzeros(nonowned_diag) + 1), hypre_AMGDDCompGridMemoryLocation(compGrid[level])); - hypre_CSRMatrixResize(nonowned_diag, hypre_CSRMatrixNumRows(nonowned_diag), hypre_CSRMatrixNumCols(nonowned_diag), ceil(1.5*hypre_CSRMatrixNumNonzeros(nonowned_diag) + 1)); + hypre_AMGDDCompGridNonOwnedDiagMissingColIndices(compGrid[level]) = hypre_TReAlloc_v2( + hypre_AMGDDCompGridNonOwnedDiagMissingColIndices(compGrid[level]), HYPRE_Int, + hypre_CSRMatrixNumNonzeros(nonowned_diag), HYPRE_Int, + (HYPRE_Int)hypre_ceil(1.5 * hypre_CSRMatrixNumNonzeros(nonowned_diag) + 1), + hypre_AMGDDCompGridMemoryLocation(compGrid[level])); + hypre_CSRMatrixResize(nonowned_diag, hypre_CSRMatrixNumRows(nonowned_diag), + hypre_CSRMatrixNumCols(nonowned_diag), + (HYPRE_Int)hypre_ceil(1.5 * hypre_CSRMatrixNumNonzeros(nonowned_diag) + 1)); } - hypre_AMGDDCompGridNonOwnedDiagMissingColIndices(compGrid[level])[ hypre_AMGDDCompGridNumMissingColIndices(compGrid[level])++ ] = diag_rowptr; - hypre_CSRMatrixJ(nonowned_diag)[diag_rowptr++] = -(incoming_index+1); + hypre_AMGDDCompGridNonOwnedDiagMissingColIndices( + compGrid[level])[ hypre_AMGDDCompGridNumMissingColIndices(compGrid[level])++ ] = diag_rowptr; + hypre_CSRMatrixJ(nonowned_diag)[diag_rowptr++] = -(incoming_index + 1); } } // Incoming is an index to dofs within the buffer (could be owned or nonowned) else { HYPRE_Int local_index = incoming_dest[ incoming_index ]; - if (local_index < 0) local_index = -(local_index + 1); + if (local_index < 0) { local_index = -(local_index + 1); } // Check whether dof is owned or nonowned if (local_index < hypre_AMGDDCompGridNumOwnedNodes(compGrid[level])) { // Add to offd if (offd_rowptr >= hypre_CSRMatrixNumNonzeros(nonowned_offd)) - hypre_CSRMatrixResize(nonowned_offd, hypre_CSRMatrixNumRows(nonowned_offd), hypre_CSRMatrixNumCols(nonowned_offd), ceil(1.5*hypre_CSRMatrixNumNonzeros(nonowned_offd) + 1)); + { + hypre_CSRMatrixResize(nonowned_offd, hypre_CSRMatrixNumRows(nonowned_offd), + hypre_CSRMatrixNumCols(nonowned_offd), + (HYPRE_Int)hypre_ceil(1.5 * hypre_CSRMatrixNumNonzeros(nonowned_offd) + 1)); + } hypre_CSRMatrixJ(nonowned_offd)[offd_rowptr++] = local_index; } else @@ -1271,10 +1458,17 @@ hypre_BoomerAMGDD_UnpackRecvBuffer( hypre_ParAMGDDData *amgdd_data, // Add to diag (index is within buffer, so we can directly go to local index) if (diag_rowptr >= hypre_CSRMatrixNumNonzeros(nonowned_diag)) { - hypre_AMGDDCompGridNonOwnedDiagMissingColIndices(compGrid[level]) = hypre_TReAlloc_v2(hypre_AMGDDCompGridNonOwnedDiagMissingColIndices(compGrid[level]), HYPRE_Int, hypre_CSRMatrixNumNonzeros(nonowned_diag), HYPRE_Int, ceil(1.5*hypre_CSRMatrixNumNonzeros(nonowned_diag) + 1), hypre_AMGDDCompGridMemoryLocation(compGrid[level])); - hypre_CSRMatrixResize(nonowned_diag, hypre_CSRMatrixNumRows(nonowned_diag), hypre_CSRMatrixNumCols(nonowned_diag), ceil(1.5*hypre_CSRMatrixNumNonzeros(nonowned_diag) + 1)); + hypre_AMGDDCompGridNonOwnedDiagMissingColIndices(compGrid[level]) = hypre_TReAlloc_v2( + hypre_AMGDDCompGridNonOwnedDiagMissingColIndices(compGrid[level]), HYPRE_Int, + hypre_CSRMatrixNumNonzeros(nonowned_diag), HYPRE_Int, + (HYPRE_Int)hypre_ceil(1.5 * hypre_CSRMatrixNumNonzeros(nonowned_diag) + 1), + hypre_AMGDDCompGridMemoryLocation(compGrid[level])); + hypre_CSRMatrixResize(nonowned_diag, hypre_CSRMatrixNumRows(nonowned_diag), + hypre_CSRMatrixNumCols(nonowned_diag), + (HYPRE_Int)hypre_ceil(1.5 * hypre_CSRMatrixNumNonzeros(nonowned_diag) + 1)); } - hypre_CSRMatrixJ(nonowned_diag)[diag_rowptr++] = local_index - hypre_AMGDDCompGridNumOwnedNodes(compGrid[level]); + hypre_CSRMatrixJ(nonowned_diag)[diag_rowptr++] = local_index - hypre_AMGDDCompGridNumOwnedNodes( + compGrid[level]); } } } @@ -1304,11 +1498,12 @@ hypre_BoomerAMGDD_PackColInd( HYPRE_Int *send_flag, { HYPRE_Int i, j, send_elmt, add_flag_index; HYPRE_Int cnt = starting_cnt; - HYPRE_Int total_num_nodes = hypre_AMGDDCompGridNumOwnedNodes(compGrid) + hypre_AMGDDCompGridNumNonOwnedNodes(compGrid); + HYPRE_Int total_num_nodes = hypre_AMGDDCompGridNumOwnedNodes(compGrid) + + hypre_AMGDDCompGridNumNonOwnedNodes(compGrid); for (i = 0; i < num_send_nodes; i++) { send_elmt = send_flag[i]; - if (send_elmt < 0) send_elmt = -(send_elmt + 1); + if (send_elmt < 0) { send_elmt = -(send_elmt + 1); } // Owned point if (send_elmt < hypre_AMGDDCompGridNumOwnedNodes(compGrid)) @@ -1316,7 +1511,7 @@ hypre_BoomerAMGDD_PackColInd( HYPRE_Int *send_flag, hypre_CSRMatrix *diag = hypre_AMGDDCompGridMatrixOwnedDiag(hypre_AMGDDCompGridA(compGrid)); hypre_CSRMatrix *offd = hypre_AMGDDCompGridMatrixOwnedOffd(hypre_AMGDDCompGridA(compGrid)); // Get diag connections - for (j = hypre_CSRMatrixI(diag)[send_elmt]; j < hypre_CSRMatrixI(diag)[send_elmt+1]; j++) + for (j = hypre_CSRMatrixI(diag)[send_elmt]; j < hypre_CSRMatrixI(diag)[send_elmt + 1]; j++) { add_flag_index = hypre_CSRMatrixJ(diag)[j]; if (add_flag[add_flag_index] > 0) @@ -1325,11 +1520,12 @@ hypre_BoomerAMGDD_PackColInd( HYPRE_Int *send_flag, } else { - send_buffer[cnt++] = -(add_flag_index + hypre_AMGDDCompGridFirstGlobalIndex(compGrid) + 1); // -(GID + 1) + send_buffer[cnt++] = -(add_flag_index + hypre_AMGDDCompGridFirstGlobalIndex( + compGrid) + 1); // -(GID + 1) } } // Get offd connections - for (j = hypre_CSRMatrixI(offd)[send_elmt]; j < hypre_CSRMatrixI(offd)[send_elmt+1]; j++) + for (j = hypre_CSRMatrixI(offd)[send_elmt]; j < hypre_CSRMatrixI(offd)[send_elmt + 1]; j++) { add_flag_index = hypre_CSRMatrixJ(offd)[j] + hypre_AMGDDCompGridNumOwnedNodes(compGrid); if (add_flag[add_flag_index] > 0) @@ -1338,7 +1534,8 @@ hypre_BoomerAMGDD_PackColInd( HYPRE_Int *send_flag, } else { - send_buffer[cnt++] = -(hypre_AMGDDCompGridNonOwnedGlobalIndices(compGrid)[ hypre_CSRMatrixJ(offd)[j] ] + 1); // -(GID + 1) + send_buffer[cnt++] = -(hypre_AMGDDCompGridNonOwnedGlobalIndices(compGrid)[ hypre_CSRMatrixJ( + offd)[j] ] + 1); // -(GID + 1) } } } @@ -1349,7 +1546,8 @@ hypre_BoomerAMGDD_PackColInd( HYPRE_Int *send_flag, hypre_CSRMatrix *diag = hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridA(compGrid)); hypre_CSRMatrix *offd = hypre_AMGDDCompGridMatrixNonOwnedOffd(hypre_AMGDDCompGridA(compGrid)); // Get diag connections - for (j = hypre_CSRMatrixI(diag)[nonowned_index]; j < hypre_CSRMatrixI(diag)[nonowned_index+1]; j++) + for (j = hypre_CSRMatrixI(diag)[nonowned_index]; j < hypre_CSRMatrixI(diag)[nonowned_index + 1]; + j++) { if (hypre_CSRMatrixJ(diag)[j] >= 0) { @@ -1360,7 +1558,8 @@ hypre_BoomerAMGDD_PackColInd( HYPRE_Int *send_flag, } else { - send_buffer[cnt++] = -(hypre_AMGDDCompGridNonOwnedGlobalIndices(compGrid)[ hypre_CSRMatrixJ(diag)[j] ] + 1); // -(GID + 1) + send_buffer[cnt++] = -(hypre_AMGDDCompGridNonOwnedGlobalIndices(compGrid)[ hypre_CSRMatrixJ( + diag)[j] ] + 1); // -(GID + 1) } } else @@ -1369,7 +1568,8 @@ hypre_BoomerAMGDD_PackColInd( HYPRE_Int *send_flag, } } // Get offd connections - for (j = hypre_CSRMatrixI(offd)[nonowned_index]; j < hypre_CSRMatrixI(offd)[nonowned_index+1]; j++) + for (j = hypre_CSRMatrixI(offd)[nonowned_index]; j < hypre_CSRMatrixI(offd)[nonowned_index + 1]; + j++) { add_flag_index = hypre_CSRMatrixJ(offd)[j]; if (add_flag[add_flag_index] > 0) @@ -1378,11 +1578,12 @@ hypre_BoomerAMGDD_PackColInd( HYPRE_Int *send_flag, } else { - send_buffer[cnt++] = -(add_flag_index + hypre_AMGDDCompGridFirstGlobalIndex(compGrid) + 1); // -(GID + 1) + send_buffer[cnt++] = -(add_flag_index + hypre_AMGDDCompGridFirstGlobalIndex( + compGrid) + 1); // -(GID + 1) } } } - else send_flag[i] = send_elmt - total_num_nodes; + else { send_flag[i] = send_elmt - total_num_nodes; } } return cnt; @@ -1450,8 +1651,9 @@ hypre_BoomerAMGDD_AddFlagToSendFlag( hypre_AMGDDCompGrid *compGrid, HYPRE_Int *num_send_nodes, HYPRE_Int num_ghost_layers ) { - HYPRE_Int i,cnt,add_flag_index; - HYPRE_Int total_num_nodes = hypre_AMGDDCompGridNumOwnedNodes(compGrid) + hypre_AMGDDCompGridNumNonOwnedNodes(compGrid); + HYPRE_Int i, cnt, add_flag_index; + HYPRE_Int total_num_nodes = hypre_AMGDDCompGridNumOwnedNodes(compGrid) + + hypre_AMGDDCompGridNumNonOwnedNodes(compGrid); for (i = 0; i < total_num_nodes; i++) { if (add_flag[i] > 0) @@ -1467,7 +1669,8 @@ hypre_BoomerAMGDD_AddFlagToSendFlag( hypre_AMGDDCompGrid *compGrid, // First the nonowned indices coming before the owned block if (hypre_AMGDDCompGridNumNonOwnedNodes(compGrid)) { - while (hypre_AMGDDCompGridNonOwnedGlobalIndices(compGrid)[inv_sort_map[i]] < hypre_AMGDDCompGridFirstGlobalIndex(compGrid)) + while (hypre_AMGDDCompGridNonOwnedGlobalIndices(compGrid)[inv_sort_map[i]] < + hypre_AMGDDCompGridFirstGlobalIndex(compGrid)) { add_flag_index = i + hypre_AMGDDCompGridNumOwnedNodes(compGrid); if (add_flag[add_flag_index] > num_ghost_layers) @@ -1481,11 +1684,12 @@ hypre_BoomerAMGDD_AddFlagToSendFlag( hypre_AMGDDCompGrid *compGrid, cnt++; } i++; - if (i == hypre_AMGDDCompGridNumNonOwnedNodes(compGrid)) break; + if (i == hypre_AMGDDCompGridNumNonOwnedNodes(compGrid)) { break; } } } // Then the owned block - for (add_flag_index = 0; add_flag_index < hypre_AMGDDCompGridNumOwnedNodes(compGrid); add_flag_index++) + for (add_flag_index = 0; add_flag_index < hypre_AMGDDCompGridNumOwnedNodes(compGrid); + add_flag_index++) { if (add_flag[add_flag_index] > num_ghost_layers) { @@ -1494,7 +1698,7 @@ hypre_BoomerAMGDD_AddFlagToSendFlag( hypre_AMGDDCompGrid *compGrid, } else if (add_flag[add_flag_index] > 0) { - send_flag[cnt] = -(add_flag_index+1); + send_flag[cnt] = -(add_flag_index + 1); cnt++; } } @@ -1532,7 +1736,8 @@ hypre_BoomerAMGDD_SubtractLists( hypre_AMGDDCompGrid *compGrid, while (current_cnt < (*current_list_length) && prev_cnt < prev_list_length) { // Get the global indices - HYPRE_Int current_global_index = hypre_BoomerAMGDD_LocalToGlobalIndex(compGrid, current_list[current_cnt]); + HYPRE_Int current_global_index = hypre_BoomerAMGDD_LocalToGlobalIndex(compGrid, + current_list[current_cnt]); HYPRE_Int prev_global_index = hypre_BoomerAMGDD_LocalToGlobalIndex(compGrid, prev_list[prev_cnt]); // Do the merge @@ -1553,10 +1758,16 @@ hypre_BoomerAMGDD_SubtractLists( hypre_AMGDDCompGrid *compGrid, { // This is the case of real dof sent to overwrite ghost. // Current list is a positive local index here. Map beyond the range of total dofs to mark. - if (current_list[current_cnt] < hypre_AMGDDCompGridNumOwnedNodes(compGrid) + hypre_AMGDDCompGridNumNonOwnedNodes(compGrid)) - current_list[new_cnt] = current_list[current_cnt] + hypre_AMGDDCompGridNumOwnedNodes(compGrid) + hypre_AMGDDCompGridNumNonOwnedNodes(compGrid); + if (current_list[current_cnt] < hypre_AMGDDCompGridNumOwnedNodes(compGrid) + + hypre_AMGDDCompGridNumNonOwnedNodes(compGrid)) + { + current_list[new_cnt] = current_list[current_cnt] + hypre_AMGDDCompGridNumOwnedNodes( + compGrid) + hypre_AMGDDCompGridNumNonOwnedNodes(compGrid); + } else + { current_list[new_cnt] = current_list[current_cnt]; + } new_cnt++; current_cnt++; prev_cnt++; @@ -1591,10 +1802,12 @@ hypre_BoomerAMGDD_RemoveRedundancy( hypre_ParAMGData *amg_data, { HYPRE_Int current_send_proc = hypre_AMGDDCommPkgSendProcs(compGridCommPkg)[current_level][proc]; HYPRE_Int prev_proc, prev_level; - for (prev_level = current_level+1; prev_level <= level; prev_level++) + for (prev_level = current_level + 1; prev_level <= level; prev_level++) { - hypre_ParCSRCommPkg *original_commPkg = hypre_ParCSRMatrixCommPkg(hypre_ParAMGDataAArray(amg_data)[prev_level]); - for (prev_proc = 0; prev_proc < hypre_AMGDDCommPkgNumSendProcs(compGridCommPkg)[prev_level]; prev_proc++) + hypre_ParCSRCommPkg *original_commPkg = hypre_ParCSRMatrixCommPkg(hypre_ParAMGDataAArray( + amg_data)[prev_level]); + for (prev_proc = 0; prev_proc < hypre_AMGDDCommPkgNumSendProcs(compGridCommPkg)[prev_level]; + prev_proc++) { if (hypre_AMGDDCommPkgSendProcs(compGridCommPkg)[prev_level][prev_proc] == current_send_proc) { @@ -1602,64 +1815,71 @@ hypre_BoomerAMGDD_RemoveRedundancy( hypre_ParAMGData *amg_data, if (prev_level == level) { HYPRE_Int original_proc; - for (original_proc = 0; original_proc < hypre_ParCSRCommPkgNumSends(original_commPkg); original_proc++) + for (original_proc = 0; original_proc < hypre_ParCSRCommPkgNumSends(original_commPkg); + original_proc++) { if (hypre_ParCSRCommPkgSendProc(original_commPkg, original_proc) == current_send_proc) { - prev_list_end = hypre_ParCSRCommPkgSendMapStart(original_commPkg, original_proc+1) - hypre_ParCSRCommPkgSendMapStart(original_commPkg, original_proc); + prev_list_end = hypre_ParCSRCommPkgSendMapStart(original_commPkg, + original_proc + 1) - hypre_ParCSRCommPkgSendMapStart(original_commPkg, original_proc); break; } } } hypre_BoomerAMGDD_SubtractLists(compGrid[level], - send_flag[current_level][proc][level], - &(num_send_nodes[current_level][proc][level]), - send_flag[prev_level][prev_proc][level], - prev_list_end); + send_flag[current_level][proc][level], + &(num_send_nodes[current_level][proc][level]), + send_flag[prev_level][prev_proc][level], + prev_list_end); if (num_send_nodes[prev_level][prev_proc][level] - prev_list_end > 0) { hypre_BoomerAMGDD_SubtractLists(compGrid[level], - send_flag[current_level][proc][level], - &(num_send_nodes[current_level][proc][level]), - &(send_flag[prev_level][prev_proc][level][prev_list_end]), - num_send_nodes[prev_level][prev_proc][level] - prev_list_end); + send_flag[current_level][proc][level], + &(num_send_nodes[current_level][proc][level]), + &(send_flag[prev_level][prev_proc][level][prev_list_end]), + num_send_nodes[prev_level][prev_proc][level] - prev_list_end); } } } - for (prev_proc = 0; prev_proc < hypre_AMGDDCommPkgNumRecvProcs(compGridCommPkg)[prev_level]; prev_proc++) + for (prev_proc = 0; prev_proc < hypre_AMGDDCommPkgNumRecvProcs(compGridCommPkg)[prev_level]; + prev_proc++) { if (hypre_AMGDDCommPkgRecvProcs(compGridCommPkg)[prev_level][prev_proc] == current_send_proc) { - HYPRE_Int prev_list_end = hypre_AMGDDCommPkgNumRecvNodes(compGridCommPkg)[prev_level][prev_proc][level]; + HYPRE_Int prev_list_end = hypre_AMGDDCommPkgNumRecvNodes( + compGridCommPkg)[prev_level][prev_proc][level]; if (prev_level == level) { HYPRE_Int original_proc; - for (original_proc = 0; original_proc < hypre_ParCSRCommPkgNumRecvs(original_commPkg); original_proc++) + for (original_proc = 0; original_proc < hypre_ParCSRCommPkgNumRecvs(original_commPkg); + original_proc++) { if (hypre_ParCSRCommPkgRecvProc(original_commPkg, original_proc) == current_send_proc) { - prev_list_end = hypre_ParCSRCommPkgRecvVecStart(original_commPkg, original_proc+1) - hypre_ParCSRCommPkgRecvVecStart(original_commPkg, original_proc); + prev_list_end = hypre_ParCSRCommPkgRecvVecStart(original_commPkg, + original_proc + 1) - hypre_ParCSRCommPkgRecvVecStart(original_commPkg, original_proc); break; } } } hypre_BoomerAMGDD_SubtractLists(compGrid[level], - send_flag[current_level][proc][level], - &(num_send_nodes[current_level][proc][level]), - hypre_AMGDDCommPkgRecvMap(compGridCommPkg)[prev_level][prev_proc][level], - prev_list_end); + send_flag[current_level][proc][level], + &(num_send_nodes[current_level][proc][level]), + hypre_AMGDDCommPkgRecvMap(compGridCommPkg)[prev_level][prev_proc][level], + prev_list_end); - if (hypre_AMGDDCommPkgNumRecvNodes(compGridCommPkg)[prev_level][prev_proc][level] - prev_list_end > 0) + if (hypre_AMGDDCommPkgNumRecvNodes(compGridCommPkg)[prev_level][prev_proc][level] - prev_list_end > + 0) { hypre_BoomerAMGDD_SubtractLists(compGrid[level], - send_flag[current_level][proc][level], - &(num_send_nodes[current_level][proc][level]), - &(hypre_AMGDDCommPkgRecvMap(compGridCommPkg)[prev_level][prev_proc][level][prev_list_end]), - hypre_AMGDDCommPkgNumRecvNodes(compGridCommPkg)[prev_level][prev_proc][level] - prev_list_end); + send_flag[current_level][proc][level], + &(num_send_nodes[current_level][proc][level]), + &(hypre_AMGDDCommPkgRecvMap(compGridCommPkg)[prev_level][prev_proc][level][prev_list_end]), + hypre_AMGDDCommPkgNumRecvNodes(compGridCommPkg)[prev_level][prev_proc][level] - prev_list_end); } } } @@ -1675,7 +1895,7 @@ hypre_BoomerAMGDD_RecursivelyBuildPsiComposite( HYPRE_Int node, HYPRE_Int *add_flag, HYPRE_Int use_sort) { - HYPRE_Int i,index,sort_index; + HYPRE_Int i, index, sort_index; HYPRE_Int error_code = 0; HYPRE_Int *sort_map = hypre_AMGDDCompGridNonOwnedSort(compGrid); @@ -1698,7 +1918,7 @@ hypre_BoomerAMGDD_RecursivelyBuildPsiComposite( HYPRE_Int node, } // Look at neighbors in diag - for (i = hypre_CSRMatrixI(diag)[node]; i < hypre_CSRMatrixI(diag)[node+1]; i++) + for (i = hypre_CSRMatrixI(diag)[node]; i < hypre_CSRMatrixI(diag)[node + 1]; i++) { // Get the index of the neighbor index = hypre_CSRMatrixJ(diag)[i]; @@ -1710,8 +1930,8 @@ hypre_BoomerAMGDD_RecursivelyBuildPsiComposite( HYPRE_Int node, } else { - if (use_sort) sort_index = sort_map[index] + hypre_AMGDDCompGridNumOwnedNodes(compGrid); - else sort_index = index + hypre_AMGDDCompGridNumOwnedNodes(compGrid); + if (use_sort) { sort_index = sort_map[index] + hypre_AMGDDCompGridNumOwnedNodes(compGrid); } + else { sort_index = index + hypre_AMGDDCompGridNumOwnedNodes(compGrid); } index += hypre_AMGDDCompGridNumOwnedNodes(compGrid); } @@ -1720,18 +1940,19 @@ hypre_BoomerAMGDD_RecursivelyBuildPsiComposite( HYPRE_Int node, { add_flag[sort_index] = m; // Recursively call to find distance m-1 neighbors of index - if (m-1 > 0) error_code = hypre_BoomerAMGDD_RecursivelyBuildPsiComposite(index, m-1, compGrid, add_flag, use_sort); + if (m - 1 > 0) { error_code = hypre_BoomerAMGDD_RecursivelyBuildPsiComposite(index, m - 1, compGrid, add_flag, use_sort); } } } else { error_code = 1; - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"WARNING: Negative col index encountered during hypre_BoomerAMGDD_RecursivelyBuildPsiComposite().\n"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "WARNING: Negative col index encountered during hypre_BoomerAMGDD_RecursivelyBuildPsiComposite().\n"); } } // Look at neighbors in offd - for (i = hypre_CSRMatrixI(offd)[node]; i < hypre_CSRMatrixI(offd)[node+1]; i++) + for (i = hypre_CSRMatrixI(offd)[node]; i < hypre_CSRMatrixI(offd)[node + 1]; i++) { // Get the index of the neighbor index = hypre_CSRMatrixJ(offd)[i]; @@ -1743,8 +1964,8 @@ hypre_BoomerAMGDD_RecursivelyBuildPsiComposite( HYPRE_Int node, } else { - if (use_sort) sort_index = sort_map[index] + hypre_AMGDDCompGridNumOwnedNodes(compGrid); - else sort_index = index + hypre_AMGDDCompGridNumOwnedNodes(compGrid); + if (use_sort) { sort_index = sort_map[index] + hypre_AMGDDCompGridNumOwnedNodes(compGrid); } + else { sort_index = index + hypre_AMGDDCompGridNumOwnedNodes(compGrid); } index += hypre_AMGDDCompGridNumOwnedNodes(compGrid); } @@ -1753,13 +1974,14 @@ hypre_BoomerAMGDD_RecursivelyBuildPsiComposite( HYPRE_Int node, { add_flag[sort_index] = m; // Recursively call to find distance m-1 neighbors of index - if (m-1 > 0) error_code = hypre_BoomerAMGDD_RecursivelyBuildPsiComposite(index, m-1, compGrid, add_flag, use_sort); + if (m - 1 > 0) { error_code = hypre_BoomerAMGDD_RecursivelyBuildPsiComposite(index, m - 1, compGrid, add_flag, use_sort); } } } else { error_code = 1; - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"WARNING: Negative col index encountered during hypre_BoomerAMGDD_RecursivelyBuildPsiComposite().\n"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "WARNING: Negative col index encountered during hypre_BoomerAMGDD_RecursivelyBuildPsiComposite().\n"); } } @@ -1812,13 +2034,13 @@ hypre_BoomerAMGDD_PackSendBuffer( hypre_ParAMGDDData *amgdd_data, add_flag[current_level] = hypre_CTAlloc(HYPRE_Int, total_num_nodes, memory_location); send_buffer_size[current_level][proc] += 2; - if (current_level != num_levels-1) + if (current_level != num_levels - 1) { - send_buffer_size[current_level][proc] += 3*num_send_nodes[current_level][proc][current_level]; + send_buffer_size[current_level][proc] += 3 * num_send_nodes[current_level][proc][current_level]; } else { - send_buffer_size[current_level][proc] += 2*num_send_nodes[current_level][proc][current_level]; + send_buffer_size[current_level][proc] += 2 * num_send_nodes[current_level][proc][current_level]; } for (i = 0; i < num_send_nodes[current_level][proc][current_level]; i++) @@ -1832,31 +2054,33 @@ hypre_BoomerAMGDD_PackSendBuffer( hypre_ParAMGDDData *amgdd_data, diag = hypre_AMGDDCompGridMatrixOwnedDiag(hypre_AMGDDCompGridA(compGrid[current_level])); offd = hypre_AMGDDCompGridMatrixOwnedOffd(hypre_AMGDDCompGridA(compGrid[current_level])); - send_buffer_size[current_level][proc] += hypre_CSRMatrixI(diag)[send_elmt+1] - hypre_CSRMatrixI(diag)[send_elmt]; - send_buffer_size[current_level][proc] += hypre_CSRMatrixI(offd)[send_elmt+1] - hypre_CSRMatrixI(offd)[send_elmt]; + send_buffer_size[current_level][proc] += hypre_CSRMatrixI(diag)[send_elmt + 1] - hypre_CSRMatrixI( + diag)[send_elmt]; + send_buffer_size[current_level][proc] += hypre_CSRMatrixI(offd)[send_elmt + 1] - hypre_CSRMatrixI( + offd)[send_elmt]; } // Add the nodes listed by the coarse grid counterparts if applicable // Note that the compGridCommPkg is set up to list all nodes within the padding plus ghost layers - if (current_level != num_levels-1) + if (current_level != num_levels - 1) { - total_num_nodes = hypre_AMGDDCompGridNumOwnedNodes(compGrid[current_level+1]) + - hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[current_level+1]); - memory_location = hypre_AMGDDCompGridMemoryLocation(compGrid[current_level+1]); - add_flag[current_level+1] = hypre_CTAlloc(HYPRE_Int, total_num_nodes, memory_location); + total_num_nodes = hypre_AMGDDCompGridNumOwnedNodes(compGrid[current_level + 1]) + + hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[current_level + 1]); + memory_location = hypre_AMGDDCompGridMemoryLocation(compGrid[current_level + 1]); + add_flag[current_level + 1] = hypre_CTAlloc(HYPRE_Int, total_num_nodes, memory_location); total_num_nodes = hypre_AMGDDCompGridNumOwnedNodes(compGrid[current_level]) + hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[current_level]); hypre_BoomerAMGDD_MarkCoarse(send_flag[current_level][proc][current_level], - add_flag[current_level+1], + add_flag[current_level + 1], hypre_AMGDDCompGridOwnedCoarseIndices(compGrid[current_level]), hypre_AMGDDCompGridNonOwnedCoarseIndices(compGrid[current_level]), - hypre_AMGDDCompGridNonOwnedSort(compGrid[current_level+1]), + hypre_AMGDDCompGridNonOwnedSort(compGrid[current_level + 1]), hypre_AMGDDCompGridNumOwnedNodes(compGrid[current_level]), total_num_nodes, - hypre_AMGDDCompGridNumOwnedNodes(compGrid[current_level+1]), + hypre_AMGDDCompGridNumOwnedNodes(compGrid[current_level + 1]), num_send_nodes[current_level][proc][current_level], - padding[current_level+1] + num_ghost_layers + 1, + padding[current_level + 1] + num_ghost_layers + 1, 1, &nodes_to_add); } @@ -1875,12 +2099,12 @@ hypre_BoomerAMGDD_PackSendBuffer( hypre_ParAMGDDData *amgdd_data, nodes_to_add = 0; // if we need coarse info, allocate space for the add flag on the next level - if (level != num_levels-1) + if (level != num_levels - 1) { - total_num_nodes = hypre_AMGDDCompGridNumOwnedNodes(compGrid[level+1]) + - hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[level+1]); - memory_location = hypre_AMGDDCompGridMemoryLocation(compGrid[current_level+1]); - add_flag[level+1] = hypre_CTAlloc(HYPRE_Int, total_num_nodes, memory_location); + total_num_nodes = hypre_AMGDDCompGridNumOwnedNodes(compGrid[level + 1]) + + hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[level + 1]); + memory_location = hypre_AMGDDCompGridMemoryLocation(compGrid[current_level + 1]); + add_flag[level + 1] = hypre_CTAlloc(HYPRE_Int, total_num_nodes, memory_location); } // Expand by the padding on this level and add coarse grid counterparts if applicable @@ -1910,9 +2134,9 @@ hypre_BoomerAMGDD_PackSendBuffer( hypre_ParAMGDDData *amgdd_data, } send_flag[current_level][proc][level] = hypre_BoomerAMGDD_AddFlagToSendFlag(compGrid[level], - add_flag[level], - &(num_send_nodes[current_level][proc][level]), - num_ghost_layers); + add_flag[level], + &(num_send_nodes[current_level][proc][level]), + num_ghost_layers); // Compare with previous send/recvs to eliminate redundant info hypre_BoomerAMGDD_RemoveRedundancy(amg_data, @@ -1925,20 +2149,20 @@ hypre_BoomerAMGDD_PackSendBuffer( hypre_ParAMGDDData *amgdd_data, level); // Mark the points to start from on the next level - if (level != num_levels-1) + if (level != num_levels - 1) { total_num_nodes = hypre_AMGDDCompGridNumOwnedNodes(compGrid[level]) + hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[level]); hypre_BoomerAMGDD_MarkCoarse(send_flag[current_level][proc][level], - add_flag[level+1], + add_flag[level + 1], hypre_AMGDDCompGridOwnedCoarseIndices(compGrid[level]), hypre_AMGDDCompGridNonOwnedCoarseIndices(compGrid[level]), - hypre_AMGDDCompGridNonOwnedSort(compGrid[level+1]), + hypre_AMGDDCompGridNonOwnedSort(compGrid[level + 1]), hypre_AMGDDCompGridNumOwnedNodes(compGrid[level]), total_num_nodes, - hypre_AMGDDCompGridNumOwnedNodes(compGrid[level+1]), + hypre_AMGDDCompGridNumOwnedNodes(compGrid[level + 1]), num_send_nodes[current_level][proc][level], - padding[level+1] + num_ghost_layers + 1, + padding[level + 1] + num_ghost_layers + 1, 1, &nodes_to_add); } @@ -1947,15 +2171,15 @@ hypre_BoomerAMGDD_PackSendBuffer( hypre_ParAMGDDData *amgdd_data, total_num_nodes = hypre_AMGDDCompGridNumOwnedNodes(compGrid[level]) + hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[level]); - hypre_Memset(add_flag[level], 0, sizeof(HYPRE_Int)*total_num_nodes, HYPRE_MEMORY_HOST); + hypre_Memset(add_flag[level], 0, sizeof(HYPRE_Int)*total_num_nodes, memory_location); (*send_flag_buffer_size) += num_send_nodes[current_level][proc][level]; - if (level != num_levels-1) + if (level != num_levels - 1) { - send_buffer_size[current_level][proc] += 3*num_send_nodes[current_level][proc][level]; + send_buffer_size[current_level][proc] += 3 * num_send_nodes[current_level][proc][level]; } else { - send_buffer_size[current_level][proc] += 2*num_send_nodes[current_level][proc][level]; + send_buffer_size[current_level][proc] += 2 * num_send_nodes[current_level][proc][level]; } for (i = 0; i < num_send_nodes[current_level][proc][level]; i++) @@ -1971,21 +2195,27 @@ hypre_BoomerAMGDD_PackSendBuffer( hypre_ParAMGDDData *amgdd_data, add_flag[level][send_elmt] = i + 1; diag = hypre_AMGDDCompGridMatrixOwnedDiag(hypre_AMGDDCompGridA(compGrid[level])); offd = hypre_AMGDDCompGridMatrixOwnedOffd(hypre_AMGDDCompGridA(compGrid[level])); - send_buffer_size[current_level][proc] += hypre_CSRMatrixI(diag)[send_elmt+1] - hypre_CSRMatrixI(diag)[send_elmt]; - send_buffer_size[current_level][proc] += hypre_CSRMatrixI(offd)[send_elmt+1] - hypre_CSRMatrixI(offd)[send_elmt]; + send_buffer_size[current_level][proc] += hypre_CSRMatrixI(diag)[send_elmt + 1] - hypre_CSRMatrixI( + diag)[send_elmt]; + send_buffer_size[current_level][proc] += hypre_CSRMatrixI(offd)[send_elmt + 1] - hypre_CSRMatrixI( + offd)[send_elmt]; } - else if (send_elmt < hypre_AMGDDCompGridNumOwnedNodes(compGrid[level]) + hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[level])) + else if (send_elmt < hypre_AMGDDCompGridNumOwnedNodes(compGrid[level]) + + hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[level])) { add_flag[level][send_elmt] = i + 1; send_elmt -= hypre_AMGDDCompGridNumOwnedNodes(compGrid[level]); diag = hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridA(compGrid[level])); offd = hypre_AMGDDCompGridMatrixNonOwnedOffd(hypre_AMGDDCompGridA(compGrid[level])); - send_buffer_size[current_level][proc] += hypre_CSRMatrixI(diag)[send_elmt+1] - hypre_CSRMatrixI(diag)[send_elmt]; - send_buffer_size[current_level][proc] += hypre_CSRMatrixI(offd)[send_elmt+1] - hypre_CSRMatrixI(offd)[send_elmt]; + send_buffer_size[current_level][proc] += hypre_CSRMatrixI(diag)[send_elmt + 1] - hypre_CSRMatrixI( + diag)[send_elmt]; + send_buffer_size[current_level][proc] += hypre_CSRMatrixI(offd)[send_elmt + 1] - hypre_CSRMatrixI( + offd)[send_elmt]; } else { - send_elmt -= hypre_AMGDDCompGridNumOwnedNodes(compGrid[level]) + hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[level]); + send_elmt -= hypre_AMGDDCompGridNumOwnedNodes(compGrid[level]) + + hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[level]); add_flag[level][send_elmt] = i + 1; } } @@ -2025,7 +2255,8 @@ hypre_BoomerAMGDD_PackSendBuffer( hypre_ParAMGDDData *amgdd_data, } else { - send_buffer[cnt++] = -(hypre_AMGDDCompGridNonOwnedGlobalIndices(compGrid[level])[ send_elmt - hypre_AMGDDCompGridNumOwnedNodes(compGrid[level]) ] + 1); + send_buffer[cnt++] = -(hypre_AMGDDCompGridNonOwnedGlobalIndices(compGrid[level])[ send_elmt - + hypre_AMGDDCompGridNumOwnedNodes(compGrid[level]) ] + 1); } } else @@ -2041,13 +2272,14 @@ hypre_BoomerAMGDD_PackSendBuffer( hypre_ParAMGDDData *amgdd_data, } else { - send_buffer[cnt++] = hypre_AMGDDCompGridNonOwnedGlobalIndices(compGrid[level])[send_elmt - hypre_AMGDDCompGridNumOwnedNodes(compGrid[level])]; + send_buffer[cnt++] = hypre_AMGDDCompGridNonOwnedGlobalIndices(compGrid[level])[send_elmt - + hypre_AMGDDCompGridNumOwnedNodes(compGrid[level])]; } } } // if not on last level, copy coarse gobal indices - if (level != num_levels-1) + if (level != num_levels - 1) { for (i = 0; i < num_send_nodes[current_level][proc][level]; i++) { @@ -2065,7 +2297,8 @@ hypre_BoomerAMGDD_PackSendBuffer( hypre_ParAMGDDData *amgdd_data, { if (hypre_AMGDDCompGridOwnedCoarseIndices(compGrid[level])[ send_elmt ] >= 0) { - send_buffer[cnt++] = hypre_AMGDDCompGridOwnedCoarseIndices(compGrid[level])[send_elmt] + hypre_AMGDDCompGridFirstGlobalIndex(compGrid[level+1]); + send_buffer[cnt++] = hypre_AMGDDCompGridOwnedCoarseIndices(compGrid[level])[send_elmt] + + hypre_AMGDDCompGridFirstGlobalIndex(compGrid[level + 1]); } else { @@ -2079,7 +2312,8 @@ hypre_BoomerAMGDD_PackSendBuffer( hypre_ParAMGDDData *amgdd_data, if (nonowned_coarse_index >= 0) { - send_buffer[cnt++] = hypre_AMGDDCompGridNonOwnedGlobalIndices(compGrid[level+1])[ nonowned_coarse_index ]; + send_buffer[cnt++] = hypre_AMGDDCompGridNonOwnedGlobalIndices(compGrid[level + + 1])[ nonowned_coarse_index ]; } else if (nonowned_coarse_index == -1) { @@ -2106,7 +2340,7 @@ hypre_BoomerAMGDD_PackSendBuffer( hypre_ParAMGDDData *amgdd_data, diag = hypre_AMGDDCompGridMatrixOwnedDiag(hypre_AMGDDCompGridA(compGrid[level])); offd = hypre_AMGDDCompGridMatrixOwnedOffd(hypre_AMGDDCompGridA(compGrid[level])); row_length = hypre_CSRMatrixI(diag)[send_elmt + 1] - hypre_CSRMatrixI(diag)[send_elmt] - + hypre_CSRMatrixI(offd)[send_elmt + 1] - hypre_CSRMatrixI(offd)[send_elmt]; + + hypre_CSRMatrixI(offd)[send_elmt + 1] - hypre_CSRMatrixI(offd)[send_elmt]; } else if (send_elmt < total_num_nodes) { @@ -2114,7 +2348,7 @@ hypre_BoomerAMGDD_PackSendBuffer( hypre_ParAMGDDData *amgdd_data, diag = hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridA(compGrid[level])); offd = hypre_AMGDDCompGridMatrixNonOwnedOffd(hypre_AMGDDCompGridA(compGrid[level])); row_length = hypre_CSRMatrixI(diag)[nonowned_index + 1] - hypre_CSRMatrixI(diag)[nonowned_index] - + hypre_CSRMatrixI(offd)[nonowned_index + 1] - hypre_CSRMatrixI(offd)[nonowned_index]; + + hypre_CSRMatrixI(offd)[nonowned_index + 1] - hypre_CSRMatrixI(offd)[nonowned_index]; } else { @@ -2159,7 +2393,7 @@ hypre_BoomerAMGDD_PackRecvMapSendBuffer( HYPRE_Int *recv_map_send_buffer, cnt = 0; *recv_buffer_size = 0; - for (level = current_level+1; level < num_levels; level++) + for (level = current_level + 1; level < num_levels; level++) { // if there were nodes in psiComposite on this level if (recv_red_marker[level]) @@ -2175,7 +2409,7 @@ hypre_BoomerAMGDD_PackRecvMapSendBuffer( HYPRE_Int *recv_map_send_buffer, } } // otherwise record that there were zero nodes on this level - else recv_map_send_buffer[cnt++] = 0; + else { recv_map_send_buffer[cnt++] = 0; } } return hypre_error_flag; @@ -2190,11 +2424,13 @@ hypre_BoomerAMGDD_UnpackSendFlagBuffer( hypre_AMGDDCompGrid **compGrid, HYPRE_Int current_level, HYPRE_Int num_levels ) { + HYPRE_UNUSED_VAR(compGrid); + HYPRE_Int level, i, cnt, num_nodes; cnt = 0; *send_buffer_size = 0; - for (level = current_level+1; level < num_levels; level++) + for (level = current_level + 1; level < num_levels; level++) { num_nodes = send_flag_buffer[cnt++]; num_send_nodes[level] = 0; @@ -2208,7 +2444,8 @@ hypre_BoomerAMGDD_UnpackSendFlagBuffer( hypre_AMGDDCompGrid **compGrid, } } - send_flag[level] = hypre_TReAlloc(send_flag[level], HYPRE_Int, num_send_nodes[level], HYPRE_MEMORY_HOST); + send_flag[level] = hypre_TReAlloc(send_flag[level], HYPRE_Int, num_send_nodes[level], + HYPRE_MEMORY_HOST); } return hypre_error_flag; @@ -2230,41 +2467,67 @@ hypre_BoomerAMGDD_CommunicateRemainingMatrixInfo( hypre_ParAMGDDData* amgdd_data HYPRE_Int *R_row_cnt = hypre_CTAlloc(HYPRE_Int, num_levels, HYPRE_MEMORY_HOST); HYPRE_Int *A_row_cnt = hypre_CTAlloc(HYPRE_Int, num_levels, HYPRE_MEMORY_HOST); - HYPRE_Int outer_level,proc,level,i,j; + HYPRE_Int outer_level, proc, level, i, j; - for (outer_level = num_levels-1; outer_level >= amgdd_start_level; outer_level--) + for (outer_level = num_levels - 1; outer_level >= amgdd_start_level; outer_level--) { // Initialize nonowned matrices for P (and R) - if (outer_level != num_levels-1) + if (outer_level != num_levels - 1) { - hypre_CSRMatrix *P_diag_original = hypre_ParCSRMatrixDiag(hypre_ParAMGDataPArray(amg_data)[outer_level]); - hypre_CSRMatrix *P_offd_original = hypre_ParCSRMatrixOffd(hypre_ParAMGDataPArray(amg_data)[outer_level]); + hypre_CSRMatrix *P_diag_original = hypre_ParCSRMatrixDiag(hypre_ParAMGDataPArray( + amg_data)[outer_level]); + hypre_CSRMatrix *P_offd_original = hypre_ParCSRMatrixOffd(hypre_ParAMGDataPArray( + amg_data)[outer_level]); HYPRE_Int ave_nnz_per_row = 1; if (hypre_ParAMGDataPMaxElmts(amg_data)) + { ave_nnz_per_row = hypre_ParAMGDataPMaxElmts(amg_data); + } else if (hypre_CSRMatrixNumRows(P_diag_original)) - ave_nnz_per_row = (HYPRE_Int) (hypre_CSRMatrixNumNonzeros(P_diag_original) / hypre_CSRMatrixNumRows(P_diag_original)); - HYPRE_Int max_nonowned_diag_nnz = hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[outer_level]) * ave_nnz_per_row; + { + ave_nnz_per_row = (HYPRE_Int) (hypre_CSRMatrixNumNonzeros(P_diag_original) / hypre_CSRMatrixNumRows( + P_diag_original)); + } + HYPRE_Int max_nonowned_diag_nnz = hypre_AMGDDCompGridNumNonOwnedNodes( + compGrid[outer_level]) * ave_nnz_per_row; HYPRE_Int max_nonowned_offd_nnz = hypre_CSRMatrixNumNonzeros(P_offd_original); - hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridP(compGrid[outer_level])) = hypre_CSRMatrixCreate(hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[outer_level]), hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[outer_level+1]), max_nonowned_diag_nnz); - hypre_CSRMatrixInitialize(hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridP(compGrid[outer_level]))); - hypre_AMGDDCompGridMatrixNonOwnedOffd(hypre_AMGDDCompGridP(compGrid[outer_level])) = hypre_CSRMatrixCreate(hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[outer_level]), hypre_AMGDDCompGridNumOwnedNodes(compGrid[outer_level+1]), max_nonowned_offd_nnz); - hypre_CSRMatrixInitialize(hypre_AMGDDCompGridMatrixNonOwnedOffd(hypre_AMGDDCompGridP(compGrid[outer_level]))); + hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridP(compGrid[outer_level])) = + hypre_CSRMatrixCreate(hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[outer_level]), + hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[outer_level + 1]), max_nonowned_diag_nnz); + hypre_CSRMatrixInitialize(hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridP( + compGrid[outer_level]))); + hypre_AMGDDCompGridMatrixNonOwnedOffd(hypre_AMGDDCompGridP(compGrid[outer_level])) = + hypre_CSRMatrixCreate(hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[outer_level]), + hypre_AMGDDCompGridNumOwnedNodes(compGrid[outer_level + 1]), max_nonowned_offd_nnz); + hypre_CSRMatrixInitialize(hypre_AMGDDCompGridMatrixNonOwnedOffd(hypre_AMGDDCompGridP( + compGrid[outer_level]))); } if (hypre_ParAMGDataRestriction(amg_data) && outer_level != 0) { - hypre_CSRMatrix *R_diag_original = hypre_ParCSRMatrixDiag(hypre_ParAMGDataPArray(amg_data)[outer_level-1]); - hypre_CSRMatrix *R_offd_original = hypre_ParCSRMatrixOffd(hypre_ParAMGDataPArray(amg_data)[outer_level-1]); + hypre_CSRMatrix *R_diag_original = hypre_ParCSRMatrixDiag(hypre_ParAMGDataPArray( + amg_data)[outer_level - 1]); + hypre_CSRMatrix *R_offd_original = hypre_ParCSRMatrixOffd(hypre_ParAMGDataPArray( + amg_data)[outer_level - 1]); HYPRE_Int ave_nnz_per_row = 1; if (hypre_CSRMatrixNumRows(R_diag_original)) - ave_nnz_per_row = (HYPRE_Int) (hypre_CSRMatrixNumNonzeros(R_diag_original) / hypre_CSRMatrixNumRows(R_diag_original)); - HYPRE_Int max_nonowned_diag_nnz = hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[outer_level]) * ave_nnz_per_row; + { + ave_nnz_per_row = (HYPRE_Int) (hypre_CSRMatrixNumNonzeros(R_diag_original) / hypre_CSRMatrixNumRows( + R_diag_original)); + } + HYPRE_Int max_nonowned_diag_nnz = hypre_AMGDDCompGridNumNonOwnedNodes( + compGrid[outer_level]) * ave_nnz_per_row; HYPRE_Int max_nonowned_offd_nnz = hypre_CSRMatrixNumNonzeros(R_offd_original); - hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridR(compGrid[outer_level-1])) = hypre_CSRMatrixCreate(hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[outer_level]), hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[outer_level-1]), max_nonowned_diag_nnz); - hypre_CSRMatrixInitialize(hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridR(compGrid[outer_level-1]))); - hypre_AMGDDCompGridMatrixNonOwnedOffd(hypre_AMGDDCompGridR(compGrid[outer_level-1])) = hypre_CSRMatrixCreate(hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[outer_level]), hypre_AMGDDCompGridNumOwnedNodes(compGrid[outer_level-1]), max_nonowned_offd_nnz); - hypre_CSRMatrixInitialize(hypre_AMGDDCompGridMatrixNonOwnedOffd(hypre_AMGDDCompGridR(compGrid[outer_level-1]))); + hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridR(compGrid[outer_level - 1])) = + hypre_CSRMatrixCreate(hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[outer_level]), + hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[outer_level - 1]), max_nonowned_diag_nnz); + hypre_CSRMatrixInitialize(hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridR( + compGrid[outer_level - 1]))); + hypre_AMGDDCompGridMatrixNonOwnedOffd(hypre_AMGDDCompGridR(compGrid[outer_level - 1])) = + hypre_CSRMatrixCreate(hypre_AMGDDCompGridNumNonOwnedNodes(compGrid[outer_level]), + hypre_AMGDDCompGridNumOwnedNodes(compGrid[outer_level - 1]), max_nonowned_offd_nnz); + hypre_CSRMatrixInitialize(hypre_AMGDDCompGridMatrixNonOwnedOffd(hypre_AMGDDCompGridR( + compGrid[outer_level - 1]))); } // Get send/recv info from the comp grid comm pkg @@ -2279,7 +2542,7 @@ hypre_BoomerAMGDD_CommunicateRemainingMatrixInfo( hypre_ParAMGDDData* amgdd_data // Get the buffer sizes //////////////////////////////////// - HYPRE_Int *send_sizes = hypre_CTAlloc(HYPRE_Int, 2*num_send_procs, HYPRE_MEMORY_HOST); + HYPRE_Int *send_sizes = hypre_CTAlloc(HYPRE_Int, 2 * num_send_procs, HYPRE_MEMORY_HOST); for (proc = 0; proc < num_send_procs; proc++) { for (level = outer_level; level < num_levels; level++) @@ -2291,28 +2554,28 @@ hypre_BoomerAMGDD_CommunicateRemainingMatrixInfo( hypre_ParAMGDDData* amgdd_data for (i = 0; i < hypre_AMGDDCommPkgNumSendNodes(compGridCommPkg)[outer_level][proc][level]; i++) { idx = hypre_AMGDDCommPkgSendFlag(compGridCommPkg)[outer_level][proc][level][i]; - if (idx < 0) idx = -(idx + 1); + if (idx < 0) { idx = -(idx + 1); } // Owned diag and offd if (idx < hypre_AMGDDCompGridNumOwnedNodes(compGrid[level])) { diag = hypre_AMGDDCompGridMatrixOwnedDiag(hypre_AMGDDCompGridA(compGrid[level])); offd = hypre_AMGDDCompGridMatrixOwnedOffd(hypre_AMGDDCompGridA(compGrid[level])); - A_row_size = hypre_CSRMatrixI(diag)[idx+1] - hypre_CSRMatrixI(diag)[idx] - + hypre_CSRMatrixI(offd)[idx+1] - hypre_CSRMatrixI(offd)[idx]; - if (level != num_levels-1) + A_row_size = hypre_CSRMatrixI(diag)[idx + 1] - hypre_CSRMatrixI(diag)[idx] + + hypre_CSRMatrixI(offd)[idx + 1] - hypre_CSRMatrixI(offd)[idx]; + if (level != num_levels - 1) { diag = hypre_AMGDDCompGridMatrixOwnedDiag(hypre_AMGDDCompGridP(compGrid[level])); offd = hypre_AMGDDCompGridMatrixOwnedOffd(hypre_AMGDDCompGridP(compGrid[level])); - P_row_size = hypre_CSRMatrixI(diag)[idx+1] - hypre_CSRMatrixI(diag)[idx] - + hypre_CSRMatrixI(offd)[idx+1] - hypre_CSRMatrixI(offd)[idx]; + P_row_size = hypre_CSRMatrixI(diag)[idx + 1] - hypre_CSRMatrixI(diag)[idx] + + hypre_CSRMatrixI(offd)[idx + 1] - hypre_CSRMatrixI(offd)[idx]; } if (hypre_ParAMGDataRestriction(amg_data) && level != 0) { - diag = hypre_AMGDDCompGridMatrixOwnedDiag(hypre_AMGDDCompGridR(compGrid[level-1])); - offd = hypre_AMGDDCompGridMatrixOwnedOffd(hypre_AMGDDCompGridR(compGrid[level-1])); - R_row_size = hypre_CSRMatrixI(diag)[idx+1] - hypre_CSRMatrixI(diag)[idx] - + hypre_CSRMatrixI(offd)[idx+1] - hypre_CSRMatrixI(offd)[idx]; + diag = hypre_AMGDDCompGridMatrixOwnedDiag(hypre_AMGDDCompGridR(compGrid[level - 1])); + offd = hypre_AMGDDCompGridMatrixOwnedOffd(hypre_AMGDDCompGridR(compGrid[level - 1])); + R_row_size = hypre_CSRMatrixI(diag)[idx + 1] - hypre_CSRMatrixI(diag)[idx] + + hypre_CSRMatrixI(offd)[idx + 1] - hypre_CSRMatrixI(offd)[idx]; } } // Nonowned diag and offd @@ -2322,49 +2585,56 @@ hypre_BoomerAMGDD_CommunicateRemainingMatrixInfo( hypre_ParAMGDDData* amgdd_data // Count diag and offd diag = hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridA(compGrid[level])); offd = hypre_AMGDDCompGridMatrixNonOwnedOffd(hypre_AMGDDCompGridA(compGrid[level])); - A_row_size = hypre_CSRMatrixI(diag)[idx+1] - hypre_CSRMatrixI(diag)[idx] - + hypre_CSRMatrixI(offd)[idx+1] - hypre_CSRMatrixI(offd)[idx]; - if (level != num_levels-1) + A_row_size = hypre_CSRMatrixI(diag)[idx + 1] - hypre_CSRMatrixI(diag)[idx] + + hypre_CSRMatrixI(offd)[idx + 1] - hypre_CSRMatrixI(offd)[idx]; + if (level != num_levels - 1) { diag = hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridP(compGrid[level])); offd = hypre_AMGDDCompGridMatrixNonOwnedOffd(hypre_AMGDDCompGridP(compGrid[level])); - P_row_size = hypre_CSRMatrixI(diag)[idx+1] - hypre_CSRMatrixI(diag)[idx] - + hypre_CSRMatrixI(offd)[idx+1] - hypre_CSRMatrixI(offd)[idx]; + P_row_size = hypre_CSRMatrixI(diag)[idx + 1] - hypre_CSRMatrixI(diag)[idx] + + hypre_CSRMatrixI(offd)[idx + 1] - hypre_CSRMatrixI(offd)[idx]; } if (hypre_ParAMGDataRestriction(amg_data) && level != 0) { - diag = hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridR(compGrid[level-1])); - offd = hypre_AMGDDCompGridMatrixNonOwnedOffd(hypre_AMGDDCompGridR(compGrid[level-1])); - R_row_size = hypre_CSRMatrixI(diag)[idx+1] - hypre_CSRMatrixI(diag)[idx] - + hypre_CSRMatrixI(offd)[idx+1] - hypre_CSRMatrixI(offd)[idx]; + diag = hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridR(compGrid[level - 1])); + offd = hypre_AMGDDCompGridMatrixNonOwnedOffd(hypre_AMGDDCompGridR(compGrid[level - 1])); + R_row_size = hypre_CSRMatrixI(diag)[idx + 1] - hypre_CSRMatrixI(diag)[idx] + + hypre_CSRMatrixI(offd)[idx + 1] - hypre_CSRMatrixI(offd)[idx]; } } - send_sizes[2*proc] += A_row_size + P_row_size + R_row_size; - send_sizes[2*proc+1] += A_row_size + P_row_size + R_row_size; + send_sizes[2 * proc] += A_row_size + P_row_size + R_row_size; + send_sizes[2 * proc + 1] += A_row_size + P_row_size + R_row_size; } - if (level != num_levels-1) send_sizes[2*proc] += hypre_AMGDDCommPkgNumSendNodes(compGridCommPkg)[outer_level][proc][level]; - if (hypre_ParAMGDataRestriction(amg_data) && level != 0) send_sizes[2*proc] += hypre_AMGDDCommPkgNumSendNodes(compGridCommPkg)[outer_level][proc][level]; + if (level != num_levels - 1) { send_sizes[2 * proc] += hypre_AMGDDCommPkgNumSendNodes(compGridCommPkg)[outer_level][proc][level]; } + if (hypre_ParAMGDataRestriction(amg_data) && level != 0) { send_sizes[2 * proc] += hypre_AMGDDCommPkgNumSendNodes(compGridCommPkg)[outer_level][proc][level]; } } } HYPRE_Int **int_recv_buffers = hypre_CTAlloc(HYPRE_Int*, num_recv_procs, HYPRE_MEMORY_HOST); - HYPRE_Complex **complex_recv_buffers = hypre_CTAlloc(HYPRE_Complex*, num_recv_procs, HYPRE_MEMORY_HOST); + HYPRE_Complex **complex_recv_buffers = hypre_CTAlloc(HYPRE_Complex*, num_recv_procs, + HYPRE_MEMORY_HOST); // Communicate buffer sizes - hypre_MPI_Request *size_requests = hypre_CTAlloc(hypre_MPI_Request, num_send_procs + num_recv_procs, HYPRE_MEMORY_HOST); + hypre_MPI_Request *size_requests = hypre_CTAlloc(hypre_MPI_Request, num_send_procs + num_recv_procs, + HYPRE_MEMORY_HOST); HYPRE_Int request_cnt = 0; - hypre_MPI_Status *size_statuses = hypre_CTAlloc(hypre_MPI_Status, num_send_procs + num_recv_procs, HYPRE_MEMORY_HOST); - HYPRE_Int *recv_sizes = hypre_CTAlloc(HYPRE_Int, 2*num_recv_procs, HYPRE_MEMORY_HOST); + hypre_MPI_Status *size_statuses = hypre_CTAlloc(hypre_MPI_Status, num_send_procs + num_recv_procs, + HYPRE_MEMORY_HOST); + HYPRE_Int *recv_sizes = hypre_CTAlloc(HYPRE_Int, 2 * num_recv_procs, HYPRE_MEMORY_HOST); for (proc = 0; proc < num_recv_procs; proc++) { - hypre_MPI_Irecv(&(recv_sizes[2*proc]), 2, HYPRE_MPI_INT, recv_procs[proc], 1, hypre_MPI_COMM_WORLD, &(size_requests[request_cnt++])); + hypre_MPI_Irecv(&(recv_sizes[2 * proc]), 2, HYPRE_MPI_INT, recv_procs[proc], 1, + hypre_MPI_COMM_WORLD, + &(size_requests[request_cnt++])); } for (proc = 0; proc < num_send_procs; proc++) { - hypre_MPI_Isend(&(send_sizes[2*proc]), 2, HYPRE_MPI_INT, send_procs[proc], 1, hypre_MPI_COMM_WORLD, &(size_requests[request_cnt++])); + hypre_MPI_Isend(&(send_sizes[2 * proc]), 2, HYPRE_MPI_INT, send_procs[proc], 1, + hypre_MPI_COMM_WORLD, + &(size_requests[request_cnt++])); } //////////////////////////////////// @@ -2377,15 +2647,19 @@ hypre_BoomerAMGDD_CommunicateRemainingMatrixInfo( hypre_ParAMGDDData* amgdd_data // complex_send_buffer = [ [level] , [level] , ... , [level] ] // level = [ [A_data] , [P_data], ( [R_data] ) ] - hypre_MPI_Request *buf_requests = hypre_CTAlloc(hypre_MPI_Request, 2*(num_send_procs + num_recv_procs), HYPRE_MEMORY_HOST); + hypre_MPI_Request *buf_requests = hypre_CTAlloc(hypre_MPI_Request, + 2 * (num_send_procs + num_recv_procs), HYPRE_MEMORY_HOST); request_cnt = 0; - hypre_MPI_Status *buf_statuses = hypre_CTAlloc(hypre_MPI_Status, 2*(num_send_procs + num_recv_procs), HYPRE_MEMORY_HOST); + hypre_MPI_Status *buf_statuses = hypre_CTAlloc(hypre_MPI_Status, + 2 * (num_send_procs + num_recv_procs), HYPRE_MEMORY_HOST); HYPRE_Int **int_send_buffers = hypre_CTAlloc(HYPRE_Int*, num_send_procs, HYPRE_MEMORY_HOST); - HYPRE_Complex **complex_send_buffers = hypre_CTAlloc(HYPRE_Complex*, num_send_procs, HYPRE_MEMORY_HOST); + HYPRE_Complex **complex_send_buffers = hypre_CTAlloc(HYPRE_Complex*, num_send_procs, + HYPRE_MEMORY_HOST); for (proc = 0; proc < num_send_procs; proc++) { - int_send_buffers[proc] = hypre_CTAlloc(HYPRE_Int, send_sizes[2*proc], HYPRE_MEMORY_HOST); - complex_send_buffers[proc] = hypre_CTAlloc(HYPRE_Complex, send_sizes[2*proc+1], HYPRE_MEMORY_HOST); + int_send_buffers[proc] = hypre_CTAlloc(HYPRE_Int, send_sizes[2 * proc], HYPRE_MEMORY_HOST); + complex_send_buffers[proc] = hypre_CTAlloc(HYPRE_Complex, send_sizes[2 * proc + 1], + HYPRE_MEMORY_HOST); HYPRE_Int int_cnt = 0; HYPRE_Int complex_cnt = 0; @@ -2395,21 +2669,23 @@ hypre_BoomerAMGDD_CommunicateRemainingMatrixInfo( hypre_ParAMGDDData* amgdd_data for (i = 0; i < hypre_AMGDDCommPkgNumSendNodes(compGridCommPkg)[outer_level][proc][level]; i++) { HYPRE_Int idx = hypre_AMGDDCommPkgSendFlag(compGridCommPkg)[outer_level][proc][level][i]; - if (idx < 0) idx = -(idx + 1); + if (idx < 0) { idx = -(idx + 1); } // Owned diag and offd if (idx < hypre_AMGDDCompGridNumOwnedNodes(compGrid[level])) { diag = hypre_AMGDDCompGridMatrixOwnedDiag(hypre_AMGDDCompGridA(compGrid[level])); offd = hypre_AMGDDCompGridMatrixOwnedOffd(hypre_AMGDDCompGridA(compGrid[level])); - for (j = hypre_CSRMatrixI(diag)[idx]; j < hypre_CSRMatrixI(diag)[idx+1]; j++) + for (j = hypre_CSRMatrixI(diag)[idx]; j < hypre_CSRMatrixI(diag)[idx + 1]; j++) { - int_send_buffers[proc][int_cnt++] = hypre_CSRMatrixJ(diag)[j] + hypre_AMGDDCompGridFirstGlobalIndex(compGrid[level]); + int_send_buffers[proc][int_cnt++] = hypre_CSRMatrixJ(diag)[j] + hypre_AMGDDCompGridFirstGlobalIndex( + compGrid[level]); complex_send_buffers[proc][complex_cnt++] = hypre_CSRMatrixData(diag)[j]; } - for (j = hypre_CSRMatrixI(offd)[idx]; j < hypre_CSRMatrixI(offd)[idx+1]; j++) + for (j = hypre_CSRMatrixI(offd)[idx]; j < hypre_CSRMatrixI(offd)[idx + 1]; j++) { - int_send_buffers[proc][int_cnt++] = hypre_AMGDDCompGridNonOwnedGlobalIndices(compGrid[level])[ hypre_CSRMatrixJ(offd)[j] ]; + int_send_buffers[proc][int_cnt++] = hypre_AMGDDCompGridNonOwnedGlobalIndices( + compGrid[level])[ hypre_CSRMatrixJ(offd)[j] ]; complex_send_buffers[proc][complex_cnt++] = hypre_CSRMatrixData(offd)[j]; } } @@ -2420,40 +2696,42 @@ hypre_BoomerAMGDD_CommunicateRemainingMatrixInfo( hypre_ParAMGDDData* amgdd_data diag = hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridA(compGrid[level])); offd = hypre_AMGDDCompGridMatrixNonOwnedOffd(hypre_AMGDDCompGridA(compGrid[level])); - for (j = hypre_CSRMatrixI(diag)[idx]; j < hypre_CSRMatrixI(diag)[idx+1]; j++) + for (j = hypre_CSRMatrixI(diag)[idx]; j < hypre_CSRMatrixI(diag)[idx + 1]; j++) { - if (hypre_CSRMatrixJ(diag)[j] < 0) int_send_buffers[proc][int_cnt++] = -(hypre_CSRMatrixJ(diag)[j]+1); - else int_send_buffers[proc][int_cnt++] = hypre_AMGDDCompGridNonOwnedGlobalIndices(compGrid[level])[ hypre_CSRMatrixJ(diag)[j] ]; + if (hypre_CSRMatrixJ(diag)[j] < 0) { int_send_buffers[proc][int_cnt++] = -(hypre_CSRMatrixJ(diag)[j] + 1); } + else { int_send_buffers[proc][int_cnt++] = hypre_AMGDDCompGridNonOwnedGlobalIndices(compGrid[level])[ hypre_CSRMatrixJ(diag)[j] ]; } complex_send_buffers[proc][complex_cnt++] = hypre_CSRMatrixData(diag)[j]; } - for (j = hypre_CSRMatrixI(offd)[idx]; j < hypre_CSRMatrixI(offd)[idx+1]; j++) + for (j = hypre_CSRMatrixI(offd)[idx]; j < hypre_CSRMatrixI(offd)[idx + 1]; j++) { - int_send_buffers[proc][int_cnt++] = hypre_CSRMatrixJ(offd)[j] + hypre_AMGDDCompGridFirstGlobalIndex(compGrid[level]); + int_send_buffers[proc][int_cnt++] = hypre_CSRMatrixJ(offd)[j] + hypre_AMGDDCompGridFirstGlobalIndex( + compGrid[level]); complex_send_buffers[proc][complex_cnt++] = hypre_CSRMatrixData(offd)[j]; } } } // Pack P - if (level != num_levels-1) + if (level != num_levels - 1) { for (i = 0; i < hypre_AMGDDCommPkgNumSendNodes(compGridCommPkg)[outer_level][proc][level]; i++) { HYPRE_Int idx = hypre_AMGDDCommPkgSendFlag(compGridCommPkg)[outer_level][proc][level][i]; - if (idx < 0) idx = -(idx + 1); + if (idx < 0) { idx = -(idx + 1); } // Owned diag and offd if (idx < hypre_AMGDDCompGridNumOwnedNodes(compGrid[level])) { diag = hypre_AMGDDCompGridMatrixOwnedDiag(hypre_AMGDDCompGridP(compGrid[level])); offd = hypre_AMGDDCompGridMatrixOwnedOffd(hypre_AMGDDCompGridP(compGrid[level])); - int_send_buffers[proc][int_cnt++] = hypre_CSRMatrixI(diag)[idx+1] - hypre_CSRMatrixI(diag)[idx] - + hypre_CSRMatrixI(offd)[idx+1] - hypre_CSRMatrixI(offd)[idx]; - for (j = hypre_CSRMatrixI(diag)[idx]; j < hypre_CSRMatrixI(diag)[idx+1]; j++) + int_send_buffers[proc][int_cnt++] = hypre_CSRMatrixI(diag)[idx + 1] - hypre_CSRMatrixI(diag)[idx] + + hypre_CSRMatrixI(offd)[idx + 1] - hypre_CSRMatrixI(offd)[idx]; + for (j = hypre_CSRMatrixI(diag)[idx]; j < hypre_CSRMatrixI(diag)[idx + 1]; j++) { - int_send_buffers[proc][int_cnt++] = hypre_CSRMatrixJ(diag)[j] + hypre_AMGDDCompGridFirstGlobalIndex(compGrid[level+1]); + int_send_buffers[proc][int_cnt++] = hypre_CSRMatrixJ(diag)[j] + hypre_AMGDDCompGridFirstGlobalIndex( + compGrid[level + 1]); complex_send_buffers[proc][complex_cnt++] = hypre_CSRMatrixData(diag)[j]; } - for (j = hypre_CSRMatrixI(offd)[idx]; j < hypre_CSRMatrixI(offd)[idx+1]; j++) + for (j = hypre_CSRMatrixI(offd)[idx]; j < hypre_CSRMatrixI(offd)[idx + 1]; j++) { int_send_buffers[proc][int_cnt++] = hypre_CSRMatrixJ(offd)[j]; complex_send_buffers[proc][complex_cnt++] = hypre_CSRMatrixData(offd)[j]; @@ -2465,16 +2743,17 @@ hypre_BoomerAMGDD_CommunicateRemainingMatrixInfo( hypre_ParAMGDDData* amgdd_data idx -= hypre_AMGDDCompGridNumOwnedNodes(compGrid[level]); diag = hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridP(compGrid[level])); offd = hypre_AMGDDCompGridMatrixNonOwnedOffd(hypre_AMGDDCompGridP(compGrid[level])); - int_send_buffers[proc][int_cnt++] = hypre_CSRMatrixI(diag)[idx+1] - hypre_CSRMatrixI(diag)[idx] - + hypre_CSRMatrixI(offd)[idx+1] - hypre_CSRMatrixI(offd)[idx]; - for (j = hypre_CSRMatrixI(diag)[idx]; j < hypre_CSRMatrixI(diag)[idx+1]; j++) + int_send_buffers[proc][int_cnt++] = hypre_CSRMatrixI(diag)[idx + 1] - hypre_CSRMatrixI(diag)[idx] + + hypre_CSRMatrixI(offd)[idx + 1] - hypre_CSRMatrixI(offd)[idx]; + for (j = hypre_CSRMatrixI(diag)[idx]; j < hypre_CSRMatrixI(diag)[idx + 1]; j++) { int_send_buffers[proc][int_cnt++] = hypre_CSRMatrixJ(diag)[j]; complex_send_buffers[proc][complex_cnt++] = hypre_CSRMatrixData(diag)[j]; } - for (j = hypre_CSRMatrixI(offd)[idx]; j < hypre_CSRMatrixI(offd)[idx+1]; j++) + for (j = hypre_CSRMatrixI(offd)[idx]; j < hypre_CSRMatrixI(offd)[idx + 1]; j++) { - int_send_buffers[proc][int_cnt++] = hypre_CSRMatrixJ(offd)[j] + hypre_AMGDDCompGridFirstGlobalIndex(compGrid[level+1]); + int_send_buffers[proc][int_cnt++] = hypre_CSRMatrixJ(offd)[j] + hypre_AMGDDCompGridFirstGlobalIndex( + compGrid[level + 1]); complex_send_buffers[proc][complex_cnt++] = hypre_CSRMatrixData(offd)[j]; } } @@ -2486,21 +2765,22 @@ hypre_BoomerAMGDD_CommunicateRemainingMatrixInfo( hypre_ParAMGDDData* amgdd_data for (i = 0; i < hypre_AMGDDCommPkgNumSendNodes(compGridCommPkg)[outer_level][proc][level]; i++) { HYPRE_Int idx = hypre_AMGDDCommPkgSendFlag(compGridCommPkg)[outer_level][proc][level][i]; - if (idx < 0) idx = -(idx + 1); + if (idx < 0) { idx = -(idx + 1); } // Owned diag and offd if (idx < hypre_AMGDDCompGridNumOwnedNodes(compGrid[level])) { - diag = hypre_AMGDDCompGridMatrixOwnedDiag(hypre_AMGDDCompGridR(compGrid[level-1])); - offd = hypre_AMGDDCompGridMatrixOwnedOffd(hypre_AMGDDCompGridR(compGrid[level-1])); - int_send_buffers[proc][int_cnt++] = hypre_CSRMatrixI(diag)[idx+1] - hypre_CSRMatrixI(diag)[idx] - + hypre_CSRMatrixI(offd)[idx+1] - hypre_CSRMatrixI(offd)[idx]; - for (j = hypre_CSRMatrixI(diag)[idx]; j < hypre_CSRMatrixI(diag)[idx+1]; j++) + diag = hypre_AMGDDCompGridMatrixOwnedDiag(hypre_AMGDDCompGridR(compGrid[level - 1])); + offd = hypre_AMGDDCompGridMatrixOwnedOffd(hypre_AMGDDCompGridR(compGrid[level - 1])); + int_send_buffers[proc][int_cnt++] = hypre_CSRMatrixI(diag)[idx + 1] - hypre_CSRMatrixI(diag)[idx] + + hypre_CSRMatrixI(offd)[idx + 1] - hypre_CSRMatrixI(offd)[idx]; + for (j = hypre_CSRMatrixI(diag)[idx]; j < hypre_CSRMatrixI(diag)[idx + 1]; j++) { - int_send_buffers[proc][int_cnt++] = hypre_CSRMatrixJ(diag)[j] + hypre_AMGDDCompGridFirstGlobalIndex(compGrid[level-1]); + int_send_buffers[proc][int_cnt++] = hypre_CSRMatrixJ(diag)[j] + hypre_AMGDDCompGridFirstGlobalIndex( + compGrid[level - 1]); complex_send_buffers[proc][complex_cnt++] = hypre_CSRMatrixData(diag)[j]; } - for (j = hypre_CSRMatrixI(offd)[idx]; j < hypre_CSRMatrixI(offd)[idx+1]; j++) + for (j = hypre_CSRMatrixI(offd)[idx]; j < hypre_CSRMatrixI(offd)[idx + 1]; j++) { int_send_buffers[proc][int_cnt++] = hypre_CSRMatrixJ(offd)[j]; complex_send_buffers[proc][complex_cnt++] = hypre_CSRMatrixData(offd)[j]; @@ -2510,18 +2790,19 @@ hypre_BoomerAMGDD_CommunicateRemainingMatrixInfo( hypre_ParAMGDDData* amgdd_data else { idx -= hypre_AMGDDCompGridNumOwnedNodes(compGrid[level]); - diag = hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridR(compGrid[level-1])); - offd = hypre_AMGDDCompGridMatrixNonOwnedOffd(hypre_AMGDDCompGridR(compGrid[level-1])); - int_send_buffers[proc][int_cnt++] = hypre_CSRMatrixI(diag)[idx+1] - hypre_CSRMatrixI(diag)[idx] - + hypre_CSRMatrixI(offd)[idx+1] - hypre_CSRMatrixI(offd)[idx]; - for (j = hypre_CSRMatrixI(diag)[idx]; j < hypre_CSRMatrixI(diag)[idx+1]; j++) + diag = hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridR(compGrid[level - 1])); + offd = hypre_AMGDDCompGridMatrixNonOwnedOffd(hypre_AMGDDCompGridR(compGrid[level - 1])); + int_send_buffers[proc][int_cnt++] = hypre_CSRMatrixI(diag)[idx + 1] - hypre_CSRMatrixI(diag)[idx] + + hypre_CSRMatrixI(offd)[idx + 1] - hypre_CSRMatrixI(offd)[idx]; + for (j = hypre_CSRMatrixI(diag)[idx]; j < hypre_CSRMatrixI(diag)[idx + 1]; j++) { int_send_buffers[proc][int_cnt++] = hypre_CSRMatrixJ(diag)[j]; complex_send_buffers[proc][complex_cnt++] = hypre_CSRMatrixData(diag)[j]; } - for (j = hypre_CSRMatrixI(offd)[idx]; j < hypre_CSRMatrixI(offd)[idx+1]; j++) + for (j = hypre_CSRMatrixI(offd)[idx]; j < hypre_CSRMatrixI(offd)[idx + 1]; j++) { - int_send_buffers[proc][int_cnt++] = hypre_CSRMatrixJ(offd)[j] + hypre_AMGDDCompGridFirstGlobalIndex(compGrid[level-1]); + int_send_buffers[proc][int_cnt++] = hypre_CSRMatrixJ(offd)[j] + hypre_AMGDDCompGridFirstGlobalIndex( + compGrid[level - 1]); complex_send_buffers[proc][complex_cnt++] = hypre_CSRMatrixData(offd)[j]; } } @@ -2536,8 +2817,10 @@ hypre_BoomerAMGDD_CommunicateRemainingMatrixInfo( hypre_ParAMGDDData* amgdd_data for (proc = 0; proc < num_send_procs; proc++) { - hypre_MPI_Isend(int_send_buffers[proc], send_sizes[2*proc], HYPRE_MPI_INT, send_procs[proc], 2, hypre_MPI_COMM_WORLD, &(buf_requests[request_cnt++])); - hypre_MPI_Isend(complex_send_buffers[proc], send_sizes[2*proc+1], HYPRE_MPI_COMPLEX, send_procs[proc], 3, hypre_MPI_COMM_WORLD, &(buf_requests[request_cnt++])); + hypre_MPI_Isend(int_send_buffers[proc], send_sizes[2 * proc], HYPRE_MPI_INT, send_procs[proc], 2, + hypre_MPI_COMM_WORLD, &(buf_requests[request_cnt++])); + hypre_MPI_Isend(complex_send_buffers[proc], send_sizes[2 * proc + 1], HYPRE_MPI_COMPLEX, + send_procs[proc], 3, hypre_MPI_COMM_WORLD, &(buf_requests[request_cnt++])); } // Wait on buffer sizes @@ -2546,17 +2829,20 @@ hypre_BoomerAMGDD_CommunicateRemainingMatrixInfo( hypre_ParAMGDDData* amgdd_data // Allocate and post recvs for (proc = 0; proc < num_recv_procs; proc++) { - int_recv_buffers[proc] = hypre_CTAlloc(HYPRE_Int, recv_sizes[2*proc], HYPRE_MEMORY_HOST); - complex_recv_buffers[proc] = hypre_CTAlloc(HYPRE_Complex, recv_sizes[2*proc+1], HYPRE_MEMORY_HOST); - hypre_MPI_Irecv(int_recv_buffers[proc], recv_sizes[2*proc], HYPRE_MPI_INT, recv_procs[proc], 2, hypre_MPI_COMM_WORLD, &(buf_requests[request_cnt++])); - hypre_MPI_Irecv(complex_recv_buffers[proc], recv_sizes[2*proc+1], HYPRE_MPI_COMPLEX, recv_procs[proc], 3, hypre_MPI_COMM_WORLD, &(buf_requests[request_cnt++])); + int_recv_buffers[proc] = hypre_CTAlloc(HYPRE_Int, recv_sizes[2 * proc], HYPRE_MEMORY_HOST); + complex_recv_buffers[proc] = hypre_CTAlloc(HYPRE_Complex, recv_sizes[2 * proc + 1], + HYPRE_MEMORY_HOST); + hypre_MPI_Irecv(int_recv_buffers[proc], recv_sizes[2 * proc], HYPRE_MPI_INT, recv_procs[proc], 2, + hypre_MPI_COMM_WORLD, &(buf_requests[request_cnt++])); + hypre_MPI_Irecv(complex_recv_buffers[proc], recv_sizes[2 * proc + 1], HYPRE_MPI_COMPLEX, + recv_procs[proc], 3, hypre_MPI_COMM_WORLD, &(buf_requests[request_cnt++])); } // Wait on buffers - hypre_MPI_Waitall( 2*(num_send_procs + num_recv_procs), buf_requests, buf_statuses ); + hypre_MPI_Waitall( 2 * (num_send_procs + num_recv_procs), buf_requests, buf_statuses ); - for (proc = 0; proc < num_send_procs; proc++) hypre_TFree(int_send_buffers[proc], HYPRE_MEMORY_HOST); - for (proc = 0; proc < num_send_procs; proc++) hypre_TFree(complex_send_buffers[proc], HYPRE_MEMORY_HOST); + for (proc = 0; proc < num_send_procs; proc++) { hypre_TFree(int_send_buffers[proc], HYPRE_MEMORY_HOST); } + for (proc = 0; proc < num_send_procs; proc++) { hypre_TFree(complex_send_buffers[proc], HYPRE_MEMORY_HOST); } hypre_TFree(int_send_buffers, HYPRE_MEMORY_HOST); hypre_TFree(complex_send_buffers, HYPRE_MEMORY_HOST); hypre_TFree(size_requests, HYPRE_MEMORY_HOST); @@ -2565,28 +2851,34 @@ hypre_BoomerAMGDD_CommunicateRemainingMatrixInfo( hypre_ParAMGDDData* amgdd_data hypre_TFree(buf_statuses, HYPRE_MEMORY_HOST); // P_tmp_info[buffer_number] = [ size, [row], size, [row], ... ] - HYPRE_Int **P_tmp_info_int; - HYPRE_Complex **P_tmp_info_complex; + HYPRE_Int **P_tmp_info_int = NULL; + HYPRE_Complex **P_tmp_info_complex = NULL; HYPRE_Int P_tmp_info_size = 0; HYPRE_Int P_tmp_info_cnt = 0; - if (outer_level != num_levels-1) + if (outer_level != num_levels - 1) { for (proc = 0; proc < num_recv_procs; proc++) + { P_tmp_info_size += hypre_AMGDDCommPkgNumRecvNodes(compGridCommPkg)[outer_level][proc][outer_level]; - P_tmp_info_size -= hypre_CSRMatrixNumCols(hypre_AMGDDCompGridMatrixOwnedOffd(hypre_AMGDDCompGridA(compGrid[outer_level]))); + } + P_tmp_info_size -= hypre_CSRMatrixNumCols(hypre_AMGDDCompGridMatrixOwnedOffd(hypre_AMGDDCompGridA( + compGrid[outer_level]))); P_tmp_info_int = hypre_CTAlloc(HYPRE_Int*, P_tmp_info_size, HYPRE_MEMORY_HOST); P_tmp_info_complex = hypre_CTAlloc(HYPRE_Complex*, P_tmp_info_size, HYPRE_MEMORY_HOST); } // R_tmp_info[buffer_number] = [ size, [row], size, [row], ... ] - HYPRE_Int **R_tmp_info_int; - HYPRE_Complex **R_tmp_info_complex; + HYPRE_Int **R_tmp_info_int = NULL; + HYPRE_Complex **R_tmp_info_complex = NULL; HYPRE_Int R_tmp_info_size = 0; HYPRE_Int R_tmp_info_cnt = 0; if (hypre_ParAMGDataRestriction(amg_data) && outer_level != 0) { for (proc = 0; proc < num_recv_procs; proc++) + { R_tmp_info_size += hypre_AMGDDCommPkgNumRecvNodes(compGridCommPkg)[outer_level][proc][outer_level]; - R_tmp_info_size -= hypre_CSRMatrixNumCols(hypre_AMGDDCompGridMatrixOwnedOffd(hypre_AMGDDCompGridA(compGrid[outer_level]))); + } + R_tmp_info_size -= hypre_CSRMatrixNumCols(hypre_AMGDDCompGridMatrixOwnedOffd(hypre_AMGDDCompGridA( + compGrid[outer_level]))); R_tmp_info_int = hypre_CTAlloc(HYPRE_Int*, R_tmp_info_size, HYPRE_MEMORY_HOST); R_tmp_info_complex = hypre_CTAlloc(HYPRE_Complex*, R_tmp_info_size, HYPRE_MEMORY_HOST); } @@ -2606,7 +2898,7 @@ hypre_BoomerAMGDD_CommunicateRemainingMatrixInfo( hypre_ParAMGDDData* amgdd_data { HYPRE_Int idx = hypre_AMGDDCommPkgRecvMap(compGridCommPkg)[outer_level][proc][level][i]; - if (idx < 0) idx = -(idx + 1); + if (idx < 0) { idx = -(idx + 1); } // !!! Optimization: I send (and setup) A info twice for ghosts overwritten as real // Unpack A data @@ -2615,12 +2907,14 @@ hypre_BoomerAMGDD_CommunicateRemainingMatrixInfo( hypre_ParAMGDDData* amgdd_data HYPRE_Int diag_rowptr = hypre_CSRMatrixI(diag)[idx]; HYPRE_Int offd_rowptr = hypre_CSRMatrixI(offd)[idx]; - while (diag_rowptr < hypre_CSRMatrixI(diag)[idx+1] || offd_rowptr < hypre_CSRMatrixI(offd)[idx+1]) + while (diag_rowptr < hypre_CSRMatrixI(diag)[idx + 1] || + offd_rowptr < hypre_CSRMatrixI(offd)[idx + 1]) { HYPRE_Int incoming_index = int_recv_buffers[proc][int_cnt++]; // See whether global index is owned - if (incoming_index >= hypre_AMGDDCompGridFirstGlobalIndex(compGrid[level]) && incoming_index <= hypre_AMGDDCompGridLastGlobalIndex(compGrid[level])) + if (incoming_index >= hypre_AMGDDCompGridFirstGlobalIndex(compGrid[level]) && + incoming_index <= hypre_AMGDDCompGridLastGlobalIndex(compGrid[level])) { // Don't overwrite data if already accounted for (ordering can change and screw things up) if (level == outer_level || idx == A_row_cnt[level]) @@ -2647,13 +2941,13 @@ hypre_BoomerAMGDD_CommunicateRemainingMatrixInfo( hypre_ParAMGDDData* amgdd_data } } } - if (level != outer_level && idx == A_row_cnt[level]) A_row_cnt[level]++; + if (level != outer_level && idx == A_row_cnt[level]) { A_row_cnt[level]++; } } - if (level == outer_level) A_row_cnt[level] += hypre_AMGDDCommPkgNumRecvNodes(compGridCommPkg)[outer_level][proc][level]; + if (level == outer_level) { A_row_cnt[level] += hypre_AMGDDCommPkgNumRecvNodes(compGridCommPkg)[outer_level][proc][level]; } // Unpack P data and col indices - if (level != num_levels-1) + if (level != num_levels - 1) { diag = hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridP(compGrid[level])); offd = hypre_AMGDDCompGridMatrixNonOwnedOffd(hypre_AMGDDCompGridP(compGrid[level])); @@ -2661,7 +2955,7 @@ hypre_BoomerAMGDD_CommunicateRemainingMatrixInfo( hypre_ParAMGDDData* amgdd_data for (i = 0; i < hypre_AMGDDCommPkgNumRecvNodes(compGridCommPkg)[outer_level][proc][level]; i++) { HYPRE_Int idx = hypre_AMGDDCommPkgRecvMap(compGridCommPkg)[outer_level][proc][level][i]; - if (idx < 0) idx = -(idx + 1); + if (idx < 0) { idx = -(idx + 1); } // Setup orig commPkg recv dofs if (idx == P_row_cnt[level]) @@ -2676,25 +2970,33 @@ hypre_BoomerAMGDD_CommunicateRemainingMatrixInfo( hypre_ParAMGDDData* amgdd_data HYPRE_Int incoming_index = int_recv_buffers[proc][int_cnt++]; // See whether global index is owned - if (incoming_index >= hypre_AMGDDCompGridFirstGlobalIndex(compGrid[level+1]) && incoming_index <= hypre_AMGDDCompGridLastGlobalIndex(compGrid[level+1])) + if (incoming_index >= hypre_AMGDDCompGridFirstGlobalIndex(compGrid[level + 1]) && + incoming_index <= hypre_AMGDDCompGridLastGlobalIndex(compGrid[level + 1])) { if (offd_rowptr >= hypre_CSRMatrixNumNonzeros(offd)) - hypre_CSRMatrixResize(offd, hypre_CSRMatrixNumRows(offd), hypre_CSRMatrixNumCols(offd), ceil(1.5*hypre_CSRMatrixNumNonzeros(offd) + 1)); - hypre_CSRMatrixJ(offd)[offd_rowptr] = incoming_index - hypre_AMGDDCompGridFirstGlobalIndex(compGrid[level+1]); + { + hypre_CSRMatrixResize(offd, hypre_CSRMatrixNumRows(offd), hypre_CSRMatrixNumCols(offd), + (HYPRE_Int)hypre_ceil(1.5 * hypre_CSRMatrixNumNonzeros(offd) + 1)); + } + hypre_CSRMatrixJ(offd)[offd_rowptr] = incoming_index - hypre_AMGDDCompGridFirstGlobalIndex( + compGrid[level + 1]); hypre_CSRMatrixData(offd)[offd_rowptr] = complex_recv_buffers[proc][complex_cnt++]; offd_rowptr++; } else { if (diag_rowptr >= hypre_CSRMatrixNumNonzeros(diag)) - hypre_CSRMatrixResize(diag, hypre_CSRMatrixNumRows(diag), hypre_CSRMatrixNumCols(diag), ceil(1.5*hypre_CSRMatrixNumNonzeros(diag) + 1)); + { + hypre_CSRMatrixResize(diag, hypre_CSRMatrixNumRows(diag), hypre_CSRMatrixNumCols(diag), + (HYPRE_Int)hypre_ceil(1.5 * hypre_CSRMatrixNumNonzeros(diag) + 1)); + } hypre_CSRMatrixJ(diag)[diag_rowptr] = incoming_index; hypre_CSRMatrixData(diag)[diag_rowptr] = complex_recv_buffers[proc][complex_cnt++]; diag_rowptr++; } } - hypre_CSRMatrixI(diag)[idx+1] = diag_rowptr; - hypre_CSRMatrixI(offd)[idx+1] = offd_rowptr; + hypre_CSRMatrixI(diag)[idx + 1] = diag_rowptr; + hypre_CSRMatrixI(offd)[idx + 1] = offd_rowptr; P_row_cnt[level]++; } @@ -2702,12 +3004,12 @@ hypre_BoomerAMGDD_CommunicateRemainingMatrixInfo( hypre_ParAMGDDData* amgdd_data else if (level == outer_level) { HYPRE_Int row_size = int_recv_buffers[proc][int_cnt++]; - P_tmp_info_int[P_tmp_info_cnt] = hypre_CTAlloc(HYPRE_Int, row_size+1, HYPRE_MEMORY_HOST); + P_tmp_info_int[P_tmp_info_cnt] = hypre_CTAlloc(HYPRE_Int, row_size + 1, HYPRE_MEMORY_HOST); P_tmp_info_complex[P_tmp_info_cnt] = hypre_CTAlloc(HYPRE_Complex, row_size, HYPRE_MEMORY_HOST); P_tmp_info_int[P_tmp_info_cnt][0] = row_size; for (j = 0; j < row_size; j++) { - P_tmp_info_int[P_tmp_info_cnt][j+1] = int_recv_buffers[proc][int_cnt++]; + P_tmp_info_int[P_tmp_info_cnt][j + 1] = int_recv_buffers[proc][int_cnt++]; P_tmp_info_complex[P_tmp_info_cnt][j] = complex_recv_buffers[proc][complex_cnt++]; } P_tmp_info_cnt++; @@ -2727,16 +3029,16 @@ hypre_BoomerAMGDD_CommunicateRemainingMatrixInfo( hypre_ParAMGDDData* amgdd_data // Unpack R data and col indices if (hypre_ParAMGDataRestriction(amg_data) && level != 0) { - diag = hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridR(compGrid[level-1])); - offd = hypre_AMGDDCompGridMatrixNonOwnedOffd(hypre_AMGDDCompGridR(compGrid[level-1])); + diag = hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridR(compGrid[level - 1])); + offd = hypre_AMGDDCompGridMatrixNonOwnedOffd(hypre_AMGDDCompGridR(compGrid[level - 1])); for (i = 0; i < hypre_AMGDDCommPkgNumRecvNodes(compGridCommPkg)[outer_level][proc][level]; i++) { HYPRE_Int idx = hypre_AMGDDCommPkgRecvMap(compGridCommPkg)[outer_level][proc][level][i]; - if (idx < 0) idx = -(idx + 1); + if (idx < 0) { idx = -(idx + 1); } // Setup orig commPkg recv dofs - if (idx == R_row_cnt[level-1]) + if (idx == R_row_cnt[level - 1]) { HYPRE_Int row_size = int_recv_buffers[proc][int_cnt++]; @@ -2748,38 +3050,46 @@ hypre_BoomerAMGDD_CommunicateRemainingMatrixInfo( hypre_ParAMGDDData* amgdd_data HYPRE_Int incoming_index = int_recv_buffers[proc][int_cnt++]; // See whether global index is owned - if (incoming_index >= hypre_AMGDDCompGridFirstGlobalIndex(compGrid[level-1]) && incoming_index <= hypre_AMGDDCompGridLastGlobalIndex(compGrid[level-1])) + if (incoming_index >= hypre_AMGDDCompGridFirstGlobalIndex(compGrid[level - 1]) && + incoming_index <= hypre_AMGDDCompGridLastGlobalIndex(compGrid[level - 1])) { if (offd_rowptr >= hypre_CSRMatrixNumNonzeros(offd)) - hypre_CSRMatrixResize(offd, hypre_CSRMatrixNumRows(offd), hypre_CSRMatrixNumCols(offd), ceil(1.5*hypre_CSRMatrixNumNonzeros(offd) + 1)); - hypre_CSRMatrixJ(offd)[offd_rowptr] = incoming_index - hypre_AMGDDCompGridFirstGlobalIndex(compGrid[level-1]); + { + hypre_CSRMatrixResize(offd, hypre_CSRMatrixNumRows(offd), hypre_CSRMatrixNumCols(offd), + (HYPRE_Int)hypre_ceil(1.5 * hypre_CSRMatrixNumNonzeros(offd) + 1)); + } + hypre_CSRMatrixJ(offd)[offd_rowptr] = incoming_index - hypre_AMGDDCompGridFirstGlobalIndex( + compGrid[level - 1]); hypre_CSRMatrixData(offd)[offd_rowptr] = complex_recv_buffers[proc][complex_cnt++]; offd_rowptr++; } else { if (diag_rowptr >= hypre_CSRMatrixNumNonzeros(diag)) - hypre_CSRMatrixResize(diag, hypre_CSRMatrixNumRows(diag), hypre_CSRMatrixNumCols(diag), ceil(1.5*hypre_CSRMatrixNumNonzeros(diag) + 1)); + { + hypre_CSRMatrixResize(diag, hypre_CSRMatrixNumRows(diag), hypre_CSRMatrixNumCols(diag), + (HYPRE_Int)hypre_ceil(1.5 * hypre_CSRMatrixNumNonzeros(diag) + 1)); + } hypre_CSRMatrixJ(diag)[diag_rowptr] = incoming_index; hypre_CSRMatrixData(diag)[diag_rowptr] = complex_recv_buffers[proc][complex_cnt++]; diag_rowptr++; } } - hypre_CSRMatrixI(diag)[idx+1] = diag_rowptr; - hypre_CSRMatrixI(offd)[idx+1] = offd_rowptr; + hypre_CSRMatrixI(diag)[idx + 1] = diag_rowptr; + hypre_CSRMatrixI(offd)[idx + 1] = offd_rowptr; - R_row_cnt[level-1]++; + R_row_cnt[level - 1]++; } // Store info for later setup on current outer level else if (level == outer_level) { HYPRE_Int row_size = int_recv_buffers[proc][int_cnt++]; - R_tmp_info_int[R_tmp_info_cnt] = hypre_CTAlloc(HYPRE_Int, row_size+1, HYPRE_MEMORY_HOST); + R_tmp_info_int[R_tmp_info_cnt] = hypre_CTAlloc(HYPRE_Int, row_size + 1, HYPRE_MEMORY_HOST); R_tmp_info_complex[R_tmp_info_cnt] = hypre_CTAlloc(HYPRE_Complex, row_size, HYPRE_MEMORY_HOST); R_tmp_info_int[R_tmp_info_cnt][0] = row_size; for (j = 0; j < row_size; j++) { - R_tmp_info_int[R_tmp_info_cnt][j+1] = int_recv_buffers[proc][int_cnt++]; + R_tmp_info_int[R_tmp_info_cnt][j + 1] = int_recv_buffers[proc][int_cnt++]; R_tmp_info_complex[R_tmp_info_cnt][j] = complex_recv_buffers[proc][complex_cnt++]; } R_tmp_info_cnt++; @@ -2800,7 +3110,7 @@ hypre_BoomerAMGDD_CommunicateRemainingMatrixInfo( hypre_ParAMGDDData* amgdd_data } // Setup temporary info for P on current level - if (outer_level != num_levels-1) + if (outer_level != num_levels - 1) { diag = hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridP(compGrid[outer_level])); offd = hypre_AMGDDCompGridMatrixNonOwnedOffd(hypre_AMGDDCompGridP(compGrid[outer_level])); @@ -2815,29 +3125,37 @@ hypre_BoomerAMGDD_CommunicateRemainingMatrixInfo( hypre_ParAMGDDData* amgdd_data HYPRE_Int row_size = P_tmp_info_int[i][0]; for (j = 0; j < row_size; j++) { - HYPRE_Int incoming_index = P_tmp_info_int[i][j+1]; + HYPRE_Int incoming_index = P_tmp_info_int[i][j + 1]; // See whether global index is owned - if (incoming_index >= hypre_AMGDDCompGridFirstGlobalIndex(compGrid[outer_level+1]) && incoming_index <= hypre_AMGDDCompGridLastGlobalIndex(compGrid[outer_level+1])) + if (incoming_index >= hypre_AMGDDCompGridFirstGlobalIndex(compGrid[outer_level + 1]) && + incoming_index <= hypre_AMGDDCompGridLastGlobalIndex(compGrid[outer_level + 1])) { if (offd_rowptr >= hypre_CSRMatrixNumNonzeros(offd)) - hypre_CSRMatrixResize(offd, hypre_CSRMatrixNumRows(offd), hypre_CSRMatrixNumCols(offd), ceil(1.5*hypre_CSRMatrixNumNonzeros(offd) + 1)); - hypre_CSRMatrixJ(offd)[offd_rowptr] = incoming_index - hypre_AMGDDCompGridFirstGlobalIndex(compGrid[outer_level+1]); + { + hypre_CSRMatrixResize(offd, hypre_CSRMatrixNumRows(offd), hypre_CSRMatrixNumCols(offd), + (HYPRE_Int)hypre_ceil(1.5 * hypre_CSRMatrixNumNonzeros(offd) + 1)); + } + hypre_CSRMatrixJ(offd)[offd_rowptr] = incoming_index - hypre_AMGDDCompGridFirstGlobalIndex( + compGrid[outer_level + 1]); hypre_CSRMatrixData(offd)[offd_rowptr] = P_tmp_info_complex[i][j]; offd_rowptr++; } else { if (diag_rowptr >= hypre_CSRMatrixNumNonzeros(diag)) - hypre_CSRMatrixResize(diag, hypre_CSRMatrixNumRows(diag), hypre_CSRMatrixNumCols(diag), ceil(1.5*hypre_CSRMatrixNumNonzeros(diag) + 1)); + { + hypre_CSRMatrixResize(diag, hypre_CSRMatrixNumRows(diag), hypre_CSRMatrixNumCols(diag), + (HYPRE_Int)hypre_ceil(1.5 * hypre_CSRMatrixNumNonzeros(diag) + 1)); + } hypre_CSRMatrixJ(diag)[diag_rowptr] = incoming_index; hypre_CSRMatrixData(diag)[diag_rowptr] = P_tmp_info_complex[i][j]; diag_rowptr++; } } - hypre_CSRMatrixI(diag)[P_row_cnt[outer_level]+1] = diag_rowptr; - hypre_CSRMatrixI(offd)[P_row_cnt[outer_level]+1] = offd_rowptr; + hypre_CSRMatrixI(diag)[P_row_cnt[outer_level] + 1] = diag_rowptr; + hypre_CSRMatrixI(offd)[P_row_cnt[outer_level] + 1] = offd_rowptr; P_row_cnt[outer_level]++; hypre_TFree(P_tmp_info_int[i], HYPRE_MEMORY_HOST); @@ -2851,11 +3169,11 @@ hypre_BoomerAMGDD_CommunicateRemainingMatrixInfo( hypre_ParAMGDDData* amgdd_data // Setup temporary info for R on current level if (hypre_ParAMGDataRestriction(amg_data) && outer_level != 0) { - diag = hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridR(compGrid[outer_level-1])); - offd = hypre_AMGDDCompGridMatrixNonOwnedOffd(hypre_AMGDDCompGridR(compGrid[outer_level-1])); + diag = hypre_AMGDDCompGridMatrixNonOwnedDiag(hypre_AMGDDCompGridR(compGrid[outer_level - 1])); + offd = hypre_AMGDDCompGridMatrixNonOwnedOffd(hypre_AMGDDCompGridR(compGrid[outer_level - 1])); - HYPRE_Int diag_rowptr = hypre_CSRMatrixI(diag)[ R_row_cnt[outer_level-1] ]; - HYPRE_Int offd_rowptr = hypre_CSRMatrixI(offd)[ R_row_cnt[outer_level-1] ]; + HYPRE_Int diag_rowptr = hypre_CSRMatrixI(diag)[ R_row_cnt[outer_level - 1] ]; + HYPRE_Int offd_rowptr = hypre_CSRMatrixI(offd)[ R_row_cnt[outer_level - 1] ]; for (i = 0; i < R_tmp_info_size; i++) { @@ -2864,30 +3182,38 @@ hypre_BoomerAMGDD_CommunicateRemainingMatrixInfo( hypre_ParAMGDDData* amgdd_data HYPRE_Int row_size = R_tmp_info_int[i][0]; for (j = 0; j < row_size; j++) { - HYPRE_Int incoming_index = R_tmp_info_int[i][j+1]; + HYPRE_Int incoming_index = R_tmp_info_int[i][j + 1]; // See whether global index is owned - if (incoming_index >= hypre_AMGDDCompGridFirstGlobalIndex(compGrid[outer_level-1]) && incoming_index <= hypre_AMGDDCompGridLastGlobalIndex(compGrid[outer_level-1])) + if (incoming_index >= hypre_AMGDDCompGridFirstGlobalIndex(compGrid[outer_level - 1]) && + incoming_index <= hypre_AMGDDCompGridLastGlobalIndex(compGrid[outer_level - 1])) { if (offd_rowptr >= hypre_CSRMatrixNumNonzeros(offd)) - hypre_CSRMatrixResize(offd, hypre_CSRMatrixNumRows(offd), hypre_CSRMatrixNumCols(offd), ceil(1.5*hypre_CSRMatrixNumNonzeros(offd) + 1)); - hypre_CSRMatrixJ(offd)[offd_rowptr] = incoming_index - hypre_AMGDDCompGridFirstGlobalIndex(compGrid[outer_level-1]); + { + hypre_CSRMatrixResize(offd, hypre_CSRMatrixNumRows(offd), hypre_CSRMatrixNumCols(offd), + (HYPRE_Int)hypre_ceil(1.5 * hypre_CSRMatrixNumNonzeros(offd) + 1)); + } + hypre_CSRMatrixJ(offd)[offd_rowptr] = incoming_index - hypre_AMGDDCompGridFirstGlobalIndex( + compGrid[outer_level - 1]); hypre_CSRMatrixData(offd)[offd_rowptr] = R_tmp_info_complex[i][j]; offd_rowptr++; } else { if (diag_rowptr >= hypre_CSRMatrixNumNonzeros(diag)) - hypre_CSRMatrixResize(diag, hypre_CSRMatrixNumRows(diag), hypre_CSRMatrixNumCols(diag), ceil(1.5*hypre_CSRMatrixNumNonzeros(diag) + 1)); + { + hypre_CSRMatrixResize(diag, hypre_CSRMatrixNumRows(diag), hypre_CSRMatrixNumCols(diag), + (HYPRE_Int)hypre_ceil(1.5 * hypre_CSRMatrixNumNonzeros(diag) + 1)); + } hypre_CSRMatrixJ(diag)[diag_rowptr] = incoming_index; hypre_CSRMatrixData(diag)[diag_rowptr] = R_tmp_info_complex[i][j]; diag_rowptr++; } } - hypre_CSRMatrixI(diag)[R_row_cnt[outer_level-1]+1] = diag_rowptr; - hypre_CSRMatrixI(offd)[R_row_cnt[outer_level-1]+1] = offd_rowptr; - R_row_cnt[outer_level-1]++; + hypre_CSRMatrixI(diag)[R_row_cnt[outer_level - 1] + 1] = diag_rowptr; + hypre_CSRMatrixI(offd)[R_row_cnt[outer_level - 1] + 1] = offd_rowptr; + R_row_cnt[outer_level - 1]++; hypre_TFree(R_tmp_info_int[i], HYPRE_MEMORY_HOST); hypre_TFree(R_tmp_info_complex[i], HYPRE_MEMORY_HOST); @@ -2899,8 +3225,8 @@ hypre_BoomerAMGDD_CommunicateRemainingMatrixInfo( hypre_ParAMGDDData* amgdd_data } // Clean up memory - for (proc = 0; proc < num_recv_procs; proc++) hypre_TFree(int_recv_buffers[proc], HYPRE_MEMORY_HOST); - for (proc = 0; proc < num_recv_procs; proc++) hypre_TFree(complex_recv_buffers[proc], HYPRE_MEMORY_HOST); + for (proc = 0; proc < num_recv_procs; proc++) { hypre_TFree(int_recv_buffers[proc], HYPRE_MEMORY_HOST); } + for (proc = 0; proc < num_recv_procs; proc++) { hypre_TFree(complex_recv_buffers[proc], HYPRE_MEMORY_HOST); } hypre_TFree(int_recv_buffers, HYPRE_MEMORY_HOST); hypre_TFree(complex_recv_buffers, HYPRE_MEMORY_HOST); hypre_TFree(send_sizes, HYPRE_MEMORY_HOST); @@ -2935,7 +3261,7 @@ hypre_BoomerAMGDD_FixUpRecvMaps( hypre_AMGDDCompGrid **compGrid, // Get rid of redundant recvs and index from beginning of nonowned (instead of owned) if (compGridCommPkg) { - recv_red_marker = hypre_AMGDDCommPkgRecvRedMarker(compGridCommPkg); + recv_red_marker = hypre_AMGDDCommPkgRecvRedMarker(compGridCommPkg); for (level = start_level; level < num_levels; level++) { @@ -2972,14 +3298,16 @@ hypre_BoomerAMGDD_FixUpRecvMaps( hypre_AMGDDCompGrid **compGrid, { map_val -= hypre_AMGDDCompGridNumOwnedNodes(compGrid[inner_level]); } - hypre_AMGDDCommPkgRecvMap(compGridCommPkg)[level][proc][inner_level][ hypre_AMGDDCommPkgNumRecvNodes(compGridCommPkg)[level][proc][inner_level]++ ] = map_val; + hypre_AMGDDCommPkgRecvMap( + compGridCommPkg)[level][proc][inner_level][ hypre_AMGDDCommPkgNumRecvNodes( + compGridCommPkg)[level][proc][inner_level]++ ] = map_val; } } hypre_AMGDDCommPkgRecvMap(compGridCommPkg)[level][proc][inner_level] = - hypre_TReAlloc(hypre_AMGDDCommPkgRecvMap(compGridCommPkg)[level][proc][inner_level], - HYPRE_Int, - hypre_AMGDDCommPkgNumRecvNodes(compGridCommPkg)[level][proc][inner_level], - HYPRE_MEMORY_HOST); + hypre_TReAlloc(hypre_AMGDDCommPkgRecvMap(compGridCommPkg)[level][proc][inner_level], + HYPRE_Int, + hypre_AMGDDCommPkgNumRecvNodes(compGridCommPkg)[level][proc][inner_level], + HYPRE_MEMORY_HOST); } } } diff --git a/external/hypre/src/parcsr_ls/par_amgdd_setup.c b/external/hypre/src/parcsr_ls/par_amgdd_setup.c index 6c9ccc43..a8440738 100644 --- a/external/hypre/src/parcsr_ls/par_amgdd_setup.c +++ b/external/hypre/src/parcsr_ls/par_amgdd_setup.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -24,7 +24,7 @@ hypre_BoomerAMGDDSetup( void *amgdd_vdata, hypre_ParVector *b, hypre_ParVector *x ) { - MPI_Comm comm; + MPI_Comm comm; hypre_ParAMGDDData *amgdd_data = (hypre_ParAMGDDData*) amgdd_vdata; hypre_ParAMGData *amg_data = hypre_ParAMGDDDataAMG(amgdd_data); @@ -49,12 +49,12 @@ hypre_BoomerAMGDDSetup( void *amgdd_vdata, HYPRE_Int ****send_flag; HYPRE_Int ****recv_map; HYPRE_Int ****recv_red_marker; - HYPRE_Int **send_buffer; - HYPRE_Int **recv_buffer; - HYPRE_Int **send_flag_buffer; - HYPRE_Int **recv_map_send_buffer; - HYPRE_Int *send_flag_buffer_size; - HYPRE_Int *recv_map_send_buffer_size; + HYPRE_Int **send_buffer = NULL; + HYPRE_Int **recv_buffer = NULL; + HYPRE_Int **send_flag_buffer = NULL; + HYPRE_Int **recv_map_send_buffer = NULL; + HYPRE_Int *send_flag_buffer_size = NULL; + HYPRE_Int *recv_map_send_buffer_size = NULL; HYPRE_Int num_procs; HYPRE_Int num_send_procs; @@ -63,6 +63,13 @@ hypre_BoomerAMGDDSetup( void *amgdd_vdata, HYPRE_Int num_requests; HYPRE_Int request_counter; + /* Sanity check */ + if (hypre_ParVectorNumVectors(b) > 1) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "BoomerAMGDD doesn't support multicomponent vectors"); + return hypre_error_flag; + } + // If the underlying AMG data structure has not yet been set up, call BoomerAMGSetup() if (!hypre_ParAMGDataAArray(amg_data)) { @@ -184,7 +191,8 @@ hypre_BoomerAMGDDSetup( void *amgdd_vdata, // Post the receives for the buffer size for (i = 0; i < num_recv_procs; i++) { - hypre_MPI_Irecv(&(recv_buffer_size[level][i]), 1, HYPRE_MPI_INT, hypre_AMGDDCommPkgRecvProcs(compGridCommPkg)[level][i], 0, comm, &(requests[request_counter++])); + hypre_MPI_Irecv(&(recv_buffer_size[level][i]), 1, HYPRE_MPI_INT, + hypre_AMGDDCommPkgRecvProcs(compGridCommPkg)[level][i], 0, comm, &(requests[request_counter++])); } } @@ -198,13 +206,15 @@ hypre_BoomerAMGDDSetup( void *amgdd_vdata, // Pack send buffers for (i = 0; i < num_send_procs; i++) { - send_buffer[i] = hypre_BoomerAMGDD_PackSendBuffer(amgdd_data, i, level, padding, &(send_flag_buffer_size[i])); + send_buffer[i] = hypre_BoomerAMGDD_PackSendBuffer(amgdd_data, i, level, padding, + &(send_flag_buffer_size[i])); } // Send the buffer sizes for (i = 0; i < num_send_procs; i++) { - hypre_MPI_Isend(&(send_buffer_size[level][i]), 1, HYPRE_MPI_INT, hypre_AMGDDCommPkgSendProcs(compGridCommPkg)[level][i], 0, comm, &(requests[request_counter++])); + hypre_MPI_Isend(&(send_buffer_size[level][i]), 1, HYPRE_MPI_INT, + hypre_AMGDDCommPkgSendProcs(compGridCommPkg)[level][i], 0, comm, &(requests[request_counter++])); } } @@ -216,12 +226,14 @@ hypre_BoomerAMGDDSetup( void *amgdd_vdata, for (i = 0; i < num_recv_procs; i++) { recv_buffer[i] = hypre_CTAlloc(HYPRE_Int, recv_buffer_size[level][i], HYPRE_MEMORY_HOST); - hypre_MPI_Irecv(recv_buffer[i], recv_buffer_size[level][i], HYPRE_MPI_INT, hypre_AMGDDCommPkgRecvProcs(compGridCommPkg)[level][i], 1, comm, &(requests[request_counter++])); + hypre_MPI_Irecv(recv_buffer[i], recv_buffer_size[level][i], HYPRE_MPI_INT, + hypre_AMGDDCommPkgRecvProcs(compGridCommPkg)[level][i], 1, comm, &(requests[request_counter++])); } for (i = 0; i < num_send_procs; i++) { - hypre_MPI_Isend(send_buffer[i], send_buffer_size[level][i], HYPRE_MPI_INT, hypre_AMGDDCommPkgSendProcs(compGridCommPkg)[level][i], 1, comm, &(requests[request_counter++])); + hypre_MPI_Isend(send_buffer[i], send_buffer_size[level][i], HYPRE_MPI_INT, + hypre_AMGDDCommPkgSendProcs(compGridCommPkg)[level][i], 1, comm, &(requests[request_counter++])); } // Wait for buffers to be received @@ -236,14 +248,17 @@ hypre_BoomerAMGDDSetup( void *amgdd_vdata, recv_red_marker[level][i] = hypre_CTAlloc(HYPRE_Int*, num_levels, HYPRE_MEMORY_HOST); num_recv_nodes[level][i] = hypre_CTAlloc(HYPRE_Int, num_levels, HYPRE_MEMORY_HOST); - hypre_BoomerAMGDD_UnpackRecvBuffer(amgdd_data, recv_buffer[i], A_tmp_info, &(recv_map_send_buffer_size[i]), nodes_added_on_level, level, i); + hypre_BoomerAMGDD_UnpackRecvBuffer(amgdd_data, recv_buffer[i], A_tmp_info, + &(recv_map_send_buffer_size[i]), nodes_added_on_level, level, i); recv_map_send_buffer[i] = hypre_CTAlloc(HYPRE_Int, recv_map_send_buffer_size[i], HYPRE_MEMORY_HOST); - hypre_BoomerAMGDD_PackRecvMapSendBuffer(recv_map_send_buffer[i], recv_red_marker[level][i], num_recv_nodes[level][i], &(recv_buffer_size[level][i]), level, num_levels); + hypre_BoomerAMGDD_PackRecvMapSendBuffer(recv_map_send_buffer[i], recv_red_marker[level][i], + num_recv_nodes[level][i], &(recv_buffer_size[level][i]), level, num_levels); } //////////// Setup local indices for the composite grid //////////// - hypre_AMGDDCompGridSetupLocalIndices(compGrid, nodes_added_on_level, recv_map, num_recv_procs, A_tmp_info, level, num_levels); + hypre_AMGDDCompGridSetupLocalIndices(compGrid, nodes_added_on_level, recv_map, num_recv_procs, + A_tmp_info, level, num_levels); for (j = level; j < num_levels; j++) { nodes_added_on_level[j] = 0; @@ -254,13 +269,15 @@ hypre_BoomerAMGDDSetup( void *amgdd_vdata, for (i = 0; i < num_send_procs; i++) { send_flag_buffer[i] = hypre_CTAlloc(HYPRE_Int, send_flag_buffer_size[i], HYPRE_MEMORY_HOST); - hypre_MPI_Irecv(send_flag_buffer[i], send_flag_buffer_size[i], HYPRE_MPI_INT, hypre_AMGDDCommPkgSendProcs(compGridCommPkg)[level][i], 2, comm, &(requests[request_counter++])); + hypre_MPI_Irecv(send_flag_buffer[i], send_flag_buffer_size[i], HYPRE_MPI_INT, + hypre_AMGDDCommPkgSendProcs(compGridCommPkg)[level][i], 2, comm, &(requests[request_counter++])); } // send the recv_map_send_buffer's for (i = 0; i < num_recv_procs; i++) { - hypre_MPI_Isend(recv_map_send_buffer[i], recv_map_send_buffer_size[i], HYPRE_MPI_INT, hypre_AMGDDCommPkgRecvProcs(compGridCommPkg)[level][i], 2, comm, &(requests[request_counter++])); + hypre_MPI_Isend(recv_map_send_buffer[i], recv_map_send_buffer_size[i], HYPRE_MPI_INT, + hypre_AMGDDCommPkgRecvProcs(compGridCommPkg)[level][i], 2, comm, &(requests[request_counter++])); } // wait for maps to be received @@ -269,7 +286,8 @@ hypre_BoomerAMGDDSetup( void *amgdd_vdata, // unpack and setup the send flag arrays for (i = 0; i < num_send_procs; i++) { - hypre_BoomerAMGDD_UnpackSendFlagBuffer(compGrid, send_flag_buffer[i], send_flag[level][i], num_send_nodes[level][i], &(send_buffer_size[level][i]), level, num_levels); + hypre_BoomerAMGDD_UnpackSendFlagBuffer(compGrid, send_flag_buffer[i], send_flag[level][i], + num_send_nodes[level][i], &(send_buffer_size[level][i]), level, num_levels); } // clean up memory for this level diff --git a/external/hypre/src/parcsr_ls/par_amgdd_solve.c b/external/hypre/src/parcsr_ls/par_amgdd_solve.c index 8e8f4dd4..cb5c5d09 100644 --- a/external/hypre/src/parcsr_ls/par_amgdd_solve.c +++ b/external/hypre/src/parcsr_ls/par_amgdd_solve.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -21,7 +21,7 @@ hypre_BoomerAMGDDSolve( void *amgdd_vdata, hypre_ParCSRMatrix **P_array; hypre_ParVector **F_array; hypre_ParVector **U_array; - hypre_ParVector *res; + hypre_ParVector *res = NULL; hypre_ParVector *Vtemp; hypre_ParVector *Ztemp; @@ -37,9 +37,9 @@ hypre_BoomerAMGDDSolve( void *amgdd_vdata, HYPRE_Int amg_print_level; HYPRE_Int amg_logging; HYPRE_Real tol; - HYPRE_Real resid_nrm; - HYPRE_Real resid_nrm_init; - HYPRE_Real rhs_norm; + HYPRE_Real resid_nrm = 0.0; + HYPRE_Real resid_nrm_init = 1.0; + HYPRE_Real rhs_norm = 1.0; HYPRE_Real old_resid; HYPRE_Real relative_resid; HYPRE_Real conv_factor; @@ -98,8 +98,9 @@ hypre_BoomerAMGDDSolve( void *amgdd_vdata, U_array[0] = u; if (A != A_array[0]) { - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"WARNING: calling hypre_BoomerAMGDDSolve with different matrix than what was used for initial setup. " - "Non-owned parts of fine-grid matrix and fine-grid communication patterns may be incorrect.\n"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "WARNING: calling hypre_BoomerAMGDDSolve with different matrix than what was used for initial setup. " + "Non-owned parts of fine-grid matrix and fine-grid communication patterns may be incorrect.\n"); hypre_AMGDDCompGridMatrixOwnedDiag(hypre_AMGDDCompGridA(compGrids[0])) = hypre_ParCSRMatrixDiag(A); hypre_AMGDDCompGridMatrixOwnedOffd(hypre_AMGDDCompGridA(compGrids[0])) = hypre_ParCSRMatrixOffd(A); } @@ -122,7 +123,7 @@ hypre_BoomerAMGDDSolve( void *amgdd_vdata, { hypre_ParCSRMatrixMatvec(alpha, A_array[0], U_array[0], beta, res); } - resid_nrm = sqrt(hypre_ParVectorInnerProd(res, res)); + resid_nrm = hypre_sqrt(hypre_ParVectorInnerProd(res, res)); } else { @@ -131,14 +132,14 @@ hypre_BoomerAMGDDSolve( void *amgdd_vdata, { hypre_ParCSRMatrixMatvec(alpha, A_array[0], U_array[0], beta, Vtemp); } - resid_nrm = sqrt(hypre_ParVectorInnerProd(Vtemp, Vtemp)); + resid_nrm = hypre_sqrt(hypre_ParVectorInnerProd(Vtemp, Vtemp)); } - /* Since it is does not diminish performance, attempt to return an error flag + /* Since it does not diminish performance, attempt to return an error flag and notify users when they supply bad input. */ if (resid_nrm != 0.) { - ieee_check = resid_nrm/resid_nrm; /* INF -> NaN conversion */ + ieee_check = resid_nrm / resid_nrm; /* INF -> NaN conversion */ } if (ieee_check != ieee_check) @@ -165,7 +166,7 @@ hypre_BoomerAMGDDSolve( void *amgdd_vdata, if (0 == converge_type) { - rhs_norm = sqrt(hypre_ParVectorInnerProd(f, f)); + rhs_norm = hypre_sqrt(hypre_ParVectorInnerProd(f, f)); if (rhs_norm) { relative_resid = resid_nrm_init / rhs_norm; @@ -192,7 +193,7 @@ hypre_BoomerAMGDDSolve( void *amgdd_vdata, hypre_printf(" residual factor residual\n"); hypre_printf(" -------- ------ --------\n"); hypre_printf(" Initial %e %e\n", - resid_nrm_init, relative_resid); + resid_nrm_init, relative_resid); } /*----------------------------------------------------------------------- @@ -256,9 +257,9 @@ hypre_BoomerAMGDDSolve( void *amgdd_vdata, if (amgdd_start_level > 0) { // Interpolate - hypre_ParCSRMatrixMatvec(1.0, P_array[amgdd_start_level-1], + hypre_ParCSRMatrixMatvec(1.0, P_array[amgdd_start_level - 1], U_array[amgdd_start_level], 1.0, - U_array[amgdd_start_level-1]); + U_array[amgdd_start_level - 1]); // V-cycle back to finest grid hypre_ParAMGDataPartialCycleCoarsestLevel(amg_data) = amgdd_start_level - 1; hypre_ParAMGDataPartialCycleControl(amg_data) = 1; @@ -285,13 +286,13 @@ hypre_BoomerAMGDDSolve( void *amgdd_vdata, { hypre_ParCSRMatrixMatvecOutOfPlace(alpha, A_array[0], U_array[0], beta, F_array[0], res); - resid_nrm = sqrt(hypre_ParVectorInnerProd(res, res)); + resid_nrm = hypre_sqrt(hypre_ParVectorInnerProd(res, res)); } else { hypre_ParCSRMatrixMatvecOutOfPlace(alpha, A_array[0], U_array[0], beta, F_array[0], Vtemp); - resid_nrm = sqrt(hypre_ParVectorInnerProd(Vtemp, Vtemp)); + resid_nrm = hypre_sqrt(hypre_ParVectorInnerProd(Vtemp, Vtemp)); } if (old_resid) @@ -339,7 +340,7 @@ hypre_BoomerAMGDDSolve( void *amgdd_vdata, { hypre_printf("\n\n=============================================="); hypre_printf("\n NOTE: Convergence tolerance was not achieved\n"); - hypre_printf(" within the allowed %d V-cycles\n",max_iter); + hypre_printf(" within the allowed %d V-cycles\n", max_iter); hypre_printf("=============================================="); } @@ -384,7 +385,7 @@ hypre_BoomerAMGDD_ResidualCommunication( hypre_ParAMGDDData *amgdd_data ) HYPRE_Int send_buffer_size, recv_buffer_size; HYPRE_Int num_levels, amgdd_start_level; - HYPRE_Int level,i; + HYPRE_Int level, i; // Get info from amg num_levels = hypre_ParAMGDataNumLevels(amg_data); @@ -396,15 +397,15 @@ hypre_BoomerAMGDD_ResidualCommunication( hypre_ParAMGDDData *amgdd_data ) F_array = hypre_ParAMGDataFArray(amg_data); // Restrict residual down to all levels - for (level = amgdd_start_level; level < num_levels-1; level++) + for (level = amgdd_start_level; level < num_levels - 1; level++) { if (hypre_ParAMGDataRestriction(amg_data)) { - hypre_ParCSRMatrixMatvec(1.0, R_array[level], F_array[level], 0.0, F_array[level+1]); + hypre_ParCSRMatrixMatvec(1.0, R_array[level], F_array[level], 0.0, F_array[level + 1]); } else { - hypre_ParCSRMatrixMatvecT(1.0, R_array[level], F_array[level], 0.0, F_array[level+1]); + hypre_ParCSRMatrixMatvecT(1.0, R_array[level], F_array[level], 0.0, F_array[level + 1]); } } @@ -435,14 +436,16 @@ hypre_BoomerAMGDD_ResidualCommunication( hypre_ParAMGDDData *amgdd_data ) { recv_buffer_size = hypre_AMGDDCommPkgRecvBufferSize(compGridCommPkg)[level][i]; recv_buffers[i] = hypre_CTAlloc(HYPRE_Complex, recv_buffer_size, HYPRE_MEMORY_HOST); - hypre_MPI_Irecv(recv_buffers[i], recv_buffer_size, HYPRE_MPI_COMPLEX, hypre_AMGDDCommPkgRecvProcs(compGridCommPkg)[level][i], 3, comm, &requests[request_counter++]); + hypre_MPI_Irecv(recv_buffers[i], recv_buffer_size, HYPRE_MPI_COMPLEX, + hypre_AMGDDCommPkgRecvProcs(compGridCommPkg)[level][i], 3, comm, &requests[request_counter++]); } for (i = 0; i < num_sends; i++) { send_buffer_size = hypre_AMGDDCommPkgSendBufferSize(compGridCommPkg)[level][i]; send_buffers[i] = hypre_BoomerAMGDD_PackResidualBuffer(compGrid, compGridCommPkg, level, i); - hypre_MPI_Isend(send_buffers[i], send_buffer_size, HYPRE_MPI_COMPLEX, hypre_AMGDDCommPkgSendProcs(compGridCommPkg)[level][i], 3, comm, &requests[request_counter++]); + hypre_MPI_Isend(send_buffers[i], send_buffer_size, HYPRE_MPI_COMPLEX, + hypre_AMGDDCommPkgSendProcs(compGridCommPkg)[level][i], 3, comm, &requests[request_counter++]); } // wait for buffers to be received @@ -486,7 +489,8 @@ hypre_BoomerAMGDD_PackResidualBuffer( hypre_AMGDDCompGrid **compGrid, HYPRE_Int send_elmt; HYPRE_Int cnt = 0; - buffer = hypre_CTAlloc(HYPRE_Complex, hypre_AMGDDCommPkgSendBufferSize(compGridCommPkg)[current_level][proc], HYPRE_MEMORY_HOST); + buffer = hypre_CTAlloc(HYPRE_Complex, + hypre_AMGDDCommPkgSendBufferSize(compGridCommPkg)[current_level][proc], HYPRE_MEMORY_HOST); for (level = current_level; level < hypre_AMGDDCommPkgNumLevels(compGridCommPkg); level++) { for (i = 0; i < hypre_AMGDDCommPkgNumSendNodes(compGridCommPkg)[current_level][proc][level]; i++) @@ -494,12 +498,14 @@ hypre_BoomerAMGDD_PackResidualBuffer( hypre_AMGDDCompGrid **compGrid, send_elmt = hypre_AMGDDCommPkgSendFlag(compGridCommPkg)[current_level][proc][level][i]; if (send_elmt < hypre_AMGDDCompGridNumOwnedNodes(compGrid[level])) { - buffer[cnt++] = hypre_VectorData(hypre_AMGDDCompGridVectorOwned(hypre_AMGDDCompGridF(compGrid[level])))[send_elmt]; + buffer[cnt++] = hypre_VectorData(hypre_AMGDDCompGridVectorOwned(hypre_AMGDDCompGridF( + compGrid[level])))[send_elmt]; } else { send_elmt -= hypre_AMGDDCompGridNumOwnedNodes(compGrid[level]); - buffer[cnt++] = hypre_VectorData(hypre_AMGDDCompGridVectorNonOwned(hypre_AMGDDCompGridF(compGrid[level])))[send_elmt]; + buffer[cnt++] = hypre_VectorData(hypre_AMGDDCompGridVectorNonOwned(hypre_AMGDDCompGridF( + compGrid[level])))[send_elmt]; } } } @@ -523,7 +529,8 @@ hypre_BoomerAMGDD_UnpackResidualBuffer( HYPRE_Complex *buffer, for (i = 0; i < hypre_AMGDDCommPkgNumRecvNodes(compGridCommPkg)[current_level][proc][level]; i++) { recv_elmt = hypre_AMGDDCommPkgRecvMap(compGridCommPkg)[current_level][proc][level][i]; - hypre_VectorData(hypre_AMGDDCompGridVectorNonOwned(hypre_AMGDDCompGridF(compGrid[level])))[recv_elmt] = buffer[cnt++]; + hypre_VectorData(hypre_AMGDDCompGridVectorNonOwned(hypre_AMGDDCompGridF( + compGrid[level])))[recv_elmt] = buffer[cnt++]; } } diff --git a/external/hypre/src/parcsr_ls/par_cg_relax_wt.c b/external/hypre/src/parcsr_ls/par_cg_relax_wt.c index ba9d56d4..07e7dece 100644 --- a/external/hypre/src/parcsr_ls/par_cg_relax_wt.c +++ b/external/hypre/src/parcsr_ls/par_cg_relax_wt.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -15,7 +15,7 @@ #include "par_amg.h" /*-------------------------------------------------------------------------- - * hypre_BoomerAMGCycle + * hypre_BoomerAMGCGRelaxWt *--------------------------------------------------------------------------*/ HYPRE_Int @@ -27,7 +27,7 @@ hypre_BoomerAMGCGRelaxWt( void *amg_vdata, hypre_ParAMGData *amg_data = (hypre_ParAMGData*) amg_vdata; MPI_Comm comm; - HYPRE_Solver *smoother; + HYPRE_Solver *smoother = NULL; /* Data Structure variables */ /* hypre_ParCSRMatrix **A_array = hypre_ParAMGDataAArray(amg_data); */ @@ -35,14 +35,14 @@ hypre_BoomerAMGCGRelaxWt( void *amg_vdata, hypre_ParCSRMatrix *A = hypre_ParAMGDataAArray(amg_data)[level]; /* hypre_ParVector **F_array = hypre_ParAMGDataFArray(amg_data); */ /* hypre_ParVector **U_array = hypre_ParAMGDataUArray(amg_data); */ - hypre_ParVector *Utemp; + hypre_ParVector *Utemp = NULL; hypre_ParVector *Vtemp; hypre_ParVector *Ptemp; hypre_ParVector *Rtemp; hypre_ParVector *Ztemp; hypre_ParVector *Qtemp = NULL; - HYPRE_Int *CF_marker = hypre_IntArrayData(hypre_ParAMGDataCFMarkerArray(amg_data)[level]); + HYPRE_Int *CF_marker; HYPRE_Real *Ptemp_data; HYPRE_Real *Ztemp_data; @@ -87,15 +87,15 @@ hypre_BoomerAMGCGRelaxWt( void *amg_vdata, HYPRE_Real *S_vec; #endif -#if !defined(HYPRE_USING_CUDA) && !defined(HYPRE_USING_HIP) +#if !defined(HYPRE_USING_GPU) HYPRE_Int num_threads = hypre_NumThreads(); #endif /* Acquire data and allocate storage */ - tridiag = hypre_CTAlloc(HYPRE_Real, num_cg_sweeps+1, HYPRE_MEMORY_HOST); - trioffd = hypre_CTAlloc(HYPRE_Real, num_cg_sweeps+1, HYPRE_MEMORY_HOST); - for (i=0; i < num_cg_sweeps+1; i++) + tridiag = hypre_CTAlloc(HYPRE_Real, num_cg_sweeps + 1, HYPRE_MEMORY_HOST); + trioffd = hypre_CTAlloc(HYPRE_Real, num_cg_sweeps + 1, HYPRE_MEMORY_HOST); + for (i = 0; i < num_cg_sweeps + 1; i++) { tridiag[i] = 0; trioffd[i] = 0; @@ -119,25 +119,29 @@ hypre_BoomerAMGCGRelaxWt( void *amg_vdata, hypre_ParVectorInitialize(Ztemp); if (hypre_ParAMGDataL1Norms(amg_data) != NULL) + { l1_norms = hypre_ParAMGDataL1Norms(amg_data)[level]; + } -#if !defined(HYPRE_USING_CUDA) && !defined(HYPRE_USING_HIP) +#if !defined(HYPRE_USING_GPU) if (num_threads > 1) #endif { needQ = 1; } - grid_relax_type = hypre_ParAMGDataGridRelaxType(amg_data); - smooth_type = hypre_ParAMGDataSmoothType(amg_data); - smooth_num_levels = hypre_ParAMGDataSmoothNumLevels(amg_data); + grid_relax_type = hypre_ParAMGDataGridRelaxType(amg_data); + smooth_type = hypre_ParAMGDataSmoothType(amg_data); + smooth_num_levels = hypre_ParAMGDataSmoothNumLevels(amg_data); + CF_marker = (hypre_ParAMGDataCFMarkerArray(amg_data)[level] != NULL) ? + hypre_IntArrayData(hypre_ParAMGDataCFMarkerArray(amg_data)[level]) : NULL; /* Initialize */ Solve_err_flag = 0; comm = hypre_ParCSRMatrixComm(A); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_rank(comm, &my_id); if (smooth_num_levels > level) { @@ -146,8 +150,8 @@ hypre_BoomerAMGCGRelaxWt( void *amg_vdata, if (smooth_type > 6 && smooth_type < 10) { Utemp = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A), - hypre_ParCSRMatrixGlobalNumRows(A), - hypre_ParCSRMatrixRowStarts(A)); + hypre_ParCSRMatrixGlobalNumRows(A), + hypre_ParCSRMatrixRowStarts(A)); hypre_ParVectorInitialize(Utemp); } } @@ -200,43 +204,50 @@ hypre_BoomerAMGCGRelaxWt( void *amg_vdata, for (jj = 0; jj < num_cg_sweeps; jj++) { hypre_ParVectorSetConstantValues(Ztemp, 0.0); + for (j = 0; j < num_sweeps; j++) { - if (smooth_option > 6) + if (smooth_num_levels > level) { - - hypre_ParVectorCopy(Rtemp,Vtemp); - alpha = -1.0; - beta = 1.0; - hypre_ParCSRMatrixMatvec(alpha, A, - Ztemp, beta, Vtemp); - if (smooth_option == 8) - HYPRE_ParCSRParaSailsSolve(smoother[level], - (HYPRE_ParCSRMatrix) A, - (HYPRE_ParVector) Vtemp, - (HYPRE_ParVector) Utemp); - else if (smooth_option == 7) + if (smooth_option > 6) { - HYPRE_ParCSRPilutSolve(smoother[level], - (HYPRE_ParCSRMatrix) A, - (HYPRE_ParVector) Vtemp, - (HYPRE_ParVector) Utemp); - hypre_ParVectorAxpy(1.0,Utemp,Ztemp); + hypre_ParVectorCopy(Rtemp, Vtemp); + alpha = -1.0; + beta = 1.0; + hypre_ParCSRMatrixMatvec(alpha, A, + Ztemp, beta, Vtemp); + if (smooth_option == 8) + { + HYPRE_ParCSRParaSailsSolve(smoother[level], + (HYPRE_ParCSRMatrix) A, + (HYPRE_ParVector) Vtemp, + (HYPRE_ParVector) Utemp); + } + else if (smooth_option == 7) + { + HYPRE_ParCSRPilutSolve(smoother[level], + (HYPRE_ParCSRMatrix) A, + (HYPRE_ParVector) Vtemp, + (HYPRE_ParVector) Utemp); + hypre_ParVectorAxpy(1.0, Utemp, Ztemp); + } + else if (smooth_option == 9) + { + HYPRE_EuclidSolve(smoother[level], + (HYPRE_ParCSRMatrix) A, + (HYPRE_ParVector) Vtemp, + (HYPRE_ParVector) Utemp); + hypre_ParVectorAxpy(1.0, Utemp, Ztemp); + } } - else if (smooth_option == 9) + else if (smooth_option == 6) { - HYPRE_EuclidSolve(smoother[level], - (HYPRE_ParCSRMatrix) A, - (HYPRE_ParVector) Vtemp, - (HYPRE_ParVector) Utemp); - hypre_ParVectorAxpy(1.0,Utemp,Ztemp); + HYPRE_SchwarzSolve(smoother[level], + (HYPRE_ParCSRMatrix) A, + (HYPRE_ParVector) Rtemp, + (HYPRE_ParVector) Ztemp); } } - else if (smooth_option == 6) - HYPRE_SchwarzSolve(smoother[level], - (HYPRE_ParCSRMatrix) A, - (HYPRE_ParVector) Rtemp, - (HYPRE_ParVector) Ztemp); else { Solve_err_flag = hypre_BoomerAMGRelax(A, @@ -257,47 +268,50 @@ hypre_BoomerAMGCGRelaxWt( void *amg_vdata, hypre_ParVectorDestroy(Ptemp); hypre_TFree(tridiag, HYPRE_MEMORY_HOST); hypre_TFree(trioffd, HYPRE_MEMORY_HOST); - return(Solve_err_flag); + return (Solve_err_flag); } } + gammaold = gamma; - gamma = hypre_ParVectorInnerProd(Rtemp,Ztemp); + gamma = hypre_ParVectorInnerProd(Rtemp, Ztemp); if (jj == 0) { - hypre_ParVectorCopy(Ztemp,Ptemp); + hypre_ParVectorCopy(Ztemp, Ptemp); beta = 1.0; } else { - beta = gamma/gammaold; - for (i=0; i < local_size; i++) - Ptemp_data[i] = Ztemp_data[i] + beta*Ptemp_data[i]; + beta = gamma / gammaold; + for (i = 0; i < local_size; i++) + { + Ptemp_data[i] = Ztemp_data[i] + beta * Ptemp_data[i]; + } } - hypre_ParCSRMatrixMatvec(1.0,A,Ptemp,0.0,Vtemp); - alpha = gamma /hypre_ParVectorInnerProd(Ptemp,Vtemp); - alphinv = 1.0/alpha; - tridiag[jj+1] = alphinv; + hypre_ParCSRMatrixMatvec(1.0, A, Ptemp, 0.0, Vtemp); + alpha = gamma / (hypre_ParVectorInnerProd(Ptemp, Vtemp) + HYPRE_REAL_MIN); + alphinv = 1.0 / (alpha + HYPRE_REAL_MIN); + tridiag[jj + 1] = alphinv; tridiag[jj] *= beta; tridiag[jj] += alphinv; - trioffd[jj] *= sqrt(beta); - trioffd[jj+1] = -alphinv; - row_sum = fabs(tridiag[jj]) + fabs(trioffd[jj]); - if (row_sum > max_row_sum) max_row_sum = row_sum; + trioffd[jj] *= hypre_sqrt(beta); + trioffd[jj + 1] = -alphinv; + row_sum = hypre_abs(tridiag[jj]) + hypre_abs(trioffd[jj]); + if (row_sum > max_row_sum) { max_row_sum = row_sum; } if (jj > 0) { - row_sum = fabs(tridiag[jj-1]) + fabs(trioffd[jj-1]) - + fabs(trioffd[jj]); - if (row_sum > max_row_sum) max_row_sum = row_sum; + row_sum = hypre_abs(tridiag[jj - 1]) + hypre_abs(trioffd[jj - 1]) + + hypre_abs(trioffd[jj]); + if (row_sum > max_row_sum) { max_row_sum = row_sum; } /* lambda_min_old = lambda_min; */ lambda_max_old = lambda_max; rlx_wt_old = rlx_wt; - hypre_Bisection(jj+1, tridiag, trioffd, lambda_max_old, - max_row_sum, 1.e-3, jj+1, &lambda_max); - rlx_wt = 1.0/lambda_max; + hypre_Bisection(jj + 1, tridiag, trioffd, lambda_max_old, + max_row_sum, 1.e-3, jj + 1, &lambda_max); + rlx_wt = 1.0 / lambda_max; /* hypre_Bisection(jj+1, tridiag, trioffd, 0.0, lambda_min_old, 1.e-3, 1, &lambda_min); rlx_wt = 2.0/(lambda_min+lambda_max); */ - if (fabs(rlx_wt-rlx_wt_old) < 1.e-3 ) + if (hypre_abs(rlx_wt - rlx_wt_old) < 1.e-3 ) { /* if (my_id == 0) hypre_printf (" cg sweeps : %d\n", (jj+1)); */ break; @@ -309,19 +323,19 @@ hypre_BoomerAMGCGRelaxWt( void *amg_vdata, lambda_max = tridiag[0]; } - hypre_ParVectorAxpy(-alpha,Vtemp,Rtemp); + hypre_ParVectorAxpy(-alpha, Vtemp, Rtemp); } /*if (my_id == 0) hypre_printf (" lambda-min: %f lambda-max: %f\n", lambda_min, lambda_max); - rlx_wt = fabs(tridiag[0])+fabs(trioffd[1]); + rlx_wt = hypre_abs(tridiag[0])+hypre_abs(trioffd[1]); for (i=1; i < num_cg_sweeps-1; i++) { - row_sum = fabs(tridiag[i]) + fabs(trioffd[i]) + fabs(trioffd[i+1]); + row_sum = hypre_abs(tridiag[i]) + hypre_abs(trioffd[i]) + hypre_abs(trioffd[i+1]); if (row_sum > rlx_wt) rlx_wt = row_sum; } - row_sum = fabs(tridiag[num_cg_sweeps-1]) + fabs(trioffd[num_cg_sweeps-1]); + row_sum = hypre_abs(tridiag[num_cg_sweeps-1]) + hypre_abs(trioffd[num_cg_sweeps-1]); if (row_sum > rlx_wt) rlx_wt = row_sum; hypre_Bisection(num_cg_sweeps, tridiag, trioffd, 0.0, rlx_wt, 1.e-3, 1, @@ -352,7 +366,7 @@ hypre_BoomerAMGCGRelaxWt( void *amg_vdata, *rlx_wt_ptr = rlx_wt; - return(Solve_err_flag); + return (Solve_err_flag); } /*-------------------------------------------------------------------------- @@ -371,29 +385,33 @@ hypre_Bisection(HYPRE_Int n, HYPRE_Real *diag, HYPRE_Real *offd, HYPRE_Int i; HYPRE_Real p0, p1, p2; - while (fabs(y-z) > tol*(fabs(y) + fabs(z))) + while (hypre_abs(y - z) > tol * (hypre_abs(y) + hypre_abs(z))) { - x = (y+z)/2; + x = (y + z) / 2; sign_change = 0; p0 = 1; p1 = diag[0] - x; - if (p0*p1 <= 0) sign_change++; - for (i=1; i < n; i++) + if (p0 * p1 <= 0) { sign_change++; } + for (i = 1; i < n; i++) { - p2 = (diag[i] - x)*p1 - offd[i]*offd[i]*p0; + p2 = (diag[i] - x) * p1 - offd[i] * offd[i] * p0; p0 = p1; p1 = p2; - if (p0*p1 <= 0) sign_change++; + if (p0 * p1 <= 0) { sign_change++; } } if (sign_change >= k) + { z = x; + } else + { y = x; + } } - eigen_value = (y+z)/2; + eigen_value = (y + z) / 2; *ev_ptr = eigen_value; return ierr; diff --git a/external/hypre/src/parcsr_ls/par_cgc_coarsen.c b/external/hypre/src/parcsr_ls/par_cgc_coarsen.c index dfa2f6a1..b4a59737 100644 --- a/external/hypre/src/parcsr_ls/par_cgc_coarsen.c +++ b/external/hypre/src/parcsr_ls/par_cgc_coarsen.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -14,6 +14,7 @@ #include "_hypre_parcsr_ls.h" #include "../HYPRE.h" /* BM Aug 15, 2006 */ +#include "_hypre_IJ_mv.h" #define C_PT 1 #define F_PT -1 @@ -37,7 +38,7 @@ hypre_BoomerAMGCoarsenCGCb( hypre_ParCSRMatrix *S, hypre_IntArray **CF_marker_ptr) { #ifdef HYPRE_MIXEDINT - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"CGC coarsening is not enabled in mixedint mode!"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "CGC coarsening is not enabled in mixedint mode!"); return hypre_error_flag; #endif @@ -53,7 +54,7 @@ hypre_BoomerAMGCoarsenCGCb( hypre_ParCSRMatrix *S, HYPRE_Int num_variables = hypre_CSRMatrixNumRows(S_diag); HYPRE_Int num_cols_offd = hypre_CSRMatrixNumCols(S_offd); - hypre_CSRMatrix *S_ext; + hypre_CSRMatrix *S_ext = NULL; HYPRE_Int *S_ext_i; HYPRE_BigInt *S_ext_j; @@ -62,14 +63,14 @@ hypre_BoomerAMGCoarsenCGCb( hypre_ParCSRMatrix *S, HYPRE_Int *ST_j; HYPRE_Int *CF_marker; - HYPRE_Int *CF_marker_offd=NULL; + HYPRE_Int *CF_marker_offd = NULL; HYPRE_Int ci_tilde = -1; HYPRE_Int ci_tilde_mark = -1; HYPRE_Int *measure_array; HYPRE_Int *measure_array_master; HYPRE_Int *graph_array; - HYPRE_Int *int_buf_data=NULL; + HYPRE_Int *int_buf_data = NULL; /*HYPRE_Int *ci_array=NULL;*/ HYPRE_Int i, j, k, l, jS; @@ -92,11 +93,11 @@ hypre_BoomerAMGCoarsenCGCb( hypre_ParCSRMatrix *S, HYPRE_Int nabor, nabor_two; HYPRE_Int use_commpkg_A = 0; - HYPRE_Real wall_time; + HYPRE_Real wall_time = 0.0; - HYPRE_Int measure_max; /* BM Aug 30, 2006: maximal measure, needed for CGC */ + HYPRE_Int measure_max = 0; /* BM Aug 30, 2006: maximal measure, needed for CGC */ - if (coarsen_type < 0) coarsen_type = -coarsen_type; + if (coarsen_type < 0) { coarsen_type = -coarsen_type; } /*------------------------------------------------------- * Initialize the C/F marker, LoL_head, LoL_tail arrays @@ -127,10 +128,10 @@ hypre_BoomerAMGCoarsenCGCb( hypre_ParCSRMatrix *S, * to "unaccounted-for" dependence. *----------------------------------------------------------------*/ - if (debug_flag == 3) wall_time = time_getWallclockSeconds(); + if (debug_flag == 3) { wall_time = time_getWallclockSeconds(); } - hypre_MPI_Comm_size(comm,&num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); if (!comm_pkg) { @@ -151,7 +152,7 @@ hypre_BoomerAMGCoarsenCGCb( hypre_ParCSRMatrix *S, jS = S_i[num_variables]; ST = hypre_CSRMatrixCreate(num_variables, num_variables, jS); - ST_i = hypre_CTAlloc(HYPRE_Int, num_variables+1, HYPRE_MEMORY_HOST); + ST_i = hypre_CTAlloc(HYPRE_Int, num_variables + 1, HYPRE_MEMORY_HOST); ST_j = hypre_CTAlloc(HYPRE_Int, jS, HYPRE_MEMORY_HOST); hypre_CSRMatrixI(ST) = ST_i; hypre_CSRMatrixJ(ST) = ST_j; @@ -161,20 +162,22 @@ hypre_BoomerAMGCoarsenCGCb( hypre_ParCSRMatrix *S, * generate transpose of S, ST *----------------------------------------------------------*/ - for (i=0; i <= num_variables; i++) + for (i = 0; i <= num_variables; i++) + { ST_i[i] = 0; + } - for (i=0; i < jS; i++) + for (i = 0; i < jS; i++) { - ST_i[S_j[i]+1]++; + ST_i[S_j[i] + 1]++; } - for (i=0; i < num_variables; i++) + for (i = 0; i < num_variables; i++) { - ST_i[i+1] += ST_i[i]; + ST_i[i + 1] += ST_i[i]; } - for (i=0; i < num_variables; i++) + for (i = 0; i < num_variables; i++) { - for (j=S_i[i]; j < S_i[i+1]; j++) + for (j = S_i[i]; j < S_i[i + 1]; j++) { index = S_j[j]; ST_j[ST_i[index]] = i; @@ -183,7 +186,7 @@ hypre_BoomerAMGCoarsenCGCb( hypre_ParCSRMatrix *S, } for (i = num_variables; i > 0; i--) { - ST_i[i] = ST_i[i-1]; + ST_i[i] = ST_i[i - 1]; } ST_i[0] = 0; @@ -202,16 +205,20 @@ hypre_BoomerAMGCoarsenCGCb( hypre_ParCSRMatrix *S, for (i = 0; i < num_variables; i++) { - measure_array_master[i] = ST_i[i+1]-ST_i[i]; + measure_array_master[i] = ST_i[i + 1] - ST_i[i]; } if ((measure_type || (coarsen_type != 1 && coarsen_type != 11)) - && num_procs > 1) + && num_procs > 1) { if (use_commpkg_A) - S_ext = hypre_ParCSRMatrixExtractBExt(S,A,0); + { + S_ext = hypre_ParCSRMatrixExtractBExt(S, A, 0); + } else - S_ext = hypre_ParCSRMatrixExtractBExt(S,S,0); + { + S_ext = hypre_ParCSRMatrixExtractBExt(S, S, 0); + } S_ext_i = hypre_CSRMatrixI(S_ext); S_ext_j = hypre_CSRMatrixBigJ(S_ext); num_nonzeros = S_ext_i[num_cols_offd]; @@ -220,11 +227,13 @@ hypre_BoomerAMGCoarsenCGCb( hypre_ParCSRMatrix *S, col_n = col_0+num_variables;*/ if (measure_type) { - for (i=0; i < num_nonzeros; i++) + for (i = 0; i < num_nonzeros; i++) { index = (HYPRE_Int)(S_ext_j[i] - first_col); if (index > -1 && index < num_variables) + { measure_array_master[index]++; + } } } } @@ -233,7 +242,7 @@ hypre_BoomerAMGCoarsenCGCb( hypre_ParCSRMatrix *S, * Loop until all points are either fine or coarse. *---------------------------------------------------*/ - if (debug_flag == 3) wall_time = time_getWallclockSeconds(); + if (debug_flag == 3) { wall_time = time_getWallclockSeconds(); } /* first coarsening phase */ @@ -254,8 +263,8 @@ hypre_BoomerAMGCoarsenCGCb( hypre_ParCSRMatrix *S, num_left = 0; for (j = 0; j < num_variables; j++) { - if ((S_i[j+1]-S_i[j])== 0 && - (S_offd_i[j+1]-S_offd_i[j]) == 0) + if ((S_i[j + 1] - S_i[j]) == 0 && + (S_offd_i[j + 1] - S_offd_i[j]) == 0) { CF_marker[j] = SF_PT; measure_array_master[j] = 0; @@ -267,12 +276,13 @@ hypre_BoomerAMGCoarsenCGCb( hypre_ParCSRMatrix *S, } } - if (coarsen_type==22) { + if (coarsen_type == 22) + { /* BM Sep 8, 2006: allow_emptygrids only if the following holds for all points j: (a) the point has no strong connections at all, OR (b) the point has a strong connection across a boundary */ - for (j=0;jS_i[j] && S_offd_i[j+1] == S_offd_i[j]) {coarsen_type=21;break;} + for (j = 0; j < num_variables; j++) + if (S_i[j + 1] > S_i[j] && S_offd_i[j + 1] == S_offd_i[j]) {coarsen_type = 21; break;} } for (l = 1; l <= cgc_its; l++) @@ -280,9 +290,10 @@ hypre_BoomerAMGCoarsenCGCb( hypre_ParCSRMatrix *S, LoL_head = NULL; LoL_tail = NULL; num_left = 0; /* compute num_left before each RS coarsening loop */ - hypre_TMemcpy(measure_array, measure_array_master, HYPRE_Int, num_variables, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); - memset (lists,0,sizeof(HYPRE_Int)*num_variables); - memset (where,0,sizeof(HYPRE_Int)*num_variables); + hypre_TMemcpy(measure_array, measure_array_master, HYPRE_Int, num_variables, HYPRE_MEMORY_HOST, + HYPRE_MEMORY_HOST); + memset (lists, 0, sizeof(HYPRE_Int)*num_variables); + memset (where, 0, sizeof(HYPRE_Int)*num_variables); for (j = 0; j < num_variables; j++) { @@ -300,9 +311,9 @@ hypre_BoomerAMGCoarsenCGCb( hypre_ParCSRMatrix *S, in each CGC iteration. BM Aug 30, 2006 */ { - if (measure < 0) hypre_error_w_msg(HYPRE_ERROR_GENERIC,"negative measure!\n"); + if (measure < 0) { hypre_error_w_msg(HYPRE_ERROR_GENERIC, "negative measure!\n"); } /* CF_marker[j] = f_pnt; */ - for (k = S_i[j]; k < S_i[j+1]; k++) + for (k = S_i[j]; k < S_i[j + 1]; k++) { nabor = S_j[k]; /* if (CF_marker[nabor] != SF_PT) */ @@ -314,12 +325,12 @@ hypre_BoomerAMGCoarsenCGCb( hypre_ParCSRMatrix *S, new_meas = measure_array[nabor]; if (new_meas > 0) hypre_remove_point(&LoL_head, &LoL_tail, new_meas, - nabor, lists, where); - else num_left++; /* BM Aug 29, 2006 */ + nabor, lists, where); + else { num_left++; } /* BM Aug 29, 2006 */ new_meas = ++(measure_array[nabor]); hypre_enter_on_lists(&LoL_head, &LoL_tail, new_meas, - nabor, lists, where); + nabor, lists, where); } else { @@ -333,11 +344,13 @@ hypre_BoomerAMGCoarsenCGCb( hypre_ParCSRMatrix *S, } /* BM Aug 30, 2006: first iteration: determine maximal weight */ - if (num_left && l==1) measure_max = measure_array[LoL_head->head]; + if (num_left && l == 1) { measure_max = measure_array[LoL_head->head]; } /* BM Aug 30, 2006: break CGC iteration if no suitable starting point is available any more */ - if (!num_left || measure_array[LoL_head->head]head] < measure_max) + { + while (LoL_head) + { hypre_LinkList list_ptr = LoL_head; LoL_head = LoL_head->next_elt; hypre_dispose_elt (list_ptr); @@ -379,42 +392,42 @@ hypre_BoomerAMGCoarsenCGCb( hypre_ParCSRMatrix *S, hypre_remove_point(&LoL_head, &LoL_tail, measure, index, lists, where); - for (j = ST_i[index]; j < ST_i[index+1]; j++) + for (j = ST_i[index]; j < ST_i[index + 1]; j++) { nabor = ST_j[j]; /* if (CF_marker[nabor] == UNDECIDED) */ - if (measure_array[nabor]>0) /* undecided point */ + if (measure_array[nabor] > 0) /* undecided point */ { /* CF_marker[nabor] = F_PT; */ /* BM Aug 18, 2006 */ measure = measure_array[nabor]; - measure_array[nabor]=0; + measure_array[nabor] = 0; hypre_remove_point(&LoL_head, &LoL_tail, measure, nabor, lists, where); --num_left; - for (k = S_i[nabor]; k < S_i[nabor+1]; k++) + for (k = S_i[nabor]; k < S_i[nabor + 1]; k++) { nabor_two = S_j[k]; /* if (CF_marker[nabor_two] == UNDECIDED) */ - if (measure_array[nabor_two]>0) /* undecided point */ + if (measure_array[nabor_two] > 0) /* undecided point */ { measure = measure_array[nabor_two]; hypre_remove_point(&LoL_head, &LoL_tail, measure, - nabor_two, lists, where); + nabor_two, lists, where); new_meas = ++(measure_array[nabor_two]); hypre_enter_on_lists(&LoL_head, &LoL_tail, new_meas, - nabor_two, lists, where); + nabor_two, lists, where); } } } } - for (j = S_i[index]; j < S_i[index+1]; j++) + for (j = S_i[index]; j < S_i[index + 1]; j++) { nabor = S_j[j]; /* if (CF_marker[nabor] == UNDECIDED) */ - if (measure_array[nabor]>0) /* undecided point */ + if (measure_array[nabor] > 0) /* undecided point */ { measure = measure_array[nabor]; @@ -424,33 +437,33 @@ hypre_BoomerAMGCoarsenCGCb( hypre_ParCSRMatrix *S, if (measure > 0) hypre_enter_on_lists(&LoL_head, &LoL_tail, measure, nabor, - lists, where); + lists, where); else { /* CF_marker[nabor] = F_PT; */ /* BM Aug 18, 2006 */ --num_left; - for (k = S_i[nabor]; k < S_i[nabor+1]; k++) + for (k = S_i[nabor]; k < S_i[nabor + 1]; k++) { nabor_two = S_j[k]; /* if (CF_marker[nabor_two] == UNDECIDED) */ - if (measure_array[nabor_two]>0) + if (measure_array[nabor_two] > 0) { new_meas = measure_array[nabor_two]; hypre_remove_point(&LoL_head, &LoL_tail, new_meas, - nabor_two, lists, where); + nabor_two, lists, where); new_meas = ++(measure_array[nabor_two]); hypre_enter_on_lists(&LoL_head, &LoL_tail, new_meas, - nabor_two, lists, where); + nabor_two, lists, where); } } } } } } - if (LoL_head) hypre_error_w_msg (HYPRE_ERROR_GENERIC,"Linked list not empty!\n"); /*head: %d\n",LoL_head->head);*/ + if (LoL_head) { hypre_error_w_msg (HYPRE_ERROR_GENERIC, "Linked list not empty!\n"); } /*head: %d\n",LoL_head->head);*/ } l--; /* BM Aug 15, 2006 */ @@ -462,34 +475,38 @@ hypre_BoomerAMGCoarsenCGCb( hypre_ParCSRMatrix *S, { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Coarsen 1st pass = %f\n", - my_id, wall_time); + my_id, wall_time); } hypre_TFree(lists, HYPRE_MEMORY_HOST); hypre_TFree(where, HYPRE_MEMORY_HOST); - if (num_procs>1) { - if (debug_flag == 3) wall_time = time_getWallclockSeconds(); - hypre_BoomerAMGCoarsenCGC (S,l,coarsen_type,CF_marker); + if (num_procs > 1) + { + if (debug_flag == 3) { wall_time = time_getWallclockSeconds(); } + hypre_BoomerAMGCoarsenCGC (S, l, coarsen_type, CF_marker); - if (debug_flag == 3) { + if (debug_flag == 3) + { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Coarsen CGC = %f\n", - my_id, wall_time); + my_id, wall_time); } } - else { + else + { /* the first candiate coarse grid is the coarse grid */ - for (j=0;j 0) + { graph_array[j] = i; + } } - for (ji = S_i[i]; ji < S_i[i+1]; ji++) + for (ji = S_i[i]; ji < S_i[i + 1]; ji++) { j = S_j[ji]; if (CF_marker[j] == -1) { set_empty = 1; - for (jj = S_i[j]; jj < S_i[j+1]; jj++) + for (jj = S_i[j]; jj < S_i[j + 1]; jj++) { index = S_j[jj]; if (graph_array[index] == i) @@ -562,7 +581,7 @@ hypre_BoomerAMGCoarsenCGCb( hypre_ParCSRMatrix *S, { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Coarsen 2nd pass = %f\n", - my_id, wall_time); + my_id, wall_time); } /* third pass, check boundary fine points for coarse neighbors */ @@ -571,34 +590,34 @@ hypre_BoomerAMGCoarsenCGCb( hypre_ParCSRMatrix *S, * Exchange boundary data for CF_marker *------------------------------------------------*/ - if (debug_flag == 3) wall_time = time_getWallclockSeconds(); + if (debug_flag == 3) { wall_time = time_getWallclockSeconds(); } CF_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_offd, HYPRE_MEMORY_HOST); int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, - num_sends), HYPRE_MEMORY_HOST); + num_sends), HYPRE_MEMORY_HOST); index = 0; for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) int_buf_data[index++] - = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } if (num_procs > 1) { comm_handle = hypre_ParCSRCommHandleCreate(11, comm_pkg, int_buf_data, - CF_marker_offd); + CF_marker_offd); hypre_ParCSRCommHandleDestroy(comm_handle); } - hypre_AmgCGCBoundaryFix (S,CF_marker,CF_marker_offd); + hypre_AmgCGCBoundaryFix (S, CF_marker, CF_marker_offd); if (debug_flag == 3) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d CGC boundary fix = %f\n", - my_id, wall_time); + my_id, wall_time); } /*--------------------------------------------------- @@ -607,30 +626,33 @@ hypre_BoomerAMGCoarsenCGCb( hypre_ParCSRMatrix *S, /*if (coarsen_type != 1) { */ - if (CF_marker_offd) hypre_TFree(CF_marker_offd, HYPRE_MEMORY_HOST); /* BM Aug 21, 2006 */ - if (int_buf_data) hypre_TFree(int_buf_data, HYPRE_MEMORY_HOST); /* BM Aug 21, 2006 */ + if (CF_marker_offd) { hypre_TFree(CF_marker_offd, HYPRE_MEMORY_HOST); } /* BM Aug 21, 2006 */ + if (int_buf_data) { hypre_TFree(int_buf_data, HYPRE_MEMORY_HOST); } /* BM Aug 21, 2006 */ /*if (ci_array) hypre_TFree(ci_array);*/ /* BM Aug 21, 2006 */ /*} */ hypre_TFree(graph_array, HYPRE_MEMORY_HOST); if ((measure_type || (coarsen_type != 1 && coarsen_type != 11)) - && num_procs > 1) + && num_procs > 1) + { hypre_CSRMatrixDestroy(S_ext); + } return hypre_error_flag; } /* begin Bram added */ -HYPRE_Int hypre_BoomerAMGCoarsenCGC (hypre_ParCSRMatrix *S,HYPRE_Int numberofgrids,HYPRE_Int coarsen_type,HYPRE_Int *CF_marker) - /* CGC algorithm - * ==================================================================================================== - * coupling : the strong couplings - * numberofgrids : the number of grids - * coarsen_type : the coarsening type - * gridpartition : the grid partition - * =====================================================================================================*/ +HYPRE_Int hypre_BoomerAMGCoarsenCGC (hypre_ParCSRMatrix *S, HYPRE_Int numberofgrids, + HYPRE_Int coarsen_type, HYPRE_Int *CF_marker) +/* CGC algorithm + * ==================================================================================================== + * coupling : the strong couplings + * numberofgrids : the number of grids + * coarsen_type : the coarsening type + * gridpartition : the grid partition + * =====================================================================================================*/ { - HYPRE_Int j,/*p,*/mpisize,mpirank,/*rstart,rend,*/choice,*coarse; + HYPRE_Int j,/*p,*/mpisize, mpirank,/*rstart,rend,*/choice, *coarse; HYPRE_Int *vertexrange = NULL; HYPRE_Int *vertexrange_all = NULL; HYPRE_Int *CF_marker_offd = NULL; @@ -645,33 +667,36 @@ HYPRE_Int hypre_BoomerAMGCoarsenCGC (hypre_ParCSRMatrix *S,HYPRE_Int numberof hypre_CSRMatrix *Gseq; MPI_Comm comm = hypre_ParCSRMatrixComm(S); - hypre_MPI_Comm_size (comm,&mpisize); - hypre_MPI_Comm_rank (comm,&mpirank); + hypre_MPI_Comm_size (comm, &mpisize); + hypre_MPI_Comm_rank (comm, &mpirank); #if 0 - if (!mpirank) { + if (!mpirank) + { wall_time = time_getWallclockSeconds(); hypre_printf ("Starting CGC preparation\n"); } #endif - hypre_AmgCGCPrepare (S,numberofgrids,CF_marker,&CF_marker_offd,coarsen_type,&vertexrange); + hypre_AmgCGCPrepare (S, numberofgrids, CF_marker, &CF_marker_offd, coarsen_type, &vertexrange); #if 0 /* debugging */ - if (!mpirank) { + if (!mpirank) + { wall_time = time_getWallclockSeconds() - wall_time; - hypre_printf ("Finished CGC preparation, wall_time = %f s\n",wall_time); + hypre_printf ("Finished CGC preparation, wall_time = %f s\n", wall_time); wall_time = time_getWallclockSeconds(); hypre_printf ("Starting CGC matrix assembly\n"); } #endif - hypre_AmgCGCGraphAssemble (S,vertexrange,CF_marker,CF_marker_offd,coarsen_type,&ijG); + hypre_AmgCGCGraphAssemble (S, vertexrange, CF_marker, CF_marker_offd, coarsen_type, &ijG); #if 0 - HYPRE_IJMatrixPrint (ijG,"graph.txt"); + HYPRE_IJMatrixPrint (ijG, "graph.txt"); #endif - HYPRE_IJMatrixGetObject (ijG,(void**)&G); + HYPRE_IJMatrixGetObject (ijG, (void**)&G); #if 0 /* debugging */ - if (!mpirank) { + if (!mpirank) + { wall_time = time_getWallclockSeconds() - wall_time; - hypre_printf ("Finished CGC matrix assembly, wall_time = %f s\n",wall_time); + hypre_printf ("Finished CGC matrix assembly, wall_time = %f s\n", wall_time); wall_time = time_getWallclockSeconds(); hypre_printf ("Starting CGC matrix communication\n"); } @@ -679,70 +704,86 @@ HYPRE_Int hypre_BoomerAMGCoarsenCGC (hypre_ParCSRMatrix *S,HYPRE_Int numberof { /* classical CGC does not really make sense with an assumed partition, but anyway, here it is: */ - HYPRE_Int nlocal = vertexrange[1]-vertexrange[0]; - vertexrange_all = hypre_CTAlloc(HYPRE_Int, mpisize+1, HYPRE_MEMORY_HOST); - hypre_MPI_Allgather (&nlocal,1,HYPRE_MPI_INT,vertexrange_all+1,1,HYPRE_MPI_INT,comm); - vertexrange_all[0]=0; - for (j=2;j<=mpisize;j++) vertexrange_all[j]+=vertexrange_all[j-1]; + HYPRE_Int nlocal = vertexrange[1] - vertexrange[0]; + vertexrange_all = hypre_CTAlloc(HYPRE_Int, mpisize + 1, HYPRE_MEMORY_HOST); + hypre_MPI_Allgather (&nlocal, 1, HYPRE_MPI_INT, vertexrange_all + 1, 1, HYPRE_MPI_INT, comm); + vertexrange_all[0] = 0; + for (j = 2; j <= mpisize; j++) { vertexrange_all[j] += vertexrange_all[j - 1]; } } - Gseq = hypre_ParCSRMatrixToCSRMatrixAll (G); + Gseq = hypre_ParCSRMatrixToCSRMatrixAll(G); #if 0 /* debugging */ - if (!mpirank) { + if (!mpirank) + { wall_time = time_getWallclockSeconds() - wall_time; - hypre_printf ("Finished CGC matrix communication, wall_time = %f s\n",wall_time); + hypre_printf ("Finished CGC matrix communication, wall_time = %f s\n", wall_time); } #endif - if (Gseq) { /* BM Aug 31, 2006: Gseq==NULL if G has no local rows */ + if (Gseq) /* BM Aug 31, 2006: Gseq==NULL if G has no local rows */ + { #if 0 /* debugging */ - if (!mpirank) { + if (!mpirank) + { wall_time = time_getWallclockSeconds(); hypre_printf ("Starting CGC election\n"); } #endif - hypre_AmgCGCChoose (Gseq,vertexrange_all,mpisize,&coarse); + hypre_AmgCGCChoose (Gseq, vertexrange_all, mpisize, &coarse); #if 0 /* debugging */ - if (!mpirank) { + if (!mpirank) + { wall_time = time_getWallclockSeconds() - wall_time; - hypre_printf ("Finished CGC election, wall_time = %f s\n",wall_time); + hypre_printf ("Finished CGC election, wall_time = %f s\n", wall_time); } #endif #if 0 /* debugging */ - if (!mpirank) { - for (j=0;j0) - CF_marker[i]+=vstart; + if (coarsen_type % 2 == 1) /* see above */ + { + for (i = 0; i < num_variables; i++) + if (CF_marker[i] > 0) + { + CF_marker[i] += vstart; + } } - else { + else + { /* hypre_printf ("processor %d: empty grid allowed\n",mpirank); */ - for (i=0;i0) - CF_marker[i]+=vstart+1; /* add one because vertexrange[mpirank]+1 denotes the empty grid. + for (i = 0; i < num_variables; i++) + { + if (CF_marker[i] > 0) + { + CF_marker[i] += vstart + 1; + } /* add one because vertexrange[mpirank]+1 denotes the empty grid. Hence, vertexrange[mpirank]+2 is the first coarse grid denoted in global indices, ... */ } @@ -828,39 +879,55 @@ HYPRE_Int hypre_AmgCGCPrepare (hypre_ParCSRMatrix *S,HYPRE_Int nlocal,HYPRE_Int /* exchange data */ *CF_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_offd, HYPRE_MEMORY_HOST); - int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart (comm_pkg, num_sends), HYPRE_MEMORY_HOST); + int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart (comm_pkg, num_sends), + HYPRE_MEMORY_HOST); - for (i=0,ii=0;i1) { - comm_handle = hypre_ParCSRCommHandleCreate (11,comm_pkg,int_buf_data,*CF_marker_offd); + if (mpisize > 1) + { + comm_handle = hypre_ParCSRCommHandleCreate (11, comm_pkg, int_buf_data, *CF_marker_offd); hypre_ParCSRCommHandleDestroy (comm_handle); } hypre_TFree(int_buf_data, HYPRE_MEMORY_HOST); - *vrange=vertexrange; + *vrange = vertexrange; return hypre_error_flag; } #define tag_pointrange 301 #define tag_vertexrange 302 -HYPRE_Int hypre_AmgCGCGraphAssemble (hypre_ParCSRMatrix *S,HYPRE_Int *vertexrange,HYPRE_Int *CF_marker,HYPRE_Int *CF_marker_offd,HYPRE_Int coarsen_type, - HYPRE_IJMatrix *ijG) -/* assemble a graph representing the connections between the grids - * ================================================================================================ +/*-------------------------------------------------------------------------- + * hypre_AmgCGCGraphAssemble + * + * Assemble a graph representing the connections between the grids + * * S : the strength matrix * vertexrange : the parallel layout of the candidate coarse grid vertices * CF_marker, CF_marker_offd : the coarse/fine markers * coarsen_type : the coarsening type * ijG : the created graph - * ================================================================================================*/ + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AmgCGCGraphAssemble(hypre_ParCSRMatrix *S, + HYPRE_Int *vertexrange, + HYPRE_Int *CF_marker, + HYPRE_Int *CF_marker_offd, + HYPRE_Int coarsen_type, + HYPRE_IJMatrix *ijG) { - HYPRE_Int i,/* ii,ip,*/ j,jj,m,n,p; - HYPRE_Int mpisize,mpirank; + HYPRE_UNUSED_VAR(coarsen_type); + + HYPRE_Int i,/* ii,ip,*/ j, jj, m, n, p; + HYPRE_Int mpisize, mpirank; MPI_Comm comm = hypre_ParCSRMatrixComm(S); /* hypre_MPI_Status status; */ @@ -876,166 +943,191 @@ HYPRE_Int hypre_AmgCGCGraphAssemble (hypre_ParCSRMatrix *S,HYPRE_Int *vertexrang HYPRE_Int num_cols_offd = hypre_CSRMatrixNumCols (S_offd); HYPRE_BigInt *col_map_offd = hypre_ParCSRMatrixColMapOffd (S); HYPRE_BigInt *pointrange; - HYPRE_Int *pointrange_nonlocal,*pointrange_strong=NULL; - HYPRE_Int vertexrange_start,vertexrange_end; - HYPRE_Int *vertexrange_strong= NULL; + HYPRE_Int *pointrange_nonlocal, *pointrange_strong = NULL; + HYPRE_Int vertexrange_start, vertexrange_end; + HYPRE_Int *vertexrange_strong = NULL; HYPRE_Int *vertexrange_nonlocal; - HYPRE_Int num_recvs,num_recvs_strong; - HYPRE_Int *recv_procs,*recv_procs_strong=NULL; - HYPRE_Int /* *zeros,*rownz,*/*rownz_diag,*rownz_offd; + HYPRE_Int num_recvs, num_recvs_strong; + HYPRE_Int *recv_procs, *recv_procs_strong = NULL; + HYPRE_Int /* *zeros,*rownz,*/*rownz_diag, *rownz_offd; HYPRE_Int nz; HYPRE_Int nlocal; //HYPRE_Int one=1; hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg (S); - hypre_MPI_Comm_size (comm,&mpisize); - hypre_MPI_Comm_rank (comm,&mpirank); - - HYPRE_BigInt *big_m_n = hypre_TAlloc(HYPRE_BigInt, 2, HYPRE_MEMORY_DEVICE); - HYPRE_Real *weight = hypre_TAlloc(HYPRE_Real, 1, HYPRE_MEMORY_DEVICE); + hypre_MPI_Comm_size (comm, &mpisize); + hypre_MPI_Comm_rank (comm, &mpirank); /* determine neighbor processors */ num_recvs = hypre_ParCSRCommPkgNumRecvs (comm_pkg); recv_procs = hypre_ParCSRCommPkgRecvProcs (comm_pkg); pointrange = hypre_ParCSRMatrixRowStarts (S); - pointrange_nonlocal = hypre_CTAlloc(HYPRE_Int, 2*num_recvs, HYPRE_MEMORY_HOST); - vertexrange_nonlocal = hypre_CTAlloc(HYPRE_Int, 2*num_recvs, HYPRE_MEMORY_HOST); + pointrange_nonlocal = hypre_CTAlloc(HYPRE_Int, 2 * num_recvs, HYPRE_MEMORY_HOST); + vertexrange_nonlocal = hypre_CTAlloc(HYPRE_Int, 2 * num_recvs, HYPRE_MEMORY_HOST); { HYPRE_Int num_sends = hypre_ParCSRCommPkgNumSends (comm_pkg); HYPRE_Int *send_procs = hypre_ParCSRCommPkgSendProcs (comm_pkg); - HYPRE_Int *int_buf_data = hypre_CTAlloc(HYPRE_Int, 4*num_sends, HYPRE_MEMORY_HOST); - HYPRE_Int *int_buf_data2 = int_buf_data + 2*num_sends; - hypre_MPI_Request *sendrequest,*recvrequest; - HYPRE_Int pointrange_start,pointrange_end; + HYPRE_Int *int_buf_data = hypre_CTAlloc(HYPRE_Int, 4 * num_sends, HYPRE_MEMORY_HOST); + HYPRE_Int *int_buf_data2 = int_buf_data + 2 * num_sends; + hypre_MPI_Request *sendrequest, *recvrequest; + HYPRE_Int pointrange_start, pointrange_end; nlocal = vertexrange[1] - vertexrange[0]; pointrange_start = pointrange[0]; pointrange_end = pointrange[1]; vertexrange_start = vertexrange[0]; vertexrange_end = vertexrange[1]; - sendrequest = hypre_CTAlloc(hypre_MPI_Request, 2*(num_sends+num_recvs), HYPRE_MEMORY_HOST); - recvrequest = sendrequest+2*num_sends; + sendrequest = hypre_CTAlloc(hypre_MPI_Request, 2 * (num_sends + num_recvs), HYPRE_MEMORY_HOST); + recvrequest = sendrequest + 2 * num_sends; - for (i=0;i= pointrange_nonlocal[2*p] && jj < pointrange_nonlocal[2*p+1]) break; + for (p = 0; p < num_recvs; p++) /* S_offd_j is NOT sorted! */ + if (jj >= pointrange_nonlocal[2 * p] && jj < pointrange_nonlocal[2 * p + 1]) { break; } #if 0 - hypre_printf ("Processor %d, remote point %d on processor %d\n",mpirank,jj,recv_procs[p]); + hypre_printf ("Processor %d, remote point %d on processor %d\n", mpirank, jj, recv_procs[p]); #endif - recv_procs_strong [p]=1; + recv_procs_strong [p] = 1; } - for (p=0,num_recvs_strong=0;p= pointrange_strong[2*p] && col_map_offd[jj] < pointrange_strong[2*p+1]) break; + for (p = 0; p < num_recvs_strong; p++) + if (col_map_offd[jj] >= pointrange_strong[2 * p] && + col_map_offd[jj] < pointrange_strong[2 * p + 1]) { break; } /*ip=recv_procs_strong[p];*/ /* loop over all coarse grids constructed on this processor domain */ - for (m=vertexrange_start;mlocal/gridpartition->nonlocal starts with one while counting inside range starts with zero */ - if (CF_marker[i]-1==m && CF_marker_offd[jj]-1==n) + if (CF_marker[i] - 1 == m && CF_marker_offd[jj] - 1 == n) /* C-C-coupling */ + { weight[0] = -1; - else if ( (CF_marker[i]-1==m && (CF_marker_offd[jj]==0 || CF_marker_offd[jj]-1!=n) ) - || ( (CF_marker[i]==0 || CF_marker[i]-1!=m) && CF_marker_offd[jj]-1==n ) ) + } + else if ( (CF_marker[i] - 1 == m && (CF_marker_offd[jj] == 0 || CF_marker_offd[jj] - 1 != n) ) + || ( (CF_marker[i] == 0 || CF_marker[i] - 1 != m) && CF_marker_offd[jj] - 1 == n ) ) /* C-F-coupling */ + { weight[0] = 0; - else weight[0] = -8; /* F-F-coupling */ + } + else { weight[0] = -8; } /* F-F-coupling */ HYPRE_IJMatrixAddToValues (ijmatrix, 1, NULL, &big_m_n[0], &big_m_n[1], &weight[0]); /*#if 0 if (ierr) hypre_printf ("Processor %d: error %d while adding %lf to entry (%d, %d)\n",mpirank,ierr,weight,m,n); -#endif*/ + #endif*/ } } } @@ -1048,8 +1140,8 @@ HYPRE_Int hypre_AmgCGCGraphAssemble (hypre_ParCSRMatrix *S,HYPRE_Int *vertexrang hypre_TFree(pointrange_strong, HYPRE_MEMORY_HOST); hypre_TFree(vertexrange_strong, HYPRE_MEMORY_HOST); - hypre_TFree(big_m_n, HYPRE_MEMORY_DEVICE); - hypre_TFree(weight, HYPRE_MEMORY_DEVICE); + hypre_TFree(big_m_n, memory_location); + hypre_TFree(weight, memory_location); /*} */ @@ -1057,17 +1149,18 @@ HYPRE_Int hypre_AmgCGCGraphAssemble (hypre_ParCSRMatrix *S,HYPRE_Int *vertexrang return hypre_error_flag; } -HYPRE_Int hypre_AmgCGCChoose (hypre_CSRMatrix *G,HYPRE_Int *vertexrange,HYPRE_Int mpisize,HYPRE_Int **coarse) - /* chooses one grid for every processor - * ============================================================ - * G : the connectivity graph - * map : the parallel layout - * mpisize : number of procs - * coarse : the chosen coarse grids - * ===========================================================*/ +HYPRE_Int hypre_AmgCGCChoose (hypre_CSRMatrix *G, HYPRE_Int *vertexrange, HYPRE_Int mpisize, + HYPRE_Int **coarse) +/* chooses one grid for every processor + * ============================================================ + * G : the connectivity graph + * map : the parallel layout + * mpisize : number of procs + * coarse : the chosen coarse grids + * ===========================================================*/ { - HYPRE_Int i,j,jj,p,choice,*processor; - HYPRE_Int measure,new_measure; + HYPRE_Int i, j, jj, p, choice, *processor; + HYPRE_Int measure, new_measure; /* MPI_Comm comm = hypre_ParCSRMatrixComm(G); */ @@ -1078,19 +1171,19 @@ HYPRE_Int hypre_AmgCGCChoose (hypre_CSRMatrix *G,HYPRE_Int *vertexrange,HYPRE_In HYPRE_Real max; HYPRE_Int *G_i = hypre_CSRMatrixI(G); HYPRE_Int *G_j = hypre_CSRMatrixJ(G); - hypre_CSRMatrix *H,*HT; - HYPRE_Int *H_i,*H_j,*HT_i,*HT_j; - HYPRE_Int jG,jH; + hypre_CSRMatrix *H, *HT; + HYPRE_Int *H_i, *H_j, *HT_i, *HT_j; + HYPRE_Int jG, jH; HYPRE_Int num_vertices = hypre_CSRMatrixNumRows (G); HYPRE_Int *measure_array; - HYPRE_Int *lists,*where; + HYPRE_Int *lists, *where; hypre_LinkList LoL_head = NULL; hypre_LinkList LoL_tail = NULL; processor = hypre_CTAlloc(HYPRE_Int, num_vertices, HYPRE_MEMORY_HOST); *coarse = hypre_CTAlloc(HYPRE_Int, mpisize, HYPRE_MEMORY_HOST); - memset (*coarse,0,sizeof(HYPRE_Int)*mpisize); + memset (*coarse, 0, sizeof(HYPRE_Int)*mpisize); measure_array = hypre_CTAlloc(HYPRE_Int, num_vertices, HYPRE_MEMORY_HOST); lists = hypre_CTAlloc(HYPRE_Int, num_vertices, HYPRE_MEMORY_HOST); @@ -1103,42 +1196,49 @@ HYPRE_Int hypre_AmgCGCChoose (hypre_CSRMatrix *G,HYPRE_Int *vertexrange,HYPRE_In ******************************************************************/ jG = G_i[num_vertices]; - H = hypre_CSRMatrixCreate (num_vertices,num_vertices,jG); - H_i = hypre_CTAlloc(HYPRE_Int, num_vertices+1, HYPRE_MEMORY_HOST); + H = hypre_CSRMatrixCreate (num_vertices, num_vertices, jG); + H_i = hypre_CTAlloc(HYPRE_Int, num_vertices + 1, HYPRE_MEMORY_HOST); H_j = hypre_CTAlloc(HYPRE_Int, jG, HYPRE_MEMORY_HOST); hypre_CSRMatrixI(H) = H_i; hypre_CSRMatrixJ(H) = H_j; hypre_CSRMatrixMemoryLocation(H) = HYPRE_MEMORY_HOST; - for (i=0,p=0;i=0.0) - hypre_printf ("G[%d,%d]=0. G_j(j)=%d, G_data(j)=%f.\n",i,G_j[j],j,G_data[j]); + if (G_data[j] >= 0.0) + { + hypre_printf ("G[%d,%d]=0. G_j(j)=%d, G_data(j)=%f.\n", i, G_j[j], j, G_data[j]); + } #endif /* G_data is always negative, so this test is sufficient */ - if (choice==-1 || G_data[j]>max) { + if (choice == -1 || G_data[j] > max) + { choice = G_j[j]; max = G_data[j]; } - if (j==G_i[i+1]-1 || processor[G_j[j+1]] > processor[choice]) { + if (j == G_i[i + 1] - 1 || processor[G_j[j + 1]] > processor[choice]) + { /* we are done for this processor boundary */ - H_j[jj++]=choice; - H_i[i+1]++; + H_j[jj++] = choice; + H_i[i + 1]++; #if 0 - hypre_printf (" %d",choice); + hypre_printf (" %d", choice); #endif - choice = -1; max=0; + choice = -1; max = 0; } } #if 0 @@ -1151,30 +1251,37 @@ HYPRE_Int hypre_AmgCGCChoose (hypre_CSRMatrix *G,HYPRE_Int *vertexrange,HYPRE_In ******************************************************************/ jH = H_i[num_vertices]; - HT = hypre_CSRMatrixCreate (num_vertices,num_vertices,jH); - HT_i = hypre_CTAlloc(HYPRE_Int, num_vertices+1, HYPRE_MEMORY_HOST); + HT = hypre_CSRMatrixCreate (num_vertices, num_vertices, jH); + HT_i = hypre_CTAlloc(HYPRE_Int, num_vertices + 1, HYPRE_MEMORY_HOST); HT_j = hypre_CTAlloc(HYPRE_Int, jH, HYPRE_MEMORY_HOST); hypre_CSRMatrixI(HT) = HT_i; hypre_CSRMatrixJ(HT) = HT_j; hypre_CSRMatrixMemoryLocation(HT) = HYPRE_MEMORY_HOST; - for (i=0; i <= num_vertices; i++) + for (i = 0; i <= num_vertices; i++) + { HT_i[i] = 0; - for (i=0; i < jH; i++) { - HT_i[H_j[i]+1]++; } - for (i=0; i < num_vertices; i++) { - HT_i[i+1] += HT_i[i]; + for (i = 0; i < jH; i++) + { + HT_i[H_j[i] + 1]++; + } + for (i = 0; i < num_vertices; i++) + { + HT_i[i + 1] += HT_i[i]; } - for (i=0; i < num_vertices; i++) { - for (j=H_i[i]; j < H_i[i+1]; j++) { + for (i = 0; i < num_vertices; i++) + { + for (j = H_i[i]; j < H_i[i + 1]; j++) + { HYPRE_Int myindex = H_j[j]; HT_j[HT_i[myindex]] = i; HT_i[myindex]++; } } - for (i = num_vertices; i > 0; i--) { - HT_i[i] = HT_i[i-1]; + for (i = num_vertices; i > 0; i--) + { + HT_i[i] = HT_i[i - 1]; } HT_i[0] = 0; @@ -1182,72 +1289,82 @@ HYPRE_Int hypre_AmgCGCChoose (hypre_CSRMatrix *G,HYPRE_Int *vertexrange,HYPRE_In * set initial vertex weights *****************************************************************/ - for (i=0;ihead]) { + while (LoL_head && measure_array[LoL_head->head]) + { choice = LoL_head->head; measure = measure_array[choice]; #if 0 - hypre_printf ("Choice: %d, measure %d, processor %d\n",choice, measure,processor[choice]); + hypre_printf ("Choice: %d, measure %d, processor %d\n", choice, measure, processor[choice]); fflush(stdout); #endif - (*coarse)[processor[choice]] = choice+1; /* add one because coarsegrid indexing starts with 1, not 0 */ + (*coarse)[processor[choice]] = choice + + 1; /* add one because coarsegrid indexing starts with 1, not 0 */ /* new maximal weight */ - new_measure = measure+1; - for (i=vertexrange[processor[choice]];ihead; measure = measure_array[i]; #if 0 - hypre_assert (measure==0); + hypre_assert (measure == 0); #endif - hypre_remove_point (&LoL_head,&LoL_tail,measure,i,lists,where); + hypre_remove_point (&LoL_head, &LoL_tail, measure, i, lists, where); } - for (p=0;p= 0.0) + if (max_eig <= 0.0) + { + upper_bound = min_eig * 1.1; + lower_bound = max_eig - (max_eig - upper_bound) * fraction; + } + else { /* make sure we are large enough - Adams et al. 2003 */ upper_bound = max_eig * 1.1; /* lower_bound = max_eig/fraction; */ lower_bound = (upper_bound - min_eig) * fraction + min_eig; } - else if (max_eig <= 0.0) - { - upper_bound = min_eig * 1.1; - lower_bound = max_eig - (max_eig - upper_bound) * fraction; - } /* theta and delta */ - theta = (upper_bound + lower_bound)/2; - delta = (upper_bound - lower_bound)/2; + theta = (upper_bound + lower_bound) / 2; + delta = (upper_bound - lower_bound) / 2; if (variant == 1) { - switch ( cheby_order ) /* these are the corresponding cheby polynomials: u = u_o + s(A)r_0 - so order is - one less that resid poly: r(t) = 1 - t*s(t) */ + switch (cheby_order) /* these are the corresponding cheby polynomials: u = u_o + s(A)r_0 - so order is + one less that resid poly: r(t) = 1 - t*s(t) */ { case 0: - coefs[0] = 1.0/theta; + coefs[0] = 1.0 / theta; break; case 1: /* (del - t + 2*th)/(th^2 + del*th) */ - den = (theta*theta + delta*theta); + den = (theta * theta + delta * theta); - coefs[0] = (delta + 2*theta)/den; - coefs[1] = -1.0/den; + coefs[0] = (delta + 2 * theta) / den; + coefs[1] = -1.0 / den; break; case 2: /* (4*del*th - del^2 - t*(2*del + 6*th) + 2*t^2 + 6*th^2)/(2*del*th^2 - del^2*th - del^3 + 2*th^3)*/ - den = 2*delta*theta*theta - delta*delta*theta - pow(delta,3) + 2*pow(theta,3); + den = 2 * delta * theta * theta - delta * delta * theta - + hypre_pow(delta, 3) + 2 * hypre_pow(theta, 3); - coefs[0] = (4*delta*theta - pow(delta,2) + 6*pow(theta,2))/den; - coefs[1] = -(2*delta + 6*theta)/den; - coefs[2] = 2/den; + coefs[0] = (4 * delta * theta - hypre_pow(delta, 2) + 6 * hypre_pow(theta, 2)) / den; + coefs[1] = -(2 * delta + 6 * theta) / den; + coefs[2] = 2 / den; break; case 3: /* -(6*del^2*th - 12*del*th^2 - t^2*(4*del + 16*th) + t*(12*del*th - 3*del^2 + 24*th^2) + 3*del^3 + 4*t^3 - 16*th^3)/(4*del*th^3 - 3*del^2*th^2 - 3*del^3*th + 4*th^4)*/ - den = - (4*delta*pow(theta,3) - 3*pow(delta,2)*pow(theta,2) - 3*pow(delta,3)*theta + 4*pow(theta,4) ); - - coefs[0] = (6*pow(delta,2)*theta - 12*delta*pow(theta,2) + 3*pow(delta,3) - 16*pow(theta,3) )/den; - coefs[1] = (12*delta*theta - 3*pow(delta,2) + 24*pow(theta,2))/den; - coefs[2] = -( 4*delta + 16*theta)/den; - coefs[3] = 4/den; + den = - 4 * delta * hypre_pow(theta, 3) + + 3 * hypre_pow(delta, 2) * hypre_pow(theta, 2) + + 3 * hypre_pow(delta, 3) * theta - + 4 * hypre_pow(theta, 4); + + coefs[0] = (6 * hypre_pow(delta, 2) * theta - + 12 * delta * hypre_pow(theta, 2) + + 3 * hypre_pow(delta, 3) - + 16 * hypre_pow(theta, 3) ) / den; + coefs[1] = (12 * delta * theta - + 3 * hypre_pow(delta, 2) + + 24 * hypre_pow(theta, 2)) / den; + coefs[2] = -( 4 * delta + 16 * theta) / den; + coefs[3] = 4 / den; break; } @@ -148,37 +157,37 @@ hypre_ParCSRRelax_Cheby_Setup(hypre_ParCSRMatrix *A, /* matrix to relax else /* standard chebyshev */ { - switch ( cheby_order ) /* these are the corresponding cheby polynomials: u = u_o + s(A)r_0 - so order is - one less thatn resid poly: r(t) = 1 - t*s(t) */ + switch (cheby_order) /* these are the corresponding cheby polynomials: u = u_o + s(A)r_0 - so order is + one less thatn resid poly: r(t) = 1 - t*s(t) */ { case 0: - coefs[0] = 1.0/theta; + coefs[0] = 1.0 / theta; break; case 1: /* ( 2*t - 4*th)/(del^2 - 2*th^2) */ - den = delta*delta - 2*theta*theta; + den = delta * delta - 2 * theta * theta; - coefs[0] = -4*theta/den; - coefs[1] = 2/den; + coefs[0] = -4 * theta / den; + coefs[1] = 2 / den; break; case 2: /* (3*del^2 - 4*t^2 + 12*t*th - 12*th^2)/(3*del^2*th - 4*th^3)*/ - den = 3*(delta*delta)*theta - 4*(theta*theta*theta); + den = 3 * (delta * delta) * theta - 4 * (theta * theta * theta); - coefs[0] = (3*delta*delta - 12 *theta*theta)/den; - coefs[1] = 12*theta/den; - coefs[2] = -4/den; + coefs[0] = (3 * delta * delta - 12 * theta * theta) / den; + coefs[1] = 12 * theta / den; + coefs[2] = -4 / den; break; case 3: /*(t*(8*del^2 - 48*th^2) - 16*del^2*th + 32*t^2*th - 8*t^3 + 32*th^3)/(del^4 - 8*del^2*th^2 + 8*th^4)*/ - den = pow(delta,4) - 8*delta*delta*theta*theta + 8*pow(theta,4); + den = hypre_pow(delta, 4) - 8 * delta * delta * theta * theta + 8 * hypre_pow(theta, 4); - coefs[0] = (32*pow(theta,3)- 16*delta*delta*theta)/den; - coefs[1] = (8*delta*delta - 48*theta*theta)/den; - coefs[2] = 32*theta/den; - coefs[3] = -8/den; + coefs[0] = (32 * hypre_pow(theta, 3) - 16 * delta * delta * theta) / den; + coefs[1] = (8 * delta * delta - 48 * theta * theta) / den; + coefs[2] = 32 * theta / den; + coefs[3] = -8 / den; break; } @@ -187,7 +196,7 @@ hypre_ParCSRRelax_Cheby_Setup(hypre_ParCSRMatrix *A, /* matrix to relax if (scale) { - /*grab 1/sqrt(abs(diagonal)) */ + /*grab 1/hypre_sqrt(abs(diagonal)) */ ds_data = hypre_CTAlloc(HYPRE_Real, num_rows, hypre_ParCSRMatrixMemoryLocation(A)); hypre_CSRMatrixExtractDiagonal(hypre_ParCSRMatrixDiag(A), ds_data, 4); } /* end of scaling code */ @@ -226,6 +235,8 @@ hypre_ParCSRRelax_Cheby_SolveHost(hypre_ParCSRMatrix *A, /* matrix to relax with hypre_ParVector *orig_u_vec, /*another temp vector */ hypre_ParVector *tmp_vec) /*a potential temp vector */ { + HYPRE_UNUSED_VAR(variant); + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); HYPRE_Real *u_data = hypre_VectorData(hypre_ParVectorLocalVector(u)); HYPRE_Real *f_data = hypre_VectorData(hypre_ParVectorLocalVector(f)); @@ -247,12 +258,16 @@ hypre_ParCSRRelax_Cheby_SolveHost(hypre_ParCSRMatrix *A, /* matrix to relax with /* u = u + p(A)r */ if (order > 4) + { order = 4; + } if (order < 1) + { order = 1; + } /* we are using the order of p(A) */ - cheby_order = order -1; + cheby_order = order - 1; hypre_assert(hypre_VectorSize(hypre_ParVectorLocalVector(orig_u_vec)) >= num_rows); orig_u = hypre_VectorData(hypre_ParVectorLocalVector(orig_u_vec)); @@ -275,7 +290,7 @@ hypre_ParCSRRelax_Cheby_SolveHost(hypre_ParCSRMatrix *A, /* matrix to relax with mult = coefs[i]; /* u = mult * r + v */ #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(j) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(j) HYPRE_SMP_SCHEDULE #endif for ( j = 0; j < num_rows; j++ ) { @@ -285,7 +300,7 @@ hypre_ParCSRRelax_Cheby_SolveHost(hypre_ParCSRMatrix *A, /* matrix to relax with /* u = o + u */ #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif for ( i = 0; i < num_rows; i++ ) { @@ -295,16 +310,16 @@ hypre_ParCSRRelax_Cheby_SolveHost(hypre_ParCSRMatrix *A, /* matrix to relax with else /* scaling! */ { - /*grab 1/sqrt(diagonal) */ + /*grab 1/hypre_sqrt(diagonal) */ tmp_data = hypre_VectorData(hypre_ParVectorLocalVector(tmp_vec)); - /* get ds_data and get scaled residual: r = D^(-1/2)f - - * D^(-1/2)A*u */ + /* get ds_data and get scaled residual: r = D^(-1/2)f - + * D^(-1/2)A*u */ hypre_ParCSRMatrixMatvec(-1.0, A, u, 0.0, tmp_vec); /* r = ds .* (f + tmp) */ #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(j) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(j) HYPRE_SMP_SCHEDULE #endif for ( j = 0; j < num_rows; j++ ) { @@ -316,7 +331,7 @@ hypre_ParCSRRelax_Cheby_SolveHost(hypre_ParCSRMatrix *A, /* matrix to relax with /* o = u; u = r * coef */ #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(j) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(j) HYPRE_SMP_SCHEDULE #endif for ( j = 0; j < num_rows; j++ ) { @@ -331,7 +346,7 @@ hypre_ParCSRRelax_Cheby_SolveHost(hypre_ParCSRMatrix *A, /* matrix to relax with /* v = D^(-1/2)AD^(-1/2)u */ /* tmp = ds .* u */ #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(j) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(j) HYPRE_SMP_SCHEDULE #endif for ( j = 0; j < num_rows; j++ ) { @@ -344,11 +359,11 @@ hypre_ParCSRRelax_Cheby_SolveHost(hypre_ParCSRMatrix *A, /* matrix to relax with /* u = coef * r + ds .* v */ #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(j) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(j) HYPRE_SMP_SCHEDULE #endif for ( j = 0; j < num_rows; j++ ) { - u_data[j] = mult * r_data[j] + ds_data[j]*v_data[j]; + u_data[j] = mult * r_data[j] + ds_data[j] * v_data[j]; } } /* end of cheby_order loop */ @@ -357,11 +372,11 @@ hypre_ParCSRRelax_Cheby_SolveHost(hypre_ParCSRMatrix *A, /* matrix to relax with /* u = orig_u + ds .* u */ #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(j) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(j) HYPRE_SMP_SCHEDULE #endif for ( j = 0; j < num_rows; j++ ) { - u_data[j] = orig_u[j] + ds_data[j]*u_data[j]; + u_data[j] = orig_u[j] + ds_data[j] * u_data[j]; } }/* end of scaling code */ @@ -401,25 +416,31 @@ hypre_ParCSRRelax_Cheby_Solve(hypre_ParCSRMatrix *A, /* matrix to relax with */ hypre_ParVector *orig_u_vec, /*another temp vector */ hypre_ParVector *tmp_vec) /*another temp vector */ { -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_GpuProfilingPushRange("ParCSRRelaxChebySolve"); -#endif - HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1(hypre_ParCSRMatrixMemoryLocation(A)); HYPRE_Int ierr = 0; - if (exec == HYPRE_EXEC_HOST) + /* Sanity check */ + if (hypre_ParVectorNumVectors(f) > 1) { - ierr = hypre_ParCSRRelax_Cheby_SolveHost(A, f, ds_data, coefs, order, scale, variant, u, v, r, orig_u_vec, tmp_vec); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "Requested relaxation type doesn't support multicomponent vectors"); + return hypre_error_flag; } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - else + +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1(hypre_ParCSRMatrixMemoryLocation(A)); + if (exec == HYPRE_EXEC_DEVICE) { - ierr = hypre_ParCSRRelax_Cheby_SolveDevice(A, f, ds_data, coefs, order, scale, variant, u, v, r, orig_u_vec, tmp_vec); + ierr = hypre_ParCSRRelax_Cheby_SolveDevice(A, f, ds_data, coefs, order, scale, variant, u, v, r, + orig_u_vec, tmp_vec); } + else #endif + { + ierr = hypre_ParCSRRelax_Cheby_SolveHost(A, f, ds_data, coefs, order, scale, variant, u, v, r, + orig_u_vec, tmp_vec); + } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_GpuProfilingPopRange(); -#endif return ierr; } diff --git a/external/hypre/src/parcsr_ls/par_cheby_device.c b/external/hypre/src/parcsr_ls/par_cheby_device.c index 18ccdb4c..8208b143 100644 --- a/external/hypre/src/parcsr_ls/par_cheby_device.c +++ b/external/hypre/src/parcsr_ls/par_cheby_device.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -11,13 +11,18 @@ * *****************************************************************************/ +#include "_hypre_onedpl.hpp" #include "_hypre_parcsr_ls.h" #include "_hypre_parcsr_mv.h" #include "float.h" -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) #include "_hypre_utilities.hpp" +#if defined(HYPRE_USING_SYCL) +namespace thrust = std; +#endif + /** * @brief waxpyz * @@ -33,7 +38,7 @@ struct waxpyz const T scale; waxpyz(T _scale) : scale(_scale) {} - __host__ __device__ void operator()(Tuple t) + __host__ __device__ void operator()(Tuple t) const { thrust::get<0>(t) = scale * thrust::get<1>(t) + thrust::get<2>(t) * thrust::get<3>(t); } @@ -50,7 +55,7 @@ template struct wxypz { typedef thrust::tuple Tuple; - __host__ __device__ void operator()(Tuple t) + __host__ __device__ void operator()(Tuple t) const { thrust::get<0>(t) = thrust::get<1>(t) * (thrust::get<2>(t) + thrust::get<3>(t)); } @@ -72,7 +77,7 @@ struct save_and_scale save_and_scale(T _scale) : scale(_scale) {} - __host__ __device__ void operator()(Tuple t) + __host__ __device__ void operator()(Tuple t) const { thrust::get<0>(t) = thrust::get<1>(t); thrust::get<1>(t) = thrust::get<2>(t) * scale; @@ -91,7 +96,7 @@ struct xpyz { typedef thrust::tuple Tuple; - __host__ __device__ void operator()(Tuple t) + __host__ __device__ void operator()(Tuple t) const { thrust::get<0>(t) = thrust::get<1>(t) + thrust::get<2>(t) * thrust::get<0>(t); } @@ -125,6 +130,8 @@ hypre_ParCSRRelax_Cheby_SolveDevice(hypre_ParCSRMatrix *A, /* matrix to relax wi hypre_ParVector *orig_u_vec, /*another temp vector */ hypre_ParVector *tmp_vec) /*a potential temp vector */ { + HYPRE_UNUSED_VAR(variant); + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); HYPRE_Real *u_data = hypre_VectorData(hypre_ParVectorLocalVector(u)); HYPRE_Real *f_data = hypre_VectorData(hypre_ParVectorLocalVector(f)); @@ -143,8 +150,8 @@ hypre_ParCSRRelax_Cheby_SolveDevice(hypre_ParCSRMatrix *A, /* matrix to relax wi /* u = u + p(A)r */ - if (order > 4) order = 4; - if (order < 1) order = 1; + if (order > 4) { order = 4; } + if (order < 1) { order = 1; } /* we are using the order of p(A) */ cheby_order = order - 1; @@ -159,28 +166,38 @@ hypre_ParCSRRelax_Cheby_SolveDevice(hypre_ParCSRMatrix *A, /* matrix to relax wi hypre_ParCSRMatrixMatvec(-1.0, A, u, 1.0, r); /* o = u; u = r .* coef */ +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( + std::for_each, + oneapi::dpl::make_zip_iterator(orig_u, u_data, r_data), + oneapi::dpl::make_zip_iterator(orig_u + num_rows, u_data + num_rows, + r_data + num_rows), + save_and_scale(coefs[cheby_order])); +#else HYPRE_THRUST_CALL( - for_each, - thrust::make_zip_iterator(thrust::make_tuple(orig_u, u_data, r_data)), - thrust::make_zip_iterator(thrust::make_tuple(orig_u + num_rows, u_data + num_rows, r_data + num_rows)), - save_and_scale(coefs[cheby_order])); + for_each, + thrust::make_zip_iterator(thrust::make_tuple(orig_u, u_data, r_data)), + thrust::make_zip_iterator(thrust::make_tuple(orig_u + num_rows, u_data + num_rows, + r_data + num_rows)), + save_and_scale(coefs[cheby_order])); +#endif for (i = cheby_order - 1; i >= 0; i--) { hypre_ParCSRMatrixMatvec(1.0, A, u, 0.0, v); mult = coefs[i]; - /* u = mult * r + v */ - HYPRE_THRUST_CALL( transform, r_data, r_data + num_rows, v_data, u_data, mult * _1 + _2 ); + /* u = mult * r + v */ + hypreDevice_ComplexAxpyn( r_data, num_rows, v_data, u_data, mult ); } /* u = o + u */ - HYPRE_THRUST_CALL(transform, orig_u, orig_u + num_rows, u_data, u_data, _1 + _2); + hypreDevice_ComplexAxpyn( orig_u, num_rows, u_data, u_data, 1.0); } else /* scaling! */ { - /*grab 1/sqrt(diagonal) */ + /*grab 1/hypre_sqrt(diagonal) */ tmp_data = hypre_VectorData(hypre_ParVectorLocalVector(tmp_vec)); @@ -192,26 +209,45 @@ hypre_ParCSRRelax_Cheby_SolveDevice(hypre_ParCSRMatrix *A, /* matrix to relax wi /* TODO: It might be possible to merge this and the next call to: * r[j] = ds_data[j] * (f_data[j] + tmp_data[j]); o[j] = u[j]; u[j] = r[j] * coef */ +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL(std::for_each, + oneapi::dpl::make_zip_iterator(r_data, ds_data, f_data, tmp_data), + oneapi::dpl::make_zip_iterator(r_data, ds_data, f_data, tmp_data) + num_rows, + wxypz()); +#else HYPRE_THRUST_CALL(for_each, thrust::make_zip_iterator(thrust::make_tuple(r_data, ds_data, f_data, tmp_data)), thrust::make_zip_iterator(thrust::make_tuple(r_data, ds_data, f_data, tmp_data)) + num_rows, wxypz()); +#endif /* save original u, then start the iteration by multiplying r by the cheby coef.*/ /* o = u; u = r * coef */ +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL(std::for_each, + oneapi::dpl::make_zip_iterator(orig_u, u_data, r_data), + oneapi::dpl::make_zip_iterator(orig_u, u_data, r_data) + num_rows, + save_and_scale(coefs[cheby_order])); +#else HYPRE_THRUST_CALL(for_each, thrust::make_zip_iterator(thrust::make_tuple(orig_u, u_data, r_data)), thrust::make_zip_iterator(thrust::make_tuple(orig_u, u_data, r_data)) + num_rows, save_and_scale(coefs[cheby_order])); +#endif /* now do the other coefficients */ for (i = cheby_order - 1; i >= 0; i--) { /* v = D^(-1/2)AD^(-1/2)u */ /* tmp = ds .* u */ +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::transform, ds_data, ds_data + num_rows, u_data, tmp_data, + std::multiplies() ); +#else HYPRE_THRUST_CALL( transform, ds_data, ds_data + num_rows, u_data, tmp_data, _1 * _2 ); +#endif hypre_ParCSRMatrixMatvec(1.0, A, tmp_vec, 0.0, v); @@ -219,20 +255,36 @@ hypre_ParCSRRelax_Cheby_SolveDevice(hypre_ParCSRMatrix *A, /* matrix to relax wi mult = coefs[i]; /* u = coef * r + ds .* v */ +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL(std::for_each, + oneapi::dpl::make_zip_iterator(u_data, r_data, ds_data, v_data), + oneapi::dpl::make_zip_iterator(u_data, r_data, ds_data, v_data) + num_rows, + waxpyz(mult)); +#else HYPRE_THRUST_CALL(for_each, thrust::make_zip_iterator(thrust::make_tuple(u_data, r_data, ds_data, v_data)), thrust::make_zip_iterator(thrust::make_tuple(u_data, r_data, ds_data, v_data)) + num_rows, waxpyz(mult)); +#endif } /* end of cheby_order loop */ /* now we have to scale u_data before adding it to u_orig*/ /* u = orig_u + ds .* u */ +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( + std::for_each, + oneapi::dpl::make_zip_iterator(u_data, orig_u, ds_data), + oneapi::dpl::make_zip_iterator(u_data + num_rows, orig_u + num_rows, ds_data + num_rows), + xpyz()); +#else HYPRE_THRUST_CALL( - for_each, - thrust::make_zip_iterator(thrust::make_tuple(u_data, orig_u, ds_data)), - thrust::make_zip_iterator(thrust::make_tuple(u_data + num_rows, orig_u + num_rows, ds_data + num_rows)), - xpyz()); + for_each, + thrust::make_zip_iterator(thrust::make_tuple(u_data, orig_u, ds_data)), + thrust::make_zip_iterator(thrust::make_tuple(u_data + num_rows, orig_u + num_rows, + ds_data + num_rows)), + xpyz()); +#endif } /* end of scaling code */ diff --git a/external/hypre/src/parcsr_ls/par_coarse_parms.c b/external/hypre/src/parcsr_ls/par_coarse_parms.c index d3d974a0..22b5f2dc 100644 --- a/external/hypre/src/parcsr_ls/par_coarse_parms.c +++ b/external/hypre/src/parcsr_ls/par_coarse_parms.c @@ -1,23 +1,12 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ -/****************************************************************************** - * - *****************************************************************************/ - -/* following should be in a header file */ - - #include "_hypre_parcsr_ls.h" - - -/*==========================================================================*/ -/*==========================================================================*/ /** Generates global coarse_size and dof_func for next coarser level @@ -46,37 +35,32 @@ marker array for coarse points @param coarse_dof_func_ptr [OUT] pointer to array which contains the function numbers for local coarse points - @param coarse_pnts_global_ptr [OUT] + @param coarse_pnts_global [OUT] pointer to array which contains the number of the first coarse point on each processor and the total number of coarse points in its last element @see */ /*--------------------------------------------------------------------------*/ HYPRE_Int -hypre_BoomerAMGCoarseParmsHost(MPI_Comm comm, - HYPRE_Int local_num_variables, - HYPRE_Int num_functions, - hypre_IntArray *dof_func, - hypre_IntArray *CF_marker, - hypre_IntArray **coarse_dof_func_ptr, - HYPRE_BigInt **coarse_pnts_global_ptr) +hypre_BoomerAMGCoarseParmsHost(MPI_Comm comm, + HYPRE_Int local_num_variables, + HYPRE_Int num_functions, + hypre_IntArray *dof_func, + hypre_IntArray *CF_marker, + hypre_IntArray **coarse_dof_func_ptr, + HYPRE_BigInt *coarse_pnts_global) { #ifdef HYPRE_PROFILE hypre_profile_times[HYPRE_TIMER_ID_COARSE_PARAMS] -= hypre_MPI_Wtime(); #endif - HYPRE_Int i; - HYPRE_Int num_procs; - HYPRE_BigInt local_coarse_size = 0; - - HYPRE_Int *coarse_dof_func; - HYPRE_BigInt *coarse_pnts_global; + HYPRE_Int i; + HYPRE_BigInt local_coarse_size = 0; + HYPRE_Int *coarse_dof_func; /*-------------------------------------------------------------- *----------------------------------------------------------------*/ - hypre_MPI_Comm_size(comm,&num_procs); - for (i = 0; i < local_num_variables; i++) { if (hypre_IntArrayData(CF_marker)[i] == 1) @@ -84,6 +68,7 @@ hypre_BoomerAMGCoarseParmsHost(MPI_Comm comm, local_coarse_size++; } } + if (num_functions > 1) { *coarse_dof_func_ptr = hypre_IntArrayCreate(local_coarse_size); @@ -102,8 +87,6 @@ hypre_BoomerAMGCoarseParmsHost(MPI_Comm comm, { HYPRE_BigInt scan_recv; - - coarse_pnts_global = hypre_CTAlloc(HYPRE_BigInt, 2, HYPRE_MEMORY_HOST); hypre_MPI_Scan(&local_coarse_size, &scan_recv, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); /* first point in my range */ @@ -113,12 +96,6 @@ hypre_BoomerAMGCoarseParmsHost(MPI_Comm comm, coarse_pnts_global[1] = scan_recv; } - if (*coarse_pnts_global_ptr) - { - hypre_TFree(*coarse_pnts_global_ptr, HYPRE_MEMORY_HOST); - } - *coarse_pnts_global_ptr = coarse_pnts_global; - #ifdef HYPRE_PROFILE hypre_profile_times[HYPRE_TIMER_ID_COARSE_PARAMS] += hypre_MPI_Wtime(); #endif @@ -127,34 +104,36 @@ hypre_BoomerAMGCoarseParmsHost(MPI_Comm comm, } HYPRE_Int -hypre_BoomerAMGCoarseParms(MPI_Comm comm, - HYPRE_Int local_num_variables, - HYPRE_Int num_functions, - hypre_IntArray *dof_func, - hypre_IntArray *CF_marker, - hypre_IntArray **coarse_dof_func_ptr, - HYPRE_BigInt **coarse_pnts_global_ptr) +hypre_BoomerAMGCoarseParms(MPI_Comm comm, + HYPRE_Int local_num_variables, + HYPRE_Int num_functions, + hypre_IntArray *dof_func, + hypre_IntArray *CF_marker, + hypre_IntArray **coarse_dof_func_ptr, + HYPRE_BigInt *coarse_pnts_global) { - HYPRE_Int ierr = 0; +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec; -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1(hypre_IntArrayMemoryLocation(CF_marker)); if (num_functions > 1) { - exec = hypre_GetExecPolicy2(hypre_IntArrayMemoryLocation(CF_marker), hypre_IntArrayMemoryLocation(dof_func)); + exec = hypre_GetExecPolicy2(hypre_IntArrayMemoryLocation(CF_marker), + hypre_IntArrayMemoryLocation(dof_func)); + } + else + { + exec = hypre_GetExecPolicy1(hypre_IntArrayMemoryLocation(CF_marker)); } if (exec == HYPRE_EXEC_DEVICE) { - ierr = hypre_BoomerAMGCoarseParmsDevice(comm, local_num_variables, num_functions, dof_func, - CF_marker, coarse_dof_func_ptr, coarse_pnts_global_ptr); + return hypre_BoomerAMGCoarseParmsDevice(comm, local_num_variables, num_functions, dof_func, + CF_marker, coarse_dof_func_ptr, coarse_pnts_global); } else #endif { - ierr = hypre_BoomerAMGCoarseParmsHost(comm, local_num_variables, num_functions, dof_func, - CF_marker, coarse_dof_func_ptr, coarse_pnts_global_ptr); + return hypre_BoomerAMGCoarseParmsHost(comm, local_num_variables, num_functions, dof_func, + CF_marker, coarse_dof_func_ptr, coarse_pnts_global); } - - return ierr; } diff --git a/external/hypre/src/parcsr_ls/par_coarse_parms_device.c b/external/hypre/src/parcsr_ls/par_coarse_parms_device.c index 863e6454..b6e86387 100644 --- a/external/hypre/src/parcsr_ls/par_coarse_parms_device.c +++ b/external/hypre/src/parcsr_ls/par_coarse_parms_device.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -11,15 +11,12 @@ /* following should be in a header file */ - +#include "_hypre_onedpl.hpp" #include "_hypre_parcsr_ls.h" #include "_hypre_utilities.hpp" -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - +#if defined(HYPRE_USING_GPU) -/*==========================================================================*/ -/*==========================================================================*/ /** Generates global coarse_size and dof_func for next coarser level @@ -37,7 +34,7 @@ _hypre_parcsr_ls.h @return Error code. - + @param comm [IN] MPI Communicator @param local_num_variables [IN] @@ -45,12 +42,12 @@ @param dof_func [IN] array that contains the function numbers for all local points @param CF_marker [IN] - marker array for coarse points + marker array for coarse points @param coarse_dof_func_ptr [OUT] pointer to array which contains the function numbers for local coarse points - @param coarse_pnts_global_ptr [OUT] + @param coarse_pnts_global [OUT] pointer to array which contains the number of the first coarse point on each processor and the total number of coarse points in its last element - + @see */ /*--------------------------------------------------------------------------*/ @@ -61,57 +58,62 @@ hypre_BoomerAMGCoarseParmsDevice(MPI_Comm comm, hypre_IntArray *dof_func, hypre_IntArray *CF_marker, hypre_IntArray **coarse_dof_func_ptr, - HYPRE_BigInt **coarse_pnts_global_ptr) + HYPRE_BigInt *coarse_pnts_global) { #ifdef HYPRE_PROFILE hypre_profile_times[HYPRE_TIMER_ID_COARSE_PARAMS] -= hypre_MPI_Wtime(); #endif HYPRE_Int ierr = 0; - HYPRE_Int num_procs; HYPRE_BigInt local_coarse_size = 0; - HYPRE_BigInt *coarse_pnts_global; - - /*-------------------------------------------------------------- *----------------------------------------------------------------*/ - hypre_MPI_Comm_size(comm,&num_procs); - +#if defined(HYPRE_USING_SYCL) + local_coarse_size = HYPRE_ONEDPL_CALL( std::count_if, + hypre_IntArrayData(CF_marker), + hypre_IntArrayData(CF_marker) + local_num_variables, + equal(1) ); +#else local_coarse_size = HYPRE_THRUST_CALL( count_if, hypre_IntArrayData(CF_marker), hypre_IntArrayData(CF_marker) + local_num_variables, equal(1) ); +#endif if (num_functions > 1) { *coarse_dof_func_ptr = hypre_IntArrayCreate(local_coarse_size); hypre_IntArrayInitialize_v2(*coarse_dof_func_ptr, HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_SYCL) + hypreSycl_copy_if( hypre_IntArrayData(dof_func), + hypre_IntArrayData(dof_func) + local_num_variables, + hypre_IntArrayData(CF_marker), + hypre_IntArrayData(*coarse_dof_func_ptr), + equal(1) ); +#else HYPRE_THRUST_CALL( copy_if, hypre_IntArrayData(dof_func), hypre_IntArrayData(dof_func) + local_num_variables, hypre_IntArrayData(CF_marker), hypre_IntArrayData(*coarse_dof_func_ptr), equal(1) ); +#endif } - { HYPRE_BigInt scan_recv; - - coarse_pnts_global = hypre_CTAlloc(HYPRE_BigInt, 2, HYPRE_MEMORY_HOST); hypre_MPI_Scan(&local_coarse_size, &scan_recv, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); - /* first point in my range */ + + /* first point in my range */ coarse_pnts_global[0] = scan_recv - local_coarse_size; + /* first point in next proc's range */ coarse_pnts_global[1] = scan_recv; - } - *coarse_pnts_global_ptr = coarse_pnts_global; - #ifdef HYPRE_PROFILE hypre_profile_times[HYPRE_TIMER_ID_COARSE_PARAMS] += hypre_MPI_Wtime(); #endif @@ -120,24 +122,37 @@ hypre_BoomerAMGCoarseParmsDevice(MPI_Comm comm, } HYPRE_Int -hypre_BoomerAMGInitDofFuncDevice( HYPRE_Int *dof_func, - HYPRE_Int local_size, +hypre_BoomerAMGInitDofFuncDevice( HYPRE_Int *dof_func, + HYPRE_Int local_size, HYPRE_Int offset, HYPRE_Int num_functions ) { +#if defined(HYPRE_USING_SYCL) + hypreSycl_sequence(dof_func, + dof_func + local_size, + offset); + + HYPRE_ONEDPL_CALL( std::transform, + dof_func, + dof_func + local_size, + dof_func, + modulo(num_functions) ); +#else HYPRE_THRUST_CALL( sequence, dof_func, dof_func + local_size, offset, 1 ); + HYPRE_THRUST_CALL( transform, dof_func, dof_func + local_size, dof_func, modulo(num_functions) ); +#endif return hypre_error_flag; } -#endif // #if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#endif // #if defined(HYPRE_USING_GPU) diff --git a/external/hypre/src/parcsr_ls/par_coarsen.c b/external/hypre/src/parcsr_ls/par_coarsen.c index 414a2f8b..1f131432 100644 --- a/external/hypre/src/parcsr_ls/par_coarsen.c +++ b/external/hypre/src/parcsr_ls/par_coarsen.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -96,9 +96,9 @@ hypre_BoomerAMGCoarsen( hypre_ParCSRMatrix *S, HYPRE_Int debug_flag, hypre_IntArray **CF_marker_ptr) { - MPI_Comm comm = hypre_ParCSRMatrixComm(S); - hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(S); - hypre_ParCSRCommHandle *comm_handle; + MPI_Comm comm = hypre_ParCSRMatrixComm(S); + hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(S); + hypre_ParCSRCommHandle *comm_handle = NULL; hypre_CSRMatrix *S_diag = hypre_ParCSRMatrixDiag(S); HYPRE_Int *S_diag_i = hypre_CSRMatrixI(S_diag); @@ -106,13 +106,13 @@ hypre_BoomerAMGCoarsen( hypre_ParCSRMatrix *S, hypre_CSRMatrix *S_offd = hypre_ParCSRMatrixOffd(S); HYPRE_Int *S_offd_i = hypre_CSRMatrixI(S_offd); - HYPRE_Int *S_offd_j = NULL; + HYPRE_Int *S_offd_j = NULL; HYPRE_BigInt *col_map_offd = hypre_ParCSRMatrixColMapOffd(S); HYPRE_Int num_variables = hypre_CSRMatrixNumRows(S_diag); - HYPRE_BigInt col_1 = hypre_ParCSRMatrixFirstColDiag(S); - HYPRE_BigInt col_n = col_1 + (HYPRE_BigInt)hypre_CSRMatrixNumCols(S_diag); - HYPRE_Int num_cols_offd = 0; + HYPRE_BigInt col_1 = hypre_ParCSRMatrixFirstColDiag(S); + HYPRE_BigInt col_n = col_1 + (HYPRE_BigInt)hypre_CSRMatrixNumCols(S_diag); + HYPRE_Int num_cols_offd = 0; hypre_CSRMatrix *S_ext; HYPRE_Int *S_ext_i = NULL; @@ -139,7 +139,7 @@ hypre_BoomerAMGCoarsen( hypre_ParCSRMatrix *S, HYPRE_Int use_commpkg_A = 0; HYPRE_Int break_var = 1; - HYPRE_Real wall_time; + HYPRE_Real wall_time = 0.0; HYPRE_Int iter = 0; HYPRE_BigInt big_k; @@ -164,9 +164,9 @@ hypre_BoomerAMGCoarsen( hypre_ParCSRMatrix *S, *----------------------------------------------------------------*/ S_ext = NULL; - if (debug_flag == 3) wall_time = time_getWallclockSeconds(); - hypre_MPI_Comm_size(comm,&num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + if (debug_flag == 3) { wall_time = time_getWallclockSeconds(); } + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); if (!comm_pkg) { @@ -183,9 +183,9 @@ hypre_BoomerAMGCoarsen( hypre_ParCSRMatrix *S, num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, - num_sends), HYPRE_MEMORY_HOST); + num_sends), HYPRE_MEMORY_HOST); buf_data = hypre_CTAlloc(HYPRE_Real, hypre_ParCSRCommPkgSendMapStart(comm_pkg, - num_sends), HYPRE_MEMORY_HOST); + num_sends), HYPRE_MEMORY_HOST); num_cols_offd = hypre_CSRMatrixNumCols(S_offd); @@ -206,43 +206,52 @@ hypre_BoomerAMGCoarsen( hypre_ParCSRMatrix *S, * between 0 and 1. *----------------------------------------------------------*/ - measure_array = hypre_CTAlloc(HYPRE_Real, num_variables+num_cols_offd, HYPRE_MEMORY_HOST); + measure_array = hypre_CTAlloc(HYPRE_Real, num_variables + num_cols_offd, HYPRE_MEMORY_HOST); - for (i=0; i < S_offd_i[num_variables]; i++) + for (i = 0; i < S_offd_i[num_variables]; i++) { measure_array[num_variables + S_offd_j[i]] += 1.0; } + if (num_procs > 1) + { comm_handle = hypre_ParCSRCommHandleCreate(2, comm_pkg, - &measure_array[num_variables], buf_data); + &measure_array[num_variables], buf_data); + } - for (i=0; i < S_diag_i[num_variables]; i++) + for (i = 0; i < S_diag_i[num_variables]; i++) { measure_array[S_diag_j[i]] += 1.0; } if (num_procs > 1) + { hypre_ParCSRCommHandleDestroy(comm_handle); + } index = 0; - for (i=0; i < num_sends; i++) + for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j=start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) - measure_array[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)] - += buf_data[index++]; + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) + measure_array[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)] + += buf_data[index++]; } - for (i=num_variables; i < num_variables+num_cols_offd; i++) + for (i = num_variables; i < num_variables + num_cols_offd; i++) { measure_array[i] = 0; } /* this augments the measures */ if (CF_init == 2) + { hypre_BoomerAMGIndepSetInit(S, measure_array, 1); + } else + { hypre_BoomerAMGIndepSetInit(S, measure_array, 0); + } /*--------------------------------------------------- * Initialize the graph array @@ -252,14 +261,20 @@ hypre_BoomerAMGCoarsen( hypre_ParCSRMatrix *S, graph_array = hypre_CTAlloc(HYPRE_Int, num_variables, HYPRE_MEMORY_HOST); if (num_cols_offd) + { graph_array_offd = hypre_CTAlloc(HYPRE_Int, num_cols_offd, HYPRE_MEMORY_HOST); + } else + { graph_array_offd = NULL; + } /* initialize measure array and graph array */ for (ig = 0; ig < num_cols_offd; ig++) + { graph_array_offd[ig] = ig; + } /*--------------------------------------------------- * Initialize the C/F marker array @@ -284,14 +299,14 @@ hypre_BoomerAMGCoarsen( hypre_ParCSRMatrix *S, { if ( CF_marker[i] != SF_PT ) { - if ( (S_offd_i[i+1] - S_offd_i[i]) > 0 || + if ( (S_offd_i[i + 1] - S_offd_i[i]) > 0 || (CF_marker[i] == F_PT) ) { CF_marker[i] = 0; } if ( CF_marker[i] == Z_PT) { - if ( (S_diag_i[i+1] - S_diag_i[i]) > 0 || + if ( (S_diag_i[i + 1] - S_diag_i[i]) > 0 || (measure_array[i] >= 1.0) ) { CF_marker[i] = 0; @@ -321,7 +336,7 @@ hypre_BoomerAMGCoarsen( hypre_ParCSRMatrix *S, if ( CF_marker[i] != SF_PT ) { CF_marker[i] = 0; - nnzrow = (S_diag_i[i+1] - S_diag_i[i]) + (S_offd_i[i+1] - S_offd_i[i]); + nnzrow = (S_diag_i[i + 1] - S_diag_i[i]) + (S_offd_i[i + 1] - S_offd_i[i]); if (nnzrow == 0) { CF_marker[i] = SF_PT; @@ -340,11 +355,17 @@ hypre_BoomerAMGCoarsen( hypre_ParCSRMatrix *S, } graph_size = cnt; if (num_cols_offd) + { CF_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_offd, HYPRE_MEMORY_HOST); + } else + { CF_marker_offd = NULL; - for (i=0; i < num_cols_offd; i++) + } + for (i = 0; i < num_cols_offd; i++) + { CF_marker_offd[i] = 0; + } /*--------------------------------------------------- * Loop until all points are either fine or coarse. @@ -353,9 +374,13 @@ hypre_BoomerAMGCoarsen( hypre_ParCSRMatrix *S, if (num_procs > 1) { if (use_commpkg_A) - S_ext = hypre_ParCSRMatrixExtractBExt(S,A,0); + { + S_ext = hypre_ParCSRMatrixExtractBExt(S, A, 0); + } else - S_ext = hypre_ParCSRMatrixExtractBExt(S,S,0); + { + S_ext = hypre_ParCSRMatrixExtractBExt(S, S, 0); + } S_ext_i = hypre_CSRMatrixI(S_ext); S_ext_j = hypre_CSRMatrixBigJ(S_ext); } @@ -363,9 +388,9 @@ hypre_BoomerAMGCoarsen( hypre_ParCSRMatrix *S, /* compress S_ext and convert column numbers*/ index = 0; - for (i=0; i < num_cols_offd; i++) + for (i = 0; i < num_cols_offd; i++) { - for (j=S_ext_i[i]; j < S_ext_i[i+1]; j++) + for (j = S_ext_i[i]; j < S_ext_i[i + 1]; j++) { big_k = S_ext_j[j]; if (big_k >= col_1 && big_k < col_n) @@ -374,21 +399,23 @@ hypre_BoomerAMGCoarsen( hypre_ParCSRMatrix *S, } else { - kc = hypre_BigBinarySearch(col_map_offd,big_k,num_cols_offd); - if (kc > -1) S_ext_j[index++] = (HYPRE_BigInt)(-kc-1); + kc = hypre_BigBinarySearch(col_map_offd, big_k, num_cols_offd); + if (kc > -1) { S_ext_j[index++] = (HYPRE_BigInt)(-kc - 1); } } } S_ext_i[i] = index; } for (i = num_cols_offd; i > 0; i--) - S_ext_i[i] = S_ext_i[i-1]; - if (num_procs > 1) S_ext_i[0] = 0; + { + S_ext_i[i] = S_ext_i[i - 1]; + } + if (num_procs > 1) { S_ext_i[0] = 0; } if (debug_flag == 3) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Initialize CLJP phase = %f\n", - my_id, wall_time); + my_id, wall_time); } while (1) @@ -399,18 +426,20 @@ hypre_BoomerAMGCoarsen( hypre_ParCSRMatrix *S, if (num_procs > 1) comm_handle = hypre_ParCSRCommHandleCreate(2, comm_pkg, - &measure_array[num_variables], buf_data); + &measure_array[num_variables], buf_data); if (num_procs > 1) + { hypre_ParCSRCommHandleDestroy(comm_handle); + } index = 0; - for (i=0; i < num_sends; i++) + for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j=start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) - measure_array[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)] - += buf_data[index++]; + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) + measure_array[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)] + += buf_data[index++]; } /*------------------------------------------------ @@ -429,14 +458,14 @@ hypre_BoomerAMGCoarsen( hypre_ParCSRMatrix *S, CF_marker[i] = F_PT; /* make sure all dependencies have been accounted for */ - for (jS = S_diag_i[i]; jS < S_diag_i[i+1]; jS++) + for (jS = S_diag_i[i]; jS < S_diag_i[i + 1]; jS++) { if (S_diag_j[jS] > -1) { CF_marker[i] = 0; } } - for (jS = S_offd_i[i]; jS < S_offd_i[i+1]; jS++) + for (jS = S_offd_i[i]; jS < S_offd_i[i + 1]; jS++) { if (S_offd_j[jS] > -1) { @@ -461,15 +490,15 @@ hypre_BoomerAMGCoarsen( hypre_ParCSRMatrix *S, * Exchange boundary data, i.i. get measures *------------------------------------------------*/ - if (debug_flag == 3) wall_time = time_getWallclockSeconds(); + if (debug_flag == 3) { wall_time = time_getWallclockSeconds(); } index = 0; for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { - jrow = hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j); + jrow = hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j); buf_data[index++] = measure_array[jrow]; } } @@ -477,7 +506,7 @@ hypre_BoomerAMGCoarsen( hypre_ParCSRMatrix *S, if (num_procs > 1) { comm_handle = hypre_ParCSRCommHandleCreate(1, comm_pkg, buf_data, - &measure_array[num_variables]); + &measure_array[num_variables]); hypre_ParCSRCommHandleDestroy(comm_handle); @@ -522,10 +551,12 @@ hypre_BoomerAMGCoarsen( hypre_ParCSRMatrix *S, *------------------------------------------------*/ big_graph_size = (HYPRE_BigInt) graph_size; - hypre_MPI_Allreduce(&big_graph_size,&global_graph_size,1,HYPRE_MPI_BIG_INT,hypre_MPI_SUM,comm); + hypre_MPI_Allreduce(&big_graph_size, &global_graph_size, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); if (global_graph_size == 0) + { break; + } /*------------------------------------------------ * Pick an independent set of points with @@ -534,13 +565,13 @@ hypre_BoomerAMGCoarsen( hypre_ParCSRMatrix *S, if (iter || (CF_init != 1)) { hypre_BoomerAMGIndepSet(S, measure_array, graph_array, - graph_size, - graph_array_offd, graph_offd_size, - CF_marker, CF_marker_offd); + graph_size, + graph_array_offd, graph_offd_size, + CF_marker, CF_marker_offd); if (num_procs > 1) { comm_handle = hypre_ParCSRCommHandleCreate(12, comm_pkg, - CF_marker_offd, int_buf_data); + CF_marker_offd, int_buf_data); hypre_ParCSRCommHandleDestroy(comm_handle); } @@ -549,8 +580,9 @@ hypre_BoomerAMGCoarsen( hypre_ParCSRMatrix *S, for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j=start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg,i+1);j++) { - elmt = hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j); + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) + { + elmt = hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j); if (!int_buf_data[index++] && CF_marker[elmt] > 0) { CF_marker[elmt] = 0; @@ -569,9 +601,9 @@ hypre_BoomerAMGCoarsen( hypre_ParCSRMatrix *S, for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { - elmt = hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j); + elmt = hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j); int_buf_data[index++] = CF_marker[elmt]; } } @@ -579,7 +611,7 @@ hypre_BoomerAMGCoarsen( hypre_ParCSRMatrix *S, if (num_procs > 1) { comm_handle = hypre_ParCSRCommHandleCreate(11, comm_pkg, int_buf_data, - CF_marker_offd); + CF_marker_offd); hypre_ParCSRCommHandleDestroy(comm_handle); } @@ -601,18 +633,18 @@ hypre_BoomerAMGCoarsen( hypre_ParCSRMatrix *S, { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d iter %d comm. and subgraph update = %f\n", - my_id, iter, wall_time); + my_id, iter, wall_time); } /*------------------------------------------------ * Set C_pts and apply heuristics. *------------------------------------------------*/ - for (i=num_variables; i < num_variables+num_cols_offd; i++) + for (i = num_variables; i < num_variables + num_cols_offd; i++) { measure_array[i] = 0; } - if (debug_flag == 3) wall_time = time_getWallclockSeconds(); + if (debug_flag == 3) { wall_time = time_getWallclockSeconds(); } for (ig = 0; ig < graph_size; ig++) { i = graph_array[ig]; @@ -627,14 +659,14 @@ hypre_BoomerAMGCoarsen( hypre_ParCSRMatrix *S, /* set to be a C-pt */ CF_marker[i] = C_PT; - for (jS = S_diag_i[i]; jS < S_diag_i[i+1]; jS++) + for (jS = S_diag_i[i]; jS < S_diag_i[i + 1]; jS++) { j = S_diag_j[jS]; if (j > -1) { /* "remove" edge from S */ - S_diag_j[jS] = -S_diag_j[jS]-1; + S_diag_j[jS] = -S_diag_j[jS] - 1; /* decrement measures of unmarked neighbors */ if (!CF_marker[j]) @@ -643,19 +675,19 @@ hypre_BoomerAMGCoarsen( hypre_ParCSRMatrix *S, } } } - for (jS = S_offd_i[i]; jS < S_offd_i[i+1]; jS++) + for (jS = S_offd_i[i]; jS < S_offd_i[i + 1]; jS++) { j = S_offd_j[jS]; if (j > -1) { /* "remove" edge from S */ - S_offd_j[jS] = -S_offd_j[jS]-1; + S_offd_j[jS] = -S_offd_j[jS] - 1; /* decrement measures of unmarked neighbors */ if (!CF_marker_offd[j]) { - measure_array[j+num_variables]--; + measure_array[j + num_variables]--; } } } @@ -663,17 +695,17 @@ hypre_BoomerAMGCoarsen( hypre_ParCSRMatrix *S, else { /* marked dependencies */ - for (jS = S_diag_i[i]; jS < S_diag_i[i+1]; jS++) + for (jS = S_diag_i[i]; jS < S_diag_i[i + 1]; jS++) { j = S_diag_j[jS]; - if (j < 0) j = -j-1; + if (j < 0) { j = -j - 1; } if (CF_marker[j] > 0) { if (S_diag_j[jS] > -1) { /* "remove" edge from S */ - S_diag_j[jS] = -S_diag_j[jS]-1; + S_diag_j[jS] = -S_diag_j[jS] - 1; } /* IMPORTANT: consider all dependencies */ @@ -685,21 +717,21 @@ hypre_BoomerAMGCoarsen( hypre_ParCSRMatrix *S, if (S_diag_j[jS] > -1) { /* "remove" edge from S */ - S_diag_j[jS] = -S_diag_j[jS]-1; + S_diag_j[jS] = -S_diag_j[jS] - 1; } } } - for (jS = S_offd_i[i]; jS < S_offd_i[i+1]; jS++) + for (jS = S_offd_i[i]; jS < S_offd_i[i + 1]; jS++) { j = S_offd_j[jS]; - if (j < 0) j = -j-1; + if (j < 0) { j = -j - 1; } if (CF_marker_offd[j] > 0) { if (S_offd_j[jS] > -1) { /* "remove" edge from S */ - S_offd_j[jS] = -S_offd_j[jS]-1; + S_offd_j[jS] = -S_offd_j[jS] - 1; } /* IMPORTANT: consider all dependencies */ @@ -711,29 +743,29 @@ hypre_BoomerAMGCoarsen( hypre_ParCSRMatrix *S, if (S_offd_j[jS] > -1) { /* "remove" edge from S */ - S_offd_j[jS] = -S_offd_j[jS]-1; + S_offd_j[jS] = -S_offd_j[jS] - 1; } } } /* unmarked dependencies */ - for (jS = S_diag_i[i]; jS < S_diag_i[i+1]; jS++) + for (jS = S_diag_i[i]; jS < S_diag_i[i + 1]; jS++) { if (S_diag_j[jS] > -1) { j = S_diag_j[jS]; break_var = 1; /* check for common C-pt */ - for (kS = S_diag_i[j]; kS < S_diag_i[j+1]; kS++) + for (kS = S_diag_i[j]; kS < S_diag_i[j + 1]; kS++) { k = S_diag_j[kS]; - if (k < 0) k = -k-1; + if (k < 0) { k = -k - 1; } /* IMPORTANT: consider all dependencies */ if (CF_marker[k] == COMMON_C_PT) { /* "remove" edge from S and update measure*/ - S_diag_j[jS] = -S_diag_j[jS]-1; + S_diag_j[jS] = -S_diag_j[jS] - 1; measure_array[j]--; break_var = 0; break; @@ -741,16 +773,16 @@ hypre_BoomerAMGCoarsen( hypre_ParCSRMatrix *S, } if (break_var) { - for (kS = S_offd_i[j]; kS < S_offd_i[j+1]; kS++) + for (kS = S_offd_i[j]; kS < S_offd_i[j + 1]; kS++) { k = S_offd_j[kS]; - if (k < 0) k = -k-1; + if (k < 0) { k = -k - 1; } /* IMPORTANT: consider all dependencies */ if ( CF_marker_offd[k] == COMMON_C_PT) { /* "remove" edge from S and update measure*/ - S_diag_j[jS] = -S_diag_j[jS]-1; + S_diag_j[jS] = -S_diag_j[jS] - 1; measure_array[j]--; break; } @@ -758,14 +790,14 @@ hypre_BoomerAMGCoarsen( hypre_ParCSRMatrix *S, } } } - for (jS = S_offd_i[i]; jS < S_offd_i[i+1]; jS++) + for (jS = S_offd_i[i]; jS < S_offd_i[i + 1]; jS++) { if (S_offd_j[jS] > -1) { j = S_offd_j[jS]; /* check for common C-pt */ - for (kS = S_ext_i[j]; kS < S_ext_i[j+1]; kS++) + for (kS = S_ext_i[j]; kS < S_ext_i[j + 1]; kS++) { k = (HYPRE_Int)S_ext_j[kS]; if (k >= 0) @@ -774,19 +806,19 @@ hypre_BoomerAMGCoarsen( hypre_ParCSRMatrix *S, if (CF_marker[k] == COMMON_C_PT) { /* "remove" edge from S and update measure*/ - S_offd_j[jS] = -S_offd_j[jS]-1; - measure_array[j+num_variables]--; + S_offd_j[jS] = -S_offd_j[jS] - 1; + measure_array[j + num_variables]--; break; } } else { - kc = -k-1; + kc = -k - 1; if (kc > -1 && CF_marker_offd[kc] == COMMON_C_PT) { /* "remove" edge from S and update measure*/ - S_offd_j[jS] = -S_offd_j[jS]-1; - measure_array[j+num_variables]--; + S_offd_j[jS] = -S_offd_j[jS] - 1; + measure_array[j + num_variables]--; break; } } @@ -796,20 +828,20 @@ hypre_BoomerAMGCoarsen( hypre_ParCSRMatrix *S, } /* reset CF_marker */ - for (jS = S_diag_i[i]; jS < S_diag_i[i+1]; jS++) + for (jS = S_diag_i[i]; jS < S_diag_i[i + 1]; jS++) { j = S_diag_j[jS]; - if (j < 0) j = -j-1; + if (j < 0) { j = -j - 1; } if (CF_marker[j] == COMMON_C_PT) { CF_marker[j] = C_PT; } } - for (jS = S_offd_i[i]; jS < S_offd_i[i+1]; jS++) + for (jS = S_offd_i[i]; jS < S_offd_i[i + 1]; jS++) { j = S_offd_j[jS]; - if (j < 0) j = -j-1; + if (j < 0) { j = -j - 1; } if (CF_marker_offd[j] == COMMON_C_PT) { @@ -821,7 +853,7 @@ hypre_BoomerAMGCoarsen( hypre_ParCSRMatrix *S, { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d CLJP phase = %f graph_size = %d nc_offd = %d\n", - my_id, wall_time, graph_size, num_cols_offd); + my_id, wall_time, graph_size, num_cols_offd); } } @@ -830,26 +862,30 @@ hypre_BoomerAMGCoarsen( hypre_ParCSRMatrix *S, *---------------------------------------------------*/ /* Reset S_matrix */ - for (i=0; i < S_diag_i[num_variables]; i++) + for (i = 0; i < S_diag_i[num_variables]; i++) { if (S_diag_j[i] < 0) - S_diag_j[i] = -S_diag_j[i]-1; + { + S_diag_j[i] = -S_diag_j[i] - 1; + } } - for (i=0; i < S_offd_i[num_variables]; i++) + for (i = 0; i < S_offd_i[num_variables]; i++) { if (S_offd_j[i] < 0) - S_offd_j[i] = -S_offd_j[i]-1; + { + S_offd_j[i] = -S_offd_j[i] - 1; + } } /*for (i=0; i < num_variables; i++) if (CF_marker[i] == SF_PT) CF_marker[i] = F_PT;*/ hypre_TFree(measure_array, HYPRE_MEMORY_HOST); hypre_TFree(graph_array, HYPRE_MEMORY_HOST); - if (num_cols_offd) hypre_TFree(graph_array_offd, HYPRE_MEMORY_HOST); + if (num_cols_offd) { hypre_TFree(graph_array_offd, HYPRE_MEMORY_HOST); } hypre_TFree(buf_data, HYPRE_MEMORY_HOST); hypre_TFree(int_buf_data, HYPRE_MEMORY_HOST); hypre_TFree(CF_marker_offd, HYPRE_MEMORY_HOST); - if (num_procs > 1) hypre_CSRMatrixDestroy(S_ext); + if (num_procs > 1) { hypre_CSRMatrixDestroy(S_ext); } return hypre_error_flag; } @@ -946,7 +982,7 @@ hypre_BoomerAMGCoarsenRuge( hypre_ParCSRMatrix *S, HYPRE_Int use_commpkg_A = 0; HYPRE_Int break_var = 0; HYPRE_Int f_pnt = F_PT; - HYPRE_Real wall_time; + HYPRE_Real wall_time = 0.0; if (coarsen_type < 0) { @@ -990,13 +1026,13 @@ hypre_BoomerAMGCoarsenRuge( hypre_ParCSRMatrix *S, * to "unaccounted-for" dependence. *----------------------------------------------------------------*/ - if (debug_flag == 3) wall_time = time_getWallclockSeconds(); + if (debug_flag == 3) { wall_time = time_getWallclockSeconds(); } first_col = hypre_ParCSRMatrixFirstColDiag(S); - col_0 = first_col-1; - col_n = col_0+(HYPRE_BigInt)num_variables; - hypre_MPI_Comm_size(comm,&num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + col_0 = first_col - 1; + col_n = col_0 + (HYPRE_BigInt)num_variables; + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); if (!comm_pkg) { @@ -1021,7 +1057,7 @@ hypre_BoomerAMGCoarsenRuge( hypre_ParCSRMatrix *S, ST = hypre_CSRMatrixCreate(num_variables, num_variables, jS); hypre_CSRMatrixMemoryLocation(ST) = HYPRE_MEMORY_HOST; - ST_i = hypre_CTAlloc(HYPRE_Int, num_variables+1, HYPRE_MEMORY_HOST); + ST_i = hypre_CTAlloc(HYPRE_Int, num_variables + 1, HYPRE_MEMORY_HOST); ST_j = hypre_CTAlloc(HYPRE_Int, jS, HYPRE_MEMORY_HOST); hypre_CSRMatrixI(ST) = ST_i; hypre_CSRMatrixJ(ST) = ST_j; @@ -1030,21 +1066,21 @@ hypre_BoomerAMGCoarsenRuge( hypre_ParCSRMatrix *S, * generate transpose of S, ST *----------------------------------------------------------*/ - for (i=0; i <= num_variables; i++) + for (i = 0; i <= num_variables; i++) { ST_i[i] = 0; } - for (i=0; i < jS; i++) + for (i = 0; i < jS; i++) { - ST_i[S_j[i]+1]++; + ST_i[S_j[i] + 1]++; } - for (i=0; i < num_variables; i++) + for (i = 0; i < num_variables; i++) { - ST_i[i+1] += ST_i[i]; + ST_i[i + 1] += ST_i[i]; } - for (i=0; i < num_variables; i++) + for (i = 0; i < num_variables; i++) { - for (j=S_i[i]; j < S_i[i+1]; j++) + for (j = S_i[i]; j < S_i[i + 1]; j++) { index = S_j[j]; ST_j[ST_i[index]] = i; @@ -1053,7 +1089,7 @@ hypre_BoomerAMGCoarsenRuge( hypre_ParCSRMatrix *S, } for (i = num_variables; i > 0; i--) { - ST_i[i] = ST_i[i-1]; + ST_i[i] = ST_i[i - 1]; } ST_i[0] = 0; @@ -1071,7 +1107,7 @@ hypre_BoomerAMGCoarsenRuge( hypre_ParCSRMatrix *S, for (i = 0; i < num_variables; i++) { - measure_array[i] = ST_i[i+1]-ST_i[i]; + measure_array[i] = ST_i[i + 1] - ST_i[i]; } /* special case for Falgout coarsening */ @@ -1089,9 +1125,13 @@ hypre_BoomerAMGCoarsenRuge( hypre_ParCSRMatrix *S, if ((meas_type || (coarsen_type != 1 && coarsen_type != 11)) && num_procs > 1) { if (use_commpkg_A) - S_ext = hypre_ParCSRMatrixExtractBExt(S,A,0); + { + S_ext = hypre_ParCSRMatrixExtractBExt(S, A, 0); + } else - S_ext = hypre_ParCSRMatrixExtractBExt(S,S,0); + { + S_ext = hypre_ParCSRMatrixExtractBExt(S, S, 0); + } S_ext_i = hypre_CSRMatrixI(S_ext); S_ext_j = hypre_CSRMatrixBigJ(S_ext); HYPRE_Int num_nonzeros = S_ext_i[num_cols_offd]; @@ -1100,11 +1140,13 @@ hypre_BoomerAMGCoarsenRuge( hypre_ParCSRMatrix *S, col_n = col_0+num_variables; */ if (meas_type) { - for (i=0; i < num_nonzeros; i++) + for (i = 0; i < num_nonzeros; i++) { index = (HYPRE_Int)(S_ext_j[i] - first_col); if (index > -1 && index < num_variables) + { measure_array[index]++; + } } } } @@ -1113,7 +1155,7 @@ hypre_BoomerAMGCoarsenRuge( hypre_ParCSRMatrix *S, * Loop until all points are either fine or coarse. *---------------------------------------------------*/ - if (debug_flag == 3) wall_time = time_getWallclockSeconds(); + if (debug_flag == 3) { wall_time = time_getWallclockSeconds(); } /* first coarsening phase */ @@ -1127,7 +1169,7 @@ hypre_BoomerAMGCoarsenRuge( hypre_ParCSRMatrix *S, if (*CF_marker_ptr == NULL) { *CF_marker_ptr = hypre_IntArrayCreate(num_variables); - hypre_IntArrayInitialize(*CF_marker_ptr); + hypre_IntArrayInitialize_v2(*CF_marker_ptr, HYPRE_MEMORY_HOST); } CF_marker = hypre_IntArrayData(*CF_marker_ptr); @@ -1136,7 +1178,7 @@ hypre_BoomerAMGCoarsenRuge( hypre_ParCSRMatrix *S, { if (CF_marker[j] == 0) { - nnzrow = (S_i[j+1] - S_i[j]) + (S_offd_i[j+1] - S_offd_i[j]); + nnzrow = (S_i[j + 1] - S_i[j]) + (S_offd_i[j + 1] - S_offd_i[j]); if (nnzrow == 0) { CF_marker[j] = SF_PT; @@ -1161,11 +1203,11 @@ hypre_BoomerAMGCoarsenRuge( hypre_ParCSRMatrix *S, /* Set dense rows as SF_PT */ if ((cut_factor > 0) && (global_num_rows > 0)) { - avg_nnzrow = num_nonzeros/global_num_rows; - cut = cut_factor*avg_nnzrow; + avg_nnzrow = num_nonzeros / global_num_rows; + cut = cut_factor * avg_nnzrow; for (j = 0; j < num_variables; j++) { - nnzrow = (A_i[j+1] - A_i[j]) + (A_offd_i[j+1] - A_offd_i[j]); + nnzrow = (A_i[j + 1] - A_i[j]) + (A_offd_i[j + 1] - A_offd_i[j]); if (nnzrow > cut) { if (CF_marker[j] == UNDECIDED) @@ -1190,11 +1232,11 @@ hypre_BoomerAMGCoarsenRuge( hypre_ParCSRMatrix *S, { if (measure < 0) { - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"negative measure!\n"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "negative measure!\n"); } CF_marker[j] = f_pnt; - for (k = S_i[j]; k < S_i[j+1]; k++) + for (k = S_i[j]; k < S_i[j + 1]; k++) { nabor = S_j[k]; if (CF_marker[nabor] != SF_PT && CF_marker[nabor] != SC_PT) @@ -1205,12 +1247,12 @@ hypre_BoomerAMGCoarsenRuge( hypre_ParCSRMatrix *S, if (new_meas > 0) { hypre_remove_point(&LoL_head, &LoL_tail, new_meas, - nabor, lists, where); + nabor, lists, where); } new_meas = ++(measure_array[nabor]); hypre_enter_on_lists(&LoL_head, &LoL_tail, new_meas, - nabor, lists, where); + nabor, lists, where); } else { @@ -1254,7 +1296,7 @@ hypre_BoomerAMGCoarsenRuge( hypre_ParCSRMatrix *S, hypre_remove_point(&LoL_head, &LoL_tail, measure, index, lists, where); - for (j = ST_i[index]; j < ST_i[index+1]; j++) + for (j = ST_i[index]; j < ST_i[index + 1]; j++) { nabor = ST_j[j]; if (CF_marker[nabor] == UNDECIDED) @@ -1265,24 +1307,24 @@ hypre_BoomerAMGCoarsenRuge( hypre_ParCSRMatrix *S, hypre_remove_point(&LoL_head, &LoL_tail, measure, nabor, lists, where); --num_left; - for (k = S_i[nabor]; k < S_i[nabor+1]; k++) + for (k = S_i[nabor]; k < S_i[nabor + 1]; k++) { nabor_two = S_j[k]; if (CF_marker[nabor_two] == UNDECIDED) { measure = measure_array[nabor_two]; hypre_remove_point(&LoL_head, &LoL_tail, measure, - nabor_two, lists, where); + nabor_two, lists, where); new_meas = ++(measure_array[nabor_two]); hypre_enter_on_lists(&LoL_head, &LoL_tail, new_meas, - nabor_two, lists, where); + nabor_two, lists, where); } } } } - for (j = S_i[index]; j < S_i[index+1]; j++) + for (j = S_i[index]; j < S_i[index + 1]; j++) { nabor = S_j[j]; if (CF_marker[nabor] == UNDECIDED) @@ -1296,26 +1338,26 @@ hypre_BoomerAMGCoarsenRuge( hypre_ParCSRMatrix *S, if (measure > 0) { hypre_enter_on_lists(&LoL_head, &LoL_tail, measure, nabor, - lists, where); + lists, where); } else { CF_marker[nabor] = F_PT; --num_left; - for (k = S_i[nabor]; k < S_i[nabor+1]; k++) + for (k = S_i[nabor]; k < S_i[nabor + 1]; k++) { nabor_two = S_j[k]; if (CF_marker[nabor_two] == UNDECIDED) { new_meas = measure_array[nabor_two]; hypre_remove_point(&LoL_head, &LoL_tail, new_meas, - nabor_two, lists, where); + nabor_two, lists, where); new_meas = ++(measure_array[nabor_two]); hypre_enter_on_lists(&LoL_head, &LoL_tail, new_meas, - nabor_two, lists, where); + nabor_two, lists, where); } } } @@ -1330,7 +1372,7 @@ hypre_BoomerAMGCoarsenRuge( hypre_ParCSRMatrix *S, { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Coarsen 1st pass = %f\n", - my_id, wall_time); + my_id, wall_time); } hypre_TFree(lists, HYPRE_MEMORY_HOST); @@ -1338,7 +1380,7 @@ hypre_BoomerAMGCoarsenRuge( hypre_ParCSRMatrix *S, hypre_TFree(LoL_head, HYPRE_MEMORY_HOST); hypre_TFree(LoL_tail, HYPRE_MEMORY_HOST); - for (i=0; i < num_variables; i++) + for (i = 0; i < num_variables; i++) { if (CF_marker[i] == SC_PT) { @@ -1370,7 +1412,7 @@ hypre_BoomerAMGCoarsenRuge( hypre_ParCSRMatrix *S, graph_array[i] = -1; } - if (debug_flag == 3) wall_time = time_getWallclockSeconds(); + if (debug_flag == 3) { wall_time = time_getWallclockSeconds(); } if (coarsen_type == 2) { @@ -1380,56 +1422,62 @@ hypre_BoomerAMGCoarsenRuge( hypre_ParCSRMatrix *S, CF_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_offd, HYPRE_MEMORY_HOST); int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, - num_sends), HYPRE_MEMORY_HOST); + num_sends), HYPRE_MEMORY_HOST); index = 0; for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { - int_buf_data[index++] = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + int_buf_data[index++] = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } } if (num_procs > 1) { comm_handle = hypre_ParCSRCommHandleCreate(11, comm_pkg, int_buf_data, - CF_marker_offd); + CF_marker_offd); hypre_ParCSRCommHandleDestroy(comm_handle); } ci_array = hypre_CTAlloc(HYPRE_Int, num_cols_offd, HYPRE_MEMORY_HOST); - for (i=0; i < num_cols_offd; i++) + for (i = 0; i < num_cols_offd; i++) + { ci_array[i] = -1; + } - for (i=0; i < num_variables; i++) + for (i = 0; i < num_variables; i++) { - if (ci_tilde_mark != i) ci_tilde = -1; - if (ci_tilde_offd_mark != i) ci_tilde_offd = -1; + if (ci_tilde_mark != i) { ci_tilde = -1; } + if (ci_tilde_offd_mark != i) { ci_tilde_offd = -1; } if (CF_marker[i] == -1) { break_var = 1; - for (ji = S_i[i]; ji < S_i[i+1]; ji++) + for (ji = S_i[i]; ji < S_i[i + 1]; ji++) { j = S_j[ji]; if (CF_marker[j] > 0) + { graph_array[j] = i; + } } - for (ji = S_offd_i[i]; ji < S_offd_i[i+1]; ji++) + for (ji = S_offd_i[i]; ji < S_offd_i[i + 1]; ji++) { j = S_offd_j[ji]; if (CF_marker_offd[j] > 0) + { ci_array[j] = i; + } } - for (ji = S_i[i]; ji < S_i[i+1]; ji++) + for (ji = S_i[i]; ji < S_i[i + 1]; ji++) { j = S_j[ji]; if (CF_marker[j] == -1) { set_empty = 1; - for (jj = S_i[j]; jj < S_i[j+1]; jj++) + for (jj = S_i[j]; jj < S_i[j + 1]; jj++) { index = S_j[jj]; if (graph_array[index] == i) @@ -1440,7 +1488,7 @@ hypre_BoomerAMGCoarsenRuge( hypre_ParCSRMatrix *S, } if (set_empty) { - for (jj = S_offd_i[j]; jj < S_offd_i[j+1]; jj++) + for (jj = S_offd_i[j]; jj < S_offd_i[j + 1]; jj++) { index = S_offd_j[jj]; if (ci_array[index] == i) @@ -1484,18 +1532,18 @@ hypre_BoomerAMGCoarsenRuge( hypre_ParCSRMatrix *S, } if (break_var) { - for (ji = S_offd_i[i]; ji < S_offd_i[i+1]; ji++) + for (ji = S_offd_i[i]; ji < S_offd_i[i + 1]; ji++) { j = S_offd_j[ji]; if (CF_marker_offd[j] == -1) { set_empty = 1; - for (jj = S_ext_i[j]; jj < S_ext_i[j+1]; jj++) + for (jj = S_ext_i[j]; jj < S_ext_i[j + 1]; jj++) { big_k = S_ext_j[jj]; if (big_k > col_0 && big_k < col_n) /* index interior */ { - if (graph_array[(HYPRE_Int)(big_k-first_col)] == i) + if (graph_array[(HYPRE_Int)(big_k - first_col)] == i) { set_empty = 0; break; @@ -1503,7 +1551,7 @@ hypre_BoomerAMGCoarsenRuge( hypre_ParCSRMatrix *S, } else { - jk = hypre_BigBinarySearch(col_map_offd,big_k,num_cols_offd); + jk = hypre_BigBinarySearch(col_map_offd, big_k, num_cols_offd); if (jk != -1) { if (ci_array[jk] == i) @@ -1550,24 +1598,26 @@ hypre_BoomerAMGCoarsenRuge( hypre_ParCSRMatrix *S, } else { - for (i=0; i < num_variables; i++) + for (i = 0; i < num_variables; i++) { - if (ci_tilde_mark != i) ci_tilde = -1; + if (ci_tilde_mark != i) { ci_tilde = -1; } if (CF_marker[i] == -1) { - for (ji = S_i[i]; ji < S_i[i+1]; ji++) + for (ji = S_i[i]; ji < S_i[i + 1]; ji++) { j = S_j[ji]; if (CF_marker[j] > 0) + { graph_array[j] = i; + } } - for (ji = S_i[i]; ji < S_i[i+1]; ji++) + for (ji = S_i[i]; ji < S_i[i + 1]; ji++) { j = S_j[ji]; if (CF_marker[j] == -1) { set_empty = 1; - for (jj = S_i[j]; jj < S_i[j+1]; jj++) + for (jj = S_i[j]; jj < S_i[j + 1]; jj++) { index = S_j[jj]; if (graph_array[index] == i) @@ -1609,18 +1659,18 @@ hypre_BoomerAMGCoarsenRuge( hypre_ParCSRMatrix *S, { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Coarsen 2nd pass = %f\n", - my_id, wall_time); + my_id, wall_time); } /* third pass, check boundary fine points for coarse neighbors */ if (coarsen_type == 3 || coarsen_type == 4) { - if (debug_flag == 3) wall_time = time_getWallclockSeconds(); + if (debug_flag == 3) { wall_time = time_getWallclockSeconds(); } CF_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_offd, HYPRE_MEMORY_HOST); int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), - HYPRE_MEMORY_HOST); + HYPRE_MEMORY_HOST); /*------------------------------------------------ * Exchange boundary data for CF_marker @@ -1630,51 +1680,59 @@ hypre_BoomerAMGCoarsenRuge( hypre_ParCSRMatrix *S, for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) int_buf_data[index++] - = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } if (num_procs > 1) { comm_handle = hypre_ParCSRCommHandleCreate(11, comm_pkg, int_buf_data, - CF_marker_offd); + CF_marker_offd); hypre_ParCSRCommHandleDestroy(comm_handle); } ci_array = hypre_CTAlloc(HYPRE_Int, num_cols_offd, HYPRE_MEMORY_HOST); - for (i=0; i < num_cols_offd; i++) + for (i = 0; i < num_cols_offd; i++) + { ci_array[i] = -1; + } } if (coarsen_type > 1 && coarsen_type < 5) { - for (i=0; i < num_variables; i++) + for (i = 0; i < num_variables; i++) + { graph_array[i] = -1; - for (i=0; i < num_cols_offd; i++) + } + for (i = 0; i < num_cols_offd; i++) { - if (ci_tilde_mark != i) ci_tilde = -1; - if (ci_tilde_offd_mark != i) ci_tilde_offd = -1; + if (ci_tilde_mark != i) { ci_tilde = -1; } + if (ci_tilde_offd_mark != i) { ci_tilde_offd = -1; } if (CF_marker_offd[i] == -1) { - for (ji = S_ext_i[i]; ji < S_ext_i[i+1]; ji++) + for (ji = S_ext_i[i]; ji < S_ext_i[i + 1]; ji++) { big_k = S_ext_j[ji]; if (big_k > col_0 && big_k < col_n) { j = (HYPRE_Int)(big_k - first_col); if (CF_marker[j] > 0) + { graph_array[j] = i; + } } else { - jj = hypre_BigBinarySearch(col_map_offd,big_k,num_cols_offd); + jj = hypre_BigBinarySearch(col_map_offd, big_k, num_cols_offd); if (jj != -1 && CF_marker_offd[jj] > 0) + { ci_array[jj] = i; + } } } - for (ji = S_ext_i[i]; ji < S_ext_i[i+1]; ji++) + for (ji = S_ext_i[i]; ji < S_ext_i[i + 1]; ji++) { big_k = S_ext_j[ji]; if (big_k > col_0 && big_k < col_n) @@ -1683,7 +1741,7 @@ hypre_BoomerAMGCoarsenRuge( hypre_ParCSRMatrix *S, if ( CF_marker[j] == -1) { set_empty = 1; - for (jj = S_i[j]; jj < S_i[j+1]; jj++) + for (jj = S_i[j]; jj < S_i[j + 1]; jj++) { index = S_j[jj]; if (graph_array[index] == i) @@ -1692,7 +1750,7 @@ hypre_BoomerAMGCoarsenRuge( hypre_ParCSRMatrix *S, break; } } - for (jj = S_offd_i[j]; jj < S_offd_i[j+1]; jj++) + for (jj = S_offd_i[j]; jj < S_offd_i[j + 1]; jj++) { index = S_offd_j[jj]; if (ci_array[index] == i) @@ -1733,16 +1791,16 @@ hypre_BoomerAMGCoarsenRuge( hypre_ParCSRMatrix *S, } else { - jm = hypre_BigBinarySearch(col_map_offd,big_k,num_cols_offd); + jm = hypre_BigBinarySearch(col_map_offd, big_k, num_cols_offd); if (jm != -1 && CF_marker_offd[jm] == -1) { set_empty = 1; - for (jj = S_ext_i[jm]; jj < S_ext_i[jm+1]; jj++) + for (jj = S_ext_i[jm]; jj < S_ext_i[jm + 1]; jj++) { big_k = S_ext_j[jj]; if (big_k > col_0 && big_k < col_n) { - if (graph_array[(HYPRE_Int)(big_k-first_col)] == i) + if (graph_array[(HYPRE_Int)(big_k - first_col)] == i) { set_empty = 0; break; @@ -1750,7 +1808,7 @@ hypre_BoomerAMGCoarsenRuge( hypre_ParCSRMatrix *S, } else { - jk = hypre_BigBinarySearch(col_map_offd,big_k,num_cols_offd); + jk = hypre_BigBinarySearch(col_map_offd, big_k, num_cols_offd); if (jk != -1) { if (ci_array[jk] == i) @@ -1800,7 +1858,7 @@ hypre_BoomerAMGCoarsenRuge( hypre_ParCSRMatrix *S, if (num_procs > 1) { comm_handle = hypre_ParCSRCommHandleCreate(12, comm_pkg, CF_marker_offd, - int_buf_data); + int_buf_data); hypre_ParCSRCommHandleDestroy(comm_handle); } @@ -1814,15 +1872,15 @@ hypre_BoomerAMGCoarsenRuge( hypre_ParCSRMatrix *S, for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - if (hypre_ParCSRCommPkgSendProc(comm_pkg,i) > my_id) + if (hypre_ParCSRCommPkgSendProc(comm_pkg, i) > my_id) { - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) - CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)] = + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) + CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)] = int_buf_data[index++]; } else { - index += hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1) - start; + index += hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1) - start; } } } @@ -1831,19 +1889,21 @@ hypre_BoomerAMGCoarsenRuge( hypre_ParCSRMatrix *S, for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - if (hypre_ParCSRCommPkgSendProc(comm_pkg,i) > my_id) + if (hypre_ParCSRCommPkgSendProc(comm_pkg, i) > my_id) { - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { - elmt = hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j); + elmt = hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j); if (CF_marker[elmt] != 1) + { CF_marker[elmt] = int_buf_data[index]; + } index++; } } else { - index += hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1) - start; + index += hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1) - start; } } } @@ -1852,13 +1912,13 @@ hypre_BoomerAMGCoarsenRuge( hypre_ParCSRMatrix *S, wall_time = time_getWallclockSeconds() - wall_time; if (coarsen_type == 4) hypre_printf("Proc = %d Coarsen 3rd pass = %f\n", - my_id, wall_time); + my_id, wall_time); if (coarsen_type == 3) hypre_printf("Proc = %d Coarsen 3rd pass = %f\n", - my_id, wall_time); + my_id, wall_time); if (coarsen_type == 2) hypre_printf("Proc = %d Coarsen 2nd pass = %f\n", - my_id, wall_time); + my_id, wall_time); } } if (coarsen_type == 5) @@ -1867,64 +1927,72 @@ hypre_BoomerAMGCoarsenRuge( hypre_ParCSRMatrix *S, * Exchange boundary data for CF_marker *------------------------------------------------*/ - if (debug_flag == 3) wall_time = time_getWallclockSeconds(); + if (debug_flag == 3) { wall_time = time_getWallclockSeconds(); } CF_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_offd, HYPRE_MEMORY_HOST); int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, - num_sends), HYPRE_MEMORY_HOST); + num_sends), HYPRE_MEMORY_HOST); index = 0; for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) int_buf_data[index++] - = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } if (num_procs > 1) { comm_handle = hypre_ParCSRCommHandleCreate(11, comm_pkg, int_buf_data, - CF_marker_offd); + CF_marker_offd); hypre_ParCSRCommHandleDestroy(comm_handle); } ci_array = hypre_CTAlloc(HYPRE_Int, num_cols_offd, HYPRE_MEMORY_HOST); - for (i=0; i < num_cols_offd; i++) + for (i = 0; i < num_cols_offd; i++) + { ci_array[i] = -1; - for (i=0; i < num_variables; i++) + } + for (i = 0; i < num_variables; i++) + { graph_array[i] = -1; + } - for (i=0; i < num_variables; i++) + for (i = 0; i < num_variables; i++) { - if (CF_marker[i] == -1 && (S_offd_i[i+1]-S_offd_i[i]) > 0) + if (CF_marker[i] == -1 && (S_offd_i[i + 1] - S_offd_i[i]) > 0) { break_var = 1; - for (ji = S_i[i]; ji < S_i[i+1]; ji++) + for (ji = S_i[i]; ji < S_i[i + 1]; ji++) { j = S_j[ji]; if (CF_marker[j] > 0) + { graph_array[j] = i; + } } - for (ji = S_offd_i[i]; ji < S_offd_i[i+1]; ji++) + for (ji = S_offd_i[i]; ji < S_offd_i[i + 1]; ji++) { j = S_offd_j[ji]; if (CF_marker_offd[j] > 0) + { ci_array[j] = i; + } } - for (ji = S_offd_i[i]; ji < S_offd_i[i+1]; ji++) + for (ji = S_offd_i[i]; ji < S_offd_i[i + 1]; ji++) { j = S_offd_j[ji]; if (CF_marker_offd[j] == -1) { set_empty = 1; - for (jj = S_ext_i[j]; jj < S_ext_i[j+1]; jj++) + for (jj = S_ext_i[j]; jj < S_ext_i[j + 1]; jj++) { big_k = S_ext_j[jj]; if (big_k > col_0 && big_k < col_n) /* index interior */ { - if (graph_array[(HYPRE_Int)(big_k-first_col)] == i) + if (graph_array[(HYPRE_Int)(big_k - first_col)] == i) { set_empty = 0; break; @@ -1932,7 +2000,7 @@ hypre_BoomerAMGCoarsenRuge( hypre_ParCSRMatrix *S, } else { - jk = hypre_BigBinarySearch(col_map_offd,big_k,num_cols_offd); + jk = hypre_BigBinarySearch(col_map_offd, big_k, num_cols_offd); if (jk != -1) { if (ci_array[jk] == i) @@ -1966,10 +2034,10 @@ hypre_BoomerAMGCoarsenRuge( hypre_ParCSRMatrix *S, { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Coarsen special points = %f\n", - my_id, wall_time); + my_id, wall_time); } - } + /*--------------------------------------------------- * Clean up and return *---------------------------------------------------*/ @@ -2021,7 +2089,7 @@ hypre_BoomerAMGCoarsenFalgout( hypre_ParCSRMatrix *S, #define COMMON_C_PT 2 #define Z_PT -2 - /* begin HANS added */ +/* begin HANS added */ /************************************************************** * * Modified Independent Set Coarsening routine @@ -2040,19 +2108,19 @@ hypre_BoomerAMGCoarsenPMISHost( hypre_ParCSRMatrix *S, hypre_profile_times[HYPRE_TIMER_ID_PMIS] -= hypre_MPI_Wtime(); #endif - MPI_Comm comm = hypre_ParCSRMatrixComm(S); - hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(S); - hypre_ParCSRCommHandle *comm_handle; + MPI_Comm comm = hypre_ParCSRMatrixComm(S); + hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(S); + hypre_ParCSRCommHandle *comm_handle = NULL; - hypre_CSRMatrix *S_diag = hypre_ParCSRMatrixDiag(S); - HYPRE_Int *S_diag_i = hypre_CSRMatrixI(S_diag); - HYPRE_Int *S_diag_j = hypre_CSRMatrixJ(S_diag); + hypre_CSRMatrix *S_diag = hypre_ParCSRMatrixDiag(S); + HYPRE_Int *S_diag_i = hypre_CSRMatrixI(S_diag); + HYPRE_Int *S_diag_j = hypre_CSRMatrixJ(S_diag); - hypre_CSRMatrix *S_offd = hypre_ParCSRMatrixOffd(S); - HYPRE_Int *S_offd_i = hypre_CSRMatrixI(S_offd); - HYPRE_Int *S_offd_j; + hypre_CSRMatrix *S_offd = hypre_ParCSRMatrixOffd(S); + HYPRE_Int *S_offd_i = hypre_CSRMatrixI(S_offd); + HYPRE_Int *S_offd_j = NULL; - HYPRE_Int num_variables = hypre_CSRMatrixNumRows(S_diag); + HYPRE_Int num_variables = hypre_CSRMatrixNumRows(S_diag); HYPRE_Int num_cols_offd = 0; /* hypre_CSRMatrix *S_ext; @@ -2093,10 +2161,10 @@ hypre_BoomerAMGCoarsenPMISHost( hypre_ParCSRMatrix *S, /******************************************************************************* BEFORE THE INDEPENDENT SET COARSENING LOOP: -measure_array: calculate the measures, and communicate them -(this array contains measures for both local and external nodes) -CF_marker, CF_marker_offd: initialize CF_marker -(separate arrays for local and external; 0=unassigned, negative=F point, positive=C point) + measure_array: calculate the measures, and communicate them + (this array contains measures for both local and external nodes) + CF_marker, CF_marker_offd: initialize CF_marker + (separate arrays for local and external; 0=unassigned, negative=F point, positive=C point) ******************************************************************************/ /*-------------------------------------------------------------- @@ -2135,8 +2203,10 @@ CF_marker, CF_marker_offd: initialize CF_marker num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), HYPRE_MEMORY_HOST); - buf_data = hypre_CTAlloc(HYPRE_Real, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), HYPRE_MEMORY_HOST); + int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); + buf_data = hypre_CTAlloc(HYPRE_Real, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); num_cols_offd = hypre_CSRMatrixNumCols(S_offd); @@ -2162,16 +2232,17 @@ CF_marker, CF_marker_offd: initialize CF_marker /* first calculate the local part of the sums for the external nodes */ #ifdef HYPRE_USING_OPENMP - HYPRE_Int *measure_array_temp = hypre_CTAlloc(HYPRE_Int, num_variables + num_cols_offd, HYPRE_MEMORY_HOST); + HYPRE_Int *measure_array_temp = hypre_CTAlloc(HYPRE_Int, num_variables + num_cols_offd, + HYPRE_MEMORY_HOST); -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE for (i = 0; i < S_offd_i[num_variables]; i++) { -#pragma omp atomic + #pragma omp atomic measure_array_temp[num_variables + S_offd_j[i]]++; } -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE for (i = 0; i < num_cols_offd; i++) { measure_array[i + num_variables] = measure_array_temp[i + num_variables]; @@ -2191,14 +2262,14 @@ CF_marker, CF_marker_offd: initialize CF_marker /* calculate the local part for the local nodes */ #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE for (i = 0; i < S_diag_i[num_variables]; i++) { -#pragma omp atomic + #pragma omp atomic measure_array_temp[S_diag_j[i]]++; } -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE for (i = 0; i < num_variables; i++) { measure_array[i] = measure_array_temp[i]; @@ -2223,9 +2294,9 @@ CF_marker, CF_marker_offd: initialize CF_marker for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { - measure_array[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)] += buf_data[index++]; + measure_array[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)] += buf_data[index++]; } } @@ -2284,15 +2355,15 @@ CF_marker, CF_marker_offd: initialize CF_marker cnt = 0; for (i = 0; i < num_variables; i++) { - if ( CF_marker[i] != SF_PT ) + if (CF_marker[i] != SF_PT) { - if ( S_offd_i[i+1] - S_offd_i[i] > 0 || CF_marker[i] == -1 ) + if (S_offd_i[i + 1] - S_offd_i[i] > 0 || CF_marker[i] == -1) { CF_marker[i] = 0; } - if ( CF_marker[i] == Z_PT) + if (CF_marker[i] == Z_PT) { - if ( measure_array[i] >= 1.0 || S_diag_i[i+1] - S_diag_i[i] > 0 ) + if (measure_array[i] >= 1.0 || S_diag_i[i + 1] - S_diag_i[i] > 0) { CF_marker[i] = 0; graph_array[cnt++] = i; @@ -2319,7 +2390,7 @@ CF_marker, CF_marker_offd: initialize CF_marker for (i = 0; i < num_variables; i++) { CF_marker[i] = 0; - nnzrow = (S_diag_i[i+1] - S_diag_i[i]) + (S_offd_i[i+1] - S_offd_i[i]); + nnzrow = (S_diag_i[i + 1] - S_diag_i[i]) + (S_offd_i[i + 1] - S_offd_i[i]); if (nnzrow == 0) { CF_marker[i] = SF_PT; /* an isolated fine grid */ @@ -2361,9 +2432,9 @@ CF_marker, CF_marker_offd: initialize CF_marker for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { - jrow = hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j); + jrow = hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j); buf_data[index++] = measure_array[jrow]; } } @@ -2400,7 +2471,7 @@ CF_marker, CF_marker_offd: initialize CF_marker big_graph_size = (HYPRE_BigInt) graph_size; /* stop the coarsening if nothing left to be coarsened */ - hypre_MPI_Allreduce(&big_graph_size, &global_graph_size, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM,comm); + hypre_MPI_Allreduce(&big_graph_size, &global_graph_size, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); /* if (my_id == 0) { hypre_printf("graph size %b\n", global_graph_size); } */ @@ -2428,7 +2499,7 @@ CF_marker, CF_marker_offd: initialize CF_marker */ #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(ig, i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(ig, i) HYPRE_SMP_SCHEDULE #endif for (ig = 0; ig < graph_size; ig++) { @@ -2440,12 +2511,12 @@ CF_marker, CF_marker_offd: initialize CF_marker } #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(ig, i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(ig, i) HYPRE_SMP_SCHEDULE #endif for (ig = 0; ig < graph_offd_size; ig++) { i = graph_array_offd[ig]; - if (measure_array[i+num_variables] > 1) + if (measure_array[i + num_variables] > 1) { CF_marker_offd[i] = 1; } @@ -2455,7 +2526,7 @@ CF_marker, CF_marker_offd: initialize CF_marker * Remove nodes from the initial independent set *-------------------------------------------------------*/ #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(ig, i, jS, j, jj) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(ig, i, jS, j, jj) HYPRE_SMP_SCHEDULE #endif for (ig = 0; ig < graph_size; ig++) { @@ -2464,7 +2535,7 @@ CF_marker, CF_marker_offd: initialize CF_marker if (measure_array[i] > 1) { /* for each local neighbor j of i */ - for (jS = S_diag_i[i]; jS < S_diag_i[i+1]; jS++) + for (jS = S_diag_i[i]; jS < S_diag_i[i + 1]; jS++) { j = S_diag_j[jS]; if (measure_array[j] > 1) @@ -2481,7 +2552,7 @@ CF_marker, CF_marker_offd: initialize CF_marker } /* for each offd neighbor j of i */ - for (jS = S_offd_i[i]; jS < S_offd_i[i+1]; jS++) + for (jS = S_offd_i[i]; jS < S_offd_i[i + 1]; jS++) { jj = S_offd_j[jS]; j = num_variables + jj; @@ -2513,9 +2584,9 @@ CF_marker, CF_marker_offd: initialize CF_marker for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { - elmt = hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j); + elmt = hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j); if (!int_buf_data[index] && CF_marker[elmt] > 0) { CF_marker[elmt] = 0; @@ -2541,7 +2612,7 @@ CF_marker, CF_marker_offd: initialize CF_marker * Set C-pts and F-pts. *------------------------------------------------*/ #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(ig, i, jS, j) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(ig, i, jS, j) HYPRE_SMP_SCHEDULE #endif for (ig = 0; ig < graph_size; ig++) { @@ -2555,7 +2626,7 @@ CF_marker, CF_marker_offd: initialize CF_marker if (measure_array[i] < 1) { - CF_marker[i]= F_PT; + CF_marker[i] = F_PT; } /*--------------------------------------------- @@ -2576,7 +2647,7 @@ CF_marker, CF_marker_offd: initialize CF_marker else { /* first the local part */ - for (jS = S_diag_i[i]; jS < S_diag_i[i+1]; jS++) + for (jS = S_diag_i[i]; jS < S_diag_i[i + 1]; jS++) { /* j is the column number, or the local number of the point influencing i */ j = S_diag_j[jS]; @@ -2586,7 +2657,7 @@ CF_marker, CF_marker_offd: initialize CF_marker } } /* now the external part */ - for (jS = S_offd_i[i]; jS < S_offd_i[i+1]; jS++) + for (jS = S_offd_i[i]; jS < S_offd_i[i + 1]; jS++) { j = S_offd_j[jS]; if (CF_marker_offd[j] > 0) /* j is a C-point */ @@ -2607,9 +2678,9 @@ CF_marker, CF_marker_offd: initialize CF_marker for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { - int_buf_data[index++] = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + int_buf_data[index++] = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } } @@ -2624,10 +2695,10 @@ CF_marker, CF_marker_offd: initialize CF_marker *------------------------------------------------*/ /*HYPRE_Int prefix_sum_workspace[2*(hypre_NumThreads() + 1)];*/ - prefix_sum_workspace = hypre_TAlloc(HYPRE_Int, 2*(hypre_NumThreads() + 1), HYPRE_MEMORY_HOST); + prefix_sum_workspace = hypre_TAlloc(HYPRE_Int, 2 * (hypre_NumThreads() + 1), HYPRE_MEMORY_HOST); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel private(ig,i) + #pragma omp parallel private(ig,i) #endif { HYPRE_Int private_graph_size_cnt = 0; @@ -2669,7 +2740,8 @@ CF_marker, CF_marker_offd: initialize CF_marker } } - hypre_prefix_sum_pair(&private_graph_size_cnt, &graph_size, &private_graph_offd_size_cnt, &graph_offd_size, prefix_sum_workspace); + hypre_prefix_sum_pair(&private_graph_size_cnt, &graph_size, &private_graph_offd_size_cnt, + &graph_offd_size, prefix_sum_workspace); for (ig = ig_begin; ig < ig_end; ig++) { @@ -2747,32 +2819,32 @@ hypre_BoomerAMGCoarsenPMIS( hypre_ParCSRMatrix *S, HYPRE_Int debug_flag, hypre_IntArray **CF_marker_ptr) { -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_GpuProfilingPushRange("PMIS"); -#endif - - HYPRE_Int ierr = 0; -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(A) ); if (exec == HYPRE_EXEC_DEVICE) { - ierr = hypre_BoomerAMGCoarsenPMISDevice( S, A, CF_init, debug_flag, CF_marker_ptr ); + hypre_BoomerAMGCoarsenPMISDevice(S, A, CF_init, debug_flag, CF_marker_ptr); } else #endif { - ierr = hypre_BoomerAMGCoarsenPMISHost( S, A, CF_init, debug_flag, CF_marker_ptr ); + hypre_BoomerAMGCoarsenPMISHost(S, A, CF_init, debug_flag, CF_marker_ptr); } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_GpuProfilingPopRange(); -#endif - return ierr; + return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_BoomerAMGCoarsenHMIS + * + * Ruge coarsening followed by CLJP coarsening + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_BoomerAMGCoarsenHMIS( hypre_ParCSRMatrix *S, hypre_ParCSRMatrix *A, @@ -2781,16 +2853,62 @@ hypre_BoomerAMGCoarsenHMIS( hypre_ParCSRMatrix *S, HYPRE_Int debug_flag, hypre_IntArray **CF_marker_ptr) { - HYPRE_Int ierr = 0; + hypre_ParCSRMatrix *h_A, *h_S; + hypre_IntArray *CF_marker = NULL; + HYPRE_MemoryLocation CF_memory_location; - /*------------------------------------------------------- - * Perform Ruge coarsening followed by CLJP coarsening - *-------------------------------------------------------*/ + /* Clone matrices on the host if needed */ + h_S = hypre_GetActualMemLocation(hypre_ParCSRMatrixMemoryLocation(S)) == hypre_MEMORY_DEVICE ? + hypre_ParCSRMatrixClone_v2(S, 0, HYPRE_MEMORY_HOST) : S; - ierr += hypre_BoomerAMGCoarsenRuge (S, A, measure_type, 10, cut_factor, - debug_flag, CF_marker_ptr); + h_A = hypre_GetActualMemLocation(hypre_ParCSRMatrixMemoryLocation(A)) == hypre_MEMORY_DEVICE ? + hypre_ParCSRMatrixClone_v2(A, 0, HYPRE_MEMORY_HOST) : A; + + /* Clone/Create CF_marker on the host if needed */ + if (*CF_marker_ptr) + { + CF_memory_location = hypre_IntArrayMemoryLocation(*CF_marker_ptr); + CF_marker = hypre_GetActualMemLocation(CF_memory_location) == hypre_MEMORY_DEVICE ? + hypre_IntArrayCloneDeep_v2(*CF_marker_ptr, HYPRE_MEMORY_HOST) : *CF_marker_ptr; + } + else + { + CF_memory_location = HYPRE_MEMORY_HOST; + CF_marker = hypre_IntArrayCreate(hypre_ParCSRMatrixNumRows(A)); + hypre_IntArrayInitialize_v2(CF_marker, CF_memory_location); + } - ierr += hypre_BoomerAMGCoarsenPMISHost (S, A, 1, debug_flag, CF_marker_ptr); + /* Perform Ruge coarsening on the host */ + hypre_BoomerAMGCoarsenRuge(h_S, h_A, measure_type, 10, cut_factor, debug_flag, &CF_marker); - return (ierr); + /* Free cloned matrices on the host */ + if (h_S != S) { hypre_ParCSRMatrixDestroy(h_S); } + if (h_A != A) { hypre_ParCSRMatrixDestroy(h_A); } + + /* Move CF_marker to device if needed */ +#if defined(HYPRE_USING_GPU) + if (hypre_GetExecPolicy1(hypre_ParCSRMatrixMemoryLocation(A)) == HYPRE_EXEC_DEVICE) + { + if (*CF_marker_ptr && (*CF_marker_ptr != CF_marker)) + { + hypre_IntArrayCopy(CF_marker, *CF_marker_ptr); + hypre_IntArrayDestroy(CF_marker); + CF_marker = NULL; + } + else if (*CF_marker_ptr == NULL) + { + *CF_marker_ptr = hypre_IntArrayCloneDeep_v2(CF_marker, HYPRE_MEMORY_DEVICE); + hypre_IntArrayDestroy(CF_marker); + } + } + else +#endif + { + *CF_marker_ptr = CF_marker; + } + + /* Perform PMIS coarsening on the host or device */ + hypre_BoomerAMGCoarsenPMIS(S, A, 1, debug_flag, CF_marker_ptr); + + return hypre_error_flag; } diff --git a/external/hypre/src/parcsr_ls/par_coarsen_device.c b/external/hypre/src/parcsr_ls/par_coarsen_device.c index 38764b61..daadfb79 100644 --- a/external/hypre/src/parcsr_ls/par_coarsen_device.c +++ b/external/hypre/src/parcsr_ls/par_coarsen_device.c @@ -1,10 +1,11 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ +#include "_hypre_onedpl.hpp" #include "_hypre_parcsr_ls.h" #include "_hypre_utilities.hpp" @@ -14,11 +15,16 @@ #define COMMON_C_PT 2 #define Z_PT -2 -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) -HYPRE_Int hypre_PMISCoarseningInitDevice( hypre_ParCSRMatrix *S, hypre_ParCSRCommPkg *comm_pkg, HYPRE_Int CF_init, HYPRE_Real *measure_diag, HYPRE_Real *measure_offd, HYPRE_Real *real_send_buf, HYPRE_Int *graph_diag_size, HYPRE_Int *graph_diag, HYPRE_Int *CF_marker_diag); +HYPRE_Int hypre_PMISCoarseningInitDevice( hypre_ParCSRMatrix *S, hypre_ParCSRCommPkg *comm_pkg, + HYPRE_Int CF_init, HYPRE_Real *measure_diag, HYPRE_Real *measure_offd, HYPRE_Real *real_send_buf, + HYPRE_Int *graph_diag_size, HYPRE_Int *graph_diag, HYPRE_Int *CF_marker_diag); -HYPRE_Int hypre_PMISCoarseningUpdateCFDevice( hypre_ParCSRMatrix *S, HYPRE_Real *measure_diag, HYPRE_Real *measure_offd, HYPRE_Int graph_diag_size, HYPRE_Int *graph_diag, HYPRE_Int *CF_marker_diag, HYPRE_Int *CF_marker_offd, hypre_ParCSRCommPkg *comm_pkg, HYPRE_Real *real_send_buf, HYPRE_Int *int_send_buf); +HYPRE_Int hypre_PMISCoarseningUpdateCFDevice( hypre_ParCSRMatrix *S, HYPRE_Real *measure_diag, + HYPRE_Real *measure_offd, HYPRE_Int graph_diag_size, HYPRE_Int *graph_diag, + HYPRE_Int *CF_marker_diag, HYPRE_Int *CF_marker_offd, hypre_ParCSRCommPkg *comm_pkg, + HYPRE_Real *real_send_buf, HYPRE_Int *int_send_buf); HYPRE_Int hypre_BoomerAMGCoarsenPMISDevice( hypre_ParCSRMatrix *S, @@ -27,6 +33,9 @@ hypre_BoomerAMGCoarsenPMISDevice( hypre_ParCSRMatrix *S, HYPRE_Int debug_flag, hypre_IntArray **CF_marker_ptr ) { + HYPRE_UNUSED_VAR(debug_flag); + HYPRE_UNUSED_VAR(CF_init); + MPI_Comm comm = hypre_ParCSRMatrixComm(S); hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(S); hypre_ParCSRCommHandle *comm_handle; @@ -115,11 +124,13 @@ hypre_BoomerAMGCoarsenPMISDevice( hypre_ParCSRMatrix *S, aug_rand = hypre_HandleUseGpuRand(hypre_handle()) ? 1 : 2; } - hypre_GetGlobalMeasureDevice(S, comm_pkg, CF_init, aug_rand, measure_diag, measure_offd, (HYPRE_Real *) send_buf); + hypre_GetGlobalMeasureDevice(S, comm_pkg, CF_init, aug_rand, measure_diag, measure_offd, + (HYPRE_Real *) send_buf); /* initialize CF marker, graph arrays and measure_diag, measure_offd is sync'ed * Note: CF_marker_offd is not sync'ed */ - hypre_PMISCoarseningInitDevice(S, comm_pkg, CF_init, measure_diag, measure_offd, (HYPRE_Real *) send_buf, + hypre_PMISCoarseningInitDevice(S, comm_pkg, CF_init, measure_diag, measure_offd, + (HYPRE_Real *) send_buf, &graph_diag_size, graph_diag, CF_marker_diag); while (1) @@ -146,12 +157,28 @@ hypre_BoomerAMGCoarsenPMISDevice( hypre_ParCSRMatrix *S, CF_marker_diag, CF_marker_offd, comm_pkg, (HYPRE_Int *) send_buf); /* sync CF_marker_offd: so it has correct 1/0 now */ +#if defined(HYPRE_USING_SYCL) + hypreSycl_gather( hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + + hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + CF_marker_diag, + (HYPRE_Int *) send_buf ); +#else HYPRE_THRUST_CALL( gather, hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), CF_marker_diag, (HYPRE_Int *) send_buf ); +#endif + +#if defined(HYPRE_USING_THRUST_NOSYNC) + /* RL: make sure send_buf is ready before issuing GPU-GPU MPI */ + if (hypre_GetGpuAwareMPI()) + { + hypre_ForceSyncComputeStream(); + } +#endif comm_handle = hypre_ParCSRCommHandleCreate_v2(11, comm_pkg, HYPRE_MEMORY_DEVICE, (HYPRE_Int *) send_buf, @@ -170,6 +197,17 @@ hypre_BoomerAMGCoarsenPMISDevice( hypre_ParCSRMatrix *S, (HYPRE_Int *)send_buf); /* Update graph_diag. Remove the nodes with CF_marker_diag != 0 */ +#if defined(HYPRE_USING_SYCL) + hypreSycl_gather( graph_diag, + graph_diag + graph_diag_size, + CF_marker_diag, + diag_iwork ); + + HYPRE_Int *new_end = hypreSycl_remove_if( graph_diag, + graph_diag + graph_diag_size, + diag_iwork, + [] (const auto & x) {return x;} ); +#else HYPRE_THRUST_CALL( gather, graph_diag, graph_diag + graph_diag_size, @@ -181,6 +219,7 @@ hypre_BoomerAMGCoarsenPMISDevice( hypre_ParCSRMatrix *S, graph_diag + graph_diag_size, diag_iwork, thrust::identity() ); +#endif graph_diag_size = new_end - graph_diag; } @@ -212,6 +251,8 @@ hypre_GetGlobalMeasureDevice( hypre_ParCSRMatrix *S, HYPRE_Real *measure_offd, HYPRE_Real *real_send_buf ) { + HYPRE_UNUSED_VAR(CF_init); + hypre_ParCSRCommHandle *comm_handle; HYPRE_Int num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); hypre_CSRMatrix *S_diag = hypre_ParCSRMatrixDiag(S); @@ -221,6 +262,12 @@ hypre_GetGlobalMeasureDevice( hypre_ParCSRMatrix *S, /* compute local column nnz of the offd part */ hypre_CSRMatrixColNNzRealDevice(S_offd, measure_offd); + if (hypre_GetGpuAwareMPI()) + { + /* RL: make sure measure_offd is ready before issuing GPU-GPU MPI */ + hypre_ForceSyncComputeStream(); + } + /* send local column nnz of the offd part to neighbors */ comm_handle = hypre_ParCSRCommHandleCreate_v2(2, comm_pkg, HYPRE_MEMORY_DEVICE, measure_offd, HYPRE_MEMORY_DEVICE, real_send_buf); @@ -250,15 +297,16 @@ hypre_GetGlobalMeasureDevice( hypre_ParCSRMatrix *S, } __global__ void -hypreCUDAKernel_PMISCoarseningInit(HYPRE_Int nrows, - HYPRE_Int CF_init, - HYPRE_Int *S_diag_i, - HYPRE_Int *S_offd_i, - HYPRE_Real *measure_diag, - HYPRE_Int *CF_marker_diag) +hypreGPUKernel_PMISCoarseningInit(hypre_DeviceItem &item, + HYPRE_Int nrows, + HYPRE_Int CF_init, + HYPRE_Int *S_diag_i, + HYPRE_Int *S_offd_i, + HYPRE_Real *measure_diag, + HYPRE_Int *CF_marker_diag) { /* global_thread_id */ - const HYPRE_Int i = hypre_cuda_get_grid_thread_id<1,1>(); + const HYPRE_Int i = hypre_gpu_get_grid_thread_id<1, 1>(item); if (i >= nrows) { @@ -269,13 +317,37 @@ hypreCUDAKernel_PMISCoarseningInit(HYPRE_Int nrows, if (CF_init == 1) { - // TODO - hypre_device_assert(0); + CF_marker_i = read_only_load(&CF_marker_diag[i]); + + if (CF_marker_i != SF_PT) + { + if (read_only_load(&S_offd_i[i + 1]) - read_only_load(&S_offd_i[i]) > 0 || + CF_marker_i == F_PT) + { + CF_marker_i = 0; + } + if (CF_marker_i == Z_PT) + { + if (measure_diag[i] > 1.0 || + read_only_load(&S_diag_i[i + 1]) - read_only_load(&S_diag_i[i])) + { + CF_marker_i = 0; + } + else + { + CF_marker_i = SF_PT; + } + } + } + else + { + measure_diag[i] = 0.0; + } } else { - if ( read_only_load(&S_diag_i[i+1]) - read_only_load(&S_diag_i[i]) == 0 && - read_only_load(&S_offd_i[i+1]) - read_only_load(&S_offd_i[i]) == 0 ) + if ( read_only_load(&S_diag_i[i + 1]) - read_only_load(&S_diag_i[i]) == 0 && + read_only_load(&S_offd_i[i + 1]) - read_only_load(&S_offd_i[i]) == 0 ) { CF_marker_i = (CF_init == 3 || CF_init == 4) ? C_PT : SF_PT; measure_diag[i] = 0.0; @@ -316,24 +388,39 @@ hypre_PMISCoarseningInitDevice( hypre_ParCSRMatrix *S, /* in */ HYPRE_Int num_rows_diag = hypre_CSRMatrixNumRows(S_diag); HYPRE_Int num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - dim3 bDim, gDim; - bDim = hypre_GetDefaultCUDABlockDimension(); - gDim = hypre_GetDefaultCUDAGridDimension(num_rows_diag, "thread", bDim); + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(num_rows_diag, "thread", bDim); hypre_ParCSRCommHandle *comm_handle; HYPRE_Int *new_end; /* init CF_marker_diag and measure_diag: remove some special nodes */ - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_PMISCoarseningInit, gDim, bDim, - num_rows_diag, CF_init, S_diag_i, S_offd_i, measure_diag, CF_marker_diag ); + HYPRE_GPU_LAUNCH( hypreGPUKernel_PMISCoarseningInit, gDim, bDim, + num_rows_diag, CF_init, S_diag_i, S_offd_i, measure_diag, CF_marker_diag ); /* communicate for measure_offd */ +#if defined(HYPRE_USING_SYCL) + hypreSycl_gather( hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + + hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + measure_diag, + real_send_buf ); +#else HYPRE_THRUST_CALL(gather, hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), measure_diag, real_send_buf); +#endif + +#if defined(HYPRE_USING_THRUST_NOSYNC) + /* RL: make sure real_send_buf is ready before issuing GPU-GPU MPI */ + if (hypre_GetGpuAwareMPI()) + { + hypre_ForceSyncComputeStream(); + } +#endif comm_handle = hypre_ParCSRCommHandleCreate_v2(1, comm_pkg, HYPRE_MEMORY_DEVICE, real_send_buf, @@ -342,13 +429,21 @@ hypre_PMISCoarseningInitDevice( hypre_ParCSRMatrix *S, /* in */ hypre_ParCSRCommHandleDestroy(comm_handle); /* graph_diag consists points with CF_marker_diag == 0 */ - new_end = - HYPRE_THRUST_CALL(remove_copy_if, - thrust::make_counting_iterator(0), - thrust::make_counting_iterator(num_rows_diag), - CF_marker_diag, - graph_diag, - thrust::identity()); +#if defined(HYPRE_USING_SYCL) + oneapi::dpl::counting_iterator count(0); + new_end = hypreSycl_remove_copy_if( count, + count + num_rows_diag, + CF_marker_diag, + graph_diag, + [] (const auto & x) {return x;} ); +#else + new_end = HYPRE_THRUST_CALL( remove_copy_if, + thrust::make_counting_iterator(0), + thrust::make_counting_iterator(num_rows_diag), + CF_marker_diag, + graph_diag, + thrust::identity()); +#endif *graph_diag_size = new_end - graph_diag; @@ -356,25 +451,26 @@ hypre_PMISCoarseningInitDevice( hypre_ParCSRMatrix *S, /* in */ } __global__ void -hypreCUDAKernel_PMISCoarseningUpdateCF(HYPRE_Int graph_diag_size, - HYPRE_Int *graph_diag, - HYPRE_Int *S_diag_i, - HYPRE_Int *S_diag_j, - HYPRE_Int *S_offd_i, - HYPRE_Int *S_offd_j, - HYPRE_Real *measure_diag, - HYPRE_Int *CF_marker_diag, - HYPRE_Int *CF_marker_offd) +hypreGPUKernel_PMISCoarseningUpdateCF(hypre_DeviceItem &item, + HYPRE_Int graph_diag_size, + HYPRE_Int *graph_diag, + HYPRE_Int *S_diag_i, + HYPRE_Int *S_diag_j, + HYPRE_Int *S_offd_i, + HYPRE_Int *S_offd_j, + HYPRE_Real *measure_diag, + HYPRE_Int *CF_marker_diag, + HYPRE_Int *CF_marker_offd) { - HYPRE_Int warp_id = hypre_cuda_get_grid_warp_id<1,1>(); + HYPRE_Int warp_id = hypre_gpu_get_grid_warp_id<1, 1>(item); if (warp_id >= graph_diag_size) { return; } - HYPRE_Int lane = hypre_cuda_get_lane_id<1>(); - HYPRE_Int row, i, marker_row, row_start, row_end; + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); + HYPRE_Int row = 0, i = 0, marker_row, row_start, row_end; if (lane < 2) { @@ -382,7 +478,7 @@ hypreCUDAKernel_PMISCoarseningUpdateCF(HYPRE_Int graph_diag_size, i = read_only_load(CF_marker_diag + row); } - marker_row = __shfl_sync(HYPRE_WARP_FULL_MASK, i, 0); + marker_row = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, i, 0); if (marker_row > 0) { @@ -404,7 +500,7 @@ hypreCUDAKernel_PMISCoarseningUpdateCF(HYPRE_Int graph_diag_size, * Now treat the case where this node is not in the * independent set: loop over * all the points j that influence equation 'row'; if - * any j is a C point, then make row an F point and + * any j is a C point, then make row an F point and * clear the measure *-------------------------------------------------*/ if (lane < 2) @@ -412,8 +508,8 @@ hypreCUDAKernel_PMISCoarseningUpdateCF(HYPRE_Int graph_diag_size, i = read_only_load(S_diag_i + row + lane); } - row_start = __shfl_sync(HYPRE_WARP_FULL_MASK, i, 0); - row_end = __shfl_sync(HYPRE_WARP_FULL_MASK, i, 1); + row_start = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, i, 0); + row_end = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, i, 1); for (i = row_start + lane; i < row_end; i += HYPRE_WARP_SIZE) { @@ -428,7 +524,7 @@ hypreCUDAKernel_PMISCoarseningUpdateCF(HYPRE_Int graph_diag_size, } } - marker_row = warp_allreduce_min(marker_row); + marker_row = warp_allreduce_min(item, marker_row); if (marker_row == 0) { @@ -437,8 +533,8 @@ hypreCUDAKernel_PMISCoarseningUpdateCF(HYPRE_Int graph_diag_size, i = read_only_load(S_offd_i + row + lane); } - row_start = __shfl_sync(HYPRE_WARP_FULL_MASK, i, 0); - row_end = __shfl_sync(HYPRE_WARP_FULL_MASK, i, 1); + row_start = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, i, 0); + row_end = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, i, 1); for (i = row_start + lane; i < row_end; i += HYPRE_WARP_SIZE) { @@ -452,7 +548,7 @@ hypreCUDAKernel_PMISCoarseningUpdateCF(HYPRE_Int graph_diag_size, } } - marker_row = warp_reduce_min(marker_row); + marker_row = warp_reduce_min(item, marker_row); } if (lane == 0 && marker_row == -1) @@ -475,6 +571,8 @@ hypre_PMISCoarseningUpdateCFDevice( hypre_ParCSRMatrix *S, /* in HYPRE_Real *real_send_buf, HYPRE_Int *int_send_buf ) { + HYPRE_UNUSED_VAR(int_send_buf); + hypre_CSRMatrix *S_diag = hypre_ParCSRMatrixDiag(S); HYPRE_Int *S_diag_i = hypre_CSRMatrixI(S_diag); HYPRE_Int *S_diag_j = hypre_CSRMatrixJ(S_diag); @@ -483,31 +581,46 @@ hypre_PMISCoarseningUpdateCFDevice( hypre_ParCSRMatrix *S, /* in HYPRE_Int *S_offd_j = hypre_CSRMatrixJ(S_offd); HYPRE_Int num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - dim3 bDim, gDim; - bDim = hypre_GetDefaultCUDABlockDimension(); - gDim = hypre_GetDefaultCUDAGridDimension(graph_diag_size, "warp", bDim); - - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_PMISCoarseningUpdateCF, - gDim, bDim, - graph_diag_size, - graph_diag, - S_diag_i, - S_diag_j, - S_offd_i, - S_offd_j, - measure_diag, - CF_marker_diag, - CF_marker_offd ); + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(graph_diag_size, "warp", bDim); + + HYPRE_GPU_LAUNCH( hypreGPUKernel_PMISCoarseningUpdateCF, + gDim, bDim, + graph_diag_size, + graph_diag, + S_diag_i, + S_diag_j, + S_offd_i, + S_offd_j, + measure_diag, + CF_marker_diag, + CF_marker_offd ); hypre_ParCSRCommHandle *comm_handle; /* communicate for measure_offd */ +#if defined(HYPRE_USING_SYCL) + hypreSycl_gather( hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + + hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + measure_diag, + real_send_buf ); +#else HYPRE_THRUST_CALL(gather, hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), measure_diag, real_send_buf); +#endif + +#if defined(HYPRE_USING_THRUST_NOSYNC) + /* RL: make sure real_send_buf is ready before issuing GPU-GPU MPI */ + if (hypre_GetGpuAwareMPI()) + { + hypre_ForceSyncComputeStream(); + } +#endif comm_handle = hypre_ParCSRCommHandleCreate_v2(1, comm_pkg, HYPRE_MEMORY_DEVICE, real_send_buf, @@ -519,11 +632,19 @@ hypre_PMISCoarseningUpdateCFDevice( hypre_ParCSRMatrix *S, /* in /* now communicate CF_marker to CF_marker_offd, to make sure that new external F points are known on this processor */ HYPRE_THRUST_CALL(gather, - hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), - hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + - hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), - CF_marker_diag, - int_send_buf); + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + + hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + CF_marker_diag, + int_send_buf); + +#if defined(HYPRE_USING_THRUST_NOSYNC) + /* RL: make sure int_send_buf is ready before issuing GPU-GPU MPI */ + if (hypre_GetGpuAwareMPI()) + { + hypre_ForceSyncComputeStream(); + } +#endif comm_handle = hypre_ParCSRCommHandleCreate_v2(11, comm_pkg, HYPRE_MEMORY_DEVICE, int_send_buf, @@ -535,5 +656,4 @@ hypre_PMISCoarseningUpdateCFDevice( hypre_ParCSRMatrix *S, /* in return hypre_error_flag; } -#endif // #if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - +#endif // #if defined(HYPRE_USING_GPU) diff --git a/external/hypre/src/parcsr_ls/par_coordinates.c b/external/hypre/src/parcsr_ls/par_coordinates.c index e81c701d..f4896b75 100644 --- a/external/hypre/src/parcsr_ls/par_coordinates.c +++ b/external/hypre/src/parcsr_ls/par_coordinates.c @@ -1,29 +1,31 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ #include "_hypre_parcsr_ls.h" - + /*-------------------------------------------------------------------------- - * GenerateCoordinates + * hypre_GenerateCoordinates *--------------------------------------------------------------------------*/ float * -GenerateCoordinates( MPI_Comm comm, - HYPRE_BigInt nx, - HYPRE_BigInt ny, - HYPRE_BigInt nz, - HYPRE_Int P, - HYPRE_Int Q, - HYPRE_Int R, - HYPRE_Int p, - HYPRE_Int q, - HYPRE_Int r, - HYPRE_Int coorddim) +hypre_GenerateCoordinates( MPI_Comm comm, + HYPRE_BigInt nx, + HYPRE_BigInt ny, + HYPRE_BigInt nz, + HYPRE_Int P, + HYPRE_Int Q, + HYPRE_Int R, + HYPRE_Int p, + HYPRE_Int q, + HYPRE_Int r, + HYPRE_Int coorddim) { + HYPRE_UNUSED_VAR(comm); + HYPRE_BigInt ix, iy, iz; HYPRE_Int cnt; @@ -34,41 +36,43 @@ GenerateCoordinates( MPI_Comm comm, HYPRE_BigInt *ny_part; HYPRE_BigInt *nz_part; - float *coord=NULL; + float *coord = NULL; - if (coorddim<1 || coorddim>3) { - return NULL; + if (coorddim < 1 || coorddim > 3) + { + return NULL; } - hypre_GeneratePartitioning(nx,P,&nx_part); - hypre_GeneratePartitioning(ny,Q,&ny_part); - hypre_GeneratePartitioning(nz,R,&nz_part); + hypre_GeneratePartitioning(nx, P, &nx_part); + hypre_GeneratePartitioning(ny, Q, &ny_part); + hypre_GeneratePartitioning(nz, R, &nz_part); - nx_local = (HYPRE_Int)(nx_part[p+1] - nx_part[p]); - ny_local = (HYPRE_Int)(ny_part[q+1] - ny_part[q]); - nz_local = (HYPRE_Int)(nz_part[r+1] - nz_part[r]); + nx_local = (HYPRE_Int)(nx_part[p + 1] - nx_part[p]); + ny_local = (HYPRE_Int)(ny_part[q + 1] - ny_part[q]); + nz_local = (HYPRE_Int)(nz_part[r + 1] - nz_part[r]); + + local_num_rows = nx_local * ny_local * nz_local; + + coord = hypre_CTAlloc(float, coorddim * local_num_rows, HYPRE_MEMORY_HOST); - local_num_rows = nx_local*ny_local*nz_local; - - coord = hypre_CTAlloc(float, coorddim*local_num_rows, HYPRE_MEMORY_HOST); - cnt = 0; - for (iz = nz_part[r]; iz < nz_part[r+1]; iz++) + for (iz = nz_part[r]; iz < nz_part[r + 1]; iz++) { - for (iy = ny_part[q]; iy < ny_part[q+1]; iy++) - { - for (ix = nx_part[p]; ix < nx_part[p+1]; ix++) - { - /* set coordinates BM Oct 17, 2006 */ - if (coord) { - if (nx>1) coord[cnt++] = ix; - if (ny>1) coord[cnt++] = iy; - if (nz>1) coord[cnt++] = iz; - } - } - } + for (iy = ny_part[q]; iy < ny_part[q + 1]; iy++) + { + for (ix = nx_part[p]; ix < nx_part[p + 1]; ix++) + { + /* set coordinates BM Oct 17, 2006 */ + if (coord) + { + if (nx > 1) { coord[cnt++] = ix; } + if (ny > 1) { coord[cnt++] = iy; } + if (nz > 1) { coord[cnt++] = iz; } + } + } + } } - + hypre_TFree(nx_part, HYPRE_MEMORY_HOST); hypre_TFree(ny_part, HYPRE_MEMORY_HOST); hypre_TFree(nz_part, HYPRE_MEMORY_HOST); diff --git a/external/hypre/src/parcsr_ls/par_cr.c b/external/hypre/src/parcsr_ls/par_cr.c index d9fe5234..9d038d36 100644 --- a/external/hypre/src/parcsr_ls/par_cr.c +++ b/external/hypre/src/parcsr_ls/par_cr.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -30,6 +30,9 @@ hypre_BoomerAMGCoarsenCR1( hypre_ParCSRMatrix *A, HYPRE_Int IS_type, HYPRE_Int CRaddCpoints) { + HYPRE_UNUSED_VAR(num_CR_relax_steps); + HYPRE_UNUSED_VAR(IS_type); + HYPRE_Int i; /* HYPRE_Real theta_global;*/ hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); @@ -41,7 +44,8 @@ hypre_BoomerAMGCoarsenCR1( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker; HYPRE_Int coarse_size; - if(CRaddCpoints == 0){ + if (CRaddCpoints == 0) + { *CF_marker_ptr = hypre_IntArrayCreate(num_variables); hypre_IntArrayInitialize(*CF_marker_ptr); hypre_IntArraySetConstantValues(*CF_marker_ptr, fpt); @@ -50,14 +54,16 @@ hypre_BoomerAMGCoarsenCR1( hypre_ParCSRMatrix *A, /* Run the CR routine */ - hypre_fprintf(stdout,"\n... Building CF using CR ...\n\n"); + hypre_fprintf(stdout, "\n... Building CF using CR ...\n\n"); hypre_cr(A_i, A_j, A_data, num_variables, CF_marker, - RelaxScheme1, omega1, theta_global1,mu1); + RelaxScheme1, omega1, theta_global1, mu1); - hypre_fprintf(stdout,"\n... Done \n\n"); + hypre_fprintf(stdout, "\n... Done \n\n"); coarse_size = 0; - for ( i =0 ;i < num_variables;i++){ - if ( CF_marker[i] == cpt){ + for ( i = 0 ; i < num_variables; i++) + { + if ( CF_marker[i] == cpt) + { coarse_size++; } } @@ -70,68 +76,87 @@ hypre_BoomerAMGCoarsenCR1( hypre_ParCSRMatrix *A, HYPRE_Int hypre_cr(HYPRE_Int *A_i, HYPRE_Int *A_j, HYPRE_Real *A_data, HYPRE_Int n, HYPRE_Int *cf, HYPRE_Int rlx, HYPRE_Real omega, HYPRE_Real tg, HYPRE_Int mu) { - HYPRE_Int i,nstages=0; - HYPRE_Real rho,rho0,rho1,*e0,*e1; - HYPRE_Real nc= 0.0; + HYPRE_Int i, nstages = 0; + HYPRE_Real rho, rho0, rho1, *e0, *e1; + HYPRE_Real nc = 0.0; - e0=hypre_CTAlloc(HYPRE_Real, n, HYPRE_MEMORY_HOST); - e1=hypre_CTAlloc(HYPRE_Real, n, HYPRE_MEMORY_HOST); + e0 = hypre_CTAlloc(HYPRE_Real, n, HYPRE_MEMORY_HOST); + e1 = hypre_CTAlloc(HYPRE_Real, n, HYPRE_MEMORY_HOST); - hypre_fprintf(stdout,"Stage \t rho \t alpha \n"); - hypre_fprintf(stdout,"-----------------------\n"); + hypre_fprintf(stdout, "Stage \t rho \t alpha \n"); + hypre_fprintf(stdout, "-----------------------\n"); for (i = 0; i < n; i++) - e1[i] = 1.0e0+.1*hypre_RandI(); + { + e1[i] = 1.0e0 + .1 * hypre_RandI(); + } /* stages */ - while(1){ - if (nstages > 0){ - for (i=0;i 0) + { + for (i = 0; i < n; i++) + { + if (cf[i] == cpt) + { e0[i] = 0.0e0; e1[i] = 0.0e0; } } } - switch(rlx){ + switch (rlx) + { case fptOmegaJac: - for (i=0;i tg){ - hypre_formu(cf,n,e1,A_i,rho); - hypre_IndepSetGreedy(A_i,A_j,n,cf); + if (rho > tg) + { + hypre_formu(cf, n, e1, A_i, rho); + hypre_IndepSetGreedy(A_i, A_j, n, cf); - hypre_fprintf(stdout," %d \t%2.3f \t%2.3f \n", - nstages,rho,nc/n); + hypre_fprintf(stdout, " %d \t%2.3f \t%2.3f \n", + nstages, rho, nc / n); /* update for next sweep */ nc = 0.0e0; - for (i=0;i istack){ + if (ma[i] > istack) + { istack = (HYPRE_Int) ma[i]; } } - else if (cf[i] == cpt){ + else if (cf[i] == cpt) + { ma[i] = -1; - } else { + } + else + { ma[i] = 0; } } - stack_size = 2*istack; + stack_size = 2 * istack; /* initialize graph */ head_mem = hypre_CTAlloc(HYPRE_Int, stack_size, HYPRE_MEMORY_HOST); head = head_mem + stack_size; tail_mem = hypre_CTAlloc(HYPRE_Int, stack_size, HYPRE_MEMORY_HOST); tail = tail_mem + stack_size; list = hypre_CTAlloc(Link, n, HYPRE_MEMORY_HOST); - for (i = -1; i >= -stack_size; i--){ + for (i = -1; i >= -stack_size; i--) + { head[i] = i; tail[i] = i; } - for (i = 0; i < n; i++){ - if (ma[i] > 0){ + for (i = 0; i < n; i++) + { + if (ma[i] > 0) + { hypre_GraphAdd(list, head, tail, i, (HYPRE_Int) ma[i]); } } /* Loop until all points are either F or C */ - while (istack > 0){ + while (istack > 0) + { /* i w/ max measure at head of stacks */ i = head[-istack]; @@ -245,12 +292,15 @@ HYPRE_Int hypre_IndepSetGreedy(HYPRE_Int *A_i, HYPRE_Int *A_j, HYPRE_Int n, HYPR hypre_GraphRemove(list, head, tail, i); /* update nbs and nbs-of-nbs */ - for (ji = A_i[i]+1; ji < A_i[i+1]; ji++){ + for (ji = A_i[i] + 1; ji < A_i[i + 1]; ji++) + { jj = A_j[ji]; /* if not "decided" C or F */ - if (ma[jj] > -1){ + if (ma[jj] > -1) + { /* if a candidate, remove jj from graph */ - if (ma[jj] > 0){ + if (ma[jj] > 0) + { hypre_GraphRemove(list, head, tail, jj); } @@ -258,17 +308,20 @@ HYPRE_Int hypre_IndepSetGreedy(HYPRE_Int *A_i, HYPRE_Int *A_j, HYPRE_Int n, HYPR cf[jj] = fpt; ma[jj] = -1; - for (jl = A_i[jj]+1; jl < A_i[jj+1]; jl++){ + for (jl = A_i[jj] + 1; jl < A_i[jj + 1]; jl++) + { index = A_j[jl]; /* if a candidate, increase ma */ - if (ma[index] > 0){ + if (ma[index] > 0) + { ma[index]++; /* move index in graph */ hypre_GraphRemove(list, head, tail, index); hypre_GraphAdd(list, head, tail, index, (HYPRE_Int) ma[index]); - if (ma[index] > istack){ + if (ma[index] > istack) + { istack = (HYPRE_Int) ma[index]; } } @@ -276,9 +329,11 @@ HYPRE_Int hypre_IndepSetGreedy(HYPRE_Int *A_i, HYPRE_Int *A_j, HYPRE_Int n, HYPR } } /* reset istack to point to biggest non-empty stack */ - for ( ; istack > 0; istack--){ + for ( ; istack > 0; istack--) + { /* if non-negative, break */ - if (head[-istack] > -1){ + if (head[-istack] > -1) + { break; } } @@ -310,44 +365,56 @@ HYPRE_Int hypre_IndepSetGreedyS(HYPRE_Int *A_i, HYPRE_Int *A_j, HYPRE_Int n, HYP * Note: only cands are put into graph */ istack = 0; - for (i = 0; i < n; i++){ - if (cf[i] == cand){ + for (i = 0; i < n; i++) + { + if (cf[i] == cand) + { ma[i] = 1; - for (ji = A_i[i]; ji < A_i[i+1]; ji++){ + for (ji = A_i[i]; ji < A_i[i + 1]; ji++) + { jj = A_j[ji]; - if (cf[jj] != cpt){ + if (cf[jj] != cpt) + { ma[i]++; } } - if (ma[i] > istack){ + if (ma[i] > istack) + { istack = (HYPRE_Int) ma[i]; } } - else if (cf[i] == cpt){ + else if (cf[i] == cpt) + { ma[i] = -1; - } else { + } + else + { ma[i] = 0; } } - stack_size = 2*istack; + stack_size = 2 * istack; /* initialize graph */ head_mem = hypre_CTAlloc(HYPRE_Int, stack_size, HYPRE_MEMORY_HOST); head = head_mem + stack_size; tail_mem = hypre_CTAlloc(HYPRE_Int, stack_size, HYPRE_MEMORY_HOST); tail = tail_mem + stack_size; list = hypre_CTAlloc(Link, n, HYPRE_MEMORY_HOST); - for (i = -1; i >= -stack_size; i--){ + for (i = -1; i >= -stack_size; i--) + { head[i] = i; tail[i] = i; } - for (i = 0; i < n; i++){ - if (ma[i] > 0){ + for (i = 0; i < n; i++) + { + if (ma[i] > 0) + { hypre_GraphAdd(list, head, tail, i, (HYPRE_Int) ma[i]); } } /* Loop until all points are either F or C */ - while (istack > 0){ + while (istack > 0) + { /* i w/ max measure at head of stacks */ i = head[-istack]; @@ -359,12 +426,15 @@ HYPRE_Int hypre_IndepSetGreedyS(HYPRE_Int *A_i, HYPRE_Int *A_j, HYPRE_Int n, HYP hypre_GraphRemove(list, head, tail, i); /* update nbs and nbs-of-nbs */ - for (ji = A_i[i]; ji < A_i[i+1]; ji++){ + for (ji = A_i[i]; ji < A_i[i + 1]; ji++) + { jj = A_j[ji]; /* if not "decided" C or F */ - if (ma[jj] > -1){ + if (ma[jj] > -1) + { /* if a candidate, remove jj from graph */ - if (ma[jj] > 0){ + if (ma[jj] > 0) + { hypre_GraphRemove(list, head, tail, jj); } @@ -372,17 +442,20 @@ HYPRE_Int hypre_IndepSetGreedyS(HYPRE_Int *A_i, HYPRE_Int *A_j, HYPRE_Int n, HYP cf[jj] = fpt; ma[jj] = -1; - for (jl = A_i[jj]; jl < A_i[jj+1]; jl++){ + for (jl = A_i[jj]; jl < A_i[jj + 1]; jl++) + { index = A_j[jl]; /* if a candidate, increase ma */ - if (ma[index] > 0){ + if (ma[index] > 0) + { ma[index]++; /* move index in graph */ hypre_GraphRemove(list, head, tail, index); hypre_GraphAdd(list, head, tail, index, (HYPRE_Int) ma[index]); - if (ma[index] > istack){ + if (ma[index] > istack) + { istack = (HYPRE_Int) ma[index]; } } @@ -390,9 +463,11 @@ HYPRE_Int hypre_IndepSetGreedyS(HYPRE_Int *A_i, HYPRE_Int *A_j, HYPRE_Int n, HYP } } /* reset istack to point to biggest non-empty stack */ - for ( ; istack > 0; istack--){ + for ( ; istack > 0; istack--) + { /* if non-negative, break */ - if (head[-istack] > -1){ + if (head[-istack] > -1) + { break; } } @@ -413,20 +488,26 @@ HYPRE_Int hypre_fptjaccr(HYPRE_Int *cf, HYPRE_Int *A_i, HYPRE_Int *A_j, HYPRE_Re HYPRE_Int i, j; HYPRE_Real res; - for (i=0;i max) - max = fabs(e1[i]); + for (i = 0; i < n; i++) + if (hypre_abs(e1[i]) > max) + { + max = hypre_abs(e1[i]); + } - for (i=0;i thresh && A_i[i+1]-A_i[i] > 1){ + for (i = 0; i < n; i++) + { + if (cf[i] == fpt) + { + candmeas = hypre_pow(hypre_abs(e1[i]), 1.0) / max; + if (candmeas > thresh && A_i[i + 1] - A_i[i] > 1) + { cf[i] = cand; } } @@ -500,16 +594,16 @@ hypre_BoomerAMGIndepRS( hypre_ParCSRMatrix *S, HYPRE_Int debug_flag, HYPRE_Int *CF_marker) { - MPI_Comm comm = hypre_ParCSRMatrixComm(S); - hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(S); - hypre_CSRMatrix *S_diag = hypre_ParCSRMatrixDiag(S); - hypre_CSRMatrix *S_offd = hypre_ParCSRMatrixOffd(S); - HYPRE_Int *S_i = hypre_CSRMatrixI(S_diag); - HYPRE_Int *S_j = hypre_CSRMatrixJ(S_diag); - HYPRE_Int *S_offd_i = hypre_CSRMatrixI(S_offd); - HYPRE_Int *S_offd_j; - HYPRE_Int num_variables = hypre_CSRMatrixNumRows(S_diag); - HYPRE_Int num_cols_offd = hypre_CSRMatrixNumCols(S_offd); + MPI_Comm comm = hypre_ParCSRMatrixComm(S); + hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(S); + hypre_CSRMatrix *S_diag = hypre_ParCSRMatrixDiag(S); + hypre_CSRMatrix *S_offd = hypre_ParCSRMatrixOffd(S); + HYPRE_Int *S_i = hypre_CSRMatrixI(S_diag); + HYPRE_Int *S_j = hypre_CSRMatrixJ(S_diag); + HYPRE_Int *S_offd_i = hypre_CSRMatrixI(S_offd); + HYPRE_Int *S_offd_j = NULL; + HYPRE_Int num_variables = hypre_CSRMatrixNumRows(S_diag); + HYPRE_Int num_cols_offd = hypre_CSRMatrixNumCols(S_offd); hypre_ParCSRCommHandle *comm_handle; hypre_CSRMatrix *ST; @@ -566,10 +660,10 @@ hypre_BoomerAMGIndepRS( hypre_ParCSRMatrix *S, * to "unaccounted-for" dependence. *----------------------------------------------------------------*/ - if (debug_flag == 3) wall_time = time_getWallclockSeconds(); + if (debug_flag == 3) { wall_time = time_getWallclockSeconds(); } - hypre_MPI_Comm_size(comm,&num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); if (!comm_pkg) { @@ -585,12 +679,12 @@ hypre_BoomerAMGIndepRS( hypre_ParCSRMatrix *S, num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - if (num_cols_offd) S_offd_j = hypre_CSRMatrixJ(S_offd); + if (num_cols_offd) { S_offd_j = hypre_CSRMatrixJ(S_offd); } jS = S_i[num_variables]; ST = hypre_CSRMatrixCreate(num_variables, num_variables, jS); - ST_i = hypre_CTAlloc(HYPRE_Int, num_variables+1, HYPRE_MEMORY_HOST); + ST_i = hypre_CTAlloc(HYPRE_Int, num_variables + 1, HYPRE_MEMORY_HOST); ST_j = hypre_CTAlloc(HYPRE_Int, jS, HYPRE_MEMORY_HOST); hypre_CSRMatrixI(ST) = ST_i; hypre_CSRMatrixJ(ST) = ST_j; @@ -599,20 +693,22 @@ hypre_BoomerAMGIndepRS( hypre_ParCSRMatrix *S, * generate transpose of S, ST *----------------------------------------------------------*/ - for (i=0; i <= num_variables; i++) + for (i = 0; i <= num_variables; i++) + { ST_i[i] = 0; + } - for (i=0; i < jS; i++) + for (i = 0; i < jS; i++) { - ST_i[S_j[i]+1]++; + ST_i[S_j[i] + 1]++; } - for (i=0; i < num_variables; i++) + for (i = 0; i < num_variables; i++) { - ST_i[i+1] += ST_i[i]; + ST_i[i + 1] += ST_i[i]; } - for (i=0; i < num_variables; i++) + for (i = 0; i < num_variables; i++) { - for (j=S_i[i]; j < S_i[i+1]; j++) + for (j = S_i[i]; j < S_i[i + 1]; j++) { index = S_j[j]; ST_j[ST_i[index]] = i; @@ -621,7 +717,7 @@ hypre_BoomerAMGIndepRS( hypre_ParCSRMatrix *S, } for (i = num_variables; i > 0; i--) { - ST_i[i] = ST_i[i-1]; + ST_i[i] = ST_i[i - 1]; } ST_i[0] = 0; @@ -638,16 +734,20 @@ hypre_BoomerAMGIndepRS( hypre_ParCSRMatrix *S, if (measure_type == 0) { measure_array = hypre_CTAlloc(HYPRE_Int, num_variables, HYPRE_MEMORY_HOST); - for (i=0; i < num_variables; i++) + for (i = 0; i < num_variables; i++) + { measure_array[i] = 0; - for (i=0; i < num_variables; i++) + } + for (i = 0; i < num_variables; i++) { if (CF_marker[i] < 1) { - for (j = S_i[i]; j < S_i[i+1]; j++) + for (j = S_i[i]; j < S_i[i + 1]; j++) { if (CF_marker[S_j[j]] < 1) + { measure_array[S_j[j]]++; + } } } } @@ -658,25 +758,31 @@ hypre_BoomerAMGIndepRS( hypre_ParCSRMatrix *S, /* now the off-diagonal part of CF_marker */ if (num_cols_offd) + { CF_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_offd, HYPRE_MEMORY_HOST); + } else + { CF_marker_offd = NULL; + } - for (i=0; i < num_cols_offd; i++) + for (i = 0; i < num_cols_offd; i++) + { CF_marker_offd[i] = 0; + } /*------------------------------------------------ * Communicate the CF_marker values to the external nodes *------------------------------------------------*/ int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, - num_sends), HYPRE_MEMORY_HOST); + num_sends), HYPRE_MEMORY_HOST); index = 0; for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { - jrow = hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j); + jrow = hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j); int_buf_data[index++] = CF_marker[jrow]; } } @@ -688,23 +794,29 @@ hypre_BoomerAMGIndepRS( hypre_ParCSRMatrix *S, hypre_ParCSRCommHandleDestroy(comm_handle); } - measure_array = hypre_CTAlloc(HYPRE_Int, num_variables+num_cols_offd, HYPRE_MEMORY_HOST); - for (i=0; i < num_variables+num_cols_offd; i++) + measure_array = hypre_CTAlloc(HYPRE_Int, num_variables + num_cols_offd, HYPRE_MEMORY_HOST); + for (i = 0; i < num_variables + num_cols_offd; i++) + { measure_array[i] = 0; + } - for (i=0; i < num_variables; i++) + for (i = 0; i < num_variables; i++) { if (CF_marker[i] < 1) { - for (j = S_i[i]; j < S_i[i+1]; j++) + for (j = S_i[i]; j < S_i[i + 1]; j++) { if (CF_marker[S_j[j]] < 1) + { measure_array[S_j[j]]++; + } } - for (j = S_offd_i[i]; j < S_offd_i[i+1]; j++) + for (j = S_offd_i[i]; j < S_offd_i[i + 1]; j++) { if (CF_marker_offd[S_offd_j[j]] < 1) + { measure_array[num_variables + S_offd_j[j]]++; + } } } } @@ -716,16 +828,18 @@ hypre_BoomerAMGIndepRS( hypre_ParCSRMatrix *S, /* finish the communication */ if (num_procs > 1) + { hypre_ParCSRCommHandleDestroy(comm_handle); + } /* now add the externally calculated part of the local nodes to the local nodes */ index = 0; - for (i=0; i < num_sends; i++) + for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j=start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) - measure_array[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)] - += int_buf_data[index++]; + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) + measure_array[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)] + += int_buf_data[index++]; } hypre_TFree(int_buf_data, HYPRE_MEMORY_HOST); } @@ -737,7 +851,7 @@ hypre_BoomerAMGIndepRS( hypre_ParCSRMatrix *S, { if (CF_marker[i] == 0) { - if ((S_offd_i[i+1]-S_offd_i[i]) == 0) + if ((S_offd_i[i + 1] - S_offd_i[i]) == 0) { num_left++; } @@ -748,9 +862,13 @@ hypre_BoomerAMGIndepRS( hypre_ParCSRMatrix *S, } } else if (CF_marker[i] < 0) + { measure_array[i] = 0; + } else + { measure_array[i] = -1; + } } } else @@ -762,9 +880,13 @@ hypre_BoomerAMGIndepRS( hypre_ParCSRMatrix *S, num_left++; } else if (CF_marker[i] < 0) + { measure_array[i] = 0; + } else + { measure_array[i] = -1; + } } } @@ -772,7 +894,7 @@ hypre_BoomerAMGIndepRS( hypre_ParCSRMatrix *S, * Loop until all points are either fine or coarse. *---------------------------------------------------*/ - if (debug_flag == 3) wall_time = time_getWallclockSeconds(); + if (debug_flag == 3) { wall_time = time_getWallclockSeconds(); } /* first coarsening phase */ @@ -793,9 +915,9 @@ hypre_BoomerAMGIndepRS( hypre_ParCSRMatrix *S, } else { - if (measure < 0) hypre_printf("negative measure!\n"); + if (measure < 0) { hypre_printf("negative measure!\n"); } CF_marker[j] = f_pnt; - for (k = S_i[j]; k < S_i[j+1]; k++) + for (k = S_i[j]; k < S_i[j + 1]; k++) { nabor = S_j[k]; if (CF_marker[nabor] != SF_PT && CF_marker[nabor] < 1) @@ -853,7 +975,7 @@ hypre_BoomerAMGIndepRS( hypre_ParCSRMatrix *S, hypre_remove_point(&LoL_head, &LoL_tail, measure, index, lists, where); - for (j = ST_i[index]; j < ST_i[index+1]; j++) + for (j = ST_i[index]; j < ST_i[index + 1]; j++) { nabor = ST_j[j]; if (CF_marker[nabor] == UNDECIDED) @@ -864,7 +986,7 @@ hypre_BoomerAMGIndepRS( hypre_ParCSRMatrix *S, hypre_remove_point(&LoL_head, &LoL_tail, measure, nabor, lists, where); --num_left; - for (k = S_i[nabor]+1; k < S_i[nabor+1]; k++) + for (k = S_i[nabor] + 1; k < S_i[nabor + 1]; k++) { nabor_two = S_j[k]; if (CF_marker[nabor_two] == UNDECIDED) @@ -881,7 +1003,7 @@ hypre_BoomerAMGIndepRS( hypre_ParCSRMatrix *S, } } } - for (j = S_i[index]; j < S_i[index+1]; j++) + for (j = S_i[index]; j < S_i[index + 1]; j++) { nabor = S_j[j]; if (CF_marker[nabor] == UNDECIDED) @@ -900,7 +1022,7 @@ hypre_BoomerAMGIndepRS( hypre_ParCSRMatrix *S, CF_marker[nabor] = F_PT; --num_left; - for (k = S_i[nabor]+1; k < S_i[nabor+1]; k++) + for (k = S_i[nabor] + 1; k < S_i[nabor + 1]; k++) { nabor_two = S_j[k]; if (CF_marker[nabor_two] == UNDECIDED) @@ -932,8 +1054,8 @@ hypre_BoomerAMGIndepRS( hypre_ParCSRMatrix *S, if (measure_type == 2) { - for (i=0; i < num_variables; i++) - if (CF_marker[i] == 2) CF_marker[i] = 0; + for (i = 0; i < num_variables; i++) + if (CF_marker[i] == 2) { CF_marker[i] = 0; } } hypre_TFree(lists, HYPRE_MEMORY_HOST); @@ -955,16 +1077,16 @@ hypre_BoomerAMGIndepRSa( hypre_ParCSRMatrix *S, HYPRE_Int debug_flag, HYPRE_Int *CF_marker) { - MPI_Comm comm = hypre_ParCSRMatrixComm(S); - hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(S); - hypre_CSRMatrix *S_diag = hypre_ParCSRMatrixDiag(S); - hypre_CSRMatrix *S_offd = hypre_ParCSRMatrixOffd(S); - HYPRE_Int *S_i = hypre_CSRMatrixI(S_diag); - HYPRE_Int *S_j = hypre_CSRMatrixJ(S_diag); - HYPRE_Int *S_offd_i = hypre_CSRMatrixI(S_offd); - HYPRE_Int *S_offd_j; - HYPRE_Int num_variables = hypre_CSRMatrixNumRows(S_diag); - HYPRE_Int num_cols_offd = hypre_CSRMatrixNumCols(S_offd); + MPI_Comm comm = hypre_ParCSRMatrixComm(S); + hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(S); + hypre_CSRMatrix *S_diag = hypre_ParCSRMatrixDiag(S); + hypre_CSRMatrix *S_offd = hypre_ParCSRMatrixOffd(S); + HYPRE_Int *S_i = hypre_CSRMatrixI(S_diag); + HYPRE_Int *S_j = hypre_CSRMatrixJ(S_diag); + HYPRE_Int *S_offd_i = hypre_CSRMatrixI(S_offd); + HYPRE_Int *S_offd_j = NULL; + HYPRE_Int num_variables = hypre_CSRMatrixNumRows(S_diag); + HYPRE_Int num_cols_offd = hypre_CSRMatrixNumCols(S_offd); hypre_ParCSRCommHandle *comm_handle; hypre_CSRMatrix *ST; @@ -1021,10 +1143,10 @@ hypre_BoomerAMGIndepRSa( hypre_ParCSRMatrix *S, * to "unaccounted-for" dependence. *----------------------------------------------------------------*/ - if (debug_flag == 3) wall_time = time_getWallclockSeconds(); + if (debug_flag == 3) { wall_time = time_getWallclockSeconds(); } - hypre_MPI_Comm_size(comm,&num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); if (!comm_pkg) { @@ -1040,12 +1162,12 @@ hypre_BoomerAMGIndepRSa( hypre_ParCSRMatrix *S, num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - if (num_cols_offd) S_offd_j = hypre_CSRMatrixJ(S_offd); + if (num_cols_offd) { S_offd_j = hypre_CSRMatrixJ(S_offd); } jS = S_i[num_variables]; ST = hypre_CSRMatrixCreate(num_variables, num_variables, jS); - ST_i = hypre_CTAlloc(HYPRE_Int, num_variables+1, HYPRE_MEMORY_HOST); + ST_i = hypre_CTAlloc(HYPRE_Int, num_variables + 1, HYPRE_MEMORY_HOST); ST_j = hypre_CTAlloc(HYPRE_Int, jS, HYPRE_MEMORY_HOST); hypre_CSRMatrixI(ST) = ST_i; hypre_CSRMatrixJ(ST) = ST_j; @@ -1054,20 +1176,22 @@ hypre_BoomerAMGIndepRSa( hypre_ParCSRMatrix *S, * generate transpose of S, ST *----------------------------------------------------------*/ - for (i=0; i <= num_variables; i++) + for (i = 0; i <= num_variables; i++) + { ST_i[i] = 0; + } - for (i=0; i < jS; i++) + for (i = 0; i < jS; i++) { - ST_i[S_j[i]+1]++; + ST_i[S_j[i] + 1]++; } - for (i=0; i < num_variables; i++) + for (i = 0; i < num_variables; i++) { - ST_i[i+1] += ST_i[i]; + ST_i[i + 1] += ST_i[i]; } - for (i=0; i < num_variables; i++) + for (i = 0; i < num_variables; i++) { - for (j=S_i[i]; j < S_i[i+1]; j++) + for (j = S_i[i]; j < S_i[i + 1]; j++) { index = S_j[j]; ST_j[ST_i[index]] = i; @@ -1076,7 +1200,7 @@ hypre_BoomerAMGIndepRSa( hypre_ParCSRMatrix *S, } for (i = num_variables; i > 0; i--) { - ST_i[i] = ST_i[i-1]; + ST_i[i] = ST_i[i - 1]; } ST_i[0] = 0; @@ -1093,16 +1217,20 @@ hypre_BoomerAMGIndepRSa( hypre_ParCSRMatrix *S, if (measure_type == 0) { measure_array = hypre_CTAlloc(HYPRE_Int, num_variables, HYPRE_MEMORY_HOST); - for (i=0; i < num_variables; i++) + for (i = 0; i < num_variables; i++) + { measure_array[i] = 0; - for (i=0; i < num_variables; i++) + } + for (i = 0; i < num_variables; i++) { if (CF_marker[i] < 1) { - for (j = S_i[i]+1; j < S_i[i+1]; j++) + for (j = S_i[i] + 1; j < S_i[i + 1]; j++) { if (CF_marker[S_j[j]] < 1) + { measure_array[S_j[j]]++; + } } } } @@ -1113,12 +1241,18 @@ hypre_BoomerAMGIndepRSa( hypre_ParCSRMatrix *S, /* now the off-diagonal part of CF_marker */ if (num_cols_offd) + { CF_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_offd, HYPRE_MEMORY_HOST); + } else + { CF_marker_offd = NULL; + } - for (i=0; i < num_cols_offd; i++) + for (i = 0; i < num_cols_offd; i++) + { CF_marker_offd[i] = 0; + } /*------------------------------------------------ * Communicate the CF_marker values to the external nodes @@ -1129,9 +1263,9 @@ hypre_BoomerAMGIndepRSa( hypre_ParCSRMatrix *S, for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { - jrow = hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j); + jrow = hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j); int_buf_data[index++] = CF_marker[jrow]; } } @@ -1143,23 +1277,29 @@ hypre_BoomerAMGIndepRSa( hypre_ParCSRMatrix *S, hypre_ParCSRCommHandleDestroy(comm_handle); } - measure_array = hypre_CTAlloc(HYPRE_Int, num_variables+num_cols_offd, HYPRE_MEMORY_HOST); - for (i=0; i < num_variables+num_cols_offd; i++) + measure_array = hypre_CTAlloc(HYPRE_Int, num_variables + num_cols_offd, HYPRE_MEMORY_HOST); + for (i = 0; i < num_variables + num_cols_offd; i++) + { measure_array[i] = 0; + } - for (i=0; i < num_variables; i++) + for (i = 0; i < num_variables; i++) { if (CF_marker[i] < 1) { - for (j = S_i[i]+1; j < S_i[i+1]; j++) + for (j = S_i[i] + 1; j < S_i[i + 1]; j++) { if (CF_marker[S_j[j]] < 1) + { measure_array[S_j[j]]++; + } } - for (j = S_offd_i[i]; j < S_offd_i[i+1]; j++) + for (j = S_offd_i[i]; j < S_offd_i[i + 1]; j++) { if (CF_marker_offd[S_offd_j[j]] < 1) + { measure_array[num_variables + S_offd_j[j]]++; + } } } } @@ -1171,16 +1311,18 @@ hypre_BoomerAMGIndepRSa( hypre_ParCSRMatrix *S, /* finish the communication */ if (num_procs > 1) + { hypre_ParCSRCommHandleDestroy(comm_handle); + } /* now add the externally calculated part of the local nodes to the local nodes */ index = 0; - for (i=0; i < num_sends; i++) + for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j=start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) - measure_array[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)] - += int_buf_data[index++]; + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) + measure_array[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)] + += int_buf_data[index++]; } hypre_TFree(int_buf_data, HYPRE_MEMORY_HOST); } @@ -1192,7 +1334,7 @@ hypre_BoomerAMGIndepRSa( hypre_ParCSRMatrix *S, { if (CF_marker[i] == 0) { - if ((S_offd_i[i+1]-S_offd_i[i]) == 0) + if ((S_offd_i[i + 1] - S_offd_i[i]) == 0) { num_left++; } @@ -1203,9 +1345,13 @@ hypre_BoomerAMGIndepRSa( hypre_ParCSRMatrix *S, } } else if (CF_marker[i] < 0) + { measure_array[i] = 0; + } else + { measure_array[i] = -1; + } } } else @@ -1217,9 +1363,13 @@ hypre_BoomerAMGIndepRSa( hypre_ParCSRMatrix *S, num_left++; } else if (CF_marker[i] < 0) + { measure_array[i] = 0; + } else + { measure_array[i] = -1; + } } } @@ -1227,7 +1377,7 @@ hypre_BoomerAMGIndepRSa( hypre_ParCSRMatrix *S, * Loop until all points are either fine or coarse. *---------------------------------------------------*/ - if (debug_flag == 3) wall_time = time_getWallclockSeconds(); + if (debug_flag == 3) { wall_time = time_getWallclockSeconds(); } /* first coarsening phase */ @@ -1248,9 +1398,9 @@ hypre_BoomerAMGIndepRSa( hypre_ParCSRMatrix *S, } else { - if (measure < 0) hypre_printf("negative measure!\n"); + if (measure < 0) { hypre_printf("negative measure!\n"); } CF_marker[j] = f_pnt; - for (k = S_i[j]+1; k < S_i[j+1]; k++) + for (k = S_i[j] + 1; k < S_i[j + 1]; k++) { nabor = S_j[k]; if (CF_marker[nabor] != SF_PT && CF_marker[nabor] < 1) @@ -1308,7 +1458,7 @@ hypre_BoomerAMGIndepRSa( hypre_ParCSRMatrix *S, hypre_remove_point(&LoL_head, &LoL_tail, measure, index, lists, where); - for (j = ST_i[index]+1; j < ST_i[index+1]; j++) + for (j = ST_i[index] + 1; j < ST_i[index + 1]; j++) { nabor = ST_j[j]; if (CF_marker[nabor] == UNDECIDED) @@ -1319,7 +1469,7 @@ hypre_BoomerAMGIndepRSa( hypre_ParCSRMatrix *S, hypre_remove_point(&LoL_head, &LoL_tail, measure, nabor, lists, where); --num_left; - for (k = S_i[nabor]+1; k < S_i[nabor+1]; k++) + for (k = S_i[nabor] + 1; k < S_i[nabor + 1]; k++) { nabor_two = S_j[k]; if (CF_marker[nabor_two] == UNDECIDED) @@ -1336,7 +1486,7 @@ hypre_BoomerAMGIndepRSa( hypre_ParCSRMatrix *S, } } } - for (j = S_i[index]+1; j < S_i[index+1]; j++) + for (j = S_i[index] + 1; j < S_i[index + 1]; j++) { nabor = S_j[j]; if (CF_marker[nabor] == UNDECIDED) @@ -1355,7 +1505,7 @@ hypre_BoomerAMGIndepRSa( hypre_ParCSRMatrix *S, CF_marker[nabor] = F_PT; --num_left; - for (k = S_i[nabor]+1; k < S_i[nabor+1]; k++) + for (k = S_i[nabor] + 1; k < S_i[nabor + 1]; k++) { nabor_two = S_j[k]; if (CF_marker[nabor_two] == UNDECIDED) @@ -1387,8 +1537,8 @@ hypre_BoomerAMGIndepRSa( hypre_ParCSRMatrix *S, if (measure_type == 2) { - for (i=0; i < num_variables; i++) - if (CF_marker[i] == 2) CF_marker[i] = 0; + for (i = 0; i < num_variables; i++) + if (CF_marker[i] == 2) { CF_marker[i] = 0; } } hypre_TFree(lists, HYPRE_MEMORY_HOST); @@ -1402,48 +1552,54 @@ hypre_BoomerAMGIndepRSa( hypre_ParCSRMatrix *S, HYPRE_Int hypre_BoomerAMGIndepHMIS( hypre_ParCSRMatrix *S, - HYPRE_Int measure_type, - HYPRE_Int debug_flag, - HYPRE_Int *CF_marker) + HYPRE_Int measure_type, + HYPRE_Int debug_flag, + HYPRE_Int *CF_marker) { - HYPRE_Int num_procs; - MPI_Comm comm = hypre_ParCSRMatrixComm(S); + HYPRE_UNUSED_VAR(measure_type); + + HYPRE_Int num_procs; + MPI_Comm comm = hypre_ParCSRMatrixComm(S); + + hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_size(comm,&num_procs); /*------------------------------------------------------- * Perform Ruge coarsening followed by CLJP coarsening *-------------------------------------------------------*/ - hypre_BoomerAMGIndepRS (S, 2, debug_flag, - CF_marker); + hypre_BoomerAMGIndepRS(S, 2, debug_flag, CF_marker); if (num_procs > 1) - hypre_BoomerAMGIndepPMIS (S, 0, debug_flag, - CF_marker); + { + hypre_BoomerAMGIndepPMIS(S, 0, debug_flag, CF_marker); + } return hypre_error_flag; } HYPRE_Int hypre_BoomerAMGIndepHMISa( hypre_ParCSRMatrix *S, - HYPRE_Int measure_type, - HYPRE_Int debug_flag, - HYPRE_Int *CF_marker) + HYPRE_Int measure_type, + HYPRE_Int debug_flag, + HYPRE_Int *CF_marker) { - HYPRE_Int num_procs; - MPI_Comm comm = hypre_ParCSRMatrixComm(S); + HYPRE_UNUSED_VAR(measure_type); + + HYPRE_Int num_procs; + MPI_Comm comm = hypre_ParCSRMatrixComm(S); + + hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_size(comm,&num_procs); /*------------------------------------------------------- * Perform Ruge coarsening followed by CLJP coarsening *-------------------------------------------------------*/ - hypre_BoomerAMGIndepRSa (S, 2, debug_flag, - CF_marker); + hypre_BoomerAMGIndepRSa(S, 2, debug_flag, CF_marker); if (num_procs > 1) - hypre_BoomerAMGIndepPMISa (S, 0, debug_flag, - CF_marker); + { + hypre_BoomerAMGIndepPMISa(S, 0, debug_flag, CF_marker); + } return hypre_error_flag; } @@ -1470,20 +1626,20 @@ hypre_BoomerAMGIndepPMIS( hypre_ParCSRMatrix *S, HYPRE_Int debug_flag, HYPRE_Int *CF_marker) { - MPI_Comm comm = hypre_ParCSRMatrixComm(S); - hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(S); - hypre_ParCSRCommHandle *comm_handle; + MPI_Comm comm = hypre_ParCSRMatrixComm(S); + hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(S); + hypre_ParCSRCommHandle *comm_handle; - hypre_CSRMatrix *S_diag = hypre_ParCSRMatrixDiag(S); - HYPRE_Int *S_diag_i = hypre_CSRMatrixI(S_diag); - HYPRE_Int *S_diag_j = hypre_CSRMatrixJ(S_diag); + hypre_CSRMatrix *S_diag = hypre_ParCSRMatrixDiag(S); + HYPRE_Int *S_diag_i = hypre_CSRMatrixI(S_diag); + HYPRE_Int *S_diag_j = hypre_CSRMatrixJ(S_diag); - hypre_CSRMatrix *S_offd = hypre_ParCSRMatrixOffd(S); - HYPRE_Int *S_offd_i = hypre_CSRMatrixI(S_offd); - HYPRE_Int *S_offd_j; + hypre_CSRMatrix *S_offd = hypre_ParCSRMatrixOffd(S); + HYPRE_Int *S_offd_i = hypre_CSRMatrixI(S_offd); + HYPRE_Int *S_offd_j = NULL; - HYPRE_Int num_variables = hypre_CSRMatrixNumRows(S_diag); - HYPRE_Int num_cols_offd = 0; + HYPRE_Int num_variables = hypre_CSRMatrixNumRows(S_diag); + HYPRE_Int num_cols_offd = 0; HYPRE_Int num_sends = 0; HYPRE_Int *int_buf_data; @@ -1503,7 +1659,6 @@ hypre_BoomerAMGIndepPMIS( hypre_ParCSRMatrix *S, HYPRE_Real wall_time; - HYPRE_Int iter = 0; @@ -1536,9 +1691,9 @@ hypre_BoomerAMGIndepPMIS( hypre_ParCSRMatrix *S, *----------------------------------------------------------------*/ /*S_ext = NULL; */ - if (debug_flag == 3) wall_time = time_getWallclockSeconds(); - hypre_MPI_Comm_size(comm,&num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + if (debug_flag == 3) { wall_time = time_getWallclockSeconds(); } + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); if (!comm_pkg) { @@ -1554,9 +1709,9 @@ hypre_BoomerAMGIndepPMIS( hypre_ParCSRMatrix *S, num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, - num_sends), HYPRE_MEMORY_HOST); + num_sends), HYPRE_MEMORY_HOST); buf_data = hypre_CTAlloc(HYPRE_Real, hypre_ParCSRCommPkgSendMapStart(comm_pkg, - num_sends), HYPRE_MEMORY_HOST); + num_sends), HYPRE_MEMORY_HOST); num_cols_offd = hypre_CSRMatrixNumCols(S_offd); @@ -1569,12 +1724,18 @@ hypre_BoomerAMGIndepPMIS( hypre_ParCSRMatrix *S, /* now the off-diagonal part of CF_marker */ if (num_cols_offd) + { CF_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_offd, HYPRE_MEMORY_HOST); + } else + { CF_marker_offd = NULL; + } - for (i=0; i < num_cols_offd; i++) + for (i = 0; i < num_cols_offd; i++) + { CF_marker_offd[i] = 0; + } /*------------------------------------------------ * Communicate the CF_marker values to the external nodes @@ -1583,9 +1744,9 @@ hypre_BoomerAMGIndepPMIS( hypre_ParCSRMatrix *S, for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { - jrow = hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j); + jrow = hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j); int_buf_data[index++] = CF_marker[jrow]; } } @@ -1609,24 +1770,30 @@ hypre_BoomerAMGIndepPMIS( hypre_ParCSRMatrix *S, * between 0 and 1. *----------------------------------------------------------*/ - measure_array = hypre_CTAlloc(HYPRE_Real, num_variables+num_cols_offd, HYPRE_MEMORY_HOST); - for (i=0; i < num_variables+num_cols_offd; i++) + measure_array = hypre_CTAlloc(HYPRE_Real, num_variables + num_cols_offd, HYPRE_MEMORY_HOST); + for (i = 0; i < num_variables + num_cols_offd; i++) + { measure_array[i] = 0; + } /* calculate the local part for the local nodes */ - for (i=0; i < num_variables; i++) + for (i = 0; i < num_variables; i++) { if (CF_marker[i] < 1) { - for (j = S_diag_i[i]; j < S_diag_i[i+1]; j++) + for (j = S_diag_i[i]; j < S_diag_i[i + 1]; j++) { if (CF_marker[S_diag_j[j]] < 1) + { measure_array[S_diag_j[j]] += 1.0; + } } - for (j = S_offd_i[i]; j < S_offd_i[i+1]; j++) + for (j = S_offd_i[i]; j < S_offd_i[i + 1]; j++) { if (CF_marker_offd[S_offd_j[j]] < 1) + { measure_array[num_variables + S_offd_j[j]] += 1.0; + } } } } @@ -1638,20 +1805,22 @@ hypre_BoomerAMGIndepPMIS( hypre_ParCSRMatrix *S, /* finish the communication */ if (num_procs > 1) + { hypre_ParCSRCommHandleDestroy(comm_handle); + } /* now add the externally calculated part of the local nodes to the local nodes */ index = 0; - for (i=0; i < num_sends; i++) + for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j=start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) - measure_array[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)] - += buf_data[index++]; + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) + measure_array[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)] + += buf_data[index++]; } /* set the measures of the external nodes to zero */ - for (i=num_variables; i < num_variables+num_cols_offd; i++) + for (i = num_variables; i < num_variables + num_cols_offd; i++) { measure_array[i] = 0; } @@ -1659,7 +1828,7 @@ hypre_BoomerAMGIndepPMIS( hypre_ParCSRMatrix *S, /* this augments the measures with a random number between 0 and 1 */ /* (only for the local part) */ /* this augments the measures */ - i = 2747+my_id; + i = 2747 + my_id; hypre_SeedRand(i); for (i = 0; i < num_variables; i++) { @@ -1672,29 +1841,37 @@ hypre_BoomerAMGIndepPMIS( hypre_ParCSRMatrix *S, /* first the off-diagonal part of the graph array */ if (num_cols_offd) + { graph_array_offd = hypre_CTAlloc(HYPRE_Int, num_cols_offd, HYPRE_MEMORY_HOST); + } else + { graph_array_offd = NULL; + } for (ig = 0; ig < num_cols_offd; ig++) + { graph_array_offd[ig] = ig; + } graph_offd_size = num_cols_offd; /* now the local part of the graph array, and the local CF_marker array */ graph_array = hypre_CTAlloc(HYPRE_Int, num_variables, HYPRE_MEMORY_HOST); - if (CF_init==1) + if (CF_init == 1) { cnt = 0; - for (i=0; i < num_variables; i++) + for (i = 0; i < num_variables; i++) { - if ( (S_offd_i[i+1]-S_offd_i[i]) > 0 || CF_marker[i] == -1) + if ( (S_offd_i[i + 1] - S_offd_i[i]) > 0 || CF_marker[i] == -1) { CF_marker[i] = 0; } if (CF_marker[i] == SF_PT) + { measure_array[i] = 0; + } else if ( CF_marker[i] < 1) { if (measure_array[i] >= 1.0 ) @@ -1709,20 +1886,26 @@ hypre_BoomerAMGIndepPMIS( hypre_ParCSRMatrix *S, } } else + { measure_array[i] = 0; + } } } else { cnt = 0; - for (i=0; i < num_variables; i++) + for (i = 0; i < num_variables; i++) { if (CF_marker[i] == 0) { if ( measure_array[i] >= 1.0 ) + { graph_array[cnt++] = i; + } else + { CF_marker[i] = F_PT; + } } else { @@ -1740,9 +1923,9 @@ hypre_BoomerAMGIndepPMIS( hypre_ParCSRMatrix *S, for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { - jrow = hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j); + jrow = hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j); buf_data[index++] = measure_array[jrow]; } } @@ -1776,10 +1959,12 @@ hypre_BoomerAMGIndepPMIS( hypre_ParCSRMatrix *S, HYPRE_BigInt big_graph_size = (HYPRE_BigInt) graph_size; /* stop the coarsening if nothing left to be coarsened */ - hypre_MPI_Allreduce(&big_graph_size,&global_graph_size,1,HYPRE_MPI_BIG_INT,hypre_MPI_SUM,comm); + hypre_MPI_Allreduce(&big_graph_size, &global_graph_size, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); if (global_graph_size == 0) + { break; + } /* hypre_printf("\n"); hypre_printf("*** MIS iteration %d\n",iter); @@ -1801,13 +1986,17 @@ hypre_BoomerAMGIndepPMIS( hypre_ParCSRMatrix *S, { i = graph_array[ig]; if (measure_array[i] > 1) + { CF_marker[i] = 1; + } } for (ig = 0; ig < graph_offd_size; ig++) { i = graph_array_offd[ig]; - if (measure_array[i+num_variables] > 1) + if (measure_array[i + num_variables] > 1) + { CF_marker_offd[i] = 1; + } } /*------------------------------------------------------- * Remove nodes from the initial independent set @@ -1818,29 +2007,37 @@ hypre_BoomerAMGIndepPMIS( hypre_ParCSRMatrix *S, i = graph_array[ig]; if (measure_array[i] > 1) { - for (jS = S_diag_i[i]; jS < S_diag_i[i+1]; jS++) + for (jS = S_diag_i[i]; jS < S_diag_i[i + 1]; jS++) { j = S_diag_j[jS]; if (measure_array[j] > 1) { if (measure_array[i] > measure_array[j]) + { CF_marker[j] = 0; + } else if (measure_array[j] > measure_array[i]) + { CF_marker[i] = 0; + } } } - for (jS = S_offd_i[i]; jS < S_offd_i[i+1]; jS++) + for (jS = S_offd_i[i]; jS < S_offd_i[i + 1]; jS++) { jj = S_offd_j[jS]; - j = num_variables+jj; + j = num_variables + jj; if (measure_array[j] > 1) { if (measure_array[i] > measure_array[j]) + { CF_marker_offd[jj] = 0; + } else if (measure_array[j] > measure_array[i]) + { CF_marker[i] = 0; + } } } } @@ -1863,9 +2060,9 @@ hypre_BoomerAMGIndepPMIS( hypre_ParCSRMatrix *S, for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j=start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { - elmt = hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j); + elmt = hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j); if (!int_buf_data[index] && CF_marker[elmt] > 0) { CF_marker[elmt] = 0; @@ -1887,12 +2084,15 @@ hypre_BoomerAMGIndepPMIS( hypre_ParCSRMatrix *S, } } +#if 0 /* debugging */ iter++; +#endif /*------------------------------------------------ * Set C-pts and F-pts. *------------------------------------------------*/ - for (ig = 0; ig < graph_size; ig++) { + for (ig = 0; ig < graph_size; ig++) + { i = graph_array[ig]; /*--------------------------------------------- @@ -1928,17 +2128,21 @@ hypre_BoomerAMGIndepPMIS( hypre_ParCSRMatrix *S, { /* first the local part */ - for (jS = S_diag_i[i]; jS < S_diag_i[i+1]; jS++) { + for (jS = S_diag_i[i]; jS < S_diag_i[i + 1]; jS++) + { /* j is the column number, or the local number of the point influencing i */ j = S_diag_j[jS]; - if (CF_marker[j] > 0){ /* j is a C-point */ + if (CF_marker[j] > 0) /* j is a C-point */ + { CF_marker[i] = F_PT; } } /* now the external part */ - for (jS = S_offd_i[i]; jS < S_offd_i[i+1]; jS++) { + for (jS = S_offd_i[i]; jS < S_offd_i[i + 1]; jS++) + { j = S_offd_j[jS]; - if (CF_marker_offd[j] > 0){ /* j is a C-point */ + if (CF_marker_offd[j] > 0) /* j is a C-point */ + { CF_marker[i] = F_PT; } } @@ -1958,9 +2162,9 @@ hypre_BoomerAMGIndepPMIS( hypre_ParCSRMatrix *S, for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) int_buf_data[index++] - = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } if (num_procs > 1) @@ -1975,10 +2179,11 @@ hypre_BoomerAMGIndepPMIS( hypre_ParCSRMatrix *S, * Update subgraph *------------------------------------------------*/ - for (ig = 0; ig < graph_size; ig++) { + for (ig = 0; ig < graph_size; ig++) + { i = graph_array[ig]; - if (CF_marker[i]!=0) /* C or F point */ + if (CF_marker[i] != 0) /* C or F point */ { /* the independent set subroutine needs measure 0 for removed nodes */ @@ -1990,14 +2195,15 @@ hypre_BoomerAMGIndepPMIS( hypre_ParCSRMatrix *S, ig--; } } - for (ig = 0; ig < graph_offd_size; ig++) { + for (ig = 0; ig < graph_offd_size; ig++) + { i = graph_array_offd[ig]; - if (CF_marker_offd[i]!=0) /* C or F point */ + if (CF_marker_offd[i] != 0) /* C or F point */ { /* the independent set subroutine needs measure 0 for removed nodes */ - measure_array[i+num_variables] = 0; + measure_array[i + num_variables] = 0; /* take point out of the subgraph */ graph_offd_size--; graph_array_offd[ig] = graph_array_offd[graph_offd_size]; @@ -2025,7 +2231,7 @@ hypre_BoomerAMGIndepPMIS( hypre_ParCSRMatrix *S, hypre_TFree(measure_array, HYPRE_MEMORY_HOST); hypre_TFree(graph_array, HYPRE_MEMORY_HOST); - if (num_cols_offd) hypre_TFree(graph_array_offd, HYPRE_MEMORY_HOST); + if (num_cols_offd) { hypre_TFree(graph_array_offd, HYPRE_MEMORY_HOST); } hypre_TFree(buf_data, HYPRE_MEMORY_HOST); hypre_TFree(int_buf_data, HYPRE_MEMORY_HOST); hypre_TFree(CF_marker_offd, HYPRE_MEMORY_HOST); @@ -2038,20 +2244,20 @@ hypre_BoomerAMGIndepPMISa( hypre_ParCSRMatrix *S, HYPRE_Int debug_flag, HYPRE_Int *CF_marker) { - MPI_Comm comm = hypre_ParCSRMatrixComm(S); - hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(S); - hypre_ParCSRCommHandle *comm_handle; + MPI_Comm comm = hypre_ParCSRMatrixComm(S); + hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(S); + hypre_ParCSRCommHandle *comm_handle; - hypre_CSRMatrix *S_diag = hypre_ParCSRMatrixDiag(S); - HYPRE_Int *S_diag_i = hypre_CSRMatrixI(S_diag); - HYPRE_Int *S_diag_j = hypre_CSRMatrixJ(S_diag); + hypre_CSRMatrix *S_diag = hypre_ParCSRMatrixDiag(S); + HYPRE_Int *S_diag_i = hypre_CSRMatrixI(S_diag); + HYPRE_Int *S_diag_j = hypre_CSRMatrixJ(S_diag); - hypre_CSRMatrix *S_offd = hypre_ParCSRMatrixOffd(S); - HYPRE_Int *S_offd_i = hypre_CSRMatrixI(S_offd); - HYPRE_Int *S_offd_j; + hypre_CSRMatrix *S_offd = hypre_ParCSRMatrixOffd(S); + HYPRE_Int *S_offd_i = hypre_CSRMatrixI(S_offd); + HYPRE_Int *S_offd_j = NULL; - HYPRE_Int num_variables = hypre_CSRMatrixNumRows(S_diag); - HYPRE_Int num_cols_offd = 0; + HYPRE_Int num_variables = hypre_CSRMatrixNumRows(S_diag); + HYPRE_Int num_cols_offd = 0; HYPRE_Int num_sends = 0; HYPRE_Int *int_buf_data; @@ -2071,7 +2277,6 @@ hypre_BoomerAMGIndepPMISa( hypre_ParCSRMatrix *S, HYPRE_Real wall_time; - HYPRE_Int iter = 0; @@ -2104,9 +2309,9 @@ hypre_BoomerAMGIndepPMISa( hypre_ParCSRMatrix *S, *----------------------------------------------------------------*/ /*S_ext = NULL; */ - if (debug_flag == 3) wall_time = time_getWallclockSeconds(); - hypre_MPI_Comm_size(comm,&num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + if (debug_flag == 3) { wall_time = time_getWallclockSeconds(); } + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); if (!comm_pkg) { @@ -2123,9 +2328,9 @@ hypre_BoomerAMGIndepPMISa( hypre_ParCSRMatrix *S, num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, - num_sends), HYPRE_MEMORY_HOST); + num_sends), HYPRE_MEMORY_HOST); buf_data = hypre_CTAlloc(HYPRE_Real, hypre_ParCSRCommPkgSendMapStart(comm_pkg, - num_sends), HYPRE_MEMORY_HOST); + num_sends), HYPRE_MEMORY_HOST); num_cols_offd = hypre_CSRMatrixNumCols(S_offd); @@ -2138,12 +2343,18 @@ hypre_BoomerAMGIndepPMISa( hypre_ParCSRMatrix *S, /* now the off-diagonal part of CF_marker */ if (num_cols_offd) + { CF_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_offd, HYPRE_MEMORY_HOST); + } else + { CF_marker_offd = NULL; + } - for (i=0; i < num_cols_offd; i++) + for (i = 0; i < num_cols_offd; i++) + { CF_marker_offd[i] = 0; + } /*------------------------------------------------ * Communicate the CF_marker values to the external nodes @@ -2152,9 +2363,9 @@ hypre_BoomerAMGIndepPMISa( hypre_ParCSRMatrix *S, for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { - jrow = hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j); + jrow = hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j); int_buf_data[index++] = CF_marker[jrow]; } } @@ -2178,24 +2389,30 @@ hypre_BoomerAMGIndepPMISa( hypre_ParCSRMatrix *S, * between 0 and 1. *----------------------------------------------------------*/ - measure_array = hypre_CTAlloc(HYPRE_Real, num_variables+num_cols_offd, HYPRE_MEMORY_HOST); - for (i=0; i < num_variables+num_cols_offd; i++) + measure_array = hypre_CTAlloc(HYPRE_Real, num_variables + num_cols_offd, HYPRE_MEMORY_HOST); + for (i = 0; i < num_variables + num_cols_offd; i++) + { measure_array[i] = 0; + } /* calculate the local part for the local nodes */ - for (i=0; i < num_variables; i++) + for (i = 0; i < num_variables; i++) { if (CF_marker[i] < 1) { - for (j = S_diag_i[i]+1; j < S_diag_i[i+1]; j++) + for (j = S_diag_i[i] + 1; j < S_diag_i[i + 1]; j++) { if (CF_marker[S_diag_j[j]] < 1) + { measure_array[S_diag_j[j]] += 1.0; + } } - for (j = S_offd_i[i]; j < S_offd_i[i+1]; j++) + for (j = S_offd_i[i]; j < S_offd_i[i + 1]; j++) { if (CF_marker_offd[S_offd_j[j]] < 1) + { measure_array[num_variables + S_offd_j[j]] += 1.0; + } } } } @@ -2207,20 +2424,22 @@ hypre_BoomerAMGIndepPMISa( hypre_ParCSRMatrix *S, /* finish the communication */ if (num_procs > 1) + { hypre_ParCSRCommHandleDestroy(comm_handle); + } /* now add the externally calculated part of the local nodes to the local nodes */ index = 0; - for (i=0; i < num_sends; i++) + for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j=start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) - measure_array[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)] - += buf_data[index++]; + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) + measure_array[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)] + += buf_data[index++]; } /* set the measures of the external nodes to zero */ - for (i=num_variables; i < num_variables+num_cols_offd; i++) + for (i = num_variables; i < num_variables + num_cols_offd; i++) { measure_array[i] = 0; } @@ -2228,7 +2447,7 @@ hypre_BoomerAMGIndepPMISa( hypre_ParCSRMatrix *S, /* this augments the measures with a random number between 0 and 1 */ /* (only for the local part) */ /* this augments the measures */ - i = 2747+my_id; + i = 2747 + my_id; hypre_SeedRand(i); for (i = 0; i < num_variables; i++) { @@ -2241,29 +2460,37 @@ hypre_BoomerAMGIndepPMISa( hypre_ParCSRMatrix *S, /* first the off-diagonal part of the graph array */ if (num_cols_offd) + { graph_array_offd = hypre_CTAlloc(HYPRE_Int, num_cols_offd, HYPRE_MEMORY_HOST); + } else + { graph_array_offd = NULL; + } for (ig = 0; ig < num_cols_offd; ig++) + { graph_array_offd[ig] = ig; + } graph_offd_size = num_cols_offd; /* now the local part of the graph array, and the local CF_marker array */ graph_array = hypre_CTAlloc(HYPRE_Int, num_variables, HYPRE_MEMORY_HOST); - if (CF_init==1) + if (CF_init == 1) { cnt = 0; - for (i=0; i < num_variables; i++) + for (i = 0; i < num_variables; i++) { - if ( (S_offd_i[i+1]-S_offd_i[i]) > 0 || CF_marker[i] == -1) + if ( (S_offd_i[i + 1] - S_offd_i[i]) > 0 || CF_marker[i] == -1) { CF_marker[i] = 0; } if (CF_marker[i] == SF_PT) + { measure_array[i] = 0; + } else if ( CF_marker[i] < 1) { if (measure_array[i] >= 1.0 ) @@ -2278,20 +2505,24 @@ hypre_BoomerAMGIndepPMISa( hypre_ParCSRMatrix *S, } } else + { measure_array[i] = 0; + } } } else { cnt = 0; - for (i=0; i < num_variables; i++) + for (i = 0; i < num_variables; i++) { if (CF_marker[i] == 0 && measure_array[i] >= 1.0 ) { graph_array[cnt++] = i; } else + { measure_array[i] = 0; + } } } graph_size = cnt; @@ -2304,9 +2535,9 @@ hypre_BoomerAMGIndepPMISa( hypre_ParCSRMatrix *S, for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { - jrow = hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j); + jrow = hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j); buf_data[index++] = measure_array[jrow]; } } @@ -2340,10 +2571,12 @@ hypre_BoomerAMGIndepPMISa( hypre_ParCSRMatrix *S, HYPRE_BigInt big_graph_size = (HYPRE_BigInt) graph_size; /* stop the coarsening if nothing left to be coarsened */ - hypre_MPI_Allreduce(&big_graph_size,&global_graph_size,1,HYPRE_MPI_INT,hypre_MPI_SUM,comm); + hypre_MPI_Allreduce(&big_graph_size, &global_graph_size, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); if (global_graph_size == 0) + { break; + } /* hypre_printf("\n"); hypre_printf("*** MIS iteration %d\n",iter); @@ -2365,13 +2598,17 @@ hypre_BoomerAMGIndepPMISa( hypre_ParCSRMatrix *S, { i = graph_array[ig]; if (measure_array[i] > 1) + { CF_marker[i] = 1; + } } for (ig = 0; ig < graph_offd_size; ig++) { i = graph_array_offd[ig]; - if (measure_array[i+num_variables] > 1) + if (measure_array[i + num_variables] > 1) + { CF_marker_offd[i] = 1; + } } /*------------------------------------------------------- * Remove nodes from the initial independent set @@ -2382,29 +2619,37 @@ hypre_BoomerAMGIndepPMISa( hypre_ParCSRMatrix *S, i = graph_array[ig]; if (measure_array[i] > 1) { - for (jS = S_diag_i[i]+1; jS < S_diag_i[i+1]; jS++) + for (jS = S_diag_i[i] + 1; jS < S_diag_i[i + 1]; jS++) { j = S_diag_j[jS]; if (measure_array[j] > 1) { if (measure_array[i] > measure_array[j]) + { CF_marker[j] = 0; + } else if (measure_array[j] > measure_array[i]) + { CF_marker[i] = 0; + } } } - for (jS = S_offd_i[i]; jS < S_offd_i[i+1]; jS++) + for (jS = S_offd_i[i]; jS < S_offd_i[i + 1]; jS++) { jj = S_offd_j[jS]; - j = num_variables+jj; + j = num_variables + jj; if (measure_array[j] > 1) { if (measure_array[i] > measure_array[j]) + { CF_marker_offd[jj] = 0; + } else if (measure_array[j] > measure_array[i]) + { CF_marker[i] = 0; + } } } } @@ -2427,9 +2672,9 @@ hypre_BoomerAMGIndepPMISa( hypre_ParCSRMatrix *S, for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j=start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { - elmt = hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j); + elmt = hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j); if (!int_buf_data[index] && CF_marker[elmt] > 0) { CF_marker[elmt] = 0; @@ -2451,12 +2696,15 @@ hypre_BoomerAMGIndepPMISa( hypre_ParCSRMatrix *S, } } +#if 0 /* debugging */ iter++; +#endif /*------------------------------------------------ * Set C-pts and F-pts. *------------------------------------------------*/ - for (ig = 0; ig < graph_size; ig++) { + for (ig = 0; ig < graph_size; ig++) + { i = graph_array[ig]; /*--------------------------------------------- @@ -2481,17 +2729,21 @@ hypre_BoomerAMGIndepPMISa( hypre_ParCSRMatrix *S, { /* first the local part */ - for (jS = S_diag_i[i]+1; jS < S_diag_i[i+1]; jS++) { + for (jS = S_diag_i[i] + 1; jS < S_diag_i[i + 1]; jS++) + { /* j is the column number, or the local number of the point influencing i */ j = S_diag_j[jS]; - if (CF_marker[j] > 0){ /* j is a C-point */ + if (CF_marker[j] > 0) /* j is a C-point */ + { CF_marker[i] = F_PT; } } /* now the external part */ - for (jS = S_offd_i[i]; jS < S_offd_i[i+1]; jS++) { + for (jS = S_offd_i[i]; jS < S_offd_i[i + 1]; jS++) + { j = S_offd_j[jS]; - if (CF_marker_offd[j] > 0){ /* j is a C-point */ + if (CF_marker_offd[j] > 0) /* j is a C-point */ + { CF_marker[i] = F_PT; } } @@ -2511,9 +2763,9 @@ hypre_BoomerAMGIndepPMISa( hypre_ParCSRMatrix *S, for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) int_buf_data[index++] - = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } if (num_procs > 1) @@ -2528,10 +2780,11 @@ hypre_BoomerAMGIndepPMISa( hypre_ParCSRMatrix *S, * Update subgraph *------------------------------------------------*/ - for (ig = 0; ig < graph_size; ig++) { + for (ig = 0; ig < graph_size; ig++) + { i = graph_array[ig]; - if (CF_marker[i]!=0) /* C or F point */ + if (CF_marker[i] != 0) /* C or F point */ { /* the independent set subroutine needs measure 0 for removed nodes */ @@ -2543,14 +2796,15 @@ hypre_BoomerAMGIndepPMISa( hypre_ParCSRMatrix *S, ig--; } } - for (ig = 0; ig < graph_offd_size; ig++) { + for (ig = 0; ig < graph_offd_size; ig++) + { i = graph_array_offd[ig]; - if (CF_marker_offd[i]!=0) /* C or F point */ + if (CF_marker_offd[i] != 0) /* C or F point */ { /* the independent set subroutine needs measure 0 for removed nodes */ - measure_array[i+num_variables] = 0; + measure_array[i + num_variables] = 0; /* take point out of the subgraph */ graph_offd_size--; graph_array_offd[ig] = graph_array_offd[graph_offd_size]; @@ -2578,7 +2832,7 @@ hypre_BoomerAMGIndepPMISa( hypre_ParCSRMatrix *S, hypre_TFree(measure_array, HYPRE_MEMORY_HOST); hypre_TFree(graph_array, HYPRE_MEMORY_HOST); - if (num_cols_offd) hypre_TFree(graph_array_offd, HYPRE_MEMORY_HOST); + if (num_cols_offd) { hypre_TFree(graph_array_offd, HYPRE_MEMORY_HOST); } hypre_TFree(buf_data, HYPRE_MEMORY_HOST); hypre_TFree(int_buf_data, HYPRE_MEMORY_HOST); hypre_TFree(CF_marker_offd, HYPRE_MEMORY_HOST); @@ -2628,27 +2882,27 @@ hypre_BoomerAMGCoarsenCR( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker; /*HYPRE_Int *CFN_marker;*/ HYPRE_BigInt coarse_size; - HYPRE_Int i,j, jj, j2, nstages=0; + HYPRE_Int i, j, jj, j2, nstages = 0; HYPRE_Int num_procs, my_id, num_threads; - HYPRE_Int num_nodes = num_variables/num_functions; + HYPRE_Int num_nodes = num_variables / num_functions; HYPRE_Real rho = 1.0; HYPRE_Real gamma = 0.0; - HYPRE_Real rho0,rho1,*e0,*e1, *sum = NULL; + HYPRE_Real rho0, rho1, *e0, *e1, *sum = NULL; HYPRE_Real rho_old, relrho; HYPRE_Real *e2; HYPRE_Real alpha, beta, gammaold; HYPRE_Int num_coarse; HYPRE_BigInt global_num_variables, global_nc = 0; - HYPRE_Real candmeas=0.0e0, local_max=0.0e0, global_max = 0; + HYPRE_Real candmeas = 0.0e0, local_max = 0.0e0, global_max = 0; /*HYPRE_Real thresh=1-rho;*/ - HYPRE_Real thresh=0.5; + HYPRE_Real thresh = 0.5; hypre_ParVector *Relax_temp = NULL; - hypre_MPI_Comm_size(comm,&num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); num_threads = hypre_NumThreads(); @@ -2656,13 +2910,13 @@ hypre_BoomerAMGCoarsenCR( hypre_ParCSRMatrix *A, global_num_variables = hypre_ParCSRMatrixGlobalNumRows(A); /*if(CRaddCpoints == 0) {*/ - if(num_functions == 1) + if (num_functions == 1) { *CF_marker_ptr = hypre_IntArrayCreate(num_variables); } else { - num_nodes = num_variables/num_functions; + num_nodes = num_variables / num_functions; sum = hypre_CTAlloc(HYPRE_Real, num_nodes, HYPRE_MEMORY_HOST); *CF_marker_ptr = hypre_IntArrayCreate(num_nodes); } @@ -2685,37 +2939,37 @@ hypre_BoomerAMGCoarsenCR( hypre_ParCSRMatrix *A, /* Run the CR routine */ - if (my_id == 0) hypre_fprintf(stdout,"\n... Building CF using CR ...\n\n"); + if (my_id == 0) { hypre_fprintf(stdout, "\n... Building CF using CR ...\n\n"); } /*cr(A_i, A_j, A_data, num_variables, CF_marker, RelaxScheme1, omega1, theta_global1,mu1);*/ -/* main cr routine */ -/*HYPRE_Int cr(HYPRE_Int *A_i, HYPRE_Int *A_j, HYPRE_Real *A_data, HYPRE_Int n, HYPRE_Int *cf, - HYPRE_Int rlx, HYPRE_Real omega, HYPRE_Real tg, HYPRE_Int mu)*/ + /* main cr routine */ + /*HYPRE_Int cr(HYPRE_Int *A_i, HYPRE_Int *A_j, HYPRE_Real *A_data, HYPRE_Int n, HYPRE_Int *cf, + HYPRE_Int rlx, HYPRE_Real omega, HYPRE_Real tg, HYPRE_Int mu)*/ - e0_vec = hypre_ParVectorCreate(comm,global_num_rows,row_starts); + e0_vec = hypre_ParVectorCreate(comm, global_num_rows, row_starts); hypre_ParVectorInitialize(e0_vec); - e1_vec = hypre_ParVectorCreate(comm,global_num_rows,row_starts); + e1_vec = hypre_ParVectorCreate(comm, global_num_rows, row_starts); hypre_ParVectorInitialize(e1_vec); - e2_vec = hypre_ParVectorCreate(comm,global_num_rows,row_starts); + e2_vec = hypre_ParVectorCreate(comm, global_num_rows, row_starts); hypre_ParVectorInitialize(e2_vec); - Vtemp = hypre_ParVectorCreate(comm,global_num_rows,row_starts); + Vtemp = hypre_ParVectorCreate(comm, global_num_rows, row_starts); hypre_ParVectorInitialize(Vtemp); Vtemp_data = hypre_VectorData(hypre_ParVectorLocalVector(Vtemp)); - Ptemp = hypre_ParVectorCreate(comm,global_num_rows,row_starts); + Ptemp = hypre_ParVectorCreate(comm, global_num_rows, row_starts); hypre_ParVectorInitialize(Ptemp); Ptemp_data = hypre_VectorData(hypre_ParVectorLocalVector(Ptemp)); - Qtemp = hypre_ParVectorCreate(comm,global_num_rows,row_starts); + Qtemp = hypre_ParVectorCreate(comm, global_num_rows, row_starts); hypre_ParVectorInitialize(Qtemp); - Ztemp = hypre_ParVectorCreate(comm,global_num_rows,row_starts); + Ztemp = hypre_ParVectorCreate(comm, global_num_rows, row_starts); hypre_ParVectorInitialize(Ztemp); Ztemp_data = hypre_VectorData(hypre_ParVectorLocalVector(Ztemp)); - Rtemp = hypre_ParVectorCreate(comm,global_num_rows,row_starts); + Rtemp = hypre_ParVectorCreate(comm, global_num_rows, row_starts); hypre_ParVectorInitialize(Rtemp); if (num_threads > 1) { - Relax_temp = hypre_ParVectorCreate(comm,global_num_rows,row_starts); + Relax_temp = hypre_ParVectorCreate(comm, global_num_rows, row_starts); hypre_ParVectorInitialize(Relax_temp); } @@ -2725,25 +2979,27 @@ hypre_BoomerAMGCoarsenCR( hypre_ParCSRMatrix *A, if (my_id == 0) { - hypre_fprintf(stdout,"Stage \t rho \t alpha \n"); - hypre_fprintf(stdout,"-----------------------\n"); + hypre_fprintf(stdout, "Stage \t rho \t alpha \n"); + hypre_fprintf(stdout, "-----------------------\n"); } for (i = 0; i < num_variables; i++) + { e1[i] = 1.0e0; + } /*e1[i] = 1.0e0+.1*hypre_RandI();*/ /* stages */ - while(1) + while (1) { if (nstages > 0) { if (num_functions == 1) { - for (i=0;i= 0.1*theta && (i < num_CR_relax_steps || relrho >= 0.1)) + while (rho >= 0.1 * theta && (i < num_CR_relax_steps || relrho >= 0.1)) /*for (i=0;i theta) { if (useCG) { - for (i=0;i 1.e-2 && i < num_CR_relax_steps) + i = 0; + while (rho1 / rho0 > 1.e-2 && i < num_CR_relax_steps) { - if (i==0) - hypre_ParCSRMatrixMatvec_FF(-1.0,A,e0_vec,0.0,Rtemp,CF_marker,fpt); + if (i == 0) + { + hypre_ParCSRMatrixMatvec_FF(-1.0, A, e0_vec, 0.0, Rtemp, CF_marker, fpt); + } /*hypre_BoomerAMGRelax(A, Rtemp, CF_marker, rlx_type, fpt, relax_weight, omega, NULL, Ztemp, Vtemp);*/ - HYPRE_ParCSRDiagScale(NULL,(HYPRE_ParCSRMatrix) A, (HYPRE_ParVector) Rtemp, + HYPRE_ParCSRDiagScale(NULL, (HYPRE_ParCSRMatrix) A, (HYPRE_ParVector) Rtemp, (HYPRE_ParVector) Ztemp); gammaold = gamma; - gamma = hypre_ParVectorInnerProd(Rtemp,Ztemp); - if (i==0) + gamma = hypre_ParVectorInnerProd(Rtemp, Ztemp); + if (i == 0) { - hypre_ParVectorCopy(Ztemp,Ptemp); + hypre_ParVectorCopy(Ztemp, Ptemp); beta = 1.0; } else { - beta = gamma/gammaold; - for (j=0; j < num_variables; j++) + beta = gamma / gammaold; + for (j = 0; j < num_variables; j++) if (CF_marker[j] == fpt) - Ptemp_data[j] = Ztemp_data[j]+beta*Ptemp_data[j]; + { + Ptemp_data[j] = Ztemp_data[j] + beta * Ptemp_data[j]; + } } - hypre_ParCSRMatrixMatvec_FF(1.0,A,Ptemp,0.0,Qtemp,CF_marker,fpt); - alpha = gamma/hypre_ParVectorInnerProd(Ptemp,Qtemp); - hypre_ParVectorAxpy(-alpha,Qtemp,Rtemp); - for (j=0; j < num_variables; j++) - if (CF_marker[j] == fpt) e0[j] = e1[j]; - hypre_ParVectorAxpy(-alpha,Ptemp,e1_vec); - rho1 = hypre_ParVectorInnerProd(e1_vec,e1_vec); + hypre_ParCSRMatrixMatvec_FF(1.0, A, Ptemp, 0.0, Qtemp, CF_marker, fpt); + alpha = gamma / hypre_ParVectorInnerProd(Ptemp, Qtemp); + hypre_ParVectorAxpy(-alpha, Qtemp, Rtemp); + for (j = 0; j < num_variables; j++) + if (CF_marker[j] == fpt) { e0[j] = e1[j]; } + hypre_ParVectorAxpy(-alpha, Ptemp, e1_vec); + rho1 = hypre_ParVectorInnerProd(e1_vec, e1_vec); i++; } } /*formu(CF_marker,num_variables,e1,A_i,rho);*/ if (nstages) - thresh=0.5; + { + thresh = 0.5; + } else + { thresh = 0.3; - for (i=1; i < num_CR_relax_steps; i++) + } + for (i = 1; i < num_CR_relax_steps; i++) + { thresh *= 0.3; + } /*thresh=0.1;*/ if (num_functions == 1) /*if(CRaddCpoints == 0)*/ { local_max = 0.0; - for(i=0;i local_max) - local_max = fabs(e1[i]); + for (i = 0; i < num_variables; i++) + if (hypre_abs(e1[i]) > local_max) + { + local_max = hypre_abs(e1[i]); + } } else { jj = 0; local_max = 0.0; - for(i=0;i local_max) + if (sum[i] > local_max) + { local_max = sum[i]; + } } } - hypre_MPI_Allreduce(&local_max,&global_max,1,HYPRE_MPI_REAL,hypre_MPI_MAX,comm); + hypre_MPI_Allreduce(&local_max, &global_max, 1, HYPRE_MPI_REAL, hypre_MPI_MAX, comm); if (num_functions == 1) /*if(CRaddCpoints == 0)*/ { - for (i=0;i thresh && - (A_i[i+1]-A_i[i]+A_offd_i[i+1]-A_offd_i[i]) > 1) + (A_i[i + 1] - A_i[i] + A_offd_i[i + 1] - A_offd_i[i]) > 1) { CF_marker[i] = cand; } } } if (IS_type == 1) - hypre_BoomerAMGIndepHMIS(S,0,0,CF_marker); + { + hypre_BoomerAMGIndepHMIS(S, 0, 0, CF_marker); + } else if (IS_type == 7) - hypre_BoomerAMGIndepHMISa(A,0,0,CF_marker); + { + hypre_BoomerAMGIndepHMISa(A, 0, 0, CF_marker); + } else if (IS_type == 2) - hypre_BoomerAMGIndepPMISa(A,0,0,CF_marker); + { + hypre_BoomerAMGIndepPMISa(A, 0, 0, CF_marker); + } else if (IS_type == 5) - hypre_BoomerAMGIndepPMIS(S,0,0,CF_marker); + { + hypre_BoomerAMGIndepPMIS(S, 0, 0, CF_marker); + } else if (IS_type == 3) - hypre_IndepSetGreedy(A_i,A_j,num_variables,CF_marker); + { + hypre_IndepSetGreedy(A_i, A_j, num_variables, CF_marker); + } else if (IS_type == 6) - hypre_IndepSetGreedyS(S_i,S_j,num_variables,CF_marker); + { + hypre_IndepSetGreedyS(S_i, S_j, num_variables, CF_marker); + } else if (IS_type == 4) - hypre_BoomerAMGIndepRS(S,1,0,CF_marker); + { + hypre_BoomerAMGIndepRS(S, 1, 0, CF_marker); + } else - hypre_BoomerAMGIndepRSa(A,1,0,CF_marker); + { + hypre_BoomerAMGIndepRSa(A, 1, 0, CF_marker); + } } else { AN_i = hypre_CSRMatrixI(hypre_ParCSRMatrixDiag(AN)); AN_offd_i = hypre_CSRMatrixI(hypre_ParCSRMatrixOffd(AN)); - for (i=0;i thresh && - (AN_i[i+1]-AN_i[i]+AN_offd_i[i+1]-AN_offd_i[i]) > 1) + (AN_i[i + 1] - AN_i[i] + AN_offd_i[i + 1] - AN_offd_i[i]) > 1) { /*CFN_marker[i] = cand; */ CF_marker[i] = cand; @@ -2977,45 +3263,53 @@ hypre_BoomerAMGCoarsenCR( hypre_ParCSRMatrix *A, } } if (IS_type == 1) - hypre_BoomerAMGIndepHMIS(AN,0,0,CF_marker); + { + hypre_BoomerAMGIndepHMIS(AN, 0, 0, CF_marker); + } /*hypre_BoomerAMGIndepHMIS(AN,0,0,CFN_marker);*/ else if (IS_type == 2) - hypre_BoomerAMGIndepPMIS(AN,0,0,CF_marker); + { + hypre_BoomerAMGIndepPMIS(AN, 0, 0, CF_marker); + } /*hypre_BoomerAMGIndepPMIS(AN,0,0,CFN_marker);*/ else if (IS_type == 3) { hypre_IndepSetGreedy(hypre_CSRMatrixI(hypre_ParCSRMatrixDiag(AN)), hypre_CSRMatrixJ(hypre_ParCSRMatrixDiag(AN)), - num_nodes,CF_marker); + num_nodes, CF_marker); /*num_nodes,CFN_marker);*/ } else - hypre_BoomerAMGIndepRS(AN,1,0,CF_marker); + { + hypre_BoomerAMGIndepRS(AN, 1, 0, CF_marker); + } /*hypre_BoomerAMGIndepRS(AN,1,0,CFN_marker);*/ } - if (my_id == 0) hypre_fprintf(stdout," %d \t%2.3f \t%2.3f \n", - nstages,rho,(HYPRE_Real)global_nc/(HYPRE_Real)global_num_variables); + if (my_id == 0) hypre_fprintf(stdout, " %d \t%2.3f \t%2.3f \n", + nstages, rho, (HYPRE_Real)global_nc / (HYPRE_Real)global_num_variables); /* update for next sweep */ num_coarse = 0; if (num_functions == 1) /*if(CRaddCpoints == 0)*/ { - for (i=0;i 1) + { hypre_ParVectorDestroy(Relax_temp); + } - if (my_id == 0) hypre_fprintf(stdout,"\n... Done \n\n"); + if (my_id == 0) { hypre_fprintf(stdout, "\n... Done \n\n"); } coarse_size = 0; - for ( i =0 ;i < num_variables;i++){ - if ( CF_marker[i] == cpt){ + for ( i = 0 ; i < num_variables; i++) + { + if ( CF_marker[i] == cpt) + { coarse_size++; } } diff --git a/external/hypre/src/parcsr_ls/par_cycle.c b/external/hypre/src/parcsr_ls/par_cycle.c index 1d2f7a25..ee4b1147 100644 --- a/external/hypre/src/parcsr_ls/par_cycle.c +++ b/external/hypre/src/parcsr_ls/par_cycle.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -32,7 +32,7 @@ hypre_BoomerAMGCycle( void *amg_vdata, hypre_ParCSRMatrix **A_array; hypre_ParCSRMatrix **P_array; hypre_ParCSRMatrix **R_array; - hypre_ParVector *Utemp; + hypre_ParVector *Utemp = NULL; hypre_ParVector *Vtemp; hypre_ParVector *Rtemp; hypre_ParVector *Ptemp; @@ -43,8 +43,8 @@ hypre_BoomerAMGCycle( void *amg_vdata, hypre_ParCSRBlockMatrix **P_block_array; hypre_ParCSRBlockMatrix **R_block_array; - HYPRE_Real *Ztemp_data; - HYPRE_Real *Ptemp_data; + HYPRE_Real *Ztemp_data = NULL; + HYPRE_Real *Ptemp_data = NULL; hypre_IntArray **CF_marker_array; HYPRE_Int *CF_marker; /* @@ -77,7 +77,7 @@ hypre_BoomerAMGCycle( void *amg_vdata, HYPRE_Int num_sweep; HYPRE_Int cg_num_sweep = 1; HYPRE_Int relax_type; - HYPRE_Int relax_points; + HYPRE_Int relax_points = 0; HYPRE_Int relax_order; HYPRE_Int relax_local; HYPRE_Int old_version = 0; @@ -85,7 +85,7 @@ hypre_BoomerAMGCycle( void *amg_vdata, HYPRE_Real *omega; HYPRE_Real alfa, beta, gammaold; HYPRE_Real gamma = 1.0; - HYPRE_Int local_size; + HYPRE_Int local_size = 0; /* HYPRE_Int *smooth_option; */ HYPRE_Int smooth_type; HYPRE_Int smooth_num_levels; @@ -101,12 +101,15 @@ hypre_BoomerAMGCycle( void *amg_vdata, HYPRE_Int partial_cycle_control; MPI_Comm comm; + char nvtx_name[1024]; + #if 0 HYPRE_Real *D_mat; HYPRE_Real *S_vec; #endif HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("AMGCycle"); /* Acquire data and allocate storage */ A_array = hypre_ParAMGDataAArray(amg_data); @@ -184,7 +187,7 @@ hypre_BoomerAMGCycle( void *amg_vdata, num_coeffs[j] = hypre_ParCSRMatrixDNumNonzeros(A_array[j]); } } - + /*--------------------------------------------------------------------- * Initialize cycling control counter * @@ -226,19 +229,18 @@ hypre_BoomerAMGCycle( void *amg_vdata, if (smooth_num_levels > 0) { - if (smooth_type == 7 || smooth_type == 8 - || smooth_type == 17 || smooth_type == 18 - || smooth_type == 9 || smooth_type == 19) + if (smooth_type == 7 || smooth_type == 8 || smooth_type == 9 || + smooth_type == 17 || smooth_type == 18 || smooth_type == 19) { HYPRE_Int actual_local_size = hypre_ParVectorActualLocalSize(Vtemp); - Utemp = hypre_ParVectorCreate(comm,hypre_ParVectorGlobalSize(Vtemp), + Utemp = hypre_ParVectorCreate(comm, hypre_ParVectorGlobalSize(Vtemp), hypre_ParVectorPartitioning(Vtemp)); - local_size - = hypre_VectorSize(hypre_ParVectorLocalVector(Vtemp)); + local_size = hypre_VectorSize(hypre_ParVectorLocalVector(Vtemp)); if (local_size < actual_local_size) { - hypre_VectorData(hypre_ParVectorLocalVector(Utemp)) = - hypre_CTAlloc(HYPRE_Complex, actual_local_size, HYPRE_MEMORY_HOST); + hypre_VectorData(hypre_ParVectorLocalVector(Utemp)) = hypre_CTAlloc(HYPRE_Complex, + actual_local_size, + HYPRE_MEMORY_HOST); hypre_ParVectorActualLocalSize(Utemp) = actual_local_size; } else @@ -279,12 +281,14 @@ hypre_BoomerAMGCycle( void *amg_vdata, *--------------------------------------------------------------------*/ HYPRE_ANNOTATE_MGLEVEL_BEGIN(level); + hypre_sprintf(nvtx_name, "%s-%d", "AMG Level", level); + hypre_GpuProfilingPushRange(nvtx_name); while (Not_Finished) { if (num_levels > 1) { local_size = hypre_VectorSize(hypre_ParVectorLocalVector(F_array[level])); - hypre_VectorSize(hypre_ParVectorLocalVector(Vtemp)) = local_size; + hypre_ParVectorSetLocalSize(Vtemp, local_size); if (smooth_num_levels <= level) { @@ -295,12 +299,13 @@ hypre_BoomerAMGCycle( void *amg_vdata, } else if (smooth_type > 9) { - hypre_VectorSize(hypre_ParVectorLocalVector(Ztemp)) = local_size; - hypre_VectorSize(hypre_ParVectorLocalVector(Rtemp)) = local_size; - hypre_VectorSize(hypre_ParVectorLocalVector(Ptemp)) = local_size; + hypre_ParVectorSetLocalSize(Ztemp, local_size); + hypre_ParVectorSetLocalSize(Rtemp, local_size); + hypre_ParVectorSetLocalSize(Ptemp, local_size); + Ztemp_data = hypre_VectorData(hypre_ParVectorLocalVector(Ztemp)); Ptemp_data = hypre_VectorData(hypre_ParVectorLocalVector(Ptemp)); - hypre_ParVectorSetConstantValues(Ztemp,0); + hypre_ParVectorSetConstantValues(Ztemp, 0.0); alpha = -1.0; beta = 1.0; @@ -357,15 +362,19 @@ hypre_BoomerAMGCycle( void *amg_vdata, if (cycle_param == 3 && seq_cg) { HYPRE_ANNOTATE_REGION_BEGIN("%s", "Coarse solve"); + hypre_GpuProfilingPushRange("Coarse solve"); hypre_seqAMGCycle(amg_data, level, F_array, U_array); HYPRE_ANNOTATE_REGION_END("%s", "Coarse solve"); + hypre_GpuProfilingPopRange(); } #ifdef HYPRE_USING_DSUPERLU else if (cycle_param == 3 && hypre_ParAMGDataDSLUSolver(amg_data) != NULL) { HYPRE_ANNOTATE_REGION_BEGIN("%s", "Coarse solve"); + hypre_GpuProfilingPushRange("Coarse solve"); hypre_SLUDistSolve(hypre_ParAMGDataDSLUSolver(amg_data), Aux_F, Aux_U); HYPRE_ANNOTATE_REGION_END("%s", "Coarse solve"); + hypre_GpuProfilingPopRange(); } #endif else @@ -374,11 +383,13 @@ hypre_BoomerAMGCycle( void *amg_vdata, * Do the relaxation num_sweep times *-----------------------------------------------------------------*/ HYPRE_ANNOTATE_REGION_BEGIN("%s", "Relaxation"); + hypre_GpuProfilingPushRange("Relaxation"); + for (jj = 0; jj < cg_num_sweep; jj++) { if (smooth_num_levels > level && smooth_type > 9) { - hypre_ParVectorSetConstantValues(Aux_U, 0); + hypre_ParVectorSetConstantValues(Aux_U, 0.0); } for (j = 0; j < num_sweep; j++) @@ -386,7 +397,7 @@ hypre_BoomerAMGCycle( void *amg_vdata, if (num_levels == 1 && max_levels > 1) { relax_points = 0; - relax_local = 0; + relax_local = 0; } else { @@ -405,11 +416,11 @@ hypre_BoomerAMGCycle( void *amg_vdata, switch (relax_points) { case 1: - cycle_op_count += num_coeffs[level+1]; + cycle_op_count += num_coeffs[level + 1]; break; case -1: - cycle_op_count += (num_coeffs[level]-num_coeffs[level+1]); + cycle_op_count += (num_coeffs[level] - num_coeffs[level + 1]); break; } } @@ -421,29 +432,30 @@ hypre_BoomerAMGCycle( void *amg_vdata, /*----------------------------------------------- Choose Smoother -----------------------------------------------*/ - if ( smooth_num_levels > level && (smooth_type == 7 || smooth_type == 8 || - smooth_type == 9 || smooth_type == 19 || - smooth_type == 17 || smooth_type == 18) ) + if ( (smooth_num_levels > level) && + (smooth_type == 7 || smooth_type == 8 || smooth_type == 9 || + smooth_type == 17 || smooth_type == 18 || smooth_type == 19) ) { - hypre_VectorSize(hypre_ParVectorLocalVector(Utemp)) = local_size; + hypre_ParVectorSetLocalSize(Utemp, local_size); + alpha = -1.0; beta = 1.0; hypre_ParCSRMatrixMatvecOutOfPlace(alpha, A_array[level], U_array[level], beta, Aux_F, Vtemp); - if (smooth_type == 8 || smooth_type == 18) - { - HYPRE_ParCSRParaSailsSolve(smoother[level], - (HYPRE_ParCSRMatrix) A_array[level], - (HYPRE_ParVector) Vtemp, - (HYPRE_ParVector) Utemp); - } - else if (smooth_type == 7 || smooth_type == 17) + if (smooth_type == 7 || smooth_type == 17) { HYPRE_ParCSRPilutSolve(smoother[level], (HYPRE_ParCSRMatrix) A_array[level], (HYPRE_ParVector) Vtemp, (HYPRE_ParVector) Utemp); } + else if (smooth_type == 8 || smooth_type == 18) + { + HYPRE_ParCSRParaSailsSolve(smoother[level], + (HYPRE_ParCSRMatrix) A_array[level], + (HYPRE_ParVector) Vtemp, + (HYPRE_ParVector) Utemp); + } else if (smooth_type == 9 || smooth_type == 19) { HYPRE_EuclidSolve(smoother[level], @@ -451,7 +463,16 @@ hypre_BoomerAMGCycle( void *amg_vdata, (HYPRE_ParVector) Vtemp, (HYPRE_ParVector) Utemp); } - hypre_ParVectorAxpy(relax_weight[level],Utemp,Aux_U); + hypre_ParVectorAxpy(relax_weight[level], Utemp, Aux_U); + } + else if ( smooth_num_levels > level && (smooth_type == 4) ) + { + HYPRE_FSAISetZeroGuess(smoother[level], cycle_param - 2); + HYPRE_FSAISetMaxIterations(smoother[level], num_grid_sweeps[cycle_param]); + HYPRE_FSAISolve(smoother[level], + (HYPRE_ParCSRMatrix) A_array[level], + (HYPRE_ParVector) Aux_F, + (HYPRE_ParVector) Aux_U); } else if ( smooth_num_levels > level && (smooth_type == 5 || smooth_type == 15) ) { @@ -467,7 +488,12 @@ hypre_BoomerAMGCycle( void *amg_vdata, (HYPRE_ParVector) Aux_F, (HYPRE_ParVector) Aux_U); } - else if (relax_type == 9 || relax_type == 99 || relax_type == 199) + else if (relax_type == 9 || + relax_type == 19 || + relax_type == 98 || + relax_type == 99 || + relax_type == 198 || + relax_type == 199) { /* Gaussian elimination */ hypre_GaussElimSolve(amg_data, level, relax_type); @@ -501,7 +527,8 @@ hypre_BoomerAMGCycle( void *amg_vdata, } } else if (relax_type == 16) - { /* scaled Chebyshev */ + { + /* scaled Chebyshev */ HYPRE_Int scale = hypre_ParAMGDataChebyScale(amg_data); HYPRE_Int variant = hypre_ParAMGDataChebyVariant(amg_data); hypre_ParCSRRelax_Cheby_Solve(A_array[level], Aux_F, @@ -514,7 +541,7 @@ hypre_BoomerAMGCycle( void *amg_vdata, if (level == num_levels - 1) { /* if we are on the coarsest level, the cf_marker will be null - and we just do one sweep regular jacobi */ + and we just do one sweep regular Jacobi */ hypre_assert(cycle_param == 3); hypre_BoomerAMGRelax(A_array[level], Aux_F, CF_marker, 0, 0, relax_weight[level], 0.0, NULL, Aux_U, Vtemp, NULL); @@ -577,34 +604,40 @@ hypre_BoomerAMGCycle( void *amg_vdata, HYPRE_ANNOTATE_REGION_END("%s", "Relaxation"); HYPRE_ANNOTATE_MGLEVEL_END(level); HYPRE_ANNOTATE_FUNC_END; - - return(Solve_err_flag); + hypre_GpuProfilingPopRange(); + hypre_GpuProfilingPopRange(); + hypre_GpuProfilingPopRange(); + return (Solve_err_flag); } - } - if (smooth_num_levels > level && smooth_type > 9) + } /* for (j = 0; j < num_sweep; j++) */ + + if (smooth_num_levels > level && smooth_type > 9) { gammaold = gamma; - gamma = hypre_ParVectorInnerProd(Rtemp,Ztemp); + gamma = hypre_ParVectorInnerProd(Rtemp, Ztemp); if (jj == 0) { - hypre_ParVectorCopy(Ztemp,Ptemp); + hypre_ParVectorCopy(Ztemp, Ptemp); } else { - beta = gamma/gammaold; - for (i=0; i < local_size; i++) + beta = gamma / gammaold; + /* TODO (VPM): Use a ParVector routine to do the following */ + for (i = 0; i < local_size; i++) { - Ptemp_data[i] = Ztemp_data[i] + beta*Ptemp_data[i]; + Ptemp_data[i] = Ztemp_data[i] + beta * Ptemp_data[i]; } } - hypre_ParCSRMatrixMatvec(1.0,A_array[level],Ptemp,0.0,Vtemp); - alfa = gamma /hypre_ParVectorInnerProd(Ptemp,Vtemp); - hypre_ParVectorAxpy(alfa,Ptemp,U_array[level]); - hypre_ParVectorAxpy(-alfa,Vtemp,Rtemp); + hypre_ParCSRMatrixMatvec(1.0, A_array[level], Ptemp, 0.0, Vtemp); + alfa = gamma / hypre_ParVectorInnerProd(Ptemp, Vtemp); + hypre_ParVectorAxpy(alfa, Ptemp, U_array[level]); + hypre_ParVectorAxpy(-alfa, Vtemp, Rtemp); } - } + } /* for (jj = 0; jj < cg_num_sweep; jj++) */ + HYPRE_ANNOTATE_REGION_END("%s", "Relaxation"); + hypre_GpuProfilingPopRange(); } /*------------------------------------------------------------------ @@ -614,7 +647,7 @@ hypre_BoomerAMGCycle( void *amg_vdata, --lev_counter[level]; //if ( level != num_levels-1 && lev_counter[level] >= 0 ) - if (lev_counter[level] >= 0 && level != num_levels-1) + if (lev_counter[level] >= 0 && level != num_levels - 1) { /*--------------------------------------------------------------- * Visit coarser level next. @@ -626,15 +659,16 @@ hypre_BoomerAMGCycle( void *amg_vdata, fine_grid = level; coarse_grid = level + 1; - hypre_ParVectorSetConstantValues(U_array[coarse_grid], 0.0); + hypre_ParVectorSetZeros(U_array[coarse_grid]); alpha = -1.0; beta = 1.0; HYPRE_ANNOTATE_REGION_BEGIN("%s", "Residual"); + hypre_GpuProfilingPushRange("Residual"); if (block_mode) { - hypre_ParVectorCopy(F_array[fine_grid],Vtemp); + hypre_ParVectorCopy(F_array[fine_grid], Vtemp); hypre_ParCSRBlockMatrixMatvec(alpha, A_block_array[fine_grid], U_array[fine_grid], beta, Vtemp); } @@ -645,11 +679,13 @@ hypre_BoomerAMGCycle( void *amg_vdata, beta, F_array[fine_grid], Vtemp); } HYPRE_ANNOTATE_REGION_END("%s", "Residual"); + hypre_GpuProfilingPopRange(); alpha = 1.0; beta = 0.0; HYPRE_ANNOTATE_REGION_BEGIN("%s", "Restriction"); + hypre_GpuProfilingPushRange("Restriction"); if (block_mode) { hypre_ParCSRBlockMatrixMatvecT(alpha, R_block_array[fine_grid], Vtemp, @@ -671,11 +707,13 @@ hypre_BoomerAMGCycle( void *amg_vdata, } HYPRE_ANNOTATE_REGION_END("%s", "Restriction"); HYPRE_ANNOTATE_MGLEVEL_END(level); + hypre_GpuProfilingPopRange(); + hypre_GpuProfilingPopRange(); ++level; lev_counter[level] = hypre_max(lev_counter[level], cycle_type); cycle_param = 1; - if (level == num_levels-1) + if (level == num_levels - 1) { cycle_param = 3; } @@ -683,8 +721,9 @@ hypre_BoomerAMGCycle( void *amg_vdata, { Not_Finished = 0; } - HYPRE_ANNOTATE_MGLEVEL_BEGIN(level); + hypre_sprintf(nvtx_name, "%s-%d", "AMG Level", level); + hypre_GpuProfilingPushRange(nvtx_name); } else if (level != 0) { @@ -699,6 +738,7 @@ hypre_BoomerAMGCycle( void *amg_vdata, beta = 1.0; HYPRE_ANNOTATE_REGION_BEGIN("%s", "Interpolation"); + hypre_GpuProfilingPushRange("Interpolation"); if (block_mode) { hypre_ParCSRBlockMatrixMatvec(alpha, P_block_array[fine_grid], @@ -713,8 +753,13 @@ hypre_BoomerAMGCycle( void *amg_vdata, beta, U_array[fine_grid]); /* printf("Proc %d: level %d, n %d, Interpolation done\n", my_id, level, local_size); */ } + + hypre_ParVectorAllZeros(U_array[fine_grid]) = 0; + HYPRE_ANNOTATE_REGION_END("%s", "Interpolation"); HYPRE_ANNOTATE_MGLEVEL_END(level); + hypre_GpuProfilingPopRange(); + hypre_GpuProfilingPopRange(); --level; cycle_param = 2; @@ -725,6 +770,8 @@ hypre_BoomerAMGCycle( void *amg_vdata, } HYPRE_ANNOTATE_MGLEVEL_BEGIN(level); + hypre_sprintf(nvtx_name, "%s-%d", "AMG Level", level); + hypre_GpuProfilingPushRange(nvtx_name); } else { @@ -733,6 +780,7 @@ hypre_BoomerAMGCycle( void *amg_vdata, } /* main loop: while (Not_Finished) */ HYPRE_ANNOTATE_MGLEVEL_END(level); + hypre_GpuProfilingPopRange(); hypre_ParAMGDataCycleOpCount(amg_data) = cycle_op_count; @@ -749,6 +797,7 @@ hypre_BoomerAMGCycle( void *amg_vdata, } HYPRE_ANNOTATE_FUNC_END; + hypre_GpuProfilingPopRange(); - return(Solve_err_flag); + return (Solve_err_flag); } diff --git a/external/hypre/src/parcsr_ls/par_difconv.c b/external/hypre/src/parcsr_ls/par_difconv.c index f702be6f..cede6127 100644 --- a/external/hypre/src/parcsr_ls/par_difconv.c +++ b/external/hypre/src/parcsr_ls/par_difconv.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -37,14 +37,14 @@ GenerateDifConv( MPI_Comm comm, HYPRE_BigInt *big_offd_j = NULL; HYPRE_Real *offd_data = NULL; - HYPRE_BigInt *global_part; + HYPRE_BigInt global_part[2]; HYPRE_BigInt ix, iy, iz; HYPRE_Int ip, iq, ir; HYPRE_Int cnt, o_cnt; HYPRE_Int local_num_rows; HYPRE_BigInt *col_map_offd = NULL; HYPRE_Int row_index; - HYPRE_Int i,j; + HYPRE_Int i, j; HYPRE_Int nx_local, ny_local, nz_local; HYPRE_Int num_cols_offd; @@ -57,60 +57,61 @@ GenerateDifConv( MPI_Comm comm, HYPRE_Int num_procs; HYPRE_Int P_busy, Q_busy, R_busy; - hypre_MPI_Comm_size(comm,&num_procs); + hypre_MPI_Comm_size(comm, &num_procs); - grid_size = nx*ny*nz; + grid_size = nx * ny * nz; - hypre_GeneratePartitioning(nx,P,&nx_part); - hypre_GeneratePartitioning(ny,Q,&ny_part); - hypre_GeneratePartitioning(nz,R,&nz_part); + hypre_GeneratePartitioning(nx, P, &nx_part); + hypre_GeneratePartitioning(ny, Q, &ny_part); + hypre_GeneratePartitioning(nz, R, &nz_part); - nx_local = (HYPRE_Int)(nx_part[p+1] - nx_part[p]); - ny_local = (HYPRE_Int)(ny_part[q+1] - ny_part[q]); - nz_local = (HYPRE_Int)(nz_part[r+1] - nz_part[r]); + nx_local = (HYPRE_Int)(nx_part[p + 1] - nx_part[p]); + ny_local = (HYPRE_Int)(ny_part[q + 1] - ny_part[q]); + nz_local = (HYPRE_Int)(nz_part[r + 1] - nz_part[r]); - local_num_rows = nx_local*ny_local*nz_local; + local_num_rows = nx_local * ny_local * nz_local; ip = p; iq = q; ir = r; - global_part = hypre_CTAlloc(HYPRE_BigInt,2,HYPRE_MEMORY_HOST); - global_part[0] = nz_part[ir]*nx*ny+(ny_part[iq]*nx+nx_part[ip]*ny_local)*nz_local; + global_part[0] = nz_part[ir] * nx * ny + (ny_part[iq] * nx + nx_part[ip] * ny_local) * nz_local; global_part[1] = global_part[0] + (HYPRE_BigInt)local_num_rows; - diag_i = hypre_CTAlloc(HYPRE_Int, local_num_rows+1, HYPRE_MEMORY_HOST); - offd_i = hypre_CTAlloc(HYPRE_Int, local_num_rows+1, HYPRE_MEMORY_HOST); + diag_i = hypre_CTAlloc(HYPRE_Int, local_num_rows + 1, HYPRE_MEMORY_HOST); + offd_i = hypre_CTAlloc(HYPRE_Int, local_num_rows + 1, HYPRE_MEMORY_HOST); - P_busy = hypre_min(nx,P); - Q_busy = hypre_min(ny,Q); - R_busy = hypre_min(nz,R); + P_busy = hypre_min(nx, P); + Q_busy = hypre_min(ny, Q); + R_busy = hypre_min(nz, R); num_cols_offd = 0; - if (p) num_cols_offd += ny_local*nz_local; - if (p < P_busy-1) num_cols_offd += ny_local*nz_local; - if (q) num_cols_offd += nx_local*nz_local; - if (q < Q_busy-1) num_cols_offd += nx_local*nz_local; - if (r) num_cols_offd += nx_local*ny_local; - if (r < R_busy-1) num_cols_offd += nx_local*ny_local; + if (p) { num_cols_offd += ny_local * nz_local; } + if (p < P_busy - 1) { num_cols_offd += ny_local * nz_local; } + if (q) { num_cols_offd += nx_local * nz_local; } + if (q < Q_busy - 1) { num_cols_offd += nx_local * nz_local; } + if (r) { num_cols_offd += nx_local * ny_local; } + if (r < R_busy - 1) { num_cols_offd += nx_local * ny_local; } - if (!local_num_rows) num_cols_offd = 0; + if (!local_num_rows) { num_cols_offd = 0; } cnt = 1; o_cnt = 1; diag_i[0] = 0; offd_i[0] = 0; - for (iz = nz_part[ir]; iz < nz_part[ir+1]; iz++) + for (iz = nz_part[ir]; iz < nz_part[ir + 1]; iz++) { - for (iy = ny_part[iq]; iy < ny_part[iq+1]; iy++) + for (iy = ny_part[iq]; iy < ny_part[iq + 1]; iy++) { - for (ix = nx_part[ip]; ix < nx_part[ip+1]; ix++) + for (ix = nx_part[ip]; ix < nx_part[ip + 1]; ix++) { - diag_i[cnt] = diag_i[cnt-1]; - offd_i[o_cnt] = offd_i[o_cnt-1]; + diag_i[cnt] = diag_i[cnt - 1]; + offd_i[o_cnt] = offd_i[o_cnt - 1]; diag_i[cnt]++; if (iz > nz_part[ir]) + { diag_i[cnt]++; + } else { if (iz) @@ -119,7 +120,9 @@ GenerateDifConv( MPI_Comm comm, } } if (iy > ny_part[iq]) + { diag_i[cnt]++; + } else { if (iy) @@ -128,7 +131,9 @@ GenerateDifConv( MPI_Comm comm, } } if (ix > nx_part[ip]) + { diag_i[cnt]++; + } else { if (ix) @@ -136,29 +141,35 @@ GenerateDifConv( MPI_Comm comm, offd_i[o_cnt]++; } } - if (ix+1 < nx_part[ip+1]) + if (ix + 1 < nx_part[ip + 1]) + { diag_i[cnt]++; + } else { - if (ix+1 < nx) + if (ix + 1 < nx) { offd_i[o_cnt]++; } } - if (iy+1 < ny_part[iq+1]) + if (iy + 1 < ny_part[iq + 1]) + { diag_i[cnt]++; + } else { - if (iy+1 < ny) + if (iy + 1 < ny) { offd_i[o_cnt]++; } } - if (iz+1 < nz_part[ir+1]) + if (iz + 1 < nz_part[ir + 1]) + { diag_i[cnt]++; + } else { - if (iz+1 < nz) + if (iz + 1 < nz) { offd_i[o_cnt]++; } @@ -182,94 +193,94 @@ GenerateDifConv( MPI_Comm comm, row_index = 0; cnt = 0; o_cnt = 0; - for (iz = nz_part[ir]; iz < nz_part[ir+1]; iz++) + for (iz = nz_part[ir]; iz < nz_part[ir + 1]; iz++) { - for (iy = ny_part[iq]; iy < ny_part[iq+1]; iy++) + for (iy = ny_part[iq]; iy < ny_part[iq + 1]; iy++) { - for (ix = nx_part[ip]; ix < nx_part[ip+1]; ix++) + for (ix = nx_part[ip]; ix < nx_part[ip + 1]; ix++) { diag_j[cnt] = row_index; diag_data[cnt++] = value[0]; if (iz > nz_part[ir]) { - diag_j[cnt] = row_index-nx_local*ny_local; + diag_j[cnt] = row_index - nx_local * ny_local; diag_data[cnt++] = value[3]; } else { if (iz) { - big_offd_j[o_cnt] = hypre_map(ix,iy,iz-1,ip,iq,ir-1,nx,ny, + big_offd_j[o_cnt] = hypre_map(ix, iy, iz - 1, ip, iq, ir - 1, nx, ny, nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[3]; } } if (iy > ny_part[iq]) { - diag_j[cnt] = row_index-nx_local; + diag_j[cnt] = row_index - nx_local; diag_data[cnt++] = value[2]; } else { if (iy) { - big_offd_j[o_cnt] = hypre_map(ix,iy-1,iz,ip,iq-1,ir,nx,ny, + big_offd_j[o_cnt] = hypre_map(ix, iy - 1, iz, ip, iq - 1, ir, nx, ny, nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[2]; } } if (ix > nx_part[ip]) { - diag_j[cnt] = row_index-1; + diag_j[cnt] = row_index - 1; diag_data[cnt++] = value[1]; } else { if (ix) { - big_offd_j[o_cnt] = hypre_map(ix-1,iy,iz,ip-1,iq,ir,nx,ny, + big_offd_j[o_cnt] = hypre_map(ix - 1, iy, iz, ip - 1, iq, ir, nx, ny, nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } } - if (ix+1 < nx_part[ip+1]) + if (ix + 1 < nx_part[ip + 1]) { - diag_j[cnt] = row_index+1; + diag_j[cnt] = row_index + 1; diag_data[cnt++] = value[4]; } else { - if (ix+1 < nx) + if (ix + 1 < nx) { - big_offd_j[o_cnt] = hypre_map(ix+1,iy,iz,ip+1,iq,ir,nx,ny, + big_offd_j[o_cnt] = hypre_map(ix + 1, iy, iz, ip + 1, iq, ir, nx, ny, nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[4]; } } - if (iy+1 < ny_part[iq+1]) + if (iy + 1 < ny_part[iq + 1]) { - diag_j[cnt] = row_index+nx_local; + diag_j[cnt] = row_index + nx_local; diag_data[cnt++] = value[5]; } else { - if (iy+1 < ny) + if (iy + 1 < ny) { - big_offd_j[o_cnt] = hypre_map(ix,iy+1,iz,ip,iq+1,ir,nx,ny, + big_offd_j[o_cnt] = hypre_map(ix, iy + 1, iz, ip, iq + 1, ir, nx, ny, nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[5]; } } - if (iz+1 < nz_part[ir+1]) + if (iz + 1 < nz_part[ir + 1]) { - diag_j[cnt] = row_index+nx_local*ny_local; + diag_j[cnt] = row_index + nx_local * ny_local; diag_data[cnt++] = value[6]; } else { - if (iz+1 < nz) + if (iz + 1 < nz) { - big_offd_j[o_cnt] = hypre_map(ix,iy,iz+1,ip,iq,ir+1,nx,ny, + big_offd_j[o_cnt] = hypre_map(ix, iy, iz + 1, ip, iq, ir + 1, nx, ny, nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[6]; } @@ -282,13 +293,15 @@ GenerateDifConv( MPI_Comm comm, if (num_cols_offd) { col_map_offd = hypre_CTAlloc(HYPRE_BigInt, num_cols_offd, HYPRE_MEMORY_HOST); - for (i=0; i < num_cols_offd; i++) + for (i = 0; i < num_cols_offd; i++) + { col_map_offd[i] = big_offd_j[i]; + } - hypre_BigQsort0(col_map_offd, 0, num_cols_offd-1); + hypre_BigQsort0(col_map_offd, 0, num_cols_offd - 1); - for (i=0; i < num_cols_offd; i++) - for (j=0; j < num_cols_offd; j++) + for (i = 0; i < num_cols_offd; i++) + for (j = 0; j < num_cols_offd; j++) if (big_offd_j[i] == col_map_offd[j]) { offd_j[i] = j; @@ -325,7 +338,6 @@ GenerateDifConv( MPI_Comm comm, hypre_TFree(ny_part, HYPRE_MEMORY_HOST); hypre_TFree(nz_part, HYPRE_MEMORY_HOST); hypre_TFree(big_offd_j, HYPRE_MEMORY_HOST); - hypre_TFree(global_part, HYPRE_MEMORY_HOST); return (HYPRE_ParCSRMatrix) A; } diff --git a/external/hypre/src/parcsr_ls/par_fsai.c b/external/hypre/src/parcsr_ls/par_fsai.c new file mode 100644 index 00000000..3b6a3c41 --- /dev/null +++ b/external/hypre/src/parcsr_ls/par_fsai.c @@ -0,0 +1,798 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + *******************************************************************************/ + +#include "_hypre_parcsr_ls.h" +#include "par_fsai.h" + +/****************************************************************************** + * HYPRE_FSAICreate + ******************************************************************************/ + +void * +hypre_FSAICreate( void ) +{ + hypre_ParFSAIData *fsai_data; + + /* setup params */ + HYPRE_Int algo_type; + HYPRE_Int local_solve_type; + HYPRE_Int max_steps; + HYPRE_Int max_step_size; + HYPRE_Int max_nnz_row; + HYPRE_Int num_levels; + HYPRE_Real kap_tolerance; + + /* solver params */ + HYPRE_Int eig_max_iters; + HYPRE_Int max_iterations; + HYPRE_Int num_iterations; + HYPRE_Real tolerance; + HYPRE_Real omega; + + /* log info */ + HYPRE_Int logging; + + /* output params */ + HYPRE_Int print_level; + + /*----------------------------------------------------------------------- + * Setup default values for parameters + *-----------------------------------------------------------------------*/ + fsai_data = hypre_CTAlloc(hypre_ParFSAIData, 1, HYPRE_MEMORY_HOST); + + /* setup params */ + local_solve_type = 0; + max_steps = 3; + max_step_size = 5; + max_nnz_row = max_steps * max_step_size; + num_levels = 2; + kap_tolerance = 1.0e-3; + + /* parameters that depend on the execution policy */ +#if defined (HYPRE_USING_CUDA) || defined (HYPRE_USING_HIP) + HYPRE_MemoryLocation memory_location = hypre_HandleMemoryLocation(hypre_handle()); + + if (hypre_GetExecPolicy1(memory_location) == HYPRE_EXEC_DEVICE) + { + algo_type = 3; + } + else +#endif + { + algo_type = hypre_NumThreads() > 4 ? 2 : 1; + } + + /* solver params */ + eig_max_iters = 0; + max_iterations = 20; + tolerance = 1.0e-6; + omega = 1.0; + + /* log info */ + logging = 0; + num_iterations = 0; + + /* output params */ + print_level = 0; + + HYPRE_ANNOTATE_FUNC_BEGIN; + + /*----------------------------------------------------------------------- + * Create the hypre_ParFSAIData structure and return + *-----------------------------------------------------------------------*/ + + hypre_ParFSAIDataGmat(fsai_data) = NULL; + hypre_ParFSAIDataGTmat(fsai_data) = NULL; + hypre_ParFSAIDataRWork(fsai_data) = NULL; + hypre_ParFSAIDataZWork(fsai_data) = NULL; + hypre_ParFSAIDataZeroGuess(fsai_data) = 0; + + hypre_FSAISetAlgoType(fsai_data, algo_type); + hypre_FSAISetLocalSolveType(fsai_data, local_solve_type); + hypre_FSAISetMaxSteps(fsai_data, max_steps); + hypre_FSAISetMaxStepSize(fsai_data, max_step_size); + hypre_FSAISetMaxNnzRow(fsai_data, max_nnz_row); + hypre_FSAISetNumLevels(fsai_data, num_levels); + hypre_FSAISetKapTolerance(fsai_data, kap_tolerance); + + hypre_FSAISetMaxIterations(fsai_data, max_iterations); + hypre_FSAISetEigMaxIters(fsai_data, eig_max_iters); + hypre_FSAISetTolerance(fsai_data, tolerance); + hypre_FSAISetOmega(fsai_data, omega); + + hypre_FSAISetLogging(fsai_data, logging); + hypre_FSAISetNumIterations(fsai_data, num_iterations); + + hypre_FSAISetPrintLevel(fsai_data, print_level); + + HYPRE_ANNOTATE_FUNC_END; + + return (void *) fsai_data; +} + +/****************************************************************************** + * HYPRE_FSAIDestroy + ******************************************************************************/ + +HYPRE_Int +hypre_FSAIDestroy( void *data ) +{ + hypre_ParFSAIData *fsai_data = (hypre_ParFSAIData*)data; + + HYPRE_ANNOTATE_FUNC_BEGIN; + + if (fsai_data) + { + if (hypre_ParFSAIDataGmat(fsai_data)) + { + hypre_ParCSRMatrixDestroy(hypre_ParFSAIDataGmat(fsai_data)); + } + + if (hypre_ParFSAIDataGTmat(fsai_data)) + { + hypre_ParCSRMatrixDestroy(hypre_ParFSAIDataGTmat(fsai_data)); + } + + hypre_ParVectorDestroy(hypre_ParFSAIDataRWork(fsai_data)); + hypre_ParVectorDestroy(hypre_ParFSAIDataZWork(fsai_data)); + + hypre_TFree(fsai_data, HYPRE_MEMORY_HOST); + } + + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/****************************************************************************** + * Routines to SET the setup phase parameters + ******************************************************************************/ + +HYPRE_Int +hypre_FSAISetAlgoType( void *data, + HYPRE_Int algo_type ) +{ + hypre_ParFSAIData *fsai_data = (hypre_ParFSAIData*) data; + + if (!fsai_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + if (algo_type < 0) + { + hypre_error_in_arg(2); + return hypre_error_flag; + } + + hypre_ParFSAIDataAlgoType(fsai_data) = algo_type; + + return hypre_error_flag; +} + +HYPRE_Int +hypre_FSAISetLocalSolveType( void *data, + HYPRE_Int local_solve_type ) +{ + hypre_ParFSAIData *fsai_data = (hypre_ParFSAIData*) data; + + if (!fsai_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + if (local_solve_type < 0 || local_solve_type > 2) + { + hypre_error_in_arg(2); + return hypre_error_flag; + } + + hypre_ParFSAIDataLocalSolveType(fsai_data) = local_solve_type; + + return hypre_error_flag; +} + +HYPRE_Int +hypre_FSAISetMaxSteps( void *data, + HYPRE_Int max_steps ) +{ + hypre_ParFSAIData *fsai_data = (hypre_ParFSAIData*) data; + + if (!fsai_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + if (max_steps < 0) + { + hypre_error_in_arg(2); + return hypre_error_flag; + } + + hypre_ParFSAIDataMaxSteps(fsai_data) = max_steps; + + return hypre_error_flag; +} + +HYPRE_Int +hypre_FSAISetMaxStepSize( void *data, + HYPRE_Int max_step_size ) +{ + hypre_ParFSAIData *fsai_data = (hypre_ParFSAIData*) data; + + if (!fsai_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + if (max_step_size < 0) + { + hypre_error_in_arg(2); + return hypre_error_flag; + } + + hypre_ParFSAIDataMaxStepSize(fsai_data) = max_step_size; + + return hypre_error_flag; +} + +HYPRE_Int +hypre_FSAISetMaxNnzRow( void *data, + HYPRE_Int max_nnz_row ) +{ + hypre_ParFSAIData *fsai_data = (hypre_ParFSAIData*) data; + + if (!fsai_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + if (max_nnz_row < 0) + { + hypre_error_in_arg(2); + return hypre_error_flag; + } + + hypre_ParFSAIDataMaxNnzRow(fsai_data) = max_nnz_row; + + return hypre_error_flag; +} + +HYPRE_Int +hypre_FSAISetNumLevels( void *data, + HYPRE_Int num_levels ) +{ + hypre_ParFSAIData *fsai_data = (hypre_ParFSAIData*) data; + + if (!fsai_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + if (num_levels < 1) + { + hypre_error_in_arg(2); + return hypre_error_flag; + } + + hypre_ParFSAIDataNumLevels(fsai_data) = num_levels; + + return hypre_error_flag; +} + +HYPRE_Int +hypre_FSAISetThreshold( void *data, + HYPRE_Real threshold ) +{ + hypre_ParFSAIData *fsai_data = (hypre_ParFSAIData*) data; + + if (!fsai_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + if (threshold < 0) + { + hypre_error_in_arg(2); + return hypre_error_flag; + } + + hypre_ParFSAIDataThreshold(fsai_data) = threshold; + + return hypre_error_flag; +} + +HYPRE_Int +hypre_FSAISetKapTolerance( void *data, + HYPRE_Real kap_tolerance ) +{ + hypre_ParFSAIData *fsai_data = (hypre_ParFSAIData*) data; + + if (!fsai_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + if (kap_tolerance < 0) + { + hypre_error_in_arg(2); + return hypre_error_flag; + } + + hypre_ParFSAIDataKapTolerance(fsai_data) = kap_tolerance; + + return hypre_error_flag; +} + +HYPRE_Int +hypre_FSAISetMaxIterations( void *data, + HYPRE_Int max_iterations ) +{ + hypre_ParFSAIData *fsai_data = (hypre_ParFSAIData*) data; + + if (!fsai_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + if (max_iterations < 0) + { + hypre_error_in_arg(2); + return hypre_error_flag; + } + + hypre_ParFSAIDataMaxIterations(fsai_data) = max_iterations; + + return hypre_error_flag; +} + +HYPRE_Int +hypre_FSAISetEigMaxIters( void *data, + HYPRE_Int eig_max_iters ) +{ + hypre_ParFSAIData *fsai_data = (hypre_ParFSAIData*) data; + + if (!fsai_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + if (eig_max_iters < 0) + { + hypre_error_in_arg(2); + return hypre_error_flag; + } + + hypre_ParFSAIDataEigMaxIters(fsai_data) = eig_max_iters; + + return hypre_error_flag; +} + +HYPRE_Int +hypre_FSAISetZeroGuess( void *data, + HYPRE_Int zero_guess ) +{ + hypre_ParFSAIData *fsai_data = (hypre_ParFSAIData*) data; + + if (!fsai_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + if (zero_guess != 0) + { + hypre_ParFSAIDataZeroGuess(fsai_data) = 1; + } + else + { + hypre_ParFSAIDataZeroGuess(fsai_data) = 0; + } + + return hypre_error_flag; +} + +HYPRE_Int +hypre_FSAISetTolerance( void *data, + HYPRE_Real tolerance ) +{ + hypre_ParFSAIData *fsai_data = (hypre_ParFSAIData*) data; + + if (!fsai_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + if (tolerance < 0) + { + hypre_error_in_arg(2); + return hypre_error_flag; + } + + hypre_ParFSAIDataTolerance(fsai_data) = tolerance; + + return hypre_error_flag; +} + +HYPRE_Int +hypre_FSAISetOmega( void *data, + HYPRE_Real omega ) +{ + hypre_ParFSAIData *fsai_data = (hypre_ParFSAIData*) data; + + if (!fsai_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + if (omega < 0) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Negative omega not allowed!"); + return hypre_error_flag; + } + + hypre_ParFSAIDataOmega(fsai_data) = omega; + + return hypre_error_flag; +} + +HYPRE_Int +hypre_FSAISetLogging( void *data, + HYPRE_Int logging ) +{ + hypre_ParFSAIData *fsai_data = (hypre_ParFSAIData*) data; + + if (!fsai_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + if (logging < 0) + { + hypre_error_in_arg(2); + return hypre_error_flag; + } + + hypre_ParFSAIDataLogging(fsai_data) = logging; + + return hypre_error_flag; +} + +HYPRE_Int +hypre_FSAISetNumIterations( void *data, + HYPRE_Int num_iterations ) +{ + hypre_ParFSAIData *fsai_data = (hypre_ParFSAIData*) data; + + if (!fsai_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + if (num_iterations < 0) + { + hypre_error_in_arg(2); + return hypre_error_flag; + } + + hypre_ParFSAIDataNumIterations(fsai_data) = num_iterations; + + return hypre_error_flag; +} + +HYPRE_Int +hypre_FSAISetPrintLevel( void *data, + HYPRE_Int print_level ) +{ + hypre_ParFSAIData *fsai_data = (hypre_ParFSAIData*) data; + + if (!fsai_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + if (print_level < 0) + { + hypre_error_in_arg(2); + return hypre_error_flag; + } + + hypre_ParFSAIDataPrintLevel(fsai_data) = print_level; + + return hypre_error_flag; +} + +/****************************************************************************** + * Routines to GET the setup phase parameters + ******************************************************************************/ + +HYPRE_Int +hypre_FSAIGetAlgoType( void *data, + HYPRE_Int *algo_type ) +{ + hypre_ParFSAIData *fsai_data = (hypre_ParFSAIData*) data; + + if (!fsai_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + *algo_type = hypre_ParFSAIDataAlgoType(fsai_data); + + return hypre_error_flag; +} + +HYPRE_Int +hypre_FSAIGetLocalSolveType( void *data, + HYPRE_Int *local_solve_type ) +{ + hypre_ParFSAIData *fsai_data = (hypre_ParFSAIData*) data; + + if (!fsai_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + *local_solve_type = hypre_ParFSAIDataLocalSolveType(fsai_data); + + return hypre_error_flag; +} + +HYPRE_Int +hypre_FSAIGetMaxSteps( void *data, + HYPRE_Int *algo_type ) +{ + hypre_ParFSAIData *fsai_data = (hypre_ParFSAIData*) data; + + if (!fsai_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + *algo_type = hypre_ParFSAIDataMaxSteps(fsai_data); + + return hypre_error_flag; +} + +HYPRE_Int +hypre_FSAIGetMaxStepSize( void *data, + HYPRE_Int *max_step_size ) +{ + hypre_ParFSAIData *fsai_data = (hypre_ParFSAIData*) data; + + if (!fsai_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + *max_step_size = hypre_ParFSAIDataMaxStepSize(fsai_data); + + return hypre_error_flag; +} + +HYPRE_Int +hypre_FSAIGetMaxNnzRow( void *data, + HYPRE_Int *max_nnz_row ) +{ + hypre_ParFSAIData *fsai_data = (hypre_ParFSAIData*) data; + + if (!fsai_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + *max_nnz_row = hypre_ParFSAIDataMaxNnzRow(fsai_data); + + return hypre_error_flag; +} + +HYPRE_Int +hypre_FSAIGetNumLevels( void *data, + HYPRE_Int *num_levels ) +{ + hypre_ParFSAIData *fsai_data = (hypre_ParFSAIData*) data; + + if (!fsai_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + *num_levels = hypre_ParFSAIDataNumLevels(fsai_data); + + return hypre_error_flag; +} + +HYPRE_Int +hypre_FSAIGetThreshold( void *data, + HYPRE_Real *threshold ) +{ + hypre_ParFSAIData *fsai_data = (hypre_ParFSAIData*) data; + + if (!fsai_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + *threshold = hypre_ParFSAIDataThreshold(fsai_data); + + return hypre_error_flag; +} + +HYPRE_Int +hypre_FSAIGetKapTolerance( void *data, + HYPRE_Real *kap_tolerance ) +{ + hypre_ParFSAIData *fsai_data = (hypre_ParFSAIData*) data; + + if (!fsai_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + *kap_tolerance = hypre_ParFSAIDataKapTolerance(fsai_data); + + return hypre_error_flag; +} + +HYPRE_Int +hypre_FSAIGetMaxIterations( void *data, + HYPRE_Int *max_iterations ) +{ + hypre_ParFSAIData *fsai_data = (hypre_ParFSAIData*) data; + + if (!fsai_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + *max_iterations = hypre_ParFSAIDataMaxIterations(fsai_data); + + return hypre_error_flag; +} + +HYPRE_Int +hypre_FSAIGetEigMaxIters( void *data, + HYPRE_Int *eig_max_iters ) +{ + hypre_ParFSAIData *fsai_data = (hypre_ParFSAIData*) data; + + if (!fsai_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + *eig_max_iters = hypre_ParFSAIDataEigMaxIters(fsai_data); + + return hypre_error_flag; +} + +HYPRE_Int +hypre_FSAIGetZeroGuess( void *data, + HYPRE_Int *zero_guess ) +{ + hypre_ParFSAIData *fsai_data = (hypre_ParFSAIData*) data; + + if (!fsai_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + *zero_guess = hypre_ParFSAIDataZeroGuess(fsai_data); + + return hypre_error_flag; +} + +HYPRE_Int +hypre_FSAIGetTolerance( void *data, + HYPRE_Real *tolerance ) +{ + hypre_ParFSAIData *fsai_data = (hypre_ParFSAIData*) data; + + if (!fsai_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + *tolerance = hypre_ParFSAIDataTolerance(fsai_data); + + return hypre_error_flag; +} + +HYPRE_Int +hypre_FSAIGetOmega( void *data, + HYPRE_Real *omega ) +{ + hypre_ParFSAIData *fsai_data = (hypre_ParFSAIData*) data; + + if (!fsai_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + *omega = hypre_ParFSAIDataOmega(fsai_data); + + return hypre_error_flag; +} + +HYPRE_Int +hypre_FSAIGetLogging( void *data, + HYPRE_Int *logging ) +{ + hypre_ParFSAIData *fsai_data = (hypre_ParFSAIData*) data; + + if (!fsai_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + *logging = hypre_ParFSAIDataLogging(fsai_data); + + return hypre_error_flag; +} + +HYPRE_Int +hypre_FSAIGetNumIterations( void *data, + HYPRE_Int *num_iterations ) +{ + hypre_ParFSAIData *fsai_data = (hypre_ParFSAIData*) data; + + if (!fsai_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + *num_iterations = hypre_ParFSAIDataNumIterations(fsai_data); + + return hypre_error_flag; +} + +HYPRE_Int +hypre_FSAIGetPrintLevel( void *data, + HYPRE_Int *print_level ) +{ + hypre_ParFSAIData *fsai_data = (hypre_ParFSAIData*) data; + + if (!fsai_data) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + *print_level = hypre_ParFSAIDataPrintLevel(fsai_data); + + return hypre_error_flag; +} diff --git a/external/hypre/src/parcsr_ls/par_fsai.h b/external/hypre/src/parcsr_ls/par_fsai.h new file mode 100644 index 00000000..9bbe7073 --- /dev/null +++ b/external/hypre/src/parcsr_ls/par_fsai.h @@ -0,0 +1,88 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#ifndef hypre_ParFSAI_DATA_HEADER +#define hypre_ParFSAI_DATA_HEADER + +//#define DEBUG_FSAI + +/*-------------------------------------------------------------------------- + * hypre_ParFSAIData + *--------------------------------------------------------------------------*/ + +typedef struct hypre_ParFSAIData_struct +{ + /* FSAI Setup input data */ + HYPRE_Int algo_type; /* FSAI algorithm type */ + HYPRE_Int local_solve_type; /* Local linear solver type */ + HYPRE_Int max_steps; /* Max. iterations run per row */ + HYPRE_Int max_step_size; /* Max. number of nonzeros added to a row of G per step */ + HYPRE_Int max_nnz_row; /* Max. number of nonzeros per row of G */ + HYPRE_Int num_levels; /* Number of levels for computing the candidate pattern */ + HYPRE_Real threshold; /* Filtering threshold for the candidate pattern */ + HYPRE_Real kap_tolerance; /* Min. amount of change between two steps */ + + /* FSAI Setup data */ + HYPRE_Real density; /* Density of matrix G wrt. A */ + hypre_ParCSRMatrix *Gmat; /* Matrix holding FSAI factor. M^(-1) = G'G */ + hypre_ParCSRMatrix *GTmat; /* Matrix holding the transpose of the FSAI factor */ + + /* Solver data */ + HYPRE_Int zero_guess; /* Flag indicating x0 = 0 */ + HYPRE_Int eig_max_iters; /* Iters for computing max. eigenvalue of G^T*G*A */ + HYPRE_Int max_iterations; /* Maximum iterations run for the solver */ + HYPRE_Int num_iterations; /* Number of iterations the solver ran */ + HYPRE_Real omega; /* Step size for Preconditioned Richardson Solver */ + HYPRE_Real tolerance; /* Tolerance for the solver */ + HYPRE_Real rel_resnorm; /* available if logging > 1 */ + + /* Work data */ + hypre_ParVector *r_work; /* work vector used to compute the residual */ + hypre_ParVector *z_work; /* work vector used for applying FSAI */ + + /* Log info data */ + HYPRE_Int logging; + HYPRE_Int print_level; +} hypre_ParFSAIData; + +/*-------------------------------------------------------------------------- + * Accessor functions for the hypre_ParFSAIData structure + *--------------------------------------------------------------------------*/ + +/* FSAI Setup input data */ +#define hypre_ParFSAIDataAlgoType(fsai_data) ((fsai_data) -> algo_type) +#define hypre_ParFSAIDataLocalSolveType(fsai_data) ((fsai_data) -> local_solve_type) +#define hypre_ParFSAIDataMaxSteps(fsai_data) ((fsai_data) -> max_steps) +#define hypre_ParFSAIDataMaxStepSize(fsai_data) ((fsai_data) -> max_step_size) +#define hypre_ParFSAIDataMaxNnzRow(fsai_data) ((fsai_data) -> max_nnz_row) +#define hypre_ParFSAIDataNumLevels(fsai_data) ((fsai_data) -> num_levels) +#define hypre_ParFSAIDataThreshold(fsai_data) ((fsai_data) -> threshold) +#define hypre_ParFSAIDataKapTolerance(fsai_data) ((fsai_data) -> kap_tolerance) + +/* FSAI Setup data */ +#define hypre_ParFSAIDataGmat(fsai_data) ((fsai_data) -> Gmat) +#define hypre_ParFSAIDataGTmat(fsai_data) ((fsai_data) -> GTmat) +#define hypre_ParFSAIDataDensity(fsai_data) ((fsai_data) -> density) + +/* Solver problem data */ +#define hypre_ParFSAIDataZeroGuess(fsai_data) ((fsai_data) -> zero_guess) +#define hypre_ParFSAIDataEigMaxIters(fsai_data) ((fsai_data) -> eig_max_iters) +#define hypre_ParFSAIDataMaxIterations(fsai_data) ((fsai_data) -> max_iterations) +#define hypre_ParFSAIDataNumIterations(fsai_data) ((fsai_data) -> num_iterations) +#define hypre_ParFSAIDataOmega(fsai_data) ((fsai_data) -> omega) +#define hypre_ParFSAIDataRelResNorm(fsai_data) ((fsai_data) -> rel_resnorm) +#define hypre_ParFSAIDataTolerance(fsai_data) ((fsai_data) -> tolerance) + +/* Work data */ +#define hypre_ParFSAIDataRWork(fsai_data) ((fsai_data) -> r_work) +#define hypre_ParFSAIDataZWork(fsai_data) ((fsai_data) -> z_work) + +/* Log info data */ +#define hypre_ParFSAIDataLogging(fsai_data) ((fsai_data) -> logging) +#define hypre_ParFSAIDataPrintLevel(fsai_data) ((fsai_data) -> print_level) + +#endif diff --git a/external/hypre/src/parcsr_ls/par_fsai_device.c b/external/hypre/src/parcsr_ls/par_fsai_device.c new file mode 100644 index 00000000..581d85c0 --- /dev/null +++ b/external/hypre/src/parcsr_ls/par_fsai_device.c @@ -0,0 +1,1338 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#include "_hypre_parcsr_ls.h" +#include "_hypre_utilities.hpp" +#include "par_fsai.h" + +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + +#define mat_(l, k, i, j) mat_data[l * (l * k + i) + j] +#define rhs_(l, i, j) rhs_data[l * i + j] +#define sol_(l, i, j) sol_data[l * i + j] +#define ls_(i, j) ls_data[batch_dim * j + i] + +#define HYPRE_THRUST_ZIP3(A, B, C) thrust::make_zip_iterator(thrust::make_tuple(A, B, C)) + +/*-------------------------------------------------------------------------- + * hypreGPUKernel_BatchedGaussJordanSolve + *--------------------------------------------------------------------------*/ + +__global__ void +__launch_bounds__(1024, 1) +hypreGPUKernel_BatchedGaussJordanSolve( hypre_DeviceItem &item, + HYPRE_Int batch_num_items, + HYPRE_Int batch_dim, + HYPRE_Complex *mat_data, + HYPRE_Complex *rhs_data, + HYPRE_Complex *sol_data ) +{ + extern __shared__ void* shmem[]; + + HYPRE_Complex *ls_data = (HYPRE_Complex*) shmem; + HYPRE_Complex *coef = (HYPRE_Complex*) (ls_data + batch_dim * (batch_dim + 1)); + HYPRE_Int *pos = (HYPRE_Int*) (coef + 2); + + HYPRE_Int tidx = threadIdx.x; + HYPRE_Int tidy = threadIdx.y; + HYPRE_Int btid = blockIdx.y * gridDim.x + blockIdx.x; + + HYPRE_Int i, k; + HYPRE_Int posA; + HYPRE_Complex coefA, coefB; + HYPRE_Complex *ptrA; + + if (btid < batch_num_items) + { + /* Shift to LS belonging to the current batch ID (btid) */ + mat_data += btid * batch_dim * batch_dim; + rhs_data += btid * batch_dim; + sol_data += btid * batch_dim; + + /* Copy matrix into shared memory */ + if (tidy < batch_dim) + { + ls_(tidx, tidy) = mat_data[tidy * batch_dim + tidx]; + } + + /* Copy RHS into shared memory */ + if (tidy == batch_dim) + { + ls_(tidx, tidy) = rhs_data[tidx]; + } + + /* Perform elimination */ + for (k = 0; k < batch_dim; k++) + { + /* Pivot computation */ + __syncthreads(); + if ((tidx < 2) && (tidy == 0)) + { + i = k + 1 + tidx; + posA = k; + ptrA = &ls_(i, k); + coefA = fabs(ls_(k, k)); + +#pragma unroll 1 + for (; i < batch_dim; i += 2) + { + coefB = fabs(*ptrA); + if (coefA < coefB) + { + coefA = coefB; + posA = i; + } + ptrA += 2; + } + pos[tidx] = posA; + coef[tidx] = coefA; + } + + /* Swap row coefficients */ + __syncthreads(); + if ((tidx == k) && (tidy >= k)) + { + posA = (coef[1] > coef[0]) ? pos[1] : pos[0]; + + coefA = ls_(posA, tidy); + ls_(posA, tidy) = ls_(tidx, tidy); + ls_(tidx, tidy) = coefA; + } + + /* Row scaling */ + __syncthreads(); + if ((tidx == k) && (tidy > k)) + { + ls_(tidx, tidy) = ls_(tidx, tidy) * (1.0 / ls_(tidx, k)); + } + + /* Row elimination */ + __syncthreads(); + if ((tidx != k) && (tidy > k)) + { + ls_(tidx, tidy) -= ls_(tidx, k) * ls_(k, tidy); + } + } + + __syncthreads(); + if (tidy == batch_dim) + { + sol_data[tidx] = ls_(tidx, batch_dim); + } + } +} + +/*-------------------------------------------------------------------- + * hypreGPUKernel_FSAIExtractSubSystems + * + * Output: + * 1) mat_data: dense matrix coefficients. + * 2) rhs_data: right hand side coefficients. + * 3) G_r: number of nonzero coefficients per row of the matrix G. + * + * TODO: + * 1) Minimize intra-warp divergence. + *--------------------------------------------------------------------*/ + +__global__ void +hypreGPUKernel_FSAIExtractSubSystems( hypre_DeviceItem &item, + HYPRE_Int num_rows, + HYPRE_Int *A_i, + HYPRE_Int *A_j, + HYPRE_Complex *A_a, + HYPRE_Int *P_i, + HYPRE_Int *P_e, + HYPRE_Int *P_j, + HYPRE_Int batch_dim, + HYPRE_Complex *mat_data, + HYPRE_Complex *rhs_data, + HYPRE_Int *G_r ) +{ + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); + HYPRE_Int i, j, jj, k; + HYPRE_Int pj, qj; + HYPRE_Int pk, qk; + HYPRE_Int A_col, P_col; + HYPRE_Complex val; + hypre_mask bitmask; + + /* Grid-stride loop over matrix rows */ + for (i = hypre_gpu_get_grid_warp_id<1, 1>(item); + i < num_rows; + i += hypre_gpu_get_grid_num_warps<1, 1>(item)) + { + /* Set identity matrix */ + for (j = lane; j < batch_dim; j += HYPRE_WARP_SIZE) + { + mat_(batch_dim, i, j, j) = 1.0; + } + + if (lane == 0) + { + pj = read_only_load(P_i + i); + qj = read_only_load(P_e + i); + } + qj = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, qj, 0, HYPRE_WARP_SIZE); + pj = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, pj, 0, HYPRE_WARP_SIZE); + + if (lane < 2) + { + pk = read_only_load(A_i + i + lane); + } + qk = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, pk, 1, HYPRE_WARP_SIZE); + pk = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, pk, 0, HYPRE_WARP_SIZE); + + /* Set right hand side vector */ + for (j = pj; j < qj; j++) + { + if (lane == 0) + { + P_col = read_only_load(P_j + j); + } + P_col = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, P_col, 0, HYPRE_WARP_SIZE); + + for (k = pk + lane; + warp_any_sync(item, HYPRE_WARP_FULL_MASK, k < qk); + k += HYPRE_WARP_SIZE) + { + if (k < qk) + { + A_col = read_only_load(A_j + k); + } + else + { + A_col = -1; + } + + bitmask = hypre_ballot_sync(item, HYPRE_WARP_FULL_MASK, A_col == P_col); + if (bitmask > 0) + { + if (lane == (hypre_ffs(bitmask) - 1)) + { + rhs_(batch_dim, i, j - pj) = - read_only_load(A_a + k); + } + break; + } + } + } + + /* Loop over requested rows */ + for (j = pj; j < qj; j++) + { + if (lane < 2) + { + pk = read_only_load(A_i + P_j[j] + lane); + } + qk = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, pk, 1, HYPRE_WARP_SIZE); + pk = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, pk, 0, HYPRE_WARP_SIZE); + + /* Visit only the lower triangular part */ + for (jj = pj; jj <= j; jj++) + { + if (lane == 0) + { + P_col = read_only_load(P_j + jj); + } + P_col = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, P_col, 0, HYPRE_WARP_SIZE); + + for (k = pk + lane; + warp_any_sync(item, HYPRE_WARP_FULL_MASK, k < qk); + k += HYPRE_WARP_SIZE) + { + if (k < qk) + { + A_col = read_only_load(A_j + k); + } + else + { + A_col = -1; + } + + bitmask = hypre_ballot_sync(item, HYPRE_WARP_FULL_MASK, A_col == P_col); + if (bitmask > 0) + { + if (lane == (hypre_ffs(bitmask) - 1)) + { + val = read_only_load(A_a + k); + mat_(batch_dim, i, j - pj, jj - pj) = val; + mat_(batch_dim, i, jj - pj, j - pj) = val; + } + break; + } + } + } + } + + /* Set number of nonzero coefficients per row of G */ + if (lane == 0) + { + G_r[i] = qj - pj + 1; + } + } /* Grid-stride loop over matrix rows */ +} + +/*-------------------------------------------------------------------- + * hypreGPUKernel_FSAIScaling + * + * TODO: unroll inner loop + * Use fma? + *--------------------------------------------------------------------*/ + +__global__ void +hypreGPUKernel_FSAIScaling( hypre_DeviceItem &item, + HYPRE_Int num_rows, + HYPRE_Int batch_dim, + HYPRE_Complex *sol_data, + HYPRE_Complex *rhs_data, + HYPRE_Complex *scaling, + HYPRE_Int *info ) +{ + HYPRE_Int i, j; + HYPRE_Complex val; + + /* Grid-stride loop over matrix rows */ + for (i = hypre_gpu_get_grid_thread_id<1, 1>(item); + i < num_rows; + i += hypre_gpu_get_grid_num_threads<1, 1>(item)) + { + val = scaling[i]; + for (j = 0; j < batch_dim; j++) + { + val += sol_(batch_dim, i, j) * rhs_(batch_dim, i, j); + } + + if (val > 0) + { + scaling[i] = 1.0 / sqrt(val); + } + else + { + scaling[i] = 1.0 / sqrt(scaling[i]); + info[i] = 1; + } + } +} + +/*-------------------------------------------------------------------- + * hypreGPUKernel_FSAIGatherEntries + * + * Output: + * 1) G_j: column indices of G_diag + * 2) G_a: coefficients of G_diag + * + * TODO: + * 1) Use a (sub-)warp per row of G + *--------------------------------------------------------------------*/ + +__global__ void +hypreGPUKernel_FSAIGatherEntries( hypre_DeviceItem &item, + HYPRE_Int num_rows, + HYPRE_Int batch_dim, + HYPRE_Complex *sol_data, + HYPRE_Complex *scaling, + HYPRE_Int *K_i, + HYPRE_Int *K_e, + HYPRE_Int *K_j, + HYPRE_Int *G_i, + HYPRE_Int *G_j, + HYPRE_Complex *G_a ) +{ + HYPRE_Int i, j; + HYPRE_Int cnt, il; + HYPRE_Int col; + HYPRE_Complex val; + + /* Grid-stride loop over matrix rows */ + for (i = hypre_gpu_get_grid_thread_id<1, 1>(item); + i < num_rows; + i += hypre_gpu_get_grid_num_threads<1, 1>(item)) + { + /* Set scaling factor */ + val = scaling[i]; + + /* Set diagonal coefficient */ + cnt = G_i[i]; + G_j[cnt] = i; + G_a[cnt] = val; + cnt++; + + /* Set off-diagonal coefficients */ + il = 0; + for (j = K_i[i]; j < K_e[i]; j++) + { + col = K_j[j]; + + G_j[cnt + il] = col; + G_a[cnt + il] = sol_(batch_dim, i, il) * val; + il++; + } + } +} + +/*-------------------------------------------------------------------- + * hypreGPUKernel_FSAITruncateCandidateOrdered + * + * Truncates the candidate pattern matrix (K). This function extracts + * lower triangular portion of the matrix up to the largest + * "max_nonzeros_row" coefficients in absolute value. + * + * Assumptions: + * 1) columns are ordered with descreasing absolute coef. values + * 2) max_nonzeros_row < warp_size. + * + * TODO: + * 1) Perform truncation with COO matrix + * 2) Use less than one warp per row when possible + *--------------------------------------------------------------------*/ + +__global__ void +hypreGPUKernel_FSAITruncateCandidateOrdered( hypre_DeviceItem &item, + HYPRE_Int max_nonzeros_row, + HYPRE_Int num_rows, + HYPRE_Int *K_i, + HYPRE_Int *K_j, + HYPRE_Complex *K_a ) +{ + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); + HYPRE_Int p = 0; + HYPRE_Int q = 0; + HYPRE_Int i, j, k, kk, cnt; + HYPRE_Int col; + hypre_mask bitmask; + HYPRE_Complex val; + HYPRE_Int max_lane; + HYPRE_Int max_idx; + HYPRE_Complex max_val; + HYPRE_Complex warp_max_val; + + /* Grid-stride loop over matrix rows */ + for (i = hypre_gpu_get_grid_warp_id<1, 1>(item); + i < num_rows; + i += hypre_gpu_get_grid_num_warps<1, 1>(item)) + { + if (lane < 2) + { + p = read_only_load(K_i + i + lane); + } + q = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 1, HYPRE_WARP_SIZE); + p = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 0, HYPRE_WARP_SIZE); + + k = 0; + while (k < max_nonzeros_row) + { + /* Initialize variables */ + j = p + k + lane; + max_val = 0.0; + max_idx = -1; + + /* Find maximum val/col pair in each lane */ + if (j < q) + { + if (K_j[j] < i) + { + max_val = abs(K_a[j]); + max_idx = j; + } + } + + for (j += HYPRE_WARP_SIZE; j < q; j += HYPRE_WARP_SIZE) + { + if (K_j[j] < i) + { + val = abs(K_a[j]); + if (val > max_val) + { + max_val = val; + max_idx = j; + } + } + } + + /* Find maximum coefficient in absolute value in the warp */ + warp_max_val = warp_allreduce_max(item, max_val); + + /* Reorder col/val entries associated with warp_max_val */ + bitmask = hypre_ballot_sync(item, HYPRE_WARP_FULL_MASK, warp_max_val == max_val); + if (warp_max_val > 0.0) + { + cnt = min(hypre_popc(bitmask), max_nonzeros_row - k); + + for (kk = 0; kk < cnt; kk++) + { + /* warp_sync(item); */ + max_lane = hypre_ffs(bitmask) - 1; + if (lane == max_lane) + { + col = K_j[p + k + kk]; + val = K_a[p + k + kk]; + + K_j[p + k + kk] = K_j[max_idx]; + K_a[p + k + kk] = max_val; + + K_j[max_idx] = col; + K_a[max_idx] = val; + } + + /* Update bitmask */ + bitmask = hypre_mask_flip_at(bitmask, max_lane); + } + + /* Update number of nonzeros per row */ + k += cnt; + } + else + { + break; + } + } + + /* Exclude remaining columns */ + for (j = p + k + lane; j < q; j += HYPRE_WARP_SIZE) + { + K_j[j] = -1; + } + } +} + +/*-------------------------------------------------------------------- + * hypreGPUKernel_FSAITruncateCandidateUnordered + * + * Truncates the candidate pattern matrix (K). This function extracts + * lower triangular portion of the matrix up to the largest + * "max_nonzeros_row" coefficients in absolute value. + * + * Assumptions: + * 1) max_nonzeros_row < warp_size. + * + * TODO: + * 1) Use less than one warp per row when possible + *--------------------------------------------------------------------*/ + +__global__ void +hypreGPUKernel_FSAITruncateCandidateUnordered( hypre_DeviceItem &item, + HYPRE_Int max_nonzeros_row, + HYPRE_Int num_rows, + HYPRE_Int *K_i, + HYPRE_Int *K_e, + HYPRE_Int *K_j, + HYPRE_Complex *K_a ) +{ + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); + HYPRE_Int p = 0; + HYPRE_Int q = 0; + HYPRE_Int ee, e, i, j, k, kk, cnt; + hypre_mask bitmask; + HYPRE_Complex val; + HYPRE_Int max_lane; + HYPRE_Int max_idx; + HYPRE_Int max_col; + HYPRE_Int colK; + HYPRE_Complex valK; + HYPRE_Complex max_val; + HYPRE_Complex warp_max_val; + + /* Grid-stride loop over matrix rows */ + for (i = hypre_gpu_get_grid_warp_id<1, 1>(item); + i < num_rows; + i += hypre_gpu_get_grid_num_warps<1, 1>(item)) + { + if (lane < 2) + { + p = read_only_load(K_i + i + lane); + } + q = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 1, HYPRE_WARP_SIZE); + p = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 0, HYPRE_WARP_SIZE); + + k = 0; + while (k < max_nonzeros_row) + { + /* Initialize variables */ + j = p + k + lane; + max_val = 0.0; + max_idx = -1; + + /* Find maximum val/col pair in each lane */ + if (j < q) + { + if (K_j[j] < i) + { + max_val = abs(K_a[j]); + max_idx = j; + } + } + + for (j += HYPRE_WARP_SIZE; j < q; j += HYPRE_WARP_SIZE) + { + if (K_j[j] < i) + { + val = abs(K_a[j]); + if (val > max_val) + { + max_val = val; + max_idx = j; + } + } + } + + /* Find maximum coefficient in absolute value in the warp */ + warp_max_val = warp_allreduce_max(item, max_val); + + /* Reorder col/val entries associated with warp_max_val */ + bitmask = hypre_ballot_sync(item, HYPRE_WARP_FULL_MASK, warp_max_val == max_val); + if (warp_max_val > 0.0) + { + cnt = min(hypre_popc(bitmask), max_nonzeros_row - k); + + for (kk = 0; kk < cnt; kk++) + { + /* warp_sync(item); */ + max_lane = hypre_ffs(bitmask) - 1; + if (lane == max_lane) + { + colK = K_j[p + k + kk]; + valK = K_a[p + k + kk]; + max_col = K_j[max_idx]; + + if (k + kk == 0) + { + K_j[p] = max_col; + K_a[p] = max_val; + + K_j[max_idx] = colK; + K_a[max_idx] = valK; + } + else + { + if (max_col > K_j[p + k + kk - 1]) + { + /* Insert from the right */ + K_j[p + k + kk] = max_col; + K_a[p + k + kk] = max_val; + + K_j[max_idx] = colK; + K_a[max_idx] = valK; + } + else if (max_col < K_j[p]) + { + /* Insert from the left */ + for (ee = k + kk; ee > 0; ee--) + { + K_j[p + ee] = K_j[p + ee - 1]; + K_a[p + ee] = K_a[p + ee - 1]; + } + + K_j[p] = max_col; + K_a[p] = max_val; + + if (max_idx > p + k + kk) + { + K_j[max_idx] = colK; + K_a[max_idx] = valK; + } + } + else + { + /* Insert in the middle */ + for (e = k + kk - 1; e >= 0; e--) + { + if (K_j[p + e] < max_col) + { + for (ee = k + kk - 1; ee > e; ee--) + { + K_j[p + ee + 1] = K_j[p + ee]; + K_a[p + ee + 1] = K_a[p + ee]; + } + + K_j[p + e + 1] = max_col; + K_a[p + e + 1] = max_val; + + if (max_idx > p + k + kk) + { + K_j[max_idx] = colK; + K_a[max_idx] = valK; + } + + break; + } + } + } + } + } + + /* Update bitmask */ + bitmask = hypre_mask_flip_at(bitmask, max_lane); + } + + /* Update number of nonzeros per row */ + k += cnt; + } + else + { + break; + } + } + + /* Set pointer to the end of this row */ + if (lane == 0) + { + K_e[i] = p + k; + } + } +} + +/*-------------------------------------------------------------------------- + * hypre_BatchedGaussJordanSolveDevice + * + * Solve dense linear systems with less than 32 unknowns via Gauss-Jordan + * elimination. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BatchedGaussJordanSolveDevice( HYPRE_Int batch_num_items, + HYPRE_Int batch_dim, + HYPRE_Complex *mat_data, + HYPRE_Complex *rhs_data, + HYPRE_Complex *sol_data ) +{ + if (batch_dim > 31) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "Error: cannot solve for local systems larger than 31."); + return hypre_error_flag; + } + + /* Assign one linear system per thread block*/ + dim3 bDim = hypre_dim3(batch_dim, batch_dim + 1, 1); + dim3 gDim = hypre_dim3(batch_num_items, 1, 1); + HYPRE_Int shared_mem_size = (sizeof(HYPRE_Complex) * ((batch_dim + 1) * batch_dim + 2) + + sizeof(HYPRE_Int) * 2); + + HYPRE_GPU_LAUNCH2(hypreGPUKernel_BatchedGaussJordanSolve, gDim, bDim, shared_mem_size, + batch_num_items, batch_dim, mat_data, rhs_data, sol_data); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_FSAIExtractSubSystemsDevice + * + * TODO (VPM): This could be a hypre_CSRMatrix routine + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAIExtractSubSystemsDevice( HYPRE_Int num_rows, + HYPRE_Int *A_i, + HYPRE_Int *A_j, + HYPRE_Complex *A_a, + HYPRE_Int *P_i, + HYPRE_Int *P_e, + HYPRE_Int *P_j, + HYPRE_Int batch_dim, + HYPRE_Complex *mat_data, + HYPRE_Complex *rhs_data, + HYPRE_Int *G_r ) +{ + /* trivial case */ + if (num_rows <= 0) + { + return hypre_error_flag; + } + + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(num_rows, "warp", bDim); + + HYPRE_GPU_LAUNCH( hypreGPUKernel_FSAIExtractSubSystems, gDim, bDim, num_rows, + A_i, A_j, A_a, P_i, P_e, P_j, batch_dim, mat_data, rhs_data, G_r ); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_FSAIScalingDevice + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAIScalingDevice( HYPRE_Int num_rows, + HYPRE_Int batch_dim, + HYPRE_Complex *sol_data, + HYPRE_Complex *rhs_data, + HYPRE_Complex *scaling, + HYPRE_Int *info ) +{ + /* trivial case */ + if (num_rows <= 0) + { + return hypre_error_flag; + } + + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(num_rows, "thread", bDim); + + HYPRE_GPU_LAUNCH( hypreGPUKernel_FSAIScaling, gDim, bDim, + num_rows, batch_dim, sol_data, rhs_data, scaling, info ); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_FSAIGatherEntriesDevice + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAIGatherEntriesDevice( HYPRE_Int num_rows, + HYPRE_Int batch_dim, + HYPRE_Complex *sol_data, + HYPRE_Complex *scaling, + HYPRE_Int *K_i, + HYPRE_Int *K_e, + HYPRE_Int *K_j, + HYPRE_Int *G_i, + HYPRE_Int *G_j, + HYPRE_Complex *G_a ) +{ + /* trivial case */ + if (num_rows <= 0) + { + return hypre_error_flag; + } + + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(num_rows, "thread", bDim); + + HYPRE_GPU_LAUNCH( hypreGPUKernel_FSAIGatherEntries, gDim, bDim, + num_rows, batch_dim, sol_data, scaling, K_i, K_e, K_j, G_i, G_j, G_a ); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_FSAITruncateCandidateDevice + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAITruncateCandidateDevice( hypre_CSRMatrix *matrix, + HYPRE_Int **matrix_e, + HYPRE_Int max_nonzeros_row ) +{ + HYPRE_Int num_rows = hypre_CSRMatrixNumRows(matrix); + HYPRE_Int *mat_i = hypre_CSRMatrixI(matrix); + HYPRE_Int *mat_j = hypre_CSRMatrixJ(matrix); + HYPRE_Complex *mat_a = hypre_CSRMatrixData(matrix); + + HYPRE_Int *mat_e; + + /* Sanity check */ + if (num_rows <= 0) + { + *matrix_e = NULL; + return hypre_error_flag; + } + + /*----------------------------------------------------- + * Keep only the largest coefficients in absolute value + *-----------------------------------------------------*/ + + /* Allocate memory for row indices array */ + hypre_GpuProfilingPushRange("Storage1"); + mat_e = hypre_TAlloc(HYPRE_Int, num_rows, HYPRE_MEMORY_DEVICE); + hypre_GpuProfilingPopRange(); + + /* Mark unwanted entries with -1 */ + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(num_rows, "warp", bDim); + + hypre_GpuProfilingPushRange("TruncCand"); + HYPRE_GPU_LAUNCH(hypreGPUKernel_FSAITruncateCandidateUnordered, gDim, bDim, + max_nonzeros_row, num_rows, mat_i, mat_e, mat_j, mat_a ); + hypre_GpuProfilingPopRange(); + + *matrix_e = mat_e; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_FSAISetupStaticPowerDevice + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAISetupStaticPowerDevice( void *fsai_vdata, + hypre_ParCSRMatrix *A, + hypre_ParVector *f, + hypre_ParVector *u ) +{ + HYPRE_UNUSED_VAR(f); + HYPRE_UNUSED_VAR(u); + + hypre_ParFSAIData *fsai_data = (hypre_ParFSAIData*) fsai_vdata; + hypre_ParCSRMatrix *G = hypre_ParFSAIDataGmat(fsai_data); + hypre_CSRMatrix *G_diag = hypre_ParCSRMatrixDiag(G); + HYPRE_Int local_solve_type = hypre_ParFSAIDataLocalSolveType(fsai_data); + HYPRE_Int max_nnz_row = hypre_ParFSAIDataMaxNnzRow(fsai_data); + HYPRE_Int num_levels = hypre_ParFSAIDataNumLevels(fsai_data); + HYPRE_Real threshold = hypre_ParFSAIDataThreshold(fsai_data); + + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + HYPRE_Int num_rows = hypre_CSRMatrixNumRows(A_diag); + HYPRE_Int block_size = max_nnz_row * max_nnz_row; + HYPRE_Int num_nonzeros_G; + + HYPRE_Complex **sol_aop = NULL; + HYPRE_Complex **mat_aop = NULL; + + hypre_ParCSRMatrix *Atilde; + hypre_ParCSRMatrix *B; + hypre_ParCSRMatrix *Ktilde; + hypre_CSRMatrix *K_diag; + HYPRE_Int *K_e = NULL; + HYPRE_Int i; + + /* Local linear solve data */ +#if defined (HYPRE_USING_MAGMA) + magma_queue_t queue = hypre_HandleMagmaQueue(hypre_handle()); +#endif + +#if defined (HYPRE_USING_CUSOLVER) || defined (HYPRE_USING_ROCSOLVER) + vendorSolverHandle_t vs_handle = hypre_HandleVendorSolverHandle(hypre_handle()); +#endif + + /* TODO: Move to fsai_data? */ + HYPRE_Complex *scaling; + HYPRE_Int *info; + HYPRE_Int *h_info; + + /* Error code array for FSAI */ + info = hypre_CTAlloc(HYPRE_Int, num_rows, HYPRE_MEMORY_DEVICE); + h_info = hypre_TAlloc(HYPRE_Int, num_rows, HYPRE_MEMORY_HOST); + + /*----------------------------------------------------- + * Sanity checks + *-----------------------------------------------------*/ + + /* Check local linear solve algorithm */ + if (local_solve_type == 1) + { +#if !(defined (HYPRE_USING_CUSOLVER) || defined(HYPRE_USING_ROCSOLVER)) + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "local_solve_type == 1 requires cuSOLVER (CUDA) or rocSOLVER (HIP)\n"); + return hypre_error_flag; +#endif + } + else if (local_solve_type == 2) + { +#if !defined (HYPRE_USING_MAGMA) + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "local_solve_type == 2 requires MAGMA\n"); + return hypre_error_flag; +#endif + } + else if (local_solve_type == 0) + { + if (max_nnz_row > 31) + { + hypre_ParFSAIDataMaxNnzRow(fsai_data) = max_nnz_row = 31; + } + } + else + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown local linear solve type!\n"); + return hypre_error_flag; + } + + /*----------------------------------------------------- + * Compute candidate pattern + *-----------------------------------------------------*/ + + hypre_GpuProfilingPushRange("CandPat"); + + /* Compute filtered version of A */ + Atilde = hypre_ParCSRMatrixClone(A, 1); + + /* Pre-filter to reduce SpGEMM cost */ + if (num_levels > 1) + { + hypre_ParCSRMatrixDropSmallEntriesDevice(Atilde, threshold, 2); + } + + /* TODO: Check if Atilde is diagonal */ + + /* Compute power pattern */ + switch (num_levels) + { + case 1: + Ktilde = Atilde; + break; + + case 2: + Ktilde = hypre_ParCSRMatMatDevice(Atilde, Atilde); + break; + + case 3: + /* First pass */ + B = hypre_ParCSRMatMatDevice(Atilde, Atilde); + + /* Second pass */ + Ktilde = hypre_ParCSRMatMatDevice(Atilde, B); + hypre_ParCSRMatrixDestroy(B); + break; + + case 4: + /* First pass */ + B = hypre_ParCSRMatMatDevice(Atilde, Atilde); + hypre_ParCSRMatrixDropSmallEntriesDevice(B, threshold, 2); + + /* Second pass */ + Ktilde = hypre_ParCSRMatMatDevice(B, B); + hypre_ParCSRMatrixDestroy(B); + break; + + default: + Ktilde = hypre_ParCSRMatrixClone(Atilde, 1); + for (i = 1; i < num_levels; i++) + { + /* Compute temporary matrix */ + B = hypre_ParCSRMatMatDevice(Atilde, Ktilde); + + /* Update resulting matrix */ + hypre_ParCSRMatrixDestroy(Ktilde); + Ktilde = hypre_ParCSRMatrixClone(B, 1); + } + } + + hypre_GpuProfilingPopRange(); + + /*----------------------------------------------------- + * Filter candidate pattern + *-----------------------------------------------------*/ + + hypre_GpuProfilingPushRange("FilterPat"); + +#if defined (DEBUG_FSAI) + { + hypre_ParCSRMatrixPrintIJ(Ktilde, 0, 0, "FSAI.out.H.ij"); + } +#endif + + /* Set pattern matrix diagonal matrix */ + K_diag = hypre_ParCSRMatrixDiag(Ktilde); + + /* Filter candidate pattern */ + hypre_FSAITruncateCandidateDevice(K_diag, &K_e, max_nnz_row); + +#if defined (DEBUG_FSAI) + { + hypre_ParCSRMatrixPrintIJ(Ktilde, 0, 0, "FSAI.out.K.ij"); + } +#endif + + hypre_GpuProfilingPopRange(); + + /*----------------------------------------------------- + * Preprocess input matrix + *-----------------------------------------------------*/ + + hypre_GpuProfilingPushRange("PreProcessA"); + + /* TODO: implement faster diagonal extraction (use "i == A_j[A_i[i]]")*/ + scaling = hypre_TAlloc(HYPRE_Complex, num_rows, HYPRE_MEMORY_DEVICE); + hypre_CSRMatrixExtractDiagonalDevice(A_diag, scaling, 0); + + hypre_GpuProfilingPopRange(); + + /*----------------------------------------------------- + * Extract local linear systems + *-----------------------------------------------------*/ + + /* Allocate storage */ + hypre_GpuProfilingPushRange("Storage1"); + HYPRE_Complex *mat_data = hypre_CTAlloc(HYPRE_Complex, + block_size * num_rows, + HYPRE_MEMORY_DEVICE); + HYPRE_Complex *rhs_data = hypre_CTAlloc(HYPRE_Complex, max_nnz_row * num_rows, + HYPRE_MEMORY_DEVICE); + HYPRE_Complex *sol_data = hypre_CTAlloc(HYPRE_Complex, max_nnz_row * num_rows, + HYPRE_MEMORY_DEVICE); + hypre_GpuProfilingPopRange(); + + /* Gather dense linear subsystems */ + hypre_GpuProfilingPushRange("ExtractLS"); + hypre_FSAIExtractSubSystemsDevice(num_rows, + hypre_CSRMatrixI(A_diag), + hypre_CSRMatrixJ(A_diag), + hypre_CSRMatrixData(A_diag), + hypre_CSRMatrixI(K_diag), + K_e, + hypre_CSRMatrixJ(K_diag), + max_nnz_row, + mat_data, + rhs_data, + hypre_CSRMatrixI(G_diag) + 1); + hypre_GpuProfilingPopRange(); + + /* Copy rhs to solution vector */ + hypre_GpuProfilingPushRange("CopyRHS"); + hypre_TMemcpy(sol_data, rhs_data, HYPRE_Complex, max_nnz_row * num_rows, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + hypre_GpuProfilingPopRange(); + + /* Build array of pointers */ + if (local_solve_type != 0) + { + hypre_GpuProfilingPushRange("Storage2"); + sol_aop = hypre_TAlloc(HYPRE_Complex *, num_rows, HYPRE_MEMORY_DEVICE); + mat_aop = hypre_TAlloc(HYPRE_Complex *, num_rows, HYPRE_MEMORY_DEVICE); + hypre_GpuProfilingPopRange(); + + hypre_GpuProfilingPushRange("FormAOP"); + hypreDevice_ComplexArrayToArrayOfPtrs(num_rows, block_size, mat_data, mat_aop); + hypreDevice_ComplexArrayToArrayOfPtrs(num_rows, max_nnz_row, sol_data, sol_aop); + hypre_GpuProfilingPopRange(); + } + + /*----------------------------------------------------- + * Solve local linear systems + *-----------------------------------------------------*/ + + hypre_GpuProfilingPushRange("BatchedSolve"); + if (num_rows) + { + hypre_GpuProfilingPushRange("Factorization"); + + if (local_solve_type == 1) + { +#if defined (HYPRE_USING_CUSOLVER) + HYPRE_CUSOLVER_CALL(cusolverDnDpotrfBatched(vs_handle, + CUBLAS_FILL_MODE_LOWER, + max_nnz_row, + mat_aop, + max_nnz_row, + info, + num_rows)); + +#elif defined (HYPRE_USING_ROCSOLVER) + HYPRE_ROCSOLVER_CALL(rocsolver_dpotrf_batched(vs_handle, + rocblas_fill_lower, + max_nnz_row, + mat_aop, + max_nnz_row, + info, + num_rows)); +#endif + } + else if (local_solve_type == 2) + { +#if defined (HYPRE_USING_MAGMA) + HYPRE_MAGMA_CALL(magma_dpotrf_batched(MagmaLower, + max_nnz_row, + mat_aop, + max_nnz_row, + info, + num_rows, + queue)); +#endif + } + hypre_GpuProfilingPopRange(); /* Factorization */ + +#if defined (HYPRE_DEBUG) + hypre_TMemcpy(h_info, info, HYPRE_Int, num_rows, + HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); + for (HYPRE_Int k = 0; k < num_rows; k++) + { + if (h_info[k] != 0) + { + hypre_printf("Cholesky factorization failed at system #%d, subrow %d\n", + k, h_info[k]); + } + } +#endif + + hypre_GpuProfilingPushRange("Solve"); + + if (local_solve_type == 0) + { + hypre_BatchedGaussJordanSolveDevice(num_rows, max_nnz_row, mat_data, rhs_data, sol_data); + } + else if (local_solve_type == 1) + { +#if defined (HYPRE_USING_CUSOLVER) + HYPRE_CUSOLVER_CALL(cusolverDnDpotrsBatched(vs_handle, + CUBLAS_FILL_MODE_LOWER, + max_nnz_row, + 1, + mat_aop, + max_nnz_row, + sol_aop, + max_nnz_row, + info, + num_rows)); +#elif defined (HYPRE_USING_ROCSOLVER) + HYPRE_ROCSOLVER_CALL(rocsolver_dpotrs_batched(vs_handle, + rocblas_fill_lower, + max_nnz_row, + 1, + mat_aop, + max_nnz_row, + sol_aop, + max_nnz_row, + num_rows)); +#endif + } + else if (local_solve_type == 2) + { +#if defined (HYPRE_USING_MAGMA) + HYPRE_MAGMA_CALL(magma_dpotrs_batched(MagmaLower, + max_nnz_row, + 1, + mat_aop, + max_nnz_row, + sol_aop, + max_nnz_row, + num_rows, + queue)); +#endif + } + hypre_GpuProfilingPopRange(); /* Solve */ + +#if defined (HYPRE_DEBUG) + hypre_TMemcpy(h_info, info, HYPRE_Int, num_rows, + HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); + for (HYPRE_Int k = 0; k < num_rows; k++) + { + if (h_info[k] != 0) + { + hypre_printf("Cholesky solution failed at system #%d with code %d\n", + k, h_info[k]); + } + } +#endif + } + hypre_GpuProfilingPopRange(); /* BatchedSolve */ + + /*----------------------------------------------------- + * Finalize construction of the triangular factor + *-----------------------------------------------------*/ + + hypre_GpuProfilingPushRange("BuildFSAI"); + + /* Update scaling factor */ + hypre_FSAIScalingDevice(num_rows, max_nnz_row, sol_data, rhs_data, scaling, info); + + /* Compute the row pointer G_i */ + hypreDevice_IntegerInclusiveScan(num_rows + 1, hypre_CSRMatrixI(G_diag)); + + /* Get the actual number of nonzero coefficients of G_diag */ + hypre_TMemcpy(&num_nonzeros_G, hypre_CSRMatrixI(G_diag) + num_rows, + HYPRE_Int, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); + + /* Update the nonzero count of matrix G */ + hypre_CSRMatrixNumNonzeros(G_diag) = num_nonzeros_G; + + /* Set column indices and coefficients of G */ + hypre_FSAIGatherEntriesDevice(num_rows, + max_nnz_row, + sol_data, + scaling, + hypre_CSRMatrixI(K_diag), + K_e, + hypre_CSRMatrixJ(K_diag), + hypre_CSRMatrixI(G_diag), + hypre_CSRMatrixJ(G_diag), + hypre_CSRMatrixData(G_diag)); + + hypre_GpuProfilingPopRange(); + /* TODO: Reallocate memory for G_j/G_a? */ + + /*----------------------------------------------------- + * Free memory + *-----------------------------------------------------*/ + + hypre_ParCSRMatrixDestroy(Ktilde); + if (num_levels > 1) + { + hypre_ParCSRMatrixDestroy(Atilde); + } + + /* TODO: can we free some of these earlier? */ + hypre_TFree(K_e, HYPRE_MEMORY_DEVICE); + hypre_TFree(rhs_data, HYPRE_MEMORY_DEVICE); + hypre_TFree(sol_data, HYPRE_MEMORY_DEVICE); + hypre_TFree(mat_data, HYPRE_MEMORY_DEVICE); + hypre_TFree(sol_aop, HYPRE_MEMORY_DEVICE); + hypre_TFree(mat_aop, HYPRE_MEMORY_DEVICE); + hypre_TFree(scaling, HYPRE_MEMORY_DEVICE); + hypre_TFree(info, HYPRE_MEMORY_DEVICE); + hypre_TFree(h_info, HYPRE_MEMORY_HOST); + + return hypre_error_flag; +} + +#endif /* if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) */ +#if defined(HYPRE_USING_GPU) + +/*-------------------------------------------------------------------------- + * hypre_FSAISetupDevice + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAISetupDevice( void *fsai_vdata, + hypre_ParCSRMatrix *A, + hypre_ParVector *f, + hypre_ParVector *u ) +{ + hypre_ParFSAIData *fsai_data = (hypre_ParFSAIData*) fsai_vdata; + HYPRE_Int algo_type = hypre_ParFSAIDataAlgoType(fsai_data); + hypre_ParCSRMatrix *G = hypre_ParFSAIDataGmat(fsai_data); + hypre_ParCSRMatrix *h_A; + + hypre_GpuProfilingPushRange("FSAISetup"); + + if (algo_type == 1 || algo_type == 2) + { + /* Initialize matrix G on host */ + hypre_ParCSRMatrixInitialize_v2(G, HYPRE_MEMORY_HOST); + + /* Clone input matrix on host */ + h_A = hypre_ParCSRMatrixClone_v2(A, 1, HYPRE_MEMORY_HOST); + + /* Compute FSAI factor on host */ + switch (algo_type) + { + case 2: + hypre_FSAISetupOMPDyn(fsai_vdata, h_A, f, u); + break; + + default: + hypre_FSAISetupNative(fsai_vdata, h_A, f, u); + break; + } + + /* Move FSAI factor G to device */ + hypre_ParCSRMatrixMigrate(G, HYPRE_MEMORY_DEVICE); + + /* Destroy temporary data on host */ + HYPRE_ParCSRMatrixDestroy(h_A); + } + else + { +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + /* Initialize matrix G on device */ + hypre_ParCSRMatrixInitialize_v2(G, HYPRE_MEMORY_DEVICE); + + if (algo_type == 3) + { + hypre_FSAISetupStaticPowerDevice(fsai_vdata, A, f, u); + } +#else + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Device FSAI not implemented for SYCL!\n"); +#endif + } + + hypre_GpuProfilingPopRange(); + + return hypre_error_flag; +} + +#endif /* if defined(HYPRE_USING_GPU) */ diff --git a/external/hypre/src/parcsr_ls/par_fsai_setup.c b/external/hypre/src/parcsr_ls/par_fsai_setup.c new file mode 100644 index 00000000..f58df3e7 --- /dev/null +++ b/external/hypre/src/parcsr_ls/par_fsai_setup.c @@ -0,0 +1,1357 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#include "_hypre_parcsr_ls.h" +#include "_hypre_blas.h" +#include "_hypre_lapack.h" + +/***************************************************************************** + * + * Routine for driving the setup phase of FSAI + * + ******************************************************************************/ + +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixExtractDenseMat + * + * Extract A[P, P] into a dense matrix. + * + * Parameters: + * - A: The hypre_CSRMatrix whose submatrix will be extracted. + * - A_sub: A patt_size^2 - sized array to hold the lower triangular of + * the symmetric submatrix A[P, P]. + * - pattern: A patt_size - sized array to hold the wanted rows/cols. + * - marker: A work array of length equal to the number of columns in A. + * All values should be -1. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixExtractDenseMat( hypre_CSRMatrix *A, + hypre_Vector *A_sub, + HYPRE_Int *pattern, + HYPRE_Int patt_size, + HYPRE_Int *marker ) +{ + HYPRE_Int *A_i = hypre_CSRMatrixI(A); + HYPRE_Int *A_j = hypre_CSRMatrixJ(A); + HYPRE_Complex *A_a = hypre_CSRMatrixData(A); + HYPRE_Complex *A_sub_data = hypre_VectorData(A_sub); + + /* Local variables */ + HYPRE_Int cc, i, ii, j; + + // TODO: Do we need to reinitialize all entries? + for (i = 0; i < hypre_VectorSize(A_sub); i++) + { + A_sub_data[i] = 0.0; + } + + for (i = 0; i < patt_size; i++) + { + ii = pattern[i]; + for (j = A_i[ii]; j < A_i[ii + 1]; j++) + { + if ((A_j[j] <= ii) && + (cc = marker[A_j[j]]) >= 0) + { + A_sub_data[cc * patt_size + i] = A_a[j]; + } + } + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixExtractDenseRow + * + * Extract the dense subrow from a matrix (A[i, P]) + * + * Parameters: + * - A: The hypre_CSRMatrix whose subrow will be extracted. + * - A_subrow: The extracted subrow of A[i, P]. + * - marker: A work array of length equal to the number of row in A. + * Assumed to be set to all -1. + * - row_num: which row index of A we want to extract data from. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixExtractDenseRow( hypre_CSRMatrix *A, + hypre_Vector *A_subrow, + HYPRE_Int *marker, + HYPRE_Int row_num ) +{ + HYPRE_Int *A_i = hypre_CSRMatrixI(A); + HYPRE_Int *A_j = hypre_CSRMatrixJ(A); + HYPRE_Complex *A_a = hypre_CSRMatrixData(A); + HYPRE_Complex *sub_row_data = hypre_VectorData(A_subrow); + + /* Local variables */ + HYPRE_Int j, cc; + + for (j = 0; j < hypre_VectorSize(A_subrow); j++) + { + sub_row_data[j] = 0.0; + } + + for (j = A_i[row_num]; j < A_i[row_num + 1]; j++) + { + if ((cc = marker[A_j[j]]) >= 0) + { + sub_row_data[cc] = A_a[j]; + } + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_FindKapGrad + * + * Finding the Kaporin Gradient contribution (psi) of a given row. + * + * Parameters: + * - A: CSR matrix diagonal of A. + * - kap_grad: Array holding the kaporin gradient. + * This will we modified. + * - kg_pos: Array of the nonzero column indices of kap_grad. + * To be modified. + * - G_temp: Work array of G for row i. + * - pattern: Array of column indices of the nonzeros of G_temp. + * - patt_size: Number of column indices of the nonzeros of G_temp. + * - max_row_size: To ensure we don't overfill kap_grad. + * - row_num: Which row of G we are working on. + * - marker: Array of length equal to the number of rows in A. + * Assumed to all be set to -1. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FindKapGrad( hypre_CSRMatrix *A_diag, + hypre_Vector *kap_grad, + HYPRE_Int *kg_pos, + hypre_Vector *G_temp, + HYPRE_Int *pattern, + HYPRE_Int patt_size, + HYPRE_Int max_row_size, + HYPRE_Int row_num, + HYPRE_Int *kg_marker ) +{ + HYPRE_UNUSED_VAR(max_row_size); + + HYPRE_Int *A_i = hypre_CSRMatrixI(A_diag); + HYPRE_Int *A_j = hypre_CSRMatrixJ(A_diag); + HYPRE_Complex *A_a = hypre_CSRMatrixData(A_diag); + HYPRE_Complex *G_temp_data = hypre_VectorData(G_temp); + HYPRE_Complex *kap_grad_data = hypre_VectorData(kap_grad); + + /* Local Variables */ + HYPRE_Int i, ii, j, k, count, col; + + count = 0; + + /* Compute A[row_num, 0:(row_num-1)]*G_temp[i,i] */ + for (j = A_i[row_num]; j < A_i[row_num + 1]; j++) + { + col = A_j[j]; + if (col < row_num) + { + if (kg_marker[col] > -1) + { + /* Add A[row_num, col] to the tentative pattern */ + kg_marker[col] = count + 1; + kg_pos[count] = col; + kap_grad_data[count] = A_a[j]; + count++; + } + } + } + + /* Compute A[0:(row_num-1), P]*G_temp[P, i] */ + for (i = 0; i < patt_size; i++) + { + ii = pattern[i]; + for (j = A_i[ii]; j < A_i[ii + 1]; j++) + { + col = A_j[j]; + if (col < row_num) + { + k = kg_marker[col]; + if (k == 0) + { + /* New entry in the tentative pattern */ + kg_marker[col] = count + 1; + kg_pos[count] = col; + kap_grad_data[count] = G_temp_data[i] * A_a[j]; + count++; + } + else if (k > 0) + { + /* Already existing entry in the tentative pattern */ + kap_grad_data[k - 1] += G_temp_data[i] * A_a[j]; + } + } + } + } + + /* Update number of nonzero coefficients held in kap_grad */ + hypre_VectorSize(kap_grad) = count; + + /* Update to absolute values */ + for (i = 0; i < count; i++) + { + kap_grad_data[i] = hypre_cabs(kap_grad_data[i]); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_swap2_ci + *--------------------------------------------------------------------------*/ + +void +hypre_swap2_ci( HYPRE_Complex *v, + HYPRE_Int *w, + HYPRE_Int i, + HYPRE_Int j ) +{ + HYPRE_Complex temp; + HYPRE_Int temp2; + + temp = v[i]; + v[i] = v[j]; + v[j] = temp; + temp2 = w[i]; + w[i] = w[j]; + w[j] = temp2; +} + +/*-------------------------------------------------------------------------- + * hypre_qsort2_ci + * + * Quick Sort (largest to smallest) for complex arrays. + * Sort on real portion of v (HYPRE_Complex), move w. + *--------------------------------------------------------------------------*/ + +void +hypre_qsort2_ci( HYPRE_Complex *v, + HYPRE_Int *w, + HYPRE_Int left, + HYPRE_Int right ) +{ + HYPRE_Int i, last; + + if (left >= right) + { + return; + } + + hypre_swap2_ci(v, w, left, (left + right) / 2); + last = left; + for (i = left + 1; i <= right; i++) + { + if (hypre_creal(v[i]) > hypre_creal(v[left])) + { + hypre_swap2_ci(v, w, ++last, i); + } + } + + hypre_swap2_ci(v, w, left, last); + hypre_qsort2_ci(v, w, left, last - 1); + hypre_qsort2_ci(v, w, last + 1, right); +} + +/*-------------------------------------------------------------------------- + * hypre_PartialSelectSortCI + *--------------------------------------------------------------------------*/ +HYPRE_Int +hypre_PartialSelectSortCI( HYPRE_Complex *v, + HYPRE_Int *w, + HYPRE_Int size, + HYPRE_Int nentries ) +{ + HYPRE_Int i, k, pos; + + for (k = 0; k < nentries; k++) + { + /* Find largest kth entry */ + pos = k; + for (i = k + 1; i < size; i++) + { + if (hypre_creal(v[i]) > hypre_creal(v[pos])) + { + pos = i; + } + } + + /* Move entry to beggining of the array */ + hypre_swap2_ci(v, w, k, pos); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_AddToPattern + * + * Take the largest elements from the kaporin gradient and add their + * locations to pattern. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AddToPattern( hypre_Vector *kap_grad, + HYPRE_Int *kg_pos, + HYPRE_Int *pattern, + HYPRE_Int *patt_size, + HYPRE_Int *kg_marker, + HYPRE_Int max_step_size ) +{ + HYPRE_Int kap_grad_size = hypre_VectorSize(kap_grad); + HYPRE_Complex *kap_grad_data = hypre_VectorData(kap_grad); + + HYPRE_Int i, nentries; + + /* Number of entries that can be added */ + nentries = hypre_min(kap_grad_size, max_step_size); + + /* Reorder candidates according to larger weights */ + //hypre_qsort2_ci(kap_grad_data, &kg_pos, 0, kap_grad_size-1); + hypre_PartialSelectSortCI(kap_grad_data, kg_pos, kap_grad_size, nentries); + + /* Update pattern with new entries */ + for (i = 0; i < nentries; i++) + { + pattern[*patt_size + i] = kg_pos[i]; + } + *patt_size += nentries; + + /* Put pattern in ascending order */ + hypre_qsort0(pattern, 0, (*patt_size) - 1); + + /* Reset marked entries that are added to pattern */ + for (i = 0; i < nentries; i++) + { + kg_marker[kg_pos[i]] = -1; + } + for (i = nentries; i < kap_grad_size; i++) + { + kg_marker[kg_pos[i]] = 0; + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_DenseSPDSystemSolve + * + * Solve the dense SPD linear system with LAPACK: + * + * mat*lhs = -rhs + * + * Note: the contents of A change to its Cholesky factor. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_DenseSPDSystemSolve( hypre_Vector *mat, + hypre_Vector *rhs, + hypre_Vector *lhs ) +{ + HYPRE_Int size = hypre_VectorSize(rhs); + HYPRE_Complex *mat_data = hypre_VectorData(mat); + HYPRE_Complex *rhs_data = hypre_VectorData(rhs); + HYPRE_Complex *lhs_data = hypre_VectorData(lhs); + + /* Local variables */ + HYPRE_Int num_rhs = 1; + char uplo = 'L'; + char msg[512]; + HYPRE_Int i, info; + + /* Copy RHS into LHS */ + for (i = 0; i < size; i++) + { + lhs_data[i] = -rhs_data[i]; + } + + /* Compute Cholesky factor */ + hypre_dpotrf(&uplo, &size, mat_data, &size, &info); + if (info) + { + hypre_sprintf(msg, "Error: dpotrf failed with code %d\n", info); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, msg); + return hypre_error_flag; + } + + /* Solve dense linear system */ + hypre_dpotrs(&uplo, &size, &num_rhs, mat_data, &size, lhs_data, &size, &info); + if (info) + { + hypre_sprintf(msg, "Error: dpotrs failed with code %d\n", info); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, msg); + return hypre_error_flag; + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_FSAISetupNative + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAISetupNative( void *fsai_vdata, + hypre_ParCSRMatrix *A, + hypre_ParVector *f, + hypre_ParVector *u ) +{ + HYPRE_UNUSED_VAR(f); + HYPRE_UNUSED_VAR(u); + + /* Data structure variables */ + hypre_ParFSAIData *fsai_data = (hypre_ParFSAIData*) fsai_vdata; + HYPRE_Real kap_tolerance = hypre_ParFSAIDataKapTolerance(fsai_data); + HYPRE_Int max_steps = hypre_ParFSAIDataMaxSteps(fsai_data); + HYPRE_Int max_step_size = hypre_ParFSAIDataMaxStepSize(fsai_data); + + /* CSRMatrix A_diag variables */ + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + HYPRE_Int *A_i = hypre_CSRMatrixI(A_diag); + HYPRE_Complex *A_a = hypre_CSRMatrixData(A_diag); + HYPRE_Int num_rows_diag_A = hypre_CSRMatrixNumRows(A_diag); + + /* Matrix G variables */ + hypre_ParCSRMatrix *G = hypre_ParFSAIDataGmat(fsai_data); + hypre_CSRMatrix *G_diag; + HYPRE_Int *G_i; + HYPRE_Int *G_j; + HYPRE_Complex *G_a; + HYPRE_Int max_nnzrow_diag_G; /* Max. number of nonzeros per row in G_diag */ + + /* Local variables */ + char msg[512]; /* Warning message */ + HYPRE_Int *twspace; /* shared work space for omp threads */ + + /* Initalize some variables */ + max_nnzrow_diag_G = max_steps * max_step_size + 1; + + G_diag = hypre_ParCSRMatrixDiag(G); + G_a = hypre_CSRMatrixData(G_diag); + G_i = hypre_CSRMatrixI(G_diag); + G_j = hypre_CSRMatrixJ(G_diag); + + /* Allocate shared work space array for OpenMP threads */ + twspace = hypre_CTAlloc(HYPRE_Int, hypre_NumThreads() + 1, HYPRE_MEMORY_HOST); + + /********************************************************************** + * Start of Adaptive FSAI algorithm + ***********************************************************************/ + + /* Cycle through each of the local rows */ + HYPRE_ANNOTATE_REGION_BEGIN("%s", "MainLoop"); +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel +#endif + { + hypre_Vector *G_temp; /* Vector holding the values of G[i,:] */ + hypre_Vector *A_sub; /* Vector holding the dense submatrix A[P, P] */ + hypre_Vector *A_subrow; /* Vector holding A[i, P] */ + hypre_Vector *kap_grad; /* Vector holding the Kaporin gradient values */ + HYPRE_Int *kg_pos; /* Indices of nonzero entries of kap_grad */ + HYPRE_Int *kg_marker; /* Marker array with nonzeros pointing to kg_pos */ + HYPRE_Int *marker; /* Marker array with nonzeros pointing to P */ + HYPRE_Int *pattern; /* Array holding column indices of G[i,:] */ + HYPRE_Int patt_size; /* Number of entries in current pattern */ + HYPRE_Int patt_size_old; /* Number of entries in previous pattern */ + HYPRE_Int ii; /* Thread identifier */ + HYPRE_Int num_threads; /* Number of active threads */ + HYPRE_Int ns, ne; /* Initial and last row indices */ + HYPRE_Int i, j, k, iloc; /* Loop variables */ + HYPRE_Complex old_psi; /* GAG' before k-th interation of aFSAI */ + HYPRE_Complex new_psi; /* GAG' after k-th interation of aFSAI */ + HYPRE_Complex row_scale; /* Scaling factor for G_temp */ + HYPRE_Complex *G_temp_data; + HYPRE_Complex *A_subrow_data; + + HYPRE_Int num_rows_Gloc; + HYPRE_Int num_nnzs_Gloc; + HYPRE_Int *Gloc_i; + HYPRE_Int *Gloc_j; + HYPRE_Complex *Gloc_a; + + /* Allocate and initialize local vector variables */ + G_temp = hypre_SeqVectorCreate(max_nnzrow_diag_G); + A_subrow = hypre_SeqVectorCreate(max_nnzrow_diag_G); + kap_grad = hypre_SeqVectorCreate(num_rows_diag_A); + A_sub = hypre_SeqVectorCreate(max_nnzrow_diag_G * max_nnzrow_diag_G); + pattern = hypre_CTAlloc(HYPRE_Int, max_nnzrow_diag_G, HYPRE_MEMORY_HOST); + kg_pos = hypre_CTAlloc(HYPRE_Int, num_rows_diag_A, HYPRE_MEMORY_HOST); + kg_marker = hypre_CTAlloc(HYPRE_Int, num_rows_diag_A, HYPRE_MEMORY_HOST); + marker = hypre_TAlloc(HYPRE_Int, num_rows_diag_A, HYPRE_MEMORY_HOST); + + hypre_SeqVectorInitialize_v2(G_temp, HYPRE_MEMORY_HOST); + hypre_SeqVectorInitialize_v2(A_subrow, HYPRE_MEMORY_HOST); + hypre_SeqVectorInitialize_v2(kap_grad, HYPRE_MEMORY_HOST); + hypre_SeqVectorInitialize_v2(A_sub, HYPRE_MEMORY_HOST); + hypre_Memset(marker, -1, num_rows_diag_A * sizeof(HYPRE_Int), HYPRE_MEMORY_HOST); + + /* Setting data variables for vectors */ + G_temp_data = hypre_VectorData(G_temp); + A_subrow_data = hypre_VectorData(A_subrow); + + ii = hypre_GetThreadNum(); + num_threads = hypre_NumActiveThreads(); + hypre_partition1D(num_rows_diag_A, num_threads, ii, &ns, &ne); + + num_rows_Gloc = ne - ns; + if (num_threads == 1) + { + Gloc_i = G_i; + Gloc_j = G_j; + Gloc_a = G_a; + } + else + { + num_nnzs_Gloc = num_rows_Gloc * max_nnzrow_diag_G; + + Gloc_i = hypre_CTAlloc(HYPRE_Int, num_rows_Gloc + 1, HYPRE_MEMORY_HOST); + Gloc_j = hypre_CTAlloc(HYPRE_Int, num_nnzs_Gloc, HYPRE_MEMORY_HOST); + Gloc_a = hypre_CTAlloc(HYPRE_Complex, num_nnzs_Gloc, HYPRE_MEMORY_HOST); + } + + for (i = ns; i < ne; i++) + { + patt_size = 0; + + /* Set old_psi up front so we don't have to compute GAG' twice in the inner for-loop */ + new_psi = old_psi = A_a[A_i[i]]; + + /* Cycle through each iteration for that row */ + for (k = 0; k < max_steps; k++) + { + /* Compute Kaporin Gradient */ + hypre_FindKapGrad(A_diag, kap_grad, kg_pos, G_temp, pattern, + patt_size, max_nnzrow_diag_G, i, kg_marker); + + /* Find max_step_size largest values of the kaporin gradient, + find their column indices, and add it to pattern */ + patt_size_old = patt_size; + hypre_AddToPattern(kap_grad, kg_pos, pattern, &patt_size, + kg_marker, max_step_size); + + /* Update sizes */ + hypre_VectorSize(A_sub) = patt_size * patt_size; + hypre_VectorSize(A_subrow) = patt_size; + hypre_VectorSize(G_temp) = patt_size; + + if (patt_size == patt_size_old) + { + new_psi = old_psi; + break; + } + else + { + /* Gather A[P, P] and -A[i, P] */ + for (j = 0; j < patt_size; j++) + { + marker[pattern[j]] = j; + } + hypre_CSRMatrixExtractDenseMat(A_diag, A_sub, pattern, patt_size, marker); + hypre_CSRMatrixExtractDenseRow(A_diag, A_subrow, marker, i); + + /* Solve A[P, P] G[i, P]' = -A[i, P] */ + hypre_DenseSPDSystemSolve(A_sub, A_subrow, G_temp); + + /* Determine psi_{k+1} = G_temp[i] * A[P, P] * G_temp[i]' */ + new_psi = A_a[A_i[i]]; + for (j = 0; j < patt_size; j++) + { + new_psi += G_temp_data[j] * A_subrow_data[j]; + } + + /* Check psi reduction */ + if (hypre_cabs(new_psi - old_psi) < hypre_creal(kap_tolerance * old_psi)) + { + break; + } + else + { + old_psi = new_psi; + } + } + } + + /* Reset marker for building dense linear system */ + for (j = 0; j < patt_size; j++) + { + marker[pattern[j]] = -1; + } + + /* Compute scaling factor */ + if (hypre_creal(new_psi) > 0 && hypre_cimag(new_psi) == 0) + { + row_scale = 1.0 / hypre_csqrt(new_psi); + } + else + { + hypre_sprintf(msg, "Warning: complex scaling factor found in row %d\n", i); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, msg); + + row_scale = 1.0 / hypre_cabs(A_a[A_i[i]]); + hypre_VectorSize(G_temp) = patt_size = 0; + } + + /* Pass values of G_temp into G */ + iloc = i - ns; + Gloc_j[Gloc_i[iloc]] = i; + Gloc_a[Gloc_i[iloc]] = row_scale; + for (k = 0; k < patt_size; k++) + { + j = Gloc_i[iloc] + k + 1; + Gloc_j[j] = pattern[k]; + Gloc_a[j] = row_scale * G_temp_data[k]; + kg_marker[pattern[k]] = 0; + } + Gloc_i[iloc + 1] = Gloc_i[iloc] + k + 1; + } + + /* Copy data to shared memory */ + twspace[ii + 1] = Gloc_i[num_rows_Gloc] - Gloc_i[0]; +#ifdef HYPRE_USING_OPENMP + #pragma omp barrier + #pragma omp single +#endif + { + for (i = 0; i < num_threads; i++) + { + twspace[i + 1] += twspace[i]; + } + } + + if (num_threads > 1) + { + /* Correct row pointer G_i */ + G_i[ns] = twspace[ii]; + for (i = ns; i < ne; i++) + { + iloc = i - ns; + G_i[i + 1] = G_i[i] + Gloc_i[iloc + 1] - Gloc_i[iloc]; + } + + /* Move G_j and G_a */ + for (i = ns; i < ne; i++) + { + for (j = G_i[i]; j < G_i[i + 1]; j++) + { + G_j[j] = Gloc_j[j - G_i[ns]]; + G_a[j] = Gloc_a[j - G_i[ns]]; + } + } + + hypre_TFree(Gloc_i, HYPRE_MEMORY_HOST); + hypre_TFree(Gloc_j, HYPRE_MEMORY_HOST); + hypre_TFree(Gloc_a, HYPRE_MEMORY_HOST); + } + + /* Free memory */ + hypre_SeqVectorDestroy(G_temp); + hypre_SeqVectorDestroy(A_subrow); + hypre_SeqVectorDestroy(kap_grad); + hypre_SeqVectorDestroy(A_sub); + hypre_TFree(kg_pos, HYPRE_MEMORY_HOST); + hypre_TFree(pattern, HYPRE_MEMORY_HOST); + hypre_TFree(marker, HYPRE_MEMORY_HOST); + hypre_TFree(kg_marker, HYPRE_MEMORY_HOST); + } /* end openmp region */ + HYPRE_ANNOTATE_REGION_END("%s", "MainLoop"); + + /* Free memory */ + hypre_TFree(twspace, HYPRE_MEMORY_HOST); + + /* Update local number of nonzeros of G */ + hypre_CSRMatrixNumNonzeros(G_diag) = G_i[num_rows_diag_A]; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_FSAISetupOMPDyn + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAISetupOMPDyn( void *fsai_vdata, + hypre_ParCSRMatrix *A, + hypre_ParVector *f, + hypre_ParVector *u ) +{ + HYPRE_UNUSED_VAR(f); + HYPRE_UNUSED_VAR(u); + + /* Data structure variables */ + hypre_ParFSAIData *fsai_data = (hypre_ParFSAIData*) fsai_vdata; + HYPRE_Real kap_tolerance = hypre_ParFSAIDataKapTolerance(fsai_data); + HYPRE_Int max_steps = hypre_ParFSAIDataMaxSteps(fsai_data); + HYPRE_Int max_step_size = hypre_ParFSAIDataMaxStepSize(fsai_data); + + /* CSRMatrix A_diag variables */ + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + HYPRE_Int *A_i = hypre_CSRMatrixI(A_diag); + HYPRE_Complex *A_a = hypre_CSRMatrixData(A_diag); + HYPRE_Int num_rows_diag_A = hypre_CSRMatrixNumRows(A_diag); + + /* Matrix G variables */ + hypre_ParCSRMatrix *G = hypre_ParFSAIDataGmat(fsai_data); + hypre_CSRMatrix *G_diag; + HYPRE_Int *G_i; + HYPRE_Int *G_j; + HYPRE_Complex *G_a; + HYPRE_Int *G_nnzcnt; /* Array holding number of nonzeros of row G[i,:] */ + HYPRE_Int max_nnzrow_diag_G; /* Max. number of nonzeros per row in G_diag */ + + /* Local variables */ + HYPRE_Int i, j, jj; + char msg[512]; /* Warning message */ + HYPRE_Complex *twspace; /* shared work space for omp threads */ + + /* Initalize some variables */ + max_nnzrow_diag_G = max_steps * max_step_size + 1; + + G_diag = hypre_ParCSRMatrixDiag(G); + G_a = hypre_CSRMatrixData(G_diag); + G_i = hypre_CSRMatrixI(G_diag); + G_j = hypre_CSRMatrixJ(G_diag); + G_nnzcnt = hypre_CTAlloc(HYPRE_Int, num_rows_diag_A, HYPRE_MEMORY_HOST); + + /* Allocate shared work space array for OpenMP threads */ + twspace = hypre_CTAlloc(HYPRE_Complex, hypre_NumThreads() + 1, HYPRE_MEMORY_HOST); + + /********************************************************************** + * Start of Adaptive FSAI algorithm + ***********************************************************************/ + + /* Cycle through each of the local rows */ + HYPRE_ANNOTATE_REGION_BEGIN("%s", "MainLoop"); +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel +#endif + { + hypre_Vector *G_temp; /* Vector holding the values of G[i,:] */ + hypre_Vector *A_sub; /* Vector holding the dense submatrix A[P, P] */ + hypre_Vector *A_subrow; /* Vector holding A[i, P] */ + hypre_Vector *kap_grad; /* Vector holding the Kaporin gradient values */ + HYPRE_Int *kg_pos; /* Indices of nonzero entries of kap_grad */ + HYPRE_Int *kg_marker; /* Marker array with nonzeros pointing to kg_pos */ + HYPRE_Int *marker; /* Marker array with nonzeros pointing to P */ + HYPRE_Int *pattern; /* Array holding column indices of G[i,:] */ + HYPRE_Int patt_size; /* Number of entries in current pattern */ + HYPRE_Int patt_size_old; /* Number of entries in previous pattern */ + HYPRE_Int i, j, k; /* Loop variables */ + HYPRE_Complex old_psi; /* GAG' before k-th interation of aFSAI */ + HYPRE_Complex new_psi; /* GAG' after k-th interation of aFSAI */ + HYPRE_Complex row_scale; /* Scaling factor for G_temp */ + HYPRE_Complex *G_temp_data; + HYPRE_Complex *A_subrow_data; + + /* Allocate and initialize local vector variables */ + G_temp = hypre_SeqVectorCreate(max_nnzrow_diag_G); + A_subrow = hypre_SeqVectorCreate(max_nnzrow_diag_G); + kap_grad = hypre_SeqVectorCreate(num_rows_diag_A); + A_sub = hypre_SeqVectorCreate(max_nnzrow_diag_G * max_nnzrow_diag_G); + pattern = hypre_CTAlloc(HYPRE_Int, max_nnzrow_diag_G, HYPRE_MEMORY_HOST); + kg_pos = hypre_CTAlloc(HYPRE_Int, num_rows_diag_A, HYPRE_MEMORY_HOST); + kg_marker = hypre_CTAlloc(HYPRE_Int, num_rows_diag_A, HYPRE_MEMORY_HOST); + marker = hypre_TAlloc(HYPRE_Int, num_rows_diag_A, HYPRE_MEMORY_HOST); + + hypre_SeqVectorInitialize_v2(G_temp, HYPRE_MEMORY_HOST); + hypre_SeqVectorInitialize_v2(A_subrow, HYPRE_MEMORY_HOST); + hypre_SeqVectorInitialize_v2(kap_grad, HYPRE_MEMORY_HOST); + hypre_SeqVectorInitialize_v2(A_sub, HYPRE_MEMORY_HOST); + hypre_Memset(marker, -1, num_rows_diag_A * sizeof(HYPRE_Int), HYPRE_MEMORY_HOST); + + /* Setting data variables for vectors */ + G_temp_data = hypre_VectorData(G_temp); + A_subrow_data = hypre_VectorData(A_subrow); + +#ifdef HYPRE_USING_OPENMP + #pragma omp for schedule(dynamic) +#endif + for (i = 0; i < num_rows_diag_A; i++) + { + patt_size = 0; + + /* Set old_psi up front so we don't have to compute GAG' twice in the inner for-loop */ + new_psi = old_psi = A_a[A_i[i]]; + + /* Cycle through each iteration for that row */ + for (k = 0; k < max_steps; k++) + { + /* Compute Kaporin Gradient */ + hypre_FindKapGrad(A_diag, kap_grad, kg_pos, G_temp, pattern, + patt_size, max_nnzrow_diag_G, i, kg_marker); + + /* Find max_step_size largest values of the kaporin gradient, + find their column indices, and add it to pattern */ + patt_size_old = patt_size; + hypre_AddToPattern(kap_grad, kg_pos, pattern, &patt_size, + kg_marker, max_step_size); + + /* Update sizes */ + hypre_VectorSize(A_sub) = patt_size * patt_size; + hypre_VectorSize(A_subrow) = patt_size; + hypre_VectorSize(G_temp) = patt_size; + + if (patt_size == patt_size_old) + { + new_psi = old_psi; + break; + } + else + { + /* Gather A[P, P] and -A[i, P] */ + for (j = 0; j < patt_size; j++) + { + marker[pattern[j]] = j; + } + hypre_CSRMatrixExtractDenseMat(A_diag, A_sub, pattern, patt_size, marker); + hypre_CSRMatrixExtractDenseRow(A_diag, A_subrow, marker, i); + + /* Solve A[P, P] G[i, P]' = -A[i, P] */ + hypre_DenseSPDSystemSolve(A_sub, A_subrow, G_temp); + + /* Determine psi_{k+1} = G_temp[i] * A[P, P] * G_temp[i]' */ + new_psi = A_a[A_i[i]]; + for (j = 0; j < patt_size; j++) + { + new_psi += G_temp_data[j] * A_subrow_data[j]; + } + + /* Check psi reduction */ + if (hypre_cabs(new_psi - old_psi) < hypre_creal(kap_tolerance * old_psi)) + { + break; + } + else + { + old_psi = new_psi; + } + } + } + + /* Reset marker for building dense linear system */ + for (j = 0; j < patt_size; j++) + { + marker[pattern[j]] = -1; + } + + /* Compute scaling factor */ + if (hypre_creal(new_psi) > 0 && hypre_cimag(new_psi) == 0) + { + row_scale = 1.0 / hypre_csqrt(new_psi); + } + else + { + hypre_sprintf(msg, "Warning: complex scaling factor found in row %d\n", i); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, msg); + + row_scale = 1.0 / hypre_cabs(A_a[A_i[i]]); + hypre_VectorSize(G_temp) = patt_size = 0; + } + + /* Pass values of G_temp into G */ + j = i * max_nnzrow_diag_G; + G_j[j] = i; + G_a[j] = row_scale; + j++; + for (k = 0; k < patt_size; k++) + { + G_j[j] = pattern[k]; + G_a[j++] = row_scale * G_temp_data[k]; + kg_marker[pattern[k]] = 0; + } + G_nnzcnt[i] = patt_size + 1; + } /* omp for schedule(dynamic) */ + + /* Free memory */ + hypre_SeqVectorDestroy(G_temp); + hypre_SeqVectorDestroy(A_subrow); + hypre_SeqVectorDestroy(kap_grad); + hypre_SeqVectorDestroy(A_sub); + hypre_TFree(kg_pos, HYPRE_MEMORY_HOST); + hypre_TFree(pattern, HYPRE_MEMORY_HOST); + hypre_TFree(marker, HYPRE_MEMORY_HOST); + hypre_TFree(kg_marker, HYPRE_MEMORY_HOST); + } /* end openmp region */ + HYPRE_ANNOTATE_REGION_END("%s", "MainLoop"); + + /* Reorder array */ + G_i[0] = 0; + for (i = 0; i < num_rows_diag_A; i++) + { + G_i[i + 1] = G_i[i] + G_nnzcnt[i]; + jj = i * max_nnzrow_diag_G; + for (j = G_i[i]; j < G_i[i + 1]; j++) + { + G_j[j] = G_j[jj]; + G_a[j] = G_a[jj++]; + } + } + + /* Free memory */ + hypre_TFree(twspace, HYPRE_MEMORY_HOST); + hypre_TFree(G_nnzcnt, HYPRE_MEMORY_HOST); + + /* Update local number of nonzeros of G */ + hypre_CSRMatrixNumNonzeros(G_diag) = G_i[num_rows_diag_A]; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_FSAISetup + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAISetup( void *fsai_vdata, + hypre_ParCSRMatrix *A, + hypre_ParVector *f, + hypre_ParVector *u ) +{ + hypre_ParFSAIData *fsai_data = (hypre_ParFSAIData*) fsai_vdata; + HYPRE_Int max_steps = hypre_ParFSAIDataMaxSteps(fsai_data); + HYPRE_Int max_step_size = hypre_ParFSAIDataMaxStepSize(fsai_data); + HYPRE_Int max_nnz_row = hypre_ParFSAIDataMaxNnzRow(fsai_data); + HYPRE_Int algo_type = hypre_ParFSAIDataAlgoType(fsai_data); + HYPRE_Int print_level = hypre_ParFSAIDataPrintLevel(fsai_data); + HYPRE_Int eig_max_iters = hypre_ParFSAIDataEigMaxIters(fsai_data); + + /* ParCSRMatrix A variables */ + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + HYPRE_BigInt num_rows_A = hypre_ParCSRMatrixGlobalNumRows(A); + HYPRE_BigInt num_cols_A = hypre_ParCSRMatrixGlobalNumCols(A); + HYPRE_BigInt *row_starts_A = hypre_ParCSRMatrixRowStarts(A); + HYPRE_BigInt *col_starts_A = hypre_ParCSRMatrixColStarts(A); + + /* CSRMatrix A_diag variables */ + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + HYPRE_Int num_rows_diag_A = hypre_CSRMatrixNumRows(A_diag); + + /* Work vectors */ + hypre_ParVector *r_work; + hypre_ParVector *z_work; + + /* G variables */ + hypre_ParCSRMatrix *G; + HYPRE_Int max_nnzrow_diag_G; /* Max. number of nonzeros per row in G_diag */ + HYPRE_Int max_nonzeros_diag_G; /* Max. number of nonzeros in G_diag */ + + /* Sanity check */ + if (f && hypre_ParVectorNumVectors(f) > 1) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "FSAI doesn't support multicomponent vectors"); + return hypre_error_flag; + } + + HYPRE_ANNOTATE_FUNC_BEGIN; + + /* Create and initialize work vectors used in the solve phase */ + r_work = hypre_ParVectorCreate(comm, num_rows_A, row_starts_A); + z_work = hypre_ParVectorCreate(comm, num_rows_A, row_starts_A); + + hypre_ParVectorInitialize(r_work); + hypre_ParVectorInitialize(z_work); + + hypre_ParFSAIDataRWork(fsai_data) = r_work; + hypre_ParFSAIDataZWork(fsai_data) = z_work; + + /* Create the matrix G */ + if (algo_type == 1 || algo_type == 2) + { + max_nnzrow_diag_G = max_steps * max_step_size + 1; + } + else + { + max_nnzrow_diag_G = max_nnz_row + 1; + } + max_nonzeros_diag_G = num_rows_diag_A * max_nnzrow_diag_G; + G = hypre_ParCSRMatrixCreate(comm, num_rows_A, num_cols_A, + row_starts_A, col_starts_A, + 0, max_nonzeros_diag_G, 0); + hypre_ParFSAIDataGmat(fsai_data) = G; + + /* Initialize and compute lower triangular factor G */ +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + HYPRE_MemoryLocation memloc_A = hypre_ParCSRMatrixMemoryLocation(A); + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1(memloc_A); + + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_FSAISetupDevice(fsai_vdata, A, f, u); + } + else +#endif + { + /* Initialize matrix */ + hypre_ParCSRMatrixInitialize(G); + + switch (algo_type) + { + case 1: + // TODO: Change name to hypre_FSAISetupAdaptive + hypre_FSAISetupNative(fsai_vdata, A, f, u); + break; + + case 2: + // TODO: Change name to hypre_FSAISetupAdaptiveOMPDynamic + hypre_FSAISetupOMPDyn(fsai_vdata, A, f, u); + break; + + default: + hypre_FSAISetupNative(fsai_vdata, A, f, u); + break; + } + } + + /* Compute G^T */ + G = hypre_ParFSAIDataGmat(fsai_data); + hypre_ParCSRMatrixTranspose(G, &hypre_ParFSAIDataGTmat(fsai_data), 1); + + /* Update omega if requested */ + if (eig_max_iters) + { + hypre_FSAIComputeOmega(fsai_vdata, A); + } + + /* Print setup info */ + if (print_level == 1) + { + hypre_FSAIPrintStats(fsai_data, A); + } + else if (print_level > 2) + { + char filename[] = "FSAI.out.G.ij"; + hypre_ParCSRMatrixPrintIJ(G, 0, 0, filename); + } + +#if defined (DEBUG_FSAI) +#if !defined (HYPRE_USING_GPU) || + (defined (HYPRE_USING_GPU) && defined (HYPRE_USING_UNIFIED_MEMORY)) + hypre_FSAIDumpLocalLSDense(fsai_vdata, "fsai_dense_ls.out", A); +#endif +#endif + + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_FSAIPrintStats + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAIPrintStats( void *fsai_vdata, + hypre_ParCSRMatrix *A ) +{ + /* Data structure variables */ + hypre_ParFSAIData *fsai_data = (hypre_ParFSAIData*) fsai_vdata; + HYPRE_Int algo_type = hypre_ParFSAIDataAlgoType(fsai_data); + HYPRE_Int local_solve_type = hypre_ParFSAIDataLocalSolveType(fsai_data); + HYPRE_Real kap_tolerance = hypre_ParFSAIDataKapTolerance(fsai_data); + HYPRE_Int max_steps = hypre_ParFSAIDataMaxSteps(fsai_data); + HYPRE_Int max_step_size = hypre_ParFSAIDataMaxStepSize(fsai_data); + HYPRE_Int max_nnz_row = hypre_ParFSAIDataMaxNnzRow(fsai_data); + HYPRE_Int num_levels = hypre_ParFSAIDataNumLevels(fsai_data); + HYPRE_Real threshold = hypre_ParFSAIDataThreshold(fsai_data); + HYPRE_Int eig_max_iters = hypre_ParFSAIDataEigMaxIters(fsai_data); + HYPRE_Real density; + + hypre_ParCSRMatrix *G = hypre_ParFSAIDataGmat(fsai_data); + + /* Local variables */ + HYPRE_Int nprocs; + HYPRE_Int my_id; + + hypre_MPI_Comm_size(hypre_ParCSRMatrixComm(A), &nprocs); + hypre_MPI_Comm_rank(hypre_ParCSRMatrixComm(A), &my_id); + + /* Compute density */ + hypre_ParCSRMatrixSetDNumNonzeros(G); + hypre_ParCSRMatrixSetDNumNonzeros(A); + density = hypre_ParCSRMatrixDNumNonzeros(G) / + hypre_ParCSRMatrixDNumNonzeros(A); + hypre_ParFSAIDataDensity(fsai_data) = density; + + if (!my_id) + { + hypre_printf("*************************\n"); + hypre_printf("* HYPRE FSAI Setup Info *\n"); + hypre_printf("*************************\n\n"); + + hypre_printf("+---------------------------+\n"); + hypre_printf("| No. MPI tasks: %6d |\n", nprocs); + hypre_printf("| No. threads: %6d |\n", hypre_NumThreads()); + hypre_printf("| Algorithm type: %6d |\n", algo_type); + hypre_printf("| Local solve type: %6d |\n", local_solve_type); + if (algo_type == 1 || algo_type == 2) + { + hypre_printf("| Max no. steps: %6d |\n", max_steps); + hypre_printf("| Max step size: %6d |\n", max_step_size); + hypre_printf("| Kap grad tol: %8.1e |\n", kap_tolerance); + } + else + { + hypre_printf("| Max nnz. row: %6d |\n", max_nnz_row); + hypre_printf("| Number of levels: %6d |\n", num_levels); + hypre_printf("| Threshold: %8.1e |\n", threshold); + } + hypre_printf("| Prec. density: %8.3f |\n", density); + hypre_printf("| Eig max iters: %6d |\n", eig_max_iters); + hypre_printf("| Omega factor: %8.3f |\n", hypre_ParFSAIDataOmega(fsai_data)); + hypre_printf("+---------------------------+\n"); + + hypre_printf("\n\n"); + } + + return hypre_error_flag; +} + +/***************************************************************************** + * hypre_FSAIComputeOmega + * + * Approximates the relaxation factor omega with 1/eigmax(G^T*G*A), where the + * maximum eigenvalue is computed with a fixed number of iterations via the + * power method. + ******************************************************************************/ + +HYPRE_Int +hypre_FSAIComputeOmega( void *fsai_vdata, + hypre_ParCSRMatrix *A ) +{ + hypre_ParFSAIData *fsai_data = (hypre_ParFSAIData*) fsai_vdata; + hypre_ParCSRMatrix *G = hypre_ParFSAIDataGmat(fsai_data); + hypre_ParCSRMatrix *GT = hypre_ParFSAIDataGTmat(fsai_data); + hypre_ParVector *r_work = hypre_ParFSAIDataRWork(fsai_data); + hypre_ParVector *z_work = hypre_ParFSAIDataZWork(fsai_data); + HYPRE_Int eig_max_iters = hypre_ParFSAIDataEigMaxIters(fsai_data); + HYPRE_MemoryLocation memory_location = hypre_ParCSRMatrixMemoryLocation(A); + + hypre_ParVector *eigvec; + hypre_ParVector *eigvec_old; + + HYPRE_Int i; + HYPRE_Real norm, invnorm, lambda, omega; + + eigvec_old = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A), + hypre_ParCSRMatrixGlobalNumRows(A), + hypre_ParCSRMatrixRowStarts(A)); + eigvec = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A), + hypre_ParCSRMatrixGlobalNumRows(A), + hypre_ParCSRMatrixRowStarts(A)); + hypre_ParVectorInitialize_v2(eigvec, memory_location); + hypre_ParVectorInitialize_v2(eigvec_old, memory_location); + +#if defined(HYPRE_USING_GPU) + /* Make random number generation faster on GPUs */ + if (hypre_GetExecPolicy1(memory_location) == HYPRE_EXEC_DEVICE) + { + hypre_Vector *eigvec_local = hypre_ParVectorLocalVector(eigvec); + HYPRE_Complex *eigvec_data = hypre_VectorData(eigvec_local); + HYPRE_Int eigvec_size = hypre_VectorSize(eigvec_local); + + hypre_CurandUniform(eigvec_size, eigvec_data, 0, 0, 0, 0); + } + else +#endif + { + hypre_ParVectorSetRandomValues(eigvec, 256); + } + + /* Power method iteration */ + for (i = 0; i < eig_max_iters; i++) + { + norm = hypre_ParVectorInnerProd(eigvec, eigvec); + invnorm = 1.0 / hypre_sqrt(norm); + hypre_ParVectorScale(invnorm, eigvec); + + if (i == (eig_max_iters - 1)) + { + hypre_ParVectorCopy(eigvec, eigvec_old); + } + + /* eigvec = GT * G * A * eigvec */ + hypre_ParCSRMatrixMatvec(1.0, A, eigvec, 0.0, r_work); + hypre_ParCSRMatrixMatvec(1.0, G, r_work, 0.0, z_work); + hypre_ParCSRMatrixMatvec(1.0, GT, z_work, 0.0, eigvec); + } + norm = hypre_ParVectorInnerProd(eigvec, eigvec_old); + lambda = hypre_sqrt(norm); + + /* Check lambda */ + if (lambda < HYPRE_REAL_EPSILON) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Found small lambda. Reseting it to one!"); + lambda = 1.0; + } + + /* Free memory */ + hypre_ParVectorDestroy(eigvec_old); + hypre_ParVectorDestroy(eigvec); + + /* Update omega */ + omega = 1.0 / lambda; + hypre_FSAISetOmega(fsai_vdata, omega); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_FSAIDumpLocalLSDense + * + * Dump local linear systems to file. Matrices are written in dense format. + * This functions serves for debugging. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAIDumpLocalLSDense( void *fsai_vdata, + const char *filename, + hypre_ParCSRMatrix *A ) +{ + hypre_ParFSAIData *fsai_data = (hypre_ParFSAIData*) fsai_vdata; + + /* Data structure variables */ + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + HYPRE_Int max_steps = hypre_ParFSAIDataMaxSteps(fsai_data); + HYPRE_Int max_step_size = hypre_ParFSAIDataMaxStepSize(fsai_data); + hypre_ParCSRMatrix *G = hypre_ParFSAIDataGmat(fsai_data); + hypre_CSRMatrix *G_diag = hypre_ParCSRMatrixDiag(G); + HYPRE_Int *G_i = hypre_CSRMatrixI(G_diag); + HYPRE_Int *G_j = hypre_CSRMatrixJ(G_diag); + HYPRE_Int num_rows_diag_G = hypre_CSRMatrixNumRows(G_diag); + + /* CSRMatrix A_diag variables */ + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + HYPRE_Int *A_i = hypre_CSRMatrixI(A_diag); + HYPRE_Int *A_j = hypre_CSRMatrixJ(A_diag); + HYPRE_Complex *A_a = hypre_CSRMatrixData(A_diag); + + FILE *fp; + char new_filename[1024]; + HYPRE_Int myid; + HYPRE_Int i, j, k, m, n; + HYPRE_Int ii, jj; + HYPRE_Int nnz, col, index; + HYPRE_Int *indices; + HYPRE_Int *marker; + HYPRE_Real *data; + HYPRE_Int data_size; + HYPRE_Real density; + HYPRE_Int width = 20; //6 + HYPRE_Int prec = 16; //2 + + hypre_MPI_Comm_rank(comm, &myid); + hypre_sprintf(new_filename, "%s.%05d", filename, myid); + if ((fp = fopen(new_filename, "w")) == NULL) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Error: can't open output file %s\n"); + return hypre_error_flag; + } + + /* Allocate memory */ + data_size = (max_steps * max_step_size) * + (max_steps * max_step_size + 1); + indices = hypre_CTAlloc(HYPRE_Int, data_size, HYPRE_MEMORY_HOST); + data = hypre_CTAlloc(HYPRE_Real, data_size, HYPRE_MEMORY_HOST); + marker = hypre_TAlloc(HYPRE_Int, num_rows_diag_G, HYPRE_MEMORY_HOST); + hypre_Memset(marker, -1, num_rows_diag_G * sizeof(HYPRE_Int), HYPRE_MEMORY_HOST); + + /* Write header info */ + hypre_fprintf(fp, "num_linear_sys = %d\n", num_rows_diag_G); + hypre_fprintf(fp, "max_data_size = %d\n", data_size); + hypre_fprintf(fp, "max_num_steps = %d\n", hypre_ParFSAIDataMaxSteps(fsai_data)); + hypre_fprintf(fp, "max_step_size = %d\n", hypre_ParFSAIDataMaxStepSize(fsai_data)); + hypre_fprintf(fp, "max_step_size = %g\n", hypre_ParFSAIDataKapTolerance(fsai_data)); + hypre_fprintf(fp, "algo_type = %d\n\n", hypre_ParFSAIDataAlgoType(fsai_data)); + + /* Write local full linear systems */ + for (i = 0; i < num_rows_diag_G; i++) + { + /* Build marker array */ + n = G_i[i + 1] - G_i[i] - 1; + m = n + 1; + for (j = (G_i[i] + 1); j < G_i[i + 1]; j++) + { + marker[G_j[j]] = j - G_i[i] - 1; + } + + /* Gather matrix coefficients */ + nnz = 0; + for (j = (G_i[i] + 1); j < G_i[i + 1]; j++) + { + for (k = A_i[G_j[j]]; k < A_i[G_j[j] + 1]; k++) + { + if ((col = marker[A_j[k]]) >= 0) + { + /* Add A(i,j) entry */ + index = (j - G_i[i] - 1) * n + col; + data[index] = A_a[k]; + indices[nnz] = index; + nnz++; + } + } + } + density = (n > 0) ? (HYPRE_Real) nnz / (n * n) : 0.0; + + /* Gather RHS coefficients */ + for (j = A_i[i]; j < A_i[i + 1]; j++) + { + if ((col = marker[A_j[j]]) >= 0) + { + index = (m - 1) * n + col; + data[index] = A_a[j]; + indices[nnz] = index; + nnz++; + } + } + + /* Write coefficients to file */ + hypre_fprintf(fp, "id = %d, (m, n) = (%d, %d), rho = %.3f\n", i, m, n, density); + for (ii = 0; ii < n; ii++) + { + for (jj = 0; jj < n; jj++) + { + hypre_fprintf(fp, "%*.*f ", width, prec, data[ii * n + jj]); + } + hypre_fprintf(fp, "\n"); + } + for (jj = 0; jj < n; jj++) + { + hypre_fprintf(fp, "%*.*f ", width, prec, data[ii * n + jj]); + } + hypre_fprintf(fp, "\n"); + + + /* Reset work arrays */ + for (j = (G_i[i] + 1); j < G_i[i + 1]; j++) + { + marker[G_j[j]] = -1; + } + + for (k = 0; k < nnz; k++) + { + data[indices[k]] = 0.0; + } + } + + /* Close stream */ + fclose(fp); + + /* Free memory */ + hypre_TFree(indices, HYPRE_MEMORY_HOST); + hypre_TFree(marker, HYPRE_MEMORY_HOST); + hypre_TFree(data, HYPRE_MEMORY_HOST); + + return hypre_error_flag; +} diff --git a/external/hypre/src/parcsr_ls/par_fsai_solve.c b/external/hypre/src/parcsr_ls/par_fsai_solve.c new file mode 100644 index 00000000..b5824f14 --- /dev/null +++ b/external/hypre/src/parcsr_ls/par_fsai_solve.c @@ -0,0 +1,179 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + *******************************************************************************/ + +/****************************************************************************** + * + * FSAI solve routine + * + ******************************************************************************/ + +#include "_hypre_parcsr_ls.h" + +/*-------------------------------------------------------------------- + * hypre_FSAISolve + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAISolve( void *fsai_vdata, + hypre_ParCSRMatrix *A, + hypre_ParVector *b, + hypre_ParVector *x ) +{ + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + hypre_ParFSAIData *fsai_data = (hypre_ParFSAIData*) fsai_vdata; + + /* Data structure variables */ + hypre_ParVector *r_work = hypre_ParFSAIDataRWork(fsai_data); + HYPRE_Real tol = hypre_ParFSAIDataTolerance(fsai_data); + HYPRE_Int zero_guess = hypre_ParFSAIDataZeroGuess(fsai_data); + HYPRE_Int max_iter = hypre_ParFSAIDataMaxIterations(fsai_data); + HYPRE_Int print_level = hypre_ParFSAIDataPrintLevel(fsai_data); + HYPRE_Int logging = hypre_ParFSAIDataLogging(fsai_data); + + /* Local variables */ + HYPRE_Int iter, my_id; + HYPRE_Real old_resnorm, resnorm = 0.0, rel_resnorm; + HYPRE_Complex one = 1.0; + HYPRE_Complex neg_one = -1.0; + HYPRE_Complex zero = 0.0; + + /* Sanity check */ + if (hypre_ParVectorNumVectors(b) > 1) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "FSAI doesn't support multicomponent vectors"); + return hypre_error_flag; + } + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("FSAISolve"); + + hypre_MPI_Comm_rank(comm, &my_id); + + /*----------------------------------------------------------------- + * Preconditioned Richardson - Main solver loop + * x(k+1) = x(k) + omega * (G^T*G) * (b - A*x(k)) + * ----------------------------------------------------------------*/ + + if (my_id == 0 && print_level > 1) + { + hypre_printf("\n\n FSAI SOLVER SOLUTION INFO:\n"); + } + + iter = 0; + rel_resnorm = resnorm = 1.0; + + if (my_id == 0 && print_level > 1) + { + hypre_printf(" new relative\n"); + hypre_printf(" iter # res norm res norm\n"); + hypre_printf(" -------- -------- --------\n"); + } + + if (max_iter > 0) + { + /* First iteration */ + if (zero_guess) + { + /* Compute: x(k+1) = omega*G^T*G*b */ + hypre_FSAIApply(fsai_vdata, zero, b, x); + } + else + { + /* Compute: x(k+1) = x(k) + omega*G^T*G*(b - A*x(k)) */ + hypre_ParCSRMatrixMatvecOutOfPlace(neg_one, A, x, one, b, r_work); + hypre_FSAIApply(fsai_vdata, one, r_work, x); + } + + /* Update iteration count */ + iter++; + } + else + { + hypre_ParVectorCopy(b, x); + } + + /* Apply remaining iterations */ + for (; iter < max_iter; iter++) + { + /* Update residual */ + hypre_ParCSRMatrixMatvecOutOfPlace(neg_one, A, x, one, b, r_work); + + if (tol > 0.0) + { + old_resnorm = resnorm; + resnorm = hypre_ParVectorInnerProd(r_work, r_work); + + /* Compute rel_resnorm */ + rel_resnorm = resnorm / old_resnorm; + + if (my_id == 0 && print_level > 1) + { + hypre_printf(" %e %e %e\n", iter, resnorm, rel_resnorm); + } + + /* Exit if convergence tolerance has been achieved */ + if (rel_resnorm >= tol) + { + break; + } + } + + /* Compute: x(k+1) = x(k) + omega*inv(M)*r */ + hypre_FSAIApply(fsai_vdata, one, r_work, x); + } + + if (logging > 1) + { + hypre_ParFSAIDataNumIterations(fsai_data) = iter; + hypre_ParFSAIDataRelResNorm(fsai_data) = rel_resnorm; + } + else + { + hypre_ParFSAIDataNumIterations(fsai_data) = 0; + hypre_ParFSAIDataRelResNorm(fsai_data) = 0.0; + } + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------- + * hypre_FSAIApply + * + * Computes x(k+1) = alpha*x(k) + omega*G^T*G*b + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAIApply( void *fsai_vdata, + HYPRE_Complex alpha, + hypre_ParVector *b, + hypre_ParVector *x ) +{ + hypre_ParFSAIData *fsai_data = (hypre_ParFSAIData*) fsai_vdata; + + /* Data structure variables */ + hypre_ParCSRMatrix *G = hypre_ParFSAIDataGmat(fsai_data); + hypre_ParCSRMatrix *GT = hypre_ParFSAIDataGTmat(fsai_data); + hypre_ParVector *z_work = hypre_ParFSAIDataZWork(fsai_data); + HYPRE_Real omega = hypre_ParFSAIDataOmega(fsai_data); + + HYPRE_Complex one = 1.0; + HYPRE_Complex zero = 0.0; + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("FSAIApply"); + + hypre_ParCSRMatrixMatvec(one, G, b, zero, z_work); + hypre_ParCSRMatrixMatvec(omega, GT, z_work, alpha, x); + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} diff --git a/external/hypre/src/parcsr_ls/par_gauss_elim.c b/external/hypre/src/parcsr_ls/par_gauss_elim.c index fa6f58ac..c3a9ec6e 100644 --- a/external/hypre/src/parcsr_ls/par_gauss_elim.c +++ b/external/hypre/src/parcsr_ls/par_gauss_elim.c @@ -1,195 +1,443 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ #include "_hypre_parcsr_ls.h" -#include "Common.h" #include "_hypre_blas.h" #include "_hypre_lapack.h" -/*------------------------------------------------------------------------- +/*-------------------------------------------------------------------------- + * hypre_GaussElimSetup * - * Gaussian Elimination + * Gaussian elimination setup routine. * - *------------------------------------------------------------------------ */ - -HYPRE_Int hypre_GaussElimSetup (hypre_ParAMGData *amg_data, HYPRE_Int level, HYPRE_Int relax_type) + * Solver options for which local matrices/vectors are formed via MPI + * collectives on a sub-communicator defined with active ranks: + * + * - 9: hypre's internal Gaussian elimination on the host. + * - 99: LU factorization with pivoting. + * - 199: explicit (dense) inverse A_inv = U^{-1}*L^{-1}. + * + * Solver options for which local matrices/vectors are formed via + * hypre_DataExchangeList: + * + * - 19: hypre's internal Gaussian elimination on the host. + * - 98: LU factorization with pivoting. + * - 198: explicit (dense) inverse A_inv = U^{-1}*L^{-1}. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GaussElimSetup(hypre_ParAMGData *amg_data, + HYPRE_Int level, + HYPRE_Int solver_type) { -#ifdef HYPRE_PROFILE - hypre_profile_times[HYPRE_TIMER_ID_GS_ELIM_SETUP] -= hypre_MPI_Wtime(); -#endif - /* Par Data Structure variables */ - hypre_ParCSRMatrix *A = hypre_ParAMGDataAArray(amg_data)[level]; - hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); - hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); + hypre_ParCSRMatrix *A = hypre_ParAMGDataAArray(amg_data)[level]; + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + HYPRE_Int num_rows = hypre_ParCSRMatrixNumRows(A); + HYPRE_Int global_num_rows = (HYPRE_Int) hypre_ParCSRMatrixGlobalNumRows(A); + HYPRE_BigInt first_row_index = hypre_ParCSRMatrixFirstRowIndex(A); + HYPRE_BigInt *col_map_offd = hypre_ParCSRMatrixColMapOffd(A); + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); + HYPRE_MemoryLocation memory_location = hypre_ParCSRMatrixMemoryLocation(A); + + /* Local matrices */ + hypre_CSRMatrix *A_diag_host; + hypre_CSRMatrix *A_offd_host; + hypre_CSRMatrix *A_CSR; + HYPRE_Int *A_CSR_i; + HYPRE_Int *A_CSR_j; + HYPRE_Complex *A_CSR_data; + HYPRE_Int *A_diag_i; + HYPRE_Int *A_offd_i; + HYPRE_Int *A_diag_j; + HYPRE_Int *A_offd_j; + HYPRE_Complex *A_diag_data; + HYPRE_Complex *A_offd_data; + + HYPRE_Complex *A_mat_local; + HYPRE_Int *comm_info, *info, *displs; + HYPRE_Int *mat_info, *mat_displs; + HYPRE_Int new_num_procs, A_mat_local_size; + + /* Local variables */ + MPI_Comm new_comm; + HYPRE_Int global_size = global_num_rows * global_num_rows; + HYPRE_Real *A_mat = NULL; + HYPRE_Real *AT_mat = NULL; + HYPRE_Int *A_piv = NULL; + HYPRE_MemoryLocation ge_memory_location; + HYPRE_Int i, jj, col; + HYPRE_Int ierr = 0; + + /*----------------------------------------------------------------- + * Sanity checks + *-----------------------------------------------------------------*/ + + /* Check for relaxation type */ + if (solver_type != 9 && solver_type != 99 && solver_type != 199 && + solver_type != 19 && solver_type != 98 && solver_type != 198) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unsupported solver type!"); + return hypre_error_flag; + } - HYPRE_Int num_rows = hypre_CSRMatrixNumRows(A_diag); - HYPRE_Int global_num_rows = (HYPRE_Int) hypre_ParCSRMatrixGlobalNumRows(A); - MPI_Comm comm = hypre_ParCSRMatrixComm(A); - MPI_Comm new_comm; + /*----------------------------------------------------------------- + * Determine mem. location of the GE lin. system and allocate data + *-----------------------------------------------------------------*/ - /* Generate sub communicator: processes that have nonzero num_rows */ - hypre_GenerateSubComm(comm, num_rows, &new_comm); + if (solver_type == 9 || solver_type == 19) + { + ge_memory_location = HYPRE_MEMORY_HOST; + } + else + { + /* Fallback to host execution when dependency libraries are not met (cuSOLVER/MAGMA) */ +#if defined(HYPRE_USING_CUDA) && !defined(HYPRE_USING_CUSOLVER) && !defined(HYPRE_USING_MAGMA) ||\ + (defined(HYPRE_USING_HIP) && !defined(HYPRE_USING_MAGMA)) + ge_memory_location = HYPRE_MEMORY_HOST; +#else + ge_memory_location = memory_location; +#endif + } + hypre_ParAMGDataGEMemoryLocation(amg_data) = ge_memory_location; + /* Allocate dense linear system data */ if (num_rows) { - hypre_CSRMatrix *A_diag_host, *A_offd_host; - if (hypre_GetActualMemLocation(hypre_CSRMatrixMemoryLocation(A_diag)) != hypre_MEMORY_HOST) + hypre_ParAMGDataAMat(amg_data) = hypre_CTAlloc(HYPRE_Real, + global_size, + ge_memory_location); + hypre_ParAMGDataAWork(amg_data) = hypre_CTAlloc(HYPRE_Real, + global_size, + ge_memory_location); + hypre_ParAMGDataBVec(amg_data) = hypre_CTAlloc(HYPRE_Real, + global_num_rows, + ge_memory_location); + + /* solver types 198 and 199 need a work space for the solution vector */ + if (solver_type == 198 || solver_type == 199) { - A_diag_host = hypre_CSRMatrixClone_v2(A_diag, 1, HYPRE_MEMORY_HOST); + hypre_ParAMGDataUVec(amg_data) = hypre_CTAlloc(HYPRE_Real, + global_num_rows, + ge_memory_location); } - else - { - A_diag_host = A_diag; - } - if (hypre_GetActualMemLocation(hypre_CSRMatrixMemoryLocation(A_offd)) != hypre_MEMORY_HOST) + + /* solver types other than 9 and 19 need an array for storing pivots */ + if (solver_type != 9 && solver_type != 19) { - A_offd_host = hypre_CSRMatrixClone_v2(A_offd, 1, HYPRE_MEMORY_HOST); +#if defined(HYPRE_USING_MAGMA) + /* MAGMA's getrf/getrs expect Apiv to be on the host */ + hypre_ParAMGDataAPiv(amg_data) = hypre_CTAlloc(HYPRE_Int, + global_num_rows, + HYPRE_MEMORY_HOST); +#else + hypre_ParAMGDataAPiv(amg_data) = hypre_CTAlloc(HYPRE_Int, + global_num_rows, + ge_memory_location); +#endif } - else + A_piv = hypre_ParAMGDataAPiv(amg_data); + } + + /*----------------------------------------------------------------- + * Gaussian elimination setup + *-----------------------------------------------------------------*/ + +#ifdef HYPRE_PROFILE + hypre_profile_times[HYPRE_TIMER_ID_GS_ELIM_SETUP] -= hypre_MPI_Wtime(); +#endif + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("GESetup"); + + if (solver_type == 9 || solver_type == 99 || solver_type == 199) + { + /* Generate sub communicator - processes that have nonzero num_rows */ + hypre_GenerateSubComm(comm, num_rows, &new_comm); + hypre_ParAMGDataNewComm(amg_data) = new_comm; + + if (num_rows) { - A_offd_host = A_offd; - } + hypre_MPI_Comm_size(new_comm, &new_num_procs); + + A_diag_host = (hypre_GetActualMemLocation(memory_location) == hypre_MEMORY_DEVICE) ? + hypre_CSRMatrixClone_v2(A_diag, 1, HYPRE_MEMORY_HOST) : A_diag; + A_offd_host = (hypre_GetActualMemLocation(memory_location) == hypre_MEMORY_DEVICE) ? + hypre_CSRMatrixClone_v2(A_offd, 1, HYPRE_MEMORY_HOST) : A_offd; + A_diag_i = hypre_CSRMatrixI(A_diag_host); + A_offd_i = hypre_CSRMatrixI(A_offd_host); + A_diag_j = hypre_CSRMatrixJ(A_diag_host); + A_offd_j = hypre_CSRMatrixJ(A_offd_host); + A_diag_data = hypre_CSRMatrixData(A_diag_host); + A_offd_data = hypre_CSRMatrixData(A_offd_host); + comm_info = hypre_CTAlloc(HYPRE_Int, 2 * new_num_procs + 1, HYPRE_MEMORY_HOST); + mat_info = hypre_CTAlloc(HYPRE_Int, new_num_procs, HYPRE_MEMORY_HOST); + mat_displs = hypre_CTAlloc(HYPRE_Int, new_num_procs + 1, HYPRE_MEMORY_HOST); + info = &comm_info[0]; + displs = &comm_info[new_num_procs]; + + hypre_ParAMGDataCommInfo(amg_data) = comm_info; + hypre_MPI_Allgather(&num_rows, 1, HYPRE_MPI_INT, info, 1, HYPRE_MPI_INT, new_comm); + + displs[0] = 0; + mat_displs[0] = 0; + for (i = 0; i < new_num_procs; i++) + { + displs[i + 1] = displs[i] + info[i]; + mat_displs[i + 1] = global_num_rows * displs[i + 1]; + mat_info[i] = global_num_rows * info[i]; + } - HYPRE_BigInt *col_map_offd = hypre_ParCSRMatrixColMapOffd(A); - HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag_host); - HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd_host); - HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag_host); - HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd_host); - HYPRE_Real *A_diag_data = hypre_CSRMatrixData(A_diag_host); - HYPRE_Real *A_offd_data = hypre_CSRMatrixData(A_offd_host); + A_mat_local_size = global_num_rows * num_rows; + A_mat_local = hypre_CTAlloc(HYPRE_Real, A_mat_local_size, HYPRE_MEMORY_HOST); + A_mat = (hypre_GetActualMemLocation(ge_memory_location) == hypre_MEMORY_DEVICE) ? + hypre_CTAlloc(HYPRE_Real, global_size, HYPRE_MEMORY_HOST) : + hypre_ParAMGDataAMat(amg_data); - HYPRE_Real *A_mat, *A_mat_local; - HYPRE_Int *comm_info, *info, *displs; - HYPRE_Int *mat_info, *mat_displs; - HYPRE_Int new_num_procs, A_mat_local_size, i, jj, column; - HYPRE_BigInt first_row_index = hypre_ParCSRMatrixFirstRowIndex(A); + /*--------------------------------------------------------------- + * Load local matrix into A_mat_local. + *---------------------------------------------------------------*/ - hypre_MPI_Comm_size(new_comm, &new_num_procs); + for (i = 0; i < num_rows; i++) + { + for (jj = A_diag_i[i]; jj < A_diag_i[i + 1]; jj++) + { + /* using row major */ + col = A_diag_j[jj] + first_row_index; + A_mat_local[i * global_num_rows + col] = A_diag_data[jj]; + } - comm_info = hypre_CTAlloc(HYPRE_Int, 2*new_num_procs+1, HYPRE_MEMORY_HOST); - mat_info = hypre_CTAlloc(HYPRE_Int, new_num_procs, HYPRE_MEMORY_HOST); - mat_displs = hypre_CTAlloc(HYPRE_Int, new_num_procs+1, HYPRE_MEMORY_HOST); - info = &comm_info[0]; - displs = &comm_info[new_num_procs]; + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) + { + /* using row major */ + col = col_map_offd[A_offd_j[jj]]; + A_mat_local[i * global_num_rows + col] = A_offd_data[jj]; + } + } - hypre_MPI_Allgather(&num_rows, 1, HYPRE_MPI_INT, info, 1, HYPRE_MPI_INT, new_comm); + hypre_MPI_Allgatherv(A_mat_local, A_mat_local_size, HYPRE_MPI_REAL, A_mat, mat_info, + mat_displs, HYPRE_MPI_REAL, new_comm); - displs[0] = 0; - mat_displs[0] = 0; - for (i = 0; i < new_num_procs; i++) - { - displs[i+1] = displs[i] + info[i]; - mat_displs[i+1] = global_num_rows * displs[i+1]; - mat_info[i] = global_num_rows * info[i]; - } + /* Set dense matrix - We store it in row-major format when using hypre's internal + Gaussian Elimination or in column-major format if using LAPACK solvers */ + if (solver_type != 9 && solver_type != 19) + { + AT_mat = (hypre_GetActualMemLocation(ge_memory_location) == hypre_MEMORY_DEVICE) ? + hypre_CTAlloc(HYPRE_Real, global_size, HYPRE_MEMORY_HOST) : + hypre_ParAMGDataAWork(amg_data); - hypre_ParAMGDataBVec(amg_data) = hypre_CTAlloc(HYPRE_Real, global_num_rows, HYPRE_MEMORY_HOST); + /* Compute A transpose, i.e., store A in column-major format */ + for (i = 0; i < global_num_rows; i++) + { + for (jj = 0; jj < global_num_rows; jj++) + { + AT_mat[i * global_num_rows + jj] = A_mat[i + jj * global_num_rows]; + } + } + + if (hypre_ParAMGDataAWork(amg_data) != AT_mat) + { + /* Copy A^T to destination variable */ + hypre_TMemcpy(hypre_ParAMGDataAMat(amg_data), AT_mat, HYPRE_Real, global_size, + ge_memory_location, HYPRE_MEMORY_HOST); + hypre_TFree(AT_mat, HYPRE_MEMORY_HOST); + } + else + { + /* Swap pointers */ + hypre_ParAMGDataAWork(amg_data) = hypre_ParAMGDataAMat(amg_data); + hypre_ParAMGDataAMat(amg_data) = AT_mat; + } + } - A_mat_local_size = global_num_rows * num_rows; - A_mat_local = hypre_CTAlloc(HYPRE_Real, A_mat_local_size, HYPRE_MEMORY_HOST); - A_mat = hypre_CTAlloc(HYPRE_Real, global_num_rows*global_num_rows, HYPRE_MEMORY_HOST); + hypre_TFree(mat_info, HYPRE_MEMORY_HOST); + hypre_TFree(mat_displs, HYPRE_MEMORY_HOST); + hypre_TFree(A_mat_local, HYPRE_MEMORY_HOST); - /* load local matrix into A_mat_local */ - for (i = 0; i < num_rows; i++) - { - for (jj = A_diag_i[i]; jj < A_diag_i[i+1]; jj++) + if (hypre_GetActualMemLocation(ge_memory_location) == hypre_MEMORY_DEVICE) { - /* need col major */ - column = A_diag_j[jj]+first_row_index; - A_mat_local[i*global_num_rows + column] = A_diag_data[jj]; + hypre_TFree(A_mat, HYPRE_MEMORY_HOST); } - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + + if (A_diag_host != A_diag) { - /* need col major */ - column = col_map_offd[A_offd_j[jj]]; - A_mat_local[i*global_num_rows + column] = A_offd_data[jj]; + hypre_CSRMatrixDestroy(A_diag_host); + } + + if (A_offd_host != A_offd) + { + hypre_CSRMatrixDestroy(A_offd_host); } } + else + { + /* Skip setup if this rank has no rows. */ + hypre_ParAMGDataGSSetup(amg_data) = 1; + + /* Finalize profiling */ + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; - hypre_MPI_Allgatherv(A_mat_local, A_mat_local_size, HYPRE_MPI_REAL, A_mat, mat_info, - mat_displs, HYPRE_MPI_REAL, new_comm); + return hypre_error_flag; + } + } + else /* if (solver_type == 19 || solver_type = 98 || solver_type == 198) */ + { + /* Generate CSR matrix from ParCSRMatrix A */ + A_CSR = hypre_ParCSRMatrixToCSRMatrixAll_v2(A, HYPRE_MEMORY_HOST); - if (relax_type == 99) + if (num_rows) { - HYPRE_Real *AT_mat = hypre_CTAlloc(HYPRE_Real, global_num_rows*global_num_rows, HYPRE_MEMORY_HOST); + A_CSR_i = hypre_CSRMatrixI(A_CSR); + A_CSR_j = hypre_CSRMatrixJ(A_CSR); + A_CSR_data = hypre_CSRMatrixData(A_CSR); + + /*--------------------------------------------------------------- + * Load CSR matrix into A_mat. + *---------------------------------------------------------------*/ + + /* Allocate memory */ + A_mat = (hypre_GetActualMemLocation(ge_memory_location) == hypre_MEMORY_DEVICE) ? + hypre_CTAlloc(HYPRE_Real, global_size, HYPRE_MEMORY_HOST) : + hypre_ParAMGDataAMat(amg_data); + + /* TODO (VPM): Add OpenMP support */ for (i = 0; i < global_num_rows; i++) { - for (jj = 0; jj < global_num_rows; jj++) + for (jj = A_CSR_i[i]; jj < A_CSR_i[i + 1]; jj++) { - AT_mat[i*global_num_rows + jj] = A_mat[i + jj*global_num_rows]; + /* need col major */ + col = A_CSR_j[jj]; + A_mat[i + global_num_rows * col] = (HYPRE_Real) A_CSR_data[jj]; } } - hypre_ParAMGDataAMat(amg_data) = AT_mat; - hypre_TFree(A_mat, HYPRE_MEMORY_HOST); + + if (hypre_ParAMGDataAMat(amg_data) != A_mat) + { + hypre_TMemcpy(hypre_ParAMGDataAMat(amg_data), A_mat, HYPRE_Real, global_size, + ge_memory_location, HYPRE_MEMORY_HOST); + hypre_TFree(A_mat, HYPRE_MEMORY_HOST); + } } - else if (relax_type == 9) + else { - hypre_ParAMGDataAMat(amg_data) = A_mat; + /* Free memory */ + hypre_CSRMatrixDestroy(A_CSR); + + /* Skip setup if this rank has no rows. */ + hypre_ParAMGDataGSSetup(amg_data) = 1; + + /* Finalize profiling */ + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; } - else if (relax_type == 199) + + /* Free memory */ + hypre_CSRMatrixDestroy(A_CSR); + } + + /* Exit if no rows in this rank */ + if (!num_rows) + { + hypre_ParAMGDataGSSetup(amg_data) = 1; + + /* Finalize profiling */ + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; + } + + /*----------------------------------------------------------------- + * Factorization phase + *-----------------------------------------------------------------*/ + +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1(ge_memory_location); + + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_GaussElimSetupDevice(amg_data, level, solver_type); + } + else +#endif + { + if (solver_type != 9 && solver_type != 19) { - HYPRE_Real *AT_mat = hypre_TAlloc(HYPRE_Real, global_num_rows*global_num_rows, HYPRE_MEMORY_HOST); - HYPRE_Real *Ainv = hypre_TAlloc(HYPRE_Real, num_rows*global_num_rows, HYPRE_MEMORY_HOST); - for (i = 0; i < global_num_rows; i++) + /* Perform factorization */ + hypre_dgetrf(&global_num_rows, &global_num_rows, + hypre_ParAMGDataAMat(amg_data), + &global_num_rows, A_piv, &ierr); + if (ierr != 0) { - for (jj = 0; jj < global_num_rows; jj++) - { - AT_mat[i*global_num_rows + jj] = A_mat[i + jj*global_num_rows]; - } + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Problem with dgetrf!"); + + /* Finalize profiling */ + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; } - HYPRE_Int *ipiv, info, query = -1, lwork; - HYPRE_Real lwork_opt, *work; - ipiv = hypre_TAlloc(HYPRE_Int, global_num_rows, HYPRE_MEMORY_HOST); - hypre_dgetrf(&global_num_rows, &global_num_rows, AT_mat, &global_num_rows, ipiv, &info); - hypre_assert(info == 0); - hypre_dgetri(&global_num_rows, AT_mat, &global_num_rows, ipiv, &lwork_opt, &query, &info); - hypre_assert(info == 0); - lwork = lwork_opt; - work = hypre_TAlloc(HYPRE_Real, lwork, HYPRE_MEMORY_HOST); - hypre_dgetri(&global_num_rows, AT_mat, &global_num_rows, ipiv, work, &lwork, &info); - hypre_assert(info == 0); - for (i = 0; i < global_num_rows; i++) + /* Compute explicit inverse */ + if (solver_type == 198 || solver_type == 199) { - for (jj = 0; jj < num_rows; jj++) + HYPRE_Int query = -1, lwork; + HYPRE_Real lwork_opt; + HYPRE_Real *work; + + /* Compute buffer size */ + hypre_dgetri(&global_num_rows, hypre_ParAMGDataAMat(amg_data), + &global_num_rows, A_piv, &lwork_opt, &query, &ierr); + if (ierr != 0) { - Ainv[i*num_rows+jj] = AT_mat[i*global_num_rows+jj+first_row_index]; - } - } + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Problem with dgetri (query)!"); - hypre_TFree(ipiv, HYPRE_MEMORY_HOST); - hypre_TFree(A_mat, HYPRE_MEMORY_HOST); - hypre_TFree(AT_mat, HYPRE_MEMORY_HOST); - hypre_TFree(work, HYPRE_MEMORY_HOST); + /* Finalize profiling */ + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; - hypre_ParAMGDataAInv(amg_data) = Ainv; - } + return hypre_error_flag; + } - hypre_ParAMGDataCommInfo(amg_data) = comm_info; - hypre_ParAMGDataNewComm(amg_data) = new_comm; + /* Allocate work space */ + lwork = (HYPRE_Int) lwork_opt; + work = hypre_TAlloc(HYPRE_Real, lwork, HYPRE_MEMORY_HOST); - hypre_TFree(mat_info, HYPRE_MEMORY_HOST); - hypre_TFree(mat_displs, HYPRE_MEMORY_HOST); - hypre_TFree(A_mat_local, HYPRE_MEMORY_HOST); + /* Compute dense inverse */ + hypre_dgetri(&global_num_rows, hypre_ParAMGDataAMat(amg_data), + &global_num_rows, A_piv, work, &lwork, &ierr); + if (ierr != 0) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Problem with dgetri!"); - if (A_diag_host != A_diag) - { - hypre_CSRMatrixDestroy(A_diag_host); - } + /* Finalize profiling */ + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; - if (A_offd_host != A_offd) - { - hypre_CSRMatrixDestroy(A_offd_host); + return hypre_error_flag; + } + hypre_TFree(work, HYPRE_MEMORY_HOST); + } } } + /*----------------------------------------------------------------- + * Finalize + *-----------------------------------------------------------------*/ + hypre_ParAMGDataGSSetup(amg_data) = 1; + /* Finalize profiling */ + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; #ifdef HYPRE_PROFILE hypre_profile_times[HYPRE_TIMER_ID_GS_ELIM_SETUP] += hypre_MPI_Wtime(); #endif @@ -197,233 +445,253 @@ HYPRE_Int hypre_GaussElimSetup (hypre_ParAMGData *amg_data, HYPRE_Int level, HYP return hypre_error_flag; } -/* relax_type = 9, 99, 199, see par_relax.c for 19 and 98 */ -HYPRE_Int hypre_GaussElimSolve (hypre_ParAMGData *amg_data, HYPRE_Int level, HYPRE_Int relax_type) +/*-------------------------------------------------------------------------- + * hypre_GaussElimSolve + * + * Gaussian elimination solve. See hypre_GaussElimSetup for comments. + * + * TODO (VPM): remove (u/f)_data_h. Communicate device buffers instead. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GaussElimSolve(hypre_ParAMGData *amg_data, + HYPRE_Int level, + HYPRE_Int solver_type) { + hypre_ParCSRMatrix *A = hypre_ParAMGDataAArray(amg_data)[level]; + HYPRE_Int first_row_index = (HYPRE_Int) hypre_ParCSRMatrixFirstRowIndex(A); + HYPRE_Int global_num_rows = (HYPRE_Int) hypre_ParCSRMatrixGlobalNumRows(A); + HYPRE_Int num_rows = hypre_ParCSRMatrixNumRows(A); + HYPRE_MemoryLocation memory_location = hypre_ParCSRMatrixMemoryLocation(A); + HYPRE_MemoryLocation ge_memory_location = hypre_ParAMGDataGEMemoryLocation(amg_data); + + HYPRE_Real *b_vec = hypre_ParAMGDataBVec(amg_data); + hypre_ParVector *f = hypre_ParAMGDataFArray(amg_data)[level]; + HYPRE_Real *f_data = hypre_VectorData(hypre_ParVectorLocalVector(f)); + HYPRE_Real *f_data_h = NULL; + HYPRE_Real *b_data_h = NULL; + hypre_Vector *f_all = NULL; + + hypre_ParVector *u = hypre_ParAMGDataUArray(amg_data)[level]; + HYPRE_Real *u_data = hypre_VectorData(hypre_ParVectorLocalVector(u)); + HYPRE_Real *u_data_h = NULL; + HYPRE_Real *u_vec = hypre_ParAMGDataUVec(amg_data); + + /* Coarse solver data */ + HYPRE_Int *A_piv = hypre_ParAMGDataAPiv(amg_data); + HYPRE_Real *A_mat = hypre_ParAMGDataAMat(amg_data); + HYPRE_Real *A_work = hypre_ParAMGDataAWork(amg_data); + + /* Constants */ + HYPRE_Int one_i = 1; + HYPRE_Real one = 1.0; + HYPRE_Real zero = 0.0; + + /* Local variables */ + MPI_Comm new_comm = hypre_ParAMGDataNewComm(amg_data); + HYPRE_Int *comm_info = hypre_ParAMGDataCommInfo(amg_data); + HYPRE_Int global_size = global_num_rows * global_num_rows; + HYPRE_Int ierr = 0; + HYPRE_Int *displs, *info; + HYPRE_Int new_num_procs; + #ifdef HYPRE_PROFILE hypre_profile_times[HYPRE_TIMER_ID_GS_ELIM_SOLVE] -= hypre_MPI_Wtime(); #endif + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("GESolve"); - hypre_ParCSRMatrix *A = hypre_ParAMGDataAArray(amg_data)[level]; - hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); - HYPRE_Int n = hypre_CSRMatrixNumRows(A_diag); - HYPRE_Int error_flag = 0; + /*----------------------------------------------------------------- + * Sanity checks + *-----------------------------------------------------------------*/ + /* Call setup if not done before */ if (hypre_ParAMGDataGSSetup(amg_data) == 0) { - hypre_GaussElimSetup(amg_data, level, relax_type); + hypre_GaussElimSetup(amg_data, level, solver_type); } - if (n) + /* Check for relaxation type */ + if (solver_type != 9 && solver_type != 99 && solver_type != 199 && + solver_type != 19 && solver_type != 98 && solver_type != 198) { - MPI_Comm new_comm = hypre_ParAMGDataNewComm(amg_data); - hypre_ParVector *f = hypre_ParAMGDataFArray(amg_data)[level]; - hypre_ParVector *u = hypre_ParAMGDataUArray(amg_data)[level]; - HYPRE_Real *b_vec = hypre_ParAMGDataBVec(amg_data); - HYPRE_Real *f_data = hypre_VectorData(hypre_ParVectorLocalVector(f)); - HYPRE_Real *u_data = hypre_VectorData(hypre_ParVectorLocalVector(u)); - HYPRE_Int *comm_info = hypre_ParAMGDataCommInfo(amg_data); - HYPRE_Int *displs, *info; - HYPRE_Int n_global = (HYPRE_Int) hypre_ParCSRMatrixGlobalNumRows(A); - HYPRE_Int new_num_procs; - HYPRE_Int first_row_index = (HYPRE_Int) hypre_ParCSRMatrixFirstRowIndex(A); - HYPRE_Int one_i = 1; - - hypre_MPI_Comm_size(new_comm, &new_num_procs); - info = &comm_info[0]; - displs = &comm_info[new_num_procs]; - - HYPRE_Real *f_data_host, *u_data_host; - - if (hypre_GetActualMemLocation(hypre_ParVectorMemoryLocation(f)) != hypre_MEMORY_HOST) - { - f_data_host = hypre_TAlloc(HYPRE_Real, n, HYPRE_MEMORY_HOST); - - hypre_TMemcpy(f_data_host, f_data, HYPRE_Real, n, HYPRE_MEMORY_HOST, hypre_ParVectorMemoryLocation(f)); - } - else - { - f_data_host = f_data; - } - - if (hypre_GetActualMemLocation(hypre_ParVectorMemoryLocation(u)) != hypre_MEMORY_HOST) - { - u_data_host = hypre_TAlloc(HYPRE_Real, n, HYPRE_MEMORY_HOST); - } - else - { - u_data_host = u_data; - } + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unsupported solver type!"); + return hypre_error_flag; + } - hypre_MPI_Allgatherv (f_data_host, n, HYPRE_MPI_REAL, b_vec, info, - displs, HYPRE_MPI_REAL, new_comm); + /* Check if we need to allocate a work space for setting the values of uvec/bvec */ + if (hypre_GetActualMemLocation(ge_memory_location) != hypre_MEMORY_HOST) + { + b_data_h = hypre_TAlloc(HYPRE_Real, global_num_rows, HYPRE_MEMORY_HOST); + u_data_h = hypre_TAlloc(HYPRE_Real, global_num_rows, HYPRE_MEMORY_HOST); + } + else + { + b_data_h = b_vec; + u_data_h = u_vec; + } - if (f_data_host != f_data) - { - hypre_TFree(f_data_host, HYPRE_MEMORY_HOST); - } + /*----------------------------------------------------------------- + * Gather RHS phase + *-----------------------------------------------------------------*/ - if (relax_type == 9 || relax_type == 99) + if (solver_type == 9 || solver_type == 99 || solver_type == 199) + { + /* Exit if no rows in this rank */ + if (!num_rows) { - HYPRE_Real *A_mat = hypre_ParAMGDataAMat(amg_data); - HYPRE_Real *A_tmp; - HYPRE_Int i, my_info; - - A_tmp = hypre_CTAlloc(HYPRE_Real, n_global*n_global, HYPRE_MEMORY_HOST); - for (i = 0; i < n_global*n_global; i++) + if (u_data_h != u_vec) { - A_tmp[i] = A_mat[i]; + hypre_TFree(u_data_h, HYPRE_MEMORY_HOST); } - - if (relax_type == 9) + if (b_data_h != b_vec) { - hypre_gselim(A_tmp, b_vec, n_global, error_flag); + hypre_TFree(b_data_h, HYPRE_MEMORY_HOST); } - else if (relax_type == 99) /* use pivoting */ - { - HYPRE_Int *piv = hypre_CTAlloc(HYPRE_Int, n_global, HYPRE_MEMORY_HOST); - /* write over A with LU */ - hypre_dgetrf(&n_global, &n_global, A_tmp, &n_global, piv, &my_info); + /* Finalize profiling */ + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; - /* now b_vec = inv(A)*b_vec */ - hypre_dgetrs("N", &n_global, &one_i, A_tmp, &n_global, piv, b_vec, &n_global, &my_info); - - hypre_TFree(piv, HYPRE_MEMORY_HOST); - } + return hypre_error_flag; + } - for (i = 0; i < n; i++) - { - u_data_host[i] = b_vec[first_row_index+i]; - } + hypre_MPI_Comm_size(new_comm, &new_num_procs); + info = &comm_info[0]; + displs = &comm_info[new_num_procs]; - hypre_TFree(A_tmp, HYPRE_MEMORY_HOST); + if (hypre_GetActualMemLocation(hypre_ParVectorMemoryLocation(f)) != hypre_MEMORY_HOST) + { + f_data_h = hypre_TAlloc(HYPRE_Real, num_rows, HYPRE_MEMORY_HOST); + hypre_TMemcpy(f_data_h, f_data, HYPRE_Real, num_rows, HYPRE_MEMORY_HOST, + hypre_ParVectorMemoryLocation(f)); } - else if (relax_type == 199) + else { - HYPRE_Real *Ainv = hypre_ParAMGDataAInv(amg_data); - - char cN = 'N'; - HYPRE_Real one = 1.0, zero = 0.0; - hypre_dgemv(&cN, &n, &n_global, &one, Ainv, &n, b_vec, &one_i, &zero, u_data_host, &one_i); + f_data_h = f_data; } - if (u_data_host != u_data) + /* TODO (VPM): Add GPU-aware MPI support to buffers */ + hypre_MPI_Allgatherv(f_data_h, num_rows, HYPRE_MPI_REAL, b_data_h, + info, displs, HYPRE_MPI_REAL, new_comm); + + if (f_data_h != f_data) { - hypre_TMemcpy(u_data, u_data_host, HYPRE_Real, n, hypre_ParVectorMemoryLocation(u), HYPRE_MEMORY_HOST); - hypre_TFree(u_data_host, HYPRE_MEMORY_HOST); + hypre_TFree(f_data_h, HYPRE_MEMORY_HOST); } } - - if (error_flag) + else /* if (solver_type == 19 || solver_type == 98 || solver_type == 198) */ { - hypre_error(HYPRE_ERROR_GENERIC); + f_all = hypre_ParVectorToVectorAll_v2(f, HYPRE_MEMORY_HOST); } -#ifdef HYPRE_PROFILE - hypre_profile_times[HYPRE_TIMER_ID_GS_ELIM_SOLVE] += hypre_MPI_Wtime(); -#endif - - return hypre_error_flag; -} - - - - - - - - - - - - - - - - - - - - - - - - - - - + /* Complete the computation of bvec and free work space if needed */ + if (f_all) + { + hypre_TMemcpy(b_vec, hypre_VectorData(f_all), HYPRE_Real, global_num_rows, + ge_memory_location, HYPRE_MEMORY_HOST); + } + else + { + if (b_data_h != b_vec) + { + hypre_TMemcpy(b_vec, b_data_h, HYPRE_Real, global_num_rows, + ge_memory_location, HYPRE_MEMORY_HOST); + hypre_TFree(b_data_h, HYPRE_MEMORY_HOST); + } + } + /* Exit if no rows in this rank */ + if (!num_rows) + { + if (u_data_h != u_vec) + { + hypre_TFree(u_data_h, HYPRE_MEMORY_HOST); + } + if (b_data_h != b_vec) + { + hypre_TFree(b_data_h, HYPRE_MEMORY_HOST); + } + /* Finalize profiling */ + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; + } -#if 0 -#include "HYPRE_config.h" -#ifndef HYPRE_SEQUENTIAL -#define HYPRE_SEQUENTIAL -#endif -#include "_hypre_utilities.h" -#include "_hypre_blas.h" + /*----------------------------------------------------------------- + * Gaussian elimination solve + *-----------------------------------------------------------------*/ #if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1(ge_memory_location); -#define BLOCK_SIZE 512 - -__global__ void -hypreCUDAKernel_dgemv(HYPRE_Int m, - HYPRE_Int n, - HYPRE_Int lda, - HYPRE_Real *a, - HYPRE_Real *x, - HYPRE_Real *y) -{ - __shared__ HYPRE_Real sh_x[BLOCK_SIZE]; - - HYPRE_Int row = hypre_cuda_get_grid_thread_id<1,1>(); - HYPRE_Int tid = hypre_cuda_get_thread_id<1>(); - - HYPRE_Real y_row = 0.0; - - for (HYPRE_Int k = 0; k < n; k += BLOCK_SIZE) + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_GaussElimSolveDevice(amg_data, level, solver_type); + } + else +#endif { - if (k + tid < n) + if (solver_type == 9 || solver_type == 19) { - sh_x[tid] = read_only_load(&x[k+tid]); - } + /* Copy matrix to work space */ + hypre_TMemcpy(A_work, A_mat, HYPRE_Real, global_size, + HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); - __syncthreads(); + /* Run hypre's internal gaussian elimination */ + hypre_gselim(A_work, b_vec, global_num_rows, ierr); + if (ierr != 0) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Problem with hypre_gselim!"); + } - if (row < m) + hypre_TMemcpy(u_data, b_data_h + first_row_index, HYPRE_Real, num_rows, + memory_location, HYPRE_MEMORY_HOST); + } + else if (solver_type == 98 || solver_type == 99) { -#pragma unroll - for (HYPRE_Int j = 0; j < BLOCK_SIZE; j++) + /* Run LAPACK's triangular solver */ + hypre_dgetrs("N", &global_num_rows, &one_i, A_mat, + &global_num_rows, A_piv, b_vec, + &global_num_rows, &ierr); + if (ierr != 0) { - const HYPRE_Int col = k + j; - if (col < n) - { - y_row += a[row + col*lda] * sh_x[j]; - } + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Problem with hypre_dgetrs!"); } + + hypre_TMemcpy(u_data, b_data_h + first_row_index, HYPRE_Real, num_rows, + memory_location, HYPRE_MEMORY_HOST); } + else /* if (solver_type == 198 || solver_type == 199) */ + { + hypre_dgemv("N", &global_num_rows, &global_num_rows, &one, + A_mat, &global_num_rows, b_vec, &one_i, &zero, + u_data_h, &one_i); - __syncthreads(); + hypre_TMemcpy(u_data, u_data_h + first_row_index, HYPRE_Real, num_rows, + memory_location, HYPRE_MEMORY_HOST); + } } - if (row < m) + /* Free memory - TODO (VPM): do we need to create and destroy f_all at every solve call? */ + hypre_SeqVectorDestroy(f_all); + if (u_data_h != u_vec) { - y[row] = y_row; + hypre_TFree(u_data_h, HYPRE_MEMORY_HOST); + } + if (b_data_h != b_vec) + { + hypre_TFree(b_data_h, HYPRE_MEMORY_HOST); } -} - -HYPRE_Int hypre_dgemv_device(HYPRE_Int m, HYPRE_Int n, HYPRE_Int lda, HYPRE_Real *a, HYPRE_Real *x, HYPRE_Real *y) -{ - dim3 bDim(BLOCK_SIZE, 1, 1); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(m, "thread", bDim); - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_dgemv, gDim, bDim, m, n, lda, a, x, y ); + /* Finalize profiling */ + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; +#ifdef HYPRE_PROFILE + hypre_profile_times[HYPRE_TIMER_ID_GS_ELIM_SOLVE] += hypre_MPI_Wtime(); +#endif return hypre_error_flag; } - -#endif // defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) -#endif diff --git a/external/hypre/src/parcsr_ls/par_ge_device.c b/external/hypre/src/parcsr_ls/par_ge_device.c new file mode 100644 index 00000000..9527a2d3 --- /dev/null +++ b/external/hypre/src/parcsr_ls/par_ge_device.c @@ -0,0 +1,356 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#include "_hypre_parcsr_ls.h" +#include "_hypre_utilities.hpp" + +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + +/*-------------------------------------------------------------------------- + * hypre_GaussElimSetupDevice + * + * Gaussian elimination setup routine on the device. This uses MAGMA by + * default or any of the vendor math libraries (cuBLAS, rocSOLVER) when + * MAGMA is not available. + * + * See hypre_GaussElimSetup for more info. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GaussElimSetupDevice(hypre_ParAMGData *amg_data, + HYPRE_Int level, + HYPRE_Int solver_type) +{ + /* Input data */ + hypre_ParCSRMatrix *par_A = hypre_ParAMGDataAArray(amg_data)[level]; + HYPRE_Int global_num_rows = (HYPRE_Int) hypre_ParCSRMatrixGlobalNumRows(par_A); + HYPRE_Int num_rows = hypre_ParCSRMatrixNumRows(par_A); + HYPRE_Int *A_piv = hypre_ParAMGDataAPiv(amg_data); + HYPRE_Real *A_mat = hypre_ParAMGDataAMat(amg_data); + HYPRE_Real *A_work = hypre_ParAMGDataAWork(amg_data); + HYPRE_Int global_size = global_num_rows * global_num_rows; + + /* Local variables */ + HYPRE_Int buffer_size = 0; + HYPRE_Int ierr = 0; + HYPRE_Int *d_ierr = NULL; + char msg[1024]; + + /* Sanity checks */ + if (!num_rows || !global_size) + { + return hypre_error_flag; + } + + if (global_size < 0) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Detected overflow!"); + return hypre_error_flag; + } + + /*----------------------------------------------------------------- + * Compute the factorization A = L*U + *-----------------------------------------------------------------*/ + +#if defined(HYPRE_USING_MAGMA) + HYPRE_MAGMA_CALL(hypre_magma_getrf_nat(global_num_rows, + global_num_rows, + A_mat, + global_num_rows, + A_piv, + &ierr)); + +#elif defined(HYPRE_USING_CUSOLVER) + /* Allocate space for device error code */ + d_ierr = hypre_CTAlloc(HYPRE_Int, 1, HYPRE_MEMORY_DEVICE); + + /* Compute buffer size */ + HYPRE_CUSOLVER_CALL(hypre_cusolver_dngetrf_bs(hypre_HandleVendorSolverHandle(hypre_handle()), + global_num_rows, + global_num_rows, + A_mat, + global_num_rows, + &buffer_size)); + + /* We use A_work as workspace */ + if (buffer_size > global_size) + { + A_work = hypre_TReAlloc_v2(A_work, HYPRE_Real, global_size, HYPRE_Real, buffer_size, + HYPRE_MEMORY_DEVICE); + hypre_ParAMGDataAWork(amg_data) = A_work; + } + + /* Factorize */ + HYPRE_CUSOLVER_CALL(hypre_cusolver_dngetrf(hypre_HandleVendorSolverHandle(hypre_handle()), + global_num_rows, + global_num_rows, + A_mat, + global_num_rows, + A_work, + A_piv, + d_ierr)); + + /* Move error code to host */ + hypre_TMemcpy(&ierr, d_ierr, HYPRE_Int, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); + +#elif defined(HYPRE_USING_ROCSOLVER) + + /************** + * TODO (VPM) * + **************/ + HYPRE_UNUSED_VAR(A_piv); + HYPRE_UNUSED_VAR(A_mat); + HYPRE_UNUSED_VAR(A_work); + HYPRE_UNUSED_VAR(buffer_size); + +#else + /* Silence declared but never referenced warnings */ + (A_piv += 0); + (A_mat += 0); + (A_work += 0); + (buffer_size *= 1); + + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "Missing dependency library for running gaussian elimination!"); +#endif + + /* Free memory */ + hypre_TFree(d_ierr, HYPRE_MEMORY_DEVICE); + + if (ierr < 0) + { + hypre_sprintf(msg, "Problem with getrf's %d-th input argument", -ierr); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, msg); + return hypre_error_flag; + } + else if (ierr > 0) + { + hypre_sprintf(msg, "Found that U(%d, %d) = 0", ierr, ierr); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, msg); + return hypre_error_flag; + } + + /*----------------------------------------------------------------- + * Compute the explicit inverse: A^{-1} = inv(A) + *-----------------------------------------------------------------*/ + + if (solver_type == 198 || solver_type == 199) + { +#if defined(HYPRE_USING_MAGMA) + /* Determine workspace size */ + buffer_size = global_num_rows * hypre_magma_getri_nb(global_num_rows); + + /* We use A_work as workspace */ + if (buffer_size > global_size) + { + A_work = hypre_TReAlloc_v2(A_work, HYPRE_Real, global_size, HYPRE_Real, buffer_size, + HYPRE_MEMORY_DEVICE); + hypre_ParAMGDataAWork(amg_data) = A_work; + } + + HYPRE_MAGMA_CALL(hypre_magma_getri_gpu(global_num_rows, + A_mat, + global_num_rows, + A_piv, + A_work, + buffer_size, + &ierr)); + +#elif defined(HYPRE_USING_CUSOLVER) + /* Allocate space for device error code */ + d_ierr = hypre_CTAlloc(HYPRE_Int, 1, HYPRE_MEMORY_DEVICE); + + /* Create identity dense matrix */ + hypre_Memset((void*) A_work, 0, + (size_t) global_size * sizeof(HYPRE_Real), + HYPRE_MEMORY_DEVICE); + HYPRE_THRUST_CALL(for_each, + thrust::make_counting_iterator(0), + thrust::make_counting_iterator(global_num_rows), + hypreFunctor_DenseMatrixIdentity(global_num_rows, A_work)); + + /* Compute inverse */ + HYPRE_CUSOLVER_CALL(hypre_cusolver_dngetrs(hypre_HandleVendorSolverHandle(hypre_handle()), + CUBLAS_OP_N, + global_num_rows, + global_num_rows, + A_mat, + global_num_rows, + A_piv, + A_work, + global_num_rows, + d_ierr)); + + /* Store the inverse in A_mat */ + hypre_TMemcpy(A_mat, A_work, HYPRE_Real, global_size, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + + /* Free memory */ + hypre_TFree(d_ierr, HYPRE_MEMORY_DEVICE); + +#elif defined(HYPRE_USING_ROCSOLVER) + + /************** + * TODO (VPM) * + **************/ + +#else + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "Missing dependency library for running gaussian elimination!"); +#endif + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_GaussElimSolveDevice + * + * Gaussian elimination solve routine on the device. + * + * See hypre_GaussElimSolve and hypre_GaussElimSetupDevice for more info. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GaussElimSolveDevice(hypre_ParAMGData *amg_data, + HYPRE_Int level, + HYPRE_Int solver_type) +{ + /* Input variables */ + hypre_ParCSRMatrix *A = hypre_ParAMGDataAArray(amg_data)[level]; + HYPRE_Int global_num_rows = (HYPRE_Int) hypre_ParCSRMatrixGlobalNumRows(A); + HYPRE_Int first_row_index = (HYPRE_Int) hypre_ParCSRMatrixFirstRowIndex(A); + HYPRE_Int num_rows = hypre_ParCSRMatrixNumRows(A); + HYPRE_MemoryLocation memory_location = hypre_ParCSRMatrixMemoryLocation(A); + HYPRE_MemoryLocation ge_memory_location = hypre_ParAMGDataGEMemoryLocation(amg_data); + + hypre_ParVector *par_u = hypre_ParAMGDataUArray(amg_data)[level]; + HYPRE_Real *u_data = hypre_VectorData(hypre_ParVectorLocalVector(par_u)); + + HYPRE_Real *b_vec = hypre_ParAMGDataBVec(amg_data); + HYPRE_Real *u_vec = hypre_ParAMGDataUVec(amg_data); + HYPRE_Real *A_mat = hypre_ParAMGDataAMat(amg_data); + HYPRE_Int *A_piv = hypre_ParAMGDataAPiv(amg_data); + + /* Local variables */ + HYPRE_Real *work; + HYPRE_Int *d_ierr = NULL; + HYPRE_Int ierr = 0; + HYPRE_Int i_one = 1; + HYPRE_Complex d_one = 1.0; + HYPRE_Complex zero = 0.0; + char msg[1024]; + + /* Sanity check */ + if (!num_rows || !global_num_rows) + { + return hypre_error_flag; + } + +#if defined(HYPRE_USING_MAGMA) + if (solver_type == 98 || solver_type == 99) + { + HYPRE_MAGMA_CALL(hypre_magma_getrs_gpu(MagmaNoTrans, + global_num_rows, + i_one, + A_mat, + global_num_rows, + A_piv, + b_vec, + global_num_rows, + &ierr)); + } + else if (solver_type == 198 || solver_type == 199) + { + HYPRE_MAGMA_VCALL(hypre_magma_gemv(MagmaNoTrans, + global_num_rows, + global_num_rows, + d_one, + A_mat, + global_num_rows, + b_vec, + i_one, + zero, + u_vec, + i_one, + hypre_HandleMagmaQueue(hypre_handle()))); + } + +#elif defined(HYPRE_USING_CUSOLVER) && defined(HYPRE_USING_CUBLAS) + if (solver_type == 98 || solver_type == 99) + { + d_ierr = hypre_CTAlloc(HYPRE_Int, 1, HYPRE_MEMORY_DEVICE); + HYPRE_CUSOLVER_CALL(hypre_cusolver_dngetrs(hypre_HandleVendorSolverHandle(hypre_handle()), + CUBLAS_OP_N, + global_num_rows, + d_one, + A_mat, + global_num_rows, + A_piv, + b_vec, + global_num_rows, + d_ierr)); + hypre_TMemcpy(&ierr, d_ierr, HYPRE_Int, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); + } + else if (solver_type == 198 || solver_type == 199) + { + HYPRE_CUBLAS_CALL(hypre_cublas_gemv(hypre_HandleCublasHandle(hypre_handle()), + CUBLAS_OP_N, + global_num_rows, + global_num_rows, + &d_one, + A_mat, + global_num_rows, + b_vec, + i_one, + &zero, + u_vec, + i_one)); + } +#elif defined(HYPRE_USING_ROCSOLVER) + + /************** + * TODO (VPM) * + **************/ + HYPRE_UNUSED_VAR(A_piv); + HYPRE_UNUSED_VAR(A_mat); + HYPRE_UNUSED_VAR(i_one); + HYPRE_UNUSED_VAR(d_one); + HYPRE_UNUSED_VAR(zero); + +#else + /* Silence declared but never referenced warnings */ + (A_mat += 0); + (A_piv += 0); + (i_one *= 1); + (d_one *= 1.0); + (zero *= zero); + + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "Missing dependency library for running gaussian elimination!"); +#endif + + /* Check error code */ + if (ierr < 0) + { + hypre_sprintf(msg, "Problem with getrs' %d-th input argument", -ierr); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, msg); + return hypre_error_flag; + } + + /* Copy solution vector to proper variable */ + work = (solver_type == 198 || solver_type == 199) ? u_vec : b_vec; + hypre_TMemcpy(u_data, work + first_row_index, HYPRE_Complex, num_rows, + memory_location, ge_memory_location); + + /* Free memory */ + hypre_TFree(d_ierr, HYPRE_MEMORY_DEVICE); + + return hypre_error_flag; +} + +#endif /* if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) */ diff --git a/external/hypre/src/parcsr_ls/par_gsmg.c b/external/hypre/src/parcsr_ls/par_gsmg.c index 18e77e9a..1c40dc14 100644 --- a/external/hypre/src/parcsr_ls/par_gsmg.c +++ b/external/hypre/src/parcsr_ls/par_gsmg.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -28,20 +28,24 @@ static HYPRE_Real mydnrm2(HYPRE_Int n, HYPRE_Real *x) { - HYPRE_Real temp = 0.; - HYPRE_Int i; + HYPRE_Real temp = 0.; + HYPRE_Int i; - for (i=0; i 1 && dof_func[i] != dof_func[ii]) - { - S_diag_data[j] = 0.; - continue; - } - - /* explicit zeros */ - if (A_diag_data[j] == 0.) - { - S_diag_data[j] = 0.; - continue; - } - - temp = 0.; - p = samples; - for (k=0; k 1 && dof_func[i] != dof_func[ii]) + { + S_diag_data[j] = 0.; + continue; + } + + /* explicit zeros */ + if (A_diag_data[j] == 0.) + { + S_diag_data[j] = 0.; + continue; + } + + temp = 0.; + p = samples; + for (k = 0; k < nsamples; k++) + { + temp = temp + ABS(p[i] - p[ii]); + p = p + n; + } + + /* explicit zeros in matrix may cause this */ + if (temp == 0.) + { + S_diag_data[j] = 0.; + continue; + } + + temp = 1. / temp; /* reciprocal */ #if 0 - my = hypre_min(my,temp); - mx = hypre_max(mx,temp); + my = hypre_min(my, temp); + mx = hypre_max(mx, temp); #endif - S_diag_data[j] = temp; - } - - for (j = S_offd_i[i]; j < S_offd_i[i+1]; j++) - { - ii = S_offd_j[j]; - - /* only interpolate between like functions */ - if (num_functions > 1 && dof_func[i] != dof_func_offd[ii]) - { - S_offd_data[j] = 0.; - continue; - } - - /* explicit zeros */ - if (A_offd_data[j] == 0.) - { - S_offd_data[j] = 0.; - continue; - } - - temp = 0.; - p = samples; - p_offd = p_ptr; - for (k=0; k 1 && dof_func[i] != dof_func_offd[ii]) + { + S_offd_data[j] = 0.; + continue; + } + + /* explicit zeros */ + if (A_offd_data[j] == 0.) + { + S_offd_data[j] = 0.; + continue; + } + + temp = 0.; + p = samples; + p_offd = p_ptr; + for (k = 0; k < nsamples; k++) + { + temp = temp + ABS(p[i] - p_offd[ii]); + p = p + n; + p_offd = p_offd + num_cols_offd; + } + + /* explicit zeros in matrix may cause this */ + if (temp == 0.) + { + S_offd_data[j] = 0.; + continue; + } + + temp = 1. / temp; /* reciprocal */ #if 0 - my = hypre_min(my,temp); - mx = hypre_max(mx,temp); + my = hypre_min(my, temp); + mx = hypre_max(mx, temp); #endif - S_offd_data[j] = temp; - } + S_offd_data[j] = temp; + } } #if 0 - hypre_printf("MIN, MAX: %f %f\n", my, mx); + hypre_printf("MIN, MAX: %f %f\n", my, mx); #endif hypre_TFree(p_ptr, HYPRE_MEMORY_HOST); if (num_functions > 1) + { hypre_TFree(dof_func_offd, HYPRE_MEMORY_HOST); + } return 0; } @@ -262,16 +268,22 @@ hypre_ParCSRMatrixChooseThresh(hypre_ParCSRMatrix *S) HYPRE_Real mx, minimax = 1.e+10; HYPRE_Real minmin; - for (i=0; i= thresh) - count++; + for (i = 0; i < num_nonzeros_diag; i++) + if (A_diag_data[i] >= thresh) + { + count++; + } /* allocate vectors */ - S_diag_i = hypre_CTAlloc(HYPRE_Int, n+1, HYPRE_MEMORY_HOST); + S_diag_i = hypre_CTAlloc(HYPRE_Int, n + 1, HYPRE_MEMORY_HOST); S_diag_j = hypre_CTAlloc(HYPRE_Int, count, HYPRE_MEMORY_HOST); S_diag_data = hypre_CTAlloc(HYPRE_Real, count, HYPRE_MEMORY_HOST); @@ -325,7 +339,7 @@ hypre_ParCSRMatrixThreshold(hypre_ParCSRMatrix *A, HYPRE_Real thresh) for (i = 0; i < n; i++) { S_diag_i[i] = jS; - for (jA = A_diag_i[i]; jA < A_diag_i[i+1]; jA++) + for (jA = A_diag_i[i]; jA < A_diag_i[i + 1]; jA++) { if (A_diag_data[jA] >= thresh) { @@ -354,12 +368,14 @@ hypre_ParCSRMatrixThreshold(hypre_ParCSRMatrix *A, HYPRE_Real thresh) /* first count the number of nonzeros we will need */ count = 0; - for (i=0; i= thresh) - count++; + for (i = 0; i < num_nonzeros_offd; i++) + if (A_offd_data[i] >= thresh) + { + count++; + } /* allocate vectors */ - S_offd_i = hypre_CTAlloc(HYPRE_Int, n+1, HYPRE_MEMORY_HOST); + S_offd_i = hypre_CTAlloc(HYPRE_Int, n + 1, HYPRE_MEMORY_HOST); S_offd_j = hypre_CTAlloc(HYPRE_Int, count, HYPRE_MEMORY_HOST); S_offd_data = hypre_CTAlloc(HYPRE_Real, count, HYPRE_MEMORY_HOST); @@ -367,7 +383,7 @@ hypre_ParCSRMatrixThreshold(hypre_ParCSRMatrix *A, HYPRE_Real thresh) for (i = 0; i < n; i++) { S_offd_i[i] = jS; - for (jA = A_offd_i[i]; jA < A_offd_i[i+1]; jA++) + for (jA = A_offd_i[i]; jA < A_offd_i[i + 1]; jA++) { if (A_offd_data[jA] >= thresh) { @@ -400,10 +416,10 @@ hypre_ParCSRMatrixThreshold(hypre_ParCSRMatrix *A, HYPRE_Real thresh) HYPRE_Int hypre_BoomerAMGCreateSmoothVecs(void *data, - hypre_ParCSRMatrix *A, - HYPRE_Int num_sweeps, - HYPRE_Int level, - HYPRE_Real **SmoothVecs_p) + hypre_ParCSRMatrix *A, + HYPRE_Int num_sweeps, + HYPRE_Int level, + HYPRE_Real **SmoothVecs_p) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; @@ -432,7 +448,7 @@ hypre_BoomerAMGCreateSmoothVecs(void *data, HYPRE_Int smooth_type; HYPRE_Int smooth_option = 0; HYPRE_Int smooth_num_levels; - HYPRE_Solver *smoother; + HYPRE_Solver *smoother = NULL; HYPRE_Int debug_flag = hypre_ParAMGDataDebugFlag(amg_data); HYPRE_Int num_threads; @@ -448,7 +464,7 @@ hypre_BoomerAMGCreateSmoothVecs(void *data, if (debug_flag >= 1) hypre_printf("Creating smooth dirs, %d sweeps, %d samples\n", num_sweeps, - nsamples); + nsamples); smooth_type = hypre_ParAMGDataSmoothType(amg_data); smooth_num_levels = hypre_ParAMGDataSmoothNumLevels(amg_data); @@ -467,14 +483,18 @@ hypre_BoomerAMGCreateSmoothVecs(void *data, Zero = hypre_ParVectorCreate(comm, n, starts); hypre_ParVectorInitialize(Zero); datax = hypre_VectorData(hypre_ParVectorLocalVector(Zero)); - for (i=0; i level) && (smooth_option == 6)) { HYPRE_SchwarzSolve(smoother[level], - (HYPRE_ParCSRMatrix) A, - (HYPRE_ParVector) Zero, - (HYPRE_ParVector) U); + (HYPRE_ParCSRMatrix) A, + (HYPRE_ParVector) Zero, + (HYPRE_ParVector) U); } else { ret = hypre_BoomerAMGRelax(A, Zero, NULL /*CFmarker*/, - rlx_type , 0 /*rel pts*/, 1.0 /*weight*/, - 1.0 /*omega*/, NULL, U, Temp, - Qtemp); + rlx_type, 0 /*rel pts*/, 1.0 /*weight*/, + 1.0 /*omega*/, NULL, U, Temp, + Qtemp); hypre_assert(ret == 0); } } /* copy out the solution */ - for (i=0; i 1) + { hypre_ParVectorDestroy(Qtemp); + } *SmoothVecs_p = bp; @@ -539,12 +565,12 @@ hypre_BoomerAMGCreateSmoothVecs(void *data, HYPRE_Int hypre_BoomerAMGCreateSmoothDirs(void *data, - hypre_ParCSRMatrix *A, - HYPRE_Real *SmoothVecs, - HYPRE_Real thresh, - HYPRE_Int num_functions, - HYPRE_Int *dof_func, - hypre_ParCSRMatrix **S_ptr) + hypre_ParCSRMatrix *A, + HYPRE_Real *SmoothVecs, + HYPRE_Real thresh, + HYPRE_Int num_functions, + HYPRE_Int *dof_func, + hypre_ParCSRMatrix **S_ptr) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; hypre_ParCSRMatrix *S; @@ -555,15 +581,17 @@ hypre_BoomerAMGCreateSmoothDirs(void *data, /* Traverse S and fill in differences */ hypre_ParCSRMatrixFillSmooth( - hypre_ParAMGDataNumSamples(amg_data), SmoothVecs, - S, A, num_functions, dof_func); + hypre_ParAMGDataNumSamples(amg_data), SmoothVecs, + S, A, num_functions, dof_func); minimax = hypre_ParCSRMatrixChooseThresh(S); if (debug_flag >= 1) + { hypre_printf("Minimax chosen: %f\n", minimax); + } /* Threshold and compress */ - hypre_ParCSRMatrixThreshold(S, thresh*minimax); + hypre_ParCSRMatrixThreshold(S, thresh * minimax); *S_ptr = S; @@ -591,13 +619,15 @@ hypre_BoomerAMGNormalizeVecs(HYPRE_Int n, HYPRE_Int num, HYPRE_Real *V) HYPRE_Real nrm; /* change first vector to the constant vector */ - for (i=0; i 1 && num_cols_S_offd) - dof_func_offd = hypre_CTAlloc(HYPRE_Int, num_cols_S_offd, HYPRE_MEMORY_HOST); + { + dof_func_offd = hypre_CTAlloc(HYPRE_Int, num_cols_S_offd, HYPRE_MEMORY_HOST); + } if (!comm_pkg) { hypre_MatvecCommPkgCreate(S); - comm_pkg = hypre_ParCSRMatrixCommPkg(S); + comm_pkg = hypre_ParCSRMatrixCommPkg(S); } num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, - num_sends), HYPRE_MEMORY_HOST); + num_sends), HYPRE_MEMORY_HOST); index = 0; for (i = 0; i < num_sends; i++) { - start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) - int_buf_data[index++] - = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) + int_buf_data[index++] + = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } comm_handle = hypre_ParCSRCommHandleCreate( 11, comm_pkg, int_buf_data, - CF_marker_offd); + CF_marker_offd); hypre_ParCSRCommHandleDestroy(comm_handle); if (num_functions > 1) @@ -829,25 +870,25 @@ hypre_BoomerAMGBuildInterpLS( hypre_ParCSRMatrix *A, index = 0; for (i = 0; i < num_sends; i++) { - start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j=start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) - int_buf_data[index++] - = dof_func[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) + int_buf_data[index++] + = dof_func[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } comm_handle = hypre_ParCSRCommHandleCreate( 11, comm_pkg, int_buf_data, - dof_func_offd); + dof_func_offd); hypre_ParCSRCommHandleDestroy(comm_handle); } hypre_TFree(int_buf_data, HYPRE_MEMORY_HOST); - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Interp: Comm 1 CF_marker = %f\n", - my_id, wall_time); + my_id, wall_time); fflush(NULL); } @@ -855,21 +896,21 @@ hypre_BoomerAMGBuildInterpLS( hypre_ParCSRMatrix *A, * Get the ghost rows of S *---------------------------------------------------------------------*/ - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } if (num_procs > 1) { - S_ext = hypre_ParCSRMatrixExtractBExt(S,S,1); + S_ext = hypre_ParCSRMatrixExtractBExt(S, S, 1); //S_ext_i = hypre_CSRMatrixI(S_ext); //S_ext_j = hypre_CSRMatrixBigJ(S_ext); //S_ext_data = hypre_CSRMatrixData(S_ext); } - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Interp: Comm 2 Get S_ext = %f\n", - my_id, wall_time); + my_id, wall_time); fflush(NULL); } @@ -887,9 +928,9 @@ hypre_BoomerAMGBuildInterpLS( hypre_ParCSRMatrix *A, fine_to_coarse = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i = 0; i < n_fine; i++) fine_to_coarse[i] = -1; + for (i = 0; i < n_fine; i++) { fine_to_coarse[i] = -1; } jj_counter = start_indexing; jj_counter_offd = start_indexing; @@ -898,80 +939,80 @@ hypre_BoomerAMGBuildInterpLS( hypre_ParCSRMatrix *A, * Loop over fine grid. *-----------------------------------------------------------------------*/ -/* RDF: this looks a little tricky, but doable */ + /* RDF: this looks a little tricky, but doable */ #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,j,i1,jj,ns,ne,size,rest) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,j,i1,jj,ns,ne,size,rest) HYPRE_SMP_SCHEDULE #endif for (j = 0; j < num_threads; j++) { - size = n_fine/num_threads; - rest = n_fine - size*num_threads; - if (j < rest) - { - ns = j*size+j; - ne = (j+1)*size+j+1; - } - else - { - ns = j*size+rest; - ne = (j+1)*size+rest; - } - for (i = ns; i < ne; i++) - { - - /*-------------------------------------------------------------------- - * If i is a C-point, interpolation is the identity. Also set up - * mapping vector. - *--------------------------------------------------------------------*/ - - if (CF_marker[i] >= 0) + size = n_fine / num_threads; + rest = n_fine - size * num_threads; + if (j < rest) { - jj_count[j]++; - fine_to_coarse[i] = coarse_counter[j]; - coarse_counter[j]++; + ns = j * size + j; + ne = (j + 1) * size + j + 1; } - - /*-------------------------------------------------------------------- - * If i is an F-point, interpolation is from the C-points that - * strongly influence i. - *--------------------------------------------------------------------*/ - else { - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) + ns = j * size + rest; + ne = (j + 1) * size + rest; + } + for (i = ns; i < ne; i++) + { + + /*-------------------------------------------------------------------- + * If i is a C-point, interpolation is the identity. Also set up + * mapping vector. + *--------------------------------------------------------------------*/ + + if (CF_marker[i] >= 0) { - i1 = S_diag_j[jj]; - if (CF_marker[i1] >= 0) - { - jj_count[j]++; - } + jj_count[j]++; + fine_to_coarse[i] = coarse_counter[j]; + coarse_counter[j]++; } - if (num_procs > 1) + /*-------------------------------------------------------------------- + * If i is an F-point, interpolation is from the C-points that + * strongly influence i. + *--------------------------------------------------------------------*/ + + else { - /* removed */ + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) + { + i1 = S_diag_j[jj]; + if (CF_marker[i1] >= 0) + { + jj_count[j]++; + } + } + + if (num_procs > 1) + { + /* removed */ + } } } - } } /*----------------------------------------------------------------------- * Allocate arrays. *-----------------------------------------------------------------------*/ - for (i=0; i < num_threads-1; i++) + for (i = 0; i < num_threads - 1; i++) { - coarse_counter[i+1] += coarse_counter[i]; - jj_count[i+1] += jj_count[i]; - jj_count_offd[i+1] += jj_count_offd[i]; + coarse_counter[i + 1] += coarse_counter[i]; + jj_count[i + 1] += jj_count[i]; + jj_count_offd[i + 1] += jj_count_offd[i]; } - i = num_threads-1; + i = num_threads - 1; jj_counter = jj_count[i]; jj_counter_offd = jj_count_offd[i]; P_diag_size = jj_counter; - P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, HYPRE_MEMORY_HOST); + P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, HYPRE_MEMORY_HOST); P_diag_j = hypre_CTAlloc(HYPRE_Int, P_diag_size, HYPRE_MEMORY_HOST); P_diag_data = hypre_CTAlloc(HYPRE_Real, P_diag_size, HYPRE_MEMORY_HOST); @@ -980,7 +1021,7 @@ hypre_BoomerAMGBuildInterpLS( hypre_ParCSRMatrix *A, P_offd_size = jj_counter_offd; - P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, HYPRE_MEMORY_HOST); + P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, HYPRE_MEMORY_HOST); P_offd_j = hypre_CTAlloc(HYPRE_Int, P_offd_size, HYPRE_MEMORY_HOST); P_offd_data = hypre_CTAlloc(HYPRE_Real, P_offd_size, HYPRE_MEMORY_HOST); @@ -991,11 +1032,11 @@ hypre_BoomerAMGBuildInterpLS( hypre_ParCSRMatrix *A, jj_counter = start_indexing; jj_counter_offd = start_indexing; - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Interp: Internal work 1 = %f\n", - my_id, wall_time); + my_id, wall_time); fflush(NULL); } @@ -1003,45 +1044,47 @@ hypre_BoomerAMGBuildInterpLS( hypre_ParCSRMatrix *A, * Send and receive fine_to_coarse info. *-----------------------------------------------------------------------*/ - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } /*fine_to_coarse_offd = hypre_CTAlloc(HYPRE_BigInt, num_cols_S_offd, HYPRE_MEMORY_HOST); big_buf_data = hypre_CTAlloc(HYPRE_BigInt, hypre_ParCSRCommPkgSendMapStart(comm_pkg, - num_sends), HYPRE_MEMORY_HOST);*/ + num_sends), HYPRE_MEMORY_HOST);*/ #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,j,ns,ne,size,rest,coarse_shift) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,j,ns,ne,size,rest,coarse_shift) HYPRE_SMP_SCHEDULE #endif for (j = 0; j < num_threads; j++) { - coarse_shift = 0; - if (j > 0) coarse_shift = coarse_counter[j-1]; - size = n_fine/num_threads; - rest = n_fine - size*num_threads; - if (j < rest) - { - ns = j*size+j; - ne = (j+1)*size+j+1; - } - else - { - ns = j*size+rest; - ne = (j+1)*size+rest; - } - for (i = ns; i < ne; i++) - fine_to_coarse[i] += coarse_shift; + coarse_shift = 0; + if (j > 0) { coarse_shift = coarse_counter[j - 1]; } + size = n_fine / num_threads; + rest = n_fine - size * num_threads; + if (j < rest) + { + ns = j * size + j; + ne = (j + 1) * size + j + 1; + } + else + { + ns = j * size + rest; + ne = (j + 1) * size + rest; + } + for (i = ns; i < ne; i++) + { + fine_to_coarse[i] += coarse_shift; + } } /*index = 0; for (i = 0; i < num_sends; i++) { - start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) - big_buf_data[index++] - = my_first_cpt+(HYPRE_BigInt)fine_to_coarse[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + big_buf_data[index++] + = my_first_cpt+(HYPRE_BigInt)fine_to_coarse[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; } comm_handle = hypre_ParCSRCommHandleCreate( 21, comm_pkg, big_buf_data, - fine_to_coarse_offd); + fine_to_coarse_offd); hypre_ParCSRCommHandleDestroy(comm_handle); @@ -1060,80 +1103,80 @@ hypre_BoomerAMGBuildInterpLS( hypre_ParCSRMatrix *A, *-----------------------------------------------------------------------*/ #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,j,jl,i1,jj,ns,ne,size,rest,P_marker,jj_counter,jj_counter_offd) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,j,jl,i1,jj,ns,ne,size,rest,P_marker,jj_counter,jj_counter_offd) HYPRE_SMP_SCHEDULE #endif for (jl = 0; jl < num_threads; jl++) { - size = n_fine/num_threads; - rest = n_fine - size*num_threads; - if (jl < rest) - { - ns = jl*size+jl; - ne = (jl+1)*size+jl+1; - } - else - { - ns = jl*size+rest; - ne = (jl+1)*size+rest; - } - jj_counter = 0; - if (jl > 0) jj_counter = jj_count[jl-1]; - jj_counter_offd = 0; - if (jl > 0) jj_counter_offd = jj_count_offd[jl-1]; - - for (i = ns; i < ne; i++) - { - - /*-------------------------------------------------------------------- - * If i is a c-point, interpolation is the identity. - *--------------------------------------------------------------------*/ - - if (CF_marker[i] >= 0) + size = n_fine / num_threads; + rest = n_fine - size * num_threads; + if (jl < rest) { - P_diag_i[i] = jj_counter; - P_diag_j[jj_counter] = fine_to_coarse[i]; - P_diag_data[jj_counter] = one; - jj_counter++; + ns = jl * size + jl; + ne = (jl + 1) * size + jl + 1; } - - /*-------------------------------------------------------------------- - * If i is an F-point, build interpolation. - *--------------------------------------------------------------------*/ - else { - HYPRE_Int kk; - HYPRE_Int indices[1000]; /* kludge */ + ns = jl * size + rest; + ne = (jl + 1) * size + rest; + } + jj_counter = 0; + if (jl > 0) { jj_counter = jj_count[jl - 1]; } + jj_counter_offd = 0; + if (jl > 0) { jj_counter_offd = jj_count_offd[jl - 1]; } + + for (i = ns; i < ne; i++) + { + + /*-------------------------------------------------------------------- + * If i is a c-point, interpolation is the identity. + *--------------------------------------------------------------------*/ + + if (CF_marker[i] >= 0) + { + P_diag_i[i] = jj_counter; + P_diag_j[jj_counter] = fine_to_coarse[i]; + P_diag_data[jj_counter] = one; + jj_counter++; + } - /* Diagonal part of P */ - P_diag_i[i] = jj_counter; + /*-------------------------------------------------------------------- + * If i is an F-point, build interpolation. + *--------------------------------------------------------------------*/ - kk = 0; - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) + else { - i1 = S_diag_j[jj]; + HYPRE_Int kk; + HYPRE_Int indices[1000]; /* kludge */ - /*-------------------------------------------------------------- - * If neighbor i1 is a C-point, set column number in P_diag_j - * and initialize interpolation weight to zero. - *--------------------------------------------------------------*/ + /* Diagonal part of P */ + P_diag_i[i] = jj_counter; - if (CF_marker[i1] >= 0) + kk = 0; + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) { - P_diag_j[jj_counter] = fine_to_coarse[i1]; - jj_counter++; - indices[kk] = i1; - kk++; + i1 = S_diag_j[jj]; + + /*-------------------------------------------------------------- + * If neighbor i1 is a C-point, set column number in P_diag_j + * and initialize interpolation weight to zero. + *--------------------------------------------------------------*/ + + if (CF_marker[i1] >= 0) + { + P_diag_j[jj_counter] = fine_to_coarse[i1]; + jj_counter++; + indices[kk] = i1; + kk++; + } } - } - hypre_BoomerAMGFitVectors(i, n_fine, num_smooth, SmoothVecs, - kk, indices, &P_diag_data[P_diag_i[i]]); + hypre_BoomerAMGFitVectors(i, n_fine, num_smooth, SmoothVecs, + kk, indices, &P_diag_data[P_diag_i[i]]); - /* Off-Diagonal part of P */ - /* undone */ + /* Off-Diagonal part of P */ + /* undone */ + } } - } } P_diag_i[i] = jj_counter; /* check that this is in right place for threads */ @@ -1177,47 +1220,51 @@ hypre_BoomerAMGBuildInterpLS( hypre_ParCSRMatrix *A, P_marker = hypre_CTAlloc(HYPRE_Int, P_offd_size, HYPRE_MEMORY_HOST); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i=0; i < P_offd_size; i++) - P_marker[i] = P_offd_j[i]; + for (i = 0; i < P_offd_size; i++) + { + P_marker[i] = P_offd_j[i]; + } - hypre_qsort0(P_marker, 0, P_offd_size-1); + hypre_qsort0(P_marker, 0, P_offd_size - 1); num_cols_P_offd = 1; index = P_marker[0]; - for (i=1; i < P_offd_size; i++) + for (i = 1; i < P_offd_size; i++) { - if (P_marker[i] > index) - { - index = P_marker[i]; - P_marker[num_cols_P_offd++] = index; - } + if (P_marker[i] > index) + { + index = P_marker[i]; + P_marker[num_cols_P_offd++] = index; + } } col_map_offd_P = hypre_CTAlloc(HYPRE_BigInt, num_cols_P_offd, HYPRE_MEMORY_HOST); tmp_map_offd = hypre_CTAlloc(HYPRE_Int, num_cols_P_offd, HYPRE_MEMORY_HOST); - for (i=0; i < num_cols_P_offd; i++) + for (i = 0; i < num_cols_P_offd; i++) + { tmp_map_offd[i] = P_marker[i]; + } #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i=0; i < P_offd_size; i++) - P_offd_j[i] = hypre_BinarySearch(tmp_map_offd, - P_offd_j[i], - num_cols_P_offd); + for (i = 0; i < P_offd_size; i++) + P_offd_j[i] = hypre_BinarySearch(tmp_map_offd, + P_offd_j[i], + num_cols_P_offd); hypre_TFree(P_marker, HYPRE_MEMORY_HOST); } if (num_cols_P_offd) { - hypre_ParCSRMatrixColMapOffd(P) = col_map_offd_P; - hypre_CSRMatrixNumCols(P_offd) = num_cols_P_offd; + hypre_ParCSRMatrixColMapOffd(P) = col_map_offd_P; + hypre_CSRMatrixNumCols(P_offd) = num_cols_P_offd; } - hypre_GetCommPkgRTFromCommPkgA(P,S,fine_to_coarse, tmp_map_offd); + hypre_GetCommPkgRTFromCommPkgA(P, S, fine_to_coarse, tmp_map_offd); *P_ptr = P; @@ -1229,12 +1276,11 @@ hypre_BoomerAMGBuildInterpLS( hypre_ParCSRMatrix *A, hypre_TFree(coarse_counter, HYPRE_MEMORY_HOST); hypre_TFree(jj_count, HYPRE_MEMORY_HOST); hypre_TFree(jj_count_offd, HYPRE_MEMORY_HOST); + hypre_CSRMatrixDestroy(S_ext); - if (num_procs > 1) hypre_CSRMatrixDestroy(S_ext); - - return(0); - + return hypre_error_flag; } + /*--------------------------------------------------------------------------- * hypre_BoomerAMGBuildInterpGSMG * @@ -1244,17 +1290,18 @@ hypre_BoomerAMGBuildInterpLS( hypre_ParCSRMatrix *A, HYPRE_Int hypre_BoomerAMGBuildInterpGSMG( hypre_ParCSRMatrix *A, - HYPRE_Int *CF_marker, - hypre_ParCSRMatrix *S, - HYPRE_BigInt *num_cpts_global, - HYPRE_Int num_functions, - HYPRE_Int *dof_func, - HYPRE_Int debug_flag, - HYPRE_Real trunc_factor, - hypre_ParCSRMatrix **P_ptr) + HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, + HYPRE_BigInt *num_cpts_global, + HYPRE_Int num_functions, + HYPRE_Int *dof_func, + HYPRE_Int debug_flag, + HYPRE_Real trunc_factor, + hypre_ParCSRMatrix **P_ptr) { + HYPRE_UNUSED_VAR(A); - MPI_Comm comm = hypre_ParCSRMatrixComm(S); + MPI_Comm comm = hypre_ParCSRMatrixComm(S); hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(S); hypre_ParCSRCommHandle *comm_handle; @@ -1273,16 +1320,16 @@ hypre_BoomerAMGBuildInterpGSMG( hypre_ParCSRMatrix *A, HYPRE_Int *tmp_map_offd = NULL; hypre_ParCSRMatrix *P; - HYPRE_BigInt *col_map_offd_P; + HYPRE_BigInt *col_map_offd_P; HYPRE_Int *CF_marker_offd; HYPRE_Int *dof_func_offd = NULL; - hypre_CSRMatrix *S_ext; + hypre_CSRMatrix *S_ext = NULL; - HYPRE_Real *S_ext_data; - HYPRE_Int *S_ext_i; - HYPRE_BigInt *S_ext_j; + HYPRE_Real *S_ext_data = NULL; + HYPRE_Int *S_ext_i = NULL; + HYPRE_BigInt *S_ext_j = NULL; hypre_CSRMatrix *P_diag; hypre_CSRMatrix *P_offd; @@ -1298,10 +1345,10 @@ hypre_BoomerAMGBuildInterpGSMG( hypre_ParCSRMatrix *A, HYPRE_Int *P_marker, *P_marker_offd; - HYPRE_Int jj_counter,jj_counter_offd; + HYPRE_Int jj_counter, jj_counter_offd; HYPRE_Int *jj_count, *jj_count_offd; - HYPRE_Int jj_begin_row,jj_begin_row_offd; - HYPRE_Int jj_end_row,jj_end_row_offd; + HYPRE_Int jj_begin_row, jj_begin_row_offd; + HYPRE_Int jj_end_row, jj_end_row_offd; HYPRE_Int start_indexing = 0; /* start indexing for P_data at 0 */ @@ -1317,8 +1364,8 @@ hypre_BoomerAMGBuildInterpGSMG( hypre_ParCSRMatrix *A, //HYPRE_BigInt my_first_cpt; HYPRE_BigInt big_i2; - HYPRE_Int i,i1,i2; - HYPRE_Int j,jl,jj,jj1; + HYPRE_Int i, i1, i2; + HYPRE_Int j, jl, jj, jj1; HYPRE_Int start; HYPRE_Int c_num; @@ -1343,7 +1390,7 @@ hypre_BoomerAMGBuildInterpGSMG( hypre_ParCSRMatrix *A, HYPRE_Real wall_time; /* for debugging instrumentation */ hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_rank(comm, &my_id); num_threads = hypre_NumThreads(); //my_first_cpt = num_cpts_global[0]; @@ -1356,33 +1403,35 @@ hypre_BoomerAMGBuildInterpGSMG( hypre_ParCSRMatrix *A, * Get the CF_marker data for the off-processor columns *-------------------------------------------------------------------*/ - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } CF_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_S_offd, HYPRE_MEMORY_HOST); if (num_functions > 1 && num_cols_S_offd) - dof_func_offd = hypre_CTAlloc(HYPRE_Int, num_cols_S_offd, HYPRE_MEMORY_HOST); + { + dof_func_offd = hypre_CTAlloc(HYPRE_Int, num_cols_S_offd, HYPRE_MEMORY_HOST); + } if (!comm_pkg) { - hypre_MatvecCommPkgCreate(S); - comm_pkg = hypre_ParCSRMatrixCommPkg(S); + hypre_MatvecCommPkgCreate(S); + comm_pkg = hypre_ParCSRMatrixCommPkg(S); } num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, - num_sends), HYPRE_MEMORY_HOST); + num_sends), HYPRE_MEMORY_HOST); index = 0; for (i = 0; i < num_sends; i++) { - start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) - int_buf_data[index++] - = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) + int_buf_data[index++] + = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } comm_handle = hypre_ParCSRCommHandleCreate( 11, comm_pkg, int_buf_data, - CF_marker_offd); + CF_marker_offd); hypre_ParCSRCommHandleDestroy(comm_handle); if (num_functions > 1) @@ -1390,23 +1439,23 @@ hypre_BoomerAMGBuildInterpGSMG( hypre_ParCSRMatrix *A, index = 0; for (i = 0; i < num_sends; i++) { - start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j=start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) - int_buf_data[index++] - = dof_func[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) + int_buf_data[index++] + = dof_func[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } comm_handle = hypre_ParCSRCommHandleCreate( 11, comm_pkg, int_buf_data, - dof_func_offd); + dof_func_offd); hypre_ParCSRCommHandleDestroy(comm_handle); } - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Interp: Comm 1 CF_marker = %f\n", - my_id, wall_time); + my_id, wall_time); fflush(NULL); } @@ -1414,21 +1463,21 @@ hypre_BoomerAMGBuildInterpGSMG( hypre_ParCSRMatrix *A, * Get the ghost rows of S *---------------------------------------------------------------------*/ - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } if (num_procs > 1) { - S_ext = hypre_ParCSRMatrixExtractBExt(S,S,1); + S_ext = hypre_ParCSRMatrixExtractBExt(S, S, 1); S_ext_i = hypre_CSRMatrixI(S_ext); S_ext_j = hypre_CSRMatrixBigJ(S_ext); S_ext_data = hypre_CSRMatrixData(S_ext); } - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Interp: Comm 2 Get S_ext = %f\n", - my_id, wall_time); + my_id, wall_time); fflush(NULL); } @@ -1446,9 +1495,9 @@ hypre_BoomerAMGBuildInterpGSMG( hypre_ParCSRMatrix *A, fine_to_coarse = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i = 0; i < n_fine; i++) fine_to_coarse[i] = -1; + for (i = 0; i < n_fine; i++) { fine_to_coarse[i] = -1; } jj_counter = start_indexing; jj_counter_offd = start_indexing; @@ -1457,87 +1506,87 @@ hypre_BoomerAMGBuildInterpGSMG( hypre_ParCSRMatrix *A, * Loop over fine grid. *-----------------------------------------------------------------------*/ -/* RDF: this looks a little tricky, but doable */ + /* RDF: this looks a little tricky, but doable */ #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,j,i1,jj,ns,ne,size,rest) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,j,i1,jj,ns,ne,size,rest) HYPRE_SMP_SCHEDULE #endif for (j = 0; j < num_threads; j++) { - size = n_fine/num_threads; - rest = n_fine - size*num_threads; - if (j < rest) - { - ns = j*size+j; - ne = (j+1)*size+j+1; - } - else - { - ns = j*size+rest; - ne = (j+1)*size+rest; - } - for (i = ns; i < ne; i++) - { - - /*-------------------------------------------------------------------- - * If i is a C-point, interpolation is the identity. Also set up - * mapping vector. - *--------------------------------------------------------------------*/ - - if (CF_marker[i] >= 0) + size = n_fine / num_threads; + rest = n_fine - size * num_threads; + if (j < rest) { - jj_count[j]++; - fine_to_coarse[i] = coarse_counter[j]; - coarse_counter[j]++; + ns = j * size + j; + ne = (j + 1) * size + j + 1; } - - /*-------------------------------------------------------------------- - * If i is an F-point, interpolation is from the C-points that - * strongly influence i. - *--------------------------------------------------------------------*/ - else { - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) + ns = j * size + rest; + ne = (j + 1) * size + rest; + } + for (i = ns; i < ne; i++) + { + + /*-------------------------------------------------------------------- + * If i is a C-point, interpolation is the identity. Also set up + * mapping vector. + *--------------------------------------------------------------------*/ + + if (CF_marker[i] >= 0) { - i1 = S_diag_j[jj]; - if (CF_marker[i1] >= 0) - { - jj_count[j]++; - } + jj_count[j]++; + fine_to_coarse[i] = coarse_counter[j]; + coarse_counter[j]++; } - if (num_procs > 1) + /*-------------------------------------------------------------------- + * If i is an F-point, interpolation is from the C-points that + * strongly influence i. + *--------------------------------------------------------------------*/ + + else { - for (jj = S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) { - i1 = S_offd_j[jj]; - if (CF_marker_offd[i1] >= 0) + i1 = S_diag_j[jj]; + if (CF_marker[i1] >= 0) { - jj_count_offd[j]++; + jj_count[j]++; + } + } + + if (num_procs > 1) + { + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) + { + i1 = S_offd_j[jj]; + if (CF_marker_offd[i1] >= 0) + { + jj_count_offd[j]++; + } } } } } - } } /*----------------------------------------------------------------------- * Allocate arrays. *-----------------------------------------------------------------------*/ - for (i=0; i < num_threads-1; i++) + for (i = 0; i < num_threads - 1; i++) { - coarse_counter[i+1] += coarse_counter[i]; - jj_count[i+1] += jj_count[i]; - jj_count_offd[i+1] += jj_count_offd[i]; + coarse_counter[i + 1] += coarse_counter[i]; + jj_count[i + 1] += jj_count[i]; + jj_count_offd[i + 1] += jj_count_offd[i]; } - i = num_threads-1; + i = num_threads - 1; jj_counter = jj_count[i]; jj_counter_offd = jj_count_offd[i]; P_diag_size = jj_counter; - P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, HYPRE_MEMORY_HOST); + P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, HYPRE_MEMORY_HOST); P_diag_j = hypre_CTAlloc(HYPRE_Int, P_diag_size, HYPRE_MEMORY_HOST); P_diag_data = hypre_CTAlloc(HYPRE_Real, P_diag_size, HYPRE_MEMORY_HOST); @@ -1546,7 +1595,7 @@ hypre_BoomerAMGBuildInterpGSMG( hypre_ParCSRMatrix *A, P_offd_size = jj_counter_offd; - P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, HYPRE_MEMORY_HOST); + P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, HYPRE_MEMORY_HOST); P_offd_j = hypre_CTAlloc(HYPRE_Int, P_offd_size, HYPRE_MEMORY_HOST); P_offd_data = hypre_CTAlloc(HYPRE_Real, P_offd_size, HYPRE_MEMORY_HOST); @@ -1557,11 +1606,11 @@ hypre_BoomerAMGBuildInterpGSMG( hypre_ParCSRMatrix *A, jj_counter = start_indexing; jj_counter_offd = start_indexing; - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Interp: Internal work 1 = %f\n", - my_id, wall_time); + my_id, wall_time); fflush(NULL); } @@ -1569,343 +1618,232 @@ hypre_BoomerAMGBuildInterpGSMG( hypre_ParCSRMatrix *A, * Send and receive fine_to_coarse info. *-----------------------------------------------------------------------*/ - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } /*----------------------------------------------------------------------- * Loop over fine grid points. *-----------------------------------------------------------------------*/ #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,j,jl,i1,i2,jj,jj1,ns,ne,size,rest,sum,distribute,P_marker,P_marker_offd,strong_f_marker,jj_counter,jj_counter_offd,c_num,jj_begin_row,jj_end_row,jj_begin_row_offd,jj_end_row_offd) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,j,jl,i1,i2,jj,jj1,ns,ne,size,rest,sum,distribute,P_marker,P_marker_offd,strong_f_marker,jj_counter,jj_counter_offd,c_num,jj_begin_row,jj_end_row,jj_begin_row_offd,jj_end_row_offd) HYPRE_SMP_SCHEDULE #endif for (jl = 0; jl < num_threads; jl++) { - size = n_fine/num_threads; - rest = n_fine - size*num_threads; - if (jl < rest) - { - ns = jl*size+jl; - ne = (jl+1)*size+jl+1; - } - else - { - ns = jl*size+rest; - ne = (jl+1)*size+rest; - } - jj_counter = 0; - if (jl > 0) jj_counter = jj_count[jl-1]; - jj_counter_offd = 0; - if (jl > 0) jj_counter_offd = jj_count_offd[jl-1]; - - P_marker = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); - P_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_S_offd, HYPRE_MEMORY_HOST); - - for (i = 0; i < n_fine; i++) - { - P_marker[i] = -1; - } - for (i = 0; i < num_cols_S_offd; i++) - { - P_marker_offd[i] = -1; - } - strong_f_marker = -2; - - for (i = ns; i < ne; i++) - { - - /*-------------------------------------------------------------------- - * If i is a c-point, interpolation is the identity. - *--------------------------------------------------------------------*/ - - if (CF_marker[i] >= 0) + size = n_fine / num_threads; + rest = n_fine - size * num_threads; + if (jl < rest) { - P_diag_i[i] = jj_counter; - P_diag_j[jj_counter] = fine_to_coarse[i]; - P_diag_data[jj_counter] = one; - jj_counter++; + ns = jl * size + jl; + ne = (jl + 1) * size + jl + 1; } - - /*-------------------------------------------------------------------- - * If i is an F-point, build interpolation. - *--------------------------------------------------------------------*/ - else { - /* Diagonal part of P */ - P_diag_i[i] = jj_counter; - jj_begin_row = jj_counter; + ns = jl * size + rest; + ne = (jl + 1) * size + rest; + } + jj_counter = 0; + if (jl > 0) { jj_counter = jj_count[jl - 1]; } + jj_counter_offd = 0; + if (jl > 0) { jj_counter_offd = jj_count_offd[jl - 1]; } - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) - { - i1 = S_diag_j[jj]; + P_marker = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); + P_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_S_offd, HYPRE_MEMORY_HOST); - /*-------------------------------------------------------------- - * If neighbor i1 is a C-point, set column number in P_diag_j - * and initialize interpolation weight to zero. - *--------------------------------------------------------------*/ + for (i = 0; i < n_fine; i++) + { + P_marker[i] = -1; + } + for (i = 0; i < num_cols_S_offd; i++) + { + P_marker_offd[i] = -1; + } + strong_f_marker = -2; - if (CF_marker[i1] >= 0) - { - P_marker[i1] = jj_counter; - P_diag_j[jj_counter] = fine_to_coarse[i1]; - P_diag_data[jj_counter] = zero; - jj_counter++; - } + for (i = ns; i < ne; i++) + { - /*-------------------------------------------------------------- - * If neighbor i1 is an F-point, mark it as a strong F-point - * whose connection needs to be distributed. - *--------------------------------------------------------------*/ + /*-------------------------------------------------------------------- + * If i is a c-point, interpolation is the identity. + *--------------------------------------------------------------------*/ - else - { - P_marker[i1] = strong_f_marker; - } + if (CF_marker[i] >= 0) + { + P_diag_i[i] = jj_counter; + P_diag_j[jj_counter] = fine_to_coarse[i]; + P_diag_data[jj_counter] = one; + jj_counter++; } - jj_end_row = jj_counter; - /* Off-Diagonal part of P */ - P_offd_i[i] = jj_counter_offd; - jj_begin_row_offd = jj_counter_offd; + /*-------------------------------------------------------------------- + * If i is an F-point, build interpolation. + *--------------------------------------------------------------------*/ - - if (num_procs > 1) + else { - for (jj = S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + /* Diagonal part of P */ + P_diag_i[i] = jj_counter; + jj_begin_row = jj_counter; + + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) { - i1 = S_offd_j[jj]; + i1 = S_diag_j[jj]; - /*----------------------------------------------------------- - * If neighbor i1 is a C-point, set column number in P_offd_j + /*-------------------------------------------------------------- + * If neighbor i1 is a C-point, set column number in P_diag_j * and initialize interpolation weight to zero. - *-----------------------------------------------------------*/ + *--------------------------------------------------------------*/ - if (CF_marker_offd[i1] >= 0) + if (CF_marker[i1] >= 0) { - P_marker_offd[i1] = jj_counter_offd; - P_offd_j[jj_counter_offd] = i1; - P_offd_data[jj_counter_offd] = zero; - jj_counter_offd++; + P_marker[i1] = jj_counter; + P_diag_j[jj_counter] = fine_to_coarse[i1]; + P_diag_data[jj_counter] = zero; + jj_counter++; } - /*----------------------------------------------------------- + /*-------------------------------------------------------------- * If neighbor i1 is an F-point, mark it as a strong F-point * whose connection needs to be distributed. - *-----------------------------------------------------------*/ + *--------------------------------------------------------------*/ else { - P_marker_offd[i1] = strong_f_marker; + P_marker[i1] = strong_f_marker; } } - } + jj_end_row = jj_counter; - jj_end_row_offd = jj_counter_offd; + /* Off-Diagonal part of P */ + P_offd_i[i] = jj_counter_offd; + jj_begin_row_offd = jj_counter_offd; - /* Loop over ith row of S. First, the diagonal part of S */ - - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) - { - i1 = S_diag_j[jj]; - /*-------------------------------------------------------------- - * Case 1: neighbor i1 is a C-point and strongly influences i, - * accumulate a_{i,i1} into the interpolation weight. - *--------------------------------------------------------------*/ - - if (P_marker[i1] >= jj_begin_row) - { - P_diag_data[P_marker[i1]] += S_diag_data[jj]; - } - - /*-------------------------------------------------------------- - * Case 2: neighbor i1 is an F-point and strongly influences i, - * distribute a_{i,i1} to C-points that strongly infuence i. - * Note: currently no distribution to the diagonal in this case. - *--------------------------------------------------------------*/ - - else if (P_marker[i1] == strong_f_marker) + if (num_procs > 1) { - sum = zero; - - /*----------------------------------------------------------- - * Loop over row of S for point i1 and calculate the sum - * of the connections to c-points that strongly influence i. - *-----------------------------------------------------------*/ - - /* Diagonal block part of row i1 */ - for (jj1 = S_diag_i[i1]; jj1 < S_diag_i[i1+1]; jj1++) + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) { - i2 = S_diag_j[jj1]; - if (P_marker[i2] >= jj_begin_row) - sum += S_diag_data[jj1]; - } + i1 = S_offd_j[jj]; - /* Off-Diagonal block part of row i1 */ - if (num_procs > 1) - { - for (jj1 = S_offd_i[i1]; jj1 < S_offd_i[i1+1]; jj1++) + /*----------------------------------------------------------- + * If neighbor i1 is a C-point, set column number in P_offd_j + * and initialize interpolation weight to zero. + *-----------------------------------------------------------*/ + + if (CF_marker_offd[i1] >= 0) { - i2 = S_offd_j[jj1]; - if (P_marker_offd[i2] >= jj_begin_row_offd) - sum += S_offd_data[jj1]; + P_marker_offd[i1] = jj_counter_offd; + P_offd_j[jj_counter_offd] = i1; + P_offd_data[jj_counter_offd] = zero; + jj_counter_offd++; } - } - - if (sum != 0) - { - distribute = S_diag_data[jj] / sum; - /*----------------------------------------------------------- - * Loop over row of S for point i1 and do the distribution. - *-----------------------------------------------------------*/ + /*----------------------------------------------------------- + * If neighbor i1 is an F-point, mark it as a strong F-point + * whose connection needs to be distributed. + *-----------------------------------------------------------*/ - /* Diagonal block part of row i1 */ - for (jj1 = S_diag_i[i1]; jj1 < S_diag_i[i1+1]; jj1++) - { - i2 = S_diag_j[jj1]; - if (P_marker[i2] >= jj_begin_row) - P_diag_data[P_marker[i2]] - += distribute * S_diag_data[jj1]; - } - - /* Off-Diagonal block part of row i1 */ - if (num_procs > 1) - { - for (jj1 = S_offd_i[i1]; jj1 < S_offd_i[i1+1]; jj1++) + else { - i2 = S_offd_j[jj1]; - if (P_marker_offd[i2] >= jj_begin_row_offd) - P_offd_data[P_marker_offd[i2]] - += distribute * S_offd_data[jj1]; + P_marker_offd[i1] = strong_f_marker; } } - } - else - { - /* do nothing */ - } } - /*-------------------------------------------------------------- - * Case 3: neighbor i1 weakly influences i, accumulate a_{i,i1} - * into the diagonal. - *--------------------------------------------------------------*/ - - else - { - /* do nothing */ - } - - } - + jj_end_row_offd = jj_counter_offd; - /*---------------------------------------------------------------- - * Still looping over ith row of S. Next, loop over the - * off-diagonal part of S - *---------------------------------------------------------------*/ + /* Loop over ith row of S. First, the diagonal part of S */ - if (num_procs > 1) - { - for (jj = S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) { - i1 = S_offd_j[jj]; + i1 = S_diag_j[jj]; - /*-------------------------------------------------------------- - * Case 1: neighbor i1 is a C-point and strongly influences i, - * accumulate a_{i,i1} into the interpolation weight. - *--------------------------------------------------------------*/ + /*-------------------------------------------------------------- + * Case 1: neighbor i1 is a C-point and strongly influences i, + * accumulate a_{i,i1} into the interpolation weight. + *--------------------------------------------------------------*/ - if (P_marker_offd[i1] >= jj_begin_row_offd) + if (P_marker[i1] >= jj_begin_row) { - P_offd_data[P_marker_offd[i1]] += S_offd_data[jj]; + P_diag_data[P_marker[i1]] += S_diag_data[jj]; } - /*------------------------------------------------------------ + /*-------------------------------------------------------------- * Case 2: neighbor i1 is an F-point and strongly influences i, * distribute a_{i,i1} to C-points that strongly infuence i. * Note: currently no distribution to the diagonal in this case. - *-----------------------------------------------------------*/ + *--------------------------------------------------------------*/ - else if (P_marker_offd[i1] == strong_f_marker) + else if (P_marker[i1] == strong_f_marker) { sum = zero; - /*--------------------------------------------------------- - * Loop over row of S_ext for point i1 and calculate the sum - * of the connections to c-points that strongly influence i. - *---------------------------------------------------------*/ - - /* find row number */ - c_num = S_offd_j[jj]; + /*----------------------------------------------------------- + * Loop over row of S for point i1 and calculate the sum + * of the connections to c-points that strongly influence i. + *-----------------------------------------------------------*/ - for (jj1 = S_ext_i[c_num]; jj1 < S_ext_i[c_num+1]; jj1++) + /* Diagonal block part of row i1 */ + for (jj1 = S_diag_i[i1]; jj1 < S_diag_i[i1 + 1]; jj1++) { - big_i2 = S_ext_j[jj1]; - - if (big_i2 >= col_1 && big_i2 < col_n) + i2 = S_diag_j[jj1]; + if (P_marker[i2] >= jj_begin_row) { - /* in the diagonal block */ - if (P_marker[(HYPRE_Int)(big_i2-col_1)] >= jj_begin_row) - sum += S_ext_data[jj1]; + sum += S_diag_data[jj1]; } - else + } + + /* Off-Diagonal block part of row i1 */ + if (num_procs > 1) + { + for (jj1 = S_offd_i[i1]; jj1 < S_offd_i[i1 + 1]; jj1++) { - /* in the off_diagonal block */ - j = hypre_BigBinarySearch(col_map_offd,big_i2,num_cols_S_offd); - if (j != -1) + i2 = S_offd_j[jj1]; + if (P_marker_offd[i2] >= jj_begin_row_offd) { - if (P_marker_offd[j] >= jj_begin_row_offd) - sum += S_ext_data[jj1]; + sum += S_offd_data[jj1]; } - } - } if (sum != 0) - { - distribute = S_offd_data[jj] / sum; - /*--------------------------------------------------------- - * Loop over row of S_ext for point i1 and do - * the distribution. - *--------------------------------------------------------*/ - - /* Diagonal block part of row i1 */ - - for (jj1 = S_ext_i[c_num]; jj1 < S_ext_i[c_num+1]; jj1++) { - big_i2 = S_ext_j[jj1]; + distribute = S_diag_data[jj] / sum; + + /*----------------------------------------------------------- + * Loop over row of S for point i1 and do the distribution. + *-----------------------------------------------------------*/ - if (big_i2 >= col_1 && big_i2 < col_n) /* in the diagonal block */ + /* Diagonal block part of row i1 */ + for (jj1 = S_diag_i[i1]; jj1 < S_diag_i[i1 + 1]; jj1++) { - if (P_marker[(HYPRE_Int)(big_i2-col_1)] >= jj_begin_row) - P_diag_data[P_marker[(HYPRE_Int)(big_i2-col_1)]] - += distribute * S_ext_data[jj1]; + i2 = S_diag_j[jj1]; + if (P_marker[i2] >= jj_begin_row) + P_diag_data[P_marker[i2]] + += distribute * S_diag_data[jj1]; } - else + + /* Off-Diagonal block part of row i1 */ + if (num_procs > 1) { - /* check to see if it is in the off_diagonal block */ - j = hypre_BigBinarySearch(col_map_offd,big_i2,num_cols_S_offd); - if (j != -1) + for (jj1 = S_offd_i[i1]; jj1 < S_offd_i[i1 + 1]; jj1++) { - if (P_marker_offd[j] >= jj_begin_row_offd) - P_offd_data[P_marker_offd[j]] - += distribute * S_ext_data[jj1]; + i2 = S_offd_j[jj1]; + if (P_marker_offd[i2] >= jj_begin_row_offd) + P_offd_data[P_marker_offd[i2]] + += distribute * S_offd_data[jj1]; } } } - } - else + else { /* do nothing */ } } - /*----------------------------------------------------------- + /*-------------------------------------------------------------- * Case 3: neighbor i1 weakly influences i, accumulate a_{i,i1} * into the diagonal. - *-----------------------------------------------------------*/ + *--------------------------------------------------------------*/ else { @@ -1913,31 +1851,158 @@ hypre_BoomerAMGBuildInterpGSMG( hypre_ParCSRMatrix *A, } } - } - /*----------------------------------------------------------------- - * Set interpolation weight by dividing by the diagonal. - *-----------------------------------------------------------------*/ - sum = 0.; - for (jj = jj_begin_row; jj < jj_end_row; jj++) - sum += P_diag_data[jj]; - for (jj = jj_begin_row_offd; jj < jj_end_row_offd; jj++) - sum += P_offd_data[jj]; + /*---------------------------------------------------------------- + * Still looping over ith row of S. Next, loop over the + * off-diagonal part of S + *---------------------------------------------------------------*/ - for (jj = jj_begin_row; jj < jj_end_row; jj++) - P_diag_data[jj] /= sum; - for (jj = jj_begin_row_offd; jj < jj_end_row_offd; jj++) - P_offd_data[jj] /= sum; + if (num_procs > 1) + { + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) + { + i1 = S_offd_j[jj]; - } + /*-------------------------------------------------------------- + * Case 1: neighbor i1 is a C-point and strongly influences i, + * accumulate a_{i,i1} into the interpolation weight. + *--------------------------------------------------------------*/ + + if (P_marker_offd[i1] >= jj_begin_row_offd) + { + P_offd_data[P_marker_offd[i1]] += S_offd_data[jj]; + } + + /*------------------------------------------------------------ + * Case 2: neighbor i1 is an F-point and strongly influences i, + * distribute a_{i,i1} to C-points that strongly infuence i. + * Note: currently no distribution to the diagonal in this case. + *-----------------------------------------------------------*/ + + else if (P_marker_offd[i1] == strong_f_marker) + { + sum = zero; + + /*--------------------------------------------------------- + * Loop over row of S_ext for point i1 and calculate the sum + * of the connections to c-points that strongly influence i. + *---------------------------------------------------------*/ + + /* find row number */ + c_num = S_offd_j[jj]; + + for (jj1 = S_ext_i[c_num]; jj1 < S_ext_i[c_num + 1]; jj1++) + { + big_i2 = S_ext_j[jj1]; + + if (big_i2 >= col_1 && big_i2 < col_n) + { + /* in the diagonal block */ + if (P_marker[(HYPRE_Int)(big_i2 - col_1)] >= jj_begin_row) + { + sum += S_ext_data[jj1]; + } + } + else + { + /* in the off_diagonal block */ + j = hypre_BigBinarySearch(col_map_offd, big_i2, num_cols_S_offd); + if (j != -1) + { + if (P_marker_offd[j] >= jj_begin_row_offd) + { + sum += S_ext_data[jj1]; + } + } + + } + + } + + if (sum != 0) + { + distribute = S_offd_data[jj] / sum; + /*--------------------------------------------------------- + * Loop over row of S_ext for point i1 and do + * the distribution. + *--------------------------------------------------------*/ + + /* Diagonal block part of row i1 */ + + for (jj1 = S_ext_i[c_num]; jj1 < S_ext_i[c_num + 1]; jj1++) + { + big_i2 = S_ext_j[jj1]; + + if (big_i2 >= col_1 && big_i2 < col_n) /* in the diagonal block */ + { + if (P_marker[(HYPRE_Int)(big_i2 - col_1)] >= jj_begin_row) + P_diag_data[P_marker[(HYPRE_Int)(big_i2 - col_1)]] + += distribute * S_ext_data[jj1]; + } + else + { + /* check to see if it is in the off_diagonal block */ + j = hypre_BigBinarySearch(col_map_offd, big_i2, num_cols_S_offd); + if (j != -1) + { + if (P_marker_offd[j] >= jj_begin_row_offd) + P_offd_data[P_marker_offd[j]] + += distribute * S_ext_data[jj1]; + } + } + } + } + else + { + /* do nothing */ + } + } + + /*----------------------------------------------------------- + * Case 3: neighbor i1 weakly influences i, accumulate a_{i,i1} + * into the diagonal. + *-----------------------------------------------------------*/ + + else + { + /* do nothing */ + } + + } + } + + /*----------------------------------------------------------------- + * Set interpolation weight by dividing by the diagonal. + *-----------------------------------------------------------------*/ + + sum = 0.; + for (jj = jj_begin_row; jj < jj_end_row; jj++) + { + sum += P_diag_data[jj]; + } + for (jj = jj_begin_row_offd; jj < jj_end_row_offd; jj++) + { + sum += P_offd_data[jj]; + } - strong_f_marker--; + for (jj = jj_begin_row; jj < jj_end_row; jj++) + { + P_diag_data[jj] /= sum; + } + for (jj = jj_begin_row_offd; jj < jj_end_row_offd; jj++) + { + P_offd_data[jj] /= sum; + } - P_offd_i[i+1] = jj_counter_offd; - } - hypre_TFree(P_marker, HYPRE_MEMORY_HOST); - hypre_TFree(P_marker_offd, HYPRE_MEMORY_HOST); + } + + strong_f_marker--; + + P_offd_i[i + 1] = jj_counter_offd; + } + hypre_TFree(P_marker, HYPRE_MEMORY_HOST); + hypre_TFree(P_marker_offd, HYPRE_MEMORY_HOST); } P = hypre_ParCSRMatrixCreate(comm, @@ -1980,47 +2045,51 @@ hypre_BoomerAMGBuildInterpGSMG( hypre_ParCSRMatrix *A, P_marker = hypre_CTAlloc(HYPRE_Int, P_offd_size, HYPRE_MEMORY_HOST); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i=0; i < P_offd_size; i++) - P_marker[i] = P_offd_j[i]; + for (i = 0; i < P_offd_size; i++) + { + P_marker[i] = P_offd_j[i]; + } - hypre_qsort0(P_marker, 0, P_offd_size-1); + hypre_qsort0(P_marker, 0, P_offd_size - 1); num_cols_P_offd = 1; index = P_marker[0]; - for (i=1; i < P_offd_size; i++) + for (i = 1; i < P_offd_size; i++) { - if (P_marker[i] > index) - { - index = P_marker[i]; - P_marker[num_cols_P_offd++] = index; - } + if (P_marker[i] > index) + { + index = P_marker[i]; + P_marker[num_cols_P_offd++] = index; + } } col_map_offd_P = hypre_CTAlloc(HYPRE_BigInt, num_cols_P_offd, HYPRE_MEMORY_HOST); tmp_map_offd = hypre_CTAlloc(HYPRE_Int, num_cols_P_offd, HYPRE_MEMORY_HOST); - for (i=0; i < num_cols_P_offd; i++) + for (i = 0; i < num_cols_P_offd; i++) + { tmp_map_offd[i] = P_marker[i]; + } #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i=0; i < P_offd_size; i++) - P_offd_j[i] = hypre_BinarySearch(tmp_map_offd, - P_offd_j[i], - num_cols_P_offd); + for (i = 0; i < P_offd_size; i++) + P_offd_j[i] = hypre_BinarySearch(tmp_map_offd, + P_offd_j[i], + num_cols_P_offd); hypre_TFree(P_marker, HYPRE_MEMORY_HOST); } if (num_cols_P_offd) { - hypre_ParCSRMatrixColMapOffd(P) = col_map_offd_P; - hypre_CSRMatrixNumCols(P_offd) = num_cols_P_offd; + hypre_ParCSRMatrixColMapOffd(P) = col_map_offd_P; + hypre_CSRMatrixNumCols(P_offd) = num_cols_P_offd; } - hypre_GetCommPkgRTFromCommPkgA(P,S,fine_to_coarse, tmp_map_offd); + hypre_GetCommPkgRTFromCommPkgA(P, S, fine_to_coarse, tmp_map_offd); *P_ptr = P; @@ -2032,9 +2101,7 @@ hypre_BoomerAMGBuildInterpGSMG( hypre_ParCSRMatrix *A, hypre_TFree(coarse_counter, HYPRE_MEMORY_HOST); hypre_TFree(jj_count, HYPRE_MEMORY_HOST); hypre_TFree(jj_count_offd, HYPRE_MEMORY_HOST); + hypre_CSRMatrixDestroy(S_ext); - if (num_procs > 1) hypre_CSRMatrixDestroy(S_ext); - - return(0); - + return hypre_error_flag; } diff --git a/external/hypre/src/parcsr_ls/par_ilu.c b/external/hypre/src/parcsr_ls/par_ilu.c index 51038b98..bd88027d 100644 --- a/external/hypre/src/parcsr_ls/par_ilu.c +++ b/external/hypre/src/parcsr_ls/par_ilu.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -12,510 +12,406 @@ *****************************************************************************/ #include "_hypre_parcsr_ls.h" -#include "_hypre_utilities.hpp" -#include "par_ilu.h" -/* Create */ +/*-------------------------------------------------------------------------- + * hypre_ILUCreate + *--------------------------------------------------------------------------*/ + void * -hypre_ILUCreate() +hypre_ILUCreate( void ) { - hypre_ParILUData *ilu_data; - - ilu_data = hypre_CTAlloc(hypre_ParILUData, 1, HYPRE_MEMORY_HOST); - -#ifdef HYPRE_USING_CUDA - hypre_ParILUDataMatLMatrixDescription(ilu_data) = NULL; - hypre_ParILUDataMatUMatrixDescription(ilu_data) = NULL; - hypre_ParILUDataMatBLILUSolveInfo(ilu_data) = NULL; - hypre_ParILUDataMatBUILUSolveInfo(ilu_data) = NULL; - hypre_ParILUDataMatSLILUSolveInfo(ilu_data) = NULL; - hypre_ParILUDataMatSUILUSolveInfo(ilu_data) = NULL; - hypre_ParILUDataILUSolveBuffer(ilu_data) = NULL; - hypre_ParILUDataILUSolvePolicy(ilu_data) = CUSPARSE_SOLVE_POLICY_USE_LEVEL; - hypre_ParILUDataAperm(ilu_data) = NULL; - hypre_ParILUDataMatBILUDevice(ilu_data) = NULL; - hypre_ParILUDataMatSILUDevice(ilu_data) = NULL; - hypre_ParILUDataMatEDevice(ilu_data) = NULL; - hypre_ParILUDataMatFDevice(ilu_data) = NULL; - hypre_ParILUDataR(ilu_data) = NULL; - hypre_ParILUDataP(ilu_data) = NULL; - hypre_ParILUDataFTempUpper(ilu_data) = NULL; - hypre_ParILUDataUTempLower(ilu_data) = NULL; - hypre_ParILUDataMatAFakeDiagonal(ilu_data) = NULL; + hypre_ParILUData *ilu_data; + hypre_Solver *base; + + ilu_data = hypre_CTAlloc(hypre_ParILUData, 1, HYPRE_MEMORY_HOST); + base = (hypre_Solver*) ilu_data; + + /* Set base solver function pointers */ + hypre_SolverSetup(base) = (HYPRE_PtrToSolverFcn) HYPRE_ILUSetup; + hypre_SolverSolve(base) = (HYPRE_PtrToSolverFcn) HYPRE_ILUSolve; + hypre_SolverDestroy(base) = (HYPRE_PtrToDestroyFcn) HYPRE_ILUDestroy; + +#if defined(HYPRE_USING_GPU) + hypre_ParILUDataAperm(ilu_data) = NULL; + hypre_ParILUDataMatBILUDevice(ilu_data) = NULL; + hypre_ParILUDataMatSILUDevice(ilu_data) = NULL; + hypre_ParILUDataMatEDevice(ilu_data) = NULL; + hypre_ParILUDataMatFDevice(ilu_data) = NULL; + hypre_ParILUDataR(ilu_data) = NULL; + hypre_ParILUDataP(ilu_data) = NULL; + hypre_ParILUDataFTempUpper(ilu_data) = NULL; + hypre_ParILUDataUTempLower(ilu_data) = NULL; + hypre_ParILUDataADiagDiag(ilu_data) = NULL; + hypre_ParILUDataSDiagDiag(ilu_data) = NULL; #endif /* general data */ - hypre_ParILUDataGlobalSolver(ilu_data) = 0; - hypre_ParILUDataMatA(ilu_data) = NULL; - hypre_ParILUDataMatL(ilu_data) = NULL; - hypre_ParILUDataMatD(ilu_data) = NULL; - hypre_ParILUDataMatU(ilu_data) = NULL; - hypre_ParILUDataMatS(ilu_data) = NULL; - hypre_ParILUDataSchurSolver(ilu_data) = NULL; - hypre_ParILUDataSchurPrecond(ilu_data) = NULL; - hypre_ParILUDataRhs(ilu_data) = NULL; - hypre_ParILUDataX(ilu_data) = NULL; - - hypre_ParILUDataDroptol(ilu_data) = hypre_TAlloc(HYPRE_Real,3,HYPRE_MEMORY_HOST); - hypre_ParILUDataDroptol(ilu_data)[0] = 1.0e-02;/* droptol for B */ - hypre_ParILUDataDroptol(ilu_data)[1] = 1.0e-02;/* droptol for E and F */ - hypre_ParILUDataDroptol(ilu_data)[2] = 1.0e-02;/* droptol for S */ - hypre_ParILUDataLfil(ilu_data) = 0; - hypre_ParILUDataMaxRowNnz(ilu_data) = 1000; - hypre_ParILUDataCFMarkerArray(ilu_data) = NULL; - hypre_ParILUDataPerm(ilu_data) = NULL; - hypre_ParILUDataQPerm(ilu_data) = NULL; - hypre_ParILUDataTolDDPQ(ilu_data) = 1.0e-01; - - hypre_ParILUDataF(ilu_data) = NULL; - hypre_ParILUDataU(ilu_data) = NULL; - hypre_ParILUDataFTemp(ilu_data) = NULL; - hypre_ParILUDataUTemp(ilu_data) = NULL; - hypre_ParILUDataXTemp(ilu_data) = NULL; - hypre_ParILUDataYTemp(ilu_data) = NULL; - hypre_ParILUDataUExt(ilu_data) = NULL; - hypre_ParILUDataFExt(ilu_data) = NULL; - hypre_ParILUDataResidual(ilu_data) = NULL; - hypre_ParILUDataRelResNorms(ilu_data) = NULL; - - hypre_ParILUDataNumIterations(ilu_data) = 0; - - hypre_ParILUDataMaxIter(ilu_data) = 20; - hypre_ParILUDataTol(ilu_data) = 1.0e-7; - - hypre_ParILUDataLogging(ilu_data) = 0; - hypre_ParILUDataPrintLevel(ilu_data) = 0; - - hypre_ParILUDataL1Norms(ilu_data) = NULL; - - hypre_ParILUDataOperatorComplexity(ilu_data) = 0.; - - hypre_ParILUDataIluType(ilu_data) = 0; - hypre_ParILUDataNLU(ilu_data) = 0; - hypre_ParILUDataNI(ilu_data) = 0; - hypre_ParILUDataUEnd(ilu_data) = NULL; + hypre_ParILUDataGlobalSolver(ilu_data) = 0; + hypre_ParILUDataMatA(ilu_data) = NULL; + hypre_ParILUDataMatL(ilu_data) = NULL; + hypre_ParILUDataMatD(ilu_data) = NULL; + hypre_ParILUDataMatU(ilu_data) = NULL; + hypre_ParILUDataMatS(ilu_data) = NULL; + hypre_ParILUDataSchurSolver(ilu_data) = NULL; + hypre_ParILUDataSchurPrecond(ilu_data) = NULL; + hypre_ParILUDataRhs(ilu_data) = NULL; + hypre_ParILUDataX(ilu_data) = NULL; + + /* TODO (VPM): Transform this into a stack array */ + hypre_ParILUDataDroptol(ilu_data) = hypre_TAlloc(HYPRE_Real, 3, HYPRE_MEMORY_HOST); + hypre_ParILUDataDroptol(ilu_data)[0] = 1.0e-02; /* droptol for B */ + hypre_ParILUDataDroptol(ilu_data)[1] = 1.0e-02; /* droptol for E and F */ + hypre_ParILUDataDroptol(ilu_data)[2] = 1.0e-02; /* droptol for S */ + hypre_ParILUDataLfil(ilu_data) = 0; + hypre_ParILUDataMaxRowNnz(ilu_data) = 1000; + hypre_ParILUDataCFMarkerArray(ilu_data) = NULL; + hypre_ParILUDataPerm(ilu_data) = NULL; + hypre_ParILUDataQPerm(ilu_data) = NULL; + hypre_ParILUDataTolDDPQ(ilu_data) = 1.0e-01; + hypre_ParILUDataF(ilu_data) = NULL; + hypre_ParILUDataU(ilu_data) = NULL; + hypre_ParILUDataFTemp(ilu_data) = NULL; + hypre_ParILUDataUTemp(ilu_data) = NULL; + hypre_ParILUDataXTemp(ilu_data) = NULL; + hypre_ParILUDataYTemp(ilu_data) = NULL; + hypre_ParILUDataZTemp(ilu_data) = NULL; + hypre_ParILUDataUExt(ilu_data) = NULL; + hypre_ParILUDataFExt(ilu_data) = NULL; + hypre_ParILUDataResidual(ilu_data) = NULL; + hypre_ParILUDataRelResNorms(ilu_data) = NULL; + hypre_ParILUDataNumIterations(ilu_data) = 0; + hypre_ParILUDataMaxIter(ilu_data) = 20; + hypre_ParILUDataTriSolve(ilu_data) = 1; + hypre_ParILUDataLowerJacobiIters(ilu_data) = 5; + hypre_ParILUDataUpperJacobiIters(ilu_data) = 5; + hypre_ParILUDataTol(ilu_data) = 1.0e-7; + hypre_ParILUDataLogging(ilu_data) = 0; + hypre_ParILUDataPrintLevel(ilu_data) = 0; + hypre_ParILUDataL1Norms(ilu_data) = NULL; + hypre_ParILUDataOperatorComplexity(ilu_data) = 0.; + hypre_ParILUDataIluType(ilu_data) = 0; + hypre_ParILUDataNLU(ilu_data) = 0; + hypre_ParILUDataNI(ilu_data) = 0; + hypre_ParILUDataUEnd(ilu_data) = NULL; + + /* Iterative setup variables */ + hypre_ParILUDataIterativeSetupType(ilu_data) = 0; + hypre_ParILUDataIterativeSetupOption(ilu_data) = 0; + hypre_ParILUDataIterativeSetupMaxIter(ilu_data) = 100; + hypre_ParILUDataIterativeSetupNumIter(ilu_data) = 0; + hypre_ParILUDataIterativeSetupTolerance(ilu_data) = 1.e-6; + hypre_ParILUDataIterativeSetupHistory(ilu_data) = NULL; /* reordering_type default to use local RCM */ - hypre_ParILUDataReorderingType(ilu_data) = 1; + hypre_ParILUDataReorderingType(ilu_data) = 1; /* see hypre_ILUSetType for more default values */ - hypre_ParILUDataTestOption(ilu_data) = 0; - - /* -> GENERAL-SLOTS */ - hypre_ParILUDataSchurSolverLogging(ilu_data) = 0; - hypre_ParILUDataSchurSolverPrintLevel(ilu_data) = 0; - - /* -> SCHUR-GMRES */ - hypre_ParILUDataSchurGMRESKDim(ilu_data) = 5; - hypre_ParILUDataSchurGMRESMaxIter(ilu_data) = 5; - hypre_ParILUDataSchurGMRESTol(ilu_data) = 0.0; - hypre_ParILUDataSchurGMRESAbsoluteTol(ilu_data) = 0.0; - hypre_ParILUDataSchurGMRESRelChange(ilu_data) = 0; - - /* schur precond data */ - hypre_ParILUDataSchurPrecondIluType(ilu_data) = 0; - hypre_ParILUDataSchurPrecondIluLfil(ilu_data) = 0; - hypre_ParILUDataSchurPrecondIluMaxRowNnz(ilu_data) = 100; - hypre_ParILUDataSchurPrecondIluDroptol(ilu_data) = NULL;/* this is not the default option, set it only when switched to */ - hypre_ParILUDataSchurPrecondPrintLevel(ilu_data) = 0; - hypre_ParILUDataSchurPrecondMaxIter(ilu_data) = 1; - hypre_ParILUDataSchurPrecondTol(ilu_data) = 0.0; - - /* -> SCHUR-NSH */ - hypre_ParILUDataSchurNSHSolveMaxIter(ilu_data) = 5; - hypre_ParILUDataSchurNSHSolveTol(ilu_data) = 0.0; - hypre_ParILUDataSchurNSHDroptol(ilu_data) = NULL;/* this is not the default option, set it only when switched to */ - - hypre_ParILUDataSchurNSHMaxNumIter(ilu_data) = 2; - hypre_ParILUDataSchurNSHMaxRowNnz(ilu_data) = 1000; - hypre_ParILUDataSchurNSHTol(ilu_data) = 1e-09; - - hypre_ParILUDataSchurMRMaxIter(ilu_data) = 2; - hypre_ParILUDataSchurMRColVersion(ilu_data) = 0; - hypre_ParILUDataSchurMRMaxRowNnz(ilu_data) = 200; - hypre_ParILUDataSchurMRTol(ilu_data) = 1e-09; - - return (void *) ilu_data; + hypre_ParILUDataTestOption(ilu_data) = 0; + + /* -> General slots */ + hypre_ParILUDataSchurSolverLogging(ilu_data) = 0; + hypre_ParILUDataSchurSolverPrintLevel(ilu_data) = 0; + + /* -> Schur-GMRES */ + hypre_ParILUDataSchurGMRESKDim(ilu_data) = 5; + hypre_ParILUDataSchurGMRESMaxIter(ilu_data) = 5; + hypre_ParILUDataSchurGMRESTol(ilu_data) = 0.0; + hypre_ParILUDataSchurGMRESAbsoluteTol(ilu_data) = 0.0; + hypre_ParILUDataSchurGMRESRelChange(ilu_data) = 0; + + /* -> Schur precond data */ + hypre_ParILUDataSchurPrecondIluType(ilu_data) = 0; + hypre_ParILUDataSchurPrecondIluLfil(ilu_data) = 0; + hypre_ParILUDataSchurPrecondIluMaxRowNnz(ilu_data) = 100; + hypre_ParILUDataSchurPrecondIluDroptol(ilu_data) = NULL; + hypre_ParILUDataSchurPrecondPrintLevel(ilu_data) = 0; + hypre_ParILUDataSchurPrecondMaxIter(ilu_data) = 1; + hypre_ParILUDataSchurPrecondTriSolve(ilu_data) = 1; + hypre_ParILUDataSchurPrecondLowerJacobiIters(ilu_data) = 5; + hypre_ParILUDataSchurPrecondUpperJacobiIters(ilu_data) = 5; + hypre_ParILUDataSchurPrecondTol(ilu_data) = 0.0; + + /* -> Schur-NSH */ + hypre_ParILUDataSchurNSHSolveMaxIter(ilu_data) = 5; + hypre_ParILUDataSchurNSHSolveTol(ilu_data) = 0.0; + hypre_ParILUDataSchurNSHDroptol(ilu_data) = NULL; + hypre_ParILUDataSchurNSHMaxNumIter(ilu_data) = 2; + hypre_ParILUDataSchurNSHMaxRowNnz(ilu_data) = 1000; + hypre_ParILUDataSchurNSHTol(ilu_data) = 1e-09; + hypre_ParILUDataSchurMRMaxIter(ilu_data) = 2; + hypre_ParILUDataSchurMRColVersion(ilu_data) = 0; + hypre_ParILUDataSchurMRMaxRowNnz(ilu_data) = 200; + hypre_ParILUDataSchurMRTol(ilu_data) = 1e-09; + + return ilu_data; } /*-------------------------------------------------------------------------- + * hypre_ILUDestroy *--------------------------------------------------------------------------*/ -/* Destroy */ + HYPRE_Int hypre_ILUDestroy( void *data ) { - hypre_ParILUData * ilu_data = (hypre_ParILUData*) data; + hypre_ParILUData *ilu_data = (hypre_ParILUData*) data; + HYPRE_MemoryLocation memory_location; -#ifdef HYPRE_USING_CUDA - if(hypre_ParILUDataILUSolveBuffer(ilu_data)) - { - hypre_TFree(hypre_ParILUDataILUSolveBuffer(ilu_data), HYPRE_MEMORY_DEVICE); - hypre_ParILUDataILUSolveBuffer(ilu_data) = NULL; - } - if(hypre_ParILUDataMatLMatrixDescription(ilu_data)) - { - HYPRE_CUSPARSE_CALL( (cusparseDestroyMatDescr(hypre_ParILUDataMatLMatrixDescription(ilu_data))) ); - hypre_ParILUDataMatLMatrixDescription(ilu_data) = NULL; - } - if(hypre_ParILUDataMatUMatrixDescription(ilu_data)) - { - HYPRE_CUSPARSE_CALL( (cusparseDestroyMatDescr(hypre_ParILUDataMatUMatrixDescription(ilu_data))) ); - hypre_ParILUDataMatUMatrixDescription(ilu_data) = NULL; - } - if(hypre_ParILUDataMatALILUSolveInfo(ilu_data)) - { - HYPRE_CUSPARSE_CALL( (cusparseDestroyCsrsv2Info(hypre_ParILUDataMatALILUSolveInfo(ilu_data))) ); - hypre_ParILUDataMatALILUSolveInfo(ilu_data) = NULL; - } - if(hypre_ParILUDataMatAUILUSolveInfo(ilu_data)) - { - HYPRE_CUSPARSE_CALL( (cusparseDestroyCsrsv2Info(hypre_ParILUDataMatAUILUSolveInfo(ilu_data))) ); - hypre_ParILUDataMatAUILUSolveInfo(ilu_data) = NULL; - } - if(hypre_ParILUDataMatBLILUSolveInfo(ilu_data)) - { - HYPRE_CUSPARSE_CALL( (cusparseDestroyCsrsv2Info(hypre_ParILUDataMatBLILUSolveInfo(ilu_data))) ); - hypre_ParILUDataMatBLILUSolveInfo(ilu_data) = NULL; - } - if(hypre_ParILUDataMatBUILUSolveInfo(ilu_data)) - { - HYPRE_CUSPARSE_CALL( (cusparseDestroyCsrsv2Info(hypre_ParILUDataMatBUILUSolveInfo(ilu_data))) ); - hypre_ParILUDataMatBUILUSolveInfo(ilu_data) = NULL; - } - if(hypre_ParILUDataMatSLILUSolveInfo(ilu_data)) - { - HYPRE_CUSPARSE_CALL( (cusparseDestroyCsrsv2Info(hypre_ParILUDataMatSLILUSolveInfo(ilu_data))) ); - hypre_ParILUDataMatSLILUSolveInfo(ilu_data) = NULL; - } - if(hypre_ParILUDataMatSUILUSolveInfo(ilu_data)) - { - HYPRE_CUSPARSE_CALL( (cusparseDestroyCsrsv2Info(hypre_ParILUDataMatSUILUSolveInfo(ilu_data))) ); - hypre_ParILUDataMatSUILUSolveInfo(ilu_data) = NULL; - } - if(hypre_ParILUDataMatAILUDevice(ilu_data)) + if (ilu_data) { + /* Get memory location from L factor */ + if (hypre_ParILUDataMatL(ilu_data)) + { + memory_location = hypre_ParCSRMatrixMemoryLocation(hypre_ParILUDataMatL(ilu_data)); + } + else + { + /* Use default memory location */ + HYPRE_GetMemoryLocation(&memory_location); + } + + /* GPU additional data */ +#if defined(HYPRE_USING_GPU) + hypre_ParCSRMatrixDestroy( hypre_ParILUDataAperm(ilu_data) ); + hypre_ParCSRMatrixDestroy( hypre_ParILUDataR(ilu_data) ); + hypre_ParCSRMatrixDestroy( hypre_ParILUDataP(ilu_data) ); + hypre_CSRMatrixDestroy( hypre_ParILUDataMatAILUDevice(ilu_data) ); - hypre_ParILUDataMatAILUDevice(ilu_data) = NULL; - } - if(hypre_ParILUDataMatBILUDevice(ilu_data)) - { hypre_CSRMatrixDestroy( hypre_ParILUDataMatBILUDevice(ilu_data) ); - hypre_ParILUDataMatBILUDevice(ilu_data) = NULL; - } - if(hypre_ParILUDataMatSILUDevice(ilu_data)) - { hypre_CSRMatrixDestroy( hypre_ParILUDataMatSILUDevice(ilu_data) ); - hypre_ParILUDataMatSILUDevice(ilu_data) = NULL; - } - if(hypre_ParILUDataMatEDevice(ilu_data)) - { hypre_CSRMatrixDestroy( hypre_ParILUDataMatEDevice(ilu_data) ); - hypre_ParILUDataMatEDevice(ilu_data) = NULL; - } - if(hypre_ParILUDataMatFDevice(ilu_data)) - { hypre_CSRMatrixDestroy( hypre_ParILUDataMatFDevice(ilu_data) ); - hypre_ParILUDataMatFDevice(ilu_data) = NULL; - } - if(hypre_ParILUDataAperm(ilu_data)) - { - hypre_ParCSRMatrixDestroy( hypre_ParILUDataAperm(ilu_data) ); - hypre_ParILUDataAperm(ilu_data) = NULL; - } - if(hypre_ParILUDataR(ilu_data)) - { - hypre_ParCSRMatrixDestroy( hypre_ParILUDataR(ilu_data) ); - hypre_ParILUDataR(ilu_data) = NULL; - } - if(hypre_ParILUDataP(ilu_data)) - { - hypre_ParCSRMatrixDestroy( hypre_ParILUDataP(ilu_data) ); - hypre_ParILUDataP(ilu_data) = NULL; - } - if(hypre_ParILUDataFTempUpper(ilu_data)) - { hypre_SeqVectorDestroy( hypre_ParILUDataFTempUpper(ilu_data) ); - hypre_ParILUDataFTempUpper(ilu_data) = NULL; - } - if(hypre_ParILUDataUTempLower(ilu_data)) - { hypre_SeqVectorDestroy( hypre_ParILUDataUTempLower(ilu_data) ); - hypre_ParILUDataUTempLower(ilu_data) = NULL; - } - if(hypre_ParILUDataMatAFakeDiagonal(ilu_data)) - { - hypre_TFree( hypre_ParILUDataMatAFakeDiagonal(ilu_data), HYPRE_MEMORY_DEVICE); - hypre_ParILUDataMatAFakeDiagonal(ilu_data) = NULL; - } + hypre_SeqVectorDestroy( hypre_ParILUDataADiagDiag(ilu_data) ); + hypre_SeqVectorDestroy( hypre_ParILUDataSDiagDiag(ilu_data) ); #endif - /* final residual vector */ - if(hypre_ParILUDataResidual(ilu_data)) - { + /* final residual vector */ hypre_ParVectorDestroy( hypre_ParILUDataResidual(ilu_data) ); - hypre_ParILUDataResidual(ilu_data) = NULL; - } - if(hypre_ParILUDataRelResNorms(ilu_data)) - { - hypre_TFree( hypre_ParILUDataRelResNorms(ilu_data) , HYPRE_MEMORY_HOST); - hypre_ParILUDataRelResNorms(ilu_data) = NULL; - } - /* temp vectors for solve phase */ - if(hypre_ParILUDataUTemp(ilu_data)) - { + hypre_TFree( hypre_ParILUDataRelResNorms(ilu_data), HYPRE_MEMORY_HOST ); + + /* temp vectors for solve phase */ hypre_ParVectorDestroy( hypre_ParILUDataUTemp(ilu_data) ); - hypre_ParILUDataUTemp(ilu_data) = NULL; - } - if(hypre_ParILUDataFTemp(ilu_data)) - { hypre_ParVectorDestroy( hypre_ParILUDataFTemp(ilu_data) ); - hypre_ParILUDataFTemp(ilu_data) = NULL; - } - if(hypre_ParILUDataXTemp(ilu_data)) - { hypre_ParVectorDestroy( hypre_ParILUDataXTemp(ilu_data) ); - hypre_ParILUDataXTemp(ilu_data) = NULL; - } - if(hypre_ParILUDataYTemp(ilu_data)) - { hypre_ParVectorDestroy( hypre_ParILUDataYTemp(ilu_data) ); - hypre_ParILUDataYTemp(ilu_data) = NULL; - } - if(hypre_ParILUDataUExt(ilu_data)) - { - hypre_TFree(hypre_ParILUDataUExt(ilu_data), HYPRE_MEMORY_HOST); - hypre_ParILUDataUExt(ilu_data) = NULL; - } - if(hypre_ParILUDataFExt(ilu_data)) - { - hypre_TFree(hypre_ParILUDataFExt(ilu_data), HYPRE_MEMORY_HOST); - hypre_ParILUDataFExt(ilu_data) = NULL; - } - if(hypre_ParILUDataRhs(ilu_data)) - { + hypre_ParVectorDestroy( hypre_ParILUDataZTemp(ilu_data) ); hypre_ParVectorDestroy( hypre_ParILUDataRhs(ilu_data) ); - hypre_ParILUDataRhs(ilu_data) = NULL; - } - if(hypre_ParILUDataX(ilu_data)) - { hypre_ParVectorDestroy( hypre_ParILUDataX(ilu_data) ); - hypre_ParILUDataX(ilu_data) = NULL; - } - /* l1_norms */ - if(hypre_ParILUDataL1Norms(ilu_data)) - { - hypre_TFree(hypre_ParILUDataL1Norms(ilu_data), HYPRE_MEMORY_HOST); - hypre_ParILUDataL1Norms(ilu_data) = NULL; - } + hypre_TFree( hypre_ParILUDataUExt(ilu_data), HYPRE_MEMORY_HOST ); + hypre_TFree( hypre_ParILUDataFExt(ilu_data), HYPRE_MEMORY_HOST ); - /* u_end */ - if(hypre_ParILUDataUEnd(ilu_data)) - { - hypre_TFree(hypre_ParILUDataUEnd(ilu_data), HYPRE_MEMORY_HOST); - hypre_ParILUDataUEnd(ilu_data) = NULL; - } + /* l1_norms */ + hypre_TFree( hypre_ParILUDataL1Norms(ilu_data), HYPRE_MEMORY_HOST ); - /* Factors */ - if(hypre_ParILUDataMatL(ilu_data)) - { - hypre_ParCSRMatrixDestroy(hypre_ParILUDataMatL(ilu_data)); - hypre_ParILUDataMatL(ilu_data) = NULL; - } - if(hypre_ParILUDataMatU(ilu_data)) - { - hypre_ParCSRMatrixDestroy(hypre_ParILUDataMatU(ilu_data)); - hypre_ParILUDataMatU(ilu_data) = NULL; - } - if(hypre_ParILUDataMatD(ilu_data)) - { - hypre_TFree(hypre_ParILUDataMatD(ilu_data), HYPRE_MEMORY_DEVICE); - hypre_ParILUDataMatD(ilu_data) = NULL; - } - if(hypre_ParILUDataMatLModified(ilu_data)) - { - hypre_ParCSRMatrixDestroy(hypre_ParILUDataMatLModified(ilu_data)); - hypre_ParILUDataMatLModified(ilu_data) = NULL; - } - if(hypre_ParILUDataMatUModified(ilu_data)) - { - hypre_ParCSRMatrixDestroy(hypre_ParILUDataMatUModified(ilu_data)); - hypre_ParILUDataMatUModified(ilu_data) = NULL; - } - if(hypre_ParILUDataMatDModified(ilu_data)) - { - hypre_TFree(hypre_ParILUDataMatDModified(ilu_data), HYPRE_MEMORY_DEVICE); - hypre_ParILUDataMatDModified(ilu_data) = NULL; - } - if(hypre_ParILUDataMatS(ilu_data)) - { - hypre_ParCSRMatrixDestroy(hypre_ParILUDataMatS(ilu_data)); - hypre_ParILUDataMatS(ilu_data) = NULL; - } - if(hypre_ParILUDataSchurSolver(ilu_data)) - { - switch(hypre_ParILUDataIluType(ilu_data)){ - case 10: case 11: case 40: case 41: case 50: - HYPRE_ParCSRGMRESDestroy(hypre_ParILUDataSchurSolver(ilu_data)); //GMRES for Schur - break; - case 20: case 21: - hypre_NSHDestroy(hypre_ParILUDataSchurSolver(ilu_data));//NSH for Schur - break; - default: - break; - } - hypre_ParILUDataSchurSolver(ilu_data) = NULL; - } - if(hypre_ParILUDataSchurPrecond(ilu_data)) - { - switch(hypre_ParILUDataIluType(ilu_data)){ - case 10: case 11: case 40: case 41: -#ifdef HYPRE_USING_CUDA - if(hypre_ParILUDataIluType(ilu_data) != 10 && hypre_ParILUDataIluType(ilu_data) != 11) + /* u_end */ + hypre_TFree( hypre_ParILUDataUEnd(ilu_data), HYPRE_MEMORY_HOST ); + + /* Factors */ + hypre_ParCSRMatrixDestroy( hypre_ParILUDataMatS(ilu_data) ); + hypre_ParCSRMatrixDestroy( hypre_ParILUDataMatL(ilu_data) ); + hypre_ParCSRMatrixDestroy( hypre_ParILUDataMatU(ilu_data) ); + hypre_ParCSRMatrixDestroy( hypre_ParILUDataMatLModified(ilu_data) ); + hypre_ParCSRMatrixDestroy( hypre_ParILUDataMatUModified(ilu_data) ); + hypre_TFree( hypre_ParILUDataMatD(ilu_data), memory_location ); + hypre_TFree( hypre_ParILUDataMatDModified(ilu_data), memory_location ); + + if (hypre_ParILUDataSchurSolver(ilu_data)) + { + switch (hypre_ParILUDataIluType(ilu_data)) { -#endif - HYPRE_ILUDestroy(hypre_ParILUDataSchurPrecond(ilu_data)); //ILU as precond for Schur -#ifdef HYPRE_USING_CUDA + case 10: case 11: case 40: case 41: case 50: + /* GMRES for Schur */ + HYPRE_ParCSRGMRESDestroy(hypre_ParILUDataSchurSolver(ilu_data)); + break; + + case 20: case 21: + /* NSH for Schur */ + hypre_NSHDestroy(hypre_ParILUDataSchurSolver(ilu_data)); + break; + + default: + break; } + } + + /* ILU as precond for Schur */ + if ( hypre_ParILUDataSchurPrecond(ilu_data) && +#if defined(HYPRE_USING_GPU) + hypre_ParILUDataIluType(ilu_data) != 10 && + hypre_ParILUDataIluType(ilu_data) != 11 && #endif - break; - default: - break; - } - hypre_ParILUDataSchurPrecond(ilu_data) = NULL; - } - /* CF marker array */ - if(hypre_ParILUDataCFMarkerArray(ilu_data)) - { - hypre_TFree(hypre_ParILUDataCFMarkerArray(ilu_data), HYPRE_MEMORY_HOST); - hypre_ParILUDataCFMarkerArray(ilu_data) = NULL; - } - /* permutation array */ - if(hypre_ParILUDataPerm(ilu_data)) - { - hypre_TFree(hypre_ParILUDataPerm(ilu_data), HYPRE_MEMORY_DEVICE); - hypre_ParILUDataPerm(ilu_data) = NULL; - } - if(hypre_ParILUDataQPerm(ilu_data)) - { - hypre_TFree(hypre_ParILUDataQPerm(ilu_data), HYPRE_MEMORY_DEVICE); - hypre_ParILUDataQPerm(ilu_data) = NULL; - } - /* droptol array */ - if(hypre_ParILUDataDroptol(ilu_data)) - { - hypre_TFree(hypre_ParILUDataDroptol(ilu_data), HYPRE_MEMORY_HOST); - hypre_ParILUDataDroptol(ilu_data) = NULL; - } - if(hypre_ParILUDataSchurPrecondIluDroptol(ilu_data)) - { - hypre_TFree(hypre_ParILUDataSchurPrecondIluDroptol(ilu_data), HYPRE_MEMORY_HOST); - hypre_ParILUDataSchurPrecondIluDroptol(ilu_data) = NULL; - } - if(hypre_ParILUDataSchurNSHDroptol(ilu_data)) - { - hypre_TFree(hypre_ParILUDataSchurNSHDroptol(ilu_data), HYPRE_MEMORY_HOST); - hypre_ParILUDataSchurNSHDroptol(ilu_data) = NULL; + (hypre_ParILUDataIluType(ilu_data) == 10 || + hypre_ParILUDataIluType(ilu_data) == 11 || + hypre_ParILUDataIluType(ilu_data) == 40 || + hypre_ParILUDataIluType(ilu_data) == 41) ) + { + HYPRE_ILUDestroy( hypre_ParILUDataSchurPrecond(ilu_data) ); + } + + /* CF marker array */ + hypre_TFree( hypre_ParILUDataCFMarkerArray(ilu_data), HYPRE_MEMORY_HOST ); + + /* permutation array */ + hypre_TFree( hypre_ParILUDataPerm(ilu_data), memory_location ); + hypre_TFree( hypre_ParILUDataQPerm(ilu_data), memory_location ); + + /* Iterative ILU data */ + hypre_TFree( hypre_ParILUDataIterativeSetupHistory(ilu_data), HYPRE_MEMORY_HOST ); + + /* droptol array - TODO (VPM): remove this after changing to static array */ + hypre_TFree( hypre_ParILUDataDroptol(ilu_data), HYPRE_MEMORY_HOST ); + hypre_TFree( hypre_ParILUDataSchurPrecondIluDroptol(ilu_data), HYPRE_MEMORY_HOST ); + hypre_TFree( hypre_ParILUDataSchurNSHDroptol(ilu_data), HYPRE_MEMORY_HOST ); } - /* ilu data */ + + /* ILU data */ hypre_TFree(ilu_data, HYPRE_MEMORY_HOST); return hypre_error_flag; } + /*-------------------------------------------------------------------------- + * hypre_ILUSetLevelOfFill + * + * Set fill level for ILUK *--------------------------------------------------------------------------*/ -/* set fill level (for ilu(k)) */ + HYPRE_Int -hypre_ILUSetLevelOfFill( void *ilu_vdata, HYPRE_Int lfil ) +hypre_ILUSetLevelOfFill( void *ilu_vdata, + HYPRE_Int lfil ) { hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; + hypre_ParILUDataLfil(ilu_data) = lfil; + return hypre_error_flag; } -/* set max non-zeros per row in factors (for ilut) */ + +/*-------------------------------------------------------------------------- + * hypre_ILUSetMaxNnzPerRow + * + * Set max non-zeros per row in factors for ILUT + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUSetMaxNnzPerRow( void *ilu_vdata, HYPRE_Int nzmax ) +hypre_ILUSetMaxNnzPerRow( void *ilu_vdata, + HYPRE_Int nzmax ) { hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; + hypre_ParILUDataMaxRowNnz(ilu_data) = nzmax; + return hypre_error_flag; } -/* set threshold for dropping in LU factors (for ilut) */ + +/*-------------------------------------------------------------------------- + * hypre_ILUSetDropThreshold + * + * Set threshold for dropping in LU factors for ILUT + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUSetDropThreshold( void *ilu_vdata, HYPRE_Real threshold ) +hypre_ILUSetDropThreshold( void *ilu_vdata, + HYPRE_Real threshold ) { hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; - if(!(hypre_ParILUDataDroptol(ilu_data))) + + if (!(hypre_ParILUDataDroptol(ilu_data))) { hypre_ParILUDataDroptol(ilu_data) = hypre_TAlloc(HYPRE_Real, 3, HYPRE_MEMORY_HOST); } hypre_ParILUDataDroptol(ilu_data)[0] = threshold; hypre_ParILUDataDroptol(ilu_data)[1] = threshold; hypre_ParILUDataDroptol(ilu_data)[2] = threshold; + return hypre_error_flag; } -/* set array of threshold for dropping in LU factors (for ilut) */ + +/*-------------------------------------------------------------------------- + * hypre_ILUSetDropThresholdArray + * + * Set array of threshold for dropping in LU factors for ILUT + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUSetDropThresholdArray( void *ilu_vdata, HYPRE_Real *threshold ) +hypre_ILUSetDropThresholdArray( void *ilu_vdata, + HYPRE_Real *threshold ) { hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; - if(!(hypre_ParILUDataDroptol(ilu_data))) + + if (!(hypre_ParILUDataDroptol(ilu_data))) { hypre_ParILUDataDroptol(ilu_data) = hypre_TAlloc(HYPRE_Real, 3, HYPRE_MEMORY_HOST); } - hypre_TMemcpy( hypre_ParILUDataDroptol(ilu_data), threshold, HYPRE_Real, 3, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + + hypre_ParILUDataDroptol(ilu_data)[0] = threshold[0]; + hypre_ParILUDataDroptol(ilu_data)[1] = threshold[1]; + hypre_ParILUDataDroptol(ilu_data)[2] = threshold[2]; + return hypre_error_flag; } -/* set ILU factorization type */ + +/*-------------------------------------------------------------------------- + * hypre_ILUSetType + * + * Set ILU factorization type + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUSetType( void *ilu_vdata, HYPRE_Int ilu_type ) +hypre_ILUSetType( void *ilu_vdata, + HYPRE_Int ilu_type ) { hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; - /* destroy schur solver and/or preconditioner if already have one */ - if(hypre_ParILUDataSchurSolver(ilu_data)) + /* Destroy schur solver and/or preconditioner if already have one */ + if (hypre_ParILUDataSchurSolver(ilu_data)) { - switch(hypre_ParILUDataIluType(ilu_data)){ - case 10: case 11: case 40: case 41: case 50: - HYPRE_ParCSRGMRESDestroy(hypre_ParILUDataSchurSolver(ilu_data)); //GMRES for Schur - break; - case 20: case 21: - hypre_NSHDestroy(hypre_ParILUDataSchurSolver(ilu_data));//NSH for Schur - break; - default: - break; + switch (hypre_ParILUDataIluType(ilu_data)) + { + case 10: case 11: case 40: case 41: case 50: + //GMRES for Schur + HYPRE_ParCSRGMRESDestroy(hypre_ParILUDataSchurSolver(ilu_data)); + break; + + case 20: case 21: + // NSH for Schur + hypre_NSHDestroy(hypre_ParILUDataSchurSolver(ilu_data)); + break; + + default: + break; } hypre_ParILUDataSchurSolver(ilu_data) = NULL; } - if(hypre_ParILUDataSchurPrecond(ilu_data)) - { - switch(hypre_ParILUDataIluType(ilu_data)){ - case 10: case 11: case 40: case 41: -#ifdef HYPRE_USING_CUDA - if(hypre_ParILUDataIluType(ilu_data) != 10 && hypre_ParILUDataIluType(ilu_data) != 11) - { -#endif - HYPRE_ILUDestroy(hypre_ParILUDataSchurPrecond(ilu_data)); //ILU as precond for Schur -#ifdef HYPRE_USING_CUDA - } + + /* ILU as precond for Schur */ + if ( hypre_ParILUDataSchurPrecond(ilu_data) && +#if defined(HYPRE_USING_GPU) + (hypre_ParILUDataIluType(ilu_data) != 10 && + hypre_ParILUDataIluType(ilu_data) != 11) && #endif - break; - default: - break; - } + (hypre_ParILUDataIluType(ilu_data) == 10 || + hypre_ParILUDataIluType(ilu_data) == 11 || + hypre_ParILUDataIluType(ilu_data) == 40 || + hypre_ParILUDataIluType(ilu_data) == 41) ) + { + HYPRE_ILUDestroy(hypre_ParILUDataSchurPrecond(ilu_data)); hypre_ParILUDataSchurPrecond(ilu_data) = NULL; } hypre_ParILUDataIluType(ilu_data) = ilu_type; + /* reset default value, not a large cost * assume we won't change back from */ - switch(ilu_type) + switch (ilu_type) { /* NSH type */ case 20: case 21: { /* only set value when user has not assiged value before */ - if(!(hypre_ParILUDataSchurNSHDroptol(ilu_data))) + if (!(hypre_ParILUDataSchurNSHDroptol(ilu_data))) { hypre_ParILUDataSchurNSHDroptol(ilu_data) = hypre_TAlloc(HYPRE_Real, 2, HYPRE_MEMORY_HOST); hypre_ParILUDataSchurNSHDroptol(ilu_data)[0] = 1e-02; @@ -523,11 +419,12 @@ hypre_ILUSetType( void *ilu_vdata, HYPRE_Int ilu_type ) } break; } + case 10: case 11: case 40: case 41: case 50: { /* Set value of droptol for solving Schur system (if not set by user) */ /* NOTE: This is currently not exposed to users */ - if(!(hypre_ParILUDataSchurPrecondIluDroptol(ilu_data))) + if (!(hypre_ParILUDataSchurPrecondIluDroptol(ilu_data))) { hypre_ParILUDataSchurPrecondIluDroptol(ilu_data) = hypre_TAlloc(HYPRE_Real, 3, HYPRE_MEMORY_HOST); hypre_ParILUDataSchurPrecondIluDroptol(ilu_data)[0] = 1e-02; @@ -536,66 +433,275 @@ hypre_ILUSetType( void *ilu_vdata, HYPRE_Int ilu_type ) } break; } + default: break; } return hypre_error_flag; } -/* Set max number of iterations for ILU solver */ + +/*-------------------------------------------------------------------------- + * hypre_ILUSetMaxIter + * + * Set max number of iterations for ILU solver + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUSetMaxIter( void *ilu_vdata, HYPRE_Int max_iter ) +hypre_ILUSetMaxIter( void *ilu_vdata, + HYPRE_Int max_iter ) { - hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; + hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; + hypre_ParILUDataMaxIter(ilu_data) = max_iter; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_ILUSetIterativeSetupType + * + * Set iterative ILU setup algorithm + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetIterativeSetupType( void *ilu_vdata, + HYPRE_Int iter_setup_type) +{ + hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; + + hypre_ParILUDataIterativeSetupType(ilu_data) = iter_setup_type; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_ILUSetIterativeSetupOption + * + * Set iterative ILU compute option + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetIterativeSetupOption( void *ilu_vdata, + HYPRE_Int iter_setup_option) +{ + hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; + + /* Compute residuals when using the stopping criteria, if not chosen by the user */ + iter_setup_option |= ((iter_setup_option & 0x02) && !(iter_setup_option & 0x0C)) ? 0x08 : 0; + + /* Compute residuals when asking for conv. history, if not chosen by the user */ + iter_setup_option |= ((iter_setup_option & 0x10) && !(iter_setup_option & 0x08)) ? 0x08 : 0; + + /* Zero out first bit of option (turn off rocSPARSE logging) */ + iter_setup_option &= ~0x01; + + /* Set internal iter_setup_option */ + hypre_ParILUDataIterativeSetupOption(ilu_data) = iter_setup_option; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_ILUSetIterativeSetupMaxIter + * + * Set maximum number of iterations for iterative ILU setup + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetIterativeSetupMaxIter( void *ilu_vdata, + HYPRE_Int iter_setup_max_iter) +{ + hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; + + hypre_ParILUDataIterativeSetupMaxIter(ilu_data) = iter_setup_max_iter; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_ILUSetIterativeSetupTolerance + * + * Set dropping tolerance for iterative ILU setup + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetIterativeSetupTolerance( void *ilu_vdata, + HYPRE_Real iter_setup_tolerance) +{ + hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; + + hypre_ParILUDataIterativeSetupTolerance(ilu_data) = iter_setup_tolerance; + return hypre_error_flag; } -/* Set convergence tolerance for ILU solver */ + +/*-------------------------------------------------------------------------- + * hypre_ILUGetIterativeSetupHistory + * + * Get array of corrections and/or residual norms computed during ILU's + * iterative setup algorithm. + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUSetTol( void *ilu_vdata, HYPRE_Real tol ) +hypre_ILUGetIterativeSetupHistory( void *ilu_vdata, + HYPRE_Complex **iter_setup_history) +{ + hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; + + *iter_setup_history = hypre_ParILUDataIterativeSetupHistory(ilu_data); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_ILUSetTriSolve + * + * Set ILU triangular solver type + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetTriSolve( void *ilu_vdata, + HYPRE_Int tri_solve ) { hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; + + hypre_ParILUDataTriSolve(ilu_data) = tri_solve; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_ILUSetLowerJacobiIters + * + * Set Lower Jacobi iterations for iterative triangular solver + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetLowerJacobiIters( void *ilu_vdata, + HYPRE_Int lower_jacobi_iters ) +{ + hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; + + hypre_ParILUDataLowerJacobiIters(ilu_data) = lower_jacobi_iters; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_ILUSetUpperJacobiIters + * + * Set Upper Jacobi iterations for iterative triangular solver + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetUpperJacobiIters( void *ilu_vdata, + HYPRE_Int upper_jacobi_iters ) +{ + hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; + + hypre_ParILUDataUpperJacobiIters(ilu_data) = upper_jacobi_iters; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_ILUSetTol + * + * Set convergence tolerance for ILU solver + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetTol( void *ilu_vdata, + HYPRE_Real tol ) +{ + hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; + hypre_ParILUDataTol(ilu_data) = tol; + return hypre_error_flag; } -/* Set print level for ilu solver */ + +/*-------------------------------------------------------------------------- + * hypre_ILUSetPrintLevel + * + * Set print level for ILU solver + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUSetPrintLevel( void *ilu_vdata, HYPRE_Int print_level ) +hypre_ILUSetPrintLevel( void *ilu_vdata, + HYPRE_Int print_level ) { hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; + hypre_ParILUDataPrintLevel(ilu_data) = print_level; + return hypre_error_flag; } -/* Set print level for ilu solver */ + +/*-------------------------------------------------------------------------- + * hypre_ILUSetLogging + * + * Set print level for ilu solver + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUSetLogging( void *ilu_vdata, HYPRE_Int logging ) +hypre_ILUSetLogging( void *ilu_vdata, + HYPRE_Int logging ) { hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; + hypre_ParILUDataLogging(ilu_data) = logging; + return hypre_error_flag; } -/* Set type of reordering for local matrix */ + +/*-------------------------------------------------------------------------- + * hypre_ILUSetLocalReordering + * + * Set type of reordering for local matrix + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUSetLocalReordering( void *ilu_vdata, HYPRE_Int ordering_type ) +hypre_ILUSetLocalReordering( void *ilu_vdata, + HYPRE_Int ordering_type ) { hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; + hypre_ParILUDataReorderingType(ilu_data) = ordering_type; + return hypre_error_flag; } -/* Set KDim (for GMRES) for Solver of Schur System */ +/*-------------------------------------------------------------------------- + * hypre_ILUSetSchurSolverKDIM + * + * Set KDim (for GMRES) for Solver of Schur System + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUSetSchurSolverKDIM( void *ilu_vdata, HYPRE_Int ss_kDim ) +hypre_ILUSetSchurSolverKDIM( void *ilu_vdata, + HYPRE_Int ss_kDim ) { hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; + hypre_ParILUDataSchurGMRESKDim(ilu_data) = ss_kDim; + return hypre_error_flag; } -/* Set max iteration for Solver of Schur System */ + +/*-------------------------------------------------------------------------- + * hypre_ILUSetSchurSolverMaxIter + * + * Set max iteration for Solver of Schur System + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUSetSchurSolverMaxIter( void *ilu_vdata, HYPRE_Int ss_max_iter ) +hypre_ILUSetSchurSolverMaxIter( void *ilu_vdata, + HYPRE_Int ss_max_iter ) { hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; + /* for the GMRES solve, the max iter is same as kdim by default */ hypre_ParILUDataSchurGMRESKDim(ilu_data) = ss_max_iter; hypre_ParILUDataSchurGMRESMaxIter(ilu_data) = ss_max_iter; @@ -605,156 +711,349 @@ hypre_ILUSetSchurSolverMaxIter( void *ilu_vdata, HYPRE_Int ss_max_iter ) return hypre_error_flag; } -/* Set convergence tolerance for Solver of Schur System */ + +/*-------------------------------------------------------------------------- + * hypre_ILUSetSchurSolverTol + * + * Set convergence tolerance for Solver of Schur System + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUSetSchurSolverTol( void *ilu_vdata, HYPRE_Real ss_tol ) +hypre_ILUSetSchurSolverTol( void *ilu_vdata, + HYPRE_Real ss_tol ) { hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; + hypre_ParILUDataSchurGMRESTol(ilu_data) = ss_tol; + return hypre_error_flag; } -/* Set absolute tolerance for Solver of Schur System */ + +/*-------------------------------------------------------------------------- + * hypre_ILUSetSchurSolverAbsoluteTol + * + * Set absolute tolerance for Solver of Schur System + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUSetSchurSolverAbsoluteTol( void *ilu_vdata, HYPRE_Real ss_absolute_tol ) +hypre_ILUSetSchurSolverAbsoluteTol( void *ilu_vdata, + HYPRE_Real ss_absolute_tol ) { hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; + hypre_ParILUDataSchurGMRESAbsoluteTol(ilu_data) = ss_absolute_tol; + return hypre_error_flag; } -/* Set logging for Solver of Schur System */ + +/*-------------------------------------------------------------------------- + * hypre_ILUSetSchurSolverLogging + * + * Set logging for Solver of Schur System + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUSetSchurSolverLogging( void *ilu_vdata, HYPRE_Int ss_logging ) +hypre_ILUSetSchurSolverLogging( void *ilu_vdata, + HYPRE_Int ss_logging ) { hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; + hypre_ParILUDataSchurSolverLogging(ilu_data) = ss_logging; + return hypre_error_flag; } -/* Set print level for Solver of Schur System */ + +/*-------------------------------------------------------------------------- + * hypre_ILUSetSchurSolverPrintLevel + * + * Set print level for Solver of Schur System + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUSetSchurSolverPrintLevel( void *ilu_vdata, HYPRE_Int ss_print_level ) +hypre_ILUSetSchurSolverPrintLevel( void *ilu_vdata, + HYPRE_Int ss_print_level ) { hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; + hypre_ParILUDataSchurSolverPrintLevel(ilu_data) = ss_print_level; + return hypre_error_flag; } -/* Set rel change (for GMRES) for Solver of Schur System */ + +/*-------------------------------------------------------------------------- + * hypre_ILUSetSchurSolverRelChange + * + * Set rel change (for GMRES) for Solver of Schur System + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_ILUSetSchurSolverRelChange( void *ilu_vdata, HYPRE_Int ss_rel_change ) { hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; + hypre_ParILUDataSchurGMRESRelChange(ilu_data) = ss_rel_change; + return hypre_error_flag; } -/* Set ILU type for Precond of Schur System */ + +/*-------------------------------------------------------------------------- + * hypre_ILUSetSchurPrecondILUType + * + * Set ILU type for Precond of Schur System + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_ILUSetSchurPrecondILUType( void *ilu_vdata, HYPRE_Int sp_ilu_type ) { hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; + hypre_ParILUDataSchurPrecondIluType(ilu_data) = sp_ilu_type; + return hypre_error_flag; } -/* Set ILU level of fill for Precond of Schur System */ + +/*-------------------------------------------------------------------------- + * hypre_ILUSetSchurPrecondILULevelOfFill + * + * Set ILU level of fill for Precond of Schur System + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_ILUSetSchurPrecondILULevelOfFill( void *ilu_vdata, HYPRE_Int sp_ilu_lfil ) { hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; + hypre_ParILUDataSchurPrecondIluLfil(ilu_data) = sp_ilu_lfil; + return hypre_error_flag; } -/* Set ILU max nonzeros per row for Precond of Schur System */ + +/*-------------------------------------------------------------------------- + * hypre_ILUSetSchurPrecondILUMaxNnzPerRow + * + * Set ILU max nonzeros per row for Precond of Schur System + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUSetSchurPrecondILUMaxNnzPerRow( void *ilu_vdata, HYPRE_Int sp_ilu_max_row_nnz ) +hypre_ILUSetSchurPrecondILUMaxNnzPerRow( void *ilu_vdata, + HYPRE_Int sp_ilu_max_row_nnz ) { hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; + hypre_ParILUDataSchurPrecondIluMaxRowNnz(ilu_data) = sp_ilu_max_row_nnz; + return hypre_error_flag; } -/* Set ILU drop threshold for ILUT for Precond of Schur System - * We don't want to influence the original ILU, so create new array if not own data - */ + +/*-------------------------------------------------------------------------- + * hypre_ILUSetSchurPrecondILUDropThreshold + * + * Set ILU drop threshold for ILUT for Precond of Schur System + * We don't want to influence the original ILU, so create new array if + * not own data + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUSetSchurPrecondILUDropThreshold( void *ilu_vdata, HYPRE_Real sp_ilu_droptol ) +hypre_ILUSetSchurPrecondILUDropThreshold( void *ilu_vdata, + HYPRE_Real sp_ilu_droptol ) { hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; - if(!(hypre_ParILUDataSchurPrecondIluDroptol(ilu_data))) + + if (!(hypre_ParILUDataSchurPrecondIluDroptol(ilu_data))) { hypre_ParILUDataSchurPrecondIluDroptol(ilu_data) = hypre_TAlloc(HYPRE_Real, 3, HYPRE_MEMORY_HOST); } hypre_ParILUDataSchurPrecondIluDroptol(ilu_data)[0] = sp_ilu_droptol; hypre_ParILUDataSchurPrecondIluDroptol(ilu_data)[1] = sp_ilu_droptol; hypre_ParILUDataSchurPrecondIluDroptol(ilu_data)[2] = sp_ilu_droptol; + return hypre_error_flag; } -/* Set array of ILU drop threshold for ILUT for Precond of Schur System */ + +/*-------------------------------------------------------------------------- + * hypre_ILUSetSchurPrecondILUDropThresholdArray + * + * Set array of ILU drop threshold for ILUT for Precond of Schur System + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUSetSchurPrecondILUDropThresholdArray( void *ilu_vdata, HYPRE_Real *sp_ilu_droptol ) +hypre_ILUSetSchurPrecondILUDropThresholdArray( void *ilu_vdata, + HYPRE_Real *sp_ilu_droptol ) { hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; - if(!(hypre_ParILUDataSchurPrecondIluDroptol(ilu_data))) + if (!(hypre_ParILUDataSchurPrecondIluDroptol(ilu_data))) { hypre_ParILUDataSchurPrecondIluDroptol(ilu_data) = hypre_TAlloc(HYPRE_Real, 3, HYPRE_MEMORY_HOST); } - hypre_TMemcpy( hypre_ParILUDataSchurPrecondIluDroptol(ilu_data), sp_ilu_droptol, HYPRE_Real, 3, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + + hypre_ParILUDataSchurPrecondIluDroptol(ilu_data)[0] = sp_ilu_droptol[0]; + hypre_ParILUDataSchurPrecondIluDroptol(ilu_data)[1] = sp_ilu_droptol[1]; + hypre_ParILUDataSchurPrecondIluDroptol(ilu_data)[2] = sp_ilu_droptol[2]; + return hypre_error_flag; } -/* Set print level for Precond of Schur System */ + +/*-------------------------------------------------------------------------- + * hypre_ILUSetSchurPrecondPrintLevel + * + * Set print level for Precond of Schur System + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUSetSchurPrecondPrintLevel( void *ilu_vdata, HYPRE_Int sp_print_level ) +hypre_ILUSetSchurPrecondPrintLevel( void *ilu_vdata, + HYPRE_Int sp_print_level ) { hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; + hypre_ParILUDataSchurPrecondPrintLevel(ilu_data) = sp_print_level; + return hypre_error_flag; } -/* Set max number of iterations for Precond of Schur System */ + +/*-------------------------------------------------------------------------- + * hypre_ILUSetSchurPrecondMaxIter + * + * Set max number of iterations for Precond of Schur System + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUSetSchurPrecondMaxIter( void *ilu_vdata, HYPRE_Int sp_max_iter ) +hypre_ILUSetSchurPrecondMaxIter( void *ilu_vdata, + HYPRE_Int sp_max_iter ) { hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; + hypre_ParILUDataSchurPrecondMaxIter(ilu_data) = sp_max_iter; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_ILUSetSchurPrecondTriSolve + * + * Set triangular solver type for Precond of Schur System + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetSchurPrecondTriSolve( void *ilu_vdata, + HYPRE_Int sp_tri_solve ) +{ + hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; + + hypre_ParILUDataSchurPrecondTriSolve(ilu_data) = sp_tri_solve; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_ILUSetSchurPrecondLowerJacobiIters + * + * Set Lower Jacobi iterations for Precond of Schur System + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetSchurPrecondLowerJacobiIters( void *ilu_vdata, + HYPRE_Int sp_lower_jacobi_iters ) +{ + hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; + + hypre_ParILUDataSchurPrecondLowerJacobiIters(ilu_data) = sp_lower_jacobi_iters; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_ILUSetSchurPrecondUpperJacobiIters + * + * Set Upper Jacobi iterations for Precond of Schur System + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetSchurPrecondUpperJacobiIters( void *ilu_vdata, + HYPRE_Int sp_upper_jacobi_iters ) +{ + hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; + + hypre_ParILUDataSchurPrecondUpperJacobiIters(ilu_data) = sp_upper_jacobi_iters; + return hypre_error_flag; } -/* Set onvergence tolerance for Precond of Schur System */ + +/*-------------------------------------------------------------------------- + * hypre_ILUSetSchurPrecondTol + * + * Set convergence tolerance for Precond of Schur System + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUSetSchurPrecondTol( void *ilu_vdata, HYPRE_Int sp_tol ) +hypre_ILUSetSchurPrecondTol( void *ilu_vdata, + HYPRE_Int sp_tol ) { hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; + hypre_ParILUDataSchurPrecondTol(ilu_data) = sp_tol; + return hypre_error_flag; } -/* Set tolorance for dropping in NSH for Schur System - * We don't want to influence the original ILU, so create new array if not own data - */ + +/*-------------------------------------------------------------------------- + * hypre_ILUSetSchurNSHDropThreshold + * + * Set tolorance for dropping in NSH for Schur System + * We don't want to influence the original ILU, so create new array if + * not own data + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUSetSchurNSHDropThreshold( void *ilu_vdata, HYPRE_Real threshold) +hypre_ILUSetSchurNSHDropThreshold( void *ilu_vdata, + HYPRE_Real threshold ) { hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; - if(!(hypre_ParILUDataSchurNSHDroptol(ilu_data))) + + if (!(hypre_ParILUDataSchurNSHDroptol(ilu_data))) { hypre_ParILUDataSchurNSHDroptol(ilu_data) = hypre_TAlloc(HYPRE_Real, 2, HYPRE_MEMORY_HOST); } - hypre_ParILUDataSchurNSHDroptol(ilu_data)[0] = threshold; - hypre_ParILUDataSchurNSHDroptol(ilu_data)[1] = threshold; + + hypre_ParILUDataSchurNSHDroptol(ilu_data)[0] = threshold; + hypre_ParILUDataSchurNSHDroptol(ilu_data)[1] = threshold; + return hypre_error_flag; } -/* Set tolorance array for NSH for Schur System + +/*-------------------------------------------------------------------------- + * hypre_ILUSetSchurNSHDropThresholdArray + * + * Set tolorance array for NSH for Schur System * - threshold[0] : threshold for Minimal Residual iteration (initial guess for NSH). - * - threshold[1] : threshold for Newton–Schulz–Hotelling iteration. -*/ + * - threshold[1] : threshold for Newton-Schulz-Hotelling iteration. + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUSetSchurNSHDropThresholdArray( void *ilu_vdata, HYPRE_Real *threshold) +hypre_ILUSetSchurNSHDropThresholdArray( void *ilu_vdata, + HYPRE_Real *threshold ) { hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; - if(!(hypre_ParILUDataSchurNSHDroptol(ilu_data))) + + if (!(hypre_ParILUDataSchurNSHDroptol(ilu_data))) { hypre_ParILUDataSchurNSHDroptol(ilu_data) = hypre_TAlloc(HYPRE_Real, 2, HYPRE_MEMORY_HOST); } - hypre_TMemcpy( hypre_ParILUDataSchurNSHDroptol(ilu_data), threshold, HYPRE_Real, 2, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + + hypre_ParILUDataSchurNSHDroptol(ilu_data)[0] = threshold[0]; + hypre_ParILUDataSchurNSHDroptol(ilu_data)[1] = threshold[1]; + return hypre_error_flag; } -/* Get number of iterations for ILU solver */ +/*-------------------------------------------------------------------------- + * hypre_ILUGetNumIterations + * + * Get number of iterations for ILU solver + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUGetNumIterations( void *ilu_vdata, HYPRE_Int *num_iterations ) +hypre_ILUGetNumIterations( void *ilu_vdata, + HYPRE_Int *num_iterations ) { hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; @@ -763,13 +1062,21 @@ hypre_ILUGetNumIterations( void *ilu_vdata, HYPRE_Int *num_iterations ) hypre_error_in_arg(1); return hypre_error_flag; } + *num_iterations = hypre_ParILUDataNumIterations(ilu_data); return hypre_error_flag; } -/* Get residual norms for ILU solver */ + +/*-------------------------------------------------------------------------- + * hypre_ILUGetFinalRelativeResidualNorm + * + * Get residual norms for ILU solver + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUGetFinalRelativeResidualNorm( void *ilu_vdata, HYPRE_Real *res_norm ) +hypre_ILUGetFinalRelativeResidualNorm( void *ilu_vdata, + HYPRE_Real *res_norm ) { hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; @@ -778,145 +1085,175 @@ hypre_ILUGetFinalRelativeResidualNorm( void *ilu_vdata, HYPRE_Real *res_norm ) hypre_error_in_arg(1); return hypre_error_flag; } + *res_norm = hypre_ParILUDataFinalRelResidualNorm(ilu_data); return hypre_error_flag; } -/* - * Quicksort of the elements in a from low to high. - * The elements in b are permuted according to the sorted a. - * The elements in iw are permuted reverse according to the sorted a as it's index - * ie, iw[a1] and iw[a2] will be switched if a1 and a2 are switched - * lo and hi are the extents of the region of the array a, that is to be sorted. -*/ -/* -HYPRE_Int -hypre_quickSortIR (HYPRE_Int *a, HYPRE_Real *b, HYPRE_Int *iw, const HYPRE_Int lo, const HYPRE_Int hi) -{ - HYPRE_Int i=lo, j=hi; - HYPRE_Int v; - HYPRE_Int mid = (lo+hi)>>1; - HYPRE_Int x=ceil(a[mid]); - HYPRE_Real q; - // partition - do - { - while (a[i]x) j--; - if (i<=j) - { - v=a[i]; a[i]=a[j]; a[j]=v; - q=b[i]; b[i]=b[j]; b[j]=q; - v=iw[a[i]];iw[a[i]]=iw[a[j]];iw[a[j]]=v; - i++; j--; - } - } while (i<=j); - // recursion - if (lo 0) + + len--; /* now len is the current index */ + while (len > 0) { /* get the parent index */ - p = (len-1)/2; - if(heap[p] > heap[len]) + p = (len - 1) / 2; + if (heap[p] > heap[len]) { /* this is smaller */ - hypre_swap(heap,p,len); + hypre_swap(heap, p, len); len = p; } else @@ -954,22 +1293,28 @@ hypre_ILUMinHeapAddI(HYPRE_Int *heap, HYPRE_Int len) return hypre_error_flag; } -/* see hypre_ILUMinHeapAddI for detail instructions */ +/*-------------------------------------------------------------------------- + * hypre_ILUMinHeapAddIIIi + * + * See hypre_ILUMinHeapAddI for detail instructions + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_ILUMinHeapAddIIIi(HYPRE_Int *heap, HYPRE_Int *I1, HYPRE_Int *Ii1, HYPRE_Int len) { /* parent, left, right */ HYPRE_Int p; - len--;/* now len is the current index */ - while(len > 0) + + len--; /* now len is the current index */ + while (len > 0) { /* get the parent index */ - p = (len-1)/2; - if(heap[p] > heap[len]) + p = (len - 1) / 2; + if (heap[p] > heap[len]) { /* this is smaller */ - hypre_swap(Ii1,heap[p],heap[len]); - hypre_swap2i(heap,I1,p,len); + hypre_swap(Ii1, heap[p], heap[len]); + hypre_swap2i(heap, I1, p, len); len = p; } else @@ -980,48 +1325,28 @@ hypre_ILUMinHeapAddIIIi(HYPRE_Int *heap, HYPRE_Int *I1, HYPRE_Int *Ii1, HYPRE_In return hypre_error_flag; } -/* see hypre_ILUMinHeapAddI for detail instructions */ +/*-------------------------------------------------------------------------- + * hypre_ILUMinHeapAddIRIi + * + * see hypre_ILUMinHeapAddI for detail instructions + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_ILUMinHeapAddIRIi(HYPRE_Int *heap, HYPRE_Real *I1, HYPRE_Int *Ii1, HYPRE_Int len) { /* parent, left, right */ HYPRE_Int p; - len--;/* now len is the current index */ - while(len > 0) - { - /* get the parent index */ - p = (len-1)/2; - if(heap[p] > heap[len]) - { - /* this is smaller */ - hypre_swap(Ii1,heap[p],heap[len]); - hypre_swap2(heap,I1,p,len); - len = p; - } - else - { - break; - } - } - return hypre_error_flag; -} -/* see hypre_ILUMinHeapAddI for detail instructions */ -HYPRE_Int -hypre_ILUMaxHeapAddRabsIIi(HYPRE_Real *heap, HYPRE_Int *I1, HYPRE_Int *Ii1, HYPRE_Int len) -{ - /* parent, left, right */ - HYPRE_Int p; - len--;/* now len is the current index */ - while(len > 0) + len--; /* now len is the current index */ + while (len > 0) { /* get the parent index */ - p = (len-1)/2; - if(hypre_abs(heap[p]) < hypre_abs(heap[len])) + p = (len - 1) / 2; + if (heap[p] > heap[len]) { /* this is smaller */ - hypre_swap(Ii1,heap[p],heap[len]); - hypre_swap2(I1,heap,p,len); + hypre_swap(Ii1, heap[p], heap[len]); + hypre_swap2(heap, I1, p, len); len = p; } else @@ -1032,21 +1357,26 @@ hypre_ILUMaxHeapAddRabsIIi(HYPRE_Real *heap, HYPRE_Int *I1, HYPRE_Int *Ii1, HYPR return hypre_error_flag; } -/* see hypre_ILUMinHeapAddI for detail instructions */ +/*-------------------------------------------------------------------------- + * hypre_ILUMaxrHeapAddRabsI + * + * See hypre_ILUMinHeapAddI for detail instructions + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_ILUMaxrHeapAddRabsI(HYPRE_Real *heap, HYPRE_Int *I1, HYPRE_Int len) { /* parent, left, right */ HYPRE_Int p; len--;/* now len is the current index */ - while(len > 0) + while (len > 0) { /* get the parent index */ - p = (len-1)/2; - if(hypre_abs(heap[-p]) < hypre_abs(heap[-len])) + p = (len - 1) / 2; + if (hypre_abs(heap[-p]) < hypre_abs(heap[-len])) { /* this is smaller */ - hypre_swap2(I1,heap,-p,-len); + hypre_swap2(I1, heap, -p, -len); len = p; } else @@ -1057,7 +1387,9 @@ hypre_ILUMaxrHeapAddRabsI(HYPRE_Real *heap, HYPRE_Int *I1, HYPRE_Int len) return hypre_error_flag; } -/* +/*-------------------------------------------------------------------------- + * hypre_ILUMinHeapRemoveI + * * Swap the first element with the last element of the heap, * reduce size by one, and maintain the heap structure * I means HYPRE_Int @@ -1067,95 +1399,77 @@ hypre_ILUMaxrHeapAddRabsI(HYPRE_Real *heap, HYPRE_Int *I1, HYPRE_Int len) * Ii and Ri means orderd by value of heap, like iw for ILU * heap: aray of that heap * len: current length of the heap - * WARNING: Remember to change the len youself - */ + * WARNING: Remember to change the len yourself + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_ILUMinHeapRemoveI(HYPRE_Int *heap, HYPRE_Int len) { /* parent, left, right */ - HYPRE_Int p,l,r; - len--;/* now len is the max index */ - /* swap the first element to last */ - hypre_swap(heap,0,len); - p = 0; - l = 1; - /* while I'm still in the heap */ - while(l < len) - { - r = 2*p+2; - /* two childs, pick the smaller one */ - l = r >= len || heap[l]= len || heap[l]= len || heap[l] < heap[r] ? l : r; + if (heap[l] < heap[p]) { - hypre_swap(Ii1,heap[p],heap[l]); - hypre_swap2i(heap,I1,l,p); + hypre_swap(heap, l, p); p = l; - l = 2*p+1; + l = 2 * p + 1; } else { break; } } + return hypre_error_flag; } -/* see hypre_ILUMinHeapRemoveI for detail instructions */ +/*-------------------------------------------------------------------------- + * hypre_ILUMinHeapRemoveIIIi + * + * See hypre_ILUMinHeapRemoveI for detail instructions + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUMinHeapRemoveIRIi(HYPRE_Int *heap, HYPRE_Real *I1, HYPRE_Int *Ii1, HYPRE_Int len) +hypre_ILUMinHeapRemoveIIIi(HYPRE_Int *heap, HYPRE_Int *I1, HYPRE_Int *Ii1, HYPRE_Int len) { /* parent, left, right */ - HYPRE_Int p,l,r; + HYPRE_Int p, l, r; + len--;/* now len is the max index */ + /* swap the first element to last */ - hypre_swap(Ii1,heap[0],heap[len]); - hypre_swap2(heap,I1,0,len); + hypre_swap(Ii1, heap[0], heap[len]); + hypre_swap2i(heap, I1, 0, len); p = 0; l = 1; + /* while I'm still in the heap */ - while(l < len) + while (l < len) { - r = 2*p+2; + r = 2 * p + 2; + /* two childs, pick the smaller one */ - l = r >= len || heap[l]= len || heap[l] < heap[r] ? l : r; + if (heap[l] < heap[p]) { - hypre_swap(Ii1,heap[p],heap[l]); - hypre_swap2(heap,I1,l,p); + hypre_swap(Ii1, heap[p], heap[l]); + hypre_swap2i(heap, I1, l, p); p = l; - l = 2*p+1; + l = 2 * p + 1; } else { @@ -1165,61 +1479,80 @@ hypre_ILUMinHeapRemoveIRIi(HYPRE_Int *heap, HYPRE_Real *I1, HYPRE_Int *Ii1, HYPR return hypre_error_flag; } -/* see hypre_ILUMinHeapRemoveI for detail instructions */ +/*-------------------------------------------------------------------------- + * hypre_ILUMinHeapRemoveIRIi + * + * See hypre_ILUMinHeapRemoveI for detail instructions + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUMaxHeapRemoveRabsIIi(HYPRE_Real *heap, HYPRE_Int *I1, HYPRE_Int *Ii1, HYPRE_Int len) +hypre_ILUMinHeapRemoveIRIi(HYPRE_Int *heap, HYPRE_Real *I1, HYPRE_Int *Ii1, HYPRE_Int len) { /* parent, left, right */ - HYPRE_Int p,l,r; + HYPRE_Int p, l, r; + len--;/* now len is the max index */ + /* swap the first element to last */ - hypre_swap(Ii1,heap[0],heap[len]); - hypre_swap2(I1,heap,0,len); + hypre_swap(Ii1, heap[0], heap[len]); + hypre_swap2(heap, I1, 0, len); p = 0; l = 1; + /* while I'm still in the heap */ - while(l < len) + while (l < len) { - r = 2*p+2; + r = 2 * p + 2; + /* two childs, pick the smaller one */ - l = r >= len || hypre_abs(heap[l])>hypre_abs(heap[r]) ? l : r; - if(hypre_abs(heap[l])>hypre_abs(heap[p])) + l = r >= len || heap[l] < heap[r] ? l : r; + if (heap[l] < heap[p]) { - hypre_swap(Ii1,heap[p],heap[l]); - hypre_swap2(I1,heap,l,p); + hypre_swap(Ii1, heap[p], heap[l]); + hypre_swap2(heap, I1, l, p); p = l; - l = 2*p+1; + l = 2 * p + 1; } else { break; } } + return hypre_error_flag; } -/* see hypre_ILUMinHeapRemoveI for detail instructions */ +/*-------------------------------------------------------------------------- + * hypre_ILUMaxrHeapRemoveRabsI + * + * See hypre_ILUMinHeapRemoveI for detail instructions + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_ILUMaxrHeapRemoveRabsI(HYPRE_Real *heap, HYPRE_Int *I1, HYPRE_Int len) { /* parent, left, right */ - HYPRE_Int p,l,r; + HYPRE_Int p, l, r; + len--;/* now len is the max index */ + /* swap the first element to last */ - hypre_swap2(I1,heap,0,-len); + hypre_swap2(I1, heap, 0, -len); p = 0; l = 1; + /* while I'm still in the heap */ - while(l < len) + while (l < len) { - r = 2*p+2; + r = 2 * p + 2; + /* two childs, pick the smaller one */ - l = r >= len || hypre_abs(heap[-l])>hypre_abs(heap[-r]) ? l : r; - if(hypre_abs(heap[-l])>hypre_abs(heap[-p])) + l = r >= len || hypre_abs(heap[-l]) > hypre_abs(heap[-r]) ? l : r; + if (hypre_abs(heap[-l]) > hypre_abs(heap[-p])) { - hypre_swap2(I1,heap,-l,-p); + hypre_swap2(I1, heap, -l, -p); p = l; - l = 2*p+1; + l = 2 * p + 1; } else { @@ -1229,41 +1562,56 @@ hypre_ILUMaxrHeapRemoveRabsI(HYPRE_Real *heap, HYPRE_Int *I1, HYPRE_Int len) return hypre_error_flag; } -/* Split based on quick sort algorithm (avoid sorting the entire array) +/*-------------------------------------------------------------------------- + * hypre_ILUMaxQSplitRabsI + * + * Split based on quick sort algorithm (avoid sorting the entire array) * find the largest k elements out of original array - * array: input array for compare - * I: integer array bind with array + * + * arrayR: input array for compare + * arrayI: integer array bind with array * k: largest k elements * len: length of the array - */ + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUMaxQSplitRabsI(HYPRE_Real *array, HYPRE_Int *I, HYPRE_Int left, HYPRE_Int bound, HYPRE_Int right) +hypre_ILUMaxQSplitRabsI(HYPRE_Real *arrayR, + HYPRE_Int *arrayI, + HYPRE_Int left, + HYPRE_Int bound, + HYPRE_Int right) { HYPRE_Int i, last; + if (left >= right) { return hypre_error_flag; } - hypre_swap2(I,array,left,(left+right)/2); + + hypre_swap2(arrayI, arrayR, left, (left + right) / 2); last = left; - for(i = left + 1 ; i <= right ; i ++) + for (i = left + 1 ; i <= right ; i ++) { - if(hypre_abs(array[i]) > hypre_abs(array[left])) + if (hypre_abs(arrayR[i]) > hypre_abs(arrayR[left])) { - hypre_swap2(I,array,++last,i); + hypre_swap2(arrayI, arrayR, ++last, i); } } - hypre_swap2(I,array,left,last); - hypre_ILUMaxQSplitRabsI(array,I,left,bound,last-1); - if(bound > last) + + hypre_swap2(arrayI, arrayR, left, last); + hypre_ILUMaxQSplitRabsI(arrayR, arrayI, left, bound, last - 1); + if (bound > last) { - hypre_ILUMaxQSplitRabsI(array,I,last+1,bound,right); + hypre_ILUMaxQSplitRabsI(arrayR, arrayI, last + 1, bound, right); } return hypre_error_flag; } -/* Helper function to search max value from a row +/*-------------------------------------------------------------------------- + * hypre_ILUMaxRabs + * + * Helper function to search max value from a row * array: the array we work on * start: the start of the search range * end: the end of the search range @@ -1274,24 +1622,34 @@ hypre_ILUMaxQSplitRabsI(HYPRE_Real *array, HYPRE_Int *I, HYPRE_Int left, HYPRE_I * index: return the index of that value, could be NULL which means not return * l1_norm: return the l1_norm of the array, could be NULL which means no return * nnz: return the number of nonzeros inside this array, could be NULL which means no return - */ + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUMaxRabs(HYPRE_Real *array_data, HYPRE_Int *array_j, HYPRE_Int start, HYPRE_Int end, HYPRE_Int nLU, HYPRE_Int *rperm, HYPRE_Real *value, HYPRE_Int *index, HYPRE_Real *l1_norm, HYPRE_Int *nnz) +hypre_ILUMaxRabs(HYPRE_Real *array_data, + HYPRE_Int *array_j, + HYPRE_Int start, + HYPRE_Int end, + HYPRE_Int nLU, + HYPRE_Int *rperm, + HYPRE_Real *value, + HYPRE_Int *index, + HYPRE_Real *l1_norm, + HYPRE_Int *nnz) { - HYPRE_Int i, idx, col; - HYPRE_Real val, max_value, norm, nz; + HYPRE_Int i, idx, col, nz; + HYPRE_Real val, max_value, norm; nz = 0; norm = 0.0; max_value = -1.0; idx = -1; - if(rperm) + if (rperm) { /* apply rperm and nLU */ - for(i = start ; i < end ; i ++) + for (i = start ; i < end ; i ++) { col = rperm[array_j[i]]; - if(col > nLU) + if (col > nLU) { /* this old column is in new external part */ continue; @@ -1299,7 +1657,7 @@ hypre_ILUMaxRabs(HYPRE_Real *array_data, HYPRE_Int *array_j, HYPRE_Int start, HY nz ++; val = hypre_abs(array_data[i]); norm += val; - if(max_value < val) + if (max_value < val) { max_value = val; idx = i; @@ -1309,11 +1667,11 @@ hypre_ILUMaxRabs(HYPRE_Real *array_data, HYPRE_Int *array_j, HYPRE_Int start, HY else { /* basic search */ - for(i = start ; i < end ; i ++) + for (i = start ; i < end ; i ++) { val = hypre_abs(array_data[i]); norm += val; - if(max_value < val) + if (max_value < val) { max_value = val; idx = i; @@ -1323,15 +1681,15 @@ hypre_ILUMaxRabs(HYPRE_Real *array_data, HYPRE_Int *array_j, HYPRE_Int start, HY } *value = max_value; - if(index) + if (index) { *index = idx; } - if(l1_norm) + if (l1_norm) { *l1_norm = norm; } - if(nnz) + if (nnz) { *nnz = nz; } @@ -1339,7 +1697,10 @@ hypre_ILUMaxRabs(HYPRE_Real *array_data, HYPRE_Int *array_j, HYPRE_Int start, HY return hypre_error_flag; } -/* Pre selection for ddPQ, this is the basic version considering row sparsity +/*-------------------------------------------------------------------------- + * hypre_ILUGetPermddPQPre + * + * Pre selection for ddPQ, this is the basic version considering row sparsity * n: size of matrix * nLU: size we consider ddPQ reorder, only first nLU*nLU block is considered * A_diag_i/j/data: information of A @@ -1348,33 +1709,48 @@ hypre_ILUMaxRabs(HYPRE_Real *array_data, HYPRE_Int *array_j, HYPRE_Int start, HY * *rperm: current column order * *pperm_pre: output ddPQ pre row roder * *qperm_pre: output ddPQ pre column order - */ + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUGetPermddPQPre(HYPRE_Int n, HYPRE_Int nLU, HYPRE_Int *A_diag_i, HYPRE_Int *A_diag_j, HYPRE_Real *A_diag_data, HYPRE_Real tol, HYPRE_Int *perm, HYPRE_Int *rperm, - HYPRE_Int *pperm_pre, HYPRE_Int *qperm_pre, HYPRE_Int *nB) +hypre_ILUGetPermddPQPre(HYPRE_Int n, + HYPRE_Int nLU, + HYPRE_Int *A_diag_i, + HYPRE_Int *A_diag_j, + HYPRE_Real *A_diag_data, + HYPRE_Real tol, + HYPRE_Int *perm, + HYPRE_Int *rperm, + HYPRE_Int *pperm_pre, + HYPRE_Int *qperm_pre, + HYPRE_Int *nB) { + HYPRE_UNUSED_VAR(n); + HYPRE_Int i, ii, nB_pre, k1, k2; HYPRE_Real gtol, max_value, norm; HYPRE_Int *jcol, *jnnz; HYPRE_Real *weight; - weight = hypre_TAlloc(HYPRE_Real, nLU + 1, HYPRE_MEMORY_HOST); - jcol = hypre_TAlloc(HYPRE_Int, nLU + 1, HYPRE_MEMORY_HOST); - jnnz = hypre_TAlloc(HYPRE_Int, nLU + 1, HYPRE_MEMORY_HOST); + weight = hypre_TAlloc(HYPRE_Real, nLU + 1, HYPRE_MEMORY_HOST); + jcol = hypre_TAlloc(HYPRE_Int, nLU + 1, HYPRE_MEMORY_HOST); + jnnz = hypre_TAlloc(HYPRE_Int, nLU + 1, HYPRE_MEMORY_HOST); + + max_value = -1.0; - max_value = -1.0; /* first need to build gtol */ - for( ii = 0 ; ii < nLU ; ii ++) + for (ii = 0; ii < nLU; ii++) { /* find real row */ i = perm[ii]; k1 = A_diag_i[i]; - k2 = A_diag_i[i+1]; + k2 = A_diag_i[i + 1]; + /* find max|a| of that row and its index */ - hypre_ILUMaxRabs(A_diag_data, A_diag_j, k1, k2, nLU, rperm, weight + ii, jcol + ii, &norm, jnnz + ii); + hypre_ILUMaxRabs(A_diag_data, A_diag_j, k1, k2, nLU, rperm, + weight + ii, jcol + ii, &norm, jnnz + ii); weight[ii] /= norm; - if(weight[ii] > max_value) + if (weight[ii] > max_value) { max_value = weight[ii]; } @@ -1384,10 +1760,10 @@ hypre_ILUGetPermddPQPre(HYPRE_Int n, HYPRE_Int nLU, HYPRE_Int *A_diag_i, HYPRE_I /* second loop to pre select B */ nB_pre = 0; - for( ii = 0 ; ii < nLU ; ii ++) + for ( ii = 0 ; ii < nLU ; ii ++) { /* keep this row */ - if(weight[ii] > gtol) + if (weight[ii] > gtol) { weight[nB_pre] /= (HYPRE_Real)(jnnz[ii]); pperm_pre[nB_pre] = perm[ii]; @@ -1398,7 +1774,7 @@ hypre_ILUGetPermddPQPre(HYPRE_Int n, HYPRE_Int nLU, HYPRE_Int *A_diag_i, HYPRE_I *nB = nB_pre; /* sort from small to large */ - hypre_qsort3(weight, pperm_pre, qperm_pre, 0, nB_pre-1); + hypre_qsort3(weight, pperm_pre, qperm_pre, 0, nB_pre - 1); hypre_TFree(weight, HYPRE_MEMORY_HOST); hypre_TFree(jcol, HYPRE_MEMORY_HOST); @@ -1407,47 +1783,60 @@ hypre_ILUGetPermddPQPre(HYPRE_Int n, HYPRE_Int nLU, HYPRE_Int *A_diag_i, HYPRE_I return hypre_error_flag; } -/* Get ddPQ version perm array for ParCSR - * Greedy matching selection - * ddPQ is a two-side permutation for diagonal dominance - * A: the input matrix - * pperm: row permutation - * qperm: col permutation - * nB: the size of B block - * nI: number of interial nodes - * tol: the dropping tolorance for ddPQ - * reordering_type: Type of reordering for the interior nodes. +/*-------------------------------------------------------------------------- + * hypre_ILUGetPermddPQ + * + * Get ddPQ version perm array for ParCSR matrices. ddPQ is a two-side + * permutation for diagonal dominance. Greedy matching selection + * + * Parameters: + * A: the input matrix + * pperm: row permutation (lives at memory_location_A) + * qperm: col permutation (lives at memory_location_A) + * nB: the size of B block + * nI: number of interial nodes + * tol: the dropping tolorance for ddPQ + * reordering_type: Type of reordering for the interior nodes. + * * Currently only supports RCM reordering. Set to 0 for no reordering. - */ + * + * TODO (VPM): Change permutation arrays types to hypre_IntArray + *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_ILUGetPermddPQ(hypre_ParCSRMatrix *A, HYPRE_Int **io_pperm, HYPRE_Int **io_qperm, HYPRE_Real tol, HYPRE_Int *nB, HYPRE_Int *nI, HYPRE_Int reordering_type) +hypre_ILUGetPermddPQ(hypre_ParCSRMatrix *A, + HYPRE_Int **io_pperm, + HYPRE_Int **io_qperm, + HYPRE_Real tol, + HYPRE_Int *nB, + HYPRE_Int *nI, + HYPRE_Int reordering_type) { - HYPRE_Int i, nB_pre, irow, jcol, nLU; - HYPRE_Int *pperm, *qperm; - HYPRE_Int *rpperm, *rqperm, *pperm_pre, *qperm_pre; - /* data objects for A */ - hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); - HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); - HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); - HYPRE_Real *A_diag_data = hypre_CSRMatrixData(A_diag); - - /* problem size */ - HYPRE_Int n = hypre_CSRMatrixNumRows(A_diag); - - /* 1: Setup and create memory - */ - - pperm = NULL; - qperm = hypre_TAlloc(HYPRE_Int, n, HYPRE_MEMORY_DEVICE); - rpperm = hypre_TAlloc(HYPRE_Int, n, HYPRE_MEMORY_HOST); - rqperm = hypre_TAlloc(HYPRE_Int, n, HYPRE_MEMORY_HOST); + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + HYPRE_Int n = hypre_CSRMatrixNumRows(A_diag); + HYPRE_MemoryLocation memory_location = hypre_CSRMatrixMemoryLocation(A_diag); + + hypre_CSRMatrix *h_A_diag; + HYPRE_Int *A_diag_i; + HYPRE_Int *A_diag_j; + HYPRE_Complex *A_diag_data; + + /* Local variables */ + HYPRE_Int i, nB_pre, irow, jcol, nLU; + HYPRE_Int *pperm, *qperm; + HYPRE_Int *new_pperm, *new_qperm; + HYPRE_Int *rpperm, *rqperm, *pperm_pre, *qperm_pre; + HYPRE_MemoryLocation memory_location_perm; + + /* 1: Setup and create memory */ + pperm = NULL; + qperm = hypre_TAlloc(HYPRE_Int, n, HYPRE_MEMORY_HOST); + rpperm = hypre_TAlloc(HYPRE_Int, n, HYPRE_MEMORY_HOST); + rqperm = hypre_TAlloc(HYPRE_Int, n, HYPRE_MEMORY_HOST); - /* 2: Find interior nodes first - */ - hypre_ILUGetInteriorExteriorPerm( A, &pperm, &nLU, 0); - *nI = nLU; + /* 2: Find interior nodes first */ + hypre_ILUGetInteriorExteriorPerm(A, HYPRE_MEMORY_HOST, &pperm, &nLU, 0); /* 3: Pre selection on interial nodes * this pre selection puts external nodes to the last @@ -1457,7 +1846,7 @@ hypre_ILUGetPermddPQ(hypre_ParCSRMatrix *A, HYPRE_Int **io_pperm, HYPRE_Int **io /* build reverse permutation array * rperm[old] = new */ - for(i = 0 ; i < n ; i ++) + for (i = 0 ; i < n ; i ++) { rpperm[pperm[i]] = i; } @@ -1466,32 +1855,40 @@ hypre_ILUGetPermddPQ(hypre_ParCSRMatrix *A, HYPRE_Int **io_pperm, HYPRE_Int **io pperm_pre = hypre_TAlloc(HYPRE_Int, nLU, HYPRE_MEMORY_HOST); qperm_pre = hypre_TAlloc(HYPRE_Int, nLU, HYPRE_MEMORY_HOST); + /* Set/Move A_diag to host memory */ + h_A_diag = (hypre_GetActualMemLocation(memory_location) == hypre_MEMORY_DEVICE) ? + hypre_CSRMatrixClone_v2(A_diag, 1, HYPRE_MEMORY_HOST) : A_diag; + A_diag_i = hypre_CSRMatrixI(h_A_diag); + A_diag_j = hypre_CSRMatrixJ(h_A_diag); + A_diag_data = hypre_CSRMatrixData(h_A_diag); + /* pre selection */ - hypre_ILUGetPermddPQPre(n, nLU, A_diag_i, A_diag_j, A_diag_data, tol, pperm, rpperm, pperm_pre, qperm_pre, &nB_pre); + hypre_ILUGetPermddPQPre(n, nLU, A_diag_i, A_diag_j, A_diag_data, tol, + pperm, rpperm, pperm_pre, qperm_pre, &nB_pre); /* 4: Build B block * Greedy selection */ /* rperm[old] = new */ - for(i = 0 ; i < nLU ; i ++) + for (i = 0 ; i < nLU ; i ++) { rpperm[pperm[i]] = -1; } - hypre_TMemcpy( rqperm, rpperm, HYPRE_Int, n, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); - hypre_TMemcpy( qperm, pperm, HYPRE_Int, n, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); + hypre_TMemcpy(rqperm, rpperm, HYPRE_Int, n, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + hypre_TMemcpy(qperm, pperm, HYPRE_Int, n, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); /* we sort from small to large, so we need to go from back to start * we only need nB_pre to start the loop, after that we could use it for size of B */ - for(i = nB_pre-1, nB_pre = 0 ; i >=0 ; i --) + for (i = nB_pre - 1, nB_pre = 0 ; i >= 0 ; i --) { irow = pperm_pre[i]; jcol = qperm_pre[i]; /* this col is not yet taken */ - if(rqperm[jcol] < 0) + if (rqperm[jcol] < 0) { rpperm[irow] = nB_pre; rqperm[jcol] = nB_pre; @@ -1505,504 +1902,263 @@ hypre_ILUGetPermddPQ(hypre_ParCSRMatrix *A, HYPRE_Int **io_pperm, HYPRE_Int **io * those still mapped to a new index means not yet covered */ nLU = nB_pre; - for(i = 0 ; i < n ; i ++) + for (i = 0 ; i < n ; i ++) { - if(rpperm[i] < 0) + if (rpperm[i] < 0) { pperm[nB_pre++] = i; } } nB_pre = nLU; - for(i = 0 ; i < n ; i ++) + for (i = 0 ; i < n ; i ++) { - if(rqperm[i] < 0) + if (rqperm[i] < 0) { qperm[nB_pre++] = i; } } - /* Finishing up and free - */ + /* Apply RCM reordering */ + if (reordering_type != 0) + { + hypre_ILULocalRCM(h_A_diag, 0, nLU, &pperm, &qperm, 0); + memory_location_perm = memory_location; + } + else + { + memory_location_perm = HYPRE_MEMORY_HOST; + } - switch(reordering_type) + /* Move to device memory if needed */ + if (memory_location_perm != memory_location) { - case 0: - /* no RCM in this case */ - break; - case 1: - /* RCM */ - hypre_ILULocalRCM( hypre_ParCSRMatrixDiag(A), 0, nLU, &pperm, &qperm, 0); - break; - default: - /* RCM */ - hypre_ILULocalRCM( hypre_ParCSRMatrixDiag(A), 0, nLU, &pperm, &qperm, 0); - break; + new_pperm = hypre_TAlloc(HYPRE_Int, n, memory_location); + new_qperm = hypre_TAlloc(HYPRE_Int, n, memory_location); + + hypre_TMemcpy(new_pperm, pperm, HYPRE_Int, n, + memory_location, memory_location_perm); + hypre_TMemcpy(new_qperm, qperm, HYPRE_Int, n, + memory_location, memory_location_perm); + + hypre_TFree(pperm, memory_location_perm); + hypre_TFree(qperm, memory_location_perm); + + pperm = new_pperm; + qperm = new_qperm; } + /* Output pointers */ + *nI = nLU; *nB = nLU; *io_pperm = pperm; *io_qperm = qperm; - hypre_TFree( rpperm, HYPRE_MEMORY_HOST); - hypre_TFree( rqperm, HYPRE_MEMORY_HOST); - hypre_TFree( pperm_pre, HYPRE_MEMORY_HOST); - hypre_TFree( qperm_pre, HYPRE_MEMORY_HOST); + /* Free memory */ + if (h_A_diag != A_diag) + { + hypre_CSRMatrixDestroy(h_A_diag); + } + hypre_TFree(rpperm, HYPRE_MEMORY_HOST); + hypre_TFree(rqperm, HYPRE_MEMORY_HOST); + hypre_TFree(pperm_pre, HYPRE_MEMORY_HOST); + hypre_TFree(qperm_pre, HYPRE_MEMORY_HOST); + return hypre_error_flag; } -/* +/*-------------------------------------------------------------------------- + * hypre_ILUGetInteriorExteriorPerm + * * Get perm array from parcsr matrix based on diag and offdiag matrix * Just simply loop through the rows of offd of A, check for nonzero rows * Put interior nodes at the beginning - * A: parcsr matrix - * perm: permutation array - * nLU: number of interial nodes - * reordering_type: Type of (additional) reordering for the interior nodes. + * + * Parameters: + * A: parcsr matrix + * perm: permutation array + * nLU: number of interial nodes + * reordering_type: Type of (additional) reordering for the interior nodes. + * * Currently only supports RCM reordering. Set to 0 for no reordering. - */ + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUGetInteriorExteriorPerm(hypre_ParCSRMatrix *A, HYPRE_Int **perm, HYPRE_Int *nLU, HYPRE_Int reordering_type) +hypre_ILUGetInteriorExteriorPerm(hypre_ParCSRMatrix *A, + HYPRE_MemoryLocation memory_location, + HYPRE_Int **perm, + HYPRE_Int *nLU, + HYPRE_Int reordering_type) { /* get basic information of A */ - HYPRE_Int n = hypre_ParCSRMatrixNumRows(A); - HYPRE_Int i, j, first, last, start, end; - HYPRE_Int num_sends, send_map_start, send_map_end, col; - hypre_CSRMatrix *A_offd; - HYPRE_Int *A_offd_i; - A_offd = hypre_ParCSRMatrixOffd(A); - A_offd_i = hypre_CSRMatrixI(A_offd); - first = 0; - last = n - 1; - HYPRE_Int *temp_perm = hypre_TAlloc(HYPRE_Int, n, HYPRE_MEMORY_DEVICE); - HYPRE_Int *marker = hypre_CTAlloc(HYPRE_Int, n, HYPRE_MEMORY_HOST); - - /* first get col nonzero from com_pkg */ - /* get comm_pkg, craete one if we not yet have one */ - hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); + HYPRE_Int n = hypre_ParCSRMatrixNumRows(A); + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); + hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); + HYPRE_MemoryLocation A_memory_location = hypre_ParCSRMatrixMemoryLocation(A); + + HYPRE_Int *A_offd_i; + HYPRE_Int i, j, first, last, start, end; + HYPRE_Int num_sends, send_map_start, send_map_end, col; + + /* Local arrays */ + HYPRE_Int *tperm = hypre_TAlloc(HYPRE_Int, n, memory_location); + HYPRE_Int *h_tperm = hypre_CTAlloc(HYPRE_Int, n, HYPRE_MEMORY_HOST); + HYPRE_Int *marker = hypre_CTAlloc(HYPRE_Int, n, HYPRE_MEMORY_HOST); + + /* Get comm_pkg, create one if not present */ if (!comm_pkg) { hypre_MatvecCommPkgCreate(A); comm_pkg = hypre_ParCSRMatrixCommPkg(A); } - /* now directly take adavantage of comm_pkg */ + /* Set A_offd_i on the host */ + if (hypre_GetActualMemLocation(A_memory_location) == hypre_MEMORY_DEVICE) + { + /* Move A_offd_i to host */ + A_offd_i = hypre_CTAlloc(HYPRE_Int, n + 1, HYPRE_MEMORY_HOST); + hypre_TMemcpy(A_offd_i, hypre_CSRMatrixI(A_offd), HYPRE_Int, n + 1, + HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); + } + else + { + A_offd_i = hypre_CSRMatrixI(A_offd); + } + + /* Set initial interior/exterior pointers */ + first = 0; + last = n - 1; + + /* now directly take advantage of comm_pkg */ num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - for( i = 0 ; i < num_sends ; i ++ ) + for (i = 0; i < num_sends; i++) { - send_map_start = hypre_ParCSRCommPkgSendMapStart(comm_pkg,i); - send_map_end = hypre_ParCSRCommPkgSendMapStart(comm_pkg,i+1); - for ( j = send_map_start ; j < send_map_end ; j ++) + send_map_start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); + send_map_end = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); + for (j = send_map_start; j < send_map_end; j++) { col = hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j); - if(marker[col] == 0) + if (marker[col] == 0) { - temp_perm[last--] = col; + h_tperm[last--] = col; marker[col] = -1; } } } /* now deal with the row */ - for( i = 0 ; i < n ; i ++) + for (i = 0; i < n; i++) { - if(marker[i] == 0) + if (marker[i] == 0) { start = A_offd_i[i]; - end = A_offd_i[i+1]; - if(start == end) + end = A_offd_i[i + 1]; + if (start == end) { - temp_perm[first++] = i; + h_tperm[first++] = i; } else { - temp_perm[last--] = i; + h_tperm[last--] = i; } } } - switch(reordering_type) - { - case 0: - /* no RCM in this case */ - break; - case 1: - /* RCM */ - hypre_ILULocalRCM( hypre_ParCSRMatrixDiag(A), 0, first, &temp_perm, &temp_perm, 1); - break; - default: - /* RCM */ - hypre_ILULocalRCM( hypre_ParCSRMatrixDiag(A), 0, first, &temp_perm, &temp_perm, 1); - break; - } - /* set out values */ - *nLU = first; - if((*perm) != NULL) hypre_TFree(*perm,HYPRE_MEMORY_DEVICE); - *perm = temp_perm; - - hypre_TFree(marker, HYPRE_MEMORY_HOST); - return hypre_error_flag; -} + if (reordering_type != 0) + { + /* Apply RCM. Note: h_tperm lives at A_memory_location at output */ + hypre_ILULocalRCM(A_diag, 0, first, &h_tperm, &h_tperm, 1); -/* - * Get the (local) ordering of the diag (local) matrix (no permutation). This is the permutation used for the block-jacobi case - * A: parcsr matrix - * perm: permutation array - * nLU: number of interior nodes - * reordering_type: Type of (additional) reordering for the nodes. - * Currently only supports RCM reordering. Set to 0 for no reordering. - */ -HYPRE_Int -hypre_ILUGetLocalPerm(hypre_ParCSRMatrix *A, HYPRE_Int **perm, HYPRE_Int *nLU, HYPRE_Int reordering_type) -{ - /* get basic information of A */ - HYPRE_Int n = hypre_ParCSRMatrixNumRows(A); - HYPRE_Int i; - HYPRE_Int *temp_perm = hypre_TAlloc(HYPRE_Int, n, HYPRE_MEMORY_DEVICE); + /* Move permutation vector to final memory location */ + hypre_TMemcpy(tperm, h_tperm, HYPRE_Int, n, memory_location, A_memory_location); - /* set perm array */ - for( i = 0 ; i < n ; i ++ ) - { - temp_perm[i] = i; + /* Free memory */ + hypre_TFree(h_tperm, A_memory_location); } - switch(reordering_type) + else { - case 0: - /* no RCM in this case */ - break; - case 1: - /* RCM */ - hypre_ILULocalRCM( hypre_ParCSRMatrixDiag(A), 0, n, &temp_perm, &temp_perm, 1); - break; - default: - /* RCM */ - hypre_ILULocalRCM( hypre_ParCSRMatrixDiag(A), 0, n, &temp_perm, &temp_perm, 1); - break; - } - *nLU = n; - if((*perm) != NULL) hypre_TFree(*perm,HYPRE_MEMORY_DEVICE); - *perm = temp_perm; - - return hypre_error_flag; -} - -#if 0 -/* Build the expanded matrix for RAS-1 - * A: input ParCSR matrix - * E_i, E_j, E_data: information for external matrix - * rperm: reverse permutation to build real index, rperm[old] = new - * - * NOTE: Modified to avoid communicating BigInt arrays - DOK - */ -HYPRE_Int -hypre_ILUBuildRASExternalMatrix(hypre_ParCSRMatrix *A, HYPRE_Int *rperm, HYPRE_Int **E_i, HYPRE_Int **E_j, HYPRE_Real **E_data) -{ - HYPRE_Int i, i1, i2, j, jj, k, row, k1, k2, k3, lend, leno, col, l1, l2; - HYPRE_BigInt big_col; - - /* data objects for communication */ - MPI_Comm comm = hypre_ParCSRMatrixComm(A); - hypre_ParCSRCommPkg *comm_pkg; - hypre_ParCSRCommPkg *comm_pkg_tmp; - hypre_ParCSRCommHandle *comm_handle_count; - hypre_ParCSRCommHandle *comm_handle_marker; - hypre_ParCSRCommHandle *comm_handle_j; - hypre_ParCSRCommHandle *comm_handle_data; - HYPRE_BigInt *col_starts; - HYPRE_Int total_rows; - HYPRE_Int num_sends; - HYPRE_Int num_recvs; - HYPRE_Int begin, end; - HYPRE_Int my_id,num_procs,proc_id; - - /* data objects for buffers in communication */ - HYPRE_Int *send_map; - HYPRE_Int *send_count = NULL,*send_disp = NULL; - HYPRE_Int *send_count_offd = NULL; - HYPRE_Int *recv_count = NULL,*recv_disp = NULL,*recv_marker = NULL; - HYPRE_Int *send_buf_int = NULL; - HYPRE_Int *recv_buf_int = NULL; - HYPRE_Real *send_buf_real = NULL, *recv_buf_real = NULL; - HYPRE_Int *send_disp_comm = NULL, *recv_disp_comm = NULL; - - /* data objects for A */ - hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); - hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); - HYPRE_BigInt *A_col_starts = hypre_ParCSRMatrixColStarts(A); - HYPRE_BigInt *A_offd_colmap = hypre_ParCSRMatrixColMapOffd(A); - HYPRE_Real *A_diag_data = hypre_CSRMatrixData(A_diag); - HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); - HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); - HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); - HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); - HYPRE_Real *A_offd_data = hypre_CSRMatrixData(A_offd); - - /* size */ - HYPRE_Int n = hypre_CSRMatrixNumCols(A_diag); - HYPRE_Int m = hypre_CSRMatrixNumCols(A_offd); - - /* 1: setup part - * allocate memory and setup working array - */ + /* Move permutation vector to final memory location */ + hypre_TMemcpy(tperm, h_tperm, HYPRE_Int, n, memory_location, HYPRE_MEMORY_HOST); - /* MPI stuff */ - hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_rank(comm, &my_id); - - /* now check communication package */ - comm_pkg = hypre_ParCSRMatrixCommPkg(A); - /* create if not yet built */ - if(!comm_pkg) - { - hypre_MatvecCommPkgCreate(A); - comm_pkg = hypre_ParCSRMatrixCommPkg(A); + /* Free memory */ + hypre_TFree(h_tperm, HYPRE_MEMORY_HOST); } - /* get communication information */ - send_map = hypre_ParCSRCommPkgSendMapElmts(comm_pkg); - num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - send_disp_comm = hypre_TAlloc(HYPRE_Int, num_sends + 1, HYPRE_MEMORY_HOST); - begin = hypre_ParCSRCommPkgSendMapStart(comm_pkg,0); - end = hypre_ParCSRCommPkgSendMapStart(comm_pkg,num_sends); - total_rows = end - begin; - num_recvs = hypre_ParCSRCommPkgNumRecvs(comm_pkg); - recv_disp_comm = hypre_TAlloc(HYPRE_Int, num_recvs + 1, HYPRE_MEMORY_HOST); - - /* create buffers */ - send_count = hypre_TAlloc(HYPRE_Int, total_rows, HYPRE_MEMORY_HOST); - send_disp = hypre_TAlloc(HYPRE_Int, total_rows + 1, HYPRE_MEMORY_HOST); - send_count_offd = hypre_CTAlloc(HYPRE_Int, total_rows, HYPRE_MEMORY_HOST); - recv_count = hypre_TAlloc(HYPRE_Int, m, HYPRE_MEMORY_HOST); - recv_marker = hypre_TAlloc(HYPRE_Int, m, HYPRE_MEMORY_HOST); - recv_disp = hypre_TAlloc(HYPRE_Int, m + 1, HYPRE_MEMORY_HOST); - - /* 2: communication part 1 to get amount of send and recv */ - - /* first we need to know the global start */ - col_starts = hypre_TAlloc(HYPRE_BigInt, num_procs + 1, HYPRE_MEMORY_HOST); - hypre_MPI_Allgather(A_col_starts+1,1,HYPRE_MPI_BIG_INT,col_starts+1,1,HYPRE_MPI_BIG_INT,comm); - col_starts[0] = 0; - - send_disp[0] = 0; - send_disp_comm[0] = 0; - /* now loop to know how many to send per row */ - for( i = 0 ; i < num_sends ; i ++ ) + /* Free memory */ + hypre_TFree(marker, HYPRE_MEMORY_HOST); + if (A_offd_i != hypre_CSRMatrixI(A_offd)) { - /* update disp for comm package */ - send_disp_comm[i+1] = send_disp_comm[i]; - /* get the proc we are sending to */ - proc_id = hypre_ParCSRCommPkgSendProc(comm_pkg,i); - /* set start end of this proc */ - l1 = hypre_ParCSRCommPkgSendMapStart(comm_pkg,i); - l2 = hypre_ParCSRCommPkgSendMapStart(comm_pkg,i + 1); - /* loop through rows we need to send */ - for( j = l1 ; j < l2 ; j ++ ) - { - /* reset length */ - leno = lend = 0; - /* we need to send out this row */ - row = hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j); - - /* check how many we need to send from diagonal first */ - k1 = A_diag_i[row], k2 = A_diag_i[row+1]; - for( k = k1 ; k < k2 ; k ++ ) - { - col = A_diag_j[k]; - if(hypre_BinarySearch(send_map+l1,col,l2-l1) >=0 ) - { - lend++; - } - } - - /* check how many we need to send from offdiagonal */ - k1 = A_offd_i[row], k2 = A_offd_i[row+1]; - for( k = k1 ; k < k2 ; k ++ ) - { - /* get real column number of this offdiagonal column */ - big_col = A_offd_colmap[A_offd_j[k]]; - if(big_col >= col_starts[proc_id] && big_col < col_starts[proc_id+1]) - { - /* this column is in diagonal range of proc_id - * everything in diagonal range need to be in the factorization - */ - leno++; - } - } - send_count_offd[j] = leno; - send_count[j] = leno + lend; - send_disp[j+1] = send_disp[j] + send_count[j]; - send_disp_comm[i+1] += send_count[j]; - } + hypre_TFree(A_offd_i, HYPRE_MEMORY_HOST); } - /* 3: new communication to know how many we need to receive for each external row - * main communication, 11 is integer - */ - comm_handle_count = hypre_ParCSRCommHandleCreate(11, comm_pkg, send_count, recv_count); - comm_handle_marker = hypre_ParCSRCommHandleCreate(11, comm_pkg, send_count_offd, recv_marker); - hypre_ParCSRCommHandleDestroy(comm_handle_count); - hypre_ParCSRCommHandleDestroy(comm_handle_marker); - - recv_disp[0] = 0; - recv_disp_comm[0] = 0; - /* now build the recv disp array */ - for(i = 0 ; i < num_recvs ; i ++) + /* Set output values */ + if ((*perm) != NULL) { - recv_disp_comm[i+1] = recv_disp_comm[i]; - k1 = hypre_ParCSRCommPkgRecvVecStart( comm_pkg, i ); - k2 = hypre_ParCSRCommPkgRecvVecStart( comm_pkg, i + 1 ); - for(j = k1 ; j < k2 ; j ++) - { - recv_disp[j+1] = recv_disp[j] + recv_count[j]; - recv_disp_comm[i+1] += recv_count[j]; - } + hypre_TFree(*perm, memory_location); } + *perm = tperm; + *nLU = first; - /* 4: ready to start real communication - * now we know how many we need to send out, create send/recv buffers - */ - send_buf_int = hypre_TAlloc(HYPRE_Int, send_disp[total_rows], HYPRE_MEMORY_HOST); - send_buf_real = hypre_TAlloc(HYPRE_Real, send_disp[total_rows], HYPRE_MEMORY_HOST); - recv_buf_int = hypre_TAlloc(HYPRE_Int, recv_disp[m], HYPRE_MEMORY_HOST); - recv_buf_real = hypre_TAlloc(HYPRE_Real, recv_disp[m], HYPRE_MEMORY_HOST); + return hypre_error_flag; +} - /* fill send buffer */ - for( i = 0 ; i < num_sends ; i ++ ) - { - /* get the proc we are sending to */ - proc_id = hypre_ParCSRCommPkgSendProc(comm_pkg,i); - /* set start end of this proc */ - l1 = hypre_ParCSRCommPkgSendMapStart(comm_pkg,i); - l2 = hypre_ParCSRCommPkgSendMapStart(comm_pkg,i + 1); - /* loop through rows we need to apply communication */ - for( j = l1 ; j < l2 ; j ++ ) - { - /* reset length - * one remark here, the diagonal we send becomes - * off diagonal part for reciver - */ - leno = send_disp[j]; - lend = leno + send_count_offd[j]; - /* we need to send out this row */ - row = hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j); - - /* fill diagonal first */ - k1 = A_diag_i[row], k2 = A_diag_i[row+1]; - for( k = k1 ; k < k2 ; k ++ ) - { - col = A_diag_j[k]; - if(hypre_BinarySearch(send_map+l1,col,l2-l1) >=0) - { - send_buf_real[lend] = A_diag_data[k]; - /* the diag part becomes offd for recv part, so update index - * set up to global index - * set it to be negative - */ - send_buf_int[lend++] = col;// + col_starts[my_id]; - } - } +/*-------------------------------------------------------------------------- + * hypre_ILUGetLocalPerm + * + * Get the (local) ordering of the diag (local) matrix (no permutation). + * This is the permutation used for the block-jacobi case. + * + * Parameters: + * A: parcsr matrix + * perm: permutation array + * nLU: number of interior nodes + * reordering_type: Type of (additional) reordering for the nodes. + * + * Currently only supports RCM reordering. Set to 0 for no reordering. + *--------------------------------------------------------------------------*/ - /* fill offdiagonal */ - k1 = A_offd_i[row], k2 = A_offd_i[row+1]; - for( k = k1 ; k < k2 ; k ++ ) - { - /* get real column number of this offdiagonal column */ - big_col = A_offd_colmap[A_offd_j[k]]; - if(big_col >= col_starts[proc_id] && big_col < col_starts[proc_id+1]) - { - /* this column is in diagonal range of proc_id - * everything in diagonal range need to be in the factorization - */ - send_buf_real[leno] = A_offd_data[k]; - /* the offd part becomes diagonal for recv part, so update index */ - send_buf_int[leno++] = (HYPRE_Int)(big_col - col_starts[proc_id]); - } - } - } - } +HYPRE_Int +hypre_ILUGetLocalPerm(hypre_ParCSRMatrix *A, + HYPRE_Int **perm_ptr, + HYPRE_Int *nLU, + HYPRE_Int reordering_type) +{ + /* get basic information of A */ + HYPRE_Int num_rows = hypre_ParCSRMatrixNumRows(A); + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); - /* now build new comm_pkg for this communication */ - comm_pkg_tmp = hypre_CTAlloc(hypre_ParCSRCommPkg, 1, HYPRE_MEMORY_HOST); - hypre_ParCSRCommPkgComm (comm_pkg_tmp) = comm; - hypre_ParCSRCommPkgNumSends (comm_pkg_tmp) = num_sends; - hypre_ParCSRCommPkgSendProcs (comm_pkg_tmp) = hypre_ParCSRCommPkgSendProcs(comm_pkg); - hypre_ParCSRCommPkgSendMapStarts(comm_pkg_tmp) = send_disp_comm; - hypre_ParCSRCommPkgNumRecvs (comm_pkg_tmp) = num_recvs; - hypre_ParCSRCommPkgRecvProcs (comm_pkg_tmp) = hypre_ParCSRCommPkgRecvProcs(comm_pkg); - hypre_ParCSRCommPkgRecvVecStarts(comm_pkg_tmp) = recv_disp_comm; - - /* communication */ - comm_handle_j = hypre_ParCSRCommHandleCreate(11, comm_pkg_tmp, send_buf_int, recv_buf_int); - comm_handle_data = hypre_ParCSRCommHandleCreate(1, comm_pkg_tmp, send_buf_real, recv_buf_real); - hypre_ParCSRCommHandleDestroy(comm_handle_j); - hypre_ParCSRCommHandleDestroy(comm_handle_data); - - /* Update the index to be real index */ - /* Dealing with diagonal part */ - for(i = 0 ; i < m ; i++ ) - { - k1 = recv_disp[i]; - k2 = recv_disp[i] + recv_marker[i]; - k3 = recv_disp[i+1]; - for(j = k1 ; j < k2 ; j ++ ) - { - recv_buf_int[j] = rperm[recv_buf_int[j]]; - } - } + /* Local variables */ + HYPRE_Int *perm = NULL; - /* Dealing with off-diagonal part */ - for(i = 0 ; i < num_recvs ; i ++) + /* Compute local RCM ordering on the host */ + if (reordering_type != 0) { - proc_id = hypre_ParCSRCommPkgRecvProc( comm_pkg_tmp, i); - i1 = hypre_ParCSRCommPkgRecvVecStart( comm_pkg_tmp, i ); - i2 = hypre_ParCSRCommPkgRecvVecStart( comm_pkg_tmp, i + 1 ); - for(j = i1 ; j < i2 ; j++) - { - k1 = recv_disp[j] + recv_marker[j]; - k2 = recv_disp[j+1]; - - for(jj = k1 ; jj < k2 ; jj++) - { - /* Correct index to get actual global index */ - big_col = recv_buf_int[jj] + col_starts[proc_id]; - recv_buf_int[jj] = hypre_BigBinarySearch( A_offd_colmap, big_col, m) + n; - } - } + hypre_ILULocalRCM(A_diag, 0, num_rows, &perm, &perm, 1); } - /* Assign data */ - *E_i = recv_disp; - *E_j = recv_buf_int; - *E_data = recv_buf_real; - - /* 5: finish and free - */ - - hypre_TFree(send_disp_comm, HYPRE_MEMORY_HOST); - hypre_TFree(recv_disp_comm, HYPRE_MEMORY_HOST); - hypre_TFree(comm_pkg_tmp, HYPRE_MEMORY_HOST); - hypre_TFree(col_starts, HYPRE_MEMORY_HOST); - hypre_TFree(send_count, HYPRE_MEMORY_HOST); - hypre_TFree(send_disp, HYPRE_MEMORY_HOST); - hypre_TFree(send_count_offd, HYPRE_MEMORY_HOST); - hypre_TFree(recv_count, HYPRE_MEMORY_HOST); - hypre_TFree(send_buf_int, HYPRE_MEMORY_HOST); - hypre_TFree(send_buf_real, HYPRE_MEMORY_HOST); - hypre_TFree(recv_marker, HYPRE_MEMORY_HOST); + /* Set output pointers */ + *nLU = num_rows; + *perm_ptr = perm; return hypre_error_flag; } -#else -/* Build the expanded matrix for RAS-1 + +/*-------------------------------------------------------------------------- + * hypre_ILUBuildRASExternalMatrix + * + * Build the expanded matrix for RAS-1 * A: input ParCSR matrix * E_i, E_j, E_data: information for external matrix * rperm: reverse permutation to build real index, rperm[old] = new - */ + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUBuildRASExternalMatrix(hypre_ParCSRMatrix *A, HYPRE_Int *rperm, HYPRE_Int **E_i, HYPRE_Int **E_j, HYPRE_Real **E_data) +hypre_ILUBuildRASExternalMatrix(hypre_ParCSRMatrix *A, + HYPRE_Int *rperm, + HYPRE_Int **E_i, + HYPRE_Int **E_j, + HYPRE_Real **E_data) { - HYPRE_Int i, j, idx; - HYPRE_BigInt big_col; - /* data objects for communication */ MPI_Comm comm = hypre_ParCSRMatrixComm(A); HYPRE_Int my_id; @@ -2010,8 +2166,8 @@ hypre_ILUBuildRASExternalMatrix(hypre_ParCSRMatrix *A, HYPRE_Int *rperm, HYPRE_I /* data objects for A */ hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); - HYPRE_BigInt *A_col_starts = hypre_ParCSRMatrixColStarts(A); - HYPRE_BigInt *A_offd_colmap = hypre_ParCSRMatrixColMapOffd(A); + HYPRE_BigInt *A_col_starts = hypre_ParCSRMatrixColStarts(A); + HYPRE_BigInt *A_offd_colmap = hypre_ParCSRMatrixColMapOffd(A); HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); @@ -2021,24 +2177,27 @@ hypre_ILUBuildRASExternalMatrix(hypre_ParCSRMatrix *A, HYPRE_Int *rperm, HYPRE_I // # up to local offd cols, no need to be HYPRE_BigInt HYPRE_Int *A_ext_i = NULL; // Return global index, HYPRE_BigInt required - HYPRE_BigInt *A_ext_j = NULL; + HYPRE_BigInt *A_ext_j = NULL; HYPRE_Real *A_ext_data = NULL; /* data objects for output */ - HYPRE_Int E_nnz; + HYPRE_Int E_nnz; HYPRE_Int *E_ext_i = NULL; // Local index, no need to use HYPRE_BigInt HYPRE_Int *E_ext_j = NULL; HYPRE_Real *E_ext_data = NULL; //guess non-zeros for E before start - HYPRE_Int E_init_alloc; + HYPRE_Int E_init_alloc; /* size */ - HYPRE_Int n = hypre_CSRMatrixNumCols(A_diag); - HYPRE_Int m = hypre_CSRMatrixNumCols(A_offd); - HYPRE_Int A_diag_nnz = A_diag_i[n]; - HYPRE_Int A_offd_nnz = A_offd_i[n]; + HYPRE_Int n = hypre_CSRMatrixNumCols(A_diag); + HYPRE_Int m = hypre_CSRMatrixNumCols(A_offd); + HYPRE_Int A_diag_nnz = A_diag_i[n]; + HYPRE_Int A_offd_nnz = A_offd_i[n]; + + HYPRE_Int i, j, idx; + HYPRE_BigInt big_col; /* 1: Set up phase and get external rows * Use the HYPRE build-in function @@ -2064,12 +2223,13 @@ hypre_ILUBuildRASExternalMatrix(hypre_ParCSRMatrix *A, HYPRE_Int *rperm, HYPRE_I A_ext_data = hypre_CSRMatrixData(A_ext); /* guess memory we need to allocate to E_j */ - E_init_alloc = hypre_max( (HYPRE_Int) ( A_diag_nnz / (HYPRE_Real) n / (HYPRE_Real) n * (HYPRE_Real) m * (HYPRE_Real) m + A_offd_nnz), 1); + E_init_alloc = hypre_max( (HYPRE_Int) ( A_diag_nnz / (HYPRE_Real) n / (HYPRE_Real) n * + (HYPRE_Real) m * (HYPRE_Real) m + A_offd_nnz), 1); /* Initial guess */ - E_ext_i = hypre_TAlloc(HYPRE_Int, m + 1 , HYPRE_MEMORY_HOST); - E_ext_j = hypre_TAlloc(HYPRE_Int, E_init_alloc , HYPRE_MEMORY_HOST); - E_ext_data = hypre_TAlloc(HYPRE_Real, E_init_alloc , HYPRE_MEMORY_HOST); + E_ext_i = hypre_TAlloc(HYPRE_Int, m + 1, HYPRE_MEMORY_HOST); + E_ext_j = hypre_TAlloc(HYPRE_Int, E_init_alloc, HYPRE_MEMORY_HOST); + E_ext_data = hypre_TAlloc(HYPRE_Real, E_init_alloc, HYPRE_MEMORY_HOST); /* 2: Discard unecessary cols * Search A_ext_j, discard those cols not belong to current proc @@ -2079,14 +2239,14 @@ hypre_ILUBuildRASExternalMatrix(hypre_ParCSRMatrix *A, HYPRE_Int *rperm, HYPRE_I E_nnz = 0; E_ext_i[0] = 0; - for( i = 0 ; i < m ; i ++) + for ( i = 0 ; i < m ; i ++) { E_ext_i[i] = E_nnz; - for( j = A_ext_i[i] ; j < A_ext_i[i+1] ; j ++) + for ( j = A_ext_i[i] ; j < A_ext_i[i + 1] ; j ++) { big_col = A_ext_j[j]; /* First check if that belongs to the diagonal part */ - if( big_col >= A_col_starts[0] && big_col < A_col_starts[1] ) + if ( big_col >= A_col_starts[0] && big_col < A_col_starts[1] ) { /* this is a diagonal entry, rperm (map old to new) and shift it */ @@ -2101,7 +2261,7 @@ hypre_ILUBuildRASExternalMatrix(hypre_ParCSRMatrix *A, HYPRE_Int *rperm, HYPRE_I { /* Search, result is not HYPRE_BigInt */ E_ext_j[E_nnz] = hypre_BigBinarySearch( A_offd_colmap, big_col, m); - if( E_ext_j[E_nnz] >= 0) + if ( E_ext_j[E_nnz] >= 0) { /* this is an offdiagonal entry */ E_ext_j[E_nnz] = E_ext_j[E_nnz] + n; @@ -2114,13 +2274,15 @@ hypre_ILUBuildRASExternalMatrix(hypre_ParCSRMatrix *A, HYPRE_Int *rperm, HYPRE_I } } /* capacity check, allocate new memory when full */ - if(E_nnz >= E_init_alloc) + if (E_nnz >= E_init_alloc) { HYPRE_Int tmp; tmp = E_init_alloc; - E_init_alloc = E_init_alloc * EXPAND_FACT + 1; - E_ext_j = hypre_TReAlloc_v2(E_ext_j, HYPRE_Int, tmp, HYPRE_Int, E_init_alloc, HYPRE_MEMORY_HOST); - E_ext_data = hypre_TReAlloc_v2(E_ext_data, HYPRE_Real, tmp, HYPRE_Real, E_init_alloc, HYPRE_MEMORY_HOST); + E_init_alloc = (HYPRE_Int)(E_init_alloc * EXPAND_FACT + 1); + E_ext_j = hypre_TReAlloc_v2(E_ext_j, HYPRE_Int, tmp, HYPRE_Int, + E_init_alloc, HYPRE_MEMORY_HOST); + E_ext_data = hypre_TReAlloc_v2(E_ext_data, HYPRE_Real, tmp, HYPRE_Real, + E_init_alloc, HYPRE_MEMORY_HOST); } } } @@ -2137,53 +2299,127 @@ hypre_ILUBuildRASExternalMatrix(hypre_ParCSRMatrix *A, HYPRE_Int *rperm, HYPRE_I hypre_CSRMatrixDestroy(A_ext); return hypre_error_flag; - } -#endif -/* This function sort offdiagonal map as well as J array for offdiagonal part - * A: The input CSR matrix - */ +/*-------------------------------------------------------------------------- + * hypre_ILUSortOffdColmap + * + * This function sort offdiagonal map as well as J array for offdiagonal part + * A: The input CSR matrix. + * + * TODO (VPM): This work should be done via hypre_ParCSRMatrixPermute. This + * function needs to be implemented. + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_ILUSortOffdColmap(hypre_ParCSRMatrix *A) { - HYPRE_Int i; - hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); - HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); - HYPRE_BigInt *A_offd_colmap = hypre_ParCSRMatrixColMapOffd(A); - HYPRE_Int len = hypre_CSRMatrixNumCols(A_offd); - HYPRE_Int nnz = hypre_CSRMatrixNumNonzeros(A_offd); - HYPRE_Int *perm = hypre_TAlloc(HYPRE_Int,len,HYPRE_MEMORY_HOST); - HYPRE_Int *rperm = hypre_TAlloc(HYPRE_Int,len,HYPRE_MEMORY_HOST); - - for(i = 0 ; i < len ; i ++) + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); + HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); + HYPRE_Int A_offd_nnz = hypre_CSRMatrixNumNonzeros(A_offd); + HYPRE_Int A_offd_num_cols = hypre_CSRMatrixNumCols(A_offd); + HYPRE_MemoryLocation memory_location = hypre_CSRMatrixMemoryLocation(A_offd); + HYPRE_BigInt *col_map_offd = hypre_ParCSRMatrixColMapOffd(A); + + HYPRE_Int *h_A_offd_j; + + HYPRE_Int *perm = hypre_TAlloc(HYPRE_Int, A_offd_num_cols, HYPRE_MEMORY_HOST); + HYPRE_Int *rperm = hypre_TAlloc(HYPRE_Int, A_offd_num_cols, HYPRE_MEMORY_HOST); + HYPRE_Int i; + + /* Set/Move A_offd_j on the host */ + if (hypre_GetActualMemLocation(memory_location) == hypre_MEMORY_DEVICE) + { + h_A_offd_j = hypre_TAlloc(HYPRE_Int, A_offd_nnz, HYPRE_MEMORY_HOST); + hypre_TMemcpy(h_A_offd_j, A_offd_j, HYPRE_Int, A_offd_nnz, + HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); + } + else + { + h_A_offd_j = A_offd_j; + } + + for (i = 0; i < A_offd_num_cols; i++) { perm[i] = i; } - hypre_BigQsort2i(A_offd_colmap,perm,0,len-1); + hypre_BigQsort2i(col_map_offd, perm, 0, A_offd_num_cols - 1); - for(i = 0 ; i < len ; i ++) + for (i = 0; i < A_offd_num_cols; i++) { rperm[perm[i]] = i; } - for(i = 0 ; i < nnz ; i ++) + for (i = 0; i < A_offd_nnz; i++) + { + h_A_offd_j[i] = rperm[h_A_offd_j[i]]; + } + + if (h_A_offd_j != A_offd_j) + { + hypre_TMemcpy(A_offd_j, h_A_offd_j, HYPRE_Int, A_offd_nnz, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); + hypre_TFree(h_A_offd_j, HYPRE_MEMORY_HOST); + } + + /* Free memory */ + hypre_TFree(perm, HYPRE_MEMORY_HOST); + hypre_TFree(rperm, HYPRE_MEMORY_HOST); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_ILULocalRCMBuildFinalPerm + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILULocalRCMBuildFinalPerm(HYPRE_Int start, + HYPRE_Int end, + HYPRE_Int *G_perm, + HYPRE_Int *perm, + HYPRE_Int *qperm, + HYPRE_Int **permp, + HYPRE_Int **qpermp) +{ + /* update to new index */ + HYPRE_Int i = 0; + HYPRE_Int num_nodes = end - start; + HYPRE_Int *perm_temp = hypre_TAlloc(HYPRE_Int, num_nodes, HYPRE_MEMORY_HOST); + + for ( i = 0 ; i < num_nodes ; i ++) + { + perm_temp[i] = perm[i + start]; + } + for ( i = 0 ; i < num_nodes ; i ++) + { + perm[i + start] = perm_temp[G_perm[i]]; + } + if (perm != qperm) { - A_offd_j[i] = rperm[A_offd_j[i]]; + for ( i = 0 ; i < num_nodes ; i ++) + { + perm_temp[i] = qperm[i + start]; + } + for ( i = 0 ; i < num_nodes ; i ++) + { + qperm[i + start] = perm_temp[G_perm[i]]; + } } - hypre_TFree(perm,HYPRE_MEMORY_HOST); - hypre_TFree(rperm,HYPRE_MEMORY_HOST); + *permp = perm; + *qpermp = qperm; + + hypre_TFree(perm_temp, HYPRE_MEMORY_HOST); return hypre_error_flag; } /*-------------------------------------------------------------------------- * hypre_ILULocalRCM - *--------------------------------------------------------------------------*/ - -/* This function computes the RCM ordering of a sub matrix of + * + * This function computes the RCM ordering of a sub matrix of * sparse matrix B = A(perm,perm) * For nonsymmetrix problem, is the RCM ordering of B + B' * A: The input CSR matrix @@ -2192,257 +2428,295 @@ hypre_ILUSortOffdColmap(hypre_ParCSRMatrix *A) * permp: pointer to the row permutation array such that B = A(perm, perm) * point to NULL if you want to work directly on A * on return, permp will point to the new permutation where - * in [start, end) the matrix will reordered + * in [start, end) the matrix will reordered. if *permp is not NULL, + * we assume that it lives on the host memory at input. At output, + * it lives in the same memory location as A. * qpermp: pointer to the col permutation array such that B = A(perm, perm) * point to NULL or equal to permp if you want symmetric order * on return, qpermp will point to the new permutation where - * in [start, end) the matrix will reordered + * in [start, end) the matrix will reordered. if *qpermp is not NULL, + * we assume that it lives on the host memory at input. At output, + * it lives in the same memory location as A. * sym: set to nonzero to work on A only(symmetric), otherwise A + A'. * WARNING: if you use non-symmetric reordering, that is, * different row and col reordering, the resulting A might be non-symmetric. * Be careful if you are using non-symmetric reordering - */ + * + * TODO (VPM): Implement RCM computation on the device. + * Use IntArray for perm. + * Move this function and internal RCM calls to parcsr_mv. + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILULocalRCM( hypre_CSRMatrix *A, HYPRE_Int start, HYPRE_Int end, - HYPRE_Int **permp, HYPRE_Int **qpermp, HYPRE_Int sym) +hypre_ILULocalRCM(hypre_CSRMatrix *A, + HYPRE_Int start, + HYPRE_Int end, + HYPRE_Int **permp, + HYPRE_Int **qpermp, + HYPRE_Int sym) { - HYPRE_Int i, j, row, col, r1, r2; - - HYPRE_Int num_nodes = end - start; - HYPRE_Int n = hypre_CSRMatrixNumRows(A); - HYPRE_Int ncol = hypre_CSRMatrixNumCols(A); - HYPRE_Int *A_i = hypre_CSRMatrixI(A); - HYPRE_Int *A_j = hypre_CSRMatrixJ(A); - hypre_CSRMatrix *GT = NULL; - hypre_CSRMatrix *GGT = NULL; - // HYPRE_Int *AAT_i = NULL; - // HYPRE_Int *AAT_j = NULL; - HYPRE_Int A_nnz = hypre_CSRMatrixNumNonzeros(A); - hypre_CSRMatrix *G = NULL; - HYPRE_Int *G_i = NULL; - HYPRE_Int *G_j = NULL; - HYPRE_Real *G_data = NULL; - HYPRE_Int *G_perm = NULL; - HYPRE_Int G_nnz; - HYPRE_Int G_capacity; - HYPRE_Int *perm_temp = NULL; - HYPRE_Int *perm = *permp; - HYPRE_Int *qperm = *qpermp; - HYPRE_Int *rqperm = NULL; + /* Input variables */ + HYPRE_Int num_nodes = end - start; + HYPRE_Int n = hypre_CSRMatrixNumRows(A); + HYPRE_Int ncol = hypre_CSRMatrixNumCols(A); + HYPRE_MemoryLocation memory_location = hypre_CSRMatrixMemoryLocation(A); + HYPRE_Int A_nnz = hypre_CSRMatrixNumNonzeros(A); + HYPRE_Int *A_i; + HYPRE_Int *A_j; + + /* Local variables */ + hypre_CSRMatrix *GT = NULL; + hypre_CSRMatrix *GGT = NULL; + hypre_CSRMatrix *G = NULL; + HYPRE_Int *G_i = NULL; + HYPRE_Int *G_j = NULL; + HYPRE_Int *G_perm = NULL; + HYPRE_Int *perm_temp = NULL; + HYPRE_Int *rqperm = NULL; + HYPRE_Int *d_perm = NULL; + HYPRE_Int *d_qperm = NULL; + HYPRE_Int *perm = *permp; + HYPRE_Int *qperm = *qpermp; + + HYPRE_Int perm_is_qperm; + HYPRE_Int i, j, row, col, r1, r2; + HYPRE_Int G_nnz, G_capacity; + + /* Set flag for computing row and column permutations (true) or only row permutation (false) */ + perm_is_qperm = (perm == qperm) ? 1 : 0; /* 1: Preprosessing * Check error in input, set some parameters */ - if(num_nodes <= 0) + if (num_nodes <= 0) { /* don't do this if we are too small */ return hypre_error_flag; } - if(n!=ncol || end > n || start < 0) + + if (n != ncol || end > n || start < 0) { /* don't do this if the input has error */ hypre_printf("Error input, abort RCM\n"); return hypre_error_flag; } - if(!perm) + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("ILULocalRCM"); + + /* create permutation array if we don't have one yet */ + if (!perm) { - /* create permutation array if we don't have one yet */ - perm = hypre_TAlloc( HYPRE_Int, n, HYPRE_MEMORY_DEVICE); - for(i = 0 ; i < n ; i ++) + perm = hypre_TAlloc(HYPRE_Int, n, HYPRE_MEMORY_HOST); + for (i = 0; i < n; i++) { perm[i] = i; } } - if(!qperm) + + /* Check for symmetric reordering, then point qperm to row reordering */ + if (!qperm) { - /* symmetric reordering, just point it to row reordering */ qperm = perm; } + + /* Compute reverse qperm ordering */ rqperm = hypre_TAlloc(HYPRE_Int, n, HYPRE_MEMORY_HOST); - for(i = 0 ; i < n ; i ++) + for (i = 0; i < n; i++) { rqperm[qperm[i]] = i; } + + /* Set/Move A_i and A_j to host */ + if (hypre_GetActualMemLocation(memory_location) == hypre_MEMORY_DEVICE) + { + A_i = hypre_TAlloc(HYPRE_Int, n + 1, HYPRE_MEMORY_HOST); + A_j = hypre_TAlloc(HYPRE_Int, A_nnz, HYPRE_MEMORY_HOST); + + hypre_TMemcpy(A_i, hypre_CSRMatrixI(A), HYPRE_Int, n + 1, + HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(A_j, hypre_CSRMatrixJ(A), HYPRE_Int, A_nnz, + HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); + } + else + { + A_i = hypre_CSRMatrixI(A); + A_j = hypre_CSRMatrixJ(A); + } + /* 2: Build Graph * Build Graph for RCM ordering */ - G = hypre_CSRMatrixCreate(num_nodes, num_nodes, 0); - hypre_CSRMatrixInitialize(G); - hypre_CSRMatrixSetDataOwner(G, 1); - G_i = hypre_CSRMatrixI(G); - if(sym) - { - /* Directly use A */ - G_nnz = 0; - G_capacity = hypre_max(A_nnz * n * n / num_nodes / num_nodes - num_nodes, 1); - G_j = hypre_TAlloc(HYPRE_Int, G_capacity, HYPRE_MEMORY_DEVICE); - for(i = 0 ; i < num_nodes ; i ++) + G_nnz = 0; + G_capacity = hypre_max((A_nnz * n * n / num_nodes / num_nodes) - num_nodes, 1); + G_i = hypre_TAlloc(HYPRE_Int, num_nodes + 1, HYPRE_MEMORY_HOST); + G_j = hypre_TAlloc(HYPRE_Int, G_capacity, HYPRE_MEMORY_HOST); + + /* TODO (VPM): Extend hypre_CSRMatrixPermute to replace the block below */ + for (i = 0; i < num_nodes; i++) + { + G_i[i] = G_nnz; + row = perm[i + start]; + r1 = A_i[row]; + r2 = A_i[row + 1]; + for (j = r1; j < r2; j ++) { - G_i[i] = G_nnz; - row = perm[i + start]; - r1 = A_i[row]; - r2 = A_i[row+1]; - for(j = r1 ; j < r2 ; j ++) + col = rqperm[A_j[j]]; + if (col != row && col >= start && col < end) { - col = rqperm[A_j[j]]; - if(col != row && col >= start && col < end) + /* this is an entry in G */ + G_j[G_nnz++] = col - start; + if (G_nnz >= G_capacity) { - /* this is an entry in G */ - G_j[G_nnz++] = col - start; - if(G_nnz >= G_capacity) - { - HYPRE_Int tmp = G_capacity; - G_capacity = G_capacity * EXPAND_FACT + 1; - G_j = hypre_TReAlloc_v2(G_j, HYPRE_Int, tmp, HYPRE_Int, G_capacity, HYPRE_MEMORY_DEVICE); - } + HYPRE_Int tmp = G_capacity; + G_capacity = (HYPRE_Int) (G_capacity * EXPAND_FACT + 1); + G_j = hypre_TReAlloc_v2(G_j, HYPRE_Int, tmp, HYPRE_Int, + G_capacity, HYPRE_MEMORY_HOST); } } } - G_i[num_nodes] = G_nnz; - if(G_nnz == 0) - { - //G has only diagonal, no need to do any kind of RCM - hypre_TFree(G_j, HYPRE_MEMORY_DEVICE); - hypre_TFree(rqperm, HYPRE_MEMORY_HOST); - *permp = perm; - *qpermp = qperm; - hypre_CSRMatrixDestroy(G); - return hypre_error_flag; - } - hypre_CSRMatrixJ(G) = G_j; - hypre_CSRMatrixNumNonzeros(G) = G_nnz; } - else + G_i[num_nodes] = G_nnz; + + /* Free memory */ + if (A_i != hypre_CSRMatrixI(A)) { - /* Use A + A' */ - G_nnz = 0; - G_capacity = hypre_max(A_nnz * n * n / num_nodes / num_nodes - num_nodes, 1); - G_j = hypre_TAlloc(HYPRE_Int, G_capacity, HYPRE_MEMORY_DEVICE); - for(i = 0 ; i < num_nodes ; i ++) - { - G_i[i] = G_nnz; - row = perm[i + start]; - r1 = A_i[row]; - r2 = A_i[row+1]; - for(j = r1 ; j < r2 ; j ++) - { - col = rqperm[A_j[j]]; - if(col != row && col >= start && col < end) - { - /* this is an entry in G */ - G_j[G_nnz++] = col - start; - if(G_nnz >= G_capacity) - { - HYPRE_Int tmp = G_capacity; - G_capacity = G_capacity * EXPAND_FACT + 1; - G_j = hypre_TReAlloc_v2(G_j, HYPRE_Int, tmp, HYPRE_Int, G_capacity, HYPRE_MEMORY_DEVICE); - } - } - } - } - G_i[num_nodes] = G_nnz; - if(G_nnz == 0) + hypre_TFree(A_i, HYPRE_MEMORY_HOST); + } + if (A_j != hypre_CSRMatrixJ(A)) + { + hypre_TFree(A_j, HYPRE_MEMORY_HOST); + } + + /* Create matrix G on the host */ + G = hypre_CSRMatrixCreate(num_nodes, num_nodes, G_nnz); + hypre_CSRMatrixMemoryLocation(G) = HYPRE_MEMORY_HOST; + hypre_CSRMatrixI(G) = G_i; + hypre_CSRMatrixJ(G) = G_j; + + /* Check if G is not empty (no need to do any kind of RCM) */ + if (G_nnz > 0) + { + /* Sum G with G' if G is nonsymmetric */ + if (!sym) { - //G has only diagonal, no need to do any kind of RCM - hypre_TFree(G_j, HYPRE_MEMORY_DEVICE); - hypre_TFree(rqperm, HYPRE_MEMORY_HOST); - *permp = perm; - *qpermp = qperm; + hypre_CSRMatrixData(G) = hypre_CTAlloc(HYPRE_Complex, G_nnz, HYPRE_MEMORY_HOST); + hypre_CSRMatrixTranspose(G, >, 1); + GGT = hypre_CSRMatrixAdd(1.0, G, 1.0, GT); hypre_CSRMatrixDestroy(G); - return hypre_error_flag; + hypre_CSRMatrixDestroy(GT); + G = GGT; + GGT = NULL; } - hypre_CSRMatrixJ(G) = G_j; - G_data = hypre_CTAlloc(HYPRE_Real, G_nnz, HYPRE_MEMORY_DEVICE); - hypre_CSRMatrixData(G) = G_data; - hypre_CSRMatrixNumNonzeros(G) = G_nnz; - - /* now sum G with G' */ - hypre_CSRMatrixTranspose(G, >, 1); - GGT = hypre_CSRMatrixAdd(1.0, G, 1.0, GT); - hypre_CSRMatrixDestroy(G); - hypre_CSRMatrixDestroy(GT); - G = GGT; - GGT = NULL; - } - /* 3: Build Graph - * Build RCM - */ - /* no need to be shared, but perm should be shared */ - G_perm = hypre_TAlloc(HYPRE_Int, num_nodes, HYPRE_MEMORY_HOST); - hypre_ILULocalRCMOrder( G, G_perm); + /* 3: Build RCM on the host */ + G_perm = hypre_TAlloc(HYPRE_Int, num_nodes, HYPRE_MEMORY_HOST); + hypre_ILULocalRCMOrder(G, G_perm); - /* 4: Post processing - * Free, set value, return - */ + /* 4: Post processing + * Free, set value, return + */ - /* update to new index */ - perm_temp = hypre_TAlloc(HYPRE_Int, num_nodes, HYPRE_MEMORY_HOST); - for( i = 0 ; i < num_nodes ; i ++) - { - perm_temp[i] = perm[i + start]; - } - for( i = 0 ; i < num_nodes ; i ++) - { - perm[i+start] = perm_temp[G_perm[i]]; + /* update to new index */ + perm_temp = hypre_TAlloc(HYPRE_Int, num_nodes, HYPRE_MEMORY_HOST); + hypre_TMemcpy(perm_temp, &perm[start], HYPRE_Int, num_nodes, + HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + for (i = 0; i < num_nodes; i++) + { + perm[i + start] = perm_temp[G_perm[i]]; + } + + if (!perm_is_qperm) + { + hypre_TMemcpy(perm_temp, &qperm[start], HYPRE_Int, num_nodes, + HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + for (i = 0; i < num_nodes; i++) + { + qperm[i + start] = perm_temp[G_perm[i]]; + } + } } - if(perm != qperm) + + /* Move to device memory if needed */ + if (memory_location == HYPRE_MEMORY_DEVICE) { - for( i = 0 ; i < num_nodes ; i ++) + d_perm = hypre_TAlloc(HYPRE_Int, n, HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(d_perm, perm, HYPRE_Int, n, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); + hypre_TFree(perm, HYPRE_MEMORY_HOST); + + perm = d_perm; + if (perm_is_qperm) { - perm_temp[i] = qperm[i + start]; + qperm = d_perm; } - for( i = 0 ; i < num_nodes ; i ++) + else { - qperm[i+start] = perm_temp[G_perm[i]]; + d_qperm = hypre_TAlloc(HYPRE_Int, n, HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(d_qperm, qperm, HYPRE_Int, n, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); + hypre_TFree(qperm, HYPRE_MEMORY_HOST); + + qperm = d_qperm; } } - *permp = perm; - *qpermp = qperm; - hypre_CSRMatrixDestroy(G); + /* Set output pointers */ + *permp = perm; + *qpermp = qperm; + + /* Free memory */ + hypre_CSRMatrixDestroy(G); hypre_TFree(G_perm, HYPRE_MEMORY_HOST); hypre_TFree(perm_temp, HYPRE_MEMORY_HOST); hypre_TFree(rqperm, HYPRE_MEMORY_HOST); + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; } /*-------------------------------------------------------------------------- * hypre_ILULocalRCMMindegree + * + * This function finds the unvisited node with the minimum degree *--------------------------------------------------------------------------*/ -/* This function finds the unvisited node with the minimum degree - */ HYPRE_Int -hypre_ILULocalRCMMindegree(HYPRE_Int n, HYPRE_Int *degree, HYPRE_Int *marker, HYPRE_Int *rootp) +hypre_ILULocalRCMMindegree(HYPRE_Int n, + HYPRE_Int *degree, + HYPRE_Int *marker, + HYPRE_Int *rootp) { - HYPRE_Int i; - HYPRE_Int min_degree = n+1; - HYPRE_Int root = 0; - for(i = 0 ; i < n ; i ++) - { - if(marker[i] < 0) - { - if(degree[i] < min_degree) - { - root = i; - min_degree = degree[i]; - } - } - } - *rootp = root; - return 0; + HYPRE_Int i; + HYPRE_Int min_degree = n + 1; + HYPRE_Int root = 0; + + for (i = 0 ; i < n ; i ++) + { + if (marker[i] < 0) + { + if (degree[i] < min_degree) + { + root = i; + min_degree = degree[i]; + } + } + } + *rootp = root; + return 0; } /*-------------------------------------------------------------------------- * hypre_ILULocalRCMOrder - *--------------------------------------------------------------------------*/ - -/* This function actually does the RCM ordering of a symmetric csr matrix (entire) + * + * This function actually does the RCM ordering of a symmetric CSR matrix (entire) * A: the csr matrix, A_data is not needed * perm: the permutation array, space should be allocated outside - */ + * This is pure host code. + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_ILULocalRCMOrder( hypre_CSRMatrix *A, HYPRE_Int *perm) { @@ -2455,15 +2729,15 @@ hypre_ILULocalRCMOrder( hypre_CSRMatrix *A, HYPRE_Int *perm) /* get the degree for each node */ degree = hypre_TAlloc(HYPRE_Int, n, HYPRE_MEMORY_HOST); marker = hypre_TAlloc(HYPRE_Int, n, HYPRE_MEMORY_HOST); - for(i = 0 ; i < n ; i ++) + for (i = 0 ; i < n ; i ++) { - degree[i] = A_i[i+1] - A_i[i]; + degree[i] = A_i[i + 1] - A_i[i]; marker[i] = -1; } /* start RCM loop */ current_num = 0; - while(current_num < n) + while (current_num < n) { hypre_ILULocalRCMMindegree( n, degree, marker, &root); /* This is a new connect component */ @@ -2473,21 +2747,22 @@ hypre_ILULocalRCMOrder( hypre_CSRMatrix *A, HYPRE_Int *perm) hypre_ILULocalRCMNumbering(A, root, marker, perm, ¤t_num); } - /* free */ + /* Free */ hypre_TFree(degree, HYPRE_MEMORY_HOST); hypre_TFree(marker, HYPRE_MEMORY_HOST); + return hypre_error_flag; } /*-------------------------------------------------------------------------- * hypre_ILULocalRCMFindPPNode + * + * This function find a pseudo-peripheral node start from root + * A: the csr matrix, A_data is not needed + * rootp: pointer to the root, on return will be a end of the pseudo-peripheral + * marker: the marker array for unvisited node *--------------------------------------------------------------------------*/ -/* This function find a pseudo-peripheral node start from root - * A: the csr matrix, A_data is not needed - * rootp: pointer to the root, on return will be a end of the pseudo-peripheral - * marker: the marker array for unvisited node - */ HYPRE_Int hypre_ILULocalRCMFindPPNode( hypre_CSRMatrix *A, HYPRE_Int *rootp, HYPRE_Int *marker) { @@ -2495,27 +2770,28 @@ hypre_ILULocalRCMFindPPNode( hypre_CSRMatrix *A, HYPRE_Int *rootp, HYPRE_Int *ma HYPRE_Int root = *rootp; HYPRE_Int n = hypre_CSRMatrixNumRows(A); - HYPRE_Int *A_i = hypre_CSRMatrixI(A); + HYPRE_Int *A_i = hypre_CSRMatrixI(A); + /* at most n levels */ - HYPRE_Int *level_i = hypre_TAlloc(HYPRE_Int, n+1, HYPRE_MEMORY_HOST); - HYPRE_Int *level_j = hypre_TAlloc(HYPRE_Int, n, HYPRE_MEMORY_HOST); + HYPRE_Int *level_i = hypre_TAlloc(HYPRE_Int, n + 1, HYPRE_MEMORY_HOST); + HYPRE_Int *level_j = hypre_TAlloc(HYPRE_Int, n, HYPRE_MEMORY_HOST); /* build initial level structure from root */ - hypre_ILULocalRCMBuildLevel( A, root, marker, level_i, level_j, &newnlev); + hypre_ILULocalRCMBuildLevel(A, root, marker, level_i, level_j, &newnlev); - nlev = newnlev - 1; - while(nlev < newnlev) + nlev = newnlev - 1; + while (nlev < newnlev) { nlev = newnlev; - r1 = level_i[nlev-1]; + r1 = level_i[nlev - 1]; r2 = level_i[nlev]; min_degree = n; - for(i = r1 ; i < r2 ; i ++) + for (i = r1 ; i < r2 ; i ++) { /* select the last level, pick min-degree node */ row = level_j[i]; - lev_degree = A_i[row+1] - A_i[row]; - if(min_degree > lev_degree) + lev_degree = A_i[row + 1] - A_i[row]; + if (min_degree > lev_degree) { min_degree = lev_degree; root = row; @@ -2524,28 +2800,31 @@ hypre_ILULocalRCMFindPPNode( hypre_CSRMatrix *A, HYPRE_Int *rootp, HYPRE_Int *ma hypre_ILULocalRCMBuildLevel( A, root, marker, level_i, level_j, &newnlev); } + /* Set output pointers */ *rootp = root; - /* free */ + + /* Free */ hypre_TFree(level_i, HYPRE_MEMORY_HOST); hypre_TFree(level_j, HYPRE_MEMORY_HOST); + return hypre_error_flag; } /*-------------------------------------------------------------------------- * hypre_ILULocalRCMBuildLevel + * + * This function build level structure start from root + * A: the csr matrix, A_data is not needed + * root: pointer to the root + * marker: the marker array for unvisited node + * level_i: points to the start/end of position on level_j, similar to CSR Matrix + * level_j: store node number on each level + * nlevp: return the number of level on this level structure *--------------------------------------------------------------------------*/ -/* This function build level structure start from root - * A: the csr matrix, A_data is not needed - * root: pointer to the root - * marker: the marker array for unvisited node - * level_i: points to the start/end of position on level_j, similar to CSR Matrix - * level_j: store node number on each level - * nlevp: return the number of level on this level structure - */ HYPRE_Int hypre_ILULocalRCMBuildLevel(hypre_CSRMatrix *A, HYPRE_Int root, HYPRE_Int *marker, - HYPRE_Int *level_i, HYPRE_Int *level_j, HYPRE_Int *nlevp) + HYPRE_Int *level_i, HYPRE_Int *level_j, HYPRE_Int *nlevp) { HYPRE_Int i, j, l1, l2, l_current, r1, r2, rowi, rowj, nlev; HYPRE_Int *A_i = hypre_CSRMatrixI(A); @@ -2560,21 +2839,21 @@ hypre_ILULocalRCMBuildLevel(hypre_CSRMatrix *A, HYPRE_Int root, HYPRE_Int *marke l2 = 1; l_current = l2; - //explore nbhds of all nodes in current level - while(l2 > l1) + /* Explore nbhds of all nodes in current level */ + while (l2 > l1) { level_i[nlev++] = l2; /* loop through last level */ - for(i = l1 ; i < l2 ; i ++) + for (i = l1 ; i < l2 ; i ++) { /* the node to explore */ rowi = level_j[i]; r1 = A_i[rowi]; r2 = A_i[rowi + 1]; - for(j = r1 ; j < r2 ; j ++) + for (j = r1 ; j < r2 ; j ++) { rowj = A_j[j]; - if( marker[rowj] < 0 ) + if ( marker[rowj] < 0 ) { /* Aha, an unmarked row */ marker[rowj] = 0; @@ -2585,11 +2864,12 @@ hypre_ILULocalRCMBuildLevel(hypre_CSRMatrix *A, HYPRE_Int root, HYPRE_Int *marke l1 = l2; l2 = l_current; } + /* after this we always have a "ghost" last level */ nlev --; /* reset marker */ - for(i = 0 ; i < l2 ; i ++) + for (i = 0 ; i < l2 ; i ++) { marker[level_j[i]] = -1; } @@ -2601,1038 +2881,528 @@ hypre_ILULocalRCMBuildLevel(hypre_CSRMatrix *A, HYPRE_Int root, HYPRE_Int *marke /*-------------------------------------------------------------------------- * hypre_ILULocalRCMNumbering + * + * This function generate numbering for a connect component + * A: the csr matrix, A_data is not needed + * root: pointer to the root + * marker: the marker array for unvisited node + * perm: permutation array + * current_nump: number of nodes already have a perm value *--------------------------------------------------------------------------*/ -/* This function generate numbering for a connect component - * A: the csr matrix, A_data is not needed - * root: pointer to the root - * marker: the marker array for unvisited node - * perm: permutation array - * current_nump: number of nodes already have a perm value - */ - HYPRE_Int -hypre_ILULocalRCMNumbering(hypre_CSRMatrix *A, HYPRE_Int root, HYPRE_Int *marker, HYPRE_Int *perm, HYPRE_Int *current_nump) +hypre_ILULocalRCMNumbering(hypre_CSRMatrix *A, HYPRE_Int root, HYPRE_Int *marker, HYPRE_Int *perm, + HYPRE_Int *current_nump) { - HYPRE_Int i, j, l1, l2, r1, r2, rowi, rowj, row_start, row_end; - HYPRE_Int *A_i = hypre_CSRMatrixI(A); - HYPRE_Int *A_j = hypre_CSRMatrixJ(A); - HYPRE_Int current_num = *current_nump; - - - marker[root] = 0; - l1 = current_num; - perm[current_num++] = root; - l2 = current_num; - - while(l2 > l1) - { - /* loop through all nodes is current level */ - for(i = l1 ; i < l2 ; i ++) - { - rowi = perm[i]; - r1 = A_i[rowi]; - r2 = A_i[rowi+1]; - row_start = current_num; - for(j = r1 ; j < r2 ; j ++) - { - rowj = A_j[j]; - if(marker[rowj] < 0) - { - /* save the degree in marker and add it to perm */ - marker[rowj] = A_i[rowj+1] - A_i[rowj]; - perm[current_num++] = rowj; - } - } - row_end = current_num; - hypre_ILULocalRCMQsort(perm, row_start, row_end-1, marker); - } - l1 = l2; - l2 = current_num; - } - - //reverse - hypre_ILULocalRCMReverse(perm, *current_nump, current_num-1); - *current_nump = current_num; - return hypre_error_flag; + HYPRE_Int i, j, l1, l2, r1, r2, rowi, rowj, row_start, row_end; + HYPRE_Int *A_i = hypre_CSRMatrixI(A); + HYPRE_Int *A_j = hypre_CSRMatrixJ(A); + HYPRE_Int current_num = *current_nump; + + + marker[root] = 0; + l1 = current_num; + perm[current_num++] = root; + l2 = current_num; + + while (l2 > l1) + { + /* loop through all nodes is current level */ + for (i = l1 ; i < l2 ; i ++) + { + rowi = perm[i]; + r1 = A_i[rowi]; + r2 = A_i[rowi + 1]; + row_start = current_num; + for (j = r1 ; j < r2 ; j ++) + { + rowj = A_j[j]; + if (marker[rowj] < 0) + { + /* save the degree in marker and add it to perm */ + marker[rowj] = A_i[rowj + 1] - A_i[rowj]; + perm[current_num++] = rowj; + } + } + row_end = current_num; + hypre_ILULocalRCMQsort(perm, row_start, row_end - 1, marker); + } + l1 = l2; + l2 = current_num; + } + + //reverse + hypre_ILULocalRCMReverse(perm, *current_nump, current_num - 1); + *current_nump = current_num; + return hypre_error_flag; } /*-------------------------------------------------------------------------- * hypre_ILULocalRCMQsort - *--------------------------------------------------------------------------*/ - -/* This qsort is very specialized, not worth to put into utilities + * + * This qsort is very specialized, not worth to put into utilities * Sort a part of array perm based on degree value (ascend) * That is, if degree[perm[i]] < degree[perm[j]], we should have i < j - * perm: the perm array - * start: start in perm - * end: end in perm - * degree: degree array - */ + * perm: the perm array + * start: start in perm + * end: end in perm + * degree: degree array + *--------------------------------------------------------------------------*/ HYPRE_Int hypre_ILULocalRCMQsort(HYPRE_Int *perm, HYPRE_Int start, HYPRE_Int end, HYPRE_Int *degree) { + HYPRE_Int i, mid; + if (start >= end) + { + return hypre_error_flag; + } + + hypre_swap(perm, start, (start + end) / 2); + mid = start; + + /* Loop to split */ + for (i = start + 1 ; i <= end ; i ++) + { + if (degree[perm[i]] < degree[perm[start]]) + { + hypre_swap(perm, ++mid, i); + } + } + hypre_swap(perm, start, mid); + hypre_ILULocalRCMQsort(perm, mid + 1, end, degree); + hypre_ILULocalRCMQsort(perm, start, mid - 1, degree); - HYPRE_Int i, mid; - if(start >= end) - { - return hypre_error_flag; - } - - hypre_swap(perm, start, (start + end) / 2); - mid = start; - //loop to split - for(i = start + 1 ; i <= end ; i ++) - { - if(degree[perm[i]] < degree[perm[start]]) - { - hypre_swap(perm, ++mid, i); - } - } - hypre_swap(perm, start, mid); - hypre_ILULocalRCMQsort(perm, mid+1, end, degree); - hypre_ILULocalRCMQsort(perm, start, mid-1, degree); - return hypre_error_flag; + return hypre_error_flag; } /*-------------------------------------------------------------------------- * hypre_ILULocalRCMReverse - *--------------------------------------------------------------------------*/ - -/* Last step in RCM, reverse it + * + * Last step in RCM, reverse it * perm: perm array * srart: start position * end: end position - */ + *--------------------------------------------------------------------------*/ HYPRE_Int hypre_ILULocalRCMReverse(HYPRE_Int *perm, HYPRE_Int start, HYPRE_Int end) { - HYPRE_Int i, j; - HYPRE_Int mid = (start + end + 1) / 2; + HYPRE_Int i, j; + HYPRE_Int mid = (start + end + 1) / 2; - for(i = start, j = end ; i < mid ; i ++, j--) - { - hypre_swap(perm, i, j); - } + for (i = start, j = end ; i < mid ; i ++, j--) + { + hypre_swap(perm, i, j); + } return hypre_error_flag; } -#ifdef HYPRE_USING_CUDA +/* TODO (VPM): Change this block to another file? */ +#if defined(HYPRE_USING_GPU) /*-------------------------------------------------------------------------- - * hypre_ParILUCusparseSchurGMRESDummySetup + * hypre_ParILUSchurGMRESDummySolveDevice + * + * Unit GMRES preconditioner, just copy data from one slot to another *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_ParILUCusparseSchurGMRESDummySetup(void *a, void *b, void *c, void *d) +hypre_ParILUSchurGMRESDummySolveDevice( void *ilu_vdata, + void *ilu_vdata2, + hypre_ParVector *f, + hypre_ParVector *u ) { - /* Null GMRES setup, does nothing */ - return 0; -} - -/*-------------------------------------------------------------------------- - * hypre_ParILUCusparseSchurGMRESDummySolve - *--------------------------------------------------------------------------*/ + HYPRE_UNUSED_VAR(ilu_vdata); + HYPRE_UNUSED_VAR(ilu_vdata2); -HYPRE_Int -hypre_ParILUCusparseSchurGMRESDummySolve( void *ilu_vdata, - void *ilu_vdata2, - hypre_ParVector *f, - hypre_ParVector *u ) -{ - /* Unit GMRES preconditioner, just copy data from one slot to another */ - hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; - hypre_ParCSRMatrix *A = hypre_ParILUDataMatS(ilu_data); - hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); - HYPRE_Int n_local = hypre_CSRMatrixNumRows(A_diag); + hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; + hypre_ParCSRMatrix *S = hypre_ParILUDataMatS(ilu_data); + HYPRE_Int n_local = hypre_ParCSRMatrixNumRows(S); - hypre_Vector *u_local = hypre_ParVectorLocalVector(u); - HYPRE_Real *u_data = hypre_VectorData(u_local); + hypre_Vector *u_local = hypre_ParVectorLocalVector(u); + HYPRE_Complex *u_data = hypre_VectorData(u_local); - hypre_Vector *f_local = hypre_ParVectorLocalVector(f); - HYPRE_Real *f_data = hypre_VectorData(f_local); + hypre_Vector *f_local = hypre_ParVectorLocalVector(f); + HYPRE_Complex *f_data = hypre_VectorData(f_local); - cudaDeviceSynchronize(); hypre_TMemcpy(u_data, f_data, HYPRE_Real, n_local, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); return hypre_error_flag; } /*-------------------------------------------------------------------------- - * hypre_ParILUCusparseSchurGMRESCommInfo + * hypre_ParILUSchurGMRESCommInfoDevice *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_ParILUCusparseSchurGMRESCommInfo( void *ilu_vdata, HYPRE_Int *my_id, HYPRE_Int *num_procs) +hypre_ParILUSchurGMRESCommInfoDevice(void *ilu_vdata, + HYPRE_Int *my_id, + HYPRE_Int *num_procs) { /* get comm info from ilu_data */ - hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; - hypre_ParCSRMatrix *A = hypre_ParILUDataMatS(ilu_data); - MPI_Comm comm = hypre_ParCSRMatrixComm ( A ); - hypre_MPI_Comm_size(comm,num_procs); - hypre_MPI_Comm_rank(comm,my_id); - return 0; -} - -/*-------------------------------------------------------------------------- - * hypre_ParILUCusparseSchurGMRESMatvecCreate - *--------------------------------------------------------------------------*/ - -void * -hypre_ParILUCusparseSchurGMRESMatvecCreate( void *ilu_vdata, - void *x ) -{ - /* Null matvec create */ - void *matvec_data; - matvec_data = NULL; - return ( matvec_data ); -} - -/*-------------------------------------------------------------------------- - * hypre_ParILUCusparseSchurGMRESMatvec - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_ParILUCusparseSchurGMRESMatvec( void *matvec_data, - HYPRE_Complex alpha, - void *ilu_vdata, - void *x, - HYPRE_Complex beta, - void *y ) -{ - /* Slightly different, for this new matvec, the diagonal of the original matrix - * is the LU factorization. Thus, the matvec is done in an different way - * |IS_1 E_12 E_13| - * |E_21 IS_2 E_23| = S - * |E_31 E_32 IS_3| - * - * |IS_1 | - * | IS_2 | = M - * | IS_3| - * - * Solve Sy = g is just M^{-1}S = M^{-1}g - * - * | I IS_1^{-1}E_12 IS_1^{-1}E_13| - * |IS_2^{-1}E_21 I IS_2^{-1}E_23| = M^{-1}S - * |IS_3^{-1}E_31 IS_3^{-1}E_32 I | - * - * */ - - /* get matrix information first */ - hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; - hypre_ParCSRMatrix *A = hypre_ParILUDataMatS(ilu_data); - - /* fist step, apply matvec on empty diagonal slot */ - hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); - HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); - HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); - HYPRE_Real *A_diag_data = hypre_CSRMatrixData(A_diag); - HYPRE_Int A_diag_n = hypre_CSRMatrixNumRows(A_diag); - HYPRE_Int A_diag_nnz = A_diag_i[A_diag_n]; - HYPRE_Int *A_diag_fake_i = hypre_ParILUDataMatAFakeDiagonal(ilu_data); - - cusparseMatDescr_t matL_des = hypre_ParILUDataMatLMatrixDescription(ilu_data); - cusparseMatDescr_t matU_des = hypre_ParILUDataMatUMatrixDescription(ilu_data); - void *ilu_solve_buffer = hypre_ParILUDataILUSolveBuffer(ilu_data);//device memory - cusparseSolvePolicy_t ilu_solve_policy = hypre_ParILUDataILUSolvePolicy(ilu_data); - csrsv2Info_t matSL_info = hypre_ParILUDataMatSLILUSolveInfo(ilu_data); - csrsv2Info_t matSU_info = hypre_ParILUDataMatSUILUSolveInfo(ilu_data); - - HYPRE_Int isDoublePrecision = sizeof(HYPRE_Complex) == sizeof(hypre_double); - HYPRE_Int isSinglePrecision = sizeof(HYPRE_Complex) == sizeof(hypre_double) / 2; - - hypre_assert(isDoublePrecision || isSinglePrecision); - - hypre_ParVector *xtemp = hypre_ParILUDataXTemp(ilu_data); - hypre_Vector *xtemp_local = hypre_ParVectorLocalVector(xtemp); - HYPRE_Real *xtemp_data = hypre_VectorData(xtemp_local); - hypre_ParVector *ytemp = hypre_ParILUDataYTemp(ilu_data); - hypre_Vector *ytemp_local = hypre_ParVectorLocalVector(ytemp); - HYPRE_Real *ytemp_data = hypre_VectorData(ytemp_local); - HYPRE_Real zero = 0.0; - HYPRE_Real one = 1.0; - - cusparseHandle_t handle = hypre_HandleCusparseHandle(hypre_handle()); - - /* Matvec with - * | O E_12 E_13| - * alpha * |E_21 O E_23| - * |E_31 E_32 O | - * store in xtemp - */ - hypre_CSRMatrixI(A_diag) = A_diag_fake_i; - hypre_ParCSRMatrixMatvec( alpha, (hypre_ParCSRMatrix *) A, (hypre_ParVector *) x, zero, xtemp ); - hypre_CSRMatrixI(A_diag) = A_diag_i; - - /* Compute U^{-1}*L^{-1}*(A_offd * x) - * Or in another word, matvec with - * | O IS_1^{-1}E_12 IS_1^{-1}E_13| - * alpha * |IS_2^{-1}E_21 O IS_2^{-1}E_23| - * |IS_3^{-1}E_31 IS_3^{-1}E_32 O | - * store in xtemp - */ - if( A_diag_n > 0 ) - { - if(isDoublePrecision) - { - /* L solve - Forward solve */ - HYPRE_CUSPARSE_CALL(cusparseDcsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - A_diag_n, A_diag_nnz, (hypre_double *) &one, matL_des, - (hypre_double *) A_diag_data, A_diag_i, A_diag_j, matSL_info, - (hypre_double *) xtemp_data, (hypre_double *) ytemp_data, ilu_solve_policy, ilu_solve_buffer)); - - /* U solve - Backward substitution */ - HYPRE_CUSPARSE_CALL(cusparseDcsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - A_diag_n, A_diag_nnz, (hypre_double *) &one, matU_des, - (hypre_double *) A_diag_data, A_diag_i, A_diag_j, matSU_info, - (hypre_double *) ytemp_data, (hypre_double *) xtemp_data, ilu_solve_policy, ilu_solve_buffer)); - } - else if(isSinglePrecision) - { - /* L solve - Forward solve */ - HYPRE_CUSPARSE_CALL(cusparseScsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - A_diag_n, A_diag_nnz, (float *) &one, matL_des, - (float *) A_diag_data, A_diag_i, A_diag_j, matSL_info, - (float *) xtemp_data, (float *) ytemp_data, ilu_solve_policy, ilu_solve_buffer)); - - /* U solve - Backward substitution */ - HYPRE_CUSPARSE_CALL(cusparseScsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - A_diag_n, A_diag_nnz, (float *) &one, matU_des, - (float *) A_diag_data, A_diag_i, A_diag_j, matSU_info, - (float *) ytemp_data, (float *) xtemp_data, ilu_solve_policy, ilu_solve_buffer)); - } - } + hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; + hypre_ParCSRMatrix *S = hypre_ParILUDataMatS(ilu_data); + MPI_Comm comm = hypre_ParCSRMatrixComm(S); - /* now add the original x onto it */ - hypre_ParVectorAxpy( alpha, (hypre_ParVector *) x, (hypre_ParVector *) xtemp); - - /* finall, add that into y and get final result */ - hypre_ParVectorScale( beta, (hypre_ParVector *) y ); - hypre_ParVectorAxpy( one, xtemp, (hypre_ParVector *) y); + hypre_MPI_Comm_size(comm, num_procs); + hypre_MPI_Comm_rank(comm, my_id); return hypre_error_flag; } /*-------------------------------------------------------------------------- - * hypre_ParILUCusparseSchurGMRESMatvecDestroy + * hypre_ParILURAPSchurGMRESSolveDevice *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_ParILUCusparseSchurGMRESMatvecDestroy( void *matvec_data ) +hypre_ParILURAPSchurGMRESSolveDevice( void *ilu_vdata, + void *ilu_vdata2, + hypre_ParVector *par_f, + hypre_ParVector *par_u ) { - return hypre_error_flag; -} + HYPRE_UNUSED_VAR(ilu_vdata); + HYPRE_UNUSED_VAR(ilu_vdata2); -/*-------------------------------------------------------------------------- - * hypre_ParILUCusparseSchurGMRESDummySetup - *--------------------------------------------------------------------------*/ + hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; + hypre_ParCSRMatrix *S = hypre_ParILUDataMatS(ilu_data); + hypre_CSRMatrix *SLU = hypre_ParCSRMatrixDiag(S); -HYPRE_Int -hypre_ParILURAPSchurGMRESDummySetup(void *a, void *b, void *c, void *d) -{ - /* Null GMRES setup, does nothing */ - return 0; -} + hypre_ParVector *par_rhs = hypre_ParILUDataRhs(ilu_data); + hypre_Vector *rhs = hypre_ParVectorLocalVector(par_rhs); + hypre_Vector *f = hypre_ParVectorLocalVector(par_f); + hypre_Vector *u = hypre_ParVectorLocalVector(par_u); -/*-------------------------------------------------------------------------- - * hypre_ParILUCusparseSchurGMRESDummySolve - *--------------------------------------------------------------------------*/ + /* L solve */ + hypre_CSRMatrixTriLowerUpperSolveDevice('L', 1, SLU, NULL, f, rhs); -HYPRE_Int -hypre_ParILURAPSchurGMRESSolve( void *ilu_vdata, - void *ilu_vdata2, - hypre_ParVector *f, - hypre_ParVector *u ) -{ - /* Unit GMRES preconditioner, just copy data from one slot to another */ - hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; - //hypre_ParCSRMatrix *Aperm = hypre_ParILUDataAperm(ilu_data); - - cusparseHandle_t handle = hypre_HandleCusparseHandle(hypre_handle()); - cusparseMatDescr_t matL_des = hypre_ParILUDataMatLMatrixDescription(ilu_data); - cusparseMatDescr_t matU_des = hypre_ParILUDataMatUMatrixDescription(ilu_data); - void *ilu_solve_buffer = hypre_ParILUDataILUSolveBuffer(ilu_data);//device memory - cusparseSolvePolicy_t ilu_solve_policy = hypre_ParILUDataILUSolvePolicy(ilu_data); - - HYPRE_Int isDoublePrecision = sizeof(HYPRE_Complex) == sizeof(hypre_double); - HYPRE_Int isSinglePrecision = sizeof(HYPRE_Complex) == sizeof(hypre_double) / 2; - - hypre_assert(isDoublePrecision || isSinglePrecision); - - hypre_ParCSRMatrix *S = hypre_ParILUDataMatS(ilu_data); - hypre_CSRMatrix *SLU = hypre_ParCSRMatrixDiag(S); - HYPRE_Int *SLU_i = hypre_CSRMatrixI(SLU); - HYPRE_Int *SLU_j = hypre_CSRMatrixJ(SLU); - HYPRE_Real *SLU_data = hypre_CSRMatrixData(SLU); - HYPRE_Int SLU_nnz = hypre_CSRMatrixNumNonzeros(SLU); - - csrsv2Info_t matSL_info = hypre_ParILUDataMatSLILUSolveInfo(ilu_data); - csrsv2Info_t matSU_info = hypre_ParILUDataMatSUILUSolveInfo(ilu_data); - - //HYPRE_Int n = hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(Aperm)); - HYPRE_Int m = hypre_CSRMatrixNumRows(SLU); - //HYPRE_Int nLU = n - m; - - hypre_ParVector *f_vec = (hypre_ParVector *) f; - hypre_Vector *f_local = hypre_ParVectorLocalVector(f_vec); - HYPRE_Real *f_data = hypre_VectorData(f_local); - hypre_ParVector *u_vec = (hypre_ParVector *) u; - hypre_Vector *u_local = hypre_ParVectorLocalVector(u_vec); - HYPRE_Real *u_data = hypre_VectorData(u_local); - hypre_ParVector *rhs = hypre_ParILUDataRhs(ilu_data); - hypre_Vector *rhs_local = hypre_ParVectorLocalVector(rhs); - HYPRE_Real *rhs_data = hypre_VectorData(rhs_local); - - //HYPRE_Real zero = 0.0; - HYPRE_Real one = 1.0; - //HYPRE_Real mone = -1.0; - - if(m > 0) - { - if(isDoublePrecision) - { - /* L solve */ - HYPRE_CUSPARSE_CALL(cusparseDcsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - m, SLU_nnz, (hypre_double *) &one, matL_des, - (hypre_double *) SLU_data, SLU_i, SLU_j, matSL_info, - (hypre_double *) f_data, (hypre_double *) rhs_data, ilu_solve_policy, ilu_solve_buffer)); - /* U solve */ - HYPRE_CUSPARSE_CALL(cusparseDcsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - m, SLU_nnz, (hypre_double *) &one, matU_des, - (hypre_double *) SLU_data, SLU_i, SLU_j, matSU_info, - (hypre_double *) rhs_data, (hypre_double *) u_data, ilu_solve_policy, ilu_solve_buffer)); - } - else if(isSinglePrecision) - { - /* L solve */ - HYPRE_CUSPARSE_CALL(cusparseScsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - m, SLU_nnz, (float *) &one, matL_des, - (float *) SLU_data, SLU_i, SLU_j, matSL_info, - (float *) f_data, (float *) rhs_data, ilu_solve_policy, ilu_solve_buffer)); - /* U solve */ - HYPRE_CUSPARSE_CALL(cusparseScsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - m, SLU_nnz, (float *) &one, matU_des, - (float *) SLU_data, SLU_i, SLU_j, matSU_info, - (float *) rhs_data, (float *) u_data, ilu_solve_policy, ilu_solve_buffer)); - } - } + /* U solve */ + hypre_CSRMatrixTriLowerUpperSolveDevice('U', 0, SLU, NULL, rhs, u); return hypre_error_flag; } /*-------------------------------------------------------------------------- - * hypre_ParILUCusparseSchurGMRESMatvecCreate - *--------------------------------------------------------------------------*/ - -void * -hypre_ParILURAPSchurGMRESMatvecCreate( void *ilu_vdata, - void *x ) -{ - /* Null matvec create */ - void *matvec_data; - matvec_data = NULL; - return ( matvec_data ); -} - -/*-------------------------------------------------------------------------- - * hypre_ParILUCusparseSchurGMRESMatvec + * hypre_ParILURAPSchurGMRESMatvecDevice + * + * Compute y = alpha * S * x + beta * y + * + * TODO (VPM): Unify this function with hypre_ParILURAPSchurGMRESMatvecHost *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_ParILURAPSchurGMRESMatvec( void *matvec_data, - HYPRE_Complex alpha, - void *ilu_vdata, - void *x, - HYPRE_Complex beta, - void *y ) +hypre_ParILURAPSchurGMRESMatvecDevice( void *matvec_data, + HYPRE_Complex alpha, + void *ilu_vdata, + void *x, + HYPRE_Complex beta, + void *y ) { - /* Compute y = alpha * S * x + beta * y - * */ - - /* get matrix information first */ - hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; - - HYPRE_Int test_opt = hypre_ParILUDataTestOption(ilu_data); - - switch(test_opt) + HYPRE_UNUSED_VAR(matvec_data); + + /* Get matrix information first */ + hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; + HYPRE_Int test_opt = hypre_ParILUDataTestOption(ilu_data); + hypre_ParCSRMatrix *Aperm = hypre_ParILUDataAperm(ilu_data); + HYPRE_Int n = hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(Aperm)); + hypre_CSRMatrix *EiU = hypre_ParILUDataMatEDevice(ilu_data); + hypre_CSRMatrix *iLF = hypre_ParILUDataMatFDevice(ilu_data); + hypre_CSRMatrix *BLU = hypre_ParILUDataMatBILUDevice(ilu_data); + hypre_CSRMatrix *C = hypre_ParILUDataMatSILUDevice(ilu_data); + + hypre_ParVector *x_vec = (hypre_ParVector *) x; + hypre_Vector *x_local = hypre_ParVectorLocalVector(x_vec); + HYPRE_Real *x_data = hypre_VectorData(x_local); + hypre_ParVector *xtemp = hypre_ParILUDataUTemp(ilu_data); + hypre_Vector *xtemp_local = hypre_ParVectorLocalVector(xtemp); + HYPRE_Real *xtemp_data = hypre_VectorData(xtemp_local); + + hypre_ParVector *y_vec = (hypre_ParVector *) y; + hypre_Vector *y_local = hypre_ParVectorLocalVector(y_vec); + hypre_ParVector *ytemp = hypre_ParILUDataYTemp(ilu_data); + hypre_Vector *ytemp_local = hypre_ParVectorLocalVector(ytemp); + HYPRE_Real *ytemp_data = hypre_VectorData(ytemp_local); + + HYPRE_Int nLU; + HYPRE_Int m; + hypre_Vector *xtemp_upper; + hypre_Vector *xtemp_lower; + hypre_Vector *ytemp_upper; + hypre_Vector *ytemp_lower; + + switch (test_opt) { case 1: - { /* S = R * A * P */ - hypre_ParCSRMatrix *Aperm = hypre_ParILUDataAperm(ilu_data); - - cusparseHandle_t handle = hypre_HandleCusparseHandle(hypre_handle()); - cusparseMatDescr_t matL_des = hypre_ParILUDataMatLMatrixDescription(ilu_data); - cusparseMatDescr_t matU_des = hypre_ParILUDataMatUMatrixDescription(ilu_data); - void *ilu_solve_buffer = hypre_ParILUDataILUSolveBuffer(ilu_data);//device memory - cusparseSolvePolicy_t ilu_solve_policy = hypre_ParILUDataILUSolvePolicy(ilu_data); - - HYPRE_Int isDoublePrecision = sizeof(HYPRE_Complex) == sizeof(hypre_double); - HYPRE_Int isSinglePrecision = sizeof(HYPRE_Complex) == sizeof(hypre_double) / 2; - - hypre_assert(isDoublePrecision || isSinglePrecision); - - hypre_CSRMatrix *EiU = hypre_ParILUDataMatEDevice(ilu_data); - hypre_CSRMatrix *iLF = hypre_ParILUDataMatFDevice(ilu_data); - hypre_CSRMatrix *BLU = hypre_ParILUDataMatBILUDevice(ilu_data); - HYPRE_Int *BLU_i = hypre_CSRMatrixI(BLU); - HYPRE_Int *BLU_j = hypre_CSRMatrixJ(BLU); - HYPRE_Real *BLU_data = hypre_CSRMatrixData(BLU); - HYPRE_Int BLU_nnz = hypre_CSRMatrixNumNonzeros(BLU); - - csrsv2Info_t matBL_info = hypre_ParILUDataMatBLILUSolveInfo(ilu_data); - csrsv2Info_t matBU_info = hypre_ParILUDataMatBUILUSolveInfo(ilu_data); - - HYPRE_Int n = hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(Aperm)); - HYPRE_Int nLU = hypre_CSRMatrixNumRows(BLU); - HYPRE_Int m = n - nLU; - - hypre_ParVector *x_vec = (hypre_ParVector *) x; - hypre_Vector *x_local = hypre_ParVectorLocalVector(x_vec); - HYPRE_Real *x_data = hypre_VectorData(x_local); - hypre_ParVector *y_vec = (hypre_ParVector *) y; - hypre_Vector *y_local = hypre_ParVectorLocalVector(y_vec); - //HYPRE_Real *y_data = hypre_VectorData(y_local); - hypre_ParVector *xtemp = hypre_ParILUDataUTemp(ilu_data); - hypre_Vector *xtemp_local = hypre_ParVectorLocalVector(xtemp); - HYPRE_Real *xtemp_data = hypre_VectorData(xtemp_local); - hypre_ParVector *ytemp = hypre_ParILUDataYTemp(ilu_data); - hypre_Vector *ytemp_local = hypre_ParVectorLocalVector(ytemp); - HYPRE_Real *ytemp_data = hypre_VectorData(ytemp_local); - - hypre_Vector *xtemp_upper = hypre_SeqVectorCreate(nLU); - hypre_Vector *ytemp_upper = hypre_SeqVectorCreate(nLU); - hypre_Vector *xtemp_lower = hypre_SeqVectorCreate(m); - hypre_VectorOwnsData(xtemp_upper) = 0; - hypre_VectorOwnsData(ytemp_upper) = 0; - hypre_VectorOwnsData(xtemp_lower) = 0; - hypre_VectorData(xtemp_upper) = xtemp_data; - hypre_VectorData(ytemp_upper) = ytemp_data; - hypre_VectorData(xtemp_lower) = xtemp_data+nLU; + nLU = hypre_CSRMatrixNumRows(BLU); + m = n - nLU; + xtemp_upper = hypre_SeqVectorCreate(nLU); + ytemp_upper = hypre_SeqVectorCreate(nLU); + xtemp_lower = hypre_SeqVectorCreate(m); + hypre_VectorOwnsData(xtemp_upper) = 0; + hypre_VectorOwnsData(ytemp_upper) = 0; + hypre_VectorOwnsData(xtemp_lower) = 0; + hypre_VectorData(xtemp_upper) = xtemp_data; + hypre_VectorData(ytemp_upper) = ytemp_data; + hypre_VectorData(xtemp_lower) = xtemp_data + nLU; + hypre_SeqVectorInitialize(xtemp_upper); hypre_SeqVectorInitialize(ytemp_upper); hypre_SeqVectorInitialize(xtemp_lower); - HYPRE_Real zero = 0.0; - HYPRE_Real one = 1.0; - HYPRE_Real mone = -1.0; - /* first step, compute P*x put in y */ /* -Fx */ - hypre_CSRMatrixMatvec(mone, iLF, x_local, zero, ytemp_upper); + hypre_CSRMatrixMatvec(-1.0, iLF, x_local, 0.0, ytemp_upper); + /* -L^{-1}Fx */ - if(isDoublePrecision) - { - /* L solve */ - HYPRE_CUSPARSE_CALL(cusparseDcsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - nLU, BLU_nnz, (hypre_double *) &one, matL_des, - (hypre_double *) BLU_data, BLU_i, BLU_j, matBL_info, - (hypre_double *) ytemp_data, (hypre_double *) xtemp_data, ilu_solve_policy, ilu_solve_buffer)); - } - else if(isSinglePrecision) - { - /* L solve */ - HYPRE_CUSPARSE_CALL(cusparseScsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - nLU, BLU_nnz, (float *) &one, matL_des, - (float *) BLU_data, BLU_i, BLU_j, matBL_info, - (float *) ytemp_data, (float *) xtemp_data, ilu_solve_policy, ilu_solve_buffer)); - } + /* L solve */ + hypre_CSRMatrixTriLowerUpperSolveDevice('L', 1, BLU, NULL, ytemp_local, xtemp_local); + /* -U{-1}L^{-1}Fx */ - if(isDoublePrecision) - { - /* U solve */ - HYPRE_CUSPARSE_CALL(cusparseDcsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - nLU, BLU_nnz, (hypre_double *) &one, matU_des, - (hypre_double *) BLU_data, BLU_i, BLU_j, matBU_info, - (hypre_double *) xtemp_data, (hypre_double *) ytemp_data, ilu_solve_policy, ilu_solve_buffer)); - } - else if(isSinglePrecision) - { - /* U solve */ - HYPRE_CUSPARSE_CALL(cusparseScsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - nLU, BLU_nnz, (float *) &one, matU_des, - (float *) BLU_data, BLU_i, BLU_j, matBU_info, - (float *) xtemp_data, (float *) ytemp_data, ilu_solve_policy, ilu_solve_buffer)); - } + /* U solve */ + hypre_CSRMatrixTriLowerUpperSolveDevice('U', 0, BLU, NULL, xtemp_local, ytemp_local); + /* now copy data to y_lower */ - hypre_TMemcpy( ytemp_data + nLU, x_data, HYPRE_Real, m, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(ytemp_data + nLU, x_data, HYPRE_Real, m, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); /* second step, compute A*P*x store in xtemp */ - hypre_ParCSRMatrixMatvec( one, Aperm, ytemp, zero, xtemp); + hypre_ParCSRMatrixMatvec(1.0, Aperm, ytemp, 0.0, xtemp); /* third step, compute R*A*P*x */ /* solve L^{-1} */ - if(isDoublePrecision) - { - /* L solve */ - HYPRE_CUSPARSE_CALL(cusparseDcsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - nLU, BLU_nnz, (hypre_double *) &one, matL_des, - (hypre_double *) BLU_data, BLU_i, BLU_j, matBL_info, - (hypre_double *) xtemp_data, (hypre_double *) ytemp_data, ilu_solve_policy, ilu_solve_buffer)); - } - else if(isSinglePrecision) - { - /* L solve */ - HYPRE_CUSPARSE_CALL(cusparseScsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - nLU, BLU_nnz, (float *) &one, matL_des, - (float *) BLU_data, BLU_i, BLU_j, matBL_info, - (float *) xtemp_data, (float *) ytemp_data, ilu_solve_policy, ilu_solve_buffer)); - } - /* U^{-1}L^{-1} */ - if(isDoublePrecision) - { - /* U solve */ - HYPRE_CUSPARSE_CALL(cusparseDcsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - nLU, BLU_nnz, (hypre_double *) &one, matU_des, - (hypre_double *) BLU_data, BLU_i, BLU_j, matBU_info, - (hypre_double *) ytemp_data, (hypre_double *) xtemp_data, ilu_solve_policy, ilu_solve_buffer)); - } - else if(isSinglePrecision) - { - /* U solve */ - HYPRE_CUSPARSE_CALL(cusparseScsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - nLU, BLU_nnz, (float *) &one, matU_des, - (float *) BLU_data, BLU_i, BLU_j, matBU_info, - (float *) ytemp_data, (float *) xtemp_data, ilu_solve_policy, ilu_solve_buffer)); - } - /* -EU^{-1}L^{-1} */ - hypre_CSRMatrixMatvec(mone * alpha, EiU, xtemp_upper, beta, y_local); - /* I*lower-EU^{-1}L^{-1}*upper */ - hypre_SeqVectorAxpy(alpha, xtemp_lower, y_local); - - /* over */ - hypre_SeqVectorDestroy(xtemp_upper); - hypre_SeqVectorDestroy(ytemp_upper); - hypre_SeqVectorDestroy(xtemp_lower); - } - break; - case 2: - { - /* S = C - EU^{-1} * L^{-1}F */ - - //hypre_ParCSRMatrix *Aperm = hypre_ParILUDataAperm(ilu_data); - - //cusparseHandle_t handle = hypre_HandleCusparseHandle(hypre_handle()); - //cusparseMatDescr_t matL_des = hypre_ParILUDataMatLMatrixDescription(ilu_data); - //cusparseMatDescr_t matU_des = hypre_ParILUDataMatUMatrixDescription(ilu_data); - //void *ilu_solve_buffer = hypre_ParILUDataILUSolveBuffer(ilu_data);//device memory - //cusparseSolvePolicy_t ilu_solve_policy = hypre_ParILUDataILUSolvePolicy(ilu_data); + /* L solve */ + hypre_CSRMatrixTriLowerUpperSolveDevice('L', 1, BLU, NULL, xtemp_local, ytemp_local); - //HYPRE_Int isDoublePrecision = sizeof(HYPRE_Complex) == sizeof(hypre_double); - //HYPRE_Int isSinglePrecision = sizeof(HYPRE_Complex) == sizeof(hypre_double) / 2; + /* U^{-1}L^{-1} */ + /* U solve */ + hypre_CSRMatrixTriLowerUpperSolveDevice('U', 0, BLU, NULL, ytemp_local, xtemp_local); - //hypre_assert(isDoublePrecision || isSinglePrecision); + /* -EU^{-1}L^{-1} */ + hypre_CSRMatrixMatvec(-alpha, EiU, xtemp_upper, beta, y_local); - hypre_CSRMatrix *EiU = hypre_ParILUDataMatEDevice(ilu_data); - hypre_CSRMatrix *iLF = hypre_ParILUDataMatFDevice(ilu_data); - hypre_CSRMatrix *C = hypre_ParILUDataMatSILUDevice(ilu_data); + /* I*lower-EU^{-1}L^{-1}*upper */ + hypre_SeqVectorAxpy(alpha, xtemp_lower, y_local); - //HYPRE_Int n = hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(Aperm)); - HYPRE_Int nLU = hypre_CSRMatrixNumRows(C); - //HYPRE_Int m = n - nLU; + hypre_SeqVectorDestroy(xtemp_upper); + hypre_SeqVectorDestroy(ytemp_upper); + hypre_SeqVectorDestroy(xtemp_lower); + break; - hypre_ParVector *x_vec = (hypre_ParVector *) x; - hypre_Vector *x_local = hypre_ParVectorLocalVector(x_vec); - //HYPRE_Real *x_data = hypre_VectorData(x_local); - hypre_ParVector *y_vec = (hypre_ParVector *) y; - hypre_Vector *y_local = hypre_ParVectorLocalVector(y_vec); - //HYPRE_Real *y_data = hypre_VectorData(y_local); - hypre_ParVector *xtemp = hypre_ParILUDataUTemp(ilu_data); - hypre_Vector *xtemp_local = hypre_ParVectorLocalVector(xtemp); - HYPRE_Real *xtemp_data = hypre_VectorData(xtemp_local); + case 2: + /* S = C - EU^{-1} * L^{-1}F */ + nLU = hypre_CSRMatrixNumRows(C); + xtemp_upper = hypre_SeqVectorCreate(nLU); + hypre_VectorOwnsData(xtemp_upper) = 0; + hypre_VectorData(xtemp_upper) = xtemp_data; - hypre_Vector *xtemp_upper = hypre_SeqVectorCreate(nLU); - hypre_VectorOwnsData(xtemp_upper) = 0; - hypre_VectorData(xtemp_upper) = xtemp_data; hypre_SeqVectorInitialize(xtemp_upper); - HYPRE_Real zero = 0.0; - HYPRE_Real one = 1.0; - HYPRE_Real mone = -1.0; - /* first step, compute EB^{-1}F*x put in y */ /* -L^{-1}Fx */ - hypre_CSRMatrixMatvec(mone, iLF, x_local, zero, xtemp_upper); + hypre_CSRMatrixMatvec(-1.0, iLF, x_local, 0.0, xtemp_upper); + /* - alpha EU^{-1}L^{-1}Fx + beta * y */ - hypre_CSRMatrixMatvec( alpha, EiU, xtemp_upper, beta, y_local); - /* alpha * C - alpha EU^{-1}L^{-1}Fx + beta y */ - hypre_CSRMatrixMatvec( alpha, C, x_local, one, y_local); + hypre_CSRMatrixMatvec(alpha, EiU, xtemp_upper, beta, y_local); - /* over */ + /* alpha * C - alpha EU^{-1}L^{-1}Fx + beta y */ + hypre_CSRMatrixMatvec(alpha, C, x_local, 1.0, y_local); hypre_SeqVectorDestroy(xtemp_upper); - } - break; + break; + case 3: - { /* S = C - EU^{-1} * L^{-1}F */ - - //hypre_ParCSRMatrix *Aperm = hypre_ParILUDataAperm(ilu_data); - - cusparseHandle_t handle = hypre_HandleCusparseHandle(hypre_handle()); - cusparseMatDescr_t matL_des = hypre_ParILUDataMatLMatrixDescription(ilu_data); - cusparseMatDescr_t matU_des = hypre_ParILUDataMatUMatrixDescription(ilu_data); - void *ilu_solve_buffer = hypre_ParILUDataILUSolveBuffer(ilu_data);//device memory - cusparseSolvePolicy_t ilu_solve_policy = hypre_ParILUDataILUSolvePolicy(ilu_data); - - HYPRE_Int isDoublePrecision = sizeof(HYPRE_Complex) == sizeof(hypre_double); - HYPRE_Int isSinglePrecision = sizeof(HYPRE_Complex) == sizeof(hypre_double) / 2; - - hypre_assert(isDoublePrecision || isSinglePrecision); - - hypre_CSRMatrix *EiU = hypre_ParILUDataMatEDevice(ilu_data); - hypre_CSRMatrix *iLF = hypre_ParILUDataMatFDevice(ilu_data); - hypre_CSRMatrix *C = hypre_ParILUDataMatSILUDevice(ilu_data); - hypre_CSRMatrix *BLU = hypre_ParILUDataMatBILUDevice(ilu_data); - HYPRE_Int *BLU_i = hypre_CSRMatrixI(BLU); - HYPRE_Int *BLU_j = hypre_CSRMatrixJ(BLU); - HYPRE_Real *BLU_data = hypre_CSRMatrixData(BLU); - HYPRE_Int BLU_nnz = hypre_CSRMatrixNumNonzeros(BLU); - - csrsv2Info_t matBL_info = hypre_ParILUDataMatBLILUSolveInfo(ilu_data); - csrsv2Info_t matBU_info = hypre_ParILUDataMatBUILUSolveInfo(ilu_data); - - //HYPRE_Int n = hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(Aperm)); - HYPRE_Int nLU = hypre_CSRMatrixNumRows(C); - //HYPRE_Int m = n - nLU; - - hypre_ParVector *x_vec = (hypre_ParVector *) x; - hypre_Vector *x_local = hypre_ParVectorLocalVector(x_vec); - //HYPRE_Real *x_data = hypre_VectorData(x_local); - hypre_ParVector *y_vec = (hypre_ParVector *) y; - hypre_Vector *y_local = hypre_ParVectorLocalVector(y_vec); - //HYPRE_Real *y_data = hypre_VectorData(y_local); - hypre_ParVector *xtemp = hypre_ParILUDataUTemp(ilu_data); - hypre_Vector *xtemp_local = hypre_ParVectorLocalVector(xtemp); - HYPRE_Real *xtemp_data = hypre_VectorData(xtemp_local); - hypre_ParVector *ytemp = hypre_ParILUDataYTemp(ilu_data); - hypre_Vector *ytemp_local = hypre_ParVectorLocalVector(ytemp); - HYPRE_Real *ytemp_data = hypre_VectorData(ytemp_local); - - hypre_Vector *xtemp_upper = hypre_SeqVectorCreate(nLU); - hypre_VectorOwnsData(xtemp_upper) = 0; - hypre_VectorData(xtemp_upper) = xtemp_data; + nLU = hypre_CSRMatrixNumRows(C); + xtemp_upper = hypre_SeqVectorCreate(nLU); + hypre_VectorOwnsData(xtemp_upper) = 0; + hypre_VectorData(xtemp_upper) = xtemp_data; hypre_SeqVectorInitialize(xtemp_upper); - HYPRE_Real zero = 0.0; - HYPRE_Real one = 1.0; - HYPRE_Real mone = -1.0; - /* first step, compute EB^{-1}F*x put in y */ /* -Fx */ - hypre_CSRMatrixMatvec(mone, iLF, x_local, zero, xtemp_upper); + hypre_CSRMatrixMatvec(-1.0, iLF, x_local, 0.0, xtemp_upper); + /* -L^{-1}Fx */ - if(isDoublePrecision) - { - /* L solve */ - HYPRE_CUSPARSE_CALL(cusparseDcsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - nLU, BLU_nnz, (hypre_double *) &one, matL_des, - (hypre_double *) BLU_data, BLU_i, BLU_j, matBL_info, - (hypre_double *) xtemp_data, (hypre_double *) ytemp_data, ilu_solve_policy, ilu_solve_buffer)); - } - else if(isSinglePrecision) - { - /* L solve */ - HYPRE_CUSPARSE_CALL(cusparseScsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - nLU, BLU_nnz, (float *) &one, matL_des, - (float *) BLU_data, BLU_i, BLU_j, matBL_info, - (float *) xtemp_data, (float *) ytemp_data, ilu_solve_policy, ilu_solve_buffer)); - } + /* L solve */ + hypre_CSRMatrixTriLowerUpperSolveDevice('L', 1, BLU, NULL, xtemp_local, ytemp_local); + /* -U^{-1}L^{-1}Fx */ - if(isDoublePrecision) - { - /* U solve */ - HYPRE_CUSPARSE_CALL(cusparseDcsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - nLU, BLU_nnz, (hypre_double *) &one, matU_des, - (hypre_double *) BLU_data, BLU_i, BLU_j, matBU_info, - (hypre_double *) ytemp_data, (hypre_double *) xtemp_data, ilu_solve_policy, ilu_solve_buffer)); - } - else if(isSinglePrecision) - { - /* U solve */ - HYPRE_CUSPARSE_CALL(cusparseScsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - nLU, BLU_nnz, (float *) &one, matU_des, - (float *) BLU_data, BLU_i, BLU_j, matBU_info, - (float *) ytemp_data, (float *) xtemp_data, ilu_solve_policy, ilu_solve_buffer)); - } + /* U solve */ + hypre_CSRMatrixTriLowerUpperSolveDevice('U', 0, BLU, NULL, ytemp_local, xtemp_local); + /* - alpha EU^{-1}L^{-1}Fx + beta * y */ - hypre_CSRMatrixMatvec( alpha, EiU, xtemp_upper, beta, y_local); - /* alpha * C - alpha EU^{-1}L^{-1}Fx + beta y */ - hypre_CSRMatrixMatvec( alpha, C, x_local, one, y_local); + hypre_CSRMatrixMatvec(alpha, EiU, xtemp_upper, beta, y_local); - /* over */ + /* alpha * C - alpha EU^{-1}L^{-1}Fx + beta y */ + hypre_CSRMatrixMatvec(alpha, C, x_local, 1.0, y_local); hypre_SeqVectorDestroy(xtemp_upper); - } - break; - case 0: default: - { + break; + + case 0: default: /* S = R * A * P */ + nLU = hypre_CSRMatrixNumRows(BLU); + m = n - nLU; + xtemp_upper = hypre_SeqVectorCreate(nLU); + ytemp_upper = hypre_SeqVectorCreate(nLU); + ytemp_lower = hypre_SeqVectorCreate(m); + hypre_VectorOwnsData(xtemp_upper) = 0; + hypre_VectorOwnsData(ytemp_upper) = 0; + hypre_VectorOwnsData(ytemp_lower) = 0; + hypre_VectorData(xtemp_upper) = xtemp_data; + hypre_VectorData(ytemp_upper) = ytemp_data; + hypre_VectorData(ytemp_lower) = ytemp_data + nLU; - hypre_ParCSRMatrix *Aperm = hypre_ParILUDataAperm(ilu_data); - - cusparseHandle_t handle = hypre_HandleCusparseHandle(hypre_handle()); - cusparseMatDescr_t matL_des = hypre_ParILUDataMatLMatrixDescription(ilu_data); - cusparseMatDescr_t matU_des = hypre_ParILUDataMatUMatrixDescription(ilu_data); - void *ilu_solve_buffer = hypre_ParILUDataILUSolveBuffer(ilu_data);//device memory - cusparseSolvePolicy_t ilu_solve_policy = hypre_ParILUDataILUSolvePolicy(ilu_data); - - HYPRE_Int isDoublePrecision = sizeof(HYPRE_Complex) == sizeof(hypre_double); - HYPRE_Int isSinglePrecision = sizeof(HYPRE_Complex) == sizeof(hypre_double) / 2; - - hypre_assert(isDoublePrecision || isSinglePrecision); - - hypre_CSRMatrix *EiU = hypre_ParILUDataMatEDevice(ilu_data); - hypre_CSRMatrix *iLF = hypre_ParILUDataMatFDevice(ilu_data); - hypre_CSRMatrix *BLU = hypre_ParILUDataMatBILUDevice(ilu_data); - HYPRE_Int *BLU_i = hypre_CSRMatrixI(BLU); - HYPRE_Int *BLU_j = hypre_CSRMatrixJ(BLU); - HYPRE_Real *BLU_data = hypre_CSRMatrixData(BLU); - HYPRE_Int BLU_nnz = hypre_CSRMatrixNumNonzeros(BLU); - - csrsv2Info_t matBL_info = hypre_ParILUDataMatBLILUSolveInfo(ilu_data); - csrsv2Info_t matBU_info = hypre_ParILUDataMatBUILUSolveInfo(ilu_data); - - HYPRE_Int n = hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(Aperm)); - HYPRE_Int nLU = hypre_CSRMatrixNumRows(BLU); - HYPRE_Int m = n - nLU; - - hypre_ParVector *x_vec = (hypre_ParVector *) x; - hypre_Vector *x_local = hypre_ParVectorLocalVector(x_vec); - HYPRE_Real *x_data = hypre_VectorData(x_local); - hypre_ParVector *y_vec = (hypre_ParVector *) y; - hypre_Vector *y_local = hypre_ParVectorLocalVector(y_vec); - //HYPRE_Real *y_data = hypre_VectorData(y_local); - hypre_ParVector *xtemp = hypre_ParILUDataUTemp(ilu_data); - hypre_Vector *xtemp_local = hypre_ParVectorLocalVector(xtemp); - HYPRE_Real *xtemp_data = hypre_VectorData(xtemp_local); - hypre_ParVector *ytemp = hypre_ParILUDataYTemp(ilu_data); - hypre_Vector *ytemp_local = hypre_ParVectorLocalVector(ytemp); - HYPRE_Real *ytemp_data = hypre_VectorData(ytemp_local); - - hypre_Vector *xtemp_upper = hypre_SeqVectorCreate(nLU); - hypre_Vector *ytemp_upper = hypre_SeqVectorCreate(nLU); - hypre_Vector *ytemp_lower = hypre_SeqVectorCreate(m); - hypre_VectorOwnsData(xtemp_upper) = 0; - hypre_VectorOwnsData(ytemp_upper) = 0; - hypre_VectorOwnsData(ytemp_lower) = 0; - hypre_VectorData(xtemp_upper) = xtemp_data; - hypre_VectorData(ytemp_upper) = ytemp_data; - hypre_VectorData(ytemp_lower) = ytemp_data+nLU; hypre_SeqVectorInitialize(xtemp_upper); hypre_SeqVectorInitialize(ytemp_upper); hypre_SeqVectorInitialize(ytemp_lower); - HYPRE_Real zero = 0.0; - HYPRE_Real one = 1.0; - HYPRE_Real mone = -1.0; - /* first step, compute P*x put in y */ /* -L^{-1}Fx */ - hypre_CSRMatrixMatvec(mone, iLF, x_local, zero, xtemp_upper); + hypre_CSRMatrixMatvec(-1.0, iLF, x_local, 0.0, xtemp_upper); /* -U{-1}L^{-1}Fx */ - if(nLU > 0) - { - if(isDoublePrecision) - { - /* U solve */ - HYPRE_CUSPARSE_CALL(cusparseDcsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - nLU, BLU_nnz, (hypre_double *) &one, matU_des, - (hypre_double *) BLU_data, BLU_i, BLU_j, matBU_info, - (hypre_double *) xtemp_data, (hypre_double *) ytemp_data, ilu_solve_policy, ilu_solve_buffer)); - } - else if(isSinglePrecision) - { - /* U solve */ - HYPRE_CUSPARSE_CALL(cusparseScsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - nLU, BLU_nnz, (float *) &one, matU_des, - (float *) BLU_data, BLU_i, BLU_j, matBU_info, - (float *) xtemp_data, (float *) ytemp_data, ilu_solve_policy, ilu_solve_buffer)); - } - } + /* U solve */ + hypre_CSRMatrixTriLowerUpperSolveDevice('U', 0, BLU, NULL, xtemp_local, ytemp_local); + /* now copy data to y_lower */ - hypre_TMemcpy( ytemp_data + nLU, x_data, HYPRE_Real, m, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(ytemp_data + nLU, x_data, HYPRE_Real, m, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); /* second step, compute A*P*x store in xtemp */ - hypre_ParCSRMatrixMatvec( one, Aperm, ytemp, zero, xtemp); + hypre_ParCSRMatrixMatvec(1.0, Aperm, ytemp, 0.0, xtemp); /* third step, compute R*A*P*x */ /* copy partial data in */ - hypre_TMemcpy( ytemp_data+nLU, xtemp_data + nLU, HYPRE_Real, m, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(ytemp_data + nLU, xtemp_data + nLU, HYPRE_Real, m, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); /* solve L^{-1} */ - if(nLU > 0) - { - if(isDoublePrecision) - { - /* L solve */ - HYPRE_CUSPARSE_CALL(cusparseDcsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - nLU, BLU_nnz, (hypre_double *) &one, matL_des, - (hypre_double *) BLU_data, BLU_i, BLU_j, matBL_info, - (hypre_double *) xtemp_data, (hypre_double *) ytemp_data, ilu_solve_policy, ilu_solve_buffer)); - } - else if(isSinglePrecision) - { - /* L solve */ - HYPRE_CUSPARSE_CALL(cusparseScsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - nLU, BLU_nnz, (float *) &one, matL_des, - (float *) BLU_data, BLU_i, BLU_j, matBL_info, - (float *) xtemp_data, (float *) ytemp_data, ilu_solve_policy, ilu_solve_buffer)); - } - } + /* L solve */ + hypre_CSRMatrixTriLowerUpperSolveDevice('L', 1, BLU, NULL, xtemp_local, ytemp_local); + /* -EU^{-1}L^{-1} */ - hypre_CSRMatrixMatvec(mone * alpha, EiU, ytemp_upper, beta, y_local); + hypre_CSRMatrixMatvec(-alpha, EiU, ytemp_upper, beta, y_local); hypre_SeqVectorAxpy(alpha, ytemp_lower, y_local); /* over */ hypre_SeqVectorDestroy(xtemp_upper); hypre_SeqVectorDestroy(ytemp_upper); hypre_SeqVectorDestroy(ytemp_lower); - } - break; - } + break; + } /* switch (test_opt) */ return hypre_error_flag; } -/*-------------------------------------------------------------------------- - * hypre_ParILUCusparseSchurGMRESMatvecDestroy - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_ParILURAPSchurGMRESMatvecDestroy( void *matvec_data ) -{ - return 0; -} - -#else - -HYPRE_Int -hypre_ParILURAPSchurGMRESDummySetupH(void *a, void *b, void *c, void *d) -{ - /* Null GMRES setup, does nothing */ - return 0; -} +#endif /* if defined(HYPRE_USING_GPU) */ /*-------------------------------------------------------------------------- - * hypre_ParILUCusparseSchurGMRESDummySolve + * hypre_ParILURAPSchurGMRESSolveHost *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_ParILURAPSchurGMRESSolveH( void *ilu_vdata, - void *ilu_vdata2, - hypre_ParVector *f, - hypre_ParVector *u ) +hypre_ParILURAPSchurGMRESSolveHost( void *ilu_vdata, + void *ilu_vdata2, + hypre_ParVector *f, + hypre_ParVector *u ) { - /* Unit GMRES preconditioner, just copy data from one slot to another */ - hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; - - HYPRE_Int i, j, k1, k2, col; - - hypre_ParCSRMatrix *L = hypre_ParILUDataMatLModified(ilu_data); - hypre_CSRMatrix *L_diag = hypre_ParCSRMatrixDiag(L); - HYPRE_Int *L_diag_i = hypre_CSRMatrixI(L_diag); - HYPRE_Int *L_diag_j = hypre_CSRMatrixJ(L_diag); - HYPRE_Real *L_diag_data = hypre_CSRMatrixData(L_diag); - HYPRE_Real *D = hypre_ParILUDataMatDModified(ilu_data); - hypre_ParCSRMatrix *U = hypre_ParILUDataMatUModified(ilu_data); - hypre_CSRMatrix *U_diag = hypre_ParCSRMatrixDiag(U); - HYPRE_Int *U_diag_i = hypre_CSRMatrixI(U_diag); - HYPRE_Int *U_diag_j = hypre_CSRMatrixJ(U_diag); - HYPRE_Real *U_diag_data = hypre_CSRMatrixData(U_diag); - - HYPRE_Int n = hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(L)); - HYPRE_Int nLU = hypre_ParILUDataNLU(ilu_data); - HYPRE_Int m = n - nLU; - - hypre_Vector *f_local = hypre_ParVectorLocalVector(f); - HYPRE_Real *f_data = hypre_VectorData(f_local); - hypre_Vector *u_local = hypre_ParVectorLocalVector(u); - HYPRE_Real *u_data = hypre_VectorData(u_local); - - hypre_ParVector *utemp = hypre_ParILUDataUTemp(ilu_data); - hypre_Vector *utemp_local = hypre_ParVectorLocalVector(utemp); - HYPRE_Real *utemp_data = hypre_VectorData(utemp_local); - - HYPRE_Int *u_end = hypre_ParILUDataUEnd(ilu_data); + HYPRE_UNUSED_VAR(ilu_vdata2); + + hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; + hypre_ParCSRMatrix *L = hypre_ParILUDataMatLModified(ilu_data); + hypre_CSRMatrix *L_diag = hypre_ParCSRMatrixDiag(L); + HYPRE_Int *L_diag_i = hypre_CSRMatrixI(L_diag); + HYPRE_Int *L_diag_j = hypre_CSRMatrixJ(L_diag); + HYPRE_Real *L_diag_data = hypre_CSRMatrixData(L_diag); + + HYPRE_Real *D = hypre_ParILUDataMatDModified(ilu_data); + + hypre_ParCSRMatrix *U = hypre_ParILUDataMatUModified(ilu_data); + hypre_CSRMatrix *U_diag = hypre_ParCSRMatrixDiag(U); + HYPRE_Int *U_diag_i = hypre_CSRMatrixI(U_diag); + HYPRE_Int *U_diag_j = hypre_CSRMatrixJ(U_diag); + HYPRE_Real *U_diag_data = hypre_CSRMatrixData(U_diag); + + HYPRE_Int n = hypre_CSRMatrixNumRows(L_diag); + HYPRE_Int nLU = hypre_ParILUDataNLU(ilu_data); + HYPRE_Int m = n - nLU; + + hypre_Vector *f_local = hypre_ParVectorLocalVector(f); + HYPRE_Real *f_data = hypre_VectorData(f_local); + hypre_Vector *u_local = hypre_ParVectorLocalVector(u); + HYPRE_Real *u_data = hypre_VectorData(u_local); + hypre_ParVector *utemp = hypre_ParILUDataUTemp(ilu_data); + hypre_Vector *utemp_local = hypre_ParVectorLocalVector(utemp); + HYPRE_Real *utemp_data = hypre_VectorData(utemp_local); + HYPRE_Int *u_end = hypre_ParILUDataUEnd(ilu_data); + + HYPRE_Int i, j, k1, k2, col; /* permuted L solve */ - for(i = 0 ; i < m ; i ++) + for (i = 0 ; i < m ; i ++) { utemp_data[i] = f_data[i]; - k1 = u_end[i+nLU] ; k2 = L_diag_i[i+nLU+1]; - for(j = k1 ; j < k2 ; j ++) + k1 = u_end[i + nLU] ; k2 = L_diag_i[i + nLU + 1]; + for (j = k1 ; j < k2 ; j ++) { col = L_diag_j[j]; - utemp_data[i] -= L_diag_data[j] * utemp_data[col-nLU]; + utemp_data[i] -= L_diag_data[j] * utemp_data[col - nLU]; } } /* U solve */ - for(i = m-1 ; i >= 0 ; i --) + for (i = m - 1 ; i >= 0 ; i --) { u_data[i] = utemp_data[i]; - k1 = U_diag_i[i+nLU] ; k2 = U_diag_i[i+1+nLU]; - for(j = k1 ; j < k2 ; j ++) + k1 = U_diag_i[i + nLU] ; k2 = U_diag_i[i + 1 + nLU]; + for (j = k1 ; j < k2 ; j ++) { col = U_diag_j[j]; - u_data[i] -= U_diag_data[j] * u_data[col-nLU]; + u_data[i] -= U_diag_data[j] * u_data[col - nLU]; } u_data[i] *= D[i]; } - return hypre_error_flag; } /*-------------------------------------------------------------------------- - * hypre_ParILUCusparseSchurGMRESCommInfo + * hypre_ParILURAPSchurGMRESCommInfoHost *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_ParILURAPSchurGMRESCommInfoH( void *ilu_vdata, HYPRE_Int *my_id, HYPRE_Int *num_procs) +hypre_ParILURAPSchurGMRESCommInfoHost(void *ilu_vdata, + HYPRE_Int *my_id, + HYPRE_Int *num_procs) { /* get comm info from ilu_data */ - hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; - hypre_ParCSRMatrix *A = hypre_ParILUDataMatA(ilu_data); - MPI_Comm comm = hypre_ParCSRMatrixComm ( A ); - hypre_MPI_Comm_size(comm,num_procs); - hypre_MPI_Comm_rank(comm,my_id); - return 0; -} + hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; + hypre_ParCSRMatrix *A = hypre_ParILUDataMatA(ilu_data); + MPI_Comm comm = hypre_ParCSRMatrixComm(A); -/*-------------------------------------------------------------------------- - * hypre_ParILUCusparseSchurGMRESMatvecCreate - *--------------------------------------------------------------------------*/ + hypre_MPI_Comm_size(comm, num_procs); + hypre_MPI_Comm_rank(comm, my_id); -void * -hypre_ParILURAPSchurGMRESMatvecCreateH( void *ilu_vdata, - void *x ) -{ - /* Null matvec create */ - void *matvec_data; - matvec_data = NULL; - return ( matvec_data ); + return hypre_error_flag; } /*-------------------------------------------------------------------------- - * hypre_ParILUCusparseSchurGMRESMatvec + * hypre_ParILURAPSchurGMRESMatvecHost + * + * Compute y = alpha * S * x + beta * y + * + * TODO (VPM): Unify this function with hypre_ParILURAPSchurGMRESMatvecDevice *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_ParILURAPSchurGMRESMatvecH( void *matvec_data, - HYPRE_Complex alpha, - void *ilu_vdata, - void *x, - HYPRE_Complex beta, - void *y ) +hypre_ParILURAPSchurGMRESMatvecHost( void *matvec_data, + HYPRE_Complex alpha, + void *ilu_vdata, + void *x, + HYPRE_Complex beta, + void *y ) { - /* Compute y = alpha * S * x + beta * y - * */ - HYPRE_Int i, j, k1, k2, col; - HYPRE_Real one = 1.0; - HYPRE_Real zero = 0.0; + HYPRE_UNUSED_VAR(matvec_data); /* get matrix information first */ hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; @@ -3665,17 +3435,21 @@ hypre_ParILURAPSchurGMRESMatvecH( void *matvec_data, hypre_Vector *y_local = hypre_ParVectorLocalVector(y_vec); HYPRE_Real *y_data = hypre_VectorData(y_local); - hypre_ParVector *utemp = hypre_ParILUDataUTemp(ilu_data); - hypre_Vector *utemp_local = hypre_ParVectorLocalVector(utemp); - HYPRE_Real *utemp_data = hypre_VectorData(utemp_local); + hypre_ParVector *utemp = hypre_ParILUDataUTemp(ilu_data); + hypre_Vector *utemp_local = hypre_ParVectorLocalVector(utemp); + HYPRE_Real *utemp_data = hypre_VectorData(utemp_local); + + hypre_ParVector *ftemp = hypre_ParILUDataFTemp(ilu_data); + hypre_Vector *ftemp_local = hypre_ParVectorLocalVector(ftemp); + HYPRE_Real *ftemp_data = hypre_VectorData(ftemp_local); - hypre_ParVector *ftemp = hypre_ParILUDataFTemp(ilu_data); - hypre_Vector *ftemp_local = hypre_ParVectorLocalVector(ftemp); - HYPRE_Real *ftemp_data = hypre_VectorData(ftemp_local); + hypre_ParVector *ytemp = hypre_ParILUDataYTemp(ilu_data); + hypre_Vector *ytemp_local = hypre_ParVectorLocalVector(ytemp); + HYPRE_Real *ytemp_data = hypre_VectorData(ytemp_local); - hypre_ParVector *ytemp = hypre_ParILUDataYTemp(ilu_data); - hypre_Vector *ytemp_local = hypre_ParVectorLocalVector(ytemp); - HYPRE_Real *ytemp_data = hypre_VectorData(ytemp_local); + HYPRE_Int i, j, k1, k2, col; + HYPRE_Real one = 1.0; + HYPRE_Real zero = 0.0; /* S = R * A * P */ /* matvec */ @@ -3684,22 +3458,22 @@ hypre_ParILURAPSchurGMRESMatvecH( void *matvec_data, * [ I ] */ /* matvec */ - for(i = 0 ; i < nLU ; i ++) + for (i = 0 ; i < nLU ; i ++) { ytemp_data[i] = 0.0; - k1 = u_end[i] ; k2 = mU_diag_i[i+1]; - for(j = k1 ; j < k2 ; j ++) + k1 = u_end[i] ; k2 = mU_diag_i[i + 1]; + for (j = k1 ; j < k2 ; j ++) { col = mU_diag_j[j]; - ytemp_data[i] -= alpha * mU_diag_data[j] * x_data[col-nLU]; + ytemp_data[i] -= alpha * mU_diag_data[j] * x_data[col - nLU]; } } /* U solve */ - for(i = nLU-1 ; i >= 0 ; i --) + for (i = nLU - 1 ; i >= 0 ; i --) { ftemp_data[perm[i]] = ytemp_data[i]; k1 = mU_diag_i[i] ; k2 = u_end[i]; - for(j = k1 ; j < k2 ; j ++) + for (j = k1 ; j < k2 ; j ++) { col = mU_diag_j[j]; ftemp_data[perm[i]] -= mU_diag_data[j] * ftemp_data[perm[col]]; @@ -3708,9 +3482,9 @@ hypre_ParILURAPSchurGMRESMatvecH( void *matvec_data, } /* update with I */ - for(i = nLU ; i < n ; i ++) + for (i = nLU ; i < n ; i ++) { - ftemp_data[perm[i]] = alpha * x_data[i-nLU]; + ftemp_data[perm[i]] = alpha * x_data[i - nLU]; } /* apply alpha*A*P*x */ @@ -3719,11 +3493,11 @@ hypre_ParILURAPSchurGMRESMatvecH( void *matvec_data, // R = [-L21 L\inv, I] /* first is L solve */ - for(i = 0 ; i < nLU ; i ++) + for (i = 0 ; i < nLU ; i ++) { ytemp_data[i] = utemp_data[perm[i]]; - k1 = mL_diag_i[i] ; k2 = mL_diag_i[i+1]; - for(j = k1 ; j < k2 ; j ++) + k1 = mL_diag_i[i] ; k2 = mL_diag_i[i + 1]; + for (j = k1 ; j < k2 ; j ++) { col = mL_diag_j[j]; ytemp_data[i] -= mL_diag_data[j] * ytemp_data[col]; @@ -3731,11 +3505,11 @@ hypre_ParILURAPSchurGMRESMatvecH( void *matvec_data, } /* apply -W * utemp on this, and take care of the I part */ - for(i = nLU ; i < n ; i ++) + for (i = nLU ; i < n ; i ++) { y_data[i - nLU] = beta * y_data[i - nLU] + utemp_data[perm[i]]; k1 = mL_diag_i[i] ; k2 = u_end[i]; - for(j = k1 ; j < k2 ; j ++) + for (j = k1 ; j < k2 ; j ++) { col = mL_diag_j[j]; y_data[i - nLU] -= mL_diag_data[j] * ytemp_data[col]; @@ -3745,23 +3519,19 @@ hypre_ParILURAPSchurGMRESMatvecH( void *matvec_data, return hypre_error_flag; } +/****************************************************************************** + * + * NSH create and solve and help functions. + * + * TODO (VPM): Move NSH code to separate files? + *****************************************************************************/ + /*-------------------------------------------------------------------------- - * hypre_ParILUCusparseSchurGMRESMatvecDestroy + * hypre_NSHCreate *--------------------------------------------------------------------------*/ -HYPRE_Int -hypre_ParILURAPSchurGMRESMatvecDestroyH( void *matvec_data ) -{ - return 0; -} - -#endif - -/* NSH create and solve and help functions */ - -/* Create */ void * -hypre_NSHCreate() +hypre_NSHCreate( void ) { hypre_ParNSHData *nsh_data; @@ -3783,7 +3553,7 @@ hypre_NSHCreate() hypre_ParNSHDataMaxIter(nsh_data) = 5; hypre_ParNSHDataOperatorComplexity(nsh_data) = 0.0; - hypre_ParNSHDataDroptol(nsh_data) = hypre_TAlloc(HYPRE_Real,2,HYPRE_MEMORY_HOST); + hypre_ParNSHDataDroptol(nsh_data) = hypre_TAlloc(HYPRE_Real, 2, HYPRE_MEMORY_HOST); hypre_ParNSHDataOwnDroptolData(nsh_data) = 1; hypre_ParNSHDataDroptol(nsh_data)[0] = 1.0e-02;/* droptol for MR */ hypre_ParNSHDataDroptol(nsh_data)[1] = 1.0e-02;/* droptol for NSH */ @@ -3804,59 +3574,44 @@ hypre_NSHCreate() return (void *) nsh_data; } -/* Destroy */ +/*-------------------------------------------------------------------------- + * hypre_NSHDestroy + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_NSHDestroy( void *data ) { hypre_ParNSHData * nsh_data = (hypre_ParNSHData*) data; /* residual */ - if(hypre_ParNSHDataResidual(nsh_data)) - { - hypre_ParVectorDestroy( hypre_ParNSHDataResidual(nsh_data) ); - hypre_ParNSHDataResidual(nsh_data) = NULL; - } + hypre_ParVectorDestroy( hypre_ParNSHDataResidual(nsh_data) ); + hypre_ParNSHDataResidual(nsh_data) = NULL; /* residual norms */ - if(hypre_ParNSHDataRelResNorms(nsh_data)) - { - hypre_TFree( hypre_ParNSHDataRelResNorms(nsh_data), HYPRE_MEMORY_HOST ); - hypre_ParNSHDataRelResNorms(nsh_data) = NULL; - } + hypre_TFree( hypre_ParNSHDataRelResNorms(nsh_data), HYPRE_MEMORY_HOST ); + hypre_ParNSHDataRelResNorms(nsh_data) = NULL; /* l1 norms */ - if(hypre_ParNSHDataL1Norms(nsh_data)) - { - hypre_TFree( hypre_ParNSHDataL1Norms(nsh_data), HYPRE_MEMORY_HOST ); - hypre_ParNSHDataL1Norms(nsh_data) = NULL; - } + hypre_TFree( hypre_ParNSHDataL1Norms(nsh_data), HYPRE_MEMORY_HOST ); + hypre_ParNSHDataL1Norms(nsh_data) = NULL; /* temp arrays */ - if(hypre_ParNSHDataUTemp(nsh_data)) - { - hypre_ParVectorDestroy( hypre_ParNSHDataUTemp(nsh_data) ); - hypre_ParNSHDataUTemp(nsh_data) = NULL; - } - if(hypre_ParNSHDataFTemp(nsh_data)) - { - hypre_ParVectorDestroy( hypre_ParNSHDataFTemp(nsh_data) ); - hypre_ParNSHDataFTemp(nsh_data) = NULL; - } + hypre_ParVectorDestroy( hypre_ParNSHDataUTemp(nsh_data) ); + hypre_ParVectorDestroy( hypre_ParNSHDataFTemp(nsh_data) ); + hypre_ParNSHDataUTemp(nsh_data) = NULL; + hypre_ParNSHDataFTemp(nsh_data) = NULL; /* approx inverse matrix */ - if(hypre_ParNSHDataMatM(nsh_data)) - { - hypre_ParCSRMatrixDestroy( hypre_ParNSHDataMatM(nsh_data) ); - hypre_ParNSHDataMatM(nsh_data) = NULL; - } + hypre_ParCSRMatrixDestroy( hypre_ParNSHDataMatM(nsh_data) ); + hypre_ParNSHDataMatM(nsh_data) = NULL; /* droptol array */ - if(hypre_ParNSHDataOwnDroptolData(nsh_data)) - { - hypre_TFree(hypre_ParNSHDataDroptol(nsh_data), HYPRE_MEMORY_HOST); - hypre_ParNSHDataOwnDroptolData(nsh_data) = 0; - hypre_ParNSHDataDroptol(nsh_data) = NULL; - } + if (hypre_ParNSHDataOwnDroptolData(nsh_data)) + { + hypre_TFree(hypre_ParNSHDataDroptol(nsh_data), HYPRE_MEMORY_HOST); + hypre_ParNSHDataOwnDroptolData(nsh_data) = 0; + hypre_ParNSHDataDroptol(nsh_data) = NULL; + } /* nsh data */ hypre_TFree(nsh_data, HYPRE_MEMORY_HOST); @@ -3864,27 +3619,36 @@ hypre_NSHDestroy( void *data ) return hypre_error_flag; } -/* Print solver params */ +/*-------------------------------------------------------------------------- + * hypre_NSHWriteSolverParams + * + * Print solver params + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_NSHWriteSolverParams(void *nsh_vdata) +hypre_NSHWriteSolverParams( void *nsh_vdata ) { hypre_ParNSHData *nsh_data = (hypre_ParNSHData*) nsh_vdata; - hypre_printf("Newton–Schulz–Hotelling Setup parameters: \n"); + hypre_printf("Newton-Schulz-Hotelling Setup parameters: \n"); hypre_printf("NSH max iterations = %d \n", hypre_ParNSHDataNSHMaxIter(nsh_data)); hypre_printf("NSH drop tolerance = %e \n", hypre_ParNSHDataDroptol(nsh_data)[1]); hypre_printf("NSH max nnz per row = %d \n", hypre_ParNSHDataNSHMaxRowNnz(nsh_data)); hypre_printf("MR max iterations = %d \n", hypre_ParNSHDataMRMaxIter(nsh_data)); hypre_printf("MR drop tolerance = %e \n", hypre_ParNSHDataDroptol(nsh_data)[0]); hypre_printf("MR max nnz per row = %d \n", hypre_ParNSHDataMRMaxRowNnz(nsh_data)); - hypre_printf("Operator Complexity (Fill factor) = %f \n", hypre_ParNSHDataOperatorComplexity(nsh_data)); - hypre_printf("\n Newton–Schulz–Hotelling Solver Parameters: \n"); + hypre_printf("Operator Complexity (Fill factor) = %f \n", + hypre_ParNSHDataOperatorComplexity(nsh_data)); + hypre_printf("\n Newton-Schulz-Hotelling Solver Parameters: \n"); hypre_printf("Max number of iterations: %d\n", hypre_ParNSHDataMaxIter(nsh_data)); hypre_printf("Stopping tolerance: %e\n", hypre_ParNSHDataTol(nsh_data)); return hypre_error_flag; } -/* set print level */ +/*-------------------------------------------------------------------------- + * hypre_NSHSetPrintLevel + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_NSHSetPrintLevel( void *nsh_vdata, HYPRE_Int print_level ) { @@ -3892,7 +3656,11 @@ hypre_NSHSetPrintLevel( void *nsh_vdata, HYPRE_Int print_level ) hypre_ParNSHDataPrintLevel(nsh_data) = print_level; return hypre_error_flag; } -/* set logging level */ + +/*-------------------------------------------------------------------------- + * hypre_NSHSetLogging + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_NSHSetLogging( void *nsh_vdata, HYPRE_Int logging ) { @@ -3900,7 +3668,11 @@ hypre_NSHSetLogging( void *nsh_vdata, HYPRE_Int logging ) hypre_ParNSHDataLogging(nsh_data) = logging; return hypre_error_flag; } -/* set max iteration */ + +/*-------------------------------------------------------------------------- + * hypre_NSHSetMaxIter + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_NSHSetMaxIter( void *nsh_vdata, HYPRE_Int max_iter ) { @@ -3908,7 +3680,11 @@ hypre_NSHSetMaxIter( void *nsh_vdata, HYPRE_Int max_iter ) hypre_ParNSHDataMaxIter(nsh_data) = max_iter; return hypre_error_flag; } -/* set solver iteration tol */ + +/*-------------------------------------------------------------------------- + * hypre_NSHSetTol + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_NSHSetTol( void *nsh_vdata, HYPRE_Real tol ) { @@ -3916,7 +3692,11 @@ hypre_NSHSetTol( void *nsh_vdata, HYPRE_Real tol ) hypre_ParNSHDataTol(nsh_data) = tol; return hypre_error_flag; } -/* set global solver */ + +/*-------------------------------------------------------------------------- + * hypre_NSHSetGlobalSolver + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_NSHSetGlobalSolver( void *nsh_vdata, HYPRE_Int global_solver ) { @@ -3924,7 +3704,11 @@ hypre_NSHSetGlobalSolver( void *nsh_vdata, HYPRE_Int global_solver ) hypre_ParNSHDataGlobalSolver(nsh_data) = global_solver; return hypre_error_flag; } -/* set all droptols */ + +/*-------------------------------------------------------------------------- + * hypre_NSHSetDropThreshold + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_NSHSetDropThreshold( void *nsh_vdata, HYPRE_Real droptol ) { @@ -3933,20 +3717,28 @@ hypre_NSHSetDropThreshold( void *nsh_vdata, HYPRE_Real droptol ) hypre_ParNSHDataDroptol(nsh_data)[1] = droptol; return hypre_error_flag; } -/* set array of droptols */ + +/*-------------------------------------------------------------------------- + * hypre_NSHSetDropThresholdArray + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_NSHSetDropThresholdArray( void *nsh_vdata, HYPRE_Real *droptol ) { hypre_ParNSHData *nsh_data = (hypre_ParNSHData*) nsh_vdata; - if(hypre_ParNSHDataOwnDroptolData(nsh_data)) + if (hypre_ParNSHDataOwnDroptolData(nsh_data)) { - hypre_TFree(hypre_ParNSHDataDroptol(nsh_data),HYPRE_MEMORY_HOST); + hypre_TFree(hypre_ParNSHDataDroptol(nsh_data), HYPRE_MEMORY_HOST); hypre_ParNSHDataOwnDroptolData(nsh_data) = 0; } hypre_ParNSHDataDroptol(nsh_data) = droptol; return hypre_error_flag; } -/* set MR max iter */ + +/*-------------------------------------------------------------------------- + * hypre_NSHSetMRMaxIter + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_NSHSetMRMaxIter( void *nsh_vdata, HYPRE_Int mr_max_iter ) { @@ -3954,7 +3746,11 @@ hypre_NSHSetMRMaxIter( void *nsh_vdata, HYPRE_Int mr_max_iter ) hypre_ParNSHDataMRMaxIter(nsh_data) = mr_max_iter; return hypre_error_flag; } -/* set MR tol */ + +/*-------------------------------------------------------------------------- + * hypre_NSHSetMRTol + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_NSHSetMRTol( void *nsh_vdata, HYPRE_Real mr_tol ) { @@ -3962,7 +3758,11 @@ hypre_NSHSetMRTol( void *nsh_vdata, HYPRE_Real mr_tol ) hypre_ParNSHDataMRTol(nsh_data) = mr_tol; return hypre_error_flag; } -/* set MR max nonzeros of a row */ + +/*-------------------------------------------------------------------------- + * hypre_NSHSetMRMaxRowNnz + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_NSHSetMRMaxRowNnz( void *nsh_vdata, HYPRE_Int mr_max_row_nnz ) { @@ -3970,7 +3770,13 @@ hypre_NSHSetMRMaxRowNnz( void *nsh_vdata, HYPRE_Int mr_max_row_nnz ) hypre_ParNSHDataMRMaxRowNnz(nsh_data) = mr_max_row_nnz; return hypre_error_flag; } -/* set MR version, column version or global version */ + +/*-------------------------------------------------------------------------- + * hypre_NSHSetColVersion + * + * set MR version, column version or global version + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_NSHSetColVersion( void *nsh_vdata, HYPRE_Int mr_col_version ) { @@ -3978,7 +3784,11 @@ hypre_NSHSetColVersion( void *nsh_vdata, HYPRE_Int mr_col_version ) hypre_ParNSHDataMRColVersion(nsh_data) = mr_col_version; return hypre_error_flag; } -/* set NSH max iter */ + +/*-------------------------------------------------------------------------- + * hypre_NSHSetNSHMaxIter + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_NSHSetNSHMaxIter( void *nsh_vdata, HYPRE_Int nsh_max_iter ) { @@ -3986,7 +3796,11 @@ hypre_NSHSetNSHMaxIter( void *nsh_vdata, HYPRE_Int nsh_max_iter ) hypre_ParNSHDataNSHMaxIter(nsh_data) = nsh_max_iter; return hypre_error_flag; } -/* set NSH tol */ + +/*-------------------------------------------------------------------------- + * hypre_NSHSetNSHTol + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_NSHSetNSHTol( void *nsh_vdata, HYPRE_Real nsh_tol ) { @@ -3994,7 +3808,13 @@ hypre_NSHSetNSHTol( void *nsh_vdata, HYPRE_Real nsh_tol ) hypre_ParNSHDataNSHTol(nsh_data) = nsh_tol; return hypre_error_flag; } -/* set NSH max nonzeros of a row */ + +/*-------------------------------------------------------------------------- + * hypre_NSHSetNSHMaxRowNnz + * + * Set NSH max nonzeros of a row + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_NSHSetNSHMaxRowNnz( void *nsh_vdata, HYPRE_Int nsh_max_row_nnz ) { @@ -4003,32 +3823,44 @@ hypre_NSHSetNSHMaxRowNnz( void *nsh_vdata, HYPRE_Int nsh_max_row_nnz ) return hypre_error_flag; } - -/* Compute the F norm of CSR matrix +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixNormFro + * + * Compute the F norm of CSR matrix * A: the target CSR matrix * norm_io: output - */ + * + * TODO (VPM): Move this function to seq_mv + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_CSRMatrixNormFro(hypre_CSRMatrix *A, HYPRE_Real *norm_io) { HYPRE_Real norm = 0.0; HYPRE_Real *data = hypre_CSRMatrixData(A); - HYPRE_Int i,k; + HYPRE_Int i, k; k = hypre_CSRMatrixNumNonzeros(A); + /* main loop */ - for(i = 0 ; i < k ; i ++) + for (i = 0 ; i < k ; i ++) { norm += data[i] * data[i]; } - *norm_io = sqrt(norm); - return hypre_error_flag; + *norm_io = hypre_sqrt(norm); + return hypre_error_flag; } -/* Compute the norm of I-A where I is identity matrix and A is a CSR matrix +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixResNormFro + * + * Compute the norm of I-A where I is identity matrix and A is a CSR matrix * A: the target CSR matrix * norm_io: the output - */ + * + * TODO (VPM): Move this function to seq_mv + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_CSRMatrixResNormFro(hypre_CSRMatrix *A, HYPRE_Real *norm_io) { @@ -4040,14 +3872,14 @@ hypre_CSRMatrixResNormFro(hypre_CSRMatrix *A, HYPRE_Real *norm_io) n = hypre_CSRMatrixNumRows(A); /* main loop to sum up data */ - for(i = 0 ; i < n ; i ++) + for (i = 0 ; i < n ; i ++) { k1 = idx[i]; - k2 = idx[i+1]; + k2 = idx[i + 1]; /* check if we have diagonal in A */ - if(k2 > k1) + if (k2 > k1) { - if(cols[k1] == i) + if (cols[k1] == i) { /* reduce 1 on diagonal */ value = data[k1] - 1.0; @@ -4066,18 +3898,25 @@ hypre_CSRMatrixResNormFro(hypre_CSRMatrix *A, HYPRE_Real *norm_io) norm += 1.0; } /* and the rest of the code */ - for(j = k1 + 1 ; j < k2 ; j ++) + for (j = k1 + 1 ; j < k2 ; j ++) { norm += data[j] * data[j]; } } - *norm_io = sqrt(norm); + *norm_io = hypre_sqrt(norm); return hypre_error_flag; } -/* Compute the F norm of ParCSR matrix + +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixNormFro + * + * Compute the F norm of ParCSR matrix * A: the target CSR matrix - */ + * + * TODO (VPM): Move this function to parcsr_mv + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_ParCSRMatrixNormFro(hypre_ParCSRMatrix *A, HYPRE_Real *norm_io) { @@ -4094,20 +3933,26 @@ hypre_ParCSRMatrixNormFro(hypre_ParCSRMatrix *A, HYPRE_Real *norm_io) /* square and sum them */ local_norm *= local_norm; - local_norm += global_norm*global_norm; + local_norm += global_norm * global_norm; /* do communication to get global total sum */ hypre_MPI_Allreduce(&local_norm, &global_norm, 1, HYPRE_MPI_REAL, hypre_MPI_SUM, comm); - *norm_io = sqrt(global_norm); - return hypre_error_flag; + *norm_io = hypre_sqrt(global_norm); + return hypre_error_flag; } -/* Compute the F norm of ParCSR matrix +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixResNormFro + * + * Compute the F norm of ParCSR matrix * Norm of I-A * A: the target CSR matrix - */ + * + * TODO (VPM): Move this function to parcsr_mv + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_ParCSRMatrixResNormFro(hypre_ParCSRMatrix *A, HYPRE_Real *norm_io) { @@ -4120,25 +3965,31 @@ hypre_ParCSRMatrixResNormFro(hypre_ParCSRMatrix *A, HYPRE_Real *norm_io) /* compute I-A for diagonal */ hypre_CSRMatrixResNormFro(A_diag, &local_norm); + /* use global_norm to store offd for now */ hypre_CSRMatrixNormFro(A_offd, &global_norm); /* square and sum them */ local_norm *= local_norm; - local_norm += global_norm*global_norm; + local_norm += global_norm * global_norm; /* do communication to get global total sum */ hypre_MPI_Allreduce(&local_norm, &global_norm, 1, HYPRE_MPI_REAL, hypre_MPI_SUM, comm); - *norm_io = sqrt(global_norm); + *norm_io = hypre_sqrt(global_norm); return hypre_error_flag; - } -/* Compute the trace of CSR matrix +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixTrace + * + * Compute the trace of CSR matrix * A: the target CSR matrix * trace_io: the output trace - */ + * + * TODO (VPM): Move this function to seq_mv + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_CSRMatrixTrace(hypre_CSRMatrix *A, HYPRE_Real *trace_io) { @@ -4146,13 +3997,14 @@ hypre_CSRMatrixTrace(hypre_CSRMatrix *A, HYPRE_Real *trace_io) HYPRE_Int *idx = hypre_CSRMatrixI(A); HYPRE_Int *cols = hypre_CSRMatrixJ(A); HYPRE_Real *data = hypre_CSRMatrixData(A); - HYPRE_Int i,k1,k2,n; + HYPRE_Int i, k1, k2, n; + n = hypre_CSRMatrixNumRows(A); - for(i = 0 ; i < n ; i ++) + for (i = 0 ; i < n ; i ++) { k1 = idx[i]; - k2 = idx[i+1]; - if(cols[k1] == i && k2 > k1) + k2 = idx[i + 1]; + if (cols[k1] == i && k2 > k1) { /* only add when diagonal is nonzero */ trace += data[k1]; @@ -4160,16 +4012,22 @@ hypre_CSRMatrixTrace(hypre_CSRMatrix *A, HYPRE_Real *trace_io) } *trace_io = trace; - return hypre_error_flag; + return hypre_error_flag; } -/* Apply dropping to CSR matrix +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixDropInplace + * + * Apply dropping to CSR matrix * A: the target CSR matrix * droptol: all entries have smaller absolute value than this will be dropped * max_row_nnz: max nonzeros allowed for each row, only largest max_row_nnz kept * we NEVER drop diagonal entry if exists - */ + * + * TODO (VPM): Move this function to seq_mv + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_CSRMatrixDropInplace(hypre_CSRMatrix *A, HYPRE_Real droptol, HYPRE_Int max_row_nnz) { @@ -4184,6 +4042,7 @@ hypre_CSRMatrixDropInplace(hypre_CSRMatrix *A, HYPRE_Real droptol, HYPRE_Int max HYPRE_Int *A_j = hypre_CSRMatrixJ(A); HYPRE_Real *A_data = hypre_CSRMatrixData(A); HYPRE_Real nnzA = hypre_CSRMatrixNumNonzeros(A); + HYPRE_MemoryLocation memory_location = hypre_CSRMatrixMemoryLocation(A); /* new data */ HYPRE_Int *new_i; @@ -4195,43 +4054,43 @@ hypre_CSRMatrixDropInplace(hypre_CSRMatrix *A, HYPRE_Real droptol, HYPRE_Int max HYPRE_Int ctrA; /* setup */ - capacity = nnzA*0.3+1; + capacity = (HYPRE_Int)(nnzA * 0.3 + 1); ctrA = 0; - new_i = hypre_TAlloc(HYPRE_Int, n+1, HYPRE_MEMORY_DEVICE); - new_j = hypre_TAlloc(HYPRE_Int, capacity, HYPRE_MEMORY_DEVICE); - new_data = hypre_TAlloc(HYPRE_Real, capacity, HYPRE_MEMORY_DEVICE); + new_i = hypre_TAlloc(HYPRE_Int, n + 1, memory_location); + new_j = hypre_TAlloc(HYPRE_Int, capacity, memory_location); + new_data = hypre_TAlloc(HYPRE_Real, capacity, memory_location); - idx = hypre_TAlloc(HYPRE_Int, m, HYPRE_MEMORY_DEVICE); - data = hypre_TAlloc(HYPRE_Real, m, HYPRE_MEMORY_DEVICE); + idx = hypre_TAlloc(HYPRE_Int, m, memory_location); + data = hypre_TAlloc(HYPRE_Real, m, memory_location); /* start of main loop */ new_i[0] = 0; - for(i = 0 ; i < n ; i ++) + for (i = 0 ; i < n ; i ++) { len = 0; k1 = A_i[i]; - k2 = A_i[i+1]; + k2 = A_i[i + 1]; /* compute droptol for current row */ norm = 0.0; - for(j = k1 ; j < k2 ; j ++) + for (j = k1 ; j < k2 ; j ++) { norm += hypre_abs(A_data[j]); } - if(k2 > k1) + if (k2 > k1) { norm /= (HYPRE_Real)(k2 - k1); } itol = droptol * norm; /* we don't want to drop the diagonal entry, so use an if statement here */ - if(A_j[k1] == i) + if (A_j[k1] == i) { /* we have diagonal entry, skip it */ idx[len] = A_j[k1]; data[len++] = A_data[k1]; - for(j = k1 + 1 ; j < k2 ; j ++) + for (j = k1 + 1 ; j < k2 ; j ++) { value = A_data[j]; - if(hypre_abs(value) < itol) + if (hypre_abs(value) < itol) { /* skip small element */ continue; @@ -4241,10 +4100,10 @@ hypre_CSRMatrixDropInplace(hypre_CSRMatrix *A, HYPRE_Real droptol, HYPRE_Int max } /* now apply drop on length */ - if(len > max_row_nnz) + if (len > max_row_nnz) { drop_len = max_row_nnz; - hypre_ILUMaxQSplitRabsI( data + 1, idx + 1, 0, drop_len - 1 , len - 2); + hypre_ILUMaxQSplitRabsI( data + 1, idx + 1, 0, drop_len - 1, len - 2); } else { @@ -4252,25 +4111,28 @@ hypre_CSRMatrixDropInplace(hypre_CSRMatrix *A, HYPRE_Real droptol, HYPRE_Int max drop_len = len; } /* copy data */ - while(ctrA + drop_len > capacity) + while (ctrA + drop_len > capacity) { HYPRE_Int tmp = capacity; - capacity = capacity * EXPAND_FACT + 1; - new_j = hypre_TReAlloc_v2(new_j, HYPRE_Int, tmp, HYPRE_Int, capacity, HYPRE_MEMORY_DEVICE); - new_data = hypre_TReAlloc_v2(new_data, HYPRE_Real, tmp, HYPRE_Real, capacity, HYPRE_MEMORY_DEVICE); + capacity = (HYPRE_Int)(capacity * EXPAND_FACT + 1); + new_j = hypre_TReAlloc_v2(new_j, HYPRE_Int, tmp, + HYPRE_Int, capacity, memory_location); + new_data = hypre_TReAlloc_v2(new_data, HYPRE_Real, tmp, + HYPRE_Real, capacity, memory_location); } - hypre_TMemcpy( new_j + ctrA, idx,HYPRE_Int, drop_len, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); - hypre_TMemcpy( new_data + ctrA, data,HYPRE_Real, drop_len, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(new_j + ctrA, idx, HYPRE_Int, drop_len, memory_location, memory_location); + hypre_TMemcpy(new_data + ctrA, data, HYPRE_Real, drop_len, memory_location, + memory_location); ctrA += drop_len; - new_i[i+1] = ctrA; + new_i[i + 1] = ctrA; } else { /* we don't have diagonal entry */ - for(j = k1 ; j < k2 ; j ++) + for (j = k1 ; j < k2 ; j ++) { value = A_data[j]; - if(hypre_abs(value) max_row_nnz) + if (len > max_row_nnz) { drop_len = max_row_nnz; hypre_ILUMaxQSplitRabsI( data, idx, 0, drop_len, len - 1); @@ -4292,25 +4154,28 @@ hypre_CSRMatrixDropInplace(hypre_CSRMatrix *A, HYPRE_Real droptol, HYPRE_Int max } /* copy data */ - while(ctrA + drop_len > capacity) + while (ctrA + drop_len > capacity) { HYPRE_Int tmp = capacity; - capacity = capacity * EXPAND_FACT + 1; - new_j = hypre_TReAlloc_v2(new_j, HYPRE_Int, tmp, HYPRE_Int, capacity, HYPRE_MEMORY_DEVICE); - new_data = hypre_TReAlloc_v2(new_data, HYPRE_Real, tmp, HYPRE_Real, capacity, HYPRE_MEMORY_DEVICE); + capacity = (HYPRE_Int)(capacity * EXPAND_FACT + 1); + new_j = hypre_TReAlloc_v2(new_j, HYPRE_Int, tmp, + HYPRE_Int, capacity, memory_location); + new_data = hypre_TReAlloc_v2(new_data, HYPRE_Real, tmp, + HYPRE_Real, capacity, memory_location); } - hypre_TMemcpy( new_j + ctrA, idx,HYPRE_Int, drop_len, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); - hypre_TMemcpy( new_data + ctrA, data,HYPRE_Real, drop_len, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(new_j + ctrA, idx, HYPRE_Int, drop_len, memory_location, memory_location); + hypre_TMemcpy(new_data + ctrA, data, HYPRE_Real, drop_len, memory_location, + memory_location); ctrA += drop_len; - new_i[i+1] = ctrA; + new_i[i + 1] = ctrA; } }/* end of main loop */ /* destory data if A own them */ - if(hypre_CSRMatrixOwnsData(A)) + if (hypre_CSRMatrixOwnsData(A)) { - hypre_TFree(A_i, HYPRE_MEMORY_DEVICE); - hypre_TFree(A_j, HYPRE_MEMORY_DEVICE); - hypre_TFree(A_data, HYPRE_MEMORY_DEVICE); + hypre_TFree(A_i, memory_location); + hypre_TFree(A_j, memory_location); + hypre_TFree(A_data, memory_location); } hypre_CSRMatrixI(A) = new_i; @@ -4319,13 +4184,16 @@ hypre_CSRMatrixDropInplace(hypre_CSRMatrix *A, HYPRE_Real droptol, HYPRE_Int max hypre_CSRMatrixNumNonzeros(A) = ctrA; hypre_CSRMatrixOwnsData(A) = 1; - hypre_TFree(idx, HYPRE_MEMORY_DEVICE); - hypre_TFree(data, HYPRE_MEMORY_DEVICE); + hypre_TFree(idx, memory_location); + hypre_TFree(data, memory_location); return hypre_error_flag; } -/* Compute the inverse with MR of original CSR matrix +/*-------------------------------------------------------------------------- + * hypre_ILUCSRMatrixInverseSelfPrecondMRGlobal + * + * Compute the inverse with MR of original CSR matrix * Global(not by each column) and out place version * A: the input matrix * M: the output matrix @@ -4335,23 +4203,27 @@ hypre_CSRMatrixDropInplace(hypre_CSRMatrix *A, HYPRE_Real droptol, HYPRE_Int max * max_row_nnz: max number of nonzeros per row * max_iter: max number of iterations * print_level: the print level of this algorithm - */ + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUCSRMatrixInverseSelfPrecondMRGlobal(hypre_CSRMatrix *matA, hypre_CSRMatrix **M, HYPRE_Real droptol, - HYPRE_Real tol, HYPRE_Real eps_tol, HYPRE_Int max_row_nnz, HYPRE_Int max_iter, - HYPRE_Int print_level ) +hypre_ILUCSRMatrixInverseSelfPrecondMRGlobal(hypre_CSRMatrix *matA, + hypre_CSRMatrix **M, + HYPRE_Real droptol, + HYPRE_Real tol, + HYPRE_Real eps_tol, + HYPRE_Int max_row_nnz, + HYPRE_Int max_iter, + HYPRE_Int print_level) { - HYPRE_Int i, k1, k2; - HYPRE_Real value, trace1, trace2, alpha, r_norm; - - /* martix A */ + /* matrix A */ HYPRE_Int *A_i = hypre_CSRMatrixI(matA); HYPRE_Int *A_j = hypre_CSRMatrixJ(matA); HYPRE_Real *A_data = hypre_CSRMatrixData(matA); + HYPRE_MemoryLocation memory_location = hypre_CSRMatrixMemoryLocation(matA); /* complexity */ HYPRE_Real nnzA = hypre_CSRMatrixNumNonzeros(matA); - HYPRE_Real nnzM; + HYPRE_Real nnzM = 1.0; /* inverse matrix */ hypre_CSRMatrix *inM = *M; @@ -4373,40 +4245,42 @@ hypre_ILUCSRMatrixInverseSelfPrecondMRGlobal(hypre_CSRMatrix *matA, hypre_CSRMat hypre_CSRMatrix *matC; hypre_CSRMatrix *matW; - HYPRE_Real time_s, time_e; + HYPRE_Real time_s = 0.0, time_e; + HYPRE_Int i, k1, k2; + HYPRE_Real value, trace1, trace2, alpha, r_norm = 0.0; HYPRE_Int n = hypre_CSRMatrixNumRows(matA); /* create initial guess and matrix I */ - matM = hypre_CSRMatrixCreate(n,n,n); - M_i = hypre_TAlloc(HYPRE_Int, n+1, HYPRE_MEMORY_DEVICE); - M_j = hypre_TAlloc(HYPRE_Int, n, HYPRE_MEMORY_DEVICE); - M_data = hypre_TAlloc(HYPRE_Real, n, HYPRE_MEMORY_DEVICE); + matM = hypre_CSRMatrixCreate(n, n, n); + M_i = hypre_TAlloc(HYPRE_Int, n + 1, memory_location); + M_j = hypre_TAlloc(HYPRE_Int, n, memory_location); + M_data = hypre_TAlloc(HYPRE_Real, n, memory_location); - matI = hypre_CSRMatrixCreate(n,n,n); - I_i = hypre_TAlloc(HYPRE_Int, n+1, HYPRE_MEMORY_DEVICE); - I_j = hypre_TAlloc(HYPRE_Int, n, HYPRE_MEMORY_DEVICE); - I_data = hypre_TAlloc(HYPRE_Real, n, HYPRE_MEMORY_DEVICE); + matI = hypre_CSRMatrixCreate(n, n, n); + I_i = hypre_TAlloc(HYPRE_Int, n + 1, memory_location); + I_j = hypre_TAlloc(HYPRE_Int, n, memory_location); + I_data = hypre_TAlloc(HYPRE_Real, n, memory_location); /* now loop to create initial guess */ M_i[0] = 0; I_i[0] = 0; - for(i = 0 ; i < n ; i ++) + for (i = 0 ; i < n ; i ++) { - M_i[i+1] = i+1; + M_i[i + 1] = i + 1; M_j[i] = i; k1 = A_i[i]; - k2 = A_i[i+1]; - if(k2 > k1) + k2 = A_i[i + 1]; + if (k2 > k1) { - if(A_j[k1] == i) + if (A_j[k1] == i) { value = A_data[k1]; - if(hypre_abs(value) < MAT_TOL) + if (hypre_abs(value) < MAT_TOL) { value = 1.0; } - M_data[i] = 1.0/value; + M_data[i] = 1.0 / value; } else { @@ -4417,7 +4291,7 @@ hypre_ILUCSRMatrixInverseSelfPrecondMRGlobal(hypre_CSRMatrix *matA, hypre_CSRMat { M_data[i] = 1.0; } - I_i[i+1] = i+1; + I_i[i + 1] = i + 1; I_j[i] = i; I_data[i] = 1.0; } @@ -4433,18 +4307,18 @@ hypre_ILUCSRMatrixInverseSelfPrecondMRGlobal(hypre_CSRMatrix *matA, hypre_CSRMat hypre_CSRMatrixOwnsData(matI) = 1; /* now start the main loop */ - if(print_level > 1) + if (print_level > 1) { /* time the iteration */ time_s = hypre_MPI_Wtime(); } /* main loop */ - for(i = 0 ; i < max_iter ; i ++) + for (i = 0 ; i < max_iter ; i ++) { nnzM = hypre_CSRMatrixNumNonzeros(matM); /* R = I - AM */ - matR_temp = hypre_CSRMatrixMultiply(matA,matM); + matR_temp = hypre_CSRMatrixMultiply(matA, matM); hypre_CSRMatrixScale(matR_temp, -1.0); @@ -4453,7 +4327,7 @@ hypre_ILUCSRMatrixInverseSelfPrecondMRGlobal(hypre_CSRMatrix *matA, hypre_CSRMat /* r_norm */ hypre_CSRMatrixNormFro(matR, &r_norm); - if(r_norm < tol) + if (r_norm < tol) { break; } @@ -4467,15 +4341,15 @@ hypre_ILUCSRMatrixInverseSelfPrecondMRGlobal(hypre_CSRMatrix *matA, hypre_CSRMat matC = hypre_CSRMatrixMultiply(matA, matZ); /* W = R' * C */ - hypre_CSRMatrixTranspose(matR,&matR_temp,1); - matW = hypre_CSRMatrixMultiply(matR_temp,matC); + hypre_CSRMatrixTranspose(matR, &matR_temp, 1); + matW = hypre_CSRMatrixMultiply(matR_temp, matC); /* trace and alpha */ hypre_CSRMatrixTrace(matW, &trace1); hypre_CSRMatrixNormFro(matC, &trace2); trace2 *= trace2; - if(hypre_abs(trace2) < eps_tol) + if (hypre_abs(trace2) < eps_tol) { break; } @@ -4494,32 +4368,34 @@ hypre_ILUCSRMatrixInverseSelfPrecondMRGlobal(hypre_CSRMatrix *matA, hypre_CSRMat hypre_CSRMatrixDestroy(matW); hypre_CSRMatrixDestroy(matC); hypre_CSRMatrixDestroy(matR_temp); - - }/* end of main loop i for compute inverse matrix */ + } /* end of main loop i for compute inverse matrix */ /* time if we need to print */ - if(print_level > 1) + if (print_level > 1) { time_e = hypre_MPI_Wtime(); - if(i == 0) + if (i == 0) { i = 1; } - hypre_printf("matrix size %5d\nfinal norm at loop %5d is %16.12f, time per iteration is %16.12f, complexity is %16.12f out of maximum %16.12f\n",n,i,r_norm, (time_e-time_s)/i, nnzM/nnzA, n/nnzA*n); + hypre_printf("matrix size %5d\nfinal norm at loop %5d is %16.12f, time per iteration is %16.12f, complexity is %16.12f out of maximum %16.12f\n", + n, i, r_norm, (time_e - time_s) / i, nnzM / nnzA, n / nnzA * n); } hypre_CSRMatrixDestroy(matI); - if(inM) + if (inM) { hypre_CSRMatrixDestroy(inM); } *M = matM; return hypre_error_flag; - } -/* Compute inverse with NSH method +/*-------------------------------------------------------------------------- + * hypre_ILUParCSRInverseNSH + * + * Compute inverse with NSH method * Use MR to get local initial guess * A: input matrix * M: output matrix @@ -4532,39 +4408,49 @@ hypre_ILUCSRMatrixInverseSelfPrecondMRGlobal(hypre_CSRMatrix *matA, hypre_CSRMat * mr_max_iter: max number of iterations for MR * nsh_max_iter: max number of iterations for NSH * mr_col_version: column version of global version - */ + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUParCSRInverseNSH(hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **M, HYPRE_Real *droptol, HYPRE_Real mr_tol, - HYPRE_Real nsh_tol, HYPRE_Real eps_tol, HYPRE_Int mr_max_row_nnz, HYPRE_Int nsh_max_row_nnz, - HYPRE_Int mr_max_iter, HYPRE_Int nsh_max_iter, HYPRE_Int mr_col_version, - HYPRE_Int print_level) +hypre_ILUParCSRInverseNSH(hypre_ParCSRMatrix *A, + hypre_ParCSRMatrix **M, + HYPRE_Real *droptol, + HYPRE_Real mr_tol, + HYPRE_Real nsh_tol, + HYPRE_Real eps_tol, + HYPRE_Int mr_max_row_nnz, + HYPRE_Int nsh_max_row_nnz, + HYPRE_Int mr_max_iter, + HYPRE_Int nsh_max_iter, + HYPRE_Int mr_col_version, + HYPRE_Int print_level) { - HYPRE_Int i; + HYPRE_UNUSED_VAR(nsh_max_row_nnz); /* data slots for matrices */ hypre_ParCSRMatrix *matM = NULL; hypre_ParCSRMatrix *inM = *M; - hypre_ParCSRMatrix *AM,*MAM; + hypre_ParCSRMatrix *AM, *MAM; HYPRE_Real norm, s_norm; MPI_Comm comm = hypre_ParCSRMatrixComm(A); HYPRE_Int myid; - + HYPRE_MemoryLocation memory_location = hypre_ParCSRMatrixMemoryLocation(A); hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); hypre_CSRMatrix *M_diag = NULL; hypre_CSRMatrix *M_offd; HYPRE_Int *M_offd_i; - HYPRE_Real time_s, time_e; + HYPRE_Real time_s = 0.0, time_e; HYPRE_Int n = hypre_CSRMatrixNumRows(A_diag); + HYPRE_Int i; /* setup */ hypre_MPI_Comm_rank(comm, &myid); - M_offd_i = hypre_CTAlloc(HYPRE_Int, n+1, HYPRE_MEMORY_DEVICE); + M_offd_i = hypre_CTAlloc(HYPRE_Int, n + 1, memory_location); - if(mr_col_version) + if (mr_col_version) { hypre_printf("Column version is not yet support, switch to global version\n"); } @@ -4574,17 +4460,18 @@ hypre_ILUParCSRInverseNSH(hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **M, HYPRE_R * we want same number for MR and NSH to let user set them eaiser * but we don't want a too dense MR initial guess */ - hypre_ILUCSRMatrixInverseSelfPrecondMRGlobal(A_diag, &M_diag, droptol[0] * 10.0, mr_tol, eps_tol, mr_max_row_nnz, mr_max_iter, print_level ); + hypre_ILUCSRMatrixInverseSelfPrecondMRGlobal(A_diag, &M_diag, droptol[0] * 10.0, mr_tol, eps_tol, + mr_max_row_nnz, mr_max_iter, print_level ); /* create parCSR matM */ matM = hypre_ParCSRMatrixCreate( comm, - hypre_ParCSRMatrixGlobalNumRows(A), - hypre_ParCSRMatrixGlobalNumRows(A), - hypre_ParCSRMatrixRowStarts(A), - hypre_ParCSRMatrixColStarts(A), - 0, - hypre_CSRMatrixNumNonzeros(M_diag), - 0 ); + hypre_ParCSRMatrixGlobalNumRows(A), + hypre_ParCSRMatrixGlobalNumRows(A), + hypre_ParCSRMatrixRowStarts(A), + hypre_ParCSRMatrixColStarts(A), + 0, + hypre_CSRMatrixNumNonzeros(M_diag), + 0 ); hypre_CSRMatrixDestroy(hypre_ParCSRMatrixDiag(matM)); hypre_ParCSRMatrixDiag(matM) = M_diag; @@ -4602,21 +4489,21 @@ hypre_ILUParCSRInverseNSH(hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **M, HYPRE_R hypre_ParCSRMatrixResNormFro(AM, &norm); s_norm = norm; hypre_ParCSRMatrixDestroy(AM); - if(print_level > 1) + if (print_level > 1) { - if(myid == 0) + if (myid == 0) { hypre_printf("before NSH the norm is %16.12f\n", norm); } time_s = hypre_MPI_Wtime(); } - for(i = 0 ; i < nsh_max_iter ; i ++) + for (i = 0 ; i < nsh_max_iter ; i ++) { /* compute XjAXj */ AM = hypre_ParMatmul(A, matM); hypre_ParCSRMatrixResNormFro(AM, &norm); - if(norm < nsh_tol) + if (norm < nsh_tol) { break; } @@ -4639,30 +4526,31 @@ hypre_ILUParCSRInverseNSH(hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **M, HYPRE_R hypre_ParCSRMatrixDestroy(MAM); } - if(print_level > 1) + if (print_level > 1) { time_e = hypre_MPI_Wtime(); /* at this point of time, norm has to be already computed */ - if(i == 0) + if (i == 0) { i = 1; } - if(myid == 0) + if (myid == 0) { - hypre_printf("after %5d NSH iterations the norm is %16.12f, time per iteration is %16.12f\n", i, norm, (time_e-time_s)/i); + hypre_printf("after %5d NSH iterations the norm is %16.12f, time per iteration is %16.12f\n", i, + norm, (time_e - time_s) / i); } } - if(s_norm < norm) + if (s_norm < norm) { /* the residual norm increase after NSH iteration, need to let user know */ - if(myid == 0) + if (myid == 0) { hypre_printf("Warning: NSH divergence, probably bad approximate invese matrix.\n"); } } - if(inM) + if (inM) { hypre_ParCSRMatrixDestroy(inM); } diff --git a/external/hypre/src/parcsr_ls/par_ilu.h b/external/hypre/src/parcsr_ls/par_ilu.h index b72dc0bf..f4a599ca 100644 --- a/external/hypre/src/parcsr_ls/par_ilu.h +++ b/external/hypre/src/parcsr_ls/par_ilu.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -11,38 +11,14 @@ /*-------------------------------------------------------------------------- * hypre_ParILUData *--------------------------------------------------------------------------*/ + typedef struct hypre_ParILUData_struct { -#ifdef HYPRE_USING_CUDA - /* Data slots for cusparse-based ilu0 */ - cusparseMatDescr_t matL_des;//lower tri with ones on diagonal - cusparseMatDescr_t matU_des;//upper tri - csrsv2Info_t matAL_info;//ILU info for L of A block (used in A-smoothing) - csrsv2Info_t matAU_info;//ILU info for U of A block - csrsv2Info_t matBL_info;//ILU info for L of B block - csrsv2Info_t matBU_info;//ILU info for U of B block - csrsv2Info_t matSL_info;//ILU info for L of S block - csrsv2Info_t matSU_info;//ILU info for U of S block - cusparseSolvePolicy_t ilu_solve_policy;//Use/Don't use level - void *ilu_solve_buffer;//working array on device memory + /* Base solver data structure */ + hypre_Solver base; - /* on GPU, we have to form E and F explicitly, since we don't have much control to it - * - */ - hypre_CSRMatrix *matALU_d;//the matrix holding ILU of A (for A-smoothing) - hypre_CSRMatrix *matBLU_d;//the matrix holding ILU of B - hypre_CSRMatrix *matSLU_d;//the matrix holding ILU of S - hypre_CSRMatrix *matE_d; - hypre_CSRMatrix *matF_d; - hypre_ParCSRMatrix *Aperm; - hypre_ParCSRMatrix *R; - hypre_ParCSRMatrix *P; - hypre_Vector *Ftemp_upper; - hypre_Vector *Utemp_lower; - HYPRE_Int *A_diag_fake;//fake diagonal, used to pretend that the diagonal matrix is empty -#endif - //general data - HYPRE_Int global_solver; + /* General data */ + HYPRE_Int global_solver; hypre_ParCSRMatrix *matA; hypre_ParCSRMatrix *matL; HYPRE_Real *matD; @@ -51,105 +27,119 @@ typedef struct hypre_ParILUData_struct HYPRE_Real *matmD; hypre_ParCSRMatrix *matmU; hypre_ParCSRMatrix *matS; - HYPRE_Real *droptol;/* should be an array of 3 element, for B, (E and F), S respectively */ - HYPRE_Int lfil; - HYPRE_Int maxRowNnz; + HYPRE_Real *droptol; /* Array of 3 elements, for B, (E and F), S respectively */ + HYPRE_Int lfil; + HYPRE_Int maxRowNnz; HYPRE_Int *CF_marker_array; HYPRE_Int *perm; HYPRE_Int *qperm; - HYPRE_Real tol_ddPQ; + HYPRE_Real tol_ddPQ; hypre_ParVector *F; hypre_ParVector *U; hypre_ParVector *residual; HYPRE_Real *rel_res_norms; - HYPRE_Int num_iterations; + HYPRE_Int num_iterations; HYPRE_Real *l1_norms; - HYPRE_Real final_rel_residual_norm; - HYPRE_Real tol; - HYPRE_Real operator_complexity; - - HYPRE_Int logging; - HYPRE_Int print_level; - HYPRE_Int max_iter; - - HYPRE_Int ilu_type; - HYPRE_Int nLU; - HYPRE_Int nI; - - /* used when schur block is formed */ - HYPRE_Int *u_end; + HYPRE_Real final_rel_residual_norm; + HYPRE_Real tol; + HYPRE_Real operator_complexity; + HYPRE_Int logging; + HYPRE_Int print_level; + HYPRE_Int max_iter; + HYPRE_Int tri_solve; + HYPRE_Int lower_jacobi_iters; + HYPRE_Int upper_jacobi_iters; + HYPRE_Int ilu_type; + HYPRE_Int nLU; + HYPRE_Int nI; + HYPRE_Int *u_end; /* used when schur block is formed */ + + /* Iterative ILU parameters */ + HYPRE_Int iter_setup_type; + HYPRE_Int iter_setup_option; + HYPRE_Int setup_max_iter; + HYPRE_Int setup_num_iter; + HYPRE_Real setup_tolerance; + HYPRE_Complex *setup_history; /* temp vectors for solve phase */ hypre_ParVector *Utemp; hypre_ParVector *Ftemp; hypre_ParVector *Xtemp; hypre_ParVector *Ytemp; + hypre_ParVector *Ztemp; HYPRE_Real *uext; HYPRE_Real *fext; + /* On GPU, we have to form E and F explicitly, since we don't have much control to it */ +#if defined(HYPRE_USING_GPU) + hypre_CSRMatrix *matALU_d; /* Matrix holding ILU of A (for A-smoothing) */ + hypre_CSRMatrix *matBLU_d; /* Matrix holding ILU of B */ + hypre_CSRMatrix *matSLU_d; /* Matrix holding ILU of S */ + hypre_CSRMatrix *matE_d; + hypre_CSRMatrix *matF_d; + hypre_ParCSRMatrix *Aperm; + hypre_ParCSRMatrix *R; + hypre_ParCSRMatrix *P; + hypre_Vector *Ftemp_upper; + hypre_Vector *Utemp_lower; + hypre_Vector *Adiag_diag; + hypre_Vector *Sdiag_diag; +#endif + /* data structure sor solving Schur System */ - HYPRE_Solver schur_solver; - HYPRE_Solver schur_precond; + HYPRE_Solver schur_solver; + HYPRE_Solver schur_precond; hypre_ParVector *rhs; hypre_ParVector *x; - /* schur solver data */ - - /* -> GENERAL-SLOTS */ - HYPRE_Int ss_logging; - HYPRE_Int ss_print_level; - - /* -> SCHUR-GMRES */ - HYPRE_Int ss_kDim;/* max number of iterations for GMRES */ - HYPRE_Int ss_max_iter;/* max number of iterations for GMRES solve */ - HYPRE_Real ss_tol;/* stop iteration tol for GMRES */ - HYPRE_Real ss_absolute_tol;/* absolute tol for GMRES or tol for NSH solve */ - HYPRE_Int ss_rel_change; - - /* -> SCHUR-NSH */ - HYPRE_Int ss_nsh_setup_max_iter;/* number of iterations for NSH inverse */ - HYPRE_Int ss_nsh_solve_max_iter;/* max number of iterations for NSH solve */ - HYPRE_Real ss_nsh_setup_tol;/* stop iteration tol for NSH inverse */ - HYPRE_Real ss_nsh_solve_tol;/* absolute tol for NSH solve */ - HYPRE_Int ss_nsh_max_row_nnz;/* max rows of nonzeros for NSH */ - HYPRE_Int ss_nsh_mr_col_version;/* MR column version setting in NSH */ - HYPRE_Int ss_nsh_mr_max_row_nnz;/* max rows for MR */ - HYPRE_Real *ss_nsh_droptol;/* droptol array for NSH */ - HYPRE_Int ss_nsh_mr_max_iter;/* max MR iteration */ - HYPRE_Real ss_nsh_mr_tol; - - /* schur precond data */ - HYPRE_Int sp_ilu_type;/* ilu type is use ILU */ - HYPRE_Int sp_ilu_lfil;/* level of fill in for ILUK */ - HYPRE_Int sp_ilu_max_row_nnz;/* max rows for ILUT */ + /* Schur solver data */ + HYPRE_Int ss_logging; + HYPRE_Int ss_print_level; + + /* Schur-GMRES */ + HYPRE_Int ss_kDim; /* max number of iterations for GMRES */ + HYPRE_Int ss_max_iter; /* max number of iterations for GMRES solve */ + HYPRE_Real ss_tol; /* stop iteration tol for GMRES */ + HYPRE_Real ss_absolute_tol; /* absolute tol for GMRES or tol for NSH solve */ + HYPRE_Int ss_rel_change; + + /* Schur-NSH */ + HYPRE_Int ss_nsh_setup_max_iter; /* number of iterations for NSH inverse */ + HYPRE_Int ss_nsh_solve_max_iter; /* max number of iterations for NSH solve */ + HYPRE_Real ss_nsh_setup_tol; /* stop iteration tol for NSH inverse */ + HYPRE_Real ss_nsh_solve_tol; /* absolute tol for NSH solve */ + HYPRE_Int ss_nsh_max_row_nnz; /* max rows of nonzeros for NSH */ + HYPRE_Int ss_nsh_mr_col_version; /* MR column version setting in NSH */ + HYPRE_Int ss_nsh_mr_max_row_nnz; /* max rows for MR */ + HYPRE_Real *ss_nsh_droptol; /* droptol array for NSH */ + HYPRE_Int ss_nsh_mr_max_iter; /* max MR iteration */ + HYPRE_Real ss_nsh_mr_tol; + + /* Schur precond data */ + HYPRE_Int sp_ilu_type; /* ilu type is use ILU */ + HYPRE_Int sp_ilu_lfil; /* level of fill in for ILUK */ + HYPRE_Int sp_ilu_max_row_nnz; /* max rows for ILUT */ /* droptol for ILUT or MR * ILUT: [0], [1], [2] B, E&F, S respectively * NSH: [0] for MR, [1] for NSH */ - HYPRE_Real *sp_ilu_droptol;/* droptol array for ILUT */ - HYPRE_Int sp_print_level; - HYPRE_Int sp_max_iter;/* max precond iter or max MR iteration */ - HYPRE_Real sp_tol; + HYPRE_Real *sp_ilu_droptol; /* droptol array for ILUT */ + HYPRE_Int sp_print_level; + HYPRE_Int sp_max_iter; /* max precond iter or max MR iteration */ + HYPRE_Int sp_tri_solve; + HYPRE_Int sp_lower_jacobi_iters; + HYPRE_Int sp_upper_jacobi_iters; + HYPRE_Real sp_tol; + HYPRE_Int test_opt; /* TODO (VPM): change this to something more descriptive*/ - HYPRE_Int test_opt; /* local reordering */ - HYPRE_Int reordering_type; - + HYPRE_Int reordering_type; } hypre_ParILUData; #define hypre_ParILUDataTestOption(ilu_data) ((ilu_data) -> test_opt) -#ifdef HYPRE_USING_CUDA -#define hypre_ParILUDataMatLMatrixDescription(ilu_data) ((ilu_data) -> matL_des) -#define hypre_ParILUDataMatUMatrixDescription(ilu_data) ((ilu_data) -> matU_des) -#define hypre_ParILUDataMatALILUSolveInfo(ilu_data) ((ilu_data) -> matAL_info) -#define hypre_ParILUDataMatAUILUSolveInfo(ilu_data) ((ilu_data) -> matAU_info) -#define hypre_ParILUDataMatBLILUSolveInfo(ilu_data) ((ilu_data) -> matBL_info) -#define hypre_ParILUDataMatBUILUSolveInfo(ilu_data) ((ilu_data) -> matBU_info) -#define hypre_ParILUDataMatSLILUSolveInfo(ilu_data) ((ilu_data) -> matSL_info) -#define hypre_ParILUDataMatSUILUSolveInfo(ilu_data) ((ilu_data) -> matSU_info) -#define hypre_ParILUDataILUSolveBuffer(ilu_data) ((ilu_data) -> ilu_solve_buffer) -#define hypre_ParILUDataILUSolvePolicy(ilu_data) ((ilu_data) -> ilu_solve_policy) +#if defined(HYPRE_USING_GPU) #define hypre_ParILUDataMatAILUDevice(ilu_data) ((ilu_data) -> matALU_d) #define hypre_ParILUDataMatBILUDevice(ilu_data) ((ilu_data) -> matBLU_d) #define hypre_ParILUDataMatSILUDevice(ilu_data) ((ilu_data) -> matSLU_d) @@ -160,7 +150,8 @@ typedef struct hypre_ParILUData_struct #define hypre_ParILUDataP(ilu_data) ((ilu_data) -> P) #define hypre_ParILUDataFTempUpper(ilu_data) ((ilu_data) -> Ftemp_upper) #define hypre_ParILUDataUTempLower(ilu_data) ((ilu_data) -> Utemp_lower) -#define hypre_ParILUDataMatAFakeDiagonal(ilu_data) ((ilu_data) -> A_diag_fake) +#define hypre_ParILUDataADiagDiag(ilu_data) ((ilu_data) -> Adiag_diag) +#define hypre_ParILUDataSDiagDiag(ilu_data) ((ilu_data) -> Sdiag_diag) #endif #define hypre_ParILUDataGlobalSolver(ilu_data) ((ilu_data) -> global_solver) @@ -192,14 +183,18 @@ typedef struct hypre_ParILUData_struct #define hypre_ParILUDataLogging(ilu_data) ((ilu_data) -> logging) #define hypre_ParILUDataPrintLevel(ilu_data) ((ilu_data) -> print_level) #define hypre_ParILUDataMaxIter(ilu_data) ((ilu_data) -> max_iter) +#define hypre_ParILUDataTriSolve(ilu_data) ((ilu_data) -> tri_solve) +#define hypre_ParILUDataLowerJacobiIters(ilu_data) ((ilu_data) -> lower_jacobi_iters) +#define hypre_ParILUDataUpperJacobiIters(ilu_data) ((ilu_data) -> upper_jacobi_iters) #define hypre_ParILUDataIluType(ilu_data) ((ilu_data) -> ilu_type) #define hypre_ParILUDataNLU(ilu_data) ((ilu_data) -> nLU) #define hypre_ParILUDataNI(ilu_data) ((ilu_data) -> nI) #define hypre_ParILUDataUEnd(ilu_data) ((ilu_data) -> u_end) -#define hypre_ParILUDataXTemp(ilu_data) ((ilu_data) -> Xtemp) -#define hypre_ParILUDataYTemp(ilu_data) ((ilu_data) -> Ytemp) #define hypre_ParILUDataUTemp(ilu_data) ((ilu_data) -> Utemp) #define hypre_ParILUDataFTemp(ilu_data) ((ilu_data) -> Ftemp) +#define hypre_ParILUDataXTemp(ilu_data) ((ilu_data) -> Xtemp) +#define hypre_ParILUDataYTemp(ilu_data) ((ilu_data) -> Ytemp) +#define hypre_ParILUDataZTemp(ilu_data) ((ilu_data) -> Ztemp) #define hypre_ParILUDataUExt(ilu_data) ((ilu_data) -> uext) #define hypre_ParILUDataFExt(ilu_data) ((ilu_data) -> fext) #define hypre_ParILUDataSchurSolver(ilu_data) ((ilu_data) -> schur_solver) @@ -207,6 +202,18 @@ typedef struct hypre_ParILUData_struct #define hypre_ParILUDataRhs(ilu_data) ((ilu_data) -> rhs) #define hypre_ParILUDataX(ilu_data) ((ilu_data) -> x) #define hypre_ParILUDataReorderingType(ilu_data) ((ilu_data) -> reordering_type) + +/* Iterative ILU setup */ +#define hypre_ParILUDataIterativeSetupType(ilu_data) ((ilu_data) -> iter_setup_type) +#define hypre_ParILUDataIterativeSetupOption(ilu_data) ((ilu_data) -> iter_setup_option) +#define hypre_ParILUDataIterativeSetupMaxIter(ilu_data) ((ilu_data) -> setup_max_iter) +#define hypre_ParILUDataIterativeSetupNumIter(ilu_data) ((ilu_data) -> setup_num_iter) +#define hypre_ParILUDataIterativeSetupTolerance(ilu_data) ((ilu_data) -> setup_tolerance) +#define hypre_ParILUDataIterativeSetupHistory(ilu_data) ((ilu_data) -> setup_history) +#define hypre_ParILUDataIterSetupCorrectionNorm(ilu_data,i) ((ilu_data) -> setup_history[i]) +#define hypre_ParILUDataIterSetupResidualNorm(ilu_data,i) (((ilu_data) -> setup_history + \ + (ilu_data) -> setup_num_iter)[i]) + /* Schur System */ #define hypre_ParILUDataSchurGMRESKDim(ilu_data) ((ilu_data) -> ss_kDim) #define hypre_ParILUDataSchurGMRESMaxIter(ilu_data) ((ilu_data) -> ss_max_iter) @@ -219,6 +226,9 @@ typedef struct hypre_ParILUData_struct #define hypre_ParILUDataSchurPrecondIluDroptol(ilu_data) ((ilu_data) -> sp_ilu_droptol) #define hypre_ParILUDataSchurPrecondPrintLevel(ilu_data) ((ilu_data) -> sp_print_level) #define hypre_ParILUDataSchurPrecondMaxIter(ilu_data) ((ilu_data) -> sp_max_iter) +#define hypre_ParILUDataSchurPrecondTriSolve(ilu_data) ((ilu_data) -> sp_tri_solve) +#define hypre_ParILUDataSchurPrecondLowerJacobiIters(ilu_data) ((ilu_data) -> sp_lower_jacobi_iters) +#define hypre_ParILUDataSchurPrecondUpperJacobiIters(ilu_data) ((ilu_data) -> sp_upper_jacobi_iters) #define hypre_ParILUDataSchurPrecondTol(ilu_data) ((ilu_data) -> sp_tol) #define hypre_ParILUDataSchurNSHMaxNumIter(ilu_data) ((ilu_data) -> ss_nsh_setup_max_iter) @@ -235,65 +245,57 @@ typedef struct hypre_ParILUData_struct #define hypre_ParILUDataSchurSolverLogging(ilu_data) ((ilu_data) -> ss_logging) #define hypre_ParILUDataSchurSolverPrintLevel(ilu_data) ((ilu_data) -> ss_print_level) -#define FMRK -1 -#define CMRK 1 -#define UMRK 0 +#define FMRK -1 +#define CMRK 1 +#define UMRK 0 #define S_CMRK 2 #define FPT(i, bsize) (((i) % (bsize)) == FMRK) #define CPT(i, bsize) (((i) % (bsize)) == CMRK) -#define MAT_TOL 1e-14 +#define MAT_TOL 1e-14 #define EXPAND_FACT 1.3 - - - - /* NSH data structure */ typedef struct hypre_ParNSHData_struct { /* solver information */ - HYPRE_Int global_solver; + HYPRE_Int global_solver; hypre_ParCSRMatrix *matA; hypre_ParCSRMatrix *matM; hypre_ParVector *F; hypre_ParVector *U; hypre_ParVector *residual; HYPRE_Real *rel_res_norms; - HYPRE_Int num_iterations; + HYPRE_Int num_iterations; HYPRE_Real *l1_norms; - HYPRE_Real final_rel_residual_norm; - HYPRE_Real tol; - HYPRE_Real operator_complexity; - - HYPRE_Int logging; - HYPRE_Int print_level; - HYPRE_Int max_iter; + HYPRE_Real final_rel_residual_norm; + HYPRE_Real tol; + HYPRE_Real operator_complexity; + HYPRE_Int logging; + HYPRE_Int print_level; + HYPRE_Int max_iter; /* common data slots */ - /* droptol[0]: droptol for MR - * droptol[1]: droptol for NSH - */ - HYPRE_Real *droptol; - HYPRE_Int own_droptol_data; + HYPRE_Real *droptol; /* 2 drop torelances for {MR, NSH}*/ + HYPRE_Int own_droptol_data; /* temp vectors for solve phase */ hypre_ParVector *Utemp; hypre_ParVector *Ftemp; /* data slots for local MR */ - HYPRE_Int mr_max_iter; - HYPRE_Real mr_tol; - HYPRE_Int mr_max_row_nnz; - HYPRE_Int mr_col_version;/* global version or column version MR */ + HYPRE_Int mr_max_iter; + HYPRE_Real mr_tol; + HYPRE_Int mr_max_row_nnz; + HYPRE_Int mr_col_version; /* global version or column version MR */ /* data slots for global NSH */ - HYPRE_Int nsh_max_iter; - HYPRE_Real nsh_tol; - HYPRE_Int nsh_max_row_nnz; -}hypre_ParNSHData; + HYPRE_Int nsh_max_iter; + HYPRE_Real nsh_tol; + HYPRE_Int nsh_max_row_nnz; +} hypre_ParNSHData; #define hypre_ParNSHDataGlobalSolver(nsh_data) ((nsh_data) -> global_solver) #define hypre_ParNSHDataMatA(nsh_data) ((nsh_data) -> matA) @@ -322,36 +324,4 @@ typedef struct hypre_ParNSHData_struct #define hypre_ParNSHDataNSHTol(nsh_data) ((nsh_data) -> nsh_tol) #define hypre_ParNSHDataNSHMaxRowNnz(nsh_data) ((nsh_data) -> nsh_max_row_nnz) -#define DIVIDE_TOL 1e-32 - -#ifdef HYPRE_USING_CUDA -HYPRE_Int hypre_ILUSolveCusparseLU(hypre_ParCSRMatrix *A, cusparseMatDescr_t matL_des, cusparseMatDescr_t matU_des, csrsv2Info_t matL_info, csrsv2Info_t matU_info, hypre_CSRMatrix *matLU_d, cusparseSolvePolicy_t ilu_solve_policy, void *ilu_solve_buffer, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int *perm, HYPRE_Int n, hypre_ParVector *ftemp, hypre_ParVector *utemp); -HYPRE_Int hypre_ILUSolveCusparseSchurGMRES(hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int *perm, HYPRE_Int nLU, hypre_ParCSRMatrix *S, hypre_ParVector *ftemp, hypre_ParVector *utemp, HYPRE_Solver schur_solver, HYPRE_Solver schur_precond, hypre_ParVector *rhs, hypre_ParVector *x, HYPRE_Int *u_end, cusparseMatDescr_t matL_des, cusparseMatDescr_t matU_des, csrsv2Info_t matBL_info, csrsv2Info_t matBU_info, csrsv2Info_t matSL_info, csrsv2Info_t matSU_info, hypre_CSRMatrix *matBLU_d, hypre_CSRMatrix *matE_d, hypre_CSRMatrix *matF_d, cusparseSolvePolicy_t ilu_solve_policy, void *ilu_solve_buffer); -HYPRE_Int hypre_ILUSolveRAPGMRES(hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int *perm, HYPRE_Int nLU, hypre_ParCSRMatrix *S, hypre_ParVector *ftemp, hypre_ParVector *utemp, hypre_ParVector *xtemp, hypre_ParVector *ytemp, HYPRE_Solver schur_solver, HYPRE_Solver schur_precond, hypre_ParVector *rhs, hypre_ParVector *x, HYPRE_Int *u_end, cusparseMatDescr_t matL_des, cusparseMatDescr_t matU_des, csrsv2Info_t matAL_info, csrsv2Info_t matAU_info, csrsv2Info_t matBL_info, csrsv2Info_t matBU_info, csrsv2Info_t matSL_info, csrsv2Info_t matSU_info, hypre_ParCSRMatrix *Aperm, hypre_CSRMatrix *matALU_d, hypre_CSRMatrix *matBLU_d, hypre_CSRMatrix *matE_d, hypre_CSRMatrix *matF_d, cusparseSolvePolicy_t ilu_solve_policy, void *ilu_solve_buffer, HYPRE_Int test_opt); -HYPRE_Int hypre_ParILUCusparseExtractDiagonalCSR(hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int *rqperm, hypre_CSRMatrix **A_diagp); -HYPRE_Int hypre_ParILUCusparseILUExtractEBFC(hypre_CSRMatrix *A_diag, HYPRE_Int nLU, hypre_CSRMatrix **Bp, hypre_CSRMatrix **Cp, hypre_CSRMatrix **Ep, hypre_CSRMatrix **Fp); -HYPRE_Int HYPRE_ILUSetupCusparseCSRILU0(hypre_CSRMatrix *A, cusparseSolvePolicy_t ilu_solve_policy); -HYPRE_Int HYPRE_ILUSetupCusparseCSRILU0SetupSolve(hypre_CSRMatrix *A, cusparseMatDescr_t matL_des, cusparseMatDescr_t matU_des, cusparseSolvePolicy_t ilu_solve_policy, csrsv2Info_t *matL_infop, csrsv2Info_t *matU_infop, HYPRE_Int *buffer_sizep, void **bufferp); -HYPRE_Int hypre_ILUSetupILU0Device(hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int *qperm, HYPRE_Int n, HYPRE_Int nLU, cusparseMatDescr_t matL_des, cusparseMatDescr_t matU_des, cusparseSolvePolicy_t ilu_solve_policy, void **bufferp, csrsv2Info_t *matBL_infop, csrsv2Info_t *matBU_infop, csrsv2Info_t *matSL_infop, csrsv2Info_t *matSU_infop, hypre_CSRMatrix **BLUptr, hypre_ParCSRMatrix **matSptr, hypre_CSRMatrix **Eptr, hypre_CSRMatrix **Fptr, HYPRE_Int **A_fake_diag_ip); -HYPRE_Int hypre_ILUSetupILUKDevice(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *perm, HYPRE_Int *qperm, HYPRE_Int n, HYPRE_Int nLU, cusparseMatDescr_t matL_des, cusparseMatDescr_t matU_des, cusparseSolvePolicy_t ilu_solve_policy, void **bufferp, csrsv2Info_t *matBL_infop, csrsv2Info_t *matBU_infop, csrsv2Info_t *matSL_infop, csrsv2Info_t *matSU_infop, hypre_CSRMatrix **BLUptr, hypre_ParCSRMatrix **matSptr, hypre_CSRMatrix **Eptr, hypre_CSRMatrix **Fptr, HYPRE_Int **A_fake_diag_ip); -HYPRE_Int hypre_ILUSetupILUTDevice(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, HYPRE_Int *perm, HYPRE_Int *qperm, HYPRE_Int n, HYPRE_Int nLU, cusparseMatDescr_t matL_des, cusparseMatDescr_t matU_des, cusparseSolvePolicy_t ilu_solve_policy, void **bufferp, csrsv2Info_t *matBL_infop, csrsv2Info_t *matBU_infop, csrsv2Info_t *matSL_infop, csrsv2Info_t *matSU_infop, hypre_CSRMatrix **BLUptr, hypre_ParCSRMatrix **matSptr, hypre_CSRMatrix **Eptr, hypre_CSRMatrix **Fptr, HYPRE_Int **A_fake_diag_ip); -HYPRE_Int hypre_ParILURAPReorder(hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int *rqperm, hypre_ParCSRMatrix **A_pq); -HYPRE_Int hypre_ILUSetupLDUtoCusparse(hypre_ParCSRMatrix *L, HYPRE_Real *D, hypre_ParCSRMatrix *U, hypre_ParCSRMatrix **LDUp); -HYPRE_Int hypre_ParILURAPBuildRP(hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *BLUm, hypre_ParCSRMatrix* E, hypre_ParCSRMatrix *F, cusparseMatDescr_t matL_des, cusparseMatDescr_t matU_des, hypre_ParCSRMatrix **Rp, hypre_ParCSRMatrix **Pp); -HYPRE_Int hypre_ILUSetupRAPMILU0(hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **ALUp, HYPRE_Int modified); -HYPRE_Int hypre_ILUSetupRAPILU0Device(hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int n, HYPRE_Int nLU, cusparseMatDescr_t matL_des, cusparseMatDescr_t matU_des, cusparseSolvePolicy_t ilu_solve_policy, void **bufferp, csrsv2Info_t *matAL_infop, csrsv2Info_t *matAU_infop, csrsv2Info_t *matBL_infop, csrsv2Info_t *matBU_infop, csrsv2Info_t *matSL_infop, csrsv2Info_t *matSU_infop, hypre_ParCSRMatrix **Apermptr, hypre_ParCSRMatrix **matSptr, hypre_CSRMatrix **ALUptr, hypre_CSRMatrix **BLUptr, hypre_CSRMatrix **CLUptr, hypre_CSRMatrix **Eptr, hypre_CSRMatrix **Fptr, HYPRE_Int test_opt); -HYPRE_Int hypre_ParILUCusparseSchurGMRESDummySetup(void *a, void *b, void *c, void *d); -HYPRE_Int hypre_ParILUCusparseSchurGMRESDummySolve(void *ilu_vdata, void *ilu_vdata2, hypre_ParVector *f, hypre_ParVector *u); -HYPRE_Int hypre_ParILUCusparseSchurGMRESCommInfo(void *ilu_vdata, HYPRE_Int *my_id, HYPRE_Int *num_procs); -void *hypre_ParILUCusparseSchurGMRESMatvecCreate(void *ilu_vdata, void *x); -HYPRE_Int hypre_ParILUCusparseSchurGMRESMatvec(void *matvec_data, HYPRE_Complex alpha, void *ilu_vdata, void *x, HYPRE_Complex beta, void *y); -HYPRE_Int hypre_ParILUCusparseSchurGMRESMatvecDestroy(void *matvec_data ); -HYPRE_Int hypre_ParILURAPSchurGMRESDummySetup(void *a, void *b, void *c, void *d); -HYPRE_Int hypre_ParILURAPSchurGMRESSolve(void *ilu_vdata, void *ilu_vdata2, hypre_ParVector *f, hypre_ParVector *u); -void *hypre_ParILURAPSchurGMRESMatvecCreate(void *ilu_vdata, void *x); -HYPRE_Int hypre_ParILURAPSchurGMRESMatvec(void *matvec_data, HYPRE_Complex alpha, void *ilu_vdata, void *x, HYPRE_Complex beta, void *y); -HYPRE_Int hypre_ParILURAPSchurGMRESMatvecDestroy(void *matvec_data ); -#endif - #endif /* #ifndef hypre_ParILU_DATA_HEADER */ - diff --git a/external/hypre/src/parcsr_ls/par_ilu_setup.c b/external/hypre/src/parcsr_ls/par_ilu_setup.c index 4a62d38a..0742fb82 100644 --- a/external/hypre/src/parcsr_ls/par_ilu_setup.c +++ b/external/hypre/src/parcsr_ls/par_ilu_setup.c @@ -1,67 +1,59 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ + #include "_hypre_parcsr_ls.h" -#include "_hypre_utilities.hpp" -#include "par_ilu.h" -#include "seq_mv.hpp" -/* Setup ILU data */ +/*-------------------------------------------------------------------------- + * hypre_ILUSetup + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_ILUSetup( void *ilu_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ) { - MPI_Comm comm = hypre_ParCSRMatrixComm(A); + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + HYPRE_MemoryLocation memory_location = hypre_ParCSRMatrixMemoryLocation(A); hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; hypre_ParILUData *schur_precond_ilu; hypre_ParNSHData *schur_solver_nsh; - HYPRE_Int i; - // HYPRE_Int num_threads; - // HYPRE_Int debug_flag = 0; - - /* pointers to ilu data */ - HYPRE_Int logging = hypre_ParILUDataLogging(ilu_data); - HYPRE_Int print_level = hypre_ParILUDataPrintLevel(ilu_data); - HYPRE_Int ilu_type = hypre_ParILUDataIluType(ilu_data); - HYPRE_Int nLU = hypre_ParILUDataNLU(ilu_data); - HYPRE_Int nI = hypre_ParILUDataNI(ilu_data); - HYPRE_Int fill_level = hypre_ParILUDataLfil(ilu_data); - HYPRE_Int max_row_elmts = hypre_ParILUDataMaxRowNnz(ilu_data); + /* Pointers to ilu data */ + HYPRE_Int logging = hypre_ParILUDataLogging(ilu_data); + HYPRE_Int print_level = hypre_ParILUDataPrintLevel(ilu_data); + HYPRE_Int ilu_type = hypre_ParILUDataIluType(ilu_data); + HYPRE_Int nLU = hypre_ParILUDataNLU(ilu_data); + HYPRE_Int nI = hypre_ParILUDataNI(ilu_data); + HYPRE_Int fill_level = hypre_ParILUDataLfil(ilu_data); + HYPRE_Int max_row_elmts = hypre_ParILUDataMaxRowNnz(ilu_data); HYPRE_Real *droptol = hypre_ParILUDataDroptol(ilu_data); HYPRE_Int *CF_marker_array = hypre_ParILUDataCFMarkerArray(ilu_data); HYPRE_Int *perm = hypre_ParILUDataPerm(ilu_data); HYPRE_Int *qperm = hypre_ParILUDataQPerm(ilu_data); - HYPRE_Real tol_ddPQ = hypre_ParILUDataTolDDPQ(ilu_data); - -#ifdef HYPRE_USING_CUDA - /* pointers to cusparse data, note that they are not NULL only when needed */ - cusparseMatDescr_t matL_des = hypre_ParILUDataMatLMatrixDescription(ilu_data); - cusparseMatDescr_t matU_des = hypre_ParILUDataMatUMatrixDescription(ilu_data); - void *ilu_solve_buffer = hypre_ParILUDataILUSolveBuffer(ilu_data);//device memory - cusparseSolvePolicy_t ilu_solve_policy = hypre_ParILUDataILUSolvePolicy(ilu_data); - hypre_ParCSRMatrix *Aperm = hypre_ParILUDataAperm(ilu_data); - hypre_ParCSRMatrix *R = hypre_ParILUDataR(ilu_data); - hypre_ParCSRMatrix *P = hypre_ParILUDataP(ilu_data); - hypre_CSRMatrix *matALU_d = hypre_ParILUDataMatAILUDevice(ilu_data); - hypre_CSRMatrix *matBLU_d = hypre_ParILUDataMatBILUDevice(ilu_data); - hypre_CSRMatrix *matSLU_d = hypre_ParILUDataMatSILUDevice(ilu_data); - hypre_CSRMatrix *matE_d = hypre_ParILUDataMatEDevice(ilu_data); - hypre_CSRMatrix *matF_d = hypre_ParILUDataMatFDevice(ilu_data); - csrsv2Info_t matAL_info = hypre_ParILUDataMatALILUSolveInfo(ilu_data); - csrsv2Info_t matAU_info = hypre_ParILUDataMatAUILUSolveInfo(ilu_data); - csrsv2Info_t matBL_info = hypre_ParILUDataMatBLILUSolveInfo(ilu_data); - csrsv2Info_t matBU_info = hypre_ParILUDataMatBUILUSolveInfo(ilu_data); - csrsv2Info_t matSL_info = hypre_ParILUDataMatSLILUSolveInfo(ilu_data); - csrsv2Info_t matSU_info = hypre_ParILUDataMatSUILUSolveInfo(ilu_data); - HYPRE_Int *A_diag_fake = hypre_ParILUDataMatAFakeDiagonal(ilu_data); - hypre_Vector *Ftemp_upper = NULL; - hypre_Vector *Utemp_lower = NULL; + HYPRE_Real tol_ddPQ = hypre_ParILUDataTolDDPQ(ilu_data); + + /* Pointers to device data, note that they are not NULL only when needed */ +#if defined(HYPRE_USING_GPU) +#if defined(HYPRE_USING_UNIFIED_MEMORY) + HYPRE_Int test_opt = hypre_ParILUDataTestOption(ilu_data); +#endif + hypre_ParCSRMatrix *Aperm = hypre_ParILUDataAperm(ilu_data); + hypre_ParCSRMatrix *R = hypre_ParILUDataR(ilu_data); + hypre_ParCSRMatrix *P = hypre_ParILUDataP(ilu_data); + hypre_CSRMatrix *matALU_d = hypre_ParILUDataMatAILUDevice(ilu_data); + hypre_CSRMatrix *matBLU_d = hypre_ParILUDataMatBILUDevice(ilu_data); + hypre_CSRMatrix *matSLU_d = hypre_ParILUDataMatSILUDevice(ilu_data); + hypre_CSRMatrix *matE_d = hypre_ParILUDataMatEDevice(ilu_data); + hypre_CSRMatrix *matF_d = hypre_ParILUDataMatFDevice(ilu_data); + hypre_Vector *Ftemp_upper = NULL; + hypre_Vector *Utemp_lower = NULL; + hypre_Vector *Adiag_diag = NULL; + hypre_Vector *Sdiag_diag = NULL; #endif hypre_ParCSRMatrix *matA = hypre_ParILUDataMatA(ilu_data); @@ -72,596 +64,604 @@ hypre_ILUSetup( void *ilu_vdata, HYPRE_Real *matmD = hypre_ParILUDataMatDModified(ilu_data); hypre_ParCSRMatrix *matmU = hypre_ParILUDataMatUModified(ilu_data); hypre_ParCSRMatrix *matS = hypre_ParILUDataMatS(ilu_data); -// hypre_ParCSRMatrix *matM = NULL; -// HYPRE_Int nnzG;/* g stands for global */ - HYPRE_Real nnzS;/* total nnz in S */ - HYPRE_Int nnzS_offd; - HYPRE_Int size_C/* total size of coarse grid */; - - HYPRE_Int n = hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(A)); - // HYPRE_Int m;/* m = n-LU */ - /* reordering option */ - HYPRE_Int reordering_type = hypre_ParILUDataReorderingType(ilu_data); - HYPRE_Int num_procs, my_id; + HYPRE_Int n = hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(A)); + HYPRE_Int reordering_type = hypre_ParILUDataReorderingType(ilu_data); + HYPRE_Real nnzS; /* Total nnz in S */ + HYPRE_Real nnzS_offd_local; + HYPRE_Real nnzS_offd; + HYPRE_Int size_C /* Total size of coarse grid */; hypre_ParVector *Utemp = NULL; hypre_ParVector *Ftemp = NULL; hypre_ParVector *Xtemp = NULL; hypre_ParVector *Ytemp = NULL; + hypre_ParVector *Ztemp = NULL; HYPRE_Real *uext = NULL; HYPRE_Real *fext = NULL; hypre_ParVector *rhs = NULL; hypre_ParVector *x = NULL; + + /* TODO (VPM): Change F_array and U_array variable names */ hypre_ParVector *F_array = hypre_ParILUDataF(ilu_data); hypre_ParVector *U_array = hypre_ParILUDataU(ilu_data); hypre_ParVector *residual = hypre_ParILUDataResidual(ilu_data); HYPRE_Real *rel_res_norms = hypre_ParILUDataRelResNorms(ilu_data); /* might need for Schur Complement */ - HYPRE_Int *u_end = NULL; - HYPRE_Solver schur_solver = NULL; - HYPRE_Solver schur_precond = NULL; - HYPRE_Solver schur_precond_gotten = NULL; + HYPRE_Int *u_end = NULL; + HYPRE_Solver schur_solver = NULL; + HYPRE_Solver schur_precond = NULL; + HYPRE_Solver schur_precond_gotten = NULL; + + /* Whether or not to use exact (direct) triangular solves */ + HYPRE_Int tri_solve = hypre_ParILUDataTriSolve(ilu_data); /* help to build external */ hypre_ParCSRCommPkg *comm_pkg; - HYPRE_Int buffer_size; - HYPRE_Int send_size; - HYPRE_Int recv_size; -#ifdef HYPRE_USING_CUDA - HYPRE_Int test_opt; -#endif - /* ----- begin -----*/ - HYPRE_ANNOTATE_FUNC_BEGIN; - - //num_threads = hypre_NumThreads(); + HYPRE_Int buffer_size; + HYPRE_Int num_sends; + HYPRE_Int send_size; + HYPRE_Int recv_size; + HYPRE_Int num_procs, my_id; - hypre_MPI_Comm_size(comm,&num_procs); - hypre_MPI_Comm_rank(comm,&my_id); +#if defined (HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1(hypre_ParCSRMatrixMemoryLocation(A)); -#ifdef HYPRE_USING_CUDA - /* create cuda and cusparse information when needed */ - /* Use most of them from global information */ - /* set matrix L descripter, L is a lower triangular matrix with unit diagonal entries */ - if (!matL_des) - { - HYPRE_CUSPARSE_CALL(cusparseCreateMatDescr(&(hypre_ParILUDataMatLMatrixDescription(ilu_data)))); - matL_des = hypre_ParILUDataMatLMatrixDescription(ilu_data); - HYPRE_CUSPARSE_CALL(cusparseSetMatIndexBase(matL_des, CUSPARSE_INDEX_BASE_ZERO)); - HYPRE_CUSPARSE_CALL(cusparseSetMatType(matL_des, CUSPARSE_MATRIX_TYPE_GENERAL)); - HYPRE_CUSPARSE_CALL(cusparseSetMatFillMode(matL_des, CUSPARSE_FILL_MODE_LOWER)); - HYPRE_CUSPARSE_CALL(cusparseSetMatDiagType(matL_des, CUSPARSE_DIAG_TYPE_UNIT)); - } - /* set matrix U descripter, U is a upper triangular matrix with non-unit diagonal entries */ - if (!matU_des) - { - HYPRE_CUSPARSE_CALL(cusparseCreateMatDescr(&(hypre_ParILUDataMatUMatrixDescription(ilu_data)))); - matU_des = hypre_ParILUDataMatUMatrixDescription(ilu_data); - HYPRE_CUSPARSE_CALL(cusparseSetMatIndexBase(matU_des, CUSPARSE_INDEX_BASE_ZERO)); - HYPRE_CUSPARSE_CALL(cusparseSetMatType(matU_des, CUSPARSE_MATRIX_TYPE_GENERAL)); - HYPRE_CUSPARSE_CALL(cusparseSetMatFillMode(matU_des, CUSPARSE_FILL_MODE_UPPER)); - HYPRE_CUSPARSE_CALL(cusparseSetMatDiagType(matU_des, CUSPARSE_DIAG_TYPE_NON_UNIT)); - } - if (!matAL_info) - { - HYPRE_CUSPARSE_CALL( (cusparseDestroyCsrsv2Info(hypre_ParILUDataMatALILUSolveInfo(ilu_data))) ); - matAL_info = NULL; - } - if (!matAU_info) - { - HYPRE_CUSPARSE_CALL( (cusparseDestroyCsrsv2Info(hypre_ParILUDataMatAUILUSolveInfo(ilu_data))) ); - matAU_info = NULL; - } - if (!matBL_info) - { - HYPRE_CUSPARSE_CALL( (cusparseDestroyCsrsv2Info(hypre_ParILUDataMatBLILUSolveInfo(ilu_data))) ); - matBL_info = NULL; - } - if (!matBU_info) - { - HYPRE_CUSPARSE_CALL( (cusparseDestroyCsrsv2Info(hypre_ParILUDataMatBUILUSolveInfo(ilu_data))) ); - matBU_info = NULL; - } - if (!matSL_info) - { - HYPRE_CUSPARSE_CALL( (cusparseDestroyCsrsv2Info(hypre_ParILUDataMatSLILUSolveInfo(ilu_data))) ); - matSL_info = NULL; - } - if (!matSU_info) - { - HYPRE_CUSPARSE_CALL( (cusparseDestroyCsrsv2Info(hypre_ParILUDataMatSUILUSolveInfo(ilu_data))) ); - matSU_info = NULL; - } - if (ilu_solve_buffer) - { - hypre_TFree(ilu_solve_buffer, HYPRE_MEMORY_DEVICE); - ilu_solve_buffer = NULL; - } - if (matALU_d) - { - hypre_CSRMatrixDestroy( matALU_d ); - matALU_d = NULL; - } - if (matSLU_d) + /* TODO (VPM): Placeholder check to avoid -Wunused-variable warning. Remove this! */ + if (exec != HYPRE_EXEC_DEVICE && exec != HYPRE_EXEC_HOST) { - hypre_CSRMatrixDestroy( matSLU_d ); - matSLU_d = NULL; - } - if (matBLU_d) - { - hypre_CSRMatrixDestroy( matBLU_d ); - matBLU_d = NULL; - } - if (matE_d) - { - hypre_CSRMatrixDestroy( matE_d ); - matE_d = NULL; - } - if (matF_d) - { - hypre_CSRMatrixDestroy( matF_d ); - matF_d = NULL; - } - if (Aperm) - { - hypre_ParCSRMatrixDestroy( Aperm ); - Aperm = NULL; - } - if (R) - { - hypre_ParCSRMatrixDestroy( R ); - R = NULL; - } - if (P) - { - hypre_ParCSRMatrixDestroy( P ); - P = NULL; - } - if (hypre_ParILUDataXTemp(ilu_data)) - { - hypre_ParVectorDestroy(hypre_ParILUDataXTemp(ilu_data)); - hypre_ParILUDataXTemp(ilu_data) = NULL; - } - if (hypre_ParILUDataYTemp(ilu_data)) - { - hypre_ParVectorDestroy(hypre_ParILUDataYTemp(ilu_data)); - hypre_ParILUDataYTemp(ilu_data) = NULL; - } - if (hypre_ParILUDataFTempUpper(ilu_data)) - { - hypre_SeqVectorDestroy(hypre_ParILUDataFTempUpper(ilu_data)); - hypre_ParILUDataFTempUpper(ilu_data) = NULL; - } - if (hypre_ParILUDataUTempLower(ilu_data)) - { - hypre_SeqVectorDestroy(hypre_ParILUDataUTempLower(ilu_data)); - hypre_ParILUDataUTempLower(ilu_data) = NULL; - } - if (hypre_ParILUDataMatAFakeDiagonal(ilu_data)) - { - hypre_TFree(hypre_ParILUDataMatAFakeDiagonal(ilu_data), HYPRE_MEMORY_DEVICE); - hypre_ParILUDataMatAFakeDiagonal(ilu_data) = NULL; + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Need to run either on host or device!"); + return hypre_error_flag; } #endif - /* Free Previously allocated data, if any not destroyed */ - if (matL) - { - hypre_ParCSRMatrixDestroy(matL); - matL = NULL; - } - if (matU) - { - hypre_ParCSRMatrixDestroy(matU); - matU = NULL; - } - if (matmL) - { - hypre_ParCSRMatrixDestroy(matmL); - matmL = NULL; - } - if (matmU) - { - hypre_ParCSRMatrixDestroy(matmU); - matmU = NULL; - } - if (matS) + /* Sanity checks */ +#if defined(HYPRE_USING_CUDA) && !defined(HYPRE_USING_CUSPARSE) { - hypre_ParCSRMatrixDestroy(matS); - matS = NULL; - } - if (matD) - { - hypre_TFree(matD, HYPRE_MEMORY_DEVICE); - matD = NULL; + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ILU CUDA build requires cuSPARSE!"); + return hypre_error_flag; } - if (matmD) +#elif defined(HYPRE_USING_HIP) && !defined(HYPRE_USING_ROCSPARSE) { - hypre_TFree(matmD, HYPRE_MEMORY_DEVICE); - matmD = NULL; + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ILU HIP build requires rocSPARSE!"); + return hypre_error_flag; } - if (CF_marker_array) +#elif defined(HYPRE_USING_SYCL) && !defined(HYPRE_USING_ONEMKLSPARSE) { - hypre_TFree(CF_marker_array, HYPRE_MEMORY_HOST); - CF_marker_array = NULL; + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ILU SYCL build requires oneMKLSparse!"); + return hypre_error_flag; } +#endif + + /* ----- begin -----*/ + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("hypre_ILUSetup"); + + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); + +#if defined(HYPRE_USING_GPU) + hypre_CSRMatrixDestroy(matALU_d); matALU_d = NULL; + hypre_CSRMatrixDestroy(matSLU_d); matSLU_d = NULL; + hypre_CSRMatrixDestroy(matBLU_d); matBLU_d = NULL; + hypre_CSRMatrixDestroy(matE_d); matE_d = NULL; + hypre_CSRMatrixDestroy(matF_d); matF_d = NULL; + hypre_ParCSRMatrixDestroy(Aperm); Aperm = NULL; + hypre_ParCSRMatrixDestroy(R); R = NULL; + hypre_ParCSRMatrixDestroy(P); P = NULL; + + hypre_SeqVectorDestroy(hypre_ParILUDataFTempUpper(ilu_data)); + hypre_SeqVectorDestroy(hypre_ParILUDataUTempLower(ilu_data)); + hypre_ParVectorDestroy(hypre_ParILUDataXTemp(ilu_data)); + hypre_ParVectorDestroy(hypre_ParILUDataYTemp(ilu_data)); + hypre_ParVectorDestroy(hypre_ParILUDataZTemp(ilu_data)); + hypre_SeqVectorDestroy(hypre_ParILUDataADiagDiag(ilu_data)); + hypre_SeqVectorDestroy(hypre_ParILUDataSDiagDiag(ilu_data)); + + hypre_ParILUDataFTempUpper(ilu_data) = NULL; + hypre_ParILUDataUTempLower(ilu_data) = NULL; + hypre_ParILUDataXTemp(ilu_data) = NULL; + hypre_ParILUDataYTemp(ilu_data) = NULL; + hypre_ParILUDataZTemp(ilu_data) = NULL; + hypre_ParILUDataADiagDiag(ilu_data) = NULL; + hypre_ParILUDataSDiagDiag(ilu_data) = NULL; +#endif + /* Free previously allocated data, if any not destroyed */ + hypre_ParCSRMatrixDestroy(matL); matL = NULL; + hypre_ParCSRMatrixDestroy(matU); matU = NULL; + hypre_ParCSRMatrixDestroy(matmL); matmL = NULL; + hypre_ParCSRMatrixDestroy(matmU); matmU = NULL; + hypre_ParCSRMatrixDestroy(matS); matS = NULL; + + hypre_TFree(matD, HYPRE_MEMORY_DEVICE); + hypre_TFree(matmD, HYPRE_MEMORY_DEVICE); + hypre_TFree(CF_marker_array, HYPRE_MEMORY_HOST); /* clear old l1_norm data, if created */ - if (hypre_ParILUDataL1Norms(ilu_data)) - { - hypre_TFree(hypre_ParILUDataL1Norms(ilu_data), HYPRE_MEMORY_HOST); - hypre_ParILUDataL1Norms(ilu_data) = NULL; - } + hypre_TFree(hypre_ParILUDataL1Norms(ilu_data), HYPRE_MEMORY_HOST); /* setup temporary storage * first check is they've already here */ - if (hypre_ParILUDataUTemp(ilu_data)) - { - hypre_ParVectorDestroy(hypre_ParILUDataUTemp(ilu_data)); - hypre_ParILUDataUTemp(ilu_data) = NULL; - } - if (hypre_ParILUDataFTemp(ilu_data)) - { - hypre_ParVectorDestroy(hypre_ParILUDataFTemp(ilu_data)); - hypre_ParILUDataFTemp(ilu_data) = NULL; - } - if (hypre_ParILUDataUExt(ilu_data)) - { - hypre_TFree(hypre_ParILUDataUExt(ilu_data), HYPRE_MEMORY_HOST); - hypre_ParILUDataUExt(ilu_data) = NULL; - } - if ( hypre_ParILUDataFExt(ilu_data)) - { - hypre_TFree(hypre_ParILUDataFExt(ilu_data), HYPRE_MEMORY_HOST); - hypre_ParILUDataFExt(ilu_data) = NULL; - } - if ( hypre_ParILUDataUEnd(ilu_data)) - { - hypre_TFree(hypre_ParILUDataUEnd(ilu_data), HYPRE_MEMORY_HOST); - hypre_ParILUDataUEnd(ilu_data) = NULL; - } - if (hypre_ParILUDataRhs(ilu_data)) - { - hypre_ParVectorDestroy(hypre_ParILUDataRhs(ilu_data)); - hypre_ParILUDataRhs(ilu_data) = NULL; - } - if (hypre_ParILUDataX(ilu_data)) - { - hypre_ParVectorDestroy(hypre_ParILUDataX(ilu_data)); - hypre_ParILUDataX(ilu_data) = NULL; - } - if (hypre_ParILUDataResidual(ilu_data)) - { - hypre_ParVectorDestroy(hypre_ParILUDataResidual(ilu_data)); - hypre_ParILUDataResidual(ilu_data) = NULL; - } - if (hypre_ParILUDataRelResNorms(ilu_data)) - { - hypre_TFree(hypre_ParILUDataRelResNorms(ilu_data), HYPRE_MEMORY_HOST); - hypre_ParILUDataRelResNorms(ilu_data) = NULL; - } + hypre_ParVectorDestroy(hypre_ParILUDataUTemp(ilu_data)); + hypre_ParVectorDestroy(hypre_ParILUDataFTemp(ilu_data)); + hypre_ParVectorDestroy(hypre_ParILUDataRhs(ilu_data)); + hypre_ParVectorDestroy(hypre_ParILUDataX(ilu_data)); + hypre_ParVectorDestroy(hypre_ParILUDataResidual(ilu_data)); + hypre_TFree(hypre_ParILUDataUExt(ilu_data), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_ParILUDataFExt(ilu_data), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_ParILUDataUEnd(ilu_data), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_ParILUDataRelResNorms(ilu_data), HYPRE_MEMORY_HOST); + + hypre_ParILUDataUTemp(ilu_data) = NULL; + hypre_ParILUDataFTemp(ilu_data) = NULL; + hypre_ParILUDataRhs(ilu_data) = NULL; + hypre_ParILUDataX(ilu_data) = NULL; + hypre_ParILUDataResidual(ilu_data) = NULL; + if (hypre_ParILUDataSchurSolver(ilu_data)) { - switch(ilu_type){ + switch (ilu_type) + { case 10: case 11: case 40: case 41: case 50: HYPRE_ParCSRGMRESDestroy(hypre_ParILUDataSchurSolver(ilu_data)); //GMRES for Schur break; + case 20: case 21: hypre_NSHDestroy(hypre_ParILUDataSchurSolver(ilu_data)); //NSH for Schur break; + default: break; } (hypre_ParILUDataSchurSolver(ilu_data)) = NULL; } - if (hypre_ParILUDataSchurPrecond(ilu_data)) - { - switch(ilu_type){ - case 10: case 11: case 40: case 41: -#ifdef HYPRE_USING_CUDA - if (hypre_ParILUDataIluType(ilu_data) != 10 && - hypre_ParILUDataIluType(ilu_data) != 11) - { -#endif - HYPRE_ILUDestroy(hypre_ParILUDataSchurPrecond(ilu_data)); //ILU as precond for Schur -#ifdef HYPRE_USING_CUDA - } + + /* ILU as precond for Schur */ + if ( hypre_ParILUDataSchurPrecond(ilu_data) && +#if defined(HYPRE_USING_GPU) + hypre_ParILUDataIluType(ilu_data) != 10 && + hypre_ParILUDataIluType(ilu_data) != 11 && #endif - break; - default: - break; - } - (hypre_ParILUDataSchurPrecond(ilu_data)) = NULL; + (hypre_ParILUDataIluType(ilu_data) == 10 || + hypre_ParILUDataIluType(ilu_data) == 11 || + hypre_ParILUDataIluType(ilu_data) == 40 || + hypre_ParILUDataIluType(ilu_data) == 41) ) + { + HYPRE_ILUDestroy(hypre_ParILUDataSchurPrecond(ilu_data)); + hypre_ParILUDataSchurPrecond(ilu_data) = NULL; } - /* start to create working vectors */ + + /* Create work vectors */ Utemp = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A), - hypre_ParCSRMatrixGlobalNumRows(A), - hypre_ParCSRMatrixRowStarts(A)); + hypre_ParCSRMatrixGlobalNumRows(A), + hypre_ParCSRMatrixRowStarts(A)); hypre_ParVectorInitialize(Utemp); hypre_ParILUDataUTemp(ilu_data) = Utemp; Ftemp = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A), - hypre_ParCSRMatrixGlobalNumRows(A), - hypre_ParCSRMatrixRowStarts(A)); + hypre_ParCSRMatrixGlobalNumRows(A), + hypre_ParCSRMatrixRowStarts(A)); hypre_ParVectorInitialize(Ftemp); hypre_ParILUDataFTemp(ilu_data) = Ftemp; + /* set matrix, solution and rhs pointers */ - matA = A; + matA = A; F_array = f; U_array = u; - // create perm arary if necessary - if (perm == NULL) + /* Create perm array if necessary */ + if (!perm) { - switch(ilu_type) + switch (ilu_type) { - case 10: case 11: case 20: case 21: case 30: case 31: case 50:/* symmetric */ - hypre_ILUGetInteriorExteriorPerm(matA, &perm, &nLU, reordering_type); + case 10: case 11: case 20: case 21: case 30: case 31: case 50: + /* symmetric */ + hypre_ILUGetInteriorExteriorPerm(matA, memory_location, &perm, &nLU, reordering_type); break; - case 40: case 41:/* ddPQ */ + + case 40: case 41: + /* ddPQ */ hypre_ILUGetPermddPQ(matA, &perm, &qperm, tol_ddPQ, &nLU, &nI, reordering_type); break; + case 0: case 1: - hypre_ILUGetLocalPerm(matA, &perm, &nLU, reordering_type); - break; default: + /* RCM or none */ hypre_ILUGetLocalPerm(matA, &perm, &nLU, reordering_type); break; } } - // m = n - nLU; - /* factorization */ - switch(ilu_type) + + /* Factorization */ + switch (ilu_type) { - case 0: -#ifdef HYPRE_USING_CUDA - /* only apply the setup of ILU0 with cusparse */ - if (fill_level == 0) - { - hypre_ILUSetupILU0Device(matA, perm, perm, n, n, matL_des, matU_des, ilu_solve_policy, &ilu_solve_buffer, - &matBL_info, &matBU_info, &matSL_info, &matSU_info, &matBLU_d, &matS, - &matE_d, &matF_d, &A_diag_fake);//BJ + cusparse_ilu0() - } - else - { - hypre_ILUSetupILUKDevice(matA, fill_level, perm, perm, n, n, matL_des, matU_des, ilu_solve_policy, &ilu_solve_buffer, - &matBL_info, &matBU_info, &matSL_info, &matSU_info, &matBLU_d, &matS, - &matE_d, &matF_d, &A_diag_fake);//BJ + hypre_iluk(), setup the device solve - } -#else - hypre_ILUSetupILUK(matA, fill_level, perm, perm, n, n, &matL, &matD, &matU, &matS, &u_end); //BJ + hypre_iluk() -#endif - break; - case 1: -#ifdef HYPRE_USING_CUDA - hypre_ILUSetupILUTDevice(matA, max_row_elmts, droptol, perm, perm, n, n, matL_des, matU_des, ilu_solve_policy, &ilu_solve_buffer, - &matBL_info, &matBU_info, &matSL_info, &matSU_info, &matBLU_d, &matS, - &matE_d, &matF_d, &A_diag_fake);//BJ + hypre_ilut(), setup the device solve -#else - hypre_ILUSetupILUT(matA, max_row_elmts, droptol, perm, perm, n, n, &matL, &matD, &matU, &matS, &u_end); //BJ + hypre_ilut() -#endif - break; - case 10: -#ifdef HYPRE_USING_CUDA - if (fill_level == 0) - { - /* Only support ILU0 */ - hypre_ILUSetupILU0Device(matA, perm, perm, n, nLU, matL_des, matU_des, ilu_solve_policy, &ilu_solve_buffer, - &matBL_info, &matBU_info, &matSL_info, &matSU_info, &matBLU_d, &matS, - &matE_d, &matF_d, &A_diag_fake);//BJ + cusparse_ilu0() - } - else - { - hypre_ILUSetupILUKDevice(matA, fill_level, perm, perm, n, nLU, matL_des, matU_des, ilu_solve_policy, &ilu_solve_buffer, - &matBL_info, &matBU_info, &matSL_info, &matSU_info, &matBLU_d, &matS, - &matE_d, &matF_d, &A_diag_fake);//BJ + cusparse_ilu0() - } -#else - hypre_ILUSetupILUK(matA, fill_level, perm, perm, nLU, nLU, &matL, &matD, &matU, &matS, &u_end); //GMRES + hypre_iluk() + case 0: /* BJ + hypre_iluk() */ +#if defined(HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_ILUSetupDevice(ilu_data, matA, perm, perm, n, n, + &matBLU_d, &matS, &matE_d, &matF_d); + } + else #endif - break; - case 11: -#ifdef HYPRE_USING_CUDA - hypre_ILUSetupILUTDevice(matA, max_row_elmts, droptol, perm, perm, n, nLU, matL_des, matU_des, ilu_solve_policy, &ilu_solve_buffer, - &matBL_info, &matBU_info, &matSL_info, &matSU_info, &matBLU_d, &matS, - &matE_d, &matF_d, &A_diag_fake);//BJ + cusparse_ilu0() -#else - hypre_ILUSetupILUT(matA, max_row_elmts, droptol, perm, perm, nLU, nLU, &matL, &matD, &matU, &matS, &u_end); //GMRES + hypre_ilut() + { + hypre_ILUSetupILUK(matA, fill_level, perm, perm, n, n, + &matL, &matD, &matU, &matS, &u_end); + } + break; + + case 1: /* BJ + hypre_ilut() */ +#if defined(HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_ILUSetupDevice(ilu_data, matA, perm, perm, n, n, + &matBLU_d, &matS, &matE_d, &matF_d); + } + else #endif - break; - case 20: hypre_ILUSetupILUK(matA, fill_level, perm, perm, nLU, nLU, &matL, &matD, &matU, &matS, &u_end); //Newton Schulz Hotelling + hypre_iluk() - break; - case 21: hypre_ILUSetupILUT(matA, max_row_elmts, droptol, perm, perm, nLU, nLU, &matL, &matD, &matU, &matS, &u_end); //Newton Schulz Hotelling + hypre_ilut() - break; - case 30: hypre_ILUSetupILUKRAS(matA, fill_level, perm, nLU, &matL, &matD, &matU); //RAS + hypre_iluk() - break; - case 31: hypre_ILUSetupILUTRAS(matA, max_row_elmts, droptol, perm, nLU, &matL, &matD, &matU); //RAS + hypre_ilut() - break; - case 40: hypre_ILUSetupILUK(matA, fill_level, perm, qperm, nLU, nI, &matL, &matD, &matU, &matS, &u_end); //ddPQ + GMRES + hypre_iluk() - break; - case 41: hypre_ILUSetupILUT(matA, max_row_elmts, droptol, perm, qperm, nLU, nI, &matL, &matD, &matU, &matS, &u_end); //ddPQ + GMRES + hypre_ilut() - break; - case 50: -#ifdef HYPRE_USING_CUDA - test_opt = hypre_ParILUDataTestOption(ilu_data); - hypre_ILUSetupRAPILU0Device(matA, perm, n, nLU, matL_des, matU_des, ilu_solve_policy, - &ilu_solve_buffer, &matAL_info, &matAU_info, &matBL_info, &matBU_info, &matSL_info, &matSU_info, - &Aperm, &matS, &matALU_d, &matBLU_d, &matSLU_d, &matE_d, &matF_d, test_opt); //RAP + hypre_modified_ilu0 -#else - hypre_ILUSetupRAPILU0(matA, perm, n, nLU, &matL, &matD, &matU, &matmL, &matmD, &matmU, &u_end); //RAP + hypre_modified_ilu0 + { + hypre_ILUSetupILUT(matA, max_row_elmts, droptol, perm, perm, n, n, + &matL, &matD, &matU, &matS, &u_end); + } + break; + + case 10: /* GMRES + hypre_iluk() */ +#if defined(HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_ILUSetupDevice(ilu_data, matA, perm, perm, n, nLU, + &matBLU_d, &matS, &matE_d, &matF_d); + } + else #endif - break; - default: -#ifdef HYPRE_USING_CUDA - hypre_ILUSetupILU0Device(matA, perm, perm, n, n, matL_des, matU_des, ilu_solve_policy, &ilu_solve_buffer, - &matBL_info, &matBU_info, &matSL_info, &matSU_info, &matBLU_d, &matS, - &matE_d, &matF_d, &A_diag_fake);//BJ + cusparse_ilu0() -#else - hypre_ILUSetupILU0(matA, perm, perm, n, n, &matL, &matD, &matU, &matS, &u_end);//BJ + hypre_ilu0() + { + hypre_ILUSetupILUK(matA, fill_level, perm, perm, nLU, nLU, + &matL, &matD, &matU, &matS, &u_end); + } + break; + + case 11: /* GMRES + hypre_ilut() */ +#if defined(HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_ILUSetupDevice(ilu_data, matA, perm, perm, n, nLU, + &matBLU_d, &matS, &matE_d, &matF_d); + } + else #endif - break; - } - /* setup Schur solver */ - switch(ilu_type) - { - case 10: case 11: - if (matS) { -#ifdef HYPRE_USING_CUDA - /* create working vectors */ + hypre_ILUSetupILUT(matA, max_row_elmts, droptol, perm, perm, nLU, nLU, + &matL, &matD, &matU, &matS, &u_end); + } + break; - Xtemp = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(matS), - hypre_ParCSRMatrixGlobalNumRows(matS), - hypre_ParCSRMatrixRowStarts(matS)); - hypre_ParVectorInitialize(Xtemp); + case 20: /* Newton Schulz Hotelling + hypre_iluk() */ +#if defined(HYPRE_USING_GPU) && !defined(HYPRE_USING_UNIFIED_MEMORY) + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "NSH+ILUK setup on device runs requires unified memory!"); + return hypre_error_flag; + } +#endif - Ytemp = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(matS), - hypre_ParCSRMatrixGlobalNumRows(matS), - hypre_ParCSRMatrixRowStarts(matS)); - hypre_ParVectorInitialize(Ytemp); + hypre_ILUSetupILUK(matA, fill_level, perm, perm, nLU, nLU, + &matL, &matD, &matU, &matS, &u_end); + break; - Ftemp_upper = hypre_SeqVectorCreate(nLU); - hypre_VectorOwnsData(Ftemp_upper) = 0; - hypre_VectorData(Ftemp_upper) = hypre_VectorData(hypre_ParVectorLocalVector(Ftemp)); - hypre_SeqVectorInitialize(Ftemp_upper); + case 21: /* Newton Schulz Hotelling + hypre_ilut() */ +#if defined(HYPRE_USING_GPU) && !defined(HYPRE_USING_UNIFIED_MEMORY) + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "NSH+ILUT setup on device runs requires unified memory!"); + return hypre_error_flag; + } +#endif - Utemp_lower = hypre_SeqVectorCreate(n - nLU); - hypre_VectorOwnsData(Utemp_lower) = 0; - hypre_VectorData(Utemp_lower) = hypre_VectorData(hypre_ParVectorLocalVector(Utemp)) + nLU; - hypre_SeqVectorInitialize(Utemp_lower); + hypre_ILUSetupILUT(matA, max_row_elmts, droptol, perm, perm, nLU, nLU, + &matL, &matD, &matU, &matS, &u_end); + break; - /* create GMRES */ -// HYPRE_ParCSRGMRESCreate(comm, &schur_solver); + case 30: /* RAS + hypre_iluk() */ +#if defined(HYPRE_USING_GPU) && !defined(HYPRE_USING_UNIFIED_MEMORY) + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "RAS+ILUK setup on device runs requires unified memory!"); + return hypre_error_flag; + } +#endif - hypre_GMRESFunctions * gmres_functions; + hypre_ILUSetupILUKRAS(matA, fill_level, perm, nLU, + &matL, &matD, &matU); + break; - gmres_functions = - hypre_GMRESFunctionsCreate( - hypre_CAlloc, - hypre_ParKrylovFree, - hypre_ParILUCusparseSchurGMRESCommInfo, //parCSR A -> ilu_data - hypre_ParKrylovCreateVector, - hypre_ParKrylovCreateVectorArray, - hypre_ParKrylovDestroyVector, - hypre_ParILUCusparseSchurGMRESMatvecCreate, //parCSR A -- inactive - hypre_ParILUCusparseSchurGMRESMatvec, //parCSR A -> ilu_data - hypre_ParILUCusparseSchurGMRESMatvecDestroy, //parCSR A -- inactive - hypre_ParKrylovInnerProd, - hypre_ParKrylovCopyVector, - hypre_ParKrylovClearVector, - hypre_ParKrylovScaleVector, - hypre_ParKrylovAxpy, - hypre_ParKrylovIdentitySetup, //parCSR A -- inactive - hypre_ParKrylovIdentity ); //parCSR A -- inactive - schur_solver = ( (HYPRE_Solver) hypre_GMRESCreate( gmres_functions ) ); + case 31: /* RAS + hypre_ilut() */ +#if defined(HYPRE_USING_GPU) && !defined(HYPRE_USING_UNIFIED_MEMORY) + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "RAS+ILUT setup on device runs requires unified memory!"); + return hypre_error_flag; + } +#endif - /* setup GMRES parameters */ - HYPRE_GMRESSetKDim (schur_solver, hypre_ParILUDataSchurGMRESKDim(ilu_data)); - HYPRE_GMRESSetMaxIter (schur_solver, hypre_ParILUDataSchurGMRESMaxIter(ilu_data));/* we don't need that many solves */ - HYPRE_GMRESSetTol (schur_solver, hypre_ParILUDataSchurGMRESTol(ilu_data)); - HYPRE_GMRESSetAbsoluteTol (schur_solver, hypre_ParILUDataSchurGMRESAbsoluteTol(ilu_data)); - HYPRE_GMRESSetLogging (schur_solver, hypre_ParILUDataSchurSolverLogging(ilu_data)); - HYPRE_GMRESSetPrintLevel (schur_solver, hypre_ParILUDataSchurSolverPrintLevel(ilu_data));/* set to zero now, don't print */ - HYPRE_GMRESSetRelChange (schur_solver, hypre_ParILUDataSchurGMRESRelChange(ilu_data)); + hypre_ILUSetupILUTRAS(matA, max_row_elmts, droptol, + perm, nLU, &matL, &matD, &matU); + break; - /* setup preconditioner parameters */ - /* create Unit precond */ - schur_precond = (HYPRE_Solver) ilu_vdata; - /* add preconditioner to solver */ - HYPRE_GMRESSetPrecond(schur_solver, - (HYPRE_PtrToSolverFcn) hypre_ParILUCusparseSchurGMRESDummySolve, - (HYPRE_PtrToSolverFcn) hypre_ParILUCusparseSchurGMRESDummySetup, - schur_precond); - HYPRE_GMRESGetPrecond(schur_solver, &schur_precond_gotten); - if (schur_precond_gotten != (schur_precond)) - { - hypre_printf("Schur complement got bad precond\n"); - return(-1); - } + case 40: /* ddPQ + GMRES + hypre_iluk() */ +#if defined(HYPRE_USING_GPU) && !defined(HYPRE_USING_UNIFIED_MEMORY) + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "ddPQ+GMRES+ILUK setup on device runs requires unified memory!"); + return hypre_error_flag; + } +#endif - /* need to create working vector rhs and x for Schur System */ - rhs = hypre_ParVectorCreate(comm, - hypre_ParCSRMatrixGlobalNumRows(matS), - hypre_ParCSRMatrixRowStarts(matS)); - hypre_ParVectorInitialize(rhs); - x = hypre_ParVectorCreate(comm, - hypre_ParCSRMatrixGlobalNumRows(matS), - hypre_ParCSRMatrixRowStarts(matS)); - hypre_ParVectorInitialize(x); + hypre_ILUSetupILUK(matA, fill_level, perm, qperm, nLU, nI, + &matL, &matD, &matU, &matS, &u_end); + break; - /* setup solver */ - HYPRE_GMRESSetup(schur_solver,(HYPRE_Matrix)ilu_vdata,(HYPRE_Vector)rhs,(HYPRE_Vector)x); + case 41: /* ddPQ + GMRES + hypre_ilut() */ +#if defined(HYPRE_USING_GPU) && !defined(HYPRE_USING_UNIFIED_MEMORY) + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "ddPQ+GMRES+ILUT setup on device runs requires unified memory!"); + return hypre_error_flag; + } +#endif - /* solve for right-hand-side consists of only 1 */ - hypre_Vector *rhs_local = hypre_ParVectorLocalVector(rhs); - //HYPRE_Real *Xtemp_data = hypre_VectorData(Xtemp_local); - hypre_SeqVectorSetConstantValues(rhs_local, 1.0); + hypre_ILUSetupILUT(matA, max_row_elmts, droptol, perm, qperm, nLU, nI, + &matL, &matD, &matU, &matS, &u_end); + break; - /* update ilu_data */ - hypre_ParILUDataSchurSolver (ilu_data) = schur_solver; - hypre_ParILUDataSchurPrecond (ilu_data) = schur_precond; - hypre_ParILUDataRhs (ilu_data) = rhs; - hypre_ParILUDataX (ilu_data) = x; + case 50: /* RAP + hypre_modified_ilu0 */ +#if defined(HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_DEVICE) + { +#if !defined(HYPRE_USING_UNIFIED_MEMORY) + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "GMRES+ILU0-RAP setup on device runs requires unified memory!"); + return hypre_error_flag; #else - /* setup GMRES parameters */ - HYPRE_ParCSRGMRESCreate(comm, &schur_solver); + hypre_ILUSetupRAPILU0Device(matA, perm, n, nLU, + &Aperm, &matS, &matALU_d, &matBLU_d, + &matSLU_d, &matE_d, &matF_d, test_opt); +#endif + } + else +#endif + { + hypre_ILUSetupRAPILU0(matA, perm, n, nLU, &matL, &matD, &matU, + &matmL, &matmD, &matmU, &u_end); + } + break; - HYPRE_GMRESSetKDim (schur_solver, hypre_ParILUDataSchurGMRESKDim(ilu_data)); - HYPRE_GMRESSetMaxIter (schur_solver, hypre_ParILUDataSchurGMRESMaxIter(ilu_data));/* we don't need that many solves */ - HYPRE_GMRESSetTol (schur_solver, hypre_ParILUDataSchurGMRESTol(ilu_data)); - HYPRE_GMRESSetAbsoluteTol (schur_solver, hypre_ParILUDataSchurGMRESAbsoluteTol(ilu_data)); - HYPRE_GMRESSetLogging (schur_solver, hypre_ParILUDataSchurSolverLogging(ilu_data)); - HYPRE_GMRESSetPrintLevel (schur_solver, hypre_ParILUDataSchurSolverPrintLevel(ilu_data));/* set to zero now, don't print */ - HYPRE_GMRESSetRelChange (schur_solver, hypre_ParILUDataSchurGMRESRelChange(ilu_data)); + default: /* BJ + device_ilu0() */ +#if defined(HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_ILUSetupDevice(ilu_data, matA, perm, perm, n, n, + &matBLU_d, &matS, &matE_d, &matF_d); + } + else +#endif + { + hypre_ILUSetupILU0(matA, perm, perm, n, n, &matL, + &matD, &matU, &matS, &u_end); + } + break; + } - /* setup preconditioner parameters */ - /* create precond, the default is ILU0 */ - HYPRE_ILUCreate (&schur_precond); - HYPRE_ILUSetType (schur_precond, hypre_ParILUDataSchurPrecondIluType(ilu_data)); - HYPRE_ILUSetLevelOfFill (schur_precond, hypre_ParILUDataSchurPrecondIluLfil(ilu_data)); - HYPRE_ILUSetMaxNnzPerRow (schur_precond, hypre_ParILUDataSchurPrecondIluMaxRowNnz(ilu_data)); - HYPRE_ILUSetDropThresholdArray(schur_precond, hypre_ParILUDataSchurPrecondIluDroptol(ilu_data)); - HYPRE_ILUSetPrintLevel (schur_precond, hypre_ParILUDataSchurPrecondPrintLevel(ilu_data)); - HYPRE_ILUSetMaxIter (schur_precond, hypre_ParILUDataSchurPrecondMaxIter(ilu_data)); - HYPRE_ILUSetTol (schur_precond, hypre_ParILUDataSchurPrecondTol(ilu_data)); + /* Create additional temporary vector for iterative triangular solve */ + if (!tri_solve) + { + Ztemp = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A), + hypre_ParCSRMatrixGlobalNumRows(A), + hypre_ParCSRMatrixRowStarts(A)); + hypre_ParVectorInitialize(Ztemp); + } - /* add preconditioner to solver */ - HYPRE_GMRESSetPrecond(schur_solver, - (HYPRE_PtrToSolverFcn) HYPRE_ILUSolve, - (HYPRE_PtrToSolverFcn) HYPRE_ILUSetup, - schur_precond); - HYPRE_GMRESGetPrecond(schur_solver, &schur_precond_gotten); - if (schur_precond_gotten != (schur_precond)) + /* setup Schur solver - TODO (VPM): merge host and device paths below */ + switch (ilu_type) + { + case 0: case 1: + default: + break; + + case 10: case 11: + if (matS) + { + /* Create work vectors */ +#if defined(HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_DEVICE) { - hypre_printf("Schur complement got bad precond\n"); - HYPRE_ANNOTATE_FUNC_END; + Xtemp = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(matS), + hypre_ParCSRMatrixGlobalNumRows(matS), + hypre_ParCSRMatrixRowStarts(matS)); + hypre_ParVectorInitialize(Xtemp); + + Ytemp = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(matS), + hypre_ParCSRMatrixGlobalNumRows(matS), + hypre_ParCSRMatrixRowStarts(matS)); + hypre_ParVectorInitialize(Ytemp); + + Ftemp_upper = hypre_SeqVectorCreate(nLU); + hypre_VectorOwnsData(Ftemp_upper) = 0; + hypre_VectorData(Ftemp_upper) = hypre_VectorData( + hypre_ParVectorLocalVector(Ftemp)); + hypre_SeqVectorInitialize(Ftemp_upper); + + Utemp_lower = hypre_SeqVectorCreate(n - nLU); + hypre_VectorOwnsData(Utemp_lower) = 0; + hypre_VectorData(Utemp_lower) = hypre_VectorData( + hypre_ParVectorLocalVector(Utemp)) + nLU; + hypre_SeqVectorInitialize(Utemp_lower); + + /* create GMRES */ + // HYPRE_ParCSRGMRESCreate(comm, &schur_solver); + + hypre_GMRESFunctions * gmres_functions; + + gmres_functions = + hypre_GMRESFunctionsCreate( + hypre_ParKrylovCAlloc, + hypre_ParKrylovFree, + hypre_ParILUSchurGMRESCommInfoDevice, //parCSR A -> ilu_data + hypre_ParKrylovCreateVector, + hypre_ParKrylovCreateVectorArray, + hypre_ParKrylovDestroyVector, + hypre_ParKrylovMatvecCreate, //parCSR A -- inactive + ((tri_solve == 1) ? + hypre_ParILUSchurGMRESMatvecDevice : + hypre_ParILUSchurGMRESMatvecJacIterDevice), //parCSR A -> ilu_data + hypre_ParKrylovMatvecDestroy, //parCSR A -- inactive + hypre_ParKrylovInnerProd, + hypre_ParKrylovCopyVector, + hypre_ParKrylovClearVector, + hypre_ParKrylovScaleVector, + hypre_ParKrylovAxpy, + hypre_ParKrylovIdentitySetup, //parCSR A -- inactive + hypre_ParKrylovIdentity ); //parCSR A -- inactive + schur_solver = ( (HYPRE_Solver) hypre_GMRESCreate( gmres_functions ) ); + + /* setup GMRES parameters */ + HYPRE_GMRESSetKDim (schur_solver, hypre_ParILUDataSchurGMRESKDim(ilu_data)); + HYPRE_GMRESSetMaxIter (schur_solver, + hypre_ParILUDataSchurGMRESMaxIter(ilu_data));/* we don't need that many solves */ + HYPRE_GMRESSetTol (schur_solver, hypre_ParILUDataSchurGMRESTol(ilu_data)); + HYPRE_GMRESSetAbsoluteTol (schur_solver, hypre_ParILUDataSchurGMRESAbsoluteTol(ilu_data)); + HYPRE_GMRESSetLogging (schur_solver, hypre_ParILUDataSchurSolverLogging(ilu_data)); + HYPRE_GMRESSetPrintLevel (schur_solver, + hypre_ParILUDataSchurSolverPrintLevel(ilu_data));/* set to zero now, don't print */ + HYPRE_GMRESSetRelChange (schur_solver, hypre_ParILUDataSchurGMRESRelChange(ilu_data)); + + /* setup preconditioner parameters */ + /* create Unit precond */ + schur_precond = (HYPRE_Solver) ilu_vdata; + + /* add preconditioner to solver */ + HYPRE_GMRESSetPrecond(schur_solver, + (HYPRE_PtrToSolverFcn) hypre_ParILUSchurGMRESDummySolveDevice, + (HYPRE_PtrToSolverFcn) hypre_ParKrylovIdentitySetup, + schur_precond); + + HYPRE_GMRESGetPrecond(schur_solver, &schur_precond_gotten); + if (schur_precond_gotten != (schur_precond)) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Schur complement got bad precond!"); + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; - return(-1); - } + return hypre_error_flag; + } - /* need to create working vector rhs and x for Schur System */ - rhs = hypre_ParVectorCreate(comm, - hypre_ParCSRMatrixGlobalNumRows(matS), - hypre_ParCSRMatrixRowStarts(matS)); - hypre_ParVectorInitialize(rhs); - x = hypre_ParVectorCreate(comm, - hypre_ParCSRMatrixGlobalNumRows(matS), - hypre_ParCSRMatrixRowStarts(matS)); - hypre_ParVectorInitialize(x); + /* need to create working vector rhs and x for Schur System */ + rhs = hypre_ParVectorCreate(comm, + hypre_ParCSRMatrixGlobalNumRows(matS), + hypre_ParCSRMatrixRowStarts(matS)); + hypre_ParVectorInitialize(rhs); + x = hypre_ParVectorCreate(comm, + hypre_ParCSRMatrixGlobalNumRows(matS), + hypre_ParCSRMatrixRowStarts(matS)); + hypre_ParVectorInitialize(x); + + /* setup solver */ + HYPRE_GMRESSetup(schur_solver, + (HYPRE_Matrix) ilu_vdata, + (HYPRE_Vector) rhs, + (HYPRE_Vector) x); + + /* solve for right-hand-side consists of only 1 */ + hypre_Vector *rhs_local = hypre_ParVectorLocalVector(rhs); + //HYPRE_Real *Xtemp_data = hypre_VectorData(Xtemp_local); + hypre_SeqVectorSetConstantValues(rhs_local, 1.0); + + /* update ilu_data */ + hypre_ParILUDataSchurSolver (ilu_data) = schur_solver; + hypre_ParILUDataSchurPrecond (ilu_data) = schur_precond; + hypre_ParILUDataRhs (ilu_data) = rhs; + hypre_ParILUDataX (ilu_data) = x; + } + else +#endif + { + /* setup GMRES parameters */ + HYPRE_ParCSRGMRESCreate(comm, &schur_solver); + + HYPRE_GMRESSetKDim (schur_solver, hypre_ParILUDataSchurGMRESKDim(ilu_data)); + HYPRE_GMRESSetMaxIter (schur_solver, + hypre_ParILUDataSchurGMRESMaxIter(ilu_data));/* we don't need that many solves */ + HYPRE_GMRESSetTol (schur_solver, hypre_ParILUDataSchurGMRESTol(ilu_data)); + HYPRE_GMRESSetAbsoluteTol (schur_solver, hypre_ParILUDataSchurGMRESAbsoluteTol(ilu_data)); + HYPRE_GMRESSetLogging (schur_solver, hypre_ParILUDataSchurSolverLogging(ilu_data)); + HYPRE_GMRESSetPrintLevel (schur_solver, + hypre_ParILUDataSchurSolverPrintLevel(ilu_data));/* set to zero now, don't print */ + HYPRE_GMRESSetRelChange (schur_solver, hypre_ParILUDataSchurGMRESRelChange(ilu_data)); + + /* setup preconditioner parameters */ + /* create precond, the default is ILU0 */ + HYPRE_ILUCreate (&schur_precond); + HYPRE_ILUSetType (schur_precond, hypre_ParILUDataSchurPrecondIluType(ilu_data)); + HYPRE_ILUSetLevelOfFill (schur_precond, hypre_ParILUDataSchurPrecondIluLfil(ilu_data)); + HYPRE_ILUSetMaxNnzPerRow (schur_precond, hypre_ParILUDataSchurPrecondIluMaxRowNnz(ilu_data)); + HYPRE_ILUSetDropThresholdArray(schur_precond, hypre_ParILUDataSchurPrecondIluDroptol(ilu_data)); + HYPRE_ILUSetPrintLevel (schur_precond, hypre_ParILUDataSchurPrecondPrintLevel(ilu_data)); + HYPRE_ILUSetTriSolve (schur_precond, hypre_ParILUDataSchurPrecondTriSolve(ilu_data)); + HYPRE_ILUSetMaxIter (schur_precond, hypre_ParILUDataSchurPrecondMaxIter(ilu_data)); + HYPRE_ILUSetLowerJacobiIters (schur_precond, + hypre_ParILUDataSchurPrecondLowerJacobiIters(ilu_data)); + HYPRE_ILUSetUpperJacobiIters (schur_precond, + hypre_ParILUDataSchurPrecondUpperJacobiIters(ilu_data)); + HYPRE_ILUSetTol (schur_precond, hypre_ParILUDataSchurPrecondTol(ilu_data)); + + /* add preconditioner to solver */ + HYPRE_GMRESSetPrecond(schur_solver, + (HYPRE_PtrToSolverFcn) HYPRE_ILUSolve, + (HYPRE_PtrToSolverFcn) HYPRE_ILUSetup, + schur_precond); + + HYPRE_GMRESGetPrecond(schur_solver, &schur_precond_gotten); + if (schur_precond_gotten != (schur_precond)) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Schur complement got bad precond!"); + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; - /* setup solver */ - HYPRE_GMRESSetup(schur_solver,(HYPRE_Matrix)matS,(HYPRE_Vector)rhs,(HYPRE_Vector)x); + return hypre_error_flag; + } - /* update ilu_data */ - hypre_ParILUDataSchurSolver (ilu_data) = schur_solver; - hypre_ParILUDataSchurPrecond (ilu_data) = schur_precond; - hypre_ParILUDataRhs (ilu_data) = rhs; - hypre_ParILUDataX (ilu_data) = x; -#endif + /* need to create working vector rhs and x for Schur System */ + rhs = hypre_ParVectorCreate(comm, + hypre_ParCSRMatrixGlobalNumRows(matS), + hypre_ParCSRMatrixRowStarts(matS)); + hypre_ParVectorInitialize(rhs); + x = hypre_ParVectorCreate(comm, + hypre_ParCSRMatrixGlobalNumRows(matS), + hypre_ParCSRMatrixRowStarts(matS)); + hypre_ParVectorInitialize(x); + + /* setup solver */ + HYPRE_GMRESSetup(schur_solver, + (HYPRE_Matrix) matS, + (HYPRE_Vector) rhs, + (HYPRE_Vector) x); + + /* update ilu_data */ + hypre_ParILUDataSchurSolver (ilu_data) = schur_solver; + hypre_ParILUDataSchurPrecond (ilu_data) = schur_precond; + hypre_ParILUDataRhs (ilu_data) = rhs; + hypre_ParILUDataX (ilu_data) = x; + } } break; + case 20: case 21: if (matS) { @@ -686,39 +686,46 @@ hypre_ILUSetup( void *ilu_vdata, /* need to create working vector rhs and x for Schur System */ rhs = hypre_ParVectorCreate(comm, - hypre_ParCSRMatrixGlobalNumRows(matS), - hypre_ParCSRMatrixRowStarts(matS)); + hypre_ParCSRMatrixGlobalNumRows(matS), + hypre_ParCSRMatrixRowStarts(matS)); hypre_ParVectorInitialize(rhs); x = hypre_ParVectorCreate(comm, - hypre_ParCSRMatrixGlobalNumRows(matS), - hypre_ParCSRMatrixRowStarts(matS)); + hypre_ParCSRMatrixGlobalNumRows(matS), + hypre_ParCSRMatrixRowStarts(matS)); hypre_ParVectorInitialize(x); /* setup solver */ - hypre_NSHSetup(schur_solver,matS,rhs,x); + hypre_NSHSetup(schur_solver, matS, rhs, x); hypre_ParILUDataSchurSolver(ilu_data) = schur_solver; hypre_ParILUDataRhs (ilu_data) = rhs; hypre_ParILUDataX (ilu_data) = x; } break; + case 30 : case 31: /* now check communication package */ comm_pkg = hypre_ParCSRMatrixCommPkg(matA); + /* create if not yet built */ if (!comm_pkg) { hypre_MatvecCommPkgCreate(matA); comm_pkg = hypre_ParCSRMatrixCommPkg(matA); } + /* create uext and fext */ - send_size = hypre_ParCSRCommPkgSendMapStart(comm_pkg,hypre_ParCSRCommPkgNumSends(comm_pkg)) - - hypre_ParCSRCommPkgSendMapStart(comm_pkg,0); + num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); + send_size = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends) - + hypre_ParCSRCommPkgSendMapStart(comm_pkg, 0); recv_size = hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(matA)); buffer_size = send_size > recv_size ? send_size : recv_size; - fext = hypre_TAlloc(HYPRE_Real,buffer_size,HYPRE_MEMORY_HOST); - uext = hypre_TAlloc(HYPRE_Real,buffer_size,HYPRE_MEMORY_HOST); + + /* TODO (VPM): Check these memory locations */ + fext = hypre_TAlloc(HYPRE_Real, buffer_size, HYPRE_MEMORY_HOST); + uext = hypre_TAlloc(HYPRE_Real, buffer_size, HYPRE_MEMORY_HOST); break; + case 40: case 41: if (matS) { @@ -726,11 +733,13 @@ hypre_ILUSetup( void *ilu_vdata, HYPRE_ParCSRGMRESCreate(comm, &schur_solver); HYPRE_GMRESSetKDim (schur_solver, hypre_ParILUDataSchurGMRESKDim(ilu_data)); - HYPRE_GMRESSetMaxIter (schur_solver, hypre_ParILUDataSchurGMRESMaxIter(ilu_data));/* we don't need that many solves */ + HYPRE_GMRESSetMaxIter (schur_solver, + hypre_ParILUDataSchurGMRESMaxIter(ilu_data));/* we don't need that many solves */ HYPRE_GMRESSetTol (schur_solver, hypre_ParILUDataSchurGMRESTol(ilu_data)); HYPRE_GMRESSetAbsoluteTol (schur_solver, hypre_ParILUDataSchurGMRESAbsoluteTol(ilu_data)); HYPRE_GMRESSetLogging (schur_solver, hypre_ParILUDataSchurSolverLogging(ilu_data)); - HYPRE_GMRESSetPrintLevel (schur_solver, hypre_ParILUDataSchurSolverPrintLevel(ilu_data));/* set to zero now, don't print */ + HYPRE_GMRESSetPrintLevel (schur_solver, + hypre_ParILUDataSchurSolverPrintLevel(ilu_data));/* set to zero now, don't print */ HYPRE_GMRESSetRelChange (schur_solver, hypre_ParILUDataSchurGMRESRelChange(ilu_data)); /* setup preconditioner parameters */ @@ -742,32 +751,44 @@ hypre_ILUSetup( void *ilu_vdata, HYPRE_ILUSetDropThresholdArray(schur_precond, hypre_ParILUDataSchurPrecondIluDroptol(ilu_data)); HYPRE_ILUSetPrintLevel (schur_precond, hypre_ParILUDataSchurPrecondPrintLevel(ilu_data)); HYPRE_ILUSetMaxIter (schur_precond, hypre_ParILUDataSchurPrecondMaxIter(ilu_data)); + HYPRE_ILUSetTriSolve (schur_precond, hypre_ParILUDataSchurPrecondTriSolve(ilu_data)); + HYPRE_ILUSetLowerJacobiIters (schur_precond, + hypre_ParILUDataSchurPrecondLowerJacobiIters(ilu_data)); + HYPRE_ILUSetUpperJacobiIters (schur_precond, + hypre_ParILUDataSchurPrecondUpperJacobiIters(ilu_data)); HYPRE_ILUSetTol (schur_precond, hypre_ParILUDataSchurPrecondTol(ilu_data)); /* add preconditioner to solver */ HYPRE_GMRESSetPrecond(schur_solver, - (HYPRE_PtrToSolverFcn) HYPRE_ILUSolve, - (HYPRE_PtrToSolverFcn) HYPRE_ILUSetup, - schur_precond); + (HYPRE_PtrToSolverFcn) HYPRE_ILUSolve, + (HYPRE_PtrToSolverFcn) HYPRE_ILUSetup, + schur_precond); + HYPRE_GMRESGetPrecond(schur_solver, &schur_precond_gotten); if (schur_precond_gotten != (schur_precond)) { - hypre_printf("Schur complement got bad precond\n"); - return(-1); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Schur complement got bad precond!"); + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; } /* need to create working vector rhs and x for Schur System */ rhs = hypre_ParVectorCreate(comm, - hypre_ParCSRMatrixGlobalNumRows(matS), - hypre_ParCSRMatrixRowStarts(matS)); + hypre_ParCSRMatrixGlobalNumRows(matS), + hypre_ParCSRMatrixRowStarts(matS)); hypre_ParVectorInitialize(rhs); x = hypre_ParVectorCreate(comm, - hypre_ParCSRMatrixGlobalNumRows(matS), - hypre_ParCSRMatrixRowStarts(matS)); + hypre_ParCSRMatrixGlobalNumRows(matS), + hypre_ParCSRMatrixRowStarts(matS)); hypre_ParVectorInitialize(x); /* setup solver */ - HYPRE_GMRESSetup(schur_solver,(HYPRE_Matrix)matS,(HYPRE_Vector)rhs,(HYPRE_Vector)x); + HYPRE_GMRESSetup(schur_solver, + (HYPRE_Matrix) matS, + (HYPRE_Vector) rhs, + (HYPRE_Vector) x); /* update ilu_data */ hypre_ParILUDataSchurSolver (ilu_data) = schur_solver; @@ -776,48 +797,48 @@ hypre_ILUSetup( void *ilu_vdata, hypre_ParILUDataX (ilu_data) = x; } break; + case 50: - { -#ifdef HYPRE_USING_CUDA - if (matS) +#if defined(HYPRE_USING_GPU) + if (matS && exec == HYPRE_EXEC_DEVICE) { - /* create working vectors */ Xtemp = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(matA), - hypre_ParCSRMatrixGlobalNumRows(matA), - hypre_ParCSRMatrixRowStarts(matA)); + hypre_ParCSRMatrixGlobalNumRows(matA), + hypre_ParCSRMatrixRowStarts(matA)); hypre_ParVectorInitialize(Xtemp); Ytemp = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(matA), - hypre_ParCSRMatrixGlobalNumRows(matA), - hypre_ParCSRMatrixRowStarts(matA)); + hypre_ParCSRMatrixGlobalNumRows(matA), + hypre_ParCSRMatrixRowStarts(matA)); hypre_ParVectorInitialize(Ytemp); Ftemp_upper = hypre_SeqVectorCreate(nLU); - hypre_VectorOwnsData(Ftemp_upper) = 0; - hypre_VectorData(Ftemp_upper) = hypre_VectorData(hypre_ParVectorLocalVector(Ftemp)); + hypre_VectorOwnsData(Ftemp_upper) = 0; + hypre_VectorData(Ftemp_upper) = hypre_VectorData(hypre_ParVectorLocalVector(Ftemp)); hypre_SeqVectorInitialize(Ftemp_upper); Utemp_lower = hypre_SeqVectorCreate(n - nLU); - hypre_VectorOwnsData(Utemp_lower) = 0; - hypre_VectorData(Utemp_lower) = hypre_VectorData(hypre_ParVectorLocalVector(Utemp)) + nLU; + hypre_VectorOwnsData(Utemp_lower) = 0; + hypre_VectorData(Utemp_lower) = nLU + + hypre_VectorData(hypre_ParVectorLocalVector(Utemp)); hypre_SeqVectorInitialize(Utemp_lower); /* create GMRES */ -// HYPRE_ParCSRGMRESCreate(comm, &schur_solver); + // HYPRE_ParCSRGMRESCreate(comm, &schur_solver); hypre_GMRESFunctions * gmres_functions; gmres_functions = hypre_GMRESFunctionsCreate( - hypre_CAlloc, + hypre_ParKrylovCAlloc, hypre_ParKrylovFree, - hypre_ParILUCusparseSchurGMRESCommInfo, //parCSR A -> ilu_data + hypre_ParILUSchurGMRESCommInfoDevice, //parCSR A -> ilu_data hypre_ParKrylovCreateVector, hypre_ParKrylovCreateVectorArray, hypre_ParKrylovDestroyVector, - hypre_ParILURAPSchurGMRESMatvecCreate, //parCSR A -- inactive - hypre_ParILURAPSchurGMRESMatvec, //parCSR A -> ilu_data - hypre_ParILURAPSchurGMRESMatvecDestroy, //parCSR A -- inactive + hypre_ParKrylovMatvecCreate, //parCSR A -- inactive + hypre_ParILURAPSchurGMRESMatvecDevice, //parCSR A -> ilu_data + hypre_ParKrylovMatvecDestroy, //parCSR A -- inactive hypre_ParKrylovInnerProd, hypre_ParKrylovCopyVector, hypre_ParKrylovClearVector, @@ -825,117 +846,123 @@ hypre_ILUSetup( void *ilu_vdata, hypre_ParKrylovAxpy, hypre_ParKrylovIdentitySetup, //parCSR A -- inactive hypre_ParKrylovIdentity ); //parCSR A -- inactive - schur_solver = ( (HYPRE_Solver) hypre_GMRESCreate( gmres_functions ) ); + schur_solver = (HYPRE_Solver) hypre_GMRESCreate(gmres_functions); /* setup GMRES parameters */ /* at least should apply 1 solve */ if (hypre_ParILUDataSchurGMRESKDim(ilu_data) == 0) { - hypre_ParILUDataSchurGMRESKDim(ilu_data) ++; + hypre_ParILUDataSchurGMRESKDim(ilu_data)++; } HYPRE_GMRESSetKDim (schur_solver, hypre_ParILUDataSchurGMRESKDim(ilu_data)); - HYPRE_GMRESSetMaxIter (schur_solver, hypre_ParILUDataSchurGMRESMaxIter(ilu_data));/* we don't need that many solves */ + HYPRE_GMRESSetMaxIter (schur_solver, + hypre_ParILUDataSchurGMRESMaxIter(ilu_data));/* we don't need that many solves */ HYPRE_GMRESSetTol (schur_solver, hypre_ParILUDataSchurGMRESTol(ilu_data)); HYPRE_GMRESSetAbsoluteTol (schur_solver, hypre_ParILUDataSchurGMRESAbsoluteTol(ilu_data)); HYPRE_GMRESSetLogging (schur_solver, hypre_ParILUDataSchurSolverLogging(ilu_data)); - HYPRE_GMRESSetPrintLevel (schur_solver, hypre_ParILUDataSchurSolverPrintLevel(ilu_data));/* set to zero now, don't print */ + HYPRE_GMRESSetPrintLevel (schur_solver, + hypre_ParILUDataSchurSolverPrintLevel(ilu_data));/* set to zero now, don't print */ HYPRE_GMRESSetRelChange (schur_solver, hypre_ParILUDataSchurGMRESRelChange(ilu_data)); /* setup preconditioner parameters */ /* create Schur precond */ schur_precond = (HYPRE_Solver) ilu_vdata; + /* add preconditioner to solver */ HYPRE_GMRESSetPrecond(schur_solver, - (HYPRE_PtrToSolverFcn) hypre_ParILURAPSchurGMRESSolve, - //(HYPRE_PtrToSolverFcn) hypre_ParILUCusparseSchurGMRESDummySolve, - (HYPRE_PtrToSolverFcn) hypre_ParILURAPSchurGMRESDummySetup, - schur_precond); + (HYPRE_PtrToSolverFcn) hypre_ParILURAPSchurGMRESSolveDevice, + (HYPRE_PtrToSolverFcn) hypre_ParKrylovIdentitySetup, + schur_precond); HYPRE_GMRESGetPrecond(schur_solver, &schur_precond_gotten); + if (schur_precond_gotten != (schur_precond)) { - hypre_printf("Schur complement got bad precond\n"); - return(-1); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Schur complement got bad precond!"); + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; } /* need to create working vector rhs and x for Schur System */ rhs = hypre_ParVectorCreate(comm, - hypre_ParCSRMatrixGlobalNumRows(matS), - hypre_ParCSRMatrixRowStarts(matS)); + hypre_ParCSRMatrixGlobalNumRows(matS), + hypre_ParCSRMatrixRowStarts(matS)); hypre_ParVectorInitialize(rhs); x = hypre_ParVectorCreate(comm, - hypre_ParCSRMatrixGlobalNumRows(matS), - hypre_ParCSRMatrixRowStarts(matS)); + hypre_ParCSRMatrixGlobalNumRows(matS), + hypre_ParCSRMatrixRowStarts(matS)); hypre_ParVectorInitialize(x); /* setup solver */ - HYPRE_GMRESSetup(schur_solver,(HYPRE_Matrix)ilu_vdata,(HYPRE_Vector)rhs,(HYPRE_Vector)x); + HYPRE_GMRESSetup(schur_solver, + (HYPRE_Matrix) ilu_vdata, + (HYPRE_Vector) rhs, + (HYPRE_Vector) x); /* solve for right-hand-side consists of only 1 */ //hypre_Vector *rhs_local = hypre_ParVectorLocalVector(rhs); //HYPRE_Real *Xtemp_data = hypre_VectorData(Xtemp_local); //hypre_SeqVectorSetConstantValues(rhs_local, 1.0); - /* update ilu_data */ - hypre_ParILUDataSchurSolver (ilu_data) = schur_solver; - hypre_ParILUDataSchurPrecond (ilu_data) = schur_precond; - hypre_ParILUDataRhs (ilu_data) = rhs; - hypre_ParILUDataX (ilu_data) = x; + /* Update ilu_data */ + hypre_ParILUDataSchurSolver(ilu_data) = schur_solver; + hypre_ParILUDataSchurPrecond(ilu_data) = schur_precond; + hypre_ParILUDataRhs(ilu_data) = rhs; + hypre_ParILUDataX(ilu_data) = x; } -#else - /* need to create working vector rhs and x for Schur System */ - HYPRE_Int m = n - nLU; - HYPRE_BigInt S_total_rows, S_row_starts[2]; - HYPRE_BigInt big_m = (HYPRE_BigInt)m; - hypre_MPI_Allreduce( &big_m, &S_total_rows, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); - - if ( S_total_rows > 0 ) + else +#endif { - /* create working vectors */ - Xtemp = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(matA), - hypre_ParCSRMatrixGlobalNumRows(matA), - hypre_ParCSRMatrixRowStarts(matA)); - hypre_ParVectorInitialize(Xtemp); + /* Need to create working vector rhs and x for Schur System */ + HYPRE_Int m = n - nLU; + HYPRE_BigInt global_start, S_total_rows, S_row_starts[2]; + HYPRE_BigInt big_m = (HYPRE_BigInt) m; - Ytemp = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(matA), - hypre_ParCSRMatrixGlobalNumRows(matA), - hypre_ParCSRMatrixRowStarts(matA)); - hypre_ParVectorInitialize(Ytemp); + hypre_MPI_Allreduce(&big_m, &S_total_rows, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); - /* only do so when we hae the Schur Complement */ + if (S_total_rows > 0) { - HYPRE_BigInt global_start; - hypre_MPI_Scan( &big_m, &global_start, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); - S_row_starts[0] = global_start - m; + Xtemp = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(matA), + hypre_ParCSRMatrixGlobalNumRows(matA), + hypre_ParCSRMatrixRowStarts(matA)); + hypre_ParVectorInitialize(Xtemp); + + Ytemp = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(matA), + hypre_ParCSRMatrixGlobalNumRows(matA), + hypre_ParCSRMatrixRowStarts(matA)); + hypre_ParVectorInitialize(Ytemp); + + hypre_MPI_Scan(&big_m, &global_start, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); + S_row_starts[0] = global_start - big_m; S_row_starts[1] = global_start; - } - rhs = hypre_ParVectorCreate(comm, - S_total_rows, - S_row_starts); - hypre_ParVectorInitialize(rhs); + rhs = hypre_ParVectorCreate(comm, + S_total_rows, + S_row_starts); + hypre_ParVectorInitialize(rhs); - x = hypre_ParVectorCreate(comm, - S_total_rows, - S_row_starts); - hypre_ParVectorInitialize(x); + x = hypre_ParVectorCreate(comm, + S_total_rows, + S_row_starts); + hypre_ParVectorInitialize(x); - /* add when necessary */ - /* create GMRES */ -// HYPRE_ParCSRGMRESCreate(comm, &schur_solver); + /* create GMRES */ + // HYPRE_ParCSRGMRESCreate(comm, &schur_solver); - hypre_GMRESFunctions * gmres_functions; + hypre_GMRESFunctions * gmres_functions; - gmres_functions = + gmres_functions = hypre_GMRESFunctionsCreate( - hypre_CAlloc, + hypre_ParKrylovCAlloc, hypre_ParKrylovFree, - hypre_ParILURAPSchurGMRESCommInfoH, //parCSR A -> ilu_data + hypre_ParILURAPSchurGMRESCommInfoHost, //parCSR A -> ilu_data hypre_ParKrylovCreateVector, hypre_ParKrylovCreateVectorArray, hypre_ParKrylovDestroyVector, - hypre_ParILURAPSchurGMRESMatvecCreateH, //parCSR A -- inactive - hypre_ParILURAPSchurGMRESMatvecH, //parCSR A -> ilu_data - hypre_ParILURAPSchurGMRESMatvecDestroyH, //parCSR A -- inactive + hypre_ParKrylovMatvecCreate, //parCSR A -- inactive + hypre_ParILURAPSchurGMRESMatvecHost, //parCSR A -> ilu_data + hypre_ParKrylovMatvecDestroy, //parCSR A -- inactive hypre_ParKrylovInnerProd, hypre_ParKrylovCopyVector, hypre_ParKrylovClearVector, @@ -943,112 +970,116 @@ hypre_ILUSetup( void *ilu_vdata, hypre_ParKrylovAxpy, hypre_ParKrylovIdentitySetup, //parCSR A -- inactive hypre_ParKrylovIdentity ); //parCSR A -- inactive - schur_solver = ( (HYPRE_Solver) hypre_GMRESCreate( gmres_functions ) ); + schur_solver = (HYPRE_Solver) hypre_GMRESCreate(gmres_functions); - /* setup GMRES parameters */ - /* at least should apply 1 solve */ - if (hypre_ParILUDataSchurGMRESKDim(ilu_data) == 0) - { - hypre_ParILUDataSchurGMRESKDim(ilu_data) ++; - } - HYPRE_GMRESSetKDim (schur_solver, hypre_ParILUDataSchurGMRESKDim(ilu_data)); - HYPRE_GMRESSetMaxIter (schur_solver, hypre_ParILUDataSchurGMRESMaxIter(ilu_data));/* we don't need that many solves */ - HYPRE_GMRESSetTol (schur_solver, hypre_ParILUDataSchurGMRESTol(ilu_data)); - HYPRE_GMRESSetAbsoluteTol (schur_solver, hypre_ParILUDataSchurGMRESAbsoluteTol(ilu_data)); - HYPRE_GMRESSetLogging (schur_solver, hypre_ParILUDataSchurSolverLogging(ilu_data)); - HYPRE_GMRESSetPrintLevel (schur_solver, hypre_ParILUDataSchurSolverPrintLevel(ilu_data));/* set to zero now, don't print */ - HYPRE_GMRESSetRelChange (schur_solver, hypre_ParILUDataSchurGMRESRelChange(ilu_data)); + /* setup GMRES parameters */ + /* at least should apply 1 solve */ + if (hypre_ParILUDataSchurGMRESKDim(ilu_data) == 0) + { + hypre_ParILUDataSchurGMRESKDim(ilu_data)++; + } + HYPRE_GMRESSetKDim (schur_solver, hypre_ParILUDataSchurGMRESKDim(ilu_data)); + HYPRE_GMRESSetMaxIter (schur_solver, + hypre_ParILUDataSchurGMRESMaxIter(ilu_data));/* we don't need that many solves */ + HYPRE_GMRESSetTol (schur_solver, hypre_ParILUDataSchurGMRESTol(ilu_data)); + HYPRE_GMRESSetAbsoluteTol (schur_solver, hypre_ParILUDataSchurGMRESAbsoluteTol(ilu_data)); + HYPRE_GMRESSetLogging (schur_solver, hypre_ParILUDataSchurSolverLogging(ilu_data)); + HYPRE_GMRESSetPrintLevel (schur_solver, + hypre_ParILUDataSchurSolverPrintLevel(ilu_data));/* set to zero now, don't print */ + HYPRE_GMRESSetRelChange (schur_solver, hypre_ParILUDataSchurGMRESRelChange(ilu_data)); + + /* setup preconditioner parameters */ + /* create Schur precond */ + schur_precond = (HYPRE_Solver) ilu_vdata; + + /* add preconditioner to solver */ + HYPRE_GMRESSetPrecond(schur_solver, + (HYPRE_PtrToSolverFcn) hypre_ParILURAPSchurGMRESSolveHost, + (HYPRE_PtrToSolverFcn) hypre_ParKrylovIdentitySetup, + schur_precond); + HYPRE_GMRESGetPrecond(schur_solver, &schur_precond_gotten); + if (schur_precond_gotten != (schur_precond)) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Schur complement got bad precond!"); + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; - /* setup preconditioner parameters */ - /* create Schur precond */ - schur_precond = (HYPRE_Solver) ilu_vdata; - /* add preconditioner to solver */ - HYPRE_GMRESSetPrecond(schur_solver, - (HYPRE_PtrToSolverFcn) hypre_ParILURAPSchurGMRESSolveH, - //(HYPRE_PtrToSolverFcn) hypre_ParILUCusparseSchurGMRESDummySolve, - (HYPRE_PtrToSolverFcn) hypre_ParILURAPSchurGMRESDummySetupH, - schur_precond); - HYPRE_GMRESGetPrecond(schur_solver, &schur_precond_gotten); - if (schur_precond_gotten != (schur_precond)) - { - hypre_printf("Schur complement got bad precond\n"); - return(-1); - } + return hypre_error_flag; + } - /* setup solver */ - HYPRE_GMRESSetup(schur_solver,(HYPRE_Matrix)ilu_vdata,(HYPRE_Vector)rhs,(HYPRE_Vector)x); + /* setup solver */ + HYPRE_GMRESSetup(schur_solver, + (HYPRE_Matrix) ilu_vdata, + (HYPRE_Vector) rhs, + (HYPRE_Vector) x); - /* solve for right-hand-side consists of only 1 */ - //hypre_Vector *rhs_local = hypre_ParVectorLocalVector(rhs); - //HYPRE_Real *Xtemp_data = hypre_VectorData(Xtemp_local); - //hypre_SeqVectorSetConstantValues(rhs_local, 1.0); - } - /* update ilu_data */ - hypre_ParILUDataSchurSolver (ilu_data) = schur_solver; - hypre_ParILUDataSchurPrecond (ilu_data) = schur_precond; - hypre_ParILUDataRhs (ilu_data) = rhs; - hypre_ParILUDataX (ilu_data) = x; + /* solve for right-hand-side consists of only 1 */ + //hypre_Vector *rhs_local = hypre_ParVectorLocalVector(rhs); + //HYPRE_Real *Xtemp_data = hypre_VectorData(Xtemp_local); + //hypre_SeqVectorSetConstantValues(rhs_local, 1.0); + } /* if (S_total_rows > 0) */ -#endif - break; - } - default: + /* Update ilu_data */ + hypre_ParILUDataSchurSolver(ilu_data) = schur_solver; + hypre_ParILUDataSchurPrecond(ilu_data) = schur_precond; + hypre_ParILUDataRhs(ilu_data) = rhs; + hypre_ParILUDataX(ilu_data) = x; + } break; } + /* set pointers to ilu data */ -#ifdef HYPRE_USING_CUDA - /* set cusparse pointers */ - //hypre_ParILUDataILUSolveBuffer(ilu_data) = ilu_solve_buffer; - hypre_ParILUDataMatAILUDevice(ilu_data) = matALU_d; - hypre_ParILUDataMatBILUDevice(ilu_data) = matBLU_d; - hypre_ParILUDataMatSILUDevice(ilu_data) = matSLU_d; - hypre_ParILUDataMatEDevice(ilu_data) = matE_d; - hypre_ParILUDataMatFDevice(ilu_data) = matF_d; - hypre_ParILUDataILUSolveBuffer(ilu_data) = ilu_solve_buffer; - hypre_ParILUDataMatALILUSolveInfo(ilu_data) = matAL_info; - hypre_ParILUDataMatAUILUSolveInfo(ilu_data) = matAU_info; - hypre_ParILUDataMatBLILUSolveInfo(ilu_data) = matBL_info; - hypre_ParILUDataMatBUILUSolveInfo(ilu_data) = matBU_info; - hypre_ParILUDataMatSLILUSolveInfo(ilu_data) = matSL_info; - hypre_ParILUDataMatSUILUSolveInfo(ilu_data) = matSU_info; - hypre_ParILUDataAperm(ilu_data) = Aperm; - hypre_ParILUDataR(ilu_data) = R; - hypre_ParILUDataP(ilu_data) = P; - hypre_ParILUDataFTempUpper(ilu_data) = Ftemp_upper; - hypre_ParILUDataUTempLower(ilu_data) = Utemp_lower; - hypre_ParILUDataMatAFakeDiagonal(ilu_data) = A_diag_fake; + /* set device data pointers */ +#if defined(HYPRE_USING_GPU) + hypre_ParILUDataMatAILUDevice(ilu_data) = matALU_d; + hypre_ParILUDataMatBILUDevice(ilu_data) = matBLU_d; + hypre_ParILUDataMatSILUDevice(ilu_data) = matSLU_d; + hypre_ParILUDataMatEDevice(ilu_data) = matE_d; + hypre_ParILUDataMatFDevice(ilu_data) = matF_d; + hypre_ParILUDataAperm(ilu_data) = Aperm; + hypre_ParILUDataR(ilu_data) = R; + hypre_ParILUDataP(ilu_data) = P; + hypre_ParILUDataFTempUpper(ilu_data) = Ftemp_upper; + hypre_ParILUDataUTempLower(ilu_data) = Utemp_lower; + hypre_ParILUDataADiagDiag(ilu_data) = Adiag_diag; + hypre_ParILUDataSDiagDiag(ilu_data) = Sdiag_diag; #endif - hypre_ParILUDataMatA(ilu_data) = matA; - hypre_ParILUDataXTemp(ilu_data) = Xtemp; - hypre_ParILUDataYTemp(ilu_data) = Ytemp; - hypre_ParILUDataF(ilu_data) = F_array; - hypre_ParILUDataU(ilu_data) = U_array; - hypre_ParILUDataMatL(ilu_data) = matL; - hypre_ParILUDataMatD(ilu_data) = matD; - hypre_ParILUDataMatU(ilu_data) = matU; - hypre_ParILUDataMatLModified(ilu_data) = matmL; - hypre_ParILUDataMatDModified(ilu_data) = matmD; - hypre_ParILUDataMatUModified(ilu_data) = matmU; - hypre_ParILUDataMatS(ilu_data) = matS; - hypre_ParILUDataCFMarkerArray(ilu_data) = CF_marker_array; - hypre_ParILUDataPerm(ilu_data) = perm; - hypre_ParILUDataQPerm(ilu_data) = qperm; - hypre_ParILUDataNLU(ilu_data) = nLU; - hypre_ParILUDataNI(ilu_data) = nI; - hypre_ParILUDataUEnd(ilu_data) = u_end; - hypre_ParILUDataUExt(ilu_data) = uext; - hypre_ParILUDataFExt(ilu_data) = fext; + + /* Set pointers to ilu data */ + hypre_ParILUDataMatA(ilu_data) = matA; + hypre_ParILUDataXTemp(ilu_data) = Xtemp; + hypre_ParILUDataYTemp(ilu_data) = Ytemp; + hypre_ParILUDataZTemp(ilu_data) = Ztemp; + hypre_ParILUDataF(ilu_data) = F_array; + hypre_ParILUDataU(ilu_data) = U_array; + hypre_ParILUDataMatL(ilu_data) = matL; + hypre_ParILUDataMatD(ilu_data) = matD; + hypre_ParILUDataMatU(ilu_data) = matU; + hypre_ParILUDataMatLModified(ilu_data) = matmL; + hypre_ParILUDataMatDModified(ilu_data) = matmD; + hypre_ParILUDataMatUModified(ilu_data) = matmU; + hypre_ParILUDataMatS(ilu_data) = matS; + hypre_ParILUDataCFMarkerArray(ilu_data) = CF_marker_array; + hypre_ParILUDataPerm(ilu_data) = perm; + hypre_ParILUDataQPerm(ilu_data) = qperm; + hypre_ParILUDataNLU(ilu_data) = nLU; + hypre_ParILUDataNI(ilu_data) = nI; + hypre_ParILUDataUEnd(ilu_data) = u_end; + hypre_ParILUDataUExt(ilu_data) = uext; + hypre_ParILUDataFExt(ilu_data) = fext; /* compute operator complexity */ hypre_ParCSRMatrixSetDNumNonzeros(matA); nnzS = 0.0; + /* size_C is the size of global coarse grid, upper left part */ size_C = hypre_ParCSRMatrixGlobalNumRows(matA); - /* switch to compute complexity */ -#ifdef HYPRE_USING_CUDA + /* switch to compute complexity */ +#if defined(HYPRE_USING_GPU) HYPRE_Int nnzBEF = 0; - HYPRE_Int nnzG;/* Global nnz */ + HYPRE_Int nnzG; /* Global nnz */ + if (ilu_type == 0 && fill_level == 0) { /* The nnz is for sure 1.0 in this case */ @@ -1077,7 +1108,7 @@ hypre_ILUSetup( void *ilu_vdata, /* if we have Schur system need to reduce it from size_C */ } hypre_ParILUDataOperatorComplexity(ilu_data) = ((HYPRE_Real)nnzG + nnzS) / - hypre_ParCSRMatrixDNumNonzeros(matA); + hypre_ParCSRMatrixDNumNonzeros(matA); } else if (ilu_type == 50) { @@ -1105,125 +1136,171 @@ hypre_ILUSetup( void *ilu_vdata, /* if we have Schur system need to reduce it from size_C */ } hypre_ParILUDataOperatorComplexity(ilu_data) = ((HYPRE_Real)nnzG + nnzS) / - hypre_ParCSRMatrixDNumNonzeros(matA); + hypre_ParCSRMatrixDNumNonzeros(matA); } else - { #endif + { if (matS) { hypre_ParCSRMatrixSetDNumNonzeros(matS); nnzS = hypre_ParCSRMatrixDNumNonzeros(matS); - /* if we have Schur system need to reduce it from size_C */ + + /* If we have Schur system need to reduce it from size_C */ size_C -= hypre_ParCSRMatrixGlobalNumRows(matS); - switch(ilu_type) + switch (ilu_type) { case 10: case 11: case 40: case 41: case 50: - /* now we need to compute the preconditioner */ + /* Now we need to compute the preconditioner */ schur_precond_ilu = (hypre_ParILUData*) (hypre_ParILUDataSchurPrecond(ilu_data)); + /* borrow i for local nnz of S */ - i = hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixOffd(matS)); - hypre_MPI_Allreduce(&i, &nnzS_offd, 1, HYPRE_MPI_INT, hypre_MPI_SUM, comm); - nnzS = nnzS * hypre_ParILUDataOperatorComplexity(schur_precond_ilu) +nnzS_offd; + nnzS_offd_local = hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixOffd(matS)); + hypre_MPI_Allreduce(&nnzS_offd_local, &nnzS_offd, 1, HYPRE_MPI_REAL, + hypre_MPI_SUM, comm); + nnzS = nnzS * hypre_ParILUDataOperatorComplexity(schur_precond_ilu) + nnzS_offd; break; + case 20: case 21: schur_solver_nsh = (hypre_ParNSHData*) hypre_ParILUDataSchurSolver(ilu_data); - nnzS = nnzS * (hypre_ParNSHDataOperatorComplexity(schur_solver_nsh)); + nnzS *= hypre_ParNSHDataOperatorComplexity(schur_solver_nsh); break; + default: break; } } - hypre_ParILUDataOperatorComplexity(ilu_data) = ((HYPRE_Real)size_C + nnzS + - hypre_ParCSRMatrixDNumNonzeros(matL) + - hypre_ParCSRMatrixDNumNonzeros(matU))/ - hypre_ParCSRMatrixDNumNonzeros(matA); -#ifdef HYPRE_USING_CUDA + hypre_ParILUDataOperatorComplexity(ilu_data) = ((HYPRE_Real)size_C + nnzS + + hypre_ParCSRMatrixDNumNonzeros(matL) + + hypre_ParCSRMatrixDNumNonzeros(matU)) / + hypre_ParCSRMatrixDNumNonzeros(matA); } -#endif + + /* TODO (VPM): Move ILU statistics printout to its own function */ if ((my_id == 0) && (print_level > 0)) { - hypre_printf("ILU SETUP: operator complexity = %f \n", hypre_ParILUDataOperatorComplexity(ilu_data)); + hypre_printf("ILU SETUP: operator complexity = %f \n", + hypre_ParILUDataOperatorComplexity(ilu_data)); + if (hypre_ParILUDataTriSolve(ilu_data)) + { + hypre_printf("ILU SOLVE: using direct triangular solves\n", + hypre_ParILUDataOperatorComplexity(ilu_data)); + } + else + { + hypre_printf("ILU SOLVE: using iterative triangular solves\n", + hypre_ParILUDataOperatorComplexity(ilu_data)); + } + +#if defined (HYPRE_USING_ROCSPARSE) + HYPRE_Int i; + + if (hypre_ParILUDataIterativeSetupType(ilu_data)) + { + hypre_printf("ILU: iterative setup type = %d\n", + hypre_ParILUDataIterativeSetupType(ilu_data)); + hypre_printf("ILU: iterative setup option = %d\n", + hypre_ParILUDataIterativeSetupOption(ilu_data)); + if (hypre_ParILUDataIterativeSetupOption(ilu_data) & 0x2) + { + /* This path enables termination based on stopping tolerance */ + hypre_printf("ILU: iterative setup tolerance = %g\n", + hypre_ParILUDataIterativeSetupTolerance(ilu_data)); + } + else + { + /* This path enables termination based on number of iterations */ + hypre_printf("ILU: iterative setup max. iters = %d\n", + hypre_ParILUDataIterativeSetupMaxIter(ilu_data)); + } + + /* TODO (VPM): Add min, max, avg statistics across ranks */ + hypre_printf("ILU: iterative setup num. iters at rank 0 = %d\n", + hypre_ParILUDataIterativeSetupNumIter(ilu_data)); + + /* Show convergence history */ + if (hypre_ParILUDataIterativeSetupOption(ilu_data) & 0x10) + { + hypre_printf("ILU: iterative setup convergence history at rank 0:\n"); + hypre_printf("%8s", "iter"); + if (hypre_ParILUDataIterativeSetupOption(ilu_data) & 0x08) + { + hypre_printf(" %14s %14s", "residual", "rate"); + } + if (hypre_ParILUDataIterativeSetupOption(ilu_data) & 0x04) + { + hypre_printf(" %14s %14s", "correction", "rate"); + } + hypre_printf("\n"); + printf("%8d", 0); + if (hypre_ParILUDataIterativeSetupOption(ilu_data) & 0x08) + { + hypre_printf(" %14.5e %14.5e", + hypre_ParILUDataIterSetupResidualNorm(ilu_data, 0), 1.0); + } + if (hypre_ParILUDataIterativeSetupOption(ilu_data) & 0x04) + { + hypre_printf(" %14.5e %14.5e", + hypre_ParILUDataIterSetupCorrectionNorm(ilu_data, 0), 1.0); + } + hypre_printf("\n"); + + for (i = 1; i < hypre_ParILUDataIterativeSetupNumIter(ilu_data); i++) + { + printf("%8d", i); + if (hypre_ParILUDataIterativeSetupOption(ilu_data) & 0x08) + { + hypre_printf(" %14.5e %14.5e", + hypre_ParILUDataIterSetupResidualNorm(ilu_data, i), + hypre_ParILUDataIterSetupResidualNorm(ilu_data, i) / + hypre_ParILUDataIterSetupResidualNorm(ilu_data, i - 1)); + } + if (hypre_ParILUDataIterativeSetupOption(ilu_data) & 0x04) + { + hypre_printf(" %14.5e %14.5e", + hypre_ParILUDataIterSetupCorrectionNorm(ilu_data, i), + hypre_ParILUDataIterSetupCorrectionNorm(ilu_data, i) / + hypre_ParILUDataIterSetupCorrectionNorm(ilu_data, i - 1)); + } + hypre_printf("\n"); + } + } + } +#endif } - if ( logging > 1 ) { + if (logging > 1) + { residual = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(matA), - hypre_ParCSRMatrixGlobalNumRows(matA), - hypre_ParCSRMatrixRowStarts(matA) ); + hypre_ParCSRMatrixGlobalNumRows(matA), + hypre_ParCSRMatrixRowStarts(matA) ); hypre_ParVectorInitialize(residual); hypre_ParILUDataResidual(ilu_data) = residual; } - else{ + else + { hypre_ParILUDataResidual(ilu_data) = NULL; } - rel_res_norms = hypre_CTAlloc(HYPRE_Real, hypre_ParILUDataMaxIter(ilu_data), HYPRE_MEMORY_HOST); + rel_res_norms = hypre_CTAlloc(HYPRE_Real, + hypre_ParILUDataMaxIter(ilu_data), + HYPRE_MEMORY_HOST); hypre_ParILUDataRelResNorms(ilu_data) = rel_res_norms; - HYPRE_ANNOTATE_FUNC_END; - - return hypre_error_flag; -} - -#ifdef HYPRE_USING_CUDA - -/* Extract submatrix from diagonal part of A into a new CSRMatrix without sort rows - * WARNING: We don't put diagonal to the first entry of each row since this function is now for cuSparse only - * A = input matrix - * perm = permutation array indicating ordering of rows. Perm could come from a - * CF_marker array or a reordering routine. - * rqperm = reverse permutation array indicating ordering of columns - * A_diagp = pointer to the output diagonal matrix. - */ -HYPRE_Int -hypre_ParILUCusparseExtractDiagonalCSR( hypre_ParCSRMatrix *A, - HYPRE_Int *perm, - HYPRE_Int *rqperm, - hypre_CSRMatrix **A_diagp ) -{ - /* Get necessary slots */ - hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); - HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); - HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); - HYPRE_Real *A_diag_data = hypre_CSRMatrixData(A_diag); - HYPRE_Int n = hypre_CSRMatrixNumRows(A_diag); - HYPRE_Int nnz_A_diag = A_diag_i[n]; - - HYPRE_Int i, j, current_idx; - - /* No schur complement makes everything easy :) */ - hypre_CSRMatrix *B = NULL; - B = hypre_CSRMatrixCreate(n, n, nnz_A_diag); - hypre_CSRMatrixInitialize(B); - HYPRE_Int *B_i = hypre_CSRMatrixI(B); - HYPRE_Int *B_j = hypre_CSRMatrixJ(B); - HYPRE_Real *B_data = hypre_CSRMatrixData(B); - - /* Copy everything in with permutation */ - current_idx = 0; - for ( i = 0; i < n; i++ ) - { - B_i[i] = current_idx; - for (j = A_diag_i[perm[i]] ; j < A_diag_i[perm[i]+1] ; j ++) - { - B_j[current_idx] = rqperm[A_diag_j[j]]; - B_data[current_idx++] = A_diag_data[j]; - } - } - B_i[n] = current_idx; - hypre_assert(current_idx == nnz_A_diag); - *A_diagp = B; + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; return hypre_error_flag; } -/* Extract submatrix from diagonal part of A into a - * | B F | - * | E C | - * Struct in order to do ILU with cusparse. - * WARNING: Cusparse requires each row been sorted by column - * This function only works when rows are sorted!. +/*-------------------------------------------------------------------------- + * hypre_ParILUExtractEBFC + * + * Extract submatrix from diagonal part of A into + * | B F | + * | E C | + * * A = input matrix * perm = permutation array indicating ordering of rows. Perm could come from a * CF_marker array or a reordering routine. @@ -1232,71 +1309,63 @@ hypre_ParILUCusparseExtractDiagonalCSR( hypre_ParCSRMatrix *A, * Cp = pointer to the output C matrix. * Ep = pointer to the output E matrix. * Fp = pointer to the output F matrix. - */ + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ParILUCusparseILUExtractEBFC(hypre_CSRMatrix *A_diag, HYPRE_Int nLU, hypre_CSRMatrix **Bp, hypre_CSRMatrix **Cp, hypre_CSRMatrix **Ep, hypre_CSRMatrix **Fp) +hypre_ParILUExtractEBFC(hypre_CSRMatrix *A_diag, + HYPRE_Int nLU, + hypre_CSRMatrix **Bp, + hypre_CSRMatrix **Cp, + hypre_CSRMatrix **Ep, + hypre_CSRMatrix **Fp) { /* Get necessary slots */ - HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); - HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); - HYPRE_Real *A_diag_data = hypre_CSRMatrixData(A_diag); - HYPRE_Int n = hypre_CSRMatrixNumRows(A_diag); - HYPRE_Int nnz_A_diag = A_diag_i[n]; - + HYPRE_Int n = hypre_CSRMatrixNumRows(A_diag); + HYPRE_Int nnz_A_diag = hypre_CSRMatrixNumNonzeros(A_diag); + HYPRE_MemoryLocation memory_location = hypre_CSRMatrixMemoryLocation(A_diag); + + hypre_CSRMatrix *B = NULL; + hypre_CSRMatrix *C = NULL; + hypre_CSRMatrix *E = NULL; + hypre_CSRMatrix *F = NULL; HYPRE_Int i, j, row, col; hypre_assert(nLU >= 0 && nLU <= n); if (nLU == n) { - /* No schur complement makes everything easy :) */ - hypre_CSRMatrix *B = NULL; - hypre_CSRMatrix *C = NULL; - hypre_CSRMatrix *E = NULL; - hypre_CSRMatrix *F = NULL; - B = hypre_CSRMatrixCreate(n, n, nnz_A_diag); - hypre_CSRMatrixInitialize(B); + /* No Schur complement */ + B = hypre_CSRMatrixCreate(n, n, nnz_A_diag); + C = hypre_CSRMatrixCreate(0, 0, 0); + E = hypre_CSRMatrixCreate(0, 0, 0); + F = hypre_CSRMatrixCreate(0, 0, 0); + + hypre_CSRMatrixInitialize_v2(B, 0, memory_location); + hypre_CSRMatrixInitialize_v2(C, 0, memory_location); + hypre_CSRMatrixInitialize_v2(E, 0, memory_location); + hypre_CSRMatrixInitialize_v2(F, 0, memory_location); + hypre_CSRMatrixCopy(A_diag, B, 1); - C = hypre_CSRMatrixCreate(0, 0, 0); - hypre_CSRMatrixInitialize(C); - E = hypre_CSRMatrixCreate(0, 0, 0); - hypre_CSRMatrixInitialize(E); - F = hypre_CSRMatrixCreate(0, 0, 0); - hypre_CSRMatrixInitialize(F); - *Bp = B; - *Cp = C; - *Ep = E; - *Fp = F; - } - else if (nLU ==0) - { - /* All schur complement also makes everything easy :) */ - hypre_CSRMatrix *B = NULL; - hypre_CSRMatrix *C = NULL; - hypre_CSRMatrix *E = NULL; - hypre_CSRMatrix *F = NULL; - C = hypre_CSRMatrixCreate(n, n, nnz_A_diag); - hypre_CSRMatrixInitialize(C); + } + else if (nLU == 0) + { + /* All Schur complement */ + C = hypre_CSRMatrixCreate(n, n, nnz_A_diag); + B = hypre_CSRMatrixCreate(0, 0, 0); + E = hypre_CSRMatrixCreate(0, 0, 0); + F = hypre_CSRMatrixCreate(0, 0, 0); + + hypre_CSRMatrixInitialize_v2(C, 0, memory_location); + hypre_CSRMatrixInitialize_v2(B, 0, memory_location); + hypre_CSRMatrixInitialize_v2(E, 0, memory_location); + hypre_CSRMatrixInitialize_v2(F, 0, memory_location); + hypre_CSRMatrixCopy(A_diag, C, 1); - B = hypre_CSRMatrixCreate(0, 0, 0); - hypre_CSRMatrixInitialize(B); - E = hypre_CSRMatrixCreate(0, 0, 0); - hypre_CSRMatrixInitialize(E); - F = hypre_CSRMatrixCreate(0, 0, 0); - hypre_CSRMatrixInitialize(F); - *Bp = B; - *Cp = C; - *Ep = E; - *Fp = F; } else { - /* Has schur complement :( */ - HYPRE_Int m = n - nLU; - hypre_CSRMatrix *B = NULL; - hypre_CSRMatrix *C = NULL; - hypre_CSRMatrix *E = NULL; - hypre_CSRMatrix *F = NULL; + /* Has schur complement */ + HYPRE_Int m = n - nLU; HYPRE_Int capacity_B; HYPRE_Int capacity_E; HYPRE_Int capacity_F; @@ -1306,60 +1375,75 @@ hypre_ParILUCusparseILUExtractEBFC(hypre_CSRMatrix *A_diag, HYPRE_Int nLU, hypre HYPRE_Int ctrE; HYPRE_Int ctrF; - HYPRE_Int *B_i = NULL; - HYPRE_Int *C_i = NULL; - HYPRE_Int *E_i = NULL; - HYPRE_Int *F_i = NULL; - HYPRE_Int *B_j = NULL; - HYPRE_Int *C_j = NULL; - HYPRE_Int *E_j = NULL; - HYPRE_Int *F_j = NULL; - HYPRE_Real *B_data = NULL; - HYPRE_Real *C_data = NULL; - HYPRE_Real *E_data = NULL; - HYPRE_Real *F_data = NULL; + HYPRE_Int *B_i = NULL; + HYPRE_Int *C_i = NULL; + HYPRE_Int *E_i = NULL; + HYPRE_Int *F_i = NULL; + HYPRE_Int *B_j = NULL; + HYPRE_Int *C_j = NULL; + HYPRE_Int *E_j = NULL; + HYPRE_Int *F_j = NULL; + HYPRE_Complex *B_data = NULL; + HYPRE_Complex *C_data = NULL; + HYPRE_Complex *E_data = NULL; + HYPRE_Complex *F_data = NULL; + + hypre_CSRMatrix *h_A_diag; + HYPRE_Int *A_diag_i; + HYPRE_Int *A_diag_j; + HYPRE_Complex *A_diag_data; + + /* Create/Get host pointer for A_diag */ + h_A_diag = (hypre_GetActualMemLocation(memory_location) == hypre_MEMORY_DEVICE) ? + hypre_CSRMatrixClone_v2(A_diag, 1, HYPRE_MEMORY_HOST) : A_diag; + A_diag_i = hypre_CSRMatrixI(h_A_diag); + A_diag_j = hypre_CSRMatrixJ(h_A_diag); + A_diag_data = hypre_CSRMatrixData(h_A_diag); + + /* Estimate # of nonzeros */ + capacity_B = (HYPRE_Int) (nLU + hypre_ceil(nnz_A_diag * 1.0 * nLU / n * nLU / n)); + capacity_C = (HYPRE_Int) (m + hypre_ceil(nnz_A_diag * 1.0 * m / n * m / n)); + capacity_E = (HYPRE_Int) (hypre_min(m, nLU) + hypre_ceil(nnz_A_diag * 1.0 * nLU / n * m / n)); + capacity_F = capacity_E; /* Create CSRMatrices */ - B = hypre_CSRMatrixCreate(nLU, nLU, 0); - hypre_CSRMatrixInitialize(B); - C = hypre_CSRMatrixCreate(m, m, 0); - hypre_CSRMatrixInitialize(C); - E = hypre_CSRMatrixCreate(m, nLU, 0); - hypre_CSRMatrixInitialize(E); - F = hypre_CSRMatrixCreate(nLU, m, 0); - hypre_CSRMatrixInitialize(F); + B = hypre_CSRMatrixCreate(nLU, nLU, capacity_B); + C = hypre_CSRMatrixCreate(m, m, capacity_C); + E = hypre_CSRMatrixCreate(m, nLU, capacity_E); + F = hypre_CSRMatrixCreate(nLU, m, capacity_F); - /* Estimate # of nonzeros */ - capacity_B = nLU + ceil(nnz_A_diag * 1.0 * nLU / n * nLU / n); - capacity_C = m + ceil(nnz_A_diag * 1.0 * m / n * m / n); - capacity_E = hypre_min(m, nLU) + ceil(nnz_A_diag * 1.0 * nLU / n * m / n); - capacity_F = capacity_E; - - /* Allocate memory */ - B_i = hypre_CSRMatrixI(B); - B_j = hypre_CTAlloc(HYPRE_Int, capacity_B, HYPRE_MEMORY_DEVICE); - B_data = hypre_CTAlloc(HYPRE_Real, capacity_B, HYPRE_MEMORY_DEVICE); - C_i = hypre_CSRMatrixI(C); - C_j = hypre_CTAlloc(HYPRE_Int, capacity_C, HYPRE_MEMORY_DEVICE); - C_data = hypre_CTAlloc(HYPRE_Real, capacity_C, HYPRE_MEMORY_DEVICE); - E_i = hypre_CSRMatrixI(E); - E_j = hypre_CTAlloc(HYPRE_Int, capacity_E, HYPRE_MEMORY_DEVICE); - E_data = hypre_CTAlloc(HYPRE_Real, capacity_E, HYPRE_MEMORY_DEVICE); - F_i = hypre_CSRMatrixI(F); - F_j = hypre_CTAlloc(HYPRE_Int, capacity_F, HYPRE_MEMORY_DEVICE); - F_data = hypre_CTAlloc(HYPRE_Real, capacity_F, HYPRE_MEMORY_DEVICE); - ctrB = 0; - ctrC = 0; - ctrE = 0; - ctrF = 0; + /* Initialize matrices on the host */ + hypre_CSRMatrixInitialize_v2(B, 0, HYPRE_MEMORY_HOST); + hypre_CSRMatrixInitialize_v2(C, 0, HYPRE_MEMORY_HOST); + hypre_CSRMatrixInitialize_v2(E, 0, HYPRE_MEMORY_HOST); + hypre_CSRMatrixInitialize_v2(F, 0, HYPRE_MEMORY_HOST); + + /* Access pointers */ + B_i = hypre_CSRMatrixI(B); + B_j = hypre_CSRMatrixJ(B); + B_data = hypre_CSRMatrixData(B); + + C_i = hypre_CSRMatrixI(C); + C_j = hypre_CSRMatrixJ(C); + C_data = hypre_CSRMatrixData(C); + + E_i = hypre_CSRMatrixI(E); + E_j = hypre_CSRMatrixJ(E); + E_data = hypre_CSRMatrixData(E); + + F_i = hypre_CSRMatrixI(F); + F_j = hypre_CSRMatrixJ(F); + F_data = hypre_CSRMatrixData(F); + + ctrB = ctrC = ctrE = ctrF = 0; /* Loop to copy data */ /* B and F first */ for (i = 0; i < nLU; i++) { - B_i[i] = ctrB; - F_i[i] = ctrF; - for (j = A_diag_i[i]; j < A_diag_i[i+1]; j++) + B_i[i] = ctrB; + F_i[i] = ctrF; + for (j = A_diag_i[i]; j < A_diag_i[i + 1]; j++) { col = A_diag_j[j]; if (col >= nLU) @@ -1373,24 +1457,28 @@ hypre_ParILUCusparseILUExtractEBFC(hypre_CSRMatrix *A_diag, HYPRE_Int nLU, hypre { HYPRE_Int tmp; tmp = capacity_B; - capacity_B = capacity_B * EXPAND_FACT + 1; - B_j = hypre_TReAlloc_v2(B_j, HYPRE_Int, tmp, HYPRE_Int, capacity_B, HYPRE_MEMORY_DEVICE); - B_data = hypre_TReAlloc_v2(B_data, HYPRE_Real, tmp, HYPRE_Real, capacity_B, HYPRE_MEMORY_DEVICE); + capacity_B = (HYPRE_Int)(capacity_B * EXPAND_FACT + 1); + B_j = hypre_TReAlloc_v2(B_j, HYPRE_Int, tmp, HYPRE_Int, + capacity_B, HYPRE_MEMORY_HOST); + B_data = hypre_TReAlloc_v2(B_data, HYPRE_Complex, tmp, HYPRE_Complex, + capacity_B, HYPRE_MEMORY_HOST); } } - for (; j < A_diag_i[i+1]; j++) + for (; j < A_diag_i[i + 1]; j++) { - col = A_diag_j[j]; - col = col - nLU; + col = A_diag_j[j] - nLU; + hypre_assert(col >= 0); F_j[ctrF] = col; F_data[ctrF++] = A_diag_data[j]; if (ctrF >= capacity_F) { HYPRE_Int tmp; tmp = capacity_F; - capacity_F = capacity_F * EXPAND_FACT + 1; - F_j = hypre_TReAlloc_v2(F_j, HYPRE_Int, tmp, HYPRE_Int, capacity_F, HYPRE_MEMORY_DEVICE); - F_data = hypre_TReAlloc_v2(F_data, HYPRE_Real, tmp, HYPRE_Real, capacity_F, HYPRE_MEMORY_DEVICE); + capacity_F = (HYPRE_Int)(capacity_F * EXPAND_FACT + 1); + F_j = hypre_TReAlloc_v2(F_j, HYPRE_Int, tmp, HYPRE_Int, + capacity_F, HYPRE_MEMORY_HOST); + F_data = hypre_TReAlloc_v2(F_data, HYPRE_Complex, tmp, HYPRE_Complex, + capacity_F, HYPRE_MEMORY_HOST); } } } @@ -1403,7 +1491,7 @@ hypre_ParILUCusparseILUExtractEBFC(hypre_CSRMatrix *A_diag, HYPRE_Int nLU, hypre row = i - nLU; E_i[row] = ctrE; C_i[row] = ctrC; - for (j = A_diag_i[i]; j < A_diag_i[i+1]; j++) + for (j = A_diag_i[i]; j < A_diag_i[i + 1]; j++) { col = A_diag_j[j]; if (col >= nLU) @@ -1417,1870 +1505,382 @@ hypre_ParILUCusparseILUExtractEBFC(hypre_CSRMatrix *A_diag, HYPRE_Int nLU, hypre { HYPRE_Int tmp; tmp = capacity_E; - capacity_E = capacity_E * EXPAND_FACT + 1; - E_j = hypre_TReAlloc_v2(E_j, HYPRE_Int, tmp, HYPRE_Int, capacity_E, HYPRE_MEMORY_DEVICE); - E_data = hypre_TReAlloc_v2(E_data, HYPRE_Real, tmp, HYPRE_Real, capacity_E, HYPRE_MEMORY_DEVICE); + capacity_E = (HYPRE_Int)(capacity_E * EXPAND_FACT + 1); + E_j = hypre_TReAlloc_v2(E_j, HYPRE_Int, tmp, HYPRE_Int, + capacity_E, HYPRE_MEMORY_HOST); + E_data = hypre_TReAlloc_v2(E_data, HYPRE_Complex, tmp, HYPRE_Complex, + capacity_E, HYPRE_MEMORY_HOST); } } - for (; j < A_diag_i[i+1]; j++) + for (; j < A_diag_i[i + 1]; j++) { - col = A_diag_j[j]; - col = col - nLU; + col = A_diag_j[j] - nLU; + hypre_assert(col >= 0); C_j[ctrC] = col; C_data[ctrC++] = A_diag_data[j]; if (ctrC >= capacity_C) { HYPRE_Int tmp; tmp = capacity_C; - capacity_C = capacity_C * EXPAND_FACT + 1; - C_j = hypre_TReAlloc_v2(C_j, HYPRE_Int, tmp, HYPRE_Int, capacity_C, HYPRE_MEMORY_DEVICE); - C_data = hypre_TReAlloc_v2(C_data, HYPRE_Real, tmp, HYPRE_Real, capacity_C, HYPRE_MEMORY_DEVICE); + capacity_C = (HYPRE_Int)(capacity_C * EXPAND_FACT + 1); + C_j = hypre_TReAlloc_v2(C_j, HYPRE_Int, tmp, HYPRE_Int, + capacity_C, HYPRE_MEMORY_HOST); + C_data = hypre_TReAlloc_v2(C_data, HYPRE_Complex, tmp, HYPRE_Complex, + capacity_C, HYPRE_MEMORY_HOST); } } } E_i[m] = ctrE; C_i[m] = ctrC; - hypre_assert((ctrB+ctrC+ctrE+ctrF) == nnz_A_diag); + hypre_assert((ctrB + ctrC + ctrE + ctrF) == nnz_A_diag); - /* Create CSRMatrices */ - hypre_CSRMatrixJ(B) = B_j; - hypre_CSRMatrixData(B) = B_data; - hypre_CSRMatrixNumNonzeros(B) = ctrB; - hypre_CSRMatrixSetDataOwner(B, 1); - *Bp = B; - - hypre_CSRMatrixJ(C) = C_j; - hypre_CSRMatrixData(C) = C_data; - hypre_CSRMatrixNumNonzeros(C) = ctrC; - hypre_CSRMatrixSetDataOwner(C, 1); - *Cp = C; - - hypre_CSRMatrixJ(E) = E_j; - hypre_CSRMatrixData(E) = E_data; - hypre_CSRMatrixNumNonzeros(E) = ctrE; - hypre_CSRMatrixSetDataOwner(E, 1); - *Ep = E; - - hypre_CSRMatrixJ(F) = F_j; - hypre_CSRMatrixData(F) = F_data; - hypre_CSRMatrixNumNonzeros(F) = ctrF; - hypre_CSRMatrixSetDataOwner(F, 1); - *Fp = F; - } - - return hypre_error_flag; -} + /* Update pointers */ + hypre_CSRMatrixJ(B) = B_j; + hypre_CSRMatrixData(B) = B_data; + hypre_CSRMatrixNumNonzeros(B) = ctrB; -/* Wrapper for ILU0 with cusparse on a matrix, csr sort was done in this function */ -HYPRE_Int -HYPRE_ILUSetupCusparseCSRILU0(hypre_CSRMatrix *A, cusparseSolvePolicy_t ilu_solve_policy) -{ + hypre_CSRMatrixJ(C) = C_j; + hypre_CSRMatrixData(C) = C_data; + hypre_CSRMatrixNumNonzeros(C) = ctrC; - /* data objects for A */ - HYPRE_Int n = hypre_CSRMatrixNumRows(A); - HYPRE_Int m = hypre_CSRMatrixNumCols(A); + hypre_CSRMatrixJ(E) = E_j; + hypre_CSRMatrixData(E) = E_data; + hypre_CSRMatrixNumNonzeros(E) = ctrE; - hypre_assert(n == m); + hypre_CSRMatrixJ(F) = F_j; + hypre_CSRMatrixData(F) = F_data; + hypre_CSRMatrixNumNonzeros(F) = ctrF; - HYPRE_Real *A_data = hypre_CSRMatrixData(A); - HYPRE_Int *A_i = hypre_CSRMatrixI(A); - HYPRE_Int *A_j = hypre_CSRMatrixJ(A); - HYPRE_Int nnz_A = hypre_CSRMatrixNumNonzeros(A); + /* Migrate to final memory location */ + hypre_CSRMatrixMigrate(B, memory_location); + hypre_CSRMatrixMigrate(C, memory_location); + hypre_CSRMatrixMigrate(E, memory_location); + hypre_CSRMatrixMigrate(F, memory_location); - /* pointers to cusparse data */ - csrilu02Info_t matA_info = NULL; - - /* variables and working arrays used during the ilu */ - HYPRE_Int zero_pivot; - HYPRE_Int matA_buffersize; - void *matA_buffer = NULL; - - HYPRE_Int isDoublePrecision = sizeof(HYPRE_Complex) == sizeof(hypre_double); - HYPRE_Int isSinglePrecision = sizeof(HYPRE_Complex) == sizeof(hypre_double) / 2; - - cusparseHandle_t handle = hypre_HandleCusparseHandle(hypre_handle()); - cusparseMatDescr_t descr = hypre_CSRMatrixGPUMatDescr(A); - - hypre_assert(isDoublePrecision || isSinglePrecision); - - /* 1. Sort columns inside each row first, we can't assume that's sorted */ - hypre_SortCSRCusparse(n, m, nnz_A, descr, A_i, A_j, A_data); - - /* 2. Create info for ilu setup and solve */ - HYPRE_CUSPARSE_CALL(cusparseCreateCsrilu02Info(&matA_info)); - - /* 3. Get working array size */ - if (isDoublePrecision) - { - HYPRE_CUSPARSE_CALL(cusparseDcsrilu02_bufferSize(handle, n, nnz_A, descr, - (hypre_double *) A_data, A_i, A_j, - matA_info, &matA_buffersize)); - } - else if (isSinglePrecision) - { - HYPRE_CUSPARSE_CALL(cusparseScsrilu02_bufferSize(handle, n, nnz_A, descr, - (float *) A_data, A_i, A_j, - matA_info, &matA_buffersize)); - } - /* 4. Create working array, since they won't be visited by host, allocate on device */ - matA_buffer = hypre_MAlloc(matA_buffersize, HYPRE_MEMORY_DEVICE); - - /* 5. Now perform the analysis */ - /* 5-1. Analysis */ - if (isDoublePrecision) - { - HYPRE_CUSPARSE_CALL(cusparseDcsrilu02_analysis(handle, n, nnz_A, descr, - (hypre_double *) A_data, A_i, A_j, - matA_info, ilu_solve_policy, matA_buffer)); - } - else if (isSinglePrecision) - { - HYPRE_CUSPARSE_CALL(cusparseScsrilu02_analysis(handle, n, nnz_A, descr, - (float *) A_data, A_i, A_j, - matA_info, ilu_solve_policy, matA_buffer)); - } - /* 5-2. Check for zero pivot */ - HYPRE_CUSPARSE_CALL(cusparseXcsrilu02_zeroPivot(handle, matA_info, &zero_pivot)); - - /* 6. Apply the factorization */ - if (isDoublePrecision) - { - HYPRE_CUSPARSE_CALL(cusparseDcsrilu02(handle, n, nnz_A, descr, - (hypre_double *) A_data, A_i, A_j, - matA_info, ilu_solve_policy, matA_buffer)); - } - else if (isSinglePrecision) - { - HYPRE_CUSPARSE_CALL(cusparseScsrilu02(handle, n, nnz_A, descr, - (float *) A_data, A_i, A_j, - matA_info, ilu_solve_policy, matA_buffer)); - } - - /* Check for zero pivot */ - HYPRE_CUSPARSE_CALL(cusparseXcsrilu02_zeroPivot(handle, matA_info, &zero_pivot)); - - /* Done with factorization, finishing up */ - hypre_TFree(matA_buffer, HYPRE_MEMORY_DEVICE); - HYPRE_CUSPARSE_CALL(cusparseDestroyCsrilu02Info(matA_info)); - - return hypre_error_flag; -} - -/* Wrapper for ILU0 solve analysis phase with cusparse on a matrix */ -HYPRE_Int -HYPRE_ILUSetupCusparseCSRILU0SetupSolve(hypre_CSRMatrix *A, cusparseMatDescr_t matL_des, cusparseMatDescr_t matU_des, - cusparseSolvePolicy_t ilu_solve_policy, csrsv2Info_t *matL_infop, csrsv2Info_t *matU_infop, - HYPRE_Int *buffer_sizep, void **bufferp) -{ - if (!A) - { - /* return if A is NULL */ - *matL_infop = NULL; - *matU_infop = NULL; - *buffer_sizep = 0; - *bufferp = NULL; - return hypre_error_flag; - } - - /* data objects for A */ - HYPRE_Int n = hypre_CSRMatrixNumRows(A); - HYPRE_Int m = hypre_CSRMatrixNumCols(A); - - hypre_assert(n == m); - - if (n == 0) - { - /* return if A is 0 by 0 */ - *matL_infop = NULL; - *matU_infop = NULL; - *buffer_sizep = 0; - *bufferp = NULL; - return hypre_error_flag; - } - - HYPRE_Real *A_data = hypre_CSRMatrixData(A); - HYPRE_Int *A_i = hypre_CSRMatrixI(A); - HYPRE_Int *A_j = hypre_CSRMatrixJ(A); - HYPRE_Int nnz_A = A_i[n]; - - /* pointers to cusparse data */ - csrsv2Info_t matL_info = *matL_infop; - csrsv2Info_t matU_info = *matU_infop; - - /* clear data if already exists */ - if (matL_info) - { - HYPRE_CUSPARSE_CALL( cusparseDestroyCsrsv2Info(matL_info) ); - matL_info = NULL; - } - if (matU_info) - { - HYPRE_CUSPARSE_CALL( cusparseDestroyCsrsv2Info(matU_info) ); - matU_info = NULL; - } - - /* variables and working arrays used during the ilu */ - HYPRE_Int matL_buffersize; - HYPRE_Int matU_buffersize; - HYPRE_Int solve_buffersize; - HYPRE_Int solve_oldbuffersize = *buffer_sizep; - void *solve_buffer = *bufferp; - - HYPRE_Int isDoublePrecision = sizeof(HYPRE_Complex) == sizeof(hypre_double); - HYPRE_Int isSinglePrecision = sizeof(HYPRE_Complex) == sizeof(hypre_double) / 2; - - hypre_assert(isDoublePrecision || isSinglePrecision); - - cusparseHandle_t handle = hypre_HandleCusparseHandle(hypre_handle()); - - /* 1. Create info for ilu setup and solve */ - HYPRE_CUSPARSE_CALL(cusparseCreateCsrsv2Info(&(matL_info))); - HYPRE_CUSPARSE_CALL(cusparseCreateCsrsv2Info(&(matU_info))); - - /* 2. Get working array size */ - if (isDoublePrecision) - { - - HYPRE_CUSPARSE_CALL(cusparseDcsrsv2_bufferSize(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, n, nnz_A, - matL_des, (hypre_double *) A_data, A_i, A_j, - matL_info, &matL_buffersize)); - - HYPRE_CUSPARSE_CALL(cusparseDcsrsv2_bufferSize(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, n, nnz_A, - matU_des, (hypre_double *) A_data, A_i, A_j, - matU_info, &matU_buffersize)); - } - else if (isSinglePrecision) - { - - HYPRE_CUSPARSE_CALL(cusparseScsrsv2_bufferSize(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, n, nnz_A, - matL_des, (float *) A_data, A_i, A_j, - matL_info, &matL_buffersize)); - - HYPRE_CUSPARSE_CALL(cusparseScsrsv2_bufferSize(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, n, nnz_A, - matU_des, (float *) A_data, A_i, A_j, - matU_info, &matU_buffersize)); - } - solve_buffersize = hypre_max( matL_buffersize, matU_buffersize ); - /* 3. Create working array, since they won't be visited by host, allocate on device */ - if (solve_buffersize > solve_oldbuffersize) - { - if (solve_buffer) - { - solve_buffer = hypre_ReAlloc_v2(solve_buffer, solve_oldbuffersize, solve_buffersize, HYPRE_MEMORY_DEVICE); - } - else - { - solve_buffer = hypre_MAlloc(solve_buffersize, HYPRE_MEMORY_DEVICE); - } - } - - /* 4. Now perform the analysis */ - if (isDoublePrecision) - { - - HYPRE_CUSPARSE_CALL(cusparseDcsrsv2_analysis(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - n, nnz_A, matL_des, - (hypre_double *) A_data, A_i, A_j, - matL_info, ilu_solve_policy, solve_buffer)); - - HYPRE_CUSPARSE_CALL(cusparseDcsrsv2_analysis(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - n, nnz_A, matU_des, - (hypre_double *) A_data, A_i, A_j, - matU_info, ilu_solve_policy, solve_buffer)); - } - else if (isSinglePrecision) - { - - HYPRE_CUSPARSE_CALL(cusparseScsrsv2_analysis(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - n, nnz_A, matL_des, - (float *) A_data, A_i, A_j, - matL_info, ilu_solve_policy, solve_buffer)); - - HYPRE_CUSPARSE_CALL(cusparseScsrsv2_analysis(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - n, nnz_A, matU_des, - (float *) A_data, A_i, A_j, - matU_info, ilu_solve_policy, solve_buffer)); - } - - /* Done with analysis, finishing up */ - /* Set return value */ - *matL_infop = matL_info; - *matU_infop = matU_info; - *buffer_sizep = solve_buffersize; - *bufferp = solve_buffer; - - return hypre_error_flag; -} - -/* ILU(0) (GPU) - * A = input matrix - * perm = permutation array indicating ordering of rows. Perm could come from a - * CF_marker array or a reordering routine. - * qperm = permutation array indicating ordering of columns - * nI = number of interial unknowns - * nLU = size of incomplete factorization, nLU should obey nLU <= nI. - * Schur complement is formed if nLU < n - * Lptr, Dptr, Uptr, Sptr = L, D, U, S factors. Note that with CUDA, Dptr and Uptr are unused - * xtempp, ytempp = helper vector used in 2-level solve. - * A_fake_diagp = fake diagonal for matvec - * will form global Schur Matrix if nLU < n - */ -HYPRE_Int -hypre_ILUSetupILU0Device(hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int *qperm, HYPRE_Int n, HYPRE_Int nLU, - cusparseMatDescr_t matL_des, cusparseMatDescr_t matU_des, cusparseSolvePolicy_t ilu_solve_policy, - void **bufferp, csrsv2Info_t *matBL_infop, csrsv2Info_t *matBU_infop, - csrsv2Info_t *matSL_infop, csrsv2Info_t *matSU_infop, - hypre_CSRMatrix **BLUptr, hypre_ParCSRMatrix **matSptr, hypre_CSRMatrix **Eptr, hypre_CSRMatrix **Fptr, - HYPRE_Int **A_fake_diag_ip) -{ - /* GPU-accelerated ILU0 with cusparse */ - HYPRE_Int i, j, k1, k2, k3, col; - - /* communication stuffs for S */ - MPI_Comm comm = hypre_ParCSRMatrixComm(A); - - HYPRE_Int my_id, num_procs; - hypre_MPI_Comm_size(comm,&num_procs); - hypre_MPI_Comm_rank(comm,&my_id); - - hypre_ParCSRCommPkg *comm_pkg; - hypre_ParCSRCommHandle *comm_handle; - HYPRE_Int num_sends, begin, end; - HYPRE_BigInt *send_buf = NULL; - HYPRE_Int *rperm = NULL; - HYPRE_Int *rqperm = NULL; - - hypre_ParCSRMatrix *matS = NULL; - hypre_CSRMatrix *A_diag = NULL; - HYPRE_Int *A_fake_diag_i = NULL; - hypre_CSRMatrix *A_offd = NULL; - HYPRE_Int *A_offd_i = NULL; - HYPRE_Int *A_offd_j = NULL; - HYPRE_Real *A_offd_data = NULL; - hypre_CSRMatrix *SLU = NULL; - /* pointers to cusparse data */ - csrsv2Info_t matBL_info = NULL; - csrsv2Info_t matBU_info = NULL; - csrsv2Info_t matSL_info = NULL; - csrsv2Info_t matSU_info = NULL; - - HYPRE_Int buffer_size = 0; - void *buffer = NULL; - - /* variables for matS */ - HYPRE_Int m = n - nLU; - HYPRE_Int nI = nLU;//use default - HYPRE_Int e = 0; - HYPRE_Int m_e = m; - HYPRE_BigInt total_rows; - HYPRE_BigInt col_starts[2]; - HYPRE_Int *S_diag_i = NULL; - HYPRE_Int S_diag_nnz; - hypre_CSRMatrix *S_offd = NULL; - HYPRE_Int *S_offd_i = NULL; - HYPRE_Int *S_offd_j = NULL; - HYPRE_Real *S_offd_data = NULL; - HYPRE_BigInt *S_offd_colmap = NULL; - HYPRE_Int S_offd_nnz; - HYPRE_Int S_offd_ncols; - - /* set data slots */ - A_offd = hypre_ParCSRMatrixOffd(A); - A_offd_i = hypre_CSRMatrixI(A_offd); - A_offd_j = hypre_CSRMatrixJ(A_offd); - A_offd_data = hypre_CSRMatrixData(A_offd); - - /* unfortunately we need to build the reverse permutation array */ - rperm = hypre_CTAlloc(HYPRE_Int, n, HYPRE_MEMORY_HOST); - rqperm = hypre_CTAlloc(HYPRE_Int, n, HYPRE_MEMORY_HOST); - for (i = 0; i < n; i++) - { - rperm[perm[i]] = i; - rqperm[qperm[i]] = i; - } - - /* Only call ILU when we really have a matrix on this processor */ - if (n > 0) - { - /* Copy diagonal matrix into a new place with permutation - * That is, A_diag = A_diag(perm,qperm); - */ - hypre_ParILUCusparseExtractDiagonalCSR(A, perm, rqperm, &A_diag); - - /* Apply ILU factorization to the entile A_diag */ - HYPRE_ILUSetupCusparseCSRILU0(A_diag, ilu_solve_policy); - - /* | L \ U (B) L^{-1}F | - * | EU^{-1} L \ U (S)| - * Extract submatrix L_B U_B, L_S U_S, EU_B^{-1}, L_B^{-1}F - * Note that in this function after ILU, all rows are sorted - * in a way different than HYPRE. Diagonal is not listed in the front - */ - hypre_ParILUCusparseILUExtractEBFC(A_diag, nLU, BLUptr, &SLU, Eptr, Fptr); - } - else - { - *BLUptr = NULL; - *Eptr = NULL; - *Fptr = NULL; - SLU = NULL; - } - - /* create B */ - /* only analyse when nacessary */ - if ( nLU > 0 ) - { - /* Analysis of BILU */ - HYPRE_ILUSetupCusparseCSRILU0SetupSolve(*BLUptr, matL_des, matU_des, - ilu_solve_policy, &matBL_info, &matBU_info, - &buffer_size, &buffer); - } - - HYPRE_BigInt big_m = (HYPRE_BigInt)m; - hypre_MPI_Allreduce(&big_m, &total_rows, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); - /* only form when total_rows > 0 */ - if ( total_rows > 0 ) - { - /* now create S */ - /* need to get new column start */ - { - HYPRE_BigInt global_start; - hypre_MPI_Scan( &big_m, &global_start, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); - col_starts[0] = global_start - m; - col_starts[1] = global_start; - } - - A_fake_diag_i = hypre_CTAlloc(HYPRE_Int, m + 1, HYPRE_MEMORY_DEVICE); - if (SLU) - { - /* Analysis of SILU */ - HYPRE_ILUSetupCusparseCSRILU0SetupSolve(SLU, matL_des, matU_des, - ilu_solve_policy, &matSL_info, &matSU_info, - &buffer_size, &buffer); - } - else - { - SLU = hypre_CSRMatrixCreate(0,0,0); - hypre_CSRMatrixInitialize(SLU); - } - S_diag_i = hypre_CSRMatrixI(SLU); - S_diag_nnz = S_diag_i[m]; - /* Build ParCSRMatrix matS - * For example when np == 3 the new matrix takes the following form - * |IS_1 E_12 E_13| - * |E_21 IS_2 E_22| = S - * |E_31 E_32 IS_3| - * In which IS_i is the cusparse ILU factorization of S_i in one matrix - * */ - - /* We did nothing to A_offd, so all the data kept, just reorder them - * The create function takes comm, global num rows/cols, - * row/col start, num cols offd, nnz diag, nnz offd - */ - S_offd_nnz = hypre_CSRMatrixNumNonzeros(A_offd); - S_offd_ncols = hypre_CSRMatrixNumCols(A_offd); - - matS = hypre_ParCSRMatrixCreate( comm, - total_rows, - total_rows, - col_starts, - col_starts, - S_offd_ncols, - S_diag_nnz, - S_offd_nnz); - - /* first put diagonal data in */ - hypre_CSRMatrixDestroy(hypre_ParCSRMatrixDiag(matS)); - hypre_ParCSRMatrixDiag(matS) = SLU; - - /* now start to construct offdiag of S */ - S_offd = hypre_ParCSRMatrixOffd(matS); - S_offd_i = hypre_TAlloc(HYPRE_Int, m+1, HYPRE_MEMORY_DEVICE); - S_offd_j = hypre_TAlloc(HYPRE_Int, S_offd_nnz, HYPRE_MEMORY_DEVICE); - S_offd_data = hypre_TAlloc(HYPRE_Real, S_offd_nnz, HYPRE_MEMORY_DEVICE); - S_offd_colmap = hypre_CTAlloc(HYPRE_BigInt, S_offd_ncols, HYPRE_MEMORY_HOST); - - /* simply use a loop to copy data from A_offd */ - S_offd_i[0] = 0; - k3 = 0; - for (i = 1; i <= e; i++) - { - S_offd_i[i] = k3; - } - for (i = 0; i < m_e; i++) - { - col = perm[i + nI]; - k1 = A_offd_i[col]; - k2 = A_offd_i[col+1]; - for (j = k1; j < k2; j++) - { - S_offd_j[k3] = A_offd_j[j]; - S_offd_data[k3++] = A_offd_data[j]; - } - S_offd_i[i+1+e] = k3; - } - - /* give I, J, DATA to S_offd */ - hypre_CSRMatrixI(S_offd) = S_offd_i; - hypre_CSRMatrixJ(S_offd) = S_offd_j; - hypre_CSRMatrixData(S_offd) = S_offd_data; - - /* now we need to update S_offd_colmap */ - comm_pkg = hypre_ParCSRMatrixCommPkg(A); - /* setup comm_pkg if not yet built */ - if (!comm_pkg) - { - hypre_MatvecCommPkgCreate(A); - comm_pkg = hypre_ParCSRMatrixCommPkg(A); - } - /* get total num of send */ - num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - begin = hypre_ParCSRCommPkgSendMapStart(comm_pkg,0); - end = hypre_ParCSRCommPkgSendMapStart(comm_pkg,num_sends); - send_buf = hypre_TAlloc(HYPRE_BigInt, end - begin, HYPRE_MEMORY_HOST); - /* copy new index into send_buf */ - for (i = begin; i < end; i++) - { - send_buf[i-begin] = rperm[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,i)] - nLU + col_starts[0]; - } - - /* main communication */ - comm_handle = hypre_ParCSRCommHandleCreate(21, comm_pkg, send_buf, S_offd_colmap); - hypre_ParCSRCommHandleDestroy(comm_handle); - - /* setup index */ - hypre_ParCSRMatrixColMapOffd(matS) = S_offd_colmap; - - hypre_ILUSortOffdColmap(matS); - - /* free */ - hypre_TFree(send_buf, HYPRE_MEMORY_HOST); - } /* end of forming S */ - - *matSptr = matS; - *bufferp = buffer; - *matBL_infop = matBL_info; - *matBU_infop = matBU_info; - *matSL_infop = matSL_info; - *matSU_infop = matSU_info; - *A_fake_diag_ip= A_fake_diag_i; - - /* Destroy the bridge after acrossing the river */ - hypre_CSRMatrixDestroy(A_diag); - hypre_TFree(rperm, HYPRE_MEMORY_HOST); - hypre_TFree(rqperm, HYPRE_MEMORY_HOST); - - return hypre_error_flag; -} - -HYPRE_Int -hypre_ILUSetupILUKDevice(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *perm, HYPRE_Int *qperm, HYPRE_Int n, HYPRE_Int nLU, - cusparseMatDescr_t matL_des, cusparseMatDescr_t matU_des, cusparseSolvePolicy_t ilu_solve_policy, - void **bufferp, csrsv2Info_t *matBL_infop, csrsv2Info_t *matBU_infop, - csrsv2Info_t *matSL_infop, csrsv2Info_t *matSU_infop, - hypre_CSRMatrix **BLUptr, hypre_ParCSRMatrix **matSptr, hypre_CSRMatrix **Eptr, hypre_CSRMatrix **Fptr, - HYPRE_Int **A_fake_diag_ip) -{ - /* GPU-accelerated ILU0 with cusparse */ - HYPRE_Int i, j, k1, k2, k3, col; - - /* communication stuffs for S */ - MPI_Comm comm = hypre_ParCSRMatrixComm(A); - - HYPRE_Int my_id, num_procs; - hypre_MPI_Comm_size(comm,&num_procs); - hypre_MPI_Comm_rank(comm,&my_id); - - hypre_ParCSRCommPkg *comm_pkg; - hypre_ParCSRCommHandle *comm_handle; - HYPRE_Int num_sends, begin, end; - HYPRE_BigInt *send_buf = NULL; - HYPRE_Int *rperm = NULL; - HYPRE_Int *rqperm = NULL; - - hypre_ParCSRMatrix *Apq = NULL; - hypre_ParCSRMatrix *ALU = NULL; - - hypre_ParCSRMatrix *matS = NULL; - hypre_CSRMatrix *A_diag = NULL; - HYPRE_Int *A_fake_diag_i = NULL; - hypre_CSRMatrix *A_offd = NULL; - HYPRE_Int *A_offd_i = NULL; - HYPRE_Int *A_offd_j = NULL; - HYPRE_Real *A_offd_data = NULL; - hypre_CSRMatrix *SLU = NULL; - /* pointers to cusparse data */ - csrsv2Info_t matBL_info = NULL; - csrsv2Info_t matBU_info = NULL; - csrsv2Info_t matSL_info = NULL; - csrsv2Info_t matSU_info = NULL; - - HYPRE_Int buffer_size = 0; - void *buffer = NULL; - - /* variables for matS */ - HYPRE_Int m = n - nLU; - HYPRE_Int nI = nLU;//use default - HYPRE_Int e = 0; - HYPRE_Int m_e = m; - HYPRE_BigInt total_rows; - HYPRE_BigInt col_starts[2]; - HYPRE_Int *S_diag_i = NULL; - HYPRE_Int S_diag_nnz; - hypre_CSRMatrix *S_offd = NULL; - HYPRE_Int *S_offd_i = NULL; - HYPRE_Int *S_offd_j = NULL; - HYPRE_Real *S_offd_data = NULL; - HYPRE_BigInt *S_offd_colmap = NULL; - HYPRE_Int S_offd_nnz; - HYPRE_Int S_offd_ncols; - - /* set data slots */ - A_offd = hypre_ParCSRMatrixOffd(A); - A_offd_i = hypre_CSRMatrixI(A_offd); - A_offd_j = hypre_CSRMatrixJ(A_offd); - A_offd_data = hypre_CSRMatrixData(A_offd); - - hypre_ParCSRMatrix *parL = NULL; - hypre_ParCSRMatrix *parU = NULL; - hypre_ParCSRMatrix *parS = NULL; - HYPRE_Real *parD = NULL; - HYPRE_Int *uend = NULL; - - /* unfortunately we need to build the reverse permutation array */ - rperm = hypre_CTAlloc(HYPRE_Int, n, HYPRE_MEMORY_HOST); - rqperm = hypre_CTAlloc(HYPRE_Int, n, HYPRE_MEMORY_HOST); - for (i = 0; i < n; i++) - { - rperm[perm[i]] = i; - rqperm[qperm[i]] = i; - } - - /* Only call ILU when we really have a matrix on this processor */ - if (n > 0) - { - /* Copy diagonal matrix into a new place with permutation - * That is, A_diag = A_diag(perm,qperm); - */ - hypre_ParILURAPReorder( A, perm, rqperm, &Apq); - - /* Apply ILU factorization to the entile A_diag */ - hypre_ILUSetupILUK(Apq, lfil, NULL, NULL, n, n, &parL, &parD, &parU, &parS, &uend); - - if (uend) - { - hypre_TFree(uend, HYPRE_MEMORY_HOST); - } - - if (parS) - { - hypre_ParCSRMatrixDestroy(parS); - } - - /* | L \ U (B) L^{-1}F | - * | EU^{-1} L \ U (S)| - * Extract submatrix L_B U_B, L_S U_S, EU_B^{-1}, L_B^{-1}F - * Note that in this function after ILU, all rows are sorted - * in a way different than HYPRE. Diagonal is not listed in the front - */ - hypre_ILUSetupLDUtoCusparse( parL, parD, parU, &ALU); - - if (parL) - { - hypre_ParCSRMatrixDestroy(parL); - } - if (parD) - { - hypre_TFree(parD, HYPRE_MEMORY_DEVICE); - } - if (parU) - { - hypre_ParCSRMatrixDestroy(parU); - } - - A_diag = hypre_ParCSRMatrixDiag(ALU); - - hypre_ParILUCusparseILUExtractEBFC(A_diag, nLU, BLUptr, &SLU, Eptr, Fptr); - - if (Apq) - { - hypre_ParCSRMatrixDestroy(Apq); - } - - } - else - { - *BLUptr = NULL; - *Eptr = NULL; - *Fptr = NULL; - SLU = NULL; - } - - /* create B */ - /* only analyse when nacessary */ - if ( nLU > 0 ) - { - /* Analysis of BILU */ - HYPRE_ILUSetupCusparseCSRILU0SetupSolve(*BLUptr, matL_des, matU_des, - ilu_solve_policy, &matBL_info, &matBU_info, - &buffer_size, &buffer); - } - - HYPRE_BigInt big_m = (HYPRE_BigInt)m; - hypre_MPI_Allreduce(&big_m, &total_rows, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); - /* only form when total_rows > 0 */ - if ( total_rows > 0 ) - { - /* now create S */ - /* need to get new column start */ - { - HYPRE_BigInt global_start; - hypre_MPI_Scan( &big_m, &global_start, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); - col_starts[0] = global_start - m; - col_starts[1] = global_start; - } - - A_fake_diag_i = hypre_CTAlloc(HYPRE_Int, m + 1, HYPRE_MEMORY_DEVICE); - if (SLU) - { - /* Analysis of SILU */ - HYPRE_ILUSetupCusparseCSRILU0SetupSolve(SLU, matL_des, matU_des, - ilu_solve_policy, &matSL_info, &matSU_info, - &buffer_size, &buffer); - } - else - { - SLU = hypre_CSRMatrixCreate(0,0,0); - hypre_CSRMatrixInitialize(SLU); - } - S_diag_i = hypre_CSRMatrixI(SLU); - S_diag_nnz = S_diag_i[m]; - /* Build ParCSRMatrix matS - * For example when np == 3 the new matrix takes the following form - * |IS_1 E_12 E_13| - * |E_21 IS_2 E_22| = S - * |E_31 E_32 IS_3| - * In which IS_i is the cusparse ILU factorization of S_i in one matrix - * */ - - /* We did nothing to A_offd, so all the data kept, just reorder them - * The create function takes comm, global num rows/cols, - * row/col start, num cols offd, nnz diag, nnz offd - */ - S_offd_nnz = hypre_CSRMatrixNumNonzeros(A_offd); - S_offd_ncols = hypre_CSRMatrixNumCols(A_offd); - - matS = hypre_ParCSRMatrixCreate( comm, - total_rows, - total_rows, - col_starts, - col_starts, - S_offd_ncols, - S_diag_nnz, - S_offd_nnz); - - /* first put diagonal data in */ - hypre_CSRMatrixDestroy(hypre_ParCSRMatrixDiag(matS)); - hypre_ParCSRMatrixDiag(matS) = SLU; - - /* now start to construct offdiag of S */ - S_offd = hypre_ParCSRMatrixOffd(matS); - S_offd_i = hypre_TAlloc(HYPRE_Int, m+1, HYPRE_MEMORY_DEVICE); - S_offd_j = hypre_TAlloc(HYPRE_Int, S_offd_nnz, HYPRE_MEMORY_DEVICE); - S_offd_data = hypre_TAlloc(HYPRE_Real, S_offd_nnz, HYPRE_MEMORY_DEVICE); - S_offd_colmap = hypre_CTAlloc(HYPRE_BigInt, S_offd_ncols, HYPRE_MEMORY_HOST); - - /* simply use a loop to copy data from A_offd */ - S_offd_i[0] = 0; - k3 = 0; - for (i = 1; i <= e; i++) - { - S_offd_i[i] = k3; - } - for (i = 0; i < m_e; i++) - { - col = perm[i + nI]; - k1 = A_offd_i[col]; - k2 = A_offd_i[col+1]; - for (j = k1; j < k2; j++) - { - S_offd_j[k3] = A_offd_j[j]; - S_offd_data[k3++] = A_offd_data[j]; - } - S_offd_i[i+1+e] = k3; - } - - /* give I, J, DATA to S_offd */ - hypre_CSRMatrixI(S_offd) = S_offd_i; - hypre_CSRMatrixJ(S_offd) = S_offd_j; - hypre_CSRMatrixData(S_offd) = S_offd_data; - - /* now we need to update S_offd_colmap */ - comm_pkg = hypre_ParCSRMatrixCommPkg(A); - /* setup comm_pkg if not yet built */ - if (!comm_pkg) - { - hypre_MatvecCommPkgCreate(A); - comm_pkg = hypre_ParCSRMatrixCommPkg(A); - } - /* get total num of send */ - num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - begin = hypre_ParCSRCommPkgSendMapStart(comm_pkg,0); - end = hypre_ParCSRCommPkgSendMapStart(comm_pkg,num_sends); - send_buf = hypre_TAlloc(HYPRE_BigInt, end - begin, HYPRE_MEMORY_HOST); - /* copy new index into send_buf */ - for (i = begin; i < end; i++) - { - send_buf[i-begin] = rperm[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,i)] - nLU + col_starts[0]; - } - - /* main communication */ - comm_handle = hypre_ParCSRCommHandleCreate(21, comm_pkg, send_buf, S_offd_colmap); - hypre_ParCSRCommHandleDestroy(comm_handle); - - /* setup index */ - hypre_ParCSRMatrixColMapOffd(matS) = S_offd_colmap; - - hypre_ILUSortOffdColmap(matS); - - /* free */ - hypre_TFree(send_buf, HYPRE_MEMORY_HOST); - } /* end of forming S */ - - *matSptr = matS; - *bufferp = buffer; - *matBL_infop = matBL_info; - *matBU_infop = matBU_info; - *matSL_infop = matSL_info; - *matSU_infop = matSU_info; - *A_fake_diag_ip= A_fake_diag_i; - - /* Destroy the bridge after acrossing the river */ - hypre_CSRMatrixDestroy(A_diag); - hypre_TFree(rperm, HYPRE_MEMORY_HOST); - hypre_TFree(rqperm, HYPRE_MEMORY_HOST); - - return hypre_error_flag; -} - - -HYPRE_Int -hypre_ILUSetupILUTDevice(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, HYPRE_Int *perm, HYPRE_Int *qperm, HYPRE_Int n, HYPRE_Int nLU, - cusparseMatDescr_t matL_des, cusparseMatDescr_t matU_des, cusparseSolvePolicy_t ilu_solve_policy, - void **bufferp, csrsv2Info_t *matBL_infop, csrsv2Info_t *matBU_infop, - csrsv2Info_t *matSL_infop, csrsv2Info_t *matSU_infop, - hypre_CSRMatrix **BLUptr, hypre_ParCSRMatrix **matSptr, hypre_CSRMatrix **Eptr, hypre_CSRMatrix **Fptr, - HYPRE_Int **A_fake_diag_ip) -{ - /* GPU-accelerated ILU0 with cusparse */ - HYPRE_Int i, j, k1, k2, k3, col; - - /* communication stuffs for S */ - MPI_Comm comm = hypre_ParCSRMatrixComm(A); - - HYPRE_Int my_id, num_procs; - hypre_MPI_Comm_size(comm,&num_procs); - hypre_MPI_Comm_rank(comm,&my_id); - - hypre_ParCSRCommPkg *comm_pkg; - hypre_ParCSRCommHandle *comm_handle; - HYPRE_Int num_sends, begin, end; - HYPRE_BigInt *send_buf = NULL; - HYPRE_Int *rperm = NULL; - HYPRE_Int *rqperm = NULL; - - hypre_ParCSRMatrix *Apq = NULL; - hypre_ParCSRMatrix *ALU = NULL; - - hypre_ParCSRMatrix *matS = NULL; - hypre_CSRMatrix *A_diag = NULL; - HYPRE_Int *A_fake_diag_i = NULL; - hypre_CSRMatrix *A_offd = NULL; - HYPRE_Int *A_offd_i = NULL; - HYPRE_Int *A_offd_j = NULL; - HYPRE_Real *A_offd_data = NULL; - hypre_CSRMatrix *SLU = NULL; - /* pointers to cusparse data */ - csrsv2Info_t matBL_info = NULL; - csrsv2Info_t matBU_info = NULL; - csrsv2Info_t matSL_info = NULL; - csrsv2Info_t matSU_info = NULL; - - HYPRE_Int buffer_size = 0; - void *buffer = NULL; - - /* variables for matS */ - HYPRE_Int m = n - nLU; - HYPRE_Int nI = nLU;//use default - HYPRE_Int e = 0; - HYPRE_Int m_e = m; - HYPRE_BigInt total_rows; - HYPRE_BigInt col_starts[2]; - HYPRE_Int *S_diag_i = NULL; - HYPRE_Int S_diag_nnz; - hypre_CSRMatrix *S_offd = NULL; - HYPRE_Int *S_offd_i = NULL; - HYPRE_Int *S_offd_j = NULL; - HYPRE_Real *S_offd_data = NULL; - HYPRE_BigInt *S_offd_colmap = NULL; - HYPRE_Int S_offd_nnz; - HYPRE_Int S_offd_ncols; - - /* set data slots */ - A_offd = hypre_ParCSRMatrixOffd(A); - A_offd_i = hypre_CSRMatrixI(A_offd); - A_offd_j = hypre_CSRMatrixJ(A_offd); - A_offd_data = hypre_CSRMatrixData(A_offd); - - hypre_ParCSRMatrix *parL = NULL; - hypre_ParCSRMatrix *parU = NULL; - hypre_ParCSRMatrix *parS = NULL; - HYPRE_Real *parD = NULL; - HYPRE_Int *uend = NULL; - - /* unfortunately we need to build the reverse permutation array */ - rperm = hypre_CTAlloc(HYPRE_Int, n, HYPRE_MEMORY_HOST); - rqperm = hypre_CTAlloc(HYPRE_Int, n, HYPRE_MEMORY_HOST); - for (i = 0; i < n; i++) - { - rperm[perm[i]] = i; - rqperm[qperm[i]] = i; - } - - /* Only call ILU when we really have a matrix on this processor */ - if (n > 0) - { - /* Copy diagonal matrix into a new place with permutation - * That is, A_diag = A_diag(perm,qperm); - */ - hypre_ParILURAPReorder( A, perm, rqperm, &Apq); - - /* Apply ILU factorization to the entile A_diag */ - hypre_ILUSetupILUT(Apq, lfil, tol, NULL, NULL, n, n, &parL, &parD, &parU, &parS, &uend); - - if (uend) - { - hypre_TFree(uend, HYPRE_MEMORY_HOST); - } - - if (parS) - { - hypre_ParCSRMatrixDestroy(parS); - } - - /* | L \ U (B) L^{-1}F | - * | EU^{-1} L \ U (S)| - * Extract submatrix L_B U_B, L_S U_S, EU_B^{-1}, L_B^{-1}F - * Note that in this function after ILU, all rows are sorted - * in a way different than HYPRE. Diagonal is not listed in the front - */ - hypre_ILUSetupLDUtoCusparse( parL, parD, parU, &ALU); - - if (parL) - { - hypre_ParCSRMatrixDestroy(parL); - } - if (parD) - { - hypre_TFree(parD, HYPRE_MEMORY_DEVICE); - } - if (parU) - { - hypre_ParCSRMatrixDestroy(parU); - } - - A_diag = hypre_ParCSRMatrixDiag(ALU); - - hypre_ParILUCusparseILUExtractEBFC(A_diag, nLU, BLUptr, &SLU, Eptr, Fptr); - - if (Apq) - { - hypre_ParCSRMatrixDestroy(Apq); - } - - } - else - { - *BLUptr = NULL; - *Eptr = NULL; - *Fptr = NULL; - SLU = NULL; - } - - /* create B */ - /* only analyse when nacessary */ - if ( nLU > 0 ) - { - /* Analysis of BILU */ - HYPRE_ILUSetupCusparseCSRILU0SetupSolve(*BLUptr, matL_des, matU_des, - ilu_solve_policy, &matBL_info, &matBU_info, - &buffer_size, &buffer); - } - - HYPRE_BigInt big_m = (HYPRE_BigInt)m; - hypre_MPI_Allreduce(&big_m, &total_rows, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); - /* only form when total_rows > 0 */ - if ( total_rows > 0 ) - { - /* now create S */ - /* need to get new column start */ - { - HYPRE_BigInt global_start; - hypre_MPI_Scan( &big_m, &global_start, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); - col_starts[0] = global_start - m; - col_starts[1] = global_start; - } - - A_fake_diag_i = hypre_CTAlloc(HYPRE_Int, m + 1, HYPRE_MEMORY_DEVICE); - if (SLU) - { - /* Analysis of SILU */ - HYPRE_ILUSetupCusparseCSRILU0SetupSolve(SLU, matL_des, matU_des, - ilu_solve_policy, &matSL_info, &matSU_info, - &buffer_size, &buffer); - } - else - { - SLU = hypre_CSRMatrixCreate(0,0,0); - hypre_CSRMatrixInitialize(SLU); - } - S_diag_i = hypre_CSRMatrixI(SLU); - S_diag_nnz = S_diag_i[m]; - /* Build ParCSRMatrix matS - * For example when np == 3 the new matrix takes the following form - * |IS_1 E_12 E_13| - * |E_21 IS_2 E_22| = S - * |E_31 E_32 IS_3| - * In which IS_i is the cusparse ILU factorization of S_i in one matrix - * */ - - /* We did nothing to A_offd, so all the data kept, just reorder them - * The create function takes comm, global num rows/cols, - * row/col start, num cols offd, nnz diag, nnz offd - */ - S_offd_nnz = hypre_CSRMatrixNumNonzeros(A_offd); - S_offd_ncols = hypre_CSRMatrixNumCols(A_offd); - - matS = hypre_ParCSRMatrixCreate( comm, - total_rows, - total_rows, - col_starts, - col_starts, - S_offd_ncols, - S_diag_nnz, - S_offd_nnz); - - /* first put diagonal data in */ - hypre_CSRMatrixDestroy(hypre_ParCSRMatrixDiag(matS)); - hypre_ParCSRMatrixDiag(matS) = SLU; - - /* now start to construct offdiag of S */ - S_offd = hypre_ParCSRMatrixOffd(matS); - S_offd_i = hypre_TAlloc(HYPRE_Int, m+1, HYPRE_MEMORY_DEVICE); - S_offd_j = hypre_TAlloc(HYPRE_Int, S_offd_nnz, HYPRE_MEMORY_DEVICE); - S_offd_data = hypre_TAlloc(HYPRE_Real, S_offd_nnz, HYPRE_MEMORY_DEVICE); - S_offd_colmap = hypre_CTAlloc(HYPRE_BigInt, S_offd_ncols, HYPRE_MEMORY_HOST); - - /* simply use a loop to copy data from A_offd */ - S_offd_i[0] = 0; - k3 = 0; - for (i = 1; i <= e; i++) - { - S_offd_i[i] = k3; - } - for (i = 0; i < m_e; i++) - { - col = perm[i + nI]; - k1 = A_offd_i[col]; - k2 = A_offd_i[col+1]; - for (j = k1; j < k2; j++) - { - S_offd_j[k3] = A_offd_j[j]; - S_offd_data[k3++] = A_offd_data[j]; - } - S_offd_i[i+1+e] = k3; - } - - /* give I, J, DATA to S_offd */ - hypre_CSRMatrixI(S_offd) = S_offd_i; - hypre_CSRMatrixJ(S_offd) = S_offd_j; - hypre_CSRMatrixData(S_offd) = S_offd_data; - - /* now we need to update S_offd_colmap */ - comm_pkg = hypre_ParCSRMatrixCommPkg(A); - /* setup comm_pkg if not yet built */ - if (!comm_pkg) + /* Free memory */ + if (h_A_diag != A_diag) { - hypre_MatvecCommPkgCreate(A); - comm_pkg = hypre_ParCSRMatrixCommPkg(A); + hypre_CSRMatrixDestroy(h_A_diag); } - /* get total num of send */ - num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - begin = hypre_ParCSRCommPkgSendMapStart(comm_pkg,0); - end = hypre_ParCSRCommPkgSendMapStart(comm_pkg,num_sends); - send_buf = hypre_TAlloc(HYPRE_BigInt, end - begin, HYPRE_MEMORY_HOST); - /* copy new index into send_buf */ - for (i = begin; i < end; i++) - { - send_buf[i-begin] = rperm[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,i)] - nLU + col_starts[0]; - } - - /* main communication */ - comm_handle = hypre_ParCSRCommHandleCreate(21, comm_pkg, send_buf, S_offd_colmap); - hypre_ParCSRCommHandleDestroy(comm_handle); - - /* setup index */ - hypre_ParCSRMatrixColMapOffd(matS) = S_offd_colmap; - - hypre_ILUSortOffdColmap(matS); - - /* free */ - hypre_TFree(send_buf, HYPRE_MEMORY_HOST); - } /* end of forming S */ - - *matSptr = matS; - *bufferp = buffer; - *matBL_infop = matBL_info; - *matBU_infop = matBU_info; - *matSL_infop = matSL_info; - *matSU_infop = matSU_info; - *A_fake_diag_ip= A_fake_diag_i; + } - /* Destroy the bridge after acrossing the river */ - hypre_CSRMatrixDestroy(A_diag); - hypre_TFree(rperm, HYPRE_MEMORY_HOST); - hypre_TFree(rqperm, HYPRE_MEMORY_HOST); + /* Set output pointers */ + *Bp = B; + *Cp = C; + *Ep = E; + *Fp = F; return hypre_error_flag; } -/* Reorder matrix A based on local permutation (combine local permutation into global permutation) +/*-------------------------------------------------------------------------- + * hypre_ParILURAPReorder + * + * Reorder matrix A based on local permutation, i.e., combine local + * permutation into global permutation) + * * WARNING: We don't put diagonal to the first entry of each row + * * A = input matrix - * perm = permutation array indicating ordering of rows. Perm could come from a - * CF_marker array or a reordering routine. + * perm = permutation array indicating ordering of rows. + * Perm could come from a CF_marker array or a reordering routine. * rqperm = reverse permutation array indicating ordering of columns * A_pq = pointer to the output par CSR matrix. - */ + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ParILURAPReorder(hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int *rqperm, hypre_ParCSRMatrix **A_pq) +hypre_ParILURAPReorder(hypre_ParCSRMatrix *A, + HYPRE_Int *perm, + HYPRE_Int *rqperm, + hypre_ParCSRMatrix **A_pq) { /* Get necessary slots */ - hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); - //HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); - //HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); - //HYPRE_Real *A_diag_data = hypre_CSRMatrixData(A_diag); - HYPRE_Int n = hypre_CSRMatrixNumRows(A_diag); - //HYPRE_Int nnz_A_diag = A_diag_i[n]; - - //HYPRE_Int i, j, current_idx; + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + HYPRE_Int n = hypre_CSRMatrixNumRows(A_diag); + HYPRE_MemoryLocation memory_location = hypre_ParCSRMatrixMemoryLocation(A); + + /* Permutation matrices */ + hypre_ParCSRMatrix *P, *Q, *PAQ, *PA; + hypre_CSRMatrix *P_diag, *Q_diag; + HYPRE_Int *P_diag_i, *P_diag_j, *Q_diag_i, *Q_diag_j; + HYPRE_Complex *P_diag_data, *Q_diag_data; + HYPRE_Int *h_perm, *h_rqperm; + + /* Local variables */ HYPRE_Int i; - /* MPI */ - MPI_Comm comm = hypre_ParCSRMatrixComm(A); - HYPRE_Int num_procs, my_id; + /* Trivial case */ + if (!perm && !rqperm) + { + *A_pq = hypre_ParCSRMatrixClone(A, 1); - hypre_MPI_Comm_size(comm,&num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + return hypre_error_flag; + } + else if (!perm && rqperm) + { + hypre_error_w_msg(HYPRE_ERROR_ARG, "(!perm && rqperm) should not be possible!"); + } + else if (perm && !rqperm) + { + hypre_error_w_msg(HYPRE_ERROR_ARG, "(perm && !rqperm) should not be possible!"); + } /* Create permutation matrices P = I(perm,:) and Q(rqperm,:), such that Apq = PAQ */ - hypre_ParCSRMatrix *P, *Q, *PAQ, *PA; - - hypre_CSRMatrix *P_diag, *Q_diag; - hypre_CSRMatrix *P_offd, *Q_offd; - - P = hypre_ParCSRMatrixCreate( comm, - hypre_ParCSRMatrixGlobalNumRows(A), - hypre_ParCSRMatrixGlobalNumRows(A), - hypre_ParCSRMatrixRowStarts(A), - hypre_ParCSRMatrixColStarts(A), - 0, - n, - 0); - - Q = hypre_ParCSRMatrixCreate( comm, - hypre_ParCSRMatrixGlobalNumRows(A), - hypre_ParCSRMatrixGlobalNumRows(A), - hypre_ParCSRMatrixRowStarts(A), - hypre_ParCSRMatrixColStarts(A), - 0, - n, - 0); - - P_diag = hypre_ParCSRMatrixDiag(P); - Q_diag = hypre_ParCSRMatrixDiag(Q); - P_offd = hypre_ParCSRMatrixOffd(P); - Q_offd = hypre_ParCSRMatrixOffd(Q); - - HYPRE_Int *P_diag_i, *P_diag_j, *Q_diag_i, *Q_diag_j; - HYPRE_Real *P_diag_data, *Q_diag_data; - HYPRE_Int *P_offd_i, *Q_offd_i; - - P_diag_i = hypre_TAlloc(HYPRE_Int, n+1, HYPRE_MEMORY_DEVICE); - P_diag_j = hypre_TAlloc(HYPRE_Int, n, HYPRE_MEMORY_DEVICE); - P_diag_data = hypre_TAlloc(HYPRE_Real, n, HYPRE_MEMORY_DEVICE); - - Q_diag_i = hypre_TAlloc(HYPRE_Int, n+1, HYPRE_MEMORY_DEVICE); - Q_diag_j = hypre_TAlloc(HYPRE_Int, n, HYPRE_MEMORY_DEVICE); - Q_diag_data = hypre_TAlloc(HYPRE_Real, n, HYPRE_MEMORY_DEVICE); - - /* fill data, openmp should be availiable here */ + P = hypre_ParCSRMatrixCreate(comm, + hypre_ParCSRMatrixGlobalNumRows(A), + hypre_ParCSRMatrixGlobalNumRows(A), + hypre_ParCSRMatrixRowStarts(A), + hypre_ParCSRMatrixColStarts(A), + 0, + n, + 0); + + Q = hypre_ParCSRMatrixCreate(comm, + hypre_ParCSRMatrixGlobalNumRows(A), + hypre_ParCSRMatrixGlobalNumRows(A), + hypre_ParCSRMatrixRowStarts(A), + hypre_ParCSRMatrixColStarts(A), + 0, + n, + 0); + + hypre_ParCSRMatrixInitialize_v2(P, HYPRE_MEMORY_HOST); + hypre_ParCSRMatrixInitialize_v2(Q, HYPRE_MEMORY_HOST); + + P_diag = hypre_ParCSRMatrixDiag(P); + Q_diag = hypre_ParCSRMatrixDiag(Q); + + P_diag_i = hypre_CSRMatrixI(P_diag); + P_diag_j = hypre_CSRMatrixJ(P_diag); + P_diag_data = hypre_CSRMatrixData(P_diag); + + Q_diag_i = hypre_CSRMatrixI(Q_diag); + Q_diag_j = hypre_CSRMatrixJ(Q_diag); + Q_diag_data = hypre_CSRMatrixData(Q_diag); + + /* Set/Move permutation vectors on host */ + if (hypre_GetActualMemLocation(memory_location) == hypre_MEMORY_DEVICE) + { + h_perm = hypre_TAlloc(HYPRE_Int, n, HYPRE_MEMORY_HOST); + h_rqperm = hypre_TAlloc(HYPRE_Int, n, HYPRE_MEMORY_HOST); + + hypre_TMemcpy(h_perm, perm, HYPRE_Int, n, HYPRE_MEMORY_HOST, memory_location); + hypre_TMemcpy(h_rqperm, rqperm, HYPRE_Int, n, HYPRE_MEMORY_HOST, memory_location); + } + else + { + h_perm = perm; + h_rqperm = rqperm; + } + + /* Fill data */ +#if defined(HYPRE_USING_OPENMP) + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif for (i = 0; i < n; i++) { P_diag_i[i] = i; - P_diag_j[i] = perm[i]; + P_diag_j[i] = h_perm[i]; P_diag_data[i] = 1.0; Q_diag_i[i] = i; - Q_diag_j[i] = rqperm[i]; + Q_diag_j[i] = h_rqperm[i]; Q_diag_data[i] = 1.0; - } P_diag_i[n] = n; Q_diag_i[n] = n; - /* give I, J, DATA */ - hypre_CSRMatrixI(P_diag) = P_diag_i; - hypre_CSRMatrixJ(P_diag) = P_diag_j; - hypre_CSRMatrixData(P_diag) = P_diag_data; - - hypre_CSRMatrixI(Q_diag) = Q_diag_i; - hypre_CSRMatrixJ(Q_diag) = Q_diag_j; - hypre_CSRMatrixData(Q_diag) = Q_diag_data; - - P_offd_i = hypre_CTAlloc(HYPRE_Int, n+1, HYPRE_MEMORY_DEVICE); - Q_offd_i = hypre_CTAlloc(HYPRE_Int, n+1, HYPRE_MEMORY_DEVICE); - - hypre_CSRMatrixI(P_offd) = P_offd_i; - hypre_CSRMatrixI(Q_offd) = Q_offd_i; + /* Move to final memory location */ + hypre_ParCSRMatrixMigrate(P, memory_location); + hypre_ParCSRMatrixMigrate(Q, memory_location); /* Update A */ - PA = hypre_ParCSRMatMat(P, A); + PA = hypre_ParCSRMatMat(P, A); PAQ = hypre_ParCSRMatMat(PA, Q); //PAQ = hypre_ParCSRMatrixRAPKT(P, A, Q, 0); /* free and return */ hypre_ParCSRMatrixDestroy(P); hypre_ParCSRMatrixDestroy(Q); - - *A_pq = PAQ; - - return hypre_error_flag; -} - -/* Convert the L, D, U style to the cusparse style - * Assume the diagonal of L and U are the ilu factorization, directly combine them - */ -HYPRE_Int -hypre_ParILURAPBuildRP(hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *BLUm, hypre_ParCSRMatrix* E, hypre_ParCSRMatrix *F, - cusparseMatDescr_t matL_des, cusparseMatDescr_t matU_des, hypre_ParCSRMatrix **Rp, hypre_ParCSRMatrix **Pp) -{ - /* declare variables */ - HYPRE_Int j, row, col; - HYPRE_Real val; - hypre_ParCSRMatrix *R, *P; - hypre_CSRMatrix *R_diag, *P_diag; - - hypre_CSRMatrix *BLUm_diag = hypre_ParCSRMatrixDiag(BLUm); - HYPRE_Int *BLUm_diag_i = hypre_CSRMatrixI(BLUm_diag); - HYPRE_Int *BLUm_diag_j = hypre_CSRMatrixJ(BLUm_diag); - HYPRE_Real *BLUm_diag_data = hypre_CSRMatrixData(BLUm_diag); - - hypre_CSRMatrix *E_diag = hypre_ParCSRMatrixDiag(E); - HYPRE_Int *E_diag_i = hypre_CSRMatrixI(E_diag); - HYPRE_Int *E_diag_j = hypre_CSRMatrixJ(E_diag); - HYPRE_Real *E_diag_data = hypre_CSRMatrixData(E_diag); - hypre_CSRMatrix *F_diag = hypre_ParCSRMatrixDiag(F); - HYPRE_Int *F_diag_i = hypre_CSRMatrixI(F_diag); - HYPRE_Int *F_diag_j = hypre_CSRMatrixJ(F_diag); - HYPRE_Real *F_diag_data = hypre_CSRMatrixData(F_diag); - - HYPRE_Int n = hypre_CSRMatrixNumRows(F_diag); - HYPRE_Int m = hypre_CSRMatrixNumCols(F_diag); - - HYPRE_Int nnz_BLUm = BLUm_diag_i[n]; - - /* MPI */ - MPI_Comm comm = hypre_ParCSRMatrixComm(A); - HYPRE_Int num_procs, my_id; - - hypre_MPI_Comm_size(comm,&num_procs); - hypre_MPI_Comm_rank(comm,&my_id); - - /* cusparse */ - HYPRE_Int isDoublePrecision = sizeof(HYPRE_Complex) == sizeof(hypre_double); - HYPRE_Int isSinglePrecision = sizeof(HYPRE_Complex) == sizeof(hypre_double) / 2; - - hypre_assert(isDoublePrecision || isSinglePrecision); - - cusparseHandle_t handle = hypre_HandleCusparseHandle(hypre_handle()); - - /* compute P = -UB\(LB\F) - * op(A) * op(X) = \alpha op(B) - * first iLF = LB\F -> LB*iLF = F - */ - - HYPRE_Int algo = 0; - HYPRE_Real alpha = 1.0; - HYPRE_Real *rhs; - cusparseSolvePolicy_t policy = CUSPARSE_SOLVE_POLICY_NO_LEVEL; - size_t buffer_size, buffer_size_old; - void *buffer; - csrsm2Info_t malL_info = NULL; - HYPRE_CUSPARSE_CALL(cusparseCreateCsrsm2Info(&malL_info)); - - rhs = hypre_CTAlloc(HYPRE_Real, m * n, HYPRE_MEMORY_DEVICE); - - /* fill data, note that rhs is in Fortan style (col first) - * oprating by col is slow, but - */ - for (row = 0; row < n; row++) - { - for (j = F_diag_i[row]; j < F_diag_i[row+1]; j++) - { - col = F_diag_j[j]; - *(rhs + col*n + row) = F_diag_data[j]; - } - } - - /* check buffer size and create buffer */ - - if (isDoublePrecision) - { - HYPRE_CUSPARSE_CALL(cusparseDcsrsm2_bufferSizeExt( handle, algo, CUSPARSE_OPERATION_NON_TRANSPOSE, CUSPARSE_OPERATION_NON_TRANSPOSE, - n, m, nnz_BLUm, (hypre_double *)&alpha, matL_des, (hypre_double *)BLUm_diag_data, BLUm_diag_i, BLUm_diag_j, (hypre_double *)rhs, n, malL_info, policy, &buffer_size)); - } - else if (isSinglePrecision) - { - HYPRE_CUSPARSE_CALL(cusparseScsrsm2_bufferSizeExt( handle, algo, CUSPARSE_OPERATION_NON_TRANSPOSE, CUSPARSE_OPERATION_NON_TRANSPOSE, - n, m, nnz_BLUm, (float *)&alpha, matL_des, (float *)BLUm_diag_data, BLUm_diag_i, BLUm_diag_j, (float *)rhs, n, malL_info, policy, &buffer_size)); - } - - buffer = hypre_MAlloc(buffer_size, HYPRE_MEMORY_DEVICE); - - /* analysis */ - - if (isDoublePrecision) - { - HYPRE_CUSPARSE_CALL(cusparseDcsrsm2_analysis( handle, algo, CUSPARSE_OPERATION_NON_TRANSPOSE, CUSPARSE_OPERATION_NON_TRANSPOSE, - n, m, nnz_BLUm, (hypre_double *)&alpha, matL_des, (hypre_double *)BLUm_diag_data, BLUm_diag_i, BLUm_diag_j, (hypre_double *)rhs, n, malL_info, policy, buffer)); - } - else if (isSinglePrecision) - { - HYPRE_CUSPARSE_CALL(cusparseScsrsm2_analysis( handle, algo, CUSPARSE_OPERATION_NON_TRANSPOSE, CUSPARSE_OPERATION_NON_TRANSPOSE, - n, m, nnz_BLUm, (float *)&alpha, matL_des, (float *)BLUm_diag_data, BLUm_diag_i, BLUm_diag_j, (float *)rhs, n, malL_info, policy, buffer)); - } - - /* solve phase */ - if (isDoublePrecision) - { - HYPRE_CUSPARSE_CALL(cusparseDcsrsm2_solve( handle, algo, CUSPARSE_OPERATION_NON_TRANSPOSE, CUSPARSE_OPERATION_NON_TRANSPOSE, - n, m, nnz_BLUm, (hypre_double *)&alpha, matL_des, (hypre_double *)BLUm_diag_data, BLUm_diag_i, BLUm_diag_j, (hypre_double *)rhs, n, malL_info, policy, buffer)); - } - else if (isSinglePrecision) - { - HYPRE_CUSPARSE_CALL(cusparseScsrsm2_solve( handle, algo, CUSPARSE_OPERATION_NON_TRANSPOSE, CUSPARSE_OPERATION_NON_TRANSPOSE, - n, m, nnz_BLUm, (float *)&alpha, matL_des, (float *)BLUm_diag_data, BLUm_diag_i, BLUm_diag_j, (float *)rhs, n, malL_info, policy, buffer)); - } - /* now P = -UB\(LB\F) -> UB*P = -(LB\F) - */ - alpha = -1.0; - csrsm2Info_t malU_info = NULL; - HYPRE_CUSPARSE_CALL(cusparseCreateCsrsm2Info(&malU_info)); - - buffer_size_old = buffer_size; - - /* check buffer size and create buffer */ - - if (isDoublePrecision) - { - HYPRE_CUSPARSE_CALL(cusparseDcsrsm2_bufferSizeExt( handle, algo, CUSPARSE_OPERATION_NON_TRANSPOSE, CUSPARSE_OPERATION_NON_TRANSPOSE, - n, m, nnz_BLUm, (hypre_double *)&alpha, matU_des, (hypre_double *)BLUm_diag_data, BLUm_diag_i, BLUm_diag_j, (hypre_double *)rhs, n, malU_info, policy, &buffer_size)); - } - else if (isSinglePrecision) - { - HYPRE_CUSPARSE_CALL(cusparseScsrsm2_bufferSizeExt( handle, algo, CUSPARSE_OPERATION_NON_TRANSPOSE, CUSPARSE_OPERATION_NON_TRANSPOSE, - n, m, nnz_BLUm, (float *)&alpha, matU_des, (float *)BLUm_diag_data, BLUm_diag_i, BLUm_diag_j, (float *)rhs, n, malU_info, policy, &buffer_size)); - } - - if (buffer_size > buffer_size_old) - { - buffer = hypre_ReAlloc_v2(buffer, buffer_size_old, buffer_size, HYPRE_MEMORY_DEVICE); - buffer_size_old = buffer_size; - } - - /* analysis */ - - if (isDoublePrecision) - { - HYPRE_CUSPARSE_CALL(cusparseDcsrsm2_analysis( handle, algo, CUSPARSE_OPERATION_NON_TRANSPOSE, CUSPARSE_OPERATION_NON_TRANSPOSE, - n, m, nnz_BLUm, (hypre_double *)&alpha, matU_des, (hypre_double *)BLUm_diag_data, BLUm_diag_i, BLUm_diag_j, (hypre_double *)rhs, n, malU_info, policy, buffer)); - } - else if (isSinglePrecision) - { - HYPRE_CUSPARSE_CALL(cusparseScsrsm2_analysis( handle, algo, CUSPARSE_OPERATION_NON_TRANSPOSE, CUSPARSE_OPERATION_NON_TRANSPOSE, - n, m, nnz_BLUm, (float *)&alpha, matU_des, (float *)BLUm_diag_data, BLUm_diag_i, BLUm_diag_j, (float *)rhs, n, malU_info, policy, buffer)); - } - - /* solve phase */ - if (isDoublePrecision) - { - HYPRE_CUSPARSE_CALL(cusparseDcsrsm2_solve( handle, algo, CUSPARSE_OPERATION_NON_TRANSPOSE, CUSPARSE_OPERATION_NON_TRANSPOSE, - n, m, nnz_BLUm, (hypre_double *)&alpha, matU_des, (hypre_double *)BLUm_diag_data, BLUm_diag_i, BLUm_diag_j, (hypre_double *)rhs, n, malU_info, policy, buffer)); - } - else if (isSinglePrecision) - { - HYPRE_CUSPARSE_CALL(cusparseScsrsm2_solve( handle, algo, CUSPARSE_OPERATION_NON_TRANSPOSE, CUSPARSE_OPERATION_NON_TRANSPOSE, - n, m, nnz_BLUm, (float *)&alpha, matU_des, (float *)BLUm_diag_data, BLUm_diag_i, BLUm_diag_j, (float *)rhs, n, malU_info, policy, buffer)); - } - /* wait till GPU done to copy data */ - cudaDeviceSynchronize(); - /* now form P, (n + m) * m */ - HYPRE_Real drop_tol = 1e-06; - HYPRE_Int ctrP = 0; - HYPRE_Int *P_diag_i; - HYPRE_Int *P_offd_i; - HYPRE_Int *P_diag_j; - HYPRE_Real *P_diag_data; - - HYPRE_Int capacity_P = nnz_BLUm + m; - - P_diag_i = hypre_TAlloc(HYPRE_Int, n+m+1, HYPRE_MEMORY_DEVICE); - P_offd_i = hypre_CTAlloc(HYPRE_Int, n+m+1, HYPRE_MEMORY_DEVICE); - P_diag_j = hypre_TAlloc(HYPRE_Int, capacity_P, HYPRE_MEMORY_DEVICE); - P_diag_data = hypre_TAlloc(HYPRE_Real, capacity_P, HYPRE_MEMORY_DEVICE); - - for (row = 0; row < n; row++) - { - P_diag_i[row] = ctrP; - for (col = 0; col < m; col++) - { - val = *(rhs + col*n + row); - if (hypre_abs(val) > drop_tol) - { - if (ctrP >= capacity_P) - { - HYPRE_Int tmp; - tmp = capacity_P; - capacity_P = capacity_P * EXPAND_FACT; - P_diag_j = hypre_TReAlloc_v2(P_diag_j, HYPRE_Int, tmp, HYPRE_Int, capacity_P, HYPRE_MEMORY_DEVICE); - P_diag_data = hypre_TReAlloc_v2(P_diag_data, HYPRE_Real, tmp, HYPRE_Real, capacity_P, HYPRE_MEMORY_DEVICE); - } - P_diag_j[ctrP] = col; - P_diag_data[ctrP++] = val; - } - } - } - - if (ctrP + m >= capacity_P) - { - HYPRE_Int tmp; - tmp = capacity_P; - capacity_P = ctrP + m; - P_diag_j = hypre_TReAlloc_v2(P_diag_j, HYPRE_Int, tmp, HYPRE_Int, capacity_P, HYPRE_MEMORY_DEVICE); - P_diag_data = hypre_TReAlloc_v2(P_diag_data, HYPRE_Real, tmp, HYPRE_Real, capacity_P, HYPRE_MEMORY_DEVICE); - } - - for (row = 0; row < m; row++) - { - P_diag_i[row+n] = ctrP; - P_diag_j[ctrP] = row; - P_diag_data[ctrP++] = 1.0; - } - - P_diag_i[m+n] = ctrP; - - /* now start to form R = - (E / UB ) / LB - * first EiUB = E / UB -> UB'*EiUB'=E' - */ - alpha = 1.0; - csrsm2Info_t malU_info2 = NULL; - HYPRE_CUSPARSE_CALL(cusparseCreateCsrsm2Info(&malU_info2)); - - /* fill data, note that rhs is in Fortan style (col first) - * oprating by col is slow, but - */ - - hypre_TFree(rhs, HYPRE_MEMORY_DEVICE); - rhs = hypre_CTAlloc(HYPRE_Real, m * n, HYPRE_MEMORY_DEVICE); - - for (row = 0; row < m; row++) - { - for (j = E_diag_i[row]; j < E_diag_i[row+1]; j++) - { - col = E_diag_j[j]; - *(rhs + col*m + row) = E_diag_data[j]; - } - } - - /* check buffer size and create buffer */ - - if (isDoublePrecision) - { - HYPRE_CUSPARSE_CALL(cusparseDcsrsm2_bufferSizeExt( handle, algo, CUSPARSE_OPERATION_TRANSPOSE, CUSPARSE_OPERATION_TRANSPOSE, - n, m, nnz_BLUm, (hypre_double *)&alpha, matU_des, (hypre_double *)BLUm_diag_data, BLUm_diag_i, BLUm_diag_j, (hypre_double *)rhs, m, malU_info2, policy, &buffer_size)); - } - else if (isSinglePrecision) - { - HYPRE_CUSPARSE_CALL(cusparseScsrsm2_bufferSizeExt( handle, algo, CUSPARSE_OPERATION_TRANSPOSE, CUSPARSE_OPERATION_TRANSPOSE, - n, m, nnz_BLUm, (float *)&alpha, matU_des, (float *)BLUm_diag_data, BLUm_diag_i, BLUm_diag_j, (float *)rhs, m, malU_info2, policy, &buffer_size)); - } - - if (buffer_size > buffer_size_old) - { - buffer = hypre_ReAlloc_v2(buffer, buffer_size_old, buffer_size, HYPRE_MEMORY_DEVICE); - buffer_size_old = buffer_size; - } - - /* analysis */ - - if (isDoublePrecision) - { - HYPRE_CUSPARSE_CALL(cusparseDcsrsm2_analysis( handle, algo, CUSPARSE_OPERATION_TRANSPOSE, CUSPARSE_OPERATION_TRANSPOSE, - n, m, nnz_BLUm, (hypre_double *)&alpha, matU_des, (hypre_double *)BLUm_diag_data, BLUm_diag_i, BLUm_diag_j, (hypre_double *)rhs, m, malU_info2, policy, buffer)); - } - else if (isSinglePrecision) - { - HYPRE_CUSPARSE_CALL(cusparseScsrsm2_analysis( handle, algo, CUSPARSE_OPERATION_TRANSPOSE, CUSPARSE_OPERATION_TRANSPOSE, - n, m, nnz_BLUm, (float *)&alpha, matU_des, (float *)BLUm_diag_data, BLUm_diag_i, BLUm_diag_j, (float *)rhs, m, malU_info2, policy, buffer)); - } - - /* solve phase */ - if (isDoublePrecision) - { - HYPRE_CUSPARSE_CALL(cusparseDcsrsm2_solve( handle, algo, CUSPARSE_OPERATION_TRANSPOSE, CUSPARSE_OPERATION_TRANSPOSE, - n, m, nnz_BLUm, (hypre_double *)&alpha, matU_des, (hypre_double *)BLUm_diag_data, BLUm_diag_i, BLUm_diag_j, (hypre_double *)rhs, m, malU_info2, policy, buffer)); - } - else if (isSinglePrecision) - { - HYPRE_CUSPARSE_CALL(cusparseScsrsm2_solve( handle, algo, CUSPARSE_OPERATION_TRANSPOSE, CUSPARSE_OPERATION_TRANSPOSE, - n, m, nnz_BLUm, (float *)&alpha, matU_des, (float *)BLUm_diag_data, BLUm_diag_i, BLUm_diag_j, (float *)rhs, m, malU_info2, policy, buffer)); - } - - /* R = - (EiUB ) / LB -> LB'R' = -EiUB' - */ - alpha = -1.0; - csrsm2Info_t malL_info2 = NULL; - HYPRE_CUSPARSE_CALL(cusparseCreateCsrsm2Info(&malL_info2)); - - /* check buffer size and create buffer */ - - if (isDoublePrecision) - { - HYPRE_CUSPARSE_CALL(cusparseDcsrsm2_bufferSizeExt( handle, algo, CUSPARSE_OPERATION_TRANSPOSE, CUSPARSE_OPERATION_TRANSPOSE, - n, m, nnz_BLUm, (hypre_double *)&alpha, matL_des, (hypre_double *)BLUm_diag_data, BLUm_diag_i, BLUm_diag_j, (hypre_double *)rhs, m, malL_info2, policy, &buffer_size)); - } - else if (isSinglePrecision) - { - HYPRE_CUSPARSE_CALL(cusparseScsrsm2_bufferSizeExt( handle, algo, CUSPARSE_OPERATION_TRANSPOSE, CUSPARSE_OPERATION_TRANSPOSE, - n, m, nnz_BLUm, (float *)&alpha, matL_des, (float *)BLUm_diag_data, BLUm_diag_i, BLUm_diag_j, (float *)rhs, m, malL_info2, policy, &buffer_size)); - } - - if (buffer_size > buffer_size_old) - { - buffer = hypre_ReAlloc_v2(buffer, buffer_size_old, buffer_size, HYPRE_MEMORY_DEVICE); - buffer_size_old = buffer_size; - } - - /* analysis */ - - if (isDoublePrecision) - { - HYPRE_CUSPARSE_CALL(cusparseDcsrsm2_analysis( handle, algo, CUSPARSE_OPERATION_TRANSPOSE, CUSPARSE_OPERATION_TRANSPOSE, - n, m, nnz_BLUm, (hypre_double *)&alpha, matL_des, (hypre_double *)BLUm_diag_data, BLUm_diag_i, BLUm_diag_j, (hypre_double *)rhs, m, malL_info2, policy, buffer)); - } - else if (isSinglePrecision) - { - HYPRE_CUSPARSE_CALL(cusparseScsrsm2_analysis( handle, algo, CUSPARSE_OPERATION_TRANSPOSE, CUSPARSE_OPERATION_TRANSPOSE, - n, m, nnz_BLUm, (float *)&alpha, matL_des, (float *)BLUm_diag_data, BLUm_diag_i, BLUm_diag_j, (float *)rhs, m, malL_info2, policy, buffer)); - } - - /* solve phase */ - if (isDoublePrecision) - { - HYPRE_CUSPARSE_CALL(cusparseDcsrsm2_solve( handle, algo, CUSPARSE_OPERATION_TRANSPOSE, CUSPARSE_OPERATION_TRANSPOSE, - n, m, nnz_BLUm, (hypre_double *)&alpha, matL_des, (hypre_double *)BLUm_diag_data, BLUm_diag_i, BLUm_diag_j, (hypre_double *)rhs, m, malL_info2, policy, buffer)); - } - else if (isSinglePrecision) + hypre_ParCSRMatrixDestroy(PA); + if (h_perm != perm) { - HYPRE_CUSPARSE_CALL(cusparseScsrsm2_solve( handle, algo, CUSPARSE_OPERATION_TRANSPOSE, CUSPARSE_OPERATION_TRANSPOSE, - n, m, nnz_BLUm, (float *)&alpha, matL_des, (float *)BLUm_diag_data, BLUm_diag_i, BLUm_diag_j, (float *)rhs, m, malL_info2, policy, buffer)); + hypre_TFree(h_perm, HYPRE_MEMORY_HOST); } - cudaDeviceSynchronize(); - /* now form R, m * (n + m) */ - HYPRE_Int ctrR = 0; - HYPRE_Int *R_diag_i; - HYPRE_Int *R_offd_i; - HYPRE_Int *R_diag_j; - HYPRE_Real *R_diag_data; - - HYPRE_Int capacity_R = nnz_BLUm + m; - R_diag_i = hypre_TAlloc(HYPRE_Int, m+1, HYPRE_MEMORY_DEVICE); - R_offd_i = hypre_CTAlloc(HYPRE_Int, m+1, HYPRE_MEMORY_DEVICE); - R_diag_j = hypre_TAlloc(HYPRE_Int, capacity_R, HYPRE_MEMORY_DEVICE); - R_diag_data = hypre_TAlloc(HYPRE_Real, capacity_R, HYPRE_MEMORY_DEVICE); - - for (row = 0; row < m; row++) + if (h_rqperm != rqperm) { - R_diag_i[row] = ctrR; - for (col = 0; col < n; col++) - { - val = *(rhs + col*m + row); - if (hypre_abs(val) > drop_tol) - { - if (ctrR >= capacity_R) - { - HYPRE_Int tmp; - tmp = capacity_R; - capacity_R = capacity_R * EXPAND_FACT; - R_diag_j = hypre_TReAlloc_v2(R_diag_j, HYPRE_Int, tmp, HYPRE_Int, capacity_R, HYPRE_MEMORY_DEVICE); - R_diag_data = hypre_TReAlloc_v2(R_diag_data, HYPRE_Real, tmp, HYPRE_Real, capacity_R, HYPRE_MEMORY_DEVICE); - } - R_diag_j[ctrR] = col; - R_diag_data[ctrR++] = val; - } - } - if (ctrR >= capacity_R) - { - HYPRE_Int tmp; - tmp = capacity_R; - capacity_R = capacity_R * EXPAND_FACT; - R_diag_j = hypre_TReAlloc_v2(R_diag_j, HYPRE_Int, tmp, HYPRE_Int, capacity_R, HYPRE_MEMORY_DEVICE); - R_diag_data = hypre_TReAlloc_v2(R_diag_data, HYPRE_Real, tmp, HYPRE_Real, capacity_R, HYPRE_MEMORY_DEVICE); - } - R_diag_j[ctrR] = n + row; - R_diag_data[ctrR++] = 1.0; + hypre_TFree(h_rqperm, HYPRE_MEMORY_HOST); } - R_diag_i[m] = ctrR; - - hypre_TFree(buffer, HYPRE_MEMORY_DEVICE); - - /* create ParCSR matrices */ - - R = hypre_ParCSRMatrixCreate( hypre_ParCSRMatrixComm(A), - hypre_ParCSRMatrixGlobalNumRows(E), - hypre_ParCSRMatrixGlobalNumCols(A), - hypre_ParCSRMatrixRowStarts(E), - hypre_ParCSRMatrixColStarts(A), - 0, - ctrR, - 0); - - P = hypre_ParCSRMatrixCreate( hypre_ParCSRMatrixComm(A), - hypre_ParCSRMatrixGlobalNumRows(A), - hypre_ParCSRMatrixGlobalNumCols(F), - hypre_ParCSRMatrixRowStarts(A), - hypre_ParCSRMatrixColStarts(F), - 0, - ctrP, - 0); - - /* Assign value to diagonal data */ - - R_diag = hypre_ParCSRMatrixDiag(R); - hypre_CSRMatrixI(R_diag) = R_diag_i; - hypre_CSRMatrixJ(R_diag) = R_diag_j; - hypre_CSRMatrixData(R_diag) = R_diag_data; - hypre_CSRMatrixSetDataOwner(R_diag, 1); - - P_diag = hypre_ParCSRMatrixDiag(P); - hypre_CSRMatrixI(P_diag) = P_diag_i; - hypre_CSRMatrixJ(P_diag) = P_diag_j; - hypre_CSRMatrixData(P_diag) = P_diag_data; - hypre_CSRMatrixSetDataOwner(P_diag, 1); - - /* Assign value to off diagonal data */ - - R_diag = hypre_ParCSRMatrixOffd(R); - hypre_CSRMatrixI(R_diag) = R_offd_i; - P_diag = hypre_ParCSRMatrixOffd(P); - hypre_CSRMatrixI(P_diag) = P_offd_i; - - *Rp = R; - *Pp = P; - - HYPRE_CUSPARSE_CALL(cusparseDestroyCsrsm2Info(malL_info)); - HYPRE_CUSPARSE_CALL(cusparseDestroyCsrsm2Info(malU_info)); - HYPRE_CUSPARSE_CALL(cusparseDestroyCsrsm2Info(malL_info2)); - HYPRE_CUSPARSE_CALL(cusparseDestroyCsrsm2Info(malU_info2)); + *A_pq = PAQ; return hypre_error_flag; } -/* Convert the L, D, U style to the cusparse style +/*-------------------------------------------------------------------------- + * hypre_ILUSetupLDUtoCusparse + * + * Convert the L, D, U style to the cusparse style * Assume the diagonal of L and U are the ilu factorization, directly combine them - */ + * + * TODO (VPM): Check this function's name + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUSetupLDUtoCusparse(hypre_ParCSRMatrix *L, HYPRE_Real *D, hypre_ParCSRMatrix *U, hypre_ParCSRMatrix **LDUp) +hypre_ILUSetupLDUtoCusparse(hypre_ParCSRMatrix *L, + HYPRE_Real *D, + hypre_ParCSRMatrix *U, + hypre_ParCSRMatrix **LDUp) { - /* data slots */ - HYPRE_Int i, j, pos; - - hypre_CSRMatrix *L_diag = hypre_ParCSRMatrixDiag(L); - hypre_CSRMatrix *U_diag = hypre_ParCSRMatrixDiag(U); - HYPRE_Int *L_diag_i = hypre_CSRMatrixI(L_diag); - HYPRE_Int *L_diag_j = hypre_CSRMatrixJ(L_diag); - HYPRE_Real *L_diag_data = hypre_CSRMatrixData(L_diag); - HYPRE_Int *U_diag_i = hypre_CSRMatrixI(U_diag); - HYPRE_Int *U_diag_j = hypre_CSRMatrixJ(U_diag); - HYPRE_Real *U_diag_data = hypre_CSRMatrixData(U_diag); - HYPRE_Int n = hypre_ParCSRMatrixNumRows(L); - HYPRE_Int nnz_L = L_diag_i[n]; - HYPRE_Int nnz_U = U_diag_i[n]; - HYPRE_Int nnz_LDU = n + nnz_L + nnz_U; + MPI_Comm comm = hypre_ParCSRMatrixComm(L); + hypre_CSRMatrix *L_diag = hypre_ParCSRMatrixDiag(L); + hypre_CSRMatrix *U_diag = hypre_ParCSRMatrixDiag(U); + HYPRE_Int *L_diag_i = hypre_CSRMatrixI(L_diag); + HYPRE_Int *L_diag_j = hypre_CSRMatrixJ(L_diag); + HYPRE_Real *L_diag_a = hypre_CSRMatrixData(L_diag); + HYPRE_Int *U_diag_i = hypre_CSRMatrixI(U_diag); + HYPRE_Int *U_diag_j = hypre_CSRMatrixJ(U_diag); + HYPRE_Real *U_diag_a = hypre_CSRMatrixData(U_diag); + HYPRE_Int n = hypre_ParCSRMatrixNumRows(L); + HYPRE_Int nnz_L = L_diag_i[n]; + HYPRE_Int nnz_U = U_diag_i[n]; + HYPRE_Int nnz_LDU = n + nnz_L + nnz_U; hypre_ParCSRMatrix *LDU; hypre_CSRMatrix *LDU_diag; HYPRE_Int *LDU_diag_i; HYPRE_Int *LDU_diag_j; - HYPRE_Real *LDU_diag_data; - - /* MPI */ - MPI_Comm comm = hypre_ParCSRMatrixComm(L); - HYPRE_Int num_procs, my_id; - - hypre_MPI_Comm_size(comm,&num_procs); - hypre_MPI_Comm_rank(comm,&my_id); - - - /* cuda data slot */ - - /* create matrix */ - - LDU = hypre_ParCSRMatrixCreate( comm, - hypre_ParCSRMatrixGlobalNumRows(L), - hypre_ParCSRMatrixGlobalNumRows(L), - hypre_ParCSRMatrixRowStarts(L), - hypre_ParCSRMatrixColStarts(L), - 0, - nnz_LDU, - 0); - + HYPRE_Real *LDU_diag_a; + + HYPRE_Int i, j, pos; + + /* Create matrix */ + LDU = hypre_ParCSRMatrixCreate(comm, + hypre_ParCSRMatrixGlobalNumRows(L), + hypre_ParCSRMatrixGlobalNumRows(L), + hypre_ParCSRMatrixRowStarts(L), + hypre_ParCSRMatrixColStarts(L), + 0, + nnz_LDU, + 0); + hypre_ParCSRMatrixInitialize_v2(LDU, HYPRE_MEMORY_HOST); LDU_diag = hypre_ParCSRMatrixDiag(LDU); - LDU_diag_i = hypre_TAlloc(HYPRE_Int, n+1, HYPRE_MEMORY_DEVICE); - LDU_diag_j = hypre_TAlloc(HYPRE_Int, nnz_LDU, HYPRE_MEMORY_DEVICE); - LDU_diag_data = hypre_TAlloc(HYPRE_Real, nnz_LDU, HYPRE_MEMORY_DEVICE); + LDU_diag_i = hypre_CSRMatrixI(LDU_diag); + LDU_diag_j = hypre_CSRMatrixJ(LDU_diag); + LDU_diag_a = hypre_CSRMatrixData(LDU_diag); pos = 0; - - for (i = 1; i <= n; i++) + for (i = 0; i < n; i++) { - LDU_diag_i[i-1] = pos; - for (j = L_diag_i[i-1]; j < L_diag_i[i]; j++) + LDU_diag_i[i] = pos; + for (j = L_diag_i[i]; j < L_diag_i[i + 1]; j++) { - LDU_diag_j[pos] = L_diag_j[j]; - LDU_diag_data[pos++] = L_diag_data[j]; + LDU_diag_j[pos] = L_diag_j[j]; + LDU_diag_a[pos++] = L_diag_a[j]; } - LDU_diag_j[pos] = i-1; - LDU_diag_data[pos++] = 1.0/D[i-1]; - for (j = U_diag_i[i-1]; j < U_diag_i[i]; j++) + LDU_diag_j[pos] = i; + LDU_diag_a[pos++] = 1.0 / D[i]; + for (j = U_diag_i[i]; j < U_diag_i[i + 1]; j++) { - LDU_diag_j[pos] = U_diag_j[j]; - LDU_diag_data[pos++] = U_diag_data[j]; + LDU_diag_j[pos] = U_diag_j[j]; + LDU_diag_a[pos++] = U_diag_a[j]; } } LDU_diag_i[n] = pos; - hypre_CSRMatrixI(LDU_diag) = LDU_diag_i; - hypre_CSRMatrixJ(LDU_diag) = LDU_diag_j; - hypre_CSRMatrixData(LDU_diag) = LDU_diag_data; + /* Migrate to device (abstract memory space) */ + hypre_ParCSRMatrixMigrate(LDU, HYPRE_MEMORY_DEVICE); - /* now sort */ - hypre_CSRMatrixSortRow(LDU_diag); - hypre_ParCSRMatrixDiag(LDU) = LDU_diag; +#if defined(HYPRE_USING_GPU) + hypre_CSRMatrixSortRow(hypre_ParCSRMatrixDiag(LDU)); +#endif *LDUp = LDU; return hypre_error_flag; } -/* Apply the (modified) ILU factorization to the diagonal block of A only. +/*-------------------------------------------------------------------------- + * hypre_ILUSetupRAPMILU0 + * + * Apply the (modified) ILU factorization to the diagonal block of A only. + * * A: matrix * ALUp: pointer to the result, factorization stroed on the diagonal * modified: set to 0 to use classical ILU0 - */ + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUSetupRAPMILU0(hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **ALUp, HYPRE_Int modified) +hypre_ILUSetupRAPMILU0(hypre_ParCSRMatrix *A, + hypre_ParCSRMatrix **ALUp, + HYPRE_Int modified) { - HYPRE_Int n = hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(A)); + HYPRE_Int n = hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(A)); + /* Get necessary slots */ hypre_ParCSRMatrix *L, *U, *S, *ALU; HYPRE_Real *D; HYPRE_Int *u_end; - /* u_end is the end position of the upper triangular part (if we need E and F implicitly), not used here */ - hypre_ILUSetupMILU0( A, NULL, NULL, n, n, &L, &D, &U, &S, &u_end, modified); + /* u_end is the end position of the upper triangular part + (if we need E and F implicitly), not used here */ + hypre_ILUSetupMILU0(A, NULL, NULL, n, n, &L, &D, &U, &S, &u_end, modified); hypre_TFree(u_end, HYPRE_MEMORY_HOST); + /* TODO (VPM): Change this function's name */ hypre_ILUSetupLDUtoCusparse(L, D, U, &ALU); - if (L) - { - hypre_ParCSRMatrixDestroy(L); - } - if (D) - { - hypre_TFree(D, HYPRE_MEMORY_DEVICE); - } - if (U) - { - hypre_ParCSRMatrixDestroy(U); - } + /* Free memory */ + hypre_ParCSRMatrixDestroy(L); + hypre_TFree(D, hypre_ParCSRMatrixMemoryLocation(A)); + hypre_ParCSRMatrixDestroy(U); *ALUp = ALU; return hypre_error_flag; } -/* Modified ILU(0) with RAP like solve +/*-------------------------------------------------------------------------- + * hypre_ILUSetupRAPILU0Device + * + * Modified ILU(0) with RAP like solve * A = input matrix - * Not explicitly forming the matrix, the previous version was abondoned - */ + * + * TODO (VPM): Move this function to par_setup_device.c? + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUSetupRAPILU0Device(hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int n, HYPRE_Int nLU, - cusparseMatDescr_t matL_des, cusparseMatDescr_t matU_des, cusparseSolvePolicy_t ilu_solve_policy, - void **bufferp, csrsv2Info_t *matAL_infop, csrsv2Info_t *matAU_infop, - csrsv2Info_t *matBL_infop, csrsv2Info_t *matBU_infop, - csrsv2Info_t *matSL_infop, csrsv2Info_t *matSU_infop, - hypre_ParCSRMatrix **Apermptr, hypre_ParCSRMatrix **matSptr, hypre_CSRMatrix **ALUptr, hypre_CSRMatrix **BLUptr, hypre_CSRMatrix **CLUptr, - hypre_CSRMatrix **Eptr, hypre_CSRMatrix **Fptr, HYPRE_Int test_opt) +hypre_ILUSetupRAPILU0Device(hypre_ParCSRMatrix *A, + HYPRE_Int *perm, + HYPRE_Int n, + HYPRE_Int nLU, + hypre_ParCSRMatrix **Apermptr, + hypre_ParCSRMatrix **matSptr, + hypre_CSRMatrix **ALUptr, + hypre_CSRMatrix **BLUptr, + hypre_CSRMatrix **CLUptr, + hypre_CSRMatrix **Eptr, + hypre_CSRMatrix **Fptr, + HYPRE_Int test_opt) { - - /* params */ - MPI_Comm comm = hypre_ParCSRMatrixComm(A); - HYPRE_Int *rperm = NULL; - - csrsv2Info_t matAL_info = NULL; - csrsv2Info_t matAU_info = NULL; - csrsv2Info_t matBL_info = NULL; - csrsv2Info_t matBU_info = NULL; - csrsv2Info_t matSL_info = NULL; - csrsv2Info_t matSU_info = NULL; - - HYPRE_Int buffer_size = 0; - void *buffer = NULL; - - //hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); - HYPRE_Int m = n - nLU; - - //printf("Size of local Schur: %d\n",m); - + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + HYPRE_Int *rperm = NULL; + HYPRE_Int m = n - nLU; HYPRE_Int i; - - /* MPI */ HYPRE_Int num_procs, my_id; - hypre_MPI_Comm_size(comm,&num_procs); - hypre_MPI_Comm_rank(comm,&my_id); /* Matrix Structure */ hypre_ParCSRMatrix *Apq, *ALU, *ALUm, *S; hypre_CSRMatrix *Amd, *Ad, *SLU, *Apq_diag; - rperm = hypre_CTAlloc(HYPRE_Int, n, HYPRE_MEMORY_HOST); + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); + + rperm = hypre_CTAlloc(HYPRE_Int, n, HYPRE_MEMORY_HOST); - for(i = 0; i < n; i++) + for (i = 0; i < n; i++) { rperm[perm[i]] = i; } @@ -3300,200 +1900,216 @@ hypre_ILUSetupRAPILU0Device(hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int n, /* get modified and extract LU factorization */ Amd = hypre_ParCSRMatrixDiag(ALUm); - Ad = hypre_ParCSRMatrixDiag(ALU); - switch(test_opt) + Ad = hypre_ParCSRMatrixDiag(ALU); + switch (test_opt) { case 1: - { - /* RAP where we save E and F */ - Apq_diag = hypre_ParCSRMatrixDiag(Apq); - hypre_CSRMatrixSortRow(Apq_diag); - hypre_ParILUCusparseILUExtractEBFC(Apq_diag, nLU, &dB, &dS, Eptr, Fptr); - /* get modified ILU of B */ - hypre_ParILUCusparseILUExtractEBFC(Amd, nLU, BLUptr, &SLU, &dE, &dF); - hypre_CSRMatrixDestroy(dB); - hypre_CSRMatrixDestroy(dS); - hypre_CSRMatrixDestroy(dE); - hypre_CSRMatrixDestroy(dF); - } + { + /* RAP where we save E and F */ + Apq_diag = hypre_ParCSRMatrixDiag(Apq); +#if defined(HYPRE_USING_GPU) + hypre_CSRMatrixSortRow(Apq_diag); +#endif + hypre_ParILUExtractEBFC(Apq_diag, nLU, &dB, &dS, Eptr, Fptr); + + /* get modified ILU of B */ + hypre_ParILUExtractEBFC(Amd, nLU, BLUptr, &SLU, &dE, &dF); + hypre_CSRMatrixDestroy(dB); + hypre_CSRMatrixDestroy(dS); + hypre_CSRMatrixDestroy(dE); + hypre_CSRMatrixDestroy(dF); + break; + } + case 2: - { - /* C-EB^{-1}F where we save EU^{-1}, L^{-1}F as sparse matrices */ - Apq_diag = hypre_ParCSRMatrixDiag(Apq); - hypre_CSRMatrixSortRow(Apq_diag); - hypre_ParILUCusparseILUExtractEBFC(Apq_diag, nLU, &dB, CLUptr, &dE, &dF); - /* get modified ILU of B */ - hypre_ParILUCusparseILUExtractEBFC(Amd, nLU, BLUptr, &SLU, Eptr, Fptr); - hypre_CSRMatrixDestroy(dB); - hypre_CSRMatrixDestroy(dE); - hypre_CSRMatrixDestroy(dF); - } + { + /* C-EB^{-1}F where we save EU^{-1}, L^{-1}F as sparse matrices */ + Apq_diag = hypre_ParCSRMatrixDiag(Apq); +#if defined(HYPRE_USING_GPU) + hypre_CSRMatrixSortRow(Apq_diag); +#endif + hypre_ParILUExtractEBFC(Apq_diag, nLU, &dB, CLUptr, &dE, &dF); + + /* get modified ILU of B */ + hypre_ParILUExtractEBFC(Amd, nLU, BLUptr, &SLU, Eptr, Fptr); + hypre_CSRMatrixDestroy(dB); + hypre_CSRMatrixDestroy(dE); + hypre_CSRMatrixDestroy(dF); + break; + } + case 3: - { - /* C-EB^{-1}F where we save E and F */ - Apq_diag = hypre_ParCSRMatrixDiag(Apq); - hypre_CSRMatrixSortRow(Apq_diag); - hypre_ParILUCusparseILUExtractEBFC(Apq_diag, nLU, &dB, CLUptr, Eptr, Fptr); - /* get modified ILU of B */ - hypre_ParILUCusparseILUExtractEBFC(Amd, nLU, BLUptr, &SLU, &dE, &dF); - hypre_CSRMatrixDestroy(dB); - hypre_CSRMatrixDestroy(dE); - hypre_CSRMatrixDestroy(dF); - } + { + /* C-EB^{-1}F where we save E and F */ + Apq_diag = hypre_ParCSRMatrixDiag(Apq); +#if defined(HYPRE_USING_GPU) + hypre_CSRMatrixSortRow(Apq_diag); +#endif + hypre_ParILUExtractEBFC(Apq_diag, nLU, &dB, CLUptr, Eptr, Fptr); + + /* get modified ILU of B */ + hypre_ParILUExtractEBFC(Amd, nLU, BLUptr, &SLU, &dE, &dF); + hypre_CSRMatrixDestroy(dB); + hypre_CSRMatrixDestroy(dE); + hypre_CSRMatrixDestroy(dF); + break; + } + case 4: - { - /* RAP where we save EU^{-1}, L^{-1}F as sparse matrices */ - hypre_ParILUCusparseILUExtractEBFC(Ad, nLU, BLUptr, &SLU, Eptr, Fptr); - } + { + /* RAP where we save EU^{-1}, L^{-1}F as sparse matrices */ + hypre_ParILUExtractEBFC(Ad, nLU, BLUptr, &SLU, Eptr, Fptr); + break; - case 0: default: - { - /* RAP where we save EU^{-1}, L^{-1}F as sparse matrices */ - hypre_ParILUCusparseILUExtractEBFC(Amd, nLU, BLUptr, &SLU, Eptr, Fptr); - } + } + + case 0: + default: + { + /* RAP where we save EU^{-1}, L^{-1}F as sparse matrices */ + hypre_ParILUExtractEBFC(Amd, nLU, BLUptr, &SLU, Eptr, Fptr); + break; + } } *ALUptr = hypre_ParCSRMatrixDiag(ALU); - /* Analysis of BILU */ - HYPRE_ILUSetupCusparseCSRILU0SetupSolve(*ALUptr, matL_des, matU_des, - ilu_solve_policy, &matAL_info, &matAU_info, - &buffer_size, &buffer); - - /* Analysis of BILU */ - HYPRE_ILUSetupCusparseCSRILU0SetupSolve(*BLUptr, matL_des, matU_des, - ilu_solve_policy, &matBL_info, &matBU_info, - &buffer_size, &buffer); - /* Analysis of SILU */ - HYPRE_ILUSetupCusparseCSRILU0SetupSolve(SLU, matL_des, matU_des, - ilu_solve_policy, &matSL_info, &matSU_info, - &buffer_size, &buffer); + hypre_ParCSRMatrixDiag(ALU) = NULL; /* not a good practice to manipulate parcsr's csr */ + hypre_ParCSRMatrixDestroy(ALU); + hypre_ParCSRMatrixDestroy(ALUm); /* start forming parCSR matrix S */ - HYPRE_BigInt S_total_rows, *S_row_starts; + HYPRE_BigInt S_total_rows, S_row_starts[2]; HYPRE_BigInt big_m = (HYPRE_BigInt)m; - hypre_MPI_Allreduce( &big_m, &S_total_rows, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); + hypre_MPI_Allreduce(&big_m, &S_total_rows, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); - if (S_total_rows>0) + if (S_total_rows > 0) { { HYPRE_BigInt global_start; - S_row_starts = hypre_CTAlloc(HYPRE_BigInt,2,HYPRE_MEMORY_HOST); - hypre_MPI_Scan( &big_m, &global_start, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); - S_row_starts[0] = global_start - m; + hypre_MPI_Scan(&big_m, &global_start, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); + S_row_starts[0] = global_start - big_m; S_row_starts[1] = global_start; } - S_row_starts = hypre_CTAlloc(HYPRE_BigInt, 2, HYPRE_MEMORY_HOST); - S_row_starts[1] = S_total_rows; - S_row_starts[0] = S_total_rows - m; - hypre_MPI_Allreduce(&m, &S_total_rows, 1, HYPRE_MPI_INT, hypre_MPI_SUM, comm); S = hypre_ParCSRMatrixCreate( hypre_ParCSRMatrixComm(A), - S_total_rows, - S_total_rows, - S_row_starts, - S_row_starts, - 0, - 0, - 0); - - /* memroy leak here */ - hypre_ParCSRMatrixDiag(S) = SLU; + S_total_rows, + S_total_rows, + S_row_starts, + S_row_starts, + 0, + 0, + 0); - /* free memory */ - hypre_TFree(S_row_starts, HYPRE_MEMORY_HOST); + hypre_CSRMatrixDestroy(hypre_ParCSRMatrixDiag(S)); + hypre_ParCSRMatrixDiag(S) = SLU; + } + else + { + S = NULL; + hypre_CSRMatrixDestroy(SLU); } - *matSptr = S; - *Apermptr = Apq; - *bufferp = buffer; - *matAL_infop = matAL_info; - *matAU_infop = matAU_info; - *matBL_infop = matBL_info; - *matBU_infop = matBU_info; - *matSL_infop = matSL_info; - *matSU_infop = matSU_info; + *matSptr = S; + *Apermptr = Apq; + + hypre_TFree(rperm, HYPRE_MEMORY_HOST); return hypre_error_flag; } -#endif - -/* Modified ILU(0) with RAP like solve +/*-------------------------------------------------------------------------- + * hypre_ILUSetupRAPILU0 + * + * Modified ILU(0) with RAP like solve + * * A = input matrix * Not explicitly forming the matrix - */ + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUSetupRAPILU0(hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int n, HYPRE_Int nLU, - hypre_ParCSRMatrix **Lptr, HYPRE_Real **Dptr, hypre_ParCSRMatrix **Uptr, - hypre_ParCSRMatrix **mLptr, HYPRE_Real **mDptr, hypre_ParCSRMatrix **mUptr, HYPRE_Int **u_end) +hypre_ILUSetupRAPILU0(hypre_ParCSRMatrix *A, + HYPRE_Int *perm, + HYPRE_Int n, + HYPRE_Int nLU, + hypre_ParCSRMatrix **Lptr, + HYPRE_Real **Dptr, + hypre_ParCSRMatrix **Uptr, + hypre_ParCSRMatrix **mLptr, + HYPRE_Real **mDptr, + hypre_ParCSRMatrix **mUptr, + HYPRE_Int **u_end) { - HYPRE_Int i; hypre_ParCSRMatrix *S_temp = NULL; HYPRE_Int *u_temp = NULL; - /* standard ILU0 factorization */ + HYPRE_Int *u_end_array; + + hypre_CSRMatrix *L_diag, *U_diag; + HYPRE_Int *L_diag_i, *U_diag_i; + HYPRE_Int *L_diag_j, *U_diag_j; + HYPRE_Complex *L_diag_data, *U_diag_data; + + hypre_CSRMatrix *mL_diag, *mU_diag; + HYPRE_Int *mL_diag_i, *mU_diag_i; + HYPRE_Int *mL_diag_j, *mU_diag_j; + HYPRE_Complex *mL_diag_data, *mU_diag_data; + + HYPRE_Int i; + + /* Standard ILU0 factorization */ hypre_ILUSetupMILU0(A, perm, perm, n, n, Lptr, Dptr, Uptr, &S_temp, &u_temp, 0); - if (S_temp) - { - hypre_ParCSRMatrixDestroy(S_temp); - } - if (u_temp) - { - hypre_Free( u_temp, HYPRE_MEMORY_HOST); - } - /* modified ILU0 factorization */ - hypre_ILUSetupMILU0(A, perm, perm, n, n, mLptr, mDptr, mUptr, &S_temp, &u_temp, 1); - if (S_temp) - { - hypre_ParCSRMatrixDestroy(S_temp); - } - if (u_temp) - { - hypre_Free( u_temp, HYPRE_MEMORY_HOST); - } - /* pointer to the start location */ - HYPRE_Int *u_end_array; - u_end_array = hypre_TAlloc(HYPRE_Int, n, HYPRE_MEMORY_HOST); + /* Free memory */ + hypre_ParCSRMatrixDestroy(S_temp); + hypre_TFree(u_temp, HYPRE_MEMORY_HOST); - hypre_CSRMatrix *U_diag = hypre_ParCSRMatrixDiag(*Uptr); - HYPRE_Int *U_diag_i = hypre_CSRMatrixI(U_diag); - HYPRE_Int *U_diag_j = hypre_CSRMatrixJ(U_diag); - HYPRE_Real *U_diag_data = hypre_CSRMatrixData(U_diag); - hypre_CSRMatrix *mU_diag = hypre_ParCSRMatrixDiag(*mUptr); - HYPRE_Int *mU_diag_i = hypre_CSRMatrixI(mU_diag); - HYPRE_Int *mU_diag_j = hypre_CSRMatrixJ(mU_diag); - HYPRE_Real *mU_diag_data = hypre_CSRMatrixData(mU_diag); + /* Modified ILU0 factorization */ + hypre_ILUSetupMILU0(A, perm, perm, n, n, mLptr, mDptr, mUptr, &S_temp, &u_temp, 1); - // first sort the Upper part U + /* Free memory */ + hypre_ParCSRMatrixDestroy(S_temp); + hypre_TFree(u_temp, HYPRE_MEMORY_HOST); + + /* Pointer to the start location */ + u_end_array = hypre_TAlloc(HYPRE_Int, n, HYPRE_MEMORY_HOST); + U_diag = hypre_ParCSRMatrixDiag(*Uptr); + U_diag_i = hypre_CSRMatrixI(U_diag); + U_diag_j = hypre_CSRMatrixJ(U_diag); + U_diag_data = hypre_CSRMatrixData(U_diag); + mU_diag = hypre_ParCSRMatrixDiag(*mUptr); + mU_diag_i = hypre_CSRMatrixI(mU_diag); + mU_diag_j = hypre_CSRMatrixJ(mU_diag); + mU_diag_data = hypre_CSRMatrixData(mU_diag); + + /* first sort the Upper part U */ for (i = 0; i < nLU; i++) { - hypre_qsort1(U_diag_j,U_diag_data,U_diag_i[i],U_diag_i[i+1]-1); - hypre_qsort1(mU_diag_j,mU_diag_data,mU_diag_i[i],mU_diag_i[i+1]-1); - hypre_BinarySearch2(U_diag_j,nLU,U_diag_i[i],U_diag_i[i+1]-1,u_end_array + i); + hypre_qsort1(U_diag_j, U_diag_data, U_diag_i[i], U_diag_i[i + 1] - 1); + hypre_qsort1(mU_diag_j, mU_diag_data, mU_diag_i[i], mU_diag_i[i + 1] - 1); + hypre_BinarySearch2(U_diag_j, nLU, U_diag_i[i], U_diag_i[i + 1] - 1, u_end_array + i); } - hypre_CSRMatrix *L_diag = hypre_ParCSRMatrixDiag(*Lptr); - HYPRE_Int *L_diag_i = hypre_CSRMatrixI(L_diag); - HYPRE_Int *L_diag_j = hypre_CSRMatrixJ(L_diag); - HYPRE_Real *L_diag_data = hypre_CSRMatrixData(L_diag); - hypre_CSRMatrix *mL_diag = hypre_ParCSRMatrixDiag(*mLptr); - HYPRE_Int *mL_diag_i = hypre_CSRMatrixI(mL_diag); - HYPRE_Int *mL_diag_j = hypre_CSRMatrixJ(mL_diag); - HYPRE_Real *mL_diag_data = hypre_CSRMatrixData(mL_diag); + L_diag = hypre_ParCSRMatrixDiag(*Lptr); + L_diag_i = hypre_CSRMatrixI(L_diag); + L_diag_j = hypre_CSRMatrixJ(L_diag); + L_diag_data = hypre_CSRMatrixData(L_diag); + mL_diag = hypre_ParCSRMatrixDiag(*mLptr); + mL_diag_i = hypre_CSRMatrixI(mL_diag); + mL_diag_j = hypre_CSRMatrixJ(mL_diag); + mL_diag_data = hypre_CSRMatrixData(mL_diag); - // now sort the Lower part L + /* now sort the Lower part L */ for (i = nLU; i < n; i++) { - hypre_qsort1(L_diag_j,L_diag_data,L_diag_i[i],L_diag_i[i+1]-1); - hypre_qsort1(mL_diag_j,mL_diag_data,mL_diag_i[i],mL_diag_i[i+1]-1); - hypre_BinarySearch2(L_diag_j, nLU, L_diag_i[i], L_diag_i[i+1]-1, u_end_array + i); + hypre_qsort1(L_diag_j, L_diag_data, L_diag_i[i], L_diag_i[i + 1] - 1); + hypre_qsort1(mL_diag_j, mL_diag_data, mL_diag_i[i], mL_diag_i[i + 1] - 1); + hypre_BinarySearch2(L_diag_j, nLU, L_diag_i[i], L_diag_i[i + 1] - 1, u_end_array + i); } *u_end = u_end_array; @@ -3501,54 +2117,85 @@ hypre_ILUSetupRAPILU0(hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int n, HYPRE return hypre_error_flag; } -/* ILU(0) +/*-------------------------------------------------------------------------- + * hypre_ILUSetupILU0 + * + * Setup ILU(0) + * * A = input matrix - * perm = permutation array indicating ordering of rows. Perm could come from a - * CF_marker array or a reordering routine. When set to NULL, indentity permutation is used. - * qperm = permutation array indicating ordering of columns. When set to NULL, indentity permutation is used. + * perm = permutation array indicating ordering of rows. + * Perm could come from a CF_marker array or a reordering routine. + * When set to NULL, identity permutation is used. + * qperm = permutation array indicating ordering of columns. + * When set to NULL, identity permutation is used. * nI = number of interial unknowns * nLU = size of incomplete factorization, nLU should obey nLU <= nI. - * Schur complement is formed if nLU < n + * Schur complement is formed if nLU < n * Lptr, Dptr, Uptr, Sptr = L, D, U, S factors. * will form global Schur Matrix if nLU < n - */ + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUSetupILU0(hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int *qperm, HYPRE_Int nLU, HYPRE_Int nI, - hypre_ParCSRMatrix **Lptr, HYPRE_Real** Dptr, hypre_ParCSRMatrix **Uptr, hypre_ParCSRMatrix **Sptr, HYPRE_Int **u_end) +hypre_ILUSetupILU0(hypre_ParCSRMatrix *A, + HYPRE_Int *perm, + HYPRE_Int *qperm, + HYPRE_Int nLU, + HYPRE_Int nI, + hypre_ParCSRMatrix **Lptr, + HYPRE_Real **Dptr, + hypre_ParCSRMatrix **Uptr, + hypre_ParCSRMatrix **Sptr, + HYPRE_Int **u_end) { - return hypre_ILUSetupMILU0( A, perm, qperm, nLU, nI, Lptr, Dptr, Uptr, Sptr, u_end, 0); + return hypre_ILUSetupMILU0(A, perm, qperm, nLU, nI, Lptr, Dptr, Uptr, Sptr, u_end, 0); } -/* (modified) ILU(0) +/*-------------------------------------------------------------------------- + * hypre_ILUSetupILU0 + * + * Setup modified ILU(0) + * * A = input matrix - * perm = permutation array indicating ordering of rows. Perm could come from a - * CF_marker array or a reordering routine. When set to NULL, indentity permutation is used. - * qperm = permutation array indicating ordering of columns When set to NULL, identity permutation is used. + * perm = permutation array indicating ordering of rows. + * Perm could come from a CF_marker array or a reordering routine. + * When set to NULL, indentity permutation is used. + * qperm = permutation array indicating ordering of columns. + * When set to NULL, identity permutation is used. * nI = number of interior unknowns * nLU = size of incomplete factorization, nLU should obey nLU <= nI. - * Schur complement is formed if nLU < n + * Schur complement is formed if nLU < n * Lptr, Dptr, Uptr, Sptr = L, D, U, S factors. * modified set to 0 to use classical ILU * will form global Schur Matrix if nLU < n - */ + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUSetupMILU0(hypre_ParCSRMatrix *A, HYPRE_Int *permp, HYPRE_Int *qpermp, HYPRE_Int nLU, HYPRE_Int nI, - hypre_ParCSRMatrix **Lptr, HYPRE_Real** Dptr, hypre_ParCSRMatrix **Uptr, hypre_ParCSRMatrix **Sptr, HYPRE_Int **u_end, - HYPRE_Int modified) +hypre_ILUSetupMILU0(hypre_ParCSRMatrix *A, + HYPRE_Int *permp, + HYPRE_Int *qpermp, + HYPRE_Int nLU, + HYPRE_Int nI, + hypre_ParCSRMatrix **Lptr, + HYPRE_Real **Dptr, + hypre_ParCSRMatrix **Uptr, + hypre_ParCSRMatrix **Sptr, + HYPRE_Int **u_end, + HYPRE_Int modified) { - HYPRE_Int i, ii, j, k, k1, k2, k3, ctrU, ctrL, ctrS, lenl, lenu, jpiv, col, jpos; + HYPRE_Int i, ii, j, k, k1, k2, k3, ctrU, ctrL, ctrS; + HYPRE_Int lenl, lenu, jpiv, col, jpos; HYPRE_Int *iw, *iL, *iU; HYPRE_Real dd, t, dpiv, lxu, *wU, *wL; HYPRE_Real drop; /* communication stuffs for S */ - MPI_Comm comm = hypre_ParCSRMatrixComm(A); - HYPRE_Int S_offd_nnz, S_offd_ncols; + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + HYPRE_Int S_offd_nnz, S_offd_ncols; hypre_ParCSRCommPkg *comm_pkg; hypre_ParCSRCommHandle *comm_handle; - HYPRE_Int num_sends, begin, end; - HYPRE_BigInt *send_buf = NULL; - HYPRE_Int num_procs, my_id; + HYPRE_Int num_sends, begin, end; + HYPRE_BigInt *send_buf = NULL; + HYPRE_Int num_procs, my_id; /* data objects for A */ hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); @@ -3559,6 +2206,7 @@ hypre_ILUSetupMILU0(hypre_ParCSRMatrix *A, HYPRE_Int *permp, HYPRE_Int *qpermp, HYPRE_Real *A_offd_data = hypre_CSRMatrixData(A_offd); HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); + HYPRE_MemoryLocation memory_location = hypre_ParCSRMatrixMemoryLocation(A); /* size of problem and schur system */ HYPRE_Int n = hypre_CSRMatrixNumRows(A_diag); @@ -3609,9 +2257,10 @@ hypre_ILUSetupMILU0(hypre_ParCSRMatrix *A, HYPRE_Int *permp, HYPRE_Int *qpermp, /* start setup * get communication stuffs first */ - hypre_MPI_Comm_size(comm,&num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); comm_pkg = hypre_ParCSRMatrixCommPkg(A); + /* setup if not yet built */ if (!comm_pkg) { @@ -3622,11 +2271,11 @@ hypre_ILUSetupMILU0(hypre_ParCSRMatrix *A, HYPRE_Int *permp, HYPRE_Int *qpermp, /* check for correctness */ if (nLU < 0 || nLU > n) { - hypre_error_w_msg(HYPRE_ERROR_ARG,"WARNING: nLU out of range.\n"); + hypre_error_w_msg(HYPRE_ERROR_ARG, "WARNING: nLU out of range.\n"); } if (e < 0) { - hypre_error_w_msg(HYPRE_ERROR_ARG,"WARNING: nLU should not exceed nI.\n"); + hypre_error_w_msg(HYPRE_ERROR_ARG, "WARNING: nLU should not exceed nI.\n"); } /* Allocate memory for u_end array */ @@ -3635,27 +2284,27 @@ hypre_ILUSetupMILU0(hypre_ParCSRMatrix *A, HYPRE_Int *permp, HYPRE_Int *qpermp, /* Allocate memory for L,D,U,S factors */ if (n > 0) { - initial_alloc = nLU + ceil((nnz_A / 2.0)*nLU/n); - capacity_S = m + ceil((nnz_A / 2.0)*m/n); + initial_alloc = (HYPRE_Int)(nLU + hypre_ceil((nnz_A / 2.0) * nLU / n)); + capacity_S = (HYPRE_Int)(m + hypre_ceil((nnz_A / 2.0) * m / n)); } capacity_L = initial_alloc; capacity_U = initial_alloc; - D_data = hypre_TAlloc(HYPRE_Real, n, HYPRE_MEMORY_DEVICE); - L_diag_i = hypre_TAlloc(HYPRE_Int, n+1, HYPRE_MEMORY_DEVICE); - L_diag_j = hypre_TAlloc(HYPRE_Int, capacity_L, HYPRE_MEMORY_DEVICE); - L_diag_data = hypre_TAlloc(HYPRE_Real, capacity_L, HYPRE_MEMORY_DEVICE); - U_diag_i = hypre_TAlloc(HYPRE_Int, n+1, HYPRE_MEMORY_DEVICE); - U_diag_j = hypre_TAlloc(HYPRE_Int, capacity_U, HYPRE_MEMORY_DEVICE); - U_diag_data = hypre_TAlloc(HYPRE_Real, capacity_U, HYPRE_MEMORY_DEVICE); - S_diag_i = hypre_TAlloc(HYPRE_Int, m+1, HYPRE_MEMORY_DEVICE); - S_diag_j = hypre_TAlloc(HYPRE_Int, capacity_S, HYPRE_MEMORY_DEVICE); - S_diag_data = hypre_TAlloc(HYPRE_Real, capacity_S, HYPRE_MEMORY_DEVICE); + D_data = hypre_TAlloc(HYPRE_Real, n, memory_location); + L_diag_i = hypre_TAlloc(HYPRE_Int, n + 1, memory_location); + L_diag_j = hypre_TAlloc(HYPRE_Int, capacity_L, memory_location); + L_diag_data = hypre_TAlloc(HYPRE_Real, capacity_L, memory_location); + U_diag_i = hypre_TAlloc(HYPRE_Int, n + 1, memory_location); + U_diag_j = hypre_TAlloc(HYPRE_Int, capacity_U, memory_location); + U_diag_data = hypre_TAlloc(HYPRE_Real, capacity_U, memory_location); + S_diag_i = hypre_TAlloc(HYPRE_Int, m + 1, memory_location); + S_diag_j = hypre_TAlloc(HYPRE_Int, capacity_S, memory_location); + S_diag_data = hypre_TAlloc(HYPRE_Real, capacity_S, memory_location); /* allocate working arrays */ - iw = hypre_TAlloc(HYPRE_Int, 3*n, HYPRE_MEMORY_HOST); - iL = iw+n; - rperm = iw + 2*n; + iw = hypre_TAlloc(HYPRE_Int, 3 * n, HYPRE_MEMORY_HOST); + iL = iw + n; + rperm = iw + 2 * n; wL = hypre_TAlloc(HYPRE_Real, n, HYPRE_MEMORY_HOST); ctrU = ctrL = ctrS = 0; @@ -3674,7 +2323,7 @@ hypre_ILUSetupMILU0(hypre_ParCSRMatrix *A, HYPRE_Int *permp, HYPRE_Int *qpermp, if (!permp) { - perm = hypre_TAlloc(HYPRE_Int, n, HYPRE_MEMORY_DEVICE); + perm = hypre_TAlloc(HYPRE_Int, n, memory_location); for (i = 0; i < n; i++) { perm[i] = i; @@ -3687,7 +2336,7 @@ hypre_ILUSetupMILU0(hypre_ParCSRMatrix *A, HYPRE_Int *permp, HYPRE_Int *qpermp, if (!qpermp) { - qperm = hypre_TAlloc(HYPRE_Int, n, HYPRE_MEMORY_DEVICE); + qperm = hypre_TAlloc(HYPRE_Int, n, memory_location); for (i = 0; i < n; i++) { qperm[i] = i; @@ -3709,14 +2358,14 @@ hypre_ILUSetupMILU0(hypre_ParCSRMatrix *A, HYPRE_Int *permp, HYPRE_Int *qpermp, // get row i i = perm[ii]; // get extents of row i - k1=A_diag_i[i]; - k2=A_diag_i[i+1]; + k1 = A_diag_i[i]; + k2 = A_diag_i[i + 1]; // track the drop drop = 0.0; /*-------------------- unpack L & U-parts of row of A in arrays w */ - iU = iL+ii; - wU = wL+ii; + iU = iL + ii; + wU = wL + ii; /*-------------------- diagonal entry */ dd = 0.0; lenl = lenu = 0; @@ -3740,7 +2389,7 @@ hypre_ILUSetupMILU0(hypre_ParCSRMatrix *A, HYPRE_Int *permp, HYPRE_Int *qpermp, } else { - dd=t; + dd = t; } } @@ -3752,7 +2401,7 @@ hypre_ILUSetupMILU0(hypre_ParCSRMatrix *A, HYPRE_Int *permp, HYPRE_Int *qpermp, * entering the elimination loop. *-----------------------------------------------------------------------*/ // hypre_quickSortIR(iL, wL, iw, 0, (lenl-1)); - hypre_qsort3ir(iL, wL, iw, 0, (lenl-1)); + hypre_qsort3ir(iL, wL, iw, 0, (lenl - 1)); for (j = 0; j < lenl; j++) { jpiv = iL[j]; @@ -3764,7 +2413,7 @@ hypre_ILUSetupMILU0(hypre_ParCSRMatrix *A, HYPRE_Int *permp, HYPRE_Int *qpermp, /* zero out element - reset pivot */ iw[jpiv] = -1; /* combine current row and pivot row */ - for (k = U_diag_i[jpiv]; k < U_diag_i[jpiv+1]; k++) + for (k = U_diag_i[jpiv]; k < U_diag_i[jpiv + 1]; k++) { col = U_diag_j[k]; jpos = iw[col]; @@ -3812,54 +2461,54 @@ hypre_ILUSetupMILU0(hypre_ParCSRMatrix *A, HYPRE_Int *permp, HYPRE_Int *qpermp, /* Check that memory is sufficient */ if (lenl > 0) { - while ((ctrL+lenl) > capacity_L) + while ((ctrL + lenl) > capacity_L) { HYPRE_Int tmp = capacity_L; - capacity_L = capacity_L * EXPAND_FACT + 1; - L_diag_j = hypre_TReAlloc_v2(L_diag_j, HYPRE_Int, tmp, HYPRE_Int, capacity_L, HYPRE_MEMORY_DEVICE); - L_diag_data = hypre_TReAlloc_v2(L_diag_data, HYPRE_Real, tmp, HYPRE_Real, capacity_L, HYPRE_MEMORY_DEVICE); + capacity_L = (HYPRE_Int)(capacity_L * EXPAND_FACT + 1); + L_diag_j = hypre_TReAlloc_v2(L_diag_j, HYPRE_Int, tmp, HYPRE_Int, + capacity_L, memory_location); + L_diag_data = hypre_TReAlloc_v2(L_diag_data, HYPRE_Real, tmp, HYPRE_Real, + capacity_L, memory_location); } - //hypre_TMemcpy(&(L_diag_j)[ctrL], iL, HYPRE_Int, lenl, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - //hypre_TMemcpy(&(L_diag_data)[ctrL], wL, HYPRE_Real, lenl, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); hypre_TMemcpy(&L_diag_j[ctrL], iL, HYPRE_Int, lenl, - HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + memory_location, HYPRE_MEMORY_HOST); hypre_TMemcpy(&L_diag_data[ctrL], wL, HYPRE_Real, lenl, - HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + memory_location, HYPRE_MEMORY_HOST); } - L_diag_i[ii+1] = (ctrL+=lenl); + L_diag_i[ii + 1] = (ctrL += lenl); /* diagonal part (we store the inverse) */ - if (fabs(dd) < MAT_TOL) + if (hypre_abs(dd) < MAT_TOL) { dd = 1.0e-6; } - D_data[ii] = 1./dd; + D_data[ii] = 1. / dd; /* U part */ /* Check that memory is sufficient */ if (lenu > 0) { - while ((ctrU+lenu) > capacity_U) + while ((ctrU + lenu) > capacity_U) { HYPRE_Int tmp = capacity_U; - capacity_U = capacity_U * EXPAND_FACT + 1; - U_diag_j = hypre_TReAlloc_v2(U_diag_j, HYPRE_Int, tmp, HYPRE_Int, capacity_U, HYPRE_MEMORY_DEVICE); - U_diag_data = hypre_TReAlloc_v2(U_diag_data, HYPRE_Real, tmp, HYPRE_Real, capacity_U, HYPRE_MEMORY_DEVICE); + capacity_U = (HYPRE_Int)(capacity_U * EXPAND_FACT + 1); + U_diag_j = hypre_TReAlloc_v2(U_diag_j, HYPRE_Int, tmp, HYPRE_Int, + capacity_U, memory_location); + U_diag_data = hypre_TReAlloc_v2(U_diag_data, HYPRE_Real, tmp, HYPRE_Real, + capacity_U, memory_location); } - //hypre_TMemcpy(&(U_diag_j)[ctrU], iU, HYPRE_Int, lenu, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - //hypre_TMemcpy(&(U_diag_data)[ctrU], wU, HYPRE_Real, lenu, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); hypre_TMemcpy(&U_diag_j[ctrU], iU, HYPRE_Int, lenu, - HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + memory_location, HYPRE_MEMORY_HOST); hypre_TMemcpy(&U_diag_data[ctrU], wU, HYPRE_Real, lenu, - HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + memory_location, HYPRE_MEMORY_HOST); } - U_diag_i[ii+1] = (ctrU+=lenu); + U_diag_i[ii + 1] = (ctrU += lenu); /* check and build u_end array */ if (m > 0) { - hypre_qsort1(U_diag_j,U_diag_data,U_diag_i[ii],U_diag_i[ii+1]-1); - hypre_BinarySearch2(U_diag_j,nLU,U_diag_i[ii],U_diag_i[ii+1]-1,u_end_array + ii); + hypre_qsort1(U_diag_j, U_diag_data, U_diag_i[ii], U_diag_i[ii + 1] - 1); + hypre_BinarySearch2(U_diag_j, nLU, U_diag_i[ii], U_diag_i[ii + 1] - 1, u_end_array + ii); } else { @@ -3875,13 +2524,13 @@ hypre_ILUSetupMILU0(hypre_ParCSRMatrix *A, HYPRE_Int *permp, HYPRE_Int *qpermp, // get row i i = perm[ii]; // get extents of row i - k1=A_diag_i[i]; - k2=A_diag_i[i+1]; + k1 = A_diag_i[i]; + k2 = A_diag_i[i + 1]; drop = 0.0; /*-------------------- unpack L & U-parts of row of A in arrays w */ - iU = iL+nLU + 1; - wU = wL+nLU + 1; + iU = iL + nLU + 1; + wU = wL + nLU + 1; /*-------------------- diagonal entry */ dd = 0.0; lenl = lenu = 0; @@ -3905,7 +2554,7 @@ hypre_ILUSetupMILU0(hypre_ParCSRMatrix *A, HYPRE_Int *permp, HYPRE_Int *qpermp, } else { - dd=t; + dd = t; } } @@ -3917,7 +2566,7 @@ hypre_ILUSetupMILU0(hypre_ParCSRMatrix *A, HYPRE_Int *permp, HYPRE_Int *qpermp, * entering the elimination loop. *-----------------------------------------------------------------------*/ // hypre_quickSortIR(iL, wL, iw, 0, (lenl-1)); - hypre_qsort3ir(iL, wL, iw, 0, (lenl-1)); + hypre_qsort3ir(iL, wL, iw, 0, (lenl - 1)); for (j = 0; j < lenl; j++) { jpiv = iL[j]; @@ -3929,7 +2578,7 @@ hypre_ILUSetupMILU0(hypre_ParCSRMatrix *A, HYPRE_Int *permp, HYPRE_Int *qpermp, /* zero out element - reset pivot */ iw[jpiv] = -1; /* combine current row and pivot row */ - for (k = U_diag_i[jpiv]; k < U_diag_i[jpiv+1]; k++) + for (k = U_diag_i[jpiv]; k < U_diag_i[jpiv + 1]; k++) { col = U_diag_j[k]; jpos = iw[col]; @@ -3975,48 +2624,50 @@ hypre_ILUSetupMILU0(hypre_ParCSRMatrix *A, HYPRE_Int *permp, HYPRE_Int *qpermp, /* Check that memory is sufficient */ if (lenl > 0) { - while ((ctrL+lenl) > capacity_L) + while ((ctrL + lenl) > capacity_L) { HYPRE_Int tmp = capacity_L; - capacity_L = capacity_L * EXPAND_FACT + 1; - L_diag_j = hypre_TReAlloc_v2(L_diag_j, HYPRE_Int, tmp, HYPRE_Int, capacity_L, HYPRE_MEMORY_DEVICE); - L_diag_data = hypre_TReAlloc_v2(L_diag_data, HYPRE_Real, tmp, HYPRE_Real, capacity_L, HYPRE_MEMORY_DEVICE); + capacity_L = (HYPRE_Int)(capacity_L * EXPAND_FACT + 1); + L_diag_j = hypre_TReAlloc_v2(L_diag_j, HYPRE_Int, tmp, HYPRE_Int, + capacity_L, memory_location); + L_diag_data = hypre_TReAlloc_v2(L_diag_data, HYPRE_Real, tmp, HYPRE_Real, + capacity_L, memory_location); } - //hypre_TMemcpy(&(L_diag_j)[ctrL], iL, HYPRE_Int, lenl, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - //hypre_TMemcpy(&(L_diag_data)[ctrL], wL, HYPRE_Real, lenl, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); hypre_TMemcpy(&L_diag_j[ctrL], iL, HYPRE_Int, lenl, - HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + memory_location, HYPRE_MEMORY_HOST); hypre_TMemcpy(&L_diag_data[ctrL], wL, HYPRE_Real, lenl, - HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + memory_location, HYPRE_MEMORY_HOST); } - L_diag_i[ii+1] = (ctrL+=lenl); + L_diag_i[ii + 1] = (ctrL += lenl); /* S part */ /* Check that memory is sufficient */ - while ((ctrS+lenu+1) > capacity_S) + while ((ctrS + lenu + 1) > capacity_S) { HYPRE_Int tmp = capacity_S; - capacity_S = capacity_S * EXPAND_FACT + 1; - S_diag_j = hypre_TReAlloc_v2(S_diag_j, HYPRE_Int, tmp, HYPRE_Int, capacity_S, HYPRE_MEMORY_DEVICE); - S_diag_data = hypre_TReAlloc_v2(S_diag_data, HYPRE_Real, tmp, HYPRE_Real, capacity_S, HYPRE_MEMORY_DEVICE); + capacity_S = (HYPRE_Int)(capacity_S * EXPAND_FACT + 1); + S_diag_j = hypre_TReAlloc_v2(S_diag_j, HYPRE_Int, tmp, HYPRE_Int, + capacity_S, memory_location); + S_diag_data = hypre_TReAlloc_v2(S_diag_data, HYPRE_Real, tmp, HYPRE_Real, + capacity_S, memory_location); } /* remember S in under a new index system! */ S_diag_j[ctrS] = ii - nLU; S_diag_data[ctrS] = dd; for (j = 0; j < lenu; j++) { - S_diag_j[ctrS+1+j] = iU[j] - nLU; + S_diag_j[ctrS + 1 + j] = iU[j] - nLU; } - //hypre_TMemcpy(S_diag_data+ctrS+1, wU, HYPRE_Real, lenu, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - hypre_TMemcpy(S_diag_data+ctrS+1, wU, HYPRE_Real, lenu, - HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); - S_diag_i[ii-nLU+1] = ctrS+=(lenu+1); + //hypre_TMemcpy(S_diag_data+ctrS+1, wU, HYPRE_Real, lenu, memory_location, HYPRE_MEMORY_HOST); + hypre_TMemcpy(S_diag_data + ctrS + 1, wU, HYPRE_Real, lenu, + memory_location, HYPRE_MEMORY_HOST); + S_diag_i[ii - nLU + 1] = ctrS += (lenu + 1); } /* Assemble LDUS matrices */ /* zero out unfactored rows for U and D */ for (k = nLU; k < n; k++) { - U_diag_i[k+1] = ctrU; + U_diag_i[k + 1] = ctrU; D_data[k] = 1.; } @@ -4025,14 +2676,15 @@ hypre_ILUSetupMILU0(hypre_ParCSRMatrix *A, HYPRE_Int *permp, HYPRE_Int *qpermp, */ HYPRE_BigInt big_m = (HYPRE_BigInt)m; hypre_MPI_Allreduce(&big_m, &total_rows, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); + /* only form when total_rows > 0 */ - if ( total_rows > 0 ) + if (total_rows > 0) { /* now create S */ /* need to get new column start */ { HYPRE_BigInt global_start; - hypre_MPI_Scan( &big_m, &global_start, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); + hypre_MPI_Scan(&big_m, &global_start, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); col_starts[0] = global_start - m; col_starts[1] = global_start; } @@ -4045,13 +2697,13 @@ hypre_ILUSetupMILU0(hypre_ParCSRMatrix *A, HYPRE_Int *permp, HYPRE_Int *qpermp, S_offd_ncols = hypre_CSRMatrixNumCols(A_offd); matS = hypre_ParCSRMatrixCreate( comm, - total_rows, - total_rows, - col_starts, - col_starts, - S_offd_ncols, - ctrS, - S_offd_nnz); + total_rows, + total_rows, + col_starts, + col_starts, + S_offd_ncols, + ctrS, + S_offd_nnz); /* first put diagonal data in */ S_diag = hypre_ParCSRMatrixDiag(matS); @@ -4062,9 +2714,9 @@ hypre_ILUSetupMILU0(hypre_ParCSRMatrix *A, HYPRE_Int *permp, HYPRE_Int *qpermp, /* now start to construct offdiag of S */ S_offd = hypre_ParCSRMatrixOffd(matS); - S_offd_i = hypre_TAlloc(HYPRE_Int, m+1, HYPRE_MEMORY_DEVICE); - S_offd_j = hypre_TAlloc(HYPRE_Int, S_offd_nnz, HYPRE_MEMORY_DEVICE); - S_offd_data = hypre_TAlloc(HYPRE_Real, S_offd_nnz, HYPRE_MEMORY_DEVICE); + S_offd_i = hypre_TAlloc(HYPRE_Int, m + 1, memory_location); + S_offd_j = hypre_TAlloc(HYPRE_Int, S_offd_nnz, memory_location); + S_offd_data = hypre_TAlloc(HYPRE_Real, S_offd_nnz, memory_location); S_offd_colmap = hypre_CTAlloc(HYPRE_BigInt, S_offd_ncols, HYPRE_MEMORY_HOST); /* simply use a loop to copy data from A_offd */ @@ -4078,13 +2730,13 @@ hypre_ILUSetupMILU0(hypre_ParCSRMatrix *A, HYPRE_Int *permp, HYPRE_Int *qpermp, { col = perm[i + nI]; k1 = A_offd_i[col]; - k2 = A_offd_i[col+1]; + k2 = A_offd_i[col + 1]; for (j = k1; j < k2; j++) { S_offd_j[k3] = A_offd_j[j]; S_offd_data[k3++] = A_offd_data[j]; } - S_offd_i[i+1+e] = k3; + S_offd_i[i + 1 + e] = k3; } /* give I, J, DATA to S_offd */ @@ -4096,13 +2748,14 @@ hypre_ILUSetupMILU0(hypre_ParCSRMatrix *A, HYPRE_Int *permp, HYPRE_Int *qpermp, /* get total num of send */ num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - begin = hypre_ParCSRCommPkgSendMapStart(comm_pkg,0); - end = hypre_ParCSRCommPkgSendMapStart(comm_pkg,num_sends); + begin = hypre_ParCSRCommPkgSendMapStart(comm_pkg, 0); + end = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends); send_buf = hypre_TAlloc(HYPRE_BigInt, end - begin, HYPRE_MEMORY_HOST); /* copy new index into send_buf */ for (i = begin; i < end; i++) { - send_buf[i-begin] = rperm[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,i)] - nLU + col_starts[0]; + send_buf[i - begin] = rperm[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, i)] - + nLU + col_starts[0]; } /* main communication */ comm_handle = hypre_ParCSRCommHandleCreate(21, comm_pkg, send_buf, S_offd_colmap); @@ -4120,13 +2773,13 @@ hypre_ILUSetupMILU0(hypre_ParCSRMatrix *A, HYPRE_Int *permp, HYPRE_Int *qpermp, /* create S finished */ matL = hypre_ParCSRMatrixCreate( comm, - hypre_ParCSRMatrixGlobalNumRows(A), - hypre_ParCSRMatrixGlobalNumRows(A), - hypre_ParCSRMatrixRowStarts(A), - hypre_ParCSRMatrixColStarts(A), - 0, - ctrL, - 0 ); + hypre_ParCSRMatrixGlobalNumRows(A), + hypre_ParCSRMatrixGlobalNumRows(A), + hypre_ParCSRMatrixRowStarts(A), + hypre_ParCSRMatrixColStarts(A), + 0, + ctrL, + 0 ); L_diag = hypre_ParCSRMatrixDiag(matL); hypre_CSRMatrixI(L_diag) = L_diag_i; @@ -4138,8 +2791,8 @@ hypre_ILUSetupMILU0(hypre_ParCSRMatrix *A, HYPRE_Int *permp, HYPRE_Int *qpermp, else { /* we've allocated some memory, so free if not used */ - hypre_TFree(L_diag_j,HYPRE_MEMORY_DEVICE); - hypre_TFree(L_diag_data,HYPRE_MEMORY_DEVICE); + hypre_TFree(L_diag_j, memory_location); + hypre_TFree(L_diag_data, memory_location); } /* store (global) total number of nonzeros */ local_nnz = (HYPRE_Real) ctrL; @@ -4147,13 +2800,13 @@ hypre_ILUSetupMILU0(hypre_ParCSRMatrix *A, HYPRE_Int *permp, HYPRE_Int *qpermp, hypre_ParCSRMatrixDNumNonzeros(matL) = total_nnz; matU = hypre_ParCSRMatrixCreate( comm, - hypre_ParCSRMatrixGlobalNumRows(A), - hypre_ParCSRMatrixGlobalNumRows(A), - hypre_ParCSRMatrixRowStarts(A), - hypre_ParCSRMatrixColStarts(A), - 0, - ctrU, - 0 ); + hypre_ParCSRMatrixGlobalNumRows(A), + hypre_ParCSRMatrixGlobalNumRows(A), + hypre_ParCSRMatrixRowStarts(A), + hypre_ParCSRMatrixColStarts(A), + 0, + ctrU, + 0 ); U_diag = hypre_ParCSRMatrixDiag(matU); hypre_CSRMatrixI(U_diag) = U_diag_i; @@ -4165,29 +2818,29 @@ hypre_ILUSetupMILU0(hypre_ParCSRMatrix *A, HYPRE_Int *permp, HYPRE_Int *qpermp, else { /* we've allocated some memory, so free if not used */ - hypre_TFree(U_diag_j,HYPRE_MEMORY_DEVICE); - hypre_TFree(U_diag_data,HYPRE_MEMORY_DEVICE); + hypre_TFree(U_diag_j, memory_location); + hypre_TFree(U_diag_data, memory_location); } /* store (global) total number of nonzeros */ local_nnz = (HYPRE_Real) ctrU; hypre_MPI_Allreduce(&local_nnz, &total_nnz, 1, HYPRE_MPI_REAL, hypre_MPI_SUM, comm); hypre_ParCSRMatrixDNumNonzeros(matU) = total_nnz; /* free memory */ - hypre_TFree(wL,HYPRE_MEMORY_HOST); - hypre_TFree(iw,HYPRE_MEMORY_HOST); + hypre_TFree(wL, HYPRE_MEMORY_HOST); + hypre_TFree(iw, HYPRE_MEMORY_HOST); if (!matS) { /* we allocate some memory for S, need to free if unused */ - hypre_TFree(S_diag_i,HYPRE_MEMORY_DEVICE); + hypre_TFree(S_diag_i, memory_location); } if (!permp) { - hypre_TFree(perm, HYPRE_MEMORY_DEVICE); + hypre_TFree(perm, memory_location); } if (!qpermp) { - hypre_TFree(qperm, HYPRE_MEMORY_DEVICE); + hypre_TFree(qperm, memory_location); } /* set matrix pointers */ @@ -4200,21 +2853,39 @@ hypre_ILUSetupMILU0(hypre_ParCSRMatrix *A, HYPRE_Int *permp, HYPRE_Int *qpermp, return hypre_error_flag; } -/* ILU(k) symbolic factorization +/*-------------------------------------------------------------------------- + * hypre_ILUSetupILUKSymbolic + * + * Setup ILU(k) symbolic factorization + * * n = total rows of input * lfil = level of fill-in, the k in ILU(k) - * perm = permutation array indicating ordering of factorization. Perm could come from a + * perm = permutation array indicating ordering of factorization. * rperm = reverse permutation array, used here to avoid duplicate memory allocation * iw = working array, used here to avoid duplicate memory allocation * nLU = size of computed LDU factorization. * A/L/U/S_diag_i = the I slot of A, L, U and S * A/L/U/S_diag_j = the J slot of A, L, U and S - * will form global Schur Matrix if nLU < n - */ + * + * Will form global Schur Matrix if nLU < n + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUSetupILUKSymbolic(HYPRE_Int n, HYPRE_Int *A_diag_i, HYPRE_Int *A_diag_j, HYPRE_Int lfil, HYPRE_Int *perm, - HYPRE_Int *rperm, HYPRE_Int *iw, HYPRE_Int nLU, HYPRE_Int *L_diag_i, HYPRE_Int *U_diag_i, - HYPRE_Int *S_diag_i, HYPRE_Int **L_diag_j, HYPRE_Int **U_diag_j, HYPRE_Int **S_diag_j, HYPRE_Int **u_end) +hypre_ILUSetupILUKSymbolic(HYPRE_Int n, + HYPRE_Int *A_diag_i, + HYPRE_Int *A_diag_j, + HYPRE_Int lfil, + HYPRE_Int *perm, + HYPRE_Int *rperm, + HYPRE_Int *iw, + HYPRE_Int nLU, + HYPRE_Int *L_diag_i, + HYPRE_Int *U_diag_i, + HYPRE_Int *S_diag_i, + HYPRE_Int **L_diag_j, + HYPRE_Int **U_diag_j, + HYPRE_Int **S_diag_j, + HYPRE_Int **u_end) { /* * 1: Setup and create buffers @@ -4240,31 +2911,35 @@ hypre_ILUSetupILUKSymbolic(HYPRE_Int n, HYPRE_Int *A_diag_i, HYPRE_Int *A_diag_j HYPRE_Int ctrS; HYPRE_Int capacity_L; HYPRE_Int capacity_U; - HYPRE_Int capacity_S; + HYPRE_Int capacity_S = 0; HYPRE_Int initial_alloc = 0; HYPRE_Int nnz_A; + HYPRE_MemoryLocation memory_location; + + /* Get default memory location */ + HYPRE_GetMemoryLocation(&memory_location); /* set iL and iLev to right place in iw array */ iL = iw + n; - iLev = iw + 2*n; + iLev = iw + 2 * n; /* setup initial memory used */ nnz_A = A_diag_i[n]; if (n > 0) { - initial_alloc = nLU + ceil((nnz_A / 2.0) * nLU / n); + initial_alloc = (HYPRE_Int)(nLU + hypre_ceil((nnz_A / 2.0) * nLU / n)); } capacity_L = initial_alloc; capacity_U = initial_alloc; /* allocate other memory for L and U struct */ - temp_L_diag_j = hypre_CTAlloc(HYPRE_Int, capacity_L, HYPRE_MEMORY_DEVICE); - temp_U_diag_j = hypre_CTAlloc(HYPRE_Int, capacity_U, HYPRE_MEMORY_DEVICE); + temp_L_diag_j = hypre_CTAlloc(HYPRE_Int, capacity_L, memory_location); + temp_U_diag_j = hypre_CTAlloc(HYPRE_Int, capacity_U, memory_location); if (m > 0) { - capacity_S = m + ceil(nnz_A / 2.0 * m / n); - temp_S_diag_j = hypre_CTAlloc(HYPRE_Int, capacity_S, HYPRE_MEMORY_DEVICE); + capacity_S = (HYPRE_Int)(m + hypre_ceil(nnz_A / 2.0 * m / n)); + temp_S_diag_j = hypre_CTAlloc(HYPRE_Int, capacity_S, memory_location); } u_end_array = hypre_TAlloc(HYPRE_Int, nLU, HYPRE_MEMORY_HOST); @@ -4287,7 +2962,7 @@ hypre_ILUSetupILUKSymbolic(HYPRE_Int n, HYPRE_Int *A_diag_i, HYPRE_Int *A_diag_j lenl = 0; lenh = 0;/* this is the current length of heap */ lenu = ii; - lena = A_diag_i[i+1]; + lena = A_diag_i[i + 1]; /* put those already inside original pattern, and set their level to 0 */ for (j = A_diag_i[i]; j < lena; j++) { @@ -4303,7 +2978,7 @@ hypre_ILUSetupILUKSymbolic(HYPRE_Int n, HYPRE_Int *A_diag_i, HYPRE_Int *A_diag_j iLev[lenh] = 0; iw[col] = lenh++; /*now miantian a heap structure*/ - hypre_ILUMinHeapAddIIIi(iL,iLev,iw,lenh); + hypre_ILUMinHeapAddIIIi(iL, iLev, iw, lenh); } else if (col > ii) { @@ -4328,18 +3003,18 @@ hypre_ILUSetupILUKSymbolic(HYPRE_Int n, HYPRE_Int *A_diag_i, HYPRE_Int *A_diag_j /* * we now need to maintain the heap structure */ - hypre_ILUMinHeapRemoveIIIi(iL,iLev,iw,lenh); + hypre_ILUMinHeapRemoveIIIi(iL, iLev, iw, lenh); lenh--; /* copy to the end of array */ lenl++; /* reset iw for that, not using anymore */ - iw[k]=-1; - hypre_swap2i(iL,iLev,ii-lenl,lenh); + iw[k] = -1; + hypre_swap2i(iL, iLev, ii - lenl, lenh); /* * now the elimination on current row could start. * eliminate row k (new index) from current row */ - ku = U_diag_i[k+1]; + ku = U_diag_i[k + 1]; for (j = U_diag_i[k]; j < ku; j++) { col = temp_U_diag_j[j]; @@ -4366,7 +3041,7 @@ hypre_ILUSetupILUKSymbolic(HYPRE_Int n, HYPRE_Int *A_diag_i, HYPRE_Int *A_diag_j /*swap it with the element right after the heap*/ /* maintain the heap */ - hypre_ILUMinHeapAddIIIi(iL,iLev,iw,lenh); + hypre_ILUMinHeapAddIIIi(iL, iLev, iw, lenh); } else if (col > ii) { @@ -4383,46 +3058,48 @@ hypre_ILUSetupILUKSymbolic(HYPRE_Int n, HYPRE_Int *A_diag_i, HYPRE_Int *A_diag_j }/* end of while loop for iith row */ /* now update everything, indices, levels and so */ - L_diag_i[ii+1] = L_diag_i[ii] + lenl; + L_diag_i[ii + 1] = L_diag_i[ii] + lenl; if (lenl > 0) { /* check if memory is enough */ while (ctrL + lenl > capacity_L) { HYPRE_Int tmp = capacity_L; - capacity_L = capacity_L * EXPAND_FACT + 1; - temp_L_diag_j = hypre_TReAlloc_v2(temp_L_diag_j, HYPRE_Int, tmp, HYPRE_Int, capacity_L, HYPRE_MEMORY_DEVICE); + capacity_L = (HYPRE_Int)(capacity_L * EXPAND_FACT + 1); + temp_L_diag_j = hypre_TReAlloc_v2(temp_L_diag_j, HYPRE_Int, tmp, HYPRE_Int, capacity_L, + memory_location); } /* now copy L data, reverse order */ for (j = 0; j < lenl; j++) { - temp_L_diag_j[ctrL+j] = iL[ii-j-1]; + temp_L_diag_j[ctrL + j] = iL[ii - j - 1]; } ctrL += lenl; } k = lenu - ii; - U_diag_i[ii+1] = U_diag_i[ii] + k; + U_diag_i[ii + 1] = U_diag_i[ii] + k; if (k > 0) { /* check if memory is enough */ while (ctrU + k > capacity_U) { HYPRE_Int tmp = capacity_U; - capacity_U = capacity_U * EXPAND_FACT + 1; - temp_U_diag_j = hypre_TReAlloc_v2(temp_U_diag_j, HYPRE_Int, tmp, HYPRE_Int, capacity_U, HYPRE_MEMORY_DEVICE); + capacity_U = (HYPRE_Int)(capacity_U * EXPAND_FACT + 1); + temp_U_diag_j = hypre_TReAlloc_v2(temp_U_diag_j, HYPRE_Int, tmp, HYPRE_Int, capacity_U, + memory_location); u_levels = hypre_TReAlloc_v2(u_levels, HYPRE_Int, tmp, HYPRE_Int, capacity_U, HYPRE_MEMORY_HOST); } - //hypre_TMemcpy(temp_U_diag_j+ctrU,iL+ii,HYPRE_Int,k,HYPRE_MEMORY_DEVICE,HYPRE_MEMORY_HOST); - hypre_TMemcpy(temp_U_diag_j+ctrU, iL+ii, HYPRE_Int, k, - HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); - hypre_TMemcpy(u_levels+ctrU, iLev+ii, HYPRE_Int, k, + //hypre_TMemcpy(temp_U_diag_j+ctrU,iL+ii,HYPRE_Int,k,memory_location,HYPRE_MEMORY_HOST); + hypre_TMemcpy(temp_U_diag_j + ctrU, iL + ii, HYPRE_Int, k, + memory_location, HYPRE_MEMORY_HOST); + hypre_TMemcpy(u_levels + ctrU, iLev + ii, HYPRE_Int, k, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); ctrU += k; } if (m > 0) { - hypre_qsort2i(temp_U_diag_j,u_levels,U_diag_i[ii],U_diag_i[ii+1]-1); - hypre_BinarySearch2(temp_U_diag_j,nLU,U_diag_i[ii],U_diag_i[ii+1]-1,u_end_array + ii); + hypre_qsort2i(temp_U_diag_j, u_levels, U_diag_i[ii], U_diag_i[ii + 1] - 1); + hypre_BinarySearch2(temp_U_diag_j, nLU, U_diag_i[ii], U_diag_i[ii + 1] - 1, u_end_array + ii); } else { @@ -4431,7 +3108,7 @@ hypre_ILUSetupILUKSymbolic(HYPRE_Int n, HYPRE_Int *A_diag_i, HYPRE_Int *A_diag_j } /* reset iw */ - for(j = ii; j < lenu; j++) + for (j = ii; j < lenu; j++) { iw[iL[j]] = -1; } @@ -4445,7 +3122,7 @@ hypre_ILUSetupILUKSymbolic(HYPRE_Int n, HYPRE_Int *A_diag_i, HYPRE_Int *A_diag_j lenl = 0; lenh = 0;/* this is the current length of heap */ lenu = nLU;/* now this stores S, start from nLU */ - lena = A_diag_i[i+1]; + lena = A_diag_i[i + 1]; /* put those already inside original pattern, and set their level to 0 */ for (j = A_diag_i[i]; j < lena; j++) { @@ -4461,7 +3138,7 @@ hypre_ILUSetupILUKSymbolic(HYPRE_Int n, HYPRE_Int *A_diag_i, HYPRE_Int *A_diag_j iLev[lenh] = 0; iw[col] = lenh++; /*now miantian a heap structure*/ - hypre_ILUMinHeapAddIIIi(iL,iLev,iw,lenh); + hypre_ILUMinHeapAddIIIi(iL, iLev, iw, lenh); } else if (col != ii) /* we for sure to add ii, avoid duplicate */ { @@ -4486,18 +3163,18 @@ hypre_ILUSetupILUKSymbolic(HYPRE_Int n, HYPRE_Int *A_diag_i, HYPRE_Int *A_diag_j /* * we now need to maintain the heap structure */ - hypre_ILUMinHeapRemoveIIIi(iL,iLev,iw,lenh); + hypre_ILUMinHeapRemoveIIIi(iL, iLev, iw, lenh); lenh--; /* copy to the end of array */ lenl++; /* reset iw for that, not using anymore */ - iw[k]=-1; - hypre_swap2i(iL,iLev,nLU-lenl,lenh); + iw[k] = -1; + hypre_swap2i(iL, iLev, nLU - lenl, lenh); /* * now the elimination on current row could start. * eliminate row k (new index) from current row */ - ku = U_diag_i[k+1]; + ku = U_diag_i[k + 1]; for (j = U_diag_i[k]; j < ku; j++) { col = temp_U_diag_j[j]; @@ -4524,7 +3201,7 @@ hypre_ILUSetupILUKSymbolic(HYPRE_Int n, HYPRE_Int *A_diag_i, HYPRE_Int *A_diag_j /*swap it with the element right after the heap*/ /* maintain the heap */ - hypre_ILUMinHeapAddIIIi(iL,iLev,iw,lenh); + hypre_ILUMinHeapAddIIIi(iL, iLev, iw, lenh); } else if (col != ii) { @@ -4542,20 +3219,21 @@ hypre_ILUSetupILUKSymbolic(HYPRE_Int n, HYPRE_Int *A_diag_i, HYPRE_Int *A_diag_j }/* end of while loop for iith row */ /* now update everything, indices, levels and so */ - L_diag_i[ii+1] = L_diag_i[ii] + lenl; + L_diag_i[ii + 1] = L_diag_i[ii] + lenl; if (lenl > 0) { /* check if memory is enough */ while (ctrL + lenl > capacity_L) { HYPRE_Int tmp = capacity_L; - capacity_L = capacity_L * EXPAND_FACT + 1; - temp_L_diag_j = hypre_TReAlloc_v2(temp_L_diag_j, HYPRE_Int, tmp, HYPRE_Int, capacity_L, HYPRE_MEMORY_DEVICE); + capacity_L = (HYPRE_Int)(capacity_L * EXPAND_FACT + 1); + temp_L_diag_j = hypre_TReAlloc_v2(temp_L_diag_j, HYPRE_Int, tmp, HYPRE_Int, + capacity_L, memory_location); } /* now copy L data, reverse order */ - for (j = 0; j < lenl; j ++) + for (j = 0; j < lenl; j++) { - temp_L_diag_j[ctrL+j] = iL[nLU-j-1]; + temp_L_diag_j[ctrL + j] = iL[nLU - j - 1]; } ctrL += lenl; } @@ -4564,15 +3242,16 @@ hypre_ILUSetupILUKSymbolic(HYPRE_Int n, HYPRE_Int *A_diag_i, HYPRE_Int *A_diag_j while (ctrS + k > capacity_S) { HYPRE_Int tmp = capacity_S; - capacity_S = capacity_S * EXPAND_FACT + 1; - temp_S_diag_j = hypre_TReAlloc_v2(temp_S_diag_j, HYPRE_Int, tmp, HYPRE_Int, capacity_S, HYPRE_MEMORY_DEVICE); + capacity_S = (HYPRE_Int)(capacity_S * EXPAND_FACT + 1); + temp_S_diag_j = hypre_TReAlloc_v2(temp_S_diag_j, HYPRE_Int, tmp, HYPRE_Int, capacity_S, + memory_location); } temp_S_diag_j[ctrS] = ii;/* must have diagonal */ - //hypre_TMemcpy(temp_S_diag_j+ctrS+1,iL+nLU,HYPRE_Int,k-1,HYPRE_MEMORY_DEVICE,HYPRE_MEMORY_HOST); - hypre_TMemcpy(temp_S_diag_j+ctrS+1, iL+nLU, HYPRE_Int, k-1, - HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + //hypre_TMemcpy(temp_S_diag_j+ctrS+1,iL+nLU,HYPRE_Int,k-1,memory_location,HYPRE_MEMORY_HOST); + hypre_TMemcpy(temp_S_diag_j + ctrS + 1, iL + nLU, HYPRE_Int, k - 1, + memory_location, HYPRE_MEMORY_HOST); ctrS += k; - S_diag_i[ii-nLU+1] = ctrS; + S_diag_i[ii - nLU + 1] = ctrS; /* reset iw */ for (j = nLU; j < lenu; j++) @@ -4587,12 +3266,12 @@ hypre_ILUSetupILUKSymbolic(HYPRE_Int n, HYPRE_Int *A_diag_i, HYPRE_Int *A_diag_j */ for (k = nLU; k < n; k++) { - U_diag_i[k+1] = U_diag_i[nLU]; + U_diag_i[k + 1] = U_diag_i[nLU]; } /* * 4: Finishing up and free memory */ - hypre_TFree(u_levels,HYPRE_MEMORY_HOST); + hypre_TFree(u_levels, HYPRE_MEMORY_HOST); *L_diag_j = temp_L_diag_j; *U_diag_j = temp_U_diag_j; @@ -4602,20 +3281,34 @@ hypre_ILUSetupILUKSymbolic(HYPRE_Int n, HYPRE_Int *A_diag_i, HYPRE_Int *A_diag_j return hypre_error_flag; } -/* ILU(k) +/*-------------------------------------------------------------------------- + * hypre_ILUSetupILUK + * + * Setup ILU(k) numeric factorization + * * A: input matrix * lfil: level of fill-in, the k in ILU(k) - * permp: permutation array indicating ordering of factorization. Perm could come from a - * CF_marker: array or a reordering routine. + * permp: permutation array indicating ordering of factorization. + * Perm could come from a CF_marker array or a reordering routine. * qpermp: column permutation array. * nLU: size of computed LDU factorization. * nI: number of interial unknowns, nI should obey nI >= nLU * Lptr, Dptr, Uptr: L, D, U factors. - * Sprt: Schur Complement, if no Schur Complement is needed it will be set to NULL - */ + * Sprt: Schur Complement, if no Schur Complement, it will be set to NULL + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUSetupILUK(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *permp, HYPRE_Int *qpermp, HYPRE_Int nLU, HYPRE_Int nI, - hypre_ParCSRMatrix **Lptr, HYPRE_Real** Dptr, hypre_ParCSRMatrix **Uptr, hypre_ParCSRMatrix **Sptr, HYPRE_Int **u_end) +hypre_ILUSetupILUK(hypre_ParCSRMatrix *A, + HYPRE_Int lfil, + HYPRE_Int *permp, + HYPRE_Int *qpermp, + HYPRE_Int nLU, + HYPRE_Int nI, + hypre_ParCSRMatrix **Lptr, + HYPRE_Real **Dptr, + hypre_ParCSRMatrix **Uptr, + hypre_ParCSRMatrix **Sptr, + HYPRE_Int **u_end) { /* * 1: Setup and create buffers @@ -4633,11 +3326,12 @@ hypre_ILUSetupILUK(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *permp, HYPR { return hypre_ILUSetupILU0( A, permp, qpermp, nLU, nI, Lptr, Dptr, Uptr, Sptr, u_end); } + HYPRE_Real local_nnz, total_nnz; HYPRE_Int i, ii, j, k, k1, k2, k3, kl, ku, jpiv, col, icol; HYPRE_Int *iw; MPI_Comm comm = hypre_ParCSRMatrixComm(A); - HYPRE_Int num_procs, my_id; + HYPRE_Int num_procs, my_id; /* data objects for A */ hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); @@ -4648,6 +3342,7 @@ hypre_ILUSetupILUK(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *permp, HYPR HYPRE_Real *A_offd_data = hypre_CSRMatrixData(A_offd); HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); + HYPRE_MemoryLocation memory_location = hypre_ParCSRMatrixMemoryLocation(A); /* data objects for L, D, U */ hypre_ParCSRMatrix *matL; @@ -4697,25 +3392,25 @@ hypre_ILUSetupILUK(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *permp, HYPR n = hypre_CSRMatrixNumRows(A_diag); if (nLU < 0 || nLU > n) { - hypre_error_w_msg(HYPRE_ERROR_ARG,"WARNING: nLU out of range.\n"); + hypre_error_w_msg(HYPRE_ERROR_ARG, "WARNING: nLU out of range.\n"); } m = n - nLU; e = nI - nLU; m_e = n - nI; if (e < 0) { - hypre_error_w_msg(HYPRE_ERROR_ARG,"WARNING: nLU should not exceed nI.\n"); + hypre_error_w_msg(HYPRE_ERROR_ARG, "WARNING: nLU should not exceed nI.\n"); } /* Init I array anyway. S's might be freed later */ - D_data = hypre_CTAlloc(HYPRE_Real, n, HYPRE_MEMORY_DEVICE); - L_diag_i = hypre_CTAlloc(HYPRE_Int, (n+1), HYPRE_MEMORY_DEVICE); - U_diag_i = hypre_CTAlloc(HYPRE_Int, (n+1), HYPRE_MEMORY_DEVICE); - S_diag_i = hypre_CTAlloc(HYPRE_Int, (m+1), HYPRE_MEMORY_DEVICE); + D_data = hypre_CTAlloc(HYPRE_Real, n, memory_location); + L_diag_i = hypre_CTAlloc(HYPRE_Int, (n + 1), memory_location); + U_diag_i = hypre_CTAlloc(HYPRE_Int, (n + 1), memory_location); + S_diag_i = hypre_CTAlloc(HYPRE_Int, (m + 1), memory_location); /* set Comm_Pkg if not yet built */ - hypre_MPI_Comm_size(comm,&num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); comm_pkg = hypre_ParCSRMatrixCommPkg(A); if (!comm_pkg) { @@ -4728,8 +3423,8 @@ hypre_ILUSetupILUK(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *permp, HYPR * setup iw and rperm first */ /* allocate work arrays */ - iw = hypre_CTAlloc(HYPRE_Int, 4*n, HYPRE_MEMORY_HOST); - rperm = iw + 3*n; + iw = hypre_CTAlloc(HYPRE_Int, 4 * n, HYPRE_MEMORY_HOST); + rperm = iw + 3 * n; L_diag_i[0] = U_diag_i[0] = S_diag_i[0] = 0; /* get reverse permutation (rperm). * rperm holds the reordered indexes. @@ -4737,7 +3432,7 @@ hypre_ILUSetupILUK(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *permp, HYPR if (!permp) { - perm = hypre_TAlloc(HYPRE_Int, n, HYPRE_MEMORY_DEVICE); + perm = hypre_TAlloc(HYPRE_Int, n, memory_location); for (i = 0; i < n; i++) { perm[i] = i; @@ -4750,7 +3445,7 @@ hypre_ILUSetupILUK(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *permp, HYPR if (!qpermp) { - qperm = hypre_TAlloc(HYPRE_Int, n, HYPRE_MEMORY_DEVICE); + qperm = hypre_TAlloc(HYPRE_Int, n, memory_location); for (i = 0; i < n; i++) { qperm[i] = i; @@ -4768,7 +3463,7 @@ hypre_ILUSetupILUK(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *permp, HYPR /* do symbolic factorization */ hypre_ILUSetupILUKSymbolic(n, A_diag_i, A_diag_j, lfil, perm, rperm, iw, - nLU, L_diag_i, U_diag_i, S_diag_i, &L_diag_j, &U_diag_j, &S_diag_j, u_end); + nLU, L_diag_i, U_diag_i, S_diag_i, &L_diag_j, &U_diag_j, &S_diag_j, u_end); /* * after this, we have our I,J for L, U and S ready, and L sorted @@ -4777,15 +3472,15 @@ hypre_ILUSetupILUK(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *permp, HYPR */ if (L_diag_i[n]) { - L_diag_data = hypre_CTAlloc(HYPRE_Real, L_diag_i[n], HYPRE_MEMORY_DEVICE); + L_diag_data = hypre_CTAlloc(HYPRE_Real, L_diag_i[n], memory_location); } if (U_diag_i[n]) { - U_diag_data = hypre_CTAlloc(HYPRE_Real, U_diag_i[n], HYPRE_MEMORY_DEVICE); + U_diag_data = hypre_CTAlloc(HYPRE_Real, U_diag_i[n], memory_location); } if (S_diag_i[m]) { - S_diag_data = hypre_CTAlloc(HYPRE_Real, S_diag_i[m], HYPRE_MEMORY_DEVICE); + S_diag_data = hypre_CTAlloc(HYPRE_Real, S_diag_i[m], memory_location); } /* @@ -4797,10 +3492,10 @@ hypre_ILUSetupILUK(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *permp, HYPR { // get row i i = perm[ii]; - kl = L_diag_i[ii+1]; - ku = U_diag_i[ii+1]; + kl = L_diag_i[ii + 1]; + ku = U_diag_i[ii + 1]; k1 = A_diag_i[i]; - k2 = A_diag_i[i+1]; + k2 = A_diag_i[i + 1]; /* set up working arrays */ for (j = L_diag_i[ii]; j < kl; j++) { @@ -4839,7 +3534,7 @@ hypre_ILUSetupILUK(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *permp, HYPR { jpiv = L_diag_j[j]; L_diag_data[j] *= D_data[jpiv]; - ku = U_diag_i[jpiv+1]; + ku = U_diag_i[jpiv + 1]; for (k = U_diag_i[jpiv]; k < ku; k++) { @@ -4853,22 +3548,22 @@ hypre_ILUSetupILUK(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *permp, HYPR if (col < ii) { /* L part */ - L_diag_data[icol] -= L_diag_data[j]*U_diag_data[k]; + L_diag_data[icol] -= L_diag_data[j] * U_diag_data[k]; } else if (col == ii) { /* diag part */ - D_data[icol] -= L_diag_data[j]*U_diag_data[k]; + D_data[icol] -= L_diag_data[j] * U_diag_data[k]; } else { /* U part */ - U_diag_data[icol] -= L_diag_data[j]*U_diag_data[k]; + U_diag_data[icol] -= L_diag_data[j] * U_diag_data[k]; } } } /* reset working array */ - ku = U_diag_i[ii+1]; + ku = U_diag_i[ii + 1]; for (j = L_diag_i[ii]; j < kl; j++) { col = L_diag_j[j]; @@ -4882,11 +3577,11 @@ hypre_ILUSetupILUK(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *permp, HYPR } /* diagonal part (we store the inverse) */ - if (fabs(D_data[ii]) < MAT_TOL) + if (hypre_abs(D_data[ii]) < MAT_TOL) { - D_data[ii] = 1e-06; + D_data[ii] = 1.0e-06; } - D_data[ii] = 1./ D_data[ii]; + D_data[ii] = 1. / D_data[ii]; } /* Now lower part for Schur complement */ @@ -4894,10 +3589,10 @@ hypre_ILUSetupILUK(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *permp, HYPR { // get row i i = perm[ii]; - kl = L_diag_i[ii+1]; - ku = S_diag_i[ii - nLU +1]; + kl = L_diag_i[ii + 1]; + ku = S_diag_i[ii - nLU + 1]; k1 = A_diag_i[i]; - k2 = A_diag_i[i+1]; + k2 = A_diag_i[i + 1]; /* set up working arrays */ for (j = L_diag_i[ii]; j < kl; j++) { @@ -4930,7 +3625,7 @@ hypre_ILUSetupILUK(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *permp, HYPR { jpiv = L_diag_j[j]; L_diag_data[j] *= D_data[jpiv]; - ku = U_diag_i[jpiv+1]; + ku = U_diag_i[jpiv + 1]; for (k = U_diag_i[jpiv]; k < ku; k++) { col = U_diag_j[k]; @@ -4943,12 +3638,12 @@ hypre_ILUSetupILUK(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *permp, HYPR if (col < nLU) { /* L part */ - L_diag_data[icol] -= L_diag_data[j]*U_diag_data[k]; + L_diag_data[icol] -= L_diag_data[j] * U_diag_data[k]; } else { /* S part */ - S_diag_data[icol] -= L_diag_data[j]*U_diag_data[k]; + S_diag_data[icol] -= L_diag_data[j] * U_diag_data[k]; } } } @@ -4958,13 +3653,13 @@ hypre_ILUSetupILUK(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *permp, HYPR col = L_diag_j[j]; iw[col] = -1; } - ku = S_diag_i[ii-nLU+1]; - for (j = S_diag_i[ii-nLU]; j < ku; j++) + ku = S_diag_i[ii - nLU + 1]; + for (j = S_diag_i[ii - nLU]; j < ku; j++) { col = S_diag_j[j]; iw[col] = -1; /* remember to update index, S is smaller! */ - S_diag_j[j]-=nLU; + S_diag_j[j] -= nLU; } } @@ -4984,7 +3679,7 @@ hypre_ILUSetupILUK(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *permp, HYPR /* need to get new column start */ { HYPRE_BigInt global_start; - hypre_MPI_Scan( &big_m, &global_start, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); + hypre_MPI_Scan(&big_m, &global_start, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); col_starts[0] = global_start - m; col_starts[1] = global_start; } @@ -4997,13 +3692,13 @@ hypre_ILUSetupILUK(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *permp, HYPR S_offd_ncols = hypre_CSRMatrixNumCols(A_offd); matS = hypre_ParCSRMatrixCreate( comm, - total_rows, - total_rows, - col_starts, - col_starts, - S_offd_ncols, - S_diag_i[m], - S_offd_nnz); + total_rows, + total_rows, + col_starts, + col_starts, + S_offd_ncols, + S_diag_i[m], + S_offd_nnz); /* first put diagonal data in */ S_diag = hypre_ParCSRMatrixDiag(matS); @@ -5014,9 +3709,9 @@ hypre_ILUSetupILUK(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *permp, HYPR /* now start to construct offdiag of S */ S_offd = hypre_ParCSRMatrixOffd(matS); - S_offd_i = hypre_TAlloc(HYPRE_Int, m+1, HYPRE_MEMORY_DEVICE); - S_offd_j = hypre_TAlloc(HYPRE_Int, S_offd_nnz, HYPRE_MEMORY_DEVICE); - S_offd_data = hypre_TAlloc(HYPRE_Real, S_offd_nnz, HYPRE_MEMORY_DEVICE); + S_offd_i = hypre_TAlloc(HYPRE_Int, m + 1, memory_location); + S_offd_j = hypre_TAlloc(HYPRE_Int, S_offd_nnz, memory_location); + S_offd_data = hypre_TAlloc(HYPRE_Real, S_offd_nnz, memory_location); S_offd_colmap = hypre_CTAlloc(HYPRE_BigInt, S_offd_ncols, HYPRE_MEMORY_HOST); /* simply use a loop to copy data from A_offd */ @@ -5024,19 +3719,19 @@ hypre_ILUSetupILUK(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *permp, HYPR k3 = 0; for (i = 1; i <= e; i++) { - S_offd_i[i+1] = k3; + S_offd_i[i + 1] = k3; } for (i = 0; i < m_e; i++) { col = perm[i + nI]; k1 = A_offd_i[col]; - k2 = A_offd_i[col+1]; + k2 = A_offd_i[col + 1]; for (j = k1; j < k2; j++) { S_offd_j[k3] = A_offd_j[j]; S_offd_data[k3++] = A_offd_data[j]; } - S_offd_i[i+e+1] = k3; + S_offd_i[i + e + 1] = k3; } /* give I, J, DATA to S_offd */ @@ -5048,13 +3743,14 @@ hypre_ILUSetupILUK(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *permp, HYPR /* get total num of send */ HYPRE_Int num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - HYPRE_Int begin = hypre_ParCSRCommPkgSendMapStart(comm_pkg,0); - HYPRE_Int end = hypre_ParCSRCommPkgSendMapStart(comm_pkg,num_sends); + HYPRE_Int begin = hypre_ParCSRCommPkgSendMapStart(comm_pkg, 0); + HYPRE_Int end = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends); send_buf = hypre_TAlloc(HYPRE_BigInt, end - begin, HYPRE_MEMORY_HOST); + /* copy new index into send_buf */ for (i = begin; i < end; i++) { - send_buf[i-begin] = rperm[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,i)] - nLU + col_starts[0]; + send_buf[i - begin] = rperm[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, i)] - nLU + col_starts[0]; } /* main communication */ @@ -5078,17 +3774,17 @@ hypre_ILUSetupILUK(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *permp, HYPR } matL = hypre_ParCSRMatrixCreate( comm, - hypre_ParCSRMatrixGlobalNumRows(A), - hypre_ParCSRMatrixGlobalNumRows(A), - hypre_ParCSRMatrixRowStarts(A), - hypre_ParCSRMatrixColStarts(A), - 0 /* num_cols_offd */, - L_diag_i[n], - 0 /* num_nonzeros_offd */); + hypre_ParCSRMatrixGlobalNumRows(A), + hypre_ParCSRMatrixGlobalNumRows(A), + hypre_ParCSRMatrixRowStarts(A), + hypre_ParCSRMatrixColStarts(A), + 0 /* num_cols_offd */, + L_diag_i[n], + 0 /* num_nonzeros_offd */); L_diag = hypre_ParCSRMatrixDiag(matL); hypre_CSRMatrixI(L_diag) = L_diag_i; - if (L_diag_i[n]>0) + if (L_diag_i[n] > 0) { hypre_CSRMatrixData(L_diag) = L_diag_data; hypre_CSRMatrixJ(L_diag) = L_diag_j; @@ -5096,7 +3792,7 @@ hypre_ILUSetupILUK(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *permp, HYPR else { /* we allocated some initial length, so free them */ - hypre_TFree(L_diag_j, HYPRE_MEMORY_DEVICE); + hypre_TFree(L_diag_j, memory_location); } /* store (global) total number of nonzeros */ local_nnz = (HYPRE_Real) (L_diag_i[n]); @@ -5104,17 +3800,17 @@ hypre_ILUSetupILUK(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *permp, HYPR hypre_ParCSRMatrixDNumNonzeros(matL) = total_nnz; matU = hypre_ParCSRMatrixCreate( comm, - hypre_ParCSRMatrixGlobalNumRows(A), - hypre_ParCSRMatrixGlobalNumRows(A), - hypre_ParCSRMatrixRowStarts(A), - hypre_ParCSRMatrixColStarts(A), - 0, - U_diag_i[n], - 0 ); + hypre_ParCSRMatrixGlobalNumRows(A), + hypre_ParCSRMatrixGlobalNumRows(A), + hypre_ParCSRMatrixRowStarts(A), + hypre_ParCSRMatrixColStarts(A), + 0, + U_diag_i[n], + 0 ); U_diag = hypre_ParCSRMatrixDiag(matU); hypre_CSRMatrixI(U_diag) = U_diag_i; - if (U_diag_i[n]>0) + if (U_diag_i[n] > 0) { hypre_CSRMatrixData(U_diag) = U_diag_data; hypre_CSRMatrixJ(U_diag) = U_diag_j; @@ -5122,7 +3818,7 @@ hypre_ILUSetupILUK(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *permp, HYPR else { /* we allocated some initial length, so free them */ - hypre_TFree(U_diag_j, HYPRE_MEMORY_DEVICE); + hypre_TFree(U_diag_j, memory_location); } /* store (global) total number of nonzeros */ local_nnz = (HYPRE_Real) (U_diag_i[n]); @@ -5130,21 +3826,21 @@ hypre_ILUSetupILUK(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *permp, HYPR hypre_ParCSRMatrixDNumNonzeros(matU) = total_nnz; /* free */ - hypre_TFree(iw,HYPRE_MEMORY_HOST); + hypre_TFree(iw, HYPRE_MEMORY_HOST); if (!matS) { /* we allocate some memory for S, need to free if unused */ - hypre_TFree(S_diag_i,HYPRE_MEMORY_DEVICE); + hypre_TFree(S_diag_i, memory_location); } if (!permp) { - hypre_TFree(perm, HYPRE_MEMORY_DEVICE); + hypre_TFree(perm, memory_location); } if (!qpermp) { - hypre_TFree(qperm, HYPRE_MEMORY_DEVICE); + hypre_TFree(qperm, memory_location); } /* set matrix pointers */ @@ -5156,28 +3852,43 @@ hypre_ILUSetupILUK(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *permp, HYPR return hypre_error_flag; } -/* ILUT +/*-------------------------------------------------------------------------- + * hypre_ILUSetupILUT + * + * Setup ILU(t) numeric factorization + * * A: input matrix * lfil: maximum nnz per row in L and U * tol: droptol array in ILUT * tol[0]: matrix B * tol[1]: matrix E and F * tol[2]: matrix S - * perm: permutation array indicating ordering of factorization. Perm could come from a - * CF_marker: array or a reordering routine. + * perm: permutation array indicating ordering of factorization. + * Perm could come from a CF_marker array or a reordering routine. * qperm: permutation array for column - * nLU: size of computed LDU factorization. If nLU < n, Schur compelemnt will be formed + * nLU: size of computed LDU factorization. + * If nLU < n, Schur complement will be formed * nI: number of interial unknowns. nLU should obey nLU <= nI. * Lptr, Dptr, Uptr: L, D, U factors. * Sptr: Schur complement * * Keep the largest lfil entries that is greater than some tol relative * to the input tol and the norm of that row in both L and U - */ + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUSetupILUT(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, - HYPRE_Int *permp, HYPRE_Int *qpermp, HYPRE_Int nLU, HYPRE_Int nI, hypre_ParCSRMatrix **Lptr, - HYPRE_Real** Dptr, hypre_ParCSRMatrix **Uptr, hypre_ParCSRMatrix **Sptr, HYPRE_Int **u_end) +hypre_ILUSetupILUT(hypre_ParCSRMatrix *A, + HYPRE_Int lfil, + HYPRE_Real *tol, + HYPRE_Int *permp, + HYPRE_Int *qpermp, + HYPRE_Int nLU, + HYPRE_Int nI, + hypre_ParCSRMatrix **Lptr, + HYPRE_Real **Dptr, + hypre_ParCSRMatrix **Uptr, + hypre_ParCSRMatrix **Sptr, + HYPRE_Int **u_end) { /* * 1: Setup and create buffers @@ -5190,9 +3901,10 @@ hypre_ILUSetupILUT(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, * iL = working array store the active col number */ HYPRE_Real local_nnz, total_nnz; - HYPRE_Int i, ii, j, k, k1, k2, k3, kl, ku, col, icol, lenl, lenu, lenhu, lenhlr, lenhll, jpos, jrow; + HYPRE_Int i, ii, j, k, k1, k2, k3, kl, ku, col, icol, lenl, lenu, lenhu, lenhlr, + lenhll, jpos, jrow; HYPRE_Real inorm, itolb, itolef, itols, dpiv, lxu; - HYPRE_Int *iw,*iL; + HYPRE_Int *iw, *iL; HYPRE_Real *w; /* memory management */ @@ -5202,7 +3914,7 @@ hypre_ILUSetupILUT(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, HYPRE_Int capacity_L; HYPRE_Int capacity_U; HYPRE_Int ctrS; - HYPRE_Int capacity_S; + HYPRE_Int capacity_S = 0; HYPRE_Int nnz_A; /* communication stuffs for S */ @@ -5225,6 +3937,7 @@ hypre_ILUSetupILUT(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); HYPRE_Real *A_offd_data = hypre_CSRMatrixData(A_offd); + HYPRE_MemoryLocation memory_location = hypre_ParCSRMatrixMemoryLocation(A); /* data objects for L, D, U */ hypre_ParCSRMatrix *matL; @@ -5248,9 +3961,9 @@ hypre_ILUSetupILUT(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, HYPRE_Int *S_diag_j = NULL; HYPRE_Int *S_offd_i = NULL; HYPRE_Int *S_offd_j = NULL; - HYPRE_BigInt *S_offd_colmap = NULL; + HYPRE_BigInt *S_offd_colmap = NULL; HYPRE_Real *S_offd_data; - HYPRE_BigInt *send_buf = NULL; + HYPRE_BigInt *send_buf = NULL; HYPRE_Int *u_end_array; /* reverse permutation */ @@ -5273,14 +3986,14 @@ hypre_ILUSetupILUT(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, n = hypre_CSRMatrixNumRows(A_diag); if (nLU < 0 || nLU > n) { - hypre_error_w_msg(HYPRE_ERROR_ARG,"WARNING: nLU out of range.\n"); + hypre_error_w_msg(HYPRE_ERROR_ARG, "WARNING: nLU out of range.\n"); } m = n - nLU; e = nI - nLU; m_e = n - nI; if (e < 0) { - hypre_error_w_msg(HYPRE_ERROR_ARG,"WARNING: nLU should not exceed nI.\n"); + hypre_error_w_msg(HYPRE_ERROR_ARG, "WARNING: nLU should not exceed nI.\n"); } u_end_array = hypre_TAlloc(HYPRE_Int, nLU, HYPRE_MEMORY_HOST); @@ -5288,8 +4001,8 @@ hypre_ILUSetupILUT(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, /* start set up * setup communication stuffs first */ - hypre_MPI_Comm_size(comm,&num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); comm_pkg = hypre_ParCSRMatrixCommPkg(A); /* create if not yet built */ if (!comm_pkg) @@ -5302,37 +4015,39 @@ hypre_ILUSetupILUT(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, nnz_A = A_diag_i[nLU]; if (n > 0) { - initial_alloc = hypre_min(nLU + ceil((nnz_A / 2.0) * nLU / n), nLU * lfil); + initial_alloc = (HYPRE_Int)(hypre_min(nLU + hypre_ceil((nnz_A / 2.0) * nLU / n), + nLU * lfil)); } capacity_L = initial_alloc; capacity_U = initial_alloc; - D_data = hypre_CTAlloc(HYPRE_Real, n, HYPRE_MEMORY_DEVICE); - L_diag_i = hypre_CTAlloc(HYPRE_Int, (n+1), HYPRE_MEMORY_DEVICE); - U_diag_i = hypre_CTAlloc(HYPRE_Int, (n+1), HYPRE_MEMORY_DEVICE); + D_data = hypre_CTAlloc(HYPRE_Real, n, memory_location); + L_diag_i = hypre_CTAlloc(HYPRE_Int, (n + 1), memory_location); + U_diag_i = hypre_CTAlloc(HYPRE_Int, (n + 1), memory_location); - L_diag_j = hypre_CTAlloc(HYPRE_Int, capacity_L, HYPRE_MEMORY_DEVICE); - U_diag_j = hypre_CTAlloc(HYPRE_Int, capacity_U, HYPRE_MEMORY_DEVICE); - L_diag_data = hypre_CTAlloc(HYPRE_Real, capacity_L, HYPRE_MEMORY_DEVICE); - U_diag_data = hypre_CTAlloc(HYPRE_Real, capacity_U, HYPRE_MEMORY_DEVICE); + L_diag_j = hypre_CTAlloc(HYPRE_Int, capacity_L, memory_location); + U_diag_j = hypre_CTAlloc(HYPRE_Int, capacity_U, memory_location); + L_diag_data = hypre_CTAlloc(HYPRE_Real, capacity_L, memory_location); + U_diag_data = hypre_CTAlloc(HYPRE_Real, capacity_U, memory_location); ctrL = ctrU = 0; ctrS = 0; - S_diag_i = hypre_CTAlloc(HYPRE_Int, (m + 1), HYPRE_MEMORY_DEVICE); + S_diag_i = hypre_CTAlloc(HYPRE_Int, (m + 1), memory_location); S_diag_i[0] = 0; + /* only setup S part when n > nLU */ if (m > 0) { - capacity_S = hypre_min(m + ceil((nnz_A / 2.0) * m / n), m * lfil); - S_diag_j = hypre_CTAlloc(HYPRE_Int, capacity_S, HYPRE_MEMORY_DEVICE); - S_diag_data = hypre_CTAlloc(HYPRE_Real, capacity_S, HYPRE_MEMORY_DEVICE); + capacity_S = (HYPRE_Int)(hypre_min(m + hypre_ceil((nnz_A / 2.0) * m / n), m * lfil)); + S_diag_j = hypre_CTAlloc(HYPRE_Int, capacity_S, memory_location); + S_diag_data = hypre_CTAlloc(HYPRE_Real, capacity_S, memory_location); } /* setting up working array */ - iw = hypre_CTAlloc(HYPRE_Int,3*n,HYPRE_MEMORY_HOST); + iw = hypre_CTAlloc(HYPRE_Int, 3 * n, HYPRE_MEMORY_HOST); iL = iw + n; - w = hypre_CTAlloc(HYPRE_Real,n,HYPRE_MEMORY_HOST); + w = hypre_CTAlloc(HYPRE_Real, n, HYPRE_MEMORY_HOST); for (i = 0; i < n; i++) { iw[i] = -1; @@ -5343,11 +4058,11 @@ hypre_ILUSetupILUT(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, * rperm[old] -> new * perm[new] -> old */ - rperm = iw + 2*n; + rperm = iw + 2 * n; if (!permp) { - perm = hypre_TAlloc(HYPRE_Int, n, HYPRE_MEMORY_DEVICE); + perm = hypre_TAlloc(HYPRE_Int, n, memory_location); for (i = 0; i < n; i++) { perm[i] = i; @@ -5360,7 +4075,7 @@ hypre_ILUSetupILUT(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, if (!qpermp) { - qperm = hypre_TAlloc(HYPRE_Int, n, HYPRE_MEMORY_DEVICE); + qperm = hypre_TAlloc(HYPRE_Int, n, memory_location); for (i = 0; i < n; i++) { qperm[i] = i; @@ -5388,19 +4103,19 @@ hypre_ILUSetupILUT(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, /* get real row with perm */ i = perm[ii]; k1 = A_diag_i[i]; - k2 = A_diag_i[i+1]; - kl = ii-1; + k2 = A_diag_i[i + 1]; + kl = ii - 1; /* reset row norm of ith row */ inorm = .0; for (j = k1; j < k2; j++) { - inorm += fabs(A_diag_data[j]); + inorm += hypre_abs(A_diag_data[j]); } if (inorm == .0) { - hypre_error_w_msg(HYPRE_ERROR_ARG,"WARNING: ILUT with zero row.\n"); + hypre_error_w_msg(HYPRE_ERROR_ARG, "WARNING: ILUT with zero row.\n"); } - inorm /= (HYPRE_Real)(k2-k1); + inorm /= (HYPRE_Real)(k2 - k1); /* set the scaled tol for that row */ itolb = tol[0] * inorm; itolef = tol[1] * inorm; @@ -5421,7 +4136,7 @@ hypre_ILUSetupILUT(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, w[lenhll] = A_diag_data[j]; iw[col] = lenhll++; /* add to heap, by col number */ - hypre_ILUMinHeapAddIRIi(iL,w,iw,lenhll); + hypre_ILUMinHeapAddIRIi(iL, w, iw, lenhll); } else if (col == ii) { @@ -5451,7 +4166,7 @@ hypre_ILUSetupILUT(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, dpiv = w[0] * D_data[jrow]; w[0] = dpiv; /* now remove it from the top of the heap */ - hypre_ILUMinHeapRemoveIRIi(iL,w,iw,lenhll); + hypre_ILUMinHeapRemoveIRIi(iL, w, iw, lenhll); lenhll--; /* * reset the drop part to -1 @@ -5460,19 +4175,19 @@ hypre_ILUSetupILUT(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, iw[jrow] = -1; /* need to keep this one, move to the end of the heap */ /* no longer need to maintain iw */ - hypre_swap2(iL,w,lenhll,kl-lenhlr); + hypre_swap2(iL, w, lenhll, kl - lenhlr); lenhlr++; - hypre_ILUMaxrHeapAddRabsI(w+kl,iL+kl,lenhlr); + hypre_ILUMaxrHeapAddRabsI(w + kl, iL + kl, lenhlr); /* loop for elimination */ - ku = U_diag_i[jrow+1]; + ku = U_diag_i[jrow + 1]; for (j = U_diag_i[jrow]; j < ku; j++) { col = U_diag_j[j]; icol = iw[col]; - lxu = - dpiv*U_diag_data[j]; + lxu = - dpiv * U_diag_data[j]; /* we don't want to fill small number to empty place */ if ((icol == -1) && - ((col < nLU && fabs(lxu) < itolb) || (col >= nLU && fabs(lxu) < itolef))) + ((col < nLU && hypre_abs(lxu) < itolb) || (col >= nLU && hypre_abs(lxu) < itolef))) { continue; } @@ -5489,7 +4204,7 @@ hypre_ILUSetupILUT(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, w[lenhll] = lxu; iw[col] = lenhll++; /* add to heap, by col number */ - hypre_ILUMinHeapAddIRIi(iL,w,iw,lenhll); + hypre_ILUMinHeapAddIRIi(iL, w, iw, lenhll); } else if (col == ii) { @@ -5515,11 +4230,11 @@ hypre_ILUSetupILUT(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, } }/* while loop for the elimination of current row */ - if (fabs(w[ii]) < MAT_TOL) + if (hypre_abs(w[ii]) < MAT_TOL) { - w[ii]=1e-06; + w[ii] = 1.0e-06; } - D_data[ii] = 1./w[ii]; + D_data[ii] = 1. / w[ii]; iw[ii] = -1; /* @@ -5528,24 +4243,27 @@ hypre_ILUSetupILUT(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, */ lenl = lenhlr < lfil ? lenhlr : lfil; - L_diag_i[ii+1] = L_diag_i[ii] + lenl; + L_diag_i[ii + 1] = L_diag_i[ii] + lenl; if (lenl > 0) { /* test if memory is enough */ while (ctrL + lenl > capacity_L) { HYPRE_Int tmp = capacity_L; - capacity_L = capacity_L * EXPAND_FACT + 1; - L_diag_j = hypre_TReAlloc_v2(L_diag_j, HYPRE_Int, tmp, HYPRE_Int, capacity_L, HYPRE_MEMORY_DEVICE); - L_diag_data = hypre_TReAlloc_v2(L_diag_data, HYPRE_Real, tmp, HYPRE_Real, capacity_L, HYPRE_MEMORY_DEVICE); + capacity_L = (HYPRE_Int)(capacity_L * EXPAND_FACT + 1); + L_diag_j = hypre_TReAlloc_v2(L_diag_j, HYPRE_Int, tmp, HYPRE_Int, + capacity_L, memory_location); + L_diag_data = hypre_TReAlloc_v2(L_diag_data, HYPRE_Real, tmp, HYPRE_Real, + capacity_L, memory_location); } ctrL += lenl; + /* copy large data in */ for (j = L_diag_i[ii]; j < ctrL; j++) { L_diag_j[j] = iL[kl]; L_diag_data[j] = w[kl]; - hypre_ILUMaxrHeapRemoveRabsI(w+kl,iL+kl,lenhlr); + hypre_ILUMaxrHeapRemoveRabsI(w + kl, iL + kl, lenhlr); lenhlr--; } } @@ -5553,7 +4271,7 @@ hypre_ILUSetupILUT(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, * now reset working array * L part already reset when move out of heap, only U part */ - ku = lenu+ii; + ku = lenu + ii; for (j = ii + 1; j <= ku; j++) { iw[iL[j]] = -1; @@ -5569,25 +4287,27 @@ hypre_ILUSetupILUT(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, /* need to sort the first small(hopefully) part of it */ lenhu = lfil; /* quick split, only sort the first small part of the array */ - hypre_ILUMaxQSplitRabsI(w,iL,ii+1,ii+lenhu,ii+lenu); + hypre_ILUMaxQSplitRabsI(w, iL, ii + 1, ii + lenhu, ii + lenu); } - U_diag_i[ii+1] = U_diag_i[ii] + lenhu; + U_diag_i[ii + 1] = U_diag_i[ii] + lenhu; if (lenhu > 0) { /* test if memory is enough */ while (ctrU + lenhu > capacity_U) { HYPRE_Int tmp = capacity_U; - capacity_U = capacity_U * EXPAND_FACT + 1; - U_diag_j = hypre_TReAlloc_v2(U_diag_j, HYPRE_Int, tmp, HYPRE_Int, capacity_U, HYPRE_MEMORY_DEVICE); - U_diag_data = hypre_TReAlloc_v2(U_diag_data, HYPRE_Real, tmp, HYPRE_Real, capacity_U, HYPRE_MEMORY_DEVICE); + capacity_U = (HYPRE_Int)(capacity_U * EXPAND_FACT + 1); + U_diag_j = hypre_TReAlloc_v2(U_diag_j, HYPRE_Int, tmp, HYPRE_Int, + capacity_U, memory_location); + U_diag_data = hypre_TReAlloc_v2(U_diag_data, HYPRE_Real, tmp, HYPRE_Real, + capacity_U, memory_location); } ctrU += lenhu; /* copy large data in */ for (j = U_diag_i[ii]; j < ctrU; j++) { - jpos = ii+1+j-U_diag_i[ii]; + jpos = ii + 1 + j - U_diag_i[ii]; U_diag_j[j] = iL[jpos]; U_diag_data[j] = w[jpos]; } @@ -5595,8 +4315,8 @@ hypre_ILUSetupILUT(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, /* check and build u_end array */ if (m > 0) { - hypre_qsort1(U_diag_j,U_diag_data,U_diag_i[ii],U_diag_i[ii+1]-1); - hypre_BinarySearch2(U_diag_j,nLU,U_diag_i[ii],U_diag_i[ii+1]-1,u_end_array + ii); + hypre_qsort1(U_diag_j, U_diag_data, U_diag_i[ii], U_diag_i[ii + 1] - 1); + hypre_BinarySearch2(U_diag_j, nLU, U_diag_i[ii], U_diag_i[ii + 1] - 1, u_end_array + ii); } else { @@ -5612,19 +4332,19 @@ hypre_ILUSetupILUT(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, /* get real row with perm */ i = perm[ii]; k1 = A_diag_i[i]; - k2 = A_diag_i[i+1]; - kl = nLU-1; + k2 = A_diag_i[i + 1]; + kl = nLU - 1; /* reset row norm of ith row */ inorm = .0; for (j = k1; j < k2; j++) { - inorm += fabs(A_diag_data[j]); + inorm += hypre_abs(A_diag_data[j]); } if (inorm == .0) { - hypre_error_w_msg(HYPRE_ERROR_ARG,"WARNING: ILUT with zero row.\n"); + hypre_error_w_msg(HYPRE_ERROR_ARG, "WARNING: ILUT with zero row.\n"); } - inorm /= (HYPRE_Real)(k2-k1); + inorm /= (HYPRE_Real)(k2 - k1); /* set the scaled tol for that row */ itols = tol[2] * inorm; itolef = tol[1] * inorm; @@ -5643,7 +4363,7 @@ hypre_ILUSetupILUT(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, w[lenhll] = A_diag_data[j]; iw[col] = lenhll++; /* add to heap, by col number */ - hypre_ILUMinHeapAddIRIi(iL,w,iw,lenhll); + hypre_ILUMinHeapAddIRIi(iL, w, iw, lenhll); } else if (col == ii) { @@ -5676,7 +4396,7 @@ hypre_ILUSetupILUT(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, dpiv = w[0] * D_data[jrow]; w[0] = dpiv; /* now remove it from the top of the heap */ - hypre_ILUMinHeapRemoveIRIi(iL,w,iw,lenhll); + hypre_ILUMinHeapRemoveIRIi(iL, w, iw, lenhll); lenhll--; /* * reset the drop part to -1 @@ -5685,19 +4405,20 @@ hypre_ILUSetupILUT(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, iw[jrow] = -1; /* need to keep this one, move to the end of the heap */ /* no longer need to maintain iw */ - hypre_swap2(iL,w,lenhll,kl-lenhlr); + hypre_swap2(iL, w, lenhll, kl - lenhlr); lenhlr++; - hypre_ILUMaxrHeapAddRabsI(w+kl,iL+kl,lenhlr); + hypre_ILUMaxrHeapAddRabsI(w + kl, iL + kl, lenhlr); /* loop for elimination */ - ku = U_diag_i[jrow+1]; + ku = U_diag_i[jrow + 1]; for (j = U_diag_i[jrow]; j < ku; j++) { col = U_diag_j[j]; icol = iw[col]; - lxu = - dpiv*U_diag_data[j]; + lxu = - dpiv * U_diag_data[j]; /* we don't want to fill small number to empty place */ if ((icol == -1) && - ((col < nLU && fabs(lxu) < itolef) || ( col >= nLU && fabs(lxu) < itols ))) + ((col < nLU && hypre_abs(lxu) < itolef) || + (col >= nLU && hypre_abs(lxu) < itols ))) { continue; } @@ -5714,7 +4435,7 @@ hypre_ILUSetupILUT(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, w[lenhll] = lxu; iw[col] = lenhll++; /* add to heap, by col number */ - hypre_ILUMinHeapAddIRIi(iL,w,iw,lenhll); + hypre_ILUMinHeapAddIRIi(iL, w, iw, lenhll); } else if (col == ii) { @@ -5749,24 +4470,27 @@ hypre_ILUSetupILUT(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, */ lenl = lenhlr < lfil ? lenhlr : lfil; - L_diag_i[ii+1] = L_diag_i[ii] + lenl; + L_diag_i[ii + 1] = L_diag_i[ii] + lenl; if (lenl > 0) { /* test if memory is enough */ while (ctrL + lenl > capacity_L) { HYPRE_Int tmp = capacity_L; - capacity_L = capacity_L * EXPAND_FACT + 1; - L_diag_j = hypre_TReAlloc_v2(L_diag_j, HYPRE_Int, tmp, HYPRE_Int, capacity_L, HYPRE_MEMORY_DEVICE); - L_diag_data = hypre_TReAlloc_v2(L_diag_data, HYPRE_Real, tmp, HYPRE_Real, capacity_L, HYPRE_MEMORY_DEVICE); + capacity_L = (HYPRE_Int)(capacity_L * EXPAND_FACT + 1); + L_diag_j = hypre_TReAlloc_v2(L_diag_j, HYPRE_Int, tmp, HYPRE_Int, + capacity_L, memory_location); + L_diag_data = hypre_TReAlloc_v2(L_diag_data, HYPRE_Real, tmp, HYPRE_Real, + capacity_L, memory_location); } ctrL += lenl; + /* copy large data in */ - for (j = L_diag_i[ii]; j < ctrL; j ++) + for (j = L_diag_i[ii]; j < ctrL; j++) { L_diag_j[j] = iL[kl]; L_diag_data[j] = w[kl]; - hypre_ILUMaxrHeapRemoveRabsI(w+kl,iL+kl,lenhlr); + hypre_ILUMaxrHeapRemoveRabsI(w + kl, iL + kl, lenhlr); lenhlr--; } } @@ -5774,7 +4498,7 @@ hypre_ILUSetupILUT(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, * now reset working array * L part already reset when move out of heap, only S part */ - ku = lenu+nLU; + ku = lenu + nLU; for (j = nLU; j <= ku; j++) { iw[iL[j]] = -1; @@ -5784,27 +4508,29 @@ hypre_ILUSetupILUT(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, //lenhu = lenu < lfil ? lenu : lfil; lenhu = lenu; /* quick split, only sort the first small part of the array */ - hypre_ILUMaxQSplitRabsI(w,iL,nLU+1,nLU+lenhu,nLU+lenu); + hypre_ILUMaxQSplitRabsI(w, iL, nLU + 1, nLU + lenhu, nLU + lenu); /* we have diagonal in S anyway */ /* test if memory is enough */ while (ctrS + lenhu + 1 > capacity_S) { HYPRE_Int tmp = capacity_S; - capacity_S = capacity_S * EXPAND_FACT + 1; - S_diag_j = hypre_TReAlloc_v2(S_diag_j, HYPRE_Int, tmp, HYPRE_Int, capacity_S, HYPRE_MEMORY_DEVICE); - S_diag_data = hypre_TReAlloc_v2(S_diag_data, HYPRE_Real, tmp, HYPRE_Real, capacity_S, HYPRE_MEMORY_DEVICE); + capacity_S = (HYPRE_Int)(capacity_S * EXPAND_FACT + 1); + S_diag_j = hypre_TReAlloc_v2(S_diag_j, HYPRE_Int, tmp, + HYPRE_Int, capacity_S, memory_location); + S_diag_data = hypre_TReAlloc_v2(S_diag_data, HYPRE_Real, tmp, + HYPRE_Real, capacity_S, memory_location); } - ctrS += (lenhu+1); - S_diag_i[ii-nLU+1] = ctrS; + ctrS += (lenhu + 1); + S_diag_i[ii - nLU + 1] = ctrS; /* copy large data in, diagonal first */ - S_diag_j[S_diag_i[ii-nLU]] = iL[nLU]-nLU; - S_diag_data[S_diag_i[ii-nLU]] = w[nLU]; - for (j = S_diag_i[ii-nLU] + 1; j < ctrS; j++) + S_diag_j[S_diag_i[ii - nLU]] = iL[nLU] - nLU; + S_diag_data[S_diag_i[ii - nLU]] = w[nLU]; + for (j = S_diag_i[ii - nLU] + 1; j < ctrS; j++) { - jpos = nLU+j-S_diag_i[ii-nLU]; - S_diag_j[j] = iL[jpos]-nLU; + jpos = nLU + j - S_diag_i[ii - nLU]; + S_diag_j[j] = iL[jpos] - nLU; S_diag_data[j] = w[jpos]; } }/* end of ii loop from nLU to n-1 */ @@ -5818,6 +4544,7 @@ hypre_ILUSetupILUT(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, */ HYPRE_BigInt big_m = (HYPRE_BigInt)m; hypre_MPI_Allreduce(&big_m, &total_rows, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); + /* only form when total_rows > 0 */ if ( total_rows > 0 ) { @@ -5825,7 +4552,7 @@ hypre_ILUSetupILUT(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, /* need to get new column start */ { HYPRE_BigInt global_start; - hypre_MPI_Scan( &big_m, &global_start, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); + hypre_MPI_Scan(&big_m, &global_start, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); col_starts[0] = global_start - m; col_starts[1] = global_start; } @@ -5837,13 +4564,13 @@ hypre_ILUSetupILUT(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, S_offd_ncols = hypre_CSRMatrixNumCols(A_offd); matS = hypre_ParCSRMatrixCreate( comm, - total_rows, - total_rows, - col_starts, - col_starts, - S_offd_ncols, - S_diag_i[m], - S_offd_nnz); + total_rows, + total_rows, + col_starts, + col_starts, + S_offd_ncols, + S_diag_i[m], + S_offd_nnz); /* first put diagonal data in */ S_diag = hypre_ParCSRMatrixDiag(matS); @@ -5854,9 +4581,9 @@ hypre_ILUSetupILUT(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, /* now start to construct offdiag of S */ S_offd = hypre_ParCSRMatrixOffd(matS); - S_offd_i = hypre_TAlloc(HYPRE_Int, m+1, HYPRE_MEMORY_DEVICE); - S_offd_j = hypre_TAlloc(HYPRE_Int, S_offd_nnz, HYPRE_MEMORY_DEVICE); - S_offd_data = hypre_TAlloc(HYPRE_Real, S_offd_nnz, HYPRE_MEMORY_DEVICE); + S_offd_i = hypre_TAlloc(HYPRE_Int, m + 1, memory_location); + S_offd_j = hypre_TAlloc(HYPRE_Int, S_offd_nnz, memory_location); + S_offd_data = hypre_TAlloc(HYPRE_Real, S_offd_nnz, memory_location); S_offd_colmap = hypre_CTAlloc(HYPRE_BigInt, S_offd_ncols, HYPRE_MEMORY_HOST); /* simply use a loop to copy data from A_offd */ @@ -5870,13 +4597,13 @@ hypre_ILUSetupILUT(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, { col = perm[i + nI]; k1 = A_offd_i[col]; - k2 = A_offd_i[col+1]; + k2 = A_offd_i[col + 1]; for (j = k1; j < k2; j++) { S_offd_j[k3] = A_offd_j[j]; S_offd_data[k3++] = A_offd_data[j]; } - S_offd_i[i+e+1] = k3; + S_offd_i[i + e + 1] = k3; } /* give I, J, DATA to S_offd */ @@ -5888,13 +4615,13 @@ hypre_ILUSetupILUT(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, /* get total num of send */ num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - begin = hypre_ParCSRCommPkgSendMapStart(comm_pkg,0); - end = hypre_ParCSRCommPkgSendMapStart(comm_pkg,num_sends); + begin = hypre_ParCSRCommPkgSendMapStart(comm_pkg, 0); + end = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends); send_buf = hypre_TAlloc(HYPRE_BigInt, end - begin, HYPRE_MEMORY_HOST); /* copy new index into send_buf */ for (i = begin; i < end; i++) { - send_buf[i-begin] = rperm[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,i)] - nLU + col_starts[0]; + send_buf[i - begin] = rperm[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, i)] - nLU + col_starts[0]; } /* main communication */ @@ -5915,19 +4642,21 @@ hypre_ILUSetupILUT(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, for (k = nLU; k < n; k++) { /* set U after nLU to be 0, and diag to be one */ - U_diag_i[k+1] = U_diag_i[nLU]; + U_diag_i[k + 1] = U_diag_i[nLU]; D_data[k] = 1.; } /* create parcsr matrix */ matL = hypre_ParCSRMatrixCreate( comm, - hypre_ParCSRMatrixGlobalNumRows(A), - hypre_ParCSRMatrixGlobalNumRows(A), - hypre_ParCSRMatrixRowStarts(A), - hypre_ParCSRMatrixColStarts(A), - 0, - L_diag_i[n], - 0 ); + hypre_ParCSRMatrixGlobalNumRows(A), + hypre_ParCSRMatrixGlobalNumRows(A), + hypre_ParCSRMatrixRowStarts(A), + hypre_ParCSRMatrixColStarts(A), + 0, + L_diag_i[n], + 0 ); + hypre_CSRMatrixMemoryLocation(hypre_ParCSRMatrixDiag(matL)) = memory_location; + hypre_CSRMatrixMemoryLocation(hypre_ParCSRMatrixOffd(matL)) = memory_location; L_diag = hypre_ParCSRMatrixDiag(matL); hypre_CSRMatrixI(L_diag) = L_diag_i; @@ -5939,8 +4668,8 @@ hypre_ILUSetupILUT(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, else { /* we initialized some anyway, so remove if unused */ - hypre_TFree(L_diag_j,HYPRE_MEMORY_DEVICE); - hypre_TFree(L_diag_data,HYPRE_MEMORY_DEVICE); + hypre_TFree(L_diag_j, memory_location); + hypre_TFree(L_diag_data, memory_location); } /* store (global) total number of nonzeros */ local_nnz = (HYPRE_Real) (L_diag_i[n]); @@ -5948,13 +4677,15 @@ hypre_ILUSetupILUT(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, hypre_ParCSRMatrixDNumNonzeros(matL) = total_nnz; matU = hypre_ParCSRMatrixCreate( comm, - hypre_ParCSRMatrixGlobalNumRows(A), - hypre_ParCSRMatrixGlobalNumRows(A), - hypre_ParCSRMatrixRowStarts(A), - hypre_ParCSRMatrixColStarts(A), - 0, - U_diag_i[n], - 0 ); + hypre_ParCSRMatrixGlobalNumRows(A), + hypre_ParCSRMatrixGlobalNumRows(A), + hypre_ParCSRMatrixRowStarts(A), + hypre_ParCSRMatrixColStarts(A), + 0, + U_diag_i[n], + 0 ); + hypre_CSRMatrixMemoryLocation(hypre_ParCSRMatrixDiag(matU)) = memory_location; + hypre_CSRMatrixMemoryLocation(hypre_ParCSRMatrixOffd(matU)) = memory_location; U_diag = hypre_ParCSRMatrixDiag(matU); hypre_CSRMatrixI(U_diag) = U_diag_i; @@ -5966,8 +4697,8 @@ hypre_ILUSetupILUT(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, else { /* we initialized some anyway, so remove if unused */ - hypre_TFree(U_diag_j,HYPRE_MEMORY_DEVICE); - hypre_TFree(U_diag_data,HYPRE_MEMORY_DEVICE); + hypre_TFree(U_diag_j, memory_location); + hypre_TFree(U_diag_data, memory_location); } /* store (global) total number of nonzeros */ local_nnz = (HYPRE_Real) (U_diag_i[n]); @@ -5975,22 +4706,22 @@ hypre_ILUSetupILUT(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, hypre_ParCSRMatrixDNumNonzeros(matU) = total_nnz; /* free working array */ - hypre_TFree(iw,HYPRE_MEMORY_HOST); - hypre_TFree(w,HYPRE_MEMORY_HOST); + hypre_TFree(iw, HYPRE_MEMORY_HOST); + hypre_TFree(w, HYPRE_MEMORY_HOST); if (!matS) { - hypre_TFree(S_diag_i,HYPRE_MEMORY_DEVICE); + hypre_TFree(S_diag_i, memory_location); } if (!permp) { - hypre_TFree(perm, HYPRE_MEMORY_DEVICE); + hypre_TFree(perm, memory_location); } if (!qpermp) { - hypre_TFree(qperm, HYPRE_MEMORY_DEVICE); + hypre_TFree(qperm, memory_location); } /* set matrix pointers */ @@ -6003,9 +4734,10 @@ hypre_ILUSetupILUT(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_NSHSetup + *--------------------------------------------------------------------------*/ -/* NSH setup */ -/* Setup NSH data */ HYPRE_Int hypre_NSHSetup( void *nsh_vdata, hypre_ParCSRMatrix *A, @@ -6015,20 +4747,11 @@ hypre_NSHSetup( void *nsh_vdata, MPI_Comm comm = hypre_ParCSRMatrixComm(A); hypre_ParNSHData *nsh_data = (hypre_ParNSHData*) nsh_vdata; - // HYPRE_Int i; - // HYPRE_Int num_threads; - // HYPRE_Int debug_flag = 0; - - /* pointers to NSH data */ - HYPRE_Int logging = hypre_ParNSHDataLogging(nsh_data); - HYPRE_Int print_level = hypre_ParNSHDataPrintLevel(nsh_data); - + /* Pointers to NSH data */ + HYPRE_Int logging = hypre_ParNSHDataLogging(nsh_data); + HYPRE_Int print_level = hypre_ParNSHDataPrintLevel(nsh_data); hypre_ParCSRMatrix *matA = hypre_ParNSHDataMatA(nsh_data); hypre_ParCSRMatrix *matM = hypre_ParNSHDataMatM(nsh_data); - - // HYPRE_Int n = hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(A)); - HYPRE_Int num_procs, my_id; - hypre_ParVector *Utemp; hypre_ParVector *Ftemp; hypre_ParVector *F_array = hypre_ParNSHDataF(nsh_data); @@ -6036,140 +4759,122 @@ hypre_NSHSetup( void *nsh_vdata, hypre_ParVector *residual = hypre_ParNSHDataResidual(nsh_data); HYPRE_Real *rel_res_norms = hypre_ParNSHDataRelResNorms(nsh_data); - /* solver setting */ + /* Solver setting */ HYPRE_Real *droptol = hypre_ParNSHDataDroptol(nsh_data); - HYPRE_Real mr_tol = hypre_ParNSHDataMRTol(nsh_data); - HYPRE_Int mr_max_row_nnz = hypre_ParNSHDataMRMaxRowNnz(nsh_data); - HYPRE_Int mr_max_iter = hypre_ParNSHDataMRMaxIter(nsh_data); - HYPRE_Int mr_col_version = hypre_ParNSHDataMRColVersion(nsh_data); - HYPRE_Real nsh_tol = hypre_ParNSHDataNSHTol(nsh_data); - HYPRE_Int nsh_max_row_nnz = hypre_ParNSHDataNSHMaxRowNnz(nsh_data); - HYPRE_Int nsh_max_iter = hypre_ParNSHDataNSHMaxIter(nsh_data); - - /* ----- begin -----*/ - - //num_threads = hypre_NumThreads(); + HYPRE_Real mr_tol = hypre_ParNSHDataMRTol(nsh_data); + HYPRE_Int mr_max_row_nnz = hypre_ParNSHDataMRMaxRowNnz(nsh_data); + HYPRE_Int mr_max_iter = hypre_ParNSHDataMRMaxIter(nsh_data); + HYPRE_Int mr_col_version = hypre_ParNSHDataMRColVersion(nsh_data); + HYPRE_Real nsh_tol = hypre_ParNSHDataNSHTol(nsh_data); + HYPRE_Int nsh_max_row_nnz = hypre_ParNSHDataNSHMaxRowNnz(nsh_data); + HYPRE_Int nsh_max_iter = hypre_ParNSHDataNSHMaxIter(nsh_data); + HYPRE_Int num_procs, my_id; - hypre_MPI_Comm_size(comm,&num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); /* Free Previously allocated data, if any not destroyed */ - if (matM) - { - hypre_TFree(matM, HYPRE_MEMORY_HOST); - matM = NULL; - } - - /* clear old l1_norm data, if created */ - if (hypre_ParNSHDataL1Norms(nsh_data)) - { - hypre_TFree(hypre_ParNSHDataL1Norms(nsh_data), HYPRE_MEMORY_HOST); - hypre_ParNSHDataL1Norms(nsh_data) = NULL; - } - - /* setup temporary storage - * first check is they've already here - */ - if (hypre_ParNSHDataUTemp(nsh_data)) - { - hypre_ParVectorDestroy(hypre_ParNSHDataUTemp(nsh_data)); - hypre_ParNSHDataUTemp(nsh_data) = NULL; - } - if (hypre_ParNSHDataFTemp(nsh_data)) - { - hypre_ParVectorDestroy(hypre_ParNSHDataFTemp(nsh_data)); - hypre_ParNSHDataFTemp(nsh_data) = NULL; - } - if (hypre_ParNSHDataResidual(nsh_data)) - { - hypre_ParVectorDestroy(hypre_ParNSHDataResidual(nsh_data)); - hypre_ParNSHDataResidual(nsh_data) = NULL; - } - if (hypre_ParNSHDataRelResNorms(nsh_data)) - { - hypre_TFree(hypre_ParNSHDataRelResNorms(nsh_data), HYPRE_MEMORY_HOST); - hypre_ParNSHDataRelResNorms(nsh_data) = NULL; - } + hypre_TFree(matM, HYPRE_MEMORY_HOST); + hypre_TFree(hypre_ParNSHDataL1Norms(nsh_data), HYPRE_MEMORY_HOST); + hypre_ParVectorDestroy(hypre_ParNSHDataUTemp(nsh_data)); + hypre_ParVectorDestroy(hypre_ParNSHDataFTemp(nsh_data)); + hypre_ParVectorDestroy(hypre_ParNSHDataResidual(nsh_data)); + hypre_TFree(hypre_ParNSHDataRelResNorms(nsh_data), HYPRE_MEMORY_HOST); + + matM = NULL; + hypre_ParNSHDataL1Norms(nsh_data) = NULL; + hypre_ParNSHDataUTemp(nsh_data) = NULL; + hypre_ParNSHDataFTemp(nsh_data) = NULL; + hypre_ParNSHDataResidual(nsh_data) = NULL; + hypre_ParNSHDataRelResNorms(nsh_data) = NULL; /* start to create working vectors */ Utemp = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A), - hypre_ParCSRMatrixGlobalNumRows(A), - hypre_ParCSRMatrixRowStarts(A)); + hypre_ParCSRMatrixGlobalNumRows(A), + hypre_ParCSRMatrixRowStarts(A)); hypre_ParVectorInitialize(Utemp); hypre_ParNSHDataUTemp(nsh_data) = Utemp; Ftemp = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A), - hypre_ParCSRMatrixGlobalNumRows(A), - hypre_ParCSRMatrixRowStarts(A)); + hypre_ParCSRMatrixGlobalNumRows(A), + hypre_ParCSRMatrixRowStarts(A)); hypre_ParVectorInitialize(Ftemp); hypre_ParNSHDataFTemp(nsh_data) = Ftemp; - /* set matrix, solution and rhs pointers */ + + /* Set matrix, solution and rhs pointers */ matA = A; F_array = f; U_array = u; /* NSH compute approximate inverse, see par_ilu.c */ - hypre_ILUParCSRInverseNSH(matA, &matM, droptol, mr_tol, nsh_tol, DIVIDE_TOL, mr_max_row_nnz, - nsh_max_row_nnz, mr_max_iter, nsh_max_iter, mr_col_version, print_level); + hypre_ILUParCSRInverseNSH(matA, &matM, droptol, mr_tol, nsh_tol, HYPRE_REAL_MIN, + mr_max_row_nnz, nsh_max_row_nnz, mr_max_iter, nsh_max_iter, + mr_col_version, print_level); - /* set pointers to NSH data */ + /* Set pointers to NSH data */ hypre_ParNSHDataMatA(nsh_data) = matA; - hypre_ParNSHDataF(nsh_data) = F_array; - hypre_ParNSHDataU(nsh_data) = U_array; + hypre_ParNSHDataF(nsh_data) = F_array; + hypre_ParNSHDataU(nsh_data) = U_array; hypre_ParNSHDataMatM(nsh_data) = matM; - /* compute operator complexity */ + /* Compute operator complexity */ hypre_ParCSRMatrixSetDNumNonzeros(matA); hypre_ParCSRMatrixSetDNumNonzeros(matM); - /* compute complexity */ - hypre_ParNSHDataOperatorComplexity(nsh_data) = hypre_ParCSRMatrixDNumNonzeros(matM)/hypre_ParCSRMatrixDNumNonzeros(matA); - if (my_id == 0) + + /* Compute complexity */ + hypre_ParNSHDataOperatorComplexity(nsh_data) = hypre_ParCSRMatrixDNumNonzeros(matM) / + hypre_ParCSRMatrixDNumNonzeros(matA); + if (my_id == 0 && print_level > 0) { - hypre_printf("NSH SETUP: operator complexity = %f \n", hypre_ParNSHDataOperatorComplexity(nsh_data)); + hypre_printf("NSH SETUP: operator complexity = %f \n", + hypre_ParNSHDataOperatorComplexity(nsh_data)); } - if ( logging > 1 ) { - residual = - hypre_ParVectorCreate(hypre_ParCSRMatrixComm(matA), - hypre_ParCSRMatrixGlobalNumRows(matA), - hypre_ParCSRMatrixRowStarts(matA) ); + if (logging > 1) + { + residual = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(matA), + hypre_ParCSRMatrixGlobalNumRows(matA), + hypre_ParCSRMatrixRowStarts(matA)); hypre_ParVectorInitialize(residual); - hypre_ParNSHDataResidual(nsh_data)= residual; + hypre_ParNSHDataResidual(nsh_data) = residual; } - else{ + else + { hypre_ParNSHDataResidual(nsh_data) = NULL; } - rel_res_norms = hypre_CTAlloc(HYPRE_Real, hypre_ParNSHDataMaxIter(nsh_data), HYPRE_MEMORY_HOST); + + rel_res_norms = hypre_CTAlloc(HYPRE_Real, hypre_ParNSHDataMaxIter(nsh_data), + HYPRE_MEMORY_HOST); hypre_ParNSHDataRelResNorms(nsh_data) = rel_res_norms; return hypre_error_flag; } - -/* ILU(0) for RAS, has some external rows +/*-------------------------------------------------------------------------- + * hypre_ILUSetupILU0RAS + * + * ILU(0) for RAS, has some external rows + * * A = input matrix - * perm = permutation array indicating ordering of factorization. Perm could come from a - * CF_marker array or a reordering routine. + * perm = permutation array indicating ordering of factorization. + * Perm could come from a CF_marker array or a reordering routine. * nLU = size of computed LDU factorization. * Lptr, Dptr, Uptr, Sptr = L, D, U, S factors. * will form global Schur Matrix if nLU < n - */ + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUSetupILU0RAS(hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int nLU, - hypre_ParCSRMatrix **Lptr, HYPRE_Real** Dptr, hypre_ParCSRMatrix **Uptr) +hypre_ILUSetupILU0RAS(hypre_ParCSRMatrix *A, + HYPRE_Int *perm, + HYPRE_Int nLU, + hypre_ParCSRMatrix **Lptr, + HYPRE_Real **Dptr, + hypre_ParCSRMatrix **Uptr) { - HYPRE_Int i, ii, j, k, k1, k2, ctrU, ctrL, lenl, lenu, jpiv, col, jpos; - HYPRE_Int *iw, *iL, *iU; - HYPRE_Real dd, t, dpiv, lxu, *wU, *wL; - /* communication stuffs for S */ MPI_Comm comm = hypre_ParCSRMatrixComm(A); HYPRE_Int num_procs; - // HYPRE_Int S_offd_nnz, S_offd_ncols; hypre_ParCSRCommPkg *comm_pkg; - // hypre_ParCSRCommHandle *comm_handle; - // HYPRE_Int num_sends, begin, end; - // HYPRE_Int *send_buf = NULL; /* data objects for A */ hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); @@ -6180,10 +4885,10 @@ hypre_ILUSetupILU0RAS(hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int nLU, HYPRE_Real *A_offd_data = hypre_CSRMatrixData(A_offd); HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); + HYPRE_MemoryLocation memory_location = hypre_ParCSRMatrixMemoryLocation(A); /* size of problem and external matrix */ HYPRE_Int n = hypre_CSRMatrixNumRows(A_diag); - // HYPRE_Int m = n - nLU; HYPRE_Int ext = hypre_CSRMatrixNumCols(A_offd); HYPRE_Int total_rows = n + ext; HYPRE_BigInt col_starts[2]; @@ -6216,15 +4921,21 @@ hypre_ILUSetupILU0RAS(hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int nLU, /* reverse permutation array */ HYPRE_Int *rperm; + /* the original permutation array */ HYPRE_Int *perm_old; + HYPRE_Int i, ii, j, k, k1, k2, ctrU, ctrL, lenl, lenu, jpiv, col, jpos; + HYPRE_Int *iw, *iL, *iU; + HYPRE_Real dd, t, dpiv, lxu, *wU, *wL; + /* start setup * get communication stuffs first */ - hypre_MPI_Comm_size(comm,&num_procs); + hypre_MPI_Comm_size(comm, &num_procs); comm_pkg = hypre_ParCSRMatrixCommPkg(A); - /* setup if not yet built */ + + /* Setup if not yet built */ if (!comm_pkg) { hypre_MatvecCommPkgCreate(A); @@ -6234,34 +4945,35 @@ hypre_ILUSetupILU0RAS(hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int nLU, /* check for correctness */ if (nLU < 0 || nLU > n) { - hypre_error_w_msg(HYPRE_ERROR_ARG,"WARNING: nLU out of range.\n"); + hypre_error_w_msg(HYPRE_ERROR_ARG, "WARNING: nLU out of range.\n"); } /* Allocate memory for L,D,U,S factors */ if (n > 0) { - initial_alloc = (n + ext) + ceil((nnz_A / 2.0)*total_rows/n); + initial_alloc = (HYPRE_Int)((n + ext) + hypre_ceil((nnz_A / 2.0) * total_rows / n)); } capacity_L = initial_alloc; capacity_U = initial_alloc; - D_data = hypre_TAlloc(HYPRE_Real, total_rows, HYPRE_MEMORY_DEVICE); - L_diag_i = hypre_TAlloc(HYPRE_Int, total_rows+1, HYPRE_MEMORY_DEVICE); - L_diag_j = hypre_TAlloc(HYPRE_Int, capacity_L, HYPRE_MEMORY_DEVICE); - L_diag_data = hypre_TAlloc(HYPRE_Real, capacity_L, HYPRE_MEMORY_DEVICE); - U_diag_i = hypre_TAlloc(HYPRE_Int, total_rows+1, HYPRE_MEMORY_DEVICE); - U_diag_j = hypre_TAlloc(HYPRE_Int, capacity_U, HYPRE_MEMORY_DEVICE); - U_diag_data = hypre_TAlloc(HYPRE_Real, capacity_U, HYPRE_MEMORY_DEVICE); + D_data = hypre_TAlloc(HYPRE_Real, total_rows, memory_location); + L_diag_i = hypre_TAlloc(HYPRE_Int, total_rows + 1, memory_location); + L_diag_j = hypre_TAlloc(HYPRE_Int, capacity_L, memory_location); + L_diag_data = hypre_TAlloc(HYPRE_Real, capacity_L, memory_location); + U_diag_i = hypre_TAlloc(HYPRE_Int, total_rows + 1, memory_location); + U_diag_j = hypre_TAlloc(HYPRE_Int, capacity_U, memory_location); + U_diag_data = hypre_TAlloc(HYPRE_Real, capacity_U, memory_location); /* allocate working arrays */ - iw = hypre_TAlloc(HYPRE_Int, 4*total_rows, HYPRE_MEMORY_HOST); - iL = iw+total_rows; + iw = hypre_TAlloc(HYPRE_Int, 4 * total_rows, HYPRE_MEMORY_HOST); + iL = iw + total_rows; rperm = iw + 2 * total_rows; perm_old = perm; perm = iw + 3 * total_rows; wL = hypre_TAlloc(HYPRE_Real, total_rows, HYPRE_MEMORY_HOST); ctrU = ctrL = 0; L_diag_i[0] = U_diag_i[0] = 0; + /* set marker array iw to -1 */ for (i = 0; i < total_rows; i++) { @@ -6297,12 +5009,12 @@ hypre_ILUSetupILU0RAS(hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int nLU, // get row i i = perm[ii]; // get extents of row i - k1=A_diag_i[i]; - k2=A_diag_i[i+1]; + k1 = A_diag_i[i]; + k2 = A_diag_i[i + 1]; /*-------------------- unpack L & U-parts of row of A in arrays w */ - iU = iL+ii; - wU = wL+ii; + iU = iL + ii; + wU = wL + ii; /*-------------------- diagonal entry */ dd = 0.0; lenl = lenu = 0; @@ -6326,7 +5038,7 @@ hypre_ILUSetupILU0RAS(hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int nLU, } else { - dd=t; + dd = t; } } @@ -6338,7 +5050,7 @@ hypre_ILUSetupILU0RAS(hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int nLU, * entering the elimination loop. *-----------------------------------------------------------------------*/ // hypre_quickSortIR(iL, wL, iw, 0, (lenl-1)); - hypre_qsort3ir(iL, wL, iw, 0, (lenl-1)); + hypre_qsort3ir(iL, wL, iw, 0, (lenl - 1)); for (j = 0; j < lenl; j++) { jpiv = iL[j]; @@ -6350,7 +5062,7 @@ hypre_ILUSetupILU0RAS(hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int nLU, /* zero out element - reset pivot */ iw[jpiv] = -1; /* combine current row and pivot row */ - for (k = U_diag_i[jpiv]; k < U_diag_i[jpiv+1]; k++) + for (k = U_diag_i[jpiv]; k < U_diag_i[jpiv + 1]; k++) { col = U_diag_j[k]; jpos = iw[col]; @@ -6389,44 +5101,40 @@ hypre_ILUSetupILU0RAS(hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int nLU, /* Update LDU factors */ /* L part */ /* Check that memory is sufficient */ - while ((ctrL+lenl) > capacity_L) + while ((ctrL + lenl) > capacity_L) { HYPRE_Int tmp = capacity_L; - capacity_L = capacity_L * EXPAND_FACT + 1; - L_diag_j = hypre_TReAlloc_v2(L_diag_j, HYPRE_Int, tmp, HYPRE_Int, capacity_L, HYPRE_MEMORY_DEVICE); - L_diag_data = hypre_TReAlloc_v2(L_diag_data, HYPRE_Real, tmp, HYPRE_Real, capacity_L, HYPRE_MEMORY_DEVICE); - } - //hypre_TMemcpy(&(L_diag_j)[ctrL], iL, HYPRE_Int, lenl, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - //hypre_TMemcpy(&(L_diag_data)[ctrL], wL, HYPRE_Real, lenl, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - hypre_TMemcpy(&(L_diag_j)[ctrL], iL, HYPRE_Int, lenl, - HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); - hypre_TMemcpy(&(L_diag_data)[ctrL], wL, HYPRE_Real, lenl, - HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); - L_diag_i[ii+1] = (ctrL+=lenl); + capacity_L = (HYPRE_Int)(capacity_L * EXPAND_FACT + 1); + L_diag_j = hypre_TReAlloc_v2(L_diag_j, HYPRE_Int, tmp, + HYPRE_Int, capacity_L, memory_location); + L_diag_data = hypre_TReAlloc_v2(L_diag_data, HYPRE_Real, tmp, + HYPRE_Real, capacity_L, memory_location); + } + hypre_TMemcpy(&(L_diag_j)[ctrL], iL, HYPRE_Int, lenl, memory_location, HYPRE_MEMORY_HOST); + hypre_TMemcpy(&(L_diag_data)[ctrL], wL, HYPRE_Real, lenl, memory_location, HYPRE_MEMORY_HOST); + L_diag_i[ii + 1] = (ctrL += lenl); /* diagonal part (we store the inverse) */ - if (fabs(dd) < MAT_TOL) + if (hypre_abs(dd) < MAT_TOL) { dd = 1.0e-6; } - D_data[ii] = 1./dd; + D_data[ii] = 1. / dd; /* U part */ /* Check that memory is sufficient */ - while ((ctrU+lenu) > capacity_U) + while ((ctrU + lenu) > capacity_U) { HYPRE_Int tmp = capacity_U; - capacity_U = capacity_U * EXPAND_FACT + 1; - U_diag_j = hypre_TReAlloc_v2(U_diag_j, HYPRE_Int, tmp, HYPRE_Int, capacity_U, HYPRE_MEMORY_DEVICE); - U_diag_data = hypre_TReAlloc_v2(U_diag_data, HYPRE_Real, tmp, HYPRE_Real, capacity_U, HYPRE_MEMORY_DEVICE); + capacity_U = (HYPRE_Int)(capacity_U * EXPAND_FACT + 1); + U_diag_j = hypre_TReAlloc_v2(U_diag_j, HYPRE_Int, tmp, + HYPRE_Int, capacity_U, memory_location); + U_diag_data = hypre_TReAlloc_v2(U_diag_data, HYPRE_Real, tmp, + HYPRE_Real, capacity_U, memory_location); } - //hypre_TMemcpy(&(U_diag_j)[ctrU], iU, HYPRE_Int, lenu, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - //hypre_TMemcpy(&(U_diag_data)[ctrU], wU, HYPRE_Real, lenu, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - hypre_TMemcpy(&(U_diag_j)[ctrU], iU, HYPRE_Int, lenu, - HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); - hypre_TMemcpy(&(U_diag_data)[ctrU], wU, HYPRE_Real, lenu, - HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); - U_diag_i[ii+1] = (ctrU+=lenu); + hypre_TMemcpy(&(U_diag_j)[ctrU], iU, HYPRE_Int, lenu, memory_location, HYPRE_MEMORY_HOST); + hypre_TMemcpy(&(U_diag_data)[ctrU], wU, HYPRE_Real, lenu, memory_location, HYPRE_MEMORY_HOST); + U_diag_i[ii + 1] = (ctrU += lenu); } /*--------- Begin Factorization in lower part ---- @@ -6437,12 +5145,12 @@ hypre_ILUSetupILU0RAS(hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int nLU, // get row i i = perm[ii]; // get extents of row i - k1=A_diag_i[i]; - k2=A_diag_i[i+1]; + k1 = A_diag_i[i]; + k2 = A_diag_i[i + 1]; /*-------------------- unpack L & U-parts of row of A in arrays w */ - iU = iL+ii; - wU = wL+ii; + iU = iL + ii; + wU = wL + ii; /*-------------------- diagonal entry */ dd = 0.0; lenl = lenu = 0; @@ -6466,13 +5174,13 @@ hypre_ILUSetupILU0RAS(hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int nLU, } else { - dd=t; + dd = t; } } /*------------------ sjcan offd*/ - k1=A_offd_i[i]; - k2=A_offd_i[i+1]; + k1 = A_offd_i[i]; + k2 = A_offd_i[i + 1]; for (j = k1; j < k2; j++) { /* add offd to U part, all offd are U for this part */ @@ -6491,7 +5199,7 @@ hypre_ILUSetupILU0RAS(hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int nLU, * entering the elimination loop. *-----------------------------------------------------------------------*/ // hypre_quickSortIR(iL, wL, iw, 0, (lenl-1)); - hypre_qsort3ir(iL, wL, iw, 0, (lenl-1)); + hypre_qsort3ir(iL, wL, iw, 0, (lenl - 1)); for (j = 0; j < lenl; j++) { jpiv = iL[j]; @@ -6503,7 +5211,7 @@ hypre_ILUSetupILU0RAS(hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int nLU, /* zero out element - reset pivot */ iw[jpiv] = -1; /* combine current row and pivot row */ - for (k = U_diag_i[jpiv]; k < U_diag_i[jpiv+1]; k++) + for (k = U_diag_i[jpiv]; k < U_diag_i[jpiv + 1]; k++) { col = U_diag_j[k]; jpos = iw[col]; @@ -6542,44 +5250,40 @@ hypre_ILUSetupILU0RAS(hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int nLU, /* Update LDU factors */ /* L part */ /* Check that memory is sufficient */ - while ((ctrL+lenl) > capacity_L) + while ((ctrL + lenl) > capacity_L) { HYPRE_Int tmp = capacity_L; - capacity_L = capacity_L * EXPAND_FACT + 1; - L_diag_j = hypre_TReAlloc_v2(L_diag_j, HYPRE_Int, tmp, HYPRE_Int, capacity_L, HYPRE_MEMORY_DEVICE); - L_diag_data = hypre_TReAlloc_v2(L_diag_data, HYPRE_Real, tmp, HYPRE_Real, capacity_L, HYPRE_MEMORY_DEVICE); - } - //hypre_TMemcpy(&(L_diag_j)[ctrL], iL, HYPRE_Int, lenl, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - //hypre_TMemcpy(&(L_diag_data)[ctrL], wL, HYPRE_Real, lenl, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - hypre_TMemcpy(&(L_diag_j)[ctrL], iL, HYPRE_Int, lenl, - HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); - hypre_TMemcpy(&(L_diag_data)[ctrL], wL, HYPRE_Real, lenl, - HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); - L_diag_i[ii+1] = (ctrL+=lenl); + capacity_L = (HYPRE_Int)(capacity_L * EXPAND_FACT + 1); + L_diag_j = hypre_TReAlloc_v2(L_diag_j, HYPRE_Int, tmp, + HYPRE_Int, capacity_L, memory_location); + L_diag_data = hypre_TReAlloc_v2(L_diag_data, HYPRE_Real, tmp, + HYPRE_Real, capacity_L, memory_location); + } + hypre_TMemcpy(&(L_diag_j)[ctrL], iL, HYPRE_Int, lenl, memory_location, HYPRE_MEMORY_HOST); + hypre_TMemcpy(&(L_diag_data)[ctrL], wL, HYPRE_Real, lenl, memory_location, HYPRE_MEMORY_HOST); + L_diag_i[ii + 1] = (ctrL += lenl); /* diagonal part (we store the inverse) */ - if (fabs(dd) < MAT_TOL) + if (hypre_abs(dd) < MAT_TOL) { dd = 1.0e-6; } - D_data[ii] = 1./dd; + D_data[ii] = 1. / dd; /* U part */ /* Check that memory is sufficient */ - while ((ctrU+lenu) > capacity_U) + while ((ctrU + lenu) > capacity_U) { HYPRE_Int tmp = capacity_U; - capacity_U = capacity_U * EXPAND_FACT + 1; - U_diag_j = hypre_TReAlloc_v2(U_diag_j, HYPRE_Int, tmp, HYPRE_Int, capacity_U, HYPRE_MEMORY_DEVICE); - U_diag_data = hypre_TReAlloc_v2(U_diag_data, HYPRE_Real, tmp, HYPRE_Real, capacity_U, HYPRE_MEMORY_DEVICE); + capacity_U = (HYPRE_Int)(capacity_U * EXPAND_FACT + 1); + U_diag_j = hypre_TReAlloc_v2(U_diag_j, HYPRE_Int, tmp, + HYPRE_Int, capacity_U, memory_location); + U_diag_data = hypre_TReAlloc_v2(U_diag_data, HYPRE_Real, tmp, + HYPRE_Real, capacity_U, memory_location); } - //hypre_TMemcpy(&(U_diag_j)[ctrU], iU, HYPRE_Int, lenu, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - //hypre_TMemcpy(&(U_diag_data)[ctrU], wU, HYPRE_Real, lenu, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - hypre_TMemcpy(&(U_diag_j)[ctrU], iU, HYPRE_Int, lenu, - HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); - hypre_TMemcpy(&(U_diag_data)[ctrU], wU, HYPRE_Real, lenu, - HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); - U_diag_i[ii+1] = (ctrU+=lenu); + hypre_TMemcpy(&(U_diag_j)[ctrU], iU, HYPRE_Int, lenu, memory_location, HYPRE_MEMORY_HOST); + hypre_TMemcpy(&(U_diag_data)[ctrU], wU, HYPRE_Real, lenu, memory_location, HYPRE_MEMORY_HOST); + U_diag_i[ii + 1] = (ctrU += lenu); } /*--------- Begin Factorization in external part ---- @@ -6588,14 +5292,14 @@ hypre_ILUSetupILU0RAS(hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int nLU, for (ii = n ; ii < total_rows ; ii++) { // get row i - i = ii-n; + i = ii - n; // get extents of row i - k1=E_i[i]; - k2=E_i[i+1]; + k1 = E_i[i]; + k2 = E_i[i + 1]; /*-------------------- unpack L & U-parts of row of A in arrays w */ - iU = iL+ii; - wU = wL+ii; + iU = iL + ii; + wU = wL + ii; /*-------------------- diagonal entry */ dd = 0.0; lenl = lenu = 0; @@ -6619,7 +5323,7 @@ hypre_ILUSetupILU0RAS(hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int nLU, } else { - dd=t; + dd = t; } } @@ -6631,7 +5335,7 @@ hypre_ILUSetupILU0RAS(hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int nLU, * entering the elimination loop. *-----------------------------------------------------------------------*/ // hypre_quickSortIR(iL, wL, iw, 0, (lenl-1)); - hypre_qsort3ir(iL, wL, iw, 0, (lenl-1)); + hypre_qsort3ir(iL, wL, iw, 0, (lenl - 1)); for (j = 0; j < lenl; j++) { jpiv = iL[j]; @@ -6643,7 +5347,7 @@ hypre_ILUSetupILU0RAS(hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int nLU, /* zero out element - reset pivot */ iw[jpiv] = -1; /* combine current row and pivot row */ - for (k = U_diag_i[jpiv]; k < U_diag_i[jpiv+1]; k++) + for (k = U_diag_i[jpiv]; k < U_diag_i[jpiv + 1]; k++) { col = U_diag_j[k]; jpos = iw[col]; @@ -6682,44 +5386,40 @@ hypre_ILUSetupILU0RAS(hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int nLU, /* Update LDU factors */ /* L part */ /* Check that memory is sufficient */ - while ((ctrL+lenl) > capacity_L) + while ((ctrL + lenl) > capacity_L) { HYPRE_Int tmp = capacity_L; - capacity_L = capacity_L * EXPAND_FACT + 1; - L_diag_j = hypre_TReAlloc_v2(L_diag_j, HYPRE_Int, tmp, HYPRE_Int, capacity_L, HYPRE_MEMORY_DEVICE); - L_diag_data = hypre_TReAlloc_v2(L_diag_data, HYPRE_Real, tmp, HYPRE_Real, capacity_L, HYPRE_MEMORY_DEVICE); - } - //hypre_TMemcpy(&(L_diag_j)[ctrL], iL, HYPRE_Int, lenl, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - //hypre_TMemcpy(&(L_diag_data)[ctrL], wL, HYPRE_Real, lenl, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - hypre_TMemcpy(&(L_diag_j)[ctrL], iL, HYPRE_Int, lenl, - HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); - hypre_TMemcpy(&(L_diag_data)[ctrL], wL, HYPRE_Real, lenl, - HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); - L_diag_i[ii+1] = (ctrL+=lenl); + capacity_L = (HYPRE_Int)(capacity_L * EXPAND_FACT + 1); + L_diag_j = hypre_TReAlloc_v2(L_diag_j, HYPRE_Int, tmp, + HYPRE_Int, capacity_L, memory_location); + L_diag_data = hypre_TReAlloc_v2(L_diag_data, HYPRE_Real, tmp, + HYPRE_Real, capacity_L, memory_location); + } + hypre_TMemcpy(&(L_diag_j)[ctrL], iL, HYPRE_Int, lenl, memory_location, HYPRE_MEMORY_HOST); + hypre_TMemcpy(&(L_diag_data)[ctrL], wL, HYPRE_Real, lenl, memory_location, HYPRE_MEMORY_HOST); + L_diag_i[ii + 1] = (ctrL += lenl); /* diagonal part (we store the inverse) */ - if (fabs(dd) < MAT_TOL) + if (hypre_abs(dd) < MAT_TOL) { dd = 1.0e-6; } - D_data[ii] = 1./dd; + D_data[ii] = 1. / dd; /* U part */ /* Check that memory is sufficient */ - while ((ctrU+lenu) > capacity_U) + while ((ctrU + lenu) > capacity_U) { HYPRE_Int tmp = capacity_U; - capacity_U = capacity_U * EXPAND_FACT + 1; - U_diag_j = hypre_TReAlloc_v2(U_diag_j, HYPRE_Int, tmp, HYPRE_Int, capacity_U, HYPRE_MEMORY_DEVICE); - U_diag_data = hypre_TReAlloc_v2(U_diag_data, HYPRE_Real, tmp, HYPRE_Real, capacity_U, HYPRE_MEMORY_DEVICE); + capacity_U = (HYPRE_Int)(capacity_U * EXPAND_FACT + 1); + U_diag_j = hypre_TReAlloc_v2(U_diag_j, HYPRE_Int, tmp, + HYPRE_Int, capacity_U, memory_location); + U_diag_data = hypre_TReAlloc_v2(U_diag_data, HYPRE_Real, tmp, + HYPRE_Real, capacity_U, memory_location); } - //hypre_TMemcpy(&(U_diag_j)[ctrU], iU, HYPRE_Int, lenu, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - //hypre_TMemcpy(&(U_diag_data)[ctrU], wU, HYPRE_Real, lenu, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - hypre_TMemcpy(&(U_diag_j)[ctrU], iU, HYPRE_Int, lenu, - HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); - hypre_TMemcpy(&(U_diag_data)[ctrU], wU, HYPRE_Real, lenu, - HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); - U_diag_i[ii+1] = (ctrU+=lenu); + hypre_TMemcpy(&(U_diag_j)[ctrU], iU, HYPRE_Int, lenu, memory_location, HYPRE_MEMORY_HOST); + hypre_TMemcpy(&(U_diag_data)[ctrU], wU, HYPRE_Real, lenu, memory_location, HYPRE_MEMORY_HOST); + U_diag_i[ii + 1] = (ctrU += lenu); } HYPRE_BigInt big_total_rows = (HYPRE_BigInt)total_rows; @@ -6728,19 +5428,19 @@ hypre_ILUSetupILU0RAS(hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int nLU, /* need to get new column start */ { HYPRE_BigInt global_start; - hypre_MPI_Scan( &big_total_rows, &global_start, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); + hypre_MPI_Scan(&big_total_rows, &global_start, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); col_starts[0] = global_start - total_rows; col_starts[1] = global_start; } matL = hypre_ParCSRMatrixCreate( comm, - global_num_rows, - global_num_rows, - col_starts, - col_starts, - 0, - ctrL, - 0 ); + global_num_rows, + global_num_rows, + col_starts, + col_starts, + 0, + ctrL, + 0 ); L_diag = hypre_ParCSRMatrixDiag(matL); hypre_CSRMatrixI(L_diag) = L_diag_i; @@ -6752,8 +5452,8 @@ hypre_ILUSetupILU0RAS(hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int nLU, else { /* we've allocated some memory, so free if not used */ - hypre_TFree(L_diag_j,HYPRE_MEMORY_DEVICE); - hypre_TFree(L_diag_data,HYPRE_MEMORY_DEVICE); + hypre_TFree(L_diag_j, memory_location); + hypre_TFree(L_diag_data, memory_location); } /* store (global) total number of nonzeros */ local_nnz = (HYPRE_Real) ctrL; @@ -6761,13 +5461,13 @@ hypre_ILUSetupILU0RAS(hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int nLU, hypre_ParCSRMatrixDNumNonzeros(matL) = total_nnz; matU = hypre_ParCSRMatrixCreate( comm, - global_num_rows, - global_num_rows, - col_starts, - col_starts, - 0, - ctrU, - 0 ); + global_num_rows, + global_num_rows, + col_starts, + col_starts, + 0, + ctrU, + 0 ); U_diag = hypre_ParCSRMatrixDiag(matU); hypre_CSRMatrixI(U_diag) = U_diag_i; @@ -6779,16 +5479,16 @@ hypre_ILUSetupILU0RAS(hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int nLU, else { /* we've allocated some memory, so free if not used */ - hypre_TFree(U_diag_j,HYPRE_MEMORY_DEVICE); - hypre_TFree(U_diag_data,HYPRE_MEMORY_DEVICE); + hypre_TFree(U_diag_j, memory_location); + hypre_TFree(U_diag_data, memory_location); } /* store (global) total number of nonzeros */ local_nnz = (HYPRE_Real) ctrU; hypre_MPI_Allreduce(&local_nnz, &total_nnz, 1, HYPRE_MPI_REAL, hypre_MPI_SUM, comm); hypre_ParCSRMatrixDNumNonzeros(matU) = total_nnz; /* free memory */ - hypre_TFree(wL,HYPRE_MEMORY_HOST); - hypre_TFree(iw,HYPRE_MEMORY_HOST); + hypre_TFree(wL, HYPRE_MEMORY_HOST); + hypre_TFree(iw, HYPRE_MEMORY_HOST); /* free external data */ if (E_i) @@ -6809,26 +5509,41 @@ hypre_ILUSetupILU0RAS(hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int nLU, return hypre_error_flag; } - - -/* ILU(k) symbolic factorization for RAS +/*-------------------------------------------------------------------------- + * hypre_ILUSetupILUKRASSymbolic + * + * ILU(k) symbolic factorization for RAS + * * n = total rows of input * lfil = level of fill-in, the k in ILU(k) - * perm = permutation array indicating ordering of factorization. Perm could come from a + * perm = permutation array indicating ordering of factorization. * rperm = reverse permutation array, used here to avoid duplicate memory allocation * iw = working array, used here to avoid duplicate memory allocation * nLU = size of computed LDU factorization. * A/L/U/E_i = the I slot of A, L, U and E * A/L/U/E_j = the J slot of A, L, U and E - * will form global Schur Matrix if nLU < n - */ + * + * Will form global Schur Matrix if nLU < n + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUSetupILUKRASSymbolic(HYPRE_Int n, HYPRE_Int *A_diag_i, HYPRE_Int *A_diag_j, HYPRE_Int *A_offd_i, HYPRE_Int *A_offd_j, - HYPRE_Int *E_i, HYPRE_Int *E_j, HYPRE_Int ext, - HYPRE_Int lfil, HYPRE_Int *perm, - HYPRE_Int *rperm, HYPRE_Int *iw, HYPRE_Int nLU, - HYPRE_Int *L_diag_i, HYPRE_Int *U_diag_i, - HYPRE_Int **L_diag_j, HYPRE_Int **U_diag_j) +hypre_ILUSetupILUKRASSymbolic(HYPRE_Int n, + HYPRE_Int *A_diag_i, + HYPRE_Int *A_diag_j, + HYPRE_Int *A_offd_i, + HYPRE_Int *A_offd_j, + HYPRE_Int *E_i, + HYPRE_Int *E_j, + HYPRE_Int ext, + HYPRE_Int lfil, + HYPRE_Int *perm, + HYPRE_Int *rperm, + HYPRE_Int *iw, + HYPRE_Int nLU, + HYPRE_Int *L_diag_i, + HYPRE_Int *U_diag_i, + HYPRE_Int **L_diag_j, + HYPRE_Int **U_diag_j) { /* * 1: Setup and create buffers @@ -6855,23 +5570,27 @@ hypre_ILUSetupILUKRASSymbolic(HYPRE_Int n, HYPRE_Int *A_diag_i, HYPRE_Int *A_dia HYPRE_Int capacity_U; HYPRE_Int initial_alloc = 0; HYPRE_Int nnz_A; + HYPRE_MemoryLocation memory_location; + + /* Get default memory location */ + HYPRE_GetMemoryLocation(&memory_location); /* set iL and iLev to right place in iw array */ iL = iw + total_rows; - iLev = iw + 2*total_rows; + iLev = iw + 2 * total_rows; /* setup initial memory used */ nnz_A = A_diag_i[n]; if (n > 0) { - initial_alloc = (n + ext) + ceil((nnz_A / 2.0) * total_rows / n); + initial_alloc = (HYPRE_Int)((n + ext) + hypre_ceil((nnz_A / 2.0) * total_rows / n)); } capacity_L = initial_alloc; capacity_U = initial_alloc; /* allocate other memory for L and U struct */ - temp_L_diag_j = hypre_CTAlloc(HYPRE_Int, capacity_L, HYPRE_MEMORY_DEVICE); - temp_U_diag_j = hypre_CTAlloc(HYPRE_Int, capacity_U, HYPRE_MEMORY_DEVICE); + temp_L_diag_j = hypre_CTAlloc(HYPRE_Int, capacity_L, memory_location); + temp_U_diag_j = hypre_CTAlloc(HYPRE_Int, capacity_U, memory_location); u_levels = hypre_CTAlloc(HYPRE_Int, capacity_U, HYPRE_MEMORY_HOST); ctrL = ctrU = 0; @@ -6892,7 +5611,7 @@ hypre_ILUSetupILUKRASSymbolic(HYPRE_Int n, HYPRE_Int *A_diag_i, HYPRE_Int *A_dia lenl = 0; lenh = 0;/* this is the current length of heap */ lenu = ii; - lena = A_diag_i[i+1]; + lena = A_diag_i[i + 1]; /* put those already inside original pattern, and set their level to 0 */ for (j = A_diag_i[i]; j < lena; j++) { @@ -6908,7 +5627,7 @@ hypre_ILUSetupILUKRASSymbolic(HYPRE_Int n, HYPRE_Int *A_diag_i, HYPRE_Int *A_dia iLev[lenh] = 0; iw[col] = lenh++; /*now miantian a heap structure*/ - hypre_ILUMinHeapAddIIIi(iL,iLev,iw,lenh); + hypre_ILUMinHeapAddIIIi(iL, iLev, iw, lenh); } else if (col > ii) { @@ -6933,18 +5652,18 @@ hypre_ILUSetupILUKRASSymbolic(HYPRE_Int n, HYPRE_Int *A_diag_i, HYPRE_Int *A_dia /* * we now need to maintain the heap structure */ - hypre_ILUMinHeapRemoveIIIi(iL,iLev,iw,lenh); + hypre_ILUMinHeapRemoveIIIi(iL, iLev, iw, lenh); lenh--; /* copy to the end of array */ lenl++; /* reset iw for that, not using anymore */ - iw[k]=-1; - hypre_swap2i(iL,iLev,ii-lenl,lenh); + iw[k] = -1; + hypre_swap2i(iL, iLev, ii - lenl, lenh); /* * now the elimination on current row could start. * eliminate row k (new index) from current row */ - ku = U_diag_i[k+1]; + ku = U_diag_i[k + 1]; for (j = U_diag_i[k]; j < ku; j++) { col = temp_U_diag_j[j]; @@ -6971,7 +5690,7 @@ hypre_ILUSetupILUKRASSymbolic(HYPRE_Int n, HYPRE_Int *A_diag_i, HYPRE_Int *A_dia /*swap it with the element right after the heap*/ /* maintain the heap */ - hypre_ILUMinHeapAddIIIi(iL,iLev,iw,lenh); + hypre_ILUMinHeapAddIIIi(iL, iLev, iw, lenh); } else if (col > ii) { @@ -6988,39 +5707,41 @@ hypre_ILUSetupILUKRASSymbolic(HYPRE_Int n, HYPRE_Int *A_diag_i, HYPRE_Int *A_dia }/* end of while loop for iith row */ /* now update everything, indices, levels and so */ - L_diag_i[ii+1] = L_diag_i[ii] + lenl; + L_diag_i[ii + 1] = L_diag_i[ii] + lenl; if (lenl > 0) { /* check if memory is enough */ while (ctrL + lenl > capacity_L) { HYPRE_Int tmp = capacity_L; - capacity_L = capacity_L * EXPAND_FACT + 1; - temp_L_diag_j = hypre_TReAlloc_v2(temp_L_diag_j, HYPRE_Int, tmp, HYPRE_Int, capacity_L, HYPRE_MEMORY_DEVICE); + capacity_L = (HYPRE_Int)(capacity_L * EXPAND_FACT + 1); + temp_L_diag_j = hypre_TReAlloc_v2(temp_L_diag_j, HYPRE_Int, tmp, HYPRE_Int, capacity_L, + memory_location); } /* now copy L data, reverse order */ for (j = 0; j < lenl; j++) { - temp_L_diag_j[ctrL+j] = iL[ii-j-1]; + temp_L_diag_j[ctrL + j] = iL[ii - j - 1]; } ctrL += lenl; } k = lenu - ii; - U_diag_i[ii+1] = U_diag_i[ii] + k; + U_diag_i[ii + 1] = U_diag_i[ii] + k; if (k > 0) { /* check if memory is enough */ while (ctrU + k > capacity_U) { HYPRE_Int tmp = capacity_U; - capacity_U = capacity_U * EXPAND_FACT + 1; - temp_U_diag_j = hypre_TReAlloc_v2(temp_U_diag_j, HYPRE_Int, tmp, HYPRE_Int, capacity_U, HYPRE_MEMORY_DEVICE); + capacity_U = (HYPRE_Int)(capacity_U * EXPAND_FACT + 1); + temp_U_diag_j = hypre_TReAlloc_v2(temp_U_diag_j, HYPRE_Int, tmp, HYPRE_Int, capacity_U, + memory_location); u_levels = hypre_TReAlloc_v2(u_levels, HYPRE_Int, tmp, HYPRE_Int, capacity_U, HYPRE_MEMORY_HOST); } - //hypre_TMemcpy(temp_U_diag_j+ctrU,iL+ii,HYPRE_Int,k,HYPRE_MEMORY_DEVICE,HYPRE_MEMORY_HOST); - hypre_TMemcpy(temp_U_diag_j+ctrU, iL+ii, HYPRE_Int, k, - HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); - hypre_TMemcpy(u_levels+ctrU, iLev+ii, HYPRE_Int, k, + //hypre_TMemcpy(temp_U_diag_j+ctrU,iL+ii,HYPRE_Int,k,memory_location,HYPRE_MEMORY_HOST); + hypre_TMemcpy(temp_U_diag_j + ctrU, iL + ii, HYPRE_Int, k, + memory_location, HYPRE_MEMORY_HOST); + hypre_TMemcpy(u_levels + ctrU, iLev + ii, HYPRE_Int, k, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); ctrU += k; } @@ -7042,7 +5763,7 @@ hypre_ILUSetupILUKRASSymbolic(HYPRE_Int n, HYPRE_Int *A_diag_i, HYPRE_Int *A_dia lenl = 0; lenh = 0;/* this is the current length of heap */ lenu = ii; - lena = A_diag_i[i+1]; + lena = A_diag_i[i + 1]; /* put those already inside original pattern, and set their level to 0 */ for (j = A_diag_i[i]; j < lena; j++) { @@ -7058,7 +5779,7 @@ hypre_ILUSetupILUKRASSymbolic(HYPRE_Int n, HYPRE_Int *A_diag_i, HYPRE_Int *A_dia iLev[lenh] = 0; iw[col] = lenh++; /*now miantian a heap structure*/ - hypre_ILUMinHeapAddIIIi(iL,iLev,iw,lenh); + hypre_ILUMinHeapAddIIIi(iL, iLev, iw, lenh); } else if (col > ii) { @@ -7070,7 +5791,7 @@ hypre_ILUSetupILUKRASSymbolic(HYPRE_Int n, HYPRE_Int *A_diag_i, HYPRE_Int *A_dia }/* end of j loop for adding pattern in original matrix */ /* put those already inside offd pattern in, and set their level to 0 */ - lena = A_offd_i[i+1]; + lena = A_offd_i[i + 1]; for (j = A_offd_i[i]; j < lena; j++) { /* the offd cols are in order */ @@ -7095,18 +5816,18 @@ hypre_ILUSetupILUKRASSymbolic(HYPRE_Int n, HYPRE_Int *A_diag_i, HYPRE_Int *A_dia /* * we now need to maintain the heap structure */ - hypre_ILUMinHeapRemoveIIIi(iL,iLev,iw,lenh); + hypre_ILUMinHeapRemoveIIIi(iL, iLev, iw, lenh); lenh--; /* copy to the end of array */ lenl++; /* reset iw for that, not using anymore */ - iw[k]=-1; - hypre_swap2i(iL,iLev,ii-lenl,lenh); + iw[k] = -1; + hypre_swap2i(iL, iLev, ii - lenl, lenh); /* * now the elimination on current row could start. * eliminate row k (new index) from current row */ - ku = U_diag_i[k+1]; + ku = U_diag_i[k + 1]; for (j = U_diag_i[k]; j < ku; j++) { col = temp_U_diag_j[j]; @@ -7133,7 +5854,7 @@ hypre_ILUSetupILUKRASSymbolic(HYPRE_Int n, HYPRE_Int *A_diag_i, HYPRE_Int *A_dia /*swap it with the element right after the heap*/ /* maintain the heap */ - hypre_ILUMinHeapAddIIIi(iL,iLev,iw,lenh); + hypre_ILUMinHeapAddIIIi(iL, iLev, iw, lenh); } else if (col > ii) { @@ -7150,40 +5871,39 @@ hypre_ILUSetupILUKRASSymbolic(HYPRE_Int n, HYPRE_Int *A_diag_i, HYPRE_Int *A_dia }/* end of while loop for iith row */ /* now update everything, indices, levels and so */ - L_diag_i[ii+1] = L_diag_i[ii] + lenl; + L_diag_i[ii + 1] = L_diag_i[ii] + lenl; if (lenl > 0) { /* check if memory is enough */ while (ctrL + lenl > capacity_L) { HYPRE_Int tmp = capacity_L; - capacity_L = capacity_L * EXPAND_FACT + 1; - temp_L_diag_j = hypre_TReAlloc_v2(temp_L_diag_j, HYPRE_Int, tmp, HYPRE_Int, capacity_L, HYPRE_MEMORY_DEVICE); + capacity_L = (HYPRE_Int)(capacity_L * EXPAND_FACT + 1); + temp_L_diag_j = hypre_TReAlloc_v2(temp_L_diag_j, HYPRE_Int, tmp, HYPRE_Int, capacity_L, + memory_location); } /* now copy L data, reverse order */ for (j = 0; j < lenl; j++) { - temp_L_diag_j[ctrL+j] = iL[ii-j-1]; + temp_L_diag_j[ctrL + j] = iL[ii - j - 1]; } ctrL += lenl; } k = lenu - ii; - U_diag_i[ii+1] = U_diag_i[ii] + k; + U_diag_i[ii + 1] = U_diag_i[ii] + k; if (k > 0) { /* check if memory is enough */ while (ctrU + k > capacity_U) { HYPRE_Int tmp = capacity_U; - capacity_U = capacity_U * EXPAND_FACT + 1; - temp_U_diag_j = hypre_TReAlloc_v2(temp_U_diag_j, HYPRE_Int, tmp, HYPRE_Int, capacity_U, HYPRE_MEMORY_DEVICE); + capacity_U = (HYPRE_Int)(capacity_U * EXPAND_FACT + 1); + temp_U_diag_j = hypre_TReAlloc_v2(temp_U_diag_j, HYPRE_Int, tmp, HYPRE_Int, capacity_U, + memory_location); u_levels = hypre_TReAlloc_v2(u_levels, HYPRE_Int, tmp, HYPRE_Int, capacity_U, HYPRE_MEMORY_HOST); } - //hypre_TMemcpy(temp_U_diag_j+ctrU,iL+ii,HYPRE_Int,k,HYPRE_MEMORY_DEVICE,HYPRE_MEMORY_HOST); - hypre_TMemcpy(temp_U_diag_j+ctrU, iL+ii, HYPRE_Int, k, - HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); - hypre_TMemcpy(u_levels+ctrU, iLev+ii, HYPRE_Int, k, - HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + hypre_TMemcpy(temp_U_diag_j + ctrU, iL + ii, HYPRE_Int, k, memory_location, HYPRE_MEMORY_HOST); + hypre_TMemcpy(u_levels + ctrU, iLev + ii, HYPRE_Int, k, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); ctrU += k; } @@ -7195,13 +5915,13 @@ hypre_ILUSetupILUKRASSymbolic(HYPRE_Int n, HYPRE_Int *A_diag_i, HYPRE_Int *A_dia } /* end of main loop ii from nLU to n */ /* external part matrix */ - for (ii = n ; ii < total_rows ; ii ++) + for (ii = n; ii < total_rows; ii++) { i = ii - n; lenl = 0; lenh = 0;/* this is the current length of heap */ lenu = ii; - lena = E_i[i+1]; + lena = E_i[i + 1]; /* put those already inside original pattern, and set their level to 0 */ for (j = E_i[i]; j < lena; j++) { @@ -7217,7 +5937,7 @@ hypre_ILUSetupILUKRASSymbolic(HYPRE_Int n, HYPRE_Int *A_diag_i, HYPRE_Int *A_dia iLev[lenh] = 0; iw[col] = lenh++; /*now miantian a heap structure*/ - hypre_ILUMinHeapAddIIIi(iL,iLev,iw,lenh); + hypre_ILUMinHeapAddIIIi(iL, iLev, iw, lenh); } else if (col > ii) { @@ -7242,18 +5962,18 @@ hypre_ILUSetupILUKRASSymbolic(HYPRE_Int n, HYPRE_Int *A_diag_i, HYPRE_Int *A_dia /* * we now need to maintain the heap structure */ - hypre_ILUMinHeapRemoveIIIi(iL,iLev,iw,lenh); + hypre_ILUMinHeapRemoveIIIi(iL, iLev, iw, lenh); lenh--; /* copy to the end of array */ lenl++; /* reset iw for that, not using anymore */ - iw[k]=-1; - hypre_swap2i(iL,iLev,ii-lenl,lenh); + iw[k] = -1; + hypre_swap2i(iL, iLev, ii - lenl, lenh); /* * now the elimination on current row could start. * eliminate row k (new index) from current row */ - ku = U_diag_i[k+1]; + ku = U_diag_i[k + 1]; for (j = U_diag_i[k]; j < ku; j++) { col = temp_U_diag_j[j]; @@ -7280,7 +6000,7 @@ hypre_ILUSetupILUKRASSymbolic(HYPRE_Int n, HYPRE_Int *A_diag_i, HYPRE_Int *A_dia /*swap it with the element right after the heap*/ /* maintain the heap */ - hypre_ILUMinHeapAddIIIi(iL,iLev,iw,lenh); + hypre_ILUMinHeapAddIIIi(iL, iLev, iw, lenh); } else if (col > ii) { @@ -7297,40 +6017,39 @@ hypre_ILUSetupILUKRASSymbolic(HYPRE_Int n, HYPRE_Int *A_diag_i, HYPRE_Int *A_dia }/* end of while loop for iith row */ /* now update everything, indices, levels and so */ - L_diag_i[ii+1] = L_diag_i[ii] + lenl; + L_diag_i[ii + 1] = L_diag_i[ii] + lenl; if (lenl > 0) { /* check if memory is enough */ while (ctrL + lenl > capacity_L) { HYPRE_Int tmp = capacity_L; - capacity_L = capacity_L * EXPAND_FACT + 1; - temp_L_diag_j = hypre_TReAlloc_v2(temp_L_diag_j, HYPRE_Int, tmp, HYPRE_Int, capacity_L, HYPRE_MEMORY_DEVICE); + capacity_L = (HYPRE_Int)(capacity_L * EXPAND_FACT + 1); + temp_L_diag_j = hypre_TReAlloc_v2(temp_L_diag_j, HYPRE_Int, tmp, HYPRE_Int, capacity_L, + memory_location); } /* now copy L data, reverse order */ for (j = 0; j < lenl; j++) { - temp_L_diag_j[ctrL+j] = iL[ii-j-1]; + temp_L_diag_j[ctrL + j] = iL[ii - j - 1]; } ctrL += lenl; } k = lenu - ii; - U_diag_i[ii+1] = U_diag_i[ii] + k; + U_diag_i[ii + 1] = U_diag_i[ii] + k; if (k > 0) { /* check if memory is enough */ while (ctrU + k > capacity_U) { HYPRE_Int tmp = capacity_U; - capacity_U = capacity_U * EXPAND_FACT + 1; - temp_U_diag_j = hypre_TReAlloc_v2(temp_U_diag_j, HYPRE_Int, tmp, HYPRE_Int, capacity_U, HYPRE_MEMORY_DEVICE); + capacity_U = (HYPRE_Int)(capacity_U * EXPAND_FACT + 1); + temp_U_diag_j = hypre_TReAlloc_v2(temp_U_diag_j, HYPRE_Int, tmp, HYPRE_Int, capacity_U, + memory_location); u_levels = hypre_TReAlloc_v2(u_levels, HYPRE_Int, tmp, HYPRE_Int, capacity_U, HYPRE_MEMORY_HOST); } - //hypre_TMemcpy(temp_U_diag_j+ctrU,iL+ii,HYPRE_Int,k,HYPRE_MEMORY_DEVICE,HYPRE_MEMORY_HOST); - hypre_TMemcpy(temp_U_diag_j+ctrU, iL+ii, HYPRE_Int, k, - HYPRE_MEMORY_HOST,HYPRE_MEMORY_HOST); - hypre_TMemcpy(u_levels+ctrU, iLev+ii, HYPRE_Int, k, - HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + hypre_TMemcpy(temp_U_diag_j + ctrU, iL + ii, HYPRE_Int, k, memory_location, HYPRE_MEMORY_HOST); + hypre_TMemcpy(u_levels + ctrU, iLev + ii, HYPRE_Int, k, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); ctrU += k; } @@ -7345,7 +6064,7 @@ hypre_ILUSetupILUKRASSymbolic(HYPRE_Int n, HYPRE_Int *A_diag_i, HYPRE_Int *A_dia /* * 3: Finishing up and free memory */ - hypre_TFree(u_levels,HYPRE_MEMORY_HOST); + hypre_TFree(u_levels, HYPRE_MEMORY_HOST); *L_diag_j = temp_L_diag_j; *U_diag_j = temp_U_diag_j; @@ -7353,17 +6072,27 @@ hypre_ILUSetupILUKRASSymbolic(HYPRE_Int n, HYPRE_Int *A_diag_i, HYPRE_Int *A_dia return hypre_error_flag; } -/* ILU(k) for RAS +/*-------------------------------------------------------------------------- + * hypre_ILUSetupILUKRAS + * + * ILU(k) numeric factorization for RAS + * * A: input matrix * lfil: level of fill-in, the k in ILU(k) - * perm: permutation array indicating ordering of factorization. Perm could come from a - * CF_marker: array or a reordering routine. + * perm: permutation array indicating ordering of factorization. + * Perm could come from a CF_marker array or a reordering routine. * nLU: size of computed LDU factorization. * Lptr, Dptr, Uptr: L, D, U factors. - */ + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUSetupILUKRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *perm, HYPRE_Int nLU, - hypre_ParCSRMatrix **Lptr, HYPRE_Real** Dptr, hypre_ParCSRMatrix **Uptr) +hypre_ILUSetupILUKRAS(hypre_ParCSRMatrix *A, + HYPRE_Int lfil, + HYPRE_Int *perm, + HYPRE_Int nLU, + hypre_ParCSRMatrix **Lptr, + HYPRE_Real **Dptr, + hypre_ParCSRMatrix **Uptr) { /* * 1: Setup and create buffers @@ -7379,8 +6108,9 @@ hypre_ILUSetupILUKRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *perm, HY /* call ILU0 if lfil is 0 */ if (lfil == 0) { - return hypre_ILUSetupILU0RAS(A,perm,nLU,Lptr,Dptr,Uptr); + return hypre_ILUSetupILU0RAS(A, perm, nLU, Lptr, Dptr, Uptr); } + HYPRE_Int i, ii, j, k, k1, k2, kl, ku, jpiv, col, icol; HYPRE_Int *iw; MPI_Comm comm = hypre_ParCSRMatrixComm(A); @@ -7395,6 +6125,7 @@ hypre_ILUSetupILUKRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *perm, HY HYPRE_Real *A_offd_data = hypre_CSRMatrixData(A_offd); HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); + HYPRE_MemoryLocation memory_location = hypre_ParCSRMatrixMemoryLocation(A); /* data objects for L, D, U */ hypre_ParCSRMatrix *matL; @@ -7411,7 +6142,6 @@ hypre_ILUSetupILUKRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *perm, HY /* size of problem and external matrix */ HYPRE_Int n = hypre_CSRMatrixNumRows(A_diag); - // HYPRE_Int m = n - nLU; HYPRE_Int ext = hypre_CSRMatrixNumCols(A_offd); HYPRE_Int total_rows = n + ext; HYPRE_BigInt global_num_rows; @@ -7426,8 +6156,6 @@ hypre_ILUSetupILUKRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *perm, HY /* communication */ hypre_ParCSRCommPkg *comm_pkg; hypre_MPI_Comm_size(comm, &num_procs); - // hypre_ParCSRCommHandle *comm_handle; - // HYPRE_Int *send_buf = NULL; /* reverse permutation array */ HYPRE_Int *rperm; @@ -7439,13 +6167,13 @@ hypre_ILUSetupILUKRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *perm, HY n = hypre_CSRMatrixNumRows(A_diag); if (nLU < 0 || nLU > n) { - hypre_error_w_msg(HYPRE_ERROR_ARG,"WARNING: nLU out of range.\n"); + hypre_error_w_msg(HYPRE_ERROR_ARG, "WARNING: nLU out of range.\n"); } /* Init I array anyway. S's might be freed later */ - D_data = hypre_CTAlloc(HYPRE_Real, total_rows, HYPRE_MEMORY_DEVICE); - L_diag_i = hypre_CTAlloc(HYPRE_Int, (total_rows+1), HYPRE_MEMORY_DEVICE); - U_diag_i = hypre_CTAlloc(HYPRE_Int, (total_rows+1), HYPRE_MEMORY_DEVICE); + D_data = hypre_CTAlloc(HYPRE_Real, total_rows, memory_location); + L_diag_i = hypre_CTAlloc(HYPRE_Int, (total_rows + 1), memory_location); + U_diag_i = hypre_CTAlloc(HYPRE_Int, (total_rows + 1), memory_location); /* set Comm_Pkg if not yet built */ comm_pkg = hypre_ParCSRMatrixCommPkg(A); @@ -7460,10 +6188,10 @@ hypre_ILUSetupILUKRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *perm, HY * setup iw and rperm first */ /* allocate work arrays */ - iw = hypre_CTAlloc(HYPRE_Int, 5*total_rows, HYPRE_MEMORY_HOST); - rperm = iw + 3*total_rows; + iw = hypre_CTAlloc(HYPRE_Int, 5 * total_rows, HYPRE_MEMORY_HOST); + rperm = iw + 3 * total_rows; perm_old = perm; - perm = iw + 4*total_rows; + perm = iw + 4 * total_rows; L_diag_i[0] = U_diag_i[0] = 0; /* get reverse permutation (rperm). * rperm holds the reordered indexes. @@ -7482,10 +6210,11 @@ hypre_ILUSetupILUKRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *perm, HY } /* get external rows */ - hypre_ILUBuildRASExternalMatrix(A,rperm,&E_i,&E_j,&E_data); + hypre_ILUBuildRASExternalMatrix(A, rperm, &E_i, &E_j, &E_data); /* do symbolic factorization */ - hypre_ILUSetupILUKRASSymbolic(n, A_diag_i, A_diag_j, A_offd_i, A_offd_j, E_i, E_j, ext, lfil, perm, rperm, iw, - nLU, L_diag_i, U_diag_i, &L_diag_j, &U_diag_j); + hypre_ILUSetupILUKRASSymbolic(n, A_diag_i, A_diag_j, A_offd_i, A_offd_j, E_i, E_j, ext, lfil, perm, + rperm, iw, + nLU, L_diag_i, U_diag_i, &L_diag_j, &U_diag_j); /* * after this, we have our I,J for L, U and S ready, and L sorted @@ -7494,11 +6223,11 @@ hypre_ILUSetupILUKRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *perm, HY */ if (L_diag_i[total_rows]) { - L_diag_data = hypre_CTAlloc(HYPRE_Real, L_diag_i[total_rows], HYPRE_MEMORY_DEVICE); + L_diag_data = hypre_CTAlloc(HYPRE_Real, L_diag_i[total_rows], memory_location); } if (U_diag_i[total_rows]) { - U_diag_data = hypre_CTAlloc(HYPRE_Real, U_diag_i[total_rows], HYPRE_MEMORY_DEVICE); + U_diag_data = hypre_CTAlloc(HYPRE_Real, U_diag_i[total_rows], memory_location); } /* @@ -7510,10 +6239,10 @@ hypre_ILUSetupILUKRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *perm, HY { // get row i i = perm[ii]; - kl = L_diag_i[ii+1]; - ku = U_diag_i[ii+1]; + kl = L_diag_i[ii + 1]; + ku = U_diag_i[ii + 1]; k1 = A_diag_i[i]; - k2 = A_diag_i[i+1]; + k2 = A_diag_i[i + 1]; /* set up working arrays */ for (j = L_diag_i[ii]; j < kl; j++) { @@ -7552,7 +6281,7 @@ hypre_ILUSetupILUKRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *perm, HY { jpiv = L_diag_j[j]; L_diag_data[j] *= D_data[jpiv]; - ku = U_diag_i[jpiv+1]; + ku = U_diag_i[jpiv + 1]; for (k = U_diag_i[jpiv]; k < ku; k++) { @@ -7566,22 +6295,22 @@ hypre_ILUSetupILUKRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *perm, HY if (col < ii) { /* L part */ - L_diag_data[icol] -= L_diag_data[j]*U_diag_data[k]; + L_diag_data[icol] -= L_diag_data[j] * U_diag_data[k]; } else if (col == ii) { /* diag part */ - D_data[icol] -= L_diag_data[j]*U_diag_data[k]; + D_data[icol] -= L_diag_data[j] * U_diag_data[k]; } else { /* U part */ - U_diag_data[icol] -= L_diag_data[j]*U_diag_data[k]; + U_diag_data[icol] -= L_diag_data[j] * U_diag_data[k]; } } } /* reset working array */ - ku = U_diag_i[ii+1]; + ku = U_diag_i[ii + 1]; for (j = L_diag_i[ii]; j < kl; j++) { col = L_diag_j[j]; @@ -7595,11 +6324,11 @@ hypre_ILUSetupILUKRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *perm, HY } /* diagonal part (we store the inverse) */ - if (fabs(D_data[ii]) < MAT_TOL) + if (hypre_abs(D_data[ii]) < MAT_TOL) { - D_data[ii] = 1e-06; + D_data[ii] = 1.0e-06; } - D_data[ii] = 1./ D_data[ii]; + D_data[ii] = 1. / D_data[ii]; }/* end of loop for upper part */ @@ -7608,8 +6337,8 @@ hypre_ILUSetupILUKRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *perm, HY { // get row i i = perm[ii]; - kl = L_diag_i[ii+1]; - ku = U_diag_i[ii+1]; + kl = L_diag_i[ii + 1]; + ku = U_diag_i[ii + 1]; /* set up working arrays */ for (j = L_diag_i[ii]; j < kl; j++) { @@ -7625,7 +6354,7 @@ hypre_ILUSetupILUKRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *perm, HY } /* copy data from A into L, D and U */ k1 = A_diag_i[i]; - k2 = A_diag_i[i+1]; + k2 = A_diag_i[i + 1]; for (j = k1; j < k2; j++) { /* compute everything in new index */ @@ -7647,7 +6376,7 @@ hypre_ILUSetupILUKRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *perm, HY } /* copy data from A_offd into L, D and U */ k1 = A_offd_i[i]; - k2 = A_offd_i[i+1]; + k2 = A_offd_i[i + 1]; for (j = k1; j < k2; j++) { /* compute everything in new index */ @@ -7660,7 +6389,7 @@ hypre_ILUSetupILUKRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *perm, HY { jpiv = L_diag_j[j]; L_diag_data[j] *= D_data[jpiv]; - ku = U_diag_i[jpiv+1]; + ku = U_diag_i[jpiv + 1]; for (k = U_diag_i[jpiv]; k < ku; k++) { @@ -7674,22 +6403,22 @@ hypre_ILUSetupILUKRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *perm, HY if (col < ii) { /* L part */ - L_diag_data[icol] -= L_diag_data[j]*U_diag_data[k]; + L_diag_data[icol] -= L_diag_data[j] * U_diag_data[k]; } else if (col == ii) { /* diag part */ - D_data[icol] -= L_diag_data[j]*U_diag_data[k]; + D_data[icol] -= L_diag_data[j] * U_diag_data[k]; } else { /* U part */ - U_diag_data[icol] -= L_diag_data[j]*U_diag_data[k]; + U_diag_data[icol] -= L_diag_data[j] * U_diag_data[k]; } } } /* reset working array */ - ku = U_diag_i[ii+1]; + ku = U_diag_i[ii + 1]; for (j = L_diag_i[ii]; j < kl; j++) { col = L_diag_j[j]; @@ -7703,11 +6432,11 @@ hypre_ILUSetupILUKRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *perm, HY } /* diagonal part (we store the inverse) */ - if (fabs(D_data[ii]) < MAT_TOL) + if (hypre_abs(D_data[ii]) < MAT_TOL) { - D_data[ii] = 1e-06; + D_data[ii] = 1.0e-06; } - D_data[ii] = 1./ D_data[ii]; + D_data[ii] = 1. / D_data[ii]; }/* end of loop for lower part */ @@ -7716,10 +6445,10 @@ hypre_ILUSetupILUKRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *perm, HY { // get row i i = ii - n; - kl = L_diag_i[ii+1]; - ku = U_diag_i[ii+1]; + kl = L_diag_i[ii + 1]; + ku = U_diag_i[ii + 1]; k1 = E_i[i]; - k2 = E_i[i+1]; + k2 = E_i[i + 1]; /* set up working arrays */ for (j = L_diag_i[ii]; j < kl; j++) { @@ -7758,7 +6487,7 @@ hypre_ILUSetupILUKRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *perm, HY { jpiv = L_diag_j[j]; L_diag_data[j] *= D_data[jpiv]; - ku = U_diag_i[jpiv+1]; + ku = U_diag_i[jpiv + 1]; for (k = U_diag_i[jpiv]; k < ku; k++) { @@ -7772,22 +6501,22 @@ hypre_ILUSetupILUKRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *perm, HY if (col < ii) { /* L part */ - L_diag_data[icol] -= L_diag_data[j]*U_diag_data[k]; + L_diag_data[icol] -= L_diag_data[j] * U_diag_data[k]; } else if (col == ii) { /* diag part */ - D_data[icol] -= L_diag_data[j]*U_diag_data[k]; + D_data[icol] -= L_diag_data[j] * U_diag_data[k]; } else { /* U part */ - U_diag_data[icol] -= L_diag_data[j]*U_diag_data[k]; + U_diag_data[icol] -= L_diag_data[j] * U_diag_data[k]; } } } /* reset working array */ - ku = U_diag_i[ii+1]; + ku = U_diag_i[ii + 1]; for (j = L_diag_i[ii]; j < kl; j++) { col = L_diag_j[j]; @@ -7801,11 +6530,11 @@ hypre_ILUSetupILUKRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *perm, HY } /* diagonal part (we store the inverse) */ - if (fabs(D_data[ii]) < MAT_TOL) + if (hypre_abs(D_data[ii]) < MAT_TOL) { - D_data[ii] = 1e-06; + D_data[ii] = 1.0e-06; } - D_data[ii] = 1./ D_data[ii]; + D_data[ii] = 1. / D_data[ii]; }/* end of loop for external loop */ @@ -7813,27 +6542,28 @@ hypre_ILUSetupILUKRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *perm, HY * 4: Finishing up and free */ HYPRE_BigInt big_total_rows = (HYPRE_BigInt)total_rows; - hypre_MPI_Allreduce( &big_total_rows, &global_num_rows, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); + hypre_MPI_Allreduce(&big_total_rows, &global_num_rows, 1, HYPRE_MPI_BIG_INT, + hypre_MPI_SUM, comm); /* need to get new column start */ { HYPRE_BigInt global_start; - hypre_MPI_Scan( &big_total_rows, &global_start, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); + hypre_MPI_Scan(&big_total_rows, &global_start, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); col_starts[0] = global_start - total_rows; col_starts[1] = global_start; } /* Assemble LDU matrices */ matL = hypre_ParCSRMatrixCreate( comm, - global_num_rows, - global_num_rows, - col_starts, - col_starts, - 0 /* num_cols_offd */, - L_diag_i[total_rows], - 0 /* num_nonzeros_offd */); + global_num_rows, + global_num_rows, + col_starts, + col_starts, + 0 /* num_cols_offd */, + L_diag_i[total_rows], + 0 /* num_nonzeros_offd */); L_diag = hypre_ParCSRMatrixDiag(matL); hypre_CSRMatrixI(L_diag) = L_diag_i; - if (L_diag_i[total_rows]>0) + if (L_diag_i[total_rows] > 0) { hypre_CSRMatrixData(L_diag) = L_diag_data; hypre_CSRMatrixJ(L_diag) = L_diag_j; @@ -7841,7 +6571,7 @@ hypre_ILUSetupILUKRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *perm, HY else { /* we allocated some initial length, so free them */ - hypre_TFree(L_diag_j, HYPRE_MEMORY_DEVICE); + hypre_TFree(L_diag_j, memory_location); } /* store (global) total number of nonzeros */ local_nnz = (HYPRE_Real) (L_diag_i[total_rows]); @@ -7849,17 +6579,17 @@ hypre_ILUSetupILUKRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *perm, HY hypre_ParCSRMatrixDNumNonzeros(matL) = total_nnz; matU = hypre_ParCSRMatrixCreate( comm, - global_num_rows, - global_num_rows, - col_starts, - col_starts, - 0, - U_diag_i[total_rows], - 0 ); + global_num_rows, + global_num_rows, + col_starts, + col_starts, + 0, + U_diag_i[total_rows], + 0 ); U_diag = hypre_ParCSRMatrixDiag(matU); hypre_CSRMatrixI(U_diag) = U_diag_i; - if (U_diag_i[n]>0) + if (U_diag_i[n] > 0) { hypre_CSRMatrixData(U_diag) = U_diag_data; hypre_CSRMatrixJ(U_diag) = U_diag_j; @@ -7867,7 +6597,7 @@ hypre_ILUSetupILUKRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *perm, HY else { /* we allocated some initial length, so free them */ - hypre_TFree(U_diag_j, HYPRE_MEMORY_DEVICE); + hypre_TFree(U_diag_j, memory_location); } /* store (global) total number of nonzeros */ local_nnz = (HYPRE_Real) (U_diag_i[total_rows]); @@ -7875,7 +6605,7 @@ hypre_ILUSetupILUKRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *perm, HY hypre_ParCSRMatrixDNumNonzeros(matU) = total_nnz; /* free */ - hypre_TFree(iw,HYPRE_MEMORY_HOST); + hypre_TFree(iw, HYPRE_MEMORY_HOST); /* free external data */ if (E_i) @@ -7896,26 +6626,36 @@ hypre_ILUSetupILUKRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *perm, HY return hypre_error_flag; } -/* ILUT for RAS +/*-------------------------------------------------------------------------- + * hypre_ILUSetupILUTRAS + * + * ILUT for RAS + * * A: input matrix * lfil: level of fill-in, the k in ILU(k) * tol: droptol array in ILUT * tol[0]: matrix B * tol[1]: matrix E and F * tol[2]: matrix S - * perm: permutation array indicating ordering of factorization. Perm could come from a - * CF_marker: array or a reordering routine. + * perm: permutation array indicating ordering of factorization. + * Perm could come from a CF_marker: array or a reordering routine. * nLU: size of computed LDU factorization. If nLU < n, Schur compelemnt will be formed * Lptr, Dptr, Uptr: L, D, U factors. * Sptr: Schur complement * * Keep the largest lfil entries that is greater than some tol relative * to the input tol and the norm of that row in both L and U - */ + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, - HYPRE_Int *perm, HYPRE_Int nLU, hypre_ParCSRMatrix **Lptr, - HYPRE_Real** Dptr, hypre_ParCSRMatrix **Uptr) +hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, + HYPRE_Int lfil, + HYPRE_Real *tol, + HYPRE_Int *perm, + HYPRE_Int nLU, + hypre_ParCSRMatrix **Lptr, + HYPRE_Real **Dptr, + hypre_ParCSRMatrix **Uptr) { /* * 1: Setup and create buffers @@ -7928,9 +6668,10 @@ hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, * iL = working array store the active col number */ HYPRE_Real local_nnz, total_nnz; - HYPRE_Int i, ii, j, k1, k2, k12, k22, kl, ku, col, icol, lenl, lenu, lenhu, lenhlr, lenhll, jpos, jrow; + HYPRE_Int i, ii, j, k1, k2, k12, k22, kl, ku, col, icol, lenl, lenu, lenhu, lenhlr, + lenhll, jpos, jrow; HYPRE_Real inorm, itolb, itolef, dpiv, lxu; - HYPRE_Int *iw,*iL; + HYPRE_Int *iw, *iL; HYPRE_Real *w; /* memory management */ @@ -7945,10 +6686,7 @@ hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, MPI_Comm comm = hypre_ParCSRMatrixComm(A); HYPRE_Int num_procs; hypre_ParCSRCommPkg *comm_pkg; - // hypre_ParCSRCommHandle *comm_handle; HYPRE_BigInt col_starts[2]; - // HYPRE_Int num_sends; - // HYPRE_Int begin, end; /* data objects for A */ hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); @@ -7959,6 +6697,7 @@ hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); HYPRE_Real *A_offd_data = hypre_CSRMatrixData(A_offd); + HYPRE_MemoryLocation memory_location = hypre_ParCSRMatrixMemoryLocation(A); /* data objects for L, D, U */ hypre_ParCSRMatrix *matL; @@ -7975,7 +6714,6 @@ hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, /* size of problem and external matrix */ HYPRE_Int n = hypre_CSRMatrixNumRows(A_diag); - // HYPRE_Int m = n - nLU; HYPRE_Int ext = hypre_CSRMatrixNumCols(A_offd); HYPRE_Int total_rows = n + ext; HYPRE_BigInt global_num_rows; @@ -7996,7 +6734,7 @@ hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, n = hypre_CSRMatrixNumRows(A_diag); if (nLU < 0 || nLU > n) { - hypre_error_w_msg(HYPRE_ERROR_ARG,"WARNING: nLU out of range.\n"); + hypre_error_w_msg(HYPRE_ERROR_ARG, "WARNING: nLU out of range.\n"); } /* start set up @@ -8015,26 +6753,26 @@ hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, nnz_A = A_diag_i[nLU]; if (n > 0) { - initial_alloc = nLU + ceil(nnz_A / 2.0); + initial_alloc = (HYPRE_Int)(nLU + hypre_ceil((HYPRE_Real)(nnz_A / 2.0))); } capacity_L = initial_alloc; capacity_U = initial_alloc; - D_data = hypre_CTAlloc(HYPRE_Real, total_rows, HYPRE_MEMORY_DEVICE); - L_diag_i = hypre_CTAlloc(HYPRE_Int, (total_rows+1), HYPRE_MEMORY_DEVICE); - U_diag_i = hypre_CTAlloc(HYPRE_Int, (total_rows+1), HYPRE_MEMORY_DEVICE); + D_data = hypre_CTAlloc(HYPRE_Real, total_rows, memory_location); + L_diag_i = hypre_CTAlloc(HYPRE_Int, (total_rows + 1), memory_location); + U_diag_i = hypre_CTAlloc(HYPRE_Int, (total_rows + 1), memory_location); - L_diag_j = hypre_CTAlloc(HYPRE_Int, capacity_L, HYPRE_MEMORY_DEVICE); - U_diag_j = hypre_CTAlloc(HYPRE_Int, capacity_U, HYPRE_MEMORY_DEVICE); - L_diag_data = hypre_CTAlloc(HYPRE_Real, capacity_L, HYPRE_MEMORY_DEVICE); - U_diag_data = hypre_CTAlloc(HYPRE_Real, capacity_U, HYPRE_MEMORY_DEVICE); + L_diag_j = hypre_CTAlloc(HYPRE_Int, capacity_L, memory_location); + U_diag_j = hypre_CTAlloc(HYPRE_Int, capacity_U, memory_location); + L_diag_data = hypre_CTAlloc(HYPRE_Real, capacity_L, memory_location); + U_diag_data = hypre_CTAlloc(HYPRE_Real, capacity_U, memory_location); ctrL = ctrU = 0; /* setting up working array */ - iw = hypre_CTAlloc(HYPRE_Int,4*total_rows,HYPRE_MEMORY_HOST); + iw = hypre_CTAlloc(HYPRE_Int, 4 * total_rows, HYPRE_MEMORY_HOST); iL = iw + total_rows; - w = hypre_CTAlloc(HYPRE_Real,total_rows,HYPRE_MEMORY_HOST); + w = hypre_CTAlloc(HYPRE_Real, total_rows, HYPRE_MEMORY_HOST); for (i = 0; i < total_rows; i++) { iw[i] = -1; @@ -8045,9 +6783,9 @@ hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, * rperm[old] -> new * perm[new] -> old */ - rperm = iw + 2*total_rows; + rperm = iw + 2 * total_rows; perm_old = perm; - perm = iw + 3*total_rows; + perm = iw + 3 * total_rows; for (i = 0; i < n; i++) { perm[i] = perm_old[i]; @@ -8061,7 +6799,7 @@ hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, rperm[perm[i]] = i; } /* get external matrix */ - hypre_ILUBuildRASExternalMatrix(A,rperm,&E_i,&E_j,&E_data); + hypre_ILUBuildRASExternalMatrix(A, rperm, &E_i, &E_j, &E_data); /* * 2: Main loop of elimination @@ -8076,19 +6814,19 @@ hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, /* get real row with perm */ i = perm[ii]; k1 = A_diag_i[i]; - k2 = A_diag_i[i+1]; - kl = ii-1; + k2 = A_diag_i[i + 1]; + kl = ii - 1; /* reset row norm of ith row */ inorm = .0; for (j = k1; j < k2; j++) { - inorm += fabs(A_diag_data[j]); + inorm += hypre_abs(A_diag_data[j]); } if (inorm == .0) { - hypre_error_w_msg(HYPRE_ERROR_ARG,"WARNING: ILUT with zero row.\n"); + hypre_error_w_msg(HYPRE_ERROR_ARG, "WARNING: ILUT with zero row.\n"); } - inorm /= (HYPRE_Real)(k2-k1); + inorm /= (HYPRE_Real)(k2 - k1); /* set the scaled tol for that row */ itolb = tol[0] * inorm; itolef = tol[1] * inorm; @@ -8109,7 +6847,7 @@ hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, w[lenhll] = A_diag_data[j]; iw[col] = lenhll++; /* add to heap, by col number */ - hypre_ILUMinHeapAddIRIi(iL,w,iw,lenhll); + hypre_ILUMinHeapAddIRIi(iL, w, iw, lenhll); } else if (col == ii) { @@ -8139,31 +6877,36 @@ hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, dpiv = w[0] * D_data[jrow]; w[0] = dpiv; /* now remove it from the top of the heap */ - hypre_ILUMinHeapRemoveIRIi(iL,w,iw,lenhll); + hypre_ILUMinHeapRemoveIRIi(iL, w, iw, lenhll); lenhll--; /* * reset the drop part to -1 * we don't need this iw anymore */ iw[jrow] = -1; + /* need to keep this one, move to the end of the heap */ /* no longer need to maintain iw */ - hypre_swap2(iL,w,lenhll,kl-lenhlr); + hypre_swap2(iL, w, lenhll, kl - lenhlr); lenhlr++; - hypre_ILUMaxrHeapAddRabsI(w+kl,iL+kl,lenhlr); + hypre_ILUMaxrHeapAddRabsI(w + kl, iL + kl, lenhlr); + /* loop for elimination */ - ku = U_diag_i[jrow+1]; + ku = U_diag_i[jrow + 1]; for (j = U_diag_i[jrow]; j < ku; j++) { - col = U_diag_j[j]; + col = U_diag_j[j]; icol = iw[col]; - lxu = - dpiv*U_diag_data[j]; + lxu = - dpiv * U_diag_data[j]; + /* we don't want to fill small number to empty place */ if ((icol == -1) && - ((col < nLU && fabs(lxu) < itolb) || (col >= nLU && fabs(lxu) < itolef))) + ((col < nLU && hypre_abs(lxu) < itolb) || + (col >= nLU && hypre_abs(lxu) < itolef))) { continue; } + if (icol == -1) { if (col < ii) @@ -8177,7 +6920,7 @@ hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, w[lenhll] = lxu; iw[col] = lenhll++; /* add to heap, by col number */ - hypre_ILUMinHeapAddIRIi(iL,w,iw,lenhll); + hypre_ILUMinHeapAddIRIi(iL, w, iw, lenhll); } else if (col == ii) { @@ -8203,11 +6946,11 @@ hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, } }/* while loop for the elimination of current row */ - if (fabs(w[ii]) < MAT_TOL) + if (hypre_abs(w[ii]) < MAT_TOL) { - w[ii]=1e-06; + w[ii] = 1.0e-06; } - D_data[ii] = 1./w[ii]; + D_data[ii] = 1. / w[ii]; iw[ii] = -1; /* @@ -8216,16 +6959,19 @@ hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, */ lenl = lenhlr < lfil ? lenhlr : lfil; - L_diag_i[ii+1] = L_diag_i[ii] + lenl; + L_diag_i[ii + 1] = L_diag_i[ii] + lenl; if (lenl > 0) { /* test if memory is enough */ while (ctrL + lenl > capacity_L) { HYPRE_Int tmp = capacity_L; - capacity_L = capacity_L * EXPAND_FACT + 1; - L_diag_j = hypre_TReAlloc_v2(L_diag_j, HYPRE_Int, tmp, HYPRE_Int, capacity_L, HYPRE_MEMORY_DEVICE); - L_diag_data = hypre_TReAlloc_v2(L_diag_data, HYPRE_Real, tmp, HYPRE_Real, capacity_L, HYPRE_MEMORY_DEVICE); + + capacity_L = (HYPRE_Int)(capacity_L * EXPAND_FACT + 1); + L_diag_j = hypre_TReAlloc_v2(L_diag_j, HYPRE_Int, tmp, + HYPRE_Int, capacity_L, memory_location); + L_diag_data = hypre_TReAlloc_v2(L_diag_data, HYPRE_Real, tmp, + HYPRE_Real, capacity_L, memory_location); } ctrL += lenl; /* copy large data in */ @@ -8233,7 +6979,7 @@ hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, { L_diag_j[j] = iL[kl]; L_diag_data[j] = w[kl]; - hypre_ILUMaxrHeapRemoveRabsI(w+kl,iL+kl,lenhlr); + hypre_ILUMaxrHeapRemoveRabsI(w + kl, iL + kl, lenhlr); lenhlr--; } } @@ -8241,7 +6987,7 @@ hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, * now reset working array * L part already reset when move out of heap, only U part */ - ku = lenu+ii; + ku = lenu + ii; for (j = ii + 1; j <= ku; j++) { iw[iL[j]] = -1; @@ -8257,25 +7003,27 @@ hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, /* need to sort the first small(hopefully) part of it */ lenhu = lfil; /* quick split, only sort the first small part of the array */ - hypre_ILUMaxQSplitRabsI(w,iL,ii+1,ii+lenhu,ii+lenu); + hypre_ILUMaxQSplitRabsI(w, iL, ii + 1, ii + lenhu, ii + lenu); } - U_diag_i[ii+1] = U_diag_i[ii] + lenhu; + U_diag_i[ii + 1] = U_diag_i[ii] + lenhu; if (lenhu > 0) { /* test if memory is enough */ while (ctrU + lenhu > capacity_U) { HYPRE_Int tmp = capacity_U; - capacity_U = capacity_U * EXPAND_FACT + 1; - U_diag_j = hypre_TReAlloc_v2(U_diag_j, HYPRE_Int, tmp, HYPRE_Int, capacity_U, HYPRE_MEMORY_DEVICE); - U_diag_data = hypre_TReAlloc_v2(U_diag_data, HYPRE_Real, tmp, HYPRE_Real, capacity_U, HYPRE_MEMORY_DEVICE); + capacity_U = (HYPRE_Int)(capacity_U * EXPAND_FACT + 1); + U_diag_j = hypre_TReAlloc_v2(U_diag_j, HYPRE_Int, tmp, + HYPRE_Int, capacity_U, memory_location); + U_diag_data = hypre_TReAlloc_v2(U_diag_data, HYPRE_Real, tmp, + HYPRE_Real, capacity_U, memory_location); } ctrU += lenhu; /* copy large data in */ for (j = U_diag_i[ii]; j < ctrU; j++) { - jpos = ii+1+j-U_diag_i[ii]; + jpos = ii + 1 + j - U_diag_i[ii]; U_diag_j[j] = iL[jpos]; U_diag_data[j] = w[jpos]; } @@ -8288,25 +7036,25 @@ hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, /* get real row with perm */ i = perm[ii]; k1 = A_diag_i[i]; - k2 = A_diag_i[i+1]; + k2 = A_diag_i[i + 1]; k12 = A_offd_i[i]; - k22 = A_offd_i[i+1]; - kl = ii-1; + k22 = A_offd_i[i + 1]; + kl = ii - 1; /* reset row norm of ith row */ inorm = .0; for (j = k1; j < k2; j++) { - inorm += fabs(A_diag_data[j]); + inorm += hypre_abs(A_diag_data[j]); } for (j = k12; j < k22; j++) { - inorm += fabs(A_offd_data[j]); + inorm += hypre_abs(A_offd_data[j]); } if (inorm == .0) { - hypre_error_w_msg(HYPRE_ERROR_ARG,"WARNING: ILUT with zero row.\n"); + hypre_error_w_msg(HYPRE_ERROR_ARG, "WARNING: ILUT with zero row.\n"); } - inorm /= (HYPRE_Real)(k2+k22-k1-k12); + inorm /= (HYPRE_Real)(k2 + k22 - k1 - k12); /* set the scaled tol for that row */ itolb = tol[0] * inorm; itolef = tol[1] * inorm; @@ -8327,7 +7075,7 @@ hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, w[lenhll] = A_diag_data[j]; iw[col] = lenhll++; /* add to heap, by col number */ - hypre_ILUMinHeapAddIRIi(iL,w,iw,lenhll); + hypre_ILUMinHeapAddIRIi(iL, w, iw, lenhll); } else if (col == ii) { @@ -8369,7 +7117,7 @@ hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, dpiv = w[0] * D_data[jrow]; w[0] = dpiv; /* now remove it from the top of the heap */ - hypre_ILUMinHeapRemoveIRIi(iL,w,iw,lenhll); + hypre_ILUMinHeapRemoveIRIi(iL, w, iw, lenhll); lenhll--; /* * reset the drop part to -1 @@ -8378,19 +7126,19 @@ hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, iw[jrow] = -1; /* need to keep this one, move to the end of the heap */ /* no longer need to maintain iw */ - hypre_swap2(iL,w,lenhll,kl-lenhlr); + hypre_swap2(iL, w, lenhll, kl - lenhlr); lenhlr++; - hypre_ILUMaxrHeapAddRabsI(w+kl,iL+kl,lenhlr); + hypre_ILUMaxrHeapAddRabsI(w + kl, iL + kl, lenhlr); /* loop for elimination */ - ku = U_diag_i[jrow+1]; + ku = U_diag_i[jrow + 1]; for (j = U_diag_i[jrow]; j < ku; j++) { col = U_diag_j[j]; icol = iw[col]; - lxu = - dpiv*U_diag_data[j]; + lxu = - dpiv * U_diag_data[j]; /* we don't want to fill small number to empty place */ if ((icol == -1) && - ((col < nLU && fabs(lxu) < itolb) || (col >= nLU && fabs(lxu) < itolef))) + ((col < nLU && hypre_abs(lxu) < itolb) || (col >= nLU && hypre_abs(lxu) < itolef))) { continue; } @@ -8407,7 +7155,7 @@ hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, w[lenhll] = lxu; iw[col] = lenhll++; /* add to heap, by col number */ - hypre_ILUMinHeapAddIRIi(iL,w,iw,lenhll); + hypre_ILUMinHeapAddIRIi(iL, w, iw, lenhll); } else if (col == ii) { @@ -8433,11 +7181,11 @@ hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, } }/* while loop for the elimination of current row */ - if (fabs(w[ii]) < MAT_TOL) + if (hypre_abs(w[ii]) < MAT_TOL) { - w[ii]=1e-06; + w[ii] = 1.0e-06; } - D_data[ii] = 1./w[ii]; + D_data[ii] = 1. / w[ii]; iw[ii] = -1; /* @@ -8446,16 +7194,18 @@ hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, */ lenl = lenhlr < lfil ? lenhlr : lfil; - L_diag_i[ii+1] = L_diag_i[ii] + lenl; + L_diag_i[ii + 1] = L_diag_i[ii] + lenl; if (lenl > 0) { /* test if memory is enough */ while (ctrL + lenl > capacity_L) { HYPRE_Int tmp = capacity_L; - capacity_L = capacity_L * EXPAND_FACT + 1; - L_diag_j = hypre_TReAlloc_v2(L_diag_j, HYPRE_Int, tmp, HYPRE_Int, capacity_L, HYPRE_MEMORY_DEVICE); - L_diag_data = hypre_TReAlloc_v2(L_diag_data, HYPRE_Real, tmp, HYPRE_Real, capacity_L, HYPRE_MEMORY_DEVICE); + capacity_L = (HYPRE_Int)(capacity_L * EXPAND_FACT + 1); + L_diag_j = hypre_TReAlloc_v2(L_diag_j, HYPRE_Int, tmp, + HYPRE_Int, capacity_L, memory_location); + L_diag_data = hypre_TReAlloc_v2(L_diag_data, HYPRE_Real, tmp, + HYPRE_Real, capacity_L, memory_location); } ctrL += lenl; /* copy large data in */ @@ -8463,7 +7213,7 @@ hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, { L_diag_j[j] = iL[kl]; L_diag_data[j] = w[kl]; - hypre_ILUMaxrHeapRemoveRabsI(w+kl,iL+kl,lenhlr); + hypre_ILUMaxrHeapRemoveRabsI(w + kl, iL + kl, lenhlr); lenhlr--; } } @@ -8471,7 +7221,7 @@ hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, * now reset working array * L part already reset when move out of heap, only U part */ - ku = lenu+ii; + ku = lenu + ii; for (j = ii + 1; j <= ku; j++) { iw[iL[j]] = -1; @@ -8487,25 +7237,27 @@ hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, /* need to sort the first small(hopefully) part of it */ lenhu = lfil; /* quick split, only sort the first small part of the array */ - hypre_ILUMaxQSplitRabsI(w,iL,ii+1,ii+lenhu,ii+lenu); + hypre_ILUMaxQSplitRabsI(w, iL, ii + 1, ii + lenhu, ii + lenu); } - U_diag_i[ii+1] = U_diag_i[ii] + lenhu; + U_diag_i[ii + 1] = U_diag_i[ii] + lenhu; if (lenhu > 0) { /* test if memory is enough */ while (ctrU + lenhu > capacity_U) { HYPRE_Int tmp = capacity_U; - capacity_U = capacity_U * EXPAND_FACT + 1; - U_diag_j = hypre_TReAlloc_v2(U_diag_j, HYPRE_Int, tmp, HYPRE_Int, capacity_U, HYPRE_MEMORY_DEVICE); - U_diag_data = hypre_TReAlloc_v2(U_diag_data, HYPRE_Real, tmp, HYPRE_Real, capacity_U, HYPRE_MEMORY_DEVICE); + capacity_U = (HYPRE_Int)(capacity_U * EXPAND_FACT + 1); + U_diag_j = hypre_TReAlloc_v2(U_diag_j, HYPRE_Int, tmp, + HYPRE_Int, capacity_U, memory_location); + U_diag_data = hypre_TReAlloc_v2(U_diag_data, HYPRE_Real, tmp, + HYPRE_Real, capacity_U, memory_location); } ctrU += lenhu; /* copy large data in */ for (j = U_diag_i[ii]; j < ctrU; j++) { - jpos = ii+1+j-U_diag_i[ii]; + jpos = ii + 1 + j - U_diag_i[ii]; U_diag_j[j] = iL[jpos]; U_diag_data[j] = w[jpos]; } @@ -8517,21 +7269,21 @@ hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, for (ii = n; ii < total_rows; ii++) { /* get real row with perm */ - i = ii-n; + i = ii - n; k1 = E_i[i]; - k2 = E_i[i+1]; - kl = ii-1; + k2 = E_i[i + 1]; + kl = ii - 1; /* reset row norm of ith row */ inorm = .0; for (j = k1; j < k2; j++) { - inorm += fabs(E_data[j]); + inorm += hypre_abs(E_data[j]); } if (inorm == .0) { - hypre_error_w_msg(HYPRE_ERROR_ARG,"WARNING: ILUT with zero row.\n"); + hypre_error_w_msg(HYPRE_ERROR_ARG, "WARNING: ILUT with zero row.\n"); } - inorm /= (HYPRE_Real)(k2-k1); + inorm /= (HYPRE_Real)(k2 - k1); /* set the scaled tol for that row */ itolb = tol[0] * inorm; itolef = tol[1] * inorm; @@ -8552,7 +7304,7 @@ hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, w[lenhll] = E_data[j]; iw[col] = lenhll++; /* add to heap, by col number */ - hypre_ILUMinHeapAddIRIi(iL,w,iw,lenhll); + hypre_ILUMinHeapAddIRIi(iL, w, iw, lenhll); } else if (col == ii) { @@ -8582,7 +7334,7 @@ hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, dpiv = w[0] * D_data[jrow]; w[0] = dpiv; /* now remove it from the top of the heap */ - hypre_ILUMinHeapRemoveIRIi(iL,w,iw,lenhll); + hypre_ILUMinHeapRemoveIRIi(iL, w, iw, lenhll); lenhll--; /* * reset the drop part to -1 @@ -8591,19 +7343,19 @@ hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, iw[jrow] = -1; /* need to keep this one, move to the end of the heap */ /* no longer need to maintain iw */ - hypre_swap2(iL,w,lenhll,kl-lenhlr); + hypre_swap2(iL, w, lenhll, kl - lenhlr); lenhlr++; - hypre_ILUMaxrHeapAddRabsI(w+kl,iL+kl,lenhlr); + hypre_ILUMaxrHeapAddRabsI(w + kl, iL + kl, lenhlr); /* loop for elimination */ - ku = U_diag_i[jrow+1]; + ku = U_diag_i[jrow + 1]; for (j = U_diag_i[jrow]; j < ku; j++) { col = U_diag_j[j]; icol = iw[col]; - lxu = - dpiv*U_diag_data[j]; + lxu = - dpiv * U_diag_data[j]; /* we don't want to fill small number to empty place */ if ((icol == -1) && - ((col < nLU && fabs(lxu) < itolb) || (col >= nLU && fabs(lxu) < itolef))) + ((col < nLU && hypre_abs(lxu) < itolb) || (col >= nLU && hypre_abs(lxu) < itolef))) { continue; } @@ -8620,7 +7372,7 @@ hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, w[lenhll] = lxu; iw[col] = lenhll++; /* add to heap, by col number */ - hypre_ILUMinHeapAddIRIi(iL,w,iw,lenhll); + hypre_ILUMinHeapAddIRIi(iL, w, iw, lenhll); } else if (col == ii) { @@ -8646,11 +7398,11 @@ hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, } }/* while loop for the elimination of current row */ - if (fabs(w[ii]) < MAT_TOL) + if (hypre_abs(w[ii]) < MAT_TOL) { - w[ii]=1e-06; + w[ii] = 1.0e-06; } - D_data[ii] = 1./w[ii]; + D_data[ii] = 1. / w[ii]; iw[ii] = -1; /* @@ -8659,16 +7411,18 @@ hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, */ lenl = lenhlr < lfil ? lenhlr : lfil; - L_diag_i[ii+1] = L_diag_i[ii] + lenl; + L_diag_i[ii + 1] = L_diag_i[ii] + lenl; if (lenl > 0) { /* test if memory is enough */ while (ctrL + lenl > capacity_L) { HYPRE_Int tmp = capacity_L; - capacity_L = capacity_L * EXPAND_FACT + 1; - L_diag_j = hypre_TReAlloc_v2(L_diag_j, HYPRE_Int, tmp, HYPRE_Int, capacity_L, HYPRE_MEMORY_DEVICE); - L_diag_data = hypre_TReAlloc_v2(L_diag_data, HYPRE_Real, tmp, HYPRE_Real, capacity_L, HYPRE_MEMORY_DEVICE); + capacity_L = (HYPRE_Int)(capacity_L * EXPAND_FACT + 1); + L_diag_j = hypre_TReAlloc_v2(L_diag_j, HYPRE_Int, tmp, + HYPRE_Int, capacity_L, memory_location); + L_diag_data = hypre_TReAlloc_v2(L_diag_data, HYPRE_Real, tmp, + HYPRE_Real, capacity_L, memory_location); } ctrL += lenl; /* copy large data in */ @@ -8676,7 +7430,7 @@ hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, { L_diag_j[j] = iL[kl]; L_diag_data[j] = w[kl]; - hypre_ILUMaxrHeapRemoveRabsI(w+kl,iL+kl,lenhlr); + hypre_ILUMaxrHeapRemoveRabsI(w + kl, iL + kl, lenhlr); lenhlr--; } } @@ -8684,7 +7438,7 @@ hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, * now reset working array * L part already reset when move out of heap, only U part */ - ku = lenu+ii; + ku = lenu + ii; for (j = ii + 1; j <= ku; j++) { iw[iL[j]] = -1; @@ -8700,25 +7454,27 @@ hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, /* need to sort the first small(hopefully) part of it */ lenhu = lfil; /* quick split, only sort the first small part of the array */ - hypre_ILUMaxQSplitRabsI(w,iL,ii+1,ii+lenhu,ii+lenu); + hypre_ILUMaxQSplitRabsI(w, iL, ii + 1, ii + lenhu, ii + lenu); } - U_diag_i[ii+1] = U_diag_i[ii] + lenhu; + U_diag_i[ii + 1] = U_diag_i[ii] + lenhu; if (lenhu > 0) { /* test if memory is enough */ while (ctrU + lenhu > capacity_U) { HYPRE_Int tmp = capacity_U; - capacity_U = capacity_U * EXPAND_FACT + 1; - U_diag_j = hypre_TReAlloc_v2(U_diag_j, HYPRE_Int, tmp, HYPRE_Int, capacity_U, HYPRE_MEMORY_DEVICE); - U_diag_data = hypre_TReAlloc_v2(U_diag_data, HYPRE_Real, tmp, HYPRE_Real, capacity_U, HYPRE_MEMORY_DEVICE); + capacity_U = (HYPRE_Int)(capacity_U * EXPAND_FACT + 1); + U_diag_j = hypre_TReAlloc_v2(U_diag_j, HYPRE_Int, tmp, + HYPRE_Int, capacity_U, memory_location); + U_diag_data = hypre_TReAlloc_v2(U_diag_data, HYPRE_Real, tmp, + HYPRE_Real, capacity_U, memory_location); } ctrU += lenhu; /* copy large data in */ for (j = U_diag_i[ii]; j < ctrU; j++) { - jpos = ii+1+j-U_diag_i[ii]; + jpos = ii + 1 + j - U_diag_i[ii]; U_diag_j[j] = iL[jpos]; U_diag_data[j] = w[jpos]; } @@ -8729,24 +7485,25 @@ hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, * 3: Finishing up and free */ HYPRE_BigInt big_total_rows = (HYPRE_BigInt)total_rows; - hypre_MPI_Allreduce( &big_total_rows, &global_num_rows, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); + hypre_MPI_Allreduce(&big_total_rows, &global_num_rows, 1, HYPRE_MPI_BIG_INT, + hypre_MPI_SUM, comm); /* need to get new column start */ { HYPRE_BigInt global_start; - hypre_MPI_Scan( &big_total_rows, &global_start, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); + hypre_MPI_Scan(&big_total_rows, &global_start, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); col_starts[0] = global_start - total_rows; col_starts[1] = global_start; } /* create parcsr matrix */ matL = hypre_ParCSRMatrixCreate( comm, - global_num_rows, - global_num_rows, - col_starts, - col_starts, - 0, - L_diag_i[total_rows], - 0 ); + global_num_rows, + global_num_rows, + col_starts, + col_starts, + 0, + L_diag_i[total_rows], + 0 ); L_diag = hypre_ParCSRMatrixDiag(matL); hypre_CSRMatrixI(L_diag) = L_diag_i; @@ -8758,8 +7515,8 @@ hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, else { /* we initialized some anyway, so remove if unused */ - hypre_TFree(L_diag_j,HYPRE_MEMORY_DEVICE); - hypre_TFree(L_diag_data,HYPRE_MEMORY_DEVICE); + hypre_TFree(L_diag_j, memory_location); + hypre_TFree(L_diag_data, memory_location); } /* store (global) total number of nonzeros */ local_nnz = (HYPRE_Real) (L_diag_i[total_rows]); @@ -8767,13 +7524,13 @@ hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, hypre_ParCSRMatrixDNumNonzeros(matL) = total_nnz; matU = hypre_ParCSRMatrixCreate( comm, - global_num_rows, - global_num_rows, - col_starts, - col_starts, - 0, - U_diag_i[total_rows], - 0 ); + global_num_rows, + global_num_rows, + col_starts, + col_starts, + 0, + U_diag_i[total_rows], + 0 ); U_diag = hypre_ParCSRMatrixDiag(matU); hypre_CSRMatrixI(U_diag) = U_diag_i; @@ -8785,8 +7542,8 @@ hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, else { /* we initialized some anyway, so remove if unused */ - hypre_TFree(U_diag_j,HYPRE_MEMORY_DEVICE); - hypre_TFree(U_diag_data,HYPRE_MEMORY_DEVICE); + hypre_TFree(U_diag_j, memory_location); + hypre_TFree(U_diag_data, memory_location); } /* store (global) total number of nonzeros */ local_nnz = (HYPRE_Real) (U_diag_i[total_rows]); @@ -8794,8 +7551,8 @@ hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, hypre_ParCSRMatrixDNumNonzeros(matU) = total_nnz; /* free working array */ - hypre_TFree(iw,HYPRE_MEMORY_HOST); - hypre_TFree(w,HYPRE_MEMORY_HOST); + hypre_TFree(iw, HYPRE_MEMORY_HOST); + hypre_TFree(w, HYPRE_MEMORY_HOST); /* free external data */ if (E_i) diff --git a/external/hypre/src/parcsr_ls/par_ilu_setup_device.c b/external/hypre/src/parcsr_ls/par_ilu_setup_device.c new file mode 100644 index 00000000..f626b67c --- /dev/null +++ b/external/hypre/src/parcsr_ls/par_ilu_setup_device.c @@ -0,0 +1,605 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#include "_hypre_parcsr_ls.h" +#include "_hypre_utilities.hpp" + +#if defined(HYPRE_USING_GPU) + +/*-------------------------------------------------------------------------- + * hypre_ILUSetupDevice + * + * ILU(0), ILUK, ILUT setup on the device + * + * Arguments: + * A = input matrix + * perm_data = permutation array indicating ordering of rows. + * Could come from a CF_marker array or a reordering routine. + * qperm_data = permutation array indicating ordering of columns + * nI = number of internal unknowns + * nLU = size of incomplete factorization, nLU should obey nLU <= nI. + * Schur complement is formed if nLU < n + * + * This function will form the global Schur Matrix if nLU < n + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetupDevice(hypre_ParILUData *ilu_data, + hypre_ParCSRMatrix *A, + HYPRE_Int *perm_data, + HYPRE_Int *qperm_data, + HYPRE_Int n, + HYPRE_Int nLU, + hypre_CSRMatrix **BLUptr, + hypre_ParCSRMatrix **matSptr, + hypre_CSRMatrix **Eptr, + hypre_CSRMatrix **Fptr) +{ + /* Input ILU data */ + HYPRE_Int ilu_type = hypre_ParILUDataIluType(ilu_data); + HYPRE_Int fill_level = hypre_ParILUDataLfil(ilu_data); + HYPRE_Int max_row_nnz = hypre_ParILUDataMaxRowNnz(ilu_data); + HYPRE_Real *droptol = hypre_ParILUDataDroptol(ilu_data); + HYPRE_Int iter_setup_type = hypre_ParILUDataIterativeSetupType(ilu_data); + HYPRE_Int iter_setup_option = hypre_ParILUDataIterativeSetupOption(ilu_data); + HYPRE_Int iter_setup_max_iter = hypre_ParILUDataIterativeSetupMaxIter(ilu_data); + HYPRE_Complex iter_setup_tol = hypre_ParILUDataIterativeSetupTolerance(ilu_data); + + /* Input matrix data */ + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + HYPRE_MemoryLocation memory_location = hypre_ParCSRMatrixMemoryLocation(A); + hypre_ParCSRMatrix *matS = NULL; + hypre_CSRMatrix *A_diag = NULL; + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); + hypre_CSRMatrix *h_A_offd = NULL; + HYPRE_Int *A_offd_i = NULL; + HYPRE_Int *A_offd_j = NULL; + HYPRE_Real *A_offd_data = NULL; + hypre_CSRMatrix *SLU = NULL; + + /* Permutation arrays */ + HYPRE_Int *rperm_data = NULL; + HYPRE_Int *rqperm_data = NULL; + hypre_IntArray *perm = NULL; + hypre_IntArray *rperm = NULL; + hypre_IntArray *qperm = NULL; + hypre_IntArray *rqperm = NULL; + hypre_IntArray *h_perm = NULL; + hypre_IntArray *h_rperm = NULL; + + /* Variables for matS */ + HYPRE_Int m = n - nLU; + HYPRE_Int nI = nLU; //use default + HYPRE_Int e = 0; + HYPRE_Int m_e = m; + HYPRE_Int *S_diag_i = NULL; + hypre_CSRMatrix *S_offd = NULL; + HYPRE_Int *S_offd_i = NULL; + HYPRE_Int *S_offd_j = NULL; + HYPRE_Real *S_offd_data = NULL; + HYPRE_BigInt *S_offd_colmap = NULL; + HYPRE_Int S_offd_nnz; + HYPRE_Int S_offd_ncols; + HYPRE_Int S_diag_nnz; + + hypre_ParCSRMatrix *Apq = NULL; + hypre_ParCSRMatrix *ALU = NULL; + hypre_ParCSRMatrix *parL = NULL; + hypre_ParCSRMatrix *parU = NULL; + hypre_ParCSRMatrix *parS = NULL; + HYPRE_Real *parD = NULL; + HYPRE_Int *uend = NULL; + + /* Local variables */ + HYPRE_BigInt *send_buf = NULL; + hypre_ParCSRCommPkg *comm_pkg; + hypre_ParCSRCommHandle *comm_handle; + HYPRE_Int num_sends, begin, end; + HYPRE_BigInt total_rows, col_starts[2]; + HYPRE_Int i, j, k1, k2, k3, col; + HYPRE_Int my_id, num_procs; + + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); + + /* Sanity checks */ +#if !defined(HYPRE_USING_UNIFIED_MEMORY) + if (ilu_type == 0 && fill_level) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "ILUK setup on device runs requires unified memory!"); + return hypre_error_flag; + } + else if (ilu_type == 10 && fill_level) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "GMRES+ILUK setup on device runs requires unified memory!"); + return hypre_error_flag; + } +#endif + + /* Build the inverse permutation arrays */ + if (perm_data && qperm_data) + { + /* Create arrays */ + perm = hypre_IntArrayCreate(n); + qperm = hypre_IntArrayCreate(n); + + /* Set existing data */ + hypre_IntArrayData(perm) = perm_data; + hypre_IntArrayData(qperm) = qperm_data; + + /* Initialize arrays */ + hypre_IntArrayInitialize_v2(perm, memory_location); + hypre_IntArrayInitialize_v2(qperm, memory_location); + + /* Compute inverse permutation arrays */ + hypre_IntArrayInverseMapping(perm, &rperm); + hypre_IntArrayInverseMapping(qperm, &rqperm); + + rqperm_data = hypre_IntArrayData(rqperm); + } + + /* Only call ILU when we really have a matrix on this processor */ + if (n > 0) + { + /* + * Apply ILU factorization to the entire A_diag + * + * | L \ U (B) L^{-1}F | + * | EU^{-1} L \ U (S)| + * + * Extract submatrix L_B U_B, L_S U_S, EU_B^{-1}, L_B^{-1}F + * Note that in this function after ILU, all rows are sorted + * in a way different than HYPRE. Diagonal is not listed in the front + */ + +#if !defined(HYPRE_USING_SYCL) + if ((fill_level == 0) && !(ilu_type % 10)) + { + /* Copy diagonal matrix into a new place with permutation + * That is, A_diag = A_diag(perm,qperm); */ + hypre_CSRMatrixPermute(hypre_ParCSRMatrixDiag(A), perm_data, rqperm_data, &A_diag); + + /* Compute ILU0 on the device */ + if (iter_setup_type) + { + hypre_ILUSetupIterativeILU0Device(A_diag, iter_setup_type, iter_setup_option, + iter_setup_max_iter, iter_setup_tol, + &hypre_ParILUDataIterativeSetupNumIter(ilu_data), + &hypre_ParILUDataIterativeSetupHistory(ilu_data)); + } + else + { + hypre_CSRMatrixILU0(A_diag); + } + + hypre_ParILUExtractEBFC(A_diag, nLU, BLUptr, &SLU, Eptr, Fptr); + hypre_CSRMatrixDestroy(A_diag); + } + else +#endif + { + hypre_ParILURAPReorder(A, perm_data, rqperm_data, &Apq); +#if defined(HYPRE_USING_SYCL) + /* WM: note - ILU0 is not yet available in oneMKL sparse */ + if (fill_level == 0 && !(ilu_type % 10)) + { + hypre_ILUSetupILU0(Apq, NULL, NULL, n, n, &parL, &parD, &parU, &parS, &uend); + } +#endif + if (fill_level != 0 && !(ilu_type % 10)) + { + hypre_ILUSetupILUK(Apq, fill_level, NULL, NULL, n, n, &parL, &parD, &parU, &parS, &uend); + } + else if ((ilu_type % 10) == 1) + { + hypre_ParCSRMatrixMigrate(Apq, HYPRE_MEMORY_HOST); + hypre_ILUSetupILUT(Apq, max_row_nnz, droptol, NULL, NULL, n, n, + &parL, &parD, &parU, &parS, &uend); + } + + hypre_ParCSRMatrixDestroy(Apq); + hypre_TFree(uend, HYPRE_MEMORY_HOST); + hypre_ParCSRMatrixDestroy(parS); + + hypre_ILUSetupLDUtoCusparse(parL, parD, parU, &ALU); + if ((ilu_type % 10) == 1) + { + hypre_TFree(parD, HYPRE_MEMORY_HOST); + } + else + { + hypre_TFree(parD, HYPRE_MEMORY_DEVICE); + } + hypre_ParCSRMatrixDestroy(parL); + hypre_ParCSRMatrixDestroy(parU); + + hypre_ParILUExtractEBFC(hypre_ParCSRMatrixDiag(ALU), nLU, + BLUptr, &SLU, Eptr, Fptr); + hypre_ParCSRMatrixDestroy(ALU); + } + } + else + { + *BLUptr = NULL; + *Eptr = NULL; + *Fptr = NULL; + SLU = NULL; + } + + /* Compute total rows in Schur block */ + HYPRE_BigInt big_m = (HYPRE_BigInt) m; + hypre_MPI_Allreduce(&big_m, &total_rows, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); + + /* only form when total_rows > 0 */ + if (total_rows > 0) + { + /* now create S - need to get new column start */ + { + HYPRE_BigInt global_start; + hypre_MPI_Scan(&big_m, &global_start, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); + col_starts[0] = global_start - m; + col_starts[1] = global_start; + } + + if (!SLU) + { + SLU = hypre_CSRMatrixCreate(0, 0, 0); + hypre_CSRMatrixInitialize(SLU); + } + + S_diag_i = hypre_CSRMatrixI(SLU); + hypre_TMemcpy(&S_diag_nnz, S_diag_i + m, HYPRE_Int, 1, + HYPRE_MEMORY_HOST, hypre_CSRMatrixMemoryLocation(SLU)); + + /* Build ParCSRMatrix matS + * For example when np == 3 the new matrix takes the following form + * |IS_1 E_12 E_13| + * |E_21 IS_2 E_22| = S + * |E_31 E_32 IS_3| + * In which IS_i is the cusparse ILU factorization of S_i in one matrix + * */ + + /* We did nothing to A_offd, so all the data kept, just reorder them + * The create function takes comm, global num rows/cols, + * row/col start, num cols offd, nnz diag, nnz offd + */ + S_offd_nnz = hypre_CSRMatrixNumNonzeros(A_offd); + S_offd_ncols = hypre_CSRMatrixNumCols(A_offd); + + matS = hypre_ParCSRMatrixCreate(comm, + total_rows, + total_rows, + col_starts, + col_starts, + S_offd_ncols, + S_diag_nnz, + S_offd_nnz); + + /* first put diagonal data in */ + hypre_CSRMatrixDestroy(hypre_ParCSRMatrixDiag(matS)); + hypre_ParCSRMatrixDiag(matS) = SLU; + + /* now start to construct offdiag of S */ + S_offd = hypre_ParCSRMatrixOffd(matS); + hypre_CSRMatrixInitialize_v2(S_offd, 0, HYPRE_MEMORY_HOST); + S_offd_i = hypre_CSRMatrixI(S_offd); + S_offd_j = hypre_CSRMatrixJ(S_offd); + S_offd_data = hypre_CSRMatrixData(S_offd); + S_offd_colmap = hypre_CTAlloc(HYPRE_BigInt, S_offd_ncols, HYPRE_MEMORY_HOST); + + /* Set/Move A_offd to host */ + h_A_offd = (hypre_GetActualMemLocation(memory_location) == hypre_MEMORY_DEVICE) ? + hypre_CSRMatrixClone_v2(A_offd, 1, HYPRE_MEMORY_HOST) : A_offd; + A_offd_i = hypre_CSRMatrixI(h_A_offd); + A_offd_j = hypre_CSRMatrixJ(h_A_offd); + A_offd_data = hypre_CSRMatrixData(h_A_offd); + + /* Clone permutation arrays on the host */ + if (rperm && perm) + { + h_perm = hypre_IntArrayCloneDeep_v2(perm, HYPRE_MEMORY_HOST); + h_rperm = hypre_IntArrayCloneDeep_v2(rperm, HYPRE_MEMORY_HOST); + + perm_data = hypre_IntArrayData(h_perm); + rperm_data = hypre_IntArrayData(h_rperm); + } + + /* simply use a loop to copy data from A_offd */ + S_offd_i[0] = 0; + k3 = 0; + for (i = 1; i <= e; i++) + { + S_offd_i[i] = k3; + } + for (i = 0; i < m_e; i++) + { + col = (perm_data) ? perm_data[i + nI] : i + nI; + k1 = A_offd_i[col]; + k2 = A_offd_i[col + 1]; + for (j = k1; j < k2; j++) + { + S_offd_j[k3] = A_offd_j[j]; + S_offd_data[k3++] = A_offd_data[j]; + } + S_offd_i[i + 1 + e] = k3; + } + + /* give I, J, DATA to S_offd */ + hypre_CSRMatrixI(S_offd) = S_offd_i; + hypre_CSRMatrixJ(S_offd) = S_offd_j; + hypre_CSRMatrixData(S_offd) = S_offd_data; + + /* now we need to update S_offd_colmap */ + comm_pkg = hypre_ParCSRMatrixCommPkg(A); + + /* setup comm_pkg if not yet built */ + if (!comm_pkg) + { + hypre_MatvecCommPkgCreate(A); + comm_pkg = hypre_ParCSRMatrixCommPkg(A); + } + + /* get total num of send */ + num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); + begin = hypre_ParCSRCommPkgSendMapStart(comm_pkg, 0); + end = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends); + send_buf = hypre_TAlloc(HYPRE_BigInt, end - begin, HYPRE_MEMORY_HOST); + + /* copy new index into send_buf */ + for (i = 0; i < (end - begin); i++) + { + send_buf[i] = (rperm_data) ? + rperm_data[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, i + begin)] - + nLU + col_starts[0] : + hypre_ParCSRCommPkgSendMapElmt(comm_pkg, i + begin) - + nLU + col_starts[0]; + } + + /* main communication */ + comm_handle = hypre_ParCSRCommHandleCreate(21, comm_pkg, send_buf, S_offd_colmap); + hypre_ParCSRCommHandleDestroy(comm_handle); + + /* setup index */ + hypre_ParCSRMatrixColMapOffd(matS) = S_offd_colmap; + + hypre_ILUSortOffdColmap(matS); + + /* Move S_offd to final memory location */ + hypre_CSRMatrixMigrate(S_offd, memory_location); + + /* Free memory */ + hypre_TFree(send_buf, HYPRE_MEMORY_HOST); + if (h_A_offd != A_offd) + { + hypre_CSRMatrixDestroy(h_A_offd); + } + } /* end of forming S */ + else + { + hypre_CSRMatrixDestroy(SLU); + } + + /* Set output pointer */ + *matSptr = matS; + + /* Do not free perm_data/qperm_data */ + if (perm) + { + hypre_IntArrayData(perm) = NULL; + } + if (qperm) + { + hypre_IntArrayData(qperm) = NULL; + } + + /* Free memory */ + hypre_IntArrayDestroy(perm); + hypre_IntArrayDestroy(qperm); + hypre_IntArrayDestroy(rperm); + hypre_IntArrayDestroy(rqperm); + hypre_IntArrayDestroy(h_perm); + hypre_IntArrayDestroy(h_rperm); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_ILUSetupIterativeILU0Device + * + * This function computes an ILU0 iteratively with rocSPARSE. + * + * Input arguments: + * A - input matrix + * type - algorithm for computing iterative ILU0 + * option - internal flags used by rocSPARSE + * max_iter - max. number of iterations + * tolerance - stopping criteria in iterative algorithm + * + * Output arguments: + * num_iter_ptr - number of iterations + * history_ptr - list of corrections and residual values for each iteration + * (computed only when the 5th bit of option is active) + * + * Note: This function requires rocSPARSE 2.4.0 at least. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetupIterativeILU0Device(hypre_CSRMatrix *A, + HYPRE_Int type, + HYPRE_Int option, + HYPRE_Int max_iter, + HYPRE_Real tolerance, + HYPRE_Int *num_iter_ptr, + HYPRE_Real **history_ptr) +{ +#if defined (HYPRE_USING_ROCSPARSE) && (ROCSPARSE_VERSION >= 200400) + /* Input matrix data */ + HYPRE_Int num_rows = hypre_CSRMatrixNumRows(A); + HYPRE_Int num_cols = hypre_CSRMatrixNumCols(A); + HYPRE_Int num_nonzeros = hypre_CSRMatrixNumNonzeros(A); + HYPRE_Int *A_i = hypre_CSRMatrixI(A); + HYPRE_Int *A_j = hypre_CSRMatrixJ(A); + HYPRE_Complex *A_data = hypre_CSRMatrixData(A); + HYPRE_Complex *A_data_new; + + /* Vendor math sparse libraries data */ + void *buffer = NULL; + rocsparse_index_base idx_base = rocsparse_index_base_zero; + rocsparse_handle handle = hypre_HandleCusparseHandle(hypre_handle()); + rocsparse_datatype data_type; + size_t buffer_size; + HYPRE_Int history_size; + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("CSRMatrixITILU0"); + + /* Set default output */ + *num_iter_ptr = 0; + + /*------------------------------------------------------------------------------------- + * 0. Sanity checks + *-------------------------------------------------------------------------------------*/ + + if (num_rows != num_cols) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Not a square matrix!"); + return hypre_error_flag; + } + +#if defined(HYPRE_COMPLEX) + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Complex data type is not supported!"); + return hypre_error_flag; + +#elif defined(HYPRE_LONG_DOUBLE) + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Long-double type is not supported!"); + return hypre_error_flag; + +#elif defined(HYPRE_SINGLE) + data_type = rocsparse_datatype_f32_r; + +#else + data_type = rocsparse_datatype_f64_r; +#endif + + /*------------------------------------------------------------------------------------- + * 1. Sort columns belonging to each row, then copy result to new matrix + *-------------------------------------------------------------------------------------*/ + + hypre_CSRMatrixSortRow(A); + + /* TODO (VPM): make use of a non-zero initial guess if available. */ + A_data_new = hypre_CTAlloc(HYPRE_Complex, num_nonzeros, HYPRE_MEMORY_DEVICE); + + /*------------------------------------------------------------------------------------- + * 2. Get work array size + *-------------------------------------------------------------------------------------*/ + + HYPRE_ROCSPARSE_CALL(rocsparse_csritilu0_buffer_size(handle, + (rocsparse_itilu0_alg) type, + (rocsparse_int) option, + (rocsparse_int) max_iter, + (rocsparse_int) num_rows, + (rocsparse_int) num_nonzeros, + (const rocsparse_int*) A_i, + (const rocsparse_int*) A_j, + idx_base, + data_type, + &buffer_size)); + + /*------------------------------------------------------------------------------------- + * 3. Create work array on the device + *-------------------------------------------------------------------------------------*/ + + buffer = hypre_TAlloc(char, buffer_size, HYPRE_MEMORY_DEVICE); + + /*------------------------------------------------------------------------------------- + * 4. Perform the analysis (pre-processing) + *-------------------------------------------------------------------------------------*/ + + hypre_GpuProfilingPushRange("Analysis"); + HYPRE_ROCSPARSE_CALL(rocsparse_csritilu0_preprocess(handle, + (rocsparse_itilu0_alg) type, + (rocsparse_int) option, + (rocsparse_int) max_iter, + (rocsparse_int) num_rows, + (rocsparse_int) num_nonzeros, + (const rocsparse_int*) A_i, + (const rocsparse_int*) A_j, + idx_base, + data_type, + buffer_size, + buffer)); + hypre_GpuProfilingPopRange(); + + /*------------------------------------------------------------------------------------- + * 5. Compute the numerical factorization iteratively + *-------------------------------------------------------------------------------------*/ + + *num_iter_ptr = max_iter; + hypre_GpuProfilingPushRange("Factorization"); + HYPRE_ROCSPARSE_CALL(hypre_rocsparse_csritilu0_compute(handle, + (rocsparse_itilu0_alg) type, + (rocsparse_int) option, + (rocsparse_int*) num_iter_ptr, + tolerance, + (rocsparse_int) num_rows, + (rocsparse_int) num_nonzeros, + (const rocsparse_int*) A_i, + (const rocsparse_int*) A_j, + (const HYPRE_Complex*) A_data, + A_data_new, + idx_base, + buffer_size, + buffer)); + hypre_GpuProfilingPopRange(); + hypre_CSRMatrixData(A) = A_data_new; + hypre_TFree(A_data, HYPRE_MEMORY_DEVICE); + + /*------------------------------------------------------------------------------------- + * 6. Compute history if requested + *-------------------------------------------------------------------------------------*/ + + if (option & rocsparse_itilu0_option_convergence_history) + { + history_size = (*num_iter_ptr) * 2; + *history_ptr = hypre_TAlloc(HYPRE_Complex, history_size, HYPRE_MEMORY_HOST); + + HYPRE_ROCSPARSE_CALL(hypre_rocsparse_csritilu0_history(handle, + (rocsparse_itilu0_alg) type, + (rocsparse_int*) num_iter_ptr, + *history_ptr, + buffer_size, + buffer)); + } + + /*------------------------------------------------------------------------------------- + * 7. Free memory + *-------------------------------------------------------------------------------------*/ + + /* Free buffer */ + hypre_TFree(buffer, HYPRE_MEMORY_DEVICE); + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; +#else + HYPRE_UNUSED_VAR(A); + HYPRE_UNUSED_VAR(type); + HYPRE_UNUSED_VAR(option); + HYPRE_UNUSED_VAR(max_iter); + HYPRE_UNUSED_VAR(tolerance); + HYPRE_UNUSED_VAR(num_iter_ptr); + HYPRE_UNUSED_VAR(history_ptr); + + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Iterative ILU0 requires rocSPARSE 2.4.0 at least!"); +#endif + + return hypre_error_flag; +} + +#endif /* defined(HYPRE_USING_GPU) */ diff --git a/external/hypre/src/parcsr_ls/par_ilu_solve.c b/external/hypre/src/parcsr_ls/par_ilu_solve.c index 3c3530d9..45b113fc 100644 --- a/external/hypre/src/parcsr_ls/par_ilu_solve.c +++ b/external/hypre/src/parcsr_ls/par_ilu_solve.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -13,109 +13,107 @@ #include "_hypre_parcsr_ls.h" #include "_hypre_utilities.hpp" -#include "par_ilu.h" /*-------------------------------------------------------------------- * hypre_ILUSolve + * + * TODO (VPM): Change variable names of F_array and U_array *--------------------------------------------------------------------*/ + HYPRE_Int hypre_ILUSolve( void *ilu_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ) { - MPI_Comm comm = hypre_ParCSRMatrixComm(A); - // HYPRE_Int i; - - hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; - -#ifdef HYPRE_USING_CUDA - /* pointers to cusparse data, note that they are not NULL only when needed */ - cusparseMatDescr_t matL_des = hypre_ParILUDataMatLMatrixDescription(ilu_data); - cusparseMatDescr_t matU_des = hypre_ParILUDataMatUMatrixDescription(ilu_data); - void *ilu_solve_buffer = hypre_ParILUDataILUSolveBuffer(ilu_data);//device memory - cusparseSolvePolicy_t ilu_solve_policy = hypre_ParILUDataILUSolvePolicy(ilu_data); - hypre_CSRMatrix *matALU_d = hypre_ParILUDataMatAILUDevice(ilu_data); - hypre_CSRMatrix *matBLU_d = hypre_ParILUDataMatBILUDevice(ilu_data); - //hypre_CSRMatrix *matSLU_d = hypre_ParILUDataMatSILUDevice(ilu_data); - hypre_CSRMatrix *matE_d = hypre_ParILUDataMatEDevice(ilu_data); - hypre_CSRMatrix *matF_d = hypre_ParILUDataMatFDevice(ilu_data); - csrsv2Info_t matAL_info = hypre_ParILUDataMatALILUSolveInfo(ilu_data); - csrsv2Info_t matAU_info = hypre_ParILUDataMatAUILUSolveInfo(ilu_data); - csrsv2Info_t matBL_info = hypre_ParILUDataMatBLILUSolveInfo(ilu_data); - csrsv2Info_t matBU_info = hypre_ParILUDataMatBUILUSolveInfo(ilu_data); - csrsv2Info_t matSL_info = hypre_ParILUDataMatSLILUSolveInfo(ilu_data); - csrsv2Info_t matSU_info = hypre_ParILUDataMatSUILUSolveInfo(ilu_data); - hypre_ParCSRMatrix *Aperm = hypre_ParILUDataAperm(ilu_data); - //hypre_ParCSRMatrix *R = hypre_ParILUDataR(ilu_data); - //hypre_ParCSRMatrix *P = hypre_ParILUDataP(ilu_data); + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; + + /* Matrices */ + hypre_ParCSRMatrix *matmL = hypre_ParILUDataMatLModified(ilu_data); + hypre_ParCSRMatrix *matmU = hypre_ParILUDataMatUModified(ilu_data); + hypre_ParCSRMatrix *matA = hypre_ParILUDataMatA(ilu_data); + hypre_ParCSRMatrix *matL = hypre_ParILUDataMatL(ilu_data); + hypre_ParCSRMatrix *matU = hypre_ParILUDataMatU(ilu_data); + hypre_ParCSRMatrix *matS = hypre_ParILUDataMatS(ilu_data); + HYPRE_Real *matD = hypre_ParILUDataMatD(ilu_data); + HYPRE_Real *matmD = hypre_ParILUDataMatDModified(ilu_data); + + /* Vectors */ + HYPRE_Int ilu_type = hypre_ParILUDataIluType(ilu_data); + HYPRE_Int *perm = hypre_ParILUDataPerm(ilu_data); + HYPRE_Int *qperm = hypre_ParILUDataQPerm(ilu_data); + hypre_ParVector *F_array = hypre_ParILUDataF(ilu_data); + hypre_ParVector *U_array = hypre_ParILUDataU(ilu_data); + + /* Device data */ +#if defined(HYPRE_USING_GPU) + hypre_CSRMatrix *matALU_d = hypre_ParILUDataMatAILUDevice(ilu_data); + hypre_CSRMatrix *matBLU_d = hypre_ParILUDataMatBILUDevice(ilu_data); + hypre_CSRMatrix *matE_d = hypre_ParILUDataMatEDevice(ilu_data); + hypre_CSRMatrix *matF_d = hypre_ParILUDataMatFDevice(ilu_data); + hypre_ParCSRMatrix *Aperm = hypre_ParILUDataAperm(ilu_data); + hypre_Vector *Adiag_diag = hypre_ParILUDataADiagDiag(ilu_data); + hypre_Vector *Sdiag_diag = hypre_ParILUDataSDiagDiag(ilu_data); + hypre_ParVector *Ztemp = hypre_ParILUDataZTemp(ilu_data); + HYPRE_Int test_opt = hypre_ParILUDataTestOption(ilu_data); #endif - /* get matrices */ - HYPRE_Int ilu_type = hypre_ParILUDataIluType(ilu_data); - HYPRE_Int *perm = hypre_ParILUDataPerm(ilu_data); - HYPRE_Int *qperm = hypre_ParILUDataQPerm(ilu_data); - hypre_ParCSRMatrix *matA = hypre_ParILUDataMatA(ilu_data); - hypre_ParCSRMatrix *matL = hypre_ParILUDataMatL(ilu_data); - HYPRE_Real *matD = hypre_ParILUDataMatD(ilu_data); - hypre_ParCSRMatrix *matU = hypre_ParILUDataMatU(ilu_data); -#ifndef HYPRE_USING_CUDA - hypre_ParCSRMatrix *matmL = hypre_ParILUDataMatLModified(ilu_data); - HYPRE_Real *matmD = hypre_ParILUDataMatDModified(ilu_data); - hypre_ParCSRMatrix *matmU = hypre_ParILUDataMatUModified(ilu_data); -#endif - hypre_ParCSRMatrix *matS = hypre_ParILUDataMatS(ilu_data); - - HYPRE_Int iter, num_procs, my_id; - - hypre_ParVector *F_array = hypre_ParILUDataF(ilu_data); - hypre_ParVector *U_array = hypre_ParILUDataU(ilu_data); - - /* get settings */ - HYPRE_Real tol = hypre_ParILUDataTol(ilu_data); - HYPRE_Int logging = hypre_ParILUDataLogging(ilu_data); - HYPRE_Int print_level = hypre_ParILUDataPrintLevel(ilu_data); - HYPRE_Int max_iter = hypre_ParILUDataMaxIter(ilu_data); - HYPRE_Real *norms = hypre_ParILUDataRelResNorms(ilu_data); - hypre_ParVector *Ftemp = hypre_ParILUDataFTemp(ilu_data); - hypre_ParVector *Utemp = hypre_ParILUDataUTemp(ilu_data); - hypre_ParVector *Xtemp = hypre_ParILUDataXTemp(ilu_data); - hypre_ParVector *Ytemp = hypre_ParILUDataYTemp(ilu_data); - HYPRE_Real *fext = hypre_ParILUDataFExt(ilu_data); - HYPRE_Real *uext = hypre_ParILUDataUExt(ilu_data); - hypre_ParVector *residual; - - HYPRE_Real alpha = -1; - HYPRE_Real beta = 1; - HYPRE_Real conv_factor = 0.0; - HYPRE_Real resnorm = 1.0; - HYPRE_Real init_resnorm = 0.0; - HYPRE_Real rel_resnorm; - HYPRE_Real rhs_norm = 0.0; - HYPRE_Real old_resnorm; - HYPRE_Real ieee_check = 0.0; - HYPRE_Real operat_cmplxty = hypre_ParILUDataOperatorComplexity(ilu_data); - - HYPRE_Int Solve_err_flag; -#ifdef HYPRE_USING_CUDA - HYPRE_Int test_opt; -#endif + /* Solver settings */ + HYPRE_Real tol = hypre_ParILUDataTol(ilu_data); + HYPRE_Int logging = hypre_ParILUDataLogging(ilu_data); + HYPRE_Int print_level = hypre_ParILUDataPrintLevel(ilu_data); + HYPRE_Int max_iter = hypre_ParILUDataMaxIter(ilu_data); + HYPRE_Int tri_solve = hypre_ParILUDataTriSolve(ilu_data); + HYPRE_Int lower_jacobi_iters = hypre_ParILUDataLowerJacobiIters(ilu_data); + HYPRE_Int upper_jacobi_iters = hypre_ParILUDataUpperJacobiIters(ilu_data); + HYPRE_Real *norms = hypre_ParILUDataRelResNorms(ilu_data); + hypre_ParVector *Ftemp = hypre_ParILUDataFTemp(ilu_data); + hypre_ParVector *Utemp = hypre_ParILUDataUTemp(ilu_data); + hypre_ParVector *Xtemp = hypre_ParILUDataXTemp(ilu_data); + hypre_ParVector *Ytemp = hypre_ParILUDataYTemp(ilu_data); + HYPRE_Real *fext = hypre_ParILUDataFExt(ilu_data); + HYPRE_Real *uext = hypre_ParILUDataUExt(ilu_data); + hypre_ParVector *residual = NULL; + HYPRE_Real alpha = -1.0; + HYPRE_Real beta = 1.0; + HYPRE_Real conv_factor = 0.0; + HYPRE_Real resnorm = 1.0; + HYPRE_Real init_resnorm = 0.0; + HYPRE_Real rel_resnorm; + HYPRE_Real rhs_norm = 0.0; + HYPRE_Real old_resnorm; + HYPRE_Real ieee_check = 0.0; + HYPRE_Real operat_cmplxty = hypre_ParILUDataOperatorComplexity(ilu_data); + HYPRE_Int Solve_err_flag; + HYPRE_Int iter, num_procs, my_id; /* problem size */ - HYPRE_Int n = hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(A)); - HYPRE_Int nLU = hypre_ParILUDataNLU(ilu_data); - HYPRE_Int *u_end = hypre_ParILUDataUEnd(ilu_data); + HYPRE_Int n = hypre_ParCSRMatrixNumRows(A); + HYPRE_Int nLU = hypre_ParILUDataNLU(ilu_data); + HYPRE_Int *u_end = hypre_ParILUDataUEnd(ilu_data); /* Schur system solve */ - HYPRE_Solver schur_solver = hypre_ParILUDataSchurSolver(ilu_data); - HYPRE_Solver schur_precond = hypre_ParILUDataSchurPrecond(ilu_data); - hypre_ParVector *rhs = hypre_ParILUDataRhs(ilu_data); - hypre_ParVector *x = hypre_ParILUDataX(ilu_data); + HYPRE_Solver schur_solver = hypre_ParILUDataSchurSolver(ilu_data); + HYPRE_Solver schur_precond = hypre_ParILUDataSchurPrecond(ilu_data); + hypre_ParVector *rhs = hypre_ParILUDataRhs(ilu_data); + hypre_ParVector *x = hypre_ParILUDataX(ilu_data); + +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy2( hypre_ParCSRMatrixMemoryLocation(A), + hypre_ParVectorMemoryLocation(f) ); + + /* VPM: Placeholder check to avoid -Wunused-variable warning. TODO: remove this */ + if (exec != HYPRE_EXEC_DEVICE && exec != HYPRE_EXEC_HOST) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Need to run either on host or device!"); + return hypre_error_flag; + } +#endif - /* begin */ HYPRE_ANNOTATE_FUNC_BEGIN; - if(logging > 1) + if (logging > 1) { residual = hypre_ParILUDataResidual(ilu_data); } @@ -123,11 +121,12 @@ hypre_ILUSolve( void *ilu_vdata, hypre_ParILUDataNumIterations(ilu_data) = 0; hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_rank(comm, &my_id); /*----------------------------------------------------------------------- * Write the solver parameters *-----------------------------------------------------------------------*/ + if (my_id == 0 && print_level > 1) { hypre_ILUWriteSolverParams(ilu_data); @@ -138,6 +137,7 @@ hypre_ILUSolve( void *ilu_vdata, *-----------------------------------------------------------------------*/ Solve_err_flag = 0; + /*----------------------------------------------------------------------- * write some initial info *-----------------------------------------------------------------------*/ @@ -147,20 +147,20 @@ hypre_ILUSolve( void *ilu_vdata, hypre_printf("\n\n ILU SOLVER SOLUTION INFO:\n"); } - /*----------------------------------------------------------------------- * Compute initial residual and print *-----------------------------------------------------------------------*/ + if (print_level > 1 || logging > 1 || tol > 0.) { - if ( logging > 1 ) + if (logging > 1) { - hypre_ParVectorCopy(f, residual ); + hypre_ParVectorCopy(f, residual); if (tol > 0.0) { - hypre_ParCSRMatrixMatvec(alpha, A, u, beta, residual ); + hypre_ParCSRMatrixMatvec(alpha, A, u, beta, residual); } - resnorm = sqrt(hypre_ParVectorInnerProd( residual, residual )); + resnorm = hypre_sqrt(hypre_ParVectorInnerProd(residual, residual)); } else { @@ -169,14 +169,14 @@ hypre_ILUSolve( void *ilu_vdata, { hypre_ParCSRMatrixMatvec(alpha, A, u, beta, Ftemp); } - resnorm = sqrt(hypre_ParVectorInnerProd(Ftemp, Ftemp)); + resnorm = hypre_sqrt(hypre_ParVectorInnerProd(Ftemp, Ftemp)); } - /* Since it is does not diminish performance, attempt to return an error flag + /* Since it does not diminish performance, attempt to return an error flag and notify users when they supply bad input. */ if (resnorm != 0.) { - ieee_check = resnorm/resnorm; /* INF -> NaN conversion */ + ieee_check = resnorm / resnorm; /* INF -> NaN conversion */ } if (ieee_check != ieee_check) { @@ -199,7 +199,7 @@ hypre_ILUSolve( void *ilu_vdata, } init_resnorm = resnorm; - rhs_norm = sqrt(hypre_ParVectorInnerProd(f, f)); + rhs_norm = hypre_sqrt(hypre_ParVectorInnerProd(f, f)); if (rhs_norm > HYPRE_REAL_EPSILON) { rel_resnorm = init_resnorm / rhs_norm; @@ -208,7 +208,7 @@ hypre_ILUSolve( void *ilu_vdata, { /* rhs is zero, return a zero solution */ hypre_ParVectorSetConstantValues(U_array, 0.0); - if(logging > 0) + if (logging > 0) { rel_resnorm = 0.0; hypre_ParILUDataFinalRelResidualNorm(ilu_data) = rel_resnorm; @@ -228,75 +228,156 @@ hypre_ILUSolve( void *ilu_vdata, hypre_printf(" relative\n"); hypre_printf(" residual factor residual\n"); hypre_printf(" -------- ------ --------\n"); - hypre_printf(" Initial %e %e\n",init_resnorm, - rel_resnorm); + hypre_printf(" Initial %e %e\n", init_resnorm, + rel_resnorm); } - matA = A; + matA = A; U_array = u; F_array = f; /************** Main Solver Loop - always do 1 iteration ************/ iter = 0; - while ((rel_resnorm >= tol || iter < 1) - && iter < max_iter) + while ((rel_resnorm >= tol || iter < 1) && + (iter < max_iter)) { + /* Do one solve on LU*e = r */ + switch (ilu_type) + { + case 0: case 1: default: + /* TODO (VPM): Encapsulate host and device functions into a single one */ +#if defined(HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_DEVICE) + { + /* Apply GPU-accelerated LU solve - BJ-ILU0 */ + if (tri_solve == 1) + { + hypre_ILUSolveLUDevice(matA, matBLU_d, F_array, U_array, perm, Utemp, Ftemp); + } + else + { + hypre_ILUSolveLUIterDevice(matA, matBLU_d, F_array, U_array, perm, + Utemp, Ftemp, Ztemp, &Adiag_diag, + lower_jacobi_iters, upper_jacobi_iters); - /* Do one solve on LUe=r */ - switch(ilu_type){ - case 0: case 1: -#ifdef HYPRE_USING_CUDA - /* Apply GPU-accelerated LU solve */ - hypre_ILUSolveCusparseLU(matA, matL_des, matU_des, matBL_info, matBU_info, matBLU_d, ilu_solve_policy, - ilu_solve_buffer, F_array, U_array, perm, n, Utemp, Ftemp);//BJ-cusparse -#else - hypre_ILUSolveLU(matA, F_array, U_array, perm, n, matL, matD, matU, Utemp, Ftemp); //BJ + /* Assign this now, in case it was set in method above */ + hypre_ParILUDataADiagDiag(ilu_data) = Adiag_diag; + } + } + else #endif + { + /* BJ - hypre_ilu */ + if (tri_solve == 1) + { + hypre_ILUSolveLU(matA, F_array, U_array, perm, n, + matL, matD, matU, Utemp, Ftemp); + } + else + { + hypre_ILUSolveLUIter(matA, F_array, U_array, perm, n, + matL, matD, matU, Utemp, Ftemp, + lower_jacobi_iters, upper_jacobi_iters); + } + } break; + case 10: case 11: -#ifdef HYPRE_USING_CUDA - /* Apply GPU-accelerated LU solve */ - hypre_ILUSolveCusparseSchurGMRES(matA, F_array, U_array, perm, nLU, matS, Utemp, Ftemp, schur_solver, schur_precond, rhs, x, u_end, - matL_des, matU_des, matBL_info, matBU_info, matSL_info, matSU_info, - matBLU_d, matE_d, matF_d, ilu_solve_policy, ilu_solve_buffer);//GMRES-cusparse -#else - hypre_ILUSolveSchurGMRES(matA, F_array, U_array, perm, perm, nLU, matL, matD, matU, matS, - Utemp, Ftemp, schur_solver, schur_precond, rhs, x, u_end); //GMRES +#if defined(HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_DEVICE) + { + /* Apply GPU-accelerated GMRES-ILU solve */ + if (tri_solve == 1) + { + hypre_ILUSolveSchurGMRESDevice(matA, F_array, U_array, perm, nLU, matS, + Utemp, Ftemp, schur_solver, schur_precond, + rhs, x, u_end, matBLU_d, matE_d, matF_d); + } + else + { + hypre_ILUSolveSchurGMRESJacIterDevice(matA, F_array, U_array, perm, nLU, matS, + Utemp, Ftemp, schur_solver, schur_precond, + rhs, x, u_end, matBLU_d, matE_d, matF_d, + Ztemp, &Adiag_diag, &Sdiag_diag, + lower_jacobi_iters, upper_jacobi_iters); + + /* Assign this now, in case it was set in method above */ + hypre_ParILUDataADiagDiag(ilu_data) = Adiag_diag; + hypre_ParILUDataSDiagDiag(ilu_data) = Sdiag_diag; + } + } + else #endif + { + hypre_ILUSolveSchurGMRES(matA, F_array, U_array, perm, perm, nLU, + matL, matD, matU, matS, Utemp, Ftemp, + schur_solver, schur_precond, rhs, x, u_end); + } break; + case 20: case 21: +#if defined(HYPRE_USING_GPU) && !defined(HYPRE_USING_UNIFIED_MEMORY) + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "NSH+ILU solve on device runs requires unified memory!"); + return hypre_error_flag; + } +#endif + /* NSH+ILU */ hypre_ILUSolveSchurNSH(matA, F_array, U_array, perm, nLU, matL, matD, matU, matS, - Utemp, Ftemp, schur_solver, rhs, x, u_end); //MR+NSH + Utemp, Ftemp, schur_solver, rhs, x, u_end); break; + case 30: case 31: - hypre_ILUSolveLURAS(matA, F_array, U_array, perm, matL, matD, matU, Utemp, Utemp, fext, uext); //RAS +#if defined(HYPRE_USING_GPU) && !defined(HYPRE_USING_UNIFIED_MEMORY) + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "RAS+ILU solve on device runs requires unified memory!"); + return hypre_error_flag; + } +#endif + /* RAS */ + hypre_ILUSolveLURAS(matA, F_array, U_array, perm, matL, matD, matU, + Utemp, Utemp, fext, uext); break; + case 40: case 41: - hypre_ILUSolveSchurGMRES(matA, F_array, U_array, perm, qperm, nLU, matL, matD, matU, matS, - Utemp, Ftemp, schur_solver, schur_precond, rhs, x, u_end); //GMRES - break; - case 50: -#ifdef HYPRE_USING_CUDA - test_opt = hypre_ParILUDataTestOption(ilu_data); - hypre_ILUSolveRAPGMRES(matA, F_array, U_array, perm, nLU, matS, Utemp, Ftemp, Xtemp, Ytemp, schur_solver, schur_precond, rhs, x, u_end, - matL_des, matU_des, matAL_info, matAU_info, matBL_info, matBU_info, matSL_info, matSU_info, - Aperm, matALU_d, matBLU_d, matE_d, matF_d, ilu_solve_policy, ilu_solve_buffer, test_opt);//GMRES-RAP -#else - hypre_ILUSolveRAPGMRESHOST(matA, F_array, U_array, perm, nLU, matL, matD, matU, matmL, matmD, matmU, Utemp, Ftemp, Xtemp, Ytemp, - schur_solver, schur_precond, rhs, x, u_end);//GMRES-RAP +#if defined(HYPRE_USING_GPU) && !defined(HYPRE_USING_UNIFIED_MEMORY) + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "ddPQ+GMRES+ILU solve on device runs requires unified memory!"); + return hypre_error_flag; + } #endif + + /* ddPQ + GMRES + hypre_ilu[k,t]() */ + hypre_ILUSolveSchurGMRES(matA, F_array, U_array, perm, qperm, nLU, + matL, matD, matU, matS, Utemp, Ftemp, + schur_solver, schur_precond, rhs, x, u_end); break; - default: -#ifdef HYPRE_USING_CUDA - /* Apply GPU-accelerated LU solve */ - hypre_ILUSolveCusparseLU(matA, matL_des, matU_des, matBL_info, matBU_info, matBLU_d, ilu_solve_policy, - ilu_solve_buffer, F_array, U_array, perm, n, Utemp, Ftemp);//BJ-cusparse -#else - hypre_ILUSolveLU(matA, F_array, U_array, perm, n, matL, matD, matU, Utemp, Ftemp); //BJ + + case 50: + /* GMRES-RAP */ +#if defined(HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_ILUSolveRAPGMRESDevice(matA, F_array, U_array, perm, nLU, matS, Utemp, Ftemp, + Xtemp, Ytemp, schur_solver, schur_precond, rhs, x, + u_end, Aperm, matALU_d, matBLU_d, matE_d, matF_d, + test_opt); + } + else #endif + { + hypre_ILUSolveRAPGMRESHost(matA, F_array, U_array, perm, nLU, matL, matD, matU, + matmL, matmD, matmU, Utemp, Ftemp, Xtemp, Ytemp, + schur_solver, schur_precond, rhs, x, u_end); + } break; - } /*--------------------------------------------------------------- @@ -307,19 +388,28 @@ hypre_ILUSolve( void *ilu_vdata, { old_resnorm = resnorm; - if ( logging > 1 ) { + if (logging > 1) + { hypre_ParVectorCopy(F_array, residual); - hypre_ParCSRMatrixMatvec(alpha, matA, U_array, beta, residual ); - resnorm = sqrt(hypre_ParVectorInnerProd( residual, residual )); + hypre_ParCSRMatrixMatvec(alpha, matA, U_array, beta, residual); + resnorm = hypre_sqrt(hypre_ParVectorInnerProd(residual, residual)); } - else { + else + { hypre_ParVectorCopy(F_array, Ftemp); hypre_ParCSRMatrixMatvec(alpha, matA, U_array, beta, Ftemp); - resnorm = sqrt(hypre_ParVectorInnerProd(Ftemp, Ftemp)); + resnorm = hypre_sqrt(hypre_ParVectorInnerProd(Ftemp, Ftemp)); + } + + if (old_resnorm) + { + conv_factor = resnorm / old_resnorm; + } + else + { + conv_factor = resnorm; } - if (old_resnorm) conv_factor = resnorm / old_resnorm; - else conv_factor = resnorm; if (rhs_norm > HYPRE_REAL_EPSILON) { rel_resnorm = resnorm / rhs_norm; @@ -339,7 +429,7 @@ hypre_ILUSolve( void *ilu_vdata, if (my_id == 0 && print_level > 1) { hypre_printf(" ILUSolve %2d %e %f %e \n", iter, - resnorm, conv_factor, rel_resnorm); + resnorm, conv_factor, rel_resnorm); } } @@ -357,7 +447,7 @@ hypre_ILUSolve( void *ilu_vdata, if (iter > 0 && init_resnorm) { - conv_factor = pow((resnorm/init_resnorm),(1.0/(HYPRE_Real) iter)); + conv_factor = hypre_pow((resnorm / init_resnorm), (1.0 / (HYPRE_Real) iter)); } else { @@ -373,11 +463,11 @@ hypre_ILUSolve( void *ilu_vdata, { hypre_printf("\n\n=============================================="); hypre_printf("\n NOTE: Convergence tolerance was not achieved\n"); - hypre_printf(" within the allowed %d iterations\n",max_iter); + hypre_printf(" within the allowed %d iterations\n", max_iter); hypre_printf("=============================================="); } - hypre_printf("\n\n Average Convergence Factor = %f \n",conv_factor); - hypre_printf(" operator = %f\n",operat_cmplxty); + hypre_printf("\n\n Average Convergence Factor = %f \n", conv_factor); + hypre_printf(" operator = %f\n", operat_cmplxty); } } @@ -386,78 +476,81 @@ hypre_ILUSolve( void *ilu_vdata, return hypre_error_flag; } -/* Schur Complement solve with GMRES on schur complement - * ParCSRMatrix S is already built in ilu data sturcture, here directly use S - * L, D and U factors only have local scope (no off-diagonal processor terms) - * so apart from the residual calculation (which uses A), the solves with the - * L and U factors are local. +/*-------------------------------------------------------------------- + * hypre_ILUSolveSchurGMRES + * + * Schur Complement solve with GMRES on schur complement + * + * ParCSRMatrix S is already built in ilu data sturcture, here directly + * use S, L, D and U factors only have local scope (no off-diag terms) + * so apart from the residual calculation (which uses A), the solves + * with the L and U factors are local. + * * S is the global Schur complement * schur_solver is a GMRES solver * schur_precond is the ILU preconditioner for GMRES * rhs and x are helper vector for solving Schur system -*/ + *--------------------------------------------------------------------*/ HYPRE_Int -hypre_ILUSolveSchurGMRES(hypre_ParCSRMatrix *A, hypre_ParVector *f, - hypre_ParVector *u, HYPRE_Int *perm, HYPRE_Int *qperm, - HYPRE_Int nLU, hypre_ParCSRMatrix *L, - HYPRE_Real* D, hypre_ParCSRMatrix *U, - hypre_ParCSRMatrix *S, - hypre_ParVector *ftemp, hypre_ParVector *utemp, - HYPRE_Solver schur_solver, HYPRE_Solver schur_precond, - hypre_ParVector *rhs, hypre_ParVector *x, HYPRE_Int *u_end) +hypre_ILUSolveSchurGMRES(hypre_ParCSRMatrix *A, + hypre_ParVector *f, + hypre_ParVector *u, + HYPRE_Int *perm, + HYPRE_Int *qperm, + HYPRE_Int nLU, + hypre_ParCSRMatrix *L, + HYPRE_Real *D, + hypre_ParCSRMatrix *U, + hypre_ParCSRMatrix *S, + hypre_ParVector *ftemp, + hypre_ParVector *utemp, + HYPRE_Solver schur_solver, + HYPRE_Solver schur_precond, + hypre_ParVector *rhs, + hypre_ParVector *x, + HYPRE_Int *u_end) { - /* data objects for communication */ - // MPI_Comm comm = hypre_ParCSRMatrixComm(A); + HYPRE_UNUSED_VAR(schur_precond); - /* data objects for L and U */ - hypre_CSRMatrix *L_diag = hypre_ParCSRMatrixDiag(L); + /* Data objects for L and U */ + hypre_CSRMatrix *L_diag = hypre_ParCSRMatrixDiag(L); HYPRE_Real *L_diag_data = hypre_CSRMatrixData(L_diag); - HYPRE_Int *L_diag_i = hypre_CSRMatrixI(L_diag); - HYPRE_Int *L_diag_j = hypre_CSRMatrixJ(L_diag); - hypre_CSRMatrix *U_diag = hypre_ParCSRMatrixDiag(U); + HYPRE_Int *L_diag_i = hypre_CSRMatrixI(L_diag); + HYPRE_Int *L_diag_j = hypre_CSRMatrixJ(L_diag); + hypre_CSRMatrix *U_diag = hypre_ParCSRMatrixDiag(U); HYPRE_Real *U_diag_data = hypre_CSRMatrixData(U_diag); - HYPRE_Int *U_diag_i = hypre_CSRMatrixI(U_diag); - HYPRE_Int *U_diag_j = hypre_CSRMatrixJ(U_diag); + HYPRE_Int *U_diag_i = hypre_CSRMatrixI(U_diag); + HYPRE_Int *U_diag_j = hypre_CSRMatrixJ(U_diag); + + /* Vectors */ hypre_Vector *utemp_local = hypre_ParVectorLocalVector(utemp); HYPRE_Real *utemp_data = hypre_VectorData(utemp_local); hypre_Vector *ftemp_local = hypre_ParVectorLocalVector(ftemp); HYPRE_Real *ftemp_data = hypre_VectorData(ftemp_local); + HYPRE_Real alpha = -1.0; + HYPRE_Real beta = 1.0; + HYPRE_Int i, j, k1, k2, col; - HYPRE_Real alpha; - HYPRE_Real beta; - HYPRE_Int i, j, k1, k2, col; - - /* problem size */ - HYPRE_Int n = hypre_CSRMatrixNumRows(L_diag); - // HYPRE_Int m = n - nLU; - - /* other data objects for computation */ - // hypre_Vector *f_local; - // HYPRE_Real *f_data; + /* Problem size */ + HYPRE_Int n = hypre_CSRMatrixNumRows(L_diag); hypre_Vector *rhs_local; HYPRE_Real *rhs_data; hypre_Vector *x_local; HYPRE_Real *x_data; - /* begin */ - beta = 1.0; - alpha = -1.0; - - /* compute residual */ + /* Compute residual */ hypre_ParCSRMatrixMatvecOutOfPlace(alpha, A, u, beta, f, ftemp); /* 1st need to solve LBi*xi = fi * L solve, solve xi put in u_temp upper */ - // f_local = hypre_ParVectorLocalVector(f); - // f_data = hypre_VectorData(f_local); /* now update with L to solve */ - for(i = 0 ; i < nLU ; i ++) + for (i = 0 ; i < nLU ; i ++) { utemp_data[qperm[i]] = ftemp_data[perm[i]]; - k1 = L_diag_i[i] ; k2 = L_diag_i[i+1]; - for(j = k1 ; j < k2 ; j ++) + k1 = L_diag_i[i] ; k2 = L_diag_i[i + 1]; + for (j = k1 ; j < k2 ; j ++) { utemp_data[qperm[i]] -= L_diag_data[j] * utemp_data[qperm[L_diag_j[j]]]; } @@ -466,10 +559,10 @@ hypre_ILUSolveSchurGMRES(hypre_ParCSRMatrix *A, hypre_ParVector *f, /* 2nd need to compute g'i = gi - Ei*UBi^-1*xi * now put g'i into the f_temp lower */ - for(i = nLU ; i < n ; i ++) + for (i = nLU ; i < n ; i ++) { - k1 = L_diag_i[i] ; k2 = L_diag_i[i+1]; - for(j = k1 ; j < k2 ; j ++) + k1 = L_diag_i[i] ; k2 = L_diag_i[i + 1]; + for (j = k1 ; j < k2 ; j ++) { col = L_diag_j[j]; ftemp_data[perm[i]] -= L_diag_data[j] * utemp_data[qperm[col]]; @@ -481,10 +574,11 @@ hypre_ILUSolveSchurGMRES(hypre_ParCSRMatrix *A, hypre_ParVector *f, * solve y put in u_temp lower * only solve whe S is not NULL */ - if(S) + if (S) { /*initialize solution to zero for residual equation */ hypre_ParVectorSetConstantValues(x, 0.0); + /* setup vectors for solve */ rhs_local = hypre_ParVectorLocalVector(rhs); rhs_data = hypre_VectorData(rhs_local); @@ -492,18 +586,18 @@ hypre_ILUSolveSchurGMRES(hypre_ParCSRMatrix *A, hypre_ParVector *f, x_data = hypre_VectorData(x_local); /* set rhs value */ - for(i = nLU ; i < n ; i ++) + for (i = nLU ; i < n ; i ++) { - rhs_data[i-nLU] = ftemp_data[perm[i]]; + rhs_data[i - nLU] = ftemp_data[perm[i]]; } /* solve */ - HYPRE_GMRESSolve(schur_solver,(HYPRE_Matrix)S,(HYPRE_Vector)rhs,(HYPRE_Vector)x); + HYPRE_GMRESSolve(schur_solver, (HYPRE_Matrix)S, (HYPRE_Vector)rhs, (HYPRE_Vector)x); /* copy value back to original */ - for(i = nLU ; i < n ; i ++) + for (i = nLU ; i < n ; i ++) { - utemp_data[qperm[i]] = x_data[i-nLU]; + utemp_data[qperm[i]] = x_data[i - nLU]; } } @@ -512,19 +606,19 @@ hypre_ILUSolveSchurGMRES(hypre_ParCSRMatrix *A, hypre_ParVector *f, * only do this computation when nLU < n * U is unsorted, search is expensive when unnecessary */ - if(nLU < n) + if (nLU < n) { - for(i = 0 ; i < nLU ; i ++) + for (i = 0 ; i < nLU ; i ++) { ftemp_data[perm[i]] = utemp_data[qperm[i]]; - k1 = u_end[i] ; k2 = U_diag_i[i+1]; - for(j = k1 ; j < k2 ; j ++) + k1 = u_end[i] ; k2 = U_diag_i[i + 1]; + for (j = k1 ; j < k2 ; j ++) { col = U_diag_j[j]; ftemp_data[perm[i]] -= U_diag_data[j] * utemp_data[qperm[col]]; } } - for(i = 0 ; i < nLU ; i ++) + for (i = 0 ; i < nLU ; i ++) { utemp_data[qperm[i]] = ftemp_data[perm[i]]; } @@ -532,10 +626,10 @@ hypre_ILUSolveSchurGMRES(hypre_ParCSRMatrix *A, hypre_ParVector *f, /* 5th need to solve UBi*ui = zi */ /* put result in u_temp upper */ - for(i = nLU-1 ; i >= 0 ; i --) + for (i = nLU - 1 ; i >= 0 ; i --) { k1 = U_diag_i[i] ; k2 = u_end[i]; - for(j = k1 ; j < k2 ; j ++) + for (j = k1 ; j < k2 ; j ++) { col = U_diag_j[j]; utemp_data[qperm[i]] -= U_diag_data[j] * utemp_data[qperm[col]]; @@ -545,80 +639,82 @@ hypre_ILUSolveSchurGMRES(hypre_ParCSRMatrix *A, hypre_ParVector *f, /* done, now everything are in u_temp, update solution */ hypre_ParVectorAxpy(beta, utemp, u); + return hypre_error_flag; } -/* Newton-Schulz-Hotelling solve +/*-------------------------------------------------------------------- + * hypre_ILUSolveSchurNSH + * + * Newton-Schulz-Hotelling solve + * * ParCSRMatrix S is already built in ilu data sturcture + * * S here is the INVERSE of Schur Complement - * L, D and U factors only have local scope (no off-diagonal processor terms) - * so apart from the residual calculation (which uses A), the solves with the - * L and U factors are local. + * L, D and U factors only have local scope (no off-diag terms) + * so apart from the residual calculation (which uses A), the solves + * with the L and U factors are local. * S is the inverse global Schur complement * rhs and x are helper vector for solving Schur system -*/ + *--------------------------------------------------------------------*/ HYPRE_Int -hypre_ILUSolveSchurNSH(hypre_ParCSRMatrix *A, hypre_ParVector *f, - hypre_ParVector *u, HYPRE_Int *perm, - HYPRE_Int nLU, hypre_ParCSRMatrix *L, - HYPRE_Real* D, hypre_ParCSRMatrix *U, - hypre_ParCSRMatrix *S, - hypre_ParVector *ftemp, hypre_ParVector *utemp, - HYPRE_Solver schur_solver, - hypre_ParVector *rhs, hypre_ParVector *x, HYPRE_Int *u_end) +hypre_ILUSolveSchurNSH(hypre_ParCSRMatrix *A, + hypre_ParVector *f, + hypre_ParVector *u, + HYPRE_Int *perm, + HYPRE_Int nLU, + hypre_ParCSRMatrix *L, + HYPRE_Real *D, + hypre_ParCSRMatrix *U, + hypre_ParCSRMatrix *S, + hypre_ParVector *ftemp, + hypre_ParVector *utemp, + HYPRE_Solver schur_solver, + hypre_ParVector *rhs, + hypre_ParVector *x, + HYPRE_Int *u_end) { - /* data objects for communication */ - // MPI_Comm comm = hypre_ParCSRMatrixComm(A); - /* data objects for L and U */ - hypre_CSRMatrix *L_diag = hypre_ParCSRMatrixDiag(L); + hypre_CSRMatrix *L_diag = hypre_ParCSRMatrixDiag(L); HYPRE_Real *L_diag_data = hypre_CSRMatrixData(L_diag); - HYPRE_Int *L_diag_i = hypre_CSRMatrixI(L_diag); - HYPRE_Int *L_diag_j = hypre_CSRMatrixJ(L_diag); - hypre_CSRMatrix *U_diag = hypre_ParCSRMatrixDiag(U); + HYPRE_Int *L_diag_i = hypre_CSRMatrixI(L_diag); + HYPRE_Int *L_diag_j = hypre_CSRMatrixJ(L_diag); + hypre_CSRMatrix *U_diag = hypre_ParCSRMatrixDiag(U); HYPRE_Real *U_diag_data = hypre_CSRMatrixData(U_diag); - HYPRE_Int *U_diag_i = hypre_CSRMatrixI(U_diag); - HYPRE_Int *U_diag_j = hypre_CSRMatrixJ(U_diag); + HYPRE_Int *U_diag_i = hypre_CSRMatrixI(U_diag); + HYPRE_Int *U_diag_j = hypre_CSRMatrixJ(U_diag); + + /* Vectors */ hypre_Vector *utemp_local = hypre_ParVectorLocalVector(utemp); HYPRE_Real *utemp_data = hypre_VectorData(utemp_local); hypre_Vector *ftemp_local = hypre_ParVectorLocalVector(ftemp); HYPRE_Real *ftemp_data = hypre_VectorData(ftemp_local); - - HYPRE_Real alpha; - HYPRE_Real beta; - HYPRE_Int i, j, k1, k2, col; + HYPRE_Real alpha = -1.0; + HYPRE_Real beta = 1.0; + HYPRE_Int i, j, k1, k2, col; /* problem size */ HYPRE_Int n = hypre_CSRMatrixNumRows(L_diag); - // HYPRE_Int m = n - nLU; /* other data objects for computation */ - // hypre_Vector *f_local; - // HYPRE_Real *f_data; hypre_Vector *rhs_local; HYPRE_Real *rhs_data; hypre_Vector *x_local; HYPRE_Real *x_data; - /* begin */ - beta = 1.0; - alpha = -1.0; - /* compute residual */ hypre_ParCSRMatrixMatvecOutOfPlace(alpha, A, u, beta, f, ftemp); /* 1st need to solve LBi*xi = fi * L solve, solve xi put in u_temp upper */ - // f_local = hypre_ParVectorLocalVector(f); - // f_data = hypre_VectorData(f_local); /* now update with L to solve */ - for(i = 0 ; i < nLU ; i ++) + for (i = 0 ; i < nLU ; i ++) { utemp_data[perm[i]] = ftemp_data[perm[i]]; - k1 = L_diag_i[i] ; k2 = L_diag_i[i+1]; - for(j = k1 ; j < k2 ; j ++) + k1 = L_diag_i[i] ; k2 = L_diag_i[i + 1]; + for (j = k1 ; j < k2 ; j ++) { utemp_data[perm[i]] -= L_diag_data[j] * utemp_data[perm[L_diag_j[j]]]; } @@ -627,10 +723,10 @@ hypre_ILUSolveSchurNSH(hypre_ParCSRMatrix *A, hypre_ParVector *f, /* 2nd need to compute g'i = gi - Ei*UBi^-1*xi * now put g'i into the f_temp lower */ - for(i = nLU ; i < n ; i ++) + for (i = nLU ; i < n ; i ++) { - k1 = L_diag_i[i] ; k2 = L_diag_i[i+1]; - for(j = k1 ; j < k2 ; j ++) + k1 = L_diag_i[i] ; k2 = L_diag_i[i + 1]; + for (j = k1 ; j < k2 ; j ++) { col = L_diag_j[j]; ftemp_data[perm[i]] -= L_diag_data[j] * utemp_data[perm[col]]; @@ -642,31 +738,32 @@ hypre_ILUSolveSchurNSH(hypre_ParCSRMatrix *A, hypre_ParVector *f, * solve y put in u_temp lower * only solve when S is not NULL */ - if(S) + if (S) { - /*initialize solution to zero for residual equation */ + /* Initialize solution to zero for residual equation */ hypre_ParVectorSetConstantValues(x, 0.0); - /* setup vectors for solve */ - rhs_local = hypre_ParVectorLocalVector(rhs); - rhs_data = hypre_VectorData(rhs_local); - x_local = hypre_ParVectorLocalVector(x); - x_data = hypre_VectorData(x_local); + + /* Setup vectors for solve */ + rhs_local = hypre_ParVectorLocalVector(rhs); + rhs_data = hypre_VectorData(rhs_local); + x_local = hypre_ParVectorLocalVector(x); + x_data = hypre_VectorData(x_local); /* set rhs value */ - for(i = nLU ; i < n ; i ++) + for (i = nLU ; i < n ; i ++) { - rhs_data[i-nLU] = ftemp_data[perm[i]]; + rhs_data[i - nLU] = ftemp_data[perm[i]]; } /* Solve Schur system with approx inverse * x = S*rhs */ - hypre_NSHSolve(schur_solver,S,rhs,x); + hypre_NSHSolve(schur_solver, S, rhs, x); /* copy value back to original */ - for(i = nLU ; i < n ; i ++) + for (i = nLU ; i < n ; i ++) { - utemp_data[perm[i]] = x_data[i-nLU]; + utemp_data[perm[i]] = x_data[i - nLU]; } } @@ -675,19 +772,19 @@ hypre_ILUSolveSchurNSH(hypre_ParCSRMatrix *A, hypre_ParVector *f, * only do this computation when nLU < n * U is unsorted, search is expensive when unnecessary */ - if(nLU < n) + if (nLU < n) { - for(i = 0 ; i < nLU ; i ++) + for (i = 0 ; i < nLU ; i ++) { ftemp_data[perm[i]] = utemp_data[perm[i]]; - k1 = u_end[i] ; k2 = U_diag_i[i+1]; - for(j = k1 ; j < k2 ; j ++) + k1 = u_end[i] ; k2 = U_diag_i[i + 1]; + for (j = k1 ; j < k2 ; j ++) { col = U_diag_j[j]; ftemp_data[perm[i]] -= U_diag_data[j] * utemp_data[perm[col]]; } } - for(i = 0 ; i < nLU ; i ++) + for (i = 0 ; i < nLU ; i ++) { utemp_data[perm[i]] = ftemp_data[perm[i]]; } @@ -695,10 +792,10 @@ hypre_ILUSolveSchurNSH(hypre_ParCSRMatrix *A, hypre_ParVector *f, /* 5th need to solve UBi*ui = zi */ /* put result in u_temp upper */ - for(i = nLU-1 ; i >= 0 ; i --) + for (i = nLU - 1 ; i >= 0 ; i --) { k1 = U_diag_i[i] ; k2 = u_end[i]; - for(j = k1 ; j < k2 ; j ++) + for (j = k1 ; j < k2 ; j ++) { col = U_diag_j[j]; utemp_data[perm[i]] -= U_diag_data[j] * utemp_data[perm[col]]; @@ -706,48 +803,58 @@ hypre_ILUSolveSchurNSH(hypre_ParCSRMatrix *A, hypre_ParVector *f, utemp_data[perm[i]] *= D[i]; } - /* done, now everything are in u_temp, update solution */ + /* Done, now everything are in u_temp, update solution */ hypre_ParVectorAxpy(beta, utemp, u); return hypre_error_flag; } -/* Incomplete LU solve - * L, D and U factors only have local scope (no off-diagonal processor terms) - * so apart from the residual calculation (which uses A), the solves with the - * L and U factors are local. -*/ +/*-------------------------------------------------------------------- + * hypre_ILUSolveLU + * + * Incomplete LU solve + * + * L, D and U factors only have local scope (no off-diagterms) + * so apart from the residual calculation (which uses A), + * the solves with the L and U factors are local. + * + * Note: perm contains the permutation of indexes corresponding to + * user-prescribed reordering strategy. In the block Jacobi case, perm + * may be NULL if no reordering is done (for performance, (perm == NULL) + * assumes identity mapping of indexes). Hence we need to check the local + * solves for this case and avoid segfaults. - DOK + *--------------------------------------------------------------------*/ HYPRE_Int -hypre_ILUSolveLU(hypre_ParCSRMatrix *A, hypre_ParVector *f, - hypre_ParVector *u, HYPRE_Int *perm, - HYPRE_Int nLU, hypre_ParCSRMatrix *L, - HYPRE_Real* D, hypre_ParCSRMatrix *U, - hypre_ParVector *ftemp, hypre_ParVector *utemp) +hypre_ILUSolveLU(hypre_ParCSRMatrix *A, + hypre_ParVector *f, + hypre_ParVector *u, + HYPRE_Int *perm, + HYPRE_Int nLU, + hypre_ParCSRMatrix *L, + HYPRE_Real *D, + hypre_ParCSRMatrix *U, + hypre_ParVector *ftemp, + hypre_ParVector *utemp) { - hypre_CSRMatrix *L_diag = hypre_ParCSRMatrixDiag(L); + /* data objects for L and U */ + hypre_CSRMatrix *L_diag = hypre_ParCSRMatrixDiag(L); HYPRE_Real *L_diag_data = hypre_CSRMatrixData(L_diag); - HYPRE_Int *L_diag_i = hypre_CSRMatrixI(L_diag); - HYPRE_Int *L_diag_j = hypre_CSRMatrixJ(L_diag); - - hypre_CSRMatrix *U_diag = hypre_ParCSRMatrixDiag(U); + HYPRE_Int *L_diag_i = hypre_CSRMatrixI(L_diag); + HYPRE_Int *L_diag_j = hypre_CSRMatrixJ(L_diag); + hypre_CSRMatrix *U_diag = hypre_ParCSRMatrixDiag(U); HYPRE_Real *U_diag_data = hypre_CSRMatrixData(U_diag); - HYPRE_Int *U_diag_i = hypre_CSRMatrixI(U_diag); - HYPRE_Int *U_diag_j = hypre_CSRMatrixJ(U_diag); + HYPRE_Int *U_diag_i = hypre_CSRMatrixI(U_diag); + HYPRE_Int *U_diag_j = hypre_CSRMatrixJ(U_diag); + /* Vectors */ hypre_Vector *utemp_local = hypre_ParVectorLocalVector(utemp); HYPRE_Real *utemp_data = hypre_VectorData(utemp_local); - hypre_Vector *ftemp_local = hypre_ParVectorLocalVector(ftemp); HYPRE_Real *ftemp_data = hypre_VectorData(ftemp_local); - - HYPRE_Real alpha; - HYPRE_Real beta; - HYPRE_Int i, j, k1, k2; - - /* begin */ - alpha = -1.0; - beta = 1.0; + HYPRE_Real alpha = -1.0; + HYPRE_Real beta = 1.0; + HYPRE_Int i, j, k1, k2; /* Initialize Utemp to zero. * This is necessary for correctness, when we use optimized @@ -759,97 +866,309 @@ hypre_ILUSolveLU(hypre_ParCSRMatrix *A, hypre_ParVector *f, /* L solve - Forward solve */ /* copy rhs to account for diagonal of L (which is identity) */ - for( i = 0; i < nLU; i++ ) + if (perm) { - utemp_data[perm[i]] = ftemp_data[perm[i]]; + for (i = 0; i < nLU; i++) + { + utemp_data[perm[i]] = ftemp_data[perm[i]]; + } } - /* update with remaining (off-diagonal) entries of L */ - for( i = 0; i < nLU; i++ ) + else { - k1 = L_diag_i[i] ; k2 = L_diag_i[i+1]; - for(j=k1; j = 0; i-- ) + if (perm) { - /* first update with the remaining (off-diagonal) entries of U */ - k1 = U_diag_i[i] ; k2 = U_diag_i[i+1]; - for(j=k1; j = 0; i-- ) { - utemp_data[perm[i]] -= U_diag_data[j] * utemp_data[perm[U_diag_j[j]]]; + /* first update with the remaining (off-diagonal) entries of U */ + k1 = U_diag_i[i] ; k2 = U_diag_i[i + 1]; + for (j = k1; j < k2; j++) + { + utemp_data[perm[i]] -= U_diag_data[j] * utemp_data[perm[U_diag_j[j]]]; + } + + /* diagonal scaling (contribution from D. Note: D is stored as its inverse) */ + utemp_data[perm[i]] *= D[i]; } - /* diagonal scaling (contribution from D. Note: D is stored as its inverse) */ - utemp_data[perm[i]] *= D[i]; } + else + { + for ( i = nLU - 1; i >= 0; i-- ) + { + /* first update with the remaining (off-diagonal) entries of U */ + k1 = U_diag_i[i] ; k2 = U_diag_i[i + 1]; + for (j = k1; j < k2; j++) + { + utemp_data[i] -= U_diag_data[j] * utemp_data[U_diag_j[j]]; + } + /* diagonal scaling (contribution from D. Note: D is stored as its inverse) */ + utemp_data[i] *= D[i]; + } + } /* Update solution */ hypre_ParVectorAxpy(beta, utemp, u); - return hypre_error_flag; } +/*-------------------------------------------------------------------- + * hypre_ILUSolveLUIter + * + * Iterative incomplete LU solve + * + * L, D and U factors only have local scope (no off-diag terms) + * so apart from the residual calculation (which uses A), the solves + * with the L and U factors are local. + * + * Note: perm contains the permutation of indexes corresponding to + * user-prescribed reordering strategy. In the block Jacobi case, perm + * may be NULL if no reordering is done (for performance, (perm == NULL) + * assumes identity mapping of indexes). Hence we need to check the local + * solves for this case and avoid segfaults. - DOK + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSolveLUIter(hypre_ParCSRMatrix *A, + hypre_ParVector *f, + hypre_ParVector *u, + HYPRE_Int *perm, + HYPRE_Int nLU, + hypre_ParCSRMatrix *L, + HYPRE_Real *D, + hypre_ParCSRMatrix *U, + hypre_ParVector *ftemp, + hypre_ParVector *utemp, + HYPRE_Int lower_jacobi_iters, + HYPRE_Int upper_jacobi_iters) +{ + /* Data objects for L and U */ + hypre_CSRMatrix *L_diag = hypre_ParCSRMatrixDiag(L); + HYPRE_Real *L_diag_data = hypre_CSRMatrixData(L_diag); + HYPRE_Int *L_diag_i = hypre_CSRMatrixI(L_diag); + HYPRE_Int *L_diag_j = hypre_CSRMatrixJ(L_diag); + hypre_CSRMatrix *U_diag = hypre_ParCSRMatrixDiag(U); + HYPRE_Real *U_diag_data = hypre_CSRMatrixData(U_diag); + HYPRE_Int *U_diag_i = hypre_CSRMatrixI(U_diag); + HYPRE_Int *U_diag_j = hypre_CSRMatrixJ(U_diag); + + /* Vectors */ + hypre_Vector *utemp_local = hypre_ParVectorLocalVector(utemp); + HYPRE_Real *utemp_data = hypre_VectorData(utemp_local); + hypre_Vector *ftemp_local = hypre_ParVectorLocalVector(ftemp); + HYPRE_Real *ftemp_data = hypre_VectorData(ftemp_local); + + /* Local variables */ + HYPRE_Real alpha = -1.0; + HYPRE_Real beta = 1.0; + HYPRE_Real sum; + HYPRE_Int i, j, k1, k2, kk; + + /* Initialize Utemp to zero. + * This is necessary for correctness, when we use optimized + * vector operations in the case where sizeof(L, D or U) < sizeof(A) + */ + //hypre_ParVectorSetConstantValues( utemp, 0.); + /* compute residual */ + hypre_ParCSRMatrixMatvecOutOfPlace(alpha, A, u, beta, f, ftemp); + + /* L solve - Forward solve */ + /* copy rhs to account for diagonal of L (which is identity) */ + + /* Initialize iteration to 0 */ + if (perm) + { + for ( i = 0; i < nLU; i++ ) + { + utemp_data[perm[i]] = 0.0; + } + } + else + { + for ( i = 0; i < nLU; i++ ) + { + utemp_data[i] = 0.0; + } + } + /* Jacobi iteration loop */ + for ( kk = 0; kk < lower_jacobi_iters; kk++ ) + { + /* u^{k+1} = f - Lu^k */ + + /* Do a SpMV with L and save the results in xtemp */ + if (perm) + { + for ( i = nLU - 1; i >= 0; i-- ) + { + sum = 0.0; + k1 = L_diag_i[i] ; k2 = L_diag_i[i + 1]; + for (j = k1; j < k2; j++) + { + sum += L_diag_data[j] * utemp_data[perm[L_diag_j[j]]]; + } + utemp_data[perm[i]] = ftemp_data[perm[i]] - sum; + } + } + else + { + for ( i = nLU - 1; i >= 0; i-- ) + { + sum = 0.0; + k1 = L_diag_i[i] ; k2 = L_diag_i[i + 1]; + for (j = k1; j < k2; j++) + { + sum += L_diag_data[j] * utemp_data[L_diag_j[j]]; + } + utemp_data[i] = ftemp_data[i] - sum; + } + } + } /* end jacobi loop */ + + /* Initialize iteration to 0 */ + if (perm) + { + for ( i = 0; i < nLU; i++ ) + { + ftemp_data[perm[i]] = 0.0; + } + } + else + { + for ( i = 0; i < nLU; i++ ) + { + ftemp_data[i] = 0.0; + } + } + + /* Jacobi iteration loop */ + for ( kk = 0; kk < upper_jacobi_iters; kk++ ) + { + /* u^{k+1} = f - Uu^k */ + + /* Do a SpMV with U and save the results in xtemp */ + if (perm) + { + for ( i = 0; i < nLU; ++i ) + { + sum = 0.0; + k1 = U_diag_i[i] ; k2 = U_diag_i[i + 1]; + for (j = k1; j < k2; j++) + { + sum += U_diag_data[j] * ftemp_data[perm[U_diag_j[j]]]; + } + ftemp_data[perm[i]] = D[i] * (utemp_data[perm[i]] - sum); + } + } + else + { + for ( i = 0; i < nLU; ++i ) + { + sum = 0.0; + k1 = U_diag_i[i] ; k2 = U_diag_i[i + 1]; + for (j = k1; j < k2; j++) + { + sum += U_diag_data[j] * ftemp_data[U_diag_j[j]]; + } + ftemp_data[i] = D[i] * (utemp_data[i] - sum); + } + } + } /* end jacobi loop */ + + /* Update solution */ + hypre_ParVectorAxpy(beta, ftemp, u); + + return hypre_error_flag; +} -/* Incomplete LU solve RAS - * L, D and U factors only have local scope (no off-diagonal processor terms) - * so apart from the residual calculation (which uses A), the solves with the - * L and U factors are local. +/*-------------------------------------------------------------------- + * hypre_ILUSolveLURAS + * + * Incomplete LU solve RAS + * + * L, D and U factors only have local scope (no off-diag terms) + * so apart from the residual calculation (which uses A), the solves + * with the L and U factors are local. * fext and uext are tempory arrays for external data -*/ + *--------------------------------------------------------------------*/ HYPRE_Int -hypre_ILUSolveLURAS(hypre_ParCSRMatrix *A, hypre_ParVector *f, - hypre_ParVector *u, HYPRE_Int *perm, - hypre_ParCSRMatrix *L, - HYPRE_Real* D, hypre_ParCSRMatrix *U, - hypre_ParVector *ftemp, hypre_ParVector *utemp, - HYPRE_Real *fext, HYPRE_Real *uext) +hypre_ILUSolveLURAS(hypre_ParCSRMatrix *A, + hypre_ParVector *f, + hypre_ParVector *u, + HYPRE_Int *perm, + hypre_ParCSRMatrix *L, + HYPRE_Real *D, + hypre_ParCSRMatrix *U, + hypre_ParVector *ftemp, + hypre_ParVector *utemp, + HYPRE_Real *fext, + HYPRE_Real *uext) { - + /* Parallel info */ hypre_ParCSRCommPkg *comm_pkg; hypre_ParCSRCommHandle *comm_handle; - HYPRE_Int num_sends, begin, end; + HYPRE_Int num_sends, begin, end; - hypre_CSRMatrix *L_diag = hypre_ParCSRMatrixDiag(L); - HYPRE_Real *L_diag_data = hypre_CSRMatrixData(L_diag); - HYPRE_Int *L_diag_i = hypre_CSRMatrixI(L_diag); - HYPRE_Int *L_diag_j = hypre_CSRMatrixJ(L_diag); - hypre_CSRMatrix *U_diag = hypre_ParCSRMatrixDiag(U); + /* Data objects for L and U */ + hypre_CSRMatrix *L_diag = hypre_ParCSRMatrixDiag(L); + HYPRE_Real *L_diag_data = hypre_CSRMatrixData(L_diag); + HYPRE_Int *L_diag_i = hypre_CSRMatrixI(L_diag); + HYPRE_Int *L_diag_j = hypre_CSRMatrixJ(L_diag); + hypre_CSRMatrix *U_diag = hypre_ParCSRMatrixDiag(U); HYPRE_Real *U_diag_data = hypre_CSRMatrixData(U_diag); - HYPRE_Int *U_diag_i = hypre_CSRMatrixI(U_diag); - HYPRE_Int *U_diag_j = hypre_CSRMatrixJ(U_diag); - - HYPRE_Int n = hypre_CSRMatrixNumCols(hypre_ParCSRMatrixDiag(A)); - HYPRE_Int m = hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(A)); - // HYPRE_Int buffer_size; - HYPRE_Int n_total = m + n; - - HYPRE_Int idx; - HYPRE_Int jcol; - HYPRE_Int col; + HYPRE_Int *U_diag_i = hypre_CSRMatrixI(U_diag); + HYPRE_Int *U_diag_j = hypre_CSRMatrixJ(U_diag); + /* Vectors */ + HYPRE_Int n = hypre_CSRMatrixNumCols(hypre_ParCSRMatrixDiag(A)); + HYPRE_Int m = hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(A)); + HYPRE_Int n_total = m + n; hypre_Vector *utemp_local = hypre_ParVectorLocalVector(utemp); HYPRE_Real *utemp_data = hypre_VectorData(utemp_local); - hypre_Vector *ftemp_local = hypre_ParVectorLocalVector(ftemp); HYPRE_Real *ftemp_data = hypre_VectorData(ftemp_local); - HYPRE_Real alpha; - HYPRE_Real beta; - HYPRE_Int i, j, k1, k2; - - /* begin */ - alpha = -1.0; - beta = 1.0; + /* Local variables */ + HYPRE_Int idx, jcol, col; + HYPRE_Int i, j, k1, k2; + HYPRE_Real alpha = -1.0; + HYPRE_Real beta = 1.0; /* prepare for communication */ comm_pkg = hypre_ParCSRMatrixCommPkg(A); + /* setup if not yet built */ - if(!comm_pkg) + if (!comm_pkg) { hypre_MatvecCommPkgCreate(A); comm_pkg = hypre_ParCSRMatrixCommPkg(A); @@ -867,18 +1186,18 @@ hypre_ILUSolveLURAS(hypre_ParCSRMatrix *A, hypre_ParVector *f, /* get total num of send */ num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - begin = hypre_ParCSRCommPkgSendMapStart(comm_pkg,0); - end = hypre_ParCSRCommPkgSendMapStart(comm_pkg,num_sends); + begin = hypre_ParCSRCommPkgSendMapStart(comm_pkg, 0); + end = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends); /* copy new index into send_buf */ - for(i = begin ; i < end ; i ++) + for (i = begin ; i < end ; i ++) { /* all we need is just send out data, we don't need to worry about the * permutation of offd part, actually we don't need to worry about * permutation at all * borrow uext as send buffer . */ - uext[i-begin] = ftemp_data[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,i)]; + uext[i - begin] = ftemp_data[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, i)]; } /* main communication */ @@ -886,17 +1205,17 @@ hypre_ILUSolveLURAS(hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParCSRCommHandleDestroy(comm_handle); /* L solve - Forward solve */ - for( i = 0 ; i < n_total ; i ++) + for ( i = 0 ; i < n_total ; i ++) { - k1 = L_diag_i[i] ; k2 = L_diag_i[i+1]; - if( i < n ) + k1 = L_diag_i[i] ; k2 = L_diag_i[i + 1]; + if ( i < n ) { /* diag part */ utemp_data[perm[i]] = ftemp_data[perm[i]]; - for(j=k1; j = 0; i-- ) + for ( i = n_total - 1; i >= 0; i-- ) { /* first update with the remaining (off-diagonal) entries of U */ - k1 = U_diag_i[i] ; k2 = U_diag_i[i+1]; - if( i < n ) + k1 = U_diag_i[i] ; k2 = U_diag_i[i + 1]; + if ( i < n ) { /* diag part */ - for(j=k1; j 0) - { - BLU_i = hypre_CSRMatrixI(matBLU_d); - BLU_j = hypre_CSRMatrixJ(matBLU_d); - BLU_data = hypre_CSRMatrixData(matBLU_d); - BLU_nnz = BLU_i[nLU]; - } - - /* begin */ - beta = 1.0; - alpha = -1.0; - //gamma = 0.0; - - HYPRE_Int isDoublePrecision = sizeof(HYPRE_Complex) == sizeof(hypre_double); - HYPRE_Int isSinglePrecision = sizeof(HYPRE_Complex) == sizeof(hypre_double) / 2; - - hypre_assert(isDoublePrecision || isSinglePrecision); - - cusparseHandle_t handle = hypre_HandleCusparseHandle(hypre_handle()); - - /* compute residual */ - hypre_ParCSRMatrixMatvecOutOfPlace(alpha, A, u, beta, f, ftemp); - - /* 1st need to solve LBi*xi = fi - * L solve, solve xi put in u_temp upper - */ - - /* apply permutation before we can start our solve */ - HYPRE_THRUST_CALL(gather, perm, perm + n, ftemp_data, utemp_data); - - if(nLU > 0) - { - - /* This solve won't touch data in utemp, thus, gi is still in utemp_lower */ - if(isDoublePrecision) - { - /* L solve - Forward solve */ - HYPRE_CUSPARSE_CALL(cusparseDcsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - nLU, BLU_nnz, (hypre_double *) &beta, matL_des, - (hypre_double *) BLU_data, BLU_i, BLU_j, matBL_info, - (hypre_double *) utemp_data, (hypre_double *) ftemp_data, ilu_solve_policy, ilu_solve_buffer)); - } - else if(isSinglePrecision) - { - /* L solve - Forward solve */ - HYPRE_CUSPARSE_CALL(cusparseScsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - nLU, BLU_nnz, (float *) &beta, matL_des, - (float *) BLU_data, BLU_i, BLU_j, matBL_info, - (float *) utemp_data, (float *) ftemp_data, ilu_solve_policy, ilu_solve_buffer)); - } - - /* 2nd need to compute g'i = gi - Ei*UBi^{-1}*xi - * Ei*UBi^{-1} is exactly the matE_d here - * Now: LBi^{-1}f_i is in ftemp_upper - * gi' is in utemp_lower - */ - - hypre_CSRMatrixMatvec(alpha, matE_d, ftemp_upper, beta, utemp_lower); - - } - - /* 3rd need to solve global Schur Complement M^{-1}Sy = M^{-1}g' - * for now only solve the local system - * solve y put in u_temp lower - * only solve whe S is not NULL - */ - - /* setup vectors for solve - * rhs = M^{-1}g' - */ - - if(m > 0) - { - if(isDoublePrecision) - { - /* L solve */ - HYPRE_CUSPARSE_CALL(cusparseDcsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - m, SLU_nnz, (hypre_double *) &beta, matL_des, - (hypre_double *) SLU_data, SLU_i, SLU_j, matSL_info, - (hypre_double *) utemp_data + nLU, (hypre_double *) ftemp_data + nLU, ilu_solve_policy, ilu_solve_buffer)); - - /* U solve */ - HYPRE_CUSPARSE_CALL(cusparseDcsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - m, SLU_nnz, (hypre_double *) &beta, matU_des, - (hypre_double *) SLU_data, SLU_i, SLU_j, matSU_info, - (hypre_double *) ftemp_data + nLU, (hypre_double *) rhs_data, ilu_solve_policy, ilu_solve_buffer)); - } - else if(isSinglePrecision) - { - /* L solve */ - HYPRE_CUSPARSE_CALL(cusparseScsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - m, SLU_nnz, (float *) &beta, matL_des, - (float *) SLU_data, SLU_i, SLU_j, matSL_info, - (float *) utemp_data + nLU, (float *) ftemp_data + nLU, ilu_solve_policy, ilu_solve_buffer)); - - /* U solve */ - HYPRE_CUSPARSE_CALL(cusparseScsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - m, SLU_nnz, (float *) &beta, matU_des, - (float *) SLU_data, SLU_i, SLU_j, matSU_info, - (float *) ftemp_data + nLU, (float *) rhs_data, ilu_solve_policy, ilu_solve_buffer)); - } - } - - - /* solve */ - /* with tricky initial guess */ - //hypre_Vector *tv = hypre_ParVectorLocalVector(x); - //HYPRE_Real *tz = hypre_VectorData(tv); - HYPRE_GMRESSolve(schur_solver,(HYPRE_Matrix)schur_precond,(HYPRE_Vector)rhs,(HYPRE_Vector)x); - /* 4th need to compute zi = xi - LBi^-1*yi - * put zi in f_temp upper - * only do this computation when nLU < n - * U is unsorted, search is expensive when unnecessary - */ - - if(nLU > 0) - { - hypre_CSRMatrixMatvec(alpha, matF_d, x_local, beta, ftemp_upper); - - /* 5th need to solve UBi*ui = zi */ - /* put result in u_temp upper */ - - if(isDoublePrecision) - { - /* U solve - Forward solve */ - HYPRE_CUSPARSE_CALL(cusparseDcsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - nLU, BLU_nnz, (hypre_double *) &beta, matU_des, - (hypre_double *) BLU_data, BLU_i, BLU_j, matBU_info, - (hypre_double *) ftemp_data, (hypre_double *) utemp_data, ilu_solve_policy, ilu_solve_buffer)); - } - else if(isSinglePrecision) - { - /* U solve - Forward solve */ - HYPRE_CUSPARSE_CALL(cusparseScsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - nLU, BLU_nnz, (float *) &beta, matU_des, - (float *) BLU_data, BLU_i, BLU_j, matBU_info, - (float *) ftemp_data, (float *) utemp_data, ilu_solve_policy, ilu_solve_buffer)); - } - } + HYPRE_Int n = hypre_CSRMatrixNumRows(L_diag); + HYPRE_Int m = n - nLU; - /* copy lower part solution into u_temp as well */ - hypre_TMemcpy(utemp_data + nLU, x_data, HYPRE_Real, m, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); - - /* perm back */ - HYPRE_THRUST_CALL(scatter,utemp_data, utemp_data + n, perm, ftemp_data); - - /* done, now everything are in u_temp, update solution */ - hypre_ParVectorAxpy(beta, ftemp, u); - - hypre_SeqVectorDestroy(ftemp_upper); - hypre_SeqVectorDestroy(utemp_lower); - - return hypre_error_flag; -} - -/* Schur Complement solve with GMRES on schur complement, RAP style - * ParCSRMatrix S is already built in ilu data sturcture, here directly use S - * L, D and U factors only have local scope (no off-diagonal processor terms) - * so apart from the residual calculation (which uses A), the solves with the - * L and U factors are local. - * S is the global Schur complement - * schur_solver is a GMRES solver - * schur_precond is the ILU preconditioner for GMRES - * rhs and x are helper vector for solving Schur system -*/ - -HYPRE_Int -hypre_ILUSolveRAPGMRES(hypre_ParCSRMatrix *A, hypre_ParVector *f, - hypre_ParVector *u, HYPRE_Int *perm, - HYPRE_Int nLU, hypre_ParCSRMatrix *S, - hypre_ParVector *ftemp, hypre_ParVector *utemp, hypre_ParVector *xtemp, hypre_ParVector *ytemp, - HYPRE_Solver schur_solver, HYPRE_Solver schur_precond, - hypre_ParVector *rhs, hypre_ParVector *x, HYPRE_Int *u_end, - cusparseMatDescr_t matL_des, cusparseMatDescr_t matU_des, - csrsv2Info_t matAL_info, csrsv2Info_t matAU_info, - csrsv2Info_t matBL_info, csrsv2Info_t matBU_info, - csrsv2Info_t matSL_info, csrsv2Info_t matSU_info, - hypre_ParCSRMatrix *Aperm, hypre_CSRMatrix *matALU_d, hypre_CSRMatrix *matBLU_d, hypre_CSRMatrix *matE_d, hypre_CSRMatrix *matF_d, - cusparseSolvePolicy_t ilu_solve_policy, void *ilu_solve_buffer, HYPRE_Int test_opt) -{ - /* data objects for communication */ -// MPI_Comm comm = hypre_ParCSRMatrixComm(A); - - /* data objects for temp vector */ - hypre_Vector *utemp_local = hypre_ParVectorLocalVector(utemp); - HYPRE_Real *utemp_data = hypre_VectorData(utemp_local); - hypre_Vector *ftemp_local = hypre_ParVectorLocalVector(ftemp); - HYPRE_Real *ftemp_data = hypre_VectorData(ftemp_local); - hypre_Vector *xtemp_local = hypre_ParVectorLocalVector(xtemp); - HYPRE_Real *xtemp_data = hypre_VectorData(xtemp_local); - //hypre_Vector *ytemp_local = hypre_ParVectorLocalVector(ytemp); - //HYPRE_Real *ytemp_data = hypre_VectorData(ytemp_local); - hypre_Vector *rhs_local = hypre_ParVectorLocalVector(rhs); - HYPRE_Real *rhs_data = hypre_VectorData(rhs_local); - hypre_Vector *x_local = hypre_ParVectorLocalVector(x); - HYPRE_Real *x_data = hypre_VectorData(x_local); - - //HYPRE_Int i, j, k1, k2, col; - - /* problem size */ - HYPRE_Int *ALU_i = hypre_CSRMatrixI(matALU_d); - HYPRE_Int *ALU_j = hypre_CSRMatrixJ(matALU_d); - HYPRE_Real *ALU_data = hypre_CSRMatrixData(matALU_d); - HYPRE_Int *BLU_i = hypre_CSRMatrixI(matBLU_d); - HYPRE_Int *BLU_j = hypre_CSRMatrixJ(matBLU_d); - HYPRE_Real *BLU_data = hypre_CSRMatrixData(matBLU_d); - HYPRE_Int BLU_nnz = BLU_i[nLU]; - hypre_CSRMatrix *matSLU_d = hypre_ParCSRMatrixDiag(S); - HYPRE_Int *SLU_i = hypre_CSRMatrixI(matSLU_d); - HYPRE_Int *SLU_j = hypre_CSRMatrixJ(matSLU_d); - HYPRE_Real *SLU_data = hypre_CSRMatrixData(matSLU_d); - HYPRE_Int m = hypre_CSRMatrixNumRows(matSLU_d); - HYPRE_Int n = nLU + m; - HYPRE_Int SLU_nnz = SLU_i[m]; - HYPRE_Int ALU_nnz = ALU_i[n]; - - hypre_Vector *ftemp_upper = hypre_SeqVectorCreate(nLU); - hypre_Vector *utemp_lower = hypre_SeqVectorCreate(m); - hypre_VectorOwnsData(ftemp_upper) = 0; - hypre_VectorOwnsData(utemp_lower) = 0; - hypre_VectorData(ftemp_upper) = ftemp_data; - hypre_VectorData(utemp_lower) = utemp_data + nLU; - hypre_SeqVectorInitialize(ftemp_upper); - hypre_SeqVectorInitialize(utemp_lower); - - /* begin */ - HYPRE_Real one = 1.0; - HYPRE_Real mone = -1.0; - HYPRE_Real zero = 0.0; - - HYPRE_Int isDoublePrecision = sizeof(HYPRE_Complex) == sizeof(hypre_double); - HYPRE_Int isSinglePrecision = sizeof(HYPRE_Complex) == sizeof(hypre_double) / 2; - - hypre_assert(isDoublePrecision || isSinglePrecision); - - cusparseHandle_t handle = hypre_HandleCusparseHandle(hypre_handle()); - - switch(test_opt) - { - case 1: case 3: - { - /* E and F */ - /* compute residual */ - hypre_ParCSRMatrixMatvecOutOfPlace(mone, A, u, one, f, utemp); - - /* apply permutation before we can start our solve - * Au=f -> (PAQ)Q'u=Pf - */ - HYPRE_THRUST_CALL(gather, perm, perm + n, utemp_data, ftemp_data); - - /* A-smoothing - * x = [UA\(LA\(P*f_u))] fill to xtemp - */ - if(n > 0) - { - if(isDoublePrecision) - { - /* L solve - Forward solve */ - HYPRE_CUSPARSE_CALL(cusparseDcsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - n, ALU_nnz, (hypre_double *) &one, matL_des, - (hypre_double *) ALU_data, ALU_i, ALU_j, matAL_info, - (hypre_double *) ftemp_data, (hypre_double *) utemp_data, ilu_solve_policy, ilu_solve_buffer)); - /* U solve - Forward solve */ - HYPRE_CUSPARSE_CALL(cusparseDcsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - n, ALU_nnz, (hypre_double *) &one, matU_des, - (hypre_double *) ALU_data, ALU_i, ALU_j, matAU_info, - (hypre_double *) utemp_data, (hypre_double *) xtemp_data, ilu_solve_policy, ilu_solve_buffer)); - } - else if(isSinglePrecision) - { - /* L solve - Forward solve */ - HYPRE_CUSPARSE_CALL(cusparseScsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - n, ALU_nnz, (float *) &one, matL_des, - (float *) ALU_data, ALU_i, ALU_j, matAL_info, - (float *) ftemp_data, (float *) utemp_data, ilu_solve_policy, ilu_solve_buffer)); - /* U solve - Forward solve */ - HYPRE_CUSPARSE_CALL(cusparseScsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - n, ALU_nnz, (float *) &one, matU_des, - (float *) ALU_data, ALU_i, ALU_j, matAU_info, - (float *) utemp_data, (float *) xtemp_data, ilu_solve_policy, ilu_solve_buffer)); - } - } - /* residual, we should not touch xtemp for now - * r = R*(f-PAQx) - */ - hypre_ParCSRMatrixMatvec(mone, Aperm, xtemp, one, ftemp); - /* with R is complex */ - /* copy partial data in */ - hypre_TMemcpy( rhs_data, ftemp_data + nLU, HYPRE_Real, m, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); - - /* solve L^{-1} */ - if(nLU > 0) - { - if(isDoublePrecision) - { - /* L solve */ - HYPRE_CUSPARSE_CALL(cusparseDcsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - nLU, BLU_nnz, (hypre_double *) &one, matL_des, - (hypre_double *) BLU_data, BLU_i, BLU_j, matBL_info, - (hypre_double *) ftemp_data, (hypre_double *) utemp_data, ilu_solve_policy, ilu_solve_buffer)); - } - else if(isSinglePrecision) - { - /* L solve */ - HYPRE_CUSPARSE_CALL(cusparseScsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - nLU, BLU_nnz, (float *) &one, matL_des, - (float *) BLU_data, BLU_i, BLU_j, matBL_info, - (float *) ftemp_data, (float *) utemp_data, ilu_solve_policy, ilu_solve_buffer)); - } - /* -U^{-1}L^{-1} */ - if(isDoublePrecision) - { - /* U solve */ - HYPRE_CUSPARSE_CALL(cusparseDcsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - nLU, BLU_nnz, (hypre_double *) &one, matU_des, - (hypre_double *) BLU_data, BLU_i, BLU_j, matBU_info, - (hypre_double *) utemp_data, (hypre_double *) ftemp_data, ilu_solve_policy, ilu_solve_buffer)); - } - else if(isSinglePrecision) - { - /* U solve */ - HYPRE_CUSPARSE_CALL(cusparseScsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - nLU, BLU_nnz, (float *) &one, matU_des, - (float *) BLU_data, BLU_i, BLU_j, matBU_info, - (float *) utemp_data, (float *) ftemp_data, ilu_solve_policy, ilu_solve_buffer)); - } - } - /* -EU^{-1}L^{-1} */ - hypre_CSRMatrixMatvec(mone, matE_d, ftemp_upper, one, rhs_local); - - - /* now solve S - */ - if(S) - { - /* if we have a schur complement */ - hypre_ParVectorSetConstantValues(x, 0.0); - HYPRE_GMRESSolve(schur_solver,(HYPRE_Matrix)schur_precond,(HYPRE_Vector)rhs,(HYPRE_Vector)x); - - /* u = xtemp + P*x */ - /* -Fx */ - hypre_CSRMatrixMatvec(mone, matF_d, x_local, zero, ftemp_upper); - /* -L^{-1}Fx */ - if(nLU > 0) - { - if(isDoublePrecision) - { - /* L solve */ - HYPRE_CUSPARSE_CALL(cusparseDcsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - nLU, BLU_nnz, (hypre_double *) &one, matL_des, - (hypre_double *) BLU_data, BLU_i, BLU_j, matBL_info, - (hypre_double *) ftemp_data, (hypre_double *) utemp_data, ilu_solve_policy, ilu_solve_buffer)); - } - else if(isSinglePrecision) - { - /* L solve */ - HYPRE_CUSPARSE_CALL(cusparseScsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - nLU, BLU_nnz, (float *) &one, matL_des, - (float *) BLU_data, BLU_i, BLU_j, matBL_info, - (float *) ftemp_data, (float *) utemp_data, ilu_solve_policy, ilu_solve_buffer)); - } - /* -U{-1}L^{-1}Fx */ - if(isDoublePrecision) - { - /* U solve */ - HYPRE_CUSPARSE_CALL(cusparseDcsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - nLU, BLU_nnz, (hypre_double *) &one, matU_des, - (hypre_double *) BLU_data, BLU_i, BLU_j, matBU_info, - (hypre_double *) utemp_data, (hypre_double *) ftemp_data, ilu_solve_policy, ilu_solve_buffer)); - } - else if(isSinglePrecision) - { - /* U solve */ - HYPRE_CUSPARSE_CALL(cusparseScsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - nLU, BLU_nnz, (float *) &one, matU_des, - (float *) BLU_data, BLU_i, BLU_j, matBU_info, - (float *) utemp_data, (float *) ftemp_data, ilu_solve_policy, ilu_solve_buffer)); - } - } - /* now copy data to y_lower */ - hypre_TMemcpy( ftemp_data + nLU, x_data, HYPRE_Real, m, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); - - /* correction to the residual */ - hypre_ParVectorAxpy(one, ftemp, xtemp); - - } - else - { - /* otherwise just apply triangular solves */ - if(m > 0) - { - if(isDoublePrecision) - { - /* L solve - Forward solve */ - HYPRE_CUSPARSE_CALL(cusparseDcsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - m, SLU_nnz, (hypre_double *) &one, matL_des, - (hypre_double *) SLU_data, SLU_i, SLU_j, matSL_info, - (hypre_double *) rhs_data, (hypre_double *) x_data, ilu_solve_policy, ilu_solve_buffer)); - } - else if(isSinglePrecision) - { - /* L solve - Forward solve */ - HYPRE_CUSPARSE_CALL(cusparseScsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - m, SLU_nnz, (float *) &one, matL_des, - (float *) SLU_data, SLU_i, SLU_j, matSL_info, - (float *) rhs_data, (float *) x_data, ilu_solve_policy, ilu_solve_buffer)); - } - if(isDoublePrecision) - { - /* U solve - Forward solve */ - HYPRE_CUSPARSE_CALL(cusparseDcsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - m, SLU_nnz, (hypre_double *) &one, matU_des, - (hypre_double *) SLU_data, SLU_i, SLU_j, matSU_info, - (hypre_double *) x_data, (hypre_double *) rhs_data, ilu_solve_policy, ilu_solve_buffer)); - } - else if(isSinglePrecision) - { - /* U solve - Forward solve */ - HYPRE_CUSPARSE_CALL(cusparseScsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - m, SLU_nnz, (float *) &one, matU_des, - (float *) SLU_data, SLU_i, SLU_j, matSU_info, - (float *) x_data, (float *) rhs_data, ilu_solve_policy, ilu_solve_buffer)); - } - } - - /* u = xtemp + P*x */ - /* -Fx */ - hypre_CSRMatrixMatvec(mone, matF_d, rhs_local, zero, ftemp_upper); - /* -L^{-1}Fx */ - if(nLU > 0) - { - if(isDoublePrecision) - { - /* L solve */ - HYPRE_CUSPARSE_CALL(cusparseDcsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - nLU, BLU_nnz, (hypre_double *) &one, matL_des, - (hypre_double *) BLU_data, BLU_i, BLU_j, matBL_info, - (hypre_double *) ftemp_data, (hypre_double *) utemp_data, ilu_solve_policy, ilu_solve_buffer)); - } - else if(isSinglePrecision) - { - /* L solve */ - HYPRE_CUSPARSE_CALL(cusparseScsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - nLU, BLU_nnz, (float *) &one, matL_des, - (float *) BLU_data, BLU_i, BLU_j, matBL_info, - (float *) ftemp_data, (float *) utemp_data, ilu_solve_policy, ilu_solve_buffer)); - } - /* -U{-1}L^{-1}Fx */ - if(isDoublePrecision) - { - /* U solve */ - HYPRE_CUSPARSE_CALL(cusparseDcsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - nLU, BLU_nnz, (hypre_double *) &one, matU_des, - (hypre_double *) BLU_data, BLU_i, BLU_j, matBU_info, - (hypre_double *) utemp_data, (hypre_double *) ftemp_data, ilu_solve_policy, ilu_solve_buffer)); - } - else if(isSinglePrecision) - { - /* U solve */ - HYPRE_CUSPARSE_CALL(cusparseScsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - nLU, BLU_nnz, (float *) &one, matU_des, - (float *) BLU_data, BLU_i, BLU_j, matBU_info, - (float *) utemp_data, (float *) ftemp_data, ilu_solve_policy, ilu_solve_buffer)); - } - } - /* now copy data to y_lower */ - hypre_TMemcpy( ftemp_data + nLU, rhs_data, HYPRE_Real, m, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); - - hypre_ParVectorAxpy(one, ftemp, xtemp); - - } - - /* perm back */ - HYPRE_THRUST_CALL(scatter,xtemp_data, xtemp_data + n, perm, ftemp_data); - - /* done, now everything are in u_temp, update solution */ - hypre_ParVectorAxpy(one, ftemp, u); - } - break; - case 0: case 2: default: - { - /* EU^{-1} and L^{-1}F */ - /* compute residual */ - hypre_ParCSRMatrixMatvecOutOfPlace(mone, A, u, one, f, ftemp); - /* apply permutation before we can start our solve - * Au=f -> (PAQ)Q'u=Pf - */ - HYPRE_THRUST_CALL(gather, perm, perm + n, ftemp_data, utemp_data); - - /* A-smoothing - * x = [UA\(LA\(P*f_u))] fill to xtemp - */ - if(n > 0) - { - if(isDoublePrecision) - { - /* L solve - Forward solve */ - HYPRE_CUSPARSE_CALL(cusparseDcsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - n, ALU_nnz, (hypre_double *) &one, matL_des, - (hypre_double *) ALU_data, ALU_i, ALU_j, matAL_info, - (hypre_double *) utemp_data, (hypre_double *) ftemp_data, ilu_solve_policy, ilu_solve_buffer)); - /* U solve - Forward solve */ - HYPRE_CUSPARSE_CALL(cusparseDcsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - n, ALU_nnz, (hypre_double *) &one, matU_des, - (hypre_double *) ALU_data, ALU_i, ALU_j, matAU_info, - (hypre_double *) ftemp_data, (hypre_double *) xtemp_data, ilu_solve_policy, ilu_solve_buffer)); - } - else if(isSinglePrecision) - { - /* L solve - Forward solve */ - HYPRE_CUSPARSE_CALL(cusparseScsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - n, ALU_nnz, (float *) &one, matL_des, - (float *) ALU_data, ALU_i, ALU_j, matAL_info, - (float *) utemp_data, (float *) ftemp_data, ilu_solve_policy, ilu_solve_buffer)); - /* U solve - Forward solve */ - HYPRE_CUSPARSE_CALL(cusparseScsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - n, ALU_nnz, (float *) &one, matU_des, - (float *) ALU_data, ALU_i, ALU_j, matAU_info, - (float *) ftemp_data, (float *) xtemp_data, ilu_solve_policy, ilu_solve_buffer)); - } - } - /* residual, we should not touch xtemp for now - * r = R*(f-PAQx) - */ - hypre_ParCSRMatrixMatvec(mone, Aperm, xtemp, one, utemp); - /* with R is complex */ - /* copy partial data in */ - hypre_TMemcpy( rhs_data, utemp_data + nLU, HYPRE_Real, m, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); - - /* solve L^{-1} */ - if(nLU > 0) - { - if(isDoublePrecision) - { - /* L solve */ - HYPRE_CUSPARSE_CALL(cusparseDcsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - nLU, BLU_nnz, (hypre_double *) &one, matL_des, - (hypre_double *) BLU_data, BLU_i, BLU_j, matBL_info, - (hypre_double *) utemp_data, (hypre_double *) ftemp_data, ilu_solve_policy, ilu_solve_buffer)); - } - else if(isSinglePrecision) - { - /* L solve */ - HYPRE_CUSPARSE_CALL(cusparseScsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - nLU, BLU_nnz, (float *) &one, matL_des, - (float *) BLU_data, BLU_i, BLU_j, matBL_info, - (float *) utemp_data, (float *) ftemp_data, ilu_solve_policy, ilu_solve_buffer)); - } - } - /* -EU^{-1}L^{-1} */ - hypre_CSRMatrixMatvec(mone, matE_d, ftemp_upper, one, rhs_local); - - - /* now solve S - */ - if(S) - { - /* if we have a schur complement */ - hypre_ParVectorSetConstantValues(x, 0.0); - HYPRE_GMRESSolve(schur_solver,(HYPRE_Matrix)schur_precond,(HYPRE_Vector)rhs,(HYPRE_Vector)x); - - /* u = xtemp + P*x */ - /* -L^{-1}Fx */ - hypre_CSRMatrixMatvec(mone, matF_d, x_local, zero, ftemp_upper); - /* -U{-1}L^{-1}Fx */ - if(nLU > 0) - { - if(isDoublePrecision) - { - /* U solve */ - HYPRE_CUSPARSE_CALL(cusparseDcsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - nLU, BLU_nnz, (hypre_double *) &one, matU_des, - (hypre_double *) BLU_data, BLU_i, BLU_j, matBU_info, - (hypre_double *) ftemp_data, (hypre_double *) utemp_data, ilu_solve_policy, ilu_solve_buffer)); - } - else if(isSinglePrecision) - { - /* U solve */ - HYPRE_CUSPARSE_CALL(cusparseScsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - nLU, BLU_nnz, (float *) &one, matU_des, - (float *) BLU_data, BLU_i, BLU_j, matBU_info, - (float *) ftemp_data, (float *) utemp_data, ilu_solve_policy, ilu_solve_buffer)); - } - } - /* now copy data to y_lower */ - hypre_TMemcpy( utemp_data + nLU, x_data, HYPRE_Real, m, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); - - hypre_ParVectorAxpy(one, utemp, xtemp); - - } - else - { - /* otherwise just apply triangular solves */ - if(m > 0) - { - if(isDoublePrecision) - { - /* L solve - Forward solve */ - HYPRE_CUSPARSE_CALL(cusparseDcsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - m, SLU_nnz, (hypre_double *) &one, matL_des, - (hypre_double *) SLU_data, SLU_i, SLU_j, matSL_info, - (hypre_double *) rhs_data, (hypre_double *) x_data, ilu_solve_policy, ilu_solve_buffer)); - } - else if(isSinglePrecision) - { - /* L solve - Forward solve */ - HYPRE_CUSPARSE_CALL(cusparseScsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - m, SLU_nnz, (float *) &one, matL_des, - (float *) SLU_data, SLU_i, SLU_j, matSL_info, - (float *) rhs_data, (float *) x_data, ilu_solve_policy, ilu_solve_buffer)); - } - if(isDoublePrecision) - { - /* U solve - Forward solve */ - HYPRE_CUSPARSE_CALL(cusparseDcsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - m, SLU_nnz, (hypre_double *) &one, matU_des, - (hypre_double *) SLU_data, SLU_i, SLU_j, matSU_info, - (hypre_double *) x_data, (hypre_double *) rhs_data, ilu_solve_policy, ilu_solve_buffer)); - } - else if(isSinglePrecision) - { - /* U solve - Forward solve */ - HYPRE_CUSPARSE_CALL(cusparseScsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - m, SLU_nnz, (float *) &one, matU_des, - (float *) SLU_data, SLU_i, SLU_j, matSU_info, - (float *) x_data, (float *) rhs_data, ilu_solve_policy, ilu_solve_buffer)); - } - } - /* u = xtemp + P*x */ - /* -L^{-1}Fx */ - hypre_CSRMatrixMatvec(mone, matF_d, rhs_local, zero, ftemp_upper); - /* -U{-1}L^{-1}Fx */ - if(nLU > 0) - { - if(isDoublePrecision) - { - /* U solve */ - HYPRE_CUSPARSE_CALL(cusparseDcsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - nLU, BLU_nnz, (hypre_double *) &one, matU_des, - (hypre_double *) BLU_data, BLU_i, BLU_j, matBU_info, - (hypre_double *) ftemp_data, (hypre_double *) utemp_data, ilu_solve_policy, ilu_solve_buffer)); - } - else if(isSinglePrecision) - { - /* U solve */ - HYPRE_CUSPARSE_CALL(cusparseScsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - nLU, BLU_nnz, (float *) &one, matU_des, - (float *) BLU_data, BLU_i, BLU_j, matBU_info, - (float *) ftemp_data, (float *) utemp_data, ilu_solve_policy, ilu_solve_buffer)); - } - } - /* now copy data to y_lower */ - hypre_TMemcpy( utemp_data + nLU, rhs_data, HYPRE_Real, m, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); - - hypre_ParVectorAxpy(one, utemp, xtemp); - - } - - /* perm back */ - HYPRE_THRUST_CALL(scatter,xtemp_data, xtemp_data + n, perm, ftemp_data); - - /* done, now everything are in u_temp, update solution */ - hypre_ParVectorAxpy(one, ftemp, u); - } - break; - } - - return hypre_error_flag; -} - -#endif - -HYPRE_Int -hypre_ILUSolveRAPGMRESHOST(hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int *perm, - HYPRE_Int nLU, hypre_ParCSRMatrix *L, HYPRE_Real *D, hypre_ParCSRMatrix *U, - hypre_ParCSRMatrix *mL, HYPRE_Real *mD, hypre_ParCSRMatrix *mU, - hypre_ParVector *ftemp, hypre_ParVector *utemp, - hypre_ParVector *xtemp, hypre_ParVector *ytemp, - HYPRE_Solver schur_solver, HYPRE_Solver schur_precond, - hypre_ParVector *rhs, hypre_ParVector *x, HYPRE_Int *u_end) -{ -//#pragma omp parallel -// printf("threads %d\n",omp_get_num_threads()); - /* data objects for communication */ -// MPI_Comm comm = hypre_ParCSRMatrixComm(A); - - /* data objects for L and U */ - hypre_CSRMatrix *L_diag = hypre_ParCSRMatrixDiag(L); - HYPRE_Real *L_diag_data = hypre_CSRMatrixData(L_diag); - HYPRE_Int *L_diag_i = hypre_CSRMatrixI(L_diag); - HYPRE_Int *L_diag_j = hypre_CSRMatrixJ(L_diag); - hypre_CSRMatrix *U_diag = hypre_ParCSRMatrixDiag(U); - HYPRE_Real *U_diag_data = hypre_CSRMatrixData(U_diag); - HYPRE_Int *U_diag_i = hypre_CSRMatrixI(U_diag); - HYPRE_Int *U_diag_j = hypre_CSRMatrixJ(U_diag); - - hypre_CSRMatrix *mL_diag = hypre_ParCSRMatrixDiag(mL); - HYPRE_Real *mL_diag_data = hypre_CSRMatrixData(mL_diag); - HYPRE_Int *mL_diag_i = hypre_CSRMatrixI(mL_diag); - HYPRE_Int *mL_diag_j = hypre_CSRMatrixJ(mL_diag); - hypre_CSRMatrix *mU_diag = hypre_ParCSRMatrixDiag(mU); - HYPRE_Real *mU_diag_data = hypre_CSRMatrixData(mU_diag); - HYPRE_Int *mU_diag_i = hypre_CSRMatrixI(mU_diag); - HYPRE_Int *mU_diag_j = hypre_CSRMatrixJ(mU_diag); + /* other data objects for computation */ + hypre_Vector *rhs_local; + HYPRE_Real *rhs_data; + hypre_Vector *x_local = NULL; + HYPRE_Real *x_data = NULL; - hypre_Vector *utemp_local = hypre_ParVectorLocalVector(utemp); - HYPRE_Real *utemp_data = hypre_VectorData(utemp_local); - hypre_Vector *ftemp_local = hypre_ParVectorLocalVector(ftemp); - HYPRE_Real *ftemp_data = hypre_VectorData(ftemp_local); - hypre_Vector *xtemp_local = NULL; - HYPRE_Real *xtemp_data = NULL; - hypre_Vector *ytemp_local = NULL; - HYPRE_Real *ytemp_data = NULL; - if(xtemp) + /* xtemp might be null when we have no Schur complement */ + if (xtemp) { - /* xtemp might be null when we have no Schur complement */ xtemp_local = hypre_ParVectorLocalVector(xtemp); xtemp_data = hypre_VectorData(xtemp_local); ytemp_local = hypre_ParVectorLocalVector(ytemp); ytemp_data = hypre_VectorData(ytemp_local); } - HYPRE_Real alpha; - HYPRE_Real beta; - HYPRE_Int i, j, k1, k2, col; - - /* problem size */ - HYPRE_Int n = hypre_CSRMatrixNumRows(L_diag); - HYPRE_Int m = n - nLU; - - /* other data objects for computation */ - //hypre_Vector *f_local; - //HYPRE_Real *f_data; - hypre_Vector *rhs_local; - HYPRE_Real *rhs_data; - hypre_Vector *x_local; - HYPRE_Real *x_data; - - /* begin */ - beta = 1.0; - alpha = -1.0; - - if(m > 0) + /* Setup vectors for solve */ + if (m > 0) { - /* setup vectors for solve */ rhs_local = hypre_ParVectorLocalVector(rhs); rhs_data = hypre_VectorData(rhs_local); x_local = hypre_ParVectorLocalVector(x); x_data = hypre_VectorData(x_local); - } /* only support RAP with partial factorized W and Z */ @@ -1970,26 +1407,26 @@ hypre_ILUSolveRAPGMRESHOST(hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParV /* A-smoothing f_temp = [UA \ LA \ (f_temp[perm])] */ /* permuted L solve */ - for(i = 0 ; i < n ; i ++) + for (i = 0 ; i < n ; i ++) { utemp_data[i] = ftemp_data[perm[i]]; - k1 = L_diag_i[i] ; k2 = L_diag_i[i+1]; - for(j = k1 ; j < k2 ; j ++) + k1 = L_diag_i[i] ; k2 = L_diag_i[i + 1]; + for (j = k1 ; j < k2 ; j ++) { col = L_diag_j[j]; utemp_data[i] -= L_diag_data[j] * utemp_data[col]; } } - if(!xtemp) + if (!xtemp) { /* in this case, we don't have a Schur complement */ /* U solve */ - for(i = n-1 ; i >= 0 ; i --) + for (i = n - 1 ; i >= 0 ; i --) { ftemp_data[perm[i]] = utemp_data[i]; - k1 = U_diag_i[i] ; k2 = U_diag_i[i+1]; - for(j = k1 ; j < k2 ; j ++) + k1 = U_diag_i[i] ; k2 = U_diag_i[i + 1]; + for (j = k1 ; j < k2 ; j ++) { col = U_diag_j[j]; ftemp_data[perm[i]] -= U_diag_data[j] * ftemp_data[perm[col]]; @@ -2003,11 +1440,11 @@ hypre_ILUSolveRAPGMRESHOST(hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParV } /* U solve */ - for(i = n-1 ; i >= 0 ; i --) + for (i = n - 1 ; i >= 0 ; i --) { xtemp_data[perm[i]] = utemp_data[i]; - k1 = U_diag_i[i] ; k2 = U_diag_i[i+1]; - for(j = k1 ; j < k2 ; j ++) + k1 = U_diag_i[i] ; k2 = U_diag_i[i + 1]; + for (j = k1 ; j < k2 ; j ++) { col = U_diag_j[j]; xtemp_data[perm[i]] -= U_diag_data[j] * xtemp_data[perm[col]]; @@ -2023,14 +1460,14 @@ hypre_ILUSolveRAPGMRESHOST(hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParV hypre_ParCSRMatrixMatvecOutOfPlace(alpha, A, xtemp, beta, ftemp, utemp); // R = [-L21 L\inv, I] - if( m > 0) + if (m > 0) { /* first is L solve */ - for(i = 0 ; i < nLU ; i ++) + for (i = 0 ; i < nLU ; i ++) { ytemp_data[i] = utemp_data[perm[i]]; - k1 = mL_diag_i[i] ; k2 = mL_diag_i[i+1]; - for(j = k1 ; j < k2 ; j ++) + k1 = mL_diag_i[i] ; k2 = mL_diag_i[i + 1]; + for (j = k1 ; j < k2 ; j ++) { col = mL_diag_j[j]; ytemp_data[i] -= mL_diag_data[j] * ytemp_data[col]; @@ -2038,11 +1475,11 @@ hypre_ILUSolveRAPGMRESHOST(hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParV } /* apply -W * ytemp on this, and take care of the I part */ - for(i = nLU ; i < n ; i ++) + for (i = nLU ; i < n ; i ++) { rhs_data[i - nLU] = utemp_data[perm[i]]; k1 = mL_diag_i[i] ; k2 = u_end[i]; - for(j = k1 ; j < k2 ; j ++) + for (j = k1 ; j < k2 ; j ++) { col = mL_diag_j[j]; rhs_data[i - nLU] -= mL_diag_data[j] * ytemp_data[col]; @@ -2052,9 +1489,12 @@ hypre_ILUSolveRAPGMRESHOST(hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParV /* now the rhs is ready */ hypre_SeqVectorSetConstantValues(x_local, 0.0); - HYPRE_GMRESSolve(schur_solver,(HYPRE_Matrix)schur_precond,(HYPRE_Vector)rhs,(HYPRE_Vector)x); + HYPRE_GMRESSolve(schur_solver, + (HYPRE_Matrix) schur_precond, + (HYPRE_Vector) rhs, + (HYPRE_Vector) x); - if(m > 0) + if (m > 0) { /* for(i = 0 ; i < m ; i ++) @@ -2089,22 +1529,22 @@ hypre_ILUSolveRAPGMRESHOST(hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParV * [ I ] */ /* matvec */ - for(i = 0 ; i < nLU ; i ++) + for (i = 0 ; i < nLU ; i ++) { ytemp_data[i] = 0.0; - k1 = u_end[i] ; k2 = mU_diag_i[i+1]; - for(j = k1 ; j < k2 ; j ++) + k1 = u_end[i] ; k2 = mU_diag_i[i + 1]; + for (j = k1 ; j < k2 ; j ++) { col = mU_diag_j[j]; - ytemp_data[i] -= mU_diag_data[j] * x_data[col-nLU]; + ytemp_data[i] -= mU_diag_data[j] * x_data[col - nLU]; } } /* U solve */ - for(i = nLU-1 ; i >= 0 ; i --) + for (i = nLU - 1 ; i >= 0 ; i --) { ftemp_data[perm[i]] = ytemp_data[i]; k1 = mU_diag_i[i] ; k2 = u_end[i]; - for(j = k1 ; j < k2 ; j ++) + for (j = k1 ; j < k2 ; j ++) { col = mU_diag_j[j]; ftemp_data[perm[i]] -= mU_diag_data[j] * ftemp_data[perm[col]]; @@ -2113,9 +1553,9 @@ hypre_ILUSolveRAPGMRESHOST(hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParV } /* update with I */ - for(i = nLU ; i < n ; i ++) + for (i = nLU ; i < n ; i ++) { - ftemp_data[perm[i]] = x_data[i-nLU]; + ftemp_data[perm[i]] = x_data[i - nLU]; } hypre_ParVectorAxpy(beta, ftemp, u); } @@ -2125,59 +1565,53 @@ hypre_ILUSolveRAPGMRESHOST(hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParV return hypre_error_flag; } -/* solve functions for NSH */ +/****************************************************************************** + * + * NSH functions. + * + *****************************************************************************/ /*-------------------------------------------------------------------- * hypre_NSHSolve *--------------------------------------------------------------------*/ + HYPRE_Int hypre_NSHSolve( void *nsh_vdata, - hypre_ParCSRMatrix *A, - hypre_ParVector *f, - hypre_ParVector *u ) + hypre_ParCSRMatrix *A, + hypre_ParVector *f, + hypre_ParVector *u ) { - MPI_Comm comm = hypre_ParCSRMatrixComm(A); - // HYPRE_Int i; - - hypre_ParNSHData *nsh_data = (hypre_ParNSHData*) nsh_vdata; - - /* get matrices */ - hypre_ParCSRMatrix *matA = hypre_ParNSHDataMatA(nsh_data); - hypre_ParCSRMatrix *matM = hypre_ParNSHDataMatM(nsh_data); - - HYPRE_Int iter, num_procs, my_id; - - hypre_ParVector *F_array = hypre_ParNSHDataF(nsh_data); - hypre_ParVector *U_array = hypre_ParNSHDataU(nsh_data); - - /* get settings */ - HYPRE_Real tol = hypre_ParNSHDataTol(nsh_data); - HYPRE_Int logging = hypre_ParNSHDataLogging(nsh_data); - HYPRE_Int print_level = hypre_ParNSHDataPrintLevel(nsh_data); - HYPRE_Int max_iter = hypre_ParNSHDataMaxIter(nsh_data); - HYPRE_Real *norms = hypre_ParNSHDataRelResNorms(nsh_data); - hypre_ParVector *Ftemp = hypre_ParNSHDataFTemp(nsh_data); - hypre_ParVector *Utemp = hypre_ParNSHDataUTemp(nsh_data); - hypre_ParVector *residual; - - HYPRE_Real alpha = -1.0; - HYPRE_Real beta = 1.0; - HYPRE_Real conv_factor = 0.0; - HYPRE_Real resnorm = 1.0; - HYPRE_Real init_resnorm = 0.0; - HYPRE_Real rel_resnorm; - HYPRE_Real rhs_norm = 0.0; - HYPRE_Real old_resnorm; - HYPRE_Real ieee_check = 0.; - HYPRE_Real operat_cmplxty = hypre_ParNSHDataOperatorComplexity(nsh_data); - - HYPRE_Int Solve_err_flag; - - /* problem size */ - // HYPRE_Int n = hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(A)); - - /* begin */ - if(logging > 1) + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + hypre_ParNSHData *nsh_data = (hypre_ParNSHData*) nsh_vdata; + hypre_ParCSRMatrix *matA = hypre_ParNSHDataMatA(nsh_data); + hypre_ParCSRMatrix *matM = hypre_ParNSHDataMatM(nsh_data); + hypre_ParVector *F_array = hypre_ParNSHDataF(nsh_data); + hypre_ParVector *U_array = hypre_ParNSHDataU(nsh_data); + + HYPRE_Real tol = hypre_ParNSHDataTol(nsh_data); + HYPRE_Int logging = hypre_ParNSHDataLogging(nsh_data); + HYPRE_Int print_level = hypre_ParNSHDataPrintLevel(nsh_data); + HYPRE_Int max_iter = hypre_ParNSHDataMaxIter(nsh_data); + HYPRE_Real *norms = hypre_ParNSHDataRelResNorms(nsh_data); + hypre_ParVector *Ftemp = hypre_ParNSHDataFTemp(nsh_data); + hypre_ParVector *Utemp = hypre_ParNSHDataUTemp(nsh_data); + hypre_ParVector *residual = NULL; + + HYPRE_Real alpha = -1.0; + HYPRE_Real beta = 1.0; + HYPRE_Real conv_factor = 0.0; + HYPRE_Real resnorm = 1.0; + HYPRE_Real init_resnorm = 0.0; + HYPRE_Real rel_resnorm; + HYPRE_Real rhs_norm = 0.0; + HYPRE_Real old_resnorm; + HYPRE_Real ieee_check = 0.0; + HYPRE_Real operat_cmplxty = hypre_ParNSHDataOperatorComplexity(nsh_data); + + HYPRE_Int iter, num_procs, my_id; + HYPRE_Int Solve_err_flag; + + if (logging > 1) { residual = hypre_ParNSHDataResidual(nsh_data); } @@ -2185,7 +1619,7 @@ hypre_NSHSolve( void *nsh_vdata, hypre_ParNSHDataNumIterations(nsh_data) = 0; hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_rank(comm, &my_id); /*----------------------------------------------------------------------- * Write the solver parameters @@ -2206,7 +1640,7 @@ hypre_NSHSolve( void *nsh_vdata, if (my_id == 0 && print_level > 1 && tol > 0.) { - hypre_printf("\n\n Newton–Schulz–Hotelling SOLVER SOLUTION INFO:\n"); + hypre_printf("\n\n Newton-Schulz-Hotelling SOLVER SOLUTION INFO:\n"); } @@ -2215,14 +1649,14 @@ hypre_NSHSolve( void *nsh_vdata, *-----------------------------------------------------------------------*/ if (print_level > 1 || logging > 1 || tol > 0.) { - if ( logging > 1 ) + if (logging > 1) { - hypre_ParVectorCopy(f, residual ); + hypre_ParVectorCopy(f, residual); if (tol > 0.0) { - hypre_ParCSRMatrixMatvec(alpha, A, u, beta, residual ); + hypre_ParCSRMatrixMatvec(alpha, A, u, beta, residual); } - resnorm = sqrt(hypre_ParVectorInnerProd( residual, residual )); + resnorm = hypre_sqrt(hypre_ParVectorInnerProd(residual, residual)); } else { @@ -2231,14 +1665,14 @@ hypre_NSHSolve( void *nsh_vdata, { hypre_ParCSRMatrixMatvec(alpha, A, u, beta, Ftemp); } - resnorm = sqrt(hypre_ParVectorInnerProd(Ftemp, Ftemp)); + resnorm = hypre_sqrt(hypre_ParVectorInnerProd(Ftemp, Ftemp)); } - /* Since it is does not diminish performance, attempt to return an error flag + /* Since it does not diminish performance, attempt to return an error flag and notify users when they supply bad input. */ if (resnorm != 0.) { - ieee_check = resnorm/resnorm; /* INF -> NaN conversion */ + ieee_check = resnorm / resnorm; /* INF -> NaN conversion */ } if (ieee_check != ieee_check) { @@ -2259,7 +1693,7 @@ hypre_NSHSolve( void *nsh_vdata, } init_resnorm = resnorm; - rhs_norm = sqrt(hypre_ParVectorInnerProd(f, f)); + rhs_norm = hypre_sqrt(hypre_ParVectorInnerProd(f, f)); if (rhs_norm > HYPRE_REAL_EPSILON) { rel_resnorm = init_resnorm / rhs_norm; @@ -2268,7 +1702,7 @@ hypre_NSHSolve( void *nsh_vdata, { /* rhs is zero, return a zero solution */ hypre_ParVectorSetConstantValues(U_array, 0.0); - if(logging > 0) + if (logging > 0) { rel_resnorm = 0.0; hypre_ParNSHDataFinalRelResidualNorm(nsh_data) = rel_resnorm; @@ -2286,8 +1720,8 @@ hypre_NSHSolve( void *nsh_vdata, hypre_printf(" relative\n"); hypre_printf(" residual factor residual\n"); hypre_printf(" -------- ------ --------\n"); - hypre_printf(" Initial %e %e\n",init_resnorm, - rel_resnorm); + hypre_printf(" Initial %e %e\n", init_resnorm, + rel_resnorm); } matA = A; @@ -2297,10 +1731,8 @@ hypre_NSHSolve( void *nsh_vdata, /************** Main Solver Loop - always do 1 iteration ************/ iter = 0; - while ((rel_resnorm >= tol || iter < 1) - && iter < max_iter) + while ((rel_resnorm >= tol || iter < 1) && iter < max_iter) { - /* Do one solve on e = Mr */ hypre_NSHSolveInverse(matA, f, u, matM, Utemp, Ftemp); @@ -2312,19 +1744,21 @@ hypre_NSHSolve( void *nsh_vdata, { old_resnorm = resnorm; - if ( logging > 1 ) { + if (logging > 1) + { hypre_ParVectorCopy(F_array, residual); hypre_ParCSRMatrixMatvec(alpha, matA, U_array, beta, residual ); - resnorm = sqrt(hypre_ParVectorInnerProd( residual, residual )); + resnorm = hypre_sqrt(hypre_ParVectorInnerProd( residual, residual )); } - else { + else + { hypre_ParVectorCopy(F_array, Ftemp); hypre_ParCSRMatrixMatvec(alpha, matA, U_array, beta, Ftemp); - resnorm = sqrt(hypre_ParVectorInnerProd(Ftemp, Ftemp)); + resnorm = hypre_sqrt(hypre_ParVectorInnerProd(Ftemp, Ftemp)); } - if (old_resnorm) conv_factor = resnorm / old_resnorm; - else conv_factor = resnorm; + if (old_resnorm) { conv_factor = resnorm / old_resnorm; } + else { conv_factor = resnorm; } if (rhs_norm > HYPRE_REAL_EPSILON) { rel_resnorm = resnorm / rhs_norm; @@ -2344,7 +1778,7 @@ hypre_NSHSolve( void *nsh_vdata, if (my_id == 0 && print_level > 1) { hypre_printf(" NSHSolve %2d %e %f %e \n", iter, - resnorm, conv_factor, rel_resnorm); + resnorm, conv_factor, rel_resnorm); } } @@ -2362,7 +1796,7 @@ hypre_NSHSolve( void *nsh_vdata, if (iter > 0 && init_resnorm) { - conv_factor = pow((resnorm/init_resnorm),(1.0/(HYPRE_Real) iter)); + conv_factor = hypre_pow((resnorm / init_resnorm), (1.0 / (HYPRE_Real) iter)); } else { @@ -2378,40 +1812,49 @@ hypre_NSHSolve( void *nsh_vdata, { hypre_printf("\n\n=============================================="); hypre_printf("\n NOTE: Convergence tolerance was not achieved\n"); - hypre_printf(" within the allowed %d iterations\n",max_iter); + hypre_printf(" within the allowed %d iterations\n", max_iter); hypre_printf("=============================================="); } - hypre_printf("\n\n Average Convergence Factor = %f \n",conv_factor); - hypre_printf(" operator = %f\n",operat_cmplxty); + hypre_printf("\n\n Average Convergence Factor = %f \n", conv_factor); + hypre_printf(" operator = %f\n", operat_cmplxty); } } + return hypre_error_flag; } -/* NSH solve +/*-------------------------------------------------------------------- + * hypre_NSHSolveInverse + * * Simply a matvec on residual with approximate inverse + * * A: original matrix * f: rhs * u: solution * M: approximate inverse * ftemp, utemp: working vectors -*/ + *--------------------------------------------------------------------*/ + HYPRE_Int -hypre_NSHSolveInverse(hypre_ParCSRMatrix *A, hypre_ParVector *f, - hypre_ParVector *u, hypre_ParCSRMatrix *M, - hypre_ParVector *ftemp, hypre_ParVector *utemp) +hypre_NSHSolveInverse(hypre_ParCSRMatrix *A, + hypre_ParVector *f, + hypre_ParVector *u, + hypre_ParCSRMatrix *M, + hypre_ParVector *ftemp, + hypre_ParVector *utemp) { - HYPRE_Real alpha; - HYPRE_Real beta; + HYPRE_Real alpha = -1.0; + HYPRE_Real beta = 1.0; + HYPRE_Real zero = 0.0; - /* begin */ - alpha = -1.0; - beta = 1.0; - /* r = f-Au */ + /* r = f - Au */ hypre_ParCSRMatrixMatvecOutOfPlace(alpha, A, u, beta, f, ftemp); + /* e = Mr */ - hypre_ParCSRMatrixMatvec(1.0, M, ftemp, 0.0, utemp); + hypre_ParCSRMatrixMatvec(beta, M, ftemp, zero, utemp); + /* u = u + e */ hypre_ParVectorAxpy(beta, utemp, u); + return hypre_error_flag; } diff --git a/external/hypre/src/parcsr_ls/par_ilu_solve_device.c b/external/hypre/src/parcsr_ls/par_ilu_solve_device.c new file mode 100644 index 00000000..685f6e3b --- /dev/null +++ b/external/hypre/src/parcsr_ls/par_ilu_solve_device.c @@ -0,0 +1,1226 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#include "_hypre_onedpl.hpp" +#include "_hypre_parcsr_ls.h" +#include "_hypre_utilities.hpp" + +#if defined(HYPRE_USING_GPU) + +/*-------------------------------------------------------------------------- + * hypre_ILUSolveLUDevice + * + * Incomplete LU solve (GPU) + * + * L, D and U factors only have local scope (no off-diagonal processor terms) + * so apart from the residual calculation (which uses A), the solves with the + * L and U factors are local. + * + * TODO (VPM): Merge this function with hypre_ILUSolveLUIterDevice + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSolveLUDevice(hypre_ParCSRMatrix *A, + hypre_CSRMatrix *matLU_d, + hypre_ParVector *f, + hypre_ParVector *u, + HYPRE_Int *perm, + hypre_ParVector *ftemp, + hypre_ParVector *utemp) +{ + HYPRE_Int num_rows = hypre_ParCSRMatrixNumRows(A); + + hypre_Vector *utemp_local = hypre_ParVectorLocalVector(utemp); + HYPRE_Complex *utemp_data = hypre_VectorData(utemp_local); + hypre_Vector *ftemp_local = hypre_ParVectorLocalVector(ftemp); + HYPRE_Complex *ftemp_data = hypre_VectorData(ftemp_local); + + HYPRE_Complex alpha = -1.0; + HYPRE_Complex beta = 1.0; + + /* Sanity check */ + if (num_rows == 0) + { + return hypre_error_flag; + } + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("ILUSolve"); + + /* Compute residual */ + hypre_ParCSRMatrixMatvecOutOfPlace(alpha, A, u, beta, f, ftemp); + + /* Apply permutation */ + if (perm) + { +#if defined(HYPRE_USING_SYCL) + hypreSycl_gather(perm, perm + num_rows, ftemp_data, utemp_data); +#else + HYPRE_THRUST_CALL(gather, perm, perm + num_rows, ftemp_data, utemp_data); +#endif + } + else + { + hypre_TMemcpy(utemp_data, ftemp_data, HYPRE_Complex, num_rows, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + } + + /* L solve - Forward solve */ + hypre_CSRMatrixTriLowerUpperSolveDevice('L', 1, matLU_d, NULL, utemp_local, ftemp_local); + + /* U solve - Backward substitution */ + hypre_CSRMatrixTriLowerUpperSolveDevice('U', 0, matLU_d, NULL, ftemp_local, utemp_local); + + /* Apply reverse permutation */ + if (perm) + { +#if defined(HYPRE_USING_SYCL) + hypreSycl_scatter(utemp_data, utemp_data + num_rows, perm, ftemp_data); +#else + HYPRE_THRUST_CALL(scatter, utemp_data, utemp_data + num_rows, perm, ftemp_data); +#endif + } + else + { + hypre_TMemcpy(ftemp_data, utemp_data, HYPRE_Complex, num_rows, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + } + + /* Update solution */ + hypre_ParVectorAxpy(beta, ftemp, u); + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_ILUApplyLowerJacIterDevice + * + * Incomplete L solve (Forward) of u^{k+1} = L^{-1}u^k on the GPU using the + * Jacobi iterative approach. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUApplyLowerJacIterDevice(hypre_CSRMatrix *A, + hypre_Vector *input, + hypre_Vector *work, + hypre_Vector *output, + HYPRE_Int lower_jacobi_iters) +{ + HYPRE_Complex *input_data = hypre_VectorData(input); + HYPRE_Complex *work_data = hypre_VectorData(work); + HYPRE_Complex *output_data = hypre_VectorData(output); + HYPRE_Int num_rows = hypre_CSRMatrixNumRows(A); + + HYPRE_Int kk = 0; + + /* Since the initial guess to the jacobi iteration is 0, the result of + the first L SpMV is 0, so no need to compute. + However, we still need to compute the transformation */ + hypreDevice_ComplexAxpyn(work_data, num_rows, input_data, output_data, 0.0); + + /* Do the remaining iterations */ + for (kk = 1; kk < lower_jacobi_iters; kk++) + { + /* Apply SpMV */ + hypre_CSRMatrixSpMVDevice(0, 1.0, A, output, 0.0, work, -2); + + /* Transform */ + hypreDevice_ComplexAxpyn(work_data, num_rows, input_data, output_data, -1.0); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_ILUApplyUpperJacIterDevice + * + * Incomplete U solve (Backward) of u^{k+1} = U^{-1}u^k on the GPU using the + * Jacobi iterative approach. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUApplyUpperJacIterDevice(hypre_CSRMatrix *A, + hypre_Vector *input, + hypre_Vector *work, + hypre_Vector *output, + hypre_Vector *diag, + HYPRE_Int upper_jacobi_iters) +{ + HYPRE_Complex *output_data = hypre_VectorData(output); + HYPRE_Complex *work_data = hypre_VectorData(work); + HYPRE_Complex *input_data = hypre_VectorData(input); + HYPRE_Complex *diag_data = hypre_VectorData(diag); + HYPRE_Int num_rows = hypre_CSRMatrixNumRows(A); + + HYPRE_Int kk = 0; + + /* Since the initial guess to the jacobi iteration is 0, + the result of the first U SpMV is 0, so no need to compute. + However, we still need to compute the transformation */ + hypreDevice_zeqxmydd(num_rows, input_data, 0.0, work_data, output_data, diag_data); + + /* Do the remaining iterations */ + for (kk = 1; kk < upper_jacobi_iters; kk++) + { + /* apply SpMV */ + hypre_CSRMatrixSpMVDevice(0, 1.0, A, output, 0.0, work, 2); + + /* transform */ + hypreDevice_zeqxmydd(num_rows, input_data, -1.0, work_data, output_data, diag_data); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_ILUApplyLowerUpperJacIterDevice + * + * Incomplete LU solve of u^{k+1} = U^{-1} L^{-1} u^k on the GPU using the + * Jacobi iterative approach. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUApplyLowerUpperJacIterDevice(hypre_CSRMatrix *A, + hypre_Vector *work1, + hypre_Vector *work2, + hypre_Vector *inout, + hypre_Vector *diag, + HYPRE_Int lower_jacobi_iters, + HYPRE_Int upper_jacobi_iters) +{ + /* Apply the iterative solve to L */ + hypre_ILUApplyLowerJacIterDevice(A, inout, work1, work2, lower_jacobi_iters); + + /* Apply the iterative solve to U */ + hypre_ILUApplyUpperJacIterDevice(A, work2, work1, inout, diag, upper_jacobi_iters); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_ILUSolveLUIterDevice + * + * Incomplete LU solve using jacobi iterations on GPU. + * L, D and U factors only have local scope (no off-diagonal processor terms). + * + * TODO (VPM): Merge this function with hypre_ILUSolveLUDevice + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSolveLUIterDevice(hypre_ParCSRMatrix *A, + hypre_CSRMatrix *matLU, + hypre_ParVector *f, + hypre_ParVector *u, + HYPRE_Int *perm, + hypre_ParVector *ftemp, + hypre_ParVector *utemp, + hypre_ParVector *xtemp, + hypre_Vector **diag_ptr, + HYPRE_Int lower_jacobi_iters, + HYPRE_Int upper_jacobi_iters) +{ + HYPRE_Int num_rows = hypre_ParCSRMatrixNumRows(A); + + hypre_Vector *diag = *diag_ptr; + hypre_Vector *xtemp_local = hypre_ParVectorLocalVector(xtemp); + hypre_Vector *utemp_local = hypre_ParVectorLocalVector(utemp); + HYPRE_Complex *utemp_data = hypre_VectorData(utemp_local); + hypre_Vector *ftemp_local = hypre_ParVectorLocalVector(ftemp); + HYPRE_Complex *ftemp_data = hypre_VectorData(ftemp_local); + + HYPRE_Complex alpha = -1.0; + HYPRE_Complex beta = 1.0; + + /* Sanity check */ + if (num_rows == 0) + { + return hypre_error_flag; + } + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("ILUSolveLUIter"); + + /* Grab the main diagonal from the diagonal block. Only do this once */ + if (!diag) + { + /* Storage for the diagonal */ + diag = hypre_SeqVectorCreate(num_rows); + hypre_SeqVectorInitialize(diag); + + /* extract with device kernel */ + hypre_CSRMatrixExtractDiagonalDevice(matLU, hypre_VectorData(diag), 2); + + /* Save output pointer */ + *diag_ptr = diag; + } + + /* Compute residual */ + hypre_ParCSRMatrixMatvecOutOfPlace(alpha, A, u, beta, f, ftemp); + + /* Apply permutation */ + if (perm) + { +#if defined(HYPRE_USING_SYCL) + hypreSycl_gather(perm, perm + num_rows, ftemp_data, utemp_data); +#else + HYPRE_THRUST_CALL(gather, perm, perm + num_rows, ftemp_data, utemp_data); +#endif + } + else + { + hypre_TMemcpy(utemp_data, ftemp_data, HYPRE_Complex, num_rows, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + } + + /* Apply the iterative solve to L and U */ + hypre_ILUApplyLowerUpperJacIterDevice(matLU, ftemp_local, xtemp_local, utemp_local, + diag, lower_jacobi_iters, upper_jacobi_iters); + + /* Apply reverse permutation */ + if (perm) + { +#if defined(HYPRE_USING_SYCL) + hypreSycl_scatter(utemp_data, utemp_data + num_rows, perm, ftemp_data); +#else + HYPRE_THRUST_CALL(scatter, utemp_data, utemp_data + num_rows, perm, ftemp_data); +#endif + } + else + { + hypre_TMemcpy(ftemp_data, utemp_data, HYPRE_Complex, num_rows, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + } + + /* Update solution */ + hypre_ParVectorAxpy(beta, ftemp, u); + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_ParILUSchurGMRESMatvecDevice + * + * Slightly different, for this new matvec, the diagonal of the original + * matrix is the LU factorization. Thus, the matvec is done in an different way + * + * |IS_1 E_12 E_13| + * |E_21 IS_2 E_23| = S + * |E_31 E_32 IS_3| + * + * |IS_1 | + * | IS_2 | = M + * | IS_3| + * + * Solve Sy = g is just M^{-1}S = M^{-1}g + * + * | I IS_1^{-1}E_12 IS_1^{-1}E_13| + * |IS_2^{-1}E_21 I IS_2^{-1}E_23| = M^{-1}S + * |IS_3^{-1}E_31 IS_3^{-1}E_32 I | + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParILUSchurGMRESMatvecDevice(void *matvec_data, + HYPRE_Complex alpha, + void *ilu_vdata, + void *x, + HYPRE_Complex beta, + void *y) +{ + HYPRE_UNUSED_VAR(matvec_data); + + /* Get matrix information first */ + hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; + hypre_ParCSRMatrix *S = hypre_ParILUDataMatS(ilu_data); + hypre_CSRMatrix *S_diag = hypre_ParCSRMatrixDiag(S); + + /* Fist step, apply matvec on empty diagonal slot */ + HYPRE_Int num_rows = hypre_CSRMatrixNumRows(S_diag); + HYPRE_Int num_nonzeros = hypre_CSRMatrixNumNonzeros(S_diag); + + hypre_ParVector *xtemp = hypre_ParILUDataXTemp(ilu_data); + hypre_ParVector *ytemp = hypre_ParILUDataYTemp(ilu_data); + hypre_Vector *xtemp_local = hypre_ParVectorLocalVector(xtemp); + hypre_Vector *ytemp_local = hypre_ParVectorLocalVector(ytemp); + + /* Local variables */ + HYPRE_Complex zero = 0.0; + HYPRE_Complex one = 1.0; + + /* Matvec with + * | O E_12 E_13| + * alpha * |E_21 O E_23| + * |E_31 E_32 O | + * store in xtemp + */ + + /* RL: temp. set S_diag's nnz = 0 to skip the matvec + (based on the assumption in seq_mv/csr_matvec impl.) */ + hypre_CSRMatrixNumRows(S_diag) = 0; + hypre_CSRMatrixNumNonzeros(S_diag) = 0; + hypre_ParCSRMatrixMatvec(alpha, (hypre_ParCSRMatrix *) S, (hypre_ParVector *) x, zero, xtemp); + hypre_CSRMatrixNumRows(S_diag) = num_rows; + hypre_CSRMatrixNumNonzeros(S_diag) = num_nonzeros; + + /* Compute U^{-1}*L^{-1}*(S_offd * x) + * Or in other words, matvec with + * | O IS_1^{-1}E_12 IS_1^{-1}E_13| + * alpha * |IS_2^{-1}E_21 O IS_2^{-1}E_23| + * |IS_3^{-1}E_31 IS_3^{-1}E_32 O | + * store in xtemp + */ + + /* L solve - Forward solve */ + hypre_CSRMatrixTriLowerUpperSolveDevice('L', 1, S_diag, NULL, xtemp_local, ytemp_local); + + /* U solve - Backward substitution */ + hypre_CSRMatrixTriLowerUpperSolveDevice('U', 0, S_diag, NULL, ytemp_local, xtemp_local); + + /* xtemp = xtemp + alpha*x */ + hypre_ParVectorAxpy(alpha, (hypre_ParVector *) x, xtemp); + + /* y = xtemp + beta*y */ + hypre_ParVectorAxpyz(one, xtemp, beta, (hypre_ParVector *) y, (hypre_ParVector *) y); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_ILUSolveSchurGMRESDevice + * + * Schur Complement solve with GMRES on schur complement + * + * ParCSRMatrix S is already built in ilu data sturcture, here directly use + * S, L, D and U factors only have local scope (no off-diag terms) so apart + * from the residual calculation (which uses A), the solves with the L and U + * factors are local. + * S is the global Schur complement + * schur_solver is a GMRES solver + * schur_precond is the ILU preconditioner for GMRES + * rhs and x are helper vectors for solving the Schur system + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSolveSchurGMRESDevice(hypre_ParCSRMatrix *A, + hypre_ParVector *f, + hypre_ParVector *u, + HYPRE_Int *perm, + HYPRE_Int nLU, + hypre_ParCSRMatrix *S, + hypre_ParVector *ftemp, + hypre_ParVector *utemp, + HYPRE_Solver schur_solver, + HYPRE_Solver schur_precond, + hypre_ParVector *rhs, + hypre_ParVector *x, + HYPRE_Int *u_end, + hypre_CSRMatrix *matBLU_d, + hypre_CSRMatrix *matE_d, + hypre_CSRMatrix *matF_d) +{ + HYPRE_UNUSED_VAR(u_end); + + /* If we don't have S block, just do one L solve and one U solve */ + if (!S) + { + return hypre_ILUSolveLUDevice(A, matBLU_d, f, u, perm, ftemp, utemp); + } + + /* Data objects for temp vector */ + hypre_Vector *utemp_local = hypre_ParVectorLocalVector(utemp); + HYPRE_Real *utemp_data = hypre_VectorData(utemp_local); + hypre_Vector *ftemp_local = hypre_ParVectorLocalVector(ftemp); + HYPRE_Real *ftemp_data = hypre_VectorData(ftemp_local); + hypre_Vector *rhs_local = hypre_ParVectorLocalVector(rhs); + hypre_Vector *x_local = hypre_ParVectorLocalVector(x); + HYPRE_Real *x_data = hypre_VectorData(x_local); + + /* Problem size */ + hypre_CSRMatrix *matSLU_d = hypre_ParCSRMatrixDiag(S); + HYPRE_Int m = hypre_CSRMatrixNumRows(matSLU_d); + HYPRE_Int n = nLU + m; + + /* Local variables */ + HYPRE_Real alpha = -1.0; + HYPRE_Real beta = 1.0; + hypre_Vector *ftemp_upper; + hypre_Vector *utemp_lower; + + /* Temporary vectors */ + ftemp_upper = hypre_SeqVectorCreate(nLU); + utemp_lower = hypre_SeqVectorCreate(m); + hypre_VectorOwnsData(ftemp_upper) = 0; + hypre_VectorOwnsData(utemp_lower) = 0; + hypre_VectorData(ftemp_upper) = ftemp_data; + hypre_VectorData(utemp_lower) = utemp_data + nLU; + hypre_SeqVectorInitialize(ftemp_upper); + hypre_SeqVectorInitialize(utemp_lower); + + /* Compute residual */ + hypre_ParCSRMatrixMatvecOutOfPlace(alpha, A, u, beta, f, ftemp); + + /* 1st need to solve LBi*xi = fi + * L solve, solve xi put in u_temp upper + */ + + /* Apply permutation before we can start our solve */ + if (perm) + { +#if defined(HYPRE_USING_SYCL) + hypreSycl_gather(perm, perm + n, ftemp_data, utemp_data); +#else + HYPRE_THRUST_CALL(gather, perm, perm + n, ftemp_data, utemp_data); +#endif + } + else + { + hypre_TMemcpy(utemp_data, ftemp_data, HYPRE_Complex, n, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + } + + /* This solve won't touch data in utemp, thus, gi is still in utemp_lower */ + /* L solve - Forward solve */ + hypre_CSRMatrixTriLowerUpperSolveDevice('L', 1, matBLU_d, NULL, utemp_local, ftemp_local); + + /* 2nd need to compute g'i = gi - Ei*UBi^{-1}*xi + * Ei*UBi^{-1} is exactly the matE_d here + * Now: LBi^{-1}f_i is in ftemp_upper + * gi' is in utemp_lower + */ + hypre_CSRMatrixMatvec(alpha, matE_d, ftemp_upper, beta, utemp_lower); + + /* 3rd need to solve global Schur Complement M^{-1}Sy = M^{-1}g' + * for now only solve the local system + * solve y put in u_temp lower + * only solve whe S is not NULL + */ + + /* Setup vectors for solve + * rhs = M^{-1}g' + */ + + /* L solve */ + hypre_CSRMatrixTriLowerUpperSolveDevice_core('L', 1, matSLU_d, NULL, utemp_local, + nLU, ftemp_local, nLU); + + /* U solve */ + hypre_CSRMatrixTriLowerUpperSolveDevice_core('U', 0, matSLU_d, NULL, ftemp_local, + nLU, rhs_local, 0); + + /* Solve with tricky initial guess */ + HYPRE_GMRESSolve(schur_solver, + (HYPRE_Matrix) schur_precond, + (HYPRE_Vector) rhs, + (HYPRE_Vector) x); + + /* 4th need to compute zi = xi - LBi^-1*yi + * put zi in f_temp upper + * only do this computation when nLU < n + * U is unsorted, search is expensive when unnecessary + */ + hypre_CSRMatrixMatvec(alpha, matF_d, x_local, beta, ftemp_upper); + + /* 5th need to solve UBi*ui = zi */ + /* put result in u_temp upper */ + /* U solve - Forward solve */ + hypre_CSRMatrixTriLowerUpperSolveDevice('U', 0, matBLU_d, NULL, ftemp_local, utemp_local); + + /* Copy lower part solution into u_temp as well */ + hypre_TMemcpy(utemp_data + nLU, x_data, HYPRE_Real, m, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + + /* Perm back */ + if (perm) + { +#if defined(HYPRE_USING_SYCL) + hypreSycl_scatter(utemp_data, utemp_data + n, perm, ftemp_data); +#else + HYPRE_THRUST_CALL(scatter, utemp_data, utemp_data + n, perm, ftemp_data); +#endif + } + else + { + hypre_TMemcpy(ftemp_data, utemp_data, HYPRE_Complex, n, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + } + + /* Done, now everything are in u_temp, update solution */ + hypre_ParVectorAxpy(beta, ftemp, u); + + /* Free memory */ + hypre_SeqVectorDestroy(ftemp_upper); + hypre_SeqVectorDestroy(utemp_lower); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_ILUSolveSchurGMRESJacIterDevice + * + * Schur Complement solve with GMRES. + * + * ParCSRMatrix S is already built in the ilu data structure. S, L, D and U + * factors only have local scope (no off-diag terms). So apart from the + * residual calculation (which uses A), the solves with the L and U factors + * are local. + * S: the global Schur complement + * schur_solver: GMRES solver + * schur_precond: ILU preconditioner for GMRES + * rhs and x are helper vectors for solving the Schur system + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSolveSchurGMRESJacIterDevice(hypre_ParCSRMatrix *A, + hypre_ParVector *f, + hypre_ParVector *u, + HYPRE_Int *perm, + HYPRE_Int nLU, + hypre_ParCSRMatrix *S, + hypre_ParVector *ftemp, + hypre_ParVector *utemp, + HYPRE_Solver schur_solver, + HYPRE_Solver schur_precond, + hypre_ParVector *rhs, + hypre_ParVector *x, + HYPRE_Int *u_end, + hypre_CSRMatrix *matBLU_d, + hypre_CSRMatrix *matE_d, + hypre_CSRMatrix *matF_d, + hypre_ParVector *ztemp, + hypre_Vector **Adiag_diag, + hypre_Vector **Sdiag_diag, + HYPRE_Int lower_jacobi_iters, + HYPRE_Int upper_jacobi_iters) +{ + HYPRE_UNUSED_VAR(u_end); + + /* If we don't have S block, just do one L solve and one U solve */ + if (!S) + { + return hypre_ILUSolveLUIterDevice(A, matBLU_d, f, u, perm, + ftemp, utemp, ztemp, Adiag_diag, + lower_jacobi_iters, upper_jacobi_iters); + } + + /* Data objects for work vectors */ + hypre_Vector *utemp_local = hypre_ParVectorLocalVector(utemp); + hypre_Vector *ftemp_local = hypre_ParVectorLocalVector(ftemp); + hypre_Vector *ztemp_local = hypre_ParVectorLocalVector(ztemp); + hypre_Vector *rhs_local = hypre_ParVectorLocalVector(rhs); + hypre_Vector *x_local = hypre_ParVectorLocalVector(x); + + HYPRE_Complex *utemp_data = hypre_VectorData(utemp_local); + HYPRE_Complex *ftemp_data = hypre_VectorData(ftemp_local); + HYPRE_Complex *x_data = hypre_VectorData(x_local); + + /* Problem size */ + hypre_CSRMatrix *matSLU_d = hypre_ParCSRMatrixDiag(S); + HYPRE_Int m = hypre_CSRMatrixNumRows(matSLU_d); + HYPRE_Int n = nLU + m; + + /* Local variables */ + HYPRE_Complex alpha = -1.0; + HYPRE_Complex beta = 1.0; + hypre_Vector *ftemp_upper; + hypre_Vector *utemp_lower; + hypre_Vector *ftemp_shift; + hypre_Vector *utemp_shift; + + /* Set work vectors */ + ftemp_upper = hypre_SeqVectorCreate(nLU); + utemp_lower = hypre_SeqVectorCreate(m); + ftemp_shift = hypre_SeqVectorCreate(m); + utemp_shift = hypre_SeqVectorCreate(m); + + hypre_VectorOwnsData(ftemp_upper) = 0; + hypre_VectorOwnsData(utemp_lower) = 0; + hypre_VectorOwnsData(ftemp_shift) = 0; + hypre_VectorOwnsData(utemp_shift) = 0; + + hypre_VectorData(ftemp_upper) = ftemp_data; + hypre_VectorData(utemp_lower) = utemp_data + nLU; + hypre_VectorData(ftemp_shift) = ftemp_data + nLU; + hypre_VectorData(utemp_shift) = utemp_data + nLU; + + hypre_SeqVectorInitialize(ftemp_upper); + hypre_SeqVectorInitialize(utemp_lower); + hypre_SeqVectorInitialize(ftemp_shift); + hypre_SeqVectorInitialize(utemp_shift); + + /* Grab the main diagonal from the diagonal block. Only do this once */ + if (!(*Adiag_diag)) + { + /* Storage for the diagonal */ + *Adiag_diag = hypre_SeqVectorCreate(n); + hypre_SeqVectorInitialize(*Adiag_diag); + + /* Extract with device kernel */ + hypre_CSRMatrixExtractDiagonalDevice(matBLU_d, hypre_VectorData(*Adiag_diag), 2); + } + + /* Compute residual */ + hypre_ParCSRMatrixMatvecOutOfPlace(alpha, A, u, beta, f, ftemp); + + /* 1st need to solve LBi*xi = fi + * L solve, solve xi put in u_temp upper + */ + + /* Apply permutation before we can start our solve */ + if (perm) + { +#if defined(HYPRE_USING_SYCL) + hypreSycl_gather(perm, perm + n, ftemp_data, utemp_data); +#else + HYPRE_THRUST_CALL(gather, perm, perm + n, ftemp_data, utemp_data); +#endif + } + else + { + hypre_TMemcpy(utemp_data, ftemp_data, HYPRE_Complex, n, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + } + + if (nLU > 0) + { + /* Apply the iterative solve to L */ + hypre_ILUApplyLowerJacIterDevice(matBLU_d, utemp_local, ztemp_local, + ftemp_local, lower_jacobi_iters); + + /* 2nd need to compute g'i = gi - Ei*UBi^{-1}*xi + * Ei*UBi^{-1} is exactly the matE_d here + * Now: LBi^{-1}f_i is in ftemp_upper + * gi' is in utemp_lower + */ + hypre_CSRMatrixMatvec(alpha, matE_d, ftemp_upper, beta, utemp_lower); + } + + /* 3rd need to solve global Schur Complement M^{-1}Sy = M^{-1}g' + * for now only solve the local system + * solve y put in u_temp lower + * only solve whe S is not NULL + */ + + /* Setup vectors for solve + * rhs = M^{-1}g' + */ + if (m > 0) + { + /* Grab the main diagonal from the diagonal block. Only do this once */ + if (!(*Sdiag_diag)) + { + /* Storage for the diagonal */ + *Sdiag_diag = hypre_SeqVectorCreate(m); + hypre_SeqVectorInitialize(*Sdiag_diag); + + /* Extract with device kernel */ + hypre_CSRMatrixExtractDiagonalDevice(matSLU_d, hypre_VectorData(*Sdiag_diag), 2); + } + + /* Apply the iterative solve to L */ + hypre_ILUApplyLowerJacIterDevice(matSLU_d, utemp_shift, rhs_local, + ftemp_shift, lower_jacobi_iters); + + /* Apply the iterative solve to U */ + hypre_ILUApplyUpperJacIterDevice(matSLU_d, ftemp_shift, utemp_shift, + rhs_local, *Sdiag_diag, upper_jacobi_iters); + } + + /* Solve with tricky initial guess */ + HYPRE_GMRESSolve(schur_solver, + (HYPRE_Matrix) schur_precond, + (HYPRE_Vector) rhs, + (HYPRE_Vector) x); + + /* 4th need to compute zi = xi - LBi^-1*yi + * put zi in f_temp upper + * only do this computation when nLU < n + * U is unsorted, search is expensive when unnecessary + */ + if (nLU > 0) + { + hypre_CSRMatrixMatvec(alpha, matF_d, x_local, beta, ftemp_upper); + + /* 5th need to solve UBi*ui = zi */ + /* put result in u_temp upper */ + + /* Apply the iterative solve to U */ + hypre_ILUApplyUpperJacIterDevice(matBLU_d, ftemp_local, ztemp_local, + utemp_local, *Adiag_diag, upper_jacobi_iters); + } + + /* Copy lower part solution into u_temp as well */ + hypre_TMemcpy(utemp_data + nLU, x_data, HYPRE_Real, m, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + + /* Perm back */ + if (perm) + { +#if defined(HYPRE_USING_SYCL) + hypreSycl_scatter(utemp_data, utemp_data + n, perm, ftemp_data); +#else + HYPRE_THRUST_CALL(scatter, utemp_data, utemp_data + n, perm, ftemp_data); +#endif + } + else + { + hypre_TMemcpy(ftemp_data, utemp_data, HYPRE_Complex, n, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + } + + /* Update solution */ + hypre_ParVectorAxpy(beta, ftemp, u); + + /* Free memory */ + hypre_SeqVectorDestroy(ftemp_shift); + hypre_SeqVectorDestroy(utemp_shift); + hypre_SeqVectorDestroy(ftemp_upper); + hypre_SeqVectorDestroy(utemp_lower); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_ParILUSchurGMRESMatvecJacIterDevice + * + * Slightly different, for this new matvec, the diagonal of the original matrix + * is the LU factorization. Thus, the matvec is done in an different way + * + * |IS_1 E_12 E_13| + * |E_21 IS_2 E_23| = S + * |E_31 E_32 IS_3| + * + * |IS_1 | + * | IS_2 | = M + * | IS_3| + * + * Solve Sy = g is just M^{-1}S = M^{-1}g + * + * | I IS_1^{-1}E_12 IS_1^{-1}E_13| + * |IS_2^{-1}E_21 I IS_2^{-1}E_23| = M^{-1}S + * |IS_3^{-1}E_31 IS_3^{-1}E_32 I | + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParILUSchurGMRESMatvecJacIterDevice(void *matvec_data, + HYPRE_Complex alpha, + void *ilu_vdata, + void *x, + HYPRE_Complex beta, + void *y) +{ + HYPRE_UNUSED_VAR(matvec_data); + + /* get matrix information first */ + hypre_ParILUData *ilu_data = (hypre_ParILUData*) ilu_vdata; + hypre_ParCSRMatrix *S = hypre_ParILUDataMatS(ilu_data); + hypre_Vector *Sdiag_diag = hypre_ParILUDataSDiagDiag(ilu_data); + HYPRE_Int lower_jacobi_iters = hypre_ParILUDataLowerJacobiIters(ilu_data); + HYPRE_Int upper_jacobi_iters = hypre_ParILUDataUpperJacobiIters(ilu_data); + + /* fist step, apply matvec on empty diagonal slot */ + hypre_CSRMatrix *S_diag = hypre_ParCSRMatrixDiag(S); + HYPRE_Int S_diag_n = hypre_CSRMatrixNumRows(S_diag); + HYPRE_Int S_diag_nnz = hypre_CSRMatrixNumNonzeros(S_diag); + + hypre_ParVector *xtemp = hypre_ParILUDataXTemp(ilu_data); + hypre_Vector *xtemp_local = hypre_ParVectorLocalVector(xtemp); + hypre_ParVector *ytemp = hypre_ParILUDataYTemp(ilu_data); + hypre_Vector *ytemp_local = hypre_ParVectorLocalVector(ytemp); + hypre_ParVector *ztemp = hypre_ParILUDataZTemp(ilu_data); + hypre_Vector *ztemp_local = hypre_ParVectorLocalVector(ztemp); + HYPRE_Real zero = 0.0; + HYPRE_Real one = 1.0; + + /* Matvec with + * | O E_12 E_13| + * alpha * |E_21 O E_23| + * |E_31 E_32 O | + * store in xtemp + */ + + /* RL: temp. set S_diag's nnz = 0 to skip the matvec + (based on the assumption in seq_mv/csr_matvec impl.) */ + hypre_CSRMatrixNumRows(S_diag) = 0; + hypre_CSRMatrixNumNonzeros(S_diag) = 0; + hypre_ParCSRMatrixMatvec(alpha, (hypre_ParCSRMatrix *) S, (hypre_ParVector *) x, zero, xtemp); + hypre_CSRMatrixNumRows(S_diag) = S_diag_n; + hypre_CSRMatrixNumNonzeros(S_diag) = S_diag_nnz; + + /* Grab the main diagonal from the diagonal block. Only do this once */ + if (!Sdiag_diag) + { + /* Storage for the diagonal */ + Sdiag_diag = hypre_SeqVectorCreate(S_diag_n); + hypre_SeqVectorInitialize(Sdiag_diag); + + /* Extract with device kernel */ + hypre_CSRMatrixExtractDiagonalDevice(S_diag, hypre_VectorData(Sdiag_diag), 2); + + /* Save Schur diagonal */ + hypre_ParILUDataSDiagDiag(ilu_data) = Sdiag_diag; + } + + /* Compute U^{-1}*L^{-1}*(A_offd * x) + * Or in another words, matvec with + * | O IS_1^{-1}E_12 IS_1^{-1}E_13| + * alpha * |IS_2^{-1}E_21 O IS_2^{-1}E_23| + * |IS_3^{-1}E_31 IS_3^{-1}E_32 O | + * store in xtemp + */ + if (S_diag_n) + { + /* apply the iterative solve to L and U */ + hypre_ILUApplyLowerUpperJacIterDevice(S_diag, ytemp_local, ztemp_local, + xtemp_local, Sdiag_diag, + lower_jacobi_iters, upper_jacobi_iters); + } + + /* now add the original x onto it */ + hypre_ParVectorAxpy(alpha, (hypre_ParVector *) x, xtemp); + + /* y = xtemp + beta*y */ + hypre_ParVectorAxpyz(one, xtemp, beta, (hypre_ParVector *) y, (hypre_ParVector *) y); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------- + * hypre_ILUSolveRAPGMRESDevice + * + * Device solve with GMRES on schur complement, RAP style. + * + * See hypre_ILUSolveRAPGMRESHost for more comments + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSolveRAPGMRESDevice(hypre_ParCSRMatrix *A, + hypre_ParVector *f, + hypre_ParVector *u, + HYPRE_Int *perm, + HYPRE_Int nLU, + hypre_ParCSRMatrix *S, + hypre_ParVector *ftemp, + hypre_ParVector *utemp, + hypre_ParVector *xtemp, + hypre_ParVector *ytemp, + HYPRE_Solver schur_solver, + HYPRE_Solver schur_precond, + hypre_ParVector *rhs, + hypre_ParVector *x, + HYPRE_Int *u_end, + hypre_ParCSRMatrix *Aperm, + hypre_CSRMatrix *matALU_d, + hypre_CSRMatrix *matBLU_d, + hypre_CSRMatrix *matE_d, + hypre_CSRMatrix *matF_d, + HYPRE_Int test_opt) +{ + HYPRE_UNUSED_VAR(ytemp); + HYPRE_UNUSED_VAR(u_end); + + /* If we don't have S block, just do one L/U solve */ + if (!S) + { + return hypre_ILUSolveLUDevice(A, matBLU_d, f, u, perm, ftemp, utemp); + } + + /* data objects for vectors */ + hypre_Vector *utemp_local = hypre_ParVectorLocalVector(utemp); + hypre_Vector *ftemp_local = hypre_ParVectorLocalVector(ftemp); + hypre_Vector *xtemp_local = hypre_ParVectorLocalVector(xtemp); + hypre_Vector *rhs_local = hypre_ParVectorLocalVector(rhs); + hypre_Vector *x_local = hypre_ParVectorLocalVector(x); + + HYPRE_Complex *utemp_data = hypre_VectorData(utemp_local); + HYPRE_Complex *ftemp_data = hypre_VectorData(ftemp_local); + HYPRE_Complex *xtemp_data = hypre_VectorData(xtemp_local); + HYPRE_Complex *rhs_data = hypre_VectorData(rhs_local); + HYPRE_Complex *x_data = hypre_VectorData(x_local); + + hypre_CSRMatrix *matSLU_d = hypre_ParCSRMatrixDiag(S); + HYPRE_Int m = hypre_CSRMatrixNumRows(matSLU_d); + HYPRE_Int n = nLU + m; + HYPRE_Real one = 1.0; + HYPRE_Real mone = -1.0; + HYPRE_Real zero = 0.0; + + /* Temporary vectors */ + hypre_Vector *ftemp_upper; + hypre_Vector *utemp_lower; + + /* Create temporary vectors */ + ftemp_upper = hypre_SeqVectorCreate(nLU); + utemp_lower = hypre_SeqVectorCreate(m); + + hypre_VectorOwnsData(ftemp_upper) = 0; + hypre_VectorOwnsData(utemp_lower) = 0; + hypre_VectorData(ftemp_upper) = ftemp_data; + hypre_VectorData(utemp_lower) = utemp_data + nLU; + + hypre_SeqVectorInitialize(ftemp_upper); + hypre_SeqVectorInitialize(utemp_lower); + + switch (test_opt) + { + case 1: case 3: + { + /* E and F */ + /* compute residual */ + hypre_ParCSRMatrixMatvecOutOfPlace(mone, A, u, one, f, utemp); + + /* apply permutation before we can start our solve + * Au=f -> (PAQ)Q'u=Pf + */ + if (perm) + { +#if defined(HYPRE_USING_SYCL) + hypreSycl_gather(perm, perm + n, utemp_data, ftemp_data); +#else + HYPRE_THRUST_CALL(gather, perm, perm + n, utemp_data, ftemp_data); +#endif + } + else + { + hypre_TMemcpy(ftemp_data, utemp_data, HYPRE_Complex, n, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + } + + /* A-smoothing + * x = [UA\(LA\(P*f_u))] fill to xtemp + */ + + /* L solve - Forward solve */ + hypre_CSRMatrixTriLowerUpperSolveDevice('L', 1, matALU_d, NULL, + ftemp_local, utemp_local); + + /* U solve - Backward solve */ + hypre_CSRMatrixTriLowerUpperSolveDevice('U', 0, matALU_d, NULL, + utemp_local, xtemp_local); + + /* residual, we should not touch xtemp for now + * r = R*(f-PAQx) + */ + hypre_ParCSRMatrixMatvec(mone, Aperm, xtemp, one, ftemp); + + /* with R is complex */ + /* copy partial data in */ + hypre_TMemcpy(rhs_data, ftemp_data + nLU, HYPRE_Real, m, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + + /* solve L^{-1} */ + hypre_CSRMatrixTriLowerUpperSolveDevice('L', 1, matBLU_d, NULL, + ftemp_local, utemp_local); + + /* -U^{-1}L^{-1} */ + hypre_CSRMatrixTriLowerUpperSolveDevice('U', 0, matBLU_d, NULL, + utemp_local, ftemp_local); + + /* -EU^{-1}L^{-1} */ + hypre_CSRMatrixMatvec(mone, matE_d, ftemp_upper, one, rhs_local); + + /* Solve S */ + if (S) + { + /* if we have a schur complement */ + hypre_ParVectorSetConstantValues(x, 0.0); + HYPRE_GMRESSolve(schur_solver, + (HYPRE_Matrix) schur_precond, + (HYPRE_Vector) rhs, + (HYPRE_Vector) x); + + /* u = xtemp + P*x */ + /* -Fx */ + hypre_CSRMatrixMatvec(mone, matF_d, x_local, zero, ftemp_upper); + + /* -L^{-1}Fx */ + hypre_CSRMatrixTriLowerUpperSolveDevice('L', 1, matBLU_d, NULL, + ftemp_local, utemp_local); + + /* -U{-1}L^{-1}Fx */ + hypre_CSRMatrixTriLowerUpperSolveDevice('U', 0, matBLU_d, NULL, + utemp_local, ftemp_local); + + /* now copy data to y_lower */ + hypre_TMemcpy(ftemp_data + nLU, x_data, HYPRE_Real, m, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + } + else + { + /* otherwise just apply triangular solves */ + /* L solve - Forward solve */ + hypre_CSRMatrixTriLowerUpperSolveDevice('L', 1, matSLU_d, NULL, rhs_local, x_local); + + /* U solve - Backward solve */ + hypre_CSRMatrixTriLowerUpperSolveDevice('U', 0, matSLU_d, NULL, x_local, rhs_local); + + /* u = xtemp + P*x */ + /* -Fx */ + hypre_CSRMatrixMatvec(mone, matF_d, rhs_local, zero, ftemp_upper); + + /* -L^{-1}Fx */ + hypre_CSRMatrixTriLowerUpperSolveDevice('L', 1, matBLU_d, NULL, + ftemp_local, utemp_local); + + /* -U{-1}L^{-1}Fx */ + hypre_CSRMatrixTriLowerUpperSolveDevice('U', 0, matBLU_d, NULL, + utemp_local, ftemp_local); + + /* now copy data to y_lower */ + hypre_TMemcpy(ftemp_data + nLU, rhs_data, HYPRE_Real, m, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + } + + /* correction to the residual */ + hypre_ParVectorAxpy(one, ftemp, xtemp); + + /* perm back */ + if (perm) + { +#if defined(HYPRE_USING_SYCL) + hypreSycl_scatter(xtemp_data, xtemp_data + n, perm, ftemp_data); +#else + HYPRE_THRUST_CALL(scatter, xtemp_data, xtemp_data + n, perm, ftemp_data); +#endif + } + else + { + hypre_TMemcpy(ftemp_data, xtemp_data, HYPRE_Complex, n, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + } + } + break; + + case 0: case 2: default: + { + /* EU^{-1} and L^{-1}F */ + /* compute residual */ + hypre_ParCSRMatrixMatvecOutOfPlace(mone, A, u, one, f, ftemp); + + /* apply permutation before we can start our solve + * Au=f -> (PAQ)Q'u=Pf + */ + if (perm) + { +#if defined(HYPRE_USING_SYCL) + hypreSycl_gather(perm, perm + n, ftemp_data, utemp_data); +#else + HYPRE_THRUST_CALL(gather, perm, perm + n, ftemp_data, utemp_data); +#endif + } + else + { + hypre_TMemcpy(utemp_data, ftemp_data, HYPRE_Complex, n, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + } + + /* A-smoothing + * x = [UA\(LA\(P*f_u))] fill to xtemp + */ + + /* L solve - Forward solve */ + hypre_CSRMatrixTriLowerUpperSolveDevice('L', 1, matALU_d, NULL, + utemp_local, ftemp_local); + + /* U solve - Backward solve */ + hypre_CSRMatrixTriLowerUpperSolveDevice('U', 0, matALU_d, NULL, + ftemp_local, xtemp_local); + + /* residual, we should not touch xtemp for now + * r = R*(f-PAQx) + */ + hypre_ParCSRMatrixMatvec(mone, Aperm, xtemp, one, utemp); + + /* with R is complex */ + /* copy partial data in */ + hypre_TMemcpy(rhs_data, utemp_data + nLU, HYPRE_Real, m, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + + /* solve L^{-1} */ + hypre_CSRMatrixTriLowerUpperSolveDevice('L', 1, matBLU_d, NULL, + utemp_local, ftemp_local); + + /* -EU^{-1}L^{-1} */ + hypre_CSRMatrixMatvec(mone, matE_d, ftemp_upper, one, rhs_local); + + /* Solve S */ + if (S) + { + /* if we have a schur complement */ + hypre_ParVectorSetConstantValues(x, 0.0); + HYPRE_GMRESSolve(schur_solver, + (HYPRE_Matrix) schur_precond, + (HYPRE_Vector) rhs, + (HYPRE_Vector) x); + + /* u = xtemp + P*x */ + /* -L^{-1}Fx */ + hypre_CSRMatrixMatvec(mone, matF_d, x_local, zero, ftemp_upper); + + /* -U{-1}L^{-1}Fx */ + hypre_CSRMatrixTriLowerUpperSolveDevice('U', 0, matBLU_d, NULL, + ftemp_local, utemp_local); + + /* now copy data to y_lower */ + hypre_TMemcpy(utemp_data + nLU, x_data, HYPRE_Real, m, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + } + else + { + /* otherwise just apply triangular solves */ + hypre_CSRMatrixTriLowerUpperSolveDevice('L', 1, matSLU_d, NULL, rhs_local, x_local); + hypre_CSRMatrixTriLowerUpperSolveDevice('U', 0, matSLU_d, NULL, x_local, rhs_local); + + /* u = xtemp + P*x */ + /* -L^{-1}Fx */ + hypre_CSRMatrixMatvec(mone, matF_d, rhs_local, zero, ftemp_upper); + + /* -U{-1}L^{-1}Fx */ + hypre_CSRMatrixTriLowerUpperSolveDevice('U', 0, matBLU_d, NULL, + ftemp_local, utemp_local); + + /* now copy data to y_lower */ + hypre_TMemcpy(utemp_data + nLU, rhs_data, HYPRE_Real, m, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + } + + /* Update xtemp */ + hypre_ParVectorAxpy(one, utemp, xtemp); + + /* perm back */ + if (perm) + { +#if defined(HYPRE_USING_SYCL) + hypreSycl_scatter(xtemp_data, xtemp_data + n, perm, ftemp_data); +#else + HYPRE_THRUST_CALL(scatter, xtemp_data, xtemp_data + n, perm, ftemp_data); +#endif + } + else + { + hypre_TMemcpy(ftemp_data, xtemp_data, HYPRE_Complex, n, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + } + } + break; + } + + /* Done, now everything are in u_temp, update solution */ + hypre_ParVectorAxpy(one, ftemp, u); + + /* Destroy temporary vectors */ + hypre_SeqVectorDestroy(ftemp_upper); + hypre_SeqVectorDestroy(utemp_lower); + + return hypre_error_flag; +} + +#endif /* defined(HYPRE_USING_GPU) */ diff --git a/external/hypre/src/parcsr_ls/par_indepset.c b/external/hypre/src/parcsr_ls/par_indepset.c index ea442dc6..e595caad 100644 --- a/external/hypre/src/parcsr_ls/par_indepset.c +++ b/external/hypre/src/parcsr_ls/par_indepset.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -41,7 +41,7 @@ hypre_BoomerAMGIndepSetInit( hypre_ParCSRMatrix *S, HYPRE_Int i, my_id; HYPRE_Int ierr = 0; - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_rank(comm, &my_id); i = 2747 + my_id; if (seq_rand) { @@ -142,7 +142,7 @@ hypre_BoomerAMGIndepSet( hypre_ParCSRMatrix *S, for (ig = 0; ig < graph_array_offd_size; ig++) { i = graph_array_offd[ig]; - if (measure_array[i+local_num_vars] > 1) + if (measure_array[i + local_num_vars] > 1) { IS_marker_offd[i] = 1; } @@ -157,12 +157,12 @@ hypre_BoomerAMGIndepSet( hypre_ParCSRMatrix *S, i = graph_array[ig]; if (measure_array[i] > 1) { - for (jS = S_diag_i[i]; jS < S_diag_i[i+1]; jS++) + for (jS = S_diag_i[i]; jS < S_diag_i[i + 1]; jS++) { j = S_diag_j[jS]; if (j < 0) { - j = -j-1; + j = -j - 1; } /* only consider valid graph edges */ @@ -179,14 +179,14 @@ hypre_BoomerAMGIndepSet( hypre_ParCSRMatrix *S, } } } - for (jS = S_offd_i[i]; jS < S_offd_i[i+1]; jS++) + for (jS = S_offd_i[i]; jS < S_offd_i[i + 1]; jS++) { jj = S_offd_j[jS]; if (jj < 0) { - jj = -jj-1; + jj = -jj - 1; } - j = local_num_vars+jj; + j = local_num_vars + jj; /* only consider valid graph edges */ /* if ( (measure_array[j] > 1) && (S_offd_data[jS]) ) */ diff --git a/external/hypre/src/parcsr_ls/par_indepset_device.c b/external/hypre/src/parcsr_ls/par_indepset_device.c index d031b693..f02ce157 100644 --- a/external/hypre/src/parcsr_ls/par_indepset_device.c +++ b/external/hypre/src/parcsr_ls/par_indepset_device.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -12,31 +12,32 @@ #include "_hypre_parcsr_ls.h" #include "_hypre_utilities.hpp" -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) __global__ void -hypreCUDAKernel_IndepSetMain(HYPRE_Int graph_diag_size, - HYPRE_Int *graph_diag, - HYPRE_Real *measure_diag, - HYPRE_Real *measure_offd, - HYPRE_Int *S_diag_i, - HYPRE_Int *S_diag_j, - HYPRE_Int *S_offd_i, - HYPRE_Int *S_offd_j, - HYPRE_Int *IS_marker_diag, - HYPRE_Int *IS_marker_offd, - HYPRE_Int IS_offd_temp_mark) +hypreGPUKernel_IndepSetMain(hypre_DeviceItem &item, + HYPRE_Int graph_diag_size, + HYPRE_Int *graph_diag, + HYPRE_Real *measure_diag, + HYPRE_Real *measure_offd, + HYPRE_Int *S_diag_i, + HYPRE_Int *S_diag_j, + HYPRE_Int *S_offd_i, + HYPRE_Int *S_offd_j, + HYPRE_Int *IS_marker_diag, + HYPRE_Int *IS_marker_offd, + HYPRE_Int IS_offd_temp_mark) { - HYPRE_Int warp_id = hypre_cuda_get_grid_warp_id<1,1>(); + HYPRE_Int warp_id = hypre_gpu_get_grid_warp_id<1, 1>(item); if (warp_id >= graph_diag_size) { return; } - HYPRE_Int lane = hypre_cuda_get_lane_id<1>(); + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); HYPRE_Int row, row_start, row_end; - HYPRE_Int i, j; - HYPRE_Real t, measure_row; + HYPRE_Int i = 0, j; + HYPRE_Real t = 0.0, measure_row; HYPRE_Int marker_row = 1; if (lane < 2) @@ -45,15 +46,15 @@ hypreCUDAKernel_IndepSetMain(HYPRE_Int graph_diag_size, i = read_only_load(S_diag_i + row + lane); } - row_start = __shfl_sync(HYPRE_WARP_FULL_MASK, i, 0); - row_end = __shfl_sync(HYPRE_WARP_FULL_MASK, i, 1); + row_start = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, i, 0); + row_end = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, i, 1); if (lane == 0) { t = read_only_load(measure_diag + row); } - measure_row = __shfl_sync(HYPRE_WARP_FULL_MASK, t, 0); + measure_row = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, t, 0); for (i = row_start + lane; i < row_end; i += HYPRE_WARP_SIZE) { @@ -77,8 +78,8 @@ hypreCUDAKernel_IndepSetMain(HYPRE_Int graph_diag_size, i = read_only_load(S_offd_i + row + lane); } - row_start = __shfl_sync(HYPRE_WARP_FULL_MASK, i, 0); - row_end = __shfl_sync(HYPRE_WARP_FULL_MASK, i, 1); + row_start = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, i, 0); + row_end = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, i, 1); for (i = row_start + lane; i < row_end; i += HYPRE_WARP_SIZE) { @@ -97,7 +98,7 @@ hypreCUDAKernel_IndepSetMain(HYPRE_Int graph_diag_size, } } - marker_row = warp_reduce_min(marker_row); + marker_row = warp_reduce_min(item, marker_row); if (lane == 0 && marker_row == 0) { @@ -106,13 +107,14 @@ hypreCUDAKernel_IndepSetMain(HYPRE_Int graph_diag_size, } __global__ void -hypreCUDAKernel_IndepSetFixMarker(HYPRE_Int *IS_marker_diag, - HYPRE_Int num_elmts_send, - HYPRE_Int *send_map_elmts, - HYPRE_Int *int_send_buf, - HYPRE_Int IS_offd_temp_mark) +hypreGPUKernel_IndepSetFixMarker(hypre_DeviceItem &item, + HYPRE_Int *IS_marker_diag, + HYPRE_Int num_elmts_send, + HYPRE_Int *send_map_elmts, + HYPRE_Int *int_send_buf, + HYPRE_Int IS_offd_temp_mark) { - HYPRE_Int thread_id = hypre_cuda_get_grid_thread_id<1,1>(); + HYPRE_Int thread_id = hypre_gpu_get_grid_thread_id<1, 1>(item); if (thread_id >= num_elmts_send) { @@ -156,39 +158,44 @@ hypre_BoomerAMGIndepSetDevice( hypre_ParCSRMatrix *S, HYPRE_Int num_elmts_send = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends); HYPRE_Int *send_map_elmts = hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg); - dim3 bDim, gDim; hypre_ParCSRCommHandle *comm_handle; /*------------------------------------------------------------------ * Initialize IS_marker by putting all nodes in the IS (marked by 1) *------------------------------------------------------------------*/ - hypreDevice_ScatterConstant(IS_marker_diag, graph_diag_size, graph_diag, 1); + hypreDevice_ScatterConstant(IS_marker_diag, graph_diag_size, graph_diag, (HYPRE_Int) 1); /*------------------------------------------------------- * Remove nodes from the initial independent set *-------------------------------------------------------*/ - bDim = hypre_GetDefaultCUDABlockDimension(); - gDim = hypre_GetDefaultCUDAGridDimension(graph_diag_size, "warp", bDim); + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(graph_diag_size, "warp", bDim); - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_IndepSetMain, gDim, bDim, - graph_diag_size, graph_diag, measure_diag, measure_offd, - S_diag_i, S_diag_j, S_offd_i, S_offd_j, - IS_marker_diag, IS_marker_offd, IS_offd_temp_mark ); + HYPRE_GPU_LAUNCH( hypreGPUKernel_IndepSetMain, gDim, bDim, + graph_diag_size, graph_diag, measure_diag, measure_offd, + S_diag_i, S_diag_j, S_offd_i, S_offd_j, + IS_marker_diag, IS_marker_offd, IS_offd_temp_mark ); /*-------------------------------------------------------------------- * Exchange boundary data for IS_marker: send external IS to internal *-------------------------------------------------------------------*/ + /* RL: make sure IS_marker_offd is ready before issuing GPU-GPU MPI */ + if (hypre_GetGpuAwareMPI()) + { + hypre_ForceSyncComputeStream(); + } + comm_handle = hypre_ParCSRCommHandleCreate_v2(12, comm_pkg, HYPRE_MEMORY_DEVICE, IS_marker_offd, HYPRE_MEMORY_DEVICE, int_send_buf); hypre_ParCSRCommHandleDestroy(comm_handle); /* adjust IS_marker_diag from the received */ - gDim = hypre_GetDefaultCUDAGridDimension(num_elmts_send, "thread", bDim); + gDim = hypre_GetDefaultDeviceGridDimension(num_elmts_send, "thread", bDim); - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_IndepSetFixMarker, gDim, bDim, - IS_marker_diag, num_elmts_send, send_map_elmts, - int_send_buf, IS_offd_temp_mark ); + HYPRE_GPU_LAUNCH( hypreGPUKernel_IndepSetFixMarker, gDim, bDim, + IS_marker_diag, num_elmts_send, send_map_elmts, + int_send_buf, IS_offd_temp_mark ); /* Note that IS_marker_offd is not sync'ed (communicated) here */ @@ -196,8 +203,8 @@ hypre_BoomerAMGIndepSetDevice( hypre_ParCSRMatrix *S, } /* Augments measures by some random value between 0 and 1 - * aug_rand: 1: GPU CURAND/ROCRAND; 11: GPU SEQ CURAND/ROCRAND - * 2: CPU RAND; 12: CPU SEQ RAND + * aug_rand: 1: GPU RAND; 11: GPU SEQ RAND + * 2: CPU RAND; 12: CPU SEQ RAND */ HYPRE_Int hypre_BoomerAMGIndepSetInitDevice( hypre_ParCSRMatrix *S, @@ -229,7 +236,8 @@ hypre_BoomerAMGIndepSetInitDevice( hypre_ParCSRMatrix *S, HYPRE_Real *urand_global = hypre_TAlloc(HYPRE_Real, n_global, HYPRE_MEMORY_DEVICE); // To make sure all rank generate the same sequence hypre_CurandUniform(n_global, urand_global, 0, 0, 1, 0); - hypre_TMemcpy(urand, urand_global + n_first, HYPRE_Real, num_rows_diag, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(urand, urand_global + n_first, HYPRE_Real, num_rows_diag, HYPRE_MEMORY_DEVICE, + HYPRE_MEMORY_DEVICE); hypre_TFree(urand_global, HYPRE_MEMORY_DEVICE); } else @@ -238,13 +246,11 @@ hypre_BoomerAMGIndepSetInitDevice( hypre_ParCSRMatrix *S, hypre_CurandUniform(num_rows_diag, urand, 0, 0, 0, 0); } - thrust::plus op; - HYPRE_THRUST_CALL(transform, measure_array, measure_array + num_rows_diag, - urand, measure_array, op); + hypreDevice_ComplexAxpyn(measure_array, num_rows_diag, urand, measure_array, 1.0); hypre_TFree(urand, HYPRE_MEMORY_DEVICE); return hypre_error_flag; } -#endif // #if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#endif // #if defined(HYPRE_USING_GPU) diff --git a/external/hypre/src/parcsr_ls/par_interp.c b/external/hypre/src/parcsr_ls/par_interp.c index 5dc827ac..09e2fc59 100644 --- a/external/hypre/src/parcsr_ls/par_interp.c +++ b/external/hypre/src/parcsr_ls/par_interp.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -12,21 +12,23 @@ *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_BoomerAMGBuildInterp( hypre_ParCSRMatrix *A, - HYPRE_Int *CF_marker, - hypre_ParCSRMatrix *S, - HYPRE_BigInt *num_cpts_global, - HYPRE_Int num_functions, - HYPRE_Int *dof_func, - HYPRE_Int debug_flag, - HYPRE_Real trunc_factor, - HYPRE_Int max_elmts, - hypre_ParCSRMatrix **P_ptr) +hypre_BoomerAMGBuildInterp( hypre_ParCSRMatrix *A, + HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, + HYPRE_BigInt *num_cpts_global, + HYPRE_Int num_functions, + HYPRE_Int *dof_func, + HYPRE_Int debug_flag, + HYPRE_Real trunc_factor, + HYPRE_Int max_elmts, + hypre_ParCSRMatrix **P_ptr) { - MPI_Comm comm = hypre_ParCSRMatrixComm(A); + MPI_Comm comm = hypre_ParCSRMatrixComm(A); hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); hypre_ParCSRCommHandle *comm_handle; + HYPRE_MemoryLocation memory_location_P = hypre_ParCSRMatrixMemoryLocation(A); + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); HYPRE_Real *A_diag_data = hypre_CSRMatrixData(A_diag); HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); @@ -54,7 +56,7 @@ hypre_BoomerAMGBuildInterp( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker_offd = NULL; HYPRE_Int *dof_func_offd = NULL; - hypre_CSRMatrix *A_ext; + hypre_CSRMatrix *A_ext = NULL; HYPRE_Real *A_ext_data = NULL; HYPRE_Int *A_ext_i = NULL; @@ -74,10 +76,10 @@ hypre_BoomerAMGBuildInterp( hypre_ParCSRMatrix *A, HYPRE_Int *P_marker, *P_marker_offd; - HYPRE_Int jj_counter,jj_counter_offd; + HYPRE_Int jj_counter, jj_counter_offd; HYPRE_Int *jj_count, *jj_count_offd; - HYPRE_Int jj_begin_row,jj_begin_row_offd; - HYPRE_Int jj_end_row,jj_end_row_offd; + HYPRE_Int jj_begin_row, jj_begin_row_offd; + HYPRE_Int jj_end_row, jj_end_row_offd; HYPRE_Int start_indexing = 0; /* start indexing for P_data at 0 */ @@ -93,8 +95,8 @@ hypre_BoomerAMGBuildInterp( hypre_ParCSRMatrix *A, //HYPRE_BigInt my_first_cpt; HYPRE_Int num_cols_P_offd; - HYPRE_Int i,i1,i2; - HYPRE_Int j,jl,jj,jj1; + HYPRE_Int i, i1, i2; + HYPRE_Int j, jl, jj, jj1; HYPRE_Int kc; HYPRE_BigInt big_k; HYPRE_Int start; @@ -121,15 +123,15 @@ hypre_BoomerAMGBuildInterp( hypre_ParCSRMatrix *A, HYPRE_Int local_numrows = hypre_CSRMatrixNumRows(A_diag); HYPRE_BigInt col_n = col_1 + (HYPRE_BigInt)local_numrows; - HYPRE_Real wall_time; /* for debugging instrumentation */ + HYPRE_Real wall_time = 0.0; /* for debugging instrumentation */ hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_rank(comm, &my_id); num_threads = hypre_NumThreads(); //my_first_cpt = num_cpts_global[0]; - if (my_id == (num_procs -1)) total_global_cpts = num_cpts_global[1]; - hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); + if (my_id == (num_procs - 1)) { total_global_cpts = num_cpts_global[1]; } + hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); /*------------------------------------------------------------------- * Get the CF_marker data for the off-processor columns @@ -141,9 +143,9 @@ hypre_BoomerAMGBuildInterp( hypre_ParCSRMatrix *A, print_level = 1; } - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } - if (num_cols_A_offd) CF_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); + if (num_cols_A_offd) { CF_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); } if (num_functions > 1 && num_cols_A_offd) { dof_func_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); @@ -163,9 +165,9 @@ hypre_BoomerAMGBuildInterp( hypre_ParCSRMatrix *A, for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { - int_buf_data[index++] = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + int_buf_data[index++] = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } } @@ -178,8 +180,10 @@ hypre_BoomerAMGBuildInterp( hypre_ParCSRMatrix *A, for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j=start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) - int_buf_data[index++] = dof_func[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) + { + int_buf_data[index++] = dof_func[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; + } } comm_handle = hypre_ParCSRCommHandleCreate( 11, comm_pkg, int_buf_data, dof_func_offd); @@ -187,11 +191,11 @@ hypre_BoomerAMGBuildInterp( hypre_ParCSRMatrix *A, hypre_ParCSRCommHandleDestroy(comm_handle); } - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Interp: Comm 1 CF_marker = %f\n", - my_id, wall_time); + my_id, wall_time); fflush(NULL); } @@ -199,20 +203,20 @@ hypre_BoomerAMGBuildInterp( hypre_ParCSRMatrix *A, * Get the ghost rows of A *---------------------------------------------------------------------*/ - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } if (num_procs > 1) { - A_ext = hypre_ParCSRMatrixExtractBExt(A,A,1); + A_ext = hypre_ParCSRMatrixExtractBExt(A, A, 1); A_ext_i = hypre_CSRMatrixI(A_ext); A_ext_j = hypre_CSRMatrixBigJ(A_ext); A_ext_data = hypre_CSRMatrixData(A_ext); } index = 0; - for (i=0; i < num_cols_A_offd; i++) + for (i = 0; i < num_cols_A_offd; i++) { - for (j=A_ext_i[i]; j < A_ext_i[i+1]; j++) + for (j = A_ext_i[i]; j < A_ext_i[i + 1]; j++) { big_k = A_ext_j[j]; if (big_k >= col_1 && big_k < col_n) @@ -222,10 +226,10 @@ hypre_BoomerAMGBuildInterp( hypre_ParCSRMatrix *A, } else { - kc = hypre_BigBinarySearch(col_map_offd,big_k,num_cols_A_offd); + kc = hypre_BigBinarySearch(col_map_offd, big_k, num_cols_A_offd); if (kc > -1) { - A_ext_j[index] = (HYPRE_BigInt)(-kc-1); + A_ext_j[index] = (HYPRE_BigInt)(-kc - 1); A_ext_data[index++] = A_ext_data[j]; } } @@ -233,14 +237,16 @@ hypre_BoomerAMGBuildInterp( hypre_ParCSRMatrix *A, A_ext_i[i] = index; } for (i = num_cols_A_offd; i > 0; i--) - A_ext_i[i] = A_ext_i[i-1]; - if (num_procs > 1) A_ext_i[0] = 0; + { + A_ext_i[i] = A_ext_i[i - 1]; + } + if (num_procs > 1) { A_ext_i[0] = 0; } - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Interp: Comm 2 Get A_ext = %f\n", - my_id, wall_time); + my_id, wall_time); fflush(NULL); } @@ -259,9 +265,9 @@ hypre_BoomerAMGBuildInterp( hypre_ParCSRMatrix *A, fine_to_coarse = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i = 0; i < n_fine; i++) fine_to_coarse[i] = -1; + for (i = 0; i < n_fine; i++) { fine_to_coarse[i] = -1; } jj_counter = start_indexing; jj_counter_offd = start_indexing; @@ -272,21 +278,21 @@ hypre_BoomerAMGBuildInterp( hypre_ParCSRMatrix *A, /* RDF: this looks a little tricky, but doable */ #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,j,i1,jj,ns,ne,size,rest) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,j,i1,jj,ns,ne,size,rest) HYPRE_SMP_SCHEDULE #endif for (j = 0; j < num_threads; j++) { - size = n_fine/num_threads; - rest = n_fine - size*num_threads; + size = n_fine / num_threads; + rest = n_fine - size * num_threads; if (j < rest) { - ns = j*size+j; - ne = (j+1)*size+j+1; + ns = j * size + j; + ne = (j + 1) * size + j + 1; } else { - ns = j*size+rest; - ne = (j+1)*size+rest; + ns = j * size + rest; + ne = (j + 1) * size + rest; } for (i = ns; i < ne; i++) { @@ -310,7 +316,7 @@ hypre_BoomerAMGBuildInterp( hypre_ParCSRMatrix *A, else { - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) { i1 = S_diag_j[jj]; if (CF_marker[i1] >= 0) @@ -321,7 +327,7 @@ hypre_BoomerAMGBuildInterp( hypre_ParCSRMatrix *A, if (num_procs > 1) { - for (jj = S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) { i1 = S_offd_j[jj]; if (CF_marker_offd[i1] >= 0) @@ -338,30 +344,30 @@ hypre_BoomerAMGBuildInterp( hypre_ParCSRMatrix *A, * Allocate arrays. *-----------------------------------------------------------------------*/ - for (i=0; i < num_threads-1; i++) + for (i = 0; i < num_threads - 1; i++) { - coarse_counter[i+1] += coarse_counter[i]; - jj_count[i+1] += jj_count[i]; - jj_count_offd[i+1] += jj_count_offd[i]; + coarse_counter[i + 1] += coarse_counter[i]; + jj_count[i + 1] += jj_count[i]; + jj_count_offd[i + 1] += jj_count_offd[i]; } - i = num_threads-1; + i = num_threads - 1; jj_counter = jj_count[i]; jj_counter_offd = jj_count_offd[i]; P_diag_size = jj_counter; - P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, HYPRE_MEMORY_DEVICE); - P_diag_j = hypre_CTAlloc(HYPRE_Int, P_diag_size, HYPRE_MEMORY_DEVICE); - P_diag_data = hypre_CTAlloc(HYPRE_Real, P_diag_size, HYPRE_MEMORY_DEVICE); + P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, memory_location_P); + P_diag_j = hypre_CTAlloc(HYPRE_Int, P_diag_size, memory_location_P); + P_diag_data = hypre_CTAlloc(HYPRE_Real, P_diag_size, memory_location_P); P_diag_i[n_fine] = jj_counter; P_offd_size = jj_counter_offd; - P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, HYPRE_MEMORY_DEVICE); - P_offd_j = hypre_CTAlloc(HYPRE_Int, P_offd_size, HYPRE_MEMORY_DEVICE); - P_offd_data = hypre_CTAlloc(HYPRE_Real, P_offd_size, HYPRE_MEMORY_DEVICE); + P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, memory_location_P); + P_offd_j = hypre_CTAlloc(HYPRE_Int, P_offd_size, memory_location_P); + P_offd_data = hypre_CTAlloc(HYPRE_Real, P_offd_size, memory_location_P); /*----------------------------------------------------------------------- * Intialize some stuff. @@ -370,11 +376,11 @@ hypre_BoomerAMGBuildInterp( hypre_ParCSRMatrix *A, jj_counter = start_indexing; jj_counter_offd = start_indexing; - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Interp: Internal work 1 = %f\n", - my_id, wall_time); + my_id, wall_time); fflush(NULL); } @@ -382,28 +388,28 @@ hypre_BoomerAMGBuildInterp( hypre_ParCSRMatrix *A, * Send and receive fine_to_coarse info. *-----------------------------------------------------------------------*/ - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } //fine_to_coarse_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,j,ns,ne,size,rest,coarse_shift) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,j,ns,ne,size,rest,coarse_shift) HYPRE_SMP_SCHEDULE #endif for (j = 0; j < num_threads; j++) { coarse_shift = 0; - if (j > 0) coarse_shift = coarse_counter[j-1]; - size = n_fine/num_threads; - rest = n_fine - size*num_threads; + if (j > 0) { coarse_shift = coarse_counter[j - 1]; } + size = n_fine / num_threads; + rest = n_fine - size * num_threads; if (j < rest) { - ns = j*size+j; - ne = (j+1)*size+j+1; + ns = j * size + j; + ne = (j + 1) * size + j + 1; } else { - ns = j*size+rest; - ne = (j+1)*size+rest; + ns = j * size + rest; + ne = (j + 1) * size + rest; } for (i = ns; i < ne; i++) { @@ -432,44 +438,48 @@ hypre_BoomerAMGBuildInterp( hypre_ParCSRMatrix *A, fflush(NULL); }*/ - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } /*#ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE -#endif -for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt; */ + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #endif + for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt; */ /*----------------------------------------------------------------------- * Loop over fine grid points. *-----------------------------------------------------------------------*/ #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,j,jl,i1,i2,jj,jj1,ns,ne,size,rest,sum,diagonal,distribute,P_marker,P_marker_offd,strong_f_marker,jj_counter,jj_counter_offd,sgn,c_num,jj_begin_row,jj_end_row,jj_begin_row_offd,jj_end_row_offd) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,j,jl,i1,i2,jj,jj1,ns,ne,size,rest,sum,diagonal,distribute,P_marker,P_marker_offd,strong_f_marker,jj_counter,jj_counter_offd,sgn,c_num,jj_begin_row,jj_end_row,jj_begin_row_offd,jj_end_row_offd) HYPRE_SMP_SCHEDULE #endif for (jl = 0; jl < num_threads; jl++) { - size = n_fine/num_threads; - rest = n_fine - size*num_threads; + size = n_fine / num_threads; + rest = n_fine - size * num_threads; if (jl < rest) { - ns = jl*size+jl; - ne = (jl+1)*size+jl+1; + ns = jl * size + jl; + ne = (jl + 1) * size + jl + 1; } else { - ns = jl*size+rest; - ne = (jl+1)*size+rest; + ns = jl * size + rest; + ne = (jl + 1) * size + rest; } jj_counter = 0; - if (jl > 0) jj_counter = jj_count[jl-1]; + if (jl > 0) { jj_counter = jj_count[jl - 1]; } jj_counter_offd = 0; - if (jl > 0) jj_counter_offd = jj_count_offd[jl-1]; + if (jl > 0) { jj_counter_offd = jj_count_offd[jl - 1]; } P_marker = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); if (num_cols_A_offd) + { P_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); + } else + { P_marker_offd = NULL; + } for (i = 0; i < n_fine; i++) { @@ -506,7 +516,7 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt; */ P_diag_i[i] = jj_counter; jj_begin_row = jj_counter; - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) { i1 = S_diag_j[jj]; @@ -542,7 +552,7 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt; */ if (num_procs > 1) { - for (jj = S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) { i1 = S_offd_j[jj]; @@ -579,7 +589,7 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt; */ /* Loop over ith row of A. First, the diagonal part of A */ - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) { i1 = A_diag_j[jj]; @@ -608,13 +618,13 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt; */ * of the connections to c-points that strongly influence i. *-----------------------------------------------------------*/ sgn = 1; - if (A_diag_data[A_diag_i[i1]] < 0) sgn = -1; + if (A_diag_data[A_diag_i[i1]] < 0) { sgn = -1; } /* Diagonal block part of row i1 */ - for (jj1 = A_diag_i[i1]; jj1 < A_diag_i[i1+1]; jj1++) + for (jj1 = A_diag_i[i1]; jj1 < A_diag_i[i1 + 1]; jj1++) { i2 = A_diag_j[jj1]; if (P_marker[i2] >= jj_begin_row && - (sgn*A_diag_data[jj1]) < 0) + (sgn * A_diag_data[jj1]) < 0) { sum += A_diag_data[jj1]; } @@ -623,11 +633,11 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt; */ /* Off-Diagonal block part of row i1 */ if (num_procs > 1) { - for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1+1]; jj1++) + for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1 + 1]; jj1++) { i2 = A_offd_j[jj1]; if (P_marker_offd[i2] >= jj_begin_row_offd - && (sgn*A_offd_data[jj1]) < 0) + && (sgn * A_offd_data[jj1]) < 0) { sum += A_offd_data[jj1]; } @@ -643,28 +653,28 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt; */ *-----------------------------------------------------------*/ /* Diagonal block part of row i1 */ - for (jj1 = A_diag_i[i1]; jj1 < A_diag_i[i1+1]; jj1++) + for (jj1 = A_diag_i[i1]; jj1 < A_diag_i[i1 + 1]; jj1++) { i2 = A_diag_j[jj1]; if (P_marker[i2] >= jj_begin_row - && (sgn*A_diag_data[jj1]) < 0) + && (sgn * A_diag_data[jj1]) < 0) { P_diag_data[P_marker[i2]] - += distribute * A_diag_data[jj1]; + += distribute * A_diag_data[jj1]; } } /* Off-Diagonal block part of row i1 */ if (num_procs > 1) { - for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1+1]; jj1++) + for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1 + 1]; jj1++) { i2 = A_offd_j[jj1]; if (P_marker_offd[i2] >= jj_begin_row_offd - && (sgn*A_offd_data[jj1]) < 0) + && (sgn * A_offd_data[jj1]) < 0) { P_offd_data[P_marker_offd[i2]] - += distribute * A_offd_data[jj1]; + += distribute * A_offd_data[jj1]; } } } @@ -701,7 +711,7 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt; */ if (num_procs > 1) { - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { i1 = A_offd_j[jj]; @@ -734,8 +744,8 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt; */ c_num = A_offd_j[jj]; sgn = 1; - if (A_ext_data[A_ext_i[c_num]] < 0) sgn = -1; - for (jj1 = A_ext_i[c_num]; jj1 < A_ext_i[c_num+1]; jj1++) + if (A_ext_data[A_ext_i[c_num]] < 0) { sgn = -1; } + for (jj1 = A_ext_i[c_num]; jj1 < A_ext_i[c_num + 1]; jj1++) { i2 = (HYPRE_Int)A_ext_j[jj1]; @@ -743,7 +753,7 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt; */ { /* in the diagonal block */ if (P_marker[i2] >= jj_begin_row - && (sgn*A_ext_data[jj1]) < 0) + && (sgn * A_ext_data[jj1]) < 0) { sum += A_ext_data[jj1]; } @@ -751,8 +761,8 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt; */ else { /* in the off_diagonal block */ - if (P_marker_offd[-i2-1] >= jj_begin_row_offd - && (sgn*A_ext_data[jj1]) < 0) + if (P_marker_offd[-i2 - 1] >= jj_begin_row_offd + && (sgn * A_ext_data[jj1]) < 0) { sum += A_ext_data[jj1]; } @@ -771,26 +781,26 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt; */ /* Diagonal block part of row i1 */ - for (jj1 = A_ext_i[c_num]; jj1 < A_ext_i[c_num+1]; jj1++) + for (jj1 = A_ext_i[c_num]; jj1 < A_ext_i[c_num + 1]; jj1++) { i2 = (HYPRE_Int)A_ext_j[jj1]; if (i2 > -1) /* in the diagonal block */ { if (P_marker[i2] >= jj_begin_row - && (sgn*A_ext_data[jj1]) < 0) + && (sgn * A_ext_data[jj1]) < 0) { P_diag_data[P_marker[i2]] - += distribute * A_ext_data[jj1]; + += distribute * A_ext_data[jj1]; } } else { /* in the off_diagonal block */ - if (P_marker_offd[-i2-1] >= jj_begin_row_offd - && (sgn*A_ext_data[jj1]) < 0) - P_offd_data[P_marker_offd[-i2-1]] - += distribute * A_ext_data[jj1]; + if (P_marker_offd[-i2 - 1] >= jj_begin_row_offd + && (sgn * A_ext_data[jj1]) < 0) + P_offd_data[P_marker_offd[-i2 - 1]] + += distribute * A_ext_data[jj1]; } } } @@ -827,7 +837,7 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt; */ { if (print_level) { - hypre_printf(" Warning! zero diagonal! Proc id %d row %d\n", my_id,i); + hypre_printf(" Warning! zero diagonal! Proc id %d row %d\n", my_id, i); } for (jj = jj_begin_row; jj < jj_end_row; jj++) { @@ -854,20 +864,20 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt; */ strong_f_marker--; - P_offd_i[i+1] = jj_counter_offd; + P_offd_i[i + 1] = jj_counter_offd; } hypre_TFree(P_marker, HYPRE_MEMORY_HOST); hypre_TFree(P_marker_offd, HYPRE_MEMORY_HOST); } P = hypre_ParCSRMatrixCreate(comm, - hypre_ParCSRMatrixGlobalNumRows(A), - total_global_cpts, - hypre_ParCSRMatrixColStarts(A), - num_cpts_global, - 0, - P_diag_i[n_fine], - P_offd_i[n_fine]); + hypre_ParCSRMatrixGlobalNumRows(A), + total_global_cpts, + hypre_ParCSRMatrixColStarts(A), + num_cpts_global, + 0, + P_diag_i[n_fine], + P_offd_i[n_fine]); P_diag = hypre_ParCSRMatrixDiag(P); hypre_CSRMatrixData(P_diag) = P_diag_data; @@ -899,15 +909,15 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt; */ P_marker = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i=0; i < num_cols_A_offd; i++) + for (i = 0; i < num_cols_A_offd; i++) { P_marker[i] = 0; } num_cols_P_offd = 0; - for (i=0; i < P_offd_size; i++) + for (i = 0; i < P_offd_size; i++) { index = P_offd_j[i]; if (!P_marker[index]) @@ -921,25 +931,25 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt; */ tmp_map_offd = hypre_CTAlloc(HYPRE_Int, num_cols_P_offd, HYPRE_MEMORY_HOST); index = 0; - for (i=0; i < num_cols_P_offd; i++) + for (i = 0; i < num_cols_P_offd; i++) { - while (P_marker[index]==0) index++; + while (P_marker[index] == 0) { index++; } tmp_map_offd[i] = index++; } #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i=0; i < P_offd_size; i++) + for (i = 0; i < P_offd_size; i++) P_offd_j[i] = hypre_BinarySearch(tmp_map_offd, - P_offd_j[i], - num_cols_P_offd); + P_offd_j[i], + num_cols_P_offd); hypre_TFree(P_marker, HYPRE_MEMORY_HOST); } - for (i=0; i < n_fine; i++) + for (i = 0; i < n_fine; i++) { - if (CF_marker[i] == -3) CF_marker[i] = -1; + if (CF_marker[i] == -3) { CF_marker[i] = -1; } } if (num_cols_P_offd) @@ -948,8 +958,7 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt; */ hypre_CSRMatrixNumCols(P_offd) = num_cols_P_offd; } - hypre_GetCommPkgRTFromCommPkgA(P,A, fine_to_coarse, tmp_map_offd); - + hypre_GetCommPkgRTFromCommPkgA(P, A, fine_to_coarse, tmp_map_offd); *P_ptr = P; @@ -962,13 +971,11 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt; */ hypre_TFree(coarse_counter, HYPRE_MEMORY_HOST); hypre_TFree(jj_count, HYPRE_MEMORY_HOST); hypre_TFree(jj_count_offd, HYPRE_MEMORY_HOST); - - if (num_procs > 1) hypre_CSRMatrixDestroy(A_ext); + hypre_CSRMatrixDestroy(A_ext); return hypre_error_flag; } - /*--------------------------------------------------------------------------- * hypre_BoomerAMGBuildInterpHE * interpolation routine for hyperbolic PDEs @@ -1019,7 +1026,7 @@ hypre_BoomerAMGBuildInterpHE( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker_offd = NULL; HYPRE_Int *dof_func_offd = NULL; - hypre_CSRMatrix *A_ext; + hypre_CSRMatrix *A_ext = NULL; HYPRE_Real *A_ext_data = NULL; HYPRE_Int *A_ext_i = NULL; @@ -1039,10 +1046,10 @@ hypre_BoomerAMGBuildInterpHE( hypre_ParCSRMatrix *A, HYPRE_Int *P_marker, *P_marker_offd; - HYPRE_Int jj_counter,jj_counter_offd; + HYPRE_Int jj_counter, jj_counter_offd; HYPRE_Int *jj_count, *jj_count_offd; - HYPRE_Int jj_begin_row,jj_begin_row_offd; - HYPRE_Int jj_end_row,jj_end_row_offd; + HYPRE_Int jj_begin_row, jj_begin_row_offd; + HYPRE_Int jj_end_row, jj_end_row_offd; HYPRE_Int start_indexing = 0; /* start indexing for P_data at 0 */ @@ -1056,8 +1063,8 @@ hypre_BoomerAMGBuildInterpHE( hypre_ParCSRMatrix *A, //HYPRE_BigInt my_first_cpt; HYPRE_Int num_cols_P_offd; - HYPRE_Int i,i1,i2; - HYPRE_Int j,jl,jj,jj1; + HYPRE_Int i, i1, i2; + HYPRE_Int j, jl, jj, jj1; HYPRE_Int kc; HYPRE_BigInt big_k; HYPRE_Int start; @@ -1083,26 +1090,28 @@ hypre_BoomerAMGBuildInterpHE( hypre_ParCSRMatrix *A, HYPRE_Int local_numrows = hypre_CSRMatrixNumRows(A_diag); HYPRE_BigInt col_n = col_1 + local_numrows; - HYPRE_Real wall_time; /* for debugging instrumentation */ + HYPRE_Real wall_time = 0.0; /* for debugging instrumentation */ hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_rank(comm, &my_id); num_threads = hypre_NumThreads(); //my_first_cpt = num_cpts_global[0]; - if (my_id == (num_procs -1)) total_global_cpts = num_cpts_global[1]; - hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); + if (my_id == (num_procs - 1)) { total_global_cpts = num_cpts_global[1]; } + hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); /*------------------------------------------------------------------- * Get the CF_marker data for the off-processor columns *-------------------------------------------------------------------*/ - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } - if (num_cols_A_offd) CF_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); + if (num_cols_A_offd) { CF_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); } if (num_functions > 1 && num_cols_A_offd) + { dof_func_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); + } if (!comm_pkg) { @@ -1118,9 +1127,9 @@ hypre_BoomerAMGBuildInterpHE( hypre_ParCSRMatrix *A, for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) int_buf_data[index++] - = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } comm_handle = hypre_ParCSRCommHandleCreate( 11, comm_pkg, int_buf_data, CF_marker_offd); @@ -1132,9 +1141,9 @@ hypre_BoomerAMGBuildInterpHE( hypre_ParCSRMatrix *A, for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j=start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) int_buf_data[index++] - = dof_func[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + = dof_func[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } comm_handle = hypre_ParCSRCommHandleCreate( 11, comm_pkg, int_buf_data, dof_func_offd); @@ -1142,11 +1151,11 @@ hypre_BoomerAMGBuildInterpHE( hypre_ParCSRMatrix *A, hypre_ParCSRCommHandleDestroy(comm_handle); } - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Interp: Comm 1 CF_marker = %f\n", - my_id, wall_time); + my_id, wall_time); fflush(NULL); } @@ -1154,20 +1163,20 @@ hypre_BoomerAMGBuildInterpHE( hypre_ParCSRMatrix *A, * Get the ghost rows of A *---------------------------------------------------------------------*/ - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } if (num_procs > 1) { - A_ext = hypre_ParCSRMatrixExtractBExt(A,A,1); + A_ext = hypre_ParCSRMatrixExtractBExt(A, A, 1); A_ext_i = hypre_CSRMatrixI(A_ext); A_ext_j = hypre_CSRMatrixBigJ(A_ext); A_ext_data = hypre_CSRMatrixData(A_ext); } index = 0; - for (i=0; i < num_cols_A_offd; i++) + for (i = 0; i < num_cols_A_offd; i++) { - for (j=A_ext_i[i]; j < A_ext_i[i+1]; j++) + for (j = A_ext_i[i]; j < A_ext_i[i + 1]; j++) { big_k = A_ext_j[j]; if (big_k >= col_1 && big_k < col_n) @@ -1177,10 +1186,10 @@ hypre_BoomerAMGBuildInterpHE( hypre_ParCSRMatrix *A, } else { - kc = hypre_BigBinarySearch(col_map_offd,big_k,num_cols_A_offd); + kc = hypre_BigBinarySearch(col_map_offd, big_k, num_cols_A_offd); if (kc > -1) { - A_ext_j[index] = (HYPRE_BigInt)(-kc-1); + A_ext_j[index] = (HYPRE_BigInt)(-kc - 1); A_ext_data[index++] = A_ext_data[j]; } } @@ -1188,14 +1197,16 @@ hypre_BoomerAMGBuildInterpHE( hypre_ParCSRMatrix *A, A_ext_i[i] = index; } for (i = num_cols_A_offd; i > 0; i--) - A_ext_i[i] = A_ext_i[i-1]; - if (num_procs > 1) A_ext_i[0] = 0; + { + A_ext_i[i] = A_ext_i[i - 1]; + } + if (num_procs > 1) { A_ext_i[0] = 0; } - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Interp: Comm 2 Get A_ext = %f\n", - my_id, wall_time); + my_id, wall_time); fflush(NULL); } @@ -1213,9 +1224,9 @@ hypre_BoomerAMGBuildInterpHE( hypre_ParCSRMatrix *A, fine_to_coarse = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i = 0; i < n_fine; i++) fine_to_coarse[i] = -1; + for (i = 0; i < n_fine; i++) { fine_to_coarse[i] = -1; } jj_counter = start_indexing; jj_counter_offd = start_indexing; @@ -1226,21 +1237,21 @@ hypre_BoomerAMGBuildInterpHE( hypre_ParCSRMatrix *A, /* RDF: this looks a little tricky, but doable */ #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,j,i1,jj,ns,ne,size,rest) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,j,i1,jj,ns,ne,size,rest) HYPRE_SMP_SCHEDULE #endif for (j = 0; j < num_threads; j++) { - size = n_fine/num_threads; - rest = n_fine - size*num_threads; + size = n_fine / num_threads; + rest = n_fine - size * num_threads; if (j < rest) { - ns = j*size+j; - ne = (j+1)*size+j+1; + ns = j * size + j; + ne = (j + 1) * size + j + 1; } else { - ns = j*size+rest; - ne = (j+1)*size+rest; + ns = j * size + rest; + ne = (j + 1) * size + rest; } for (i = ns; i < ne; i++) { @@ -1264,7 +1275,7 @@ hypre_BoomerAMGBuildInterpHE( hypre_ParCSRMatrix *A, else { - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) { i1 = S_diag_j[jj]; if (CF_marker[i1] >= 0) @@ -1275,7 +1286,7 @@ hypre_BoomerAMGBuildInterpHE( hypre_ParCSRMatrix *A, if (num_procs > 1) { - for (jj = S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) { i1 = S_offd_j[jj]; if (CF_marker_offd[i1] >= 0) @@ -1292,19 +1303,19 @@ hypre_BoomerAMGBuildInterpHE( hypre_ParCSRMatrix *A, * Allocate arrays. *-----------------------------------------------------------------------*/ - for (i=0; i < num_threads-1; i++) + for (i = 0; i < num_threads - 1; i++) { - coarse_counter[i+1] += coarse_counter[i]; - jj_count[i+1] += jj_count[i]; - jj_count_offd[i+1] += jj_count_offd[i]; + coarse_counter[i + 1] += coarse_counter[i]; + jj_count[i + 1] += jj_count[i]; + jj_count_offd[i + 1] += jj_count_offd[i]; } - i = num_threads-1; + i = num_threads - 1; jj_counter = jj_count[i]; jj_counter_offd = jj_count_offd[i]; P_diag_size = jj_counter; - P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, HYPRE_MEMORY_HOST); + P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, HYPRE_MEMORY_HOST); P_diag_j = hypre_CTAlloc(HYPRE_Int, P_diag_size, HYPRE_MEMORY_HOST); P_diag_data = hypre_CTAlloc(HYPRE_Real, P_diag_size, HYPRE_MEMORY_HOST); @@ -1313,7 +1324,7 @@ hypre_BoomerAMGBuildInterpHE( hypre_ParCSRMatrix *A, P_offd_size = jj_counter_offd; - P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, HYPRE_MEMORY_HOST); + P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, HYPRE_MEMORY_HOST); P_offd_j = hypre_CTAlloc(HYPRE_Int, P_offd_size, HYPRE_MEMORY_HOST); P_offd_data = hypre_CTAlloc(HYPRE_Real, P_offd_size, HYPRE_MEMORY_HOST); @@ -1324,11 +1335,11 @@ hypre_BoomerAMGBuildInterpHE( hypre_ParCSRMatrix *A, jj_counter = start_indexing; jj_counter_offd = start_indexing; - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Interp: Internal work 1 = %f\n", - my_id, wall_time); + my_id, wall_time); fflush(NULL); } @@ -1336,31 +1347,33 @@ hypre_BoomerAMGBuildInterpHE( hypre_ParCSRMatrix *A, * Send and receive fine_to_coarse info. *-----------------------------------------------------------------------*/ - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } //fine_to_coarse_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,j,ns,ne,size,rest,coarse_shift) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,j,ns,ne,size,rest,coarse_shift) HYPRE_SMP_SCHEDULE #endif for (j = 0; j < num_threads; j++) { coarse_shift = 0; - if (j > 0) coarse_shift = coarse_counter[j-1]; - size = n_fine/num_threads; - rest = n_fine - size*num_threads; + if (j > 0) { coarse_shift = coarse_counter[j - 1]; } + size = n_fine / num_threads; + rest = n_fine - size * num_threads; if (j < rest) { - ns = j*size+j; - ne = (j+1)*size+j+1; + ns = j * size + j; + ne = (j + 1) * size + j + 1; } else { - ns = j*size+rest; - ne = (j+1)*size+rest; + ns = j * size + rest; + ne = (j + 1) * size + rest; } for (i = ns; i < ne; i++) + { fine_to_coarse[i] += coarse_shift; + } } /*index = 0; for (i = 0; i < num_sends; i++) @@ -1384,44 +1397,48 @@ hypre_BoomerAMGBuildInterpHE( hypre_ParCSRMatrix *A, fflush(NULL); }*/ - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } /*#ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE -#endif -for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #endif + for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ /*----------------------------------------------------------------------- * Loop over fine grid points. *-----------------------------------------------------------------------*/ #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,j,jl,i1,i2,jj,jj1,ns,ne,size,rest,sum,diagonal,distribute,P_marker,P_marker_offd,jj_counter,jj_counter_offd,sgn,c_num,jj_begin_row,jj_end_row,jj_begin_row_offd,jj_end_row_offd) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,j,jl,i1,i2,jj,jj1,ns,ne,size,rest,sum,diagonal,distribute,P_marker,P_marker_offd,jj_counter,jj_counter_offd,sgn,c_num,jj_begin_row,jj_end_row,jj_begin_row_offd,jj_end_row_offd) HYPRE_SMP_SCHEDULE #endif for (jl = 0; jl < num_threads; jl++) { - size = n_fine/num_threads; - rest = n_fine - size*num_threads; + size = n_fine / num_threads; + rest = n_fine - size * num_threads; if (jl < rest) { - ns = jl*size+jl; - ne = (jl+1)*size+jl+1; + ns = jl * size + jl; + ne = (jl + 1) * size + jl + 1; } else { - ns = jl*size+rest; - ne = (jl+1)*size+rest; + ns = jl * size + rest; + ne = (jl + 1) * size + rest; } jj_counter = 0; - if (jl > 0) jj_counter = jj_count[jl-1]; + if (jl > 0) { jj_counter = jj_count[jl - 1]; } jj_counter_offd = 0; - if (jl > 0) jj_counter_offd = jj_count_offd[jl-1]; + if (jl > 0) { jj_counter_offd = jj_count_offd[jl - 1]; } P_marker = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); if (num_cols_A_offd) + { P_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); + } else + { P_marker_offd = NULL; + } for (i = 0; i < n_fine; i++) { @@ -1457,7 +1474,7 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ P_diag_i[i] = jj_counter; jj_begin_row = jj_counter; - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) { i1 = S_diag_j[jj]; @@ -1484,7 +1501,7 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ if (num_procs > 1) { - for (jj = S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) { i1 = S_offd_j[jj]; @@ -1510,7 +1527,7 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ /* Loop over ith row of A. First, the diagonal part of A */ - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) { i1 = A_diag_j[jj]; @@ -1539,13 +1556,13 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ * of the connections to c-points that strongly influence i. *-----------------------------------------------------------*/ sgn = 1; - if (A_diag_data[A_diag_i[i1]] < 0) sgn = -1; + if (A_diag_data[A_diag_i[i1]] < 0) { sgn = -1; } /* Diagonal block part of row i1 */ - for (jj1 = A_diag_i[i1]; jj1 < A_diag_i[i1+1]; jj1++) + for (jj1 = A_diag_i[i1]; jj1 < A_diag_i[i1 + 1]; jj1++) { i2 = A_diag_j[jj1]; if (P_marker[i2] >= jj_begin_row && - (sgn*A_diag_data[jj1]) < 0) + (sgn * A_diag_data[jj1]) < 0) { sum += A_diag_data[jj1]; } @@ -1554,11 +1571,11 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ /* Off-Diagonal block part of row i1 */ if (num_procs > 1) { - for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1+1]; jj1++) + for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1 + 1]; jj1++) { i2 = A_offd_j[jj1]; if (P_marker_offd[i2] >= jj_begin_row_offd - && (sgn*A_offd_data[jj1]) < 0) + && (sgn * A_offd_data[jj1]) < 0) { sum += A_offd_data[jj1]; } @@ -1574,28 +1591,28 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ *-----------------------------------------------------------*/ /* Diagonal block part of row i1 */ - for (jj1 = A_diag_i[i1]; jj1 < A_diag_i[i1+1]; jj1++) + for (jj1 = A_diag_i[i1]; jj1 < A_diag_i[i1 + 1]; jj1++) { i2 = A_diag_j[jj1]; if (P_marker[i2] >= jj_begin_row - && (sgn*A_diag_data[jj1]) < 0) + && (sgn * A_diag_data[jj1]) < 0) { P_diag_data[P_marker[i2]] - += distribute * A_diag_data[jj1]; + += distribute * A_diag_data[jj1]; } } /* Off-Diagonal block part of row i1 */ if (num_procs > 1) { - for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1+1]; jj1++) + for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1 + 1]; jj1++) { i2 = A_offd_j[jj1]; if (P_marker_offd[i2] >= jj_begin_row_offd - && (sgn*A_offd_data[jj1]) < 0) + && (sgn * A_offd_data[jj1]) < 0) { P_offd_data[P_marker_offd[i2]] - += distribute * A_offd_data[jj1]; + += distribute * A_offd_data[jj1]; } } } @@ -1603,7 +1620,9 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ else { if (num_functions == 1 || dof_func[i] == dof_func[i1]) + { diagonal += A_diag_data[jj]; + } } } @@ -1617,7 +1636,7 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ if (num_procs > 1) { - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { i1 = A_offd_j[jj]; @@ -1650,8 +1669,8 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ c_num = A_offd_j[jj]; sgn = 1; - if (A_ext_data[A_ext_i[c_num]] < 0) sgn = -1; - for (jj1 = A_ext_i[c_num]; jj1 < A_ext_i[c_num+1]; jj1++) + if (A_ext_data[A_ext_i[c_num]] < 0) { sgn = -1; } + for (jj1 = A_ext_i[c_num]; jj1 < A_ext_i[c_num + 1]; jj1++) { i2 = (HYPRE_Int)A_ext_j[jj1]; @@ -1659,7 +1678,7 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ { /* in the diagonal block */ if (P_marker[i2] >= jj_begin_row - && (sgn*A_ext_data[jj1]) < 0) + && (sgn * A_ext_data[jj1]) < 0) { sum += A_ext_data[jj1]; } @@ -1667,8 +1686,8 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ else { /* in the off_diagonal block */ - if (P_marker_offd[-i2-1] >= jj_begin_row_offd - && (sgn*A_ext_data[jj1]) < 0) + if (P_marker_offd[-i2 - 1] >= jj_begin_row_offd + && (sgn * A_ext_data[jj1]) < 0) { sum += A_ext_data[jj1]; } @@ -1686,33 +1705,35 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ *--------------------------------------------------------*/ /* Diagonal block part of row i1 */ - for (jj1 = A_ext_i[c_num]; jj1 < A_ext_i[c_num+1]; jj1++) + for (jj1 = A_ext_i[c_num]; jj1 < A_ext_i[c_num + 1]; jj1++) { i2 = (HYPRE_Int)A_ext_j[jj1]; if (i2 > -1) /* in the diagonal block */ { if (P_marker[i2] >= jj_begin_row - && (sgn*A_ext_data[jj1]) < 0) + && (sgn * A_ext_data[jj1]) < 0) { P_diag_data[P_marker[i2]] - += distribute * A_ext_data[jj1]; + += distribute * A_ext_data[jj1]; } } else { /* in the off_diagonal block */ - if (P_marker_offd[-i2-1] >= jj_begin_row_offd - && (sgn*A_ext_data[jj1]) < 0) - P_offd_data[P_marker_offd[-i2-1]] - += distribute * A_ext_data[jj1]; + if (P_marker_offd[-i2 - 1] >= jj_begin_row_offd + && (sgn * A_ext_data[jj1]) < 0) + P_offd_data[P_marker_offd[-i2 - 1]] + += distribute * A_ext_data[jj1]; } } } else { if (num_functions == 1 || dof_func[i] == dof_func_offd[i1]) + { diagonal += A_offd_data[jj]; + } } } } @@ -1733,20 +1754,20 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ } } - P_offd_i[i+1] = jj_counter_offd; + P_offd_i[i + 1] = jj_counter_offd; } hypre_TFree(P_marker, HYPRE_MEMORY_HOST); hypre_TFree(P_marker_offd, HYPRE_MEMORY_HOST); } P = hypre_ParCSRMatrixCreate(comm, - hypre_ParCSRMatrixGlobalNumRows(A), - total_global_cpts, - hypre_ParCSRMatrixColStarts(A), - num_cpts_global, - 0, - P_diag_i[n_fine], - P_offd_i[n_fine]); + hypre_ParCSRMatrixGlobalNumRows(A), + total_global_cpts, + hypre_ParCSRMatrixColStarts(A), + num_cpts_global, + 0, + P_diag_i[n_fine], + P_offd_i[n_fine]); P_diag = hypre_ParCSRMatrixDiag(P); @@ -1779,13 +1800,15 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ P_marker = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i=0; i < num_cols_A_offd; i++) + for (i = 0; i < num_cols_A_offd; i++) + { P_marker[i] = 0; + } num_cols_P_offd = 0; - for (i=0; i < P_offd_size; i++) + for (i = 0; i < P_offd_size; i++) { index = P_offd_j[i]; if (!P_marker[index]) @@ -1799,24 +1822,24 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ tmp_map_offd = hypre_CTAlloc(HYPRE_Int, num_cols_P_offd, HYPRE_MEMORY_HOST); index = 0; - for (i=0; i < num_cols_P_offd; i++) + for (i = 0; i < num_cols_P_offd; i++) { - while (P_marker[index]==0) index++; + while (P_marker[index] == 0) { index++; } tmp_map_offd[i] = index++; } #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i=0; i < P_offd_size; i++) + for (i = 0; i < P_offd_size; i++) P_offd_j[i] = hypre_BinarySearch(tmp_map_offd, - P_offd_j[i], - num_cols_P_offd); + P_offd_j[i], + num_cols_P_offd); hypre_TFree(P_marker, HYPRE_MEMORY_HOST); } - for (i=0; i < n_fine; i++) - if (CF_marker[i] == -3) CF_marker[i] = -1; + for (i = 0; i < n_fine; i++) + if (CF_marker[i] == -3) { CF_marker[i] = -1; } if (num_cols_P_offd) { @@ -1824,7 +1847,7 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ hypre_CSRMatrixNumCols(P_offd) = num_cols_P_offd; } - hypre_GetCommPkgRTFromCommPkgA(P,A,fine_to_coarse, tmp_map_offd); + hypre_GetCommPkgRTFromCommPkgA(P, A, fine_to_coarse, tmp_map_offd); *P_ptr = P; @@ -1836,11 +1859,7 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ hypre_TFree(coarse_counter, HYPRE_MEMORY_HOST); hypre_TFree(jj_count, HYPRE_MEMORY_HOST); hypre_TFree(jj_count_offd, HYPRE_MEMORY_HOST); - - if (num_procs > 1) - { - hypre_CSRMatrixDestroy(A_ext); - } + hypre_CSRMatrixDestroy(A_ext); return hypre_error_flag; } @@ -1862,11 +1881,12 @@ hypre_BoomerAMGBuildDirInterpHost( hypre_ParCSRMatrix *A, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr) { - - MPI_Comm comm = hypre_ParCSRMatrixComm(A); + MPI_Comm comm = hypre_ParCSRMatrixComm(A); hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); hypre_ParCSRCommHandle *comm_handle; + HYPRE_MemoryLocation memory_location_P = hypre_ParCSRMatrixMemoryLocation(A); + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); HYPRE_Real *A_diag_data = hypre_CSRMatrixData(A_diag); HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); @@ -1905,10 +1925,10 @@ hypre_BoomerAMGBuildDirInterpHost( hypre_ParCSRMatrix *A, HYPRE_Int P_diag_size, P_offd_size; - HYPRE_Int jj_counter,jj_counter_offd; + HYPRE_Int jj_counter, jj_counter_offd; HYPRE_Int *jj_count, *jj_count_offd; - HYPRE_Int jj_begin_row,jj_begin_row_offd; - HYPRE_Int jj_end_row,jj_end_row_offd; + HYPRE_Int jj_begin_row, jj_begin_row_offd; + HYPRE_Int jj_end_row, jj_end_row_offd; HYPRE_Int start_indexing = 0; /* start indexing for P_data at 0 */ @@ -1921,8 +1941,8 @@ hypre_BoomerAMGBuildDirInterpHost( hypre_ParCSRMatrix *A, HYPRE_Int num_cols_P_offd; //HYPRE_BigInt my_first_cpt; - HYPRE_Int i,i1; - HYPRE_Int j,jl,jj; + HYPRE_Int i, i1; + HYPRE_Int j, jl, jj; HYPRE_Int start; HYPRE_Real diagonal; @@ -1945,22 +1965,24 @@ hypre_BoomerAMGBuildDirInterpHost( hypre_ParCSRMatrix *A, HYPRE_Real wall_time; /* for debugging instrumentation */ hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_rank(comm, &my_id); num_threads = hypre_NumThreads(); //my_first_cpt = num_cpts_global[0]; - if (my_id == (num_procs -1)) total_global_cpts = num_cpts_global[1]; - hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); + if (my_id == (num_procs - 1)) { total_global_cpts = num_cpts_global[1]; } + hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); /*------------------------------------------------------------------- * Get the CF_marker data for the off-processor columns *-------------------------------------------------------------------*/ - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } - if (num_cols_A_offd) CF_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); + if (num_cols_A_offd) { CF_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); } if (num_functions > 1 && num_cols_A_offd) + { dof_func_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); + } if (!comm_pkg) { @@ -1970,19 +1992,19 @@ hypre_BoomerAMGBuildDirInterpHost( hypre_ParCSRMatrix *A, num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, - num_sends), HYPRE_MEMORY_HOST); + num_sends), HYPRE_MEMORY_HOST); index = 0; for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) int_buf_data[index++] - = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } comm_handle = hypre_ParCSRCommHandleCreate( 11, comm_pkg, int_buf_data, - CF_marker_offd); + CF_marker_offd); hypre_ParCSRCommHandleDestroy(comm_handle); if (num_functions > 1) @@ -1991,22 +2013,22 @@ hypre_BoomerAMGBuildDirInterpHost( hypre_ParCSRMatrix *A, for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j=start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) int_buf_data[index++] - = dof_func[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + = dof_func[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } comm_handle = hypre_ParCSRCommHandleCreate( 11, comm_pkg, int_buf_data, - dof_func_offd); + dof_func_offd); hypre_ParCSRCommHandleDestroy(comm_handle); } - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Interp: Comm 1 CF_marker = %f\n", - my_id, wall_time); + my_id, wall_time); fflush(NULL); } @@ -2024,9 +2046,9 @@ hypre_BoomerAMGBuildDirInterpHost( hypre_ParCSRMatrix *A, fine_to_coarse = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i = 0; i < n_fine; i++) fine_to_coarse[i] = -1; + for (i = 0; i < n_fine; i++) { fine_to_coarse[i] = -1; } jj_counter = start_indexing; jj_counter_offd = start_indexing; @@ -2037,21 +2059,21 @@ hypre_BoomerAMGBuildDirInterpHost( hypre_ParCSRMatrix *A, /* RDF: this looks a little tricky, but doable */ #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,j,i1,jj,ns,ne,size,rest) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,j,i1,jj,ns,ne,size,rest) HYPRE_SMP_SCHEDULE #endif for (j = 0; j < num_threads; j++) { - size = n_fine/num_threads; - rest = n_fine - size*num_threads; + size = n_fine / num_threads; + rest = n_fine - size * num_threads; if (j < rest) { - ns = j*size+j; - ne = (j+1)*size+j+1; + ns = j * size + j; + ne = (j + 1) * size + j + 1; } else { - ns = j*size+rest; - ne = (j+1)*size+rest; + ns = j * size + rest; + ne = (j + 1) * size + rest; } for (i = ns; i < ne; i++) { @@ -2075,7 +2097,7 @@ hypre_BoomerAMGBuildDirInterpHost( hypre_ParCSRMatrix *A, else { - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) { i1 = S_diag_j[jj]; if (CF_marker[i1] > 0) @@ -2086,7 +2108,7 @@ hypre_BoomerAMGBuildDirInterpHost( hypre_ParCSRMatrix *A, if (num_procs > 1) { - for (jj = S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) { i1 = S_offd_j[jj]; if (CF_marker_offd[i1] > 0) @@ -2103,30 +2125,30 @@ hypre_BoomerAMGBuildDirInterpHost( hypre_ParCSRMatrix *A, * Allocate arrays. *-----------------------------------------------------------------------*/ - for (i=0; i < num_threads-1; i++) + for (i = 0; i < num_threads - 1; i++) { - coarse_counter[i+1] += coarse_counter[i]; - jj_count[i+1] += jj_count[i]; - jj_count_offd[i+1] += jj_count_offd[i]; + coarse_counter[i + 1] += coarse_counter[i]; + jj_count[i + 1] += jj_count[i]; + jj_count_offd[i + 1] += jj_count_offd[i]; } - i = num_threads-1; + i = num_threads - 1; jj_counter = jj_count[i]; jj_counter_offd = jj_count_offd[i]; P_diag_size = jj_counter; - P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, HYPRE_MEMORY_DEVICE); - P_diag_j = hypre_CTAlloc(HYPRE_Int, P_diag_size, HYPRE_MEMORY_DEVICE); - P_diag_data = hypre_CTAlloc(HYPRE_Real, P_diag_size, HYPRE_MEMORY_DEVICE); + P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, memory_location_P); + P_diag_j = hypre_CTAlloc(HYPRE_Int, P_diag_size, memory_location_P); + P_diag_data = hypre_CTAlloc(HYPRE_Real, P_diag_size, memory_location_P); P_diag_i[n_fine] = jj_counter; P_offd_size = jj_counter_offd; - P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, HYPRE_MEMORY_DEVICE); - P_offd_j = hypre_CTAlloc(HYPRE_Int, P_offd_size, HYPRE_MEMORY_DEVICE); - P_offd_data = hypre_CTAlloc(HYPRE_Real, P_offd_size, HYPRE_MEMORY_DEVICE); + P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, memory_location_P); + P_offd_j = hypre_CTAlloc(HYPRE_Int, P_offd_size, memory_location_P); + P_offd_data = hypre_CTAlloc(HYPRE_Real, P_offd_size, memory_location_P); /*----------------------------------------------------------------------- * Intialize some stuff. @@ -2135,11 +2157,11 @@ hypre_BoomerAMGBuildDirInterpHost( hypre_ParCSRMatrix *A, jj_counter = start_indexing; jj_counter_offd = start_indexing; - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Interp: Internal work 1 = %f\n", - my_id, wall_time); + my_id, wall_time); fflush(NULL); } @@ -2147,28 +2169,28 @@ hypre_BoomerAMGBuildDirInterpHost( hypre_ParCSRMatrix *A, * Send and receive fine_to_coarse info. *-----------------------------------------------------------------------*/ - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } //fine_to_coarse_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,j,ns,ne,size,rest,coarse_shift) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,j,ns,ne,size,rest,coarse_shift) HYPRE_SMP_SCHEDULE #endif for (j = 0; j < num_threads; j++) { coarse_shift = 0; - if (j > 0) coarse_shift = coarse_counter[j-1]; - size = n_fine/num_threads; - rest = n_fine - size*num_threads; + if (j > 0) { coarse_shift = coarse_counter[j - 1]; } + size = n_fine / num_threads; + rest = n_fine - size * num_threads; if (j < rest) { - ns = j*size+j; - ne = (j+1)*size+j+1; + ns = j * size + j; + ne = (j + 1) * size + j + 1; } else { - ns = j*size+rest; - ne = (j+1)*size+rest; + ns = j * size + rest; + ne = (j + 1) * size + rest; } for (i = ns; i < ne; i++) { @@ -2197,46 +2219,52 @@ hypre_BoomerAMGBuildDirInterpHost( hypre_ParCSRMatrix *A, fflush(NULL); }*/ - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } /*#ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE -#endif -for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #endif + for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ /*----------------------------------------------------------------------- * Loop over fine grid points. *-----------------------------------------------------------------------*/ #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,j,jl,i1,jj,ns,ne,size,rest,diagonal,jj_counter,jj_counter_offd,jj_begin_row,jj_end_row,jj_begin_row_offd,jj_end_row_offd,sum_P_pos,sum_P_neg,sum_N_pos,sum_N_neg,alfa,beta) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,j,jl,i1,jj,ns,ne,size,rest,diagonal,jj_counter,jj_counter_offd,jj_begin_row,jj_end_row,jj_begin_row_offd,jj_end_row_offd,sum_P_pos,sum_P_neg,sum_N_pos,sum_N_neg,alfa,beta) HYPRE_SMP_SCHEDULE #endif for (jl = 0; jl < num_threads; jl++) { HYPRE_Int *P_marker, *P_marker_offd; - size = n_fine/num_threads; - rest = n_fine - size*num_threads; + alfa = 1.0; + beta = 1.0; + size = n_fine / num_threads; + rest = n_fine - size * num_threads; if (jl < rest) { - ns = jl*size+jl; - ne = (jl+1)*size+jl+1; + ns = jl * size + jl; + ne = (jl + 1) * size + jl + 1; } else { - ns = jl*size+rest; - ne = (jl+1)*size+rest; + ns = jl * size + rest; + ne = (jl + 1) * size + rest; } jj_counter = 0; - if (jl > 0) jj_counter = jj_count[jl-1]; + if (jl > 0) { jj_counter = jj_count[jl - 1]; } jj_counter_offd = 0; - if (jl > 0) jj_counter_offd = jj_count_offd[jl-1]; + if (jl > 0) { jj_counter_offd = jj_count_offd[jl - 1]; } P_marker = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); if (num_cols_A_offd) + { P_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); + } else + { P_marker_offd = NULL; + } for (i = 0; i < n_fine; i++) { @@ -2272,7 +2300,7 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ P_diag_i[i] = jj_counter; jj_begin_row = jj_counter; - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) { i1 = S_diag_j[jj]; @@ -2299,7 +2327,7 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ if (num_procs > 1) { - for (jj = S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) { i1 = S_offd_j[jj]; @@ -2329,15 +2357,19 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ sum_P_pos = 0; sum_P_neg = 0; - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) { i1 = A_diag_j[jj]; if (num_functions == 1 || dof_func[i1] == dof_func[i]) { if (A_diag_data[jj] > 0) + { sum_N_pos += A_diag_data[jj]; + } else + { sum_N_neg += A_diag_data[jj]; + } } /*-------------------------------------------------------------- * Case 1: neighbor i1 is a C-point and strongly influences i, @@ -2348,9 +2380,13 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ { P_diag_data[P_marker[i1]] += A_diag_data[jj]; if (A_diag_data[jj] > 0) + { sum_P_pos += A_diag_data[jj]; + } else + { sum_P_neg += A_diag_data[jj]; + } } } @@ -2361,15 +2397,19 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ if (num_procs > 1) { - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { i1 = A_offd_j[jj]; if (num_functions == 1 || dof_func_offd[i1] == dof_func[i]) { if (A_offd_data[jj] > 0) + { sum_N_pos += A_offd_data[jj]; + } else + { sum_N_neg += A_offd_data[jj]; + } } /*-------------------------------------------------------------- @@ -2381,15 +2421,19 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ { P_offd_data[P_marker_offd[i1]] += A_offd_data[jj]; if (A_offd_data[jj] > 0) + { sum_P_pos += A_offd_data[jj]; + } else + { sum_P_neg += A_offd_data[jj]; + } } } } - if (sum_P_neg) alfa = sum_N_neg/sum_P_neg/diagonal; - if (sum_P_pos) beta = sum_N_pos/sum_P_pos/diagonal; + if (sum_P_neg) { alfa = sum_N_neg / sum_P_neg / diagonal; } + if (sum_P_pos) { beta = sum_N_pos / sum_P_pos / diagonal; } /*----------------------------------------------------------------- * Set interpolation weight by dividing by the diagonal. @@ -2397,36 +2441,44 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ for (jj = jj_begin_row; jj < jj_end_row; jj++) { - if (P_diag_data[jj]> 0) + if (P_diag_data[jj] > 0) + { P_diag_data[jj] *= -beta; + } else + { P_diag_data[jj] *= -alfa; + } } for (jj = jj_begin_row_offd; jj < jj_end_row_offd; jj++) { - if (P_offd_data[jj]> 0) + if (P_offd_data[jj] > 0) + { P_offd_data[jj] *= -beta; + } else + { P_offd_data[jj] *= -alfa; + } } } - P_offd_i[i+1] = jj_counter_offd; + P_offd_i[i + 1] = jj_counter_offd; } hypre_TFree(P_marker, HYPRE_MEMORY_HOST); hypre_TFree(P_marker_offd, HYPRE_MEMORY_HOST); } P = hypre_ParCSRMatrixCreate(comm, - hypre_ParCSRMatrixGlobalNumRows(A), - total_global_cpts, - hypre_ParCSRMatrixColStarts(A), - num_cpts_global, - 0, - P_diag_i[n_fine], - P_offd_i[n_fine]); + hypre_ParCSRMatrixGlobalNumRows(A), + total_global_cpts, + hypre_ParCSRMatrixColStarts(A), + num_cpts_global, + 0, + P_diag_i[n_fine], + P_offd_i[n_fine]); P_diag = hypre_ParCSRMatrixDiag(P); @@ -2459,13 +2511,15 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ HYPRE_Int *P_marker = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i=0; i < num_cols_A_offd; i++) + for (i = 0; i < num_cols_A_offd; i++) + { P_marker[i] = 0; + } num_cols_P_offd = 0; - for (i=0; i < P_offd_size; i++) + for (i = 0; i < P_offd_size; i++) { index = P_offd_j[i]; if (!P_marker[index]) @@ -2479,26 +2533,26 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ tmp_map_offd = hypre_CTAlloc(HYPRE_Int, num_cols_P_offd, HYPRE_MEMORY_HOST); index = 0; - for (i=0; i < num_cols_P_offd; i++) + for (i = 0; i < num_cols_P_offd; i++) { - while (P_marker[index]==0) index++; + while (P_marker[index] == 0) { index++; } tmp_map_offd[i] = index++; } #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i=0; i < P_offd_size; i++) + for (i = 0; i < P_offd_size; i++) { P_offd_j[i] = hypre_BinarySearch(tmp_map_offd, - P_offd_j[i], - num_cols_P_offd); + P_offd_j[i], + num_cols_P_offd); } hypre_TFree(P_marker, HYPRE_MEMORY_HOST); } - for (i=0; i < n_fine; i++) - if (CF_marker[i] == -3) CF_marker[i] = -1; + for (i = 0; i < n_fine; i++) + if (CF_marker[i] == -3) { CF_marker[i] = -1; } if (num_cols_P_offd) { @@ -2535,33 +2589,29 @@ hypre_BoomerAMGBuildDirInterp( hypre_ParCSRMatrix *A, HYPRE_Int interp_type, hypre_ParCSRMatrix **P_ptr) { -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - hypre_GpuProfilingPushRange("DirInterp"); -#endif + HYPRE_UNUSED_VAR(interp_type); - HYPRE_Int ierr = 0; + hypre_GpuProfilingPushRange("DirInterp"); -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(A) ); if (exec == HYPRE_EXEC_DEVICE) { - ierr = hypre_BoomerAMGBuildDirInterpDevice(A,CF_marker,S,num_cpts_global,num_functions,dof_func, - debug_flag,trunc_factor,max_elmts, - interp_type, P_ptr); + hypre_BoomerAMGBuildDirInterpDevice(A, CF_marker, S, num_cpts_global, num_functions, + dof_func, debug_flag, trunc_factor, max_elmts, + interp_type, P_ptr); } else #endif { - ierr = hypre_BoomerAMGBuildDirInterpHost(A,CF_marker,S,num_cpts_global,num_functions,dof_func, - debug_flag,trunc_factor,max_elmts, P_ptr); + hypre_BoomerAMGBuildDirInterpHost(A, CF_marker, S, num_cpts_global, num_functions, + dof_func, debug_flag, trunc_factor, max_elmts, P_ptr); } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_GpuProfilingPopRange(); -#endif - return ierr; + return hypre_error_flag; } /*------------------------------------------------ @@ -2575,10 +2625,10 @@ hypre_BoomerAMGInterpTruncation( hypre_ParCSRMatrix *P, { if (trunc_factor <= 0.0 && max_elmts == 0) { - return 0; + return hypre_error_flag; } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(P) ); if (exec == HYPRE_EXEC_DEVICE) @@ -2639,12 +2689,12 @@ hypre_BoomerAMGBuildInterpModUnk( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P; HYPRE_BigInt *col_map_offd_P; - HYPRE_Int *tmp_map_offd; + HYPRE_Int *tmp_map_offd = NULL; HYPRE_Int *CF_marker_offd = NULL; HYPRE_Int *dof_func_offd = NULL; - hypre_CSRMatrix *A_ext; + hypre_CSRMatrix *A_ext = NULL; HYPRE_Real *A_ext_data = NULL; HYPRE_Int *A_ext_i = NULL; @@ -2664,10 +2714,10 @@ hypre_BoomerAMGBuildInterpModUnk( hypre_ParCSRMatrix *A, HYPRE_Int *P_marker, *P_marker_offd; - HYPRE_Int jj_counter,jj_counter_offd; + HYPRE_Int jj_counter, jj_counter_offd; HYPRE_Int *jj_count, *jj_count_offd; - HYPRE_Int jj_begin_row,jj_begin_row_offd; - HYPRE_Int jj_end_row,jj_end_row_offd; + HYPRE_Int jj_begin_row, jj_begin_row_offd; + HYPRE_Int jj_end_row, jj_end_row_offd; HYPRE_Int start_indexing = 0; /* start indexing for P_data at 0 */ @@ -2683,8 +2733,8 @@ hypre_BoomerAMGBuildInterpModUnk( hypre_ParCSRMatrix *A, HYPRE_Int num_cols_P_offd; //HYPRE_BigInt my_first_cpt; - HYPRE_Int i,i1,i2; - HYPRE_Int j,jl,jj,jj1; + HYPRE_Int i, i1, i2; + HYPRE_Int j, jl, jj, jj1; HYPRE_Int kc; HYPRE_BigInt big_k; HYPRE_Int start; @@ -2711,16 +2761,16 @@ hypre_BoomerAMGBuildInterpModUnk( hypre_ParCSRMatrix *A, HYPRE_Int local_numrows = hypre_CSRMatrixNumRows(A_diag); HYPRE_BigInt col_n = col_1 + local_numrows; - HYPRE_Real wall_time; /* for debugging instrumentation */ + HYPRE_Real wall_time = 0.0; /* for debugging instrumentation */ hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_rank(comm, &my_id); num_threads = hypre_NumThreads(); //my_first_cpt = num_cpts_global[0]; - if (my_id == (num_procs -1)) total_global_cpts = num_cpts_global[1]; - hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); + if (my_id == (num_procs - 1)) { total_global_cpts = num_cpts_global[1]; } + hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); /*------------------------------------------------------------------- * Get the CF_marker data for the off-processor columns @@ -2732,11 +2782,13 @@ hypre_BoomerAMGBuildInterpModUnk( hypre_ParCSRMatrix *A, print_level = 1; } - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } - if (num_cols_A_offd) CF_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); + if (num_cols_A_offd) { CF_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); } if (num_functions > 1 && num_cols_A_offd) + { dof_func_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); + } if (!comm_pkg) { @@ -2746,19 +2798,19 @@ hypre_BoomerAMGBuildInterpModUnk( hypre_ParCSRMatrix *A, num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, - num_sends), HYPRE_MEMORY_HOST); + num_sends), HYPRE_MEMORY_HOST); index = 0; for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) int_buf_data[index++] - = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } comm_handle = hypre_ParCSRCommHandleCreate( 11, comm_pkg, int_buf_data, - CF_marker_offd); + CF_marker_offd); hypre_ParCSRCommHandleDestroy(comm_handle); if (num_functions > 1) @@ -2767,22 +2819,22 @@ hypre_BoomerAMGBuildInterpModUnk( hypre_ParCSRMatrix *A, for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j=start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) int_buf_data[index++] - = dof_func[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + = dof_func[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } comm_handle = hypre_ParCSRCommHandleCreate( 11, comm_pkg, int_buf_data, - dof_func_offd); + dof_func_offd); hypre_ParCSRCommHandleDestroy(comm_handle); } - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Interp: Comm 1 CF_marker = %f\n", - my_id, wall_time); + my_id, wall_time); fflush(NULL); } @@ -2790,20 +2842,20 @@ hypre_BoomerAMGBuildInterpModUnk( hypre_ParCSRMatrix *A, * Get the ghost rows of A *---------------------------------------------------------------------*/ - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } if (num_procs > 1) { - A_ext = hypre_ParCSRMatrixExtractBExt(A,A,1); + A_ext = hypre_ParCSRMatrixExtractBExt(A, A, 1); A_ext_i = hypre_CSRMatrixI(A_ext); A_ext_j = hypre_CSRMatrixBigJ(A_ext); A_ext_data = hypre_CSRMatrixData(A_ext); } index = 0; - for (i=0; i < num_cols_A_offd; i++) + for (i = 0; i < num_cols_A_offd; i++) { - for (j=A_ext_i[i]; j < A_ext_i[i+1]; j++) + for (j = A_ext_i[i]; j < A_ext_i[i + 1]; j++) { big_k = A_ext_j[j]; if (big_k >= col_1 && big_k < col_n) @@ -2813,10 +2865,10 @@ hypre_BoomerAMGBuildInterpModUnk( hypre_ParCSRMatrix *A, } else { - kc = hypre_BigBinarySearch(col_map_offd,big_k,num_cols_A_offd); + kc = hypre_BigBinarySearch(col_map_offd, big_k, num_cols_A_offd); if (kc > -1) { - A_ext_j[index] = (HYPRE_BigInt)(-kc-1); + A_ext_j[index] = (HYPRE_BigInt)(-kc - 1); A_ext_data[index++] = A_ext_data[j]; } } @@ -2824,14 +2876,16 @@ hypre_BoomerAMGBuildInterpModUnk( hypre_ParCSRMatrix *A, A_ext_i[i] = index; } for (i = num_cols_A_offd; i > 0; i--) - A_ext_i[i] = A_ext_i[i-1]; - if (num_procs > 1) A_ext_i[0] = 0; + { + A_ext_i[i] = A_ext_i[i - 1]; + } + if (num_procs > 1) { A_ext_i[0] = 0; } - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Interp: Comm 2 Get A_ext = %f\n", - my_id, wall_time); + my_id, wall_time); fflush(NULL); } @@ -2850,9 +2904,9 @@ hypre_BoomerAMGBuildInterpModUnk( hypre_ParCSRMatrix *A, fine_to_coarse = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i = 0; i < n_fine; i++) fine_to_coarse[i] = -1; + for (i = 0; i < n_fine; i++) { fine_to_coarse[i] = -1; } jj_counter = start_indexing; jj_counter_offd = start_indexing; @@ -2863,21 +2917,21 @@ hypre_BoomerAMGBuildInterpModUnk( hypre_ParCSRMatrix *A, /* RDF: this looks a little tricky, but doable */ #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,j,i1,jj,ns,ne,size,rest) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,j,i1,jj,ns,ne,size,rest) HYPRE_SMP_SCHEDULE #endif for (j = 0; j < num_threads; j++) { - size = n_fine/num_threads; - rest = n_fine - size*num_threads; + size = n_fine / num_threads; + rest = n_fine - size * num_threads; if (j < rest) { - ns = j*size+j; - ne = (j+1)*size+j+1; + ns = j * size + j; + ne = (j + 1) * size + j + 1; } else { - ns = j*size+rest; - ne = (j+1)*size+rest; + ns = j * size + rest; + ne = (j + 1) * size + rest; } for (i = ns; i < ne; i++) { @@ -2901,7 +2955,7 @@ hypre_BoomerAMGBuildInterpModUnk( hypre_ParCSRMatrix *A, else { - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) { i1 = S_diag_j[jj]; if (CF_marker[i1] >= 0) @@ -2912,7 +2966,7 @@ hypre_BoomerAMGBuildInterpModUnk( hypre_ParCSRMatrix *A, if (num_procs > 1) { - for (jj = S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) { i1 = S_offd_j[jj]; if (CF_marker_offd[i1] >= 0) @@ -2929,19 +2983,19 @@ hypre_BoomerAMGBuildInterpModUnk( hypre_ParCSRMatrix *A, * Allocate arrays. *-----------------------------------------------------------------------*/ - for (i=0; i < num_threads-1; i++) + for (i = 0; i < num_threads - 1; i++) { - coarse_counter[i+1] += coarse_counter[i]; - jj_count[i+1] += jj_count[i]; - jj_count_offd[i+1] += jj_count_offd[i]; + coarse_counter[i + 1] += coarse_counter[i]; + jj_count[i + 1] += jj_count[i]; + jj_count_offd[i + 1] += jj_count_offd[i]; } - i = num_threads-1; + i = num_threads - 1; jj_counter = jj_count[i]; jj_counter_offd = jj_count_offd[i]; P_diag_size = jj_counter; - P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, HYPRE_MEMORY_HOST); + P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, HYPRE_MEMORY_HOST); P_diag_j = hypre_CTAlloc(HYPRE_Int, P_diag_size, HYPRE_MEMORY_HOST); P_diag_data = hypre_CTAlloc(HYPRE_Real, P_diag_size, HYPRE_MEMORY_HOST); @@ -2949,7 +3003,7 @@ hypre_BoomerAMGBuildInterpModUnk( hypre_ParCSRMatrix *A, P_offd_size = jj_counter_offd; - P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, HYPRE_MEMORY_HOST); + P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, HYPRE_MEMORY_HOST); P_offd_j = hypre_CTAlloc(HYPRE_Int, P_offd_size, HYPRE_MEMORY_HOST); P_offd_data = hypre_CTAlloc(HYPRE_Real, P_offd_size, HYPRE_MEMORY_HOST); @@ -2960,11 +3014,11 @@ hypre_BoomerAMGBuildInterpModUnk( hypre_ParCSRMatrix *A, jj_counter = start_indexing; jj_counter_offd = start_indexing; - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d Interp: Internal work 1 = %f\n", - my_id, wall_time); + my_id, wall_time); fflush(NULL); } @@ -2972,31 +3026,33 @@ hypre_BoomerAMGBuildInterpModUnk( hypre_ParCSRMatrix *A, * Send and receive fine_to_coarse info. *-----------------------------------------------------------------------*/ - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } //fine_to_coarse_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,j,ns,ne,size,rest,coarse_shift) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,j,ns,ne,size,rest,coarse_shift) HYPRE_SMP_SCHEDULE #endif for (j = 0; j < num_threads; j++) { coarse_shift = 0; - if (j > 0) coarse_shift = coarse_counter[j-1]; - size = n_fine/num_threads; - rest = n_fine - size*num_threads; + if (j > 0) { coarse_shift = coarse_counter[j - 1]; } + size = n_fine / num_threads; + rest = n_fine - size * num_threads; if (j < rest) { - ns = j*size+j; - ne = (j+1)*size+j+1; + ns = j * size + j; + ne = (j + 1) * size + j + 1; } else { - ns = j*size+rest; - ne = (j+1)*size+rest; + ns = j * size + rest; + ne = (j + 1) * size + rest; } for (i = ns; i < ne; i++) + { fine_to_coarse[i] += coarse_shift; + } } /*index = 0; for (i = 0; i < num_sends; i++) @@ -3020,44 +3076,48 @@ hypre_BoomerAMGBuildInterpModUnk( hypre_ParCSRMatrix *A, fflush(NULL); }*/ - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } /*#ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE -#endif -for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #endif + for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ /*----------------------------------------------------------------------- * Loop over fine grid points. *-----------------------------------------------------------------------*/ #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,j,jl,i1,i2,jj,jj1,ns,ne,size,rest,sum,diagonal,distribute,P_marker,P_marker_offd,strong_f_marker,jj_counter,jj_counter_offd,sgn,c_num,jj_begin_row,jj_end_row,jj_begin_row_offd,jj_end_row_offd) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,j,jl,i1,i2,jj,jj1,ns,ne,size,rest,sum,diagonal,distribute,P_marker,P_marker_offd,strong_f_marker,jj_counter,jj_counter_offd,sgn,c_num,jj_begin_row,jj_end_row,jj_begin_row_offd,jj_end_row_offd) HYPRE_SMP_SCHEDULE #endif for (jl = 0; jl < num_threads; jl++) { - size = n_fine/num_threads; - rest = n_fine - size*num_threads; + size = n_fine / num_threads; + rest = n_fine - size * num_threads; if (jl < rest) { - ns = jl*size+jl; - ne = (jl+1)*size+jl+1; + ns = jl * size + jl; + ne = (jl + 1) * size + jl + 1; } else { - ns = jl*size+rest; - ne = (jl+1)*size+rest; + ns = jl * size + rest; + ne = (jl + 1) * size + rest; } jj_counter = 0; - if (jl > 0) jj_counter = jj_count[jl-1]; + if (jl > 0) { jj_counter = jj_count[jl - 1]; } jj_counter_offd = 0; - if (jl > 0) jj_counter_offd = jj_count_offd[jl-1]; + if (jl > 0) { jj_counter_offd = jj_count_offd[jl - 1]; } P_marker = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); if (num_cols_A_offd) + { P_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); + } else + { P_marker_offd = NULL; + } for (i = 0; i < n_fine; i++) { @@ -3094,7 +3154,7 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ P_diag_i[i] = jj_counter; jj_begin_row = jj_counter; - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) { i1 = S_diag_j[jj]; @@ -3130,7 +3190,7 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ if (num_procs > 1) { - for (jj = S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) { i1 = S_offd_j[jj]; @@ -3167,7 +3227,7 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ /* Loop over ith row of A. First, the diagonal part of A */ - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) { i1 = A_diag_j[jj]; @@ -3199,16 +3259,16 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ * of the connections to c-points that strongly influence i. *-----------------------------------------------------------*/ sgn = 1; - if (A_diag_data[A_diag_i[i1]] < 0) sgn = -1; + if (A_diag_data[A_diag_i[i1]] < 0) { sgn = -1; } /* Diagonal block part of row i1 */ - for (jj1 = A_diag_i[i1]; jj1 < A_diag_i[i1+1]; jj1++) + for (jj1 = A_diag_i[i1]; jj1 < A_diag_i[i1 + 1]; jj1++) { i2 = A_diag_j[jj1]; if (num_functions == 1 || dof_func[i1] == dof_func[i2]) { if (P_marker[i2] >= jj_begin_row && - (sgn*A_diag_data[jj1]) < 0 ) + (sgn * A_diag_data[jj1]) < 0 ) { sum += A_diag_data[jj1]; } @@ -3219,13 +3279,13 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ /* Off-Diagonal block part of row i1 */ if (num_procs > 1) { - for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1+1]; jj1++) + for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1 + 1]; jj1++) { i2 = A_offd_j[jj1]; if (num_functions == 1 || dof_func[i1] == dof_func[i2]) { if (P_marker_offd[i2] >= jj_begin_row_offd - && (sgn*A_offd_data[jj1]) < 0) + && (sgn * A_offd_data[jj1]) < 0) { sum += A_offd_data[jj1]; } @@ -3242,16 +3302,16 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ *-----------------------------------------------------------*/ /* Diagonal block part of row i1 */ - for (jj1 = A_diag_i[i1]; jj1 < A_diag_i[i1+1]; jj1++) + for (jj1 = A_diag_i[i1]; jj1 < A_diag_i[i1 + 1]; jj1++) { i2 = A_diag_j[jj1]; if (num_functions == 1 || dof_func[i1] == dof_func[i2]) { if (P_marker[i2] >= jj_begin_row - && (sgn*A_diag_data[jj1]) < 0) + && (sgn * A_diag_data[jj1]) < 0) { P_diag_data[P_marker[i2]] - += distribute * A_diag_data[jj1]; + += distribute * A_diag_data[jj1]; } } @@ -3260,16 +3320,16 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ /* Off-Diagonal block part of row i1 */ if (num_procs > 1) { - for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1+1]; jj1++) + for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1 + 1]; jj1++) { i2 = A_offd_j[jj1]; if (num_functions == 1 || dof_func[i1] == dof_func[i2]) { if (P_marker_offd[i2] >= jj_begin_row_offd - && (sgn*A_offd_data[jj1]) < 0) + && (sgn * A_offd_data[jj1]) < 0) { P_offd_data[P_marker_offd[i2]] - += distribute * A_offd_data[jj1]; + += distribute * A_offd_data[jj1]; } } } @@ -3279,7 +3339,9 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ else /* sum = 0 - only add to diag if the same function type */ { if (num_functions == 1 || dof_func[i] == dof_func[i1]) + { diagonal += A_diag_data[jj]; + } } } @@ -3291,7 +3353,9 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ else if (CF_marker[i1] != -3) { if (num_functions == 1 || dof_func[i] == dof_func[i1]) + { diagonal += A_diag_data[jj]; + } } } @@ -3304,7 +3368,7 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ if (num_procs > 1) { - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { i1 = A_offd_j[jj]; @@ -3340,8 +3404,8 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ c_num = A_offd_j[jj]; sgn = 1; - if (A_ext_data[A_ext_i[c_num]] < 0) sgn = -1; - for (jj1 = A_ext_i[c_num]; jj1 < A_ext_i[c_num+1]; jj1++) + if (A_ext_data[A_ext_i[c_num]] < 0) { sgn = -1; } + for (jj1 = A_ext_i[c_num]; jj1 < A_ext_i[c_num + 1]; jj1++) { i2 = (HYPRE_Int)A_ext_j[jj1]; if (num_functions == 1 || dof_func[i1] == dof_func[i2]) @@ -3350,7 +3414,7 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ { /* in the diagonal block */ if (P_marker[i2] >= jj_begin_row - && (sgn*A_ext_data[jj1]) < 0) + && (sgn * A_ext_data[jj1]) < 0) { sum += A_ext_data[jj1]; } @@ -3358,8 +3422,8 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ else { /* in the off_diagonal block */ - if (P_marker_offd[-i2-1] >= jj_begin_row_offd - && (sgn*A_ext_data[jj1]) < 0) + if (P_marker_offd[-i2 - 1] >= jj_begin_row_offd + && (sgn * A_ext_data[jj1]) < 0) { sum += A_ext_data[jj1]; } @@ -3377,7 +3441,7 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ /* Diagonal block part of row i1 */ - for (jj1 = A_ext_i[c_num]; jj1 < A_ext_i[c_num+1]; jj1++) + for (jj1 = A_ext_i[c_num]; jj1 < A_ext_i[c_num + 1]; jj1++) { i2 = (HYPRE_Int)A_ext_j[jj1]; if (num_functions == 1 || dof_func[i1] == dof_func[i2]) @@ -3385,19 +3449,19 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ if (i2 > -1) /* in the diagonal block */ { if (P_marker[i2] >= jj_begin_row - && (sgn*A_ext_data[jj1]) < 0) + && (sgn * A_ext_data[jj1]) < 0) { P_diag_data[P_marker[i2]] - += distribute * A_ext_data[jj1]; + += distribute * A_ext_data[jj1]; } } else { /* in the off_diagonal block */ - if (P_marker_offd[-i2-1] >= jj_begin_row_offd - && (sgn*A_ext_data[jj1]) < 0) - P_offd_data[P_marker_offd[-i2-1]] - += distribute * A_ext_data[jj1]; + if (P_marker_offd[-i2 - 1] >= jj_begin_row_offd + && (sgn * A_ext_data[jj1]) < 0) + P_offd_data[P_marker_offd[-i2 - 1]] + += distribute * A_ext_data[jj1]; } } } @@ -3405,7 +3469,9 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ else /* sum = 0 */ { if (num_functions == 1 || dof_func[i] == dof_func_offd[i1]) + { diagonal += A_offd_data[jj]; + } } } @@ -3417,7 +3483,9 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ else if (CF_marker_offd[i1] != -3) { if (num_functions == 1 || dof_func[i] == dof_func_offd[i1]) + { diagonal += A_offd_data[jj]; + } } } @@ -3430,7 +3498,9 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ if (diagonal == 0.0) { if (print_level) - hypre_printf(" Warning! zero diagonal! Proc id %d row %d\n", my_id,i); + { + hypre_printf(" Warning! zero diagonal! Proc id %d row %d\n", my_id, i); + } for (jj = jj_begin_row; jj < jj_end_row; jj++) { P_diag_data[jj] = 0.0; @@ -3455,20 +3525,20 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ strong_f_marker--; - P_offd_i[i+1] = jj_counter_offd; + P_offd_i[i + 1] = jj_counter_offd; } hypre_TFree(P_marker, HYPRE_MEMORY_HOST); hypre_TFree(P_marker_offd, HYPRE_MEMORY_HOST); } P = hypre_ParCSRMatrixCreate(comm, - hypre_ParCSRMatrixGlobalNumRows(A), - total_global_cpts, - hypre_ParCSRMatrixColStarts(A), - num_cpts_global, - 0, - P_diag_i[n_fine], - P_offd_i[n_fine]); + hypre_ParCSRMatrixGlobalNumRows(A), + total_global_cpts, + hypre_ParCSRMatrixColStarts(A), + num_cpts_global, + 0, + P_diag_i[n_fine], + P_offd_i[n_fine]); P_diag = hypre_ParCSRMatrixDiag(P); hypre_CSRMatrixData(P_diag) = P_diag_data; @@ -3500,13 +3570,15 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ P_marker = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i=0; i < num_cols_A_offd; i++) + for (i = 0; i < num_cols_A_offd; i++) + { P_marker[i] = 0; + } num_cols_P_offd = 0; - for (i=0; i < P_offd_size; i++) + for (i = 0; i < P_offd_size; i++) { index = P_offd_j[i]; if (!P_marker[index]) @@ -3520,24 +3592,24 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ tmp_map_offd = hypre_CTAlloc(HYPRE_Int, num_cols_P_offd, HYPRE_MEMORY_HOST); index = 0; - for (i=0; i < num_cols_P_offd; i++) + for (i = 0; i < num_cols_P_offd; i++) { - while (P_marker[index]==0) index++; + while (P_marker[index] == 0) { index++; } tmp_map_offd[i] = index++; } #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i=0; i < P_offd_size; i++) + for (i = 0; i < P_offd_size; i++) P_offd_j[i] = hypre_BinarySearch(tmp_map_offd, - P_offd_j[i], - num_cols_P_offd); + P_offd_j[i], + num_cols_P_offd); hypre_TFree(P_marker, HYPRE_MEMORY_HOST); } - for (i=0; i < n_fine; i++) - if (CF_marker[i] == -3) CF_marker[i] = -1; + for (i = 0; i < n_fine; i++) + if (CF_marker[i] == -3) { CF_marker[i] = -1; } if (num_cols_P_offd) { @@ -3558,11 +3630,9 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ hypre_TFree(coarse_counter, HYPRE_MEMORY_HOST); hypre_TFree(jj_count, HYPRE_MEMORY_HOST); hypre_TFree(jj_count_offd, HYPRE_MEMORY_HOST); - - if (num_procs > 1) hypre_CSRMatrixDestroy(A_ext); + hypre_CSRMatrixDestroy(A_ext); return hypre_error_flag; - } /*--------------------------------------------------------------------------- @@ -3571,8 +3641,8 @@ for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt;*/ HYPRE_Int hypre_BoomerAMGTruncandBuild( hypre_ParCSRMatrix *P, - HYPRE_Real trunc_factor, - HYPRE_Int max_elmts) + HYPRE_Real trunc_factor, + HYPRE_Int max_elmts) { hypre_CSRMatrix *P_offd = hypre_ParCSRMatrixOffd(P); hypre_ParCSRCommPkg *commpkg_P = hypre_ParCSRMatrixCommPkg(P); @@ -3585,7 +3655,7 @@ hypre_BoomerAMGTruncandBuild( hypre_ParCSRMatrix *P, HYPRE_BigInt *new_col_map_offd; HYPRE_Int *tmp_map_offd = NULL; - HYPRE_Int P_offd_size=0, new_num_cols_offd; + HYPRE_Int P_offd_size = 0, new_num_cols_offd; HYPRE_Int *P_marker; @@ -3609,11 +3679,13 @@ hypre_BoomerAMGTruncandBuild( hypre_ParCSRMatrix *P, P_marker = hypre_CTAlloc(HYPRE_Int, num_cols_offd, HYPRE_MEMORY_HOST); /*#define HYPRE_SMP_PRIVATE i -#include "../utilities/hypre_smp_forloop.h"*/ - for (i=0; i < num_cols_offd; i++) + #include "../utilities/hypre_smp_forloop.h"*/ + for (i = 0; i < num_cols_offd; i++) + { P_marker[i] = 0; + } - for (i=0; i < P_offd_size; i++) + for (i = 0; i < P_offd_size; i++) { index = P_offd_j[i]; if (!P_marker[index]) @@ -3627,30 +3699,30 @@ hypre_BoomerAMGTruncandBuild( hypre_ParCSRMatrix *P, new_col_map_offd = hypre_CTAlloc(HYPRE_BigInt, new_num_cols_offd, HYPRE_MEMORY_HOST); index = 0; - for (i=0; i < new_num_cols_offd; i++) + for (i = 0; i < new_num_cols_offd; i++) { - while (P_marker[index]==0) index++; + while (P_marker[index] == 0) { index++; } tmp_map_offd[i] = index++; } /*#define HYPRE_SMP_PRIVATE i -#include "../utilities/hypre_smp_forloop.h"*/ - for (i=0; i < P_offd_size; i++) + #include "../utilities/hypre_smp_forloop.h"*/ + for (i = 0; i < P_offd_size; i++) P_offd_j[i] = hypre_BinarySearch(tmp_map_offd, - P_offd_j[i], - new_num_cols_offd); + P_offd_j[i], + new_num_cols_offd); } index = 0; for (i = 0; i < new_num_cols_offd; i++) { - while (P_marker[index] == 0) index++; + while (P_marker[index] == 0) { index++; } new_col_map_offd[i] = col_map_offd[index]; index++; } - if (P_offd_size) hypre_TFree(P_marker, HYPRE_MEMORY_HOST); + if (P_offd_size) { hypre_TFree(P_marker, HYPRE_MEMORY_HOST); } if (new_num_cols_offd) { @@ -3660,7 +3732,7 @@ hypre_BoomerAMGTruncandBuild( hypre_ParCSRMatrix *P, hypre_CSRMatrixNumCols(P_offd) = new_num_cols_offd; } - if (commpkg_P != NULL) hypre_MatvecCommPkgDestroy(commpkg_P); + if (commpkg_P != NULL) { hypre_MatvecCommPkgDestroy(commpkg_P); } hypre_MatvecCommPkgCreate(P); return hypre_error_flag; @@ -3708,7 +3780,7 @@ hypre_ParCSRMatrix *hypre_CreateC( hypre_ParCSRMatrix *A, HYPRE_Real w_local = w; C = hypre_ParCSRMatrixCreate(comm, global_num_rows, global_num_rows, row_starts, - row_starts, num_cols_offd, A_diag_i[num_rows], A_offd_i[num_rows]); + row_starts, num_cols_offd, A_diag_i[num_rows], A_offd_i[num_rows]); hypre_ParCSRMatrixInitialize(C); @@ -3733,29 +3805,33 @@ hypre_ParCSRMatrix *hypre_CreateC( hypre_ParCSRMatrix *A, for (i = 0; i < num_rows; i++) { index = A_diag_i[i]; - invdiag = -w/A_diag_data[index]; - C_diag_data[index] = 1.0-w; + invdiag = -w / A_diag_data[index]; + C_diag_data[index] = 1.0 - w; C_diag_j[index] = A_diag_j[index]; if (w == 0) { - w_local = fabs(A_diag_data[index]); - for (j = index+1; j < A_diag_i[i+1]; j++) - w_local += fabs(A_diag_data[j]); - for (j = A_offd_i[i]; j < A_offd_i[i+1]; j++) - w_local += fabs(A_offd_data[j]); - invdiag = -1/w_local; - C_diag_data[index] = 1.0-A_diag_data[index]/w_local; + w_local = hypre_abs(A_diag_data[index]); + for (j = index + 1; j < A_diag_i[i + 1]; j++) + { + w_local += hypre_abs(A_diag_data[j]); + } + for (j = A_offd_i[i]; j < A_offd_i[i + 1]; j++) + { + w_local += hypre_abs(A_offd_data[j]); + } + invdiag = -1 / w_local; + C_diag_data[index] = 1.0 - A_diag_data[index] / w_local; } C_diag_i[i] = index; C_offd_i[i] = A_offd_i[i]; - for (j = index+1; j < A_diag_i[i+1]; j++) + for (j = index + 1; j < A_diag_i[i + 1]; j++) { - C_diag_data[j] = A_diag_data[j]*invdiag; + C_diag_data[j] = A_diag_data[j] * invdiag; C_diag_j[j] = A_diag_j[j]; } - for (j = A_offd_i[i]; j < A_offd_i[i+1]; j++) + for (j = A_offd_i[i]; j < A_offd_i[i + 1]; j++) { - C_offd_data[j] = A_offd_data[j]*invdiag; + C_offd_data[j] = A_offd_data[j] * invdiag; C_offd_j[j] = A_offd_j[j]; } } @@ -3776,10 +3852,14 @@ hypre_BoomerAMGBuildInterpOnePntHost( hypre_ParCSRMatrix *A, HYPRE_Int debug_flag, hypre_ParCSRMatrix **P_ptr) { + HYPRE_UNUSED_VAR(debug_flag); + MPI_Comm comm = hypre_ParCSRMatrixComm(A); hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); hypre_ParCSRCommHandle *comm_handle; + HYPRE_MemoryLocation memory_location_P = hypre_ParCSRMatrixMemoryLocation(A); + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); HYPRE_Real *A_diag_data = hypre_CSRMatrixData(A_diag); HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); @@ -3844,11 +3924,11 @@ hypre_BoomerAMGBuildInterpOnePntHost( hypre_ParCSRMatrix *A, HYPRE_Real max_abs_aij, vv; hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_rank(comm, &my_id); my_first_cpt = num_cpts_global[0]; - if (my_id == (num_procs -1)) total_global_cpts = num_cpts_global[1]; - hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); + if (my_id == (num_procs - 1)) { total_global_cpts = num_cpts_global[1]; } + hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); /*------------------------------------------------------------------- * Get the CF_marker data for the off-processor columns @@ -3856,12 +3936,12 @@ hypre_BoomerAMGBuildInterpOnePntHost( hypre_ParCSRMatrix *A, /* CF marker for the off-diag columns */ if (num_cols_A_offd) { - CF_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd,HYPRE_MEMORY_HOST); + CF_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); } /* function type indicator for the off-diag columns */ if (num_functions > 1 && num_cols_A_offd) { - dof_func_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd,HYPRE_MEMORY_HOST); + dof_func_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); } /* if CommPkg of A is not present, create it */ if (!comm_pkg) @@ -3873,7 +3953,8 @@ hypre_BoomerAMGBuildInterpOnePntHost( hypre_ParCSRMatrix *A, num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); /* send buffer, of size send_map_starts[num_sends]), * i.e., number of entries to send */ - int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends),HYPRE_MEMORY_HOST); + int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); /* copy CF markers of elements to send to buffer * RL: why copy them with two for loops? Why not just loop through all in one */ @@ -3883,10 +3964,10 @@ hypre_BoomerAMGBuildInterpOnePntHost( hypre_ParCSRMatrix *A, /* start pos of elements sent to send_proc[i] */ start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); /* loop through all elems to send_proc[i] */ - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { /* CF marker of send_map_elemts[j] */ - int_buf_data[index++] = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + int_buf_data[index++] = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } } /* create a handle to start communication. 11: for integer */ @@ -3901,16 +3982,16 @@ hypre_BoomerAMGBuildInterpOnePntHost( hypre_ParCSRMatrix *A, for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { - int_buf_data[index++] = dof_func[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + int_buf_data[index++] = dof_func[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } } comm_handle = hypre_ParCSRCommHandleCreate(11, comm_pkg, int_buf_data, dof_func_offd); hypre_ParCSRCommHandleDestroy(comm_handle); } - hypre_TFree(int_buf_data,HYPRE_MEMORY_HOST); + hypre_TFree(int_buf_data, HYPRE_MEMORY_HOST); /*----------------------------------------------------------------------- * First Pass: Determine size of P and fill in fine_to_coarse mapping, * and find the most strongly influencing C-pt for each F-pt @@ -3918,13 +3999,13 @@ hypre_BoomerAMGBuildInterpOnePntHost( hypre_ParCSRMatrix *A, /* nnz in diag and offd parts */ cnt_diag = 0; cnt_offd = 0; - max_abs_cij = hypre_CTAlloc(HYPRE_Int, n_fine,HYPRE_MEMORY_HOST); - max_abs_diag_offd = hypre_CTAlloc(char, n_fine,HYPRE_MEMORY_HOST); - fine_to_coarse = hypre_CTAlloc(HYPRE_Int, n_fine,HYPRE_MEMORY_HOST); + max_abs_cij = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); + max_abs_diag_offd = hypre_CTAlloc(char, n_fine, HYPRE_MEMORY_HOST); + fine_to_coarse = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); /* markers initialized as zeros */ - marker_diag = hypre_CTAlloc(HYPRE_Int, n_fine,HYPRE_MEMORY_HOST); - marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd,HYPRE_MEMORY_HOST); + marker_diag = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); + marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); for (i = 0; i < n_fine; i++) { @@ -3943,18 +4024,18 @@ hypre_BoomerAMGBuildInterpOnePntHost( hypre_ParCSRMatrix *A, /* mark all the strong connections: in S */ HYPRE_Int MARK = i + 1; /* loop through row i of S, diag part */ - for (j = S_diag_i[i]; j < S_diag_i[i+1]; j++) + for (j = S_diag_i[i]; j < S_diag_i[i + 1]; j++) { marker_diag[S_diag_j[j]] = MARK; } /* loop through row i of S, offd part */ if (num_procs > 1) { - for (j = S_offd_i[i]; j < S_offd_i[i+1]; j++) - { - j1 = S_offd_j[j]; - marker_offd[j1] = MARK; - } + for (j = S_offd_i[i]; j < S_offd_i[i + 1]; j++) + { + j1 = S_offd_j[j]; + marker_offd[j1] = MARK; + } } fine_to_coarse[i] = -1; @@ -3967,10 +4048,10 @@ hypre_BoomerAMGBuildInterpOnePntHost( hypre_ParCSRMatrix *A, /* max abs val */ max_abs_aij = -1.0; /* loop through row i of A, diag part */ - for (j = A_diag_i[i]; j < A_diag_i[i+1]; j++) + for (j = A_diag_i[i]; j < A_diag_i[i + 1]; j++) { i1 = A_diag_j[j]; - vv = fabs(A_diag_data[j]); + vv = hypre_abs(A_diag_data[j]); #if 0 /* !!! this is a hack just for code verification purpose !!! it basically says: @@ -4004,10 +4085,10 @@ hypre_BoomerAMGBuildInterpOnePntHost( hypre_ParCSRMatrix *A, /* offd part */ if (num_procs > 1) { - for (j = A_offd_i[i]; j < A_offd_i[i+1]; j++) + for (j = A_offd_i[i]; j < A_offd_i[i + 1]; j++) { i1 = A_offd_j[j]; - vv = fabs(A_offd_data[j]); + vv = hypre_abs(A_offd_data[j]); if (CF_marker_offd[i1] >= 0 && marker_offd[i1] == MARK && vv > max_abs_aij) { /* mark it as an 'o' */ @@ -4034,15 +4115,15 @@ hypre_BoomerAMGBuildInterpOnePntHost( hypre_ParCSRMatrix *A, nnz_offd = cnt_offd; /*------------- allocate arrays */ - P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine+1,HYPRE_MEMORY_DEVICE); - P_diag_j = hypre_CTAlloc(HYPRE_Int, nnz_diag,HYPRE_MEMORY_DEVICE); - P_diag_data = hypre_CTAlloc(HYPRE_Real, nnz_diag,HYPRE_MEMORY_DEVICE); + P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, memory_location_P); + P_diag_j = hypre_CTAlloc(HYPRE_Int, nnz_diag, memory_location_P); + P_diag_data = hypre_CTAlloc(HYPRE_Real, nnz_diag, memory_location_P); /* not in ``if num_procs > 1'', * allocation needed even for empty CSR */ - P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine+1,HYPRE_MEMORY_DEVICE); - P_offd_j = hypre_CTAlloc(HYPRE_Int, nnz_offd,HYPRE_MEMORY_DEVICE); - P_offd_data = hypre_CTAlloc(HYPRE_Real, nnz_offd,HYPRE_MEMORY_DEVICE); + P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, memory_location_P); + P_offd_j = hypre_CTAlloc(HYPRE_Int, nnz_offd, memory_location_P); + P_offd_data = hypre_CTAlloc(HYPRE_Real, nnz_offd, memory_location_P); /* redundant */ P_diag_i[0] = 0; @@ -4055,16 +4136,17 @@ hypre_BoomerAMGBuildInterpOnePntHost( hypre_ParCSRMatrix *A, /*----------------------------------------------------------------------- * Send and receive fine_to_coarse info. *-----------------------------------------------------------------------*/ - fine_to_coarse_offd = hypre_CTAlloc(HYPRE_BigInt, num_cols_A_offd,HYPRE_MEMORY_HOST); - big_int_buf_data = hypre_CTAlloc(HYPRE_BigInt, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends),HYPRE_MEMORY_HOST); + fine_to_coarse_offd = hypre_CTAlloc(HYPRE_BigInt, num_cols_A_offd, HYPRE_MEMORY_HOST); + big_int_buf_data = hypre_CTAlloc(HYPRE_BigInt, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); index = 0; for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { big_int_buf_data[index++] = my_first_cpt - +(HYPRE_BigInt)fine_to_coarse[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + + (HYPRE_BigInt)fine_to_coarse[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } } comm_handle = hypre_ParCSRCommHandleCreate(21, comm_pkg, big_int_buf_data, fine_to_coarse_offd); @@ -4106,8 +4188,8 @@ hypre_BoomerAMGBuildInterpOnePntHost( hypre_ParCSRMatrix *A, } } - P_diag_i[i+1] = cnt_diag; - P_offd_i[i+1] = cnt_offd; + P_diag_i[i + 1] = cnt_diag; + P_offd_i[i + 1] = cnt_offd; } hypre_assert(cnt_diag == nnz_diag); @@ -4133,8 +4215,8 @@ hypre_BoomerAMGBuildInterpOnePntHost( hypre_ParCSRMatrix *A, /* col_map_offd_P: the col indices of the offd of P * we first keep them be the offd-idx of A */ - col_map_offd_P = hypre_CTAlloc(HYPRE_BigInt, num_cols_offd_P,HYPRE_MEMORY_HOST); - tmp_map_offd = hypre_CTAlloc(HYPRE_Int, num_cols_offd_P,HYPRE_MEMORY_HOST); + col_map_offd_P = hypre_CTAlloc(HYPRE_BigInt, num_cols_offd_P, HYPRE_MEMORY_HOST); + tmp_map_offd = hypre_CTAlloc(HYPRE_Int, num_cols_offd_P, HYPRE_MEMORY_HOST); for (i = 0, i1 = 0; i < num_cols_A_offd; i++) { if (marker_offd[i] == 1) @@ -4189,16 +4271,16 @@ hypre_BoomerAMGBuildInterpOnePntHost( hypre_ParCSRMatrix *A, *P_ptr = P; /* free workspace */ - hypre_TFree(CF_marker_offd,HYPRE_MEMORY_HOST); - hypre_TFree(dof_func_offd,HYPRE_MEMORY_HOST); - hypre_TFree(tmp_map_offd,HYPRE_MEMORY_HOST); - hypre_TFree(big_int_buf_data,HYPRE_MEMORY_HOST); - hypre_TFree(fine_to_coarse,HYPRE_MEMORY_HOST); - hypre_TFree(fine_to_coarse_offd,HYPRE_MEMORY_HOST); - hypre_TFree(marker_diag,HYPRE_MEMORY_HOST); - hypre_TFree(marker_offd,HYPRE_MEMORY_HOST); - hypre_TFree(max_abs_cij,HYPRE_MEMORY_HOST); - hypre_TFree(max_abs_diag_offd,HYPRE_MEMORY_HOST); + hypre_TFree(CF_marker_offd, HYPRE_MEMORY_HOST); + hypre_TFree(dof_func_offd, HYPRE_MEMORY_HOST); + hypre_TFree(tmp_map_offd, HYPRE_MEMORY_HOST); + hypre_TFree(big_int_buf_data, HYPRE_MEMORY_HOST); + hypre_TFree(fine_to_coarse, HYPRE_MEMORY_HOST); + hypre_TFree(fine_to_coarse_offd, HYPRE_MEMORY_HOST); + hypre_TFree(marker_diag, HYPRE_MEMORY_HOST); + hypre_TFree(marker_offd, HYPRE_MEMORY_HOST); + hypre_TFree(max_abs_cij, HYPRE_MEMORY_HOST); + hypre_TFree(max_abs_diag_offd, HYPRE_MEMORY_HOST); return hypre_error_flag; } @@ -4213,30 +4295,26 @@ hypre_BoomerAMGBuildInterpOnePnt( hypre_ParCSRMatrix *A, HYPRE_Int debug_flag, hypre_ParCSRMatrix **P_ptr) { -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_GpuProfilingPushRange("OnePntInterp"); -#endif HYPRE_Int ierr = 0; -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(A) ); if (exec == HYPRE_EXEC_DEVICE) { - ierr = hypre_BoomerAMGBuildInterpOnePntDevice(A,CF_marker,S,num_cpts_global,num_functions, - dof_func,debug_flag,P_ptr); + ierr = hypre_BoomerAMGBuildInterpOnePntDevice(A, CF_marker, S, num_cpts_global, num_functions, + dof_func, debug_flag, P_ptr); } else #endif { - ierr = hypre_BoomerAMGBuildInterpOnePntHost(A,CF_marker,S,num_cpts_global,num_functions, - dof_func,debug_flag,P_ptr); + ierr = hypre_BoomerAMGBuildInterpOnePntHost(A, CF_marker, S, num_cpts_global, num_functions, + dof_func, debug_flag, P_ptr); } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_GpuProfilingPopRange(); -#endif return ierr; } diff --git a/external/hypre/src/parcsr_ls/par_interp_device.c b/external/hypre/src/parcsr_ls/par_interp_device.c index 714f8466..c6634142 100644 --- a/external/hypre/src/parcsr_ls/par_interp_device.c +++ b/external/hypre/src/parcsr_ls/par_interp_device.c @@ -1,23 +1,48 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ +#include "_hypre_onedpl.hpp" #include "_hypre_parcsr_ls.h" #include "_hypre_utilities.hpp" -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - -__global__ void hypre_BoomerAMGBuildDirInterp_getnnz( HYPRE_Int nr_of_rows, HYPRE_Int *S_diag_i, HYPRE_Int *S_diag_j, HYPRE_Int *S_offd_i, HYPRE_Int *S_offd_j, HYPRE_Int *CF_marker, HYPRE_Int *CF_marker_offd, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int *dof_func_offd, HYPRE_Int *P_diag_i, HYPRE_Int *P_offd_i); - -__global__ void hypre_BoomerAMGBuildDirInterp_getcoef( HYPRE_Int nr_of_rows, HYPRE_Int *A_diag_i, HYPRE_Int *A_diag_j, HYPRE_Real *A_diag_data, HYPRE_Int *A_offd_i, HYPRE_Int *A_offd_j, HYPRE_Real *A_offd_data, HYPRE_Int *Soc_diag_j, HYPRE_Int *Soc_offd_j, HYPRE_Int *CF_marker, HYPRE_Int *CF_marker_offd, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int *dof_func_offd, HYPRE_Int *P_diag_i, HYPRE_Int *P_diag_j, HYPRE_Real *P_diag_data, HYPRE_Int *P_offd_i, HYPRE_Int *P_offd_j, HYPRE_Real *P_offd_data, HYPRE_Int *fine_to_coarse ); - -__global__ void hypre_BoomerAMGBuildDirInterp_getcoef_v2( HYPRE_Int nr_of_rows, HYPRE_Int *A_diag_i, HYPRE_Int *A_diag_j, HYPRE_Real *A_diag_data, HYPRE_Int *A_offd_i, HYPRE_Int *A_offd_j, HYPRE_Real *A_offd_data, HYPRE_Int *Soc_diag_j, HYPRE_Int *Soc_offd_j, HYPRE_Int *CF_marker, HYPRE_Int *CF_marker_offd, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int *dof_func_offd, HYPRE_Int *P_diag_i, HYPRE_Int *P_diag_j, HYPRE_Real *P_diag_data, HYPRE_Int *P_offd_i, HYPRE_Int *P_offd_j, HYPRE_Real *P_offd_data, HYPRE_Int *fine_to_coarse ); +#if defined(HYPRE_USING_GPU) + +/* TODO (VPM): Rename to hypreGPUKernel_. Also, do we need these prototypes? */ + +__global__ void hypre_BoomerAMGBuildDirInterp_getnnz( hypre_DeviceItem &item, HYPRE_Int nr_of_rows, + HYPRE_Int *S_diag_i, + HYPRE_Int *S_diag_j, HYPRE_Int *S_offd_i, HYPRE_Int *S_offd_j, HYPRE_Int *CF_marker, + HYPRE_Int *CF_marker_offd, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int *dof_func_offd, + HYPRE_Int *P_diag_i, HYPRE_Int *P_offd_i); + +__global__ void hypre_BoomerAMGBuildDirInterp_getcoef( hypre_DeviceItem &item, HYPRE_Int nr_of_rows, + HYPRE_Int *A_diag_i, + HYPRE_Int *A_diag_j, HYPRE_Real *A_diag_data, HYPRE_Int *A_offd_i, HYPRE_Int *A_offd_j, + HYPRE_Real *A_offd_data, HYPRE_Int *Soc_diag_j, HYPRE_Int *Soc_offd_j, HYPRE_Int *CF_marker, + HYPRE_Int *CF_marker_offd, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int *dof_func_offd, + HYPRE_Int *P_diag_i, HYPRE_Int *P_diag_j, HYPRE_Real *P_diag_data, HYPRE_Int *P_offd_i, + HYPRE_Int *P_offd_j, HYPRE_Real *P_offd_data, HYPRE_Int *fine_to_coarse ); + +__global__ void hypre_BoomerAMGBuildDirInterp_getcoef_v2( hypre_DeviceItem &item, + HYPRE_Int nr_of_rows, + HYPRE_Int *A_diag_i, + HYPRE_Int *A_diag_j, HYPRE_Real *A_diag_data, HYPRE_Int *A_offd_i, HYPRE_Int *A_offd_j, + HYPRE_Real *A_offd_data, HYPRE_Int *Soc_diag_j, HYPRE_Int *Soc_offd_j, HYPRE_Int *CF_marker, + HYPRE_Int *CF_marker_offd, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int *dof_func_offd, + HYPRE_Int *P_diag_i, HYPRE_Int *P_diag_j, HYPRE_Real *P_diag_data, HYPRE_Int *P_offd_i, + HYPRE_Int *P_offd_j, HYPRE_Real *P_offd_data, HYPRE_Int *fine_to_coarse ); __global__ void -hypre_BoomerAMGBuildInterpOnePnt_getnnz( HYPRE_Int nr_of_rows, HYPRE_Int *A_diag_i, HYPRE_Int *A_strong_diag_j, HYPRE_Complex *A_diag_a, HYPRE_Int *A_offd_i, HYPRE_Int *A_strong_offd_j, HYPRE_Complex *A_offd_a, HYPRE_Int *CF_marker, HYPRE_Int *CF_marker_offd, HYPRE_Int *diag_compress_marker, HYPRE_Int *offd_compress_marker, HYPRE_Int *P_diag_i, HYPRE_Int *P_diag_j, HYPRE_Int *P_offd_i, HYPRE_Int *P_offd_j); +hypre_BoomerAMGBuildInterpOnePnt_getnnz( hypre_DeviceItem &item, HYPRE_Int nr_of_rows, + HYPRE_Int *A_diag_i, + HYPRE_Int *A_strong_diag_j, HYPRE_Complex *A_diag_a, HYPRE_Int *A_offd_i, + HYPRE_Int *A_strong_offd_j, HYPRE_Complex *A_offd_a, HYPRE_Int *CF_marker, + HYPRE_Int *CF_marker_offd, HYPRE_Int *diag_compress_marker, HYPRE_Int *offd_compress_marker, + HYPRE_Int *P_diag_i, HYPRE_Int *P_diag_j, HYPRE_Int *P_offd_i, HYPRE_Int *P_offd_j); /*--------------------------------------------------------------------------- * hypre_BoomerAMGBuildDirInterp @@ -50,7 +75,6 @@ hypre_BoomerAMGBuildDirInterpDevice( hypre_ParCSRMatrix *A, HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); HYPRE_Int num_cols_A_offd = hypre_CSRMatrixNumCols(A_offd); - // HYPRE_BigInt *col_map_offd_A = hypre_ParCSRMatrixColMapOffd(A); HYPRE_Int n_fine = hypre_CSRMatrixNumRows(A_diag); @@ -64,13 +88,13 @@ hypre_BoomerAMGBuildDirInterpDevice( hypre_ParCSRMatrix *A, HYPRE_Int *S_offd_i = hypre_CSRMatrixI(S_offd); HYPRE_Int *S_offd_j = hypre_CSRMatrixJ(S_offd); - hypre_ParCSRMatrix *P; - HYPRE_Int *tmp_map_offd_h = NULL; + HYPRE_Int *Soc_diag_j = hypre_ParCSRMatrixSocDiagJ(S); + HYPRE_Int *Soc_offd_j = hypre_ParCSRMatrixSocOffdJ(S); HYPRE_Int *CF_marker_offd = NULL; HYPRE_Int *dof_func_offd = NULL; - HYPRE_Int *dof_func_dev = NULL; + hypre_ParCSRMatrix *P; hypre_CSRMatrix *P_diag; hypre_CSRMatrix *P_offd; HYPRE_Real *P_diag_data; @@ -84,15 +108,10 @@ hypre_BoomerAMGBuildDirInterpDevice( hypre_ParCSRMatrix *A, HYPRE_Int *fine_to_coarse_d; HYPRE_Int *fine_to_coarse_h; HYPRE_BigInt total_global_cpts; - HYPRE_Int num_cols_P_offd = 0; - HYPRE_Int i; - HYPRE_Int j; - HYPRE_Int start; HYPRE_Int my_id; HYPRE_Int num_procs; HYPRE_Int num_sends; - HYPRE_Int index; HYPRE_Int *int_buf_data; HYPRE_Real wall_time; /* for debugging instrumentation */ @@ -100,13 +119,13 @@ hypre_BoomerAMGBuildDirInterpDevice( hypre_ParCSRMatrix *A, HYPRE_MemoryLocation memory_location = hypre_ParCSRMatrixMemoryLocation(A); hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_rank(comm, &my_id); - if (my_id == (num_procs -1)) + if (my_id == (num_procs - 1)) { total_global_cpts = num_cpts_global[1]; } - hypre_MPI_Bcast( &total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); + hypre_MPI_Bcast( &total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); if (!comm_pkg) { @@ -125,13 +144,31 @@ hypre_BoomerAMGBuildDirInterpDevice( hypre_ParCSRMatrix *A, } num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - int_buf_data = hypre_TAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), HYPRE_MEMORY_DEVICE); + int_buf_data = hypre_TAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_DEVICE); hypre_ParCSRCommPkgCopySendMapElmtsToDevice(comm_pkg); +#if defined(HYPRE_USING_SYCL) + hypreSycl_gather( hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + hypre_ParCSRCommPkgSendMapStart(comm_pkg, + num_sends), + CF_marker, + int_buf_data ); +#else HYPRE_THRUST_CALL( gather, hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), - hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + hypre_ParCSRCommPkgSendMapStart(comm_pkg, + num_sends), CF_marker, int_buf_data ); +#endif + +#if defined(HYPRE_USING_THRUST_NOSYNC) + /* RL: make sure int_buf_data is ready before issuing GPU-GPU MPI */ + if (hypre_GetGpuAwareMPI()) + { + hypre_ForceSyncComputeStream(); + } +#endif comm_handle = hypre_ParCSRCommHandleCreate_v2(11, comm_pkg, HYPRE_MEMORY_DEVICE, int_buf_data, HYPRE_MEMORY_DEVICE, CF_marker_offd); @@ -145,21 +182,32 @@ hypre_BoomerAMGBuildDirInterpDevice( hypre_ParCSRMatrix *A, dof_func_offd = hypre_TAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_DEVICE); } - index = 0; - for (i = 0; i < num_sends; i++) +#if defined(HYPRE_USING_SYCL) + hypreSycl_gather( hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + hypre_ParCSRCommPkgSendMapStart(comm_pkg, + num_sends), + dof_func, + int_buf_data ); +#else + HYPRE_THRUST_CALL( gather, + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + hypre_ParCSRCommPkgSendMapStart(comm_pkg, + num_sends), + dof_func, + int_buf_data ); +#endif + +#if defined(HYPRE_USING_THRUST_NOSYNC) + /* RL: make sure int_buf_data is ready before issuing GPU-GPU MPI */ + if (hypre_GetGpuAwareMPI()) { - start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j=start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) - { - int_buf_data[index++] = dof_func[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; - } + hypre_ForceSyncComputeStream(); } - comm_handle = hypre_ParCSRCommHandleCreate_v2(11, comm_pkg, HYPRE_MEMORY_HOST, int_buf_data, +#endif + + comm_handle = hypre_ParCSRCommHandleCreate_v2(11, comm_pkg, HYPRE_MEMORY_DEVICE, int_buf_data, HYPRE_MEMORY_DEVICE, dof_func_offd); hypre_ParCSRCommHandleDestroy(comm_handle); - - dof_func_dev = hypre_TAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_DEVICE); - hypre_TMemcpy(dof_func_dev, dof_func, HYPRE_Int, n_fine, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); } if (debug_flag == 4) @@ -172,29 +220,40 @@ hypre_BoomerAMGBuildDirInterpDevice( hypre_ParCSRMatrix *A, /* 3. Figure out the size of the interpolation matrix, P, i.e., compute P_diag_i and P_offd_i */ /* Also, compute fine_to_coarse array: When i is a coarse point, fine_to_coarse[i] will hold a */ /* corresponding coarse point index in the range 0..n_coarse-1 */ - P_diag_i = hypre_TAlloc(HYPRE_Int, n_fine+1, memory_location); - P_offd_i = hypre_TAlloc(HYPRE_Int, n_fine+1, memory_location); + P_diag_i = hypre_TAlloc(HYPRE_Int, n_fine + 1, memory_location); + P_offd_i = hypre_TAlloc(HYPRE_Int, n_fine + 1, memory_location); - dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(n_fine, "warp", bDim); + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(n_fine, "warp", bDim); - HYPRE_CUDA_LAUNCH( hypre_BoomerAMGBuildDirInterp_getnnz, gDim, bDim, - n_fine, S_diag_i, S_diag_j, S_offd_i, S_offd_j, - CF_marker, CF_marker_offd, num_functions, - dof_func_dev, dof_func_offd, P_diag_i, P_offd_i); + HYPRE_GPU_LAUNCH( hypre_BoomerAMGBuildDirInterp_getnnz, gDim, bDim, + n_fine, S_diag_i, S_diag_j, S_offd_i, S_offd_j, + CF_marker, CF_marker_offd, num_functions, + dof_func, dof_func_offd, P_diag_i, P_offd_i); /* The scans will transform P_diag_i and P_offd_i to the CSR I-vectors */ - hypreDevice_IntegerExclusiveScan(n_fine+1, P_diag_i); - hypreDevice_IntegerExclusiveScan(n_fine+1, P_offd_i); + hypre_Memset(P_diag_i + n_fine, 0, sizeof(HYPRE_Int), HYPRE_MEMORY_DEVICE); + hypre_Memset(P_offd_i + n_fine, 0, sizeof(HYPRE_Int), HYPRE_MEMORY_DEVICE); + + hypreDevice_IntegerExclusiveScan(n_fine + 1, P_diag_i); + hypreDevice_IntegerExclusiveScan(n_fine + 1, P_offd_i); fine_to_coarse_d = hypre_TAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_DEVICE); /* The scan will make fine_to_coarse[i] for i a coarse point hold a * coarse point index in the range from 0 to n_coarse-1 */ +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::exclusive_scan, + oneapi::dpl::make_transform_iterator(CF_marker, is_nonnegative()), + oneapi::dpl::make_transform_iterator(CF_marker + n_fine, is_nonnegative()), + fine_to_coarse_d, + HYPRE_Int(0) ); /* *MUST* pass init value since input and output types diff. */ +#else HYPRE_THRUST_CALL( exclusive_scan, thrust::make_transform_iterator(CF_marker, is_nonnegative()), thrust::make_transform_iterator(CF_marker + n_fine, is_nonnegative()), fine_to_coarse_d, HYPRE_Int(0) ); /* *MUST* pass init value since input and output types diff. */ +#endif /* 4. Compute the CSR arrays P_diag_j, P_diag_data, P_offd_j, and P_offd_data */ /* P_diag_i and P_offd_i are now known, first allocate the remaining CSR arrays of P */ @@ -209,29 +268,29 @@ hypre_BoomerAMGBuildDirInterpDevice( hypre_ParCSRMatrix *A, if (interp_type == 3) { - HYPRE_CUDA_LAUNCH( hypre_BoomerAMGBuildDirInterp_getcoef, gDim, bDim, - n_fine, A_diag_i, A_diag_j, A_diag_data, - A_offd_i, A_offd_j, A_offd_data, - hypre_ParCSRMatrixSocDiagJ(S), - hypre_ParCSRMatrixSocOffdJ(S), - CF_marker, CF_marker_offd, - num_functions, dof_func_dev, dof_func_offd, - P_diag_i, P_diag_j, P_diag_data, - P_offd_i, P_offd_j, P_offd_data, - fine_to_coarse_d ); + HYPRE_GPU_LAUNCH( hypre_BoomerAMGBuildDirInterp_getcoef, gDim, bDim, + n_fine, A_diag_i, A_diag_j, A_diag_data, + A_offd_i, A_offd_j, A_offd_data, + Soc_diag_j, + Soc_offd_j, + CF_marker, CF_marker_offd, + num_functions, dof_func, dof_func_offd, + P_diag_i, P_diag_j, P_diag_data, + P_offd_i, P_offd_j, P_offd_data, + fine_to_coarse_d ); } else { - HYPRE_CUDA_LAUNCH( hypre_BoomerAMGBuildDirInterp_getcoef_v2, gDim, bDim, - n_fine, A_diag_i, A_diag_j, A_diag_data, - A_offd_i, A_offd_j, A_offd_data, - hypre_ParCSRMatrixSocDiagJ(S), - hypre_ParCSRMatrixSocOffdJ(S), - CF_marker, CF_marker_offd, - num_functions, dof_func_dev, dof_func_offd, - P_diag_i, P_diag_j, P_diag_data, - P_offd_i, P_offd_j, P_offd_data, - fine_to_coarse_d ); + HYPRE_GPU_LAUNCH( hypre_BoomerAMGBuildDirInterp_getcoef_v2, gDim, bDim, + n_fine, A_diag_i, A_diag_j, A_diag_data, + A_offd_i, A_offd_j, A_offd_data, + Soc_diag_j, + Soc_offd_j, + CF_marker, CF_marker_offd, + num_functions, dof_func, dof_func_offd, + P_diag_i, P_diag_j, P_diag_data, + P_offd_i, P_offd_j, P_offd_data, + fine_to_coarse_d ); } /* !!!! Free them here */ @@ -240,7 +299,11 @@ hypre_BoomerAMGBuildDirInterpDevice( hypre_ParCSRMatrix *A, hypre_TFree(hypre_ParCSRMatrixSocOffdJ(S), HYPRE_MEMORY_DEVICE); */ +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL(std::replace, CF_marker, CF_marker + n_fine, -3, -1); +#else HYPRE_THRUST_CALL(replace, CF_marker, CF_marker + n_fine, -3, -1); +#endif /* 5. Construct the result as a ParCSRMatrix. At this point, P's column indices */ /* are defined with A's enumeration of columns */ @@ -250,7 +313,7 @@ hypre_BoomerAMGBuildDirInterpDevice( hypre_ParCSRMatrix *A, total_global_cpts, hypre_ParCSRMatrixColStarts(A), num_cpts_global, - 0, + num_cols_A_offd, P_diag_size, P_offd_size); @@ -273,63 +336,21 @@ hypre_BoomerAMGBuildDirInterpDevice( hypre_ParCSRMatrix *A, if (trunc_factor != 0.0 || max_elmts > 0) { hypre_BoomerAMGInterpTruncationDevice(P, trunc_factor, max_elmts); - - P_offd_i = hypre_CSRMatrixI(P_offd); - P_offd_j = hypre_CSRMatrixJ(P_offd); - P_offd_size = hypre_CSRMatrixNumNonzeros(P_offd); - /* hypre_TMemcpy(&P_offd_size, &P_offd_i[n_fine], HYPRE_Int, 1, HYPRE_MEMORY_HOST, memory_location); */ } /* 7. Translate P_offd's column indices from the values inherited from A_offd to a 0,1,2,3,... enumeration, */ /* and construct the col_map array that translates these into the global 0..c-1 enumeration */ - if (P_offd_size) - { - /* Array P_marker has length equal to the number of A's offd columns+1, and will */ - /* store a translation code from A_offd's local column numbers to P_offd's local column numbers */ - /* Example: if A_offd has 6 columns, locally 0,1,..,5, and points 1 and 4 are coarse points, then - P_marker=[0,1,0,0,1,0,0], */ - - /* First, set P_marker[i] to 1 if A's column i is also present in P, otherwise P_marker[i] is 0 */ - HYPRE_Int *P_marker = hypre_TAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_DEVICE); - HYPRE_Int *P_colids = hypre_TAlloc(HYPRE_Int, hypre_max(P_offd_size, num_cols_A_offd), HYPRE_MEMORY_DEVICE); - - hypre_TMemcpy(P_colids, P_offd_j, HYPRE_Int, P_offd_size, HYPRE_MEMORY_DEVICE, memory_location); - /* sort and unique */ - HYPRE_THRUST_CALL(sort, P_colids, P_colids + P_offd_size); - HYPRE_Int *new_end = HYPRE_THRUST_CALL(unique, P_colids, P_colids + P_offd_size); - - num_cols_P_offd = new_end - P_colids; - - HYPRE_THRUST_CALL(fill_n, P_marker, num_cols_A_offd, 0); - hypreDevice_ScatterConstant(P_marker, num_cols_P_offd, P_colids, 1); - - /* Because P's columns correspond to P_marker[i]=1 (and =0 otherwise), the scan below will return */ - /* an enumeration of P's columns 0,1,... at the corresponding locations in P_marker. */ - /* P_marker[num_cols_A_offd] will contain num_cols_P_offd, so sum reduction above could */ - /* have been replaced by reading the last element of P_marker. */ - HYPRE_THRUST_CALL(exclusive_scan, P_marker, P_marker + num_cols_A_offd, P_colids); - /* Example: P_marker becomes [0,0,1,1,1,2] so that P_marker[1]=0, P_marker[4]=1 */ - - /* Do the re-enumeration, P_offd_j are mapped, using P_marker as map */ - HYPRE_THRUST_CALL(gather, P_offd_j, P_offd_j + P_offd_size, P_colids, P_offd_j); - - /* Create and define array tmp_map_offd. This array is the inverse of the P_marker mapping, */ - /* Example: num_cols_P_offd=2, tmp_map_offd[0] = 1, tmp_map_offd[1]=4 */ - /* P_colids is large enough to hold */ - new_end = HYPRE_THRUST_CALL(copy_if, - thrust::make_counting_iterator(0), - thrust::make_counting_iterator(num_cols_A_offd), - P_marker, - P_colids, - thrust::identity()); - hypre_assert(new_end - P_colids == num_cols_P_offd); - - tmp_map_offd_h = hypre_TAlloc(HYPRE_Int, num_cols_P_offd, HYPRE_MEMORY_HOST); - hypre_TMemcpy(tmp_map_offd_h, P_colids, HYPRE_Int, num_cols_P_offd, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); - - hypre_TFree(P_colids, HYPRE_MEMORY_DEVICE); - hypre_TFree(P_marker, HYPRE_MEMORY_DEVICE); - } + + /* Array P_marker has length equal to the number of A's offd columns+1, and will */ + /* store a translation code from A_offd's local column numbers to P_offd's local column numbers */ + HYPRE_Int *P_colids; + HYPRE_Int *P_colids_h = NULL; + + hypre_CSRMatrixCompressColumnsDevice(P_offd, NULL, &P_colids, NULL); + P_colids_h = hypre_TAlloc(HYPRE_Int, hypre_CSRMatrixNumCols(P_offd), HYPRE_MEMORY_HOST); + hypre_TMemcpy(P_colids_h, P_colids, HYPRE_Int, hypre_CSRMatrixNumCols(P_offd), + HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); + hypre_TFree(P_colids, HYPRE_MEMORY_DEVICE); /* 8. P_offd_j now has a 0,1,2,3... local column index enumeration. */ /* tmp_map_offd contains the index mapping from P's offd local columns to A's offd local columns.*/ @@ -337,30 +358,31 @@ hypre_BoomerAMGBuildDirInterpDevice( hypre_ParCSRMatrix *A, /* comm_pkg in P, and perhaps more members of P ??? */ fine_to_coarse_h = hypre_TAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); - hypre_TMemcpy(fine_to_coarse_h, fine_to_coarse_d, HYPRE_Int, n_fine, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(fine_to_coarse_h, fine_to_coarse_d, HYPRE_Int, n_fine, HYPRE_MEMORY_HOST, + HYPRE_MEMORY_DEVICE); - hypre_ParCSRMatrixColMapOffd(P) = hypre_CTAlloc(HYPRE_BigInt, num_cols_P_offd, HYPRE_MEMORY_HOST); - hypre_CSRMatrixNumCols(P_offd) = num_cols_P_offd; + hypre_ParCSRMatrixColMapOffd(P) = hypre_CTAlloc(HYPRE_BigInt, hypre_CSRMatrixNumCols(P_offd), + HYPRE_MEMORY_HOST); - hypre_GetCommPkgRTFromCommPkgA(P, A, fine_to_coarse_h, tmp_map_offd_h); + hypre_GetCommPkgRTFromCommPkgA(P, A, fine_to_coarse_h, P_colids_h); *P_ptr = P; hypre_TFree(CF_marker_offd, HYPRE_MEMORY_DEVICE); hypre_TFree(dof_func_offd, HYPRE_MEMORY_DEVICE); - hypre_TFree(dof_func_dev, HYPRE_MEMORY_DEVICE); hypre_TFree(int_buf_data, HYPRE_MEMORY_DEVICE); hypre_TFree(fine_to_coarse_d, HYPRE_MEMORY_DEVICE); hypre_TFree(fine_to_coarse_h, HYPRE_MEMORY_HOST); - hypre_TFree(tmp_map_offd_h, HYPRE_MEMORY_HOST); + hypre_TFree(P_colids_h, HYPRE_MEMORY_HOST); return hypre_error_flag; } /*-----------------------------------------------------------------------*/ - __global__ void -hypre_BoomerAMGBuildDirInterp_getnnz( HYPRE_Int nr_of_rows, +__global__ void +hypre_BoomerAMGBuildDirInterp_getnnz( hypre_DeviceItem &item, + HYPRE_Int nr_of_rows, HYPRE_Int *S_diag_i, HYPRE_Int *S_diag_j, HYPRE_Int *S_offd_i, @@ -397,22 +419,22 @@ hypre_BoomerAMGBuildDirInterp_getnnz( HYPRE_Int nr_of_rows, */ /*-----------------------------------------------------------------------*/ - HYPRE_Int i = hypre_cuda_get_grid_warp_id<1,1>(); + HYPRE_Int i = hypre_gpu_get_grid_warp_id<1, 1>(item); if (i >= nr_of_rows) { return; } - HYPRE_Int p, q, dof_func_i; + HYPRE_Int p = 0, q = 0, dof_func_i = 0; HYPRE_Int jPd = 0, jPo = 0; - HYPRE_Int lane = hypre_cuda_get_lane_id<1>(); + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); if (lane == 0) { p = read_only_load(CF_marker + i); } - p = __shfl_sync(HYPRE_WARP_FULL_MASK, p, 0); + p = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 0); /*-------------------------------------------------------------------- * If i is a C-point, interpolation is the identity. @@ -437,7 +459,7 @@ hypre_BoomerAMGBuildDirInterp_getnnz( HYPRE_Int nr_of_rows, { dof_func_i = read_only_load(&dof_func[i]); } - dof_func_i = __shfl_sync(HYPRE_WARP_FULL_MASK, dof_func_i, 0); + dof_func_i = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, dof_func_i, 0); } /* diag part */ @@ -445,43 +467,45 @@ hypre_BoomerAMGBuildDirInterp_getnnz( HYPRE_Int nr_of_rows, { p = read_only_load(S_diag_i + i + lane); } - q = __shfl_sync(HYPRE_WARP_FULL_MASK, p, 1); - p = __shfl_sync(HYPRE_WARP_FULL_MASK, p, 0); + q = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 1); + p = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 0); - for (HYPRE_Int j = p + lane; __any_sync(HYPRE_WARP_FULL_MASK, j < q); j += HYPRE_WARP_SIZE) + for (HYPRE_Int j = p + lane; warp_any_sync(item, HYPRE_WARP_FULL_MASK, j < q); j += HYPRE_WARP_SIZE) { if (j < q) { const HYPRE_Int col = read_only_load(&S_diag_j[j]); - if ( read_only_load(&CF_marker[col]) > 0 && (num_functions == 1 || read_only_load(&dof_func[col]) == dof_func_i) ) + if ( read_only_load(&CF_marker[col]) > 0 && (num_functions == 1 || + read_only_load(&dof_func[col]) == dof_func_i) ) { jPd++; } } } - jPd = warp_reduce_sum(jPd); + jPd = warp_reduce_sum(item, jPd); /* offd part */ if (lane < 2) { p = read_only_load(S_offd_i + i + lane); } - q = __shfl_sync(HYPRE_WARP_FULL_MASK, p, 1); - p = __shfl_sync(HYPRE_WARP_FULL_MASK, p, 0); + q = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 1); + p = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 0); - for (HYPRE_Int j = p + lane; __any_sync(HYPRE_WARP_FULL_MASK, j < q); j += HYPRE_WARP_SIZE) + for (HYPRE_Int j = p + lane; warp_any_sync(item, HYPRE_WARP_FULL_MASK, j < q); j += HYPRE_WARP_SIZE) { if (j < q) { const HYPRE_Int tmp = read_only_load(&S_offd_j[j]); const HYPRE_Int col = tmp; - if ( read_only_load(&CF_marker_offd[col]) > 0 && (num_functions == 1 || read_only_load(&dof_func_offd[col]) == dof_func_i) ) + if ( read_only_load(&CF_marker_offd[col]) > 0 && (num_functions == 1 || + read_only_load(&dof_func_offd[col]) == dof_func_i) ) { jPo++; } } } - jPo = warp_reduce_sum(jPo); + jPo = warp_reduce_sum(item, jPo); if (lane == 0) { @@ -492,8 +516,9 @@ hypre_BoomerAMGBuildDirInterp_getnnz( HYPRE_Int nr_of_rows, /*-----------------------------------------------------------------------* *-----------------------------------------------------------------------*/ - __global__ void -hypre_BoomerAMGBuildDirInterp_getcoef( HYPRE_Int nr_of_rows, +__global__ void +hypre_BoomerAMGBuildDirInterp_getcoef( hypre_DeviceItem &item, + HYPRE_Int nr_of_rows, HYPRE_Int *A_diag_i, HYPRE_Int *A_diag_j, HYPRE_Real *A_diag_data, @@ -537,22 +562,22 @@ hypre_BoomerAMGBuildDirInterp_getcoef( HYPRE_Int nr_of_rows, */ /*-----------------------------------------------------------------------*/ - HYPRE_Int i = hypre_cuda_get_grid_warp_id<1,1>(); + HYPRE_Int i = hypre_gpu_get_grid_warp_id<1, 1>(item); if (i >= nr_of_rows) { return; } - HYPRE_Int lane = hypre_cuda_get_lane_id<1>(); + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); - HYPRE_Int k, dof_func_i; + HYPRE_Int k = 0, dof_func_i = 0; if (lane == 0) { k = read_only_load(CF_marker + i); } - k = __shfl_sync(HYPRE_WARP_FULL_MASK, k, 0); + k = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, k, 0); /*-------------------------------------------------------------------- * If i is a C-point, interpolation is the identity. @@ -578,25 +603,26 @@ hypre_BoomerAMGBuildDirInterp_getcoef( HYPRE_Int nr_of_rows, { dof_func_i = read_only_load(&dof_func[i]); } - dof_func_i = __shfl_sync(HYPRE_WARP_FULL_MASK, dof_func_i, 0); + dof_func_i = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, dof_func_i, 0); } HYPRE_Real diagonal = 0.0, sum_N_pos = 0.0, sum_N_neg = 0.0, sum_P_pos = 0.0, sum_P_neg = 0.0; /* diag part */ - HYPRE_Int p_diag_A, q_diag_A, p_diag_P, q_diag_P; + HYPRE_Int p_diag_A = 0, q_diag_A, p_diag_P = 0, q_diag_P; if (lane < 2) { p_diag_A = read_only_load(A_diag_i + i + lane); p_diag_P = read_only_load(P_diag_i + i + lane); } - q_diag_A = __shfl_sync(HYPRE_WARP_FULL_MASK, p_diag_A, 1); - p_diag_A = __shfl_sync(HYPRE_WARP_FULL_MASK, p_diag_A, 0); - q_diag_P = __shfl_sync(HYPRE_WARP_FULL_MASK, p_diag_P, 1); - p_diag_P = __shfl_sync(HYPRE_WARP_FULL_MASK, p_diag_P, 0); + q_diag_A = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_diag_A, 1); + p_diag_A = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_diag_A, 0); + q_diag_P = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_diag_P, 1); + p_diag_P = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_diag_P, 0); k = p_diag_P; - for (HYPRE_Int j = p_diag_A + lane; __any_sync(HYPRE_WARP_FULL_MASK, j < q_diag_A); j += HYPRE_WARP_SIZE) + for (HYPRE_Int j = p_diag_A + lane; warp_any_sync(item, HYPRE_WARP_FULL_MASK, j < q_diag_A); + j += HYPRE_WARP_SIZE) { HYPRE_Int col, sum, pos; HYPRE_Int is_SC = 0; /* if is a Strong-C */ @@ -639,7 +665,7 @@ hypre_BoomerAMGBuildDirInterp_getcoef( HYPRE_Int nr_of_rows, } } - pos = warp_prefix_sum(lane, is_SC, sum); + pos = warp_prefix_sum(item, lane, is_SC, sum); if (is_SC) { @@ -652,19 +678,20 @@ hypre_BoomerAMGBuildDirInterp_getcoef( HYPRE_Int nr_of_rows, hypre_device_assert(k == q_diag_P); /* offd part */ - HYPRE_Int p_offd_A, q_offd_A, p_offd_P, q_offd_P; + HYPRE_Int p_offd_A = 0, q_offd_A, p_offd_P = 0, q_offd_P; if (lane < 2) { p_offd_A = read_only_load(A_offd_i + i + lane); p_offd_P = read_only_load(P_offd_i + i + lane); } - q_offd_A = __shfl_sync(HYPRE_WARP_FULL_MASK, p_offd_A, 1); - p_offd_A = __shfl_sync(HYPRE_WARP_FULL_MASK, p_offd_A, 0); - q_offd_P = __shfl_sync(HYPRE_WARP_FULL_MASK, p_offd_P, 1); - p_offd_P = __shfl_sync(HYPRE_WARP_FULL_MASK, p_offd_P, 0); + q_offd_A = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_offd_A, 1); + p_offd_A = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_offd_A, 0); + q_offd_P = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_offd_P, 1); + p_offd_P = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_offd_P, 0); k = p_offd_P; - for (HYPRE_Int j = p_offd_A + lane; __any_sync(HYPRE_WARP_FULL_MASK, j < q_offd_A); j += HYPRE_WARP_SIZE) + for (HYPRE_Int j = p_offd_A + lane; warp_any_sync(item, HYPRE_WARP_FULL_MASK, j < q_offd_A); + j += HYPRE_WARP_SIZE) { HYPRE_Int col, sum, pos; HYPRE_Int is_SC = 0; /* if is a Strong-C */ @@ -703,7 +730,7 @@ hypre_BoomerAMGBuildDirInterp_getcoef( HYPRE_Int nr_of_rows, } } - pos = warp_prefix_sum(lane, is_SC, sum); + pos = warp_prefix_sum(item, lane, is_SC, sum); if (is_SC) { @@ -715,11 +742,11 @@ hypre_BoomerAMGBuildDirInterp_getcoef( HYPRE_Int nr_of_rows, hypre_device_assert(k == q_offd_P); - diagonal = warp_allreduce_sum(diagonal); - sum_N_pos = warp_allreduce_sum(sum_N_pos); - sum_N_neg = warp_allreduce_sum(sum_N_neg); - sum_P_pos = warp_allreduce_sum(sum_P_pos); - sum_P_neg = warp_allreduce_sum(sum_P_neg); + diagonal = warp_allreduce_sum(item, diagonal); + sum_N_pos = warp_allreduce_sum(item, sum_N_pos); + sum_N_neg = warp_allreduce_sum(item, sum_N_neg); + sum_P_pos = warp_allreduce_sum(item, sum_P_pos); + sum_P_neg = warp_allreduce_sum(item, sum_P_neg); HYPRE_Complex alfa = 1.0, beta = 1.0; @@ -733,7 +760,8 @@ hypre_BoomerAMGBuildDirInterp_getcoef( HYPRE_Int nr_of_rows, beta = sum_N_pos / (sum_P_pos * diagonal); } - for (HYPRE_Int j = p_diag_P + lane; __any_sync(HYPRE_WARP_FULL_MASK, j < q_diag_P); j += HYPRE_WARP_SIZE) + for (HYPRE_Int j = p_diag_P + lane; warp_any_sync(item, HYPRE_WARP_FULL_MASK, j < q_diag_P); + j += HYPRE_WARP_SIZE) { /* if (P_diag_data[j] > 0.0) P_diag_data[j] *= -beta; @@ -741,11 +769,12 @@ hypre_BoomerAMGBuildDirInterp_getcoef( HYPRE_Int nr_of_rows, P_diag_data[j] *= -alfa; */ if (j < q_diag_P) { - P_diag_data[j] *= (P_diag_data[j] > 0.0) * (alfa-beta) - alfa; + P_diag_data[j] *= (P_diag_data[j] > 0.0) * (alfa - beta) - alfa; } } - for (HYPRE_Int j = p_offd_P + lane; __any_sync(HYPRE_WARP_FULL_MASK, j < q_offd_P); j += HYPRE_WARP_SIZE) + for (HYPRE_Int j = p_offd_P + lane; warp_any_sync(item, HYPRE_WARP_FULL_MASK, j < q_offd_P); + j += HYPRE_WARP_SIZE) { /* if (P_offd_data[indp]> 0) P_offd_data[indp] *= -beta; @@ -753,15 +782,16 @@ hypre_BoomerAMGBuildDirInterp_getcoef( HYPRE_Int nr_of_rows, P_offd_data[indp] *= -alfa; */ if (j < q_offd_P) { - P_offd_data[j] *= (P_offd_data[j] > 0.0) * (alfa-beta) - alfa; + P_offd_data[j] *= (P_offd_data[j] > 0.0) * (alfa - beta) - alfa; } } } /*-----------------------------------------------------------------------* *-----------------------------------------------------------------------*/ - __global__ void -hypre_BoomerAMGBuildDirInterp_getcoef_v2( HYPRE_Int nr_of_rows, +__global__ void +hypre_BoomerAMGBuildDirInterp_getcoef_v2( hypre_DeviceItem &item, + HYPRE_Int nr_of_rows, HYPRE_Int *A_diag_i, HYPRE_Int *A_diag_j, HYPRE_Real *A_diag_data, @@ -805,22 +835,22 @@ hypre_BoomerAMGBuildDirInterp_getcoef_v2( HYPRE_Int nr_of_rows, */ /*-----------------------------------------------------------------------*/ - HYPRE_Int i = hypre_cuda_get_grid_warp_id<1,1>(); + HYPRE_Int i = hypre_gpu_get_grid_warp_id<1, 1>(item); if (i >= nr_of_rows) { return; } - HYPRE_Int lane = hypre_cuda_get_lane_id<1>(); + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); - HYPRE_Int k, dof_func_i; + HYPRE_Int k = 0, dof_func_i = 0; if (lane == 0) { k = read_only_load(CF_marker + i); } - k = __shfl_sync(HYPRE_WARP_FULL_MASK, k, 0); + k = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, k, 0); /*-------------------------------------------------------------------- * If i is a C-point, interpolation is the identity. @@ -846,25 +876,26 @@ hypre_BoomerAMGBuildDirInterp_getcoef_v2( HYPRE_Int nr_of_rows, { dof_func_i = read_only_load(&dof_func[i]); } - dof_func_i = __shfl_sync(HYPRE_WARP_FULL_MASK, dof_func_i, 0); + dof_func_i = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, dof_func_i, 0); } HYPRE_Real diagonal = 0.0, sum_F = 0.0; /* diag part */ - HYPRE_Int p_diag_A, q_diag_A, p_diag_P, q_diag_P; + HYPRE_Int p_diag_A = 0, q_diag_A, p_diag_P = 0, q_diag_P; if (lane < 2) { p_diag_A = read_only_load(A_diag_i + i + lane); p_diag_P = read_only_load(P_diag_i + i + lane); } - q_diag_A = __shfl_sync(HYPRE_WARP_FULL_MASK, p_diag_A, 1); - p_diag_A = __shfl_sync(HYPRE_WARP_FULL_MASK, p_diag_A, 0); - q_diag_P = __shfl_sync(HYPRE_WARP_FULL_MASK, p_diag_P, 1); - p_diag_P = __shfl_sync(HYPRE_WARP_FULL_MASK, p_diag_P, 0); + q_diag_A = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_diag_A, 1); + p_diag_A = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_diag_A, 0); + q_diag_P = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_diag_P, 1); + p_diag_P = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_diag_P, 0); k = p_diag_P; - for (HYPRE_Int j = p_diag_A + lane; __any_sync(HYPRE_WARP_FULL_MASK, j < q_diag_A); j += HYPRE_WARP_SIZE) + for (HYPRE_Int j = p_diag_A + lane; warp_any_sync(item, HYPRE_WARP_FULL_MASK, j < q_diag_A); + j += HYPRE_WARP_SIZE) { HYPRE_Int col, sum, pos; HYPRE_Int is_SC = 0; /* if is a Strong-C */ @@ -899,7 +930,7 @@ hypre_BoomerAMGBuildDirInterp_getcoef_v2( HYPRE_Int nr_of_rows, } } - pos = warp_prefix_sum(lane, is_SC, sum); + pos = warp_prefix_sum(item, lane, is_SC, sum); if (is_SC) { @@ -912,19 +943,20 @@ hypre_BoomerAMGBuildDirInterp_getcoef_v2( HYPRE_Int nr_of_rows, hypre_device_assert(k == q_diag_P); /* offd part */ - HYPRE_Int p_offd_A, q_offd_A, p_offd_P, q_offd_P; + HYPRE_Int p_offd_A = 0, q_offd_A, p_offd_P = 0, q_offd_P; if (lane < 2) { p_offd_A = read_only_load(A_offd_i + i + lane); p_offd_P = read_only_load(P_offd_i + i + lane); } - q_offd_A = __shfl_sync(HYPRE_WARP_FULL_MASK, p_offd_A, 1); - p_offd_A = __shfl_sync(HYPRE_WARP_FULL_MASK, p_offd_A, 0); - q_offd_P = __shfl_sync(HYPRE_WARP_FULL_MASK, p_offd_P, 1); - p_offd_P = __shfl_sync(HYPRE_WARP_FULL_MASK, p_offd_P, 0); + q_offd_A = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_offd_A, 1); + p_offd_A = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_offd_A, 0); + q_offd_P = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_offd_P, 1); + p_offd_P = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_offd_P, 0); k = p_offd_P; - for (HYPRE_Int j = p_offd_A + lane; __any_sync(HYPRE_WARP_FULL_MASK, j < q_offd_A); j += HYPRE_WARP_SIZE) + for (HYPRE_Int j = p_offd_A + lane; warp_any_sync(item, HYPRE_WARP_FULL_MASK, j < q_offd_A); + j += HYPRE_WARP_SIZE) { HYPRE_Int col, sum, pos; HYPRE_Int is_SC = 0; /* if is a Strong-C */ @@ -955,7 +987,7 @@ hypre_BoomerAMGBuildDirInterp_getcoef_v2( HYPRE_Int nr_of_rows, } } - pos = warp_prefix_sum(lane, is_SC, sum); + pos = warp_prefix_sum(item, lane, is_SC, sum); if (is_SC) { @@ -967,12 +999,13 @@ hypre_BoomerAMGBuildDirInterp_getcoef_v2( HYPRE_Int nr_of_rows, hypre_device_assert(k == q_offd_P); - diagonal = warp_allreduce_sum(diagonal); - sum_F = warp_allreduce_sum(sum_F); + diagonal = warp_allreduce_sum(item, diagonal); + sum_F = warp_allreduce_sum(item, sum_F); HYPRE_Complex beta = sum_F / (q_diag_P - p_diag_P + q_offd_P - p_offd_P); - for (HYPRE_Int j = p_diag_P + lane; __any_sync(HYPRE_WARP_FULL_MASK, j < q_diag_P); j += HYPRE_WARP_SIZE) + for (HYPRE_Int j = p_diag_P + lane; warp_any_sync(item, HYPRE_WARP_FULL_MASK, j < q_diag_P); + j += HYPRE_WARP_SIZE) { /* if (P_diag_data[j] > 0.0) P_diag_data[j] *= -beta; @@ -984,7 +1017,8 @@ hypre_BoomerAMGBuildDirInterp_getcoef_v2( HYPRE_Int nr_of_rows, } } - for (HYPRE_Int j = p_offd_P + lane; __any_sync(HYPRE_WARP_FULL_MASK, j < q_offd_P); j += HYPRE_WARP_SIZE) + for (HYPRE_Int j = p_offd_P + lane; warp_any_sync(item, HYPRE_WARP_FULL_MASK, j < q_offd_P); + j += HYPRE_WARP_SIZE) { /* if (P_offd_data[indp]> 0) P_offd_data[indp] *= -beta; @@ -1007,6 +1041,11 @@ hypre_BoomerAMGBuildInterpOnePntDevice( hypre_ParCSRMatrix *A, HYPRE_Int debug_flag, hypre_ParCSRMatrix **P_ptr) { + HYPRE_UNUSED_VAR(num_cpts_global); + HYPRE_UNUSED_VAR(num_functions); + HYPRE_UNUSED_VAR(dof_func); + HYPRE_UNUSED_VAR(debug_flag); + MPI_Comm comm = hypre_ParCSRMatrixComm(A); hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); hypre_ParCSRCommHandle *comm_handle; @@ -1063,19 +1102,27 @@ hypre_BoomerAMGBuildInterpOnePntDevice( hypre_ParCSRMatrix *A, HYPRE_Int *offd_compress_marker; hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_rank(comm, &my_id); my_first_cpt = num_cpts_global[0]; - if (my_id == (num_procs -1)) total_global_cpts = num_cpts_global[1]; - hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); + if (my_id == (num_procs - 1)) { total_global_cpts = num_cpts_global[1]; } + hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); /* fine to coarse mapping */ fine_to_coarse = hypre_TAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::exclusive_scan, + oneapi::dpl::make_transform_iterator(CF_marker, is_nonnegative()), + oneapi::dpl::make_transform_iterator(CF_marker + n_fine, is_nonnegative()), + fine_to_coarse, + HYPRE_Int(0) ); /* *MUST* pass init value since input and output types diff. */ +#else HYPRE_THRUST_CALL( exclusive_scan, thrust::make_transform_iterator(CF_marker, is_nonnegative()), thrust::make_transform_iterator(CF_marker + n_fine, is_nonnegative()), fine_to_coarse, HYPRE_Int(0) ); /* *MUST* pass init value since input and output types diff. */ +#endif /*------------------------------------------------------------------- * Get the CF_marker data for the off-processor columns @@ -1094,17 +1141,36 @@ hypre_BoomerAMGBuildInterpOnePntDevice( hypre_ParCSRMatrix *A, num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); /* send buffer, of size send_map_starts[num_sends]), * i.e., number of entries to send */ - int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), HYPRE_MEMORY_DEVICE); + int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_DEVICE); /* copy CF markers of elements to send to buffer */ +#if defined(HYPRE_USING_SYCL) + hypreSycl_gather( hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + + hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + CF_marker, + int_buf_data ); +#else HYPRE_THRUST_CALL( gather, hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), CF_marker, int_buf_data ); +#endif + +#if defined(HYPRE_USING_THRUST_NOSYNC) + /* RL: make sure int_buf_data is ready before issuing GPU-GPU MPI */ + if (hypre_GetGpuAwareMPI()) + { + hypre_ForceSyncComputeStream(); + } +#endif + /* create a handle to start communication. 11: for integer */ - comm_handle = hypre_ParCSRCommHandleCreate_v2(11, comm_pkg, HYPRE_MEMORY_DEVICE, int_buf_data, HYPRE_MEMORY_DEVICE, CF_marker_offd); + comm_handle = hypre_ParCSRCommHandleCreate_v2(11, comm_pkg, HYPRE_MEMORY_DEVICE, int_buf_data, + HYPRE_MEMORY_DEVICE, CF_marker_offd); /* destroy the handle to finish communication */ hypre_ParCSRCommHandleDestroy(comm_handle); hypre_TFree(int_buf_data, HYPRE_MEMORY_DEVICE); @@ -1114,8 +1180,8 @@ hypre_BoomerAMGBuildInterpOnePntDevice( hypre_ParCSRMatrix *A, * and find the most strongly influencing C-pt for each F-pt *-----------------------------------------------------------------------*/ - P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, HYPRE_MEMORY_DEVICE); - P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, HYPRE_MEMORY_DEVICE); + P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, HYPRE_MEMORY_DEVICE); + P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, HYPRE_MEMORY_DEVICE); diag_compress_marker = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_DEVICE); offd_compress_marker = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_DEVICE); @@ -1124,19 +1190,32 @@ hypre_BoomerAMGBuildInterpOnePntDevice( hypre_ParCSRMatrix *A, P_diag_j_temp = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_DEVICE); P_offd_j_temp = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_DEVICE); - dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(n_fine, "warp", bDim); + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(n_fine, "warp", bDim); - HYPRE_CUDA_LAUNCH( hypre_BoomerAMGBuildInterpOnePnt_getnnz, gDim, bDim, - n_fine, A_diag_i, A_strong_diag_j, A_diag_a, A_offd_i, A_strong_offd_j, - A_offd_a, CF_marker, CF_marker_offd, diag_compress_marker, - offd_compress_marker, P_diag_i, P_diag_j_temp, P_offd_i, P_offd_j_temp); + HYPRE_GPU_LAUNCH( hypre_BoomerAMGBuildInterpOnePnt_getnnz, gDim, bDim, + n_fine, A_diag_i, A_strong_diag_j, A_diag_a, A_offd_i, A_strong_offd_j, + A_offd_a, CF_marker, CF_marker_offd, diag_compress_marker, + offd_compress_marker, P_diag_i, P_diag_j_temp, P_offd_i, P_offd_j_temp); /*----------------------------------------------------------------------- * Send and receive fine_to_coarse info. *-----------------------------------------------------------------------*/ - fine_to_coarse_offd = hypre_CTAlloc(HYPRE_BigInt, num_cols_A_offd,HYPRE_MEMORY_DEVICE); - big_int_buf_data = hypre_CTAlloc(HYPRE_BigInt, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), HYPRE_MEMORY_DEVICE); + fine_to_coarse_offd = hypre_CTAlloc(HYPRE_BigInt, num_cols_A_offd, HYPRE_MEMORY_DEVICE); + big_int_buf_data = hypre_CTAlloc(HYPRE_BigInt, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_SYCL) + hypreSycl_gather( hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + + hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + fine_to_coarse, + big_int_buf_data ); + HYPRE_ONEDPL_CALL( std::transform, + big_int_buf_data, + big_int_buf_data + hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + big_int_buf_data, + [my_first_cpt = my_first_cpt] (const auto & x) { return x + my_first_cpt; } ); +#else HYPRE_THRUST_CALL( gather, hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + @@ -1149,7 +1228,18 @@ hypre_BoomerAMGBuildInterpOnePntDevice( hypre_ParCSRMatrix *A, thrust::make_constant_iterator(my_first_cpt), big_int_buf_data, thrust::plus() ); - comm_handle = hypre_ParCSRCommHandleCreate_v2(21, comm_pkg, HYPRE_MEMORY_DEVICE, big_int_buf_data, HYPRE_MEMORY_DEVICE, fine_to_coarse_offd); +#endif + +#if defined(HYPRE_USING_THRUST_NOSYNC) + /* RL: make sure big_int_buf_data is ready before issuing GPU-GPU MPI */ + if (hypre_GetGpuAwareMPI()) + { + hypre_ForceSyncComputeStream(); + } +#endif + + comm_handle = hypre_ParCSRCommHandleCreate_v2(21, comm_pkg, HYPRE_MEMORY_DEVICE, big_int_buf_data, + HYPRE_MEMORY_DEVICE, fine_to_coarse_offd); hypre_ParCSRCommHandleDestroy(comm_handle); hypre_TFree(big_int_buf_data, HYPRE_MEMORY_DEVICE); @@ -1158,8 +1248,8 @@ hypre_BoomerAMGBuildInterpOnePntDevice( hypre_ParCSRMatrix *A, *-----------------------------------------------------------------------*/ /* scan P_diag_i (which has number of nonzeros in each row) to get row indices */ - hypreDevice_IntegerExclusiveScan(n_fine+1, P_diag_i); - hypreDevice_IntegerExclusiveScan(n_fine+1, P_offd_i); + hypreDevice_IntegerExclusiveScan(n_fine + 1, P_diag_i); + hypreDevice_IntegerExclusiveScan(n_fine + 1, P_offd_i); /* get the number of nonzeros and allocate column index and data arrays */ hypre_TMemcpy(&nnz_diag, &P_diag_i[n_fine], HYPRE_Int, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); @@ -1173,19 +1263,31 @@ hypre_BoomerAMGBuildInterpOnePntDevice( hypre_ParCSRMatrix *A, P_offd_data = hypre_TAlloc(HYPRE_Real, nnz_offd, HYPRE_MEMORY_DEVICE); /* set data values to 1.0 */ - HYPRE_THRUST_CALL( fill_n, - P_diag_data, - nnz_diag, - 1.0 ); - HYPRE_THRUST_CALL( fill_n, - P_offd_data, - nnz_offd, - 1.0 ); + hypreDevice_ComplexFilln( P_diag_data, nnz_diag, 1.0 ); + hypreDevice_ComplexFilln( P_offd_data, nnz_offd, 1.0 ); /* compress temporary column indices */ P_diag_j_temp_compressed = hypre_TAlloc(HYPRE_Int, nnz_diag, HYPRE_MEMORY_DEVICE); P_offd_j_temp_compressed = hypre_TAlloc(HYPRE_Int, nnz_offd, HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_SYCL) + hypreSycl_copy_if( P_diag_j_temp, + P_diag_j_temp + n_fine, + diag_compress_marker, + P_diag_j_temp_compressed, + equal(1) ); + hypreSycl_copy_if( P_offd_j_temp, + P_offd_j_temp + n_fine, + offd_compress_marker, + P_offd_j_temp_compressed, + equal(1) ); + + /* map the diag column indices */ + hypreSycl_gather( P_diag_j_temp_compressed, + P_diag_j_temp_compressed + nnz_diag, + fine_to_coarse, + P_diag_j ); +#else HYPRE_THRUST_CALL( copy_if, P_diag_j_temp, P_diag_j_temp + n_fine, @@ -1205,36 +1307,69 @@ hypre_BoomerAMGBuildInterpOnePntDevice( hypre_ParCSRMatrix *A, P_diag_j_temp_compressed + nnz_diag, fine_to_coarse, P_diag_j ); +#endif + + hypre_TFree(P_diag_j_temp_compressed, HYPRE_MEMORY_DEVICE); /* mark the offd indices for P as a subset of offd indices of A */ HYPRE_Int *mark_P_offd_idx = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_DEVICE); // note that scatter is usually not safe if the same index appears more than once in the map, // but here we are just scattering constant values, so this is safe +#if defined(HYPRE_USING_SYCL) + auto perm_iter = oneapi::dpl::make_permutation_iterator(mark_P_offd_idx, P_offd_j_temp_compressed); + HYPRE_ONEDPL_CALL( std::transform, + perm_iter, + perm_iter + nnz_offd, + perm_iter, + [] (const auto & x) { return 1; } ); + num_cols_P_offd = HYPRE_ONEDPL_CALL(std::reduce, mark_P_offd_idx, + mark_P_offd_idx + num_cols_A_offd); +#else HYPRE_THRUST_CALL( scatter, thrust::make_constant_iterator(1), thrust::make_constant_iterator(1) + nnz_offd, P_offd_j_temp_compressed, mark_P_offd_idx ); num_cols_P_offd = HYPRE_THRUST_CALL(reduce, mark_P_offd_idx, mark_P_offd_idx + num_cols_A_offd); +#endif /* get a mapping from P offd indices to A offd indices */ /* offd_map_P_to_A[ P offd idx ] = A offd idx */ HYPRE_Int *offd_map_P_to_A = hypre_CTAlloc(HYPRE_Int, num_cols_P_offd, HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_SYCL) + oneapi::dpl::counting_iterator count(0); + hypreSycl_copy_if( count, + count + num_cols_A_offd, + mark_P_offd_idx, + offd_map_P_to_A, + equal(1) ); +#else HYPRE_THRUST_CALL( copy_if, thrust::make_counting_iterator(0), thrust::make_counting_iterator(num_cols_A_offd), mark_P_offd_idx, offd_map_P_to_A, equal(1) ); +#endif hypre_TFree(mark_P_offd_idx, HYPRE_MEMORY_DEVICE); /* also get an inverse mapping from A offd indices to P offd indices */ /* offd_map_A_to_P[ A offd idx ] = -1 if not a P idx, else P offd idx */ HYPRE_Int *offd_map_A_to_P = hypre_TAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_DEVICE); - HYPRE_THRUST_CALL( fill_n, - offd_map_A_to_P, - num_cols_A_offd, - -1 ); + hypreDevice_IntFilln( offd_map_A_to_P, num_cols_A_offd, -1 ); + +#if defined(HYPRE_USING_SYCL) + hypreSycl_scatter( count, + count + num_cols_P_offd, + offd_map_P_to_A, + offd_map_A_to_P ); + + /* use inverse mapping above to map P_offd_j */ + hypreSycl_gather( P_offd_j_temp_compressed, + P_offd_j_temp_compressed + nnz_offd, + offd_map_A_to_P, + P_offd_j ); +#else HYPRE_THRUST_CALL( scatter, thrust::make_counting_iterator(0), thrust::make_counting_iterator(num_cols_P_offd), @@ -1247,18 +1382,27 @@ hypre_BoomerAMGBuildInterpOnePntDevice( hypre_ParCSRMatrix *A, P_offd_j_temp_compressed + nnz_offd, offd_map_A_to_P, P_offd_j ); +#endif hypre_TFree(P_offd_j_temp_compressed, HYPRE_MEMORY_DEVICE); hypre_TFree(offd_map_A_to_P, HYPRE_MEMORY_DEVICE); /* setup col_map_offd for P */ col_map_offd_P_device = hypre_CTAlloc(HYPRE_BigInt, num_cols_P_offd, HYPRE_MEMORY_DEVICE); col_map_offd_P = hypre_CTAlloc(HYPRE_BigInt, num_cols_P_offd, HYPRE_MEMORY_HOST); +#if defined(HYPRE_USING_SYCL) + hypreSycl_gather( offd_map_P_to_A, + offd_map_P_to_A + num_cols_P_offd, + fine_to_coarse_offd, + col_map_offd_P_device); +#else HYPRE_THRUST_CALL( gather, offd_map_P_to_A, offd_map_P_to_A + num_cols_P_offd, fine_to_coarse_offd, col_map_offd_P_device); - hypre_TMemcpy(col_map_offd_P, col_map_offd_P_device, HYPRE_BigInt, num_cols_P_offd, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); +#endif + hypre_TMemcpy(col_map_offd_P, col_map_offd_P_device, HYPRE_BigInt, num_cols_P_offd, + HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); hypre_TFree(offd_map_P_to_A, HYPRE_MEMORY_DEVICE); hypre_TFree(col_map_offd_P_device, HYPRE_MEMORY_DEVICE); @@ -1293,13 +1437,18 @@ hypre_BoomerAMGBuildInterpOnePntDevice( hypre_ParCSRMatrix *A, hypre_TFree(CF_marker_offd, HYPRE_MEMORY_DEVICE); hypre_TFree(fine_to_coarse, HYPRE_MEMORY_DEVICE); hypre_TFree(fine_to_coarse_offd, HYPRE_MEMORY_DEVICE); + hypre_TFree(diag_compress_marker, HYPRE_MEMORY_DEVICE); + hypre_TFree(offd_compress_marker, HYPRE_MEMORY_DEVICE); + hypre_TFree(P_diag_j_temp, HYPRE_MEMORY_DEVICE); + hypre_TFree(P_offd_j_temp, HYPRE_MEMORY_DEVICE); return hypre_error_flag; } /*-----------------------------------------------------------------------*/ __global__ void -hypre_BoomerAMGBuildInterpOnePnt_getnnz( HYPRE_Int nr_of_rows, +hypre_BoomerAMGBuildInterpOnePnt_getnnz( hypre_DeviceItem &item, + HYPRE_Int nr_of_rows, HYPRE_Int *A_diag_i, HYPRE_Int *A_strong_diag_j, HYPRE_Complex *A_diag_a, @@ -1339,16 +1488,16 @@ hypre_BoomerAMGBuildInterpOnePnt_getnnz( HYPRE_Int nr_of_rows, */ /*-----------------------------------------------------------------------*/ - HYPRE_Int i = hypre_cuda_get_grid_warp_id<1,1>(); + HYPRE_Int i = hypre_gpu_get_grid_warp_id<1, 1>(item); if (i >= nr_of_rows) { return; } - HYPRE_Int p, q; + HYPRE_Int p = 0, q; HYPRE_Int max_j_diag = -1, max_j_offd = -1; - HYPRE_Int lane = hypre_cuda_get_lane_id<1>(); + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); HYPRE_Real max_diag = -1.0, max_offd = -1.0; HYPRE_Real warp_max_diag = -1.0, warp_max_offd = -1.0; @@ -1356,7 +1505,7 @@ hypre_BoomerAMGBuildInterpOnePnt_getnnz( HYPRE_Int nr_of_rows, { p = read_only_load(CF_marker + i); } - p = __shfl_sync(HYPRE_WARP_FULL_MASK, p, 0); + p = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 0); /*-------------------------------------------------------------------- * If i is a C-point, interpolation is the identity. @@ -1382,8 +1531,8 @@ hypre_BoomerAMGBuildInterpOnePnt_getnnz( HYPRE_Int nr_of_rows, { p = read_only_load(A_diag_i + i + lane); } - q = __shfl_sync(HYPRE_WARP_FULL_MASK, p, 1); - p = __shfl_sync(HYPRE_WARP_FULL_MASK, p, 0); + q = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 1); + p = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 0); for (HYPRE_Int j = p + lane; j < q; j += HYPRE_WARP_SIZE) { @@ -1391,7 +1540,7 @@ hypre_BoomerAMGBuildInterpOnePnt_getnnz( HYPRE_Int nr_of_rows, const HYPRE_Int col = read_only_load(&A_strong_diag_j[j]); if (col >= 0) { - const HYPRE_Complex val = fabs( read_only_load(&A_diag_a[j]) ); + const HYPRE_Complex val = hypre_abs( read_only_load(&A_diag_a[j]) ); if ( read_only_load(&CF_marker[col]) > 0 && val > max_diag ) { max_diag = val; @@ -1399,15 +1548,15 @@ hypre_BoomerAMGBuildInterpOnePnt_getnnz( HYPRE_Int nr_of_rows, } } } - warp_max_diag = warp_allreduce_max(max_diag); + warp_max_diag = warp_allreduce_max(item, max_diag); /* offd part */ if (lane < 2) { p = read_only_load(A_offd_i + i + lane); } - q = __shfl_sync(HYPRE_WARP_FULL_MASK, p, 1); - p = __shfl_sync(HYPRE_WARP_FULL_MASK, p, 0); + q = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 1); + p = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 0); for (HYPRE_Int j = p + lane; j < q; j += HYPRE_WARP_SIZE) { @@ -1415,7 +1564,7 @@ hypre_BoomerAMGBuildInterpOnePnt_getnnz( HYPRE_Int nr_of_rows, /* column indices are negative for weak connections */ if (col >= 0) { - const HYPRE_Complex val = fabs( read_only_load(&A_offd_a[j]) ); + const HYPRE_Complex val = hypre_abs( read_only_load(&A_offd_a[j]) ); if ( read_only_load(&CF_marker_offd[col]) > 0 && val > max_offd ) { max_offd = val; @@ -1423,7 +1572,7 @@ hypre_BoomerAMGBuildInterpOnePnt_getnnz( HYPRE_Int nr_of_rows, } } } - warp_max_offd = warp_allreduce_max(max_offd); + warp_max_offd = warp_allreduce_max(item, max_offd); /*-------------------------------------------------------------------- * If no max found, then there is no strongly connected C-point, @@ -1445,7 +1594,7 @@ hypre_BoomerAMGBuildInterpOnePnt_getnnz( HYPRE_Int nr_of_rows, { max_j_offd = -1; } - max_j_offd = warp_reduce_max(max_j_offd); + max_j_offd = warp_reduce_max(item, max_j_offd); if (lane == 0) { P_offd_i[i] = 1; @@ -1459,7 +1608,7 @@ hypre_BoomerAMGBuildInterpOnePnt_getnnz( HYPRE_Int nr_of_rows, { max_j_diag = -1; } - max_j_diag = warp_reduce_max(max_j_diag); + max_j_diag = warp_reduce_max(item, max_j_diag); if (lane == 0) { P_diag_i[i] = 1; @@ -1469,5 +1618,4 @@ hypre_BoomerAMGBuildInterpOnePnt_getnnz( HYPRE_Int nr_of_rows, } } - -#endif // defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#endif // defined(HYPRE_USING_GPU) diff --git a/external/hypre/src/parcsr_ls/par_interp_trunc_device.c b/external/hypre/src/parcsr_ls/par_interp_trunc_device.c index 30fc5147..a5516c51 100644 --- a/external/hypre/src/parcsr_ls/par_interp_trunc_device.c +++ b/external/hypre/src/parcsr_ls/par_interp_trunc_device.c @@ -1,61 +1,549 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ +#include "_hypre_onedpl.hpp" #include "_hypre_parcsr_ls.h" #include "_hypre_utilities.hpp" -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) +#define HYPRE_INTERPTRUNC_ALGORITHM_SWITCH 8 + +/* special case for max_elmts = 0, i.e. no max_elmts limit */ __global__ void -hypreCUDAKernel_InterpTruncation( HYPRE_Int nrows, - HYPRE_Real trunc_factor, - HYPRE_Int max_elmts, - HYPRE_Int *P_i, - HYPRE_Int *P_j, - HYPRE_Real *P_a) +hypreGPUKernel_InterpTruncationPass0_v1( hypre_DeviceItem &item, + HYPRE_Int nrows, + HYPRE_Real trunc_factor, + HYPRE_Int *P_diag_i, + HYPRE_Int *P_diag_j, + HYPRE_Real *P_diag_a, + HYPRE_Int *P_offd_i, + HYPRE_Int *P_offd_j, + HYPRE_Real *P_offd_a, + HYPRE_Int *P_diag_i_new, + HYPRE_Int *P_offd_i_new ) { HYPRE_Real row_max = 0.0, row_sum = 0.0, row_scal = 0.0; - HYPRE_Int row = hypre_cuda_get_grid_warp_id<1,1>(); + + HYPRE_Int row = hypre_gpu_get_grid_warp_id<1, 1>(item); if (row >= nrows) { return; } - HYPRE_Int lane = hypre_cuda_get_lane_id<1>(), p, q; + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); + HYPRE_Int p_diag = 0, q_diag = 0, p_offd = 0, q_offd = 0; - /* 1. compute row max, rowsum */ if (lane < 2) { - p = read_only_load(P_i + row + lane); + p_diag = read_only_load(P_diag_i + row + lane); + p_offd = read_only_load(P_offd_i + row + lane); } - q = __shfl_sync(HYPRE_WARP_FULL_MASK, p, 1); - p = __shfl_sync(HYPRE_WARP_FULL_MASK, p, 0); + q_diag = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_diag, 1); + p_diag = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_diag, 0); + q_offd = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_offd, 1); + p_offd = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_offd, 0); - for (HYPRE_Int i = p + lane; __any_sync(HYPRE_WARP_FULL_MASK, i < q); i += HYPRE_WARP_SIZE) + /* 1. compute row rowsum, rowmax */ + for (HYPRE_Int i = p_diag + lane; i < q_diag; i += HYPRE_WARP_SIZE) { - if (i < q) + HYPRE_Real v = P_diag_a[i]; + row_sum += v; + row_max = hypre_max(row_max, hypre_abs(v)); + } + + for (HYPRE_Int i = p_offd + lane; i < q_offd; i += HYPRE_WARP_SIZE) + { + HYPRE_Real v = P_offd_a[i]; + row_sum += v; + row_max = hypre_max(row_max, hypre_abs(v)); + } + + row_max = warp_allreduce_max(item, row_max) * trunc_factor; + row_sum = warp_allreduce_sum(item, row_sum); + + HYPRE_Int cnt_diag = 0, cnt_offd = 0; + + /* 2. move wanted entries to the front and row scal */ + for (HYPRE_Int i = p_diag + lane; warp_any_sync(item, HYPRE_WARP_FULL_MASK, i < q_diag); + i += HYPRE_WARP_SIZE) + { + HYPRE_Real v = 0.0; + HYPRE_Int j = -1; + + if (i < q_diag) + { + v = P_diag_a[i]; + + if (hypre_abs(v) >= row_max) + { + j = P_diag_j[i]; + row_scal += v; + } + } + + HYPRE_Int sum, pos; + pos = warp_prefix_sum(item, lane, (HYPRE_Int) (j != -1), sum); + + if (j != -1) { - HYPRE_Real v = read_only_load(&P_a[i]); - row_max = hypre_max(row_max, fabs(v)); - row_sum += v; + P_diag_a[p_diag + cnt_diag + pos] = v; + P_diag_j[p_diag + cnt_diag + pos] = j; } + + cnt_diag += sum; } - row_max = warp_allreduce_max(row_max) * trunc_factor; - row_sum = warp_allreduce_sum(row_sum); + for (HYPRE_Int i = p_offd + lane; warp_any_sync(item, HYPRE_WARP_FULL_MASK, i < q_offd); + i += HYPRE_WARP_SIZE) + { + HYPRE_Real v = 0.0; + HYPRE_Int j = -1; + + if (i < q_offd) + { + v = P_offd_a[i]; + + if (hypre_abs(v) >= row_max) + { + j = P_offd_j[i]; + row_scal += v; + } + } + + HYPRE_Int sum, pos; + pos = warp_prefix_sum(item, lane, (HYPRE_Int) (j != -1), sum); + + if (j != -1) + { + P_offd_a[p_offd + cnt_offd + pos] = v; + P_offd_j[p_offd + cnt_offd + pos] = j; + } + + cnt_offd += sum; + } + + row_scal = warp_allreduce_sum(item, row_scal); + + if (row_scal) + { + row_scal = row_sum / row_scal; + } + else + { + row_scal = 1.0; + } + + /* 3. scale the row */ + for (HYPRE_Int i = p_diag + lane; i < p_diag + cnt_diag; i += HYPRE_WARP_SIZE) + { + P_diag_a[i] *= row_scal; + } + + for (HYPRE_Int i = p_offd + lane; i < p_offd + cnt_offd; i += HYPRE_WARP_SIZE) + { + P_offd_a[i] *= row_scal; + } + + if (!lane) + { + P_diag_i_new[row] = cnt_diag; + P_offd_i_new[row] = cnt_offd; + } +} + +static __device__ __forceinline__ +void hypre_smallest_abs_val( HYPRE_Int n, + HYPRE_Real *v, + HYPRE_Real &min_v, + HYPRE_Int &min_j ) +{ + min_v = hypre_abs(v[0]); + min_j = 0; + + for (HYPRE_Int j = 1; j < n; j++) + { + const HYPRE_Real vj = hypre_abs(v[j]); + if (vj < min_v) + { + min_v = vj; + min_j = j; + } + } +} + +/* TODO: using 1 thread per row, which can be suboptimal */ +__global__ void +hypreGPUKernel_InterpTruncationPass1_v1( hypre_DeviceItem &item, +#if defined(HYPRE_USING_SYCL) + char *shmem_ptr, +#endif + HYPRE_Int nrows, + HYPRE_Real trunc_factor, + HYPRE_Int max_elmts, + HYPRE_Int *P_diag_i, + HYPRE_Int *P_diag_j, + HYPRE_Real *P_diag_a, + HYPRE_Int *P_offd_i, + HYPRE_Int *P_offd_j, + HYPRE_Real *P_offd_a, + HYPRE_Int *P_diag_i_new, + HYPRE_Int *P_offd_i_new ) +{ + const HYPRE_Int row = hypre_gpu_get_grid_thread_id<1, 1>(item); + + if (row >= nrows) + { + return; + } + + const HYPRE_Int p_diag = read_only_load(P_diag_i + row); + const HYPRE_Int q_diag = read_only_load(P_diag_i + row + 1); + const HYPRE_Int p_offd = read_only_load(P_offd_i + row); + const HYPRE_Int q_offd = read_only_load(P_offd_i + row + 1); + + /* 1. get row max and compute truncation threshold, and compute row_sum */ + HYPRE_Real row_max = 0.0, row_sum = 0.0; + + for (HYPRE_Int i = p_diag; i < q_diag; i++) + { + HYPRE_Real v = P_diag_a[i]; + row_sum += v; + row_max = hypre_max(row_max, hypre_abs(v)); + } + + for (HYPRE_Int i = p_offd; i < q_offd; i++) + { + HYPRE_Real v = P_offd_a[i]; + row_sum += v; + row_max = hypre_max(row_max, hypre_abs(v)); + } + + row_max *= trunc_factor; + + /* 2. save the largest max_elmts entries in sh_val/pos */ + const HYPRE_Int nt = hypre_gpu_get_num_threads<1>(item); + const HYPRE_Int tid = hypre_gpu_get_thread_id<1>(item); +#if defined(HYPRE_USING_SYCL) + HYPRE_Int *shared_mem = (HYPRE_Int*) shmem_ptr; +#else + extern __shared__ HYPRE_Int shared_mem[]; +#endif + HYPRE_Int *sh_pos = &shared_mem[tid * max_elmts]; + HYPRE_Real *sh_val = &((HYPRE_Real *) &shared_mem[nt * max_elmts])[tid * max_elmts]; + HYPRE_Int cnt = 0; + + for (HYPRE_Int i = p_diag; i < q_diag; i++) + { + const HYPRE_Real v = P_diag_a[i]; + + if (hypre_abs(v) < row_max) { continue; } + + if (cnt < max_elmts) + { + sh_val[cnt] = v; + sh_pos[cnt ++] = i; + } + else + { + HYPRE_Real min_v; + HYPRE_Int min_j; + + hypre_smallest_abs_val(max_elmts, sh_val, min_v, min_j); + + if (hypre_abs(v) > min_v) + { + sh_val[min_j] = v; + sh_pos[min_j] = i; + } + } + } + + for (HYPRE_Int i = p_offd; i < q_offd; i++) + { + const HYPRE_Real v = P_offd_a[i]; + + if (hypre_abs(v) < row_max) { continue; } + + if (cnt < max_elmts) + { + sh_val[cnt] = v; + sh_pos[cnt ++] = i + q_diag; + } + else + { + HYPRE_Real min_v; + HYPRE_Int min_j; + + hypre_smallest_abs_val(max_elmts, sh_val, min_v, min_j); + + if (hypre_abs(v) > min_v) + { + sh_val[min_j] = v; + sh_pos[min_j] = i + q_diag; + } + } + } + + /* 3. load actual j and compute row_scal */ + HYPRE_Real row_scal = 0.0; + + for (HYPRE_Int i = 0; i < cnt; i++) + { + const HYPRE_Int j = sh_pos[i]; + + if (j < q_diag) + { + sh_pos[i] = P_diag_j[j]; + } + else + { + sh_pos[i] = -1 - P_offd_j[j - q_diag]; + } + + row_scal += sh_val[i]; + } + + if (row_scal) + { + row_scal = row_sum / row_scal; + } + else + { + row_scal = 1.0; + } + + /* 4. write to P_diag_j and P_offd_j */ + HYPRE_Int cnt_diag = 0; + for (HYPRE_Int i = 0; i < cnt; i++) + { + const HYPRE_Int j = sh_pos[i]; + + if (j >= 0) + { + P_diag_j[p_diag + cnt_diag] = j; + P_diag_a[p_diag + cnt_diag] = sh_val[i] * row_scal; + cnt_diag ++; + } + else + { + P_offd_j[p_offd + i - cnt_diag] = -1 - j; + P_offd_a[p_offd + i - cnt_diag] = sh_val[i] * row_scal; + } + } + + P_diag_i_new[row] = cnt_diag; + P_offd_i_new[row] = cnt - cnt_diag; +} + +/* using 1 warp per row */ +__global__ void +hypreGPUKernel_InterpTruncationPass2_v1( hypre_DeviceItem &item, + HYPRE_Int nrows, + HYPRE_Int *P_diag_i, + HYPRE_Int *P_diag_j, + HYPRE_Real *P_diag_a, + HYPRE_Int *P_offd_i, + HYPRE_Int *P_offd_j, + HYPRE_Real *P_offd_a, + HYPRE_Int *P_diag_i_new, + HYPRE_Int *P_diag_j_new, + HYPRE_Real *P_diag_a_new, + HYPRE_Int *P_offd_i_new, + HYPRE_Int *P_offd_j_new, + HYPRE_Real *P_offd_a_new ) +{ + HYPRE_Int i = hypre_gpu_get_grid_warp_id<1, 1>(item); + + if (i >= nrows) + { + return; + } + + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); + HYPRE_Int p = 0, pnew = 0, qnew = 0, shift; + + if (lane < 2) + { + p = read_only_load(P_diag_i + i + lane); + pnew = read_only_load(P_diag_i_new + i + lane); + } + p = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 0); + qnew = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, pnew, 1); + pnew = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, pnew, 0); + + shift = p - pnew; + for (HYPRE_Int k = pnew + lane; k < qnew; k += HYPRE_WARP_SIZE) + { + P_diag_j_new[k] = P_diag_j[k + shift]; + P_diag_a_new[k] = P_diag_a[k + shift]; + } + + if (lane < 2) + { + p = read_only_load(P_offd_i + i + lane); + pnew = read_only_load(P_offd_i_new + i + lane); + } + p = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 0); + qnew = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, pnew, 1); + pnew = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, pnew, 0); + + shift = p - pnew; + for (HYPRE_Int k = pnew + lane; k < qnew; k += HYPRE_WARP_SIZE) + { + P_offd_j_new[k] = P_offd_j[k + shift]; + P_offd_a_new[k] = P_offd_a[k + shift]; + } +} + +/* This is a "fast" version that works for small max_elmts values */ +HYPRE_Int +hypre_BoomerAMGInterpTruncationDevice_v1( hypre_ParCSRMatrix *P, + HYPRE_Real trunc_factor, + HYPRE_Int max_elmts ) +{ + HYPRE_Int nrows = hypre_ParCSRMatrixNumRows(P); + hypre_CSRMatrix *P_diag = hypre_ParCSRMatrixDiag(P); + HYPRE_Int *P_diag_i = hypre_CSRMatrixI(P_diag); + HYPRE_Int *P_diag_j = hypre_CSRMatrixJ(P_diag); + HYPRE_Real *P_diag_a = hypre_CSRMatrixData(P_diag); + hypre_CSRMatrix *P_offd = hypre_ParCSRMatrixOffd(P); + HYPRE_Int *P_offd_i = hypre_CSRMatrixI(P_offd); + HYPRE_Int *P_offd_j = hypre_CSRMatrixJ(P_offd); + HYPRE_Real *P_offd_a = hypre_CSRMatrixData(P_offd); + + HYPRE_MemoryLocation memory_location = hypre_ParCSRMatrixMemoryLocation(P); + + HYPRE_Int *P_diag_i_new = hypre_TAlloc(HYPRE_Int, nrows + 1, memory_location); + HYPRE_Int *P_offd_i_new = hypre_TAlloc(HYPRE_Int, nrows + 1, memory_location); + + /* truncate P, wanted entries are marked negative in P_diag/offd_j */ + if (max_elmts == 0) + { + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(nrows, "warp", bDim); + + HYPRE_GPU_LAUNCH( hypreGPUKernel_InterpTruncationPass0_v1, + gDim, bDim, + nrows, trunc_factor, + P_diag_i, P_diag_j, P_diag_a, + P_offd_i, P_offd_j, P_offd_a, + P_diag_i_new, P_offd_i_new); + } + else + { + dim3 bDim = hypre_dim3(256); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(nrows, "thread", bDim); +#if defined(HYPRE_USING_SYCL) + size_t shmem_bytes = bDim.get(2) * max_elmts * (sizeof(HYPRE_Int) + sizeof(HYPRE_Real)); +#else + size_t shmem_bytes = bDim.x * max_elmts * (sizeof(HYPRE_Int) + sizeof(HYPRE_Real)); +#endif + HYPRE_GPU_LAUNCH2( hypreGPUKernel_InterpTruncationPass1_v1, + gDim, bDim, shmem_bytes, + nrows, trunc_factor, max_elmts, + P_diag_i, P_diag_j, P_diag_a, + P_offd_i, P_offd_j, P_offd_a, + P_diag_i_new, P_offd_i_new); + } + + hypre_Memset(&P_diag_i_new[nrows], 0, sizeof(HYPRE_Int), memory_location); + hypre_Memset(&P_offd_i_new[nrows], 0, sizeof(HYPRE_Int), memory_location); + + hypreDevice_IntegerExclusiveScan(nrows + 1, P_diag_i_new); + hypreDevice_IntegerExclusiveScan(nrows + 1, P_offd_i_new); + + HYPRE_Int nnz_diag, nnz_offd; + + hypre_TMemcpy(&nnz_diag, &P_diag_i_new[nrows], HYPRE_Int, 1, + HYPRE_MEMORY_HOST, memory_location); + hypre_TMemcpy(&nnz_offd, &P_offd_i_new[nrows], HYPRE_Int, 1, + HYPRE_MEMORY_HOST, memory_location); + + hypre_CSRMatrixNumNonzeros(P_diag) = nnz_diag; + hypre_CSRMatrixNumNonzeros(P_offd) = nnz_offd; + + HYPRE_Int *P_diag_j_new = hypre_TAlloc(HYPRE_Int, nnz_diag, memory_location); + HYPRE_Real *P_diag_a_new = hypre_TAlloc(HYPRE_Real, nnz_diag, memory_location); + HYPRE_Int *P_offd_j_new = hypre_TAlloc(HYPRE_Int, nnz_offd, memory_location); + HYPRE_Real *P_offd_a_new = hypre_TAlloc(HYPRE_Real, nnz_offd, memory_location); + + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(nrows, "warp", bDim); + HYPRE_GPU_LAUNCH( hypreGPUKernel_InterpTruncationPass2_v1, + gDim, bDim, + nrows, + P_diag_i, P_diag_j, P_diag_a, + P_offd_i, P_offd_j, P_offd_a, + P_diag_i_new, P_diag_j_new, P_diag_a_new, + P_offd_i_new, P_offd_j_new, P_offd_a_new ); + + hypre_CSRMatrixI (P_diag) = P_diag_i_new; + hypre_CSRMatrixJ (P_diag) = P_diag_j_new; + hypre_CSRMatrixData(P_diag) = P_diag_a_new; + hypre_CSRMatrixI (P_offd) = P_offd_i_new; + hypre_CSRMatrixJ (P_offd) = P_offd_j_new; + hypre_CSRMatrixData(P_offd) = P_offd_a_new; + + hypre_TFree(P_diag_i, memory_location); + hypre_TFree(P_diag_j, memory_location); + hypre_TFree(P_diag_a, memory_location); + hypre_TFree(P_offd_i, memory_location); + hypre_TFree(P_offd_j, memory_location); + hypre_TFree(P_offd_a, memory_location); + + return hypre_error_flag; +} + +__global__ void +hypreGPUKernel_InterpTruncation_v2( hypre_DeviceItem &item, + HYPRE_Int nrows, + HYPRE_Real trunc_factor, + HYPRE_Int max_elmts, + HYPRE_Int *P_i, + HYPRE_Int *P_j, + HYPRE_Real *P_a) +{ + HYPRE_Real row_max = 0.0, row_sum = 0.0, row_scal = 0.0; + HYPRE_Int row = hypre_gpu_get_grid_warp_id<1, 1>(item); + + if (row >= nrows) + { + return; + } + + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item), p = 0, q; + + /* 1. compute row max, rowsum */ + if (lane < 2) + { + p = read_only_load(P_i + row + lane); + } + q = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 1); + p = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 0); + + for (HYPRE_Int i = p + lane; i < q; i += HYPRE_WARP_SIZE) + { + HYPRE_Real v = read_only_load(&P_a[i]); + row_max = hypre_max(row_max, hypre_abs(v)); + row_sum += v; + } + + row_max = warp_allreduce_max(item, row_max) * trunc_factor; + row_sum = warp_allreduce_sum(item, row_sum); /* 2. mark dropped entries by -1 in P_j, and compute row_scal */ HYPRE_Int last_pos = -1; - for (HYPRE_Int i = p + lane; __any_sync(HYPRE_WARP_FULL_MASK, i < q); i += HYPRE_WARP_SIZE) + for (HYPRE_Int i = p + lane; warp_any_sync(item, HYPRE_WARP_FULL_MASK, i < q); i += HYPRE_WARP_SIZE) { HYPRE_Int cond = 0, cond_prev; - cond_prev = i == p + lane || warp_allreduce_min(cond); + cond_prev = i == p + lane || warp_allreduce_min(item, cond); if (i < q) { @@ -65,7 +553,7 @@ hypreCUDAKernel_InterpTruncation( HYPRE_Int nrows, { v = read_only_load(&P_a[i]); } - cond = cond && fabs(v) >= row_max; + cond = cond && hypre_abs(v) >= row_max; if (cond) { @@ -79,7 +567,7 @@ hypreCUDAKernel_InterpTruncation( HYPRE_Int nrows, } } - row_scal = warp_allreduce_sum(row_scal); + row_scal = warp_allreduce_sum(item, row_scal); if (row_scal) { @@ -97,16 +585,15 @@ hypreCUDAKernel_InterpTruncation( HYPRE_Int nrows, } } -/*-----------------------------------------------------------------------* +/*------------------------------------------------------------------------------------ * RL: To be consistent with the CPU version, max_elmts == 0 means no limit on rownnz + * This is a generic version that works for all max_elmts values */ HYPRE_Int -hypre_BoomerAMGInterpTruncationDevice( hypre_ParCSRMatrix *P, HYPRE_Real trunc_factor, HYPRE_Int max_elmts ) +hypre_BoomerAMGInterpTruncationDevice_v2( hypre_ParCSRMatrix *P, + HYPRE_Real trunc_factor, + HYPRE_Int max_elmts ) { -#ifdef HYPRE_PROFILE - hypre_profile_times[HYPRE_TIMER_ID_INTERP_TRUNC] -= hypre_MPI_Wtime(); -#endif - hypre_CSRMatrix *P_diag = hypre_ParCSRMatrixDiag(P); HYPRE_Int *P_diag_i = hypre_CSRMatrixI(P_diag); HYPRE_Int *P_diag_j = hypre_CSRMatrixJ(P_diag); @@ -122,33 +609,32 @@ hypre_BoomerAMGInterpTruncationDevice( hypre_ParCSRMatrix *P, HYPRE_Real trunc_f HYPRE_Int nnz_diag = hypre_CSRMatrixNumNonzeros(P_diag); HYPRE_Int nnz_offd = hypre_CSRMatrixNumNonzeros(P_offd); HYPRE_Int nnz_P = nnz_diag + nnz_offd; - HYPRE_Int *P_i = hypre_TAlloc(HYPRE_Int, nnz_P, HYPRE_MEMORY_DEVICE); - HYPRE_Int *P_j = hypre_TAlloc(HYPRE_Int, nnz_P, HYPRE_MEMORY_DEVICE); - HYPRE_Real *P_a = hypre_TAlloc(HYPRE_Real, nnz_P, HYPRE_MEMORY_DEVICE); - HYPRE_Int *P_rowptr = hypre_TAlloc(HYPRE_Int, nrows+1, HYPRE_MEMORY_DEVICE); - HYPRE_Int *tmp_rowid = hypre_TAlloc(HYPRE_Int, nnz_P, HYPRE_MEMORY_DEVICE); + HYPRE_Int *P_i = hypre_TAlloc(HYPRE_Int, nnz_P, HYPRE_MEMORY_DEVICE); + HYPRE_Int *P_j = hypre_TAlloc(HYPRE_Int, nnz_P, HYPRE_MEMORY_DEVICE); + HYPRE_Real *P_a = hypre_TAlloc(HYPRE_Real, nnz_P, HYPRE_MEMORY_DEVICE); + HYPRE_Int *P_rowptr = hypre_TAlloc(HYPRE_Int, nrows + 1, HYPRE_MEMORY_DEVICE); + HYPRE_Int *tmp_rowid = hypre_TAlloc(HYPRE_Int, nnz_P, HYPRE_MEMORY_DEVICE); HYPRE_Int new_nnz_diag = 0, new_nnz_offd = 0; - HYPRE_Int ierr = 0; - HYPRE_MemoryLocation memory_location = hypre_ParCSRMatrixMemoryLocation(P); - - /* - HYPRE_Int num_procs, my_id; - MPI_Comm comm = hypre_ParCSRMatrixComm(P); - hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_rank(comm, &my_id); - */ + HYPRE_MemoryLocation memory_location = hypre_ParCSRMatrixMemoryLocation(P); hypreDevice_CsrRowPtrsToIndices_v2(nrows, nnz_diag, P_diag_i, P_i); hypreDevice_CsrRowPtrsToIndices_v2(nrows, nnz_offd, P_offd_i, P_i + nnz_diag); hypre_TMemcpy(P_j, P_diag_j, HYPRE_Int, nnz_diag, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); /* offd col id := -2 - offd col id */ +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL(std::transform, P_offd_j, P_offd_j + nnz_offd, P_j + nnz_diag, + [] (const auto & x) {return -x - 2;} ); +#else HYPRE_THRUST_CALL(transform, P_offd_j, P_offd_j + nnz_offd, P_j + nnz_diag, -_1 - 2); +#endif - hypre_TMemcpy(P_a, P_diag_a, HYPRE_Real, nnz_diag, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); - hypre_TMemcpy(P_a + nnz_diag, P_offd_a, HYPRE_Real, nnz_offd, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(P_a, P_diag_a, HYPRE_Real, nnz_diag, HYPRE_MEMORY_DEVICE, + HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(P_a + nnz_diag, P_offd_a, HYPRE_Real, nnz_offd, HYPRE_MEMORY_DEVICE, + HYPRE_MEMORY_DEVICE); /* sort rows based on (rowind, abs(P_a)) */ hypreDevice_StableSortByTupleKey(nnz_P, P_i, P_a, P_j, 1); @@ -156,24 +642,32 @@ hypre_BoomerAMGInterpTruncationDevice( hypre_ParCSRMatrix *P, HYPRE_Real trunc_f hypreDevice_CsrRowIndicesToPtrs_v2(nrows, nnz_P, P_i, P_rowptr); /* truncate P, unwanted entries are marked -1 in P_j */ - dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(nrows, "warp", bDim); + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(nrows, "warp", bDim); - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_InterpTruncation, gDim, bDim, - nrows, trunc_factor, max_elmts, P_rowptr, P_j, P_a ); + HYPRE_GPU_LAUNCH( hypreGPUKernel_InterpTruncation_v2, gDim, bDim, + nrows, trunc_factor, max_elmts, P_rowptr, P_j, P_a ); /* build new P_diag and P_offd */ if (nnz_diag) { +#if defined(HYPRE_USING_SYCL) + auto new_end = hypreSycl_copy_if( oneapi::dpl::make_zip_iterator(P_i, P_j, P_a), + oneapi::dpl::make_zip_iterator(P_i + nnz_P, P_j + nnz_P, P_a + nnz_P), + P_j, + oneapi::dpl::make_zip_iterator(tmp_rowid, P_diag_j, P_diag_a), + is_nonnegative() ); + new_nnz_diag = std::get<0>(new_end.base()) - tmp_rowid; +#else auto new_end = HYPRE_THRUST_CALL( - copy_if, - thrust::make_zip_iterator(thrust::make_tuple(P_i, P_j, P_a)), - thrust::make_zip_iterator(thrust::make_tuple(P_i+nnz_P, P_j+nnz_P, P_a+nnz_P)), - P_j, - thrust::make_zip_iterator(thrust::make_tuple(tmp_rowid, P_diag_j, P_diag_a)), - is_nonnegative() ); - + copy_if, + thrust::make_zip_iterator(thrust::make_tuple(P_i, P_j, P_a)), + thrust::make_zip_iterator(thrust::make_tuple(P_i + nnz_P, P_j + nnz_P, P_a + nnz_P)), + P_j, + thrust::make_zip_iterator(thrust::make_tuple(tmp_rowid, P_diag_j, P_diag_a)), + is_nonnegative() ); new_nnz_diag = thrust::get<0>(new_end.get_iterator_tuple()) - tmp_rowid; +#endif hypre_assert(new_nnz_diag <= nnz_diag); @@ -183,32 +677,44 @@ hypre_BoomerAMGInterpTruncationDevice( hypre_ParCSRMatrix *P, HYPRE_Real trunc_f if (nnz_offd) { less_than pred(-1); +#if defined(HYPRE_USING_SYCL) + auto new_end = hypreSycl_copy_if( oneapi::dpl::make_zip_iterator(P_i, P_j, P_a), + oneapi::dpl::make_zip_iterator(P_i + nnz_P, P_j + nnz_P, P_a + nnz_P), + P_j, + oneapi::dpl::make_zip_iterator(tmp_rowid, P_offd_j, P_offd_a), + pred ); + new_nnz_offd = std::get<0>(new_end.base()) - tmp_rowid; +#else auto new_end = HYPRE_THRUST_CALL( - copy_if, - thrust::make_zip_iterator(thrust::make_tuple(P_i, P_j, P_a)), - thrust::make_zip_iterator(thrust::make_tuple(P_i+nnz_P, P_j+nnz_P, P_a+nnz_P)), - P_j, - thrust::make_zip_iterator(thrust::make_tuple(tmp_rowid, P_offd_j, P_offd_a)), - pred ); - + copy_if, + thrust::make_zip_iterator(thrust::make_tuple(P_i, P_j, P_a)), + thrust::make_zip_iterator(thrust::make_tuple(P_i + nnz_P, P_j + nnz_P, P_a + nnz_P)), + P_j, + thrust::make_zip_iterator(thrust::make_tuple(tmp_rowid, P_offd_j, P_offd_a)), + pred ); new_nnz_offd = thrust::get<0>(new_end.get_iterator_tuple()) - tmp_rowid; +#endif hypre_assert(new_nnz_offd <= nnz_offd); +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL(std::transform, P_offd_j, P_offd_j + new_nnz_offd, P_offd_j, + [] (const auto & x) {return -x - 2;} ); +#else HYPRE_THRUST_CALL(transform, P_offd_j, P_offd_j + new_nnz_offd, P_offd_j, -_1 - 2); +#endif hypreDevice_CsrRowIndicesToPtrs_v2(nrows, new_nnz_offd, tmp_rowid, P_offd_i); } - /* - printf("nnz_diag %d, new nnz_diag %d\n", nnz_diag, new_nnz_diag); - printf("nnz_offd %d, new nnz_offd %d\n", nnz_offd, new_nnz_offd); - */ - - hypre_CSRMatrixJ (P_diag) = hypre_TReAlloc_v2(P_diag_j, HYPRE_Int, nnz_diag, HYPRE_Int, new_nnz_diag, memory_location); - hypre_CSRMatrixData(P_diag) = hypre_TReAlloc_v2(P_diag_a, HYPRE_Real, nnz_diag, HYPRE_Real, new_nnz_diag, memory_location); - hypre_CSRMatrixJ (P_offd) = hypre_TReAlloc_v2(P_offd_j, HYPRE_Int, nnz_offd, HYPRE_Int, new_nnz_offd, memory_location); - hypre_CSRMatrixData(P_offd) = hypre_TReAlloc_v2(P_offd_a, HYPRE_Real, nnz_offd, HYPRE_Real, new_nnz_offd, memory_location); + hypre_CSRMatrixJ (P_diag) = hypre_TReAlloc_v2(P_diag_j, HYPRE_Int, nnz_diag, HYPRE_Int, + new_nnz_diag, memory_location); + hypre_CSRMatrixData(P_diag) = hypre_TReAlloc_v2(P_diag_a, HYPRE_Real, nnz_diag, HYPRE_Real, + new_nnz_diag, memory_location); + hypre_CSRMatrixJ (P_offd) = hypre_TReAlloc_v2(P_offd_j, HYPRE_Int, nnz_offd, HYPRE_Int, + new_nnz_offd, memory_location); + hypre_CSRMatrixData(P_offd) = hypre_TReAlloc_v2(P_offd_a, HYPRE_Real, nnz_offd, HYPRE_Real, + new_nnz_offd, memory_location); hypre_CSRMatrixNumNonzeros(P_diag) = new_nnz_diag; hypre_CSRMatrixNumNonzeros(P_offd) = new_nnz_offd; @@ -218,11 +724,35 @@ hypre_BoomerAMGInterpTruncationDevice( hypre_ParCSRMatrix *P, HYPRE_Real trunc_f hypre_TFree(P_rowptr, HYPRE_MEMORY_DEVICE); hypre_TFree(tmp_rowid, HYPRE_MEMORY_DEVICE); + return hypre_error_flag; +} + +HYPRE_Int +hypre_BoomerAMGInterpTruncationDevice( hypre_ParCSRMatrix *P, + HYPRE_Real trunc_factor, + HYPRE_Int max_elmts ) +{ +#ifdef HYPRE_PROFILE + hypre_profile_times[HYPRE_TIMER_ID_INTERP_TRUNC] -= hypre_MPI_Wtime(); +#endif + hypre_GpuProfilingPushRange("Interp-Truncation"); + + if (max_elmts <= HYPRE_INTERPTRUNC_ALGORITHM_SWITCH) + { + hypre_BoomerAMGInterpTruncationDevice_v1(P, trunc_factor, max_elmts); + } + else + { + hypre_BoomerAMGInterpTruncationDevice_v2(P, trunc_factor, max_elmts); + } + + hypre_GpuProfilingPopRange(); + #ifdef HYPRE_PROFILE hypre_profile_times[HYPRE_TIMER_ID_INTERP_TRUNC] += hypre_MPI_Wtime(); #endif - return ierr; + return hypre_error_flag; } -#endif /* #if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) */ +#endif /* #if defined(HYPRE_USING_GPU) */ diff --git a/external/hypre/src/parcsr_ls/par_jacobi_interp.c b/external/hypre/src/parcsr_ls/par_jacobi_interp.c index 661b550b..9b72a369 100644 --- a/external/hypre/src/parcsr_ls/par_jacobi_interp.c +++ b/external/hypre/src/parcsr_ls/par_jacobi_interp.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -33,7 +33,7 @@ void hypre_BoomerAMGJacobiInterp( hypre_ParCSRMatrix * A, dof_func, &dof_func_offd ); - for ( iji=0; iji=0) ++CF_coarse; +#ifdef HYPRE_JACINT_PRINT_DIAGNOSTICS + if (CF_marker[i] >= 0) { ++CF_coarse; } +#endif } #ifdef HYPRE_JACINT_PRINT_DIAGNOSTICS hypre_printf("%i %i Jacobi_Interp_1, P has %i+%i=%i nonzeros, local sum %e\n", my_id, level, - hypre_CSRMatrixNumNonzeros(P_diag), hypre_CSRMatrixNumNonzeros(P_offd), - hypre_CSRMatrixNumNonzeros(P_diag)+hypre_CSRMatrixNumNonzeros(P_offd), - hypre_ParCSRMatrixLocalSumElts(*P) ); + hypre_CSRMatrixNumNonzeros(P_diag), hypre_CSRMatrixNumNonzeros(P_offd), + hypre_CSRMatrixNumNonzeros(P_diag) + hypre_CSRMatrixNumNonzeros(P_offd), + hypre_ParCSRMatrixLocalSumElts(*P) ); #endif /* row sum computations, for output */ #ifdef HYPRE_JACINT_PRINT_ROW_SUMS - PIimax=-1.0e12, PIimin=1.0e12, PIimav=0, PIipav=0; - nmav=0, npav=0; - for ( i=0; i=1+eps) { PIipav+=PIi; ++npav; }; + if (PIi <= 1 - eps) { PIimav += PIi; ++nmav; }; + if (PIi >= 1 + eps) { PIipav += PIi; ++npav; }; } } - if ( nmav>0 ) PIimav = PIimav/nmav; - if ( npav>0 ) PIipav = PIipav/npav; + if ( nmav > 0 ) { PIimav = PIimav / nmav; } + if ( npav > 0 ) { PIipav = PIipav / npav; } hypre_printf("%i %i P in max,min row sums %e %e\n", my_id, level, PIimax, PIimin ); #endif - ncmax=0; ncmin=num_rows_diag_P; nc1=0; - for ( i=0; incmin+1) + nc = P_diag_i[i + 1] - P_diag_i[i]; + if (nc > ncmin + 1) /*if ( nc > ncmin + 0.5*(ncmax-ncmin) )*/ { J_marker[i] = 1; @@ -178,16 +197,18 @@ void hypre_BoomerAMGJacobiInterp_1( hypre_ParCSRMatrix * A, #ifdef HYPRE_JACINT_PRINT_SOME_ROWS Jchanges = num_rows_diag_P - Jnochanges - CF_coarse; hypre_printf("some rows to be changed: "); - randthresh = 15/(HYPRE_Real)Jchanges; - for ( i=0; i=1+eps) { PIipav+=PIi; ++npav; }; + if (PIi <= 1 - eps) { PIimav += PIi; ++nmav; }; + if (PIi >= 1 + eps) { PIipav += PIi; ++npav; }; } } - if ( nmav>0 ) PIimav = PIimav/nmav; - if ( npav>0 ) PIipav = PIipav/npav; + if ( nmav > 0 ) { PIimav = PIimav / nmav; } + if ( npav > 0 ) { PIipav = PIipav / npav; } hypre_printf("%i %i P out max,min row sums %e %e\n", my_id, level, PIimax, PIimin ); #endif #ifdef HYPRE_JACINT_PRINT_SOME_ROWS hypre_printf("some changed rows: "); - for ( isamp=0; isampvmax if no v is v>0 */ - if ( vmin >= 0.0 ) vmin = -1.0; /* make sure no v is vvmax if no v is v>0 */ + if ( vmin >= 0.0 ) { vmin = -1.0; } /* make sure no v is v=0) are always kept. The arrays are not re-allocated, so there will generally be unused space at the ends of the arrays. */ - new_P_diag_i = hypre_CTAlloc( HYPRE_Int, num_rows_diag_P+1 , HYPRE_MEMORY_HOST); - new_P_offd_i = hypre_CTAlloc( HYPRE_Int, num_rows_offd_P+1 , HYPRE_MEMORY_HOST); + new_P_diag_i = hypre_CTAlloc( HYPRE_Int, num_rows_diag_P + 1, HYPRE_MEMORY_HOST); + new_P_offd_i = hypre_CTAlloc( HYPRE_Int, num_rows_offd_P + 1, HYPRE_MEMORY_HOST); m1d = P_diag_i[0]; m1o = P_offd_i[0]; for ( i1 = 0; i1 < num_rows_diag_P; i1++ ) { old_sum = 0; new_sum = 0; - for ( m=P_diag_i[i1]; m=0 || ( v>=vmax && v>=wmax ) || ( v<=vmin && v<=wmin ) ) - { /* keep v */ + if ( CF_marker[i1] >= 0 || ( v >= vmax && v >= wmax ) || ( v <= vmin && v <= wmin ) ) + { + /* keep v */ new_sum += v; P_diag_j[m1d] = P_diag_j[m]; P_diag_data[m1d] = P_diag_data[m]; ++m1d; } else - { /* discard v */ + { + /* discard v */ --num_nonzeros_diag; } } - for ( m=P_offd_i[i1]; m=0 || ( v>=vmax && v>=wmax ) || ( v<=vmin && v<=wmin ) ) - { /* keep v */ + if ( CF_marker[i1] >= 0 || ( v >= vmax && v >= wmax ) || ( v <= vmin && v <= wmin ) ) + { + /* keep v */ new_sum += v; P_offd_j[m1o] = P_offd_j[m]; P_offd_data[m1o] = P_offd_data[m]; ++m1o; } else - { /* discard v */ + { + /* discard v */ --num_nonzeros_offd; } } - new_P_diag_i[i1+1] = m1d; - if ( i10 ) P_offd_i[i1] = new_P_offd_i[i1]; + if ( i1 <= num_rows_offd_P && num_nonzeros_offd > 0 ) { P_offd_i[i1] = new_P_offd_i[i1]; } } - hypre_TFree( new_P_diag_i , HYPRE_MEMORY_HOST); - if ( num_rows_offd_P>0 ) hypre_TFree( new_P_offd_i , HYPRE_MEMORY_HOST); + hypre_TFree( new_P_diag_i, HYPRE_MEMORY_HOST); + if ( num_rows_offd_P > 0 ) { hypre_TFree( new_P_offd_i, HYPRE_MEMORY_HOST); } hypre_CSRMatrixNumNonzeros(P_diag) = num_nonzeros_diag; hypre_CSRMatrixNumNonzeros(P_offd) = num_nonzeros_offd; @@ -534,51 +578,53 @@ hypre_ParCSRMatrix_dof_func_offd( hypre_ParCSRCommHandle *comm_handle; hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); - HYPRE_Int num_cols_offd = 0; + HYPRE_Int num_cols_offd = 0; HYPRE_Int Solve_err_flag = 0; - HYPRE_Int num_sends; - HYPRE_Int *int_buf_data; - HYPRE_Int index, start, i, j; + HYPRE_Int num_sends; + HYPRE_Int *int_buf_data; + HYPRE_Int index, start, i, j; num_cols_offd = hypre_CSRMatrixNumCols(A_offd); *dof_func_offd = NULL; if (num_cols_offd) { - if (num_functions > 1) - *dof_func_offd = hypre_CTAlloc(HYPRE_Int, num_cols_offd, HYPRE_MEMORY_HOST); + if (num_functions > 1) + { + *dof_func_offd = hypre_CTAlloc(HYPRE_Int, num_cols_offd, HYPRE_MEMORY_HOST); + } } - /*------------------------------------------------------------------- - * Get the dof_func data for the off-processor columns - *-------------------------------------------------------------------*/ + /*------------------------------------------------------------------- + * Get the dof_func data for the off-processor columns + *-------------------------------------------------------------------*/ if (!comm_pkg) { - hypre_MatvecCommPkgCreate(A); - comm_pkg = hypre_ParCSRMatrixCommPkg(A); + hypre_MatvecCommPkgCreate(A); + comm_pkg = hypre_ParCSRMatrixCommPkg(A); } num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); if (num_functions > 1) { int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, - num_sends), HYPRE_MEMORY_HOST); + num_sends), HYPRE_MEMORY_HOST); index = 0; for (i = 0; i < num_sends; i++) { - start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j=start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) - int_buf_data[index++] - = dof_func[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) + int_buf_data[index++] + = dof_func[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } comm_handle = hypre_ParCSRCommHandleCreate( 11, comm_pkg, int_buf_data, - *dof_func_offd); + *dof_func_offd); hypre_ParCSRCommHandleDestroy(comm_handle); hypre_TFree(int_buf_data, HYPRE_MEMORY_HOST); } - return(Solve_err_flag); + return (Solve_err_flag); } diff --git a/external/hypre/src/parcsr_ls/par_krylov_func.c b/external/hypre/src/parcsr_ls/par_krylov_func.c index ae3c48b9..4eb05cc8 100644 --- a/external/hypre/src/parcsr_ls/par_krylov_func.c +++ b/external/hypre/src/parcsr_ls/par_krylov_func.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -16,7 +16,7 @@ hypre_ParKrylovCAlloc( size_t count, size_t elt_size, HYPRE_MemoryLocation location ) { - return( (void*) hypre_CTAlloc(char, count * elt_size, location) ); + return ( (void*) hypre_CTAlloc(char, count * elt_size, location) ); } /*-------------------------------------------------------------------------- @@ -28,7 +28,7 @@ hypre_ParKrylovFree( void *ptr ) { HYPRE_Int ierr = 0; - hypre_TFree( ptr , HYPRE_MEMORY_HOST); + hypre_TFree( ptr, HYPRE_MEMORY_HOST); return ierr; } @@ -43,9 +43,10 @@ hypre_ParKrylovCreateVector( void *vvector ) hypre_ParVector *vector = (hypre_ParVector *) vvector; hypre_ParVector *new_vector; - new_vector = hypre_ParVectorCreate( hypre_ParVectorComm(vector), - hypre_ParVectorGlobalSize(vector), - hypre_ParVectorPartitioning(vector) ); + new_vector = hypre_ParMultiVectorCreate( hypre_ParVectorComm(vector), + hypre_ParVectorGlobalSize(vector), + hypre_ParVectorPartitioning(vector), + hypre_ParVectorNumVectors(vector) ); hypre_ParVectorInitialize_v2(new_vector, hypre_ParVectorMemoryLocation(vector)); @@ -64,20 +65,22 @@ hypre_ParKrylovCreateVectorArray(HYPRE_Int n, void *vvector ) hypre_ParVector *vector = (hypre_ParVector *) vvector; hypre_ParVector **new_vector; - HYPRE_Int i, size; + HYPRE_Int i, size, num_vectors; HYPRE_Complex *array_data; HYPRE_MemoryLocation memory_location = hypre_ParVectorMemoryLocation(vector); size = hypre_VectorSize(hypre_ParVectorLocalVector(vector)); - array_data = hypre_CTAlloc(HYPRE_Complex, (n*size), memory_location); + num_vectors = hypre_VectorNumVectors(hypre_ParVectorLocalVector(vector)); + array_data = hypre_CTAlloc(HYPRE_Complex, (n * size * num_vectors), memory_location); new_vector = hypre_CTAlloc(hypre_ParVector*, n, HYPRE_MEMORY_HOST); for (i = 0; i < n; i++) { - new_vector[i] = hypre_ParVectorCreate( hypre_ParVectorComm(vector), - hypre_ParVectorGlobalSize(vector), - hypre_ParVectorPartitioning(vector) ); - hypre_VectorData(hypre_ParVectorLocalVector(new_vector[i])) = &array_data[i*size]; + new_vector[i] = hypre_ParMultiVectorCreate( hypre_ParVectorComm(vector), + hypre_ParVectorGlobalSize(vector), + hypre_ParVectorPartitioning(vector), + hypre_ParVectorNumVectors(vector) ); + hypre_VectorData(hypre_ParVectorLocalVector(new_vector[i])) = &array_data[i * size * num_vectors]; hypre_ParVectorInitialize_v2(new_vector[i], memory_location); if (i) { @@ -98,7 +101,7 @@ hypre_ParKrylovDestroyVector( void *vvector ) { hypre_ParVector *vector = (hypre_ParVector *) vvector; - return( hypre_ParVectorDestroy( vector ) ); + return ( hypre_ParVectorDestroy( vector ) ); } /*-------------------------------------------------------------------------- @@ -109,6 +112,9 @@ void * hypre_ParKrylovMatvecCreate( void *A, void *x ) { + HYPRE_UNUSED_VAR(A); + HYPRE_UNUSED_VAR(x); + void *matvec_data; matvec_data = NULL; @@ -121,13 +127,15 @@ hypre_ParKrylovMatvecCreate( void *A, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_ParKrylovMatvec( void *matvec_data, +hypre_ParKrylovMatvec( void *matvec_data, HYPRE_Complex alpha, - void *A, - void *x, + void *A, + void *x, HYPRE_Complex beta, - void *y ) + void *y ) { + HYPRE_UNUSED_VAR(matvec_data); + return ( hypre_ParCSRMatrixMatvec ( alpha, (hypre_ParCSRMatrix *) A, (hypre_ParVector *) x, @@ -140,13 +148,15 @@ hypre_ParKrylovMatvec( void *matvec_data, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_ParKrylovMatvecT(void *matvec_data, +hypre_ParKrylovMatvecT(void *matvec_data, HYPRE_Complex alpha, - void *A, - void *x, + void *A, + void *x, HYPRE_Complex beta, - void *y ) + void *y) { + HYPRE_UNUSED_VAR(matvec_data); + return ( hypre_ParCSRMatrixMatvecT( alpha, (hypre_ParCSRMatrix *) A, (hypre_ParVector *) x, @@ -161,6 +171,8 @@ hypre_ParKrylovMatvecT(void *matvec_data, HYPRE_Int hypre_ParKrylovMatvecDestroy( void *matvec_data ) { + HYPRE_UNUSED_VAR(matvec_data); + return 0; } @@ -181,9 +193,10 @@ hypre_ParKrylovInnerProd( void *x, *--------------------------------------------------------------------------*/ HYPRE_Int hypre_ParKrylovMassInnerProd( void *x, - void **y, HYPRE_Int k, HYPRE_Int unroll, void * result ) + void **y, HYPRE_Int k, HYPRE_Int unroll, void * result ) { - return ( hypre_ParVectorMassInnerProd( (hypre_ParVector *) x,(hypre_ParVector **) y, k, unroll, (HYPRE_Real*)result ) ); + return ( hypre_ParVectorMassInnerProd( (hypre_ParVector *) x, (hypre_ParVector **) y, k, unroll, + (HYPRE_Real*)result ) ); } /*-------------------------------------------------------------------------- @@ -191,10 +204,11 @@ hypre_ParKrylovMassInnerProd( void *x, *--------------------------------------------------------------------------*/ HYPRE_Int hypre_ParKrylovMassDotpTwo( void *x, void *y, - void **z, HYPRE_Int k, HYPRE_Int unroll, void *result_x, void *result_y ) + void **z, HYPRE_Int k, HYPRE_Int unroll, void *result_x, void *result_y ) { - return ( hypre_ParVectorMassDotpTwo( (hypre_ParVector *) x, (hypre_ParVector *) y, (hypre_ParVector **) z, k, - unroll, (HYPRE_Real *)result_x, (HYPRE_Real *)result_y ) ); + return ( hypre_ParVectorMassDotpTwo( (hypre_ParVector *) x, (hypre_ParVector *) y, + (hypre_ParVector **) z, k, + unroll, (HYPRE_Real *)result_x, (HYPRE_Real *)result_y ) ); } @@ -218,7 +232,7 @@ hypre_ParKrylovCopyVector( void *x, HYPRE_Int hypre_ParKrylovClearVector( void *x ) { - return ( hypre_ParVectorSetConstantValues( (hypre_ParVector *) x, 0.0 ) ); + return ( hypre_ParVectorSetZeros( (hypre_ParVector *) x ) ); } /*-------------------------------------------------------------------------- @@ -270,8 +284,8 @@ HYPRE_Int hypre_ParKrylovCommInfo( void *A, HYPRE_Int *my_id, HYPRE_Int *num_procs) { MPI_Comm comm = hypre_ParCSRMatrixComm ( (hypre_ParCSRMatrix *) A); - hypre_MPI_Comm_size(comm,num_procs); - hypre_MPI_Comm_rank(comm,my_id); + hypre_MPI_Comm_size(comm, num_procs); + hypre_MPI_Comm_rank(comm, my_id); return 0; } @@ -286,6 +300,11 @@ hypre_ParKrylovIdentitySetup( void *vdata, void *x ) { + HYPRE_UNUSED_VAR(vdata); + HYPRE_UNUSED_VAR(A); + HYPRE_UNUSED_VAR(b); + HYPRE_UNUSED_VAR(x); + return 0; } @@ -300,5 +319,8 @@ hypre_ParKrylovIdentity( void *vdata, void *x ) { - return( hypre_ParKrylovCopyVector( b, x ) ); + HYPRE_UNUSED_VAR(vdata); + HYPRE_UNUSED_VAR(A); + + return ( hypre_ParKrylovCopyVector( b, x ) ); } diff --git a/external/hypre/src/parcsr_ls/par_laplace.c b/external/hypre/src/parcsr_ls/par_laplace.c index 49ed4533..43343211 100644 --- a/external/hypre/src/parcsr_ls/par_laplace.c +++ b/external/hypre/src/parcsr_ls/par_laplace.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -37,7 +37,7 @@ GenerateLaplacian( MPI_Comm comm, HYPRE_BigInt *big_offd_j = NULL; HYPRE_Real *offd_data = NULL; - HYPRE_BigInt *global_part; + HYPRE_BigInt global_part[2]; HYPRE_BigInt ix, iy, iz; HYPRE_Int cnt, o_cnt; HYPRE_Int local_num_rows; @@ -56,40 +56,39 @@ GenerateLaplacian( MPI_Comm comm, HYPRE_Int num_procs; HYPRE_Int P_busy, Q_busy, R_busy; - hypre_MPI_Comm_size(comm,&num_procs); + hypre_MPI_Comm_size(comm, &num_procs); - grid_size = nx*ny*nz; + grid_size = nx * ny * nz; - hypre_GeneratePartitioning(nx,P,&nx_part); - hypre_GeneratePartitioning(ny,Q,&ny_part); - hypre_GeneratePartitioning(nz,R,&nz_part); + hypre_GeneratePartitioning(nx, P, &nx_part); + hypre_GeneratePartitioning(ny, Q, &ny_part); + hypre_GeneratePartitioning(nz, R, &nz_part); - nx_local =(HYPRE_Int)(nx_part[ip+1] - nx_part[ip]); - ny_local =(HYPRE_Int)(ny_part[iq+1] - ny_part[iq]); - nz_local =(HYPRE_Int)(nz_part[ir+1] - nz_part[ir]); + nx_local = (HYPRE_Int)(nx_part[ip + 1] - nx_part[ip]); + ny_local = (HYPRE_Int)(ny_part[iq + 1] - ny_part[iq]); + nz_local = (HYPRE_Int)(nz_part[ir + 1] - nz_part[ir]); - local_num_rows = nx_local*ny_local*nz_local; + local_num_rows = nx_local * ny_local * nz_local; - global_part = hypre_CTAlloc(HYPRE_BigInt, 2, HYPRE_MEMORY_HOST); - global_part[0] = nz_part[ir]*nx*ny+(ny_part[iq]*nx+nx_part[ip]*ny_local)*nz_local; + global_part[0] = nz_part[ir] * nx * ny + (ny_part[iq] * nx + nx_part[ip] * ny_local) * nz_local; global_part[1] = global_part[0] + (HYPRE_BigInt)local_num_rows; - diag_i = hypre_CTAlloc(HYPRE_Int, local_num_rows+1, HYPRE_MEMORY_HOST); - offd_i = hypre_CTAlloc(HYPRE_Int, local_num_rows+1, HYPRE_MEMORY_HOST); + diag_i = hypre_CTAlloc(HYPRE_Int, local_num_rows + 1, HYPRE_MEMORY_HOST); + offd_i = hypre_CTAlloc(HYPRE_Int, local_num_rows + 1, HYPRE_MEMORY_HOST); - P_busy = hypre_min(nx,P); - Q_busy = hypre_min(ny,Q); - R_busy = hypre_min(nz,R); + P_busy = hypre_min(nx, P); + Q_busy = hypre_min(ny, Q); + R_busy = hypre_min(nz, R); num_cols_offd = 0; - if (ip) num_cols_offd += ny_local*nz_local; - if (ip < P_busy-1) num_cols_offd += ny_local*nz_local; - if (iq) num_cols_offd += nx_local*nz_local; - if (iq < Q_busy-1) num_cols_offd += nx_local*nz_local; - if (ir) num_cols_offd += nx_local*ny_local; - if (ir < R_busy-1) num_cols_offd += nx_local*ny_local; + if (ip) { num_cols_offd += ny_local * nz_local; } + if (ip < P_busy - 1) { num_cols_offd += ny_local * nz_local; } + if (iq) { num_cols_offd += nx_local * nz_local; } + if (iq < Q_busy - 1) { num_cols_offd += nx_local * nz_local; } + if (ir) { num_cols_offd += nx_local * ny_local; } + if (ir < R_busy - 1) { num_cols_offd += nx_local * ny_local; } - if (!local_num_rows) num_cols_offd = 0; + if (!local_num_rows) { num_cols_offd = 0; } col_map_offd = hypre_CTAlloc(HYPRE_BigInt, num_cols_offd, HYPRE_MEMORY_HOST); @@ -97,17 +96,19 @@ GenerateLaplacian( MPI_Comm comm, o_cnt = 1; diag_i[0] = 0; offd_i[0] = 0; - for (iz = nz_part[ir]; iz < nz_part[ir+1]; iz++) + for (iz = nz_part[ir]; iz < nz_part[ir + 1]; iz++) { - for (iy = ny_part[iq]; iy < ny_part[iq+1]; iy++) + for (iy = ny_part[iq]; iy < ny_part[iq + 1]; iy++) { - for (ix = nx_part[ip]; ix < nx_part[ip+1]; ix++) + for (ix = nx_part[ip]; ix < nx_part[ip + 1]; ix++) { - diag_i[cnt] = diag_i[cnt-1]; - offd_i[o_cnt] = offd_i[o_cnt-1]; + diag_i[cnt] = diag_i[cnt - 1]; + offd_i[o_cnt] = offd_i[o_cnt - 1]; diag_i[cnt]++; if (iz > nz_part[ir]) + { diag_i[cnt]++; + } else { if (iz) @@ -116,7 +117,9 @@ GenerateLaplacian( MPI_Comm comm, } } if (iy > ny_part[iq] ) + { diag_i[cnt]++; + } else { if (iy) @@ -125,7 +128,9 @@ GenerateLaplacian( MPI_Comm comm, } } if (ix > nx_part[ip] ) + { diag_i[cnt]++; + } else { if (ix) @@ -133,29 +138,35 @@ GenerateLaplacian( MPI_Comm comm, offd_i[o_cnt]++; } } - if (ix+1 < nx_part[ip+1]) + if (ix + 1 < nx_part[ip + 1]) + { diag_i[cnt]++; + } else { - if (ix+1 < nx) + if (ix + 1 < nx) { offd_i[o_cnt]++; } } - if (iy+1 < ny_part[iq+1]) + if (iy + 1 < ny_part[iq + 1]) + { diag_i[cnt]++; + } else { - if (iy+1 < ny) + if (iy + 1 < ny) { offd_i[o_cnt]++; } } - if (iz+1 < nz_part[ir+1]) + if (iz + 1 < nz_part[ir + 1]) + { diag_i[cnt]++; + } else { - if (iz+1 < nz) + if (iz + 1 < nz) { offd_i[o_cnt]++; } @@ -179,95 +190,95 @@ GenerateLaplacian( MPI_Comm comm, row_index = 0; cnt = 0; o_cnt = 0; - for (iz = nz_part[ir]; iz < nz_part[ir+1]; iz++) + for (iz = nz_part[ir]; iz < nz_part[ir + 1]; iz++) { - for (iy = ny_part[iq]; iy < ny_part[iq+1]; iy++) + for (iy = ny_part[iq]; iy < ny_part[iq + 1]; iy++) { - for (ix = nx_part[ip]; ix < nx_part[ip+1]; ix++) + for (ix = nx_part[ip]; ix < nx_part[ip + 1]; ix++) { diag_j[cnt] = row_index; diag_data[cnt++] = value[0]; if (iz > nz_part[ir]) { - diag_j[cnt] = row_index-nx_local*ny_local; + diag_j[cnt] = row_index - nx_local * ny_local; diag_data[cnt++] = value[3]; } else { if (iz) { - big_offd_j[o_cnt] = hypre_map(ix,iy,iz-1,ip,iq,ir-1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix, iy, iz - 1, ip, iq, ir - 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[3]; } } if (iy > ny_part[iq]) { - diag_j[cnt] = row_index-nx_local; + diag_j[cnt] = row_index - nx_local; diag_data[cnt++] = value[2]; } else { if (iy) { - big_offd_j[o_cnt] = hypre_map(ix,iy-1,iz,ip,iq-1,ir,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix, iy - 1, iz, ip, iq - 1, ir, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[2]; } } if (ix > nx_part[ip]) { - diag_j[cnt] = row_index-1; + diag_j[cnt] = row_index - 1; diag_data[cnt++] = value[1]; } else { if (ix) { - big_offd_j[o_cnt] = hypre_map(ix-1,iy,iz,ip-1,iq,ir,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix - 1, iy, iz, ip - 1, iq, ir, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } } - if (ix+1 < nx_part[ip+1]) + if (ix + 1 < nx_part[ip + 1]) { - diag_j[cnt] = row_index+1; + diag_j[cnt] = row_index + 1; diag_data[cnt++] = value[1]; } else { - if (ix+1 < nx) + if (ix + 1 < nx) { - big_offd_j[o_cnt] = hypre_map(ix+1,iy,iz,ip+1,iq,ir,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix + 1, iy, iz, ip + 1, iq, ir, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } } - if (iy+1 < ny_part[iq+1]) + if (iy + 1 < ny_part[iq + 1]) { - diag_j[cnt] = row_index+nx_local; + diag_j[cnt] = row_index + nx_local; diag_data[cnt++] = value[2]; } else { - if (iy+1 < ny) + if (iy + 1 < ny) { - big_offd_j[o_cnt] = hypre_map(ix,iy+1,iz,ip,iq+1,ir,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix, iy + 1, iz, ip, iq + 1, ir, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[2]; } } - if (iz+1 < nz_part[ir+1]) + if (iz + 1 < nz_part[ir + 1]) { - diag_j[cnt] = row_index+nx_local*ny_local; + diag_j[cnt] = row_index + nx_local * ny_local; diag_data[cnt++] = value[3]; } else { - if (iz+1 < nz) + if (iz + 1 < nz) { - big_offd_j[o_cnt] = hypre_map(ix,iy,iz+1,ip,iq,ir+1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix, iy, iz + 1, ip, iq, ir + 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[3]; } } @@ -278,13 +289,15 @@ GenerateLaplacian( MPI_Comm comm, if (num_procs > 1) { - for (i=0; i < num_cols_offd; i++) + for (i = 0; i < num_cols_offd; i++) + { col_map_offd[i] = big_offd_j[i]; + } - hypre_BigQsort0(col_map_offd, 0, num_cols_offd-1); + hypre_BigQsort0(col_map_offd, 0, num_cols_offd - 1); - for (i=0; i < num_cols_offd; i++) - for (j=0; j < num_cols_offd; j++) + for (i = 0; i < num_cols_offd; i++) + for (j = 0; j < num_cols_offd; j++) if (big_offd_j[i] == col_map_offd[j]) { offd_j[i] = j; @@ -326,7 +339,6 @@ GenerateLaplacian( MPI_Comm comm, hypre_TFree(ny_part, HYPRE_MEMORY_HOST); hypre_TFree(nz_part, HYPRE_MEMORY_HOST); hypre_TFree(big_offd_j, HYPRE_MEMORY_HOST); - hypre_TFree(global_part, HYPRE_MEMORY_HOST); return (HYPRE_ParCSRMatrix) A; } @@ -336,27 +348,28 @@ GenerateLaplacian( MPI_Comm comm, HYPRE_BigInt hypre_map(HYPRE_BigInt ix, - HYPRE_BigInt iy, - HYPRE_BigInt iz, - HYPRE_Int p, - HYPRE_Int q, - HYPRE_Int r, - HYPRE_BigInt nx, - HYPRE_BigInt ny, - HYPRE_BigInt *nx_part, - HYPRE_BigInt *ny_part, - HYPRE_BigInt *nz_part) + HYPRE_BigInt iy, + HYPRE_BigInt iz, + HYPRE_Int p, + HYPRE_Int q, + HYPRE_Int r, + HYPRE_BigInt nx, + HYPRE_BigInt ny, + HYPRE_BigInt *nx_part, + HYPRE_BigInt *ny_part, + HYPRE_BigInt *nz_part) { - HYPRE_Int nx_local = (HYPRE_Int)(nx_part[p+1]-nx_part[p]); - HYPRE_Int ny_local = (HYPRE_Int)(ny_part[q+1]-ny_part[q]); - HYPRE_Int nz_local = (HYPRE_Int)(nz_part[r+1]-nz_part[r]); - HYPRE_Int ix_local = (HYPRE_Int)(ix-nx_part[p]); - HYPRE_Int iy_local = (HYPRE_Int)(iy-ny_part[q]); - HYPRE_Int iz_local = (HYPRE_Int)(iz-nz_part[r]); + HYPRE_Int nx_local = (HYPRE_Int)(nx_part[p + 1] - nx_part[p]); + HYPRE_Int ny_local = (HYPRE_Int)(ny_part[q + 1] - ny_part[q]); + HYPRE_Int nz_local = (HYPRE_Int)(nz_part[r + 1] - nz_part[r]); + HYPRE_Int ix_local = (HYPRE_Int)(ix - nx_part[p]); + HYPRE_Int iy_local = (HYPRE_Int)(iy - ny_part[q]); + HYPRE_Int iz_local = (HYPRE_Int)(iz - nz_part[r]); HYPRE_BigInt global_index; - global_index = nz_part[r]*nx*ny+ny_part[q]*nx*(HYPRE_BigInt)nz_local+nx_part[p]*(HYPRE_BigInt)(ny_local*nz_local); - global_index += (HYPRE_BigInt)((iz_local*ny_local+iy_local)*nx_local + ix_local); + global_index = nz_part[r] * nx * ny + ny_part[q] * nx * (HYPRE_BigInt)nz_local + nx_part[p] * + (HYPRE_BigInt)(ny_local * nz_local); + global_index += (HYPRE_BigInt)((iz_local * ny_local + iy_local) * nx_local + ix_local); return global_index; } @@ -390,16 +403,16 @@ GenerateSysLaplacian( MPI_Comm comm, HYPRE_Int *offd_i; HYPRE_Int *offd_j = NULL; HYPRE_BigInt *big_offd_j = NULL; - HYPRE_Real *offd_data; + HYPRE_Real *offd_data = NULL; - HYPRE_BigInt *global_part; + HYPRE_BigInt global_part[2]; HYPRE_Int ix, iy, iz; HYPRE_Int cnt, o_cnt; HYPRE_Int local_num_rows; HYPRE_BigInt *col_map_offd; HYPRE_Int row_index, row, col; HYPRE_Int index, diag_index; - HYPRE_Int i,j; + HYPRE_Int i, j; HYPRE_Int nx_local, ny_local, nz_local; HYPRE_Int num_cols_offd; @@ -418,60 +431,61 @@ GenerateSysLaplacian( MPI_Comm comm, HYPRE_Real val; HYPRE_Int gp_size; - hypre_MPI_Comm_size(comm,&num_procs); + hypre_MPI_Comm_size(comm, &num_procs); - grid_size = nx*ny*nz; + grid_size = nx * ny * nz; - hypre_GeneratePartitioning(nx,P,&nx_part); - hypre_GeneratePartitioning(ny,Q,&ny_part); - hypre_GeneratePartitioning(nz,R,&nz_part); + hypre_GeneratePartitioning(nx, P, &nx_part); + hypre_GeneratePartitioning(ny, Q, &ny_part); + hypre_GeneratePartitioning(nz, R, &nz_part); - nx_local = (HYPRE_Int)(nx_part[p+1] - nx_part[p]); - ny_local = (HYPRE_Int)(ny_part[q+1] - ny_part[q]); - nz_local = (HYPRE_Int)(nz_part[r+1] - nz_part[r]); + nx_local = (HYPRE_Int)(nx_part[p + 1] - nx_part[p]); + ny_local = (HYPRE_Int)(ny_part[q + 1] - ny_part[q]); + nz_local = (HYPRE_Int)(nz_part[r + 1] - nz_part[r]); - local_grid_size = nx_local*ny_local*nz_local; - local_num_rows = num_fun*local_grid_size; + local_grid_size = nx_local * ny_local * nz_local; + local_num_rows = num_fun * local_grid_size; - global_part = hypre_CTAlloc(HYPRE_BigInt, 2, HYPRE_MEMORY_HOST); - global_part[0] = nz_part[r]*nx*ny+(ny_part[q]*nx+nx_part[p]*ny_local)*nz_local; + global_part[0] = nz_part[r] * nx * ny + (ny_part[q] * nx + nx_part[p] * ny_local) * nz_local; global_part[1] = global_part[0] + (HYPRE_BigInt)local_grid_size; gp_size = 2; - diag_i = hypre_CTAlloc(HYPRE_Int, local_num_rows+1, HYPRE_MEMORY_HOST); - offd_i = hypre_CTAlloc(HYPRE_Int, local_num_rows+1, HYPRE_MEMORY_HOST); + diag_i = hypre_CTAlloc(HYPRE_Int, local_num_rows + 1, HYPRE_MEMORY_HOST); + offd_i = hypre_CTAlloc(HYPRE_Int, local_num_rows + 1, HYPRE_MEMORY_HOST); - P_busy = hypre_min(nx,P); - Q_busy = hypre_min(ny,Q); - R_busy = hypre_min(nz,R); + P_busy = hypre_min(nx, P); + Q_busy = hypre_min(ny, Q); + R_busy = hypre_min(nz, R); num_cols_offd = 0; - if (p) num_cols_offd += ny_local*nz_local; - if (p < P_busy-1) num_cols_offd += ny_local*nz_local; - if (q) num_cols_offd += nx_local*nz_local; - if (q < Q_busy-1) num_cols_offd += nx_local*nz_local; - if (r) num_cols_offd += nx_local*ny_local; - if (r < R_busy-1) num_cols_offd += nx_local*ny_local; + if (p) { num_cols_offd += ny_local * nz_local; } + if (p < P_busy - 1) { num_cols_offd += ny_local * nz_local; } + if (q) { num_cols_offd += nx_local * nz_local; } + if (q < Q_busy - 1) { num_cols_offd += nx_local * nz_local; } + if (r) { num_cols_offd += nx_local * ny_local; } + if (r < R_busy - 1) { num_cols_offd += nx_local * ny_local; } num_cols_offd *= num_fun; - if (!local_num_rows) num_cols_offd = 0; + if (!local_num_rows) { num_cols_offd = 0; } col_map_offd = hypre_CTAlloc(HYPRE_BigInt, num_cols_offd, HYPRE_MEMORY_HOST); cnt = 1; diag_i[0] = 0; offd_i[0] = 0; - for (iz = nz_part[r]; iz < nz_part[r+1]; iz++) + for (iz = nz_part[r]; iz < nz_part[r + 1]; iz++) { - for (iy = ny_part[q]; iy < ny_part[q+1]; iy++) + for (iy = ny_part[q]; iy < ny_part[q + 1]; iy++) { - for (ix = nx_part[p]; ix < nx_part[p+1]; ix++) + for (ix = nx_part[p]; ix < nx_part[p + 1]; ix++) { - diag_i[cnt] = diag_i[cnt-1]; - offd_i[cnt] = offd_i[cnt-1]; + diag_i[cnt] = diag_i[cnt - 1]; + offd_i[cnt] = offd_i[cnt - 1]; diag_i[cnt] += num_fun; if (iz > nz_part[r]) + { diag_i[cnt] += num_fun; + } else { if (iz) @@ -480,7 +494,9 @@ GenerateSysLaplacian( MPI_Comm comm, } } if (iy > ny_part[q]) + { diag_i[cnt] += num_fun; + } else { if (iy) @@ -489,7 +505,9 @@ GenerateSysLaplacian( MPI_Comm comm, } } if (ix > nx_part[p]) + { diag_i[cnt] += num_fun; + } else { if (ix) @@ -497,40 +515,46 @@ GenerateSysLaplacian( MPI_Comm comm, offd_i[cnt] += num_fun; } } - if (ix+1 < nx_part[p+1]) + if (ix + 1 < nx_part[p + 1]) + { diag_i[cnt] += num_fun; + } else { - if (ix+1 < nx) + if (ix + 1 < nx) { offd_i[cnt] += num_fun; } } - if (iy+1 < ny_part[q+1]) + if (iy + 1 < ny_part[q + 1]) + { diag_i[cnt] += num_fun; + } else { - if (iy+1 < ny) + if (iy + 1 < ny) { offd_i[cnt] += num_fun; } } - if (iz+1 < nz_part[r+1]) + if (iz + 1 < nz_part[r + 1]) + { diag_i[cnt] += num_fun; + } else { - if (iz+1 < nz) + if (iz + 1 < nz) { offd_i[cnt] += num_fun; } } - num_coeffs = diag_i[cnt]-diag_i[cnt-1]; - num_offd_coeffs = offd_i[cnt]-offd_i[cnt-1]; + num_coeffs = diag_i[cnt] - diag_i[cnt - 1]; + num_offd_coeffs = offd_i[cnt] - offd_i[cnt - 1]; cnt++; - for (i=1; i < num_fun; i++) + for (i = 1; i < num_fun; i++) { - diag_i[cnt] = diag_i[cnt-1]+num_coeffs; - offd_i[cnt] = offd_i[cnt-1]+num_offd_coeffs; + diag_i[cnt] = diag_i[cnt - 1] + num_coeffs; + offd_i[cnt] = offd_i[cnt - 1] + num_offd_coeffs; cnt++; } } @@ -548,37 +572,37 @@ GenerateSysLaplacian( MPI_Comm comm, } row_index = 0; - for (iz = nz_part[r]; iz < nz_part[r+1]; iz++) + for (iz = nz_part[r]; iz < nz_part[r + 1]; iz++) { - for (iy = ny_part[q]; iy < ny_part[q+1]; iy++) + for (iy = ny_part[q]; iy < ny_part[q + 1]; iy++) { - for (ix = nx_part[p]; ix < nx_part[p+1]; ix++) + for (ix = nx_part[p]; ix < nx_part[p + 1]; ix++) { cnt = diag_i[row_index];; o_cnt = offd_i[row_index];; - num_coeffs = diag_i[row_index+1]-diag_i[row_index]; - num_offd_coeffs = offd_i[row_index+1]-offd_i[row_index]; + num_coeffs = diag_i[row_index + 1] - diag_i[row_index]; + num_offd_coeffs = offd_i[row_index + 1] - offd_i[row_index]; first_j = row_index; - for (i=0; i < num_fun; i++) + for (i = 0; i < num_fun; i++) { - for (j=0; j < num_fun; j++) + for (j = 0; j < num_fun; j++) { - j_ind = cnt+i*num_coeffs+j; - diag_j[j_ind] = first_j+j; - diag_data[j_ind] = value[0]*mtrx[i*num_fun+j]; + j_ind = cnt + i * num_coeffs + j; + diag_j[j_ind] = first_j + j; + diag_data[j_ind] = value[0] * mtrx[i * num_fun + j]; } } cnt += num_fun; if (iz > nz_part[r]) { - first_j = row_index-nx_local*ny_local*num_fun; - for (i=0; i < num_fun; i++) + first_j = row_index - nx_local * ny_local * num_fun; + for (i = 0; i < num_fun; i++) { - for (j=0; j < num_fun; j++) + for (j = 0; j < num_fun; j++) { - j_ind = cnt+i*num_coeffs+j; - diag_j[j_ind] = first_j+j; - diag_data[j_ind] = value[3]*mtrx[i*num_fun+j]; + j_ind = cnt + i * num_coeffs + j; + diag_j[j_ind] = first_j + j; + diag_data[j_ind] = value[3] * mtrx[i * num_fun + j]; } } cnt += num_fun; @@ -587,15 +611,15 @@ GenerateSysLaplacian( MPI_Comm comm, { if (iz) { - big_first_j = big_num_fun*hypre_map(ix,iy,iz-1,p,q,r-1,nx,ny, - nx_part,ny_part,nz_part); - for (i=0; i < num_fun; i++) + big_first_j = big_num_fun * hypre_map(ix, iy, iz - 1, p, q, r - 1, nx, ny, + nx_part, ny_part, nz_part); + for (i = 0; i < num_fun; i++) { - for (j=0; j < num_fun; j++) + for (j = 0; j < num_fun; j++) { - j_ind = o_cnt+i*num_offd_coeffs+j; - big_offd_j[j_ind] = big_first_j+(HYPRE_BigInt)j; - offd_data[j_ind] = value[3]*mtrx[i*num_fun+j]; + j_ind = o_cnt + i * num_offd_coeffs + j; + big_offd_j[j_ind] = big_first_j + (HYPRE_BigInt)j; + offd_data[j_ind] = value[3] * mtrx[i * num_fun + j]; } } o_cnt += num_fun; @@ -603,14 +627,14 @@ GenerateSysLaplacian( MPI_Comm comm, } if (iy > ny_part[q]) { - first_j = row_index-nx_local*num_fun; - for (i=0; i < num_fun; i++) + first_j = row_index - nx_local * num_fun; + for (i = 0; i < num_fun; i++) { - for (j=0; j < num_fun; j++) + for (j = 0; j < num_fun; j++) { - j_ind = cnt+i*num_coeffs+j; - diag_j[j_ind] = first_j+j; - diag_data[j_ind] = value[2]*mtrx[i*num_fun+j]; + j_ind = cnt + i * num_coeffs + j; + diag_j[j_ind] = first_j + j; + diag_data[j_ind] = value[2] * mtrx[i * num_fun + j]; } } cnt += num_fun; @@ -619,15 +643,15 @@ GenerateSysLaplacian( MPI_Comm comm, { if (iy) { - big_first_j = big_num_fun*hypre_map(ix,iy-1,iz,p,q-1,r,nx,ny, - nx_part,ny_part,nz_part); - for (i=0; i < num_fun; i++) + big_first_j = big_num_fun * hypre_map(ix, iy - 1, iz, p, q - 1, r, nx, ny, + nx_part, ny_part, nz_part); + for (i = 0; i < num_fun; i++) { - for (j=0; j < num_fun; j++) + for (j = 0; j < num_fun; j++) { - j_ind = o_cnt+i*num_offd_coeffs+j; - big_offd_j[j_ind] = big_first_j+(HYPRE_BigInt)j; - offd_data[j_ind] = value[2]*mtrx[i*num_fun+j]; + j_ind = o_cnt + i * num_offd_coeffs + j; + big_offd_j[j_ind] = big_first_j + (HYPRE_BigInt)j; + offd_data[j_ind] = value[2] * mtrx[i * num_fun + j]; } } o_cnt += num_fun; @@ -635,14 +659,14 @@ GenerateSysLaplacian( MPI_Comm comm, } if (ix > nx_part[p]) { - first_j = row_index-num_fun; - for (i=0; i < num_fun; i++) + first_j = row_index - num_fun; + for (i = 0; i < num_fun; i++) { - for (j=0; j < num_fun; j++) + for (j = 0; j < num_fun; j++) { - j_ind = cnt+i*num_coeffs+j; - diag_j[j_ind] = first_j+j; - diag_data[j_ind] = value[1]*mtrx[i*num_fun+j]; + j_ind = cnt + i * num_coeffs + j; + diag_j[j_ind] = first_j + j; + diag_data[j_ind] = value[1] * mtrx[i * num_fun + j]; } } cnt += num_fun; @@ -651,111 +675,111 @@ GenerateSysLaplacian( MPI_Comm comm, { if (ix) { - big_first_j = big_num_fun*hypre_map(ix-1,iy,iz,p-1,q,r,nx,ny, - nx_part,ny_part,nz_part); - for (i=0; i < num_fun; i++) + big_first_j = big_num_fun * hypre_map(ix - 1, iy, iz, p - 1, q, r, nx, ny, + nx_part, ny_part, nz_part); + for (i = 0; i < num_fun; i++) { - for (j=0; j < num_fun; j++) + for (j = 0; j < num_fun; j++) { - j_ind = o_cnt+i*num_offd_coeffs+j; - big_offd_j[j_ind] = big_first_j+(HYPRE_BigInt)j; - offd_data[j_ind] = value[1]*mtrx[i*num_fun+j]; + j_ind = o_cnt + i * num_offd_coeffs + j; + big_offd_j[j_ind] = big_first_j + (HYPRE_BigInt)j; + offd_data[j_ind] = value[1] * mtrx[i * num_fun + j]; } } o_cnt += num_fun; } } - if (ix+1 < nx_part[p+1]) + if (ix + 1 < nx_part[p + 1]) { - first_j = row_index+num_fun; - for (i=0; i < num_fun; i++) + first_j = row_index + num_fun; + for (i = 0; i < num_fun; i++) { - for (j=0; j < num_fun; j++) + for (j = 0; j < num_fun; j++) { - j_ind = cnt+i*num_coeffs+j; - diag_j[j_ind] = first_j+j; - diag_data[j_ind] = value[1]*mtrx[i*num_fun+j]; + j_ind = cnt + i * num_coeffs + j; + diag_j[j_ind] = first_j + j; + diag_data[j_ind] = value[1] * mtrx[i * num_fun + j]; } } cnt += num_fun; } else { - if (ix+1 < nx) + if (ix + 1 < nx) { - big_first_j = big_num_fun*hypre_map(ix+1,iy,iz,p+1,q,r,nx,ny, - nx_part,ny_part,nz_part); - for (i=0; i < num_fun; i++) + big_first_j = big_num_fun * hypre_map(ix + 1, iy, iz, p + 1, q, r, nx, ny, + nx_part, ny_part, nz_part); + for (i = 0; i < num_fun; i++) { - for (j=0; j < num_fun; j++) + for (j = 0; j < num_fun; j++) { - j_ind = o_cnt+i*num_offd_coeffs+j; - big_offd_j[j_ind] = big_first_j+(HYPRE_BigInt)j; - offd_data[j_ind] = value[1]*mtrx[i*num_fun+j]; + j_ind = o_cnt + i * num_offd_coeffs + j; + big_offd_j[j_ind] = big_first_j + (HYPRE_BigInt)j; + offd_data[j_ind] = value[1] * mtrx[i * num_fun + j]; } } o_cnt += num_fun; } } - if (iy+1 < ny_part[q+1]) + if (iy + 1 < ny_part[q + 1]) { - first_j = row_index+nx_local*num_fun; - for (i=0; i < num_fun; i++) + first_j = row_index + nx_local * num_fun; + for (i = 0; i < num_fun; i++) { - for (j=0; j < num_fun; j++) + for (j = 0; j < num_fun; j++) { - j_ind = cnt+i*num_coeffs+j; - diag_j[j_ind] = first_j+j; - diag_data[j_ind] = value[2]*mtrx[i*num_fun+j]; + j_ind = cnt + i * num_coeffs + j; + diag_j[j_ind] = first_j + j; + diag_data[j_ind] = value[2] * mtrx[i * num_fun + j]; } } cnt += num_fun; } else { - if (iy+1 < ny) + if (iy + 1 < ny) { - big_first_j = big_num_fun*hypre_map(ix,iy+1,iz,p,q+1,r,nx,ny, - nx_part,ny_part,nz_part); - for (i=0; i < num_fun; i++) + big_first_j = big_num_fun * hypre_map(ix, iy + 1, iz, p, q + 1, r, nx, ny, + nx_part, ny_part, nz_part); + for (i = 0; i < num_fun; i++) { - for (j=0; j < num_fun; j++) + for (j = 0; j < num_fun; j++) { - j_ind = o_cnt+i*num_offd_coeffs+j; - big_offd_j[j_ind] = big_first_j+(HYPRE_BigInt)j; - offd_data[j_ind] = value[2]*mtrx[i*num_fun+j]; + j_ind = o_cnt + i * num_offd_coeffs + j; + big_offd_j[j_ind] = big_first_j + (HYPRE_BigInt)j; + offd_data[j_ind] = value[2] * mtrx[i * num_fun + j]; } } o_cnt += num_fun; } } - if (iz+1 < nz_part[r+1]) + if (iz + 1 < nz_part[r + 1]) { - first_j = row_index+nx_local*ny_local*num_fun; - for (i=0; i < num_fun; i++) + first_j = row_index + nx_local * ny_local * num_fun; + for (i = 0; i < num_fun; i++) { - for (j=0; j < num_fun; j++) + for (j = 0; j < num_fun; j++) { - j_ind = cnt+i*num_coeffs+j; - diag_j[j_ind] = first_j+j; - diag_data[j_ind] = value[3]*mtrx[i*num_fun+j]; + j_ind = cnt + i * num_coeffs + j; + diag_j[j_ind] = first_j + j; + diag_data[j_ind] = value[3] * mtrx[i * num_fun + j]; } } cnt += num_fun; } else { - if (iz+1 < nz) + if (iz + 1 < nz) { - big_first_j = big_num_fun*hypre_map(ix,iy,iz+1,p,q,r+1,nx,ny, - nx_part,ny_part,nz_part); - for (i=0; i < num_fun; i++) + big_first_j = big_num_fun * hypre_map(ix, iy, iz + 1, p, q, r + 1, nx, ny, + nx_part, ny_part, nz_part); + for (i = 0; i < num_fun; i++) { - for (j=0; j < num_fun; j++) + for (j = 0; j < num_fun; j++) { - j_ind = o_cnt+i*num_offd_coeffs+j; - big_offd_j[j_ind] = big_first_j+(HYPRE_BigInt)j; - offd_data[j_ind] = value[3]*mtrx[i*num_fun+j]; + j_ind = o_cnt + i * num_offd_coeffs + j; + big_offd_j[j_ind] = big_first_j + (HYPRE_BigInt)j; + offd_data[j_ind] = value[3] * mtrx[i * num_fun + j]; } } o_cnt += num_fun; @@ -768,19 +792,19 @@ GenerateSysLaplacian( MPI_Comm comm, if (num_procs > 1) { - cnt = 0; - for (i=0; i < local_num_rows; i+=num_fun) + cnt = 0; + for (i = 0; i < local_num_rows; i += num_fun) + { + for (j = offd_i[i]; j < offd_i[i + 1]; j++) { - for (j=offd_i[i]; j < offd_i[i+1]; j++) - { - col_map_offd[cnt++] = big_offd_j[j]; - } + col_map_offd[cnt++] = big_offd_j[j]; } + } - hypre_BigQsort0(col_map_offd, 0, num_cols_offd-1); + hypre_BigQsort0(col_map_offd, 0, num_cols_offd - 1); - for (i=0; i < num_fun*num_cols_offd; i++) - for (j=hypre_min(0,hypre_abs(i-num_fun)); j < num_cols_offd; j++) + for (i = 0; i < num_fun * num_cols_offd; i++) + for (j = hypre_min(0, hypre_abs(i - num_fun)); j < num_cols_offd; j++) if (big_offd_j[i] == col_map_offd[j]) { offd_j[i] = j; @@ -788,16 +812,18 @@ GenerateSysLaplacian( MPI_Comm comm, } } - for (i=0; i < gp_size; i++) + for (i = 0; i < gp_size; i++) + { global_part[i] *= big_num_fun; + } - for (j=1; j< num_fun; j++) + for (j = 1; j < num_fun; j++) { - for (i=0; i nz_part[r]) + { diag_i[cnt] += num_fun; + } else { if (iz) @@ -963,7 +989,9 @@ GenerateSysLaplacianVCoef( MPI_Comm comm, } } if (iy > ny_part[q]) + { diag_i[cnt] += num_fun; + } else { if (iy) @@ -972,7 +1000,9 @@ GenerateSysLaplacianVCoef( MPI_Comm comm, } } if (ix > nx_part[p]) + { diag_i[cnt] += num_fun; + } else { if (ix) @@ -980,40 +1010,46 @@ GenerateSysLaplacianVCoef( MPI_Comm comm, offd_i[cnt] += num_fun; } } - if (ix+1 < nx_part[p+1]) + if (ix + 1 < nx_part[p + 1]) + { diag_i[cnt] += num_fun; + } else { - if (ix+1 < nx) + if (ix + 1 < nx) { offd_i[cnt] += num_fun; } } - if (iy+1 < ny_part[q+1]) + if (iy + 1 < ny_part[q + 1]) + { diag_i[cnt] += num_fun; + } else { - if (iy+1 < ny) + if (iy + 1 < ny) { offd_i[cnt] += num_fun; } } - if (iz+1 < nz_part[r+1]) + if (iz + 1 < nz_part[r + 1]) + { diag_i[cnt] += num_fun; + } else { - if (iz+1 < nz) + if (iz + 1 < nz) { offd_i[cnt] += num_fun; } } - num_coeffs = diag_i[cnt]-diag_i[cnt-1]; - num_offd_coeffs = offd_i[cnt]-offd_i[cnt-1]; + num_coeffs = diag_i[cnt] - diag_i[cnt - 1]; + num_offd_coeffs = offd_i[cnt] - offd_i[cnt - 1]; cnt++; - for (i=1; i < num_fun; i++) + for (i = 1; i < num_fun; i++) { - diag_i[cnt] = diag_i[cnt-1]+num_coeffs; - offd_i[cnt] = offd_i[cnt-1]+num_offd_coeffs; + diag_i[cnt] = diag_i[cnt - 1] + num_coeffs; + offd_i[cnt] = offd_i[cnt - 1] + num_offd_coeffs; cnt++; } } @@ -1031,37 +1067,37 @@ GenerateSysLaplacianVCoef( MPI_Comm comm, } row_index = 0; - for (iz = nz_part[r]; iz < nz_part[r+1]; iz++) + for (iz = nz_part[r]; iz < nz_part[r + 1]; iz++) { - for (iy = ny_part[q]; iy < ny_part[q+1]; iy++) + for (iy = ny_part[q]; iy < ny_part[q + 1]; iy++) { - for (ix = nx_part[p]; ix < nx_part[p+1]; ix++) + for (ix = nx_part[p]; ix < nx_part[p + 1]; ix++) { cnt = diag_i[row_index];; o_cnt = offd_i[row_index];; - num_coeffs = diag_i[row_index+1]-diag_i[row_index]; - num_offd_coeffs = offd_i[row_index+1]-offd_i[row_index]; + num_coeffs = diag_i[row_index + 1] - diag_i[row_index]; + num_offd_coeffs = offd_i[row_index + 1] - offd_i[row_index]; first_j = row_index; - for (i=0; i < num_fun; i++) + for (i = 0; i < num_fun; i++) { - for (j=0; j < num_fun; j++) + for (j = 0; j < num_fun; j++) { - j_ind = cnt+i*num_coeffs+j; - diag_j[j_ind] = first_j+j; - diag_data[j_ind] = value[0*sz + i*num_fun+j]*mtrx[i*num_fun+j]; + j_ind = cnt + i * num_coeffs + j; + diag_j[j_ind] = first_j + j; + diag_data[j_ind] = value[0 * sz + i * num_fun + j] * mtrx[i * num_fun + j]; } } cnt += num_fun; if (iz > nz_part[r]) { - first_j = row_index-nx_local*ny_local*num_fun; - for (i=0; i < num_fun; i++) + first_j = row_index - nx_local * ny_local * num_fun; + for (i = 0; i < num_fun; i++) { - for (j=0; j < num_fun; j++) + for (j = 0; j < num_fun; j++) { - j_ind = cnt+i*num_coeffs+j; - diag_j[j_ind] = first_j+j; - diag_data[j_ind] = value[3*sz + i*num_fun+j]*mtrx[i*num_fun+j]; + j_ind = cnt + i * num_coeffs + j; + diag_j[j_ind] = first_j + j; + diag_data[j_ind] = value[3 * sz + i * num_fun + j] * mtrx[i * num_fun + j]; } } cnt += num_fun; @@ -1070,15 +1106,15 @@ GenerateSysLaplacianVCoef( MPI_Comm comm, { if (iz) { - big_first_j = big_num_fun*hypre_map(ix,iy,iz-1,p,q,r-1,nx,ny, - nx_part,ny_part,nz_part); - for (i=0; i < num_fun; i++) + big_first_j = big_num_fun * hypre_map(ix, iy, iz - 1, p, q, r - 1, nx, ny, + nx_part, ny_part, nz_part); + for (i = 0; i < num_fun; i++) { - for (j=0; j < num_fun; j++) + for (j = 0; j < num_fun; j++) { - j_ind = o_cnt+i*num_offd_coeffs+j; - big_offd_j[j_ind] = big_first_j+(HYPRE_BigInt)j; - offd_data[j_ind] = value[3*sz + i*num_fun+j]*mtrx[i*num_fun+j]; + j_ind = o_cnt + i * num_offd_coeffs + j; + big_offd_j[j_ind] = big_first_j + (HYPRE_BigInt)j; + offd_data[j_ind] = value[3 * sz + i * num_fun + j] * mtrx[i * num_fun + j]; } } o_cnt += num_fun; @@ -1086,14 +1122,14 @@ GenerateSysLaplacianVCoef( MPI_Comm comm, } if (iy > ny_part[q]) { - first_j = row_index-nx_local*num_fun; - for (i=0; i < num_fun; i++) + first_j = row_index - nx_local * num_fun; + for (i = 0; i < num_fun; i++) { - for (j=0; j < num_fun; j++) + for (j = 0; j < num_fun; j++) { - j_ind = cnt+i*num_coeffs+j; - diag_j[j_ind] = first_j+j; - diag_data[j_ind] = value[2*sz + i*num_fun+j]*mtrx[i*num_fun+j]; + j_ind = cnt + i * num_coeffs + j; + diag_j[j_ind] = first_j + j; + diag_data[j_ind] = value[2 * sz + i * num_fun + j] * mtrx[i * num_fun + j]; } } cnt += num_fun; @@ -1102,15 +1138,15 @@ GenerateSysLaplacianVCoef( MPI_Comm comm, { if (iy) { - big_first_j = big_num_fun*hypre_map(ix,iy-1,iz,p,q-1,r,nx,ny, - nx_part,ny_part,nz_part); - for (i=0; i < num_fun; i++) + big_first_j = big_num_fun * hypre_map(ix, iy - 1, iz, p, q - 1, r, nx, ny, + nx_part, ny_part, nz_part); + for (i = 0; i < num_fun; i++) { - for (j=0; j < num_fun; j++) + for (j = 0; j < num_fun; j++) { - j_ind = o_cnt+i*num_offd_coeffs+j; - big_offd_j[j_ind] = big_first_j+(HYPRE_BigInt)j; - offd_data[j_ind] = value[2*sz + i*num_fun+j]*mtrx[i*num_fun+j]; + j_ind = o_cnt + i * num_offd_coeffs + j; + big_offd_j[j_ind] = big_first_j + (HYPRE_BigInt)j; + offd_data[j_ind] = value[2 * sz + i * num_fun + j] * mtrx[i * num_fun + j]; } } o_cnt += num_fun; @@ -1118,14 +1154,14 @@ GenerateSysLaplacianVCoef( MPI_Comm comm, } if (ix > nx_part[p]) { - first_j = row_index-num_fun; - for (i=0; i < num_fun; i++) + first_j = row_index - num_fun; + for (i = 0; i < num_fun; i++) { - for (j=0; j < num_fun; j++) + for (j = 0; j < num_fun; j++) { - j_ind = cnt+i*num_coeffs+j; - diag_j[j_ind] = first_j+j; - diag_data[j_ind] = value[1*sz + i*num_fun+j]*mtrx[i*num_fun+j]; + j_ind = cnt + i * num_coeffs + j; + diag_j[j_ind] = first_j + j; + diag_data[j_ind] = value[1 * sz + i * num_fun + j] * mtrx[i * num_fun + j]; } } cnt += num_fun; @@ -1134,111 +1170,111 @@ GenerateSysLaplacianVCoef( MPI_Comm comm, { if (ix) { - big_first_j = big_num_fun*hypre_map(ix-1,iy,iz,p-1,q,r,nx,ny, - nx_part,ny_part,nz_part); - for (i=0; i < num_fun; i++) + big_first_j = big_num_fun * hypre_map(ix - 1, iy, iz, p - 1, q, r, nx, ny, + nx_part, ny_part, nz_part); + for (i = 0; i < num_fun; i++) { - for (j=0; j < num_fun; j++) + for (j = 0; j < num_fun; j++) { - j_ind = o_cnt+i*num_offd_coeffs+j; - big_offd_j[j_ind] = big_first_j+(HYPRE_BigInt)j; - offd_data[j_ind] = value[1*sz + i*num_fun+j]*mtrx[i*num_fun+j]; + j_ind = o_cnt + i * num_offd_coeffs + j; + big_offd_j[j_ind] = big_first_j + (HYPRE_BigInt)j; + offd_data[j_ind] = value[1 * sz + i * num_fun + j] * mtrx[i * num_fun + j]; } } o_cnt += num_fun; } } - if (ix+1 < nx_part[p+1]) + if (ix + 1 < nx_part[p + 1]) { - first_j = row_index+num_fun; - for (i=0; i < num_fun; i++) + first_j = row_index + num_fun; + for (i = 0; i < num_fun; i++) { - for (j=0; j < num_fun; j++) + for (j = 0; j < num_fun; j++) { - j_ind = cnt+i*num_coeffs+j; - diag_j[j_ind] = first_j+j; - diag_data[j_ind] = value[1*sz + i*num_fun+j]*mtrx[i*num_fun+j]; + j_ind = cnt + i * num_coeffs + j; + diag_j[j_ind] = first_j + j; + diag_data[j_ind] = value[1 * sz + i * num_fun + j] * mtrx[i * num_fun + j]; } } cnt += num_fun; } else { - if (ix+1 < nx) + if (ix + 1 < nx) { - big_first_j = big_num_fun*hypre_map(ix+1,iy,iz,p+1,q,r,nx,ny, - nx_part,ny_part,nz_part); - for (i=0; i < num_fun; i++) + big_first_j = big_num_fun * hypre_map(ix + 1, iy, iz, p + 1, q, r, nx, ny, + nx_part, ny_part, nz_part); + for (i = 0; i < num_fun; i++) { - for (j=0; j < num_fun; j++) + for (j = 0; j < num_fun; j++) { - j_ind = o_cnt+i*num_offd_coeffs+j; - big_offd_j[j_ind] = big_first_j+(HYPRE_BigInt)j; - offd_data[j_ind] = value[1*sz + i*num_fun+j]*mtrx[i*num_fun+j]; + j_ind = o_cnt + i * num_offd_coeffs + j; + big_offd_j[j_ind] = big_first_j + (HYPRE_BigInt)j; + offd_data[j_ind] = value[1 * sz + i * num_fun + j] * mtrx[i * num_fun + j]; } } o_cnt += num_fun; } } - if (iy+1 < ny_part[q+1]) + if (iy + 1 < ny_part[q + 1]) { - first_j = row_index+nx_local*num_fun; - for (i=0; i < num_fun; i++) + first_j = row_index + nx_local * num_fun; + for (i = 0; i < num_fun; i++) { - for (j=0; j < num_fun; j++) + for (j = 0; j < num_fun; j++) { - j_ind = cnt+i*num_coeffs+j; - diag_j[j_ind] = first_j+j; - diag_data[j_ind] = value[2*sz + i*num_fun+j]*mtrx[i*num_fun+j]; + j_ind = cnt + i * num_coeffs + j; + diag_j[j_ind] = first_j + j; + diag_data[j_ind] = value[2 * sz + i * num_fun + j] * mtrx[i * num_fun + j]; } } cnt += num_fun; } else { - if (iy+1 < ny) + if (iy + 1 < ny) { - big_first_j = big_num_fun*hypre_map(ix,iy+1,iz,p,q+1,r,nx,ny, - nx_part,ny_part,nz_part); - for (i=0; i < num_fun; i++) + big_first_j = big_num_fun * hypre_map(ix, iy + 1, iz, p, q + 1, r, nx, ny, + nx_part, ny_part, nz_part); + for (i = 0; i < num_fun; i++) { - for (j=0; j < num_fun; j++) + for (j = 0; j < num_fun; j++) { - j_ind = o_cnt+i*num_offd_coeffs+j; - big_offd_j[j_ind] = big_first_j+(HYPRE_BigInt)j; - offd_data[j_ind] = value[2*sz + i*num_fun+j]*mtrx[i*num_fun+j]; + j_ind = o_cnt + i * num_offd_coeffs + j; + big_offd_j[j_ind] = big_first_j + (HYPRE_BigInt)j; + offd_data[j_ind] = value[2 * sz + i * num_fun + j] * mtrx[i * num_fun + j]; } } o_cnt += num_fun; } } - if (iz+1 < nz_part[r+1]) + if (iz + 1 < nz_part[r + 1]) { - first_j = row_index+nx_local*ny_local*num_fun; - for (i=0; i < num_fun; i++) + first_j = row_index + nx_local * ny_local * num_fun; + for (i = 0; i < num_fun; i++) { - for (j=0; j < num_fun; j++) + for (j = 0; j < num_fun; j++) { - j_ind = cnt+i*num_coeffs+j; - diag_j[j_ind] = first_j+j; - diag_data[j_ind] = value[3*sz + i*num_fun+j]*mtrx[i*num_fun+j]; + j_ind = cnt + i * num_coeffs + j; + diag_j[j_ind] = first_j + j; + diag_data[j_ind] = value[3 * sz + i * num_fun + j] * mtrx[i * num_fun + j]; } } cnt += num_fun; } else { - if (iz+1 < nz) + if (iz + 1 < nz) { - big_first_j = big_num_fun*hypre_map(ix,iy,iz+1,p,q,r+1,nx,ny, - nx_part,ny_part,nz_part); - for (i=0; i < num_fun; i++) + big_first_j = big_num_fun * hypre_map(ix, iy, iz + 1, p, q, r + 1, nx, ny, + nx_part, ny_part, nz_part); + for (i = 0; i < num_fun; i++) { - for (j=0; j < num_fun; j++) + for (j = 0; j < num_fun; j++) { - j_ind = o_cnt+i*num_offd_coeffs+j; - big_offd_j[j_ind] = big_first_j+(HYPRE_BigInt)j; - offd_data[j_ind] = value[3*sz + i*num_fun+j]*mtrx[i*num_fun+j]; + j_ind = o_cnt + i * num_offd_coeffs + j; + big_offd_j[j_ind] = big_first_j + (HYPRE_BigInt)j; + offd_data[j_ind] = value[3 * sz + i * num_fun + j] * mtrx[i * num_fun + j]; } } o_cnt += num_fun; @@ -1251,19 +1287,19 @@ GenerateSysLaplacianVCoef( MPI_Comm comm, if (num_procs > 1) { - cnt = 0; - for (i=0; i < local_num_rows; i+=num_fun) + cnt = 0; + for (i = 0; i < local_num_rows; i += num_fun) + { + for (j = offd_i[i]; j < offd_i[i + 1]; j++) { - for (j=offd_i[i]; j < offd_i[i+1]; j++) - { - col_map_offd[cnt++] = big_offd_j[j]; - } + col_map_offd[cnt++] = big_offd_j[j]; } + } - hypre_BigQsort0(col_map_offd, 0, num_cols_offd-1); + hypre_BigQsort0(col_map_offd, 0, num_cols_offd - 1); - for (i=0; i < num_fun*num_cols_offd; i++) - for (j=hypre_min(0,hypre_abs(i-num_fun)); j < num_cols_offd; j++) + for (i = 0; i < num_fun * num_cols_offd; i++) + for (j = hypre_min(0, hypre_abs(i - num_fun)); j < num_cols_offd; j++) if (big_offd_j[i] == col_map_offd[j]) { offd_j[i] = j; @@ -1271,16 +1307,18 @@ GenerateSysLaplacianVCoef( MPI_Comm comm, } } - for (i=0; i < gp_size; i++) + for (i = 0; i < gp_size; i++) + { global_part[i] *= num_fun; + } - for (j=1; j< num_fun; j++) + for (j = 1; j < num_fun; j++) { - for (i=0; i nz_part[r]) { @@ -143,16 +142,20 @@ GenerateLaplacian27pt(MPI_Comm comm, else { if (ix) + { offd_i[o_cnt]++; + } } - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { diag_i[cnt]++; } else { - if (ix+1 < nx) + if (ix + 1 < nx) + { offd_i[o_cnt]++; + } } } else @@ -168,18 +171,20 @@ GenerateLaplacian27pt(MPI_Comm comm, { offd_i[o_cnt]++; } - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { offd_i[o_cnt]++; } - else if (ix < nx-1) + else if (ix < nx - 1) { offd_i[o_cnt]++; } } } if (ix > nx_part[p]) + { diag_i[cnt]++; + } else { if (ix) @@ -187,16 +192,18 @@ GenerateLaplacian27pt(MPI_Comm comm, offd_i[o_cnt]++; } } - if (ix+1 < nx_part[p+1]) + if (ix + 1 < nx_part[p + 1]) + { diag_i[cnt]++; + } else { - if (ix+1 < nx) + if (ix + 1 < nx) { offd_i[o_cnt]++; } } - if (iy+1 < ny_part[q+1]) + if (iy + 1 < ny_part[q + 1]) { diag_i[cnt]++; if (ix > nx_part[p]) @@ -206,21 +213,25 @@ GenerateLaplacian27pt(MPI_Comm comm, else { if (ix) + { offd_i[o_cnt]++; + } } - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { diag_i[cnt]++; } else { - if (ix+1 < nx) + if (ix + 1 < nx) + { offd_i[o_cnt]++; + } } } else { - if (iy+1 < ny) + if (iy + 1 < ny) { offd_i[o_cnt]++; if (ix > nx_part[p]) @@ -231,11 +242,11 @@ GenerateLaplacian27pt(MPI_Comm comm, { offd_i[o_cnt]++; } - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { offd_i[o_cnt]++; } - else if (ix < nx-1) + else if (ix < nx - 1) { offd_i[o_cnt]++; } @@ -257,16 +268,20 @@ GenerateLaplacian27pt(MPI_Comm comm, else { if (ix) + { offd_i[o_cnt]++; + } } - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { offd_i[o_cnt]++; } else { - if (ix+1 < nx) + if (ix + 1 < nx) + { offd_i[o_cnt]++; + } } } else @@ -282,18 +297,20 @@ GenerateLaplacian27pt(MPI_Comm comm, { offd_i[o_cnt]++; } - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { offd_i[o_cnt]++; } - else if (ix < nx-1) + else if (ix < nx - 1) { offd_i[o_cnt]++; } } } if (ix > nx_part[p]) + { offd_i[o_cnt]++; + } else { if (ix) @@ -301,16 +318,18 @@ GenerateLaplacian27pt(MPI_Comm comm, offd_i[o_cnt]++; } } - if (ix+1 < nx_part[p+1]) + if (ix + 1 < nx_part[p + 1]) + { offd_i[o_cnt]++; + } else { - if (ix+1 < nx) + if (ix + 1 < nx) { offd_i[o_cnt]++; } } - if (iy+1 < ny_part[q+1]) + if (iy + 1 < ny_part[q + 1]) { offd_i[o_cnt]++; if (ix > nx_part[p]) @@ -320,21 +339,25 @@ GenerateLaplacian27pt(MPI_Comm comm, else { if (ix) + { offd_i[o_cnt]++; + } } - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { offd_i[o_cnt]++; } else { - if (ix+1 < nx) + if (ix + 1 < nx) + { offd_i[o_cnt]++; + } } } else { - if (iy+1 < ny) + if (iy + 1 < ny) { offd_i[o_cnt]++; if (ix > nx_part[p]) @@ -345,11 +368,11 @@ GenerateLaplacian27pt(MPI_Comm comm, { offd_i[o_cnt]++; } - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { offd_i[o_cnt]++; } - else if (ix < nx-1) + else if (ix < nx - 1) { offd_i[o_cnt]++; } @@ -367,16 +390,20 @@ GenerateLaplacian27pt(MPI_Comm comm, else { if (ix) + { offd_i[o_cnt]++; + } } - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { diag_i[cnt]++; } else { - if (ix+1 < nx) + if (ix + 1 < nx) + { offd_i[o_cnt]++; + } } } else @@ -392,18 +419,20 @@ GenerateLaplacian27pt(MPI_Comm comm, { offd_i[o_cnt]++; } - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { offd_i[o_cnt]++; } - else if (ix < nx-1) + else if (ix < nx - 1) { offd_i[o_cnt]++; } } } if (ix > nx_part[p]) + { diag_i[cnt]++; + } else { if (ix) @@ -411,16 +440,18 @@ GenerateLaplacian27pt(MPI_Comm comm, offd_i[o_cnt]++; } } - if (ix+1 < nx_part[p+1]) + if (ix + 1 < nx_part[p + 1]) + { diag_i[cnt]++; + } else { - if (ix+1 < nx) + if (ix + 1 < nx) { offd_i[o_cnt]++; } } - if (iy+1 < ny_part[q+1]) + if (iy + 1 < ny_part[q + 1]) { diag_i[cnt]++; if (ix > nx_part[p]) @@ -430,21 +461,25 @@ GenerateLaplacian27pt(MPI_Comm comm, else { if (ix) + { offd_i[o_cnt]++; + } } - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { diag_i[cnt]++; } else { - if (ix+1 < nx) + if (ix + 1 < nx) + { offd_i[o_cnt]++; + } } } else { - if (iy+1 < ny) + if (iy + 1 < ny) { offd_i[o_cnt]++; if (ix > nx_part[p]) @@ -455,17 +490,17 @@ GenerateLaplacian27pt(MPI_Comm comm, { offd_i[o_cnt]++; } - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { offd_i[o_cnt]++; } - else if (ix < nx-1) + else if (ix < nx - 1) { offd_i[o_cnt]++; } } } - if (iz+1 < nz_part[r+1]) + if (iz + 1 < nz_part[r + 1]) { diag_i[cnt]++; if (iy > ny_part[q]) @@ -478,16 +513,20 @@ GenerateLaplacian27pt(MPI_Comm comm, else { if (ix) + { offd_i[o_cnt]++; + } } - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { diag_i[cnt]++; } else { - if (ix+1 < nx) + if (ix + 1 < nx) + { offd_i[o_cnt]++; + } } } else @@ -503,18 +542,20 @@ GenerateLaplacian27pt(MPI_Comm comm, { offd_i[o_cnt]++; } - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { offd_i[o_cnt]++; } - else if (ix < nx-1) + else if (ix < nx - 1) { offd_i[o_cnt]++; } } } if (ix > nx_part[p]) + { diag_i[cnt]++; + } else { if (ix) @@ -522,16 +563,18 @@ GenerateLaplacian27pt(MPI_Comm comm, offd_i[o_cnt]++; } } - if (ix+1 < nx_part[p+1]) + if (ix + 1 < nx_part[p + 1]) + { diag_i[cnt]++; + } else { - if (ix+1 < nx) + if (ix + 1 < nx) { offd_i[o_cnt]++; } } - if (iy+1 < ny_part[q+1]) + if (iy + 1 < ny_part[q + 1]) { diag_i[cnt]++; if (ix > nx_part[p]) @@ -541,21 +584,25 @@ GenerateLaplacian27pt(MPI_Comm comm, else { if (ix) + { offd_i[o_cnt]++; + } } - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { diag_i[cnt]++; } else { - if (ix+1 < nx) + if (ix + 1 < nx) + { offd_i[o_cnt]++; + } } } else { - if (iy+1 < ny) + if (iy + 1 < ny) { offd_i[o_cnt]++; if (ix > nx_part[p]) @@ -566,11 +613,11 @@ GenerateLaplacian27pt(MPI_Comm comm, { offd_i[o_cnt]++; } - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { offd_i[o_cnt]++; } - else if (ix < nx-1) + else if (ix < nx - 1) { offd_i[o_cnt]++; } @@ -579,7 +626,7 @@ GenerateLaplacian27pt(MPI_Comm comm, } else { - if (iz+1 < nz) + if (iz + 1 < nz) { offd_i[o_cnt]++; if (iy > ny_part[q]) @@ -592,16 +639,20 @@ GenerateLaplacian27pt(MPI_Comm comm, else { if (ix) + { offd_i[o_cnt]++; + } } - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { offd_i[o_cnt]++; } else { - if (ix+1 < nx) + if (ix + 1 < nx) + { offd_i[o_cnt]++; + } } } else @@ -617,18 +668,20 @@ GenerateLaplacian27pt(MPI_Comm comm, { offd_i[o_cnt]++; } - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { offd_i[o_cnt]++; } - else if (ix < nx-1) + else if (ix < nx - 1) { offd_i[o_cnt]++; } } } if (ix > nx_part[p]) + { offd_i[o_cnt]++; + } else { if (ix) @@ -636,16 +689,18 @@ GenerateLaplacian27pt(MPI_Comm comm, offd_i[o_cnt]++; } } - if (ix+1 < nx_part[p+1]) + if (ix + 1 < nx_part[p + 1]) + { offd_i[o_cnt]++; + } else { - if (ix+1 < nx) + if (ix + 1 < nx) { offd_i[o_cnt]++; } } - if (iy+1 < ny_part[q+1]) + if (iy + 1 < ny_part[q + 1]) { offd_i[o_cnt]++; if (ix > nx_part[p]) @@ -655,21 +710,25 @@ GenerateLaplacian27pt(MPI_Comm comm, else { if (ix) + { offd_i[o_cnt]++; + } } - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { offd_i[o_cnt]++; } else { - if (ix+1 < nx) + if (ix + 1 < nx) + { offd_i[o_cnt]++; + } } } else { - if (iy+1 < ny) + if (iy + 1 < ny) { offd_i[o_cnt]++; if (ix > nx_part[p]) @@ -680,11 +739,11 @@ GenerateLaplacian27pt(MPI_Comm comm, { offd_i[o_cnt]++; } - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { offd_i[o_cnt]++; } - else if (ix < nx-1) + else if (ix < nx - 1) { offd_i[o_cnt]++; } @@ -706,15 +765,15 @@ GenerateLaplacian27pt(MPI_Comm comm, offd_data = hypre_CTAlloc(HYPRE_Real, offd_i[local_num_rows], HYPRE_MEMORY_HOST); } - nxy = nx_local*ny_local; + nxy = nx_local * ny_local; row_index = 0; cnt = 0; o_cnt = 0; - for (iz = nz_part[r]; iz < nz_part[r+1]; iz++) + for (iz = nz_part[r]; iz < nz_part[r + 1]; iz++) { - for (iy = ny_part[q]; iy < ny_part[q+1]; iy++) + for (iy = ny_part[q]; iy < ny_part[q + 1]; iy++) { - for (ix = nx_part[p]; ix < nx_part[p+1]; ix++) + for (ix = nx_part[p]; ix < nx_part[p + 1]; ix++) { diag_j[cnt] = row_index; diag_data[cnt++] = value[0]; @@ -724,31 +783,31 @@ GenerateLaplacian27pt(MPI_Comm comm, { if (ix > nx_part[p]) { - diag_j[cnt] = row_index-nxy-nx_local-1; + diag_j[cnt] = row_index - nxy - nx_local - 1; diag_data[cnt++] = value[1]; } else { if (ix) { - big_offd_j[o_cnt] = hypre_map(ix-1,iy-1,iz-1,p-1,q,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix - 1, iy - 1, iz - 1, p - 1, q, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } } - diag_j[cnt] = row_index-nxy-nx_local; + diag_j[cnt] = row_index - nxy - nx_local; diag_data[cnt++] = value[1]; - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { - diag_j[cnt] = row_index-nxy-nx_local+1; + diag_j[cnt] = row_index - nxy - nx_local + 1; diag_data[cnt++] = value[1]; } else { - if (ix+1 < nx) + if (ix + 1 < nx) { - big_offd_j[o_cnt] = hypre_map(ix+1,iy-1,iz-1,p+1,q,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix + 1, iy - 1, iz - 1, p + 1, q, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } } @@ -759,125 +818,125 @@ GenerateLaplacian27pt(MPI_Comm comm, { if (ix > nx_part[p]) { - big_offd_j[o_cnt] = hypre_map(ix-1,iy-1,iz-1,p,q-1,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix - 1, iy - 1, iz - 1, p, q - 1, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } else if (ix) { - big_offd_j[o_cnt] = hypre_map(ix-1,iy-1,iz-1,p-1,q-1,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix - 1, iy - 1, iz - 1, p - 1, q - 1, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } - big_offd_j[o_cnt] = hypre_map(ix,iy-1,iz-1,p,q-1,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix, iy - 1, iz - 1, p, q - 1, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { - big_offd_j[o_cnt] = hypre_map(ix+1,iy-1,iz-1,p,q-1,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix + 1, iy - 1, iz - 1, p, q - 1, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } - else if (ix < nx-1) + else if (ix < nx - 1) { - big_offd_j[o_cnt] = hypre_map(ix+1,iy-1,iz-1,p+1,q-1,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix + 1, iy - 1, iz - 1, p + 1, q - 1, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } } } if (ix > nx_part[p]) { - diag_j[cnt] = row_index-nxy-1; + diag_j[cnt] = row_index - nxy - 1; diag_data[cnt++] = value[1]; } else { if (ix) { - big_offd_j[o_cnt] = hypre_map(ix-1,iy,iz-1,p-1,q,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix - 1, iy, iz - 1, p - 1, q, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } } - diag_j[cnt] = row_index-nxy; + diag_j[cnt] = row_index - nxy; diag_data[cnt++] = value[1]; - if (ix+1 < nx_part[p+1]) + if (ix + 1 < nx_part[p + 1]) { - diag_j[cnt] = row_index-nxy+1; + diag_j[cnt] = row_index - nxy + 1; diag_data[cnt++] = value[1]; } else { - if (ix+1 < nx) + if (ix + 1 < nx) { - big_offd_j[o_cnt] = hypre_map(ix+1,iy,iz-1,p+1,q,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix + 1, iy, iz - 1, p + 1, q, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } } - if (iy+1 < ny_part[q+1]) + if (iy + 1 < ny_part[q + 1]) { if (ix > nx_part[p]) { - diag_j[cnt] = row_index-nxy+nx_local-1; + diag_j[cnt] = row_index - nxy + nx_local - 1; diag_data[cnt++] = value[1]; } else { if (ix) { - big_offd_j[o_cnt] = hypre_map(ix-1,iy+1,iz-1,p-1,q,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix - 1, iy + 1, iz - 1, p - 1, q, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } } - diag_j[cnt] = row_index-nxy+nx_local; + diag_j[cnt] = row_index - nxy + nx_local; diag_data[cnt++] = value[1]; - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { - diag_j[cnt] = row_index-nxy+nx_local+1; + diag_j[cnt] = row_index - nxy + nx_local + 1; diag_data[cnt++] = value[1]; } else { - if (ix+1 < nx) + if (ix + 1 < nx) { - big_offd_j[o_cnt] = hypre_map(ix+1,iy+1,iz-1,p+1,q,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix + 1, iy + 1, iz - 1, p + 1, q, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } } } else { - if (iy+1 < ny) + if (iy + 1 < ny) { if (ix > nx_part[p]) { - big_offd_j[o_cnt] = hypre_map(ix-1,iy+1,iz-1,p,q+1,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix - 1, iy + 1, iz - 1, p, q + 1, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } else if (ix) { - big_offd_j[o_cnt] = hypre_map(ix-1,iy+1,iz-1,p-1,q+1,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix - 1, iy + 1, iz - 1, p - 1, q + 1, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } - big_offd_j[o_cnt] = hypre_map(ix,iy+1,iz-1,p,q+1,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix, iy + 1, iz - 1, p, q + 1, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { - big_offd_j[o_cnt] = hypre_map(ix+1,iy+1,iz-1,p,q+1,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix + 1, iy + 1, iz - 1, p, q + 1, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } - else if (ix < nx-1) + else if (ix < nx - 1) { - big_offd_j[o_cnt] = hypre_map(ix+1,iy+1,iz-1,p+1,q+1,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix + 1, iy + 1, iz - 1, p + 1, q + 1, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } } @@ -891,34 +950,34 @@ GenerateLaplacian27pt(MPI_Comm comm, { if (ix > nx_part[p]) { - big_offd_j[o_cnt] = hypre_map(ix-1,iy-1,iz-1,p,q,r-1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix - 1, iy - 1, iz - 1, p, q, r - 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } else { if (ix) { - big_offd_j[o_cnt] = hypre_map(ix-1,iy-1,iz-1,p-1,q,r-1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix - 1, iy - 1, iz - 1, p - 1, q, r - 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } } - big_offd_j[o_cnt] = hypre_map(ix,iy-1,iz-1,p,q,r-1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix, iy - 1, iz - 1, p, q, r - 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { - big_offd_j[o_cnt] = hypre_map(ix+1,iy-1,iz-1,p,q,r-1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix + 1, iy - 1, iz - 1, p, q, r - 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } else { - if (ix+1 < nx) + if (ix + 1 < nx) { - big_offd_j[o_cnt] = hypre_map(ix+1,iy-1,iz-1,p+1,q,r-1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix + 1, iy - 1, iz - 1, p + 1, q, r - 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } } @@ -929,131 +988,131 @@ GenerateLaplacian27pt(MPI_Comm comm, { if (ix > nx_part[p]) { - big_offd_j[o_cnt] = hypre_map(ix-1,iy-1,iz-1,p,q-1,r-1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix - 1, iy - 1, iz - 1, p, q - 1, r - 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } else if (ix) { - big_offd_j[o_cnt] =hypre_map(ix-1,iy-1,iz-1,p-1,q-1,r-1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix - 1, iy - 1, iz - 1, p - 1, q - 1, r - 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } - big_offd_j[o_cnt] = hypre_map(ix,iy-1,iz-1,p,q-1,r-1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix, iy - 1, iz - 1, p, q - 1, r - 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { - big_offd_j[o_cnt] = hypre_map(ix+1,iy-1,iz-1,p,q-1,r-1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix + 1, iy - 1, iz - 1, p, q - 1, r - 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } - else if (ix < nx-1) + else if (ix < nx - 1) { - big_offd_j[o_cnt] =hypre_map(ix+1,iy-1,iz-1,p+1,q-1,r-1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix + 1, iy - 1, iz - 1, p + 1, q - 1, r - 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } } } if (ix > nx_part[p]) { - big_offd_j[o_cnt] =hypre_map(ix-1,iy,iz-1,p,q,r-1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix - 1, iy, iz - 1, p, q, r - 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } else { if (ix) { - big_offd_j[o_cnt] =hypre_map(ix-1,iy,iz-1,p-1,q,r-1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix - 1, iy, iz - 1, p - 1, q, r - 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } } - big_offd_j[o_cnt] =hypre_map(ix,iy,iz-1,p,q,r-1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix, iy, iz - 1, p, q, r - 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; - if (ix+1 < nx_part[p+1]) + if (ix + 1 < nx_part[p + 1]) { - big_offd_j[o_cnt] =hypre_map(ix+1,iy,iz-1,p,q,r-1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix + 1, iy, iz - 1, p, q, r - 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } else { - if (ix+1 < nx) + if (ix + 1 < nx) { - big_offd_j[o_cnt] =hypre_map(ix+1,iy,iz-1,p+1,q,r-1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix + 1, iy, iz - 1, p + 1, q, r - 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } } - if (iy+1 < ny_part[q+1]) + if (iy + 1 < ny_part[q + 1]) { if (ix > nx_part[p]) { - big_offd_j[o_cnt] =hypre_map(ix-1,iy+1,iz-1,p,q,r-1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix - 1, iy + 1, iz - 1, p, q, r - 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } else { if (ix) { - big_offd_j[o_cnt] =hypre_map(ix-1,iy+1,iz-1,p-1,q,r-1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix - 1, iy + 1, iz - 1, p - 1, q, r - 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } } - big_offd_j[o_cnt] =hypre_map(ix,iy+1,iz-1,p,q,r-1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix, iy + 1, iz - 1, p, q, r - 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { - big_offd_j[o_cnt] =hypre_map(ix+1,iy+1,iz-1,p,q,r-1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix + 1, iy + 1, iz - 1, p, q, r - 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } else { - if (ix+1 < nx) + if (ix + 1 < nx) { - big_offd_j[o_cnt] =hypre_map(ix+1,iy+1,iz-1,p+1,q,r-1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix + 1, iy + 1, iz - 1, p + 1, q, r - 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } } } else { - if (iy+1 < ny) + if (iy + 1 < ny) { if (ix > nx_part[p]) { - big_offd_j[o_cnt] =hypre_map(ix-1,iy+1,iz-1,p,q+1,r-1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix - 1, iy + 1, iz - 1, p, q + 1, r - 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } else if (ix) { - big_offd_j[o_cnt] =hypre_map(ix-1,iy+1,iz-1,p-1,q+1,r-1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix - 1, iy + 1, iz - 1, p - 1, q + 1, r - 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } - big_offd_j[o_cnt] =hypre_map(ix,iy+1,iz-1,p,q+1,r-1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix, iy + 1, iz - 1, p, q + 1, r - 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { - big_offd_j[o_cnt] =hypre_map(ix+1,iy+1,iz-1,p,q+1,r-1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix + 1, iy + 1, iz - 1, p, q + 1, r - 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } - else if (ix < nx-1) + else if (ix < nx - 1) { - big_offd_j[o_cnt] =hypre_map(ix+1,iy+1,iz-1,p+1,q+1,r-1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix + 1, iy + 1, iz - 1, p + 1, q + 1, r - 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } } @@ -1064,31 +1123,31 @@ GenerateLaplacian27pt(MPI_Comm comm, { if (ix > nx_part[p]) { - diag_j[cnt] = row_index-nx_local-1; + diag_j[cnt] = row_index - nx_local - 1; diag_data[cnt++] = value[1]; } else { if (ix) { - big_offd_j[o_cnt] =hypre_map(ix-1,iy-1,iz,p-1,q,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix - 1, iy - 1, iz, p - 1, q, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } } - diag_j[cnt] = row_index-nx_local; + diag_j[cnt] = row_index - nx_local; diag_data[cnt++] = value[1]; - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { - diag_j[cnt] = row_index-nx_local+1; + diag_j[cnt] = row_index - nx_local + 1; diag_data[cnt++] = value[1]; } else { - if (ix+1 < nx) + if (ix + 1 < nx) { - big_offd_j[o_cnt] =hypre_map(ix+1,iy-1,iz,p+1,q,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix + 1, iy - 1, iz, p + 1, q, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } } @@ -1099,158 +1158,158 @@ GenerateLaplacian27pt(MPI_Comm comm, { if (ix > nx_part[p]) { - big_offd_j[o_cnt] =hypre_map(ix-1,iy-1,iz,p,q-1,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix - 1, iy - 1, iz, p, q - 1, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } else if (ix) { - big_offd_j[o_cnt] =hypre_map(ix-1,iy-1,iz,p-1,q-1,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix - 1, iy - 1, iz, p - 1, q - 1, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } - big_offd_j[o_cnt] =hypre_map(ix,iy-1,iz,p,q-1,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix, iy - 1, iz, p, q - 1, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { - big_offd_j[o_cnt] =hypre_map(ix+1,iy-1,iz,p,q-1,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix + 1, iy - 1, iz, p, q - 1, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } - else if (ix < nx-1) + else if (ix < nx - 1) { - big_offd_j[o_cnt] =hypre_map(ix+1,iy-1,iz,p+1,q-1,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix + 1, iy - 1, iz, p + 1, q - 1, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } } } if (ix > nx_part[p]) { - diag_j[cnt] = row_index-1; + diag_j[cnt] = row_index - 1; diag_data[cnt++] = value[1]; } else { if (ix) { - big_offd_j[o_cnt] =hypre_map(ix-1,iy,iz,p-1,q,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix - 1, iy, iz, p - 1, q, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } } - if (ix+1 < nx_part[p+1]) + if (ix + 1 < nx_part[p + 1]) { - diag_j[cnt] = row_index+1; + diag_j[cnt] = row_index + 1; diag_data[cnt++] = value[1]; } else { - if (ix+1 < nx) + if (ix + 1 < nx) { - big_offd_j[o_cnt] =hypre_map(ix+1,iy,iz,p+1,q,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix + 1, iy, iz, p + 1, q, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } } - if (iy+1 < ny_part[q+1]) + if (iy + 1 < ny_part[q + 1]) { if (ix > nx_part[p]) { - diag_j[cnt] = row_index+nx_local-1; + diag_j[cnt] = row_index + nx_local - 1; diag_data[cnt++] = value[1]; } else { if (ix) { - big_offd_j[o_cnt] =hypre_map(ix-1,iy+1,iz,p-1,q,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix - 1, iy + 1, iz, p - 1, q, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } } - diag_j[cnt] = row_index+nx_local; + diag_j[cnt] = row_index + nx_local; diag_data[cnt++] = value[1]; - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { - diag_j[cnt] = row_index+nx_local+1; + diag_j[cnt] = row_index + nx_local + 1; diag_data[cnt++] = value[1]; } else { - if (ix+1 < nx) + if (ix + 1 < nx) { - big_offd_j[o_cnt] =hypre_map(ix+1,iy+1,iz,p+1,q,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix + 1, iy + 1, iz, p + 1, q, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } } } else { - if (iy+1 < ny) + if (iy + 1 < ny) { if (ix > nx_part[p]) { - big_offd_j[o_cnt] =hypre_map(ix-1,iy+1,iz,p,q+1,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix - 1, iy + 1, iz, p, q + 1, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } else if (ix) { - big_offd_j[o_cnt] =hypre_map(ix-1,iy+1,iz,p-1,q+1,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix - 1, iy + 1, iz, p - 1, q + 1, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } - big_offd_j[o_cnt] =hypre_map(ix,iy+1,iz,p,q+1,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix, iy + 1, iz, p, q + 1, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { - big_offd_j[o_cnt] =hypre_map(ix+1,iy+1,iz,p,q+1,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix + 1, iy + 1, iz, p, q + 1, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } - else if (ix < nx-1) + else if (ix < nx - 1) { - big_offd_j[o_cnt] =hypre_map(ix+1,iy+1,iz,p+1,q+1,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix + 1, iy + 1, iz, p + 1, q + 1, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } } } - if (iz+1 < nz_part[r+1]) + if (iz + 1 < nz_part[r + 1]) { if (iy > ny_part[q]) { if (ix > nx_part[p]) { - diag_j[cnt] = row_index+nxy-nx_local-1; + diag_j[cnt] = row_index + nxy - nx_local - 1; diag_data[cnt++] = value[1]; } else { if (ix) { - big_offd_j[o_cnt] =hypre_map(ix-1,iy-1,iz+1,p-1,q,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix - 1, iy - 1, iz + 1, p - 1, q, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } } - diag_j[cnt] = row_index+nxy-nx_local; + diag_j[cnt] = row_index + nxy - nx_local; diag_data[cnt++] = value[1]; - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { - diag_j[cnt] = row_index+nxy-nx_local+1; + diag_j[cnt] = row_index + nxy - nx_local + 1; diag_data[cnt++] = value[1]; } else { - if (ix+1 < nx) + if (ix + 1 < nx) { - big_offd_j[o_cnt] =hypre_map(ix+1,iy-1,iz+1,p+1,q,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix + 1, iy - 1, iz + 1, p + 1, q, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } } @@ -1261,125 +1320,125 @@ GenerateLaplacian27pt(MPI_Comm comm, { if (ix > nx_part[p]) { - big_offd_j[o_cnt] =hypre_map(ix-1,iy-1,iz+1,p,q-1,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix - 1, iy - 1, iz + 1, p, q - 1, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } else if (ix) { - big_offd_j[o_cnt] =hypre_map(ix-1,iy-1,iz+1,p-1,q-1,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix - 1, iy - 1, iz + 1, p - 1, q - 1, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } - big_offd_j[o_cnt] =hypre_map(ix,iy-1,iz+1,p,q-1,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix, iy - 1, iz + 1, p, q - 1, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { - big_offd_j[o_cnt] =hypre_map(ix+1,iy-1,iz+1,p,q-1,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix + 1, iy - 1, iz + 1, p, q - 1, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } - else if (ix < nx-1) + else if (ix < nx - 1) { - big_offd_j[o_cnt] =hypre_map(ix+1,iy-1,iz+1,p+1,q-1,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix + 1, iy - 1, iz + 1, p + 1, q - 1, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } } } if (ix > nx_part[p]) { - diag_j[cnt] = row_index+nxy-1; + diag_j[cnt] = row_index + nxy - 1; diag_data[cnt++] = value[1]; } else { if (ix) { - big_offd_j[o_cnt] =hypre_map(ix-1,iy,iz+1,p-1,q,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix - 1, iy, iz + 1, p - 1, q, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } } - diag_j[cnt] = row_index+nxy; + diag_j[cnt] = row_index + nxy; diag_data[cnt++] = value[1]; - if (ix+1 < nx_part[p+1]) + if (ix + 1 < nx_part[p + 1]) { - diag_j[cnt] = row_index+nxy+1; + diag_j[cnt] = row_index + nxy + 1; diag_data[cnt++] = value[1]; } else { - if (ix+1 < nx) + if (ix + 1 < nx) { - big_offd_j[o_cnt] =hypre_map(ix+1,iy,iz+1,p+1,q,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix + 1, iy, iz + 1, p + 1, q, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } } - if (iy+1 < ny_part[q+1]) + if (iy + 1 < ny_part[q + 1]) { if (ix > nx_part[p]) { - diag_j[cnt] = row_index+nxy+nx_local-1; + diag_j[cnt] = row_index + nxy + nx_local - 1; diag_data[cnt++] = value[1]; } else { if (ix) { - big_offd_j[o_cnt] =hypre_map(ix-1,iy+1,iz+1,p-1,q,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix - 1, iy + 1, iz + 1, p - 1, q, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } } - diag_j[cnt] = row_index+nxy+nx_local; + diag_j[cnt] = row_index + nxy + nx_local; diag_data[cnt++] = value[1]; - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { - diag_j[cnt] = row_index+nxy+nx_local+1; + diag_j[cnt] = row_index + nxy + nx_local + 1; diag_data[cnt++] = value[1]; } else { - if (ix+1 < nx) + if (ix + 1 < nx) { - big_offd_j[o_cnt] =hypre_map(ix+1,iy+1,iz+1,p+1,q,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix + 1, iy + 1, iz + 1, p + 1, q, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } } } else { - if (iy+1 < ny) + if (iy + 1 < ny) { if (ix > nx_part[p]) { - big_offd_j[o_cnt] =hypre_map(ix-1,iy+1,iz+1,p,q+1,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix - 1, iy + 1, iz + 1, p, q + 1, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } else if (ix) { - big_offd_j[o_cnt] =hypre_map(ix-1,iy+1,iz+1,p-1,q+1,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix - 1, iy + 1, iz + 1, p - 1, q + 1, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } - big_offd_j[o_cnt] =hypre_map(ix,iy+1,iz+1,p,q+1,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix, iy + 1, iz + 1, p, q + 1, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { - big_offd_j[o_cnt] =hypre_map(ix+1,iy+1,iz+1,p,q+1,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix + 1, iy + 1, iz + 1, p, q + 1, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } - else if (ix < nx-1) + else if (ix < nx - 1) { - big_offd_j[o_cnt] =hypre_map(ix+1,iy+1,iz+1,p+1,q+1,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix + 1, iy + 1, iz + 1, p + 1, q + 1, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } } @@ -1387,40 +1446,40 @@ GenerateLaplacian27pt(MPI_Comm comm, } else { - if (iz+1 < nz) + if (iz + 1 < nz) { if (iy > ny_part[q]) { if (ix > nx_part[p]) { - big_offd_j[o_cnt] =hypre_map(ix-1,iy-1,iz+1,p,q,r+1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix - 1, iy - 1, iz + 1, p, q, r + 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } else { if (ix) { - big_offd_j[o_cnt] =hypre_map(ix-1,iy-1,iz+1,p-1,q,r+1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix - 1, iy - 1, iz + 1, p - 1, q, r + 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } } - big_offd_j[o_cnt] =hypre_map(ix,iy-1,iz+1,p,q,r+1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix, iy - 1, iz + 1, p, q, r + 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { - big_offd_j[o_cnt] =hypre_map(ix+1,iy-1,iz+1,p,q,r+1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix + 1, iy - 1, iz + 1, p, q, r + 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } else { - if (ix+1 < nx) + if (ix + 1 < nx) { - big_offd_j[o_cnt] =hypre_map(ix+1,iy-1,iz+1,p+1,q,r+1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix + 1, iy - 1, iz + 1, p + 1, q, r + 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } } @@ -1431,131 +1490,131 @@ GenerateLaplacian27pt(MPI_Comm comm, { if (ix > nx_part[p]) { - big_offd_j[o_cnt] =hypre_map(ix-1,iy-1,iz+1,p,q-1,r+1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix - 1, iy - 1, iz + 1, p, q - 1, r + 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } else if (ix) { - big_offd_j[o_cnt] =hypre_map(ix-1,iy-1,iz+1,p-1,q-1,r+1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix - 1, iy - 1, iz + 1, p - 1, q - 1, r + 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } - big_offd_j[o_cnt] =hypre_map(ix,iy-1,iz+1,p,q-1,r+1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix, iy - 1, iz + 1, p, q - 1, r + 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { - big_offd_j[o_cnt] =hypre_map(ix+1,iy-1,iz+1,p,q-1,r+1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix + 1, iy - 1, iz + 1, p, q - 1, r + 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } - else if (ix < nx-1) + else if (ix < nx - 1) { - big_offd_j[o_cnt] =hypre_map(ix+1,iy-1,iz+1,p+1,q-1,r+1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix + 1, iy - 1, iz + 1, p + 1, q - 1, r + 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } } } if (ix > nx_part[p]) { - big_offd_j[o_cnt] =hypre_map(ix-1,iy,iz+1,p,q,r+1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix - 1, iy, iz + 1, p, q, r + 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } else { if (ix) { - big_offd_j[o_cnt] =hypre_map(ix-1,iy,iz+1,p-1,q,r+1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix - 1, iy, iz + 1, p - 1, q, r + 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } } - big_offd_j[o_cnt] =hypre_map(ix,iy,iz+1,p,q,r+1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix, iy, iz + 1, p, q, r + 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; - if (ix+1 < nx_part[p+1]) + if (ix + 1 < nx_part[p + 1]) { - big_offd_j[o_cnt] =hypre_map(ix+1,iy,iz+1,p,q,r+1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix + 1, iy, iz + 1, p, q, r + 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } else { - if (ix+1 < nx) + if (ix + 1 < nx) { - big_offd_j[o_cnt] =hypre_map(ix+1,iy,iz+1,p+1,q,r+1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix + 1, iy, iz + 1, p + 1, q, r + 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } } - if (iy+1 < ny_part[q+1]) + if (iy + 1 < ny_part[q + 1]) { if (ix > nx_part[p]) { - big_offd_j[o_cnt] =hypre_map(ix-1,iy+1,iz+1,p,q,r+1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix - 1, iy + 1, iz + 1, p, q, r + 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } else { if (ix) { - big_offd_j[o_cnt] =hypre_map(ix-1,iy+1,iz+1,p-1,q,r+1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix - 1, iy + 1, iz + 1, p - 1, q, r + 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } } - big_offd_j[o_cnt] =hypre_map(ix,iy+1,iz+1,p,q,r+1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix, iy + 1, iz + 1, p, q, r + 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { - big_offd_j[o_cnt] =hypre_map(ix+1,iy+1,iz+1,p,q,r+1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix + 1, iy + 1, iz + 1, p, q, r + 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } else { - if (ix+1 < nx) + if (ix + 1 < nx) { - big_offd_j[o_cnt] =hypre_map(ix+1,iy+1,iz+1,p+1,q,r+1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix + 1, iy + 1, iz + 1, p + 1, q, r + 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } } } else { - if (iy+1 < ny) + if (iy + 1 < ny) { if (ix > nx_part[p]) { - big_offd_j[o_cnt] =hypre_map(ix-1,iy+1,iz+1,p,q+1,r+1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix - 1, iy + 1, iz + 1, p, q + 1, r + 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } else if (ix) { - big_offd_j[o_cnt] =hypre_map(ix-1,iy+1,iz+1,p-1,q+1,r+1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix - 1, iy + 1, iz + 1, p - 1, q + 1, r + 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } - big_offd_j[o_cnt] =hypre_map(ix,iy+1,iz+1,p,q+1,r+1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix, iy + 1, iz + 1, p, q + 1, r + 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { - big_offd_j[o_cnt] =hypre_map(ix+1,iy+1,iz+1,p,q+1,r+1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix + 1, iy + 1, iz + 1, p, q + 1, r + 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } - else if (ix < nx-1) + else if (ix < nx - 1) { - big_offd_j[o_cnt] =hypre_map(ix+1,iy+1,iz+1,p+1,q+1,r+1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix + 1, iy + 1, iz + 1, p + 1, q + 1, r + 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = value[1]; } } @@ -1571,14 +1630,16 @@ GenerateLaplacian27pt(MPI_Comm comm, { work = hypre_CTAlloc(HYPRE_BigInt, o_cnt, HYPRE_MEMORY_HOST); - for (i=0; i < o_cnt; i++) + for (i = 0; i < o_cnt; i++) + { work[i] = big_offd_j[i]; + } - hypre_BigQsort0(work, 0, o_cnt-1); + hypre_BigQsort0(work, 0, o_cnt - 1); col_map_offd[0] = work[0]; cnt = 0; - for (i=0; i < o_cnt; i++) + for (i = 0; i < o_cnt; i++) { if (work[i] > col_map_offd[cnt]) { @@ -1587,9 +1648,9 @@ GenerateLaplacian27pt(MPI_Comm comm, } } - for (i=0; i < o_cnt; i++) + for (i = 0; i < o_cnt; i++) { - offd_j[i] = hypre_BigBinarySearch(col_map_offd,big_offd_j[i],num_cols_offd); + offd_j[i] = hypre_BigBinarySearch(col_map_offd, big_offd_j[i], num_cols_offd); } hypre_TFree(work, HYPRE_MEMORY_HOST); @@ -1624,7 +1685,6 @@ GenerateLaplacian27pt(MPI_Comm comm, hypre_TFree(ny_part, HYPRE_MEMORY_HOST); hypre_TFree(nz_part, HYPRE_MEMORY_HOST); hypre_TFree(big_offd_j, HYPRE_MEMORY_HOST); - hypre_TFree(global_part, HYPRE_MEMORY_HOST); return (HYPRE_ParCSRMatrix) A; } diff --git a/external/hypre/src/parcsr_ls/par_laplace_9pt.c b/external/hypre/src/parcsr_ls/par_laplace_9pt.c index 9171a2b3..4e3827b4 100644 --- a/external/hypre/src/parcsr_ls/par_laplace_9pt.c +++ b/external/hypre/src/parcsr_ls/par_laplace_9pt.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -30,15 +30,15 @@ GenerateLaplacian9pt( MPI_Comm comm, HYPRE_Real *diag_data; HYPRE_Int *offd_i; - HYPRE_Int *offd_j; - HYPRE_Real *offd_data; + HYPRE_Int *offd_j = NULL; + HYPRE_Real *offd_data = NULL; - HYPRE_BigInt *global_part; + HYPRE_BigInt global_part[2]; HYPRE_BigInt ix, iy; HYPRE_Int cnt, o_cnt; HYPRE_Int local_num_rows; HYPRE_BigInt *col_map_offd; - HYPRE_BigInt *big_offd_j; + HYPRE_BigInt *big_offd_j = NULL; HYPRE_Int row_index; HYPRE_Int i; @@ -52,39 +52,38 @@ GenerateLaplacian9pt( MPI_Comm comm, HYPRE_Int num_procs; HYPRE_Int P_busy, Q_busy; - hypre_MPI_Comm_size(comm,&num_procs); + hypre_MPI_Comm_size(comm, &num_procs); - grid_size = nx*ny; + grid_size = nx * ny; - hypre_GeneratePartitioning(nx,P,&nx_part); - hypre_GeneratePartitioning(ny,Q,&ny_part); + hypre_GeneratePartitioning(nx, P, &nx_part); + hypre_GeneratePartitioning(ny, Q, &ny_part); - nx_local = (HYPRE_Int)(nx_part[p+1] - nx_part[p]); - ny_local = (HYPRE_Int)(ny_part[q+1] - ny_part[q]); + nx_local = (HYPRE_Int)(nx_part[p + 1] - nx_part[p]); + ny_local = (HYPRE_Int)(ny_part[q + 1] - ny_part[q]); - local_num_rows = nx_local*ny_local; + local_num_rows = nx_local * ny_local; - global_part = hypre_CTAlloc(HYPRE_BigInt, 2, HYPRE_MEMORY_HOST); - global_part[0] = ny_part[q]*nx + nx_part[p]*ny_local; - global_part[1] = global_part[0]+(HYPRE_BigInt)local_num_rows; + global_part[0] = ny_part[q] * nx + nx_part[p] * ny_local; + global_part[1] = global_part[0] + (HYPRE_BigInt)local_num_rows; - diag_i = hypre_CTAlloc(HYPRE_Int, local_num_rows+1, HYPRE_MEMORY_HOST); - offd_i = hypre_CTAlloc(HYPRE_Int, local_num_rows+1, HYPRE_MEMORY_HOST); + diag_i = hypre_CTAlloc(HYPRE_Int, local_num_rows + 1, HYPRE_MEMORY_HOST); + offd_i = hypre_CTAlloc(HYPRE_Int, local_num_rows + 1, HYPRE_MEMORY_HOST); - P_busy = hypre_min(nx,P); - Q_busy = hypre_min(ny,Q); + P_busy = hypre_min(nx, P); + Q_busy = hypre_min(ny, Q); num_cols_offd = 0; - if (p) num_cols_offd += ny_local; - if (p < P_busy-1) num_cols_offd += ny_local; - if (q) num_cols_offd += nx_local; - if (q < Q_busy-1) num_cols_offd += nx_local; - if (p && q) num_cols_offd++; - if (p && q < Q_busy-1 ) num_cols_offd++; - if (p < P_busy-1 && q ) num_cols_offd++; - if (p < P_busy-1 && q < Q_busy-1 ) num_cols_offd++; + if (p) { num_cols_offd += ny_local; } + if (p < P_busy - 1) { num_cols_offd += ny_local; } + if (q) { num_cols_offd += nx_local; } + if (q < Q_busy - 1) { num_cols_offd += nx_local; } + if (p && q) { num_cols_offd++; } + if (p && q < Q_busy - 1 ) { num_cols_offd++; } + if (p < P_busy - 1 && q ) { num_cols_offd++; } + if (p < P_busy - 1 && q < Q_busy - 1 ) { num_cols_offd++; } - if (!local_num_rows) num_cols_offd = 0; + if (!local_num_rows) { num_cols_offd = 0; } col_map_offd = hypre_CTAlloc(HYPRE_BigInt, num_cols_offd, HYPRE_MEMORY_HOST); @@ -92,14 +91,14 @@ GenerateLaplacian9pt( MPI_Comm comm, o_cnt = 0; diag_i[0] = 0; offd_i[0] = 0; - for (iy = ny_part[q]; iy < ny_part[q+1]; iy++) + for (iy = ny_part[q]; iy < ny_part[q + 1]; iy++) { - for (ix = nx_part[p]; ix < nx_part[p+1]; ix++) + for (ix = nx_part[p]; ix < nx_part[p + 1]; ix++) { cnt++; o_cnt++; - diag_i[cnt] = diag_i[cnt-1]; - offd_i[o_cnt] = offd_i[o_cnt-1]; + diag_i[cnt] = diag_i[cnt - 1]; + offd_i[o_cnt] = offd_i[o_cnt - 1]; diag_i[cnt]++; if (iy > ny_part[q]) { @@ -111,16 +110,20 @@ GenerateLaplacian9pt( MPI_Comm comm, else { if (ix) + { offd_i[o_cnt]++; + } } - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { diag_i[cnt]++; } else { - if (ix+1 < nx) + if (ix + 1 < nx) + { offd_i[o_cnt]++; + } } } else @@ -136,18 +139,20 @@ GenerateLaplacian9pt( MPI_Comm comm, { offd_i[o_cnt]++; } - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { offd_i[o_cnt]++; } - else if (ix < nx-1) + else if (ix < nx - 1) { offd_i[o_cnt]++; } } } if (ix > nx_part[p]) + { diag_i[cnt]++; + } else { if (ix) @@ -155,16 +160,18 @@ GenerateLaplacian9pt( MPI_Comm comm, offd_i[o_cnt]++; } } - if (ix+1 < nx_part[p+1]) + if (ix + 1 < nx_part[p + 1]) + { diag_i[cnt]++; + } else { - if (ix+1 < nx) + if (ix + 1 < nx) { offd_i[o_cnt]++; } } - if (iy+1 < ny_part[q+1]) + if (iy + 1 < ny_part[q + 1]) { diag_i[cnt]++; if (ix > nx_part[p]) @@ -174,21 +181,25 @@ GenerateLaplacian9pt( MPI_Comm comm, else { if (ix) + { offd_i[o_cnt]++; + } } - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { diag_i[cnt]++; } else { - if (ix+1 < nx) + if (ix + 1 < nx) + { offd_i[o_cnt]++; + } } } else { - if (iy+1 < ny) + if (iy + 1 < ny) { offd_i[o_cnt]++; if (ix > nx_part[p]) @@ -199,11 +210,11 @@ GenerateLaplacian9pt( MPI_Comm comm, { offd_i[o_cnt]++; } - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { offd_i[o_cnt]++; } - else if (ix < nx-1) + else if (ix < nx - 1) { offd_i[o_cnt]++; } @@ -225,9 +236,9 @@ GenerateLaplacian9pt( MPI_Comm comm, row_index = 0; cnt = 0; o_cnt = 0; - for (iy = ny_part[q]; iy < ny_part[q+1]; iy++) + for (iy = ny_part[q]; iy < ny_part[q + 1]; iy++) { - for (ix = nx_part[p]; ix < nx_part[p+1]; ix++) + for (ix = nx_part[p]; ix < nx_part[p + 1]; ix++) { diag_j[cnt] = row_index; diag_data[cnt++] = value[0]; @@ -235,31 +246,31 @@ GenerateLaplacian9pt( MPI_Comm comm, { if (ix > nx_part[p]) { - diag_j[cnt] = row_index-nx_local-1 ; + diag_j[cnt] = row_index - nx_local - 1 ; diag_data[cnt++] = value[1]; } else { if (ix) { - big_offd_j[o_cnt] = hypre_map2(ix-1,iy-1,p-1,q,nx, - nx_part,ny_part); + big_offd_j[o_cnt] = hypre_map2(ix - 1, iy - 1, p - 1, q, nx, + nx_part, ny_part); offd_data[o_cnt++] = value[1]; } } - diag_j[cnt] = row_index-nx_local; + diag_j[cnt] = row_index - nx_local; diag_data[cnt++] = value[1]; - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { - diag_j[cnt] = row_index-nx_local+1 ; + diag_j[cnt] = row_index - nx_local + 1 ; diag_data[cnt++] = value[1]; } else { - if (ix+1 < nx) + if (ix + 1 < nx) { - big_offd_j[o_cnt] = hypre_map2(ix+1,iy-1,p+1,q,nx, - nx_part,ny_part); + big_offd_j[o_cnt] = hypre_map2(ix + 1, iy - 1, p + 1, q, nx, + nx_part, ny_part); offd_data[o_cnt++] = value[1]; } } @@ -270,123 +281,123 @@ GenerateLaplacian9pt( MPI_Comm comm, { if (ix > nx_part[p]) { - big_offd_j[o_cnt] = hypre_map2(ix-1,iy-1,p,q-1,nx, - nx_part,ny_part); + big_offd_j[o_cnt] = hypre_map2(ix - 1, iy - 1, p, q - 1, nx, + nx_part, ny_part); offd_data[o_cnt++] = value[1]; } else if (ix) { - big_offd_j[o_cnt] = hypre_map2(ix-1,iy-1,p-1,q-1,nx, - nx_part,ny_part); + big_offd_j[o_cnt] = hypre_map2(ix - 1, iy - 1, p - 1, q - 1, nx, + nx_part, ny_part); offd_data[o_cnt++] = value[1]; } - big_offd_j[o_cnt] = hypre_map2(ix,iy-1,p,q-1,nx, - nx_part,ny_part); + big_offd_j[o_cnt] = hypre_map2(ix, iy - 1, p, q - 1, nx, + nx_part, ny_part); offd_data[o_cnt++] = value[1]; - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { - big_offd_j[o_cnt] = hypre_map2(ix+1,iy-1,p,q-1,nx, - nx_part,ny_part); + big_offd_j[o_cnt] = hypre_map2(ix + 1, iy - 1, p, q - 1, nx, + nx_part, ny_part); offd_data[o_cnt++] = value[1]; } - else if (ix+1 < nx) + else if (ix + 1 < nx) { - big_offd_j[o_cnt] = hypre_map2(ix+1,iy-1,p+1,q-1,nx, - nx_part,ny_part); + big_offd_j[o_cnt] = hypre_map2(ix + 1, iy - 1, p + 1, q - 1, nx, + nx_part, ny_part); offd_data[o_cnt++] = value[1]; } } } if (ix > nx_part[p]) { - diag_j[cnt] = row_index-1; + diag_j[cnt] = row_index - 1; diag_data[cnt++] = value[1]; } else { if (ix) { - big_offd_j[o_cnt] = hypre_map2(ix-1,iy,p-1,q,nx, - nx_part,ny_part); + big_offd_j[o_cnt] = hypre_map2(ix - 1, iy, p - 1, q, nx, + nx_part, ny_part); offd_data[o_cnt++] = value[1]; } } - if (ix+1 < nx_part[p+1]) + if (ix + 1 < nx_part[p + 1]) { - diag_j[cnt] = row_index+1; + diag_j[cnt] = row_index + 1; diag_data[cnt++] = value[1]; } else { - if (ix+1 < nx) + if (ix + 1 < nx) { - big_offd_j[o_cnt] = hypre_map2(ix+1,iy,p+1,q,nx, - nx_part,ny_part); + big_offd_j[o_cnt] = hypre_map2(ix + 1, iy, p + 1, q, nx, + nx_part, ny_part); offd_data[o_cnt++] = value[1]; } } - if (iy+1 < ny_part[q+1]) + if (iy + 1 < ny_part[q + 1]) { if (ix > nx_part[p]) { - diag_j[cnt] = row_index+nx_local-1 ; + diag_j[cnt] = row_index + nx_local - 1 ; diag_data[cnt++] = value[1]; } else { if (ix) { - big_offd_j[o_cnt] = hypre_map2(ix-1,iy+1,p-1,q,nx, - nx_part,ny_part); + big_offd_j[o_cnt] = hypre_map2(ix - 1, iy + 1, p - 1, q, nx, + nx_part, ny_part); offd_data[o_cnt++] = value[1]; } } - diag_j[cnt] = row_index+nx_local; + diag_j[cnt] = row_index + nx_local; diag_data[cnt++] = value[1]; - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { - diag_j[cnt] = row_index+nx_local+1 ; + diag_j[cnt] = row_index + nx_local + 1 ; diag_data[cnt++] = value[1]; } else { - if (ix+1 < nx) + if (ix + 1 < nx) { - big_offd_j[o_cnt] = hypre_map2(ix+1,iy+1,p+1,q,nx, - nx_part,ny_part); + big_offd_j[o_cnt] = hypre_map2(ix + 1, iy + 1, p + 1, q, nx, + nx_part, ny_part); offd_data[o_cnt++] = value[1]; } } } else { - if (iy+1 < ny) + if (iy + 1 < ny) { if (ix > nx_part[p]) { - big_offd_j[o_cnt] = hypre_map2(ix-1,iy+1,p,q+1,nx, - nx_part,ny_part); + big_offd_j[o_cnt] = hypre_map2(ix - 1, iy + 1, p, q + 1, nx, + nx_part, ny_part); offd_data[o_cnt++] = value[1]; } else if (ix) { - big_offd_j[o_cnt] = hypre_map2(ix-1,iy+1,p-1,q+1,nx, - nx_part,ny_part); + big_offd_j[o_cnt] = hypre_map2(ix - 1, iy + 1, p - 1, q + 1, nx, + nx_part, ny_part); offd_data[o_cnt++] = value[1]; } - big_offd_j[o_cnt] = hypre_map2(ix,iy+1,p,q+1,nx, - nx_part,ny_part); + big_offd_j[o_cnt] = hypre_map2(ix, iy + 1, p, q + 1, nx, + nx_part, ny_part); offd_data[o_cnt++] = value[1]; - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { - big_offd_j[o_cnt] = hypre_map2(ix+1,iy+1,p,q+1,nx, - nx_part,ny_part); + big_offd_j[o_cnt] = hypre_map2(ix + 1, iy + 1, p, q + 1, nx, + nx_part, ny_part); offd_data[o_cnt++] = value[1]; } - else if (ix < nx-1) + else if (ix < nx - 1) { - big_offd_j[o_cnt] = hypre_map2(ix+1,iy+1,p+1,q+1,nx, - nx_part,ny_part); + big_offd_j[o_cnt] = hypre_map2(ix + 1, iy + 1, p + 1, q + 1, nx, + nx_part, ny_part); offd_data[o_cnt++] = value[1]; } } @@ -399,14 +410,16 @@ GenerateLaplacian9pt( MPI_Comm comm, { HYPRE_BigInt *tmp = hypre_CTAlloc(HYPRE_BigInt, o_cnt, HYPRE_MEMORY_HOST); - for (i=0; i < o_cnt; i++) + for (i = 0; i < o_cnt; i++) + { tmp[i] = big_offd_j[i]; + } - hypre_BigQsort0(tmp, 0, o_cnt-1); + hypre_BigQsort0(tmp, 0, o_cnt - 1); col_map_offd[0] = tmp[0]; cnt = 0; - for (i=0; i < o_cnt; i++) + for (i = 0; i < o_cnt; i++) { if (tmp[i] > col_map_offd[cnt]) { @@ -415,9 +428,9 @@ GenerateLaplacian9pt( MPI_Comm comm, } } - for (i=0; i < o_cnt; i++) + for (i = 0; i < o_cnt; i++) { - offd_j[i] = hypre_BigBinarySearch(col_map_offd,big_offd_j[i],num_cols_offd); + offd_j[i] = hypre_BigBinarySearch(col_map_offd, big_offd_j[i], num_cols_offd); } hypre_TFree(big_offd_j, HYPRE_MEMORY_HOST); @@ -425,9 +438,9 @@ GenerateLaplacian9pt( MPI_Comm comm, } A = hypre_ParCSRMatrixCreate(comm, grid_size, grid_size, - global_part, global_part, num_cols_offd, - diag_i[local_num_rows], - offd_i[local_num_rows]); + global_part, global_part, num_cols_offd, + diag_i[local_num_rows], + offd_i[local_num_rows]); hypre_ParCSRMatrixColMapOffd(A) = col_map_offd; @@ -451,7 +464,6 @@ GenerateLaplacian9pt( MPI_Comm comm, hypre_TFree(nx_part, HYPRE_MEMORY_HOST); hypre_TFree(ny_part, HYPRE_MEMORY_HOST); - hypre_TFree(global_part, HYPRE_MEMORY_HOST); return (HYPRE_ParCSRMatrix) A; } @@ -461,12 +473,12 @@ GenerateLaplacian9pt( MPI_Comm comm, HYPRE_BigInt hypre_map2( HYPRE_BigInt ix, - HYPRE_BigInt iy, - HYPRE_Int p, - HYPRE_Int q, - HYPRE_BigInt nx, - HYPRE_BigInt *nx_part, - HYPRE_BigInt *ny_part) + HYPRE_BigInt iy, + HYPRE_Int p, + HYPRE_Int q, + HYPRE_BigInt nx, + HYPRE_BigInt *nx_part, + HYPRE_BigInt *ny_part) { HYPRE_Int nx_local; HYPRE_Int ny_local; @@ -474,12 +486,12 @@ hypre_map2( HYPRE_BigInt ix, HYPRE_Int iy_local; HYPRE_BigInt global_index; - nx_local = (HYPRE_Int)(nx_part[p+1] - nx_part[p]); - ny_local = (HYPRE_Int)(ny_part[q+1] - ny_part[q]); + nx_local = (HYPRE_Int)(nx_part[p + 1] - nx_part[p]); + ny_local = (HYPRE_Int)(ny_part[q + 1] - ny_part[q]); ix_local = (HYPRE_Int)(ix - nx_part[p]); iy_local = (HYPRE_Int)(iy - ny_part[q]); - global_index = ny_part[q]*nx + nx_part[p]* (HYPRE_BigInt)ny_local; - global_index += (HYPRE_BigInt)(iy_local*nx_local + ix_local); + global_index = ny_part[q] * nx + nx_part[p] * (HYPRE_BigInt)ny_local; + global_index += (HYPRE_BigInt)(iy_local * nx_local + ix_local); return global_index; } diff --git a/external/hypre/src/parcsr_ls/par_lr_interp.c b/external/hypre/src/parcsr_ls/par_lr_interp.c index 9dce8470..5311f81b 100644 --- a/external/hypre/src/parcsr_ls/par_lr_interp.c +++ b/external/hypre/src/parcsr_ls/par_lr_interp.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -86,10 +86,10 @@ hypre_BoomerAMGBuildStdInterp(hypre_ParCSRMatrix *A, HYPRE_Int *dof_func_offd = NULL; /* Full row information for columns of A that are off diag*/ - hypre_CSRMatrix *A_ext; - HYPRE_Real *A_ext_data; - HYPRE_Int *A_ext_i; - HYPRE_BigInt *A_ext_j; + hypre_CSRMatrix *A_ext = NULL; + HYPRE_Real *A_ext_data = NULL; + HYPRE_Int *A_ext_i = NULL; + HYPRE_BigInt *A_ext_j = NULL; HYPRE_Int *fine_to_coarse = NULL; HYPRE_BigInt *fine_to_coarse_offd = NULL; @@ -98,9 +98,9 @@ hypre_BoomerAMGBuildStdInterp(hypre_ParCSRMatrix *A, HYPRE_Int loc_col; HYPRE_Int full_off_procNodes; - hypre_CSRMatrix *Sop; - HYPRE_Int *Sop_i; - HYPRE_BigInt *Sop_j; + hypre_CSRMatrix *Sop = NULL; + HYPRE_Int *Sop_i = NULL; + HYPRE_BigInt *Sop_j = NULL; /* Variables to keep count of interpolatory points */ HYPRE_Int jj_counter, jj_counter_offd; @@ -132,23 +132,22 @@ hypre_BoomerAMGBuildStdInterp(hypre_ParCSRMatrix *A, /* Definitions */ HYPRE_Real zero = 0.0; HYPRE_Real one = 1.0; - HYPRE_Real wall_time; - HYPRE_Real wall_1 = 0; - HYPRE_Real wall_2 = 0; - HYPRE_Real wall_3 = 0; - + HYPRE_Real wall_time = 0.0; + HYPRE_Real wall_1 = 0.0; + HYPRE_Real wall_2 = 0.0; + HYPRE_Real wall_3 = 0.0; hypre_ParCSRCommPkg *extend_comm_pkg = NULL; - if (debug_flag== 4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } /* BEGIN */ hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_rank(comm, &my_id); my_first_cpt = num_cpts_global[0]; - if (my_id == (num_procs -1)) total_global_cpts = num_cpts_global[1]; - hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); + if (my_id == (num_procs - 1)) { total_global_cpts = num_cpts_global[1]; } + hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); if (!comm_pkg) { @@ -162,8 +161,8 @@ hypre_BoomerAMGBuildStdInterp(hypre_ParCSRMatrix *A, if (num_procs > 1) { hypre_exchange_interp_data( - &CF_marker_offd, &dof_func_offd, &A_ext, &full_off_procNodes, &Sop, &extend_comm_pkg, - A, CF_marker, S, num_functions, dof_func, 0); + &CF_marker_offd, &dof_func_offd, &A_ext, &full_off_procNodes, &Sop, &extend_comm_pkg, + A, CF_marker, S, num_functions, dof_func, 0); { #ifdef HYPRE_PROFILE hypre_profile_times[HYPRE_TIMER_ID_EXTENDED_I_INTERP] += hypre_MPI_Wtime(); @@ -185,8 +184,8 @@ hypre_BoomerAMGBuildStdInterp(hypre_ParCSRMatrix *A, /*----------------------------------------------------------------------- * Intialize counters and allocate mapping vector. *-----------------------------------------------------------------------*/ - P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, memory_location_P); - P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, memory_location_P); + P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, memory_location_P); + P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, memory_location_P); if (n_fine) { @@ -233,11 +232,12 @@ hypre_BoomerAMGBuildStdInterp(hypre_ParCSRMatrix *A, *--------------------------------------------------------------------*/ else if (CF_marker[i] != -3) { - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) { i1 = S_diag_j[jj]; if (CF_marker[i1] >= 0) - { /* i1 is a C point */ + { + /* i1 is a C point */ if (P_marker[i1] < P_diag_i[i]) { P_marker[i1] = jj_counter; @@ -245,8 +245,9 @@ hypre_BoomerAMGBuildStdInterp(hypre_ParCSRMatrix *A, } } else if (CF_marker[i1] != -3) - { /* i1 is a F point, loop through it's strong neighbors */ - for (kk = S_diag_i[i1]; kk < S_diag_i[i1+1]; kk++) + { + /* i1 is a F point, loop through it's strong neighbors */ + for (kk = S_diag_i[i1]; kk < S_diag_i[i1 + 1]; kk++) { k1 = S_diag_j[kk]; if (CF_marker[k1] >= 0) @@ -260,7 +261,7 @@ hypre_BoomerAMGBuildStdInterp(hypre_ParCSRMatrix *A, } if (num_procs > 1) { - for (kk = S_offd_i[i1]; kk < S_offd_i[i1+1]; kk++) + for (kk = S_offd_i[i1]; kk < S_offd_i[i1 + 1]; kk++) { k1 = S_offd_j[kk]; if (CF_marker_offd[k1] >= 0) @@ -279,7 +280,7 @@ hypre_BoomerAMGBuildStdInterp(hypre_ParCSRMatrix *A, /* Look at off diag strong connections of i */ if (num_procs > 1) { - for (jj = S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) { i1 = S_offd_j[jj]; if (CF_marker_offd[i1] >= 0) @@ -296,12 +297,13 @@ hypre_BoomerAMGBuildStdInterp(hypre_ParCSRMatrix *A, /* F point; look at neighbors of i1. Sop contains global col * numbers and entries that could be in S_diag or S_offd or * neither. */ - for (kk = Sop_i[i1]; kk < Sop_i[i1+1]; kk++) + for (kk = Sop_i[i1]; kk < Sop_i[i1 + 1]; kk++) { big_k1 = Sop_j[kk]; if (big_k1 >= col_1 && big_k1 < col_n) - { /* In S_diag */ - loc_col = (HYPRE_Int)(big_k1-col_1); + { + /* In S_diag */ + loc_col = (HYPRE_Int)(big_k1 - col_1); if (CF_marker[loc_col] >= 0) { if (P_marker[loc_col] < P_diag_i[i]) @@ -331,11 +333,11 @@ hypre_BoomerAMGBuildStdInterp(hypre_ParCSRMatrix *A, } } - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d determine structure %f\n", - my_id, wall_time); + my_id, wall_time); fflush(NULL); } /*----------------------------------------------------------------------- @@ -428,9 +430,9 @@ hypre_BoomerAMGBuildStdInterp(hypre_ParCSRMatrix *A, else if (CF_marker[i] != -3) { - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } strong_f_marker--; - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) { i1 = S_diag_j[jj]; @@ -452,7 +454,7 @@ hypre_BoomerAMGBuildStdInterp(hypre_ParCSRMatrix *A, else if (CF_marker[i1] != -3) { P_marker[i1] = strong_f_marker; - for (kk = S_diag_i[i1]; kk < S_diag_i[i1+1]; kk++) + for (kk = S_diag_i[i1]; kk < S_diag_i[i1 + 1]; kk++) { k1 = S_diag_j[kk]; if (CF_marker[k1] >= 0) @@ -468,7 +470,7 @@ hypre_BoomerAMGBuildStdInterp(hypre_ParCSRMatrix *A, } if (num_procs > 1) { - for (kk = S_offd_i[i1]; kk < S_offd_i[i1+1]; kk++) + for (kk = S_offd_i[i1]; kk < S_offd_i[i1 + 1]; kk++) { k1 = S_offd_j[kk]; if (CF_marker_offd[k1] >= 0) @@ -488,7 +490,7 @@ hypre_BoomerAMGBuildStdInterp(hypre_ParCSRMatrix *A, if ( num_procs > 1) { - for (jj=S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) { i1 = S_offd_j[jj]; if ( CF_marker_offd[i1] >= 0) @@ -496,7 +498,7 @@ hypre_BoomerAMGBuildStdInterp(hypre_ParCSRMatrix *A, if (P_marker_offd[i1] < jj_begin_row_offd) { P_marker_offd[i1] = jj_counter_offd; - P_offd_j[jj_counter_offd]=i1; + P_offd_j[jj_counter_offd] = i1; P_offd_data[jj_counter_offd] = zero; jj_counter_offd++; } @@ -504,12 +506,12 @@ hypre_BoomerAMGBuildStdInterp(hypre_ParCSRMatrix *A, else if (CF_marker_offd[i1] != -3) { P_marker_offd[i1] = strong_f_marker; - for (kk = Sop_i[i1]; kk < Sop_i[i1+1]; kk++) + for (kk = Sop_i[i1]; kk < Sop_i[i1 + 1]; kk++) { big_k1 = Sop_j[kk]; if (big_k1 >= col_1 && big_k1 < col_n) { - loc_col = (HYPRE_Int)(big_k1-col_1); + loc_col = (HYPRE_Int)(big_k1 - col_1); if (CF_marker[loc_col] >= 0) { if (P_marker[loc_col] < jj_begin_row) @@ -529,7 +531,7 @@ hypre_BoomerAMGBuildStdInterp(hypre_ParCSRMatrix *A, if (P_marker_offd[loc_col] < jj_begin_row_offd) { P_marker_offd[loc_col] = jj_counter_offd; - P_offd_j[jj_counter_offd]=loc_col; + P_offd_j[jj_counter_offd] = loc_col; P_offd_data[jj_counter_offd] = zero; jj_counter_offd++; } @@ -543,25 +545,26 @@ hypre_BoomerAMGBuildStdInterp(hypre_ParCSRMatrix *A, jj_end_row = jj_counter; jj_end_row_offd = jj_counter_offd; - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; wall_1 += wall_time; fflush(NULL); } - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } cnt_c = 0; - cnt_f = jj_end_row-jj_begin_row; + cnt_f = jj_end_row - jj_begin_row; cnt_c_offd = 0; - cnt_f_offd = jj_end_row_offd-jj_begin_row_offd; + cnt_f_offd = jj_end_row_offd - jj_begin_row_offd; ihat[i] = cnt_f; ipnt[cnt_f] = i; ahat[cnt_f++] = A_diag_data[A_diag_i[i]]; - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) - { /* i1 is direct neighbor */ + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) + { + /* i1 is direct neighbor */ i1 = A_diag_j[jj]; if (P_marker[i1] != strong_f_marker) { @@ -587,29 +590,31 @@ hypre_BoomerAMGBuildStdInterp(hypre_ParCSRMatrix *A, { if (num_functions == 1 || dof_func[i] == dof_func[i1]) { - distribute = A_diag_data[jj]/A_diag_data[A_diag_i[i1]]; - for (kk = A_diag_i[i1]+1; kk < A_diag_i[i1+1]; kk++) + distribute = A_diag_data[jj] / A_diag_data[A_diag_i[i1]]; + for (kk = A_diag_i[i1] + 1; kk < A_diag_i[i1 + 1]; kk++) { k1 = A_diag_j[kk]; indx = ihat[k1]; if (indx > -1) - ahat[indx] -= A_diag_data[kk]*distribute; + { + ahat[indx] -= A_diag_data[kk] * distribute; + } else if (P_marker[k1] >= jj_begin_row) { ihat[k1] = cnt_c; ipnt[cnt_c] = k1; - ahat[cnt_c++] -= A_diag_data[kk]*distribute; + ahat[cnt_c++] -= A_diag_data[kk] * distribute; } else { ihat[k1] = cnt_f; ipnt[cnt_f] = k1; - ahat[cnt_f++] -= A_diag_data[kk]*distribute; + ahat[cnt_f++] -= A_diag_data[kk] * distribute; } } if (num_procs > 1) { - for (kk = A_offd_i[i1]; kk < A_offd_i[i1+1]; kk++) + for (kk = A_offd_i[i1]; kk < A_offd_i[i1 + 1]; kk++) { k1 = A_offd_j[kk]; indx = ihat_offd[k1]; @@ -617,19 +622,19 @@ hypre_BoomerAMGBuildStdInterp(hypre_ParCSRMatrix *A, { if (indx > -1) { - ahat_offd[indx] -= A_offd_data[kk]*distribute; + ahat_offd[indx] -= A_offd_data[kk] * distribute; } else if (P_marker_offd[k1] >= jj_begin_row_offd) { ihat_offd[k1] = cnt_c_offd; ipnt_offd[cnt_c_offd] = k1; - ahat_offd[cnt_c_offd++] -= A_offd_data[kk]*distribute; + ahat_offd[cnt_c_offd++] -= A_offd_data[kk] * distribute; } else { ihat_offd[k1] = cnt_f_offd; ipnt_offd[cnt_f_offd] = k1; - ahat_offd[cnt_f_offd++] -= A_offd_data[kk]*distribute; + ahat_offd[cnt_f_offd++] -= A_offd_data[kk] * distribute; } } } @@ -639,14 +644,16 @@ hypre_BoomerAMGBuildStdInterp(hypre_ParCSRMatrix *A, } if (num_procs > 1) { - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { i1 = A_offd_j[jj]; if (P_marker_offd[i1] != strong_f_marker) { indx = ihat_offd[i1]; if (indx > -1) + { ahat_offd[indx] += A_offd_data[jj]; + } else if (P_marker_offd[i1] >= jj_begin_row_offd) { ihat_offd[i1] = cnt_c_offd; @@ -664,29 +671,30 @@ hypre_BoomerAMGBuildStdInterp(hypre_ParCSRMatrix *A, { if (num_functions == 1 || dof_func[i] == dof_func_offd[i1]) { - distribute = A_offd_data[jj]/A_ext_data[A_ext_i[i1]]; - for (kk = A_ext_i[i1]+1; kk < A_ext_i[i1+1]; kk++) + distribute = A_offd_data[jj] / A_ext_data[A_ext_i[i1]]; + for (kk = A_ext_i[i1] + 1; kk < A_ext_i[i1 + 1]; kk++) { big_k1 = A_ext_j[kk]; if (big_k1 >= col_1 && big_k1 < col_n) - { /*diag*/ + { + /*diag*/ loc_col = (HYPRE_Int)(big_k1 - col_1); indx = ihat[loc_col]; if (indx > -1) { - ahat[indx] -= A_ext_data[kk]*distribute; + ahat[indx] -= A_ext_data[kk] * distribute; } else if (P_marker[loc_col] >= jj_begin_row) { ihat[loc_col] = cnt_c; ipnt[cnt_c] = loc_col; - ahat[cnt_c++] -= A_ext_data[kk]*distribute; + ahat[cnt_c++] -= A_ext_data[kk] * distribute; } else { ihat[loc_col] = cnt_f; ipnt[cnt_f] = loc_col; - ahat[cnt_f++] -= A_ext_data[kk]*distribute; + ahat[cnt_f++] -= A_ext_data[kk] * distribute; } } else @@ -697,19 +705,19 @@ hypre_BoomerAMGBuildStdInterp(hypre_ParCSRMatrix *A, indx = ihat_offd[loc_col]; if (indx > -1) { - ahat_offd[indx] -= A_ext_data[kk]*distribute; + ahat_offd[indx] -= A_ext_data[kk] * distribute; } else if (P_marker_offd[loc_col] >= jj_begin_row_offd) { ihat_offd[loc_col] = cnt_c_offd; ipnt_offd[cnt_c_offd] = loc_col; - ahat_offd[cnt_c_offd++] -= A_ext_data[kk]*distribute; + ahat_offd[cnt_c_offd++] -= A_ext_data[kk] * distribute; } else { ihat_offd[loc_col] = cnt_f_offd; ipnt_offd[cnt_f_offd] = loc_col; - ahat_offd[cnt_f_offd++] -= A_ext_data[kk]*distribute; + ahat_offd[cnt_f_offd++] -= A_ext_data[kk] * distribute; } } } @@ -718,14 +726,14 @@ hypre_BoomerAMGBuildStdInterp(hypre_ParCSRMatrix *A, } } } - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; wall_2 += wall_time; fflush(NULL); } - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } diagonal = ahat[cnt_c]; ahat[cnt_c] = 0; sum_pos = 0; @@ -736,7 +744,7 @@ hypre_BoomerAMGBuildStdInterp(hypre_ParCSRMatrix *A, sum_C = 0; if (sep_weight == 1) { - for (jj=0; jj < cnt_c; jj++) + for (jj = 0; jj < cnt_c; jj++) { if (ahat[jj] > 0) { @@ -749,7 +757,7 @@ hypre_BoomerAMGBuildStdInterp(hypre_ParCSRMatrix *A, } if (num_procs > 1) { - for (jj=0; jj < cnt_c_offd; jj++) + for (jj = 0; jj < cnt_c_offd; jj++) { if (ahat_offd[jj] > 0) { @@ -763,7 +771,7 @@ hypre_BoomerAMGBuildStdInterp(hypre_ParCSRMatrix *A, } sum_pos = sum_pos_C; sum_neg = sum_neg_C; - for (jj=cnt_c+1; jj < cnt_f; jj++) + for (jj = cnt_c + 1; jj < cnt_f; jj++) { if (ahat[jj] > 0) { @@ -777,7 +785,7 @@ hypre_BoomerAMGBuildStdInterp(hypre_ParCSRMatrix *A, } if (num_procs > 1) { - for (jj=cnt_c_offd; jj < cnt_f_offd; jj++) + for (jj = cnt_c_offd; jj < cnt_f_offd; jj++) { if (ahat_offd[jj] > 0) { @@ -790,13 +798,13 @@ hypre_BoomerAMGBuildStdInterp(hypre_ParCSRMatrix *A, ahat_offd[jj] = 0; } } - if (sum_neg_C*diagonal != 0) + if (sum_neg_C * diagonal != 0) { - alfa = sum_neg/sum_neg_C/diagonal; + alfa = sum_neg / sum_neg_C / diagonal; } - if (sum_pos_C*diagonal != 0) + if (sum_pos_C * diagonal != 0) { - beta = sum_pos/sum_pos_C/diagonal; + beta = sum_pos / sum_pos_C / diagonal; } /*----------------------------------------------------------------- @@ -808,18 +816,18 @@ hypre_BoomerAMGBuildStdInterp(hypre_ParCSRMatrix *A, j1 = ihat[P_diag_j[jj]]; if (ahat[j1] > 0) { - P_diag_data[jj] = -beta*ahat[j1]; + P_diag_data[jj] = -beta * ahat[j1]; } else { - P_diag_data[jj] = -alfa*ahat[j1]; + P_diag_data[jj] = -alfa * ahat[j1]; } P_diag_j[jj] = fine_to_coarse[P_diag_j[jj]]; ahat[j1] = 0; } - for (jj=0; jj < cnt_f; jj++) + for (jj = 0; jj < cnt_f; jj++) { ihat[ipnt[jj]] = -1; } @@ -831,16 +839,16 @@ hypre_BoomerAMGBuildStdInterp(hypre_ParCSRMatrix *A, j1 = ihat_offd[P_offd_j[jj]]; if (ahat_offd[j1] > 0) { - P_offd_data[jj] = -beta*ahat_offd[j1]; + P_offd_data[jj] = -beta * ahat_offd[j1]; } else { - P_offd_data[jj] = -alfa*ahat_offd[j1]; + P_offd_data[jj] = -alfa * ahat_offd[j1]; } ahat_offd[j1] = 0; } - for (jj=0; jj < cnt_f_offd; jj++) + for (jj = 0; jj < cnt_f_offd; jj++) { ihat_offd[ipnt_offd[jj]] = -1; } @@ -848,34 +856,34 @@ hypre_BoomerAMGBuildStdInterp(hypre_ParCSRMatrix *A, } else { - for (jj=0; jj < cnt_c; jj++) + for (jj = 0; jj < cnt_c; jj++) { sum_C += ahat[jj]; } if (num_procs > 1) { - for (jj=0; jj < cnt_c_offd; jj++) + for (jj = 0; jj < cnt_c_offd; jj++) { sum_C += ahat_offd[jj]; } } sum = sum_C; - for (jj=cnt_c+1; jj < cnt_f; jj++) + for (jj = cnt_c + 1; jj < cnt_f; jj++) { sum += ahat[jj]; ahat[jj] = 0; } if (num_procs > 1) { - for (jj=cnt_c_offd; jj < cnt_f_offd; jj++) + for (jj = cnt_c_offd; jj < cnt_f_offd; jj++) { sum += ahat_offd[jj]; ahat_offd[jj] = 0; } } - if (sum_C*diagonal != 0) + if (sum_C * diagonal != 0) { - alfa = sum/sum_C/diagonal; + alfa = sum / sum_C / diagonal; } /*----------------------------------------------------------------- @@ -885,11 +893,11 @@ hypre_BoomerAMGBuildStdInterp(hypre_ParCSRMatrix *A, for (jj = jj_begin_row; jj < jj_end_row; jj++) { j1 = ihat[P_diag_j[jj]]; - P_diag_data[jj] = -alfa*ahat[j1]; + P_diag_data[jj] = -alfa * ahat[j1]; P_diag_j[jj] = fine_to_coarse[P_diag_j[jj]]; ahat[j1] = 0; } - for (jj=0; jj < cnt_f; jj++) + for (jj = 0; jj < cnt_f; jj++) { ihat[ipnt[jj]] = -1; } @@ -898,16 +906,16 @@ hypre_BoomerAMGBuildStdInterp(hypre_ParCSRMatrix *A, for (jj = jj_begin_row_offd; jj < jj_end_row_offd; jj++) { j1 = ihat_offd[P_offd_j[jj]]; - P_offd_data[jj] = -alfa*ahat_offd[j1]; + P_offd_data[jj] = -alfa * ahat_offd[j1]; ahat_offd[j1] = 0; } - for (jj=0; jj < cnt_f_offd; jj++) + for (jj = 0; jj < cnt_f_offd; jj++) { ihat_offd[ipnt_offd[jj]] = -1; } } } - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; wall_3 += wall_time; @@ -916,10 +924,10 @@ hypre_BoomerAMGBuildStdInterp(hypre_ParCSRMatrix *A, } } - if (debug_flag==4) + if (debug_flag == 4) { hypre_printf("Proc = %d fill part 1 %f part 2 %f part 3 %f\n", - my_id, wall_1, wall_2, wall_3); + my_id, wall_1, wall_2, wall_3); fflush(NULL); } P = hypre_ParCSRMatrixCreate(comm, @@ -966,7 +974,7 @@ hypre_BoomerAMGBuildStdInterp(hypre_ParCSRMatrix *A, hypre_MatvecCommPkgCreate(P); - for (i=0; i < n_fine; i++) + for (i = 0; i < n_fine; i++) { if (CF_marker[i] == -3) { @@ -1083,10 +1091,10 @@ hypre_BoomerAMGBuildExtPIInterpHost(hypre_ParCSRMatrix *A, HYPRE_Int *dof_func_offd = NULL; /* Full row information for columns of A that are off diag*/ - hypre_CSRMatrix *A_ext; - HYPRE_Real *A_ext_data; - HYPRE_Int *A_ext_i; - HYPRE_BigInt *A_ext_j; + hypre_CSRMatrix *A_ext = NULL; + HYPRE_Real *A_ext_data = NULL; + HYPRE_Int *A_ext_i = NULL; + HYPRE_BigInt *A_ext_j = NULL; HYPRE_Int *fine_to_coarse = NULL; HYPRE_BigInt *fine_to_coarse_offd = NULL; @@ -1094,9 +1102,9 @@ hypre_BoomerAMGBuildExtPIInterpHost(hypre_ParCSRMatrix *A, HYPRE_Int loc_col; HYPRE_Int full_off_procNodes; - hypre_CSRMatrix *Sop; - HYPRE_Int *Sop_i; - HYPRE_BigInt *Sop_j; + hypre_CSRMatrix *Sop = NULL; + HYPRE_Int *Sop_i = NULL; + HYPRE_BigInt *Sop_j = NULL; HYPRE_Int sgn = 1; @@ -1132,15 +1140,15 @@ hypre_BoomerAMGBuildExtPIInterpHost(hypre_ParCSRMatrix *A, hypre_ParCSRCommPkg *extend_comm_pkg = NULL; - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } /* BEGIN */ hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_rank(comm, &my_id); my_first_cpt = num_cpts_global[0]; - if (my_id == (num_procs -1)) total_global_cpts = num_cpts_global[1]; - hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); + if (my_id == (num_procs - 1)) { total_global_cpts = num_cpts_global[1]; } + hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); if (!comm_pkg) { @@ -1154,8 +1162,8 @@ hypre_BoomerAMGBuildExtPIInterpHost(hypre_ParCSRMatrix *A, if (num_procs > 1) { hypre_exchange_interp_data( - &CF_marker_offd, &dof_func_offd, &A_ext, &full_off_procNodes, &Sop, &extend_comm_pkg, - A, CF_marker, S, num_functions, dof_func, 1); + &CF_marker_offd, &dof_func_offd, &A_ext, &full_off_procNodes, &Sop, &extend_comm_pkg, + A, CF_marker, S, num_functions, dof_func, 1); { #ifdef HYPRE_PROFILE hypre_profile_times[HYPRE_TIMER_ID_EXTENDED_I_INTERP] += hypre_MPI_Wtime(); @@ -1177,8 +1185,8 @@ hypre_BoomerAMGBuildExtPIInterpHost(hypre_ParCSRMatrix *A, /*----------------------------------------------------------------------- * Intialize counters and allocate mapping vector. *-----------------------------------------------------------------------*/ - P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, memory_location_P); - P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, memory_location_P); + P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, memory_location_P); + P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, memory_location_P); if (n_fine) { @@ -1194,8 +1202,8 @@ hypre_BoomerAMGBuildExtPIInterpHost(hypre_ParCSRMatrix *A, /* This function is smart enough to check P_marker and P_marker_offd only, * and set them if they are not NULL. The other vectors are set regardless.*/ hypre_initialize_vecs(n_fine, full_off_procNodes, fine_to_coarse, - fine_to_coarse_offd, P_marker, P_marker_offd, - tmp_CF_marker_offd); + fine_to_coarse_offd, P_marker, P_marker_offd, + tmp_CF_marker_offd); /*----------------------------------------------------------------------- @@ -1205,7 +1213,7 @@ hypre_BoomerAMGBuildExtPIInterpHost(hypre_ParCSRMatrix *A, diag_offset = hypre_CTAlloc(HYPRE_Int, max_num_threads[0], HYPRE_MEMORY_HOST); fine_to_coarse_offset = hypre_CTAlloc(HYPRE_Int, max_num_threads[0], HYPRE_MEMORY_HOST); offd_offset = hypre_CTAlloc(HYPRE_Int, max_num_threads[0], HYPRE_MEMORY_HOST); - for (i=0; i < max_num_threads[0]; i++) + for (i = 0; i < max_num_threads[0]; i++) { diag_offset[i] = 0; fine_to_coarse_offset[i] = 0; @@ -1216,7 +1224,7 @@ hypre_BoomerAMGBuildExtPIInterpHost(hypre_ParCSRMatrix *A, * Loop over fine grid. *-----------------------------------------------------------------------*/ #ifdef HYPRE_USING_OPENMP -#pragma omp parallel private(i,my_thread_num,num_threads,start,stop,coarse_counter,jj_counter,jj_counter_offd, P_marker, P_marker_offd,jj,kk,i1,k1,loc_col,jj_begin_row,jj_begin_row_offd,jj_end_row,jj_end_row_offd,diagonal,sum,sgn,jj1,i2,distribute,strong_f_marker, big_k1) + #pragma omp parallel private(i,my_thread_num,num_threads,start,stop,coarse_counter,jj_counter,jj_counter_offd, P_marker, P_marker_offd,jj,kk,i1,k1,loc_col,jj_begin_row,jj_begin_row_offd,jj_end_row,jj_end_row_offd,diagonal,sum,sgn,jj1,i2,distribute,strong_f_marker, big_k1) #endif { @@ -1237,6 +1245,8 @@ hypre_BoomerAMGBuildExtPIInterpHost(hypre_ParCSRMatrix *A, */ /* initialize thread-wise variables */ + P_marker = NULL; + P_marker_offd = NULL; strong_f_marker = -2; coarse_counter = 0; jj_counter = start_indexing; @@ -1257,11 +1267,11 @@ hypre_BoomerAMGBuildExtPIInterpHost(hypre_ParCSRMatrix *A, /* this thread's row range */ my_thread_num = hypre_GetThreadNum(); num_threads = hypre_NumActiveThreads(); - start = (n_fine/num_threads)*my_thread_num; - if (my_thread_num == num_threads-1) + start = (n_fine / num_threads) * my_thread_num; + if (my_thread_num == num_threads - 1) { stop = n_fine; } else - { stop = (n_fine/num_threads)*(my_thread_num+1); } + { stop = (n_fine / num_threads) * (my_thread_num + 1); } /* loop over rows */ /* This loop counts the number of elements in P */ @@ -1271,7 +1281,9 @@ hypre_BoomerAMGBuildExtPIInterpHost(hypre_ParCSRMatrix *A, { P_diag_i[i] = jj_counter; if (num_procs > 1) + { P_offd_i[i] = jj_counter_offd; + } if (CF_marker[i] >= 0) { @@ -1288,11 +1300,12 @@ hypre_BoomerAMGBuildExtPIInterpHost(hypre_ParCSRMatrix *A, *--------------------------------------------------------------------*/ else if (CF_marker[i] != -3) { - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) { i1 = S_diag_j[jj]; if (CF_marker[i1] >= 0) - { /* i1 is a C point */ + { + /* i1 is a C point */ if (P_marker[i1] < P_diag_i[i]) { P_marker[i1] = jj_counter; @@ -1300,8 +1313,9 @@ hypre_BoomerAMGBuildExtPIInterpHost(hypre_ParCSRMatrix *A, } } else if (CF_marker[i1] != -3) - { /* i1 is a F point, loop through it's strong neighbors */ - for (kk = S_diag_i[i1]; kk < S_diag_i[i1+1]; kk++) + { + /* i1 is a F point, loop through it's strong neighbors */ + for (kk = S_diag_i[i1]; kk < S_diag_i[i1 + 1]; kk++) { k1 = S_diag_j[kk]; if (CF_marker[k1] >= 0) @@ -1315,7 +1329,7 @@ hypre_BoomerAMGBuildExtPIInterpHost(hypre_ParCSRMatrix *A, } if (num_procs > 1) { - for (kk = S_offd_i[i1]; kk < S_offd_i[i1+1]; kk++) + for (kk = S_offd_i[i1]; kk < S_offd_i[i1 + 1]; kk++) { k1 = S_offd_j[kk]; if (CF_marker_offd[k1] >= 0) @@ -1334,7 +1348,7 @@ hypre_BoomerAMGBuildExtPIInterpHost(hypre_ParCSRMatrix *A, /* Look at off diag strong connections of i */ if (num_procs > 1) { - for (jj = S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) { i1 = S_offd_j[jj]; if (CF_marker_offd[i1] >= 0) @@ -1347,15 +1361,17 @@ hypre_BoomerAMGBuildExtPIInterpHost(hypre_ParCSRMatrix *A, } } else if (CF_marker_offd[i1] != -3) - { /* F point; look at neighbors of i1. Sop contains global col - * numbers and entries that could be in S_diag or S_offd or - * neither. */ - for (kk = Sop_i[i1]; kk < Sop_i[i1+1]; kk++) + { + /* F point; look at neighbors of i1. Sop contains global col + * numbers and entries that could be in S_diag or S_offd or + * neither. */ + for (kk = Sop_i[i1]; kk < Sop_i[i1 + 1]; kk++) { big_k1 = Sop_j[kk]; if (big_k1 >= col_1 && big_k1 < col_n) - { /* In S_diag */ - loc_col = (HYPRE_Int)(big_k1-col_1); + { + /* In S_diag */ + loc_col = (HYPRE_Int)(big_k1 - col_1); if (P_marker[loc_col] < P_diag_i[i]) { P_marker[loc_col] = jj_counter; @@ -1382,7 +1398,7 @@ hypre_BoomerAMGBuildExtPIInterpHost(hypre_ParCSRMatrix *A, * End loop over fine grid. *-----------------------------------------------------------------------*/ #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif P_diag_i[stop] = jj_counter; P_offd_i[stop] = jj_counter_offd; @@ -1392,57 +1408,57 @@ hypre_BoomerAMGBuildExtPIInterpHost(hypre_ParCSRMatrix *A, /* Stitch P_diag_i, P_offd_i and fine_to_coarse together */ #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif if (my_thread_num == 0) { /* Calculate the offset for P_diag_i and P_offd_i for each thread */ for (i = 1; i < num_threads; i++) { - diag_offset[i] = diag_offset[i-1] + diag_offset[i]; - fine_to_coarse_offset[i] = fine_to_coarse_offset[i-1] + fine_to_coarse_offset[i]; - offd_offset[i] = offd_offset[i-1] + offd_offset[i]; + diag_offset[i] = diag_offset[i - 1] + diag_offset[i]; + fine_to_coarse_offset[i] = fine_to_coarse_offset[i - 1] + fine_to_coarse_offset[i]; + offd_offset[i] = offd_offset[i - 1] + offd_offset[i]; } } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif if (my_thread_num > 0) { /* update row pointer array with offset, * making sure to update the row stop index */ - for (i = start+1; i <= stop; i++) + for (i = start + 1; i <= stop; i++) { - P_diag_i[i] += diag_offset[my_thread_num-1]; - P_offd_i[i] += offd_offset[my_thread_num-1]; + P_diag_i[i] += diag_offset[my_thread_num - 1]; + P_offd_i[i] += offd_offset[my_thread_num - 1]; } /* update fine_to_coarse by offsetting with the offset * from the preceding thread */ for (i = start; i < stop; i++) { if (fine_to_coarse[i] >= 0) - { fine_to_coarse[i] += fine_to_coarse_offset[my_thread_num-1]; } + { fine_to_coarse[i] += fine_to_coarse_offset[my_thread_num - 1]; } } } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif if (my_thread_num == 0) { - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d determine structure %f\n", - my_id, wall_time); + my_id, wall_time); fflush(NULL); } /*----------------------------------------------------------------------- * Allocate arrays. *-----------------------------------------------------------------------*/ - if (debug_flag== 4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } P_diag_size = P_diag_i[n_fine]; P_offd_size = P_offd_i[n_fine]; @@ -1464,8 +1480,8 @@ hypre_BoomerAMGBuildExtPIInterpHost(hypre_ParCSRMatrix *A, if (num_procs > 1 && my_thread_num == 0) { hypre_big_insert_new_nodes(comm_pkg, extend_comm_pkg, fine_to_coarse, - full_off_procNodes, my_first_cpt, - fine_to_coarse_offd); + full_off_procNodes, my_first_cpt, + fine_to_coarse_offd); } for (i = 0; i < n_fine; i++) @@ -1482,7 +1498,7 @@ hypre_BoomerAMGBuildExtPIInterpHost(hypre_ParCSRMatrix *A, * Loop over fine grid points. *-----------------------------------------------------------------------*/ #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif for (i = start; i < stop; i++) { @@ -1509,7 +1525,7 @@ hypre_BoomerAMGBuildExtPIInterpHost(hypre_ParCSRMatrix *A, else if (CF_marker[i] != -3) { strong_f_marker--; - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) { i1 = S_diag_j[jj]; @@ -1531,7 +1547,7 @@ hypre_BoomerAMGBuildExtPIInterpHost(hypre_ParCSRMatrix *A, else if (CF_marker[i1] != -3) { P_marker[i1] = strong_f_marker; - for (kk = S_diag_i[i1]; kk < S_diag_i[i1+1]; kk++) + for (kk = S_diag_i[i1]; kk < S_diag_i[i1 + 1]; kk++) { k1 = S_diag_j[kk]; if (CF_marker[k1] >= 0) @@ -1547,7 +1563,7 @@ hypre_BoomerAMGBuildExtPIInterpHost(hypre_ParCSRMatrix *A, } if (num_procs > 1) { - for (kk = S_offd_i[i1]; kk < S_offd_i[i1+1]; kk++) + for (kk = S_offd_i[i1]; kk < S_offd_i[i1 + 1]; kk++) { k1 = S_offd_j[kk]; if (CF_marker_offd[k1] >= 0) @@ -1567,7 +1583,7 @@ hypre_BoomerAMGBuildExtPIInterpHost(hypre_ParCSRMatrix *A, if ( num_procs > 1) { - for (jj=S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) { i1 = S_offd_j[jj]; if ( CF_marker_offd[i1] >= 0) @@ -1583,13 +1599,13 @@ hypre_BoomerAMGBuildExtPIInterpHost(hypre_ParCSRMatrix *A, else if (CF_marker_offd[i1] != -3) { P_marker_offd[i1] = strong_f_marker; - for (kk = Sop_i[i1]; kk < Sop_i[i1+1]; kk++) + for (kk = Sop_i[i1]; kk < Sop_i[i1 + 1]; kk++) { big_k1 = Sop_j[kk]; /* Find local col number */ if (big_k1 >= col_1 && big_k1 < col_n) { - loc_col = (HYPRE_Int)(big_k1-col_1); + loc_col = (HYPRE_Int)(big_k1 - col_1); if (P_marker[loc_col] < jj_begin_row) { P_marker[loc_col] = jj_counter; @@ -1604,7 +1620,7 @@ hypre_BoomerAMGBuildExtPIInterpHost(hypre_ParCSRMatrix *A, if (P_marker_offd[loc_col] < jj_begin_row_offd) { P_marker_offd[loc_col] = jj_counter_offd; - P_offd_j[jj_counter_offd]=loc_col; + P_offd_j[jj_counter_offd] = loc_col; P_offd_data[jj_counter_offd] = zero; jj_counter_offd++; } @@ -1619,9 +1635,10 @@ hypre_BoomerAMGBuildExtPIInterpHost(hypre_ParCSRMatrix *A, diagonal = A_diag_data[A_diag_i[i]]; - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) - { /* i1 is a c-point and strongly influences i, accumulate - * a_(i,i1) into interpolation weight */ + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) + { + /* i1 is a c-point and strongly influences i, accumulate + * a_(i,i1) into interpolation weight */ i1 = A_diag_j[jj]; if (P_marker[i1] >= jj_begin_row) { @@ -1631,47 +1648,53 @@ hypre_BoomerAMGBuildExtPIInterpHost(hypre_ParCSRMatrix *A, { sum = zero; sgn = 1; - if (A_diag_data[A_diag_i[i1]] < 0) sgn = -1; + if (A_diag_data[A_diag_i[i1]] < 0) { sgn = -1; } /* Loop over row of A for point i1 and calculate the sum * of the connections to c-points that strongly influence i. */ - for (jj1 = A_diag_i[i1]+1; jj1 < A_diag_i[i1+1]; jj1++) + for (jj1 = A_diag_i[i1] + 1; jj1 < A_diag_i[i1 + 1]; jj1++) { i2 = A_diag_j[jj1]; - if ((P_marker[i2] >= jj_begin_row || i2 == i) && (sgn*A_diag_data[jj1]) < 0) + if ((P_marker[i2] >= jj_begin_row || i2 == i) && (sgn * A_diag_data[jj1]) < 0) + { sum += A_diag_data[jj1]; + } } if (num_procs > 1) { - for (jj1 = A_offd_i[i1]; jj1< A_offd_i[i1+1]; jj1++) + for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1 + 1]; jj1++) { i2 = A_offd_j[jj1]; if (P_marker_offd[i2] >= jj_begin_row_offd && - (sgn*A_offd_data[jj1]) < 0) + (sgn * A_offd_data[jj1]) < 0) + { sum += A_offd_data[jj1]; + } } } if (sum != 0) { - distribute = A_diag_data[jj]/sum; + distribute = A_diag_data[jj] / sum; /* Loop over row of A for point i1 and do the distribution */ - for (jj1 = A_diag_i[i1]+1; jj1 < A_diag_i[i1+1]; jj1++) + for (jj1 = A_diag_i[i1] + 1; jj1 < A_diag_i[i1 + 1]; jj1++) { i2 = A_diag_j[jj1]; - if (P_marker[i2] >= jj_begin_row && (sgn*A_diag_data[jj1]) < 0) + if (P_marker[i2] >= jj_begin_row && (sgn * A_diag_data[jj1]) < 0) P_diag_data[P_marker[i2]] += - distribute*A_diag_data[jj1]; - if (i2 == i && (sgn*A_diag_data[jj1]) < 0) - diagonal += distribute*A_diag_data[jj1]; + distribute * A_diag_data[jj1]; + if (i2 == i && (sgn * A_diag_data[jj1]) < 0) + { + diagonal += distribute * A_diag_data[jj1]; + } } if (num_procs > 1) { - for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1+1]; jj1++) + for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1 + 1]; jj1++) { i2 = A_offd_j[jj1]; if (P_marker_offd[i2] >= jj_begin_row_offd && - (sgn*A_offd_data[jj1]) < 0) + (sgn * A_offd_data[jj1]) < 0) P_offd_data[P_marker_offd[i2]] += - distribute*A_offd_data[jj1]; + distribute * A_offd_data[jj1]; } } } @@ -1685,56 +1708,68 @@ hypre_BoomerAMGBuildExtPIInterpHost(hypre_ParCSRMatrix *A, else if (CF_marker[i1] != -3) { if (num_functions == 1 || dof_func[i] == dof_func[i1]) + { diagonal += A_diag_data[jj]; + } } } if (num_procs > 1) { - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { i1 = A_offd_j[jj]; if (P_marker_offd[i1] >= jj_begin_row_offd) + { P_offd_data[P_marker_offd[i1]] += A_offd_data[jj]; + } else if (P_marker_offd[i1] == strong_f_marker) { sum = zero; - for (jj1 = A_ext_i[i1]; jj1 < A_ext_i[i1+1]; jj1++) + for (jj1 = A_ext_i[i1]; jj1 < A_ext_i[i1 + 1]; jj1++) { big_k1 = A_ext_j[jj1]; if (big_k1 >= col_1 && big_k1 < col_n) - { /* diag */ + { + /* diag */ loc_col = (HYPRE_Int)(big_k1 - col_1); if (P_marker[loc_col] >= jj_begin_row || loc_col == i) + { sum += A_ext_data[jj1]; + } } else { loc_col = (HYPRE_Int)(-big_k1 - 1); if (P_marker_offd[loc_col] >= jj_begin_row_offd) + { sum += A_ext_data[jj1]; + } } } if (sum != 0) { distribute = A_offd_data[jj] / sum; - for (jj1 = A_ext_i[i1]; jj1 < A_ext_i[i1+1]; jj1++) + for (jj1 = A_ext_i[i1]; jj1 < A_ext_i[i1 + 1]; jj1++) { big_k1 = A_ext_j[jj1]; if (big_k1 >= col_1 && big_k1 < col_n) - { /* diag */ + { + /* diag */ loc_col = (HYPRE_Int)(big_k1 - col_1); if (P_marker[loc_col] >= jj_begin_row) - P_diag_data[P_marker[loc_col]] += distribute* - A_ext_data[jj1]; + P_diag_data[P_marker[loc_col]] += distribute * + A_ext_data[jj1]; if (loc_col == i) - diagonal += distribute*A_ext_data[jj1]; + { + diagonal += distribute * A_ext_data[jj1]; + } } else { loc_col = (HYPRE_Int)(-big_k1 - 1); if (P_marker_offd[loc_col] >= jj_begin_row_offd) - P_offd_data[P_marker_offd[loc_col]] += distribute* - A_ext_data[jj1]; + P_offd_data[P_marker_offd[loc_col]] += distribute * + A_ext_data[jj1]; } } } @@ -1746,16 +1781,22 @@ hypre_BoomerAMGBuildExtPIInterpHost(hypre_ParCSRMatrix *A, else if (CF_marker_offd[i1] != -3) { if (num_functions == 1 || dof_func[i] == dof_func_offd[i1]) + { diagonal += A_offd_data[jj]; + } } } } if (diagonal) { for (jj = jj_begin_row; jj < jj_end_row; jj++) + { P_diag_data[jj] /= -diagonal; + } for (jj = jj_begin_row_offd; jj < jj_end_row_offd; jj++) + { P_offd_data[jj] /= -diagonal; + } } } strong_f_marker--; @@ -1778,11 +1819,11 @@ hypre_BoomerAMGBuildExtPIInterpHost(hypre_ParCSRMatrix *A, * End PAR_REGION *-----------------------------------------------------------------------*/ - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d fill structure %f\n", - my_id, wall_time); + my_id, wall_time); fflush(NULL); } /*----------------------------------------------------------------------- @@ -1841,9 +1882,9 @@ hypre_BoomerAMGBuildExtPIInterpHost(hypre_ParCSRMatrix *A, hypre_MatvecCommPkgCreate(P); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i=0; i < n_fine; i++) + for (i = 0; i < n_fine; i++) { if (CF_marker[i] == -3) { @@ -1898,6 +1939,8 @@ hypre_BoomerAMGBuildExtPICCInterp(hypre_ParCSRMatrix *A, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr) { + HYPRE_UNUSED_VAR(debug_flag); + /* Communication Variables */ MPI_Comm comm = hypre_ParCSRMatrixComm(A); hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); @@ -1957,10 +2000,10 @@ hypre_BoomerAMGBuildExtPICCInterp(hypre_ParCSRMatrix *A, HYPRE_Int common_c; /* Full row information for columns of A that are off diag*/ - hypre_CSRMatrix *A_ext; - HYPRE_Real *A_ext_data; - HYPRE_Int *A_ext_i; - HYPRE_BigInt *A_ext_j; + hypre_CSRMatrix *A_ext = NULL; + HYPRE_Real *A_ext_data = NULL; + HYPRE_Int *A_ext_i = NULL; + HYPRE_BigInt *A_ext_j = NULL; HYPRE_Int *fine_to_coarse = NULL; HYPRE_BigInt *fine_to_coarse_offd = NULL; @@ -1968,9 +2011,9 @@ hypre_BoomerAMGBuildExtPICCInterp(hypre_ParCSRMatrix *A, HYPRE_Int loc_col; HYPRE_Int full_off_procNodes; - hypre_CSRMatrix *Sop; - HYPRE_Int *Sop_i; - HYPRE_BigInt *Sop_j; + hypre_CSRMatrix *Sop = NULL; + HYPRE_Int *Sop_i = NULL; + HYPRE_BigInt *Sop_j = NULL; HYPRE_Int sgn = 1; @@ -2001,11 +2044,11 @@ hypre_BoomerAMGBuildExtPICCInterp(hypre_ParCSRMatrix *A, /* BEGIN */ hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_rank(comm, &my_id); my_first_cpt = num_cpts_global[0]; - if (my_id == (num_procs -1)) total_global_cpts = num_cpts_global[1]; - hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); + if (my_id == (num_procs - 1)) { total_global_cpts = num_cpts_global[1]; } + hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); if (!comm_pkg) { @@ -2019,8 +2062,8 @@ hypre_BoomerAMGBuildExtPICCInterp(hypre_ParCSRMatrix *A, if (num_procs > 1) { hypre_exchange_interp_data( - &CF_marker_offd, &dof_func_offd, &A_ext, &full_off_procNodes, &Sop, &extend_comm_pkg, - A, CF_marker, S, num_functions, dof_func, 1); + &CF_marker_offd, &dof_func_offd, &A_ext, &full_off_procNodes, &Sop, &extend_comm_pkg, + A, CF_marker, S, num_functions, dof_func, 1); { #ifdef HYPRE_PROFILE hypre_profile_times[HYPRE_TIMER_ID_EXTENDED_I_INTERP] += hypre_MPI_Wtime(); @@ -2042,8 +2085,8 @@ hypre_BoomerAMGBuildExtPICCInterp(hypre_ParCSRMatrix *A, /*----------------------------------------------------------------------- * Intialize counters and allocate mapping vector. *-----------------------------------------------------------------------*/ - P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, memory_location_P); - P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, memory_location_P); + P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, memory_location_P); + P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, memory_location_P); if (n_fine) { @@ -2069,8 +2112,8 @@ hypre_BoomerAMGBuildExtPICCInterp(hypre_ParCSRMatrix *A, }*/ hypre_initialize_vecs(n_fine, full_off_procNodes, fine_to_coarse, - fine_to_coarse_offd, P_marker, P_marker_offd, - tmp_CF_marker_offd); + fine_to_coarse_offd, P_marker, P_marker_offd, + tmp_CF_marker_offd); jj_counter = start_indexing; jj_counter_offd = start_indexing; @@ -2083,7 +2126,9 @@ hypre_BoomerAMGBuildExtPICCInterp(hypre_ParCSRMatrix *A, { P_diag_i[i] = jj_counter; if (num_procs > 1) + { P_offd_i[i] = jj_counter_offd; + } if (CF_marker[i] >= 0) { @@ -2102,11 +2147,13 @@ hypre_BoomerAMGBuildExtPICCInterp(hypre_ParCSRMatrix *A, /* Initialize ccounter for each f point */ /*ccounter = 0; ccounter_offd = 0;*/ - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) - { /* search through diag to find all c neighbors */ + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) + { + /* search through diag to find all c neighbors */ i1 = S_diag_j[jj]; if (CF_marker[i1] > 0) - { /* i1 is a C point */ + { + /* i1 is a C point */ CF_marker[i1] = 2; if (P_marker[i1] < P_diag_i[i]) { @@ -2119,11 +2166,13 @@ hypre_BoomerAMGBuildExtPICCInterp(hypre_ParCSRMatrix *A, /*qsort0(clist,0,ccounter-1);*/ if (num_procs > 1) { - for (jj = S_offd_i[i]; jj < S_offd_i[i+1]; jj++) - { /* search through offd to find all c neighbors */ + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) + { + /* search through offd to find all c neighbors */ i1 = S_offd_j[jj]; if (CF_marker_offd[i1] > 0) - { /* i1 is a C point direct neighbor */ + { + /* i1 is a C point direct neighbor */ CF_marker_offd[i1] = 2; if (P_marker_offd[i1] < P_offd_i[i]) { @@ -2136,13 +2185,15 @@ hypre_BoomerAMGBuildExtPICCInterp(hypre_ParCSRMatrix *A, } /*qsort0(clist_offd,0,ccounter_offd-1);*/ } - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) - { /* Search diag to find f neighbors and determine if common c point */ + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) + { + /* Search diag to find f neighbors and determine if common c point */ i1 = S_diag_j[jj]; if (CF_marker[i1] == -1) - { /* i1 is a F point, loop through it's strong neighbors */ + { + /* i1 is a F point, loop through it's strong neighbors */ common_c = 0; - for (kk = S_diag_i[i1]; kk < S_diag_i[i1+1]; kk++) + for (kk = S_diag_i[i1]; kk < S_diag_i[i1 + 1]; kk++) { k1 = S_diag_j[kk]; if (CF_marker[k1] == 2) @@ -2156,13 +2207,15 @@ hypre_BoomerAMGBuildExtPICCInterp(hypre_ParCSRMatrix *A, } } if (num_procs > 1 && common_c == 0) - { /* no common c point yet, check offd */ - for (kk = S_offd_i[i1]; kk < S_offd_i[i1+1]; kk++) + { + /* no common c point yet, check offd */ + for (kk = S_offd_i[i1]; kk < S_offd_i[i1 + 1]; kk++) { k1 = S_offd_j[kk]; if (CF_marker_offd[k1] == 2) - { /* k1 is a c point check if it is common */ + { + /* k1 is a c point check if it is common */ /*if (hypre_BinarySearch(clist_offd,k1,ccounter_offd) >= 0) {*/ common_c = 1; @@ -2173,8 +2226,9 @@ hypre_BoomerAMGBuildExtPICCInterp(hypre_ParCSRMatrix *A, } } if (!common_c) - { /* No common c point, extend the interp set */ - for (kk = S_diag_i[i1]; kk < S_diag_i[i1+1]; kk++) + { + /* No common c point, extend the interp set */ + for (kk = S_diag_i[i1]; kk < S_diag_i[i1 + 1]; kk++) { k1 = S_diag_j[kk]; if (CF_marker[k1] > 0) @@ -2189,7 +2243,7 @@ hypre_BoomerAMGBuildExtPICCInterp(hypre_ParCSRMatrix *A, } if (num_procs > 1) { - for (kk = S_offd_i[i1]; kk < S_offd_i[i1+1]; kk++) + for (kk = S_offd_i[i1]; kk < S_offd_i[i1 + 1]; kk++) { k1 = S_offd_j[kk]; if (CF_marker_offd[k1] > 0) @@ -2210,20 +2264,23 @@ hypre_BoomerAMGBuildExtPICCInterp(hypre_ParCSRMatrix *A, /* Look at off diag strong connections of i */ if (num_procs > 1) { - for (jj = S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) { i1 = S_offd_j[jj]; if (CF_marker_offd[i1] == -1) - { /* F point; look at neighbors of i1. Sop contains global col - * numbers and entries that could be in S_diag or S_offd or - * neither. */ + { + /* F point; look at neighbors of i1. Sop contains global col + * numbers and entries that could be in S_diag or S_offd or + * neither. */ common_c = 0; - for (kk = Sop_i[i1]; kk < Sop_i[i1+1]; kk++) - { /* Check if common c */ + for (kk = Sop_i[i1]; kk < Sop_i[i1 + 1]; kk++) + { + /* Check if common c */ big_k1 = Sop_j[kk]; if (big_k1 >= col_1 && big_k1 < col_n) - { /* In S_diag */ - loc_col = (HYPRE_Int)(big_k1-col_1); + { + /* In S_diag */ + loc_col = (HYPRE_Int)(big_k1 - col_1); if (CF_marker[loc_col] == 2) { /*if (hypre_BinarySearch(clist,loc_col,ccounter) >= 0) @@ -2251,12 +2308,14 @@ hypre_BoomerAMGBuildExtPICCInterp(hypre_ParCSRMatrix *A, } if (!common_c) { - for (kk = Sop_i[i1]; kk < Sop_i[i1+1]; kk++) - { /* Check if common c */ + for (kk = Sop_i[i1]; kk < Sop_i[i1 + 1]; kk++) + { + /* Check if common c */ big_k1 = Sop_j[kk]; if (big_k1 >= col_1 && big_k1 < col_n) - { /* In S_diag */ - loc_col = (HYPRE_Int)(big_k1-col_1); + { + /* In S_diag */ + loc_col = (HYPRE_Int)(big_k1 - col_1); if (P_marker[loc_col] < P_diag_i[i]) { P_marker[loc_col] = jj_counter; @@ -2280,19 +2339,24 @@ hypre_BoomerAMGBuildExtPICCInterp(hypre_ParCSRMatrix *A, } } } - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) - { /* search through diag to find all c neighbors */ + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) + { + /* search through diag to find all c neighbors */ i1 = S_diag_j[jj]; if (CF_marker[i1] == 2) + { CF_marker[i1] = 1; + } } if (num_procs > 1) { - for (jj = S_offd_i[i]; jj < S_offd_i[i+1]; jj++) - { /* search through offd to find all c neighbors */ + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) + { + /* search through offd to find all c neighbors */ i1 = S_offd_j[jj]; if (CF_marker_offd[i1] == 2) - { /* i1 is a C point direct neighbor */ + { + /* i1 is a C point direct neighbor */ CF_marker_offd[i1] = 1; } } @@ -2331,15 +2395,19 @@ hypre_BoomerAMGBuildExtPICCInterp(hypre_ParCSRMatrix *A, if (num_procs > 1) { hypre_big_insert_new_nodes(comm_pkg, extend_comm_pkg, fine_to_coarse, - full_off_procNodes, my_first_cpt, - fine_to_coarse_offd); + full_off_procNodes, my_first_cpt, + fine_to_coarse_offd); } for (i = 0; i < n_fine; i++) + { P_marker[i] = -1; + } for (i = 0; i < full_off_procNodes; i++) + { P_marker_offd[i] = -1; + } /*----------------------------------------------------------------------- * Loop over fine grid points. @@ -2348,7 +2416,9 @@ hypre_BoomerAMGBuildExtPICCInterp(hypre_ParCSRMatrix *A, { jj_begin_row = jj_counter; if (num_procs > 1) + { jj_begin_row_offd = jj_counter_offd; + } /*-------------------------------------------------------------------- * If i is a c-point, interpolation is the identity. @@ -2371,8 +2441,9 @@ hypre_BoomerAMGBuildExtPICCInterp(hypre_ParCSRMatrix *A, ccounter_offd = 0;*/ strong_f_marker--; - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) - { /* Search C points only */ + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) + { + /* Search C points only */ i1 = S_diag_j[jj]; /*-------------------------------------------------------------- @@ -2396,7 +2467,7 @@ hypre_BoomerAMGBuildExtPICCInterp(hypre_ParCSRMatrix *A, /*qsort0(clist,0,ccounter-1);*/ if ( num_procs > 1) { - for (jj=S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) { i1 = S_offd_j[jj]; if ( CF_marker_offd[i1] > 0) @@ -2415,14 +2486,15 @@ hypre_BoomerAMGBuildExtPICCInterp(hypre_ParCSRMatrix *A, /*qsort0(clist_offd,0,ccounter_offd-1);*/ } - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) - { /* Search through F points */ + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) + { + /* Search through F points */ i1 = S_diag_j[jj]; if (CF_marker[i1] == -1) { P_marker[i1] = strong_f_marker; common_c = 0; - for (kk = S_diag_i[i1]; kk < S_diag_i[i1+1]; kk++) + for (kk = S_diag_i[i1]; kk < S_diag_i[i1 + 1]; kk++) { k1 = S_diag_j[kk]; if (CF_marker[k1] == 2) @@ -2436,13 +2508,15 @@ hypre_BoomerAMGBuildExtPICCInterp(hypre_ParCSRMatrix *A, } } if (num_procs > 1 && common_c == 0) - { /* no common c point yet, check offd */ - for (kk = S_offd_i[i1]; kk < S_offd_i[i1+1]; kk++) + { + /* no common c point yet, check offd */ + for (kk = S_offd_i[i1]; kk < S_offd_i[i1 + 1]; kk++) { k1 = S_offd_j[kk]; if (CF_marker_offd[k1] == 2) - { /* k1 is a c point check if it is common */ + { + /* k1 is a c point check if it is common */ /*if (hypre_BinarySearch(clist_offd,k1,ccounter_offd) >= 0) {*/ common_c = 1; @@ -2453,8 +2527,9 @@ hypre_BoomerAMGBuildExtPICCInterp(hypre_ParCSRMatrix *A, } } if (!common_c) - { /* No common c point, extend the interp set */ - for (kk = S_diag_i[i1]; kk < S_diag_i[i1+1]; kk++) + { + /* No common c point, extend the interp set */ + for (kk = S_diag_i[i1]; kk < S_diag_i[i1 + 1]; kk++) { k1 = S_diag_j[kk]; if (CF_marker[k1] >= 0) @@ -2471,7 +2546,7 @@ hypre_BoomerAMGBuildExtPICCInterp(hypre_ParCSRMatrix *A, } if (num_procs > 1) { - for (kk = S_offd_i[i1]; kk < S_offd_i[i1+1]; kk++) + for (kk = S_offd_i[i1]; kk < S_offd_i[i1 + 1]; kk++) { k1 = S_offd_j[kk]; if (CF_marker_offd[k1] >= 0) @@ -2492,19 +2567,22 @@ hypre_BoomerAMGBuildExtPICCInterp(hypre_ParCSRMatrix *A, } if ( num_procs > 1) { - for (jj=S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) { i1 = S_offd_j[jj]; if (CF_marker_offd[i1] == -1) - { /* F points that are off proc */ + { + /* F points that are off proc */ P_marker_offd[i1] = strong_f_marker; common_c = 0; - for (kk = Sop_i[i1]; kk < Sop_i[i1+1]; kk++) - { /* Check if common c */ + for (kk = Sop_i[i1]; kk < Sop_i[i1 + 1]; kk++) + { + /* Check if common c */ big_k1 = Sop_j[kk]; if (big_k1 >= col_1 && big_k1 < col_n) - { /* In S_diag */ - loc_col = (HYPRE_Int)(big_k1-col_1); + { + /* In S_diag */ + loc_col = (HYPRE_Int)(big_k1 - col_1); if (CF_marker[loc_col] == 2) { /*if (hypre_BinarySearch(clist,loc_col,ccounter) >= 0) @@ -2532,13 +2610,13 @@ hypre_BoomerAMGBuildExtPICCInterp(hypre_ParCSRMatrix *A, } if (!common_c) { - for (kk = Sop_i[i1]; kk < Sop_i[i1+1]; kk++) + for (kk = Sop_i[i1]; kk < Sop_i[i1 + 1]; kk++) { big_k1 = Sop_j[kk]; /* Find local col number */ if (big_k1 >= col_1 && big_k1 < col_n) { - loc_col = (HYPRE_Int)(big_k1-col_1); + loc_col = (HYPRE_Int)(big_k1 - col_1); if (P_marker[loc_col] < jj_begin_row) { P_marker[loc_col] = jj_counter; @@ -2554,7 +2632,7 @@ hypre_BoomerAMGBuildExtPICCInterp(hypre_ParCSRMatrix *A, if (P_marker_offd[loc_col] < jj_begin_row_offd) { P_marker_offd[loc_col] = jj_counter_offd; - P_offd_j[jj_counter_offd]=loc_col; + P_offd_j[jj_counter_offd] = loc_col; P_offd_data[jj_counter_offd] = zero; jj_counter_offd++; /*break;*/ @@ -2565,8 +2643,9 @@ hypre_BoomerAMGBuildExtPICCInterp(hypre_ParCSRMatrix *A, } } } - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) - { /* Search C points only */ + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) + { + /* Search C points only */ i1 = S_diag_j[jj]; /*-------------------------------------------------------------- @@ -2581,7 +2660,7 @@ hypre_BoomerAMGBuildExtPICCInterp(hypre_ParCSRMatrix *A, } if ( num_procs > 1) { - for (jj=S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) { i1 = S_offd_j[jj]; if ( CF_marker_offd[i1] == 2) @@ -2596,9 +2675,10 @@ hypre_BoomerAMGBuildExtPICCInterp(hypre_ParCSRMatrix *A, jj_end_row_offd = jj_counter_offd; diagonal = A_diag_data[A_diag_i[i]]; - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) - { /* i1 is a c-point and strongly influences i, accumulate - * a_(i,i1) into interpolation weight */ + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) + { + /* i1 is a c-point and strongly influences i, accumulate + * a_(i,i1) into interpolation weight */ i1 = A_diag_j[jj]; if (P_marker[i1] >= jj_begin_row) { @@ -2608,139 +2688,167 @@ hypre_BoomerAMGBuildExtPICCInterp(hypre_ParCSRMatrix *A, { sum = zero; sgn = 1; - if (A_diag_data[A_diag_i[i1]] < 0) sgn = -1; - for (jj1 = A_diag_i[i1]+1; jj1 < A_diag_i[i1+1]; jj1++) + if (A_diag_data[A_diag_i[i1]] < 0) { sgn = -1; } + for (jj1 = A_diag_i[i1] + 1; jj1 < A_diag_i[i1 + 1]; jj1++) { i2 = A_diag_j[jj1]; - if ((P_marker[i2] >= jj_begin_row || i2 == i) && (sgn*A_diag_data[jj1]) < 0) + if ((P_marker[i2] >= jj_begin_row || i2 == i) && (sgn * A_diag_data[jj1]) < 0) + { sum += A_diag_data[jj1]; + } } if (num_procs > 1) { - for (jj1 = A_offd_i[i1]; jj1< A_offd_i[i1+1]; jj1++) + for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1 + 1]; jj1++) { i2 = A_offd_j[jj1]; if (P_marker_offd[i2] >= jj_begin_row_offd && - (sgn*A_offd_data[jj1]) < 0) + (sgn * A_offd_data[jj1]) < 0) + { sum += A_offd_data[jj1]; + } } } if (sum != 0) { - distribute = A_diag_data[jj]/sum; + distribute = A_diag_data[jj] / sum; /* Loop over row of A for point i1 and do the distribution */ - for (jj1 = A_diag_i[i1]; jj1 < A_diag_i[i1+1]; jj1++) + for (jj1 = A_diag_i[i1]; jj1 < A_diag_i[i1 + 1]; jj1++) { i2 = A_diag_j[jj1]; - if (P_marker[i2] >= jj_begin_row && (sgn*A_diag_data[jj1]) < 0) + if (P_marker[i2] >= jj_begin_row && (sgn * A_diag_data[jj1]) < 0) P_diag_data[P_marker[i2]] += - distribute*A_diag_data[jj1]; - if (i2 == i && (sgn*A_diag_data[jj1]) < 0) - diagonal += distribute*A_diag_data[jj1]; + distribute * A_diag_data[jj1]; + if (i2 == i && (sgn * A_diag_data[jj1]) < 0) + { + diagonal += distribute * A_diag_data[jj1]; + } } if (num_procs > 1) { - for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1+1]; jj1++) + for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1 + 1]; jj1++) { i2 = A_offd_j[jj1]; if (P_marker_offd[i2] >= jj_begin_row_offd && - (sgn*A_offd_data[jj1]) < 0) + (sgn * A_offd_data[jj1]) < 0) P_offd_data[P_marker_offd[i2]] += - distribute*A_offd_data[jj1]; + distribute * A_offd_data[jj1]; } } } else + { diagonal += A_diag_data[jj]; + } } /* neighbor i1 weakly influences i, accumulate a_(i,i1) into * diagonal */ else if (CF_marker[i1] != -3) { if (num_functions == 1 || dof_func[i] == dof_func[i1]) + { diagonal += A_diag_data[jj]; + } } } if (num_procs > 1) { - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { i1 = A_offd_j[jj]; if (P_marker_offd[i1] >= jj_begin_row_offd) + { P_offd_data[P_marker_offd[i1]] += A_offd_data[jj]; + } else if (P_marker_offd[i1] == strong_f_marker) { sum = zero; sgn = 1; - for (jj1 = A_ext_i[i1]; jj1 < A_ext_i[i1+1]; jj1++) + for (jj1 = A_ext_i[i1]; jj1 < A_ext_i[i1 + 1]; jj1++) { big_k1 = A_ext_j[jj1]; if (big_k1 >= col_1 && big_k1 < col_n) - { /* diag */ + { + /* diag */ loc_col = (HYPRE_Int)(big_k1 - col_1); if (P_marker[loc_col] >= jj_begin_row || loc_col == i) + { sum += A_ext_data[jj1]; + } } else { loc_col = (HYPRE_Int)(-big_k1 - 1); if (P_marker_offd[loc_col] >= jj_begin_row_offd) + { sum += A_ext_data[jj1]; + } } } if (sum != 0) { distribute = A_offd_data[jj] / sum; - for (jj1 = A_ext_i[i1]; jj1 < A_ext_i[i1+1]; jj1++) + for (jj1 = A_ext_i[i1]; jj1 < A_ext_i[i1 + 1]; jj1++) { big_k1 = A_ext_j[jj1]; if (big_k1 >= col_1 && big_k1 < col_n) - { /* diag */ + { + /* diag */ loc_col = (HYPRE_Int)(big_k1 - col_1); if (P_marker[loc_col] >= jj_begin_row) - P_diag_data[P_marker[loc_col]] += distribute* - A_ext_data[jj1]; + P_diag_data[P_marker[loc_col]] += distribute * + A_ext_data[jj1]; if (loc_col == i) - diagonal += distribute*A_ext_data[jj1]; + { + diagonal += distribute * A_ext_data[jj1]; + } } else { loc_col = (HYPRE_Int)(-big_k1 - 1); if (P_marker_offd[loc_col] >= jj_begin_row_offd) - P_offd_data[P_marker_offd[loc_col]] += distribute* - A_ext_data[jj1]; + P_offd_data[P_marker_offd[loc_col]] += distribute * + A_ext_data[jj1]; } } } else + { diagonal += A_offd_data[jj]; + } } else if (CF_marker_offd[i1] != -3) { if (num_functions == 1 || dof_func[i] == dof_func_offd[i1]) + { diagonal += A_offd_data[jj]; + } } } } if (diagonal) { for (jj = jj_begin_row; jj < jj_end_row; jj++) + { P_diag_data[jj] /= -diagonal; + } for (jj = jj_begin_row_offd; jj < jj_end_row_offd; jj++) + { P_offd_data[jj] /= -diagonal; + } } } strong_f_marker--; } P = hypre_ParCSRMatrixCreate(comm, - hypre_ParCSRMatrixGlobalNumRows(A), - total_global_cpts, - hypre_ParCSRMatrixColStarts(A), - num_cpts_global, - 0, - P_diag_i[n_fine], - P_offd_i[n_fine]); + hypre_ParCSRMatrixGlobalNumRows(A), + total_global_cpts, + hypre_ParCSRMatrixColStarts(A), + num_cpts_global, + 0, + P_diag_i[n_fine], + P_offd_i[n_fine]); P_diag = hypre_ParCSRMatrixDiag(P); hypre_CSRMatrixData(P_diag) = P_diag_data; @@ -2777,8 +2885,8 @@ hypre_BoomerAMGBuildExtPICCInterp(hypre_ParCSRMatrix *A, hypre_MatvecCommPkgCreate(P); - for (i=0; i < n_fine; i++) - if (CF_marker[i] == -3) CF_marker[i] = -1; + for (i = 0; i < n_fine; i++) + if (CF_marker[i] == -3) { CF_marker[i] = -1; } *P_ptr = P; @@ -2797,7 +2905,9 @@ hypre_BoomerAMGBuildExtPICCInterp(hypre_ParCSRMatrix *A, hypre_TFree(CF_marker_offd, HYPRE_MEMORY_HOST); hypre_TFree(tmp_CF_marker_offd, HYPRE_MEMORY_HOST); if (num_functions > 1) + { hypre_TFree(dof_func_offd, HYPRE_MEMORY_HOST); + } hypre_MatvecCommPkgDestroy(extend_comm_pkg); } @@ -2821,6 +2931,8 @@ hypre_BoomerAMGBuildFFInterp(hypre_ParCSRMatrix *A, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr) { + HYPRE_UNUSED_VAR(debug_flag); + /* Communication Variables */ MPI_Comm comm = hypre_ParCSRMatrixComm(A); hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); @@ -2878,10 +2990,10 @@ hypre_BoomerAMGBuildFFInterp(hypre_ParCSRMatrix *A, HYPRE_Int common_c; /* Full row information for columns of A that are off diag*/ - hypre_CSRMatrix *A_ext; - HYPRE_Real *A_ext_data; - HYPRE_Int *A_ext_i; - HYPRE_BigInt *A_ext_j; + hypre_CSRMatrix *A_ext = NULL; + HYPRE_Real *A_ext_data = NULL; + HYPRE_Int *A_ext_i = NULL; + HYPRE_BigInt *A_ext_j = NULL; HYPRE_Int *fine_to_coarse = NULL; HYPRE_BigInt *fine_to_coarse_offd = NULL; @@ -2889,9 +3001,9 @@ hypre_BoomerAMGBuildFFInterp(hypre_ParCSRMatrix *A, HYPRE_Int loc_col; HYPRE_Int full_off_procNodes; - hypre_CSRMatrix *Sop; - HYPRE_Int *Sop_i; - HYPRE_BigInt *Sop_j; + hypre_CSRMatrix *Sop = NULL; + HYPRE_Int *Sop_i = NULL; + HYPRE_BigInt *Sop_j = NULL; /* Variables to keep count of interpolatory points */ HYPRE_Int jj_counter, jj_counter_offd; @@ -2921,11 +3033,11 @@ hypre_BoomerAMGBuildFFInterp(hypre_ParCSRMatrix *A, /* BEGIN */ hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_rank(comm, &my_id); my_first_cpt = num_cpts_global[0]; - if (my_id == (num_procs -1)) total_global_cpts = num_cpts_global[1]; - hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); + if (my_id == (num_procs - 1)) { total_global_cpts = num_cpts_global[1]; } + hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); if (!comm_pkg) { @@ -2939,8 +3051,8 @@ hypre_BoomerAMGBuildFFInterp(hypre_ParCSRMatrix *A, if (num_procs > 1) { hypre_exchange_interp_data( - &CF_marker_offd, &dof_func_offd, &A_ext, &full_off_procNodes, &Sop, &extend_comm_pkg, - A, CF_marker, S, num_functions, dof_func, 1); + &CF_marker_offd, &dof_func_offd, &A_ext, &full_off_procNodes, &Sop, &extend_comm_pkg, + A, CF_marker, S, num_functions, dof_func, 1); { #ifdef HYPRE_PROFILE hypre_profile_times[HYPRE_TIMER_ID_EXTENDED_I_INTERP] += hypre_MPI_Wtime(); @@ -2962,8 +3074,8 @@ hypre_BoomerAMGBuildFFInterp(hypre_ParCSRMatrix *A, /*----------------------------------------------------------------------- * Intialize counters and allocate mapping vector. *-----------------------------------------------------------------------*/ - P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, memory_location_P); - P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, memory_location_P); + P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, memory_location_P); + P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, memory_location_P); if (n_fine) { @@ -2979,8 +3091,8 @@ hypre_BoomerAMGBuildFFInterp(hypre_ParCSRMatrix *A, } hypre_initialize_vecs(n_fine, full_off_procNodes, fine_to_coarse, - fine_to_coarse_offd, P_marker, P_marker_offd, - tmp_CF_marker_offd); + fine_to_coarse_offd, P_marker, P_marker_offd, + tmp_CF_marker_offd); jj_counter = start_indexing; jj_counter_offd = start_indexing; @@ -2993,7 +3105,9 @@ hypre_BoomerAMGBuildFFInterp(hypre_ParCSRMatrix *A, { P_diag_i[i] = jj_counter; if (num_procs > 1) + { P_offd_i[i] = jj_counter_offd; + } if (CF_marker[i] >= 0) { @@ -3012,11 +3126,13 @@ hypre_BoomerAMGBuildFFInterp(hypre_ParCSRMatrix *A, /* Initialize ccounter for each f point */ /*ccounter = 0; ccounter_offd = 0;*/ - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) - { /* search through diag to find all c neighbors */ + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) + { + /* search through diag to find all c neighbors */ i1 = S_diag_j[jj]; if (CF_marker[i1] > 0) - { /* i1 is a C point */ + { + /* i1 is a C point */ CF_marker[i1] = 2; if (P_marker[i1] < P_diag_i[i]) { @@ -3027,11 +3143,13 @@ hypre_BoomerAMGBuildFFInterp(hypre_ParCSRMatrix *A, } if (num_procs > 1) { - for (jj = S_offd_i[i]; jj < S_offd_i[i+1]; jj++) - { /* search through offd to find all c neighbors */ + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) + { + /* search through offd to find all c neighbors */ i1 = S_offd_j[jj]; if (CF_marker_offd[i1] > 0) - { /* i1 is a C point direct neighbor */ + { + /* i1 is a C point direct neighbor */ CF_marker_offd[i1] = 2; if (P_marker_offd[i1] < P_offd_i[i]) { @@ -3042,13 +3160,15 @@ hypre_BoomerAMGBuildFFInterp(hypre_ParCSRMatrix *A, } } } - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) - { /* Search diag to find f neighbors and determine if common c point */ + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) + { + /* Search diag to find f neighbors and determine if common c point */ i1 = S_diag_j[jj]; if (CF_marker[i1] < 0) - { /* i1 is a F point, loop through it's strong neighbors */ + { + /* i1 is a F point, loop through it's strong neighbors */ common_c = 0; - for (kk = S_diag_i[i1]; kk < S_diag_i[i1+1]; kk++) + for (kk = S_diag_i[i1]; kk < S_diag_i[i1 + 1]; kk++) { k1 = S_diag_j[kk]; if (CF_marker[k1] == 2) @@ -3058,8 +3178,9 @@ hypre_BoomerAMGBuildFFInterp(hypre_ParCSRMatrix *A, } } if (num_procs > 1 && common_c == 0) - { /* no common c point yet, check offd */ - for (kk = S_offd_i[i1]; kk < S_offd_i[i1+1]; kk++) + { + /* no common c point yet, check offd */ + for (kk = S_offd_i[i1]; kk < S_offd_i[i1 + 1]; kk++) { k1 = S_offd_j[kk]; @@ -3071,8 +3192,9 @@ hypre_BoomerAMGBuildFFInterp(hypre_ParCSRMatrix *A, } } if (!common_c) - { /* No common c point, extend the interp set */ - for (kk = S_diag_i[i1]; kk < S_diag_i[i1+1]; kk++) + { + /* No common c point, extend the interp set */ + for (kk = S_diag_i[i1]; kk < S_diag_i[i1 + 1]; kk++) { k1 = S_diag_j[kk]; if (CF_marker[k1] > 0) @@ -3086,7 +3208,7 @@ hypre_BoomerAMGBuildFFInterp(hypre_ParCSRMatrix *A, } if (num_procs > 1) { - for (kk = S_offd_i[i1]; kk < S_offd_i[i1+1]; kk++) + for (kk = S_offd_i[i1]; kk < S_offd_i[i1 + 1]; kk++) { k1 = S_offd_j[kk]; if (CF_marker_offd[k1] > 0) @@ -3106,20 +3228,23 @@ hypre_BoomerAMGBuildFFInterp(hypre_ParCSRMatrix *A, /* Look at off diag strong connections of i */ if (num_procs > 1) { - for (jj = S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) { i1 = S_offd_j[jj]; if (CF_marker_offd[i1] < 0) - { /* F point; look at neighbors of i1. Sop contains global col - * numbers and entries that could be in S_diag or S_offd or - * neither. */ + { + /* F point; look at neighbors of i1. Sop contains global col + * numbers and entries that could be in S_diag or S_offd or + * neither. */ common_c = 0; - for (kk = Sop_i[i1]; kk < Sop_i[i1+1]; kk++) - { /* Check if common c */ + for (kk = Sop_i[i1]; kk < Sop_i[i1 + 1]; kk++) + { + /* Check if common c */ big_k1 = Sop_j[kk]; if (big_k1 >= col_1 && big_k1 < col_n) - { /* In S_diag */ - loc_col = (HYPRE_Int)(big_k1-col_1); + { + /* In S_diag */ + loc_col = (HYPRE_Int)(big_k1 - col_1); if (CF_marker[loc_col] == 2) { common_c = 1; @@ -3138,12 +3263,14 @@ hypre_BoomerAMGBuildFFInterp(hypre_ParCSRMatrix *A, } if (!common_c) { - for (kk = Sop_i[i1]; kk < Sop_i[i1+1]; kk++) - { /* Check if common c */ + for (kk = Sop_i[i1]; kk < Sop_i[i1 + 1]; kk++) + { + /* Check if common c */ big_k1 = Sop_j[kk]; if (big_k1 >= col_1 && big_k1 < col_n) - { /* In S_diag */ - loc_col = (HYPRE_Int)(big_k1-col_1); + { + /* In S_diag */ + loc_col = (HYPRE_Int)(big_k1 - col_1); if (P_marker[loc_col] < P_diag_i[i]) { P_marker[loc_col] = jj_counter; @@ -3165,19 +3292,24 @@ hypre_BoomerAMGBuildFFInterp(hypre_ParCSRMatrix *A, } } } - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) - { /* search through diag to find all c neighbors */ + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) + { + /* search through diag to find all c neighbors */ i1 = S_diag_j[jj]; if (CF_marker[i1] == 2) + { CF_marker[i1] = 1; + } } if (num_procs > 1) { - for (jj = S_offd_i[i]; jj < S_offd_i[i+1]; jj++) - { /* search through offd to find all c neighbors */ + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) + { + /* search through offd to find all c neighbors */ i1 = S_offd_j[jj]; if (CF_marker_offd[i1] == 2) - { /* i1 is a C point direct neighbor */ + { + /* i1 is a C point direct neighbor */ CF_marker_offd[i1] = 1; } } @@ -3216,15 +3348,19 @@ hypre_BoomerAMGBuildFFInterp(hypre_ParCSRMatrix *A, if (num_procs > 1) { hypre_big_insert_new_nodes(comm_pkg, extend_comm_pkg, fine_to_coarse, - full_off_procNodes, my_first_cpt, - fine_to_coarse_offd); + full_off_procNodes, my_first_cpt, + fine_to_coarse_offd); } for (i = 0; i < n_fine; i++) + { P_marker[i] = -1; + } for (i = 0; i < full_off_procNodes; i++) + { P_marker_offd[i] = -1; + } /*----------------------------------------------------------------------- * Loop over fine grid points. @@ -3234,7 +3370,9 @@ hypre_BoomerAMGBuildFFInterp(hypre_ParCSRMatrix *A, { jj_begin_row = jj_counter; if (num_procs > 1) + { jj_begin_row_offd = jj_counter_offd; + } /*-------------------------------------------------------------------- * If i is a c-point, interpolation is the identity. @@ -3257,8 +3395,9 @@ hypre_BoomerAMGBuildFFInterp(hypre_ParCSRMatrix *A, ccounter_offd = 0;*/ strong_f_marker--; - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) - { /* Search C points only */ + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) + { + /* Search C points only */ i1 = S_diag_j[jj]; /*-------------------------------------------------------------- @@ -3280,7 +3419,7 @@ hypre_BoomerAMGBuildFFInterp(hypre_ParCSRMatrix *A, } if ( num_procs > 1) { - for (jj=S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) { i1 = S_offd_j[jj]; if ( CF_marker_offd[i1] > 0) @@ -3297,14 +3436,15 @@ hypre_BoomerAMGBuildFFInterp(hypre_ParCSRMatrix *A, } } - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) - { /* Search through F points */ + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) + { + /* Search through F points */ i1 = S_diag_j[jj]; if (CF_marker[i1] == -1) { P_marker[i1] = strong_f_marker; common_c = 0; - for (kk = S_diag_i[i1]; kk < S_diag_i[i1+1]; kk++) + for (kk = S_diag_i[i1]; kk < S_diag_i[i1 + 1]; kk++) { k1 = S_diag_j[kk]; if (CF_marker[k1] == 2) @@ -3314,8 +3454,9 @@ hypre_BoomerAMGBuildFFInterp(hypre_ParCSRMatrix *A, } } if (num_procs > 1 && common_c == 0) - { /* no common c point yet, check offd */ - for (kk = S_offd_i[i1]; kk < S_offd_i[i1+1]; kk++) + { + /* no common c point yet, check offd */ + for (kk = S_offd_i[i1]; kk < S_offd_i[i1 + 1]; kk++) { k1 = S_offd_j[kk]; @@ -3327,8 +3468,9 @@ hypre_BoomerAMGBuildFFInterp(hypre_ParCSRMatrix *A, } } if (!common_c) - { /* No common c point, extend the interp set */ - for (kk = S_diag_i[i1]; kk < S_diag_i[i1+1]; kk++) + { + /* No common c point, extend the interp set */ + for (kk = S_diag_i[i1]; kk < S_diag_i[i1 + 1]; kk++) { k1 = S_diag_j[kk]; if (CF_marker[k1] >= 0) @@ -3344,7 +3486,7 @@ hypre_BoomerAMGBuildFFInterp(hypre_ParCSRMatrix *A, } if (num_procs > 1) { - for (kk = S_offd_i[i1]; kk < S_offd_i[i1+1]; kk++) + for (kk = S_offd_i[i1]; kk < S_offd_i[i1 + 1]; kk++) { k1 = S_offd_j[kk]; if (CF_marker_offd[k1] >= 0) @@ -3364,19 +3506,22 @@ hypre_BoomerAMGBuildFFInterp(hypre_ParCSRMatrix *A, } if ( num_procs > 1) { - for (jj=S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) { i1 = S_offd_j[jj]; if (CF_marker_offd[i1] == -1) - { /* F points that are off proc */ + { + /* F points that are off proc */ P_marker_offd[i1] = strong_f_marker; common_c = 0; - for (kk = Sop_i[i1]; kk < Sop_i[i1+1]; kk++) - { /* Check if common c */ + for (kk = Sop_i[i1]; kk < Sop_i[i1 + 1]; kk++) + { + /* Check if common c */ big_k1 = Sop_j[kk]; if (big_k1 >= col_1 && big_k1 < col_n) - { /* In S_diag */ - loc_col = (HYPRE_Int)(big_k1-col_1); + { + /* In S_diag */ + loc_col = (HYPRE_Int)(big_k1 - col_1); if (CF_marker[loc_col] == 2) { common_c = 1; @@ -3395,13 +3540,13 @@ hypre_BoomerAMGBuildFFInterp(hypre_ParCSRMatrix *A, } if (!common_c) { - for (kk = Sop_i[i1]; kk < Sop_i[i1+1]; kk++) + for (kk = Sop_i[i1]; kk < Sop_i[i1 + 1]; kk++) { big_k1 = Sop_j[kk]; /* Find local col number */ if (big_k1 >= col_1 && big_k1 < col_n) { - loc_col = (HYPRE_Int)(big_k1-col_1); + loc_col = (HYPRE_Int)(big_k1 - col_1); if (P_marker[loc_col] < jj_begin_row) { P_marker[loc_col] = jj_counter; @@ -3416,7 +3561,7 @@ hypre_BoomerAMGBuildFFInterp(hypre_ParCSRMatrix *A, if (P_marker_offd[loc_col] < jj_begin_row_offd) { P_marker_offd[loc_col] = jj_counter_offd; - P_offd_j[jj_counter_offd]=loc_col; + P_offd_j[jj_counter_offd] = loc_col; P_offd_data[jj_counter_offd] = zero; jj_counter_offd++; } @@ -3426,8 +3571,9 @@ hypre_BoomerAMGBuildFFInterp(hypre_ParCSRMatrix *A, } } } - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) - { /* Search C points only */ + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) + { + /* Search C points only */ i1 = S_diag_j[jj]; /*-------------------------------------------------------------- @@ -3442,7 +3588,7 @@ hypre_BoomerAMGBuildFFInterp(hypre_ParCSRMatrix *A, } if ( num_procs > 1) { - for (jj=S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) { i1 = S_offd_j[jj]; if ( CF_marker_offd[i1] == 2) @@ -3457,9 +3603,10 @@ hypre_BoomerAMGBuildFFInterp(hypre_ParCSRMatrix *A, jj_end_row_offd = jj_counter_offd; diagonal = A_diag_data[A_diag_i[i]]; - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) - { /* i1 is a c-point and strongly influences i, accumulate - * a_(i,i1) into interpolation weight */ + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) + { + /* i1 is a c-point and strongly influences i, accumulate + * a_(i,i1) into interpolation weight */ i1 = A_diag_j[jj]; if (P_marker[i1] >= jj_begin_row) { @@ -3468,136 +3615,160 @@ hypre_BoomerAMGBuildFFInterp(hypre_ParCSRMatrix *A, else if (P_marker[i1] == strong_f_marker) { sum = zero; - if (A_diag_data[A_diag_i[i1]] < 0) sgn = -1; + if (A_diag_data[A_diag_i[i1]] < 0) { sgn = -1; } /* Loop over row of A for point i1 and calculate the sum * of the connections to c-points that strongly incluence i. */ - for (jj1 = A_diag_i[i1]; jj1 < A_diag_i[i1+1]; jj1++) + for (jj1 = A_diag_i[i1]; jj1 < A_diag_i[i1 + 1]; jj1++) { i2 = A_diag_j[jj1]; - if (P_marker[i2] >= jj_begin_row && (sgn*A_diag_data[jj1]) < 0) + if (P_marker[i2] >= jj_begin_row && (sgn * A_diag_data[jj1]) < 0) + { sum += A_diag_data[jj1]; + } } if (num_procs > 1) { - for (jj1 = A_offd_i[i1]; jj1< A_offd_i[i1+1]; jj1++) + for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1 + 1]; jj1++) { i2 = A_offd_j[jj1]; if (P_marker_offd[i2] >= jj_begin_row_offd && - (sgn*A_offd_data[jj1]) < 0) + (sgn * A_offd_data[jj1]) < 0) + { sum += A_offd_data[jj1]; + } } } if (sum != 0) { - distribute = A_diag_data[jj]/sum; + distribute = A_diag_data[jj] / sum; /* Loop over row of A for point i1 and do the distribution */ - for (jj1 = A_diag_i[i1]; jj1 < A_diag_i[i1+1]; jj1++) + for (jj1 = A_diag_i[i1]; jj1 < A_diag_i[i1 + 1]; jj1++) { i2 = A_diag_j[jj1]; - if (P_marker[i2] >= jj_begin_row && (sgn*A_diag_data[jj1]) < 0) + if (P_marker[i2] >= jj_begin_row && (sgn * A_diag_data[jj1]) < 0) P_diag_data[P_marker[i2]] += - distribute*A_diag_data[jj1]; + distribute * A_diag_data[jj1]; } if (num_procs > 1) { - for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1+1]; jj1++) + for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1 + 1]; jj1++) { i2 = A_offd_j[jj1]; if (P_marker_offd[i2] >= jj_begin_row_offd && - (sgn*A_offd_data[jj1]) < 0) + (sgn * A_offd_data[jj1]) < 0) P_offd_data[P_marker_offd[i2]] += - distribute*A_offd_data[jj1]; + distribute * A_offd_data[jj1]; } } } else + { diagonal += A_diag_data[jj]; + } } /* neighbor i1 weakly influences i, accumulate a_(i,i1) into * diagonal */ else if (CF_marker[i1] != -3) { if (num_functions == 1 || dof_func[i] == dof_func[i1]) + { diagonal += A_diag_data[jj]; + } } } if (num_procs > 1) { - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { i1 = A_offd_j[jj]; if (P_marker_offd[i1] >= jj_begin_row_offd) + { P_offd_data[P_marker_offd[i1]] += A_offd_data[jj]; + } else if (P_marker_offd[i1] == strong_f_marker) { sum = zero; - for (jj1 = A_ext_i[i1]; jj1 < A_ext_i[i1+1]; jj1++) + for (jj1 = A_ext_i[i1]; jj1 < A_ext_i[i1 + 1]; jj1++) { big_k1 = A_ext_j[jj1]; if (big_k1 >= col_1 && big_k1 < col_n) - { /* diag */ + { + /* diag */ loc_col = (HYPRE_Int)(big_k1 - col_1); if (P_marker[loc_col] >= jj_begin_row) + { sum += A_ext_data[jj1]; + } } else { loc_col = -(HYPRE_Int)big_k1 - 1; if (P_marker_offd[loc_col] >= jj_begin_row_offd) + { sum += A_ext_data[jj1]; + } } } if (sum != 0) { distribute = A_offd_data[jj] / sum; - for (jj1 = A_ext_i[i1]; jj1 < A_ext_i[i1+1]; jj1++) + for (jj1 = A_ext_i[i1]; jj1 < A_ext_i[i1 + 1]; jj1++) { big_k1 = A_ext_j[jj1]; if (big_k1 >= col_1 && big_k1 < col_n) - { /* diag */ + { + /* diag */ loc_col = (HYPRE_Int)(big_k1 - col_1); if (P_marker[loc_col] >= jj_begin_row) - P_diag_data[P_marker[loc_col]] += distribute* - A_ext_data[jj1]; + P_diag_data[P_marker[loc_col]] += distribute * + A_ext_data[jj1]; } else { loc_col = -(HYPRE_Int)big_k1 - 1; if (P_marker_offd[loc_col] >= jj_begin_row_offd) - P_offd_data[P_marker_offd[loc_col]] += distribute* - A_ext_data[jj1]; + P_offd_data[P_marker_offd[loc_col]] += distribute * + A_ext_data[jj1]; } } } else + { diagonal += A_offd_data[jj]; + } } else if (CF_marker_offd[i1] != -3) { if (num_functions == 1 || dof_func[i] == dof_func_offd[i1]) + { diagonal += A_offd_data[jj]; + } } } } if (diagonal) { for (jj = jj_begin_row; jj < jj_end_row; jj++) + { P_diag_data[jj] /= -diagonal; + } for (jj = jj_begin_row_offd; jj < jj_end_row_offd; jj++) + { P_offd_data[jj] /= -diagonal; + } } } strong_f_marker--; } P = hypre_ParCSRMatrixCreate(comm, - hypre_ParCSRMatrixGlobalNumRows(A), - total_global_cpts, - hypre_ParCSRMatrixColStarts(A), - num_cpts_global, - 0, - P_diag_i[n_fine], - P_offd_i[n_fine]); + hypre_ParCSRMatrixGlobalNumRows(A), + total_global_cpts, + hypre_ParCSRMatrixColStarts(A), + num_cpts_global, + 0, + P_diag_i[n_fine], + P_offd_i[n_fine]); P_diag = hypre_ParCSRMatrixDiag(P); hypre_CSRMatrixData(P_diag) = P_diag_data; @@ -3634,8 +3805,8 @@ hypre_BoomerAMGBuildFFInterp(hypre_ParCSRMatrix *A, hypre_MatvecCommPkgCreate(P); - for (i=0; i < n_fine; i++) - if (CF_marker[i] == -3) CF_marker[i] = -1; + for (i = 0; i < n_fine; i++) + if (CF_marker[i] == -3) { CF_marker[i] = -1; } *P_ptr = P; @@ -3652,7 +3823,9 @@ hypre_BoomerAMGBuildFFInterp(hypre_ParCSRMatrix *A, hypre_TFree(CF_marker_offd, HYPRE_MEMORY_HOST); hypre_TFree(tmp_CF_marker_offd, HYPRE_MEMORY_HOST); if (num_functions > 1) + { hypre_TFree(dof_func_offd, HYPRE_MEMORY_HOST); + } hypre_MatvecCommPkgDestroy(extend_comm_pkg); @@ -3677,6 +3850,8 @@ hypre_BoomerAMGBuildFF1Interp(hypre_ParCSRMatrix *A, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr) { + HYPRE_UNUSED_VAR(debug_flag); + /* Communication Variables */ MPI_Comm comm = hypre_ParCSRMatrixComm(A); hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); @@ -3734,10 +3909,10 @@ hypre_BoomerAMGBuildFF1Interp(hypre_ParCSRMatrix *A, HYPRE_Int common_c; /* Full row information for columns of A that are off diag*/ - hypre_CSRMatrix *A_ext; - HYPRE_Real *A_ext_data; - HYPRE_Int *A_ext_i; - HYPRE_BigInt *A_ext_j; + hypre_CSRMatrix *A_ext = NULL; + HYPRE_Real *A_ext_data = NULL; + HYPRE_Int *A_ext_i = NULL; + HYPRE_BigInt *A_ext_j = NULL; HYPRE_Int *fine_to_coarse = NULL; HYPRE_BigInt *fine_to_coarse_offd = NULL; @@ -3745,9 +3920,9 @@ hypre_BoomerAMGBuildFF1Interp(hypre_ParCSRMatrix *A, HYPRE_Int loc_col; HYPRE_Int full_off_procNodes; - hypre_CSRMatrix *Sop; - HYPRE_Int *Sop_i; - HYPRE_BigInt *Sop_j; + hypre_CSRMatrix *Sop = NULL; + HYPRE_Int *Sop_i = NULL; + HYPRE_BigInt *Sop_j = NULL; /* Variables to keep count of interpolatory points */ HYPRE_Int jj_counter, jj_counter_offd; @@ -3776,11 +3951,11 @@ hypre_BoomerAMGBuildFF1Interp(hypre_ParCSRMatrix *A, hypre_ParCSRCommPkg *extend_comm_pkg = NULL; /* BEGIN */ hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_rank(comm, &my_id); my_first_cpt = num_cpts_global[0]; - if (my_id == (num_procs -1)) total_global_cpts = num_cpts_global[1]; - hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); + if (my_id == (num_procs - 1)) { total_global_cpts = num_cpts_global[1]; } + hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); if (!comm_pkg) { @@ -3794,8 +3969,8 @@ hypre_BoomerAMGBuildFF1Interp(hypre_ParCSRMatrix *A, if (num_procs > 1) { hypre_exchange_interp_data( - &CF_marker_offd, &dof_func_offd, &A_ext, &full_off_procNodes, &Sop, &extend_comm_pkg, - A, CF_marker, S, num_functions, dof_func, 1); + &CF_marker_offd, &dof_func_offd, &A_ext, &full_off_procNodes, &Sop, &extend_comm_pkg, + A, CF_marker, S, num_functions, dof_func, 1); { #ifdef HYPRE_PROFILE hypre_profile_times[HYPRE_TIMER_ID_EXTENDED_I_INTERP] += hypre_MPI_Wtime(); @@ -3817,8 +3992,8 @@ hypre_BoomerAMGBuildFF1Interp(hypre_ParCSRMatrix *A, /*----------------------------------------------------------------------- * Intialize counters and allocate mapping vector. *-----------------------------------------------------------------------*/ - P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, memory_location_P); - P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, memory_location_P); + P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, memory_location_P); + P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, memory_location_P); if (n_fine) { @@ -3834,8 +4009,8 @@ hypre_BoomerAMGBuildFF1Interp(hypre_ParCSRMatrix *A, } hypre_initialize_vecs(n_fine, full_off_procNodes, fine_to_coarse, - fine_to_coarse_offd, P_marker, P_marker_offd, - tmp_CF_marker_offd); + fine_to_coarse_offd, P_marker, P_marker_offd, + tmp_CF_marker_offd); jj_counter = start_indexing; jj_counter_offd = start_indexing; @@ -3848,7 +4023,9 @@ hypre_BoomerAMGBuildFF1Interp(hypre_ParCSRMatrix *A, { P_diag_i[i] = jj_counter; if (num_procs > 1) + { P_offd_i[i] = jj_counter_offd; + } if (CF_marker[i] >= 0) { @@ -3867,11 +4044,13 @@ hypre_BoomerAMGBuildFF1Interp(hypre_ParCSRMatrix *A, /* Initialize ccounter for each f point */ /*ccounter = 0; ccounter_offd = 0;*/ - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) - { /* search through diag to find all c neighbors */ + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) + { + /* search through diag to find all c neighbors */ i1 = S_diag_j[jj]; if (CF_marker[i1] > 0) - { /* i1 is a C point */ + { + /* i1 is a C point */ CF_marker[i1] = 2; if (P_marker[i1] < P_diag_i[i]) { @@ -3882,11 +4061,13 @@ hypre_BoomerAMGBuildFF1Interp(hypre_ParCSRMatrix *A, } if (num_procs > 1) { - for (jj = S_offd_i[i]; jj < S_offd_i[i+1]; jj++) - { /* search through offd to find all c neighbors */ + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) + { + /* search through offd to find all c neighbors */ i1 = S_offd_j[jj]; if (CF_marker_offd[i1] > 0) - { /* i1 is a C point direct neighbor */ + { + /* i1 is a C point direct neighbor */ CF_marker_offd[i1] = 2; if (P_marker_offd[i1] < P_offd_i[i]) { @@ -3897,13 +4078,15 @@ hypre_BoomerAMGBuildFF1Interp(hypre_ParCSRMatrix *A, } } } - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) - { /* Search diag to find f neighbors and determine if common c point */ + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) + { + /* Search diag to find f neighbors and determine if common c point */ i1 = S_diag_j[jj]; if (CF_marker[i1] < 0) - { /* i1 is a F point, loop through it's strong neighbors */ + { + /* i1 is a F point, loop through it's strong neighbors */ common_c = 0; - for (kk = S_diag_i[i1]; kk < S_diag_i[i1+1]; kk++) + for (kk = S_diag_i[i1]; kk < S_diag_i[i1 + 1]; kk++) { k1 = S_diag_j[kk]; if (CF_marker[k1] == 2) @@ -3913,22 +4096,25 @@ hypre_BoomerAMGBuildFF1Interp(hypre_ParCSRMatrix *A, } } if (num_procs > 1 && common_c == 0) - { /* no common c point yet, check offd */ - for (kk = S_offd_i[i1]; kk < S_offd_i[i1+1]; kk++) + { + /* no common c point yet, check offd */ + for (kk = S_offd_i[i1]; kk < S_offd_i[i1 + 1]; kk++) { k1 = S_offd_j[kk]; if (CF_marker_offd[k1] == 2) - { /* k1 is a c point check if it is common */ + { + /* k1 is a c point check if it is common */ common_c = 1; break; } } } if (!common_c) - { /* No common c point, extend the interp set */ + { + /* No common c point, extend the interp set */ found_c = 0; - for (kk = S_diag_i[i1]; kk < S_diag_i[i1+1]; kk++) + for (kk = S_diag_i[i1]; kk < S_diag_i[i1 + 1]; kk++) { k1 = S_diag_j[kk]; if (CF_marker[k1] > 0) @@ -3944,7 +4130,7 @@ hypre_BoomerAMGBuildFF1Interp(hypre_ParCSRMatrix *A, } if (num_procs > 1 && !found_c) { - for (kk = S_offd_i[i1]; kk < S_offd_i[i1+1]; kk++) + for (kk = S_offd_i[i1]; kk < S_offd_i[i1 + 1]; kk++) { k1 = S_offd_j[kk]; if (CF_marker_offd[k1] > 0) @@ -3965,20 +4151,23 @@ hypre_BoomerAMGBuildFF1Interp(hypre_ParCSRMatrix *A, /* Look at off diag strong connections of i */ if (num_procs > 1) { - for (jj = S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) { i1 = S_offd_j[jj]; if (CF_marker_offd[i1] < 0) - { /* F point; look at neighbors of i1. Sop contains global col - * numbers and entries that could be in S_diag or S_offd or - * neither. */ + { + /* F point; look at neighbors of i1. Sop contains global col + * numbers and entries that could be in S_diag or S_offd or + * neither. */ common_c = 0; - for (kk = Sop_i[i1]; kk < Sop_i[i1+1]; kk++) - { /* Check if common c */ + for (kk = Sop_i[i1]; kk < Sop_i[i1 + 1]; kk++) + { + /* Check if common c */ big_k1 = Sop_j[kk]; if (big_k1 >= col_1 && big_k1 < col_n) - { /* In S_diag */ - loc_col = (HYPRE_Int)(big_k1-col_1); + { + /* In S_diag */ + loc_col = (HYPRE_Int)(big_k1 - col_1); if (CF_marker[loc_col] == 2) { common_c = 1; @@ -3997,12 +4186,14 @@ hypre_BoomerAMGBuildFF1Interp(hypre_ParCSRMatrix *A, } if (!common_c) { - for (kk = Sop_i[i1]; kk < Sop_i[i1+1]; kk++) - { /* Check if common c */ + for (kk = Sop_i[i1]; kk < Sop_i[i1 + 1]; kk++) + { + /* Check if common c */ big_k1 = Sop_j[kk]; if (big_k1 >= col_1 && big_k1 < col_n) - { /* In S_diag */ - loc_col = (HYPRE_Int)(big_k1-col_1); + { + /* In S_diag */ + loc_col = (HYPRE_Int)(big_k1 - col_1); if (P_marker[loc_col] < P_diag_i[i]) { P_marker[loc_col] = jj_counter; @@ -4026,19 +4217,24 @@ hypre_BoomerAMGBuildFF1Interp(hypre_ParCSRMatrix *A, } } } - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) - { /* search through diag to find all c neighbors */ + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) + { + /* search through diag to find all c neighbors */ i1 = S_diag_j[jj]; if (CF_marker[i1] == 2) + { CF_marker[i1] = 1; + } } if (num_procs > 1) { - for (jj = S_offd_i[i]; jj < S_offd_i[i+1]; jj++) - { /* search through offd to find all c neighbors */ + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) + { + /* search through offd to find all c neighbors */ i1 = S_offd_j[jj]; if (CF_marker_offd[i1] == 2) - { /* i1 is a C point direct neighbor */ + { + /* i1 is a C point direct neighbor */ CF_marker_offd[i1] = 1; } } @@ -4077,15 +4273,19 @@ hypre_BoomerAMGBuildFF1Interp(hypre_ParCSRMatrix *A, if (num_procs > 1) { hypre_big_insert_new_nodes(comm_pkg, extend_comm_pkg, fine_to_coarse, - full_off_procNodes, my_first_cpt, - fine_to_coarse_offd); + full_off_procNodes, my_first_cpt, + fine_to_coarse_offd); } for (i = 0; i < n_fine; i++) + { P_marker[i] = -1; + } for (i = 0; i < full_off_procNodes; i++) + { P_marker_offd[i] = -1; + } /*----------------------------------------------------------------------- * Loop over fine grid points. @@ -4095,7 +4295,9 @@ hypre_BoomerAMGBuildFF1Interp(hypre_ParCSRMatrix *A, { jj_begin_row = jj_counter; if (num_procs > 1) + { jj_begin_row_offd = jj_counter_offd; + } /*-------------------------------------------------------------------- * If i is a c-point, interpolation is the identity. @@ -4118,8 +4320,9 @@ hypre_BoomerAMGBuildFF1Interp(hypre_ParCSRMatrix *A, ccounter_offd = 0;*/ strong_f_marker--; - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) - { /* Search C points only */ + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) + { + /* Search C points only */ i1 = S_diag_j[jj]; /*-------------------------------------------------------------- @@ -4141,7 +4344,7 @@ hypre_BoomerAMGBuildFF1Interp(hypre_ParCSRMatrix *A, } if ( num_procs > 1) { - for (jj=S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) { i1 = S_offd_j[jj]; if ( CF_marker_offd[i1] > 0) @@ -4158,14 +4361,15 @@ hypre_BoomerAMGBuildFF1Interp(hypre_ParCSRMatrix *A, } } - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) - { /* Search through F points */ + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) + { + /* Search through F points */ i1 = S_diag_j[jj]; if (CF_marker[i1] == -1) { P_marker[i1] = strong_f_marker; common_c = 0; - for (kk = S_diag_i[i1]; kk < S_diag_i[i1+1]; kk++) + for (kk = S_diag_i[i1]; kk < S_diag_i[i1 + 1]; kk++) { k1 = S_diag_j[kk]; if (CF_marker[k1] == 2) @@ -4175,22 +4379,25 @@ hypre_BoomerAMGBuildFF1Interp(hypre_ParCSRMatrix *A, } } if (num_procs > 1 && common_c == 0) - { /* no common c point yet, check offd */ - for (kk = S_offd_i[i1]; kk < S_offd_i[i1+1]; kk++) + { + /* no common c point yet, check offd */ + for (kk = S_offd_i[i1]; kk < S_offd_i[i1 + 1]; kk++) { k1 = S_offd_j[kk]; if (CF_marker_offd[k1] == 2) - { /* k1 is a c point check if it is common */ + { + /* k1 is a c point check if it is common */ common_c = 1; break; } } } if (!common_c) - { /* No common c point, extend the interp set */ + { + /* No common c point, extend the interp set */ found_c = 0; - for (kk = S_diag_i[i1]; kk < S_diag_i[i1+1]; kk++) + for (kk = S_diag_i[i1]; kk < S_diag_i[i1 + 1]; kk++) { k1 = S_diag_j[kk]; if (CF_marker[k1] >= 0) @@ -4208,7 +4415,7 @@ hypre_BoomerAMGBuildFF1Interp(hypre_ParCSRMatrix *A, } if (num_procs > 1 && !found_c) { - for (kk = S_offd_i[i1]; kk < S_offd_i[i1+1]; kk++) + for (kk = S_offd_i[i1]; kk < S_offd_i[i1 + 1]; kk++) { k1 = S_offd_j[kk]; if (CF_marker_offd[k1] >= 0) @@ -4229,19 +4436,22 @@ hypre_BoomerAMGBuildFF1Interp(hypre_ParCSRMatrix *A, } if ( num_procs > 1) { - for (jj=S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) { i1 = S_offd_j[jj]; if (CF_marker_offd[i1] == -1) - { /* F points that are off proc */ + { + /* F points that are off proc */ P_marker_offd[i1] = strong_f_marker; common_c = 0; - for (kk = Sop_i[i1]; kk < Sop_i[i1+1]; kk++) - { /* Check if common c */ + for (kk = Sop_i[i1]; kk < Sop_i[i1 + 1]; kk++) + { + /* Check if common c */ big_k1 = Sop_j[kk]; if (big_k1 >= col_1 && big_k1 < col_n) - { /* In S_diag */ - loc_col = (HYPRE_Int)(big_k1-col_1); + { + /* In S_diag */ + loc_col = (HYPRE_Int)(big_k1 - col_1); if (CF_marker[loc_col] == 2) { common_c = 1; @@ -4260,13 +4470,13 @@ hypre_BoomerAMGBuildFF1Interp(hypre_ParCSRMatrix *A, } if (!common_c) { - for (kk = Sop_i[i1]; kk < Sop_i[i1+1]; kk++) + for (kk = Sop_i[i1]; kk < Sop_i[i1 + 1]; kk++) { big_k1 = Sop_j[kk]; /* Find local col number */ if (big_k1 >= col_1 && big_k1 < col_n) { - loc_col = (HYPRE_Int)(big_k1-col_1); + loc_col = (HYPRE_Int)(big_k1 - col_1); if (P_marker[loc_col] < jj_begin_row) { P_marker[loc_col] = jj_counter; @@ -4282,7 +4492,7 @@ hypre_BoomerAMGBuildFF1Interp(hypre_ParCSRMatrix *A, if (P_marker_offd[loc_col] < jj_begin_row_offd) { P_marker_offd[loc_col] = jj_counter_offd; - P_offd_j[jj_counter_offd]=loc_col; + P_offd_j[jj_counter_offd] = loc_col; P_offd_data[jj_counter_offd] = zero; jj_counter_offd++; break; @@ -4293,8 +4503,9 @@ hypre_BoomerAMGBuildFF1Interp(hypre_ParCSRMatrix *A, } } } - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) - { /* Search C points only */ + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) + { + /* Search C points only */ i1 = S_diag_j[jj]; /*-------------------------------------------------------------- @@ -4309,7 +4520,7 @@ hypre_BoomerAMGBuildFF1Interp(hypre_ParCSRMatrix *A, } if ( num_procs > 1) { - for (jj=S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) { i1 = S_offd_j[jj]; if ( CF_marker_offd[i1] == 2) @@ -4324,9 +4535,10 @@ hypre_BoomerAMGBuildFF1Interp(hypre_ParCSRMatrix *A, jj_end_row_offd = jj_counter_offd; diagonal = A_diag_data[A_diag_i[i]]; - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) - { /* i1 is a c-point and strongly influences i, accumulate - * a_(i,i1) into interpolation weight */ + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) + { + /* i1 is a c-point and strongly influences i, accumulate + * a_(i,i1) into interpolation weight */ i1 = A_diag_j[jj]; if (P_marker[i1] >= jj_begin_row) { @@ -4335,136 +4547,160 @@ hypre_BoomerAMGBuildFF1Interp(hypre_ParCSRMatrix *A, else if (P_marker[i1] == strong_f_marker) { sum = zero; - if (A_diag_data[A_diag_i[i1]] < 0) sgn = -1; + if (A_diag_data[A_diag_i[i1]] < 0) { sgn = -1; } /* Loop over row of A for point i1 and calculate the sum * of the connections to c-points that strongly incluence i. */ - for (jj1 = A_diag_i[i1]; jj1 < A_diag_i[i1+1]; jj1++) + for (jj1 = A_diag_i[i1]; jj1 < A_diag_i[i1 + 1]; jj1++) { i2 = A_diag_j[jj1]; - if (P_marker[i2] >= jj_begin_row && (sgn*A_diag_data[jj1]) < 0) + if (P_marker[i2] >= jj_begin_row && (sgn * A_diag_data[jj1]) < 0) + { sum += A_diag_data[jj1]; + } } if (num_procs > 1) { - for (jj1 = A_offd_i[i1]; jj1< A_offd_i[i1+1]; jj1++) + for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1 + 1]; jj1++) { i2 = A_offd_j[jj1]; if (P_marker_offd[i2] >= jj_begin_row_offd && - (sgn*A_offd_data[jj1]) < 0) + (sgn * A_offd_data[jj1]) < 0) + { sum += A_offd_data[jj1]; + } } } if (sum != 0) { - distribute = A_diag_data[jj]/sum; + distribute = A_diag_data[jj] / sum; /* Loop over row of A for point i1 and do the distribution */ - for (jj1 = A_diag_i[i1]; jj1 < A_diag_i[i1+1]; jj1++) + for (jj1 = A_diag_i[i1]; jj1 < A_diag_i[i1 + 1]; jj1++) { i2 = A_diag_j[jj1]; - if (P_marker[i2] >= jj_begin_row && (sgn*A_diag_data[jj1]) < 0) + if (P_marker[i2] >= jj_begin_row && (sgn * A_diag_data[jj1]) < 0) P_diag_data[P_marker[i2]] += - distribute*A_diag_data[jj1]; + distribute * A_diag_data[jj1]; } if (num_procs > 1) { - for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1+1]; jj1++) + for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1 + 1]; jj1++) { i2 = A_offd_j[jj1]; if (P_marker_offd[i2] >= jj_begin_row_offd && - (sgn*A_offd_data[jj1]) < 0) + (sgn * A_offd_data[jj1]) < 0) P_offd_data[P_marker_offd[i2]] += - distribute*A_offd_data[jj1]; + distribute * A_offd_data[jj1]; } } } else + { diagonal += A_diag_data[jj]; + } } /* neighbor i1 weakly influences i, accumulate a_(i,i1) into * diagonal */ else if (CF_marker[i1] != -3) { if (num_functions == 1 || dof_func[i] == dof_func[i1]) + { diagonal += A_diag_data[jj]; + } } } if (num_procs > 1) { - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { i1 = A_offd_j[jj]; if (P_marker_offd[i1] >= jj_begin_row_offd) + { P_offd_data[P_marker_offd[i1]] += A_offd_data[jj]; + } else if (P_marker_offd[i1] == strong_f_marker) { sum = zero; - for (jj1 = A_ext_i[i1]; jj1 < A_ext_i[i1+1]; jj1++) + for (jj1 = A_ext_i[i1]; jj1 < A_ext_i[i1 + 1]; jj1++) { big_k1 = A_ext_j[jj1]; if (big_k1 >= col_1 && big_k1 < col_n) - { /* diag */ + { + /* diag */ loc_col = (HYPRE_Int)(big_k1 - col_1); if (P_marker[loc_col] >= jj_begin_row) + { sum += A_ext_data[jj1]; + } } else { loc_col = -(HYPRE_Int)big_k1 - 1; if (P_marker_offd[loc_col] >= jj_begin_row_offd) + { sum += A_ext_data[jj1]; + } } } if (sum != 0) { distribute = A_offd_data[jj] / sum; - for (jj1 = A_ext_i[i1]; jj1 < A_ext_i[i1+1]; jj1++) + for (jj1 = A_ext_i[i1]; jj1 < A_ext_i[i1 + 1]; jj1++) { big_k1 = A_ext_j[jj1]; if (big_k1 >= col_1 && big_k1 < col_n) - { /* diag */ + { + /* diag */ loc_col = (HYPRE_Int)(big_k1 - col_1); if (P_marker[loc_col] >= jj_begin_row) - P_diag_data[P_marker[loc_col]] += distribute* - A_ext_data[jj1]; + P_diag_data[P_marker[loc_col]] += distribute * + A_ext_data[jj1]; } else { loc_col = - (HYPRE_Int)big_k1 - 1; if (P_marker_offd[loc_col] >= jj_begin_row_offd) - P_offd_data[P_marker_offd[loc_col]] += distribute* - A_ext_data[jj1]; + P_offd_data[P_marker_offd[loc_col]] += distribute * + A_ext_data[jj1]; } } } else + { diagonal += A_offd_data[jj]; + } } else if (CF_marker_offd[i1] != -3) { if (num_functions == 1 || dof_func[i] == dof_func_offd[i1]) + { diagonal += A_offd_data[jj]; + } } } } if (diagonal) { for (jj = jj_begin_row; jj < jj_end_row; jj++) + { P_diag_data[jj] /= -diagonal; + } for (jj = jj_begin_row_offd; jj < jj_end_row_offd; jj++) + { P_offd_data[jj] /= -diagonal; + } } } strong_f_marker--; } P = hypre_ParCSRMatrixCreate(comm, - hypre_ParCSRMatrixGlobalNumRows(A), - total_global_cpts, - hypre_ParCSRMatrixColStarts(A), - num_cpts_global, - 0, - P_diag_i[n_fine], - P_offd_i[n_fine]); + hypre_ParCSRMatrixGlobalNumRows(A), + total_global_cpts, + hypre_ParCSRMatrixColStarts(A), + num_cpts_global, + 0, + P_diag_i[n_fine], + P_offd_i[n_fine]); P_diag = hypre_ParCSRMatrixDiag(P); hypre_CSRMatrixData(P_diag) = P_diag_data; @@ -4501,8 +4737,8 @@ hypre_BoomerAMGBuildFF1Interp(hypre_ParCSRMatrix *A, hypre_MatvecCommPkgCreate(P); - for (i=0; i < n_fine; i++) - if (CF_marker[i] == -3) CF_marker[i] = -1; + for (i = 0; i < n_fine; i++) + if (CF_marker[i] == -3) { CF_marker[i] = -1; } *P_ptr = P; @@ -4522,7 +4758,9 @@ hypre_BoomerAMGBuildFF1Interp(hypre_ParCSRMatrix *A, hypre_TFree(CF_marker_offd, HYPRE_MEMORY_HOST); hypre_TFree(tmp_CF_marker_offd, HYPRE_MEMORY_HOST); if (num_functions > 1) + { hypre_TFree(dof_func_offd, HYPRE_MEMORY_HOST); + } hypre_MatvecCommPkgDestroy(extend_comm_pkg); @@ -4602,10 +4840,10 @@ hypre_BoomerAMGBuildExtInterpHost(hypre_ParCSRMatrix *A, HYPRE_Int *dof_func_offd = NULL; /* Full row information for columns of A that are off diag*/ - hypre_CSRMatrix *A_ext; - HYPRE_Real *A_ext_data; - HYPRE_Int *A_ext_i; - HYPRE_BigInt *A_ext_j; + hypre_CSRMatrix *A_ext = NULL; + HYPRE_Real *A_ext_data = NULL; + HYPRE_Int *A_ext_i = NULL; + HYPRE_BigInt *A_ext_j = NULL; HYPRE_Int *fine_to_coarse = NULL; HYPRE_BigInt *fine_to_coarse_offd = NULL; @@ -4613,9 +4851,9 @@ hypre_BoomerAMGBuildExtInterpHost(hypre_ParCSRMatrix *A, HYPRE_Int loc_col; HYPRE_Int full_off_procNodes; - hypre_CSRMatrix *Sop; - HYPRE_Int *Sop_i; - HYPRE_BigInt *Sop_j; + hypre_CSRMatrix *Sop = NULL; + HYPRE_Int *Sop_i = NULL; + HYPRE_BigInt *Sop_j = NULL; HYPRE_Int sgn = 1; @@ -4639,23 +4877,22 @@ hypre_BoomerAMGBuildExtInterpHost(hypre_ParCSRMatrix *A, /* Definitions */ HYPRE_Real zero = 0.0; HYPRE_Real one = 1.0; - HYPRE_Real wall_time; - + HYPRE_Real wall_time = 0.0; hypre_ParCSRCommPkg *extend_comm_pkg = NULL; - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } /* BEGIN */ hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_rank(comm, &my_id); my_first_cpt = num_cpts_global[0]; - if (my_id == (num_procs -1)) + if (my_id == (num_procs - 1)) { total_global_cpts = num_cpts_global[1]; } - hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); + hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); if (!comm_pkg) { @@ -4669,8 +4906,8 @@ hypre_BoomerAMGBuildExtInterpHost(hypre_ParCSRMatrix *A, if (num_procs > 1) { hypre_exchange_interp_data( - &CF_marker_offd, &dof_func_offd, &A_ext, &full_off_procNodes, &Sop, &extend_comm_pkg, - A, CF_marker, S, num_functions, dof_func, 1); + &CF_marker_offd, &dof_func_offd, &A_ext, &full_off_procNodes, &Sop, &extend_comm_pkg, + A, CF_marker, S, num_functions, dof_func, 1); { #ifdef HYPRE_PROFILE hypre_profile_times[HYPRE_TIMER_ID_EXTENDED_I_INTERP] += hypre_MPI_Wtime(); @@ -4693,8 +4930,8 @@ hypre_BoomerAMGBuildExtInterpHost(hypre_ParCSRMatrix *A, /*----------------------------------------------------------------------- * Intialize counters and allocate mapping vector. *-----------------------------------------------------------------------*/ - P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, memory_location_P); - P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, memory_location_P); + P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, memory_location_P); + P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, memory_location_P); if (n_fine) { @@ -4742,11 +4979,12 @@ hypre_BoomerAMGBuildExtInterpHost(hypre_ParCSRMatrix *A, *--------------------------------------------------------------------*/ else if (CF_marker[i] != -3) { - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) { i1 = S_diag_j[jj]; if (CF_marker[i1] >= 0) - { /* i1 is a C point */ + { + /* i1 is a C point */ if (P_marker[i1] < P_diag_i[i]) { P_marker[i1] = jj_counter; @@ -4754,8 +4992,9 @@ hypre_BoomerAMGBuildExtInterpHost(hypre_ParCSRMatrix *A, } } else if (CF_marker[i1] != -3) - { /* i1 is a F point, loop through it's strong neighbors */ - for (kk = S_diag_i[i1]; kk < S_diag_i[i1+1]; kk++) + { + /* i1 is a F point, loop through it's strong neighbors */ + for (kk = S_diag_i[i1]; kk < S_diag_i[i1 + 1]; kk++) { k1 = S_diag_j[kk]; if (CF_marker[k1] >= 0) @@ -4769,7 +5008,7 @@ hypre_BoomerAMGBuildExtInterpHost(hypre_ParCSRMatrix *A, } if (num_procs > 1) { - for (kk = S_offd_i[i1]; kk < S_offd_i[i1+1]; kk++) + for (kk = S_offd_i[i1]; kk < S_offd_i[i1 + 1]; kk++) { k1 = S_offd_j[kk]; if (CF_marker_offd[k1] >= 0) @@ -4788,7 +5027,7 @@ hypre_BoomerAMGBuildExtInterpHost(hypre_ParCSRMatrix *A, /* Look at off diag strong connections of i */ if (num_procs > 1) { - for (jj = S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) { i1 = S_offd_j[jj]; if (CF_marker_offd[i1] >= 0) @@ -4801,15 +5040,17 @@ hypre_BoomerAMGBuildExtInterpHost(hypre_ParCSRMatrix *A, } } else if (CF_marker_offd[i1] != -3) - { /* F point; look at neighbors of i1. Sop contains global col - * numbers and entries that could be in S_diag or S_offd or - * neither. */ - for (kk = Sop_i[i1]; kk < Sop_i[i1+1]; kk++) + { + /* F point; look at neighbors of i1. Sop contains global col + * numbers and entries that could be in S_diag or S_offd or + * neither. */ + for (kk = Sop_i[i1]; kk < Sop_i[i1 + 1]; kk++) { big_k1 = Sop_j[kk]; if (big_k1 >= col_1 && big_k1 < col_n) - { /* In S_diag */ - loc_col = (HYPRE_Int)(big_k1-col_1); + { + /* In S_diag */ + loc_col = (HYPRE_Int)(big_k1 - col_1); if (P_marker[loc_col] < P_diag_i[i]) { P_marker[loc_col] = jj_counter; @@ -4833,18 +5074,18 @@ hypre_BoomerAMGBuildExtInterpHost(hypre_ParCSRMatrix *A, } } - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d determine structure %f\n", - my_id, wall_time); + my_id, wall_time); fflush(NULL); } /*----------------------------------------------------------------------- * Allocate arrays. *-----------------------------------------------------------------------*/ - if (debug_flag== 4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } @@ -4914,7 +5155,7 @@ hypre_BoomerAMGBuildExtInterpHost(hypre_ParCSRMatrix *A, else if (CF_marker[i] != -3) { strong_f_marker--; - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) { i1 = S_diag_j[jj]; @@ -4936,7 +5177,7 @@ hypre_BoomerAMGBuildExtInterpHost(hypre_ParCSRMatrix *A, else if (CF_marker[i1] != -3) { P_marker[i1] = strong_f_marker; - for (kk = S_diag_i[i1]; kk < S_diag_i[i1+1]; kk++) + for (kk = S_diag_i[i1]; kk < S_diag_i[i1 + 1]; kk++) { k1 = S_diag_j[kk]; if (CF_marker[k1] >= 0) @@ -4952,7 +5193,7 @@ hypre_BoomerAMGBuildExtInterpHost(hypre_ParCSRMatrix *A, } if (num_procs > 1) { - for (kk = S_offd_i[i1]; kk < S_offd_i[i1+1]; kk++) + for (kk = S_offd_i[i1]; kk < S_offd_i[i1 + 1]; kk++) { k1 = S_offd_j[kk]; if (CF_marker_offd[k1] >= 0) @@ -4972,7 +5213,7 @@ hypre_BoomerAMGBuildExtInterpHost(hypre_ParCSRMatrix *A, if ( num_procs > 1) { - for (jj=S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) { i1 = S_offd_j[jj]; if ( CF_marker_offd[i1] >= 0) @@ -4988,13 +5229,13 @@ hypre_BoomerAMGBuildExtInterpHost(hypre_ParCSRMatrix *A, else if (CF_marker_offd[i1] != -3) { P_marker_offd[i1] = strong_f_marker; - for (kk = Sop_i[i1]; kk < Sop_i[i1+1]; kk++) + for (kk = Sop_i[i1]; kk < Sop_i[i1 + 1]; kk++) { big_k1 = Sop_j[kk]; /* Find local col number */ if (big_k1 >= col_1 && big_k1 < col_n) { - loc_col = (HYPRE_Int)(big_k1-col_1); + loc_col = (HYPRE_Int)(big_k1 - col_1); if (P_marker[loc_col] < jj_begin_row) { P_marker[loc_col] = jj_counter; @@ -5009,7 +5250,7 @@ hypre_BoomerAMGBuildExtInterpHost(hypre_ParCSRMatrix *A, if (P_marker_offd[loc_col] < jj_begin_row_offd) { P_marker_offd[loc_col] = jj_counter_offd; - P_offd_j[jj_counter_offd]=loc_col; + P_offd_j[jj_counter_offd] = loc_col; P_offd_data[jj_counter_offd] = zero; jj_counter_offd++; } @@ -5024,9 +5265,10 @@ hypre_BoomerAMGBuildExtInterpHost(hypre_ParCSRMatrix *A, diagonal = A_diag_data[A_diag_i[i]]; - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) - { /* i1 is a c-point and strongly influences i, accumulate - * a_(i,i1) into interpolation weight */ + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) + { + /* i1 is a c-point and strongly influences i, accumulate + * a_(i,i1) into interpolation weight */ i1 = A_diag_j[jj]; if (P_marker[i1] >= jj_begin_row) { @@ -5042,20 +5284,20 @@ hypre_BoomerAMGBuildExtInterpHost(hypre_ParCSRMatrix *A, } /* Loop over row of A for point i1 and calculate the sum * of the connections to c-points that strongly incluence i. */ - for (jj1 = A_diag_i[i1]+1; jj1 < A_diag_i[i1+1]; jj1++) + for (jj1 = A_diag_i[i1] + 1; jj1 < A_diag_i[i1 + 1]; jj1++) { i2 = A_diag_j[jj1]; - if ((P_marker[i2] >= jj_begin_row ) && (sgn*A_diag_data[jj1]) < 0) + if ((P_marker[i2] >= jj_begin_row ) && (sgn * A_diag_data[jj1]) < 0) { sum += A_diag_data[jj1]; } } if (num_procs > 1) { - for (jj1 = A_offd_i[i1]; jj1< A_offd_i[i1+1]; jj1++) + for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1 + 1]; jj1++) { i2 = A_offd_j[jj1]; - if (P_marker_offd[i2] >= jj_begin_row_offd && (sgn*A_offd_data[jj1]) < 0) + if (P_marker_offd[i2] >= jj_begin_row_offd && (sgn * A_offd_data[jj1]) < 0) { sum += A_offd_data[jj1]; } @@ -5063,24 +5305,24 @@ hypre_BoomerAMGBuildExtInterpHost(hypre_ParCSRMatrix *A, } if (sum != 0) { - distribute = A_diag_data[jj]/sum; + distribute = A_diag_data[jj] / sum; /* Loop over row of A for point i1 and do the distribution */ - for (jj1 = A_diag_i[i1]+1; jj1 < A_diag_i[i1+1]; jj1++) + for (jj1 = A_diag_i[i1] + 1; jj1 < A_diag_i[i1 + 1]; jj1++) { i2 = A_diag_j[jj1]; - if (P_marker[i2] >= jj_begin_row && (sgn*A_diag_data[jj1]) < 0) + if (P_marker[i2] >= jj_begin_row && (sgn * A_diag_data[jj1]) < 0) { - P_diag_data[P_marker[i2]] += distribute*A_diag_data[jj1]; + P_diag_data[P_marker[i2]] += distribute * A_diag_data[jj1]; } } if (num_procs > 1) { - for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1+1]; jj1++) + for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1 + 1]; jj1++) { i2 = A_offd_j[jj1]; - if (P_marker_offd[i2] >= jj_begin_row_offd && (sgn*A_offd_data[jj1]) < 0) + if (P_marker_offd[i2] >= jj_begin_row_offd && (sgn * A_offd_data[jj1]) < 0) { - P_offd_data[P_marker_offd[i2]] += distribute*A_offd_data[jj1]; + P_offd_data[P_marker_offd[i2]] += distribute * A_offd_data[jj1]; } } } @@ -5102,7 +5344,7 @@ hypre_BoomerAMGBuildExtInterpHost(hypre_ParCSRMatrix *A, } if (num_procs > 1) { - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { i1 = A_offd_j[jj]; if (P_marker_offd[i1] >= jj_begin_row_offd) @@ -5112,11 +5354,12 @@ hypre_BoomerAMGBuildExtInterpHost(hypre_ParCSRMatrix *A, else if (P_marker_offd[i1] == strong_f_marker) { sum = zero; - for (jj1 = A_ext_i[i1]; jj1 < A_ext_i[i1+1]; jj1++) + for (jj1 = A_ext_i[i1]; jj1 < A_ext_i[i1 + 1]; jj1++) { big_k1 = A_ext_j[jj1]; if (big_k1 >= col_1 && big_k1 < col_n) - { /* diag */ + { + /* diag */ loc_col = (HYPRE_Int)(big_k1 - col_1); if (P_marker[loc_col] >= jj_begin_row ) { @@ -5135,11 +5378,12 @@ hypre_BoomerAMGBuildExtInterpHost(hypre_ParCSRMatrix *A, if (sum != 0) { distribute = A_offd_data[jj] / sum; - for (jj1 = A_ext_i[i1]; jj1 < A_ext_i[i1+1]; jj1++) + for (jj1 = A_ext_i[i1]; jj1 < A_ext_i[i1 + 1]; jj1++) { big_k1 = A_ext_j[jj1]; if (big_k1 >= col_1 && big_k1 < col_n) - { /* diag */ + { + /* diag */ loc_col = (HYPRE_Int)(big_k1 - col_1); if (P_marker[loc_col] >= jj_begin_row) { @@ -5151,7 +5395,7 @@ hypre_BoomerAMGBuildExtInterpHost(hypre_ParCSRMatrix *A, loc_col = -(HYPRE_Int)big_k1 - 1; if (P_marker_offd[loc_col] >= jj_begin_row_offd) { - P_offd_data[P_marker_offd[loc_col]] += distribute*A_ext_data[jj1]; + P_offd_data[P_marker_offd[loc_col]] += distribute * A_ext_data[jj1]; } } } @@ -5185,7 +5429,7 @@ hypre_BoomerAMGBuildExtInterpHost(hypre_ParCSRMatrix *A, strong_f_marker--; } - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d fill structure %f\n", my_id, wall_time); @@ -5239,7 +5483,7 @@ hypre_BoomerAMGBuildExtInterpHost(hypre_ParCSRMatrix *A, hypre_MatvecCommPkgCreate(P); - for (i=0; i < n_fine; i++) + for (i = 0; i < n_fine; i++) { if (CF_marker[i] == -3) { @@ -5279,30 +5523,26 @@ hypre_BoomerAMGBuildExtInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, HYPRE_Real trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr) { -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_GpuProfilingPushRange("ExtInterp"); -#endif - - HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(A) ); HYPRE_Int ierr = 0; - if (exec == HYPRE_EXEC_HOST) +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(A) ); + if (exec == HYPRE_EXEC_DEVICE) { - ierr = hypre_BoomerAMGBuildExtInterpHost(A,CF_marker,S,num_cpts_global,num_functions,dof_func, - debug_flag,trunc_factor,max_elmts,P_ptr); + ierr = hypre_BoomerAMGBuildExtInterpDevice(A, CF_marker, S, num_cpts_global, num_functions, + dof_func, + debug_flag, trunc_factor, max_elmts, P_ptr); } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) else +#endif { - ierr = hypre_BoomerAMGBuildExtInterpDevice(A,CF_marker,S,num_cpts_global,num_functions,dof_func, - debug_flag,trunc_factor,max_elmts,P_ptr); + ierr = hypre_BoomerAMGBuildExtInterpHost(A, CF_marker, S, num_cpts_global, num_functions, dof_func, + debug_flag, trunc_factor, max_elmts, P_ptr); } -#endif -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_GpuProfilingPopRange(); -#endif return ierr; } @@ -5321,30 +5561,27 @@ hypre_BoomerAMGBuildExtPIInterp(hypre_ParCSRMatrix *A, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr) { -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_GpuProfilingPushRange("ExtPIInterp"); -#endif - - HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(A) ); HYPRE_Int ierr = 0; - if (exec == HYPRE_EXEC_HOST) +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(A) ); + if (exec == HYPRE_EXEC_DEVICE) { - ierr = hypre_BoomerAMGBuildExtPIInterpHost(A, CF_marker, S, num_cpts_global, num_functions, dof_func, - debug_flag, trunc_factor, max_elmts, P_ptr); + ierr = hypre_BoomerAMGBuildExtPIInterpDevice(A, CF_marker, S, num_cpts_global, num_functions, + dof_func, + debug_flag, trunc_factor, max_elmts, P_ptr); } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) else +#endif { - ierr = hypre_BoomerAMGBuildExtPIInterpDevice(A, CF_marker, S, num_cpts_global, num_functions, dof_func, - debug_flag, trunc_factor, max_elmts, P_ptr); + ierr = hypre_BoomerAMGBuildExtPIInterpHost(A, CF_marker, S, num_cpts_global, num_functions, + dof_func, + debug_flag, trunc_factor, max_elmts, P_ptr); } -#endif -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_GpuProfilingPopRange(); -#endif return ierr; } diff --git a/external/hypre/src/parcsr_ls/par_lr_interp_device.c b/external/hypre/src/parcsr_ls/par_lr_interp_device.c index 84e1ba4e..744508b4 100644 --- a/external/hypre/src/parcsr_ls/par_lr_interp_device.c +++ b/external/hypre/src/parcsr_ls/par_lr_interp_device.c @@ -1,458 +1,810 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ +#include "_hypre_onedpl.hpp" #include "_hypre_parcsr_ls.h" #include "aux_interp.h" #include "_hypre_utilities.hpp" -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) #define MAX_C_CONNECTIONS 100 #define HAVE_COMMON_C 1 -__global__ void hypreCUDAKernel_compute_weak_rowsums( HYPRE_Int nr_of_rows, bool has_offd, HYPRE_Int *CF_marker, HYPRE_Int *A_diag_i, HYPRE_Complex *A_diag_a, HYPRE_Int *S_diag_j, HYPRE_Int *A_offd_i, HYPRE_Complex *A_offd_a, HYPRE_Int *S_offd_j, HYPRE_Real *rs, HYPRE_Int flag ); - -__global__ void hypreCUDAKernel_compute_aff_afc( HYPRE_Int nr_of_rows, HYPRE_Int *AFF_diag_i, HYPRE_Int *AFF_diag_j, HYPRE_Complex *AFF_diag_data, HYPRE_Int *AFF_offd_i, HYPRE_Complex *AFF_offd_data, HYPRE_Int *AFC_diag_i, HYPRE_Complex *AFC_diag_data, HYPRE_Int *AFC_offd_i, HYPRE_Complex *AFC_offd_data, HYPRE_Complex *rsW, HYPRE_Complex *rsFC ); +//----------------------------------------------------------------------- +// S_*_j is the special j-array from device SoC +// -1: weak, -2: diag, >=0 (== A_diag_j) : strong +// add weak and the diagonal entries of F-rows +#if defined(HYPRE_USING_SYCL) +SYCL_EXTERNAL +#endif +__global__ +void hypreGPUKernel_compute_weak_rowsums( hypre_DeviceItem &item, + HYPRE_Int nr_of_rows, + bool has_offd, + HYPRE_Int *CF_marker, + HYPRE_Int *A_diag_i, + HYPRE_Complex *A_diag_a, + HYPRE_Int *Soc_diag_j, + HYPRE_Int *A_offd_i, + HYPRE_Complex *A_offd_a, + HYPRE_Int *Soc_offd_j, + HYPRE_Real *rs, + HYPRE_Int flag) +{ + HYPRE_Int row = hypre_gpu_get_grid_warp_id<1, 1>(item); -void hypreDevice_extendWtoP( HYPRE_Int P_nr_of_rows, HYPRE_Int W_nr_of_rows, HYPRE_Int W_nr_of_cols, HYPRE_Int *CF_marker, HYPRE_Int W_diag_nnz, HYPRE_Int *W_diag_i, HYPRE_Int *W_diag_j, HYPRE_Complex *W_diag_data, HYPRE_Int *P_diag_i, HYPRE_Int *P_diag_j, HYPRE_Complex *P_diag_data, HYPRE_Int *W_offd_i, HYPRE_Int *P_offd_i ); + if (row >= nr_of_rows) + { + return; + } -__global__ void hypreCUDAKernel_compute_twiaff_w( HYPRE_Int nr_of_rows, HYPRE_BigInt first_index, HYPRE_Int *AFF_diag_i, HYPRE_Int *AFF_diag_j, HYPRE_Complex *AFF_diag_data, HYPRE_Complex *AFF_diag_data_old, HYPRE_Int *AFF_offd_i, HYPRE_Int *AFF_offd_j, HYPRE_Complex *AFF_offd_data, HYPRE_Int *AFF_ext_i, HYPRE_BigInt *AFF_ext_j, HYPRE_Complex *AFF_ext_data, HYPRE_Complex *rsW, HYPRE_Complex *rsFC, HYPRE_Complex *rsFC_offd ); + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); + HYPRE_Int ib = 0, ie; -__global__ void hypreCUDAKernel_compute_aff_afc_epe( HYPRE_Int nr_of_rows, HYPRE_Int *AFF_diag_i, HYPRE_Int *AFF_diag_j, HYPRE_Complex *AFF_diag_data, HYPRE_Int *AFF_offd_i, HYPRE_Int *AFF_offd_j, HYPRE_Complex *AFF_offd_data, HYPRE_Int *AFC_diag_i, HYPRE_Complex *AFC_diag_data, HYPRE_Int *AFC_offd_i, HYPRE_Complex *AFC_offd_data, HYPRE_Complex *rsW, HYPRE_Complex *dlam, HYPRE_Complex *d_tmp, HYPRE_Complex *dtmp_offd ); + if (lane == 0) + { + ib = read_only_load(CF_marker + row); + } + ib = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, ib, 0); -__global__ void hypreCUDAKernel_compute_dlam_dtmp( HYPRE_Int nr_of_rows, HYPRE_Int *AFF_diag_i, HYPRE_Int *AFF_diag_j, HYPRE_Complex *AFF_diag_data, HYPRE_Int *AFF_offd_i, HYPRE_Complex *AFF_offd_data, HYPRE_Complex *rsFC, HYPRE_Complex *dlam, HYPRE_Complex *dtmp ); + if (ib >= flag) + { + return; + } -/*--------------------------------------------------------------------- - * Extended Interpolation in the form of Mat-Mat - *---------------------------------------------------------------------*/ -HYPRE_Int -hypre_BoomerAMGBuildExtInterpDevice(hypre_ParCSRMatrix *A, - HYPRE_Int *CF_marker, - hypre_ParCSRMatrix *S, - HYPRE_BigInt *num_cpts_global, - HYPRE_Int num_functions, - HYPRE_Int *dof_func, - HYPRE_Int debug_flag, - HYPRE_Real trunc_factor, - HYPRE_Int max_elmts, - hypre_ParCSRMatrix **P_ptr) -{ - HYPRE_Int A_nr_of_rows = hypre_ParCSRMatrixNumRows(A); - hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); - HYPRE_Complex *A_diag_data = hypre_CSRMatrixData(A_diag); - HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); - hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); - HYPRE_Complex *A_offd_data = hypre_CSRMatrixData(A_offd); - HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); - HYPRE_Int A_offd_nnz = hypre_CSRMatrixNumNonzeros(A_offd); + if (lane < 2) + { + ib = read_only_load(A_diag_i + row + lane); + } + ie = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, ib, 1); + ib = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, ib, 0); - hypre_ParCSRMatrix *AFF, *AFC; - hypre_ParCSRMatrix *W, *P; - HYPRE_Int W_nr_of_rows, P_diag_nnz; - HYPRE_Complex *rsFC, *rsWA, *rsW; - HYPRE_Int *P_diag_i, *P_diag_j, *P_offd_i; - HYPRE_Complex *P_diag_data; + HYPRE_Complex rl = 0.0; - hypre_BoomerAMGMakeSocFromSDevice(A, S); + for (HYPRE_Int i = ib + lane; i < ie; i += HYPRE_WARP_SIZE) + { + rl += read_only_load(&A_diag_a[i]) * (read_only_load(&Soc_diag_j[i]) < 0); + } - HYPRE_Int *Soc_diag_j = hypre_ParCSRMatrixSocDiagJ(S); - HYPRE_Int *Soc_offd_j = hypre_ParCSRMatrixSocOffdJ(S); + if (has_offd) + { + if (lane < 2) + { + ib = read_only_load(A_offd_i + row + lane); + } + ie = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, ib, 1); + ib = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, ib, 0); - /* 0. Find row sums of weak elements */ - /* row sum of A-weak + Diag(A), i.e., (D_gamma + D_alpha) in the notes, only for F-pts */ - rsWA = hypre_TAlloc(HYPRE_Complex, A_nr_of_rows, HYPRE_MEMORY_DEVICE); + for (HYPRE_Int i = ib + lane; i < ie; i += HYPRE_WARP_SIZE) + { + rl += read_only_load(&A_offd_a[i]) * (read_only_load(&Soc_offd_j[i]) < 0); + } + } - dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(A_nr_of_rows, "warp", bDim); + rl = warp_reduce_sum(item, rl); - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_compute_weak_rowsums, - gDim, bDim, - A_nr_of_rows, - A_offd_nnz > 0, - CF_marker, - A_diag_i, - A_diag_data, - Soc_diag_j, - A_offd_i, - A_offd_data, - Soc_offd_j, - rsWA, - 0 ); + if (lane == 0) + { + rs[row] = rl; + } +} - // AFF AFC - hypre_GpuProfilingPushRange("Extract Submatrix"); - hypre_ParCSRMatrixGenerateFFFCDevice(A, CF_marker, num_cpts_global, S, &AFC, &AFF); - hypre_GpuProfilingPopRange(); +//----------------------------------------------------------------------- +__global__ +void hypreGPUKernel_compute_aff_afc( hypre_DeviceItem &item, + HYPRE_Int nr_of_rows, + HYPRE_Int *AFF_diag_i, + HYPRE_Int *AFF_diag_j, + HYPRE_Complex *AFF_diag_data, + HYPRE_Int *AFF_offd_i, + HYPRE_Complex *AFF_offd_data, + HYPRE_Int *AFC_diag_i, + HYPRE_Complex *AFC_diag_data, + HYPRE_Int *AFC_offd_i, + HYPRE_Complex *AFC_offd_data, + HYPRE_Complex *rsW, + HYPRE_Complex *rsFC ) +{ + HYPRE_Int row = hypre_gpu_get_grid_warp_id<1, 1>(item); - W_nr_of_rows = hypre_ParCSRMatrixNumRows(AFF); - hypre_assert(A_nr_of_rows == W_nr_of_rows + hypre_ParCSRMatrixNumCols(AFC)); + if (row >= nr_of_rows) + { + return; + } - rsW = hypre_TAlloc(HYPRE_Complex, W_nr_of_rows, HYPRE_MEMORY_DEVICE); - HYPRE_Complex *new_end = HYPRE_THRUST_CALL( copy_if, - rsWA, - rsWA + A_nr_of_rows, - CF_marker, - rsW, - is_negative() ); - hypre_assert(new_end - rsW == W_nr_of_rows); - hypre_TFree(rsWA, HYPRE_MEMORY_DEVICE); + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); + HYPRE_Int p = 0, q; - /* row sum of AFC, i.e., D_beta */ - rsFC = hypre_TAlloc(HYPRE_Complex, W_nr_of_rows, HYPRE_MEMORY_DEVICE); - hypre_CSRMatrixComputeRowSumDevice(hypre_ParCSRMatrixDiag(AFC), NULL, NULL, rsFC, 0, 1.0, "set"); - hypre_CSRMatrixComputeRowSumDevice(hypre_ParCSRMatrixOffd(AFC), NULL, NULL, rsFC, 0, 1.0, "add"); + HYPRE_Complex iscale = 0.0, beta = 0.0; - /* 5. Form matrix ~{A_FF}, (return twAFF in AFF data structure ) */ - /* 6. Form matrix ~{A_FC}, (return twAFC in AFC data structure) */ - hypre_GpuProfilingPushRange("Compute interp matrix"); - gDim = hypre_GetDefaultCUDAGridDimension(W_nr_of_rows, "warp", bDim); - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_compute_aff_afc, - gDim, bDim, - W_nr_of_rows, - hypre_CSRMatrixI(hypre_ParCSRMatrixDiag(AFF)), - hypre_CSRMatrixJ(hypre_ParCSRMatrixDiag(AFF)), - hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(AFF)), - hypre_CSRMatrixI(hypre_ParCSRMatrixOffd(AFF)), - hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(AFF)), - hypre_CSRMatrixI(hypre_ParCSRMatrixDiag(AFC)), - hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(AFC)), - hypre_CSRMatrixI(hypre_ParCSRMatrixOffd(AFC)), - hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(AFC)), - rsW, - rsFC ); - hypre_TFree(rsW, HYPRE_MEMORY_DEVICE); - hypre_TFree(rsFC, HYPRE_MEMORY_DEVICE); - hypre_GpuProfilingPopRange(); + if (lane == 0) + { + iscale = -1.0 / read_only_load(&rsW[row]); + beta = read_only_load(&rsFC[row]); + } + iscale = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, iscale, 0); + beta = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, beta, 0); - /* 7. Perform matrix-matrix multiplication */ - hypre_GpuProfilingPushRange("Matrix-matrix mult"); - W = hypre_ParCSRMatMatDevice(AFF, AFC); - hypre_GpuProfilingPopRange(); + // AFF + /* Diag part */ + if (lane < 2) + { + p = read_only_load(AFF_diag_i + row + lane); + } + q = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 1); + p = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 0); - hypre_ParCSRMatrixDestroy(AFF); - hypre_ParCSRMatrixDestroy(AFC); + // do not assume diag is the first element of row + for (HYPRE_Int j = p + lane; j < q; j += HYPRE_WARP_SIZE) + { + if (read_only_load(&AFF_diag_j[j]) == row) + { + AFF_diag_data[j] = beta * iscale; + } + else + { + AFF_diag_data[j] *= iscale; + } + } - /* 8. Construct P from matrix product W */ - P_diag_nnz = hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixDiag(W)) + - hypre_ParCSRMatrixNumCols(W); + /* offd part */ + if (lane < 2) + { + p = read_only_load(AFF_offd_i + row + lane); + } + q = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 1); + p = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 0); - P_diag_i = hypre_TAlloc(HYPRE_Int, A_nr_of_rows+1, HYPRE_MEMORY_DEVICE); - P_diag_j = hypre_TAlloc(HYPRE_Int, P_diag_nnz, HYPRE_MEMORY_DEVICE); - P_diag_data = hypre_TAlloc(HYPRE_Complex, P_diag_nnz, HYPRE_MEMORY_DEVICE); - P_offd_i = hypre_TAlloc(HYPRE_Int, A_nr_of_rows+1, HYPRE_MEMORY_DEVICE); + for (HYPRE_Int j = p + lane; j < q; j += HYPRE_WARP_SIZE) + { + AFF_offd_data[j] *= iscale; + } - hypre_GpuProfilingPushRange("Extend matrix"); - hypreDevice_extendWtoP( A_nr_of_rows, - W_nr_of_rows, - hypre_ParCSRMatrixNumCols(W), - CF_marker, - hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixDiag(W)), - hypre_CSRMatrixI(hypre_ParCSRMatrixDiag(W)), - hypre_CSRMatrixJ(hypre_ParCSRMatrixDiag(W)), - hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(W)), - P_diag_i, - P_diag_j, - P_diag_data, - hypre_CSRMatrixI(hypre_ParCSRMatrixOffd(W)), - P_offd_i ); - hypre_GpuProfilingPopRange(); + if (beta != 0.0) + { + beta = 1.0 / beta; + } - // final P - P = hypre_ParCSRMatrixCreate(hypre_ParCSRMatrixComm(A), - hypre_ParCSRMatrixGlobalNumRows(A), - hypre_ParCSRMatrixGlobalNumCols(W), - hypre_ParCSRMatrixColStarts(A), - hypre_ParCSRMatrixColStarts(W), - hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(W)), - P_diag_nnz, - hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixOffd(W))); + // AFC + if (lane < 2) + { + p = read_only_load(AFC_diag_i + row + lane); + } + q = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 1); + p = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 0); - hypre_CSRMatrixI(hypre_ParCSRMatrixDiag(P)) = P_diag_i; - hypre_CSRMatrixJ(hypre_ParCSRMatrixDiag(P)) = P_diag_j; - hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(P)) = P_diag_data; + /* Diag part */ + for (HYPRE_Int j = p + lane; j < q; j += HYPRE_WARP_SIZE) + { + AFC_diag_data[j] *= beta; + } - hypre_CSRMatrixI(hypre_ParCSRMatrixOffd(P)) = P_offd_i; - hypre_CSRMatrixJ(hypre_ParCSRMatrixOffd(P)) = hypre_CSRMatrixJ(hypre_ParCSRMatrixOffd(W)); - hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(P)) = hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(W)); - hypre_CSRMatrixJ(hypre_ParCSRMatrixOffd(W)) = NULL; - hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(W)) = NULL; + /* offd part */ + if (lane < 2) + { + p = read_only_load(AFC_offd_i + row + lane); + } + q = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 1); + p = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 0); - hypre_CSRMatrixMemoryLocation(hypre_ParCSRMatrixDiag(P)) = HYPRE_MEMORY_DEVICE; - hypre_CSRMatrixMemoryLocation(hypre_ParCSRMatrixOffd(P)) = HYPRE_MEMORY_DEVICE; + for (HYPRE_Int j = p + lane; j < q; j += HYPRE_WARP_SIZE) + { + AFC_offd_data[j] *= beta; + } +} - hypre_ParCSRMatrixDeviceColMapOffd(P) = hypre_ParCSRMatrixDeviceColMapOffd(W); - hypre_ParCSRMatrixColMapOffd(P) = hypre_ParCSRMatrixColMapOffd(W); - hypre_ParCSRMatrixDeviceColMapOffd(W) = NULL; - hypre_ParCSRMatrixColMapOffd(W) = NULL; - hypre_ParCSRMatrixNumNonzeros(P) = hypre_ParCSRMatrixNumNonzeros(W) + - hypre_ParCSRMatrixGlobalNumCols(W); - hypre_ParCSRMatrixDNumNonzeros(P) = (HYPRE_Real) hypre_ParCSRMatrixNumNonzeros(P); +//----------------------------------------------------------------------- +HYPRE_Int +hypreDevice_extendWtoP( HYPRE_Int P_nr_of_rows, + HYPRE_Int W_nr_of_rows, + HYPRE_Int W_nr_of_cols, + HYPRE_Int *CF_marker, + HYPRE_Int W_diag_nnz, + HYPRE_Int *W_diag_i, + HYPRE_Int *W_diag_j, + HYPRE_Complex *W_diag_data, + HYPRE_Int *P_diag_i, + HYPRE_Int *P_diag_j, + HYPRE_Complex *P_diag_data, + HYPRE_Int *W_offd_i, + HYPRE_Int *P_offd_i ) +{ + hypre_GpuProfilingPushRange("extendWtoP"); - hypre_GpuProfilingPushRange("Truncation"); - if (trunc_factor != 0.0 || max_elmts > 0) - { - hypre_BoomerAMGInterpTruncationDevice(P, trunc_factor, max_elmts ); - } - hypre_GpuProfilingPopRange(); + // row index shift P --> W + HYPRE_Int *PWoffset = hypre_TAlloc(HYPRE_Int, P_nr_of_rows + 1, HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::transform, + CF_marker, + &CF_marker[P_nr_of_rows], + PWoffset, + is_nonnegative() ); +#else + HYPRE_THRUST_CALL( transform, + CF_marker, + &CF_marker[P_nr_of_rows], + PWoffset, + is_nonnegative() ); +#endif - hypre_MatvecCommPkgCreate(P); + hypre_Memset(PWoffset + P_nr_of_rows, 0, sizeof(HYPRE_Int), HYPRE_MEMORY_DEVICE); - HYPRE_THRUST_CALL( replace_if, CF_marker, CF_marker + A_nr_of_rows, equal(-3), -1); + hypreDevice_IntegerExclusiveScan(P_nr_of_rows + 1, PWoffset); - *P_ptr = P; + // map F+C to (next) F + HYPRE_Int *map2F = hypre_TAlloc(HYPRE_Int, P_nr_of_rows + 1, HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::transform, + oneapi::dpl::counting_iterator(0), + oneapi::dpl::counting_iterator(P_nr_of_rows + 1), + PWoffset, + map2F, + std::minus() ); +#else + HYPRE_THRUST_CALL( transform, + thrust::counting_iterator(0), + thrust::counting_iterator(P_nr_of_rows + 1), + PWoffset, + map2F, + thrust::minus() ); +#endif - /* 9. Free memory */ - hypre_ParCSRMatrixDestroy(W); + // P_diag_i +#if defined(HYPRE_USING_SYCL) + hypreSycl_gather( map2F, + map2F + P_nr_of_rows + 1, + W_diag_i, + P_diag_i ); - return hypre_error_flag; -} + hypreDevice_IntAxpyn( P_diag_i, P_nr_of_rows + 1, PWoffset, P_diag_i, 1 ); -/*-----------------------------------------------------------------------*/ -HYPRE_Int -hypre_BoomerAMGBuildExtPIInterpDevice( hypre_ParCSRMatrix *A, - HYPRE_Int *CF_marker, - hypre_ParCSRMatrix *S, - HYPRE_BigInt *num_cpts_global, - HYPRE_Int num_functions, - HYPRE_Int *dof_func, - HYPRE_Int debug_flag, - HYPRE_Real trunc_factor, - HYPRE_Int max_elmts, - hypre_ParCSRMatrix **P_ptr) -{ - HYPRE_Int A_nr_of_rows = hypre_ParCSRMatrixNumRows(A); - hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); - HYPRE_Complex *A_diag_data = hypre_CSRMatrixData(A_diag); - HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); - hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); - HYPRE_Complex *A_offd_data = hypre_CSRMatrixData(A_offd); - HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); - HYPRE_Int A_offd_nnz = hypre_CSRMatrixNumNonzeros(A_offd); - hypre_CSRMatrix *AFF_ext = NULL; - hypre_ParCSRMatrix *AFF, *AFC; - hypre_ParCSRMatrix *W, *P; - HYPRE_Int W_nr_of_rows, P_diag_nnz; - HYPRE_Complex *rsFC, *rsFC_offd, *rsWA, *rsW; - HYPRE_Int *P_diag_i, *P_diag_j, *P_offd_i, num_procs; - HYPRE_Complex *P_diag_data; + // P_offd_i + if (W_offd_i && P_offd_i) + { + hypreSycl_gather( map2F, + map2F + P_nr_of_rows + 1, + W_offd_i, + P_offd_i ); + } +#else + HYPRE_THRUST_CALL( gather, + map2F, + map2F + P_nr_of_rows + 1, + W_diag_i, + P_diag_i ); - hypre_BoomerAMGMakeSocFromSDevice(A, S); + hypreDevice_IntAxpyn( P_diag_i, P_nr_of_rows + 1, PWoffset, P_diag_i, 1 ); - HYPRE_Int *Soc_diag_j = hypre_ParCSRMatrixSocDiagJ(S); - HYPRE_Int *Soc_offd_j = hypre_ParCSRMatrixSocOffdJ(S); + // P_offd_i + if (W_offd_i && P_offd_i) + { + HYPRE_THRUST_CALL( gather, + map2F, + map2F + P_nr_of_rows + 1, + W_offd_i, + P_offd_i ); + } +#endif - hypre_MPI_Comm_size(hypre_ParCSRMatrixComm(A), &num_procs); + hypre_TFree(map2F, HYPRE_MEMORY_DEVICE); - /* 0.Find row sums of weak elements */ - /* row sum of A-weak + Diag(A), i.e., (D_gamma + D_alpha) in the notes, only for F-pts */ - rsWA = hypre_TAlloc(HYPRE_Complex, A_nr_of_rows, HYPRE_MEMORY_DEVICE); + // row index shift W --> P + HYPRE_Int *WPoffset = hypre_TAlloc(HYPRE_Int, W_nr_of_rows, HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_SYCL) + HYPRE_Int *new_end = hypreSycl_copy_if( PWoffset, + PWoffset + P_nr_of_rows, + CF_marker, + WPoffset, + is_negative() ); +#else + HYPRE_Int *new_end = HYPRE_THRUST_CALL( copy_if, + PWoffset, + PWoffset + P_nr_of_rows, + CF_marker, + WPoffset, + is_negative() ); +#endif + hypre_assert(new_end - WPoffset == W_nr_of_rows); - dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(A_nr_of_rows, "warp", bDim); + hypre_TFree(PWoffset, HYPRE_MEMORY_DEVICE); - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_compute_weak_rowsums, - gDim, bDim, - A_nr_of_rows, - A_offd_nnz > 0, - CF_marker, - A_diag_i, - A_diag_data, - Soc_diag_j, - A_offd_i, - A_offd_data, - Soc_offd_j, - rsWA, - 0 ); + // elements shift + HYPRE_Int *shift = hypreDevice_CsrRowPtrsToIndices(W_nr_of_rows, W_diag_nnz, W_diag_i); +#if defined(HYPRE_USING_SYCL) + hypreSycl_gather( shift, + shift + W_diag_nnz, + WPoffset, + shift); +#else + HYPRE_THRUST_CALL( gather, + shift, + shift + W_diag_nnz, + WPoffset, + shift); +#endif + + hypre_TFree(WPoffset, HYPRE_MEMORY_DEVICE); + +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::transform, + shift, + shift + W_diag_nnz, + oneapi::dpl::counting_iterator(0), + shift, + std::plus() ); + + // P_diag_j and P_diag_data + if (W_diag_j && W_diag_data) + { + hypreSycl_scatter( oneapi::dpl::make_zip_iterator(W_diag_j, W_diag_data), + oneapi::dpl::make_zip_iterator(W_diag_j, W_diag_data) + W_diag_nnz, + shift, + oneapi::dpl::make_zip_iterator(P_diag_j, P_diag_data) ); + } +#else + HYPRE_THRUST_CALL( transform, + shift, + shift + W_diag_nnz, + thrust::counting_iterator(0), + shift, + thrust::plus() ); + + // P_diag_j and P_diag_data + if (W_diag_j && W_diag_data) + { + HYPRE_THRUST_CALL( scatter, + thrust::make_zip_iterator(thrust::make_tuple(W_diag_j, W_diag_data)), + thrust::make_zip_iterator(thrust::make_tuple(W_diag_j, W_diag_data)) + W_diag_nnz, + shift, + thrust::make_zip_iterator(thrust::make_tuple(P_diag_j, P_diag_data)) ); + } +#endif + hypre_TFree(shift, HYPRE_MEMORY_DEVICE); + + // fill the gap + HYPRE_Int *PC_i = hypre_TAlloc(HYPRE_Int, W_nr_of_cols, HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_SYCL) + new_end = hypreSycl_copy_if( P_diag_i, + P_diag_i + P_nr_of_rows, + CF_marker, + PC_i, + is_nonnegative() ); +#else + new_end = HYPRE_THRUST_CALL( copy_if, + P_diag_i, + P_diag_i + P_nr_of_rows, + CF_marker, + PC_i, + is_nonnegative() ); +#endif + + hypre_assert(new_end - PC_i == W_nr_of_cols); + +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( copy, + oneapi::dpl::counting_iterator(0), + oneapi::dpl::counting_iterator(W_nr_of_cols), + oneapi::dpl::make_permutation_iterator(P_diag_j, PC_i) ); +#else + HYPRE_THRUST_CALL( scatter, + thrust::counting_iterator(0), + thrust::counting_iterator(W_nr_of_cols), + PC_i, + P_diag_j ); +#endif + + hypreDevice_ScatterConstant(P_diag_data, W_nr_of_cols, PC_i, (HYPRE_Complex) 1.0); + + hypre_TFree(PC_i, HYPRE_MEMORY_DEVICE); - // AFF AFC - hypre_GpuProfilingPushRange("Extract Submatrix"); - hypre_ParCSRMatrixGenerateFFFCDevice(A, CF_marker, num_cpts_global, S, &AFC, &AFF); hypre_GpuProfilingPopRange(); - W_nr_of_rows = hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(AFF)); - hypre_assert(A_nr_of_rows == W_nr_of_rows + hypre_ParCSRMatrixNumCols(AFC)); + return hypre_error_flag; +} - rsW = hypre_TAlloc(HYPRE_Complex, W_nr_of_rows, HYPRE_MEMORY_DEVICE); - HYPRE_Complex *new_end = HYPRE_THRUST_CALL( copy_if, - rsWA, - rsWA + A_nr_of_rows, - CF_marker, - rsW, - is_negative() ); - hypre_assert(new_end - rsW == W_nr_of_rows); - hypre_TFree(rsWA, HYPRE_MEMORY_DEVICE); +//----------------------------------------------------------------------- +// For Ext+i Interp, scale AFF from the left and the right +__global__ +void hypreGPUKernel_compute_twiaff_w( hypre_DeviceItem &item, + HYPRE_Int nr_of_rows, + HYPRE_BigInt first_index, + HYPRE_Int *AFF_diag_i, + HYPRE_Int *AFF_diag_j, + HYPRE_Complex *AFF_diag_data, + HYPRE_Complex *AFF_diag_data_old, + HYPRE_Int *AFF_offd_i, + HYPRE_Int *AFF_offd_j, + HYPRE_Complex *AFF_offd_data, + HYPRE_Int *AFF_ext_i, + HYPRE_BigInt *AFF_ext_j, + HYPRE_Complex *AFF_ext_data, + HYPRE_Complex *rsW, + HYPRE_Complex *rsFC, + HYPRE_Complex *rsFC_offd ) +{ + HYPRE_Int row = hypre_gpu_get_grid_warp_id<1, 1>(item); + + if (row >= nr_of_rows) + { + return; + } + + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); + + HYPRE_Int ib_diag = 0, ie_diag, ib_offd = 0, ie_offd; + + // diag + if (lane < 2) + { + ib_diag = read_only_load(AFF_diag_i + row + lane); + } + ie_diag = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, ib_diag, 1); + ib_diag = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, ib_diag, 0); + + HYPRE_Complex theta_i = 0.0; + + // do not assume diag is the first element of row + // entire warp works on each j + for (HYPRE_Int indj = ib_diag; indj < ie_diag; indj++) + { + HYPRE_Int j = 0; + + if (lane == 0) + { + j = read_only_load(&AFF_diag_j[indj]); + } + j = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, j, 0); + + if (j == row) + { + if (lane == 0) + { + AFF_diag_data[indj] = 1.0; + } + + continue; + } + + HYPRE_Int kb = 0, ke; + + // find if there exists entry (j, row) in row j of diag + if (lane < 2) + { + kb = read_only_load(AFF_diag_i + j + lane); + } + ke = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, kb, 1); + kb = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, kb, 0); + + HYPRE_Int kmatch = -1; + for (HYPRE_Int indk = kb + lane; warp_any_sync(item, HYPRE_WARP_FULL_MASK, indk < ke); + indk += HYPRE_WARP_SIZE) + { + if (indk < ke && row == read_only_load(&AFF_diag_j[indk])) + { + kmatch = indk; + } + + if (warp_any_sync(item, HYPRE_WARP_FULL_MASK, kmatch >= 0)) + { + break; + } + } + kmatch = warp_reduce_max(item, kmatch); + + if (lane == 0) + { + HYPRE_Complex vji = kmatch >= 0 ? read_only_load(&AFF_diag_data_old[kmatch]) : 0.0; + HYPRE_Complex rsj = read_only_load(&rsFC[j]) + vji; + if (rsj) + { + HYPRE_Complex vij = read_only_load(&AFF_diag_data_old[indj]) / rsj; + AFF_diag_data[indj] = vij; + theta_i += vji * vij; + } + else + { + AFF_diag_data[indj] = 0.0; + theta_i += read_only_load(&AFF_diag_data_old[indj]); + } + } + } + + // offd + if (lane < 2) + { + ib_offd = read_only_load(AFF_offd_i + row + lane); + } + ie_offd = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, ib_offd, 1); + ib_offd = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, ib_offd, 0); + + for (HYPRE_Int indj = ib_offd; indj < ie_offd; indj++) + { + HYPRE_Int j = 0; + + if (lane == 0) + { + j = read_only_load(&AFF_offd_j[indj]); + } + j = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, j, 0); + + HYPRE_Int kb = 0, ke; + + if (lane < 2) + { + kb = read_only_load(AFF_ext_i + j + lane); + } + ke = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, kb, 1); + kb = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, kb, 0); + + HYPRE_Int kmatch = -1; + for (HYPRE_Int indk = kb + lane; warp_any_sync(item, HYPRE_WARP_FULL_MASK, indk < ke); + indk += HYPRE_WARP_SIZE) + { + if (indk < ke && row + first_index == read_only_load(&AFF_ext_j[indk])) + { + kmatch = indk; + } + + if (warp_any_sync(item, HYPRE_WARP_FULL_MASK, kmatch >= 0)) + { + break; + } + } + kmatch = warp_reduce_max(item, kmatch); + + if (lane == 0) + { + HYPRE_Complex vji = kmatch >= 0 ? read_only_load(&AFF_ext_data[kmatch]) : 0.0; + HYPRE_Complex rsj = read_only_load(&rsFC_offd[j]) + vji; + if (rsj) + { + HYPRE_Complex vij = read_only_load(&AFF_offd_data[indj]) / rsj; + AFF_offd_data[indj] = vij; + theta_i += vji * vij; + } + else + { + AFF_offd_data[indj] = 0.0; + theta_i += read_only_load(&AFF_offd_data[indj]); + } + } + } + + // scale row + if (lane == 0) + { + theta_i += read_only_load(rsW + row); + theta_i = theta_i ? -1.0 / theta_i : -1.0; + } + theta_i = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, theta_i, 0); + + for (HYPRE_Int j = ib_diag + lane; j < ie_diag; j += HYPRE_WARP_SIZE) + { + AFF_diag_data[j] *= theta_i; + } + + for (HYPRE_Int j = ib_offd + lane; j < ie_offd; j += HYPRE_WARP_SIZE) + { + AFF_offd_data[j] *= theta_i; + } +} + + +//----------------------------------------------------------------------- +__global__ +void hypreGPUKernel_compute_aff_afc_epe( hypre_DeviceItem &item, + HYPRE_Int nr_of_rows, + HYPRE_Int *AFF_diag_i, + HYPRE_Int *AFF_diag_j, + HYPRE_Complex *AFF_diag_data, + HYPRE_Int *AFF_offd_i, + HYPRE_Int *AFF_offd_j, + HYPRE_Complex *AFF_offd_data, + HYPRE_Int *AFC_diag_i, + HYPRE_Complex *AFC_diag_data, + HYPRE_Int *AFC_offd_i, + HYPRE_Complex *AFC_offd_data, + HYPRE_Complex *rsW, + HYPRE_Complex *dlam, + HYPRE_Complex *dtmp, + HYPRE_Complex *dtmp_offd ) +{ + HYPRE_Int row = hypre_gpu_get_grid_warp_id<1, 1>(item); - /* row sum of AFC, i.e., D_beta */ - rsFC = hypre_TAlloc(HYPRE_Complex, W_nr_of_rows, HYPRE_MEMORY_DEVICE); - hypre_CSRMatrixComputeRowSumDevice(hypre_ParCSRMatrixDiag(AFC), NULL, NULL, rsFC, 0, 1.0, "set"); - hypre_CSRMatrixComputeRowSumDevice(hypre_ParCSRMatrixOffd(AFC), NULL, NULL, rsFC, 0, 1.0, "add"); + if (row >= nr_of_rows) + { + return; + } - /* collect off-processor rsFC */ - hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(AFF); - hypre_ParCSRCommHandle *comm_handle; - if (!comm_pkg) + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); + HYPRE_Int pd = 0, qd, po = 0, qo, xd = 0, yd, xo = 0, yo; + + HYPRE_Complex theta = 0.0, value = 0.0; + HYPRE_Complex dtau_i = 0.0; + + if (lane < 2) { - hypre_MatvecCommPkgCreate(AFF); - comm_pkg = hypre_ParCSRMatrixCommPkg(AFF); + pd = read_only_load(AFF_diag_i + row + lane); + po = read_only_load(AFF_offd_i + row + lane); + xd = read_only_load(AFC_diag_i + row + lane); + xo = read_only_load(AFC_offd_i + row + lane); } - rsFC_offd = hypre_TAlloc(HYPRE_Complex, hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(AFF)), HYPRE_MEMORY_DEVICE); - HYPRE_Int num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - HYPRE_Int num_elmts_send = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends); - HYPRE_Complex *send_buf = hypre_TAlloc(HYPRE_Complex, num_elmts_send, HYPRE_MEMORY_DEVICE); - hypre_ParCSRCommPkgCopySendMapElmtsToDevice(comm_pkg); - HYPRE_THRUST_CALL( gather, - hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), - hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + num_elmts_send, - rsFC, - send_buf ); - comm_handle = hypre_ParCSRCommHandleCreate_v2(1, comm_pkg, HYPRE_MEMORY_DEVICE, send_buf, HYPRE_MEMORY_DEVICE, rsFC_offd); - hypre_ParCSRCommHandleDestroy(comm_handle); - hypre_TFree(send_buf, HYPRE_MEMORY_DEVICE); - /* offd rows of AFF */ - if (num_procs > 1) + qd = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, pd, 1); + pd = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, pd, 0); + qo = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, po, 1); + po = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, po, 0); + yd = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, xd, 1); + xd = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, xd, 0); + yo = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, xo, 1); + xo = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, xo, 0); + + /* D_\tau */ + /* do not assume the first element is the diagonal */ + for (HYPRE_Int j = pd + lane; j < qd; j += HYPRE_WARP_SIZE) { - AFF_ext = hypre_ParCSRMatrixExtractBExtDevice(AFF, AFF, 1); + const HYPRE_Int index = read_only_load(&AFF_diag_j[j]); + if (index != row) + { + dtau_i += AFF_diag_data[j] * read_only_load(&dtmp[index]); + } } - /* 5. Form matrix ~{A_FF}, (return twAFF in AFF data structure ) */ - HYPRE_Complex *AFF_diag_data_old = hypre_TAlloc(HYPRE_Complex, hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixDiag(AFF)), - HYPRE_MEMORY_DEVICE); - HYPRE_THRUST_CALL( copy, - hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(AFF)), - hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(AFF)) + hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixDiag(AFF)), - AFF_diag_data_old ); + for (HYPRE_Int j = po + lane; j < qo; j += HYPRE_WARP_SIZE) + { + const HYPRE_Int index = read_only_load(&AFF_offd_j[j]); + dtau_i += AFF_offd_data[j] * read_only_load(&dtmp_offd[index]); + } - hypre_GpuProfilingPushRange("Compute interp matrix"); - gDim = hypre_GetDefaultCUDAGridDimension(W_nr_of_rows, "warp", bDim); - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_compute_twiaff_w, - gDim, bDim, - W_nr_of_rows, - hypre_ParCSRMatrixFirstRowIndex(AFF), - hypre_CSRMatrixI(hypre_ParCSRMatrixDiag(AFF)), - hypre_CSRMatrixJ(hypre_ParCSRMatrixDiag(AFF)), - hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(AFF)), - AFF_diag_data_old, - hypre_CSRMatrixI(hypre_ParCSRMatrixOffd(AFF)), - hypre_CSRMatrixJ(hypre_ParCSRMatrixOffd(AFF)), - hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(AFF)), - AFF_ext ? hypre_CSRMatrixI(AFF_ext) : NULL, - AFF_ext ? hypre_CSRMatrixBigJ(AFF_ext) : NULL, - AFF_ext ? hypre_CSRMatrixData(AFF_ext) : NULL, - rsW, - rsFC, - rsFC_offd ); - hypre_TFree(rsW, HYPRE_MEMORY_DEVICE); - hypre_TFree(rsFC, HYPRE_MEMORY_DEVICE); - hypre_TFree(rsFC_offd, HYPRE_MEMORY_DEVICE); - hypre_TFree(AFF_diag_data_old, HYPRE_MEMORY_DEVICE); - hypre_CSRMatrixDestroy(AFF_ext); - hypre_GpuProfilingPopRange(); + dtau_i = warp_reduce_sum(item, dtau_i); - /* 7. Perform matrix-matrix multiplication */ - hypre_GpuProfilingPushRange("Matrix-matrix mult"); - W = hypre_ParCSRMatMatDevice(AFF, AFC); - hypre_GpuProfilingPopRange(); + if (lane == 0) + { + value = read_only_load(&rsW[row]) + dtau_i; + value = value != 0.0 ? -1.0 / value : 0.0; - hypre_ParCSRMatrixDestroy(AFF); - hypre_ParCSRMatrixDestroy(AFC); + theta = read_only_load(&dlam[row]); + } - /* 8. Construct P from matrix product W */ - P_diag_nnz = hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixDiag(W)) + - hypre_ParCSRMatrixNumCols(W); + value = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, value, 0); + theta = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, theta, 0); - P_diag_i = hypre_TAlloc(HYPRE_Int, A_nr_of_rows+1, HYPRE_MEMORY_DEVICE); - P_diag_j = hypre_TAlloc(HYPRE_Int, P_diag_nnz, HYPRE_MEMORY_DEVICE); - P_diag_data = hypre_TAlloc(HYPRE_Complex, P_diag_nnz, HYPRE_MEMORY_DEVICE); - P_offd_i = hypre_TAlloc(HYPRE_Int, A_nr_of_rows+1, HYPRE_MEMORY_DEVICE); + /* AFF Diag part */ + // do not assume diag is the first element of row + for (HYPRE_Int j = pd + lane; j < qd; j += HYPRE_WARP_SIZE) + { + if (read_only_load(&AFF_diag_j[j]) == row) + { + AFF_diag_data[j] = theta * value; + } + else + { + AFF_diag_data[j] *= value; + } + } - hypre_GpuProfilingPushRange("Extend matrix"); - hypreDevice_extendWtoP( A_nr_of_rows, - W_nr_of_rows, - hypre_ParCSRMatrixNumCols(W), - CF_marker, - hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixDiag(W)), - hypre_CSRMatrixI(hypre_ParCSRMatrixDiag(W)), - hypre_CSRMatrixJ(hypre_ParCSRMatrixDiag(W)), - hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(W)), - P_diag_i, - P_diag_j, - P_diag_data, - hypre_CSRMatrixI(hypre_ParCSRMatrixOffd(W)), - P_offd_i ); - hypre_GpuProfilingPopRange(); + /* AFF offd part */ + for (HYPRE_Int j = po + lane; j < qo; j += HYPRE_WARP_SIZE) + { + AFF_offd_data[j] *= value; + } - // final P - P = hypre_ParCSRMatrixCreate(hypre_ParCSRMatrixComm(A), - hypre_ParCSRMatrixGlobalNumRows(A), - hypre_ParCSRMatrixGlobalNumCols(W), - hypre_ParCSRMatrixColStarts(A), - hypre_ParCSRMatrixColStarts(W), - hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(W)), - P_diag_nnz, - hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixOffd(W))); + theta = theta != 0.0 ? 1.0 / theta : 0.0; - hypre_CSRMatrixI(hypre_ParCSRMatrixDiag(P)) = P_diag_i; - hypre_CSRMatrixJ(hypre_ParCSRMatrixDiag(P)) = P_diag_j; - hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(P)) = P_diag_data; + /* AFC Diag part */ + for (HYPRE_Int j = xd + lane; j < yd; j += HYPRE_WARP_SIZE) + { + AFC_diag_data[j] *= theta; + } - hypre_CSRMatrixI(hypre_ParCSRMatrixOffd(P)) = P_offd_i; - hypre_CSRMatrixJ(hypre_ParCSRMatrixOffd(P)) = hypre_CSRMatrixJ(hypre_ParCSRMatrixOffd(W)); - hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(P)) = hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(W)); - hypre_CSRMatrixJ(hypre_ParCSRMatrixOffd(W)) = NULL; - hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(W)) = NULL; + /* AFC offd part */ + for (HYPRE_Int j = xo + lane; j < yo; j += HYPRE_WARP_SIZE) + { + AFC_offd_data[j] *= theta; + } +} - hypre_CSRMatrixMemoryLocation(hypre_ParCSRMatrixDiag(P)) = HYPRE_MEMORY_DEVICE; - hypre_CSRMatrixMemoryLocation(hypre_ParCSRMatrixOffd(P)) = HYPRE_MEMORY_DEVICE; +//----------------------------------------------------------------------- +// For Ext+e Interp, compute D_lambda and D_tmp = D_mu / D_lambda +#if defined(HYPRE_USING_SYCL) +SYCL_EXTERNAL +#endif +__global__ +void hypreGPUKernel_compute_dlam_dtmp( hypre_DeviceItem &item, + HYPRE_Int nr_of_rows, + HYPRE_Int *AFF_diag_i, + HYPRE_Int *AFF_diag_j, + HYPRE_Complex *AFF_diag_data, + HYPRE_Int *AFF_offd_i, + HYPRE_Complex *AFF_offd_data, + HYPRE_Complex *rsFC, + HYPRE_Complex *dlam, + HYPRE_Complex *dtmp ) +{ + HYPRE_Int row = hypre_gpu_get_grid_warp_id<1, 1>(item); - hypre_ParCSRMatrixDeviceColMapOffd(P) = hypre_ParCSRMatrixDeviceColMapOffd(W); - hypre_ParCSRMatrixColMapOffd(P) = hypre_ParCSRMatrixColMapOffd(W); - hypre_ParCSRMatrixDeviceColMapOffd(W) = NULL; - hypre_ParCSRMatrixColMapOffd(W) = NULL; + if (row >= nr_of_rows) + { + return; + } - hypre_ParCSRMatrixNumNonzeros(P) = hypre_ParCSRMatrixNumNonzeros(W) + - hypre_ParCSRMatrixGlobalNumCols(W); - hypre_ParCSRMatrixDNumNonzeros(P) = (HYPRE_Real) hypre_ParCSRMatrixNumNonzeros(P); + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); + HYPRE_Int p_diag = 0, p_offd = 0, q_diag, q_offd; - hypre_GpuProfilingPushRange("Truncation"); - if (trunc_factor != 0.0 || max_elmts > 0) + if (lane < 2) { - hypre_BoomerAMGInterpTruncationDevice(P, trunc_factor, max_elmts ); + p_diag = read_only_load(AFF_diag_i + row + lane); } - hypre_GpuProfilingPopRange(); + q_diag = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_diag, 1); + p_diag = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_diag, 0); - hypre_MatvecCommPkgCreate(P); + HYPRE_Complex row_sum = 0.0; + HYPRE_Int find_diag = 0; - HYPRE_THRUST_CALL( replace_if, CF_marker, CF_marker + A_nr_of_rows, equal(-3), -1); + /* do not assume the first element is the diagonal */ + for (HYPRE_Int j = p_diag + lane; j < q_diag; j += HYPRE_WARP_SIZE) + { + if (read_only_load(&AFF_diag_j[j]) == row) + { + find_diag ++; + } + else + { + row_sum += read_only_load(&AFF_diag_data[j]); + } + } - *P_ptr = P; + if (lane < 2) + { + p_offd = read_only_load(AFF_offd_i + row + lane); + } + q_offd = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_offd, 1); + p_offd = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_offd, 0); - /* 9. Free memory */ - hypre_ParCSRMatrixDestroy(W); + for (HYPRE_Int j = p_offd + lane; j < q_offd; j += HYPRE_WARP_SIZE) + { + row_sum += read_only_load(&AFF_offd_data[j]); + } - return hypre_error_flag; + row_sum = warp_reduce_sum(item, row_sum); + find_diag = warp_reduce_sum(item, find_diag); + + if (lane == 0) + { + HYPRE_Int num = q_diag - p_diag + q_offd - p_offd - find_diag; + HYPRE_Complex mu = num > 0 ? row_sum / ((HYPRE_Complex) num) : 0.0; + /* lambda = beta + mu */ + HYPRE_Complex lam = read_only_load(&rsFC[row]) + mu; + dlam[row] = lam; + dtmp[row] = lam != 0.0 ? mu / lam : 0.0; + } } /*--------------------------------------------------------------------- - * Extended+e Interpolation in the form of Mat-Mat + * Extended Interpolation in the form of Mat-Mat *---------------------------------------------------------------------*/ HYPRE_Int -hypre_BoomerAMGBuildExtPEInterpDevice(hypre_ParCSRMatrix *A, - HYPRE_Int *CF_marker, - hypre_ParCSRMatrix *S, - HYPRE_BigInt *num_cpts_global, - HYPRE_Int num_functions, - HYPRE_Int *dof_func, - HYPRE_Int debug_flag, - HYPRE_Real trunc_factor, - HYPRE_Int max_elmts, - hypre_ParCSRMatrix **P_ptr) +hypre_BoomerAMGBuildExtInterpDevice(hypre_ParCSRMatrix *A, + HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, + HYPRE_BigInt *num_cpts_global, + HYPRE_Int num_functions, + HYPRE_Int *dof_func, + HYPRE_Int debug_flag, + HYPRE_Real trunc_factor, + HYPRE_Int max_elmts, + hypre_ParCSRMatrix **P_ptr) { + HYPRE_UNUSED_VAR(num_functions); + HYPRE_UNUSED_VAR(debug_flag); + HYPRE_UNUSED_VAR(dof_func); + HYPRE_Int A_nr_of_rows = hypre_ParCSRMatrixNumRows(A); hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); HYPRE_Complex *A_diag_data = hypre_CSRMatrixData(A_diag); @@ -462,37 +814,38 @@ hypre_BoomerAMGBuildExtPEInterpDevice(hypre_ParCSRMatrix *A, HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); HYPRE_Int A_offd_nnz = hypre_CSRMatrixNumNonzeros(A_offd); - hypre_BoomerAMGMakeSocFromSDevice(A, S); - - HYPRE_Int *Soc_diag_j = hypre_ParCSRMatrixSocDiagJ(S); - HYPRE_Int *Soc_offd_j = hypre_ParCSRMatrixSocOffdJ(S); hypre_ParCSRMatrix *AFF, *AFC; hypre_ParCSRMatrix *W, *P; HYPRE_Int W_nr_of_rows, P_diag_nnz; - HYPRE_Complex *dlam, *dtmp, *dtmp_offd, *rsFC, *rsWA, *rsW; + HYPRE_Complex *rsFC, *rsWA, *rsW; HYPRE_Int *P_diag_i, *P_diag_j, *P_offd_i; HYPRE_Complex *P_diag_data; + hypre_BoomerAMGMakeSocFromSDevice(A, S); + + HYPRE_Int *Soc_diag_j = hypre_ParCSRMatrixSocDiagJ(S); + HYPRE_Int *Soc_offd_j = hypre_ParCSRMatrixSocOffdJ(S); + /* 0. Find row sums of weak elements */ - /* row sum of A-weak + Diag(A), i.e., (D_gamma + D_FF) in the notes, only for F-pts */ + /* row sum of A-weak + Diag(A), i.e., (D_gamma + D_alpha) in the notes, only for F-pts */ rsWA = hypre_TAlloc(HYPRE_Complex, A_nr_of_rows, HYPRE_MEMORY_DEVICE); - dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(A_nr_of_rows, "warp", bDim); - - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_compute_weak_rowsums, - gDim, bDim, - A_nr_of_rows, - A_offd_nnz > 0, - CF_marker, - A_diag_i, - A_diag_data, - Soc_diag_j, - A_offd_i, - A_offd_data, - Soc_offd_j, - rsWA, - 0 ); + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(A_nr_of_rows, "warp", bDim); + + HYPRE_GPU_LAUNCH( hypreGPUKernel_compute_weak_rowsums, + gDim, bDim, + A_nr_of_rows, + A_offd_nnz > 0, + CF_marker, + A_diag_i, + A_diag_data, + Soc_diag_j, + A_offd_i, + A_offd_data, + Soc_offd_j, + rsWA, + 0 ); // AFF AFC hypre_GpuProfilingPushRange("Extract Submatrix"); @@ -503,88 +856,57 @@ hypre_BoomerAMGBuildExtPEInterpDevice(hypre_ParCSRMatrix *A, hypre_assert(A_nr_of_rows == W_nr_of_rows + hypre_ParCSRMatrixNumCols(AFC)); rsW = hypre_TAlloc(HYPRE_Complex, W_nr_of_rows, HYPRE_MEMORY_DEVICE); - HYPRE_Complex *new_end = HYPRE_THRUST_CALL( copy_if, - rsWA, +#if defined(HYPRE_USING_SYCL) + HYPRE_Complex *new_end = hypreSycl_copy_if( rsWA, rsWA + A_nr_of_rows, CF_marker, rsW, is_negative() ); - hypre_assert(new_end - rsW == W_nr_of_rows); - hypre_TFree(rsWA, HYPRE_MEMORY_DEVICE); - - /* row sum of AFC, i.e., D_beta */ - rsFC = hypre_TAlloc(HYPRE_Complex, W_nr_of_rows, HYPRE_MEMORY_DEVICE); - hypre_CSRMatrixComputeRowSumDevice(hypre_ParCSRMatrixDiag(AFC), NULL, NULL, rsFC, 0, 1.0, "set"); - hypre_CSRMatrixComputeRowSumDevice(hypre_ParCSRMatrixOffd(AFC), NULL, NULL, rsFC, 0, 1.0, "add"); - - /* Generate D_lambda in the paper: D_beta + (row sum of AFF without diagonal elements / row_nnz) */ - /* Generate D_tmp, i.e., D_mu / D_lambda */ - dlam = hypre_TAlloc(HYPRE_Complex, W_nr_of_rows, HYPRE_MEMORY_DEVICE); - dtmp = hypre_TAlloc(HYPRE_Complex, W_nr_of_rows, HYPRE_MEMORY_DEVICE); - hypre_GpuProfilingPushRange("Compute D_tmp"); - gDim = hypre_GetDefaultCUDAGridDimension(W_nr_of_rows, "warp", bDim); - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_compute_dlam_dtmp, - gDim, bDim, - W_nr_of_rows, - hypre_CSRMatrixI(hypre_ParCSRMatrixDiag(AFF)), - hypre_CSRMatrixJ(hypre_ParCSRMatrixDiag(AFF)), - hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(AFF)), - hypre_CSRMatrixI(hypre_ParCSRMatrixOffd(AFF)), - hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(AFF)), - rsFC, - dlam, - dtmp ); - - /* collect off-processor dtmp */ - hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(AFF); - hypre_ParCSRCommHandle *comm_handle; - if (!comm_pkg) - { - hypre_MatvecCommPkgCreate(AFF); - comm_pkg = hypre_ParCSRMatrixCommPkg(AFF); - } - dtmp_offd = hypre_TAlloc(HYPRE_Complex, hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(AFF)), HYPRE_MEMORY_DEVICE); - HYPRE_Int num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - HYPRE_Int num_elmts_send = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends); - HYPRE_Complex *send_buf = hypre_TAlloc(HYPRE_Complex, num_elmts_send, HYPRE_MEMORY_DEVICE); - hypre_ParCSRCommPkgCopySendMapElmtsToDevice(comm_pkg); - HYPRE_THRUST_CALL( gather, - hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), - hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + num_elmts_send, - dtmp, - send_buf ); - comm_handle = hypre_ParCSRCommHandleCreate_v2(1, comm_pkg, HYPRE_MEMORY_DEVICE, send_buf, HYPRE_MEMORY_DEVICE, dtmp_offd); - hypre_ParCSRCommHandleDestroy(comm_handle); - hypre_TFree(send_buf, HYPRE_MEMORY_DEVICE); - hypre_GpuProfilingPopRange(); +#else + HYPRE_Complex *new_end = HYPRE_THRUST_CALL( copy_if, + rsWA, + rsWA + A_nr_of_rows, + CF_marker, + rsW, + is_negative() ); +#endif + hypre_assert(new_end - rsW == W_nr_of_rows); + hypre_TFree(rsWA, HYPRE_MEMORY_DEVICE); + + /* row sum of AFC, i.e., D_beta */ + rsFC = hypre_TAlloc(HYPRE_Complex, W_nr_of_rows, HYPRE_MEMORY_DEVICE); + hypre_CSRMatrixComputeRowSumDevice(hypre_ParCSRMatrixDiag(AFC), NULL, NULL, rsFC, 0, 1.0, "set"); + hypre_CSRMatrixComputeRowSumDevice(hypre_ParCSRMatrixOffd(AFC), NULL, NULL, rsFC, 0, 1.0, "add"); - /* 4. Form D_tau */ /* 5. Form matrix ~{A_FF}, (return twAFF in AFF data structure ) */ /* 6. Form matrix ~{A_FC}, (return twAFC in AFC data structure) */ hypre_GpuProfilingPushRange("Compute interp matrix"); - gDim = hypre_GetDefaultCUDAGridDimension(W_nr_of_rows, "warp", bDim); - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_compute_aff_afc_epe, - gDim, bDim, - W_nr_of_rows, - hypre_CSRMatrixI(hypre_ParCSRMatrixDiag(AFF)), - hypre_CSRMatrixJ(hypre_ParCSRMatrixDiag(AFF)), - hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(AFF)), - hypre_CSRMatrixI(hypre_ParCSRMatrixOffd(AFF)), - hypre_CSRMatrixJ(hypre_ParCSRMatrixOffd(AFF)), - hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(AFF)), - hypre_CSRMatrixI(hypre_ParCSRMatrixDiag(AFC)), - hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(AFC)), - hypre_CSRMatrixI(hypre_ParCSRMatrixOffd(AFC)), - hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(AFC)), - rsW, - dlam, - dtmp, - dtmp_offd ); + gDim = hypre_GetDefaultDeviceGridDimension(W_nr_of_rows, "warp", bDim); + HYPRE_Int *AFF_diag_i = hypre_CSRMatrixI(hypre_ParCSRMatrixDiag(AFF)); + HYPRE_Int *AFF_diag_j = hypre_CSRMatrixJ(hypre_ParCSRMatrixDiag(AFF)); + HYPRE_Complex *AFF_diag_a = hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(AFF)); + HYPRE_Int *AFF_offd_i = hypre_CSRMatrixI(hypre_ParCSRMatrixOffd(AFF)); + HYPRE_Complex *AFF_offd_a = hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(AFF)); + HYPRE_Int *AFC_diag_i = hypre_CSRMatrixI(hypre_ParCSRMatrixDiag(AFC)); + HYPRE_Complex *AFC_diag_a = hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(AFC)); + HYPRE_Int *AFC_offd_i = hypre_CSRMatrixI(hypre_ParCSRMatrixOffd(AFC)); + HYPRE_Complex *AFC_offd_a = hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(AFC)); + HYPRE_GPU_LAUNCH( hypreGPUKernel_compute_aff_afc, + gDim, bDim, + W_nr_of_rows, + AFF_diag_i, + AFF_diag_j, + AFF_diag_a, + AFF_offd_i, + AFF_offd_a, + AFC_diag_i, + AFC_diag_a, + AFC_offd_i, + AFC_offd_a, + rsW, + rsFC ); hypre_TFree(rsW, HYPRE_MEMORY_DEVICE); hypre_TFree(rsFC, HYPRE_MEMORY_DEVICE); - hypre_TFree(dlam, HYPRE_MEMORY_DEVICE); - hypre_TFree(dtmp, HYPRE_MEMORY_DEVICE); - hypre_TFree(dtmp_offd, HYPRE_MEMORY_DEVICE); hypre_GpuProfilingPopRange(); /* 7. Perform matrix-matrix multiplication */ @@ -599,12 +921,11 @@ hypre_BoomerAMGBuildExtPEInterpDevice(hypre_ParCSRMatrix *A, P_diag_nnz = hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixDiag(W)) + hypre_ParCSRMatrixNumCols(W); - P_diag_i = hypre_TAlloc(HYPRE_Int, A_nr_of_rows+1, HYPRE_MEMORY_DEVICE); + P_diag_i = hypre_TAlloc(HYPRE_Int, A_nr_of_rows + 1, HYPRE_MEMORY_DEVICE); P_diag_j = hypre_TAlloc(HYPRE_Int, P_diag_nnz, HYPRE_MEMORY_DEVICE); P_diag_data = hypre_TAlloc(HYPRE_Complex, P_diag_nnz, HYPRE_MEMORY_DEVICE); - P_offd_i = hypre_TAlloc(HYPRE_Int, A_nr_of_rows+1, HYPRE_MEMORY_DEVICE); + P_offd_i = hypre_TAlloc(HYPRE_Int, A_nr_of_rows + 1, HYPRE_MEMORY_DEVICE); - hypre_GpuProfilingPushRange("Extend matrix"); hypreDevice_extendWtoP( A_nr_of_rows, W_nr_of_rows, hypre_ParCSRMatrixNumCols(W), @@ -618,7 +939,6 @@ hypre_BoomerAMGBuildExtPEInterpDevice(hypre_ParCSRMatrix *A, P_diag_data, hypre_CSRMatrixI(hypre_ParCSRMatrixOffd(W)), P_offd_i ); - hypre_GpuProfilingPopRange(); // final P P = hypre_ParCSRMatrixCreate(hypre_ParCSRMatrixComm(A), @@ -655,13 +975,18 @@ hypre_BoomerAMGBuildExtPEInterpDevice(hypre_ParCSRMatrix *A, hypre_GpuProfilingPushRange("Truncation"); if (trunc_factor != 0.0 || max_elmts > 0) { - hypre_BoomerAMGInterpTruncationDevice(P, trunc_factor, max_elmts ); + hypre_BoomerAMGInterpTruncationDevice(P, trunc_factor, max_elmts); + hypre_ParCSRMatrixCompressOffdMapDevice(P); } hypre_GpuProfilingPopRange(); hypre_MatvecCommPkgCreate(P); - HYPRE_THRUST_CALL( replace_if, CF_marker, CF_marker + A_nr_of_rows, equal(-3), -1); +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::replace_if, CF_marker, CF_marker + A_nr_of_rows, equal(-3), -1); +#else + HYPRE_THRUST_CALL( replace_if, CF_marker, CF_marker + A_nr_of_rows, equal(-3), -1); +#endif *P_ptr = P; @@ -671,723 +996,559 @@ hypre_BoomerAMGBuildExtPEInterpDevice(hypre_ParCSRMatrix *A, return hypre_error_flag; } -//----------------------------------------------------------------------- -// S_*_j is the special j-array from device SoC -// -1: weak, -2: diag, >=0 (== A_diag_j) : strong -// add weak and the diagonal entries of F-rows -__global__ -void hypreCUDAKernel_compute_weak_rowsums( HYPRE_Int nr_of_rows, - bool has_offd, - HYPRE_Int *CF_marker, - HYPRE_Int *A_diag_i, - HYPRE_Complex *A_diag_a, - HYPRE_Int *Soc_diag_j, - HYPRE_Int *A_offd_i, - HYPRE_Complex *A_offd_a, - HYPRE_Int *Soc_offd_j, - HYPRE_Real *rs, - HYPRE_Int flag) -{ - HYPRE_Int row = hypre_cuda_get_grid_warp_id<1,1>(); - - if (row >= nr_of_rows) - { - return; - } - - HYPRE_Int lane = hypre_cuda_get_lane_id<1>(); - HYPRE_Int ib, ie; - - if (lane == 0) - { - ib = read_only_load(CF_marker + row); - } - ib = __shfl_sync(HYPRE_WARP_FULL_MASK, ib, 0); - - if (ib >= flag) - { - return; - } - - if (lane < 2) - { - ib = read_only_load(A_diag_i + row + lane); - } - ie = __shfl_sync(HYPRE_WARP_FULL_MASK, ib, 1); - ib = __shfl_sync(HYPRE_WARP_FULL_MASK, ib, 0); - - HYPRE_Complex rl = 0.0; - - for (HYPRE_Int i = ib + lane; __any_sync(HYPRE_WARP_FULL_MASK, i < ie); i += HYPRE_WARP_SIZE) - { - if (i < ie) - { - rl += read_only_load(&A_diag_a[i]) * (read_only_load(&Soc_diag_j[i]) < 0); - } - } - - if (has_offd) - { - if (lane < 2) - { - ib = read_only_load(A_offd_i + row + lane); - } - ie = __shfl_sync(HYPRE_WARP_FULL_MASK, ib, 1); - ib = __shfl_sync(HYPRE_WARP_FULL_MASK, ib, 0); - - for (HYPRE_Int i = ib + lane; __any_sync(HYPRE_WARP_FULL_MASK, i < ie); i += HYPRE_WARP_SIZE) - { - if (i < ie) - { - rl += read_only_load(&A_offd_a[i]) * (read_only_load(&Soc_offd_j[i]) < 0); - } - } - } - - rl = warp_reduce_sum(rl); - - if (lane == 0) - { - rs[row] = rl; - } -} - -//----------------------------------------------------------------------- -__global__ -void hypreCUDAKernel_compute_aff_afc( HYPRE_Int nr_of_rows, - HYPRE_Int *AFF_diag_i, - HYPRE_Int *AFF_diag_j, - HYPRE_Complex *AFF_diag_data, - HYPRE_Int *AFF_offd_i, - HYPRE_Complex *AFF_offd_data, - HYPRE_Int *AFC_diag_i, - HYPRE_Complex *AFC_diag_data, - HYPRE_Int *AFC_offd_i, - HYPRE_Complex *AFC_offd_data, - HYPRE_Complex *rsW, - HYPRE_Complex *rsFC ) -{ - HYPRE_Int row = hypre_cuda_get_grid_warp_id<1,1>(); - - if (row >= nr_of_rows) - { - return; - } - - HYPRE_Int lane = hypre_cuda_get_lane_id<1>(); - HYPRE_Int p, q; - - HYPRE_Complex iscale, beta; - - if (lane == 0) - { - iscale = -1.0 / read_only_load(&rsW[row]); - beta = read_only_load(&rsFC[row]); - } - iscale = __shfl_sync(HYPRE_WARP_FULL_MASK, iscale, 0); - beta = __shfl_sync(HYPRE_WARP_FULL_MASK, beta, 0); - - // AFF - /* Diag part */ - if (lane < 2) - { - p = read_only_load(AFF_diag_i + row + lane); - } - q = __shfl_sync(HYPRE_WARP_FULL_MASK, p, 1); - p = __shfl_sync(HYPRE_WARP_FULL_MASK, p, 0); - - // do not assume diag is the first element of row - for (HYPRE_Int j = p + lane; __any_sync(HYPRE_WARP_FULL_MASK, j < q); j += HYPRE_WARP_SIZE) - { - if (j < q) - { - if (read_only_load(&AFF_diag_j[j]) == row) - { - AFF_diag_data[j] = beta * iscale; - } - else - { - AFF_diag_data[j] *= iscale; - } - } - } - - /* offd part */ - if (lane < 2) - { - p = read_only_load(AFF_offd_i + row + lane); - } - q = __shfl_sync(HYPRE_WARP_FULL_MASK, p, 1); - p = __shfl_sync(HYPRE_WARP_FULL_MASK, p, 0); - - for (HYPRE_Int j = p + lane; __any_sync(HYPRE_WARP_FULL_MASK, j < q); j += HYPRE_WARP_SIZE) - { - if (j < q) - { - AFF_offd_data[j] *= iscale; - } - } - - if (beta != 0.0) - { - beta = 1.0 / beta; - } - - // AFC - if (lane < 2) - { - p = read_only_load(AFC_diag_i + row + lane); - } - q = __shfl_sync(HYPRE_WARP_FULL_MASK, p, 1); - p = __shfl_sync(HYPRE_WARP_FULL_MASK, p, 0); - - /* Diag part */ - for (HYPRE_Int j = p + lane; __any_sync(HYPRE_WARP_FULL_MASK, j < q); j += HYPRE_WARP_SIZE) - { - if (j < q) - { - AFC_diag_data[j] *= beta; - } - } - - /* offd part */ - if (lane < 2) - { - p = read_only_load(AFC_offd_i + row + lane); - } - q = __shfl_sync(HYPRE_WARP_FULL_MASK, p, 1); - p = __shfl_sync(HYPRE_WARP_FULL_MASK, p, 0); - - for (HYPRE_Int j = p + lane; __any_sync(HYPRE_WARP_FULL_MASK, j < q); j += HYPRE_WARP_SIZE) - { - if (j < q) - { - AFC_offd_data[j] *= beta; - } - } -} - - -//----------------------------------------------------------------------- -void -hypreDevice_extendWtoP( HYPRE_Int P_nr_of_rows, - HYPRE_Int W_nr_of_rows, - HYPRE_Int W_nr_of_cols, - HYPRE_Int *CF_marker, - HYPRE_Int W_diag_nnz, - HYPRE_Int *W_diag_i, - HYPRE_Int *W_diag_j, - HYPRE_Complex *W_diag_data, - HYPRE_Int *P_diag_i, - HYPRE_Int *P_diag_j, - HYPRE_Complex *P_diag_data, - HYPRE_Int *W_offd_i, - HYPRE_Int *P_offd_i ) +/*-----------------------------------------------------------------------*/ +HYPRE_Int +hypre_BoomerAMGBuildExtPIInterpDevice( hypre_ParCSRMatrix *A, + HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, + HYPRE_BigInt *num_cpts_global, + HYPRE_Int num_functions, + HYPRE_Int *dof_func, + HYPRE_Int debug_flag, + HYPRE_Real trunc_factor, + HYPRE_Int max_elmts, + hypre_ParCSRMatrix **P_ptr) { - // row index shift P --> W - HYPRE_Int *PWoffset = hypre_TAlloc(HYPRE_Int, P_nr_of_rows + 1, HYPRE_MEMORY_DEVICE); - HYPRE_THRUST_CALL( transform, - CF_marker, - &CF_marker[P_nr_of_rows], - PWoffset, - is_nonnegative() ); - - HYPRE_THRUST_CALL( exclusive_scan, - PWoffset, - &PWoffset[P_nr_of_rows+1], - PWoffset); - - // map F+C to (next) F - HYPRE_Int *map2F = hypre_TAlloc(HYPRE_Int, P_nr_of_rows + 1, HYPRE_MEMORY_DEVICE); - HYPRE_THRUST_CALL( transform, - thrust::counting_iterator(0), - thrust::counting_iterator(P_nr_of_rows + 1), - PWoffset, - map2F, - thrust::minus() ); - - // P_diag_i - HYPRE_THRUST_CALL( gather, - map2F, - map2F + P_nr_of_rows + 1, - W_diag_i, - P_diag_i ); - - HYPRE_THRUST_CALL( transform, - P_diag_i, - P_diag_i + P_nr_of_rows + 1, - PWoffset, - P_diag_i, - thrust::plus() ); - - // P_offd_i - HYPRE_THRUST_CALL( gather, - map2F, - map2F + P_nr_of_rows + 1, - W_offd_i, - P_offd_i ); - - hypre_TFree(map2F, HYPRE_MEMORY_DEVICE); - - // row index shift W --> P - HYPRE_Int *WPoffset = hypre_TAlloc(HYPRE_Int, W_nr_of_rows, HYPRE_MEMORY_DEVICE); - HYPRE_Int *new_end = HYPRE_THRUST_CALL( copy_if, - PWoffset, - PWoffset + P_nr_of_rows, - CF_marker, - WPoffset, - is_negative() ); - hypre_assert(new_end - WPoffset == W_nr_of_rows); - - hypre_TFree(PWoffset, HYPRE_MEMORY_DEVICE); - - // elements shift - HYPRE_Int *shift = hypreDevice_CsrRowPtrsToIndices(W_nr_of_rows, W_diag_nnz, W_diag_i); - HYPRE_THRUST_CALL( gather, - shift, - shift + W_diag_nnz, - WPoffset, - shift); - - hypre_TFree(WPoffset, HYPRE_MEMORY_DEVICE); + HYPRE_UNUSED_VAR(num_cpts_global); + HYPRE_UNUSED_VAR(num_functions); + HYPRE_UNUSED_VAR(dof_func); + HYPRE_UNUSED_VAR(debug_flag); - HYPRE_THRUST_CALL( transform, - shift, - shift + W_diag_nnz, - thrust::counting_iterator(0), - shift, - thrust::plus() ); + HYPRE_Int A_nr_of_rows = hypre_ParCSRMatrixNumRows(A); + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + HYPRE_Complex *A_diag_data = hypre_CSRMatrixData(A_diag); + HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); + HYPRE_Complex *A_offd_data = hypre_CSRMatrixData(A_offd); + HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); + HYPRE_Int A_offd_nnz = hypre_CSRMatrixNumNonzeros(A_offd); + hypre_CSRMatrix *AFF_ext = NULL; + hypre_ParCSRMatrix *AFF, *AFC; + hypre_ParCSRMatrix *W, *P; + HYPRE_Int W_nr_of_rows, P_diag_nnz; + HYPRE_Complex *rsFC, *rsFC_offd, *rsWA, *rsW; + HYPRE_Int *P_diag_i, *P_diag_j, *P_offd_i, num_procs; + HYPRE_Complex *P_diag_data; - // P_diag_j and P_diag_data - HYPRE_THRUST_CALL( scatter, - thrust::make_zip_iterator(thrust::make_tuple(W_diag_j, W_diag_data)), - thrust::make_zip_iterator(thrust::make_tuple(W_diag_j, W_diag_data)) + W_diag_nnz, - shift, - thrust::make_zip_iterator(thrust::make_tuple(P_diag_j, P_diag_data)) ); + hypre_BoomerAMGMakeSocFromSDevice(A, S); - hypre_TFree(shift, HYPRE_MEMORY_DEVICE); + HYPRE_Int *Soc_diag_j = hypre_ParCSRMatrixSocDiagJ(S); + HYPRE_Int *Soc_offd_j = hypre_ParCSRMatrixSocOffdJ(S); - // fill the gap - HYPRE_Int *PC_i = hypre_TAlloc(HYPRE_Int, W_nr_of_cols, HYPRE_MEMORY_DEVICE); - new_end = HYPRE_THRUST_CALL( copy_if, - P_diag_i, - P_diag_i + P_nr_of_rows, - CF_marker, - PC_i, - is_nonnegative() ); + hypre_MPI_Comm_size(hypre_ParCSRMatrixComm(A), &num_procs); - hypre_assert(new_end - PC_i == W_nr_of_cols); + /* 0.Find row sums of weak elements */ + /* row sum of A-weak + Diag(A), i.e., (D_gamma + D_alpha) in the notes, only for F-pts */ + rsWA = hypre_TAlloc(HYPRE_Complex, A_nr_of_rows, HYPRE_MEMORY_DEVICE); - HYPRE_THRUST_CALL( scatter, - thrust::counting_iterator(0), - thrust::counting_iterator(W_nr_of_cols), - PC_i, - P_diag_j ); + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(A_nr_of_rows, "warp", bDim); + + HYPRE_GPU_LAUNCH( hypreGPUKernel_compute_weak_rowsums, + gDim, bDim, + A_nr_of_rows, + A_offd_nnz > 0, + CF_marker, + A_diag_i, + A_diag_data, + Soc_diag_j, + A_offd_i, + A_offd_data, + Soc_offd_j, + rsWA, + 0 ); - hypreDevice_ScatterConstant(P_diag_data, W_nr_of_cols, PC_i, 1.0); + // AFF AFC + hypre_GpuProfilingPushRange("Extract Submatrix"); + hypre_ParCSRMatrixGenerateFFFCDevice(A, CF_marker, num_cpts_global, S, &AFC, &AFF); + hypre_GpuProfilingPopRange(); - hypre_TFree(PC_i, HYPRE_MEMORY_DEVICE); -} + W_nr_of_rows = hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(AFF)); + hypre_assert(A_nr_of_rows == W_nr_of_rows + hypre_ParCSRMatrixNumCols(AFC)); + rsW = hypre_TAlloc(HYPRE_Complex, W_nr_of_rows, HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_SYCL) + HYPRE_Complex *new_end = hypreSycl_copy_if( rsWA, + rsWA + A_nr_of_rows, + CF_marker, + rsW, + is_negative() ); +#else + HYPRE_Complex *new_end = HYPRE_THRUST_CALL( copy_if, + rsWA, + rsWA + A_nr_of_rows, + CF_marker, + rsW, + is_negative() ); +#endif + hypre_assert(new_end - rsW == W_nr_of_rows); + hypre_TFree(rsWA, HYPRE_MEMORY_DEVICE); -//----------------------------------------------------------------------- -// For Ext+i Interp, scale AFF from the left and the right -__global__ -void hypreCUDAKernel_compute_twiaff_w( HYPRE_Int nr_of_rows, - HYPRE_BigInt first_index, - HYPRE_Int *AFF_diag_i, - HYPRE_Int *AFF_diag_j, - HYPRE_Complex *AFF_diag_data, - HYPRE_Complex *AFF_diag_data_old, - HYPRE_Int *AFF_offd_i, - HYPRE_Int *AFF_offd_j, - HYPRE_Complex *AFF_offd_data, - HYPRE_Int *AFF_ext_i, - HYPRE_BigInt *AFF_ext_j, - HYPRE_Complex *AFF_ext_data, - HYPRE_Complex *rsW, - HYPRE_Complex *rsFC, - HYPRE_Complex *rsFC_offd ) -{ - HYPRE_Int row = hypre_cuda_get_grid_warp_id<1,1>(); + /* row sum of AFC, i.e., D_beta */ + rsFC = hypre_TAlloc(HYPRE_Complex, W_nr_of_rows, HYPRE_MEMORY_DEVICE); + hypre_CSRMatrixComputeRowSumDevice(hypre_ParCSRMatrixDiag(AFC), NULL, NULL, rsFC, 0, 1.0, "set"); + hypre_CSRMatrixComputeRowSumDevice(hypre_ParCSRMatrixOffd(AFC), NULL, NULL, rsFC, 0, 1.0, "add"); - if (row >= nr_of_rows) + /* collect off-processor rsFC */ + hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(AFF); + hypre_ParCSRCommHandle *comm_handle; + if (!comm_pkg) { - return; + hypre_MatvecCommPkgCreate(AFF); + comm_pkg = hypre_ParCSRMatrixCommPkg(AFF); } + rsFC_offd = hypre_TAlloc(HYPRE_Complex, hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(AFF)), + HYPRE_MEMORY_DEVICE); + HYPRE_Int num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); + HYPRE_Int num_elmts_send = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends); + HYPRE_Complex *send_buf = hypre_TAlloc(HYPRE_Complex, num_elmts_send, HYPRE_MEMORY_DEVICE); + hypre_ParCSRCommPkgCopySendMapElmtsToDevice(comm_pkg); +#if defined(HYPRE_USING_SYCL) + hypreSycl_gather( hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + num_elmts_send, + rsFC, + send_buf ); +#else + HYPRE_THRUST_CALL( gather, + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + num_elmts_send, + rsFC, + send_buf ); +#endif - HYPRE_Int lane = hypre_cuda_get_lane_id<1>(); +#if defined(HYPRE_USING_THRUST_NOSYNC) + /* RL: make sure send_buf is ready before issuing GPU-GPU MPI */ + if (hypre_GetGpuAwareMPI()) + { + hypre_ForceSyncComputeStream(); + } +#endif - HYPRE_Int ib_diag, ie_diag, ib_offd, ie_offd; + comm_handle = hypre_ParCSRCommHandleCreate_v2(1, comm_pkg, HYPRE_MEMORY_DEVICE, send_buf, + HYPRE_MEMORY_DEVICE, rsFC_offd); + hypre_ParCSRCommHandleDestroy(comm_handle); + hypre_TFree(send_buf, HYPRE_MEMORY_DEVICE); - // diag - if (lane < 2) + /* offd rows of AFF */ + if (num_procs > 1) { - ib_diag = read_only_load(AFF_diag_i + row + lane); + AFF_ext = hypre_ParCSRMatrixExtractBExtDevice(AFF, AFF, 1); } - ie_diag = __shfl_sync(HYPRE_WARP_FULL_MASK, ib_diag, 1); - ib_diag = __shfl_sync(HYPRE_WARP_FULL_MASK, ib_diag, 0); - HYPRE_Complex theta_i = 0.0; + /* 5. Form matrix ~{A_FF}, (return twAFF in AFF data structure ) */ + HYPRE_Complex *AFF_diag_data_old = hypre_TAlloc(HYPRE_Complex, + hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixDiag(AFF)), + HYPRE_MEMORY_DEVICE); + hypre_TMemcpy( AFF_diag_data_old, + hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(AFF)), + HYPRE_Complex, + hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixDiag(AFF)), + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); - // do not assume diag is the first element of row - // entire warp works on each j - for (HYPRE_Int indj = ib_diag; indj < ie_diag; indj++) + hypre_GpuProfilingPushRange("Compute interp matrix"); + gDim = hypre_GetDefaultDeviceGridDimension(W_nr_of_rows, "warp", bDim); + HYPRE_BigInt AFF_first_row_idx = hypre_ParCSRMatrixFirstRowIndex(AFF); + HYPRE_Int *AFF_diag_i = hypre_CSRMatrixI(hypre_ParCSRMatrixDiag(AFF)); + HYPRE_Int *AFF_diag_j = hypre_CSRMatrixJ(hypre_ParCSRMatrixDiag(AFF)); + HYPRE_Complex *AFF_diag_a = hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(AFF)); + HYPRE_Int *AFF_offd_i = hypre_CSRMatrixI(hypre_ParCSRMatrixOffd(AFF)); + HYPRE_Int *AFF_offd_j = hypre_CSRMatrixJ(hypre_ParCSRMatrixOffd(AFF)); + HYPRE_Complex *AFF_offd_a = hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(AFF)); + HYPRE_Int *AFF_ext_i = NULL; + HYPRE_BigInt *AFF_ext_bigj = NULL; + HYPRE_Complex *AFF_ext_a = NULL; + if (AFF_ext) { - HYPRE_Int j; + AFF_ext_i = hypre_CSRMatrixI(AFF_ext); + AFF_ext_bigj = hypre_CSRMatrixBigJ(AFF_ext); + AFF_ext_a = hypre_CSRMatrixData(AFF_ext); + } + HYPRE_GPU_LAUNCH( hypreGPUKernel_compute_twiaff_w, + gDim, bDim, + W_nr_of_rows, + AFF_first_row_idx, + AFF_diag_i, + AFF_diag_j, + AFF_diag_a, + AFF_diag_data_old, + AFF_offd_i, + AFF_offd_j, + AFF_offd_a, + AFF_ext_i, + AFF_ext_bigj, + AFF_ext_a, + rsW, + rsFC, + rsFC_offd ); + hypre_TFree(rsW, HYPRE_MEMORY_DEVICE); + hypre_TFree(rsFC, HYPRE_MEMORY_DEVICE); + hypre_TFree(rsFC_offd, HYPRE_MEMORY_DEVICE); + hypre_TFree(AFF_diag_data_old, HYPRE_MEMORY_DEVICE); + hypre_CSRMatrixDestroy(AFF_ext); + hypre_GpuProfilingPopRange(); - if (lane == 0) - { - j = read_only_load(&AFF_diag_j[indj]); - } - j = __shfl_sync(HYPRE_WARP_FULL_MASK, j, 0); + /* 7. Perform matrix-matrix multiplication */ + hypre_GpuProfilingPushRange("Matrix-matrix mult"); + W = hypre_ParCSRMatMatDevice(AFF, AFC); + hypre_GpuProfilingPopRange(); - if (j == row) - { - if (lane == 0) - { - AFF_diag_data[indj] = 1.0; - } + hypre_ParCSRMatrixDestroy(AFF); + hypre_ParCSRMatrixDestroy(AFC); - continue; - } + /* 8. Construct P from matrix product W */ + P_diag_nnz = hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixDiag(W)) + + hypre_ParCSRMatrixNumCols(W); - HYPRE_Int kb, ke; + P_diag_i = hypre_TAlloc(HYPRE_Int, A_nr_of_rows + 1, HYPRE_MEMORY_DEVICE); + P_diag_j = hypre_TAlloc(HYPRE_Int, P_diag_nnz, HYPRE_MEMORY_DEVICE); + P_diag_data = hypre_TAlloc(HYPRE_Complex, P_diag_nnz, HYPRE_MEMORY_DEVICE); + P_offd_i = hypre_TAlloc(HYPRE_Int, A_nr_of_rows + 1, HYPRE_MEMORY_DEVICE); - // find if there exists entry (j, row) in row j of diag - if (lane < 2) - { - kb = read_only_load(AFF_diag_i + j + lane); - } - ke = __shfl_sync(HYPRE_WARP_FULL_MASK, kb, 1); - kb = __shfl_sync(HYPRE_WARP_FULL_MASK, kb, 0); + hypreDevice_extendWtoP( A_nr_of_rows, + W_nr_of_rows, + hypre_ParCSRMatrixNumCols(W), + CF_marker, + hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixDiag(W)), + hypre_CSRMatrixI(hypre_ParCSRMatrixDiag(W)), + hypre_CSRMatrixJ(hypre_ParCSRMatrixDiag(W)), + hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(W)), + P_diag_i, + P_diag_j, + P_diag_data, + hypre_CSRMatrixI(hypre_ParCSRMatrixOffd(W)), + P_offd_i ); - HYPRE_Int kmatch = -1; - for (HYPRE_Int indk = kb + lane; __any_sync(HYPRE_WARP_FULL_MASK, indk < ke); indk += HYPRE_WARP_SIZE) - { - if (indk < ke && row == read_only_load(&AFF_diag_j[indk])) - { - kmatch = indk; - } + // final P + P = hypre_ParCSRMatrixCreate(hypre_ParCSRMatrixComm(A), + hypre_ParCSRMatrixGlobalNumRows(A), + hypre_ParCSRMatrixGlobalNumCols(W), + hypre_ParCSRMatrixColStarts(A), + hypre_ParCSRMatrixColStarts(W), + hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(W)), + P_diag_nnz, + hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixOffd(W))); - if (__any_sync(HYPRE_WARP_FULL_MASK, kmatch >= 0)) - { - break; - } - } - kmatch = warp_reduce_max(kmatch); + hypre_CSRMatrixI(hypre_ParCSRMatrixDiag(P)) = P_diag_i; + hypre_CSRMatrixJ(hypre_ParCSRMatrixDiag(P)) = P_diag_j; + hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(P)) = P_diag_data; - if (lane == 0) - { - HYPRE_Complex vji = kmatch >= 0 ? read_only_load(&AFF_diag_data_old[kmatch]) : 0.0; - HYPRE_Complex rsj = read_only_load(&rsFC[j]) + vji; - if (rsj) - { - HYPRE_Complex vij = read_only_load(&AFF_diag_data_old[indj]) / rsj; - AFF_diag_data[indj] = vij; - theta_i += vji * vij; - } - else - { - AFF_diag_data[indj] = 0.0; - theta_i += read_only_load(&AFF_diag_data_old[indj]); - } - } - } + hypre_CSRMatrixI(hypre_ParCSRMatrixOffd(P)) = P_offd_i; + hypre_CSRMatrixJ(hypre_ParCSRMatrixOffd(P)) = hypre_CSRMatrixJ(hypre_ParCSRMatrixOffd(W)); + hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(P)) = hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(W)); + hypre_CSRMatrixJ(hypre_ParCSRMatrixOffd(W)) = NULL; + hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(W)) = NULL; - // offd - if (lane < 2) - { - ib_offd = read_only_load(AFF_offd_i + row + lane); - } - ie_offd = __shfl_sync(HYPRE_WARP_FULL_MASK, ib_offd, 1); - ib_offd = __shfl_sync(HYPRE_WARP_FULL_MASK, ib_offd, 0); + hypre_CSRMatrixMemoryLocation(hypre_ParCSRMatrixDiag(P)) = HYPRE_MEMORY_DEVICE; + hypre_CSRMatrixMemoryLocation(hypre_ParCSRMatrixOffd(P)) = HYPRE_MEMORY_DEVICE; - for (HYPRE_Int indj = ib_offd; indj < ie_offd; indj++) + hypre_ParCSRMatrixDeviceColMapOffd(P) = hypre_ParCSRMatrixDeviceColMapOffd(W); + hypre_ParCSRMatrixColMapOffd(P) = hypre_ParCSRMatrixColMapOffd(W); + hypre_ParCSRMatrixDeviceColMapOffd(W) = NULL; + hypre_ParCSRMatrixColMapOffd(W) = NULL; + + hypre_ParCSRMatrixNumNonzeros(P) = hypre_ParCSRMatrixNumNonzeros(W) + + hypre_ParCSRMatrixGlobalNumCols(W); + hypre_ParCSRMatrixDNumNonzeros(P) = (HYPRE_Real) hypre_ParCSRMatrixNumNonzeros(P); + + hypre_GpuProfilingPushRange("Truncation"); + if (trunc_factor != 0.0 || max_elmts > 0) { - HYPRE_Int j; + hypre_BoomerAMGInterpTruncationDevice(P, trunc_factor, max_elmts); + hypre_ParCSRMatrixCompressOffdMapDevice(P); + } + hypre_GpuProfilingPopRange(); - if (lane == 0) - { - j = read_only_load(&AFF_offd_j[indj]); - } - j = __shfl_sync(HYPRE_WARP_FULL_MASK, j, 0); + hypre_MatvecCommPkgCreate(P); - HYPRE_Int kb, ke; +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::replace_if, CF_marker, CF_marker + A_nr_of_rows, equal(-3), -1); +#else + HYPRE_THRUST_CALL( replace_if, CF_marker, CF_marker + A_nr_of_rows, equal(-3), -1); +#endif - if (lane < 2) - { - kb = read_only_load(AFF_ext_i + j + lane); - } - ke = __shfl_sync(HYPRE_WARP_FULL_MASK, kb, 1); - kb = __shfl_sync(HYPRE_WARP_FULL_MASK, kb, 0); + *P_ptr = P; - HYPRE_Int kmatch = -1; - for (HYPRE_Int indk = kb + lane; __any_sync(HYPRE_WARP_FULL_MASK, indk < ke); indk += HYPRE_WARP_SIZE) - { - if (indk < ke && row + first_index == read_only_load(&AFF_ext_j[indk])) - { - kmatch = indk; - } + /* 9. Free memory */ + hypre_ParCSRMatrixDestroy(W); - if (__any_sync(HYPRE_WARP_FULL_MASK, kmatch >= 0)) - { - break; - } - } - kmatch = warp_reduce_max(kmatch); + return hypre_error_flag; +} - if (lane == 0) - { - HYPRE_Complex vji = kmatch >= 0 ? read_only_load(&AFF_ext_data[kmatch]) : 0.0; - HYPRE_Complex rsj = read_only_load(&rsFC_offd[j]) + vji; - if (rsj) - { - HYPRE_Complex vij = read_only_load(&AFF_offd_data[indj]) / rsj; - AFF_offd_data[indj] = vij; - theta_i += vji * vij; - } - else - { - AFF_offd_data[indj] = 0.0; - theta_i += read_only_load(&AFF_offd_data[indj]); - } - } - } +/*--------------------------------------------------------------------- + * Extended+e Interpolation in the form of Mat-Mat + *---------------------------------------------------------------------*/ +HYPRE_Int +hypre_BoomerAMGBuildExtPEInterpDevice(hypre_ParCSRMatrix *A, + HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, + HYPRE_BigInt *num_cpts_global, + HYPRE_Int num_functions, + HYPRE_Int *dof_func, + HYPRE_Int debug_flag, + HYPRE_Real trunc_factor, + HYPRE_Int max_elmts, + hypre_ParCSRMatrix **P_ptr) +{ + HYPRE_UNUSED_VAR(num_cpts_global); + HYPRE_UNUSED_VAR(num_functions); + HYPRE_UNUSED_VAR(dof_func); + HYPRE_UNUSED_VAR(debug_flag); - // scale row - if (lane == 0) - { - theta_i += read_only_load(rsW + row); - theta_i = theta_i ? -1.0 / theta_i : -1.0; - } - theta_i = __shfl_sync(HYPRE_WARP_FULL_MASK, theta_i, 0); + HYPRE_Int A_nr_of_rows = hypre_ParCSRMatrixNumRows(A); + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + HYPRE_Complex *A_diag_data = hypre_CSRMatrixData(A_diag); + HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); + HYPRE_Complex *A_offd_data = hypre_CSRMatrixData(A_offd); + HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); + HYPRE_Int A_offd_nnz = hypre_CSRMatrixNumNonzeros(A_offd); - for (HYPRE_Int j = ib_diag + lane; __any_sync(HYPRE_WARP_FULL_MASK, j < ie_diag); j += HYPRE_WARP_SIZE) - { - if (j < ie_diag) - { - AFF_diag_data[j] *= theta_i; - } - } + hypre_BoomerAMGMakeSocFromSDevice(A, S); - for (HYPRE_Int j = ib_offd + lane; __any_sync(HYPRE_WARP_FULL_MASK, j < ie_offd); j += HYPRE_WARP_SIZE) - { - if (j < ie_offd) - { - AFF_offd_data[j] *= theta_i; - } - } -} + HYPRE_Int *Soc_diag_j = hypre_ParCSRMatrixSocDiagJ(S); + HYPRE_Int *Soc_offd_j = hypre_ParCSRMatrixSocOffdJ(S); + hypre_ParCSRMatrix *AFF, *AFC; + hypre_ParCSRMatrix *W, *P; + HYPRE_Int W_nr_of_rows, P_diag_nnz; + HYPRE_Complex *dlam, *dtmp, *dtmp_offd, *rsFC, *rsWA, *rsW; + HYPRE_Int *P_diag_i, *P_diag_j, *P_offd_i; + HYPRE_Complex *P_diag_data; + /* 0. Find row sums of weak elements */ + /* row sum of A-weak + Diag(A), i.e., (D_gamma + D_FF) in the notes, only for F-pts */ + rsWA = hypre_TAlloc(HYPRE_Complex, A_nr_of_rows, HYPRE_MEMORY_DEVICE); -//----------------------------------------------------------------------- -__global__ -void hypreCUDAKernel_compute_aff_afc_epe( HYPRE_Int nr_of_rows, - HYPRE_Int *AFF_diag_i, - HYPRE_Int *AFF_diag_j, - HYPRE_Complex *AFF_diag_data, - HYPRE_Int *AFF_offd_i, - HYPRE_Int *AFF_offd_j, - HYPRE_Complex *AFF_offd_data, - HYPRE_Int *AFC_diag_i, - HYPRE_Complex *AFC_diag_data, - HYPRE_Int *AFC_offd_i, - HYPRE_Complex *AFC_offd_data, - HYPRE_Complex *rsW, - HYPRE_Complex *dlam, - HYPRE_Complex *dtmp, - HYPRE_Complex *dtmp_offd ) -{ - HYPRE_Int row = hypre_cuda_get_grid_warp_id<1,1>(); + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(A_nr_of_rows, "warp", bDim); + + HYPRE_GPU_LAUNCH( hypreGPUKernel_compute_weak_rowsums, + gDim, bDim, + A_nr_of_rows, + A_offd_nnz > 0, + CF_marker, + A_diag_i, + A_diag_data, + Soc_diag_j, + A_offd_i, + A_offd_data, + Soc_offd_j, + rsWA, + 0 ); - if (row >= nr_of_rows) - { - return; - } + // AFF AFC + hypre_GpuProfilingPushRange("Extract Submatrix"); + hypre_ParCSRMatrixGenerateFFFCDevice(A, CF_marker, num_cpts_global, S, &AFC, &AFF); + hypre_GpuProfilingPopRange(); - HYPRE_Int lane = hypre_cuda_get_lane_id<1>(); - HYPRE_Int pd, qd, po, qo, xd, yd, xo, yo; + W_nr_of_rows = hypre_ParCSRMatrixNumRows(AFF); + hypre_assert(A_nr_of_rows == W_nr_of_rows + hypre_ParCSRMatrixNumCols(AFC)); - HYPRE_Complex theta, value; - HYPRE_Complex dtau_i = 0.0; + rsW = hypre_TAlloc(HYPRE_Complex, W_nr_of_rows, HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_SYCL) + HYPRE_Complex *new_end = hypreSycl_copy_if( rsWA, + rsWA + A_nr_of_rows, + CF_marker, + rsW, + is_negative() ); +#else + HYPRE_Complex *new_end = HYPRE_THRUST_CALL( copy_if, + rsWA, + rsWA + A_nr_of_rows, + CF_marker, + rsW, + is_negative() ); +#endif + hypre_assert(new_end - rsW == W_nr_of_rows); + hypre_TFree(rsWA, HYPRE_MEMORY_DEVICE); - if (lane < 2) - { - pd = read_only_load(AFF_diag_i + row + lane); - po = read_only_load(AFF_offd_i + row + lane); - xd = read_only_load(AFC_diag_i + row + lane); - xo = read_only_load(AFC_offd_i + row + lane); - } + /* row sum of AFC, i.e., D_beta */ + rsFC = hypre_TAlloc(HYPRE_Complex, W_nr_of_rows, HYPRE_MEMORY_DEVICE); + hypre_CSRMatrixComputeRowSumDevice(hypre_ParCSRMatrixDiag(AFC), NULL, NULL, rsFC, 0, 1.0, "set"); + hypre_CSRMatrixComputeRowSumDevice(hypre_ParCSRMatrixOffd(AFC), NULL, NULL, rsFC, 0, 1.0, "add"); - qd = __shfl_sync(HYPRE_WARP_FULL_MASK, pd, 1); - pd = __shfl_sync(HYPRE_WARP_FULL_MASK, pd, 0); - qo = __shfl_sync(HYPRE_WARP_FULL_MASK, po, 1); - po = __shfl_sync(HYPRE_WARP_FULL_MASK, po, 0); - yd = __shfl_sync(HYPRE_WARP_FULL_MASK, xd, 1); - xd = __shfl_sync(HYPRE_WARP_FULL_MASK, xd, 0); - yo = __shfl_sync(HYPRE_WARP_FULL_MASK, xo, 1); - xo = __shfl_sync(HYPRE_WARP_FULL_MASK, xo, 0); + /* Generate D_lambda in the paper: D_beta + (row sum of AFF without diagonal elements / row_nnz) */ + /* Generate D_tmp, i.e., D_mu / D_lambda */ + dlam = hypre_TAlloc(HYPRE_Complex, W_nr_of_rows, HYPRE_MEMORY_DEVICE); + dtmp = hypre_TAlloc(HYPRE_Complex, W_nr_of_rows, HYPRE_MEMORY_DEVICE); + hypre_GpuProfilingPushRange("Compute D_tmp"); + gDim = hypre_GetDefaultDeviceGridDimension(W_nr_of_rows, "warp", bDim); + HYPRE_Int *AFF_diag_i = hypre_CSRMatrixI(hypre_ParCSRMatrixDiag(AFF)); + HYPRE_Int *AFF_diag_j = hypre_CSRMatrixJ(hypre_ParCSRMatrixDiag(AFF)); + HYPRE_Complex *AFF_diag_a = hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(AFF)); + HYPRE_Int *AFF_offd_i = hypre_CSRMatrixI(hypre_ParCSRMatrixOffd(AFF)); + HYPRE_Int *AFF_offd_j = hypre_CSRMatrixJ(hypre_ParCSRMatrixOffd(AFF)); + HYPRE_Complex *AFF_offd_a = hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(AFF)); + HYPRE_Int *AFC_diag_i = hypre_CSRMatrixI(hypre_ParCSRMatrixDiag(AFC)); + HYPRE_Complex *AFC_diag_a = hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(AFC)); + HYPRE_Int *AFC_offd_i = hypre_CSRMatrixI(hypre_ParCSRMatrixOffd(AFC)); + HYPRE_Complex *AFC_offd_a = hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(AFC)); + HYPRE_GPU_LAUNCH( hypreGPUKernel_compute_dlam_dtmp, + gDim, bDim, + W_nr_of_rows, + AFF_diag_i, + AFF_diag_j, + AFF_diag_a, + AFF_offd_i, + AFF_offd_a, + rsFC, + dlam, + dtmp ); - /* D_\tau */ - /* do not assume the first element is the diagonal */ - for (HYPRE_Int j = pd + lane; __any_sync(HYPRE_WARP_FULL_MASK, j < qd); j += HYPRE_WARP_SIZE) + /* collect off-processor dtmp */ + hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(AFF); + hypre_ParCSRCommHandle *comm_handle; + if (!comm_pkg) { - if (j < qd) - { - const HYPRE_Int index = read_only_load(&AFF_diag_j[j]); - if (index != row) - { - dtau_i += AFF_diag_data[j] * read_only_load(&dtmp[index]); - } - } + hypre_MatvecCommPkgCreate(AFF); + comm_pkg = hypre_ParCSRMatrixCommPkg(AFF); } + dtmp_offd = hypre_TAlloc(HYPRE_Complex, hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(AFF)), + HYPRE_MEMORY_DEVICE); + HYPRE_Int num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); + HYPRE_Int num_elmts_send = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends); + HYPRE_Complex *send_buf = hypre_TAlloc(HYPRE_Complex, num_elmts_send, HYPRE_MEMORY_DEVICE); + hypre_ParCSRCommPkgCopySendMapElmtsToDevice(comm_pkg); +#if defined(HYPRE_USING_SYCL) + hypreSycl_gather( hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + num_elmts_send, + dtmp, + send_buf ); +#else + HYPRE_THRUST_CALL( gather, + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + num_elmts_send, + dtmp, + send_buf ); +#endif - for (HYPRE_Int j = po + lane; __any_sync(HYPRE_WARP_FULL_MASK, j < qo); j += HYPRE_WARP_SIZE) +#if defined(HYPRE_USING_THRUST_NOSYNC) + /* RL: make sure send_buf is ready before issuing GPU-GPU MPI */ + if (hypre_GetGpuAwareMPI()) { - if (j < qo) - { - const HYPRE_Int index = read_only_load(&AFF_offd_j[j]); - dtau_i += AFF_offd_data[j] * read_only_load(&dtmp_offd[index]); - } + hypre_ForceSyncComputeStream(); } +#endif - dtau_i = warp_reduce_sum(dtau_i); - - if (lane == 0) - { - value = read_only_load(&rsW[row]) + dtau_i; - value = value != 0.0 ? -1.0 / value : 0.0; + comm_handle = hypre_ParCSRCommHandleCreate_v2(1, comm_pkg, HYPRE_MEMORY_DEVICE, send_buf, + HYPRE_MEMORY_DEVICE, dtmp_offd); + hypre_ParCSRCommHandleDestroy(comm_handle); + hypre_TFree(send_buf, HYPRE_MEMORY_DEVICE); + hypre_GpuProfilingPopRange(); - theta = read_only_load(&dlam[row]); - } + /* 4. Form D_tau */ + /* 5. Form matrix ~{A_FF}, (return twAFF in AFF data structure ) */ + /* 6. Form matrix ~{A_FC}, (return twAFC in AFC data structure) */ + hypre_GpuProfilingPushRange("Compute interp matrix"); + gDim = hypre_GetDefaultDeviceGridDimension(W_nr_of_rows, "warp", bDim); + HYPRE_GPU_LAUNCH( hypreGPUKernel_compute_aff_afc_epe, + gDim, bDim, + W_nr_of_rows, + AFF_diag_i, + AFF_diag_j, + AFF_diag_a, + AFF_offd_i, + AFF_offd_j, + AFF_offd_a, + AFC_diag_i, + AFC_diag_a, + AFC_offd_i, + AFC_offd_a, + rsW, + dlam, + dtmp, + dtmp_offd ); + hypre_TFree(rsW, HYPRE_MEMORY_DEVICE); + hypre_TFree(rsFC, HYPRE_MEMORY_DEVICE); + hypre_TFree(dlam, HYPRE_MEMORY_DEVICE); + hypre_TFree(dtmp, HYPRE_MEMORY_DEVICE); + hypre_TFree(dtmp_offd, HYPRE_MEMORY_DEVICE); + hypre_GpuProfilingPopRange(); - value = __shfl_sync(HYPRE_WARP_FULL_MASK, value, 0); - theta = __shfl_sync(HYPRE_WARP_FULL_MASK, theta, 0); + /* 7. Perform matrix-matrix multiplication */ + hypre_GpuProfilingPushRange("Matrix-matrix mult"); + W = hypre_ParCSRMatMatDevice(AFF, AFC); + hypre_GpuProfilingPopRange(); - /* AFF Diag part */ - // do not assume diag is the first element of row - for (HYPRE_Int j = pd + lane; __any_sync(HYPRE_WARP_FULL_MASK, j < qd); j += HYPRE_WARP_SIZE) - { - if (j < qd) - { - if (read_only_load(&AFF_diag_j[j]) == row) - { - AFF_diag_data[j] = theta * value; - } - else - { - AFF_diag_data[j] *= value; - } - } - } + hypre_ParCSRMatrixDestroy(AFF); + hypre_ParCSRMatrixDestroy(AFC); - /* AFF offd part */ - for (HYPRE_Int j = po + lane; __any_sync(HYPRE_WARP_FULL_MASK, j < qo); j += HYPRE_WARP_SIZE) - { - if (j < qo) - { - AFF_offd_data[j] *= value; - } - } + /* 8. Construct P from matrix product W */ + P_diag_nnz = hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixDiag(W)) + + hypre_ParCSRMatrixNumCols(W); - theta = theta != 0.0 ? 1.0 / theta : 0.0; + P_diag_i = hypre_TAlloc(HYPRE_Int, A_nr_of_rows + 1, HYPRE_MEMORY_DEVICE); + P_diag_j = hypre_TAlloc(HYPRE_Int, P_diag_nnz, HYPRE_MEMORY_DEVICE); + P_diag_data = hypre_TAlloc(HYPRE_Complex, P_diag_nnz, HYPRE_MEMORY_DEVICE); + P_offd_i = hypre_TAlloc(HYPRE_Int, A_nr_of_rows + 1, HYPRE_MEMORY_DEVICE); - /* AFC Diag part */ - for (HYPRE_Int j = xd + lane; __any_sync(HYPRE_WARP_FULL_MASK, j < yd); j += HYPRE_WARP_SIZE) - { - if (j < yd) - { - AFC_diag_data[j] *= theta; - } - } + hypreDevice_extendWtoP( A_nr_of_rows, + W_nr_of_rows, + hypre_ParCSRMatrixNumCols(W), + CF_marker, + hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixDiag(W)), + hypre_CSRMatrixI(hypre_ParCSRMatrixDiag(W)), + hypre_CSRMatrixJ(hypre_ParCSRMatrixDiag(W)), + hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(W)), + P_diag_i, + P_diag_j, + P_diag_data, + hypre_CSRMatrixI(hypre_ParCSRMatrixOffd(W)), + P_offd_i ); - /* AFC offd part */ - for (HYPRE_Int j = xo + lane; __any_sync(HYPRE_WARP_FULL_MASK, j < yo); j += HYPRE_WARP_SIZE) - { - if (j < yo) - { - AFC_offd_data[j] *= theta; - } - } -} + // final P + P = hypre_ParCSRMatrixCreate(hypre_ParCSRMatrixComm(A), + hypre_ParCSRMatrixGlobalNumRows(A), + hypre_ParCSRMatrixGlobalNumCols(W), + hypre_ParCSRMatrixColStarts(A), + hypre_ParCSRMatrixColStarts(W), + hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(W)), + P_diag_nnz, + hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixOffd(W))); -//----------------------------------------------------------------------- -// For Ext+e Interp, compute D_lambda and D_tmp = D_mu / D_lambda -__global__ -void hypreCUDAKernel_compute_dlam_dtmp( HYPRE_Int nr_of_rows, - HYPRE_Int *AFF_diag_i, - HYPRE_Int *AFF_diag_j, - HYPRE_Complex *AFF_diag_data, - HYPRE_Int *AFF_offd_i, - HYPRE_Complex *AFF_offd_data, - HYPRE_Complex *rsFC, - HYPRE_Complex *dlam, - HYPRE_Complex *dtmp ) -{ - HYPRE_Int row = hypre_cuda_get_grid_warp_id<1,1>(); + hypre_CSRMatrixI(hypre_ParCSRMatrixDiag(P)) = P_diag_i; + hypre_CSRMatrixJ(hypre_ParCSRMatrixDiag(P)) = P_diag_j; + hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(P)) = P_diag_data; - if (row >= nr_of_rows) - { - return; - } + hypre_CSRMatrixI(hypre_ParCSRMatrixOffd(P)) = P_offd_i; + hypre_CSRMatrixJ(hypre_ParCSRMatrixOffd(P)) = hypre_CSRMatrixJ(hypre_ParCSRMatrixOffd(W)); + hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(P)) = hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(W)); + hypre_CSRMatrixJ(hypre_ParCSRMatrixOffd(W)) = NULL; + hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(W)) = NULL; - HYPRE_Int lane = hypre_cuda_get_lane_id<1>(); - HYPRE_Int p_diag, p_offd, q_diag, q_offd; + hypre_CSRMatrixMemoryLocation(hypre_ParCSRMatrixDiag(P)) = HYPRE_MEMORY_DEVICE; + hypre_CSRMatrixMemoryLocation(hypre_ParCSRMatrixOffd(P)) = HYPRE_MEMORY_DEVICE; - if (lane < 2) - { - p_diag = read_only_load(AFF_diag_i + row + lane); - } - q_diag = __shfl_sync(HYPRE_WARP_FULL_MASK, p_diag, 1); - p_diag = __shfl_sync(HYPRE_WARP_FULL_MASK, p_diag, 0); + hypre_ParCSRMatrixDeviceColMapOffd(P) = hypre_ParCSRMatrixDeviceColMapOffd(W); + hypre_ParCSRMatrixColMapOffd(P) = hypre_ParCSRMatrixColMapOffd(W); + hypre_ParCSRMatrixDeviceColMapOffd(W) = NULL; + hypre_ParCSRMatrixColMapOffd(W) = NULL; - HYPRE_Complex row_sum = 0.0; - HYPRE_Int find_diag = 0; + hypre_ParCSRMatrixNumNonzeros(P) = hypre_ParCSRMatrixNumNonzeros(W) + + hypre_ParCSRMatrixGlobalNumCols(W); + hypre_ParCSRMatrixDNumNonzeros(P) = (HYPRE_Real) hypre_ParCSRMatrixNumNonzeros(P); - /* do not assume the first element is the diagonal */ - for (HYPRE_Int j = p_diag + lane; __any_sync(HYPRE_WARP_FULL_MASK, j < q_diag); j += HYPRE_WARP_SIZE) + hypre_GpuProfilingPushRange("Truncation"); + if (trunc_factor != 0.0 || max_elmts > 0) { - if ( j < q_diag ) - { - if (read_only_load(&AFF_diag_j[j]) == row) - { - find_diag ++; - } - else - { - row_sum += read_only_load(&AFF_diag_data[j]); - } - } + hypre_BoomerAMGInterpTruncationDevice(P, trunc_factor, max_elmts); + hypre_ParCSRMatrixCompressOffdMapDevice(P); } + hypre_GpuProfilingPopRange(); - if (lane < 2) - { - p_offd = read_only_load(AFF_offd_i + row + lane); - } - q_offd = __shfl_sync(HYPRE_WARP_FULL_MASK, p_offd, 1); - p_offd = __shfl_sync(HYPRE_WARP_FULL_MASK, p_offd, 0); + hypre_MatvecCommPkgCreate(P); - for (HYPRE_Int j = p_offd + lane; __any_sync(HYPRE_WARP_FULL_MASK, j < q_offd); j += HYPRE_WARP_SIZE) - { - if ( j < q_offd ) - { - row_sum += read_only_load(&AFF_offd_data[j]); - } - } +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::replace_if, CF_marker, CF_marker + A_nr_of_rows, equal(-3), -1); +#else + HYPRE_THRUST_CALL( replace_if, CF_marker, CF_marker + A_nr_of_rows, equal(-3), -1); +#endif - row_sum = warp_reduce_sum(row_sum); - find_diag = warp_reduce_sum(find_diag); + *P_ptr = P; - if (lane == 0) - { - HYPRE_Int num = q_diag - p_diag + q_offd - p_offd - find_diag; - HYPRE_Complex mu = num > 0 ? row_sum / ((HYPRE_Complex) num) : 0.0; - /* lambda = beta + mu */ - HYPRE_Complex lam = read_only_load(&rsFC[row]) + mu; - dlam[row] = lam; - dtmp[row] = lam != 0.0 ? mu / lam : 0.0; - } + /* 9. Free memory */ + hypre_ParCSRMatrixDestroy(W); + + return hypre_error_flag; } -#endif // defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#endif // defined(HYPRE_USING_GPU) diff --git a/external/hypre/src/parcsr_ls/par_lr_restr.c b/external/hypre/src/parcsr_ls/par_lr_restr.c index a3eff883..1c7ce2a7 100644 --- a/external/hypre/src/parcsr_ls/par_lr_restr.c +++ b/external/hypre/src/parcsr_ls/par_lr_restr.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -24,8 +24,10 @@ HYPRE_Int AIR_MAX_SOL_SIZE = 0; #define EPSILON 1e-18 #define EPSIMAC 1e-16 -void hypre_fgmresT(HYPRE_Int n, HYPRE_Complex *A, HYPRE_Complex *b, HYPRE_Real tol, HYPRE_Int kdim, HYPRE_Complex *x, HYPRE_Real *relres, HYPRE_Int *iter, HYPRE_Int job); -void hypre_ordered_GS(const HYPRE_Complex L[], const HYPRE_Complex rhs[], HYPRE_Complex x[], const HYPRE_Int n); +void hypre_fgmresT(HYPRE_Int n, HYPRE_Complex *A, HYPRE_Complex *b, HYPRE_Real tol, HYPRE_Int kdim, + HYPRE_Complex *x, HYPRE_Real *relres, HYPRE_Int *iter, HYPRE_Int job); +void hypre_ordered_GS(const HYPRE_Complex L[], const HYPRE_Complex rhs[], HYPRE_Complex x[], + const HYPRE_Int n); /* HYPRE_Real air_time0 = 0.0; @@ -50,13 +52,14 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, HYPRE_Int is_triangular, HYPRE_Int gmres_switch) { + HYPRE_UNUSED_VAR(debug_flag); /* HYPRE_Real t0 = hypre_MPI_Wtime(); */ MPI_Comm comm = hypre_ParCSRMatrixComm(A); hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); hypre_ParCSRCommHandle *comm_handle; - hypre_ParCSRCommPkg *comm_pkg_SF; + hypre_ParCSRCommPkg *comm_pkg_SF = NULL; /* diag part of A */ hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); @@ -148,7 +151,7 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, HYPRE_Int *Marker_FF2_offd_j, Marker_FF2_offd_count; /* for communication of offd F and F^2 rows of A */ - hypre_ParCSRCommPkg *comm_pkg_FF2_i, *comm_pkg_FF2_j; + hypre_ParCSRCommPkg *comm_pkg_FF2_i, *comm_pkg_FF2_j = NULL; HYPRE_BigInt *send_FF2_j, *recv_FF2_j; HYPRE_Int num_sends_FF2, *send_FF2_i, send_FF2_ilen, send_FF2_jlen, num_recvs_FF2, *recv_FF2_i, recv_FF2_ilen, recv_FF2_jlen, @@ -168,11 +171,11 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, /*-------------- global number of C points and my start position */ /*my_first_cpt = num_cpts_global[0];*/ - if (my_id == (num_procs -1)) + if (my_id == (num_procs - 1)) { total_global_cpts = num_cpts_global[1]; } - hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); + hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); /*------------------------------------------------------------------- * Get the CF_marker data for the off-processor columns @@ -209,7 +212,7 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, /* send buffer, of size send_map_starts[num_sends]), * i.e., number of entries to send */ - send_buf_i = hypre_CTAlloc(HYPRE_Int , num_elems_send, HYPRE_MEMORY_HOST); + send_buf_i = hypre_CTAlloc(HYPRE_Int, num_elems_send, HYPRE_MEMORY_HOST); /* copy CF markers of elements to send to buffer * RL: why copy them with two for loops? Why not just loop through all in one */ @@ -218,10 +221,10 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, /* start pos of elements sent to send_proc[i] */ start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); /* loop through all elems to send_proc[i] */ - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { /* CF marker of send_map_elemts[j] */ - send_buf_i[index++] = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + send_buf_i[index++] = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } } /* create a handle to start communication. 11: for integer */ @@ -235,9 +238,9 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, for (i = 0, index = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j=start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { - send_buf_i[index++] = dof_func[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + send_buf_i[index++] = dof_func[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } } comm_handle = hypre_ParCSRCommHandleCreate(11, comm_pkg, send_buf_i, dof_func_offd); @@ -264,7 +267,7 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, continue; } /* diag part of row i1 */ - for (j = S_diag_i[i1]; j < S_diag_i[i1+1]; j++) + for (j = S_diag_i[i1]; j < S_diag_i[i1 + 1]; j++) { if (CF_marker[S_diag_j[j]] < 0) { @@ -272,7 +275,7 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, } } /* offd part of row i1 */ - for (j = S_offd_i[i1]; j < S_offd_i[i1+1]; j++) + for (j = S_offd_i[i1]; j < S_offd_i[i1 + 1]; j++) { j1 = S_offd_j[j]; if (CF_marker_offd[j1] < 0) @@ -286,7 +289,7 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, } /* do communication */ - comm_handle = hypre_ParCSRCommHandleCreate(11, comm_pkg, send_SF_i, recv_SF_i+1); + comm_handle = hypre_ParCSRCommHandleCreate(11, comm_pkg, send_SF_i, recv_SF_i + 1); /* ... */ hypre_ParCSRCommHandleDestroy(comm_handle); @@ -298,7 +301,7 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, /* start pos of elements sent to send_proc[i] */ start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); /* 1-past-the-end pos */ - end = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); + end = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); for (j = start; j < end; j++) { @@ -310,7 +313,7 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, continue; } /* diag part of row j1 */ - for (k = S_diag_i[j1]; k < S_diag_i[j1+1]; k++) + for (k = S_diag_i[j1]; k < S_diag_i[j1 + 1]; k++) { k1 = S_diag_j[k]; if (CF_marker[k1] < 0) @@ -319,7 +322,7 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, } } /* offd part of row j1 */ - for (k = S_offd_i[j1]; k < S_offd_i[j1+1]; k++) + for (k = S_offd_i[j1]; k < S_offd_i[j1 + 1]; k++) { k1 = S_offd_j[k]; if (CF_marker_offd[k1] < 0) @@ -328,7 +331,7 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, } } } - send_SF_jstarts[i+1] = i1; + send_SF_jstarts[i + 1] = i1; } hypre_assert(i1 == send_SF_jlen); @@ -336,7 +339,7 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, /* adjust recv_SF_i to ptrs */ for (i = 1; i <= num_cols_A_offd; i++) { - recv_SF_i[i] += recv_SF_i[i-1]; + recv_SF_i[i] += recv_SF_i[i - 1]; } recv_SF_jlen = recv_SF_i[num_cols_A_offd]; @@ -350,14 +353,15 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, } /* create a communication package for SF_j */ - comm_pkg_SF = hypre_CTAlloc(hypre_ParCSRCommPkg, 1, HYPRE_MEMORY_HOST); - hypre_ParCSRCommPkgComm (comm_pkg_SF) = comm; - hypre_ParCSRCommPkgNumSends (comm_pkg_SF) = num_sends; - hypre_ParCSRCommPkgSendProcs (comm_pkg_SF) = hypre_ParCSRCommPkgSendProcs(comm_pkg); - hypre_ParCSRCommPkgSendMapStarts(comm_pkg_SF) = send_SF_jstarts; - hypre_ParCSRCommPkgNumRecvs (comm_pkg_SF) = num_recvs; - hypre_ParCSRCommPkgRecvProcs (comm_pkg_SF) = hypre_ParCSRCommPkgRecvProcs(comm_pkg); - hypre_ParCSRCommPkgRecvVecStarts(comm_pkg_SF) = recv_SF_jstarts; + hypre_ParCSRCommPkgCreateAndFill(comm, + num_recvs, + hypre_ParCSRCommPkgRecvProcs(comm_pkg), + recv_SF_jstarts, + num_sends, + hypre_ParCSRCommPkgSendProcs(comm_pkg), + send_SF_jstarts, + NULL, + &comm_pkg_SF); /* do communication */ comm_handle = hypre_ParCSRCommHandleCreate(21, comm_pkg_SF, send_SF_j, recv_SF_j); @@ -387,11 +391,11 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, } /* remove redundancy after sorting */ - hypre_BigQsort0(recv_SF_offd_list, 0, j-1); + hypre_BigQsort0(recv_SF_offd_list, 0, j - 1); for (i = 0, recv_SF_offd_list_len = 0; i < j; i++) { - if (i == 0 || recv_SF_offd_list[i] != recv_SF_offd_list[i-1]) + if (i == 0 || recv_SF_offd_list[i] != recv_SF_offd_list[i - 1]) { recv_SF_offd_list[recv_SF_offd_list_len++] = recv_SF_offd_list[i]; } @@ -444,14 +448,14 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, } /* diag(F)-offd(F) */ - for (j = S_diag_i[i]; j < S_diag_i[i+1]; j++) + for (j = S_diag_i[i]; j < S_diag_i[i + 1]; j++) { j1 = S_diag_j[j]; /* if it is F */ if (CF_marker[j1] < 0) { /* go through its offd part */ - for (k = S_offd_i[j1]; k < S_offd_i[j1+1]; k++) + for (k = S_offd_i[j1]; k < S_offd_i[j1 + 1]; k++) { k1 = S_offd_j[k]; if (CF_marker_offd[k1] < 0) @@ -471,7 +475,7 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, * NOTE: we are working with two marker arrays here: Marker_offd and Marker_recv_SF_offd_list * which may have overlap. * So, we always check the first marker array */ - for (j = S_offd_i[i]; j < S_offd_i[i+1]; j++) + for (j = S_offd_i[i]; j < S_offd_i[i + 1]; j++) { j1 = S_offd_j[j]; /* offd F pts */ @@ -483,7 +487,7 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, Marker_offd[j1] = 1; } /* offd(F)-offd(F), need to open recv_SF */ - for (k = recv_SF_i[j1]; k < recv_SF_i[j1+1]; k++) + for (k = recv_SF_i[j1]; k < recv_SF_i[j1 + 1]; k++) { /* k1: global index */ big_k1 = recv_SF_j[k]; @@ -555,12 +559,12 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, hypre_assert(k == FF2_offd_len); /* sort the list */ - hypre_BigQsort0(FF2_offd, 0, FF2_offd_len-1); + hypre_BigQsort0(FF2_offd, 0, FF2_offd_len - 1); /* there must be no repetition in FF2_offd */ for (i = 1; i < FF2_offd_len; i++) { - hypre_assert(FF2_offd[i] != FF2_offd[i-1]); + hypre_assert(FF2_offd[i] != FF2_offd[i - 1]); } /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -593,7 +597,7 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, for (i = 0, send_FF2_jlen = 0; i < send_FF2_ilen; i++) { j = hypre_ParCSRCommPkgSendMapElmt(comm_pkg_FF2_i, i); - for (k = A_diag_i[j]; k < A_diag_i[j+1]; k++) + for (k = A_diag_i[j]; k < A_diag_i[j + 1]; k++) { if (CF_marker[A_diag_j[k]] < 0) { @@ -602,7 +606,7 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, } if (num_procs > 1) { - for (k = A_offd_i[j]; k < A_offd_i[j+1]; k++) + for (k = A_offd_i[j]; k < A_offd_i[j + 1]; k++) { if (CF_marker_offd[A_offd_j[k]] < 0) { @@ -615,7 +619,7 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, } /* do communication */ - comm_handle = hypre_ParCSRCommHandleCreate(11, comm_pkg_FF2_i, send_FF2_i, recv_FF2_i+1); + comm_handle = hypre_ParCSRCommHandleCreate(11, comm_pkg_FF2_i, send_FF2_i, recv_FF2_i + 1); /* ... */ hypre_ParCSRCommHandleDestroy(comm_handle); @@ -626,13 +630,13 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, for (i = 0, i1 = 0; i < num_sends_FF2; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg_FF2_i, i); - end = hypre_ParCSRCommPkgSendMapStart(comm_pkg_FF2_i, i+1); + end = hypre_ParCSRCommPkgSendMapStart(comm_pkg_FF2_i, i + 1); for (j = start; j < end; j++) { /* will send row j1 to send_proc[i] */ j1 = hypre_ParCSRCommPkgSendMapElmt(comm_pkg_FF2_i, j); /* open row j1 and fill ja and a */ - for (k = A_diag_i[j1]; k < A_diag_i[j1+1]; k++) + for (k = A_diag_i[j1]; k < A_diag_i[j1 + 1]; k++) { HYPRE_Int k1 = A_diag_j[k]; if (CF_marker[k1] < 0) @@ -644,7 +648,7 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, } if (num_procs > 1) { - for (k = A_offd_i[j1]; k < A_offd_i[j1+1]; k++) + for (k = A_offd_i[j1]; k < A_offd_i[j1 + 1]; k++) { HYPRE_Int k1 = A_offd_j[k]; if (CF_marker_offd[k1] < 0) @@ -656,14 +660,14 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, } } } - send_FF2_jstarts[i+1] = i1; + send_FF2_jstarts[i + 1] = i1; } hypre_assert(i1 == send_FF2_jlen); /* adjust recv_FF2_i to ptrs */ for (i = 1; i <= recv_FF2_ilen; i++) { - recv_FF2_i[i] += recv_FF2_i[i-1]; + recv_FF2_i[i] += recv_FF2_i[i - 1]; } recv_FF2_jlen = recv_FF2_i[recv_FF2_ilen]; @@ -678,14 +682,15 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, } /* create a communication package for FF2_j */ - comm_pkg_FF2_j = hypre_CTAlloc(hypre_ParCSRCommPkg, 1, HYPRE_MEMORY_HOST); - hypre_ParCSRCommPkgComm (comm_pkg_FF2_j) = comm; - hypre_ParCSRCommPkgNumSends (comm_pkg_FF2_j) = num_sends_FF2; - hypre_ParCSRCommPkgSendProcs (comm_pkg_FF2_j) = hypre_ParCSRCommPkgSendProcs(comm_pkg_FF2_i); - hypre_ParCSRCommPkgSendMapStarts(comm_pkg_FF2_j) = send_FF2_jstarts; - hypre_ParCSRCommPkgNumRecvs (comm_pkg_FF2_j) = num_recvs_FF2; - hypre_ParCSRCommPkgRecvProcs (comm_pkg_FF2_j) = hypre_ParCSRCommPkgRecvProcs(comm_pkg_FF2_i); - hypre_ParCSRCommPkgRecvVecStarts(comm_pkg_FF2_j) = recv_FF2_jstarts; + hypre_ParCSRCommPkgCreateAndFill(comm, + num_recvs_FF2, + hypre_ParCSRCommPkgRecvProcs(comm_pkg_FF2_i), + recv_FF2_jstarts, + num_sends_FF2, + hypre_ParCSRCommPkgSendProcs(comm_pkg_FF2_i), + send_FF2_jstarts, + NULL, + &comm_pkg_FF2_j); /* do communication */ /* ja */ @@ -792,7 +797,7 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, n_cpts ++; /* diag part of row i */ - for (j = S_diag_i[i]; j < S_diag_i[i+1]; j++) + for (j = S_diag_i[i]; j < S_diag_i[i + 1]; j++) { j1 = S_diag_j[j]; if (CF_marker[j1] >= 0) @@ -807,7 +812,7 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, cnt_diag ++; } /* F^2: D1-D2. Open row j1 */ - for (k = S_diag_i[j1]; k < S_diag_i[j1+1]; k++) + for (k = S_diag_i[j1]; k < S_diag_i[j1 + 1]; k++) { k1 = S_diag_j[k]; /* F-pt and never seen before */ @@ -819,7 +824,7 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, } } /* F^2: D1-O2. Open row j1 */ - for (k = S_offd_i[j1]; k < S_offd_i[j1+1]; k++) + for (k = S_offd_i[j1]; k < S_offd_i[j1 + 1]; k++) { k1 = S_offd_j[k]; @@ -843,7 +848,7 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, } /* offd part of row i */ - for (j = S_offd_i[i]; j < S_offd_i[i+1]; j++) + for (j = S_offd_i[i]; j < S_offd_i[i + 1]; j++) { j1 = S_offd_j[j]; @@ -868,7 +873,7 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, /* F^2: O1-D2, O1-O2 */ /* row j1 is an external row. check recv_SF for strong F-neighbors */ - for (k = recv_SF_i[j1]; k < recv_SF_i[j1+1]; k++) + for (k = recv_SF_i[j1]; k < recv_SF_i[j1 + 1]; k++) { /* k1: global index */ big_k1 = recv_SF_j[k]; @@ -929,13 +934,13 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, nnz_offd = cnt_offd; /*------------- allocate arrays */ - R_diag_i = hypre_CTAlloc(HYPRE_Int, n_cpts+1, HYPRE_MEMORY_HOST); + R_diag_i = hypre_CTAlloc(HYPRE_Int, n_cpts + 1, HYPRE_MEMORY_HOST); R_diag_j = hypre_CTAlloc(HYPRE_Int, nnz_diag, HYPRE_MEMORY_HOST); R_diag_data = hypre_CTAlloc(HYPRE_Complex, nnz_diag, HYPRE_MEMORY_HOST); /* not in ``if num_procs > 1'', * allocation needed even for empty CSR */ - R_offd_i = hypre_CTAlloc(HYPRE_Int, n_cpts+1, HYPRE_MEMORY_HOST); + R_offd_i = hypre_CTAlloc(HYPRE_Int, n_cpts + 1, HYPRE_MEMORY_HOST); R_offd_j = hypre_CTAlloc(HYPRE_Int, nnz_offd, HYPRE_MEMORY_HOST); R_offd_data = hypre_CTAlloc(HYPRE_Complex, nnz_offd, HYPRE_MEMORY_HOST); @@ -972,7 +977,7 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, //printf("AIR: max local dense solve size %d\n", local_max_size); // Allocate the rhs and dense local matrix in column-major form (for LAPACK) - DAi = hypre_CTAlloc(HYPRE_Complex, local_max_size*local_max_size, HYPRE_MEMORY_HOST); + DAi = hypre_CTAlloc(HYPRE_Complex, local_max_size * local_max_size, HYPRE_MEMORY_HOST); Dbi = hypre_CTAlloc(HYPRE_Complex, local_max_size, HYPRE_MEMORY_HOST); Dxi = hypre_CTAlloc(HYPRE_Complex, local_max_size, HYPRE_MEMORY_HOST); Ipi = hypre_CTAlloc(HYPRE_Int, local_max_size, HYPRE_MEMORY_HOST); // pivot matrix @@ -1024,7 +1029,7 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, /* Access matrices for the First time, mark the points we want */ /* diag part of row i */ - for (j = S_diag_i[i]; j < S_diag_i[i+1]; j++) + for (j = S_diag_i[i]; j < S_diag_i[i + 1]; j++) { j1 = S_diag_j[j]; if (CF_marker[j1] >= 0) @@ -1040,7 +1045,7 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, Marker_diag[j1] = local_size ++; } /* F^2: D1-D2. Open row j1 */ - for (k = S_diag_i[j1]; k < S_diag_i[j1+1]; k++) + for (k = S_diag_i[j1]; k < S_diag_i[j1 + 1]; k++) { k1 = S_diag_j[k]; /* F-pt and never seen before */ @@ -1053,7 +1058,7 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, } } /* F^2: D1-O2. Open row j1 */ - for (k = S_offd_i[j1]; k < S_offd_i[j1+1]; k++) + for (k = S_offd_i[j1]; k < S_offd_i[j1 + 1]; k++) { k1 = S_offd_j[k]; @@ -1081,7 +1086,7 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, /* offd part of row i */ if (num_procs > 1) { - for (j = S_offd_i[i]; j < S_offd_i[i+1]; j++) + for (j = S_offd_i[i]; j < S_offd_i[i + 1]; j++) { j1 = S_offd_j[j]; @@ -1108,7 +1113,7 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, /* F^2: O1-D2, O1-O2 */ /* row j1 is an external row. check recv_SF for strong F-neighbors */ - for (k = recv_SF_i[j1]; k < recv_SF_i[j1+1]; k++) + for (k = recv_SF_i[j1]; k < recv_SF_i[j1 + 1]; k++) { /* k1: global index */ big_k1 = recv_SF_j[k]; @@ -1181,7 +1186,7 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, if (i2) /* i2 == 1, i1 is an offd row */ { /* open row i1, a remote row */ - for (j = hypre_CSRMatrixI(A_offd_FF2)[i1]; j < hypre_CSRMatrixI(A_offd_FF2)[i1+1]; j++) + for (j = hypre_CSRMatrixI(A_offd_FF2)[i1]; j < hypre_CSRMatrixI(A_offd_FF2)[i1 + 1]; j++) { /* big_j1 is a global index */ big_j1 = hypre_CSRMatrixBigJ(A_offd_FF2)[j]; @@ -1197,7 +1202,7 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, /* copy the value */ /* rr and cc: local dense ids */ HYPRE_Complex vv = hypre_CSRMatrixData(A_offd_FF2)[j]; - DAi[rr + cc*local_size] = vv; + DAi[rr + cc * local_size] = vv; } } @@ -1223,7 +1228,7 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, else /* i2 == 0, i1 is a local row */ { /* open row i1, a local row */ - for (j = A_diag_i[i1]; j < A_diag_i[i1+1]; j++) + for (j = A_diag_i[i1]; j < A_diag_i[i1 + 1]; j++) { /* j1 is a local index */ j1 = A_diag_j[j]; @@ -1242,7 +1247,7 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, if (num_procs > 1) { - for (j = A_offd_i[i1]; j < A_offd_i[i1+1]; j++) + for (j = A_offd_i[i1]; j < A_offd_i[i1 + 1]; j++) { j1 = A_offd_j[j]; /* map to FF2_offd */ @@ -1305,7 +1310,7 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, /* rhs bi: entries from row i of A */ rr = 0; /* diag part */ - for (j = A_diag_i[i]; j < A_diag_i[i+1]; j++) + for (j = A_diag_i[i]; j < A_diag_i[i + 1]; j++) { i1 = A_diag_j[j]; if ((cc = Marker_diag[i1]) >= 0) @@ -1320,7 +1325,7 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, /* if parallel, offd part */ if (num_procs > 1) { - for (j = A_offd_i[i]; j < A_offd_i[i+1]; j++) + for (j = A_offd_i[i]; j < A_offd_i[i + 1]; j++) { i1 = A_offd_j[j]; i2 = Mapper_offd_A[i1]; @@ -1348,7 +1353,8 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, Aisol_method = local_size <= gmres_switch ? 'L' : 'G'; if (local_size > 0) { - if (is_triangular) { + if (is_triangular) + { hypre_ordered_GS(DAi, Dbi, Dxi, local_size); #if AIR_DEBUG HYPRE_Real alp = -1.0, err; @@ -1366,8 +1372,8 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, else if (Aisol_method == 'L') { #if AIR_DEBUG - memcpy(TMPA, DAi, local_size*local_size*sizeof(HYPRE_Complex)); - memcpy(TMPb, Dbi, local_size*sizeof(HYPRE_Complex)); + memcpy(TMPA, DAi, local_size * local_size * sizeof(HYPRE_Complex)); + memcpy(TMPb, Dbi, local_size * sizeof(HYPRE_Complex)); #endif hypre_dgetrf(&local_size, &local_size, DAi, &local_size, Ipi, &lapack_info); @@ -1418,9 +1424,9 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, nrmb = hypre_dnrm2(&local_size, Dbi, &ione); hypre_daxpy(&local_size, &alp, Dbi, &ione, TMPd, &ione); err = hypre_dnrm2(&local_size, TMPd, &ione); - if (err/nrmb > gmresAi_tol) + if (err / nrmb > gmresAi_tol) { - hypre_printf("GMRES/Jacobi: res norm %e, nrmb %e, relative %e\n", err, nrmb, err/nrmb); + hypre_printf("GMRES/Jacobi: res norm %e, nrmb %e, relative %e\n", err, nrmb, err / nrmb); hypre_printf("GMRES/Jacobi: relative %e\n", gmresAi_res); exit(0); } @@ -1428,7 +1434,7 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, } } - HYPRE_Complex *Soli = (is_triangular || (Aisol_method=='G')) ? Dxi : Dbi; + HYPRE_Complex *Soli = (is_triangular || (Aisol_method == 'G')) ? Dxi : Dbi; /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * Now we are ready to fill this row of R @@ -1467,9 +1473,9 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, R_diag_data[cnt_diag++] = 1.0; /* row ptr of the next row */ - R_diag_i[ic+1] = cnt_diag; + R_diag_i[ic + 1] = cnt_diag; - R_offd_i[ic+1] = cnt_offd; + R_offd_i[ic + 1] = cnt_offd; /* RESET marker arrays */ for (j = 0; j < Marker_diag_count; j++) @@ -1593,7 +1599,8 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, */ /* Filter small entries from R */ - if (filter_thresholdR > 0) { + if (filter_thresholdR > 0) + { hypre_ParCSRMatrixDropSmallEntries(R, filter_thresholdR, -1); } @@ -1660,16 +1667,20 @@ hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, HYPRE_Int hypre_BoomerAMGBuildRestrNeumannAIRHost( hypre_ParCSRMatrix *A, - HYPRE_Int *CF_marker, - HYPRE_BigInt *num_cpts_global, - HYPRE_Int num_functions, - HYPRE_Int *dof_func, - HYPRE_Int NeumannDeg, - HYPRE_Real strong_thresholdR, - HYPRE_Real filter_thresholdR, - HYPRE_Int debug_flag, - hypre_ParCSRMatrix **R_ptr) + HYPRE_Int *CF_marker, + HYPRE_BigInt *num_cpts_global, + HYPRE_Int num_functions, + HYPRE_Int *dof_func, + HYPRE_Int NeumannDeg, + HYPRE_Real strong_thresholdR, + HYPRE_Real filter_thresholdR, + HYPRE_Int debug_flag, + hypre_ParCSRMatrix **R_ptr) { + HYPRE_UNUSED_VAR(num_functions); + HYPRE_UNUSED_VAR(dof_func); + HYPRE_UNUSED_VAR(debug_flag); + /* HYPRE_Real t0 = hypre_MPI_Wtime(); */ MPI_Comm comm = hypre_ParCSRMatrixComm(A); hypre_ParCSRCommHandle *comm_handle; @@ -1686,7 +1697,7 @@ hypre_BoomerAMGBuildRestrNeumannAIRHost( hypre_ParCSRMatrix *A, HYPRE_Complex *R_diag_a; HYPRE_Int *R_diag_i; HYPRE_Int *R_diag_j; - HYPRE_Complex *R_offd_a; + HYPRE_Complex *R_offd_a; HYPRE_Int *R_offd_i; HYPRE_Int *R_offd_j; HYPRE_BigInt *col_map_offd_R; @@ -1696,7 +1707,7 @@ hypre_BoomerAMGBuildRestrNeumannAIRHost( hypre_ParCSRMatrix *A, HYPRE_Int my_id, num_procs; HYPRE_BigInt total_global_cpts/*, my_first_cpt*/; HYPRE_Int nnz_diag, nnz_offd, cnt_diag, cnt_offd; - HYPRE_BigInt *send_buf_i; + HYPRE_BigInt *send_buf_i; /* local size */ HYPRE_Int n_fine = hypre_CSRMatrixNumRows(A_diag); @@ -1706,13 +1717,15 @@ hypre_BoomerAMGBuildRestrNeumannAIRHost( hypre_ParCSRMatrix *A, hypre_MPI_Comm_size(comm, &num_procs); hypre_MPI_Comm_rank(comm, &my_id); + HYPRE_MemoryLocation memory_location_R = hypre_ParCSRMatrixMemoryLocation(A); + /*-------------- global number of C points and my start position */ /*my_first_cpt = num_cpts_global[0];*/ - if (my_id == (num_procs -1)) + if (my_id == (num_procs - 1)) { total_global_cpts = num_cpts_global[1]; } - hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); + hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); /*------------------------------------------------------------------- * Get the CF_marker data for the off-processor columns @@ -1752,7 +1765,7 @@ hypre_BoomerAMGBuildRestrNeumannAIRHost( hypre_ParCSRMatrix *A, /* copy CF markers of elements to send to buffer */ for (i = 0; i < num_elems_send; i++) { - send_buf_i[i] = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,i)]; + send_buf_i[i] = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, i)]; } /* create a handle to start communication. 11: for integer */ comm_handle = hypre_ParCSRCommHandleCreate(11, comm_pkg, send_buf_i, CF_marker_offd); @@ -1764,7 +1777,7 @@ hypre_BoomerAMGBuildRestrNeumannAIRHost( hypre_ParCSRMatrix *A, { for (i = 0; i < num_elems_send; i++) { - send_buf_i[i] = dof_func[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,i)]; + send_buf_i[i] = dof_func[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, i)]; } comm_handle = hypre_ParCSRCommHandleCreate(11, comm_pkg, send_buf_i, dof_func_offd); hypre_ParCSRCommHandleDestroy(comm_handle); @@ -1810,7 +1823,7 @@ hypre_BoomerAMGBuildRestrNeumannAIRHost( hypre_ParCSRMatrix *A, for (i = 0; i < n_fpts; i++) { /* find the diagonal element and store inverse */ - for (j = AFF_diag_i[i]; j < AFF_diag_i[i+1]; j++) + for (j = AFF_diag_i[i]; j < AFF_diag_i[i + 1]; j++) { if (AFF_diag_j[j] == i) { @@ -1820,13 +1833,13 @@ hypre_BoomerAMGBuildRestrNeumannAIRHost( hypre_ParCSRMatrix *A, } } - for (j = AFF_diag_i[i]; j < AFF_diag_i[i+1]; j++) + for (j = AFF_diag_i[i]; j < AFF_diag_i[i + 1]; j++) { AFF_diag_a[j] *= -diag_entries[i]; } if (num_procs > 1) { - for (j = AFF_offd_i[i]; j < AFF_offd_i[i+1]; j++) + for (j = AFF_offd_i[i]; j < AFF_offd_i[i + 1]; j++) { hypre_assert( hypre_ParCSRMatrixColMapOffd(AFF)[AFF_offd_j[j]] != \ i + hypre_ParCSRMatrixFirstRowIndex(AFF) ); @@ -1915,15 +1928,15 @@ hypre_BoomerAMGBuildRestrNeumannAIRHost( hypre_ParCSRMatrix *A, nnz_offd = hypre_CSRMatrixNumNonzeros(Z_offd); /*------------- allocate arrays */ - R_diag_i = hypre_CTAlloc(HYPRE_Int, n_cpts+1, HYPRE_MEMORY_DEVICE); - R_diag_j = hypre_CTAlloc(HYPRE_Int, nnz_diag, HYPRE_MEMORY_DEVICE); - R_diag_a = hypre_CTAlloc(HYPRE_Complex, nnz_diag, HYPRE_MEMORY_DEVICE); + R_diag_i = hypre_CTAlloc(HYPRE_Int, n_cpts + 1, memory_location_R); + R_diag_j = hypre_CTAlloc(HYPRE_Int, nnz_diag, memory_location_R); + R_diag_a = hypre_CTAlloc(HYPRE_Complex, nnz_diag, memory_location_R); /* not in ``if num_procs > 1'', * allocation needed even for empty CSR */ - R_offd_i = hypre_CTAlloc(HYPRE_Int, n_cpts+1, HYPRE_MEMORY_DEVICE); - R_offd_j = hypre_CTAlloc(HYPRE_Int, nnz_offd, HYPRE_MEMORY_DEVICE); - R_offd_a = hypre_CTAlloc(HYPRE_Complex, nnz_offd, HYPRE_MEMORY_DEVICE); + R_offd_i = hypre_CTAlloc(HYPRE_Int, n_cpts + 1, memory_location_R); + R_offd_j = hypre_CTAlloc(HYPRE_Int, nnz_offd, memory_location_R); + R_offd_a = hypre_CTAlloc(HYPRE_Complex, nnz_offd, memory_location_R); /* redundant */ R_diag_i[0] = 0; @@ -1941,7 +1954,7 @@ hypre_BoomerAMGBuildRestrNeumannAIRHost( hypre_ParCSRMatrix *A, continue; } - for (j = Z_diag_i[ic]; j < Z_diag_i[ic+1]; j++) + for (j = Z_diag_i[ic]; j < Z_diag_i[ic + 1]; j++) { j1 = Z_diag_j[j]; R_diag_j[cnt_diag] = Fmap[j1]; @@ -1952,15 +1965,15 @@ hypre_BoomerAMGBuildRestrNeumannAIRHost( hypre_ParCSRMatrix *A, R_diag_j[cnt_diag] = i; R_diag_a[cnt_diag++] = 1.0; - for (j = Z_offd_i[ic]; j < Z_offd_i[ic+1]; j++) + for (j = Z_offd_i[ic]; j < Z_offd_i[ic + 1]; j++) { j1 = Z_offd_j[j]; R_offd_j[cnt_offd] = j1; R_offd_a[cnt_offd++] = -Z_offd_a[j] * diag_entries_offd[j1]; } - R_diag_i[ic+1] = cnt_diag; - R_offd_i[ic+1] = cnt_offd; + R_diag_i[ic + 1] = cnt_diag; + R_offd_i[ic + 1] = cnt_offd; ic++; } @@ -2000,7 +2013,8 @@ hypre_BoomerAMGBuildRestrNeumannAIRHost( hypre_ParCSRMatrix *A, hypre_MatvecCommPkgCreate(R); /* Filter small entries from R */ - if (filter_thresholdR > 0) { + if (filter_thresholdR > 0) + { hypre_ParCSRMatrixDropSmallEntries(R, filter_thresholdR, -1); } @@ -2028,32 +2042,30 @@ hypre_BoomerAMGBuildRestrNeumannAIR( hypre_ParCSRMatrix *A, HYPRE_Int debug_flag, hypre_ParCSRMatrix **R_ptr) { -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_GpuProfilingPushRange("RestrNeumannAIR"); -#endif HYPRE_Int ierr = 0; -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(A) ); if (exec == HYPRE_EXEC_DEVICE) { - ierr = hypre_BoomerAMGBuildRestrNeumannAIRDevice(A,CF_marker,num_cpts_global,num_functions,dof_func, - NeumannDeg, strong_thresholdR, filter_thresholdR, - debug_flag, R_ptr); + ierr = hypre_BoomerAMGBuildRestrNeumannAIRDevice(A, CF_marker, num_cpts_global, num_functions, + dof_func, + NeumannDeg, strong_thresholdR, filter_thresholdR, + debug_flag, R_ptr); } else #endif { - ierr = hypre_BoomerAMGBuildRestrNeumannAIRHost(A,CF_marker,num_cpts_global,num_functions,dof_func, - NeumannDeg, strong_thresholdR, filter_thresholdR, - debug_flag, R_ptr); + ierr = hypre_BoomerAMGBuildRestrNeumannAIRHost(A, CF_marker, num_cpts_global, num_functions, + dof_func, + NeumannDeg, strong_thresholdR, filter_thresholdR, + debug_flag, R_ptr); } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_GpuProfilingPopRange(); -#endif return ierr; } diff --git a/external/hypre/src/parcsr_ls/par_lr_restr_device.c b/external/hypre/src/parcsr_ls/par_lr_restr_device.c index ff5e6450..bf791818 100644 --- a/external/hypre/src/parcsr_ls/par_lr_restr_device.c +++ b/external/hypre/src/parcsr_ls/par_lr_restr_device.c @@ -1,16 +1,20 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ +#include "_hypre_onedpl.hpp" #include "_hypre_parcsr_ls.h" #include "_hypre_utilities.hpp" -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) -__global__ void hypre_BoomerAMGBuildRestrNeumannAIR_assembleRdiag( HYPRE_Int nr_of_rows, HYPRE_Int *Fmap, HYPRE_Int *Cmap, HYPRE_Int *Z_diag_i, HYPRE_Int *Z_diag_j, HYPRE_Complex *Z_diag_a, HYPRE_Int *R_diag_i, HYPRE_Int *R_diag_j, HYPRE_Complex *R_diag_a); +__global__ void hypre_BoomerAMGBuildRestrNeumannAIR_assembleRdiag( hypre_DeviceItem &item, + HYPRE_Int nr_of_rows, + HYPRE_Int *Fmap, HYPRE_Int *Cmap, HYPRE_Int *Z_diag_i, HYPRE_Int *Z_diag_j, HYPRE_Complex *Z_diag_a, + HYPRE_Int *R_diag_i, HYPRE_Int *R_diag_j, HYPRE_Complex *R_diag_a); /*--------------------------------------------------------------------------- * hypre_BoomerAMGBuildRestrNeumannAIR @@ -18,16 +22,18 @@ __global__ void hypre_BoomerAMGBuildRestrNeumannAIR_assembleRdiag( HYPRE_Int nr_ HYPRE_Int hypre_BoomerAMGBuildRestrNeumannAIRDevice( hypre_ParCSRMatrix *A, - HYPRE_Int *CF_marker, - HYPRE_BigInt *num_cpts_global, - HYPRE_Int num_functions, - HYPRE_Int *dof_func, - HYPRE_Int NeumannDeg, - HYPRE_Real strong_thresholdR, - HYPRE_Real filter_thresholdR, - HYPRE_Int debug_flag, - hypre_ParCSRMatrix **R_ptr) + HYPRE_Int *CF_marker, + HYPRE_BigInt *num_cpts_global, + HYPRE_Int num_functions, + HYPRE_Int *dof_func, + HYPRE_Int NeumannDeg, + HYPRE_Real strong_thresholdR, + HYPRE_Real filter_thresholdR, + HYPRE_Int debug_flag, + hypre_ParCSRMatrix **R_ptr) { + HYPRE_UNUSED_VAR(debug_flag); + MPI_Comm comm = hypre_ParCSRMatrixComm(A); hypre_ParCSRCommHandle *comm_handle; @@ -59,11 +65,11 @@ hypre_BoomerAMGBuildRestrNeumannAIRDevice( hypre_ParCSRMatrix *A, hypre_MPI_Comm_rank(comm, &my_id); /* global number of C points and my start position */ - if (my_id == (num_procs -1)) + if (my_id == (num_procs - 1)) { total_global_cpts = num_cpts_global[1]; } - hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); + hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); /* get AFF and ACF */ hypre_ParCSRMatrix *AFF, *ACF, *Dinv, *N, *X, *X2, *Z, *Z2; @@ -91,6 +97,19 @@ hypre_BoomerAMGBuildRestrNeumannAIRDevice( hypre_ParCSRMatrix *A, /* maps from F-pts and C-pts to all points */ HYPRE_Int *Fmap = hypre_TAlloc(HYPRE_Int, n_fpts, HYPRE_MEMORY_DEVICE); HYPRE_Int *Cmap = hypre_TAlloc(HYPRE_Int, n_cpts, HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_SYCL) + oneapi::dpl::counting_iterator count(0); + hypreSycl_copy_if( count, + count + n_fine, + CF_marker, + Fmap, + is_negative()); + hypreSycl_copy_if( count, + count + n_fine, + CF_marker, + Cmap, + is_positive()); +#else HYPRE_THRUST_CALL( copy_if, thrust::make_counting_iterator(0), thrust::make_counting_iterator(n_fine), @@ -103,29 +122,42 @@ hypre_BoomerAMGBuildRestrNeumannAIRDevice( hypre_ParCSRMatrix *A, CF_marker, Cmap, is_positive()); +#endif /* setup Dinv = 1/(diagonal of AFF) */ Dinv = hypre_ParCSRMatrixCreate(comm, - hypre_ParCSRMatrixGlobalNumRows(AFF), - hypre_ParCSRMatrixGlobalNumCols(AFF), - hypre_ParCSRMatrixRowStarts(AFF), - hypre_ParCSRMatrixColStarts(AFF), - 0, - hypre_ParCSRMatrixNumRows(AFF), - 0); + hypre_ParCSRMatrixGlobalNumRows(AFF), + hypre_ParCSRMatrixGlobalNumCols(AFF), + hypre_ParCSRMatrixRowStarts(AFF), + hypre_ParCSRMatrixColStarts(AFF), + 0, + hypre_ParCSRMatrixNumRows(AFF), + 0); hypre_ParCSRMatrixAssumedPartition(Dinv) = hypre_ParCSRMatrixAssumedPartition(AFF); hypre_ParCSRMatrixOwnsAssumedPartition(Dinv) = 0; hypre_ParCSRMatrixInitialize(Dinv); hypre_CSRMatrix *Dinv_diag = hypre_ParCSRMatrixDiag(Dinv); +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::copy, + count, + count + hypre_CSRMatrixNumRows(Dinv_diag) + 1, + hypre_CSRMatrixI(Dinv_diag) ); + HYPRE_ONEDPL_CALL( std::copy, + count, + count + hypre_CSRMatrixNumRows(Dinv_diag), + hypre_CSRMatrixJ(Dinv_diag) ); +#else HYPRE_THRUST_CALL( copy, - thrust::make_counting_iterator(0), - thrust::make_counting_iterator(hypre_CSRMatrixNumRows(Dinv_diag)+1), - hypre_CSRMatrixI(Dinv_diag) ); + thrust::make_counting_iterator(0), + thrust::make_counting_iterator(hypre_CSRMatrixNumRows(Dinv_diag) + 1), + hypre_CSRMatrixI(Dinv_diag) ); HYPRE_THRUST_CALL( copy, - thrust::make_counting_iterator(0), - thrust::make_counting_iterator(hypre_CSRMatrixNumRows(Dinv_diag)), - hypre_CSRMatrixJ(Dinv_diag) ); - hypre_CSRMatrixExtractDiagonalDevice(hypre_ParCSRMatrixDiag(AFF), hypre_CSRMatrixData(Dinv_diag), 2); + thrust::make_counting_iterator(0), + thrust::make_counting_iterator(hypre_CSRMatrixNumRows(Dinv_diag)), + hypre_CSRMatrixJ(Dinv_diag) ); +#endif + hypre_CSRMatrixExtractDiagonalDevice(hypre_ParCSRMatrixDiag(AFF), hypre_CSRMatrixData(Dinv_diag), + 2); /* N = I - D^{-1}*A_FF */ if (NeumannDeg >= 1) @@ -134,16 +166,33 @@ hypre_BoomerAMGBuildRestrNeumannAIRDevice( hypre_ParCSRMatrix *A, hypre_CSRMatrixRemoveDiagonalDevice(hypre_ParCSRMatrixDiag(N)); +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::transform, + hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(N)), + hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(N)) + hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixDiag( + N)), + hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(N)), + std::negate() ); + HYPRE_ONEDPL_CALL( std::transform, + hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(N)), + hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(N)) + hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixOffd( + N)), + hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(N)), + std::negate() ); +#else HYPRE_THRUST_CALL( transform, - hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(N)), - hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(N)) + hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixDiag(N)), - hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(N)), - thrust::negate() ); + hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(N)), + hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(N)) + hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixDiag( + N)), + hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(N)), + thrust::negate() ); HYPRE_THRUST_CALL( transform, - hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(N)), - hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(N)) + hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixOffd(N)), - hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(N)), - thrust::negate() ); + hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(N)), + hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(N)) + hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixOffd( + N)), + hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(N)), + thrust::negate() ); +#endif } /* Z = Acf * (I + N + N^2 + ... + N^k) * D^{-1} */ @@ -196,7 +245,8 @@ hypre_BoomerAMGBuildRestrNeumannAIRDevice( hypre_ParCSRMatrix *A, HYPRE_Int *Z_diag_j = hypre_CSRMatrixJ(Z_diag); HYPRE_Int num_cols_offd_Z = hypre_CSRMatrixNumCols(Z_offd); HYPRE_Int nnz_diag_Z = hypre_CSRMatrixNumNonzeros(Z_diag); - HYPRE_BigInt *Fmap_offd_global = hypre_TAlloc(HYPRE_BigInt, num_cols_offd_Z, HYPRE_MEMORY_DEVICE); + HYPRE_BigInt *Fmap_offd_global = hypre_TAlloc(HYPRE_BigInt, num_cols_offd_Z, + HYPRE_MEMORY_DEVICE); /* send and recv Fmap (wrt Z): global */ if (num_procs > 1) @@ -209,20 +259,42 @@ hypre_BoomerAMGBuildRestrNeumannAIRDevice( hypre_ParCSRMatrix *A, send_buf_i = hypre_TAlloc(HYPRE_BigInt, num_elems_send_Z, HYPRE_MEMORY_DEVICE); hypre_ParCSRCommPkgCopySendMapElmtsToDevice(comm_pkg_Z); +#if defined(HYPRE_USING_SYCL) + hypreSycl_gather( hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg_Z), + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg_Z) + + hypre_ParCSRCommPkgSendMapStart(comm_pkg_Z, num_sends_Z), + Fmap, + send_buf_i ); + HYPRE_ONEDPL_CALL( std::transform, + send_buf_i, + send_buf_i + num_elems_send_Z, + send_buf_i, + [y = col_start](auto & x) {return x + y;} ); +#else HYPRE_THRUST_CALL( gather, - hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg_Z), - hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg_Z) + - hypre_ParCSRCommPkgSendMapStart(comm_pkg_Z, num_sends_Z), - Fmap, - send_buf_i ); + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg_Z), + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg_Z) + + hypre_ParCSRCommPkgSendMapStart(comm_pkg_Z, num_sends_Z), + Fmap, + send_buf_i ); HYPRE_THRUST_CALL( transform, - send_buf_i, - send_buf_i + num_elems_send_Z, - thrust::make_constant_iterator(col_start), - send_buf_i, - thrust::plus() ); + send_buf_i, + send_buf_i + num_elems_send_Z, + thrust::make_constant_iterator(col_start), + send_buf_i, + thrust::plus() ); +#endif + +#if defined(HYPRE_USING_THRUST_NOSYNC) + /* RL: make sure send_buf_i is ready before issuing GPU-GPU MPI */ + if (hypre_GetGpuAwareMPI()) + { + hypre_ForceSyncComputeStream(); + } +#endif - comm_handle = hypre_ParCSRCommHandleCreate_v2(21, comm_pkg_Z, HYPRE_MEMORY_DEVICE, send_buf_i, HYPRE_MEMORY_DEVICE, Fmap_offd_global); + comm_handle = hypre_ParCSRCommHandleCreate_v2(21, comm_pkg_Z, HYPRE_MEMORY_DEVICE, send_buf_i, + HYPRE_MEMORY_DEVICE, Fmap_offd_global); hypre_ParCSRCommHandleDestroy(comm_handle); hypre_TFree(send_buf_i, HYPRE_MEMORY_DEVICE); } @@ -232,27 +304,37 @@ hypre_BoomerAMGBuildRestrNeumannAIRDevice( hypre_ParCSRMatrix *A, nnz_offd = hypre_CSRMatrixNumNonzeros(Z_offd); /* allocate arrays for R diag */ - R_diag_i = hypre_CTAlloc(HYPRE_Int, n_cpts+1, HYPRE_MEMORY_DEVICE); + R_diag_i = hypre_CTAlloc(HYPRE_Int, n_cpts + 1, HYPRE_MEMORY_DEVICE); R_diag_j = hypre_CTAlloc(HYPRE_Int, nnz_diag, HYPRE_MEMORY_DEVICE); R_diag_a = hypre_CTAlloc(HYPRE_Complex, nnz_diag, HYPRE_MEMORY_DEVICE); /* setup R row indices (just Z row indices plus one extra entry for each C-pt)*/ +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::transform, + Z_diag_i, + Z_diag_i + n_cpts + 1, + count, + R_diag_i, + std::plus() ); +#else HYPRE_THRUST_CALL( transform, - Z_diag_i, - Z_diag_i + n_cpts + 1, - thrust::make_counting_iterator(0), - R_diag_i, - thrust::plus() ); + Z_diag_i, + Z_diag_i + n_cpts + 1, + thrust::make_counting_iterator(0), + R_diag_i, + thrust::plus() ); +#endif /* assemble the diagonal part of R from Z */ - dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(n_fine, "warp", bDim); - HYPRE_CUDA_LAUNCH( hypre_BoomerAMGBuildRestrNeumannAIR_assembleRdiag, gDim, bDim, - n_cpts, Fmap, Cmap, Z_diag_i, Z_diag_j, Z_diag_a, R_diag_i, R_diag_j, R_diag_a); + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(n_fine, "warp", bDim); + HYPRE_GPU_LAUNCH( hypre_BoomerAMGBuildRestrNeumannAIR_assembleRdiag, gDim, bDim, + n_cpts, Fmap, Cmap, Z_diag_i, Z_diag_j, Z_diag_a, R_diag_i, R_diag_j, R_diag_a); num_cols_offd_R = num_cols_offd_Z; col_map_offd_R = hypre_TAlloc(HYPRE_BigInt, num_cols_offd_Z, HYPRE_MEMORY_HOST); - hypre_TMemcpy(col_map_offd_R, Fmap_offd_global, HYPRE_BigInt, num_cols_offd_Z, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(col_map_offd_R, Fmap_offd_global, HYPRE_BigInt, num_cols_offd_Z, HYPRE_MEMORY_HOST, + HYPRE_MEMORY_DEVICE); /* Now, we should have everything of Parcsr matrix R */ R = hypre_ParCSRMatrixCreate(comm, @@ -272,11 +354,21 @@ hypre_BoomerAMGBuildRestrNeumannAIRDevice( hypre_ParCSRMatrix *A, /* R_offd is simply a clone of -Z_offd */ hypre_CSRMatrixDestroy(hypre_ParCSRMatrixOffd(R)); hypre_ParCSRMatrixOffd(R) = hypre_CSRMatrixClone(Z_offd, 1); +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::transform, + hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(R)), + hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(R)) + hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixOffd( + R)), + hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(R)), + std::negate() ); +#else HYPRE_THRUST_CALL( transform, hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(R)), - hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(R)) + hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixOffd(R)), + hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(R)) + hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixOffd( + R)), hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(R)), thrust::negate() ); +#endif hypre_ParCSRMatrixColMapOffd(R) = col_map_offd_R; @@ -296,13 +388,15 @@ hypre_BoomerAMGBuildRestrNeumannAIRDevice( hypre_ParCSRMatrix *A, hypre_ParCSRMatrixDestroy(Z); hypre_TFree(Fmap, HYPRE_MEMORY_DEVICE); hypre_TFree(Cmap, HYPRE_MEMORY_DEVICE); + hypre_TFree(Fmap_offd_global, HYPRE_MEMORY_DEVICE); return 0; } /*-----------------------------------------------------------------------*/ __global__ void -hypre_BoomerAMGBuildRestrNeumannAIR_assembleRdiag( HYPRE_Int nr_of_rows, +hypre_BoomerAMGBuildRestrNeumannAIR_assembleRdiag( hypre_DeviceItem &item, + HYPRE_Int nr_of_rows, HYPRE_Int *Fmap, HYPRE_Int *Cmap, HYPRE_Int *Z_diag_i, @@ -323,28 +417,28 @@ hypre_BoomerAMGBuildRestrNeumannAIR_assembleRdiag( HYPRE_Int nr_of_rows, */ /*-----------------------------------------------------------------------*/ - HYPRE_Int i = hypre_cuda_get_grid_warp_id<1,1>(); + HYPRE_Int i = hypre_gpu_get_grid_warp_id<1, 1>(item); if (i >= nr_of_rows) { return; } - HYPRE_Int p, q, pZ; - HYPRE_Int lane = hypre_cuda_get_lane_id<1>(); + HYPRE_Int p = 0, q, pZ = 0; + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); /* diag part */ if (lane < 2) { p = read_only_load(R_diag_i + i + lane); } - q = __shfl_sync(HYPRE_WARP_FULL_MASK, p, 1); - p = __shfl_sync(HYPRE_WARP_FULL_MASK, p, 0); + q = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 1); + p = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 0); if (lane < 1) { pZ = read_only_load(Z_diag_i + i + lane); } - pZ = __shfl_sync(HYPRE_WARP_FULL_MASK, pZ, 0); + pZ = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, pZ, 0); for (HYPRE_Int j = p + lane; j < q; j += HYPRE_WARP_SIZE) { @@ -362,26 +456,39 @@ hypre_BoomerAMGBuildRestrNeumannAIR_assembleRdiag( HYPRE_Int nr_of_rows, } } - -struct setTo1minus1 : public thrust::unary_function +#if !defined(HYPRE_USING_SYCL) +#if (defined(THRUST_VERSION) && THRUST_VERSION < 101000) +struct setTo1minus1 : public thrust::unary_function +#else +struct setTo1minus1 +#endif { - __host__ __device__ HYPRE_Int operator()(const HYPRE_Int &x) const - { - return x > 0 ? 1 : -1; - } + __host__ __device__ HYPRE_Int operator()(const HYPRE_Int &x) const + { + return x > 0 ? 1 : -1; + } }; +#endif HYPRE_Int hypre_BoomerAMGCFMarkerTo1minus1Device( HYPRE_Int *CF_marker, HYPRE_Int size ) { +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::transform, + CF_marker, + CF_marker + size, + CF_marker, + [] (const auto & x) {return x > 0 ? 1 : -1;} ); +#else HYPRE_THRUST_CALL( transform, CF_marker, CF_marker + size, CF_marker, setTo1minus1() ); +#endif return hypre_error_flag; } -#endif // defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#endif // defined(HYPRE_USING_GPU) diff --git a/external/hypre/src/parcsr_ls/par_mgr.c b/external/hypre/src/parcsr_ls/par_mgr.c index 01d9982c..b5bdeb69 100644 --- a/external/hypre/src/parcsr_ls/par_mgr.c +++ b/external/hypre/src/parcsr_ls/par_mgr.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -14,112 +14,144 @@ #include "_hypre_parcsr_ls.h" #include "par_amg.h" #include "par_mgr.h" +#include "_hypre_blas.h" +#include "_hypre_lapack.h" -#ifdef HYPRE_USING_DSUPERLU -#include "dsuperlu.h" -#endif +//#ifdef HYPRE_USING_DSUPERLU +//#include "dsuperlu.h" +//#endif + +/* Need to define these hypre_lapack protos here instead of including _hypre_lapack.h to avoid conflicts with + * dsuperlu.h on some lapack functions. Alternative is to move superLU related functions to a separate file. +*/ +/* dgetrf.c */ +//HYPRE_Int hypre_dgetrf ( HYPRE_Int *m, HYPRE_Int *n, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Int *ipiv, +// HYPRE_Int *info ); +/* dgetri.c */ +//HYPRE_Int hypre_dgetri ( HYPRE_Int *n, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Int *ipiv, +// HYPRE_Real *work, HYPRE_Int *lwork, HYPRE_Int *info); /* Create */ void * -hypre_MGRCreate() +hypre_MGRCreate(void) { - hypre_ParMGRData *mgr_data; - - mgr_data = hypre_CTAlloc(hypre_ParMGRData, 1, HYPRE_MEMORY_HOST); - - /* block data */ - (mgr_data -> block_size) = 1; - (mgr_data -> block_num_coarse_indexes) = NULL; - (mgr_data -> point_marker_array) = NULL; - (mgr_data -> block_cf_marker) = NULL; - - /* general data */ - (mgr_data -> max_num_coarse_levels) = 10; - (mgr_data -> A_array) = NULL; - (mgr_data -> P_array) = NULL; - (mgr_data -> RT_array) = NULL; - (mgr_data -> RAP) = NULL; - (mgr_data -> CF_marker_array) = NULL; - (mgr_data -> coarse_indices_lvls) = NULL; - - (mgr_data -> A_ff_array) = NULL; - (mgr_data -> F_fine_array) = NULL; - (mgr_data -> U_fine_array) = NULL; - (mgr_data -> aff_solver) = NULL; - (mgr_data -> fine_grid_solver_setup) = NULL; - (mgr_data -> fine_grid_solver_solve) = NULL; - - (mgr_data -> F_array) = NULL; - (mgr_data -> U_array) = NULL; - (mgr_data -> residual) = NULL; - (mgr_data -> rel_res_norms) = NULL; - (mgr_data -> Vtemp) = NULL; - (mgr_data -> Ztemp) = NULL; - (mgr_data -> Utemp) = NULL; - (mgr_data -> Ftemp) = NULL; - - (mgr_data -> num_iterations) = 0; - (mgr_data -> num_interp_sweeps) = 1; - (mgr_data -> num_restrict_sweeps) = 1; - (mgr_data -> trunc_factor) = 0.0; - (mgr_data -> max_row_sum) = 0.9; - (mgr_data -> strong_threshold) = 0.25; - (mgr_data -> P_max_elmts) = 0; - - (mgr_data -> coarse_grid_solver) = NULL; - (mgr_data -> coarse_grid_solver_setup) = NULL; - (mgr_data -> coarse_grid_solver_solve) = NULL; - - (mgr_data -> global_smoother) = NULL; - - (mgr_data -> use_default_cgrid_solver) = 1; - (mgr_data -> use_default_fsolver) = -1; // set to -1 to avoid printing when not used - (mgr_data -> omega) = 1.; - (mgr_data -> max_iter) = 20; - (mgr_data -> tol) = 1.0e-6; - (mgr_data -> relax_type) = 0; - (mgr_data -> relax_order) = 1; // not fully utilized. Only used to compute L1-norms. - (mgr_data -> interp_type) = NULL; - (mgr_data -> restrict_type) = NULL; - (mgr_data -> num_relax_sweeps) = 1; - (mgr_data -> relax_weight) = 1.0; - - (mgr_data -> logging) = 0; - (mgr_data -> print_level) = 0; - (mgr_data -> frelax_print_level) = 0; - (mgr_data -> cg_print_level) = 0; - - (mgr_data -> l1_norms) = NULL; - - (mgr_data -> reserved_coarse_size) = 0; - (mgr_data -> reserved_coarse_indexes) = NULL; - (mgr_data -> reserved_Cpoint_local_indexes) = NULL; - - (mgr_data -> diaginv) = NULL; - (mgr_data -> global_smooth_iters) = 1; - (mgr_data -> global_smooth_type) = 0; - - (mgr_data -> set_non_Cpoints_to_F) = 0; - (mgr_data -> idx_array) = NULL; - - (mgr_data -> Frelax_method) = NULL; - (mgr_data -> VcycleRelaxVtemp) = NULL; - (mgr_data -> VcycleRelaxZtemp) = NULL; - (mgr_data -> FrelaxVcycleData) = NULL; - (mgr_data -> Frelax_num_functions) = NULL; - (mgr_data -> max_local_lvls) = 10; - - (mgr_data -> use_non_galerkin_cg) = NULL; - - (mgr_data -> print_coarse_system) = 0; - - (mgr_data -> set_c_points_method) = 0; - (mgr_data -> lvl_to_keep_cpoints) = 0; - (mgr_data -> cg_convergence_factor) = 0.0; - - (mgr_data -> truncate_coarse_grid_threshold) = 0.0; - - return (void *) mgr_data; + hypre_ParMGRData *mgr_data; + + mgr_data = hypre_CTAlloc(hypre_ParMGRData, 1, HYPRE_MEMORY_HOST); + + /* block data */ + (mgr_data -> block_size) = 1; + (mgr_data -> block_num_coarse_indexes) = NULL; + (mgr_data -> point_marker_array) = NULL; + (mgr_data -> block_cf_marker) = NULL; + + /* general data */ + (mgr_data -> max_num_coarse_levels) = 10; + (mgr_data -> A_array) = NULL; + (mgr_data -> B_array) = NULL; + (mgr_data -> B_FF_array) = NULL; +#if defined(HYPRE_USING_GPU) + (mgr_data -> P_FF_array) = NULL; +#endif + (mgr_data -> P_array) = NULL; + (mgr_data -> R_array) = NULL; + (mgr_data -> RT_array) = NULL; + (mgr_data -> RAP) = NULL; + (mgr_data -> CF_marker_array) = NULL; + (mgr_data -> coarse_indices_lvls) = NULL; + + (mgr_data -> A_ff_array) = NULL; + (mgr_data -> F_fine_array) = NULL; + (mgr_data -> U_fine_array) = NULL; + (mgr_data -> aff_solver) = NULL; + (mgr_data -> fine_grid_solver_setup) = NULL; + (mgr_data -> fine_grid_solver_solve) = NULL; + + (mgr_data -> F_array) = NULL; + (mgr_data -> U_array) = NULL; + (mgr_data -> residual) = NULL; + (mgr_data -> rel_res_norms) = NULL; + (mgr_data -> Vtemp) = NULL; + (mgr_data -> Ztemp) = NULL; + (mgr_data -> Utemp) = NULL; + (mgr_data -> Ftemp) = NULL; + + (mgr_data -> num_iterations) = 0; + (mgr_data -> num_interp_sweeps) = 1; + (mgr_data -> num_restrict_sweeps) = 1; + (mgr_data -> trunc_factor) = 0.0; + (mgr_data -> max_row_sum) = 0.9; + (mgr_data -> strong_threshold) = 0.25; + (mgr_data -> P_max_elmts) = NULL; + + (mgr_data -> coarse_grid_solver) = NULL; + (mgr_data -> coarse_grid_solver_setup) = NULL; + (mgr_data -> coarse_grid_solver_solve) = NULL; + + //(mgr_data -> global_smoother) = NULL; + + (mgr_data -> use_default_cgrid_solver) = 1; + (mgr_data -> fsolver_mode) = -1; // user or hypre -prescribed F-solver + (mgr_data -> omega) = 1.; + (mgr_data -> max_iter) = 20; + (mgr_data -> tol) = 1.0e-6; + (mgr_data -> relax_type) = 0; + (mgr_data -> Frelax_type) = NULL; + (mgr_data -> relax_order) = 1; // not fully utilized. Only used to compute L1-norms. + (mgr_data -> num_relax_sweeps) = NULL; + (mgr_data -> relax_weight) = 1.0; + + (mgr_data -> interp_type) = NULL; + (mgr_data -> restrict_type) = NULL; + (mgr_data -> level_smooth_iters) = NULL; + (mgr_data -> level_smooth_type) = NULL; + (mgr_data -> level_smoother) = NULL; + (mgr_data -> global_smooth_cycle) = 1; // Pre = 1 or Post = 2 global smoothing + + (mgr_data -> logging) = 0; + (mgr_data -> print_level) = 0; + (mgr_data -> frelax_print_level) = 0; + (mgr_data -> cg_print_level) = 0; + (mgr_data -> data_path) = NULL; + + (mgr_data -> l1_norms) = NULL; + + (mgr_data -> reserved_coarse_size) = 0; + (mgr_data -> reserved_coarse_indexes) = NULL; + (mgr_data -> reserved_Cpoint_local_indexes) = NULL; + + (mgr_data -> level_diaginv) = NULL; + (mgr_data -> frelax_diaginv) = NULL; + //(mgr_data -> global_smooth_iters) = 1; + //(mgr_data -> global_smooth_type) = 0; + + (mgr_data -> set_non_Cpoints_to_F) = 0; + (mgr_data -> idx_array) = NULL; + + (mgr_data -> Frelax_method) = NULL; + (mgr_data -> VcycleRelaxVtemp) = NULL; + (mgr_data -> VcycleRelaxZtemp) = NULL; + (mgr_data -> FrelaxVcycleData) = NULL; + (mgr_data -> Frelax_num_functions) = NULL; + (mgr_data -> max_local_lvls) = 10; + + (mgr_data -> coarse_grid_method) = NULL; + (mgr_data -> nonglk_max_elmts) = NULL; + + (mgr_data -> print_coarse_system) = 0; + + (mgr_data -> set_c_points_method) = 0; + (mgr_data -> lvl_to_keep_cpoints) = 0; + (mgr_data -> cg_convergence_factor) = 0.0; + + (mgr_data -> block_jacobi_bsize) = 0; + (mgr_data -> blk_size) = NULL; + + (mgr_data -> truncate_coarse_grid_threshold) = 0.0; + + (mgr_data -> GSElimData) = NULL; + + return (void *) mgr_data; } /*-------------------------------------------------------------------------- @@ -128,372 +160,509 @@ hypre_MGRCreate() HYPRE_Int hypre_MGRDestroy( void *data ) { - hypre_ParMGRData * mgr_data = (hypre_ParMGRData*) data; + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) data; + hypre_Solver *aff_base; - HYPRE_Int i; - HYPRE_Int num_coarse_levels = (mgr_data -> num_coarse_levels); - - /* block info data */ - if ((mgr_data -> block_cf_marker)) - { - for (i=0; i < (mgr_data -> max_num_coarse_levels); i++) - { - if ((mgr_data -> block_cf_marker)[i]) + HYPRE_Int i; + HYPRE_Int num_coarse_levels = (mgr_data -> num_coarse_levels); + + /* block info data */ + if ((mgr_data -> block_cf_marker)) + { + for (i = 0; i < (mgr_data -> max_num_coarse_levels); i++) { - hypre_TFree((mgr_data -> block_cf_marker)[i], HYPRE_MEMORY_HOST); + hypre_TFree((mgr_data -> block_cf_marker)[i], HYPRE_MEMORY_HOST); } - } - hypre_TFree((mgr_data -> block_cf_marker), HYPRE_MEMORY_HOST); - (mgr_data -> block_cf_marker) = NULL; - } + hypre_TFree((mgr_data -> block_cf_marker), HYPRE_MEMORY_HOST); + } - if(mgr_data -> block_num_coarse_indexes) - { - hypre_TFree(mgr_data -> block_num_coarse_indexes, HYPRE_MEMORY_HOST); - (mgr_data -> block_num_coarse_indexes) = NULL; - } + hypre_TFree(mgr_data -> block_num_coarse_indexes, HYPRE_MEMORY_HOST); - /* final residual vector */ - if((mgr_data -> residual)) - { - hypre_ParVectorDestroy( (mgr_data -> residual) ); - (mgr_data -> residual) = NULL; - } - if((mgr_data -> rel_res_norms)) - { - hypre_TFree( (mgr_data -> rel_res_norms) , HYPRE_MEMORY_HOST); - (mgr_data -> rel_res_norms) = NULL; - } - /* temp vectors for solve phase */ - if((mgr_data -> Vtemp)) - { - hypre_ParVectorDestroy( (mgr_data -> Vtemp) ); - (mgr_data -> Vtemp) = NULL; - } - if((mgr_data -> Ztemp)) - { - hypre_ParVectorDestroy( (mgr_data -> Ztemp) ); - (mgr_data -> Ztemp) = NULL; - } - if((mgr_data -> Utemp)) - { - hypre_ParVectorDestroy( (mgr_data -> Utemp) ); - (mgr_data -> Utemp) = NULL; - } - if((mgr_data -> Ftemp)) - { - hypre_ParVectorDestroy( (mgr_data -> Ftemp) ); - (mgr_data -> Ftemp) = NULL; - } - /* coarse grid solver */ - if((mgr_data -> use_default_cgrid_solver)) - { - if((mgr_data -> coarse_grid_solver)) - { - hypre_BoomerAMGDestroy( (mgr_data -> coarse_grid_solver) ); - } - (mgr_data -> coarse_grid_solver) = NULL; - } - /* l1_norms */ - if ((mgr_data -> l1_norms)) - { - for (i=0; i < (num_coarse_levels); i++) - { - hypre_SeqVectorDestroy((mgr_data -> l1_norms)[i]); - } - hypre_TFree((mgr_data -> l1_norms), HYPRE_MEMORY_HOST); - } + /* final residual vector */ + if ((mgr_data -> residual)) + { + hypre_ParVectorDestroy( (mgr_data -> residual) ); + (mgr_data -> residual) = NULL; + } - /* coarse_indices_lvls */ - if ((mgr_data -> coarse_indices_lvls)) - { - for (i=0; i < (num_coarse_levels); i++) - if ((mgr_data -> coarse_indices_lvls)[i]) - hypre_TFree((mgr_data -> coarse_indices_lvls)[i], HYPRE_MEMORY_HOST); - hypre_TFree((mgr_data -> coarse_indices_lvls), HYPRE_MEMORY_HOST); - } + hypre_TFree( (mgr_data -> rel_res_norms), HYPRE_MEMORY_HOST); - /* linear system and cf marker array */ - if(mgr_data -> A_array || mgr_data -> P_array || mgr_data -> RT_array || mgr_data -> CF_marker_array) - { - for (i=1; i < num_coarse_levels+1; i++) { - hypre_ParVectorDestroy((mgr_data -> F_array)[i]); - hypre_ParVectorDestroy((mgr_data -> U_array)[i]); - - if ((mgr_data -> P_array)[i-1]) - hypre_ParCSRMatrixDestroy((mgr_data -> P_array)[i-1]); - - if ((mgr_data -> RT_array)[i-1]) - hypre_ParCSRMatrixDestroy((mgr_data -> RT_array)[i-1]); - - hypre_IntArrayDestroy(mgr_data -> CF_marker_array[i-1]); - } - for (i=1; i < (num_coarse_levels); i++) { - if ((mgr_data -> A_array)[i]) - hypre_ParCSRMatrixDestroy((mgr_data -> A_array)[i]); - } - } + /* temp vectors for solve phase */ + if ((mgr_data -> Vtemp)) + { + hypre_ParVectorDestroy( (mgr_data -> Vtemp) ); + (mgr_data -> Vtemp) = NULL; + } + if ((mgr_data -> Ztemp)) + { + hypre_ParVectorDestroy( (mgr_data -> Ztemp) ); + (mgr_data -> Ztemp) = NULL; + } + if ((mgr_data -> Utemp)) + { + hypre_ParVectorDestroy( (mgr_data -> Utemp) ); + (mgr_data -> Utemp) = NULL; + } + if ((mgr_data -> Ftemp)) + { + hypre_ParVectorDestroy( (mgr_data -> Ftemp) ); + (mgr_data -> Ftemp) = NULL; + } + /* coarse grid solver */ + if ((mgr_data -> use_default_cgrid_solver)) + { + if ((mgr_data -> coarse_grid_solver)) + { + hypre_BoomerAMGDestroy( (mgr_data -> coarse_grid_solver) ); + } + (mgr_data -> coarse_grid_solver) = NULL; + } + /* l1_norms */ + if ((mgr_data -> l1_norms)) + { + for (i = 0; i < (num_coarse_levels); i++) + { + hypre_SeqVectorDestroy((mgr_data -> l1_norms)[i]); + } + hypre_TFree((mgr_data -> l1_norms), HYPRE_MEMORY_HOST); + } - /* AMG for Frelax */ - if(mgr_data -> A_ff_array || mgr_data -> F_fine_array || mgr_data -> U_fine_array) - { - for (i=1; i < num_coarse_levels+1; i++) - { - if (mgr_data -> F_fine_array[i]) - hypre_ParVectorDestroy((mgr_data -> F_fine_array)[i]); - if (mgr_data -> U_fine_array[i]) - hypre_ParVectorDestroy((mgr_data -> U_fine_array)[i]); - } - for (i=1; i < (num_coarse_levels); i++) - { - if ((mgr_data -> A_ff_array)[i]) - hypre_ParCSRMatrixDestroy((mgr_data -> A_ff_array)[i]); - } - if (mgr_data -> use_default_fsolver) - { - hypre_ParCSRMatrixDestroy((mgr_data -> A_ff_array)[0]); - } - hypre_TFree(mgr_data -> F_fine_array, HYPRE_MEMORY_HOST); - (mgr_data -> F_fine_array) = NULL; - hypre_TFree(mgr_data -> U_fine_array, HYPRE_MEMORY_HOST); - (mgr_data -> U_fine_array) = NULL; - hypre_TFree(mgr_data -> A_ff_array, HYPRE_MEMORY_HOST); - (mgr_data -> A_ff_array) = NULL; - } + /* coarse_indices_lvls */ + if ((mgr_data -> coarse_indices_lvls)) + { + for (i = 0; i < (num_coarse_levels); i++) + { + hypre_TFree((mgr_data -> coarse_indices_lvls)[i], HYPRE_MEMORY_HOST); + } + hypre_TFree((mgr_data -> coarse_indices_lvls), HYPRE_MEMORY_HOST); + } - if(mgr_data -> aff_solver) - { - for (i = 1; i < (num_coarse_levels); i++) { - if ((mgr_data -> aff_solver)[i]) - hypre_BoomerAMGDestroy((mgr_data -> aff_solver)[i]); - } - if (mgr_data -> use_default_fsolver) - { - if ((mgr_data -> aff_solver)[0]) - hypre_BoomerAMGDestroy((mgr_data -> aff_solver)[0]); - } - hypre_TFree(mgr_data -> aff_solver, HYPRE_MEMORY_HOST); - (mgr_data -> aff_solver) = NULL; - } + /* linear system and cf marker array */ + if (mgr_data -> A_array || mgr_data -> P_array || + mgr_data -> RT_array || mgr_data -> R_array || + mgr_data -> CF_marker_array) + { + for (i = 1; i < num_coarse_levels + 1; i++) + { + hypre_ParVectorDestroy((mgr_data -> F_array)[i]); + hypre_ParVectorDestroy((mgr_data -> U_array)[i]); - if((mgr_data -> F_array)) - { - hypre_TFree((mgr_data -> F_array), HYPRE_MEMORY_HOST); - (mgr_data -> F_array) = NULL; - } - if((mgr_data -> U_array)) - { - hypre_TFree((mgr_data -> U_array), HYPRE_MEMORY_HOST); - (mgr_data -> U_array) = NULL; - } - if((mgr_data -> A_array)) - { - hypre_TFree((mgr_data -> A_array), HYPRE_MEMORY_HOST); - (mgr_data -> A_array) = NULL; - } - if((mgr_data -> P_array)) - { - hypre_TFree((mgr_data -> P_array), HYPRE_MEMORY_HOST); - (mgr_data -> P_array) = NULL; - } - if((mgr_data -> RT_array)) - { - hypre_TFree((mgr_data -> RT_array), HYPRE_MEMORY_HOST); - (mgr_data -> RT_array) = NULL; - } - if((mgr_data -> CF_marker_array)) - { - hypre_TFree((mgr_data -> CF_marker_array), HYPRE_MEMORY_HOST); - (mgr_data -> CF_marker_array) = NULL; - } - if((mgr_data -> reserved_Cpoint_local_indexes)) - { - hypre_TFree((mgr_data -> reserved_Cpoint_local_indexes), HYPRE_MEMORY_HOST); - (mgr_data -> reserved_Cpoint_local_indexes) = NULL; - } - if (mgr_data -> restrict_type) - { - hypre_TFree(mgr_data -> restrict_type, HYPRE_MEMORY_HOST); - (mgr_data -> restrict_type) = NULL; - } - if (mgr_data -> interp_type) - { - hypre_TFree(mgr_data -> interp_type, HYPRE_MEMORY_HOST); - (mgr_data -> interp_type) = NULL; - } - /* Frelax_method */ - if (mgr_data -> Frelax_method) - { - hypre_TFree(mgr_data -> Frelax_method, HYPRE_MEMORY_HOST); - (mgr_data -> Frelax_method) = NULL; - } - /* Frelax_num_functions */ - if (mgr_data -> Frelax_num_functions) - { - hypre_TFree(mgr_data -> Frelax_num_functions, HYPRE_MEMORY_HOST); - (mgr_data -> Frelax_num_functions) = NULL; - } - /* data for V-cycle F-relaxation */ - if((mgr_data -> VcycleRelaxVtemp)) - { - hypre_ParVectorDestroy( (mgr_data -> VcycleRelaxVtemp) ); - (mgr_data -> VcycleRelaxVtemp) = NULL; - } - if((mgr_data -> VcycleRelaxZtemp)) - { - hypre_ParVectorDestroy( (mgr_data -> VcycleRelaxZtemp) ); - (mgr_data -> VcycleRelaxZtemp) = NULL; - } - if (mgr_data -> FrelaxVcycleData) { - for (i = 0; i < num_coarse_levels; i++) { - if ((mgr_data -> FrelaxVcycleData)[i]) { - hypre_MGRDestroyFrelaxVcycleData((mgr_data -> FrelaxVcycleData)[i]); - (mgr_data -> FrelaxVcycleData)[i] = NULL; + if ((mgr_data -> P_array)[i - 1]) + { + hypre_ParCSRMatrixDestroy((mgr_data -> P_array)[i - 1]); + } + + if ((mgr_data -> R_array)[i - 1]) + { + hypre_ParCSRMatrixDestroy((mgr_data -> R_array)[i - 1]); + } + + if ((mgr_data -> RT_array)[i - 1]) + { + hypre_ParCSRMatrixDestroy((mgr_data -> RT_array)[i - 1]); + } + + hypre_IntArrayDestroy(mgr_data -> CF_marker_array[i - 1]); } - } - hypre_TFree(mgr_data -> FrelaxVcycleData, HYPRE_MEMORY_HOST); - (mgr_data -> FrelaxVcycleData) = NULL; - } - /* data for reserved coarse nodes */ - if(mgr_data -> reserved_coarse_indexes) - { - hypre_TFree(mgr_data -> reserved_coarse_indexes, HYPRE_MEMORY_HOST); - (mgr_data -> reserved_coarse_indexes) = NULL; - } - /* index array for setting Cpoints by global block */ - if ((mgr_data -> set_c_points_method) == 1) - { - hypre_TFree(mgr_data -> idx_array, HYPRE_MEMORY_HOST); - (mgr_data -> idx_array) = NULL; - } - /* array for setting option to use non-Galerkin coarse grid */ - if (mgr_data -> use_non_galerkin_cg) - { - hypre_TFree(mgr_data -> use_non_galerkin_cg, HYPRE_MEMORY_HOST); - (mgr_data -> use_non_galerkin_cg) = NULL; - } - /* coarse level matrix - RAP */ - if ((mgr_data -> RAP)) - hypre_ParCSRMatrixDestroy((mgr_data -> RAP)); - if ((mgr_data -> diaginv)) - hypre_TFree((mgr_data -> diaginv), HYPRE_MEMORY_HOST); - if ((mgr_data -> global_smoother)) - { - if (mgr_data -> global_smooth_type == 8) - { - HYPRE_EuclidDestroy((mgr_data -> global_smoother)); - } - else if (mgr_data -> global_smooth_type == 16) - { - HYPRE_ILUDestroy((mgr_data -> global_smoother)); - } - } - /* mgr data */ - hypre_TFree(mgr_data, HYPRE_MEMORY_HOST); + for (i = 1; i < (num_coarse_levels); i++) + { + if ((mgr_data -> A_array)[i]) + { + hypre_ParCSRMatrixDestroy((mgr_data -> A_array)[i]); + } + } + } + + /* Block relaxation/interpolation matrices */ + if (hypre_ParMGRDataBArray(mgr_data)) + { + for (i = 0; i < num_coarse_levels; i++) + { + hypre_ParCSRMatrixDestroy(hypre_ParMGRDataB(mgr_data, i)); + } + } + + if (hypre_ParMGRDataBFFArray(mgr_data)) + { + for (i = 0; i < num_coarse_levels; i++) + { + hypre_ParCSRMatrixDestroy(hypre_ParMGRDataBFF(mgr_data, i)); + } + } + +#if defined(HYPRE_USING_GPU) + if (mgr_data -> P_FF_array) + { + for (i = 0; i < num_coarse_levels; i++) + { + if ((mgr_data -> P_array)[i]) + { + hypre_ParCSRMatrixDestroy((mgr_data -> P_FF_array)[i]); + } + } + //hypre_TFree(P_FF_array, hypre_HandleMemoryLocation(hypre_handle())); + hypre_TFree((mgr_data -> P_FF_array), HYPRE_MEMORY_HOST); + (mgr_data -> P_FF_array) = NULL; + } +#endif + + /* AMG for Frelax */ + if (mgr_data -> A_ff_array || mgr_data -> F_fine_array || mgr_data -> U_fine_array) + { + for (i = 1; i < num_coarse_levels + 1; i++) + { + if (mgr_data -> F_fine_array[i]) + { + hypre_ParVectorDestroy((mgr_data -> F_fine_array)[i]); + } + if (mgr_data -> U_fine_array[i]) + { + hypre_ParVectorDestroy((mgr_data -> U_fine_array)[i]); + } + } + for (i = 1; i < (num_coarse_levels); i++) + { + if ((mgr_data -> A_ff_array)[i]) + { + hypre_ParCSRMatrixDestroy((mgr_data -> A_ff_array)[i]); + } + } + if (mgr_data -> fsolver_mode != 0) + { + if ((mgr_data -> A_ff_array)[0]) + { + hypre_ParCSRMatrixDestroy((mgr_data -> A_ff_array)[0]); + } + } + hypre_TFree(mgr_data -> F_fine_array, HYPRE_MEMORY_HOST); + (mgr_data -> F_fine_array) = NULL; + hypre_TFree(mgr_data -> U_fine_array, HYPRE_MEMORY_HOST); + (mgr_data -> U_fine_array) = NULL; + hypre_TFree(mgr_data -> A_ff_array, HYPRE_MEMORY_HOST); + (mgr_data -> A_ff_array) = NULL; + } + + if (mgr_data -> aff_solver) + { + for (i = 1; i < (num_coarse_levels); i++) + { + if ((mgr_data -> aff_solver)[i]) + { + aff_base = (hypre_Solver*) (mgr_data -> aff_solver)[i]; + hypre_SolverDestroy(aff_base)((HYPRE_Solver) (aff_base)); + } + } + if (mgr_data -> fsolver_mode == 2) + { + hypre_BoomerAMGDestroy((mgr_data -> aff_solver)[0]); + } + hypre_TFree(mgr_data -> aff_solver, HYPRE_MEMORY_HOST); + (mgr_data -> aff_solver) = NULL; + } + + if (mgr_data -> level_diaginv) + { + for (i = 0; i < (num_coarse_levels); i++) + { + hypre_TFree((mgr_data -> level_diaginv)[i], HYPRE_MEMORY_HOST); + } + hypre_TFree(mgr_data -> level_diaginv, HYPRE_MEMORY_HOST); + } - return hypre_error_flag; + if (mgr_data -> frelax_diaginv) + { + for (i = 0; i < (num_coarse_levels); i++) + { + hypre_TFree((mgr_data -> frelax_diaginv)[i], HYPRE_MEMORY_HOST); + } + hypre_TFree(mgr_data -> frelax_diaginv, HYPRE_MEMORY_HOST); + } + hypre_TFree((mgr_data -> F_array), HYPRE_MEMORY_HOST); + hypre_TFree((mgr_data -> U_array), HYPRE_MEMORY_HOST); + hypre_TFree((mgr_data -> A_array), HYPRE_MEMORY_HOST); + hypre_TFree((mgr_data -> B_array), HYPRE_MEMORY_HOST); + hypre_TFree((mgr_data -> B_FF_array), HYPRE_MEMORY_HOST); + hypre_TFree((mgr_data -> P_array), HYPRE_MEMORY_HOST); + hypre_TFree((mgr_data -> R_array), HYPRE_MEMORY_HOST); + hypre_TFree((mgr_data -> RT_array), HYPRE_MEMORY_HOST); + hypre_TFree((mgr_data -> CF_marker_array), HYPRE_MEMORY_HOST); + hypre_TFree((mgr_data -> reserved_Cpoint_local_indexes), HYPRE_MEMORY_HOST); + hypre_TFree((mgr_data -> restrict_type), HYPRE_MEMORY_HOST); + hypre_TFree((mgr_data -> interp_type), HYPRE_MEMORY_HOST); + hypre_TFree((mgr_data -> P_max_elmts), HYPRE_MEMORY_HOST); + /* Frelax_type */ + hypre_TFree(mgr_data -> Frelax_type, HYPRE_MEMORY_HOST); + /* Frelax_method */ + hypre_TFree(mgr_data -> Frelax_method, HYPRE_MEMORY_HOST); + /* Frelax_num_functions */ + hypre_TFree(mgr_data -> Frelax_num_functions, HYPRE_MEMORY_HOST); + + /* data for V-cycle F-relaxation */ + if ((mgr_data -> VcycleRelaxVtemp)) + { + hypre_ParVectorDestroy( (mgr_data -> VcycleRelaxVtemp) ); + (mgr_data -> VcycleRelaxVtemp) = NULL; + } + if ((mgr_data -> VcycleRelaxZtemp)) + { + hypre_ParVectorDestroy( (mgr_data -> VcycleRelaxZtemp) ); + (mgr_data -> VcycleRelaxZtemp) = NULL; + } + if (mgr_data -> FrelaxVcycleData) + { + for (i = 0; i < num_coarse_levels; i++) + { + hypre_MGRDestroyFrelaxVcycleData((mgr_data -> FrelaxVcycleData)[i]); + } + hypre_TFree(mgr_data -> FrelaxVcycleData, HYPRE_MEMORY_HOST); + } + + /* data for reserved coarse nodes */ + hypre_TFree(mgr_data -> reserved_coarse_indexes, HYPRE_MEMORY_HOST); + + /* index array for setting Cpoints by global block */ + if ((mgr_data -> set_c_points_method) == 1) + { + hypre_TFree(mgr_data -> idx_array, HYPRE_MEMORY_HOST); + } + + /* Coarse grid options */ + hypre_TFree(mgr_data -> coarse_grid_method, HYPRE_MEMORY_HOST); + hypre_TFree(mgr_data -> nonglk_max_elmts, HYPRE_MEMORY_HOST); + + /* coarsest level matrix - RAP */ + if ((mgr_data -> RAP)) + { + hypre_ParCSRMatrixDestroy((mgr_data -> RAP)); + } + + if ((mgr_data -> level_smoother) != NULL) + { + for (i = 0; i < num_coarse_levels; i++) + { + if ((mgr_data -> level_smooth_iters)[i] > 0) + { + if ((mgr_data -> level_smooth_type)[i] == 8) + { + HYPRE_EuclidDestroy((mgr_data -> level_smoother)[i]); + } + else if ((mgr_data -> level_smooth_type)[i] == 16) + { + HYPRE_ILUDestroy((mgr_data -> level_smoother)[i]); + } + else if ((mgr_data -> level_smoother)[i]) + { + hypre_Solver *smoother_base = (hypre_Solver*) (mgr_data -> level_smoother)[i]; + hypre_SolverDestroy(smoother_base)((mgr_data -> level_smoother)[i]); + } + } + } + hypre_TFree(mgr_data -> level_smoother, HYPRE_MEMORY_HOST); + } + + /* free level data */ + hypre_TFree(mgr_data -> blk_size, HYPRE_MEMORY_HOST); + hypre_TFree(mgr_data -> level_smooth_type, HYPRE_MEMORY_HOST); + hypre_TFree(mgr_data -> level_smooth_iters, HYPRE_MEMORY_HOST); + hypre_TFree(mgr_data -> num_relax_sweeps, HYPRE_MEMORY_HOST); + + if (mgr_data -> GSElimData) + { + for (i = 0; i < num_coarse_levels; i++) + { + if ((mgr_data -> GSElimData)[i]) + { + hypre_MGRDestroyGSElimData((mgr_data -> GSElimData)[i]); + (mgr_data -> GSElimData)[i] = NULL; + } + } + hypre_TFree(mgr_data -> GSElimData, HYPRE_MEMORY_HOST); + } + + /* Free the data path filename */ + hypre_TFree(mgr_data -> data_path, HYPRE_MEMORY_HOST); + + /* mgr data */ + hypre_TFree(mgr_data, HYPRE_MEMORY_HOST); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_MGRCreateGSElimData + * + * Create data for Gaussian Elimination for F-relaxation. + *--------------------------------------------------------------------------*/ + +void * +hypre_MGRCreateGSElimData( void ) +{ + hypre_ParAMGData *gsdata = hypre_CTAlloc(hypre_ParAMGData, 1, HYPRE_MEMORY_HOST); + + hypre_ParAMGDataGSSetup(gsdata) = 0; + hypre_ParAMGDataGEMemoryLocation(gsdata) = HYPRE_MEMORY_UNDEFINED; + hypre_ParAMGDataNewComm(gsdata) = hypre_MPI_COMM_NULL; + hypre_ParAMGDataCommInfo(gsdata) = NULL; + hypre_ParAMGDataAMat(gsdata) = NULL; + hypre_ParAMGDataAWork(gsdata) = NULL; + hypre_ParAMGDataAPiv(gsdata) = NULL; + hypre_ParAMGDataBVec(gsdata) = NULL; + hypre_ParAMGDataUVec(gsdata) = NULL; + + return (void *) gsdata; +} + +/*-------------------------------------------------------------------------- + * hypre_MGRDestroyGSElimData + * + * Destroy data for Gaussian Elimination for F-relaxation. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRDestroyGSElimData( void *data ) +{ + hypre_ParAMGData *gsdata = (hypre_ParAMGData*) data; + MPI_Comm new_comm = hypre_ParAMGDataNewComm(gsdata); + +#if defined(HYPRE_USING_MAGMA) + hypre_TFree(hypre_ParAMGDataAPiv(gsdata), HYPRE_MEMORY_HOST); +#else + hypre_TFree(hypre_ParAMGDataAPiv(gsdata), hypre_ParAMGDataGEMemoryLocation(gsdata)); +#endif + hypre_TFree(hypre_ParAMGDataAMat(gsdata), hypre_ParAMGDataGEMemoryLocation(gsdata)); + hypre_TFree(hypre_ParAMGDataAWork(gsdata), hypre_ParAMGDataGEMemoryLocation(gsdata)); + hypre_TFree(hypre_ParAMGDataBVec(gsdata), hypre_ParAMGDataGEMemoryLocation(gsdata)); + hypre_TFree(hypre_ParAMGDataUVec(gsdata), hypre_ParAMGDataGEMemoryLocation(gsdata)); + hypre_TFree(hypre_ParAMGDataCommInfo(gsdata), HYPRE_MEMORY_HOST); + + if (new_comm != hypre_MPI_COMM_NULL) + { + hypre_MPI_Comm_free(&new_comm); + } + + hypre_TFree(gsdata, HYPRE_MEMORY_HOST); + + return hypre_error_flag; } /* Create data for V-cycle F-relaxtion */ void * -hypre_MGRCreateFrelaxVcycleData() +hypre_MGRCreateFrelaxVcycleData( void ) { - hypre_ParAMGData *vdata = hypre_CTAlloc(hypre_ParAMGData, 1, HYPRE_MEMORY_HOST); - - hypre_ParAMGDataAArray(vdata) = NULL; - hypre_ParAMGDataPArray(vdata) = NULL; - hypre_ParAMGDataFArray(vdata) = NULL; - hypre_ParAMGDataCFMarkerArray(vdata) = NULL; - hypre_ParAMGDataVtemp(vdata) = NULL; - hypre_ParAMGDataAMat(vdata) = NULL; - hypre_ParAMGDataBVec(vdata) = NULL; - hypre_ParAMGDataZtemp(vdata) = NULL; - hypre_ParAMGDataCommInfo(vdata) = NULL; - hypre_ParAMGDataUArray(vdata) = NULL; - hypre_ParAMGDataNewComm(vdata) = hypre_MPI_COMM_NULL; - hypre_ParAMGDataNumLevels(vdata) = 0; - hypre_ParAMGDataMaxLevels(vdata) = 10; - hypre_ParAMGDataNumFunctions(vdata) = 1; - hypre_ParAMGDataSCommPkgSwitch(vdata) = 1.0; - hypre_ParAMGDataRelaxOrder(vdata) = 1; - hypre_ParAMGDataMaxCoarseSize(vdata) = 9; - hypre_ParAMGDataMinCoarseSize(vdata) = 0; - hypre_ParAMGDataUserCoarseRelaxType(vdata) = 9; - - return (void *) vdata; + hypre_ParAMGData *vdata = hypre_CTAlloc(hypre_ParAMGData, 1, HYPRE_MEMORY_HOST); + + hypre_ParAMGDataAArray(vdata) = NULL; + hypre_ParAMGDataPArray(vdata) = NULL; + hypre_ParAMGDataFArray(vdata) = NULL; + hypre_ParAMGDataCFMarkerArray(vdata) = NULL; + hypre_ParAMGDataVtemp(vdata) = NULL; + // hypre_ParAMGDataAMat(vdata) = NULL; + // hypre_ParAMGDataBVec(vdata) = NULL; + hypre_ParAMGDataZtemp(vdata) = NULL; + // hypre_ParAMGDataCommInfo(vdata) = NULL; + hypre_ParAMGDataUArray(vdata) = NULL; + hypre_ParAMGDataNewComm(vdata) = hypre_MPI_COMM_NULL; + hypre_ParAMGDataNumLevels(vdata) = 0; + hypre_ParAMGDataMaxLevels(vdata) = 10; + hypre_ParAMGDataNumFunctions(vdata) = 1; + hypre_ParAMGDataSCommPkgSwitch(vdata) = 1.0; + hypre_ParAMGDataRelaxOrder(vdata) = 1; + hypre_ParAMGDataMaxCoarseSize(vdata) = 9; + hypre_ParAMGDataMinCoarseSize(vdata) = 0; + hypre_ParAMGDataUserCoarseRelaxType(vdata) = 9; + + /* Gaussian Elim data */ + hypre_ParAMGDataGSSetup(vdata) = 0; + hypre_ParAMGDataAMat(vdata) = NULL; + hypre_ParAMGDataAWork(vdata) = NULL; + hypre_ParAMGDataBVec(vdata) = NULL; + hypre_ParAMGDataCommInfo(vdata) = NULL; + + return (void *) vdata; } /* Destroy data for V-cycle F-relaxation */ HYPRE_Int hypre_MGRDestroyFrelaxVcycleData( void *data ) { - hypre_ParAMGData * vdata = (hypre_ParAMGData*) data; - HYPRE_Int i; - HYPRE_Int num_levels = hypre_ParAMGDataNumLevels(vdata); - MPI_Comm new_comm = hypre_ParAMGDataNewComm(vdata); - - hypre_TFree(hypre_ParAMGDataDofFuncArray(vdata)[0], HYPRE_MEMORY_HOST); - for (i=1; i < num_levels + 1; i++) - { - if (hypre_ParAMGDataAArray(vdata)[i]) - hypre_ParCSRMatrixDestroy(hypre_ParAMGDataAArray(vdata)[i]); - - if (hypre_ParAMGDataPArray(vdata)[i-1]) - hypre_ParCSRMatrixDestroy(hypre_ParAMGDataPArray(vdata)[i-1]); - - hypre_IntArrayDestroy(hypre_ParAMGDataCFMarkerArray(vdata)[i-1]); - hypre_ParVectorDestroy(hypre_ParAMGDataFArray(vdata)[i]); - hypre_ParVectorDestroy(hypre_ParAMGDataUArray(vdata)[i]); - hypre_TFree(hypre_ParAMGDataDofFuncArray(vdata)[i], HYPRE_MEMORY_HOST); - } + hypre_ParAMGData * vdata = (hypre_ParAMGData*) data; + HYPRE_Int i; + HYPRE_Int num_levels = hypre_ParAMGDataNumLevels(vdata); + MPI_Comm new_comm = hypre_ParAMGDataNewComm(vdata); - if (num_levels < 1) - { - hypre_IntArrayDestroy(hypre_ParAMGDataCFMarkerArray(vdata)[0]); - } + hypre_TFree(hypre_ParAMGDataDofFuncArray(vdata)[0], HYPRE_MEMORY_HOST); + for (i = 1; i < num_levels + 1; i++) + { + if (hypre_ParAMGDataAArray(vdata)[i]) + { + hypre_ParCSRMatrixDestroy(hypre_ParAMGDataAArray(vdata)[i]); + } - /* Points to VcycleRelaxVtemp of mgr_data, which is already destroyed */ - //hypre_ParVectorDestroy(hypre_ParAMGDataVtemp(vdata)); - hypre_TFree(hypre_ParAMGDataFArray(vdata), HYPRE_MEMORY_HOST); - hypre_TFree(hypre_ParAMGDataUArray(vdata), HYPRE_MEMORY_HOST); - hypre_TFree(hypre_ParAMGDataAArray(vdata), HYPRE_MEMORY_HOST); - hypre_TFree(hypre_ParAMGDataPArray(vdata), HYPRE_MEMORY_HOST); - hypre_TFree(hypre_ParAMGDataCFMarkerArray(vdata), HYPRE_MEMORY_HOST); - //hypre_TFree(hypre_ParAMGDataGridRelaxType(vdata), HYPRE_MEMORY_HOST); - hypre_TFree(hypre_ParAMGDataDofFuncArray(vdata), HYPRE_MEMORY_HOST); - - /* Points to VcycleRelaxZtemp of mgr_data, which is already destroyed */ - /* - if (hypre_ParAMGDataZtemp(vdata)) - hypre_ParVectorDestroy(hypre_ParAMGDataZtemp(vdata)); - */ - - if (hypre_ParAMGDataAMat(vdata)) hypre_TFree(hypre_ParAMGDataAMat(vdata), HYPRE_MEMORY_HOST); - if (hypre_ParAMGDataBVec(vdata)) hypre_TFree(hypre_ParAMGDataBVec(vdata), HYPRE_MEMORY_HOST); - if (hypre_ParAMGDataCommInfo(vdata)) hypre_TFree(hypre_ParAMGDataCommInfo(vdata), HYPRE_MEMORY_HOST); - - if (new_comm != hypre_MPI_COMM_NULL) - { - hypre_MPI_Comm_free (&new_comm); - } - hypre_TFree(vdata, HYPRE_MEMORY_HOST); + if (hypre_ParAMGDataPArray(vdata)[i - 1]) + { + hypre_ParCSRMatrixDestroy(hypre_ParAMGDataPArray(vdata)[i - 1]); + } + + hypre_IntArrayDestroy(hypre_ParAMGDataCFMarkerArray(vdata)[i - 1]); + hypre_ParVectorDestroy(hypre_ParAMGDataFArray(vdata)[i]); + hypre_ParVectorDestroy(hypre_ParAMGDataUArray(vdata)[i]); + hypre_TFree(hypre_ParAMGDataDofFuncArray(vdata)[i], HYPRE_MEMORY_HOST); + } + + if (num_levels < 1) + { + hypre_IntArrayDestroy(hypre_ParAMGDataCFMarkerArray(vdata)[0]); + } + + /* Points to VcycleRelaxVtemp of mgr_data, which is already destroyed */ + //hypre_ParVectorDestroy(hypre_ParAMGDataVtemp(vdata)); + hypre_TFree(hypre_ParAMGDataFArray(vdata), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_ParAMGDataUArray(vdata), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_ParAMGDataAArray(vdata), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_ParAMGDataPArray(vdata), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_ParAMGDataCFMarkerArray(vdata), HYPRE_MEMORY_HOST); + //hypre_TFree(hypre_ParAMGDataGridRelaxType(vdata), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_ParAMGDataDofFuncArray(vdata), HYPRE_MEMORY_HOST); + + /* Points to VcycleRelaxZtemp of mgr_data, which is already destroyed */ + /* + if (hypre_ParAMGDataZtemp(vdata)) + hypre_ParVectorDestroy(hypre_ParAMGDataZtemp(vdata)); + */ + +#if defined(HYPRE_USING_MAGMA) + hypre_TFree(hypre_ParAMGDataAPiv(vdata), HYPRE_MEMORY_HOST); +#else + hypre_TFree(hypre_ParAMGDataAPiv(vdata), hypre_ParAMGDataGEMemoryLocation(vdata)); +#endif + hypre_TFree(hypre_ParAMGDataAMat(vdata), hypre_ParAMGDataGEMemoryLocation(vdata)); + hypre_TFree(hypre_ParAMGDataAWork(vdata), hypre_ParAMGDataGEMemoryLocation(vdata)); + hypre_TFree(hypre_ParAMGDataBVec(vdata), hypre_ParAMGDataGEMemoryLocation(vdata)); + hypre_TFree(hypre_ParAMGDataUVec(vdata), hypre_ParAMGDataGEMemoryLocation(vdata)); + hypre_TFree(hypre_ParAMGDataCommInfo(vdata), HYPRE_MEMORY_HOST); + + if (new_comm != hypre_MPI_COMM_NULL) + { + hypre_MPI_Comm_free (&new_comm); + } + hypre_TFree(vdata, HYPRE_MEMORY_HOST); - return hypre_error_flag; + return hypre_error_flag; } /* Set C-point variables for each reduction level */ /* Currently not implemented */ HYPRE_Int hypre_MGRSetReductionLevelCpoints( void *mgr_vdata, - HYPRE_Int nlevels, - HYPRE_Int *num_coarse_points, - HYPRE_Int **level_coarse_indexes) + HYPRE_Int nlevels, + HYPRE_Int *num_coarse_points, + HYPRE_Int **level_coarse_indexes) { - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; - (mgr_data -> num_coarse_levels) = nlevels; - (mgr_data -> num_coarse_per_level) = num_coarse_points; - (mgr_data -> level_coarse_indexes) = level_coarse_indexes; - return hypre_error_flag; + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + (mgr_data -> num_coarse_levels) = nlevels; + (mgr_data -> num_coarse_per_level) = num_coarse_points; + (mgr_data -> level_coarse_indexes) = level_coarse_indexes; + return hypre_error_flag; } /* Initialize some data */ @@ -501,3672 +670,2061 @@ hypre_MGRSetReductionLevelCpoints( void *mgr_vdata, HYPRE_Int hypre_MGRSetNonCpointsToFpoints( void *mgr_vdata, HYPRE_Int nonCptToFptFlag) { - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; - (mgr_data -> set_non_Cpoints_to_F) = nonCptToFptFlag; + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + (mgr_data -> set_non_Cpoints_to_F) = nonCptToFptFlag; - return hypre_error_flag; + return hypre_error_flag; } /* Set whether the reserved C points are reduced before the coarse grid solve */ HYPRE_Int hypre_MGRSetReservedCpointsLevelToKeep(void *mgr_vdata, HYPRE_Int level) { - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; - (mgr_data -> lvl_to_keep_cpoints) = level; + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + (mgr_data -> lvl_to_keep_cpoints) = level; - return hypre_error_flag; + return hypre_error_flag; } /* Set Cpoints by contiguous blocks, i.e. p1, p2, ..., pn, s1, s2, ..., sn, ... */ HYPRE_Int hypre_MGRSetCpointsByContiguousBlock( void *mgr_vdata, - HYPRE_Int block_size, - HYPRE_Int max_num_levels, - HYPRE_BigInt *begin_idx_array, - HYPRE_Int *block_num_coarse_points, - HYPRE_Int **block_coarse_indexes) + HYPRE_Int block_size, + HYPRE_Int max_num_levels, + HYPRE_BigInt *begin_idx_array, + HYPRE_Int *block_num_coarse_points, + HYPRE_Int **block_coarse_indexes) { - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; - HYPRE_Int i; - if((mgr_data -> idx_array) != NULL) { - hypre_TFree(mgr_data -> idx_array, HYPRE_MEMORY_HOST); - (mgr_data -> idx_array) = NULL; - } - HYPRE_BigInt *index_array = hypre_CTAlloc(HYPRE_BigInt, block_size, HYPRE_MEMORY_HOST); - if (begin_idx_array != NULL) - { - for (i = 0; i < block_size; i++) { - index_array[i] = *(begin_idx_array+i); - } - } - hypre_MGRSetCpointsByBlock(mgr_data, block_size, max_num_levels, block_num_coarse_points, block_coarse_indexes); - (mgr_data -> idx_array) = index_array; - (mgr_data -> set_c_points_method) = 1; - return hypre_error_flag; + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + HYPRE_Int i; + if ((mgr_data -> idx_array) != NULL) + { + hypre_TFree(mgr_data -> idx_array, HYPRE_MEMORY_HOST); + (mgr_data -> idx_array) = NULL; + } + HYPRE_BigInt *index_array = hypre_CTAlloc(HYPRE_BigInt, block_size, HYPRE_MEMORY_HOST); + if (begin_idx_array != NULL) + { + for (i = 0; i < block_size; i++) + { + index_array[i] = *(begin_idx_array + i); + } + } + hypre_MGRSetCpointsByBlock(mgr_data, block_size, max_num_levels, block_num_coarse_points, + block_coarse_indexes); + (mgr_data -> idx_array) = index_array; + (mgr_data -> set_c_points_method) = 1; + return hypre_error_flag; } /* Initialize/ set local block data information */ HYPRE_Int hypre_MGRSetCpointsByBlock( void *mgr_vdata, - HYPRE_Int block_size, - HYPRE_Int max_num_levels, - HYPRE_Int *block_num_coarse_points, - HYPRE_Int **block_coarse_indexes) + HYPRE_Int block_size, + HYPRE_Int max_num_levels, + HYPRE_Int *block_num_coarse_points, + HYPRE_Int **block_coarse_indexes) { - HYPRE_Int i,j; - HYPRE_Int **block_cf_marker = NULL; - HYPRE_Int *block_num_coarse_indexes = NULL; - - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; - - /* free block cf_marker data if not previously destroyed */ - if((mgr_data -> block_cf_marker) != NULL) - { - for (i=0; i < (mgr_data -> max_num_coarse_levels); i++) - { - if ((mgr_data -> block_cf_marker)[i]) - { - hypre_TFree((mgr_data -> block_cf_marker)[i], HYPRE_MEMORY_HOST); - (mgr_data -> block_cf_marker)[i] = NULL; - } - } - hypre_TFree(mgr_data -> block_cf_marker, HYPRE_MEMORY_HOST); - (mgr_data -> block_cf_marker) = NULL; - } - if((mgr_data -> block_num_coarse_indexes)) - { - hypre_TFree((mgr_data -> block_num_coarse_indexes), HYPRE_MEMORY_HOST); - (mgr_data -> block_num_coarse_indexes) = NULL; - } - - /* store block cf_marker */ - block_cf_marker = hypre_CTAlloc(HYPRE_Int *, max_num_levels, HYPRE_MEMORY_HOST); - for (i = 0; i < max_num_levels; i++) - { - block_cf_marker[i] = hypre_CTAlloc(HYPRE_Int, block_size, HYPRE_MEMORY_HOST); - memset(block_cf_marker[i], FMRK, block_size*sizeof(HYPRE_Int)); - } - for (i = 0; i < max_num_levels; i++) - { - for(j=0; j 0) - { - block_num_coarse_indexes = hypre_CTAlloc(HYPRE_Int, max_num_levels, HYPRE_MEMORY_HOST); - for(i=0; i max_num_coarse_levels) = max_num_levels; - (mgr_data -> block_size) = block_size; - (mgr_data -> block_num_coarse_indexes) = block_num_coarse_indexes; - (mgr_data -> block_cf_marker) = block_cf_marker; - (mgr_data -> set_c_points_method) = 0; - - return hypre_error_flag; -} + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; -HYPRE_Int -hypre_MGRSetCpointsByPointMarkerArray( void *mgr_vdata, - HYPRE_Int block_size, - HYPRE_Int max_num_levels, - HYPRE_Int *lvl_num_coarse_points, - HYPRE_Int **lvl_coarse_indexes, - HYPRE_Int *point_marker_array) -{ - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; - HYPRE_Int i,j; - HYPRE_Int **block_cf_marker = NULL; - HYPRE_Int *block_num_coarse_indexes = NULL; - - /* free block cf_marker data if not previously destroyed */ - if((mgr_data -> block_cf_marker) != NULL) - { - for (i=0; i < (mgr_data -> max_num_coarse_levels); i++) - { - if ((mgr_data -> block_cf_marker)[i]) + /* free block cf_marker data if not previously destroyed */ + if ((mgr_data -> block_cf_marker) != NULL) + { + for (i = 0; i < (mgr_data -> max_num_coarse_levels); i++) { - hypre_TFree((mgr_data -> block_cf_marker)[i], HYPRE_MEMORY_HOST); - (mgr_data -> block_cf_marker)[i] = NULL; + if ((mgr_data -> block_cf_marker)[i]) + { + hypre_TFree((mgr_data -> block_cf_marker)[i], HYPRE_MEMORY_HOST); + (mgr_data -> block_cf_marker)[i] = NULL; + } } - } - hypre_TFree(mgr_data -> block_cf_marker, HYPRE_MEMORY_HOST); - (mgr_data -> block_cf_marker) = NULL; - } - if((mgr_data -> block_num_coarse_indexes)) - { - hypre_TFree((mgr_data -> block_num_coarse_indexes), HYPRE_MEMORY_HOST); - (mgr_data -> block_num_coarse_indexes) = NULL; - } + hypre_TFree(mgr_data -> block_cf_marker, HYPRE_MEMORY_HOST); + (mgr_data -> block_cf_marker) = NULL; + } + if ((mgr_data -> block_num_coarse_indexes)) + { + hypre_TFree((mgr_data -> block_num_coarse_indexes), HYPRE_MEMORY_HOST); + (mgr_data -> block_num_coarse_indexes) = NULL; + } - /* store block cf_marker */ - block_cf_marker = hypre_CTAlloc(HYPRE_Int *, max_num_levels, HYPRE_MEMORY_HOST); - for (i = 0; i < max_num_levels; i++) - { - block_cf_marker[i] = hypre_CTAlloc(HYPRE_Int, block_size, HYPRE_MEMORY_HOST); - memset(block_cf_marker[i], FMRK, block_size*sizeof(HYPRE_Int)); - } - for (i = 0; i < max_num_levels; i++) - { - for(j=0; j 0) - { - block_num_coarse_indexes = hypre_CTAlloc(HYPRE_Int, max_num_levels, HYPRE_MEMORY_HOST); - for(i=0; i max_num_coarse_levels) = max_num_levels; - (mgr_data -> block_size) = block_size; - (mgr_data -> block_num_coarse_indexes) = block_num_coarse_indexes; - (mgr_data -> block_cf_marker) = block_cf_marker; - (mgr_data -> point_marker_array) = point_marker_array; - (mgr_data -> set_c_points_method) = 2; - - return hypre_error_flag; -} - -/*Set number of points that remain part of the coarse grid throughout the hierarchy */ -HYPRE_Int -hypre_MGRSetReservedCoarseNodes(void *mgr_vdata, - HYPRE_Int reserved_coarse_size, - HYPRE_BigInt *reserved_cpt_index) -{ - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; - HYPRE_BigInt *reserved_coarse_indexes = NULL; - HYPRE_Int i; - - if (!mgr_data) - { - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Warning! MGR object empty!\n"); - return hypre_error_flag; - } - - if(reserved_coarse_size < 0) - { - hypre_error_in_arg(2); - return hypre_error_flag; - } - /* free data not previously destroyed */ - if((mgr_data -> reserved_coarse_indexes)) - { - hypre_TFree((mgr_data -> reserved_coarse_indexes), HYPRE_MEMORY_HOST); - (mgr_data -> reserved_coarse_indexes) = NULL; - } - - /* set reserved coarse nodes */ - if(reserved_coarse_size > 0) - { - reserved_coarse_indexes = hypre_CTAlloc(HYPRE_BigInt, reserved_coarse_size, HYPRE_MEMORY_HOST); - for(i=0; i reserved_coarse_size) = reserved_coarse_size; - (mgr_data -> reserved_coarse_indexes) = reserved_coarse_indexes; - - return hypre_error_flag; -} - -/* Set CF marker array */ -HYPRE_Int -hypre_MGRCoarsen(hypre_ParCSRMatrix *S, - hypre_ParCSRMatrix *A, - HYPRE_Int fixed_coarse_size, - HYPRE_Int *fixed_coarse_indexes, - HYPRE_Int debug_flag, - hypre_IntArray **CF_marker_ptr, - HYPRE_Int cflag) -{ - HYPRE_Int *CF_marker = NULL; - HYPRE_Int *cindexes = fixed_coarse_indexes; - HYPRE_Int i, row, nc; - HYPRE_Int nloc = hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(A)); - - /* If this is the last level, coarsen onto fixed coarse set */ - if(cflag) - { - if(*CF_marker_ptr != NULL) - { - hypre_IntArrayDestroy(*CF_marker_ptr); - } - *CF_marker_ptr = hypre_IntArrayCreate(nloc); - hypre_IntArrayInitialize(*CF_marker_ptr); - hypre_IntArraySetConstantValues(*CF_marker_ptr, FMRK); - CF_marker = hypre_IntArrayData(*CF_marker_ptr); - - /* first mark fixed coarse set */ - nc = fixed_coarse_size; - for(i = 0; i < nc; i++) - { - CF_marker[cindexes[i]] = CMRK; - } - } - else - { - /* First coarsen to get initial CF splitting. - * This is then followed by updating the CF marker to pass - * coarse information to the next levels. NOTE: It may be - * convenient to implement this way (allows the use of multiple - * coarsening strategies without changing too much code), - * but not necessarily the best option, compared to initializing - * CF_marker first and then coarsening on subgraph which excludes - * the initialized coarse nodes. - */ - hypre_BoomerAMGCoarsen(S, A, 0, debug_flag, CF_marker_ptr); - CF_marker = hypre_IntArrayData(*CF_marker_ptr); - - /* Update CF_marker to correct Cpoints marked as Fpoints. */ - nc = fixed_coarse_size; - for(i = 0; i < nc; i++) - { - CF_marker[cindexes[i]] = CMRK; - } - /* set F-points to FMRK. This is necessary since the different coarsening schemes differentiate - * between type of F-points (example Ruge coarsening). We do not need that distinction here. - */ - for (row = 0; row = 0) - { - jj_count[j]++; - fine_to_coarse[i] = coarse_counter[j]; - coarse_counter[j]++; - } - /*-------------------------------------------------------------------- - * If i is an F-point, interpolation is the approximation of A_{ff}^{-1}A_{fc} - *--------------------------------------------------------------------*/ - else - { - for (jj = A_diag_i[i]; jj < A_diag_i[i+1]; jj++) - { - i1 = A_diag_j[jj]; - if ((CF_marker[i1] >= 0) && (method > 0)) - { - jj_count[j]++; - } - } - - if (num_procs > 1) - { - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) - { - i1 = A_offd_j[jj]; - if ((CF_marker_offd[i1] >= 0) && (method > 0)) - { - jj_count_offd[j]++; - } - } - } - } - } - } - - /*----------------------------------------------------------------------- - * Allocate arrays. - *-----------------------------------------------------------------------*/ - for (i=0; i < num_threads-1; i++) - { - coarse_counter[i+1] += coarse_counter[i]; - jj_count[i+1] += jj_count[i]; - jj_count_offd[i+1] += jj_count_offd[i]; - } - i = num_threads-1; - jj_counter = jj_count[i]; - jj_counter_offd = jj_count_offd[i]; - - P_diag_size = jj_counter; - - P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, HYPRE_MEMORY_DEVICE); - P_diag_j = hypre_CTAlloc(HYPRE_Int, P_diag_size, HYPRE_MEMORY_DEVICE); - P_diag_data = hypre_CTAlloc(HYPRE_Real, P_diag_size, HYPRE_MEMORY_DEVICE); - - P_diag_i[n_fine] = jj_counter; - - P_offd_size = jj_counter_offd; - - P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, HYPRE_MEMORY_DEVICE); - P_offd_j = hypre_CTAlloc(HYPRE_Int, P_offd_size, HYPRE_MEMORY_DEVICE); - P_offd_data = hypre_CTAlloc(HYPRE_Real, P_offd_size, HYPRE_MEMORY_DEVICE); - - /*----------------------------------------------------------------------- - * Intialize some stuff. - *-----------------------------------------------------------------------*/ - - jj_counter = start_indexing; - jj_counter_offd = start_indexing; - - if (debug_flag==4) - { - wall_time = time_getWallclockSeconds() - wall_time; - hypre_printf("Proc = %d Interp: Internal work 1 = %f\n", - my_id, wall_time); - fflush(NULL); - } - - /*----------------------------------------------------------------------- - * Send and receive fine_to_coarse info. - *-----------------------------------------------------------------------*/ - - if (debug_flag==4) wall_time = time_getWallclockSeconds(); - - //fine_to_coarse_offd = hypre_CTAlloc(HYPRE_BigInt, num_cols_A_offd, HYPRE_MEMORY_HOST); - -#if 0 -#ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,j,ns,ne,size,rest,coarse_shift) HYPRE_SMP_SCHEDULE -#endif -#endif - for (j = 0; j < num_threads; j++) - { - coarse_shift = 0; - if (j > 0) coarse_shift = coarse_counter[j-1]; - size = n_fine/num_threads; - rest = n_fine - size*num_threads; - if (j < rest) - { - ns = j*size+j; - ne = (j+1)*size+j+1; - } - else - { - ns = j*size+rest; - ne = (j+1)*size+rest; - } - for (i = ns; i < ne; i++) - { - fine_to_coarse[i] += coarse_shift; - } - } - -/* index = 0; - for (i = 0; i < num_sends; i++) - { - start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) - big_buf_data[index++] - = fine_to_coarse[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]+ my_first_cpt; - } - - comm_handle = hypre_ParCSRCommHandleCreate( 21, comm_pkg, big_buf_data, - fine_to_coarse_offd); - - hypre_ParCSRCommHandleDestroy(comm_handle); -*/ - if (debug_flag==4) - { - wall_time = time_getWallclockSeconds() - wall_time; - hypre_printf("Proc = %d Interp: Comm 4 FineToCoarse = %f\n", - my_id, wall_time); - fflush(NULL); - } - - if (debug_flag==4) wall_time = time_getWallclockSeconds(); - -#if 0 -#ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE -#endif -#endif - //for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt; - - /*----------------------------------------------------------------------- - * Loop over fine grid points. - *-----------------------------------------------------------------------*/ - a_diag = hypre_CTAlloc(HYPRE_Real, n_fine, HYPRE_MEMORY_HOST); - for (i = 0; i < n_fine; i++) - { - if (CF_marker[i] < 0) - { - for (jj = A_diag_i[i]; jj < A_diag_i[i+1]; jj++) - { - i1 = A_diag_j[jj]; - if ( i==i1 ) /* diagonal of A only */ - { - a_diag[i] = 1.0/A_diag_data[jj]; - } - } - } - } - -#if 0 -#ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,j,jl,i1,jj,ns,ne,size,rest,P_marker,P_marker_offd,jj_counter,jj_counter_offd,jj_begin_row,jj_end_row,jj_begin_row_offd,jj_end_row_offd) HYPRE_SMP_SCHEDULE -#endif -#endif - for (jl = 0; jl < num_threads; jl++) - { - size = n_fine/num_threads; - rest = n_fine - size*num_threads; - if (jl < rest) - { - ns = jl*size+jl; - ne = (jl+1)*size+jl+1; - } - else - { - ns = jl*size+rest; - ne = (jl+1)*size+rest; - } - jj_counter = 0; - if (jl > 0) jj_counter = jj_count[jl-1]; - jj_counter_offd = 0; - if (jl > 0) jj_counter_offd = jj_count_offd[jl-1]; - P_marker = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); - if (num_cols_A_offd) - P_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); - else - P_marker_offd = NULL; - - for (i = 0; i < n_fine; i++) - { - P_marker[i] = -1; - } - for (i = 0; i < num_cols_A_offd; i++) - { - P_marker_offd[i] = -1; - } - for (i = ns; i < ne; i++) - { - /*-------------------------------------------------------------------- - * If i is a c-point, interpolation is the identity. - *--------------------------------------------------------------------*/ - if (CF_marker[i] >= 0) - { - P_diag_i[i] = jj_counter; - P_diag_j[jj_counter] = fine_to_coarse[i]; - P_diag_data[jj_counter] = one; - jj_counter++; - } - /*-------------------------------------------------------------------- - * If i is an F-point, build interpolation. - *--------------------------------------------------------------------*/ - else - { - /* Diagonal part of P */ - P_diag_i[i] = jj_counter; - for (jj = A_diag_i[i]; jj < A_diag_i[i+1]; jj++) - { - i1 = A_diag_j[jj]; - - /*-------------------------------------------------------------- - * If neighbor i1 is a C-point, set column number in P_diag_j - * and initialize interpolation weight to zero. - *--------------------------------------------------------------*/ - - if ((CF_marker[i1] >= 0) && (method > 0)) - { - P_marker[i1] = jj_counter; - P_diag_j[jj_counter] = fine_to_coarse[i1]; - /* - if(method == 0) - { - P_diag_data[jj_counter] = 0.0; - } - */ - if (method == 1) - { - P_diag_data[jj_counter] = - A_diag_data[jj]; - } - else if (method == 2) - { - P_diag_data[jj_counter] = - A_diag_data[jj]*a_diag[i]; - } - jj_counter++; - } - } - - /* Off-Diagonal part of P */ - P_offd_i[i] = jj_counter_offd; - - if (num_procs > 1) - { - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) - { - i1 = A_offd_j[jj]; - - /*----------------------------------------------------------- - * If neighbor i1 is a C-point, set column number in P_offd_j - * and initialize interpolation weight to zero. - *-----------------------------------------------------------*/ - - if ((CF_marker_offd[i1] >= 0) && (method > 0)) - { - P_marker_offd[i1] = jj_counter_offd; - /*P_offd_j[jj_counter_offd] = fine_to_coarse_offd[i1];*/ - P_offd_j[jj_counter_offd] = i1; - /* - if(method == 0) - { - P_offd_data[jj_counter_offd] = 0.0; - } - */ - if (method == 1) - { - P_offd_data[jj_counter_offd] = - A_offd_data[jj]; - } - else if (method == 2) - { - P_offd_data[jj_counter_offd] = - A_offd_data[jj]*a_diag[i]; - } - jj_counter_offd++; - } - } - } - } - P_offd_i[i+1] = jj_counter_offd; - } - hypre_TFree(P_marker, HYPRE_MEMORY_HOST); - hypre_TFree(P_marker_offd, HYPRE_MEMORY_HOST); - } - hypre_TFree(a_diag, HYPRE_MEMORY_HOST); - P = hypre_ParCSRMatrixCreate(comm, - hypre_ParCSRMatrixGlobalNumRows(A), - total_global_cpts, - hypre_ParCSRMatrixColStarts(A), - num_cpts_global, - 0, - P_diag_i[n_fine], - P_offd_i[n_fine]); - - P_diag = hypre_ParCSRMatrixDiag(P); - hypre_CSRMatrixData(P_diag) = P_diag_data; - hypre_CSRMatrixI(P_diag) = P_diag_i; - hypre_CSRMatrixJ(P_diag) = P_diag_j; - P_offd = hypre_ParCSRMatrixOffd(P); - hypre_CSRMatrixData(P_offd) = P_offd_data; - hypre_CSRMatrixI(P_offd) = P_offd_i; - hypre_CSRMatrixJ(P_offd) = P_offd_j; - - num_cols_P_offd = 0; - - if (P_offd_size) - { - P_marker = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); -#if 0 -#ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE -#endif -#endif - for (i=0; i < num_cols_A_offd; i++) - P_marker[i] = 0; - num_cols_P_offd = 0; - for (i=0; i < P_offd_size; i++) - { - index = P_offd_j[i]; - if (!P_marker[index]) - { - num_cols_P_offd++; - P_marker[index] = 1; - } - } - - col_map_offd_P = hypre_CTAlloc(HYPRE_BigInt, num_cols_P_offd, HYPRE_MEMORY_HOST); - tmp_map_offd = hypre_CTAlloc(HYPRE_Int, num_cols_P_offd, HYPRE_MEMORY_HOST); - index = 0; - for (i=0; i < num_cols_P_offd; i++) - { - while (P_marker[index]==0) index++; - tmp_map_offd[i] = index++; - } - -#if 0 -#ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE -#endif -#endif - for (i=0; i < P_offd_size; i++) - P_offd_j[i] = hypre_BinarySearch(tmp_map_offd, - P_offd_j[i], - num_cols_P_offd); - hypre_TFree(P_marker, HYPRE_MEMORY_HOST); - } - - for (i=0; i < n_fine; i++) - if (CF_marker[i] == -3) CF_marker[i] = -1; - if (num_cols_P_offd) - { - hypre_ParCSRMatrixColMapOffd(P) = col_map_offd_P; - hypre_CSRMatrixNumCols(P_offd) = num_cols_P_offd; - } - hypre_GetCommPkgRTFromCommPkgA(P,A, fine_to_coarse, tmp_map_offd); - - *P_ptr = P; - - hypre_TFree(tmp_map_offd, HYPRE_MEMORY_HOST); - hypre_TFree(CF_marker_offd, HYPRE_MEMORY_HOST); - hypre_TFree(int_buf_data, HYPRE_MEMORY_HOST); - hypre_TFree(fine_to_coarse, HYPRE_MEMORY_HOST); - //hypre_TFree(fine_to_coarse_offd, HYPRE_MEMORY_HOST); - hypre_TFree(coarse_counter, HYPRE_MEMORY_HOST); - hypre_TFree(jj_count, HYPRE_MEMORY_HOST); - hypre_TFree(jj_count_offd, HYPRE_MEMORY_HOST); - - return(0); -} - - -/* Interpolation for MGR - Dynamic Row Sum method */ - -HYPRE_Int -hypre_MGRBuildPDRS( hypre_ParCSRMatrix *A, - HYPRE_Int *CF_marker, - HYPRE_BigInt *num_cpts_global, - HYPRE_Int blk_size, - HYPRE_Int reserved_coarse_size, - HYPRE_Int debug_flag, - hypre_ParCSRMatrix **P_ptr) -{ - MPI_Comm comm = hypre_ParCSRMatrixComm(A); - hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); - hypre_ParCSRCommHandle *comm_handle; - - hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); - HYPRE_Real *A_diag_data = hypre_CSRMatrixData(A_diag); - HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); - HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); - - hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); - HYPRE_Real *A_offd_data = hypre_CSRMatrixData(A_offd); - HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); - HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); - HYPRE_Int num_cols_A_offd = hypre_CSRMatrixNumCols(A_offd); - HYPRE_Real *a_diag; - - hypre_ParCSRMatrix *P; - HYPRE_BigInt *col_map_offd_P; - HYPRE_Int *tmp_map_offd; - - HYPRE_Int *CF_marker_offd = NULL; - - hypre_CSRMatrix *P_diag; - hypre_CSRMatrix *P_offd; - - HYPRE_Real *P_diag_data; - HYPRE_Int *P_diag_i; - HYPRE_Int *P_diag_j; - HYPRE_Real *P_offd_data; - HYPRE_Int *P_offd_i; - HYPRE_Int *P_offd_j; - - HYPRE_Int P_diag_size, P_offd_size; - - HYPRE_Int *P_marker, *P_marker_offd; - - HYPRE_Int jj_counter,jj_counter_offd; - HYPRE_Int *jj_count, *jj_count_offd; -// HYPRE_Int jj_begin_row,jj_begin_row_offd; -// HYPRE_Int jj_end_row,jj_end_row_offd; - - HYPRE_Int start_indexing = 0; /* start indexing for P_data at 0 */ - - HYPRE_Int n_fine = hypre_CSRMatrixNumRows(A_diag); - - HYPRE_Int *fine_to_coarse; - //HYPRE_BigInt *fine_to_coarse_offd; - HYPRE_Int *coarse_counter; - HYPRE_Int coarse_shift; - HYPRE_BigInt total_global_cpts; - //HYPRE_BigInt my_first_cpt; - HYPRE_Int num_cols_P_offd; - - HYPRE_Int i,i1; - HYPRE_Int j,jl,jj; - HYPRE_Int start; - - HYPRE_Real one = 1.0; - - HYPRE_Int my_id; - HYPRE_Int num_procs; - HYPRE_Int num_threads; - HYPRE_Int num_sends; - HYPRE_Int index; - HYPRE_Int ns, ne, size, rest; - - HYPRE_Int *int_buf_data; - - HYPRE_Real wall_time; /* for debugging instrumentation */ - - hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_rank(comm,&my_id); - //num_threads = hypre_NumThreads(); - // Temporary fix, disable threading - // TODO: enable threading - num_threads = 1; - - //my_first_cpt = num_cpts_global[0]; - if (my_id == (num_procs -1)) total_global_cpts = num_cpts_global[1]; - hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); - - /*------------------------------------------------------------------- - * Get the CF_marker data for the off-processor columns - *-------------------------------------------------------------------*/ - - if (debug_flag < 0) - { - debug_flag = -debug_flag; - } - - if (debug_flag==4) wall_time = time_getWallclockSeconds(); - - if (num_cols_A_offd) CF_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); - - if (!comm_pkg) - { - hypre_MatvecCommPkgCreate(A); - comm_pkg = hypre_ParCSRMatrixCommPkg(A); - } - - num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, - num_sends), HYPRE_MEMORY_HOST); - - index = 0; - for (i = 0; i < num_sends; i++) - { - start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) - int_buf_data[index++] - = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; - } - - comm_handle = hypre_ParCSRCommHandleCreate( 11, comm_pkg, int_buf_data, - CF_marker_offd); - hypre_ParCSRCommHandleDestroy(comm_handle); - - if (debug_flag==4) - { - wall_time = time_getWallclockSeconds() - wall_time; - hypre_printf("Proc = %d Interp: Comm 1 CF_marker = %f\n", - my_id, wall_time); - fflush(NULL); - } - - /*----------------------------------------------------------------------- - * First Pass: Determine size of P and fill in fine_to_coarse mapping. - *-----------------------------------------------------------------------*/ - - /*----------------------------------------------------------------------- - * Intialize counters and allocate mapping vector. - *-----------------------------------------------------------------------*/ - - coarse_counter = hypre_CTAlloc(HYPRE_Int, num_threads, HYPRE_MEMORY_HOST); - jj_count = hypre_CTAlloc(HYPRE_Int, num_threads, HYPRE_MEMORY_HOST); - jj_count_offd = hypre_CTAlloc(HYPRE_Int, num_threads, HYPRE_MEMORY_HOST); - - fine_to_coarse = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); -#if 0 -#ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE -#endif -#endif - for (i = 0; i < n_fine; i++) fine_to_coarse[i] = -1; - - jj_counter = start_indexing; - jj_counter_offd = start_indexing; - - /*----------------------------------------------------------------------- - * Loop over fine grid. - *-----------------------------------------------------------------------*/ - -/* RDF: this looks a little tricky, but doable */ -#if 0 -#ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,j,i1,jj,ns,ne,size,rest) HYPRE_SMP_SCHEDULE -#endif -#endif - for (j = 0; j < num_threads; j++) - { - size = n_fine/num_threads; - rest = n_fine - size*num_threads; - - if (j < rest) - { - ns = j*size+j; - ne = (j+1)*size+j+1; - } - else - { - ns = j*size+rest; - ne = (j+1)*size+rest; - } - for (i = ns; i < ne; i++) - { - /*-------------------------------------------------------------------- - * If i is a C-point, interpolation is the identity. Also set up - * mapping vector. - *--------------------------------------------------------------------*/ - - if (CF_marker[i] >= 0) - { - jj_count[j]++; - fine_to_coarse[i] = coarse_counter[j]; - coarse_counter[j]++; - } - /*-------------------------------------------------------------------- - * If i is an F-point, interpolation is the approximation of A_{ff}^{-1}A_{fc} - *--------------------------------------------------------------------*/ - else - { - for (jj = A_diag_i[i]; jj < A_diag_i[i+1]; jj++) - { - i1 = A_diag_j[jj]; - if (CF_marker[i1] >= 0) - { - jj_count[j]++; - } - } - - if (num_procs > 1) - { - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) - { - i1 = A_offd_j[jj]; - if (CF_marker_offd[i1] >= 0) - { - jj_count_offd[j]++; - } - } - } - } - /*-------------------------------------------------------------------- - * Set up the indexes for the DRS method - *--------------------------------------------------------------------*/ - - } - } - - /*----------------------------------------------------------------------- - * Allocate arrays. - *-----------------------------------------------------------------------*/ - for (i=0; i < num_threads-1; i++) - { - coarse_counter[i+1] += coarse_counter[i]; - jj_count[i+1] += jj_count[i]; - jj_count_offd[i+1] += jj_count_offd[i]; - } - i = num_threads-1; - jj_counter = jj_count[i]; - jj_counter_offd = jj_count_offd[i]; - - P_diag_size = jj_counter; - - P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, HYPRE_MEMORY_HOST); - P_diag_j = hypre_CTAlloc(HYPRE_Int, P_diag_size, HYPRE_MEMORY_HOST); - P_diag_data = hypre_CTAlloc(HYPRE_Real, P_diag_size, HYPRE_MEMORY_HOST); - - P_diag_i[n_fine] = jj_counter; - - - P_offd_size = jj_counter_offd; - - P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, HYPRE_MEMORY_HOST); - P_offd_j = hypre_CTAlloc(HYPRE_Int, P_offd_size, HYPRE_MEMORY_HOST); - P_offd_data = hypre_CTAlloc(HYPRE_Real, P_offd_size, HYPRE_MEMORY_HOST); - - /*----------------------------------------------------------------------- - * Intialize some stuff. - *-----------------------------------------------------------------------*/ - - jj_counter = start_indexing; - jj_counter_offd = start_indexing; - - if (debug_flag==4) + /* store block cf_marker */ + block_cf_marker = hypre_CTAlloc(HYPRE_Int *, max_num_levels, HYPRE_MEMORY_HOST); + for (i = 0; i < max_num_levels; i++) { - wall_time = time_getWallclockSeconds() - wall_time; - hypre_printf("Proc = %d Interp: Internal work 1 = %f\n", - my_id, wall_time); - fflush(NULL); + block_cf_marker[i] = hypre_CTAlloc(HYPRE_Int, block_size, HYPRE_MEMORY_HOST); + memset(block_cf_marker[i], FMRK, block_size * sizeof(HYPRE_Int)); } - - /*----------------------------------------------------------------------- - * Send and receive fine_to_coarse info. - *-----------------------------------------------------------------------*/ - - if (debug_flag==4) wall_time = time_getWallclockSeconds(); - - //fine_to_coarse_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); - -#if 0 -#ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,j,ns,ne,size,rest,coarse_shift) HYPRE_SMP_SCHEDULE -#endif -#endif - for (j = 0; j < num_threads; j++) + for (i = 0; i < max_num_levels; i++) { - coarse_shift = 0; - if (j > 0) coarse_shift = coarse_counter[j-1]; - size = n_fine/num_threads; - rest = n_fine - size*num_threads; - if (j < rest) + for (j = 0; j < block_num_coarse_points[i]; j++) { - ns = j*size+j; - ne = (j+1)*size+j+1; + (block_cf_marker[i])[block_coarse_indexes[i][j]] = CMRK; } - else - { - ns = j*size+rest; - ne = (j+1)*size+rest; - } - for (i = ns; i < ne; i++) - fine_to_coarse[i] += coarse_shift; - } - - /*index = 0; - for (i = 0; i < num_sends; i++) - { - start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) - int_buf_data[index++] - = fine_to_coarse[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; } - comm_handle = hypre_ParCSRCommHandleCreate( 11, comm_pkg, int_buf_data, - fine_to_coarse_offd); - - hypre_ParCSRCommHandleDestroy(comm_handle); -*/ - if (debug_flag==4) + /* store block_num_coarse_points */ + if (max_num_levels > 0) { - wall_time = time_getWallclockSeconds() - wall_time; - hypre_printf("Proc = %d Interp: Comm 4 FineToCoarse = %f\n", - my_id, wall_time); - fflush(NULL); + block_num_coarse_indexes = hypre_CTAlloc(HYPRE_Int, max_num_levels, HYPRE_MEMORY_HOST); + for (i = 0; i < max_num_levels; i++) + { + block_num_coarse_indexes[i] = block_num_coarse_points[i]; + } } + /* set block data */ + (mgr_data -> max_num_coarse_levels) = max_num_levels; + (mgr_data -> block_size) = block_size; + (mgr_data -> block_num_coarse_indexes) = block_num_coarse_indexes; + (mgr_data -> block_cf_marker) = block_cf_marker; + (mgr_data -> set_c_points_method) = 0; - if (debug_flag==4) wall_time = time_getWallclockSeconds(); - -#if 0 -#ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE -#endif -#endif + return hypre_error_flag; +} - //for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt; +HYPRE_Int +hypre_MGRSetCpointsByPointMarkerArray( void *mgr_vdata, + HYPRE_Int block_size, + HYPRE_Int max_num_levels, + HYPRE_Int *lvl_num_coarse_points, + HYPRE_Int **lvl_coarse_indexes, + HYPRE_Int *point_marker_array) +{ + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + HYPRE_Int i, j; + HYPRE_Int **block_cf_marker = NULL; + HYPRE_Int *block_num_coarse_indexes = NULL; - /*----------------------------------------------------------------------- - * Loop over fine grid points. - *-----------------------------------------------------------------------*/ - a_diag = hypre_CTAlloc(HYPRE_Real, n_fine, HYPRE_MEMORY_HOST); - for (i = 0; i < n_fine; i++) + /* free block cf_marker data if not previously destroyed */ + if ((mgr_data -> block_cf_marker) != NULL) { - for (jj = A_diag_i[i]; jj < A_diag_i[i+1]; jj++) + for (i = 0; i < (mgr_data -> max_num_coarse_levels); i++) { - i1 = A_diag_j[jj]; - if ( i==i1 ) /* diagonal of A only */ + if ((mgr_data -> block_cf_marker)[i]) { - a_diag[i] = 1.0/A_diag_data[jj]; + hypre_TFree((mgr_data -> block_cf_marker)[i], HYPRE_MEMORY_HOST); + (mgr_data -> block_cf_marker)[i] = NULL; } } + hypre_TFree(mgr_data -> block_cf_marker, HYPRE_MEMORY_HOST); + (mgr_data -> block_cf_marker) = NULL; + } + if ((mgr_data -> block_num_coarse_indexes)) + { + hypre_TFree((mgr_data -> block_num_coarse_indexes), HYPRE_MEMORY_HOST); + (mgr_data -> block_num_coarse_indexes) = NULL; } -#if 0 -#ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,j,jl,i1,jj,ns,ne,size,rest,P_marker,P_marker_offd,jj_counter,jj_counter_offd,jj_begin_row,jj_end_row,jj_begin_row_offd,jj_end_row_offd) HYPRE_SMP_SCHEDULE -#endif -#endif - for (jl = 0; jl < num_threads; jl++) + /* store block cf_marker */ + block_cf_marker = hypre_CTAlloc(HYPRE_Int *, max_num_levels, HYPRE_MEMORY_HOST); + for (i = 0; i < max_num_levels; i++) { - size = n_fine/num_threads; - rest = n_fine - size*num_threads; - if (jl < rest) - { - ns = jl*size+jl; - ne = (jl+1)*size+jl+1; - } - else + block_cf_marker[i] = hypre_CTAlloc(HYPRE_Int, block_size, HYPRE_MEMORY_HOST); + memset(block_cf_marker[i], FMRK, block_size * sizeof(HYPRE_Int)); + } + for (i = 0; i < max_num_levels; i++) + { + for (j = 0; j < lvl_num_coarse_points[i]; j++) { - ns = jl*size+rest; - ne = (jl+1)*size+rest; + block_cf_marker[i][j] = lvl_coarse_indexes[i][j]; } - jj_counter = 0; - if (jl > 0) jj_counter = jj_count[jl-1]; - jj_counter_offd = 0; - if (jl > 0) jj_counter_offd = jj_count_offd[jl-1]; - P_marker = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); - if (num_cols_A_offd) - P_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); - else - P_marker_offd = NULL; + } - for (i = 0; i < n_fine; i++) - { - P_marker[i] = -1; - } - for (i = 0; i < num_cols_A_offd; i++) - { - P_marker_offd[i] = -1; - } - for (i = ns; i < ne; i++) + /* store block_num_coarse_points */ + if (max_num_levels > 0) + { + block_num_coarse_indexes = hypre_CTAlloc(HYPRE_Int, max_num_levels, HYPRE_MEMORY_HOST); + for (i = 0; i < max_num_levels; i++) { - /*-------------------------------------------------------------------- - * If i is a c-point, interpolation is the identity. - *--------------------------------------------------------------------*/ - if (CF_marker[i] >= 0) - { - P_diag_i[i] = jj_counter; - P_diag_j[jj_counter] = fine_to_coarse[i]; - P_diag_data[jj_counter] = one; - jj_counter++; - } - /*-------------------------------------------------------------------- - * If i is an F-point, build interpolation. - *--------------------------------------------------------------------*/ - else - { - /* Diagonal part of P */ - P_diag_i[i] = jj_counter; - for (jj = A_diag_i[i]; jj < A_diag_i[i+1]; jj++) - { - i1 = A_diag_j[jj]; - - /*-------------------------------------------------------------- - * If neighbor i1 is a C-point, set column number in P_diag_j - * and initialize interpolation weight to zero. - *--------------------------------------------------------------*/ - - if (CF_marker[i1] >= 0) - { - P_marker[i1] = jj_counter; - P_diag_j[jj_counter] = fine_to_coarse[i1]; - P_diag_data[jj_counter] = - A_diag_data[jj]*a_diag[i]; - - jj_counter++; - } - } - - /* Off-Diagonal part of P */ - P_offd_i[i] = jj_counter_offd; - - if (num_procs > 1) - { - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) - { - i1 = A_offd_j[jj]; - - /*----------------------------------------------------------- - * If neighbor i1 is a C-point, set column number in P_offd_j - * and initialize interpolation weight to zero. - *-----------------------------------------------------------*/ - - if (CF_marker_offd[i1] >= 0) - { - P_marker_offd[i1] = jj_counter_offd; - /*P_offd_j[jj_counter_offd] = fine_to_coarse_offd[i1];*/ - P_offd_j[jj_counter_offd] = i1; - P_offd_data[jj_counter_offd] = - A_offd_data[jj]*a_diag[i]; - - jj_counter_offd++; - } - } - } - } - P_offd_i[i+1] = jj_counter_offd; + block_num_coarse_indexes[i] = lvl_num_coarse_points[i]; } - hypre_TFree(P_marker, HYPRE_MEMORY_HOST); - hypre_TFree(P_marker_offd, HYPRE_MEMORY_HOST); - } - hypre_TFree(a_diag, HYPRE_MEMORY_HOST); - P = hypre_ParCSRMatrixCreate(comm, - hypre_ParCSRMatrixGlobalNumRows(A), - total_global_cpts, - hypre_ParCSRMatrixColStarts(A), - num_cpts_global, - 0, - P_diag_i[n_fine], - P_offd_i[n_fine]); - - P_diag = hypre_ParCSRMatrixDiag(P); - hypre_CSRMatrixData(P_diag) = P_diag_data; - hypre_CSRMatrixI(P_diag) = P_diag_i; - hypre_CSRMatrixJ(P_diag) = P_diag_j; - P_offd = hypre_ParCSRMatrixOffd(P); - hypre_CSRMatrixData(P_offd) = P_offd_data; - hypre_CSRMatrixI(P_offd) = P_offd_i; - hypre_CSRMatrixJ(P_offd) = P_offd_j; - - num_cols_P_offd = 0; - - if (P_offd_size) - { - P_marker = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); + } + /* set block data */ + (mgr_data -> max_num_coarse_levels) = max_num_levels; + (mgr_data -> block_size) = block_size; + (mgr_data -> block_num_coarse_indexes) = block_num_coarse_indexes; + (mgr_data -> block_cf_marker) = block_cf_marker; + (mgr_data -> point_marker_array) = point_marker_array; + (mgr_data -> set_c_points_method) = 2; -#if 0 -#ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE -#endif -#endif - for (i=0; i < num_cols_A_offd; i++) - P_marker[i] = 0; - num_cols_P_offd = 0; - for (i=0; i < P_offd_size; i++) - { - index = P_offd_j[i]; - if (!P_marker[index]) - { - num_cols_P_offd++; - P_marker[index] = 1; - } - } + return hypre_error_flag; +} - tmp_map_offd = hypre_CTAlloc(HYPRE_Int, num_cols_P_offd, HYPRE_MEMORY_HOST); - col_map_offd_P = hypre_CTAlloc(HYPRE_BigInt, num_cols_P_offd, HYPRE_MEMORY_HOST); - index = 0; - for (i=0; i < num_cols_P_offd; i++) - { - while (P_marker[index]==0) index++; - tmp_map_offd[i] = index++; - } +/*Set number of points that remain part of the coarse grid throughout the hierarchy */ +HYPRE_Int +hypre_MGRSetReservedCoarseNodes(void *mgr_vdata, + HYPRE_Int reserved_coarse_size, + HYPRE_BigInt *reserved_cpt_index) +{ + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + HYPRE_BigInt *reserved_coarse_indexes = NULL; + HYPRE_Int i; -#if 0 -#ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE -#endif -#endif - for (i=0; i < P_offd_size; i++) - P_offd_j[i] = hypre_BinarySearch(tmp_map_offd, - P_offd_j[i], - num_cols_P_offd); - hypre_TFree(P_marker, HYPRE_MEMORY_HOST); + /* free data not previously destroyed */ + if ((mgr_data -> reserved_coarse_indexes)) + { + hypre_TFree((mgr_data -> reserved_coarse_indexes), HYPRE_MEMORY_HOST); + (mgr_data -> reserved_coarse_indexes) = NULL; } - for (i=0; i < n_fine; i++) - if (CF_marker[i] == -3) CF_marker[i] = -1; - if (num_cols_P_offd) + /* set reserved coarse nodes */ + if (reserved_coarse_size > 0) { - hypre_ParCSRMatrixColMapOffd(P) = col_map_offd_P; - hypre_CSRMatrixNumCols(P_offd) = num_cols_P_offd; + reserved_coarse_indexes = hypre_CTAlloc(HYPRE_BigInt, reserved_coarse_size, HYPRE_MEMORY_HOST); + for (i = 0; i < reserved_coarse_size; i++) + { + reserved_coarse_indexes[i] = reserved_cpt_index[i]; + } } - hypre_GetCommPkgRTFromCommPkgA(P,A, fine_to_coarse, tmp_map_offd); + (mgr_data -> reserved_coarse_size) = reserved_coarse_size; + (mgr_data -> reserved_coarse_indexes) = reserved_coarse_indexes; - *P_ptr = P; - - hypre_TFree(tmp_map_offd, HYPRE_MEMORY_HOST); - hypre_TFree(CF_marker_offd, HYPRE_MEMORY_HOST); - hypre_TFree(int_buf_data, HYPRE_MEMORY_HOST); - hypre_TFree(fine_to_coarse, HYPRE_MEMORY_HOST); -// hypre_TFree(fine_to_coarse_offd, HYPRE_MEMORY_HOST); - hypre_TFree(coarse_counter, HYPRE_MEMORY_HOST); - hypre_TFree(jj_count, HYPRE_MEMORY_HOST); - hypre_TFree(jj_count_offd, HYPRE_MEMORY_HOST); - - return(0); -} - -/* Scale ParCSR matrix A = scalar * A - * A: the target CSR matrix - * vector: array of real numbers - */ -HYPRE_Int -hypre_ParCSRMatrixLeftScale(HYPRE_Real *vector, - hypre_ParCSRMatrix *A) -{ - HYPRE_Int i, j, n_local; - hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); - HYPRE_Real *A_diag_data = hypre_CSRMatrixData(A_diag); - HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); - - hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); - HYPRE_Real *A_offd_data = hypre_CSRMatrixData(A_offd); - HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); - - n_local = hypre_CSRMatrixNumRows(A_diag); - - for (i = 0; i < n_local; i++) - { - HYPRE_Real factor = vector[i]; - for (j = A_diag_i[i]; j < A_diag_i[i+1]; j++) - { - A_diag_data[j] *= factor; - } - for (j = A_offd_i[i]; j < A_offd_i[i+1]; j++) - { - A_offd_data[j] *= factor; - } - } - - return(0); + return hypre_error_flag; } -/************************************************************ -* Available methods: -* 0: inv(A_FF) approximated by its diagonal inverse -* 1: inv(A_FF) approximated by sparse approximate inverse -*************************************************************/ +/* Set CF marker array */ HYPRE_Int -hypre_MGRComputeNonGalerkinCoarseGrid(hypre_ParCSRMatrix *A, - hypre_ParCSRMatrix *P, - hypre_ParCSRMatrix *RT, - HYPRE_Int bsize, - HYPRE_Int ordering, - HYPRE_Int method, - HYPRE_Int Pmax, - HYPRE_Int keep_stencil, - HYPRE_Int *CF_marker, - hypre_ParCSRMatrix **A_h_ptr) +hypre_MGRCoarsen(hypre_ParCSRMatrix *S, + hypre_ParCSRMatrix *A, + HYPRE_Int fixed_coarse_size, + HYPRE_Int *fixed_coarse_indexes, + HYPRE_Int debug_flag, + hypre_IntArray **CF_marker_ptr, + HYPRE_Int cflag) { - HYPRE_Int *c_marker, *f_marker; - HYPRE_Int n_local_fine_grid, i, i1, jj; - hypre_ParCSRMatrix *A_cc; - hypre_ParCSRMatrix *A_ff; - hypre_ParCSRMatrix *A_fc; - hypre_ParCSRMatrix *A_cf; - hypre_ParCSRMatrix *A_h; - hypre_ParCSRMatrix *A_h_correction; - HYPRE_Int max_elmts = Pmax; -// HYPRE_Real wall_time = 0.; - hypre_ParCSRMatrix *P_mod = NULL; - - HYPRE_Int my_id; - MPI_Comm comm = hypre_ParCSRMatrixComm(A); - hypre_MPI_Comm_rank(comm,&my_id); - HYPRE_MemoryLocation memory_location = hypre_ParCSRMatrixMemoryLocation(A); - - n_local_fine_grid = hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(A)); - c_marker = hypre_CTAlloc(HYPRE_Int, n_local_fine_grid, HYPRE_MEMORY_HOST); - f_marker = hypre_CTAlloc(HYPRE_Int, n_local_fine_grid, HYPRE_MEMORY_HOST); - - for (i = 0; i < n_local_fine_grid; i++) - { - HYPRE_Int point_type = CF_marker[i]; - hypre_assert(point_type == 1 || point_type == -1); - c_marker[i] = point_type; - f_marker[i] = -point_type; - } - - // get the A_cc sub-block - hypre_MGRGetSubBlock(A, c_marker, c_marker, 0, &A_cc); - - if (method == 0) - { - if (keep_stencil) - { - //wall_time = time_getWallclockSeconds(); - hypre_MGRGetSubBlock(A, c_marker, f_marker, 0, &A_cf); - hypre_MGRGetSubBlock(A, f_marker, c_marker, 0, &A_fc); - hypre_MGRGetSubBlock(A, f_marker, f_marker, 0, &A_ff); - - // extract the diagonal of A_ff and compute D_ff_inv - hypre_CSRMatrix *A_ff_diag = hypre_ParCSRMatrixDiag(A_ff); - HYPRE_Real *A_ff_diag_data = hypre_CSRMatrixData(A_ff_diag); - HYPRE_Int *A_ff_diag_i = hypre_CSRMatrixI(A_ff_diag); - HYPRE_Int *A_ff_diag_j = hypre_CSRMatrixJ(A_ff_diag); - HYPRE_Int n_local_fpoints = hypre_CSRMatrixNumRows(A_ff_diag); - - HYPRE_Real *D_ff_inv; - D_ff_inv = hypre_CTAlloc(HYPRE_Real, n_local_fpoints, HYPRE_MEMORY_HOST); - for (i = 0; i < n_local_fpoints; i++) + HYPRE_Int *CF_marker = NULL; + HYPRE_Int *cindexes = fixed_coarse_indexes; + HYPRE_Int i, row, nc; + HYPRE_Int nloc = hypre_ParCSRMatrixNumRows(A); + HYPRE_MemoryLocation memory_location; + + /* If this is the last level, coarsen onto fixed coarse set */ + if (cflag) + { + if (*CF_marker_ptr != NULL) { - for (jj = A_ff_diag_i[i]; jj < A_ff_diag_i[i+1]; jj++) - { - i1 = A_ff_diag_j[jj]; - if ( i==i1 ) - { - D_ff_inv[i] = -1.0/A_ff_diag_data[jj]; - } - } + hypre_IntArrayDestroy(*CF_marker_ptr); } + *CF_marker_ptr = hypre_IntArrayCreate(nloc); + hypre_IntArrayInitialize(*CF_marker_ptr); + hypre_IntArraySetConstantValues(*CF_marker_ptr, FMRK); + memory_location = hypre_IntArrayMemoryLocation(*CF_marker_ptr); - // extract the diagonal of A_cf - hypre_CSRMatrix *A_cf_diag = hypre_ParCSRMatrixDiag(A_cf); - HYPRE_Real *A_cf_diag_data = hypre_CSRMatrixData(A_cf_diag); - HYPRE_Int *A_cf_diag_i = hypre_CSRMatrixI(A_cf_diag); - HYPRE_Int *A_cf_diag_j = hypre_CSRMatrixJ(A_cf_diag); - - n_local_fpoints = hypre_CSRMatrixNumRows(A_cf_diag); - HYPRE_Real *D_cf; - D_cf = hypre_CTAlloc(HYPRE_Real, n_local_fpoints, HYPRE_MEMORY_HOST); - for (i = 0; i < n_local_fpoints; i++) + if (hypre_GetActualMemLocation(memory_location) == hypre_MEMORY_DEVICE) { - i1 = A_cf_diag_j[A_cf_diag_i[i]]; - D_cf[i] = A_cf_diag_data[jj]; + hypre_IntArrayMigrate(*CF_marker_ptr, HYPRE_MEMORY_HOST); } - // compute the triple product - hypre_ParCSRMatrixLeftScale(D_ff_inv, A_fc); - hypre_ParCSRMatrixLeftScale(D_cf, A_fc); - A_h_correction = A_fc; - - hypre_TFree(D_cf, HYPRE_MEMORY_HOST); - hypre_TFree(D_ff_inv, HYPRE_MEMORY_HOST); - hypre_ParCSRMatrixDestroy(A_ff); - hypre_ParCSRMatrixDestroy(A_cf); - //wall_time = time_getWallclockSeconds() - wall_time; - //hypre_printf("Compute triple product D_cf * D_ff_inv * A_fc time: %1.5f\n", wall_time); - } - else - { - //wall_time = time_getWallclockSeconds(); - P_mod = hypre_ParCSRMatrixCompleteClone(P); - hypre_ParCSRMatrixCopy(P,P_mod,1); - - HYPRE_Int n_local_rows = hypre_ParCSRMatrixNumRows(P_mod); - hypre_CSRMatrix *P_mod_diag = hypre_ParCSRMatrixDiag(P_mod); - HYPRE_Int *P_mod_diag_i = hypre_CSRMatrixI(P_mod_diag); - HYPRE_Real *P_mod_diag_data = hypre_CSRMatrixData(P_mod_diag); - for (i = 0; i < n_local_rows; i ++) + CF_marker = hypre_IntArrayData(*CF_marker_ptr); + + /* first mark fixed coarse set */ + nc = fixed_coarse_size; + for (i = 0; i < nc; i++) { - if (CF_marker[i] >= 0) - { - HYPRE_Int ii = P_mod_diag_i[i]; - P_mod_diag_data[ii] = 0.0; - } + CF_marker[cindexes[i]] = CMRK; } - hypre_BoomerAMGBuildCoarseOperator(RT, A, P_mod, &A_h_correction); - //wall_time = time_getWallclockSeconds() - wall_time; - //hypre_printf("Compute triple product time new: %1.5f\n", wall_time); - - hypre_ParCSRMatrixDestroy(P_mod); - } - } - else - { - // Approximate inverse for ideal interploation - hypre_MGRGetSubBlock(A, c_marker, f_marker, 0, &A_cf); - hypre_MGRGetSubBlock(A, f_marker, c_marker, 0, &A_fc); - hypre_MGRGetSubBlock(A, f_marker, f_marker, 0, &A_ff); - - hypre_ParCSRMatrix *A_ff_inv = NULL; - hypre_ParCSRMatrix *minus_Wp = NULL; - hypre_MGRApproximateInverse(A_ff, &A_ff_inv); - minus_Wp = hypre_ParMatmul(A_ff_inv, A_fc); - A_h_correction = hypre_ParMatmul(A_cf, minus_Wp); - - hypre_ParCSRMatrixDestroy(minus_Wp); - hypre_ParCSRMatrixDestroy(A_ff); - hypre_ParCSRMatrixDestroy(A_fc); - hypre_ParCSRMatrixDestroy(A_cf); - } - - // perform dropping for A_h_correction - // specific to multiphase poromechanics - // we only keep the diagonal of each block - //wall_time = time_getWallclockSeconds(); - HYPRE_Int n_local_cpoints = hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(A_h_correction)); - - hypre_CSRMatrix *A_h_correction_diag = hypre_ParCSRMatrixDiag(A_h_correction); - HYPRE_Real *A_h_correction_diag_data = hypre_CSRMatrixData(A_h_correction_diag); - HYPRE_Int *A_h_correction_diag_i = hypre_CSRMatrixI(A_h_correction_diag); - HYPRE_Int *A_h_correction_diag_j = hypre_CSRMatrixJ(A_h_correction_diag); - HYPRE_Int ncol_diag = hypre_CSRMatrixNumCols(A_h_correction_diag); - - hypre_CSRMatrix *A_h_correction_offd = hypre_ParCSRMatrixOffd(A_h_correction); - HYPRE_Real *A_h_correction_offd_data = hypre_CSRMatrixData(A_h_correction_offd); - HYPRE_Int *A_h_correction_offd_i = hypre_CSRMatrixI(A_h_correction_offd); - HYPRE_Int *A_h_correction_offd_j = hypre_CSRMatrixJ(A_h_correction_offd); - - if (Pmax > 0) - { - if (ordering == 0) // interleaved ordering - { - HYPRE_Int *A_h_correction_diag_i_new = hypre_CTAlloc(HYPRE_Int, n_local_cpoints+1, memory_location); - HYPRE_Int *A_h_correction_diag_j_new = hypre_CTAlloc(HYPRE_Int, (bsize + max_elmts)*n_local_cpoints, memory_location); - HYPRE_Complex *A_h_correction_diag_data_new = hypre_CTAlloc(HYPRE_Complex, (bsize + max_elmts)*n_local_cpoints, memory_location); - HYPRE_Int num_nonzeros_diag_new = 0; - - HYPRE_Int *A_h_correction_offd_i_new = hypre_CTAlloc(HYPRE_Int, n_local_cpoints+1, memory_location); - HYPRE_Int *A_h_correction_offd_j_new = hypre_CTAlloc(HYPRE_Int, max_elmts*n_local_cpoints, memory_location); - HYPRE_Complex *A_h_correction_offd_data_new = hypre_CTAlloc(HYPRE_Complex, max_elmts*n_local_cpoints, memory_location); - HYPRE_Int num_nonzeros_offd_new = 0; - - - for (i = 0; i < n_local_cpoints; i++) + if (hypre_GetActualMemLocation(memory_location) == hypre_MEMORY_DEVICE) { - HYPRE_Int max_num_nonzeros = A_h_correction_diag_i[i+1] - A_h_correction_diag_i[i] + A_h_correction_offd_i[i+1] - A_h_correction_offd_i[i]; - HYPRE_Int *aux_j = hypre_CTAlloc(HYPRE_Int, max_num_nonzeros, HYPRE_MEMORY_HOST); - HYPRE_Real *aux_data = hypre_CTAlloc(HYPRE_Real, max_num_nonzeros, HYPRE_MEMORY_HOST); - HYPRE_Int row_start = i - (i % bsize); - HYPRE_Int row_stop = row_start + bsize - 1; - HYPRE_Int cnt = 0; - for (jj = A_h_correction_offd_i[i]; jj < A_h_correction_offd_i[i+1]; jj++) - { - aux_j[cnt] = A_h_correction_offd_j[jj] + ncol_diag; - aux_data[cnt] = A_h_correction_offd_data[jj]; - cnt++; - } - for (jj = A_h_correction_diag_i[i]; jj < A_h_correction_diag_i[i+1]; jj++) - { - aux_j[cnt] = A_h_correction_diag_j[jj]; - aux_data[cnt] = A_h_correction_diag_data[jj]; - cnt++; - } - hypre_qsort2_abs(aux_j, aux_data, 0, cnt-1); - - for (jj = A_h_correction_diag_i[i]; jj < A_h_correction_diag_i[i+1]; jj++) - { - i1 = A_h_correction_diag_j[jj]; - if (i1 >= row_start && i1 <= row_stop) - { - // copy data to new arrays - A_h_correction_diag_j_new[num_nonzeros_diag_new] = i1; - A_h_correction_diag_data_new[num_nonzeros_diag_new] = A_h_correction_diag_data[jj]; - ++num_nonzeros_diag_new; - } - else - { - // Do nothing - } - } - - if (max_elmts > 0) - { - for (jj = 0; jj < hypre_min(max_elmts, cnt); jj++) - { - HYPRE_Int col_idx = aux_j[jj]; - HYPRE_Real col_value = aux_data[jj]; - if (col_idx < ncol_diag && (col_idx < row_start || col_idx > row_stop)) - { - A_h_correction_diag_j_new[num_nonzeros_diag_new] = col_idx; - A_h_correction_diag_data_new[num_nonzeros_diag_new] = col_value; - ++num_nonzeros_diag_new; - } - else if (col_idx >= ncol_diag) - { - A_h_correction_offd_j_new[num_nonzeros_offd_new] = col_idx - ncol_diag; - A_h_correction_offd_data_new[num_nonzeros_offd_new] = col_value; - ++num_nonzeros_offd_new; - } - } - } - A_h_correction_diag_i_new[i+1] = num_nonzeros_diag_new; - A_h_correction_offd_i_new[i+1] = num_nonzeros_offd_new; - - hypre_TFree(aux_j, HYPRE_MEMORY_HOST); - hypre_TFree(aux_data, HYPRE_MEMORY_HOST); + hypre_IntArrayMigrate(*CF_marker_ptr, HYPRE_MEMORY_DEVICE); } - - hypre_TFree(A_h_correction_diag_i, memory_location); - hypre_TFree(A_h_correction_diag_j, memory_location); - hypre_TFree(A_h_correction_diag_data, memory_location); - hypre_CSRMatrixI(A_h_correction_diag) = A_h_correction_diag_i_new; - hypre_CSRMatrixJ(A_h_correction_diag) = A_h_correction_diag_j_new; - hypre_CSRMatrixData(A_h_correction_diag) = A_h_correction_diag_data_new; - hypre_CSRMatrixNumNonzeros(A_h_correction_diag) = num_nonzeros_diag_new; - - if (A_h_correction_offd_i) hypre_TFree(A_h_correction_offd_i, memory_location); - if (A_h_correction_offd_j) hypre_TFree(A_h_correction_offd_j, memory_location); - if (A_h_correction_offd_data) hypre_TFree(A_h_correction_offd_data, memory_location); - hypre_CSRMatrixI(A_h_correction_offd) = A_h_correction_offd_i_new; - hypre_CSRMatrixJ(A_h_correction_offd) = A_h_correction_offd_j_new; - hypre_CSRMatrixData(A_h_correction_offd) = A_h_correction_offd_data_new; - hypre_CSRMatrixNumNonzeros(A_h_correction_offd) = num_nonzeros_offd_new; - } - else - { - hypre_printf("Error!! Block ordering for non-Galerkin coarse grid is not currently supported\n"); - exit(-1); - } - } - //hypre_MGRParCSRMatrixTruncate(A_h_correction, max_elmts); - //wall_time = time_getWallclockSeconds() - wall_time; - //hypre_printf("Filter A_h_correction time: %1.5f\n", wall_time); - //hypre_ParCSRMatrixPrintIJ(A_h_correction,1,1,"A_h_correction_filtered"); - - // coarse grid / schur complement - hypre_ParCSRMatrixAdd(1.0, A_cc, 1.0, A_h_correction, &A_h); - *A_h_ptr = A_h; - //hypre_ParCSRMatrixPrintIJ(A_h,1,1,"A_h"); - - hypre_ParCSRMatrixDestroy(A_cc); - hypre_ParCSRMatrixDestroy(A_h_correction); - hypre_TFree(c_marker, HYPRE_MEMORY_HOST); - hypre_TFree(f_marker, HYPRE_MEMORY_HOST); - - return hypre_error_flag; -} - -HYPRE_Int -hypre_MGRComputeAlgebraicFixedStress(hypre_ParCSRMatrix *A, - HYPRE_BigInt *mgr_idx_array, - HYPRE_Solver A_ff_solver) -{ - HYPRE_Int *U_marker, *S_marker, *P_marker; - HYPRE_Int n_fine, i; - HYPRE_BigInt ibegin; - hypre_ParCSRMatrix *A_up; - hypre_ParCSRMatrix *A_uu; - hypre_ParCSRMatrix *A_su; - hypre_ParCSRMatrix *A_pu; - hypre_ParVector *e1_vector; - hypre_ParVector *e2_vector; - hypre_ParVector *e3_vector; - hypre_ParVector *e4_vector; - hypre_ParVector *e5_vector; - - n_fine = hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(A)); - ibegin = hypre_ParCSRMatrixFirstRowIndex(A); - hypre_assert(ibegin == mgr_idx_array[0]); - U_marker = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); - S_marker = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); - P_marker = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); - - for (i = 0; i < n_fine; i++) - { - U_marker[i] = -1; - S_marker[i] = -1; - P_marker[i] = -1; - } - - // create C and F markers - for (i = 0; i < n_fine; i++) - { - if (i < mgr_idx_array[1] - ibegin) - { - U_marker[i] = 1; - } - else if (i >= (mgr_idx_array[1] - ibegin) && i < (mgr_idx_array[2] - ibegin)) - { - S_marker[i] = 1; - } - else - { - P_marker[i] = 1; - } - } - - // Get A_up - hypre_MGRGetSubBlock(A, U_marker, P_marker, 0, &A_up); - // GetA_uu - hypre_MGRGetSubBlock(A, U_marker, U_marker, 0, &A_uu); - // Get A_su - hypre_MGRGetSubBlock(A, S_marker, U_marker, 0, &A_su); - // Get A_pu - hypre_MGRGetSubBlock(A, P_marker, U_marker, 0, &A_pu); - - e1_vector = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A_up), - hypre_ParCSRMatrixGlobalNumCols(A_up), - hypre_ParCSRMatrixColStarts(A_up)); - hypre_ParVectorInitialize(e1_vector); - hypre_ParVectorSetConstantValues(e1_vector, 1.0); - - e2_vector = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A_uu), - hypre_ParCSRMatrixGlobalNumRows(A_uu), - hypre_ParCSRMatrixRowStarts(A_uu)); - hypre_ParVectorInitialize(e2_vector); - hypre_ParVectorSetConstantValues(e2_vector, 0.0); - - e3_vector = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A_uu), - hypre_ParCSRMatrixGlobalNumRows(A_uu), - hypre_ParCSRMatrixRowStarts(A_uu)); - hypre_ParVectorInitialize(e3_vector); - hypre_ParVectorSetConstantValues(e3_vector, 0.0); - - e4_vector = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A_su), - hypre_ParCSRMatrixGlobalNumRows(A_su), - hypre_ParCSRMatrixRowStarts(A_su)); - hypre_ParVectorInitialize(e4_vector); - hypre_ParVectorSetConstantValues(e4_vector, 0.0); - - e5_vector = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A_pu), - hypre_ParCSRMatrixGlobalNumRows(A_pu), - hypre_ParCSRMatrixRowStarts(A_pu)); - hypre_ParVectorInitialize(e5_vector); - hypre_ParVectorSetConstantValues(e5_vector, 0.0); - - // compute e2 = A_up * e1 - hypre_ParCSRMatrixMatvecOutOfPlace(1.0, A_up, e1_vector, 0.0, e2_vector, e2_vector); - - // solve e3 = A_uu^-1 * e2 - hypre_BoomerAMGSolve(A_ff_solver, A_uu, e2_vector, e3_vector); - - // compute e4 = A_su * e3 - hypre_ParCSRMatrixMatvecOutOfPlace(1.0, A_su, e3_vector, 0.0, e4_vector, e4_vector); - - // compute e4 = A_su * e3 - hypre_ParCSRMatrixMatvecOutOfPlace(1.0, A_su, e3_vector, 0.0, e4_vector, e4_vector); - - // print e4 - hypre_ParVectorPrintIJ(e4_vector,1,"Dsp"); - - // compute e5 = A_pu * e3 - hypre_ParCSRMatrixMatvecOutOfPlace(1.0, A_pu, e3_vector, 0.0, e5_vector, e5_vector); - - hypre_ParVectorPrintIJ(e5_vector,1,"Dpp"); - - hypre_ParVectorDestroy(e1_vector); - hypre_ParVectorDestroy(e2_vector); - hypre_ParVectorDestroy(e3_vector); - hypre_ParCSRMatrixDestroy(A_uu); - hypre_ParCSRMatrixDestroy(A_up); - hypre_ParCSRMatrixDestroy(A_pu); - hypre_ParCSRMatrixDestroy(A_su); - hypre_TFree(U_marker, HYPRE_MEMORY_HOST); - hypre_TFree(S_marker, HYPRE_MEMORY_HOST); - hypre_TFree(P_marker, HYPRE_MEMORY_HOST); - - return hypre_error_flag; -} - - -HYPRE_Int -hypre_MGRApproximateInverse(hypre_ParCSRMatrix *A, - hypre_ParCSRMatrix **A_inv) -{ - HYPRE_Int print_level, mr_max_row_nnz, mr_max_iter, nsh_max_row_nnz, nsh_max_iter, mr_col_version; - HYPRE_Real mr_tol, nsh_tol; - HYPRE_Real *droptol = hypre_CTAlloc(HYPRE_Real, 2, HYPRE_MEMORY_HOST); - hypre_ParCSRMatrix *approx_A_inv = NULL; - - print_level = 0; - nsh_max_iter = 2; - nsh_max_row_nnz = 2; // default 1000 - mr_max_iter = 1; - mr_tol = 1.0e-3; - mr_max_row_nnz = 2; // default 800 - mr_col_version = 0; - nsh_tol = 1.0e-3; - droptol[0] = 1.0e-2; - droptol[1] = 1.0e-2; - - hypre_ILUParCSRInverseNSH(A, &approx_A_inv, droptol, mr_tol, nsh_tol, DIVIDE_TOL, mr_max_row_nnz, - nsh_max_row_nnz, mr_max_iter, nsh_max_iter, mr_col_version, print_level); - *A_inv = approx_A_inv; - - if (droptol) hypre_TFree(droptol, HYPRE_MEMORY_HOST); - - return hypre_error_flag; -} - -HYPRE_Int -hypre_MGRBuildInterpApproximateInverseExp(hypre_ParCSRMatrix *A, - hypre_ParCSRMatrix *S, - HYPRE_Int *CF_marker, - HYPRE_BigInt *num_cpts_global, - HYPRE_Int debug_flag, - hypre_ParCSRMatrix **P_ptr) -{ - HYPRE_Int *C_marker; - HYPRE_Int *F_marker; - hypre_ParCSRMatrix *A_fc; - hypre_ParCSRMatrix *minus_Wp; - - MPI_Comm comm = hypre_ParCSRMatrixComm(A); - - hypre_ParCSRMatrix *P; - HYPRE_BigInt *col_map_offd_P; - - hypre_CSRMatrix *P_diag; - hypre_CSRMatrix *P_offd; - - HYPRE_Real *P_diag_data; - HYPRE_Int *P_diag_i; - HYPRE_Int *P_diag_j; - HYPRE_Real *P_offd_data; - HYPRE_Int *P_offd_i; - HYPRE_Int *P_offd_j; - - HYPRE_Int P_diag_size, P_offd_size; - - HYPRE_Int jj_counter,jj_counter_offd; - - HYPRE_Int start_indexing = 0; /* start indexing for P_data at 0 */ - - HYPRE_Int n_fine = hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(A)); - - HYPRE_Int *fine_to_coarse = NULL; - HYPRE_Int coarse_counter; - HYPRE_BigInt total_global_cpts; - HYPRE_Int num_cols_P_offd; -// HYPRE_BigInt my_first_cpt; - - HYPRE_Int i, jj; - - HYPRE_Real one = 1.0; - - HYPRE_Int my_id; - HYPRE_Int num_procs; -// HYPRE_Int num_threads; - -// HYPRE_Real wall_time; /* for debugging instrumentation */ - - C_marker = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); - F_marker = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); - - // create C and F markers - for (i = 0; i < n_fine; i++) - { - C_marker[i] = (CF_marker[i] == 1)? 1: -1; - F_marker[i] = (CF_marker[i] == 1) ? -1: 1; - } - - // Get A_FC - hypre_MGRGetSubBlock(A, F_marker, C_marker, 0, &A_fc); - - // compute -Wp - minus_Wp = hypre_ParMatmul(S, A_fc); - - hypre_CSRMatrix *minus_Wp_diag = hypre_ParCSRMatrixDiag(minus_Wp); - HYPRE_Real *minus_Wp_diag_data = hypre_CSRMatrixData(minus_Wp_diag); - HYPRE_Int *minus_Wp_diag_i = hypre_CSRMatrixI(minus_Wp_diag); - HYPRE_Int *minus_Wp_diag_j = hypre_CSRMatrixJ(minus_Wp_diag); - - hypre_CSRMatrix *minus_Wp_offd = hypre_ParCSRMatrixOffd(minus_Wp); - HYPRE_Real *minus_Wp_offd_data = hypre_CSRMatrixData(minus_Wp_offd); - HYPRE_Int *minus_Wp_offd_i = hypre_CSRMatrixI(minus_Wp_offd); - HYPRE_Int *minus_Wp_offd_j = hypre_CSRMatrixJ(minus_Wp_offd); - - hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_rank(comm,&my_id); -// num_threads = hypre_NumThreads(); - -// my_first_cpt = num_cpts_global[0]; - if (my_id == (num_procs -1)) total_global_cpts = num_cpts_global[1]; - hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); - - /*----------------------------------------------------------------------- - * First Pass: Determine size of P and fill in fine_to_coarse mapping. - *-----------------------------------------------------------------------*/ - - /*----------------------------------------------------------------------- - * Intialize counters and allocate mapping vector. - *-----------------------------------------------------------------------*/ - - fine_to_coarse = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); -#if 0 -#ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE -#endif -#endif - for (i = 0; i < n_fine; i++) fine_to_coarse[i] = -1; - - jj_counter = start_indexing; - jj_counter_offd = start_indexing; - - /*----------------------------------------------------------------------- - * Loop over fine grid. - *-----------------------------------------------------------------------*/ - - HYPRE_Int row_counter = 0; - coarse_counter = 0; - for (i = 0; i < n_fine; i++) - { - /*-------------------------------------------------------------------- - * If i is a C-point, interpolation is the identity. Also set up - * mapping vector. - *--------------------------------------------------------------------*/ - - if (CF_marker[i] > 0) - { - jj_counter++; - fine_to_coarse[i] = coarse_counter; - coarse_counter++; - } - else - { - /*-------------------------------------------------------------------- - * If i is an F-point, interpolation is the approximation of A_{ff}^{-1}A_{fc} - *--------------------------------------------------------------------*/ - for (jj = minus_Wp_diag_i[row_counter]; jj < minus_Wp_diag_i[row_counter+1]; jj++) + } + else + { + /* First coarsen to get initial CF splitting. + * This is then followed by updating the CF marker to pass + * coarse information to the next levels. NOTE: It may be + * convenient to implement this way (allows the use of multiple + * coarsening strategies without changing too much code), + * but not necessarily the best option, compared to initializing + * CF_marker first and then coarsening on subgraph which excludes + * the initialized coarse nodes. + */ + hypre_BoomerAMGCoarsen(S, A, 0, debug_flag, CF_marker_ptr); + CF_marker = hypre_IntArrayData(*CF_marker_ptr); + + /* Update CF_marker to correct Cpoints marked as Fpoints. */ + nc = fixed_coarse_size; + for (i = 0; i < nc; i++) { - jj_counter++; + CF_marker[cindexes[i]] = CMRK; } - - if (num_procs > 1) + /* set F-points to FMRK. This is necessary since the different coarsening schemes differentiate + * between type of F-points (example Ruge coarsening). We do not need that distinction here. + */ + for (row = 0; row < nloc; row++) { - for (jj = minus_Wp_offd_i[row_counter]; jj < minus_Wp_offd_i[row_counter+1]; jj++) - { - jj_counter_offd++; - } + if (CF_marker[row] == CMRK) { continue; } + CF_marker[row] = FMRK; } - row_counter++; - } - } - - /*----------------------------------------------------------------------- - * Allocate arrays. - *-----------------------------------------------------------------------*/ - - P_diag_size = jj_counter; - - P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, HYPRE_MEMORY_DEVICE); - P_diag_j = hypre_CTAlloc(HYPRE_Int, P_diag_size, HYPRE_MEMORY_DEVICE); - P_diag_data = hypre_CTAlloc(HYPRE_Real, P_diag_size, HYPRE_MEMORY_DEVICE); - - P_diag_i[n_fine] = jj_counter; - - - P_offd_size = jj_counter_offd; - - P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, HYPRE_MEMORY_DEVICE); - P_offd_j = hypre_CTAlloc(HYPRE_Int, P_offd_size, HYPRE_MEMORY_DEVICE); - P_offd_data = hypre_CTAlloc(HYPRE_Real, P_offd_size, HYPRE_MEMORY_DEVICE); - - /*----------------------------------------------------------------------- - * Intialize some stuff. - *-----------------------------------------------------------------------*/ - - jj_counter = start_indexing; - jj_counter_offd = start_indexing; - - /*----------------------------------------------------------------------- - * Send and receive fine_to_coarse info. - *-----------------------------------------------------------------------*/ - - row_counter = 0; - for (i = 0; i < n_fine; i++) - { - /*-------------------------------------------------------------------- - * If i is a c-point, interpolation is the identity. - *--------------------------------------------------------------------*/ - if (CF_marker[i] >= 0) - { - P_diag_i[i] = jj_counter; - P_diag_j[jj_counter] = fine_to_coarse[i]; - P_diag_data[jj_counter] = one; - jj_counter++; - } - /*-------------------------------------------------------------------- - * If i is an F-point, build interpolation. - *--------------------------------------------------------------------*/ - else - { - /* Diagonal part of P */ - P_diag_i[i] = jj_counter; - for (jj = minus_Wp_diag_i[row_counter]; jj < minus_Wp_diag_i[row_counter+1]; jj++) +#if 0 + /* IMPORTANT: Update coarse_indexes array to define the positions of the fixed coarse points + * in the next level. + */ + nc = 0; + index_i = 0; + for (row = 0; row < nloc; row++) { - P_diag_j[jj_counter] = minus_Wp_diag_j[jj]; - P_diag_data[jj_counter] = - minus_Wp_diag_data[jj]; - jj_counter++; + /* loop through new c-points */ + if (CF_marker[row] == CMRK) { nc++; } + else if (CF_marker[row] == S_CMRK) + { + /* previously marked c-point is part of fixed coarse set. Track its current local index */ + cindexes[index_i++] = nc; + /* reset c-point from S_CMRK to CMRK */ + cf_marker[row] = CMRK; + nc++; + } + /* set F-points to FMRK. This is necessary since the different coarsening schemes differentiate + * between type of F-points (example Ruge coarsening). We do not need that distinction here. + */ + else + { + CF_marker[row] = FMRK; + } } - - /* Off-Diagonal part of P */ - P_offd_i[i] = jj_counter_offd; - - if (num_procs > 1) + /* check if this should be last level */ + if ( nc == fixed_coarse_size) { - for (jj = minus_Wp_offd_i[row_counter]; jj < minus_Wp_offd_i[row_counter+1]; jj++) - { - P_offd_j[jj_counter_offd] = minus_Wp_offd_j[jj]; - P_offd_data[jj_counter_offd] = - minus_Wp_offd_data[jj]; - jj_counter_offd++; - } + last_level = 1; } - row_counter++; - } - P_offd_i[i+1] = jj_counter_offd; - } - - P = hypre_ParCSRMatrixCreate(comm, - hypre_ParCSRMatrixGlobalNumRows(A), - total_global_cpts, - hypre_ParCSRMatrixColStarts(A), - num_cpts_global, - 0, - P_diag_i[n_fine], - P_offd_i[n_fine]); - - P_diag = hypre_ParCSRMatrixDiag(P); - hypre_CSRMatrixData(P_diag) = P_diag_data; - hypre_CSRMatrixI(P_diag) = P_diag_i; - hypre_CSRMatrixJ(P_diag) = P_diag_j; - P_offd = hypre_ParCSRMatrixOffd(P); - hypre_CSRMatrixData(P_offd) = P_offd_data; - hypre_CSRMatrixI(P_offd) = P_offd_i; - hypre_CSRMatrixJ(P_offd) = P_offd_j; - - num_cols_P_offd = hypre_CSRMatrixNumCols(minus_Wp_offd); - HYPRE_BigInt *col_map_offd_tmp = hypre_ParCSRMatrixColMapOffd(minus_Wp); - if (P_offd_size) - { - col_map_offd_P = hypre_CTAlloc(HYPRE_BigInt, num_cols_P_offd, HYPRE_MEMORY_HOST); - for (i=0; i < num_cols_P_offd; i++) - { - col_map_offd_P[i] = col_map_offd_tmp[i]; - } - } - - if (num_cols_P_offd) - { - hypre_ParCSRMatrixColMapOffd(P) = col_map_offd_P; - hypre_CSRMatrixNumCols(P_offd) = num_cols_P_offd; - } - hypre_MatvecCommPkgCreate(P); - - *P_ptr = P; - - hypre_TFree(fine_to_coarse, HYPRE_MEMORY_HOST); - hypre_TFree(C_marker, HYPRE_MEMORY_HOST); - hypre_TFree(F_marker, HYPRE_MEMORY_HOST); - hypre_ParCSRMatrixDestroy(A_fc); - hypre_ParCSRMatrixDestroy(minus_Wp); + //printf(" nc = %d and fixed coarse size = %d \n", nc, fixed_coarse_size); +#endif + } - return 0; + return hypre_error_flag; } +/* Scale ParCSR matrix A = scalar * A + * A: the target CSR matrix + * vector: array of real numbers + */ HYPRE_Int -hypre_MGRBuildInterpApproximateInverse(hypre_ParCSRMatrix *A, - HYPRE_Int *CF_marker, - HYPRE_BigInt *num_cpts_global, - HYPRE_Int debug_flag, - hypre_ParCSRMatrix **P_ptr) +hypre_ParCSRMatrixLeftScale(HYPRE_Real *vector, + hypre_ParCSRMatrix *A) { - HYPRE_Int *C_marker; - HYPRE_Int *F_marker; - hypre_ParCSRMatrix *A_ff; - hypre_ParCSRMatrix *A_fc; - hypre_ParCSRMatrix *A_ff_inv; - hypre_ParCSRMatrix *minus_Wp; - - MPI_Comm comm = hypre_ParCSRMatrixComm(A); - - hypre_ParCSRMatrix *P; - HYPRE_BigInt *col_map_offd_P; - - hypre_CSRMatrix *P_diag; - hypre_CSRMatrix *P_offd; - - HYPRE_Real *P_diag_data; - HYPRE_Int *P_diag_i; - HYPRE_Int *P_diag_j; - HYPRE_Real *P_offd_data; - HYPRE_Int *P_offd_i; - HYPRE_Int *P_offd_j; - - HYPRE_Int P_diag_size, P_offd_size; + HYPRE_Int i, j, n_local; + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + HYPRE_Real *A_diag_data = hypre_CSRMatrixData(A_diag); + HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); - HYPRE_Int jj_counter,jj_counter_offd; - //HYPRE_Int jj_begin_row,jj_begin_row_offd; - //HYPRE_Int jj_end_row,jj_end_row_offd; + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); + HYPRE_Real *A_offd_data = hypre_CSRMatrixData(A_offd); + HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); - HYPRE_Int start_indexing = 0; /* start indexing for P_data at 0 */ + n_local = hypre_CSRMatrixNumRows(A_diag); - HYPRE_Int n_fine = hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(A)); + for (i = 0; i < n_local; i++) + { + HYPRE_Real factor = vector[i]; + for (j = A_diag_i[i]; j < A_diag_i[i + 1]; j++) + { + A_diag_data[j] *= factor; + } + for (j = A_offd_i[i]; j < A_offd_i[i + 1]; j++) + { + A_offd_data[j] *= factor; + } + } - HYPRE_Int *fine_to_coarse = NULL; - //HYPRE_Int *coarse_counter; - HYPRE_Int coarse_counter; - HYPRE_BigInt total_global_cpts; - HYPRE_Int num_cols_P_offd; -// HYPRE_BigInt my_first_cpt; + return hypre_error_flag; +} - HYPRE_Int i,jj; +HYPRE_Int +hypre_MGRComputeAlgebraicFixedStress(hypre_ParCSRMatrix *A, + HYPRE_BigInt *mgr_idx_array, + HYPRE_Solver A_ff_solver) +{ + HYPRE_Int *U_marker, *S_marker, *P_marker; + HYPRE_Int n_fine, i; + HYPRE_BigInt ibegin; + hypre_ParCSRMatrix *A_up; + hypre_ParCSRMatrix *A_uu; + hypre_ParCSRMatrix *A_su; + hypre_ParCSRMatrix *A_pu; + hypre_ParVector *e1_vector; + hypre_ParVector *e2_vector; + hypre_ParVector *e3_vector; + hypre_ParVector *e4_vector; + hypre_ParVector *e5_vector; + + n_fine = hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(A)); + ibegin = hypre_ParCSRMatrixFirstRowIndex(A); + hypre_assert(ibegin == mgr_idx_array[0]); + U_marker = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); + S_marker = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); + P_marker = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); - HYPRE_Real one = 1.0; + for (i = 0; i < n_fine; i++) + { + U_marker[i] = -1; + S_marker[i] = -1; + P_marker[i] = -1; + } - HYPRE_Int my_id; - HYPRE_Int num_procs; -// HYPRE_Int num_threads; + // create C and F markers + for (i = 0; i < n_fine; i++) + { + if (i < mgr_idx_array[1] - ibegin) + { + U_marker[i] = 1; + } + else if (i >= (mgr_idx_array[1] - ibegin) && i < (mgr_idx_array[2] - ibegin)) + { + S_marker[i] = 1; + } + else + { + P_marker[i] = 1; + } + } -// HYPRE_Real wall_time; /* for debugging instrumentation */ + // Get A_up + hypre_MGRGetSubBlock(A, U_marker, P_marker, 0, &A_up); + // GetA_uu + hypre_MGRGetSubBlock(A, U_marker, U_marker, 0, &A_uu); + // Get A_su + hypre_MGRGetSubBlock(A, S_marker, U_marker, 0, &A_su); + // Get A_pu + hypre_MGRGetSubBlock(A, P_marker, U_marker, 0, &A_pu); + + e1_vector = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A_up), + hypre_ParCSRMatrixGlobalNumCols(A_up), + hypre_ParCSRMatrixColStarts(A_up)); + hypre_ParVectorInitialize(e1_vector); + hypre_ParVectorSetConstantValues(e1_vector, 1.0); + + e2_vector = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A_uu), + hypre_ParCSRMatrixGlobalNumRows(A_uu), + hypre_ParCSRMatrixRowStarts(A_uu)); + hypre_ParVectorInitialize(e2_vector); + hypre_ParVectorSetConstantValues(e2_vector, 0.0); + + e3_vector = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A_uu), + hypre_ParCSRMatrixGlobalNumRows(A_uu), + hypre_ParCSRMatrixRowStarts(A_uu)); + hypre_ParVectorInitialize(e3_vector); + hypre_ParVectorSetConstantValues(e3_vector, 0.0); + + e4_vector = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A_su), + hypre_ParCSRMatrixGlobalNumRows(A_su), + hypre_ParCSRMatrixRowStarts(A_su)); + hypre_ParVectorInitialize(e4_vector); + hypre_ParVectorSetConstantValues(e4_vector, 0.0); + + e5_vector = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A_pu), + hypre_ParCSRMatrixGlobalNumRows(A_pu), + hypre_ParCSRMatrixRowStarts(A_pu)); + hypre_ParVectorInitialize(e5_vector); + hypre_ParVectorSetConstantValues(e5_vector, 0.0); + + // compute e2 = A_up * e1 + hypre_ParCSRMatrixMatvecOutOfPlace(1.0, A_up, e1_vector, 0.0, e2_vector, e2_vector); + + // solve e3 = A_uu^-1 * e2 + hypre_BoomerAMGSolve(A_ff_solver, A_uu, e2_vector, e3_vector); + + // compute e4 = A_su * e3 + hypre_ParCSRMatrixMatvecOutOfPlace(1.0, A_su, e3_vector, 0.0, e4_vector, e4_vector); + + // compute e4 = A_su * e3 + hypre_ParCSRMatrixMatvecOutOfPlace(1.0, A_su, e3_vector, 0.0, e4_vector, e4_vector); + + // print e4 + hypre_ParVectorPrintIJ(e4_vector, 1, "Dsp"); + + // compute e5 = A_pu * e3 + hypre_ParCSRMatrixMatvecOutOfPlace(1.0, A_pu, e3_vector, 0.0, e5_vector, e5_vector); + + hypre_ParVectorPrintIJ(e5_vector, 1, "Dpp"); + + hypre_ParVectorDestroy(e1_vector); + hypre_ParVectorDestroy(e2_vector); + hypre_ParVectorDestroy(e3_vector); + hypre_ParCSRMatrixDestroy(A_uu); + hypre_ParCSRMatrixDestroy(A_up); + hypre_ParCSRMatrixDestroy(A_pu); + hypre_ParCSRMatrixDestroy(A_su); + hypre_TFree(U_marker, HYPRE_MEMORY_HOST); + hypre_TFree(S_marker, HYPRE_MEMORY_HOST); + hypre_TFree(P_marker, HYPRE_MEMORY_HOST); - C_marker = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); - F_marker = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); + return hypre_error_flag; +} - // create C and F markers - for (i = 0; i < n_fine; i++) - { - C_marker[i] = (CF_marker[i] == 1)? 1: -1; - F_marker[i] = (CF_marker[i] == 1) ? -1: 1; - } - // Get A_FF - hypre_MGRGetSubBlock(A, F_marker, F_marker, 0, &A_ff); -// hypre_ParCSRMatrixPrintIJ(A_ff, 1, 1, "A_ff"); - // Get A_FC - hypre_MGRGetSubBlock(A, F_marker, C_marker, 0, &A_fc); +HYPRE_Int +hypre_MGRApproximateInverse(hypre_ParCSRMatrix *A, + hypre_ParCSRMatrix **A_inv) +{ + HYPRE_Int print_level, mr_max_row_nnz, mr_max_iter, nsh_max_row_nnz, nsh_max_iter, mr_col_version; + HYPRE_Real mr_tol, nsh_tol; + HYPRE_Real *droptol = hypre_CTAlloc(HYPRE_Real, 2, HYPRE_MEMORY_HOST); + hypre_ParCSRMatrix *approx_A_inv = NULL; + + print_level = 0; + nsh_max_iter = 2; + nsh_max_row_nnz = 2; // default 1000 + mr_max_iter = 1; + mr_tol = 1.0e-3; + mr_max_row_nnz = 2; // default 800 + mr_col_version = 0; + nsh_tol = 1.0e-3; + droptol[0] = 1.0e-2; + droptol[1] = 1.0e-2; + + hypre_ILUParCSRInverseNSH(A, &approx_A_inv, droptol, mr_tol, nsh_tol, HYPRE_REAL_MIN, + mr_max_row_nnz, + nsh_max_row_nnz, mr_max_iter, nsh_max_iter, mr_col_version, print_level); + *A_inv = approx_A_inv; + + if (droptol) { hypre_TFree(droptol, HYPRE_MEMORY_HOST); } - hypre_MGRApproximateInverse(A_ff, &A_ff_inv); -// hypre_ParCSRMatrixPrintIJ(A_ff_inv, 1, 1, "A_ff_inv"); -// hypre_ParCSRMatrixPrintIJ(A_fc, 1, 1, "A_fc"); - minus_Wp = hypre_ParMatmul(A_ff_inv, A_fc); -// hypre_ParCSRMatrixPrintIJ(minus_Wp, 1, 1, "Wp"); + return hypre_error_flag; +} - hypre_CSRMatrix *minus_Wp_diag = hypre_ParCSRMatrixDiag(minus_Wp); - HYPRE_Real *minus_Wp_diag_data = hypre_CSRMatrixData(minus_Wp_diag); - HYPRE_Int *minus_Wp_diag_i = hypre_CSRMatrixI(minus_Wp_diag); - HYPRE_Int *minus_Wp_diag_j = hypre_CSRMatrixJ(minus_Wp_diag); +/*-------------------------------------------------------------------------- + * hypre_blas_smat_inv_n2 + * + * TODO (VPM): move this function to seq_ls + *--------------------------------------------------------------------------*/ - hypre_CSRMatrix *minus_Wp_offd = hypre_ParCSRMatrixOffd(minus_Wp); - HYPRE_Real *minus_Wp_offd_data = hypre_CSRMatrixData(minus_Wp_offd); - HYPRE_Int *minus_Wp_offd_i = hypre_CSRMatrixI(minus_Wp_offd); - HYPRE_Int *minus_Wp_offd_j = hypre_CSRMatrixJ(minus_Wp_offd); +void hypre_blas_smat_inv_n2 (HYPRE_Real *a) +{ + const HYPRE_Real a11 = a[0], a12 = a[1]; + const HYPRE_Real a21 = a[2], a22 = a[3]; + const HYPRE_Real det_inv = 1.0 / (a11 * a22 - a12 * a21); + + a[0] = a22 * det_inv; + a[1] = -a12 * det_inv; + a[2] = -a21 * det_inv; + a[3] = a11 * det_inv; +} - //hypre_CSRMatrix *minus_Wp_offd = hypre_ParCSRMatrixOffd(minus_Wp); - //HYPRE_Int num_cols_minus_Wp_offd = hypre_CSRMatrixNumCols(minus_Wp_offd); +/*-------------------------------------------------------------------------- + * hypre_blas_smat_inv_n3 + * + * TODO (VPM): move this function to seq_ls + *--------------------------------------------------------------------------*/ - hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_rank(comm,&my_id); -// num_threads = hypre_NumThreads(); +void hypre_blas_smat_inv_n3 (HYPRE_Real *a) +{ + const HYPRE_Real a11 = a[0], a12 = a[1], a13 = a[2]; + const HYPRE_Real a21 = a[3], a22 = a[4], a23 = a[5]; + const HYPRE_Real a31 = a[6], a32 = a[7], a33 = a[8]; + + const HYPRE_Real det = a11 * a22 * a33 - a11 * a23 * a32 - + a12 * a21 * a33 + a12 * a23 * a31 + + a13 * a21 * a32 - a13 * a22 * a31; + const HYPRE_Real det_inv = 1.0 / det; + + a[0] = (a22 * a33 - a23 * a32) * det_inv; + a[1] = (a13 * a32 - a12 * a33) * det_inv; + a[2] = (a12 * a23 - a13 * a22) * det_inv; + a[3] = (a23 * a31 - a21 * a33) * det_inv; + a[4] = (a11 * a33 - a13 * a31) * det_inv; + a[5] = (a13 * a21 - a11 * a23) * det_inv; + a[6] = (a21 * a32 - a22 * a31) * det_inv; + a[7] = (a12 * a31 - a11 * a32) * det_inv; + a[8] = (a11 * a22 - a12 * a21) * det_inv; +} -// my_first_cpt = num_cpts_global[0]; - if (my_id == (num_procs -1)) total_global_cpts = num_cpts_global[1]; - hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); +/*-------------------------------------------------------------------------- + * hypre_blas_smat_inv_n4 + * + * TODO (VPM): move this function to seq_ls + *--------------------------------------------------------------------------*/ - /*----------------------------------------------------------------------- - * First Pass: Determine size of P and fill in fine_to_coarse mapping. - *-----------------------------------------------------------------------*/ +void hypre_blas_smat_inv_n4 (HYPRE_Real *a) +{ + const HYPRE_Real a11 = a[0], a12 = a[1], a13 = a[2], a14 = a[3]; + const HYPRE_Real a21 = a[4], a22 = a[5], a23 = a[6], a24 = a[7]; + const HYPRE_Real a31 = a[8], a32 = a[9], a33 = a[10], a34 = a[11]; + const HYPRE_Real a41 = a[12], a42 = a[13], a43 = a[14], a44 = a[15]; + + const HYPRE_Real M11 = a22 * a33 * a44 + a23 * a34 * a42 + + a24 * a32 * a43 - a22 * a34 * a43 - + a23 * a32 * a44 - a24 * a33 * a42; + + const HYPRE_Real M12 = a12 * a34 * a43 + a13 * a32 * a44 + + a14 * a33 * a42 - a12 * a33 * a44 - + a13 * a34 * a42 - a14 * a32 * a43; + + const HYPRE_Real M13 = a12 * a23 * a44 + a13 * a24 * a42 + + a14 * a22 * a43 - a12 * a24 * a43 - + a13 * a22 * a44 - a14 * a23 * a42; + + const HYPRE_Real M14 = a12 * a24 * a33 + a13 * a22 * a34 + + a14 * a23 * a32 - a12 * a23 * a34 - + a13 * a24 * a32 - a14 * a22 * a33; + + const HYPRE_Real M21 = a21 * a34 * a43 + a23 * a31 * a44 + + a24 * a33 * a41 - a21 * a33 * a44 - + a23 * a34 * a41 - a24 * a31 * a43; + + const HYPRE_Real M22 = a11 * a33 * a44 + a13 * a34 * a41 + + a14 * a31 * a43 - a11 * a34 * a43 - + a13 * a31 * a44 - a14 * a33 * a41; + + const HYPRE_Real M23 = a11 * a24 * a43 + a13 * a21 * a44 + + a14 * a23 * a41 - a11 * a23 * a44 - + a13 * a24 * a41 - a14 * a21 * a43; + + const HYPRE_Real M24 = a11 * a23 * a34 + a13 * a24 * a31 + + a14 * a21 * a33 - a11 * a24 * a33 - + a13 * a21 * a34 - a14 * a23 * a31; + + const HYPRE_Real M31 = a21 * a32 * a44 + a22 * a34 * a41 + + a24 * a31 * a42 - a21 * a34 * a42 - + a22 * a31 * a44 - a24 * a32 * a41; + + const HYPRE_Real M32 = a11 * a34 * a42 + a12 * a31 * a44 + + a14 * a32 * a41 - a11 * a32 * a44 - + a12 * a34 * a41 - a14 * a31 * a42; + + const HYPRE_Real M33 = a11 * a22 * a44 + a12 * a24 * a41 + + a14 * a21 * a42 - a11 * a24 * a42 - + a12 * a21 * a44 - a14 * a22 * a41; + + const HYPRE_Real M34 = a11 * a24 * a32 + a12 * a21 * a34 + + a14 * a22 * a31 - a11 * a22 * a34 - + a12 * a24 * a31 - a14 * a21 * a32; + + const HYPRE_Real M41 = a21 * a33 * a42 + a22 * a31 * a43 + + a23 * a32 * a41 - a21 * a32 * a43 - + a22 * a33 * a41 - a23 * a31 * a42; + + const HYPRE_Real M42 = a11 * a32 * a43 + a12 * a33 * a41 + + a13 * a31 * a42 - a11 * a33 * a42 - + a12 * a31 * a43 - a13 * a32 * a41; + + const HYPRE_Real M43 = a11 * a23 * a42 + a12 * a21 * a43 + + a13 * a22 * a41 - a11 * a22 * a43 - + a12 * a23 * a41 - a13 * a21 * a42; + + const HYPRE_Real M44 = a11 * a22 * a33 + a12 * a23 * a31 + + a13 * a21 * a32 - a11 * a23 * a32 - + a12 * a21 * a33 - a13 * a22 * a31; + + const HYPRE_Real det = a11 * M11 + a12 * M21 + a13 * M31 + a14 * M41; + HYPRE_Real det_inv = 1.0 / det; + + //if ( hypre_abs(det) < 1e-22 ) { + //hypre_printf("### WARNING: Matrix is nearly singular! det = %e\n", det); + /* + printf("##----------------------------------------------\n"); + printf("## %12.5e %12.5e %12.5e \n", a0, a1, a2); + printf("## %12.5e %12.5e %12.5e \n", a3, a4, a5); + printf("## %12.5e %12.5e %12.5e \n", a5, a6, a7); + printf("##----------------------------------------------\n"); + getchar(); + */ + //} - /*----------------------------------------------------------------------- - * Intialize counters and allocate mapping vector. - *-----------------------------------------------------------------------*/ + a[0] = M11 * det_inv; a[1] = M12 * det_inv; a[2] = M13 * det_inv; a[3] = M14 * det_inv; + a[4] = M21 * det_inv; a[5] = M22 * det_inv; a[6] = M23 * det_inv; a[7] = M24 * det_inv; + a[8] = M31 * det_inv; a[9] = M32 * det_inv; a[10] = M33 * det_inv; a[11] = M34 * det_inv; + a[12] = M41 * det_inv; a[13] = M42 * det_inv; a[14] = M43 * det_inv; a[15] = M44 * det_inv; +} - //coarse_counter = hypre_CTAlloc(HYPRE_Int, num_threads, HYPRE_MEMORY_HOST); - //jj_count = hypre_CTAlloc(HYPRE_Int, num_threads, HYPRE_MEMORY_HOST); - //jj_count_offd = hypre_CTAlloc(HYPRE_Int, num_threads, HYPRE_MEMORY_HOST); +/*-------------------------------------------------------------------------- + * hypre_MGRSmallBlkInverse + * + * TODO (VPM): move this function to seq_ls + *--------------------------------------------------------------------------*/ +void hypre_MGRSmallBlkInverse(HYPRE_Real *mat, + HYPRE_Int blk_size) +{ + if (blk_size == 2) + { + hypre_blas_smat_inv_n2(mat); + } + else if (blk_size == 3) + { + hypre_blas_smat_inv_n3(mat); + } + else if (blk_size == 4) + { + hypre_blas_smat_inv_n4(mat); + } +} - fine_to_coarse = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); -#if 0 -#ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE -#endif -#endif - for (i = 0; i < n_fine; i++) fine_to_coarse[i] = -1; - - jj_counter = start_indexing; - jj_counter_offd = start_indexing; - - /*----------------------------------------------------------------------- - * Loop over fine grid. - *-----------------------------------------------------------------------*/ - - HYPRE_Int row_counter = 0; - coarse_counter = 0; - for (i = 0; i < n_fine; i++) - { - /*-------------------------------------------------------------------- - * If i is a C-point, interpolation is the identity. Also set up - * mapping vector. - *--------------------------------------------------------------------*/ - - if (CF_marker[i] > 0) - { - //jj_count[j]++; - //fine_to_coarse[i] = coarse_counter[j]; - //coarse_counter[j]++; - jj_counter++; - fine_to_coarse[i] = coarse_counter; - coarse_counter++; - } - else - { - /*-------------------------------------------------------------------- - * If i is an F-point, interpolation is the approximation of A_{ff}^{-1}A_{fc} - *--------------------------------------------------------------------*/ - for (jj = minus_Wp_diag_i[row_counter]; jj < minus_Wp_diag_i[row_counter+1]; jj++) - { - //jj_count[j]++; - jj_counter++; - } +/*-------------------------------------------------------------------------- + * hypre_MGRSmallBlkInverse + * + * TODO (VPM): move this function to seq_ls + *--------------------------------------------------------------------------*/ - if (num_procs > 1) +void hypre_blas_mat_inv(HYPRE_Real *a, + HYPRE_Int n) +{ + HYPRE_Int i, j, k, l, u, kn, in; + HYPRE_Real alinv; + if (n == 4) + { + hypre_blas_smat_inv_n4(a); + } + else + { + for (k = 0; k < n; ++k) { - for (jj = minus_Wp_offd_i[row_counter]; jj < minus_Wp_offd_i[row_counter+1]; jj++) - { - //jj_count_offd[j]++; - jj_counter_offd++; - } - } - row_counter++; - } - } - - /*----------------------------------------------------------------------- - * Allocate arrays. - *-----------------------------------------------------------------------*/ - /* - for (i=0; i < num_threads-1; i++) - { - coarse_counter[i+1] += coarse_counter[i]; - jj_count[i+1] += jj_count[i]; - jj_count_offd[i+1] += jj_count_offd[i]; - } - i = num_threads-1; - jj_counter = jj_count[i]; - jj_counter_offd = jj_count_offd[i]; - */ - - P_diag_size = jj_counter; + kn = k * n; + l = kn + k; + + //if (hypre_abs(a[l]) < HYPRE_REAL_MIN) { + // printf("### WARNING: Diagonal entry is close to zero!"); + // printf("### WARNING: diag_%d=%e\n", k, a[l]); + // a[l] = HYPRE_REAL_MIN; + //} + alinv = 1.0 / a[l]; + a[l] = alinv; + + for (j = 0; j < k; ++j) + { + u = kn + j; a[u] *= alinv; + } - P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, HYPRE_MEMORY_DEVICE); - P_diag_j = hypre_CTAlloc(HYPRE_Int, P_diag_size, HYPRE_MEMORY_DEVICE); - P_diag_data = hypre_CTAlloc(HYPRE_Real, P_diag_size, HYPRE_MEMORY_DEVICE); + for (j = k + 1; j < n; ++j) + { + u = kn + j; a[u] *= alinv; + } - P_diag_i[n_fine] = jj_counter; + for (i = 0; i < k; ++i) + { + in = i * n; + for (j = 0; j < n; ++j) + if (j != k) + { + u = in + j; a[u] -= a[in + k] * a[kn + j]; + } // end if (j!=k) + } + for (i = k + 1; i < n; ++i) + { + in = i * n; + for (j = 0; j < n; ++j) + if (j != k) + { + u = in + j; a[u] -= a[in + k] * a[kn + j]; + } // end if (j!=k) + } - P_offd_size = jj_counter_offd; + for (i = 0; i < k; ++i) + { + u = i * n + k; a[u] *= -alinv; + } - P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, HYPRE_MEMORY_DEVICE); - P_offd_j = hypre_CTAlloc(HYPRE_Int, P_offd_size, HYPRE_MEMORY_DEVICE); - P_offd_data = hypre_CTAlloc(HYPRE_Real, P_offd_size, HYPRE_MEMORY_DEVICE); + for (i = k + 1; i < n; ++i) + { + u = i * n + k; a[u] *= -alinv; + } + } // end for (k=0; k 1) - { - if (debug_flag==4) wall_time = time_getWallclockSeconds(); - - fine_to_coarse_offd = hypre_CTAlloc(HYPRE_Int, num_cols_minus_Wp_offd, HYPRE_MEMORY_HOST); - - for (i = 0; i < n_fine; i++) - { - fine_to_coarse[i] += my_first_cpt; - } - - comm_pkg = hypre_ParCSRMatrixCommPkg(minus_Wp); - if (!comm_pkg) - { - hypre_MatvecCommPkgCreate(minus_Wp); - comm_pkg = hypre_ParCSRMatrixCommPkg(minus_Wp); - } - num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - - index = 0; - for (i = 0; i < num_sends; i++) - { - start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) - int_buf_data[index++] - = fine_to_coarse[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; - } + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); + // HYPRE_Int num_threads = hypre_NumThreads(); - comm_handle = hypre_ParCSRCommHandleCreate( 11, comm_pkg, int_buf_data, - fine_to_coarse_offd); + res = hypre_CTAlloc(HYPRE_Real, blk_size, HYPRE_MEMORY_HOST); - hypre_ParCSRCommHandleDestroy(comm_handle); + if (!comm_pkg) + { + hypre_MatvecCommPkgCreate(A); + comm_pkg = hypre_ParCSRMatrixCommPkg(A); + } - if (debug_flag==4) - { - wall_time = time_getWallclockSeconds() - wall_time; - hypre_printf("Proc = %d Interp: Comm 4 FineToCoarse = %f\n", - my_id, wall_time); - fflush(NULL); - } + if (num_procs > 1) + { + num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + v_buf_data = hypre_CTAlloc(HYPRE_Real, + hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); -#if 0 -#ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE -#endif -#endif - for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt; + Vext_data = hypre_CTAlloc(HYPRE_Real, num_cols_offd, HYPRE_MEMORY_HOST); - } - */ - - - row_counter = 0; - for (i = 0; i < n_fine; i++) - { - /*-------------------------------------------------------------------- - * If i is a c-point, interpolation is the identity. - *--------------------------------------------------------------------*/ - if (CF_marker[i] >= 0) - { - P_diag_i[i] = jj_counter; - P_diag_j[jj_counter] = fine_to_coarse[i]; - P_diag_data[jj_counter] = one; - jj_counter++; - } - /*-------------------------------------------------------------------- - * If i is an F-point, build interpolation. - *--------------------------------------------------------------------*/ - else - { - /* Diagonal part of P */ - P_diag_i[i] = jj_counter; - for (jj = minus_Wp_diag_i[row_counter]; jj < minus_Wp_diag_i[row_counter+1]; jj++) + if (num_cols_offd) { - //P_marker[row_counter] = jj_counter; - P_diag_j[jj_counter] = minus_Wp_diag_j[jj]; - P_diag_data[jj_counter] = - minus_Wp_diag_data[jj]; - jj_counter++; + A_offd_j = hypre_CSRMatrixJ(A_offd); + A_offd_data = hypre_CSRMatrixData(A_offd); } - /* Off-Diagonal part of P */ - P_offd_i[i] = jj_counter_offd; - - if (num_procs > 1) + index = 0; + for (i = 0; i < num_sends; i++) { - for (jj = minus_Wp_offd_i[row_counter]; jj < minus_Wp_offd_i[row_counter+1]; jj++) - { - //P_marker_offd[row_counter] = jj_counter_offd; - P_offd_j[jj_counter_offd] = minus_Wp_offd_j[jj]; - P_offd_data[jj_counter_offd] = - minus_Wp_offd_data[jj]; - jj_counter_offd++; - } + start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) + { + v_buf_data[index++] = u_data[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; + } } - row_counter++; - } - P_offd_i[i+1] = jj_counter_offd; - } - //hypre_printf("Num rows of Wp = %d\n", row_counter); - //P_offd_i[row_counter] = jj_counter_offd; - - - P = hypre_ParCSRMatrixCreate(comm, - hypre_ParCSRMatrixGlobalNumRows(A), - total_global_cpts, - hypre_ParCSRMatrixColStarts(A), - num_cpts_global, - 0, - P_diag_i[n_fine], - P_offd_i[n_fine]); - - P_diag = hypre_ParCSRMatrixDiag(P); - hypre_CSRMatrixData(P_diag) = P_diag_data; - hypre_CSRMatrixI(P_diag) = P_diag_i; - hypre_CSRMatrixJ(P_diag) = P_diag_j; - P_offd = hypre_ParCSRMatrixOffd(P); - hypre_CSRMatrixData(P_offd) = P_offd_data; - hypre_CSRMatrixI(P_offd) = P_offd_i; - hypre_CSRMatrixJ(P_offd) = P_offd_j; - - num_cols_P_offd = hypre_CSRMatrixNumCols(minus_Wp_offd); - HYPRE_BigInt *col_map_offd_tmp = hypre_ParCSRMatrixColMapOffd(minus_Wp); - if (P_offd_size) - { - col_map_offd_P = hypre_CTAlloc(HYPRE_BigInt, num_cols_P_offd, HYPRE_MEMORY_HOST); - for (i=0; i < num_cols_P_offd; i++) - { - col_map_offd_P[i] = col_map_offd_tmp[i]; - } - } - /* - num_cols_P_offd = 0; + comm_handle = hypre_ParCSRCommHandleCreate(1, comm_pkg, v_buf_data, Vext_data); + } + + /*----------------------------------------------------------------- + * Copy current approximation into temporary vector. + *-----------------------------------------------------------------*/ - if (P_offd_size) - { - P_marker = hypre_CTAlloc(HYPRE_Int, num_cols_minus_Wp_offd, HYPRE_MEMORY_HOST); #if 0 #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif #endif - for (i=0; i < num_cols_minus_Wp_offd; i++) - P_marker[i] = 0; - num_cols_P_offd = 0; - for (i=0; i < P_offd_size; i++) - { - index = P_offd_j[i]; - if (!P_marker[index]) + for (i = 0; i < n; i++) + { + Vtemp_data[i] = u_data[i]; + //printf("u_old[%d] = %e\n",i,Vtemp_data[i]); + } + if (num_procs > 1) + { + hypre_ParCSRCommHandleDestroy(comm_handle); + comm_handle = NULL; + } + + /*----------------------------------------------------------------- + * Relax points block by block + *-----------------------------------------------------------------*/ + for (i = 0; i < n_block; i++) + { + for (j = 0; j < blk_size; j++) { - num_cols_P_offd++; - P_marker[index] = 1; + bidx = i * blk_size + j; + res[j] = f_data[bidx]; + for (jj = A_diag_i[bidx]; jj < A_diag_i[bidx + 1]; jj++) + { + ii = A_diag_j[jj]; + if (method == 0) + { + // Jacobi for diagonal part + res[j] -= A_diag_data[jj] * Vtemp_data[ii]; + } + else if (method == 1) + { + // Gauss-Seidel for diagonal part + res[j] -= A_diag_data[jj] * u_data[ii]; + } + else + { + // Default do Jacobi for diagonal part + res[j] -= A_diag_data[jj] * Vtemp_data[ii]; + } + //printf("%d: Au= %e * %e =%e\n",ii,A_diag_data[jj],Vtemp_data[ii], res[j]); + } + for (jj = A_offd_i[bidx]; jj < A_offd_i[bidx + 1]; jj++) + { + // always do Jacobi for off-diagonal part + ii = A_offd_j[jj]; + res[j] -= A_offd_data[jj] * Vext_data[ii]; + } + //printf("%d: res = %e\n",bidx,res[j]); } - } - - col_map_offd_P = hypre_CTAlloc(HYPRE_Int, num_cols_P_offd, HYPRE_MEMORY_HOST); - index = 0; - for (i=0; i < num_cols_P_offd; i++) - { - while (P_marker[index]==0) index++; - col_map_offd_P[i] = index++; - } -#if 0 -#ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE -#endif -#endif - for (i=0; i < P_offd_size; i++) - P_offd_j[i] = hypre_BinarySearch(col_map_offd_P, - P_offd_j[i], - num_cols_P_offd); - hypre_TFree(P_marker, HYPRE_MEMORY_HOST); - } - */ + for (j = 0; j < blk_size; j++) + { + bidx1 = i * blk_size + j; + for (k = 0; k < blk_size; k++) + { + bidx = i * nb2 + j * blk_size + k; + u_data[bidx1] += res[k] * diaginv[bidx]; + //printf("u[%d] = %e, diaginv[%d] = %e\n",bidx1,u_data[bidx1],bidx,diaginv[bidx]); + } + //printf("u[%d] = %e\n",bidx1,u_data[bidx1]); + } + } - if (num_cols_P_offd) - { - hypre_ParCSRMatrixColMapOffd(P) = col_map_offd_P; - hypre_CSRMatrixNumCols(P_offd) = num_cols_P_offd; - } - hypre_MatvecCommPkgCreate(P); - //hypre_GetCommPkgRTFromCommPkgA(P,A, fine_to_coarse_offd); - - *P_ptr = P; - - //hypre_TFree(CF_marker_offd, HYPRE_MEMORY_HOST); - //hypre_TFree(int_buf_data, HYPRE_MEMORY_HOST); - hypre_TFree(fine_to_coarse, HYPRE_MEMORY_HOST); - //if (fine_to_coarse_offd) hypre_TFree(fine_to_coarse_offd, HYPRE_MEMORY_HOST); - //hypre_TFree(coarse_counter, HYPRE_MEMORY_HOST); - //hypre_TFree(jj_count, HYPRE_MEMORY_HOST); - //hypre_TFree(jj_count_offd, HYPRE_MEMORY_HOST); - hypre_TFree(C_marker, HYPRE_MEMORY_HOST); - hypre_TFree(F_marker, HYPRE_MEMORY_HOST); - hypre_ParCSRMatrixDestroy(A_ff); - hypre_ParCSRMatrixDestroy(A_fc); - hypre_ParCSRMatrixDestroy(A_ff_inv); - hypre_ParCSRMatrixDestroy(minus_Wp); + if (num_procs > 1) + { + hypre_TFree(Vext_data, HYPRE_MEMORY_HOST); + hypre_TFree(v_buf_data, HYPRE_MEMORY_HOST); + } + hypre_TFree(res, HYPRE_MEMORY_HOST); - return 0; + return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_MGRBlockRelaxSolveDevice + *--------------------------------------------------------------------------*/ - -/* Setup interpolation operator */ HYPRE_Int -hypre_MGRBuildInterp(hypre_ParCSRMatrix *A, - HYPRE_Int *CF_marker, - hypre_ParCSRMatrix *S, - HYPRE_BigInt *num_cpts_global, - HYPRE_Int num_functions, - HYPRE_Int *dof_func, - HYPRE_Int debug_flag, - HYPRE_Real trunc_factor, - HYPRE_Int max_elmts, - hypre_ParCSRMatrix **P, - HYPRE_Int interp_type, - HYPRE_Int numsweeps) +hypre_MGRBlockRelaxSolveDevice( hypre_ParCSRMatrix *B, + hypre_ParCSRMatrix *A, + hypre_ParVector *f, + hypre_ParVector *u, + hypre_ParVector *Vtemp, + HYPRE_Real relax_weight ) { -// HYPRE_Int i; - hypre_ParCSRMatrix *P_ptr = NULL; -// HYPRE_Real jac_trunc_threshold = trunc_factor; -// HYPRE_Real jac_trunc_threshold_minus = 0.5*jac_trunc_threshold; + hypre_GpuProfilingPushRange("BlockRelaxSolve"); - /* Interpolation for each level */ - if (interp_type <3) - { - hypre_MGRBuildP( A,CF_marker,num_cpts_global,interp_type,debug_flag,&P_ptr); + /* Copy f into temporary vector */ + hypre_ParVectorCopy(f, Vtemp); - /* Could do a few sweeps of Jacobi to further improve Jacobi interpolation P */ -/* - if(interp_type == 2) - { - for(i=0; i 0) - { - hypre_ParCSRMatrixTranspose(A, &AT, 1); - } + HYPRE_UNUSED_VAR(left_size); - /* Restriction for each level */ - if (restrict_type == 0) - { - hypre_MGRBuildP(A, CF_marker, num_cpts_global, restrict_type, debug_flag, &R_ptr); - } - else if (restrict_type == 1 || restrict_type == 2) - { - hypre_MGRBuildP(AT, CF_marker, num_cpts_global, restrict_type, debug_flag, &R_ptr); - } - else if (restrict_type == 3) - { - /* move diagonal to first entry */ - hypre_CSRMatrixReorder(hypre_ParCSRMatrixDiag(AT)); - hypre_MGRBuildInterpApproximateInverse(AT, CF_marker, num_cpts_global, debug_flag, &R_ptr); - hypre_BoomerAMGInterpTruncation(R_ptr, trunc_factor, max_elmts); - } - else - { - /* Build new strength matrix */ - hypre_BoomerAMGCreateS(AT, strong_threshold, max_row_sum, 1, NULL, &ST); - - /* Classical modified interpolation */ - hypre_BoomerAMGBuildInterp(AT, CF_marker, ST, num_cpts_global,1, NULL,debug_flag, - trunc_factor, max_elmts, &R_ptr); - } + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + HYPRE_Real *A_diag_data = hypre_CSRMatrixData(A_diag); + HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); + HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); + HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); + HYPRE_Real *A_offd_data = hypre_CSRMatrixData(A_offd); + HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); + hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); + hypre_ParCSRCommHandle *comm_handle = NULL; + + HYPRE_Int n = hypre_CSRMatrixNumRows(A_diag); + HYPRE_Int num_cols_offd = hypre_CSRMatrixNumCols(A_offd); + + hypre_Vector *u_local = hypre_ParVectorLocalVector(u); + HYPRE_Real *u_data = hypre_VectorData(u_local); + + hypre_Vector *f_local = hypre_ParVectorLocalVector(f); + HYPRE_Real *f_data = hypre_VectorData(f_local); + + hypre_Vector *Vtemp_local = hypre_ParVectorLocalVector(Vtemp); + HYPRE_Real *Vtemp_data = hypre_VectorData(Vtemp_local); + HYPRE_Real *Vext_data = NULL; + HYPRE_Real *v_buf_data = NULL; + + HYPRE_Int i, j, k; + HYPRE_Int ii, jj; + HYPRE_Int bidx, bidx1, bidxm1; + HYPRE_Int num_sends; + HYPRE_Int index, start; + HYPRE_Int num_procs, my_id; + HYPRE_Real *res; - /* set pointer to P */ - *R = R_ptr; + const HYPRE_Int nb2 = blk_size * blk_size; - /* Free memory */ - if (restrict_type > 0) - { - hypre_ParCSRMatrixDestroy(AT); - } - if (restrict_type > 5) - { - hypre_ParCSRMatrixDestroy(ST); - } + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); + // HYPRE_Int num_threads = hypre_NumThreads(); - return hypre_error_flag; -} + res = hypre_CTAlloc(HYPRE_Real, blk_size, HYPRE_MEMORY_HOST); -void hypre_blas_smat_inv_n4 (HYPRE_Real *a) -{ - const HYPRE_Real a11 = a[0], a12 = a[1], a13 = a[2], a14 = a[3]; - const HYPRE_Real a21 = a[4], a22 = a[5], a23 = a[6], a24 = a[7]; - const HYPRE_Real a31 = a[8], a32 = a[9], a33 = a[10], a34 = a[11]; - const HYPRE_Real a41 = a[12], a42 = a[13], a43 = a[14], a44 = a[15]; - - const HYPRE_Real M11 = a22*a33*a44 + a23*a34*a42 + a24*a32*a43 - a22*a34*a43 - a23*a32*a44 - a24*a33*a42; - const HYPRE_Real M12 = a12*a34*a43 + a13*a32*a44 + a14*a33*a42 - a12*a33*a44 - a13*a34*a42 - a14*a32*a43; - const HYPRE_Real M13 = a12*a23*a44 + a13*a24*a42 + a14*a22*a43 - a12*a24*a43 - a13*a22*a44 - a14*a23*a42; - const HYPRE_Real M14 = a12*a24*a33 + a13*a22*a34 + a14*a23*a32 - a12*a23*a34 - a13*a24*a32 - a14*a22*a33; - const HYPRE_Real M21 = a21*a34*a43 + a23*a31*a44 + a24*a33*a41 - a21*a33*a44 - a23*a34*a41 - a24*a31*a43; - const HYPRE_Real M22 = a11*a33*a44 + a13*a34*a41 + a14*a31*a43 - a11*a34*a43 - a13*a31*a44 - a14*a33*a41; - const HYPRE_Real M23 = a11*a24*a43 + a13*a21*a44 + a14*a23*a41 - a11*a23*a44 - a13*a24*a41 - a14*a21*a43; - const HYPRE_Real M24 = a11*a23*a34 + a13*a24*a31 + a14*a21*a33 - a11*a24*a33 - a13*a21*a34 - a14*a23*a31; - const HYPRE_Real M31 = a21*a32*a44 + a22*a34*a41 + a24*a31*a42 - a21*a34*a42 - a22*a31*a44 - a24*a32*a41; - const HYPRE_Real M32 = a11*a34*a42 + a12*a31*a44 + a14*a32*a41 - a11*a32*a44 - a12*a34*a41 - a14*a31*a42; - const HYPRE_Real M33 = a11*a22*a44 + a12*a24*a41 + a14*a21*a42 - a11*a24*a42 - a12*a21*a44 - a14*a22*a41; - const HYPRE_Real M34 = a11*a24*a32 + a12*a21*a34 + a14*a22*a31 - a11*a22*a34 - a12*a24*a31 - a14*a21*a32; - const HYPRE_Real M41 = a21*a33*a42 + a22*a31*a43 + a23*a32*a41 - a21*a32*a43 - a22*a33*a41 - a23*a31*a42; - const HYPRE_Real M42 = a11*a32*a43 + a12*a33*a41 + a13*a31*a42 - a11*a33*a42 - a12*a31*a43 - a13*a32*a41; - const HYPRE_Real M43 = a11*a23*a42 + a12*a21*a43 + a13*a22*a41 - a11*a22*a43 - a12*a23*a41 - a13*a21*a42; - const HYPRE_Real M44 = a11*a22*a33 + a12*a23*a31 + a13*a21*a32 - a11*a23*a32 - a12*a21*a33 - a13*a22*a31; - - const HYPRE_Real det = a11*M11 + a12*M21 + a13*M31 + a14*M41; - HYPRE_Real det_inv; - - //if ( fabs(det) < 1e-22 ) { - //hypre_printf("### WARNING: Matrix is nearly singular! det = %e\n", det); - /* - printf("##----------------------------------------------\n"); - printf("## %12.5e %12.5e %12.5e \n", a0, a1, a2); - printf("## %12.5e %12.5e %12.5e \n", a3, a4, a5); - printf("## %12.5e %12.5e %12.5e \n", a5, a6, a7); - printf("##----------------------------------------------\n"); - getchar(); - */ - //} - - det_inv = 1.0/det; - - a[0] = M11*det_inv; a[1] = M12*det_inv; a[2] = M13*det_inv; a[3] = M14*det_inv; - a[4] = M21*det_inv; a[5] = M22*det_inv; a[6] = M23*det_inv; a[7] = M24*det_inv; - a[8] = M31*det_inv; a[9] = M32*det_inv; a[10] = M33*det_inv; a[11] = M34*det_inv; - a[12] = M41*det_inv; a[13] = M42*det_inv; a[14] = M43*det_inv; a[15] = M44*det_inv; + if (!comm_pkg) + { + hypre_MatvecCommPkgCreate(A); + comm_pkg = hypre_ParCSRMatrixCommPkg(A); + } -} + if (num_procs > 1) + { + num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); -void hypre_blas_mat_inv(HYPRE_Real *a, - HYPRE_Int n) -{ - HYPRE_Int i,j,k,l,u,kn,in; - HYPRE_Real alinv; - if (n == 4) - { - hypre_blas_smat_inv_n4(a); - } - else - { - for (k=0; k 1) + { + hypre_ParCSRCommHandleDestroy(comm_handle); + comm_handle = NULL; + } - for (i=0; i 1) + { + hypre_TFree(Vext_data, HYPRE_MEMORY_HOST); + hypre_TFree(v_buf_data, HYPRE_MEMORY_HOST); + } + hypre_TFree(res, HYPRE_MEMORY_HOST); + return hypre_error_flag; } -HYPRE_Int hypre_block_jacobi_scaling(hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **B_ptr, - void *mgr_vdata, HYPRE_Int debug_flag) -{ - MPI_Comm comm = hypre_ParCSRMatrixComm(A); - - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; +/*-------------------------------------------------------------------------- + * hypre_BlockDiagInvLapack + * + * TODO (VPM): move this function to seq_ls + *--------------------------------------------------------------------------*/ - HYPRE_Int num_procs, my_id; +HYPRE_Int +hypre_BlockDiagInvLapack(HYPRE_Real *diag, HYPRE_Int N, HYPRE_Int blk_size) +{ + HYPRE_Int nblock, left_size, i; + //HYPRE_Int *IPIV = hypre_CTAlloc(HYPRE_Int, blk_size, HYPRE_MEMORY_HOST); + HYPRE_Int LWORK = blk_size * blk_size; + HYPRE_Real *WORK = hypre_CTAlloc(HYPRE_Real, LWORK, HYPRE_MEMORY_HOST); + HYPRE_Int INFO; + + HYPRE_Real wall_time; + HYPRE_Int my_id; + MPI_Comm comm = hypre_MPI_COMM_WORLD; + hypre_MPI_Comm_rank(comm, &my_id); - HYPRE_Int blk_size = (mgr_data -> block_size); - HYPRE_Int reserved_coarse_size = (mgr_data -> reserved_coarse_size); + nblock = N / blk_size; + left_size = N - blk_size * nblock; + i = nblock; + HYPRE_Int *IPIV = hypre_CTAlloc(HYPRE_Int, blk_size, HYPRE_MEMORY_HOST); - hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); - HYPRE_Real *A_diag_data = hypre_CSRMatrixData(A_diag); - HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); - HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); + wall_time = time_getWallclockSeconds(); + if (blk_size >= 2 && blk_size <= 4) + { + for (i = 0; i < nblock; i++) + { + hypre_MGRSmallBlkInverse(diag + i * LWORK, blk_size); + //hypre_blas_smat_inv_n2(diag+i*LWORK); + } + } + else if (blk_size > 4) + { + for (i = 0; i < nblock; i++) + { + hypre_dgetrf(&blk_size, &blk_size, diag + i * LWORK, &blk_size, IPIV, &INFO); + hypre_dgetri(&blk_size, diag + i * LWORK, &blk_size, IPIV, WORK, &LWORK, &INFO); + } + } - hypre_ParCSRMatrix *B; + // Left size + if (left_size > 0) + { + hypre_dgetrf(&left_size, &left_size, diag + i * LWORK, &left_size, IPIV, &INFO); + hypre_dgetri(&left_size, diag + i * LWORK, &left_size, IPIV, WORK, &LWORK, &INFO); + } + wall_time = time_getWallclockSeconds() - wall_time; + //if (my_id == 0) hypre_printf("Proc = %d, Compute inverse time: %1.5f\n", my_id, wall_time); - hypre_CSRMatrix *B_diag; - HYPRE_Real *B_diag_data; - HYPRE_Int *B_diag_i; - HYPRE_Int *B_diag_j; + hypre_TFree(IPIV, HYPRE_MEMORY_HOST); + hypre_TFree(WORK, HYPRE_MEMORY_HOST); - hypre_CSRMatrix *B_offd; - HYPRE_Int i,ii; - HYPRE_Int j,jj; - HYPRE_Int k; + return hypre_error_flag; +} - HYPRE_Int n = hypre_CSRMatrixNumRows(A_diag); - HYPRE_Int n_block, left_size,inv_size; +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixExtractBlockDiagHost + * + * Extract the block diagonal part of a A or a principal submatrix of A + * defined by a marker (point_type) in an associated CF_marker array. + * The result is an array of (flattened) block diagonals. + * + * If CF marker array is NULL, it returns an array of the (flattened) + * block diagonal of the entire matrix A. + * + * Options for diag_type are: + * diag_type = 1: return the inverse of the block diagonals + * otherwise : return the block diagonals + * + * On return, blk_diag_size contains the size of the returned + * (flattened) array. (i.e. nnz of extracted block diagonal) + * + * Input parameters are: + * A - original ParCSR matrix + * blk_size - Size of diagonal blocks to extract + * CF_marker - Array prescribing submatrix from which to extract + * block diagonals. Ignored if NULL. + * point_type - marker tag in CF_marker array to extract diagonal + * diag_type - Type of block diagonal entries to return. + * Currently supports block diagonal or inverse block + * diagonal entries (diag_type = 1). + * + * Output parameters are: + * diag_ptr - Array of block diagonal entries + * blk_diag_size - number of entries in extracted block diagonal + * (size of diag_ptr). + *--------------------------------------------------------------------------*/ - // HYPRE_Real wall_time; /* for debugging instrumentation */ - HYPRE_Int bidx,bidxm1,bidxp1; - HYPRE_Real * diaginv; +HYPRE_Int +hypre_ParCSRMatrixExtractBlockDiagHost( hypre_ParCSRMatrix *par_A, + HYPRE_Int blk_size, + HYPRE_Int num_points, + HYPRE_Int point_type, + HYPRE_Int *CF_marker, + HYPRE_Int diag_size, + HYPRE_Int diag_type, + HYPRE_Real *diag_data ) +{ + HYPRE_UNUSED_VAR(diag_size); + + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(par_A); + HYPRE_Int nrows = hypre_CSRMatrixNumRows(A_diag); + HYPRE_Complex *A_diag_data = hypre_CSRMatrixData(A_diag); + HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); + HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); + + HYPRE_Int i, j; + HYPRE_Int ii, jj; + HYPRE_Int bidx, bidxm1, bidxp1, ridx, didx; + HYPRE_Int row_offset; + + HYPRE_Int whole_num_points, cnt, bstart; + HYPRE_Int bs2 = blk_size * blk_size; + HYPRE_Int num_blocks; + HYPRE_Int left_size = 0; + + // First count the number of points matching point_type in CF_marker + num_blocks = num_points / blk_size; + whole_num_points = blk_size * num_blocks; + left_size = num_points - whole_num_points; + bstart = bs2 * num_blocks; + + /*----------------------------------------------------------------- + * Get all the diagonal sub-blocks + *-----------------------------------------------------------------*/ + + HYPRE_ANNOTATE_REGION_BEGIN("%s", "ExtractDiagSubBlocks"); + if (CF_marker == NULL) + { + // CF Marker is NULL. Consider all rows of matrix. + for (i = 0; i < num_blocks; i++) + { + bidxm1 = i * blk_size; + bidxp1 = (i + 1) * blk_size; - const HYPRE_Int nb2 = blk_size*blk_size; + for (j = 0; j < blk_size; j++) + { + for (ii = A_diag_i[bidxm1 + j]; ii < A_diag_i[bidxm1 + j + 1]; ii++) + { + jj = A_diag_j[ii]; + if ((jj >= bidxm1) && + (jj < bidxp1) && + hypre_cabs(A_diag_data[ii]) > HYPRE_REAL_MIN) + { + bidx = j * blk_size + jj - bidxm1; + diag_data[i * bs2 + bidx] = A_diag_data[ii]; + } + } + } + } - HYPRE_Int block_scaling_error = 0; + // deal with remaining points if any + if (left_size) + { + bidxm1 = whole_num_points; + bidxp1 = num_points; + for (j = 0; j < left_size; j++) + { + for (ii = A_diag_i[bidxm1 + j]; ii < A_diag_i[bidxm1 + j + 1]; ii++) + { + jj = A_diag_j[ii]; + if ((jj >= bidxm1) && + (jj < bidxp1) && + hypre_cabs(A_diag_data[ii]) > HYPRE_REAL_MIN) + { + bidx = j * left_size + jj - bidxm1; + diag_data[bstart + bidx] = A_diag_data[ii]; + } + } + } + } + } + else + { + // extract only block diagonal of submatrix defined by CF marker + cnt = 0; + row_offset = 0; + for (i = 0; i < nrows; i++) + { + if (CF_marker[i] == point_type) + { + bidx = cnt / blk_size; + ridx = cnt % blk_size; + bidxm1 = bidx * blk_size; + bidxp1 = (bidx + 1) * blk_size; + for (ii = A_diag_i[i]; ii < A_diag_i[i + 1]; ii++) + { + jj = A_diag_j[ii]; + if (CF_marker[jj] == point_type) + { + if ((jj - row_offset >= bidxm1) && + (jj - row_offset < bidxp1) && + (hypre_cabs(A_diag_data[ii]) > HYPRE_REAL_MIN)) + { + didx = bidx * bs2 + ridx * blk_size + jj - bidxm1 - row_offset; + diag_data[didx] = A_diag_data[ii]; + } + } + } + if (++cnt == whole_num_points) + { + break; + } + } + else + { + row_offset++; + } + } - hypre_MPI_Comm_size(comm,&num_procs); - hypre_MPI_Comm_rank(comm,&my_id); - // HYPRE_Int num_threads = hypre_NumThreads(); + // remaining points + for (i = whole_num_points; i < num_points; i++) + { + if (CF_marker[i] == point_type) + { + bidx = num_blocks; + ridx = cnt - whole_num_points; + bidxm1 = whole_num_points; + bidxp1 = num_points; + for (ii = A_diag_i[i]; ii < A_diag_i[i + 1]; ii++) + { + jj = A_diag_j[ii]; + if (CF_marker[jj] == point_type) + { + if ((jj - row_offset >= bidxm1) && + (jj - row_offset < bidxp1) && + (hypre_cabs(A_diag_data[ii]) > HYPRE_REAL_MIN)) + { + didx = bstart + ridx * left_size + jj - bidxm1 - row_offset; + diag_data[didx] = A_diag_data[ii]; + } + } + } + cnt++; + } + else + { + row_offset++; + } + } + } + HYPRE_ANNOTATE_REGION_END("%s", "ExtractDiagSubBlocks"); - //printf("n = %d\n",n); + /*----------------------------------------------------------------- + * Compute the inverses of all the diagonal sub-blocks + *-----------------------------------------------------------------*/ - if (my_id == num_procs) - { - n_block = (n - reserved_coarse_size) / blk_size; - left_size = n - blk_size*n_block; - } - else - { - n_block = n / blk_size; - left_size = n - blk_size*n_block; - } + if (diag_type == 1) + { + HYPRE_ANNOTATE_REGION_BEGIN("%s", "InvertDiagSubBlocks"); + if (blk_size > 1) + { + hypre_BlockDiagInvLapack(diag_data, num_points, blk_size); + } + else + { + for (i = 0; i < num_points; i++) + { + if (hypre_cabs(diag_data[i]) < HYPRE_REAL_MIN) + { + diag_data[i] = 0.0; + } + else + { + diag_data[i] = 1.0 / diag_data[i]; + } + } + } + HYPRE_ANNOTATE_REGION_END("%s", "InvertDiagSubBlocks"); + } - inv_size = nb2*n_block + left_size*left_size; + return hypre_error_flag; +} - //printf("inv_size = %d\n",inv_size); +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixBlockDiagMatrix + * + * Extract the block diagonal part of a A or a principal submatrix of A defined + * by a marker (point_type) in an associated CF_marker array. The result is + * a new block diagonal parCSR matrix. + * + * If CF marker array is NULL, it returns the block diagonal of the matrix A. + * + * Options for diag_type are: + * diag_type = 1: return the inverse of the block diagonals + * otherwise : return the block diagonals + * + * Input parameters are: + * par_A - original ParCSR matrix + * blk_size - Size of diagonal blocks to extract + * CF_marker - Array prescribing submatrix from which to extract block + * diagonals. Ignored if NULL. + * point_type - marker tag in CF_marker array to extract diagonal + * diag_type - Type of block diagonal entries to return. Currently supports + * block diagonal or inverse block diagonal entries. + * + * Output parameters are: + * B_ptr - New block diagonal matrix + *--------------------------------------------------------------------------*/ - hypre_blockRelax_setup(A,blk_size,reserved_coarse_size,&(mgr_data -> diaginv)); +HYPRE_Int +hypre_ParCSRMatrixBlockDiagMatrix( hypre_ParCSRMatrix *A, + HYPRE_Int blk_size, + HYPRE_Int point_type, + HYPRE_Int *CF_marker, + HYPRE_Int diag_type, + hypre_ParCSRMatrix **B_ptr ) +{ +#if defined (HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(A) ); - // if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_ParCSRMatrixBlockDiagMatrixDevice(A, blk_size, point_type, + CF_marker, diag_type, B_ptr); + } + else +#endif + { + hypre_ParCSRMatrixBlockDiagMatrixHost(A, blk_size, point_type, + CF_marker, diag_type, B_ptr); + } - /*----------------------------------------------------------------------- - * First Pass: Determine size of B and fill in - *-----------------------------------------------------------------------*/ + return hypre_error_flag; +} - B_diag_i = hypre_CTAlloc(HYPRE_Int, n+1, HYPRE_MEMORY_HOST); - B_diag_j = hypre_CTAlloc(HYPRE_Int, inv_size, HYPRE_MEMORY_HOST); - B_diag_data = hypre_CTAlloc(HYPRE_Real, inv_size, HYPRE_MEMORY_HOST); +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixBlockDiagMatrixHost + *--------------------------------------------------------------------------*/ - B_diag_i[n] = inv_size; +HYPRE_Int +hypre_ParCSRMatrixBlockDiagMatrixHost( hypre_ParCSRMatrix *A, + HYPRE_Int blk_size, + HYPRE_Int point_type, + HYPRE_Int *CF_marker, + HYPRE_Int diag_type, + hypre_ParCSRMatrix **B_ptr ) +{ + /* Input matrix info */ + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + HYPRE_BigInt *row_starts_A = hypre_ParCSRMatrixRowStarts(A); + HYPRE_BigInt num_rows_A = hypre_ParCSRMatrixGlobalNumRows(A); + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + HYPRE_Int A_diag_num_rows = hypre_CSRMatrixNumRows(A_diag); + + /* Global block matrix info */ + hypre_ParCSRMatrix *par_B; + HYPRE_BigInt num_rows_B; + HYPRE_BigInt row_starts_B[2]; + + /* Diagonal block matrix info */ + hypre_CSRMatrix *B_diag; + HYPRE_Int B_diag_num_rows = 0; + HYPRE_Int B_diag_size; + HYPRE_Int *B_diag_i; + HYPRE_Int *B_diag_j; + HYPRE_Complex *B_diag_data; + + /* Local variables */ + HYPRE_BigInt num_rows_big; + HYPRE_BigInt scan_recv; + HYPRE_Int num_procs, my_id; + HYPRE_Int nb2 = blk_size * blk_size; + HYPRE_Int num_blocks, num_left; + HYPRE_Int bidx, i, j, k; - //B_offd_i = hypre_CTAlloc(HYPRE_Int, n+1, HYPRE_MEMORY_HOST); - //B_offd_j = hypre_CTAlloc(HYPRE_Int, 1, HYPRE_MEMORY_HOST); - //B_offd_data = hypre_CTAlloc(HYPRE_Real, 1, HYPRE_MEMORY_HOST); + hypre_MPI_Comm_rank(comm, &my_id); + hypre_MPI_Comm_size(comm, &num_procs); - //B_offd_i[n] = 1; - /*----------------------------------------------------------------- - * Get all the diagonal sub-blocks - *-----------------------------------------------------------------*/ - diaginv = hypre_CTAlloc(HYPRE_Real, nb2, HYPRE_MEMORY_HOST); - //printf("n_block = %d\n",n_block); - for (i = 0;i < n_block; i++) - { - bidxm1 = i*blk_size; - bidxp1 = (i+1)*blk_size; + /* Sanity check */ + if ((num_rows_A > 0) && (num_rows_A < blk_size)) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Error!!! Input matrix is smaller than block size."); + return hypre_error_flag; + } - for (k = 0;k < blk_size; k++) - { - for (j = 0;j < blk_size; j++) - { - bidx = k*blk_size + j; - diaginv[bidx] = 0.0; - } + /*----------------------------------------------------------------- + * Count the number of points matching point_type in CF_marker + *-----------------------------------------------------------------*/ - for (ii = A_diag_i[bidxm1+k]; ii < A_diag_i[bidxm1+k+1]; ii++) + if (CF_marker == NULL) + { + B_diag_num_rows = A_diag_num_rows; + } + else + { +#if !defined(_MSC_VER) && defined(HYPRE_USING_OPENMP) + #pragma omp parallel for private(i) reduction(+:B_diag_num_rows) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < A_diag_num_rows; i++) { - jj = A_diag_j[ii]; - if (jj >= bidxm1 && jj < bidxp1 && fabs(A_diag_data[ii]) > SMALLREAL) - { - bidx = k*blk_size + jj - bidxm1; - //printf("jj = %d,val = %e, bidx = %d\n",jj,A_diag_data[ii],bidx); - diaginv[bidx] = A_diag_data[ii]; - } + B_diag_num_rows += (CF_marker[i] == point_type) ? 1 : 0; } - } + } + num_blocks = B_diag_num_rows / blk_size; + num_left = B_diag_num_rows - num_blocks * blk_size; + B_diag_size = blk_size * (blk_size * num_blocks) + num_left * num_left; - /* for (k = 0;k < blk_size; k++) */ - /* { */ - /* for (j = 0;j < blk_size; j++) */ - /* { */ - /* bidx = k*blk_size + j; */ - /* printf("diaginv[%d] = %e\n",bidx,diaginv[bidx]); */ - /* } */ - /* } */ + /*----------------------------------------------------------------- + * Compute global number of rows and partitionings + *-----------------------------------------------------------------*/ - hypre_blas_mat_inv(diaginv, blk_size); + if (CF_marker) + { + num_rows_big = (HYPRE_BigInt) B_diag_num_rows; + hypre_MPI_Scan(&num_rows_big, &scan_recv, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); - for (k = 0;k < blk_size; k++) - { - B_diag_i[i*blk_size+k] = i*nb2 + k*blk_size; - //B_offd_i[i*nb2+k] = 0; + /* first point in my range */ + row_starts_B[0] = scan_recv - num_rows_big; - for (j = 0;j < blk_size; j++) + /* first point in next proc's range */ + row_starts_B[1] = scan_recv; + if (my_id == (num_procs - 1)) { - bidx = i*nb2 + k*blk_size + j; - B_diag_j[bidx] = i*blk_size + j; - B_diag_data[bidx] = diaginv[k*blk_size + j]; + num_rows_B = row_starts_B[1]; } - } - } - - //printf("Before create\n"); - B = hypre_ParCSRMatrixCreate(comm, - hypre_ParCSRMatrixGlobalNumRows(A), - hypre_ParCSRMatrixGlobalNumCols(A), - hypre_ParCSRMatrixRowStarts(A), - hypre_ParCSRMatrixColStarts(A), - 0, - inv_size, - 0); - //printf("After create\n"); - B_diag = hypre_ParCSRMatrixDiag(B); - hypre_CSRMatrixData(B_diag) = B_diag_data; - hypre_CSRMatrixI(B_diag) = B_diag_i; - hypre_CSRMatrixJ(B_diag) = B_diag_j; - B_offd = hypre_ParCSRMatrixOffd(B); - hypre_CSRMatrixData(B_offd) = NULL; - hypre_CSRMatrixI(B_offd) = NULL; - hypre_CSRMatrixJ(B_offd) = NULL; - - *B_ptr = B; - - return(block_scaling_error); -} - -HYPRE_Int hypre_blockRelax_solve (hypre_ParCSRMatrix *A, - hypre_ParVector *f, - hypre_ParVector *u, - HYPRE_Real blk_size, - HYPRE_Int n_block, - HYPRE_Int left_size, - HYPRE_Int method, - HYPRE_Real *diaginv, - hypre_ParVector *Vtemp) -{ - MPI_Comm comm = hypre_ParCSRMatrixComm(A); - hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); - HYPRE_Real *A_diag_data = hypre_CSRMatrixData(A_diag); - HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); - HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); - hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); - HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); - HYPRE_Real *A_offd_data = hypre_CSRMatrixData(A_offd); - HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); - hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); - hypre_ParCSRCommHandle *comm_handle; - - HYPRE_Int n = hypre_CSRMatrixNumRows(A_diag); - HYPRE_Int num_cols_offd = hypre_CSRMatrixNumCols(A_offd); - - hypre_Vector *u_local = hypre_ParVectorLocalVector(u); - HYPRE_Real *u_data = hypre_VectorData(u_local); - - hypre_Vector *f_local = hypre_ParVectorLocalVector(f); - HYPRE_Real *f_data = hypre_VectorData(f_local); - - hypre_Vector *Vtemp_local = hypre_ParVectorLocalVector(Vtemp); - HYPRE_Real *Vtemp_data = hypre_VectorData(Vtemp_local); - HYPRE_Real *Vext_data = NULL; - HYPRE_Real *v_buf_data; - - HYPRE_Int i, j, k; - HYPRE_Int ii, jj; - HYPRE_Int bidx,bidx1; - HYPRE_Int relax_error = 0; - HYPRE_Int num_sends; - HYPRE_Int index, start; - HYPRE_Int num_procs, my_id; - HYPRE_Real *res; - - const HYPRE_Int nb2 = blk_size*blk_size; - - hypre_MPI_Comm_size(comm,&num_procs); - hypre_MPI_Comm_rank(comm,&my_id); - // HYPRE_Int num_threads = hypre_NumThreads(); - - res = hypre_CTAlloc(HYPRE_Real, blk_size, HYPRE_MEMORY_HOST); - - if (!comm_pkg) - { - hypre_MatvecCommPkgCreate(A); - comm_pkg = hypre_ParCSRMatrixCommPkg(A); - } + hypre_MPI_Bcast(&num_rows_B, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); + } + else + { + row_starts_B[0] = row_starts_A[0]; + row_starts_B[1] = row_starts_A[1]; + num_rows_B = num_rows_A; + } - if (num_procs > 1) - { - num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); + /* Create matrix B */ + par_B = hypre_ParCSRMatrixCreate(comm, + num_rows_B, + num_rows_B, + row_starts_B, + row_starts_B, + 0, + B_diag_size, + 0); + hypre_ParCSRMatrixInitialize_v2(par_B, HYPRE_MEMORY_HOST); + B_diag = hypre_ParCSRMatrixDiag(par_B); + B_diag_i = hypre_CSRMatrixI(B_diag); + B_diag_j = hypre_CSRMatrixJ(B_diag); + B_diag_data = hypre_CSRMatrixData(B_diag); - v_buf_data = hypre_CTAlloc(HYPRE_Real, - hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), HYPRE_MEMORY_HOST); + /*----------------------------------------------------------------------- + * Extract coefficients + *-----------------------------------------------------------------------*/ - Vext_data = hypre_CTAlloc(HYPRE_Real, num_cols_offd, HYPRE_MEMORY_HOST); + hypre_ParCSRMatrixExtractBlockDiagHost(A, blk_size, B_diag_num_rows, + point_type, CF_marker, + B_diag_size, diag_type, + B_diag_data); - if (num_cols_offd) - { - A_offd_j = hypre_CSRMatrixJ(A_offd); - A_offd_data = hypre_CSRMatrixData(A_offd); - } + /*----------------------------------------------------------------- + * Set row/col indices of diagonal blocks + *-----------------------------------------------------------------*/ - index = 0; - for (i = 0; i < num_sends; i++) - { - start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j=start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) - v_buf_data[index++] - = u_data[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; - } + B_diag_i[B_diag_num_rows] = B_diag_size; + for (i = 0; i < num_blocks; i++) + { + //diag_local = &diag[i * nb2]; + for (k = 0; k < blk_size; k++) + { + B_diag_i[i * blk_size + k] = i * nb2 + k * blk_size; - comm_handle = hypre_ParCSRCommHandleCreate( 1, comm_pkg, v_buf_data, - Vext_data); - } + for (j = 0; j < blk_size; j++) + { + bidx = i * nb2 + k * blk_size + j; + B_diag_j[bidx] = i * blk_size + j; + //B_diag_data[bidx] = diag_local[k * blk_size + j]; + } + } + } - /*----------------------------------------------------------------- - * Copy current approximation into temporary vector. - *-----------------------------------------------------------------*/ + /*----------------------------------------------------------------- + * Treat the remaining points + *-----------------------------------------------------------------*/ -#if 0 -#ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE -#endif -#endif - for (i = 0; i < n; i++) - { - Vtemp_data[i] = u_data[i]; - //printf("u_old[%d] = %e\n",i,Vtemp_data[i]); - } - if (num_procs > 1) - { - hypre_ParCSRCommHandleDestroy(comm_handle); - comm_handle = NULL; - } + //diag_local = &diag[num_blocks * nb2]; + for (k = 0; k < num_left; k++) + { + B_diag_i[num_blocks * blk_size + k] = num_blocks * nb2 + k * num_left; - /*----------------------------------------------------------------- - * Relax points block by block - *-----------------------------------------------------------------*/ - for (i = 0;i < n_block; i++) - { - for (j = 0;j < blk_size; j++) - { - bidx = i*blk_size +j; - res[j] = f_data[bidx]; - for (jj = A_diag_i[bidx]; jj < A_diag_i[bidx+1]; jj++) - { - ii = A_diag_j[jj]; - if (method == 0) - { - // Jacobi for diagonal part - res[j] -= A_diag_data[jj] * Vtemp_data[ii]; - } - else if (method == 1) - { - // Gauss-Seidel for diagonal part - res[j] -= A_diag_data[jj] * u_data[ii]; - } - else - { - // Default do Jacobi for diagonal part - res[j] -= A_diag_data[jj] * Vtemp_data[ii]; - } - //printf("%d: Au= %e * %e =%e\n",ii,A_diag_data[jj],Vtemp_data[ii], res[j]); - } - for (jj = A_offd_i[bidx]; jj < A_offd_i[bidx+1]; jj++) + for (j = 0; j < num_left; j++) { - // always do Jacobi for off-diagonal part - ii = A_offd_j[jj]; - res[j] -= A_offd_data[jj] * Vext_data[ii]; + bidx = num_blocks * nb2 + k * num_left + j; + B_diag_j[bidx] = num_blocks * blk_size + j; + //B_diag_data[bidx] = diag_local[k * num_left + j]; } - //printf("%d: res = %e\n",bidx,res[j]); - } + } - for (j = 0;j < blk_size; j++) - { - bidx1 = i*blk_size +j; - for (k = 0;k < blk_size; k++) - { - bidx = i*nb2 +j*blk_size+k; - u_data[bidx1] += res[k]*diaginv[bidx]; - //printf("u[%d] = %e, diaginv[%d] = %e\n",bidx1,u_data[bidx1],bidx,diaginv[bidx]); - } - //printf("u[%d] = %e\n",bidx1,u_data[bidx1]); - } - } + /* Set output pointer */ + *B_ptr = par_B; - if (num_procs > 1) - { - hypre_TFree(Vext_data, HYPRE_MEMORY_HOST); - hypre_TFree(v_buf_data, HYPRE_MEMORY_HOST); - } - hypre_TFree(res, HYPRE_MEMORY_HOST); - return(relax_error); + return hypre_error_flag; } -HYPRE_Int hypre_block_gs (hypre_ParCSRMatrix *A, - hypre_ParVector *f, - hypre_ParVector *u, - HYPRE_Real blk_size, - HYPRE_Int n_block, - HYPRE_Int left_size, - HYPRE_Real *diaginv, - hypre_ParVector *Vtemp) +/*-------------------------------------------------------------------------- + * hypre_MGRBlockRelaxSetup + * + * Setup block smoother. Computes the entries of the inverse of the block + * diagonal matrix with blk_size diagonal blocks. + * + * Current implementation ignores reserved C-pts and acts on whole matrix. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRBlockRelaxSetup( hypre_ParCSRMatrix *A, + HYPRE_Int blk_size, + HYPRE_Real **diaginvptr ) { - MPI_Comm comm = hypre_ParCSRMatrixComm(A); - hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); - HYPRE_Real *A_diag_data = hypre_CSRMatrixData(A_diag); - HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); - HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); - hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); - HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); - HYPRE_Real *A_offd_data = hypre_CSRMatrixData(A_offd); - HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); - hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); - hypre_ParCSRCommHandle *comm_handle; - - HYPRE_Int n = hypre_CSRMatrixNumRows(A_diag); - HYPRE_Int num_cols_offd = hypre_CSRMatrixNumCols(A_offd); - - hypre_Vector *u_local = hypre_ParVectorLocalVector(u); - HYPRE_Real *u_data = hypre_VectorData(u_local); - - hypre_Vector *f_local = hypre_ParVectorLocalVector(f); - HYPRE_Real *f_data = hypre_VectorData(f_local); - - hypre_Vector *Vtemp_local = hypre_ParVectorLocalVector(Vtemp); - HYPRE_Real *Vtemp_data = hypre_VectorData(Vtemp_local); - HYPRE_Real *Vext_data = NULL; - HYPRE_Real *v_buf_data; - - HYPRE_Int i, j, k; - HYPRE_Int ii, jj; - HYPRE_Int bidx,bidx1; - HYPRE_Int relax_error = 0; - HYPRE_Int num_sends; - HYPRE_Int index, start; - HYPRE_Int num_procs, my_id; - HYPRE_Real *res; - - const HYPRE_Int nb2 = blk_size*blk_size; - - hypre_MPI_Comm_size(comm,&num_procs); - hypre_MPI_Comm_rank(comm,&my_id); - //HYPRE_Int num_threads = hypre_NumThreads(); - - res = hypre_CTAlloc(HYPRE_Real, blk_size, HYPRE_MEMORY_HOST); - - if (!comm_pkg) - { - hypre_MatvecCommPkgCreate(A); - comm_pkg = hypre_ParCSRMatrixCommPkg(A); - } + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + HYPRE_Int num_rows = hypre_CSRMatrixNumRows(A_diag); - if (num_procs > 1) - { - num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); + HYPRE_Int num_blocks; + HYPRE_Int diag_size; + HYPRE_Complex *diaginv = *diaginvptr; - v_buf_data = hypre_CTAlloc(HYPRE_Real, - hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), HYPRE_MEMORY_HOST); + num_blocks = 1 + (num_rows - 1) / blk_size; + diag_size = blk_size * (blk_size * num_blocks); - Vext_data = hypre_CTAlloc(HYPRE_Real, num_cols_offd, HYPRE_MEMORY_HOST); + hypre_TFree(diaginv, HYPRE_MEMORY_HOST); + diaginv = hypre_CTAlloc(HYPRE_Complex, diag_size, HYPRE_MEMORY_HOST); - if (num_cols_offd) - { - A_offd_j = hypre_CSRMatrixJ(A_offd); - A_offd_data = hypre_CSRMatrixData(A_offd); - } + hypre_ParCSRMatrixExtractBlockDiagHost(A, blk_size, num_rows, 0, NULL, + diag_size, 1, diaginv); - index = 0; - for (i = 0; i < num_sends; i++) - { - start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j=start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) - v_buf_data[index++] - = u_data[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; - } + *diaginvptr = diaginv; - comm_handle = hypre_ParCSRCommHandleCreate( 1, comm_pkg, v_buf_data, - Vext_data); - } +#if 0 + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + HYPRE_Real *A_diag_data = hypre_CSRMatrixData(A_diag); + HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); + HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); + HYPRE_Int n = hypre_CSRMatrixNumRows(A_diag); - /*----------------------------------------------------------------- - * Copy current approximation into temporary vector. - *-----------------------------------------------------------------*/ + HYPRE_Int i, j, k; + HYPRE_Int ii, jj; + HYPRE_Int bidx, bidxm1, bidxp1; + HYPRE_Int num_procs, my_id; -#if 0 -#ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE -#endif -#endif - for (i = 0; i < n; i++) - { - Vtemp_data[i] = u_data[i]; - //printf("u_old[%d] = %e\n",i,Vtemp_data[i]); - } - if (num_procs > 1) - { - hypre_ParCSRCommHandleDestroy(comm_handle); - comm_handle = NULL; - } + const HYPRE_Int nb2 = blk_size * blk_size; + HYPRE_Int n_block; + HYPRE_Int left_size, inv_size; + HYPRE_Real *diaginv = *diaginvptr; - /*----------------------------------------------------------------- - * Relax points block by block - *-----------------------------------------------------------------*/ - for (i = 0;i < n_block; i++) - { - for (j = 0;j < blk_size; j++) - { - bidx = i*blk_size +j; - res[j] = f_data[bidx]; - for (jj = A_diag_i[bidx]; jj < A_diag_i[bidx+1]; jj++) - { - ii = A_diag_j[jj]; - //res[j] -= A_diag_data[jj] * Vtemp_data[ii]; - //printf("my_id = %d, %d: Au = %e * %e\n",my_id,ii,A_diag_data[jj],Vtemp_data[ii]); - res[j] -= A_diag_data[jj] * u_data[ii]; - //printf("%d: Au= %e * %e =%e\n",ii,A_diag_data[jj],Vtemp_data[ii], res[j]); - } - for (jj = A_offd_i[bidx]; jj < A_offd_i[bidx+1]; jj++) - { - ii = A_offd_j[jj]; - res[j] -= A_offd_data[jj] * Vext_data[ii]; - } - //printf("%d: res = %e\n",bidx,res[j]); - } - for (j = 0;j < blk_size; j++) - { - bidx1 = i*blk_size +j; - for (k = 0;k < blk_size; k++) - { - bidx = i*nb2 +j*blk_size+k; - u_data[bidx1] += res[k]*diaginv[bidx]; - //printf("u[%d] = %e, diaginv[%d] = %e\n",bidx1,u_data[bidx1],bidx,diaginv[bidx]); - } - //printf("u[%d] = %e\n",bidx1,u_data[bidx1]); - } - } + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); + //HYPRE_Int num_threads = hypre_NumThreads(); - if (num_procs > 1) - { - hypre_TFree(Vext_data, HYPRE_MEMORY_HOST); - hypre_TFree(v_buf_data, HYPRE_MEMORY_HOST); - } - hypre_TFree(res, HYPRE_MEMORY_HOST); - return(relax_error); -} + if (my_id == num_procs) + { + n_block = (n - reserved_coarse_size) / blk_size; + left_size = n - blk_size * n_block; + } + else + { + n_block = n / blk_size; + left_size = n - blk_size * n_block; + } -/*Block smoother*/ -HYPRE_Int -hypre_blockRelax_setup(hypre_ParCSRMatrix *A, - HYPRE_Int blk_size, - HYPRE_Int reserved_coarse_size, - HYPRE_Real **diaginvptr) -{ - MPI_Comm comm = hypre_ParCSRMatrixComm(A); - hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); - HYPRE_Real *A_diag_data = hypre_CSRMatrixData(A_diag); - HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); - HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); - HYPRE_Int n = hypre_CSRMatrixNumRows(A_diag); - - HYPRE_Int i, j,k; - HYPRE_Int ii, jj; - HYPRE_Int bidx,bidxm1,bidxp1; - HYPRE_Int num_procs, my_id; - - const HYPRE_Int nb2 = blk_size*blk_size; - HYPRE_Int n_block; - HYPRE_Int left_size,inv_size; - HYPRE_Real *diaginv = *diaginvptr; - - - hypre_MPI_Comm_size(comm,&num_procs); - hypre_MPI_Comm_rank(comm,&my_id); - //HYPRE_Int num_threads = hypre_NumThreads(); - - if (my_id == num_procs) - { - n_block = (n - reserved_coarse_size) / blk_size; - left_size = n - blk_size*n_block; - } - else - { - n_block = n / blk_size; - left_size = n - blk_size*n_block; - } + n_block = n / blk_size; + left_size = n - blk_size * n_block; - inv_size = nb2*n_block + left_size*left_size; + inv_size = nb2 * n_block + left_size * left_size; - if (diaginv !=NULL) - { - hypre_TFree(diaginv, HYPRE_MEMORY_HOST); - diaginv = hypre_CTAlloc(HYPRE_Real, inv_size, HYPRE_MEMORY_HOST); - } - else { - diaginv = hypre_CTAlloc(HYPRE_Real, inv_size, HYPRE_MEMORY_HOST); - } + if (diaginv != NULL) + { + hypre_TFree(diaginv, HYPRE_MEMORY_HOST); + diaginv = hypre_CTAlloc(HYPRE_Real, inv_size, HYPRE_MEMORY_HOST); + } + else + { + diaginv = hypre_CTAlloc(HYPRE_Real, inv_size, HYPRE_MEMORY_HOST); + } + + /*----------------------------------------------------------------- + * Get all the diagonal sub-blocks + *-----------------------------------------------------------------*/ + for (i = 0; i < n_block; i++) + { + bidxm1 = i * blk_size; + bidxp1 = (i + 1) * blk_size; + //printf("bidxm1 = %d,bidxp1 = %d\n",bidxm1,bidxp1); - /*----------------------------------------------------------------- - * Get all the diagonal sub-blocks - *-----------------------------------------------------------------*/ - for (i = 0;i < n_block; i++) - { - bidxm1 = i*blk_size; - bidxp1 = (i+1)*blk_size; - //printf("bidxm1 = %d,bidxp1 = %d\n",bidxm1,bidxp1); - - for (k = 0;k < blk_size; k++) - { - for (j = 0;j < blk_size; j++) + for (k = 0; k < blk_size; k++) { - bidx = i*nb2 + k*blk_size + j; - diaginv[bidx] = 0.0; + for (j = 0; j < blk_size; j++) + { + bidx = i * nb2 + k * blk_size + j; + diaginv[bidx] = 0.0; + } + + for (ii = A_diag_i[bidxm1 + k]; ii < A_diag_i[bidxm1 + k + 1]; ii++) + { + jj = A_diag_j[ii]; + if (jj >= bidxm1 && jj < bidxp1 && hypre_cabs(A_diag_data[ii]) > HYPRE_REAL_MIN) + { + bidx = i * nb2 + k * blk_size + jj - bidxm1; + //printf("jj = %d,val = %e, bidx = %d\n",jj,A_diag_data[ii],bidx); + diaginv[bidx] = A_diag_data[ii]; + } + } } + } - for (ii = A_diag_i[bidxm1+k]; ii < A_diag_i[bidxm1+k+1]; ii++) + for (i = 0; i < left_size; i++) + { + bidxm1 = n_block * nb2 + i * blk_size; + bidxp1 = n_block * nb2 + (i + 1) * blk_size; + for (j = 0; j < left_size; j++) { - jj = A_diag_j[ii]; - if (jj >= bidxm1 && jj < bidxp1 && fabs(A_diag_data[ii]) > SMALLREAL) - { - bidx = i*nb2 + k*blk_size + jj - bidxm1; - //printf("jj = %d,val = %e, bidx = %d\n",jj,A_diag_data[ii],bidx); - diaginv[bidx] = A_diag_data[ii]; - } + bidx = n_block * nb2 + i * blk_size + j; + diaginv[bidx] = 0.0; } - } - } - for (i = 0;i < left_size; i++) - { - bidxm1 =n_block*nb2 + i*blk_size; - bidxp1 =n_block*nb2 + (i+1)*blk_size; - for (j = 0;j < left_size; j++) - { - bidx = n_block*nb2 + i*blk_size +j; - diaginv[bidx] = 0.0; - } - - for (ii = A_diag_i[n_block*blk_size + i]; ii < A_diag_i[n_block*blk_size+i+1]; ii++) - { - jj = A_diag_j[ii]; - if (jj > n_block*blk_size) + for (ii = A_diag_i[n_block * blk_size + i]; ii < A_diag_i[n_block * blk_size + i + 1]; ii++) { - bidx = n_block*nb2 + i*blk_size + jj - n_block*blk_size; - diaginv[bidx] = A_diag_data[ii]; + jj = A_diag_j[ii]; + if (jj > n_block * blk_size) + { + bidx = n_block * nb2 + i * blk_size + jj - n_block * blk_size; + diaginv[bidx] = A_diag_data[ii]; + } } - } - } - - - /*----------------------------------------------------------------- - * compute the inverses of all the diagonal sub-blocks - *-----------------------------------------------------------------*/ - if (blk_size > 1) - { - for (i = 0;i < n_block; i++) - { - hypre_blas_mat_inv(diaginv+i*nb2, blk_size); - } - hypre_blas_mat_inv(diaginv+(HYPRE_Int)(blk_size*nb2),left_size); - } - else - { - for (i = 0;i < n; i++) - { - // FIX-ME: zero-diagonal should be tested previously - if (fabs(diaginv[i]) < SMALLREAL) - diaginv[i] = 0.0; - else - diaginv[i] = 1.0 / diaginv[i]; - } - } + } - *diaginvptr = diaginv; + /*----------------------------------------------------------------- + * compute the inverses of all the diagonal sub-blocks + *-----------------------------------------------------------------*/ + if (blk_size > 1) + { + for (i = 0; i < n_block; i++) + { + hypre_blas_mat_inv(diaginv + i * nb2, blk_size); + } + hypre_blas_mat_inv(diaginv + (HYPRE_Int)(blk_size * nb2), left_size); + } + else + { + for (i = 0; i < n; i++) + { + /* TODO: zero-diagonal should be tested previously */ + if (hypre_cabs(diaginv[i]) < HYPRE_REAL_MIN) + { + diaginv[i] = 0.0; + } + else + { + diaginv[i] = 1.0 / diaginv[i]; + } + } + } - return 1; + *diaginvptr = diaginv; +#endif + return hypre_error_flag; } - +#if 0 HYPRE_Int hypre_blockRelax(hypre_ParCSRMatrix *A, - hypre_ParVector *f, - hypre_ParVector *u, - HYPRE_Int blk_size, - HYPRE_Int reserved_coarse_size, - HYPRE_Int method, - hypre_ParVector *Vtemp, - hypre_ParVector *Ztemp) + hypre_ParVector *f, + hypre_ParVector *u, + HYPRE_Int blk_size, + HYPRE_Int reserved_coarse_size, + HYPRE_Int method, + hypre_ParVector *Vtemp, + hypre_ParVector *Ztemp) { - MPI_Comm comm = hypre_ParCSRMatrixComm(A); - hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); - HYPRE_Real *A_diag_data = hypre_CSRMatrixData(A_diag); - HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); - HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); - HYPRE_Int n = hypre_CSRMatrixNumRows(A_diag); + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + HYPRE_Real *A_diag_data = hypre_CSRMatrixData(A_diag); + HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); + HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); + HYPRE_Int n = hypre_CSRMatrixNumRows(A_diag); - HYPRE_Int i, j,k; - HYPRE_Int ii, jj; + HYPRE_Int i, j, k; + HYPRE_Int ii, jj; - HYPRE_Int bidx,bidxm1,bidxp1; - HYPRE_Int relax_error = 0; + HYPRE_Int bidx, bidxm1, bidxp1; - HYPRE_Int num_procs, my_id; + HYPRE_Int num_procs, my_id; - const HYPRE_Int nb2 = blk_size*blk_size; - HYPRE_Int n_block; - HYPRE_Int left_size,inv_size; - HYPRE_Real *diaginv; + const HYPRE_Int nb2 = blk_size * blk_size; + HYPRE_Int n_block; + HYPRE_Int left_size, inv_size; + HYPRE_Real *diaginv; - hypre_MPI_Comm_size(comm,&num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); - //HYPRE_Int num_threads = hypre_NumThreads(); + //HYPRE_Int num_threads = hypre_NumThreads(); - if (my_id == num_procs) - { - n_block = (n - reserved_coarse_size) / blk_size; - left_size = n - blk_size*n_block; - } - else - { - n_block = n / blk_size; - left_size = n - blk_size*n_block; - } + if (my_id == num_procs) + { + n_block = (n - reserved_coarse_size) / blk_size; + left_size = n - blk_size * n_block; + } + else + { + n_block = n / blk_size; + left_size = n - blk_size * n_block; + } - inv_size = nb2*n_block + left_size*left_size; - - diaginv = hypre_CTAlloc(HYPRE_Real, inv_size, HYPRE_MEMORY_HOST); - /*----------------------------------------------------------------- - * Get all the diagonal sub-blocks - *-----------------------------------------------------------------*/ - for (i = 0;i < n_block; i++) - { - bidxm1 = i*blk_size; - bidxp1 = (i+1)*blk_size; - //printf("bidxm1 = %d,bidxp1 = %d\n",bidxm1,bidxp1); - - for (k = 0;k < blk_size; k++) - { - for (j = 0;j < blk_size; j++) + inv_size = nb2 * n_block + left_size * left_size; + + diaginv = hypre_CTAlloc(HYPRE_Real, inv_size, HYPRE_MEMORY_HOST); + /*----------------------------------------------------------------- + * Get all the diagonal sub-blocks + *-----------------------------------------------------------------*/ + for (i = 0; i < n_block; i++) + { + bidxm1 = i * blk_size; + bidxp1 = (i + 1) * blk_size; + //printf("bidxm1 = %d,bidxp1 = %d\n",bidxm1,bidxp1); + + for (k = 0; k < blk_size; k++) { - bidx = i*nb2 + k*blk_size + j; - diaginv[bidx] = 0.0; + for (j = 0; j < blk_size; j++) + { + bidx = i * nb2 + k * blk_size + j; + diaginv[bidx] = 0.0; + } + + for (ii = A_diag_i[bidxm1 + k]; ii < A_diag_i[bidxm1 + k + 1]; ii++) + { + jj = A_diag_j[ii]; + + if (jj >= bidxm1 && jj < bidxp1 && hypre_abs(A_diag_data[ii]) > HYPRE_REAL_MIN) + { + bidx = i * nb2 + k * blk_size + jj - bidxm1; + //printf("jj = %d,val = %e, bidx = %d\n",jj,A_diag_data[ii],bidx); + diaginv[bidx] = A_diag_data[ii]; + } + } } + } - for (ii = A_diag_i[bidxm1+k]; ii < A_diag_i[bidxm1+k+1]; ii++) + for (i = 0; i < left_size; i++) + { + bidxm1 = n_block * nb2 + i * blk_size; + bidxp1 = n_block * nb2 + (i + 1) * blk_size; + for (j = 0; j < left_size; j++) { - jj = A_diag_j[ii]; - - if (jj >= bidxm1 && jj < bidxp1 && fabs(A_diag_data[ii]) > SMALLREAL) - { - bidx = i*nb2 + k*blk_size + jj - bidxm1; - //printf("jj = %d,val = %e, bidx = %d\n",jj,A_diag_data[ii],bidx); - diaginv[bidx] = A_diag_data[ii]; - } + bidx = n_block * nb2 + i * blk_size + j; + diaginv[bidx] = 0.0; } - } - } - for (i = 0;i < left_size; i++) - { - bidxm1 =n_block*nb2 + i*blk_size; - bidxp1 =n_block*nb2 + (i+1)*blk_size; - for (j = 0;j < left_size; j++) - { - bidx = n_block*nb2 + i*blk_size +j; - diaginv[bidx] = 0.0; - } - - for (ii = A_diag_i[n_block*blk_size + i]; ii < A_diag_i[n_block*blk_size+i+1]; ii++) - { - jj = A_diag_j[ii]; - if (jj > n_block*blk_size) + for (ii = A_diag_i[n_block * blk_size + i]; ii < A_diag_i[n_block * blk_size + i + 1]; ii++) { - bidx = n_block*nb2 + i*blk_size + jj - n_block*blk_size; - diaginv[bidx] = A_diag_data[ii]; + jj = A_diag_j[ii]; + if (jj > n_block * blk_size) + { + bidx = n_block * nb2 + i * blk_size + jj - n_block * blk_size; + diaginv[bidx] = A_diag_data[ii]; + } } - } - } - /* - for (i = 0;i < n_block; i++) - { - for (j = 0;j < blk_size; j++) - { - for (k = 0;k < blk_size; k ++) + } + /* + for (i = 0;i < n_block; i++) + { + for (j = 0;j < blk_size; j++) + { + for (k = 0;k < blk_size; k ++) + { + bidx = i*nb2 + j*blk_size + k; + printf("%e\t",diaginv[bidx]); + } + printf("\n"); + } + printf("\n"); + } + */ + /*----------------------------------------------------------------- + * compute the inverses of all the diagonal sub-blocks + *-----------------------------------------------------------------*/ + if (blk_size > 1) + { + for (i = 0; i < n_block; i++) { - bidx = i*nb2 + j*blk_size + k; - printf("%e\t",diaginv[bidx]); + hypre_blas_mat_inv(diaginv + i * nb2, blk_size); } - printf("\n"); - } - printf("\n"); - } - */ - /*----------------------------------------------------------------- - * compute the inverses of all the diagonal sub-blocks - *-----------------------------------------------------------------*/ - if (blk_size > 1) - { - for (i = 0;i < n_block; i++) - { - hypre_blas_mat_inv(diaginv+i*nb2, blk_size); - } - hypre_blas_mat_inv(diaginv+(HYPRE_Int)(blk_size*nb2),left_size); - /* - for (i = 0;i < n_block; i++) - { - for (j = 0;j < blk_size; j++) + hypre_blas_mat_inv(diaginv + (HYPRE_Int)(blk_size * nb2), left_size); + /* + for (i = 0;i < n_block; i++) { - for (k = 0;k < blk_size; k ++) + for (j = 0;j < blk_size; j++) { - bidx = i*nb2 + j*blk_size + k; - printf("%e\t",diaginv[bidx]); + for (k = 0;k < blk_size; k ++) + { + bidx = i*nb2 + j*blk_size + k; + printf("%e\t",diaginv[bidx]); + } + printf("\n"); } printf("\n"); } - printf("\n"); - } - */ - } - else - { - for (i = 0;i < n; i++) - { - // FIX-ME: zero-diagonal should be tested previously - if (fabs(diaginv[i]) < SMALLREAL) - diaginv[i] = 0.0; - else - diaginv[i] = 1.0 / diaginv[i]; - } - } + */ + } + else + { + for (i = 0; i < n; i++) + { + // FIX-ME: zero-diagonal should be tested previously + if (hypre_abs(diaginv[i]) < HYPRE_REAL_MIN) + { + diaginv[i] = 0.0; + } + else + { + diaginv[i] = 1.0 / diaginv[i]; + } + } + } - hypre_blockRelax_solve(A,f,u,blk_size,n_block,left_size,method,diaginv,Vtemp); + hypre_MGRBlockRelaxSolve(A, f, u, blk_size, n_block, left_size, method, diaginv, Vtemp); - /*----------------------------------------------------------------- - * Free temperary memeory - *-----------------------------------------------------------------*/ - hypre_TFree(diaginv, HYPRE_MEMORY_HOST); + /*----------------------------------------------------------------- + * Free temporary memory + *-----------------------------------------------------------------*/ + hypre_TFree(diaginv, HYPRE_MEMORY_HOST); - return(relax_error); + return (hypre_error_flag); } +#endif + +/*-------------------------------------------------------------------------- + * hypre_MGRSetFSolver + * + * set F-relaxation solver + *--------------------------------------------------------------------------*/ -/* set coarse grid solver */ HYPRE_Int hypre_MGRSetFSolver( void *mgr_vdata, - HYPRE_Int (*fine_grid_solver_solve)(void*,void*,void*,void*), - HYPRE_Int (*fine_grid_solver_setup)(void*,void*,void*,void*), - void *fsolver ) + HYPRE_Int (*fine_grid_solver_solve)(void*, void*, void*, void*), + HYPRE_Int (*fine_grid_solver_setup)(void*, void*, void*, void*), + void *fsolver ) { - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + HYPRE_Int max_num_coarse_levels = (mgr_data -> max_num_coarse_levels); + HYPRE_Solver **aff_solver = (mgr_data -> aff_solver); - if (!mgr_data) - { - hypre_error_in_arg(1); - return hypre_error_flag; - } - HYPRE_Int max_num_coarse_levels = (mgr_data -> max_num_coarse_levels); - HYPRE_Solver **aff_solver = (mgr_data -> aff_solver); - - if (aff_solver == NULL) - aff_solver = hypre_CTAlloc(HYPRE_Solver*, max_num_coarse_levels, HYPRE_MEMORY_HOST); + if (aff_solver == NULL) + { + aff_solver = hypre_CTAlloc(HYPRE_Solver*, max_num_coarse_levels, HYPRE_MEMORY_HOST); + } - /* only allow to set F-solver for the first level */ - aff_solver[0] = (HYPRE_Solver *) fsolver; + /* only allow to set F-solver for the first level */ + aff_solver[0] = (HYPRE_Solver *) fsolver; - (mgr_data -> fine_grid_solver_solve) = fine_grid_solver_solve; - (mgr_data -> fine_grid_solver_setup) = fine_grid_solver_setup; - (mgr_data -> aff_solver) = aff_solver; - (mgr_data -> use_default_fsolver) = 0; + (mgr_data -> fine_grid_solver_solve) = fine_grid_solver_solve; + (mgr_data -> fine_grid_solver_setup) = fine_grid_solver_setup; + (mgr_data -> aff_solver) = aff_solver; + (mgr_data -> fsolver_mode) = 0; - return hypre_error_flag; + return hypre_error_flag; } -/* set coarse grid solver */ +/*-------------------------------------------------------------------------- + * hypre_MGRSetFSolverAtLevel + * + * set F-relaxation solver for a given MGR level. + * + * Note this function asks for a level identifier and doesn't expect an array + * of function pointers for each level (as done by SetLevel functions). + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_MGRSetCoarseSolver( void *mgr_vdata, - HYPRE_Int (*coarse_grid_solver_solve)(void*,void*,void*,void*), - HYPRE_Int (*coarse_grid_solver_setup)(void*,void*,void*,void*), - void *coarse_grid_solver ) +hypre_MGRSetFSolverAtLevel( void *mgr_vdata, + void *fsolver, + HYPRE_Int level ) { - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + HYPRE_Int max_num_coarse_levels = (mgr_data -> max_num_coarse_levels); + HYPRE_Solver **aff_solver = (mgr_data -> aff_solver); - if (!mgr_data) - { - hypre_error_in_arg(1); - return hypre_error_flag; - } + /* Check if the requested level makes sense */ + if (level < 0 || level >= max_num_coarse_levels) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } - (mgr_data -> coarse_grid_solver_solve) = coarse_grid_solver_solve; - (mgr_data -> coarse_grid_solver_setup) = coarse_grid_solver_setup; - (mgr_data -> coarse_grid_solver) = (HYPRE_Solver) coarse_grid_solver; + /* Allocate aff_solver if needed */ + if (!aff_solver) + { + (mgr_data -> aff_solver) = aff_solver = hypre_CTAlloc(HYPRE_Solver*, + max_num_coarse_levels, + HYPRE_MEMORY_HOST); + } - (mgr_data -> use_default_cgrid_solver) = 0; + aff_solver[level] = (HYPRE_Solver *) fsolver; + (mgr_data -> fsolver_mode) = 1; - return hypre_error_flag; + return hypre_error_flag; } +/* set coarse grid solver */ HYPRE_Int -hypre_MGRSetAffInv( void *mgr_vdata, - hypre_ParCSRMatrix *A_ff_inv ) +hypre_MGRSetCoarseSolver( void *mgr_vdata, + HYPRE_Int (*coarse_grid_solver_solve)(void*, void*, void*, void*), + HYPRE_Int (*coarse_grid_solver_setup)(void*, void*, void*, void*), + void *coarse_grid_solver ) { - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; - (mgr_data -> A_ff_inv) = A_ff_inv; - return hypre_error_flag; + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + + (mgr_data -> coarse_grid_solver_solve) = coarse_grid_solver_solve; + (mgr_data -> coarse_grid_solver_setup) = coarse_grid_solver_setup; + (mgr_data -> coarse_grid_solver) = (HYPRE_Solver) coarse_grid_solver; + + (mgr_data -> use_default_cgrid_solver) = 0; + + return hypre_error_flag; } /* Set the maximum number of coarse levels. @@ -4175,183 +2733,318 @@ hypre_MGRSetAffInv( void *mgr_vdata, HYPRE_Int hypre_MGRSetMaxCoarseLevels( void *mgr_vdata, HYPRE_Int maxcoarselevs ) { - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; - (mgr_data -> max_num_coarse_levels) = maxcoarselevs; - return hypre_error_flag; + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + (mgr_data -> max_num_coarse_levels) = maxcoarselevs; + + return hypre_error_flag; } + /* Set the system block size */ HYPRE_Int hypre_MGRSetBlockSize( void *mgr_vdata, HYPRE_Int bsize ) { - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; - (mgr_data -> block_size) = bsize; - return hypre_error_flag; + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + (mgr_data -> block_size) = bsize; + + return hypre_error_flag; } + /* Set the relaxation type for the fine levels of the reduction. * Currently supports the following flavors of relaxation types * as described in the documentation: * relax_types 0 - 8, 13, 14, 18, 19, 98. * See par_relax.c and par_relax_more.c for more details. - * -*/ + * */ HYPRE_Int hypre_MGRSetRelaxType( void *mgr_vdata, HYPRE_Int relax_type ) { - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; - (mgr_data -> relax_type) = relax_type; - return hypre_error_flag; + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + (mgr_data -> relax_type) = relax_type; + return hypre_error_flag; } /* Set the number of relaxation sweeps */ HYPRE_Int hypre_MGRSetNumRelaxSweeps( void *mgr_vdata, HYPRE_Int nsweeps ) { - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; - (mgr_data -> num_relax_sweeps) = nsweeps; - return hypre_error_flag; + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + HYPRE_Int i; + HYPRE_Int max_num_coarse_levels = (mgr_data -> max_num_coarse_levels); + hypre_TFree(mgr_data -> num_relax_sweeps, HYPRE_MEMORY_HOST); + HYPRE_Int *num_relax_sweeps = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, + HYPRE_MEMORY_HOST); + for (i = 0; i < max_num_coarse_levels; i++) + { + num_relax_sweeps[i] = nsweeps; + } + (mgr_data -> num_relax_sweeps) = num_relax_sweeps; + + return hypre_error_flag; +} + +HYPRE_Int +hypre_MGRSetLevelNumRelaxSweeps( void *mgr_vdata, HYPRE_Int *level_nsweeps ) +{ + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + HYPRE_Int i; + HYPRE_Int max_num_coarse_levels = (mgr_data -> max_num_coarse_levels); + hypre_TFree(mgr_data -> num_relax_sweeps, HYPRE_MEMORY_HOST); + + HYPRE_Int *num_relax_sweeps = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, + HYPRE_MEMORY_HOST); + if (level_nsweeps != NULL) + { + for (i = 0; i < max_num_coarse_levels; i++) + { + num_relax_sweeps[i] = level_nsweeps[i]; + } + } + else + { + for (i = 0; i < max_num_coarse_levels; i++) + { + num_relax_sweeps[i] = 0; + } + } + (mgr_data -> num_relax_sweeps) = num_relax_sweeps; + + return hypre_error_flag; +} + +/* Set the order of the global smoothing step at each level + * 1=Down cycle/ Pre-smoothing (default) + * 2=Up cycle/ Post-smoothing + */ +HYPRE_Int +hypre_MGRSetGlobalSmoothCycle( void *mgr_vdata, HYPRE_Int smooth_cycle ) +{ + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + (mgr_data -> global_smooth_cycle) = smooth_cycle; + return hypre_error_flag; } /* Set the F-relaxation strategy: 0=single level, 1=multi level */ HYPRE_Int hypre_MGRSetFRelaxMethod( void *mgr_vdata, HYPRE_Int relax_method ) { - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; - HYPRE_Int i; - HYPRE_Int max_num_coarse_levels = (mgr_data -> max_num_coarse_levels); - if((mgr_data -> Frelax_method) != NULL) { - hypre_TFree(mgr_data -> Frelax_method, HYPRE_MEMORY_HOST); - (mgr_data -> Frelax_method) = NULL; - } - HYPRE_Int *Frelax_method = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, HYPRE_MEMORY_HOST); - for (i=0; i < max_num_coarse_levels; i++) - { - Frelax_method[i] = relax_method; - } - (mgr_data -> Frelax_method) = Frelax_method; - return hypre_error_flag; + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + HYPRE_Int i; + HYPRE_Int max_num_coarse_levels = (mgr_data -> max_num_coarse_levels); + hypre_TFree(mgr_data -> Frelax_method, HYPRE_MEMORY_HOST); + HYPRE_Int *Frelax_method = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, HYPRE_MEMORY_HOST); + for (i = 0; i < max_num_coarse_levels; i++) + { + Frelax_method[i] = relax_method; + } + (mgr_data -> Frelax_method) = Frelax_method; + return hypre_error_flag; } /* Set the F-relaxation strategy: 0=single level, 1=multi level */ +/* This will be removed later. Use SetLevelFrelaxType */ HYPRE_Int hypre_MGRSetLevelFRelaxMethod( void *mgr_vdata, HYPRE_Int *relax_method ) { - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; - HYPRE_Int i; - HYPRE_Int max_num_coarse_levels = (mgr_data -> max_num_coarse_levels); - if((mgr_data -> Frelax_method) != NULL) { - hypre_TFree(mgr_data -> Frelax_method, HYPRE_MEMORY_HOST); - (mgr_data -> Frelax_method) = NULL; - } - HYPRE_Int *Frelax_method = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, HYPRE_MEMORY_HOST); - if (relax_method != NULL) - { - for (i=0; i < max_num_coarse_levels; i++) - { - Frelax_method[i] = relax_method[i]; - } - } - else - { - for (i = 0; i < max_num_coarse_levels; i++) - { - Frelax_method[i] = 0; - } - } - (mgr_data -> Frelax_method) = Frelax_method; - return hypre_error_flag; + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + HYPRE_Int i; + HYPRE_Int max_num_coarse_levels = (mgr_data -> max_num_coarse_levels); + hypre_TFree(mgr_data -> Frelax_method, HYPRE_MEMORY_HOST); + + HYPRE_Int *Frelax_method = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, HYPRE_MEMORY_HOST); + if (relax_method != NULL) + { + for (i = 0; i < max_num_coarse_levels; i++) + { + Frelax_method[i] = relax_method[i]; + } + } + else + { + for (i = 0; i < max_num_coarse_levels; i++) + { + Frelax_method[i] = 0; + } + } + (mgr_data -> Frelax_method) = Frelax_method; + return hypre_error_flag; +} + +/* Set the F-relaxation type: + * 0: Jacobi + * 1: Vcycle smoother + * 2: AMG + * Otherwise: use standard BoomerAMGRelax options +*/ +HYPRE_Int +hypre_MGRSetLevelFRelaxType( void *mgr_vdata, HYPRE_Int *relax_type ) +{ + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + HYPRE_Int i; + HYPRE_Int max_num_coarse_levels = (mgr_data -> max_num_coarse_levels); + hypre_TFree(mgr_data -> Frelax_type, HYPRE_MEMORY_HOST); + + HYPRE_Int *Frelax_type = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, HYPRE_MEMORY_HOST); + if (relax_type != NULL) + { + for (i = 0; i < max_num_coarse_levels; i++) + { + Frelax_type[i] = relax_type[i]; + } + } + else + { + for (i = 0; i < max_num_coarse_levels; i++) + { + Frelax_type[i] = 0; + } + } + (mgr_data -> Frelax_type) = Frelax_type; + return hypre_error_flag; } -/* Coarse grid method: 0=Galerkin RAP, 1=non-Galerkin with dropping*/ +/* Coarse grid method: 0=Galerkin RAP, 1=non-Galerkin with dropping */ HYPRE_Int hypre_MGRSetCoarseGridMethod( void *mgr_vdata, HYPRE_Int *cg_method ) { - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; - HYPRE_Int i; - HYPRE_Int max_num_coarse_levels = (mgr_data -> max_num_coarse_levels); - if((mgr_data -> use_non_galerkin_cg) != NULL) { - hypre_TFree(mgr_data -> use_non_galerkin_cg, HYPRE_MEMORY_HOST); - (mgr_data -> use_non_galerkin_cg) = NULL; - } - HYPRE_Int *use_non_galerkin_cg = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, HYPRE_MEMORY_HOST); - if (cg_method != NULL) - { - for (i=0; i < max_num_coarse_levels; i++) - { - use_non_galerkin_cg[i] = cg_method[i]; - } - } - else - { - for (i = 0; i < max_num_coarse_levels; i++) - { - use_non_galerkin_cg[i] = 0; - } - } - (mgr_data -> use_non_galerkin_cg) = use_non_galerkin_cg; - return hypre_error_flag; + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + HYPRE_Int i; + HYPRE_Int max_num_coarse_levels = (mgr_data -> max_num_coarse_levels); + + hypre_TFree(mgr_data -> coarse_grid_method, HYPRE_MEMORY_HOST); + HYPRE_Int *coarse_grid_method = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, + HYPRE_MEMORY_HOST); + if (cg_method != NULL) + { + for (i = 0; i < max_num_coarse_levels; i++) + { + coarse_grid_method[i] = cg_method[i]; + } + } + else + { + for (i = 0; i < max_num_coarse_levels; i++) + { + coarse_grid_method[i] = 0; + } + } + (mgr_data -> coarse_grid_method) = coarse_grid_method; + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_MGRSetNonGalerkinMaxElmts + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetNonGalerkinMaxElmts( void *mgr_vdata, HYPRE_Int max_elmts ) +{ + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + HYPRE_Int max_num_coarse_levels = (mgr_data -> max_num_coarse_levels); + HYPRE_Int *nonglk_max_elmts = (mgr_data -> nonglk_max_elmts); + HYPRE_Int i; + + if (!nonglk_max_elmts) + { + nonglk_max_elmts = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, HYPRE_MEMORY_HOST); + } + hypre_TFree(mgr_data -> nonglk_max_elmts, HYPRE_MEMORY_HOST); + + for (i = 0; i < max_num_coarse_levels; i++) + { + nonglk_max_elmts[i] = max_elmts; + } + + (mgr_data -> nonglk_max_elmts) = nonglk_max_elmts; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_MGRSetLevelNonGalerkinMaxElmts + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetLevelNonGalerkinMaxElmts( void *mgr_vdata, HYPRE_Int *max_elmts ) +{ + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + HYPRE_Int max_num_coarse_levels = (mgr_data -> max_num_coarse_levels); + HYPRE_Int *nonglk_max_elmts = (mgr_data -> nonglk_max_elmts); + HYPRE_Int i; + + if (!nonglk_max_elmts) + { + nonglk_max_elmts = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, HYPRE_MEMORY_HOST); + } + hypre_TFree(mgr_data -> nonglk_max_elmts, HYPRE_MEMORY_HOST); + + for (i = 0; i < max_num_coarse_levels; i++) + { + nonglk_max_elmts[i] = max_elmts[i]; + } + + (mgr_data -> nonglk_max_elmts) = nonglk_max_elmts; + + return hypre_error_flag; } /* Set the F-relaxation number of functions for each level */ HYPRE_Int hypre_MGRSetLevelFRelaxNumFunctions( void *mgr_vdata, HYPRE_Int *num_functions ) { - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; - HYPRE_Int i; - HYPRE_Int max_num_coarse_levels = (mgr_data -> max_num_coarse_levels); - if((mgr_data -> Frelax_num_functions) != NULL) { - hypre_TFree(mgr_data -> Frelax_num_functions, HYPRE_MEMORY_HOST); - (mgr_data -> Frelax_num_functions) = NULL; - } - HYPRE_Int *Frelax_num_functions = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, HYPRE_MEMORY_HOST); - if (num_functions != NULL) - { - for (i=0; i < max_num_coarse_levels; i++) - { - Frelax_num_functions[i] = num_functions[i]; - } - } - else - { - for (i = 0; i < max_num_coarse_levels; i++) - { - Frelax_num_functions[i] = 1; - } - } - (mgr_data -> Frelax_num_functions) = Frelax_num_functions; - return hypre_error_flag; + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + HYPRE_Int i; + HYPRE_Int max_num_coarse_levels = (mgr_data -> max_num_coarse_levels); + + hypre_TFree(mgr_data -> Frelax_num_functions, HYPRE_MEMORY_HOST); + + HYPRE_Int *Frelax_num_functions = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, + HYPRE_MEMORY_HOST); + if (num_functions != NULL) + { + for (i = 0; i < max_num_coarse_levels; i++) + { + Frelax_num_functions[i] = num_functions[i]; + } + } + else + { + for (i = 0; i < max_num_coarse_levels; i++) + { + Frelax_num_functions[i] = 1; + } + } + (mgr_data -> Frelax_num_functions) = Frelax_num_functions; + return hypre_error_flag; } /* Set the type of the restriction type * for computing restriction operator */ HYPRE_Int -hypre_MGRSetLevelRestrictType( void *mgr_vdata, HYPRE_Int *restrict_type) -{ - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; - HYPRE_Int i; - HYPRE_Int max_num_coarse_levels = (mgr_data -> max_num_coarse_levels); - if ((mgr_data -> restrict_type) != NULL) - { - hypre_TFree((mgr_data -> restrict_type), HYPRE_MEMORY_HOST); - (mgr_data -> restrict_type) = NULL; - } - HYPRE_Int *level_restrict_type = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, HYPRE_MEMORY_HOST); - if (restrict_type != NULL) - { - for (i=0; i < max_num_coarse_levels; i++) - { - level_restrict_type[i] = *(restrict_type + i); - } - } - else - { - for (i=0; i < max_num_coarse_levels; i++) - { - level_restrict_type[i] = 0; - } - } - (mgr_data -> restrict_type) = level_restrict_type; - return hypre_error_flag; +hypre_MGRSetLevelRestrictType( void *mgr_vdata, HYPRE_Int *restrict_type) +{ + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + HYPRE_Int i; + HYPRE_Int max_num_coarse_levels = (mgr_data -> max_num_coarse_levels); + hypre_TFree((mgr_data -> restrict_type), HYPRE_MEMORY_HOST); + + HYPRE_Int *level_restrict_type = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, HYPRE_MEMORY_HOST); + if (restrict_type != NULL) + { + for (i = 0; i < max_num_coarse_levels; i++) + { + level_restrict_type[i] = *(restrict_type + i); + } + } + else + { + for (i = 0; i < max_num_coarse_levels; i++) + { + level_restrict_type[i] = 0; + } + } + (mgr_data -> restrict_type) = level_restrict_type; + return hypre_error_flag; } /* Set the type of the restriction type @@ -4360,21 +3053,21 @@ hypre_MGRSetLevelRestrictType( void *mgr_vdata, HYPRE_Int *restrict_type) HYPRE_Int hypre_MGRSetRestrictType( void *mgr_vdata, HYPRE_Int restrict_type) { - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; - HYPRE_Int i; - HYPRE_Int max_num_coarse_levels = (mgr_data -> max_num_coarse_levels); - if ((mgr_data -> restrict_type) != NULL) - { - hypre_TFree((mgr_data -> restrict_type), HYPRE_MEMORY_HOST); - (mgr_data -> restrict_type) = NULL; - } - HYPRE_Int *level_restrict_type = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, HYPRE_MEMORY_HOST); - for (i=0; i < max_num_coarse_levels; i++) - { - level_restrict_type[i] = restrict_type; - } - (mgr_data -> restrict_type) = level_restrict_type; - return hypre_error_flag; + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + HYPRE_Int i; + HYPRE_Int max_num_coarse_levels = (mgr_data -> max_num_coarse_levels); + if ((mgr_data -> restrict_type) != NULL) + { + hypre_TFree((mgr_data -> restrict_type), HYPRE_MEMORY_HOST); + (mgr_data -> restrict_type) = NULL; + } + HYPRE_Int *level_restrict_type = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, HYPRE_MEMORY_HOST); + for (i = 0; i < max_num_coarse_levels; i++) + { + level_restrict_type[i] = restrict_type; + } + (mgr_data -> restrict_type) = level_restrict_type; + return hypre_error_flag; } /* Set the number of Jacobi interpolation iterations @@ -4383,9 +3076,9 @@ hypre_MGRSetRestrictType( void *mgr_vdata, HYPRE_Int restrict_type) HYPRE_Int hypre_MGRSetNumRestrictSweeps( void *mgr_vdata, HYPRE_Int nsweeps ) { - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; - (mgr_data -> num_restrict_sweeps) = nsweeps; - return hypre_error_flag; + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + (mgr_data -> num_restrict_sweeps) = nsweeps; + return hypre_error_flag; } /* Set the type of the interpolation @@ -4394,21 +3087,21 @@ hypre_MGRSetNumRestrictSweeps( void *mgr_vdata, HYPRE_Int nsweeps ) HYPRE_Int hypre_MGRSetInterpType( void *mgr_vdata, HYPRE_Int interpType) { - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; - HYPRE_Int i; - HYPRE_Int max_num_coarse_levels = (mgr_data -> max_num_coarse_levels); - if ((mgr_data -> interp_type) != NULL) - { - hypre_TFree((mgr_data -> interp_type), HYPRE_MEMORY_HOST); - (mgr_data -> interp_type) = NULL; - } - HYPRE_Int *level_interp_type = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, HYPRE_MEMORY_HOST); - for (i=0; i < max_num_coarse_levels; i++) - { - level_interp_type[i] = interpType; - } - (mgr_data -> interp_type) = level_interp_type; - return hypre_error_flag; + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + HYPRE_Int i; + HYPRE_Int max_num_coarse_levels = (mgr_data -> max_num_coarse_levels); + if ((mgr_data -> interp_type) != NULL) + { + hypre_TFree((mgr_data -> interp_type), HYPRE_MEMORY_HOST); + (mgr_data -> interp_type) = NULL; + } + HYPRE_Int *level_interp_type = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, HYPRE_MEMORY_HOST); + for (i = 0; i < max_num_coarse_levels; i++) + { + level_interp_type[i] = interpType; + } + (mgr_data -> interp_type) = level_interp_type; + return hypre_error_flag; } /* Set the type of the interpolation @@ -4417,31 +3110,28 @@ hypre_MGRSetInterpType( void *mgr_vdata, HYPRE_Int interpType) HYPRE_Int hypre_MGRSetLevelInterpType( void *mgr_vdata, HYPRE_Int *interpType) { - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; - HYPRE_Int i; - HYPRE_Int max_num_coarse_levels = (mgr_data -> max_num_coarse_levels); - if ((mgr_data -> interp_type) != NULL) - { - hypre_TFree((mgr_data -> interp_type), HYPRE_MEMORY_HOST); - (mgr_data -> interp_type) = NULL; - } - HYPRE_Int *level_interp_type = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, HYPRE_MEMORY_HOST); - if (interpType != NULL) - { - for (i=0; i < max_num_coarse_levels; i++) - { - level_interp_type[i] = *(interpType + i); - } - } - else - { - for (i=0; i < max_num_coarse_levels; i++) - { - level_interp_type[i] = 2; - } - } - (mgr_data -> interp_type) = level_interp_type; - return hypre_error_flag; + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + HYPRE_Int i; + HYPRE_Int max_num_coarse_levels = (mgr_data -> max_num_coarse_levels); + hypre_TFree((mgr_data -> interp_type), HYPRE_MEMORY_HOST); + + HYPRE_Int *level_interp_type = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, HYPRE_MEMORY_HOST); + if (interpType != NULL) + { + for (i = 0; i < max_num_coarse_levels; i++) + { + level_interp_type[i] = *(interpType + i); + } + } + else + { + for (i = 0; i < max_num_coarse_levels; i++) + { + level_interp_type[i] = 2; + } + } + (mgr_data -> interp_type) = level_interp_type; + return hypre_error_flag; } /* Set the number of Jacobi interpolation iterations @@ -4450,9 +3140,9 @@ hypre_MGRSetLevelInterpType( void *mgr_vdata, HYPRE_Int *interpType) HYPRE_Int hypre_MGRSetNumInterpSweeps( void *mgr_vdata, HYPRE_Int nsweeps ) { - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; - (mgr_data -> num_interp_sweeps) = nsweeps; - return hypre_error_flag; + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + (mgr_data -> num_interp_sweeps) = nsweeps; + return hypre_error_flag; } /* Set the threshold to truncate the coarse grid at each @@ -4461,639 +3151,864 @@ hypre_MGRSetNumInterpSweeps( void *mgr_vdata, HYPRE_Int nsweeps ) HYPRE_Int hypre_MGRSetTruncateCoarseGridThreshold( void *mgr_vdata, HYPRE_Real threshold) { - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; - (mgr_data -> truncate_coarse_grid_threshold) = threshold; - return hypre_error_flag; + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + (mgr_data -> truncate_coarse_grid_threshold) = threshold; + return hypre_error_flag; +} + +/* Set block size for block Jacobi Interp/Relax */ +HYPRE_Int +hypre_MGRSetBlockJacobiBlockSize( void *mgr_vdata, HYPRE_Int blk_size) +{ + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + (mgr_data -> block_jacobi_bsize) = blk_size; + return hypre_error_flag; } /* Set print level for F-relaxation solver */ HYPRE_Int hypre_MGRSetFrelaxPrintLevel( void *mgr_vdata, HYPRE_Int print_level ) { - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; - (mgr_data -> frelax_print_level) = print_level; - return hypre_error_flag; + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + (mgr_data -> frelax_print_level) = print_level; + return hypre_error_flag; } /* Set print level for coarse grid solver */ HYPRE_Int hypre_MGRSetCoarseGridPrintLevel( void *mgr_vdata, HYPRE_Int print_level ) { - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; - (mgr_data -> cg_print_level) = print_level; - return hypre_error_flag; + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + (mgr_data -> cg_print_level) = print_level; + return hypre_error_flag; } /* Set print level for mgr solver */ HYPRE_Int hypre_MGRSetPrintLevel( void *mgr_vdata, HYPRE_Int print_level ) { - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; - (mgr_data -> print_level) = print_level; - return hypre_error_flag; + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + + /* Unset reserved bits if any are active */ + (mgr_data -> print_level) = print_level & ~(HYPRE_MGR_PRINT_RESERVED_A | + HYPRE_MGR_PRINT_RESERVED_B | + HYPRE_MGR_PRINT_RESERVED_C); + return hypre_error_flag; } /* Set logging level for mgr solver */ HYPRE_Int hypre_MGRSetLogging( void *mgr_vdata, HYPRE_Int logging ) { - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; - (mgr_data -> logging) = logging; - return hypre_error_flag; + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + (mgr_data -> logging) = logging; + return hypre_error_flag; } /* Set max number of iterations for mgr solver */ HYPRE_Int hypre_MGRSetMaxIter( void *mgr_vdata, HYPRE_Int max_iter ) { - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; - (mgr_data -> max_iter) = max_iter; - return hypre_error_flag; + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + (mgr_data -> max_iter) = max_iter; + return hypre_error_flag; } /* Set convergence tolerance for mgr solver */ HYPRE_Int hypre_MGRSetTol( void *mgr_vdata, HYPRE_Real tol ) { - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; - (mgr_data -> tol) = tol; - return hypre_error_flag; + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + (mgr_data -> tol) = tol; + return hypre_error_flag; } /* Set max number of iterations for mgr global smoother */ HYPRE_Int -hypre_MGRSetMaxGlobalsmoothIters( void *mgr_vdata, HYPRE_Int max_iter ) +hypre_MGRSetMaxGlobalSmoothIters( void *mgr_vdata, HYPRE_Int max_iter ) +{ + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + HYPRE_Int max_num_coarse_levels = (mgr_data -> max_num_coarse_levels); + if ((mgr_data -> level_smooth_iters) != NULL) + { + hypre_TFree((mgr_data -> level_smooth_iters), HYPRE_MEMORY_HOST); + (mgr_data -> level_smooth_iters) = NULL; + } + HYPRE_Int *level_smooth_iters = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, HYPRE_MEMORY_HOST); + if (max_num_coarse_levels > 0) + { + level_smooth_iters[0] = max_iter; + } + (mgr_data -> level_smooth_iters) = level_smooth_iters; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_MGRSetGlobalSmoothType + * + * Set global smoothing type at the first (finest) MGR level + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetGlobalSmoothType( void *mgr_vdata, HYPRE_Int gsmooth_type ) +{ + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + HYPRE_Int max_num_coarse_levels = (mgr_data -> max_num_coarse_levels); + if ((mgr_data -> level_smooth_type) != NULL) + { + hypre_TFree((mgr_data -> level_smooth_type), HYPRE_MEMORY_HOST); + (mgr_data -> level_smooth_type) = NULL; + } + HYPRE_Int *level_smooth_type = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, HYPRE_MEMORY_HOST); + if (max_num_coarse_levels > 0) + { + level_smooth_type[0] = gsmooth_type; + } + (mgr_data -> level_smooth_type) = level_smooth_type; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_MGRSetLevelSmoothType + * + * Set global smoothing type at each MGR level. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetLevelSmoothType( void *mgr_vdata, + HYPRE_Int *gsmooth_type ) +{ + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + HYPRE_Int max_num_coarse_levels = (mgr_data -> max_num_coarse_levels); + HYPRE_Int *level_smooth_type, i; + char msg[1024]; + + /* Set level_smooth_type array */ + level_smooth_type = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, HYPRE_MEMORY_HOST); + hypre_TFree((mgr_data -> level_smooth_type), HYPRE_MEMORY_HOST); + if (gsmooth_type != NULL) + { + for (i = 0; i < max_num_coarse_levels; i++) + { + /* For meaningful values of global smoothing type, the option set via + hypre_MGRSetGlobalSmootherAtLevel has precedence over the option set + via this function. */ + if ((mgr_data -> level_smoother) && (mgr_data -> level_smoother)[i] && + (gsmooth_type[i] >= 0)) + { + hypre_sprintf(msg, "hypre_MGRSetLevelSmoothType does not take effect at level %d since\n\ + hypre_MGRSetGlobalSmootherAtLevel has been called at the same level", + i); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, msg); + } + else + { + level_smooth_type[i] = gsmooth_type[i]; + } + } + } + else + { + for (i = 0; i < max_num_coarse_levels; i++) + { + level_smooth_type[i] = 0; // Jacobi + } + } + (mgr_data -> level_smooth_type) = level_smooth_type; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_MGRSetLevelSmoothIters + * + * Set the number of global smoothing iterations at each MGR level. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetLevelSmoothIters( void *mgr_vdata, + HYPRE_Int *gsmooth_iters ) +{ + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + HYPRE_Int max_num_coarse_levels = (mgr_data -> max_num_coarse_levels); + HYPRE_Int *level_smooth_iters; + HYPRE_Int i; + + level_smooth_iters = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, HYPRE_MEMORY_HOST); + hypre_TFree((mgr_data -> level_smooth_iters), HYPRE_MEMORY_HOST); + if (gsmooth_iters != NULL) + { + for (i = 0; i < max_num_coarse_levels; i++) + { + level_smooth_iters[i] = gsmooth_iters[i]; + } + } + else + { + for (i = 0; i < max_num_coarse_levels; i++) + { + level_smooth_iters[i] = 0; + } + } + (mgr_data -> level_smooth_iters) = level_smooth_iters; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_MGRSetGlobalSmootherAtLevel + * + * Set global relaxation method for a given MGR level via a HYPRE solver object. + * + * Note this function asks for a level identifier and doesn't expect an array + * of function pointers for each level (as done by SetLevel functions). + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetGlobalSmootherAtLevel( void *mgr_vdata, + HYPRE_Solver smoother, + HYPRE_Int level ) { - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; - (mgr_data -> global_smooth_iters) = max_iter; - return hypre_error_flag; + hypre_Solver *base = (hypre_Solver*) smoother; + HYPRE_PtrToSolverFcn setup = hypre_SolverSetup(base); + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + HYPRE_Int max_num_coarse_levels = (mgr_data -> max_num_coarse_levels); + HYPRE_Int smoother_type; + char msg[1024]; + + /* Check if the requested level makes sense */ + if (level < 0 || level >= max_num_coarse_levels) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + /* Allocate level_smoother if needed */ + if (!(mgr_data -> level_smoother)) + { + (mgr_data -> level_smoother) = hypre_CTAlloc(HYPRE_Solver, + max_num_coarse_levels, + HYPRE_MEMORY_HOST); + } + + /* Allocate level_smooth_type if needed */ + if (!(mgr_data -> level_smooth_type)) + { + (mgr_data -> level_smooth_type) = hypre_CTAlloc(HYPRE_Int, + max_num_coarse_levels, + HYPRE_MEMORY_HOST); + } + + (mgr_data -> level_smoother)[level] = smoother; + + /* Obtain corresponding smoother type */ + if (setup == (HYPRE_PtrToSolverFcn) HYPRE_ILUSetup) + { + smoother_type = 16; + } + else + { + smoother_type = -1; /* Unknown smoother */ + } + + /* Check if level_smooth_type[level] corresponds to the right smoother type */ + if ((mgr_data -> level_smooth_type)[level] > 0 && + (mgr_data -> level_smooth_type)[level] != smoother_type) + { + hypre_sprintf(msg, "Reseting global relaxation type at level %d to user's smoother", level); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, msg); + } + (mgr_data -> level_smooth_type)[level] = smoother_type; + + return hypre_error_flag; } -/* Set global smoothing type for mgr solver */ +/* Set the maximum number of non-zero entries for interpolation operators */ HYPRE_Int -hypre_MGRSetGlobalsmoothType( void *mgr_vdata, HYPRE_Int iter_type ) +hypre_MGRSetPMaxElmts(void *mgr_vdata, HYPRE_Int P_max_elmts) { - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; - (mgr_data -> global_smooth_type) = iter_type; - return hypre_error_flag; + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + HYPRE_Int max_num_coarse_levels = (mgr_data -> max_num_coarse_levels); + HYPRE_Int i; + + /* Allocate internal P_max_elmts if needed */ + if (!(mgr_data -> P_max_elmts)) + { + (mgr_data -> P_max_elmts) = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, HYPRE_MEMORY_HOST); + } + + /* Set all P_max_elmts entries to the value passed as input */ + for (i = 0; i < max_num_coarse_levels; i++) + { + (mgr_data -> P_max_elmts)[i] = P_max_elmts; + } + + return hypre_error_flag; } -/* Set the maximum number of non-zero entries for restriction - and interpolation operator if classical AMG interpolation is used */ +/* Set the maximum number of non-zero entries for interpolation operators per level */ HYPRE_Int -hypre_MGRSetPMaxElmts( void *mgr_vdata, HYPRE_Int P_max_elmts) +hypre_MGRSetLevelPMaxElmts(void *mgr_vdata, HYPRE_Int *P_max_elmts) { - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; - (mgr_data -> P_max_elmts) = P_max_elmts; - return hypre_error_flag; + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + HYPRE_Int max_num_coarse_levels = (mgr_data -> max_num_coarse_levels); + HYPRE_Int i; + + /* Allocate internal P_max_elmts if needed */ + if (!(mgr_data -> P_max_elmts)) + { + (mgr_data -> P_max_elmts) = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, HYPRE_MEMORY_HOST); + } + + /* Set all P_max_elmts entries to the value passed as input */ + for (i = 0; i < max_num_coarse_levels; i++) + { + (mgr_data -> P_max_elmts)[i] = (P_max_elmts) ? P_max_elmts[i] : 0; + } + + return hypre_error_flag; } /* Get number of iterations for MGR solver */ HYPRE_Int hypre_MGRGetNumIterations( void *mgr_vdata, HYPRE_Int *num_iterations ) { - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; - if (!mgr_data) - { - hypre_error_in_arg(1); - return hypre_error_flag; - } - *num_iterations = mgr_data->num_iterations; + *num_iterations = mgr_data->num_iterations; - return hypre_error_flag; + return hypre_error_flag; } /* Get residual norms for MGR solver */ HYPRE_Int hypre_MGRGetFinalRelativeResidualNorm( void *mgr_vdata, HYPRE_Real *res_norm ) { - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; - if (!mgr_data) - { - hypre_error_in_arg(1); - return hypre_error_flag; - } - *res_norm = mgr_data->final_rel_residual_norm; + *res_norm = mgr_data->final_rel_residual_norm; - return hypre_error_flag; + return hypre_error_flag; } HYPRE_Int -hypre_MGRGetCoarseGridConvergenceFactor( void *mgr_vdata , HYPRE_Real *conv_factor ) +hypre_MGRGetCoarseGridConvergenceFactor( void *mgr_vdata, HYPRE_Real *conv_factor ) { - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; - if (!mgr_data) - { - hypre_error_in_arg(1); - return hypre_error_flag; - } - *conv_factor = (mgr_data -> cg_convergence_factor); + *conv_factor = (mgr_data -> cg_convergence_factor); - return hypre_error_flag; + return hypre_error_flag; } - /* Build A_FF matrix from A given a CF_marker array */ HYPRE_Int hypre_MGRGetSubBlock( hypre_ParCSRMatrix *A, - HYPRE_Int *row_cf_marker, - HYPRE_Int *col_cf_marker, - HYPRE_Int debug_flag, - hypre_ParCSRMatrix **A_block_ptr ) + HYPRE_Int *row_cf_marker, + HYPRE_Int *col_cf_marker, + HYPRE_Int debug_flag, + hypre_ParCSRMatrix **A_block_ptr ) { - MPI_Comm comm = hypre_ParCSRMatrixComm(A); - hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); - hypre_ParCSRCommHandle *comm_handle; - HYPRE_MemoryLocation memory_location = hypre_ParCSRMatrixMemoryLocation(A); - - hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); - HYPRE_Real *A_diag_data = hypre_CSRMatrixData(A_diag); - HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); - HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); - - hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); - HYPRE_Real *A_offd_data = hypre_CSRMatrixData(A_offd); - HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); - HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); - HYPRE_Int num_cols_A_offd = hypre_CSRMatrixNumCols(A_offd); - //HYPRE_Int *col_map_offd = hypre_ParCSRMatrixColMapOffd(A); - - hypre_IntArray *coarse_dof_func_ptr = NULL; - HYPRE_BigInt *num_row_cpts_global = NULL; - HYPRE_BigInt *num_col_cpts_global = NULL; - - hypre_ParCSRMatrix *Ablock; - HYPRE_BigInt *col_map_offd_Ablock; - HYPRE_Int *tmp_map_offd = NULL; - - HYPRE_Int *CF_marker_offd = NULL; - - hypre_CSRMatrix *Ablock_diag; - hypre_CSRMatrix *Ablock_offd; - - HYPRE_Real *Ablock_diag_data; - HYPRE_Int *Ablock_diag_i; - HYPRE_Int *Ablock_diag_j; - HYPRE_Real *Ablock_offd_data; - HYPRE_Int *Ablock_offd_i; - HYPRE_Int *Ablock_offd_j; - - HYPRE_Int Ablock_diag_size, Ablock_offd_size; - - HYPRE_Int *Ablock_marker; - - HYPRE_Int ii_counter; - HYPRE_Int jj_counter, jj_counter_offd; - HYPRE_Int *jj_count, *jj_count_offd; - - HYPRE_Int start_indexing = 0; /* start indexing for Aff_data at 0 */ - - HYPRE_Int n_fine = hypre_CSRMatrixNumRows(A_diag); - - HYPRE_Int *fine_to_coarse; - HYPRE_Int *coarse_counter; - HYPRE_Int *col_coarse_counter; - HYPRE_Int coarse_shift; - HYPRE_BigInt total_global_row_cpts; - HYPRE_BigInt total_global_col_cpts; - HYPRE_Int num_cols_Ablock_offd; -// HYPRE_BigInt my_first_row_cpt, my_first_col_cpt; - - HYPRE_Int i,i1; - HYPRE_Int j,jl,jj; - HYPRE_Int start; - - HYPRE_Int my_id; - HYPRE_Int num_procs; - HYPRE_Int num_threads; - HYPRE_Int num_sends; - HYPRE_Int index; - HYPRE_Int ns, ne, size, rest; - HYPRE_Int *int_buf_data; - HYPRE_Int local_numrows = hypre_CSRMatrixNumRows(A_diag); - - hypre_IntArray *wrap_cf; - -// HYPRE_Real wall_time; /* for debugging instrumentation */ - - hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_rank(comm,&my_id); - //num_threads = hypre_NumThreads(); - // Temporary fix, disable threading - // TODO: enable threading - num_threads = 1; - - /* get the number of coarse rows */ - wrap_cf = hypre_IntArrayCreate(local_numrows); - hypre_IntArrayMemoryLocation(wrap_cf) = HYPRE_MEMORY_HOST; - hypre_IntArrayData(wrap_cf) = row_cf_marker; - hypre_BoomerAMGCoarseParms(comm, local_numrows, 1, NULL, wrap_cf, &coarse_dof_func_ptr, &num_row_cpts_global); - hypre_IntArrayDestroy(coarse_dof_func_ptr); - coarse_dof_func_ptr = NULL; - - //hypre_printf("my_id = %d, cpts_this = %d, cpts_next = %d\n", my_id, num_row_cpts_global[0], num_row_cpts_global[1]); - -// my_first_row_cpt = num_row_cpts_global[0]; - if (my_id == (num_procs -1)) total_global_row_cpts = num_row_cpts_global[1]; - hypre_MPI_Bcast(&total_global_row_cpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); - - /* get the number of coarse rows */ - hypre_IntArrayData(wrap_cf) = col_cf_marker; - hypre_BoomerAMGCoarseParms(comm, local_numrows, 1, NULL, wrap_cf, &coarse_dof_func_ptr, &num_col_cpts_global); - hypre_IntArrayDestroy(coarse_dof_func_ptr); - coarse_dof_func_ptr = NULL; - - //hypre_printf("my_id = %d, cpts_this = %d, cpts_next = %d\n", my_id, num_col_cpts_global[0], num_col_cpts_global[1]); - -// my_first_col_cpt = num_col_cpts_global[0]; - if (my_id == (num_procs -1)) total_global_col_cpts = num_col_cpts_global[1]; - hypre_MPI_Bcast(&total_global_col_cpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); - - /*------------------------------------------------------------------- - * Get the CF_marker data for the off-processor columns - *-------------------------------------------------------------------*/ - if (debug_flag < 0) - { - debug_flag = -debug_flag; - } + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); + hypre_ParCSRCommHandle *comm_handle; + HYPRE_MemoryLocation memory_location = hypre_ParCSRMatrixMemoryLocation(A); + + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + HYPRE_Real *A_diag_data = hypre_CSRMatrixData(A_diag); + HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); + HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); + + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); + HYPRE_Real *A_offd_data = hypre_CSRMatrixData(A_offd); + HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); + HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); + HYPRE_Int num_cols_A_offd = hypre_CSRMatrixNumCols(A_offd); + //HYPRE_Int *col_map_offd = hypre_ParCSRMatrixColMapOffd(A); -// if (debug_flag==4) wall_time = time_getWallclockSeconds(); + hypre_IntArray *coarse_dof_func_ptr = NULL; + HYPRE_BigInt num_row_cpts_global[2]; + HYPRE_BigInt num_col_cpts_global[2]; - if (num_cols_A_offd) CF_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); + hypre_ParCSRMatrix *Ablock; + HYPRE_BigInt *col_map_offd_Ablock; + HYPRE_Int *tmp_map_offd = NULL; - if (!comm_pkg) - { - hypre_MatvecCommPkgCreate(A); - comm_pkg = hypre_ParCSRMatrixCommPkg(A); - } + HYPRE_Int *CF_marker_offd = NULL; - num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, - num_sends), HYPRE_MEMORY_HOST); - - index = 0; - for (i = 0; i < num_sends; i++) - { - start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) - int_buf_data[index++] - = col_cf_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; - } + hypre_CSRMatrix *Ablock_diag; + hypre_CSRMatrix *Ablock_offd; + + HYPRE_Real *Ablock_diag_data; + HYPRE_Int *Ablock_diag_i; + HYPRE_Int *Ablock_diag_j; + HYPRE_Real *Ablock_offd_data; + HYPRE_Int *Ablock_offd_i; + HYPRE_Int *Ablock_offd_j; + + HYPRE_Int Ablock_diag_size, Ablock_offd_size; + + HYPRE_Int *Ablock_marker; + + HYPRE_Int ii_counter; + HYPRE_Int jj_counter, jj_counter_offd; + HYPRE_Int *jj_count, *jj_count_offd; + + HYPRE_Int start_indexing = 0; /* start indexing for Aff_data at 0 */ + + HYPRE_Int n_fine = hypre_CSRMatrixNumRows(A_diag); + + HYPRE_Int *fine_to_coarse; + HYPRE_Int *coarse_counter; + HYPRE_Int *col_coarse_counter; + HYPRE_Int coarse_shift; + HYPRE_BigInt total_global_row_cpts; + HYPRE_BigInt total_global_col_cpts; + HYPRE_Int num_cols_Ablock_offd; + // HYPRE_BigInt my_first_row_cpt, my_first_col_cpt; + + HYPRE_Int i, i1; + HYPRE_Int j, jl, jj; + HYPRE_Int start; + + HYPRE_Int my_id; + HYPRE_Int num_procs; + HYPRE_Int num_threads; + HYPRE_Int num_sends; + HYPRE_Int index; + HYPRE_Int ns, ne, size, rest; + HYPRE_Int *int_buf_data; + HYPRE_Int local_numrows = hypre_CSRMatrixNumRows(A_diag); + + hypre_IntArray *wrap_cf; + + // HYPRE_Real wall_time; /* for debugging instrumentation */ + + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); + //num_threads = hypre_NumThreads(); + // Temporary fix, disable threading + // TODO: enable threading + num_threads = 1; + + /* get the number of coarse rows */ + wrap_cf = hypre_IntArrayCreate(local_numrows); + hypre_IntArrayMemoryLocation(wrap_cf) = HYPRE_MEMORY_HOST; + hypre_IntArrayData(wrap_cf) = row_cf_marker; + hypre_BoomerAMGCoarseParms(comm, local_numrows, 1, NULL, wrap_cf, &coarse_dof_func_ptr, + num_row_cpts_global); + hypre_IntArrayDestroy(coarse_dof_func_ptr); + coarse_dof_func_ptr = NULL; + + //hypre_printf("my_id = %d, cpts_this = %d, cpts_next = %d\n", my_id, num_row_cpts_global[0], num_row_cpts_global[1]); + + // my_first_row_cpt = num_row_cpts_global[0]; + if (my_id == (num_procs - 1)) { total_global_row_cpts = num_row_cpts_global[1]; } + hypre_MPI_Bcast(&total_global_row_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); + + /* get the number of coarse rows */ + hypre_IntArrayData(wrap_cf) = col_cf_marker; + hypre_BoomerAMGCoarseParms(comm, local_numrows, 1, NULL, wrap_cf, &coarse_dof_func_ptr, + num_col_cpts_global); + hypre_IntArrayDestroy(coarse_dof_func_ptr); + coarse_dof_func_ptr = NULL; + + //hypre_printf("my_id = %d, cpts_this = %d, cpts_next = %d\n", my_id, num_col_cpts_global[0], num_col_cpts_global[1]); + + // my_first_col_cpt = num_col_cpts_global[0]; + if (my_id == (num_procs - 1)) { total_global_col_cpts = num_col_cpts_global[1]; } + hypre_MPI_Bcast(&total_global_col_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); + + /*------------------------------------------------------------------- + * Get the CF_marker data for the off-processor columns + *-------------------------------------------------------------------*/ + if (debug_flag < 0) + { + debug_flag = -debug_flag; + } + + // if (debug_flag==4) wall_time = time_getWallclockSeconds(); + + if (num_cols_A_offd) { CF_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); } + + if (!comm_pkg) + { + hypre_MatvecCommPkgCreate(A); + comm_pkg = hypre_ParCSRMatrixCommPkg(A); + } + + num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); + int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, + num_sends), HYPRE_MEMORY_HOST); + + index = 0; + for (i = 0; i < num_sends; i++) + { + start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) + int_buf_data[index++] + = col_cf_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; + } - comm_handle = hypre_ParCSRCommHandleCreate( 11, comm_pkg, int_buf_data, - CF_marker_offd); - hypre_ParCSRCommHandleDestroy(comm_handle); + comm_handle = hypre_ParCSRCommHandleCreate( 11, comm_pkg, int_buf_data, + CF_marker_offd); + hypre_ParCSRCommHandleDestroy(comm_handle); - /*----------------------------------------------------------------------- - * First Pass: Determine size of Ablock and fill in fine_to_coarse mapping. - *-----------------------------------------------------------------------*/ + /*----------------------------------------------------------------------- + * First Pass: Determine size of Ablock and fill in fine_to_coarse mapping. + *-----------------------------------------------------------------------*/ - /*----------------------------------------------------------------------- - * Intialize counters and allocate mapping vector. - *-----------------------------------------------------------------------*/ + /*----------------------------------------------------------------------- + * Intialize counters and allocate mapping vector. + *-----------------------------------------------------------------------*/ - coarse_counter = hypre_CTAlloc(HYPRE_Int, num_threads, HYPRE_MEMORY_HOST); - col_coarse_counter = hypre_CTAlloc(HYPRE_Int, num_threads, HYPRE_MEMORY_HOST); - jj_count = hypre_CTAlloc(HYPRE_Int, num_threads, HYPRE_MEMORY_HOST); - jj_count_offd = hypre_CTAlloc(HYPRE_Int, num_threads, HYPRE_MEMORY_HOST); + coarse_counter = hypre_CTAlloc(HYPRE_Int, num_threads, HYPRE_MEMORY_HOST); + col_coarse_counter = hypre_CTAlloc(HYPRE_Int, num_threads, HYPRE_MEMORY_HOST); + jj_count = hypre_CTAlloc(HYPRE_Int, num_threads, HYPRE_MEMORY_HOST); + jj_count_offd = hypre_CTAlloc(HYPRE_Int, num_threads, HYPRE_MEMORY_HOST); - fine_to_coarse = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); + fine_to_coarse = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); #if 0 #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif #endif - for (i = 0; i < n_fine; i++) fine_to_coarse[i] = -1; + for (i = 0; i < n_fine; i++) { fine_to_coarse[i] = -1; } - jj_counter = start_indexing; - jj_counter_offd = start_indexing; + jj_counter = start_indexing; + jj_counter_offd = start_indexing; - /*----------------------------------------------------------------------- - * Loop over fine grid. - *-----------------------------------------------------------------------*/ + /*----------------------------------------------------------------------- + * Loop over fine grid. + *-----------------------------------------------------------------------*/ -/* RDF: this looks a little tricky, but doable */ + /* RDF: this looks a little tricky, but doable */ #if 0 #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,j,i1,jj,ns,ne,size,rest) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,j,i1,jj,ns,ne,size,rest) HYPRE_SMP_SCHEDULE #endif #endif - for (j = 0; j < num_threads; j++) - { - size = n_fine/num_threads; - rest = n_fine - size*num_threads; - - if (j < rest) - { - ns = j*size+j; - ne = (j+1)*size+j+1; - } - else - { - ns = j*size+rest; - ne = (j+1)*size+rest; - } - for (i = ns; i < ne; i++) - { - /*-------------------------------------------------------------------- - * If i is a F-point, we loop through the columns and select - * the F-columns. Also set up mapping vector. - *--------------------------------------------------------------------*/ - - if (col_cf_marker[i] > 0) + for (j = 0; j < num_threads; j++) + { + size = n_fine / num_threads; + rest = n_fine - size * num_threads; + + if (j < rest) { - fine_to_coarse[i] = col_coarse_counter[j]; - col_coarse_counter[j]++; + ns = j * size + j; + ne = (j + 1) * size + j + 1; } - - if (row_cf_marker[i] > 0) + else { - //fine_to_coarse[i] = coarse_counter[j]; - coarse_counter[j]++; - for (jj = A_diag_i[i]; jj < A_diag_i[i+1]; jj++) - { - i1 = A_diag_j[jj]; - if (col_cf_marker[i1] > 0) - { - jj_count[j]++; - } - } + ns = j * size + rest; + ne = (j + 1) * size + rest; + } + for (i = ns; i < ne; i++) + { + /*-------------------------------------------------------------------- + * If i is a F-point, we loop through the columns and select + * the F-columns. Also set up mapping vector. + *--------------------------------------------------------------------*/ + + if (col_cf_marker[i] > 0) + { + fine_to_coarse[i] = col_coarse_counter[j]; + col_coarse_counter[j]++; + } + + if (row_cf_marker[i] > 0) + { + //fine_to_coarse[i] = coarse_counter[j]; + coarse_counter[j]++; + for (jj = A_diag_i[i]; jj < A_diag_i[i + 1]; jj++) + { + i1 = A_diag_j[jj]; + if (col_cf_marker[i1] > 0) + { + jj_count[j]++; + } + } - if (num_procs > 1) - { - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) - { - i1 = A_offd_j[jj]; - if (CF_marker_offd[i1] > 0) + if (num_procs > 1) { - jj_count_offd[j]++; + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) + { + i1 = A_offd_j[jj]; + if (CF_marker_offd[i1] > 0) + { + jj_count_offd[j]++; + } + } } - } - } + } } - } - } + } - /*----------------------------------------------------------------------- - * Allocate arrays. - *-----------------------------------------------------------------------*/ - for (i=0; i < num_threads-1; i++) - { - jj_count[i+1] += jj_count[i]; - jj_count_offd[i+1] += jj_count_offd[i]; - coarse_counter[i+1] += coarse_counter[i]; - col_coarse_counter[i+1] += col_coarse_counter[i]; - } - i = num_threads-1; - jj_counter = jj_count[i]; - jj_counter_offd = jj_count_offd[i]; - ii_counter = coarse_counter[i]; + /*----------------------------------------------------------------------- + * Allocate arrays. + *-----------------------------------------------------------------------*/ + for (i = 0; i < num_threads - 1; i++) + { + jj_count[i + 1] += jj_count[i]; + jj_count_offd[i + 1] += jj_count_offd[i]; + coarse_counter[i + 1] += coarse_counter[i]; + col_coarse_counter[i + 1] += col_coarse_counter[i]; + } + i = num_threads - 1; + jj_counter = jj_count[i]; + jj_counter_offd = jj_count_offd[i]; + ii_counter = coarse_counter[i]; - Ablock_diag_size = jj_counter; + Ablock_diag_size = jj_counter; - Ablock_diag_i = hypre_CTAlloc(HYPRE_Int, ii_counter+1, memory_location); - Ablock_diag_j = hypre_CTAlloc(HYPRE_Int, Ablock_diag_size, memory_location); - Ablock_diag_data = hypre_CTAlloc(HYPRE_Real, Ablock_diag_size, memory_location); + Ablock_diag_i = hypre_CTAlloc(HYPRE_Int, ii_counter + 1, memory_location); + Ablock_diag_j = hypre_CTAlloc(HYPRE_Int, Ablock_diag_size, memory_location); + Ablock_diag_data = hypre_CTAlloc(HYPRE_Real, Ablock_diag_size, memory_location); - Ablock_diag_i[ii_counter] = jj_counter; + Ablock_diag_i[ii_counter] = jj_counter; - Ablock_offd_size = jj_counter_offd; + Ablock_offd_size = jj_counter_offd; - Ablock_offd_i = hypre_CTAlloc(HYPRE_Int, ii_counter+1, memory_location); - Ablock_offd_j = hypre_CTAlloc(HYPRE_Int, Ablock_offd_size, memory_location); - Ablock_offd_data = hypre_CTAlloc(HYPRE_Real, Ablock_offd_size, memory_location); + Ablock_offd_i = hypre_CTAlloc(HYPRE_Int, ii_counter + 1, memory_location); + Ablock_offd_j = hypre_CTAlloc(HYPRE_Int, Ablock_offd_size, memory_location); + Ablock_offd_data = hypre_CTAlloc(HYPRE_Real, Ablock_offd_size, memory_location); - /*----------------------------------------------------------------------- - * Intialize some stuff. - *-----------------------------------------------------------------------*/ + /*----------------------------------------------------------------------- + * Intialize some stuff. + *-----------------------------------------------------------------------*/ - jj_counter = start_indexing; - jj_counter_offd = start_indexing; + jj_counter = start_indexing; + jj_counter_offd = start_indexing; - //----------------------------------------------------------------------- - // Send and receive fine_to_coarse info. - //----------------------------------------------------------------------- + //----------------------------------------------------------------------- + // Send and receive fine_to_coarse info. + //----------------------------------------------------------------------- -// if (debug_flag==4) wall_time = time_getWallclockSeconds(); + // if (debug_flag==4) wall_time = time_getWallclockSeconds(); #if 0 #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,j,ns,ne,size,rest,coarse_shift) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,j,ns,ne,size,rest,coarse_shift) HYPRE_SMP_SCHEDULE #endif #endif - for (j = 0; j < num_threads; j++) - { - coarse_shift = 0; - if (j > 0) coarse_shift = col_coarse_counter[j-1]; - size = n_fine/num_threads; - rest = n_fine - size*num_threads; - if (j < rest) - { - ns = j*size+j; - ne = (j+1)*size+j+1; - } - else - { - ns = j*size+rest; - ne = (j+1)*size+rest; - } - for (i = ns; i < ne; i++) - fine_to_coarse[i] += coarse_shift; - } + for (j = 0; j < num_threads; j++) + { + coarse_shift = 0; + if (j > 0) { coarse_shift = col_coarse_counter[j - 1]; } + size = n_fine / num_threads; + rest = n_fine - size * num_threads; + if (j < rest) + { + ns = j * size + j; + ne = (j + 1) * size + j + 1; + } + else + { + ns = j * size + rest; + ne = (j + 1) * size + rest; + } + for (i = ns; i < ne; i++) + { + fine_to_coarse[i] += coarse_shift; + } + } -// if (debug_flag==4) wall_time = time_getWallclockSeconds(); + // if (debug_flag==4) wall_time = time_getWallclockSeconds(); #if 0 #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif #endif -// for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_col_cpt; + // for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_col_cpt; #if 0 #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,jl,i1,jj,ns,ne,size,rest,jj_counter,jj_counter_offd,ii_counter) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,jl,i1,jj,ns,ne,size,rest,jj_counter,jj_counter_offd,ii_counter) HYPRE_SMP_SCHEDULE #endif #endif - for (jl = 0; jl < num_threads; jl++) - { - size = n_fine/num_threads; - rest = n_fine - size*num_threads; - if (jl < rest) - { - ns = jl*size+jl; - ne = (jl+1)*size+jl+1; - } - else - { - ns = jl*size+rest; - ne = (jl+1)*size+rest; - } - jj_counter = 0; - if (jl > 0) jj_counter = jj_count[jl-1]; - jj_counter_offd = 0; - if (jl > 0) jj_counter_offd = jj_count_offd[jl-1]; - ii_counter = 0; - for (i = ns; i < ne; i++) - { - /*-------------------------------------------------------------------- - * If i is a F-point, we loop through the columns and select - * the F-columns. Also set up mapping vector. - *--------------------------------------------------------------------*/ - if (row_cf_marker[i] > 0) + for (jl = 0; jl < num_threads; jl++) + { + size = n_fine / num_threads; + rest = n_fine - size * num_threads; + if (jl < rest) { - // Diagonal part of Ablock // - Ablock_diag_i[ii_counter] = jj_counter; - for (jj = A_diag_i[i]; jj < A_diag_i[i+1]; jj++) - { - i1 = A_diag_j[jj]; - if (col_cf_marker[i1] > 0) - { - Ablock_diag_j[jj_counter] = fine_to_coarse[i1]; - Ablock_diag_data[jj_counter] = A_diag_data[jj]; - jj_counter++; - } - } + ns = jl * size + jl; + ne = (jl + 1) * size + jl + 1; + } + else + { + ns = jl * size + rest; + ne = (jl + 1) * size + rest; + } + jj_counter = 0; + if (jl > 0) { jj_counter = jj_count[jl - 1]; } + jj_counter_offd = 0; + if (jl > 0) { jj_counter_offd = jj_count_offd[jl - 1]; } + ii_counter = 0; + for (i = ns; i < ne; i++) + { + /*-------------------------------------------------------------------- + * If i is a F-point, we loop through the columns and select + * the F-columns. Also set up mapping vector. + *--------------------------------------------------------------------*/ + if (row_cf_marker[i] > 0) + { + // Diagonal part of Ablock // + Ablock_diag_i[ii_counter] = jj_counter; + for (jj = A_diag_i[i]; jj < A_diag_i[i + 1]; jj++) + { + i1 = A_diag_j[jj]; + if (col_cf_marker[i1] > 0) + { + Ablock_diag_j[jj_counter] = fine_to_coarse[i1]; + Ablock_diag_data[jj_counter] = A_diag_data[jj]; + jj_counter++; + } + } - // Off-Diagonal part of Ablock // - Ablock_offd_i[ii_counter] = jj_counter_offd; - if (num_procs > 1) - { - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) - { - i1 = A_offd_j[jj]; - if (CF_marker_offd[i1] > 0) + // Off-Diagonal part of Ablock // + Ablock_offd_i[ii_counter] = jj_counter_offd; + if (num_procs > 1) { - Ablock_offd_j[jj_counter_offd] = i1; - Ablock_offd_data[jj_counter_offd] = A_offd_data[jj]; - jj_counter_offd++; + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) + { + i1 = A_offd_j[jj]; + if (CF_marker_offd[i1] > 0) + { + Ablock_offd_j[jj_counter_offd] = i1; + Ablock_offd_data[jj_counter_offd] = A_offd_data[jj]; + jj_counter_offd++; + } + } } - } - } - ii_counter++; + ii_counter++; + } } - } - Ablock_offd_i[ii_counter] = jj_counter_offd; - Ablock_diag_i[ii_counter] = jj_counter; - } - Ablock = hypre_ParCSRMatrixCreate(comm, - total_global_row_cpts, - total_global_col_cpts, - num_row_cpts_global, - num_col_cpts_global, - 0, - Ablock_diag_i[ii_counter], - Ablock_offd_i[ii_counter]); - - Ablock_diag = hypre_ParCSRMatrixDiag(Ablock); - hypre_CSRMatrixData(Ablock_diag) = Ablock_diag_data; - hypre_CSRMatrixI(Ablock_diag) = Ablock_diag_i; - hypre_CSRMatrixJ(Ablock_diag) = Ablock_diag_j; - Ablock_offd = hypre_ParCSRMatrixOffd(Ablock); - hypre_CSRMatrixData(Ablock_offd) = Ablock_offd_data; - hypre_CSRMatrixI(Ablock_offd) = Ablock_offd_i; - hypre_CSRMatrixJ(Ablock_offd) = Ablock_offd_j; - - num_cols_Ablock_offd = 0; - - if (Ablock_offd_size) - { - Ablock_marker = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); + Ablock_offd_i[ii_counter] = jj_counter_offd; + Ablock_diag_i[ii_counter] = jj_counter; + } + Ablock = hypre_ParCSRMatrixCreate(comm, + total_global_row_cpts, + total_global_col_cpts, + num_row_cpts_global, + num_col_cpts_global, + 0, + Ablock_diag_i[ii_counter], + Ablock_offd_i[ii_counter]); + + Ablock_diag = hypre_ParCSRMatrixDiag(Ablock); + hypre_CSRMatrixData(Ablock_diag) = Ablock_diag_data; + hypre_CSRMatrixI(Ablock_diag) = Ablock_diag_i; + hypre_CSRMatrixJ(Ablock_diag) = Ablock_diag_j; + Ablock_offd = hypre_ParCSRMatrixOffd(Ablock); + hypre_CSRMatrixData(Ablock_offd) = Ablock_offd_data; + hypre_CSRMatrixI(Ablock_offd) = Ablock_offd_i; + hypre_CSRMatrixJ(Ablock_offd) = Ablock_offd_j; + + num_cols_Ablock_offd = 0; + + if (Ablock_offd_size) + { + Ablock_marker = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); #if 0 #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif #endif - for (i=0; i < num_cols_A_offd; i++) - Ablock_marker[i] = 0; - num_cols_Ablock_offd = 0; - for (i=0; i < Ablock_offd_size; i++) - { - index = Ablock_offd_j[i]; - if (!Ablock_marker[index]) + for (i = 0; i < num_cols_A_offd; i++) + { + Ablock_marker[i] = 0; + } + num_cols_Ablock_offd = 0; + for (i = 0; i < Ablock_offd_size; i++) + { + index = Ablock_offd_j[i]; + if (!Ablock_marker[index]) + { + num_cols_Ablock_offd++; + Ablock_marker[index] = 1; + } + } + + col_map_offd_Ablock = hypre_CTAlloc(HYPRE_BigInt, num_cols_Ablock_offd, memory_location); + tmp_map_offd = hypre_CTAlloc(HYPRE_Int, num_cols_Ablock_offd, HYPRE_MEMORY_HOST); + index = 0; + for (i = 0; i < num_cols_Ablock_offd; i++) { - num_cols_Ablock_offd++; - Ablock_marker[index] = 1; + while (Ablock_marker[index] == 0) { index++; } + tmp_map_offd[i] = index++; } - } - - col_map_offd_Ablock = hypre_CTAlloc(HYPRE_BigInt, num_cols_Ablock_offd, memory_location); - tmp_map_offd = hypre_CTAlloc(HYPRE_Int, num_cols_Ablock_offd, HYPRE_MEMORY_HOST); - index = 0; - for (i=0; i < num_cols_Ablock_offd; i++) - { - while (Ablock_marker[index]==0) index++; - tmp_map_offd[i] = index++; - } #if 0 #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif #endif - for (i=0; i < Ablock_offd_size; i++) - Ablock_offd_j[i] = hypre_BinarySearch(tmp_map_offd, - Ablock_offd_j[i], - num_cols_Ablock_offd); - hypre_TFree(Ablock_marker, HYPRE_MEMORY_HOST); - } + for (i = 0; i < Ablock_offd_size; i++) + Ablock_offd_j[i] = hypre_BinarySearch(tmp_map_offd, + Ablock_offd_j[i], + num_cols_Ablock_offd); + hypre_TFree(Ablock_marker, HYPRE_MEMORY_HOST); + } - if (num_cols_Ablock_offd) - { - hypre_ParCSRMatrixColMapOffd(Ablock) = col_map_offd_Ablock; - hypre_CSRMatrixNumCols(Ablock_offd) = num_cols_Ablock_offd; - } + if (num_cols_Ablock_offd) + { + hypre_ParCSRMatrixColMapOffd(Ablock) = col_map_offd_Ablock; + hypre_CSRMatrixNumCols(Ablock_offd) = num_cols_Ablock_offd; + } - hypre_GetCommPkgRTFromCommPkgA(Ablock, A, fine_to_coarse, tmp_map_offd); + hypre_GetCommPkgRTFromCommPkgA(Ablock, A, fine_to_coarse, tmp_map_offd); - /* Create the assumed partition */ - if (hypre_ParCSRMatrixAssumedPartition(Ablock) == NULL) - { - hypre_ParCSRMatrixCreateAssumedPartition(Ablock); - } + /* Create the assumed partition */ + if (hypre_ParCSRMatrixAssumedPartition(Ablock) == NULL) + { + hypre_ParCSRMatrixCreateAssumedPartition(Ablock); + } - *A_block_ptr= Ablock; + *A_block_ptr = Ablock; - hypre_TFree(tmp_map_offd, HYPRE_MEMORY_HOST); - hypre_TFree(CF_marker_offd, HYPRE_MEMORY_HOST); - hypre_TFree(int_buf_data, HYPRE_MEMORY_HOST); - hypre_TFree(fine_to_coarse, HYPRE_MEMORY_HOST); - hypre_TFree(coarse_counter, HYPRE_MEMORY_HOST); - hypre_TFree(col_coarse_counter, HYPRE_MEMORY_HOST); - hypre_TFree(jj_count, HYPRE_MEMORY_HOST); - hypre_TFree(jj_count_offd, HYPRE_MEMORY_HOST); + hypre_TFree(tmp_map_offd, HYPRE_MEMORY_HOST); + hypre_TFree(CF_marker_offd, HYPRE_MEMORY_HOST); + hypre_TFree(int_buf_data, HYPRE_MEMORY_HOST); + hypre_TFree(fine_to_coarse, HYPRE_MEMORY_HOST); + hypre_TFree(coarse_counter, HYPRE_MEMORY_HOST); + hypre_TFree(col_coarse_counter, HYPRE_MEMORY_HOST); + hypre_TFree(jj_count, HYPRE_MEMORY_HOST); + hypre_TFree(jj_count_offd, HYPRE_MEMORY_HOST); + hypre_IntArrayData(wrap_cf) = NULL; + hypre_IntArrayDestroy(wrap_cf); - return(0); + return hypre_error_flag; } - /* Build A_FF matrix from A given a CF_marker array */ HYPRE_Int hypre_MGRBuildAff( hypre_ParCSRMatrix *A, - HYPRE_Int *CF_marker, - HYPRE_Int debug_flag, - hypre_ParCSRMatrix **A_ff_ptr ) + HYPRE_Int *CF_marker, + HYPRE_Int debug_flag, + hypre_ParCSRMatrix **A_ff_ptr ) { - HYPRE_Int i; - HYPRE_Int local_numrows = hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(A)); - /* create a copy of the CF_marker array and switch C-points to F-points */ - HYPRE_Int *CF_marker_copy = hypre_CTAlloc(HYPRE_Int, local_numrows, HYPRE_MEMORY_HOST); + HYPRE_Int i; + HYPRE_Int local_numrows = hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(A)); + /* create a copy of the CF_marker array and switch C-points to F-points */ + HYPRE_Int *CF_marker_copy = hypre_CTAlloc(HYPRE_Int, local_numrows, HYPRE_MEMORY_HOST); #if 0 #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif #endif - for (i = 0; i < local_numrows; i++) { - CF_marker_copy[i] = -CF_marker[i]; - } + for (i = 0; i < local_numrows; i++) + { + CF_marker_copy[i] = -CF_marker[i]; + } - hypre_MGRGetSubBlock(A, CF_marker_copy, CF_marker_copy, debug_flag, A_ff_ptr); + hypre_MGRGetSubBlock(A, CF_marker_copy, CF_marker_copy, debug_flag, A_ff_ptr); - /* Free copy of CF marker */ - hypre_TFree(CF_marker_copy, HYPRE_MEMORY_HOST); - return(0); + /* Free copy of CF marker */ + hypre_TFree(CF_marker_copy, HYPRE_MEMORY_HOST); + return (0); } /********************************************************************************* @@ -5104,29 +4019,33 @@ hypre_MGRBuildAff( hypre_ParCSRMatrix *A, * same as the 'point_type' *********************************************************************************/ HYPRE_Int -hypre_MGRAddVectorP ( HYPRE_Int *CF_marker, - HYPRE_Int point_type, - HYPRE_Real a, - hypre_ParVector *fromVector, - HYPRE_Real b, - hypre_ParVector **toVector ) +hypre_MGRAddVectorP ( hypre_IntArray *CF_marker, + HYPRE_Int point_type, + HYPRE_Real a, + hypre_ParVector *fromVector, + HYPRE_Real b, + hypre_ParVector **toVector ) { - hypre_Vector *fromVectorLocal = hypre_ParVectorLocalVector(fromVector); - HYPRE_Real *fromVectorData = hypre_VectorData(fromVectorLocal); - hypre_Vector *toVectorLocal = hypre_ParVectorLocalVector(*toVector); - HYPRE_Real *toVectorData = hypre_VectorData(toVectorLocal); - - HYPRE_Int n = hypre_ParVectorActualLocalSize(*toVector); - HYPRE_Int i, j; - - j = 0; - for (i = 0; i < n; i++) { - if (CF_marker[i] == point_type) { - toVectorData[i] = b * toVectorData[i] + a * fromVectorData[j]; - j++; - } - } - return 0; + hypre_Vector *fromVectorLocal = hypre_ParVectorLocalVector(fromVector); + HYPRE_Real *fromVectorData = hypre_VectorData(fromVectorLocal); + hypre_Vector *toVectorLocal = hypre_ParVectorLocalVector(*toVector); + HYPRE_Real *toVectorData = hypre_VectorData(toVectorLocal); + HYPRE_Int *CF_marker_data = hypre_IntArrayData(CF_marker); + + //HYPRE_Int n = hypre_ParVectorActualLocalSize(*toVector); + HYPRE_Int n = hypre_IntArraySize(CF_marker); + HYPRE_Int i, j; + + j = 0; + for (i = 0; i < n; i++) + { + if (CF_marker_data[i] == point_type) + { + toVectorData[i] = b * toVectorData[i] + a * fromVectorData[j]; + j++; + } + } + return 0; } /************************************************************************************* @@ -5137,29 +4056,33 @@ hypre_MGRAddVectorP ( HYPRE_Int *CF_marker, * same as the 'point_type' to the 'toVector' *************************************************************************************/ HYPRE_Int -hypre_MGRAddVectorR ( HYPRE_Int *CF_marker, - HYPRE_Int point_type, - HYPRE_Real a, - hypre_ParVector *fromVector, - HYPRE_Real b, - hypre_ParVector **toVector ) +hypre_MGRAddVectorR ( hypre_IntArray *CF_marker, + HYPRE_Int point_type, + HYPRE_Real a, + hypre_ParVector *fromVector, + HYPRE_Real b, + hypre_ParVector **toVector ) { - hypre_Vector *fromVectorLocal = hypre_ParVectorLocalVector(fromVector); - HYPRE_Real *fromVectorData = hypre_VectorData(fromVectorLocal); - hypre_Vector *toVectorLocal = hypre_ParVectorLocalVector(*toVector); - HYPRE_Real *toVectorData = hypre_VectorData(toVectorLocal); - - HYPRE_Int n = hypre_ParVectorActualLocalSize(fromVector); - HYPRE_Int i, j; - - j = 0; - for (i = 0; i < n; i++) { - if (CF_marker[i] == point_type) { - toVectorData[j] = b * toVectorData[j] + a * fromVectorData[i]; - j++; - } - } - return 0; + hypre_Vector *fromVectorLocal = hypre_ParVectorLocalVector(fromVector); + HYPRE_Real *fromVectorData = hypre_VectorData(fromVectorLocal); + hypre_Vector *toVectorLocal = hypre_ParVectorLocalVector(*toVector); + HYPRE_Real *toVectorData = hypre_VectorData(toVectorLocal); + HYPRE_Int *CF_marker_data = hypre_IntArrayData(CF_marker); + + //HYPRE_Int n = hypre_ParVectorActualLocalSize(*toVector); + HYPRE_Int n = hypre_IntArraySize(CF_marker); + HYPRE_Int i, j; + + j = 0; + for (i = 0; i < n; i++) + { + if (CF_marker_data[i] == point_type) + { + toVectorData[j] = b * toVectorData[j] + a * fromVectorData[i]; + j++; + } + } + return 0; } /* @@ -5187,252 +4110,353 @@ hypre_MGRBuildAffRAP( MPI_Comm comm, HYPRE_Int local_num_variables, HYPRE_Int nu HYPRE_Int hypre_MGRGetCoarseGridMatrix( void *mgr_vdata, hypre_ParCSRMatrix **RAP ) { - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; - if (!mgr_data) - { - hypre_error_in_arg(1); - return hypre_error_flag; - } - if (mgr_data -> RAP == NULL) - { - hypre_error_w_msg(HYPRE_ERROR_GENERIC," Coarse grid matrix is NULL. Please make sure MGRSetup() is called \n"); - return hypre_error_flag; - } - *RAP = mgr_data->RAP; + if (mgr_data -> RAP == NULL) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + " Coarse grid matrix is NULL. Please make sure MGRSetup() is called \n"); + return hypre_error_flag; + } + *RAP = mgr_data->RAP; - return hypre_error_flag; + return hypre_error_flag; } /* Get pointer to coarse grid solution for MGR solver */ HYPRE_Int hypre_MGRGetCoarseGridSolution( void *mgr_vdata, hypre_ParVector **sol ) { - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; - if (!mgr_data) - { - hypre_error_in_arg(1); - return hypre_error_flag; - } - if (mgr_data -> U_array == NULL) - { - hypre_error_w_msg(HYPRE_ERROR_GENERIC," MGR solution array is NULL. Please make sure MGRSetup() and MGRSolve() are called \n"); - return hypre_error_flag; - } - *sol = mgr_data->U_array[mgr_data->num_coarse_levels]; + if (mgr_data -> U_array == NULL) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + " MGR solution array is NULL. Please make sure MGRSetup() and MGRSolve() are called \n"); + return hypre_error_flag; + } + *sol = mgr_data->U_array[mgr_data->num_coarse_levels]; - return hypre_error_flag; + return hypre_error_flag; } /* Get pointer to coarse grid solution for MGR solver */ HYPRE_Int hypre_MGRGetCoarseGridRHS( void *mgr_vdata, hypre_ParVector **rhs ) { - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; - if (!mgr_data) - { - hypre_error_in_arg(1); - return hypre_error_flag; - } - if (mgr_data -> F_array == NULL) - { - hypre_error_w_msg(HYPRE_ERROR_GENERIC," MGR RHS array is NULL. Please make sure MGRSetup() and MGRSolve() are called \n"); - return hypre_error_flag; - } - *rhs = mgr_data->F_array[mgr_data->num_coarse_levels]; + if (mgr_data -> F_array == NULL) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + " MGR RHS array is NULL. Please make sure MGRSetup() and MGRSolve() are called \n"); + return hypre_error_flag; + } + *rhs = mgr_data->F_array[mgr_data->num_coarse_levels]; - return hypre_error_flag; + return hypre_error_flag; } /* Print coarse grid linear system (for debugging)*/ HYPRE_Int hypre_MGRPrintCoarseSystem( void *mgr_vdata, HYPRE_Int print_flag) { - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; - mgr_data->print_coarse_system = print_flag; + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + mgr_data->print_coarse_system = print_flag; - return hypre_error_flag; + return hypre_error_flag; } -/* Print solver params */ +/*-------------------------------------------------------------------------- + * hypre_MGRDataPrint + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_MGRWriteSolverParams(void *mgr_vdata) +hypre_MGRDataPrint(void *mgr_vdata) { - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; - HYPRE_Int i, j; - HYPRE_Int max_num_coarse_levels = (mgr_data -> max_num_coarse_levels); - hypre_printf("MGR Setup parameters: \n"); - hypre_printf("Block size: %d\n", (mgr_data -> block_size)); - hypre_printf("Max number of coarse levels: %d\n", (mgr_data -> max_num_coarse_levels)); - hypre_printf("Relax type: %d\n", (mgr_data -> relax_type)); - hypre_printf("Set non-Cpoints to F-points: %d\n", (mgr_data -> set_non_Cpoints_to_F)); - hypre_printf("Set Cpoints method: %d\n", (mgr_data -> set_c_points_method)); - for (i = 0; i < max_num_coarse_levels; i++) - { - hypre_printf("Lev = %d, Interpolation type: %d\n", i, (mgr_data -> interp_type)[i]); - hypre_printf("Lev = %d, Restriction type: %d\n", i, (mgr_data -> restrict_type)[i]); - hypre_printf("Lev = %d, F-relaxation method: %d\n", i, (mgr_data -> Frelax_method)[i]); - hypre_printf("Lev = %d, Use non-Galerkin coarse grid: %d\n", i, (mgr_data -> use_non_galerkin_cg)[i]); - HYPRE_Int lvl_num_coarse_points = (mgr_data -> block_num_coarse_indexes)[i]; - hypre_printf("Lev = %d, Number of Cpoints: %d\n", i, lvl_num_coarse_points); - hypre_printf("Cpoints indices: "); - for (j = 0; j < lvl_num_coarse_points; j++) - { - if ((mgr_data -> block_cf_marker)[i][j] == 1) + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + HYPRE_Int print_level = (mgr_data -> print_level); + HYPRE_Int num_coarse_levels = (mgr_data -> num_coarse_levels); + hypre_ParCSRMatrix **A_array = (mgr_data -> A_array); + hypre_ParCSRMatrix **P_array = (mgr_data -> P_array); + hypre_ParCSRMatrix **RT_array = (mgr_data -> RT_array); + hypre_ParCSRMatrix *A_coarsest = (mgr_data -> RAP); + hypre_ParVector **f_array = (mgr_data -> F_array); + HYPRE_Int *point_marker_array = (mgr_data -> point_marker_array); + HYPRE_Int block_size = (mgr_data -> block_size); + char *data_path = (mgr_data -> data_path); + + char topdir[] = "./hypre-data"; + char *filename = NULL; + hypre_IntArray *dofmap = NULL; + MPI_Comm comm; + HYPRE_Int myid, lvl; + HYPRE_Int data_path_length = 0; + + /* Sanity check */ + if (!A_array[0]) + { + return hypre_error_flag; + } + + /* Get rank ID */ + comm = hypre_ParCSRMatrixComm(A_array[0]); + hypre_MPI_Comm_rank(comm, &myid); + + /* Create new "ls_" folder (data_path) */ + if (((print_level & HYPRE_MGR_PRINT_INFO_PARAMS) || + (print_level & HYPRE_MGR_PRINT_FINE_MATRIX) || + (print_level & HYPRE_MGR_PRINT_FINE_RHS) || + (print_level & HYPRE_MGR_PRINT_CRSE_MATRIX) || + (print_level & HYPRE_MGR_PRINT_LVLS_MATRIX) ) && + (data_path == NULL)) + { + if (!myid) { - hypre_printf("%d ", j); + if (!hypre_CheckDirExists(topdir)) + { + hypre_CreateDir(topdir); + } + + hypre_CreateNextDirOfSequence(topdir, "ls_", &data_path); + data_path_length = strlen(data_path) + 1; } - } - hypre_printf("\n"); - } - hypre_printf("Number of Reserved Cpoints: %d\n", (mgr_data -> reserved_coarse_size)); - hypre_printf("Keep reserved Cpoints to level: %d\n", (mgr_data -> lvl_to_keep_cpoints)); - - hypre_printf("\n MGR Solver Parameters: \n"); - hypre_printf("Number of relax sweeps: %d\n", (mgr_data -> num_relax_sweeps)); - hypre_printf("Number of interpolation sweeps: %d\n", (mgr_data -> num_interp_sweeps)); - hypre_printf("Number of restriction sweeps: %d\n", (mgr_data -> num_restrict_sweeps)); - hypre_printf("Global smoother type: %d\n", (mgr_data ->global_smooth_type)); - hypre_printf("Number of global smoother sweeps: %d\n", (mgr_data ->global_smooth_iters)); - hypre_printf("Max number of iterations: %d\n", (mgr_data -> max_iter)); - hypre_printf("Stopping tolerance: %e\n", (mgr_data -> tol)); - hypre_printf("Use default coarse grid solver: %d\n", (mgr_data -> use_default_cgrid_solver)); - if((mgr_data -> use_default_fsolver) >= 0) - { - hypre_printf("Use default AMG solver for full AMG F-relaxation: %d\n", (mgr_data -> use_default_fsolver)); - } - return hypre_error_flag; -} + hypre_MPI_Bcast(&data_path_length, 1, HYPRE_MPI_INT, 0, comm); -#ifdef HYPRE_USING_DSUPERLU -void * -hypre_MGRDirectSolverCreate() -{ - hypre_DSLUData *dslu_data = hypre_CTAlloc(hypre_DSLUData, 1, HYPRE_MEMORY_HOST); - return (void *) dslu_data; -} + if (data_path_length > 0) + { + if (myid) + { + data_path = hypre_TAlloc(char, data_path_length, HYPRE_MEMORY_HOST); + } + } + else + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unable to create data path!"); + return hypre_error_flag; + } + hypre_MPI_Bcast(data_path, data_path_length, hypre_MPI_CHAR, 0, comm); -HYPRE_Int -hypre_MGRDirectSolverSetup( void *solver, - hypre_ParCSRMatrix *A, - hypre_ParVector *f, - hypre_ParVector *u ) -{ - /* Par Data Structure variables */ - HYPRE_BigInt global_num_rows = hypre_ParCSRMatrixGlobalNumRows(A); - MPI_Comm comm = hypre_ParCSRMatrixComm(A); - hypre_CSRMatrix *A_local; - HYPRE_Int num_rows; - HYPRE_Int num_procs, my_id; - HYPRE_Int pcols=1, prows=1; - HYPRE_BigInt *big_rowptr = NULL; - hypre_DSLUData *dslu_data = (hypre_DSLUData *) solver; - - HYPRE_Int info = 0; - HYPRE_Int nrhs = 0; + /* Save data_path */ + (mgr_data -> data_path) = data_path; + } + else + { + if (data_path) + { + data_path_length = strlen(data_path); + } + } - hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_rank(comm, &my_id); + /* Allocate memory for filename */ + filename = hypre_TAlloc(char, data_path_length + 16, HYPRE_MEMORY_HOST); + + /* Print MGR parameters to file */ + if (print_level & HYPRE_MGR_PRINT_INFO_PARAMS) + { + /* TODO (VPM): print internal MGR parameters to file */ - /* Merge diag and offd into one matrix (global ids) */ - A_local = hypre_MergeDiagAndOffd(A); + /* Signal that the MGR parameters have already been printed */ + (mgr_data -> print_level) &= ~HYPRE_MGR_PRINT_INFO_PARAMS; + (mgr_data -> print_level) |= HYPRE_MGR_PRINT_RESERVED_A; + } - num_rows = hypre_CSRMatrixNumRows(A_local); - /* Now convert hypre matrix to a SuperMatrix */ -#ifdef HYPRE_MIXEDINT + /* Print linear system matrix at the finest level and dofmap */ + if ((print_level & (HYPRE_MGR_PRINT_FINE_MATRIX + HYPRE_MGR_PRINT_LVLS_MATRIX)) && A_array[0]) { - HYPRE_Int *rowptr = NULL; - HYPRE_Int i; - rowptr = hypre_CSRMatrixI(A_local); - big_rowptr = hypre_CTAlloc(HYPRE_BigInt, (num_rows+1), HYPRE_MEMORY_HOST); - for(i=0; i<(num_rows+1); i++) + /* Build dofmap array */ + dofmap = hypre_IntArrayCreate(hypre_ParCSRMatrixNumRows(A_array[0])); + hypre_IntArrayInitialize_v2(dofmap, HYPRE_MEMORY_HOST); + if (point_marker_array) { - big_rowptr[i] = (HYPRE_BigInt)rowptr[i]; + hypre_TMemcpy(hypre_IntArrayData(dofmap), point_marker_array, + HYPRE_Int, hypre_ParCSRMatrixNumRows(A_array[0]), + HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); } + else + { + hypre_IntArraySetInterleavedValues(dofmap, block_size); + } + + /* Print dofmap */ + hypre_ParPrintf(comm, "Writing dofmap to path: %s\n", data_path); + hypre_sprintf(filename, "%s/dofmap.out", data_path); + hypre_IntArrayPrint(comm, dofmap, filename); + + /* Free memory */ + hypre_IntArrayDestroy(dofmap); + + /* Print Matrix */ + hypre_ParPrintf(comm, "Writing fine level matrix to path: %s\n", data_path); + hypre_sprintf(filename, "%s/IJ.out.A", data_path); + if (print_level & HYPRE_MGR_PRINT_MODE_ASCII) + { + hypre_ParCSRMatrixPrintIJ(A_array[0], 0, 0, filename); + } + else + { + hypre_ParCSRMatrixPrintBinaryIJ(A_array[0], 0, 0, filename); + } + + /* Signal that the matrix has already been printed */ + (mgr_data -> print_level) &= ~HYPRE_MGR_PRINT_FINE_MATRIX; + (mgr_data -> print_level) |= HYPRE_MGR_PRINT_RESERVED_B; } -#else - big_rowptr = hypre_CSRMatrixI(A_local); -#endif - dCreate_CompRowLoc_Matrix_dist( - &(dslu_data->A_dslu),global_num_rows,global_num_rows, - hypre_CSRMatrixNumNonzeros(A_local), - num_rows, - hypre_ParCSRMatrixFirstRowIndex(A), - hypre_CSRMatrixData(A_local), - hypre_CSRMatrixBigJ(A_local),big_rowptr, - SLU_NR_loc, SLU_D, SLU_GE); - - /* DOK: SuperLU frees assigned data, so set them to null before - * calling hypre_CSRMatrixdestroy on A_local to avoid memory errors. - */ -#ifndef HYPRE_MIXEDINT - hypre_CSRMatrixI(A_local) = NULL; -#endif - hypre_CSRMatrixData(A_local) = NULL; - hypre_CSRMatrixBigJ(A_local) = NULL; - hypre_CSRMatrixDestroy(A_local); - /*Create process grid */ - while (prows*pcols <= num_procs) ++prows; - --prows; - pcols = num_procs/prows; - while (prows*pcols != num_procs) + /* Print linear system RHS at the finest level */ + if ((print_level & HYPRE_MGR_PRINT_FINE_RHS) && f_array[0]) { - prows -= 1; - pcols = num_procs/prows; + /* Print RHS */ + hypre_ParPrintf(comm, "Writing RHS to path: %s\n", data_path); + hypre_sprintf(filename, "%s/IJ.out.b", data_path); + if (print_level & HYPRE_MGR_PRINT_MODE_ASCII) + { + hypre_ParVectorPrintIJ(f_array[0], 0, filename); + } + else + { + hypre_ParVectorPrintBinaryIJ(f_array[0], filename); + } + + /* Free memory */ + hypre_TFree(filename, HYPRE_MEMORY_HOST); + + /* Signal that the vector has already been printed */ + (mgr_data -> print_level) &= ~HYPRE_MGR_PRINT_FINE_RHS; + (mgr_data -> print_level) |= HYPRE_MGR_PRINT_RESERVED_C; + } + + /* Print linear system matrix at the coarsest level */ + if ((print_level & (HYPRE_MGR_PRINT_CRSE_MATRIX + HYPRE_MGR_PRINT_LVLS_MATRIX)) && A_coarsest) + { + hypre_ParPrintf(comm, "Writing coarsest level matrix to path: %s\n", data_path); + hypre_sprintf(filename, "%s/IJ.out.A.%02d", data_path, num_coarse_levels); + if (print_level & HYPRE_MGR_PRINT_MODE_ASCII) + { + hypre_ParCSRMatrixPrintIJ(A_coarsest, 0, 0, filename); + } + else + { + hypre_ParCSRMatrixPrintBinaryIJ(A_coarsest, 0, 0, filename); + } + + /* Signal that the matrix has already been printed */ + (mgr_data -> print_level) &= ~HYPRE_MGR_PRINT_CRSE_MATRIX; } - //hypre_printf(" prows %d pcols %d\n", prows, pcols); - superlu_gridinit(comm, prows, pcols, &(dslu_data->dslu_data_grid)); + /* Print MGR hierarchy */ + if ((print_level & HYPRE_MGR_PRINT_LVLS_MATRIX)) + { + for (lvl = 0; lvl < num_coarse_levels - 1; lvl++) + { + /* Print operator matrix */ + hypre_ParPrintf(comm, "Writing level %d matrix to path: %s\n", lvl + 1, data_path); + hypre_sprintf(filename, "%s/IJ.out.A.%02d", data_path, lvl + 1); + if (print_level & HYPRE_MGR_PRINT_MODE_ASCII) + { + hypre_ParCSRMatrixPrintIJ(A_array[lvl + 1], 0, 0, filename); + } + else + { + hypre_ParCSRMatrixPrintBinaryIJ(A_array[lvl + 1], 0, 0, filename); + } + + /* Print interpolation matrix */ + if (P_array[lvl]) + { + hypre_ParPrintf(comm, "Writing level %d interpolation to path: %s\n", lvl, data_path); + hypre_sprintf(filename, "%s/IJ.out.P.%02d", data_path, lvl); + if (print_level & HYPRE_MGR_PRINT_MODE_ASCII) + { + hypre_ParCSRMatrixPrintIJ(P_array[lvl], 0, 0, filename); + } + else + { + hypre_ParCSRMatrixPrintBinaryIJ(P_array[lvl], 0, 0, filename); + } + } + + /* Print restriction matrix */ + if (RT_array[lvl]) + { + hypre_ParPrintf(comm, "Writing level %d restriction to path: %s\n", lvl, data_path); + hypre_sprintf(filename, "%s/IJ.out.RT.%02d", data_path, lvl); + if (print_level & HYPRE_MGR_PRINT_MODE_ASCII) + { + hypre_ParCSRMatrixPrintIJ(RT_array[lvl], 0, 0, filename); + } + else + { + hypre_ParCSRMatrixPrintBinaryIJ(RT_array[lvl], 0, 0, filename); + } + } + } - set_default_options_dist(&(dslu_data->dslu_options)); + /* Signal that the data has already been printed */ + (mgr_data -> print_level) &= ~HYPRE_MGR_PRINT_LVLS_MATRIX; + } - dslu_data->dslu_options.Fact = DOFACT; - dslu_data->dslu_options.PrintStat = NO; - /*dslu_data->dslu_options.IterRefine = SLU_DOUBLE; - dslu_data->dslu_options.ColPerm = MMD_AT_PLUS_A; - dslu_data->dslu_options.DiagPivotThresh = 1.0; - dslu_data->dslu_options.ReplaceTinyPivot = NO; */ + /* Free memory */ + hypre_TFree(filename, HYPRE_MEMORY_HOST); - dScalePermstructInit(global_num_rows, global_num_rows, &(dslu_data->dslu_ScalePermstruct)); + return hypre_error_flag; +} - dLUstructInit(global_num_rows, &(dslu_data->dslu_data_LU)); +/*************************************************************************** + ***************************************************************************/ - PStatInit(&(dslu_data->dslu_data_stat)); +#ifdef HYPRE_USING_DSUPERLU - dslu_data->global_num_rows = global_num_rows; +/*-------------------------------------------------------------------------- + * hypre_MGRDirectSolverCreate + *--------------------------------------------------------------------------*/ - dslu_data->berr = hypre_CTAlloc(HYPRE_Real, 1, HYPRE_MEMORY_HOST); - dslu_data->berr[0] = 0.0; +void * +hypre_MGRDirectSolverCreate() +{ + // hypre_DSLUData *dslu_data = hypre_CTAlloc(hypre_DSLUData, 1, HYPRE_MEMORY_HOST); + // return (void *) dslu_data; + return NULL; +} - pdgssvx(&(dslu_data->dslu_options), &(dslu_data->A_dslu), - &(dslu_data->dslu_ScalePermstruct), NULL, num_rows, nrhs, - &(dslu_data->dslu_data_grid), &(dslu_data->dslu_data_LU), - &(dslu_data->dslu_solve), dslu_data->berr, &(dslu_data->dslu_data_stat), &info); +/*-------------------------------------------------------------------------- + * hypre_MGRDirectSolverSetup + *--------------------------------------------------------------------------*/ - dslu_data->dslu_options.Fact = FACTORED; +HYPRE_Int +hypre_MGRDirectSolverSetup( void *solver, + hypre_ParCSRMatrix *A, + hypre_ParVector *f, + hypre_ParVector *u ) +{ + HYPRE_UNUSED_VAR(f); + HYPRE_UNUSED_VAR(u); - return hypre_error_flag; + return hypre_SLUDistSetup(solver, A, 0); } +/*-------------------------------------------------------------------------- + * hypre_MGRDirectSolverSolve + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_MGRDirectSolverSolve( void *solver, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ) { - hypre_SLUDistSolve(solver, f, u); + HYPRE_UNUSED_VAR(A); - return hypre_error_flag; + return hypre_SLUDistSolve(solver, f, u); } +/*-------------------------------------------------------------------------- + * hypre_MGRDirectSolverDestroy + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_MGRDirectSolverDestroy( void *solver ) { - hypre_SLUDistDestroy(solver); - - return hypre_error_flag; + return hypre_SLUDistDestroy(solver); } #endif diff --git a/external/hypre/src/parcsr_ls/par_mgr.h b/external/hypre/src/parcsr_ls/par_mgr.h index 37cd73b2..5e761be1 100644 --- a/external/hypre/src/parcsr_ls/par_mgr.h +++ b/external/hypre/src/parcsr_ls/par_mgr.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -7,128 +7,172 @@ #ifndef hypre_ParMGR_DATA_HEADER #define hypre_ParMGR_DATA_HEADER + /*-------------------------------------------------------------------------- * hypre_ParMGRData *--------------------------------------------------------------------------*/ + typedef struct { - // block data - HYPRE_Int block_size; - HYPRE_Int *block_num_coarse_indexes; - HYPRE_Int *point_marker_array; - HYPRE_Int **block_cf_marker; - - // initial setup data (user provided) - HYPRE_Int num_coarse_levels; - HYPRE_Int *num_coarse_per_level; - HYPRE_Int **level_coarse_indexes; - - //general data - HYPRE_Int max_num_coarse_levels; - hypre_ParCSRMatrix **A_array; - hypre_ParCSRMatrix **P_array; - hypre_ParCSRMatrix **RT_array; - hypre_ParCSRMatrix *RAP; - hypre_IntArray **CF_marker_array; - HYPRE_Int **coarse_indices_lvls; - hypre_ParVector **F_array; - hypre_ParVector **U_array; - hypre_ParVector *residual; - HYPRE_Real *rel_res_norms; - - hypre_ParCSRMatrix **A_ff_array; - hypre_ParVector **F_fine_array; - hypre_ParVector **U_fine_array; - HYPRE_Solver **aff_solver; - HYPRE_Int (*fine_grid_solver_setup)(void*,void*,void*,void*); - HYPRE_Int (*fine_grid_solver_solve)(void*,void*,void*,void*); - - HYPRE_Real max_row_sum; - HYPRE_Int num_interp_sweeps; - HYPRE_Int num_restrict_sweeps; - //HYPRE_Int interp_type; - HYPRE_Int *interp_type; - HYPRE_Int *restrict_type; - HYPRE_Real strong_threshold; - HYPRE_Real trunc_factor; - HYPRE_Real S_commpkg_switch; - HYPRE_Int P_max_elmts; - HYPRE_Int num_iterations; - - hypre_Vector **l1_norms; - HYPRE_Real final_rel_residual_norm; - HYPRE_Real tol; - HYPRE_Real relax_weight; - HYPRE_Int relax_type; - HYPRE_Int logging; - HYPRE_Int print_level; - HYPRE_Int frelax_print_level; - HYPRE_Int cg_print_level; - HYPRE_Int max_iter; - HYPRE_Int relax_order; - HYPRE_Int num_relax_sweeps; - - HYPRE_Solver coarse_grid_solver; - HYPRE_Int (*coarse_grid_solver_setup)(void*,void*,void*,void*); - HYPRE_Int (*coarse_grid_solver_solve)(void*,void*,void*,void*); - - HYPRE_Int use_default_cgrid_solver; - HYPRE_Int use_default_fsolver; -// HYPRE_Int fsolver_type; - HYPRE_Real omega; - - /* temp vectors for solve phase */ - hypre_ParVector *Vtemp; - hypre_ParVector *Ztemp; - hypre_ParVector *Utemp; - hypre_ParVector *Ftemp; - - HYPRE_Real *diaginv; - hypre_ParCSRMatrix *A_ff_inv; - HYPRE_Int n_block; - HYPRE_Int left_size; - HYPRE_Int global_smooth_iters; - HYPRE_Int global_smooth_type; - HYPRE_Solver global_smoother; - /* - Number of points that remain part of the coarse grid throughout the hierarchy. - For example, number of well equations - */ - HYPRE_Int reserved_coarse_size; - HYPRE_BigInt *reserved_coarse_indexes; - HYPRE_Int *reserved_Cpoint_local_indexes; - - HYPRE_Int set_non_Cpoints_to_F; - HYPRE_BigInt *idx_array; - - /* F-relaxation method */ - HYPRE_Int *Frelax_method; - HYPRE_Int *Frelax_num_functions; - - /* Non-Galerkin coarse grid */ - HYPRE_Int *use_non_galerkin_cg; - - /* V-cycle F relaxation method */ - hypre_ParAMGData **FrelaxVcycleData; - hypre_ParVector *VcycleRelaxVtemp; - hypre_ParVector *VcycleRelaxZtemp; - - HYPRE_Int max_local_lvls; - - HYPRE_Int print_coarse_system; - HYPRE_Real truncate_coarse_grid_threshold; - - /* how to set C points */ - HYPRE_Int set_c_points_method; - - /* reduce reserved C-points before coarse grid solve? */ - /* this might be necessary for some applications, e.g. phase transitions */ - HYPRE_Int lvl_to_keep_cpoints; - - HYPRE_Real cg_convergence_factor; - + /* block data */ + HYPRE_Int block_size; + HYPRE_Int *block_num_coarse_indexes; + HYPRE_Int *point_marker_array; + HYPRE_Int **block_cf_marker; + + /* initial setup data (user provided) */ + HYPRE_Int num_coarse_levels; + HYPRE_Int *num_coarse_per_level; + HYPRE_Int **level_coarse_indexes; + + /* general data */ + HYPRE_Int max_num_coarse_levels; + hypre_ParCSRMatrix **A_array; + hypre_ParCSRMatrix **B_array; /* block diagonal inverse matrices */ + hypre_ParCSRMatrix **B_FF_array; /* block-FF diagonal inverse matrices */ + hypre_ParCSRMatrix **A_ff_array; +#if defined(HYPRE_USING_GPU) + hypre_ParCSRMatrix **P_FF_array; +#endif + hypre_ParCSRMatrix **P_array; + hypre_ParCSRMatrix **R_array; + hypre_ParCSRMatrix **RT_array; + hypre_ParCSRMatrix *RAP; + hypre_IntArray **CF_marker_array; + HYPRE_Int **coarse_indices_lvls; + hypre_ParVector **F_array; + hypre_ParVector **U_array; + hypre_ParVector *residual; + HYPRE_Real *rel_res_norms; + + hypre_ParVector **F_fine_array; + hypre_ParVector **U_fine_array; + HYPRE_Solver **aff_solver; + HYPRE_Int (*fine_grid_solver_setup)(void*, void*, void*, void*); + HYPRE_Int (*fine_grid_solver_solve)(void*, void*, void*, void*); + + HYPRE_Real max_row_sum; + HYPRE_Int num_interp_sweeps; + HYPRE_Int num_restrict_sweeps; + HYPRE_Int *interp_type; + HYPRE_Int *restrict_type; + HYPRE_Real strong_threshold; + HYPRE_Real trunc_factor; + HYPRE_Real S_commpkg_switch; + HYPRE_Int *P_max_elmts; + HYPRE_Int num_iterations; + + hypre_Vector **l1_norms; + HYPRE_Real final_rel_residual_norm; + HYPRE_Real tol; + HYPRE_Real relax_weight; + HYPRE_Int relax_type; + HYPRE_Int logging; + HYPRE_Int print_level; + HYPRE_Int frelax_print_level; + HYPRE_Int cg_print_level; + HYPRE_Int max_iter; + HYPRE_Int relax_order; + HYPRE_Int *num_relax_sweeps; + char *data_path; + + HYPRE_Solver coarse_grid_solver; + HYPRE_Int (*coarse_grid_solver_setup)(void*, void*, void*, void*); + HYPRE_Int (*coarse_grid_solver_solve)(void*, void*, void*, void*); + + HYPRE_Int use_default_cgrid_solver; + // Mode to use an external AMG solver for F-relaxation + // 0: use an external AMG solver that is already setup + // 1: use an external AMG solver but do setup inside MGR + // 2: use default internal AMG solver + HYPRE_Int fsolver_mode; + // HYPRE_Int fsolver_type; + HYPRE_Real omega; + + /* temp vectors for solve phase */ + hypre_ParVector *Vtemp; + hypre_ParVector *Ztemp; + hypre_ParVector *Utemp; + hypre_ParVector *Ftemp; + + HYPRE_Real **level_diaginv; + HYPRE_Real **frelax_diaginv; + HYPRE_Int n_block; + HYPRE_Int left_size; + HYPRE_Int *blk_size; + HYPRE_Int *level_smooth_iters; + HYPRE_Int *level_smooth_type; + HYPRE_Solver *level_smoother; + HYPRE_Int global_smooth_cycle; + + /* + Number of points that remain part of the coarse grid throughout the hierarchy. + For example, number of well equations + */ + HYPRE_Int reserved_coarse_size; + HYPRE_BigInt *reserved_coarse_indexes; + HYPRE_Int *reserved_Cpoint_local_indexes; + + HYPRE_Int set_non_Cpoints_to_F; + HYPRE_BigInt *idx_array; + + /* F-relaxation type */ + HYPRE_Int *Frelax_method; + HYPRE_Int *Frelax_type; + HYPRE_Int *Frelax_num_functions; + + /* Non-Galerkin coarse grid */ + HYPRE_Int *coarse_grid_method; + HYPRE_Int *nonglk_max_elmts; + + /* V-cycle F relaxation method */ + hypre_ParAMGData **FrelaxVcycleData; + hypre_ParVector *VcycleRelaxVtemp; + hypre_ParVector *VcycleRelaxZtemp; + + HYPRE_Int max_local_lvls; + + HYPRE_Int print_coarse_system; + HYPRE_Real truncate_coarse_grid_threshold; + + /* how to set C points */ + HYPRE_Int set_c_points_method; + + /* reduce reserved C-points before coarse grid solve? */ + /* this might be necessary for some applications, e.g. phase transitions */ + HYPRE_Int lvl_to_keep_cpoints; + + /* block size for block Jacobi interpolation and relaxation */ + HYPRE_Int block_jacobi_bsize; + + HYPRE_Real cg_convergence_factor; + + /* Data for Gaussian elimination F-relaxation */ + hypre_ParAMGData **GSElimData; } hypre_ParMGRData; +/*-------------------------------------------------------------------------- + * hypre_MGRRelaxData + *--------------------------------------------------------------------------*/ + +/* F-relaxation struct for future refactoring of F-relaxation in MGR */ +typedef struct +{ + HYPRE_Int relax_type; + HYPRE_Int relax_nsweeps; + + hypre_ParCSRMatrix *A; + hypre_ParVector *b; + + /* for hypre's smoother options */ + HYPRE_Int *CF_marker; + + /* for block Jacobi/GS option */ + HYPRE_Complex *diaginv; + + /* for ILU option */ + HYPRE_Solver frelax_solver; +} hypre_MGRRelaxData; #define FMRK -1 #define CMRK 1 @@ -138,7 +182,70 @@ typedef struct #define FPT(i, bsize) (((i) % (bsize)) == FMRK) #define CPT(i, bsize) (((i) % (bsize)) == CMRK) -#define SMALLREAL 1e-20 -#define DIVIDE_TOL 1e-32 +/*-------------------------------------------------------------------------- + * MGR print level codes + *--------------------------------------------------------------------------*/ + +#define HYPRE_MGR_PRINT_INFO_SETUP 0x01 /* 1 (1st bit) */ +#define HYPRE_MGR_PRINT_INFO_SOLVE 0x02 /* 2 (2nd bit) */ +#define HYPRE_MGR_PRINT_INFO_PARAMS 0x04 /* 4 (3rd bit) */ +#define HYPRE_MGR_PRINT_MODE_ASCII 0x08 /* 8 (4th bit) */ +#define HYPRE_MGR_PRINT_FINE_MATRIX 0x10 /* 16 (5th bit) */ +#define HYPRE_MGR_PRINT_FINE_RHS 0x20 /* 32 (6th bit) */ +#define HYPRE_MGR_PRINT_CRSE_MATRIX 0x40 /* 64 (7th bit) */ +#define HYPRE_MGR_PRINT_LVLS_MATRIX 0x80 /* 128 (8th bit) */ +/* ... */ +/* Reserved codes */ +#define HYPRE_MGR_PRINT_RESERVED_C 0x10000000 /* 268435456 (29th bit) */ +#define HYPRE_MGR_PRINT_RESERVED_B 0x20000000 /* 536870912 (30th bit) */ +#define HYPRE_MGR_PRINT_RESERVED_A 0x40000000 /* 1073741824 (31th bit) */ + +/*-------------------------------------------------------------------------- + * Acessor macros + *--------------------------------------------------------------------------*/ + +/* TODO (VPM): add remaining acessor macros */ +#define hypre_ParMGRDataBlockSize(data) ((data) -> block_size) /* TODO (VPM): block_dim? 3x3=9 is the block_size */ +#define hypre_ParMGRDataBlockNumCoarseIndexes(data) ((data) -> block_num_coarse_indexes) +#define hypre_ParMGRDataBlockCFMarker(data) ((data) -> block_cf_marker) +#define hypre_ParMGRDataPointMarker(data) ((data) -> point_marker_array) + +#define hypre_ParMGRDataNumCoarseLevels(data) ((data) -> num_coarse_levels) /* TODO (VPM): change to num_levels ? */ +#define hypre_ParMGRDataMaxCoarseLevels(data) ((data) -> max_num_coarse_levels) /* TODO (VPM): change to max_levels ? */ + +#define hypre_ParMGRDataAArray(data) ((data) -> A_array) +#define hypre_ParMGRDataA(data, i) ((data) -> A_array[i]) +#define hypre_ParMGRDataBArray(data) ((data) -> B_array) +#define hypre_ParMGRDataB(data, i) ((data) -> B_array[i]) +#define hypre_ParMGRDataPArray(data) ((data) -> P_array) +#define hypre_ParMGRDataP(data, i) ((data) -> P_array[i]) +#define hypre_ParMGRDataRArray(data) ((data) -> R_array) +#define hypre_ParMGRDataR(data, i) ((data) -> R_array[i]) +#define hypre_ParMGRDataRTArray(data) ((data) -> RT_array) +#define hypre_ParMGRDataRT(data, i) ((data) -> RT_array[i]) +#define hypre_ParMGRDataBFFArray(data) ((data) -> B_FF_array) +#define hypre_ParMGRDataBFF(data, i) ((data) -> B_FF_array[i]) +#define hypre_ParMGRDataRAP(data) ((data) -> RAP) + +#define hypre_ParMGRDataInterpType(data) ((data) -> interp_type) +#define hypre_ParMGRDataInterpTypeI(data, i) ((data) -> interp_type[i]) +#define hypre_ParMGRDataRestrictType(data) ((data) -> restrict_type) +#define hypre_ParMGRDataRestrictTypeI(data, i) ((data) -> restrict_type[i]) + +#define hypre_ParMGRDataLevelSmoothType(data) ((data) -> level_smooth_type) +#define hypre_ParMGRDataLevelSmoothTypeI(data, i) ((data) -> level_smooth_type[i]) +#define hypre_ParMGRDataLevelSmoother(data) ((data) -> level_smoother) +#define hypre_ParMGRDataLevelSmootherI(data, i) ((data) -> level_smoother[i]) + +#define hypre_ParMGRDataRelaxType(data) ((data) -> relax_type) +#define hypre_ParMGRDataFRelaxType(data) ((data) -> Frelax_type) +#define hypre_ParMGRDataFRelaxTypeI(data, i) ((data) -> Frelax_type[i]) +#define hypre_ParMGRDataAFFsolver(data) ((data) -> aff_solver) +#define hypre_ParMGRDataAFFsolverI(data) ((data) -> aff_solver[i]) + +#define hypre_ParMGRDataCoarseGridMethod(data) ((data) -> coarse_grid_method) +#define hypre_ParMGRDataCoarseGridMethodI(data, i) ((data) -> coarse_grid_method[i]) +#define hypre_ParMGRDataCoarseGridSolver(data) ((data) -> coarse_grid_solver) +#define hypre_ParMGRDataCoarseGridSolverSetup(data) ((data) -> coarse_grid_solver_setup) #endif diff --git a/external/hypre/src/parcsr_ls/par_mgr_coarsen.c b/external/hypre/src/parcsr_ls/par_mgr_coarsen.c new file mode 100644 index 00000000..8d4c6edb --- /dev/null +++ b/external/hypre/src/parcsr_ls/par_mgr_coarsen.c @@ -0,0 +1,54 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#include "_hypre_parcsr_ls.h" +#include "par_mgr.h" + +/*-------------------------------------------------------------------------- + * hypre_MGRCoarseParms + * + * Computes the fine and coarse partitioning arrays at once. + * + * TODO: Generate the dof_func array as in hypre_BoomerAMGCoarseParms + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRCoarseParms(MPI_Comm comm, + HYPRE_Int num_rows, + hypre_IntArray *CF_marker, + HYPRE_BigInt *row_starts_cpts, + HYPRE_BigInt *row_starts_fpts) +{ + HYPRE_UNUSED_VAR(num_rows); + + HYPRE_Int num_cpts; + HYPRE_Int num_fpts; + + HYPRE_BigInt sbuffer_recv[2]; + HYPRE_BigInt sbuffer_send[2]; + + /* Count number of Coarse points */ + hypre_IntArrayCount(CF_marker, 1, &num_cpts); + + /* Count number of Fine points */ + hypre_IntArrayCount(CF_marker, -1, &num_fpts); + + /* Scan global starts */ + sbuffer_send[0] = (HYPRE_BigInt) num_cpts; + sbuffer_send[1] = (HYPRE_BigInt) num_fpts; + hypre_MPI_Scan(&sbuffer_send, &sbuffer_recv, 2, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); + + /* First points in next processor's range */ + row_starts_cpts[1] = sbuffer_recv[0]; + row_starts_fpts[1] = sbuffer_recv[1]; + + /* First points in current processor's range */ + row_starts_cpts[0] = row_starts_cpts[1] - sbuffer_send[0]; + row_starts_fpts[0] = row_starts_fpts[1] - sbuffer_send[1]; + + return hypre_error_flag; +} diff --git a/external/hypre/src/parcsr_ls/par_mgr_device.c b/external/hypre/src/parcsr_ls/par_mgr_device.c new file mode 100644 index 00000000..1b0e0549 --- /dev/null +++ b/external/hypre/src/parcsr_ls/par_mgr_device.c @@ -0,0 +1,1007 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +/****************************************************************************** + * + * Two-grid system solver + * + *****************************************************************************/ + +#include "_hypre_onedpl.hpp" +#include "seq_mv/seq_mv.h" +#include "_hypre_parcsr_ls.h" +#include "_hypre_utilities.hpp" + +#if defined (HYPRE_USING_GPU) + +template +#if defined(HYPRE_USING_SYCL) +struct functor +#else +struct functor : public thrust::binary_function +#endif +{ + T scale; + + functor(T scale_) { scale = scale_; } + + __host__ __device__ + T operator()(const T &x, const T &y) const + { + return x + scale * (y - hypre_abs(x)); + } +}; + +/*-------------------------------------------------------------------------- + * hypre_MGRBuildPFromWpDevice + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRBuildPFromWpDevice( hypre_ParCSRMatrix *A, + hypre_ParCSRMatrix *Wp, + HYPRE_Int *CF_marker, + hypre_ParCSRMatrix **P_ptr) +{ + /* Wp info */ + hypre_CSRMatrix *Wp_diag = hypre_ParCSRMatrixDiag(Wp); + hypre_CSRMatrix *Wp_offd = hypre_ParCSRMatrixOffd(Wp); + + /* Local variables */ + hypre_ParCSRMatrix *P; + hypre_CSRMatrix *P_diag; + hypre_CSRMatrix *P_offd; + HYPRE_Int P_diag_nnz; + + hypre_GpuProfilingPushRange("MGRBuildPFromWp"); + + /* Set local variables */ + P_diag_nnz = hypre_CSRMatrixNumNonzeros(Wp_diag) + + hypre_CSRMatrixNumCols(Wp_diag); + + /* Create interpolation matrix */ + P = hypre_ParCSRMatrixCreate(hypre_ParCSRMatrixComm(A), + hypre_ParCSRMatrixGlobalNumRows(A), + hypre_ParCSRMatrixGlobalNumCols(Wp), + hypre_ParCSRMatrixRowStarts(A), + hypre_ParCSRMatrixColStarts(Wp), + hypre_CSRMatrixNumCols(Wp_offd), + P_diag_nnz, + hypre_CSRMatrixNumNonzeros(Wp_offd)); + + /* Initialize interpolation matrix */ + hypre_ParCSRMatrixInitialize_v2(P, HYPRE_MEMORY_DEVICE); + hypre_ParCSRMatrixDNumNonzeros(P) = (HYPRE_Real) hypre_ParCSRMatrixNumNonzeros(P); + P_diag = hypre_ParCSRMatrixDiag(P); + P_offd = hypre_ParCSRMatrixOffd(P); + + /* Copy contents from W to P and set identity matrix for the mapping between coarse points */ + hypreDevice_extendWtoP(hypre_ParCSRMatrixNumRows(A), + hypre_ParCSRMatrixNumRows(Wp), + hypre_CSRMatrixNumCols(Wp_diag), + CF_marker, + hypre_CSRMatrixNumNonzeros(Wp_diag), + hypre_CSRMatrixI(Wp_diag), + hypre_CSRMatrixJ(Wp_diag), + hypre_CSRMatrixData(Wp_diag), + hypre_CSRMatrixI(P_diag), + hypre_CSRMatrixJ(P_diag), + hypre_CSRMatrixData(P_diag), + hypre_CSRMatrixI(Wp_offd), + hypre_CSRMatrixI(P_offd)); + + /* Swap some pointers to avoid data copies */ + hypre_CSRMatrixJ(hypre_ParCSRMatrixOffd(P)) = hypre_CSRMatrixJ(Wp_offd); + hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(P)) = hypre_CSRMatrixData(Wp_offd); + hypre_CSRMatrixJ(Wp_offd) = NULL; + hypre_CSRMatrixData(Wp_offd) = NULL; + /* hypre_ParCSRMatrixDeviceColMapOffd(P) = hypre_ParCSRMatrixDeviceColMapOffd(Wp); */ + /* hypre_ParCSRMatrixColMapOffd(P) = hypre_ParCSRMatrixColMapOffd(Wp); */ + /* hypre_ParCSRMatrixDeviceColMapOffd(Wp) = NULL; */ + /* hypre_ParCSRMatrixColMapOffd(Wp) = NULL; */ + + /* Create communication package */ + hypre_MatvecCommPkgCreate(P); + + /* Set output pointer to the interpolation matrix */ + *P_ptr = P; + + hypre_GpuProfilingPopRange(); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_MGRBuildPDevice + * + * TODO: make use of hypre_MGRBuildPFromWpDevice + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRBuildPDevice(hypre_ParCSRMatrix *A, + HYPRE_Int *CF_marker, + HYPRE_BigInt *num_cpts_global, + HYPRE_Int method, + hypre_ParCSRMatrix **P_ptr) +{ + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + HYPRE_Int num_procs, my_id; + HYPRE_Int A_nr_of_rows = hypre_ParCSRMatrixNumRows(A); + + hypre_ParCSRMatrix *A_FF = NULL, *A_FC = NULL, *P = NULL; + hypre_CSRMatrix *W_diag = NULL, *W_offd = NULL; + HYPRE_Int W_nr_of_rows, P_diag_nnz, nfpoints; + HYPRE_Int *P_diag_i = NULL, *P_diag_j = NULL, *P_offd_i = NULL; + HYPRE_Complex *P_diag_data = NULL, *diag = NULL, *diag1 = NULL; + HYPRE_BigInt nC_global; + + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); + hypre_GpuProfilingPushRange("MGRBuildP"); + +#if defined(HYPRE_USING_SYCL) + nfpoints = HYPRE_ONEDPL_CALL(std::count, + CF_marker, + CF_marker + A_nr_of_rows, + -1); +#else + nfpoints = HYPRE_THRUST_CALL(count, + CF_marker, + CF_marker + A_nr_of_rows, + -1); +#endif + + if (method > 0) + { + hypre_ParCSRMatrixGenerateFFFCDevice(A, CF_marker, num_cpts_global, NULL, &A_FC, &A_FF); + diag = hypre_CTAlloc(HYPRE_Complex, nfpoints, HYPRE_MEMORY_DEVICE); + if (method == 1) + { + // extract diag inverse sqrt + // hypre_CSRMatrixExtractDiagonalDevice(hypre_ParCSRMatrixDiag(A_FF), diag, 3); + + // L1-Jacobi-type interpolation + HYPRE_Complex scal = 1.0; + + diag1 = hypre_CTAlloc(HYPRE_Complex, nfpoints, HYPRE_MEMORY_DEVICE); + hypre_CSRMatrixExtractDiagonalDevice(hypre_ParCSRMatrixDiag(A_FF), diag, 0); + + hypre_CSRMatrixComputeRowSumDevice(hypre_ParCSRMatrixDiag(A_FF), NULL, NULL, + diag1, 1, 1.0, "set"); + hypre_CSRMatrixComputeRowSumDevice(hypre_ParCSRMatrixDiag(A_FC), NULL, NULL, + diag1, 1, 1.0, "add"); + hypre_CSRMatrixComputeRowSumDevice(hypre_ParCSRMatrixOffd(A_FF), NULL, NULL, + diag1, 1, 1.0, "add"); + hypre_CSRMatrixComputeRowSumDevice(hypre_ParCSRMatrixOffd(A_FC), NULL, NULL, + diag1, 1, 1.0, "add"); + +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL(std::transform, + diag, + diag + nfpoints, + diag1, + diag, + functor(scal)); + + HYPRE_ONEDPL_CALL(std::transform, + diag, + diag + nfpoints, + diag, + [] (auto x) { return 1.0 / x; }); +#else + HYPRE_THRUST_CALL(transform, + diag, + diag + nfpoints, + diag1, + diag, + functor(scal)); + + HYPRE_THRUST_CALL(transform, + diag, + diag + nfpoints, + diag, + 1.0 / _1); +#endif + + hypre_TFree(diag1, HYPRE_MEMORY_DEVICE); + } + else if (method == 2) + { + // extract diag inverse + hypre_CSRMatrixExtractDiagonalDevice(hypre_ParCSRMatrixDiag(A_FF), diag, 2); + } + +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( transform, diag, diag + nfpoints, diag, std::negate() ); +#else + HYPRE_THRUST_CALL( transform, diag, diag + nfpoints, diag, thrust::negate() ); +#endif + + hypre_Vector *D_FF_inv = hypre_SeqVectorCreate(nfpoints); + hypre_VectorData(D_FF_inv) = diag; + hypre_SeqVectorInitialize_v2(D_FF_inv, HYPRE_MEMORY_DEVICE); + hypre_CSRMatrixDiagScaleDevice(hypre_ParCSRMatrixDiag(A_FC), D_FF_inv, NULL); + hypre_CSRMatrixDiagScaleDevice(hypre_ParCSRMatrixOffd(A_FC), D_FF_inv, NULL); + hypre_SeqVectorDestroy(D_FF_inv); + W_diag = hypre_ParCSRMatrixDiag(A_FC); + W_offd = hypre_ParCSRMatrixOffd(A_FC); + nC_global = hypre_ParCSRMatrixGlobalNumCols(A_FC); + } + else + { + W_diag = hypre_CSRMatrixCreate(nfpoints, A_nr_of_rows - nfpoints, 0); + W_offd = hypre_CSRMatrixCreate(nfpoints, 0, 0); + hypre_CSRMatrixInitialize_v2(W_diag, 0, HYPRE_MEMORY_DEVICE); + hypre_CSRMatrixInitialize_v2(W_offd, 0, HYPRE_MEMORY_DEVICE); + + if (my_id == (num_procs - 1)) + { + nC_global = num_cpts_global[1]; + } + hypre_MPI_Bcast(&nC_global, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); + } + + W_nr_of_rows = hypre_CSRMatrixNumRows(W_diag); + + /* Construct P from matrix product W_diag */ + P_diag_nnz = hypre_CSRMatrixNumNonzeros(W_diag) + hypre_CSRMatrixNumCols(W_diag); + P_diag_i = hypre_TAlloc(HYPRE_Int, A_nr_of_rows + 1, HYPRE_MEMORY_DEVICE); + P_diag_j = hypre_TAlloc(HYPRE_Int, P_diag_nnz, HYPRE_MEMORY_DEVICE); + P_diag_data = hypre_TAlloc(HYPRE_Complex, P_diag_nnz, HYPRE_MEMORY_DEVICE); + P_offd_i = hypre_TAlloc(HYPRE_Int, A_nr_of_rows + 1, HYPRE_MEMORY_DEVICE); + + hypreDevice_extendWtoP( A_nr_of_rows, + W_nr_of_rows, + hypre_CSRMatrixNumCols(W_diag), + CF_marker, + hypre_CSRMatrixNumNonzeros(W_diag), + hypre_CSRMatrixI(W_diag), + hypre_CSRMatrixJ(W_diag), + hypre_CSRMatrixData(W_diag), + P_diag_i, + P_diag_j, + P_diag_data, + hypre_CSRMatrixI(W_offd), + P_offd_i ); + + // final P + P = hypre_ParCSRMatrixCreate(hypre_ParCSRMatrixComm(A), + hypre_ParCSRMatrixGlobalNumRows(A), + nC_global, + hypre_ParCSRMatrixColStarts(A), + num_cpts_global, + hypre_CSRMatrixNumCols(W_offd), + P_diag_nnz, + hypre_CSRMatrixNumNonzeros(W_offd) ); + + hypre_CSRMatrixMemoryLocation(hypre_ParCSRMatrixDiag(P)) = HYPRE_MEMORY_DEVICE; + hypre_CSRMatrixMemoryLocation(hypre_ParCSRMatrixOffd(P)) = HYPRE_MEMORY_DEVICE; + + hypre_CSRMatrixI(hypre_ParCSRMatrixDiag(P)) = P_diag_i; + hypre_CSRMatrixJ(hypre_ParCSRMatrixDiag(P)) = P_diag_j; + hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(P)) = P_diag_data; + + hypre_CSRMatrixI(hypre_ParCSRMatrixOffd(P)) = P_offd_i; + hypre_CSRMatrixJ(hypre_ParCSRMatrixOffd(P)) = hypre_CSRMatrixJ(W_offd); + hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(P)) = hypre_CSRMatrixData(W_offd); + hypre_CSRMatrixJ(W_offd) = NULL; + hypre_CSRMatrixData(W_offd) = NULL; + + if (method > 0) + { + hypre_ParCSRMatrixDeviceColMapOffd(P) = hypre_ParCSRMatrixDeviceColMapOffd(A_FC); + hypre_ParCSRMatrixColMapOffd(P) = hypre_ParCSRMatrixColMapOffd(A_FC); + hypre_ParCSRMatrixDeviceColMapOffd(A_FC) = NULL; + hypre_ParCSRMatrixColMapOffd(A_FC) = NULL; + hypre_ParCSRMatrixNumNonzeros(P) = hypre_ParCSRMatrixNumNonzeros(A_FC) + + hypre_ParCSRMatrixGlobalNumCols(A_FC); + } + else + { + hypre_ParCSRMatrixNumNonzeros(P) = nC_global; + } + hypre_ParCSRMatrixDNumNonzeros(P) = (HYPRE_Real) hypre_ParCSRMatrixNumNonzeros(P); + + hypre_MatvecCommPkgCreate(P); + + *P_ptr = P; + + if (A_FF) + { + hypre_ParCSRMatrixDestroy(A_FF); + } + if (A_FC) + { + hypre_ParCSRMatrixDestroy(A_FC); + } + + if (method <= 0) + { + hypre_CSRMatrixDestroy(W_diag); + hypre_CSRMatrixDestroy(W_offd); + } + + hypre_GpuProfilingPopRange(); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_MGRRelaxL1JacobiDevice + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRRelaxL1JacobiDevice( hypre_ParCSRMatrix *A, + hypre_ParVector *f, + HYPRE_Int *CF_marker, + HYPRE_Int relax_points, + HYPRE_Real relax_weight, + HYPRE_Real *l1_norms, + hypre_ParVector *u, + hypre_ParVector *Vtemp ) +{ + hypre_BoomerAMGRelax(A, f, CF_marker, 18, + relax_points, relax_weight, 1.0, + l1_norms, u, Vtemp, NULL); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypreGPUKernel_CSRMatrixExtractBlockDiag + * + * Fills vector diag with the block diagonals from the input matrix. + * This function uses column-major storage for diag. + * + * TODOs: + * 1) Move this to csr_matop_device.c + * 2) Use sub-warps? + * 3) blk_size as template arg. + * 4) Choose diag storage between row and column-major? + * 5) Should we build flat arrays, arrays of pointers, or allow both? + *--------------------------------------------------------------------------*/ + +__global__ void +hypreGPUKernel_CSRMatrixExtractBlockDiag( hypre_DeviceItem &item, + HYPRE_Int blk_size, + HYPRE_Int num_rows, + HYPRE_Int *A_i, + HYPRE_Int *A_j, + HYPRE_Complex *A_a, + HYPRE_Int *B_i, + HYPRE_Int *B_j, + HYPRE_Complex *B_a ) +{ + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); + HYPRE_Int bs2 = blk_size * blk_size; + HYPRE_Int bidx; + HYPRE_Int lidx; + HYPRE_Int i, ii, j, pj, qj; + HYPRE_Int col; + + /* Grid-stride loop over block matrix rows */ + for (bidx = hypre_gpu_get_grid_warp_id<1, 1>(item); + bidx < num_rows / blk_size; + bidx += hypre_gpu_get_grid_num_warps<1, 1>(item)) + { + ii = bidx * blk_size; + + /* Set output row pointer and column indices */ + for (i = lane; i < blk_size; i += HYPRE_WARP_SIZE) + { + B_i[ii + i + 1] = (ii + i + 1) * blk_size; + } + + /* Set output column indices (row major) */ + for (j = lane; j < bs2; j += HYPRE_WARP_SIZE) + { + B_j[ii * blk_size + j] = ii + j % blk_size; + } + + /* TODO: unroll this loop */ + for (lidx = 0; lidx < blk_size; lidx++) + { + i = ii + lidx; + + if (lane < 2) + { + pj = read_only_load(A_i + i + lane); + } + qj = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, pj, 1); + pj = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, pj, 0); + + /* Loop over columns */ + for (j = pj + lane; j < qj; j += HYPRE_WARP_SIZE) + { + col = read_only_load(A_j + j); + + if ((col >= ii) && + (col < ii + blk_size) && + (fabs(A_a[j]) > HYPRE_REAL_MIN)) + { + /* batch offset + column offset + row offset */ + B_a[ii * blk_size + (col - ii) * blk_size + lidx] = A_a[j]; + } + } + } /* Local block loop */ + } /* Grid-stride loop */ +} + +/*-------------------------------------------------------------------------- + * hypreGPUKernel_CSRMatrixExtractBlockDiagMarked + * + * Fills vector diag with the block diagonals from the input matrix. + * This function uses column-major storage for diag. + * + * TODOs: + * 1) Move this to csr_matop_device.c + * 2) Use sub-warps? + * 3) blk_size as template arg. + * 4) Choose diag storage between row and column-major? + * 5) Should we build flat arrays, arrays of pointers, or allow both? + *--------------------------------------------------------------------------*/ + +__global__ void +hypreGPUKernel_CSRMatrixExtractBlockDiagMarked( hypre_DeviceItem &item, + HYPRE_Int blk_size, + HYPRE_Int num_rows, + HYPRE_Int marker_val, + HYPRE_Int *marker, + HYPRE_Int *marker_indices, + HYPRE_Int *A_i, + HYPRE_Int *A_j, + HYPRE_Complex *A_a, + HYPRE_Int *B_i, + HYPRE_Int *B_j, + HYPRE_Complex *B_a ) +{ + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); + HYPRE_Int bidx; + HYPRE_Int lidx; + HYPRE_Int i, ii, j, pj, qj, k; + HYPRE_Int col; + + /* Grid-stride loop over block matrix rows */ + for (bidx = hypre_gpu_get_grid_warp_id<1, 1>(item); + bidx < num_rows / blk_size; + bidx += hypre_gpu_get_grid_num_warps<1, 1>(item)) + { + /* TODO: unroll this loop */ + for (lidx = 0; lidx < blk_size; lidx++) + { + ii = bidx * blk_size; + i = ii + lidx; + + if (marker[i] == marker_val) + { + if (lane < 2) + { + pj = read_only_load(A_i + i + lane); + } + qj = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, pj, 1); + pj = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, pj, 0); + + /* Loop over columns */ + for (j = pj + lane; j < qj; j += HYPRE_WARP_SIZE) + { + k = read_only_load(A_j + j); + col = A_j[k]; + + if (marker[col] == marker_val) + { + if ((col >= ii) && + (col < ii + blk_size) && + (fabs(A_a[k]) > HYPRE_REAL_MIN)) + { + /* batch offset + column offset + row offset */ + B_a[marker_indices[ii] * blk_size + (col - ii) * blk_size + lidx] = A_a[k]; + } + } + } + } /* row check */ + } /* Local block loop */ + } /* Grid-stride loop */ +} + +/*-------------------------------------------------------------------------- + * hypreGPUKernel_ComplexMatrixBatchedTranspose + * + * Transposes a group of dense matrices. Assigns one warp per block (batch). + * Naive implementation. + * + * TODOs (VPM): + * 1) Move to proper file. + * 2) Use template argument for other data types + * 3) Implement in-place transpose. + *--------------------------------------------------------------------------*/ + +__global__ void +hypreGPUKernel_ComplexMatrixBatchedTranspose( hypre_DeviceItem &item, + HYPRE_Int num_blocks, + HYPRE_Int block_size, + HYPRE_Complex *A_data, + HYPRE_Complex *B_data ) +{ + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); + HYPRE_Int bs2 = block_size * block_size; + HYPRE_Int bidx, lidx; + + /* Grid-stride loop over block matrix rows */ + for (bidx = hypre_gpu_get_grid_warp_id<1, 1>(item); + bidx < num_blocks; + bidx += hypre_gpu_get_grid_num_warps<1, 1>(item)) + { + for (lidx = lane; lidx < bs2; lidx += HYPRE_WARP_SIZE) + { + B_data[bidx * bs2 + lidx] = + A_data[bidx * bs2 + (lidx / block_size + (lidx % block_size) * block_size)]; + } + } /* Grid-stride loop */ +} + +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixExtractBlockDiagDevice + * + * TODOs (VPM): + * 1) Allow other local solver choices. Design an interface for that. + * 2) Move this to par_csr_matop_device.c + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixExtractBlockDiagDevice( hypre_ParCSRMatrix *A, + HYPRE_Int blk_size, + HYPRE_Int num_points, + HYPRE_Int point_type, + HYPRE_Int *CF_marker, + HYPRE_Int diag_size, + HYPRE_Int diag_type, + HYPRE_Int *B_diag_i, + HYPRE_Int *B_diag_j, + HYPRE_Complex *B_diag_data ) +{ + HYPRE_UNUSED_VAR(CF_marker); + HYPRE_UNUSED_VAR(diag_size); + + /* Matrix variables */ + HYPRE_BigInt num_rows_A = hypre_ParCSRMatrixGlobalNumRows(A); + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + HYPRE_Int num_rows = hypre_CSRMatrixNumRows(A_diag); + HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); + HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); + HYPRE_Complex *A_diag_data = hypre_CSRMatrixData(A_diag); + + /* Local LS variables */ +#if defined(HYPRE_USING_ONEMKLBLAS) + std::int64_t *pivots; + std::int64_t work_sizes[2]; + std::int64_t work_size; + HYPRE_Complex *scratchpad; +#else + HYPRE_Int *pivots; + HYPRE_Complex **tmpdiag_aop; + HYPRE_Int *info; +#endif + HYPRE_Int *blk_row_indices; + HYPRE_Complex *tmpdiag; + HYPRE_Complex **diag_aop; + + /* Local variables */ + HYPRE_Int bs2 = blk_size * blk_size; + HYPRE_Int num_blocks; + HYPRE_Int bdiag_size; + + /* Additional variables for debugging */ +#if HYPRE_DEBUG + HYPRE_Int *h_info; + HYPRE_Int k, myid; + + hypre_MPI_Comm_rank(hypre_ParCSRMatrixComm(A), &myid); +#endif + + /*----------------------------------------------------------------- + * Sanity checks + *-----------------------------------------------------------------*/ + + if (blk_size < 1) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Invalid block size!"); + + return hypre_error_flag; + } + + if ((num_rows_A > 0) && (num_rows_A < blk_size)) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Input matrix is smaller than block size!"); + + return hypre_error_flag; + } + + /* Return if the local matrix is empty */ + if (!num_rows) + { + return hypre_error_flag; + } + + /*----------------------------------------------------------------- + * Initial + *-----------------------------------------------------------------*/ + + hypre_GpuProfilingPushRange("ParCSRMatrixExtractBlockDiag"); + + /* Count the number of points matching point_type in CF_marker */ + if (CF_marker) + { + /* Compute block row indices */ + blk_row_indices = hypre_TAlloc(HYPRE_Int, num_rows, HYPRE_MEMORY_DEVICE); + hypreDevice_IntFilln(blk_row_indices, (size_t) num_rows, 1); +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL(oneapi::dpl::exclusive_scan_by_segment, + CF_marker, + CF_marker + num_rows, + blk_row_indices, + blk_row_indices); +#else + HYPRE_THRUST_CALL(exclusive_scan_by_key, + CF_marker, + CF_marker + num_rows, + blk_row_indices, + blk_row_indices); +#endif + } + else + { + blk_row_indices = NULL; + } + + /* Compute block info */ + num_blocks = hypre_ceildiv(num_points, blk_size); + bdiag_size = num_blocks * bs2; + + if (num_points % blk_size) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "TODO! num_points % blk_size != 0"); + hypre_GpuProfilingPopRange(); + + return hypre_error_flag; + } + + /*----------------------------------------------------------------- + * Extract diagonal sub-blocks (pattern and coefficients) + *-----------------------------------------------------------------*/ + { + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(num_blocks, "warp", bDim); + + if (CF_marker) + { + HYPRE_GPU_LAUNCH( hypreGPUKernel_CSRMatrixExtractBlockDiagMarked, gDim, bDim, + blk_size, num_rows, point_type, CF_marker, blk_row_indices, + A_diag_i, A_diag_j, A_diag_data, + B_diag_i, B_diag_j, B_diag_data ); + } + else + { + HYPRE_GPU_LAUNCH( hypreGPUKernel_CSRMatrixExtractBlockDiag, gDim, bDim, + blk_size, num_rows, + A_diag_i, A_diag_j, A_diag_data, + B_diag_i, B_diag_j, B_diag_data ); + } + } + + /*----------------------------------------------------------------- + * Invert diagonal sub-blocks + *-----------------------------------------------------------------*/ + + if (diag_type == 1) + { + HYPRE_ANNOTATE_REGION_BEGIN("%s", "InvertDiagSubBlocks"); + + /* Memory allocation */ + tmpdiag = hypre_TAlloc(HYPRE_Complex, bdiag_size, HYPRE_MEMORY_DEVICE); + diag_aop = hypre_TAlloc(HYPRE_Complex *, num_blocks, HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_ONEMKLBLAS) + pivots = hypre_CTAlloc(std::int64_t, num_rows * blk_size, HYPRE_MEMORY_DEVICE); +#else + pivots = hypre_CTAlloc(HYPRE_Int, num_rows * blk_size, HYPRE_MEMORY_DEVICE); + tmpdiag_aop = hypre_TAlloc(HYPRE_Complex *, num_blocks, HYPRE_MEMORY_DEVICE); + info = hypre_CTAlloc(HYPRE_Int, num_blocks, HYPRE_MEMORY_DEVICE); +#if defined (HYPRE_DEBUG) + h_info = hypre_TAlloc(HYPRE_Int, num_blocks, HYPRE_MEMORY_HOST); +#endif + + /* Memory copy */ + hypre_TMemcpy(tmpdiag, B_diag_data, HYPRE_Complex, bdiag_size, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + + /* Set work array of pointers */ + hypreDevice_ComplexArrayToArrayOfPtrs(num_blocks, bs2, tmpdiag, tmpdiag_aop); +#endif + + /* Set array of pointers */ + hypreDevice_ComplexArrayToArrayOfPtrs(num_blocks, bs2, B_diag_data, diag_aop); + + /* Compute LU factorization */ +#if defined(HYPRE_USING_CUBLAS) + HYPRE_CUBLAS_CALL(hypre_cublas_getrfBatched(hypre_HandleCublasHandle(hypre_handle()), + blk_size, + tmpdiag_aop, + blk_size, + pivots, + info, + num_blocks)); +#elif defined(HYPRE_USING_ROCSOLVER) + HYPRE_ROCSOLVER_CALL(rocsolver_dgetrf_batched(hypre_HandleVendorSolverHandle(hypre_handle()), + blk_size, + blk_size, + tmpdiag_aop, + blk_size, + pivots, + blk_size, + info, + num_blocks)); + +#elif defined(HYPRE_USING_ONEMKLBLAS) + HYPRE_ONEMKL_CALL( work_sizes[0] = + oneapi::mkl::lapack::getrf_batch_scratchpad_size( *hypre_HandleComputeStream( + hypre_handle()), + blk_size, // std::int64_t m, + blk_size, // std::int64_t n, + blk_size, // std::int64_t lda, + bs2, // std::int64_t stride_a, + blk_size, // std::int64_t stride_ipiv, + num_blocks ) ); // std::int64_t batch_size + + HYPRE_ONEMKL_CALL( work_sizes[1] = + oneapi::mkl::lapack::getri_batch_scratchpad_size( *hypre_HandleComputeStream( + hypre_handle()), + (std::int64_t) blk_size, // std::int64_t n, + (std::int64_t) blk_size, // std::int64_t lda, + (std::int64_t) bs2, // std::int64_t stride_a, + (std::int64_t) blk_size, // std::int64_t stride_ipiv, + (std::int64_t) num_blocks // std::int64_t batch_size + ) ); + work_size = hypre_max(work_sizes[0], work_sizes[1]); + scratchpad = hypre_TAlloc(HYPRE_Complex, work_size, HYPRE_MEMORY_DEVICE); + + HYPRE_ONEMKL_CALL( oneapi::mkl::lapack::getrf_batch( *hypre_HandleComputeStream(hypre_handle()), + (std::int64_t) blk_size, // std::int64_t m, + (std::int64_t) blk_size, // std::int64_t n, + *diag_aop, // T *a, + (std::int64_t) blk_size, // std::int64_t lda, + (std::int64_t) bs2, // std::int64_t stride_a, + pivots, // std::int64_t *ipiv, + (std::int64_t) blk_size, // std::int64_t stride_ipiv, + (std::int64_t) num_blocks, // std::int64_t batch_size, + scratchpad, // T *scratchpad, + (std::int64_t) work_size // std::int64_t scratchpad_size, + ).wait() ); // const std::vector &events = {} ) ); +#else + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Block inversion not available!"); + return hypre_error_flag; +#endif + +#if defined (HYPRE_DEBUG) && !defined(HYPRE_USING_ONEMKLBLAS) + hypre_TMemcpy(h_info, info, HYPRE_Int, num_blocks, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); + for (k = 0; k < num_blocks; k++) + { + if (h_info[k] != 0) + { + if (h_info[k] < 0) + { + hypre_printf("[%d]: LU fact. failed at system %d, parameter %d ", + myid, k, h_info[k]); + } + else + { + hypre_printf("[%d]: Singular U(%d, %d) at system %d", + myid, h_info[k], h_info[k], k); + } + } + } +#endif + + /* Compute sub-blocks inverses */ +#if defined(HYPRE_USING_CUBLAS) + HYPRE_CUBLAS_CALL(hypre_cublas_getriBatched(hypre_HandleCublasHandle(hypre_handle()), + blk_size, + (const HYPRE_Real **) tmpdiag_aop, + blk_size, + pivots, + diag_aop, + blk_size, + info, + num_blocks)); +#elif defined(HYPRE_USING_ROCSOLVER) + HYPRE_ROCSOLVER_CALL(rocsolver_dgetri_batched(hypre_HandleVendorSolverHandle(hypre_handle()), + blk_size, + tmpdiag_aop, + blk_size, + pivots, + blk_size, + info, + num_blocks)); +#elif defined(HYPRE_USING_ONEMKLBLAS) + HYPRE_ONEMKL_CALL( oneapi::mkl::lapack::getri_batch( *hypre_HandleComputeStream(hypre_handle()), + (std::int64_t) blk_size, // std::int64_t n, + *diag_aop, // T *a, + (std::int64_t) blk_size, // std::int64_t lda, + (std::int64_t) bs2, // std::int64_t stride_a, + pivots, // std::int64_t *ipiv, + (std::int64_t) blk_size, // std::int64_t stride_ipiv, + (std::int64_t) num_blocks, // std::int64_t batch_size, + scratchpad, // T *scratchpad, + work_size // std::int64_t scratchpad_size + ).wait() ); +#else + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Block inversion not available!"); + return hypre_error_flag; +#endif + + /* Free memory */ + hypre_TFree(diag_aop, HYPRE_MEMORY_DEVICE); + hypre_TFree(pivots, HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_ONEMKLBLAS) + hypre_TFree(scratchpad, HYPRE_MEMORY_DEVICE); +#else + hypre_TFree(tmpdiag_aop, HYPRE_MEMORY_DEVICE); + hypre_TFree(info, HYPRE_MEMORY_DEVICE); +#if defined (HYPRE_DEBUG) + hypre_TFree(h_info, HYPRE_MEMORY_HOST); +#endif +#endif + + /* Transpose data to row-major format */ + { + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(num_blocks, "warp", bDim); + + /* Memory copy */ + hypre_TMemcpy(tmpdiag, B_diag_data, HYPRE_Complex, bdiag_size, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + + HYPRE_GPU_LAUNCH( hypreGPUKernel_ComplexMatrixBatchedTranspose, gDim, bDim, + num_blocks, blk_size, tmpdiag, B_diag_data ); + } + + /* Free memory */ + hypre_TFree(tmpdiag, HYPRE_MEMORY_DEVICE); + + HYPRE_ANNOTATE_REGION_END("%s", "InvertDiagSubBlocks"); + } + + /* Free memory */ + hypre_TFree(blk_row_indices, HYPRE_MEMORY_DEVICE); + hypre_GpuProfilingPopRange(); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixBlockDiagMatrixDevice + * + * TODO: Move this to par_csr_matop_device.c (VPM) + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixBlockDiagMatrixDevice( hypre_ParCSRMatrix *A, + HYPRE_Int blk_size, + HYPRE_Int point_type, + HYPRE_Int *CF_marker, + HYPRE_Int diag_type, + hypre_ParCSRMatrix **B_ptr ) +{ + /* Input matrix info */ + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + HYPRE_BigInt *row_starts_A = hypre_ParCSRMatrixRowStarts(A); + HYPRE_BigInt num_rows_A = hypre_ParCSRMatrixGlobalNumRows(A); + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + HYPRE_Int A_diag_num_rows = hypre_CSRMatrixNumRows(A_diag); + + /* Global block matrix info */ + hypre_ParCSRMatrix *par_B; + HYPRE_BigInt num_rows_B; + HYPRE_BigInt row_starts_B[2]; + + /* Diagonal block matrix info */ + hypre_CSRMatrix *B_diag; + HYPRE_Int B_diag_num_rows; + HYPRE_Int B_diag_size; + HYPRE_Int *B_diag_i; + HYPRE_Int *B_diag_j; + HYPRE_Complex *B_diag_data; + + /* Local variables */ + HYPRE_BigInt num_rows_big; + HYPRE_BigInt scan_recv; + HYPRE_Int num_procs, my_id; + HYPRE_Int num_blocks; + + hypre_MPI_Comm_rank(comm, &my_id); + hypre_MPI_Comm_size(comm, &num_procs); + + /*----------------------------------------------------------------- + * Count the number of points matching point_type in CF_marker + *-----------------------------------------------------------------*/ + + if (!CF_marker) + { + B_diag_num_rows = A_diag_num_rows; + } + else + { +#if defined(HYPRE_USING_SYCL) + B_diag_num_rows = HYPRE_ONEDPL_CALL( std::count, + CF_marker, + CF_marker + A_diag_num_rows, + point_type ); +#else + B_diag_num_rows = HYPRE_THRUST_CALL( count, + CF_marker, + CF_marker + A_diag_num_rows, + point_type ); +#endif + } + num_blocks = hypre_ceildiv(B_diag_num_rows, blk_size); + B_diag_size = blk_size * (blk_size * num_blocks); + + /*----------------------------------------------------------------- + * Compute global number of rows and partitionings + *-----------------------------------------------------------------*/ + + if (CF_marker) + { + num_rows_big = (HYPRE_BigInt) B_diag_num_rows; + hypre_MPI_Scan(&num_rows_big, &scan_recv, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); + + /* first point in my range */ + row_starts_B[0] = scan_recv - num_rows_big; + + /* first point in next proc's range */ + row_starts_B[1] = scan_recv; + if (my_id == (num_procs - 1)) + { + num_rows_B = row_starts_B[1]; + } + hypre_MPI_Bcast(&num_rows_B, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); + } + else + { + row_starts_B[0] = row_starts_A[0]; + row_starts_B[1] = row_starts_A[1]; + num_rows_B = num_rows_A; + } + + /* Create matrix B */ + par_B = hypre_ParCSRMatrixCreate(comm, + num_rows_B, + num_rows_B, + row_starts_B, + row_starts_B, + 0, + B_diag_size, + 0); + hypre_ParCSRMatrixInitialize_v2(par_B, HYPRE_MEMORY_DEVICE); + B_diag = hypre_ParCSRMatrixDiag(par_B); + B_diag_i = hypre_CSRMatrixI(B_diag); + B_diag_j = hypre_CSRMatrixJ(B_diag); + B_diag_data = hypre_CSRMatrixData(B_diag); + + /*----------------------------------------------------------------------- + * Extract coefficients + *-----------------------------------------------------------------------*/ + + hypre_ParCSRMatrixExtractBlockDiagDevice(A, blk_size, B_diag_num_rows, + point_type, CF_marker, + B_diag_size, diag_type, + B_diag_i, B_diag_j, B_diag_data); + + /* Set output pointer */ + *B_ptr = par_B; + + return hypre_error_flag; +} + +#endif diff --git a/external/hypre/src/parcsr_ls/par_mgr_interp.c b/external/hypre/src/parcsr_ls/par_mgr_interp.c new file mode 100644 index 00000000..83a4776b --- /dev/null +++ b/external/hypre/src/parcsr_ls/par_mgr_interp.c @@ -0,0 +1,2637 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#include "_hypre_parcsr_ls.h" +#include "par_mgr.h" + +/*-------------------------------------------------------------------------- + * hypre_MGRBuildInterp + * + * Build MGR's prolongation matrix P = [Wp I]^T where Wp might be computed + * explicitly and returned as an output of this function. + * Wp approximates [- inv(A_FF) * A_FC]. Note the negative sign. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRBuildInterp(hypre_ParCSRMatrix *A, + hypre_ParCSRMatrix *A_FF, + hypre_ParCSRMatrix *A_FC, + hypre_ParCSRMatrix *S, + hypre_IntArray *CF_marker, + HYPRE_BigInt *num_cpts_global, + HYPRE_Real trunc_factor, + HYPRE_Int max_elmts, + HYPRE_Int blk_size, + HYPRE_Int interp_type, + HYPRE_Int num_sweeps_post, + hypre_ParCSRMatrix **Wp_ptr, + hypre_ParCSRMatrix **P_ptr) +{ + HYPRE_Int *CF_marker_data = hypre_IntArrayData(CF_marker); + hypre_ParCSRMatrix *P = NULL; + hypre_ParCSRMatrix *Wp = NULL; + +#if defined (HYPRE_USING_GPU) + HYPRE_MemoryLocation memory_location = hypre_ParCSRMatrixMemoryLocation(A); + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1(memory_location); +#endif + + /* Sanity checks */ + if (!Wp_ptr) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Wp_ptr is not NULL!"); + return hypre_error_flag; + } + + if (!P_ptr) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "P_ptr is not NULL!"); + return hypre_error_flag; + } + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("Interp"); + + /* Interpolation for each level */ + if (interp_type < 3) + { +#if defined (HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_MGRBuildPDevice(A, CF_marker_data, num_cpts_global, interp_type, &P); + } + else +#endif + { + hypre_MGRBuildPHost(A, A_FF, A_FC, CF_marker_data, num_cpts_global, + interp_type, &Wp, &P); + + /* TODO (VPM): Revisit Prolongation post-smoothing */ +#if 0 + if (interp_type == 2) + { + HYPRE_Real jac_trunc_threshold = trunc_factor; + HYPRE_Real jac_trunc_threshold_minus = 0.5 * jac_trunc_threshold; + HYPRE_Int i; + + for (i = 0; i < num_sweeps_post; i++) + { + hypre_BoomerAMGJacobiInterp(A, &P, S, 1, NULL, CF_marker_data, 0, + jac_trunc_threshold, jac_trunc_threshold_minus); + } + hypre_BoomerAMGInterpTruncation(P, trunc_factor, max_elmts); + } +#else + HYPRE_UNUSED_VAR(num_sweeps_post); +#endif + } + } + else if (interp_type == 4) + { +#if defined (HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_IntArrayMigrate(CF_marker, HYPRE_MEMORY_HOST); + hypre_ParCSRMatrixMigrate(A, HYPRE_MEMORY_HOST); + hypre_MGRBuildInterpApproximateInverse(A, CF_marker_data, num_cpts_global, &P); + hypre_ParCSRMatrixMigrate(A, memory_location); + hypre_IntArrayMigrate(CF_marker, memory_location); + } + else +#endif + { + hypre_MGRBuildInterpApproximateInverse(A, CF_marker_data, num_cpts_global, &P); + } + + /* Perform truncation */ + hypre_BoomerAMGInterpTruncation(P, trunc_factor, max_elmts); + } + else if (interp_type == 5) + { + hypre_BoomerAMGBuildModExtInterp(A, CF_marker_data, S, num_cpts_global, + 1, NULL, 0, trunc_factor, max_elmts, &P); + } + else if (interp_type == 6) + { + hypre_BoomerAMGBuildModExtPIInterp(A, CF_marker_data, S, num_cpts_global, + 1, NULL, 0, trunc_factor, max_elmts, &P); + } + else if (interp_type == 7) + { + hypre_BoomerAMGBuildModExtPEInterp(A, CF_marker_data, S, num_cpts_global, + 1, NULL, 0, trunc_factor, max_elmts, &P); + } + else if (interp_type == 12) + { + /* Block diagonal interpolation */ + hypre_MGRBuildBlockJacobiWp(A_FF, A_FC, blk_size, &Wp); + hypre_MGRBuildBlockJacobiP(A, A_FF, A_FC, Wp, blk_size, CF_marker_data, &P); + } + else + { + /* Classical modified interpolation */ + hypre_BoomerAMGBuildInterp(A, CF_marker_data, S, num_cpts_global, 1, NULL, 0, + trunc_factor, max_elmts, &P); + } + + /* set pointer to Wp and P */ + *Wp_ptr = Wp; + *P_ptr = P; + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_MGRBuildRestrict + * + * Build MGR's restriction matrix R = [Wr I] where Wr might be computed + * explicitly and returned as an output of this function. + * Wr approximates [- A_CF * inv(A_FF)]. Note the negative sign. + * + * TODOs (VPM): + * 1) Add post-smoothing + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRBuildRestrict( hypre_ParCSRMatrix *A, + hypre_ParCSRMatrix *A_FF, + hypre_ParCSRMatrix *A_FC, + hypre_ParCSRMatrix *A_CF, + hypre_IntArray *CF_marker, + HYPRE_BigInt *num_cpts_global, + HYPRE_Real trunc_factor, + HYPRE_Int max_elmts, + HYPRE_Real strong_threshold, + HYPRE_Real max_row_sum, + HYPRE_Int blk_size, + HYPRE_Int restrict_type, + hypre_ParCSRMatrix **Wr_ptr, + hypre_ParCSRMatrix **R_ptr, + hypre_ParCSRMatrix **RT_ptr) +{ + /* Input variables */ + HYPRE_Int *CF_marker_data = hypre_IntArrayData(CF_marker); + + /* Output variables */ + hypre_ParCSRMatrix *Wr = NULL; + hypre_ParCSRMatrix *R = NULL; + hypre_ParCSRMatrix *RT = NULL; + + /* Local variables */ + hypre_ParCSRMatrix *AT = NULL; + hypre_ParCSRMatrix *A_FFT = NULL; + hypre_ParCSRMatrix *A_FCT = NULL; + hypre_ParCSRMatrix *ST = NULL; + +#if defined (HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(A) ); +#endif + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("Restrict"); + + /* Build AT (transpose A) */ + if (restrict_type > 0 && restrict_type != 14) + { + hypre_ParCSRMatrixTranspose(A, &AT, 1); + + if (A_FF) + { + hypre_ParCSRMatrixTranspose(A_FF, &A_FFT, 1); + } + + if (A_FC) + { + hypre_ParCSRMatrixTranspose(A_FC, &A_FCT, 1); + } + } + + /* Restriction for each level */ + if (restrict_type == 0) + { +#if defined (HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_MGRBuildPDevice(A, CF_marker_data, num_cpts_global, restrict_type, &RT); + } + else +#endif + { + hypre_MGRBuildP(A, CF_marker_data, num_cpts_global, restrict_type, 0, &RT); + } + } + else if (restrict_type == 1 || restrict_type == 2) + { +#if defined (HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_MGRBuildPDevice(AT, CF_marker_data, num_cpts_global, restrict_type, &RT); + } + else +#endif + { + hypre_MGRBuildP(AT, CF_marker_data, num_cpts_global, restrict_type, 0, &RT); + } + } + else if (restrict_type == 3) + { + /* move diagonal to first entry */ + hypre_CSRMatrixReorder(hypre_ParCSRMatrixDiag(AT)); + hypre_MGRBuildInterpApproximateInverse(AT, CF_marker_data, num_cpts_global, &RT); + hypre_BoomerAMGInterpTruncation(RT, trunc_factor, max_elmts); + } + else if (restrict_type == 4 || restrict_type == 5) + { + /* Approximate Ideal Restriction (AIR) */ + HYPRE_Real filter_thresholdR = 0.0; + HYPRE_Int gmres_switch = 64; + HYPRE_Int is_triangular = 0; + HYPRE_Int *dofunc_buff_data = NULL; + HYPRE_Int air15_flag = 1; + HYPRE_Int debug = 0; + + hypre_BoomerAMGCreateSabs(A, strong_threshold, 1.0, 1, NULL, &ST); + + if (restrict_type == 4) + { + /* distance-1 AIR */ + hypre_BoomerAMGBuildRestrAIR(A, CF_marker_data, ST, num_cpts_global, 1, + dofunc_buff_data, filter_thresholdR, debug, &R, + is_triangular, gmres_switch); + } + else + { + /* distance-1.5 AIR - distance 2 locally and distance 1 across procs. */ + hypre_BoomerAMGBuildRestrDist2AIR(A, CF_marker_data, ST, num_cpts_global, 1, + dofunc_buff_data, filter_thresholdR, debug, &R, + air15_flag, is_triangular, gmres_switch); + } + } + else if (restrict_type == 12) + { + hypre_MGRBuildBlockJacobiP(AT, A_FFT, A_FCT, NULL, blk_size, CF_marker_data, &RT); + } + else if (restrict_type == 13) // CPR-like restriction operator + { + /* TODO: create a function with this block (VPM) */ + hypre_ParCSRMatrix *A_CF_blk = NULL; + hypre_ParCSRMatrix *A_CFT_blk = NULL; + hypre_ParCSRMatrix *WrT = NULL; + hypre_ParCSRMatrix *A_FF_blkinv = NULL; + +#if defined (HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "No GPU support!"); + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; + } + else +#endif + { + /* Get block A_CF */ + hypre_MGRTruncateAcfCPR(A_CF, &A_CF_blk); + + /* Transpose block A_CF */ + hypre_ParCSRMatrixTranspose(A_CF_blk, &A_CFT_blk, 1); + + /* Compute block diagonal A_FF */ + hypre_ParCSRMatrixBlockDiagMatrix(AT, blk_size, -1, CF_marker_data, 1, + &A_FF_blkinv); + + /* Compute WrT = -A_FF_blk^{-T} * A_CF^{T} */ + WrT = hypre_ParCSRMatMat(A_FF_blkinv, A_CFT_blk); + hypre_ParCSRMatrixScale(WrT, -1.0); + + /* compute restriction operator RT = [WrT I] (transposed for use with RAP) */ + hypre_MGRBuildPFromWp(AT, WrT, CF_marker_data, &RT); + } + + /* Free memory */ + hypre_ParCSRMatrixDestroy(A_CF_blk); + hypre_ParCSRMatrixDestroy(A_CFT_blk); + hypre_ParCSRMatrixDestroy(WrT); + hypre_ParCSRMatrixDestroy(A_FF_blkinv); + } + else if (restrict_type == 14) + { + if (blk_size > 1) + { + /* Block column-lumped restriction */ + hypre_MGRBlockColLumpedRestrict(A, A_FF, A_CF, CF_marker, blk_size, &Wr, &R); + } + else + { + /* Column-lumped restriction */ + hypre_MGRColLumpedRestrict(A, A_FF, A_CF, CF_marker, &Wr, &R); + } + } + else + { + /* Build new strength matrix */ + hypre_BoomerAMGCreateS(AT, strong_threshold, max_row_sum, 1, NULL, &ST); + + /* Classical modified interpolation */ + hypre_BoomerAMGBuildInterp(AT, CF_marker_data, ST, num_cpts_global, 1, NULL, 0, + trunc_factor, max_elmts, &RT); + } + + /* Compute R^T so it can be used in the solve phase */ + if (RT) + { + hypre_ParCSRMatrixLocalTranspose(RT); + } + + /* Set output pointers */ + *RT_ptr = RT; + *R_ptr = R; + *Wr_ptr = Wr; + + /* Free memory */ + hypre_ParCSRMatrixDestroy(AT); + hypre_ParCSRMatrixDestroy(A_FFT); + hypre_ParCSRMatrixDestroy(A_FCT); + hypre_ParCSRMatrixDestroy(ST); + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_MGRBuildPFromWp + * + * Build prolongation matrix from the Nf x Nc matrix + * + * TODO (VPM): Move this function to par_interp.c ? + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRBuildPFromWp( hypre_ParCSRMatrix *A, + hypre_ParCSRMatrix *Wp, + HYPRE_Int *CF_marker, + hypre_ParCSRMatrix **P_ptr) +{ + HYPRE_ANNOTATE_FUNC_BEGIN; + +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(A) ); + + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_MGRBuildPFromWpDevice(A, Wp, CF_marker, P_ptr); + } + else +#endif + { + hypre_MGRBuildPFromWpHost(A, Wp, CF_marker, P_ptr); + } + + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_MGRBuildPFromWpHost + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRBuildPFromWpHost( hypre_ParCSRMatrix *A, + hypre_ParCSRMatrix *Wp, + HYPRE_Int *CF_marker, + hypre_ParCSRMatrix **P_ptr) +{ + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + HYPRE_MemoryLocation memory_location_P = hypre_ParCSRMatrixMemoryLocation(A); + hypre_ParCSRMatrix *P; + + hypre_CSRMatrix *P_diag = NULL; + hypre_CSRMatrix *P_offd = NULL; + hypre_CSRMatrix *Wp_diag, *Wp_offd; + + HYPRE_Real *P_diag_data, *Wp_diag_data; + HYPRE_Int *P_diag_i, *Wp_diag_i; + HYPRE_Int *P_diag_j, *Wp_diag_j; + HYPRE_Real *P_offd_data, *Wp_offd_data; + HYPRE_Int *P_offd_i, *Wp_offd_i; + HYPRE_Int *P_offd_j, *Wp_offd_j; + + HYPRE_Int P_num_rows, P_diag_size, P_offd_size; + HYPRE_Int jj_counter, jj_counter_offd; + HYPRE_Int start_indexing = 0; /* start indexing for P_data at 0 */ + + HYPRE_Int i, jj; + HYPRE_Int row_Wp, coarse_counter; + HYPRE_Real one = 1.0; + HYPRE_Int my_id; + HYPRE_Int num_procs; + + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); + //num_threads = hypre_NumThreads(); + // Temporary fix, disable threading + // TODO: enable threading + P_num_rows = hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(A)); + + Wp_diag = hypre_ParCSRMatrixDiag(Wp); + Wp_offd = hypre_ParCSRMatrixOffd(Wp); + Wp_diag_i = hypre_CSRMatrixI(Wp_diag); + Wp_diag_j = hypre_CSRMatrixJ(Wp_diag); + Wp_diag_data = hypre_CSRMatrixData(Wp_diag); + Wp_offd_i = hypre_CSRMatrixI(Wp_offd); + Wp_offd_j = hypre_CSRMatrixJ(Wp_offd); + Wp_offd_data = hypre_CSRMatrixData(Wp_offd); + + /*----------------------------------------------------------------------- + * Intialize counters and allocate mapping vector. + *-----------------------------------------------------------------------*/ + P_diag_size = hypre_CSRMatrixNumNonzeros(Wp_diag) + hypre_CSRMatrixNumCols(Wp_diag); + + P_diag_i = hypre_CTAlloc(HYPRE_Int, P_num_rows + 1, memory_location_P); + P_diag_j = hypre_CTAlloc(HYPRE_Int, P_diag_size, memory_location_P); + P_diag_data = hypre_CTAlloc(HYPRE_Real, P_diag_size, memory_location_P); + P_diag_i[P_num_rows] = P_diag_size; + + P_offd_size = hypre_CSRMatrixNumNonzeros(Wp_offd); + + P_offd_i = hypre_CTAlloc(HYPRE_Int, P_num_rows + 1, memory_location_P); + P_offd_j = hypre_CTAlloc(HYPRE_Int, P_offd_size, memory_location_P); + P_offd_data = hypre_CTAlloc(HYPRE_Real, P_offd_size, memory_location_P); + P_offd_i[P_num_rows] = P_offd_size; + + /*----------------------------------------------------------------------- + * Intialize some stuff. + *-----------------------------------------------------------------------*/ + jj_counter = start_indexing; + jj_counter_offd = start_indexing; + + row_Wp = 0; + coarse_counter = 0; + for (i = 0; i < P_num_rows; i++) + { + /*-------------------------------------------------------------------- + * If i is a c-point, interpolation is the identity. + *--------------------------------------------------------------------*/ + if (CF_marker[i] >= 0) + { + P_diag_i[i] = jj_counter; + P_diag_j[jj_counter] = coarse_counter; + P_diag_data[jj_counter] = one; + coarse_counter++; + jj_counter++; + } + /*-------------------------------------------------------------------- + * If i is an F-point, build interpolation. + *--------------------------------------------------------------------*/ + else + { + /* Diagonal part of P */ + P_diag_i[i] = jj_counter; + for (jj = Wp_diag_i[row_Wp]; jj < Wp_diag_i[row_Wp + 1]; jj++) + { + P_diag_j[jj_counter] = Wp_diag_j[jj]; + P_diag_data[jj_counter] = Wp_diag_data[jj]; + jj_counter++; + } + + /* Off-Diagonal part of P */ + P_offd_i[i] = jj_counter_offd; + if (num_procs > 1) + { + for (jj = Wp_offd_i[row_Wp]; jj < Wp_offd_i[row_Wp + 1]; jj++) + { + P_offd_j[jj_counter_offd] = Wp_offd_j[jj]; + P_offd_data[jj_counter_offd] = Wp_offd_data[jj]; + jj_counter_offd++; + } + } + row_Wp++; + } + P_offd_i[i + 1] = jj_counter_offd; + } + P = hypre_ParCSRMatrixCreate(comm, + hypre_ParCSRMatrixGlobalNumRows(A), + hypre_ParCSRMatrixGlobalNumCols(Wp), + hypre_ParCSRMatrixColStarts(A), + hypre_ParCSRMatrixColStarts(Wp), + hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(Wp)), + P_diag_size, + P_offd_size); + + P_diag = hypre_ParCSRMatrixDiag(P); + hypre_CSRMatrixData(P_diag) = P_diag_data; + hypre_CSRMatrixI(P_diag) = P_diag_i; + hypre_CSRMatrixJ(P_diag) = P_diag_j; + + P_offd = hypre_ParCSRMatrixOffd(P); + hypre_CSRMatrixData(P_offd) = P_offd_data; + hypre_CSRMatrixI(P_offd) = P_offd_i; + hypre_CSRMatrixJ(P_offd) = P_offd_j; + + hypre_ParCSRMatrixColMapOffd(P) = + hypre_TAlloc(HYPRE_BigInt, + hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(Wp)), + memory_location_P); + hypre_TMemcpy(hypre_ParCSRMatrixColMapOffd(P), hypre_ParCSRMatrixColMapOffd(Wp), + HYPRE_BigInt, hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(Wp)), + memory_location_P, memory_location_P); + + hypre_ParCSRMatrixNumNonzeros(P) = hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixDiag(P)) + + hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixOffd(P)); + hypre_ParCSRMatrixDNumNonzeros(P) = (HYPRE_Real) hypre_ParCSRMatrixNumNonzeros(P); + + hypre_MatvecCommPkgCreate(P); + *P_ptr = P; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_MGRBuildBlockJacobiWp + * + * TODO: Move this to hypre_MGRBuildBlockJacobiP? (VPM) + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRBuildBlockJacobiWp( hypre_ParCSRMatrix *A_FF, + hypre_ParCSRMatrix *A_FC, + HYPRE_Int blk_size, + hypre_ParCSRMatrix **Wp_ptr ) +{ + hypre_ParCSRMatrix *A_FF_inv; + hypre_ParCSRMatrix *Wp; + + HYPRE_ANNOTATE_FUNC_BEGIN; + + /* Build A_FF_inv */ + hypre_ParCSRMatrixBlockDiagMatrix(A_FF, blk_size, -1, NULL, 1, &A_FF_inv); + + /* Compute Wp = -A_FF_inv * A_FC */ + Wp = hypre_ParCSRMatMat(A_FF_inv, A_FC); + hypre_ParCSRMatrixScale(Wp, -1.0); + + /* Free memory */ + hypre_ParCSRMatrixDestroy(A_FF_inv); + + /* Set output pointer */ + *Wp_ptr = Wp; + + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_MGRBuildBlockJacobiP + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRBuildBlockJacobiP( hypre_ParCSRMatrix *A, + hypre_ParCSRMatrix *A_FF, + hypre_ParCSRMatrix *A_FC, + hypre_ParCSRMatrix *Wp, + HYPRE_Int blk_size, + HYPRE_Int *CF_marker, + hypre_ParCSRMatrix **P_ptr) +{ + hypre_ParCSRMatrix *Wp_tmp; + + HYPRE_ANNOTATE_FUNC_BEGIN; + + if (Wp == NULL) + { + hypre_MGRBuildBlockJacobiWp(A_FF, A_FC, blk_size, &Wp_tmp); + hypre_MGRBuildPFromWp(A, Wp_tmp, CF_marker, P_ptr); + + hypre_ParCSRMatrixDeviceColMapOffd(Wp_tmp) = NULL; + hypre_ParCSRMatrixColMapOffd(Wp_tmp) = NULL; + + hypre_ParCSRMatrixDestroy(Wp_tmp); + } + else + { + hypre_MGRBuildPFromWp(A, Wp, CF_marker, P_ptr); + } + + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_ExtendWtoPHost + * + * TODO (VPM): merge with hypre_MGRBuildPFromWpHost + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ExtendWtoPHost(HYPRE_Int P_nr_of_rows, + HYPRE_Int *CF_marker, + HYPRE_Int *W_diag_i, + HYPRE_Int *W_diag_j, + HYPRE_Complex *W_diag_data, + HYPRE_Int *P_diag_i, + HYPRE_Int *P_diag_j, + HYPRE_Complex *P_diag_data, + HYPRE_Int *W_offd_i, + HYPRE_Int *P_offd_i) +{ + HYPRE_Int jj_counter, jj_counter_offd; + HYPRE_Int start_indexing = 0; /* start indexing for P_data at 0 */ + HYPRE_Int *fine_to_coarse = NULL; + HYPRE_Int coarse_counter; + + HYPRE_Int i, jj; + HYPRE_Real one = 1.0; + + /*----------------------------------------------------------------------- + * Intialize counters and allocate mapping vector. + *-----------------------------------------------------------------------*/ + + fine_to_coarse = hypre_CTAlloc(HYPRE_Int, P_nr_of_rows, HYPRE_MEMORY_HOST); + + for (i = 0; i < P_nr_of_rows; i++) { fine_to_coarse[i] = -1; } + + /*----------------------------------------------------------------------- + * Loop over fine grid. + *-----------------------------------------------------------------------*/ + + HYPRE_Int row_counter = 0; + coarse_counter = 0; + for (i = 0; i < P_nr_of_rows; i++) + { + /*-------------------------------------------------------------------- + * If i is a C-point, interpolation is the identity. Also set up + * mapping vector. + *--------------------------------------------------------------------*/ + + if (CF_marker[i] > 0) + { + fine_to_coarse[i] = coarse_counter; + coarse_counter++; + } + } + + /*----------------------------------------------------------------------- + * Intialize counters + *-----------------------------------------------------------------------*/ + + jj_counter = start_indexing; + jj_counter_offd = start_indexing; + + row_counter = 0; + for (i = 0; i < P_nr_of_rows; i++) + { + /*-------------------------------------------------------------------- + * If i is a c-point, interpolation is the identity. + *--------------------------------------------------------------------*/ + if (CF_marker[i] >= 0) + { + P_diag_i[i] = jj_counter; + P_diag_j[jj_counter] = fine_to_coarse[i]; + P_diag_data[jj_counter] = one; + jj_counter++; + } + /*-------------------------------------------------------------------- + * If i is an F-point, build interpolation. + *--------------------------------------------------------------------*/ + else + { + /* Diagonal part of P */ + P_diag_i[i] = jj_counter; + for (jj = W_diag_i[row_counter]; jj < W_diag_i[row_counter + 1]; jj++) + { + //P_marker[row_counter] = jj_counter; + P_diag_j[jj_counter] = W_diag_j[jj]; + P_diag_data[jj_counter] = W_diag_data[jj]; + jj_counter++; + } + + /* Off-Diagonal part of P */ + P_offd_i[i] = jj_counter_offd; + jj_counter_offd += W_offd_i[row_counter + 1] - W_offd_i[row_counter]; + + row_counter++; + } + /* update off-diagonal row pointer */ + P_offd_i[i + 1] = jj_counter_offd; + } + P_diag_i[P_nr_of_rows] = jj_counter; + + hypre_TFree(fine_to_coarse, HYPRE_MEMORY_HOST); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_MGRBuildPHost + * + * Interpolation for MGR - Adapted from BoomerAMGBuildInterp + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRBuildPHost( hypre_ParCSRMatrix *A, + hypre_ParCSRMatrix *A_FF, + hypre_ParCSRMatrix *A_FC, + HYPRE_Int *CF_marker, + HYPRE_BigInt *num_cpts_global, + HYPRE_Int method, + hypre_ParCSRMatrix **Wp_ptr, + hypre_ParCSRMatrix **P_ptr) +{ + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + HYPRE_Int num_rows_A = hypre_ParCSRMatrixNumRows(A); + HYPRE_Int num_rows_AFF = hypre_ParCSRMatrixNumRows(A_FF); + HYPRE_Int num_procs, my_id; + + HYPRE_Real zero = 0.0; + HYPRE_Real one = 1.0; + HYPRE_Complex scal = 1.0; + hypre_CSRMatrix *A_FF_diag = hypre_ParCSRMatrixDiag(A_FF); + hypre_CSRMatrix *A_FC_diag = hypre_ParCSRMatrixDiag(A_FC); + hypre_CSRMatrix *A_FF_offd = hypre_ParCSRMatrixOffd(A_FF); + hypre_CSRMatrix *A_FC_offd = hypre_ParCSRMatrixOffd(A_FC); + + hypre_ParVector *D_FF_inv; + hypre_ParCSRMatrix *P, *Wp; + hypre_CSRMatrix *W_diag = NULL, *W_offd = NULL; + hypre_CSRMatrix *P_diag = NULL, *P_offd = NULL; + HYPRE_Int P_diag_nnz; + HYPRE_Int *P_diag_i = NULL, *P_diag_j = NULL, *P_offd_i = NULL; + HYPRE_Complex *P_diag_a = NULL, *diag = NULL, *diag_FF = NULL; + HYPRE_Int i; + HYPRE_Complex dsum; + + HYPRE_MemoryLocation memory_location_P = hypre_ParCSRMatrixMemoryLocation(A); + + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); + + if (method > 0) + { + diag = hypre_CTAlloc(HYPRE_Complex, num_rows_AFF, memory_location_P); + if (method == 1) + { + // L1-Jacobi-type interpolation + diag_FF = hypre_CTAlloc(HYPRE_Complex, num_rows_AFF, memory_location_P); + hypre_CSRMatrixExtractDiagonalHost(hypre_ParCSRMatrixDiag(A_FF), diag, 0); + hypre_CSRMatrixComputeRowSumHost(A_FF_diag, NULL, NULL, diag_FF, 1, 1.0, "set"); + hypre_CSRMatrixComputeRowSumHost(A_FC_diag, NULL, NULL, diag_FF, 1, 1.0, "add"); + hypre_CSRMatrixComputeRowSumHost(A_FF_offd, NULL, NULL, diag_FF, 1, 1.0, "add"); + hypre_CSRMatrixComputeRowSumHost(A_FC_offd, NULL, NULL, diag_FF, 1, 1.0, "add"); + + for (i = 0; i < num_rows_AFF; i++) + { + dsum = diag[i] + scal * (diag_FF[i] - hypre_cabs(diag[i])); + diag[i] = (hypre_cabs(dsum) > zero || hypre_cabs(dsum) < zero) ? + (one / dsum) : one; + } + hypre_TFree(diag_FF, memory_location_P); + } + else if (method == 2) + { + // extract diag inverse + hypre_CSRMatrixExtractDiagonalHost(hypre_ParCSRMatrixDiag(A_FF), diag, 2); + } + + Wp = hypre_ParCSRMatrixClone_v2(A_FC, 1, memory_location_P); + D_FF_inv = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A_FF), + hypre_ParCSRMatrixGlobalNumRows(A_FF), + hypre_ParCSRMatrixRowStarts(A_FC)); + hypre_ParVectorLocalData(D_FF_inv) = diag; + hypre_ParVectorInitialize_v2(D_FF_inv, memory_location_P); + hypre_ParVectorScale(-1.0, D_FF_inv); + hypre_ParCSRMatrixDiagScale(Wp, D_FF_inv, NULL); + hypre_ParVectorDestroy(D_FF_inv); + } + else + { + Wp = hypre_ParCSRMatrixCreate(hypre_ParCSRMatrixComm(A_FF), + hypre_ParCSRMatrixGlobalNumRows(A_FF), + hypre_ParCSRMatrixGlobalNumCols(A_FC), + hypre_ParCSRMatrixRowStarts(A_FC), + hypre_ParCSRMatrixColStarts(A_FC), + 0, 0, 0); + hypre_ParCSRMatrixInitialize_v2(Wp, memory_location_P); + } + + /* Construct P from matrix product W_diag */ + W_diag = hypre_ParCSRMatrixDiag(Wp); + W_offd = hypre_ParCSRMatrixOffd(Wp); + P_diag_nnz = hypre_CSRMatrixNumNonzeros(W_diag) + hypre_CSRMatrixNumCols(W_diag); + P_diag_i = hypre_CTAlloc(HYPRE_Int, num_rows_A + 1, memory_location_P); + P_diag_j = hypre_CTAlloc(HYPRE_Int, P_diag_nnz, memory_location_P); + P_diag_a = hypre_CTAlloc(HYPRE_Complex, P_diag_nnz, memory_location_P); + P_offd_i = hypre_CTAlloc(HYPRE_Int, num_rows_A + 1, memory_location_P); + + /* Extend W data to P data */ + hypre_ExtendWtoPHost(num_rows_A, + CF_marker, + hypre_CSRMatrixI(W_diag), + hypre_CSRMatrixJ(W_diag), + hypre_CSRMatrixData(W_diag), + P_diag_i, + P_diag_j, + P_diag_a, + hypre_CSRMatrixI(W_offd), + P_offd_i); + + /* finalize P */ + P = hypre_ParCSRMatrixCreate(hypre_ParCSRMatrixComm(A), + hypre_ParCSRMatrixGlobalNumRows(A), + hypre_ParCSRMatrixGlobalNumCols(A_FC), + hypre_ParCSRMatrixColStarts(A), + num_cpts_global, + hypre_CSRMatrixNumCols(W_offd), + P_diag_nnz, + hypre_CSRMatrixNumNonzeros(W_offd)); + P_diag = hypre_ParCSRMatrixDiag(P); + P_offd = hypre_ParCSRMatrixOffd(P); + + hypre_CSRMatrixMemoryLocation(P_diag) = memory_location_P; + hypre_CSRMatrixMemoryLocation(P_offd) = memory_location_P; + hypre_CSRMatrixI(P_diag) = P_diag_i; + hypre_CSRMatrixJ(P_diag) = P_diag_j; + hypre_CSRMatrixData(P_diag) = P_diag_a; + hypre_CSRMatrixI(P_offd) = P_offd_i; + hypre_CSRMatrixJ(P_offd) = hypre_TAlloc(HYPRE_Int, + hypre_CSRMatrixNumNonzeros(W_offd), + memory_location_P); + hypre_CSRMatrixData(P_offd) = hypre_TAlloc(HYPRE_Complex, + hypre_CSRMatrixNumNonzeros(W_offd), + memory_location_P); + hypre_ParCSRMatrixColMapOffd(P) = hypre_TAlloc(HYPRE_BigInt, + hypre_CSRMatrixNumCols(W_offd), + memory_location_P); + + hypre_TMemcpy(hypre_CSRMatrixJ(P_offd), hypre_CSRMatrixJ(W_offd), + HYPRE_Int, hypre_CSRMatrixNumNonzeros(W_offd), + memory_location_P, memory_location_P); + + hypre_TMemcpy(hypre_CSRMatrixData(P_offd), hypre_CSRMatrixData(W_offd), + HYPRE_Complex, hypre_CSRMatrixNumNonzeros(W_offd), + memory_location_P, memory_location_P); + + hypre_TMemcpy(hypre_ParCSRMatrixColMapOffd(P), hypre_ParCSRMatrixColMapOffd(Wp), + HYPRE_BigInt, hypre_CSRMatrixNumCols(W_offd), + memory_location_P, memory_location_P); + + hypre_ParCSRMatrixSetNumNonzeros(P); + hypre_ParCSRMatrixDNumNonzeros(P) = (HYPRE_Real) hypre_ParCSRMatrixNumNonzeros(P); + hypre_MatvecCommPkgCreate(P); + + /* Set output pointer */ + *P_ptr = P; + *Wp_ptr = Wp; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_MGRBuildP + * + * Interpolation for MGR - Adapted from BoomerAMGBuildInterp + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRBuildP( hypre_ParCSRMatrix *A, + HYPRE_Int *CF_marker, + HYPRE_BigInt *num_cpts_global, + HYPRE_Int method, + HYPRE_Int debug_flag, + hypre_ParCSRMatrix **P_ptr) +{ + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); + hypre_ParCSRCommHandle *comm_handle; + HYPRE_MemoryLocation memory_location_P = hypre_ParCSRMatrixMemoryLocation(A); + + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + HYPRE_Real *A_diag_data = hypre_CSRMatrixData(A_diag); + HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); + HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); + + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); + HYPRE_Real *A_offd_data = hypre_CSRMatrixData(A_offd); + HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); + HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); + HYPRE_Int num_cols_A_offd = hypre_CSRMatrixNumCols(A_offd); + HYPRE_Real *a_diag; + + hypre_ParCSRMatrix *P; + HYPRE_BigInt *col_map_offd_P; + HYPRE_Int *tmp_map_offd = NULL; + + HYPRE_Int *CF_marker_offd = NULL; + + hypre_CSRMatrix *P_diag; + hypre_CSRMatrix *P_offd; + + HYPRE_Real *P_diag_data; + HYPRE_Int *P_diag_i; + HYPRE_Int *P_diag_j; + HYPRE_Real *P_offd_data; + HYPRE_Int *P_offd_i; + HYPRE_Int *P_offd_j; + + HYPRE_Int P_diag_size, P_offd_size; + + HYPRE_Int *P_marker, *P_marker_offd; + + HYPRE_Int jj_counter, jj_counter_offd; + HYPRE_Int *jj_count, *jj_count_offd; + // HYPRE_Int jj_begin_row,jj_begin_row_offd; + // HYPRE_Int jj_end_row,jj_end_row_offd; + + HYPRE_Int start_indexing = 0; /* start indexing for P_data at 0 */ + + HYPRE_Int n_fine = hypre_CSRMatrixNumRows(A_diag); + + HYPRE_Int *fine_to_coarse; + //HYPRE_BigInt *fine_to_coarse_offd; + HYPRE_Int *coarse_counter; + HYPRE_Int coarse_shift; + HYPRE_BigInt total_global_cpts; + //HYPRE_BigInt my_first_cpt; + HYPRE_Int num_cols_P_offd; + + HYPRE_Int i, i1; + HYPRE_Int j, jl, jj; + HYPRE_Int start; + + HYPRE_Real one = 1.0; + + HYPRE_Int my_id; + HYPRE_Int num_procs; + HYPRE_Int num_threads; + HYPRE_Int num_sends; + HYPRE_Int index; + HYPRE_Int ns, ne, size, rest; + + HYPRE_Int *int_buf_data; + + HYPRE_Real wall_time; /* for debugging instrumentation */ + + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); + //num_threads = hypre_NumThreads(); + // Temporary fix, disable threading + // TODO: enable threading + num_threads = 1; + + //my_first_cpt = num_cpts_global[0]; + if (my_id == (num_procs - 1)) { total_global_cpts = num_cpts_global[1]; } + hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); + + /*------------------------------------------------------------------- + * Get the CF_marker data for the off-processor columns + *-------------------------------------------------------------------*/ + + if (debug_flag < 0) + { + debug_flag = -debug_flag; + } + + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } + + CF_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); + + if (!comm_pkg) + { + hypre_MatvecCommPkgCreate(A); + comm_pkg = hypre_ParCSRMatrixCommPkg(A); + } + + num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); + int_buf_data = hypre_CTAlloc(HYPRE_Int, + hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); + + index = 0; + for (i = 0; i < num_sends; i++) + { + start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) + { + int_buf_data[index++] = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; + } + } + + comm_handle = hypre_ParCSRCommHandleCreate( 11, comm_pkg, int_buf_data, CF_marker_offd); + hypre_ParCSRCommHandleDestroy(comm_handle); + + if (debug_flag == 4) + { + wall_time = time_getWallclockSeconds() - wall_time; + hypre_printf("Proc = %d Interp: Comm 1 CF_marker = %f\n", + my_id, wall_time); + fflush(NULL); + } + + /*----------------------------------------------------------------------- + * First Pass: Determine size of P and fill in fine_to_coarse mapping. + *-----------------------------------------------------------------------*/ + + /*----------------------------------------------------------------------- + * Intialize counters and allocate mapping vector. + *-----------------------------------------------------------------------*/ + + coarse_counter = hypre_CTAlloc(HYPRE_Int, num_threads, HYPRE_MEMORY_HOST); + jj_count = hypre_CTAlloc(HYPRE_Int, num_threads, HYPRE_MEMORY_HOST); + jj_count_offd = hypre_CTAlloc(HYPRE_Int, num_threads, HYPRE_MEMORY_HOST); + + fine_to_coarse = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); +#if 0 +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif +#endif + for (i = 0; i < n_fine; i++) { fine_to_coarse[i] = -1; } + + jj_counter = start_indexing; + jj_counter_offd = start_indexing; + + /*----------------------------------------------------------------------- + * Loop over fine grid. + *-----------------------------------------------------------------------*/ + + /* RDF: this looks a little tricky, but doable */ +#if 0 +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i,j,i1,jj,ns,ne,size,rest) HYPRE_SMP_SCHEDULE +#endif +#endif + for (j = 0; j < num_threads; j++) + { + size = n_fine / num_threads; + rest = n_fine - size * num_threads; + + if (j < rest) + { + ns = j * size + j; + ne = (j + 1) * size + j + 1; + } + else + { + ns = j * size + rest; + ne = (j + 1) * size + rest; + } + for (i = ns; i < ne; i++) + { + /*-------------------------------------------------------------------- + * If i is a C-point, interpolation is the identity. Also set up + * mapping vector. + *--------------------------------------------------------------------*/ + + if (CF_marker[i] >= 0) + { + jj_count[j]++; + fine_to_coarse[i] = coarse_counter[j]; + coarse_counter[j]++; + } + /*-------------------------------------------------------------------- + * If i is an F-point, interpolation is the approximation of A_{ff}^{-1}A_{fc} + *--------------------------------------------------------------------*/ + else + { + for (jj = A_diag_i[i]; jj < A_diag_i[i + 1]; jj++) + { + i1 = A_diag_j[jj]; + if ((CF_marker[i1] >= 0) && (method > 0)) + { + jj_count[j]++; + } + } + + if (num_procs > 1) + { + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) + { + i1 = A_offd_j[jj]; + if ((CF_marker_offd[i1] >= 0) && (method > 0)) + { + jj_count_offd[j]++; + } + } + } + } + } + } + + /*----------------------------------------------------------------------- + * Allocate arrays. + *-----------------------------------------------------------------------*/ + for (i = 0; i < num_threads - 1; i++) + { + coarse_counter[i + 1] += coarse_counter[i]; + jj_count[i + 1] += jj_count[i]; + jj_count_offd[i + 1] += jj_count_offd[i]; + } + i = num_threads - 1; + jj_counter = jj_count[i]; + jj_counter_offd = jj_count_offd[i]; + + P_diag_size = jj_counter; + + P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, memory_location_P); + P_diag_j = hypre_CTAlloc(HYPRE_Int, P_diag_size, memory_location_P); + P_diag_data = hypre_CTAlloc(HYPRE_Real, P_diag_size, memory_location_P); + + P_diag_i[n_fine] = jj_counter; + + P_offd_size = jj_counter_offd; + + P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, memory_location_P); + P_offd_j = hypre_CTAlloc(HYPRE_Int, P_offd_size, memory_location_P); + P_offd_data = hypre_CTAlloc(HYPRE_Real, P_offd_size, memory_location_P); + + /*----------------------------------------------------------------------- + * Intialize some stuff. + *-----------------------------------------------------------------------*/ + + jj_counter = start_indexing; + jj_counter_offd = start_indexing; + + if (debug_flag == 4) + { + wall_time = time_getWallclockSeconds() - wall_time; + hypre_printf("Proc = %d Interp: Internal work 1 = %f\n", + my_id, wall_time); + fflush(NULL); + } + + /*----------------------------------------------------------------------- + * Send and receive fine_to_coarse info. + *-----------------------------------------------------------------------*/ + + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } + + //fine_to_coarse_offd = hypre_CTAlloc(HYPRE_BigInt, num_cols_A_offd, HYPRE_MEMORY_HOST); + +#if 0 +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i,j,ns,ne,size,rest,coarse_shift) HYPRE_SMP_SCHEDULE +#endif +#endif + for (j = 0; j < num_threads; j++) + { + coarse_shift = 0; + if (j > 0) { coarse_shift = coarse_counter[j - 1]; } + size = n_fine / num_threads; + rest = n_fine - size * num_threads; + if (j < rest) + { + ns = j * size + j; + ne = (j + 1) * size + j + 1; + } + else + { + ns = j * size + rest; + ne = (j + 1) * size + rest; + } + for (i = ns; i < ne; i++) + { + fine_to_coarse[i] += coarse_shift; + } + } + + /* index = 0; + for (i = 0; i < num_sends; i++) + { + start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + big_buf_data[index++] + = fine_to_coarse[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]+ my_first_cpt; + } + + comm_handle = hypre_ParCSRCommHandleCreate( 21, comm_pkg, big_buf_data, + fine_to_coarse_offd); + + hypre_ParCSRCommHandleDestroy(comm_handle); + */ + if (debug_flag == 4) + { + wall_time = time_getWallclockSeconds() - wall_time; + hypre_printf("Proc = %d Interp: Comm 4 FineToCoarse = %f\n", + my_id, wall_time); + fflush(NULL); + } + + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } + +#if 0 +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif +#endif + //for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt; + + /*----------------------------------------------------------------------- + * Loop over fine grid points. + *-----------------------------------------------------------------------*/ + a_diag = hypre_CTAlloc(HYPRE_Real, n_fine, HYPRE_MEMORY_HOST); + for (i = 0; i < n_fine; i++) + { + if (CF_marker[i] < 0) + { + for (jj = A_diag_i[i]; jj < A_diag_i[i + 1]; jj++) + { + i1 = A_diag_j[jj]; + if ( i == i1 ) /* diagonal of A only */ + { + a_diag[i] = 1.0 / A_diag_data[jj]; + } + } + } + } + +#if 0 +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i,j,jl,i1,jj,ns,ne,size,rest,P_marker,P_marker_offd,jj_counter,jj_counter_offd,jj_begin_row,jj_end_row,jj_begin_row_offd,jj_end_row_offd) HYPRE_SMP_SCHEDULE +#endif +#endif + for (jl = 0; jl < num_threads; jl++) + { + size = n_fine / num_threads; + rest = n_fine - size * num_threads; + if (jl < rest) + { + ns = jl * size + jl; + ne = (jl + 1) * size + jl + 1; + } + else + { + ns = jl * size + rest; + ne = (jl + 1) * size + rest; + } + jj_counter = 0; + if (jl > 0) { jj_counter = jj_count[jl - 1]; } + jj_counter_offd = 0; + if (jl > 0) { jj_counter_offd = jj_count_offd[jl - 1]; } + P_marker = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); + if (num_cols_A_offd) + { + P_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); + } + else + { + P_marker_offd = NULL; + } + + for (i = 0; i < n_fine; i++) + { + P_marker[i] = -1; + } + for (i = 0; i < num_cols_A_offd; i++) + { + P_marker_offd[i] = -1; + } + for (i = ns; i < ne; i++) + { + /*-------------------------------------------------------------------- + * If i is a c-point, interpolation is the identity. + *--------------------------------------------------------------------*/ + if (CF_marker[i] >= 0) + { + P_diag_i[i] = jj_counter; + P_diag_j[jj_counter] = fine_to_coarse[i]; + P_diag_data[jj_counter] = one; + jj_counter++; + } + /*-------------------------------------------------------------------- + * If i is an F-point, build interpolation. + *--------------------------------------------------------------------*/ + else + { + /* Diagonal part of P */ + P_diag_i[i] = jj_counter; + for (jj = A_diag_i[i]; jj < A_diag_i[i + 1]; jj++) + { + i1 = A_diag_j[jj]; + + /*-------------------------------------------------------------- + * If neighbor i1 is a C-point, set column number in P_diag_j + * and initialize interpolation weight to zero. + *--------------------------------------------------------------*/ + + if ((CF_marker[i1] >= 0) && (method > 0)) + { + P_marker[i1] = jj_counter; + P_diag_j[jj_counter] = fine_to_coarse[i1]; + /* + if(method == 0) + { + P_diag_data[jj_counter] = 0.0; + } + */ + if (method == 1) + { + P_diag_data[jj_counter] = - A_diag_data[jj]; + } + else if (method == 2) + { + P_diag_data[jj_counter] = - A_diag_data[jj] * a_diag[i]; + } + jj_counter++; + } + } + + /* Off-Diagonal part of P */ + P_offd_i[i] = jj_counter_offd; + + if (num_procs > 1) + { + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) + { + i1 = A_offd_j[jj]; + + /*----------------------------------------------------------- + * If neighbor i1 is a C-point, set column number in P_offd_j + * and initialize interpolation weight to zero. + *-----------------------------------------------------------*/ + + if ((CF_marker_offd[i1] >= 0) && (method > 0)) + { + P_marker_offd[i1] = jj_counter_offd; + /*P_offd_j[jj_counter_offd] = fine_to_coarse_offd[i1];*/ + P_offd_j[jj_counter_offd] = i1; + /* + if(method == 0) + { + P_offd_data[jj_counter_offd] = 0.0; + } + */ + if (method == 1) + { + P_offd_data[jj_counter_offd] = - A_offd_data[jj]; + } + else if (method == 2) + { + P_offd_data[jj_counter_offd] = - A_offd_data[jj] * a_diag[i]; + } + jj_counter_offd++; + } + } + } + } + P_offd_i[i + 1] = jj_counter_offd; + } + hypre_TFree(P_marker, HYPRE_MEMORY_HOST); + hypre_TFree(P_marker_offd, HYPRE_MEMORY_HOST); + } + hypre_TFree(a_diag, HYPRE_MEMORY_HOST); + P = hypre_ParCSRMatrixCreate(comm, + hypre_ParCSRMatrixGlobalNumRows(A), + total_global_cpts, + hypre_ParCSRMatrixColStarts(A), + num_cpts_global, + 0, + P_diag_i[n_fine], + P_offd_i[n_fine]); + + P_diag = hypre_ParCSRMatrixDiag(P); + hypre_CSRMatrixData(P_diag) = P_diag_data; + hypre_CSRMatrixI(P_diag) = P_diag_i; + hypre_CSRMatrixJ(P_diag) = P_diag_j; + P_offd = hypre_ParCSRMatrixOffd(P); + hypre_CSRMatrixData(P_offd) = P_offd_data; + hypre_CSRMatrixI(P_offd) = P_offd_i; + hypre_CSRMatrixJ(P_offd) = P_offd_j; + + num_cols_P_offd = 0; + + if (P_offd_size) + { + P_marker = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); +#if 0 +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif +#endif + for (i = 0; i < num_cols_A_offd; i++) + { + P_marker[i] = 0; + } + num_cols_P_offd = 0; + for (i = 0; i < P_offd_size; i++) + { + index = P_offd_j[i]; + if (!P_marker[index]) + { + num_cols_P_offd++; + P_marker[index] = 1; + } + } + + col_map_offd_P = hypre_CTAlloc(HYPRE_BigInt, num_cols_P_offd, HYPRE_MEMORY_HOST); + tmp_map_offd = hypre_CTAlloc(HYPRE_Int, num_cols_P_offd, HYPRE_MEMORY_HOST); + index = 0; + for (i = 0; i < num_cols_P_offd; i++) + { + while (P_marker[index] == 0) { index++; } + tmp_map_offd[i] = index++; + } + +#if 0 +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif +#endif + for (i = 0; i < P_offd_size; i++) + P_offd_j[i] = hypre_BinarySearch(tmp_map_offd, + P_offd_j[i], + num_cols_P_offd); + hypre_TFree(P_marker, HYPRE_MEMORY_HOST); + } + + for (i = 0; i < n_fine; i++) + if (CF_marker[i] == -3) { CF_marker[i] = -1; } + if (num_cols_P_offd) + { + hypre_ParCSRMatrixColMapOffd(P) = col_map_offd_P; + hypre_CSRMatrixNumCols(P_offd) = num_cols_P_offd; + } + hypre_GetCommPkgRTFromCommPkgA(P, A, fine_to_coarse, tmp_map_offd); + + *P_ptr = P; + + hypre_TFree(tmp_map_offd, HYPRE_MEMORY_HOST); + hypre_TFree(CF_marker_offd, HYPRE_MEMORY_HOST); + hypre_TFree(int_buf_data, HYPRE_MEMORY_HOST); + hypre_TFree(fine_to_coarse, HYPRE_MEMORY_HOST); + // hypre_TFree(fine_to_coarse_offd, HYPRE_MEMORY_HOST); + hypre_TFree(coarse_counter, HYPRE_MEMORY_HOST); + hypre_TFree(jj_count, HYPRE_MEMORY_HOST); + hypre_TFree(jj_count_offd, HYPRE_MEMORY_HOST); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_MGRBuildPDRS + * + * Interpolation for MGR - Dynamic Row Sum method + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRBuildPDRS( hypre_ParCSRMatrix *A, + HYPRE_Int *CF_marker, + HYPRE_BigInt *num_cpts_global, + HYPRE_Int debug_flag, + hypre_ParCSRMatrix **P_ptr) +{ + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); + hypre_ParCSRCommHandle *comm_handle; + + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + HYPRE_Real *A_diag_data = hypre_CSRMatrixData(A_diag); + HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); + HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); + + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); + HYPRE_Real *A_offd_data = hypre_CSRMatrixData(A_offd); + HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); + HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); + HYPRE_Int num_cols_A_offd = hypre_CSRMatrixNumCols(A_offd); + HYPRE_Real *a_diag; + + hypre_ParCSRMatrix *P; + HYPRE_BigInt *col_map_offd_P; + HYPRE_Int *tmp_map_offd = NULL; + HYPRE_Int *CF_marker_offd = NULL; + + hypre_CSRMatrix *P_diag; + hypre_CSRMatrix *P_offd; + + HYPRE_Real *P_diag_data; + HYPRE_Int *P_diag_i, *P_diag_j; + HYPRE_Real *P_offd_data; + HYPRE_Int *P_offd_i, *P_offd_j; + + HYPRE_Int P_diag_size, P_offd_size; + HYPRE_Int *P_marker, *P_marker_offd; + HYPRE_Int jj_counter, jj_counter_offd; + HYPRE_Int *jj_count, *jj_count_offd; + + HYPRE_Int start_indexing = 0; /* start indexing for P_data at 0 */ + HYPRE_Int n_fine = hypre_CSRMatrixNumRows(A_diag); + + HYPRE_Int *fine_to_coarse; + HYPRE_Int *coarse_counter; + HYPRE_Int coarse_shift; + HYPRE_BigInt total_global_cpts; + HYPRE_Int num_cols_P_offd; + + HYPRE_Int i, i1; + HYPRE_Int j, jl, jj; + HYPRE_Int start; + HYPRE_Real one = 1.0; + HYPRE_Int my_id, num_procs; + HYPRE_Int num_threads; + HYPRE_Int num_sends; + HYPRE_Int index; + HYPRE_Int ns, ne, size, rest; + + HYPRE_Int *int_buf_data; + HYPRE_Real wall_time; /* for debugging instrumentation */ + + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); + //num_threads = hypre_NumThreads(); + // Temporary fix, disable threading + // TODO: enable threading + num_threads = 1; + + //my_first_cpt = num_cpts_global[0]; + if (my_id == (num_procs - 1)) { total_global_cpts = num_cpts_global[1]; } + hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); + + /*------------------------------------------------------------------- + * Get the CF_marker data for the off-processor columns + *-------------------------------------------------------------------*/ + + if (debug_flag < 0) + { + debug_flag = -debug_flag; + } + + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } + + CF_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); + + if (!comm_pkg) + { + hypre_MatvecCommPkgCreate(A); + comm_pkg = hypre_ParCSRMatrixCommPkg(A); + } + + num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); + int_buf_data = hypre_CTAlloc(HYPRE_Int, + hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); + + index = 0; + for (i = 0; i < num_sends; i++) + { + start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) + { + int_buf_data[index++] = + CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; + } + } + + comm_handle = hypre_ParCSRCommHandleCreate(11, comm_pkg, int_buf_data, CF_marker_offd); + hypre_ParCSRCommHandleDestroy(comm_handle); + + if (debug_flag == 4) + { + wall_time = time_getWallclockSeconds() - wall_time; + hypre_printf("Proc = %d Interp: Comm 1 CF_marker = %f\n", + my_id, wall_time); + fflush(NULL); + } + + /*----------------------------------------------------------------------- + * First Pass: Determine size of P and fill in fine_to_coarse mapping. + *-----------------------------------------------------------------------*/ + + /*----------------------------------------------------------------------- + * Intialize counters and allocate mapping vector. + *-----------------------------------------------------------------------*/ + + coarse_counter = hypre_CTAlloc(HYPRE_Int, num_threads, HYPRE_MEMORY_HOST); + jj_count = hypre_CTAlloc(HYPRE_Int, num_threads, HYPRE_MEMORY_HOST); + jj_count_offd = hypre_CTAlloc(HYPRE_Int, num_threads, HYPRE_MEMORY_HOST); + + fine_to_coarse = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); +#if 0 +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif +#endif + for (i = 0; i < n_fine; i++) { fine_to_coarse[i] = -1; } + + jj_counter = start_indexing; + jj_counter_offd = start_indexing; + + /*----------------------------------------------------------------------- + * Loop over fine grid. + *-----------------------------------------------------------------------*/ + + /* RDF: this looks a little tricky, but doable */ +#if 0 +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i,j,i1,jj,ns,ne,size,rest) HYPRE_SMP_SCHEDULE +#endif +#endif + for (j = 0; j < num_threads; j++) + { + size = n_fine / num_threads; + rest = n_fine - size * num_threads; + + if (j < rest) + { + ns = j * size + j; + ne = (j + 1) * size + j + 1; + } + else + { + ns = j * size + rest; + ne = (j + 1) * size + rest; + } + for (i = ns; i < ne; i++) + { + /*-------------------------------------------------------------------- + * If i is a C-point, interpolation is the identity. Also set up + * mapping vector. + *--------------------------------------------------------------------*/ + + if (CF_marker[i] >= 0) + { + jj_count[j]++; + fine_to_coarse[i] = coarse_counter[j]; + coarse_counter[j]++; + } + /*-------------------------------------------------------------------- + * If i is an F-point, interpolation is the approximation of A_{ff}^{-1}A_{fc} + *--------------------------------------------------------------------*/ + else + { + for (jj = A_diag_i[i]; jj < A_diag_i[i + 1]; jj++) + { + i1 = A_diag_j[jj]; + if (CF_marker[i1] >= 0) + { + jj_count[j]++; + } + } + + if (num_procs > 1) + { + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) + { + i1 = A_offd_j[jj]; + if (CF_marker_offd[i1] >= 0) + { + jj_count_offd[j]++; + } + } + } + } + /*-------------------------------------------------------------------- + * Set up the indexes for the DRS method + *--------------------------------------------------------------------*/ + + } + } + + /*----------------------------------------------------------------------- + * Allocate arrays. + *-----------------------------------------------------------------------*/ + for (i = 0; i < num_threads - 1; i++) + { + coarse_counter[i + 1] += coarse_counter[i]; + jj_count[i + 1] += jj_count[i]; + jj_count_offd[i + 1] += jj_count_offd[i]; + } + i = num_threads - 1; + jj_counter = jj_count[i]; + jj_counter_offd = jj_count_offd[i]; + + P_diag_size = jj_counter; + + P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, HYPRE_MEMORY_HOST); + P_diag_j = hypre_CTAlloc(HYPRE_Int, P_diag_size, HYPRE_MEMORY_HOST); + P_diag_data = hypre_CTAlloc(HYPRE_Real, P_diag_size, HYPRE_MEMORY_HOST); + + P_diag_i[n_fine] = jj_counter; + + + P_offd_size = jj_counter_offd; + + P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, HYPRE_MEMORY_HOST); + P_offd_j = hypre_CTAlloc(HYPRE_Int, P_offd_size, HYPRE_MEMORY_HOST); + P_offd_data = hypre_CTAlloc(HYPRE_Real, P_offd_size, HYPRE_MEMORY_HOST); + + /*----------------------------------------------------------------------- + * Intialize some stuff. + *-----------------------------------------------------------------------*/ + + jj_counter = start_indexing; + jj_counter_offd = start_indexing; + + if (debug_flag == 4) + { + wall_time = time_getWallclockSeconds() - wall_time; + hypre_printf("Proc = %d Interp: Internal work 1 = %f\n", + my_id, wall_time); + fflush(NULL); + } + + /*----------------------------------------------------------------------- + * Send and receive fine_to_coarse info. + *-----------------------------------------------------------------------*/ + + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } + +#if 0 +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i,j,ns,ne,size,rest,coarse_shift) HYPRE_SMP_SCHEDULE +#endif +#endif + for (j = 0; j < num_threads; j++) + { + coarse_shift = 0; + if (j > 0) { coarse_shift = coarse_counter[j - 1]; } + size = n_fine / num_threads; + rest = n_fine - size * num_threads; + if (j < rest) + { + ns = j * size + j; + ne = (j + 1) * size + j + 1; + } + else + { + ns = j * size + rest; + ne = (j + 1) * size + rest; + } + for (i = ns; i < ne; i++) + { + fine_to_coarse[i] += coarse_shift; + } + } + + /*index = 0; + for (i = 0; i < num_sends; i++) + { + start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + int_buf_data[index++] + = fine_to_coarse[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + } + + comm_handle = hypre_ParCSRCommHandleCreate( 11, comm_pkg, int_buf_data, + fine_to_coarse_offd); + + hypre_ParCSRCommHandleDestroy(comm_handle); + */ + if (debug_flag == 4) + { + wall_time = time_getWallclockSeconds() - wall_time; + hypre_printf("Proc = %d Interp: Comm 4 FineToCoarse = %f\n", + my_id, wall_time); + fflush(NULL); + } + + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } + +#if 0 +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif +#endif + + //for (i = 0; i < n_fine; i++) fine_to_coarse[i] -= my_first_cpt; + + /*----------------------------------------------------------------------- + * Loop over fine grid points. + *-----------------------------------------------------------------------*/ + a_diag = hypre_CTAlloc(HYPRE_Real, n_fine, HYPRE_MEMORY_HOST); + for (i = 0; i < n_fine; i++) + { + for (jj = A_diag_i[i]; jj < A_diag_i[i + 1]; jj++) + { + i1 = A_diag_j[jj]; + if ( i == i1 ) /* diagonal of A only */ + { + a_diag[i] = 1.0 / A_diag_data[jj]; + } + } + } + +#if 0 +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i,j,jl,i1,jj,ns,ne,size,rest,P_marker,P_marker_offd,jj_counter,jj_counter_offd,jj_begin_row,jj_end_row,jj_begin_row_offd,jj_end_row_offd) HYPRE_SMP_SCHEDULE +#endif +#endif + for (jl = 0; jl < num_threads; jl++) + { + size = n_fine / num_threads; + rest = n_fine - size * num_threads; + if (jl < rest) + { + ns = jl * size + jl; + ne = (jl + 1) * size + jl + 1; + } + else + { + ns = jl * size + rest; + ne = (jl + 1) * size + rest; + } + jj_counter = 0; + if (jl > 0) { jj_counter = jj_count[jl - 1]; } + jj_counter_offd = 0; + if (jl > 0) { jj_counter_offd = jj_count_offd[jl - 1]; } + P_marker = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); + if (num_cols_A_offd) + { + P_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); + } + else + { + P_marker_offd = NULL; + } + + for (i = 0; i < n_fine; i++) + { + P_marker[i] = -1; + } + for (i = 0; i < num_cols_A_offd; i++) + { + P_marker_offd[i] = -1; + } + for (i = ns; i < ne; i++) + { + /*-------------------------------------------------------------------- + * If i is a c-point, interpolation is the identity. + *--------------------------------------------------------------------*/ + if (CF_marker[i] >= 0) + { + P_diag_i[i] = jj_counter; + P_diag_j[jj_counter] = fine_to_coarse[i]; + P_diag_data[jj_counter] = one; + jj_counter++; + } + /*-------------------------------------------------------------------- + * If i is an F-point, build interpolation. + *--------------------------------------------------------------------*/ + else + { + /* Diagonal part of P */ + P_diag_i[i] = jj_counter; + for (jj = A_diag_i[i]; jj < A_diag_i[i + 1]; jj++) + { + i1 = A_diag_j[jj]; + + /*-------------------------------------------------------------- + * If neighbor i1 is a C-point, set column number in P_diag_j + * and initialize interpolation weight to zero. + *--------------------------------------------------------------*/ + + if (CF_marker[i1] >= 0) + { + P_marker[i1] = jj_counter; + P_diag_j[jj_counter] = fine_to_coarse[i1]; + P_diag_data[jj_counter] = - A_diag_data[jj] * a_diag[i]; + + jj_counter++; + } + } + + /* Off-Diagonal part of P */ + P_offd_i[i] = jj_counter_offd; + + if (num_procs > 1) + { + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) + { + i1 = A_offd_j[jj]; + + /*----------------------------------------------------------- + * If neighbor i1 is a C-point, set column number in P_offd_j + * and initialize interpolation weight to zero. + *-----------------------------------------------------------*/ + + if (CF_marker_offd[i1] >= 0) + { + P_marker_offd[i1] = jj_counter_offd; + P_offd_j[jj_counter_offd] = i1; + P_offd_data[jj_counter_offd] = - A_offd_data[jj] * a_diag[i]; + + jj_counter_offd++; + } + } + } + } + P_offd_i[i + 1] = jj_counter_offd; + } + hypre_TFree(P_marker, HYPRE_MEMORY_HOST); + hypre_TFree(P_marker_offd, HYPRE_MEMORY_HOST); + } + hypre_TFree(a_diag, HYPRE_MEMORY_HOST); + P = hypre_ParCSRMatrixCreate(comm, + hypre_ParCSRMatrixGlobalNumRows(A), + total_global_cpts, + hypre_ParCSRMatrixColStarts(A), + num_cpts_global, + 0, + P_diag_i[n_fine], + P_offd_i[n_fine]); + + P_diag = hypre_ParCSRMatrixDiag(P); + hypre_CSRMatrixData(P_diag) = P_diag_data; + hypre_CSRMatrixI(P_diag) = P_diag_i; + hypre_CSRMatrixJ(P_diag) = P_diag_j; + P_offd = hypre_ParCSRMatrixOffd(P); + hypre_CSRMatrixData(P_offd) = P_offd_data; + hypre_CSRMatrixI(P_offd) = P_offd_i; + hypre_CSRMatrixJ(P_offd) = P_offd_j; + + num_cols_P_offd = 0; + + if (P_offd_size) + { + P_marker = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); + +#if 0 +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif +#endif + for (i = 0; i < num_cols_A_offd; i++) + { + P_marker[i] = 0; + } + num_cols_P_offd = 0; + for (i = 0; i < P_offd_size; i++) + { + index = P_offd_j[i]; + if (!P_marker[index]) + { + num_cols_P_offd++; + P_marker[index] = 1; + } + } + + tmp_map_offd = hypre_CTAlloc(HYPRE_Int, num_cols_P_offd, HYPRE_MEMORY_HOST); + col_map_offd_P = hypre_CTAlloc(HYPRE_BigInt, num_cols_P_offd, HYPRE_MEMORY_HOST); + index = 0; + for (i = 0; i < num_cols_P_offd; i++) + { + while (P_marker[index] == 0) { index++; } + tmp_map_offd[i] = index++; + } + +#if 0 +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif +#endif + for (i = 0; i < P_offd_size; i++) + { + P_offd_j[i] = hypre_BinarySearch(tmp_map_offd, + P_offd_j[i], + num_cols_P_offd); + } + hypre_TFree(P_marker, HYPRE_MEMORY_HOST); + } + + for (i = 0; i < n_fine; i++) + { + if (CF_marker[i] == -3) + { + CF_marker[i] = -1; + } + } + if (num_cols_P_offd) + { + hypre_ParCSRMatrixColMapOffd(P) = col_map_offd_P; + hypre_CSRMatrixNumCols(P_offd) = num_cols_P_offd; + } + hypre_GetCommPkgRTFromCommPkgA(P, A, fine_to_coarse, tmp_map_offd); + + *P_ptr = P; + + hypre_TFree(tmp_map_offd, HYPRE_MEMORY_HOST); + hypre_TFree(CF_marker_offd, HYPRE_MEMORY_HOST); + hypre_TFree(int_buf_data, HYPRE_MEMORY_HOST); + hypre_TFree(fine_to_coarse, HYPRE_MEMORY_HOST); + hypre_TFree(coarse_counter, HYPRE_MEMORY_HOST); + hypre_TFree(jj_count, HYPRE_MEMORY_HOST); + hypre_TFree(jj_count_offd, HYPRE_MEMORY_HOST); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_MGRBuildInterpApproximateInverse + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRBuildInterpApproximateInverse(hypre_ParCSRMatrix *A, + HYPRE_Int *CF_marker, + HYPRE_BigInt *num_cpts_global, + hypre_ParCSRMatrix **P_ptr) +{ + HYPRE_Int *C_marker; + HYPRE_Int *F_marker; + hypre_ParCSRMatrix *A_ff; + hypre_ParCSRMatrix *A_fc; + hypre_ParCSRMatrix *A_ff_inv; + hypre_ParCSRMatrix *W; + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + hypre_ParCSRMatrix *P; + HYPRE_BigInt *col_map_offd_P = NULL; + HYPRE_Real *P_diag_data; + HYPRE_Int *P_diag_i; + HYPRE_Int *P_diag_j; + HYPRE_Int *P_offd_i; + HYPRE_Int P_diag_nnz; + HYPRE_Int n_fine = hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(A)); + HYPRE_BigInt total_global_cpts; + HYPRE_Int num_cols_P_offd; + + HYPRE_Int i; + + HYPRE_Real m_one = -1.0; + + HYPRE_Int my_id; + HYPRE_Int num_procs; + + HYPRE_MemoryLocation memory_location_P = hypre_ParCSRMatrixMemoryLocation(A); + + C_marker = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); + F_marker = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); + + // create C and F markers + for (i = 0; i < n_fine; i++) + { + C_marker[i] = (CF_marker[i] == 1) ? 1 : -1; + F_marker[i] = (CF_marker[i] == 1) ? -1 : 1; + } + + // Get A_FF + hypre_MGRGetSubBlock(A, F_marker, F_marker, 0, &A_ff); + // hypre_ParCSRMatrixPrintIJ(A_ff, 1, 1, "A_ff"); + // Get A_FC + hypre_MGRGetSubBlock(A, F_marker, C_marker, 0, &A_fc); + + hypre_MGRApproximateInverse(A_ff, &A_ff_inv); + // hypre_ParCSRMatrixPrintIJ(A_ff_inv, 1, 1, "A_ff_inv"); + // hypre_ParCSRMatrixPrintIJ(A_fc, 1, 1, "A_fc"); + W = hypre_ParMatmul(A_ff_inv, A_fc); + hypre_ParCSRMatrixScale(W, m_one); + // hypre_ParCSRMatrixPrintIJ(W, 1, 1, "Wp"); + + hypre_CSRMatrix *W_diag = hypre_ParCSRMatrixDiag(W); + hypre_CSRMatrix *W_offd = hypre_ParCSRMatrixOffd(W); + + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); + + if (my_id == (num_procs - 1)) { total_global_cpts = num_cpts_global[1]; } + hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); + + /*----------------------------------------------------------------------- + * Allocate arrays. + *-----------------------------------------------------------------------*/ + + P_diag_nnz = hypre_CSRMatrixNumNonzeros(W_diag) + hypre_CSRMatrixNumCols(W_diag); + P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, memory_location_P); + P_diag_j = hypre_CTAlloc(HYPRE_Int, P_diag_nnz, memory_location_P); + P_diag_data = hypre_CTAlloc(HYPRE_Real, P_diag_nnz, memory_location_P); + P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, memory_location_P); + + /* Extend W data to P data */ + hypre_ExtendWtoPHost( n_fine, + CF_marker, + hypre_CSRMatrixI(W_diag), + hypre_CSRMatrixJ(W_diag), + hypre_CSRMatrixData(W_diag), + P_diag_i, + P_diag_j, + P_diag_data, + hypre_CSRMatrixI(W_offd), + P_offd_i ); + // final P + P = hypre_ParCSRMatrixCreate(comm, + hypre_ParCSRMatrixGlobalNumRows(A), + total_global_cpts, + hypre_ParCSRMatrixColStarts(A), + num_cpts_global, + hypre_CSRMatrixNumCols(W_offd), + P_diag_nnz, + hypre_CSRMatrixNumNonzeros(W_offd) ); + + hypre_CSRMatrixMemoryLocation(hypre_ParCSRMatrixDiag(P)) = memory_location_P; + hypre_CSRMatrixMemoryLocation(hypre_ParCSRMatrixOffd(P)) = memory_location_P; + + hypre_CSRMatrixI(hypre_ParCSRMatrixDiag(P)) = P_diag_i; + hypre_CSRMatrixJ(hypre_ParCSRMatrixDiag(P)) = P_diag_j; + hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(P)) = P_diag_data; + + hypre_CSRMatrixI(hypre_ParCSRMatrixOffd(P)) = P_offd_i; + hypre_CSRMatrixJ(hypre_ParCSRMatrixOffd(P)) = hypre_CSRMatrixJ(W_offd); + hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(P)) = hypre_CSRMatrixData(W_offd); + hypre_CSRMatrixJ(W_offd) = NULL; + hypre_CSRMatrixData(W_offd) = NULL; + + num_cols_P_offd = hypre_CSRMatrixNumCols(W_offd); + HYPRE_BigInt *col_map_offd_tmp = hypre_ParCSRMatrixColMapOffd(W); + if (hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixOffd(P))) + { + col_map_offd_P = hypre_CTAlloc(HYPRE_BigInt, num_cols_P_offd, HYPRE_MEMORY_HOST); + for (i = 0; i < num_cols_P_offd; i++) + { + col_map_offd_P[i] = col_map_offd_tmp[i]; + } + } + + if (num_cols_P_offd) + { + hypre_ParCSRMatrixColMapOffd(P) = col_map_offd_P; + hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(P)) = num_cols_P_offd; + } + hypre_MatvecCommPkgCreate(P); + + *P_ptr = P; + + hypre_TFree(C_marker, HYPRE_MEMORY_HOST); + hypre_TFree(F_marker, HYPRE_MEMORY_HOST); + hypre_ParCSRMatrixDestroy(A_ff); + hypre_ParCSRMatrixDestroy(A_fc); + hypre_ParCSRMatrixDestroy(A_ff_inv); + hypre_ParCSRMatrixDestroy(W); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_MGRTruncateAcfCPRDevice + * + * TODO (VPM): Port truncation to GPUs + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRTruncateAcfCPRDevice(hypre_ParCSRMatrix *A_CF, + hypre_ParCSRMatrix **A_CF_new_ptr) +{ + hypre_ParCSRMatrix *hA_CF; + hypre_ParCSRMatrix *A_CF_new; + + hypre_GpuProfilingPushRange("MGRTruncateAcfCPR"); + + /* Clone matrix to host, truncate, and migrate result to device */ + hA_CF = hypre_ParCSRMatrixClone_v2(A_CF, 1, HYPRE_MEMORY_HOST); + hypre_MGRTruncateAcfCPR(hA_CF, &A_CF_new); + hypre_ParCSRMatrixMigrate(A_CF_new, HYPRE_MEMORY_DEVICE); + hypre_ParCSRMatrixDestroy(hA_CF); + + /* Set output pointer */ + *A_CF_new_ptr = A_CF_new; + + hypre_GpuProfilingPopRange(); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_MGRTruncateAcfCPR + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRTruncateAcfCPR(hypre_ParCSRMatrix *A_CF, + hypre_ParCSRMatrix **A_CF_new_ptr) +{ + /* Input matrix info */ + MPI_Comm comm = hypre_ParCSRMatrixComm(A_CF); + HYPRE_BigInt num_rows = hypre_ParCSRMatrixGlobalNumRows(A_CF); + HYPRE_BigInt num_cols = hypre_ParCSRMatrixGlobalNumCols(A_CF); + + hypre_CSRMatrix *A_CF_diag = hypre_ParCSRMatrixDiag(A_CF); + HYPRE_Int *A_CF_diag_i = hypre_CSRMatrixI(A_CF_diag); + HYPRE_Int *A_CF_diag_j = hypre_CSRMatrixJ(A_CF_diag); + HYPRE_Complex *A_CF_diag_data = hypre_CSRMatrixData(A_CF_diag); + HYPRE_Int num_rows_local = hypre_CSRMatrixNumRows(A_CF_diag); + + /* Output matrix info */ + hypre_ParCSRMatrix *A_CF_new; + hypre_CSRMatrix *A_CF_diag_new; + HYPRE_Int *A_CF_diag_i_new; + HYPRE_Int *A_CF_diag_j_new; + HYPRE_Complex *A_CF_diag_data_new; + HYPRE_Int nnz_diag_new; + + /* Local variables */ + HYPRE_Int i, j, jj; + HYPRE_Int jj_counter; + HYPRE_Int blk_size = num_cols / num_rows; + + HYPRE_ANNOTATE_FUNC_BEGIN; + + /* First pass: count the nnz of truncated (new) A_CF */ + jj_counter = 0; + for (i = 0; i < num_rows_local; i++) + { + for (j = A_CF_diag_i[i]; j < A_CF_diag_i[i + 1]; j++) + { + jj = A_CF_diag_j[j]; + if (jj >= i * blk_size && jj < (i + 1) * blk_size) + { + jj_counter++; + } + } + } + nnz_diag_new = jj_counter; + + /* Create truncated matrix */ + A_CF_new = hypre_ParCSRMatrixCreate(comm, + num_rows, + num_cols, + hypre_ParCSRMatrixRowStarts(A_CF), + hypre_ParCSRMatrixColStarts(A_CF), + 0, + nnz_diag_new, + 0); + + hypre_ParCSRMatrixInitialize_v2(A_CF_new, HYPRE_MEMORY_HOST); + A_CF_diag_new = hypre_ParCSRMatrixDiag(A_CF_new); + A_CF_diag_i_new = hypre_CSRMatrixI(A_CF_diag_new); + A_CF_diag_j_new = hypre_CSRMatrixJ(A_CF_diag_new); + A_CF_diag_data_new = hypre_CSRMatrixData(A_CF_diag_new); + + /* Second pass: fill entries of the truncated (new) A_CF */ + jj_counter = 0; + for (i = 0; i < num_rows_local; i++) + { + A_CF_diag_i_new[i] = jj_counter; + for (j = A_CF_diag_i[i]; j < A_CF_diag_i[i + 1]; j++) + { + jj = A_CF_diag_j[j]; + if (jj >= i * blk_size && jj < (i + 1) * blk_size) + { + A_CF_diag_j_new[jj_counter] = jj; + A_CF_diag_data_new[jj_counter] = A_CF_diag_data[j]; + jj_counter++; + } + } + } + A_CF_diag_i_new[num_rows_local] = nnz_diag_new; + + /* Set output pointer */ + *A_CF_new_ptr = A_CF_new; + + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_MGRBuildRFromWrHost + * + * Constructs a classical restriction operator as R = [Wr I]. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRBuildRFromWrHost(hypre_IntArray *C_map, + hypre_IntArray *F_map, + hypre_ParCSRMatrix *Wr, + hypre_ParCSRMatrix *R) +{ + /* Input matrix variables */ + hypre_CSRMatrix *Wr_diag = hypre_ParCSRMatrixDiag(Wr); + HYPRE_Int *Wr_diag_i = hypre_CSRMatrixI(Wr_diag); + HYPRE_Int *Wr_diag_j = hypre_CSRMatrixJ(Wr_diag); + HYPRE_Complex *Wr_diag_a = hypre_CSRMatrixData(Wr_diag); + HYPRE_Int Wr_diag_num_rows = hypre_CSRMatrixNumRows(Wr_diag); + HYPRE_Int *C_map_data = hypre_IntArrayData(C_map); + HYPRE_Int *F_map_data = hypre_IntArrayData(F_map); + + /* Output matrix */ + hypre_CSRMatrix *R_diag = hypre_ParCSRMatrixDiag(R); + HYPRE_Int *R_diag_i = hypre_CSRMatrixI(R_diag); + HYPRE_Int *R_diag_j = hypre_CSRMatrixJ(R_diag); + HYPRE_Complex *R_diag_a = hypre_CSRMatrixData(R_diag); + + /* Local variables */ + HYPRE_Int i, j, nnz_diag; + HYPRE_Real one = 1.0; + + R_diag_i[0] = nnz_diag = 0; + for (i = 0; i < Wr_diag_num_rows; i++) + { + /* Set CC connection */ + R_diag_j[nnz_diag] = C_map_data[i]; + R_diag_a[nnz_diag] = one; + nnz_diag++; + + /* Set CF connections */ + for (j = Wr_diag_i[i]; j < Wr_diag_i[i + 1]; j++) + { + R_diag_j[nnz_diag] = F_map_data[Wr_diag_j[j]]; + R_diag_a[nnz_diag] = Wr_diag_a[j]; + nnz_diag++; + } + + /* Update row pointer */ + R_diag_i[i + 1] = nnz_diag; + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_MGRBuildRFromWr + * + * Constructs a classical restriction operator as R = [Wr I]. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRBuildRFromWr(hypre_IntArray *C_map, + hypre_IntArray *F_map, + HYPRE_BigInt global_num_rows_R, + HYPRE_BigInt global_num_cols_R, + HYPRE_BigInt *row_starts_R, + HYPRE_BigInt *col_starts_R, + hypre_ParCSRMatrix *Wr, + hypre_ParCSRMatrix **R_ptr) +{ + /* Input matrix variables */ + MPI_Comm comm = hypre_ParCSRMatrixComm(Wr); + HYPRE_MemoryLocation memory_location_Wr = hypre_ParCSRMatrixMemoryLocation(Wr); + + hypre_CSRMatrix *Wr_diag = hypre_ParCSRMatrixDiag(Wr); + HYPRE_Int Wr_diag_num_rows = hypre_CSRMatrixNumRows(Wr_diag); + HYPRE_Int Wr_diag_nnz = hypre_CSRMatrixNumNonzeros(Wr_diag); + + hypre_CSRMatrix *Wr_offd = hypre_ParCSRMatrixOffd(Wr); + HYPRE_Int Wr_offd_num_cols = hypre_CSRMatrixNumCols(Wr_offd); + HYPRE_Int Wr_offd_nnz = hypre_CSRMatrixNumNonzeros(Wr_offd); + + /* Output matrix */ + hypre_ParCSRMatrix *R; + HYPRE_Int num_nonzeros_diag = Wr_diag_nnz + Wr_diag_num_rows; + HYPRE_Int num_nonzeros_offd = Wr_offd_nnz; + + /* Sanity checks */ + if (Wr_offd_nnz > 0 || Wr_offd_num_cols > 0) + { + *R_ptr = NULL; + + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Not implemented for matrices with nonzero offd"); + return hypre_error_flag; + } + + HYPRE_ANNOTATE_FUNC_BEGIN; + + /*----------------------------------------------------------------------- + * Create and initialize output matrix + *-----------------------------------------------------------------------*/ + + R = hypre_ParCSRMatrixCreate(comm, global_num_rows_R, global_num_cols_R, + row_starts_R, col_starts_R, Wr_offd_num_cols, + num_nonzeros_diag, num_nonzeros_offd); + hypre_ParCSRMatrixInitialize_v2(R, memory_location_Wr); + + /*----------------------------------------------------------------------- + * Fill matrix entries + *-----------------------------------------------------------------------*/ + +#if defined (HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1(memory_location_Wr); + + if (exec == HYPRE_EXEC_DEVICE) + { + /* TODO (VPM): Implement hypre_MGRBuildRFromWrDevice */ + hypre_ParCSRMatrixMigrate(Wr, HYPRE_MEMORY_HOST); + hypre_ParCSRMatrixMigrate(R, HYPRE_MEMORY_HOST); + hypre_IntArrayMigrate(C_map, HYPRE_MEMORY_HOST); + hypre_IntArrayMigrate(F_map, HYPRE_MEMORY_HOST); + hypre_MGRBuildRFromWrHost(C_map, F_map, Wr, R); + hypre_ParCSRMatrixMigrate(Wr, HYPRE_MEMORY_DEVICE); + hypre_ParCSRMatrixMigrate(R, HYPRE_MEMORY_DEVICE); + } + else +#endif + { + hypre_MGRBuildRFromWrHost(C_map, F_map, Wr, R); + } + + /* Setup communication package */ + hypre_MatvecCommPkgCreate(R); + + /* Set output pointer */ + *R_ptr = R; + + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_MGRColLumpedRestrict + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRColLumpedRestrict(hypre_ParCSRMatrix *A, + hypre_ParCSRMatrix *A_FF, + hypre_ParCSRMatrix *A_CF, + hypre_IntArray *CF_marker, + hypre_ParCSRMatrix **Wr_ptr, + hypre_ParCSRMatrix **R_ptr) +{ + hypre_ParVector *b_FF = NULL; + hypre_ParVector *b_CF = NULL; + hypre_ParVector *r_CF = NULL; + hypre_ParCSRMatrix *Wr = NULL; + hypre_ParCSRMatrix *R = NULL; + + HYPRE_Int num_points = 2; + HYPRE_Int points[2] = {1, -1}; // {C, F} + HYPRE_Int sizes[2] = {hypre_ParCSRMatrixNumRows(A_CF), + hypre_ParCSRMatrixNumCols(A_CF) + }; + hypre_IntArrayArray *CF_maps; + + HYPRE_ANNOTATE_FUNC_BEGIN; + + /*------------------------------------------------------- + * 1) b_FF = approx(A_FF) + *-------------------------------------------------------*/ + + hypre_ParCSRMatrixColSum(A_FF, &b_FF); + + /*------------------------------------------------------- + * 2) b_CF = approx(A_CF) + *-------------------------------------------------------*/ + + hypre_ParCSRMatrixColSum(A_CF, &b_CF); + + /*------------------------------------------------------- + * 3) Wr = - approx(A_CF) * inv(approx(A_FF)) + *-------------------------------------------------------*/ + + r_CF = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A_CF), + hypre_ParCSRMatrixGlobalNumRows(A_CF), + hypre_ParCSRMatrixRowStarts(A_CF)); + hypre_ParVectorInitialize_v2(r_CF, hypre_ParCSRMatrixMemoryLocation(A_CF)); + hypre_ParVectorElmdivpy(b_CF, b_FF, r_CF); + hypre_ParVectorScale(-1.0, r_CF); + Wr = hypre_ParCSRMatrixCreateFromParVector(r_CF, + hypre_ParCSRMatrixGlobalNumRows(A_CF), + hypre_ParCSRMatrixGlobalNumCols(A_CF), + hypre_ParCSRMatrixRowStarts(A_CF), + hypre_ParCSRMatrixColStarts(A_CF)); + + /* Free memory */ + hypre_ParVectorDestroy(b_FF); + hypre_ParVectorDestroy(b_CF); + hypre_ParVectorDestroy(r_CF); + + /*------------------------------------------------------- + * 4) Build Restriction + *-------------------------------------------------------*/ + + /* Compute C/F local mappings */ + hypre_IntArraySeparateByValue(num_points, points, sizes, CF_marker, &CF_maps); + + /* Build restriction from Wr (R = [Wr I]) */ + hypre_MGRBuildRFromWr(hypre_IntArrayArrayEntryI(CF_maps, 0), + hypre_IntArrayArrayEntryI(CF_maps, 1), + hypre_ParCSRMatrixGlobalNumRows(A_CF), + hypre_ParCSRMatrixGlobalNumCols(A), + hypre_ParCSRMatrixRowStarts(A_CF), + hypre_ParCSRMatrixColStarts(A), + Wr, &R); + + /* Set output pointers */ + *Wr_ptr = Wr; + *R_ptr = R; + + /* Free memory */ + hypre_IntArrayArrayDestroy(CF_maps); + + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_MGRBlockColLumpedRestrict + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRBlockColLumpedRestrict(hypre_ParCSRMatrix *A, + hypre_ParCSRMatrix *A_FF, + hypre_ParCSRMatrix *A_CF, + hypre_IntArray *CF_marker, + HYPRE_Int block_dim, + hypre_ParCSRMatrix **Wr_ptr, + hypre_ParCSRMatrix **R_ptr) +{ + hypre_DenseBlockMatrix *b_FF = NULL; + hypre_DenseBlockMatrix *b_CF = NULL; + hypre_DenseBlockMatrix *r_CF = NULL; + hypre_ParCSRMatrix *Wr = NULL; + hypre_ParCSRMatrix *R = NULL; + + HYPRE_Int row_major = 0; + HYPRE_Int num_points = 2; + HYPRE_Int points[2] = {1, -1}; // {C, F} + HYPRE_Int sizes[2] = {hypre_ParCSRMatrixNumRows(A_CF), + hypre_ParCSRMatrixNumCols(A_CF) + }; + hypre_IntArrayArray *CF_maps; + + HYPRE_ANNOTATE_FUNC_BEGIN; + + /* Sanity check */ + if (block_dim <= 1) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Invalid block dimension!"); + return hypre_error_flag; + } + + /*------------------------------------------------------- + * 1) b_FF = approx(A_FF) + *-------------------------------------------------------*/ + + hypre_ParCSRMatrixBlockColSum(A_FF, row_major, block_dim, block_dim, &b_FF); + + /*------------------------------------------------------- + * 2) b_CF = approx(A_CF) + *-------------------------------------------------------*/ + + hypre_ParCSRMatrixBlockColSum(A_CF, row_major, 1, block_dim, &b_CF); + + /*------------------------------------------------------- + * 3) b_FF = inv(approx(A_FF)) (invert in-place) + *-------------------------------------------------------*/ + +#if defined (HYPRE_USING_GPU) + if (hypre_GetExecPolicy1(hypre_DenseBlockMatrixMemoryLocation(b_FF)) == HYPRE_EXEC_DEVICE) + { + /* TODO (VPM): GPU version */ + hypre_DenseBlockMatrixMigrate(b_FF, HYPRE_MEMORY_HOST); + hypre_BlockDiagInvLapack(hypre_DenseBlockMatrixData(b_FF), + hypre_DenseBlockMatrixNumRows(b_FF), + hypre_DenseBlockMatrixNumRowsBlock(b_FF)); + hypre_DenseBlockMatrixMigrate(b_FF, HYPRE_MEMORY_DEVICE); + } + else +#endif + { + hypre_BlockDiagInvLapack(hypre_DenseBlockMatrixData(b_FF), + hypre_DenseBlockMatrixNumRows(b_FF), + hypre_DenseBlockMatrixNumRowsBlock(b_FF)); + } + + /*------------------------------------------------------- + * 4) Wr = - approx(A_CF) * inv(approx(A_FF)) + *-------------------------------------------------------*/ + + hypre_DenseBlockMatrixMultiply(b_CF, b_FF, &r_CF); + hypre_DenseBlockMatrixPrint(hypre_ParCSRMatrixComm(A), r_CF, "r_CF"); + Wr = hypre_ParCSRMatrixCreateFromDenseBlockMatrix(hypre_ParCSRMatrixComm(A_CF), + hypre_ParCSRMatrixGlobalNumRows(A_CF), + hypre_ParCSRMatrixGlobalNumCols(A_CF), + hypre_ParCSRMatrixRowStarts(A_CF), + hypre_ParCSRMatrixColStarts(A_CF), + r_CF); + hypre_ParCSRMatrixScale(Wr, -1.0); + + /* Free memory */ + hypre_DenseBlockMatrixDestroy(b_FF); + hypre_DenseBlockMatrixDestroy(b_CF); + hypre_DenseBlockMatrixDestroy(r_CF); + + /*------------------------------------------------------- + * 5) Build Restriction + *-------------------------------------------------------*/ + + /* Compute C/F local mappings */ + hypre_IntArraySeparateByValue(num_points, points, sizes, CF_marker, &CF_maps); + + /* Build restriction from W (R = [Wr I]) */ + hypre_MGRBuildRFromWr(hypre_IntArrayArrayEntryI(CF_maps, 0), + hypre_IntArrayArrayEntryI(CF_maps, 1), + hypre_ParCSRMatrixGlobalNumRows(A_CF), + hypre_ParCSRMatrixGlobalNumCols(A), + hypre_ParCSRMatrixRowStarts(A_CF), + hypre_ParCSRMatrixColStarts(A), + Wr, &R); + + /* Set output pointers */ + *Wr_ptr = Wr; + *R_ptr = R; + + /* Free memory */ + hypre_IntArrayArrayDestroy(CF_maps); + + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} diff --git a/external/hypre/src/parcsr_ls/par_mgr_rap.c b/external/hypre/src/parcsr_ls/par_mgr_rap.c new file mode 100644 index 00000000..c18c61d1 --- /dev/null +++ b/external/hypre/src/parcsr_ls/par_mgr_rap.c @@ -0,0 +1,692 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#include "_hypre_parcsr_ls.h" +#include "par_mgr.h" + +/*-------------------------------------------------------------------------- + * hypre_MGRNonGalerkinTruncate + * + * Applies filtering in-place to the input matrix "A" based on the maximum + * number of nonzero entries per row. This algorithm is tailored to the needs + * of the Non-Galerkin approach in MGR. + * + * - max_elmts == 0: no filtering + * - max_elmts == 1 and blk_dim == 1: keep diagonal entries + * - max_elmts == 1 and blk_dim > 1: keep block diagonal entries + * - max_elmts > 1 and blk_dim == 1: keep diagonal entries and + * (max_elmts - 1) largest ones per row + * - max_elmts > blk_dim and blk_dim > 1: keep block diagonal entries and + * (max_elmts - blk_dim) largest ones + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRNonGalerkinTruncate(hypre_ParCSRMatrix *A, + HYPRE_Int ordering, + HYPRE_Int blk_dim, + HYPRE_Int max_elmts) +{ + HYPRE_MemoryLocation memory_location = hypre_ParCSRMatrixMemoryLocation(A); + HYPRE_Int nrows = hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(A)); + + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + HYPRE_Complex *A_diag_a = hypre_CSRMatrixData(A_diag); + HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); + HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); + HYPRE_Int ncol_diag = hypre_CSRMatrixNumCols(A_diag); + + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); + HYPRE_Complex *A_offd_a = hypre_CSRMatrixData(A_offd); + HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); + HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); + + HYPRE_Int i, i1, jj; + + HYPRE_Int *A_diag_i_new, *A_diag_j_new; + HYPRE_Complex *A_diag_a_new; + HYPRE_Int num_nonzeros_diag_new = 0; + + HYPRE_Int *A_offd_i_new, *A_offd_j_new; + HYPRE_Complex *A_offd_a_new; + HYPRE_Int num_nonzeros_offd_new = 0; + HYPRE_Int num_nonzeros_max = (blk_dim + max_elmts) * nrows; + HYPRE_Int num_nonzeros_offd_max = max_elmts * nrows; + + HYPRE_Int max_num_nonzeros; + HYPRE_Int *aux_j = NULL; + HYPRE_Real *aux_data = NULL; + HYPRE_Int row_start, row_stop, cnt; + HYPRE_Int col_idx; + HYPRE_Real col_value; + + /* Return if max_elmts is zero, i.e., no truncation */ + if (max_elmts == 0) + { + return hypre_error_flag; + } + + /* Allocate new memory */ + if (ordering == 0) + { +#if defined (HYPRE_USING_GPU) + if (hypre_GetExecPolicy1(memory_location) == HYPRE_EXEC_DEVICE) + { + hypre_ParCSRMatrixMigrate(A, HYPRE_MEMORY_HOST); + } +#endif + + A_diag_i_new = hypre_CTAlloc(HYPRE_Int, nrows + 1, HYPRE_MEMORY_HOST); + A_diag_j_new = hypre_CTAlloc(HYPRE_Int, num_nonzeros_max, HYPRE_MEMORY_HOST); + A_diag_a_new = hypre_CTAlloc(HYPRE_Complex, num_nonzeros_max, HYPRE_MEMORY_HOST); + A_offd_i_new = hypre_CTAlloc(HYPRE_Int, nrows + 1, HYPRE_MEMORY_HOST); + A_offd_j_new = hypre_CTAlloc(HYPRE_Int, num_nonzeros_offd_max, HYPRE_MEMORY_HOST); + A_offd_a_new = hypre_CTAlloc(HYPRE_Complex, num_nonzeros_offd_max, HYPRE_MEMORY_HOST); + + if (max_elmts > 0) + { + max_num_nonzeros = 0; + for (i = 0; i < nrows; i++) + { + max_num_nonzeros = hypre_max(max_num_nonzeros, + (A_diag_i[i + 1] - A_diag_i[i]) + + (A_offd_i[i + 1] - A_offd_i[i])); + } + aux_j = hypre_CTAlloc(HYPRE_Int, max_num_nonzeros, HYPRE_MEMORY_HOST); + aux_data = hypre_CTAlloc(HYPRE_Real, max_num_nonzeros, HYPRE_MEMORY_HOST); + } + + for (i = 0; i < nrows; i++) + { + row_start = i - (i % blk_dim); + row_stop = row_start + blk_dim - 1; + + /* Copy (block) diagonal data to new arrays */ + for (jj = A_diag_i[i]; jj < A_diag_i[i + 1]; jj++) + { + i1 = A_diag_j[jj]; + if (i1 >= row_start && i1 <= row_stop) + { + A_diag_j_new[num_nonzeros_diag_new] = i1; + A_diag_a_new[num_nonzeros_diag_new] = A_diag_a[jj]; + ++num_nonzeros_diag_new; + } + } + + /* Add other connections? */ + if (max_elmts > 0) + { + cnt = 0; + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) + { + aux_j[cnt] = A_offd_j[jj] + ncol_diag; + aux_data[cnt] = A_offd_a[jj]; + cnt++; + } + + for (jj = A_diag_i[i]; jj < A_diag_i[i + 1]; jj++) + { + aux_j[cnt] = A_diag_j[jj]; + aux_data[cnt] = A_diag_a[jj]; + cnt++; + } + hypre_qsort2_abs(aux_j, aux_data, 0, cnt - 1); + + for (jj = 0; jj < hypre_min(max_elmts, cnt); jj++) + { + col_idx = aux_j[jj]; + col_value = aux_data[jj]; + if (col_idx < ncol_diag && (col_idx < row_start || col_idx > row_stop)) + { + A_diag_j_new[num_nonzeros_diag_new] = col_idx; + A_diag_a_new[num_nonzeros_diag_new] = col_value; + ++num_nonzeros_diag_new; + } + else if (col_idx >= ncol_diag) + { + A_offd_j_new[num_nonzeros_offd_new] = col_idx - ncol_diag; + A_offd_a_new[num_nonzeros_offd_new] = col_value; + ++num_nonzeros_offd_new; + } + } + } + + A_diag_i_new[i + 1] = num_nonzeros_diag_new; + A_offd_i_new[i + 1] = num_nonzeros_offd_new; + } + + hypre_TFree(aux_j, HYPRE_MEMORY_HOST); + hypre_TFree(aux_data, HYPRE_MEMORY_HOST); + + /* Update input matrix */ + hypre_TFree(A_diag_i, HYPRE_MEMORY_HOST); + hypre_TFree(A_diag_j, HYPRE_MEMORY_HOST); + hypre_TFree(A_diag_a, HYPRE_MEMORY_HOST); + hypre_CSRMatrixI(A_diag) = A_diag_i_new; + hypre_CSRMatrixJ(A_diag) = A_diag_j_new; + hypre_CSRMatrixData(A_diag) = A_diag_a_new; + hypre_CSRMatrixNumNonzeros(A_diag) = num_nonzeros_diag_new; + + hypre_TFree(A_offd_i, HYPRE_MEMORY_HOST); + hypre_TFree(A_offd_j, HYPRE_MEMORY_HOST); + hypre_TFree(A_offd_a, HYPRE_MEMORY_HOST); + hypre_CSRMatrixI(A_offd) = A_offd_i_new; + hypre_CSRMatrixJ(A_offd) = A_offd_j_new; + hypre_CSRMatrixData(A_offd) = A_offd_a_new; + hypre_CSRMatrixNumNonzeros(A_offd) = num_nonzeros_offd_new; + +#if defined (HYPRE_USING_GPU) + if (hypre_GetExecPolicy1(memory_location) == HYPRE_EXEC_DEVICE) + { + hypre_ParCSRMatrixMigrate(A, memory_location); + } +#endif + } + else + { + /* Keep only the diagonal portion of A + TODO (VPM): consider other combinations of max_elmts and blk_dim */ + hypre_CSRMatrixNumCols(A_offd) = 0; + hypre_CSRMatrixNumNonzeros(A_offd) = 0; + hypre_CSRMatrixNumRownnz(A_offd) = 0; + hypre_TFree(hypre_CSRMatrixRownnz(A_offd), memory_location); + hypre_TFree(hypre_CSRMatrixI(A_offd), memory_location); + hypre_TFree(hypre_CSRMatrixJ(A_offd), memory_location); + hypre_TFree(hypre_CSRMatrixData(A_offd), memory_location); + hypre_TFree(hypre_ParCSRMatrixColMapOffd(A), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_ParCSRMatrixDeviceColMapOffd(A), memory_location); + hypre_CSRMatrixI(A_offd) = hypre_CTAlloc(HYPRE_Int, nrows + 1, memory_location); + + hypre_CSRMatrixTruncateDiag(A_diag); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_MGRBuildNonGalerkinCoarseOperatorHost + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRBuildNonGalerkinCoarseOperatorHost(hypre_ParCSRMatrix *A_FF, + hypre_ParCSRMatrix *A_FC, + hypre_ParCSRMatrix *A_CF, + hypre_ParCSRMatrix *A_CC, + hypre_ParCSRMatrix *Wp, + hypre_ParCSRMatrix *Wr, + HYPRE_Int fine_blk_dim, + HYPRE_Int coarse_blk_dim, + HYPRE_Int ordering, + HYPRE_Int method, + HYPRE_Int max_elmts, + hypre_ParCSRMatrix **A_H_ptr) +{ + hypre_ParCSRMatrix *A_H = NULL; + hypre_ParCSRMatrix *A_Hc = NULL; + hypre_ParCSRMatrix *Wp_tmp = NULL; + hypre_ParCSRMatrix *Wr_tmp = NULL; + hypre_ParCSRMatrix *A_CF_truncated = NULL; + hypre_ParCSRMatrix *A_FF_inv = NULL; + hypre_ParCSRMatrix *minus_Wp = NULL; + + HYPRE_Int blk_inv_size; + HYPRE_Complex neg_one = -1.0; + HYPRE_Complex one = 1.0; + HYPRE_Complex beta = 0.0; + + if (Wp != NULL && max_elmts > 0) + { + /* A_Hc = diag(A_CF * Wp) */ + hypre_ParCSRMatMatDiag(A_CF, Wp, &A_Hc); + + /* Coarse grid / Schur complement + Note that beta is one since A_Hc has positive sign */ + hypre_ParCSRMatrixAdd(one, A_CC, one, A_Hc, &A_H); + + /* Free memory */ + hypre_ParCSRMatrixDestroy(A_Hc); + + /* Set output pointer */ + *A_H_ptr = A_H; + + return hypre_error_flag; + } + + if (method == 1) + { + if (Wp != NULL) + { + A_Hc = hypre_ParCSRMatMat(A_CF, Wp); + + /* Set multiplication factor to A_Hc */ + beta = one; + } + else + { + // Build block diagonal inverse for A_FF + hypre_ParCSRMatrixBlockDiagMatrix(A_FF, fine_blk_dim, -1, NULL, 1, &A_FF_inv); + + // compute Wp = A_FF_inv * A_FC + // NOTE: Use hypre_ParMatmul here instead of hypre_ParCSRMatMat to avoid padding + // zero entries at diagonals for the latter routine. Use MatMat once this padding + // issue is resolved since it is more efficient. + // hypre_ParCSRMatrix *Wp_tmp = hypre_ParCSRMatMat(A_FF_inv, A_FC); + Wp_tmp = hypre_ParMatmul(A_FF_inv, A_FC); + + /* Compute correction A_Hc = A_CF * (A_FF_inv * A_FC); */ + A_Hc = hypre_ParCSRMatMat(A_CF, Wp_tmp); + hypre_ParCSRMatrixDestroy(Wp_tmp); + hypre_ParCSRMatrixDestroy(A_FF_inv); + + /* Set multiplication factor to A_Hc */ + beta = neg_one; + } + } + else if (method == 2 || method == 3) + { + /* Extract the diagonal of A_CF */ + hypre_MGRTruncateAcfCPR(A_CF, &A_CF_truncated); + if (Wp != NULL) + { + A_Hc = hypre_ParCSRMatMat(A_CF_truncated, Wp); + + /* Set multiplication factor to A_Hc */ + beta = one; + } + else + { + blk_inv_size = method == 2 ? 1 : fine_blk_dim; + hypre_ParCSRMatrixBlockDiagMatrix(A_FF, blk_inv_size, -1, NULL, 1, &A_FF_inv); + + /* TODO (VPM): We shouldn't need to compute Wr_tmp since we are passing in Wr already */ + HYPRE_UNUSED_VAR(Wr); + Wr_tmp = hypre_ParCSRMatMat(A_CF_truncated, A_FF_inv); + A_Hc = hypre_ParCSRMatMat(Wr_tmp, A_FC); + hypre_ParCSRMatrixDestroy(Wr_tmp); + hypre_ParCSRMatrixDestroy(A_FF_inv); + + /* Set multiplication factor to A_Hc */ + beta = neg_one; + } + hypre_ParCSRMatrixDestroy(A_CF_truncated); + } + else if (method == 4) + { + /* Approximate inverse for ideal interploation */ + hypre_MGRApproximateInverse(A_FF, &A_FF_inv); + + minus_Wp = hypre_ParCSRMatMat(A_FF_inv, A_FC); + A_Hc = hypre_ParCSRMatMat(A_CF, minus_Wp); + hypre_ParCSRMatrixDestroy(minus_Wp); + + /* Set multiplication factor to A_Hc */ + beta = neg_one; + } + + /* Drop small entries in the correction term A_Hc */ + hypre_MGRNonGalerkinTruncate(A_Hc, ordering, coarse_blk_dim, max_elmts); + + /* Coarse grid / Schur complement */ + hypre_ParCSRMatrixAdd(one, A_CC, beta, A_Hc, &A_H); + + /* Free memory */ + hypre_ParCSRMatrixDestroy(A_Hc); + + /* Set output pointer */ + *A_H_ptr = A_H; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_MGRBuildNonGalerkinCoarseOperatorDevice + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRBuildNonGalerkinCoarseOperatorDevice(hypre_ParCSRMatrix *A_FF, + hypre_ParCSRMatrix *A_FC, + hypre_ParCSRMatrix *A_CF, + hypre_ParCSRMatrix *A_CC, + hypre_ParCSRMatrix *Wp, + hypre_ParCSRMatrix *Wr, + HYPRE_Int fine_blk_dim, + HYPRE_Int coarse_blk_dim, + HYPRE_Int ordering, + HYPRE_Int method, + HYPRE_Int max_elmts, + hypre_ParCSRMatrix **A_H_ptr) +{ + /* Local variables */ + hypre_ParCSRMatrix *A_H; + hypre_ParCSRMatrix *A_Hc; + hypre_ParCSRMatrix *A_CF_trunc; + hypre_ParCSRMatrix *Wp_tmp = Wp; + HYPRE_Complex neg_one = -1.0; + HYPRE_Complex one = 1.0; + + hypre_GpuProfilingPushRange("MGRComputeNonGalerkinCG"); + + /* Truncate A_CF according to the method */ + if (method == 2 || method == 3) + { + hypre_MGRTruncateAcfCPRDevice(A_CF, &A_CF_trunc); + } + else + { + A_CF_trunc = A_CF; + } + + /* Compute Wp/Wr if not passed in */ + if (!Wp && (method == 1 || method == 2)) + { + hypre_ParVector *D_FF_inv; + HYPRE_Complex *data; + + /* Create vector to store A_FF's diagonal inverse */ + D_FF_inv = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A_FF), + hypre_ParCSRMatrixGlobalNumRows(A_FF), + hypre_ParCSRMatrixRowStarts(A_FF)); + hypre_ParVectorInitialize_v2(D_FF_inv, HYPRE_MEMORY_DEVICE); + data = hypre_ParVectorLocalData(D_FF_inv); + + /* Compute the inverse of A_FF and compute its inverse */ + hypre_CSRMatrixExtractDiagonal(hypre_ParCSRMatrixDiag(A_FF), data, 2); + hypre_ParVectorScale(neg_one, D_FF_inv); + + /* Compute D_FF_inv*A_FC */ + Wp_tmp = hypre_ParCSRMatrixClone(A_FC, 1); + hypre_ParCSRMatrixDiagScale(Wp_tmp, D_FF_inv, NULL); + + /* Free memory */ + hypre_ParVectorDestroy(D_FF_inv); + } + else if (!Wp && (method == 3)) + { + hypre_ParCSRMatrix *B_FF_inv; + + /* Compute the block diagonal inverse of A_FF */ + hypre_ParCSRMatrixBlockDiagMatrix(A_FF, fine_blk_dim, -1, NULL, 1, &B_FF_inv); + + /* Compute Wp = A_FF_inv * A_FC */ + Wp_tmp = hypre_ParCSRMatMat(B_FF_inv, A_FC); + hypre_ParCSRMatrixScale(Wp_tmp, neg_one); + + /* Free memory */ + hypre_ParCSRMatrixDestroy(B_FF_inv); + } + + /* Compute A_Hc (the correction for A_H) */ + if (Wp_tmp) + { + if (max_elmts > 0) + { + /* A_Hc = diag(A_CF * Wp) */ + hypre_ParCSRMatMatDiag(A_CF_trunc, Wp_tmp, &A_Hc); + + /* Coarse grid / Schur complement */ + hypre_ParCSRMatrixAdd(one, A_CC, one, A_Hc, &A_H); + + /* Free memory */ + hypre_ParCSRMatrixDestroy(A_Hc); + if (method == 2 || method == 3) + { + hypre_ParCSRMatrixDestroy(A_CF_trunc); + } + if (Wp_tmp != Wp) + { + hypre_ParCSRMatrixDestroy(Wp_tmp); + } + + /* Set output pointer */ + *A_H_ptr = A_H; + + hypre_GpuProfilingPopRange(); + + return hypre_error_flag; + } + + A_Hc = hypre_ParCSRMatMat(A_CF_trunc, Wp_tmp); + } + else if (Wr) + { + A_Hc = hypre_ParCSRMatMat(Wr, A_FC); + } + else + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Wp/Wr matrices were not provided!"); + hypre_GpuProfilingPopRange(); + + return hypre_error_flag; + } + + /* Filter A_Hc */ + hypre_MGRNonGalerkinTruncate(A_Hc, ordering, coarse_blk_dim, max_elmts); + + /* Coarse grid (Schur complement) computation */ + hypre_ParCSRMatrixAdd(one, A_CC, one, A_Hc, &A_H); + + /* Free memory */ + hypre_ParCSRMatrixDestroy(A_Hc); + if (Wp_tmp != Wp) + { + hypre_ParCSRMatrixDestroy(Wp_tmp); + } + if (method == 2 || method == 3) + { + hypre_ParCSRMatrixDestroy(A_CF_trunc); + } + + /* Set output pointer to coarse grid matrix */ + *A_H_ptr = A_H; + + hypre_GpuProfilingPopRange(); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_MGRBuildNonGalerkinCoarseOperator + * + * Computes the coarse level operator A_H = RAP via a Non-Galerkin approach. + * + * Available methods: + * 1: inv(A_FF) approximated by its (block) diagonal inverse + * 2: CPR-like approx. with inv(A_FF) approx. by its diagonal inverse + * 3: CPR-like approx. with inv(A_FF) approx. by its block diagonal inverse + * 4: inv(A_FF) approximated by sparse approximate inverse + * + * Methods 1-4 assume that restriction is the injection operator. + * + * TODO (VPM): inv(A_FF)*A_FC might have been computed before. Reuse it! + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRBuildNonGalerkinCoarseOperator(hypre_ParCSRMatrix *A_FF, + hypre_ParCSRMatrix *A_FC, + hypre_ParCSRMatrix *A_CF, + hypre_ParCSRMatrix *A_CC, + hypre_ParCSRMatrix *Wp, + hypre_ParCSRMatrix *Wr, + HYPRE_Int fine_blk_dim, + HYPRE_Int coarse_blk_dim, + HYPRE_Int ordering, + HYPRE_Int method, + HYPRE_Int max_elmts, + hypre_ParCSRMatrix **A_H_ptr) +{ + hypre_ParCSRMatrix *matrices[6] = {A_FF, A_FC, A_CF, A_CC, Wp, Wr}; + HYPRE_Int i; + + /* Check that the memory locations of the input matrices match */ + for (i = 0; i < 5; i++) + { + if (matrices[i] && matrices[i + 1] && + hypre_ParCSRMatrixMemoryLocation(matrices[i]) != + hypre_ParCSRMatrixMemoryLocation(matrices[i + 1])) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Memory locations do not match!"); + return hypre_error_flag; + } + } + +#if defined (HYPRE_USING_GPU) + HYPRE_MemoryLocation memory_location = hypre_ParCSRMatrixMemoryLocation(A_FF); + + if (hypre_GetExecPolicy1(memory_location) == HYPRE_EXEC_DEVICE) + { + hypre_MGRBuildNonGalerkinCoarseOperatorDevice(A_FF, A_FC, A_CF, A_CC, Wp, Wr, + fine_blk_dim, coarse_blk_dim, + ordering, method, max_elmts, A_H_ptr); + } + else +#endif + { + hypre_MGRBuildNonGalerkinCoarseOperatorHost(A_FF, A_FC, A_CF, A_CC, Wp, Wr, + fine_blk_dim, coarse_blk_dim, + ordering, method, max_elmts, A_H_ptr); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_MGRBuildCoarseOperator + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRBuildCoarseOperator(void *mgr_vdata, + hypre_ParCSRMatrix *A_FF, + hypre_ParCSRMatrix *A_FC, + hypre_ParCSRMatrix *A_CF, + hypre_ParCSRMatrix **A_CC_ptr, + hypre_ParCSRMatrix *Wp, + hypre_ParCSRMatrix *Wr, + HYPRE_Int level) +{ + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + hypre_ParCSRMatrix *A = (mgr_data -> A_array)[level]; + hypre_ParCSRMatrix *P = (mgr_data -> P_array)[level]; + hypre_ParCSRMatrix *R = (mgr_data -> R_array)[level]; + hypre_ParCSRMatrix *RT = (mgr_data -> RT_array)[level]; + hypre_ParCSRMatrix *A_CC = *A_CC_ptr; + + HYPRE_Int *blk_dims = (mgr_data -> block_num_coarse_indexes); + HYPRE_Int block_size = (mgr_data -> block_size); + HYPRE_Int method = (mgr_data -> coarse_grid_method)[level]; + HYPRE_Int num_coarse_levels = (mgr_data -> max_num_coarse_levels); + HYPRE_Int ordering = (mgr_data -> set_c_points_method); + HYPRE_Int max_elmts = (mgr_data -> nonglk_max_elmts)[level]; + HYPRE_Int interp_type = (mgr_data -> interp_type)[level]; + HYPRE_Int restrict_type = (mgr_data -> restrict_type)[level]; + HYPRE_Real threshold = (mgr_data -> truncate_coarse_grid_threshold); + + hypre_ParCSRMatrix *AP, *RAP, *RAP_c; + HYPRE_Int fine_blk_dim = (level) ? blk_dims[level - 1] - blk_dims[level] : + block_size - blk_dims[level]; + HYPRE_Int coarse_blk_dim = blk_dims[level]; + HYPRE_Int rebuild_commpkg = 0; + HYPRE_Complex one = 1.0; + HYPRE_MemoryLocation memory_location = hypre_ParCSRMatrixMemoryLocation(A); + HYPRE_ExecutionPolicy exec_policy = hypre_GetExecPolicy1(memory_location); + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("RAP"); + + if (!method) + { + /* Galerkin path */ + if ((interp_type == 0) && Wr && (exec_policy == HYPRE_EXEC_HOST)) + { + /* Prolongation is the injection operator and + Restriction is not the injection operator (Wr != NULL) */ + RAP_c = hypre_ParCSRMatMat(Wr, A_FC); + hypre_ParCSRMatrixAdd(one, A_CC, one, RAP_c, &RAP); + hypre_ParCSRMatrixDestroy(RAP_c); + } + else if ((restrict_type == 0) && Wp && (exec_policy == HYPRE_EXEC_HOST)) + { + /* Prolongation is not the injection operator (Wp != NULL) and + Restriction is the injection operator */ + RAP_c = hypre_ParCSRMatMat(A_CF, Wp); + hypre_ParCSRMatrixAdd(one, A_CC, one, RAP_c, &RAP); + hypre_ParCSRMatrixDestroy(RAP_c); + } + else if (RT) + { + RAP = hypre_ParCSRMatrixRAPKT(RT, A, P, 1); + } + else if (R) + { + AP = hypre_ParCSRMatMat(A, P); + RAP = hypre_ParCSRMatMat(R, AP); + hypre_CSRMatrixReorder(hypre_ParCSRMatrixDiag(RAP)); + hypre_ParCSRMatrixDestroy(AP); + } + else + { + hypre_GpuProfilingPopRange(); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Expected either Wp, Wr, R or RT!"); + return hypre_error_flag; + } + } + else if (method == 5) + { + /* Approximate the coarse level matrix as A_CC */ + RAP = *A_CC_ptr; + *A_CC_ptr = NULL; + } + else + { + /* Non-Galerkin path */ + hypre_MGRBuildNonGalerkinCoarseOperator(A_FF, A_FC, A_CF, A_CC, Wp, Wr, + fine_blk_dim, coarse_blk_dim, + ordering, method, max_elmts, &RAP); + } + + /* Truncate coarse level matrix based on input threshold */ + if (threshold > 0.0) + { +#if defined (HYPRE_USING_GPU) + HYPRE_MemoryLocation memory_location = hypre_ParCSRMatrixMemoryLocation(RAP); + + if (hypre_GetExecPolicy1(memory_location) == HYPRE_EXEC_DEVICE) + { + hypre_ParCSRMatrixDropSmallEntriesDevice(RAP, threshold, -1); + rebuild_commpkg = 1; + } + else +#endif + { + hypre_ParCSRMatrixTruncate(RAP, threshold, 0, 0, 0); + } + } + + /* Compute/rebuild communication package */ + if (rebuild_commpkg) + { + if (hypre_ParCSRMatrixCommPkg(RAP)) + { + hypre_MatvecCommPkgDestroy(hypre_ParCSRMatrixCommPkg(RAP)); + } + hypre_MatvecCommPkgCreate(RAP); + } + if (!hypre_ParCSRMatrixCommPkg(RAP)) + { + hypre_MatvecCommPkgCreate(RAP); + } + + /* Set coarse grid matrix */ + (mgr_data -> A_array)[level + 1] = RAP; + if ((level + 1) == num_coarse_levels) + { + (mgr_data -> RAP) = RAP; + } + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} diff --git a/external/hypre/src/parcsr_ls/par_mgr_setup.c b/external/hypre/src/parcsr_ls/par_mgr_setup.c index 863abcb0..ef484ea0 100644 --- a/external/hypre/src/parcsr_ls/par_mgr_setup.c +++ b/external/hypre/src/parcsr_ls/par_mgr_setup.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -12,1509 +12,2078 @@ /* Setup MGR data */ HYPRE_Int hypre_MGRSetup( void *mgr_vdata, - hypre_ParCSRMatrix *A, - hypre_ParVector *f, - hypre_ParVector *u ) + hypre_ParCSRMatrix *A, + hypre_ParVector *f, + hypre_ParVector *u ) { - MPI_Comm comm = hypre_ParCSRMatrixComm(A); - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; - - HYPRE_Int i,j, final_coarse_size, block_size, idx, **block_cf_marker; - HYPRE_Int *block_num_coarse_indexes, *point_marker_array; - HYPRE_BigInt row, end_idx; - HYPRE_Int lev, num_coarsening_levs, last_level; - HYPRE_Int num_c_levels,nc,index_i,cflag; - HYPRE_Int set_c_points_method; - HYPRE_Int debug_flag = 0; -// HYPRE_Int num_threads; - - hypre_ParCSRMatrix *RT = NULL; - hypre_ParCSRMatrix *P = NULL; - hypre_ParCSRMatrix *S = NULL; - hypre_ParCSRMatrix *ST = NULL; - hypre_ParCSRMatrix *AT = NULL; - - hypre_IntArray *dof_func_buff = NULL; - HYPRE_Int *dof_func_buff_data = NULL; - HYPRE_BigInt *coarse_pnts_global = NULL; - hypre_Vector **l1_norms = NULL; - - hypre_ParVector *Ztemp; - hypre_ParVector *Vtemp; - hypre_ParVector *Utemp; - hypre_ParVector *Ftemp; - - /* pointers to mgr data */ - HYPRE_Int use_default_cgrid_solver = (mgr_data -> use_default_cgrid_solver); - HYPRE_Int use_default_fsolver = (mgr_data -> use_default_fsolver); - HYPRE_Int logging = (mgr_data -> logging); - HYPRE_Int print_level = (mgr_data -> print_level); - HYPRE_Int relax_type = (mgr_data -> relax_type); - HYPRE_Int relax_order = (mgr_data -> relax_order); - - HYPRE_Int *interp_type = (mgr_data -> interp_type); - HYPRE_Int *restrict_type = (mgr_data -> restrict_type); - HYPRE_Int num_interp_sweeps = (mgr_data -> num_interp_sweeps); - HYPRE_Int num_restrict_sweeps = (mgr_data -> num_interp_sweeps); - HYPRE_Int max_elmts = (mgr_data -> P_max_elmts); - HYPRE_Real max_row_sum = (mgr_data -> max_row_sum); - HYPRE_Real strong_threshold = (mgr_data -> strong_threshold); - HYPRE_Real trunc_factor = (mgr_data -> trunc_factor); - HYPRE_Int old_num_coarse_levels = (mgr_data -> num_coarse_levels); - HYPRE_Int max_num_coarse_levels = (mgr_data -> max_num_coarse_levels); - HYPRE_Int * reserved_Cpoint_local_indexes = (mgr_data -> reserved_Cpoint_local_indexes); - hypre_IntArray **CF_marker_array = (mgr_data -> CF_marker_array); - HYPRE_Int *CF_marker; - hypre_ParCSRMatrix **A_array = (mgr_data -> A_array); - hypre_ParCSRMatrix **P_array = (mgr_data -> P_array); - hypre_ParCSRMatrix **RT_array = (mgr_data -> RT_array); - hypre_ParCSRMatrix *RAP_ptr = NULL; - - hypre_ParCSRMatrix *A_ff_ptr = NULL; - HYPRE_Solver **aff_solver = (mgr_data -> aff_solver); - hypre_ParCSRMatrix **A_ff_array = (mgr_data -> A_ff_array); - hypre_ParVector **F_fine_array = (mgr_data -> F_fine_array); - hypre_ParVector **U_fine_array = (mgr_data -> U_fine_array); - - HYPRE_Int (*fine_grid_solver_setup)(void*,void*,void*,void*); - HYPRE_Int (*fine_grid_solver_solve)(void*,void*,void*,void*); - - hypre_ParVector **F_array = (mgr_data -> F_array); - hypre_ParVector **U_array = (mgr_data -> U_array); - hypre_ParVector *residual = (mgr_data -> residual); - HYPRE_Real *rel_res_norms = (mgr_data -> rel_res_norms); - - HYPRE_Solver default_cg_solver; - HYPRE_Int (*coarse_grid_solver_setup)(void*,void*,void*,void*) = (HYPRE_Int (*)(void*, void*, void*, void*)) (mgr_data -> coarse_grid_solver_setup); - HYPRE_Int (*coarse_grid_solver_solve)(void*,void*,void*,void*) = (HYPRE_Int (*)(void*, void*, void*, void*)) (mgr_data -> coarse_grid_solver_solve); - - HYPRE_Int global_smooth_type = (mgr_data -> global_smooth_type); - HYPRE_Int global_smooth_iters = (mgr_data -> global_smooth_iters); - - HYPRE_Int reserved_coarse_size = (mgr_data -> reserved_coarse_size); - - HYPRE_Int num_procs, my_id; - hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); - HYPRE_Int n = hypre_CSRMatrixNumRows(A_diag); - - HYPRE_Int use_VcycleSmoother = 0; - hypre_ParVector *VcycleRelaxZtemp; - hypre_ParVector *VcycleRelaxVtemp; - hypre_ParAMGData **FrelaxVcycleData; - HYPRE_Int *Frelax_method = (mgr_data -> Frelax_method); - HYPRE_Int *Frelax_num_functions = (mgr_data -> Frelax_num_functions); - - HYPRE_Int *use_non_galerkin_cg = (mgr_data -> use_non_galerkin_cg); - - hypre_ParCSRMatrix *A_ff_inv = (mgr_data -> A_ff_inv); - - HYPRE_Int use_air = 0; - HYPRE_Real truncate_cg_threshold = (mgr_data -> truncate_coarse_grid_threshold); -// HYPRE_Real wall_time; - - /* ----- begin -----*/ - HYPRE_ANNOTATE_FUNC_BEGIN; -// num_threads = hypre_NumThreads(); - - block_size = (mgr_data -> block_size); - block_cf_marker = (mgr_data -> block_cf_marker); - block_num_coarse_indexes = (mgr_data -> block_num_coarse_indexes); - point_marker_array = (mgr_data -> point_marker_array); - set_c_points_method = (mgr_data -> set_c_points_method); - - HYPRE_Int **level_coarse_indexes = NULL; - HYPRE_Int *level_coarse_size = NULL; - HYPRE_Int setNonCpointToF = (mgr_data -> set_non_Cpoints_to_F); - HYPRE_BigInt *reserved_coarse_indexes = (mgr_data -> reserved_coarse_indexes); - HYPRE_BigInt *idx_array = (mgr_data -> idx_array); - HYPRE_Int lvl_to_keep_cpoints = (mgr_data -> lvl_to_keep_cpoints); - - HYPRE_Int nloc = hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(A)); - HYPRE_BigInt ilower = hypre_ParCSRMatrixFirstRowIndex(A); - HYPRE_BigInt iupper = hypre_ParCSRMatrixLastRowIndex(A); - - hypre_MPI_Comm_size(comm,&num_procs); - hypre_MPI_Comm_rank(comm,&my_id); - - /* Trivial case: simply solve the coarse level problem */ - if( block_size < 2 || (mgr_data -> max_num_coarse_levels) < 1) - { - if (my_id == 0 && print_level > 0) - { - hypre_printf("Warning: Block size is < 2 or number of coarse levels is < 1. \n"); - hypre_printf("Solving scalar problem on fine grid using coarse level solver \n"); - } - - if(use_default_cgrid_solver) - { + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + + HYPRE_Int i, j, final_coarse_size = 0, block_size, idx, **block_cf_marker; + HYPRE_Int *block_num_coarse_indexes, *point_marker_array; + HYPRE_BigInt row, end_idx; + HYPRE_Int lev, num_coarsening_levs, last_level; + HYPRE_Int num_c_levels = 0, nc, index_i, cflag; + HYPRE_Int set_c_points_method; + HYPRE_Int debug_flag = 0; + HYPRE_Int block_jacobi_bsize; + HYPRE_Int *blk_size = mgr_data -> blk_size; + HYPRE_Int level_blk_size; + + hypre_ParCSRMatrix *RT = NULL; + hypre_ParCSRMatrix *R = NULL; + hypre_ParCSRMatrix *P = NULL; + hypre_ParCSRMatrix *S = NULL; + hypre_ParCSRMatrix *Wp = NULL; + hypre_ParCSRMatrix *Wr = NULL; + + HYPRE_BigInt coarse_pnts_global[2]; // TODO: Change to row_starts_cpts + HYPRE_BigInt row_starts_fpts[2]; + hypre_Vector **l1_norms = NULL; + HYPRE_Real *l1_norms_data; + + hypre_ParVector *Ztemp; + hypre_ParVector *Vtemp; + hypre_ParVector *Utemp; + hypre_ParVector *Ftemp; + + /* pointers to mgr data */ + HYPRE_Int use_default_cgrid_solver = (mgr_data -> use_default_cgrid_solver); + HYPRE_Int logging = (mgr_data -> logging); + HYPRE_Int print_level = (mgr_data -> print_level); + HYPRE_Int relax_type = (mgr_data -> relax_type); + HYPRE_Int relax_order = (mgr_data -> relax_order); + HYPRE_Int *interp_type = (mgr_data -> interp_type); + HYPRE_Int *restrict_type = (mgr_data -> restrict_type); + HYPRE_Int *num_relax_sweeps = (mgr_data -> num_relax_sweeps); + HYPRE_Int num_interp_sweeps = (mgr_data -> num_interp_sweeps); + //HYPRE_Int num_restrict_sweeps = (mgr_data -> num_interp_sweeps); + HYPRE_Int *P_max_elmts = (mgr_data -> P_max_elmts); + HYPRE_Real max_row_sum = (mgr_data -> max_row_sum); + HYPRE_Real strong_threshold = (mgr_data -> strong_threshold); + HYPRE_Real trunc_factor = (mgr_data -> trunc_factor); + HYPRE_Int old_num_coarse_levels = (mgr_data -> num_coarse_levels); + HYPRE_Int max_num_coarse_levels = (mgr_data -> max_num_coarse_levels); + HYPRE_Int * reserved_Cpoint_local_indexes = (mgr_data -> reserved_Cpoint_local_indexes); + hypre_IntArray **CF_marker_array = (mgr_data -> CF_marker_array); + HYPRE_Int *CF_marker; + hypre_IntArray *FC_marker; + hypre_ParCSRMatrix **A_array = (mgr_data -> A_array); + hypre_ParCSRMatrix **B_array = (mgr_data -> B_array); + hypre_ParCSRMatrix **B_FF_array = (mgr_data -> B_FF_array); +#if defined(HYPRE_USING_GPU) + hypre_ParCSRMatrix **P_FF_array = (mgr_data -> P_FF_array); +#endif + hypre_ParCSRMatrix **P_array = (mgr_data -> P_array); + hypre_ParCSRMatrix **R_array = (mgr_data -> RT_array); + hypre_ParCSRMatrix **RT_array = (mgr_data -> RT_array); + + hypre_ParCSRMatrix *A_FF = NULL; + hypre_ParCSRMatrix *A_FC = NULL; + hypre_ParCSRMatrix *A_CF = NULL; + hypre_ParCSRMatrix *A_CC = NULL; + + hypre_Solver *aff_base; + HYPRE_Solver **aff_solver = (mgr_data -> aff_solver); + hypre_ParCSRMatrix **A_ff_array = (mgr_data -> A_ff_array); + hypre_ParVector **F_fine_array = (mgr_data -> F_fine_array); + hypre_ParVector **U_fine_array = (mgr_data -> U_fine_array); + + HYPRE_Int (*fgrid_solver_setup)(void*, void*, void*, void*); + HYPRE_Int (*fgrid_solver_solve)(void*, void*, void*, void*); + + hypre_ParVector **F_array = (mgr_data -> F_array); + hypre_ParVector **U_array = (mgr_data -> U_array); + hypre_ParVector *residual = (mgr_data -> residual); + HYPRE_Real *rel_res_norms = (mgr_data -> rel_res_norms); + HYPRE_Real **frelax_diaginv = (mgr_data -> frelax_diaginv); + HYPRE_Real **level_diaginv = (mgr_data -> level_diaginv); + // VPM: Do we need both frelax_diaginv and level_diaginv? + + HYPRE_Solver default_cg_solver; + HYPRE_Int (*cgrid_solver_setup)(void*, void*, void*, void*) = + (HYPRE_Int (*)(void*, void*, void*, void*)) (mgr_data -> coarse_grid_solver_setup); + + HYPRE_Int (*cgrid_solver_solve)(void*, void*, void*, void*) = + (HYPRE_Int (*)(void*, void*, void*, void*)) (mgr_data -> coarse_grid_solver_solve); + + HYPRE_Int *level_smooth_type = (mgr_data -> level_smooth_type); + HYPRE_Int *level_smooth_iters = (mgr_data -> level_smooth_iters); + HYPRE_Solver *level_smoother = (mgr_data -> level_smoother); + + HYPRE_Int reserved_coarse_size = (mgr_data -> reserved_coarse_size); + + HYPRE_Int num_procs, my_id; + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + HYPRE_Int n = hypre_CSRMatrixNumRows(A_diag); + + HYPRE_Int use_VcycleSmoother = 0; + HYPRE_Int use_GSElimSmoother = 0; + // HYPRE_Int use_ComplexSmoother = 0; + hypre_ParVector *VcycleRelaxZtemp; + hypre_ParVector *VcycleRelaxVtemp; + hypre_ParAMGData **FrelaxVcycleData; + hypre_ParAMGData **GSElimData; + HYPRE_Int *Frelax_method = (mgr_data -> Frelax_method); + HYPRE_Int *Frelax_num_functions = (mgr_data -> Frelax_num_functions); + + HYPRE_Int *Frelax_type = (mgr_data -> Frelax_type); + + HYPRE_Int *coarse_grid_method = (mgr_data -> coarse_grid_method); + + HYPRE_MemoryLocation memory_location = hypre_ParCSRMatrixMemoryLocation(A); +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1(memory_location); +#endif + char region_name[1024]; + char msg[2048]; + + /* ----- begin -----*/ + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("MGRSetup"); + hypre_GpuProfilingPushRange("MGRSetup-Init"); + hypre_MemoryPrintUsage(comm, hypre_HandleLogLevel(hypre_handle()), "MGR setup begin", 0); + + block_size = (mgr_data -> block_size); + block_jacobi_bsize = (mgr_data -> block_jacobi_bsize); + block_cf_marker = (mgr_data -> block_cf_marker); + block_num_coarse_indexes = (mgr_data -> block_num_coarse_indexes); + point_marker_array = (mgr_data -> point_marker_array); + set_c_points_method = (mgr_data -> set_c_points_method); + + HYPRE_Int **level_coarse_indexes = NULL; + HYPRE_Int *level_coarse_size = NULL; + HYPRE_Int setNonCpointToF = (mgr_data -> set_non_Cpoints_to_F); + HYPRE_BigInt *reserved_coarse_indexes = (mgr_data -> reserved_coarse_indexes); + HYPRE_BigInt *idx_array = (mgr_data -> idx_array); + HYPRE_Int lvl_to_keep_cpoints = ((mgr_data -> lvl_to_keep_cpoints) > + (mgr_data -> max_num_coarse_levels)) ? + (mgr_data -> max_num_coarse_levels) : + (mgr_data -> lvl_to_keep_cpoints); + HYPRE_Int nloc = hypre_ParCSRMatrixNumRows(A); + HYPRE_BigInt ilower = hypre_ParCSRMatrixFirstRowIndex(A); + HYPRE_BigInt iupper = hypre_ParCSRMatrixLastRowIndex(A); + + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); + + /* Reset print_level codes. This is useful for printing + information when solving a sequence of linear systems */ + print_level |= ((print_level & HYPRE_MGR_PRINT_RESERVED_A) == HYPRE_MGR_PRINT_RESERVED_A) ? + HYPRE_MGR_PRINT_INFO_PARAMS : 0; + print_level |= ((print_level & HYPRE_MGR_PRINT_RESERVED_B) == HYPRE_MGR_PRINT_RESERVED_B) ? + HYPRE_MGR_PRINT_FINE_MATRIX : 0; + print_level |= ((print_level & HYPRE_MGR_PRINT_RESERVED_C) == HYPRE_MGR_PRINT_RESERVED_C) ? + HYPRE_MGR_PRINT_FINE_RHS : 0; + (mgr_data -> print_level) = print_level; + + /* Trivial case: simply solve the coarse level problem */ + if (block_size < 2 || (mgr_data -> max_num_coarse_levels) < 1) + { if (my_id == 0 && print_level > 0) - hypre_printf("No coarse grid solver provided. Using default AMG solver ... \n"); + { + hypre_printf("Warning: Block size is < 2 or number of coarse levels is < 1. \n"); + hypre_printf("Solving scalar problem on fine grid using coarse level solver \n"); + } + + if (use_default_cgrid_solver) + { + if (my_id == 0 && print_level > 0) + { + hypre_printf("No coarse grid solver provided. Using default AMG solver ... \n"); + } + + /* create and set default solver parameters here */ + /* create and initialize default_cg_solver */ + default_cg_solver = (HYPRE_Solver) hypre_BoomerAMGCreate(); + hypre_BoomerAMGSetMaxIter(default_cg_solver, (mgr_data -> max_iter)); + hypre_BoomerAMGSetRelaxOrder(default_cg_solver, 1); + hypre_BoomerAMGSetPrintLevel(default_cg_solver, 3); + + /* set setup and solve functions */ + cgrid_solver_setup = (HYPRE_Int (*)(void*, void*, void*, void*)) hypre_BoomerAMGSetup; + cgrid_solver_solve = (HYPRE_Int (*)(void*, void*, void*, void*)) hypre_BoomerAMGSolve; + (mgr_data -> coarse_grid_solver_setup) = cgrid_solver_setup; + (mgr_data -> coarse_grid_solver_solve) = cgrid_solver_solve; + (mgr_data -> coarse_grid_solver) = default_cg_solver; + } + + /* keep reserved coarse indexes to coarsest grid */ + if (reserved_coarse_size > 0) + { + HYPRE_BoomerAMGSetCPoints((mgr_data ->coarse_grid_solver), 25, reserved_coarse_size, + reserved_coarse_indexes); + } + + /* setup coarse grid solver */ + cgrid_solver_setup((mgr_data -> coarse_grid_solver), A, f, u); + (mgr_data -> num_coarse_levels) = 0; + + HYPRE_ANNOTATE_FUNC_END; + hypre_GpuProfilingPopRange(); + hypre_GpuProfilingPopRange(); + + return hypre_error_flag; + } + + /* If we reduce the reserved C-points, increase one level */ + if (lvl_to_keep_cpoints > 0) + { + max_num_coarse_levels++; + } + + /* Initialize local indexes of coarse sets at different levels */ + level_coarse_indexes = hypre_CTAlloc(HYPRE_Int*, max_num_coarse_levels, HYPRE_MEMORY_HOST); + for (i = 0; i < max_num_coarse_levels; i++) + { + level_coarse_indexes[i] = hypre_CTAlloc(HYPRE_Int, nloc, HYPRE_MEMORY_HOST); + } + + level_coarse_size = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, HYPRE_MEMORY_HOST); + HYPRE_Int reserved_cpoints_eliminated = 0; + + /* TODO: move this to par_mgr_coarsen.c and port to GPUs (VPM) */ + for (i = 0; i < max_num_coarse_levels; i++) + { + // if we want to reduce the reserved Cpoints, set the current level + // coarse indices the same as the previous level + if (i == lvl_to_keep_cpoints && i > 0) + { + reserved_cpoints_eliminated++; + for (j = 0; j < final_coarse_size; j++) + { + level_coarse_indexes[i][j] = level_coarse_indexes[i - 1][j]; + } + level_coarse_size[i] = final_coarse_size; + continue; + } + final_coarse_size = 0; + if (set_c_points_method == 0) // interleaved ordering, i.e. s1,p1,s2,p2,... + { + // loop over rows + for (row = ilower; row <= iupper; row++) + { + idx = row % block_size; + if (block_cf_marker[i - reserved_cpoints_eliminated][idx] == CMRK) + { + level_coarse_indexes[i][final_coarse_size++] = (HYPRE_Int)(row - ilower); + } + } + } + else if (set_c_points_method == 1) // block ordering s1,s2,...,p1,p2,... + { + for (j = 0; j < block_size; j++) + { + if (block_cf_marker[i - reserved_cpoints_eliminated][j] == CMRK) + { + if (j == block_size - 1) + { + end_idx = iupper + 1; + } + else + { + end_idx = idx_array[j + 1]; + } + for (row = idx_array[j]; row < end_idx; row++) + { + level_coarse_indexes[i][final_coarse_size++] = (HYPRE_Int)(row - ilower); + } + } + } + //hypre_printf("Level %d, # of coarse points %d\n", i, final_coarse_size); + } + else if (set_c_points_method == 2) + { + HYPRE_Int isCpoint; + // row start from 0 since point_marker_array is local + for (row = 0; row < nloc; row++) + { + isCpoint = 0; + for (j = 0; j < block_num_coarse_indexes[i]; j++) + { + if (point_marker_array[row] == block_cf_marker[i][j]) + { + isCpoint = 1; + break; + } + } + if (isCpoint) + { + level_coarse_indexes[i][final_coarse_size++] = row; + //printf("%d\n",row); + } + } + } + else + { + if (my_id == 0) + { + hypre_printf("ERROR! Unknown method for setting C points."); + } + exit(-1); // TODO: Fix error handling (VPM) + } + level_coarse_size[i] = final_coarse_size; + } + + /* Set reserved coarse indexes to be kept to the coarsest level of the MGR solver */ + hypre_TFree((mgr_data -> reserved_Cpoint_local_indexes), HYPRE_MEMORY_HOST); + + if (reserved_coarse_size > 0) + { + (mgr_data -> reserved_Cpoint_local_indexes) = hypre_CTAlloc(HYPRE_Int, + reserved_coarse_size, + HYPRE_MEMORY_HOST); + reserved_Cpoint_local_indexes = (mgr_data -> reserved_Cpoint_local_indexes); + for (i = 0; i < reserved_coarse_size; i++) + { + row = reserved_coarse_indexes[i]; + HYPRE_Int local_row = (HYPRE_Int)(row - ilower); + reserved_Cpoint_local_indexes[i] = local_row; + HYPRE_Int lvl = lvl_to_keep_cpoints == 0 ? max_num_coarse_levels : lvl_to_keep_cpoints; + if (set_c_points_method < 2) + { + idx = row % block_size; + for (j = 0; j < lvl; j++) + { + if (block_cf_marker[j][idx] != CMRK) + { + level_coarse_indexes[j][level_coarse_size[j]++] = local_row; + } + } + } + else + { + HYPRE_Int isCpoint = 0; + for (j = 0; j < lvl; j++) + { + HYPRE_Int k; + for (k = 0; k < block_num_coarse_indexes[j]; k++) + { + if (point_marker_array[local_row] == block_cf_marker[j][k]) + { + isCpoint = 1; + break; + } + } + if (!isCpoint) + { + level_coarse_indexes[j][level_coarse_size[j]++] = local_row; + } + } + } + } + } + + (mgr_data -> level_coarse_indexes) = level_coarse_indexes; + (mgr_data -> num_coarse_per_level) = level_coarse_size; + + /* Free Previously allocated data, if any not destroyed */ + if (A_array || B_array || B_FF_array || + P_array || R_array || RT_array || CF_marker_array) + { + for (j = 1; j < (old_num_coarse_levels); j++) + { + if (A_array[j]) + { + hypre_ParCSRMatrixDestroy(A_array[j]); + A_array[j] = NULL; + } + } + + for (j = 0; j < old_num_coarse_levels; j++) + { + if (B_array[j]) + { + hypre_ParCSRMatrixDestroy(B_array[j]); + B_array[j] = NULL; + } + + if (B_FF_array[j]) + { + hypre_ParCSRMatrixDestroy(B_FF_array[j]); + B_FF_array[j] = NULL; + } + + if (P_array[j]) + { + hypre_ParCSRMatrixDestroy(P_array[j]); + P_array[j] = NULL; + } + + if (R_array[j]) + { + hypre_ParCSRMatrixDestroy(R_array[j]); + R_array[j] = NULL; + } + + if (RT_array[j]) + { + hypre_ParCSRMatrixDestroy(RT_array[j]); + RT_array[j] = NULL; + } + + if (CF_marker_array[j]) + { + hypre_IntArrayDestroy(CF_marker_array[j]); + CF_marker_array[j] = NULL; + } + } + hypre_TFree(B_array, HYPRE_MEMORY_HOST); + hypre_TFree(B_FF_array, HYPRE_MEMORY_HOST); + hypre_TFree(P_array, HYPRE_MEMORY_HOST); + hypre_TFree(R_array, HYPRE_MEMORY_HOST); + hypre_TFree(RT_array, HYPRE_MEMORY_HOST); + hypre_TFree(CF_marker_array, HYPRE_MEMORY_HOST); + } + +#if defined(HYPRE_USING_GPU) + if (P_FF_array) + { + for (j = 0; j < old_num_coarse_levels; j++) + { + if (P_FF_array[j]) + { + hypre_ParCSRMatrixDestroy(P_FF_array[j]); + P_FF_array[j] = NULL; + } + } + hypre_TFree(P_FF_array, HYPRE_MEMORY_HOST); + } +#endif + + /* Free previously allocated FrelaxVcycleData if not destroyed */ + if ((mgr_data -> VcycleRelaxZtemp)) + { + hypre_ParVectorDestroy((mgr_data -> VcycleRelaxZtemp)); + (mgr_data -> VcycleRelaxZtemp) = NULL; + } + if ((mgr_data -> VcycleRelaxVtemp)) + { + hypre_ParVectorDestroy((mgr_data -> VcycleRelaxVtemp)); + (mgr_data -> VcycleRelaxVtemp) = NULL; + } + if ((mgr_data -> FrelaxVcycleData)) + { + for (j = 0; j < old_num_coarse_levels; j++) + { + if ((mgr_data -> FrelaxVcycleData)[j]) + { + hypre_MGRDestroyFrelaxVcycleData((mgr_data -> FrelaxVcycleData)[j]); + (mgr_data -> FrelaxVcycleData)[j] = NULL; + } + } + hypre_TFree((mgr_data -> FrelaxVcycleData), HYPRE_MEMORY_HOST); + (mgr_data -> FrelaxVcycleData) = NULL; + } + + /* destroy previously allocated Gaussian Elim. data */ + if ((mgr_data -> GSElimData)) + { + for (j = 0; j < old_num_coarse_levels; j++) + { + if ((mgr_data -> GSElimData)[j]) + { + hypre_MGRDestroyGSElimData((mgr_data -> GSElimData)[j]); + (mgr_data -> GSElimData)[j] = NULL; + } + } + hypre_TFree((mgr_data -> GSElimData), HYPRE_MEMORY_HOST); + (mgr_data -> GSElimData) = NULL; + } + + /* destroy final coarse grid matrix, if not previously destroyed */ + if ((mgr_data -> RAP)) + { + hypre_ParCSRMatrixDestroy((mgr_data -> RAP)); + (mgr_data -> RAP) = NULL; + } + + /* Setup for global block smoothers*/ + if (set_c_points_method == 0) + { + if (my_id == num_procs) + { + mgr_data -> n_block = (n - reserved_coarse_size) / block_size; + mgr_data -> left_size = n - block_size * (mgr_data -> n_block); + } + else + { + mgr_data -> n_block = n / block_size; + mgr_data -> left_size = n - block_size * (mgr_data -> n_block); + } + } + else + { + mgr_data -> n_block = n; + mgr_data -> left_size = 0; + } + + /* clear old l1_norm data, if created */ + if ((mgr_data -> l1_norms)) + { + for (j = 0; j < (old_num_coarse_levels); j++) + { + if ((mgr_data -> l1_norms)[j]) + { + hypre_SeqVectorDestroy((mgr_data -> l1_norms)[i]); + (mgr_data -> l1_norms)[j] = NULL; + } + } + hypre_TFree((mgr_data -> l1_norms), HYPRE_MEMORY_HOST); + } + + if ((mgr_data -> frelax_diaginv)) + { + for (j = 0; j < (old_num_coarse_levels); j++) + { + if ((mgr_data -> frelax_diaginv)[j]) + { + hypre_TFree((mgr_data -> frelax_diaginv)[j], HYPRE_MEMORY_HOST); + (mgr_data -> frelax_diaginv)[j] = NULL; + } + } + hypre_TFree((mgr_data -> frelax_diaginv), HYPRE_MEMORY_HOST); + } + + if ((mgr_data -> level_diaginv)) + { + for (j = 0; j < (old_num_coarse_levels); j++) + { + if ((mgr_data -> level_diaginv)[j]) + { + hypre_TFree((mgr_data -> level_diaginv)[j], HYPRE_MEMORY_HOST); + (mgr_data -> level_diaginv)[j] = NULL; + } + } + hypre_TFree((mgr_data -> level_diaginv), HYPRE_MEMORY_HOST); + } + + /* setup temporary storage */ + if ((mgr_data -> Ztemp)) + { + hypre_ParVectorDestroy((mgr_data -> Ztemp)); + (mgr_data -> Ztemp) = NULL; + } + if ((mgr_data -> Vtemp)) + { + hypre_ParVectorDestroy((mgr_data -> Vtemp)); + (mgr_data -> Vtemp) = NULL; + } + if ((mgr_data -> Utemp)) + { + hypre_ParVectorDestroy((mgr_data -> Utemp)); + (mgr_data -> Utemp) = NULL; + } + if ((mgr_data -> Ftemp)) + { + hypre_ParVectorDestroy((mgr_data -> Ftemp)); + (mgr_data -> Ftemp) = NULL; + } + if ((mgr_data -> residual)) + { + hypre_ParVectorDestroy((mgr_data -> residual)); + (mgr_data -> residual) = NULL; + } + hypre_TFree((mgr_data -> rel_res_norms), HYPRE_MEMORY_HOST); + hypre_TFree((mgr_data -> blk_size), HYPRE_MEMORY_HOST); + + Vtemp = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A), + hypre_ParCSRMatrixGlobalNumRows(A), + hypre_ParCSRMatrixRowStarts(A)); + hypre_ParVectorInitialize(Vtemp); + (mgr_data ->Vtemp) = Vtemp; + + Ztemp = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A), + hypre_ParCSRMatrixGlobalNumRows(A), + hypre_ParCSRMatrixRowStarts(A)); + hypre_ParVectorInitialize(Ztemp); + (mgr_data -> Ztemp) = Ztemp; + + Utemp = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A), + hypre_ParCSRMatrixGlobalNumRows(A), + hypre_ParCSRMatrixRowStarts(A)); + hypre_ParVectorInitialize(Utemp); + (mgr_data ->Utemp) = Utemp; + + Ftemp = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A), + hypre_ParCSRMatrixGlobalNumRows(A), + hypre_ParCSRMatrixRowStarts(A)); + hypre_ParVectorInitialize(Ftemp); + (mgr_data ->Ftemp) = Ftemp; + + /* Allocate memory for level structure */ + if (A_array == NULL) + { + A_array = hypre_CTAlloc(hypre_ParCSRMatrix*, max_num_coarse_levels + 1, HYPRE_MEMORY_HOST); + } + if (B_array == NULL) + { + B_array = hypre_CTAlloc(hypre_ParCSRMatrix*, max_num_coarse_levels, HYPRE_MEMORY_HOST); + } + if (P_array == NULL && max_num_coarse_levels > 0) + { + P_array = hypre_CTAlloc(hypre_ParCSRMatrix*, max_num_coarse_levels, HYPRE_MEMORY_HOST); + } + if (R_array == NULL && max_num_coarse_levels > 0) + { + R_array = hypre_CTAlloc(hypre_ParCSRMatrix*, max_num_coarse_levels, HYPRE_MEMORY_HOST); + } +#if defined(HYPRE_USING_GPU) + if (P_FF_array == NULL && max_num_coarse_levels > 0) + { + P_FF_array = hypre_CTAlloc(hypre_ParCSRMatrix*, max_num_coarse_levels, HYPRE_MEMORY_HOST); + } +#endif + if (RT_array == NULL && max_num_coarse_levels > 0) + { + RT_array = hypre_CTAlloc(hypre_ParCSRMatrix*, max_num_coarse_levels, HYPRE_MEMORY_HOST); + } + if (CF_marker_array == NULL) + { + CF_marker_array = hypre_CTAlloc(hypre_IntArray*, max_num_coarse_levels, HYPRE_MEMORY_HOST); + } + if (l1_norms == NULL) + { + l1_norms = hypre_CTAlloc(hypre_Vector*, max_num_coarse_levels, HYPRE_MEMORY_HOST); + } + if (P_max_elmts == NULL) + { + P_max_elmts = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, HYPRE_MEMORY_HOST); + } + + /* Set default for Frelax_method if not set already -- Supports deprecated function */ + /* + if (Frelax_method == NULL) + { + Frelax_method = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, HYPRE_MEMORY_HOST); + for (i = 0; i < max_num_coarse_levels; i++) + { + Frelax_method[i] = 0; + } + (mgr_data -> Frelax_method) = Frelax_method; + } + */ + /* Set default for Frelax_type if not set already. + * We also consolidate inputs from relax_type and Frelax_method here. + * This should be simplified once the other options are removed. + */ + if (Frelax_type == NULL) + { + Frelax_type = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, HYPRE_MEMORY_HOST); + + /* Use relax type/ frelax_method data or set default type to use */ + if (Frelax_method) + { + for (i = 0; i < max_num_coarse_levels; i++) + { + Frelax_type[i] = Frelax_method[i] > 0 ? Frelax_method[i] : relax_type; + } + } + else if (relax_type) + { + for (i = 0; i < max_num_coarse_levels; i++) + { + Frelax_type[i] = relax_type; + } + } + else /* set default here */ + { + for (i = 0; i < max_num_coarse_levels; i++) + { + Frelax_type[i] = 0; + } + } + + (mgr_data -> Frelax_type) = Frelax_type; + } + + /* When running on the device and using Jacobi relaxation, switch to GPU-supported Jacobi */ +#if defined(HYPRE_USING_GPU) + for (i = 0; i < max_num_coarse_levels; i++) + { + if (Frelax_type[i] == 0 && interp_type && interp_type[i] != 12) + { + Frelax_type[i] = 7; + if (print_level) + { + hypre_ParPrintf(comm, "Changing F-relaxation type to 7 at MGR level %d\n", i); + } + } + } +#endif + + /* Set default for using Non-Galerkin coarse grid */ + if (coarse_grid_method == NULL) + { + coarse_grid_method = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, HYPRE_MEMORY_HOST); + (mgr_data -> coarse_grid_method) = coarse_grid_method; + } + + /* Set default for Non-Galerkin correction truncation */ + if ((mgr_data -> nonglk_max_elmts) == NULL) + { + (mgr_data -> nonglk_max_elmts) = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, HYPRE_MEMORY_HOST); + for (i = 0; i < max_num_coarse_levels; i++) + { + (mgr_data -> nonglk_max_elmts)[i] = 1; + } + } + + /* Set default options for the interpolation type at each level if not already set */ + if (interp_type == NULL) + { + interp_type = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, HYPRE_MEMORY_HOST); + for (i = 0; i < max_num_coarse_levels; i++) + { + interp_type[i] = 2; + } + (mgr_data -> interp_type) = interp_type; + } + + /* Set default options for restriction type at each level if not already set */ + if (restrict_type == NULL) + { + restrict_type = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, HYPRE_MEMORY_HOST); + for (i = 0; i < max_num_coarse_levels; i++) + { + restrict_type[i] = 0; + } + (mgr_data -> restrict_type) = restrict_type; + } + + /* Set default number of sweeps at each level if not already set */ + if (num_relax_sweeps == NULL) + { + num_relax_sweeps = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, HYPRE_MEMORY_HOST); + for (i = 0; i < max_num_coarse_levels; i++) + { + num_relax_sweeps[i] = 1; + } + (mgr_data -> num_relax_sweeps) = num_relax_sweeps; + } + + /* set interp_type, restrict_type, and Frelax_type if we reduce the reserved C-points */ + reserved_cpoints_eliminated = 0; + if (lvl_to_keep_cpoints > 0 && reserved_coarse_size > 0) + { + HYPRE_Int *level_interp_type = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, + HYPRE_MEMORY_HOST); + HYPRE_Int *level_restrict_type = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, + HYPRE_MEMORY_HOST); + HYPRE_Int *level_frelax_type = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, + HYPRE_MEMORY_HOST); + for (i = 0; i < max_num_coarse_levels; i++) + { + if (i == lvl_to_keep_cpoints) + { + level_interp_type[i] = 2; + level_restrict_type[i] = 0; + level_frelax_type[i] = 2; //99; + reserved_cpoints_eliminated++; + } + else + { + level_interp_type[i] = interp_type[i - reserved_cpoints_eliminated]; + level_restrict_type[i] = restrict_type[i - reserved_cpoints_eliminated]; + level_frelax_type[i] = Frelax_type[i - reserved_cpoints_eliminated]; + } + } + hypre_TFree(interp_type, HYPRE_MEMORY_HOST); + hypre_TFree(restrict_type, HYPRE_MEMORY_HOST); + hypre_TFree(Frelax_type, HYPRE_MEMORY_HOST); + + interp_type = level_interp_type; + restrict_type = level_restrict_type; + Frelax_type = level_frelax_type; + (mgr_data -> interp_type) = level_interp_type; + (mgr_data -> restrict_type) = level_restrict_type; + (mgr_data -> Frelax_type) = level_frelax_type; + } + + /* set pointers to mgr data */ + (mgr_data -> A_array) = A_array; + (mgr_data -> B_array) = B_array; + (mgr_data -> P_array) = P_array; + (mgr_data -> R_array) = R_array; + (mgr_data -> RT_array) = RT_array; + (mgr_data -> CF_marker_array) = CF_marker_array; + (mgr_data -> l1_norms) = l1_norms; + (mgr_data -> P_max_elmts) = P_max_elmts; +#if defined(HYPRE_USING_GPU) + (mgr_data -> P_FF_array) = P_FF_array; +#endif + + /* Set up solution and rhs arrays */ + if (F_array != NULL || U_array != NULL) + { + for (j = 1; j < old_num_coarse_levels + 1; j++) + { + if (F_array[j] != NULL) + { + hypre_ParVectorDestroy(F_array[j]); + F_array[j] = NULL; + } + if (U_array[j] != NULL) + { + hypre_ParVectorDestroy(U_array[j]); + U_array[j] = NULL; + } + } + } + + if (F_array == NULL) + { + F_array = hypre_CTAlloc(hypre_ParVector*, max_num_coarse_levels + 1, HYPRE_MEMORY_HOST); + } + if (U_array == NULL) + { + U_array = hypre_CTAlloc(hypre_ParVector*, max_num_coarse_levels + 1, HYPRE_MEMORY_HOST); + } + + /* TODO: Change to A_FF_array (VPM) */ + if (A_ff_array) + { + for (j = 1; j < old_num_coarse_levels; j++) + { + if (A_ff_array[j]) + { + hypre_ParCSRMatrixDestroy(A_ff_array[j]); + A_ff_array[j] = NULL; + } + } + if (mgr_data -> fsolver_mode != 0) + { + if (A_ff_array[0]) + { + hypre_ParCSRMatrixDestroy(A_ff_array[0]); + A_ff_array[0] = NULL; + } + } + hypre_TFree(A_ff_array, HYPRE_MEMORY_HOST); + A_ff_array = NULL; + } + + if (aff_solver) + { + for (j = 1; j < (old_num_coarse_levels); j++) + { + if (aff_solver[j]) + { + aff_base = (hypre_Solver*) aff_solver[j]; + hypre_SolverDestroy(aff_base)((HYPRE_Solver) (aff_base)); + aff_solver[j] = NULL; + } + } + if (mgr_data -> fsolver_mode == 2) + { + hypre_BoomerAMGDestroy(aff_solver[0]); + } + } + + if ((mgr_data -> fine_grid_solver_setup) != NULL) + { + fgrid_solver_setup = (mgr_data -> fine_grid_solver_setup); + } + else + { + fgrid_solver_setup = (HYPRE_Int (*)(void*, void*, void*, void*)) hypre_BoomerAMGSetup; + (mgr_data -> fine_grid_solver_setup) = fgrid_solver_setup; + } + if ((mgr_data -> fine_grid_solver_solve) != NULL) + { + fgrid_solver_solve = (mgr_data -> fine_grid_solver_solve); + } + else + { + fgrid_solver_solve = (HYPRE_Int (*)(void*, void*, void*, void*)) hypre_BoomerAMGSolve; + (mgr_data -> fine_grid_solver_solve) = fgrid_solver_solve; + } + + /* Set up solution and rhs arrays for Frelax */ + if (F_fine_array != NULL || U_fine_array != NULL) + { + for (j = 1; j < old_num_coarse_levels + 1; j++) + { + if (F_fine_array[j] != NULL) + { + hypre_ParVectorDestroy(F_fine_array[j]); + F_fine_array[j] = NULL; + } + if (U_fine_array[j] != NULL) + { + hypre_ParVectorDestroy(U_fine_array[j]); + U_fine_array[j] = NULL; + } + } + } + + if (F_fine_array == NULL) + { + F_fine_array = hypre_CTAlloc(hypre_ParVector*, max_num_coarse_levels + 1, + HYPRE_MEMORY_HOST); + } + if (U_fine_array == NULL) + { + U_fine_array = hypre_CTAlloc(hypre_ParVector*, max_num_coarse_levels + 1, + HYPRE_MEMORY_HOST); + } + if (aff_solver == NULL) + { + aff_solver = hypre_CTAlloc(HYPRE_Solver*, max_num_coarse_levels, HYPRE_MEMORY_HOST); + } + if (A_ff_array == NULL) + { + A_ff_array = hypre_CTAlloc(hypre_ParCSRMatrix*, max_num_coarse_levels, HYPRE_MEMORY_HOST); + } + if (B_FF_array == NULL) + { + B_FF_array = hypre_CTAlloc(hypre_ParCSRMatrix*, max_num_coarse_levels, HYPRE_MEMORY_HOST); + } + if (frelax_diaginv == NULL) + { + frelax_diaginv = hypre_CTAlloc(HYPRE_Real*, max_num_coarse_levels, HYPRE_MEMORY_HOST); + } + if (level_diaginv == NULL) + { + level_diaginv = hypre_CTAlloc(HYPRE_Real*, max_num_coarse_levels, HYPRE_MEMORY_HOST); + } + if (blk_size == NULL) + { + blk_size = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, HYPRE_MEMORY_HOST); + } + if (level_smooth_type == NULL) + { + level_smooth_type = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, HYPRE_MEMORY_HOST); + } + if (level_smooth_iters == NULL) + { + level_smooth_iters = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, HYPRE_MEMORY_HOST); + } + if (level_smoother == NULL) + { + level_smoother = hypre_CTAlloc(HYPRE_Solver, max_num_coarse_levels, HYPRE_MEMORY_HOST); + } + + /* set solution and rhs pointers */ + F_array[0] = f; + U_array[0] = u; + + (mgr_data -> F_array) = F_array; + (mgr_data -> U_array) = U_array; + + (mgr_data -> F_fine_array) = F_fine_array; + (mgr_data -> U_fine_array) = U_fine_array; + (mgr_data -> aff_solver) = aff_solver; + (mgr_data -> A_ff_array) = A_ff_array; + (mgr_data -> B_FF_array) = B_FF_array; + (mgr_data -> frelax_diaginv) = frelax_diaginv; + (mgr_data -> level_diaginv) = level_diaginv; + (mgr_data -> blk_size) = blk_size; + (mgr_data -> level_smooth_type) = level_smooth_type; + (mgr_data -> level_smooth_iters) = level_smooth_iters; + (mgr_data -> level_smoother) = level_smoother; + + /* begin coarsening loop */ + num_coarsening_levs = max_num_coarse_levels; + + /* Close MGRSetup-Init region */ + hypre_GpuProfilingPopRange(); + + /* Initialize first entry in A_array to the input matrix */ + A_array[0] = A; + + /* loop over levels of coarsening */ + for (lev = 0; lev < num_coarsening_levs; lev++) + { + hypre_sprintf(region_name, "%s-%d", "MGR_Level", lev); + hypre_GpuProfilingPushRange(region_name); + HYPRE_ANNOTATE_REGION_BEGIN("%s", region_name); + + /* Check if this is the last level */ + last_level = (lev == (num_coarsening_levs - 1)); + + /* Set level's block size */ + level_blk_size = (lev == 0) ? block_size : block_num_coarse_indexes[lev - 1]; + + /* Get number of local unknowns */ + nloc = hypre_ParCSRMatrixNumRows(A_array[lev]); + + /* Reset pointers */ + l1_norms_data = NULL; + + /* Setup global smoother */ + hypre_sprintf(region_name, "Global-Relax"); + hypre_GpuProfilingPushRange(region_name); + HYPRE_ANNOTATE_REGION_BEGIN("%s", region_name); + + /* TODO (VPM): Change option types for block-Jacobi and block-GS to 30 and 31 and + make them accessible through hypre_BoomerAMGRelax? */ + if (level_smooth_iters[lev] > 0) + { + if (level_smoother[lev]) + { + hypre_Solver *smoother_base = (hypre_Solver*) level_smoother[lev]; + + /* Call setup function */ + hypre_SolverSetup(smoother_base)((HYPRE_Solver) level_smoother[lev], + (HYPRE_Matrix) A_array[lev], + NULL, NULL); + } + else if (level_smooth_type[lev] == 0 || level_smooth_type[lev] == 1) + { + /* TODO (VPM): move this to hypre_MGRBlockRelaxSetup and change its declaration */ +#if defined (HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_DEVICE) + { + if (!B_array[lev]) + { + hypre_ParCSRMatrixBlockDiagMatrixDevice(A_array[lev], level_blk_size, + 0, NULL, 1, &B_array[lev]); + } + } + else +#endif + { + hypre_MGRBlockRelaxSetup(A_array[lev], level_blk_size, + &(mgr_data -> level_diaginv)[lev]); + } + } + else if (level_smooth_type[lev] == 8) + { + /* TODO (VPM): Option 8 should be for hybrid L1 Symm. Gauss-Seidel */ + HYPRE_EuclidCreate(comm, &(level_smoother[lev])); + HYPRE_EuclidSetLevel(level_smoother[lev], 0); + HYPRE_EuclidSetBJ(level_smoother[lev], 1); + HYPRE_EuclidSetup(level_smoother[lev], A_array[lev], NULL, NULL); + } + else if (level_smooth_type[lev] == 16) + { + /* TODO (VPM): Option 16 should be for Chebyshev */ + HYPRE_ILUCreate(&(level_smoother[lev])); + HYPRE_ILUSetType(level_smoother[lev], 0); + HYPRE_ILUSetLevelOfFill(level_smoother[lev], 0); + HYPRE_ILUSetMaxIter(level_smoother[lev], level_smooth_iters[lev]); + HYPRE_ILUSetTol(level_smoother[lev], 0.0); + HYPRE_ILUSetLocalReordering(level_smoother[lev], 0); + HYPRE_ILUSetup(level_smoother[lev], A_array[lev], NULL, NULL); + } + else + { + /* Compute l1_norms according to relaxation type */ + hypre_BoomerAMGRelaxComputeL1Norms(A_array[lev], level_smooth_type[lev], + 0, 0, NULL, &l1_norms_data); + if (l1_norms_data) + { + l1_norms[lev] = hypre_SeqVectorCreate(nloc); + hypre_VectorData(l1_norms[lev]) = l1_norms_data; + hypre_VectorMemoryLocation(l1_norms[lev]) = memory_location; + + if (print_level) + { + hypre_ParPrintf(comm, "Setting l1_norms for global relax at MGR level %d\n", i); + } + } + } + } + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_REGION_END("%s", region_name); + + /* Compute strength matrix for interpolation operator + use default parameters, to be modified later */ + hypre_sprintf(region_name, "Coarsen"); + hypre_GpuProfilingPushRange(region_name); + HYPRE_ANNOTATE_REGION_BEGIN("%s", region_name); + cflag = last_level || setNonCpointToF; + if (interp_type[lev] == 3 || interp_type[lev] == 5 || + interp_type[lev] == 6 || interp_type[lev] == 7 || !cflag) + { + hypre_BoomerAMGCreateS(A_array[lev], strong_threshold, max_row_sum, 1, NULL, &S); + } + + /* Coarsen: Build CF_marker array based on rows of A */ + hypre_MGRCoarsen(S, A_array[lev], level_coarse_size[lev], level_coarse_indexes[lev], + debug_flag, &CF_marker_array[lev], cflag); + CF_marker = hypre_IntArrayData(CF_marker_array[lev]); + + /* Get global fine/coarse partitionings. TODO: generate dof_func */ + hypre_MGRCoarseParms(comm, nloc, CF_marker_array[lev], + coarse_pnts_global, row_starts_fpts); + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_REGION_END("%s", region_name); + + /* Compute Petrov-Galerkin operators */ + num_interp_sweeps = (mgr_data -> num_interp_sweeps); + + if (mgr_data -> block_jacobi_bsize == 0) + { + block_jacobi_bsize = level_blk_size - block_num_coarse_indexes[lev]; + } + + if (block_jacobi_bsize == 1 && interp_type[lev] == 12) + { + interp_type[lev] = 2; + } + + /* Compute C/F splitting (needed by RAP computation and other operations) */ + FC_marker = hypre_IntArrayCloneDeep(CF_marker_array[lev]); + hypre_IntArrayNegate(FC_marker); + + hypre_ParCSRMatrixGenerateFFFC(A_array[lev], CF_marker, coarse_pnts_global, + NULL, &A_FC, &A_FF); + hypre_ParCSRMatrixGenerateFFFC(A_array[lev], hypre_IntArrayData(FC_marker), row_starts_fpts, + NULL, &A_CF, &A_CC); + + /* Build interpolation operator */ + hypre_MGRBuildInterp(A_array[lev], A_FF, A_FC, S, CF_marker_array[lev], + coarse_pnts_global, trunc_factor, P_max_elmts[lev], + block_jacobi_bsize, interp_type[lev], num_interp_sweeps, + &Wp, &P); + P_array[lev] = P; + + /* Build Restriction operator */ + if (block_jacobi_bsize == 1 && restrict_type[lev] == 12) + { + restrict_type[lev] = 2; + } + hypre_MGRBuildRestrict(A_array[lev], A_FF, A_FC, A_CF, CF_marker_array[lev], + coarse_pnts_global, trunc_factor, P_max_elmts[lev], + strong_threshold, max_row_sum, block_jacobi_bsize, + restrict_type[lev], &Wr, &R, &RT); + R_array[lev] = R; + RT_array[lev] = RT; + + /* Use block Jacobi F-relaxation with block Jacobi interpolation */ + hypre_sprintf(region_name, "F-Relax"); + hypre_GpuProfilingPushRange(region_name); + HYPRE_ANNOTATE_REGION_BEGIN("%s", region_name); + + if (interp_type[lev] == 12 && (mgr_data -> num_relax_sweeps)[lev] > 0) + { + /* TODO: refactor the following block (VPM) */ +#if defined (HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_ParCSRMatrixBlockDiagMatrixDevice(A_FF, block_jacobi_bsize, + 0, NULL, 1, &B_FF_array[lev]); + } + else +#endif + { + HYPRE_Real *diag_inv = NULL; + HYPRE_Int inv_num_rows; + HYPRE_Int inv_size; - /* create and set default solver parameters here */ - /* create and initialize default_cg_solver */ - default_cg_solver = (HYPRE_Solver) hypre_BoomerAMGCreate(); - hypre_BoomerAMGSetMaxIter ( default_cg_solver, (mgr_data -> max_iter) ); + /* TODO: replace this with hypre_IntArrayCount (VPM) */ + inv_num_rows = 0; + for (i = 0; i < nloc; i++) + { + inv_num_rows += (CF_marker[i] == -1) ? 1 : 0; + } - hypre_BoomerAMGSetRelaxOrder( default_cg_solver, 1); - hypre_BoomerAMGSetPrintLevel(default_cg_solver, 3); - /* set setup and solve functions */ - coarse_grid_solver_setup = (HYPRE_Int (*)(void*, void*, void*, void*)) hypre_BoomerAMGSetup; - coarse_grid_solver_solve = (HYPRE_Int (*)(void*, void*, void*, void*)) hypre_BoomerAMGSolve; - (mgr_data -> coarse_grid_solver_setup) = coarse_grid_solver_setup; - (mgr_data -> coarse_grid_solver_solve) = coarse_grid_solver_solve; - (mgr_data -> coarse_grid_solver) = default_cg_solver; - } - - // keep reserved coarse indexes to coarsest grid - - if (reserved_coarse_size > 0) - { - HYPRE_BoomerAMGSetCPoints((mgr_data ->coarse_grid_solver), 25, reserved_coarse_size, reserved_coarse_indexes); - } - - /* setup coarse grid solver */ - coarse_grid_solver_setup((mgr_data -> coarse_grid_solver), A, f, u); - (mgr_data -> num_coarse_levels) = 0; - HYPRE_ANNOTATE_FUNC_END; - - return hypre_error_flag; - } - - /* If we reduce the reserved C-points, increase one level */ - if (lvl_to_keep_cpoints > 0) max_num_coarse_levels++; - /* Initialize local indexes of coarse sets at different levels */ - level_coarse_indexes = hypre_CTAlloc(HYPRE_Int*, max_num_coarse_levels, HYPRE_MEMORY_HOST); - for (i = 0; i < max_num_coarse_levels; i++) - { - level_coarse_indexes[i] = hypre_CTAlloc(HYPRE_Int, nloc, HYPRE_MEMORY_HOST); - } - - level_coarse_size = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, HYPRE_MEMORY_HOST); - HYPRE_Int reserved_cpoints_eliminated = 0; - // loop over levels - for(i=0; i 0) - { - reserved_cpoints_eliminated++; - for (j = 0; j < final_coarse_size; j++) - { - level_coarse_indexes[i][j] = level_coarse_indexes[i-1][j]; + /* Extract block diagonal inverses */ + inv_size = inv_num_rows * block_jacobi_bsize; + diag_inv = hypre_CTAlloc(HYPRE_Complex, inv_size, HYPRE_MEMORY_HOST); + + /* TODO: Extend this to device (VPM) */ + hypre_ParCSRMatrixExtractBlockDiagHost(A_array[lev], block_jacobi_bsize, inv_num_rows, + -1, CF_marker, inv_size, 1, diag_inv); + frelax_diaginv[lev] = diag_inv; + blk_size[lev] = block_jacobi_bsize; + if (!A_FF) + { + hypre_MGRBuildAff(A_array[lev], CF_marker, debug_flag, &A_FF); + } + } + + /* Set A_ff pointer */ + A_ff_array[lev] = A_FF; + + F_fine_array[lev + 1] = + hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A_FF), + hypre_ParCSRMatrixGlobalNumRows(A_FF), + hypre_ParCSRMatrixRowStarts(A_FF)); + hypre_ParVectorInitialize(F_fine_array[lev + 1]); + + U_fine_array[lev + 1] = + hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A_FF), + hypre_ParCSRMatrixGlobalNumRows(A_FF), + hypre_ParCSRMatrixRowStarts(A_FF)); + hypre_ParVectorInitialize(U_fine_array[lev + 1]); } - level_coarse_size[i] = final_coarse_size; - continue; - } - final_coarse_size = 0; - if (set_c_points_method == 0) // interleaved ordering, i.e. s1,p1,s2,p2,... - { - // loop over rows - for(row = ilower; row <=iupper; row++) - { - idx = row % block_size; - if(block_cf_marker[i - reserved_cpoints_eliminated][idx] == CMRK) - { - level_coarse_indexes[i][final_coarse_size++] = (HYPRE_Int)(row - ilower); - } - } - } - else if (set_c_points_method == 1) // block ordering s1,s2,...,p1,p2,... - { - for (j=0; j < block_size; j++) - { - if (block_cf_marker[i - reserved_cpoints_eliminated][j] == CMRK) - { - if (j == block_size - 1) - { - end_idx = iupper+1; - } - else - { - end_idx = idx_array[j+1]; - } - for (row = idx_array[j]; row < end_idx; row++) - { - level_coarse_indexes[i][final_coarse_size++] = (HYPRE_Int)(row - ilower); - } - } - } - //hypre_printf("Level %d, # of coarse points %d\n", i, final_coarse_size); - } - else if (set_c_points_method == 2) - { - HYPRE_Int isCpoint; - // row start from 0 since point_marker_array is local - for (row = 0; row < nloc; row++) - { - isCpoint = 0; - for (j = 0; j < block_num_coarse_indexes[i]; j++) - { - if (point_marker_array[row] == block_cf_marker[i][j]) - { - isCpoint = 1; - break; - } - } - if (isCpoint) - { - level_coarse_indexes[i][final_coarse_size++] = row; - //printf("%d\n",row); - } - } - } - else - { - if (my_id == 0) - hypre_printf("ERROR! Unknown method for setting C points."); - exit(-1); - } - level_coarse_size[i] = final_coarse_size; - } - - // Set reserved coarse indexes to be kept to the coarsest level of the MGR solver - if ((mgr_data -> reserved_Cpoint_local_indexes) != NULL) - hypre_TFree((mgr_data -> reserved_Cpoint_local_indexes), HYPRE_MEMORY_HOST); - if (reserved_coarse_size > 0) - { - (mgr_data -> reserved_Cpoint_local_indexes) = hypre_CTAlloc(HYPRE_Int, reserved_coarse_size, HYPRE_MEMORY_HOST); - reserved_Cpoint_local_indexes = (mgr_data -> reserved_Cpoint_local_indexes); - for(i=0; i fsolver_mode) == 0) + { + if (Frelax_type[lev] == 2) + { + if (((hypre_ParAMGData*)aff_solver[lev])->A_array != NULL) + { + if (((hypre_ParAMGData*)aff_solver[lev])->A_array[0] != NULL) + { + /* F-solver is already set up, only need to store A_ff_ptr */ + A_ff_array[lev] = ((hypre_ParAMGData*) aff_solver[lev]) -> A_array[0]; + } + else + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "F-relaxation solver has not been setup\n"); + HYPRE_ANNOTATE_FUNC_END; + hypre_GpuProfilingPopRange(); + hypre_GpuProfilingPopRange(); + + return hypre_error_flag; + } + } + else /* F-relaxation solver prescribed but not set up */ + { + /* Save A_FF splitting */ + A_ff_array[lev] = A_FF; + + /* Setup F-solver */ + fgrid_solver_setup(aff_solver[lev], + A_ff_array[lev], + F_fine_array[lev + 1], + U_fine_array[lev + 1]); + (mgr_data -> fsolver_mode) = 1; + } + } + else if (aff_solver[lev]) { - isCpoint = 1; - break; + hypre_sprintf(msg, "Warning!! User-prescribed F-solver for the first level\n\ + reduction (set in HYPRE_MGRSetFSolver()) only supports AMG\n\ + Ignoring this call and using user prescribed Frelax_type %d", + Frelax_type[lev]); + hypre_error_w_msg(0, msg); } - } - if (!isCpoint) - { - level_coarse_indexes[j][level_coarse_size[j]++] = local_row; - } - } - } - } - } - - (mgr_data -> level_coarse_indexes) = level_coarse_indexes; - (mgr_data -> num_coarse_per_level) = level_coarse_size; - - /* Free Previously allocated data, if any not destroyed */ - if (A_array || P_array || RT_array || CF_marker_array) - { - for (j = 1; j < (old_num_coarse_levels); j++) - { - if (A_array[j]) - { - hypre_ParCSRMatrixDestroy(A_array[j]); - A_array[j] = NULL; - } - } - - for (j = 0; j < old_num_coarse_levels; j++) - { - if (P_array[j]) - { - hypre_ParCSRMatrixDestroy(P_array[j]); - P_array[j] = NULL; - } - - if (RT_array[j]) - { - hypre_ParCSRMatrixDestroy(RT_array[j]); - RT_array[j] = NULL; - } - - if (CF_marker_array[j]) - { - hypre_IntArrayDestroy(CF_marker_array[j]); - CF_marker_array[j] = NULL; - } - } - hypre_TFree(P_array, HYPRE_MEMORY_HOST); - P_array = NULL; - hypre_TFree(RT_array, HYPRE_MEMORY_HOST); - RT_array = NULL; - hypre_TFree(CF_marker_array, HYPRE_MEMORY_HOST); - CF_marker_array = NULL; - } - - /* Free previously allocated FrelaxVcycleData if not destroyed */ - if ((mgr_data -> VcycleRelaxZtemp)) - { - hypre_ParVectorDestroy((mgr_data -> VcycleRelaxZtemp)); - (mgr_data -> VcycleRelaxZtemp) = NULL; - } - if ((mgr_data -> VcycleRelaxVtemp)) - { - hypre_ParVectorDestroy((mgr_data -> VcycleRelaxVtemp)); - (mgr_data -> VcycleRelaxVtemp) = NULL; - } - if ((mgr_data -> FrelaxVcycleData)) - { - for (j = 0; j < old_num_coarse_levels; j++) - { - if ((mgr_data -> FrelaxVcycleData)[j]) - { - hypre_MGRDestroyFrelaxVcycleData((mgr_data -> FrelaxVcycleData)[j]); - (mgr_data -> FrelaxVcycleData)[j] = NULL; - } - } - hypre_TFree((mgr_data -> FrelaxVcycleData), HYPRE_MEMORY_HOST); - (mgr_data -> FrelaxVcycleData) = NULL; - } - - /* destroy final coarse grid matrix, if not previously destroyed */ - if((mgr_data -> RAP)) - { - hypre_ParCSRMatrixDestroy((mgr_data -> RAP)); - (mgr_data -> RAP) = NULL; - } - - /* Setup for global block smoothers*/ - if (set_c_points_method == 0) - { - if (my_id == num_procs) - { - mgr_data -> n_block = (n - reserved_coarse_size) / block_size; - mgr_data -> left_size = n - block_size*(mgr_data -> n_block); - } - else - { - mgr_data -> n_block = n / block_size; - mgr_data -> left_size = n - block_size*(mgr_data -> n_block); - } - } - else - { - mgr_data -> n_block = n; - mgr_data -> left_size = 0; - } - //wall_time = time_getWallclockSeconds(); - if (global_smooth_iters > 0) - { - if (global_smooth_type == 0) - { - if (set_c_points_method == 0) - { - hypre_blockRelax_setup(A,block_size,reserved_coarse_size,&(mgr_data -> diaginv)); + } + else if (aff_solver[lev]) + { + aff_base = (hypre_Solver*) aff_solver[lev]; + + /* Save A_FF splitting */ + A_ff_array[lev] = A_FF; + + /* Call setup function */ + hypre_SolverSetup(aff_base)((HYPRE_Solver) aff_solver[lev], + (HYPRE_Matrix) A_ff_array[lev], + (HYPRE_Vector) F_fine_array[lev + 1], + (HYPRE_Vector) U_fine_array[lev + 1]); + } + else if (Frelax_type[lev] == 2) /* Construct default AMG solver */ + { + /* Save A_FF splitting */ + A_ff_array[lev] = A_FF; + + /* Create BoomerAMG solver for A_FF */ + aff_solver[lev] = (HYPRE_Solver*) hypre_BoomerAMGCreate(); + hypre_BoomerAMGSetMaxIter(aff_solver[lev], (mgr_data -> num_relax_sweeps)[lev]); + hypre_BoomerAMGSetTol(aff_solver[lev], 0.0); + //hypre_BoomerAMGSetStrongThreshold(aff_solver[lev], 0.6); +#if defined(HYPRE_USING_GPU) + hypre_BoomerAMGSetRelaxType(aff_solver[lev], 18); + hypre_BoomerAMGSetCoarsenType(aff_solver[lev], 8); + hypre_BoomerAMGSetNumSweeps(aff_solver[lev], 3); +#else + hypre_BoomerAMGSetRelaxOrder(aff_solver[lev], 1); +#endif + hypre_BoomerAMGSetPrintLevel(aff_solver[lev], mgr_data -> frelax_print_level); + + fgrid_solver_setup(aff_solver[lev], + A_ff_array[lev], + F_fine_array[lev + 1], + U_fine_array[lev + 1]); + + (mgr_data -> fsolver_mode) = 2; + } + else + { + /* Save A_FF splitting */ + A_ff_array[lev] = A_FF; + } + + /* TODO: Check use of A_ff_array[lev], vectors at (lev + 1) are correct? (VPM) */ + if (!F_fine_array[lev + 1]) + { + F_fine_array[lev + 1] = + hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A_ff_array[lev]), + hypre_ParCSRMatrixGlobalNumRows(A_ff_array[lev]), + hypre_ParCSRMatrixRowStarts(A_ff_array[lev])); + hypre_ParVectorInitialize(F_fine_array[lev + 1]); + } + + if (!U_fine_array[lev + 1]) + { + U_fine_array[lev + 1] = + hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A_ff_array[lev]), + hypre_ParCSRMatrixGlobalNumRows(A_ff_array[lev]), + hypre_ParCSRMatrixRowStarts(A_ff_array[lev])); + hypre_ParVectorInitialize(U_fine_array[lev + 1]); + } } - else + + /* TODO: refactor this block (VPM) */ +#if defined (HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_DEVICE) { - hypre_blockRelax_setup(A,1,reserved_coarse_size,&(mgr_data -> diaginv)); - } - } - else if (global_smooth_type == 8) - { - HYPRE_EuclidCreate(comm, &(mgr_data -> global_smoother)); - HYPRE_EuclidSetLevel(mgr_data -> global_smoother, 0); - HYPRE_EuclidSetBJ(mgr_data -> global_smoother, 1); - HYPRE_EuclidSetup(mgr_data -> global_smoother, A, f, u); - } - else if (global_smooth_type == 16) - { - HYPRE_ILUCreate(&(mgr_data -> global_smoother)); - HYPRE_ILUSetType(mgr_data -> global_smoother, 0); - HYPRE_ILUSetLevelOfFill(mgr_data -> global_smoother, 0); - HYPRE_ILUSetMaxIter(mgr_data -> global_smoother, global_smooth_iters); - HYPRE_ILUSetTol(mgr_data -> global_smoother, 0.0); - HYPRE_ILUSetup(mgr_data -> global_smoother, A, f, u); - } - } - //wall_time = time_getWallclockSeconds() - wall_time; - //hypre_printf("Proc = %d Global smoother setup: %f\n", my_id, wall_time); - - /* clear old l1_norm data, if created */ - if((mgr_data -> l1_norms)) - { - for (j = 0; j < (old_num_coarse_levels); j++) - { - if ((mgr_data -> l1_norms)[j]) - { - hypre_SeqVectorDestroy((mgr_data -> l1_norms)[i]); - //hypre_TFree((mgr_data -> l1_norms)[j], HYPRE_MEMORY_HOST); - (mgr_data -> l1_norms)[j] = NULL; - } - } - hypre_TFree((mgr_data -> l1_norms), HYPRE_MEMORY_HOST); - } - - /* setup temporary storage */ - if ((mgr_data -> Ztemp)) - { - hypre_ParVectorDestroy((mgr_data -> Ztemp)); - (mgr_data -> Ztemp) = NULL; - } - if ((mgr_data -> Vtemp)) - { - hypre_ParVectorDestroy((mgr_data -> Vtemp)); - (mgr_data -> Vtemp) = NULL; - } - if ((mgr_data -> Utemp)) - { - hypre_ParVectorDestroy((mgr_data -> Utemp)); - (mgr_data -> Utemp) = NULL; - } - if ((mgr_data -> Ftemp)) - { - hypre_ParVectorDestroy((mgr_data -> Ftemp)); - (mgr_data -> Ftemp) = NULL; - } - if ((mgr_data -> residual)) - { - hypre_ParVectorDestroy((mgr_data -> residual)); - (mgr_data -> residual) = NULL; - } - if ((mgr_data -> rel_res_norms)) - { - hypre_TFree((mgr_data -> rel_res_norms), HYPRE_MEMORY_HOST); - (mgr_data -> rel_res_norms) = NULL; - } - - Vtemp = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A), - hypre_ParCSRMatrixGlobalNumRows(A), - hypre_ParCSRMatrixRowStarts(A)); - hypre_ParVectorInitialize(Vtemp); - (mgr_data ->Vtemp) = Vtemp; - - Ztemp = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A), - hypre_ParCSRMatrixGlobalNumRows(A), - hypre_ParCSRMatrixRowStarts(A)); - hypre_ParVectorInitialize(Ztemp); - (mgr_data -> Ztemp) = Ztemp; - - Utemp = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A), - hypre_ParCSRMatrixGlobalNumRows(A), - hypre_ParCSRMatrixRowStarts(A)); - hypre_ParVectorInitialize(Utemp); - (mgr_data ->Utemp) = Utemp; - - Ftemp = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A), - hypre_ParCSRMatrixGlobalNumRows(A), - hypre_ParCSRMatrixRowStarts(A)); - hypre_ParVectorInitialize(Ftemp); - (mgr_data ->Ftemp) = Ftemp; - - /* Allocate memory for level structure */ - if (A_array == NULL) - A_array = hypre_CTAlloc(hypre_ParCSRMatrix*, max_num_coarse_levels, HYPRE_MEMORY_HOST); - if (P_array == NULL && max_num_coarse_levels > 0) - P_array = hypre_CTAlloc(hypre_ParCSRMatrix*, max_num_coarse_levels, HYPRE_MEMORY_HOST); - if (RT_array == NULL && max_num_coarse_levels > 0) - RT_array = hypre_CTAlloc(hypre_ParCSRMatrix*, max_num_coarse_levels, HYPRE_MEMORY_HOST); - if (CF_marker_array == NULL) - CF_marker_array = hypre_CTAlloc(hypre_IntArray*, max_num_coarse_levels, HYPRE_MEMORY_HOST); - - /* Set default for Frelax_method and Frelax_num_functions if not set already */ - if (Frelax_method == NULL) - { - Frelax_method = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, HYPRE_MEMORY_HOST); - for (i = 0; i < max_num_coarse_levels; i++) - { - Frelax_method[i] = 0; - } - (mgr_data -> Frelax_method) = Frelax_method; - } - /* Set default for using non-Galerkin coarse grid */ - if (use_non_galerkin_cg == NULL) - { - use_non_galerkin_cg = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, HYPRE_MEMORY_HOST); - for (i = 0; i < max_num_coarse_levels; i++) - { - use_non_galerkin_cg[i] = 0; - } - (mgr_data -> use_non_galerkin_cg) = use_non_galerkin_cg; - } - - /* - if (Frelax_num_functions== NULL) - { - Frelax_num_functions = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, HYPRE_MEMORY_HOST); - for (i = 0; i < max_num_coarse_levels; i++) - { - Frelax_num_functions[i] = 1; - } - (mgr_data -> Frelax_num_functions) = Frelax_num_functions; - } - */ - /* Set default for interp_type and restrict_type if not set already */ - if (interp_type == NULL) - { - interp_type = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, HYPRE_MEMORY_HOST); - for (i = 0; i < max_num_coarse_levels; i++) - { - interp_type[i] = 2; - } - (mgr_data -> interp_type) = interp_type; - } - if (restrict_type == NULL) - { - restrict_type = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, HYPRE_MEMORY_HOST); - for (i = 0; i < max_num_coarse_levels; i++) - { - (mgr_data -> restrict_type) = 0; - } - (mgr_data -> restrict_type) = restrict_type; - } - - /* set interp_type, restrict_type, and Frelax_method if we reduce the reserved C-points */ - reserved_cpoints_eliminated = 0; - if (lvl_to_keep_cpoints > 0 && reserved_coarse_size > 0) - { - HYPRE_Int *level_interp_type = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, HYPRE_MEMORY_HOST); - HYPRE_Int *level_restrict_type = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, HYPRE_MEMORY_HOST); - HYPRE_Int *level_frelax_method = hypre_CTAlloc(HYPRE_Int, max_num_coarse_levels, HYPRE_MEMORY_HOST); - for (i=0; i < max_num_coarse_levels; i++) - { - if (i == lvl_to_keep_cpoints) - { - level_interp_type[i] = 2; - level_restrict_type[i] = 0; - level_frelax_method[i] = 99; - reserved_cpoints_eliminated++; + hypre_MGRBuildPDevice(A_array[lev], hypre_IntArrayData(FC_marker), + row_starts_fpts, 0, &P_FF_array[lev]); } - else +#endif + + /* Destroy A_FF if it has not been saved on A_ff_array[lev] */ + if (!A_ff_array[lev]) { - level_interp_type[i] = interp_type[i - reserved_cpoints_eliminated]; - level_restrict_type[i] = restrict_type[i - reserved_cpoints_eliminated]; - level_frelax_method[i] = Frelax_method[i - reserved_cpoints_eliminated]; - } - } - hypre_TFree(interp_type, HYPRE_MEMORY_HOST); - hypre_TFree(restrict_type, HYPRE_MEMORY_HOST); - hypre_TFree(Frelax_method, HYPRE_MEMORY_HOST); - interp_type = level_interp_type; - restrict_type = level_restrict_type; - Frelax_method = level_frelax_method; - (mgr_data -> interp_type) = level_interp_type; - (mgr_data -> restrict_type) = level_restrict_type; - (mgr_data -> Frelax_method) = level_frelax_method; - } - - /* set pointers to mgr data */ - (mgr_data -> A_array) = A_array; - (mgr_data -> P_array) = P_array; - (mgr_data -> RT_array) = RT_array; - (mgr_data -> CF_marker_array) = CF_marker_array; - - /* Set up solution and rhs arrays */ - if (F_array != NULL || U_array != NULL) - { - for (j = 1; j < old_num_coarse_levels+1; j++) - { - if (F_array[j] != NULL) - { - hypre_ParVectorDestroy(F_array[j]); - F_array[j] = NULL; - } - if (U_array[j] != NULL) - { - hypre_ParVectorDestroy(U_array[j]); - U_array[j] = NULL; - } - } - } - - if (F_array == NULL) - F_array = hypre_CTAlloc(hypre_ParVector*, max_num_coarse_levels+1, HYPRE_MEMORY_HOST); - if (U_array == NULL) - U_array = hypre_CTAlloc(hypre_ParVector*, max_num_coarse_levels+1, HYPRE_MEMORY_HOST); - - if (A_ff_array) - { - for (j = 0; j < old_num_coarse_levels - 1; j++) - { - if (A_ff_array[j]) - { - hypre_ParCSRMatrixDestroy(A_ff_array[j]); - A_ff_array[j] = NULL; - } - } - hypre_TFree(A_ff_array, HYPRE_MEMORY_HOST); - A_ff_array = NULL; - } - if ((mgr_data -> fine_grid_solver_setup) != NULL) - { - fine_grid_solver_setup = (mgr_data -> fine_grid_solver_setup); - } - else - { - fine_grid_solver_setup = (HYPRE_Int (*)(void*, void*, void*, void*)) hypre_BoomerAMGSetup; - (mgr_data -> fine_grid_solver_setup) = fine_grid_solver_setup; - } - if ((mgr_data -> fine_grid_solver_solve) != NULL) - { - fine_grid_solver_solve = (mgr_data -> fine_grid_solver_solve); - } - else - { - fine_grid_solver_solve = (HYPRE_Int (*)(void*, void*, void*, void*)) hypre_BoomerAMGSolve; - (mgr_data -> fine_grid_solver_solve) = fine_grid_solver_solve; - } - - - /* Set up solution and rhs arrays for Frelax */ - if (F_fine_array != NULL || U_fine_array != NULL) - { - for (j = 1; j < old_num_coarse_levels+1; j++) - { - if (F_fine_array[j] != NULL) - { - hypre_ParVectorDestroy(F_fine_array[j]); - F_fine_array[j] = NULL; - } - if (U_fine_array[j] != NULL) - { - hypre_ParVectorDestroy(U_fine_array[j]); - U_fine_array[j] = NULL; - } - } - } - - if (F_fine_array == NULL) - F_fine_array = hypre_CTAlloc(hypre_ParVector*, max_num_coarse_levels+1, HYPRE_MEMORY_HOST); - if (U_fine_array == NULL) - U_fine_array = hypre_CTAlloc(hypre_ParVector*, max_num_coarse_levels+1, HYPRE_MEMORY_HOST); - if (aff_solver == NULL) - aff_solver = hypre_CTAlloc(HYPRE_Solver*, max_num_coarse_levels, HYPRE_MEMORY_HOST); - if (A_ff_array == NULL) - A_ff_array = hypre_CTAlloc(hypre_ParCSRMatrix*, max_num_coarse_levels, HYPRE_MEMORY_HOST); - - /* set solution and rhs pointers */ - F_array[0] = f; - U_array[0] = u; - - (mgr_data -> F_array) = F_array; - (mgr_data -> U_array) = U_array; - - (mgr_data -> F_fine_array) = F_fine_array; - (mgr_data -> U_fine_array) = U_fine_array; - (mgr_data -> aff_solver) = aff_solver; - (mgr_data -> A_ff_array) = A_ff_array; - - /* begin coarsening loop */ - num_coarsening_levs = max_num_coarse_levels; - /* initialize level data matrix here */ - RAP_ptr = A; - /* loop over levels of coarsening */ - for(lev = 0; lev < num_coarsening_levs; lev++) - { - /* check if this is the last level */ - last_level = ((lev == num_coarsening_levs-1)); - - /* initialize A_array */ - A_array[lev] = RAP_ptr; - nloc = hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(A_array[lev])); - - /* Compute strength matrix for interpolation operator - use default parameters, to be modified later */ - hypre_BoomerAMGCreateS(A_array[lev], strong_threshold, max_row_sum, 1, NULL, &S); - - /* Coarsen: Build CF_marker array based on rows of A */ - cflag = ((last_level || setNonCpointToF)); - hypre_MGRCoarsen(S, A_array[lev], level_coarse_size[lev], level_coarse_indexes[lev],debug_flag, &CF_marker_array[lev], cflag); - CF_marker = hypre_IntArrayData(CF_marker_array[lev]); - - /* - char fname[256]; - sprintf(fname,"CF_marker_lvl_%d_new.%05d", lev, my_id); - FILE* fout; - fout = fopen(fname,"w"); - for (i=0; i < nloc; i++) - { - fprintf(fout, "%d %d\n", i, CF_marker_array[lev][i]); - } - fclose(fout); - */ - - /* Get global coarse sizes. Note that we assume num_functions = 1 - * so dof_func arrays are NULL */ - hypre_BoomerAMGCoarseParms(comm, nloc, 1, NULL, CF_marker_array[lev], &dof_func_buff, &coarse_pnts_global); - if (dof_func_buff) - { - dof_func_buff_data = hypre_IntArrayData(dof_func_buff); - } - /* Compute Petrov-Galerkin operators */ - /* Interpolation operator */ - num_interp_sweeps = (mgr_data -> num_interp_sweeps); - - if (interp_type[lev] == 99) - { - //wall_time = time_getWallclockSeconds(); - hypre_MGRBuildInterp(A_array[lev], CF_marker, A_ff_inv, coarse_pnts_global, 1, dof_func_buff_data, - debug_flag, trunc_factor, max_elmts, &P, interp_type[lev], num_interp_sweeps); - //wall_time = time_getWallclockSeconds() - wall_time; - //hypre_printf("Proc = %d BuildInterp: %f\n", my_id, wall_time); - } - else - { - hypre_MGRBuildInterp(A_array[lev], CF_marker, S, coarse_pnts_global, 1, dof_func_buff_data, - debug_flag, trunc_factor, max_elmts, &P, interp_type[lev], num_interp_sweeps); - } - - P_array[lev] = P; - - if (restrict_type[lev] == 4) - use_air = 1; - else if (restrict_type[lev] == 5) - use_air = 2; - else - use_air = 0; - - if(use_air) - { - HYPRE_Real filter_thresholdR = 0.0; - HYPRE_Int gmres_switch = 64; - HYPRE_Int is_triangular = 0; - - /* for AIR, need absolute value SOC */ - - hypre_BoomerAMGCreateSabs(A_array[lev], strong_threshold, 1.0, 1, NULL, &ST); - - /* !!! Ensure that CF_marker contains -1 or 1 !!! */ - /* - for (i = 0; i < hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(A_array[level])); i++) + hypre_ParCSRMatrixDestroy(A_FF); + } + A_FF = NULL; + hypre_IntArrayDestroy(FC_marker); + + /* TODO: move this to par_mgr_coarsen.c and port to GPUs (VPM) */ + /* Update coarse level indexes for next levels */ + if (lev < num_coarsening_levs - 1) { - CF_marker[i] = CF_marker[i] > 0 ? 1 : -1; + for (i = lev + 1; i < max_num_coarse_levels; i++) + { + memory_location = hypre_IntArrayMemoryLocation(CF_marker_array[lev]); + if (hypre_GetActualMemLocation(memory_location) == hypre_MEMORY_DEVICE) + { + hypre_IntArrayMigrate(CF_marker_array[lev], HYPRE_MEMORY_HOST); + } + CF_marker = hypre_IntArrayData(CF_marker_array[lev]); + + /* First mark indexes to be updated */ + for (j = 0; j < level_coarse_size[i]; j++) + { + CF_marker[level_coarse_indexes[i][j]] = S_CMRK; + } + + /* Next: loop over levels to update indexes */ + nc = 0; + index_i = 0; + for (j = 0; j < nloc; j++) + { + if (CF_marker[j] == CMRK) + { + nc++; + } + if (CF_marker[j] == S_CMRK) + { + level_coarse_indexes[i][index_i++] = nc++; + } + //if(index_i == level_coarse_size[i]) break; + } + hypre_assert(index_i == level_coarse_size[i]); + + // then: reset previously marked indexes + for (j = 0; j < level_coarse_size[lev]; j++) + { + CF_marker[level_coarse_indexes[lev][j]] = CMRK; + } + + if (hypre_GetActualMemLocation(memory_location) == hypre_MEMORY_DEVICE) + { + hypre_IntArrayMigrate(CF_marker_array[lev], HYPRE_MEMORY_DEVICE); + } + } } - */ - if (use_air == 1) /* distance-1 AIR */ + + /* Update reserved coarse indexes to be kept to coarsest level + * first mark indexes to be updated + * skip if we reduce the reserved C-points before the coarse grid solve */ + if (mgr_data -> lvl_to_keep_cpoints == 0) + { + memory_location = hypre_IntArrayMemoryLocation(CF_marker_array[lev]); + if (hypre_GetActualMemLocation(memory_location) == hypre_MEMORY_DEVICE) + { + hypre_IntArrayMigrate(CF_marker_array[lev], HYPRE_MEMORY_HOST); + } + CF_marker = hypre_IntArrayData(CF_marker_array[lev]); + + for (i = 0; i < reserved_coarse_size; i++) + { + CF_marker[reserved_Cpoint_local_indexes[i]] = S_CMRK; + } + + /* loop to update reserved Cpoints */ + nc = 0; + index_i = 0; + for (i = 0; i < nloc; i++) + { + if (CF_marker[i] == CMRK) + { + nc++; + } + if (CF_marker[i] == S_CMRK) + { + reserved_Cpoint_local_indexes[index_i++] = nc++; + + /* reset modified CF marker array indexes */ + CF_marker[i] = CMRK; + } + } + + if (hypre_GetActualMemLocation(memory_location) == hypre_MEMORY_DEVICE) + { + hypre_IntArrayMigrate(CF_marker_array[lev], HYPRE_MEMORY_DEVICE); + } + } + + /* allocate space for solution and rhs arrays */ + F_array[lev + 1] = + hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A_array[lev + 1]), + hypre_ParCSRMatrixGlobalNumRows(A_array[lev + 1]), + hypre_ParCSRMatrixRowStarts(A_array[lev + 1])); + hypre_ParVectorInitialize(F_array[lev + 1]); + + U_array[lev + 1] = + hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A_array[lev + 1]), + hypre_ParCSRMatrixGlobalNumRows(A_array[lev + 1]), + hypre_ParCSRMatrixRowStarts(A_array[lev + 1])); + hypre_ParVectorInitialize(U_array[lev + 1]); + + /* free memory before starting next level */ + hypre_ParCSRMatrixDestroy(S); S = NULL; + + /* check if Vcycle smoother setup required */ + if ((mgr_data -> max_local_lvls) > 1) + { + if (Frelax_type[lev] == 1) + { + use_VcycleSmoother = 1; + // use_ComplexSmoother = 1; + } + } + else { - hypre_BoomerAMGBuildRestrAIR(A_array[lev], CF_marker, - ST, coarse_pnts_global, 1, - dof_func_buff_data, filter_thresholdR, - debug_flag, &RT, - is_triangular, gmres_switch); + /* Only check for vcycle smoother option. + * Currently leaves Frelax_type[lev] = 2 (full amg) option as is */ + if (Frelax_type[lev] == 1) + { + Frelax_type[lev] = 0; + } } - else /* distance-1.5 AIR - distance 2 locally and distance 1 across procs. */ + + if (Frelax_type[lev] == 9 || + Frelax_type[lev] == 99 || + Frelax_type[lev] == 199 ) { - hypre_BoomerAMGBuildRestrDist2AIR(A_array[lev], CF_marker, - ST, coarse_pnts_global, 1, - dof_func_buff_data, debug_flag, filter_thresholdR, - &RT, - 1, is_triangular, gmres_switch ); + use_GSElimSmoother = 1; } - RT_array[lev] = RT; + hypre_sprintf(region_name, "%s-%d", "MGR_Level", lev); + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_REGION_END("%s", region_name); - /* Use two matrix products to generate A_H */ - hypre_ParCSRMatrix *AP = NULL; - AP = hypre_ParMatmul(A_array[lev], P_array[lev]); - RAP_ptr = hypre_ParMatmul(RT, AP); - if (num_procs > 1) + /* check if last level */ + if (last_level) { - hypre_MatvecCommPkgCreate(RAP_ptr); + num_c_levels = lev + 1; + lev = num_coarsening_levs; } - /* Delete AP */ - hypre_ParCSRMatrixDestroy(AP); - } - else - { - hypre_MGRBuildRestrict(A_array[lev], CF_marker, coarse_pnts_global, 1, dof_func_buff_data, - debug_flag, trunc_factor, max_elmts, strong_threshold, max_row_sum, &RT, - restrict_type[lev], num_restrict_sweeps); + } - RT_array[lev] = RT; + /* set pointer to last level matrix */ + (mgr_data -> num_coarse_levels) = num_c_levels; - /* Compute RAP for next level */ - if (use_non_galerkin_cg[lev] != 0) + /* setup default coarsest grid solver (BoomerAMG) */ + if (use_default_cgrid_solver) + { + if (my_id == 0 && print_level > 0) { - HYPRE_Int block_num_f_points = (lev == 0 ? block_size : block_num_coarse_indexes[lev-1]) - block_num_coarse_indexes[lev]; - hypre_MGRComputeNonGalerkinCoarseGrid(A_array[lev], P, RT, block_num_f_points, - /* ordering */set_c_points_method, /* method (approx. inverse or not) */ 0, max_elmts, /* keep_stencil */ 0, CF_marker, &RAP_ptr); + hypre_printf("No coarse grid solver provided. Using default AMG solver ... \n"); } - else + + /* create and set default solver parameters here */ + default_cg_solver = (HYPRE_Solver) hypre_BoomerAMGCreate(); + hypre_BoomerAMGSetMaxIter(default_cg_solver, 1); + hypre_BoomerAMGSetTol(default_cg_solver, 0.0); + hypre_BoomerAMGSetRelaxOrder(default_cg_solver, 1); + hypre_BoomerAMGSetPrintLevel(default_cg_solver, mgr_data -> cg_print_level); + + /* set setup and solve functions */ + cgrid_solver_setup = (HYPRE_Int (*)(void*, void*, void*, void*)) hypre_BoomerAMGSetup; + cgrid_solver_solve = (HYPRE_Int (*)(void*, void*, void*, void*)) hypre_BoomerAMGSolve; + (mgr_data -> coarse_grid_solver_setup) = cgrid_solver_setup; + (mgr_data -> coarse_grid_solver_solve) = cgrid_solver_solve; + (mgr_data -> coarse_grid_solver) = default_cg_solver; + } + + /* keep reserved coarse indexes to coarsest grid */ + if (reserved_coarse_size > 0 && lvl_to_keep_cpoints == 0) + { + ilower = hypre_ParCSRMatrixFirstRowIndex(A_array[num_c_levels]); + for (i = 0; i < reserved_coarse_size; i++) { - hypre_BoomerAMGBuildCoarseOperator(RT, A_array[lev], P, &RAP_ptr); - } - } - - // truncate the coarse grid - hypre_ParCSRMatrixTruncate(RAP_ptr, truncate_cg_threshold, 0, 0, 0); - - if (Frelax_method[lev] == 2) // full AMG - { - // user provided AMG solver - // only support AMG at the first level - // TODO: input check to avoid crashing - if (lev == 0 && use_default_fsolver == 0) - { - if (((hypre_ParAMGData*)aff_solver[0])->A_array[0] == NULL) - { - if (my_id == 0) - { - printf("Error!!! F-relaxation solver has not been setup.\n"); - hypre_error(1); - return hypre_error_flag; - } - } - A_ff_ptr = ((hypre_ParAMGData*)aff_solver[0])->A_array[0]; - - F_fine_array[lev+1] = - hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A_ff_ptr), - hypre_ParCSRMatrixGlobalNumRows(A_ff_ptr), - hypre_ParCSRMatrixRowStarts(A_ff_ptr)); - hypre_ParVectorInitialize(F_fine_array[lev+1]); - - U_fine_array[lev+1] = - hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A_ff_ptr), - hypre_ParCSRMatrixGlobalNumRows(A_ff_ptr), - hypre_ParCSRMatrixRowStarts(A_ff_ptr)); - hypre_ParVectorInitialize(U_fine_array[lev+1]); - A_ff_array[lev] = A_ff_ptr; - } - else // construct default AMG solver - { - hypre_MGRBuildAff(A_array[lev], CF_marker, debug_flag, &A_ff_ptr); - - F_fine_array[lev+1] = - hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A_ff_ptr), - hypre_ParCSRMatrixGlobalNumRows(A_ff_ptr), - hypre_ParCSRMatrixRowStarts(A_ff_ptr)); - hypre_ParVectorInitialize(F_fine_array[lev+1]); - - U_fine_array[lev+1] = - hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A_ff_ptr), - hypre_ParCSRMatrixGlobalNumRows(A_ff_ptr), - hypre_ParCSRMatrixRowStarts(A_ff_ptr)); - hypre_ParVectorInitialize(U_fine_array[lev+1]); - A_ff_array[lev] = A_ff_ptr; - - aff_solver[lev] = (HYPRE_Solver*) hypre_BoomerAMGCreate(); - hypre_BoomerAMGSetMaxIter(aff_solver[lev], mgr_data -> num_relax_sweeps); - hypre_BoomerAMGSetTol(aff_solver[lev], 0.0); - hypre_BoomerAMGSetRelaxOrder(aff_solver[lev], 1); - //hypre_BoomerAMGSetAggNumLevels(aff_solver[lev], 1); - hypre_BoomerAMGSetNumSweeps(aff_solver[lev], 3); - hypre_BoomerAMGSetPrintLevel(aff_solver[lev], mgr_data -> frelax_print_level); - hypre_BoomerAMGSetNumFunctions(aff_solver[lev], 1); - - fine_grid_solver_setup(aff_solver[lev], A_ff_ptr, F_fine_array[lev+1], U_fine_array[lev+1]); - - (mgr_data -> use_default_fsolver) = 1; - use_default_fsolver = (mgr_data -> use_default_fsolver); - } - - } - - /* Update coarse level indexes for next levels */ - if (lev < num_coarsening_levs - 1) - { - for(i=lev+1; i lvl_to_keep_cpoints == 0) - { - for(i=0; i max_local_lvls) > 1) - { - if(Frelax_method[lev] == 1) - { - use_VcycleSmoother = 1; - } - } - else - { - /* Only check for vcycle smoother option. - * Currently leaves Frelax_method[lev] = 99 (full amg) option as is - */ - if(Frelax_method[lev] == 1) - { - Frelax_method[lev] = 0; - } - } - - /* check if last level */ - if(last_level) break; - } - - /* set pointer to last level matrix */ - num_c_levels = lev+1; - (mgr_data->num_coarse_levels) = num_c_levels; - (mgr_data->RAP) = RAP_ptr; - - /* setup default coarse grid solver */ - /* default is BoomerAMG */ - if(use_default_cgrid_solver) - { - if (my_id == 0 && print_level > 0) - hypre_printf("No coarse grid solver provided. Using default AMG solver ... \n"); - - /* create and set default solver parameters here */ - default_cg_solver = (HYPRE_Solver) hypre_BoomerAMGCreate(); - hypre_BoomerAMGSetMaxIter ( default_cg_solver, 1 ); - hypre_BoomerAMGSetTol ( default_cg_solver, 0.0 ); - hypre_BoomerAMGSetRelaxOrder( default_cg_solver, 1); - hypre_BoomerAMGSetPrintLevel(default_cg_solver, mgr_data -> cg_print_level); - /* set setup and solve functions */ - coarse_grid_solver_setup = (HYPRE_Int (*)(void*, void*, void*, void*)) hypre_BoomerAMGSetup; - coarse_grid_solver_solve = (HYPRE_Int (*)(void*, void*, void*, void*)) hypre_BoomerAMGSolve; - (mgr_data -> coarse_grid_solver_setup) = coarse_grid_solver_setup; - (mgr_data -> coarse_grid_solver_solve) = coarse_grid_solver_solve; - (mgr_data -> coarse_grid_solver) = default_cg_solver; - } - // keep reserved coarse indexes to coarsest grid - if(reserved_coarse_size > 0 && lvl_to_keep_cpoints == 0) - { - ilower = hypre_ParCSRMatrixFirstRowIndex(RAP_ptr); - for (i = 0; i < reserved_coarse_size; i++) - { - reserved_coarse_indexes[i] = (HYPRE_BigInt) (reserved_Cpoint_local_indexes[i] + ilower); - } - HYPRE_BoomerAMGSetCPoints((mgr_data ->coarse_grid_solver), 25, reserved_coarse_size, reserved_coarse_indexes); - } - - /* setup coarse grid solver */ - //wall_time = time_getWallclockSeconds(); - coarse_grid_solver_setup((mgr_data -> coarse_grid_solver), RAP_ptr, F_array[num_c_levels], U_array[num_c_levels]); - //hypre_ParCSRMatrixPrintIJ(RAP_ptr,1,1,"RAP"); - //wall_time = time_getWallclockSeconds() - wall_time; - //hypre_printf("Proc = %d Coarse grid setup: %f\n", my_id, wall_time); - - /* Setup smoother for fine grid */ - if ( relax_type == 8 || relax_type == 13 || relax_type == 14 || relax_type == 18 ) - { - l1_norms = hypre_CTAlloc(hypre_Vector*, num_c_levels, HYPRE_MEMORY_HOST); - (mgr_data -> l1_norms) = l1_norms; + reserved_coarse_indexes[i] = (HYPRE_BigInt) (reserved_Cpoint_local_indexes[i] + ilower); + } + HYPRE_BoomerAMGSetCPoints((mgr_data ->coarse_grid_solver), + 25, reserved_coarse_size, + reserved_coarse_indexes); } + /* Setup coarse grid solver */ + hypre_sprintf(region_name, "%s-%d", "MGR_Level", num_c_levels); + hypre_GpuProfilingPushRange(region_name); + HYPRE_ANNOTATE_REGION_BEGIN("%s", region_name); + + cgrid_solver_setup((mgr_data -> coarse_grid_solver), + A_array[num_c_levels], + F_array[num_c_levels], + U_array[num_c_levels]); + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_REGION_END("%s", region_name); + + /* Allocate l1_norms when necessary + TODO (VPM): move this block closer to global smoother setup */ for (j = 0; j < num_c_levels; j++) { - HYPRE_Real *l1_norm_data = NULL; - CF_marker = hypre_IntArrayData(CF_marker_array[j]); - - if (relax_type == 8 || relax_type == 13 || relax_type == 14) + if (!l1_norms[j]) { - if (relax_order) - { - hypre_ParCSRComputeL1Norms(A_array[j], 4, CF_marker, &l1_norm_data); - } - else + /* Compute l1_norms according to relaxation type */ + hypre_BoomerAMGRelaxComputeL1Norms(A_array[j], Frelax_type[j], + relax_order, 0, CF_marker_array[j], + &l1_norms_data); + if (l1_norms_data) { - hypre_ParCSRComputeL1Norms(A_array[j], 4, NULL, &l1_norm_data); + l1_norms[j] = hypre_SeqVectorCreate(hypre_ParCSRMatrixNumRows(A_array[j])); + hypre_VectorData(l1_norms[j]) = l1_norms_data; + hypre_VectorMemoryLocation(l1_norms[j]) = memory_location; } } - else if (relax_type == 18) + } + + /* Setup Vcycle data for Frelax_type == 1 */ + if (use_VcycleSmoother) + { + /* allocate memory and set pointer to (mgr_data -> FrelaxVcycleData) */ + FrelaxVcycleData = hypre_TAlloc(hypre_ParAMGData*, max_num_coarse_levels, + HYPRE_MEMORY_HOST); + (mgr_data -> FrelaxVcycleData) = FrelaxVcycleData; + + /* Setup temporary storage - TODO (VPM): Use hypre_ParVectorInitialize_v2 */ + VcycleRelaxVtemp = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A), + hypre_ParCSRMatrixGlobalNumRows(A), + hypre_ParCSRMatrixRowStarts(A)); + hypre_ParVectorInitialize(VcycleRelaxVtemp); + (mgr_data ->VcycleRelaxVtemp) = VcycleRelaxVtemp; + + VcycleRelaxZtemp = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A), + hypre_ParCSRMatrixGlobalNumRows(A), + hypre_ParCSRMatrixRowStarts(A)); + hypre_ParVectorInitialize(VcycleRelaxZtemp); + (mgr_data -> VcycleRelaxZtemp) = VcycleRelaxZtemp; + + /* loop over levels */ + for (i = 0; i < (mgr_data->num_coarse_levels); i++) { - if (relax_order) + if (Frelax_type[i] == 1) { - hypre_ParCSRComputeL1Norms(A_array[j], 1, CF_marker, &l1_norm_data); + FrelaxVcycleData[i] = (hypre_ParAMGData*) hypre_MGRCreateFrelaxVcycleData(); + if (Frelax_num_functions != NULL) + { + hypre_ParAMGDataNumFunctions(FrelaxVcycleData[i]) = Frelax_num_functions[i]; + } + (FrelaxVcycleData[i] -> Vtemp) = VcycleRelaxVtemp; + (FrelaxVcycleData[i] -> Ztemp) = VcycleRelaxZtemp; + + /* Setup variables for the V-cycle in the F-relaxation step */ + hypre_MGRSetupFrelaxVcycleData(mgr_data, A_array[i], F_array[i], U_array[i], i); } - else + } + } + else if (use_GSElimSmoother) + { + /* Allocate memory and set pointer to (mgr_data -> GSElimData) */ + GSElimData = hypre_CTAlloc(hypre_ParAMGData*, max_num_coarse_levels, + HYPRE_MEMORY_HOST); + (mgr_data -> GSElimData) = GSElimData; + + /* loop over levels */ + for (i = 0; i < (mgr_data->num_coarse_levels); i++) + { + if (Frelax_type[i] == 9 || Frelax_type[i] == 99 || Frelax_type[i] == 199) { - hypre_ParCSRComputeL1Norms(A_array[j], 1, NULL, &l1_norm_data); + GSElimData[i] = (hypre_ParAMGData*) hypre_MGRCreateGSElimData(); + + // Set pointers to GSElimData. Here, all solvers point to the same array for + // A_ff_array, F_fine_array, and U_fine_array and will act on the appropriate + // components during setup and solve. We adjust {F/U}_fine_array to start at index 1 + // by definition of {F/U}_fine_array. + (GSElimData[i] -> A_array) = A_ff_array; + (GSElimData[i] -> F_array) = &F_fine_array[1]; + (GSElimData[i] -> U_array) = &U_fine_array[1]; + + /* Save current error code to a temporary variable */ + hypre_error_code_save(); + + // setup Gaussian Elim. in the F-relaxation step. Here, we apply GSElim at level 0 + // since we have a single matrix (and not an array of matrices). + // hypre_printf("Setting GSElim Solver %d \n", Frelax_type[i]); + hypre_GaussElimSetup(GSElimData[i], i, Frelax_type[i]); + + /* Fallback to Jacobi when Gaussian Elim. is not successful */ + if (HYPRE_GetGlobalError(hypre_ParCSRMatrixComm(A_array[i]))) + { + hypre_MGRDestroyGSElimData((mgr_data -> GSElimData)[i]); + (mgr_data -> GSElimData)[i] = NULL; + + Frelax_type[i] = 7; /* Jacobi */ + if (print_level) + { + hypre_ParPrintf(comm, "Switching F-relaxation at level %d to Jacobi", i); + } + + /* Compute l1_norms if needed */ + if (!l1_norms[i]) + { + hypre_BoomerAMGRelaxComputeL1Norms(A_array[i], Frelax_type[i], 0, 0, NULL, + &l1_norms_data); + if (l1_norms_data) + { + l1_norms[i] = hypre_SeqVectorCreate(hypre_ParCSRMatrixNumRows(A_array[i])); + hypre_VectorData(l1_norms[i]) = l1_norms_data; + hypre_VectorMemoryLocation(l1_norms[i]) = memory_location; + } + } + } + + /* Restore error code prior to GaussElimSetup call */ + hypre_error_code_restore(); } } + } + + if (logging > 1) + { + residual = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A_array[0]), + hypre_ParCSRMatrixGlobalNumRows(A_array[0]), + hypre_ParCSRMatrixRowStarts(A_array[0]) ); + hypre_ParVectorInitialize(residual); + (mgr_data -> residual) = residual; + } + else + { + (mgr_data -> residual) = NULL; + } + rel_res_norms = hypre_CTAlloc(HYPRE_Real, (mgr_data -> max_iter), HYPRE_MEMORY_HOST); + (mgr_data -> rel_res_norms) = rel_res_norms; - if (l1_norm_data) + /* Free level_coarse_indexes data */ + if (level_coarse_indexes != NULL) + { + for (i = 0; i < max_num_coarse_levels; i++) { - l1_norms[j] = hypre_SeqVectorCreate(hypre_ParCSRMatrixNumRows(A_array[j])); - hypre_VectorData(l1_norms[j]) = l1_norm_data; - hypre_SeqVectorInitialize_v2(l1_norms[j], hypre_ParCSRMatrixMemoryLocation(A_array[j])); + hypre_TFree(level_coarse_indexes[i], HYPRE_MEMORY_HOST); } + hypre_TFree(level_coarse_indexes, HYPRE_MEMORY_HOST); + (mgr_data -> level_coarse_indexes) = NULL; + + hypre_TFree(level_coarse_size, HYPRE_MEMORY_HOST); + (mgr_data -> num_coarse_per_level) = NULL; } - /* Setup Vcycle data for Frelax_method > 0 */ - if(use_VcycleSmoother) - { - /* setup temporary storage */ - VcycleRelaxVtemp = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A), - hypre_ParCSRMatrixGlobalNumRows(A), - hypre_ParCSRMatrixRowStarts(A)); - hypre_ParVectorInitialize(VcycleRelaxVtemp); - (mgr_data ->VcycleRelaxVtemp) = VcycleRelaxVtemp; + /* Print statistics */ + hypre_MGRSetupStats(mgr_vdata); - VcycleRelaxZtemp = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A), - hypre_ParCSRMatrixGlobalNumRows(A), - hypre_ParCSRMatrixRowStarts(A)); - hypre_ParVectorInitialize(VcycleRelaxZtemp); - (mgr_data -> VcycleRelaxZtemp) = VcycleRelaxZtemp; - /* allocate memory and set pointer to (mgr_data -> FrelaxVcycleData) */ - FrelaxVcycleData = hypre_CTAlloc(hypre_ParAMGData*, max_num_coarse_levels, HYPRE_MEMORY_HOST); - (mgr_data -> FrelaxVcycleData) = FrelaxVcycleData; + /* Print MGR and linear system info according to print level */ + hypre_MGRDataPrint(mgr_vdata); - /* loop over levels */ - for(i=0; i<(mgr_data->num_coarse_levels); i++) - { - if (Frelax_method[i] == 1) - { - FrelaxVcycleData[i] = (hypre_ParAMGData*) hypre_MGRCreateFrelaxVcycleData(); - if (Frelax_num_functions != NULL) - { - hypre_ParAMGDataNumFunctions(FrelaxVcycleData[i]) = Frelax_num_functions[i]; - } - (FrelaxVcycleData[i] -> Vtemp) = VcycleRelaxVtemp; - (FrelaxVcycleData[i] -> Ztemp) = VcycleRelaxZtemp; - - // setup variables for the V-cycle in the F-relaxation step // - hypre_MGRSetupFrelaxVcycleData(mgr_data, A_array[i], F_array[i], U_array[i], i); - } - } - } - - if ( logging > 1 ) - { - residual = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A_array[0]), - hypre_ParCSRMatrixGlobalNumRows(A_array[0]), - hypre_ParCSRMatrixRowStarts(A_array[0]) ); - hypre_ParVectorInitialize(residual); - (mgr_data -> residual) = residual; - } - else - { - (mgr_data -> residual) = NULL; - } - rel_res_norms = hypre_CTAlloc(HYPRE_Real, (mgr_data -> max_iter), HYPRE_MEMORY_HOST); - (mgr_data -> rel_res_norms) = rel_res_norms; - - /* free level_coarse_indexes data */ - if ( level_coarse_indexes != NULL) - { - for(i=0; i FrelaxVcycleData; - - HYPRE_Int i, j, num_procs, my_id; - - HYPRE_Int max_local_lvls = (mgr_data -> max_local_lvls); - HYPRE_Int lev_local; - HYPRE_Int not_finished; - HYPRE_Int max_local_coarse_size = hypre_ParAMGDataMaxCoarseSize(FrelaxVcycleData[lev]); - hypre_IntArray **CF_marker_array = (mgr_data -> CF_marker_array); - HYPRE_Int local_size; - HYPRE_BigInt coarse_size; - - HYPRE_BigInt *coarse_pnts_global_lvl = NULL; - hypre_IntArray *coarse_dof_func_lvl = NULL; - hypre_IntArray *dof_func = NULL; - HYPRE_Int *dof_func_data = NULL; - - hypre_ParCSRMatrix *RAP_local = NULL; - hypre_ParCSRMatrix *P_local = NULL; - hypre_ParCSRMatrix *S_local = NULL; - - HYPRE_Int smrk_local = -1; - HYPRE_Int P_max_elmts = 4; - HYPRE_Real trunc_factor = 0.0; - HYPRE_Int debug_flag = 0; - HYPRE_Int measure_type = 0; - HYPRE_Real strong_threshold = 0.25; - HYPRE_Real max_row_sum = 0.9; - - HYPRE_Int old_num_levels = hypre_ParAMGDataNumLevels(FrelaxVcycleData[lev]); - hypre_IntArray **CF_marker_array_local = (FrelaxVcycleData[lev] -> CF_marker_array); - HYPRE_Int *CF_marker_local = NULL; - hypre_ParCSRMatrix **A_array_local = (FrelaxVcycleData[lev] -> A_array); - hypre_ParCSRMatrix **P_array_local = (FrelaxVcycleData[lev] -> P_array); - hypre_ParVector **F_array_local = (FrelaxVcycleData[lev] -> F_array); - hypre_ParVector **U_array_local = (FrelaxVcycleData[lev] -> U_array); - hypre_IntArray **dof_func_array = (FrelaxVcycleData[lev] -> dof_func_array); - HYPRE_Int relax_type = 3; - HYPRE_Int indx, k, tms; - HYPRE_Int num_fine_points = 0; - HYPRE_Int num_functions = hypre_ParAMGDataNumFunctions(FrelaxVcycleData[lev]); - HYPRE_Int relax_order = hypre_ParAMGDataRelaxOrder(FrelaxVcycleData[lev]); - - hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_rank(comm,&my_id); - - - local_size = hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(A)); - - /* Free any local data not previously destroyed */ - if (A_array_local || P_array_local || CF_marker_array_local) - { - for (j = 1; j < old_num_levels; j++) - { - if (A_array_local[j]) - { - hypre_ParCSRMatrixDestroy(A_array_local[j]); - A_array_local[j] = NULL; - } - } - - for (j = 0; j < old_num_levels-1; j++) - { - if (P_array_local[j]) - { - hypre_ParCSRMatrixDestroy(P_array_local[j]); - P_array_local[j] = NULL; - } - } - - for (j = 0; j < old_num_levels-1; j++) - { - if (CF_marker_array_local[j]) - { - hypre_IntArrayDestroy(CF_marker_array_local[j]); - CF_marker_array_local[j] = NULL; - } - } - hypre_TFree(A_array_local, HYPRE_MEMORY_HOST); - A_array_local = NULL; - hypre_TFree(P_array_local, HYPRE_MEMORY_HOST); - P_array_local = NULL; - hypre_TFree(CF_marker_array_local, HYPRE_MEMORY_HOST); - CF_marker_array_local = NULL; - } - /* free solution arrays not previously destroyed */ - if (F_array_local != NULL || U_array_local != NULL) - { - for (j = 1; j < old_num_levels; j++) - { - if (F_array_local[j] != NULL) - { - hypre_ParVectorDestroy(F_array_local[j]); - F_array_local[j] = NULL; - } - if (U_array_local[j] != NULL) - { - hypre_ParVectorDestroy(U_array_local[j]); - U_array_local[j] = NULL; - } - } - hypre_TFree(F_array_local, HYPRE_MEMORY_HOST); - F_array_local = NULL; - hypre_TFree(U_array_local, HYPRE_MEMORY_HOST); - U_array_local = NULL; - } - - /* Initialize some variables and allocate memory */ - not_finished = 1; - lev_local = 0; - if(A_array_local == NULL) - A_array_local = hypre_CTAlloc(hypre_ParCSRMatrix*, max_local_lvls, HYPRE_MEMORY_HOST); - if(P_array_local == NULL && max_local_lvls > 1) - P_array_local = hypre_CTAlloc(hypre_ParCSRMatrix*, max_local_lvls-1, HYPRE_MEMORY_HOST); - if(F_array_local == NULL) - F_array_local = hypre_CTAlloc(hypre_ParVector*, max_local_lvls, HYPRE_MEMORY_HOST); - if(U_array_local == NULL) - U_array_local = hypre_CTAlloc(hypre_ParVector*, max_local_lvls, HYPRE_MEMORY_HOST); - if(CF_marker_array_local == NULL) - CF_marker_array_local = hypre_CTAlloc(hypre_IntArray*, max_local_lvls, HYPRE_MEMORY_HOST); - if(dof_func_array == NULL) - dof_func_array = hypre_CTAlloc(hypre_IntArray*, max_local_lvls, HYPRE_MEMORY_HOST); - - A_array_local[0] = A; - F_array_local[0] = f; - U_array_local[0] = u; - - for (i = 0; i < local_size; i++) - { - if (hypre_IntArrayData(CF_marker_array[lev])[i] == smrk_local) - num_fine_points++; - } - //hypre_printf("My_ID = %d, Size of A_FF matrix: %d \n", my_id, num_fine_points); - - if (num_functions > 1 && dof_func == NULL) - { - dof_func = hypre_IntArrayCreate(num_fine_points); - hypre_IntArrayInitialize(dof_func); - indx = 0; - tms = num_fine_points/num_functions; - if (tms*num_functions+indx > num_fine_points) tms--; - for (j=0; j < tms; j++) - { - for (k=0; k < num_functions; k++) - hypre_IntArrayData(dof_func)[indx++] = k; - } - k = 0; - while (indx < num_fine_points) - hypre_IntArrayData(dof_func)[indx++] = k++; - FrelaxVcycleData[lev] -> dof_func = dof_func; - } - dof_func_array[0] = dof_func; - hypre_ParAMGDataDofFuncArray(FrelaxVcycleData[lev]) = dof_func_array; - - while (not_finished) - { - local_size = hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(A_array_local[lev_local])); - dof_func_data = NULL; - if (dof_func_array[lev_local]) - { - dof_func_data = hypre_IntArrayData(dof_func_array[lev_local]); - } - - if (lev_local == 0) - { - /* use the CF_marker from the outer MGR cycle to create the strength connection matrix */ - hypre_BoomerAMGCreateSFromCFMarker(A_array_local[lev_local], strong_threshold, max_row_sum, hypre_IntArrayData(CF_marker_array[lev]), - num_functions, dof_func_data, smrk_local, &S_local); - //hypre_ParCSRMatrixPrintIJ(S_local,0,0,"S_mat"); - } - else if (lev_local > 0) - { - hypre_BoomerAMGCreateS(A_array_local[lev_local], strong_threshold, max_row_sum, num_functions, - dof_func_data, &S_local); - } - - CF_marker_array_local[lev_local] = hypre_IntArrayCreate(local_size); - hypre_IntArrayInitialize(CF_marker_array_local[lev_local]); - CF_marker_local = hypre_IntArrayData(CF_marker_array_local[lev_local]); - - HYPRE_Int coarsen_cut_factor = 0; - hypre_BoomerAMGCoarsenHMIS(S_local, A_array_local[lev_local], measure_type, coarsen_cut_factor, debug_flag, &(CF_marker_array_local[lev_local])); - - - hypre_BoomerAMGCoarseParms(comm, local_size, - num_functions, dof_func_array[lev_local], CF_marker_array_local[lev_local], - &coarse_dof_func_lvl, &coarse_pnts_global_lvl); - - if (my_id == (num_procs -1)) coarse_size = coarse_pnts_global_lvl[1]; - hypre_MPI_Bcast(&coarse_size, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); - //hypre_printf("Coarse size = %d \n", coarse_size); - if (coarse_size == 0) // stop coarsening - { - if (S_local) hypre_ParCSRMatrixDestroy(S_local); - hypre_IntArrayDestroy(coarse_dof_func_lvl); + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + hypre_ParAMGData **FrelaxVcycleData = mgr_data -> FrelaxVcycleData; + HYPRE_MemoryLocation memory_location = hypre_ParCSRMatrixMemoryLocation(A); + + HYPRE_Int i, j, num_procs, my_id; + + HYPRE_Int max_local_lvls = (mgr_data -> max_local_lvls); + HYPRE_Int lev_local; + HYPRE_Int not_finished; + HYPRE_Int max_local_coarse_size = hypre_ParAMGDataMaxCoarseSize(FrelaxVcycleData[lev]); + hypre_IntArray **CF_marker_array = (mgr_data -> CF_marker_array); + HYPRE_Int local_size; + HYPRE_BigInt coarse_size; + + HYPRE_BigInt coarse_pnts_global_lvl[2]; + hypre_IntArray *coarse_dof_func_lvl = NULL; + hypre_IntArray *dof_func = NULL; + HYPRE_Int *dof_func_data = NULL; + + hypre_ParCSRMatrix *RAP_local = NULL; + hypre_ParCSRMatrix *P_local = NULL; + hypre_ParCSRMatrix *S_local = NULL; + + HYPRE_Int smrk_local = -1; + HYPRE_Int P_max_elmts = 4; + HYPRE_Real trunc_factor = 0.0; + HYPRE_Int debug_flag = 0; + HYPRE_Int measure_type = 0; + HYPRE_Real strong_threshold = 0.25; + HYPRE_Real max_row_sum = 0.9; + HYPRE_Int coarsen_cut_factor = 0; + + HYPRE_Int old_num_levels = hypre_ParAMGDataNumLevels(FrelaxVcycleData[lev]); + hypre_IntArray **CF_marker_array_local = (FrelaxVcycleData[lev] -> CF_marker_array); + HYPRE_Int *CF_marker_local = NULL; + hypre_ParCSRMatrix **A_array_local = (FrelaxVcycleData[lev] -> A_array); + hypre_ParCSRMatrix **P_array_local = (FrelaxVcycleData[lev] -> P_array); + hypre_ParVector **F_array_local = (FrelaxVcycleData[lev] -> F_array); + hypre_ParVector **U_array_local = (FrelaxVcycleData[lev] -> U_array); + hypre_IntArray **dof_func_array = (FrelaxVcycleData[lev] -> dof_func_array); + HYPRE_Int relax_type = 3; + HYPRE_Int indx, k, tms; + HYPRE_Int num_fine_points = 0; + HYPRE_Int num_functions = hypre_ParAMGDataNumFunctions(FrelaxVcycleData[lev]); + HYPRE_Int relax_order = hypre_ParAMGDataRelaxOrder(FrelaxVcycleData[lev]); + + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); + + local_size = hypre_ParCSRMatrixNumRows(A); + + /* Free any local data not previously destroyed */ + if (A_array_local || P_array_local || CF_marker_array_local) + { + for (j = 1; j < old_num_levels; j++) + { + if (A_array_local[j]) + { + hypre_ParCSRMatrixDestroy(A_array_local[j]); + A_array_local[j] = NULL; + } + } + + for (j = 0; j < old_num_levels - 1; j++) + { + if (P_array_local[j]) + { + hypre_ParCSRMatrixDestroy(P_array_local[j]); + P_array_local[j] = NULL; + } + } + + for (j = 0; j < old_num_levels - 1; j++) + { + if (CF_marker_array_local[j]) + { + hypre_IntArrayDestroy(CF_marker_array_local[j]); + CF_marker_array_local[j] = NULL; + } + } + hypre_TFree(A_array_local, HYPRE_MEMORY_HOST); + A_array_local = NULL; + hypre_TFree(P_array_local, HYPRE_MEMORY_HOST); + P_array_local = NULL; + hypre_TFree(CF_marker_array_local, HYPRE_MEMORY_HOST); + CF_marker_array_local = NULL; + } + /* free solution arrays not previously destroyed */ + if (F_array_local != NULL || U_array_local != NULL) + { + for (j = 1; j < old_num_levels; j++) + { + if (F_array_local[j] != NULL) + { + hypre_ParVectorDestroy(F_array_local[j]); + F_array_local[j] = NULL; + } + if (U_array_local[j] != NULL) + { + hypre_ParVectorDestroy(U_array_local[j]); + U_array_local[j] = NULL; + } + } + hypre_TFree(F_array_local, HYPRE_MEMORY_HOST); + F_array_local = NULL; + hypre_TFree(U_array_local, HYPRE_MEMORY_HOST); + U_array_local = NULL; + } + + /* Initialize some variables and allocate memory */ + not_finished = 1; + lev_local = 0; + if (A_array_local == NULL) + { + A_array_local = hypre_CTAlloc(hypre_ParCSRMatrix*, max_local_lvls, HYPRE_MEMORY_HOST); + } + if (P_array_local == NULL && max_local_lvls > 1) + { + P_array_local = hypre_CTAlloc(hypre_ParCSRMatrix*, max_local_lvls - 1, HYPRE_MEMORY_HOST); + } + if (F_array_local == NULL) + { + F_array_local = hypre_CTAlloc(hypre_ParVector*, max_local_lvls, HYPRE_MEMORY_HOST); + } + if (U_array_local == NULL) + { + U_array_local = hypre_CTAlloc(hypre_ParVector*, max_local_lvls, HYPRE_MEMORY_HOST); + } + if (CF_marker_array_local == NULL) + { + CF_marker_array_local = hypre_CTAlloc(hypre_IntArray*, max_local_lvls, HYPRE_MEMORY_HOST); + } + if (dof_func_array == NULL) + { + dof_func_array = hypre_CTAlloc(hypre_IntArray*, max_local_lvls, HYPRE_MEMORY_HOST); + } + + A_array_local[0] = A; + F_array_local[0] = f; + U_array_local[0] = u; + + for (i = 0; i < local_size; i++) + { + if (hypre_IntArrayData(CF_marker_array[lev])[i] == smrk_local) + { + num_fine_points++; + } + } + //hypre_printf("My_ID = %d, Size of A_FF matrix: %d \n", my_id, num_fine_points); + + if (num_functions > 1 && dof_func == NULL) + { + dof_func = hypre_IntArrayCreate(num_fine_points); + hypre_IntArrayInitialize(dof_func); + indx = 0; + tms = num_fine_points / num_functions; + if (tms * num_functions + indx > num_fine_points) { tms--; } + for (j = 0; j < tms; j++) + { + for (k = 0; k < num_functions; k++) + { + hypre_IntArrayData(dof_func)[indx++] = k; + } + } + k = 0; + while (indx < num_fine_points) + { + hypre_IntArrayData(dof_func)[indx++] = k++; + } + FrelaxVcycleData[lev] -> dof_func = dof_func; + } + dof_func_array[0] = dof_func; + hypre_ParAMGDataDofFuncArray(FrelaxVcycleData[lev]) = dof_func_array; + + while (not_finished) + { + local_size = hypre_ParCSRMatrixNumRows(A_array_local[lev_local]); + dof_func_data = NULL; + if (dof_func_array[lev_local]) + { + dof_func_data = hypre_IntArrayData(dof_func_array[lev_local]); + } + + if (lev_local == 0) + { + /* use the CF_marker from the outer MGR cycle + to create the strength connection matrix */ + hypre_BoomerAMGCreateSFromCFMarker(A_array_local[lev_local], + strong_threshold, + max_row_sum, + hypre_IntArrayData(CF_marker_array[lev]), + num_functions, dof_func_data, + smrk_local, &S_local); + } + else if (lev_local > 0) + { + hypre_BoomerAMGCreateS(A_array_local[lev_local], strong_threshold, + max_row_sum, num_functions, + dof_func_data, &S_local); + } + + CF_marker_array_local[lev_local] = hypre_IntArrayCreate(local_size); + hypre_IntArrayInitialize_v2(CF_marker_array_local[lev_local], memory_location); + CF_marker_local = hypre_IntArrayData(CF_marker_array_local[lev_local]); + + hypre_BoomerAMGCoarsenHMIS(S_local, A_array_local[lev_local], measure_type, + coarsen_cut_factor, debug_flag, + &(CF_marker_array_local[lev_local])); + + hypre_BoomerAMGCoarseParms(comm, local_size, + num_functions, dof_func_array[lev_local], + CF_marker_array_local[lev_local], + &coarse_dof_func_lvl, coarse_pnts_global_lvl); + + if (my_id == (num_procs - 1)) + { + coarse_size = coarse_pnts_global_lvl[1]; + } + hypre_MPI_Bcast(&coarse_size, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); + + if (coarse_size == 0) // stop coarsening + { + if (S_local) { hypre_ParCSRMatrixDestroy(S_local); } + hypre_IntArrayDestroy(coarse_dof_func_lvl); + + if (lev_local == 0) + { + // Save the cf_marker from outer MGR level (lev). + if (relax_order == 1) + { + /* We need to mask out C-points from outer CF-marker for + C/F relaxation at solve phase --DOK*/ + for (i = 0; i < local_size; i++) + { + if (hypre_IntArrayData(CF_marker_array[lev])[i] == 1) + { + CF_marker_local[i] = 0; + } + } + } + else + { + /* Do lexicographic relaxation on F-points from outer CF-marker --DOK*/ + for (i = 0; i < local_size; i++) + { + CF_marker_local[i] = hypre_IntArrayData(CF_marker_array[lev])[i]; + } + } + } + else + { + hypre_IntArrayDestroy(CF_marker_array_local[lev_local]); + CF_marker_array_local[lev_local] = NULL; + } + break; + } + hypre_BoomerAMGBuildExtPIInterpHost(A_array_local[lev_local], CF_marker_local, + S_local, coarse_pnts_global_lvl, num_functions, dof_func_data, + debug_flag, trunc_factor, P_max_elmts, &P_local); + + // hypre_BoomerAMGBuildInterp(A_array_local[lev_local], CF_marker_local, + // S_local, coarse_pnts_global_lvl, 1, NULL, + // 0, 0.0, 0, NULL, &P_local); + + /* Save the CF_marker pointer. For lev_local = 0, save the cf_marker from outer MGR level (lev). + * This is necessary to enable relaxations over the A_FF matrix during the solve phase. -- DOK + */ if (lev_local == 0) { - // Save the cf_marker from outer MGR level (lev). - if (relax_order == 1) - { - /* We need to mask out C-points from outer CF-marker for C/F relaxation at solve phase --DOK*/ - for (i = 0; i < local_size; i++) - { - if (hypre_IntArrayData(CF_marker_array[lev])[i] == 1) + if (relax_order == 1) + { + /* We need to mask out C-points from outer CF-marker for C/F relaxation at solve phase --DOK*/ + for (i = 0; i < local_size; i++) + { + if (hypre_IntArrayData(CF_marker_array[lev])[i] == 1) + { + CF_marker_local[i] = 0; + } + } + } + else + { + /* Do lexicographic relaxation on F-points from outer CF-marker --DOK */ + for (i = 0; i < local_size; i++) { - CF_marker_local[i] = 0; + CF_marker_local[i] = hypre_IntArrayData(CF_marker_array[lev])[i]; } - } - } - else - { - /* Do lexicographic relaxation on F-points from outer CF-marker --DOK*/ - for (i = 0; i < local_size; i++) - { - CF_marker_local[i] = hypre_IntArrayData(CF_marker_array[lev])[i]; - } - } + } } - else + /* Save interpolation matrix pointer */ + P_array_local[lev_local] = P_local; + + if (num_functions > 1) + { + dof_func_array[lev_local + 1] = coarse_dof_func_lvl; + } + + /* build the coarse grid */ + hypre_BoomerAMGBuildCoarseOperatorKT(P_local, A_array_local[lev_local], + P_local, 0, &RAP_local); + /* + if (my_id == (num_procs -1)) coarse_size = coarse_pnts_global_lvl[1]; + hypre_MPI_Bcast(&coarse_size, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); + */ + lev_local++; + + if (S_local) { hypre_ParCSRMatrixDestroy(S_local); } + S_local = NULL; + if ( (lev_local == max_local_lvls - 1) || (coarse_size <= max_local_coarse_size) ) + { + not_finished = 0; + } + + A_array_local[lev_local] = RAP_local; + F_array_local[lev_local] = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(RAP_local), + hypre_ParCSRMatrixGlobalNumRows(RAP_local), + hypre_ParCSRMatrixRowStarts(RAP_local)); + hypre_ParVectorInitialize(F_array_local[lev_local]); + + U_array_local[lev_local] = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(RAP_local), + hypre_ParCSRMatrixGlobalNumRows(RAP_local), + hypre_ParCSRMatrixRowStarts(RAP_local)); + hypre_ParVectorInitialize(U_array_local[lev_local]); + } // end while loop + + // setup Vcycle data + (FrelaxVcycleData[lev] -> A_array) = A_array_local; + (FrelaxVcycleData[lev] -> P_array) = P_array_local; + (FrelaxVcycleData[lev] -> F_array) = F_array_local; + (FrelaxVcycleData[lev] -> U_array) = U_array_local; + (FrelaxVcycleData[lev] -> CF_marker_array) = CF_marker_array_local; + (FrelaxVcycleData[lev] -> num_levels) = lev_local; + //if(lev == 1) + //{ + // for (i = 0; i < local_size; i++) + // { + // if(CF_marker_array_local[0][i] == 1) + // hypre_printf("cfmarker[%d] = %d\n",i, CF_marker_array_local[0][i]); + // } + //} + /* setup GE for coarsest level (if small enough) */ + if ((lev_local > 0) && (hypre_ParAMGDataUserCoarseRelaxType(FrelaxVcycleData[lev]) == 9)) + { + if ((coarse_size <= max_local_coarse_size) && coarse_size > 0) { - hypre_IntArrayDestroy(CF_marker_array_local[lev_local]); - CF_marker_array_local[lev_local] = NULL; - } - hypre_TFree(coarse_pnts_global_lvl, HYPRE_MEMORY_HOST); - break; - } - - hypre_BoomerAMGBuildExtPIInterpHost(A_array_local[lev_local], CF_marker_local, - S_local, coarse_pnts_global_lvl, num_functions, dof_func_data, - debug_flag, trunc_factor, P_max_elmts, &P_local); - -// hypre_BoomerAMGBuildInterp(A_array_local[lev_local], CF_marker_local, -// S_local, coarse_pnts_global_lvl, 1, NULL, -// 0, 0.0, 0, NULL, &P_local); - - /* Save the CF_marker pointer. For lev_local = 0, save the cf_marker from outer MGR level (lev). - * This is necessary to enable relaxations over the A_FF matrix during the solve phase. -- DOK - */ - if(lev_local == 0) - { - if(relax_order == 1) - { - /* We need to mask out C-points from outer CF-marker for C/F relaxation at solve phase --DOK*/ - for (i = 0; i < local_size; i++) - { - if (hypre_IntArrayData(CF_marker_array[lev])[i] == 1) - { - CF_marker_local[i] = 0; - } - } + hypre_GaussElimSetup(FrelaxVcycleData[lev], lev_local, 9); } else { - /* Do lexicographic relaxation on F-points from outer CF-marker --DOK */ - for (i = 0; i < local_size; i++) - { - CF_marker_local[i] = hypre_IntArrayData(CF_marker_array[lev])[i]; - } - } - } - /* Save interpolation matrix pointer */ - P_array_local[lev_local] = P_local; - - if (num_functions > 1) - dof_func_array[lev_local+1] = coarse_dof_func_lvl; - - /* build the coarse grid */ - hypre_BoomerAMGBuildCoarseOperatorKT(P_local, A_array_local[lev_local], - P_local, 0, &RAP_local); -/* - if (my_id == (num_procs -1)) coarse_size = coarse_pnts_global_lvl[1]; - hypre_MPI_Bcast(&coarse_size, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); -*/ - lev_local++; - - if (S_local) hypre_ParCSRMatrixDestroy(S_local); - S_local = NULL; - if ( (lev_local == max_local_lvls-1) || (coarse_size <= max_local_coarse_size) ) - { - hypre_TFree(coarse_pnts_global_lvl, HYPRE_MEMORY_HOST); - not_finished = 0; - } - - A_array_local[lev_local] = RAP_local; - F_array_local[lev_local] = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(RAP_local), - hypre_ParCSRMatrixGlobalNumRows(RAP_local), - hypre_ParCSRMatrixRowStarts(RAP_local)); - hypre_ParVectorInitialize(F_array_local[lev_local]); - - U_array_local[lev_local] = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(RAP_local), - hypre_ParCSRMatrixGlobalNumRows(RAP_local), - hypre_ParCSRMatrixRowStarts(RAP_local)); - hypre_ParVectorInitialize(U_array_local[lev_local]); - } // end while loop - - // setup Vcycle data - (FrelaxVcycleData[lev] -> A_array) = A_array_local; - (FrelaxVcycleData[lev] -> P_array) = P_array_local; - (FrelaxVcycleData[lev] -> F_array) = F_array_local; - (FrelaxVcycleData[lev] -> U_array) = U_array_local; - (FrelaxVcycleData[lev] -> CF_marker_array) = CF_marker_array_local; - (FrelaxVcycleData[lev] -> num_levels) = lev_local; - //if(lev == 1) - //{ - // for (i = 0; i < local_size; i++) - // { - // if(CF_marker_array_local[0][i] == 1) - // hypre_printf("cfmarker[%d] = %d\n",i, CF_marker_array_local[0][i]); - // } - //} - /* setup GE for coarsest level (if small enough) */ - if ((lev_local > 0) && (hypre_ParAMGDataUserCoarseRelaxType(FrelaxVcycleData[lev]) == 9)) - { - if((coarse_size <= max_local_coarse_size) && coarse_size > 0) - { - hypre_GaussElimSetup(FrelaxVcycleData[lev], lev_local, 9); - } - else - { - /* use relaxation */ - hypre_ParAMGDataUserCoarseRelaxType(FrelaxVcycleData[lev]) = relax_type; - } - } - - return hypre_error_flag; + /* use relaxation */ + hypre_ParAMGDataUserCoarseRelaxType(FrelaxVcycleData[lev]) = relax_type; + } + } + + return hypre_error_flag; } diff --git a/external/hypre/src/parcsr_ls/par_mgr_solve.c b/external/hypre/src/parcsr_ls/par_mgr_solve.c index 46f9d734..3d75cb34 100644 --- a/external/hypre/src/parcsr_ls/par_mgr_solve.c +++ b/external/hypre/src/parcsr_ls/par_mgr_solve.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -25,9 +25,9 @@ hypre_MGRSolve( void *mgr_vdata, { MPI_Comm comm = hypre_ParCSRMatrixComm(A); - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; - hypre_ParCSRMatrix **A_array = (mgr_data -> A_array); + hypre_ParCSRMatrix **A_array = (mgr_data -> A_array); hypre_ParVector **F_array = (mgr_data -> F_array); hypre_ParVector **U_array = (mgr_data -> U_array); @@ -35,13 +35,14 @@ hypre_MGRSolve( void *mgr_vdata, HYPRE_Int logging = (mgr_data -> logging); HYPRE_Int print_level = (mgr_data -> print_level); HYPRE_Int max_iter = (mgr_data -> max_iter); - HYPRE_Real *norms = (mgr_data -> rel_res_norms); - hypre_ParVector *Vtemp = (mgr_data -> Vtemp); - hypre_ParVector *Utemp = (mgr_data -> Utemp); - hypre_ParVector *residual; - - HYPRE_Real alpha = -1.0; - HYPRE_Real beta = 1.0; + HYPRE_Real *norms = (mgr_data -> rel_res_norms); + hypre_ParVector *Vtemp = (mgr_data -> Vtemp); + // hypre_ParVector *Utemp = (mgr_data -> Utemp); + hypre_ParVector *residual = NULL; + + HYPRE_Complex fp_zero = 0.0; + HYPRE_Complex fp_one = 1.0; + HYPRE_Complex fp_neg_one = - fp_one; HYPRE_Real conv_factor = 0.0; HYPRE_Real resnorm = 1.0; HYPRE_Real init_resnorm = 0.0; @@ -51,39 +52,20 @@ hypre_MGRSolve( void *mgr_vdata, HYPRE_Real ieee_check = 0.; HYPRE_Int iter, num_procs, my_id; - HYPRE_Int Solve_err_flag; - - /* - HYPRE_Real total_coeffs; - HYPRE_Real total_variables; - HYPRE_Real operat_cmplxty; - HYPRE_Real grid_cmplxty; - */ - HYPRE_Solver cg_solver = (mgr_data -> coarse_grid_solver); - HYPRE_Int (*coarse_grid_solver_solve)(void*,void*,void*,void*) = (mgr_data -> coarse_grid_solver_solve); - HYPRE_Int set_c_points_method = (mgr_data -> set_c_points_method); - - HYPRE_Int blk_size = (mgr_data -> block_size); - HYPRE_Real *diaginv = (mgr_data -> diaginv); - HYPRE_Int n_block = (mgr_data -> n_block); - HYPRE_Int left_size = (mgr_data -> left_size); - - HYPRE_Int global_smooth_iters = (mgr_data -> global_smooth_iters); - HYPRE_Int global_smooth_type = (mgr_data -> global_smooth_type); -// HYPRE_Real wall_time = 0.0; - - HYPRE_Int i; + HYPRE_Solver cg_solver = (mgr_data -> coarse_grid_solver); + HYPRE_Int (*coarse_grid_solver_solve)(void*, void*, void*, + void*) = (mgr_data -> coarse_grid_solver_solve); HYPRE_ANNOTATE_FUNC_BEGIN; - if(logging > 1) + if (logging > 1) { residual = (mgr_data -> residual); } (mgr_data -> num_iterations) = 0; - if((mgr_data -> num_coarse_levels) == 0) + if ((mgr_data -> num_coarse_levels) == 0) { /* Do scalar AMG solve when only one level */ coarse_grid_solver_solve(cg_solver, A, f, u); @@ -96,64 +78,61 @@ hypre_MGRSolve( void *mgr_vdata, return hypre_error_flag; } + A_array[0] = A; U_array[0] = u; F_array[0] = f; hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_rank(comm, &my_id); /*----------------------------------------------------------------------- * Write the solver parameters *-----------------------------------------------------------------------*/ - if (my_id == 0 && print_level > 1) - hypre_MGRWriteSolverParams(mgr_data); - /*----------------------------------------------------------------------- - * Initialize the solver error flag and assorted bookkeeping variables - *-----------------------------------------------------------------------*/ + /* Print MGR and linear system info according to print level */ + hypre_MGRDataPrint(mgr_vdata); - Solve_err_flag = 0; - /* - total_coeffs = 0; - total_variables = 0; - operat_cmplxty = 0; - grid_cmplxty = 0; - */ /*----------------------------------------------------------------------- * write some initial info *-----------------------------------------------------------------------*/ - if (my_id == 0 && print_level > 1 && tol > 0.) - hypre_printf("\n\nTWO-GRID SOLVER SOLUTION INFO:\n"); - + if (my_id == 0 && (print_level & HYPRE_MGR_PRINT_INFO_SOLVE) && tol > 0.) + { + hypre_printf("\n\nMGR SOLVER SOLUTION INFO:\n"); + } /*----------------------------------------------------------------------- * Compute initial fine-grid residual and print *-----------------------------------------------------------------------*/ - if (print_level > 1 || logging > 1 || tol > 0.) + + if ((print_level & HYPRE_MGR_PRINT_INFO_SOLVE) || logging > 1 || tol > 0.) { - if ( logging > 1 ) + if (logging > 1) { - hypre_ParVectorCopy(F_array[0], residual ); - if (tol > 0.0) + hypre_ParVectorCopy(F_array[0], residual); + if (tol > hypre_cabs(fp_zero)) { - hypre_ParCSRMatrixMatvec(alpha, A_array[0], U_array[0], beta, residual ); + hypre_ParCSRMatrixMatvec(fp_neg_one, A_array[0], U_array[0], fp_one, residual); } - resnorm = sqrt(hypre_ParVectorInnerProd( residual, residual )); + resnorm = hypre_sqrt(hypre_ParVectorInnerProd(residual, residual)); } else { hypre_ParVectorCopy(F_array[0], Vtemp); - if (tol > 0.0) + if (tol > hypre_cabs(fp_zero)) { - hypre_ParCSRMatrixMatvec(alpha, A_array[0], U_array[0], beta, Vtemp); + hypre_ParCSRMatrixMatvec(fp_neg_one, A_array[0], U_array[0], fp_one, Vtemp); } - resnorm = sqrt(hypre_ParVectorInnerProd(Vtemp, Vtemp)); + resnorm = hypre_sqrt(hypre_ParVectorInnerProd(Vtemp, Vtemp)); } - /* Since it is does not diminish performance, attempt to return an error flag + /* Since it does not diminish performance, attempt to return an error flag * and notify users when they supply bad input. */ - if (resnorm != 0.) ieee_check = resnorm/resnorm; /* INF -> NaN conversion */ + if (resnorm != 0.) + { + ieee_check = resnorm / resnorm; /* INF -> NaN conversion */ + } + if (ieee_check != ieee_check) { /* ...INFs or NaNs in input can make ieee_check a NaN. This test @@ -175,7 +154,7 @@ hypre_MGRSolve( void *mgr_vdata, } init_resnorm = resnorm; - rhs_norm = sqrt(hypre_ParVectorInnerProd(f, f)); + rhs_norm = hypre_sqrt(hypre_ParVectorInnerProd(f, f)); if (rhs_norm > HYPRE_REAL_EPSILON) { rel_resnorm = init_resnorm / rhs_norm; @@ -183,10 +162,10 @@ hypre_MGRSolve( void *mgr_vdata, else { /* rhs is zero, return a zero solution */ - hypre_ParVectorSetConstantValues(U_array[0], 0.0); - if(logging > 0) + hypre_ParVectorSetZeros(U_array[0]); + if (logging > 0) { - rel_resnorm = 0.0; + rel_resnorm = fp_zero; (mgr_data -> final_rel_residual_norm) = rel_resnorm; } HYPRE_ANNOTATE_FUNC_END; @@ -199,109 +178,45 @@ hypre_MGRSolve( void *mgr_vdata, rel_resnorm = 1.; } - if (my_id == 0 && print_level > 1) + if (my_id == 0 && (print_level & HYPRE_MGR_PRINT_INFO_SOLVE)) { hypre_printf(" relative\n"); hypre_printf(" residual factor residual\n"); hypre_printf(" -------- ------ --------\n"); - hypre_printf(" Initial %e %e\n",init_resnorm, - rel_resnorm); + hypre_printf(" Initial %e %e\n", init_resnorm, + rel_resnorm); } + /************** Main Solver Loop - always do 1 iteration ************/ iter = 0; while ((rel_resnorm >= tol || iter < 1) && iter < max_iter) { - if (global_smooth_iters) - { - //wall_time = time_getWallclockSeconds(); - /** DEBUG: **/ - // hypre_ParCSRMatrixMatvecOutOfPlace(alpha, A_array[0], U_array[0], beta, F_array[0], Vtemp); - // HYPRE_Real resnorm_gsmooth = hypre_ParVectorInnerProd(Vtemp, Vtemp); - if (global_smooth_type == 0)//block Jacobi smoother - { - for (i = 0;i < global_smooth_iters;i ++) - { - if (set_c_points_method == 0) - { - hypre_blockRelax_solve(A_array[0],F_array[0],U_array[0],blk_size,n_block,left_size,global_smooth_type,diaginv,Vtemp); - } - else - { - hypre_blockRelax_solve(A_array[0],F_array[0],U_array[0],1,n_block,left_size,global_smooth_type,diaginv,Vtemp); - } - } - } - else if ((global_smooth_type > 0) && (global_smooth_type < 7)) - { - for (i = 0;i < global_smooth_iters;i ++) - { - hypre_BoomerAMGRelax(A_array[0], F_array[0], NULL, global_smooth_type-1, 0, 1.0, 0.0, NULL, U_array[0], Vtemp, NULL); - } - } - else if (global_smooth_type == 8)//EUCLID ILU smoother - { - for (i = 0;i < global_smooth_iters;i ++) - { - // compute residual - hypre_ParCSRMatrixMatvecOutOfPlace(alpha, A_array[0], U_array[0], beta, F_array[0], Vtemp); - // solve - HYPRE_EuclidSolve( (mgr_data -> global_smoother),A_array[0],Vtemp,Utemp); - // update solution - hypre_ParVectorAxpy(beta, Utemp, U_array[0]); - } - } - else if (global_smooth_type == 16) // HYPRE ILU - { - // solve - HYPRE_ILUSolve(mgr_data -> global_smoother, A_array[0], F_array[0], U_array[0]); - } - /** DEBUG: **/ - // hypre_ParCSRMatrixMatvecOutOfPlace(alpha, A_array[0], U_array[0], beta, F_array[0], Vtemp); - // resnorm_gsmooth = hypre_ParVectorInnerProd(Vtemp, Vtemp); - //if (my_id == 0) hypre_printf("Global smoothing convergence factor: %1.2f\n", resnorm_gsmooth/conv_factor_gsmooth); - //wall_time = time_getWallclockSeconds() - wall_time; - //if (my_id == 0) hypre_printf("Global smoother solve: %f\n", wall_time); - } - - //wall_time = time_getWallclockSeconds(); - /* Do one cycle of reduction solve on Ae=r */ + /* Do one cycle of reduction solve on A*e = r */ hypre_MGRCycle(mgr_data, F_array, U_array); - //wall_time = time_getWallclockSeconds() - wall_time; - //if (my_id == 0) hypre_printf("MGR Cycle time: %f\n", wall_time); - /*--------------------------------------------------------------- * Compute fine-grid residual and residual norm *----------------------------------------------------------------*/ - if (print_level > 1 || logging > 1 || tol > 0.) + if ((print_level & HYPRE_MGR_PRINT_INFO_SOLVE) || logging > 1 || tol > 0.) { old_resnorm = resnorm; - if ( logging > 1 ) + if (logging > 1) { hypre_ParVectorCopy(F_array[0], residual); - hypre_ParCSRMatrixMatvec(alpha, A_array[0], U_array[0], beta, residual ); - resnorm = sqrt(hypre_ParVectorInnerProd( residual, residual )); + hypre_ParCSRMatrixMatvec(fp_neg_one, A_array[0], U_array[0], fp_one, residual); + resnorm = hypre_sqrt(hypre_ParVectorInnerProd(residual, residual)); } else { hypre_ParVectorCopy(F_array[0], Vtemp); - hypre_ParCSRMatrixMatvec(alpha, A_array[0], U_array[0], beta, Vtemp); - resnorm = sqrt(hypre_ParVectorInnerProd(Vtemp, Vtemp)); - } - - if (old_resnorm) conv_factor = resnorm / old_resnorm; - else conv_factor = resnorm; - if (rhs_norm > HYPRE_REAL_EPSILON) - { - rel_resnorm = resnorm / rhs_norm; - } - else - { - rel_resnorm = resnorm; + hypre_ParCSRMatrixMatvec(fp_neg_one, A_array[0], U_array[0], fp_one, Vtemp); + resnorm = hypre_sqrt(hypre_ParVectorInnerProd(Vtemp, Vtemp)); } + conv_factor = (old_resnorm > HYPRE_REAL_EPSILON) ? (resnorm / old_resnorm) : resnorm; + rel_resnorm = (rhs_norm > HYPRE_REAL_EPSILON) ? (resnorm / rhs_norm) : resnorm; norms[iter] = rel_resnorm; } @@ -309,70 +224,68 @@ hypre_MGRSolve( void *mgr_vdata, (mgr_data -> num_iterations) = iter; (mgr_data -> final_rel_residual_norm) = rel_resnorm; - if (my_id == 0 && print_level > 1) + if (my_id == 0 && (print_level & HYPRE_MGR_PRINT_INFO_SOLVE)) { hypre_printf(" MGRCycle %2d %e %f %e \n", iter, - resnorm, conv_factor, rel_resnorm); + resnorm, conv_factor, rel_resnorm); } } /* check convergence within max_iter */ if (iter == max_iter && tol > 0.) { - Solve_err_flag = 1; hypre_error(HYPRE_ERROR_CONV); - } - /*----------------------------------------------------------------------- - * Print closing statistics - * Add operator and grid complexity stats - *-----------------------------------------------------------------------*/ - - if (iter > 0 && init_resnorm) - conv_factor = pow((resnorm/init_resnorm),(1.0/(HYPRE_Real) iter)); - else - conv_factor = 1.; + if (!my_id && (print_level & HYPRE_MGR_PRINT_INFO_SOLVE)) + { + hypre_printf("\n\n=============================================="); + hypre_printf("\n NOTE: Convergence tolerance was not achieved\n"); + hypre_printf(" within the allowed %d iterations\n", max_iter); + hypre_printf("=============================================="); + } + } - if (print_level > 1) + if ((my_id == 0) && (print_level & HYPRE_MGR_PRINT_INFO_SOLVE)) { - /*** compute operator and grid complexities here ?? ***/ - if (my_id == 0) + if (iter > 0 && init_resnorm) { - if (Solve_err_flag == 1) - { - hypre_printf("\n\n=============================================="); - hypre_printf("\n NOTE: Convergence tolerance was not achieved\n"); - hypre_printf(" within the allowed %d iterations\n",max_iter); - hypre_printf("=============================================="); - } - hypre_printf("\n\n Average Convergence Factor = %f \n",conv_factor); - hypre_printf(" Number of coarse levels = %d \n",(mgr_data -> num_coarse_levels)); - // hypre_printf("\n\n Complexity: grid = %f\n",grid_cmplxty); - // hypre_printf(" operator = %f\n",operat_cmplxty); - // hypre_printf(" cycle = %f\n\n\n\n",cycle_cmplxty); + conv_factor = hypre_pow((resnorm / init_resnorm), + (fp_one / (HYPRE_Real) iter)); + } + else + { + conv_factor = fp_one; } + + hypre_printf("\n\n Average Convergence Factor = %f \n", conv_factor); } + HYPRE_ANNOTATE_FUNC_END; return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_MGRFrelaxVcycle + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_MGRFrelaxVcycle ( void *Frelax_vdata, hypre_ParVector *f, hypre_ParVector *u ) +hypre_MGRFrelaxVcycle ( void *Frelax_vdata, + hypre_ParVector *f, + hypre_ParVector *u ) { - hypre_ParAMGData *Frelax_data = (hypre_ParAMGData*) Frelax_vdata; - - HYPRE_Int Not_Finished = 0; - HYPRE_Int level = 0; - HYPRE_Int cycle_param = 1; - HYPRE_Int j, Solve_err_flag, coarse_grid, fine_grid; - HYPRE_Int local_size; - HYPRE_Int num_sweeps = 1; - HYPRE_Int relax_order = hypre_ParAMGDataRelaxOrder(Frelax_data); - HYPRE_Int relax_type = 3; - HYPRE_Int relax_weight = 1; - HYPRE_Int omega = 1; - // HYPRE_Int max_coarse_size = hypre_ParAMGDataMaxCoarseSize(Frelax_data); + hypre_ParAMGData *Frelax_data = (hypre_ParAMGData*) Frelax_vdata; + + HYPRE_Int Not_Finished = 0; + HYPRE_Int level = 0; + HYPRE_Int cycle_param = 1; + HYPRE_Int j, Solve_err_flag, coarse_grid, fine_grid; + HYPRE_Int local_size; + HYPRE_Int num_sweeps = 1; + HYPRE_Int relax_order = hypre_ParAMGDataRelaxOrder(Frelax_data); + HYPRE_Int relax_type = 3; + HYPRE_Real relax_weight = 1.0; + HYPRE_Real omega = 1.0; hypre_ParVector **F_array = (Frelax_data) -> F_array; hypre_ParVector **U_array = (Frelax_data) -> U_array; @@ -383,15 +296,17 @@ hypre_MGRFrelaxVcycle ( void *Frelax_vdata, hypre_ParVector *f, hypre_ParVecto hypre_IntArray **CF_marker_array = ((Frelax_data) -> CF_marker_array); HYPRE_Int *CF_marker; - hypre_ParVector *Vtemp = (Frelax_data) -> Vtemp; - hypre_ParVector *Ztemp = (Frelax_data) -> Ztemp; + hypre_ParVector *Vtemp = (Frelax_data) -> Vtemp; + hypre_ParVector *Ztemp = (Frelax_data) -> Ztemp; - HYPRE_Int num_c_levels = (Frelax_data) -> num_levels; + HYPRE_Int num_c_levels = (Frelax_data) -> num_levels; - hypre_ParVector *Aux_F = NULL; - hypre_ParVector *Aux_U = NULL; + hypre_ParVector *Aux_F = NULL; + hypre_ParVector *Aux_U = NULL; - HYPRE_Real alpha, beta; + HYPRE_Complex fp_zero = 0.0; + HYPRE_Complex fp_one = 1.0; + HYPRE_Complex fp_neg_one = - fp_one; HYPRE_ANNOTATE_FUNC_BEGIN; @@ -406,48 +321,53 @@ hypre_MGRFrelaxVcycle ( void *Frelax_vdata, hypre_ParVector *f, hypre_ParVecto /* (Re)set local_size for Vtemp */ local_size = hypre_VectorSize(hypre_ParVectorLocalVector(F_array[0])); - hypre_VectorSize(hypre_ParVectorLocalVector(Vtemp)) = local_size; + hypre_ParVectorSetLocalSize(Vtemp, local_size); + /* smoother on finest level: * This is separated from subsequent levels since the finest level matrix * may be larger than what is needed for the vcycle solve */ - if(relax_order == 1)// C/F ordering for smoother + if (relax_order == 1) // C/F ordering for smoother { - for (j = 0; j < num_sweeps; j++) { + for (j = 0; j < num_sweeps; j++) + { Solve_err_flag = hypre_BoomerAMGRelaxIF(A_array[0], - F_array[0], - CF_marker, - relax_type, - relax_order, - 1, - relax_weight, - omega, - NULL, - U_array[0], - Vtemp, - Ztemp); + F_array[0], + CF_marker, + relax_type, + relax_order, + 1, + relax_weight, + omega, + NULL, + U_array[0], + Vtemp, + Ztemp); } } else // lexicographic ordering for smoother (on F points in CF marker) { - for (j = 0; j < num_sweeps; j++) { + for (j = 0; j < num_sweeps; j++) + { Solve_err_flag = hypre_BoomerAMGRelax(A_array[0], - F_array[0], - CF_marker, - relax_type, - -1, - relax_weight, - omega, - NULL, - U_array[0], - Vtemp, - Ztemp); + F_array[0], + CF_marker, + relax_type, + -1, + relax_weight, + omega, + NULL, + U_array[0], + Vtemp, + Ztemp); } } /* coarse grids exist */ - if(num_c_levels > 0) + if (num_c_levels > 0) + { Not_Finished = 1; + } while (Not_Finished) { @@ -455,26 +375,26 @@ hypre_MGRFrelaxVcycle ( void *Frelax_vdata, hypre_ParVector *f, hypre_ParVecto { //hypre_printf("Vcycle smoother (down cycle): vtemp size = %d, level = %d \n", hypre_VectorSize(hypre_ParVectorLocalVector(Vtemp)), level); /* compute coarse grid vectors */ - fine_grid = level; + fine_grid = level; coarse_grid = level + 1; - hypre_ParVectorSetConstantValues(U_array[coarse_grid], 0.0); - - alpha = -1.0; - beta = 1.0; + hypre_ParVectorSetZeros(U_array[coarse_grid]); - // JSP: avoid unnecessary copy using out-of-place version of SpMV - hypre_ParCSRMatrixMatvecOutOfPlace(alpha, A_array[fine_grid], U_array[fine_grid], - beta, F_array[fine_grid], Vtemp); + /* Avoid unnecessary copy using out-of-place version of SpMV */ + hypre_ParCSRMatrixMatvecOutOfPlace(fp_neg_one, A_array[fine_grid], U_array[fine_grid], + fp_one, F_array[fine_grid], Vtemp); - alpha = 1.0; - beta = 0.0; - hypre_ParCSRMatrixMatvecT(alpha,R_array[fine_grid],Vtemp, - beta,F_array[coarse_grid]); + hypre_ParCSRMatrixMatvecT(fp_one, R_array[fine_grid], Vtemp, + fp_zero, F_array[coarse_grid]); /* update level */ ++level; + /* Update scratch vector sizes */ + local_size = hypre_VectorSize(hypre_ParVectorLocalVector(F_array[level])); + hypre_ParVectorSetLocalSize(Vtemp, local_size); + hypre_ParVectorSetLocalSize(Ztemp, local_size); + CF_marker = NULL; if (CF_marker_array[level]) { @@ -489,55 +409,53 @@ hypre_MGRFrelaxVcycle ( void *Frelax_vdata, hypre_ParVector *f, hypre_ParVecto } else { - local_size = hypre_VectorSize(hypre_ParVectorLocalVector(F_array[level])); - hypre_VectorSize(hypre_ParVectorLocalVector(Vtemp)) = local_size; Aux_F = F_array[level]; Aux_U = U_array[level]; /* relax and visit next coarse grid */ - for (j = 0; j < num_sweeps; j++) { + for (j = 0; j < num_sweeps; j++) + { Solve_err_flag = hypre_BoomerAMGRelaxIF(A_array[level], - Aux_F, - CF_marker, - relax_type, - relax_order, - cycle_param, - relax_weight, - omega, - NULL, - Aux_U, - Vtemp, - Ztemp); + Aux_F, + CF_marker, + relax_type, + relax_order, + cycle_param, + relax_weight, + omega, + NULL, + Aux_U, + Vtemp, + Ztemp); } cycle_param = 1; } } else if (cycle_param == 3) { - if(hypre_ParAMGDataUserCoarseRelaxType(Frelax_data) == 9) + if (hypre_ParAMGDataUserCoarseRelaxType(Frelax_data) == 9) { - // solve the coarsest grid with Gaussian elimination + /* solve the coarsest grid with Gaussian elimination */ hypre_GaussElimSolve(Frelax_data, level, 9); } else { - // solve with relaxation - local_size = hypre_VectorSize(hypre_ParVectorLocalVector(F_array[level])); - hypre_VectorSize(hypre_ParVectorLocalVector(Vtemp)) = local_size; + /* solve with relaxation */ Aux_F = F_array[level]; Aux_U = U_array[level]; - for (j = 0; j < num_sweeps; j++) { + for (j = 0; j < num_sweeps; j++) + { Solve_err_flag = hypre_BoomerAMGRelaxIF(A_array[level], - Aux_F, - CF_marker, - relax_type, - relax_order, - cycle_param, - relax_weight, - omega, - NULL, - Aux_U, - Vtemp, - Ztemp); + Aux_F, + CF_marker, + relax_type, + relax_order, + cycle_param, + relax_weight, + omega, + NULL, + Aux_U, + Vtemp, + Ztemp); } } //hypre_printf("Vcycle smoother (coarse level): vtemp size = %d, level = %d \n", hypre_VectorSize(hypre_ParVectorLocalVector(Vtemp)), level); @@ -551,21 +469,22 @@ hypre_MGRFrelaxVcycle ( void *Frelax_vdata, hypre_ParVector *f, hypre_ParVecto * Reset counters and cycling parameters for finer level. *--------------------------------------------------------------*/ - fine_grid = level - 1; + fine_grid = level - 1; coarse_grid = level; - alpha = 1.0; - beta = 1.0; - hypre_ParCSRMatrixMatvec(alpha, P_array[fine_grid], - U_array[coarse_grid], - beta, U_array[fine_grid]); + + /* Update solution at the fine level */ + hypre_ParCSRMatrixMatvec(fp_one, P_array[fine_grid], + U_array[coarse_grid], + fp_one, U_array[fine_grid]); --level; cycle_param = 2; - if (level == 0) cycle_param = 99; + if (level == 0) { cycle_param = 99; } - // reset vtemp size + /* Update scratch vector sizes */ local_size = hypre_VectorSize(hypre_ParVectorLocalVector(F_array[level])); - hypre_VectorSize(hypre_ParVectorLocalVector(Vtemp)) = local_size; + hypre_ParVectorSetLocalSize(Vtemp, local_size); + hypre_ParVectorSetLocalSize(Ztemp, local_size); //hypre_printf("Vcycle smoother (up cycle): vtemp size = %d, level = %d \n", hypre_VectorSize(hypre_ParVectorLocalVector(Vtemp)), level); } else @@ -578,68 +497,100 @@ hypre_MGRFrelaxVcycle ( void *Frelax_vdata, hypre_ParVector *f, hypre_ParVecto return Solve_err_flag; } +/*-------------------------------------------------------------------------- + * hypre_MGRCycle + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_MGRCycle( void *mgr_vdata, - hypre_ParVector **F_array, - hypre_ParVector **U_array ) +hypre_MGRCycle( void *mgr_vdata, + hypre_ParVector **F_array, + hypre_ParVector **U_array ) { - MPI_Comm comm; - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; - - HYPRE_Int Solve_err_flag; - HYPRE_Int level; - HYPRE_Int coarse_grid; - HYPRE_Int fine_grid; - HYPRE_Int Not_Finished; - HYPRE_Int cycle_type; - HYPRE_Int print_level = (mgr_data -> print_level); - HYPRE_Int frelax_print_level = (mgr_data -> frelax_print_level); - - hypre_ParCSRMatrix **A_array = (mgr_data -> A_array); - hypre_ParCSRMatrix **RT_array = (mgr_data -> RT_array); - hypre_ParCSRMatrix **P_array = (mgr_data -> P_array); - hypre_ParCSRMatrix *RAP = (mgr_data -> RAP); - HYPRE_Int use_default_cgrid_solver = (mgr_data -> use_default_cgrid_solver); - HYPRE_Solver cg_solver = (mgr_data -> coarse_grid_solver); - HYPRE_Int (*coarse_grid_solver_solve)(void*, void*, void*, void*) = (mgr_data -> coarse_grid_solver_solve); - - hypre_IntArray **CF_marker = (mgr_data -> CF_marker_array); - HYPRE_Int nsweeps = (mgr_data -> num_relax_sweeps); - HYPRE_Int relax_type = (mgr_data -> relax_type); - HYPRE_Real relax_weight = (mgr_data -> relax_weight); - HYPRE_Real omega = (mgr_data -> omega); - hypre_Vector **relax_l1_norms = (mgr_data -> l1_norms); - hypre_ParVector *Vtemp = (mgr_data -> Vtemp); - hypre_ParVector *Ztemp = (mgr_data -> Ztemp); -// hypre_ParVector *Utemp = (mgr_data -> Utemp); + MPI_Comm comm; + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + hypre_Solver *aff_base; + + HYPRE_Int local_size; + HYPRE_Int level; + HYPRE_Int coarse_grid; + HYPRE_Int fine_grid; + HYPRE_Int Not_Finished; + HYPRE_Int cycle_type; + HYPRE_Int print_level = (mgr_data -> print_level); + HYPRE_Int frelax_print_level = (mgr_data -> frelax_print_level); + + HYPRE_Complex *l1_norms; + HYPRE_Int *CF_marker_data; + + hypre_ParCSRMatrix **A_array = (mgr_data -> A_array); + hypre_ParCSRMatrix **RT_array = (mgr_data -> RT_array); + hypre_ParCSRMatrix **P_array = (mgr_data -> P_array); + hypre_ParCSRMatrix **R_array = (mgr_data -> R_array); +#if defined(HYPRE_USING_GPU) + hypre_ParCSRMatrix **B_array = (mgr_data -> B_array); + hypre_ParCSRMatrix **B_FF_array = (mgr_data -> B_FF_array); + hypre_ParCSRMatrix **P_FF_array = (mgr_data -> P_FF_array); +#endif + hypre_ParCSRMatrix *RAP = (mgr_data -> RAP); + HYPRE_Int use_default_cgrid_solver = (mgr_data -> use_default_cgrid_solver); + HYPRE_Solver cg_solver = (mgr_data -> coarse_grid_solver); + HYPRE_Int (*coarse_grid_solver_solve)(void*, void*, void*, void*) = + (mgr_data -> coarse_grid_solver_solve); + + hypre_IntArray **CF_marker = (mgr_data -> CF_marker_array); + HYPRE_Int *nsweeps = (mgr_data -> num_relax_sweeps); + HYPRE_Int relax_type = (mgr_data -> relax_type); + HYPRE_Real relax_weight = (mgr_data -> relax_weight); + HYPRE_Real omega = (mgr_data -> omega); + hypre_Vector **l1_norms_array = (mgr_data -> l1_norms); + hypre_ParVector *Vtemp = (mgr_data -> Vtemp); + hypre_ParVector *Ztemp = (mgr_data -> Ztemp); + hypre_ParVector *Utemp = (mgr_data -> Utemp); hypre_ParVector **U_fine_array = (mgr_data -> U_fine_array); hypre_ParVector **F_fine_array = (mgr_data -> F_fine_array); - HYPRE_Int (*fine_grid_solver_solve)(void*, void*, void*, void*) = (mgr_data -> fine_grid_solver_solve); + HYPRE_Int (*fine_grid_solver_solve)(void*, void*, void*, void*) = + (mgr_data -> fine_grid_solver_solve); hypre_ParCSRMatrix **A_ff_array = (mgr_data -> A_ff_array); - HYPRE_Int i, relax_points; - HYPRE_Int num_coarse_levels = (mgr_data -> num_coarse_levels); - - HYPRE_Real alpha; - HYPRE_Real beta; - - HYPRE_Int *Frelax_method = (mgr_data -> Frelax_method); - hypre_ParAMGData **FrelaxVcycleData = (mgr_data -> FrelaxVcycleData); - - HYPRE_Int *restrict_type = (mgr_data -> restrict_type); - HYPRE_Int use_air = 0; - HYPRE_Int my_id; - -// HYPRE_Real wall_time; + HYPRE_Int i, relax_points; + HYPRE_Int num_coarse_levels = (mgr_data -> num_coarse_levels); + + HYPRE_Complex fp_zero = 0.0; + HYPRE_Complex fp_one = 1.0; + HYPRE_Complex fp_neg_one = - fp_one; + + HYPRE_Int *Frelax_type = (mgr_data -> Frelax_type); + HYPRE_Int *interp_type = (mgr_data -> interp_type); + hypre_ParAMGData **FrelaxVcycleData = (mgr_data -> FrelaxVcycleData); + HYPRE_Real **frelax_diaginv = (mgr_data -> frelax_diaginv); + HYPRE_Int *blk_size = (mgr_data -> blk_size); + HYPRE_Int block_size = (mgr_data -> block_size); + HYPRE_Int *block_num_coarse_indexes = (mgr_data -> block_num_coarse_indexes); + /* TODO (VPM): refactor names blk_size and block_size */ + + HYPRE_Int *level_smooth_type = (mgr_data -> level_smooth_type); + HYPRE_Int *level_smooth_iters = (mgr_data -> level_smooth_iters); + + HYPRE_Int *restrict_type = (mgr_data -> restrict_type); + HYPRE_Int pre_smoothing = (mgr_data -> global_smooth_cycle) == 1 ? 1 : 0; + HYPRE_Int post_smoothing = (mgr_data -> global_smooth_cycle) == 2 ? 1 : 0; + HYPRE_Int my_id; + char region_name[1024]; + char msg[1024]; + +#if defined(HYPRE_USING_GPU) + HYPRE_MemoryLocation memory_location; + HYPRE_ExecutionPolicy exec; +#endif /* Initialize */ HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("MGRCycle"); comm = hypre_ParCSRMatrixComm(A_array[0]); hypre_MPI_Comm_rank(comm, &my_id); - Solve_err_flag = 0; Not_Finished = 1; cycle_type = 1; level = 0; @@ -647,269 +598,687 @@ hypre_MGRCycle( void *mgr_vdata, /***** Main loop ******/ while (Not_Finished) { + /* Update scratch vector sizes */ + local_size = hypre_VectorSize(hypre_ParVectorLocalVector(F_array[level])); + hypre_ParVectorSetLocalSize(Vtemp, local_size); + hypre_ParVectorSetLocalSize(Ztemp, local_size); + hypre_ParVectorSetLocalSize(Utemp, local_size); + /* Do coarse grid correction solve */ - if(cycle_type == 3) + if (cycle_type == 3) { - /* call coarse grid solver here */ - /* default is BoomerAMG */ - //wall_time = time_getWallclockSeconds(); + /* call coarse grid solver here (default is BoomerAMG) */ + hypre_sprintf(region_name, "%s-%d", "MGR_Level", level); + hypre_GpuProfilingPushRange(region_name); + HYPRE_ANNOTATE_REGION_BEGIN("%s", region_name); + coarse_grid_solver_solve(cg_solver, RAP, F_array[level], U_array[level]); if (use_default_cgrid_solver) { HYPRE_Real convergence_factor_cg; hypre_BoomerAMGGetRelResidualNorm(cg_solver, &convergence_factor_cg); (mgr_data -> cg_convergence_factor) = convergence_factor_cg; - if ((print_level) > 1 && my_id == 0 && convergence_factor_cg > 1.0) + if ((print_level) > 1 && my_id == 0 && convergence_factor_cg > hypre_cabs(fp_one)) { - hypre_printf("Warning!!! Coarse grid solve diverges. Factor = %1.2e\n", convergence_factor_cg); + hypre_printf("Warning!!! Coarse grid solve diverges. Factor = %1.2e\n", + convergence_factor_cg); } } - //wall_time = time_getWallclockSeconds() - wall_time; - //if (my_id == 0) hypre_printf("Coarse grid solve: %f\n", wall_time); - // DEBUG: print the coarse system indicated by mgr_data ->print_coarse_system - if(mgr_data -> print_coarse_system) + /* Error checking */ + if (HYPRE_GetError()) + { + hypre_sprintf(msg, "[%d]: Error from MGR's coarsest level solver (level %d)\n", + my_id, level); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, msg); + HYPRE_ClearAllErrors(); + } + + /* DEBUG: print the coarse system indicated by mgr_data->print_coarse_system */ + if (mgr_data -> print_coarse_system) { - //HYPRE_ParCSRMatrixPrint(RAP, "RAP_mat"); - //HYPRE_ParVectorPrint(F_array[level], "RAP_rhs"); - //HYPRE_ParVectorPrint(U_array[level], "RAP_sol"); hypre_ParCSRMatrixPrintIJ(RAP, 1, 1, "RAP_mat"); hypre_ParVectorPrintIJ(F_array[level], 1, "RAP_rhs"); hypre_ParVectorPrintIJ(U_array[level], 1, "RAP_sol"); mgr_data -> print_coarse_system--; } + /**** cycle up ***/ cycle_type = 2; + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_REGION_END("%s", region_name); } - /* F-relaxation */ - else if(cycle_type == 1) + /* Down cycle */ + else if (cycle_type == 1) { - fine_grid = level; - coarse_grid = level + 1; - /* Relax solution - F-relaxation */ - relax_points = -1; + /* Set fine/coarse grid level indices */ + fine_grid = level; + coarse_grid = level + 1; + l1_norms = l1_norms_array[fine_grid] ? + hypre_VectorData(l1_norms_array[fine_grid]) : NULL; + CF_marker_data = hypre_IntArrayData(CF_marker[fine_grid]); + +#if defined(HYPRE_USING_GPU) + memory_location = hypre_ParCSRMatrixMemoryLocation(A_array[fine_grid]); + exec = hypre_GetExecPolicy1(memory_location); +#endif + + hypre_sprintf(region_name, "%s-%d", "MGR_Level", fine_grid); + hypre_GpuProfilingPushRange(region_name); + HYPRE_ANNOTATE_REGION_BEGIN("%s", region_name); + + /* Global pre smoothing sweeps */ + if (pre_smoothing && (level_smooth_iters[fine_grid] > 0)) + { + hypre_sprintf(region_name, "Global-Relax"); + hypre_GpuProfilingPushRange(region_name); + HYPRE_ANNOTATE_REGION_BEGIN("%s", region_name); + + if ((level_smooth_type[fine_grid]) == 0 || + (level_smooth_type[fine_grid]) == 1) + { + /* Block Jacobi/Gauss-Seidel smoother */ +#if defined(HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_DEVICE) + { + for (i = 0; i < level_smooth_iters[fine_grid]; i++) + { + hypre_MGRBlockRelaxSolveDevice(B_array[fine_grid], A_array[fine_grid], + F_array[fine_grid], U_array[fine_grid], + Vtemp, fp_one); + } + } + else +#endif + { + HYPRE_Real *level_diaginv = (mgr_data -> level_diaginv)[fine_grid]; + HYPRE_Int level_blk_size = (level == 0) ? block_size : + block_num_coarse_indexes[level - 1]; + HYPRE_Int nrows = hypre_ParCSRMatrixNumRows(A_array[fine_grid]); + HYPRE_Int n_block = nrows / level_blk_size; + HYPRE_Int left_size = nrows - n_block * level_blk_size; + for (i = 0; i < level_smooth_iters[fine_grid]; i++) + { + hypre_MGRBlockRelaxSolve(A_array[fine_grid], F_array[fine_grid], + U_array[fine_grid], level_blk_size, + n_block, left_size, level_smooth_type[fine_grid], + level_diaginv, Vtemp); + } + } + } + else if ((level_smooth_type[fine_grid] > 1) && + (level_smooth_type[fine_grid] < 7)) + { + for (i = 0; i < level_smooth_iters[fine_grid]; i ++) + { + hypre_BoomerAMGRelax(A_array[fine_grid], F_array[fine_grid], NULL, + level_smooth_type[fine_grid] - 1, 0, fp_one, + fp_zero, NULL, U_array[fine_grid], Vtemp, NULL); + } + } + else if (level_smooth_type[fine_grid] == 8) + { + /* Euclid ILU smoother */ + for (i = 0; i < level_smooth_iters[fine_grid]; i++) + { + /* Compute residual */ + hypre_ParCSRMatrixMatvecOutOfPlace(fp_neg_one, A_array[fine_grid], + U_array[fine_grid], fp_one, + F_array[fine_grid], Vtemp); - //wall_time = time_getWallclockSeconds() - wall_time; - if (Frelax_method[level] == 0) - { /* (single level) relaxation for A_ff */ - if (relax_type == 18) + /* Solve */ + HYPRE_EuclidSolve((mgr_data -> level_smoother)[fine_grid], + A_array[fine_grid], Vtemp, Utemp); + + /* Update solution */ + hypre_ParVectorAxpy(fp_one, Utemp, U_array[fine_grid]); + } + } + else if ((mgr_data -> level_smoother)[fine_grid]) + { + /* Generic smoother object */ + hypre_Solver *base = (hypre_Solver*) (mgr_data -> level_smoother)[fine_grid]; + + hypre_SolverSolve(base)((mgr_data -> level_smoother)[fine_grid], + (HYPRE_Matrix) A_array[fine_grid], + (HYPRE_Vector) F_array[fine_grid], + (HYPRE_Vector) U_array[fine_grid]); + } + else { - for(i=0; i 1) - { - hypre_ParCSRMatrixMatvecOutOfPlace(-1.0, A_array[level], - U_array[level], 1.0, F_array[level], Vtemp); - - resnorm = hypre_ParVectorInnerProd(Vtemp, Vtemp); - init_resnorm = resnorm; - rhs_norm = sqrt(hypre_ParVectorInnerProd(F_array[level], F_array[level])); - - if (rhs_norm > HYPRE_REAL_EPSILON) - { - rel_resnorm = init_resnorm / rhs_norm; - } - else - { - /* rhs is zero, return a zero solution */ - hypre_ParVectorSetConstantValues(U_array[0], 0.0); - - HYPRE_ANNOTATE_FUNC_END; - - return hypre_error_flag; - } - if(my_id == 0) - { - hypre_printf("\nBegin F-relaxation: V-Cycle Smoother \n"); - hypre_printf(" relative\n"); - hypre_printf(" residual factor residual\n"); - hypre_printf(" -------- ------ --------\n"); - hypre_printf(" Initial %e %e\n",init_resnorm, - rel_resnorm); + { + hypre_ParCSRMatrixMatvecOutOfPlace(fp_neg_one, A_array[fine_grid], + U_array[fine_grid], fp_one, + F_array[fine_grid], Vtemp); + + resnorm = hypre_sqrt(hypre_ParVectorInnerProd(Vtemp, Vtemp)); + init_resnorm = resnorm; + rhs_norm = hypre_sqrt(hypre_ParVectorInnerProd(F_array[fine_grid], F_array[fine_grid])); + + if (rhs_norm > HYPRE_REAL_EPSILON) + { + rel_resnorm = init_resnorm / rhs_norm; + } + else + { + /* rhs is zero, return a zero solution */ + hypre_ParVectorSetZeros(U_array[0]); + + HYPRE_ANNOTATE_FUNC_END; + hypre_GpuProfilingPopRange(); + + return hypre_error_flag; + } + if (my_id == 0 && frelax_print_level > 1) + { + hypre_printf("\nBegin F-relaxation: V-Cycle Smoother \n"); + hypre_printf(" relative\n"); + hypre_printf(" residual factor residual\n"); + hypre_printf(" -------- ------ --------\n"); + hypre_printf(" Initial %e %e\n", init_resnorm, + rel_resnorm); } } - for(i=0; i 1) + hypre_MGRFrelaxVcycle(FrelaxVcycleData[fine_grid], + F_array[fine_grid], + U_array[fine_grid]); + + if (frelax_print_level > 1) { old_resnorm = resnorm; - hypre_ParCSRMatrixMatvecOutOfPlace(-1.0, A_array[level], - U_array[level], 1.0, F_array[level], Vtemp); - resnorm = hypre_ParVectorInnerProd(Vtemp, Vtemp); - - if (old_resnorm) conv_factor = resnorm / old_resnorm; - else conv_factor = resnorm; - - if (rhs_norm > HYPRE_REAL_EPSILON) - { - rel_resnorm = resnorm / rhs_norm; - } - else - { - rel_resnorm = resnorm; - } - - if (my_id == 0 ) + hypre_ParCSRMatrixMatvecOutOfPlace(fp_neg_one, A_array[fine_grid], + U_array[fine_grid], fp_one, + F_array[fine_grid], Vtemp); + resnorm = hypre_sqrt(hypre_ParVectorInnerProd(Vtemp, Vtemp)); + conv_factor = (old_resnorm > HYPRE_REAL_EPSILON) ? + (resnorm / old_resnorm) : resnorm; + rel_resnorm = (rhs_norm > HYPRE_REAL_EPSILON) ? (resnorm / rhs_norm) : resnorm; + + if (my_id == 0) { - hypre_printf("\n V-Cycle %2d %e %f %e \n", i, - resnorm, conv_factor, rel_resnorm); + hypre_printf("\n V-Cycle %2d %e %f %e \n", i, + resnorm, conv_factor, rel_resnorm); } } } if (my_id == 0 && frelax_print_level > 1) - { - hypre_printf("End F-relaxation: V-Cycle Smoother \n\n"); + { + hypre_printf("End F-relaxation: V-Cycle Smoother \n\n"); } // compute residual after solve - //hypre_ParCSRMatrixMatvecOutOfPlace(-1.0, A_array[level], - // U_array[level], 1.0, F_array[level], Vtemp); + //hypre_ParCSRMatrixMatvecOutOfPlace(fp_neg_one, A_array[fine_grid], + // U_array[fine_grid], fp_one, + // F_array[fine_grid], Vtemp); //convergence_factor_frelax = hypre_ParVectorInnerProd(Vtemp, Vtemp)/convergence_factor_frelax; //hypre_printf("F-relaxation V-cycle convergence factor: %5f\n", convergence_factor_frelax); } - else if (Frelax_method[level] == 2) + else if (Frelax_type[level] == 2 || + Frelax_type[level] == 9 || + Frelax_type[level] == 99 || + Frelax_type[level] == 199) { - // We need to first compute residual to ensure that - // F-relaxation is reducing the global residual - - alpha = -1.0; - beta = 1.0; - hypre_ParCSRMatrixMatvecOutOfPlace(alpha, A_array[fine_grid], U_array[fine_grid], beta, F_array[fine_grid], Vtemp); - - // restrict to F points -// hypre_ParVectorSetConstantValues(F_fine_array[coarse_grid], 0.0); - hypre_MGRAddVectorR(hypre_IntArrayData(CF_marker[fine_grid]), FMRK, 1.0, Vtemp, 0.0, &(F_fine_array[coarse_grid])); - // initialize solution array - hypre_ParVectorSetConstantValues(U_fine_array[coarse_grid], 0.0); - // solve - fine_grid_solver_solve((mgr_data -> aff_solver)[fine_grid], A_ff_array[fine_grid], F_fine_array[coarse_grid], - U_fine_array[coarse_grid]); - // update solution - hypre_MGRAddVectorP(hypre_IntArrayData(CF_marker[fine_grid]), FMRK, 1.0, U_fine_array[coarse_grid], 1.0, &(U_array[fine_grid])); + /* We need to compute the residual first to ensure that + F-relaxation is reducing the global residual */ + hypre_ParCSRMatrixMatvecOutOfPlace(fp_neg_one, A_array[fine_grid], + U_array[fine_grid], fp_one, + F_array[fine_grid], Vtemp); + + /* Restrict to F points */ +#if defined(HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_ParCSRMatrixMatvecT(fp_one, P_FF_array[fine_grid], Vtemp, + fp_zero, F_fine_array[coarse_grid]); + } + else +#endif + { + hypre_MGRAddVectorR(CF_marker[fine_grid], FMRK, fp_one, Vtemp, + fp_zero, &(F_fine_array[coarse_grid])); + } + + /* Set initial guess to zeros */ + hypre_ParVectorSetZeros(U_fine_array[coarse_grid]); + + if (Frelax_type[level] == 2) + { + /* Do F-relaxation using AMG */ + if (level == 0) + { + /* TODO (VPM): unify with the next block */ + fine_grid_solver_solve((mgr_data -> aff_solver)[fine_grid], + A_ff_array[fine_grid], + F_fine_array[coarse_grid], + U_fine_array[coarse_grid]); + } + else + { + aff_base = (hypre_Solver*) (mgr_data -> aff_solver)[level]; + + hypre_SolverSolve(aff_base)((HYPRE_Solver) (mgr_data -> aff_solver)[level], + (HYPRE_Matrix) A_ff_array[level], + (HYPRE_Vector) F_fine_array[level + 1], + (HYPRE_Vector) U_fine_array[level + 1]); + } + } + else + { + /* Do F-relaxation using Gaussian Elimination */ + hypre_GaussElimSolve((mgr_data -> GSElimData)[fine_grid], + level, Frelax_type[level]); + } + + /* Interpolate the solution back to the fine grid level */ +#if defined(HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_ParCSRMatrixMatvec(fp_one, P_FF_array[fine_grid], + U_fine_array[coarse_grid], fp_one, + U_array[fine_grid]); + } + else +#endif + { + hypre_MGRAddVectorP(CF_marker[fine_grid], FMRK, fp_one, + U_fine_array[coarse_grid], fp_one, + &(U_array[fine_grid])); + } } else { - for (i=0; i 0 || (exec == HYPRE_EXEC_DEVICE)) +#else + if (restrict_type[fine_grid] > 0) +#endif + { + hypre_ParCSRMatrixMatvecT(fp_one, RT_array[fine_grid], Vtemp, + fp_zero, F_array[coarse_grid]); + } + else + { + hypre_MGRAddVectorR(CF_marker[fine_grid], CMRK, fp_one, + Vtemp, fp_zero, &(F_array[coarse_grid])); + } } - // initialize coarse grid solution array - hypre_ParVectorSetConstantValues(U_array[coarse_grid], 0.0); + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_REGION_END("%s", region_name); - ++level; + hypre_sprintf(region_name, "%s-%d", "MGR_Level", fine_grid); + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_REGION_END("%s", region_name); - if (level == num_coarse_levels) cycle_type = 3; - } // end cycle_type == 1 - else if(level != 0) + /* Initialize coarse grid solution array (VPM: double-check this for multiple cycles)*/ + hypre_ParVectorSetZeros(U_array[coarse_grid]); + + ++level; + if (level == num_coarse_levels) + { + cycle_type = 3; + } + } + /* Up cycle */ + else if (level != 0) { + /* Set fine/coarse grid level indices */ + fine_grid = level - 1; + coarse_grid = level; + l1_norms = l1_norms_array[fine_grid] ? + hypre_VectorData(l1_norms_array[fine_grid]) : NULL; + CF_marker_data = hypre_IntArrayData(CF_marker[fine_grid]); + +#if defined(HYPRE_USING_GPU) + memory_location = hypre_ParCSRMatrixMemoryLocation(A_array[fine_grid]); + exec = hypre_GetExecPolicy1(memory_location); +#endif + + hypre_sprintf(region_name, "%s-%d", "MGR_Level", fine_grid); + hypre_GpuProfilingPushRange(region_name); + HYPRE_ANNOTATE_REGION_BEGIN("%s", region_name); + /* Interpolate */ + hypre_sprintf(region_name, "Prolongate"); + hypre_GpuProfilingPushRange(region_name); + HYPRE_ANNOTATE_REGION_BEGIN("%s", region_name); + +#if defined(HYPRE_USING_GPU) + if (interp_type[fine_grid] > 0 || (exec == HYPRE_EXEC_DEVICE)) +#else + if (interp_type[fine_grid] > 0) +#endif + { + hypre_ParCSRMatrixMatvec(fp_one, P_array[fine_grid], + U_array[coarse_grid], + fp_one, U_array[fine_grid]); + } + else + { + hypre_MGRAddVectorP(CF_marker[fine_grid], CMRK, fp_one, + U_array[coarse_grid], fp_one, + &(U_array[fine_grid])); + } - fine_grid = level - 1; - coarse_grid = level; - alpha = 1.0; - beta = 1.0; + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_REGION_END("%s", region_name); - hypre_ParCSRMatrixMatvec(alpha, P_array[fine_grid], - U_array[coarse_grid], - beta, U_array[fine_grid]); + /* Global post smoothing sweeps */ + if (post_smoothing & (level_smooth_iters[fine_grid] > 0)) + { + hypre_sprintf(region_name, "Global-Relax"); + hypre_GpuProfilingPushRange(region_name); + HYPRE_ANNOTATE_REGION_BEGIN("%s", region_name); - /* post relaxation sweeps */ - /* - if (level == 2) + /* Block Jacobi smoother */ + if ((level_smooth_type[fine_grid] == 0) || + (level_smooth_type[fine_grid] == 1)) + { +#if defined(HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_DEVICE) + { + for (i = 0; i < level_smooth_iters[fine_grid]; i++) + { + hypre_MGRBlockRelaxSolveDevice(B_array[fine_grid], A_array[fine_grid], + F_array[fine_grid], U_array[fine_grid], + Vtemp, fp_one); + } + } + else +#endif + { + HYPRE_Real *level_diaginv = (mgr_data -> level_diaginv)[fine_grid]; + HYPRE_Int level_blk_size = (fine_grid == 0) ? block_size : + block_num_coarse_indexes[fine_grid - 1]; + HYPRE_Int nrows = hypre_ParCSRMatrixNumRows(A_array[fine_grid]); + HYPRE_Int n_block = nrows / level_blk_size; + HYPRE_Int left_size = nrows - n_block * level_blk_size; + for (i = 0; i < level_smooth_iters[fine_grid]; i++) + { + hypre_MGRBlockRelaxSolve(A_array[fine_grid], F_array[fine_grid], + U_array[fine_grid], level_blk_size, n_block, + left_size, level_smooth_type[fine_grid], + level_diaginv, Vtemp); + } + } + } + else if ((level_smooth_type[fine_grid] > 1) && (level_smooth_type[fine_grid] < 7)) { - hypre_printf("Size of A: %d\n", hypre_ParCSRMatrixGlobalNumRows(A_array[fine_grid])); - for(i=0; i level_smoother)[fine_grid], + A_array[fine_grid], Vtemp, Utemp); + + /* Update solution */ + hypre_ParVectorAxpy(fp_one, Utemp, U_array[fine_grid]); + } } + else if (level_smooth_type[fine_grid] == 16) + { + /* HYPRE ILU */ + HYPRE_ILUSolve((mgr_data -> level_smoother)[fine_grid], + A_array[fine_grid], F_array[fine_grid], + U_array[fine_grid]); } - */ + else if ((mgr_data -> level_smoother)[fine_grid]) + { + /* User smoother */ + hypre_Solver *base = (hypre_Solver*) (mgr_data -> level_smoother)[fine_grid]; - if (Solve_err_flag != 0) - { - HYPRE_ANNOTATE_FUNC_END; - return(Solve_err_flag); - } + hypre_SolverSolve(base)((mgr_data -> level_smoother)[fine_grid], + (HYPRE_Matrix) A_array[fine_grid], + (HYPRE_Vector) F_array[fine_grid], + (HYPRE_Vector) U_array[fine_grid]); + } + else + { + /* Generic relaxation interface */ + for (i = 0; i < level_smooth_iters[level]; i++) + { + hypre_BoomerAMGRelax(A_array[fine_grid], F_array[fine_grid], + NULL, level_smooth_type[fine_grid], 0, + fp_one, fp_one, l1_norms, + U_array[fine_grid], Vtemp, Ztemp); + } + } + + /* Error checking */ + if (HYPRE_GetError()) + { + hypre_sprintf(msg, "[%d]: Error from global post-relaxation %d at MGR level %d\n", + my_id, level_smooth_type[fine_grid], fine_grid); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, msg); + HYPRE_ClearAllErrors(); + } + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_REGION_END("%s", region_name); + } /* End post-smoothing */ + + hypre_sprintf(region_name, "%s-%d", "MGR_Level", fine_grid); + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_REGION_END("%s", region_name); --level; - } // end interpolate + } /* End interpolate */ else { Not_Finished = 0; } } HYPRE_ANNOTATE_FUNC_END; + hypre_GpuProfilingPopRange(); - return Solve_err_flag; + return hypre_error_flag; } diff --git a/external/hypre/src/parcsr_ls/par_mgr_stats.c b/external/hypre/src/parcsr_ls/par_mgr_stats.c new file mode 100644 index 00000000..3f331469 --- /dev/null +++ b/external/hypre/src/parcsr_ls/par_mgr_stats.c @@ -0,0 +1,745 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#include "_hypre_parcsr_ls.h" +#include "par_mgr.h" /* TODO (VPM): include this into _hypre_parcsr_ls.h */ +#include "par_ilu.h" /* TODO (VPM): include this into _hypre_parcsr_ls.h */ + +/*-------------------------------------------------------------------- + * hypre_MGRGetGlobalRelaxName + *--------------------------------------------------------------------*/ + +const char* +hypre_MGRGetGlobalRelaxName(hypre_ParMGRData *mgr_data, + HYPRE_Int level ) +{ + HYPRE_Int smoother_type = hypre_ParMGRDataLevelSmoothTypeI(mgr_data, level); + + if ((mgr_data -> level_smooth_iters)[level] < 1) + { + return "--"; + } + + switch (smoother_type) + { + case 0: + return "Blk-Jacobi"; + + case 1: + return "Blk-GS"; + + case 2: + return "GS"; + + case 3: + return "Forward hGS"; + + case 4: + return "Backward hGS"; + + case 5: + return "Chaotic hGS"; + + case 6: + return "hSGS"; + + case 7: + return "Jacobi"; + + case 8: + return "Euclid ILU"; + + case 13: + return "Forward L1-hGS"; + + case 14: + return "Backward L1-hGS"; + + case 16: + /* TODO (VPM): Move this to hypre_ILUGetName */ + { + hypre_ParILUData *ilu_smoother = (hypre_ParILUData*) + hypre_ParMGRDataLevelSmootherI(mgr_data, level); + HYPRE_Int ilu_type = hypre_ParILUDataIluType(ilu_smoother); + HYPRE_Int ilu_fill = hypre_ParILUDataLfil(ilu_smoother); + + switch (ilu_type) + { + case 0: + return (ilu_fill == 0) ? "BJ-ILU0" : "BJ-ILUK"; + + case 1: + return "BJ-ILUT"; + + case 10: + return (ilu_fill == 0) ? "GMRES-ILU0" : "GMRES-ILUK"; + + case 11: + return "GMRES-ILUT"; + + case 20: + return (ilu_fill == 0) ? "NSH-ILU0" : "NSH-ILUK"; + + case 21: + return "NSH-ILUT"; + + case 30: + return (ilu_fill == 0) ? "RAS-ILU0" : "RAS-ILUK"; + + case 31: + return "RAS-ILUT"; + + case 40: + return (ilu_fill == 0) ? "ddPQ-GMRES-ILU0" : "ddPQ-GMRES-ILUK"; + + case 41: + return "ddPQ-GMRES-ILUT"; + + case 50: + return "RAP-modILU0"; + + default: + return "Unknown"; + } + } + + default: + return "Unknown"; + } +} + +/*-------------------------------------------------------------------- + * hypre_MGRGetFRelaxName + *--------------------------------------------------------------------*/ + +const char* +hypre_MGRGetFRelaxName(hypre_ParMGRData *mgr_data, + HYPRE_Int level ) +{ + HYPRE_Int F_relax_type = hypre_ParMGRDataFRelaxTypeI(mgr_data, level); + + if ((mgr_data -> num_relax_sweeps)[level] < 1) + { + return "--"; + } + + switch (F_relax_type) + { + case 0: case 7: + if (hypre_ParMGRDataInterpTypeI(mgr_data, level) == 12) + { + return "Blk-Jacobi"; + } + else + { + return "Jacobi"; + } + + case 1: + return "Default AMG"; + + case 2: + return "User AMG"; + + case 3: + return "Forward hGS"; + + case 4: + return "Backward hGS"; + + case 5: + return "Chaotic hGS"; + + case 6: + return "hSGS"; + + case 8: + return "L1-hSGS"; + + case 9: + return "GaussElim"; + + case 13: + return "Forward L1-hGS"; + + case 14: + return "Backward L1-hGS"; + + case 16: + return "Chebyshev"; + + case 19: + return "LU"; + + case 99: + return "LU piv"; + + case 199: + return "Dense Inv"; + + default: + return "Unknown"; + } +} + +/*-------------------------------------------------------------------- + * hypre_MGRGetProlongationName + *--------------------------------------------------------------------*/ + +const char* +hypre_MGRGetProlongationName(hypre_ParMGRData *mgr_data, + HYPRE_Int level ) +{ + switch (hypre_ParMGRDataInterpTypeI(mgr_data, level)) + { + case 0: + return "Injection"; + + case 1: + return "L1-Jac Inv"; + + case 2: + return "Diag Inv"; + + case 4: + return "Approx Inv"; + + case 5: + return "MM-ext"; + + case 6: + return "MM-ext+i"; + + case 7: + return "MM-ext+e"; + + case 12: + return "Blk-Diag Inv"; + + default: + return "Classical"; + } +} + +/*-------------------------------------------------------------------- + * hypre_MGRGetRestrictionName + *--------------------------------------------------------------------*/ + +const char* +hypre_MGRGetRestrictionName(hypre_ParMGRData *mgr_data, + HYPRE_Int level ) +{ + switch (hypre_ParMGRDataRestrictTypeI(mgr_data, level)) + { + case 0: + return "Injection"; + + case 1: + return "L1-Jac Inv"; + + case 2: + return "Diag Inv"; + + case 3: + return "Approx Inv"; + + case 12: + return "Blk-Diag Inv"; + + case 13: + return "CPR-like"; + + case 14: + return "Blk-ColLumped"; + + default: + return "Classical"; + } +} + +/*-------------------------------------------------------------------- + * hypre_MGRGetCoarseGridName + *--------------------------------------------------------------------*/ + +const char* +hypre_MGRGetCoarseGridName(hypre_ParMGRData *mgr_data, + HYPRE_Int level ) +{ + switch (hypre_ParMGRDataCoarseGridMethodI(mgr_data, level)) + { + case 0: + return "Glk-RAP"; + + case 1: + return "NG-BlkDiag"; + + case 2: + return "NG-CPR-Diag"; + + case 3: + return "NG-CPR-BlkDiag"; + + case 4: + return "NG-ApproxInv"; + + case 5: + return "NG-A_CC"; + + default: + return "Unknown"; + } +} + +/*-------------------------------------------------------------------- + * hypre_MGRSetupStats + * + * TODO (VPM): + * 1) Add total number of GPUs or number of ranks using 1 GPU? + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetupStats(void *mgr_vdata) +{ + hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; + + /* MGR data */ + HYPRE_Int print_level = (mgr_data -> print_level); + hypre_ParCSRMatrix *A_finest = hypre_ParMGRDataA(mgr_data, 0); + hypre_ParCSRMatrix *A_coarsest = hypre_ParMGRDataRAP(mgr_data); + HYPRE_Int num_levels_mgr = hypre_ParMGRDataNumCoarseLevels(mgr_data); + HYPRE_Solver coarse_solver = hypre_ParMGRDataCoarseGridSolver(mgr_data); + HYPRE_Solver **A_FF_solver = hypre_ParMGRDataAFFsolver(mgr_data); + HYPRE_Int *Frelax_type = hypre_ParMGRDataFRelaxType(mgr_data); + HYPRE_Int block_size = hypre_ParMGRDataBlockSize(mgr_data); + HYPRE_Int *block_num_Cpts = hypre_ParMGRDataBlockNumCoarseIndexes(mgr_data); + HYPRE_Int **block_CF_marker = hypre_ParMGRDataBlockCFMarker(mgr_data); + + /* Finest matrix variables */ + MPI_Comm comm = hypre_ParCSRMatrixComm(A_finest); + HYPRE_MemoryLocation memory_location = hypre_ParCSRMatrixMemoryLocation(A_finest); + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1(memory_location); + + /* Local variables */ + hypre_ParAMGData *amg_solver = NULL; + hypre_ParAMGData *coarse_amg_solver = NULL; + hypre_ParCSRMatrix **A_array; + hypre_ParCSRMatrix **P_array; + hypre_ParCSRMatrix **R_array; + hypre_ParCSRMatrix **RT_array; + hypre_MatrixStatsArray *stats_array; + + HYPRE_Real *gridcomp; + HYPRE_Real *opcomp; + HYPRE_Real *memcomp; + + HYPRE_Int max_length; + char *coarse_dofs_str = NULL; + + HYPRE_Int coarsest_mgr_level; + HYPRE_Int num_levels_total; + HYPRE_Int num_levels[2]; + HYPRE_Int max_levels; + HYPRE_Int *num_sublevels_amg; + HYPRE_Int num_procs, num_threads; + HYPRE_Int i, k, myid; + HYPRE_Int divisors[1]; + + /* Print statistics only if first print_level bit is set */ + if (!(print_level & HYPRE_MGR_PRINT_INFO_SETUP)) + { + return hypre_error_flag; + } + + /*------------------------------------------------- + * Initialize and allocate data + *-------------------------------------------------*/ + + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &myid); + num_threads = hypre_NumThreads(); + + coarsest_mgr_level = num_levels_mgr; + num_sublevels_amg = hypre_CTAlloc(HYPRE_Int, num_levels_mgr + 1, HYPRE_MEMORY_HOST); + + /* Check MGR's coarse level solver */ + if ((HYPRE_PtrToParSolverFcn) hypre_ParMGRDataCoarseGridSolverSetup(mgr_data) == + HYPRE_BoomerAMGSetup) + { + coarse_amg_solver = (hypre_ParAMGData *) coarse_solver; + num_sublevels_amg[coarsest_mgr_level] = hypre_ParAMGDataNumLevels(coarse_amg_solver); + } +#ifdef HYPRE_USING_DSUPERLU + else if ((HYPRE_PtrToParSolverFcn) hypre_ParMGRDataCoarseGridSolverSetup(mgr_data) == + (HYPRE_PtrToParSolverFcn) hypre_MGRDirectSolverSetup) + { + /* TODO (VPM): Set SuperLU solver specifics */ + num_sublevels_amg[coarsest_mgr_level] = 0; + } +#endif + else + { + hypre_TFree(num_sublevels_amg, HYPRE_MEMORY_HOST); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown coarsest level solver for MGR!\n"); + return hypre_error_flag; + } + num_levels_total = num_levels_mgr + num_sublevels_amg[coarsest_mgr_level]; + + /* Compute number of AMG sublevels at each MGR level */ + max_levels = num_levels_total; + for (i = 0; i < num_levels_mgr; i++) + { + if (Frelax_type[i] == 2) + { + amg_solver = (hypre_ParAMGData *) A_FF_solver[i]; + num_sublevels_amg[i] = hypre_ParAMGDataNumLevels(amg_solver); + + max_levels = hypre_max(max_levels, num_sublevels_amg[i]); + } + } + + /* Create array of statistics */ + stats_array = hypre_MatrixStatsArrayCreate(max_levels + 1); + + /*------------------------------------------------- + * Print general info + *-------------------------------------------------*/ + + if (!myid) + { + /* Determine max_length for printing coarse DOFs */ + if (block_num_Cpts) + { + coarse_dofs_str = hypre_ConvertIndicesToString(block_num_Cpts[0], block_CF_marker[0]); + max_length = hypre_min(strlen(coarse_dofs_str) + 2, 50); + hypre_TFree(coarse_dofs_str, HYPRE_MEMORY_HOST); + } + else + { + max_length = 10; + } + + hypre_printf("\n\n"); + hypre_printf(" Num MPI tasks = %d\n", num_procs); + hypre_printf(" Num OpenMP threads = %d\n", num_threads); + hypre_printf(" Execution policy = %s\n\n", HYPRE_GetExecutionPolicyName(exec)); + hypre_printf("\n"); + hypre_printf("MGR SETUP PARAMETERS:\n\n"); + hypre_printf(" MGR num levels = %d\n", num_levels_mgr); + hypre_printf(" coarse AMG num levels = %d\n", num_sublevels_amg[coarsest_mgr_level]); + hypre_printf(" Total num levels = %d\n\n", num_levels_total); + + divisors[0] = 83 + max_length; + //hypre_printf("\nMGR level options:\n\n"); + hypre_printf("%10s %*s %11s %14s %14s\n", + "Total", max_length, "Coarse", "Global", "Fine", "Coarse"); + hypre_printf("%3s %6s %*s %11s %14s %14s %14s %14s\n", "lev", + "DOFs", max_length, "DOFs", "relaxation", "relaxation", + "grid method", "Prolongation", "Restriction"); + HYPRE_PRINT_TOP_DIVISOR(1, divisors); + for (i = 0; i < num_levels_mgr; i++) + { + if (block_num_Cpts) + { + coarse_dofs_str = hypre_ConvertIndicesToString(block_num_Cpts[i], + block_CF_marker[i]); + } + + hypre_printf("%3d %6d %*s %11s %14s %14s %14s %14s\n", + i, + (i > 0 && block_num_Cpts) ? block_num_Cpts[i - 1] : block_size, + max_length, + (block_num_Cpts) ? coarse_dofs_str : "--", + hypre_MGRGetGlobalRelaxName(mgr_data, i), + hypre_MGRGetFRelaxName(mgr_data, i), + hypre_MGRGetCoarseGridName(mgr_data, i), + hypre_MGRGetProlongationName(mgr_data, i), + hypre_MGRGetRestrictionName(mgr_data, i)); + + hypre_TFree(coarse_dofs_str, HYPRE_MEMORY_HOST); + } + hypre_printf("\n\n"); + } + + /*------------------------------------------------- + * Print MGR hierarchy info + *-------------------------------------------------*/ + + /* Set pointers to level matrices */ + A_array = hypre_TAlloc(hypre_ParCSRMatrix *, max_levels, HYPRE_MEMORY_HOST); + for (i = 0; i < num_levels_mgr; i++) + { + A_array[i] = hypre_ParMGRDataA(mgr_data, i); + } + A_array[num_levels_mgr] = A_coarsest; + + for (i = 1; i < num_sublevels_amg[coarsest_mgr_level]; i++) + { + A_array[num_levels_mgr + i] = hypre_ParAMGDataAArray(coarse_amg_solver)[i]; + } + + /* Compute statistics data structure */ + hypre_ParCSRMatrixStatsArrayCompute(num_levels_total, A_array, stats_array); + + if (!myid) + { + const char *msg[] = { "Full Operator Matrix Hierarchy Information:\n\n", + "MGR's coarsest level", + "\t( MGR )", + "\t( AMG )" + }; + + num_levels[0] = num_levels_mgr - 1; + num_levels[1] = num_sublevels_amg[coarsest_mgr_level] + 1; + hypre_MatrixStatsArrayPrint(2, num_levels, 1, 0, msg, stats_array); + } + + /*------------------------------------------------- + * Print MGR level input data + *-------------------------------------------------*/ + + /* Set pointer to level matrices */ + P_array = hypre_TAlloc(hypre_ParCSRMatrix *, max_levels, HYPRE_MEMORY_HOST); + R_array = hypre_TAlloc(hypre_ParCSRMatrix *, max_levels, HYPRE_MEMORY_HOST); + RT_array = hypre_TAlloc(hypre_ParCSRMatrix *, max_levels, HYPRE_MEMORY_HOST); + for (i = 0; i < num_levels_mgr; i++) + { + P_array[i] = hypre_ParMGRDataP(mgr_data, i); + + if (hypre_ParMGRDataR(mgr_data, i)) + { + R_array[i] = hypre_ParMGRDataR(mgr_data, i); + } + else if (hypre_ParMGRDataRT(mgr_data, i)) + { + hypre_ParCSRMatrixTranspose(hypre_ParMGRDataRT(mgr_data, i), &R_array[i], 1); + } + else + { + R_array[i] = NULL; + } + } + + for (i = 0; i < num_sublevels_amg[coarsest_mgr_level]; i++) + { + P_array[num_levels_mgr + i] = hypre_ParAMGDataPArray(coarse_amg_solver)[i]; + R_array[num_levels_mgr + i] = NULL; + } + + /* Compute statistics data structure for Prolongation operator */ + hypre_ParCSRMatrixStatsArrayCompute(num_levels_total - 1, P_array, stats_array); + + if (!myid) + { + const char *msg[] = { "Full Prolongation Matrix Hierarchy Information:\n\n", + "MGR's coarsest level", + "\t( MGR )", + "\t( AMG )" + }; + + num_levels[0] = num_levels_mgr; + num_levels[1] = num_sublevels_amg[coarsest_mgr_level] - 1; + hypre_MatrixStatsArrayPrint(2, num_levels, 1, 0, msg, stats_array); + } + + /* Compute statistics data structure for Restriction operator (only for MGR) */ + hypre_ParCSRMatrixStatsArrayCompute(num_levels_mgr, R_array, stats_array); + + if (!myid) + { + const char *msg[] = { "MGR Restriction Matrix Hierarchy Information:\n\n" }; + + num_levels[0] = num_levels_mgr; + hypre_MatrixStatsArrayPrint(1, num_levels, 1, 0, msg, stats_array); + } + + /*------------------------------------------------- + * Print MGR F-relaxation info + *-------------------------------------------------*/ + + for (i = 0; i < num_levels_mgr; i++) + { + if (num_sublevels_amg[i] > 0) + { + if (!myid) + { + hypre_printf("At MGR level %d --> F-relaxation solver parameters\n\n", i); + } + amg_solver = (hypre_ParAMGData *) A_FF_solver[i]; + + /* General AMG info */ + if (!myid) + { + hypre_BoomerAMGPrintGeneralInfo(amg_solver, 3); + } + + /* Gather A matrices */ + for (k = 0; k < num_sublevels_amg[i]; k++) + { + A_array[k] = hypre_ParAMGDataAArray(amg_solver)[k]; + } + + /* Compute statistics */ + hypre_ParCSRMatrixStatsArrayCompute(num_sublevels_amg[i], A_array, stats_array); + + /* Print A matrices info */ + if (!myid) + { + const char *msg[] = {"Operator Matrix Hierarchy Information:\n\n"}; + num_levels[0] = num_sublevels_amg[i]; + hypre_MatrixStatsArrayPrint(1, num_levels, 1, 3, msg, stats_array); + } + + /* Gather P matrices */ + for (k = 0; k < num_sublevels_amg[i] - 1; k++) + { + P_array[k] = hypre_ParAMGDataPArray(amg_solver)[k]; + } + + /* Compute statistics */ + hypre_ParCSRMatrixStatsArrayCompute(num_sublevels_amg[i] - 1, P_array, stats_array); + + /* Print P matrices info */ + if (!myid) + { + const char *msg[] = {"Prolongation Matrix Hierarchy Information:\n\n"}; + num_levels[0] = num_sublevels_amg[i] - 1; + hypre_MatrixStatsArrayPrint(1, num_levels, 1, 3, msg, stats_array); + } + } + } + + /*------------------------------------------------- + * Print MGR coarsest level solver info + *-------------------------------------------------*/ + + if (!myid && coarse_amg_solver && num_sublevels_amg[coarsest_mgr_level] > 1) + { + hypre_printf("At coarsest MGR level --> Solver parameters:\n\n"); + hypre_BoomerAMGPrintGeneralInfo(coarse_amg_solver, 3); + } + + /*------------------------------------------------- + * Print MGR complexities + *-------------------------------------------------*/ + + /* Allocate memory for complexities arrays */ + gridcomp = hypre_CTAlloc(HYPRE_Real, num_levels_mgr + 2, HYPRE_MEMORY_HOST); + opcomp = hypre_CTAlloc(HYPRE_Real, num_levels_mgr + 2, HYPRE_MEMORY_HOST); + memcomp = hypre_CTAlloc(HYPRE_Real, num_levels_mgr + 2, HYPRE_MEMORY_HOST); + + /* Compute complexities at each MGR level */ + for (i = 0; i < num_levels_mgr + 1; i++) + { + if (num_sublevels_amg[i] > 0) + { + if (i < num_levels_mgr) + { + amg_solver = (hypre_ParAMGData *) A_FF_solver[i]; + } + else + { + amg_solver = coarse_amg_solver; + } + + for (k = 0; k < num_sublevels_amg[i]; k++) + { + A_array[k] = hypre_ParAMGDataAArray(amg_solver)[k]; + P_array[k] = (k < (num_sublevels_amg[i] - 1)) ? + hypre_ParAMGDataPArray(amg_solver)[k] : NULL; + RT_array[k] = (k < (num_sublevels_amg[i] - 1)) ? + hypre_ParAMGDataRArray(amg_solver)[k] : NULL; + + gridcomp[i] += (HYPRE_Real) hypre_ParCSRMatrixGlobalNumRows(A_array[k]); + opcomp[i] += (HYPRE_Real) hypre_ParCSRMatrixNumNonzeros(A_array[k]); + if (k < (num_sublevels_amg[i] - 1)) + { + memcomp[i] += (HYPRE_Real) hypre_ParCSRMatrixNumNonzeros(A_array[k]) + + (HYPRE_Real) hypre_ParCSRMatrixNumNonzeros(P_array[k]) + + (HYPRE_Real) hypre_ParCSRMatrixNumNonzeros(RT_array[k]); + } + } + gridcomp[num_levels_mgr + 1] += gridcomp[i]; + opcomp[num_levels_mgr + 1] += opcomp[i] / + hypre_ParCSRMatrixNumNonzeros(A_finest); + memcomp[num_levels_mgr + 1] += memcomp[i] / + hypre_ParCSRMatrixNumNonzeros(A_finest); + + gridcomp[i] /= (HYPRE_Real) hypre_ParCSRMatrixGlobalNumRows(A_array[0]); + opcomp[i] /= hypre_ParCSRMatrixDNumNonzeros(A_array[0]); + memcomp[i] /= hypre_ParCSRMatrixDNumNonzeros(A_array[0]); + } + else + { + /* TODO (VPM): Assume single-level for now, extend to ILU later */ + gridcomp[i] = 1.0; + opcomp[i] = 1.0; /* TODO (VPM): adjust according to F/G-relaxation choices */ + memcomp[i] = 1.0; + + A_array[i] = hypre_ParMGRDataA(mgr_data, i); + gridcomp[num_levels_mgr + 1] += hypre_ParCSRMatrixGlobalNumRows(A_array[i]); + opcomp[num_levels_mgr + 1] += hypre_ParCSRMatrixDNumNonzeros(A_array[i]) / + hypre_ParCSRMatrixNumNonzeros(A_finest); + memcomp[num_levels_mgr + 1] += hypre_ParCSRMatrixDNumNonzeros(A_array[i]) / + hypre_ParCSRMatrixNumNonzeros(A_finest); + } + } + gridcomp[num_levels_mgr + 1] /= (HYPRE_Real) hypre_ParCSRMatrixGlobalNumRows(A_finest); + + /* Print complexities */ + if (!myid) + { + divisors[0] = 37; + hypre_printf("MGR complexities:\n\n"); + hypre_printf("%4s ", "lev"); + hypre_printf("%10s ", "grid"); + hypre_printf("%10s ", "operator"); + hypre_printf("%10s ", "memory"); + hypre_printf("\n"); + HYPRE_PRINT_TOP_DIVISOR(1, divisors); + + for (i = 0; i < num_levels_mgr + 1; i++) + { + hypre_printf("%4d ", i); + hypre_printf("%10.3f ", gridcomp[i]); + hypre_printf("%10.3f ", opcomp[i]); + hypre_printf("%10.3f ", memcomp[i]); + hypre_printf("\n"); + } + HYPRE_PRINT_MID_DIVISOR(1, divisors, "") + hypre_printf("%4s ", "All"); + hypre_printf("%10.3f ", gridcomp[i]); + hypre_printf("%10.3f ", opcomp[i]); + hypre_printf("%10.3f ", memcomp[i]); + hypre_printf("\n"); + HYPRE_PRINT_MID_DIVISOR(1, divisors, "") + hypre_printf("\n\n"); + } + + /*------------------------------------------------- + * Free memory + *-------------------------------------------------*/ + + for (i = 0; i < num_levels_mgr; i++) + { + if (hypre_ParMGRDataRT(mgr_data, i)) + { + hypre_ParCSRMatrixDestroy(R_array[i]); + } + } + + hypre_MatrixStatsArrayDestroy(stats_array); + hypre_TFree(A_array, HYPRE_MEMORY_HOST); + hypre_TFree(P_array, HYPRE_MEMORY_HOST); + hypre_TFree(R_array, HYPRE_MEMORY_HOST); + hypre_TFree(RT_array, HYPRE_MEMORY_HOST); + hypre_TFree(num_sublevels_amg, HYPRE_MEMORY_HOST); + hypre_TFree(gridcomp, HYPRE_MEMORY_HOST); + hypre_TFree(opcomp, HYPRE_MEMORY_HOST); + hypre_TFree(memcomp, HYPRE_MEMORY_HOST); + + return hypre_error_flag; +} diff --git a/external/hypre/src/parcsr_ls/par_mod_lr_interp.c b/external/hypre/src/parcsr_ls/par_mod_lr_interp.c index bc0ecbe0..235d3811 100644 --- a/external/hypre/src/parcsr_ls/par_mod_lr_interp.c +++ b/external/hypre/src/parcsr_ls/par_mod_lr_interp.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -24,6 +24,8 @@ hypre_BoomerAMGBuildModExtInterpHost(hypre_ParCSRMatrix *A, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr) { + HYPRE_UNUSED_VAR(debug_flag); + /* Communication Variables */ MPI_Comm comm = hypre_ParCSRMatrixComm(A); HYPRE_MemoryLocation memory_location_P = hypre_ParCSRMatrixMemoryLocation(A); @@ -116,13 +118,13 @@ hypre_BoomerAMGBuildModExtInterpHost(hypre_ParCSRMatrix *A, /* BEGIN */ hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_rank(comm, &my_id); - if (my_id == (num_procs -1)) total_global_cpts = num_cpts_global[1]; - hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); - n_Cpts = num_cpts_global[1]-num_cpts_global[0]; + if (my_id == (num_procs - 1)) { total_global_cpts = num_cpts_global[1]; } + hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); + n_Cpts = num_cpts_global[1] - num_cpts_global[0]; - hypre_ParCSRMatrixGenerateFFFC(A, CF_marker, num_cpts_global, S, &As_FC, &As_FF); + hypre_ParCSRMatrixGenerateFFFCHost(A, CF_marker, num_cpts_global, S, &As_FC, &As_FF); As_FC_diag = hypre_ParCSRMatrixDiag(As_FC); As_FC_diag_i = hypre_CSRMatrixI(As_FC_diag); @@ -141,27 +143,27 @@ hypre_BoomerAMGBuildModExtInterpHost(hypre_ParCSRMatrix *A, D_q = hypre_CTAlloc(HYPRE_Real, n_Fpts, HYPRE_MEMORY_HOST); D_w = hypre_CTAlloc(HYPRE_Real, n_Fpts, HYPRE_MEMORY_HOST); cpt_array = hypre_CTAlloc(HYPRE_Int, num_threads, HYPRE_MEMORY_HOST); - start_array = hypre_CTAlloc(HYPRE_Int, num_threads+1, HYPRE_MEMORY_HOST); - startf_array = hypre_CTAlloc(HYPRE_Int, num_threads+1, HYPRE_MEMORY_HOST); + start_array = hypre_CTAlloc(HYPRE_Int, num_threads + 1, HYPRE_MEMORY_HOST); + startf_array = hypre_CTAlloc(HYPRE_Int, num_threads + 1, HYPRE_MEMORY_HOST); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel private(i,j,start,stop,startf,stopf,row) + #pragma omp parallel private(i,j,start,stop,startf,stopf,row) #endif { HYPRE_Int my_thread_num = hypre_GetThreadNum(); HYPRE_Real beta, gamma; - start = (n_fine/num_threads)*my_thread_num; - if (my_thread_num == num_threads-1) + start = (n_fine / num_threads) * my_thread_num; + if (my_thread_num == num_threads - 1) { stop = n_fine; } else { - stop = (n_fine/num_threads)*(my_thread_num+1); + stop = (n_fine / num_threads) * (my_thread_num + 1); } - start_array[my_thread_num+1] = stop; - for (i=start; i < stop; i++) + start_array[my_thread_num + 1] = stop; + for (i = start; i < stop; i++) { if (CF_marker[i] > 0) { @@ -170,13 +172,13 @@ hypre_BoomerAMGBuildModExtInterpHost(hypre_ParCSRMatrix *A, } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif if (my_thread_num == 0) { - for (i=1; i < num_threads; i++) + for (i = 1; i < num_threads; i++) { - cpt_array[i] += cpt_array[i-1]; + cpt_array[i] += cpt_array[i - 1]; } if (num_functions > 1) { @@ -186,13 +188,14 @@ hypre_BoomerAMGBuildModExtInterpHost(hypre_ParCSRMatrix *A, dof_func_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); index = 0; num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), HYPRE_MEMORY_HOST); + int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); for (i = 0; i < num_sends; i++) { startc = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = startc; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = startc; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { - int_buf_data[index++] = dof_func[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + int_buf_data[index++] = dof_func[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } } comm_handle = hypre_ParCSRCommHandleCreate( 11, comm_pkg, int_buf_data, dof_func_offd); @@ -202,28 +205,36 @@ hypre_BoomerAMGBuildModExtInterpHost(hypre_ParCSRMatrix *A, } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif if (my_thread_num > 0) - startf = start - cpt_array[my_thread_num-1]; + { + startf = start - cpt_array[my_thread_num - 1]; + } else + { startf = 0; + } - if (my_thread_num < num_threads-1) + if (my_thread_num < num_threads - 1) + { stopf = stop - cpt_array[my_thread_num]; + } else + { stopf = n_Fpts; + } - startf_array[my_thread_num+1] = stopf; + startf_array[my_thread_num + 1] = stopf; /* Create D_q = D_beta */ - for (i=startf; i < stopf; i++) + for (i = startf; i < stopf; i++) { - for (j=As_FC_diag_i[i]; j < As_FC_diag_i[i+1]; j++) + for (j = As_FC_diag_i[i]; j < As_FC_diag_i[i + 1]; j++) { D_q[i] += As_FC_diag_data[j]; } - for (j=As_FC_offd_i[i]; j < As_FC_offd_i[i+1]; j++) + for (j = As_FC_offd_i[i]; j < As_FC_offd_i[i + 1]; j++) { D_q[i] += As_FC_offd_data[j]; } @@ -231,7 +242,7 @@ hypre_BoomerAMGBuildModExtInterpHost(hypre_ParCSRMatrix *A, /* Create D_w = D_alpha + D_gamma */ row = startf; - for (i=start; i < stop; i++) + for (i = start; i < stop; i++) { if (CF_marker[i] < 0) { @@ -239,7 +250,7 @@ hypre_BoomerAMGBuildModExtInterpHost(hypre_ParCSRMatrix *A, { HYPRE_Int jA, jS, jC; jC = A_diag_i[i]; - for (j=S_diag_i[i]; j < S_diag_i[i+1]; j++) + for (j = S_diag_i[i]; j < S_diag_i[i + 1]; j++) { jS = S_diag_j[j]; jA = A_diag_j[jC]; @@ -250,18 +261,22 @@ hypre_BoomerAMGBuildModExtInterpHost(hypre_ParCSRMatrix *A, D_w[row] += A_diag_data[jC++]; } else + { jC++; + } jA = A_diag_j[jC]; } jC++; } - for (j=jC; j < A_diag_i[i+1]; j++) + for (j = jC; j < A_diag_i[i + 1]; j++) { if (dof_func[i] == dof_func[A_diag_j[j]]) - D_w[row] += A_diag_data[j]; + { + D_w[row] += A_diag_data[j]; + } } jC = A_offd_i[i]; - for (j=S_offd_i[i]; j < S_offd_i[i+1]; j++) + for (j = S_offd_i[i]; j < S_offd_i[i + 1]; j++) { jS = S_offd_j[j]; jA = A_offd_j[jC]; @@ -272,33 +287,37 @@ hypre_BoomerAMGBuildModExtInterpHost(hypre_ParCSRMatrix *A, D_w[row] += A_offd_data[jC++]; } else + { jC++; + } jA = A_offd_j[jC]; } jC++; } - for (j=jC; j < A_offd_i[i+1]; j++) + for (j = jC; j < A_offd_i[i + 1]; j++) { if (dof_func[i] == dof_func_offd[A_offd_j[j]]) - D_w[row] += A_offd_data[j]; + { + D_w[row] += A_offd_data[j]; + } } row++; } else { - for (j=A_diag_i[i]; j < A_diag_i[i+1]; j++) + for (j = A_diag_i[i]; j < A_diag_i[i + 1]; j++) { D_w[row] += A_diag_data[j]; } - for (j=A_offd_i[i]; j < A_offd_i[i+1]; j++) + for (j = A_offd_i[i]; j < A_offd_i[i + 1]; j++) { D_w[row] += A_offd_data[j]; } - for (j=As_FF_diag_i[row]+1; j < As_FF_diag_i[row+1]; j++) + for (j = As_FF_diag_i[row] + 1; j < As_FF_diag_i[row + 1]; j++) { D_w[row] -= As_FF_diag_data[j]; } - for (j=As_FF_offd_i[row]; j < As_FF_offd_i[row+1]; j++) + for (j = As_FF_offd_i[row]; j < As_FF_offd_i[row + 1]; j++) { D_w[row] -= As_FF_offd_data[j]; } @@ -308,22 +327,30 @@ hypre_BoomerAMGBuildModExtInterpHost(hypre_ParCSRMatrix *A, } } - for (i=startf; i 0) - c_pt = cpt_array[my_thread_num-1]; + { + c_pt = cpt_array[my_thread_num - 1]; + } else + { c_pt = 0; - cnt_diag = W_diag_i[startf]+c_pt; + } + cnt_diag = W_diag_i[startf] + c_pt; cnt_offd = W_offd_i[startf]; row = startf; - for (i=start; i < stop; i++) + for (i = start; i < stop; i++) { if (CF_marker[i] > 0) { @@ -385,20 +416,20 @@ hypre_BoomerAMGBuildModExtInterpHost(hypre_ParCSRMatrix *A, } else { - for (j=W_diag_i[row]; j < W_diag_i[row+1]; j++) + for (j = W_diag_i[row]; j < W_diag_i[row + 1]; j++) { P_diag_j[cnt_diag] = W_diag_j[j]; P_diag_data[cnt_diag++] = W_diag_data[j]; } - for (j=W_offd_i[row]; j < W_offd_i[row+1]; j++) + for (j = W_offd_i[row]; j < W_offd_i[row + 1]; j++) { P_offd_j[cnt_offd] = W_offd_j[j]; P_offd_data[cnt_offd++] = W_offd_data[j]; } row++; } - P_diag_i[i+1] = cnt_diag; - P_offd_i[i+1] = cnt_offd; + P_diag_i[i + 1] = cnt_diag; + P_offd_i[i + 1] = cnt_offd; } } /* end parallel region */ @@ -408,13 +439,13 @@ hypre_BoomerAMGBuildModExtInterpHost(hypre_ParCSRMatrix *A, *-----------------------------------------------------------------------*/ P = hypre_ParCSRMatrixCreate(comm, - hypre_ParCSRMatrixGlobalNumRows(A), - total_global_cpts, - hypre_ParCSRMatrixColStarts(A), - num_cpts_global, - num_cols_P_offd, - P_diag_i[n_fine], - P_offd_i[n_fine]); + hypre_ParCSRMatrixGlobalNumRows(A), + total_global_cpts, + hypre_ParCSRMatrixColStarts(A), + num_cpts_global, + num_cols_P_offd, + P_diag_i[n_fine], + P_offd_i[n_fine]); P_diag = hypre_ParCSRMatrixDiag(P); hypre_CSRMatrixData(P_diag) = P_diag_data; @@ -448,22 +479,22 @@ hypre_BoomerAMGBuildModExtInterpHost(hypre_ParCSRMatrix *A, if (num_cols_P_offd) { P_marker = hypre_CTAlloc(HYPRE_Int, num_cols_P_offd, HYPRE_MEMORY_HOST); - for (i=0; i < P_offd_size; i++) + for (i = 0; i < P_offd_size; i++) { P_marker[P_offd_j[i]] = 1; } new_ncols_P_offd = 0; - for (i=0; i < num_cols_P_offd; i++) + for (i = 0; i < num_cols_P_offd; i++) { - if (P_marker[i]) new_ncols_P_offd++; + if (P_marker[i]) { new_ncols_P_offd++; } } new_col_map_offd = hypre_CTAlloc(HYPRE_BigInt, new_ncols_P_offd, HYPRE_MEMORY_HOST); map = hypre_CTAlloc(HYPRE_Int, new_ncols_P_offd, HYPRE_MEMORY_HOST); index = 0; - for (i=0; i < num_cols_P_offd; i++) + for (i = 0; i < num_cols_P_offd; i++) if (P_marker[i]) { new_col_map_offd[index] = col_map_offd_P[i]; @@ -473,12 +504,12 @@ hypre_BoomerAMGBuildModExtInterpHost(hypre_ParCSRMatrix *A, #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i=0; i < P_offd_size; i++) + for (i = 0; i < P_offd_size; i++) { P_offd_j[i] = hypre_BinarySearch(map, P_offd_j[i], - new_ncols_P_offd); + new_ncols_P_offd); } hypre_TFree(col_map_offd_P, HYPRE_MEMORY_HOST); @@ -521,30 +552,26 @@ hypre_BoomerAMGBuildModExtInterp(hypre_ParCSRMatrix *A, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr) { -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_GpuProfilingPushRange("ModExtInterp"); -#endif - - HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(A) ); HYPRE_Int ierr = 0; - if (exec == HYPRE_EXEC_HOST) +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(A) ); + if (exec == HYPRE_EXEC_DEVICE) { - ierr = hypre_BoomerAMGBuildModExtInterpHost(A,CF_marker,S,num_cpts_global,num_functions,dof_func, - debug_flag,trunc_factor,max_elmts,P_ptr); + ierr = hypre_BoomerAMGBuildExtInterpDevice(A, CF_marker, S, num_cpts_global, 1, NULL, + debug_flag, trunc_factor, max_elmts, P_ptr); } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) else +#endif { - ierr = hypre_BoomerAMGBuildExtInterpDevice(A,CF_marker,S,num_cpts_global,1,NULL, - debug_flag,trunc_factor,max_elmts,P_ptr); + ierr = hypre_BoomerAMGBuildModExtInterpHost(A, CF_marker, S, num_cpts_global, num_functions, + dof_func, + debug_flag, trunc_factor, max_elmts, P_ptr); } -#endif -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_GpuProfilingPopRange(); -#endif return ierr; } @@ -566,6 +593,8 @@ hypre_BoomerAMGBuildModExtPIInterpHost(hypre_ParCSRMatrix *A, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr) { + HYPRE_UNUSED_VAR(debug_flag); + /* Communication Variables */ MPI_Comm comm = hypre_ParCSRMatrixComm(A); hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); @@ -671,17 +700,17 @@ hypre_BoomerAMGBuildModExtPIInterpHost(hypre_ParCSRMatrix *A, /* BEGIN */ hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_rank(comm, &my_id); - if (my_id == (num_procs -1)) total_global_cpts = num_cpts_global[1]; - hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); - n_Cpts = num_cpts_global[1]-num_cpts_global[0]; + if (my_id == (num_procs - 1)) { total_global_cpts = num_cpts_global[1]; } + hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); + n_Cpts = num_cpts_global[1] - num_cpts_global[0]; - hypre_ParCSRMatrixGenerateFFFC(A, CF_marker, num_cpts_global, S, &As_FC, &As_FF); + hypre_ParCSRMatrixGenerateFFFCHost(A, CF_marker, num_cpts_global, S, &As_FC, &As_FF); if (num_procs > 1) { - As_FF_ext = hypre_ParCSRMatrixExtractBExt(As_FF,As_FF,1); + As_FF_ext = hypre_ParCSRMatrixExtractBExt(As_FF, As_FF, 1); As_FF_ext_i = hypre_CSRMatrixI(As_FF_ext); As_FF_ext_j = hypre_CSRMatrixBigJ(As_FF_ext); As_FF_ext_data = hypre_CSRMatrixData(As_FF_ext); @@ -710,26 +739,26 @@ hypre_BoomerAMGBuildModExtPIInterpHost(hypre_ParCSRMatrix *A, D_theta = hypre_CTAlloc(HYPRE_Real, n_Fpts, HYPRE_MEMORY_HOST); D_w = hypre_CTAlloc(HYPRE_Real, n_Fpts, HYPRE_MEMORY_HOST); cpt_array = hypre_CTAlloc(HYPRE_Int, num_threads, HYPRE_MEMORY_HOST); - start_array = hypre_CTAlloc(HYPRE_Int, num_threads+1, HYPRE_MEMORY_HOST); - startf_array = hypre_CTAlloc(HYPRE_Int, num_threads+1, HYPRE_MEMORY_HOST); + start_array = hypre_CTAlloc(HYPRE_Int, num_threads + 1, HYPRE_MEMORY_HOST); + startf_array = hypre_CTAlloc(HYPRE_Int, num_threads + 1, HYPRE_MEMORY_HOST); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel private(i,j,jj,k,kk,start,stop,startf,stopf,row,theta,value,value1) + #pragma omp parallel private(i,j,jj,k,kk,start,stop,startf,stopf,row,theta,value,value1) #endif { HYPRE_Int my_thread_num = hypre_GetThreadNum(); - start = (n_fine/num_threads)*my_thread_num; - if (my_thread_num == num_threads-1) + start = (n_fine / num_threads) * my_thread_num; + if (my_thread_num == num_threads - 1) { stop = n_fine; } else { - stop = (n_fine/num_threads)*(my_thread_num+1); + stop = (n_fine / num_threads) * (my_thread_num + 1); } - start_array[my_thread_num+1] = stop; - for (i=start; i < stop; i++) + start_array[my_thread_num + 1] = stop; + for (i = start; i < stop; i++) { if (CF_marker[i] > 0) { @@ -738,37 +767,45 @@ hypre_BoomerAMGBuildModExtPIInterpHost(hypre_ParCSRMatrix *A, } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif if (my_thread_num == 0) { - for (i=1; i < num_threads; i++) + for (i = 1; i < num_threads; i++) { - cpt_array[i] += cpt_array[i-1]; + cpt_array[i] += cpt_array[i - 1]; } } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif if (my_thread_num > 0) - startf = start - cpt_array[my_thread_num-1]; + { + startf = start - cpt_array[my_thread_num - 1]; + } else + { startf = 0; + } - if (my_thread_num < num_threads-1) + if (my_thread_num < num_threads - 1) + { stopf = stop - cpt_array[my_thread_num]; + } else + { stopf = n_Fpts; + } - startf_array[my_thread_num+1] = stopf; + startf_array[my_thread_num + 1] = stopf; - for (i=startf; i < stopf; i++) + for (i = startf; i < stopf; i++) { - for (j=As_FC_diag_i[i]; j < As_FC_diag_i[i+1]; j++) + for (j = As_FC_diag_i[i]; j < As_FC_diag_i[i + 1]; j++) { D_q[i] += As_FC_diag_data[j]; } - for (j=As_FC_offd_i[i]; j < As_FC_offd_i[i+1]; j++) + for (j = As_FC_offd_i[i]; j < As_FC_offd_i[i + 1]; j++) { D_q[i] += As_FC_offd_data[j]; } @@ -781,7 +818,7 @@ hypre_BoomerAMGBuildModExtPIInterpHost(hypre_ParCSRMatrix *A, #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif if (my_thread_num == 0) { @@ -797,13 +834,14 @@ hypre_BoomerAMGBuildModExtPIInterpHost(hypre_ParCSRMatrix *A, comm_pkg = hypre_ParCSRMatrixCommPkg(As_FF); } num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - buf_data = hypre_CTAlloc(HYPRE_Real, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), HYPRE_MEMORY_HOST); + buf_data = hypre_CTAlloc(HYPRE_Real, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); for (i = 0; i < num_sends; i++) { startc = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = startc; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = startc; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { - buf_data[index++] = D_q[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + buf_data[index++] = D_q[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } } @@ -818,13 +856,14 @@ hypre_BoomerAMGBuildModExtPIInterpHost(hypre_ParCSRMatrix *A, dof_func_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); index = 0; num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), HYPRE_MEMORY_HOST); + int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); for (i = 0; i < num_sends; i++) { startc = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = startc; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = startc; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { - int_buf_data[index++] = dof_func[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + int_buf_data[index++] = dof_func[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } } comm_handle = hypre_ParCSRCommHandleCreate( 11, comm_pkg, int_buf_data, dof_func_offd); @@ -834,11 +873,11 @@ hypre_BoomerAMGBuildModExtPIInterpHost(hypre_ParCSRMatrix *A, } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif row = startf; - for (i=start; i < stop; i++) + for (i = start; i < stop; i++) { HYPRE_Int jA, jC, jS; if (CF_marker[i] < 0) @@ -846,7 +885,7 @@ hypre_BoomerAMGBuildModExtPIInterpHost(hypre_ParCSRMatrix *A, if (num_functions > 1) { jC = A_diag_i[i]; - for (j=S_diag_i[i]; j < S_diag_i[i+1]; j++) + for (j = S_diag_i[i]; j < S_diag_i[i + 1]; j++) { jS = S_diag_j[j]; jA = A_diag_j[jC]; @@ -857,18 +896,22 @@ hypre_BoomerAMGBuildModExtPIInterpHost(hypre_ParCSRMatrix *A, D_w[row] += A_diag_data[jC++]; } else + { jC++; + } jA = A_diag_j[jC]; } jC++; } - for (j=jC; j < A_diag_i[i+1]; j++) + for (j = jC; j < A_diag_i[i + 1]; j++) { if (dof_func[i] == dof_func[A_diag_j[j]]) - D_w[row] += A_diag_data[j]; + { + D_w[row] += A_diag_data[j]; + } } jC = A_offd_i[i]; - for (j=S_offd_i[i]; j < S_offd_i[i+1]; j++) + for (j = S_offd_i[i]; j < S_offd_i[i + 1]; j++) { jS = S_offd_j[j]; jA = A_offd_j[jC]; @@ -879,33 +922,37 @@ hypre_BoomerAMGBuildModExtPIInterpHost(hypre_ParCSRMatrix *A, D_w[row] += A_offd_data[jC++]; } else + { jC++; + } jA = A_offd_j[jC]; } jC++; } - for (j=jC; j < A_offd_i[i+1]; j++) + for (j = jC; j < A_offd_i[i + 1]; j++) { if (dof_func[i] == dof_func_offd[A_offd_j[j]]) - D_w[row] += A_offd_data[j]; + { + D_w[row] += A_offd_data[j]; + } } row++; } else { - for (j=A_diag_i[i]; j < A_diag_i[i+1]; j++) + for (j = A_diag_i[i]; j < A_diag_i[i + 1]; j++) { D_w[row] += A_diag_data[j]; } - for (j=A_offd_i[i]; j < A_offd_i[i+1]; j++) + for (j = A_offd_i[i]; j < A_offd_i[i + 1]; j++) { D_w[row] += A_offd_data[j]; } - for (j=As_FF_diag_i[row]+1; j < As_FF_diag_i[row+1]; j++) + for (j = As_FF_diag_i[row] + 1; j < As_FF_diag_i[row + 1]; j++) { D_w[row] -= As_FF_diag_data[j]; } - for (j=As_FF_offd_i[row]; j < As_FF_offd_i[row+1]; j++) + for (j = As_FF_offd_i[row]; j < As_FF_offd_i[row + 1]; j++) { D_w[row] -= As_FF_offd_data[j]; } @@ -915,37 +962,37 @@ hypre_BoomerAMGBuildModExtPIInterpHost(hypre_ParCSRMatrix *A, } } - for (i=startf; i 0) - c_pt = cpt_array[my_thread_num-1]; + { + c_pt = cpt_array[my_thread_num - 1]; + } else + { c_pt = 0; - cnt_diag = W_diag_i[startf]+c_pt; + } + cnt_diag = W_diag_i[startf] + c_pt; cnt_offd = W_offd_i[startf]; row = startf; - for (i=start; i < stop; i++) + for (i = start; i < stop; i++) { if (CF_marker[i] > 0) { @@ -1030,20 +1085,20 @@ hypre_BoomerAMGBuildModExtPIInterpHost(hypre_ParCSRMatrix *A, } else { - for (j=W_diag_i[row]; j < W_diag_i[row+1]; j++) + for (j = W_diag_i[row]; j < W_diag_i[row + 1]; j++) { P_diag_j[cnt_diag] = W_diag_j[j]; P_diag_data[cnt_diag++] = W_diag_data[j]; } - for (j=W_offd_i[row]; j < W_offd_i[row+1]; j++) + for (j = W_offd_i[row]; j < W_offd_i[row + 1]; j++) { P_offd_j[cnt_offd] = W_offd_j[j]; P_offd_data[cnt_offd++] = W_offd_data[j]; } row++; } - P_diag_i[i+1] = cnt_diag; - P_offd_i[i+1] = cnt_offd; + P_diag_i[i + 1] = cnt_diag; + P_offd_i[i + 1] = cnt_offd; } } /* end parallel region */ @@ -1053,13 +1108,13 @@ hypre_BoomerAMGBuildModExtPIInterpHost(hypre_ParCSRMatrix *A, *-----------------------------------------------------------------------*/ P = hypre_ParCSRMatrixCreate(comm, - hypre_ParCSRMatrixGlobalNumRows(A), - total_global_cpts, - hypre_ParCSRMatrixColStarts(A), - num_cpts_global, - num_cols_P_offd, - P_diag_i[n_fine], - P_offd_i[n_fine]); + hypre_ParCSRMatrixGlobalNumRows(A), + total_global_cpts, + hypre_ParCSRMatrixColStarts(A), + num_cpts_global, + num_cols_P_offd, + P_diag_i[n_fine], + P_offd_i[n_fine]); P_diag = hypre_ParCSRMatrixDiag(P); hypre_CSRMatrixData(P_diag) = P_diag_data; @@ -1093,33 +1148,35 @@ hypre_BoomerAMGBuildModExtPIInterpHost(hypre_ParCSRMatrix *A, if (num_cols_P_offd) { P_marker = hypre_CTAlloc(HYPRE_Int, num_cols_P_offd, HYPRE_MEMORY_HOST); - for (i=0; i < P_offd_size; i++) + for (i = 0; i < P_offd_size; i++) + { P_marker[P_offd_j[i]] = 1; + } new_ncols_P_offd = 0; - for (i=0; i < num_cols_P_offd; i++) - if (P_marker[i]) new_ncols_P_offd++; + for (i = 0; i < num_cols_P_offd; i++) + if (P_marker[i]) { new_ncols_P_offd++; } new_col_map_offd = hypre_CTAlloc(HYPRE_BigInt, new_ncols_P_offd, HYPRE_MEMORY_HOST); map = hypre_CTAlloc(HYPRE_Int, new_ncols_P_offd, HYPRE_MEMORY_HOST); index = 0; - for (i=0; i < num_cols_P_offd; i++) + for (i = 0; i < num_cols_P_offd; i++) if (P_marker[i]) { - new_col_map_offd[index] = col_map_offd_P[i]; - map[index++] = i; + new_col_map_offd[index] = col_map_offd_P[i]; + map[index++] = i; } hypre_TFree(P_marker, HYPRE_MEMORY_HOST); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i=0; i < P_offd_size; i++) + for (i = 0; i < P_offd_size; i++) { P_offd_j[i] = hypre_BinarySearch(map, P_offd_j[i], - new_ncols_P_offd); + new_ncols_P_offd); } hypre_TFree(col_map_offd_P, HYPRE_MEMORY_HOST); hypre_ParCSRMatrixColMapOffd(P) = new_col_map_offd; @@ -1166,31 +1223,26 @@ hypre_BoomerAMGBuildModExtPIInterp(hypre_ParCSRMatrix *A, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr) { -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_GpuProfilingPushRange("ModExtPIInterp"); -#endif - - HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(A) ); HYPRE_Int ierr = 0; - if (exec == HYPRE_EXEC_HOST) - { - ierr = hypre_BoomerAMGBuildModExtPIInterpHost(A, CF_marker, S, num_cpts_global, - debug_flag, num_functions, dof_func, - trunc_factor, max_elmts, P_ptr); - } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - else +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(A) ); + if (exec == HYPRE_EXEC_DEVICE) { ierr = hypre_BoomerAMGBuildExtPIInterpDevice(A, CF_marker, S, num_cpts_global, 1, NULL, debug_flag, trunc_factor, max_elmts, P_ptr); } + else #endif + { + ierr = hypre_BoomerAMGBuildModExtPIInterpHost(A, CF_marker, S, num_cpts_global, + debug_flag, num_functions, dof_func, + trunc_factor, max_elmts, P_ptr); + } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_GpuProfilingPopRange(); -#endif return ierr; } @@ -1211,6 +1263,8 @@ hypre_BoomerAMGBuildModExtPEInterpHost(hypre_ParCSRMatrix *A, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr) { + HYPRE_UNUSED_VAR(debug_flag); + /* Communication Variables */ MPI_Comm comm = hypre_ParCSRMatrixComm(A); HYPRE_MemoryLocation memory_location_P = hypre_ParCSRMatrixMemoryLocation(A); @@ -1309,13 +1363,13 @@ hypre_BoomerAMGBuildModExtPEInterpHost(hypre_ParCSRMatrix *A, /* BEGIN */ hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_rank(comm, &my_id); - if (my_id == (num_procs -1)) total_global_cpts = num_cpts_global[1]; - hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); - n_Cpts = num_cpts_global[1]-num_cpts_global[0]; + if (my_id == (num_procs - 1)) { total_global_cpts = num_cpts_global[1]; } + hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); + n_Cpts = num_cpts_global[1] - num_cpts_global[0]; - hypre_ParCSRMatrixGenerateFFFC(A, CF_marker, num_cpts_global, S, &As_FC, &As_FF); + hypre_ParCSRMatrixGenerateFFFCHost(A, CF_marker, num_cpts_global, S, &As_FC, &As_FF); As_FC_diag = hypre_ParCSRMatrixDiag(As_FC); As_FC_diag_i = hypre_CSRMatrixI(As_FC_diag); @@ -1340,26 +1394,26 @@ hypre_BoomerAMGBuildModExtPEInterpHost(hypre_ParCSRMatrix *A, D_tau = hypre_CTAlloc(HYPRE_Real, n_Fpts, HYPRE_MEMORY_HOST); D_w = hypre_CTAlloc(HYPRE_Real, n_Fpts, HYPRE_MEMORY_HOST); cpt_array = hypre_CTAlloc(HYPRE_Int, num_threads, HYPRE_MEMORY_HOST); - start_array = hypre_CTAlloc(HYPRE_Int, num_threads+1, HYPRE_MEMORY_HOST); - startf_array = hypre_CTAlloc(HYPRE_Int, num_threads+1, HYPRE_MEMORY_HOST); + start_array = hypre_CTAlloc(HYPRE_Int, num_threads + 1, HYPRE_MEMORY_HOST); + startf_array = hypre_CTAlloc(HYPRE_Int, num_threads + 1, HYPRE_MEMORY_HOST); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel private(i,j,start,stop,startf,stopf,row,theta,value) + #pragma omp parallel private(i,j,start,stop,startf,stopf,row,theta,value) #endif { HYPRE_Int my_thread_num = hypre_GetThreadNum(); - start = (n_fine/num_threads)*my_thread_num; - if (my_thread_num == num_threads-1) + start = (n_fine / num_threads) * my_thread_num; + if (my_thread_num == num_threads - 1) { stop = n_fine; } else { - stop = (n_fine/num_threads)*(my_thread_num+1); + stop = (n_fine / num_threads) * (my_thread_num + 1); } - start_array[my_thread_num+1] = stop; - for (i=start; i < stop; i++) + start_array[my_thread_num + 1] = stop; + for (i = start; i < stop; i++) { if (CF_marker[i] > 0) { @@ -1368,13 +1422,13 @@ hypre_BoomerAMGBuildModExtPEInterpHost(hypre_ParCSRMatrix *A, } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif if (my_thread_num == 0) { - for (i=1; i < num_threads; i++) + for (i = 1; i < num_threads; i++) { - cpt_array[i] += cpt_array[i-1]; + cpt_array[i] += cpt_array[i - 1]; } if (num_functions > 1) { @@ -1384,13 +1438,14 @@ hypre_BoomerAMGBuildModExtPEInterpHost(hypre_ParCSRMatrix *A, dof_func_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); index = 0; num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), HYPRE_MEMORY_HOST); + int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); for (i = 0; i < num_sends; i++) { startc = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = startc; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = startc; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { - int_buf_data[index++] = dof_func[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + int_buf_data[index++] = dof_func[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } } comm_handle = hypre_ParCSRCommHandleCreate( 11, comm_pkg, int_buf_data, dof_func_offd); @@ -1399,47 +1454,56 @@ hypre_BoomerAMGBuildModExtPEInterpHost(hypre_ParCSRMatrix *A, } } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif if (my_thread_num > 0) - startf = start - cpt_array[my_thread_num-1]; + { + startf = start - cpt_array[my_thread_num - 1]; + } else + { startf = 0; + } - if (my_thread_num < num_threads-1) + if (my_thread_num < num_threads - 1) + { stopf = stop - cpt_array[my_thread_num]; + } else + { stopf = n_Fpts; + } - startf_array[my_thread_num+1] = stopf; + startf_array[my_thread_num + 1] = stopf; - for (i=startf; i < stopf; i++) + for (i = startf; i < stopf; i++) { HYPRE_Real number; - for (j=As_FF_diag_i[i]+1; j < As_FF_diag_i[i+1]; j++) + for (j = As_FF_diag_i[i] + 1; j < As_FF_diag_i[i + 1]; j++) { D_lambda[i] += As_FF_diag_data[j]; } - for (j=As_FF_offd_i[i]; j < As_FF_offd_i[i+1]; j++) + for (j = As_FF_offd_i[i]; j < As_FF_offd_i[i + 1]; j++) { D_lambda[i] += As_FF_offd_data[j]; } - number = (HYPRE_Real)(As_FF_diag_i[i+1]-As_FF_diag_i[i]-1+As_FF_offd_i[i+1]-As_FF_offd_i[i]); - if (number) D_lambda[i] /= number; - for (j=As_FC_diag_i[i]; j < As_FC_diag_i[i+1]; j++) + number = (HYPRE_Real)(As_FF_diag_i[i + 1] - As_FF_diag_i[i] - 1 + As_FF_offd_i[i + 1] - + As_FF_offd_i[i]); + if (number) { D_lambda[i] /= number; } + for (j = As_FC_diag_i[i]; j < As_FC_diag_i[i + 1]; j++) { D_beta[i] += As_FC_diag_data[j]; } - for (j=As_FC_offd_i[i]; j < As_FC_offd_i[i+1]; j++) + for (j = As_FC_offd_i[i]; j < As_FC_offd_i[i + 1]; j++) { D_beta[i] += As_FC_offd_data[j]; } - if (D_lambda[i]+D_beta[i]) D_tmp[i] = D_lambda[i]/(D_beta[i]+D_lambda[i]); + if (D_lambda[i] + D_beta[i]) { D_tmp[i] = D_lambda[i] / (D_beta[i] + D_lambda[i]); } } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif if (my_thread_num == 0) { @@ -1455,13 +1519,14 @@ hypre_BoomerAMGBuildModExtPEInterpHost(hypre_ParCSRMatrix *A, comm_pkg = hypre_ParCSRMatrixCommPkg(As_FF); } num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - buf_data = hypre_CTAlloc(HYPRE_Real, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), HYPRE_MEMORY_HOST); + buf_data = hypre_CTAlloc(HYPRE_Real, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); for (i = 0; i < num_sends; i++) { startc = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = startc; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = startc; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { - buf_data[index++] = D_tmp[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + buf_data[index++] = D_tmp[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } } @@ -1470,11 +1535,11 @@ hypre_BoomerAMGBuildModExtPEInterpHost(hypre_ParCSRMatrix *A, } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif row = startf; - for (i=start; i < stop; i++) + for (i = start; i < stop; i++) { if (CF_marker[i] < 0) { @@ -1482,7 +1547,7 @@ hypre_BoomerAMGBuildModExtPEInterpHost(hypre_ParCSRMatrix *A, { HYPRE_Int jA, jC, jS; jC = A_diag_i[i]; - for (j=S_diag_i[i]; j < S_diag_i[i+1]; j++) + for (j = S_diag_i[i]; j < S_diag_i[i + 1]; j++) { jS = S_diag_j[j]; jA = A_diag_j[jC]; @@ -1493,18 +1558,22 @@ hypre_BoomerAMGBuildModExtPEInterpHost(hypre_ParCSRMatrix *A, D_w[row] += A_diag_data[jC++]; } else + { jC++; + } jA = A_diag_j[jC]; } jC++; } - for (j=jC; j < A_diag_i[i+1]; j++) + for (j = jC; j < A_diag_i[i + 1]; j++) { if (dof_func[i] == dof_func[A_diag_j[j]]) - D_w[row] += A_diag_data[j]; + { + D_w[row] += A_diag_data[j]; + } } jC = A_offd_i[i]; - for (j=S_offd_i[i]; j < S_offd_i[i+1]; j++) + for (j = S_offd_i[i]; j < S_offd_i[i + 1]; j++) { jS = S_offd_j[j]; jA = A_offd_j[jC]; @@ -1515,33 +1584,37 @@ hypre_BoomerAMGBuildModExtPEInterpHost(hypre_ParCSRMatrix *A, D_w[row] += A_offd_data[jC++]; } else + { jC++; + } jA = A_offd_j[jC]; } jC++; } - for (j=jC; j < A_offd_i[i+1]; j++) + for (j = jC; j < A_offd_i[i + 1]; j++) { if (dof_func[i] == dof_func_offd[A_offd_j[j]]) - D_w[row] += A_offd_data[j]; + { + D_w[row] += A_offd_data[j]; + } } row++; } else { - for (j=A_diag_i[i]; j < A_diag_i[i+1]; j++) + for (j = A_diag_i[i]; j < A_diag_i[i + 1]; j++) { D_w[row] += A_diag_data[j]; } - for (j=A_offd_i[i]; j < A_offd_i[i+1]; j++) + for (j = A_offd_i[i]; j < A_offd_i[i + 1]; j++) { D_w[row] += A_offd_data[j]; } - for (j=As_FF_diag_i[row]+1; j < As_FF_diag_i[row+1]; j++) + for (j = As_FF_diag_i[row] + 1; j < As_FF_diag_i[row + 1]; j++) { D_w[row] -= As_FF_diag_data[j]; } - for (j=As_FF_offd_i[row]; j < As_FF_offd_i[row+1]; j++) + for (j = As_FF_offd_i[row]; j < As_FF_offd_i[row + 1]; j++) { D_w[row] -= As_FF_offd_data[j]; } @@ -1551,39 +1624,39 @@ hypre_BoomerAMGBuildModExtPEInterpHost(hypre_ParCSRMatrix *A, } } - for (i=startf; i 0) - c_pt = cpt_array[my_thread_num-1]; + { + c_pt = cpt_array[my_thread_num - 1]; + } else + { c_pt = 0; - cnt_diag = W_diag_i[startf]+c_pt; + } + cnt_diag = W_diag_i[startf] + c_pt; cnt_offd = W_offd_i[startf]; row = startf; - for (i=start; i < stop; i++) + for (i = start; i < stop; i++) { if (CF_marker[i] > 0) { @@ -1648,20 +1725,20 @@ hypre_BoomerAMGBuildModExtPEInterpHost(hypre_ParCSRMatrix *A, } else { - for (j=W_diag_i[row]; j < W_diag_i[row+1]; j++) + for (j = W_diag_i[row]; j < W_diag_i[row + 1]; j++) { P_diag_j[cnt_diag] = W_diag_j[j]; P_diag_data[cnt_diag++] = W_diag_data[j]; } - for (j=W_offd_i[row]; j < W_offd_i[row+1]; j++) + for (j = W_offd_i[row]; j < W_offd_i[row + 1]; j++) { P_offd_j[cnt_offd] = W_offd_j[j]; P_offd_data[cnt_offd++] = W_offd_data[j]; } row++; } - P_diag_i[i+1] = cnt_diag; - P_offd_i[i+1] = cnt_offd; + P_diag_i[i + 1] = cnt_diag; + P_offd_i[i + 1] = cnt_offd; } } /* end parallel region */ @@ -1671,13 +1748,13 @@ hypre_BoomerAMGBuildModExtPEInterpHost(hypre_ParCSRMatrix *A, *-----------------------------------------------------------------------*/ P = hypre_ParCSRMatrixCreate(comm, - hypre_ParCSRMatrixGlobalNumRows(A), - total_global_cpts, - hypre_ParCSRMatrixColStarts(A), - num_cpts_global, - num_cols_P_offd, - P_diag_i[n_fine], - P_offd_i[n_fine]); + hypre_ParCSRMatrixGlobalNumRows(A), + total_global_cpts, + hypre_ParCSRMatrixColStarts(A), + num_cpts_global, + num_cols_P_offd, + P_diag_i[n_fine], + P_offd_i[n_fine]); P_diag = hypre_ParCSRMatrixDiag(P); hypre_CSRMatrixData(P_diag) = P_diag_data; @@ -1711,33 +1788,35 @@ hypre_BoomerAMGBuildModExtPEInterpHost(hypre_ParCSRMatrix *A, if (num_cols_P_offd) { P_marker = hypre_CTAlloc(HYPRE_Int, num_cols_P_offd, HYPRE_MEMORY_HOST); - for (i=0; i < P_offd_size; i++) + for (i = 0; i < P_offd_size; i++) + { P_marker[P_offd_j[i]] = 1; + } new_ncols_P_offd = 0; - for (i=0; i < num_cols_P_offd; i++) - if (P_marker[i]) new_ncols_P_offd++; + for (i = 0; i < num_cols_P_offd; i++) + if (P_marker[i]) { new_ncols_P_offd++; } new_col_map_offd = hypre_CTAlloc(HYPRE_BigInt, new_ncols_P_offd, HYPRE_MEMORY_HOST); map = hypre_CTAlloc(HYPRE_Int, new_ncols_P_offd, HYPRE_MEMORY_HOST); index = 0; - for (i=0; i < num_cols_P_offd; i++) + for (i = 0; i < num_cols_P_offd; i++) if (P_marker[i]) { - new_col_map_offd[index] = col_map_offd_P[i]; - map[index++] = i; + new_col_map_offd[index] = col_map_offd_P[i]; + map[index++] = i; } hypre_TFree(P_marker, HYPRE_MEMORY_HOST); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i=0; i < P_offd_size; i++) + for (i = 0; i < P_offd_size; i++) { P_offd_j[i] = hypre_BinarySearch(map, P_offd_j[i], - new_ncols_P_offd); + new_ncols_P_offd); } hypre_TFree(col_map_offd_P, HYPRE_MEMORY_HOST); hypre_ParCSRMatrixColMapOffd(P) = new_col_map_offd; @@ -1761,6 +1840,7 @@ hypre_BoomerAMGBuildModExtPEInterpHost(hypre_ParCSRMatrix *A, hypre_TFree(start_array, HYPRE_MEMORY_HOST); hypre_TFree(startf_array, HYPRE_MEMORY_HOST); hypre_TFree(buf_data, HYPRE_MEMORY_HOST); + hypre_TFree(dof_func_offd, HYPRE_MEMORY_HOST); hypre_ParCSRMatrixDestroy(As_FF); hypre_ParCSRMatrixDestroy(As_FC); hypre_ParCSRMatrixDestroy(W); @@ -1773,41 +1853,36 @@ hypre_BoomerAMGBuildModExtPEInterpHost(hypre_ParCSRMatrix *A, *-----------------------------------------------------------------------*/ HYPRE_Int hypre_BoomerAMGBuildModExtPEInterp(hypre_ParCSRMatrix *A, - HYPRE_Int *CF_marker, - hypre_ParCSRMatrix *S, - HYPRE_BigInt *num_cpts_global, - HYPRE_Int num_functions, - HYPRE_Int *dof_func, - HYPRE_Int debug_flag, - HYPRE_Real trunc_factor, - HYPRE_Int max_elmts, - hypre_ParCSRMatrix **P_ptr) + HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, + HYPRE_BigInt *num_cpts_global, + HYPRE_Int num_functions, + HYPRE_Int *dof_func, + HYPRE_Int debug_flag, + HYPRE_Real trunc_factor, + HYPRE_Int max_elmts, + hypre_ParCSRMatrix **P_ptr) { -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_GpuProfilingPushRange("ModExtPEInterp"); -#endif - - HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(A) ); HYPRE_Int ierr = 0; - if (exec == HYPRE_EXEC_HOST) +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(A) ); + if (exec == HYPRE_EXEC_DEVICE) { - ierr = hypre_BoomerAMGBuildModExtPEInterpHost(A, CF_marker, S, num_cpts_global, - num_functions, dof_func, - debug_flag, trunc_factor, max_elmts, P_ptr); + ierr = hypre_BoomerAMGBuildExtPEInterpDevice(A, CF_marker, S, num_cpts_global, 1, NULL, + debug_flag, trunc_factor, max_elmts, P_ptr); } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) else +#endif { - ierr = hypre_BoomerAMGBuildExtPEInterpDevice(A,CF_marker,S,num_cpts_global,1,NULL, - debug_flag,trunc_factor,max_elmts,P_ptr); + ierr = hypre_BoomerAMGBuildModExtPEInterpHost(A, CF_marker, S, num_cpts_global, + num_functions, dof_func, + debug_flag, trunc_factor, max_elmts, P_ptr); } -#endif -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_GpuProfilingPopRange(); -#endif return ierr; } diff --git a/external/hypre/src/parcsr_ls/par_mod_multi_interp.c b/external/hypre/src/parcsr_ls/par_mod_multi_interp.c new file mode 100644 index 00000000..1280ba36 --- /dev/null +++ b/external/hypre/src/parcsr_ls/par_mod_multi_interp.c @@ -0,0 +1,1318 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#include "_hypre_parcsr_ls.h" + +/*-------------------------------------------------------------------------- + * hypre_ParAMGBuildModMultipass + * This routine implements Stuben's direct interpolation with multiple passes. + * expressed with matrix matrix multiplications + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGBuildModMultipassHost( hypre_ParCSRMatrix *A, + HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, + HYPRE_BigInt *num_cpts_global, + HYPRE_Real trunc_factor, + HYPRE_Int P_max_elmts, + HYPRE_Int interp_type, + HYPRE_Int num_functions, + HYPRE_Int *dof_func, + hypre_ParCSRMatrix **P_ptr ) +{ +#ifdef HYPRE_PROFILE + hypre_profile_times[HYPRE_TIMER_ID_MULTIPASS_INTERP] -= hypre_MPI_Wtime(); +#endif + + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); + hypre_ParCSRCommHandle *comm_handle; + + HYPRE_MemoryLocation memory_location_P = hypre_ParCSRMatrixMemoryLocation(A); + + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); + HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); + HYPRE_Real *A_diag_data = hypre_CSRMatrixData(A_diag); + HYPRE_Int n_fine = hypre_CSRMatrixNumRows(A_diag); + + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); + HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); + HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); + HYPRE_Real *A_offd_data = hypre_CSRMatrixData(A_offd); + + HYPRE_Int num_cols_offd_A = hypre_CSRMatrixNumCols(A_offd); + + hypre_CSRMatrix *S_diag = hypre_ParCSRMatrixDiag(S); + HYPRE_Int *S_diag_i = hypre_CSRMatrixI(S_diag); + HYPRE_Int *S_diag_j = hypre_CSRMatrixJ(S_diag); + + hypre_CSRMatrix *S_offd = hypre_ParCSRMatrixOffd(S); + HYPRE_Int *S_offd_i = hypre_CSRMatrixI(S_offd); + HYPRE_Int *S_offd_j = hypre_CSRMatrixJ(S_offd); + + hypre_ParCSRMatrix **Pi; + hypre_ParCSRMatrix *P; + hypre_CSRMatrix *P_diag; + HYPRE_Real *P_diag_data; + HYPRE_Int *P_diag_i; /*at first counter of nonzero cols for each row, + finally will be pointer to start of row */ + HYPRE_Int *P_diag_j; + + hypre_CSRMatrix *P_offd; + HYPRE_Real *P_offd_data = NULL; + HYPRE_Int *P_offd_i; /*at first counter of nonzero cols for each row, + finally will be pointer to start of row */ + HYPRE_Int *P_offd_j = NULL; + HYPRE_BigInt *col_map_offd_P = NULL; + HYPRE_Int num_cols_offd_P = 0; + + HYPRE_Int num_sends = 0; + HYPRE_Int *int_buf_data = NULL; + + HYPRE_Int *fine_to_coarse; + HYPRE_Int *points_left; + HYPRE_Int *pass_marker; + HYPRE_Int *pass_marker_offd = NULL; + HYPRE_Int *pass_order; + HYPRE_Int *pass_starts; + + HYPRE_Int i, j, i1, i2, j1; + HYPRE_Int num_passes, p; + HYPRE_BigInt global_remaining, remaining; + HYPRE_Int cnt, cnt_old, cnt_rem, current_pass; + HYPRE_Int startc, index; + + HYPRE_BigInt total_global_cpts; + HYPRE_Int my_id, num_procs; + HYPRE_Int P_offd_size = 0; + + HYPRE_Int *dof_func_offd = NULL; + HYPRE_Real *row_sums = NULL; + + /* MPI size and rank*/ + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); + + if (num_procs > 1) + { + if (my_id == num_procs - 1) + { + total_global_cpts = num_cpts_global[1]; + } + hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); + } + else + { + total_global_cpts = num_cpts_global[1]; + } + + if (total_global_cpts == 0) + { + *P_ptr = NULL; + return hypre_error_flag; + } + /* Generate pass marker array */ + + pass_marker = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); + /* contains pass numbers for each variable according to original order */ + pass_order = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); + /* contains row numbers according to new order, pass 1 followed by pass 2 etc */ + fine_to_coarse = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); + /* reverse of pass_order, keeps track where original numbers go */ + points_left = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); + /* contains row numbers of remaining points, auxiliary */ + pass_starts = hypre_CTAlloc(HYPRE_Int, 11, HYPRE_MEMORY_HOST); + /* contains beginning for each pass in pass_order field, assume no more than 10 passes */ + + P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, memory_location_P); + P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, memory_location_P); + + cnt = 0; + remaining = 0; + for (i = 0; i < n_fine; i++) + { + if (CF_marker[i] == 1) + { + pass_marker[i] = 1; + P_diag_i[i + 1] = 1; + P_offd_i[i + 1] = 0; + fine_to_coarse[i] = cnt; + pass_order[cnt++] = i; + } + else + { + points_left[remaining++] = i; + } + } + pass_starts[0] = 0; + pass_starts[1] = cnt; + + if (num_functions > 1) + { + dof_func_offd = hypre_CTAlloc(HYPRE_Int, num_cols_offd_A, HYPRE_MEMORY_HOST); + index = 0; + num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); + int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); + for (i = 0; i < num_sends; i++) + { + startc = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); + for (j = startc; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) + { + int_buf_data[index++] = dof_func[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; + } + } + + comm_handle = hypre_ParCSRCommHandleCreate( 11, comm_pkg, int_buf_data, dof_func_offd); + + hypre_ParCSRCommHandleDestroy(comm_handle); + + hypre_TFree(int_buf_data, HYPRE_MEMORY_HOST); + } + + if (num_procs > 1) + { + pass_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_offd_A, HYPRE_MEMORY_HOST); + index = 0; + num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); + int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); + for (i = 0; i < num_sends; i++) + { + startc = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); + for (j = startc; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) + { + int_buf_data[index++] = pass_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; + } + } + + comm_handle = hypre_ParCSRCommHandleCreate(11, comm_pkg, int_buf_data, pass_marker_offd); + + hypre_ParCSRCommHandleDestroy(comm_handle); + } + current_pass = 1; + num_passes = 1; + /* color points according to pass number */ + hypre_MPI_Allreduce(&remaining, &global_remaining, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); + while (global_remaining > 0) + { + HYPRE_Int remaining_pts = (HYPRE_Int) remaining; + HYPRE_BigInt old_global_remaining = global_remaining; + cnt_rem = 0; + for (i = 0; i < remaining_pts; i++) + { + i1 = points_left[i]; + cnt_old = cnt; + for (j = S_diag_i[i1]; j < S_diag_i[i1 + 1]; j++) + { + j1 = S_diag_j[j]; + if (pass_marker[j1] == current_pass) + { + pass_marker[i1] = current_pass + 1; + pass_order[cnt++] = i1; + remaining--; + break; + } + } + if (cnt == cnt_old) + { + for (j = S_offd_i[i1]; j < S_offd_i[i1 + 1]; j++) + { + j1 = S_offd_j[j]; + if (pass_marker_offd[j1] == current_pass) + { + pass_marker[i1] = current_pass + 1; + pass_order[cnt++] = i1; + remaining--; + break; + } + } + } + if (cnt == cnt_old) + { + points_left[cnt_rem++] = i1; + } + } + remaining = (HYPRE_BigInt) cnt_rem; + current_pass++; + num_passes++; + if (num_passes > 9) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, " Warning!!! too many passes! out of range!\n"); + break; + } + pass_starts[num_passes] = cnt; + /* update pass_marker_offd */ + index = 0; + if (num_procs > 1) + { + for (i = 0; i < num_sends; i++) + { + startc = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); + for (j = startc; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) + { + int_buf_data[index++] = pass_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; + } + } + comm_handle = hypre_ParCSRCommHandleCreate(11, comm_pkg, int_buf_data, pass_marker_offd); + + hypre_ParCSRCommHandleDestroy(comm_handle); + } + old_global_remaining = global_remaining; + hypre_MPI_Allreduce(&remaining, &global_remaining, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); + /* if the number of remaining points does not change, we have a situation of isolated areas of + * fine points that are not connected to any C-points, and the pass generation process breaks + * down. Those points can be ignored, i.e. the corresponding rows in P will just be 0 + * and can be ignored for the algorithm. */ + if (old_global_remaining == global_remaining) { break; } + } + hypre_TFree(int_buf_data, HYPRE_MEMORY_HOST); + hypre_TFree(points_left, HYPRE_MEMORY_HOST); + + /* generate row sum of weak points and C-points to be ignored */ + + row_sums = hypre_CTAlloc(HYPRE_Real, n_fine, HYPRE_MEMORY_HOST); + if (num_functions > 1) + { + for (i = 0; i < n_fine; i++) + { + if (CF_marker[i] < 0) + { + for (j = A_diag_i[i] + 1; j < A_diag_i[i + 1]; j++) + { + if (dof_func[i] == dof_func[A_diag_j[j]]) + { + row_sums[i] += A_diag_data[j]; + } + } + for (j = A_offd_i[i]; j < A_offd_i[i + 1]; j++) + { + if (dof_func[i] == dof_func_offd[A_offd_j[j]]) + { + row_sums[i] += A_offd_data[j]; + } + } + } + } + } + else + { + for (i = 0; i < n_fine; i++) + { + if (CF_marker[i] < 0) + { + for (j = A_diag_i[i] + 1; j < A_diag_i[i + 1]; j++) + { + row_sums[i] += A_diag_data[j]; + } + for (j = A_offd_i[i]; j < A_offd_i[i + 1]; j++) + { + row_sums[i] += A_offd_data[j]; + } + } + } + } + + Pi = hypre_CTAlloc(hypre_ParCSRMatrix*, num_passes, HYPRE_MEMORY_HOST); + hypre_GenerateMultipassPi(A, S, num_cpts_global, &pass_order[pass_starts[1]], pass_marker, + pass_marker_offd, pass_starts[2] - pass_starts[1], 1, row_sums, &Pi[0]); + if (interp_type == 8) + { + for (i = 1; i < num_passes - 1; i++) + { + hypre_ParCSRMatrix *Q; + HYPRE_BigInt *c_pts_starts = hypre_ParCSRMatrixRowStarts(Pi[i - 1]); + hypre_GenerateMultipassPi(A, S, c_pts_starts, &pass_order[pass_starts[i + 1]], pass_marker, + pass_marker_offd, pass_starts[i + 2] - pass_starts[i + 1], i + 1, row_sums, &Q); + Pi[i] = hypre_ParMatmul(Q, Pi[i - 1]); + hypre_ParCSRMatrixDestroy(Q); + } + } + else if (interp_type == 9) + { + for (i = 1; i < num_passes - 1; i++) + { + HYPRE_BigInt *c_pts_starts = hypre_ParCSRMatrixRowStarts(Pi[i - 1]); + hypre_GenerateMultiPi(A, S, Pi[i - 1], c_pts_starts, &pass_order[pass_starts[i + 1]], pass_marker, + pass_marker_offd, pass_starts[i + 2] - pass_starts[i + 1], i + 1, + num_functions, dof_func, dof_func_offd, &Pi[i]); + } + } + + /* p pulate P_diag_i[i+1] with nnz of i-th row */ + for (i = 0; i < num_passes - 1; i++) + { + HYPRE_Int *Pi_diag_i = hypre_CSRMatrixI(hypre_ParCSRMatrixDiag(Pi[i])); + HYPRE_Int *Pi_offd_i = hypre_CSRMatrixI(hypre_ParCSRMatrixOffd(Pi[i])); + j1 = 0; + for (j = pass_starts[i + 1]; j < pass_starts[i + 2]; j++) + { + i1 = pass_order[j]; + P_diag_i[i1 + 1] = Pi_diag_i[j1 + 1] - Pi_diag_i[j1]; + P_offd_i[i1 + 1] = Pi_offd_i[j1 + 1] - Pi_offd_i[j1]; + j1++; + } + } + + for (i = 0; i < n_fine; i++) + { + P_diag_i[i + 1] += P_diag_i[i]; + P_offd_i[i + 1] += P_offd_i[i]; + } + + P_diag_j = hypre_CTAlloc(HYPRE_Int, P_diag_i[n_fine], memory_location_P); + P_diag_data = hypre_CTAlloc(HYPRE_Real, P_diag_i[n_fine], memory_location_P); + P_offd_j = hypre_CTAlloc(HYPRE_Int, P_offd_i[n_fine], memory_location_P); + P_offd_data = hypre_CTAlloc(HYPRE_Real, P_offd_i[n_fine], memory_location_P); + + /* insert weights for coarse points */ + for (i = 0; i < pass_starts[1]; i++) + { + i1 = pass_order[i]; + j = P_diag_i[i1]; + P_diag_j[j] = fine_to_coarse[i1]; + P_diag_data[j] = 1.0; + } + + /* generate col_map_offd_P by combining all col_map_offd_Pi + * and reompute indices if needed */ + + /* insert remaining weights */ + for (p = 0; p < num_passes - 1; p++) + { + HYPRE_Int *Pi_diag_i = hypre_CSRMatrixI(hypre_ParCSRMatrixDiag(Pi[p])); + HYPRE_Int *Pi_offd_i = hypre_CSRMatrixI(hypre_ParCSRMatrixOffd(Pi[p])); + HYPRE_Int *Pi_diag_j = hypre_CSRMatrixJ(hypre_ParCSRMatrixDiag(Pi[p])); + HYPRE_Int *Pi_offd_j = hypre_CSRMatrixJ(hypre_ParCSRMatrixOffd(Pi[p])); + HYPRE_Real *Pi_diag_data = hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(Pi[p])); + HYPRE_Real *Pi_offd_data = hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(Pi[p])); + j1 = 0; + for (i = pass_starts[p + 1]; i < pass_starts[p + 2]; i++) + { + i1 = pass_order[i]; + i2 = Pi_diag_i[j1]; + for (j = P_diag_i[i1]; j < P_diag_i[i1 + 1]; j++) + { + P_diag_j[j] = Pi_diag_j[i2]; + P_diag_data[j] = Pi_diag_data[i2++]; + } + i2 = Pi_offd_i[j1]; + for (j = P_offd_i[i1]; j < P_offd_i[i1 + 1]; j++) + { + P_offd_j[j] = Pi_offd_j[i2]; + P_offd_data[j] = Pi_offd_data[i2++]; + } + j1++; + } + } + /* Note that col indices in P_offd_j probably not consistent, + this gets fixed after truncation */ + + P = hypre_ParCSRMatrixCreate(comm, + hypre_ParCSRMatrixGlobalNumRows(A), + total_global_cpts, + hypre_ParCSRMatrixRowStarts(A), + num_cpts_global, + num_cols_offd_P, + P_diag_i[n_fine], + P_offd_i[n_fine]); + P_diag = hypre_ParCSRMatrixDiag(P); + hypre_CSRMatrixData(P_diag) = P_diag_data; + hypre_CSRMatrixI(P_diag) = P_diag_i; + hypre_CSRMatrixJ(P_diag) = P_diag_j; + P_offd = hypre_ParCSRMatrixOffd(P); + hypre_CSRMatrixData(P_offd) = P_offd_data; + hypre_CSRMatrixI(P_offd) = P_offd_i; + hypre_CSRMatrixJ(P_offd) = P_offd_j; + + /* Compress P, removing coefficients smaller than trunc_factor * Max */ + + if (trunc_factor != 0.0 || P_max_elmts > 0) + { + hypre_BoomerAMGInterpTruncation(P, trunc_factor, P_max_elmts); + P_diag_data = hypre_CSRMatrixData(P_diag); + P_diag_i = hypre_CSRMatrixI(P_diag); + P_diag_j = hypre_CSRMatrixJ(P_diag); + P_offd_data = hypre_CSRMatrixData(P_offd); + P_offd_i = hypre_CSRMatrixI(P_offd); + P_offd_j = hypre_CSRMatrixJ(P_offd); + } + + num_cols_offd_P = 0; + P_offd_size = P_offd_i[n_fine]; + if (P_offd_size) + { + HYPRE_BigInt *tmp_P_offd_j = hypre_CTAlloc(HYPRE_BigInt, P_offd_size, HYPRE_MEMORY_HOST); + HYPRE_BigInt *big_P_offd_j = hypre_CTAlloc(HYPRE_BigInt, P_offd_size, HYPRE_MEMORY_HOST); + for (p = 0; p < num_passes - 1; p++) + { + HYPRE_BigInt *col_map_offd_Pi = hypre_ParCSRMatrixColMapOffd(Pi[p]); + for (i = pass_starts[p + 1]; i < pass_starts[p + 2]; i++) + { + i1 = pass_order[i]; + for (j = P_offd_i[i1]; j < P_offd_i[i1 + 1]; j++) + { + big_P_offd_j[j] = col_map_offd_Pi[P_offd_j[j]]; + } + } + } + + for (i = 0; i < P_offd_size; i++) + { + tmp_P_offd_j[i] = big_P_offd_j[i]; + } + + hypre_BigQsort0(tmp_P_offd_j, 0, P_offd_size - 1); + + num_cols_offd_P = 1; + for (i = 0; i < P_offd_size - 1; i++) + { + if (tmp_P_offd_j[i + 1] > tmp_P_offd_j[i]) + { + tmp_P_offd_j[num_cols_offd_P++] = tmp_P_offd_j[i + 1]; + } + } + + col_map_offd_P = hypre_CTAlloc(HYPRE_BigInt, num_cols_offd_P, HYPRE_MEMORY_HOST); + + for (i = 0; i < num_cols_offd_P; i++) + { + col_map_offd_P[i] = tmp_P_offd_j[i]; + } + + for (i = 0; i < P_offd_size; i++) + { + P_offd_j[i] = hypre_BigBinarySearch(col_map_offd_P, + big_P_offd_j[i], + num_cols_offd_P); + } + hypre_TFree(tmp_P_offd_j, HYPRE_MEMORY_HOST); + hypre_TFree(big_P_offd_j, HYPRE_MEMORY_HOST); + } + + for (i = 0; i < num_passes - 1; i++) + { + hypre_ParCSRMatrixDestroy(Pi[i]); + } + hypre_TFree (Pi, HYPRE_MEMORY_HOST); + hypre_TFree (pass_marker, HYPRE_MEMORY_HOST); + hypre_TFree (pass_marker_offd, HYPRE_MEMORY_HOST); + hypre_TFree (pass_order, HYPRE_MEMORY_HOST); + hypre_TFree (pass_starts, HYPRE_MEMORY_HOST); + hypre_TFree (fine_to_coarse, HYPRE_MEMORY_HOST); + hypre_TFree (dof_func_offd, HYPRE_MEMORY_HOST); + hypre_TFree (row_sums, HYPRE_MEMORY_HOST); + + for (i = 0; i < n_fine; i++) + { + if (CF_marker[i] == -3) { CF_marker[i] = -1; } + } + + hypre_ParCSRMatrixColMapOffd(P) = col_map_offd_P; + hypre_CSRMatrixNumCols(P_offd) = num_cols_offd_P; + + hypre_MatvecCommPkgCreate(P); + + *P_ptr = P; + + return hypre_error_flag; + +} + + +HYPRE_Int +hypre_GenerateMultipassPi( hypre_ParCSRMatrix *A, + hypre_ParCSRMatrix *S, + HYPRE_BigInt *c_pts_starts, + HYPRE_Int + *pass_order, /* array containing row numbers of rows in A and S to be considered */ + HYPRE_Int *pass_marker, + HYPRE_Int *pass_marker_offd, + HYPRE_Int num_points, + HYPRE_Int color, + HYPRE_Real *row_sums, + hypre_ParCSRMatrix **P_ptr ) +{ + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); + hypre_ParCSRCommHandle *comm_handle; + + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + HYPRE_Real *A_diag_data = hypre_CSRMatrixData(A_diag); + HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); + HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); + HYPRE_Int n_fine = hypre_CSRMatrixNumRows(A_diag); + + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); + HYPRE_Real *A_offd_data = hypre_CSRMatrixData(A_offd); + HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); + HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); + HYPRE_Int num_cols_offd_A = hypre_CSRMatrixNumCols(A_offd); + + hypre_CSRMatrix *S_diag = hypre_ParCSRMatrixDiag(S); + HYPRE_Int *S_diag_i = hypre_CSRMatrixI(S_diag); + HYPRE_Int *S_diag_j = hypre_CSRMatrixJ(S_diag); + + hypre_CSRMatrix *S_offd = hypre_ParCSRMatrixOffd(S); + HYPRE_Int *S_offd_i = hypre_CSRMatrixI(S_offd); + HYPRE_Int *S_offd_j = hypre_CSRMatrixJ(S_offd); + HYPRE_BigInt *col_map_offd_P = NULL; + HYPRE_Int num_cols_offd_P; + HYPRE_Int nnz_diag, nnz_offd; + HYPRE_Int n_cpts, i, j, i1, j1, j2; + HYPRE_Int startc, index; + HYPRE_Int cpt, cnt_diag, cnt_offd; + + hypre_ParCSRMatrix *P; + hypre_CSRMatrix *P_diag; + HYPRE_Real *P_diag_data; + HYPRE_Int *P_diag_i; /*at first counter of nonzero cols for each row, + finally will be pointer to start of row */ + HYPRE_Int *P_diag_j; + + hypre_CSRMatrix *P_offd; + HYPRE_Real *P_offd_data = NULL; + HYPRE_Int *P_offd_i; /*at first counter of nonzero cols for each row, + finally will be pointer to start of row */ + HYPRE_Int *P_offd_j = NULL; + HYPRE_Int *fine_to_coarse; + HYPRE_Int *fine_to_coarse_offd = NULL; + HYPRE_BigInt f_pts_starts[2]; + HYPRE_Int my_id, num_procs; + HYPRE_BigInt total_global_fpts; + HYPRE_BigInt total_global_cpts; + HYPRE_BigInt *big_convert; + HYPRE_BigInt *big_convert_offd = NULL; + HYPRE_BigInt *big_buf_data = NULL; + HYPRE_Int num_sends; + HYPRE_Real *row_sum_C; + + /* MPI size and rank*/ + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); + + /* define P matrices */ + + P_diag_i = hypre_CTAlloc(HYPRE_Int, num_points + 1, HYPRE_MEMORY_HOST); + P_offd_i = hypre_CTAlloc(HYPRE_Int, num_points + 1, HYPRE_MEMORY_HOST); + fine_to_coarse = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); + + /* fill P */ + + n_cpts = 0; + for (i = 0; i < n_fine; i++) + { + if (pass_marker[i] == color) + { + fine_to_coarse[i] = n_cpts++; + } + else + { + fine_to_coarse[i] = -1; + } + } + + if (num_procs > 1) + { + HYPRE_BigInt big_Fpts; + big_Fpts = num_points; + + hypre_MPI_Scan(&big_Fpts, f_pts_starts + 1, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); + f_pts_starts[0] = f_pts_starts[1] - big_Fpts; + if (my_id == num_procs - 1) + { + total_global_fpts = f_pts_starts[1]; + total_global_cpts = c_pts_starts[1]; + } + hypre_MPI_Bcast(&total_global_fpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); + hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); + } + else + { + f_pts_starts[0] = 0; + f_pts_starts[1] = num_points; + total_global_fpts = f_pts_starts[1]; + total_global_cpts = c_pts_starts[1]; + } + + { + big_convert = hypre_CTAlloc(HYPRE_BigInt, n_fine, HYPRE_MEMORY_HOST); + for (i = 0; i < n_fine; i++) + { + if (pass_marker[i] == color) + { + big_convert[i] = (HYPRE_BigInt)fine_to_coarse[i] + c_pts_starts[0]; + } + } + + num_cols_offd_P = 0; + if (num_procs > 1) + { + big_convert_offd = hypre_CTAlloc(HYPRE_BigInt, num_cols_offd_A, HYPRE_MEMORY_HOST); + fine_to_coarse_offd = hypre_CTAlloc(HYPRE_Int, num_cols_offd_A, HYPRE_MEMORY_HOST); + index = 0; + num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); + big_buf_data = hypre_CTAlloc(HYPRE_BigInt, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); + for (i = 0; i < num_sends; i++) + { + startc = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); + for (j = startc; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) + { + big_buf_data[index++] = big_convert[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; + } + } + + comm_handle = hypre_ParCSRCommHandleCreate( 21, comm_pkg, big_buf_data, big_convert_offd); + + hypre_ParCSRCommHandleDestroy(comm_handle); + + num_cols_offd_P = 0; + for (i = 0; i < num_cols_offd_A; i++) + { + if (pass_marker_offd[i] == color) + { + fine_to_coarse_offd[i] = num_cols_offd_P++; + } + } + + col_map_offd_P = hypre_CTAlloc(HYPRE_BigInt, num_cols_offd_P, HYPRE_MEMORY_HOST); + + cpt = 0; + for (i = 0; i < num_cols_offd_A; i++) + { + if (pass_marker_offd[i] == color) + { + col_map_offd_P[cpt++] = big_convert_offd[i]; + } + } + } + } + + /* generate P_diag_i and P_offd_i */ + nnz_diag = 0; + nnz_offd = 0; + for (i = 0; i < num_points; i++) + { + i1 = pass_order[i]; + for (j = S_diag_i[i1]; j < S_diag_i[i1 + 1]; j++) + { + j1 = S_diag_j[j]; + if (pass_marker[j1] == color) + { + P_diag_i[i + 1]++; + nnz_diag++; + } + } + for (j = S_offd_i[i1]; j < S_offd_i[i1 + 1]; j++) + { + j1 = S_offd_j[j]; + if (pass_marker_offd[j1] == color) + { + P_offd_i[i + 1]++; + nnz_offd++; + } + } + } + + for (i = 1; i < num_points + 1; i++) + { + P_diag_i[i] += P_diag_i[i - 1]; + P_offd_i[i] += P_offd_i[i - 1]; + } + + P_diag_j = hypre_CTAlloc(HYPRE_Int, nnz_diag, HYPRE_MEMORY_HOST); + P_diag_data = hypre_CTAlloc(HYPRE_Real, nnz_diag, HYPRE_MEMORY_HOST); + P_offd_j = hypre_CTAlloc(HYPRE_Int, nnz_offd, HYPRE_MEMORY_HOST); + P_offd_data = hypre_CTAlloc(HYPRE_Real, nnz_offd, HYPRE_MEMORY_HOST); + + cnt_diag = 0; + cnt_offd = 0; + for (i = 0; i < num_points; i++) + { + i1 = pass_order[i]; + j2 = A_diag_i[i1]; + for (j = S_diag_i[i1]; j < S_diag_i[i1 + 1]; j++) + { + j1 = S_diag_j[j]; + while (A_diag_j[j2] != j1) { j2++; } + if (pass_marker[j1] == color && A_diag_j[j2] == j1) + { + P_diag_j[cnt_diag] = fine_to_coarse[j1]; + P_diag_data[cnt_diag++] = A_diag_data[j2]; + } + } + j2 = A_offd_i[i1]; + for (j = S_offd_i[i1]; j < S_offd_i[i1 + 1]; j++) + { + j1 = S_offd_j[j]; + while (A_offd_j[j2] != j1) { j2++; } + if (pass_marker_offd[j1] == color && A_offd_j[j2] == j1) + { + P_offd_j[cnt_offd] = fine_to_coarse_offd[j1]; + P_offd_data[cnt_offd++] = A_offd_data[j2]; + } + } + } + + //row_sums = hypre_CTAlloc(HYPRE_Real, num_points, HYPRE_MEMORY_HOST); + row_sum_C = hypre_CTAlloc(HYPRE_Real, num_points, HYPRE_MEMORY_HOST); + for (i = 0; i < num_points; i++) + { + HYPRE_Real diagonal, value; + i1 = pass_order[i]; + diagonal = A_diag_data[A_diag_i[i1]]; + /*for (j=A_diag_i[i1]+1; j < A_diag_i[i1+1]; j++) + { + row_sums[i] += A_diag_data[j]; + } + for (j=A_offd_i[i1]; j < A_offd_i[i1+1]; j++) + { + row_sums[i] += A_offd_data[j]; + }*/ + for (j = P_diag_i[i]; j < P_diag_i[i + 1]; j++) + { + row_sum_C[i] += P_diag_data[j]; + } + for (j = P_offd_i[i]; j < P_offd_i[i + 1]; j++) + { + row_sum_C[i] += P_offd_data[j]; + } + value = row_sum_C[i] * diagonal; + if (value != 0) + { + row_sums[i1] /= value; + } + for (j = P_diag_i[i]; j < P_diag_i[i + 1]; j++) + { + P_diag_data[j] = -P_diag_data[j] * row_sums[i1]; + } + for (j = P_offd_i[i]; j < P_offd_i[i + 1]; j++) + { + P_offd_data[j] = -P_offd_data[j] * row_sums[i1]; + } + } + + + P = hypre_ParCSRMatrixCreate(comm, + total_global_fpts, + total_global_cpts, + f_pts_starts, + c_pts_starts, + num_cols_offd_P, + P_diag_i[num_points], + P_offd_i[num_points]); + + P_diag = hypre_ParCSRMatrixDiag(P); + hypre_CSRMatrixData(P_diag) = P_diag_data; + hypre_CSRMatrixI(P_diag) = P_diag_i; + hypre_CSRMatrixJ(P_diag) = P_diag_j; + P_offd = hypre_ParCSRMatrixOffd(P); + hypre_CSRMatrixData(P_offd) = P_offd_data; + hypre_CSRMatrixI(P_offd) = P_offd_i; + hypre_CSRMatrixJ(P_offd) = P_offd_j; + hypre_ParCSRMatrixColMapOffd(P) = col_map_offd_P; + + hypre_CSRMatrixMemoryLocation(P_diag) = HYPRE_MEMORY_HOST; + hypre_CSRMatrixMemoryLocation(P_offd) = HYPRE_MEMORY_HOST; + + /* free stuff */ + hypre_TFree(fine_to_coarse, HYPRE_MEMORY_HOST); + hypre_TFree(fine_to_coarse_offd, HYPRE_MEMORY_HOST); + //hypre_TFree(row_sums, HYPRE_MEMORY_HOST); + hypre_TFree(row_sum_C, HYPRE_MEMORY_HOST); + hypre_TFree(big_convert, HYPRE_MEMORY_HOST); + hypre_TFree(big_convert_offd, HYPRE_MEMORY_HOST); + hypre_TFree(big_buf_data, HYPRE_MEMORY_HOST); + + hypre_MatvecCommPkgCreate(P); + *P_ptr = P; + + return hypre_error_flag; +} + +HYPRE_Int +hypre_GenerateMultiPi( hypre_ParCSRMatrix *A, + hypre_ParCSRMatrix *S, + hypre_ParCSRMatrix *P, + HYPRE_BigInt *c_pts_starts, + HYPRE_Int + *pass_order, /* array containing row numbers of rows in A and S to be considered */ + HYPRE_Int *pass_marker, + HYPRE_Int *pass_marker_offd, + HYPRE_Int num_points, + HYPRE_Int color, + HYPRE_Int num_functions, + HYPRE_Int *dof_func, + HYPRE_Int *dof_func_offd, + hypre_ParCSRMatrix **Pi_ptr ) +{ + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); + hypre_ParCSRCommHandle *comm_handle; + + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + HYPRE_Real *A_diag_data = hypre_CSRMatrixData(A_diag); + HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); + HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); + HYPRE_Int n_fine = hypre_CSRMatrixNumRows(A_diag); + + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); + HYPRE_Real *A_offd_data = hypre_CSRMatrixData(A_offd); + HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); + HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); + HYPRE_Int num_cols_offd_A = hypre_CSRMatrixNumCols(A_offd); + + hypre_CSRMatrix *S_diag = hypre_ParCSRMatrixDiag(S); + HYPRE_Int *S_diag_i = hypre_CSRMatrixI(S_diag); + HYPRE_Int *S_diag_j = hypre_CSRMatrixJ(S_diag); + + hypre_CSRMatrix *S_offd = hypre_ParCSRMatrixOffd(S); + HYPRE_Int *S_offd_i = hypre_CSRMatrixI(S_offd); + HYPRE_Int *S_offd_j = hypre_CSRMatrixJ(S_offd); + HYPRE_BigInt *col_map_offd_Q = NULL; + HYPRE_Int num_cols_offd_Q; + + hypre_ParCSRMatrix *Pi; + hypre_CSRMatrix *Pi_diag; + HYPRE_Int *Pi_diag_i; + HYPRE_Real *Pi_diag_data; + + hypre_CSRMatrix *Pi_offd; + HYPRE_Int *Pi_offd_i; + HYPRE_Real *Pi_offd_data; + + HYPRE_Int nnz_diag, nnz_offd; + HYPRE_Int n_cpts, i, j, i1, j1, j2; + HYPRE_Int startc, index; + HYPRE_Int cpt, cnt_diag, cnt_offd; + + hypre_ParCSRMatrix *Q; + hypre_CSRMatrix *Q_diag; + HYPRE_Real *Q_diag_data; + HYPRE_Int *Q_diag_i; /*at first counter of nonzero cols for each row, + finally will be pointer to start of row */ + HYPRE_Int *Q_diag_j; + + hypre_CSRMatrix *Q_offd; + HYPRE_Real *Q_offd_data = NULL; + HYPRE_Int *Q_offd_i; /*at first counter of nonzero cols for each row, + finally will be pointer to start of row */ + HYPRE_Int *Q_offd_j = NULL; + HYPRE_Int *fine_to_coarse; + HYPRE_Int *fine_to_coarse_offd = NULL; + HYPRE_BigInt f_pts_starts[2]; + HYPRE_Int my_id, num_procs; + HYPRE_BigInt total_global_fpts; + HYPRE_BigInt total_global_cpts; + HYPRE_BigInt *big_convert; + HYPRE_BigInt *big_convert_offd = NULL; + HYPRE_BigInt *big_buf_data = NULL; + HYPRE_Int num_sends; + //HYPRE_Real *row_sums; + HYPRE_Real *row_sums_C; + HYPRE_Real *w_row_sum; + + /* MPI size and rank*/ + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); + + /* define P matrices */ + + Q_diag_i = hypre_CTAlloc(HYPRE_Int, num_points + 1, HYPRE_MEMORY_HOST); + Q_offd_i = hypre_CTAlloc(HYPRE_Int, num_points + 1, HYPRE_MEMORY_HOST); + fine_to_coarse = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); + + /* fill P */ + + n_cpts = 0; + for (i = 0; i < n_fine; i++) + { + if (pass_marker[i] == color) + { + fine_to_coarse[i] = n_cpts++; + } + else + { + fine_to_coarse[i] = -1; + } + } + + if (num_procs > 1) + { + HYPRE_BigInt big_Fpts; + big_Fpts = num_points; + + hypre_MPI_Scan(&big_Fpts, f_pts_starts + 1, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); + f_pts_starts[0] = f_pts_starts[1] - big_Fpts; + if (my_id == num_procs - 1) + { + total_global_fpts = f_pts_starts[1]; + total_global_cpts = c_pts_starts[1]; + } + hypre_MPI_Bcast(&total_global_fpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); + hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); + } + else + { + f_pts_starts[0] = 0; + f_pts_starts[1] = num_points; + total_global_fpts = f_pts_starts[1]; + total_global_cpts = c_pts_starts[1]; + } + + { + big_convert = hypre_CTAlloc(HYPRE_BigInt, n_fine, HYPRE_MEMORY_HOST); + for (i = 0; i < n_fine; i++) + { + if (pass_marker[i] == color) + { + big_convert[i] = (HYPRE_BigInt)fine_to_coarse[i] + c_pts_starts[0]; + } + } + + num_cols_offd_Q = 0; + if (num_procs > 1) + { + big_convert_offd = hypre_CTAlloc(HYPRE_BigInt, num_cols_offd_A, HYPRE_MEMORY_HOST); + fine_to_coarse_offd = hypre_CTAlloc(HYPRE_Int, num_cols_offd_A, HYPRE_MEMORY_HOST); + index = 0; + num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); + big_buf_data = hypre_CTAlloc(HYPRE_BigInt, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); + for (i = 0; i < num_sends; i++) + { + startc = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); + for (j = startc; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) + { + big_buf_data[index++] = big_convert[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; + } + } + + comm_handle = hypre_ParCSRCommHandleCreate( 21, comm_pkg, big_buf_data, big_convert_offd); + + hypre_ParCSRCommHandleDestroy(comm_handle); + + num_cols_offd_Q = 0; + for (i = 0; i < num_cols_offd_A; i++) + { + if (pass_marker_offd[i] == color) + { + fine_to_coarse_offd[i] = num_cols_offd_Q++; + } + } + + col_map_offd_Q = hypre_CTAlloc(HYPRE_BigInt, num_cols_offd_Q, HYPRE_MEMORY_HOST); + + cpt = 0; + for (i = 0; i < num_cols_offd_A; i++) + { + if (pass_marker_offd[i] == color) + { + col_map_offd_Q[cpt++] = big_convert_offd[i]; + } + } + } + } + + /* generate Q_diag_i and Q_offd_i */ + nnz_diag = 0; + nnz_offd = 0; + for (i = 0; i < num_points; i++) + { + i1 = pass_order[i]; + for (j = S_diag_i[i1]; j < S_diag_i[i1 + 1]; j++) + { + j1 = S_diag_j[j]; + if (pass_marker[j1] == color) + { + Q_diag_i[i + 1]++; + nnz_diag++; + } + } + for (j = S_offd_i[i1]; j < S_offd_i[i1 + 1]; j++) + { + j1 = S_offd_j[j]; + if (pass_marker_offd[j1] == color) + { + Q_offd_i[i + 1]++; + nnz_offd++; + } + } + } + + for (i = 1; i < num_points + 1; i++) + { + Q_diag_i[i] += Q_diag_i[i - 1]; + Q_offd_i[i] += Q_offd_i[i - 1]; + } + + Q_diag_j = hypre_CTAlloc(HYPRE_Int, nnz_diag, HYPRE_MEMORY_HOST); + Q_diag_data = hypre_CTAlloc(HYPRE_Real, nnz_diag, HYPRE_MEMORY_HOST); + Q_offd_j = hypre_CTAlloc(HYPRE_Int, nnz_offd, HYPRE_MEMORY_HOST); + Q_offd_data = hypre_CTAlloc(HYPRE_Real, nnz_offd, HYPRE_MEMORY_HOST); + w_row_sum = hypre_CTAlloc(HYPRE_Real, num_points, HYPRE_MEMORY_HOST); + + cnt_diag = 0; + cnt_offd = 0; + if (num_functions > 1) + { + for (i = 0; i < num_points; i++) + { + i1 = pass_order[i]; + j2 = A_diag_i[i1] + 1; + //if (w_row_minus) w_row_sum[i] = -w_row_minus[i1]; + for (j = S_diag_i[i1]; j < S_diag_i[i1 + 1]; j++) + { + j1 = S_diag_j[j]; + while (A_diag_j[j2] != j1) + { + if (dof_func[i1] == dof_func[A_diag_j[j2]]) + { + w_row_sum[i] += A_diag_data[j2]; + } + j2++; + } + if (pass_marker[j1] == color && A_diag_j[j2] == j1) + { + Q_diag_j[cnt_diag] = fine_to_coarse[j1]; + Q_diag_data[cnt_diag++] = A_diag_data[j2++]; + } + else + { + if (dof_func[i1] == dof_func[A_diag_j[j2]]) + { + w_row_sum[i] += A_diag_data[j2]; + } + j2++; + } + } + while (j2 < A_diag_i[i1 + 1]) + { + if (dof_func[i1] == dof_func[A_diag_j[j2]]) + { + w_row_sum[i] += A_diag_data[j2]; + } + j2++; + } + j2 = A_offd_i[i1]; + for (j = S_offd_i[i1]; j < S_offd_i[i1 + 1]; j++) + { + j1 = S_offd_j[j]; + while (A_offd_j[j2] != j1) + { + if (dof_func[i1] == dof_func_offd[A_offd_j[j2]]) + { + w_row_sum[i] += A_offd_data[j2]; + } + j2++; + } + if (pass_marker_offd[j1] == color && A_offd_j[j2] == j1) + { + Q_offd_j[cnt_offd] = fine_to_coarse_offd[j1]; + Q_offd_data[cnt_offd++] = A_offd_data[j2++]; + } + else + { + if (dof_func[i1] == dof_func_offd[A_offd_j[j2]]) + { + w_row_sum[i] += A_offd_data[j2]; + } + j2++; + } + } + while (j2 < A_offd_i[i1 + 1]) + { + if (dof_func[i1] == dof_func_offd[A_offd_j[j2]]) + { + w_row_sum[i] += A_offd_data[j2]; + } + j2++; + } + } + } + else + { + for (i = 0; i < num_points; i++) + { + i1 = pass_order[i]; + j2 = A_diag_i[i1] + 1; + for (j = S_diag_i[i1]; j < S_diag_i[i1 + 1]; j++) + { + j1 = S_diag_j[j]; + while (A_diag_j[j2] != j1) + { + w_row_sum[i] += A_diag_data[j2]; + j2++; + } + if (pass_marker[j1] == color && A_diag_j[j2] == j1) + { + Q_diag_j[cnt_diag] = fine_to_coarse[j1]; + Q_diag_data[cnt_diag++] = A_diag_data[j2++]; + } + else + { + w_row_sum[i] += A_diag_data[j2]; + j2++; + } + } + while (j2 < A_diag_i[i1 + 1]) + { + w_row_sum[i] += A_diag_data[j2]; + j2++; + } + j2 = A_offd_i[i1]; + for (j = S_offd_i[i1]; j < S_offd_i[i1 + 1]; j++) + { + j1 = S_offd_j[j]; + while (A_offd_j[j2] != j1) + { + w_row_sum[i] += A_offd_data[j2]; + j2++; + } + if (pass_marker_offd[j1] == color && A_offd_j[j2] == j1) + { + Q_offd_j[cnt_offd] = fine_to_coarse_offd[j1]; + Q_offd_data[cnt_offd++] = A_offd_data[j2++]; + } + else + { + w_row_sum[i] += A_offd_data[j2]; + j2++; + } + } + while (j2 < A_offd_i[i1 + 1]) + { + w_row_sum[i] += A_offd_data[j2]; + j2++; + } + } + } + + Q = hypre_ParCSRMatrixCreate(comm, + total_global_fpts, + total_global_cpts, + f_pts_starts, + c_pts_starts, + num_cols_offd_Q, + Q_diag_i[num_points], + Q_offd_i[num_points]); + + Q_diag = hypre_ParCSRMatrixDiag(Q); + hypre_CSRMatrixData(Q_diag) = Q_diag_data; + hypre_CSRMatrixI(Q_diag) = Q_diag_i; + hypre_CSRMatrixJ(Q_diag) = Q_diag_j; + Q_offd = hypre_ParCSRMatrixOffd(Q); + hypre_CSRMatrixData(Q_offd) = Q_offd_data; + hypre_CSRMatrixI(Q_offd) = Q_offd_i; + hypre_CSRMatrixJ(Q_offd) = Q_offd_j; + hypre_ParCSRMatrixColMapOffd(Q) = col_map_offd_Q; + + hypre_CSRMatrixMemoryLocation(Q_diag) = HYPRE_MEMORY_HOST; + hypre_CSRMatrixMemoryLocation(Q_offd) = HYPRE_MEMORY_HOST; + + /* free stuff */ + hypre_TFree(fine_to_coarse, HYPRE_MEMORY_HOST); + hypre_TFree(fine_to_coarse_offd, HYPRE_MEMORY_HOST); + hypre_TFree(big_convert, HYPRE_MEMORY_HOST); + hypre_TFree(big_convert_offd, HYPRE_MEMORY_HOST); + hypre_TFree(big_buf_data, HYPRE_MEMORY_HOST); + + hypre_MatvecCommPkgCreate(Q); + + Pi = hypre_ParMatmul(Q, P); + + Pi_diag = hypre_ParCSRMatrixDiag(Pi); + Pi_diag_data = hypre_CSRMatrixData(Pi_diag); + Pi_diag_i = hypre_CSRMatrixI(Pi_diag); + Pi_offd = hypre_ParCSRMatrixOffd(Pi); + Pi_offd_data = hypre_CSRMatrixData(Pi_offd); + Pi_offd_i = hypre_CSRMatrixI(Pi_offd); + + row_sums_C = hypre_CTAlloc(HYPRE_Real, num_points, HYPRE_MEMORY_HOST); + for (i = 0; i < num_points; i++) + { + HYPRE_Real diagonal, value; + i1 = pass_order[i]; + diagonal = A_diag_data[A_diag_i[i1]]; + for (j = Pi_diag_i[i]; j < Pi_diag_i[i + 1]; j++) + { + row_sums_C[i] += Pi_diag_data[j]; + } + for (j = Pi_offd_i[i]; j < Pi_offd_i[i + 1]; j++) + { + row_sums_C[i] += Pi_offd_data[j]; + } + value = row_sums_C[i] * diagonal; + row_sums_C[i] += w_row_sum[i]; + if (value != 0) + { + row_sums_C[i] /= value; + } + for (j = Pi_diag_i[i]; j < Pi_diag_i[i + 1]; j++) + { + Pi_diag_data[j] = -Pi_diag_data[j] * row_sums_C[i]; + } + for (j = Pi_offd_i[i]; j < Pi_offd_i[i + 1]; j++) + { + Pi_offd_data[j] = -Pi_offd_data[j] * row_sums_C[i]; + } + } + + hypre_ParCSRMatrixDestroy(Q); + //hypre_TFree(row_sums, HYPRE_MEMORY_HOST); + hypre_TFree(row_sums_C, HYPRE_MEMORY_HOST); + hypre_TFree(w_row_sum, HYPRE_MEMORY_HOST); + + *Pi_ptr = Pi; + + return hypre_error_flag; +} + + +HYPRE_Int +hypre_BoomerAMGBuildModMultipass( hypre_ParCSRMatrix *A, + HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, + HYPRE_BigInt *num_cpts_global, + HYPRE_Real trunc_factor, + HYPRE_Int P_max_elmts, + HYPRE_Int interp_type, + HYPRE_Int num_functions, + HYPRE_Int *dof_func, + hypre_ParCSRMatrix **P_ptr ) +{ + hypre_GpuProfilingPushRange("ModMultipass"); + + HYPRE_Int ierr = 0; + +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy2( hypre_ParCSRMatrixMemoryLocation(A), + hypre_ParCSRMatrixMemoryLocation(S) ); + if (exec == HYPRE_EXEC_DEVICE) + { + ierr = hypre_BoomerAMGBuildModMultipassDevice( A, CF_marker, S, num_cpts_global, + trunc_factor, P_max_elmts, + interp_type, num_functions, + dof_func, P_ptr); + } + else +#endif + { + ierr = hypre_BoomerAMGBuildModMultipassHost( A, CF_marker, S, num_cpts_global, + trunc_factor, P_max_elmts, + interp_type, num_functions, + dof_func, P_ptr); + } + + hypre_GpuProfilingPopRange(); + + return ierr; +} + diff --git a/external/hypre/src/parcsr_ls/par_mod_multi_interp_device.c b/external/hypre/src/parcsr_ls/par_mod_multi_interp_device.c new file mode 100644 index 00000000..0f925dc3 --- /dev/null +++ b/external/hypre/src/parcsr_ls/par_mod_multi_interp_device.c @@ -0,0 +1,2492 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#include "_hypre_onedpl.hpp" +#include "_hypre_parcsr_ls.h" +#include "_hypre_utilities.hpp" + +#if defined(HYPRE_USING_GPU) + +#if defined(HYPRE_USING_SYCL) +template +struct tuple_plus +{ + __host__ __device__ + std::tuple operator()( const std::tuple & x1, const std::tuple & x2) const + { + return std::make_tuple( std::get<0>(x1) + std::get<0>(x2), + std::get<1>(x1) + std::get<1>(x2) ); + } +}; + +struct local_equal_plus_constant +{ + HYPRE_BigInt _value; + + local_equal_plus_constant(HYPRE_BigInt value) : _value(value) {} + + __host__ __device__ HYPRE_BigInt operator()(HYPRE_BigInt /*x*/, HYPRE_BigInt y) const + { return y + _value; } +}; + +/* transform from local C index to global C index */ +struct globalC_functor +{ + HYPRE_BigInt C_first; + + globalC_functor(HYPRE_BigInt C_first_) + { + C_first = C_first_; + } + + __host__ __device__ + HYPRE_BigInt operator()(const HYPRE_Int x) const + { + return ( (HYPRE_BigInt) x + C_first ); + } +}; +#else +template +struct tuple_plus : public + thrust::binary_function, thrust::tuple, thrust::tuple > +{ + __host__ __device__ + thrust::tuple operator()( const thrust::tuple & x1, const thrust::tuple & x2) + { + return thrust::make_tuple( thrust::get<0>(x1) + thrust::get<0>(x2), + thrust::get<1>(x1) + thrust::get<1>(x2) ); + } +}; + +template +struct tuple_minus : public + thrust::binary_function, thrust::tuple, thrust::tuple > +{ + __host__ __device__ + thrust::tuple operator()( const thrust::tuple & x1, const thrust::tuple & x2) + { + return thrust::make_tuple( thrust::get<0>(x1) - thrust::get<0>(x2), + thrust::get<1>(x1) - thrust::get<1>(x2) ); + } +}; + +struct local_equal_plus_constant : public + thrust::binary_function +{ + HYPRE_BigInt _value; + + local_equal_plus_constant(HYPRE_BigInt value) : _value(value) {} + + __host__ __device__ HYPRE_BigInt operator()(HYPRE_BigInt /*x*/, HYPRE_BigInt y) + { return y + _value; } +}; + +/* transform from local C index to global C index */ +#if (defined(THRUST_VERSION) && THRUST_VERSION < 101000) +struct globalC_functor : public thrust::unary_function +#else +struct globalC_functor +#endif +{ + HYPRE_BigInt C_first; + + globalC_functor(HYPRE_BigInt C_first_) + { + C_first = C_first_; + } + + __host__ __device__ + HYPRE_BigInt operator()(const HYPRE_Int x) const + { + return ( (HYPRE_BigInt) x + C_first ); + } +}; +#endif + +void hypre_modmp_init_fine_to_coarse( HYPRE_Int n_fine, HYPRE_Int *pass_marker, HYPRE_Int color, + HYPRE_Int *fine_to_coarse ); + +void hypre_modmp_compute_num_cols_offd_fine_to_coarse( HYPRE_Int * pass_marker_offd, + HYPRE_Int color, HYPRE_Int num_cols_offd_A, HYPRE_Int & num_cols_offd, + HYPRE_Int ** fine_to_coarse_offd ); + +__global__ void hypreGPUKernel_cfmarker_masked_rowsum( hypre_DeviceItem &item, HYPRE_Int nrows, + HYPRE_Int *A_diag_i, + HYPRE_Int *A_diag_j, HYPRE_Complex *A_diag_data, HYPRE_Int *A_offd_i, HYPRE_Int *A_offd_j, + HYPRE_Complex *A_offd_data, HYPRE_Int *CF_marker, HYPRE_Int *dof_func, HYPRE_Int *dof_func_offd, + HYPRE_Complex *row_sums ); + +__global__ void hypreGPUKernel_generate_Pdiag_i_Poffd_i( hypre_DeviceItem &item, + HYPRE_Int num_points, + HYPRE_Int color, + HYPRE_Int *pass_order, HYPRE_Int *pass_marker, HYPRE_Int *pass_marker_offd, HYPRE_Int *S_diag_i, + HYPRE_Int *S_diag_j, HYPRE_Int *S_offd_i, HYPRE_Int *S_offd_j, HYPRE_Int *P_diag_i, + HYPRE_Int *P_offd_i ); + +__global__ void hypreGPUKernel_generate_Pdiag_j_Poffd_j( hypre_DeviceItem &item, + HYPRE_Int num_points, + HYPRE_Int color, + HYPRE_Int *pass_order, HYPRE_Int *pass_marker, HYPRE_Int *pass_marker_offd, + HYPRE_Int *fine_to_coarse, HYPRE_Int *fine_to_coarse_offd, HYPRE_Int *A_diag_i, HYPRE_Int *A_diag_j, + HYPRE_Complex *A_diag_data, HYPRE_Int *A_offd_i, HYPRE_Int *A_offd_j, HYPRE_Complex *A_offd_data, + HYPRE_Int *Soc_diag_j, HYPRE_Int *Soc_offd_j, HYPRE_Int *P_diag_i, HYPRE_Int *P_offd_i, + HYPRE_Int *P_diag_j, HYPRE_Complex *P_diag_data, HYPRE_Int *P_offd_j, HYPRE_Complex *P_offd_data, + HYPRE_Complex *row_sums ); + +__global__ void hypreGPUKernel_insert_remaining_weights( hypre_DeviceItem &item, HYPRE_Int start, + HYPRE_Int stop, + HYPRE_Int *pass_order, HYPRE_Int *Pi_diag_i, HYPRE_Int *Pi_diag_j, HYPRE_Real *Pi_diag_data, + HYPRE_Int *P_diag_i, HYPRE_Int *P_diag_j, HYPRE_Real *P_diag_data, HYPRE_Int *Pi_offd_i, + HYPRE_Int *Pi_offd_j, HYPRE_Real *Pi_offd_data, HYPRE_Int *P_offd_i, HYPRE_Int *P_offd_j, + HYPRE_Real *P_offd_data ); + +__global__ void hypreGPUKernel_generate_Qdiag_j_Qoffd_j( hypre_DeviceItem &item, + HYPRE_Int num_points, + HYPRE_Int color, + HYPRE_Int *pass_order, HYPRE_Int *pass_marker, HYPRE_Int *pass_marker_offd, + HYPRE_Int *fine_to_coarse, HYPRE_Int *fine_to_coarse_offd, HYPRE_Int *A_diag_i, HYPRE_Int *A_diag_j, + HYPRE_Complex *A_diag_data, HYPRE_Int *A_offd_i, HYPRE_Int *A_offd_j, HYPRE_Complex *A_offd_data, + HYPRE_Int *Soc_diag_j, HYPRE_Int *Soc_offd_j, HYPRE_Int *Q_diag_i, HYPRE_Int *Q_offd_i, + HYPRE_Int *Q_diag_j, HYPRE_Complex *Q_diag_data, HYPRE_Int *Q_offd_j, HYPRE_Complex *Q_offd_data, + HYPRE_Complex *w_row_sum, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int *dof_func_offd ); + +__global__ void hypreGPUKernel_mutli_pi_rowsum( hypre_DeviceItem &item, HYPRE_Int num_points, + HYPRE_Int *pass_order, + HYPRE_Int *A_diag_i, HYPRE_Complex *A_diag_data, HYPRE_Int *Pi_diag_i, HYPRE_Complex *Pi_diag_data, + HYPRE_Int *Pi_offd_i, HYPRE_Complex *Pi_offd_data, HYPRE_Complex *w_row_sum ); + +__global__ void hypreGPUKernel_pass_order_count( hypre_DeviceItem &item, HYPRE_Int num_points, + HYPRE_Int color, + HYPRE_Int *points_left, HYPRE_Int *pass_marker, HYPRE_Int *pass_marker_offd, HYPRE_Int *S_diag_i, + HYPRE_Int *S_diag_j, HYPRE_Int *S_offd_i, HYPRE_Int *S_offd_j, HYPRE_Int *diag_shifts ); + +__global__ void hypreGPUKernel_populate_big_P_offd_j( hypre_DeviceItem &item, HYPRE_Int start, + HYPRE_Int stop, + HYPRE_Int *pass_order, HYPRE_Int *P_offd_i, HYPRE_Int *P_offd_j, HYPRE_BigInt *col_map_offd_Pi, + HYPRE_BigInt *big_P_offd_j ); + +/*-------------------------------------------------------------------------- + * hypre_ParAMGBuildModMultipass + * This routine implements Stuben's direct interpolation with multiple passes. + * expressed with matrix matrix multiplications + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGBuildModMultipassDevice( hypre_ParCSRMatrix *A, + HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, + HYPRE_BigInt *num_cpts_global, + HYPRE_Real trunc_factor, + HYPRE_Int P_max_elmts, + HYPRE_Int interp_type, + HYPRE_Int num_functions, + HYPRE_Int *dof_func, + hypre_ParCSRMatrix **P_ptr ) +{ +#ifdef HYPRE_PROFILE + hypre_profile_times[HYPRE_TIMER_ID_MULTIPASS_INTERP] -= hypre_MPI_Wtime(); +#endif + + hypre_assert( hypre_ParCSRMatrixMemoryLocation(A) == HYPRE_MEMORY_DEVICE ); + hypre_assert( hypre_ParCSRMatrixMemoryLocation(S) == HYPRE_MEMORY_DEVICE ); + + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); + hypre_ParCSRCommHandle *comm_handle; + + HYPRE_Int n_fine = hypre_ParCSRMatrixNumRows(A); + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + HYPRE_Real *A_diag_data = hypre_CSRMatrixData(A_diag); + HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); + HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); + HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); + HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); + HYPRE_Real *A_offd_data = hypre_CSRMatrixData(A_offd); + HYPRE_Int num_cols_offd_A = hypre_CSRMatrixNumCols(A_offd); + + hypre_CSRMatrix *S_diag = hypre_ParCSRMatrixDiag(S); + HYPRE_Int *S_diag_i = hypre_CSRMatrixI(S_diag); + HYPRE_Int *S_diag_j = hypre_CSRMatrixJ(S_diag); + hypre_CSRMatrix *S_offd = hypre_ParCSRMatrixOffd(S); + HYPRE_Int *S_offd_i = hypre_CSRMatrixI(S_offd); + HYPRE_Int *S_offd_j = hypre_CSRMatrixJ(S_offd); + + hypre_ParCSRMatrix **Pi; + hypre_ParCSRMatrix *P; + hypre_CSRMatrix *P_diag; + HYPRE_Real *P_diag_data; + HYPRE_Int *P_diag_i; + HYPRE_Int *P_diag_j; + hypre_CSRMatrix *P_offd; + HYPRE_Real *P_offd_data = NULL; + HYPRE_Int *P_offd_i; + HYPRE_Int *P_offd_j = NULL; + HYPRE_BigInt *col_map_offd_P = NULL; + HYPRE_BigInt *col_map_offd_P_host = NULL; + HYPRE_Int num_cols_offd_P = 0; + HYPRE_Int num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); + HYPRE_Int num_elem_send = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends); + HYPRE_Int *int_buf_data = NULL; + HYPRE_Int P_diag_size = 0, P_offd_size = 0; + + HYPRE_Int *pass_starts; + HYPRE_Int *fine_to_coarse; + HYPRE_Int *points_left; + HYPRE_Int *pass_marker; + HYPRE_Int *pass_marker_offd = NULL; + HYPRE_Int *pass_order; + + HYPRE_Int i; + HYPRE_Int num_passes, p, remaining; + HYPRE_Int pass_starts_p1, pass_starts_p2; + HYPRE_BigInt remaining_big; /* tmp variable for reducing global_remaining */ + HYPRE_BigInt global_remaining; + HYPRE_Int cnt, cnt_old, cnt_rem, current_pass; + + HYPRE_BigInt total_global_cpts; + HYPRE_Int my_id, num_procs; + + HYPRE_Int *dof_func_offd = NULL; + HYPRE_Real *row_sums = NULL; + + hypre_GpuProfilingPushRange("Section1"); + + /* MPI size and rank*/ + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); + + if (num_procs > 1) + { + if (my_id == num_procs - 1) + { + total_global_cpts = num_cpts_global[1]; + } + hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); + } + else + { + total_global_cpts = num_cpts_global[1]; + } + + if (!total_global_cpts) + { + *P_ptr = NULL; + return hypre_error_flag; + } + + hypre_BoomerAMGMakeSocFromSDevice(A, S); + + /* Generate pass marker array */ + /* contains pass numbers for each variable according to original order */ + pass_marker = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_DEVICE); + /* contains row numbers according to new order, pass 1 followed by pass 2 etc */ + pass_order = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_DEVICE); + /* F2C mapping */ + /* reverse of pass_order, keeps track where original numbers go */ + fine_to_coarse = hypre_TAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_DEVICE); + /* contains row numbers of remaining points, auxiliary */ + points_left = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_DEVICE); + P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, HYPRE_MEMORY_DEVICE); + P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, HYPRE_MEMORY_DEVICE); + +#if defined(HYPRE_USING_SYCL) + /* Fpts; number of F pts */ + oneapi::dpl::counting_iterator count(0); + HYPRE_Int *points_end = hypreSycl_copy_if( count, + count + n_fine, + CF_marker, + points_left, + [] (const auto & x) {return x != 1;} ); + remaining = points_end - points_left; + + /* Cpts; number of C pts */ + HYPRE_Int *pass_end = hypreSycl_copy_if( count, + count + n_fine, + CF_marker, + pass_order, + equal(1) ); + + P_diag_size = cnt = pass_end - pass_order; + + /* mark C points pass-1; row nnz of C-diag = 1, C-offd = 0 */ + auto zip0 = oneapi::dpl::make_zip_iterator( pass_marker, P_diag_i, P_offd_i ); + hypreSycl_transform_if( zip0, + zip0 + n_fine, + CF_marker, + zip0, + [] (const auto & x) {return std::make_tuple(HYPRE_Int(1), HYPRE_Int(1), HYPRE_Int(0));}, + equal(1) ); + + HYPRE_ONEDPL_CALL( std::exclusive_scan, + oneapi::dpl::make_transform_iterator(CF_marker, equal(1)), + oneapi::dpl::make_transform_iterator(CF_marker + n_fine, equal(1)), + fine_to_coarse, + HYPRE_Int(0) ); +#else + /* Fpts; number of F pts */ + HYPRE_Int *points_end = HYPRE_THRUST_CALL( copy_if, + thrust::make_counting_iterator(0), + thrust::make_counting_iterator(n_fine), + CF_marker, + points_left, + HYPRE_THRUST_NOT(equal(1)) ); + remaining = points_end - points_left; + + /* Cpts; number of C pts */ + HYPRE_Int *pass_end = HYPRE_THRUST_CALL( copy_if, + thrust::make_counting_iterator(0), + thrust::make_counting_iterator(n_fine), + CF_marker, + pass_order, + equal(1) ); + + P_diag_size = cnt = pass_end - pass_order; + + /* mark C points pass-1; row nnz of C-diag = 1, C-offd = 0 */ + HYPRE_THRUST_CALL( replace_if, + thrust::make_zip_iterator( thrust::make_tuple(pass_marker, P_diag_i, P_offd_i) ), + thrust::make_zip_iterator( thrust::make_tuple(pass_marker, P_diag_i, P_offd_i) ) + n_fine, + CF_marker, + equal(1), + thrust::make_tuple(HYPRE_Int(1), HYPRE_Int(1), HYPRE_Int(0)) ); + + HYPRE_THRUST_CALL( exclusive_scan, + thrust::make_transform_iterator(CF_marker, equal(1)), + thrust::make_transform_iterator(CF_marker + n_fine, equal(1)), + fine_to_coarse, + HYPRE_Int(0) ); +#endif + + /* contains beginning for each pass in pass_order field, assume no more than 10 passes */ + pass_starts = hypre_CTAlloc(HYPRE_Int, 11, HYPRE_MEMORY_HOST); + /* first pass is C */ + pass_starts[0] = 0; + pass_starts[1] = cnt; + + /* communicate dof_func */ + if (num_procs > 1 && num_functions > 1) + { + int_buf_data = hypre_TAlloc(HYPRE_Int, num_elem_send, HYPRE_MEMORY_DEVICE); + + hypre_ParCSRCommPkgCopySendMapElmtsToDevice(comm_pkg); +#if defined(HYPRE_USING_SYCL) + hypreSycl_gather( hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + num_elem_send, + dof_func, + int_buf_data ); +#else + HYPRE_THRUST_CALL( gather, + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + num_elem_send, + dof_func, + int_buf_data ); +#endif + +#if defined(HYPRE_USING_THRUST_NOSYNC) + /* RL: make sure int_buf_data is ready before issuing GPU-GPU MPI */ + if (hypre_GetGpuAwareMPI()) + { + hypre_ForceSyncComputeStream(); + } +#endif + + dof_func_offd = hypre_TAlloc(HYPRE_Int, num_cols_offd_A, HYPRE_MEMORY_DEVICE); + + comm_handle = hypre_ParCSRCommHandleCreate_v2(11, comm_pkg, HYPRE_MEMORY_DEVICE, int_buf_data, + HYPRE_MEMORY_DEVICE, dof_func_offd); + hypre_ParCSRCommHandleDestroy(comm_handle); + } + + /* communicate pass_marker */ + if (num_procs > 1) + { + if (!int_buf_data) + { + int_buf_data = hypre_CTAlloc(HYPRE_Int, num_elem_send, HYPRE_MEMORY_DEVICE); + } + + hypre_ParCSRCommPkgCopySendMapElmtsToDevice(comm_pkg); + +#if defined(HYPRE_USING_SYCL) + hypreSycl_gather( hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + num_elem_send, + pass_marker, + int_buf_data ); +#else + HYPRE_THRUST_CALL( gather, + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + num_elem_send, + pass_marker, + int_buf_data ); +#endif + +#if defined(HYPRE_USING_THRUST_NOSYNC) + /* RL: make sure int_buf_data is ready before issuing GPU-GPU MPI */ + if (hypre_GetGpuAwareMPI()) + { + hypre_ForceSyncComputeStream(); + } +#endif + + /* allocate one more see comments in hypre_modmp_compute_num_cols_offd_fine_to_coarse */ + pass_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_offd_A + 1, HYPRE_MEMORY_DEVICE); + + /* create a handle to start communication. 11: for integer */ + comm_handle = hypre_ParCSRCommHandleCreate_v2(11, comm_pkg, HYPRE_MEMORY_DEVICE, int_buf_data, + HYPRE_MEMORY_DEVICE, pass_marker_offd); + + /* destroy the handle to finish communication */ + hypre_ParCSRCommHandleDestroy(comm_handle); + } + + current_pass = 1; + num_passes = 1; + /* color points according to pass number */ + remaining_big = remaining; + hypre_MPI_Allreduce(&remaining_big, &global_remaining, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); + + hypre_GpuProfilingPopRange(); + + hypre_GpuProfilingPushRange("Section2"); + + HYPRE_Int *points_left_old = hypre_TAlloc(HYPRE_Int, remaining, HYPRE_MEMORY_DEVICE); + HYPRE_Int *diag_shifts = hypre_TAlloc(HYPRE_Int, remaining, HYPRE_MEMORY_DEVICE); + + while (global_remaining > 0) + { + cnt_rem = 0; + cnt_old = cnt; + + { + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(remaining, "warp", bDim); + + /* output diag_shifts is 0/1 indicating if points_left_dev[i] is picked in this pass */ + HYPRE_GPU_LAUNCH( hypreGPUKernel_pass_order_count, + gDim, bDim, + remaining, + current_pass, + points_left, + pass_marker, + pass_marker_offd, + S_diag_i, + S_diag_j, + S_offd_i, + S_offd_j, + diag_shifts ); + +#if defined(HYPRE_USING_SYCL) + cnt = HYPRE_ONEDPL_CALL( std::reduce, + diag_shifts, + diag_shifts + remaining, + cnt_old, + std::plus() ); + + cnt_rem = remaining - (cnt - cnt_old); + + auto perm0 = oneapi::dpl::make_permutation_iterator(pass_marker, points_left); + hypreSycl_transform_if( perm0, + perm0 + remaining, + diag_shifts, + perm0, + [current_pass = current_pass] (const auto & x) {return current_pass + 1;}, + [] (const auto & x) {return x;} ); + + hypre_TMemcpy(points_left_old, points_left, HYPRE_Int, remaining, HYPRE_MEMORY_DEVICE, + HYPRE_MEMORY_DEVICE); + + HYPRE_Int *new_end; + new_end = hypreSycl_copy_if( points_left_old, + points_left_old + remaining, + diag_shifts, + pass_order + cnt_old, + [] (const auto & x) {return x;} ); + + hypre_assert(new_end - pass_order == cnt); + + new_end = hypreSycl_copy_if( points_left_old, + points_left_old + remaining, + diag_shifts, + points_left, + [] (const auto & x) {return !x;} ); +#else + cnt = HYPRE_THRUST_CALL( reduce, + diag_shifts, + diag_shifts + remaining, + cnt_old, + thrust::plus() ); + + cnt_rem = remaining - (cnt - cnt_old); + + HYPRE_THRUST_CALL( replace_if, + thrust::make_permutation_iterator(pass_marker, points_left), + thrust::make_permutation_iterator(pass_marker, points_left + remaining), + diag_shifts, + thrust::identity(), + current_pass + 1 ); + + hypre_TMemcpy(points_left_old, points_left, HYPRE_Int, remaining, HYPRE_MEMORY_DEVICE, + HYPRE_MEMORY_DEVICE); + + HYPRE_Int *new_end; + new_end = HYPRE_THRUST_CALL( copy_if, + points_left_old, + points_left_old + remaining, + diag_shifts, + pass_order + cnt_old, + thrust::identity() ); + + hypre_assert(new_end - pass_order == cnt); + + new_end = HYPRE_THRUST_CALL( copy_if, + points_left_old, + points_left_old + remaining, + diag_shifts, + points_left, + HYPRE_THRUST_NOT(thrust::identity()) ); +#endif + + hypre_assert(new_end - points_left == cnt_rem); + } + + remaining = cnt_rem; + current_pass++; + num_passes++; + + if (num_passes > 9) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, " Warning!!! too many passes! out of range!\n"); + break; + } + + pass_starts[num_passes] = cnt; + + /* update pass_marker_offd */ + if (num_procs > 1) + { +#if defined(HYPRE_USING_SYCL) + hypreSycl_gather( hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + num_elem_send, + pass_marker, + int_buf_data ); +#else + HYPRE_THRUST_CALL( gather, + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + num_elem_send, + pass_marker, + int_buf_data ); +#endif + +#if defined(HYPRE_USING_THRUST_NOSYNC) + /* RL: make sure int_buf_data is ready before issuing GPU-GPU MPI */ + if (hypre_GetGpuAwareMPI()) + { + hypre_ForceSyncComputeStream(); + } +#endif + + /* create a handle to start communication. 11: for integer */ + comm_handle = hypre_ParCSRCommHandleCreate_v2(11, comm_pkg, HYPRE_MEMORY_DEVICE, int_buf_data, + HYPRE_MEMORY_DEVICE, pass_marker_offd); + + /* destroy the handle to finish communication */ + hypre_ParCSRCommHandleDestroy(comm_handle); + } + + HYPRE_BigInt old_global_remaining = global_remaining; + + remaining_big = remaining; + hypre_MPI_Allreduce(&remaining_big, &global_remaining, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); + + /* if the number of remaining points does not change, we have a situation of isolated areas of + * fine points that are not connected to any C-points, and the pass generation process breaks + * down. Those points can be ignored, i.e. the corresponding rows in P will just be 0 + * and can be ignored for the algorithm. */ + if (old_global_remaining == global_remaining) + { + break; + } + + } // while (global_remaining > 0) + + hypre_TFree(diag_shifts, HYPRE_MEMORY_DEVICE); + hypre_TFree(points_left_old, HYPRE_MEMORY_DEVICE); + hypre_TFree(int_buf_data, HYPRE_MEMORY_DEVICE); + hypre_TFree(points_left, HYPRE_MEMORY_DEVICE); + + /* generate row sum of weak points and C-points to be ignored */ + row_sums = hypre_CTAlloc(HYPRE_Real, n_fine, HYPRE_MEMORY_DEVICE); + + { + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(n_fine, "warp", bDim); + + HYPRE_GPU_LAUNCH( hypreGPUKernel_cfmarker_masked_rowsum, gDim, bDim, + n_fine, A_diag_i, A_diag_j, A_diag_data, + A_offd_i, A_offd_j, A_offd_data, + CF_marker, + num_functions > 1 ? dof_func : NULL, + num_functions > 1 ? dof_func_offd : NULL, + row_sums ); + } + + hypre_GpuProfilingPopRange(); + + hypre_GpuProfilingPushRange("MultipassPiDevice"); + + Pi = hypre_CTAlloc(hypre_ParCSRMatrix*, num_passes, HYPRE_MEMORY_HOST); + + hypre_GenerateMultipassPiDevice(A, S, num_cpts_global, &pass_order[pass_starts[1]], + pass_marker, pass_marker_offd, + pass_starts[2] - pass_starts[1], 1, row_sums, &Pi[0]); + + hypre_GpuProfilingPopRange(); + + if (interp_type == 8) + { + for (i = 1; i < num_passes - 1; i++) + { + hypre_GpuProfilingPushRange(std::string("MultipassPiDevice Loop" + std::to_string(i)).c_str()); + + hypre_ParCSRMatrix *Q; + HYPRE_BigInt *c_pts_starts = hypre_ParCSRMatrixRowStarts(Pi[i - 1]); + + hypre_GenerateMultipassPiDevice(A, S, c_pts_starts, &pass_order[pass_starts[i + 1]], + pass_marker, pass_marker_offd, + pass_starts[i + 2] - pass_starts[i + 1], i + 1, row_sums, &Q); + + hypre_GpuProfilingPopRange(); + Pi[i] = hypre_ParCSRMatMat(Q, Pi[i - 1]); + + hypre_ParCSRMatrixDestroy(Q); + } + } + else if (interp_type == 9) + { + for (i = 1; i < num_passes - 1; i++) + { + hypre_GpuProfilingPushRange(std::string("MultiPiDevice Loop" + std::to_string(i)).c_str()); + HYPRE_BigInt *c_pts_starts = hypre_ParCSRMatrixRowStarts(Pi[i - 1]); + + hypre_GenerateMultiPiDevice(A, S, Pi[i - 1], c_pts_starts, &pass_order[pass_starts[i + 1]], + pass_marker, pass_marker_offd, + pass_starts[i + 2] - pass_starts[i + 1], i + 1, + num_functions, dof_func, dof_func_offd, &Pi[i] ); + + hypre_GpuProfilingPopRange(); + } + } + + hypre_GpuProfilingPushRange("Section3"); + + // We don't need the row sums anymore + hypre_TFree(row_sums, HYPRE_MEMORY_DEVICE); + + /* populate P_diag_i/P_offd_i[i] with nnz of i-th row */ + for (i = 0; i < num_passes - 1; i++) + { + HYPRE_Int *Pi_diag_i = hypre_CSRMatrixI(hypre_ParCSRMatrixDiag(Pi[i])); + HYPRE_Int *Pi_offd_i = hypre_CSRMatrixI(hypre_ParCSRMatrixOffd(Pi[i])); + + HYPRE_Int start = pass_starts[i + 1]; + HYPRE_Int stop = pass_starts[i + 2]; + +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::transform, + Pi_diag_i + 1, + Pi_diag_i + stop - start + 1, + Pi_diag_i, + oneapi::dpl::make_permutation_iterator( P_diag_i, pass_order + start ), + std::minus() ); + HYPRE_ONEDPL_CALL( std::transform, + Pi_offd_i + 1, + Pi_offd_i + stop - start + 1, + Pi_offd_i, + oneapi::dpl::make_permutation_iterator( P_offd_i, pass_order + start ), + std::minus() ); +#else + HYPRE_THRUST_CALL( transform, + thrust::make_zip_iterator(thrust::make_tuple(Pi_diag_i, Pi_offd_i)) + 1, + thrust::make_zip_iterator(thrust::make_tuple(Pi_diag_i, Pi_offd_i)) + stop - start + 1, + thrust::make_zip_iterator(thrust::make_tuple(Pi_diag_i, Pi_offd_i)), + thrust::make_permutation_iterator( thrust::make_zip_iterator(thrust::make_tuple(P_diag_i, + P_offd_i)), pass_order + start ), + tuple_minus() ); +#endif + + P_diag_size += hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixDiag(Pi[i])); + P_offd_size += hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixOffd(Pi[i])); + } + +#if defined(HYPRE_USING_SYCL) + auto zip2 = oneapi::dpl::make_zip_iterator( P_diag_i, P_offd_i ); + HYPRE_ONEDPL_CALL( std::exclusive_scan, + zip2, + zip2 + n_fine + 1, + oneapi::dpl::make_zip_iterator(P_diag_i, P_offd_i), + std::make_tuple(HYPRE_Int(0), HYPRE_Int(0)), + tuple_plus() ); +#else + HYPRE_THRUST_CALL( exclusive_scan, + thrust::make_zip_iterator( thrust::make_tuple(P_diag_i, P_offd_i) ), + thrust::make_zip_iterator( thrust::make_tuple(P_diag_i, P_offd_i) ) + n_fine + 1, + thrust::make_zip_iterator( thrust::make_tuple(P_diag_i, P_offd_i) ), + thrust::make_tuple(HYPRE_Int(0), HYPRE_Int(0)), + tuple_plus() ); +#endif + +#ifdef HYPRE_DEBUG + { + HYPRE_Int tmp; + hypre_TMemcpy(&tmp, &P_diag_i[n_fine], HYPRE_Int, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); + hypre_assert(tmp == P_diag_size); + hypre_TMemcpy(&tmp, &P_offd_i[n_fine], HYPRE_Int, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); + hypre_assert(tmp == P_offd_size); + } +#endif + + P_diag_j = hypre_TAlloc(HYPRE_Int, P_diag_size, HYPRE_MEMORY_DEVICE); + P_diag_data = hypre_TAlloc(HYPRE_Real, P_diag_size, HYPRE_MEMORY_DEVICE); + P_offd_j = hypre_TAlloc(HYPRE_Int, P_offd_size, HYPRE_MEMORY_DEVICE); + P_offd_data = hypre_TAlloc(HYPRE_Real, P_offd_size, HYPRE_MEMORY_DEVICE); + + /* insert weights for coarse points */ + { +#if defined(HYPRE_USING_SYCL) + auto perm1 = oneapi::dpl::make_permutation_iterator( fine_to_coarse, pass_order ); + hypreSycl_scatter( perm1, + perm1 + pass_starts[1], + oneapi::dpl::make_permutation_iterator( P_diag_i, pass_order ), + P_diag_j ); + + auto perm2 = oneapi::dpl::make_permutation_iterator( P_diag_i, pass_order ); + auto perm3 = oneapi::dpl::make_permutation_iterator( P_diag_data, perm2 ); + HYPRE_ONEDPL_CALL( std::transform, + perm3, + perm3 + pass_starts[1], + perm3, + [] (const auto & x) {return 1.0;} ); +#else + HYPRE_THRUST_CALL( scatter, + thrust::make_permutation_iterator( fine_to_coarse, pass_order ), + thrust::make_permutation_iterator( fine_to_coarse, pass_order ) + pass_starts[1], + thrust::make_permutation_iterator( P_diag_i, pass_order ), + P_diag_j ); + + HYPRE_THRUST_CALL( scatter, + thrust::make_constant_iterator(1.0), + thrust::make_constant_iterator(1.0) + pass_starts[1], + thrust::make_permutation_iterator( P_diag_i, pass_order ), + P_diag_data ); +#endif + } + + /* generate col_map_offd_P by combining all col_map_offd_Pi + * and reompute indices if needed */ + + /* insert remaining weights */ + for (p = 0; p < num_passes - 1; p++) + { + HYPRE_Int *Pi_diag_i = hypre_CSRMatrixI(hypre_ParCSRMatrixDiag(Pi[p])); + HYPRE_Int *Pi_offd_i = hypre_CSRMatrixI(hypre_ParCSRMatrixOffd(Pi[p])); + HYPRE_Int *Pi_diag_j = hypre_CSRMatrixJ(hypre_ParCSRMatrixDiag(Pi[p])); + HYPRE_Int *Pi_offd_j = hypre_CSRMatrixJ(hypre_ParCSRMatrixOffd(Pi[p])); + HYPRE_Real *Pi_diag_data = hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(Pi[p])); + HYPRE_Real *Pi_offd_data = hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(Pi[p])); + + HYPRE_Int num_points = pass_starts[p + 2] - pass_starts[p + 1]; + + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(num_points, "warp", bDim); + + pass_starts_p1 = pass_starts[p + 1]; + pass_starts_p2 = pass_starts[p + 2]; + HYPRE_GPU_LAUNCH( hypreGPUKernel_insert_remaining_weights, gDim, bDim, + pass_starts_p1, pass_starts_p2, pass_order, + Pi_diag_i, Pi_diag_j, Pi_diag_data, + P_diag_i, P_diag_j, P_diag_data, + Pi_offd_i, Pi_offd_j, Pi_offd_data, + P_offd_i, P_offd_j, P_offd_data ); + } + + /* Note that col indices in P_offd_j probably not consistent, + this gets fixed after truncation */ + P = hypre_ParCSRMatrixCreate(comm, + hypre_ParCSRMatrixGlobalNumRows(A), + total_global_cpts, + hypre_ParCSRMatrixRowStarts(A), + num_cpts_global, + num_cols_offd_P, + P_diag_size, + P_offd_size); + + P_diag = hypre_ParCSRMatrixDiag(P); + hypre_CSRMatrixData(P_diag) = P_diag_data; + hypre_CSRMatrixI(P_diag) = P_diag_i; + hypre_CSRMatrixJ(P_diag) = P_diag_j; + + P_offd = hypre_ParCSRMatrixOffd(P); + hypre_CSRMatrixData(P_offd) = P_offd_data; + hypre_CSRMatrixI(P_offd) = P_offd_i; + hypre_CSRMatrixJ(P_offd) = P_offd_j; + + /* Compress P, removing coefficients smaller than trunc_factor * Max */ + if (trunc_factor != 0.0 || P_max_elmts > 0) + { + hypre_BoomerAMGInterpTruncationDevice(P, trunc_factor, P_max_elmts); + P_diag_data = hypre_CSRMatrixData(P_diag); + P_diag_i = hypre_CSRMatrixI(P_diag); + P_diag_j = hypre_CSRMatrixJ(P_diag); + P_offd_data = hypre_CSRMatrixData(P_offd); + P_offd_i = hypre_CSRMatrixI(P_offd); + P_offd_j = hypre_CSRMatrixJ(P_offd); + P_offd_size = hypre_CSRMatrixNumNonzeros(P_offd); + } + + hypre_GpuProfilingPopRange(); + + num_cols_offd_P = 0; + + if (P_offd_size) + { + hypre_GpuProfilingPushRange("Section4"); + + HYPRE_BigInt *big_P_offd_j = hypre_TAlloc(HYPRE_BigInt, P_offd_size, HYPRE_MEMORY_DEVICE); + + for (p = 0; p < num_passes - 1; p++) + { + HYPRE_BigInt *col_map_offd_Pi = hypre_ParCSRMatrixDeviceColMapOffd(Pi[p]); + + HYPRE_Int npoints = pass_starts[p + 2] - pass_starts[p + 1]; + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(npoints, "warp", bDim); + + pass_starts_p1 = pass_starts[p + 1]; + pass_starts_p2 = pass_starts[p + 2]; + HYPRE_GPU_LAUNCH( hypreGPUKernel_populate_big_P_offd_j, gDim, bDim, + pass_starts_p1, + pass_starts_p2, + pass_order, + P_offd_i, + P_offd_j, + col_map_offd_Pi, + big_P_offd_j ); + + } // end num_passes for loop + + HYPRE_BigInt *tmp_P_offd_j = hypre_TAlloc(HYPRE_BigInt, P_offd_size, HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(tmp_P_offd_j, big_P_offd_j, HYPRE_BigInt, P_offd_size, HYPRE_MEMORY_DEVICE, + HYPRE_MEMORY_DEVICE); + +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::sort, + tmp_P_offd_j, + tmp_P_offd_j + P_offd_size ); + + HYPRE_BigInt *new_end = HYPRE_ONEDPL_CALL( std::unique, + tmp_P_offd_j, + tmp_P_offd_j + P_offd_size ); +#else + HYPRE_THRUST_CALL( sort, + tmp_P_offd_j, + tmp_P_offd_j + P_offd_size ); + + HYPRE_BigInt *new_end = HYPRE_THRUST_CALL( unique, + tmp_P_offd_j, + tmp_P_offd_j + P_offd_size ); +#endif + + num_cols_offd_P = new_end - tmp_P_offd_j; + col_map_offd_P = hypre_TAlloc(HYPRE_BigInt, num_cols_offd_P, HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(col_map_offd_P, tmp_P_offd_j, HYPRE_BigInt, num_cols_offd_P, HYPRE_MEMORY_DEVICE, + HYPRE_MEMORY_DEVICE); + hypre_TFree(tmp_P_offd_j, HYPRE_MEMORY_DEVICE); + + // PB: It seems we still need this on the host?? + col_map_offd_P_host = hypre_TAlloc(HYPRE_BigInt, num_cols_offd_P, HYPRE_MEMORY_HOST); + hypre_TMemcpy(col_map_offd_P_host, col_map_offd_P, HYPRE_BigInt, num_cols_offd_P, HYPRE_MEMORY_HOST, + HYPRE_MEMORY_DEVICE); + +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( oneapi::dpl::lower_bound, + col_map_offd_P, + col_map_offd_P + num_cols_offd_P, + big_P_offd_j, + big_P_offd_j + P_offd_size, + P_offd_j ); +#else + HYPRE_THRUST_CALL( lower_bound, + col_map_offd_P, + col_map_offd_P + num_cols_offd_P, + big_P_offd_j, + big_P_offd_j + P_offd_size, + P_offd_j ); +#endif + + hypre_TFree(big_P_offd_j, HYPRE_MEMORY_DEVICE); + + hypre_GpuProfilingPopRange(); + } // if (P_offd_size) + + hypre_GpuProfilingPushRange("Section5"); + + hypre_ParCSRMatrixColMapOffd(P) = col_map_offd_P_host; + hypre_ParCSRMatrixDeviceColMapOffd(P) = col_map_offd_P; + hypre_CSRMatrixNumCols(P_offd) = num_cols_offd_P; + + hypre_CSRMatrixMemoryLocation(P_diag) = HYPRE_MEMORY_DEVICE; + hypre_CSRMatrixMemoryLocation(P_offd) = HYPRE_MEMORY_DEVICE; + + hypre_MatvecCommPkgCreate(P); + + for (i = 0; i < num_passes - 1; i++) + { + hypre_ParCSRMatrixDestroy(Pi[i]); + } + + hypre_TFree(Pi, HYPRE_MEMORY_HOST); + hypre_TFree(dof_func_offd, HYPRE_MEMORY_DEVICE); + hypre_TFree(pass_starts, HYPRE_MEMORY_HOST); + hypre_TFree(pass_marker, HYPRE_MEMORY_DEVICE); + hypre_TFree(pass_marker_offd, HYPRE_MEMORY_DEVICE); + hypre_TFree(pass_order, HYPRE_MEMORY_DEVICE); + hypre_TFree(fine_to_coarse, HYPRE_MEMORY_DEVICE); + +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::replace_if, + CF_marker, + CF_marker + n_fine, + equal(-3), + static_cast(-1) ); +#else + HYPRE_THRUST_CALL( replace_if, + CF_marker, + CF_marker + n_fine, + equal(-3), + static_cast(-1) ); +#endif + + *P_ptr = P; + + hypre_GpuProfilingPopRange(); + + return hypre_error_flag; +} + +HYPRE_Int +hypre_GenerateMultipassPiDevice( hypre_ParCSRMatrix *A, + hypre_ParCSRMatrix *S, + HYPRE_BigInt *c_pts_starts, + HYPRE_Int *pass_order, + HYPRE_Int *pass_marker, + HYPRE_Int *pass_marker_offd, + HYPRE_Int num_points, /* |F| */ + HYPRE_Int color, /* C-color */ + HYPRE_Real *row_sums, + hypre_ParCSRMatrix **P_ptr) +{ + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); + hypre_ParCSRCommHandle *comm_handle; + + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + HYPRE_Real *A_diag_data = hypre_CSRMatrixData(A_diag); + HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); + HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); + HYPRE_Int n_fine = hypre_CSRMatrixNumRows(A_diag); + + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); + HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); + HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); + HYPRE_Real *A_offd_data = hypre_CSRMatrixData(A_offd); + HYPRE_Int num_cols_offd_A = hypre_CSRMatrixNumCols(A_offd); + + hypre_CSRMatrix *S_diag = hypre_ParCSRMatrixDiag(S); + HYPRE_Int *S_diag_i = hypre_CSRMatrixI(S_diag); + HYPRE_Int *S_diag_j = hypre_CSRMatrixJ(S_diag); + + hypre_CSRMatrix *S_offd = hypre_ParCSRMatrixOffd(S); + HYPRE_Int *S_offd_i = hypre_CSRMatrixI(S_offd); + HYPRE_Int *S_offd_j = hypre_CSRMatrixJ(S_offd); + + HYPRE_Int *Soc_diag_j = hypre_ParCSRMatrixSocDiagJ(S); + HYPRE_Int *Soc_offd_j = hypre_ParCSRMatrixSocOffdJ(S); + + HYPRE_BigInt *col_map_offd_P = NULL; + HYPRE_BigInt *col_map_offd_P_dev = NULL; + HYPRE_Int num_cols_offd_P; + HYPRE_Int nnz_diag, nnz_offd; + + hypre_ParCSRMatrix *P; + hypre_CSRMatrix *P_diag; + HYPRE_Real *P_diag_data; + HYPRE_Int *P_diag_i; /*at first counter of nonzero cols for each row, + finally will be pointer to start of row */ + HYPRE_Int *P_diag_j; + hypre_CSRMatrix *P_offd; + HYPRE_Real *P_offd_data = NULL; + HYPRE_Int *P_offd_i; /*at first counter of nonzero cols for each row, + finally will be pointer to start of row */ + HYPRE_Int *P_offd_j = NULL; + + HYPRE_Int *fine_to_coarse; + HYPRE_Int *fine_to_coarse_offd = NULL; + HYPRE_BigInt f_pts_starts[2]; + HYPRE_Int my_id, num_procs; + HYPRE_BigInt total_global_fpts; + HYPRE_BigInt total_global_cpts; + HYPRE_BigInt *big_convert_offd = NULL; + HYPRE_BigInt *big_buf_data = NULL; + + /* MPI size and rank*/ + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); + + fine_to_coarse = hypre_TAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_DEVICE); + + hypre_modmp_init_fine_to_coarse(n_fine, pass_marker, color, fine_to_coarse); + + if (num_procs > 1) + { + HYPRE_BigInt big_Fpts = num_points; + + hypre_MPI_Scan(&big_Fpts, f_pts_starts + 1, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); + + f_pts_starts[0] = f_pts_starts[1] - big_Fpts; + + if (my_id == num_procs - 1) + { + total_global_fpts = f_pts_starts[1]; + total_global_cpts = c_pts_starts[1]; + } + hypre_MPI_Bcast(&total_global_fpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); + hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); + } + else + { + f_pts_starts[0] = 0; + f_pts_starts[1] = num_points; + total_global_fpts = f_pts_starts[1]; + total_global_cpts = c_pts_starts[1]; + } + + num_cols_offd_P = 0; + + if (num_procs > 1) + { + HYPRE_Int num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); + HYPRE_Int num_elem_send = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends); + + big_convert_offd = hypre_TAlloc(HYPRE_BigInt, num_cols_offd_A, HYPRE_MEMORY_DEVICE); + big_buf_data = hypre_TAlloc(HYPRE_BigInt, num_elem_send, HYPRE_MEMORY_DEVICE); + + globalC_functor functor(c_pts_starts[0]); + +#if defined(HYPRE_USING_SYCL) + hypreSycl_gather( hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + num_elem_send, + oneapi::dpl::make_transform_iterator(fine_to_coarse, functor), + big_buf_data ); +#else + HYPRE_THRUST_CALL( gather, + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + num_elem_send, + thrust::make_transform_iterator(fine_to_coarse, functor), + big_buf_data ); +#endif + +#if defined(HYPRE_USING_THRUST_NOSYNC) + /* RL: make sure big_buf_data is ready before issuing GPU-GPU MPI */ + if (hypre_GetGpuAwareMPI()) + { + hypre_ForceSyncComputeStream(); + } +#endif + + comm_handle = hypre_ParCSRCommHandleCreate_v2(21, comm_pkg, HYPRE_MEMORY_DEVICE, big_buf_data, + HYPRE_MEMORY_DEVICE, big_convert_offd); + + hypre_ParCSRCommHandleDestroy(comm_handle); + + // This will allocate fine_to_coarse_offd + hypre_modmp_compute_num_cols_offd_fine_to_coarse( pass_marker_offd, color, num_cols_offd_A, + num_cols_offd_P, &fine_to_coarse_offd ); + + //FIXME: Clean this up when we don't need the host pointer anymore + col_map_offd_P = hypre_TAlloc(HYPRE_BigInt, num_cols_offd_P, HYPRE_MEMORY_HOST); + col_map_offd_P_dev = hypre_TAlloc(HYPRE_BigInt, num_cols_offd_P, HYPRE_MEMORY_DEVICE); + +#if defined(HYPRE_USING_SYCL) + HYPRE_BigInt *col_map_end = hypreSycl_copy_if( big_convert_offd, + big_convert_offd + num_cols_offd_A, + pass_marker_offd, + col_map_offd_P_dev, + equal(color) ); +#else + HYPRE_BigInt *col_map_end = HYPRE_THRUST_CALL( copy_if, + big_convert_offd, + big_convert_offd + num_cols_offd_A, + pass_marker_offd, + col_map_offd_P_dev, + equal(color) ); +#endif + + hypre_assert(num_cols_offd_P == col_map_end - col_map_offd_P_dev); + + //FIXME: Clean this up when we don't need the host pointer anymore + hypre_TMemcpy(col_map_offd_P, col_map_offd_P_dev, HYPRE_BigInt, num_cols_offd_P, HYPRE_MEMORY_HOST, + HYPRE_MEMORY_DEVICE); + + hypre_TFree(big_convert_offd, HYPRE_MEMORY_DEVICE); + hypre_TFree(big_buf_data, HYPRE_MEMORY_DEVICE); + } + + P_diag_i = hypre_TAlloc(HYPRE_Int, num_points + 1, HYPRE_MEMORY_DEVICE); + P_offd_i = hypre_TAlloc(HYPRE_Int, num_points + 1, HYPRE_MEMORY_DEVICE); + + /* generate P_diag_i and P_offd_i */ + { + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(num_points, "warp", bDim); + + HYPRE_GPU_LAUNCH( hypreGPUKernel_generate_Pdiag_i_Poffd_i, gDim, bDim, + num_points, color, pass_order, pass_marker, pass_marker_offd, + S_diag_i, S_diag_j, S_offd_i, S_offd_j, + P_diag_i, P_offd_i ); + + hypre_Memset(P_diag_i + num_points, 0, sizeof(HYPRE_Int), HYPRE_MEMORY_DEVICE); + hypre_Memset(P_offd_i + num_points, 0, sizeof(HYPRE_Int), HYPRE_MEMORY_DEVICE); + +#if defined(HYPRE_USING_SYCL) + auto zip3 = oneapi::dpl::make_zip_iterator( P_diag_i, P_offd_i ); + HYPRE_ONEDPL_CALL( std::exclusive_scan, + zip3, + zip3 + num_points + 1, + oneapi::dpl::make_zip_iterator( P_diag_i, P_offd_i ), + std::make_tuple(HYPRE_Int(0), HYPRE_Int(0)), + tuple_plus() ); +#else + HYPRE_THRUST_CALL( exclusive_scan, + thrust::make_zip_iterator( thrust::make_tuple(P_diag_i, P_offd_i) ), + thrust::make_zip_iterator( thrust::make_tuple(P_diag_i, P_offd_i) ) + num_points + 1, + thrust::make_zip_iterator( thrust::make_tuple(P_diag_i, P_offd_i) ), + thrust::make_tuple(HYPRE_Int(0), HYPRE_Int(0)), + tuple_plus() ); +#endif + + hypre_TMemcpy(&nnz_diag, &P_diag_i[num_points], HYPRE_Int, 1, HYPRE_MEMORY_HOST, + HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(&nnz_offd, &P_offd_i[num_points], HYPRE_Int, 1, HYPRE_MEMORY_HOST, + HYPRE_MEMORY_DEVICE); + } + + /* generate P_diag_j/data and P_offd_j/data */ + P_diag_j = hypre_TAlloc(HYPRE_Int, nnz_diag, HYPRE_MEMORY_DEVICE); + P_diag_data = hypre_TAlloc(HYPRE_Real, nnz_diag, HYPRE_MEMORY_DEVICE); + P_offd_j = hypre_TAlloc(HYPRE_Int, nnz_offd, HYPRE_MEMORY_DEVICE); + P_offd_data = hypre_TAlloc(HYPRE_Real, nnz_offd, HYPRE_MEMORY_DEVICE); + + { + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(num_points, "warp", bDim); + + HYPRE_GPU_LAUNCH( hypreGPUKernel_generate_Pdiag_j_Poffd_j, gDim, bDim, + num_points, + color, + pass_order, + pass_marker, + pass_marker_offd, + fine_to_coarse, + fine_to_coarse_offd, + A_diag_i, + A_diag_j, + A_diag_data, + A_offd_i, + A_offd_j, + A_offd_data, + Soc_diag_j, + Soc_offd_j, + P_diag_i, + P_offd_i, + P_diag_j, + P_diag_data, + P_offd_j, + P_offd_data, + row_sums ); + } + + hypre_TFree(fine_to_coarse, HYPRE_MEMORY_DEVICE); + hypre_TFree(fine_to_coarse_offd, HYPRE_MEMORY_DEVICE); + + P = hypre_ParCSRMatrixCreate(comm, + total_global_fpts, + total_global_cpts, + f_pts_starts, + c_pts_starts, + num_cols_offd_P, + nnz_diag, + nnz_offd); + + P_diag = hypre_ParCSRMatrixDiag(P); + hypre_CSRMatrixData(P_diag) = P_diag_data; + hypre_CSRMatrixI(P_diag) = P_diag_i; + hypre_CSRMatrixJ(P_diag) = P_diag_j; + + P_offd = hypre_ParCSRMatrixOffd(P); + hypre_CSRMatrixData(P_offd) = P_offd_data; + hypre_CSRMatrixI(P_offd) = P_offd_i; + hypre_CSRMatrixJ(P_offd) = P_offd_j; + + hypre_ParCSRMatrixColMapOffd(P) = col_map_offd_P; + hypre_ParCSRMatrixDeviceColMapOffd(P) = col_map_offd_P_dev; + + hypre_CSRMatrixMemoryLocation(P_diag) = HYPRE_MEMORY_DEVICE; + hypre_CSRMatrixMemoryLocation(P_offd) = HYPRE_MEMORY_DEVICE; + + hypre_MatvecCommPkgCreate(P); + + *P_ptr = P; + + return hypre_error_flag; +} + +HYPRE_Int +hypre_GenerateMultiPiDevice( hypre_ParCSRMatrix *A, + hypre_ParCSRMatrix *S, + hypre_ParCSRMatrix *P, + HYPRE_BigInt *c_pts_starts, + HYPRE_Int *pass_order, + HYPRE_Int *pass_marker, + HYPRE_Int *pass_marker_offd, + HYPRE_Int num_points, + HYPRE_Int color, + HYPRE_Int num_functions, + HYPRE_Int *dof_func, + HYPRE_Int *dof_func_offd, + hypre_ParCSRMatrix **Pi_ptr ) +{ + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); + hypre_ParCSRCommHandle *comm_handle; + + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + HYPRE_Real *A_diag_data = hypre_CSRMatrixData(A_diag); + HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); + HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); + HYPRE_Int n_fine = hypre_CSRMatrixNumRows(A_diag); + + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); + HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); + HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); + HYPRE_Real *A_offd_data = hypre_CSRMatrixData(A_offd); + HYPRE_Int num_cols_offd_A = hypre_CSRMatrixNumCols(A_offd); + + hypre_CSRMatrix *S_diag = hypre_ParCSRMatrixDiag(S); + HYPRE_Int *S_diag_i = hypre_CSRMatrixI(S_diag); + HYPRE_Int *S_diag_j = hypre_CSRMatrixJ(S_diag); + + hypre_CSRMatrix *S_offd = hypre_ParCSRMatrixOffd(S); + HYPRE_Int *S_offd_i = hypre_CSRMatrixI(S_offd); + HYPRE_Int *S_offd_j = hypre_CSRMatrixJ(S_offd); + + HYPRE_Int *Soc_diag_j = hypre_ParCSRMatrixSocDiagJ(S); + HYPRE_Int *Soc_offd_j = hypre_ParCSRMatrixSocOffdJ(S); + + HYPRE_BigInt *col_map_offd_Q = NULL; + HYPRE_BigInt *col_map_offd_Q_dev = NULL; + HYPRE_Int num_cols_offd_Q; + + hypre_ParCSRMatrix *Pi; + hypre_CSRMatrix *Pi_diag; + HYPRE_Int *Pi_diag_i; + HYPRE_Real *Pi_diag_data; + hypre_CSRMatrix *Pi_offd; + HYPRE_Int *Pi_offd_i; + HYPRE_Real *Pi_offd_data; + + HYPRE_Int nnz_diag, nnz_offd; + + hypre_ParCSRMatrix *Q; + hypre_CSRMatrix *Q_diag; + HYPRE_Real *Q_diag_data; + HYPRE_Int *Q_diag_i; /*at first counter of nonzero cols for each row, + finally will be pointer to start of row */ + HYPRE_Int *Q_diag_j; + hypre_CSRMatrix *Q_offd; + HYPRE_Real *Q_offd_data = NULL; + HYPRE_Int *Q_offd_i; /*at first counter of nonzero cols for each row, + finally will be pointer to start of row */ + HYPRE_Int *Q_offd_j = NULL; + + HYPRE_Int *fine_to_coarse; + HYPRE_Int *fine_to_coarse_offd = NULL; + HYPRE_BigInt f_pts_starts[2]; + HYPRE_Int my_id, num_procs; + HYPRE_BigInt total_global_fpts; + HYPRE_BigInt total_global_cpts; + HYPRE_BigInt *big_convert_offd = NULL; + HYPRE_BigInt *big_buf_data = NULL; + HYPRE_Real *w_row_sum; + + /* MPI size and rank*/ + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); + + fine_to_coarse = hypre_TAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_DEVICE); + + hypre_modmp_init_fine_to_coarse(n_fine, pass_marker, color, fine_to_coarse); + + if (num_procs > 1) + { + HYPRE_BigInt big_Fpts = num_points; + + hypre_MPI_Scan(&big_Fpts, f_pts_starts + 1, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); + + f_pts_starts[0] = f_pts_starts[1] - big_Fpts; + + if (my_id == num_procs - 1) + { + total_global_fpts = f_pts_starts[1]; + total_global_cpts = c_pts_starts[1]; + } + hypre_MPI_Bcast(&total_global_fpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); + hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); + } + else + { + f_pts_starts[0] = 0; + f_pts_starts[1] = num_points; + total_global_fpts = f_pts_starts[1]; + total_global_cpts = c_pts_starts[1]; + } + + num_cols_offd_Q = 0; + + if (num_procs > 1) + { + HYPRE_Int num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); + HYPRE_Int num_elem_send = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends); + + big_convert_offd = hypre_TAlloc(HYPRE_BigInt, num_cols_offd_A, HYPRE_MEMORY_DEVICE); + big_buf_data = hypre_TAlloc(HYPRE_BigInt, num_elem_send, HYPRE_MEMORY_DEVICE); + + globalC_functor functor(c_pts_starts[0]); + +#if defined(HYPRE_USING_SYCL) + hypreSycl_gather( hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + num_elem_send, + oneapi::dpl::make_transform_iterator(fine_to_coarse, functor), + big_buf_data ); +#else + HYPRE_THRUST_CALL( gather, + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + num_elem_send, + thrust::make_transform_iterator(fine_to_coarse, functor), + big_buf_data ); +#endif + +#if defined(HYPRE_USING_THRUST_NOSYNC) + /* RL: make sure big_buf_data is ready before issuing GPU-GPU MPI */ + if (hypre_GetGpuAwareMPI()) + { + hypre_ForceSyncComputeStream(); + } +#endif + + comm_handle = hypre_ParCSRCommHandleCreate_v2(21, comm_pkg, HYPRE_MEMORY_DEVICE, big_buf_data, + HYPRE_MEMORY_DEVICE, big_convert_offd); + + hypre_ParCSRCommHandleDestroy(comm_handle); + + // This will allocate fine_to_coarse_offd_dev + hypre_modmp_compute_num_cols_offd_fine_to_coarse( pass_marker_offd, color, num_cols_offd_A, + num_cols_offd_Q, &fine_to_coarse_offd ); + + //FIXME: PB: It seems we need the host value too?!?! + col_map_offd_Q = hypre_TAlloc(HYPRE_BigInt, num_cols_offd_Q, HYPRE_MEMORY_HOST); + col_map_offd_Q_dev = hypre_TAlloc(HYPRE_BigInt, num_cols_offd_Q, HYPRE_MEMORY_DEVICE); + +#if defined(HYPRE_USING_SYCL) + HYPRE_BigInt *col_map_end = hypreSycl_copy_if( big_convert_offd, + big_convert_offd + num_cols_offd_A, + pass_marker_offd, + col_map_offd_Q_dev, + equal(color) ); +#else + HYPRE_BigInt *col_map_end = HYPRE_THRUST_CALL( copy_if, + big_convert_offd, + big_convert_offd + num_cols_offd_A, + pass_marker_offd, + col_map_offd_Q_dev, + equal(color) ); +#endif + + hypre_assert(num_cols_offd_Q == col_map_end - col_map_offd_Q_dev); + + //FIXME: PB: It seems like we're required to have a host version of this?? + hypre_TMemcpy(col_map_offd_Q, col_map_offd_Q_dev, HYPRE_BigInt, num_cols_offd_Q, HYPRE_MEMORY_HOST, + HYPRE_MEMORY_DEVICE); + + hypre_TFree(big_convert_offd, HYPRE_MEMORY_DEVICE ); + hypre_TFree(big_buf_data, HYPRE_MEMORY_DEVICE); + } + + Q_diag_i = hypre_TAlloc(HYPRE_Int, num_points + 1, HYPRE_MEMORY_DEVICE); + Q_offd_i = hypre_TAlloc(HYPRE_Int, num_points + 1, HYPRE_MEMORY_DEVICE); + + /* generate Q_diag_i and Q_offd_i */ + { + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(num_points, "warp", bDim); + + HYPRE_GPU_LAUNCH( hypreGPUKernel_generate_Pdiag_i_Poffd_i, gDim, bDim, + num_points, color, pass_order, pass_marker, pass_marker_offd, + S_diag_i, S_diag_j, S_offd_i, S_offd_j, + Q_diag_i, Q_offd_i ); + + hypre_Memset(Q_diag_i + num_points, 0, sizeof(HYPRE_Int), HYPRE_MEMORY_DEVICE); + hypre_Memset(Q_offd_i + num_points, 0, sizeof(HYPRE_Int), HYPRE_MEMORY_DEVICE); + +#if defined(HYPRE_USING_SYCL) + auto zip4 = oneapi::dpl::make_zip_iterator( Q_diag_i, Q_offd_i ); + HYPRE_ONEDPL_CALL( std::exclusive_scan, + zip4, + zip4 + num_points + 1, + oneapi::dpl::make_zip_iterator( Q_diag_i, Q_offd_i ), + std::make_tuple(HYPRE_Int(0), HYPRE_Int(0)), + tuple_plus() ); +#else + HYPRE_THRUST_CALL( exclusive_scan, + thrust::make_zip_iterator( thrust::make_tuple(Q_diag_i, Q_offd_i) ), + thrust::make_zip_iterator( thrust::make_tuple(Q_diag_i, Q_offd_i) ) + num_points + 1, + thrust::make_zip_iterator( thrust::make_tuple(Q_diag_i, Q_offd_i) ), + thrust::make_tuple(HYPRE_Int(0), HYPRE_Int(0)), + tuple_plus() ); +#endif + + hypre_TMemcpy(&nnz_diag, &Q_diag_i[num_points], HYPRE_Int, 1, HYPRE_MEMORY_HOST, + HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(&nnz_offd, &Q_offd_i[num_points], HYPRE_Int, 1, HYPRE_MEMORY_HOST, + HYPRE_MEMORY_DEVICE); + } + + /* generate P_diag_j/data and P_offd_j/data */ + Q_diag_j = hypre_TAlloc(HYPRE_Int, nnz_diag, HYPRE_MEMORY_DEVICE); + Q_diag_data = hypre_TAlloc(HYPRE_Real, nnz_diag, HYPRE_MEMORY_DEVICE); + Q_offd_j = hypre_TAlloc(HYPRE_Int, nnz_offd, HYPRE_MEMORY_DEVICE); + Q_offd_data = hypre_TAlloc(HYPRE_Real, nnz_offd, HYPRE_MEMORY_DEVICE); + w_row_sum = hypre_TAlloc(HYPRE_Real, num_points, HYPRE_MEMORY_DEVICE); + + { + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(num_points, "warp", bDim); + + HYPRE_GPU_LAUNCH( hypreGPUKernel_generate_Qdiag_j_Qoffd_j, gDim, bDim, + num_points, + color, + pass_order, + pass_marker, + pass_marker_offd, + fine_to_coarse, + fine_to_coarse_offd, + A_diag_i, + A_diag_j, + A_diag_data, + A_offd_i, + A_offd_j, + A_offd_data, + Soc_diag_j, + Soc_offd_j, + Q_diag_i, + Q_offd_i, + Q_diag_j, + Q_diag_data, + Q_offd_j, + Q_offd_data, + w_row_sum, + num_functions, + dof_func, + dof_func_offd ); + } + + hypre_TFree(fine_to_coarse, HYPRE_MEMORY_DEVICE); + hypre_TFree(fine_to_coarse_offd, HYPRE_MEMORY_DEVICE); + + Q = hypre_ParCSRMatrixCreate(comm, + total_global_fpts, + total_global_cpts, + f_pts_starts, + c_pts_starts, + num_cols_offd_Q, + nnz_diag, + nnz_offd); + + Q_diag = hypre_ParCSRMatrixDiag(Q); + hypre_CSRMatrixData(Q_diag) = Q_diag_data; + hypre_CSRMatrixI(Q_diag) = Q_diag_i; + hypre_CSRMatrixJ(Q_diag) = Q_diag_j; + + Q_offd = hypre_ParCSRMatrixOffd(Q); + hypre_CSRMatrixData(Q_offd) = Q_offd_data; + hypre_CSRMatrixI(Q_offd) = Q_offd_i; + hypre_CSRMatrixJ(Q_offd) = Q_offd_j; + + hypre_ParCSRMatrixColMapOffd(Q) = col_map_offd_Q; + hypre_ParCSRMatrixDeviceColMapOffd(Q) = col_map_offd_Q_dev; + + hypre_CSRMatrixMemoryLocation(Q_diag) = HYPRE_MEMORY_DEVICE; + hypre_CSRMatrixMemoryLocation(Q_offd) = HYPRE_MEMORY_DEVICE; + + hypre_MatvecCommPkgCreate(Q); + + Pi = hypre_ParCSRMatMat(Q, P); + + Pi_diag = hypre_ParCSRMatrixDiag(Pi); + Pi_diag_data = hypre_CSRMatrixData(Pi_diag); + Pi_diag_i = hypre_CSRMatrixI(Pi_diag); + Pi_offd = hypre_ParCSRMatrixOffd(Pi); + Pi_offd_data = hypre_CSRMatrixData(Pi_offd); + Pi_offd_i = hypre_CSRMatrixI(Pi_offd); + + { + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(num_points, "warp", bDim); + + HYPRE_GPU_LAUNCH( hypreGPUKernel_mutli_pi_rowsum, gDim, bDim, + num_points, pass_order, A_diag_i, A_diag_data, + Pi_diag_i, Pi_diag_data, Pi_offd_i, Pi_offd_data, + w_row_sum ); + } + + hypre_TFree(w_row_sum, HYPRE_MEMORY_DEVICE); + + hypre_ParCSRMatrixDestroy(Q); + + *Pi_ptr = Pi; + + return hypre_error_flag; +} + +void hypre_modmp_init_fine_to_coarse( HYPRE_Int n_fine, + HYPRE_Int *pass_marker, + HYPRE_Int color, + HYPRE_Int *fine_to_coarse ) +{ + // n_fine == pass_marker.size() + // Host code this is replacing: + // n_cpts = 0; + // for (HYPRE_Int i=0; i < n_fine; i++) + // { + // if (pass_marker[i] == color) + // fine_to_coarse[i] = n_cpts++; + // else + // fine_to_coarse[i] = -1; + // } + + if (n_fine == 0) + { + return; + } + +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::exclusive_scan, + oneapi::dpl::make_transform_iterator(pass_marker, equal(color)), + oneapi::dpl::make_transform_iterator(pass_marker + n_fine, equal(color)), + fine_to_coarse, + HYPRE_Int(0) ); + + hypreSycl_transform_if( fine_to_coarse, + fine_to_coarse + n_fine, + pass_marker, + fine_to_coarse, + [] (const auto & x) {return -1;}, + [color = color] (const auto & x) {return x != color;} ); +#else + HYPRE_THRUST_CALL( exclusive_scan, + thrust::make_transform_iterator(pass_marker, equal(color)), + thrust::make_transform_iterator(pass_marker + n_fine, equal(color)), + fine_to_coarse, + HYPRE_Int(0) ); + + HYPRE_THRUST_CALL( replace_if, + fine_to_coarse, + fine_to_coarse + n_fine, + pass_marker, + HYPRE_THRUST_NOT(equal(color)), + -1 ); +#endif +} + +void +hypre_modmp_compute_num_cols_offd_fine_to_coarse( HYPRE_Int *pass_marker_offd, + HYPRE_Int color, + HYPRE_Int num_cols_offd_A, + HYPRE_Int &num_cols_offd, + HYPRE_Int **fine_to_coarse_offd_ptr ) +{ + // We allocate with a "+1" because the host version of this code incremented the counter + // even on the last match, so we create an extra entry the exclusive_scan will reflect this + // and we can read off the last entry and only do 1 kernel call and 1 memcpy + // RL: this trick requires pass_marker_offd has 1 more space allocated too + HYPRE_Int *fine_to_coarse_offd = hypre_TAlloc(HYPRE_Int, num_cols_offd_A + 1, HYPRE_MEMORY_DEVICE); + +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::exclusive_scan, + oneapi::dpl::make_transform_iterator(pass_marker_offd, + equal(color)), + oneapi::dpl::make_transform_iterator(pass_marker_offd + num_cols_offd_A + 1, + equal(color)), + fine_to_coarse_offd, + HYPRE_Int(0) ); +#else + HYPRE_THRUST_CALL( exclusive_scan, + thrust::make_transform_iterator(pass_marker_offd, equal(color)), + thrust::make_transform_iterator(pass_marker_offd + num_cols_offd_A + 1, equal(color)), + fine_to_coarse_offd, + HYPRE_Int(0) ); +#endif + + hypre_TMemcpy( &num_cols_offd, fine_to_coarse_offd + num_cols_offd_A, HYPRE_Int, 1, + HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); + + *fine_to_coarse_offd_ptr = fine_to_coarse_offd; +} + +__global__ +void hypreGPUKernel_cfmarker_masked_rowsum( hypre_DeviceItem &item, + HYPRE_Int nrows, + HYPRE_Int *A_diag_i, + HYPRE_Int *A_diag_j, + HYPRE_Complex *A_diag_data, + HYPRE_Int *A_offd_i, + HYPRE_Int *A_offd_j, + HYPRE_Complex *A_offd_data, + HYPRE_Int *CF_marker, + HYPRE_Int *dof_func, + HYPRE_Int *dof_func_offd, + HYPRE_Complex *row_sums ) +{ + HYPRE_Int row_i = hypre_gpu_get_grid_warp_id<1, 1>(item); + + if (row_i >= nrows || read_only_load(&CF_marker[row_i]) >= 0) + { + return; + } + + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); + HYPRE_Int p = 0; + HYPRE_Int q = 0; + HYPRE_Int func_i = dof_func ? read_only_load(&dof_func[row_i]) : 0; + + // A_diag part + if (lane < 2) + { + p = read_only_load(A_diag_i + row_i + lane); + } + q = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 1); + p = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 0); + + HYPRE_Complex row_sum_i = 0.0; + + // exclude diagonal: do not assume it is the first entry + for (HYPRE_Int j = p + lane; j < q; j += HYPRE_WARP_SIZE) + { + HYPRE_Int col = read_only_load(&A_diag_j[j]); + + if (row_i != col) + { + HYPRE_Int func_j = dof_func ? read_only_load(&dof_func[col]) : 0; + + if (func_i == func_j) + { + HYPRE_Complex value = read_only_load(&A_diag_data[j]); + row_sum_i += value; + } + } + } + + // A_offd part + if (lane < 2) + { + p = read_only_load(A_offd_i + row_i + lane); + } + q = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 1); + p = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 0); + + for (HYPRE_Int j = p + lane; j < q; j += HYPRE_WARP_SIZE) + { + HYPRE_Int func_j = 0; + if (dof_func_offd) + { + HYPRE_Int col = read_only_load(&A_offd_j[j]); + func_j = read_only_load(&dof_func_offd[col]); + } + + if (func_i == func_j) + { + HYPRE_Complex value = read_only_load(&A_offd_data[j]); + row_sum_i += value; + } + } + + row_sum_i = warp_reduce_sum(item, row_sum_i); + + if (lane == 0) + { + row_sums[row_i] = row_sum_i; + } +} + +__global__ +void hypreGPUKernel_mutli_pi_rowsum( hypre_DeviceItem &item, + HYPRE_Int num_points, + HYPRE_Int *pass_order, + HYPRE_Int *A_diag_i, + HYPRE_Complex *A_diag_data, + HYPRE_Int *Pi_diag_i, + HYPRE_Complex *Pi_diag_data, + HYPRE_Int *Pi_offd_i, + HYPRE_Complex *Pi_offd_data, + HYPRE_Complex *w_row_sum ) +{ + HYPRE_Int row_i = hypre_gpu_get_grid_warp_id<1, 1>(item); + + if (row_i >= num_points) + { + return; + } + + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); + HYPRE_Int p_diag = 0, q_diag = 0, p_offd = 0, q_offd = 0; + HYPRE_Real row_sum_C = 0.0; + + // Pi_diag + if (lane < 2) + { + p_diag = read_only_load(Pi_diag_i + row_i + lane); + } + q_diag = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_diag, 1); + p_diag = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_diag, 0); + + for (HYPRE_Int j = p_diag + lane; j < q_diag; j += HYPRE_WARP_SIZE) + { + row_sum_C += read_only_load(&Pi_diag_data[j]); + } + + // Pi_offd + if (lane < 2) + { + p_offd = read_only_load(Pi_offd_i + row_i + lane); + } + q_offd = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_offd, 1); + p_offd = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_offd, 0); + + for (HYPRE_Int j = p_offd + lane; j < q_offd; j += HYPRE_WARP_SIZE) + { + row_sum_C += read_only_load(&Pi_offd_data[j]); + } + + row_sum_C = warp_reduce_sum(item, row_sum_C); + + if ( lane == 0 ) + { + const HYPRE_Int i1 = read_only_load(&pass_order[row_i]); + const HYPRE_Int j1 = read_only_load(&A_diag_i[i1]); + //XXX RL: rely on diagonal is the first of row [FIX?] + const HYPRE_Real diagonal = read_only_load(&A_diag_data[j1]); + const HYPRE_Real value = row_sum_C * diagonal; + row_sum_C += read_only_load(&w_row_sum[row_i]); + + if ( value != 0.0 ) + { + row_sum_C /= value; + } + } + + row_sum_C = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, row_sum_C, 0); + + // Pi_diag + for (HYPRE_Int j = p_diag + lane; j < q_diag; j += HYPRE_WARP_SIZE) + { + Pi_diag_data[j] *= -row_sum_C; + } + + // Pi_offd + for (HYPRE_Int j = p_offd + lane; j < q_offd; j += HYPRE_WARP_SIZE) + { + Pi_offd_data[j] *= -row_sum_C; + } +} + +__global__ +void hypreGPUKernel_generate_Pdiag_i_Poffd_i( hypre_DeviceItem &item, + HYPRE_Int num_points, + HYPRE_Int color, + HYPRE_Int *pass_order, + HYPRE_Int *pass_marker, + HYPRE_Int *pass_marker_offd, + HYPRE_Int *S_diag_i, + HYPRE_Int *S_diag_j, + HYPRE_Int *S_offd_i, + HYPRE_Int *S_offd_j, + HYPRE_Int *P_diag_i, + HYPRE_Int *P_offd_i ) +{ + /* + nnz_diag = 0; + nnz_offd = 0; + for (i=0; i < num_points; i++) + { + i1 = pass_order[i]; + for (j=S_diag_i[i1]; j < S_diag_i[i1+1]; j++) + { + j1 = S_diag_j[j]; + if (pass_marker[j1] == color) + { + P_diag_i[i]++; + nnz_diag++; + } + } + for (j=S_offd_i[i1]; j < S_offd_i[i1+1]; j++) + { + j1 = S_offd_j[j]; + if (pass_marker_offd[j1] == color) + { + P_offd_i[i]++; + nnz_offd++; + } + } + } + */ + + HYPRE_Int row_i = hypre_gpu_get_grid_warp_id<1, 1>(item); + + if (row_i >= num_points) + { + return; + } + + HYPRE_Int i1 = read_only_load(&pass_order[row_i]); + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); + HYPRE_Int p = 0; + HYPRE_Int q = 0; + HYPRE_Int diag_increment = 0; + HYPRE_Int offd_increment = 0; + + // S_diag + if (lane < 2) + { + p = read_only_load(S_diag_i + i1 + lane); + } + q = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 1); + p = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 0); + + for (HYPRE_Int j = p + lane; j < q; j += HYPRE_WARP_SIZE) + { + const HYPRE_Int j1 = read_only_load(&S_diag_j[j]); + const HYPRE_Int marker = read_only_load(&pass_marker[j1]); + + diag_increment += marker == color; + } + + diag_increment = warp_reduce_sum(item, diag_increment); + + // Increment P_diag_i, but then we need to also do a block reduction + // on diag_increment to log the total nnz_diag for the block + // Then after the kernel, we'll accumulate nnz_diag for each block + if (lane == 0) + { + P_diag_i[row_i] = diag_increment; + } + + // S_offd + if (lane < 2) + { + p = read_only_load(S_offd_i + i1 + lane); + } + q = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 1); + p = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 0); + + for (HYPRE_Int j = p + lane; j < q; j += HYPRE_WARP_SIZE) + { + const HYPRE_Int j1 = read_only_load(&S_offd_j[j]); + const HYPRE_Int marker = read_only_load(&pass_marker_offd[j1]); + + offd_increment += marker == color; + } + + offd_increment = warp_reduce_sum(item, offd_increment); + + // Increment P_offd_i, but then we need to also do a block reduction + // on offd_increment to log the total nnz_offd for the block + // Then after the kernel, we'll accumulate nnz_offd for each block + if (lane == 0) + { + P_offd_i[row_i] = offd_increment; + } +} + +__global__ +void hypreGPUKernel_generate_Pdiag_j_Poffd_j( hypre_DeviceItem &item, + HYPRE_Int num_points, + HYPRE_Int color, + HYPRE_Int *pass_order, + HYPRE_Int *pass_marker, + HYPRE_Int *pass_marker_offd, + HYPRE_Int *fine_to_coarse, + HYPRE_Int *fine_to_coarse_offd, + HYPRE_Int *A_diag_i, + HYPRE_Int *A_diag_j, + HYPRE_Complex *A_diag_data, + HYPRE_Int *A_offd_i, + HYPRE_Int *A_offd_j, + HYPRE_Complex *A_offd_data, + HYPRE_Int *Soc_diag_j, + HYPRE_Int *Soc_offd_j, + HYPRE_Int *P_diag_i, + HYPRE_Int *P_offd_i, + HYPRE_Int *P_diag_j, + HYPRE_Complex *P_diag_data, + HYPRE_Int *P_offd_j, + HYPRE_Complex *P_offd_data, + HYPRE_Complex *row_sums ) +{ + HYPRE_Int row_i = hypre_gpu_get_grid_warp_id<1, 1>(item); + + if (row_i >= num_points) + { + return; + } + + HYPRE_Int i1 = read_only_load(&pass_order[row_i]); + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); + HYPRE_Int p_diag_A = 0, q_diag_A, p_diag_P = 0, q_diag_P; + HYPRE_Int k; + HYPRE_Complex row_sum_C = 0.0, diagonal = 0.0; + + // S_diag + if (lane < 2) + { + p_diag_A = read_only_load(A_diag_i + i1 + lane); + p_diag_P = read_only_load(P_diag_i + row_i + lane); + } + q_diag_A = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_diag_A, 1); + p_diag_A = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_diag_A, 0); + q_diag_P = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_diag_P, 1); + p_diag_P = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_diag_P, 0); + + k = p_diag_P; + for (HYPRE_Int j = p_diag_A + lane; warp_any_sync(item, HYPRE_WARP_FULL_MASK, j < q_diag_A); + j += HYPRE_WARP_SIZE) + { + HYPRE_Int equal = 0; + HYPRE_Int sum = 0; + HYPRE_Int j1 = -1; + + if ( j < q_diag_A ) + { + j1 = read_only_load(&Soc_diag_j[j]); + equal = j1 > -1 && read_only_load(&pass_marker[j1]) == color; + } + + HYPRE_Int pos = warp_prefix_sum(item, lane, equal, sum); + + if (equal) + { + P_diag_j[k + pos] = read_only_load(&fine_to_coarse[j1]); + HYPRE_Complex val = read_only_load(&A_diag_data[j]); + P_diag_data[k + pos] = val; + row_sum_C += val; + } + + if (j1 == -2) + { + diagonal = read_only_load(&A_diag_data[j]); + } + + k += sum; + } + + hypre_device_assert(k == q_diag_P); + + // S_offd + HYPRE_Int p_offd_A = 0, q_offd_A, p_offd_P = 0, q_offd_P; + + if (lane < 2) + { + p_offd_A = read_only_load(A_offd_i + i1 + lane); + p_offd_P = read_only_load(P_offd_i + row_i + lane); + } + q_offd_A = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_offd_A, 1); + p_offd_A = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_offd_A, 0); + q_offd_P = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_offd_P, 1); + p_offd_P = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_offd_P, 0); + + k = p_offd_P; + for (HYPRE_Int j = p_offd_A + lane; warp_any_sync(item, HYPRE_WARP_FULL_MASK, j < q_offd_A); + j += HYPRE_WARP_SIZE) + { + HYPRE_Int equal = 0; + HYPRE_Int sum = 0; + HYPRE_Int j1 = -1; + + if ( j < q_offd_A ) + { + j1 = read_only_load(&Soc_offd_j[j]); + equal = j1 > -1 && read_only_load(&pass_marker_offd[j1]) == color; + } + + HYPRE_Int pos = warp_prefix_sum(item, lane, equal, sum); + + if (equal) + { + P_offd_j[k + pos] = read_only_load(&fine_to_coarse_offd[j1]); + HYPRE_Complex val = read_only_load(&A_offd_data[j]); + P_offd_data[k + pos] = val; + row_sum_C += val; + } + + k += sum; + } + + hypre_device_assert(k == q_offd_P); + + row_sum_C = warp_reduce_sum(item, row_sum_C); + diagonal = warp_reduce_sum(item, diagonal); + HYPRE_Complex value = row_sum_C * diagonal; + HYPRE_Complex row_sum_i = 0.0; + + if (lane == 0) + { + row_sum_i = read_only_load(&row_sums[i1]); + + if (value) + { + row_sum_i /= value; + row_sums[i1] = row_sum_i; + } + } + + row_sum_i = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, row_sum_i, 0); + + for (HYPRE_Int j = p_diag_P + lane; j < q_diag_P; j += HYPRE_WARP_SIZE) + { + P_diag_data[j] = -P_diag_data[j] * row_sum_i; + } + + for (HYPRE_Int j = p_offd_P + lane; j < q_offd_P; j += HYPRE_WARP_SIZE) + { + P_offd_data[j] = -P_offd_data[j] * row_sum_i; + } +} + +__global__ +void hypreGPUKernel_insert_remaining_weights( hypre_DeviceItem &item, + HYPRE_Int start, + HYPRE_Int stop, + HYPRE_Int *pass_order, + HYPRE_Int *Pi_diag_i, + HYPRE_Int *Pi_diag_j, + HYPRE_Real *Pi_diag_data, + HYPRE_Int *P_diag_i, + HYPRE_Int *P_diag_j, + HYPRE_Real *P_diag_data, + HYPRE_Int *Pi_offd_i, + HYPRE_Int *Pi_offd_j, + HYPRE_Real *Pi_offd_data, + HYPRE_Int *P_offd_i, + HYPRE_Int *P_offd_j, + HYPRE_Real *P_offd_data ) +{ + HYPRE_Int row_i = hypre_gpu_get_grid_warp_id<1, 1>(item); + + if (row_i >= stop - start) + { + return; + } + + HYPRE_Int i1 = read_only_load(&pass_order[row_i + start]); + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); + HYPRE_Int p = 0; + HYPRE_Int q = 0; + HYPRE_Int i2; + + // P_diag + if (lane < 2) + { + p = read_only_load(P_diag_i + i1 + lane); + } + q = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 1); + p = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 0); + + i2 = read_only_load(&Pi_diag_i[row_i]) - p; + for (HYPRE_Int j = p + lane; j < q; j += HYPRE_WARP_SIZE) + { + P_diag_j[j] = Pi_diag_j[j + i2]; + P_diag_data[j] = Pi_diag_data[j + i2]; + } + + // P_offd + if (lane < 2) + { + p = read_only_load(P_offd_i + i1 + lane); + } + q = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 1); + p = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 0); + + i2 = read_only_load(&Pi_offd_i[row_i]) - p; + for (HYPRE_Int j = p + lane; j < q; j += HYPRE_WARP_SIZE) + { + P_offd_j[j] = Pi_offd_j[j + i2]; + P_offd_data[j] = Pi_offd_data[j + i2]; + } +} + + +__global__ +void hypreGPUKernel_generate_Qdiag_j_Qoffd_j( hypre_DeviceItem &item, + HYPRE_Int num_points, + HYPRE_Int color, + HYPRE_Int *pass_order, + HYPRE_Int *pass_marker, + HYPRE_Int *pass_marker_offd, + HYPRE_Int *fine_to_coarse, + HYPRE_Int *fine_to_coarse_offd, + HYPRE_Int *A_diag_i, + HYPRE_Int *A_diag_j, + HYPRE_Complex *A_diag_data, + HYPRE_Int *A_offd_i, + HYPRE_Int *A_offd_j, + HYPRE_Complex *A_offd_data, + HYPRE_Int *Soc_diag_j, + HYPRE_Int *Soc_offd_j, + HYPRE_Int *Q_diag_i, + HYPRE_Int *Q_offd_i, + HYPRE_Int *Q_diag_j, + HYPRE_Complex *Q_diag_data, + HYPRE_Int *Q_offd_j, + HYPRE_Complex *Q_offd_data, + HYPRE_Complex *w_row_sum, + HYPRE_Int num_functions, + HYPRE_Int *dof_func, + HYPRE_Int *dof_func_offd ) +{ + HYPRE_Int row_i = hypre_gpu_get_grid_warp_id<1, 1>(item); + + if (row_i >= num_points) + { + return; + } + + HYPRE_Int i1 = read_only_load(&pass_order[row_i]); + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); + HYPRE_Int p_diag_A = 0, q_diag_A, p_diag_P = 0; +#ifdef HYPRE_DEBUG + HYPRE_Int q_diag_P; +#endif + HYPRE_Int k; + HYPRE_Complex w_row_sum_i = 0.0; + HYPRE_Int dof_func_i1 = -1; + + if (num_functions > 1) + { + if (lane == 0) + { + dof_func_i1 = read_only_load(&dof_func[i1]); + } + dof_func_i1 = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, dof_func_i1, 0); + } + + // S_diag +#ifdef HYPRE_DEBUG + if (lane < 2) + { + p_diag_A = read_only_load(A_diag_i + i1 + lane); + p_diag_P = read_only_load(Q_diag_i + row_i + lane); + } + q_diag_A = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_diag_A, 1); + p_diag_A = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_diag_A, 0); + q_diag_P = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_diag_P, 1); + p_diag_P = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_diag_P, 0); +#else + if (lane < 2) + { + p_diag_A = read_only_load(A_diag_i + i1 + lane); + } + q_diag_A = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_diag_A, 1); + p_diag_A = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_diag_A, 0); + if (lane == 0) + { + p_diag_P = read_only_load(Q_diag_i + row_i); + } + p_diag_P = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_diag_P, 0); +#endif + + k = p_diag_P; + for (HYPRE_Int j = p_diag_A + lane; warp_any_sync(item, HYPRE_WARP_FULL_MASK, j < q_diag_A); + j += HYPRE_WARP_SIZE) + { + HYPRE_Int equal = 0; + HYPRE_Int sum = 0; + HYPRE_Int j1 = -1; + + if ( j < q_diag_A ) + { + j1 = read_only_load(&Soc_diag_j[j]); + equal = j1 > -1 && read_only_load(&pass_marker[j1]) == color; + } + + HYPRE_Int pos = warp_prefix_sum(item, lane, equal, sum); + + if (equal) + { + Q_diag_j[k + pos] = read_only_load(&fine_to_coarse[j1]); + Q_diag_data[k + pos] = read_only_load(&A_diag_data[j]); + } + else if (j < q_diag_A && j1 != -2) + { + if (num_functions > 1) + { + const HYPRE_Int col = read_only_load(&A_diag_j[j]); + if ( dof_func_i1 == read_only_load(&dof_func[col]) ) + { + w_row_sum_i += read_only_load(&A_diag_data[j]); + } + } + else + { + w_row_sum_i += read_only_load(&A_diag_data[j]); + } + } + + k += sum; + } + +#ifdef HYPRE_DEBUG + hypre_device_assert(k == q_diag_P); +#endif + + // S_offd + HYPRE_Int p_offd_A = 0, q_offd_A, p_offd_P = 0; +#ifdef HYPRE_DEBUG + HYPRE_Int q_offd_P; +#endif + +#ifdef HYPRE_DEBUG + if (lane < 2) + { + p_offd_A = read_only_load(A_offd_i + i1 + lane); + p_offd_P = read_only_load(Q_offd_i + row_i + lane); + } + q_offd_A = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_offd_A, 1); + p_offd_A = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_offd_A, 0); + q_offd_P = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_offd_P, 1); + p_offd_P = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_offd_P, 0); +#else + if (lane < 2) + { + p_offd_A = read_only_load(A_offd_i + i1 + lane); + } + q_offd_A = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_offd_A, 1); + p_offd_A = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_offd_A, 0); + if (lane == 0) + { + p_offd_P = read_only_load(Q_offd_i + row_i); + } + p_offd_P = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_offd_P, 0); +#endif + + k = p_offd_P; + for (HYPRE_Int j = p_offd_A + lane; warp_any_sync(item, HYPRE_WARP_FULL_MASK, j < q_offd_A); + j += HYPRE_WARP_SIZE) + { + HYPRE_Int equal = 0; + HYPRE_Int sum = 0; + HYPRE_Int j1 = -1; + + if ( j < q_offd_A ) + { + j1 = read_only_load(&Soc_offd_j[j]); + equal = j1 > -1 && read_only_load(&pass_marker_offd[j1]) == color; + } + + HYPRE_Int pos = warp_prefix_sum(item, lane, equal, sum); + + if (equal) + { + Q_offd_j[k + pos] = read_only_load(&fine_to_coarse_offd[j1]); + Q_offd_data[k + pos] = read_only_load(&A_offd_data[j]); + } + else if (j < q_offd_A) + { + if (num_functions > 1) + { + const HYPRE_Int col = read_only_load(&A_offd_j[j]); + if ( dof_func_i1 == read_only_load(&dof_func_offd[col]) ) + { + w_row_sum_i += read_only_load(&A_offd_data[j]); + } + } + else + { + w_row_sum_i += read_only_load(&A_offd_data[j]); + } + } + + k += sum; + } + +#ifdef HYPRE_DEBUG + hypre_device_assert(k == q_offd_P); +#endif + + w_row_sum_i = warp_reduce_sum(item, w_row_sum_i); + + if (lane == 0) + { + w_row_sum[row_i] = w_row_sum_i; + } +} + +__global__ +void hypreGPUKernel_pass_order_count( hypre_DeviceItem &item, + HYPRE_Int num_points, + HYPRE_Int color, + HYPRE_Int *points_left, + HYPRE_Int *pass_marker, + HYPRE_Int *pass_marker_offd, + HYPRE_Int *S_diag_i, + HYPRE_Int *S_diag_j, + HYPRE_Int *S_offd_i, + HYPRE_Int *S_offd_j, + HYPRE_Int *diag_shifts ) +{ + HYPRE_Int row_i = hypre_gpu_get_grid_warp_id<1, 1>(item); + + if (row_i >= num_points) + { + return; + } + + HYPRE_Int i1 = read_only_load(&points_left[row_i]); + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); + HYPRE_Int p = 0; + HYPRE_Int q = 0; + hypre_int brk = 0; + + // S_diag + if (lane < 2) + { + p = read_only_load(S_diag_i + i1 + lane); + } + q = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 1); + p = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 0); + + for (HYPRE_Int j = p + lane; warp_any_sync(item, HYPRE_WARP_FULL_MASK, j < q); j += HYPRE_WARP_SIZE) + { + if (j < q) + { + HYPRE_Int j1 = read_only_load(&S_diag_j[j]); + if ( read_only_load(&pass_marker[j1]) == color ) + { + brk = 1; + } + } + + brk = warp_any_sync(item, HYPRE_WARP_FULL_MASK, brk); + + if (brk) + { + break; + } + } + + if (brk) + { + // Only one thread can increment because of the break + // so we just need to increment by 1 + if (lane == 0) + { + diag_shifts[row_i] = 1; + } + + return; + } + + // S_offd + if (lane < 2) + { + p = read_only_load(S_offd_i + i1 + lane); + } + q = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 1); + p = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 0); + + for (HYPRE_Int j = p + lane; warp_any_sync(item, HYPRE_WARP_FULL_MASK, j < q); j += HYPRE_WARP_SIZE) + { + if (j < q) + { + HYPRE_Int j1 = read_only_load(&S_offd_j[j]); + if ( read_only_load(&pass_marker_offd[j1]) == color ) + { + brk = 1; + } + } + + brk = warp_any_sync(item, HYPRE_WARP_FULL_MASK, brk); + + if (brk) + { + break; + } + } + + // Only one thread can increment because of the break + // so we just need to increment by 1 + if (lane == 0) + { + diag_shifts[row_i] = (brk != 0); + } +} + +__global__ +void hypreGPUKernel_populate_big_P_offd_j( hypre_DeviceItem &item, + HYPRE_Int start, + HYPRE_Int stop, + HYPRE_Int *pass_order, + HYPRE_Int *P_offd_i, + HYPRE_Int *P_offd_j, + HYPRE_BigInt *col_map_offd_Pi, + HYPRE_BigInt *big_P_offd_j ) +{ + HYPRE_Int i = hypre_gpu_get_grid_warp_id<1, 1>(item) + start; + + if (i >= stop) + { + return; + } + + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); + HYPRE_Int i1 = read_only_load(&pass_order[i]); + HYPRE_Int p = 0; + HYPRE_Int q = 0; + + if (lane < 2) + { + p = read_only_load(P_offd_i + i1 + lane); + } + q = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 1); + p = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 0); + + for (HYPRE_Int j = p + lane; j < q; j += HYPRE_WARP_SIZE) + { + HYPRE_Int col = read_only_load(&P_offd_j[j]); + big_P_offd_j[j] = read_only_load(&col_map_offd_Pi[col]); + } +} + +#endif // defined(HYPRE_USING_GPU) diff --git a/external/hypre/src/parcsr_ls/par_multi_interp.c b/external/hypre/src/parcsr_ls/par_multi_interp.c index bfc8ab9a..2bb118d5 100644 --- a/external/hypre/src/parcsr_ls/par_multi_interp.c +++ b/external/hypre/src/parcsr_ls/par_multi_interp.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -13,18 +13,20 @@ *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, - HYPRE_Int *CF_marker, - hypre_ParCSRMatrix *S, - HYPRE_BigInt *num_cpts_global, - HYPRE_Int num_functions, - HYPRE_Int *dof_func, - HYPRE_Int debug_flag, - HYPRE_Real trunc_factor, - HYPRE_Int P_max_elmts, - HYPRE_Int weight_option, - hypre_ParCSRMatrix **P_ptr ) +hypre_BoomerAMGBuildMultipassHost( hypre_ParCSRMatrix *A, + HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, + HYPRE_BigInt *num_cpts_global, + HYPRE_Int num_functions, + HYPRE_Int *dof_func, + HYPRE_Int debug_flag, + HYPRE_Real trunc_factor, + HYPRE_Int P_max_elmts, + HYPRE_Int weight_option, + hypre_ParCSRMatrix **P_ptr ) { + HYPRE_UNUSED_VAR(debug_flag); + #ifdef HYPRE_PROFILE hypre_profile_times[HYPRE_TIMER_ID_MULTIPASS_INTERP] -= hypre_MPI_Wtime(); #endif @@ -32,7 +34,9 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, MPI_Comm comm = hypre_ParCSRMatrixComm(A); hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(S); hypre_ParCSRCommHandle *comm_handle; - hypre_ParCSRCommPkg *tmp_comm_pkg; + hypre_ParCSRCommPkg *tmp_comm_pkg = NULL; + + HYPRE_MemoryLocation memory_location_P = hypre_ParCSRMatrixMemoryLocation(A); hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); HYPRE_Real *A_diag_data = hypre_CSRMatrixData(A_diag); @@ -74,12 +78,12 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, HYPRE_Int num_sends = 0; HYPRE_Int *int_buf_data = NULL; HYPRE_BigInt *big_buf_data = NULL; - HYPRE_Int *send_map_start; - HYPRE_Int *send_map_elmt; - HYPRE_Int *send_procs; + HYPRE_Int *send_map_start = NULL; + HYPRE_Int *send_map_elmt = NULL; + HYPRE_Int *send_procs = NULL; HYPRE_Int num_recvs = 0; - HYPRE_Int *recv_vec_start; - HYPRE_Int *recv_procs; + HYPRE_Int *recv_vec_start = NULL; + HYPRE_Int *recv_procs = NULL; HYPRE_Int *new_recv_vec_start = NULL; HYPRE_Int **Pext_send_map_start = NULL; HYPRE_Int **Pext_recv_vec_start = NULL; @@ -128,7 +132,6 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, HYPRE_Int n_coarse = 0; HYPRE_Int n_coarse_offd = 0; HYPRE_Int n_SF = 0; - HYPRE_Int n_SF_offd = 0; HYPRE_Int *fine_to_coarse = NULL; HYPRE_BigInt *fine_to_coarse_offd = NULL; @@ -148,9 +151,9 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, HYPRE_Int j_start; HYPRE_Int j_end; - HYPRE_Int i,i1; - HYPRE_Int j,j1; - HYPRE_Int k,k1,k2,k3; + HYPRE_Int i, i1; + HYPRE_Int j, j1; + HYPRE_Int k, k1, k2, k3; HYPRE_BigInt big_k1; HYPRE_Int pass_array_size; HYPRE_BigInt global_pass_array_size; @@ -190,7 +193,7 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, max_num_threads[0] = hypre_NumThreads(); cnt_nz_per_thread = hypre_CTAlloc(HYPRE_Int, max_num_threads[0], HYPRE_MEMORY_HOST); cnt_nz_offd_per_thread = hypre_CTAlloc(HYPRE_Int, max_num_threads[0], HYPRE_MEMORY_HOST); - for(i=0; i < max_num_threads[0]; i++) + for (i = 0; i < max_num_threads[0]; i++) { cnt_nz_offd_per_thread[i] = 0; cnt_nz_per_thread[i] = 0; @@ -201,13 +204,13 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, * Access the CSR vectors for A and S. Also get size of fine grid. *-----------------------------------------------------------------------*/ - hypre_MPI_Comm_size(comm,&num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); my_first_cpt = num_cpts_global[0]; /* total_global_cpts = 0; */ - if (my_id == (num_procs -1)) total_global_cpts = num_cpts_global[1]; - hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); + if (my_id == (num_procs - 1)) { total_global_cpts = num_cpts_global[1]; } + hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); if (!comm_pkg) { @@ -230,7 +233,9 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, } if (num_cols_offd) + { S_offd_j = hypre_CSRMatrixJ(S_offd); + } n_fine = hypre_CSRMatrixNumRows(A_diag); @@ -238,29 +243,37 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, * Intialize counters and allocate mapping vector. *-----------------------------------------------------------------------*/ - if (n_fine) fine_to_coarse = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); + fine_to_coarse = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); n_coarse = 0; n_SF = 0; #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) reduction(+:n_coarse,n_SF ) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) reduction(+:n_coarse,n_SF) HYPRE_SMP_SCHEDULE #endif - for (i=0; i < n_fine; i++) - if (CF_marker[i] == 1) n_coarse++; - else if (CF_marker[i] == -3) n_SF++; - - pass_array_size = n_fine-n_coarse-n_SF; - if (pass_array_size) pass_array = hypre_CTAlloc(HYPRE_Int, pass_array_size, HYPRE_MEMORY_HOST); - pass_pointer = hypre_CTAlloc(HYPRE_Int, max_num_passes+1, HYPRE_MEMORY_HOST); - if (n_fine) assigned = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); - P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, HYPRE_MEMORY_DEVICE); - P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine+1, HYPRE_MEMORY_DEVICE); - if (n_coarse) C_array = hypre_CTAlloc(HYPRE_Int, n_coarse, HYPRE_MEMORY_HOST); + for (i = 0; i < n_fine; i++) + { + if (CF_marker[i] == 1) + { + n_coarse++; + } + else if (CF_marker[i] == -3) + { + n_SF++; + } + } + + pass_array_size = n_fine - n_coarse - n_SF; + pass_array = hypre_CTAlloc(HYPRE_Int, pass_array_size, HYPRE_MEMORY_HOST); + pass_pointer = hypre_CTAlloc(HYPRE_Int, max_num_passes + 1, HYPRE_MEMORY_HOST); + assigned = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); + P_diag_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, memory_location_P); + P_offd_i = hypre_CTAlloc(HYPRE_Int, n_fine + 1, memory_location_P); + C_array = hypre_CTAlloc(HYPRE_Int, n_coarse, HYPRE_MEMORY_HOST); if (num_cols_offd) { CF_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_offd, HYPRE_MEMORY_HOST); - if (num_functions > 1) dof_func_offd = hypre_CTAlloc(HYPRE_Int, num_cols_offd, HYPRE_MEMORY_HOST); + if (num_functions > 1) { dof_func_offd = hypre_CTAlloc(HYPRE_Int, num_cols_offd, HYPRE_MEMORY_HOST); } } if (num_procs > 1) @@ -274,18 +287,19 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, recv_vec_start = hypre_ParCSRCommPkgRecvVecStarts(comm_pkg); if (send_map_start[num_sends]) { - int_buf_data = hypre_CTAlloc(HYPRE_Int, send_map_start[num_sends], HYPRE_MEMORY_HOST); - big_buf_data = hypre_CTAlloc(HYPRE_BigInt, send_map_start[num_sends], HYPRE_MEMORY_HOST); + int_buf_data = hypre_CTAlloc(HYPRE_Int, send_map_start[num_sends], HYPRE_MEMORY_HOST); + big_buf_data = hypre_CTAlloc(HYPRE_BigInt, send_map_start[num_sends], HYPRE_MEMORY_HOST); } } - index = 0; - for (i=0; i < num_sends; i++) + for (i = 0; i < num_sends; i++) { start = send_map_start[i]; - for (j = start; j < send_map_start[i+1]; j++) + for (j = start; j < send_map_start[i + 1]; j++) + { int_buf_data[index++] = CF_marker[send_map_elmt[j]]; + } } if (num_procs > 1) { @@ -297,11 +311,13 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, if (num_functions > 1) { index = 0; - for (i=0; i < num_sends; i++) + for (i = 0; i < num_sends; i++) { start = send_map_start[i]; - for (j = start; j < send_map_start[i+1]; j++) + for (j = start; j < send_map_start[i + 1]; j++) + { int_buf_data[index++] = dof_func[send_map_elmt[j]]; + } } if (num_procs > 1) { @@ -312,13 +328,11 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, } n_coarse_offd = 0; - n_SF_offd = 0; #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) reduction(+:n_coarse_offd,n_SF_offd) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) reduction(+:n_coarse_offd) HYPRE_SMP_SCHEDULE #endif - for (i=0; i < num_cols_offd; i++) - if (CF_marker_offd[i] == 1) n_coarse_offd++; - else if (CF_marker_offd[i] == -3) n_SF_offd++; + for (i = 0; i < num_cols_offd; i++) + if (CF_marker_offd[i] == 1) { n_coarse_offd++; } if (num_cols_offd) { @@ -356,7 +370,7 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, cnt = 0; - p_cnt = pass_array_size-1; + p_cnt = pass_array_size - 1; P_diag_i[0] = 0; P_offd_i[0] = 0; for (i = 0; i < n_fine; i++) @@ -368,35 +382,37 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, and in column of P */ C_array[cnt++] = i; assigned[i] = 0; - P_diag_i[i+1] = 1; /* one element in row i1 of P */ - P_offd_i[i+1] = 0; + P_diag_i[i + 1] = 1; /* one element in row i1 of P */ + P_offd_i[i + 1] = 0; } else if (CF_marker[i] == -1) { pass_array[p_cnt--] = i; - P_diag_i[i+1] = 0; - P_offd_i[i+1] = 0; + P_diag_i[i + 1] = 0; + P_offd_i[i + 1] = 0; assigned[i] = -1; fine_to_coarse[i] = -1; } else { - P_diag_i[i+1] = 0; - P_offd_i[i+1] = 0; + P_diag_i[i + 1] = 0; + P_offd_i[i + 1] = 0; assigned[i] = -1; fine_to_coarse[i] = -1; } } index = 0; - for (i=0; i < num_sends; i++) + for (i = 0; i < num_sends; i++) { start = send_map_start[i]; - for (j = start; j < send_map_start[i+1]; j++) + for (j = start; j < send_map_start[i + 1]; j++) { big_buf_data[index] = (HYPRE_BigInt)fine_to_coarse[send_map_elmt[j]]; if (big_buf_data[index] > -1) + { big_buf_data[index] += my_first_cpt; + } index++; } } @@ -407,16 +423,18 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, hypre_ParCSRCommHandleDestroy(comm_handle); } - new_recv_vec_start = hypre_CTAlloc(HYPRE_Int, num_recvs+1, HYPRE_MEMORY_HOST); + new_recv_vec_start = hypre_CTAlloc(HYPRE_Int, num_recvs + 1, HYPRE_MEMORY_HOST); if (n_coarse_offd) + { C_array_offd = hypre_CTAlloc(HYPRE_Int, n_coarse_offd, HYPRE_MEMORY_HOST); + } cnt = 0; new_recv_vec_start[0] = 0; for (j = 0; j < num_recvs; j++) { - for (i = recv_vec_start[j]; i < recv_vec_start[j+1]; i++) + for (i = recv_vec_start[j]; i < recv_vec_start[j + 1]; i++) { if (CF_marker_offd[i] == 1) { @@ -431,7 +449,7 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, map_S_to_new[i] = -1; } } - new_recv_vec_start[j+1] = cnt; + new_recv_vec_start[j + 1] = cnt; } cnt = 0; @@ -450,25 +468,25 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, cnt_offd = 0; cnt_nz = 0; cnt_nz_offd = 0; - for (i = pass_array_size-1; i > cnt-1; i--) + for (i = pass_array_size - 1; i > cnt - 1; i--) { i1 = pass_array[i]; - for (j=S_diag_i[i1]; j < S_diag_i[i1+1]; j++) + for (j = S_diag_i[i1]; j < S_diag_i[i1 + 1]; j++) { j1 = S_diag_j[j]; if (CF_marker[j1] == 1) { - P_diag_i[i1+1]++; + P_diag_i[i1 + 1]++; cnt_nz++; assigned[i1] = 1; } } - for (j=S_offd_i[i1]; j < S_offd_i[i1+1]; j++) + for (j = S_offd_i[i1]; j < S_offd_i[i1 + 1]; j++) { j1 = S_offd_j[j]; if (CF_marker_offd[j1] == 1) { - P_offd_i[i1+1]++; + P_offd_i[i1 + 1]++; cnt_nz_offd++; assigned[i1] = 1; } @@ -488,10 +506,10 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, *-----------------------------------------------------------------------*/ index = 0; - for (i=0; i < num_sends; i++) + for (i = 0; i < num_sends; i++) { start = send_map_start[i]; - for (j = start; j < send_map_start[i+1]; j++) + for (j = start; j < send_map_start[i + 1]; j++) { int_buf_data[index++] = assigned[send_map_elmt[j]]; } } if (num_procs > 1) @@ -512,14 +530,14 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, hypre_MPI_SUM, comm); while (global_pass_array_size && pass < max_num_passes) { - for (i = pass_array_size-1; i > cnt-1; i--) + for (i = pass_array_size - 1; i > cnt - 1; i--) { i1 = pass_array[i]; no_break = 1; - for (j=S_diag_i[i1]; j < S_diag_i[i1+1]; j++) + for (j = S_diag_i[i1]; j < S_diag_i[i1 + 1]; j++) { j1 = S_diag_j[j]; - if (assigned[j1] == pass-1) + if (assigned[j1] == pass - 1) { pass_array[i++] = pass_array[cnt]; pass_array[cnt++] = i1; @@ -530,10 +548,10 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, } if (no_break) { - for (j=S_offd_i[i1]; j < S_offd_i[i1+1]; j++) + for (j = S_offd_i[i1]; j < S_offd_i[i1 + 1]; j++) { j1 = S_offd_j[j]; - if (assigned_offd[j1] == pass-1) + if (assigned_offd[j1] == pass - 1) { pass_array[i++] = pass_array[cnt]; pass_array[cnt++] = i1; @@ -552,10 +570,10 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, hypre_MPI_Allreduce(&local_pass_array_size, &global_pass_array_size, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); index = 0; - for (i=0; i < num_sends; i++) + for (i = 0; i < num_sends; i++) { start = send_map_start[i]; - for (j = start; j < send_map_start[i+1]; j++) + for (j = start; j < send_map_start[i + 1]; j++) { int_buf_data[index++] = assigned[send_map_elmt[j]]; } } if (num_procs > 1) @@ -571,7 +589,8 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, num_passes = pass; - P_diag_pass = hypre_CTAlloc(HYPRE_Int*, num_passes, HYPRE_MEMORY_HOST); /* P_diag_pass[i] will contain + P_diag_pass = hypre_CTAlloc(HYPRE_Int*, num_passes, + HYPRE_MEMORY_HOST); /* P_diag_pass[i] will contain all column numbers for points of pass i */ P_diag_pass[1] = hypre_CTAlloc(HYPRE_Int, cnt_nz, HYPRE_MEMORY_HOST); @@ -587,13 +606,17 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, P_offd_pass = hypre_CTAlloc(HYPRE_Int*, num_passes, HYPRE_MEMORY_HOST); if (cnt_nz_offd) + { P_offd_pass[1] = hypre_CTAlloc(HYPRE_Int, cnt_nz_offd, HYPRE_MEMORY_HOST); + } else + { P_offd_pass[1] = NULL; + } new_elmts = hypre_CTAlloc(HYPRE_BigInt*, num_passes, HYPRE_MEMORY_HOST); - new_counter = hypre_CTAlloc(HYPRE_Int, num_passes+1, HYPRE_MEMORY_HOST); + new_counter = hypre_CTAlloc(HYPRE_Int, num_passes + 1, HYPRE_MEMORY_HOST); new_counter[0] = 0; new_counter[1] = n_coarse_offd; @@ -609,18 +632,18 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, cnt_nz = 0; cnt_nz_offd = 0; /* JBS: Possible candidate for threading */ - for (i=pass_pointer[1]; i < pass_pointer[2]; i++) + for (i = pass_pointer[1]; i < pass_pointer[2]; i++) { i1 = pass_array[i]; P_diag_start[i1] = cnt_nz; P_offd_start[i1] = cnt_nz_offd; - for (j=S_diag_i[i1]; j < S_diag_i[i1+1]; j++) + for (j = S_diag_i[i1]; j < S_diag_i[i1 + 1]; j++) { j1 = S_diag_j[j]; if (CF_marker[j1] == 1) { P_diag_pass[1][cnt_nz++] = fine_to_coarse[j1]; } } - for (j=S_offd_i[i1]; j < S_offd_i[i1+1]; j++) + for (j = S_offd_i[i1]; j < S_offd_i[i1 + 1]; j++) { j1 = S_offd_j[j]; if (CF_marker_offd[j1] == 1) @@ -634,53 +657,54 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, if (num_procs > 1) { - tmp_comm_pkg = hypre_CTAlloc(hypre_ParCSRCommPkg, 1, HYPRE_MEMORY_HOST); Pext_send_map_start = hypre_CTAlloc(HYPRE_Int*, num_passes, HYPRE_MEMORY_HOST); Pext_recv_vec_start = hypre_CTAlloc(HYPRE_Int*, num_passes, HYPRE_MEMORY_HOST); Pext_pass = hypre_CTAlloc(HYPRE_Int*, num_passes, HYPRE_MEMORY_HOST); - Pext_i = hypre_CTAlloc(HYPRE_Int, num_cols_offd+1, HYPRE_MEMORY_HOST); - if (num_cols_offd) Pext_start = hypre_CTAlloc(HYPRE_Int, num_cols_offd, HYPRE_MEMORY_HOST); + Pext_i = hypre_CTAlloc(HYPRE_Int, num_cols_offd + 1, HYPRE_MEMORY_HOST); + if (num_cols_offd) { Pext_start = hypre_CTAlloc(HYPRE_Int, num_cols_offd, HYPRE_MEMORY_HOST); } if (send_map_start[num_sends]) + { P_ncols = hypre_CTAlloc(HYPRE_Int, send_map_start[num_sends], HYPRE_MEMORY_HOST); + } #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i=0; i < num_cols_offd+1; i++) + for (i = 0; i < num_cols_offd + 1; i++) { Pext_i[i] = 0; } #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i=0; i < send_map_start[num_sends]; i++) + for (i = 0; i < send_map_start[num_sends]; i++) { P_ncols[i] = 0; } } old_Pext_send_size = 0; old_Pext_recv_size = 0; - for (pass=2; pass < num_passes; pass++) + for (pass = 2; pass < num_passes; pass++) { if (num_procs > 1) { - Pext_send_map_start[pass] = hypre_CTAlloc(HYPRE_Int, num_sends+1, HYPRE_MEMORY_HOST); - Pext_recv_vec_start[pass] = hypre_CTAlloc(HYPRE_Int, num_recvs+1, HYPRE_MEMORY_HOST); + Pext_send_map_start[pass] = hypre_CTAlloc(HYPRE_Int, num_sends + 1, HYPRE_MEMORY_HOST); + Pext_recv_vec_start[pass] = hypre_CTAlloc(HYPRE_Int, num_recvs + 1, HYPRE_MEMORY_HOST); Pext_send_size = 0; Pext_send_map_start[pass][0] = 0; - for (i=0; i < num_sends; i++) + for (i = 0; i < num_sends; i++) { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(j,j1) reduction(+:Pext_send_size) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(j,j1) reduction(+:Pext_send_size) HYPRE_SMP_SCHEDULE #endif - for (j=send_map_start[i]; j < send_map_start[i+1]; j++) + for (j = send_map_start[i]; j < send_map_start[i + 1]; j++) { j1 = send_map_elmt[j]; - if (assigned[j1] == pass-1) + if (assigned[j1] == pass - 1) { - P_ncols[j] = P_diag_i[j1+1] + P_offd_i[j1+1]; + P_ncols[j] = P_diag_i[j1 + 1] + P_offd_i[j1 + 1]; Pext_send_size += P_ncols[j]; } } - Pext_send_map_start[pass][i+1] = Pext_send_size; + Pext_send_map_start[pass][i + 1] = Pext_send_size; } comm_handle = hypre_ParCSRCommHandleCreate (11, comm_pkg, @@ -696,31 +720,31 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, } cnt_offd = 0; - for (i=0; i < num_sends; i++) + for (i = 0; i < num_sends; i++) { - for (j=send_map_start[i]; j < send_map_start[i+1]; j++) + for (j = send_map_start[i]; j < send_map_start[i + 1]; j++) { j1 = send_map_elmt[j]; - if (assigned[j1] == pass-1) + if (assigned[j1] == pass - 1) { j_start = P_diag_start[j1]; - j_end = j_start+P_diag_i[j1+1]; - for (k=j_start; k < j_end; k++) + j_end = j_start + P_diag_i[j1 + 1]; + for (k = j_start; k < j_end; k++) { Pext_send_buffer[cnt_offd++] = my_first_cpt - + (HYPRE_BigInt) P_diag_pass[pass-1][k]; + + (HYPRE_BigInt) P_diag_pass[pass - 1][k]; } j_start = P_offd_start[j1]; - j_end = j_start+P_offd_i[j1+1]; - for (k=j_start; k < j_end; k++) + j_end = j_start + P_offd_i[j1 + 1]; + for (k = j_start; k < j_end; k++) { - k1 = P_offd_pass[pass-1][k]; + k1 = P_offd_pass[pass - 1][k]; k3 = 0; - while (k3 < pass-1) + while (k3 < pass - 1) { - if (k1 < new_counter[k3+1]) + if (k1 < new_counter[k3 + 1]) { - k2 = k1-new_counter[k3]; + k2 = k1 - new_counter[k3]; Pext_send_buffer[cnt_offd++] = new_elmts[k3][k2]; break; } @@ -736,39 +760,36 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, Pext_recv_size = 0; Pext_recv_vec_start[pass][0] = 0; cnt_offd = 0; - for (i=0; i < num_recvs; i++) + for (i = 0; i < num_recvs; i++) { - for (j=recv_vec_start[i]; j old_Pext_recv_size) @@ -788,26 +809,26 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, cnt_new = 0; cnt_offd = 0; /* JBS: Possible candidate for threading */ - for (i=0; i < num_recvs; i++) + for (i = 0; i < num_recvs; i++) { - for (j=recv_vec_start[i]; j < recv_vec_start[i+1]; j++) + for (j = recv_vec_start[i]; j < recv_vec_start[i + 1]; j++) { - if (assigned_offd[j] == pass-1) + if (assigned_offd[j] == pass - 1) { - for (j1 = cnt_offd; j1 < cnt_offd+Pext_i[j+1]; j1++) + for (j1 = cnt_offd; j1 < cnt_offd + Pext_i[j + 1]; j1++) { big_k1 = big_temp_pass[j1]; k2 = (HYPRE_Int)(big_k1 - my_first_cpt); if (k2 > -1 && k2 < n_coarse) - { Pext_pass[pass][j1] = -k2-1; } + { Pext_pass[pass][j1] = -k2 - 1; } else { not_found = 1; k3 = 0; - while (k3 < pass-1 && not_found) + while (k3 < pass - 1 && not_found) { k2 = hypre_BigBinarySearch(new_elmts[k3], big_k1, - (new_counter[k3+1]-new_counter[k3])); + (new_counter[k3 + 1] - new_counter[k3])); if (k2 > -1) { Pext_pass[pass][j1] = k2 + new_counter[k3]; @@ -820,43 +841,45 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, } if (not_found) { - new_elmts[pass-1][cnt_new] = big_k1; + new_elmts[pass - 1][cnt_new] = big_k1; loc[cnt_new++] = j1; } } } - cnt_offd += Pext_i[j+1]; + cnt_offd += Pext_i[j + 1]; } } } if (cnt_new) { - hypre_BigQsortbi(new_elmts[pass-1],loc,0,cnt_new-1); + hypre_BigQsortbi(new_elmts[pass - 1], loc, 0, cnt_new - 1); cnt = 0; - local_index = new_counter[pass-1]; + local_index = new_counter[pass - 1]; Pext_pass[pass][loc[0]] = local_index; - for (i=1; i < cnt_new; i++) + for (i = 1; i < cnt_new; i++) { - if (new_elmts[pass-1][i] > new_elmts[pass-1][cnt]) + if (new_elmts[pass - 1][i] > new_elmts[pass - 1][cnt]) { - new_elmts[pass-1][++cnt] = new_elmts[pass-1][i]; + new_elmts[pass - 1][++cnt] = new_elmts[pass - 1][i]; local_index++; } Pext_pass[pass][loc[i]] = local_index; } - new_counter[pass] = local_index+1; + new_counter[pass] = local_index + 1; } else if (num_procs > 1) - new_counter[pass] = new_counter[pass-1]; + { + new_counter[pass] = new_counter[pass - 1]; + } - if (new_num_cols_offd < local_index+1) - { new_num_cols_offd = local_index+1; } + if (new_num_cols_offd < local_index + 1) + { new_num_cols_offd = local_index + 1; } - pass_length = pass_pointer[pass+1] - pass_pointer[pass]; + pass_length = pass_pointer[pass + 1] - pass_pointer[pass]; #ifdef HYPRE_USING_OPENMP -#pragma omp parallel private(i,my_thread_num,num_threads,thread_start,thread_stop,cnt_nz,cnt_nz_offd,i1,j,j1,j_start,j_end,k1,k,P_marker,P_marker_offd) + #pragma omp parallel private(i,my_thread_num,num_threads,thread_start,thread_stop,cnt_nz,cnt_nz_offd,i1,j,j1,j_start,j_end,k1,k,P_marker,P_marker_offd) #endif { /* Thread by computing the sparsity structure for this pass only over @@ -865,13 +888,14 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, * P_marker, are initialized and de-allocated internally to the * parallel region. */ + P_marker_offd = NULL; my_thread_num = hypre_GetThreadNum(); num_threads = hypre_NumActiveThreads(); - thread_start = (pass_length/num_threads)*my_thread_num; - if (my_thread_num == num_threads-1) + thread_start = (pass_length / num_threads) * my_thread_num; + if (my_thread_num == num_threads - 1) { thread_stop = pass_length; } else - { thread_stop = (pass_length/num_threads)*(my_thread_num+1); } + { thread_stop = (pass_length / num_threads) * (my_thread_num + 1); } thread_start += pass_pointer[pass]; thread_stop += pass_pointer[pass]; @@ -881,19 +905,20 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, /* This block of code is to go to the top of the parallel region starting before * the loop over num_passes. */ - P_marker = hypre_CTAlloc(HYPRE_Int, n_coarse, HYPRE_MEMORY_HOST); /* marks points to see if they're counted */ - for (i=0; i < n_coarse; i++) + P_marker = hypre_CTAlloc(HYPRE_Int, n_coarse, + HYPRE_MEMORY_HOST); /* marks points to see if they're counted */ + for (i = 0; i < n_coarse; i++) { P_marker[i] = -1; } - if (new_num_cols_offd == local_index+1) + if (new_num_cols_offd == local_index + 1) { P_marker_offd = hypre_CTAlloc(HYPRE_Int, new_num_cols_offd, HYPRE_MEMORY_HOST); - for (i=0; i < new_num_cols_offd; i++) + for (i = 0; i < new_num_cols_offd; i++) { P_marker_offd[i] = -1; } } else if (n_coarse_offd) { P_marker_offd = hypre_CTAlloc(HYPRE_Int, n_coarse_offd, HYPRE_MEMORY_HOST); - for (i=0; i < n_coarse_offd; i++) + for (i = 0; i < n_coarse_offd; i++) { P_marker_offd[i] = -1; } } @@ -904,66 +929,66 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, * P_diag_i, P_offd_i: data parallel here, and require no special treatment * P_diag_start, P_offd_start: are not data parallel, require special treatment */ - for (i=thread_start; i < thread_stop; i++) + for (i = thread_start; i < thread_stop; i++) { i1 = pass_array[i]; P_diag_start[i1] = cnt_nz; P_offd_start[i1] = cnt_nz_offd; - for (j=S_diag_i[i1]; j < S_diag_i[i1+1]; j++) + for (j = S_diag_i[i1]; j < S_diag_i[i1 + 1]; j++) { j1 = S_diag_j[j]; - if (assigned[j1] == pass-1) + if (assigned[j1] == pass - 1) { j_start = P_diag_start[j1]; - j_end = j_start+P_diag_i[j1+1]; - for (k=j_start; k < j_end; k++) + j_end = j_start + P_diag_i[j1 + 1]; + for (k = j_start; k < j_end; k++) { - k1 = P_diag_pass[pass-1][k]; + k1 = P_diag_pass[pass - 1][k]; if (P_marker[k1] != i1) { cnt_nz++; - P_diag_i[i1+1]++; + P_diag_i[i1 + 1]++; P_marker[k1] = i1; } } j_start = P_offd_start[j1]; - j_end = j_start+P_offd_i[j1+1]; - for (k=j_start; k < j_end; k++) + j_end = j_start + P_offd_i[j1 + 1]; + for (k = j_start; k < j_end; k++) { - k1 = P_offd_pass[pass-1][k]; + k1 = P_offd_pass[pass - 1][k]; if (P_marker_offd[k1] != i1) { cnt_nz_offd++; - P_offd_i[i1+1]++; + P_offd_i[i1 + 1]++; P_marker_offd[k1] = i1; } } } } j_start = 0; - for (j=S_offd_i[i1]; j < S_offd_i[i1+1]; j++) + for (j = S_offd_i[i1]; j < S_offd_i[i1 + 1]; j++) { j1 = S_offd_j[j]; - if (assigned_offd[j1] == pass-1) + if (assigned_offd[j1] == pass - 1) { j_start = Pext_start[j1]; - j_end = j_start+Pext_i[j1+1]; - for (k=j_start; k < j_end; k++) + j_end = j_start + Pext_i[j1 + 1]; + for (k = j_start; k < j_end; k++) { k1 = Pext_pass[pass][k]; if (k1 < 0) { - if (P_marker[-k1-1] != i1) + if (P_marker[-k1 - 1] != i1) { cnt_nz++; - P_diag_i[i1+1]++; - P_marker[-k1-1] = i1; + P_diag_i[i1 + 1]++; + P_marker[-k1 - 1] = i1; } } else if (P_marker_offd[k1] != i1) { cnt_nz_offd++; - P_offd_i[i1+1]++; + P_offd_i[i1 + 1]++; P_marker_offd[k1] = i1; } } @@ -973,40 +998,40 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, /* Update P_diag_start, P_offd_start with cumulative * nonzero counts over all threads */ - if(my_thread_num == 0) + if (my_thread_num == 0) { max_num_threads[0] = num_threads; } cnt_nz_offd_per_thread[my_thread_num] = cnt_nz_offd; cnt_nz_per_thread[my_thread_num] = cnt_nz; #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif - if(my_thread_num == 0) + if (my_thread_num == 0) { - for(i = 1; i < max_num_threads[0]; i++) + for (i = 1; i < max_num_threads[0]; i++) { - cnt_nz_offd_per_thread[i] += cnt_nz_offd_per_thread[i-1]; - cnt_nz_per_thread[i] += cnt_nz_per_thread[i-1]; + cnt_nz_offd_per_thread[i] += cnt_nz_offd_per_thread[i - 1]; + cnt_nz_per_thread[i] += cnt_nz_per_thread[i - 1]; } } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif - if(my_thread_num > 0) + if (my_thread_num > 0) { /* update this thread's section of P_diag_start and P_offd_start * with the num of nz's counted by previous threads */ - for (i=thread_start; i < thread_stop; i++) + for (i = thread_start; i < thread_stop; i++) { i1 = pass_array[i]; - P_diag_start[i1] += cnt_nz_per_thread[my_thread_num-1]; - P_offd_start[i1] += cnt_nz_offd_per_thread[my_thread_num-1]; + P_diag_start[i1] += cnt_nz_per_thread[my_thread_num - 1]; + P_offd_start[i1] += cnt_nz_offd_per_thread[my_thread_num - 1]; } } else /* if my_thread_num == 0 */ { /* Grab the nz count for all threads */ - cnt_nz = cnt_nz_per_thread[max_num_threads[0]-1]; - cnt_nz_offd = cnt_nz_offd_per_thread[max_num_threads[0]-1]; + cnt_nz = cnt_nz_per_thread[max_num_threads[0] - 1]; + cnt_nz_offd = cnt_nz_offd_per_thread[max_num_threads[0] - 1]; /* Updated total nz count */ total_nz += cnt_nz; @@ -1015,20 +1040,24 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, /* Allocate P_diag_pass and P_offd_pass for all threads */ P_diag_pass[pass] = hypre_CTAlloc(HYPRE_Int, cnt_nz, HYPRE_MEMORY_HOST); if (cnt_nz_offd) + { P_offd_pass[pass] = hypre_CTAlloc(HYPRE_Int, cnt_nz_offd, HYPRE_MEMORY_HOST); + } else if (num_procs > 1) + { P_offd_pass[pass] = NULL; + } } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif /* offset cnt_nz and cnt_nz_offd to point to the starting * point in P_diag_pass and P_offd_pass for each thread */ - if(my_thread_num > 0) + if (my_thread_num > 0) { - cnt_nz = cnt_nz_per_thread[my_thread_num-1]; - cnt_nz_offd = cnt_nz_offd_per_thread[my_thread_num-1]; + cnt_nz = cnt_nz_per_thread[my_thread_num - 1]; + cnt_nz_offd = cnt_nz_offd_per_thread[my_thread_num - 1]; } else { @@ -1037,60 +1066,60 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, } /* Set P_diag_pass and P_offd_pass */ - for (i=thread_start; i < thread_stop; i++) + for (i = thread_start; i < thread_stop; i++) { i1 = pass_array[i]; - for (j=S_diag_i[i1]; j < S_diag_i[i1+1]; j++) + for (j = S_diag_i[i1]; j < S_diag_i[i1 + 1]; j++) { j1 = S_diag_j[j]; - if (assigned[j1] == pass-1) + if (assigned[j1] == pass - 1) { j_start = P_diag_start[j1]; - j_end = j_start+P_diag_i[j1+1]; - for (k=j_start; k < j_end; k++) + j_end = j_start + P_diag_i[j1 + 1]; + for (k = j_start; k < j_end; k++) { - k1 = P_diag_pass[pass-1][k]; - if (P_marker[k1] != -i1-1) + k1 = P_diag_pass[pass - 1][k]; + if (P_marker[k1] != -i1 - 1) { P_diag_pass[pass][cnt_nz++] = k1; - P_marker[k1] = -i1-1; + P_marker[k1] = -i1 - 1; } } j_start = P_offd_start[j1]; - j_end = j_start+P_offd_i[j1+1]; - for (k=j_start; k < j_end; k++) + j_end = j_start + P_offd_i[j1 + 1]; + for (k = j_start; k < j_end; k++) { - k1 = P_offd_pass[pass-1][k]; - if (P_marker_offd[k1] != -i1-1) + k1 = P_offd_pass[pass - 1][k]; + if (P_marker_offd[k1] != -i1 - 1) { P_offd_pass[pass][cnt_nz_offd++] = k1; - P_marker_offd[k1] = -i1-1; + P_marker_offd[k1] = -i1 - 1; } } } } - for (j=S_offd_i[i1]; j < S_offd_i[i1+1]; j++) + for (j = S_offd_i[i1]; j < S_offd_i[i1 + 1]; j++) { j1 = S_offd_j[j]; - if (assigned_offd[j1] == pass-1) + if (assigned_offd[j1] == pass - 1) { j_start = Pext_start[j1]; - j_end = j_start+Pext_i[j1+1]; - for (k=j_start; k < j_end; k++) + j_end = j_start + Pext_i[j1 + 1]; + for (k = j_start; k < j_end; k++) { k1 = Pext_pass[pass][k]; if (k1 < 0) { - if (P_marker[-k1-1] != -i1-1) + if (P_marker[-k1 - 1] != -i1 - 1) { - P_diag_pass[pass][cnt_nz++] = -k1-1; - P_marker[-k1-1] = -i1-1; + P_diag_pass[pass][cnt_nz++] = -k1 - 1; + P_marker[-k1 - 1] = -i1 - 1; } } - else if (P_marker_offd[k1] != -i1-1) + else if (P_marker_offd[k1] != -i1 - 1) { P_offd_pass[pass][cnt_nz_offd++] = k1; - P_marker_offd[k1] = -i1-1; + P_marker_offd[k1] = -i1 - 1; } } } @@ -1098,7 +1127,7 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, } hypre_TFree(P_marker, HYPRE_MEMORY_HOST); - if ( (n_coarse_offd) || (new_num_cols_offd == local_index+1) ) + if ( (n_coarse_offd) || (new_num_cols_offd == local_index + 1) ) { hypre_TFree(P_marker_offd, HYPRE_MEMORY_HOST); } } /* End parallel region */ @@ -1114,28 +1143,28 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, hypre_TFree(cnt_nz_offd_per_thread, HYPRE_MEMORY_HOST); hypre_TFree(max_num_threads, HYPRE_MEMORY_HOST); - P_diag_j = hypre_CTAlloc(HYPRE_Int, total_nz, HYPRE_MEMORY_DEVICE); - P_diag_data = hypre_CTAlloc(HYPRE_Real, total_nz, HYPRE_MEMORY_DEVICE); + P_diag_j = hypre_CTAlloc(HYPRE_Int, total_nz, memory_location_P); + P_diag_data = hypre_CTAlloc(HYPRE_Real, total_nz, memory_location_P); if (total_nz_offd) { - P_offd_j = hypre_CTAlloc(HYPRE_Int, total_nz_offd, HYPRE_MEMORY_DEVICE); - P_offd_data = hypre_CTAlloc(HYPRE_Real, total_nz_offd, HYPRE_MEMORY_DEVICE); + P_offd_j = hypre_CTAlloc(HYPRE_Int, total_nz_offd, memory_location_P); + P_offd_data = hypre_CTAlloc(HYPRE_Real, total_nz_offd, memory_location_P); } - for (i=0; i < n_fine; i++) + for (i = 0; i < n_fine; i++) { - P_diag_i[i+1] += P_diag_i[i]; - P_offd_i[i+1] += P_offd_i[i]; + P_diag_i[i + 1] += P_diag_i[i]; + P_offd_i[i + 1] += P_offd_i[i]; } -/* determine P for coarse points */ + /* determine P for coarse points */ #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,i1) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,i1) HYPRE_SMP_SCHEDULE #endif - for (i=0; i < n_coarse; i++) + for (i = 0; i < n_coarse; i++) { i1 = C_array[i]; P_diag_j[P_diag_i[i1]] = fine_to_coarse[i1]; @@ -1148,9 +1177,9 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, accordingly */ { - pass_length = pass_pointer[2]-pass_pointer[1]; + pass_length = pass_pointer[2] - pass_pointer[1]; #ifdef HYPRE_USING_OPENMP -#pragma omp parallel private(thread_start,thread_stop,my_thread_num,num_threads,P_marker,P_marker_offd,i,i1,sum_C_pos,sum_C_neg,sum_N_pos,sum_N_neg,j_start,j_end,j,k1,cnt,j1,cnt_offd,diagonal,alfa,beta) + #pragma omp parallel private(thread_start,thread_stop,my_thread_num,num_threads,P_marker,P_marker_offd,i,i1,sum_C_pos,sum_C_neg,sum_N_pos,sum_N_neg,j_start,j_end,j,k1,cnt,j1,cnt_offd,diagonal,alfa,beta) #endif { /* Sparsity structure is now finished. Next, calculate interpolation @@ -1158,27 +1187,31 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, * weights only over each thread's range of rows. Rows are divided * up evenly amongst the threads. */ + alfa = beta = 1.0; + P_marker_offd = C_array_offd = NULL; P_marker = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); - for (i=0; i < n_fine; i++) + for (i = 0; i < n_fine; i++) { P_marker[i] = -1; } if (num_cols_offd) { P_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_offd, HYPRE_MEMORY_HOST); - for (i=0; i < num_cols_offd; i++) + for (i = 0; i < num_cols_offd; i++) + { P_marker_offd[i] = -1; + } } /* Compute this thread's range of pass_length */ my_thread_num = hypre_GetThreadNum(); num_threads = hypre_NumActiveThreads(); - thread_start = pass_pointer[1] + (pass_length/num_threads)*my_thread_num; - if (my_thread_num == num_threads-1) + thread_start = pass_pointer[1] + (pass_length / num_threads) * my_thread_num; + if (my_thread_num == num_threads - 1) { thread_stop = pass_pointer[1] + pass_length; } else - { thread_stop = pass_pointer[1] + (pass_length/num_threads)*(my_thread_num+1); } + { thread_stop = pass_pointer[1] + (pass_length / num_threads) * (my_thread_num + 1); } /* determine P for points of pass 1, i.e. neighbors of coarse points */ - for (i=thread_start; i < thread_stop; i++) + for (i = thread_start; i < thread_stop; i++) { i1 = pass_array[i]; sum_C_pos = 0; @@ -1186,76 +1219,100 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, sum_N_pos = 0; sum_N_neg = 0; j_start = P_diag_start[i1]; - j_end = j_start+P_diag_i[i1+1]-P_diag_i[i1]; - for (j=j_start; j < j_end; j++) + j_end = j_start + P_diag_i[i1 + 1] - P_diag_i[i1]; + for (j = j_start; j < j_end; j++) { k1 = P_diag_pass[1][j]; P_marker[C_array[k1]] = i1; } cnt = P_diag_i[i1]; - for (j=A_diag_i[i1]+1; j < A_diag_i[i1+1]; j++) + for (j = A_diag_i[i1] + 1; j < A_diag_i[i1 + 1]; j++) { j1 = A_diag_j[j]; if (CF_marker[j1] != -3 && (num_functions == 1 || dof_func[i1] == dof_func[j1])) { if (A_diag_data[j] < 0) + { sum_N_neg += A_diag_data[j]; + } else + { sum_N_pos += A_diag_data[j]; + } } if (j1 != -1 && P_marker[j1] == i1) { P_diag_data[cnt] = A_diag_data[j]; P_diag_j[cnt++] = fine_to_coarse[j1]; if (A_diag_data[j] < 0) + { sum_C_neg += A_diag_data[j]; + } else + { sum_C_pos += A_diag_data[j]; + } } } j_start = P_offd_start[i1]; - j_end = j_start+P_offd_i[i1+1]-P_offd_i[i1]; - for (j=j_start; j < j_end; j++) + j_end = j_start + P_offd_i[i1 + 1] - P_offd_i[i1]; + for (j = j_start; j < j_end; j++) { k1 = P_offd_pass[1][j]; P_marker_offd[C_array_offd[k1]] = i1; } cnt_offd = P_offd_i[i1]; - for (j=A_offd_i[i1]; j < A_offd_i[i1+1]; j++) + for (j = A_offd_i[i1]; j < A_offd_i[i1 + 1]; j++) { j1 = A_offd_j[j]; if (CF_marker_offd[j1] != -3 && (num_functions == 1 || dof_func[i1] == dof_func_offd[j1])) { if (A_offd_data[j] < 0) + { sum_N_neg += A_offd_data[j]; + } else + { sum_N_pos += A_offd_data[j]; + } } if (j1 != -1 && P_marker_offd[j1] == i1) { P_offd_data[cnt_offd] = A_offd_data[j]; P_offd_j[cnt_offd++] = map_S_to_new[j1]; if (A_offd_data[j] < 0) + { sum_C_neg += A_offd_data[j]; + } else + { sum_C_pos += A_offd_data[j]; + } } } diagonal = A_diag_data[A_diag_i[i1]]; - if (sum_C_neg*diagonal != 0) alfa = -sum_N_neg/(sum_C_neg*diagonal); - if (sum_C_pos*diagonal != 0) beta = -sum_N_pos/(sum_C_pos*diagonal); - for (j=P_diag_i[i1]; j < cnt; j++) + if (sum_C_neg * diagonal != 0) { alfa = -sum_N_neg / (sum_C_neg * diagonal); } + if (sum_C_pos * diagonal != 0) { beta = -sum_N_pos / (sum_C_pos * diagonal); } + for (j = P_diag_i[i1]; j < cnt; j++) if (P_diag_data[j] < 0) + { P_diag_data[j] *= alfa; + } else + { P_diag_data[j] *= beta; - for (j=P_offd_i[i1]; j < cnt_offd; j++) + } + for (j = P_offd_i[i1]; j < cnt_offd; j++) if (P_offd_data[j] < 0) + { P_offd_data[j] *= alfa; + } else + { P_offd_data[j] *= beta; + } } hypre_TFree(P_marker, HYPRE_MEMORY_HOST); @@ -1266,10 +1323,10 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, old_Pext_send_size = 0; old_Pext_recv_size = 0; - if (n_coarse) hypre_TFree(C_array, HYPRE_MEMORY_HOST); + if (n_coarse) { hypre_TFree(C_array, HYPRE_MEMORY_HOST); } hypre_TFree(C_array_offd, HYPRE_MEMORY_HOST); hypre_TFree(P_diag_pass[1], HYPRE_MEMORY_HOST); - if (num_procs > 1) hypre_TFree(P_offd_pass[1], HYPRE_MEMORY_HOST); + if (num_procs > 1) { hypre_TFree(P_offd_pass[1], HYPRE_MEMORY_HOST); } for (pass = 2; pass < num_passes; pass++) @@ -1286,20 +1343,20 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, old_Pext_send_size = Pext_send_size; cnt_offd = 0; - for (i=0; i < num_sends; i++) + for (i = 0; i < num_sends; i++) { - for (j=send_map_start[i]; j < send_map_start[i+1]; j++) + for (j = send_map_start[i]; j < send_map_start[i + 1]; j++) { j1 = send_map_elmt[j]; - if (assigned[j1] == pass-1) + if (assigned[j1] == pass - 1) { j_start = P_diag_i[j1]; - j_end = P_diag_i[j1+1]; - for (k=j_start; k < j_end; k++) + j_end = P_diag_i[j1 + 1]; + for (k = j_start; k < j_end; k++) { Pext_send_data[cnt_offd++] = P_diag_data[k]; } j_start = P_offd_i[j1]; - j_end = P_offd_i[j1+1]; - for (k=j_start; k < j_end; k++) + j_end = P_offd_i[j1 + 1]; + for (k = j_start; k < j_end; k++) { Pext_send_data[cnt_offd++] = P_offd_data[k]; } } } @@ -1329,9 +1386,9 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, hypre_TFree(Pext_recv_vec_start[pass], HYPRE_MEMORY_HOST); } - pass_length = pass_pointer[pass+1]-pass_pointer[pass]; + pass_length = pass_pointer[pass + 1] - pass_pointer[pass]; #ifdef HYPRE_USING_OPENMP -#pragma omp parallel private(thread_start,thread_stop,my_thread_num,num_threads,P_marker,P_marker_offd,i,i1,sum_C_neg,sum_C_pos,sum_N_neg,sum_N_pos,j_start,j_end,cnt,j,k1,cnt_offd,j1,k,alfa,beta,diagonal,C_array,C_array_offd) + #pragma omp parallel private(thread_start,thread_stop,my_thread_num,num_threads,P_marker,P_marker_offd,i,i1,sum_C_neg,sum_C_pos,sum_N_neg,sum_N_pos,j_start,j_end,cnt,j,k1,cnt_offd,j1,k,alfa,beta,diagonal,C_array,C_array_offd) #endif { /* Sparsity structure is now finished. Next, calculate interpolation @@ -1339,14 +1396,18 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, * weights only over each thread's range of rows. Rows are divided * up evenly amongst the threads. */ + alfa = beta = 1.0; + P_marker_offd = NULL; P_marker = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); - for (i=0; i < n_fine; i++) + for (i = 0; i < n_fine; i++) { P_marker[i] = -1; } if (num_cols_offd) { P_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_offd, HYPRE_MEMORY_HOST); - for (i=0; i < num_cols_offd; i++) + for (i = 0; i < num_cols_offd; i++) + { P_marker_offd[i] = -1; + } } C_array = NULL; @@ -1361,14 +1422,14 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, /* Compute this thread's range of pass_length */ my_thread_num = hypre_GetThreadNum(); num_threads = hypre_NumActiveThreads(); - thread_start = pass_pointer[pass] + (pass_length/num_threads)*my_thread_num; - if (my_thread_num == num_threads-1) + thread_start = pass_pointer[pass] + (pass_length / num_threads) * my_thread_num; + if (my_thread_num == num_threads - 1) { thread_stop = pass_pointer[pass] + pass_length; } else - { thread_stop = pass_pointer[pass] + (pass_length/num_threads)*(my_thread_num+1); } + { thread_stop = pass_pointer[pass] + (pass_length / num_threads) * (my_thread_num + 1); } /* Loop over each thread's row-range */ - for (i=thread_start; i < thread_stop; i++) + for (i = thread_start; i < thread_stop; i++) { i1 = pass_array[i]; sum_C_neg = 0; @@ -1376,9 +1437,9 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, sum_N_neg = 0; sum_N_pos = 0; j_start = P_diag_start[i1]; - j_end = j_start+P_diag_i[i1+1]-P_diag_i[i1]; + j_end = j_start + P_diag_i[i1 + 1] - P_diag_i[i1]; cnt = P_diag_i[i1]; - for (j=j_start; j < j_end; j++) + for (j = j_start; j < j_end; j++) { k1 = P_diag_pass[pass][j]; C_array[k1] = cnt; @@ -1386,36 +1447,40 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, P_diag_j[cnt++] = k1; } j_start = P_offd_start[i1]; - j_end = j_start+P_offd_i[i1+1]-P_offd_i[i1]; + j_end = j_start + P_offd_i[i1 + 1] - P_offd_i[i1]; cnt_offd = P_offd_i[i1]; - for (j=j_start; j < j_end; j++) + for (j = j_start; j < j_end; j++) { k1 = P_offd_pass[pass][j]; C_array_offd[k1] = cnt_offd; P_offd_data[cnt_offd] = 0; P_offd_j[cnt_offd++] = k1; } - for (j=S_diag_i[i1]; j < S_diag_i[i1+1]; j++) + for (j = S_diag_i[i1]; j < S_diag_i[i1 + 1]; j++) { j1 = S_diag_j[j]; - if (assigned[j1] == pass-1) + if (assigned[j1] == pass - 1) + { P_marker[j1] = i1; + } } - for (j=S_offd_i[i1]; j < S_offd_i[i1+1]; j++) + for (j = S_offd_i[i1]; j < S_offd_i[i1 + 1]; j++) { j1 = S_offd_j[j]; - if (assigned_offd[j1] == pass-1) + if (assigned_offd[j1] == pass - 1) + { P_marker_offd[j1] = i1; + } } - for (j=A_diag_i[i1]+1; j < A_diag_i[i1+1]; j++) + for (j = A_diag_i[i1] + 1; j < A_diag_i[i1 + 1]; j++) { j1 = A_diag_j[j]; if (P_marker[j1] == i1) { - for (k=P_diag_i[j1]; k < P_diag_i[j1+1]; k++) + for (k = P_diag_i[j1]; k < P_diag_i[j1 + 1]; k++) { k1 = P_diag_j[k]; - alfa = A_diag_data[j]*P_diag_data[k]; + alfa = A_diag_data[j] * P_diag_data[k]; P_diag_data[C_array[k1]] += alfa; if (alfa < 0) { @@ -1428,10 +1493,10 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, sum_N_pos += alfa; } } - for (k=P_offd_i[j1]; k < P_offd_i[j1+1]; k++) + for (k = P_offd_i[j1]; k < P_offd_i[j1 + 1]; k++) { k1 = P_offd_j[k]; - alfa = A_diag_data[j]*P_offd_data[k]; + alfa = A_diag_data[j] * P_offd_data[k]; P_offd_data[C_array_offd[k1]] += alfa; if (alfa < 0) { @@ -1451,28 +1516,36 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, (num_functions == 1 || dof_func[i1] == dof_func[j1])) { if (A_diag_data[j] < 0) + { sum_N_neg += A_diag_data[j]; + } else + { sum_N_pos += A_diag_data[j]; + } } } } - for (j=A_offd_i[i1]; j < A_offd_i[i1+1]; j++) + for (j = A_offd_i[i1]; j < A_offd_i[i1 + 1]; j++) { j1 = A_offd_j[j]; if (j1 > -1 && P_marker_offd[j1] == i1) { j_start = Pext_start[j1]; - j_end = j_start+Pext_i[j1+1]; - for (k=j_start; k < j_end; k++) + j_end = j_start + Pext_i[j1 + 1]; + for (k = j_start; k < j_end; k++) { k1 = Pext_pass[pass][k]; - alfa = A_offd_data[j]*Pext_data[k]; + alfa = A_offd_data[j] * Pext_data[k]; if (k1 < 0) - P_diag_data[C_array[-k1-1]] += alfa; + { + P_diag_data[C_array[-k1 - 1]] += alfa; + } else + { P_offd_data[C_array_offd[k1]] += alfa; + } if (alfa < 0) { sum_C_neg += alfa; @@ -1491,26 +1564,38 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, (num_functions == 1 || dof_func_offd[j1] == dof_func[i1])) { if ( A_offd_data[j] < 0) + { sum_N_neg += A_offd_data[j]; + } else + { sum_N_pos += A_offd_data[j]; + } } } } diagonal = A_diag_data[A_diag_i[i1]]; - if (sum_C_neg*diagonal != 0) alfa = -sum_N_neg/(sum_C_neg*diagonal); - if (sum_C_pos*diagonal != 0) beta = -sum_N_pos/(sum_C_pos*diagonal); + if (sum_C_neg * diagonal != 0) { alfa = -sum_N_neg / (sum_C_neg * diagonal); } + if (sum_C_pos * diagonal != 0) { beta = -sum_N_pos / (sum_C_pos * diagonal); } - for (j=P_diag_i[i1]; j < P_diag_i[i1+1]; j++) + for (j = P_diag_i[i1]; j < P_diag_i[i1 + 1]; j++) if (P_diag_data[j] < 0) + { P_diag_data[j] *= alfa; + } else + { P_diag_data[j] *= beta; - for (j=P_offd_i[i1]; j < P_offd_i[i1+1]; j++) + } + for (j = P_offd_i[i1]; j < P_offd_i[i1 + 1]; j++) if (P_offd_data[j] < 0) + { P_offd_data[j] *= alfa; + } else + { P_offd_data[j] *= beta; + } } hypre_TFree(C_array, HYPRE_MEMORY_HOST); @@ -1532,9 +1617,9 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, else /* no distinction between positive and negative offdiagonal element */ { - pass_length = pass_pointer[2]-pass_pointer[1]; + pass_length = pass_pointer[2] - pass_pointer[1]; #ifdef HYPRE_USING_OPENMP -#pragma omp parallel private(thread_start,thread_stop,my_thread_num,num_threads,k,k1,i,i1,j,j1,sum_C,sum_N,j_start,j_end,cnt,tmp_marker,tmp_marker_offd,cnt_offd,diagonal,alfa) + #pragma omp parallel private(thread_start,thread_stop,my_thread_num,num_threads,k,k1,i,i1,j,j1,sum_C,sum_N,j_start,j_end,cnt,tmp_marker,tmp_marker_offd,cnt_offd,diagonal,alfa) #endif { /* Sparsity structure is now finished. Next, calculate interpolation @@ -1543,46 +1628,49 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, * up evenly amongst the threads. */ /* Initialize thread-wise variables */ + alfa = 1.0; tmp_marker = NULL; if (n_fine) { tmp_marker = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); } tmp_marker_offd = NULL; if (num_cols_offd) { tmp_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_offd, HYPRE_MEMORY_HOST); } - for (i=0; i < n_fine; i++) + for (i = 0; i < n_fine; i++) { tmp_marker[i] = -1; } - for (i=0; i < num_cols_offd; i++) + for (i = 0; i < num_cols_offd; i++) { tmp_marker_offd[i] = -1; } /* Compute this thread's range of pass_length */ my_thread_num = hypre_GetThreadNum(); num_threads = hypre_NumActiveThreads(); - thread_start = pass_pointer[1] + (pass_length/num_threads)*my_thread_num; - if (my_thread_num == num_threads-1) + thread_start = pass_pointer[1] + (pass_length / num_threads) * my_thread_num; + if (my_thread_num == num_threads - 1) { thread_stop = pass_pointer[1] + pass_length; } else - { thread_stop = pass_pointer[1] + (pass_length/num_threads)*(my_thread_num+1); } + { thread_stop = pass_pointer[1] + (pass_length / num_threads) * (my_thread_num + 1); } /* determine P for points of pass 1, i.e. neighbors of coarse points */ - for (i=thread_start; i < thread_stop; i++) + for (i = thread_start; i < thread_stop; i++) { i1 = pass_array[i]; sum_C = 0; sum_N = 0; j_start = P_diag_start[i1]; - j_end = j_start+P_diag_i[i1+1]-P_diag_i[i1]; - for (j=j_start; j < j_end; j++) + j_end = j_start + P_diag_i[i1 + 1] - P_diag_i[i1]; + for (j = j_start; j < j_end; j++) { k1 = P_diag_pass[1][j]; tmp_marker[C_array[k1]] = i1; } cnt = P_diag_i[i1]; - for (j=A_diag_i[i1]+1; j < A_diag_i[i1+1]; j++) + for (j = A_diag_i[i1] + 1; j < A_diag_i[i1 + 1]; j++) { j1 = A_diag_j[j]; if (CF_marker[j1] != -3 && (num_functions == 1 || dof_func[i1] == dof_func[j1])) + { sum_N += A_diag_data[j]; + } if (j1 != -1 && tmp_marker[j1] == i1) { P_diag_data[cnt] = A_diag_data[j]; @@ -1591,19 +1679,21 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, } } j_start = P_offd_start[i1]; - j_end = j_start+P_offd_i[i1+1]-P_offd_i[i1]; - for (j=j_start; j < j_end; j++) + j_end = j_start + P_offd_i[i1 + 1] - P_offd_i[i1]; + for (j = j_start; j < j_end; j++) { k1 = P_offd_pass[1][j]; tmp_marker_offd[C_array_offd[k1]] = i1; } cnt_offd = P_offd_i[i1]; - for (j=A_offd_i[i1]; j < A_offd_i[i1+1]; j++) + for (j = A_offd_i[i1]; j < A_offd_i[i1 + 1]; j++) { j1 = A_offd_j[j]; if (CF_marker_offd[j1] != -3 && (num_functions == 1 || dof_func[i1] == dof_func_offd[j1])) + { sum_N += A_offd_data[j]; + } if (j1 != -1 && tmp_marker_offd[j1] == i1) { P_offd_data[cnt_offd] = A_offd_data[j]; @@ -1612,11 +1702,15 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, } } diagonal = A_diag_data[A_diag_i[i1]]; - if (sum_C*diagonal != 0) alfa = -sum_N/(sum_C*diagonal); - for (j=P_diag_i[i1]; j < cnt; j++) + if (sum_C * diagonal != 0) { alfa = -sum_N / (sum_C * diagonal); } + for (j = P_diag_i[i1]; j < cnt; j++) + { P_diag_data[j] *= alfa; - for (j=P_offd_i[i1]; j < cnt_offd; j++) + } + for (j = P_offd_i[i1]; j < cnt_offd; j++) + { P_offd_data[j] *= alfa; + } } hypre_TFree(tmp_marker, HYPRE_MEMORY_HOST); hypre_TFree(tmp_marker_offd, HYPRE_MEMORY_HOST); @@ -1625,10 +1719,10 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, old_Pext_send_size = 0; old_Pext_recv_size = 0; - if (n_coarse) hypre_TFree(C_array, HYPRE_MEMORY_HOST); + if (n_coarse) { hypre_TFree(C_array, HYPRE_MEMORY_HOST); } hypre_TFree(C_array_offd, HYPRE_MEMORY_HOST); hypre_TFree(P_diag_pass[1], HYPRE_MEMORY_HOST); - if (num_procs > 1) hypre_TFree(P_offd_pass[1], HYPRE_MEMORY_HOST); + if (num_procs > 1) { hypre_TFree(P_offd_pass[1], HYPRE_MEMORY_HOST); } for (pass = 2; pass < num_passes; pass++) { @@ -1644,22 +1738,22 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, old_Pext_send_size = Pext_send_size; cnt_offd = 0; - for (i=0; i < num_sends; i++) + for (i = 0; i < num_sends; i++) { - for (j=send_map_start[i]; j < send_map_start[i+1]; j++) + for (j = send_map_start[i]; j < send_map_start[i + 1]; j++) { j1 = send_map_elmt[j]; - if (assigned[j1] == pass-1) + if (assigned[j1] == pass - 1) { j_start = P_diag_i[j1]; - j_end = P_diag_i[j1+1]; - for (k=j_start; k < j_end; k++) + j_end = P_diag_i[j1 + 1]; + for (k = j_start; k < j_end; k++) { Pext_send_data[cnt_offd++] = P_diag_data[k]; } j_start = P_offd_i[j1]; - j_end = P_offd_i[j1+1]; - for (k=j_start; k < j_end; k++) + j_end = P_offd_i[j1 + 1]; + for (k = j_start; k < j_end; k++) { Pext_send_data[cnt_offd++] = P_offd_data[k]; } @@ -1691,9 +1785,9 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, hypre_TFree(Pext_recv_vec_start[pass], HYPRE_MEMORY_HOST); } - pass_length = pass_pointer[pass+1]-pass_pointer[pass]; + pass_length = pass_pointer[pass + 1] - pass_pointer[pass]; #ifdef HYPRE_USING_OPENMP -#pragma omp parallel private(thread_start,thread_stop,my_thread_num,num_threads,k,k1,i,i1,j,j1,sum_C,sum_N,j_start,j_end,cnt,tmp_marker,tmp_marker_offd,cnt_offd,diagonal,alfa,tmp_array,tmp_array_offd) + #pragma omp parallel private(thread_start,thread_stop,my_thread_num,num_threads,k,k1,i,i1,j,j1,sum_C,sum_N,j_start,j_end,cnt,tmp_marker,tmp_marker_offd,cnt_offd,diagonal,alfa,tmp_array,tmp_array_offd) #endif { /* Sparsity structure is now finished. Next, calculate interpolation @@ -1702,6 +1796,7 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, * up evenly amongst the threads. */ /* Initialize thread-wise variables */ + alfa = beta = 1.0; tmp_marker = NULL; if (n_fine) { tmp_marker = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); } @@ -1716,29 +1811,29 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, { tmp_array_offd = hypre_CTAlloc(HYPRE_Int, new_num_cols_offd, HYPRE_MEMORY_HOST); } else { tmp_array_offd = hypre_CTAlloc(HYPRE_Int, n_coarse_offd, HYPRE_MEMORY_HOST);} - for (i=0; i < n_fine; i++) + for (i = 0; i < n_fine; i++) { tmp_marker[i] = -1; } - for (i=0; i < num_cols_offd; i++) + for (i = 0; i < num_cols_offd; i++) { tmp_marker_offd[i] = -1; } /* Compute this thread's range of pass_length */ my_thread_num = hypre_GetThreadNum(); num_threads = hypre_NumActiveThreads(); - thread_start = pass_pointer[pass] + (pass_length/num_threads)*my_thread_num; - if (my_thread_num == num_threads-1) + thread_start = pass_pointer[pass] + (pass_length / num_threads) * my_thread_num; + if (my_thread_num == num_threads - 1) { thread_stop = pass_pointer[pass] + pass_length; } else - { thread_stop = pass_pointer[pass] + (pass_length/num_threads)*(my_thread_num+1); } + { thread_stop = pass_pointer[pass] + (pass_length / num_threads) * (my_thread_num + 1); } - for (i=thread_start; i < thread_stop; i++) + for (i = thread_start; i < thread_stop; i++) { i1 = pass_array[i]; sum_C = 0; sum_N = 0; j_start = P_diag_start[i1]; - j_end = j_start+P_diag_i[i1+1]-P_diag_i[i1]; + j_end = j_start + P_diag_i[i1 + 1] - P_diag_i[i1]; cnt = P_diag_i[i1]; - for (j=j_start; j < j_end; j++) + for (j = j_start; j < j_end; j++) { k1 = P_diag_pass[pass][j]; tmp_array[k1] = cnt; @@ -1746,44 +1841,48 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, P_diag_j[cnt++] = k1; } j_start = P_offd_start[i1]; - j_end = j_start+P_offd_i[i1+1]-P_offd_i[i1]; + j_end = j_start + P_offd_i[i1 + 1] - P_offd_i[i1]; cnt_offd = P_offd_i[i1]; - for (j=j_start; j < j_end; j++) + for (j = j_start; j < j_end; j++) { k1 = P_offd_pass[pass][j]; tmp_array_offd[k1] = cnt_offd; P_offd_data[cnt_offd] = 0; P_offd_j[cnt_offd++] = k1; } - for (j=S_diag_i[i1]; j < S_diag_i[i1+1]; j++) + for (j = S_diag_i[i1]; j < S_diag_i[i1 + 1]; j++) { j1 = S_diag_j[j]; - if (assigned[j1] == pass-1) + if (assigned[j1] == pass - 1) + { tmp_marker[j1] = i1; + } } - for (j=S_offd_i[i1]; j < S_offd_i[i1+1]; j++) + for (j = S_offd_i[i1]; j < S_offd_i[i1 + 1]; j++) { j1 = S_offd_j[j]; - if (assigned_offd[j1] == pass-1) + if (assigned_offd[j1] == pass - 1) + { tmp_marker_offd[j1] = i1; + } } - for (j=A_diag_i[i1]+1; j < A_diag_i[i1+1]; j++) + for (j = A_diag_i[i1] + 1; j < A_diag_i[i1 + 1]; j++) { j1 = A_diag_j[j]; if (tmp_marker[j1] == i1) { - for (k=P_diag_i[j1]; k < P_diag_i[j1+1]; k++) + for (k = P_diag_i[j1]; k < P_diag_i[j1 + 1]; k++) { k1 = P_diag_j[k]; - alfa = A_diag_data[j]*P_diag_data[k]; + alfa = A_diag_data[j] * P_diag_data[k]; P_diag_data[tmp_array[k1]] += alfa; sum_C += alfa; sum_N += alfa; } - for (k=P_offd_i[j1]; k < P_offd_i[j1+1]; k++) + for (k = P_offd_i[j1]; k < P_offd_i[j1 + 1]; k++) { k1 = P_offd_j[k]; - alfa = A_diag_data[j]*P_offd_data[k]; + alfa = A_diag_data[j] * P_offd_data[k]; P_offd_data[tmp_array_offd[k1]] += alfa; sum_C += alfa; sum_N += alfa; @@ -1793,25 +1892,31 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, { if (CF_marker[j1] != -3 && (num_functions == 1 || dof_func[i1] == dof_func[j1])) + { sum_N += A_diag_data[j]; + } } } - for (j=A_offd_i[i1]; j < A_offd_i[i1+1]; j++) + for (j = A_offd_i[i1]; j < A_offd_i[i1 + 1]; j++) { j1 = A_offd_j[j]; if (j1 > -1 && tmp_marker_offd[j1] == i1) { j_start = Pext_start[j1]; - j_end = j_start+Pext_i[j1+1]; - for (k=j_start; k < j_end; k++) + j_end = j_start + Pext_i[j1 + 1]; + for (k = j_start; k < j_end; k++) { k1 = Pext_pass[pass][k]; - alfa = A_offd_data[j]*Pext_data[k]; + alfa = A_offd_data[j] * Pext_data[k]; if (k1 < 0) - P_diag_data[tmp_array[-k1-1]] += alfa; + { + P_diag_data[tmp_array[-k1 - 1]] += alfa; + } else + { P_offd_data[tmp_array_offd[k1]] += alfa; + } sum_C += alfa; sum_N += alfa; } @@ -1820,16 +1925,22 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, { if (CF_marker_offd[j1] != -3 && (num_functions == 1 || dof_func_offd[j1] == dof_func[i1])) + { sum_N += A_offd_data[j]; + } } } diagonal = A_diag_data[A_diag_i[i1]]; - if (sum_C*diagonal != 0.0) alfa = -sum_N/(sum_C*diagonal); + if (sum_C * diagonal != 0.0) { alfa = -sum_N / (sum_C * diagonal); } - for (j=P_diag_i[i1]; j < P_diag_i[i1+1]; j++) + for (j = P_diag_i[i1]; j < P_diag_i[i1 + 1]; j++) + { P_diag_data[j] *= alfa; - for (j=P_offd_i[i1]; j < P_offd_i[i1+1]; j++) + } + for (j = P_offd_i[i1]; j < P_offd_i[i1 + 1]; j++) + { P_offd_data[j] *= alfa; + } } hypre_TFree(tmp_marker, HYPRE_MEMORY_HOST); hypre_TFree(tmp_marker_offd, HYPRE_MEMORY_HOST); @@ -1865,7 +1976,7 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, hypre_TFree(pass_pointer, HYPRE_MEMORY_HOST); hypre_TFree(pass_array, HYPRE_MEMORY_HOST); hypre_TFree(map_S_to_new, HYPRE_MEMORY_HOST); - if (num_procs > 1) hypre_TFree(tmp_comm_pkg, HYPRE_MEMORY_HOST); + if (num_procs > 1) { hypre_TFree(tmp_comm_pkg, HYPRE_MEMORY_HOST); } P = hypre_ParCSRMatrixCreate(comm, hypre_ParCSRMatrixGlobalNumRows(A), @@ -1907,13 +2018,13 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, else { P_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_offd, HYPRE_MEMORY_HOST); } #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i=0; i < new_num_cols_offd; i++) + for (i = 0; i < new_num_cols_offd; i++) { P_marker_offd[i] = 0; } num_cols_offd_P = 0; - for (i=0; i < P_offd_size; i++) + for (i = 0; i < P_offd_size; i++) { index = P_offd_j[i]; if (!P_marker_offd[index]) @@ -1924,52 +2035,58 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, } col_map_offd_P = hypre_CTAlloc(HYPRE_BigInt, num_cols_offd_P, HYPRE_MEMORY_HOST); - permute = hypre_CTAlloc(HYPRE_Int, new_counter[num_passes-1], HYPRE_MEMORY_HOST); - big_permute = hypre_CTAlloc(HYPRE_BigInt, new_counter[num_passes-1], HYPRE_MEMORY_HOST); + permute = hypre_CTAlloc(HYPRE_Int, new_counter[num_passes - 1], HYPRE_MEMORY_HOST); + big_permute = hypre_CTAlloc(HYPRE_BigInt, new_counter[num_passes - 1], HYPRE_MEMORY_HOST); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i=0; i < new_counter[num_passes-1]; i++) + for (i = 0; i < new_counter[num_passes - 1]; i++) + { big_permute[i] = -1; + } cnt = 0; - for (i=0; i < num_passes-1; i++) + for (i = 0; i < num_passes - 1; i++) { - for (j=new_counter[i]; j < new_counter[i+1]; j++) + for (j = new_counter[i]; j < new_counter[i + 1]; j++) { if (P_marker_offd[j]) { - col_map_offd_P[cnt] = new_elmts[i][j-(HYPRE_BigInt)new_counter[i]]; + col_map_offd_P[cnt] = new_elmts[i][j - (HYPRE_BigInt)new_counter[i]]; big_permute[j] = col_map_offd_P[cnt++]; } } } - hypre_BigQsort0(col_map_offd_P,0,num_cols_offd_P-1); + hypre_BigQsort0(col_map_offd_P, 0, num_cols_offd_P - 1); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,big_k1) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,big_k1) HYPRE_SMP_SCHEDULE #endif - for (i=0; i < new_counter[num_passes-1]; i++) + for (i = 0; i < new_counter[num_passes - 1]; i++) { big_k1 = big_permute[i]; if (big_k1 != -1) - permute[i] = hypre_BigBinarySearch(col_map_offd_P,big_k1,num_cols_offd_P); + { + permute[i] = hypre_BigBinarySearch(col_map_offd_P, big_k1, num_cols_offd_P); + } } #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i=0; i < P_offd_size; i++) + for (i = 0; i < P_offd_size; i++) { P_offd_j[i] = permute[P_offd_j[i]]; } hypre_TFree(P_marker_offd, HYPRE_MEMORY_HOST); } if (num_procs > 1) { - for (i=0; i < num_passes-1; i++) + for (i = 0; i < num_passes - 1; i++) + { hypre_TFree(new_elmts[i], HYPRE_MEMORY_HOST); + } } hypre_TFree(permute, HYPRE_MEMORY_HOST); hypre_TFree(big_permute, HYPRE_MEMORY_HOST); @@ -1985,10 +2102,10 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, if (n_SF) { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i=0; i < n_fine; i++) - if (CF_marker[i] == -3) CF_marker[i] = -1; + for (i = 0; i < n_fine; i++) + if (CF_marker[i] == -3) { CF_marker[i] = -1; } } if (num_procs > 1) @@ -2013,5 +2130,47 @@ hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, hypre_profile_times[HYPRE_TIMER_ID_MULTIPASS_INTERP] += hypre_MPI_Wtime(); #endif - return(0); + return (0); +} + +HYPRE_Int +hypre_BoomerAMGBuildMultipass( hypre_ParCSRMatrix *A, + HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, + HYPRE_BigInt *num_cpts_global, + HYPRE_Int num_functions, + HYPRE_Int *dof_func, + HYPRE_Int debug_flag, + HYPRE_Real trunc_factor, + HYPRE_Int P_max_elmts, + HYPRE_Int weight_option, + hypre_ParCSRMatrix **P_ptr ) +{ + hypre_GpuProfilingPushRange("MultipassInterp"); + + HYPRE_Int ierr = 0; + +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy2( hypre_ParCSRMatrixMemoryLocation(A), + hypre_ParCSRMatrixMemoryLocation(S) ); + if (exec == HYPRE_EXEC_DEVICE) + { + /* Notice: call the mod version on GPUs */ + ierr = hypre_BoomerAMGBuildModMultipassDevice( A, CF_marker, S, num_cpts_global, + trunc_factor, P_max_elmts, 9, + num_functions, dof_func, + P_ptr ); + } + else +#endif + { + ierr = hypre_BoomerAMGBuildMultipassHost( A, CF_marker, S, num_cpts_global, + num_functions, dof_func, debug_flag, + trunc_factor, P_max_elmts, weight_option, + P_ptr ); + } + + hypre_GpuProfilingPopRange(); + + return ierr; } diff --git a/external/hypre/src/parcsr_ls/par_nodal_systems.c b/external/hypre/src/parcsr_ls/par_nodal_systems.c index 1c302e2f..12c517a3 100644 --- a/external/hypre/src/parcsr_ls/par_nodal_systems.c +++ b/external/hypre/src/parcsr_ls/par_nodal_systems.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -43,6 +43,8 @@ hypre_BoomerAMGCreateNodalA(hypre_ParCSRMatrix *A, HYPRE_Int diag_option, hypre_ParCSRMatrix **AN_ptr) { + HYPRE_UNUSED_VAR(dof_func); + MPI_Comm comm = hypre_ParCSRMatrixComm(A); hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); @@ -69,31 +71,31 @@ hypre_BoomerAMGCreateNodalA(hypre_ParCSRMatrix *A, hypre_CSRMatrix *AN_offd; HYPRE_Int *AN_offd_i; HYPRE_Int *AN_offd_j; - HYPRE_Real *AN_offd_data; + HYPRE_Real *AN_offd_data = NULL; HYPRE_BigInt *col_map_offd_AN; HYPRE_BigInt *new_col_map_offd; - HYPRE_BigInt *row_starts_AN; + HYPRE_BigInt row_starts_AN[2]; HYPRE_Int AN_num_nonzeros_diag = 0; HYPRE_Int AN_num_nonzeros_offd = 0; HYPRE_Int num_cols_offd_AN; HYPRE_Int new_num_cols_offd; hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); - HYPRE_Int num_sends; - HYPRE_Int num_recvs; + HYPRE_Int num_sends = 0; + HYPRE_Int num_recvs = 0; HYPRE_Int *send_procs; - HYPRE_Int *send_map_starts; - HYPRE_Int *send_map_elmts = NULL; + HYPRE_Int *send_map_starts = NULL; + HYPRE_Int *send_map_elmts = NULL; HYPRE_Int *new_send_map_elmts; HYPRE_Int *recv_procs; - HYPRE_Int *recv_vec_starts; + HYPRE_Int *recv_vec_starts = NULL; hypre_ParCSRCommPkg *comm_pkg_AN; HYPRE_Int *send_procs_AN; - HYPRE_Int *send_map_starts_AN; - HYPRE_Int *send_map_elmts_AN; + HYPRE_Int *send_map_starts_AN = NULL; + HYPRE_Int *send_map_elmts_AN = NULL; HYPRE_Int *recv_procs_AN; - HYPRE_Int *recv_vec_starts_AN; + HYPRE_Int *recv_vec_starts_AN = NULL; HYPRE_Int i, j, k, k_map; @@ -110,7 +112,7 @@ hypre_BoomerAMGCreateNodalA(hypre_ParCSRMatrix *A, HYPRE_Int num_fun2; HYPRE_BigInt *big_map_to_node = NULL; HYPRE_Int *map_to_node; - HYPRE_Int *map_to_map; + HYPRE_Int *map_to_map = NULL; HYPRE_Int *counter; HYPRE_Real sum; @@ -118,7 +120,7 @@ hypre_BoomerAMGCreateNodalA(hypre_ParCSRMatrix *A, HYPRE_MemoryLocation memory_location = hypre_ParCSRMatrixMemoryLocation(A); - hypre_MPI_Comm_size(comm,&num_procs); + hypre_MPI_Comm_size(comm, &num_procs); if (!comm_pkg) { @@ -131,14 +133,12 @@ hypre_BoomerAMGCreateNodalA(hypre_ParCSRMatrix *A, comm_pkg_AN = NULL; col_map_offd_AN = NULL; - row_starts_AN = hypre_CTAlloc(HYPRE_BigInt, 2, HYPRE_MEMORY_HOST); - for (i = 0; i < 2; i++) { row_starts_AN[i] = row_starts[i] / (HYPRE_BigInt)num_functions; - if (row_starts_AN[i]*(HYPRE_BigInt)num_functions < row_starts[i]) + if (row_starts_AN[i] * (HYPRE_BigInt)num_functions < row_starts[i]) { - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"nodes not properly aligned or incomplete info!\n"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "nodes not properly aligned or incomplete info!\n"); return hypre_error_flag; } } @@ -149,7 +149,7 @@ hypre_BoomerAMGCreateNodalA(hypre_ParCSRMatrix *A, num_fun2 = num_functions * num_functions; map_to_node = hypre_CTAlloc(HYPRE_Int, num_variables, HYPRE_MEMORY_HOST); - AN_diag_i = hypre_CTAlloc(HYPRE_Int, num_nodes+1, memory_location); + AN_diag_i = hypre_CTAlloc(HYPRE_Int, num_nodes + 1, memory_location); counter = hypre_CTAlloc(HYPRE_Int, num_nodes, HYPRE_MEMORY_HOST); for (i = 0; i < num_variables; i++) { @@ -167,7 +167,7 @@ hypre_BoomerAMGCreateNodalA(hypre_ParCSRMatrix *A, AN_diag_i[i] = AN_num_nonzeros_diag; for (j = 0; j < num_functions; j++) { - for (k = A_diag_i[row]; k < A_diag_i[row+1]; k++) + for (k = A_diag_i[row]; k < A_diag_i[row + 1]; k++) { k_map = map_to_node[A_diag_j[k]]; if (counter[k_map] < i) @@ -189,7 +189,7 @@ hypre_BoomerAMGCreateNodalA(hypre_ParCSRMatrix *A, hypre_CSRMatrixJ(AN_diag) = AN_diag_j; hypre_CSRMatrixData(AN_diag) = AN_diag_data; - for (i=0; i < num_nodes; i++) + for (i = 0; i < num_nodes; i++) { counter[i] = -1; } @@ -201,74 +201,78 @@ hypre_BoomerAMGCreateNodalA(hypre_ParCSRMatrix *A, { case 1: /* frobenius norm */ { - for (i=0; i < num_nodes; i++) + for (i = 0; i < num_nodes; i++) { - for (j=0; j < num_functions; j++) + for (j = 0; j < num_functions; j++) { - for (k=A_diag_i[row]; k < A_diag_i[row+1]; k++) + for (k = A_diag_i[row]; k < A_diag_i[row + 1]; k++) { k_map = map_to_node[A_diag_j[k]]; if (counter[k_map] < start_index) { counter[k_map] = index; AN_diag_j[index] = k_map; - AN_diag_data[index] = A_diag_data[k]*A_diag_data[k]; + AN_diag_data[index] = A_diag_data[k] * A_diag_data[k]; index++; } else { AN_diag_data[counter[k_map]] += - A_diag_data[k]*A_diag_data[k]; + A_diag_data[k] * A_diag_data[k]; } } row++; } start_index = index; } - for (i=0; i < AN_num_nonzeros_diag; i++) - AN_diag_data[i] = sqrt(AN_diag_data[i]); + for (i = 0; i < AN_num_nonzeros_diag; i++) + { + AN_diag_data[i] = hypre_sqrt(AN_diag_data[i]); + } } break; case 2: /* sum of abs. value of all elements in each block */ { - for (i=0; i < num_nodes; i++) + for (i = 0; i < num_nodes; i++) { - for (j=0; j < num_functions; j++) + for (j = 0; j < num_functions; j++) { - for (k=A_diag_i[row]; k < A_diag_i[row+1]; k++) + for (k = A_diag_i[row]; k < A_diag_i[row + 1]; k++) { k_map = map_to_node[A_diag_j[k]]; if (counter[k_map] < start_index) { counter[k_map] = index; AN_diag_j[index] = k_map; - AN_diag_data[index] = fabs(A_diag_data[k]); + AN_diag_data[index] = hypre_abs(A_diag_data[k]); index++; } else { - AN_diag_data[counter[k_map]] += fabs(A_diag_data[k]); + AN_diag_data[counter[k_map]] += hypre_abs(A_diag_data[k]); } } row++; } start_index = index; } - for (i=0; i < AN_num_nonzeros_diag; i++) + for (i = 0; i < AN_num_nonzeros_diag; i++) + { AN_diag_data[i] /= num_fun2; + } } break; case 3: /* largest element of each block (sets true value - not abs. value) */ { - for (i=0; i < num_nodes; i++) + for (i = 0; i < num_nodes; i++) { - for (j=0; j < num_functions; j++) + for (j = 0; j < num_functions; j++) { - for (k=A_diag_i[row]; k < A_diag_i[row+1]; k++) + for (k = A_diag_i[row]; k < A_diag_i[row + 1]; k++) { k_map = map_to_node[A_diag_j[k]]; if (counter[k_map] < start_index) @@ -280,9 +284,11 @@ hypre_BoomerAMGCreateNodalA(hypre_ParCSRMatrix *A, } else { - if (fabs(A_diag_data[k]) > - fabs(AN_diag_data[counter[k_map]])) + if (hypre_abs(A_diag_data[k]) > + hypre_abs(AN_diag_data[counter[k_map]])) + { AN_diag_data[counter[k_map]] = A_diag_data[k]; + } } } row++; @@ -295,38 +301,38 @@ hypre_BoomerAMGCreateNodalA(hypre_ParCSRMatrix *A, case 4: /* inf. norm (row-sum) */ { - data = hypre_CTAlloc(HYPRE_Real, AN_num_nonzeros_diag*num_functions, HYPRE_MEMORY_HOST); + data = hypre_CTAlloc(HYPRE_Real, AN_num_nonzeros_diag * num_functions, HYPRE_MEMORY_HOST); - for (i=0; i < num_nodes; i++) + for (i = 0; i < num_nodes; i++) { - for (j=0; j < num_functions; j++) + for (j = 0; j < num_functions; j++) { - for (k=A_diag_i[row]; k < A_diag_i[row+1]; k++) + for (k = A_diag_i[row]; k < A_diag_i[row + 1]; k++) { k_map = map_to_node[A_diag_j[k]]; if (counter[k_map] < start_index) { counter[k_map] = index; AN_diag_j[index] = k_map; - data[index*num_functions + j] = fabs(A_diag_data[k]); + data[index * num_functions + j] = hypre_abs(A_diag_data[k]); index++; } else { - data[(counter[k_map])*num_functions + j] += fabs(A_diag_data[k]); + data[(counter[k_map])*num_functions + j] += hypre_abs(A_diag_data[k]); } } row++; } start_index = index; } - for (i=0; i < AN_num_nonzeros_diag; i++) + for (i = 0; i < AN_num_nonzeros_diag; i++) { - AN_diag_data[i] = data[i*num_functions]; + AN_diag_data[i] = data[i * num_functions]; - for (j=1; j< num_functions; j++) + for (j = 1; j < num_functions; j++) { - AN_diag_data[i] = hypre_max( AN_diag_data[i],data[i*num_functions+j]); + AN_diag_data[i] = hypre_max( AN_diag_data[i], data[i * num_functions + j]); } } hypre_TFree(data, HYPRE_MEMORY_HOST); @@ -336,11 +342,11 @@ hypre_BoomerAMGCreateNodalA(hypre_ParCSRMatrix *A, case 6: /* sum of all elements in each block */ { - for (i=0; i < num_nodes; i++) + for (i = 0; i < num_nodes; i++) { - for (j=0; j < num_functions; j++) + for (j = 0; j < num_functions; j++) { - for (k=A_diag_i[row]; k < A_diag_i[row+1]; k++) + for (k = A_diag_i[row]; k < A_diag_i[row + 1]; k++) { k_map = map_to_node[A_diag_j[k]]; if (counter[k_map] < start_index) @@ -364,14 +370,14 @@ hypre_BoomerAMGCreateNodalA(hypre_ParCSRMatrix *A, } - if (diag_option ==1 ) + if (diag_option == 1 ) { /* make the diag entry the negative of the sum of off-diag entries (DO MORE BELOW) */ - for (i=0; i < num_nodes; i++) + for (i = 0; i < num_nodes; i++) { index = AN_diag_i[i]; sum = 0.0; - for (k = AN_diag_i[i]+1; k < AN_diag_i[i+1]; k++) + for (k = AN_diag_i[i] + 1; k < AN_diag_i[i + 1]; k++) { sum += AN_diag_data[k]; @@ -386,7 +392,7 @@ hypre_BoomerAMGCreateNodalA(hypre_ParCSRMatrix *A, /* make all diagonal entries negative */ /* the diagonal is the first element listed in each row - */ - for (i=0; i < num_nodes; i++) + for (i = 0; i < num_nodes; i++) { index = AN_diag_i[i]; AN_diag_data[index] = - AN_diag_data[index]; @@ -394,23 +400,20 @@ hypre_BoomerAMGCreateNodalA(hypre_ParCSRMatrix *A, } num_nonzeros_offd = A_offd_i[num_variables]; - AN_offd_i = hypre_CTAlloc(HYPRE_Int, num_nodes+1, memory_location); + AN_offd_i = hypre_CTAlloc(HYPRE_Int, num_nodes + 1, memory_location); num_cols_offd_AN = 0; if (comm_pkg) { - comm_pkg_AN = hypre_CTAlloc(hypre_ParCSRCommPkg, 1, HYPRE_MEMORY_HOST); - hypre_ParCSRCommPkgComm(comm_pkg_AN) = comm; num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - hypre_ParCSRCommPkgNumSends(comm_pkg_AN) = num_sends; num_recvs = hypre_ParCSRCommPkgNumRecvs(comm_pkg); - hypre_ParCSRCommPkgNumRecvs(comm_pkg_AN) = num_recvs; send_procs = hypre_ParCSRCommPkgSendProcs(comm_pkg); send_map_starts = hypre_ParCSRCommPkgSendMapStarts(comm_pkg); send_map_elmts = hypre_ParCSRCommPkgSendMapElmts(comm_pkg); recv_procs = hypre_ParCSRCommPkgRecvProcs(comm_pkg); recv_vec_starts = hypre_ParCSRCommPkgRecvVecStarts(comm_pkg); + send_procs_AN = NULL; send_map_elmts_AN = NULL; if (num_sends) @@ -418,35 +421,45 @@ hypre_BoomerAMGCreateNodalA(hypre_ParCSRMatrix *A, send_procs_AN = hypre_CTAlloc(HYPRE_Int, num_sends, HYPRE_MEMORY_HOST); send_map_elmts_AN = hypre_CTAlloc(HYPRE_Int, send_map_starts[num_sends], HYPRE_MEMORY_HOST); } - send_map_starts_AN = hypre_CTAlloc(HYPRE_Int, num_sends+1, HYPRE_MEMORY_HOST); - recv_vec_starts_AN = hypre_CTAlloc(HYPRE_Int, num_recvs+1, HYPRE_MEMORY_HOST); + send_map_starts_AN = hypre_CTAlloc(HYPRE_Int, num_sends + 1, HYPRE_MEMORY_HOST); + recv_vec_starts_AN = hypre_CTAlloc(HYPRE_Int, num_recvs + 1, HYPRE_MEMORY_HOST); recv_procs_AN = NULL; - if (num_recvs) recv_procs_AN = hypre_CTAlloc(HYPRE_Int, num_recvs, HYPRE_MEMORY_HOST); - for (i=0; i < num_sends; i++) + if (num_recvs) { recv_procs_AN = hypre_CTAlloc(HYPRE_Int, num_recvs, HYPRE_MEMORY_HOST); } + for (i = 0; i < num_sends; i++) + { send_procs_AN[i] = send_procs[i]; - for (i=0; i < num_recvs; i++) + } + for (i = 0; i < num_recvs; i++) + { recv_procs_AN[i] = recv_procs[i]; + } send_map_starts_AN[0] = 0; cnt = 0; - for (i=0; i < num_sends; i++) + for (i = 0; i < num_sends; i++) { k_map = send_map_starts[i]; - if (send_map_starts[i+1]-k_map) - send_map_elmts_AN[cnt++] = send_map_elmts[k_map]/num_functions; - for (j=send_map_starts[i]+1; j < send_map_starts[i+1]; j++) + if (send_map_starts[i + 1] - k_map) { - node = send_map_elmts[j]/num_functions; - if (node > send_map_elmts_AN[cnt-1]) + send_map_elmts_AN[cnt++] = send_map_elmts[k_map] / num_functions; + } + for (j = send_map_starts[i] + 1; j < send_map_starts[i + 1]; j++) + { + node = send_map_elmts[j] / num_functions; + if (node > send_map_elmts_AN[cnt - 1]) + { send_map_elmts_AN[cnt++] = node; + } } - send_map_starts_AN[i+1] = cnt; + send_map_starts_AN[i + 1] = cnt; } - hypre_ParCSRCommPkgSendProcs(comm_pkg_AN) = send_procs_AN; - hypre_ParCSRCommPkgSendMapStarts(comm_pkg_AN) = send_map_starts_AN; - hypre_ParCSRCommPkgSendMapElmts(comm_pkg_AN) = send_map_elmts_AN; - hypre_ParCSRCommPkgRecvProcs(comm_pkg_AN) = recv_procs_AN; - hypre_ParCSRCommPkgRecvVecStarts(comm_pkg_AN) = recv_vec_starts_AN; + + /* Create communication package */ + hypre_ParCSRCommPkgCreateAndFill(comm, + num_recvs, recv_procs_AN, recv_vec_starts_AN, + num_sends, send_procs_AN, send_map_starts_AN, + send_map_elmts_AN, + &comm_pkg_AN); } hypre_TFree(map_to_node, HYPRE_MEMORY_HOST); @@ -456,11 +469,11 @@ hypre_BoomerAMGCreateNodalA(hypre_ParCSRMatrix *A, big_map_to_node = hypre_CTAlloc(HYPRE_BigInt, num_cols_offd, HYPRE_MEMORY_HOST); num_cols_offd_AN = 1; - big_map_to_node[0] = col_map_offd[0]/(HYPRE_BigInt)num_functions; - for (i=1; i < num_cols_offd; i++) + big_map_to_node[0] = col_map_offd[0] / (HYPRE_BigInt)num_functions; + for (i = 1; i < num_cols_offd; i++) { - big_map_to_node[i] = col_map_offd[i]/(HYPRE_BigInt)num_functions; - if (big_map_to_node[i] > big_map_to_node[i-1]) num_cols_offd_AN++; + big_map_to_node[i] = col_map_offd[i] / (HYPRE_BigInt)num_functions; + if (big_map_to_node[i] > big_map_to_node[i - 1]) { num_cols_offd_AN++; } } if (num_cols_offd_AN > num_nodes) @@ -469,38 +482,38 @@ hypre_BoomerAMGCreateNodalA(hypre_ParCSRMatrix *A, counter = hypre_CTAlloc(HYPRE_Int, num_cols_offd_AN, HYPRE_MEMORY_HOST); } - map_to_map = NULL; - col_map_offd_AN = NULL; map_to_map = hypre_CTAlloc(HYPRE_Int, num_cols_offd, HYPRE_MEMORY_HOST); col_map_offd_AN = hypre_CTAlloc(HYPRE_BigInt, num_cols_offd_AN, HYPRE_MEMORY_HOST); col_map_offd_AN[0] = big_map_to_node[0]; recv_vec_starts_AN[0] = 0; cnt = 1; - for (i=0; i < num_recvs; i++) + for (i = 0; i < num_recvs; i++) { - for (j=recv_vec_starts[i]; j < recv_vec_starts[i+1]; j++) + for (j = recv_vec_starts[i]; j < recv_vec_starts[i + 1]; j++) { big_node = big_map_to_node[j]; - if (big_node > col_map_offd_AN[cnt-1]) + if (big_node > col_map_offd_AN[cnt - 1]) { col_map_offd_AN[cnt++] = big_node; } - map_to_map[j] = cnt-1; + map_to_map[j] = cnt - 1; } - recv_vec_starts_AN[i+1] = cnt; + recv_vec_starts_AN[i + 1] = cnt; } - for (i=0; i < num_cols_offd_AN; i++) + for (i = 0; i < num_cols_offd_AN; i++) + { counter[i] = -1; + } AN_num_nonzeros_offd = 0; row = 0; - for (i=0; i < num_nodes; i++) + for (i = 0; i < num_nodes; i++) { AN_offd_i[i] = AN_num_nonzeros_offd; - for (j=0; j < num_functions; j++) + for (j = 0; j < num_functions; j++) { - for (k=A_offd_i[row]; k < A_offd_i[row+1]; k++) + for (k = A_offd_i[row]; k < A_offd_i[row + 1]; k++) { k_map = map_to_map[A_offd_j[k]]; if (counter[k_map] < i) @@ -516,8 +529,8 @@ hypre_BoomerAMGCreateNodalA(hypre_ParCSRMatrix *A, } - AN_offd = hypre_CSRMatrixCreate(num_nodes,num_cols_offd_AN, - AN_num_nonzeros_offd); + AN_offd = hypre_CSRMatrixCreate(num_nodes, num_cols_offd_AN, + AN_num_nonzeros_offd); hypre_CSRMatrixI(AN_offd) = AN_offd_i; if (AN_num_nonzeros_offd) { @@ -526,8 +539,10 @@ hypre_BoomerAMGCreateNodalA(hypre_ParCSRMatrix *A, hypre_CSRMatrixJ(AN_offd) = AN_offd_j; hypre_CSRMatrixData(AN_offd) = AN_offd_data; - for (i=0; i < num_cols_offd_AN; i++) + for (i = 0; i < num_cols_offd_AN; i++) + { counter[i] = -1; + } index = 0; row = 0; AN_offd_i[0] = 0; @@ -536,72 +551,76 @@ hypre_BoomerAMGCreateNodalA(hypre_ParCSRMatrix *A, { case 1: /* frobenius norm */ { - for (i=0; i < num_nodes; i++) + for (i = 0; i < num_nodes; i++) { - for (j=0; j < num_functions; j++) + for (j = 0; j < num_functions; j++) { - for (k=A_offd_i[row]; k < A_offd_i[row+1]; k++) + for (k = A_offd_i[row]; k < A_offd_i[row + 1]; k++) { k_map = map_to_map[A_offd_j[k]]; if (counter[k_map] < start_index) { counter[k_map] = index; AN_offd_j[index] = k_map; - AN_offd_data[index] = A_offd_data[k]*A_offd_data[k]; + AN_offd_data[index] = A_offd_data[k] * A_offd_data[k]; index++; } else { AN_offd_data[counter[k_map]] += - A_offd_data[k]*A_offd_data[k]; + A_offd_data[k] * A_offd_data[k]; } } row++; } start_index = index; } - for (i=0; i < AN_num_nonzeros_offd; i++) - AN_offd_data[i] = sqrt(AN_offd_data[i]); + for (i = 0; i < AN_num_nonzeros_offd; i++) + { + AN_offd_data[i] = hypre_sqrt(AN_offd_data[i]); + } } break; case 2: /* sum of abs. value of all elements in block */ { - for (i=0; i < num_nodes; i++) + for (i = 0; i < num_nodes; i++) { - for (j=0; j < num_functions; j++) + for (j = 0; j < num_functions; j++) { - for (k=A_offd_i[row]; k < A_offd_i[row+1]; k++) + for (k = A_offd_i[row]; k < A_offd_i[row + 1]; k++) { k_map = map_to_map[A_offd_j[k]]; if (counter[k_map] < start_index) { counter[k_map] = index; AN_offd_j[index] = k_map; - AN_offd_data[index] = fabs(A_offd_data[k]); + AN_offd_data[index] = hypre_abs(A_offd_data[k]); index++; } else { - AN_offd_data[counter[k_map]] += fabs(A_offd_data[k]); + AN_offd_data[counter[k_map]] += hypre_abs(A_offd_data[k]); } } row++; } start_index = index; } - for (i=0; i < AN_num_nonzeros_offd; i++) + for (i = 0; i < AN_num_nonzeros_offd; i++) + { AN_offd_data[i] /= num_fun2; + } } break; case 3: /* largest element in each block (not abs. value ) */ { - for (i=0; i < num_nodes; i++) + for (i = 0; i < num_nodes; i++) { - for (j=0; j < num_functions; j++) + for (j = 0; j < num_functions; j++) { - for (k=A_offd_i[row]; k < A_offd_i[row+1]; k++) + for (k = A_offd_i[row]; k < A_offd_i[row + 1]; k++) { k_map = map_to_map[A_offd_j[k]]; if (counter[k_map] < start_index) @@ -613,9 +632,11 @@ hypre_BoomerAMGCreateNodalA(hypre_ParCSRMatrix *A, } else { - if (fabs(A_offd_data[k]) > - fabs(AN_offd_data[counter[k_map]])) + if (hypre_abs(A_offd_data[k]) > + hypre_abs(AN_offd_data[counter[k_map]])) + { AN_offd_data[counter[k_map]] = A_offd_data[k]; + } } } row++; @@ -628,38 +649,38 @@ hypre_BoomerAMGCreateNodalA(hypre_ParCSRMatrix *A, case 4: /* inf. norm (row-sum) */ { - data = hypre_CTAlloc(HYPRE_Real, AN_num_nonzeros_offd*num_functions, HYPRE_MEMORY_HOST); + data = hypre_CTAlloc(HYPRE_Real, AN_num_nonzeros_offd * num_functions, HYPRE_MEMORY_HOST); - for (i=0; i < num_nodes; i++) + for (i = 0; i < num_nodes; i++) { - for (j=0; j < num_functions; j++) + for (j = 0; j < num_functions; j++) { - for (k=A_offd_i[row]; k < A_offd_i[row+1]; k++) + for (k = A_offd_i[row]; k < A_offd_i[row + 1]; k++) { k_map = map_to_map[A_offd_j[k]]; if (counter[k_map] < start_index) { counter[k_map] = index; AN_offd_j[index] = k_map; - data[index*num_functions + j] = fabs(A_offd_data[k]); + data[index * num_functions + j] = hypre_abs(A_offd_data[k]); index++; } else { - data[(counter[k_map])*num_functions + j] += fabs(A_offd_data[k]); + data[(counter[k_map])*num_functions + j] += hypre_abs(A_offd_data[k]); } } row++; } start_index = index; } - for (i=0; i < AN_num_nonzeros_offd; i++) + for (i = 0; i < AN_num_nonzeros_offd; i++) { - AN_offd_data[i] = data[i*num_functions]; + AN_offd_data[i] = data[i * num_functions]; - for (j=1; j< num_functions; j++) + for (j = 1; j < num_functions; j++) { - AN_offd_data[i] = hypre_max( AN_offd_data[i],data[i*num_functions+j]); + AN_offd_data[i] = hypre_max( AN_offd_data[i], data[i * num_functions + j]); } } hypre_TFree(data, HYPRE_MEMORY_HOST); @@ -669,11 +690,11 @@ hypre_BoomerAMGCreateNodalA(hypre_ParCSRMatrix *A, case 6: /* sum of value of all elements in block */ { - for (i=0; i < num_nodes; i++) + for (i = 0; i < num_nodes; i++) { - for (j=0; j < num_functions; j++) + for (j = 0; j < num_functions; j++) { - for (k=A_offd_i[row]; k < A_offd_i[row+1]; k++) + for (k = A_offd_i[row]; k < A_offd_i[row + 1]; k++) { k_map = map_to_map[A_offd_j[k]]; if (counter[k_map] < start_index) @@ -696,19 +717,17 @@ hypre_BoomerAMGCreateNodalA(hypre_ParCSRMatrix *A, } break; } - - hypre_TFree(map_to_map, HYPRE_MEMORY_HOST); } - if (diag_option ==1 ) + if (diag_option == 1 ) { /* make the diag entry the negative of the sum of off-diag entries (here we are adding the off_diag contribution)*/ /* the diagonal is the first element listed in each row of AN_diag_data - */ - for (i=0; i < num_nodes; i++) + for (i = 0; i < num_nodes; i++) { sum = 0.0; - for (k = AN_offd_i[i]; k < AN_offd_i[i+1]; k++) + for (k = AN_offd_i[i]; k < AN_offd_i[i + 1]; k++) { sum += AN_offd_data[k]; @@ -721,8 +740,8 @@ hypre_BoomerAMGCreateNodalA(hypre_ParCSRMatrix *A, AN = hypre_ParCSRMatrixCreate(comm, global_num_nodes, global_num_nodes, - row_starts_AN, row_starts_AN, num_cols_offd_AN, - AN_num_nonzeros_diag, AN_num_nonzeros_offd); + row_starts_AN, row_starts_AN, num_cols_offd_AN, + AN_num_nonzeros_diag, AN_num_nonzeros_offd); /* we already created the diag and offd matrices - so we don't need the ones created above */ @@ -737,7 +756,7 @@ hypre_BoomerAMGCreateNodalA(hypre_ParCSRMatrix *A, hypre_ParCSRMatrixColMapOffd(AN) = col_map_offd_AN; hypre_ParCSRMatrixCommPkg(AN) = comm_pkg_AN; - new_num_cols_offd = num_functions*num_cols_offd_AN; + new_num_cols_offd = num_functions * num_cols_offd_AN; if (new_num_cols_offd > num_cols_offd) { @@ -747,19 +766,21 @@ hypre_BoomerAMGCreateNodalA(hypre_ParCSRMatrix *A, { for (j = 0; j < num_functions; j++) { - new_col_map_offd[cnt++] = (HYPRE_BigInt)num_functions*col_map_offd_AN[i]+(HYPRE_BigInt)j; + new_col_map_offd[cnt++] = (HYPRE_BigInt)num_functions * col_map_offd_AN[i] + (HYPRE_BigInt)j; } } cnt = 0; for (i = 0; i < num_cols_offd; i++) { while (col_map_offd[i] > new_col_map_offd[cnt]) + { cnt++; + } col_map_offd[i] = (HYPRE_BigInt)cnt++; } - for (i = 0; i < num_recvs+1; i++) + for (i = 0; i < num_recvs + 1; i++) { - recv_vec_starts[i] = num_functions*recv_vec_starts_AN[i]; + recv_vec_starts[i] = num_functions * recv_vec_starts_AN[i]; } for (i = 0; i < num_nonzeros_offd; i++) @@ -773,20 +794,22 @@ hypre_BoomerAMGCreateNodalA(hypre_ParCSRMatrix *A, } hypre_TFree(big_map_to_node, HYPRE_MEMORY_HOST); - new_send_elmts_size = send_map_starts_AN[num_sends]*num_functions; + new_send_elmts_size = send_map_starts_AN[num_sends] * num_functions; if (new_send_elmts_size > send_map_starts[num_sends]) { new_send_map_elmts = hypre_CTAlloc(HYPRE_Int, new_send_elmts_size, HYPRE_MEMORY_HOST); cnt = 0; send_map_starts[0] = 0; - for (i=0; i < num_sends; i++) + for (i = 0; i < num_sends; i++) { - send_map_starts[i+1] = send_map_starts_AN[i+1]*num_functions; - for (j=send_map_starts_AN[i]; j < send_map_starts_AN[i+1]; j++) + send_map_starts[i + 1] = send_map_starts_AN[i + 1] * num_functions; + for (j = send_map_starts_AN[i]; j < send_map_starts_AN[i + 1]; j++) { - for (k=0; k < num_functions; k++) - new_send_map_elmts[cnt++] = send_map_elmts_AN[j]*num_functions+k; + for (k = 0; k < num_functions; k++) + { + new_send_map_elmts[cnt++] = send_map_elmts_AN[j] * num_functions + k; + } } } hypre_TFree(send_map_elmts, HYPRE_MEMORY_HOST); @@ -796,7 +819,7 @@ hypre_BoomerAMGCreateNodalA(hypre_ParCSRMatrix *A, *AN_ptr = AN; hypre_TFree(counter, HYPRE_MEMORY_HOST); - hypre_TFree(row_starts_AN, HYPRE_MEMORY_HOST); + hypre_TFree(map_to_map, HYPRE_MEMORY_HOST); return hypre_error_flag; } @@ -824,8 +847,8 @@ hypre_BoomerAMGCreateScalarCFS(hypre_ParCSRMatrix *SN, hypre_CSRMatrix *S_offd; HYPRE_Int *S_offd_i; HYPRE_Int *S_offd_j; - HYPRE_BigInt *row_starts_S = NULL; - HYPRE_BigInt *col_starts_S = NULL; + HYPRE_BigInt row_starts_S[2]; + HYPRE_BigInt col_starts_S[2]; HYPRE_BigInt *row_starts_A = hypre_ParCSRMatrixRowStarts(A); HYPRE_BigInt *col_starts_A = hypre_ParCSRMatrixColStarts(A); hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); @@ -854,7 +877,7 @@ hypre_BoomerAMGCreateScalarCFS(hypre_ParCSRMatrix *SN, HYPRE_Int *S_tmp_j; HYPRE_Int num_coarse_nodes; - HYPRE_Int i,j,k,cnt; + HYPRE_Int i, j, k, cnt; HYPRE_Int num_procs; HYPRE_Int num_cols_offd_A = hypre_CSRMatrixNumCols(A_offd); HYPRE_Int A_num_nonzeros_diag; @@ -870,7 +893,7 @@ hypre_BoomerAMGCreateScalarCFS(hypre_ParCSRMatrix *SN, hypre_MPI_Comm_size(comm, &num_procs); - num_variables = num_functions*num_nodes; + num_variables = num_functions * num_nodes; /* Allocate CF_marker if not done before */ if (*CF_marker_ptr == NULL) @@ -896,7 +919,7 @@ hypre_BoomerAMGCreateScalarCFS(hypre_ParCSRMatrix *SN, } } - *dof_func_ptr = hypre_IntArrayCreate(num_coarse_nodes*num_functions); + *dof_func_ptr = hypre_IntArrayCreate(num_coarse_nodes * num_functions); hypre_IntArrayInitialize(*dof_func_ptr); dof_func = hypre_IntArrayData(*dof_func_ptr); cnt = 0; @@ -923,15 +946,9 @@ hypre_BoomerAMGCreateScalarCFS(hypre_ParCSRMatrix *SN, } } - row_starts_S = hypre_CTAlloc(HYPRE_BigInt, 2, HYPRE_MEMORY_HOST); for (i = 0; i < 2; i++) { row_starts_S[i] = row_starts_A[i]; - } - - col_starts_S = hypre_CTAlloc(HYPRE_BigInt, 2, HYPRE_MEMORY_HOST); - for (i = 0; i < 2; i++) - { col_starts_S[i] = col_starts_A[i]; } @@ -941,23 +958,23 @@ hypre_BoomerAMGCreateScalarCFS(hypre_ParCSRMatrix *SN, A_num_nonzeros_offd = A_offd_i[num_variables]; global_num_nodes = hypre_ParCSRMatrixGlobalNumRows(SN); - global_num_cols = hypre_ParCSRMatrixGlobalNumCols(SN)*num_functions; + global_num_cols = hypre_ParCSRMatrixGlobalNumCols(SN) * num_functions; - global_num_vars = global_num_nodes*(HYPRE_BigInt)num_functions; + global_num_vars = global_num_nodes * (HYPRE_BigInt)num_functions; S_marker = hypre_TAlloc(HYPRE_Int, num_variables, HYPRE_MEMORY_HOST); nnz = A_num_nonzeros_diag; - if (nnz < A_num_nonzeros_offd) nnz = A_num_nonzeros_offd; + if (nnz < A_num_nonzeros_offd) { nnz = A_num_nonzeros_offd; } S_tmp_j = hypre_TAlloc(HYPRE_Int, nnz, HYPRE_MEMORY_HOST); - S_diag_i = hypre_CTAlloc(HYPRE_Int, num_variables+1, memory_locationS); - S_offd_i = hypre_CTAlloc(HYPRE_Int, num_variables+1, memory_locationS); + S_diag_i = hypre_CTAlloc(HYPRE_Int, num_variables + 1, memory_locationS); + S_offd_i = hypre_CTAlloc(HYPRE_Int, num_variables + 1, memory_locationS); //Generate S_diag_i and S_diag_j - for (i=0; i < A_num_nonzeros_diag; i++) + for (i = 0; i < A_num_nonzeros_diag; i++) { S_tmp_j[i] = -1; } - for (i=0; i < num_variables; i++) + for (i = 0; i < num_variables; i++) { S_marker[i] = -1; } @@ -969,13 +986,13 @@ hypre_BoomerAMGCreateScalarCFS(hypre_ParCSRMatrix *SN, HYPRE_Int index, index_A, kn, position; for (kn = 0; kn < num_functions; kn++) { - i = in*num_functions+kn; - position = A_diag_i[i]-1; + i = in * num_functions + kn; + position = A_diag_i[i] - 1; if (!keep_same_sign) { if (A_diag_data[A_diag_i[i]] > 0.0) { - for (j = A_diag_i[i]+1; j < A_diag_i[i+1]; j++) + for (j = A_diag_i[i] + 1; j < A_diag_i[i + 1]; j++) { if (A_diag_data[j] < 0.0) { @@ -985,7 +1002,7 @@ hypre_BoomerAMGCreateScalarCFS(hypre_ParCSRMatrix *SN, } else { - for (j = A_diag_i[i]+1; j < A_diag_i[i+1]; j++) + for (j = A_diag_i[i] + 1; j < A_diag_i[i + 1]; j++) { if (A_diag_data[j] > 0.0) { @@ -996,16 +1013,16 @@ hypre_BoomerAMGCreateScalarCFS(hypre_ParCSRMatrix *SN, } else { - for (j = A_diag_i[i]; j < A_diag_i[i+1]; j++) + for (j = A_diag_i[i]; j < A_diag_i[i + 1]; j++) { S_marker[A_diag_j[j]] = j; } } - for (j = SN_diag_i[in]; j < SN_diag_i[in+1]; j++) + for (j = SN_diag_i[in]; j < SN_diag_i[in + 1]; j++) { // only include diagonal elements of block, assuming unknown-based // approach for interpolation, i.e. ignore connections between different variables - index = SN_diag_j[j]*num_functions+kn; + index = SN_diag_j[j] * num_functions + kn; index_A = S_marker[index]; if (index_A > position) { @@ -1013,7 +1030,7 @@ hypre_BoomerAMGCreateScalarCFS(hypre_ParCSRMatrix *SN, S_cnt++; } } - S_diag_i[i+1] = S_cnt; + S_diag_i[i + 1] = S_cnt; } } @@ -1050,13 +1067,13 @@ hypre_BoomerAMGCreateScalarCFS(hypre_ParCSRMatrix *SN, HYPRE_BigInt big_index; for (kn = 0; kn < num_functions; kn++) { - i = in*num_functions+kn; - position = A_offd_i[i]-1; + i = in * num_functions + kn; + position = A_offd_i[i] - 1; if (!keep_same_sign) { if (A_diag_data[A_diag_i[i]] > 0.0) { - for (j = A_offd_i[i]; j < A_offd_i[i+1]; j++) + for (j = A_offd_i[i]; j < A_offd_i[i + 1]; j++) { if (A_offd_data[j] < 0.0) { @@ -1066,7 +1083,7 @@ hypre_BoomerAMGCreateScalarCFS(hypre_ParCSRMatrix *SN, } else { - for (j = A_offd_i[i]; j < A_offd_i[i+1]; j++) + for (j = A_offd_i[i]; j < A_offd_i[i + 1]; j++) { if (A_offd_data[j] > 0.0) { @@ -1077,15 +1094,15 @@ hypre_BoomerAMGCreateScalarCFS(hypre_ParCSRMatrix *SN, } else { - for (j = A_offd_i[i]; j < A_offd_i[i+1]; j++) + for (j = A_offd_i[i]; j < A_offd_i[i + 1]; j++) { S_marker_offd[A_offd_j[j]] = j; } } - for (j = SN_offd_i[in]; j < SN_offd_i[in+1]; j++) + for (j = SN_offd_i[in]; j < SN_offd_i[in + 1]; j++) { - big_index = col_map_offd_SN[SN_offd_j[j]]*num_functions+kn; - index = hypre_BigBinarySearch(col_map_offd_A,big_index, num_cols_offd_A); + big_index = col_map_offd_SN[SN_offd_j[j]] * num_functions + kn; + index = hypre_BigBinarySearch(col_map_offd_A, big_index, num_cols_offd_A); if (index > -1) { index_A = S_marker_offd[index]; @@ -1096,7 +1113,7 @@ hypre_BoomerAMGCreateScalarCFS(hypre_ParCSRMatrix *SN, } } } - S_offd_i[i+1] = S_cnt; + S_offd_i[i + 1] = S_cnt; } } @@ -1112,8 +1129,8 @@ hypre_BoomerAMGCreateScalarCFS(hypre_ParCSRMatrix *SN, } S = hypre_ParCSRMatrixCreate(comm, global_num_vars, global_num_cols, - row_starts_S, col_starts_S, num_cols_offd_A, - S_num_nonzeros_diag, S_num_nonzeros_offd); + row_starts_S, col_starts_S, num_cols_offd_A, + S_num_nonzeros_diag, S_num_nonzeros_offd); S_diag = hypre_ParCSRMatrixDiag(S); S_offd = hypre_ParCSRMatrixOffd(S); @@ -1130,8 +1147,6 @@ hypre_BoomerAMGCreateScalarCFS(hypre_ParCSRMatrix *SN, hypre_TFree(S_tmp_j, HYPRE_MEMORY_HOST); hypre_TFree(S_marker, HYPRE_MEMORY_HOST); hypre_TFree(S_marker_offd, HYPRE_MEMORY_HOST); - hypre_TFree(row_starts_S, HYPRE_MEMORY_HOST); - hypre_TFree(col_starts_S, HYPRE_MEMORY_HOST); *S_ptr = S; @@ -1139,7 +1154,7 @@ hypre_BoomerAMGCreateScalarCFS(hypre_ParCSRMatrix *SN, } -/* This function just finds the scalaer CF_marker and dof_func */ +/* This function just finds the scalar CF_marker and dof_func */ HYPRE_Int hypre_BoomerAMGCreateScalarCF(HYPRE_Int *CFN_marker, @@ -1153,10 +1168,10 @@ hypre_BoomerAMGCreateScalarCF(HYPRE_Int *CFN_marker, HYPRE_Int *dof_func; HYPRE_Int num_variables; HYPRE_Int num_coarse_nodes; - HYPRE_Int i,j,k,cnt; + HYPRE_Int i, j, k, cnt; - num_variables = num_functions*num_nodes; + num_variables = num_functions * num_nodes; /* Allocate CF_marker if not done before */ if (*CF_marker_ptr == NULL) @@ -1168,23 +1183,27 @@ hypre_BoomerAMGCreateScalarCF(HYPRE_Int *CFN_marker, cnt = 0; num_coarse_nodes = 0; - for (i=0; i < num_nodes; i++) + for (i = 0; i < num_nodes; i++) { - if (CFN_marker[i] == 1) num_coarse_nodes++; - for (j=0; j < num_functions; j++) + if (CFN_marker[i] == 1) { num_coarse_nodes++; } + for (j = 0; j < num_functions; j++) + { CF_marker[cnt++] = CFN_marker[i]; + } } - *dof_func_ptr = hypre_IntArrayCreate(num_coarse_nodes*num_functions); + *dof_func_ptr = hypre_IntArrayCreate(num_coarse_nodes * num_functions); hypre_IntArrayInitialize(*dof_func_ptr); dof_func = hypre_IntArrayData(*dof_func_ptr); cnt = 0; - for (i=0; i < num_nodes; i++) + for (i = 0; i < num_nodes; i++) { if (CFN_marker[i] == 1) { - for (k=0; k < num_functions; k++) + for (k = 0; k < num_functions; k++) + { dof_func[cnt++] = k; + } } } diff --git a/external/hypre/src/parcsr_ls/par_nongalerkin.c b/external/hypre/src/parcsr_ls/par_nongalerkin.c index b8a75b2c..d052dc12 100644 --- a/external/hypre/src/parcsr_ls/par_nongalerkin.c +++ b/external/hypre/src/parcsr_ls/par_nongalerkin.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -7,6 +7,7 @@ #include "_hypre_parcsr_ls.h" #include "../HYPRE.h" +#include "_hypre_IJ_mv.h" /* This file contains the routines for constructing non-Galerkin coarse grid * operators, based on the original Galerkin coarse grid @@ -25,13 +26,15 @@ hypre_GrabSubArray(HYPRE_Int * indices, HYPRE_BigInt * array, HYPRE_BigInt * output) { - HYPRE_Int i, length; - length = end - start + 1; + HYPRE_Int i, length; + length = end - start + 1; - for(i = 0; i < length; i++) - { output[i] = array[ indices[start + i] ]; } + for (i = 0; i < length; i++) + { + output[i] = array[indices[start + i]]; + } - return 0; + return hypre_error_flag; } /* Compute the intersection of x and y, placing @@ -58,70 +61,70 @@ hypre_IntersectTwoArrays(HYPRE_Int *x, HYPRE_Real *output_x_data, HYPRE_Int *intersect_length) { - HYPRE_Int x_index = 0; - HYPRE_Int y_index = 0; - *intersect_length = 0; - - /* Compute Intersection, looping over each array */ - while ( (x_index < x_length) && (y_index < y_length) ) - { - if (x[x_index] > y[y_index]) - { - y_index = y_index + 1; - } - else if (x[x_index] < y[y_index]) - { - x_index = x_index + 1; - } - else - { - z[*intersect_length] = x[x_index]; - output_x_data[*intersect_length] = x_data[x_index]; - x_index = x_index + 1; - y_index = y_index + 1; - *intersect_length = *intersect_length + 1; - } - } - - return 1; + HYPRE_Int x_index = 0; + HYPRE_Int y_index = 0; + *intersect_length = 0; + + /* Compute Intersection, looping over each array */ + while ( (x_index < x_length) && (y_index < y_length) ) + { + if (x[x_index] > y[y_index]) + { + y_index = y_index + 1; + } + else if (x[x_index] < y[y_index]) + { + x_index = x_index + 1; + } + else + { + z[*intersect_length] = x[x_index]; + output_x_data[*intersect_length] = x_data[x_index]; + x_index = x_index + 1; + y_index = y_index + 1; + *intersect_length = *intersect_length + 1; + } + } + + return 1; } HYPRE_Int hypre_IntersectTwoBigArrays(HYPRE_BigInt *x, - HYPRE_Real *x_data, - HYPRE_Int x_length, - HYPRE_BigInt *y, - HYPRE_Int y_length, - HYPRE_BigInt *z, - HYPRE_Real *output_x_data, - HYPRE_Int *intersect_length) + HYPRE_Real *x_data, + HYPRE_Int x_length, + HYPRE_BigInt *y, + HYPRE_Int y_length, + HYPRE_BigInt *z, + HYPRE_Real *output_x_data, + HYPRE_Int *intersect_length) { - HYPRE_Int x_index = 0; - HYPRE_Int y_index = 0; - *intersect_length = 0; - - /* Compute Intersection, looping over each array */ - while ( (x_index < x_length) && (y_index < y_length) ) - { - if (x[x_index] > y[y_index]) - { - y_index = y_index + 1; - } - else if (x[x_index] < y[y_index]) - { - x_index = x_index + 1; - } - else - { - z[*intersect_length] = x[x_index]; - output_x_data[*intersect_length] = x_data[x_index]; - x_index = x_index + 1; - y_index = y_index + 1; - *intersect_length = *intersect_length + 1; - } - } - - return 1; + HYPRE_Int x_index = 0; + HYPRE_Int y_index = 0; + *intersect_length = 0; + + /* Compute Intersection, looping over each array */ + while ( (x_index < x_length) && (y_index < y_length) ) + { + if (x[x_index] > y[y_index]) + { + y_index = y_index + 1; + } + else if (x[x_index] < y[y_index]) + { + x_index = x_index + 1; + } + else + { + z[*intersect_length] = x[x_index]; + output_x_data[*intersect_length] = x_data[x_index]; + x_index = x_index + 1; + y_index = y_index + 1; + *intersect_length = *intersect_length + 1; + } + } + + return 1; } /* Copy CSR matrix A to CSR matrix B. The column indices are @@ -137,84 +140,84 @@ HYPRE_Int hypre_SortedCopyParCSRData(hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B) { - /* Grab off A and B's data structures */ - hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); - HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); - HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); - HYPRE_Real *A_diag_data = hypre_CSRMatrixData(A_diag); - - hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); - HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); - HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); - HYPRE_Real *A_offd_data = hypre_CSRMatrixData(A_offd); - - hypre_CSRMatrix *B_diag = hypre_ParCSRMatrixDiag(B); - HYPRE_Int *B_diag_i = hypre_CSRMatrixI(B_diag); - HYPRE_Int *B_diag_j = hypre_CSRMatrixJ(B_diag); - HYPRE_Real *B_diag_data = hypre_CSRMatrixData(B_diag); - - hypre_CSRMatrix *B_offd = hypre_ParCSRMatrixOffd(B); - HYPRE_Int *B_offd_i = hypre_CSRMatrixI(B_offd); - HYPRE_Int *B_offd_j = hypre_CSRMatrixJ(B_offd); - HYPRE_Real *B_offd_data = hypre_CSRMatrixData(B_offd); - - HYPRE_Int num_variables = hypre_CSRMatrixNumRows(A_diag); - HYPRE_Int *temp_int_array = NULL; - HYPRE_Int temp_int_array_length=0; - HYPRE_Int i, length, offset_A, offset_B; - - for(i = 0; i < num_variables; i++) - { - - /* Deal with the first row entries, which may be diagonal elements */ - if( A_diag_j[A_diag_i[i]] == i) - { offset_A = 1; } - else - { offset_A = 0; } - if( B_diag_j[B_diag_i[i]] == i) - { offset_B = 1; } - else - { offset_B = 0; } - if( (offset_B == 1) && (offset_A == 1) ) - { B_diag_data[B_diag_i[i]] = A_diag_data[A_diag_i[i]]; } - - /* This finds the intersection of the column indices, and - * also copies the matching data in A to the data array in B - **/ - if( (A_diag_i[i+1] - A_diag_i[i] - offset_A) > temp_int_array_length ) - { - hypre_TFree(temp_int_array, HYPRE_MEMORY_HOST); - temp_int_array_length = (A_diag_i[i+1] - A_diag_i[i] - offset_A); - temp_int_array = hypre_CTAlloc(HYPRE_Int, temp_int_array_length, HYPRE_MEMORY_HOST); - } - hypre_IntersectTwoArrays(&(A_diag_j[A_diag_i[i] + offset_A]), - &(A_diag_data[A_diag_i[i] + offset_A]), - A_diag_i[i+1] - A_diag_i[i] - offset_A, - &(B_diag_j[B_diag_i[i] + offset_B]), - B_diag_i[i+1] - B_diag_i[i] - offset_B, - temp_int_array, - &(B_diag_data[B_diag_i[i] + offset_B]), - &length); - - if( (A_offd_i[i+1] - A_offd_i[i]) > temp_int_array_length ) - { - hypre_TFree(temp_int_array, HYPRE_MEMORY_HOST); - temp_int_array_length = (A_offd_i[i+1] - A_offd_i[i]); - temp_int_array = hypre_CTAlloc(HYPRE_Int, temp_int_array_length, HYPRE_MEMORY_HOST); - } - hypre_IntersectTwoArrays(&(A_offd_j[A_offd_i[i]]), - &(A_offd_data[A_offd_i[i]]), - A_offd_i[i+1] - A_offd_i[i], - &(B_offd_j[B_offd_i[i]]), - B_offd_i[i+1] - B_offd_i[i], - temp_int_array, - &(B_offd_data[B_offd_i[i]]), - &length); - } - - if(temp_int_array) - { hypre_TFree(temp_int_array, HYPRE_MEMORY_HOST); } - return 1; + /* Grab off A and B's data structures */ + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); + HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); + HYPRE_Real *A_diag_data = hypre_CSRMatrixData(A_diag); + + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); + HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); + HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); + HYPRE_Real *A_offd_data = hypre_CSRMatrixData(A_offd); + + hypre_CSRMatrix *B_diag = hypre_ParCSRMatrixDiag(B); + HYPRE_Int *B_diag_i = hypre_CSRMatrixI(B_diag); + HYPRE_Int *B_diag_j = hypre_CSRMatrixJ(B_diag); + HYPRE_Real *B_diag_data = hypre_CSRMatrixData(B_diag); + + hypre_CSRMatrix *B_offd = hypre_ParCSRMatrixOffd(B); + HYPRE_Int *B_offd_i = hypre_CSRMatrixI(B_offd); + HYPRE_Int *B_offd_j = hypre_CSRMatrixJ(B_offd); + HYPRE_Real *B_offd_data = hypre_CSRMatrixData(B_offd); + + HYPRE_Int num_variables = hypre_CSRMatrixNumRows(A_diag); + HYPRE_Int *temp_int_array = NULL; + HYPRE_Int temp_int_array_length = 0; + HYPRE_Int i, length, offset_A, offset_B; + + for (i = 0; i < num_variables; i++) + { + + /* Deal with the first row entries, which may be diagonal elements */ + if ( A_diag_j[A_diag_i[i]] == i) + { offset_A = 1; } + else + { offset_A = 0; } + if ( B_diag_j[B_diag_i[i]] == i) + { offset_B = 1; } + else + { offset_B = 0; } + if ( (offset_B == 1) && (offset_A == 1) ) + { B_diag_data[B_diag_i[i]] = A_diag_data[A_diag_i[i]]; } + + /* This finds the intersection of the column indices, and + * also copies the matching data in A to the data array in B + **/ + if ( (A_diag_i[i + 1] - A_diag_i[i] - offset_A) > temp_int_array_length ) + { + hypre_TFree(temp_int_array, HYPRE_MEMORY_HOST); + temp_int_array_length = (A_diag_i[i + 1] - A_diag_i[i] - offset_A); + temp_int_array = hypre_CTAlloc(HYPRE_Int, temp_int_array_length, HYPRE_MEMORY_HOST); + } + hypre_IntersectTwoArrays(&(A_diag_j[A_diag_i[i] + offset_A]), + &(A_diag_data[A_diag_i[i] + offset_A]), + A_diag_i[i + 1] - A_diag_i[i] - offset_A, + &(B_diag_j[B_diag_i[i] + offset_B]), + B_diag_i[i + 1] - B_diag_i[i] - offset_B, + temp_int_array, + &(B_diag_data[B_diag_i[i] + offset_B]), + &length); + + if ( (A_offd_i[i + 1] - A_offd_i[i]) > temp_int_array_length ) + { + hypre_TFree(temp_int_array, HYPRE_MEMORY_HOST); + temp_int_array_length = (A_offd_i[i + 1] - A_offd_i[i]); + temp_int_array = hypre_CTAlloc(HYPRE_Int, temp_int_array_length, HYPRE_MEMORY_HOST); + } + hypre_IntersectTwoArrays(&(A_offd_j[A_offd_i[i]]), + &(A_offd_data[A_offd_i[i]]), + A_offd_i[i + 1] - A_offd_i[i], + &(B_offd_j[B_offd_i[i]]), + B_offd_i[i + 1] - B_offd_i[i], + temp_int_array, + &(B_offd_data[B_offd_i[i]]), + &length); + } + + if (temp_int_array) + { hypre_TFree(temp_int_array, HYPRE_MEMORY_HOST); } + return 1; } /* @@ -229,380 +232,385 @@ hypre_BoomerAMG_MyCreateS(hypre_ParCSRMatrix *A, HYPRE_Int *dof_func, hypre_ParCSRMatrix **S_ptr) { - MPI_Comm comm = hypre_ParCSRMatrixComm(A); - hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); - hypre_ParCSRCommHandle *comm_handle; - hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); - HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); - HYPRE_Real *A_diag_data = hypre_CSRMatrixData(A_diag); - - - hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); - HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); - HYPRE_Real *A_offd_data = NULL; - HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); - HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); - - HYPRE_BigInt *row_starts = hypre_ParCSRMatrixRowStarts(A); - HYPRE_Int num_variables = hypre_CSRMatrixNumRows(A_diag); - HYPRE_BigInt global_num_vars = hypre_ParCSRMatrixGlobalNumRows(A); - HYPRE_Int num_nonzeros_diag; - HYPRE_Int num_nonzeros_offd = 0; - HYPRE_Int num_cols_offd = 0; - - hypre_ParCSRMatrix *S; - hypre_CSRMatrix *S_diag; - HYPRE_Int *S_diag_i; - HYPRE_Int *S_diag_j; - HYPRE_Real *S_diag_data; - hypre_CSRMatrix *S_offd; - HYPRE_Int *S_offd_i = NULL; - HYPRE_Int *S_offd_j = NULL; - HYPRE_Real *S_offd_data; - - HYPRE_Real diag, row_scale, row_sum; - HYPRE_Int i, jA, jS; - - HYPRE_Int ierr = 0; - - HYPRE_Int *dof_func_offd; - HYPRE_Int num_sends; - HYPRE_Int *int_buf_data; - HYPRE_Int index, start, j; - - /*-------------------------------------------------------------- - * Compute a ParCSR strength matrix, S. - * - * For now, the "strength" of dependence/influence is defined in - * the following way: i depends on j if - * aij > hypre_max (k != i) aik, aii < 0 - * or - * aij < hypre_min (k != i) aik, aii >= 0 - * Then S_ij = aij, else S_ij = 0. - * - * NOTE: the entries are negative initially, corresponding - * to "unaccounted-for" dependence. - *----------------------------------------------------------------*/ - - num_nonzeros_diag = A_diag_i[num_variables]; - num_cols_offd = hypre_CSRMatrixNumCols(A_offd); - - A_offd_i = hypre_CSRMatrixI(A_offd); - num_nonzeros_offd = A_offd_i[num_variables]; - - /* Initialize S */ - S = hypre_ParCSRMatrixCreate(comm, global_num_vars, global_num_vars, - row_starts, row_starts, - num_cols_offd, num_nonzeros_diag, num_nonzeros_offd); - S_diag = hypre_ParCSRMatrixDiag(S); - hypre_CSRMatrixI(S_diag) = hypre_CTAlloc(HYPRE_Int, num_variables+1, HYPRE_MEMORY_HOST); - hypre_CSRMatrixJ(S_diag) = hypre_CTAlloc(HYPRE_Int, num_nonzeros_diag, HYPRE_MEMORY_HOST); - hypre_CSRMatrixData(S_diag) = hypre_CTAlloc(HYPRE_Real, num_nonzeros_diag, HYPRE_MEMORY_HOST); - S_offd = hypre_ParCSRMatrixOffd(S); - hypre_CSRMatrixI(S_offd) = hypre_CTAlloc(HYPRE_Int, num_variables+1, HYPRE_MEMORY_HOST); - - S_diag_i = hypre_CSRMatrixI(S_diag); - S_diag_j = hypre_CSRMatrixJ(S_diag); - S_diag_data = hypre_CSRMatrixData(S_diag); - S_offd_i = hypre_CSRMatrixI(S_offd); + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); + hypre_ParCSRCommHandle *comm_handle; + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); + HYPRE_Real *A_diag_data = hypre_CSRMatrixData(A_diag); + + + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); + HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); + HYPRE_Real *A_offd_data = NULL; + HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); + HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); + + HYPRE_BigInt *row_starts = hypre_ParCSRMatrixRowStarts(A); + HYPRE_Int num_variables = hypre_CSRMatrixNumRows(A_diag); + HYPRE_BigInt global_num_vars = hypre_ParCSRMatrixGlobalNumRows(A); + HYPRE_Int num_nonzeros_diag; + HYPRE_Int num_nonzeros_offd = 0; + HYPRE_Int num_cols_offd = 0; + + hypre_ParCSRMatrix *S; + hypre_CSRMatrix *S_diag; + HYPRE_Int *S_diag_i; + HYPRE_Int *S_diag_j; + HYPRE_Real *S_diag_data; + hypre_CSRMatrix *S_offd; + HYPRE_Int *S_offd_i = NULL; + HYPRE_Int *S_offd_j = NULL; + HYPRE_Real *S_offd_data = NULL; + + HYPRE_Real diag, row_scale, row_sum; + HYPRE_Int i, jA, jS; + + HYPRE_Int ierr = 0; + + HYPRE_Int *dof_func_offd; + HYPRE_Int num_sends; + HYPRE_Int *int_buf_data; + HYPRE_Int index, start, j; + + /*-------------------------------------------------------------- + * Compute a ParCSR strength matrix, S. + * + * For now, the "strength" of dependence/influence is defined in + * the following way: i depends on j if + * aij > hypre_max (k != i) aik, aii < 0 + * or + * aij < hypre_min (k != i) aik, aii >= 0 + * Then S_ij = aij, else S_ij = 0. + * + * NOTE: the entries are negative initially, corresponding + * to "unaccounted-for" dependence. + *----------------------------------------------------------------*/ + + num_nonzeros_diag = A_diag_i[num_variables]; + num_cols_offd = hypre_CSRMatrixNumCols(A_offd); + + A_offd_i = hypre_CSRMatrixI(A_offd); + num_nonzeros_offd = A_offd_i[num_variables]; + + /* Initialize S */ + S = hypre_ParCSRMatrixCreate(comm, global_num_vars, global_num_vars, + row_starts, row_starts, + num_cols_offd, num_nonzeros_diag, num_nonzeros_offd); + S_diag = hypre_ParCSRMatrixDiag(S); + hypre_CSRMatrixI(S_diag) = hypre_CTAlloc(HYPRE_Int, num_variables + 1, HYPRE_MEMORY_HOST); + hypre_CSRMatrixJ(S_diag) = hypre_CTAlloc(HYPRE_Int, num_nonzeros_diag, HYPRE_MEMORY_HOST); + hypre_CSRMatrixData(S_diag) = hypre_CTAlloc(HYPRE_Real, num_nonzeros_diag, HYPRE_MEMORY_HOST); + S_offd = hypre_ParCSRMatrixOffd(S); + hypre_CSRMatrixI(S_offd) = hypre_CTAlloc(HYPRE_Int, num_variables + 1, HYPRE_MEMORY_HOST); + + S_diag_i = hypre_CSRMatrixI(S_diag); + S_diag_j = hypre_CSRMatrixJ(S_diag); + S_diag_data = hypre_CSRMatrixData(S_diag); + S_offd_i = hypre_CSRMatrixI(S_offd); hypre_CSRMatrixMemoryLocation(S_diag) = HYPRE_MEMORY_HOST; hypre_CSRMatrixMemoryLocation(S_offd) = HYPRE_MEMORY_HOST; - dof_func_offd = NULL; - - if (num_cols_offd) - { - A_offd_data = hypre_CSRMatrixData(A_offd); - hypre_CSRMatrixJ(S_offd) = hypre_CTAlloc(HYPRE_Int, num_nonzeros_offd, HYPRE_MEMORY_HOST); - hypre_CSRMatrixData(S_offd) = hypre_CTAlloc(HYPRE_Real, num_nonzeros_offd, HYPRE_MEMORY_HOST); - S_offd_j = hypre_CSRMatrixJ(S_offd); - S_offd_data = hypre_CSRMatrixData(S_offd); - hypre_ParCSRMatrixColMapOffd(S) = hypre_CTAlloc(HYPRE_BigInt, num_cols_offd, HYPRE_MEMORY_HOST); - if (num_functions > 1) - dof_func_offd = hypre_CTAlloc(HYPRE_Int, num_cols_offd, HYPRE_MEMORY_HOST); - } - - - /*------------------------------------------------------------------- - * Get the dof_func data for the off-processor columns - *-------------------------------------------------------------------*/ - - if (!comm_pkg) - { - hypre_MatvecCommPkgCreate(A); - comm_pkg = hypre_ParCSRMatrixCommPkg(A); - } - - num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - if (num_functions > 1) - { - int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, - num_sends), HYPRE_MEMORY_HOST); - index = 0; - for (i = 0; i < num_sends; i++) - { - start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j=start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) - int_buf_data[index++] = dof_func[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; - } - - comm_handle = hypre_ParCSRCommHandleCreate( 11, comm_pkg, int_buf_data, - dof_func_offd); - - hypre_ParCSRCommHandleDestroy(comm_handle); - hypre_TFree(int_buf_data, HYPRE_MEMORY_HOST); - } - - /* give S same nonzero structure as A */ - hypre_ParCSRMatrixCopy(A,S,1); + dof_func_offd = NULL; + + if (num_cols_offd) + { + A_offd_data = hypre_CSRMatrixData(A_offd); + hypre_CSRMatrixJ(S_offd) = hypre_CTAlloc(HYPRE_Int, num_nonzeros_offd, HYPRE_MEMORY_HOST); + hypre_CSRMatrixData(S_offd) = hypre_CTAlloc(HYPRE_Real, num_nonzeros_offd, HYPRE_MEMORY_HOST); + S_offd_j = hypre_CSRMatrixJ(S_offd); + S_offd_data = hypre_CSRMatrixData(S_offd); + hypre_ParCSRMatrixColMapOffd(S) = hypre_CTAlloc(HYPRE_BigInt, num_cols_offd, HYPRE_MEMORY_HOST); + if (num_functions > 1) + { + dof_func_offd = hypre_CTAlloc(HYPRE_Int, num_cols_offd, HYPRE_MEMORY_HOST); + } + } + + + /*------------------------------------------------------------------- + * Get the dof_func data for the off-processor columns + *-------------------------------------------------------------------*/ + + if (!comm_pkg) + { + hypre_MatvecCommPkgCreate(A); + comm_pkg = hypre_ParCSRMatrixCommPkg(A); + } + + num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); + if (num_functions > 1) + { + int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, + num_sends), HYPRE_MEMORY_HOST); + index = 0; + for (i = 0; i < num_sends; i++) + { + start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) + { + int_buf_data[index++] = dof_func[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; + } + } + + comm_handle = hypre_ParCSRCommHandleCreate( 11, comm_pkg, int_buf_data, + dof_func_offd); + + hypre_ParCSRCommHandleDestroy(comm_handle); + hypre_TFree(int_buf_data, HYPRE_MEMORY_HOST); + } + + /* give S same nonzero structure as A */ + hypre_ParCSRMatrixCopy(A, S, 1); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,diag,row_scale,row_sum,jA) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,diag,row_scale,row_sum,jA) HYPRE_SMP_SCHEDULE #endif - for (i = 0; i < num_variables; i++) - { - diag = A_diag_data[A_diag_i[i]]; - - /* compute scaling factor and row sum */ - row_scale = 0.0; - row_sum = diag; - if (num_functions > 1) - { - if (diag < 0) + for (i = 0; i < num_variables; i++) + { + diag = A_diag_data[A_diag_i[i]]; + + /* compute scaling factor and row sum */ + row_scale = 0.0; + row_sum = diag; + if (num_functions > 1) + { + if (diag < 0) + { + for (jA = A_diag_i[i] + 1; jA < A_diag_i[i + 1]; jA++) { - for (jA = A_diag_i[i]+1; jA < A_diag_i[i+1]; jA++) - { - if (dof_func[i] == dof_func[A_diag_j[jA]]) - { - row_scale = hypre_max(row_scale, A_diag_data[jA]); - row_sum += A_diag_data[jA]; - } - } - for (jA = A_offd_i[i]; jA < A_offd_i[i+1]; jA++) - { - if (dof_func[i] == dof_func_offd[A_offd_j[jA]]) - { - row_scale = hypre_max(row_scale, A_offd_data[jA]); - row_sum += A_offd_data[jA]; - } - } + if (dof_func[i] == dof_func[A_diag_j[jA]]) + { + row_scale = hypre_max(row_scale, A_diag_data[jA]); + row_sum += A_diag_data[jA]; + } } - else + for (jA = A_offd_i[i]; jA < A_offd_i[i + 1]; jA++) { - for (jA = A_diag_i[i]+1; jA < A_diag_i[i+1]; jA++) - { - if (dof_func[i] == dof_func[A_diag_j[jA]]) - { - row_scale = hypre_min(row_scale, A_diag_data[jA]); - row_sum += A_diag_data[jA]; - } - } - for (jA = A_offd_i[i]; jA < A_offd_i[i+1]; jA++) - { - if (dof_func[i] == dof_func_offd[A_offd_j[jA]]) - { - row_scale = hypre_min(row_scale, A_offd_data[jA]); - row_sum += A_offd_data[jA]; - } - } + if (dof_func[i] == dof_func_offd[A_offd_j[jA]]) + { + row_scale = hypre_max(row_scale, A_offd_data[jA]); + row_sum += A_offd_data[jA]; + } } - } - else - { - if (diag < 0) + } + else + { + for (jA = A_diag_i[i] + 1; jA < A_diag_i[i + 1]; jA++) { - for (jA = A_diag_i[i]+1; jA < A_diag_i[i+1]; jA++) - { - row_scale = hypre_max(row_scale, A_diag_data[jA]); - row_sum += A_diag_data[jA]; - } - for (jA = A_offd_i[i]; jA < A_offd_i[i+1]; jA++) - { - row_scale = hypre_max(row_scale, A_offd_data[jA]); - row_sum += A_offd_data[jA]; - } + if (dof_func[i] == dof_func[A_diag_j[jA]]) + { + row_scale = hypre_min(row_scale, A_diag_data[jA]); + row_sum += A_diag_data[jA]; + } } - else + for (jA = A_offd_i[i]; jA < A_offd_i[i + 1]; jA++) { - for (jA = A_diag_i[i]+1; jA < A_diag_i[i+1]; jA++) - { - row_scale = hypre_min(row_scale, A_diag_data[jA]); - row_sum += A_diag_data[jA]; - } - for (jA = A_offd_i[i]; jA < A_offd_i[i+1]; jA++) - { - row_scale = hypre_min(row_scale, A_offd_data[jA]); - row_sum += A_offd_data[jA]; - } + if (dof_func[i] == dof_func_offd[A_offd_j[jA]]) + { + row_scale = hypre_min(row_scale, A_offd_data[jA]); + row_sum += A_offd_data[jA]; + } } - } - - /* compute row entries of S */ - S_diag_j[A_diag_i[i]] = -1; - if ((fabs(row_sum) > fabs(diag)*max_row_sum) && (max_row_sum < 1.0)) - { - /* make all dependencies weak */ - for (jA = A_diag_i[i]+1; jA < A_diag_i[i+1]; jA++) + } + } + else + { + if (diag < 0) + { + for (jA = A_diag_i[i] + 1; jA < A_diag_i[i + 1]; jA++) { - S_diag_j[jA] = -1; + row_scale = hypre_max(row_scale, A_diag_data[jA]); + row_sum += A_diag_data[jA]; } - for (jA = A_offd_i[i]; jA < A_offd_i[i+1]; jA++) + for (jA = A_offd_i[i]; jA < A_offd_i[i + 1]; jA++) { - S_offd_j[jA] = -1; + row_scale = hypre_max(row_scale, A_offd_data[jA]); + row_sum += A_offd_data[jA]; } - } - else - { - if (num_functions > 1) + } + else + { + for (jA = A_diag_i[i] + 1; jA < A_diag_i[i + 1]; jA++) { - if (diag < 0) - { - for (jA = A_diag_i[i]+1; jA < A_diag_i[i+1]; jA++) - { - if (A_diag_data[jA] <= strength_threshold * row_scale - || dof_func[i] != dof_func[A_diag_j[jA]]) - { - S_diag_j[jA] = -1; - } - } - for (jA = A_offd_i[i]; jA < A_offd_i[i+1]; jA++) - { - if (A_offd_data[jA] <= strength_threshold * row_scale - || dof_func[i] != dof_func_offd[A_offd_j[jA]]) - { - S_offd_j[jA] = -1; - } - } - } - else - { - for (jA = A_diag_i[i]+1; jA < A_diag_i[i+1]; jA++) - { - if (A_diag_data[jA] >= strength_threshold * row_scale - || dof_func[i] != dof_func[A_diag_j[jA]]) - { - S_diag_j[jA] = -1; - } - } - for (jA = A_offd_i[i]; jA < A_offd_i[i+1]; jA++) - { - if (A_offd_data[jA] >= strength_threshold * row_scale - || dof_func[i] != dof_func_offd[A_offd_j[jA]]) - { - S_offd_j[jA] = -1; - } - } - } + row_scale = hypre_min(row_scale, A_diag_data[jA]); + row_sum += A_diag_data[jA]; + } + for (jA = A_offd_i[i]; jA < A_offd_i[i + 1]; jA++) + { + row_scale = hypre_min(row_scale, A_offd_data[jA]); + row_sum += A_offd_data[jA]; + } + } + } + + /* compute row entries of S */ + S_diag_j[A_diag_i[i]] = -1; + if ((hypre_abs(row_sum) > hypre_abs(diag)*max_row_sum) && (max_row_sum < 1.0)) + { + /* make all dependencies weak */ + for (jA = A_diag_i[i] + 1; jA < A_diag_i[i + 1]; jA++) + { + S_diag_j[jA] = -1; + } + for (jA = A_offd_i[i]; jA < A_offd_i[i + 1]; jA++) + { + S_offd_j[jA] = -1; + } + } + else + { + if (num_functions > 1) + { + if (diag < 0) + { + for (jA = A_diag_i[i] + 1; jA < A_diag_i[i + 1]; jA++) + { + if (A_diag_data[jA] <= strength_threshold * row_scale + || dof_func[i] != dof_func[A_diag_j[jA]]) + { + S_diag_j[jA] = -1; + } + } + for (jA = A_offd_i[i]; jA < A_offd_i[i + 1]; jA++) + { + if (A_offd_data[jA] <= strength_threshold * row_scale + || dof_func[i] != dof_func_offd[A_offd_j[jA]]) + { + S_offd_j[jA] = -1; + } + } } else { - if (diag < 0) - { - for (jA = A_diag_i[i]+1; jA < A_diag_i[i+1]; jA++) - { - if (A_diag_data[jA] <= strength_threshold * row_scale) - { - S_diag_j[jA] = -1; - } - } - for (jA = A_offd_i[i]; jA < A_offd_i[i+1]; jA++) - { - if (A_offd_data[jA] <= strength_threshold * row_scale) - { - S_offd_j[jA] = -1; - } - } - } - else - { - for (jA = A_diag_i[i]+1; jA < A_diag_i[i+1]; jA++) - { - if (A_diag_data[jA] >= strength_threshold * row_scale) - { - S_diag_j[jA] = -1; - } - } - for (jA = A_offd_i[i]; jA < A_offd_i[i+1]; jA++) - { - if (A_offd_data[jA] >= strength_threshold * row_scale) - { - S_offd_j[jA] = -1; - } - } - } + for (jA = A_diag_i[i] + 1; jA < A_diag_i[i + 1]; jA++) + { + if (A_diag_data[jA] >= strength_threshold * row_scale + || dof_func[i] != dof_func[A_diag_j[jA]]) + { + S_diag_j[jA] = -1; + } + } + for (jA = A_offd_i[i]; jA < A_offd_i[i + 1]; jA++) + { + if (A_offd_data[jA] >= strength_threshold * row_scale + || dof_func[i] != dof_func_offd[A_offd_j[jA]]) + { + S_offd_j[jA] = -1; + } + } } - } - } - - /*-------------------------------------------------------------- - * "Compress" the strength matrix. - * - * NOTE: S has *NO DIAGONAL ELEMENT* on any row. Caveat Emptor! - * - * NOTE: This "compression" section of code may not be removed, the - * non-Galerkin routine depends on it. - *----------------------------------------------------------------*/ - - /* RDF: not sure if able to thread this loop */ - jS = 0; - for (i = 0; i < num_variables; i++) - { - S_diag_i[i] = jS; - for (jA = A_diag_i[i]; jA < A_diag_i[i+1]; jA++) - { - if (S_diag_j[jA] > -1) + } + else + { + if (diag < 0) { - S_diag_j[jS] = S_diag_j[jA]; - S_diag_data[jS] = S_diag_data[jA]; - jS++; + for (jA = A_diag_i[i] + 1; jA < A_diag_i[i + 1]; jA++) + { + if (A_diag_data[jA] <= strength_threshold * row_scale) + { + S_diag_j[jA] = -1; + } + } + for (jA = A_offd_i[i]; jA < A_offd_i[i + 1]; jA++) + { + if (A_offd_data[jA] <= strength_threshold * row_scale) + { + S_offd_j[jA] = -1; + } + } } - } - } - S_diag_i[num_variables] = jS; - hypre_CSRMatrixNumNonzeros(S_diag) = jS; - - /* RDF: not sure if able to thread this loop */ - jS = 0; - for (i = 0; i < num_variables; i++) - { - S_offd_i[i] = jS; - for (jA = A_offd_i[i]; jA < A_offd_i[i+1]; jA++) - { - if (S_offd_j[jA] > -1) + else { - S_offd_j[jS] = S_offd_j[jA]; - S_offd_data[jS] = S_offd_data[jA]; - jS++; + for (jA = A_diag_i[i] + 1; jA < A_diag_i[i + 1]; jA++) + { + if (A_diag_data[jA] >= strength_threshold * row_scale) + { + S_diag_j[jA] = -1; + } + } + for (jA = A_offd_i[i]; jA < A_offd_i[i + 1]; jA++) + { + if (A_offd_data[jA] >= strength_threshold * row_scale) + { + S_offd_j[jA] = -1; + } + } } - } - } - S_offd_i[num_variables] = jS; - hypre_CSRMatrixNumNonzeros(S_offd) = jS; - hypre_ParCSRMatrixCommPkg(S) = NULL; - - *S_ptr = S; - - hypre_TFree(dof_func_offd, HYPRE_MEMORY_HOST); - - return (ierr); + } + } + } + + /*-------------------------------------------------------------- + * "Compress" the strength matrix. + * + * NOTE: S has *NO DIAGONAL ELEMENT* on any row. Caveat Emptor! + * + * NOTE: This "compression" section of code may not be removed, the + * non-Galerkin routine depends on it. + *----------------------------------------------------------------*/ + + /* RDF: not sure if able to thread this loop */ + jS = 0; + for (i = 0; i < num_variables; i++) + { + S_diag_i[i] = jS; + for (jA = A_diag_i[i]; jA < A_diag_i[i + 1]; jA++) + { + if (S_diag_j[jA] > -1) + { + S_diag_j[jS] = S_diag_j[jA]; + S_diag_data[jS] = S_diag_data[jA]; + jS++; + } + } + } + S_diag_i[num_variables] = jS; + hypre_CSRMatrixNumNonzeros(S_diag) = jS; + + /* RDF: not sure if able to thread this loop */ + jS = 0; + for (i = 0; i < num_variables; i++) + { + S_offd_i[i] = jS; + for (jA = A_offd_i[i]; jA < A_offd_i[i + 1]; jA++) + { + if (S_offd_j[jA] > -1) + { + S_offd_j[jS] = S_offd_j[jA]; + S_offd_data[jS] = S_offd_data[jA]; + jS++; + } + } + } + S_offd_i[num_variables] = jS; + hypre_CSRMatrixNumNonzeros(S_offd) = jS; + hypre_ParCSRMatrixCommPkg(S) = NULL; + + *S_ptr = S; + + hypre_TFree(dof_func_offd, HYPRE_MEMORY_HOST); + + return (ierr); } /** * Initialize the IJBuffer counters **/ HYPRE_Int -hypre_NonGalerkinIJBufferInit( HYPRE_Int *ijbuf_cnt, /* See NonGalerkinIJBufferWrite for parameter descriptions */ +hypre_NonGalerkinIJBufferInit( HYPRE_Int + *ijbuf_cnt, /* See NonGalerkinIJBufferWrite for parameter descriptions */ HYPRE_Int *ijbuf_rowcounter, HYPRE_Int *ijbuf_numcols ) { - HYPRE_Int ierr = 0; + HYPRE_Int ierr = 0; - (*ijbuf_cnt) = 0; - (*ijbuf_rowcounter) = 1; /*Always points to the next row*/ - ijbuf_numcols[0] = 0; + (*ijbuf_cnt) = 0; + (*ijbuf_rowcounter) = 1; /*Always points to the next row*/ + ijbuf_numcols[0] = 0; - return ierr; + return ierr; } @@ -610,17 +618,18 @@ hypre_NonGalerkinIJBufferInit( HYPRE_Int *ijbuf_cnt, /* See NonGal * Initialize the IJBuffer counters **/ HYPRE_Int -hypre_NonGalerkinIJBigBufferInit( HYPRE_Int *ijbuf_cnt, /* See NonGalerkinIJBufferWrite for parameter descriptions */ - HYPRE_Int *ijbuf_rowcounter, - HYPRE_BigInt *ijbuf_numcols ) +hypre_NonGalerkinIJBigBufferInit( HYPRE_Int + *ijbuf_cnt, /* See NonGalerkinIJBufferWrite for parameter descriptions */ + HYPRE_Int *ijbuf_rowcounter, + HYPRE_BigInt *ijbuf_numcols ) { - HYPRE_Int ierr = 0; + HYPRE_Int ierr = 0; - (*ijbuf_cnt) = 0; - (*ijbuf_rowcounter) = 1; /*Always points to the next row*/ - ijbuf_numcols[0] = 0; + (*ijbuf_cnt) = 0; + (*ijbuf_rowcounter) = 1; /*Always points to the next row*/ + ijbuf_numcols[0] = 0; - return ierr; + return ierr; } @@ -629,67 +638,71 @@ hypre_NonGalerkinIJBigBufferInit( HYPRE_Int *ijbuf_cnt, /* See Non * Update the buffer counters **/ HYPRE_Int -hypre_NonGalerkinIJBufferNewRow(HYPRE_BigInt *ijbuf_rownums, /* See NonGalerkinIJBufferWrite for parameter descriptions */ +hypre_NonGalerkinIJBufferNewRow(HYPRE_BigInt + *ijbuf_rownums, /* See NonGalerkinIJBufferWrite for parameter descriptions */ HYPRE_Int *ijbuf_numcols, HYPRE_Int *ijbuf_rowcounter, HYPRE_BigInt new_row) { - HYPRE_Int ierr = 0; - - /* First check to see if the previous row was empty, and if so, overwrite that row */ - if( ijbuf_numcols[(*ijbuf_rowcounter)-1] == 0 ) - { - ijbuf_rownums[(*ijbuf_rowcounter)-1] = new_row; - } - else - { - /* Move to the next row */ - ijbuf_rownums[(*ijbuf_rowcounter)] = new_row; - ijbuf_numcols[(*ijbuf_rowcounter)] = 0; - (*ijbuf_rowcounter)++; - } - - return ierr; + HYPRE_Int ierr = 0; + + /* First check to see if the previous row was empty, and if so, overwrite that row */ + if ( ijbuf_numcols[(*ijbuf_rowcounter) - 1] == 0 ) + { + ijbuf_rownums[(*ijbuf_rowcounter) - 1] = new_row; + } + else + { + /* Move to the next row */ + ijbuf_rownums[(*ijbuf_rowcounter)] = new_row; + ijbuf_numcols[(*ijbuf_rowcounter)] = 0; + (*ijbuf_rowcounter)++; + } + + return ierr; } /** * Compress the current row in an IJ Buffer by removing duplicate entries **/ HYPRE_Int -hypre_NonGalerkinIJBufferCompressRow( HYPRE_Int *ijbuf_cnt, /* See NonGalerkinIJBufferWrite for parameter descriptions */ +hypre_NonGalerkinIJBufferCompressRow( HYPRE_Int + *ijbuf_cnt, /* See NonGalerkinIJBufferWrite for parameter descriptions */ HYPRE_Int ijbuf_rowcounter, HYPRE_Real *ijbuf_data, HYPRE_BigInt *ijbuf_cols, HYPRE_BigInt *ijbuf_rownums, HYPRE_Int *ijbuf_numcols) { - HYPRE_Int ierr = 0; - HYPRE_Int nentries, i, nduplicate; - - /* Compress the current row by removing any repeat entries, - * making sure to decrement ijbuf_cnt by nduplicate */ - nentries = ijbuf_numcols[ ijbuf_rowcounter-1 ]; - nduplicate = 0; - hypre_BigQsort1(ijbuf_cols, ijbuf_data, (*ijbuf_cnt)-nentries, (*ijbuf_cnt)-1 ); - - for(i =(*ijbuf_cnt)-nentries+1; i <= (*ijbuf_cnt)-1; i++) - { - if( ijbuf_cols[i] == ijbuf_cols[i-1] ) - { - /* Shift duplicate entry down */ - nduplicate++; - ijbuf_data[i - nduplicate] += ijbuf_data[i]; - } - else if(nduplicate > 0) - { - ijbuf_data[i - nduplicate] = ijbuf_data[i]; - ijbuf_cols[i - nduplicate] = ijbuf_cols[i]; - } - } - (*ijbuf_cnt) -= nduplicate; - ijbuf_numcols[ ijbuf_rowcounter-1 ] -= nduplicate; - - return ierr; + HYPRE_UNUSED_VAR(ijbuf_rownums); + + HYPRE_Int ierr = 0; + HYPRE_Int nentries, i, nduplicate; + + /* Compress the current row by removing any repeat entries, + * making sure to decrement ijbuf_cnt by nduplicate */ + nentries = ijbuf_numcols[ ijbuf_rowcounter - 1 ]; + nduplicate = 0; + hypre_BigQsort1(ijbuf_cols, ijbuf_data, (*ijbuf_cnt) - nentries, (*ijbuf_cnt) - 1 ); + + for (i = (*ijbuf_cnt) - nentries + 1; i <= (*ijbuf_cnt) - 1; i++) + { + if ( ijbuf_cols[i] == ijbuf_cols[i - 1] ) + { + /* Shift duplicate entry down */ + nduplicate++; + ijbuf_data[i - nduplicate] += ijbuf_data[i]; + } + else if (nduplicate > 0) + { + ijbuf_data[i - nduplicate] = ijbuf_data[i]; + ijbuf_cols[i - nduplicate] = ijbuf_cols[i]; + } + } + (*ijbuf_cnt) -= nduplicate; + ijbuf_numcols[ ijbuf_rowcounter - 1 ] -= nduplicate; + + return ierr; } @@ -698,129 +711,131 @@ hypre_NonGalerkinIJBufferCompressRow( HYPRE_Int *ijbuf_cnt, /* See Non * Compress the entire buffer, removing duplicate rows **/ HYPRE_Int -hypre_NonGalerkinIJBufferCompress( HYPRE_Int ijbuf_size, - HYPRE_Int *ijbuf_cnt, /* See NonGalerkinIJBufferWrite for parameter descriptions */ - HYPRE_Int *ijbuf_rowcounter, - HYPRE_Real **ijbuf_data, - HYPRE_BigInt **ijbuf_cols, - HYPRE_BigInt **ijbuf_rownums, - HYPRE_Int **ijbuf_numcols) +hypre_NonGalerkinIJBufferCompress( HYPRE_MemoryLocation memory_location, + HYPRE_Int ijbuf_size, + HYPRE_Int *ijbuf_cnt, /* See NonGalerkinIJBufferWrite for parameter descriptions */ + HYPRE_Int *ijbuf_rowcounter, + HYPRE_Real **ijbuf_data, + HYPRE_BigInt **ijbuf_cols, + HYPRE_BigInt **ijbuf_rownums, + HYPRE_Int **ijbuf_numcols) { - HYPRE_Int ierr = 0; - HYPRE_Int *indys = hypre_CTAlloc(HYPRE_Int, (*ijbuf_rowcounter) , HYPRE_MEMORY_HOST); - - HYPRE_Int i, j, duplicate, cnt_new, rowcounter_new, prev_row; - HYPRE_Int row_loc; - HYPRE_BigInt row_start, row_stop, row; - - HYPRE_Real *data_new; - HYPRE_BigInt *cols_new; - HYPRE_BigInt *rownums_new; - HYPRE_Int *numcols_new; - - - /* Do a sort on rownums, but store the original order in indys. - * Then see if there are any duplicate rows */ - for(i = 0; i < (*ijbuf_rowcounter); i++) - { indys[i] = i; } - hypre_BigQsortbi((*ijbuf_rownums), indys, 0, (*ijbuf_rowcounter)-1); - duplicate = 0; - for(i = 1; i < (*ijbuf_rowcounter); i++) - { - if(indys[i] != (indys[i-1]+1)) - { - duplicate = 1; - break; - } - } - - /* Compress duplicate rows */ - if(duplicate) - { - - /* Accumulate numcols, so that it functions like a CSR row-pointer */ - for(i = 1; i < (*ijbuf_rowcounter); i++) - { (*ijbuf_numcols)[i] += (*ijbuf_numcols)[i-1]; } - - /* Initialize new buffer */ - prev_row = -1; - rowcounter_new = 0; - cnt_new = 0; - data_new = hypre_CTAlloc(HYPRE_Real, ijbuf_size, HYPRE_MEMORY_DEVICE); - cols_new = hypre_CTAlloc(HYPRE_BigInt, ijbuf_size, HYPRE_MEMORY_DEVICE); - rownums_new = hypre_CTAlloc(HYPRE_BigInt, ijbuf_size, HYPRE_MEMORY_DEVICE); - numcols_new = hypre_CTAlloc(HYPRE_Int, ijbuf_size, HYPRE_MEMORY_DEVICE); - numcols_new[0] = 0; - - /* Cycle through each row */ - for(i = 0; i < (*ijbuf_rowcounter); i++) - { - - /* Find which row this is in local and global numberings, and where - * this row's data starts and stops in the buffer*/ - row_loc = indys[i]; - row = (*ijbuf_rownums)[i]; - if(row_loc > 0) + HYPRE_Int ierr = 0; + HYPRE_Int *indys = hypre_CTAlloc(HYPRE_Int, (*ijbuf_rowcounter), + HYPRE_MEMORY_HOST); + + HYPRE_Int i, duplicate, cnt_new, rowcounter_new; + HYPRE_Int row_loc; + HYPRE_BigInt row_start, row_stop, row, prev_row, j; + + HYPRE_Real *data_new; + HYPRE_BigInt *cols_new; + HYPRE_BigInt *rownums_new; + HYPRE_Int *numcols_new; + + /* Do a sort on rownums, but store the original order in indys. + * Then see if there are any duplicate rows */ + for (i = 0; i < (*ijbuf_rowcounter); i++) + { + indys[i] = i; + } + hypre_BigQsortbi((*ijbuf_rownums), indys, 0, (*ijbuf_rowcounter) - 1); + duplicate = 0; + for (i = 1; i < (*ijbuf_rowcounter); i++) + { + if (indys[i] != (indys[i - 1] + 1)) + { + duplicate = 1; + break; + } + } + + /* Compress duplicate rows */ + if (duplicate) + { + /* Accumulate numcols, so that it functions like a CSR row-pointer */ + for (i = 1; i < (*ijbuf_rowcounter); i++) + { (*ijbuf_numcols)[i] += (*ijbuf_numcols)[i - 1]; } + + /* Initialize new buffer */ + prev_row = -1; + rowcounter_new = 0; + cnt_new = 0; + data_new = hypre_CTAlloc(HYPRE_Real, ijbuf_size, memory_location); + cols_new = hypre_CTAlloc(HYPRE_BigInt, ijbuf_size, memory_location); + rownums_new = hypre_CTAlloc(HYPRE_BigInt, ijbuf_size, memory_location); + numcols_new = hypre_CTAlloc(HYPRE_Int, ijbuf_size, memory_location); + numcols_new[0] = 0; + + /* Cycle through each row */ + for (i = 0; i < (*ijbuf_rowcounter); i++) + { + + /* Find which row this is in local and global numberings, and where + * this row's data starts and stops in the buffer*/ + row_loc = indys[i]; + row = (*ijbuf_rownums)[i]; + if (row_loc > 0) + { + row_start = (HYPRE_BigInt) (*ijbuf_numcols)[row_loc - 1]; + row_stop = (HYPRE_BigInt) (*ijbuf_numcols)[row_loc]; + } + else + { + row_start = 0; + row_stop = (HYPRE_BigInt) (*ijbuf_numcols)[row_loc]; + } + + /* Is this a new row? If so, compress previous row, and add a new + * one. Noting that prev_row = -1 is a special value */ + if (row != prev_row) + { + if (prev_row != -1) { - row_start = (*ijbuf_numcols)[row_loc-1]; - row_stop = (*ijbuf_numcols)[row_loc]; + /* Compress previous row */ + hypre_NonGalerkinIJBufferCompressRow(&cnt_new, rowcounter_new, data_new, + cols_new, rownums_new, numcols_new); } - else - { - row_start = 0; - row_stop = (*ijbuf_numcols)[row_loc]; - } - - /* Is this a new row? If so, compress previous row, and add a new - * one. Noting that prev_row = -1 is a special value */ - if(row != prev_row) - { - if(prev_row != -1) - { - /* Compress previous row */ - hypre_NonGalerkinIJBufferCompressRow(&cnt_new, rowcounter_new, data_new, - cols_new, rownums_new, numcols_new); - } - prev_row = row; - numcols_new[rowcounter_new] = 0; - rownums_new[rowcounter_new] = row; - rowcounter_new++; - } - - /* Copy row into new buffer */ - for(j = row_start; j < row_stop; j++) - { - data_new[cnt_new] = (*ijbuf_data)[j]; - cols_new[cnt_new] = (*ijbuf_cols)[j]; - numcols_new[rowcounter_new-1]++; - cnt_new++; - } - } - - /* Compress the final row */ - if(i > 1) - { - hypre_NonGalerkinIJBufferCompressRow(&cnt_new, rowcounter_new, data_new, - cols_new, rownums_new, numcols_new); - } - - *ijbuf_cnt = cnt_new; - *ijbuf_rowcounter = rowcounter_new; - - /* Point to the new buffer */ - hypre_TFree(*ijbuf_data, HYPRE_MEMORY_DEVICE); - hypre_TFree(*ijbuf_cols, HYPRE_MEMORY_DEVICE); - hypre_TFree(*ijbuf_rownums, HYPRE_MEMORY_DEVICE); - hypre_TFree(*ijbuf_numcols, HYPRE_MEMORY_DEVICE); - (*ijbuf_data) = data_new; - (*ijbuf_cols) = cols_new; - (*ijbuf_rownums) = rownums_new; - (*ijbuf_numcols) = numcols_new; - } - - hypre_TFree(indys, HYPRE_MEMORY_HOST); - - return ierr; + prev_row = row; + numcols_new[rowcounter_new] = 0; + rownums_new[rowcounter_new] = row; + rowcounter_new++; + } + + /* Copy row into new buffer */ + for (j = row_start; j < row_stop; j++) + { + data_new[cnt_new] = (*ijbuf_data)[j]; + cols_new[cnt_new] = (*ijbuf_cols)[j]; + numcols_new[rowcounter_new - 1]++; + cnt_new++; + } + } + + /* Compress the final row */ + if (i > 1) + { + hypre_NonGalerkinIJBufferCompressRow(&cnt_new, rowcounter_new, data_new, + cols_new, rownums_new, numcols_new); + } + + *ijbuf_cnt = cnt_new; + *ijbuf_rowcounter = rowcounter_new; + + /* Point to the new buffer */ + hypre_TFree(*ijbuf_data, memory_location); + hypre_TFree(*ijbuf_cols, memory_location); + hypre_TFree(*ijbuf_rownums, memory_location); + hypre_TFree(*ijbuf_numcols, memory_location); + (*ijbuf_data) = data_new; + (*ijbuf_cols) = cols_new; + (*ijbuf_rownums) = rownums_new; + (*ijbuf_numcols) = numcols_new; + } + + hypre_TFree(indys, HYPRE_MEMORY_HOST); + + return ierr; } @@ -832,64 +847,71 @@ hypre_NonGalerkinIJBufferCompress( HYPRE_Int ijbuf_size, * A[row_to_write, col_to_write] += val_to_write **/ HYPRE_Int -hypre_NonGalerkinIJBufferWrite( HYPRE_IJMatrix B, /* Unassembled matrix to add an entry to */ +hypre_NonGalerkinIJBufferWrite( HYPRE_IJMatrix + B, /* Unassembled matrix to add an entry to */ HYPRE_Int *ijbuf_cnt, /* current buffer size */ HYPRE_Int ijbuf_size, /* max buffer size */ HYPRE_Int *ijbuf_rowcounter, /* num of rows in rownums, (i.e., size of rownums) */ - /* This counter will increase as you call this function for multiple rows */ + /* This counter will increase as you call this function for multiple rows */ HYPRE_Real **ijbuf_data, /* Array of values, of size ijbuf_size */ HYPRE_BigInt **ijbuf_cols, /* Array of col indices, of size ijbuf_size */ - HYPRE_BigInt **ijbuf_rownums, /* Holds row-indices that with numcols makes for a CSR-like data structure*/ - HYPRE_Int **ijbuf_numcols, /* rownums[i] is the row num, and numcols holds the number of entries being added */ - /* for that row. Note numcols is not cumulative like an actual CSR data structure*/ + HYPRE_BigInt + **ijbuf_rownums, /* Holds row-indices that with numcols makes for a CSR-like data structure*/ + HYPRE_Int + **ijbuf_numcols, /* rownums[i] is the row num, and numcols holds the number of entries being added */ + /* for that row. Note numcols is not cumulative like an actual CSR data structure*/ HYPRE_BigInt row_to_write, /* Entry to add to the buffer */ HYPRE_BigInt col_to_write, /* Ditto */ HYPRE_Real val_to_write ) /* Ditto */ { - HYPRE_Int ierr = 0; - - - if( (*ijbuf_cnt) == 0 ) - { - /* brand new buffer: increment buffer structures for the new row */ - hypre_NonGalerkinIJBufferNewRow((*ijbuf_rownums), (*ijbuf_numcols), ijbuf_rowcounter, row_to_write); - - } - else if((*ijbuf_rownums)[ (*ijbuf_rowcounter)-1 ] != row_to_write) - { - /* If this is a new row, compress the previous row */ - hypre_NonGalerkinIJBufferCompressRow(ijbuf_cnt, (*ijbuf_rowcounter), (*ijbuf_data), - (*ijbuf_cols), (*ijbuf_rownums), (*ijbuf_numcols)); - /* increment buffer structures for the new row */ - hypre_NonGalerkinIJBufferNewRow( (*ijbuf_rownums), (*ijbuf_numcols), ijbuf_rowcounter, row_to_write); - } - - /* Add new entry to buffer */ - (*ijbuf_cols)[(*ijbuf_cnt)] = col_to_write; - (*ijbuf_data)[(*ijbuf_cnt)] = val_to_write; - (*ijbuf_numcols)[ (*ijbuf_rowcounter)-1 ]++; - (*ijbuf_cnt)++; - - /* Buffer is full, write to the matrix object */ - if ( (*ijbuf_cnt) == (ijbuf_size-1) ) - { - /* If the last row is empty, decrement rowcounter */ - if( (*ijbuf_numcols)[ (*ijbuf_rowcounter)-1 ] == 0) - { (*ijbuf_rowcounter)--; } - - /* Compress and Add Entries */ - hypre_NonGalerkinIJBufferCompressRow(ijbuf_cnt, (*ijbuf_rowcounter), (*ijbuf_data), - (*ijbuf_cols), (*ijbuf_rownums), (*ijbuf_numcols)); - hypre_NonGalerkinIJBufferCompress(ijbuf_size, ijbuf_cnt, ijbuf_rowcounter, ijbuf_data, - ijbuf_cols, ijbuf_rownums, ijbuf_numcols); - ierr += HYPRE_IJMatrixAddToValues(B, *ijbuf_rowcounter, (*ijbuf_numcols), (*ijbuf_rownums), (*ijbuf_cols), (*ijbuf_data)); - - /* Reinitialize the buffer */ - hypre_NonGalerkinIJBufferInit( ijbuf_cnt, ijbuf_rowcounter, (*ijbuf_numcols)); - hypre_NonGalerkinIJBufferNewRow((*ijbuf_rownums), (*ijbuf_numcols), ijbuf_rowcounter, row_to_write); - } - - return ierr; + HYPRE_Int ierr = 0; + + HYPRE_MemoryLocation memory_location = hypre_IJMatrixMemoryLocation(B); + + if ( (*ijbuf_cnt) == 0 ) + { + /* brand new buffer: increment buffer structures for the new row */ + hypre_NonGalerkinIJBufferNewRow((*ijbuf_rownums), (*ijbuf_numcols), ijbuf_rowcounter, row_to_write); + + } + else if ((*ijbuf_rownums)[ (*ijbuf_rowcounter) - 1 ] != row_to_write) + { + /* If this is a new row, compress the previous row */ + hypre_NonGalerkinIJBufferCompressRow(ijbuf_cnt, (*ijbuf_rowcounter), (*ijbuf_data), + (*ijbuf_cols), (*ijbuf_rownums), (*ijbuf_numcols)); + /* increment buffer structures for the new row */ + hypre_NonGalerkinIJBufferNewRow( (*ijbuf_rownums), (*ijbuf_numcols), ijbuf_rowcounter, + row_to_write); + } + + /* Add new entry to buffer */ + (*ijbuf_cols)[(*ijbuf_cnt)] = col_to_write; + (*ijbuf_data)[(*ijbuf_cnt)] = val_to_write; + (*ijbuf_numcols)[ (*ijbuf_rowcounter) - 1 ]++; + (*ijbuf_cnt)++; + + /* Buffer is full, write to the matrix object */ + if ( (*ijbuf_cnt) == (ijbuf_size - 1) ) + { + /* If the last row is empty, decrement rowcounter */ + if ( (*ijbuf_numcols)[ (*ijbuf_rowcounter) - 1 ] == 0) + { (*ijbuf_rowcounter)--; } + + /* Compress and Add Entries */ + hypre_NonGalerkinIJBufferCompressRow(ijbuf_cnt, (*ijbuf_rowcounter), (*ijbuf_data), + (*ijbuf_cols), (*ijbuf_rownums), (*ijbuf_numcols)); + hypre_NonGalerkinIJBufferCompress(memory_location, ijbuf_size, ijbuf_cnt, ijbuf_rowcounter, + ijbuf_data, + ijbuf_cols, ijbuf_rownums, ijbuf_numcols); + ierr += HYPRE_IJMatrixAddToValues(B, *ijbuf_rowcounter, (*ijbuf_numcols), (*ijbuf_rownums), + (*ijbuf_cols), (*ijbuf_data)); + + /* Reinitialize the buffer */ + hypre_NonGalerkinIJBufferInit( ijbuf_cnt, ijbuf_rowcounter, (*ijbuf_numcols)); + hypre_NonGalerkinIJBufferNewRow((*ijbuf_rownums), (*ijbuf_numcols), ijbuf_rowcounter, row_to_write); + } + + return ierr; } @@ -897,7 +919,8 @@ hypre_NonGalerkinIJBufferWrite( HYPRE_IJMatrix B, /* Unassembled * Empty the IJ Buffer with a final AddToValues. **/ HYPRE_Int -hypre_NonGalerkinIJBufferEmpty(HYPRE_IJMatrix B, /* See NonGalerkinIJBufferWrite for parameter descriptions */ +hypre_NonGalerkinIJBufferEmpty(HYPRE_IJMatrix + B, /* See NonGalerkinIJBufferWrite for parameter descriptions */ HYPRE_Int ijbuf_size, HYPRE_Int *ijbuf_cnt, HYPRE_Int ijbuf_rowcounter, @@ -906,20 +929,23 @@ hypre_NonGalerkinIJBufferEmpty(HYPRE_IJMatrix B, /* See NonGalerkinI HYPRE_BigInt **ijbuf_rownums, HYPRE_Int **ijbuf_numcols) { - HYPRE_Int ierr = 0; - - if( (*ijbuf_cnt) > 0) - { - /* Compress the last row and then write */ - hypre_NonGalerkinIJBufferCompressRow(ijbuf_cnt, ijbuf_rowcounter, (*ijbuf_data), - (*ijbuf_cols), (*ijbuf_rownums), (*ijbuf_numcols)); - hypre_NonGalerkinIJBufferCompress(ijbuf_size, ijbuf_cnt, &ijbuf_rowcounter, ijbuf_data, - ijbuf_cols, ijbuf_rownums, ijbuf_numcols); - ierr += HYPRE_IJMatrixAddToValues(B, ijbuf_rowcounter, (*ijbuf_numcols), (*ijbuf_rownums), (*ijbuf_cols), (*ijbuf_data)); - } - (*ijbuf_cnt = 0); - - return ierr; + HYPRE_Int ierr = 0; + HYPRE_MemoryLocation memory_location = hypre_IJMatrixMemoryLocation(B); + + if ( (*ijbuf_cnt) > 0) + { + /* Compress the last row and then write */ + hypre_NonGalerkinIJBufferCompressRow(ijbuf_cnt, ijbuf_rowcounter, (*ijbuf_data), + (*ijbuf_cols), (*ijbuf_rownums), (*ijbuf_numcols)); + hypre_NonGalerkinIJBufferCompress(memory_location, ijbuf_size, ijbuf_cnt, &ijbuf_rowcounter, + ijbuf_data, + ijbuf_cols, ijbuf_rownums, ijbuf_numcols); + ierr += HYPRE_IJMatrixAddToValues(B, ijbuf_rowcounter, (*ijbuf_numcols), (*ijbuf_rownums), + (*ijbuf_cols), (*ijbuf_data)); + } + (*ijbuf_cnt = 0); + + return ierr; } @@ -934,275 +960,284 @@ hypre_NonGalerkinSparsityPattern(hypre_ParCSRMatrix *R_IAP, HYPRE_Int sym_collapse, HYPRE_Int collapse_beta ) { - /* MPI Communicator */ - MPI_Comm comm = hypre_ParCSRMatrixComm(RAP); - - /* Declare R_IAP */ - hypre_CSRMatrix *R_IAP_diag = hypre_ParCSRMatrixDiag(R_IAP); - HYPRE_Int *R_IAP_diag_i = hypre_CSRMatrixI(R_IAP_diag); - HYPRE_Int *R_IAP_diag_j = hypre_CSRMatrixJ(R_IAP_diag); - - hypre_CSRMatrix *R_IAP_offd = hypre_ParCSRMatrixOffd(R_IAP); - HYPRE_Int *R_IAP_offd_i = hypre_CSRMatrixI(R_IAP_offd); - HYPRE_Int *R_IAP_offd_j = hypre_CSRMatrixJ(R_IAP_offd); - HYPRE_BigInt *col_map_offd_R_IAP = hypre_ParCSRMatrixColMapOffd(R_IAP); - - /* Declare RAP */ - hypre_CSRMatrix *RAP_diag = hypre_ParCSRMatrixDiag(RAP); - HYPRE_Int *RAP_diag_i = hypre_CSRMatrixI(RAP_diag); - HYPRE_Real *RAP_diag_data = hypre_CSRMatrixData(RAP_diag); - HYPRE_Int *RAP_diag_j = hypre_CSRMatrixJ(RAP_diag); - HYPRE_BigInt first_col_diag_RAP = hypre_ParCSRMatrixFirstColDiag(RAP); - HYPRE_Int num_cols_diag_RAP = hypre_CSRMatrixNumCols(RAP_diag); - HYPRE_BigInt last_col_diag_RAP = first_col_diag_RAP + (HYPRE_BigInt)num_cols_diag_RAP - 1; - - hypre_CSRMatrix *RAP_offd = hypre_ParCSRMatrixOffd(RAP); - HYPRE_Int *RAP_offd_i = hypre_CSRMatrixI(RAP_offd); - HYPRE_Real *RAP_offd_data = NULL; - HYPRE_Int *RAP_offd_j = hypre_CSRMatrixJ(RAP_offd); - HYPRE_BigInt *col_map_offd_RAP = hypre_ParCSRMatrixColMapOffd(RAP); - HYPRE_Int num_cols_RAP_offd = hypre_CSRMatrixNumCols(RAP_offd); - - HYPRE_Int num_variables = hypre_CSRMatrixNumRows(RAP_diag); - - /* Declare A */ - HYPRE_Int num_fine_variables = hypre_CSRMatrixNumRows(R_IAP_diag); - - /* Declare IJ matrices */ - HYPRE_IJMatrix Pattern; - hypre_ParCSRMatrix *Pattern_CSR = NULL; - - /* Buffered IJAddToValues */ - HYPRE_Int ijbuf_cnt, ijbuf_size, ijbuf_rowcounter; - HYPRE_Real *ijbuf_data; - HYPRE_BigInt *ijbuf_cols, *ijbuf_rownums; - HYPRE_Int *ijbuf_numcols; - - /* Buffered IJAddToValues for Symmetric Entries */ - HYPRE_Int ijbuf_sym_cnt, ijbuf_sym_rowcounter; - HYPRE_Real *ijbuf_sym_data; - HYPRE_BigInt *ijbuf_sym_cols, *ijbuf_sym_rownums; - HYPRE_Int *ijbuf_sym_numcols; - - /* Other Declarations */ - HYPRE_Int ierr = 0; - HYPRE_Real max_entry = 0.0; - HYPRE_Real max_entry_offd = 0.0; - HYPRE_Int * rownz = NULL; - HYPRE_Int i, j, Cpt; - HYPRE_BigInt row_start, row_end, global_row, global_col; - - /* Other Setup */ - if (num_cols_RAP_offd) - { RAP_offd_data = hypre_CSRMatrixData(RAP_offd); } - - - /* - * Initialize the IJ matrix, leveraging our rough knowledge of the - * nonzero structure of Pattern based on RAP - * - * ilower, iupper, jlower, jupper */ - ierr += HYPRE_IJMatrixCreate(comm, first_col_diag_RAP, last_col_diag_RAP, first_col_diag_RAP, last_col_diag_RAP, &Pattern); - ierr += HYPRE_IJMatrixSetObjectType(Pattern, HYPRE_PARCSR); - rownz = hypre_CTAlloc(HYPRE_Int, num_variables, HYPRE_MEMORY_HOST); - for(i = 0; i < num_variables; i++) - { rownz[i] = 1.2*(RAP_diag_i[i+1] - RAP_diag_i[i]) + 1.2*(RAP_offd_i[i+1] - RAP_offd_i[i]); } - HYPRE_IJMatrixSetRowSizes(Pattern, rownz); - ierr += HYPRE_IJMatrixInitialize(Pattern); - hypre_TFree(rownz, HYPRE_MEMORY_HOST); - - /* - *For efficiency, we do a buffered IJAddToValues. - * Here, we initialize the buffer and then initialize the buffer counters - */ - ijbuf_size = 1000; - ijbuf_data = hypre_CTAlloc(HYPRE_Real, ijbuf_size, HYPRE_MEMORY_DEVICE); - ijbuf_cols = hypre_CTAlloc(HYPRE_BigInt, ijbuf_size, HYPRE_MEMORY_DEVICE); - ijbuf_rownums = hypre_CTAlloc(HYPRE_BigInt, ijbuf_size, HYPRE_MEMORY_DEVICE); - ijbuf_numcols = hypre_CTAlloc(HYPRE_Int, ijbuf_size, HYPRE_MEMORY_DEVICE); - hypre_NonGalerkinIJBigBufferInit( &ijbuf_cnt, &ijbuf_rowcounter, ijbuf_cols ); - if(sym_collapse) - { - ijbuf_sym_data = hypre_CTAlloc(HYPRE_Real, ijbuf_size, HYPRE_MEMORY_DEVICE); - ijbuf_sym_cols = hypre_CTAlloc(HYPRE_BigInt, ijbuf_size, HYPRE_MEMORY_DEVICE); - ijbuf_sym_rownums= hypre_CTAlloc(HYPRE_BigInt, ijbuf_size, HYPRE_MEMORY_DEVICE); - ijbuf_sym_numcols= hypre_CTAlloc(HYPRE_Int, ijbuf_size, HYPRE_MEMORY_DEVICE); - hypre_NonGalerkinIJBigBufferInit( &ijbuf_sym_cnt, &ijbuf_sym_rowcounter, ijbuf_sym_cols ); - } - - - /* - * Place entries in R_IAP into Pattern - */ - Cpt = -1; /* Cpt contains the fine grid index of the i-th Cpt */ - for(i = 0; i < num_variables; i++) - { - global_row = i+first_col_diag_RAP; - - /* Find the next Coarse Point in CF_marker */ - for(j = Cpt+1; j < num_fine_variables; j++) - { - if(CF_marker[j] == 1) /* Found Next C-point */ - { - Cpt = j; - break; - } - } - - /* Diag Portion */ - row_start = R_IAP_diag_i[Cpt]; - row_end = R_IAP_diag_i[Cpt+1]; - for(j = row_start; j < row_end; j++) - { - global_col = R_IAP_diag_j[j] + first_col_diag_RAP; - /* This call adds a 1 x 1 to i j data */ - hypre_NonGalerkinIJBufferWrite( Pattern, &ijbuf_cnt, ijbuf_size, &ijbuf_rowcounter, - &ijbuf_data, &ijbuf_cols, &ijbuf_rownums, &ijbuf_numcols, global_row, - global_col, 1.0); + /* MPI Communicator */ + MPI_Comm comm = hypre_ParCSRMatrixComm(RAP); + + HYPRE_MemoryLocation memory_location_RAP = hypre_ParCSRMatrixMemoryLocation(RAP); + + /* Declare R_IAP */ + hypre_CSRMatrix *R_IAP_diag = hypre_ParCSRMatrixDiag(R_IAP); + HYPRE_Int *R_IAP_diag_i = hypre_CSRMatrixI(R_IAP_diag); + HYPRE_Int *R_IAP_diag_j = hypre_CSRMatrixJ(R_IAP_diag); + + hypre_CSRMatrix *R_IAP_offd = hypre_ParCSRMatrixOffd(R_IAP); + HYPRE_Int *R_IAP_offd_i = hypre_CSRMatrixI(R_IAP_offd); + HYPRE_Int *R_IAP_offd_j = hypre_CSRMatrixJ(R_IAP_offd); + HYPRE_BigInt *col_map_offd_R_IAP = hypre_ParCSRMatrixColMapOffd(R_IAP); + + /* Declare RAP */ + hypre_CSRMatrix *RAP_diag = hypre_ParCSRMatrixDiag(RAP); + HYPRE_Int *RAP_diag_i = hypre_CSRMatrixI(RAP_diag); + HYPRE_Real *RAP_diag_data = hypre_CSRMatrixData(RAP_diag); + HYPRE_Int *RAP_diag_j = hypre_CSRMatrixJ(RAP_diag); + HYPRE_BigInt first_col_diag_RAP = hypre_ParCSRMatrixFirstColDiag(RAP); + HYPRE_Int num_cols_diag_RAP = hypre_CSRMatrixNumCols(RAP_diag); + HYPRE_BigInt last_col_diag_RAP = first_col_diag_RAP + (HYPRE_BigInt)num_cols_diag_RAP - 1; + + hypre_CSRMatrix *RAP_offd = hypre_ParCSRMatrixOffd(RAP); + HYPRE_Int *RAP_offd_i = hypre_CSRMatrixI(RAP_offd); + HYPRE_Real *RAP_offd_data = NULL; + HYPRE_Int *RAP_offd_j = hypre_CSRMatrixJ(RAP_offd); + HYPRE_BigInt *col_map_offd_RAP = hypre_ParCSRMatrixColMapOffd(RAP); + HYPRE_Int num_cols_RAP_offd = hypre_CSRMatrixNumCols(RAP_offd); + + HYPRE_Int num_variables = hypre_CSRMatrixNumRows(RAP_diag); + + /* Declare A */ + HYPRE_Int num_fine_variables = hypre_CSRMatrixNumRows(R_IAP_diag); + + /* Declare IJ matrices */ + HYPRE_IJMatrix Pattern; + hypre_ParCSRMatrix *Pattern_CSR = NULL; + + /* Buffered IJAddToValues */ + HYPRE_Int ijbuf_cnt, ijbuf_size, ijbuf_rowcounter; + HYPRE_Real *ijbuf_data; + HYPRE_BigInt *ijbuf_cols, *ijbuf_rownums; + HYPRE_Int *ijbuf_numcols; + + /* Buffered IJAddToValues for Symmetric Entries */ + HYPRE_Int ijbuf_sym_cnt, ijbuf_sym_rowcounter; + HYPRE_Real *ijbuf_sym_data; + HYPRE_BigInt *ijbuf_sym_cols, *ijbuf_sym_rownums; + HYPRE_Int *ijbuf_sym_numcols; + + /* Other Declarations */ + HYPRE_Real max_entry = 0.0; + HYPRE_Real max_entry_offd = 0.0; + HYPRE_Int *rownz = NULL; + HYPRE_Int i, j, Cpt, row_start, row_end; + HYPRE_BigInt global_row, global_col; + + HYPRE_ANNOTATE_FUNC_BEGIN; + + /* Other Setup */ + if (num_cols_RAP_offd) + { + RAP_offd_data = hypre_CSRMatrixData(RAP_offd); + } + + /* + * Initialize the IJ matrix, leveraging our rough knowledge of the + * nonzero structure of Pattern based on RAP + * + * ilower, iupper, jlower, jupper */ + HYPRE_IJMatrixCreate(comm, first_col_diag_RAP, last_col_diag_RAP, first_col_diag_RAP, + last_col_diag_RAP, &Pattern); + HYPRE_IJMatrixSetObjectType(Pattern, HYPRE_PARCSR); + rownz = hypre_CTAlloc(HYPRE_Int, num_variables, HYPRE_MEMORY_HOST); + for (i = 0; i < num_variables; i++) + { + rownz[i] = (HYPRE_Int)(1.2 * (RAP_diag_i[i + 1] - RAP_diag_i[i]) + + 1.2 * (RAP_offd_i[i + 1] - RAP_offd_i[i])); + } + HYPRE_IJMatrixSetRowSizes(Pattern, rownz); + HYPRE_IJMatrixInitialize(Pattern); + hypre_TFree(rownz, HYPRE_MEMORY_HOST); + + /* + * For efficiency, we do a buffered IJAddToValues. + * Here, we initialize the buffer and then initialize the buffer counters + */ + ijbuf_size = 1000; + ijbuf_data = hypre_CTAlloc(HYPRE_Real, ijbuf_size, memory_location_RAP); + ijbuf_cols = hypre_CTAlloc(HYPRE_BigInt, ijbuf_size, memory_location_RAP); + ijbuf_rownums = hypre_CTAlloc(HYPRE_BigInt, ijbuf_size, memory_location_RAP); + ijbuf_numcols = hypre_CTAlloc(HYPRE_Int, ijbuf_size, memory_location_RAP); + hypre_NonGalerkinIJBigBufferInit(&ijbuf_cnt, &ijbuf_rowcounter, ijbuf_cols); + if (sym_collapse) + { + ijbuf_sym_data = hypre_CTAlloc(HYPRE_Real, ijbuf_size, memory_location_RAP); + ijbuf_sym_cols = hypre_CTAlloc(HYPRE_BigInt, ijbuf_size, memory_location_RAP); + ijbuf_sym_rownums = hypre_CTAlloc(HYPRE_BigInt, ijbuf_size, memory_location_RAP); + ijbuf_sym_numcols = hypre_CTAlloc(HYPRE_Int, ijbuf_size, memory_location_RAP); + hypre_NonGalerkinIJBigBufferInit(&ijbuf_sym_cnt, &ijbuf_sym_rowcounter, ijbuf_sym_cols); + } + + /* + * Place entries in R_IAP into Pattern + */ + Cpt = -1; /* Cpt contains the fine grid index of the i-th Cpt */ + for (i = 0; i < num_variables; i++) + { + global_row = i + first_col_diag_RAP; + + /* Find the next Coarse Point in CF_marker */ + for (j = Cpt + 1; j < num_fine_variables; j++) + { + if (CF_marker[j] == 1) /* Found Next C-point */ + { + Cpt = j; + break; + } + } + + /* Diag Portion */ + row_start = R_IAP_diag_i[Cpt]; + row_end = R_IAP_diag_i[Cpt + 1]; + for (j = row_start; j < row_end; j++) + { + global_col = R_IAP_diag_j[j] + first_col_diag_RAP; + /* This call adds a 1 x 1 to i j data */ + hypre_NonGalerkinIJBufferWrite(Pattern, &ijbuf_cnt, ijbuf_size, &ijbuf_rowcounter, + &ijbuf_data, &ijbuf_cols, &ijbuf_rownums, &ijbuf_numcols, + global_row, global_col, 1.0); + if (sym_collapse) + { + hypre_NonGalerkinIJBufferWrite(Pattern, &ijbuf_sym_cnt, + ijbuf_size, &ijbuf_sym_rowcounter, &ijbuf_sym_data, + &ijbuf_sym_cols, &ijbuf_sym_rownums, &ijbuf_sym_numcols, + global_col, global_row, 1.0); + } + } + + /* Offdiag Portion */ + row_start = R_IAP_offd_i[Cpt]; + row_end = R_IAP_offd_i[Cpt + 1]; + for (j = row_start; j < row_end; j++) + { + global_col = col_map_offd_R_IAP[R_IAP_offd_j[j]]; + /* This call adds a 1 x 1 to i j data */ + hypre_NonGalerkinIJBufferWrite(Pattern, &ijbuf_cnt, ijbuf_size, &ijbuf_rowcounter, + &ijbuf_data, &ijbuf_cols, &ijbuf_rownums, &ijbuf_numcols, + global_row, global_col, 1.0); + + if (sym_collapse) + { + hypre_NonGalerkinIJBufferWrite(Pattern, &ijbuf_sym_cnt, + ijbuf_size, &ijbuf_sym_rowcounter, &ijbuf_sym_data, + &ijbuf_sym_cols, &ijbuf_sym_rownums, &ijbuf_sym_numcols, + global_col, global_row, 1.0); + } + } + } + + /* + * Use drop-tolerance to compute new entries for sparsity pattern + */ + /*#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i,j,max_entry,max_entry_offd,global_col,global_row) HYPRE_SMP_SCHEDULE + #endif */ + for (i = 0; i < num_variables; i++) + { + global_row = i + first_col_diag_RAP; + + /* Compute the drop tolerance for this row, which is just + * abs(max of row i)*droptol */ + max_entry = -1.0; + for (j = RAP_diag_i[i]; j < RAP_diag_i[i + 1]; j++) + { + if ( (RAP_diag_j[j] != i) && (max_entry < hypre_abs(RAP_diag_data[j]) ) ) + { max_entry = hypre_abs(RAP_diag_data[j]); } + } + for (j = RAP_offd_i[i]; j < RAP_offd_i[i + 1]; j++) + { + { + if ( max_entry < hypre_abs(RAP_offd_data[j]) ) + { max_entry = hypre_abs(RAP_offd_data[j]); } + } + } + max_entry *= droptol; + max_entry_offd = max_entry * collapse_beta; + + /* Loop over diag portion, adding all entries that are "strong" */ + for (j = RAP_diag_i[i]; j < RAP_diag_i[i + 1]; j++) + { + if ( hypre_abs(RAP_diag_data[j]) > max_entry ) + { + global_col = RAP_diag_j[j] + first_col_diag_RAP; + /*#ifdef HYPRE_USING_OPENMP + #pragma omp critical (IJAdd) + #endif + {*/ + /* For efficiency, we do a buffered IJAddToValues + * A[global_row, global_col] += 1.0 */ + hypre_NonGalerkinIJBufferWrite(Pattern, &ijbuf_cnt, ijbuf_size, &ijbuf_rowcounter, + &ijbuf_data, &ijbuf_cols, &ijbuf_rownums, &ijbuf_numcols, + global_row, global_col, 1.0); if (sym_collapse) { - hypre_NonGalerkinIJBufferWrite( Pattern, &ijbuf_sym_cnt, - ijbuf_size, &ijbuf_sym_rowcounter, &ijbuf_sym_data, - &ijbuf_sym_cols, &ijbuf_sym_rownums, &ijbuf_sym_numcols, - global_col, global_row, 1.0); + hypre_NonGalerkinIJBufferWrite(Pattern, &ijbuf_sym_cnt, + ijbuf_size, &ijbuf_sym_rowcounter, &ijbuf_sym_data, + &ijbuf_sym_cols, &ijbuf_sym_rownums, &ijbuf_sym_numcols, + global_col, global_row, 1.0); } - } - - /* Offdiag Portion */ - row_start = R_IAP_offd_i[Cpt]; - row_end = R_IAP_offd_i[Cpt+1]; - for(j = row_start; j < row_end; j++) - { - global_col = col_map_offd_R_IAP[ R_IAP_offd_j[j] ]; - /* This call adds a 1 x 1 to i j data */ - hypre_NonGalerkinIJBufferWrite( Pattern, &ijbuf_cnt, ijbuf_size, &ijbuf_rowcounter, - &ijbuf_data, &ijbuf_cols, &ijbuf_rownums, &ijbuf_numcols, global_row, - global_col, 1.0); - + /*}*/ + } + } + + /* Loop over offd portion, adding all entries that are "strong" */ + for (j = RAP_offd_i[i]; j < RAP_offd_i[i + 1]; j++) + { + if ( hypre_abs(RAP_offd_data[j]) > max_entry_offd ) + { + global_col = col_map_offd_RAP[ RAP_offd_j[j] ]; + /*#ifdef HYPRE_USING_OPENMP + #pragma omp critical (IJAdd) + #endif + {*/ + /* For efficiency, we do a buffered IJAddToValues + * A[global_row, global_col] += 1.0 */ + hypre_NonGalerkinIJBufferWrite(Pattern, &ijbuf_cnt, ijbuf_size, &ijbuf_rowcounter, + &ijbuf_data, &ijbuf_cols, &ijbuf_rownums, &ijbuf_numcols, + global_row, global_col, 1.0); if (sym_collapse) { - hypre_NonGalerkinIJBufferWrite( Pattern, &ijbuf_sym_cnt, - ijbuf_size, &ijbuf_sym_rowcounter, &ijbuf_sym_data, - &ijbuf_sym_cols, &ijbuf_sym_rownums, &ijbuf_sym_numcols, - global_col, global_row, 1.0); - } - } - - } - - /* - * Use drop-tolerance to compute new entries for sparsity pattern - */ -/*#ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,j,max_entry,max_entry_offd,global_col,global_row) HYPRE_SMP_SCHEDULE -#endif */ - for(i = 0; i < num_variables; i++) - { - global_row = i+first_col_diag_RAP; - - /* Compute the drop tolerance for this row, which is just - * abs(max of row i)*droptol */ - max_entry = -1.0; - for(j = RAP_diag_i[i]; j < RAP_diag_i[i+1]; j++) - { - if( (RAP_diag_j[j] != i) && (max_entry < fabs(RAP_diag_data[j]) ) ) - { max_entry = fabs(RAP_diag_data[j]); } - } - for(j = RAP_offd_i[i]; j < RAP_offd_i[i+1]; j++) - { - { - if( max_entry < fabs(RAP_offd_data[j]) ) - { max_entry = fabs(RAP_offd_data[j]); } - } - } - max_entry *= droptol; - max_entry_offd = max_entry*collapse_beta; - - - /* Loop over diag portion, adding all entries that are "strong" */ - for(j = RAP_diag_i[i]; j < RAP_diag_i[i+1]; j++) - { - if( fabs(RAP_diag_data[j]) > max_entry ) - { - global_col = RAP_diag_j[j] + first_col_diag_RAP; -/*#ifdef HYPRE_USING_OPENMP -#pragma omp critical (IJAdd) -#endif -{*/ - /* For efficiency, we do a buffered IJAddToValues - * A[global_row, global_col] += 1.0 */ - hypre_NonGalerkinIJBufferWrite( Pattern, &ijbuf_cnt, ijbuf_size, &ijbuf_rowcounter, - &ijbuf_data, &ijbuf_cols, &ijbuf_rownums, &ijbuf_numcols, global_row, - global_col, 1.0 ); - if(sym_collapse) - { - hypre_NonGalerkinIJBufferWrite( Pattern, &ijbuf_sym_cnt, - ijbuf_size, &ijbuf_sym_rowcounter, &ijbuf_sym_data, - &ijbuf_sym_cols, &ijbuf_sym_rownums, &ijbuf_sym_numcols, - global_col, global_row, 1.0 ); - } -/*}*/ - } - } - - /* Loop over offd portion, adding all entries that are "strong" */ - for(j = RAP_offd_i[i]; j < RAP_offd_i[i+1]; j++) - { - if( fabs(RAP_offd_data[j]) > max_entry_offd ) - { - global_col = col_map_offd_RAP[ RAP_offd_j[j] ]; -/*#ifdef HYPRE_USING_OPENMP -#pragma omp critical (IJAdd) -#endif -{*/ - /* For efficiency, we do a buffered IJAddToValues - * A[global_row, global_col] += 1.0 */ - hypre_NonGalerkinIJBufferWrite( Pattern, &ijbuf_cnt, ijbuf_size, &ijbuf_rowcounter, - &ijbuf_data, &ijbuf_cols, &ijbuf_rownums, &ijbuf_numcols, global_row, - global_col, 1.0 ); - if(sym_collapse) - { - hypre_NonGalerkinIJBufferWrite( Pattern, &ijbuf_sym_cnt, - ijbuf_size, &ijbuf_sym_rowcounter, &ijbuf_sym_data, - &ijbuf_sym_cols, &ijbuf_sym_rownums, &ijbuf_sym_numcols, - global_col, global_row, 1.0 ); - } -/*}*/ + hypre_NonGalerkinIJBufferWrite(Pattern, &ijbuf_sym_cnt, + ijbuf_size, &ijbuf_sym_rowcounter, &ijbuf_sym_data, + &ijbuf_sym_cols, &ijbuf_sym_rownums, &ijbuf_sym_numcols, + global_col, global_row, 1.0); } - } - - } - - /* For efficiency, we do a buffered IJAddToValues. - * This empties the buffer of any remaining values */ - hypre_NonGalerkinIJBufferEmpty(Pattern, ijbuf_size, &ijbuf_cnt, ijbuf_rowcounter, - &ijbuf_data, &ijbuf_cols, &ijbuf_rownums, &ijbuf_numcols); - if(sym_collapse) - hypre_NonGalerkinIJBufferEmpty(Pattern, ijbuf_size, &ijbuf_sym_cnt, ijbuf_sym_rowcounter, - &ijbuf_sym_data, &ijbuf_sym_cols, &ijbuf_sym_rownums, - &ijbuf_sym_numcols); - - /* Finalize Construction of Pattern */ - ierr += HYPRE_IJMatrixAssemble(Pattern); - ierr += HYPRE_IJMatrixGetObject( Pattern, (void**) &Pattern_CSR ); - - /* Deallocate */ - ierr += HYPRE_IJMatrixSetObjectType(Pattern, -1); - ierr += HYPRE_IJMatrixDestroy(Pattern); - hypre_TFree(ijbuf_data, HYPRE_MEMORY_DEVICE); - hypre_TFree(ijbuf_cols, HYPRE_MEMORY_DEVICE); - hypre_TFree(ijbuf_rownums, HYPRE_MEMORY_DEVICE); - hypre_TFree(ijbuf_numcols, HYPRE_MEMORY_DEVICE); - - if(sym_collapse) - { - hypre_TFree(ijbuf_sym_data, HYPRE_MEMORY_DEVICE); - hypre_TFree(ijbuf_sym_cols, HYPRE_MEMORY_DEVICE); - hypre_TFree(ijbuf_sym_rownums, HYPRE_MEMORY_DEVICE); - hypre_TFree(ijbuf_sym_numcols, HYPRE_MEMORY_DEVICE); - } - - return Pattern_CSR; + /*}*/ + } + } + + } + + /* For efficiency, we do a buffered IJAddToValues. + * This empties the buffer of any remaining values */ + hypre_NonGalerkinIJBufferEmpty(Pattern, ijbuf_size, &ijbuf_cnt, ijbuf_rowcounter, + &ijbuf_data, &ijbuf_cols, &ijbuf_rownums, &ijbuf_numcols); + if (sym_collapse) + { + hypre_NonGalerkinIJBufferEmpty(Pattern, ijbuf_size, &ijbuf_sym_cnt, ijbuf_sym_rowcounter, + &ijbuf_sym_data, &ijbuf_sym_cols, &ijbuf_sym_rownums, + &ijbuf_sym_numcols); + } + + /* Finalize Construction of Pattern */ + HYPRE_IJMatrixAssemble(Pattern); + HYPRE_IJMatrixGetObject(Pattern, (void**) &Pattern_CSR); + + /* Deallocate */ + HYPRE_IJMatrixSetObjectType(Pattern, -1); + HYPRE_IJMatrixDestroy(Pattern); + hypre_TFree(ijbuf_data, memory_location_RAP); + hypre_TFree(ijbuf_cols, memory_location_RAP); + hypre_TFree(ijbuf_rownums, memory_location_RAP); + hypre_TFree(ijbuf_numcols, memory_location_RAP); + + if (sym_collapse) + { + hypre_TFree(ijbuf_sym_data, memory_location_RAP); + hypre_TFree(ijbuf_sym_cols, memory_location_RAP); + hypre_TFree(ijbuf_sym_rownums, memory_location_RAP); + hypre_TFree(ijbuf_sym_numcols, memory_location_RAP); + } + + HYPRE_ANNOTATE_FUNC_END; + + return Pattern_CSR; } @@ -1217,1098 +1252,1113 @@ hypre_BoomerAMGBuildNonGalerkinCoarseOperator( hypre_ParCSRMatrix **RAP_ptr, HYPRE_Real droptol, HYPRE_Int sym_collapse, HYPRE_Real lump_percent, HYPRE_Int collapse_beta ) { - /* Initializations */ - MPI_Comm comm = hypre_ParCSRMatrixComm(*RAP_ptr); - hypre_ParCSRMatrix *S = NULL; - hypre_ParCSRMatrix *RAP = *RAP_ptr; - HYPRE_Int i, j, k, row_start, row_end, value, num_cols_offd_Sext, num_procs; - HYPRE_Int S_ext_diag_size, S_ext_offd_size, last_col_diag_RAP, cnt_offd, cnt_diag, cnt; - HYPRE_Int col_indx_Pattern, current_Pattern_j, col_indx_RAP; - /* HYPRE_Real start_time = hypre_MPI_Wtime(); */ - /* HYPRE_Real end_time; */ - HYPRE_BigInt *temp = NULL; - HYPRE_Int ierr = 0; - char filename[256]; - - /* Lumping related variables */ - HYPRE_IJMatrix ijmatrix; - HYPRE_BigInt * Pattern_offd_indices = NULL; - HYPRE_BigInt * S_offd_indices = NULL; - HYPRE_BigInt * offd_intersection = NULL; - HYPRE_Real * offd_intersection_data = NULL; - HYPRE_Int * diag_intersection = NULL; - HYPRE_Real * diag_intersection_data = NULL; - HYPRE_Int Pattern_offd_indices_len = 0; - HYPRE_Int Pattern_offd_indices_allocated_len= 0; - HYPRE_Int S_offd_indices_len = 0; - HYPRE_Int S_offd_indices_allocated_len = 0; - HYPRE_Int offd_intersection_len = 0; - HYPRE_Int offd_intersection_allocated_len = 0; - HYPRE_Int diag_intersection_len = 0; - HYPRE_Int diag_intersection_allocated_len = 0; - HYPRE_Real intersection_len = 0; - HYPRE_Int * Pattern_indices_ptr = NULL; - HYPRE_Int Pattern_diag_indices_len = 0; - HYPRE_Int global_row = 0; - HYPRE_Int has_row_ended = 0; - HYPRE_Real lump_value = 0.; - HYPRE_Real diagonal_lump_value = 0.; - HYPRE_Real neg_lump_value = 0.; - HYPRE_Real sum_strong_neigh = 0.; - HYPRE_Int * rownz = NULL; - - /* offd and diag portions of RAP */ - hypre_CSRMatrix *RAP_diag = hypre_ParCSRMatrixDiag(RAP); - HYPRE_Int *RAP_diag_i = hypre_CSRMatrixI(RAP_diag); - HYPRE_Real *RAP_diag_data = hypre_CSRMatrixData(RAP_diag); - HYPRE_Int *RAP_diag_j = hypre_CSRMatrixJ(RAP_diag); - HYPRE_BigInt first_col_diag_RAP = hypre_ParCSRMatrixFirstColDiag(RAP); - HYPRE_Int num_cols_diag_RAP = hypre_CSRMatrixNumCols(RAP_diag); - - hypre_CSRMatrix *RAP_offd = hypre_ParCSRMatrixOffd(RAP); - HYPRE_Int *RAP_offd_i = hypre_CSRMatrixI(RAP_offd); - HYPRE_Real *RAP_offd_data = NULL; - HYPRE_Int *RAP_offd_j = hypre_CSRMatrixJ(RAP_offd); - HYPRE_BigInt *col_map_offd_RAP = hypre_ParCSRMatrixColMapOffd(RAP); - HYPRE_Int num_cols_RAP_offd = hypre_CSRMatrixNumCols(RAP_offd); - - HYPRE_Int num_variables = hypre_CSRMatrixNumRows(RAP_diag); - HYPRE_BigInt global_num_vars = hypre_ParCSRMatrixGlobalNumRows(RAP); - - /* offd and diag portions of S */ - hypre_CSRMatrix *S_diag = NULL; - HYPRE_Int *S_diag_i = NULL; - HYPRE_Real *S_diag_data = NULL; - HYPRE_Int *S_diag_j = NULL; - - hypre_CSRMatrix *S_offd = NULL; - HYPRE_Int *S_offd_i = NULL; - HYPRE_Real *S_offd_data = NULL; - HYPRE_Int *S_offd_j = NULL; - HYPRE_BigInt *col_map_offd_S = NULL; - - HYPRE_Int num_cols_offd_S; - /* HYPRE_Int num_nonzeros_S_diag; */ - - /* off processor portions of S */ - hypre_CSRMatrix *S_ext = NULL; - HYPRE_Int *S_ext_i = NULL; - HYPRE_Real *S_ext_data = NULL; - HYPRE_BigInt *S_ext_j = NULL; - - HYPRE_Int *S_ext_diag_i = NULL; - HYPRE_Real *S_ext_diag_data = NULL; - HYPRE_Int *S_ext_diag_j = NULL; - - HYPRE_Int *S_ext_offd_i = NULL; - HYPRE_Real *S_ext_offd_data = NULL; - HYPRE_Int *S_ext_offd_j = NULL; - HYPRE_BigInt *col_map_offd_Sext = NULL; - /* HYPRE_Int num_nonzeros_S_ext_diag; - HYPRE_Int num_nonzeros_S_ext_offd; - HYPRE_Int num_rows_Sext = 0; */ - HYPRE_Int row_indx_Sext = 0; - - - /* offd and diag portions of Pattern */ - hypre_ParCSRMatrix *Pattern = NULL; - hypre_CSRMatrix *Pattern_diag = NULL; - HYPRE_Int *Pattern_diag_i = NULL; - HYPRE_Real *Pattern_diag_data = NULL; - HYPRE_Int *Pattern_diag_j = NULL; - - hypre_CSRMatrix *Pattern_offd = NULL; - HYPRE_Int *Pattern_offd_i = NULL; - HYPRE_Real *Pattern_offd_data = NULL; - HYPRE_Int *Pattern_offd_j = NULL; - HYPRE_BigInt *col_map_offd_Pattern = NULL; - - HYPRE_Int num_cols_Pattern_offd; - HYPRE_Int my_id; - - /* Buffered IJAddToValues */ - HYPRE_Int ijbuf_cnt, ijbuf_size, ijbuf_rowcounter; - HYPRE_Real *ijbuf_data; - HYPRE_BigInt *ijbuf_cols, *ijbuf_rownums; - HYPRE_Int *ijbuf_numcols; - - /* Buffered IJAddToValues for Symmetric Entries */ - HYPRE_Int ijbuf_sym_cnt, ijbuf_sym_rowcounter; - HYPRE_Real *ijbuf_sym_data; - HYPRE_BigInt *ijbuf_sym_cols, *ijbuf_sym_rownums; - HYPRE_Int *ijbuf_sym_numcols; - - /* Further Initializations */ - if (num_cols_RAP_offd) - { RAP_offd_data = hypre_CSRMatrixData(RAP_offd); } - hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_rank(comm, &my_id); - - /* Compute Sparsity Pattern */ - Pattern = hypre_NonGalerkinSparsityPattern(AP, RAP, CF_marker, droptol, sym_collapse, collapse_beta); - Pattern_diag = hypre_ParCSRMatrixDiag(Pattern); - Pattern_diag_i = hypre_CSRMatrixI(Pattern_diag); - Pattern_diag_data = hypre_CSRMatrixData(Pattern_diag); - Pattern_diag_j = hypre_CSRMatrixJ(Pattern_diag); - - Pattern_offd = hypre_ParCSRMatrixOffd(Pattern); - Pattern_offd_i = hypre_CSRMatrixI(Pattern_offd); - Pattern_offd_j = hypre_CSRMatrixJ(Pattern_offd); - col_map_offd_Pattern = hypre_ParCSRMatrixColMapOffd(Pattern); - - num_cols_Pattern_offd = hypre_CSRMatrixNumCols(Pattern_offd); - if (num_cols_Pattern_offd) - { Pattern_offd_data = hypre_CSRMatrixData(Pattern_offd); } - - /** - * Fill in the entries of Pattern with entries from RAP - **/ - - /* First, sort column indices in RAP and Pattern */ - for(i = 0; i < num_variables; i++) - { - /* The diag matrices store the diagonal as first element in each row. - * We maintain that for the case of Pattern and RAP, because the - * strength of connection routine relies on it and we need to ignore - * diagonal entries in Pattern later during set intersections. - * */ - - /* Sort diag portion of RAP */ - row_start = RAP_diag_i[i]; - if( RAP_diag_j[row_start] == i) - { row_start = row_start + 1; } - row_end = RAP_diag_i[i+1]; - hypre_qsort1(RAP_diag_j, RAP_diag_data, row_start, row_end-1 ); - - /* Sort diag portion of Pattern */ - row_start = Pattern_diag_i[i]; - - if( Pattern_diag_j[row_start] == i) - { row_start = row_start + 1; } - row_end = Pattern_diag_i[i+1]; - hypre_qsort1(Pattern_diag_j, Pattern_diag_data, row_start, row_end-1 ); - - /* Sort offd portion of RAP */ - row_start = RAP_offd_i[i]; - row_end = RAP_offd_i[i+1]; - hypre_qsort1(RAP_offd_j, RAP_offd_data, row_start, row_end-1 ); - - /* Sort offd portion of Pattern */ - /* Be careful to map coarse dof i with CF_marker into Pattern */ - row_start = Pattern_offd_i[i]; - row_end = Pattern_offd_i[i+1]; - hypre_qsort1(Pattern_offd_j, Pattern_offd_data, row_start, row_end-1 ); - - } - - - /* Create Strength matrix based on RAP or Pattern. If Pattern is used, - * then the SortedCopyParCSRData(...) function call must also be commented - * back in */ - /* hypre_SortedCopyParCSRData(RAP, Pattern); */ - if(0) - { - /* hypre_BoomerAMG_MyCreateS(Pattern, strong_threshold, max_row_sum, */ - hypre_BoomerAMG_MyCreateS(RAP, strong_threshold, max_row_sum, - num_functions, dof_func_value, &S); - } - else - { - /* Passing in "1, NULL" because dof_array is not needed - * because we assume that the number of functions is 1 */ - /* hypre_BoomerAMG_MyCreateS(Pattern, strong_threshold, max_row_sum,*/ - hypre_BoomerAMG_MyCreateS(RAP, strong_threshold, max_row_sum, - 1, NULL, &S); - } - /* Grab diag and offd parts of S */ - S_diag = hypre_ParCSRMatrixDiag(S); - S_diag_i = hypre_CSRMatrixI(S_diag); - S_diag_j = hypre_CSRMatrixJ(S_diag); - S_diag_data = hypre_CSRMatrixData(S_diag); - - S_offd = hypre_ParCSRMatrixOffd(S); - S_offd_i = hypre_CSRMatrixI(S_offd); - S_offd_j = hypre_CSRMatrixJ(S_offd); - S_offd_data = hypre_CSRMatrixData(S_offd); - col_map_offd_S = hypre_ParCSRMatrixColMapOffd(S); - - num_cols_offd_S = hypre_CSRMatrixNumCols(S_offd); - /* num_nonzeros_S_diag = S_diag_i[num_variables]; */ - - - - - /* Grab part of S that is distance one away from the local rows - * This is needed later for the stencil collapsing. This section - * of the code mimics par_rap.c when it extracts Ps_ext. - * When moving from par_rap.c, the variable name changes were: - * A --> RAP - * P --> S - * Ps_ext --> S_ext - * P_ext_diag --> S_ext_diag - * P_ext_offd --> S_ext_offd - * - * The data layout of S_ext as returned by ExtractBExt gives you only global - * column indices, and must be converted to the local numbering. This code - * section constructs S_ext_diag and S_ext_offd, which are the distance 1 - * couplings in S based on the sparsity structure in RAP. - * --> S_ext_diag corresponds to the same column slice that RAP_diag - * corresponds to. Thus, the column indexing is the same as in - * RAP_diag such that S_ext_diag_j[k] just needs to be offset by - * the RAP_diag first global dof offset. - * --> S_ext_offd column indexing is a little more complicated, and - * requires the computation below of col_map_S_ext_offd, which - * maps the local 0,1,2,... column indexing in S_ext_offd to global - * dof numbers. Note, that the num_cols_RAP_offd is NOT equal to - * num_cols_offd_S_ext - * --> The row indexing of S_ext_diag|offd is as follows. Use - * col_map_offd_RAP, where the first index corresponds to the - * first global row index in S_ext_diag|offd. Remember that ExtractBExt - * grabs the information from S required for locally computing - * (RAP*S)[proc_k row slice, :] */ - - if (num_procs > 1) - { - S_ext = hypre_ParCSRMatrixExtractBExt(S,RAP,1); - S_ext_data = hypre_CSRMatrixData(S_ext); - S_ext_i = hypre_CSRMatrixI(S_ext); - S_ext_j = hypre_CSRMatrixBigJ(S_ext); - } - - /* This uses the num_cols_RAP_offd to set S_ext_diag|offd_i, because S_ext - * is the off-processor information needed to compute RAP*S. That is, - * num_cols_RAP_offd represents the number of rows needed from S_ext for - * the multiplication */ - S_ext_diag_i = hypre_CTAlloc(HYPRE_Int, num_cols_RAP_offd+1, HYPRE_MEMORY_HOST); - S_ext_offd_i = hypre_CTAlloc(HYPRE_Int, num_cols_RAP_offd+1, HYPRE_MEMORY_HOST); - S_ext_diag_size = 0; - S_ext_offd_size = 0; - /* num_rows_Sext = num_cols_RAP_offd; */ - last_col_diag_RAP = first_col_diag_RAP + num_cols_diag_RAP - 1; - - /* construct the S_ext_diag and _offd row-pointer arrays by counting elements - * This looks to create offd and diag blocks related to the local rows belonging - * to this processor...we may not need to split up S_ext this way...or we could. - * It would make for faster binary searching and set intersecting later...this will - * be the bottle neck so LETS SPLIT THIS UP Between offd and diag*/ - for (i=0; i < num_cols_RAP_offd; i++) - { - for (j=S_ext_i[i]; j < S_ext_i[i+1]; j++) - if (S_ext_j[j] < first_col_diag_RAP || S_ext_j[j] > last_col_diag_RAP) - S_ext_offd_size++; - else - S_ext_diag_size++; - S_ext_diag_i[i+1] = S_ext_diag_size; - S_ext_offd_i[i+1] = S_ext_offd_size; - } - - if (S_ext_diag_size) - { - S_ext_diag_j = hypre_CTAlloc(HYPRE_Int, S_ext_diag_size, HYPRE_MEMORY_HOST); - S_ext_diag_data = hypre_CTAlloc(HYPRE_Real, S_ext_diag_size, HYPRE_MEMORY_HOST); - } - if (S_ext_offd_size) - { - S_ext_offd_j = hypre_CTAlloc(HYPRE_Int, S_ext_offd_size, HYPRE_MEMORY_HOST); - S_ext_offd_data = hypre_CTAlloc(HYPRE_Real, S_ext_offd_size, HYPRE_MEMORY_HOST); - } - - /* This copies over the column indices into the offd and diag parts. - * The diag portion has it's local column indices shifted to start at 0. - * The offd portion requires more work to construct the col_map_offd array - * and a local column ordering. */ - cnt_offd = 0; - cnt_diag = 0; - cnt = 0; - for (i=0; i < num_cols_RAP_offd; i++) - { - for (j=S_ext_i[i]; j < S_ext_i[i+1]; j++) - if (S_ext_j[j] < first_col_diag_RAP || S_ext_j[j] > last_col_diag_RAP) + /* Initializations */ + MPI_Comm comm = hypre_ParCSRMatrixComm(*RAP_ptr); + hypre_ParCSRMatrix *S = NULL; + hypre_ParCSRMatrix *RAP = *RAP_ptr; + HYPRE_Int i, j, k, row_start, row_end, num_cols_offd_Sext, num_procs; + HYPRE_Int S_ext_diag_size, S_ext_offd_size; + HYPRE_BigInt last_col_diag_RAP; + HYPRE_Int cnt_offd, cnt_diag, cnt; + HYPRE_Int col_indx_Pattern, current_Pattern_j, col_indx_RAP; + HYPRE_BigInt value; + HYPRE_BigInt *temp = NULL; + + HYPRE_MemoryLocation memory_location_RAP = hypre_ParCSRMatrixMemoryLocation(RAP); + + /* Lumping related variables */ + HYPRE_IJMatrix ijmatrix; + HYPRE_BigInt * Pattern_offd_indices = NULL; + HYPRE_BigInt * S_offd_indices = NULL; + HYPRE_BigInt * offd_intersection = NULL; + HYPRE_Real * offd_intersection_data = NULL; + HYPRE_Int * diag_intersection = NULL; + HYPRE_Real * diag_intersection_data = NULL; + HYPRE_Int Pattern_offd_indices_len = 0; + HYPRE_Int Pattern_offd_indices_allocated_len = 0; + HYPRE_Int S_offd_indices_len = 0; + HYPRE_Int S_offd_indices_allocated_len = 0; + HYPRE_Int offd_intersection_len = 0; + HYPRE_Int offd_intersection_allocated_len = 0; + HYPRE_Int diag_intersection_len = 0; + HYPRE_Int diag_intersection_allocated_len = 0; + HYPRE_Real intersection_len = 0; + HYPRE_Int * Pattern_indices_ptr = NULL; + HYPRE_Int Pattern_diag_indices_len = 0; + HYPRE_Int global_row = 0; + HYPRE_Int has_row_ended = 0; + HYPRE_Real lump_value = 0.; + HYPRE_Real diagonal_lump_value = 0.; + HYPRE_Real neg_lump_value = 0.; + HYPRE_Real sum_strong_neigh = 0.; + HYPRE_Int * rownz = NULL; + + /* offd and diag portions of RAP */ + hypre_CSRMatrix *RAP_diag = hypre_ParCSRMatrixDiag(RAP); + HYPRE_Int *RAP_diag_i = hypre_CSRMatrixI(RAP_diag); + HYPRE_Real *RAP_diag_data = hypre_CSRMatrixData(RAP_diag); + HYPRE_Int *RAP_diag_j = hypre_CSRMatrixJ(RAP_diag); + HYPRE_BigInt first_col_diag_RAP = hypre_ParCSRMatrixFirstColDiag(RAP); + HYPRE_Int num_cols_diag_RAP = hypre_CSRMatrixNumCols(RAP_diag); + + hypre_CSRMatrix *RAP_offd = hypre_ParCSRMatrixOffd(RAP); + HYPRE_Int *RAP_offd_i = hypre_CSRMatrixI(RAP_offd); + HYPRE_Real *RAP_offd_data = NULL; + HYPRE_Int *RAP_offd_j = hypre_CSRMatrixJ(RAP_offd); + HYPRE_BigInt *col_map_offd_RAP = hypre_ParCSRMatrixColMapOffd(RAP); + HYPRE_Int num_cols_RAP_offd = hypre_CSRMatrixNumCols(RAP_offd); + HYPRE_Int num_variables = hypre_CSRMatrixNumRows(RAP_diag); + + /* offd and diag portions of S */ + hypre_CSRMatrix *S_diag = NULL; + HYPRE_Int *S_diag_i = NULL; + HYPRE_Real *S_diag_data = NULL; + HYPRE_Int *S_diag_j = NULL; + + hypre_CSRMatrix *S_offd = NULL; + HYPRE_Int *S_offd_i = NULL; + HYPRE_Real *S_offd_data = NULL; + HYPRE_Int *S_offd_j = NULL; + HYPRE_BigInt *col_map_offd_S = NULL; + + HYPRE_Int num_cols_offd_S; + /* HYPRE_Int num_nonzeros_S_diag; */ + + /* off processor portions of S */ + hypre_CSRMatrix *S_ext = NULL; + HYPRE_Int *S_ext_i = NULL; + HYPRE_Real *S_ext_data = NULL; + HYPRE_BigInt *S_ext_j = NULL; + + HYPRE_Int *S_ext_diag_i = NULL; + HYPRE_Real *S_ext_diag_data = NULL; + HYPRE_Int *S_ext_diag_j = NULL; + + HYPRE_Int *S_ext_offd_i = NULL; + HYPRE_Real *S_ext_offd_data = NULL; + HYPRE_Int *S_ext_offd_j = NULL; + HYPRE_BigInt *col_map_offd_Sext = NULL; + /* HYPRE_Int num_nonzeros_S_ext_diag; + HYPRE_Int num_nonzeros_S_ext_offd; + HYPRE_Int num_rows_Sext = 0; */ + HYPRE_Int row_indx_Sext = 0; + + + /* offd and diag portions of Pattern */ + hypre_ParCSRMatrix *Pattern = NULL; + hypre_CSRMatrix *Pattern_diag = NULL; + HYPRE_Int *Pattern_diag_i = NULL; + HYPRE_Real *Pattern_diag_data = NULL; + HYPRE_Int *Pattern_diag_j = NULL; + + hypre_CSRMatrix *Pattern_offd = NULL; + HYPRE_Int *Pattern_offd_i = NULL; + HYPRE_Real *Pattern_offd_data = NULL; + HYPRE_Int *Pattern_offd_j = NULL; + HYPRE_BigInt *col_map_offd_Pattern = NULL; + + HYPRE_Int num_cols_Pattern_offd; + HYPRE_Int my_id; + + /* Buffered IJAddToValues */ + HYPRE_Int ijbuf_cnt, ijbuf_size, ijbuf_rowcounter; + HYPRE_Real *ijbuf_data; + HYPRE_BigInt *ijbuf_cols, *ijbuf_rownums; + HYPRE_Int *ijbuf_numcols; + + /* Buffered IJAddToValues for Symmetric Entries */ + HYPRE_Int ijbuf_sym_cnt, ijbuf_sym_rowcounter; + HYPRE_Real *ijbuf_sym_data; + HYPRE_BigInt *ijbuf_sym_cols, *ijbuf_sym_rownums; + HYPRE_Int *ijbuf_sym_numcols; + + HYPRE_ANNOTATE_FUNC_BEGIN; + + /* Further Initializations */ + if (num_cols_RAP_offd) + { RAP_offd_data = hypre_CSRMatrixData(RAP_offd); } + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); + + /* Compute Sparsity Pattern */ + Pattern = hypre_NonGalerkinSparsityPattern(AP, RAP, CF_marker, droptol, + sym_collapse, collapse_beta); + Pattern_diag = hypre_ParCSRMatrixDiag(Pattern); + Pattern_diag_i = hypre_CSRMatrixI(Pattern_diag); + Pattern_diag_data = hypre_CSRMatrixData(Pattern_diag); + Pattern_diag_j = hypre_CSRMatrixJ(Pattern_diag); + + Pattern_offd = hypre_ParCSRMatrixOffd(Pattern); + Pattern_offd_i = hypre_CSRMatrixI(Pattern_offd); + Pattern_offd_j = hypre_CSRMatrixJ(Pattern_offd); + col_map_offd_Pattern = hypre_ParCSRMatrixColMapOffd(Pattern); + + num_cols_Pattern_offd = hypre_CSRMatrixNumCols(Pattern_offd); + if (num_cols_Pattern_offd) + { Pattern_offd_data = hypre_CSRMatrixData(Pattern_offd); } + + /** + * Fill in the entries of Pattern with entries from RAP + **/ + + /* First, sort column indices in RAP and Pattern */ + for (i = 0; i < num_variables; i++) + { + /* The diag matrices store the diagonal as first element in each row. + * We maintain that for the case of Pattern and RAP, because the + * strength of connection routine relies on it and we need to ignore + * diagonal entries in Pattern later during set intersections. + * */ + + /* Sort diag portion of RAP */ + row_start = RAP_diag_i[i]; + if ( RAP_diag_j[row_start] == i) + { row_start = row_start + 1; } + row_end = RAP_diag_i[i + 1]; + hypre_qsort1(RAP_diag_j, RAP_diag_data, row_start, row_end - 1 ); + + /* Sort diag portion of Pattern */ + row_start = Pattern_diag_i[i]; + + if ( Pattern_diag_j[row_start] == i) + { row_start = row_start + 1; } + row_end = Pattern_diag_i[i + 1]; + hypre_qsort1(Pattern_diag_j, Pattern_diag_data, row_start, row_end - 1 ); + + /* Sort offd portion of RAP */ + row_start = RAP_offd_i[i]; + row_end = RAP_offd_i[i + 1]; + hypre_qsort1(RAP_offd_j, RAP_offd_data, row_start, row_end - 1 ); + + /* Sort offd portion of Pattern */ + /* Be careful to map coarse dof i with CF_marker into Pattern */ + row_start = Pattern_offd_i[i]; + row_end = Pattern_offd_i[i + 1]; + hypre_qsort1(Pattern_offd_j, Pattern_offd_data, row_start, row_end - 1 ); + + } + + + /* Create Strength matrix based on RAP or Pattern. If Pattern is used, + * then the SortedCopyParCSRData(...) function call must also be commented + * back in */ + /* hypre_SortedCopyParCSRData(RAP, Pattern); */ + if (0) + { + /* hypre_BoomerAMG_MyCreateS(Pattern, strong_threshold, max_row_sum, */ + hypre_BoomerAMG_MyCreateS(RAP, strong_threshold, max_row_sum, + num_functions, dof_func_value, &S); + } + else + { + /* Passing in "1, NULL" because dof_array is not needed + * because we assume that the number of functions is 1 */ + /* hypre_BoomerAMG_MyCreateS(Pattern, strong_threshold, max_row_sum,*/ + hypre_BoomerAMG_MyCreateS(RAP, strong_threshold, max_row_sum, + 1, NULL, &S); + } + /* Grab diag and offd parts of S */ + S_diag = hypre_ParCSRMatrixDiag(S); + S_diag_i = hypre_CSRMatrixI(S_diag); + S_diag_j = hypre_CSRMatrixJ(S_diag); + S_diag_data = hypre_CSRMatrixData(S_diag); + + S_offd = hypre_ParCSRMatrixOffd(S); + S_offd_i = hypre_CSRMatrixI(S_offd); + S_offd_j = hypre_CSRMatrixJ(S_offd); + S_offd_data = hypre_CSRMatrixData(S_offd); + col_map_offd_S = hypre_ParCSRMatrixColMapOffd(S); + + num_cols_offd_S = hypre_CSRMatrixNumCols(S_offd); + /* num_nonzeros_S_diag = S_diag_i[num_variables]; */ + + + + + /* Grab part of S that is distance one away from the local rows + * This is needed later for the stencil collapsing. This section + * of the code mimics par_rap.c when it extracts Ps_ext. + * When moving from par_rap.c, the variable name changes were: + * A --> RAP + * P --> S + * Ps_ext --> S_ext + * P_ext_diag --> S_ext_diag + * P_ext_offd --> S_ext_offd + * + * The data layout of S_ext as returned by ExtractBExt gives you only global + * column indices, and must be converted to the local numbering. This code + * section constructs S_ext_diag and S_ext_offd, which are the distance 1 + * couplings in S based on the sparsity structure in RAP. + * --> S_ext_diag corresponds to the same column slice that RAP_diag + * corresponds to. Thus, the column indexing is the same as in + * RAP_diag such that S_ext_diag_j[k] just needs to be offset by + * the RAP_diag first global dof offset. + * --> S_ext_offd column indexing is a little more complicated, and + * requires the computation below of col_map_S_ext_offd, which + * maps the local 0,1,2,... column indexing in S_ext_offd to global + * dof numbers. Note, that the num_cols_RAP_offd is NOT equal to + * num_cols_offd_S_ext + * --> The row indexing of S_ext_diag|offd is as follows. Use + * col_map_offd_RAP, where the first index corresponds to the + * first global row index in S_ext_diag|offd. Remember that ExtractBExt + * grabs the information from S required for locally computing + * (RAP*S)[proc_k row slice, :] */ + + if (num_procs > 1) + { + S_ext = hypre_ParCSRMatrixExtractBExt(S, RAP, 1); + S_ext_data = hypre_CSRMatrixData(S_ext); + S_ext_i = hypre_CSRMatrixI(S_ext); + S_ext_j = hypre_CSRMatrixBigJ(S_ext); + } + + /* This uses the num_cols_RAP_offd to set S_ext_diag|offd_i, because S_ext + * is the off-processor information needed to compute RAP*S. That is, + * num_cols_RAP_offd represents the number of rows needed from S_ext for + * the multiplication */ + S_ext_diag_i = hypre_CTAlloc(HYPRE_Int, num_cols_RAP_offd + 1, HYPRE_MEMORY_HOST); + S_ext_offd_i = hypre_CTAlloc(HYPRE_Int, num_cols_RAP_offd + 1, HYPRE_MEMORY_HOST); + S_ext_diag_size = 0; + S_ext_offd_size = 0; + /* num_rows_Sext = num_cols_RAP_offd; */ + last_col_diag_RAP = first_col_diag_RAP + ((HYPRE_BigInt) (num_cols_diag_RAP - 1)); + + /* construct the S_ext_diag and _offd row-pointer arrays by counting elements + * This looks to create offd and diag blocks related to the local rows belonging + * to this processor...we may not need to split up S_ext this way...or we could. + * It would make for faster binary searching and set intersecting later...this will + * be the bottle neck so LETS SPLIT THIS UP Between offd and diag*/ + for (i = 0; i < num_cols_RAP_offd; i++) + { + for (j = S_ext_i[i]; j < S_ext_i[i + 1]; j++) + { + if (S_ext_j[j] < first_col_diag_RAP || S_ext_j[j] > last_col_diag_RAP) + { + S_ext_offd_size++; + } + else + { + S_ext_diag_size++; + } + } + S_ext_diag_i[i + 1] = S_ext_diag_size; + S_ext_offd_i[i + 1] = S_ext_offd_size; + } + + if (S_ext_diag_size) + { + S_ext_diag_j = hypre_CTAlloc(HYPRE_Int, S_ext_diag_size, HYPRE_MEMORY_HOST); + S_ext_diag_data = hypre_CTAlloc(HYPRE_Real, S_ext_diag_size, HYPRE_MEMORY_HOST); + } + if (S_ext_offd_size) + { + S_ext_offd_j = hypre_CTAlloc(HYPRE_Int, S_ext_offd_size, HYPRE_MEMORY_HOST); + S_ext_offd_data = hypre_CTAlloc(HYPRE_Real, S_ext_offd_size, HYPRE_MEMORY_HOST); + } + + /* This copies over the column indices into the offd and diag parts. + * The diag portion has it's local column indices shifted to start at 0. + * The offd portion requires more work to construct the col_map_offd array + * and a local column ordering. */ + cnt_offd = 0; + cnt_diag = 0; + cnt = 0; + for (i = 0; i < num_cols_RAP_offd; i++) + { + for (j = S_ext_i[i]; j < S_ext_i[i + 1]; j++) + { + if (S_ext_j[j] < first_col_diag_RAP || S_ext_j[j] > last_col_diag_RAP) + { + S_ext_offd_data[cnt_offd] = S_ext_data[j]; + //S_ext_offd_j[cnt_offd++] = S_ext_j[j]; + S_ext_j[cnt_offd++] = S_ext_j[j]; + } + else + { + S_ext_diag_data[cnt_diag] = S_ext_data[j]; + S_ext_diag_j[cnt_diag++] = (HYPRE_Int)(S_ext_j[j] - first_col_diag_RAP); + } + } + } + + /* This creates col_map_offd_Sext */ + if (S_ext_offd_size || num_cols_offd_S) + { + temp = hypre_CTAlloc(HYPRE_BigInt, S_ext_offd_size + num_cols_offd_S, HYPRE_MEMORY_HOST); + for (i = 0; i < S_ext_offd_size; i++) + { + temp[i] = S_ext_j[i]; + } + cnt = S_ext_offd_size; + for (i = 0; i < num_cols_offd_S; i++) + { + temp[cnt++] = col_map_offd_S[i]; + } + } + if (cnt) + { + /* after this, the first so many entries of temp will hold the + * unique column indices in S_ext_offd_j unioned with the indices + * in col_map_offd_S */ + hypre_BigQsort0(temp, 0, cnt - 1); + + num_cols_offd_Sext = 1; + value = temp[0]; + for (i = 1; i < cnt; i++) + { + if (temp[i] > value) + { + value = temp[i]; + temp[num_cols_offd_Sext++] = value; + } + } + } + else + { + num_cols_offd_Sext = 0; + } + + /* num_nonzeros_S_ext_diag = cnt_diag; + num_nonzeros_S_ext_offd = S_ext_offd_size; */ + + col_map_offd_Sext = hypre_CTAlloc(HYPRE_BigInt, num_cols_offd_Sext, HYPRE_MEMORY_HOST); + + for (i = 0; i < num_cols_offd_Sext; i++) + { + col_map_offd_Sext[i] = temp[i]; + } + + if (S_ext_offd_size || num_cols_offd_S) + { + hypre_TFree(temp, HYPRE_MEMORY_HOST); + } + + /* look for S_ext_offd_j[i] in col_map_offd_Sext, and set S_ext_offd_j[i] + * to the index of that column value in col_map_offd_Sext */ + for (i = 0 ; i < S_ext_offd_size; i++) + { + S_ext_offd_j[i] = hypre_BigBinarySearch(col_map_offd_Sext, + S_ext_j[i], + num_cols_offd_Sext); + } + + if (num_procs > 1) + { + hypre_CSRMatrixDestroy(S_ext); + S_ext = NULL; + } + + /* Need to sort column indices in S and S_ext */ + for (i = 0; i < num_variables; i++) + { + /* Re-Sort diag portion of Pattern, placing the diagonal entry in a + * sorted position */ + row_start = Pattern_diag_i[i]; + row_end = Pattern_diag_i[i + 1]; + hypre_qsort1(Pattern_diag_j, Pattern_diag_data, row_start, row_end - 1 ); + + /* Sort diag portion of S, noting that no diagonal entry */ + /* S has not "data" array...it's just NULL */ + row_start = S_diag_i[i]; + row_end = S_diag_i[i + 1]; + hypre_qsort1(S_diag_j, S_diag_data, row_start, row_end - 1 ); + + /* Sort offd portion of S */ + /* S has no "data" array...it's just NULL */ + row_start = S_offd_i[i]; + row_end = S_offd_i[i + 1]; + hypre_qsort1(S_offd_j, S_offd_data, row_start, row_end - 1 ); + } + + /* Sort S_ext + * num_cols_RAP_offd equals num_rows for S_ext*/ + for (i = 0; i < num_cols_RAP_offd; i++) + { + /* Sort diag portion of S_ext */ + row_start = S_ext_diag_i[i]; + row_end = S_ext_diag_i[i + 1]; + hypre_qsort1(S_ext_diag_j, S_ext_diag_data, row_start, row_end - 1 ); + + /* Sort offd portion of S_ext */ + row_start = S_ext_offd_i[i]; + row_end = S_ext_offd_i[i + 1]; + hypre_qsort1(S_ext_offd_j, S_ext_offd_data, row_start, row_end - 1 ); + + } + + /* + * Now, for the fun stuff -- Computing the Non-Galerkin Operator + */ + + /* Initialize the ijmatrix, leveraging our knowledge of the nonzero + * structure in Pattern */ + HYPRE_IJMatrixCreate(comm, first_col_diag_RAP, last_col_diag_RAP, + first_col_diag_RAP, last_col_diag_RAP, &ijmatrix); + HYPRE_IJMatrixSetObjectType(ijmatrix, HYPRE_PARCSR); + rownz = hypre_CTAlloc(HYPRE_Int, num_variables, HYPRE_MEMORY_HOST); + for (i = 0; i < num_variables; i++) + { + rownz[i] = (HYPRE_Int)(1.2 * (Pattern_diag_i[i + 1] - Pattern_diag_i[i]) + + 1.2 * (Pattern_offd_i[i + 1] - Pattern_offd_i[i])); + } + HYPRE_IJMatrixSetRowSizes(ijmatrix, rownz); + HYPRE_IJMatrixInitialize(ijmatrix); + hypre_TFree(rownz, HYPRE_MEMORY_HOST); + + /* + *For efficiency, we do a buffered IJAddToValues. + * Here, we initialize the buffer and then initialize the buffer counters + */ + ijbuf_size = 1000; + ijbuf_data = hypre_CTAlloc(HYPRE_Real, ijbuf_size, memory_location_RAP); + ijbuf_cols = hypre_CTAlloc(HYPRE_BigInt, ijbuf_size, memory_location_RAP); + ijbuf_rownums = hypre_CTAlloc(HYPRE_BigInt, ijbuf_size, memory_location_RAP); + ijbuf_numcols = hypre_CTAlloc(HYPRE_Int, ijbuf_size, memory_location_RAP); + hypre_NonGalerkinIJBigBufferInit( &ijbuf_cnt, &ijbuf_rowcounter, ijbuf_cols ); + if (sym_collapse) + { + ijbuf_sym_data = hypre_CTAlloc(HYPRE_Real, ijbuf_size, memory_location_RAP); + ijbuf_sym_cols = hypre_CTAlloc(HYPRE_BigInt, ijbuf_size, memory_location_RAP); + ijbuf_sym_rownums = hypre_CTAlloc(HYPRE_BigInt, ijbuf_size, memory_location_RAP); + ijbuf_sym_numcols = hypre_CTAlloc(HYPRE_Int, ijbuf_size, memory_location_RAP); + hypre_NonGalerkinIJBigBufferInit( &ijbuf_sym_cnt, &ijbuf_sym_rowcounter, ijbuf_sym_cols ); + } + + /* + * Eliminate Entries In RAP_diag + * */ + for (i = 0; i < num_variables; i++) + { + global_row = (HYPRE_BigInt) i + first_col_diag_RAP; + row_start = RAP_diag_i[i]; + row_end = RAP_diag_i[i + 1]; + has_row_ended = 0; + + /* Only do work if row has nonzeros */ + if ( row_start < row_end) + { + /* Grab pointer to current entry in Pattern_diag */ + current_Pattern_j = Pattern_diag_i[i]; + col_indx_Pattern = Pattern_diag_j[current_Pattern_j]; + + /* Grab this row's indices out of Pattern offd and diag. This will + * be for computing index set intersections for lumping */ + /* Ensure adequate length */ + Pattern_offd_indices_len = Pattern_offd_i[i + 1] - Pattern_offd_i[i]; + if (Pattern_offd_indices_allocated_len < Pattern_offd_indices_len) + { + hypre_TFree(Pattern_offd_indices, HYPRE_MEMORY_HOST); + Pattern_offd_indices = hypre_CTAlloc(HYPRE_BigInt, Pattern_offd_indices_len, HYPRE_MEMORY_HOST); + Pattern_offd_indices_allocated_len = Pattern_offd_indices_len; + } + /* Grab sub array from col_map, corresponding to the slice of Pattern_offd_j */ + hypre_GrabSubArray(Pattern_offd_j, + Pattern_offd_i[i], Pattern_offd_i[i + 1] - 1, + col_map_offd_Pattern, Pattern_offd_indices); + /* No need to grab info out of Pattern_diag_j[...], here we just start from + * Pattern_diag_i[i] and end at index Pattern_diag_i[i+1] - 1. We do need to + * ignore the diagonal entry in Pattern, because we don't lump entries there */ + if ( Pattern_diag_j[Pattern_diag_i[i]] == i ) + { + Pattern_indices_ptr = &( Pattern_diag_j[Pattern_diag_i[i] + 1]); + Pattern_diag_indices_len = Pattern_diag_i[i + 1] - Pattern_diag_i[i] - 1; + } + else + { + Pattern_indices_ptr = &( Pattern_diag_j[Pattern_diag_i[i]]); + Pattern_diag_indices_len = Pattern_diag_i[i + 1] - Pattern_diag_i[i]; + } + } + + for (j = row_start; j < row_end; j++) + { + col_indx_RAP = RAP_diag_j[j]; + + /* Ignore zero entries in RAP */ + if ( RAP_diag_data[j] != 0.0) + { + /* Don't change the diagonal, just write it */ + if (col_indx_RAP == i) { - S_ext_offd_data[cnt_offd] = S_ext_data[j]; - //S_ext_offd_j[cnt_offd++] = S_ext_j[j]; - S_ext_j[cnt_offd++] = S_ext_j[j]; + /*#ifdef HY PRE_USING_OPENMP + #pragma omp critical (IJAdd) + #endif + {*/ + /* For efficiency, we do a buffered IJAddToValues. + * A[global_row, global_row] += RAP_diag_data[j] */ + hypre_NonGalerkinIJBufferWrite( ijmatrix, &ijbuf_cnt, ijbuf_size, &ijbuf_rowcounter, + &ijbuf_data, &ijbuf_cols, &ijbuf_rownums, &ijbuf_numcols, global_row, + global_row, RAP_diag_data[j] ); + /*}*/ + } - else + /* The entry in RAP does not appear in Pattern, so LUMP it */ + else if ( (col_indx_RAP < col_indx_Pattern) || has_row_ended) { - S_ext_diag_data[cnt_diag] = S_ext_data[j]; - S_ext_diag_j[cnt_diag++] = (HYPRE_Int)(S_ext_j[j] - first_col_diag_RAP); + /* Lump entry (i, col_indx_RAP) in RAP */ + + /* Grab the indices for row col_indx_RAP of S_offd and diag. This will + * be for computing lumping locations */ + S_offd_indices_len = S_offd_i[col_indx_RAP + 1] - S_offd_i[col_indx_RAP]; + if (S_offd_indices_allocated_len < S_offd_indices_len) + { + hypre_TFree(S_offd_indices, HYPRE_MEMORY_HOST); + S_offd_indices = hypre_CTAlloc(HYPRE_BigInt, S_offd_indices_len, HYPRE_MEMORY_HOST); + S_offd_indices_allocated_len = S_offd_indices_len; + } + /* Grab sub array from col_map, corresponding to the slice of S_offd_j */ + hypre_GrabSubArray(S_offd_j, S_offd_i[col_indx_RAP], S_offd_i[col_indx_RAP + 1] - 1, + col_map_offd_S, S_offd_indices); + /* No need to grab info out of S_diag_j[...], here we just start from + * S_diag_i[col_indx_RAP] and end at index S_diag_i[col_indx_RAP+1] - 1 */ + + /* Intersect the diag and offd pieces, remembering that the + * diag array will need to have the offset +first_col_diag_RAP */ + cnt = hypre_max(S_offd_indices_len, Pattern_offd_indices_len); + if (offd_intersection_allocated_len < cnt) + { + hypre_TFree(offd_intersection, HYPRE_MEMORY_HOST); + hypre_TFree(offd_intersection_data, HYPRE_MEMORY_HOST); + offd_intersection = hypre_CTAlloc(HYPRE_BigInt, cnt, HYPRE_MEMORY_HOST); + offd_intersection_data = hypre_CTAlloc(HYPRE_Real, cnt, HYPRE_MEMORY_HOST); + offd_intersection_allocated_len = cnt; + } + /* This intersection also tracks S_offd_data and assumes that + * S_offd_indices is the first argument here */ + hypre_IntersectTwoBigArrays(S_offd_indices, + &(S_offd_data[ S_offd_i[col_indx_RAP] ]), + S_offd_indices_len, + Pattern_offd_indices, + Pattern_offd_indices_len, + offd_intersection, + offd_intersection_data, + &offd_intersection_len); + + + /* Now, intersect the indices for the diag block. Note that S_diag_j does + * not have a diagonal entry, so no lumping occurs to the diagonal. */ + cnt = hypre_max(Pattern_diag_indices_len, + S_diag_i[col_indx_RAP + 1] - S_diag_i[col_indx_RAP] ); + if (diag_intersection_allocated_len < cnt) + { + hypre_TFree(diag_intersection, HYPRE_MEMORY_HOST); + hypre_TFree(diag_intersection_data, HYPRE_MEMORY_HOST); + diag_intersection = hypre_CTAlloc(HYPRE_Int, cnt, HYPRE_MEMORY_HOST); + diag_intersection_data = hypre_CTAlloc(HYPRE_Real, cnt, HYPRE_MEMORY_HOST); + diag_intersection_allocated_len = cnt; + } + /* There is no diagonal entry in first position of S */ + hypre_IntersectTwoArrays( &(S_diag_j[S_diag_i[col_indx_RAP]]), + &(S_diag_data[ S_diag_i[col_indx_RAP] ]), + S_diag_i[col_indx_RAP + 1] - S_diag_i[col_indx_RAP], + Pattern_indices_ptr, + Pattern_diag_indices_len, + diag_intersection, + diag_intersection_data, + &diag_intersection_len); + + /* Loop over these intersections, and lump a constant fraction of + * RAP_diag_data[j] to each entry */ + intersection_len = diag_intersection_len + offd_intersection_len; + if (intersection_len > 0) + { + /* Sum the strength-of-connection values from row + * col_indx_RAP in S, corresponding to the indices we are + * collapsing to in row i This will give us our collapsing + * weights. */ + sum_strong_neigh = 0.0; + for (k = 0; k < diag_intersection_len; k++) + { sum_strong_neigh += hypre_abs(diag_intersection_data[k]); } + for (k = 0; k < offd_intersection_len; k++) + { sum_strong_neigh += hypre_abs(offd_intersection_data[k]); } + sum_strong_neigh = RAP_diag_data[j] / sum_strong_neigh; + + /* When lumping with the diag_intersection, must offset column index */ + for (k = 0; k < diag_intersection_len; k++) + { + lump_value = lump_percent * hypre_abs(diag_intersection_data[k]) * sum_strong_neigh; + diagonal_lump_value = (1.0 - lump_percent) * hypre_abs(diag_intersection_data[k]) * + sum_strong_neigh; + neg_lump_value = -1.0 * lump_value; + cnt = diag_intersection[k] + first_col_diag_RAP; + + /*#ifdef HY PRE_USING_OPENMP + #pragma omp critical (IJAdd) + #endif + {*/ + /* For efficiency, we do a buffered IJAddToValues. + * A[global_row, cnt] += RAP_diag_data[j] */ + hypre_NonGalerkinIJBufferWrite( ijmatrix, &ijbuf_cnt, ijbuf_size, &ijbuf_rowcounter, + &ijbuf_data, &ijbuf_cols, &ijbuf_rownums, &ijbuf_numcols, global_row, + cnt, lump_value ); + if (lump_percent < 1.0) + { + /* Preserve row sum by updating diagonal */ + hypre_NonGalerkinIJBufferWrite( ijmatrix, &ijbuf_cnt, ijbuf_size, &ijbuf_rowcounter, + &ijbuf_data, &ijbuf_cols, &ijbuf_rownums, &ijbuf_numcols, global_row, + global_row, diagonal_lump_value ); + } + + /* Update mirror entries, if symmetric collapsing */ + if (sym_collapse) + { + /* Update mirror entry */ + hypre_NonGalerkinIJBufferWrite( ijmatrix, + &ijbuf_sym_cnt, ijbuf_size, &ijbuf_sym_rowcounter, + &ijbuf_sym_data, &ijbuf_sym_cols, &ijbuf_sym_rownums, + &ijbuf_sym_numcols, cnt, global_row, lump_value ); + /* Update mirror entry diagonal */ + hypre_NonGalerkinIJBufferWrite( ijmatrix, + &ijbuf_sym_cnt, ijbuf_size, &ijbuf_sym_rowcounter, + &ijbuf_sym_data, &ijbuf_sym_cols, &ijbuf_sym_rownums, + &ijbuf_sym_numcols, cnt, cnt, neg_lump_value ); + } + /*}*/ + } + + /* The offd_intersection has global column indices, i.e., the + * col_map arrays contain global indices */ + for (k = 0; k < offd_intersection_len; k++) + { + lump_value = lump_percent * hypre_abs(offd_intersection_data[k]) * sum_strong_neigh; + diagonal_lump_value = (1.0 - lump_percent) * hypre_abs(offd_intersection_data[k]) * + sum_strong_neigh; + neg_lump_value = -1.0 * lump_value; + + hypre_NonGalerkinIJBufferWrite( ijmatrix, &ijbuf_cnt, ijbuf_size, &ijbuf_rowcounter, + &ijbuf_data, &ijbuf_cols, &ijbuf_rownums, &ijbuf_numcols, global_row, + offd_intersection[k], lump_value ); + + if (lump_percent < 1.0) + { + hypre_NonGalerkinIJBufferWrite( ijmatrix, &ijbuf_cnt, ijbuf_size, &ijbuf_rowcounter, + &ijbuf_data, &ijbuf_cols, &ijbuf_rownums, &ijbuf_numcols, global_row, + global_row, diagonal_lump_value ); + } + + /* Update mirror entries, if symmetric collapsing */ + if (sym_collapse) + { + hypre_NonGalerkinIJBufferWrite( ijmatrix, + &ijbuf_sym_cnt, ijbuf_size, &ijbuf_sym_rowcounter, + &ijbuf_sym_data, &ijbuf_sym_cols, &ijbuf_sym_rownums, + &ijbuf_sym_numcols, offd_intersection[k], + global_row, lump_value ); + hypre_NonGalerkinIJBufferWrite( ijmatrix, + &ijbuf_sym_cnt, ijbuf_size, &ijbuf_sym_rowcounter, + &ijbuf_sym_data, &ijbuf_sym_cols, &ijbuf_sym_rownums, + &ijbuf_sym_numcols, offd_intersection[k], + offd_intersection[k], neg_lump_value ); + } + } + } + /* If intersection is empty, do not eliminate entry */ + else + { + /* Don't forget to update mirror entry if collapsing symmetrically */ + if (sym_collapse) + { lump_value = 0.5 * RAP_diag_data[j]; } + else + { lump_value = RAP_diag_data[j]; } + + cnt = col_indx_RAP + first_col_diag_RAP; + hypre_NonGalerkinIJBufferWrite( ijmatrix, &ijbuf_cnt, ijbuf_size, &ijbuf_rowcounter, + &ijbuf_data, &ijbuf_cols, &ijbuf_rownums, &ijbuf_numcols, global_row, + cnt, lump_value ); + if (sym_collapse) + { + hypre_NonGalerkinIJBufferWrite( ijmatrix, + &ijbuf_sym_cnt, ijbuf_size, &ijbuf_sym_rowcounter, + &ijbuf_sym_data, &ijbuf_sym_cols, &ijbuf_sym_rownums, + &ijbuf_sym_numcols, cnt, global_row, lump_value ); + } + } } - } - - /* This creates col_map_offd_Sext */ - if (S_ext_offd_size || num_cols_offd_S) - { - temp = hypre_CTAlloc(HYPRE_BigInt, S_ext_offd_size+num_cols_offd_S, HYPRE_MEMORY_HOST); - for (i=0; i < S_ext_offd_size; i++) - temp[i] = S_ext_j[i]; - cnt = S_ext_offd_size; - for (i=0; i < num_cols_offd_S; i++) - temp[cnt++] = col_map_offd_S[i]; - } - if (cnt) - { - /* after this, the first so many entries of temp will hold the - * unique column indices in S_ext_offd_j unioned with the indices - * in col_map_offd_S */ - hypre_BigQsort0(temp, 0, cnt-1); - - num_cols_offd_Sext = 1; - value = temp[0]; - for (i=1; i < cnt; i++) - { - if (temp[i] > value) + /* The entry in RAP appears in Pattern, so keep it */ + else if (col_indx_RAP == col_indx_Pattern) { - value = temp[i]; - temp[num_cols_offd_Sext++] = value; + cnt = col_indx_RAP + first_col_diag_RAP; + hypre_NonGalerkinIJBufferWrite( ijmatrix, &ijbuf_cnt, ijbuf_size, &ijbuf_rowcounter, + &ijbuf_data, &ijbuf_cols, &ijbuf_rownums, &ijbuf_numcols, global_row, + cnt, RAP_diag_data[j] ); + + /* Only go to the next entry in Pattern, if this is not the end of a row */ + if ( current_Pattern_j < Pattern_diag_i[i + 1] - 1 ) + { + current_Pattern_j += 1; + col_indx_Pattern = Pattern_diag_j[current_Pattern_j]; + } + else + { has_row_ended = 1;} } - } - } - else - { - num_cols_offd_Sext = 0; - } - - /* num_nonzeros_S_ext_diag = cnt_diag; - num_nonzeros_S_ext_offd = S_ext_offd_size; */ - - if (num_cols_offd_Sext) - col_map_offd_Sext = hypre_CTAlloc(HYPRE_BigInt, num_cols_offd_Sext, HYPRE_MEMORY_HOST); - - for (i=0; i < num_cols_offd_Sext; i++) - col_map_offd_Sext[i] = temp[i]; - - if (S_ext_offd_size || num_cols_offd_S) - hypre_TFree(temp, HYPRE_MEMORY_HOST); - - /* look for S_ext_offd_j[i] in col_map_offd_Sext, and set S_ext_offd_j[i] - * to the index of that column value in col_map_offd_Sext */ - for (i=0 ; i < S_ext_offd_size; i++) - S_ext_offd_j[i] = hypre_BigBinarySearch(col_map_offd_Sext, - S_ext_j[i], - num_cols_offd_Sext); - - - if (num_procs > 1) - { - hypre_CSRMatrixDestroy(S_ext); - S_ext = NULL; - } - - /* Need to sort column indices in S and S_ext */ - for(i = 0; i < num_variables; i++) - { - - /* Re-Sort diag portion of Pattern, placing the diagonal entry in a - * sorted position */ - row_start = Pattern_diag_i[i]; - row_end = Pattern_diag_i[i+1]; - hypre_qsort1(Pattern_diag_j, Pattern_diag_data, row_start, row_end-1 ); - - /* Sort diag portion of S, noting that no diagonal entry */ - /* S has not "data" array...it's just NULL */ - row_start = S_diag_i[i]; - row_end = S_diag_i[i+1]; - hypre_qsort1(S_diag_j, S_diag_data, row_start, row_end-1 ); - - /* Sort offd portion of S */ - /* S has no "data" array...it's just NULL */ - row_start = S_offd_i[i]; - row_end = S_offd_i[i+1]; - hypre_qsort1(S_offd_j, S_offd_data, row_start, row_end-1 ); - - } - - /* Sort S_ext - * num_cols_RAP_offd equals num_rows for S_ext*/ - for(i = 0; i < num_cols_RAP_offd; i++) - { - /* Sort diag portion of S_ext */ - row_start = S_ext_diag_i[i]; - row_end = S_ext_diag_i[i+1]; - hypre_qsort1(S_ext_diag_j, S_ext_diag_data, row_start, row_end-1 ); - - /* Sort offd portion of S_ext */ - row_start = S_ext_offd_i[i]; - row_end = S_ext_offd_i[i+1]; - hypre_qsort1(S_ext_offd_j, S_ext_offd_data, row_start, row_end-1 ); - - } - - /* - * Now, for the fun stuff -- Computing the Non-Galerkin Operator - */ - - /* Initialize the ijmatrix, leveraging our knowledge of the nonzero - * structure in Pattern */ - ierr += HYPRE_IJMatrixCreate(comm, first_col_diag_RAP, last_col_diag_RAP, - first_col_diag_RAP, last_col_diag_RAP, &ijmatrix); - ierr += HYPRE_IJMatrixSetObjectType(ijmatrix, HYPRE_PARCSR); - rownz = hypre_CTAlloc(HYPRE_Int, num_variables, HYPRE_MEMORY_HOST); - for(i = 0; i < num_variables; i++) - { rownz[i] = 1.2*(Pattern_diag_i[i+1] - Pattern_diag_i[i]) + 1.2*(Pattern_offd_i[i+1] - Pattern_offd_i[i]); } - HYPRE_IJMatrixSetRowSizes(ijmatrix, rownz); - ierr += HYPRE_IJMatrixInitialize(ijmatrix); - hypre_TFree(rownz, HYPRE_MEMORY_HOST); - - /* - *For efficiency, we do a buffered IJAddToValues. - * Here, we initialize the buffer and then initialize the buffer counters - */ - ijbuf_size = 1000; - ijbuf_data = hypre_CTAlloc(HYPRE_Real, ijbuf_size, HYPRE_MEMORY_DEVICE); - ijbuf_cols = hypre_CTAlloc(HYPRE_BigInt, ijbuf_size, HYPRE_MEMORY_DEVICE); - ijbuf_rownums = hypre_CTAlloc(HYPRE_BigInt, ijbuf_size, HYPRE_MEMORY_DEVICE); - ijbuf_numcols = hypre_CTAlloc(HYPRE_Int, ijbuf_size, HYPRE_MEMORY_DEVICE); - hypre_NonGalerkinIJBigBufferInit( &ijbuf_cnt, &ijbuf_rowcounter, ijbuf_cols ); - if(sym_collapse) - { - ijbuf_sym_data = hypre_CTAlloc(HYPRE_Real, ijbuf_size, HYPRE_MEMORY_DEVICE); - ijbuf_sym_cols = hypre_CTAlloc(HYPRE_BigInt, ijbuf_size, HYPRE_MEMORY_DEVICE); - ijbuf_sym_rownums= hypre_CTAlloc(HYPRE_BigInt, ijbuf_size, HYPRE_MEMORY_DEVICE); - ijbuf_sym_numcols= hypre_CTAlloc(HYPRE_Int, ijbuf_size, HYPRE_MEMORY_DEVICE); - hypre_NonGalerkinIJBigBufferInit( &ijbuf_sym_cnt, &ijbuf_sym_rowcounter, ijbuf_sym_cols ); - } - - /* - * Eliminate Entries In RAP_diag - * */ - for(i = 0; i < num_variables; i++) - { - global_row = i+first_col_diag_RAP; - row_start = RAP_diag_i[i]; - row_end = RAP_diag_i[i+1]; - has_row_ended = 0; - - /* Only do work if row has nonzeros */ - if( row_start < row_end) - { - /* Grab pointer to current entry in Pattern_diag */ - current_Pattern_j = Pattern_diag_i[i]; - col_indx_Pattern = Pattern_diag_j[current_Pattern_j]; + /* Increment col_indx_Pattern, and repeat this loop iter for current + * col_ind_RAP value */ + else if (col_indx_RAP > col_indx_Pattern) + { + for (; current_Pattern_j < Pattern_diag_i[i + 1]; current_Pattern_j++) + { + col_indx_Pattern = Pattern_diag_j[current_Pattern_j]; + if (col_indx_RAP <= col_indx_Pattern) + { break;} + } - /* Grab this row's indices out of Pattern offd and diag. This will - * be for computing index set intersections for lumping */ - /* Ensure adequate length */ - Pattern_offd_indices_len = Pattern_offd_i[i+1] - Pattern_offd_i[i]; - if(Pattern_offd_indices_allocated_len < Pattern_offd_indices_len) + /* If col_indx_RAP is still greater (i.e., we've reached a row end), then + * we need to lump everything else in this row */ + if (col_indx_RAP > col_indx_Pattern) + { has_row_ended = 1; } + + /* Decrement j, in order to repeat this loop iteration for the current + * col_indx_RAP value */ + j--; + } + } + } + + } + + /* + * Eliminate Entries In RAP_offd + * Structure of this for-loop is very similar to the RAP_diag for-loop + * But, not so similar that these loops should be combined into a single fuction. + * */ + if (num_cols_RAP_offd) + { + for (i = 0; i < num_variables; i++) + { + global_row = i + first_col_diag_RAP; + row_start = RAP_offd_i[i]; + row_end = RAP_offd_i[i + 1]; + has_row_ended = 0; + + /* Only do work if row has nonzeros */ + if ( row_start < row_end) + { + current_Pattern_j = Pattern_offd_i[i]; + Pattern_offd_indices_len = Pattern_offd_i[i + 1] - Pattern_offd_i[i]; + if ( (Pattern_offd_j != NULL) && (Pattern_offd_indices_len > 0) ) + { col_indx_Pattern = col_map_offd_Pattern[ Pattern_offd_j[current_Pattern_j] ]; } + else { - hypre_TFree(Pattern_offd_indices, HYPRE_MEMORY_HOST); - Pattern_offd_indices = hypre_CTAlloc(HYPRE_BigInt, Pattern_offd_indices_len, HYPRE_MEMORY_HOST); - Pattern_offd_indices_allocated_len = Pattern_offd_indices_len; + /* if Pattern_offd_j is not allocated or this is a zero length row, + then all entries need to be lumped. + This is an analagous situation to has_row_ended=1. */ + col_indx_Pattern = -1; + has_row_ended = 1; } - /* Grab sub array from col_map, corresponding to the slice of Pattern_offd_j */ + + /* Grab this row's indices out of Pattern offd and diag. This will + * be for computing index set intersections for lumping. The above + * loop over RAP_diag ensures adequate length of Pattern_offd_indices */ + /* Ensure adequate length */ hypre_GrabSubArray(Pattern_offd_j, - Pattern_offd_i[i], Pattern_offd_i[i+1]-1, + Pattern_offd_i[i], Pattern_offd_i[i + 1] - 1, col_map_offd_Pattern, Pattern_offd_indices); /* No need to grab info out of Pattern_diag_j[...], here we just start from * Pattern_diag_i[i] and end at index Pattern_diag_i[i+1] - 1. We do need to * ignore the diagonal entry in Pattern, because we don't lump entries there */ - if( Pattern_diag_j[Pattern_diag_i[i]] == i ) + if ( Pattern_diag_j[Pattern_diag_i[i]] == i ) { - Pattern_indices_ptr = &( Pattern_diag_j[Pattern_diag_i[i]+1]); - Pattern_diag_indices_len = Pattern_diag_i[i+1] - Pattern_diag_i[i] - 1; + Pattern_indices_ptr = &( Pattern_diag_j[Pattern_diag_i[i] + 1]); + Pattern_diag_indices_len = Pattern_diag_i[i + 1] - Pattern_diag_i[i] - 1; } else { - Pattern_indices_ptr = &( Pattern_diag_j[Pattern_diag_i[i]]); - Pattern_diag_indices_len = Pattern_diag_i[i+1] - Pattern_diag_i[i]; + Pattern_indices_ptr = &( Pattern_diag_j[Pattern_diag_i[i]]); + Pattern_diag_indices_len = Pattern_diag_i[i + 1] - Pattern_diag_i[i]; } - } - for(j = row_start; j < row_end; j++) - { - col_indx_RAP = RAP_diag_j[j]; + } + + for (j = row_start; j < row_end; j++) + { /* Ignore zero entries in RAP */ - if( RAP_diag_data[j] != 0.0) + if ( RAP_offd_data[j] != 0.0) { - /* Don't change the diagonal, just write it */ - if(col_indx_RAP == i) - { -/*#ifdef HY PRE_USING_OPENMP -#pragma omp critical (IJAdd) -#endif -{*/ - /* For efficiency, we do a buffered IJAddToValues. - * A[global_row, global_row] += RAP_diag_data[j] */ - hypre_NonGalerkinIJBufferWrite( ijmatrix, &ijbuf_cnt, ijbuf_size, &ijbuf_rowcounter, - &ijbuf_data, &ijbuf_cols, &ijbuf_rownums, &ijbuf_numcols, global_row, - global_row, RAP_diag_data[j] ); -/*}*/ - } + /* In general for all the offd_j arrays, we have to indirectly + * index with the col_map_offd array to get a global index */ + col_indx_RAP = col_map_offd_RAP[ RAP_offd_j[j] ]; + /* The entry in RAP does not appear in Pattern, so LUMP it */ - else if( (col_indx_RAP < col_indx_Pattern) || has_row_ended) + if ( (col_indx_RAP < col_indx_Pattern) || has_row_ended) { - /* Lump entry (i, col_indx_RAP) in RAP */ - - /* Grab the indices for row col_indx_RAP of S_offd and diag. This will - * be for computing lumping locations */ - S_offd_indices_len = S_offd_i[col_indx_RAP+1] - S_offd_i[col_indx_RAP]; - if(S_offd_indices_allocated_len < S_offd_indices_len) - { - hypre_TFree(S_offd_indices, HYPRE_MEMORY_HOST); - S_offd_indices = hypre_CTAlloc(HYPRE_BigInt, S_offd_indices_len, HYPRE_MEMORY_HOST); - S_offd_indices_allocated_len = S_offd_indices_len; - } - /* Grab sub array from col_map, corresponding to the slice of S_offd_j */ - hypre_GrabSubArray(S_offd_j, S_offd_i[col_indx_RAP], S_offd_i[col_indx_RAP+1]-1, - col_map_offd_S, S_offd_indices); - /* No need to grab info out of S_diag_j[...], here we just start from - * S_diag_i[col_indx_RAP] and end at index S_diag_i[col_indx_RAP+1] - 1 */ - - /* Intersect the diag and offd pieces, remembering that the - * diag array will need to have the offset +first_col_diag_RAP */ - cnt = hypre_max(S_offd_indices_len, Pattern_offd_indices_len); - if(offd_intersection_allocated_len < cnt) - { - hypre_TFree(offd_intersection, HYPRE_MEMORY_HOST); - hypre_TFree(offd_intersection_data, HYPRE_MEMORY_HOST); - offd_intersection = hypre_CTAlloc(HYPRE_BigInt, cnt, HYPRE_MEMORY_HOST); - offd_intersection_data = hypre_CTAlloc(HYPRE_Real, cnt, HYPRE_MEMORY_HOST); - offd_intersection_allocated_len = cnt; - } - /* This intersection also tracks S_offd_data and assumes that - * S_offd_indices is the first argument here */ - hypre_IntersectTwoBigArrays(S_offd_indices, - &(S_offd_data[ S_offd_i[col_indx_RAP] ]), - S_offd_indices_len, - Pattern_offd_indices, - Pattern_offd_indices_len, - offd_intersection, - offd_intersection_data, - &offd_intersection_len); - - - /* Now, intersect the indices for the diag block. Note that S_diag_j does - * not have a diagonal entry, so no lumping occurs to the diagonal. */ - cnt = hypre_max(Pattern_diag_indices_len, - S_diag_i[col_indx_RAP+1] - S_diag_i[col_indx_RAP] ); - if(diag_intersection_allocated_len < cnt) - { - hypre_TFree(diag_intersection, HYPRE_MEMORY_HOST); - hypre_TFree(diag_intersection_data, HYPRE_MEMORY_HOST); - diag_intersection = hypre_CTAlloc(HYPRE_Int, cnt, HYPRE_MEMORY_HOST); - diag_intersection_data = hypre_CTAlloc(HYPRE_Real, cnt, HYPRE_MEMORY_HOST); - diag_intersection_allocated_len = cnt; - } - /* There is no diagonal entry in first position of S */ - hypre_IntersectTwoArrays( &(S_diag_j[S_diag_i[col_indx_RAP]]), - &(S_diag_data[ S_diag_i[col_indx_RAP] ]), - S_diag_i[col_indx_RAP+1] - S_diag_i[col_indx_RAP], + /* The row_indx_Sext would be found with: + row_indx_Sext = hypre_BinarySearch(col_map_offd_RAP, col_indx_RAP, num_cols_RAP_offd); + But, we already know the answer to this with, */ + row_indx_Sext = RAP_offd_j[j]; + + /* Grab the indices for row row_indx_Sext from the offd and diag parts. This will + * be for computing lumping locations */ + S_offd_indices_len = S_ext_offd_i[row_indx_Sext + 1] - S_ext_offd_i[row_indx_Sext]; + if (S_offd_indices_allocated_len < S_offd_indices_len) + { + hypre_TFree(S_offd_indices, HYPRE_MEMORY_HOST); + S_offd_indices = hypre_CTAlloc(HYPRE_BigInt, S_offd_indices_len, HYPRE_MEMORY_HOST); + S_offd_indices_allocated_len = S_offd_indices_len; + } + /* Grab sub array from col_map, corresponding to the slice of S_ext_offd_j */ + hypre_GrabSubArray(S_ext_offd_j, S_ext_offd_i[row_indx_Sext], S_ext_offd_i[row_indx_Sext + 1] - 1, + col_map_offd_Sext, S_offd_indices); + /* No need to grab info out of S_ext_diag_j[...], here we just start from + * S_ext_diag_i[row_indx_Sext] and end at index S_ext_diag_i[row_indx_Sext+1] - 1 */ + + /* Intersect the diag and offd pieces, remembering that the + * diag array will need to have the offset +first_col_diag_RAP */ + cnt = hypre_max(S_offd_indices_len, Pattern_offd_indices_len); + if (offd_intersection_allocated_len < cnt) + { + hypre_TFree(offd_intersection, HYPRE_MEMORY_HOST); + hypre_TFree(offd_intersection_data, HYPRE_MEMORY_HOST); + offd_intersection = hypre_CTAlloc(HYPRE_BigInt, cnt, HYPRE_MEMORY_HOST); + offd_intersection_data = hypre_CTAlloc(HYPRE_Real, cnt, HYPRE_MEMORY_HOST); + offd_intersection_allocated_len = cnt; + } + hypre_IntersectTwoBigArrays(S_offd_indices, + &(S_ext_offd_data[ S_ext_offd_i[row_indx_Sext] ]), + S_offd_indices_len, + Pattern_offd_indices, + Pattern_offd_indices_len, + offd_intersection, + offd_intersection_data, + &offd_intersection_len); + + /* Now, intersect the indices for the diag block. */ + cnt = hypre_max(Pattern_diag_indices_len, + S_ext_diag_i[row_indx_Sext + 1] - S_ext_diag_i[row_indx_Sext] ); + if (diag_intersection_allocated_len < cnt) + { + hypre_TFree(diag_intersection, HYPRE_MEMORY_HOST); + hypre_TFree(diag_intersection_data, HYPRE_MEMORY_HOST); + diag_intersection = hypre_CTAlloc(HYPRE_Int, cnt, HYPRE_MEMORY_HOST); + diag_intersection_data = hypre_CTAlloc(HYPRE_Real, cnt, HYPRE_MEMORY_HOST); + diag_intersection_allocated_len = cnt; + } + hypre_IntersectTwoArrays( &(S_ext_diag_j[S_ext_diag_i[row_indx_Sext]]), + &(S_ext_diag_data[ S_ext_diag_i[row_indx_Sext] ]), + S_ext_diag_i[row_indx_Sext + 1] - S_ext_diag_i[row_indx_Sext], Pattern_indices_ptr, Pattern_diag_indices_len, diag_intersection, diag_intersection_data, &diag_intersection_len); - /* Loop over these intersections, and lump a constant fraction of - * RAP_diag_data[j] to each entry */ - intersection_len = diag_intersection_len + offd_intersection_len; - if(intersection_len > 0) - { - /* Sum the strength-of-connection values from row - * col_indx_RAP in S, corresponding to the indices we are - * collapsing to in row i This will give us our collapsing - * weights. */ - sum_strong_neigh = 0.0; - for(k = 0; k < diag_intersection_len; k++) - { sum_strong_neigh += fabs(diag_intersection_data[k]); } - for(k = 0; k < offd_intersection_len; k++) - { sum_strong_neigh += fabs(offd_intersection_data[k]); } - sum_strong_neigh = RAP_diag_data[j]/sum_strong_neigh; - - /* When lumping with the diag_intersection, must offset column index */ - for(k = 0; k < diag_intersection_len; k++) - { - lump_value = lump_percent * fabs(diag_intersection_data[k])*sum_strong_neigh; - diagonal_lump_value = (1.0 - lump_percent) * fabs(diag_intersection_data[k])*sum_strong_neigh; - neg_lump_value = -1.0 * lump_value; - cnt = diag_intersection[k]+first_col_diag_RAP; - -/*#ifdef HY PRE_USING_OPENMP -#pragma omp critical (IJAdd) -#endif -{*/ - /* For efficiency, we do a buffered IJAddToValues. - * A[global_row, cnt] += RAP_diag_data[j] */ + /* Loop over these intersections, and lump a constant fraction of + * RAP_offd_data[j] to each entry */ + intersection_len = diag_intersection_len + offd_intersection_len; + if (intersection_len > 0) + { + /* Sum the strength-of-connection values from row + * row_indx_Sext in S, corresponding to the indices we are + * collapsing to in row i. This will give us our collapsing + * weights. */ + sum_strong_neigh = 0.0; + for (k = 0; k < diag_intersection_len; k++) + { sum_strong_neigh += hypre_abs(diag_intersection_data[k]); } + for (k = 0; k < offd_intersection_len; k++) + { sum_strong_neigh += hypre_abs(offd_intersection_data[k]); } + sum_strong_neigh = RAP_offd_data[j] / sum_strong_neigh; + + /* When lumping with the diag_intersection, must offset column index */ + for (k = 0; k < diag_intersection_len; k++) + { + lump_value = lump_percent * hypre_abs(diag_intersection_data[k]) * sum_strong_neigh; + diagonal_lump_value = (1.0 - lump_percent) * hypre_abs(diag_intersection_data[k]) * + sum_strong_neigh; + neg_lump_value = -1.0 * lump_value; + cnt = diag_intersection[k] + first_col_diag_RAP; + + hypre_NonGalerkinIJBufferWrite( ijmatrix, &ijbuf_cnt, ijbuf_size, &ijbuf_rowcounter, + &ijbuf_data, &ijbuf_cols, &ijbuf_rownums, &ijbuf_numcols, global_row, cnt, lump_value ); + if (lump_percent < 1.0) + { hypre_NonGalerkinIJBufferWrite( ijmatrix, &ijbuf_cnt, ijbuf_size, &ijbuf_rowcounter, - &ijbuf_data, &ijbuf_cols, &ijbuf_rownums, &ijbuf_numcols, global_row, - cnt, lump_value ); - if (lump_percent < 1.0) - { - /* Preserve row sum by updating diagonal */ - hypre_NonGalerkinIJBufferWrite( ijmatrix, &ijbuf_cnt, ijbuf_size, &ijbuf_rowcounter, - &ijbuf_data, &ijbuf_cols, &ijbuf_rownums, &ijbuf_numcols, global_row, - global_row, diagonal_lump_value ); - } - - /* Update mirror entries, if symmetric collapsing */ - if(sym_collapse) - { - /* Update mirror entry */ - hypre_NonGalerkinIJBufferWrite( ijmatrix, - &ijbuf_sym_cnt, ijbuf_size, &ijbuf_sym_rowcounter, - &ijbuf_sym_data, &ijbuf_sym_cols, &ijbuf_sym_rownums, - &ijbuf_sym_numcols, cnt, global_row, lump_value ); - /* Update mirror entry diagonal */ - hypre_NonGalerkinIJBufferWrite( ijmatrix, - &ijbuf_sym_cnt, ijbuf_size, &ijbuf_sym_rowcounter, - &ijbuf_sym_data, &ijbuf_sym_cols, &ijbuf_sym_rownums, - &ijbuf_sym_numcols, cnt, cnt, neg_lump_value ); - } -/*}*/ - } - - /* The offd_intersection has global column indices, i.e., the - * col_map arrays contain global indices */ - for(k = 0; k < offd_intersection_len; k++) - { - lump_value = lump_percent * fabs(offd_intersection_data[k])*sum_strong_neigh; - diagonal_lump_value = (1.0 - lump_percent) * fabs(offd_intersection_data[k])*sum_strong_neigh; - neg_lump_value = -1.0 * lump_value; + &ijbuf_data, &ijbuf_cols, &ijbuf_rownums, &ijbuf_numcols, global_row, global_row, + diagonal_lump_value ); + } + /* Update mirror entries, if symmetric collapsing */ + if (sym_collapse) + { + hypre_NonGalerkinIJBufferWrite( ijmatrix, + &ijbuf_sym_cnt, ijbuf_size, + &ijbuf_sym_rowcounter, &ijbuf_sym_data, + &ijbuf_sym_cols, &ijbuf_sym_rownums, + &ijbuf_sym_numcols, cnt, global_row, lump_value); + hypre_NonGalerkinIJBufferWrite( ijmatrix, + &ijbuf_sym_cnt, ijbuf_size, + &ijbuf_sym_rowcounter, &ijbuf_sym_data, + &ijbuf_sym_cols, &ijbuf_sym_rownums, + &ijbuf_sym_numcols, cnt, cnt, neg_lump_value ); + } + } + + /* The offd_intersection has global column indices, i.e., the + * col_map arrays contain global indices */ + for (k = 0; k < offd_intersection_len; k++) + { + lump_value = lump_percent * hypre_abs(offd_intersection_data[k]) * sum_strong_neigh; + diagonal_lump_value = (1.0 - lump_percent) * hypre_abs(offd_intersection_data[k]) * + sum_strong_neigh; + neg_lump_value = -1.0 * lump_value; + + hypre_NonGalerkinIJBufferWrite( ijmatrix, &ijbuf_cnt, ijbuf_size, &ijbuf_rowcounter, + &ijbuf_data, &ijbuf_cols, &ijbuf_rownums, &ijbuf_numcols, global_row, + offd_intersection[k], lump_value ); + if (lump_percent < 1.0) + { hypre_NonGalerkinIJBufferWrite( ijmatrix, &ijbuf_cnt, ijbuf_size, &ijbuf_rowcounter, - &ijbuf_data, &ijbuf_cols, &ijbuf_rownums, &ijbuf_numcols, global_row, - offd_intersection[k], lump_value ); - - if (lump_percent < 1.0) - { - hypre_NonGalerkinIJBufferWrite( ijmatrix, &ijbuf_cnt, ijbuf_size, &ijbuf_rowcounter, - &ijbuf_data, &ijbuf_cols, &ijbuf_rownums, &ijbuf_numcols, global_row, - global_row, diagonal_lump_value ); - } - - /* Update mirror entries, if symmetric collapsing */ - if (sym_collapse) - { - hypre_NonGalerkinIJBufferWrite( ijmatrix, - &ijbuf_sym_cnt, ijbuf_size, &ijbuf_sym_rowcounter, - &ijbuf_sym_data, &ijbuf_sym_cols, &ijbuf_sym_rownums, - &ijbuf_sym_numcols, offd_intersection[k], - global_row, lump_value ); - hypre_NonGalerkinIJBufferWrite( ijmatrix, - &ijbuf_sym_cnt, ijbuf_size, &ijbuf_sym_rowcounter, - &ijbuf_sym_data, &ijbuf_sym_cols, &ijbuf_sym_rownums, - &ijbuf_sym_numcols, offd_intersection[k], - offd_intersection[k], neg_lump_value ); - } - } - } - /* If intersection is empty, do not eliminate entry */ - else - { - /* Don't forget to update mirror entry if collapsing symmetrically */ - if (sym_collapse) - { lump_value = 0.5*RAP_diag_data[j]; } - else - { lump_value = RAP_diag_data[j]; } - - cnt = col_indx_RAP+first_col_diag_RAP; - hypre_NonGalerkinIJBufferWrite( ijmatrix, &ijbuf_cnt, ijbuf_size, &ijbuf_rowcounter, - &ijbuf_data, &ijbuf_cols, &ijbuf_rownums, &ijbuf_numcols, global_row, - cnt, lump_value ); - if (sym_collapse) - { + &ijbuf_data, &ijbuf_cols, &ijbuf_rownums, &ijbuf_numcols, global_row, global_row, + diagonal_lump_value ); + } + + + /* Update mirror entries, if symmetric collapsing */ + if (sym_collapse) + { hypre_NonGalerkinIJBufferWrite( ijmatrix, - &ijbuf_sym_cnt, ijbuf_size, &ijbuf_sym_rowcounter, - &ijbuf_sym_data, &ijbuf_sym_cols, &ijbuf_sym_rownums, - &ijbuf_sym_numcols, cnt, global_row, lump_value ); - } - } + &ijbuf_sym_cnt, ijbuf_size, + &ijbuf_sym_rowcounter, &ijbuf_sym_data, + &ijbuf_sym_cols, &ijbuf_sym_rownums, + &ijbuf_sym_numcols, offd_intersection[k], + global_row, lump_value ); + hypre_NonGalerkinIJBufferWrite( ijmatrix, + &ijbuf_sym_cnt, ijbuf_size, + &ijbuf_sym_rowcounter, &ijbuf_sym_data, + &ijbuf_sym_cols, &ijbuf_sym_rownums, + &ijbuf_sym_numcols, offd_intersection[k], + offd_intersection[k], neg_lump_value ); + } + } + } + /* If intersection is empty, do not eliminate entry */ + else + { + /* Don't forget to update mirror entry if collapsing symmetrically */ + if (sym_collapse) + { lump_value = 0.5 * RAP_offd_data[j]; } + else + { lump_value = RAP_offd_data[j]; } + + hypre_NonGalerkinIJBufferWrite( ijmatrix, &ijbuf_cnt, ijbuf_size, &ijbuf_rowcounter, + &ijbuf_data, &ijbuf_cols, &ijbuf_rownums, &ijbuf_numcols, global_row, col_indx_RAP, + lump_value ); + if (sym_collapse) + { + hypre_NonGalerkinIJBufferWrite( ijmatrix, + &ijbuf_sym_cnt, ijbuf_size, &ijbuf_sym_rowcounter, + &ijbuf_sym_data, &ijbuf_sym_cols, &ijbuf_sym_rownums, + &ijbuf_sym_numcols, col_indx_RAP, global_row, + lump_value ); + } + } } /* The entry in RAP appears in Pattern, so keep it */ - else if(col_indx_RAP == col_indx_Pattern) + else if (col_indx_RAP == col_indx_Pattern) { - cnt = col_indx_RAP+first_col_diag_RAP; - hypre_NonGalerkinIJBufferWrite( ijmatrix, &ijbuf_cnt, ijbuf_size, &ijbuf_rowcounter, - &ijbuf_data, &ijbuf_cols, &ijbuf_rownums, &ijbuf_numcols, global_row, - cnt, RAP_diag_data[j] ); - - /* Only go to the next entry in Pattern, if this is not the end of a row */ - if( current_Pattern_j < Pattern_diag_i[i+1]-1 ) - { - current_Pattern_j += 1; - col_indx_Pattern = Pattern_diag_j[current_Pattern_j]; - } - else - { has_row_ended = 1;} + /* For the offd structure, col_indx_RAP is a global dof number */ + hypre_NonGalerkinIJBufferWrite( ijmatrix, &ijbuf_cnt, ijbuf_size, &ijbuf_rowcounter, + &ijbuf_data, &ijbuf_cols, &ijbuf_rownums, &ijbuf_numcols, global_row, col_indx_RAP, + RAP_offd_data[j]); + + /* Only go to the next entry in Pattern, if this is not the end of a row */ + if ( current_Pattern_j < Pattern_offd_i[i + 1] - 1 ) + { + current_Pattern_j += 1; + col_indx_Pattern = col_map_offd_Pattern[ Pattern_offd_j[current_Pattern_j] ]; + } + else + { has_row_ended = 1;} } /* Increment col_indx_Pattern, and repeat this loop iter for current * col_ind_RAP value */ - else if(col_indx_RAP > col_indx_Pattern) + else if (col_indx_RAP > col_indx_Pattern) { - for(; current_Pattern_j < Pattern_diag_i[i+1]; current_Pattern_j++) - { - col_indx_Pattern = Pattern_diag_j[current_Pattern_j]; - if(col_indx_RAP <= col_indx_Pattern) - { break;} - } - - /* If col_indx_RAP is still greater (i.e., we've reached a row end), then - * we need to lump everything else in this row */ - if(col_indx_RAP > col_indx_Pattern) - { has_row_ended = 1; } - - /* Decrement j, in order to repeat this loop iteration for the current - * col_indx_RAP value */ - j--; + for (; current_Pattern_j < Pattern_offd_i[i + 1]; current_Pattern_j++) + { + col_indx_Pattern = col_map_offd_Pattern[ Pattern_offd_j[current_Pattern_j] ]; + if (col_indx_RAP <= col_indx_Pattern) + { break;} + } + + /* If col_indx_RAP is still greater (i.e., we've reached a row end), then + * we need to lump everything else in this row */ + if (col_indx_RAP > col_indx_Pattern) + { has_row_ended = 1; } + + /* Decrement j, in order to repeat this loop iteration for the current + * col_indx_RAP value */ + j--; } } - } - - } - - /* - * Eliminate Entries In RAP_offd - * Structure of this for-loop is very similar to the RAP_diag for-loop - * But, not so similar that these loops should be combined into a single fuction. - * */ - if(num_cols_RAP_offd) - { - for(i = 0; i < num_variables; i++) - { - global_row = i+first_col_diag_RAP; - row_start = RAP_offd_i[i]; - row_end = RAP_offd_i[i+1]; - has_row_ended = 0; - - /* Only do work if row has nonzeros */ - if( row_start < row_end) - { - current_Pattern_j = Pattern_offd_i[i]; - Pattern_offd_indices_len = Pattern_offd_i[i+1] - Pattern_offd_i[i]; - if( (Pattern_offd_j != NULL) && (Pattern_offd_indices_len > 0) ) - { col_indx_Pattern = col_map_offd_Pattern[ Pattern_offd_j[current_Pattern_j] ]; } - else - { /* if Pattern_offd_j is not allocated or this is a zero length row, - then all entries need to be lumped. - This is an analagous situation to has_row_ended=1. */ - col_indx_Pattern = -1; - has_row_ended = 1; - } - - /* Grab this row's indices out of Pattern offd and diag. This will - * be for computing index set intersections for lumping. The above - * loop over RAP_diag ensures adequate length of Pattern_offd_indices */ - /* Ensure adequate length */ - hypre_GrabSubArray(Pattern_offd_j, - Pattern_offd_i[i], Pattern_offd_i[i+1]-1, - col_map_offd_Pattern, Pattern_offd_indices); - /* No need to grab info out of Pattern_diag_j[...], here we just start from - * Pattern_diag_i[i] and end at index Pattern_diag_i[i+1] - 1. We do need to - * ignore the diagonal entry in Pattern, because we don't lump entries there */ - if( Pattern_diag_j[Pattern_diag_i[i]] == i ) - { - Pattern_indices_ptr = &( Pattern_diag_j[Pattern_diag_i[i]+1]); - Pattern_diag_indices_len = Pattern_diag_i[i+1] - Pattern_diag_i[i] - 1; - } - else - { - Pattern_indices_ptr = &( Pattern_diag_j[Pattern_diag_i[i]]); - Pattern_diag_indices_len = Pattern_diag_i[i+1] - Pattern_diag_i[i]; - } - - } - - for(j = row_start; j < row_end; j++) - { - - /* Ignore zero entries in RAP */ - if( RAP_offd_data[j] != 0.0) - { - - /* In general for all the offd_j arrays, we have to indirectly - * index with the col_map_offd array to get a global index */ - col_indx_RAP = col_map_offd_RAP[ RAP_offd_j[j] ]; - - /* The entry in RAP does not appear in Pattern, so LUMP it */ - if( (col_indx_RAP < col_indx_Pattern) || has_row_ended) - { - /* The row_indx_Sext would be found with: - row_indx_Sext = hypre_BinarySearch(col_map_offd_RAP, col_indx_RAP, num_cols_RAP_offd); - But, we already know the answer to this with, */ - row_indx_Sext = RAP_offd_j[j]; - - /* Grab the indices for row row_indx_Sext from the offd and diag parts. This will - * be for computing lumping locations */ - S_offd_indices_len = S_ext_offd_i[row_indx_Sext+1] - S_ext_offd_i[row_indx_Sext]; - if(S_offd_indices_allocated_len < S_offd_indices_len) - { - hypre_TFree(S_offd_indices, HYPRE_MEMORY_HOST); - S_offd_indices = hypre_CTAlloc(HYPRE_BigInt, S_offd_indices_len, HYPRE_MEMORY_HOST); - S_offd_indices_allocated_len = S_offd_indices_len; - } - /* Grab sub array from col_map, corresponding to the slice of S_ext_offd_j */ - hypre_GrabSubArray(S_ext_offd_j, S_ext_offd_i[row_indx_Sext], S_ext_offd_i[row_indx_Sext+1]-1, - col_map_offd_Sext, S_offd_indices); - /* No need to grab info out of S_ext_diag_j[...], here we just start from - * S_ext_diag_i[row_indx_Sext] and end at index S_ext_diag_i[row_indx_Sext+1] - 1 */ - - /* Intersect the diag and offd pieces, remembering that the - * diag array will need to have the offset +first_col_diag_RAP */ - cnt = hypre_max(S_offd_indices_len, Pattern_offd_indices_len); - if(offd_intersection_allocated_len < cnt) - { - hypre_TFree(offd_intersection, HYPRE_MEMORY_HOST); - hypre_TFree(offd_intersection_data, HYPRE_MEMORY_HOST); - offd_intersection = hypre_CTAlloc(HYPRE_BigInt, cnt, HYPRE_MEMORY_HOST); - offd_intersection_data = hypre_CTAlloc(HYPRE_Real, cnt, HYPRE_MEMORY_HOST); - offd_intersection_allocated_len = cnt; - } - hypre_IntersectTwoBigArrays(S_offd_indices, - &(S_ext_offd_data[ S_ext_offd_i[row_indx_Sext] ]), - S_offd_indices_len, - Pattern_offd_indices, - Pattern_offd_indices_len, - offd_intersection, - offd_intersection_data, - &offd_intersection_len); - - /* Now, intersect the indices for the diag block. */ - cnt = hypre_max(Pattern_diag_indices_len, - S_ext_diag_i[row_indx_Sext+1] - S_ext_diag_i[row_indx_Sext] ); - if(diag_intersection_allocated_len < cnt) - { - hypre_TFree(diag_intersection, HYPRE_MEMORY_HOST); - hypre_TFree(diag_intersection_data, HYPRE_MEMORY_HOST); - diag_intersection = hypre_CTAlloc(HYPRE_Int, cnt, HYPRE_MEMORY_HOST); - diag_intersection_data = hypre_CTAlloc(HYPRE_Real, cnt, HYPRE_MEMORY_HOST); - diag_intersection_allocated_len = cnt; - } - hypre_IntersectTwoArrays( &(S_ext_diag_j[S_ext_diag_i[row_indx_Sext]]), - &(S_ext_diag_data[ S_ext_diag_i[row_indx_Sext] ]), - S_ext_diag_i[row_indx_Sext+1] - S_ext_diag_i[row_indx_Sext], - Pattern_indices_ptr, - Pattern_diag_indices_len, - diag_intersection, - diag_intersection_data, - &diag_intersection_len); - - /* Loop over these intersections, and lump a constant fraction of - * RAP_offd_data[j] to each entry */ - intersection_len = diag_intersection_len + offd_intersection_len; - if(intersection_len > 0) - { - /* Sum the strength-of-connection values from row - * row_indx_Sext in S, corresponding to the indices we are - * collapsing to in row i. This will give us our collapsing - * weights. */ - sum_strong_neigh = 0.0; - for(k = 0; k < diag_intersection_len; k++) - { sum_strong_neigh += fabs(diag_intersection_data[k]); } - for(k = 0; k < offd_intersection_len; k++) - { sum_strong_neigh += fabs(offd_intersection_data[k]); } - sum_strong_neigh = RAP_offd_data[j]/sum_strong_neigh; - - /* When lumping with the diag_intersection, must offset column index */ - for(k = 0; k < diag_intersection_len; k++) - { - lump_value = lump_percent * fabs(diag_intersection_data[k])*sum_strong_neigh; - diagonal_lump_value = (1.0 - lump_percent) * fabs(diag_intersection_data[k])*sum_strong_neigh; - neg_lump_value = -1.0 * lump_value; - cnt = diag_intersection[k]+first_col_diag_RAP; - - hypre_NonGalerkinIJBufferWrite( ijmatrix, &ijbuf_cnt, ijbuf_size, &ijbuf_rowcounter, - &ijbuf_data, &ijbuf_cols, &ijbuf_rownums, &ijbuf_numcols, global_row, cnt, lump_value ); - if (lump_percent < 1.0) - { - hypre_NonGalerkinIJBufferWrite( ijmatrix, &ijbuf_cnt, ijbuf_size, &ijbuf_rowcounter, - &ijbuf_data, &ijbuf_cols, &ijbuf_rownums, &ijbuf_numcols, global_row, global_row, - diagonal_lump_value ); - } - - /* Update mirror entries, if symmetric collapsing */ - if (sym_collapse) - { - hypre_NonGalerkinIJBufferWrite( ijmatrix, - &ijbuf_sym_cnt, ijbuf_size, - &ijbuf_sym_rowcounter, &ijbuf_sym_data, - &ijbuf_sym_cols, &ijbuf_sym_rownums, - &ijbuf_sym_numcols, cnt, global_row, lump_value); - hypre_NonGalerkinIJBufferWrite( ijmatrix, - &ijbuf_sym_cnt, ijbuf_size, - &ijbuf_sym_rowcounter, &ijbuf_sym_data, - &ijbuf_sym_cols, &ijbuf_sym_rownums, - &ijbuf_sym_numcols, cnt, cnt, neg_lump_value ); - } - } - - /* The offd_intersection has global column indices, i.e., the - * col_map arrays contain global indices */ - for(k = 0; k < offd_intersection_len; k++) - { - lump_value = lump_percent * fabs(offd_intersection_data[k])*sum_strong_neigh; - diagonal_lump_value = (1.0 - lump_percent) * fabs(offd_intersection_data[k])*sum_strong_neigh; - neg_lump_value = -1.0 * lump_value; - - hypre_NonGalerkinIJBufferWrite( ijmatrix, &ijbuf_cnt, ijbuf_size, &ijbuf_rowcounter, - &ijbuf_data, &ijbuf_cols, &ijbuf_rownums, &ijbuf_numcols, global_row, - offd_intersection[k], lump_value ); - if (lump_percent < 1.0) - { - hypre_NonGalerkinIJBufferWrite( ijmatrix, &ijbuf_cnt, ijbuf_size, &ijbuf_rowcounter, - &ijbuf_data, &ijbuf_cols, &ijbuf_rownums, &ijbuf_numcols, global_row, global_row, - diagonal_lump_value ); - } - - - /* Update mirror entries, if symmetric collapsing */ - if (sym_collapse) - { - hypre_NonGalerkinIJBufferWrite( ijmatrix, - &ijbuf_sym_cnt, ijbuf_size, - &ijbuf_sym_rowcounter, &ijbuf_sym_data, - &ijbuf_sym_cols, &ijbuf_sym_rownums, - &ijbuf_sym_numcols, offd_intersection[k], - global_row, lump_value ); - hypre_NonGalerkinIJBufferWrite( ijmatrix, - &ijbuf_sym_cnt, ijbuf_size, - &ijbuf_sym_rowcounter, &ijbuf_sym_data, - &ijbuf_sym_cols, &ijbuf_sym_rownums, - &ijbuf_sym_numcols, offd_intersection[k], - offd_intersection[k], neg_lump_value ); - } - } - } - /* If intersection is empty, do not eliminate entry */ - else - { - /* Don't forget to update mirror entry if collapsing symmetrically */ - if (sym_collapse) - { lump_value = 0.5*RAP_offd_data[j]; } - else - { lump_value = RAP_offd_data[j]; } - - hypre_NonGalerkinIJBufferWrite( ijmatrix, &ijbuf_cnt, ijbuf_size, &ijbuf_rowcounter, - &ijbuf_data, &ijbuf_cols, &ijbuf_rownums, &ijbuf_numcols, global_row, col_indx_RAP, - lump_value ); - if (sym_collapse) - { - hypre_NonGalerkinIJBufferWrite( ijmatrix, - &ijbuf_sym_cnt, ijbuf_size, &ijbuf_sym_rowcounter, - &ijbuf_sym_data, &ijbuf_sym_cols, &ijbuf_sym_rownums, - &ijbuf_sym_numcols, col_indx_RAP, global_row, - lump_value ); - } - } - } - /* The entry in RAP appears in Pattern, so keep it */ - else if (col_indx_RAP == col_indx_Pattern) - { - /* For the offd structure, col_indx_RAP is a global dof number */ - hypre_NonGalerkinIJBufferWrite( ijmatrix, &ijbuf_cnt, ijbuf_size, &ijbuf_rowcounter, - &ijbuf_data, &ijbuf_cols, &ijbuf_rownums, &ijbuf_numcols, global_row, col_indx_RAP, - RAP_offd_data[j]); - - /* Only go to the next entry in Pattern, if this is not the end of a row */ - if( current_Pattern_j < Pattern_offd_i[i+1]-1 ) - { - current_Pattern_j += 1; - col_indx_Pattern = col_map_offd_Pattern[ Pattern_offd_j[current_Pattern_j] ]; - } - else - { has_row_ended = 1;} - } - /* Increment col_indx_Pattern, and repeat this loop iter for current - * col_ind_RAP value */ - else if(col_indx_RAP > col_indx_Pattern) - { - for(; current_Pattern_j < Pattern_offd_i[i+1]; current_Pattern_j++) - { - col_indx_Pattern = col_map_offd_Pattern[ Pattern_offd_j[current_Pattern_j] ]; - if(col_indx_RAP <= col_indx_Pattern) - { break;} - } - - /* If col_indx_RAP is still greater (i.e., we've reached a row end), then - * we need to lump everything else in this row */ - if(col_indx_RAP > col_indx_Pattern) - { has_row_ended = 1; } - - /* Decrement j, in order to repeat this loop iteration for the current - * col_indx_RAP value */ - j--; - } - } - } + } + } + } + + /* For efficiency, we do a buffered IJAddToValues. + * This empties the buffer of any remaining values */ + hypre_NonGalerkinIJBufferEmpty(ijmatrix, ijbuf_size, &ijbuf_cnt, ijbuf_rowcounter, + &ijbuf_data, &ijbuf_cols, &ijbuf_rownums, &ijbuf_numcols); + if (sym_collapse) + { + hypre_NonGalerkinIJBufferEmpty(ijmatrix, ijbuf_size, &ijbuf_sym_cnt, ijbuf_sym_rowcounter, + &ijbuf_sym_data, &ijbuf_sym_cols, &ijbuf_sym_rownums, + &ijbuf_sym_numcols); + } + + /* Assemble non-Galerkin Matrix, and overwrite current RAP*/ + HYPRE_IJMatrixAssemble(ijmatrix); + HYPRE_IJMatrixGetObject(ijmatrix, (void**) RAP_ptr); + + /* Optional diagnostic matrix printing */ +#if 0 + char filename[256]; + + hypre_sprintf(filename, "Pattern_%d.ij", global_num_vars); + hypre_ParCSRMatrixPrintIJ(Pattern, 0, 0, filename); + hypre_sprintf(filename, "Strength_%d.ij", global_num_vars); + hypre_ParCSRMatrixPrintIJ(S, 0, 0, filename); + hypre_sprintf(filename, "RAP_%d.ij", global_num_vars); + hypre_ParCSRMatrixPrintIJ(RAP, 0, 0, filename); + hypre_sprintf(filename, "RAPc_%d.ij", global_num_vars); + hypre_ParCSRMatrixPrintIJ(*RAP_ptr, 0, 0, filename); + hypre_sprintf(filename, "AP_%d.ij", global_num_vars); + hypre_ParCSRMatrixPrintIJ(AP, 0, 0, filename); +#endif - } - - } - - /* For efficiency, we do a buffered IJAddToValues. - * This empties the buffer of any remaining values */ - hypre_NonGalerkinIJBufferEmpty(ijmatrix, ijbuf_size, &ijbuf_cnt, ijbuf_rowcounter, - &ijbuf_data, &ijbuf_cols, &ijbuf_rownums, &ijbuf_numcols); - if(sym_collapse) - hypre_NonGalerkinIJBufferEmpty(ijmatrix, ijbuf_size, &ijbuf_sym_cnt, ijbuf_sym_rowcounter, - &ijbuf_sym_data, &ijbuf_sym_cols, &ijbuf_sym_rownums, - &ijbuf_sym_numcols); - - /* Assemble non-Galerkin Matrix, and overwrite current RAP*/ - ierr += HYPRE_IJMatrixAssemble (ijmatrix); - ierr += HYPRE_IJMatrixGetObject( ijmatrix, (void**) RAP_ptr); - - /* Optional diagnostic matrix printing */ - if (0) - { - hypre_sprintf(filename, "Pattern_%d.ij", global_num_vars); - hypre_ParCSRMatrixPrintIJ(Pattern, 0, 0, filename); - hypre_sprintf(filename, "Strength_%d.ij", global_num_vars); - hypre_ParCSRMatrixPrintIJ(S, 0, 0, filename); - hypre_sprintf(filename, "RAP_%d.ij", global_num_vars); - hypre_ParCSRMatrixPrintIJ(RAP, 0, 0, filename); - hypre_sprintf(filename, "RAPc_%d.ij", global_num_vars); - hypre_ParCSRMatrixPrintIJ(*RAP_ptr, 0, 0, filename); - hypre_sprintf(filename, "AP_%d.ij", global_num_vars); - hypre_ParCSRMatrixPrintIJ(AP, 0, 0, filename); - } - - /* Free matrices and variables and arrays */ - hypre_TFree(ijbuf_data, HYPRE_MEMORY_DEVICE); - hypre_TFree(ijbuf_cols, HYPRE_MEMORY_DEVICE); - hypre_TFree(ijbuf_rownums, HYPRE_MEMORY_DEVICE); - hypre_TFree(ijbuf_numcols, HYPRE_MEMORY_DEVICE); - if(sym_collapse) - { - hypre_TFree(ijbuf_sym_data, HYPRE_MEMORY_DEVICE); - hypre_TFree(ijbuf_sym_cols, HYPRE_MEMORY_DEVICE); - hypre_TFree(ijbuf_sym_rownums, HYPRE_MEMORY_DEVICE); - hypre_TFree(ijbuf_sym_numcols, HYPRE_MEMORY_DEVICE); - } - - hypre_TFree(Pattern_offd_indices, HYPRE_MEMORY_HOST); - hypre_TFree(S_ext_diag_i, HYPRE_MEMORY_HOST); - hypre_TFree(S_ext_offd_i, HYPRE_MEMORY_HOST); - hypre_TFree(S_offd_indices, HYPRE_MEMORY_HOST); - hypre_TFree(offd_intersection, HYPRE_MEMORY_HOST); - hypre_TFree(offd_intersection_data, HYPRE_MEMORY_HOST); - hypre_TFree(diag_intersection, HYPRE_MEMORY_HOST); - hypre_TFree(diag_intersection_data, HYPRE_MEMORY_HOST); - if (S_ext_diag_size) - { - hypre_TFree(S_ext_diag_j, HYPRE_MEMORY_HOST); - hypre_TFree(S_ext_diag_data, HYPRE_MEMORY_HOST); - } - if (S_ext_offd_size) - { - hypre_TFree(S_ext_offd_j, HYPRE_MEMORY_HOST); - hypre_TFree(S_ext_offd_data, HYPRE_MEMORY_HOST); - } - if (num_cols_offd_Sext) - { hypre_TFree(col_map_offd_Sext, HYPRE_MEMORY_HOST); } - - ierr += hypre_ParCSRMatrixDestroy(Pattern); - ierr += hypre_ParCSRMatrixDestroy(RAP); - ierr += hypre_ParCSRMatrixDestroy(S); - ierr += HYPRE_IJMatrixSetObjectType(ijmatrix, -1); - ierr += HYPRE_IJMatrixDestroy(ijmatrix); - - /*end_time = hypre_MPI_Wtime(); - if(my_id == 0) - { fprintf(stdout, "NonGalerkin Time: %1.2e\n", end_time-start_time); } */ - - return ierr; + /* Free matrices and variables and arrays */ + hypre_TFree(ijbuf_data, memory_location_RAP); + hypre_TFree(ijbuf_cols, memory_location_RAP); + hypre_TFree(ijbuf_rownums, memory_location_RAP); + hypre_TFree(ijbuf_numcols, memory_location_RAP); + if (sym_collapse) + { + hypre_TFree(ijbuf_sym_data, memory_location_RAP); + hypre_TFree(ijbuf_sym_cols, memory_location_RAP); + hypre_TFree(ijbuf_sym_rownums, memory_location_RAP); + hypre_TFree(ijbuf_sym_numcols, memory_location_RAP); + } + hypre_TFree(Pattern_offd_indices, HYPRE_MEMORY_HOST); + hypre_TFree(S_ext_diag_i, HYPRE_MEMORY_HOST); + hypre_TFree(S_ext_offd_i, HYPRE_MEMORY_HOST); + hypre_TFree(S_offd_indices, HYPRE_MEMORY_HOST); + hypre_TFree(offd_intersection, HYPRE_MEMORY_HOST); + hypre_TFree(offd_intersection_data, HYPRE_MEMORY_HOST); + hypre_TFree(diag_intersection, HYPRE_MEMORY_HOST); + hypre_TFree(diag_intersection_data, HYPRE_MEMORY_HOST); + hypre_TFree(S_ext_diag_j, HYPRE_MEMORY_HOST); + hypre_TFree(S_ext_diag_data, HYPRE_MEMORY_HOST); + hypre_TFree(S_ext_offd_j, HYPRE_MEMORY_HOST); + hypre_TFree(S_ext_offd_data, HYPRE_MEMORY_HOST); + hypre_TFree(col_map_offd_Sext, HYPRE_MEMORY_HOST); + + hypre_ParCSRMatrixDestroy(Pattern); + hypre_ParCSRMatrixDestroy(RAP); + hypre_ParCSRMatrixDestroy(S); + HYPRE_IJMatrixSetObjectType(ijmatrix, -1); + HYPRE_IJMatrixDestroy(ijmatrix); + + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; } diff --git a/external/hypre/src/parcsr_ls/par_rap.c b/external/hypre/src/parcsr_ls/par_rap.c index 5c5faf3c..c432b369 100644 --- a/external/hypre/src/parcsr_ls/par_rap.c +++ b/external/hypre/src/parcsr_ls/par_rap.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -22,6 +22,10 @@ hypre_BoomerAMGBuildCoarseOperator( hypre_ParCSRMatrix *RT, return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_BoomerAMGBuildCoarseOperatorKT + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, hypre_ParCSRMatrix *A, @@ -34,79 +38,73 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, hypre_profile_times[HYPRE_TIMER_ID_RAP] -= hypre_MPI_Wtime(); #endif - MPI_Comm comm = hypre_ParCSRMatrixComm(A); + MPI_Comm comm = hypre_ParCSRMatrixComm(A); - hypre_CSRMatrix *RT_diag = hypre_ParCSRMatrixDiag(RT); - hypre_CSRMatrix *RT_offd = hypre_ParCSRMatrixOffd(RT); - HYPRE_Int num_cols_diag_RT = hypre_CSRMatrixNumCols(RT_diag); - HYPRE_Int num_cols_offd_RT = hypre_CSRMatrixNumCols(RT_offd); - HYPRE_Int num_rows_offd_RT = hypre_CSRMatrixNumRows(RT_offd); - hypre_ParCSRCommPkg *comm_pkg_RT = hypre_ParCSRMatrixCommPkg(RT); - HYPRE_Int num_recvs_RT = 0; - HYPRE_Int num_sends_RT = 0; - HYPRE_Int *send_map_starts_RT; - HYPRE_Int *send_map_elmts_RT; + HYPRE_MemoryLocation memory_location_RAP = hypre_ParCSRMatrixMemoryLocation(A); - hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + hypre_CSRMatrix *RT_diag = hypre_ParCSRMatrixDiag(RT); + hypre_CSRMatrix *RT_offd = hypre_ParCSRMatrixOffd(RT); + HYPRE_Int num_cols_diag_RT = hypre_CSRMatrixNumCols(RT_diag); + HYPRE_Int num_cols_offd_RT = hypre_CSRMatrixNumCols(RT_offd); + HYPRE_Int num_rows_offd_RT = hypre_CSRMatrixNumRows(RT_offd); + hypre_ParCSRCommPkg *comm_pkg_RT = hypre_ParCSRMatrixCommPkg(RT); + HYPRE_Int num_recvs_RT = 0; + HYPRE_Int num_sends_RT = 0; + HYPRE_Int *send_map_starts_RT = NULL; + HYPRE_Int *send_map_elmts_RT = NULL; - HYPRE_Real *A_diag_data = hypre_CSRMatrixData(A_diag); + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + HYPRE_Complex *A_diag_data = hypre_CSRMatrixData(A_diag); HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); - hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); - - HYPRE_Real *A_offd_data = hypre_CSRMatrixData(A_offd); + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); + HYPRE_Complex *A_offd_data = hypre_CSRMatrixData(A_offd); HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); - HYPRE_Int num_cols_diag_A = hypre_CSRMatrixNumCols(A_diag); - HYPRE_Int num_cols_offd_A = hypre_CSRMatrixNumCols(A_offd); - - hypre_CSRMatrix *P_diag = hypre_ParCSRMatrixDiag(P); + HYPRE_Int num_cols_diag_A = hypre_CSRMatrixNumCols(A_diag); + HYPRE_Int num_cols_offd_A = hypre_CSRMatrixNumCols(A_offd); - HYPRE_Real *P_diag_data = hypre_CSRMatrixData(P_diag); + hypre_CSRMatrix *P_diag = hypre_ParCSRMatrixDiag(P); + HYPRE_Complex *P_diag_data = hypre_CSRMatrixData(P_diag); HYPRE_Int *P_diag_i = hypre_CSRMatrixI(P_diag); HYPRE_Int *P_diag_j = hypre_CSRMatrixJ(P_diag); - hypre_CSRMatrix *P_offd = hypre_ParCSRMatrixOffd(P); - HYPRE_BigInt *col_map_offd_P = hypre_ParCSRMatrixColMapOffd(P); - - HYPRE_Real *P_offd_data = hypre_CSRMatrixData(P_offd); + hypre_CSRMatrix *P_offd = hypre_ParCSRMatrixOffd(P); + HYPRE_BigInt *col_map_offd_P = hypre_ParCSRMatrixColMapOffd(P); + HYPRE_Complex *P_offd_data = hypre_CSRMatrixData(P_offd); HYPRE_Int *P_offd_i = hypre_CSRMatrixI(P_offd); HYPRE_Int *P_offd_j = hypre_CSRMatrixJ(P_offd); - HYPRE_BigInt first_col_diag_P = hypre_ParCSRMatrixFirstColDiag(P); - HYPRE_BigInt last_col_diag_P; - HYPRE_Int num_cols_diag_P = hypre_CSRMatrixNumCols(P_diag); - HYPRE_Int num_cols_offd_P = hypre_CSRMatrixNumCols(P_offd); - HYPRE_BigInt *coarse_partitioning = hypre_ParCSRMatrixColStarts(P); - HYPRE_BigInt *RT_partitioning = hypre_ParCSRMatrixColStarts(RT); - - hypre_ParCSRMatrix *RAP; - HYPRE_BigInt *col_map_offd_RAP = NULL; - HYPRE_BigInt *new_col_map_offd_RAP = NULL; + HYPRE_BigInt first_col_diag_P = hypre_ParCSRMatrixFirstColDiag(P); + HYPRE_BigInt last_col_diag_P; + HYPRE_Int num_cols_diag_P = hypre_CSRMatrixNumCols(P_diag); + HYPRE_Int num_cols_offd_P = hypre_CSRMatrixNumCols(P_offd); + HYPRE_BigInt *coarse_partitioning = hypre_ParCSRMatrixColStarts(P); + HYPRE_BigInt *RT_partitioning = hypre_ParCSRMatrixColStarts(RT); - hypre_CSRMatrix *RAP_int = NULL; + hypre_ParCSRMatrix *RAP; + HYPRE_BigInt *col_map_offd_RAP = NULL; + HYPRE_BigInt *new_col_map_offd_RAP = NULL; - HYPRE_Real *RAP_int_data; + hypre_CSRMatrix *RAP_int = NULL; + HYPRE_Complex *RAP_int_data; HYPRE_Int *RAP_int_i; - HYPRE_BigInt *RAP_int_j; + HYPRE_BigInt *RAP_int_j; - hypre_CSRMatrix *RAP_ext; - - HYPRE_Real *RAP_ext_data = NULL; + hypre_CSRMatrix *RAP_ext = NULL; + HYPRE_Complex *RAP_ext_data = NULL; HYPRE_Int *RAP_ext_i = NULL; - HYPRE_BigInt *RAP_ext_j = NULL; - - hypre_CSRMatrix *RAP_diag; + HYPRE_BigInt *RAP_ext_j = NULL; - HYPRE_Real *RAP_diag_data; + hypre_CSRMatrix *RAP_diag; + HYPRE_Complex *RAP_diag_data = NULL; HYPRE_Int *RAP_diag_i; - HYPRE_Int *RAP_diag_j; - - hypre_CSRMatrix *RAP_offd; + HYPRE_Int *RAP_diag_j = NULL; - HYPRE_Real *RAP_offd_data = NULL; + hypre_CSRMatrix *RAP_offd; + HYPRE_Complex *RAP_offd_data = NULL; HYPRE_Int *RAP_offd_i = NULL; HYPRE_Int *RAP_offd_j = NULL; @@ -116,54 +114,51 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, HYPRE_Int RAP_offd_size; HYPRE_Int P_ext_diag_size; HYPRE_Int P_ext_offd_size; - HYPRE_BigInt first_col_diag_RAP; - HYPRE_BigInt last_col_diag_RAP; + HYPRE_BigInt first_col_diag_RAP; + HYPRE_BigInt last_col_diag_RAP; HYPRE_Int num_cols_offd_RAP = 0; - hypre_CSRMatrix *R_diag; - - HYPRE_Real *R_diag_data; + hypre_CSRMatrix *R_diag; + HYPRE_Complex *R_diag_data; HYPRE_Int *R_diag_i; HYPRE_Int *R_diag_j; - hypre_CSRMatrix *R_offd; - - HYPRE_Real *R_offd_data; - HYPRE_Int *R_offd_i; - HYPRE_Int *R_offd_j; + hypre_CSRMatrix *R_offd = NULL; + HYPRE_Complex *R_offd_data = NULL; + HYPRE_Int *R_offd_i = NULL; + HYPRE_Int *R_offd_j = NULL; - HYPRE_Real *RA_diag_data_array = NULL; - HYPRE_Int *RA_diag_j_array = NULL; - HYPRE_Real *RA_offd_data_array = NULL; - HYPRE_Int *RA_offd_j_array = NULL; + HYPRE_Real *RA_diag_data_array = NULL; + HYPRE_Int *RA_diag_j_array = NULL; + HYPRE_Real *RA_offd_data_array = NULL; + HYPRE_Int *RA_offd_j_array = NULL; - hypre_CSRMatrix *Ps_ext; + hypre_CSRMatrix *Ps_ext = NULL; + HYPRE_Complex *Ps_ext_data = NULL; + HYPRE_Int *Ps_ext_i = NULL; + HYPRE_BigInt *Ps_ext_j = NULL; - HYPRE_Real *Ps_ext_data; - HYPRE_Int *Ps_ext_i; - HYPRE_BigInt *Ps_ext_j; - - HYPRE_Real *P_ext_diag_data = NULL; + HYPRE_Complex *P_ext_diag_data = NULL; HYPRE_Int *P_ext_diag_i = NULL; HYPRE_Int *P_ext_diag_j = NULL; - HYPRE_Real *P_ext_offd_data = NULL; + HYPRE_Complex *P_ext_offd_data = NULL; HYPRE_Int *P_ext_offd_i = NULL; HYPRE_Int *P_ext_offd_j = NULL; - HYPRE_BigInt *P_big_offd_j = NULL; + HYPRE_BigInt *P_big_offd_j = NULL; - HYPRE_BigInt *col_map_offd_Pext; + HYPRE_BigInt *col_map_offd_Pext = NULL; HYPRE_Int *map_P_to_Pext = NULL; HYPRE_Int *map_P_to_RAP = NULL; HYPRE_Int *map_Pext_to_RAP = NULL; - HYPRE_Int *P_marker; + HYPRE_Int *P_marker = NULL; HYPRE_Int **P_mark_array; HYPRE_Int **A_mark_array; HYPRE_Int *A_marker; - HYPRE_BigInt *temp; + HYPRE_BigInt *temp; - HYPRE_BigInt n_coarse, n_coarse_RT; + HYPRE_BigInt n_coarse, n_coarse_RT; HYPRE_Int square = 1; HYPRE_Int num_cols_offd_Pext = 0; @@ -180,26 +175,26 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, HYPRE_Int num_procs; HYPRE_Int num_threads; - HYPRE_Real r_entry; - HYPRE_Real r_a_product; - HYPRE_Real r_a_p_product; + HYPRE_Real r_entry; + HYPRE_Real r_a_product; + HYPRE_Real r_a_p_product; - HYPRE_Real zero = 0.0; - HYPRE_Int *prefix_sum_workspace; + HYPRE_Real zero = 0.0; + HYPRE_Int *prefix_sum_workspace; /*----------------------------------------------------------------------- * Copy ParCSRMatrix RT into CSRMatrix R so that we have row-wise access * to restriction . *-----------------------------------------------------------------------*/ - hypre_MPI_Comm_size(comm,&num_procs); + hypre_MPI_Comm_size(comm, &num_procs); num_threads = hypre_NumThreads(); if (comm_pkg_RT) { num_recvs_RT = hypre_ParCSRCommPkgNumRecvs(comm_pkg_RT); num_sends_RT = hypre_ParCSRCommPkgNumSends(comm_pkg_RT); - send_map_starts_RT =hypre_ParCSRCommPkgSendMapStarts(comm_pkg_RT); + send_map_starts_RT = hypre_ParCSRCommPkgSendMapStarts(comm_pkg_RT); send_map_elmts_RT = hypre_ParCSRCommPkgSendMapElmts(comm_pkg_RT); } else if (num_procs > 1) @@ -208,14 +203,14 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, comm_pkg_RT = hypre_ParCSRMatrixCommPkg(RT); num_recvs_RT = hypre_ParCSRCommPkgNumRecvs(comm_pkg_RT); num_sends_RT = hypre_ParCSRCommPkgNumSends(comm_pkg_RT); - send_map_starts_RT =hypre_ParCSRCommPkgSendMapStarts(comm_pkg_RT); + send_map_starts_RT = hypre_ParCSRCommPkgSendMapStarts(comm_pkg_RT); send_map_elmts_RT = hypre_ParCSRCommPkgSendMapElmts(comm_pkg_RT); } - hypre_CSRMatrixTranspose(RT_diag,&R_diag,1); + hypre_CSRMatrixTranspose(RT_diag, &R_diag, 1); if (num_cols_offd_RT) { - hypre_CSRMatrixTranspose(RT_offd,&R_offd,1); + hypre_CSRMatrixTranspose(RT_offd, &R_offd, 1); R_offd_data = hypre_CSRMatrixData(R_offd); R_offd_i = hypre_CSRMatrixI(R_offd); R_offd_j = hypre_CSRMatrixJ(R_offd); @@ -234,8 +229,11 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, num_nz_cols_A = num_cols_diag_A + num_cols_offd_A; n_coarse_RT = hypre_ParCSRMatrixGlobalNumCols(RT); - if (n_coarse != n_coarse_RT) + + if (n_coarse != n_coarse_RT || num_cols_diag_RT != num_cols_diag_P) + { square = 0; + } /*----------------------------------------------------------------------- * Generate Ps_ext, i.e. portion of P that is stored on neighbor procs @@ -252,9 +250,10 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, if (send_map_elmts_RT_inverse_map_initialized) { hypre_UnorderedIntSet send_map_elmts_set; - hypre_UnorderedIntSetCreate(&send_map_elmts_set, 2*(send_map_starts_RT[num_sends_RT] - send_map_starts_RT[0]), 16*hypre_NumThreads()); + hypre_UnorderedIntSetCreate(&send_map_elmts_set, + 2 * (send_map_starts_RT[num_sends_RT] - send_map_starts_RT[0]), 16 * hypre_NumThreads()); -#pragma omp parallel for HYPRE_SMP_SCHEDULE + #pragma omp parallel for HYPRE_SMP_SCHEDULE for (i = send_map_starts_RT[0]; i < send_map_starts_RT[num_sends_RT]; i++) { HYPRE_Int key = send_map_elmts_RT[i]; @@ -262,31 +261,35 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, } HYPRE_Int send_map_elmts_unique_size; - HYPRE_Int *send_map_elmts_unique = hypre_UnorderedIntSetCopyToArray(&send_map_elmts_set, &send_map_elmts_unique_size); + HYPRE_Int *send_map_elmts_unique = hypre_UnorderedIntSetCopyToArray(&send_map_elmts_set, + &send_map_elmts_unique_size); hypre_UnorderedIntSetDestroy(&send_map_elmts_set); - hypre_UnorderedIntMapCreate(&send_map_elmts_RT_inverse_map, 2*send_map_elmts_unique_size, 16*hypre_NumThreads()); -#pragma omp parallel for HYPRE_SMP_SCHEDULE + hypre_UnorderedIntMapCreate(&send_map_elmts_RT_inverse_map, 2 * send_map_elmts_unique_size, + 16 * hypre_NumThreads()); + #pragma omp parallel for HYPRE_SMP_SCHEDULE for (i = 0; i < send_map_elmts_unique_size; i++) { hypre_UnorderedIntMapPutIfAbsent(&send_map_elmts_RT_inverse_map, send_map_elmts_unique[i], i); } hypre_TFree(send_map_elmts_unique, HYPRE_MEMORY_HOST); - send_map_elmts_starts_RT_aggregated = hypre_TAlloc(HYPRE_Int, send_map_elmts_unique_size + 1, HYPRE_MEMORY_HOST); - send_map_elmts_RT_aggregated = hypre_TAlloc(HYPRE_Int, send_map_starts_RT[num_sends_RT], HYPRE_MEMORY_HOST); + send_map_elmts_starts_RT_aggregated = hypre_TAlloc(HYPRE_Int, send_map_elmts_unique_size + 1, + HYPRE_MEMORY_HOST); + send_map_elmts_RT_aggregated = hypre_TAlloc(HYPRE_Int, send_map_starts_RT[num_sends_RT], + HYPRE_MEMORY_HOST); -#pragma omp parallel for HYPRE_SMP_SCHEDULE + #pragma omp parallel for HYPRE_SMP_SCHEDULE for (i = 0; i < send_map_elmts_unique_size; i++) { send_map_elmts_starts_RT_aggregated[i] = 0; } -#pragma omp parallel for HYPRE_SMP_SCHEDULE + #pragma omp parallel for HYPRE_SMP_SCHEDULE for (i = send_map_starts_RT[0]; i < send_map_starts_RT[num_sends_RT]; i++) { HYPRE_Int idx = hypre_UnorderedIntMapGet(&send_map_elmts_RT_inverse_map, send_map_elmts_RT[i]); -#pragma omp atomic + #pragma omp atomic send_map_elmts_starts_RT_aggregated[idx]++; } @@ -296,7 +299,7 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, } send_map_elmts_starts_RT_aggregated[send_map_elmts_unique_size] = send_map_starts_RT[num_sends_RT]; -#pragma omp parallel for HYPRE_SMP_SCHEDULE + #pragma omp parallel for HYPRE_SMP_SCHEDULE for (i = send_map_starts_RT[num_sends_RT] - 1; i >= send_map_starts_RT[0]; i--) { HYPRE_Int idx = hypre_UnorderedIntMapGet(&send_map_elmts_RT_inverse_map, send_map_elmts_RT[i]); @@ -313,14 +316,14 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, if (num_procs > 1) { - Ps_ext = hypre_ParCSRMatrixExtractBExt(P,A,1); + Ps_ext = hypre_ParCSRMatrixExtractBExt(P, A, 1); Ps_ext_data = hypre_CSRMatrixData(Ps_ext); Ps_ext_i = hypre_CSRMatrixI(Ps_ext); Ps_ext_j = hypre_CSRMatrixBigJ(Ps_ext); } - P_ext_diag_i = hypre_TAlloc(HYPRE_Int, num_cols_offd_A+1, HYPRE_MEMORY_HOST); - P_ext_offd_i = hypre_TAlloc(HYPRE_Int, num_cols_offd_A+1, HYPRE_MEMORY_HOST); + P_ext_diag_i = hypre_TAlloc(HYPRE_Int, num_cols_offd_A + 1, HYPRE_MEMORY_HOST); + P_ext_offd_i = hypre_TAlloc(HYPRE_Int, num_cols_offd_A + 1, HYPRE_MEMORY_HOST); P_ext_diag_i[0] = 0; P_ext_offd_i[0] = 0; P_ext_diag_size = 0; @@ -328,10 +331,10 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, last_col_diag_P = first_col_diag_P + (HYPRE_BigInt) num_cols_diag_P - 1; /*HYPRE_Int prefix_sum_workspace[2*(num_threads + 1)];*/ - prefix_sum_workspace = hypre_TAlloc(HYPRE_Int, 2*(num_threads + 1), HYPRE_MEMORY_HOST); + prefix_sum_workspace = hypre_TAlloc(HYPRE_Int, 2 * (num_threads + 1), HYPRE_MEMORY_HOST); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel private(i,j) + #pragma omp parallel private(i,j) #endif /* This threading causes problem, maybe the prefix_sum in combination with BigInt? */ { HYPRE_Int i_begin, i_end; @@ -342,17 +345,22 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, for (i = i_begin; i < i_end; i++) { - for (j=Ps_ext_i[i]; j < Ps_ext_i[i+1]; j++) + for (j = Ps_ext_i[i]; j < Ps_ext_i[i + 1]; j++) if (Ps_ext_j[j] < first_col_diag_P || Ps_ext_j[j] > last_col_diag_P) + { P_ext_offd_size_private++; + } else + { P_ext_diag_size_private++; + } } - hypre_prefix_sum_pair(&P_ext_diag_size_private, &P_ext_diag_size, &P_ext_offd_size_private, &P_ext_offd_size, prefix_sum_workspace); + hypre_prefix_sum_pair(&P_ext_diag_size_private, &P_ext_diag_size, &P_ext_offd_size_private, + &P_ext_offd_size, prefix_sum_workspace); #ifdef HYPRE_USING_OPENMP -#pragma omp master + #pragma omp master #endif { if (P_ext_diag_size) @@ -369,12 +377,12 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, } } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif for (i = i_begin; i < i_end; i++) { - for (j=Ps_ext_i[i]; j < Ps_ext_i[i+1]; j++) + for (j = Ps_ext_i[i]; j < Ps_ext_i[i + 1]; j++) { HYPRE_BigInt value = Ps_ext_j[j]; if (value < first_col_diag_P || value > last_col_diag_P) @@ -390,8 +398,8 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, P_ext_diag_data[P_ext_diag_size_private++] = Ps_ext_data[j]; } } - P_ext_diag_i[i+1] = P_ext_diag_size_private; - P_ext_offd_i[i+1] = P_ext_offd_size_private; + P_ext_diag_i[i + 1] = P_ext_diag_size_private; + P_ext_offd_i[i + 1] = P_ext_offd_size_private; } } /* omp parallel */ hypre_TFree(prefix_sum_workspace, HYPRE_MEMORY_HOST); @@ -406,18 +414,19 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, if (P_ext_offd_size || num_cols_offd_P) { hypre_UnorderedBigIntSet found_set; - hypre_UnorderedBigIntSetCreate(&found_set, P_ext_offd_size + num_cols_offd_P, 16*hypre_NumThreads()); + hypre_UnorderedBigIntSetCreate(&found_set, P_ext_offd_size + num_cols_offd_P, + 16 * hypre_NumThreads()); -#pragma omp parallel private(i) + #pragma omp parallel private(i) { -#pragma omp for HYPRE_SMP_SCHEDULE + #pragma omp for HYPRE_SMP_SCHEDULE for (i = 0; i < P_ext_offd_size; i++) { //hypre_UnorderedBigIntSetPut(&found_set, Ps_ext_j[i]); hypre_UnorderedBigIntSetPut(&found_set, P_big_offd_j[i]); } -#pragma omp for HYPRE_SMP_SCHEDULE + #pragma omp for HYPRE_SMP_SCHEDULE for (i = 0; i < num_cols_offd_P; i++) { hypre_UnorderedBigIntSetPut(&found_set, col_map_offd_P[i]); @@ -430,33 +439,40 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, hypre_UnorderedBigIntSetDestroy(&found_set); hypre_UnorderedBigIntMap col_map_offd_Pext_inverse; - hypre_big_sort_and_create_inverse_map(temp, num_cols_offd_Pext, &col_map_offd_Pext, &col_map_offd_Pext_inverse); + hypre_big_sort_and_create_inverse_map(temp, num_cols_offd_Pext, &col_map_offd_Pext, + &col_map_offd_Pext_inverse); -#pragma omp parallel for HYPRE_SMP_SCHEDULE - for (i=0 ; i < P_ext_offd_size; i++) + #pragma omp parallel for HYPRE_SMP_SCHEDULE + for (i = 0 ; i < P_ext_offd_size; i++) //Ps_ext_j[i] = hypre_UnorderedBigIntMapGet(&col_map_offd_Pext_inverse, Ps_ext_j[i]); + { P_ext_offd_j[i] = hypre_UnorderedBigIntMapGet(&col_map_offd_Pext_inverse, P_big_offd_j[i]); - if (num_cols_offd_Pext) hypre_UnorderedBigIntMapDestroy(&col_map_offd_Pext_inverse); + } + if (num_cols_offd_Pext) { hypre_UnorderedBigIntMapDestroy(&col_map_offd_Pext_inverse); } } #else /* !HYPRE_CONCURRENT_HOPSCOTCH */ if (P_ext_offd_size || num_cols_offd_P) { - temp = hypre_CTAlloc(HYPRE_BigInt, P_ext_offd_size+num_cols_offd_P, HYPRE_MEMORY_HOST); - for (i=0; i < P_ext_offd_size; i++) + temp = hypre_CTAlloc(HYPRE_BigInt, P_ext_offd_size + num_cols_offd_P, HYPRE_MEMORY_HOST); + for (i = 0; i < P_ext_offd_size; i++) //Ps_ext_j[i] = temp[i]; //temp[i] = Ps_ext_j[i]; + { temp[i] = P_big_offd_j[i]; + } cnt = P_ext_offd_size; - for (i=0; i < num_cols_offd_P; i++) + for (i = 0; i < num_cols_offd_P; i++) + { temp[cnt++] = col_map_offd_P[i]; + } } if (cnt) { - hypre_BigQsort0(temp, 0, cnt-1); + hypre_BigQsort0(temp, 0, cnt - 1); num_cols_offd_Pext = 1; HYPRE_BigInt value = temp[0]; - for (i=1; i < cnt; i++) + for (i = 1; i < cnt; i++) { if (temp[i] > value) { @@ -467,25 +483,33 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, } if (num_cols_offd_Pext) + { col_map_offd_Pext = hypre_CTAlloc(HYPRE_BigInt, num_cols_offd_Pext, HYPRE_MEMORY_HOST); + } - for (i=0; i < num_cols_offd_Pext; i++) + for (i = 0; i < num_cols_offd_Pext; i++) + { col_map_offd_Pext[i] = temp[i]; + } if (P_ext_offd_size || num_cols_offd_P) + { hypre_TFree(temp, HYPRE_MEMORY_HOST); + } /*if (P_ext_offd_size) P_ext_offd_j = hypre_CTAlloc(HYPRE_Int, P_ext_offd_size, HYPRE_MEMORY_HOST);*/ - for (i=0 ; i < P_ext_offd_size; i++) + for (i = 0 ; i < P_ext_offd_size; i++) P_ext_offd_j[i] = hypre_BigBinarySearch(col_map_offd_Pext, - //Ps_ext_j[i], - P_big_offd_j[i], - num_cols_offd_Pext); + //Ps_ext_j[i], + P_big_offd_j[i], + num_cols_offd_Pext); #endif /* !HYPRE_CONCURRENT_HOPSCOTCH */ if (P_ext_offd_size) + { hypre_TFree(P_big_offd_j, HYPRE_MEMORY_HOST); + } /*if (num_procs > 1) { hypre_CSRMatrixDestroy(Ps_ext); @@ -497,11 +521,11 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, map_P_to_Pext = hypre_CTAlloc(HYPRE_Int, num_cols_offd_P, HYPRE_MEMORY_HOST); cnt = 0; - for (i=0; i < num_cols_offd_Pext; i++) + for (i = 0; i < num_cols_offd_Pext; i++) if (col_map_offd_Pext[i] == col_map_offd_P[cnt]) { map_P_to_Pext[cnt++] = i; - if (cnt == num_cols_offd_P) break; + if (cnt == num_cols_offd_P) { break; } } } #ifdef HYPRE_PROFILE @@ -522,21 +546,21 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, jj_count = hypre_CTAlloc(HYPRE_Int, num_threads, HYPRE_MEMORY_HOST); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,ii,ic,i1,i2,i3,jj1,jj2,jj3,ns,ne,size,rest,jj_counter,jj_row_begining,A_marker,P_marker) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,ii,ic,i1,i2,i3,jj1,jj2,jj3,ns,ne,size,rest,jj_counter,jj_row_begining,A_marker,P_marker) HYPRE_SMP_SCHEDULE #endif for (ii = 0; ii < num_threads; ii++) { - size = num_cols_offd_RT/num_threads; - rest = num_cols_offd_RT - size*num_threads; + size = num_cols_offd_RT / num_threads; + rest = num_cols_offd_RT - size * num_threads; if (ii < rest) { - ns = ii*size+ii; - ne = (ii+1)*size+ii+1; + ns = ii * size + ii; + ne = (ii + 1) * size + ii + 1; } else { - ns = ii*size+rest; - ne = (ii+1)*size+rest; + ns = ii * size + rest; + ne = (ii + 1) * size + rest; } /*----------------------------------------------------------------------- @@ -545,9 +569,14 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, if (num_cols_offd_Pext || num_cols_diag_P) { - P_mark_array[ii] = hypre_CTAlloc(HYPRE_Int, num_cols_diag_P+num_cols_offd_Pext, HYPRE_MEMORY_HOST); + P_mark_array[ii] = hypre_CTAlloc(HYPRE_Int, num_cols_diag_P + num_cols_offd_Pext, + HYPRE_MEMORY_HOST); P_marker = P_mark_array[ii]; } + else + { + P_marker = NULL; + } A_mark_array[ii] = hypre_CTAlloc(HYPRE_Int, num_nz_cols_A, HYPRE_MEMORY_HOST); A_marker = A_mark_array[ii]; /*----------------------------------------------------------------------- @@ -555,7 +584,7 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, *-----------------------------------------------------------------------*/ jj_counter = start_indexing; - for (ic = 0; ic < num_cols_diag_P+num_cols_offd_Pext; ic++) + for (ic = 0; ic < num_cols_diag_P + num_cols_offd_Pext; ic++) { P_marker[ic] = -1; } @@ -577,7 +606,7 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, * Loop over entries in row ic of R_offd. *--------------------------------------------------------------------*/ - for (jj1 = R_offd_i[ic]; jj1 < R_offd_i[ic+1]; jj1++) + for (jj1 = R_offd_i[ic]; jj1 < R_offd_i[ic + 1]; jj1++) { i1 = R_offd_j[jj1]; @@ -585,7 +614,7 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, * Loop over entries in row i1 of A_offd. *-----------------------------------------------------------------*/ - for (jj2 = A_offd_i[i1]; jj2 < A_offd_i[i1+1]; jj2++) + for (jj2 = A_offd_i[i1]; jj2 < A_offd_i[i1 + 1]; jj2++) { i2 = A_offd_j[jj2]; @@ -607,7 +636,7 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, * Loop over entries in row i2 of P_ext. *-----------------------------------------------------------*/ - for (jj3 = P_ext_diag_i[i2]; jj3 < P_ext_diag_i[i2+1]; jj3++) + for (jj3 = P_ext_diag_i[i2]; jj3 < P_ext_diag_i[i2 + 1]; jj3++) { i3 = P_ext_diag_j[jj3]; @@ -623,7 +652,7 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, jj_counter++; } } - for (jj3 = P_ext_offd_i[i2]; jj3 < P_ext_offd_i[i2+1]; jj3++) + for (jj3 = P_ext_offd_i[i2]; jj3 < P_ext_offd_i[i2 + 1]; jj3++) { i3 = P_ext_offd_j[jj3] + num_cols_diag_P; @@ -645,7 +674,7 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, * Loop over entries in row i1 of A_diag. *-----------------------------------------------------------------*/ - for (jj2 = A_diag_i[i1]; jj2 < A_diag_i[i1+1]; jj2++) + for (jj2 = A_diag_i[i1]; jj2 < A_diag_i[i1 + 1]; jj2++) { i2 = A_diag_j[jj2]; @@ -654,20 +683,20 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, * visited. New entries in RAP only occur from unmarked points. *--------------------------------------------------------------*/ - if (A_marker[i2+num_cols_offd_A] != ic) + if (A_marker[i2 + num_cols_offd_A] != ic) { /*----------------------------------------------------------- * Mark i2 as visited. *-----------------------------------------------------------*/ - A_marker[i2+num_cols_offd_A] = ic; + A_marker[i2 + num_cols_offd_A] = ic; /*----------------------------------------------------------- * Loop over entries in row i2 of P_diag. *-----------------------------------------------------------*/ - for (jj3 = P_diag_i[i2]; jj3 < P_diag_i[i2+1]; jj3++) + for (jj3 = P_diag_i[i2]; jj3 < P_diag_i[i2 + 1]; jj3++) { i3 = P_diag_j[jj3]; @@ -687,7 +716,7 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, * Loop over entries in row i2 of P_offd. *-----------------------------------------------------------*/ - for (jj3 = P_offd_i[i2]; jj3 < P_offd_i[i2+1]; jj3++) + for (jj3 = P_offd_i[i2]; jj3 < P_offd_i[i2 + 1]; jj3++) { i3 = map_P_to_Pext[P_offd_j[jj3]] + num_cols_diag_P; @@ -715,11 +744,13 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, /*----------------------------------------------------------------------- * Allocate RAP_int_data and RAP_int_j arrays. *-----------------------------------------------------------------------*/ - for (i = 0; i < num_threads-1; i++) - jj_count[i+1] += jj_count[i]; + for (i = 0; i < num_threads - 1; i++) + { + jj_count[i + 1] += jj_count[i]; + } - RAP_size = jj_count[num_threads-1]; - RAP_int_i = hypre_CTAlloc(HYPRE_Int, num_cols_offd_RT+1, HYPRE_MEMORY_HOST); + RAP_size = jj_count[num_threads - 1]; + RAP_int_i = hypre_CTAlloc(HYPRE_Int, num_cols_offd_RT + 1, HYPRE_MEMORY_HOST); RAP_int_data = hypre_CTAlloc(HYPRE_Real, RAP_size, HYPRE_MEMORY_HOST); RAP_int_j = hypre_CTAlloc(HYPRE_BigInt, RAP_size, HYPRE_MEMORY_HOST); @@ -730,34 +761,37 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, *-----------------------------------------------------------------------*/ #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,ii,ic,i1,i2,i3,jj1,jj2,jj3,ns,ne,size,rest,jj_counter,jj_row_begining,A_marker,P_marker,r_entry,r_a_product,r_a_p_product) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,ii,ic,i1,i2,i3,jj1,jj2,jj3,ns,ne,size,rest,jj_counter,jj_row_begining,A_marker,P_marker,r_entry,r_a_product,r_a_p_product) HYPRE_SMP_SCHEDULE #endif for (ii = 0; ii < num_threads; ii++) { - size = num_cols_offd_RT/num_threads; - rest = num_cols_offd_RT - size*num_threads; + P_marker = NULL; + size = num_cols_offd_RT / num_threads; + rest = num_cols_offd_RT - size * num_threads; if (ii < rest) { - ns = ii*size+ii; - ne = (ii+1)*size+ii+1; + ns = ii * size + ii; + ne = (ii + 1) * size + ii + 1; } else { - ns = ii*size+rest; - ne = (ii+1)*size+rest; + ns = ii * size + rest; + ne = (ii + 1) * size + rest; } /*----------------------------------------------------------------------- * Initialize some stuff. *-----------------------------------------------------------------------*/ if (num_cols_offd_Pext || num_cols_diag_P) + { P_marker = P_mark_array[ii]; + } A_marker = A_mark_array[ii]; jj_counter = start_indexing; - if (ii > 0) jj_counter = jj_count[ii-1]; + if (ii > 0) { jj_counter = jj_count[ii - 1]; } - for (ic = 0; ic < num_cols_diag_P+num_cols_offd_Pext; ic++) + for (ic = 0; ic < num_cols_diag_P + num_cols_offd_Pext; ic++) { P_marker[ic] = -1; } @@ -780,7 +814,7 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, * Loop over entries in row ic of R_offd. *--------------------------------------------------------------------*/ - for (jj1 = R_offd_i[ic]; jj1 < R_offd_i[ic+1]; jj1++) + for (jj1 = R_offd_i[ic]; jj1 < R_offd_i[ic + 1]; jj1++) { i1 = R_offd_j[jj1]; r_entry = R_offd_data[jj1]; @@ -789,7 +823,7 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, * Loop over entries in row i1 of A_offd. *-----------------------------------------------------------------*/ - for (jj2 = A_offd_i[i1]; jj2 < A_offd_i[i1+1]; jj2++) + for (jj2 = A_offd_i[i1]; jj2 < A_offd_i[i1 + 1]; jj2++) { i2 = A_offd_j[jj2]; r_a_product = r_entry * A_offd_data[jj2]; @@ -812,7 +846,7 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, * Loop over entries in row i2 of P_ext. *-----------------------------------------------------------*/ - for (jj3 = P_ext_diag_i[i2]; jj3 < P_ext_diag_i[i2+1]; jj3++) + for (jj3 = P_ext_diag_i[i2]; jj3 < P_ext_diag_i[i2 + 1]; jj3++) { i3 = P_ext_diag_j[jj3]; r_a_p_product = r_a_product * P_ext_diag_data[jj3]; @@ -836,7 +870,7 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, } } - for (jj3 = P_ext_offd_i[i2]; jj3 < P_ext_offd_i[i2+1]; jj3++) + for (jj3 = P_ext_offd_i[i2]; jj3 < P_ext_offd_i[i2 + 1]; jj3++) { i3 = P_ext_offd_j[jj3] + num_cols_diag_P; r_a_p_product = r_a_product * P_ext_offd_data[jj3]; @@ -852,7 +886,7 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, P_marker[i3] = jj_counter; RAP_int_data[jj_counter] = r_a_p_product; RAP_int_j[jj_counter] - = col_map_offd_Pext[i3-num_cols_diag_P]; + = col_map_offd_Pext[i3 - num_cols_diag_P]; jj_counter++; } else @@ -869,13 +903,13 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, else { - for (jj3 = P_ext_diag_i[i2]; jj3 < P_ext_diag_i[i2+1]; jj3++) + for (jj3 = P_ext_diag_i[i2]; jj3 < P_ext_diag_i[i2 + 1]; jj3++) { i3 = P_ext_diag_j[jj3]; r_a_p_product = r_a_product * P_ext_diag_data[jj3]; RAP_int_data[P_marker[i3]] += r_a_p_product; } - for (jj3 = P_ext_offd_i[i2]; jj3 < P_ext_offd_i[i2+1]; jj3++) + for (jj3 = P_ext_offd_i[i2]; jj3 < P_ext_offd_i[i2 + 1]; jj3++) { i3 = P_ext_offd_j[jj3] + num_cols_diag_P; r_a_p_product = r_a_product * P_ext_offd_data[jj3]; @@ -888,7 +922,7 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, * Loop over entries in row i1 of A_diag. *-----------------------------------------------------------------*/ - for (jj2 = A_diag_i[i1]; jj2 < A_diag_i[i1+1]; jj2++) + for (jj2 = A_diag_i[i1]; jj2 < A_diag_i[i1 + 1]; jj2++) { i2 = A_diag_j[jj2]; r_a_product = r_entry * A_diag_data[jj2]; @@ -898,20 +932,20 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, * visited. New entries in RAP only occur from unmarked points. *--------------------------------------------------------------*/ - if (A_marker[i2+num_cols_offd_A] != ic) + if (A_marker[i2 + num_cols_offd_A] != ic) { /*----------------------------------------------------------- * Mark i2 as visited. *-----------------------------------------------------------*/ - A_marker[i2+num_cols_offd_A] = ic; + A_marker[i2 + num_cols_offd_A] = ic; /*----------------------------------------------------------- * Loop over entries in row i2 of P_diag. *-----------------------------------------------------------*/ - for (jj3 = P_diag_i[i2]; jj3 < P_diag_i[i2+1]; jj3++) + for (jj3 = P_diag_i[i2]; jj3 < P_diag_i[i2 + 1]; jj3++) { i3 = P_diag_j[jj3]; r_a_p_product = r_a_product * P_diag_data[jj3]; @@ -934,7 +968,7 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, RAP_int_data[P_marker[i3]] += r_a_p_product; } } - for (jj3 = P_offd_i[i2]; jj3 < P_offd_i[i2+1]; jj3++) + for (jj3 = P_offd_i[i2]; jj3 < P_offd_i[i2 + 1]; jj3++) { i3 = map_P_to_Pext[P_offd_j[jj3]] + num_cols_diag_P; r_a_p_product = r_a_product * P_offd_data[jj3]; @@ -950,7 +984,7 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, P_marker[i3] = jj_counter; RAP_int_data[jj_counter] = r_a_p_product; RAP_int_j[jj_counter] = - col_map_offd_Pext[i3-num_cols_diag_P]; + col_map_offd_Pext[i3 - num_cols_diag_P]; jj_counter++; } else @@ -967,13 +1001,13 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, else { - for (jj3 = P_diag_i[i2]; jj3 < P_diag_i[i2+1]; jj3++) + for (jj3 = P_diag_i[i2]; jj3 < P_diag_i[i2 + 1]; jj3++) { i3 = P_diag_j[jj3]; r_a_p_product = r_a_product * P_diag_data[jj3]; RAP_int_data[P_marker[i3]] += r_a_p_product; } - for (jj3 = P_offd_i[i2]; jj3 < P_offd_i[i2+1]; jj3++) + for (jj3 = P_offd_i[i2]; jj3 < P_offd_i[i2 + 1]; jj3++) { i3 = map_P_to_Pext[P_offd_j[jj3]] + num_cols_diag_P; r_a_p_product = r_a_product * P_offd_data[jj3]; @@ -984,11 +1018,13 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, } } if (num_cols_offd_Pext || num_cols_diag_P) + { hypre_TFree(P_mark_array[ii], HYPRE_MEMORY_HOST); + } hypre_TFree(A_mark_array[ii], HYPRE_MEMORY_HOST); } - RAP_int = hypre_CSRMatrixCreate(num_cols_offd_RT,num_rows_offd_RT,RAP_size); + RAP_int = hypre_CSRMatrixCreate(num_cols_offd_RT, num_rows_offd_RT, RAP_size); hypre_CSRMatrixMemoryLocation(RAP_int) = HYPRE_MEMORY_HOST; @@ -1020,8 +1056,8 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, RAP_int = NULL; } - RAP_diag_i = hypre_TAlloc(HYPRE_Int, num_cols_diag_RT+1, HYPRE_MEMORY_DEVICE); - RAP_offd_i = hypre_TAlloc(HYPRE_Int, num_cols_diag_RT+1, HYPRE_MEMORY_DEVICE); + RAP_diag_i = hypre_TAlloc(HYPRE_Int, num_cols_diag_RT + 1, memory_location_RAP); + RAP_offd_i = hypre_TAlloc(HYPRE_Int, num_cols_diag_RT + 1, memory_location_RAP); first_col_diag_RAP = first_col_diag_P; last_col_diag_RAP = first_col_diag_P + num_cols_diag_P - 1; @@ -1035,20 +1071,23 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, if (RAP_ext_size || num_cols_offd_Pext) { hypre_UnorderedBigIntSet found_set; - hypre_UnorderedBigIntSetCreate(&found_set, 2*(RAP_ext_size + num_cols_offd_Pext), 16*hypre_NumThreads()); + hypre_UnorderedBigIntSetCreate(&found_set, 2 * (RAP_ext_size + num_cols_offd_Pext), + 16 * hypre_NumThreads()); cnt = 0; -#pragma omp parallel private(i) + #pragma omp parallel private(i) { -#pragma omp for HYPRE_SMP_SCHEDULE + #pragma omp for HYPRE_SMP_SCHEDULE for (i = 0; i < RAP_ext_size; i++) { if (RAP_ext_j[i] < first_col_diag_RAP - || RAP_ext_j[i] > last_col_diag_RAP) + || RAP_ext_j[i] > last_col_diag_RAP) + { hypre_UnorderedBigIntSetPut(&found_set, RAP_ext_j[i]); + } } -#pragma omp for HYPRE_SMP_SCHEDULE + #pragma omp for HYPRE_SMP_SCHEDULE for (i = 0; i < num_cols_offd_Pext; i++) { hypre_UnorderedBigIntSetPut(&found_set, col_map_offd_Pext[i]); @@ -1057,27 +1096,32 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, temp = hypre_UnorderedBigIntSetCopyToArray(&found_set, &num_cols_offd_RAP); hypre_UnorderedBigIntSetDestroy(&found_set); - hypre_big_sort_and_create_inverse_map(temp, num_cols_offd_RAP, &col_map_offd_RAP, &col_map_offd_RAP_inverse); + hypre_big_sort_and_create_inverse_map(temp, num_cols_offd_RAP, &col_map_offd_RAP, + &col_map_offd_RAP_inverse); } #else /* !HYPRE_CONCURRENT_HOPSCOTCH */ if (RAP_ext_size || num_cols_offd_Pext) { - temp = hypre_CTAlloc(HYPRE_BigInt, RAP_ext_size+num_cols_offd_Pext, HYPRE_MEMORY_HOST); + temp = hypre_CTAlloc(HYPRE_BigInt, RAP_ext_size + num_cols_offd_Pext, HYPRE_MEMORY_HOST); cnt = 0; - for (i=0; i < RAP_ext_size; i++) + for (i = 0; i < RAP_ext_size; i++) if (RAP_ext_j[i] < first_col_diag_RAP - || RAP_ext_j[i] > last_col_diag_RAP) + || RAP_ext_j[i] > last_col_diag_RAP) + { temp[cnt++] = RAP_ext_j[i]; - for (i=0; i < num_cols_offd_Pext; i++) + } + for (i = 0; i < num_cols_offd_Pext; i++) + { temp[cnt++] = col_map_offd_Pext[i]; + } if (cnt) { - hypre_BigQsort0(temp,0,cnt-1); + hypre_BigQsort0(temp, 0, cnt - 1); HYPRE_BigInt value = temp[0]; num_cols_offd_RAP = 1; - for (i=1; i < cnt; i++) + for (i = 1; i < cnt; i++) { if (temp[i] > value) { @@ -1089,10 +1133,14 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, /* now evaluate col_map_offd_RAP */ if (num_cols_offd_RAP) + { col_map_offd_RAP = hypre_CTAlloc(HYPRE_BigInt, num_cols_offd_RAP, HYPRE_MEMORY_HOST); + } - for (i=0 ; i < num_cols_offd_RAP; i++) + for (i = 0 ; i < num_cols_offd_RAP; i++) + { col_map_offd_RAP[i] = temp[i]; + } hypre_TFree(temp, HYPRE_MEMORY_HOST); } @@ -1103,11 +1151,11 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, map_P_to_RAP = hypre_TAlloc(HYPRE_Int, num_cols_offd_P, HYPRE_MEMORY_HOST); cnt = 0; - for (i=0; i < num_cols_offd_RAP; i++) + for (i = 0; i < num_cols_offd_RAP; i++) if (col_map_offd_RAP[i] == col_map_offd_P[cnt]) { map_P_to_RAP[cnt++] = i; - if (cnt == num_cols_offd_P) break; + if (cnt == num_cols_offd_P) { break; } } } @@ -1116,11 +1164,11 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, map_Pext_to_RAP = hypre_TAlloc(HYPRE_Int, num_cols_offd_Pext, HYPRE_MEMORY_HOST); cnt = 0; - for (i=0; i < num_cols_offd_RAP; i++) + for (i = 0; i < num_cols_offd_RAP; i++) if (col_map_offd_RAP[i] == col_map_offd_Pext[cnt]) { map_Pext_to_RAP[cnt++] = i; - if (cnt == num_cols_offd_Pext) break; + if (cnt == num_cols_offd_Pext) { break; } } } @@ -1129,23 +1177,27 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, *-----------------------------------------------------------------------*/ #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for HYPRE_SMP_SCHEDULE + #pragma omp parallel for HYPRE_SMP_SCHEDULE #endif - for (i=0; i < RAP_ext_size; i++) + for (i = 0; i < RAP_ext_size; i++) if (RAP_ext_j[i] < first_col_diag_RAP - || RAP_ext_j[i] > last_col_diag_RAP) + || RAP_ext_j[i] > last_col_diag_RAP) RAP_ext_j[i] = (HYPRE_BigInt)num_cols_diag_P #ifdef HYPRE_CONCURRENT_HOPSCOTCH - +(HYPRE_BigInt)hypre_UnorderedBigIntMapGet(&col_map_offd_RAP_inverse, RAP_ext_j[i]); + + (HYPRE_BigInt)hypre_UnorderedBigIntMapGet(&col_map_offd_RAP_inverse, RAP_ext_j[i]); #else - +(HYPRE_BigInt)hypre_BigBinarySearch(col_map_offd_RAP, RAP_ext_j[i],num_cols_offd_RAP); + +(HYPRE_BigInt)hypre_BigBinarySearch(col_map_offd_RAP, RAP_ext_j[i], num_cols_offd_RAP); #endif else + { RAP_ext_j[i] -= first_col_diag_RAP; + } #ifdef HYPRE_CONCURRENT_HOPSCOTCH if (num_cols_offd_RAP) + { hypre_UnorderedBigIntMapDestroy(&col_map_offd_RAP_inverse); + } #endif #ifdef HYPRE_PROFILE @@ -1161,31 +1213,32 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, jj_cnt_offd = hypre_CTAlloc(HYPRE_Int, num_threads, HYPRE_MEMORY_HOST); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,j,k,jcol,ii,ic,i1,i2,i3,jj1,jj2,jj3,ns,ne,size,rest,jj_count_diag,jj_count_offd,jj_row_begin_diag,jj_row_begin_offd,A_marker,P_marker) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,j,k,jcol,ii,ic,i1,i2,i3,jj1,jj2,jj3,ns,ne,size,rest,jj_count_diag,jj_count_offd,jj_row_begin_diag,jj_row_begin_offd,A_marker,P_marker) HYPRE_SMP_SCHEDULE #endif for (ii = 0; ii < num_threads; ii++) { - size = num_cols_diag_RT/num_threads; - rest = num_cols_diag_RT - size*num_threads; + size = num_cols_diag_RT / num_threads; + rest = num_cols_diag_RT - size * num_threads; if (ii < rest) { - ns = ii*size+ii; - ne = (ii+1)*size+ii+1; + ns = ii * size + ii; + ne = (ii + 1) * size + ii + 1; } else { - ns = ii*size+rest; - ne = (ii+1)*size+rest; + ns = ii * size + rest; + ne = (ii + 1) * size + rest; } - P_mark_array[ii] = hypre_CTAlloc(HYPRE_Int, num_cols_diag_P+num_cols_offd_RAP, HYPRE_MEMORY_HOST); + P_mark_array[ii] = hypre_CTAlloc(HYPRE_Int, num_cols_diag_P + num_cols_offd_RAP, + HYPRE_MEMORY_HOST); A_mark_array[ii] = hypre_CTAlloc(HYPRE_Int, num_nz_cols_A, HYPRE_MEMORY_HOST); P_marker = P_mark_array[ii]; A_marker = A_mark_array[ii]; jj_count_diag = start_indexing; jj_count_offd = start_indexing; - for (ic = 0; ic < num_cols_diag_P+num_cols_offd_RAP; ic++) + for (ic = 0; ic < num_cols_diag_P + num_cols_offd_RAP; ic++) { P_marker[ic] = -1; } @@ -1210,7 +1263,9 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, jj_row_begin_offd = jj_count_offd; if (square) + { P_marker[ic] = jj_count_diag++; + } #ifdef HYPRE_CONCURRENT_HOPSCOTCH if (send_map_elmts_RT_inverse_map_initialized) @@ -1218,10 +1273,11 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, HYPRE_Int i = hypre_UnorderedIntMapGet(&send_map_elmts_RT_inverse_map, ic); if (i != -1) { - for (j = send_map_elmts_starts_RT_aggregated[i]; j < send_map_elmts_starts_RT_aggregated[i + 1]; j++) + for (j = send_map_elmts_starts_RT_aggregated[i]; j < send_map_elmts_starts_RT_aggregated[i + 1]; + j++) { HYPRE_Int jj = send_map_elmts_RT_aggregated[j]; - for (k=RAP_ext_i[jj]; k < RAP_ext_i[jj+1]; k++) + for (k = RAP_ext_i[jj]; k < RAP_ext_i[jj + 1]; k++) { jcol = (HYPRE_Int)RAP_ext_j[k]; if (jcol < num_cols_diag_P) @@ -1245,11 +1301,11 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, } // if (set) } #else /* !HYPRE_CONCURRENT_HOPSCOTCH */ - for (i=0; i < num_sends_RT; i++) - for (j = send_map_starts_RT[i]; j < send_map_starts_RT[i+1]; j++) + for (i = 0; i < num_sends_RT; i++) + for (j = send_map_starts_RT[i]; j < send_map_starts_RT[i + 1]; j++) if (send_map_elmts_RT[j] == ic) { - for (k=RAP_ext_i[j]; k < RAP_ext_i[j+1]; k++) + for (k = RAP_ext_i[j]; k < RAP_ext_i[j + 1]; k++) { jcol = (HYPRE_Int) RAP_ext_j[k]; if (jcol < num_cols_diag_P) @@ -1277,7 +1333,7 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, * Loop over entries in row ic of R_diag. *--------------------------------------------------------------------*/ - for (jj1 = R_diag_i[ic]; jj1 < R_diag_i[ic+1]; jj1++) + for (jj1 = R_diag_i[ic]; jj1 < R_diag_i[ic + 1]; jj1++) { i1 = R_diag_j[jj1]; @@ -1287,7 +1343,7 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, if (num_cols_offd_A) { - for (jj2 = A_offd_i[i1]; jj2 < A_offd_i[i1+1]; jj2++) + for (jj2 = A_offd_i[i1]; jj2 < A_offd_i[i1 + 1]; jj2++) { i2 = A_offd_j[jj2]; @@ -1309,7 +1365,7 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, * Loop over entries in row i2 of P_ext. *-----------------------------------------------------------*/ - for (jj3 = P_ext_diag_i[i2]; jj3 < P_ext_diag_i[i2+1]; jj3++) + for (jj3 = P_ext_diag_i[i2]; jj3 < P_ext_diag_i[i2 + 1]; jj3++) { i3 = P_ext_diag_j[jj3]; @@ -1325,9 +1381,9 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, jj_count_diag++; } } - for (jj3 = P_ext_offd_i[i2]; jj3 < P_ext_offd_i[i2+1]; jj3++) + for (jj3 = P_ext_offd_i[i2]; jj3 < P_ext_offd_i[i2 + 1]; jj3++) { - i3 = map_Pext_to_RAP[P_ext_offd_j[jj3]]+num_cols_diag_P; + i3 = map_Pext_to_RAP[P_ext_offd_j[jj3]] + num_cols_diag_P; /*-------------------------------------------------------- * Check P_marker to see that RAP_{ic,i3} has not already @@ -1348,7 +1404,7 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, * Loop over entries in row i1 of A_diag. *-----------------------------------------------------------------*/ - for (jj2 = A_diag_i[i1]; jj2 < A_diag_i[i1+1]; jj2++) + for (jj2 = A_diag_i[i1]; jj2 < A_diag_i[i1 + 1]; jj2++) { i2 = A_diag_j[jj2]; @@ -1357,20 +1413,20 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, * visited. New entries in RAP only occur from unmarked points. *--------------------------------------------------------------*/ - if (A_marker[i2+num_cols_offd_A] != ic) + if (A_marker[i2 + num_cols_offd_A] != ic) { /*----------------------------------------------------------- * Mark i2 as visited. *-----------------------------------------------------------*/ - A_marker[i2+num_cols_offd_A] = ic; + A_marker[i2 + num_cols_offd_A] = ic; /*----------------------------------------------------------- * Loop over entries in row i2 of P_diag. *-----------------------------------------------------------*/ - for (jj3 = P_diag_i[i2]; jj3 < P_diag_i[i2+1]; jj3++) + for (jj3 = P_diag_i[i2]; jj3 < P_diag_i[i2 + 1]; jj3++) { i3 = P_diag_j[jj3]; @@ -1392,7 +1448,7 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, if (num_cols_offd_P) { - for (jj3 = P_offd_i[i2]; jj3 < P_offd_i[i2+1]; jj3++) + for (jj3 = P_offd_i[i2]; jj3 < P_offd_i[i2 + 1]; jj3++) { i3 = map_P_to_RAP[P_offd_j[jj3]] + num_cols_diag_P; @@ -1425,14 +1481,14 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, jj_cnt_offd[ii] = jj_count_offd; } - for (i=0; i < num_threads-1; i++) + for (i = 0; i < num_threads - 1; i++) { - jj_cnt_diag[i+1] += jj_cnt_diag[i]; - jj_cnt_offd[i+1] += jj_cnt_offd[i]; + jj_cnt_diag[i + 1] += jj_cnt_diag[i]; + jj_cnt_offd[i + 1] += jj_cnt_offd[i]; } - jj_count_diag = jj_cnt_diag[num_threads-1]; - jj_count_offd = jj_cnt_offd[num_threads-1]; + jj_count_diag = jj_cnt_diag[num_threads - 1]; + jj_count_offd = jj_cnt_offd[num_threads - 1]; RAP_diag_i[num_cols_diag_RT] = jj_count_diag; RAP_offd_i[num_cols_diag_RT] = jj_count_offd; @@ -1445,15 +1501,15 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, RAP_diag_size = jj_count_diag; if (RAP_diag_size) { - RAP_diag_data = hypre_CTAlloc(HYPRE_Real, RAP_diag_size, HYPRE_MEMORY_DEVICE); - RAP_diag_j = hypre_CTAlloc(HYPRE_Int, RAP_diag_size, HYPRE_MEMORY_DEVICE); + RAP_diag_data = hypre_CTAlloc(HYPRE_Real, RAP_diag_size, memory_location_RAP); + RAP_diag_j = hypre_CTAlloc(HYPRE_Int, RAP_diag_size, memory_location_RAP); } RAP_offd_size = jj_count_offd; if (RAP_offd_size) { - RAP_offd_data = hypre_CTAlloc(HYPRE_Real, RAP_offd_size, HYPRE_MEMORY_DEVICE); - RAP_offd_j = hypre_CTAlloc(HYPRE_Int, RAP_offd_size, HYPRE_MEMORY_DEVICE); + RAP_offd_data = hypre_CTAlloc(HYPRE_Real, RAP_offd_size, memory_location_RAP); + RAP_offd_j = hypre_CTAlloc(HYPRE_Int, RAP_offd_size, memory_location_RAP); } if (RAP_offd_size == 0 && num_cols_offd_RAP != 0) @@ -1462,12 +1518,12 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, hypre_TFree(col_map_offd_RAP, HYPRE_MEMORY_HOST); } - RA_diag_data_array = hypre_TAlloc(HYPRE_Real, num_cols_diag_A*num_threads, HYPRE_MEMORY_HOST); - RA_diag_j_array = hypre_TAlloc(HYPRE_Int, num_cols_diag_A*num_threads, HYPRE_MEMORY_HOST); + RA_diag_data_array = hypre_TAlloc(HYPRE_Real, num_cols_diag_A * num_threads, HYPRE_MEMORY_HOST); + RA_diag_j_array = hypre_TAlloc(HYPRE_Int, num_cols_diag_A * num_threads, HYPRE_MEMORY_HOST); if (num_cols_offd_A) { - RA_offd_data_array = hypre_TAlloc(HYPRE_Real, num_cols_offd_A*num_threads, HYPRE_MEMORY_HOST); - RA_offd_j_array = hypre_TAlloc(HYPRE_Int, num_cols_offd_A*num_threads, HYPRE_MEMORY_HOST); + RA_offd_data_array = hypre_TAlloc(HYPRE_Real, num_cols_offd_A * num_threads, HYPRE_MEMORY_HOST); + RA_offd_j_array = hypre_TAlloc(HYPRE_Int, num_cols_offd_A * num_threads, HYPRE_MEMORY_HOST); } /*----------------------------------------------------------------------- @@ -1476,21 +1532,21 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, *-----------------------------------------------------------------------*/ #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,j,k,jcol,ii,ic,i1,i2,i3,jj1,jj2,jj3,ns,ne,size,rest,jj_count_diag,jj_count_offd,jj_row_begin_diag,jj_row_begin_offd,A_marker,P_marker,r_entry,r_a_product,r_a_p_product) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,j,k,jcol,ii,ic,i1,i2,i3,jj1,jj2,jj3,ns,ne,size,rest,jj_count_diag,jj_count_offd,jj_row_begin_diag,jj_row_begin_offd,A_marker,P_marker,r_entry,r_a_product,r_a_p_product) HYPRE_SMP_SCHEDULE #endif for (ii = 0; ii < num_threads; ii++) { - size = num_cols_diag_RT/num_threads; - rest = num_cols_diag_RT - size*num_threads; + size = num_cols_diag_RT / num_threads; + rest = num_cols_diag_RT - size * num_threads; if (ii < rest) { - ns = ii*size+ii; - ne = (ii+1)*size+ii+1; + ns = ii * size + ii; + ne = (ii + 1) * size + ii + 1; } else { - ns = ii*size+rest; - ne = (ii+1)*size+rest; + ns = ii * size + rest; + ne = (ii + 1) * size + rest; } /*----------------------------------------------------------------------- @@ -1499,7 +1555,7 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, P_marker = P_mark_array[ii]; A_marker = A_mark_array[ii]; - for (ic = 0; ic < num_cols_diag_P+num_cols_offd_RAP; ic++) + for (ic = 0; ic < num_cols_diag_P + num_cols_offd_RAP; ic++) { P_marker[ic] = -1; } @@ -1512,23 +1568,28 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, jj_count_offd = start_indexing; if (ii > 0) { - jj_count_diag = jj_cnt_diag[ii-1]; - jj_count_offd = jj_cnt_offd[ii-1]; + jj_count_diag = jj_cnt_diag[ii - 1]; + jj_count_offd = jj_cnt_offd[ii - 1]; } // temporal matrix RA = R*A // only need to store one row per thread because R*A and (R*A)*P are fused // into one loop. hypre_CSRMatrix RA_diag, RA_offd; - RA_diag.data = RA_diag_data_array + num_cols_diag_A*ii; - RA_diag.j = RA_diag_j_array + num_cols_diag_A*ii; + RA_diag.data = RA_diag_data_array + num_cols_diag_A * ii; + RA_diag.j = RA_diag_j_array + num_cols_diag_A * ii; RA_diag.num_nonzeros = 0; RA_offd.num_nonzeros = 0; if (num_cols_offd_A) { - RA_offd.data = RA_offd_data_array + num_cols_offd_A*ii; - RA_offd.j = RA_offd_j_array + num_cols_offd_A*ii; + RA_offd.data = RA_offd_data_array + num_cols_offd_A * ii; + RA_offd.j = RA_offd_j_array + num_cols_offd_A * ii; + } + else + { + RA_offd.data = NULL; + RA_offd.j = NULL; } /*----------------------------------------------------------------------- @@ -1564,10 +1625,11 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, HYPRE_Int i = hypre_UnorderedIntMapGet(&send_map_elmts_RT_inverse_map, ic); if (i != -1) { - for (j = send_map_elmts_starts_RT_aggregated[i]; j < send_map_elmts_starts_RT_aggregated[i + 1]; j++) + for (j = send_map_elmts_starts_RT_aggregated[i]; j < send_map_elmts_starts_RT_aggregated[i + 1]; + j++) { HYPRE_Int jj = send_map_elmts_RT_aggregated[j]; - for (k=RAP_ext_i[jj]; k < RAP_ext_i[jj+1]; k++) + for (k = RAP_ext_i[jj]; k < RAP_ext_i[jj + 1]; k++) { jcol = (HYPRE_Int)RAP_ext_j[k]; if (jcol < num_cols_diag_P) @@ -1582,7 +1644,7 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, } else RAP_diag_data[P_marker[jcol]] - += RAP_ext_data[k]; + += RAP_ext_data[k]; } else { @@ -1592,23 +1654,23 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, RAP_offd_data[jj_count_offd] = RAP_ext_data[k]; RAP_offd_j[jj_count_offd] - = jcol-num_cols_diag_P; + = jcol - num_cols_diag_P; jj_count_offd++; } else RAP_offd_data[P_marker[jcol]] - += RAP_ext_data[k]; + += RAP_ext_data[k]; } } } } // if (set) } #else /* !HYPRE_CONCURRENT_HOPSCOTCH */ - for (i=0; i < num_sends_RT; i++) - for (j = send_map_starts_RT[i]; j < send_map_starts_RT[i+1]; j++) + for (i = 0; i < num_sends_RT; i++) + for (j = send_map_starts_RT[i]; j < send_map_starts_RT[i + 1]; j++) if (send_map_elmts_RT[j] == ic) { - for (k=RAP_ext_i[j]; k < RAP_ext_i[j+1]; k++) + for (k = RAP_ext_i[j]; k < RAP_ext_i[j + 1]; k++) { jcol = (HYPRE_Int)RAP_ext_j[k]; if (jcol < num_cols_diag_P) @@ -1623,7 +1685,7 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, } else RAP_diag_data[P_marker[jcol]] - += RAP_ext_data[k]; + += RAP_ext_data[k]; } else { @@ -1633,12 +1695,12 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, RAP_offd_data[jj_count_offd] = RAP_ext_data[k]; RAP_offd_j[jj_count_offd] - = jcol-num_cols_diag_P; + = jcol - num_cols_diag_P; jj_count_offd++; } else RAP_offd_data[P_marker[jcol]] - += RAP_ext_data[k]; + += RAP_ext_data[k]; } } break; @@ -1649,7 +1711,7 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, * Loop over entries in row ic of R_diag and compute row ic of RA. *--------------------------------------------------------------------*/ - for (jj1 = R_diag_i[ic]; jj1 < R_diag_i[ic+1]; jj1++) + for (jj1 = R_diag_i[ic]; jj1 < R_diag_i[ic + 1]; jj1++) { i1 = R_diag_j[jj1]; r_entry = R_diag_data[jj1]; @@ -1660,7 +1722,7 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, if (num_cols_offd_A) { - for (jj2 = A_offd_i[i1]; jj2 < A_offd_i[i1+1]; jj2++) + for (jj2 = A_offd_i[i1]; jj2 < A_offd_i[i1 + 1]; jj2++) { i2 = A_offd_j[jj2]; HYPRE_Real a_entry = A_offd_data[jj2]; @@ -1700,11 +1762,11 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, * Loop over entries in row i1 of A_diag. *-----------------------------------------------------------------*/ - for (jj2 = A_diag_i[i1]; jj2 < A_diag_i[i1+1]; jj2++) + for (jj2 = A_diag_i[i1]; jj2 < A_diag_i[i1 + 1]; jj2++) { i2 = A_diag_j[jj2]; HYPRE_Real a_entry = A_diag_data[jj2]; - HYPRE_Int marker = A_marker[i2+num_cols_offd_A]; + HYPRE_Int marker = A_marker[i2 + num_cols_offd_A]; /*-------------------------------------------------------------- * Check A_marker to see if point i2 has been previously @@ -1716,7 +1778,7 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, /*----------------------------------------------------------- * Mark i2 as visited. *-----------------------------------------------------------*/ - A_marker[i2+num_cols_offd_A] = RA_diag.num_nonzeros; + A_marker[i2 + num_cols_offd_A] = RA_diag.num_nonzeros; RA_diag.data[RA_diag.num_nonzeros - ra_row_begin_diag] = r_entry * a_entry; RA_diag.j[RA_diag.num_nonzeros - ra_row_begin_diag] = i2; RA_diag.num_nonzeros++; @@ -1744,7 +1806,7 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, /*----------------------------------------------------------- * Loop over entries in row i1 of P_ext. *-----------------------------------------------------------*/ - for (jj2 = P_ext_diag_i[i1]; jj2 < P_ext_diag_i[i1+1]; jj2++) + for (jj2 = P_ext_diag_i[i1]; jj2 < P_ext_diag_i[i1 + 1]; jj2++) { i2 = P_ext_diag_j[jj2]; HYPRE_Real p_entry = P_ext_diag_data[jj2]; @@ -1763,9 +1825,11 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, jj_count_diag++; } else + { RAP_diag_data[marker] += r_a_product * p_entry; + } } - for (jj2 = P_ext_offd_i[i1]; jj2 < P_ext_offd_i[i1+1]; jj2++) + for (jj2 = P_ext_offd_i[i1]; jj2 < P_ext_offd_i[i1 + 1]; jj2++) { i2 = map_Pext_to_RAP[P_ext_offd_j[jj2]] + num_cols_diag_P; HYPRE_Real p_entry = P_ext_offd_data[jj2]; @@ -1784,7 +1848,9 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, jj_count_offd++; } else + { RAP_offd_data[marker] += r_a_product * p_entry; + } } } // loop over entries in row ic of RA_offd @@ -1800,7 +1866,7 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, /*----------------------------------------------------------------- * Loop over entries in row i1 of P_diag. *-----------------------------------------------------------------*/ - for (jj2 = P_diag_i[i1]; jj2 < P_diag_i[i1+1]; jj2++) + for (jj2 = P_diag_i[i1]; jj2 < P_diag_i[i1 + 1]; jj2++) { i2 = P_diag_j[jj2]; HYPRE_Real p_entry = P_diag_data[jj2]; @@ -1826,7 +1892,7 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, } if (num_cols_offd_P) { - for (jj2 = P_offd_i[i1]; jj2 < P_offd_i[i1+1]; jj2++) + for (jj2 = P_offd_i[i1]; jj2 < P_offd_i[i1 + 1]; jj2++) { i2 = map_P_to_RAP[P_offd_j[jj2]] + num_cols_diag_P; HYPRE_Real p_entry = P_offd_data[jj2]; @@ -1862,16 +1928,18 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, P_marker = hypre_CTAlloc(HYPRE_Int, num_cols_offd_RAP, HYPRE_MEMORY_HOST); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for HYPRE_SMP_SCHEDULE + #pragma omp parallel for HYPRE_SMP_SCHEDULE #endif - for (i=0; i < num_cols_offd_RAP; i++) + for (i = 0; i < num_cols_offd_RAP; i++) + { P_marker[i] = -1; + } jj_count_offd = 0; #ifdef HYPRE_USING_ATOMIC -#pragma omp parallel for private(i3) reduction(+:jj_count_offd) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i3) reduction(+:jj_count_offd) HYPRE_SMP_SCHEDULE #endif - for (i=0; i < RAP_offd_size; i++) + for (i = 0; i < RAP_offd_size; i++) { i3 = RAP_offd_j[i]; #ifdef HYPRE_USING_ATOMIC @@ -1892,7 +1960,7 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, { new_col_map_offd_RAP = hypre_CTAlloc(HYPRE_BigInt, jj_count_offd, HYPRE_MEMORY_HOST); jj_counter = 0; - for (i=0; i < num_cols_offd_RAP; i++) + for (i = 0; i < num_cols_offd_RAP; i++) if (!P_marker[i]) { P_marker[i] = jj_counter; @@ -1900,9 +1968,9 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, } #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i3) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i3) HYPRE_SMP_SCHEDULE #endif - for (i=0; i < RAP_offd_size; i++) + for (i = 0; i < RAP_offd_size; i++) { i3 = RAP_offd_j[i]; RAP_offd_j[i] = P_marker[i3]; @@ -1915,9 +1983,9 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, hypre_TFree(P_marker, HYPRE_MEMORY_HOST); RAP = hypre_ParCSRMatrixCreate(comm, n_coarse_RT, n_coarse, - RT_partitioning, coarse_partitioning, - num_cols_offd_RAP, RAP_diag_size, - RAP_offd_size); + RT_partitioning, coarse_partitioning, + num_cols_offd_RAP, RAP_diag_size, + RAP_offd_size); RAP_diag = hypre_ParCSRMatrixDiag(RAP); hypre_CSRMatrixI(RAP_diag) = RAP_diag_i; @@ -2022,5 +2090,5 @@ hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, hypre_profile_times[HYPRE_TIMER_ID_RAP] += hypre_MPI_Wtime(); #endif - return(0); + return hypre_error_flag; } diff --git a/external/hypre/src/parcsr_ls/par_rap_communication.c b/external/hypre/src/parcsr_ls/par_rap_communication.c index d2295a2a..073ad966 100644 --- a/external/hypre/src/parcsr_ls/par_rap_communication.c +++ b/external/hypre/src/parcsr_ls/par_rap_communication.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -23,7 +23,7 @@ hypre_GetCommPkgRTFromCommPkgA( hypre_ParCSRMatrix *RT, HYPRE_Int *send_procs_A = hypre_ParCSRCommPkgSendProcs(comm_pkg_A); HYPRE_Int *send_map_starts_A = hypre_ParCSRCommPkgSendMapStarts(comm_pkg_A); - hypre_ParCSRCommPkg *comm_pkg; + hypre_ParCSRCommPkg *comm_pkg = NULL; HYPRE_Int num_recvs_RT; HYPRE_Int *recv_procs_RT; HYPRE_Int *recv_vec_starts_RT; @@ -60,8 +60,8 @@ hypre_GetCommPkgRTFromCommPkgA( hypre_ParCSRMatrix *RT, hypre_MPI_Request *requests; hypre_MPI_Status *status; - hypre_MPI_Comm_size(comm,&num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); /*-------------------------------------------------------------------------- * determine num_recvs, recv_procs and recv_vec_starts for RT @@ -69,27 +69,29 @@ hypre_GetCommPkgRTFromCommPkgA( hypre_ParCSRMatrix *RT, proc_mark = hypre_CTAlloc(HYPRE_Int, num_recvs_A, HYPRE_MEMORY_HOST); - for (i=0; i < num_recvs_A; i++) + for (i = 0; i < num_recvs_A; i++) + { proc_mark[i] = 0; + } proc_num = 0; num_recvs_RT = 0; if (num_cols_offd_RT) { - for (i=0; i < num_recvs_A; i++) + for (i = 0; i < num_recvs_A; i++) { - for (j=recv_vec_starts_A[i]; j 0) coarse_shift = coarse_counter[j-1]; - size = n_fine/num_threads; - rest = n_fine - size*num_threads; + if (j > 0) { coarse_shift = coarse_counter[j - 1]; } + size = n_fine / num_threads; + rest = n_fine - size * num_threads; if (j < rest) { - ns = j*size+j; - ne = (j+1)*size+j+1; + ns = j * size + j; + ne = (j + 1) * size + j + 1; } else { - ns = j*size+rest; - ne = (j+1)*size+rest; + ns = j * size + rest; + ne = (j + 1) * size + rest; } for (i = ns; i < ne; i++) + { fine_to_coarse[i] += coarse_shift; + } } index = 0; for (i = 0; i < num_sends_A; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg_A, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg_A, i+1); j++) - big_buf_data[index++] = my_first_cpt+ - (HYPRE_BigInt)fine_to_coarse[hypre_ParCSRCommPkgSendMapElmt(comm_pkg_A,j)]; + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg_A, i + 1); j++) + big_buf_data[index++] = my_first_cpt + + (HYPRE_BigInt)fine_to_coarse[hypre_ParCSRCommPkgSendMapElmt(comm_pkg_A, j)]; } comm_handle = hypre_ParCSRCommHandleCreate( 21, comm_pkg_A, big_buf_data, - fine_to_coarse_offd); + fine_to_coarse_offd); hypre_ParCSRCommHandleDestroy(comm_handle); - for (i=0; i < num_cols_offd_RT; i++) + for (i = 0; i < num_cols_offd_RT; i++) + { col_map_offd_RT[i] = fine_to_coarse_offd[tmp_map_offd[i]]; + } hypre_TFree(big_buf_data, HYPRE_MEMORY_HOST); hypre_TFree(fine_to_coarse_offd, HYPRE_MEMORY_HOST); @@ -145,16 +151,16 @@ hypre_GetCommPkgRTFromCommPkgA( hypre_ParCSRMatrix *RT, //hypre_TFree(tmp_map_offd, HYPRE_MEMORY_HOST); recv_procs_RT = hypre_CTAlloc(HYPRE_Int, num_recvs_RT, HYPRE_MEMORY_HOST); - recv_vec_starts_RT = hypre_CTAlloc(HYPRE_Int, num_recvs_RT+1, HYPRE_MEMORY_HOST); + recv_vec_starts_RT = hypre_CTAlloc(HYPRE_Int, num_recvs_RT + 1, HYPRE_MEMORY_HOST); j = 0; recv_vec_starts_RT[0] = 0; - for (i=0; i < num_recvs_A; i++) + for (i = 0; i < num_recvs_A; i++) { if (proc_mark[i]) { recv_procs_RT[j] = recv_procs_A[i]; - recv_vec_starts_RT[j+1] = recv_vec_starts_RT[j]+proc_mark[i]; + recv_vec_starts_RT[j + 1] = recv_vec_starts_RT[j] + proc_mark[i]; j++; } } @@ -163,22 +169,22 @@ hypre_GetCommPkgRTFromCommPkgA( hypre_ParCSRMatrix *RT, * send num_changes to recv_procs_A and receive change_array from send_procs_A *--------------------------------------------------------------------------*/ - num_requests = num_recvs_A+num_sends_A; + num_requests = num_recvs_A + num_sends_A; requests = hypre_CTAlloc(hypre_MPI_Request, num_requests, HYPRE_MEMORY_HOST); status = hypre_CTAlloc(hypre_MPI_Status, num_requests, HYPRE_MEMORY_HOST); change_array = hypre_CTAlloc(HYPRE_Int, num_sends_A, HYPRE_MEMORY_HOST); j = 0; - for (i=0; i < num_sends_A; i++) - hypre_MPI_Irecv(&change_array[i],1,HYPRE_MPI_INT,send_procs_A[i],0,comm, - &requests[j++]); + for (i = 0; i < num_sends_A; i++) + hypre_MPI_Irecv(&change_array[i], 1, HYPRE_MPI_INT, send_procs_A[i], 0, comm, + &requests[j++]); - for (i=0; i < num_recvs_A; i++) - hypre_MPI_Isend(&proc_mark[i],1,HYPRE_MPI_INT,recv_procs_A[i],0,comm, - &requests[j++]); + for (i = 0; i < num_recvs_A; i++) + hypre_MPI_Isend(&proc_mark[i], 1, HYPRE_MPI_INT, recv_procs_A[i], 0, comm, + &requests[j++]); - hypre_MPI_Waitall(num_requests,requests,status); + hypre_MPI_Waitall(num_requests, requests, status); hypre_TFree(proc_mark, HYPRE_MEMORY_HOST); @@ -187,23 +193,23 @@ hypre_GetCommPkgRTFromCommPkgA( hypre_ParCSRMatrix *RT, *--------------------------------------------------------------------------*/ num_sends_RT = 0; - for (i=0; i < num_sends_A; i++) + for (i = 0; i < num_sends_A; i++) if (change_array[i]) { num_sends_RT++; } send_procs_RT = hypre_CTAlloc(HYPRE_Int, num_sends_RT, HYPRE_MEMORY_HOST); - send_map_starts_RT = hypre_CTAlloc(HYPRE_Int, num_sends_RT+1, HYPRE_MEMORY_HOST); + send_map_starts_RT = hypre_CTAlloc(HYPRE_Int, num_sends_RT + 1, HYPRE_MEMORY_HOST); j = 0; send_map_starts_RT[0] = 0; - for (i=0; i < num_sends_A; i++) + for (i = 0; i < num_sends_A; i++) { if (change_array[i]) { send_procs_RT[j] = send_procs_A[i]; - send_map_starts_RT[j+1] = send_map_starts_RT[j]+change_array[i]; + send_map_starts_RT[j + 1] = send_map_starts_RT[j] + change_array[i]; j++; } } @@ -216,37 +222,35 @@ hypre_GetCommPkgRTFromCommPkgA( hypre_ParCSRMatrix *RT, send_big_elmts = hypre_CTAlloc(HYPRE_BigInt, send_map_starts_RT[num_sends_RT], HYPRE_MEMORY_HOST); j = 0; - for (i=0; i < num_sends_RT; i++) + for (i = 0; i < num_sends_RT; i++) { vec_start = send_map_starts_RT[i]; - vec_len = send_map_starts_RT[i+1]-vec_start; - hypre_MPI_Irecv(&send_big_elmts[vec_start],vec_len,HYPRE_MPI_BIG_INT, - send_procs_RT[i],0,comm,&requests[j++]); + vec_len = send_map_starts_RT[i + 1] - vec_start; + hypre_MPI_Irecv(&send_big_elmts[vec_start], vec_len, HYPRE_MPI_BIG_INT, + send_procs_RT[i], 0, comm, &requests[j++]); } - for (i=0; i < num_recvs_RT; i++) + for (i = 0; i < num_recvs_RT; i++) { vec_start = recv_vec_starts_RT[i]; - vec_len = recv_vec_starts_RT[i+1] - vec_start; - hypre_MPI_Isend(&col_map_offd_RT[vec_start],vec_len,HYPRE_MPI_BIG_INT, - recv_procs_RT[i],0,comm,&requests[j++]); + vec_len = recv_vec_starts_RT[i + 1] - vec_start; + hypre_MPI_Isend(&col_map_offd_RT[vec_start], vec_len, HYPRE_MPI_BIG_INT, + recv_procs_RT[i], 0, comm, &requests[j++]); } - hypre_MPI_Waitall(j,requests,status); + hypre_MPI_Waitall(j, requests, status); - for (i=0; i < send_map_starts_RT[num_sends_RT]; i++) - send_map_elmts_RT[i] = (HYPRE_Int)(send_big_elmts[i]-first_col_diag); - - comm_pkg = hypre_CTAlloc(hypre_ParCSRCommPkg, 1, HYPRE_MEMORY_HOST); + for (i = 0; i < send_map_starts_RT[num_sends_RT]; i++) + { + send_map_elmts_RT[i] = (HYPRE_Int)(send_big_elmts[i] - first_col_diag); + } - hypre_ParCSRCommPkgComm(comm_pkg) = comm; - hypre_ParCSRCommPkgNumSends(comm_pkg) = num_sends_RT; - hypre_ParCSRCommPkgNumRecvs(comm_pkg) = num_recvs_RT; - hypre_ParCSRCommPkgSendProcs(comm_pkg) = send_procs_RT; - hypre_ParCSRCommPkgRecvProcs(comm_pkg) = recv_procs_RT; - hypre_ParCSRCommPkgRecvVecStarts(comm_pkg) = recv_vec_starts_RT; - hypre_ParCSRCommPkgSendMapStarts(comm_pkg) = send_map_starts_RT; - hypre_ParCSRCommPkgSendMapElmts(comm_pkg) = send_map_elmts_RT; + /* Create and fill communication package */ + hypre_ParCSRCommPkgCreateAndFill(comm, + num_recvs_RT, recv_procs_RT, recv_vec_starts_RT, + num_sends_RT, send_procs_RT, send_map_starts_RT, + send_map_elmts_RT, + &comm_pkg); hypre_TFree(status, HYPRE_MEMORY_HOST); hypre_TFree(requests, HYPRE_MEMORY_HOST); @@ -266,11 +270,11 @@ hypre_GenerateSendMapAndCommPkg(MPI_Comm comm, HYPRE_Int num_sends, HYPRE_Int nu HYPRE_Int *send_map_starts; HYPRE_Int *send_map_elmts; HYPRE_Int i, j; - HYPRE_Int num_requests = num_sends+num_recvs; + HYPRE_Int num_requests = num_sends + num_recvs; hypre_MPI_Request *requests; hypre_MPI_Status *status; HYPRE_Int vec_len, vec_start; - hypre_ParCSRCommPkg *comm_pkg; + hypre_ParCSRCommPkg *comm_pkg = NULL; HYPRE_BigInt *col_map_offd = hypre_ParCSRMatrixColMapOffd(A); HYPRE_BigInt first_col_diag = hypre_ParCSRMatrixFirstColDiag(A); HYPRE_BigInt *send_big_elmts = NULL; @@ -278,66 +282,70 @@ hypre_GenerateSendMapAndCommPkg(MPI_Comm comm, HYPRE_Int num_sends, HYPRE_Int nu /*-------------------------------------------------------------------------- * generate send_map_starts and send_map_elmts *--------------------------------------------------------------------------*/ + requests = hypre_CTAlloc(hypre_MPI_Request, num_requests, HYPRE_MEMORY_HOST); status = hypre_CTAlloc(hypre_MPI_Status, num_requests, HYPRE_MEMORY_HOST); - send_map_starts = hypre_CTAlloc(HYPRE_Int, num_sends+1, HYPRE_MEMORY_HOST); + send_map_starts = hypre_CTAlloc(HYPRE_Int, num_sends + 1, HYPRE_MEMORY_HOST); j = 0; - for (i=0; i < num_sends; i++) - hypre_MPI_Irecv(&send_map_starts[i+1],1,HYPRE_MPI_INT,send_procs[i],0,comm, - &requests[j++]); + for (i = 0; i < num_sends; i++) + { + hypre_MPI_Irecv(&send_map_starts[i + 1], 1, HYPRE_MPI_INT, send_procs[i], 0, comm, + &requests[j++]); + } - for (i=0; i < num_recvs; i++) + for (i = 0; i < num_recvs; i++) { - vec_len = recv_vec_starts[i+1] - recv_vec_starts[i]; - hypre_MPI_Isend(&vec_len,1,HYPRE_MPI_INT, recv_procs[i],0,comm,&requests[j++]); + vec_len = recv_vec_starts[i + 1] - recv_vec_starts[i]; + hypre_MPI_Isend(&vec_len, 1, HYPRE_MPI_INT, recv_procs[i], 0, comm, &requests[j++]); } - hypre_MPI_Waitall(j,requests,status); + hypre_MPI_Waitall(j, requests, status); send_map_starts[0] = 0; - for (i=0; i < num_sends; i++) - send_map_starts[i+1] += send_map_starts[i]; + for (i = 0; i < num_sends; i++) + { + send_map_starts[i + 1] += send_map_starts[i]; + } send_map_elmts = hypre_CTAlloc(HYPRE_Int, send_map_starts[num_sends], HYPRE_MEMORY_HOST); send_big_elmts = hypre_CTAlloc(HYPRE_BigInt, send_map_starts[num_sends], HYPRE_MEMORY_HOST); j = 0; - for (i=0; i < num_sends; i++) + for (i = 0; i < num_sends; i++) { vec_start = send_map_starts[i]; - vec_len = send_map_starts[i+1]-vec_start; - hypre_MPI_Irecv(&send_big_elmts[vec_start],vec_len,HYPRE_MPI_BIG_INT, - send_procs[i],0,comm,&requests[j++]); + vec_len = send_map_starts[i + 1] - vec_start; + hypre_MPI_Irecv(&send_big_elmts[vec_start], vec_len, HYPRE_MPI_BIG_INT, + send_procs[i], 0, comm, &requests[j++]); } - for (i=0; i < num_recvs; i++) + for (i = 0; i < num_recvs; i++) { vec_start = recv_vec_starts[i]; - vec_len = recv_vec_starts[i+1] - vec_start; - hypre_MPI_Isend(&col_map_offd[vec_start],vec_len,HYPRE_MPI_BIG_INT, - recv_procs[i],0,comm,&requests[j++]); + vec_len = recv_vec_starts[i + 1] - vec_start; + hypre_MPI_Isend(&col_map_offd[vec_start], vec_len, HYPRE_MPI_BIG_INT, + recv_procs[i], 0, comm, &requests[j++]); } - hypre_MPI_Waitall(j,requests,status); - - for (i=0; i < send_map_starts[num_sends]; i++) - send_map_elmts[i] = (HYPRE_Int)(send_big_elmts[i]-first_col_diag); + hypre_MPI_Waitall(j, requests, status); - comm_pkg = hypre_CTAlloc(hypre_ParCSRCommPkg, 1, HYPRE_MEMORY_HOST); + for (i = 0; i < send_map_starts[num_sends]; i++) + { + send_map_elmts[i] = (HYPRE_Int)(send_big_elmts[i] - first_col_diag); + } - hypre_ParCSRCommPkgComm(comm_pkg) = comm; - hypre_ParCSRCommPkgNumSends(comm_pkg) = num_sends; - hypre_ParCSRCommPkgNumRecvs(comm_pkg) = num_recvs; - hypre_ParCSRCommPkgSendProcs(comm_pkg) = send_procs; - hypre_ParCSRCommPkgRecvProcs(comm_pkg) = recv_procs; - hypre_ParCSRCommPkgRecvVecStarts(comm_pkg) = recv_vec_starts; - hypre_ParCSRCommPkgSendMapStarts(comm_pkg) = send_map_starts; - hypre_ParCSRCommPkgSendMapElmts(comm_pkg) = send_map_elmts; + /* Create and fill communication package */ + hypre_ParCSRCommPkgCreateAndFill(comm, + num_recvs, recv_procs, recv_vec_starts, + num_sends, send_procs, send_map_starts, + send_map_elmts, + &comm_pkg); hypre_TFree(status, HYPRE_MEMORY_HOST); hypre_TFree(requests, HYPRE_MEMORY_HOST); hypre_TFree(send_big_elmts, HYPRE_MEMORY_HOST); hypre_ParCSRMatrixCommPkg(A) = comm_pkg; - return 0; + + return hypre_error_flag; } diff --git a/external/hypre/src/parcsr_ls/par_relax.c b/external/hypre/src/parcsr_ls/par_relax.c index 13255f94..4b94bb54 100644 --- a/external/hypre/src/parcsr_ls/par_relax.c +++ b/external/hypre/src/parcsr_ls/par_relax.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -19,6 +19,7 @@ /*-------------------------------------------------------------------------- * hypre_BoomerAMGRelax *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_BoomerAMGRelax( hypre_ParCSRMatrix *A, hypre_ParVector *f, @@ -47,9 +48,9 @@ hypre_BoomerAMGRelax( hypre_ParCSRMatrix *A, * relax_type = 5 -> hybrid: GS-J mix off-processor, chaotic GS on-node * relax_type = 6 -> hybrid: SSOR-J mix off-processor, SSOR on-processor * with outer relaxation parameters - * relax_type = 7 -> Jacobi (uses Matvec), only needed in CGNR [GPU-supported, CF supported with redundant computation] - * relax_type = 8 -> hybrid L1 Symm. Gauss-Seidel - * relax_type = 9 -> Direct solve, Gaussian elimination + * relax_type = 7 -> Jacobi (uses Matvec), only needed in CGNR + * [GPU-supported, CF supported with redundant computation] + * relax_type = 8 -> hybrid L1 Symm. Gauss-Seidel (SSOR) * relax_type = 10 -> On-processor direct forward solve for matrices with * triangular structure (indices need not be ordered * triangular) @@ -64,19 +65,17 @@ hypre_BoomerAMGRelax( hypre_ParCSRMatrix *A, * relax_type = 16 -> Scaled Chebyshev * relax_type = 17 -> FCF-Jacobi * relax_type = 18 -> L1-Jacobi [GPU-supported through call to relax7Jacobi] - * relax_type = 19 -> Direct Solve, (old version) - * relax_type = 20 -> Kaczmarz - * relax_type = 29 -> Direct solve: use gaussian elimination & BLAS - * (with pivoting) (old version) - * relax_type = 98 -> Direct solve, Gaussian elimination - * relax_type = 99 -> Direct solve, Gaussian elimination - * relax_type = 199-> Direct solve, Gaussian elimination + * relax_type = 21 -> the same as 8 except forcing serialization on CPU (#OMP-thread = 1) + * relax_type = 30 -> Kaczmarz + * relax_type = 88 -> convergent version of SSOR (option 8) + * relax_type = 89 -> L1 Symm. hybrid Gauss-Seidel *-------------------------------------------------------------------------------------*/ switch (relax_type) { case 0: /* Weighted Jacobi */ - hypre_BoomerAMGRelax0WeightedJacobi(A, f, cf_marker, relax_points, relax_weight, u, Vtemp); + hypre_BoomerAMGRelax0WeightedJacobi(A, f, cf_marker, relax_points, + relax_weight, u, Vtemp); break; case 1: /* Gauss-Seidel VERY SLOW */ @@ -87,13 +86,16 @@ hypre_BoomerAMGRelax( hypre_ParCSRMatrix *A, hypre_BoomerAMGRelax2GaussSeidel(A, f, cf_marker, relax_points, u); break; - /* Hybrid: Jacobi off-processor, Gauss-Seidel on-processor (forward loop) */ - case 3: - hypre_BoomerAMGRelax3HybridGaussSeidel(A, f, cf_marker, relax_points, relax_weight, omega, u, Vtemp, Ztemp); + case 3: /* Hybrid: Jacobi off-processor, Gauss-Seidel on-processor (forward loop) */ + hypre_BoomerAMGRelax3HybridGaussSeidel(A, f, cf_marker, relax_points, + relax_weight, omega, u, Vtemp, + Ztemp); break; case 4: /* Hybrid: Jacobi off-processor, Gauss-Seidel/SOR on-processor (backward loop) */ - hypre_BoomerAMGRelax4HybridGaussSeidel(A, f, cf_marker, relax_points, relax_weight, omega, u, Vtemp, Ztemp); + hypre_BoomerAMGRelax4HybridGaussSeidel(A, f, cf_marker, relax_points, + relax_weight, omega, u, Vtemp, + Ztemp); break; case 5: /* Hybrid: Jacobi off-processor, chaotic Gauss-Seidel on-processor */ @@ -101,58 +103,79 @@ hypre_BoomerAMGRelax( hypre_ParCSRMatrix *A, break; case 6: /* Hybrid: Jacobi off-processor, Symm. Gauss-Seidel/SSOR on-processor with outer relaxation parameter */ - hypre_BoomerAMGRelax6HybridSSOR(A, f, cf_marker, relax_points, relax_weight, omega, u, Vtemp, Ztemp); + hypre_BoomerAMGRelax6HybridSSOR(A, f, cf_marker, relax_points, + relax_weight, omega, u, Vtemp, + Ztemp); break; case 7: /* Jacobi (uses ParMatvec) */ - hypre_BoomerAMGRelax7Jacobi(A, f, cf_marker, relax_points, relax_weight, l1_norms, u, Vtemp); + hypre_BoomerAMGRelax7Jacobi(A, f, cf_marker, relax_points, + relax_weight, l1_norms, u, Vtemp); break; - case 8: /* hybrid L1 Symm. Gauss-Seidel */ - hypre_BoomerAMGRelax8HybridL1SSOR(A, f, cf_marker, relax_points, relax_weight, omega, l1_norms, u, Vtemp, Ztemp); + case 8: /* L1 hybrid Symm. Gauss-Seidel */ + case 88: /* L1 hybrid Symm. Gauss-Seidel (with a convergent l1 term) */ + hypre_BoomerAMGRelax8HybridL1SSOR(A, f, cf_marker, relax_points, + relax_weight, omega, l1_norms, u, + Vtemp, Ztemp); break; - /* Hybrid: Jacobi off-processor, ordered Gauss-Seidel on-processor */ - case 10: - hypre_BoomerAMGRelax10TopoOrderedGaussSeidel(A, f, cf_marker, relax_points, relax_weight, omega, u, Vtemp, Ztemp); + case 10: /* Hybrid: Jacobi off-processor, ordered Gauss-Seidel on-processor */ + hypre_BoomerAMGRelax10TopoOrderedGaussSeidel(A, f, cf_marker, relax_points, + relax_weight, omega, u, + Vtemp, Ztemp); break; case 11: /* Two Stage Gauss Seidel. Forward sweep only */ - hypre_BoomerAMGRelax11TwoStageGaussSeidel(A, f, cf_marker, relax_points, relax_weight, omega, u, Vtemp, Ztemp); + hypre_BoomerAMGRelax11TwoStageGaussSeidel(A, f, cf_marker, relax_points, + relax_weight, omega, l1_norms, u, + Vtemp, Ztemp); break; case 12: /* Two Stage Gauss Seidel. Uses the diagonal matrix for the GS part */ - hypre_BoomerAMGRelax12TwoStageGaussSeidel(A, f, cf_marker, relax_points, relax_weight, omega, u, Vtemp, Ztemp); + hypre_BoomerAMGRelax12TwoStageGaussSeidel(A, f, cf_marker, relax_points, + relax_weight, omega, l1_norms, u, + Vtemp, Ztemp); break; case 13: /* hybrid L1 Gauss-Seidel forward solve */ - hypre_BoomerAMGRelax13HybridL1GaussSeidel(A, f, cf_marker, relax_points, relax_weight, omega, l1_norms, u, Vtemp, Ztemp); + hypre_BoomerAMGRelax13HybridL1GaussSeidel(A, f, cf_marker, relax_points, + relax_weight, omega, l1_norms, u, + Vtemp, Ztemp); break; case 14: /* hybrid L1 Gauss-Seidel backward solve */ - hypre_BoomerAMGRelax14HybridL1GaussSeidel(A, f, cf_marker, relax_points, relax_weight, omega, l1_norms, u, Vtemp, Ztemp); + hypre_BoomerAMGRelax14HybridL1GaussSeidel(A, f, cf_marker, relax_points, + relax_weight, omega, l1_norms, u, + Vtemp, Ztemp); break; case 18: /* weighted L1 Jacobi */ - hypre_BoomerAMGRelax18WeightedL1Jacobi(A, f, cf_marker, relax_points, relax_weight, l1_norms, u, Vtemp); - break; - - case 19: /* Direct solve: use gaussian elimination */ - relax_error = hypre_BoomerAMGRelax19GaussElim(A, f, u); + hypre_BoomerAMGRelax18WeightedL1Jacobi(A, f, cf_marker, relax_points, + relax_weight, l1_norms, u, + Vtemp); break; - case 20: /* Kaczmarz */ + case 30: /* Kaczmarz */ hypre_BoomerAMGRelaxKaczmarz(A, f, omega, l1_norms, u); break; - case 98: /* Direct solve: use gaussian elimination & BLAS (with pivoting) */ - relax_error = hypre_BoomerAMGRelax98GaussElimPivot(A, f, u); + case 89: /* L1 Symm. hybrid Gauss-Seidel */ + hypre_BoomerAMGRelax89HybridL1SSOR(A, f, cf_marker, relax_points, + relax_weight, omega, l1_norms, u, + Vtemp, Ztemp); break; } + hypre_ParVectorAllZeros(u) = 0; + return relax_error; } +/*-------------------------------------------------------------------- + * hypre_BoomerAMGRelaxWeightedJacobi_core + *--------------------------------------------------------------------*/ + HYPRE_Int hypre_BoomerAMGRelaxWeightedJacobi_core( hypre_ParCSRMatrix *A, hypre_ParVector *f, @@ -190,7 +213,15 @@ hypre_BoomerAMGRelaxWeightedJacobi_core( hypre_ParCSRMatrix *A, HYPRE_Complex res; HYPRE_Int num_procs, my_id, i, j, ii, jj, index, num_sends, start; - hypre_ParCSRCommHandle *comm_handle; + hypre_ParCSRCommHandle *comm_handle = NULL; + + /* Sanity check */ + if (hypre_ParVectorNumVectors(f) > 1) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "Jacobi relaxation doesn't support multicomponent vectors"); + return hypre_error_flag; + } hypre_MPI_Comm_size(comm, &num_procs); hypre_MPI_Comm_rank(comm, &my_id); @@ -198,14 +229,15 @@ hypre_BoomerAMGRelaxWeightedJacobi_core( hypre_ParCSRMatrix *A, if (num_procs > 1) { num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - v_buf_data = hypre_CTAlloc(HYPRE_Real, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), HYPRE_MEMORY_HOST); + v_buf_data = hypre_CTAlloc(HYPRE_Real, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); v_ext_data = hypre_CTAlloc(HYPRE_Real, num_cols_offd, HYPRE_MEMORY_HOST); index = 0; for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { v_buf_data[index++] = u_data[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } @@ -218,7 +250,7 @@ hypre_BoomerAMGRelaxWeightedJacobi_core( hypre_ParCSRMatrix *A, * Copy current approximation into temporary vector. *-----------------------------------------------------------------*/ #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < num_rows; i++) { @@ -235,7 +267,7 @@ hypre_BoomerAMGRelaxWeightedJacobi_core( hypre_ParCSRMatrix *A, * Relax all points. *-----------------------------------------------------------------*/ #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,ii,jj,res) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,ii,jj,res) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < num_rows; i++) { @@ -249,12 +281,12 @@ hypre_BoomerAMGRelaxWeightedJacobi_core( hypre_ParCSRMatrix *A, if ( (relax_points == 0 || cf_marker[i] == relax_points) && di != zero ) { res = f_data[i]; - for (jj = A_diag_i[i] + Skip_diag; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + Skip_diag; jj < A_diag_i[i + 1]; jj++) { ii = A_diag_j[jj]; res -= A_diag_data[jj] * Vtemp_data[ii]; } - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { ii = A_offd_j[jj]; res -= A_offd_data[jj] * v_ext_data[ii]; @@ -281,6 +313,10 @@ hypre_BoomerAMGRelaxWeightedJacobi_core( hypre_ParCSRMatrix *A, return hypre_error_flag; } +/*-------------------------------------------------------------------- + * hypre_BoomerAMGRelax0WeightedJacobi + *--------------------------------------------------------------------*/ + HYPRE_Int hypre_BoomerAMGRelax0WeightedJacobi( hypre_ParCSRMatrix *A, hypre_ParVector *f, @@ -290,9 +326,14 @@ hypre_BoomerAMGRelax0WeightedJacobi( hypre_ParCSRMatrix *A, hypre_ParVector *u, hypre_ParVector *Vtemp ) { - return hypre_BoomerAMGRelaxWeightedJacobi_core(A, f, cf_marker, relax_points, relax_weight, NULL, u, Vtemp, 1); + return hypre_BoomerAMGRelaxWeightedJacobi_core(A, f, cf_marker, relax_points, relax_weight, NULL, u, + Vtemp, 1); } +/*-------------------------------------------------------------------- + * hypre_BoomerAMGRelax18WeightedL1Jacobi + *--------------------------------------------------------------------*/ + HYPRE_Int hypre_BoomerAMGRelax18WeightedL1Jacobi( hypre_ParCSRMatrix *A, hypre_ParVector *f, @@ -303,10 +344,9 @@ hypre_BoomerAMGRelax18WeightedL1Jacobi( hypre_ParCSRMatrix *A, hypre_ParVector *u, hypre_ParVector *Vtemp ) { -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - //HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy2( hypre_ParCSRMatrixMemoryLocation(A), hypre_VectorMemoryLocation(f) ); - //RL: TODO back to hypre_GetExecPolicy2 later - HYPRE_ExecutionPolicy exec = HYPRE_EXEC_DEVICE; +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy2( hypre_ParCSRMatrixMemoryLocation(A), + hypre_ParVectorMemoryLocation(f) ); if (exec == HYPRE_EXEC_DEVICE) { // XXX GPU calls Relax7 XXX @@ -322,11 +362,16 @@ hypre_BoomerAMGRelax18WeightedL1Jacobi( hypre_ParCSRMatrix *A, } else { - return hypre_BoomerAMGRelaxWeightedJacobi_core(A, f, cf_marker, relax_points, relax_weight, l1_norms, u, Vtemp, 0); + return hypre_BoomerAMGRelaxWeightedJacobi_core(A, f, cf_marker, relax_points, relax_weight, + l1_norms, u, Vtemp, 0); } } } +/*-------------------------------------------------------------------- + * hypre_BoomerAMGRelax1GaussSeidel + *--------------------------------------------------------------------*/ + HYPRE_Int hypre_BoomerAMGRelax1GaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, @@ -355,9 +400,20 @@ hypre_BoomerAMGRelax1GaussSeidel( hypre_ParCSRMatrix *A, HYPRE_Complex zero = 0.0; HYPRE_Complex res; - HYPRE_Int num_procs, my_id, i, j, ii, jj, p, jr, ip, num_sends, num_recvs, vec_start, vec_len; - hypre_MPI_Status *status; - hypre_MPI_Request *requests; + hypre_MPI_Status *status = NULL; + hypre_MPI_Request *requests = NULL; + HYPRE_Int num_procs, my_id, i, j, ii, jj, p, jr, ip; + HYPRE_Int vec_start, vec_len; + HYPRE_Int num_sends = 0; + HYPRE_Int num_recvs = 0; + + /* Sanity check */ + if (hypre_ParVectorNumVectors(f) > 1) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "GS (1) relaxation doesn't support multicomponent vectors"); + return hypre_error_flag; + } hypre_MPI_Comm_size(comm, &num_procs); hypre_MPI_Comm_rank(comm, &my_id); @@ -367,11 +423,13 @@ hypre_BoomerAMGRelax1GaussSeidel( hypre_ParCSRMatrix *A, num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); num_recvs = hypre_ParCSRCommPkgNumRecvs(comm_pkg); - v_buf_data = hypre_CTAlloc(HYPRE_Real, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), HYPRE_MEMORY_HOST); - v_ext_data = hypre_CTAlloc(HYPRE_Real, num_cols_offd, HYPRE_MEMORY_HOST); + v_buf_data = hypre_CTAlloc(HYPRE_Complex, + hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); + v_ext_data = hypre_CTAlloc(HYPRE_Complex, num_cols_offd, HYPRE_MEMORY_HOST); - status = hypre_CTAlloc(hypre_MPI_Status, num_recvs+num_sends, HYPRE_MEMORY_HOST); - requests = hypre_CTAlloc(hypre_MPI_Request, num_recvs+num_sends, HYPRE_MEMORY_HOST); + status = hypre_CTAlloc(hypre_MPI_Status, num_recvs + num_sends, HYPRE_MEMORY_HOST); + requests = hypre_CTAlloc(hypre_MPI_Request, num_recvs + num_sends, HYPRE_MEMORY_HOST); } /*----------------------------------------------------------------- @@ -388,12 +446,13 @@ hypre_BoomerAMGRelax1GaussSeidel( hypre_ParCSRMatrix *A, if (ip == p) { vec_start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - vec_len = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1) - vec_start; - for (j = vec_start; j < vec_start+vec_len; j++) + vec_len = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1) - vec_start; + for (j = vec_start; j < vec_start + vec_len; j++) { - v_buf_data[j] = u_data[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + v_buf_data[j] = u_data[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } - hypre_MPI_Isend(&v_buf_data[vec_start], vec_len, HYPRE_MPI_REAL, ip, 0, comm, &requests[jr++]); + hypre_MPI_Isend(&v_buf_data[vec_start], vec_len, HYPRE_MPI_COMPLEX, ip, 0, + comm, &requests[jr++]); } } hypre_MPI_Waitall(jr, requests, status); @@ -406,9 +465,10 @@ hypre_BoomerAMGRelax1GaussSeidel( hypre_ParCSRMatrix *A, for (i = 0; i < num_recvs; i++) { ip = hypre_ParCSRCommPkgRecvProc(comm_pkg, i); - vec_start = hypre_ParCSRCommPkgRecvVecStart(comm_pkg,i); - vec_len = hypre_ParCSRCommPkgRecvVecStart(comm_pkg,i+1) - vec_start; - hypre_MPI_Irecv(&v_ext_data[vec_start], vec_len, HYPRE_MPI_REAL, ip, 0, comm, &requests[jr++]); + vec_start = hypre_ParCSRCommPkgRecvVecStart(comm_pkg, i); + vec_len = hypre_ParCSRCommPkgRecvVecStart(comm_pkg, i + 1) - vec_start; + hypre_MPI_Irecv(&v_ext_data[vec_start], vec_len, HYPRE_MPI_COMPLEX, ip, 0, + comm, &requests[jr++]); } hypre_MPI_Waitall(jr, requests, status); } @@ -420,15 +480,16 @@ hypre_BoomerAMGRelax1GaussSeidel( hypre_ParCSRMatrix *A, * nonzero, relax point i; otherwise, skip it. * Relax only C or F points as determined by relax_points. *-----------------------------------------------------------*/ - if ( (relax_points == 0 || cf_marker[i] == relax_points) && A_diag_data[A_diag_i[i]] != zero ) + if ( (relax_points == 0 || cf_marker[i] == relax_points) && + A_diag_data[A_diag_i[i]] != zero ) { res = f_data[i]; - for (jj = A_diag_i[i] + 1; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) { ii = A_diag_j[jj]; res -= A_diag_data[jj] * u_data[ii]; } - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { ii = A_offd_j[jj]; res -= A_offd_data[jj] * v_ext_data[ii]; @@ -455,6 +516,10 @@ hypre_BoomerAMGRelax1GaussSeidel( hypre_ParCSRMatrix *A, return hypre_error_flag; } +/*-------------------------------------------------------------------- + * hypre_BoomerAMGRelax2GaussSeidel + *--------------------------------------------------------------------*/ + HYPRE_Int hypre_BoomerAMGRelax2GaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, @@ -483,9 +548,20 @@ hypre_BoomerAMGRelax2GaussSeidel( hypre_ParCSRMatrix *A, HYPRE_Complex zero = 0.0; HYPRE_Complex res; - HYPRE_Int num_procs, my_id, i, j, ii, jj, p, jr, ip, num_sends, num_recvs, vec_start, vec_len; - hypre_MPI_Status *status; - hypre_MPI_Request *requests; + HYPRE_Int num_procs, my_id, i, j, ii, jj, p, jr, ip; + HYPRE_Int num_sends = 0; + HYPRE_Int num_recvs = 0; + HYPRE_Int vec_start, vec_len; + hypre_MPI_Status *status = NULL; + hypre_MPI_Request *requests = NULL; + + /* Sanity check */ + if (hypre_ParVectorNumVectors(f) > 1) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "GS (2) relaxation doesn't support multicomponent vectors"); + return hypre_error_flag; + } hypre_MPI_Comm_size(comm, &num_procs); hypre_MPI_Comm_rank(comm, &my_id); @@ -495,27 +571,31 @@ hypre_BoomerAMGRelax2GaussSeidel( hypre_ParCSRMatrix *A, num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); num_recvs = hypre_ParCSRCommPkgNumRecvs(comm_pkg); - v_buf_data = hypre_CTAlloc(HYPRE_Real, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), HYPRE_MEMORY_HOST); - v_ext_data = hypre_CTAlloc(HYPRE_Real, num_cols_offd, HYPRE_MEMORY_HOST); + v_buf_data = hypre_CTAlloc(HYPRE_Complex, + hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); + v_ext_data = hypre_CTAlloc(HYPRE_Complex, num_cols_offd, HYPRE_MEMORY_HOST); - status = hypre_CTAlloc(hypre_MPI_Status, num_recvs+num_sends, HYPRE_MEMORY_HOST); - requests = hypre_CTAlloc(hypre_MPI_Request, num_recvs+num_sends, HYPRE_MEMORY_HOST); + status = hypre_CTAlloc(hypre_MPI_Status, num_recvs + num_sends, HYPRE_MEMORY_HOST); + requests = hypre_CTAlloc(hypre_MPI_Request, num_recvs + num_sends, HYPRE_MEMORY_HOST); } /*----------------------------------------------------------------- * Relax interior points first *-----------------------------------------------------------------*/ + for (i = 0; i < num_rows; i++) { /*----------------------------------------------------------- * If i is of the right type ( C or F or All ) and diagonal is * nonzero, relax point i; otherwise, skip it. *-----------------------------------------------------------*/ - if ( (relax_points == 0 || cf_marker[i] == relax_points) && A_offd_i[i+1] - A_offd_i[i] == zero && - A_diag_data[A_diag_i[i]] != zero ) + if ( (relax_points == 0 || cf_marker[i] == relax_points) && + (A_offd_i[i + 1] - A_offd_i[i] == zero) && + (A_diag_data[A_diag_i[i]] != zero) ) { res = f_data[i]; - for (jj = A_diag_i[i] + 1; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) { ii = A_diag_j[jj]; res -= A_diag_data[jj] * u_data[ii]; @@ -535,12 +615,13 @@ hypre_BoomerAMGRelax2GaussSeidel( hypre_ParCSRMatrix *A, if (ip == p) { vec_start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - vec_len = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1) - vec_start; - for (j = vec_start; j < vec_start+vec_len; j++) + vec_len = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1) - vec_start; + for (j = vec_start; j < vec_start + vec_len; j++) { - v_buf_data[j] = u_data[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + v_buf_data[j] = u_data[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } - hypre_MPI_Isend(&v_buf_data[vec_start], vec_len, HYPRE_MPI_REAL, ip, 0, comm, &requests[jr++]); + hypre_MPI_Isend(&v_buf_data[vec_start], vec_len, HYPRE_MPI_COMPLEX, ip, 0, + comm, &requests[jr++]); } } hypre_MPI_Waitall(jr, requests, status); @@ -553,12 +634,14 @@ hypre_BoomerAMGRelax2GaussSeidel( hypre_ParCSRMatrix *A, for (i = 0; i < num_recvs; i++) { ip = hypre_ParCSRCommPkgRecvProc(comm_pkg, i); - vec_start = hypre_ParCSRCommPkgRecvVecStart(comm_pkg,i); - vec_len = hypre_ParCSRCommPkgRecvVecStart(comm_pkg,i+1) - vec_start; - hypre_MPI_Irecv(&v_ext_data[vec_start], vec_len, HYPRE_MPI_REAL, ip, 0, comm, &requests[jr++]); + vec_start = hypre_ParCSRCommPkgRecvVecStart(comm_pkg, i); + vec_len = hypre_ParCSRCommPkgRecvVecStart(comm_pkg, i + 1) - vec_start; + hypre_MPI_Irecv(&v_ext_data[vec_start], vec_len, HYPRE_MPI_COMPLEX, ip, 0, + comm, &requests[jr++]); } hypre_MPI_Waitall(jr, requests, status); } + for (i = 0; i < num_rows; i++) { /*----------------------------------------------------------- @@ -566,16 +649,17 @@ hypre_BoomerAMGRelax2GaussSeidel( hypre_ParCSRMatrix *A, * nonzero, relax point i; otherwise, skip it. * Relax only C or F points as determined by relax_points. *-----------------------------------------------------------*/ - if ( (relax_points == 0 || cf_marker[i] == relax_points) && A_offd_i[i+1] - A_offd_i[i] != zero && - A_diag_data[A_diag_i[i]] != zero) + if ( (relax_points == 0 || cf_marker[i] == relax_points) && + (A_offd_i[i + 1] - A_offd_i[i] != zero) && + (A_diag_data[A_diag_i[i]] != zero) ) { res = f_data[i]; - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) { ii = A_diag_j[jj]; res -= A_diag_data[jj] * u_data[ii]; } - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { ii = A_offd_j[jj]; res -= A_offd_data[jj] * v_ext_data[ii]; @@ -600,6 +684,10 @@ hypre_BoomerAMGRelax2GaussSeidel( hypre_ParCSRMatrix *A, return hypre_error_flag; } +/*-------------------------------------------------------------------- + * hypre_BoomerAMGRelaxHybridGaussSeidel_core + *--------------------------------------------------------------------*/ + HYPRE_Int hypre_BoomerAMGRelaxHybridGaussSeidel_core( hypre_ParCSRMatrix *A, hypre_ParVector *f, @@ -617,6 +705,8 @@ hypre_BoomerAMGRelaxHybridGaussSeidel_core( hypre_ParCSRMatrix *A, HYPRE_Int forced_seq, HYPRE_Int Topo_order ) { + HYPRE_UNUSED_VAR(Ztemp); + MPI_Comm comm = hypre_ParCSRMatrixComm(A); hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); HYPRE_Real *A_diag_data = hypre_CSRMatrixData(A_diag); @@ -628,7 +718,6 @@ hypre_BoomerAMGRelaxHybridGaussSeidel_core( hypre_ParCSRMatrix *A, HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); HYPRE_Int num_rows = hypre_CSRMatrixNumRows(A_diag); - HYPRE_Int num_cols_offd = hypre_CSRMatrixNumCols(A_offd); hypre_Vector *u_local = hypre_ParVectorLocalVector(u); HYPRE_Complex *u_data = hypre_VectorData(u_local); hypre_Vector *f_local = hypre_ParVectorLocalVector(f); @@ -646,12 +735,26 @@ hypre_BoomerAMGRelaxHybridGaussSeidel_core( hypre_ParCSRMatrix *A, const HYPRE_Real one_minus_omega = 1.0 - omega; HYPRE_Int num_procs, my_id, num_threads, j, num_sends; - hypre_ParCSRCommHandle *comm_handle; +#if defined(HYPRE_USING_PERSISTENT_COMM) + // JSP: persistent comm can be similarly used for other smoothers + hypre_ParCSRPersistentCommHandle *persistent_comm_handle; +#else + hypre_ParCSRCommHandle *comm_handle; + HYPRE_Int num_cols_offd = hypre_CSRMatrixNumCols(A_offd); +#endif hypre_MPI_Comm_size(comm, &num_procs); hypre_MPI_Comm_rank(comm, &my_id); num_threads = forced_seq ? 1 : hypre_NumThreads(); + /* Sanity check */ + if (hypre_ParVectorNumVectors(f) > 1) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "Hybrid GS relaxation doesn't support multicomponent vectors"); + return hypre_error_flag; + } + /* GS order: forward or backward */ const HYPRE_Int gs_order = GS_order > 0 ? 1 : -1; /* for symmetric GS, a forward followed by a backward */ @@ -669,11 +772,6 @@ hypre_BoomerAMGRelaxHybridGaussSeidel_core( hypre_ParCSRMatrix *A, } */ -#if defined(HYPRE_USING_PERSISTENT_COMM) - // JSP: persistent comm can be similarly used for other smoothers - hypre_ParCSRPersistentCommHandle *persistent_comm_handle; -#endif - if (num_procs > 1) { #ifdef HYPRE_PROFILE @@ -691,16 +789,18 @@ hypre_BoomerAMGRelaxHybridGaussSeidel_core( hypre_ParCSRMatrix *A, #if defined(HYPRE_USING_PERSISTENT_COMM) persistent_comm_handle = hypre_ParCSRCommPkgGetPersistentCommHandle(1, comm_pkg); v_buf_data = (HYPRE_Real *) hypre_ParCSRCommHandleSendDataBuffer(persistent_comm_handle); - v_ext_data = (HYPRE_Real *) hypre_ParCSRCommHandleRecvDataBuffer(persistent_comm_handle); + v_ext_data = (HYPRE_Real *) hypre_ParCSRCommHandleRecvDataBuffer(persistent_comm_handle); #else - v_buf_data = hypre_CTAlloc(HYPRE_Real, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), HYPRE_MEMORY_HOST); + v_buf_data = hypre_CTAlloc(HYPRE_Real, + hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); v_ext_data = hypre_CTAlloc(HYPRE_Real, num_cols_offd, HYPRE_MEMORY_HOST); #endif HYPRE_Int begin = hypre_ParCSRCommPkgSendMapStart(comm_pkg, 0); HYPRE_Int end = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for HYPRE_SMP_SCHEDULE + #pragma omp parallel for HYPRE_SMP_SCHEDULE #endif for (j = begin; j < end; j++) { @@ -723,7 +823,6 @@ hypre_BoomerAMGRelaxHybridGaussSeidel_core( hypre_ParCSRMatrix *A, #else hypre_ParCSRCommHandleDestroy(comm_handle); #endif - comm_handle = NULL; #ifdef HYPRE_PROFILE hypre_profile_times[HYPRE_TIMER_ID_HALO_EXCHANGE] += hypre_MPI_Wtime(); @@ -758,7 +857,7 @@ hypre_BoomerAMGRelaxHybridGaussSeidel_core( hypre_ParCSRMatrix *A, if ( (num_threads > 1 || !non_scale) && Vtemp_data ) { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(j) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(j) HYPRE_SMP_SCHEDULE #endif for (j = 0; j < num_rows; j++) { @@ -769,7 +868,7 @@ hypre_BoomerAMGRelaxHybridGaussSeidel_core( hypre_ParCSRMatrix *A, if (num_threads > 1) { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(j) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(j) HYPRE_SMP_SCHEDULE #endif for (j = 0; j < num_threads; j++) { @@ -845,7 +944,12 @@ hypre_BoomerAMGRelaxHybridGaussSeidel_core( hypre_ParCSRMatrix *A, return hypre_error_flag; } -/* forward hybrid G-S */ +/*-------------------------------------------------------------------- + * hypre_BoomerAMGRelax3HybridGaussSeidel + * + * forward hybrid GS + *--------------------------------------------------------------------*/ + HYPRE_Int hypre_BoomerAMGRelax3HybridGaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, @@ -857,37 +961,17 @@ hypre_BoomerAMGRelax3HybridGaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ) { -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - //HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy2( hypre_ParCSRMatrixMemoryLocation(A), hypre_VectorMemoryLocation(f) ); - //RL: TODO back to hypre_GetExecPolicy2 later - HYPRE_ExecutionPolicy exec = HYPRE_EXEC_DEVICE; - // TODO implement CF relax on GPUs - if (relax_points != 0) - { - exec = HYPRE_EXEC_HOST; - } - -#if defined(HYPRE_USING_GPU) - if (hypre_HandleDeviceGSMethod(hypre_handle()) == 0) - { - exec = HYPRE_EXEC_HOST; - } -#endif - - if (exec == HYPRE_EXEC_DEVICE) - { - return hypre_BoomerAMGRelaxHybridGaussSeidelDevice(A, f, cf_marker, relax_points, relax_weight, omega, NULL, u, Vtemp, Ztemp, - 1 /* forward */, 0 /* nonsymm */); - } - else -#endif - { - return hypre_BoomerAMGRelaxHybridGaussSeidel_core(A, f, cf_marker, relax_points, relax_weight, omega, NULL, u, Vtemp, Ztemp, - 1 /* forward */, 0 /* nonsymm */, 1 /* skip diag */, 0, 0); - } + return hypre_BoomerAMGRelaxHybridSOR(A, f, cf_marker, relax_points, relax_weight, + omega, NULL, u, Vtemp, Ztemp, + 1, 0, 1, 0); } -/* backward hybrid G-S */ +/*-------------------------------------------------------------------- + * hypre_BoomerAMGRelax4HybridGaussSeidel + * + * backward hybrid GS + *--------------------------------------------------------------------*/ + HYPRE_Int hypre_BoomerAMGRelax4HybridGaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, @@ -899,37 +983,17 @@ hypre_BoomerAMGRelax4HybridGaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ) { -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - //HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy2( hypre_ParCSRMatrixMemoryLocation(A), hypre_VectorMemoryLocation(f) ); - //RL: TODO back to hypre_GetExecPolicy2 later - HYPRE_ExecutionPolicy exec = HYPRE_EXEC_DEVICE; - // TODO implement CF relax on GPUs - if (relax_points != 0) - { - exec = HYPRE_EXEC_HOST; - } - -#if defined(HYPRE_USING_GPU) - if (hypre_HandleDeviceGSMethod(hypre_handle()) == 0) - { - exec = HYPRE_EXEC_HOST; - } -#endif - - if (exec == HYPRE_EXEC_DEVICE) - { - return hypre_BoomerAMGRelaxHybridGaussSeidelDevice(A, f, cf_marker, relax_points, relax_weight, omega, NULL, u, Vtemp, Ztemp, - -1 /* backward */, 0 /* nonsymm */); - } - else -#endif - { - return hypre_BoomerAMGRelaxHybridGaussSeidel_core(A, f, cf_marker, relax_points, relax_weight, omega, NULL, u, Vtemp, Ztemp, - -1 /* backward */, 0 /* nosymm */, 1 /* skip diag */, 0, 0); - } + return hypre_BoomerAMGRelaxHybridSOR(A, f, cf_marker, relax_points, relax_weight, + omega, NULL, u, Vtemp, Ztemp, + -1, 0, 1, 0); } -/* chaotic forward G-S */ +/*-------------------------------------------------------------------- + * hypre_BoomerAMGRelax5ChaoticHybridGaussSeidel + * + * chaotic forward GS + *--------------------------------------------------------------------*/ + HYPRE_Int hypre_BoomerAMGRelax5ChaoticHybridGaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, @@ -962,22 +1026,31 @@ hypre_BoomerAMGRelax5ChaoticHybridGaussSeidel( hypre_ParCSRMatrix *A, HYPRE_Int num_procs, my_id, i, j, ii, jj, index, num_sends, start; hypre_ParCSRCommHandle *comm_handle; + /* Sanity check */ + if (hypre_ParVectorNumVectors(f) > 1) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "Chaotic GS relaxation doesn't support multicomponent vectors"); + return hypre_error_flag; + } + hypre_MPI_Comm_size(comm, &num_procs); hypre_MPI_Comm_rank(comm, &my_id); if (num_procs > 1) { num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - v_buf_data = hypre_CTAlloc(HYPRE_Real, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), HYPRE_MEMORY_HOST); + v_buf_data = hypre_CTAlloc(HYPRE_Real, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); v_ext_data = hypre_CTAlloc(HYPRE_Real, num_cols_offd, HYPRE_MEMORY_HOST); index = 0; for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg,i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { - v_buf_data[index++] = u_data[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + v_buf_data[index++] = u_data[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } } @@ -991,7 +1064,7 @@ hypre_BoomerAMGRelax5ChaoticHybridGaussSeidel( hypre_ParCSRMatrix *A, } #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,ii,jj,res) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,ii,jj,res) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < num_rows; i++) { @@ -1003,12 +1076,12 @@ hypre_BoomerAMGRelax5ChaoticHybridGaussSeidel( hypre_ParCSRMatrix *A, if ( (relax_points == 0 || cf_marker[i] == relax_points) && A_diag_data[A_diag_i[i]] != zero ) { res = f_data[i]; - for (jj = A_diag_i[i] + 1; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) { ii = A_diag_j[jj]; res -= A_diag_data[jj] * u_data[ii]; } - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { ii = A_offd_j[jj]; res -= A_offd_data[jj] * v_ext_data[ii]; @@ -1026,48 +1099,81 @@ hypre_BoomerAMGRelax5ChaoticHybridGaussSeidel( hypre_ParCSRMatrix *A, return hypre_error_flag; } -/* symmetric hybrid G-S */ +/*-------------------------------------------------------------------- + * hypre_BoomerAMGRelaxHybridSOR + * + * symmetric hybrid SOR + *--------------------------------------------------------------------*/ + HYPRE_Int -hypre_BoomerAMGRelax6HybridSSOR( hypre_ParCSRMatrix *A, - hypre_ParVector *f, - HYPRE_Int *cf_marker, - HYPRE_Int relax_points, - HYPRE_Real relax_weight, - HYPRE_Real omega, - hypre_ParVector *u, - hypre_ParVector *Vtemp, - hypre_ParVector *Ztemp ) +hypre_BoomerAMGRelaxHybridSOR( hypre_ParCSRMatrix *A, + hypre_ParVector *f, + HYPRE_Int *cf_marker, + HYPRE_Int relax_points, + HYPRE_Real relax_weight, + HYPRE_Real omega, + HYPRE_Real *l1_norms, + hypre_ParVector *u, + hypre_ParVector *Vtemp, + hypre_ParVector *Ztemp, + HYPRE_Int direction, + HYPRE_Int symm, + HYPRE_Int skip_diag, + HYPRE_Int force_seq ) { -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - //HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy2( hypre_ParCSRMatrixMemoryLocation(A), hypre_VectorMemoryLocation(f) ); - //RL: TODO back to hypre_GetExecPolicy2 later - HYPRE_ExecutionPolicy exec = HYPRE_EXEC_DEVICE; +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy2( hypre_ParCSRMatrixMemoryLocation(A), + hypre_ParVectorMemoryLocation(f) ); + // TODO implement CF relax on GPUs if (relax_points != 0) { exec = HYPRE_EXEC_HOST; } -#if defined(HYPRE_USING_GPU) if (hypre_HandleDeviceGSMethod(hypre_handle()) == 0) { exec = HYPRE_EXEC_HOST; } -#endif if (exec == HYPRE_EXEC_DEVICE) { - return hypre_BoomerAMGRelaxHybridGaussSeidelDevice(A, f, cf_marker, relax_points, relax_weight, omega, NULL, u, Vtemp, Ztemp, - 1, 1 /* symm */); + return hypre_BoomerAMGRelaxHybridGaussSeidelDevice(A, f, cf_marker, relax_points, relax_weight, + omega, l1_norms, u, Vtemp, Ztemp, + direction, symm); } else #endif { - return hypre_BoomerAMGRelaxHybridGaussSeidel_core(A, f, cf_marker, relax_points, relax_weight, omega, NULL, u, Vtemp, Ztemp, - 1, 1 /* symm */, 1 /* skip diag */, 0, 0); + return hypre_BoomerAMGRelaxHybridGaussSeidel_core(A, f, cf_marker, relax_points, relax_weight, + omega, l1_norms, u, Vtemp, Ztemp, + direction, symm, skip_diag, force_seq, 0); } } +/*-------------------------------------------------------------------- + * hypre_BoomerAMGRelax6HybridSSOR + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGRelax6HybridSSOR( hypre_ParCSRMatrix *A, + hypre_ParVector *f, + HYPRE_Int *cf_marker, + HYPRE_Int relax_points, + HYPRE_Real relax_weight, + HYPRE_Real omega, + hypre_ParVector *u, + hypre_ParVector *Vtemp, + hypre_ParVector *Ztemp ) +{ + return hypre_BoomerAMGRelaxHybridSOR(A, f, cf_marker, relax_points, relax_weight, + omega, NULL, u, Vtemp, Ztemp, 1, 1, 1, 0); +} + +/*-------------------------------------------------------------------- + * hypre_BoomerAMGRelax7Jacobi + *--------------------------------------------------------------------*/ + HYPRE_Int hypre_BoomerAMGRelax7Jacobi( hypre_ParCSRMatrix *A, hypre_ParVector *f, @@ -1082,8 +1188,14 @@ hypre_BoomerAMGRelax7Jacobi( hypre_ParCSRMatrix *A, hypre_Vector l1_norms_vec; hypre_ParVector l1_norms_parvec; + hypre_GpuProfilingPushRange("Relax7Jacobi"); + + hypre_VectorNumVectors(&l1_norms_vec) = 1; + hypre_VectorMultiVecStorageMethod(&l1_norms_vec) = 0; + hypre_VectorOwnsData(&l1_norms_vec) = 0; hypre_VectorData(&l1_norms_vec) = l1_norms; hypre_VectorSize(&l1_norms_vec) = num_rows; + /* TODO XXX * The next line is NOT 100% correct, which should be the memory location of l1_norms instead of f * But how do I know it? As said, don't use raw pointers, don't use raw pointers! @@ -1092,7 +1204,7 @@ hypre_BoomerAMGRelax7Jacobi( hypre_ParCSRMatrix *A, hypre_VectorMemoryLocation(&l1_norms_vec) = hypre_ParVectorMemoryLocation(f); hypre_ParVectorLocalVector(&l1_norms_parvec) = &l1_norms_vec; -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) HYPRE_Int sync_stream; hypre_GetSyncCudaCompute(&sync_stream); hypre_SetSyncCudaCompute(0); @@ -1106,7 +1218,18 @@ hypre_BoomerAMGRelax7Jacobi( hypre_ParCSRMatrix *A, /*----------------------------------------------------------------- * Perform Matvec Vtemp = w * (f - Au) *-----------------------------------------------------------------*/ - hypre_ParCSRMatrixMatvec(-relax_weight, A, u, relax_weight, Vtemp); + if (hypre_ParVectorAllZeros(u)) + { +#if defined(HYPRE_DEBUG) + hypre_assert(hypre_ParVectorInnerProd(u, u) == 0.0); + /*hypre_ParPrintf(hypre_ParCSRMatrixComm(A), "A %d: skip a matvec\n", hypre_ParCSRMatrixGlobalNumRows(A));*/ +#endif + hypre_ParVectorScale(relax_weight, Vtemp); + } + else + { + hypre_ParCSRMatrixMatvec(-relax_weight, A, u, relax_weight, Vtemp); + } /*----------------------------------------------------------------- * u += D^{-1} * Vtemp, where D_ii = ||A(i,:)||_1 @@ -1120,15 +1243,22 @@ hypre_BoomerAMGRelax7Jacobi( hypre_ParCSRMatrix *A, hypre_ParVectorElmdivpy(Vtemp, &l1_norms_parvec, u); } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) hypre_SetSyncCudaCompute(sync_stream); - hypre_SyncCudaComputeStream(hypre_handle()); + hypre_SyncComputeStream(); #endif + hypre_GpuProfilingPopRange(); + return hypre_error_flag; } -/* symmetric l1 hybrid G-S */ +/*-------------------------------------------------------------------- + * hypre_BoomerAMGRelax14HybridL1GaussSeidel + * + * l1 hybrid symmetric GS + *--------------------------------------------------------------------*/ + HYPRE_Int hypre_BoomerAMGRelax8HybridL1SSOR( hypre_ParCSRMatrix *A, hypre_ParVector *f, @@ -1143,37 +1273,43 @@ hypre_BoomerAMGRelax8HybridL1SSOR( hypre_ParCSRMatrix *A, { const HYPRE_Int skip_diag = relax_weight == 1.0 && omega == 1.0 ? 0 : 1; -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - //HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy2( hypre_ParCSRMatrixMemoryLocation(A), hypre_VectorMemoryLocation(f) ); - //RL: TODO back to hypre_GetExecPolicy2 later - HYPRE_ExecutionPolicy exec = HYPRE_EXEC_DEVICE; - // TODO implement CF relax on GPUs - if (relax_points != 0) - { - exec = HYPRE_EXEC_HOST; - } + return hypre_BoomerAMGRelaxHybridSOR(A, f, cf_marker, relax_points, relax_weight, + omega, l1_norms, u, Vtemp, Ztemp, 1, 1, skip_diag, 0); +} -#if defined(HYPRE_USING_GPU) - if (hypre_HandleDeviceGSMethod(hypre_handle()) == 0) - { - exec = HYPRE_EXEC_HOST; - } -#endif +/*-------------------------------------------------------------------- + * hypre_BoomerAMGRelax14HybridL1GaussSeidel + * + * l1 symmetric hybrid GS + *--------------------------------------------------------------------*/ - if (exec == HYPRE_EXEC_DEVICE) - { - return hypre_BoomerAMGRelaxHybridGaussSeidelDevice(A, f, cf_marker, relax_points, relax_weight, omega, l1_norms, u, Vtemp, Ztemp, - 1, 1 /* symm */); - } - else -#endif - { - return hypre_BoomerAMGRelaxHybridGaussSeidel_core(A, f, cf_marker, relax_points, relax_weight, omega, l1_norms, u, Vtemp, Ztemp, - 1, 1 /* symm */, skip_diag, 0, 0); - } +HYPRE_Int +hypre_BoomerAMGRelax89HybridL1SSOR( hypre_ParCSRMatrix *A, + hypre_ParVector *f, + HYPRE_Int *cf_marker, + HYPRE_Int relax_points, + HYPRE_Real relax_weight, + HYPRE_Real omega, + HYPRE_Real *l1_norms, + hypre_ParVector *u, + hypre_ParVector *Vtemp, + hypre_ParVector *Ztemp ) +{ + hypre_BoomerAMGRelax13HybridL1GaussSeidel(A, f, cf_marker, relax_points, relax_weight, + omega, l1_norms, u, Vtemp, Ztemp); + + hypre_BoomerAMGRelax14HybridL1GaussSeidel(A, f, cf_marker, relax_points, relax_weight, + omega, l1_norms, u, Vtemp, Ztemp); + + return hypre_error_flag; } -/* forward hybrid topology ordered G-S */ +/*-------------------------------------------------------------------- + * hypre_BoomerAMGRelax14HybridL1GaussSeidel + * + * Forward hybrid topology ordered GS + *--------------------------------------------------------------------*/ + HYPRE_Int hypre_BoomerAMGRelax10TopoOrderedGaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, @@ -1185,11 +1321,17 @@ hypre_BoomerAMGRelax10TopoOrderedGaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ) { - return hypre_BoomerAMGRelaxHybridGaussSeidel_core(A, f, cf_marker, relax_points, relax_weight, omega, NULL, u, Vtemp, Ztemp, + return hypre_BoomerAMGRelaxHybridGaussSeidel_core(A, f, cf_marker, relax_points, relax_weight, + omega, NULL, u, Vtemp, Ztemp, 1 /* forward */, 0 /* nonsymm */, 1 /* skip_diag */, 1, 1); } -/* forward l1 hybrid G-S */ +/*-------------------------------------------------------------------- + * hypre_BoomerAMGRelax14HybridL1GaussSeidel + * + * Forward l1 hybrid GS + *--------------------------------------------------------------------*/ + HYPRE_Int hypre_BoomerAMGRelax13HybridL1GaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, @@ -1204,37 +1346,17 @@ hypre_BoomerAMGRelax13HybridL1GaussSeidel( hypre_ParCSRMatrix *A, { const HYPRE_Int skip_diag = relax_weight == 1.0 && omega == 1.0 ? 0 : 1; -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - //HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy2( hypre_ParCSRMatrixMemoryLocation(A), hypre_VectorMemoryLocation(f) ); - //RL: TODO back to hypre_GetExecPolicy2 later - HYPRE_ExecutionPolicy exec = HYPRE_EXEC_DEVICE; - // TODO implement CF relax on GPUs - if (relax_points != 0) - { - exec = HYPRE_EXEC_HOST; - } - -#if defined(HYPRE_USING_GPU) - if (hypre_HandleDeviceGSMethod(hypre_handle()) == 0) - { - exec = HYPRE_EXEC_HOST; - } -#endif - - if (exec == HYPRE_EXEC_DEVICE) - { - return hypre_BoomerAMGRelaxHybridGaussSeidelDevice(A, f, cf_marker, relax_points, relax_weight, omega, l1_norms, u, Vtemp, Ztemp, - 1, 0 /* nonsymm */); - } - else -#endif - { - return hypre_BoomerAMGRelaxHybridGaussSeidel_core(A, f, cf_marker, relax_points, relax_weight, omega, l1_norms, u, Vtemp, Ztemp, - 1 /* forward */, 0 /* nonsymm */, skip_diag, 0, 0 ); - } + return hypre_BoomerAMGRelaxHybridSOR(A, f, cf_marker, relax_points, relax_weight, + omega, l1_norms, u, Vtemp, Ztemp, + 1, 0, skip_diag, 0); } -/* backward l1 hybrid G-S */ +/*-------------------------------------------------------------------- + * hypre_BoomerAMGRelax14HybridL1GaussSeidel + * + * Backward l1 hybrid GS + *--------------------------------------------------------------------*/ + HYPRE_Int hypre_BoomerAMGRelax14HybridL1GaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, @@ -1249,199 +1371,14 @@ hypre_BoomerAMGRelax14HybridL1GaussSeidel( hypre_ParCSRMatrix *A, { const HYPRE_Int skip_diag = relax_weight == 1.0 && omega == 1.0 ? 0 : 1; -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - //HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy2( hypre_ParCSRMatrixMemoryLocation(A), hypre_VectorMemoryLocation(f) ); - //RL: TODO back to hypre_GetExecPolicy2 later - HYPRE_ExecutionPolicy exec = HYPRE_EXEC_DEVICE; - // TODO implement CF relax on GPUs - if (relax_points != 0) - { - exec = HYPRE_EXEC_HOST; - } - -#if defined(HYPRE_USING_GPU) - if (hypre_HandleDeviceGSMethod(hypre_handle()) == 0) - { - exec = HYPRE_EXEC_HOST; - } -#endif - - if (exec == HYPRE_EXEC_DEVICE) - { - return hypre_BoomerAMGRelaxHybridGaussSeidelDevice(A, f, cf_marker, relax_points, relax_weight, omega, l1_norms, u, Vtemp, Ztemp, - -1, 0 /* nonsymm */); - } - else -#endif - { - return hypre_BoomerAMGRelaxHybridGaussSeidel_core(A, f, cf_marker, relax_points, relax_weight, omega, l1_norms, u, Vtemp, Ztemp, - -1 /* backward */, 0 /* nonsymm */, skip_diag, 0, 0 ); - } -} - -HYPRE_Int -hypre_BoomerAMGRelax19GaussElim( hypre_ParCSRMatrix *A, - hypre_ParVector *f, - hypre_ParVector *u ) -{ - HYPRE_BigInt global_num_rows = hypre_ParCSRMatrixGlobalNumRows(A); - HYPRE_BigInt first_ind = hypre_ParVectorFirstIndex(u); - HYPRE_Int n_global = (HYPRE_Int) global_num_rows; - HYPRE_Int first_index = (HYPRE_Int) first_ind; - HYPRE_Int num_rows = hypre_ParCSRMatrixNumRows(A); - hypre_Vector *u_local = hypre_ParVectorLocalVector(u); - HYPRE_Complex *u_data = hypre_VectorData(u_local); - hypre_CSRMatrix *A_CSR; - HYPRE_Int *A_CSR_i; - HYPRE_Int *A_CSR_j; - HYPRE_Real *A_CSR_data; - hypre_Vector *f_vector; - HYPRE_Real *f_vector_data; - HYPRE_Real *A_mat; - HYPRE_Real *b_vec; - HYPRE_Int i, jj, column, relax_error = 0; - - /*----------------------------------------------------------------- - * Generate CSR matrix from ParCSRMatrix A - *-----------------------------------------------------------------*/ - /* all processors are needed for these routines */ - A_CSR = hypre_ParCSRMatrixToCSRMatrixAll(A); - f_vector = hypre_ParVectorToVectorAll(f); - if (num_rows) - { - A_CSR_i = hypre_CSRMatrixI(A_CSR); - A_CSR_j = hypre_CSRMatrixJ(A_CSR); - A_CSR_data = hypre_CSRMatrixData(A_CSR); - f_vector_data = hypre_VectorData(f_vector); - - A_mat = hypre_CTAlloc(HYPRE_Real, n_global*n_global, HYPRE_MEMORY_HOST); - b_vec = hypre_CTAlloc(HYPRE_Real, n_global, HYPRE_MEMORY_HOST); - - /*--------------------------------------------------------------- - * Load CSR matrix into A_mat. - *---------------------------------------------------------------*/ - for (i = 0; i < n_global; i++) - { - for (jj = A_CSR_i[i]; jj < A_CSR_i[i+1]; jj++) - { - column = A_CSR_j[jj]; - A_mat[i*n_global+column] = A_CSR_data[jj]; - } - b_vec[i] = f_vector_data[i]; - } - - hypre_gselim(A_mat, b_vec, n_global, relax_error); - - for (i = 0; i < num_rows; i++) - { - u_data[i] = b_vec[first_index + i]; - } - - hypre_TFree(A_mat, HYPRE_MEMORY_HOST); - hypre_TFree(b_vec, HYPRE_MEMORY_HOST); - hypre_CSRMatrixDestroy(A_CSR); - A_CSR = NULL; - hypre_SeqVectorDestroy(f_vector); - f_vector = NULL; - } - else - { - hypre_CSRMatrixDestroy(A_CSR); - A_CSR = NULL; - hypre_SeqVectorDestroy(f_vector); - f_vector = NULL; - } - - return relax_error; + return hypre_BoomerAMGRelaxHybridSOR(A, f, cf_marker, relax_points, relax_weight, + omega, l1_norms, u, Vtemp, Ztemp, + -1, 0, skip_diag, 0); } -HYPRE_Int -hypre_BoomerAMGRelax98GaussElimPivot( hypre_ParCSRMatrix *A, - hypre_ParVector *f, - hypre_ParVector *u ) -{ - HYPRE_BigInt global_num_rows = hypre_ParCSRMatrixGlobalNumRows(A); - HYPRE_BigInt first_ind = hypre_ParVectorFirstIndex(u); - HYPRE_Int n_global = (HYPRE_Int) global_num_rows; - HYPRE_Int first_index = (HYPRE_Int) first_ind; - HYPRE_Int num_rows = hypre_ParCSRMatrixNumRows(A); - hypre_Vector *u_local = hypre_ParVectorLocalVector(u); - HYPRE_Complex *u_data = hypre_VectorData(u_local); - hypre_CSRMatrix *A_CSR; - HYPRE_Int *A_CSR_i; - HYPRE_Int *A_CSR_j; - HYPRE_Real *A_CSR_data; - hypre_Vector *f_vector; - HYPRE_Real *f_vector_data; - HYPRE_Real *A_mat; - HYPRE_Real *b_vec; - HYPRE_Int i, jj, column, relax_error = 0; - HYPRE_Int info; - HYPRE_Int one_i = 1; - HYPRE_Int *piv; - - /*----------------------------------------------------------------- - * Generate CSR matrix from ParCSRMatrix A - *-----------------------------------------------------------------*/ - /* all processors are needed for these routines */ - A_CSR = hypre_ParCSRMatrixToCSRMatrixAll(A); - f_vector = hypre_ParVectorToVectorAll(f); - if (num_rows) - { - A_CSR_i = hypre_CSRMatrixI(A_CSR); - A_CSR_j = hypre_CSRMatrixJ(A_CSR); - A_CSR_data = hypre_CSRMatrixData(A_CSR); - f_vector_data = hypre_VectorData(f_vector); - - A_mat = hypre_CTAlloc(HYPRE_Real, n_global*n_global, HYPRE_MEMORY_HOST); - b_vec = hypre_CTAlloc(HYPRE_Real, n_global, HYPRE_MEMORY_HOST); - - /*--------------------------------------------------------------- - * Load CSR matrix into A_mat. - *---------------------------------------------------------------*/ - for (i = 0; i < n_global; i++) - { - for (jj = A_CSR_i[i]; jj < A_CSR_i[i+1]; jj++) - { - /* need col major */ - column = A_CSR_j[jj]; - A_mat[i + n_global*column] = A_CSR_data[jj]; - } - b_vec[i] = f_vector_data[i]; - } - - piv = hypre_CTAlloc(HYPRE_Int, n_global, HYPRE_MEMORY_HOST); - - /* write over A with LU */ - hypre_dgetrf(&n_global, &n_global, A_mat, &n_global, piv, &info); - - /*now b_vec = inv(A)*b_vec */ - hypre_dgetrs("N", &n_global, &one_i, A_mat, &n_global, piv, b_vec, &n_global, &info); - - hypre_TFree(piv, HYPRE_MEMORY_HOST); - - for (i = 0; i < num_rows; i++) - { - u_data[i] = b_vec[first_index+i]; - } - - hypre_TFree(A_mat, HYPRE_MEMORY_HOST); - hypre_TFree(b_vec, HYPRE_MEMORY_HOST); - hypre_CSRMatrixDestroy(A_CSR); - A_CSR = NULL; - hypre_SeqVectorDestroy(f_vector); - f_vector = NULL; - } - else - { - hypre_CSRMatrixDestroy(A_CSR); - A_CSR = NULL; - hypre_SeqVectorDestroy(f_vector); - f_vector = NULL; - } - - return relax_error; -} +/*-------------------------------------------------------------------- + * hypre_BoomerAMGRelaxKaczmarz + *--------------------------------------------------------------------*/ HYPRE_Int hypre_BoomerAMGRelaxKaczmarz( hypre_ParCSRMatrix *A, @@ -1473,6 +1410,14 @@ hypre_BoomerAMGRelaxKaczmarz( hypre_ParCSRMatrix *A, HYPRE_Int num_procs, my_id, i, j, index, num_sends, start; hypre_ParCSRCommHandle *comm_handle; + /* Sanity check */ + if (hypre_ParVectorNumVectors(f) > 1) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "Kaczmarz relaxation doesn't support multicomponent vectors"); + return hypre_error_flag; + } + hypre_MPI_Comm_size(comm, &num_procs); hypre_MPI_Comm_rank(comm, &my_id); @@ -1485,14 +1430,15 @@ hypre_BoomerAMGRelaxKaczmarz( hypre_ParCSRMatrix *A, } num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - u_buf_data = hypre_TAlloc(HYPRE_Real, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), HYPRE_MEMORY_HOST); + u_buf_data = hypre_TAlloc(HYPRE_Real, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); u_offd_data = hypre_TAlloc(HYPRE_Real, num_cols_offd, HYPRE_MEMORY_HOST); index = 0; for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { u_buf_data[index++] = u_data[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } @@ -1507,19 +1453,19 @@ hypre_BoomerAMGRelaxKaczmarz( hypre_ParCSRMatrix *A, for (i = 0; i < num_rows; i++) { res = f_data[i]; - for (j = A_diag_i[i]; j < A_diag_i[i+1]; j++) + for (j = A_diag_i[i]; j < A_diag_i[i + 1]; j++) { res -= A_diag_data[j] * u_data[A_diag_j[j]]; } - for (j = A_offd_i[i]; j < A_offd_i[i+1]; j++) + for (j = A_offd_i[i]; j < A_offd_i[i + 1]; j++) { res -= A_offd_data[j] * u_offd_data[A_offd_j[j]]; } res /= l1_norms[i]; - for (j = A_diag_i[i]; j < A_diag_i[i+1]; j++) + for (j = A_diag_i[i]; j < A_diag_i[i + 1]; j++) { u_data[A_diag_j[j]] += omega * res * A_diag_data[j]; } @@ -1529,19 +1475,19 @@ hypre_BoomerAMGRelaxKaczmarz( hypre_ParCSRMatrix *A, for (i = num_rows - 1; i > -1; i--) { res = f_data[i]; - for (j = A_diag_i[i]; j < A_diag_i[i+1]; j++) + for (j = A_diag_i[i]; j < A_diag_i[i + 1]; j++) { res -= A_diag_data[j] * u_data[A_diag_j[j]]; } - for (j = A_offd_i[i]; j < A_offd_i[i+1]; j++) + for (j = A_offd_i[i]; j < A_offd_i[i + 1]; j++) { res -= A_offd_data[j] * u_offd_data[A_offd_j[j]]; } res /= l1_norms[i]; - for (j = A_diag_i[i]; j < A_diag_i[i+1]; j++) + for (j = A_diag_i[i]; j < A_diag_i[i + 1]; j++) { u_data[A_diag_j[j]] += omega * res * A_diag_data[j]; } @@ -1552,7 +1498,9 @@ hypre_BoomerAMGRelaxKaczmarz( hypre_ParCSRMatrix *A, return hypre_error_flag; } - +/*-------------------------------------------------------------------- + * hypre_BoomerAMGRelaxTwoStageGaussSeidelHost + *--------------------------------------------------------------------*/ HYPRE_Int hypre_BoomerAMGRelaxTwoStageGaussSeidelHost( hypre_ParCSRMatrix *A, @@ -1561,8 +1509,10 @@ hypre_BoomerAMGRelaxTwoStageGaussSeidelHost( hypre_ParCSRMatrix *A, HYPRE_Real omega, hypre_ParVector *u, hypre_ParVector *Vtemp, - HYPRE_Int num_inner_iters) + HYPRE_Int num_inner_iters ) { + HYPRE_UNUSED_VAR(omega); + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); HYPRE_Int num_rows = hypre_CSRMatrixNumRows(A_diag); HYPRE_Real *A_diag_data = hypre_CSRMatrixData(A_diag); @@ -1572,8 +1522,17 @@ hypre_BoomerAMGRelaxTwoStageGaussSeidelHost( hypre_ParCSRMatrix *A, HYPRE_Complex *Vtemp_data = hypre_VectorData(Vtemp_local); hypre_Vector *u_local = hypre_ParVectorLocalVector(u); HYPRE_Complex *u_data = hypre_VectorData(u_local); - HYPRE_Int i, k, jj, ii; + HYPRE_Complex multiplier = 1.0; + HYPRE_Int i, k, jj, ii; + + /* Sanity check */ + if (hypre_ParVectorNumVectors(f) > 1) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "2-stage GS relaxation (Host) doesn't support multicomponent vectors"); + return hypre_error_flag; + } /* Need to check that EVERY diagonal is nonzero first. If any are, throw exception */ for (i = 0; i < num_rows; i++) @@ -1586,8 +1545,8 @@ hypre_BoomerAMGRelaxTwoStageGaussSeidelHost( hypre_ParCSRMatrix *A, hypre_ParCSRMatrixMatvecOutOfPlace(-relax_weight, A, u, relax_weight, f, Vtemp); - - for (i = 0; i < num_rows; i++) /* Run the smoother */ + /* Run the smoother */ + for (i = 0; i < num_rows; i++) { // V = V/D Vtemp_data[i] /= A_diag_data[A_diag_i[i]]; @@ -1603,11 +1562,11 @@ hypre_BoomerAMGRelaxTwoStageGaussSeidelHost( hypre_ParCSRMatrix *A, { // By going from bottom to top, we can update Vtemp in place because // we're operating with the strict, lower triangular matrix - for (i = num_rows-1; i >=0; i--) /* Run the smoother */ + for (i = num_rows - 1; i >= 0; i--) /* Run the smoother */ { // spmv for the row first HYPRE_Complex res = 0.0; - for (jj = A_diag_i[i]; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i]; jj < A_diag_i[i + 1]; jj++) { ii = A_diag_j[jj]; if (ii < i) @@ -1628,6 +1587,10 @@ hypre_BoomerAMGRelaxTwoStageGaussSeidelHost( hypre_ParCSRMatrix *A, return hypre_error_flag; } +/*-------------------------------------------------------------------- + * hypre_BoomerAMGRelax11TwoStageGaussSeidel + *--------------------------------------------------------------------*/ + HYPRE_Int hypre_BoomerAMGRelax11TwoStageGaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, @@ -1635,28 +1598,37 @@ hypre_BoomerAMGRelax11TwoStageGaussSeidel( hypre_ParCSRMatrix *A, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, + HYPRE_Real *A_diag_diag, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ) { -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - //HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy2( hypre_VectorMemoryLocation(x), hypre_VectorMemoryLocation(b) ); - //RL: TODO back to hypre_GetExecPolicy2 later - HYPRE_ExecutionPolicy exec = HYPRE_EXEC_DEVICE; + HYPRE_UNUSED_VAR(cf_marker); + HYPRE_UNUSED_VAR(relax_points); + +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy2( hypre_ParCSRMatrixMemoryLocation(A), + hypre_ParVectorMemoryLocation(f) ); if (exec == HYPRE_EXEC_DEVICE) { - hypre_BoomerAMGRelaxTwoStageGaussSeidelDevice(A, f, relax_weight, omega, u, Vtemp, Ztemp, 1); + hypre_BoomerAMGRelaxTwoStageGaussSeidelDevice(A, f, relax_weight, omega, + A_diag_diag, u, Vtemp, Ztemp, 1); } else #endif { + HYPRE_UNUSED_VAR(A_diag_diag); + HYPRE_UNUSED_VAR(Ztemp); hypre_BoomerAMGRelaxTwoStageGaussSeidelHost(A, f, relax_weight, omega, u, Vtemp, 1); } return hypre_error_flag; } +/*-------------------------------------------------------------------- + * hypre_BoomerAMGRelax12TwoStageGaussSeidel + *--------------------------------------------------------------------*/ HYPRE_Int hypre_BoomerAMGRelax12TwoStageGaussSeidel( hypre_ParCSRMatrix *A, @@ -1665,25 +1637,74 @@ hypre_BoomerAMGRelax12TwoStageGaussSeidel( hypre_ParCSRMatrix *A, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, + HYPRE_Real *A_diag_diag, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ) { -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - //HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy2( hypre_VectorMemoryLocation(x), hypre_VectorMemoryLocation(b) ); - //RL: TODO back to hypre_GetExecPolicy2 later - HYPRE_ExecutionPolicy exec = HYPRE_EXEC_DEVICE; + HYPRE_UNUSED_VAR(cf_marker); + HYPRE_UNUSED_VAR(relax_points); + +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy2( hypre_ParCSRMatrixMemoryLocation(A), + hypre_ParVectorMemoryLocation(f) ); if (exec == HYPRE_EXEC_DEVICE) { - hypre_BoomerAMGRelaxTwoStageGaussSeidelDevice(A, f, relax_weight, omega, u, Vtemp, Ztemp, 2); + hypre_BoomerAMGRelaxTwoStageGaussSeidelDevice(A, f, relax_weight, omega, + A_diag_diag, u, Vtemp, Ztemp, 2); } else #endif { - hypre_BoomerAMGRelaxTwoStageGaussSeidelHost(A, f, relax_weight, omega, u, Vtemp, 2); + HYPRE_UNUSED_VAR(A_diag_diag); + HYPRE_UNUSED_VAR(Ztemp); + hypre_BoomerAMGRelaxTwoStageGaussSeidelHost(A, f, relax_weight, omega, u, Vtemp, 2); } return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_BoomerAMGRelaxComputeL1Norms + * + * TODO (VPM): Use this function in BoomerAMGSetup + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGRelaxComputeL1Norms( hypre_ParCSRMatrix *A, + HYPRE_Int relax_type, + HYPRE_Int relax_order, + HYPRE_Int coarsest_lvl, + hypre_IntArray *CF_marker, + HYPRE_Real **l1_norms_data_ptr ) +{ + HYPRE_Int *CF_marker_data; + HYPRE_Real *l1_norms_data = NULL; + + /* Relax according to F/C points ordering? */ + CF_marker_data = (relax_order && CF_marker) ? hypre_IntArrayData(CF_marker) : NULL; + + /* Are we in the coarsest level? */ + CF_marker_data = (coarsest_lvl) ? NULL : CF_marker_data; + + if (relax_type == 18) + { + /* l1_norm = sum(|A_ij|)_j */ + hypre_ParCSRComputeL1Norms(A, 1, CF_marker_data, &l1_norms_data); + } + else if (relax_type == 8 || relax_type == 13 || relax_type == 14) + { + /* l1_norm = sum(|D_ij| + 0.5*|A_offd_ij|)_j */ + hypre_ParCSRComputeL1Norms(A, 4, CF_marker_data, &l1_norms_data); + } + else if (relax_type == 7 || relax_type == 11 || relax_type == 12) + { + /* l1_norm = |D_ii| */ + hypre_ParCSRComputeL1Norms(A, 5, NULL, &l1_norms_data); + } + + *l1_norms_data_ptr = l1_norms_data; + + return hypre_error_flag; +} diff --git a/external/hypre/src/parcsr_ls/par_relax.h b/external/hypre/src/parcsr_ls/par_relax.h index eefdd96e..72920d2a 100644 --- a/external/hypre/src/parcsr_ls/par_relax.h +++ b/external/hypre/src/parcsr_ls/par_relax.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -28,6 +28,8 @@ hypre_HybridGaussSeidelNS( HYPRE_Int *A_diag_i, HYPRE_Int iorder, HYPRE_Int Skip_diag ) { + HYPRE_UNUSED_VAR(v_tmp_data); + HYPRE_Int i; const HYPRE_Complex zero = 0.0; @@ -45,13 +47,13 @@ hypre_HybridGaussSeidelNS( HYPRE_Int *A_diag_i, HYPRE_Int jj; HYPRE_Complex res = f_data[i]; - for (jj = A_diag_i[i] + Skip_diag; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + Skip_diag; jj < A_diag_i[i + 1]; jj++) { const HYPRE_Int ii = A_diag_j[jj]; res -= A_diag_data[jj] * u_data[ii]; } - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { const HYPRE_Int ii = A_offd_j[jj]; res -= A_offd_data[jj] * v_ext_data[ii]; @@ -77,13 +79,13 @@ hypre_HybridGaussSeidelNS( HYPRE_Int *A_diag_i, HYPRE_Int jj; HYPRE_Complex res = f_data[i]; - for (jj = A_diag_i[i] + Skip_diag; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + Skip_diag; jj < A_diag_i[i + 1]; jj++) { const HYPRE_Int ii = A_diag_j[jj]; res -= A_diag_data[jj] * u_data[ii]; } - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { const HYPRE_Int ii = A_offd_j[jj]; res -= A_offd_data[jj] * v_ext_data[ii]; @@ -147,7 +149,7 @@ hypre_HybridGaussSeidelNSThreads( HYPRE_Int *A_diag_i, HYPRE_Int jj; HYPRE_Complex res = f_data[i]; - for (jj = A_diag_i[i] + Skip_diag; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + Skip_diag; jj < A_diag_i[i + 1]; jj++) { const HYPRE_Int ii = A_diag_j[jj]; if (ii >= ns && ii < ne) @@ -160,7 +162,7 @@ hypre_HybridGaussSeidelNSThreads( HYPRE_Int *A_diag_i, } } - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { const HYPRE_Int ii = A_offd_j[jj]; res -= A_offd_data[jj] * v_ext_data[ii]; @@ -186,7 +188,7 @@ hypre_HybridGaussSeidelNSThreads( HYPRE_Int *A_diag_i, HYPRE_Int jj; HYPRE_Complex res = f_data[i]; - for (jj = A_diag_i[i] + Skip_diag; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + Skip_diag; jj < A_diag_i[i + 1]; jj++) { const HYPRE_Int ii = A_diag_j[jj]; if (ii >= ns && ii < ne) @@ -199,7 +201,7 @@ hypre_HybridGaussSeidelNSThreads( HYPRE_Int *A_diag_i, } } - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { const HYPRE_Int ii = A_offd_j[jj]; res -= A_offd_data[jj] * v_ext_data[ii]; @@ -262,14 +264,14 @@ hypre_HybridGaussSeidel( HYPRE_Int *A_diag_i, HYPRE_Complex res0 = 0.0; HYPRE_Complex res2 = 0.0; - for (jj = A_diag_i[i] + Skip_diag; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + Skip_diag; jj < A_diag_i[i + 1]; jj++) { const HYPRE_Int ii = A_diag_j[jj]; res0 -= A_diag_data[jj] * u_data[ii]; res2 += A_diag_data[jj] * v_tmp_data[ii]; } - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { const HYPRE_Int ii = A_offd_j[jj]; res -= A_offd_data[jj] * v_ext_data[ii]; @@ -298,14 +300,14 @@ hypre_HybridGaussSeidel( HYPRE_Int *A_diag_i, HYPRE_Complex res0 = 0.0; HYPRE_Complex res2 = 0.0; - for (jj = A_diag_i[i] + Skip_diag; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + Skip_diag; jj < A_diag_i[i + 1]; jj++) { const HYPRE_Int ii = A_diag_j[jj]; res0 -= A_diag_data[jj] * u_data[ii]; res2 += A_diag_data[jj] * v_tmp_data[ii]; } - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { const HYPRE_Int ii = A_offd_j[jj]; res -= A_offd_data[jj] * v_ext_data[ii]; @@ -314,11 +316,13 @@ hypre_HybridGaussSeidel( HYPRE_Int *A_diag_i, if (Skip_diag) { u_data[i] *= prod; - u_data[i] += relax_weight * (omega * res + res0 + one_minus_omega * res2) / A_diag_data[A_diag_i[i]]; + u_data[i] += relax_weight * (omega * res + res0 + one_minus_omega * res2) / + A_diag_data[A_diag_i[i]]; } else { - u_data[i] += relax_weight * (omega * res + res0 + one_minus_omega * res2) / A_diag_data[A_diag_i[i]]; + u_data[i] += relax_weight * (omega * res + res0 + one_minus_omega * res2) / + A_diag_data[A_diag_i[i]]; } } } /* for ( i = ...) */ @@ -370,7 +374,7 @@ hypre_HybridGaussSeidelThreads( HYPRE_Int *A_diag_i, HYPRE_Complex res0 = 0.0; HYPRE_Complex res2 = 0.0; - for (jj = A_diag_i[i] + Skip_diag; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + Skip_diag; jj < A_diag_i[i + 1]; jj++) { const HYPRE_Int ii = A_diag_j[jj]; if (ii >= ns && ii < ne) @@ -384,7 +388,7 @@ hypre_HybridGaussSeidelThreads( HYPRE_Int *A_diag_i, } } - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { const HYPRE_Int ii = A_offd_j[jj]; res -= A_offd_data[jj] * v_ext_data[ii]; @@ -413,7 +417,7 @@ hypre_HybridGaussSeidelThreads( HYPRE_Int *A_diag_i, HYPRE_Complex res0 = 0.0; HYPRE_Complex res2 = 0.0; - for (jj = A_diag_i[i] + Skip_diag; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + Skip_diag; jj < A_diag_i[i + 1]; jj++) { const HYPRE_Int ii = A_diag_j[jj]; if (ii >= ns && ii < ne) @@ -427,7 +431,7 @@ hypre_HybridGaussSeidelThreads( HYPRE_Int *A_diag_i, } } - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { const HYPRE_Int ii = A_offd_j[jj]; res -= A_offd_data[jj] * v_ext_data[ii]; @@ -436,11 +440,13 @@ hypre_HybridGaussSeidelThreads( HYPRE_Int *A_diag_i, if (Skip_diag) { u_data[i] *= prod; - u_data[i] += relax_weight * (omega * res + res0 + one_minus_omega * res2) / A_diag_data[A_diag_i[i]]; + u_data[i] += relax_weight * (omega * res + res0 + one_minus_omega * res2) / + A_diag_data[A_diag_i[i]]; } else { - u_data[i] += relax_weight * (omega * res + res0 + one_minus_omega * res2) / A_diag_data[A_diag_i[i]]; + u_data[i] += relax_weight * (omega * res + res0 + one_minus_omega * res2) / + A_diag_data[A_diag_i[i]]; } } } /* for ( i = ...) */ @@ -467,6 +473,8 @@ hypre_HybridGaussSeidelOrderedNS( HYPRE_Int *A_diag_i, HYPRE_Int iorder, HYPRE_Int *proc_ordering ) { + HYPRE_UNUSED_VAR(v_tmp_data); + HYPRE_Int j; const HYPRE_Complex zero = 0.0; @@ -483,13 +491,13 @@ hypre_HybridGaussSeidelOrderedNS( HYPRE_Int *A_diag_i, HYPRE_Int jj; HYPRE_Complex res = f_data[i]; - for (jj = A_diag_i[i] + 1; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) { const HYPRE_Int ii = A_diag_j[jj]; res -= A_diag_data[jj] * u_data[ii]; } - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { const HYPRE_Int ii = A_offd_j[jj]; res -= A_offd_data[jj] * v_ext_data[ii]; @@ -501,4 +509,3 @@ hypre_HybridGaussSeidelOrderedNS( HYPRE_Int *A_diag_i, } #endif /* #ifndef HYPRE_PAR_RELAX_HEADER */ - diff --git a/external/hypre/src/parcsr_ls/par_relax_device.c b/external/hypre/src/parcsr_ls/par_relax_device.c index 1554e927..da76b947 100644 --- a/external/hypre/src/parcsr_ls/par_relax_device.c +++ b/external/hypre/src/parcsr_ls/par_relax_device.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -9,7 +9,11 @@ #include "_hypre_parcsr_ls.h" #include "_hypre_utilities.hpp" -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) + +/*-------------------------------------------------------------------------- + * hypre_BoomerAMGRelaxHybridGaussSeidelDevice + *--------------------------------------------------------------------------*/ HYPRE_Int hypre_BoomerAMGRelaxHybridGaussSeidelDevice( hypre_ParCSRMatrix *A, @@ -25,11 +29,18 @@ hypre_BoomerAMGRelaxHybridGaussSeidelDevice( hypre_ParCSRMatrix *A, HYPRE_Int GS_order, HYPRE_Int Symm ) { + HYPRE_UNUSED_VAR(cf_marker); + HYPRE_UNUSED_VAR(relax_points); + HYPRE_UNUSED_VAR(omega); + /* Vtemp, Ztemp have the fine-grid size. Create two shell vectors that have the correct size */ hypre_ParVector *w1 = hypre_ParVectorCloneShallow(f); hypre_ParVector *w2 = hypre_ParVectorCloneShallow(u); - hypre_VectorData(hypre_ParVectorLocalVector(w1)) = hypre_VectorData(hypre_ParVectorLocalVector(Vtemp)); - hypre_VectorData(hypre_ParVectorLocalVector(w2)) = hypre_VectorData(hypre_ParVectorLocalVector(Ztemp)); + + hypre_VectorData(hypre_ParVectorLocalVector(w1)) = hypre_VectorData(hypre_ParVectorLocalVector( + Vtemp)); + hypre_VectorData(hypre_ParVectorLocalVector(w2)) = hypre_VectorData(hypre_ParVectorLocalVector( + Ztemp)); if (Symm) { @@ -37,19 +48,22 @@ hypre_BoomerAMGRelaxHybridGaussSeidelDevice( hypre_ParCSRMatrix *A, hypre_ParCSRMatrixMatvecOutOfPlace(-1.0, A, u, 1.0, f, w1); /* Z = L^{-1}*V */ - hypre_CSRMatrixTriLowerUpperSolveDevice('L', hypre_ParCSRMatrixDiag(A), l1_norms, - hypre_ParVectorLocalVector(w1), hypre_ParVectorLocalVector(w2)); + hypre_CSRMatrixTriLowerUpperSolveDevice('L', 0, hypre_ParCSRMatrixDiag(A), l1_norms, + hypre_ParVectorLocalVector(w1), + hypre_ParVectorLocalVector(w2)); /* u = u + w*Z */ hypre_ParVectorAxpy(relax_weight, w2, u); /* Note: only update V from local change of u, i.e., V = V - w*A_diag*Z_local */ - hypre_CSRMatrixMatvec(-relax_weight, hypre_ParCSRMatrixDiag(A), hypre_ParVectorLocalVector(w2), - 1.0, hypre_ParVectorLocalVector(w1)); + hypre_CSRMatrixMatvec(-relax_weight, hypre_ParCSRMatrixDiag(A), + hypre_ParVectorLocalVector(w2), 1.0, + hypre_ParVectorLocalVector(w1)); /* Z = U^{-1}*V */ - hypre_CSRMatrixTriLowerUpperSolveDevice('U', hypre_ParCSRMatrixDiag(A), l1_norms, - hypre_ParVectorLocalVector(w1), hypre_ParVectorLocalVector(w2)); + hypre_CSRMatrixTriLowerUpperSolveDevice('U', 0, hypre_ParCSRMatrixDiag(A), l1_norms, + hypre_ParVectorLocalVector(w1), + hypre_ParVectorLocalVector(w2)); /* u = u + w*Z */ hypre_ParVectorAxpy(relax_weight, w2, u); @@ -61,8 +75,9 @@ hypre_BoomerAMGRelaxHybridGaussSeidelDevice( hypre_ParCSRMatrix *A, hypre_ParCSRMatrixMatvecOutOfPlace(-1.0, A, u, 1.0, f, w1); /* Z = L^{-1}*V or Z = U^{-1}*V */ - hypre_CSRMatrixTriLowerUpperSolveDevice(uplo, hypre_ParCSRMatrixDiag(A), l1_norms, - hypre_ParVectorLocalVector(w1), hypre_ParVectorLocalVector(w2)); + hypre_CSRMatrixTriLowerUpperSolveDevice(uplo, 0, hypre_ParCSRMatrixDiag(A), l1_norms, + hypre_ParVectorLocalVector(w1), + hypre_ParVectorLocalVector(w2)); /* u = u + w*Z */ hypre_ParVectorAxpy(relax_weight, w2, u); @@ -74,60 +89,69 @@ hypre_BoomerAMGRelaxHybridGaussSeidelDevice( hypre_ParCSRMatrix *A, return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_BoomerAMGRelaxTwoStageGaussSeidelDevice + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_BoomerAMGRelaxTwoStageGaussSeidelDevice ( hypre_ParCSRMatrix *A, - hypre_ParVector *f, - HYPRE_Real relax_weight, - HYPRE_Real omega, - hypre_ParVector *u, - hypre_ParVector *r, - hypre_ParVector *z, - HYPRE_Int num_inner_iters) +hypre_BoomerAMGRelaxTwoStageGaussSeidelDevice( hypre_ParCSRMatrix *A, + hypre_ParVector *f, + HYPRE_Real relax_weight, + HYPRE_Real omega, + HYPRE_Real *A_diag_diag, + hypre_ParVector *u, + hypre_ParVector *r, + hypre_ParVector *z, + HYPRE_Int num_inner_iters ) { - hypre_GpuProfilingPushRange("BoomerAMGRelaxTwoStageGaussSeidelDevice"); + HYPRE_UNUSED_VAR(omega); hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); HYPRE_Int num_rows = hypre_CSRMatrixNumRows(A_diag); - HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); - HYPRE_Complex *A_diag_data = hypre_CSRMatrixData(A_diag); + hypre_Vector *u_local = hypre_ParVectorLocalVector(u); hypre_Vector *r_local = hypre_ParVectorLocalVector(r); hypre_Vector *z_local = hypre_ParVectorLocalVector(z); + + HYPRE_Int u_vecstride = hypre_VectorVectorStride(u_local); + HYPRE_Int r_vecstride = hypre_VectorVectorStride(r_local); HYPRE_Complex *u_data = hypre_VectorData(u_local); HYPRE_Complex *r_data = hypre_VectorData(r_local); HYPRE_Complex *z_data = hypre_VectorData(z_local); - HYPRE_Int zsize = hypre_VectorSize(z_local); - HYPRE_Int rsize = hypre_VectorSize(r_local); + + HYPRE_Int num_vectors = hypre_VectorNumVectors(r_local); HYPRE_Complex multiplier = 1.0; HYPRE_Int i; - hypre_ParCSRMatrixMatvecOutOfPlace(-relax_weight, A, u, relax_weight, f, r); + hypre_GpuProfilingPushRange("BoomerAMGRelaxTwoStageGaussSeidelDevice"); - hypreDevice_DiagScaleVector(num_rows, A_diag_i, A_diag_data, r_data, 0.0, z_data); + /* Sanity checks */ + hypre_assert(u_vecstride == num_rows); + hypre_assert(r_vecstride == num_rows); - // set this so that axpy works out properly. Reset later. - hypre_VectorSize(z_local) = rsize; + // 0) r = relax_weight * (f - A * u) + hypre_ParCSRMatrixMatvecOutOfPlace(-relax_weight, A, u, relax_weight, f, r); - // 1) u = u + z - hypre_SeqVectorAxpy(multiplier, z_local, u_local); + // 1) z = r/D, u = u + z + hypreDevice_DiagScaleVector2(num_vectors, num_rows, A_diag_diag, + r_data, 1.0, z_data, u_data, 1); multiplier *= -1.0; - for (i = 0; i < num_inner_iters; ++i) + for (i = 0; i < num_inner_iters; i++) { - // 2) r = Lz - hypre_CSRMatrixSpMVDevice(1.0, A_diag, z_local, 0.0, r_local, -2); - // 3) z = r/D, u = u + m*z - hypreDevice_DiagScaleVector2(num_rows, A_diag_i, A_diag_data, r_data, multiplier, z_data, u_data); - multiplier *= -1.0; + // 2) r = L * z + hypre_CSRMatrixSpMVDevice(0, 1.0, A_diag, z_local, 0.0, r_local, -2); + + // 3) z = r/D, u = u + m * z + hypreDevice_DiagScaleVector2(num_vectors, num_rows, A_diag_diag, + r_data, multiplier, z_data, u_data, + (num_inner_iters > i + 1)); + multiplier *= -1.0; } - // reset this - hypre_VectorSize(z_local) = zsize; - hypre_GpuProfilingPopRange(); - return 0; + return hypre_error_flag; } -#endif /* #if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) */ - +#endif /* #if defined(HYPRE_USING_GPU) */ diff --git a/external/hypre/src/parcsr_ls/par_relax_interface.c b/external/hypre/src/parcsr_ls/par_relax_interface.c index 1a105991..994da816 100644 --- a/external/hypre/src/parcsr_ls/par_relax_interface.c +++ b/external/hypre/src/parcsr_ls/par_relax_interface.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -78,7 +78,8 @@ hypre_ParCSRRelax_L1_Jacobi( hypre_ParCSRMatrix *A, hypre_ParVector *Vtemp ) { - return hypre_BoomerAMGRelax(A, f, cf_marker, 18, relax_points, relax_weight, 0.0, l1_norms, u, Vtemp, NULL); + return hypre_BoomerAMGRelax(A, f, cf_marker, 18, relax_points, relax_weight, 0.0, l1_norms, u, + Vtemp, NULL); } /*-------------------------------------------------------------------------- diff --git a/external/hypre/src/parcsr_ls/par_relax_more.c b/external/hypre/src/parcsr_ls/par_relax_more.c index b05128ed..ae8433b1 100644 --- a/external/hypre/src/parcsr_ls/par_relax_more.c +++ b/external/hypre/src/parcsr_ls/par_relax_more.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -33,9 +33,9 @@ *****************************************************************************/ HYPRE_Int hypre_ParCSRMaxEigEstimateHost( hypre_ParCSRMatrix *A, /* matrix to relax with */ - HYPRE_Int scale, /* scale by diagonal? */ - HYPRE_Real *max_eig, - HYPRE_Real *min_eig ) + HYPRE_Int scale, /* scale by diagonal? */ + HYPRE_Real *max_eig, + HYPRE_Real *min_eig ) { HYPRE_Int A_num_rows = hypre_ParCSRMatrixNumRows(A); HYPRE_Int *A_diag_i = hypre_CSRMatrixI(hypre_ParCSRMatrixDiag(A)); @@ -45,7 +45,8 @@ hypre_ParCSRMaxEigEstimateHost( hypre_ParCSRMatrix *A, /* matrix to relax HYPRE_Real *A_offd_data = hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(A)); HYPRE_Real *diag = NULL; HYPRE_Int i, j; - HYPRE_Real e_max, e_min; + HYPRE_Real e_max = 0.0; + HYPRE_Real e_min = 0.0; HYPRE_Real send_buf[2], recv_buf[2]; HYPRE_MemoryLocation memory_location = hypre_ParCSRMatrixMemoryLocation(A); @@ -59,7 +60,7 @@ hypre_ParCSRMaxEigEstimateHost( hypre_ParCSRMatrix *A, /* matrix to relax { HYPRE_Real a_ii = 0.0, r_i = 0.0, lower, upper; - for (j = A_diag_i[i]; j < A_diag_i[i+1]; j++) + for (j = A_diag_i[i]; j < A_diag_i[i + 1]; j++) { if (A_diag_j[j] == i) { @@ -71,7 +72,7 @@ hypre_ParCSRMaxEigEstimateHost( hypre_ParCSRMatrix *A, /* matrix to relax } } - for (j = A_offd_i[i]; j < A_offd_i[i+1]; j++) + for (j = A_offd_i[i]; j < A_offd_i[i + 1]; j++) { r_i += hypre_abs(A_offd_data[j]); } @@ -101,7 +102,8 @@ hypre_ParCSRMaxEigEstimateHost( hypre_ParCSRMatrix *A, /* matrix to relax send_buf[1] = e_max; /* get e_min e_max across procs */ - hypre_MPI_Allreduce(send_buf, recv_buf, 2, HYPRE_MPI_REAL, hypre_MPI_MAX, hypre_ParCSRMatrixComm(A)); + hypre_MPI_Allreduce(send_buf, recv_buf, 2, HYPRE_MPI_REAL, hypre_MPI_MAX, + hypre_ParCSRMatrixComm(A)); e_min = -recv_buf[0]; e_max = recv_buf[1]; @@ -137,24 +139,20 @@ hypre_ParCSRMaxEigEstimate(hypre_ParCSRMatrix *A, /* matrix to relax with */ HYPRE_Real *max_eig, HYPRE_Real *min_eig) { -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_GpuProfilingPushRange("ParCSRMaxEigEstimate"); -#endif - HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(A) ); HYPRE_Int ierr = 0; - if (exec == HYPRE_EXEC_HOST) +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(A) ); + if (exec == HYPRE_EXEC_DEVICE) { - ierr = hypre_ParCSRMaxEigEstimateHost(A,scale,max_eig,min_eig); + ierr = hypre_ParCSRMaxEigEstimateDevice(A, scale, max_eig, min_eig); } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) else +#endif { - ierr = hypre_ParCSRMaxEigEstimateDevice(A,scale,max_eig,min_eig); + ierr = hypre_ParCSRMaxEigEstimateHost(A, scale, max_eig, min_eig); } -#endif -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_GpuProfilingPopRange(); -#endif return ierr; } @@ -175,24 +173,20 @@ hypre_ParCSRMaxEigEstimateCG(hypre_ParCSRMatrix *A, /* matrix to relax with HYPRE_Real *max_eig, HYPRE_Real *min_eig) { -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_GpuProfilingPushRange("ParCSRMaxEigEstimateCG"); -#endif - HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1(hypre_ParCSRMatrixMemoryLocation(A)); HYPRE_Int ierr = 0; - if (exec == HYPRE_EXEC_HOST) +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1(hypre_ParCSRMatrixMemoryLocation(A)); + if (exec == HYPRE_EXEC_DEVICE) { - ierr = hypre_ParCSRMaxEigEstimateCGHost(A, scale, max_iter, max_eig, min_eig); + ierr = hypre_ParCSRMaxEigEstimateCGDevice(A, scale, max_iter, max_eig, min_eig); } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) else +#endif { - ierr = hypre_ParCSRMaxEigEstimateCGDevice(A, scale, max_iter, max_eig, min_eig); + ierr = hypre_ParCSRMaxEigEstimateCGHost(A, scale, max_iter, max_eig, min_eig); } -#endif -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_GpuProfilingPopRange(); -#endif return ierr; } @@ -207,10 +201,10 @@ hypre_ParCSRMaxEigEstimateCG(hypre_ParCSRMatrix *A, /* matrix to relax with */ HYPRE_Int hypre_ParCSRMaxEigEstimateCGHost( hypre_ParCSRMatrix *A, /* matrix to relax with */ - HYPRE_Int scale, /* scale by diagonal?*/ - HYPRE_Int max_iter, - HYPRE_Real *max_eig, - HYPRE_Real *min_eig ) + HYPRE_Int scale, /* scale by diagonal?*/ + HYPRE_Int max_iter, + HYPRE_Real *max_eig, + HYPRE_Real *min_eig ) { HYPRE_Int i, j, err; hypre_ParVector *p; @@ -269,16 +263,16 @@ hypre_ParCSRMaxEigEstimateCGHost( hypre_ParCSRMatrix *A, /* matrix to relax u_data = hypre_VectorData(hypre_ParVectorLocalVector(u)); /* make room for tri-diag matrix */ - tridiag = hypre_CTAlloc(HYPRE_Real, max_iter+1, HYPRE_MEMORY_HOST); - trioffd = hypre_CTAlloc(HYPRE_Real, max_iter+1, HYPRE_MEMORY_HOST); - for (i=0; i < max_iter + 1; i++) + tridiag = hypre_CTAlloc(HYPRE_Real, max_iter + 1, HYPRE_MEMORY_HOST); + trioffd = hypre_CTAlloc(HYPRE_Real, max_iter + 1, HYPRE_MEMORY_HOST); + for (i = 0; i < max_iter + 1; i++) { tridiag[i] = 0; trioffd[i] = 0; } /* set residual to random */ - hypre_ParVectorSetRandomValues(r,1); + hypre_ParVectorSetRandomValues(r, 1); if (scale) { @@ -287,11 +281,11 @@ hypre_ParCSRMaxEigEstimateCGHost( hypre_ParCSRMatrix *A, /* matrix to relax else { /* set ds to 1 */ - hypre_ParVectorSetConstantValues(ds,1.0); + hypre_ParVectorSetConstantValues(ds, 1.0); } /* gamma = */ - gamma = hypre_ParVectorInnerProd(r,p); + gamma = hypre_ParVectorInnerProd(r, p); /* for the initial filling of the tridiag matrix */ beta = 1.0; @@ -305,9 +299,14 @@ hypre_ParCSRMaxEigEstimateCGHost( hypre_ParCSRMatrix *A, /* matrix to relax /*gamma = */ gamma_old = gamma; - gamma = hypre_ParVectorInnerProd(r,s); + gamma = hypre_ParVectorInnerProd(r, s); + + if (gamma < HYPRE_REAL_EPSILON) + { + break; + } - if (i==0) + if (i == 0) { beta = 1.0; /* p_0 = C*r */ @@ -320,11 +319,11 @@ hypre_ParCSRMaxEigEstimateCGHost( hypre_ParCSRMatrix *A, /* matrix to relax /* p = s + beta p */ #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(j) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(j) HYPRE_SMP_SCHEDULE #endif - for (j=0; j < local_size; j++) + for (j = 0; j < local_size; j++) { - p_data[j] = s_data[j] + beta*p_data[j]; + p_data[j] = s_data[j] + beta * p_data[j]; } } @@ -348,34 +347,34 @@ hypre_ParCSRMaxEigEstimateCGHost( hypre_ParCSRMatrix *A, /* matrix to relax } /* */ - sdotp = hypre_ParVectorInnerProd(s,p); + sdotp = hypre_ParVectorInnerProd(s, p); /* alpha = gamma / */ - alpha = gamma/sdotp; + alpha = gamma / sdotp; /* get tridiagonal matrix */ - alphainv = 1.0/alpha; + alphainv = 1.0 / alpha; - tridiag[i+1] = alphainv; + tridiag[i + 1] = alphainv; tridiag[i] *= beta; tridiag[i] += alphainv; - trioffd[i+1] = alphainv; - trioffd[i] *= sqrt(beta); + trioffd[i + 1] = alphainv; + trioffd[i] *= hypre_sqrt(beta); /* x = x + alpha*p */ /* don't need */ /* r = r - alpha*s */ - hypre_ParVectorAxpy( -alpha, s, r); + hypre_ParVectorAxpy(-alpha, s, r); i++; } /* eispack routine - eigenvalues return in tridiag and ordered*/ - hypre_LINPACKcgtql1(&i,tridiag,trioffd,&err); + hypre_LINPACKcgtql1(&i, tridiag, trioffd, &err); - lambda_max = tridiag[i-1]; + lambda_max = tridiag[i - 1]; lambda_min = tridiag[0]; /* hypre_printf("linpack max eig est = %g\n", lambda_max);*/ /* hypre_printf("linpack min eig est = %g\n", lambda_min);*/ @@ -431,7 +430,8 @@ hypre_ParCSRRelax_Cheby(hypre_ParCSRMatrix *A, /* matrix to relax with */ hypre_ParVector *tmp_vec = NULL; hypre_ParVector *orig_u_vec = NULL; - hypre_ParCSRRelax_Cheby_Setup(A, max_eig, min_eig, fraction, order, scale, variant, &coefs, &ds_data); + hypre_ParCSRRelax_Cheby_Setup(A, max_eig, min_eig, fraction, order, scale, variant, &coefs, + &ds_data); orig_u_vec = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A), hypre_ParCSRMatrixGlobalNumRows(A), @@ -445,7 +445,8 @@ hypre_ParCSRRelax_Cheby(hypre_ParCSRMatrix *A, /* matrix to relax with */ hypre_ParCSRMatrixRowStarts(A)); hypre_ParVectorInitialize_v2(tmp_vec, hypre_ParCSRMatrixMemoryLocation(A)); } - hypre_ParCSRRelax_Cheby_Solve(A, f, ds_data, coefs, order, scale, variant, u, v, r, orig_u_vec, tmp_vec); + hypre_ParCSRRelax_Cheby_Solve(A, f, ds_data, coefs, order, scale, variant, u, v, r, orig_u_vec, + tmp_vec); hypre_TFree(ds_data, hypre_ParCSRMatrixMemoryLocation(A)); hypre_TFree(coefs, HYPRE_MEMORY_HOST); @@ -480,12 +481,12 @@ hypre_ParCSRRelax_CG( HYPRE_Solver solver, hypre_MPI_Comm_rank(hypre_MPI_COMM_WORLD, &myid); HYPRE_PCGGetNumIterations(solver, &num_iterations); HYPRE_PCGGetFinalRelativeResidualNorm(solver, &final_res_norm); - if (myid ==0) + if (myid == 0) { hypre_printf(" -----CG PCG Iterations = %d\n", num_iterations); hypre_printf(" -----CG PCG Final Relative Residual Norm = %e\n", final_res_norm); } - } + } #endif return hypre_error_flag; @@ -503,22 +504,22 @@ hypre_ParCSRRelax_CG( HYPRE_Solver solver, */ HYPRE_Int -hypre_LINPACKcgtql1(HYPRE_Int *n,HYPRE_Real *d,HYPRE_Real *e,HYPRE_Int *ierr) +hypre_LINPACKcgtql1(HYPRE_Int *n, HYPRE_Real *d, HYPRE_Real *e, HYPRE_Int *ierr) { /* System generated locals */ - HYPRE_Int i__1,i__2; - HYPRE_Real d__1,d__2,c_b10 = 1.0; + HYPRE_Int i__1, i__2; + HYPRE_Real d__1, d__2, c_b10 = 1.0; /* Local variables */ - HYPRE_Real c,f,g,h; - HYPRE_Int i,j,l,m; - HYPRE_Real p,r,s,c2,c3 = 0.0; - HYPRE_Int l1,l2; + HYPRE_Real c, f, g, h; + HYPRE_Int i, j, l, m; + HYPRE_Real p, r, s, c2, c3 = 0.0; + HYPRE_Int l1, l2; HYPRE_Real s2 = 0.0; HYPRE_Int ii; - HYPRE_Real dl1,el1; + HYPRE_Real dl1, el1; HYPRE_Int mml; - HYPRE_Real tst1,tst2; + HYPRE_Real tst1, tst2; /* THIS SUBROUTINE IS A TRANSLATION OF THE ALGOL PROCEDURE TQL1, */ /* NUM. MATH. 11, 293-306(1968) BY BOWDLER, MARTIN, REINSCH, AND */ @@ -586,15 +587,16 @@ hypre_LINPACKcgtql1(HYPRE_Int *n,HYPRE_Real *d,HYPRE_Real *e,HYPRE_Int *ierr) for (l = 1; l <= i__1; ++l) { j = 0; - h = (d__1 = d[l],fabs(d__1)) + (d__2 = e[l],fabs(d__2)); + h = (d__1 = d[l], hypre_abs(d__1)) + (d__2 = e[l], hypre_abs(d__2)); if (tst1 < h) { tst1 = h; } /* .......... LOOK FOR SMALL SUB-DIAGONAL ELEMENT .......... */ i__2 = *n; - for (m = l; m <= i__2; ++m) { - tst2 = tst1 + (d__1 = e[m],fabs(d__1)); + for (m = l; m <= i__2; ++m) + { + tst2 = tst1 + (d__1 = e[m], hypre_abs(d__1)); if (tst2 == tst1) { goto L120; @@ -602,12 +604,12 @@ hypre_LINPACKcgtql1(HYPRE_Int *n,HYPRE_Real *d,HYPRE_Real *e,HYPRE_Int *ierr) /* .......... E(N) IS ALWAYS ZERO,SO THERE IS NO EXIT */ /* THROUGH THE BOTTOM OF THE LOOP .......... */ } -L120: + L120: if (m == l) { goto L210; } -L130: + L130: if (j == 30) { goto L1000; @@ -618,10 +620,11 @@ hypre_LINPACKcgtql1(HYPRE_Int *n,HYPRE_Real *d,HYPRE_Real *e,HYPRE_Int *ierr) l2 = l1 + 1; g = d[l]; p = (d[l1] - g) / (e[l] * 2.); - r = hypre_LINPACKcgpthy(&p,&c_b10); - ds = 1.0; if (p < 0.0) ds = -1.0; - d[l] = e[l] / (p + ds*r); - d[l1] = e[l] * (p + ds*r); + r = hypre_LINPACKcgpthy(&p, &c_b10); + ds = 1.0; + if (p < 0.0) { ds = -1.0; } + d[l] = e[l] / (p + ds * r); + d[l1] = e[l] * (p + ds * r); dl1 = d[l1]; h = g - d[l]; if (l2 > *n) @@ -630,11 +633,12 @@ hypre_LINPACKcgtql1(HYPRE_Int *n,HYPRE_Real *d,HYPRE_Real *e,HYPRE_Int *ierr) } i__2 = *n; - for (i = l2; i <= i__2; ++i) { + for (i = l2; i <= i__2; ++i) + { d[i] -= h; } -L145: + L145: f += h; /* .......... QL TRANSFORMATION .......... */ p = d[m]; @@ -653,7 +657,7 @@ hypre_LINPACKcgtql1(HYPRE_Int *n,HYPRE_Real *d,HYPRE_Real *e,HYPRE_Int *ierr) i = m - ii; g = c * e[i]; h = c * p; - r = hypre_LINPACKcgpthy(&p,&e[i]); + r = hypre_LINPACKcgpthy(&p, &e[i]); e[i + 1] = s * r; s = e[i] / r; c = p / r; @@ -664,15 +668,16 @@ hypre_LINPACKcgtql1(HYPRE_Int *n,HYPRE_Real *d,HYPRE_Real *e,HYPRE_Int *ierr) p = -s * s2 * c3 * el1 * e[l] / dl1; e[l] = s * p; d[l] = c * p; - tst2 = tst1 + (d__1 = e[l],fabs(d__1)); + tst2 = tst1 + (d__1 = e[l], hypre_abs(d__1)); if (tst2 > tst1) { goto L130; } -L210: + L210: p = d[l] + f; /* .......... ORDER EIGENVALUES .......... */ - if (l == 1) { + if (l == 1) + { goto L250; } /* .......... FOR I=L STEP -1 UNTIL 2 DO -- .......... */ @@ -687,9 +692,9 @@ hypre_LINPACKcgtql1(HYPRE_Int *n,HYPRE_Real *d,HYPRE_Real *e,HYPRE_Int *ierr) d[i] = d[i - 1]; } -L250: + L250: i = 1; -L270: + L270: d[i] = p; } @@ -704,28 +709,28 @@ hypre_LINPACKcgtql1(HYPRE_Int *n,HYPRE_Real *d,HYPRE_Real *e,HYPRE_Int *ierr) } /* cgtql1_ */ HYPRE_Real -hypre_LINPACKcgpthy(HYPRE_Real *a,HYPRE_Real *b) +hypre_LINPACKcgpthy(HYPRE_Real *a, HYPRE_Real *b) { /* System generated locals */ - HYPRE_Real ret_val,d__1,d__2,d__3; + HYPRE_Real ret_val, d__1, d__2, d__3; /* Local variables */ - HYPRE_Real p,r,s,t,u; + HYPRE_Real p, r, s, t, u; /* FINDS DSQRT(A**2+B**2) WITHOUT OVERFLOW OR DESTRUCTIVE UNDERFLOW */ /* Computing MAX */ - d__1 = fabs(*a),d__2 = fabs(*b); - p = hypre_max(d__1,d__2); + d__1 = hypre_abs(*a), d__2 = hypre_abs(*b); + p = hypre_max(d__1, d__2); if (!p) { goto L20; } /* Computing MIN */ - d__2 = fabs(*a),d__3 = fabs(*b); + d__2 = hypre_abs(*a), d__3 = hypre_abs(*b); /* Computing 2nd power */ - d__1 = hypre_min(d__2,d__3) / p; + d__1 = hypre_min(d__2, d__3) / p; r = d__1 * d__1; L10: t = r + 4.; diff --git a/external/hypre/src/parcsr_ls/par_relax_more_device.c b/external/hypre/src/parcsr_ls/par_relax_more_device.c index 6cf1769b..2eeb334c 100644 --- a/external/hypre/src/parcsr_ls/par_relax_more_device.c +++ b/external/hypre/src/parcsr_ls/par_relax_more_device.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -12,9 +12,10 @@ * *****************************************************************************/ +#include "_hypre_onedpl.hpp" #include "_hypre_parcsr_ls.h" -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) #include "_hypre_utilities.hpp" /** @@ -22,26 +23,27 @@ * to be used for the MaxEigEstimate */ __global__ void -hypreCUDAKernel_CSRMaxEigEstimate(HYPRE_Int nrows, - HYPRE_Int *diag_ia, - HYPRE_Int *diag_ja, - HYPRE_Complex *diag_aa, - HYPRE_Int *offd_ia, - HYPRE_Int *offd_ja, - HYPRE_Complex *offd_aa, - HYPRE_Complex *row_sum_lower, - HYPRE_Complex *row_sum_upper, - HYPRE_Int scale) +hypreGPUKernel_CSRMaxEigEstimate(hypre_DeviceItem &item, + HYPRE_Int nrows, + HYPRE_Int *diag_ia, + HYPRE_Int *diag_ja, + HYPRE_Complex *diag_aa, + HYPRE_Int *offd_ia, + HYPRE_Int *offd_ja, + HYPRE_Complex *offd_aa, + HYPRE_Complex *row_sum_lower, + HYPRE_Complex *row_sum_upper, + HYPRE_Int scale) { - HYPRE_Int row_i = hypre_cuda_get_grid_warp_id<1, 1>(); + HYPRE_Int row_i = hypre_gpu_get_grid_warp_id<1, 1>(item); if (row_i >= nrows) { return; } - HYPRE_Int lane = hypre_cuda_get_lane_id<1>(); - HYPRE_Int p, q; + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); + HYPRE_Int p = 0, q; HYPRE_Complex diag_value = 0.0; HYPRE_Complex row_sum_i = 0.0; @@ -51,16 +53,11 @@ hypreCUDAKernel_CSRMaxEigEstimate(HYPRE_Int nrows, { p = read_only_load(diag_ia + row_i + lane); } - q = __shfl_sync(HYPRE_WARP_FULL_MASK, p, 1); - p = __shfl_sync(HYPRE_WARP_FULL_MASK, p, 0); + q = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 1); + p = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 0); - for (HYPRE_Int j = p + lane; __any_sync(HYPRE_WARP_FULL_MASK, j < q); j += HYPRE_WARP_SIZE) + for (HYPRE_Int j = p + lane; j < q; j += HYPRE_WARP_SIZE) { - if (j >= q) - { - continue; - } - HYPRE_Complex aij = read_only_load(&diag_aa[j]); if ( read_only_load(&diag_ja[j]) == row_i ) { @@ -68,7 +65,7 @@ hypreCUDAKernel_CSRMaxEigEstimate(HYPRE_Int nrows, } else { - row_sum_i += fabs(aij); + row_sum_i += hypre_abs(aij); } } @@ -76,24 +73,19 @@ hypreCUDAKernel_CSRMaxEigEstimate(HYPRE_Int nrows, { p = read_only_load(offd_ia + row_i + lane); } - q = __shfl_sync(HYPRE_WARP_FULL_MASK, p, 1); - p = __shfl_sync(HYPRE_WARP_FULL_MASK, p, 0); + q = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 1); + p = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 0); - for (HYPRE_Int j = p + lane; __any_sync(HYPRE_WARP_FULL_MASK, j < q); j += HYPRE_WARP_SIZE) + for (HYPRE_Int j = p + lane; j < q; j += HYPRE_WARP_SIZE) { - if (j >= q) - { - continue; - } - HYPRE_Complex aij = read_only_load(&offd_aa[j]); - row_sum_i += fabs(aij); + row_sum_i += hypre_abs(aij); } // Get the row_sum and diagonal value on lane 0 - row_sum_i = warp_reduce_sum(row_sum_i); + row_sum_i = warp_reduce_sum(item, row_sum_i); - diag_value = warp_reduce_sum(diag_value); + diag_value = warp_reduce_sum(item, diag_value); if (lane == 0) { @@ -102,8 +94,8 @@ hypreCUDAKernel_CSRMaxEigEstimate(HYPRE_Int nrows, if (scale) { - lower /= hypre_abs(diag_value); - upper /= hypre_abs(diag_value); + lower /= hypre_abs(diag_value); + upper /= hypre_abs(diag_value); } row_sum_upper[row_i] = upper; @@ -139,8 +131,10 @@ hypre_ParCSRMaxEigEstimateDevice( hypre_ParCSRMatrix *A, A_num_rows = hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(A)); - HYPRE_Real *rowsums_lower = hypre_TAlloc(HYPRE_Real, A_num_rows, hypre_ParCSRMatrixMemoryLocation(A)); - HYPRE_Real *rowsums_upper = hypre_TAlloc(HYPRE_Real, A_num_rows, hypre_ParCSRMatrixMemoryLocation(A)); + HYPRE_Real *rowsums_lower = hypre_TAlloc(HYPRE_Real, A_num_rows, + hypre_ParCSRMatrixMemoryLocation(A)); + HYPRE_Real *rowsums_upper = hypre_TAlloc(HYPRE_Real, A_num_rows, + hypre_ParCSRMatrixMemoryLocation(A)); A_diag_i = hypre_CSRMatrixI(hypre_ParCSRMatrixDiag(A)); A_diag_j = hypre_CSRMatrixJ(hypre_ParCSRMatrixDiag(A)); @@ -149,28 +143,35 @@ hypre_ParCSRMaxEigEstimateDevice( hypre_ParCSRMatrix *A, A_offd_j = hypre_CSRMatrixJ(hypre_ParCSRMatrixOffd(A)); A_offd_data = hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(A)); - dim3 bDim, gDim; - - bDim = hypre_GetDefaultCUDABlockDimension(); - gDim = hypre_GetDefaultCUDAGridDimension(A_num_rows, "warp", bDim); - HYPRE_CUDA_LAUNCH(hypreCUDAKernel_CSRMaxEigEstimate, - gDim, - bDim, - A_num_rows, - A_diag_i, - A_diag_j, - A_diag_data, - A_offd_i, - A_offd_j, - A_offd_data, - rowsums_lower, - rowsums_upper, - scale); - - hypre_SyncCudaComputeStream(hypre_handle()); - - e_min = HYPRE_THRUST_CALL(reduce, rowsums_lower, rowsums_lower + A_num_rows, (HYPRE_Real)0, thrust::minimum()); - e_max = HYPRE_THRUST_CALL(reduce, rowsums_upper, rowsums_upper + A_num_rows, (HYPRE_Real)0, thrust::maximum()); + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(A_num_rows, "warp", bDim); + HYPRE_GPU_LAUNCH(hypreGPUKernel_CSRMaxEigEstimate, + gDim, + bDim, + A_num_rows, + A_diag_i, + A_diag_j, + A_diag_data, + A_offd_i, + A_offd_j, + A_offd_data, + rowsums_lower, + rowsums_upper, + scale); + + hypre_SyncComputeStream(); + +#if defined(HYPRE_USING_SYCL) + e_min = HYPRE_ONEDPL_CALL(std::reduce, rowsums_lower, rowsums_lower + A_num_rows, (HYPRE_Real)0, + oneapi::dpl::minimum()); + e_max = HYPRE_ONEDPL_CALL(std::reduce, rowsums_upper, rowsums_upper + A_num_rows, (HYPRE_Real)0, + oneapi::dpl::maximum()); +#else + e_min = HYPRE_THRUST_CALL(reduce, rowsums_lower, rowsums_lower + A_num_rows, (HYPRE_Real)0, + thrust::minimum()); + e_max = HYPRE_THRUST_CALL(reduce, rowsums_upper, rowsums_upper + A_num_rows, (HYPRE_Real)0, + thrust::maximum()); +#endif /* Same as hypre_ParCSRMaxEigEstimateHost */ @@ -180,7 +181,8 @@ hypre_ParCSRMaxEigEstimateDevice( hypre_ParCSRMatrix *A, send_buf[0] = -e_min; send_buf[1] = e_max; - hypre_MPI_Allreduce(send_buf, recv_buf, 2, HYPRE_MPI_REAL, hypre_MPI_MAX, hypre_ParCSRMatrixComm(A)); + hypre_MPI_Allreduce(send_buf, recv_buf, 2, HYPRE_MPI_REAL, hypre_MPI_MAX, + hypre_ParCSRMatrixComm(A)); /* return */ if ( hypre_abs(e_min) > hypre_abs(e_max) ) @@ -216,9 +218,7 @@ hypre_ParCSRMaxEigEstimateCGDevice(hypre_ParCSRMatrix *A, /* matrix to relax HYPRE_Real *max_eig, HYPRE_Real *min_eig) { -#if defined(HYPRE_USING_CUDA) hypre_GpuProfilingPushRange("ParCSRMaxEigEstimate_Setup"); -#endif HYPRE_Int i, err; hypre_ParVector *p; hypre_ParVector *s; @@ -243,9 +243,7 @@ hypre_ParCSRMaxEigEstimateCGDevice(hypre_ParCSRMatrix *A, /* matrix to relax max_iter = (HYPRE_Int)size; } -#if defined(HYPRE_USING_CUDA) hypre_GpuProfilingPushRange("ParCSRMaxEigEstimate_Setup_DataAlloc"); -#endif /* create some temp vectors: p, s, r , ds, u*/ r = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A), hypre_ParCSRMatrixGlobalNumRows(A), @@ -280,57 +278,45 @@ hypre_ParCSRMaxEigEstimateCGDevice(hypre_ParCSRMatrix *A, /* matrix to relax u_data = hypre_VectorData(hypre_ParVectorLocalVector(u)); r_data = hypre_VectorData(hypre_ParVectorLocalVector(r)); -#if defined(HYPRE_USING_CUDA) hypre_GpuProfilingPopRange(); /*Setup Data Alloc*/ -#endif -#if defined(HYPRE_USING_CUDA) hypre_GpuProfilingPushRange("ParCSRMaxEigEstimate_Setup_CPUAlloc_Setup"); -#endif -#if defined(HYPRE_USING_CUDA) hypre_GpuProfilingPushRange("ParCSRMaxEigEstimate_Setup_CPUAlloc_Setup_Alloc"); -#endif /* make room for tri-diag matrix */ tridiag = hypre_CTAlloc(HYPRE_Real, max_iter + 1, HYPRE_MEMORY_HOST); trioffd = hypre_CTAlloc(HYPRE_Real, max_iter + 1, HYPRE_MEMORY_HOST); -#if defined(HYPRE_USING_CUDA) hypre_GpuProfilingPopRange(); /*SETUP_Alloc*/ -#endif -#if defined(HYPRE_USING_CUDA) hypre_GpuProfilingPushRange("ParCSRMaxEigEstimate_Setup_CPUAlloc_Zeroing"); -#endif for (i = 0; i < max_iter + 1; i++) { tridiag[i] = 0; trioffd[i] = 0; } -#if defined(HYPRE_USING_CUDA) hypre_GpuProfilingPopRange(); /*Zeroing */ -#endif -#if defined(HYPRE_USING_CUDA) hypre_GpuProfilingPushRange("ParCSRMaxEigEstimate_Setup_CPUAlloc_Random"); -#endif /* set residual to random */ - hypre_CurandUniform(local_size, r_data, 0, 0, 0, 0); - - hypre_SyncCudaComputeStream(hypre_handle()); - - HYPRE_THRUST_CALL(transform, - r_data, r_data + local_size, r_data, - 2.0 * _1 - 1.0); + hypre_CurandUniform(local_size, r_data, 0, 0, 0, 0); + + hypre_SyncComputeStream(); + +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL(std::transform, + r_data, r_data + local_size, r_data, + [] (auto x) { return 2.0 * x - 1.0; } ); +#else + HYPRE_THRUST_CALL(transform, + r_data, r_data + local_size, r_data, + 2.0 * _1 - 1.0); +#endif -#if defined(HYPRE_USING_CUDA) hypre_GpuProfilingPopRange(); /*CPUAlloc_Random*/ -#endif -#if defined(HYPRE_USING_CUDA) hypre_GpuProfilingPushRange("ParCSRMaxEigEstimate_Setup_CPUAlloc_Diag"); -#endif if (scale) { @@ -342,19 +328,10 @@ hypre_ParCSRMaxEigEstimateCGDevice(hypre_ParCSRMatrix *A, /* matrix to relax hypre_ParVectorSetConstantValues(ds, 1.0); } -#if defined(HYPRE_USING_CUDA) hypre_GpuProfilingPopRange(); /*Setup_CPUAlloc__Diag */ -#endif -#if defined(HYPRE_USING_CUDA) /*CPUAlloc_Setup */ - hypre_GpuProfilingPopRange(); -#endif - -#if defined(HYPRE_USING_CUDA) + hypre_GpuProfilingPopRange(); /*CPUAlloc_Setup */ hypre_GpuProfilingPopRange(); /* Setup */ -#endif -#if defined(HYPRE_USING_CUDA) hypre_GpuProfilingPushRange("ParCSRMaxEigEstimate_Iter"); -#endif /* gamma = */ gamma = hypre_ParVectorInnerProd(r, p); @@ -373,6 +350,11 @@ hypre_ParCSRMaxEigEstimateCGDevice(hypre_ParCSRMatrix *A, /* matrix to relax gamma_old = gamma; gamma = hypre_ParVectorInnerProd(r, s); + if (gamma < HYPRE_REAL_EPSILON) + { + break; + } + if (i == 0) { beta = 1.0; @@ -385,9 +367,7 @@ hypre_ParCSRMaxEigEstimateCGDevice(hypre_ParCSRMatrix *A, /* matrix to relax beta = gamma / gamma_old; /* p = s + beta p */ - HYPRE_THRUST_CALL(transform, - s_data, s_data + local_size, p_data, p_data, - _1 + beta * _2); + hypreDevice_ComplexAxpyn(p_data, local_size, s_data, p_data, beta); } if (scale) @@ -395,12 +375,22 @@ hypre_ParCSRMaxEigEstimateCGDevice(hypre_ParCSRMatrix *A, /* matrix to relax /* s = D^{-1/2}A*D^{-1/2}*p */ /* u = ds .* p */ +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::transform, ds_data, ds_data + local_size, p_data, u_data, + [] (auto x, auto y) { return x * y; } ); +#else HYPRE_THRUST_CALL( transform, ds_data, ds_data + local_size, p_data, u_data, _1 * _2 ); +#endif hypre_ParCSRMatrixMatvec(1.0, A, u, 0.0, s); /* s = ds .* s */ +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::transform, ds_data, ds_data + local_size, s_data, s_data, + [] (auto x, auto y) { return x * y; } ); +#else HYPRE_THRUST_CALL( transform, ds_data, ds_data + local_size, s_data, s_data, _1 * _2 ); +#endif } else { @@ -422,7 +412,7 @@ hypre_ParCSRMaxEigEstimateCGDevice(hypre_ParCSRMatrix *A, /* matrix to relax tridiag[i] += alphainv; trioffd[i + 1] = alphainv; - trioffd[i] *= sqrt(beta); + trioffd[i] *= hypre_sqrt(beta); /* x = x + alpha*p */ /* don't need */ @@ -446,21 +436,15 @@ hypre_ParCSRMaxEigEstimateCGDevice(hypre_ParCSRMatrix *A, /* matrix to relax * but I am not certain, nor do I have the legal knowledge to know if the * license is compatible with that which HYPRE is released under. */ -#if defined(HYPRE_USING_CUDA) hypre_GpuProfilingPopRange(); -#endif -#if defined(HYPRE_USING_CUDA) hypre_GpuProfilingPushRange("ParCSRMaxEigEstimate_TriDiagEigenSolve"); -#endif /* eispack routine - eigenvalues return in tridiag and ordered*/ hypre_LINPACKcgtql1(&i, tridiag, trioffd, &err); lambda_max = tridiag[i - 1]; lambda_min = tridiag[0]; -#if defined(HYPRE_USING_CUDA) hypre_GpuProfilingPopRange(); -#endif /* hypre_printf("linpack max eig est = %g\n", lambda_max);*/ /* hypre_printf("linpack min eig est = %g\n", lambda_min);*/ diff --git a/external/hypre/src/parcsr_ls/par_restr.c b/external/hypre/src/parcsr_ls/par_restr.c index 5d1772e1..ba1cabd5 100644 --- a/external/hypre/src/parcsr_ls/par_restr.c +++ b/external/hypre/src/parcsr_ls/par_restr.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -13,8 +13,10 @@ #define EPSILON 1e-18 #define EPSIMAC 1e-16 -void hypre_fgmresT(HYPRE_Int n, HYPRE_Complex *A, HYPRE_Complex *b, HYPRE_Real tol, HYPRE_Int kdim, HYPRE_Complex *x, HYPRE_Real *relres, HYPRE_Int *iter, HYPRE_Int job); -void hypre_ordered_GS(const HYPRE_Complex L[], const HYPRE_Complex rhs[], HYPRE_Complex x[], const HYPRE_Int n); +void hypre_fgmresT(HYPRE_Int n, HYPRE_Complex *A, HYPRE_Complex *b, HYPRE_Real tol, HYPRE_Int kdim, + HYPRE_Complex *x, HYPRE_Real *relres, HYPRE_Int *iter, HYPRE_Int job); +void hypre_ordered_GS(const HYPRE_Complex L[], const HYPRE_Complex rhs[], HYPRE_Complex x[], + const HYPRE_Int n); HYPRE_Int hypre_BoomerAMGBuildRestrAIR( hypre_ParCSRMatrix *A, @@ -29,6 +31,7 @@ hypre_BoomerAMGBuildRestrAIR( hypre_ParCSRMatrix *A, HYPRE_Int is_triangular, HYPRE_Int gmres_switch) { + HYPRE_UNUSED_VAR(debug_flag); MPI_Comm comm = hypre_ParCSRMatrixComm(A); hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); @@ -113,11 +116,11 @@ hypre_BoomerAMGBuildRestrAIR( hypre_ParCSRMatrix *A, /*-------------- global number of C points and my start position */ /*my_first_cpt = num_cpts_global[0];*/ - if (my_id == (num_procs -1)) + if (my_id == (num_procs - 1)) { total_global_cpts = num_cpts_global[1]; } - hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); + hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); /*------------------------------------------------------------------- * Get the CF_marker data for the off-processor columns @@ -125,12 +128,12 @@ hypre_BoomerAMGBuildRestrAIR( hypre_ParCSRMatrix *A, /* CF marker for the off-diag columns */ if (num_cols_A_offd) { - CF_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd,HYPRE_MEMORY_HOST); + CF_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); } /* function type indicator for the off-diag columns */ if (num_functions > 1 && num_cols_A_offd) { - dof_func_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd,HYPRE_MEMORY_HOST); + dof_func_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); } /* if CommPkg of A is not present, create it */ if (!comm_pkg) @@ -142,7 +145,8 @@ hypre_BoomerAMGBuildRestrAIR( hypre_ParCSRMatrix *A, num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); /* send buffer, of size send_map_starts[num_sends]), * i.e., number of entries to send */ - int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends),HYPRE_MEMORY_HOST); + int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); /* copy CF markers of elements to send to buffer * RL: why copy them with two for loops? Why not just loop through all in one */ index = 0; @@ -151,10 +155,10 @@ hypre_BoomerAMGBuildRestrAIR( hypre_ParCSRMatrix *A, /* start pos of elements sent to send_proc[i] */ start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); /* loop through all elems to send_proc[i] */ - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { /* CF marker of send_map_elemts[j] */ - int_buf_data[index++] = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + int_buf_data[index++] = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } } /* create a handle to start communication. 11: for integer */ @@ -168,9 +172,9 @@ hypre_BoomerAMGBuildRestrAIR( hypre_ParCSRMatrix *A, for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j=start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { - int_buf_data[index++] = dof_func[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + int_buf_data[index++] = dof_func[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } } comm_handle = hypre_ParCSRCommHandleCreate(11, comm_pkg, int_buf_data, dof_func_offd); @@ -198,7 +202,7 @@ hypre_BoomerAMGBuildRestrAIR( hypre_ParCSRMatrix *A, * strongly influence i */ local_size = 0; /* loop through the diag part of S */ - for (j = S_diag_i[i]; j < S_diag_i[i+1]; j++) + for (j = S_diag_i[i]; j < S_diag_i[i + 1]; j++) { i1 = S_diag_j[j]; /* F point */ @@ -212,7 +216,7 @@ hypre_BoomerAMGBuildRestrAIR( hypre_ParCSRMatrix *A, if (num_procs > 1) { /* use this mapping to have offd indices of A */ - for (j = S_offd_i[i]; j < S_offd_i[i+1]; j++) + for (j = S_offd_i[i]; j < S_offd_i[i + 1]; j++) { i1 = S_offd_j[j]; if (CF_marker_offd[i1] < 0) @@ -234,15 +238,15 @@ hypre_BoomerAMGBuildRestrAIR( hypre_ParCSRMatrix *A, nnz_offd = cnt_offd; /*------------- allocate arrays */ - R_diag_i = hypre_CTAlloc(HYPRE_Int, n_cpts+1,HYPRE_MEMORY_HOST); - R_diag_j = hypre_CTAlloc(HYPRE_Int, nnz_diag,HYPRE_MEMORY_HOST); - R_diag_data = hypre_CTAlloc(HYPRE_Complex, nnz_diag,HYPRE_MEMORY_HOST); + R_diag_i = hypre_CTAlloc(HYPRE_Int, n_cpts + 1, HYPRE_MEMORY_HOST); + R_diag_j = hypre_CTAlloc(HYPRE_Int, nnz_diag, HYPRE_MEMORY_HOST); + R_diag_data = hypre_CTAlloc(HYPRE_Complex, nnz_diag, HYPRE_MEMORY_HOST); /* not in ``if num_procs > 1'', * allocation needed even for empty CSR */ - R_offd_i = hypre_CTAlloc(HYPRE_Int, n_cpts+1,HYPRE_MEMORY_HOST); - R_offd_j = hypre_CTAlloc(HYPRE_Int, nnz_offd,HYPRE_MEMORY_HOST); - R_offd_data = hypre_CTAlloc(HYPRE_Complex, nnz_offd,HYPRE_MEMORY_HOST); + R_offd_i = hypre_CTAlloc(HYPRE_Int, n_cpts + 1, HYPRE_MEMORY_HOST); + R_offd_j = hypre_CTAlloc(HYPRE_Int, nnz_offd, HYPRE_MEMORY_HOST); + R_offd_data = hypre_CTAlloc(HYPRE_Complex, nnz_offd, HYPRE_MEMORY_HOST); /* redundant */ R_diag_i[0] = 0; @@ -277,13 +281,13 @@ hypre_BoomerAMGBuildRestrAIR( hypre_ParCSRMatrix *A, marker_diag[i] = -1; } marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); - for (i = 0; i< num_cols_A_offd; i++) + for (i = 0; i < num_cols_A_offd; i++) { marker_offd[i] = -1; } // Allocate the rhs and dense local matrix in column-major form (for LAPACK) - DAi = hypre_CTAlloc(HYPRE_Complex, local_max_size*local_max_size, HYPRE_MEMORY_HOST); + DAi = hypre_CTAlloc(HYPRE_Complex, local_max_size * local_max_size, HYPRE_MEMORY_HOST); Dbi = hypre_CTAlloc(HYPRE_Complex, local_max_size, HYPRE_MEMORY_HOST); Dxi = hypre_CTAlloc(HYPRE_Complex, local_max_size, HYPRE_MEMORY_HOST); Ipi = hypre_CTAlloc(HYPRE_Int, local_max_size, HYPRE_MEMORY_HOST); // pivot matrix @@ -320,7 +324,7 @@ hypre_BoomerAMGBuildRestrAIR( hypre_ParCSRMatrix *A, * strongly influence i * Access S for the first time, mark the points we want */ /* 1: loop through the diag part of S */ - for (j = S_diag_i[i]; j < S_diag_i[i+1]; j++) + for (j = S_diag_i[i]; j < S_diag_i[i + 1]; j++) { i1 = S_diag_j[j]; /* F point */ @@ -334,7 +338,7 @@ hypre_BoomerAMGBuildRestrAIR( hypre_ParCSRMatrix *A, /* 2: if parallel, loop through the offd part */ if (num_procs > 1) { - for (j = S_offd_i[i]; j < S_offd_i[i+1]; j++) + for (j = S_offd_i[i]; j < S_offd_i[i + 1]; j++) { /* use this mapping to have offd indices of A */ i1 = S_offd_j[j]; @@ -384,7 +388,7 @@ hypre_BoomerAMGBuildRestrAIR( hypre_ParCSRMatrix *A, * rr is the local dense matrix row counter */ rr = 0; /* 1. diag part of row i */ - for (j = S_diag_i[i]; j < S_diag_i[i+1]; j++) + for (j = S_diag_i[i]; j < S_diag_i[i + 1]; j++) { /* row i1 */ i1 = S_diag_j[j]; @@ -393,7 +397,7 @@ hypre_BoomerAMGBuildRestrAIR( hypre_ParCSRMatrix *A, { /* go through row i1 of A: a local row */ /* diag part of row i1 */ - for (k = A_diag_i[i1]; k < A_diag_i[i1+1]; k++) + for (k = A_diag_i[i1]; k < A_diag_i[i1 + 1]; k++) { k1 = A_diag_j[k]; /* if this col is marked with its local dense id */ @@ -408,7 +412,7 @@ hypre_BoomerAMGBuildRestrAIR( hypre_ParCSRMatrix *A, /* if parallel, offd part of row i1 */ if (num_procs > 1) { - for (k = A_offd_i[i1]; k < A_offd_i[i1+1]; k++) + for (k = A_offd_i[i1]; k < A_offd_i[i1 + 1]; k++) { k1 = A_offd_j[k]; /* if this col is marked with its local dense id */ @@ -431,7 +435,7 @@ hypre_BoomerAMGBuildRestrAIR( hypre_ParCSRMatrix *A, if (num_procs > 1) { HYPRE_BigInt big_k1; - for (j = S_offd_i[i]; j < S_offd_i[i+1]; j++) + for (j = S_offd_i[i]; j < S_offd_i[i + 1]; j++) { /* row i1: use this mapping to have offd indices of A */ i1 = S_offd_j[j]; @@ -439,14 +443,14 @@ hypre_BoomerAMGBuildRestrAIR( hypre_ParCSRMatrix *A, if (CF_marker_offd[i1] < 0) { /* loop through row i1 of A_ext, a global CSR matrix */ - for (k = A_ext_i[i1]; k < A_ext_i[i1+1]; k++) + for (k = A_ext_i[i1]; k < A_ext_i[i1 + 1]; k++) { /* k1 is a global index! */ big_k1 = A_ext_j[k]; if (big_k1 >= col_start && big_k1 < col_end) { /* big_k1 is in the diag part, adjust to local index */ - k1 = (HYPRE_Int)(big_k1-col_start); + k1 = (HYPRE_Int)(big_k1 - col_start); /* if this col is marked with its local dense id*/ if ((cc = marker_diag[k1]) >= 0) { @@ -486,7 +490,7 @@ hypre_BoomerAMGBuildRestrAIR( hypre_ParCSRMatrix *A, /* assemble rhs bi: entries from row i of A */ rr = 0; /* diag part */ - for (j = A_diag_i[i]; j < A_diag_i[i+1]; j++) + for (j = A_diag_i[i]; j < A_diag_i[i + 1]; j++) { i1 = A_diag_j[j]; if ((cc = marker_diag[i1]) >= 0) @@ -503,7 +507,7 @@ hypre_BoomerAMGBuildRestrAIR( hypre_ParCSRMatrix *A, /* if parallel, offd part */ if (num_procs > 1) { - for (j = A_offd_i[i]; j < A_offd_i[i+1]; j++) + for (j = A_offd_i[i]; j < A_offd_i[i + 1]; j++) { i1 = A_offd_j[j]; if ((cc = marker_offd[i1]) >= 0) @@ -548,9 +552,10 @@ hypre_BoomerAMGBuildRestrAIR( hypre_ParCSRMatrix *A, else if (Aisol_method == 'L') { #if AIR_DEBUG - memcpy(TMPA, DAi, local_size*local_size*sizeof(HYPRE_Complex)); - memcpy(TMPb, Dbi, local_size*sizeof(HYPRE_Complex)); + memcpy(TMPA, DAi, local_size * local_size * sizeof(HYPRE_Complex)); + memcpy(TMPb, Dbi, local_size * sizeof(HYPRE_Complex)); #endif + lapack_info = 0; hypre_dgetrf(&local_size, &local_size, DAi, &local_size, Ipi, &lapack_info); @@ -600,9 +605,9 @@ hypre_BoomerAMGBuildRestrAIR( hypre_ParCSRMatrix *A, nrmb = hypre_dnrm2(&local_size, Dbi, &ione); hypre_daxpy(&local_size, &alp, Dbi, &ione, TMPd, &ione); err = hypre_dnrm2(&local_size, TMPd, &ione); - if (err/nrmb > gmresAi_tol) + if (err / nrmb > gmresAi_tol) { - hypre_printf("GMRES/Jacobi: res norm %e, nrmb %e, relative %e\n", err, nrmb, err/nrmb); + hypre_printf("GMRES/Jacobi: res norm %e, nrmb %e, relative %e\n", err, nrmb, err / nrmb); hypre_printf("GMRES/Jacobi: relative %e\n", gmresAi_res); exit(0); } @@ -610,12 +615,12 @@ hypre_BoomerAMGBuildRestrAIR( hypre_ParCSRMatrix *A, } } - HYPRE_Complex *Soli = (is_triangular || (Aisol_method=='G')) ? Dxi : Dbi; + HYPRE_Complex *Soli = (is_triangular || (Aisol_method == 'G')) ? Dxi : Dbi; /* now we are ready to fill this row of R */ /* diag part */ rr = 0; - for (j = S_diag_i[i]; j < S_diag_i[i+1]; j++) + for (j = S_diag_i[i]; j < S_diag_i[i + 1]; j++) { i1 = S_diag_j[j]; /* F point */ @@ -635,12 +640,12 @@ hypre_BoomerAMGBuildRestrAIR( hypre_ParCSRMatrix *A, R_diag_data[cnt_diag++] = 1.0; /* row ptr of the next row */ - R_diag_i[ic+1] = cnt_diag; + R_diag_i[ic + 1] = cnt_diag; /* offd part */ if (num_procs > 1) { - for (j = S_offd_i[i]; j < S_offd_i[i+1]; j++) + for (j = S_offd_i[i]; j < S_offd_i[i + 1]; j++) { /* use this mapping to have offd indices of A */ i1 = S_offd_j[j]; @@ -657,13 +662,13 @@ hypre_BoomerAMGBuildRestrAIR( hypre_ParCSRMatrix *A, } } /* row ptr of the next row */ - R_offd_i[ic+1] = cnt_offd; + R_offd_i[ic + 1] = cnt_offd; /* we must have copied all entries */ hypre_assert(rr == local_size); /* reset markers */ - for (j = S_diag_i[i]; j < S_diag_i[i+1]; j++) + for (j = S_diag_i[i]; j < S_diag_i[i + 1]; j++) { i1 = S_diag_j[j]; /* F point */ @@ -675,7 +680,7 @@ hypre_BoomerAMGBuildRestrAIR( hypre_ParCSRMatrix *A, } if (num_procs > 1) { - for (j = S_offd_i[i]; j < S_offd_i[i+1]; j++) + for (j = S_offd_i[i]; j < S_offd_i[i + 1]; j++) { /* use this mapping to have offd indices of A */ i1 = S_offd_j[j]; @@ -770,7 +775,8 @@ hypre_BoomerAMGBuildRestrAIR( hypre_ParCSRMatrix *A, hypre_MatvecCommPkgCreate(R); /* Filter small entries from R */ - if (filter_thresholdR > 0) { + if (filter_thresholdR > 0) + { hypre_ParCSRMatrixDropSmallEntries(R, filter_thresholdR, -1); } @@ -805,16 +811,19 @@ hypre_BoomerAMGBuildRestrAIR( hypre_ParCSRMatrix *A, return 0; } - /* Compute matvec A^Tx = y, where A is stored in column major form. */ // This can also probably be accomplished with BLAS -static inline void colmaj_mvT(HYPRE_Complex *A, HYPRE_Complex *x, HYPRE_Complex *y, HYPRE_Int n) +static inline void +colmaj_mvT(HYPRE_Complex *A, + HYPRE_Complex *x, + HYPRE_Complex *y, + HYPRE_Int n) { - memset(y, 0, n*sizeof(HYPRE_Complex)); + memset(y, 0, n * sizeof(HYPRE_Complex)); HYPRE_Int i, j; for (i = 0; i < n; i++) { - HYPRE_Int row0 = i*n; + HYPRE_Int row0 = i * n; for (j = 0; j < n; j++) { y[i] += x[j] * A[row0 + j]; @@ -823,32 +832,32 @@ static inline void colmaj_mvT(HYPRE_Complex *A, HYPRE_Complex *x, HYPRE_Complex } // TODO : need to initialize and de-initialize GMRES -void hypre_fgmresT(HYPRE_Int n, - HYPRE_Complex *A, - HYPRE_Complex *b, - HYPRE_Real tol, - HYPRE_Int kdim, - HYPRE_Complex *x, - HYPRE_Real *relres, - HYPRE_Int *iter, - HYPRE_Int job) +void +hypre_fgmresT(HYPRE_Int n, + HYPRE_Complex *A, + HYPRE_Complex *b, + HYPRE_Real tol, + HYPRE_Int kdim, + HYPRE_Complex *x, + HYPRE_Real *relres, + HYPRE_Int *iter, + HYPRE_Int job) { - - HYPRE_Int one=1, i, j, k; - static HYPRE_Complex *V=NULL, *Z=NULL, *H=NULL, *c=NULL, *s=NULL, *rs=NULL; + HYPRE_Int one = 1, i, j, k; + static HYPRE_Complex *V = NULL, *Z = NULL, *H = NULL, *c = NULL, *s = NULL, *rs = NULL; HYPRE_Complex *v, *z, *w; HYPRE_Real t, normr, normr0, tolr; if (job == -1) { - V = hypre_TAlloc(HYPRE_Complex, n*(kdim+1), HYPRE_MEMORY_HOST); + V = hypre_TAlloc(HYPRE_Complex, n * (kdim + 1), HYPRE_MEMORY_HOST); /* Z = hypre_TAlloc(HYPRE_Complex, n*kdim, HYPRE_MEMORY_HOST); */ /* XXX NO PRECOND */ Z = V; - H = hypre_TAlloc(HYPRE_Complex, (kdim+1)*kdim, HYPRE_MEMORY_HOST); + H = hypre_TAlloc(HYPRE_Complex, (kdim + 1) * kdim, HYPRE_MEMORY_HOST); c = hypre_TAlloc(HYPRE_Complex, kdim, HYPRE_MEMORY_HOST); s = hypre_TAlloc(HYPRE_Complex, kdim, HYPRE_MEMORY_HOST); - rs = hypre_TAlloc(HYPRE_Complex, kdim+1, HYPRE_MEMORY_HOST); + rs = hypre_TAlloc(HYPRE_Complex, kdim + 1, HYPRE_MEMORY_HOST); return; } else if (job == -2) @@ -866,7 +875,7 @@ void hypre_fgmresT(HYPRE_Int n, /* XXX: x_0 is all ZERO !!! so r0 = b */ v = V; hypre_TMemcpy(v, b, HYPRE_Complex, n, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); - normr0 = sqrt(hypre_ddot(&n, v, &one, v, &one)); + normr = normr0 = hypre_sqrt(hypre_ddot(&n, v, &one, v, &one)); if (normr0 < EPSIMAC) { @@ -883,8 +892,8 @@ void hypre_fgmresT(HYPRE_Int n, { i++; // zi = M^{-1} * vi; - v = V + (i-1) * n; - z = Z + (i-1) * n; + v = V + (i - 1) * n; + z = Z + (i - 1) * n; /* XXX NO PRECOND */ /* memcpy(z, v, n*sizeof(HYPRE_Complex)); */ // w = v_{i+1} = A * zi @@ -894,12 +903,12 @@ void hypre_fgmresT(HYPRE_Int n, for (j = 0; j < i; j++) { v = V + j * n; - H[j+(i-1)*kdim] = t = hypre_ddot(&n, v, &one, w, &one); + H[j + (i - 1)*kdim] = t = hypre_ddot(&n, v, &one, w, &one); t = -t; hypre_daxpy(&n, &t, v, &one, w, &one); } - H[i+(i-1)*kdim] = t = sqrt(hypre_ddot(&n, w, &one, w, &one)); - if (fabs(t) > EPSILON) + H[i + (i - 1)*kdim] = t = hypre_sqrt(hypre_ddot(&n, w, &one, w, &one)); + if (hypre_abs(t) > EPSILON) { t = 1.0 / t; hypre_dscal(&n, &t, w, &one); @@ -907,25 +916,25 @@ void hypre_fgmresT(HYPRE_Int n, // Least square problem of H for (j = 1; j < i; j++) { - t = H[j-1+(i-1)*kdim]; - H[j-1+(i-1)*kdim] = c[j-1]*t + s[j-1]*H[j+(i-1)*kdim]; - H[j+(i-1)*kdim] = -s[j-1]*t + c[j-1]*H[j+(i-1)*kdim]; + t = H[j - 1 + (i - 1) * kdim]; + H[j - 1 + (i - 1)*kdim] = c[j - 1] * t + s[j - 1] * H[j + (i - 1) * kdim]; + H[j + (i - 1)*kdim] = -s[j - 1] * t + c[j - 1] * H[j + (i - 1) * kdim]; } - HYPRE_Complex hii = H[i-1+(i-1)*kdim]; - HYPRE_Complex hii1 = H[i+(i-1)*kdim]; - HYPRE_Complex gam = sqrt(hii*hii + hii1*hii1); + HYPRE_Complex hii = H[i - 1 + (i - 1) * kdim]; + HYPRE_Complex hii1 = H[i + (i - 1) * kdim]; + HYPRE_Complex gam = hypre_sqrt(hii * hii + hii1 * hii1); - if (fabs(gam) < EPSILON) + if (hypre_cabs(gam) < EPSILON) { gam = EPSIMAC; } - c[i-1] = hii / gam; - s[i-1] = hii1 / gam; - rs[i] = -s[i-1] * rs[i-1]; - rs[i-1] = c[i-1] * rs[i-1]; + c[i - 1] = hii / gam; + s[i - 1] = hii1 / gam; + rs[i] = -s[i - 1] * rs[i - 1]; + rs[i - 1] = c[i - 1] * rs[i - 1]; // residue norm - H[i-1+(i-1)*kdim] = c[i-1]*hii + s[i-1]*hii1; - normr = fabs(rs[i]); + H[i - 1 + (i - 1)*kdim] = c[i - 1] * hii + s[i - 1] * hii1; + normr = hypre_cabs(rs[i]); if (normr <= tolr) { break; @@ -933,33 +942,34 @@ void hypre_fgmresT(HYPRE_Int n, } // solve the upper triangular system - rs[i-1] /= H[i-1+(i-1)*kdim]; - for (k = i-2; k >= 0; k--) + rs[i - 1] /= H[i - 1 + (i - 1) * kdim]; + for (k = i - 2; k >= 0; k--) { - for (j = k+1; j < i; j++) + for (j = k + 1; j < i; j++) { - rs[k] -= H[k+j*kdim]*rs[j]; + rs[k] -= H[k + j * kdim] * rs[j]; } - rs[k] /= H[k+k*kdim]; + rs[k] /= H[k + k * kdim]; } + // get solution for (j = 0; j < i; j++) { z = Z + j * n; - hypre_daxpy(&n, rs+j, z, &one, x, &one); + hypre_daxpy(&n, rs + j, z, &one, x, &one); } *relres = normr / normr0; *iter = i; } - /* Ordered Gauss Seidel on A^T in column major format. Since we are * solving A^T, equivalent to solving A in row major format. */ -void hypre_ordered_GS(const HYPRE_Complex L[], - const HYPRE_Complex rhs[], - HYPRE_Complex x[], - const HYPRE_Int n) +void +hypre_ordered_GS(const HYPRE_Complex L[], + const HYPRE_Complex rhs[], + HYPRE_Complex x[], + const HYPRE_Int n) { // Get triangular ordering of L^T in col major as ordering of L in row major HYPRE_Int *ordering = hypre_TAlloc(HYPRE_Int, n, HYPRE_MEMORY_HOST); @@ -975,11 +985,12 @@ void hypre_ordered_GS(const HYPRE_Complex L[], { if (col != row) { - temp -= L[row*n+col] * x[col]; // row-major + temp -= L[row * n + col] * x[col]; // row-major } } - HYPRE_Complex diag = L[row*n + row]; - if (fabs(diag) < 1e-12) + + HYPRE_Complex diag = L[row * n + row]; + if (hypre_cabs(diag) < 1e-12) { x[row] = 0.0; } diff --git a/external/hypre/src/parcsr_ls/par_rotate_7pt.c b/external/hypre/src/parcsr_ls/par_rotate_7pt.c index f1aa6ee3..cf11eb75 100644 --- a/external/hypre/src/parcsr_ls/par_rotate_7pt.c +++ b/external/hypre/src/parcsr_ls/par_rotate_7pt.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -31,12 +31,12 @@ GenerateRotate7pt( MPI_Comm comm, HYPRE_Real *diag_data; HYPRE_Int *offd_i; - HYPRE_Int *offd_j; - HYPRE_Real *offd_data; + HYPRE_Int *offd_j = NULL; + HYPRE_Real *offd_data = NULL; HYPRE_Real *value; HYPRE_Real ac, bc, cc, s, c, pi, x; - HYPRE_BigInt *global_part; + HYPRE_BigInt global_part[2]; HYPRE_BigInt ix, iy; HYPRE_Int cnt, o_cnt; HYPRE_Int local_num_rows; @@ -55,52 +55,51 @@ GenerateRotate7pt( MPI_Comm comm, HYPRE_Int num_procs; HYPRE_Int P_busy, Q_busy; - hypre_MPI_Comm_size(comm,&num_procs); + hypre_MPI_Comm_size(comm, &num_procs); - grid_size = nx*ny; + grid_size = nx * ny; value = hypre_CTAlloc(HYPRE_Real, 4, HYPRE_MEMORY_HOST); - pi = 4.0*atan(1.0); - x = pi*alpha/180.0; - s = sin(x); - c = cos(x); - ac = -(c*c + eps*s*s); - bc = 2.0*(1.0 - eps)*s*c; - cc = -(s*s + eps*c*c); - value[0] = -2*(2*ac+bc+2*cc); - value[1] = 2*ac+bc; - value[2] = bc+2*cc; + pi = 4.0 * hypre_atan(1.0); + x = pi * alpha / 180.0; + s = hypre_sin(x); + c = hypre_cos(x); + ac = -(c * c + eps * s * s); + bc = 2.0 * (1.0 - eps) * s * c; + cc = -(s * s + eps * c * c); + value[0] = -2 * (2 * ac + bc + 2 * cc); + value[1] = 2 * ac + bc; + value[2] = bc + 2 * cc; value[3] = -bc; - hypre_GeneratePartitioning(nx,P,&nx_part); - hypre_GeneratePartitioning(ny,Q,&ny_part); + hypre_GeneratePartitioning(nx, P, &nx_part); + hypre_GeneratePartitioning(ny, Q, &ny_part); - nx_local = (HYPRE_Int)(nx_part[p+1] - nx_part[p]); - ny_local = (HYPRE_Int)(ny_part[q+1] - ny_part[q]); + nx_local = (HYPRE_Int)(nx_part[p + 1] - nx_part[p]); + ny_local = (HYPRE_Int)(ny_part[q + 1] - ny_part[q]); - local_num_rows = nx_local*ny_local; + local_num_rows = nx_local * ny_local; - global_part = hypre_CTAlloc(HYPRE_BigInt, 2, HYPRE_MEMORY_HOST); - global_part[0] = ny_part[q]*nx + nx_part[p]*ny_local; - global_part[1] = global_part[0]+(HYPRE_BigInt)local_num_rows; + global_part[0] = ny_part[q] * nx + nx_part[p] * ny_local; + global_part[1] = global_part[0] + (HYPRE_BigInt)local_num_rows; - diag_i = hypre_CTAlloc(HYPRE_Int, local_num_rows+1, HYPRE_MEMORY_HOST); - offd_i = hypre_CTAlloc(HYPRE_Int, local_num_rows+1, HYPRE_MEMORY_HOST); + diag_i = hypre_CTAlloc(HYPRE_Int, local_num_rows + 1, HYPRE_MEMORY_HOST); + offd_i = hypre_CTAlloc(HYPRE_Int, local_num_rows + 1, HYPRE_MEMORY_HOST); - P_busy = hypre_min(nx,P); - Q_busy = hypre_min(ny,Q); + P_busy = hypre_min(nx, P); + Q_busy = hypre_min(ny, Q); num_cols_offd = 0; - if (p) num_cols_offd += ny_local; - if (p < P_busy-1) num_cols_offd += ny_local; - if (q) num_cols_offd += nx_local; - if (q < Q_busy-1) num_cols_offd += nx_local; - if (p && q) num_cols_offd++; - if (p && q < Q_busy-1 ) num_cols_offd++; - if (p < P_busy-1 && q ) num_cols_offd++; - if (p < P_busy-1 && q < Q_busy-1 ) num_cols_offd++; + if (p) { num_cols_offd += ny_local; } + if (p < P_busy - 1) { num_cols_offd += ny_local; } + if (q) { num_cols_offd += nx_local; } + if (q < Q_busy - 1) { num_cols_offd += nx_local; } + if (p && q) { num_cols_offd++; } + if (p && q < Q_busy - 1 ) { num_cols_offd++; } + if (p < P_busy - 1 && q ) { num_cols_offd++; } + if (p < P_busy - 1 && q < Q_busy - 1 ) { num_cols_offd++; } - if (!local_num_rows) num_cols_offd = 0; + if (!local_num_rows) { num_cols_offd = 0; } col_map_offd = hypre_CTAlloc(HYPRE_BigInt, num_cols_offd, HYPRE_MEMORY_HOST); @@ -108,14 +107,14 @@ GenerateRotate7pt( MPI_Comm comm, o_cnt = 0; diag_i[0] = 0; offd_i[0] = 0; - for (iy = ny_part[q]; iy < ny_part[q+1]; iy++) + for (iy = ny_part[q]; iy < ny_part[q + 1]; iy++) { - for (ix = nx_part[p]; ix < nx_part[p+1]; ix++) + for (ix = nx_part[p]; ix < nx_part[p + 1]; ix++) { cnt++; o_cnt++; - diag_i[cnt] = diag_i[cnt-1]; - offd_i[o_cnt] = offd_i[o_cnt-1]; + diag_i[cnt] = diag_i[cnt - 1]; + offd_i[o_cnt] = offd_i[o_cnt - 1]; diag_i[cnt]++; if (iy > ny_part[q]) { @@ -127,7 +126,9 @@ GenerateRotate7pt( MPI_Comm comm, else { if (ix) + { offd_i[o_cnt]++; + } } } else @@ -146,7 +147,9 @@ GenerateRotate7pt( MPI_Comm comm, } } if (ix > nx_part[p]) + { diag_i[cnt]++; + } else { if (ix) @@ -154,38 +157,42 @@ GenerateRotate7pt( MPI_Comm comm, offd_i[o_cnt]++; } } - if (ix+1 < nx_part[p+1]) + if (ix + 1 < nx_part[p + 1]) + { diag_i[cnt]++; + } else { - if (ix+1 < nx) + if (ix + 1 < nx) { offd_i[o_cnt]++; } } - if (iy+1 < ny_part[q+1]) + if (iy + 1 < ny_part[q + 1]) { diag_i[cnt]++; - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { diag_i[cnt]++; } else { - if (ix+1 < nx) + if (ix + 1 < nx) + { offd_i[o_cnt]++; + } } } else { - if (iy+1 < ny) + if (iy + 1 < ny) { offd_i[o_cnt]++; - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { offd_i[o_cnt]++; } - else if (ix < nx-1) + else if (ix < nx - 1) { offd_i[o_cnt]++; } @@ -207,9 +214,9 @@ GenerateRotate7pt( MPI_Comm comm, row_index = 0; cnt = 0; o_cnt = 0; - for (iy = ny_part[q]; iy < ny_part[q+1]; iy++) + for (iy = ny_part[q]; iy < ny_part[q + 1]; iy++) { - for (ix = nx_part[p]; ix < nx_part[p+1]; ix++) + for (ix = nx_part[p]; ix < nx_part[p + 1]; ix++) { diag_j[cnt] = row_index; diag_data[cnt++] = value[0]; @@ -217,19 +224,19 @@ GenerateRotate7pt( MPI_Comm comm, { if (ix > nx_part[p]) { - diag_j[cnt] = row_index-nx_local-1 ; + diag_j[cnt] = row_index - nx_local - 1 ; diag_data[cnt++] = value[3]; } else { if (ix) { - big_offd_j[o_cnt] = hypre_map2(ix-1,iy-1,p-1,q,nx, - nx_part,ny_part); + big_offd_j[o_cnt] = hypre_map2(ix - 1, iy - 1, p - 1, q, nx, + nx_part, ny_part); offd_data[o_cnt++] = value[3]; } } - diag_j[cnt] = row_index-nx_local; + diag_j[cnt] = row_index - nx_local; diag_data[cnt++] = value[2]; } else @@ -238,85 +245,85 @@ GenerateRotate7pt( MPI_Comm comm, { if (ix > nx_part[p]) { - big_offd_j[o_cnt] = hypre_map2(ix-1,iy-1,p,q-1,nx, - nx_part,ny_part); + big_offd_j[o_cnt] = hypre_map2(ix - 1, iy - 1, p, q - 1, nx, + nx_part, ny_part); offd_data[o_cnt++] = value[3]; } else if (ix) { - big_offd_j[o_cnt] = hypre_map2(ix-1,iy-1,p-1,q-1,nx, - nx_part,ny_part); + big_offd_j[o_cnt] = hypre_map2(ix - 1, iy - 1, p - 1, q - 1, nx, + nx_part, ny_part); offd_data[o_cnt++] = value[3]; } - big_offd_j[o_cnt] = hypre_map2(ix,iy-1,p,q-1,nx, - nx_part,ny_part); + big_offd_j[o_cnt] = hypre_map2(ix, iy - 1, p, q - 1, nx, + nx_part, ny_part); offd_data[o_cnt++] = value[2]; } } if (ix > nx_part[p]) { - diag_j[cnt] = row_index-1; + diag_j[cnt] = row_index - 1; diag_data[cnt++] = value[1]; } else { if (ix) { - big_offd_j[o_cnt] = hypre_map2(ix-1,iy,p-1,q,nx, - nx_part,ny_part); + big_offd_j[o_cnt] = hypre_map2(ix - 1, iy, p - 1, q, nx, + nx_part, ny_part); offd_data[o_cnt++] = value[1]; } } - if (ix+1 < nx_part[p+1]) + if (ix + 1 < nx_part[p + 1]) { - diag_j[cnt] = row_index+1; + diag_j[cnt] = row_index + 1; diag_data[cnt++] = value[1]; } else { - if (ix+1 < nx) + if (ix + 1 < nx) { - big_offd_j[o_cnt] = hypre_map2(ix+1,iy,p+1,q,nx, - nx_part,ny_part); + big_offd_j[o_cnt] = hypre_map2(ix + 1, iy, p + 1, q, nx, + nx_part, ny_part); offd_data[o_cnt++] = value[1]; } } - if (iy+1 < ny_part[q+1]) + if (iy + 1 < ny_part[q + 1]) { - diag_j[cnt] = row_index+nx_local; + diag_j[cnt] = row_index + nx_local; diag_data[cnt++] = value[2]; - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { - diag_j[cnt] = row_index+nx_local+1 ; + diag_j[cnt] = row_index + nx_local + 1 ; diag_data[cnt++] = value[3]; } else { - if (ix+1 < nx) + if (ix + 1 < nx) { - big_offd_j[o_cnt] = hypre_map2(ix+1,iy+1,p+1,q,nx, - nx_part,ny_part); + big_offd_j[o_cnt] = hypre_map2(ix + 1, iy + 1, p + 1, q, nx, + nx_part, ny_part); offd_data[o_cnt++] = value[3]; } } } else { - if (iy+1 < ny) + if (iy + 1 < ny) { - big_offd_j[o_cnt] = hypre_map2(ix,iy+1,p,q+1,nx, - nx_part,ny_part); + big_offd_j[o_cnt] = hypre_map2(ix, iy + 1, p, q + 1, nx, + nx_part, ny_part); offd_data[o_cnt++] = value[2]; - if (ix < nx_part[p+1]-1) + if (ix < nx_part[p + 1] - 1) { - big_offd_j[o_cnt] = hypre_map2(ix+1,iy+1,p,q+1,nx, - nx_part,ny_part); + big_offd_j[o_cnt] = hypre_map2(ix + 1, iy + 1, p, q + 1, nx, + nx_part, ny_part); offd_data[o_cnt++] = value[3]; } - else if (ix < nx-1) + else if (ix < nx - 1) { - big_offd_j[o_cnt] = hypre_map2(ix+1,iy+1,p+1,q+1,nx, - nx_part,ny_part); + big_offd_j[o_cnt] = hypre_map2(ix + 1, iy + 1, p + 1, q + 1, nx, + nx_part, ny_part); offd_data[o_cnt++] = value[3]; } } @@ -329,14 +336,16 @@ GenerateRotate7pt( MPI_Comm comm, { HYPRE_BigInt *work = hypre_CTAlloc(HYPRE_BigInt, o_cnt, HYPRE_MEMORY_HOST); - for (i=0; i < o_cnt; i++) + for (i = 0; i < o_cnt; i++) + { work[i] = big_offd_j[i]; + } - hypre_BigQsort0(work, 0, o_cnt-1); + hypre_BigQsort0(work, 0, o_cnt - 1); col_map_offd[0] = work[0]; cnt = 0; - for (i=0; i < o_cnt; i++) + for (i = 0; i < o_cnt; i++) { if (work[i] > col_map_offd[cnt]) { @@ -345,10 +354,10 @@ GenerateRotate7pt( MPI_Comm comm, } } - num_cols_offd = cnt+1; - for (i=0; i < o_cnt; i++) + num_cols_offd = cnt + 1; + for (i = 0; i < o_cnt; i++) { - offd_j[i] = hypre_BigBinarySearch(col_map_offd,big_offd_j[i],num_cols_offd); + offd_j[i] = hypre_BigBinarySearch(col_map_offd, big_offd_j[i], num_cols_offd); } hypre_TFree(work, HYPRE_MEMORY_HOST); @@ -383,7 +392,6 @@ GenerateRotate7pt( MPI_Comm comm, hypre_TFree(nx_part, HYPRE_MEMORY_HOST); hypre_TFree(ny_part, HYPRE_MEMORY_HOST); hypre_TFree(value, HYPRE_MEMORY_HOST); - hypre_TFree(global_part, HYPRE_MEMORY_HOST); return (HYPRE_ParCSRMatrix) A; } diff --git a/external/hypre/src/parcsr_ls/par_scaled_matnorm.c b/external/hypre/src/parcsr_ls/par_scaled_matnorm.c index 54634000..d4e24e56 100644 --- a/external/hypre/src/parcsr_ls/par_scaled_matnorm.c +++ b/external/hypre/src/parcsr_ls/par_scaled_matnorm.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -20,30 +20,30 @@ HYPRE_Int hypre_ParCSRMatrixScaledNorm( hypre_ParCSRMatrix *A, HYPRE_Real *scnorm) { - hypre_ParCSRCommHandle *comm_handle; - hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); - MPI_Comm comm = hypre_ParCSRMatrixComm(A); + hypre_ParCSRCommHandle *comm_handle; + hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); + MPI_Comm comm = hypre_ParCSRMatrixComm(A); hypre_CSRMatrix *diag = hypre_ParCSRMatrixDiag(A); - HYPRE_Int *diag_i = hypre_CSRMatrixI(diag); - HYPRE_Int *diag_j = hypre_CSRMatrixJ(diag); - HYPRE_Real *diag_data = hypre_CSRMatrixData(diag); + HYPRE_Int *diag_i = hypre_CSRMatrixI(diag); + HYPRE_Int *diag_j = hypre_CSRMatrixJ(diag); + HYPRE_Real *diag_data = hypre_CSRMatrixData(diag); hypre_CSRMatrix *offd = hypre_ParCSRMatrixOffd(A); - HYPRE_Int *offd_i = hypre_CSRMatrixI(offd); - HYPRE_Int *offd_j = hypre_CSRMatrixJ(offd); - HYPRE_Real *offd_data = hypre_CSRMatrixData(offd); - HYPRE_BigInt global_num_rows = hypre_ParCSRMatrixGlobalNumRows(A); - HYPRE_BigInt *row_starts = hypre_ParCSRMatrixRowStarts(A); - HYPRE_Int num_rows = hypre_CSRMatrixNumRows(diag); + HYPRE_Int *offd_i = hypre_CSRMatrixI(offd); + HYPRE_Int *offd_j = hypre_CSRMatrixJ(offd); + HYPRE_Real *offd_data = hypre_CSRMatrixData(offd); + HYPRE_BigInt global_num_rows = hypre_ParCSRMatrixGlobalNumRows(A); + HYPRE_BigInt *row_starts = hypre_ParCSRMatrixRowStarts(A); + HYPRE_Int num_rows = hypre_CSRMatrixNumRows(diag); hypre_ParVector *dinvsqrt; - HYPRE_Real *dis_data; - hypre_Vector *dis_ext; - HYPRE_Real *dis_ext_data; + HYPRE_Real *dis_data; + hypre_Vector *dis_ext; + HYPRE_Real *dis_ext_data; hypre_Vector *sum; - HYPRE_Real *sum_data; + HYPRE_Real *sum_data; - HYPRE_Int num_cols_offd = hypre_CSRMatrixNumCols(offd); - HYPRE_Int num_sends, i, j, index, start; + HYPRE_Int num_cols_offd = hypre_CSRMatrixNumCols(offd); + HYPRE_Int num_sends, i, j, index, start; HYPRE_Real *d_buf_data; HYPRE_Real mat_norm, max_row_sum; @@ -61,7 +61,7 @@ hypre_ParCSRMatrixScaledNorm( hypre_ParCSRMatrix *A, HYPRE_Real *scnorm) /* generate dinvsqrt */ for (i = 0; i < num_rows; i++) { - dis_data[i] = 1.0/sqrt(fabs(diag_data[diag_i[i]])); + dis_data[i] = 1.0 / hypre_sqrt(hypre_abs(diag_data[diag_i[i]])); } /*--------------------------------------------------------------------- @@ -76,42 +76,44 @@ hypre_ParCSRMatrixScaledNorm( hypre_ParCSRMatrix *A, HYPRE_Real *scnorm) num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); d_buf_data = hypre_CTAlloc(HYPRE_Real, hypre_ParCSRCommPkgSendMapStart(comm_pkg, - num_sends), HYPRE_MEMORY_HOST); + num_sends), HYPRE_MEMORY_HOST); index = 0; for (i = 0; i < num_sends; i++) { - start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) - d_buf_data[index++] - = dis_data[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) + d_buf_data[index++] + = dis_data[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } comm_handle = hypre_ParCSRCommHandleCreate( 1, comm_pkg, d_buf_data, - dis_ext_data); + dis_ext_data); - for (i=0; i < num_rows; i++) + for (i = 0; i < num_rows; i++) { - for (j=diag_i[i]; j < diag_i[i+1]; j++) + for (j = diag_i[i]; j < diag_i[i + 1]; j++) { - sum_data[i] += fabs(diag_data[j])*dis_data[i]*dis_data[diag_j[j]]; + sum_data[i] += hypre_abs(diag_data[j]) * dis_data[i] * dis_data[diag_j[j]]; } } hypre_ParCSRCommHandleDestroy(comm_handle); - for (i=0; i < num_rows; i++) + for (i = 0; i < num_rows; i++) { - for (j=offd_i[i]; j < offd_i[i+1]; j++) + for (j = offd_i[i]; j < offd_i[i + 1]; j++) { - sum_data[i] += fabs(offd_data[j])*dis_data[i]*dis_ext_data[offd_j[j]]; + sum_data[i] += hypre_abs(offd_data[j]) * dis_data[i] * dis_ext_data[offd_j[j]]; } } max_row_sum = 0; - for (i=0; i < num_rows; i++) + for (i = 0; i < num_rows; i++) { if (max_row_sum < sum_data[i]) - max_row_sum = sum_data[i]; + { + max_row_sum = sum_data[i]; + } } hypre_MPI_Allreduce(&max_row_sum, &mat_norm, 1, HYPRE_MPI_REAL, hypre_MPI_MAX, comm); diff --git a/external/hypre/src/parcsr_ls/par_schwarz.c b/external/hypre/src/parcsr_ls/par_schwarz.c index b0e70ff9..027fc134 100644 --- a/external/hypre/src/parcsr_ls/par_schwarz.c +++ b/external/hypre/src/parcsr_ls/par_schwarz.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -19,7 +19,7 @@ *--------------------------------------------------------------------------*/ void * -hypre_SchwarzCreate() +hypre_SchwarzCreate( void ) { hypre_SchwarzData *schwarz_data; @@ -70,16 +70,24 @@ hypre_SchwarzDestroy( void *data ) hypre_SchwarzData *schwarz_data = (hypre_SchwarzData*) data; if (hypre_SchwarzDataScale(schwarz_data)) + { hypre_TFree(hypre_SchwarzDataScale(schwarz_data), HYPRE_MEMORY_HOST); + } if (hypre_SchwarzDataDofFunc(schwarz_data)) + { hypre_TFree(hypre_SchwarzDataDofFunc(schwarz_data), HYPRE_MEMORY_HOST); + } hypre_CSRMatrixDestroy(hypre_SchwarzDataDomainStructure(schwarz_data)); if (hypre_SchwarzDataVariant(schwarz_data) == 3) + { hypre_CSRMatrixDestroy(hypre_SchwarzDataABoundary(schwarz_data)); + } hypre_ParVectorDestroy(hypre_SchwarzDataVtemp(schwarz_data)); if (hypre_SchwarzDataPivots(schwarz_data)) + { hypre_TFree(hypre_SchwarzDataPivots(schwarz_data), HYPRE_MEMORY_HOST); + } hypre_TFree(schwarz_data, HYPRE_MEMORY_HOST); @@ -91,8 +99,10 @@ HYPRE_Int hypre_SchwarzSetup(void *schwarz_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, - hypre_ParVector *u ) + hypre_ParVector *u) { + HYPRE_UNUSED_VAR(f); + HYPRE_UNUSED_VAR(u); hypre_SchwarzData *schwarz_data = (hypre_SchwarzData*) schwarz_vdata; HYPRE_Int *dof_func; @@ -114,8 +124,8 @@ hypre_SchwarzSetup(void *schwarz_vdata, dof_func = hypre_SchwarzDataDofFunc(schwarz_data); Vtemp = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A), - hypre_ParCSRMatrixGlobalNumRows(A), - hypre_ParCSRMatrixRowStarts(A)); + hypre_ParCSRMatrixGlobalNumRows(A), + hypre_ParCSRMatrixRowStarts(A)); hypre_ParVectorInitialize(Vtemp); hypre_SchwarzDataVtemp(schwarz_data) = Vtemp; @@ -128,21 +138,25 @@ hypre_SchwarzSetup(void *schwarz_vdata, if (domain_structure) { - if (variant == 2) - { - hypre_ParGenerateScale(A, domain_structure, relax_weight, - &scale); - hypre_SchwarzDataScale(schwarz_data) = scale; - } - else - { - hypre_ParGenerateHybridScale(A, domain_structure, &A_boundary, &scale); - hypre_SchwarzDataScale(schwarz_data) = scale; - if (hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(A))) - hypre_SchwarzDataABoundary(schwarz_data) = A_boundary; + if (variant == 2) + { + hypre_ParGenerateScale(A, domain_structure, relax_weight, + &scale); + hypre_SchwarzDataScale(schwarz_data) = scale; + } else - hypre_SchwarzDataABoundary(schwarz_data) = NULL; - } + { + hypre_ParGenerateHybridScale(A, domain_structure, &A_boundary, &scale); + hypre_SchwarzDataScale(schwarz_data) = scale; + if (hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(A))) + { + hypre_SchwarzDataABoundary(schwarz_data) = A_boundary; + } + else + { + hypre_SchwarzDataABoundary(schwarz_data) = NULL; + } + } } } else @@ -153,13 +167,13 @@ hypre_SchwarzSetup(void *schwarz_vdata, &domain_structure, &pivots, use_nonsymm); if (domain_structure) { - if (variant == 1) - { - hypre_GenerateScale(domain_structure, - hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(A)), - relax_weight, &scale); - hypre_SchwarzDataScale(schwarz_data) = scale; - } + if (variant == 1) + { + hypre_GenerateScale(domain_structure, + hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(A)), + relax_weight, &scale); + hypre_SchwarzDataScale(schwarz_data) = scale; + } } } @@ -195,31 +209,31 @@ hypre_SchwarzSolve(void *schwarz_vdata, if (domain_structure) { - if (variant == 2) - { - hypre_ParAdSchwarzSolve(A, f, domain_structure, scale, u, Vtemp, pivots, use_nonsymm); - } - else if (variant == 3) - { - hypre_ParMPSchwarzSolve(A, A_boundary, f, domain_structure, u, - relax_wt, scale, Vtemp, pivots, use_nonsymm); - } - else if (variant == 1) - { - hypre_AdSchwarzSolve(A, f, domain_structure, scale, u, Vtemp, pivots, use_nonsymm); - } - else if (variant == 4) - { - hypre_MPSchwarzFWSolve(A, hypre_ParVectorLocalVector(f), - domain_structure, u, relax_wt, - hypre_ParVectorLocalVector(Vtemp), pivots, use_nonsymm); - } - else - { - hypre_MPSchwarzSolve(A, hypre_ParVectorLocalVector(f), - domain_structure, u, relax_wt, - hypre_ParVectorLocalVector(Vtemp), pivots, use_nonsymm); - } + if (variant == 2) + { + hypre_ParAdSchwarzSolve(A, f, domain_structure, scale, u, Vtemp, pivots, use_nonsymm); + } + else if (variant == 3) + { + hypre_ParMPSchwarzSolve(A, A_boundary, f, domain_structure, u, + relax_wt, scale, Vtemp, pivots, use_nonsymm); + } + else if (variant == 1) + { + hypre_AdSchwarzSolve(A, f, domain_structure, scale, u, Vtemp, pivots, use_nonsymm); + } + else if (variant == 4) + { + hypre_MPSchwarzFWSolve(A, hypre_ParVectorLocalVector(f), + domain_structure, u, relax_wt, + hypre_ParVectorLocalVector(Vtemp), pivots, use_nonsymm); + } + else + { + hypre_MPSchwarzSolve(A, hypre_ParVectorLocalVector(f), + domain_structure, u, relax_wt, + hypre_ParVectorLocalVector(Vtemp), pivots, use_nonsymm); + } } return hypre_error_flag; @@ -251,22 +265,22 @@ hypre_SchwarzCFSolve(void *schwarz_vdata, if (variant == 1) { - hypre_AdSchwarzCFSolve(A, f, domain_structure, scale, u, Vtemp, - CF_marker, rlx_pt, pivots, use_nonsymm); + hypre_AdSchwarzCFSolve(A, f, domain_structure, scale, u, Vtemp, + CF_marker, rlx_pt, pivots, use_nonsymm); } else if (variant == 4) { hypre_MPSchwarzCFFWSolve(A, hypre_ParVectorLocalVector(f), - domain_structure, u, relax_wt, - hypre_ParVectorLocalVector(Vtemp), - CF_marker, rlx_pt, pivots, use_nonsymm); + domain_structure, u, relax_wt, + hypre_ParVectorLocalVector(Vtemp), + CF_marker, rlx_pt, pivots, use_nonsymm); } else { hypre_MPSchwarzCFSolve(A, hypre_ParVectorLocalVector(f), - domain_structure, u, relax_wt, - hypre_ParVectorLocalVector(Vtemp), - CF_marker, rlx_pt, pivots, use_nonsymm); + domain_structure, u, relax_wt, + hypre_ParVectorLocalVector(Vtemp), + CF_marker, rlx_pt, pivots, use_nonsymm); } return hypre_error_flag; @@ -374,8 +388,10 @@ hypre_SchwarzReScale( void *data, HYPRE_Int size, HYPRE_Real value) hypre_SchwarzData *schwarz_data = (hypre_SchwarzData*) data; scale = hypre_SchwarzDataScale(schwarz_data); - for (i=0; i < size; i++) + for (i = 0; i < size; i++) + { scale[i] *= value; + } return hypre_error_flag; diff --git a/external/hypre/src/parcsr_ls/par_stats.c b/external/hypre/src/parcsr_ls/par_stats.c index a93cc3d9..16ef79c6 100644 --- a/external/hypre/src/parcsr_ls/par_stats.c +++ b/external/hypre/src/parcsr_ls/par_stats.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -8,20 +8,20 @@ #include "_hypre_parcsr_ls.h" #include "par_amg.h" -/***************************************************************************** +/*-------------------------------------------------------------------- + * hypre_BoomerAMGSetupStats * * Routine for getting matrix statistics from setup * - * * AHB - using block norm 6 (sum of all elements) instead of 1 (frobenius) - * - *****************************************************************************/ - + *--------------------------------------------------------------------*/ HYPRE_Int hypre_BoomerAMGSetupStats( void *amg_vdata, - hypre_ParCSRMatrix *A ) + hypre_ParCSRMatrix *A ) { + hypre_GpuProfilingPushRange("AMGSetupStats"); + MPI_Comm comm = hypre_ParCSRMatrixComm(A); hypre_ParAMGData *amg_data = (hypre_ParAMGData*) amg_vdata; @@ -65,6 +65,8 @@ hypre_BoomerAMGSetupStats( void *amg_vdata, HYPRE_Int num_levels; + HYPRE_Int num_functions; + HYPRE_Int filter_functions; HYPRE_Int coarsen_type; HYPRE_Int interp_type; HYPRE_Int restri_type; @@ -85,7 +87,7 @@ hypre_BoomerAMGSetupStats( void *amg_vdata, HYPRE_Int min_entries; HYPRE_Int max_entries; - HYPRE_Int num_procs,my_id; + HYPRE_Int num_procs, my_id; HYPRE_Int num_threads; @@ -135,7 +137,8 @@ hypre_BoomerAMGSetupStats( void *amg_vdata, HYPRE_Real tol; HYPRE_Int block_mode; - HYPRE_Int block_size, bnnz; + HYPRE_Int block_size = 1; + HYPRE_Int bnnz = 1; HYPRE_Real tmp_norm; @@ -153,12 +156,14 @@ hypre_BoomerAMGSetupStats( void *amg_vdata, HYPRE_Real add_rlx_wt; hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_rank(comm, &my_id); num_threads = hypre_NumThreads(); A_array = hypre_ParAMGDataAArray(amg_data); P_array = hypre_ParAMGDataPArray(amg_data); num_levels = hypre_ParAMGDataNumLevels(amg_data); + num_functions = hypre_ParAMGDataNumFunctions(amg_data); + filter_functions = hypre_ParAMGDataFilterFunctions(amg_data); coarsen_type = hypre_ParAMGDataCoarsenType(amg_data); interp_type = hypre_ParAMGDataInterpType(amg_data); restri_type = hypre_ParAMGDataRestriction(amg_data); /* RL */ @@ -198,19 +203,19 @@ hypre_BoomerAMGSetupStats( void *amg_vdata, send_buff = hypre_CTAlloc(HYPRE_Real, 6, HYPRE_MEMORY_HOST); gather_buff = hypre_CTAlloc(HYPRE_Real, 6, HYPRE_MEMORY_HOST); - if (my_id==0) + if (my_id == 0) { - hypre_printf("\n\n Num MPI tasks = %d\n\n",num_procs); - hypre_printf(" Num OpenMP threads = %d\n\n",num_threads); + hypre_printf("\n\n Num MPI tasks = %d\n\n", num_procs); + hypre_printf(" Num OpenMP threads = %d\n\n", num_threads); hypre_printf("\nBoomerAMG SETUP PARAMETERS:\n\n"); - hypre_printf(" Max levels = %d\n",hypre_ParAMGDataMaxLevels(amg_data)); - hypre_printf(" Num levels = %d\n\n",num_levels); + hypre_printf(" Max levels = %d\n", hypre_ParAMGDataMaxLevels(amg_data)); + hypre_printf(" Num levels = %d\n\n", num_levels); hypre_printf(" Strength Threshold = %f\n", - hypre_ParAMGDataStrongThreshold(amg_data)); + hypre_ParAMGDataStrongThreshold(amg_data)); hypre_printf(" Interpolation Truncation Factor = %f\n", - hypre_ParAMGDataTruncFactor(amg_data)); + hypre_ParAMGDataTruncFactor(amg_data)); hypre_printf(" Maximum Row Sum Threshold for Dependency Weakening = %f\n\n", - hypre_ParAMGDataMaxRowSum(amg_data)); + hypre_ParAMGDataMaxRowSum(amg_data)); if (coarsen_type == 0) { @@ -277,19 +282,27 @@ hypre_BoomerAMGSetupStats( void *amg_vdata, { hypre_printf("\n No. of levels of aggressive coarsening: %d\n\n", agg_num_levels); if (agg_interp_type == 4) + { hypre_printf(" Interpolation on agg. levels= multipass interpolation\n"); + } else if (agg_interp_type == 1) + { hypre_printf(" Interpolation on agg. levels = 2-stage extended+i interpolation \n"); + } else if (agg_interp_type == 2) + { hypre_printf(" Interpolation on agg. levels = 2-stage std interpolation \n"); + } else if (agg_interp_type == 3) + { hypre_printf(" Interpolation on agg. levels = 2-stage extended interpolation \n"); + } } if (coarsen_type) hypre_printf(" measures are determined %s\n\n", - (measure_type ? "globally" : "locally")); + (measure_type ? "globally" : "locally")); hypre_printf( "\n No global partition option chosen.\n\n"); @@ -390,7 +403,14 @@ hypre_BoomerAMGSetupStats( void *amg_vdata, } else if (restri_type >= 3) { - hypre_printf(" Restriction = local approximate ideal restriction (Neumann AIR-%d)\n", restri_type-3); + hypre_printf(" Restriction = local approximate ideal restriction (Neumann AIR-%d)\n", + restri_type - 3); + } + + if (num_functions > 1) + { + hypre_printf(" Number of functions = %d\n", num_functions); + hypre_printf(" Functions filtering is %s\n", (filter_functions > 0) ? "on" : "off"); } if (block_mode) @@ -437,7 +457,7 @@ hypre_BoomerAMGSetupStats( void *amg_vdata, ndigits[2] = ndigits[2] + 2; ndigits[3] = ndigits[0] + ndigits[1] + ndigits[2]; - if(my_id == 0) + if (my_id == 0) { hypre_printf("%*s", (ndigits[0] + 13), "nonzero"); hypre_printf("%*s", (ndigits[1] + 15), "entries/row"); @@ -446,7 +466,7 @@ hypre_BoomerAMGSetupStats( void *amg_vdata, hypre_printf("%*s", ndigits[1], "entries"); hypre_printf("%7s %5s %4s", "sparse", "min", "max"); hypre_printf("%*s %8s %11s\n", (ndigits[2] + 2), "avg", "min", "max"); - for (i = 0; i < (49 + ndigits[3]); i++) hypre_printf("%s", "="); + for (i = 0; i < (49 + ndigits[3]); i++) { hypre_printf("%s", "="); } hypre_printf("\n"); } @@ -473,7 +493,7 @@ hypre_BoomerAMGSetupStats( void *amg_vdata, A_offd_i = hypre_CSRMatrixI(A_block_offd); block_size = hypre_ParCSRBlockMatrixBlockSize(A_block_array[level]); - bnnz = block_size*block_size; + bnnz = block_size * block_size; row_starts = hypre_ParCSRBlockMatrixRowStarts(A_block_array[level]); @@ -483,7 +503,7 @@ hypre_BoomerAMGSetupStats( void *amg_vdata, num_mem[level] = global_nonzeros; num_variables[level] = (HYPRE_Real) fine_size; - sparse = global_nonzeros /((HYPRE_Real) fine_size * (HYPRE_Real) fine_size); + sparse = global_nonzeros / ((HYPRE_Real) fine_size * (HYPRE_Real) fine_size); min_entries = 0; max_entries = 0; @@ -492,16 +512,16 @@ hypre_BoomerAMGSetupStats( void *amg_vdata, if (hypre_CSRBlockMatrixNumRows(A_block_diag)) { - min_entries = (A_diag_i[1]-A_diag_i[0])+(A_offd_i[1]-A_offd_i[0]); + min_entries = (A_diag_i[1] - A_diag_i[0]) + (A_offd_i[1] - A_offd_i[0]); for (j = A_diag_i[0]; j < A_diag_i[1]; j++) { - hypre_CSRBlockMatrixBlockNorm(6, &A_diag_data[j*bnnz], &tmp_norm, block_size); + hypre_CSRBlockMatrixBlockNorm(6, &A_diag_data[j * bnnz], &tmp_norm, block_size); min_rowsum += tmp_norm; } for (j = A_offd_i[0]; j < A_offd_i[1]; j++) { - hypre_CSRBlockMatrixBlockNorm(6, &A_offd_data[j*bnnz], &tmp_norm, block_size); + hypre_CSRBlockMatrixBlockNorm(6, &A_offd_data[j * bnnz], &tmp_norm, block_size); min_rowsum += tmp_norm; } @@ -509,19 +529,19 @@ hypre_BoomerAMGSetupStats( void *amg_vdata, for (j = 0; j < hypre_CSRBlockMatrixNumRows(A_block_diag); j++) { - entries = (A_diag_i[j+1]-A_diag_i[j])+(A_offd_i[j+1]-A_offd_i[j]); + entries = (A_diag_i[j + 1] - A_diag_i[j]) + (A_offd_i[j + 1] - A_offd_i[j]); min_entries = hypre_min(entries, min_entries); max_entries = hypre_max(entries, max_entries); rowsum = 0.0; - for (i = A_diag_i[j]; i < A_diag_i[j+1]; i++) + for (i = A_diag_i[j]; i < A_diag_i[j + 1]; i++) { - hypre_CSRBlockMatrixBlockNorm(6, &A_diag_data[i*bnnz], &tmp_norm, block_size); + hypre_CSRBlockMatrixBlockNorm(6, &A_diag_data[i * bnnz], &tmp_norm, block_size); rowsum += tmp_norm; } - for (i = A_offd_i[j]; i < A_offd_i[j+1]; i++) + for (i = A_offd_i[j]; i < A_offd_i[j + 1]; i++) { - hypre_CSRBlockMatrixBlockNorm(6, &A_offd_data[i*bnnz], &tmp_norm, block_size); + hypre_CSRBlockMatrixBlockNorm(6, &A_offd_data[i * bnnz], &tmp_norm, block_size); rowsum += tmp_norm; } min_rowsum = hypre_min(rowsum, min_rowsum); @@ -562,17 +582,23 @@ hypre_BoomerAMGSetupStats( void *amg_vdata, global_nonzeros = hypre_ParCSRMatrixDNumNonzeros(A_array[level]); num_coeffs[level] = global_nonzeros; if (level == 0) + { num_mem[level] += global_nonzeros; + } if (level == 0 && (additive == 0 || mult_additive == 0) ) + { num_mem[level] += global_nonzeros; + } if (level > 0) { if (simple > level || simple == -1) + { num_mem[level] += global_nonzeros; + } } num_variables[level] = (HYPRE_Real) fine_size; - sparse = global_nonzeros /((HYPRE_Real) fine_size * (HYPRE_Real) fine_size); + sparse = global_nonzeros / ((HYPRE_Real) fine_size * (HYPRE_Real) fine_size); min_entries = 0; max_entries = 0; @@ -581,26 +607,34 @@ hypre_BoomerAMGSetupStats( void *amg_vdata, if (hypre_CSRMatrixNumRows(A_diag)) { - min_entries = (A_diag_i[1]-A_diag_i[0])+(A_offd_i[1]-A_offd_i[0]); + min_entries = (A_diag_i[1] - A_diag_i[0]) + (A_offd_i[1] - A_offd_i[0]); for (j = A_diag_i[0]; j < A_diag_i[1]; j++) + { min_rowsum += A_diag_data[j]; + } for (j = A_offd_i[0]; j < A_offd_i[1]; j++) + { min_rowsum += A_offd_data[j]; + } max_rowsum = min_rowsum; for (j = 0; j < hypre_CSRMatrixNumRows(A_diag); j++) { - entries = (A_diag_i[j+1]-A_diag_i[j])+(A_offd_i[j+1]-A_offd_i[j]); + entries = (A_diag_i[j + 1] - A_diag_i[j]) + (A_offd_i[j + 1] - A_offd_i[j]); min_entries = hypre_min(entries, min_entries); max_entries = hypre_max(entries, max_entries); rowsum = 0.0; - for (i = A_diag_i[j]; i < A_diag_i[j+1]; i++) + for (i = A_diag_i[j]; i < A_diag_i[j + 1]; i++) + { rowsum += A_diag_data[i]; + } - for (i = A_offd_i[j]; i < A_offd_i[j+1]; i++) + for (i = A_offd_i[j]; i < A_offd_i[j + 1]; i++) + { rowsum += A_offd_data[i]; + } min_rowsum = hypre_min(rowsum, min_rowsum); max_rowsum = hypre_max(rowsum, max_rowsum); @@ -619,7 +653,7 @@ hypre_BoomerAMGSetupStats( void *amg_vdata, } } - numrows = (HYPRE_Int)(row_starts[1]-row_starts[0]); + numrows = (HYPRE_Int)(row_starts[1] - row_starts[0]); if (!numrows) /* if we don't have any rows, then don't have this count toward min row sum or min num entries */ { @@ -634,7 +668,7 @@ hypre_BoomerAMGSetupStats( void *amg_vdata, hypre_MPI_Reduce(send_buff, gather_buff, 4, HYPRE_MPI_REAL, hypre_MPI_MAX, 0, comm); - if (my_id ==0) + if (my_id == 0) { global_min_e = - (HYPRE_Int)gather_buff[0]; global_max_e = (HYPRE_Int)gather_buff[1]; @@ -642,10 +676,10 @@ hypre_BoomerAMGSetupStats( void *amg_vdata, global_max_rsum = gather_buff[3]; hypre_printf("%3d %*b %*.0f %0.3f %4d %4d", - level, ndigits[0], fine_size, ndigits[1], global_nonzeros, - sparse, global_min_e, global_max_e); + level, ndigits[0], fine_size, ndigits[1], global_nonzeros, + sparse, global_min_e, global_max_e); hypre_printf(" %*.1f %10.3e %10.3e\n", ndigits[2], avg_entries, - global_min_rsum, global_max_rsum); + global_min_rsum, global_max_rsum); } } @@ -654,7 +688,8 @@ hypre_BoomerAMGSetupStats( void *amg_vdata, { if (block_mode) { - ndigits[0] = hypre_max(hypre_ndigits(hypre_ParCSRBlockMatrixGlobalNumRows(P_block_array[0])), ndigits[0]); + ndigits[0] = hypre_max(hypre_ndigits(hypre_ParCSRBlockMatrixGlobalNumRows(P_block_array[0])), + ndigits[0]); } else { @@ -675,11 +710,11 @@ hypre_BoomerAMGSetupStats( void *amg_vdata, } - hypre_printf("%*s ", (2*ndigits[0] + 21), "entries/row"); + hypre_printf("%*s ", (2 * ndigits[0] + 21), "entries/row"); hypre_printf("%10s %10s %19s\n", "min", "max", "row sums"); hypre_printf("lev %*s x %-*s min max avgW", ndigits[0], "rows", ndigits[0], "cols"); hypre_printf("%11s %11s %9s %11s\n", "weight", "weight", "min", "max"); - for (i = 0; i < (70 + 2*ndigits[0]); i++) hypre_printf("%s", "="); + for (i = 0; i < (70 + 2 * ndigits[0]); i++) { hypre_printf("%s", "="); } hypre_printf("\n"); } @@ -687,7 +722,7 @@ hypre_BoomerAMGSetupStats( void *amg_vdata, * Enter Statistics Loop *-----------------------------------------------------*/ - for (level = 0; level < num_levels-1; level++) + for (level = 0; level < num_levels - 1; level++) { if (block_mode) @@ -725,11 +760,13 @@ hypre_BoomerAMGSetupStats( void *amg_vdata, for (j = P_diag_i[0]; j < P_diag_i[1]; j++) { - hypre_CSRBlockMatrixBlockNorm(6, &P_diag_data[j*bnnz], &tmp_norm, block_size); + hypre_CSRBlockMatrixBlockNorm(6, &P_diag_data[j * bnnz], &tmp_norm, block_size); min_weight = hypre_min(min_weight, tmp_norm); if (tmp_norm != 1.0) + { max_weight = hypre_max(max_weight, tmp_norm); + } min_rowsum += tmp_norm; @@ -737,45 +774,51 @@ hypre_BoomerAMGSetupStats( void *amg_vdata, } for (j = P_offd_i[0]; j < P_offd_i[1]; j++) { - hypre_CSRBlockMatrixBlockNorm(6, &P_offd_data[j*bnnz], &tmp_norm, block_size); + hypre_CSRBlockMatrixBlockNorm(6, &P_offd_data[j * bnnz], &tmp_norm, block_size); min_weight = hypre_min(min_weight, tmp_norm); if (tmp_norm != 1.0) + { max_weight = hypre_max(max_weight, tmp_norm); + } min_rowsum += tmp_norm; } max_rowsum = min_rowsum; - min_entries = (P_diag_i[1]-P_diag_i[0])+(P_offd_i[1]-P_offd_i[0]); + min_entries = (P_diag_i[1] - P_diag_i[0]) + (P_offd_i[1] - P_offd_i[0]); max_entries = 0; for (j = 0; j < hypre_CSRBlockMatrixNumRows(P_block_diag); j++) { - entries = (P_diag_i[j+1]-P_diag_i[j])+(P_offd_i[j+1]-P_offd_i[j]); + entries = (P_diag_i[j + 1] - P_diag_i[j]) + (P_offd_i[j + 1] - P_offd_i[j]); min_entries = hypre_min(entries, min_entries); max_entries = hypre_max(entries, max_entries); rowsum = 0.0; - for (i = P_diag_i[j]; i < P_diag_i[j+1]; i++) + for (i = P_diag_i[j]; i < P_diag_i[j + 1]; i++) { - hypre_CSRBlockMatrixBlockNorm(6, &P_diag_data[i*bnnz], &tmp_norm, block_size); + hypre_CSRBlockMatrixBlockNorm(6, &P_diag_data[i * bnnz], &tmp_norm, block_size); min_weight = hypre_min(min_weight, tmp_norm); if (tmp_norm != 1.0) + { max_weight = hypre_max(max_weight, tmp_norm); + } rowsum += tmp_norm; } - for (i = P_offd_i[j]; i < P_offd_i[j+1]; i++) + for (i = P_offd_i[j]; i < P_offd_i[j + 1]; i++) { - hypre_CSRBlockMatrixBlockNorm(6, &P_offd_data[i*bnnz], &tmp_norm, block_size); + hypre_CSRBlockMatrixBlockNorm(6, &P_offd_data[i * bnnz], &tmp_norm, block_size); min_weight = hypre_min(min_weight, tmp_norm); if (tmp_norm != 1.0) + { max_weight = hypre_max(max_weight, P_offd_data[i]); + } rowsum += tmp_norm; } @@ -786,7 +829,8 @@ hypre_BoomerAMGSetupStats( void *amg_vdata, } - avg_entries = ((HYPRE_Real) (global_nonzeros - coarse_size)) / ((HYPRE_Real) (fine_size - coarse_size)); + avg_entries = ((HYPRE_Real) (global_nonzeros - coarse_size)) / ((HYPRE_Real) ( + fine_size - coarse_size)); } else { @@ -831,47 +875,55 @@ hypre_BoomerAMGSetupStats( void *amg_vdata, if (hypre_CSRMatrixNumRows(P_diag)) { - if (P_diag_data) min_weight = P_diag_data[0]; + if (P_diag_data) { min_weight = P_diag_data[0]; } for (j = P_diag_i[0]; j < P_diag_i[1]; j++) { min_weight = hypre_min(min_weight, P_diag_data[j]); if (P_diag_data[j] != 1.0) + { max_weight = hypre_max(max_weight, P_diag_data[j]); + } min_rowsum += P_diag_data[j]; } for (j = P_offd_i[0]; j < P_offd_i[1]; j++) { min_weight = hypre_min(min_weight, P_offd_data[j]); if (P_offd_data[j] != 1.0) + { max_weight = hypre_max(max_weight, P_offd_data[j]); + } min_rowsum += P_offd_data[j]; } max_rowsum = min_rowsum; - min_entries = (P_diag_i[1]-P_diag_i[0])+(P_offd_i[1]-P_offd_i[0]); + min_entries = (P_diag_i[1] - P_diag_i[0]) + (P_offd_i[1] - P_offd_i[0]); max_entries = 0; for (j = 0; j < hypre_CSRMatrixNumRows(P_diag); j++) { - entries = (P_diag_i[j+1]-P_diag_i[j])+(P_offd_i[j+1]-P_offd_i[j]); + entries = (P_diag_i[j + 1] - P_diag_i[j]) + (P_offd_i[j + 1] - P_offd_i[j]); min_entries = hypre_min(entries, min_entries); max_entries = hypre_max(entries, max_entries); rowsum = 0.0; - for (i = P_diag_i[j]; i < P_diag_i[j+1]; i++) + for (i = P_diag_i[j]; i < P_diag_i[j + 1]; i++) { min_weight = hypre_min(min_weight, P_diag_data[i]); if (P_diag_data[i] != 1.0) + { max_weight = hypre_max(max_weight, P_diag_data[i]); + } rowsum += P_diag_data[i]; } - for (i = P_offd_i[j]; i < P_offd_i[j+1]; i++) + for (i = P_offd_i[j]; i < P_offd_i[j + 1]; i++) { min_weight = hypre_min(min_weight, P_offd_data[i]); if (P_offd_data[i] != 1.0) + { max_weight = hypre_max(max_weight, P_offd_data[i]); + } rowsum += P_offd_data[i]; } @@ -880,7 +932,8 @@ hypre_BoomerAMGSetupStats( void *amg_vdata, } } - avg_entries = ((HYPRE_Real) (global_nonzeros - coarse_size)) / ((HYPRE_Real) (fine_size - coarse_size)); + avg_entries = ((HYPRE_Real) (global_nonzeros - coarse_size)) / ((HYPRE_Real) ( + fine_size - coarse_size)); if (P_diag_clone != P_diag) { @@ -893,7 +946,7 @@ hypre_BoomerAMGSetupStats( void *amg_vdata, } } - numrows = row_starts[1]-row_starts[0]; + numrows = row_starts[1] - row_starts[0]; if (!numrows) /* if we don't have any rows, then don't have this count toward min row sum or min num entries */ { @@ -921,39 +974,41 @@ hypre_BoomerAMGSetupStats( void *amg_vdata, global_max_wt = gather_buff[5]; hypre_printf("%3d %*b x %-*b %3d %3d", - level, ndigits[0], fine_size, ndigits[0], coarse_size, - global_min_e, global_max_e); + level, ndigits[0], fine_size, ndigits[0], coarse_size, + global_min_e, global_max_e); hypre_printf(" %4.1f %10.3e %10.3e %10.3e %10.3e\n", - avg_entries, global_min_wt, global_max_wt, - global_min_rsum, global_max_rsum); + avg_entries, global_min_wt, global_max_wt, + global_min_rsum, global_max_rsum); } } total_variables = 0; operat_cmplxty = 0; - for (j=0;j -1) + { hypre_printf( " Additive V-cycle 1st level %d last level %d: \n", additive, add_lvl); + } if (mult_additive > -1) + { hypre_printf( " Mult-Additive V-cycle 1st level %d last level %d: \n", mult_additive, add_lvl); + } if (simple > -1) - hypre_printf( " Simplified Mult-Additive V-cycle 1st level %d: last level %d \n", simple, add_lvl); + { + hypre_printf( " Simplified Mult-Additive V-cycle 1st level %d: last level %d \n", simple, + add_lvl); + } hypre_printf( " Relaxation Parameters:\n"); - if (add_lvl == num_levels-1) + if (add_lvl == num_levels - 1) { hypre_printf( " Visiting Grid: down up coarse\n"); hypre_printf( " Number of sweeps: %4d %2d %4d \n", - num_grid_sweeps[1], - num_grid_sweeps[1],(2*num_grid_sweeps[1])); - hypre_printf( " Type 0=Jac, 3=hGS, 6=hSGS, 9=GE: %2d %2d %2d \n", add_rlx, add_rlx, add_rlx); + num_grid_sweeps[1], + num_grid_sweeps[1], (2 * num_grid_sweeps[1])); + hypre_printf( " Type 0=Jac, 3=hGS, 6=hSGS, 9=GE: %2d %2d %2d \n", add_rlx, add_rlx, + add_rlx); } else { hypre_printf( " Visiting Grid: down up\n"); hypre_printf( " Number of sweeps: %4d %2d\n", - num_grid_sweeps[1], num_grid_sweeps[1]); + num_grid_sweeps[1], num_grid_sweeps[1]); hypre_printf( " Type 0=Jac, 3=hGS, 6=hSGS, 9=GE: %2d %2d\n", add_rlx, add_rlx); } - if (add_lvl < num_levels -1) + if (add_lvl < num_levels - 1) { hypre_printf( " \n"); hypre_printf( "Multiplicative portion: \n"); hypre_printf( " Visiting Grid: down up coarse\n"); hypre_printf( " Number of sweeps: %4d %2d %4d\n", - num_grid_sweeps[1], num_grid_sweeps[2], num_grid_sweeps[3]); + num_grid_sweeps[1], num_grid_sweeps[2], num_grid_sweeps[3]); hypre_printf( " Type 0=Jac, 3=hGS, 6=hSGS, 9=GE: %4d %2d %4d\n", - grid_relax_type[1], grid_relax_type[2], grid_relax_type[3]); + grid_relax_type[1], grid_relax_type[2], grid_relax_type[3]); + } + if (add_rlx == 0) + { + hypre_printf( " Relaxation Weight: %e \n", add_rlx_wt); + } + { + hypre_printf( " Point types, partial sweeps (1=C, -1=F):\n"); + hypre_printf( " Pre-CG relaxation (down):"); } - if (add_rlx == 0) hypre_printf( " Relaxation Weight: %e \n", add_rlx_wt); - hypre_printf( " Point types, partial sweeps (1=C, -1=F):\n"); - hypre_printf( " Pre-CG relaxation (down):"); for (j = 0; j < num_grid_sweeps[1]; j++) + { hypre_printf(" %2d", zero); - hypre_printf( "\n"); - hypre_printf( " Post-CG relaxation (up):"); + } + { + hypre_printf( "\n"); + hypre_printf( " Post-CG relaxation (up):"); + } for (j = 0; j < num_grid_sweeps[2]; j++) + { hypre_printf(" %2d", zero); - hypre_printf( "\n"); - hypre_printf( " Coarsest grid:"); + } + { + hypre_printf( "\n"); + hypre_printf( " Coarsest grid:"); + } for (j = 0; j < num_grid_sweeps[3]; j++) + { hypre_printf(" %2d", zero); - hypre_printf( "\n\n"); + } + { + hypre_printf( "\n"); + } } else if (additive > 0 || mult_additive > 0 || simple > 0) { - HYPRE_Int add_lvl = add_end; - if (add_end == -1) add_lvl = num_levels-1; + HYPRE_Int add_lvl = (add_end == -1) ? (num_levels - 1) : add_end; + hypre_printf( " Relaxation Parameters:\n"); - if (add_lvl < num_levels -1) + if (add_lvl < num_levels - 1) { hypre_printf( " Visiting Grid: down up coarse\n"); hypre_printf( " Number of sweeps: %4d %2d %4d\n", - num_grid_sweeps[1], num_grid_sweeps[2], num_grid_sweeps[3]); + num_grid_sweeps[1], num_grid_sweeps[2], num_grid_sweeps[3]); hypre_printf( " Type 0=Jac, 3=hGS, 6=hSGS, 9=GE: %4d %2d %4d\n", - grid_relax_type[1], grid_relax_type[2], grid_relax_type[3]); + grid_relax_type[1], grid_relax_type[2], grid_relax_type[3]); } else { hypre_printf( " Visiting Grid: down up \n"); hypre_printf( " Number of sweeps: %4d %2d \n", - num_grid_sweeps[1], num_grid_sweeps[2]); + num_grid_sweeps[1], num_grid_sweeps[2]); hypre_printf( " Type 0=Jac, 3=hGS, 6=hSGS, 9=GE: %4d %2d \n", - grid_relax_type[1], grid_relax_type[2]); + grid_relax_type[1], grid_relax_type[2]); } hypre_printf( " Point types, partial sweeps (1=C, -1=F):\n"); if (grid_relax_points && grid_relax_type[1] != 8) { hypre_printf( " Pre-CG relaxation (down):"); for (j = 0; j < num_grid_sweeps[1]; j++) + { hypre_printf(" %2d", grid_relax_points[1][j]); + } hypre_printf( "\n"); hypre_printf( " Post-CG relaxation (up):"); for (j = 0; j < num_grid_sweeps[2]; j++) + { hypre_printf(" %2d", grid_relax_points[2][j]); + } hypre_printf( "\n"); } else if (relax_order == 1 && grid_relax_type[1] != 8) { hypre_printf( " Pre-CG relaxation (down):"); for (j = 0; j < num_grid_sweeps[1]; j++) + { hypre_printf(" %2d %2d", one, minus_one); + } hypre_printf( "\n"); hypre_printf( " Post-CG relaxation (up):"); for (j = 0; j < num_grid_sweeps[2]; j++) + { hypre_printf(" %2d %2d", minus_one, one); + } hypre_printf( "\n"); } else { hypre_printf( " Pre-CG relaxation (down):"); for (j = 0; j < num_grid_sweeps[1]; j++) + { hypre_printf(" %2d", zero); + } hypre_printf( "\n"); hypre_printf( " Post-CG relaxation (up):"); for (j = 0; j < num_grid_sweeps[2]; j++) + { hypre_printf(" %2d", zero); + } hypre_printf( "\n"); } - hypre_printf( "\n\n"); + { + hypre_printf( "\n\n"); + } if (additive > -1) + { hypre_printf( " Additive V-cycle 1st level %d last level %d: \n", additive, add_lvl); + } if (mult_additive > -1) + { hypre_printf( " Mult-Additive V-cycle 1st level %d last level %d: \n", mult_additive, add_lvl); + } if (simple > -1) - hypre_printf( " Simplified Mult-Additive V-cycle 1st level %d: last level %d \n", simple, add_lvl); - hypre_printf( " Relaxation Parameters:\n"); - if (add_lvl == num_levels-1) + { + hypre_printf( " Simplified Mult-Additive V-cycle 1st level %d: last level %d \n", simple, + add_lvl); + } + { + hypre_printf( " Relaxation Parameters:\n"); + } + if (add_lvl == num_levels - 1) { hypre_printf( " Visiting Grid: down up coarse\n"); hypre_printf( " Number of sweeps: %4d %2d %4d \n", - num_grid_sweeps[1], - num_grid_sweeps[1],(2*num_grid_sweeps[1])); - hypre_printf( " Type 0=Jac, 3=hGS, 6=hSGS, 9=GE: %2d %2d %2d \n", add_rlx, add_rlx, add_rlx); + num_grid_sweeps[1], + num_grid_sweeps[1], (2 * num_grid_sweeps[1])); + hypre_printf( " Type 0=Jac, 3=hGS, 6=hSGS, 9=GE: %2d %2d %2d \n", add_rlx, add_rlx, + add_rlx); } else { hypre_printf( " Visiting Grid: down up\n"); hypre_printf( " Number of sweeps: %4d %2d\n", - num_grid_sweeps[1], num_grid_sweeps[1]); + num_grid_sweeps[1], num_grid_sweeps[1]); hypre_printf( " Type 0=Jac, 3=hGS, 6=hSGS, 9=GE: %2d %2d\n", add_rlx, add_rlx); } - if (add_rlx == 0) hypre_printf( " Relaxation Weight: %e \n", add_rlx_wt); - hypre_printf( " Point types, partial sweeps (1=C, -1=F):\n"); - hypre_printf( " Pre-CG relaxation (down):"); + if (add_rlx == 0) + { + hypre_printf( " Relaxation Weight: %e \n", add_rlx_wt); + } + { + hypre_printf( " Point types, partial sweeps (1=C, -1=F):\n"); + hypre_printf( " Pre-CG relaxation (down):"); + } for (j = 0; j < num_grid_sweeps[1]; j++) + { hypre_printf(" %2d", zero); - hypre_printf( "\n"); - hypre_printf( " Post-CG relaxation (up):"); + } + { + hypre_printf( "\n"); + hypre_printf( " Post-CG relaxation (up):"); + } for (j = 0; j < num_grid_sweeps[2]; j++) + { hypre_printf(" %2d", zero); - hypre_printf( "\n"); - hypre_printf( " Coarsest grid:"); + } + { + hypre_printf( "\n"); + hypre_printf( " Coarsest grid:"); + } for (j = 0; j < num_grid_sweeps[3]; j++) + { hypre_printf(" %2d", zero); - hypre_printf( "\n\n"); + } + { + hypre_printf( "\n"); + } } else { hypre_printf( " Relaxation Parameters:\n"); hypre_printf( " Visiting Grid: down up coarse\n"); hypre_printf( " Number of sweeps: %4d %2d %4d \n", - num_grid_sweeps[1], - num_grid_sweeps[2],num_grid_sweeps[3]); + num_grid_sweeps[1], + num_grid_sweeps[2], num_grid_sweeps[3]); hypre_printf( " Type 0=Jac, 3=hGS, 6=hSGS, 9=GE: %4d %2d %4d \n", - grid_relax_type[1], - grid_relax_type[2],grid_relax_type[3]); + grid_relax_type[1], + grid_relax_type[2], grid_relax_type[3]); hypre_printf( " Point types, partial sweeps (1=C, -1=F):\n"); if (grid_relax_points && grid_relax_type[1] != 8) { hypre_printf( " Pre-CG relaxation (down):"); for (j = 0; j < num_grid_sweeps[1]; j++) + { hypre_printf(" %2d", grid_relax_points[1][j]); + } hypre_printf( "\n"); hypre_printf( " Post-CG relaxation (up):"); for (j = 0; j < num_grid_sweeps[2]; j++) + { hypre_printf(" %2d", grid_relax_points[2][j]); + } hypre_printf( "\n"); hypre_printf( " Coarsest grid:"); for (j = 0; j < num_grid_sweeps[3]; j++) + { hypre_printf(" %2d", grid_relax_points[3][j]); - hypre_printf( "\n\n"); + } + { + hypre_printf( "\n"); + } } else if (relax_order == 1 && grid_relax_type[1] != 8) { hypre_printf( " Pre-CG relaxation (down):"); for (j = 0; j < num_grid_sweeps[1]; j++) + { hypre_printf(" %2d %2d", one, minus_one); + } hypre_printf( "\n"); hypre_printf( " Post-CG relaxation (up):"); for (j = 0; j < num_grid_sweeps[2]; j++) + { hypre_printf(" %2d %2d", minus_one, one); + } hypre_printf( "\n"); hypre_printf( " Coarsest grid:"); for (j = 0; j < num_grid_sweeps[3]; j++) + { hypre_printf(" %2d", zero); - hypre_printf( "\n\n"); + } + { + hypre_printf( "\n"); + } } else { hypre_printf( " Pre-CG relaxation (down):"); for (j = 0; j < num_grid_sweeps[1]; j++) + { hypre_printf(" %2d", zero); + } hypre_printf( "\n"); hypre_printf( " Post-CG relaxation (up):"); for (j = 0; j < num_grid_sweeps[2]; j++) + { hypre_printf(" %2d", zero); + } hypre_printf( "\n"); hypre_printf( " Coarsest grid:"); for (j = 0; j < num_grid_sweeps[3]; j++) + { hypre_printf(" %2d", zero); - hypre_printf( "\n\n"); + } + { + hypre_printf( "\n"); + } } } +#if defined(HYPRE_USING_MAGMA) + if (grid_relax_type[3] == 98 || grid_relax_type[3] == 99 || + grid_relax_type[3] == 198 || grid_relax_type[3] == 199) + { + hypre_printf( " Using MAGMA's LU factorization on coarse level\n"); + } +#endif + { + hypre_printf( "\n"); + } + if (smooth_type == 6) - for (j=0; j < smooth_num_levels; j++) + { + for (j = 0; j < smooth_num_levels; j++) + { hypre_printf( " Schwarz Relaxation Weight %f level %d\n", - hypre_ParAMGDataSchwarzRlxWeight(amg_data),j); + hypre_ParAMGDataSchwarzRlxWeight(amg_data), j); + } + } if (smooth_type == 7) - for (j=0; j < smooth_num_levels; j++) + { + for (j = 0; j < smooth_num_levels; j++) + { hypre_printf( " Pilut smoother level %d\n", j); + } + } if (smooth_type == 8) - for (j=0; j < smooth_num_levels; j++) + { + for (j = 0; j < smooth_num_levels; j++) + { hypre_printf( " ParaSails smoother level %d\n", j); + } + } if (smooth_type == 9) - for (j=0; j < smooth_num_levels; j++) + { + for (j = 0; j < smooth_num_levels; j++) + { hypre_printf( " Euclid smoother level %d\n", j); - for (j=0; j < num_levels; j++) + } + } + for (j = 0; j < num_levels; j++) + { if (relax_weight[j] != 1) - hypre_printf( " Relaxation Weight %f level %d\n",relax_weight[j],j); - for (j=0; j < num_levels; j++) + { + hypre_printf( " Relaxation Weight %f level %d\n", relax_weight[j], j); + } + } + for (j = 0; j < num_levels; j++) + { if (omega[j] != 1) - hypre_printf( " Outer relaxation weight %f level %d\n",omega[j],j); + { + hypre_printf( " Outer relaxation weight %f level %d\n", omega[j], j); + } + } } hypre_TFree(num_coeffs, HYPRE_MEMORY_HOST); @@ -1191,43 +1371,42 @@ hypre_BoomerAMGSetupStats( void *amg_vdata, hypre_TFree(send_buff, HYPRE_MEMORY_HOST); hypre_TFree(gather_buff, HYPRE_MEMORY_HOST); - return(0); -} - - + hypre_GpuProfilingPopRange(); + return hypre_error_flag; +} /*--------------------------------------------------------------- * hypre_BoomerAMGWriteSolverParams *---------------------------------------------------------------*/ - -HYPRE_Int hypre_BoomerAMGWriteSolverParams(void* data) +HYPRE_Int +hypre_BoomerAMGWriteSolverParams(void* data) { hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data; /* amg solve params */ - HYPRE_Int num_levels; - HYPRE_Int max_iter; - HYPRE_Int cycle_type; - HYPRE_Int fcycle; - HYPRE_Int *num_grid_sweeps; - HYPRE_Int *grid_relax_type; - HYPRE_Int **grid_relax_points; - HYPRE_Int relax_order; - HYPRE_Real *relax_weight; - HYPRE_Real *omega; - HYPRE_Real tol; - HYPRE_Int smooth_type; - HYPRE_Int smooth_num_levels; - /* amg output params */ - HYPRE_Int amg_print_level; + HYPRE_Int num_levels; + HYPRE_Int max_iter; + HYPRE_Int cycle_type; + HYPRE_Int fcycle; + HYPRE_Int *num_grid_sweeps; + HYPRE_Int *grid_relax_type; + HYPRE_Int **grid_relax_points; + HYPRE_Int relax_order; + HYPRE_Real *relax_weight; + HYPRE_Real *omega; + HYPRE_Real tol; + HYPRE_Int smooth_type; + HYPRE_Int smooth_num_levels; - HYPRE_Int j; - HYPRE_Int one = 1; - HYPRE_Int minus_one = -1; - HYPRE_Int zero = 0; + /* amg output params */ + HYPRE_Int amg_print_level; + HYPRE_Int j; + HYPRE_Int one = 1; + HYPRE_Int minus_one = -1; + HYPRE_Int zero = 0; /*---------------------------------------------------------- * Get the amg_data data @@ -1256,8 +1435,8 @@ HYPRE_Int hypre_BoomerAMGWriteSolverParams(void* data) if (amg_print_level == 1 || amg_print_level == 3) { hypre_printf("\n\nBoomerAMG SOLVER PARAMETERS:\n\n"); - hypre_printf( " Maximum number of cycles: %d \n",max_iter); - hypre_printf( " Stopping Tolerance: %e \n",tol); + hypre_printf( " Maximum number of cycles: %d \n", max_iter); + hypre_printf( " Stopping Tolerance: %e \n", tol); if (fcycle) { hypre_printf( " Full Multigrid. Cycle type (1 = V, 2 = W, etc.): %d\n\n", cycle_type); @@ -1269,71 +1448,348 @@ HYPRE_Int hypre_BoomerAMGWriteSolverParams(void* data) hypre_printf( " Relaxation Parameters:\n"); hypre_printf( " Visiting Grid: down up coarse\n"); hypre_printf( " Number of sweeps: %4d %2d %4d \n", - num_grid_sweeps[1], - num_grid_sweeps[2],num_grid_sweeps[3]); + num_grid_sweeps[1], + num_grid_sweeps[2], num_grid_sweeps[3]); hypre_printf( " Type 0=Jac, 3=hGS, 6=hSGS, 9=GE: %4d %2d %4d \n", - grid_relax_type[1], - grid_relax_type[2],grid_relax_type[3]); + grid_relax_type[1], + grid_relax_type[2], grid_relax_type[3]); hypre_printf( " Point types, partial sweeps (1=C, -1=F):\n"); if (grid_relax_points) { hypre_printf( " Pre-CG relaxation (down):"); for (j = 0; j < num_grid_sweeps[1]; j++) + { hypre_printf(" %2d", grid_relax_points[1][j]); + } hypre_printf( "\n"); hypre_printf( " Post-CG relaxation (up):"); for (j = 0; j < num_grid_sweeps[2]; j++) + { hypre_printf(" %2d", grid_relax_points[2][j]); + } hypre_printf( "\n"); hypre_printf( " Coarsest grid:"); for (j = 0; j < num_grid_sweeps[3]; j++) + { hypre_printf(" %2d", grid_relax_points[3][j]); + } hypre_printf( "\n\n"); } else if (relax_order == 1) { hypre_printf( " Pre-CG relaxation (down):"); for (j = 0; j < num_grid_sweeps[1]; j++) + { hypre_printf(" %2d %2d", one, minus_one); + } hypre_printf( "\n"); hypre_printf( " Post-CG relaxation (up):"); for (j = 0; j < num_grid_sweeps[2]; j++) + { hypre_printf(" %2d %2d", minus_one, one); + } hypre_printf( "\n"); hypre_printf( " Coarsest grid:"); for (j = 0; j < num_grid_sweeps[3]; j++) + { hypre_printf(" %2d", zero); + } hypre_printf( "\n\n"); } else { hypre_printf( " Pre-CG relaxation (down):"); for (j = 0; j < num_grid_sweeps[1]; j++) + { hypre_printf(" %2d", zero); + } hypre_printf( "\n"); hypre_printf( " Post-CG relaxation (up):"); for (j = 0; j < num_grid_sweeps[2]; j++) + { hypre_printf(" %2d", zero); + } hypre_printf( "\n"); hypre_printf( " Coarsest grid:"); for (j = 0; j < num_grid_sweeps[3]; j++) + { hypre_printf(" %2d", zero); + } hypre_printf( "\n\n"); } + if (smooth_type == 6) - for (j=0; j < smooth_num_levels; j++) + { + for (j = 0; j < smooth_num_levels; j++) + { hypre_printf( " Schwarz Relaxation Weight %f level %d\n", - hypre_ParAMGDataSchwarzRlxWeight(amg_data),j); - for (j=0; j < num_levels; j++) + hypre_ParAMGDataSchwarzRlxWeight(amg_data), j); + } + } + for (j = 0; j < num_levels; j++) + { if (relax_weight[j] != 1) - hypre_printf( " Relaxation Weight %f level %d\n",relax_weight[j],j); - for (j=0; j < num_levels; j++) + { + hypre_printf( " Relaxation Weight %f level %d\n", relax_weight[j], j); + } + } + for (j = 0; j < num_levels; j++) + { if (omega[j] != 1) - hypre_printf( " Outer relaxation weight %f level %d\n",omega[j],j); + { + hypre_printf( " Outer relaxation weight %f level %d\n", omega[j], j); + } + } hypre_printf( " Output flag (print_level): %d \n", amg_print_level); } - return 0; + return hypre_error_flag; +} + +/*-------------------------------------------------------------------- + * hypre_BoomerAMGGetProlongationName + *--------------------------------------------------------------------*/ + +const char* +hypre_BoomerAMGGetProlongationName(hypre_ParAMGData *amg_data) +{ + switch (hypre_ParAMGDataInterpType(amg_data)) + { + case 0: + return "modified classical"; + + case 1: + return "LS"; + + case 2: + return "modified classical for hyperbolic PDEs"; + + case 3: + return "direct with separation of weights"; + + case 4: + return "multipass"; + + case 5: + return "multipass with separation of weights"; + + case 6: + return "extended+i"; + + case 7: + return "extended+i (if no common C-point)"; + + case 8: + return "standard"; + + case 9: + return "standard with separation of weights"; + + case 10: + return "block classical for nodal systems"; + + case 11: + return "block classical with diagonal blocks for nodal systems"; + + case 12: + return "F-F"; + + case 13: + return "F-F1"; + + case 14: + return "extended"; + + case 15: + return "direct with separation of weights"; + + case 16: + return "MM-extended"; + + case 17: + return "MM-extended+i"; + + case 18: + return "MM-extended+e"; + + case 24: + return "block direct for nodal systems"; + + case 100: + return "one-point"; + + default: + return "Unknown"; + } +} + +/*-------------------------------------------------------------------- + * hypre_BoomerAMGGetAggProlongationName + *--------------------------------------------------------------------*/ + +const char* +hypre_BoomerAMGGetAggProlongationName(hypre_ParAMGData *amg_data) +{ + if (hypre_ParAMGDataAggNumLevels(amg_data)) + { + switch (hypre_ParAMGDataAggInterpType(amg_data)) + { + case 1: + return "2-stage extended+i"; + + case 2: + return "2-stage standard"; + + case 3: + return "2-stage extended"; + + case 4: + return "multipass"; + + default: + return "Unknown"; + } + } + else + { + return ""; + } } +/*-------------------------------------------------------------------- + * hypre_BoomerAMGGetCoarseningName + *--------------------------------------------------------------------*/ + +const char* +hypre_BoomerAMGGetCoarseningName(hypre_ParAMGData *amg_data) +{ + switch (hypre_ParAMGDataCoarsenType(amg_data)) + { + case 0: + return "Cleary-Luby-Jones-Plassman"; + + case 1: + return "Ruge"; + + case 2: + return "Ruge-2B"; + + case 3: + return "Ruge-3"; + + case 4: + return "Ruge-3c"; + + case 5: + return "Ruge relax special points"; + + case 6: + return "Falgout-CLJP"; + + case 7: + return "CLJP, fixed random"; + + case 8: + return "PMIS"; + + case 9: + return "PMIS, fixed random"; + + case 10: + return "HMIS"; + + case 11: + return "Ruge 1st pass only"; + + case 21: + return "CGC"; + + case 22: + return "CGC-E"; + + default: + return "Unknown"; + } +} + +/*-------------------------------------------------------------------- + * hypre_BoomerAMGGetCoarseningName + *--------------------------------------------------------------------*/ + +const char* +hypre_BoomerAMGGetCycleName(hypre_ParAMGData *amg_data) +{ + static char name[10]; + + switch (hypre_ParAMGDataCycleType(amg_data)) + { + case 1: + hypre_sprintf(name, "V(%d,%d)", + hypre_ParAMGDataNumGridSweeps(amg_data)[0], + hypre_ParAMGDataNumGridSweeps(amg_data)[1]); + break; + + case 2: + hypre_sprintf(name, "W(%d,%d)", + hypre_ParAMGDataNumGridSweeps(amg_data)[0], + hypre_ParAMGDataNumGridSweeps(amg_data)[1]); + break; + + default: + return "Unknown"; + } + + return name; +} + +/*-------------------------------------------------------------------- + * hypre_BoomerAMGPrintGeneralInfo + * + * Prints to stdout info about BoomerAMG parameters. + * The input parameter "shift" refers to the number of whitespaces + * added to the beginning of each line. + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGPrintGeneralInfo(hypre_ParAMGData *amg_data, + HYPRE_Int shift) +{ + HYPRE_PRINT_SHIFTED_PARAM(shift, + "Solver Type = BoomerAMG\n"); + + HYPRE_PRINT_SHIFTED_PARAM(shift, + "Strength Threshold = %f\n", + hypre_ParAMGDataStrongThreshold(amg_data)); + + HYPRE_PRINT_SHIFTED_PARAM(shift, + "Interpolation Truncation Factor = %f\n", + hypre_ParAMGDataTruncFactor(amg_data)); + + HYPRE_PRINT_SHIFTED_PARAM(shift, + "Maximum Row Sum Threshold for Dependency Weakening = %f\n", + hypre_ParAMGDataMaxRowSum(amg_data)); + + HYPRE_PRINT_SHIFTED_PARAM(shift, + "Number of functions = %d\n", + hypre_ParAMGDataNumFunctions(amg_data)); + + HYPRE_PRINT_SHIFTED_PARAM(shift, + "Functions filtering is %s\n", + (hypre_ParAMGDataFilterFunctions(amg_data) > 0) ? "on" : "off"); + + HYPRE_PRINT_SHIFTED_PARAM(shift, + "Coarsening type = %s\n", + hypre_BoomerAMGGetCoarseningName(amg_data)); + + HYPRE_PRINT_SHIFTED_PARAM(shift, + "Prolongation type = %s\n", + hypre_BoomerAMGGetProlongationName(amg_data)); + + HYPRE_PRINT_SHIFTED_PARAM(shift, + "Cycle type = %s\n", + hypre_BoomerAMGGetCycleName(amg_data)); + hypre_printf("\n"); + + return hypre_error_flag; +} diff --git a/external/hypre/src/parcsr_ls/par_strength.c b/external/hypre/src/parcsr_ls/par_strength.c index 4b7408a2..f514737e 100644 --- a/external/hypre/src/parcsr_ls/par_strength.c +++ b/external/hypre/src/parcsr_ls/par_strength.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -153,10 +153,10 @@ hypre_BoomerAMGCreateSHost(hypre_ParCSRMatrix *A, num_cols_offd, num_nonzeros_diag, num_nonzeros_offd); S_diag = hypre_ParCSRMatrixDiag(S); - hypre_CSRMatrixI(S_diag) = hypre_CTAlloc(HYPRE_Int, num_variables+1, memory_location); + hypre_CSRMatrixI(S_diag) = hypre_CTAlloc(HYPRE_Int, num_variables + 1, memory_location); hypre_CSRMatrixJ(S_diag) = hypre_CTAlloc(HYPRE_Int, num_nonzeros_diag, HYPRE_MEMORY_HOST); S_offd = hypre_ParCSRMatrixOffd(S); - hypre_CSRMatrixI(S_offd) = hypre_CTAlloc(HYPRE_Int, num_variables+1, memory_location); + hypre_CSRMatrixI(S_offd) = hypre_CTAlloc(HYPRE_Int, num_variables + 1, memory_location); S_diag_i = hypre_CSRMatrixI(S_diag); HYPRE_Int *S_temp_diag_j = hypre_CSRMatrixJ(S_diag); @@ -183,7 +183,7 @@ hypre_BoomerAMGCreateSHost(hypre_ParCSRMatrix *A, HYPRE_BigInt *col_map_offd_A = hypre_ParCSRMatrixColMapOffd(A); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < num_cols_offd; i++) { @@ -210,9 +210,9 @@ hypre_BoomerAMGCreateSHost(hypre_ParCSRMatrix *A, for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { - int_buf_data[index++] = dof_func[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + int_buf_data[index++] = dof_func[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } } @@ -223,11 +223,11 @@ hypre_BoomerAMGCreateSHost(hypre_ParCSRMatrix *A, } /*HYPRE_Int prefix_sum_workspace[2*(hypre_NumThreads() + 1)];*/ - prefix_sum_workspace = hypre_TAlloc(HYPRE_Int, 2*(hypre_NumThreads() + 1), HYPRE_MEMORY_HOST); + prefix_sum_workspace = hypre_TAlloc(HYPRE_Int, 2 * (hypre_NumThreads() + 1), HYPRE_MEMORY_HOST); /* give S same nonzero structure as A */ #ifdef HYPRE_USING_OPENMP -#pragma omp parallel private(i,diag,row_scale,row_sum,jA,jS) + #pragma omp parallel private(i,diag,row_scale,row_sum,jA,jS) #endif { HYPRE_Int start, stop; @@ -251,7 +251,7 @@ hypre_BoomerAMGCreateSHost(hypre_ParCSRMatrix *A, { if (diag < 0) { - for (jA = A_diag_i[i]+1; jA < A_diag_i[i+1]; jA++) + for (jA = A_diag_i[i] + 1; jA < A_diag_i[i + 1]; jA++) { if (dof_func[i] == dof_func[A_diag_j[jA]]) { @@ -259,7 +259,7 @@ hypre_BoomerAMGCreateSHost(hypre_ParCSRMatrix *A, row_sum += A_diag_data[jA]; } } - for (jA = A_offd_i[i]; jA < A_offd_i[i+1]; jA++) + for (jA = A_offd_i[i]; jA < A_offd_i[i + 1]; jA++) { if (dof_func[i] == dof_func_offd[A_offd_j[jA]]) { @@ -270,7 +270,7 @@ hypre_BoomerAMGCreateSHost(hypre_ParCSRMatrix *A, } else { - for (jA = A_diag_i[i]+1; jA < A_diag_i[i+1]; jA++) + for (jA = A_diag_i[i] + 1; jA < A_diag_i[i + 1]; jA++) { if (dof_func[i] == dof_func[A_diag_j[jA]]) { @@ -278,7 +278,7 @@ hypre_BoomerAMGCreateSHost(hypre_ParCSRMatrix *A, row_sum += A_diag_data[jA]; } } - for (jA = A_offd_i[i]; jA < A_offd_i[i+1]; jA++) + for (jA = A_offd_i[i]; jA < A_offd_i[i + 1]; jA++) { if (dof_func[i] == dof_func_offd[A_offd_j[jA]]) { @@ -292,12 +292,12 @@ hypre_BoomerAMGCreateSHost(hypre_ParCSRMatrix *A, { if (diag < 0) { - for (jA = A_diag_i[i]+1; jA < A_diag_i[i+1]; jA++) + for (jA = A_diag_i[i] + 1; jA < A_diag_i[i + 1]; jA++) { row_scale = hypre_max(row_scale, A_diag_data[jA]); row_sum += A_diag_data[jA]; } - for (jA = A_offd_i[i]; jA < A_offd_i[i+1]; jA++) + for (jA = A_offd_i[i]; jA < A_offd_i[i + 1]; jA++) { row_scale = hypre_max(row_scale, A_offd_data[jA]); row_sum += A_offd_data[jA]; @@ -305,12 +305,12 @@ hypre_BoomerAMGCreateSHost(hypre_ParCSRMatrix *A, } else { - for (jA = A_diag_i[i]+1; jA < A_diag_i[i+1]; jA++) + for (jA = A_diag_i[i] + 1; jA < A_diag_i[i + 1]; jA++) { row_scale = hypre_min(row_scale, A_diag_data[jA]); row_sum += A_diag_data[jA]; } - for (jA = A_offd_i[i]; jA < A_offd_i[i+1]; jA++) + for (jA = A_offd_i[i]; jA < A_offd_i[i + 1]; jA++) { row_scale = hypre_min(row_scale, A_offd_data[jA]); row_sum += A_offd_data[jA]; @@ -323,16 +323,16 @@ hypre_BoomerAMGCreateSHost(hypre_ParCSRMatrix *A, /* compute row entries of S */ S_temp_diag_j[A_diag_i[i]] = -1; - if ((fabs(row_sum) > fabs(diag)*max_row_sum) && (max_row_sum < 1.0)) + if ((hypre_abs(row_sum) > hypre_abs(diag)*max_row_sum) && (max_row_sum < 1.0)) { /* make all dependencies weak */ - for (jA = A_diag_i[i]+1; jA < A_diag_i[i+1]; jA++) + for (jA = A_diag_i[i] + 1; jA < A_diag_i[i + 1]; jA++) { S_temp_diag_j[jA] = -1; } jS_diag -= A_diag_i[i + 1] - (A_diag_i[i] + 1); - for (jA = A_offd_i[i]; jA < A_offd_i[i+1]; jA++) + for (jA = A_offd_i[i]; jA < A_offd_i[i + 1]; jA++) { S_temp_offd_j[jA] = -1; } @@ -344,10 +344,10 @@ hypre_BoomerAMGCreateSHost(hypre_ParCSRMatrix *A, { if (diag < 0) { - for (jA = A_diag_i[i]+1; jA < A_diag_i[i+1]; jA++) + for (jA = A_diag_i[i] + 1; jA < A_diag_i[i + 1]; jA++) { if (A_diag_data[jA] <= strength_threshold * row_scale - || dof_func[i] != dof_func[A_diag_j[jA]]) + || dof_func[i] != dof_func[A_diag_j[jA]]) { S_temp_diag_j[jA] = -1; --jS_diag; @@ -357,10 +357,10 @@ hypre_BoomerAMGCreateSHost(hypre_ParCSRMatrix *A, S_temp_diag_j[jA] = A_diag_j[jA]; } } - for (jA = A_offd_i[i]; jA < A_offd_i[i+1]; jA++) + for (jA = A_offd_i[i]; jA < A_offd_i[i + 1]; jA++) { if (A_offd_data[jA] <= strength_threshold * row_scale - || dof_func[i] != dof_func_offd[A_offd_j[jA]]) + || dof_func[i] != dof_func_offd[A_offd_j[jA]]) { S_temp_offd_j[jA] = -1; --jS_offd; @@ -373,10 +373,10 @@ hypre_BoomerAMGCreateSHost(hypre_ParCSRMatrix *A, } else { - for (jA = A_diag_i[i]+1; jA < A_diag_i[i+1]; jA++) + for (jA = A_diag_i[i] + 1; jA < A_diag_i[i + 1]; jA++) { if (A_diag_data[jA] >= strength_threshold * row_scale - || dof_func[i] != dof_func[A_diag_j[jA]]) + || dof_func[i] != dof_func[A_diag_j[jA]]) { S_temp_diag_j[jA] = -1; --jS_diag; @@ -386,10 +386,10 @@ hypre_BoomerAMGCreateSHost(hypre_ParCSRMatrix *A, S_temp_diag_j[jA] = A_diag_j[jA]; } } - for (jA = A_offd_i[i]; jA < A_offd_i[i+1]; jA++) + for (jA = A_offd_i[i]; jA < A_offd_i[i + 1]; jA++) { if (A_offd_data[jA] >= strength_threshold * row_scale - || dof_func[i] != dof_func_offd[A_offd_j[jA]]) + || dof_func[i] != dof_func_offd[A_offd_j[jA]]) { S_temp_offd_j[jA] = -1; --jS_offd; @@ -405,7 +405,7 @@ hypre_BoomerAMGCreateSHost(hypre_ParCSRMatrix *A, { if (diag < 0) { - for (jA = A_diag_i[i]+1; jA < A_diag_i[i+1]; jA++) + for (jA = A_diag_i[i] + 1; jA < A_diag_i[i + 1]; jA++) { if (A_diag_data[jA] <= strength_threshold * row_scale) { @@ -417,7 +417,7 @@ hypre_BoomerAMGCreateSHost(hypre_ParCSRMatrix *A, S_temp_diag_j[jA] = A_diag_j[jA]; } } - for (jA = A_offd_i[i]; jA < A_offd_i[i+1]; jA++) + for (jA = A_offd_i[i]; jA < A_offd_i[i + 1]; jA++) { if (A_offd_data[jA] <= strength_threshold * row_scale) { @@ -432,7 +432,7 @@ hypre_BoomerAMGCreateSHost(hypre_ParCSRMatrix *A, } else { - for (jA = A_diag_i[i]+1; jA < A_diag_i[i+1]; jA++) + for (jA = A_diag_i[i] + 1; jA < A_diag_i[i + 1]; jA++) { if (A_diag_data[jA] >= strength_threshold * row_scale) { @@ -444,7 +444,7 @@ hypre_BoomerAMGCreateSHost(hypre_ParCSRMatrix *A, S_temp_diag_j[jA] = A_diag_j[jA]; } } - for (jA = A_offd_i[i]; jA < A_offd_i[i+1]; jA++) + for (jA = A_offd_i[i]; jA < A_offd_i[i + 1]; jA++) { if (A_offd_data[jA] >= strength_threshold * row_scale) { @@ -461,7 +461,8 @@ hypre_BoomerAMGCreateSHost(hypre_ParCSRMatrix *A, } /* !((row_sum > max_row_sum) && (max_row_sum < 1.0)) */ } /* for each variable */ - hypre_prefix_sum_pair(&jS_diag, S_diag_i + num_variables, &jS_offd, S_offd_i + num_variables, prefix_sum_workspace); + hypre_prefix_sum_pair(&jS_diag, S_diag_i + num_variables, &jS_offd, S_offd_i + num_variables, + prefix_sum_workspace); /*-------------------------------------------------------------- * "Compress" the strength matrix. @@ -479,7 +480,7 @@ hypre_BoomerAMGCreateSHost(hypre_ParCSRMatrix *A, S_offd_i[i] += jS_offd; jS = S_diag_i[i]; - for (jA = A_diag_i[i]; jA < A_diag_i[i+1]; jA++) + for (jA = A_diag_i[i]; jA < A_diag_i[i + 1]; jA++) { if (S_temp_diag_j[jA] > -1) { @@ -489,7 +490,7 @@ hypre_BoomerAMGCreateSHost(hypre_ParCSRMatrix *A, } jS = S_offd_i[i]; - for (jA = A_offd_i[i]; jA < A_offd_i[i+1]; jA++) + for (jA = A_offd_i[i]; jA < A_offd_i[i + 1]; jA++) { if (S_temp_offd_j[jA] > -1) { @@ -534,28 +535,26 @@ hypre_BoomerAMGCreateS(hypre_ParCSRMatrix *A, HYPRE_Int *dof_func, hypre_ParCSRMatrix **S_ptr) { -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_GpuProfilingPushRange("CreateS"); -#endif HYPRE_Int ierr = 0; -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(A) ); if (exec == HYPRE_EXEC_DEVICE) { - ierr = hypre_BoomerAMGCreateSDevice(A,0,strength_threshold,max_row_sum,num_functions,dof_func,S_ptr); + ierr = hypre_BoomerAMGCreateSDevice(A, 0, strength_threshold, max_row_sum, num_functions, dof_func, + S_ptr); } else #endif { - ierr = hypre_BoomerAMGCreateSHost(A,strength_threshold,max_row_sum,num_functions,dof_func,S_ptr); + ierr = hypre_BoomerAMGCreateSHost(A, strength_threshold, max_row_sum, num_functions, dof_func, + S_ptr); } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_GpuProfilingPopRange(); -#endif return ierr; } @@ -585,48 +584,48 @@ hypre_BoomerAMGCreateSFromCFMarker(hypre_ParCSRMatrix *A, hypre_profile_times[HYPRE_TIMER_ID_CREATES] -= hypre_MPI_Wtime(); #endif - MPI_Comm comm = hypre_ParCSRMatrixComm(A); - hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); - hypre_ParCSRCommHandle *comm_handle; - hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); - HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); - HYPRE_Real *A_diag_data = hypre_CSRMatrixData(A_diag); - - - hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); - HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); - HYPRE_Real *A_offd_data = NULL; - HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); - HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); + HYPRE_MemoryLocation memloc = hypre_ParCSRMatrixMemoryLocation(A); + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); + HYPRE_Real *A_diag_data = hypre_CSRMatrixData(A_diag); + + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); + HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); + HYPRE_Real *A_offd_data = NULL; + HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); + HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); + + HYPRE_BigInt *row_starts = hypre_ParCSRMatrixRowStarts(A); + HYPRE_Int num_variables = hypre_CSRMatrixNumRows(A_diag); + HYPRE_BigInt global_num_vars = hypre_ParCSRMatrixGlobalNumRows(A); + HYPRE_Int num_nonzeros_diag; + HYPRE_Int num_nonzeros_offd = 0; + HYPRE_Int num_cols_offd = 0; - HYPRE_BigInt *row_starts = hypre_ParCSRMatrixRowStarts(A); - HYPRE_Int num_variables = hypre_CSRMatrixNumRows(A_diag); - HYPRE_BigInt global_num_vars = hypre_ParCSRMatrixGlobalNumRows(A); - HYPRE_Int num_nonzeros_diag; - HYPRE_Int num_nonzeros_offd = 0; - HYPRE_Int num_cols_offd = 0; - - hypre_ParCSRMatrix *S; - hypre_CSRMatrix *S_diag; - HYPRE_Int *S_diag_i; - HYPRE_Int *S_diag_j; + hypre_ParCSRCommHandle *comm_handle; + hypre_ParCSRMatrix *S; + hypre_CSRMatrix *S_diag; + HYPRE_Int *S_diag_i; + HYPRE_Int *S_diag_j; /* HYPRE_Real *S_diag_data; */ - hypre_CSRMatrix *S_offd; - HYPRE_Int *S_offd_i = NULL; - HYPRE_Int *S_offd_j = NULL; + hypre_CSRMatrix *S_offd; + HYPRE_Int *S_offd_i = NULL; + HYPRE_Int *S_offd_j = NULL; /* HYPRE_Real *S_offd_data; */ - HYPRE_Int *dof_func_offd = NULL; + HYPRE_Int *dof_func_offd = NULL; - HYPRE_Real diag, row_scale, row_sum; - HYPRE_Int i, jj, jA, jS; - HYPRE_Int num_sends, start, j, index; - HYPRE_Int *int_buf_data; + HYPRE_Real diag, row_scale, row_sum; + HYPRE_Int i, jj, jA, jS; + HYPRE_Int num_sends, start, j, index; + HYPRE_Int *int_buf_data; - HYPRE_Int ierr = 0; - HYPRE_Int *CF_marker_offd = NULL; + HYPRE_Int ierr = 0; + HYPRE_Int *CF_marker_offd = NULL; - HYPRE_Int *prefix_sum_workspace; - HYPRE_Int my_id; + HYPRE_Int *prefix_sum_workspace; + HYPRE_Int my_id; /*-------------------------------------------------------------- * Compute a ParCSR strength matrix, S. @@ -654,10 +653,10 @@ hypre_BoomerAMGCreateSFromCFMarker(hypre_ParCSRMatrix *A, num_cols_offd, num_nonzeros_diag, num_nonzeros_offd); S_diag = hypre_ParCSRMatrixDiag(S); - hypre_CSRMatrixI(S_diag) = hypre_CTAlloc(HYPRE_Int, num_variables+1, HYPRE_MEMORY_HOST); + hypre_CSRMatrixI(S_diag) = hypre_CTAlloc(HYPRE_Int, num_variables + 1, HYPRE_MEMORY_HOST); hypre_CSRMatrixJ(S_diag) = hypre_CTAlloc(HYPRE_Int, num_nonzeros_diag, HYPRE_MEMORY_HOST); S_offd = hypre_ParCSRMatrixOffd(S); - hypre_CSRMatrixI(S_offd) = hypre_CTAlloc(HYPRE_Int, num_variables+1, HYPRE_MEMORY_HOST); + hypre_CSRMatrixI(S_offd) = hypre_CTAlloc(HYPRE_Int, num_variables + 1, HYPRE_MEMORY_HOST); S_diag_i = hypre_CSRMatrixI(S_diag); HYPRE_Int *S_temp_diag_j = hypre_CSRMatrixJ(S_diag); @@ -684,7 +683,7 @@ hypre_BoomerAMGCreateSFromCFMarker(hypre_ParCSRMatrix *A, HYPRE_BigInt *col_map_offd_A = hypre_ParCSRMatrixColMapOffd(A); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < num_cols_offd; i++) { @@ -704,17 +703,20 @@ hypre_BoomerAMGCreateSFromCFMarker(hypre_ParCSRMatrix *A, num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); if (num_functions > 1) { - int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, - num_sends), HYPRE_MEMORY_HOST); + int_buf_data = hypre_CTAlloc(HYPRE_Int, + hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); index = 0; for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j=start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) - int_buf_data[index++] = dof_func[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) + { + int_buf_data[index++] = dof_func[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; + } } - comm_handle = hypre_ParCSRCommHandleCreate( 11, comm_pkg, int_buf_data, dof_func_offd); + comm_handle = hypre_ParCSRCommHandleCreate(11, comm_pkg, int_buf_data, dof_func_offd); hypre_ParCSRCommHandleDestroy(comm_handle); hypre_TFree(int_buf_data, HYPRE_MEMORY_HOST); @@ -723,37 +725,39 @@ hypre_BoomerAMGCreateSFromCFMarker(hypre_ParCSRMatrix *A, /*------------------------------------------------------------------- * Get the CF_marker data for the off-processor columns *-------------------------------------------------------------------*/ - if (num_cols_offd) CF_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_offd, HYPRE_MEMORY_HOST); + CF_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_offd, HYPRE_MEMORY_HOST); if (!comm_pkg) { hypre_MatvecCommPkgCreate(A); comm_pkg = hypre_ParCSRMatrixCommPkg(A); } num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, - num_sends), HYPRE_MEMORY_HOST); + int_buf_data = hypre_CTAlloc(HYPRE_Int, + hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); index = 0; for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) int_buf_data[index++] - = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } - comm_handle = hypre_ParCSRCommHandleCreate( 11, comm_pkg, int_buf_data, - CF_marker_offd); + comm_handle = hypre_ParCSRCommHandleCreate(11, comm_pkg, int_buf_data, + CF_marker_offd); hypre_ParCSRCommHandleDestroy(comm_handle); hypre_TFree(int_buf_data, HYPRE_MEMORY_HOST); /*HYPRE_Int prefix_sum_workspace[2*(hypre_NumThreads() + 1)];*/ - prefix_sum_workspace = hypre_TAlloc(HYPRE_Int, 2*(hypre_NumThreads() + 1), HYPRE_MEMORY_HOST); + prefix_sum_workspace = hypre_TAlloc(HYPRE_Int, + 2 * (hypre_NumThreads() + 1), + HYPRE_MEMORY_HOST); /* give S same nonzero structure as A */ - #ifdef HYPRE_USING_OPENMP -#pragma omp parallel private(i,diag,row_scale,row_sum,jA,jS) + #pragma omp parallel private(i,diag,row_scale,row_sum,jA,jS) #endif { HYPRE_Int start, stop; @@ -762,7 +766,8 @@ hypre_BoomerAMGCreateSFromCFMarker(hypre_ParCSRMatrix *A, for (i = start; i < stop; i++) { - if (CF_marker[i] == SMRK) { + if (CF_marker[i] == SMRK) + { S_diag_i[i] = jS_diag; if (num_cols_offd) { @@ -778,7 +783,7 @@ hypre_BoomerAMGCreateSFromCFMarker(hypre_ParCSRMatrix *A, { if (diag < 0) { - for (jA = A_diag_i[i]+1; jA < A_diag_i[i+1]; jA++) + for (jA = A_diag_i[i] + 1; jA < A_diag_i[i + 1]; jA++) { jj = A_diag_j[jA]; if ((CF_marker[jj] == SMRK) && (dof_func[i] == dof_func[jj])) @@ -787,10 +792,11 @@ hypre_BoomerAMGCreateSFromCFMarker(hypre_ParCSRMatrix *A, row_sum += A_diag_data[jA]; } } - for (jA = A_offd_i[i]; jA < A_offd_i[i+1]; jA++) + for (jA = A_offd_i[i]; jA < A_offd_i[i + 1]; jA++) { jj = A_offd_j[jA]; - if ((CF_marker_offd[jj] == SMRK) && (dof_func[i] == dof_func_offd[jj])) + if ((CF_marker_offd[jj] == SMRK) && + (dof_func[i] == dof_func_offd[jj])) { row_scale = hypre_max(row_scale, A_offd_data[jA]); row_sum += A_offd_data[jA]; @@ -799,7 +805,7 @@ hypre_BoomerAMGCreateSFromCFMarker(hypre_ParCSRMatrix *A, } /* diag < 0 */ else { - for (jA = A_diag_i[i]+1; jA < A_diag_i[i+1]; jA++) + for (jA = A_diag_i[i] + 1; jA < A_diag_i[i + 1]; jA++) { jj = A_diag_j[jA]; if ((CF_marker[jj] == SMRK) && (dof_func[i] == dof_func[jj])) @@ -808,10 +814,11 @@ hypre_BoomerAMGCreateSFromCFMarker(hypre_ParCSRMatrix *A, row_sum += A_diag_data[jA]; } } - for (jA = A_offd_i[i]; jA < A_offd_i[i+1]; jA++) + for (jA = A_offd_i[i]; jA < A_offd_i[i + 1]; jA++) { jj = A_offd_j[jA]; - if ((CF_marker_offd[jj] == SMRK) && (dof_func[i] == dof_func_offd[A_offd_j[jA]])) + if ((CF_marker_offd[jj] == SMRK) && + (dof_func[i] == dof_func_offd[A_offd_j[jA]])) { row_scale = hypre_min(row_scale, A_offd_data[jA]); row_sum += A_offd_data[jA]; @@ -823,18 +830,20 @@ hypre_BoomerAMGCreateSFromCFMarker(hypre_ParCSRMatrix *A, { if (diag < 0) { - for (jA = A_diag_i[i]+1; jA < A_diag_i[i+1]; jA++) + for (jA = A_diag_i[i] + 1; jA < A_diag_i[i + 1]; jA++) { jj = A_diag_j[jA]; - if (CF_marker[jj] == SMRK) { + if (CF_marker[jj] == SMRK) + { row_scale = hypre_max(row_scale, A_diag_data[jA]); row_sum += A_diag_data[jA]; } } - for (jA = A_offd_i[i]; jA < A_offd_i[i+1]; jA++) + for (jA = A_offd_i[i]; jA < A_offd_i[i + 1]; jA++) { jj = A_offd_j[jA]; - if (CF_marker_offd[jj] == SMRK) { + if (CF_marker_offd[jj] == SMRK) + { row_scale = hypre_max(row_scale, A_offd_data[jA]); row_sum += A_offd_data[jA]; } @@ -842,18 +851,20 @@ hypre_BoomerAMGCreateSFromCFMarker(hypre_ParCSRMatrix *A, } /* diag < 0 */ else { - for (jA = A_diag_i[i]+1; jA < A_diag_i[i+1]; jA++) + for (jA = A_diag_i[i] + 1; jA < A_diag_i[i + 1]; jA++) { jj = A_diag_j[jA]; - if (CF_marker[jj] == SMRK) { + if (CF_marker[jj] == SMRK) + { row_scale = hypre_min(row_scale, A_diag_data[jA]); row_sum += A_diag_data[jA]; } } - for (jA = A_offd_i[i]; jA < A_offd_i[i+1]; jA++) + for (jA = A_offd_i[i]; jA < A_offd_i[i + 1]; jA++) { jj = A_offd_j[jA]; - if (CF_marker_offd[jj] == SMRK) { + if (CF_marker_offd[jj] == SMRK) + { row_scale = hypre_min(row_scale, A_offd_data[jA]); row_sum += A_offd_data[jA]; } @@ -864,15 +875,16 @@ hypre_BoomerAMGCreateSFromCFMarker(hypre_ParCSRMatrix *A, /* compute row entries of S */ S_temp_diag_j[A_diag_i[i]] = -1; - if ((fabs(row_sum) > fabs(diag)*max_row_sum) && (max_row_sum < 1.0)) + if ((hypre_abs(row_sum) > hypre_abs(diag)*max_row_sum) && + (max_row_sum < 1.0)) { /* make all dependencies weak */ - for (jA = A_diag_i[i]+1; jA < A_diag_i[i+1]; jA++) + for (jA = A_diag_i[i] + 1; jA < A_diag_i[i + 1]; jA++) { S_temp_diag_j[jA] = -1; } - for (jA = A_offd_i[i]; jA < A_offd_i[i+1]; jA++) + for (jA = A_offd_i[i]; jA < A_offd_i[i + 1]; jA++) { S_temp_offd_j[jA] = -1; } @@ -883,13 +895,13 @@ hypre_BoomerAMGCreateSFromCFMarker(hypre_ParCSRMatrix *A, { if (diag < 0) { - for (jA = A_diag_i[i]+1; jA < A_diag_i[i+1]; jA++) + for (jA = A_diag_i[i] + 1; jA < A_diag_i[i + 1]; jA++) { jj = A_diag_j[jA]; if (CF_marker[jj] == SMRK) { if ((A_diag_data[jA] <= strength_threshold * row_scale) - || (dof_func[i] != dof_func[jj])) + || (dof_func[i] != dof_func[jj])) { S_temp_diag_j[jA] = -1; } @@ -904,13 +916,13 @@ hypre_BoomerAMGCreateSFromCFMarker(hypre_ParCSRMatrix *A, S_temp_diag_j[jA] = -1; } } - for (jA = A_offd_i[i]; jA < A_offd_i[i+1]; jA++) + for (jA = A_offd_i[i]; jA < A_offd_i[i + 1]; jA++) { jj = A_offd_j[jA]; if (CF_marker_offd[jj] == SMRK) { if ((A_offd_data[jA] <= strength_threshold * row_scale) - || (dof_func[i] != dof_func_offd[jj])) + || (dof_func[i] != dof_func_offd[jj])) { S_temp_offd_j[jA] = -1; } @@ -928,13 +940,13 @@ hypre_BoomerAMGCreateSFromCFMarker(hypre_ParCSRMatrix *A, } /* end diag < 0 */ else { - for (jA = A_diag_i[i]+1; jA < A_diag_i[i+1]; jA++) + for (jA = A_diag_i[i] + 1; jA < A_diag_i[i + 1]; jA++) { jj = A_diag_j[jA]; if (CF_marker[jj] == SMRK) { if ((A_diag_data[jA] >= strength_threshold * row_scale) - || (dof_func[i] != dof_func[jj])) + || (dof_func[i] != dof_func[jj])) { S_temp_diag_j[jA] = -1; } @@ -949,13 +961,13 @@ hypre_BoomerAMGCreateSFromCFMarker(hypre_ParCSRMatrix *A, S_temp_diag_j[jA] = -1; } } - for (jA = A_offd_i[i]; jA < A_offd_i[i+1]; jA++) + for (jA = A_offd_i[i]; jA < A_offd_i[i + 1]; jA++) { jj = A_offd_j[jA]; if (CF_marker_offd[jj] == SMRK) { if ((A_offd_data[jA] >= strength_threshold * row_scale) - || (dof_func[i] != dof_func_offd[jj])) + || (dof_func[i] != dof_func_offd[jj])) { S_temp_offd_j[jA] = -1; } @@ -976,10 +988,11 @@ hypre_BoomerAMGCreateSFromCFMarker(hypre_ParCSRMatrix *A, { if (diag < 0) { - for (jA = A_diag_i[i]+1; jA < A_diag_i[i+1]; jA++) + for (jA = A_diag_i[i] + 1; jA < A_diag_i[i + 1]; jA++) { jj = A_diag_j[jA]; - if (CF_marker[jj] == SMRK) { + if (CF_marker[jj] == SMRK) + { if (A_diag_data[jA] <= strength_threshold * row_scale) { S_temp_diag_j[jA] = -1; @@ -989,14 +1002,17 @@ hypre_BoomerAMGCreateSFromCFMarker(hypre_ParCSRMatrix *A, S_temp_diag_j[jA] = jj; ++jS_diag; } - } else { + } + else + { S_temp_diag_j[jA] = -1; } } - for (jA = A_offd_i[i]; jA < A_offd_i[i+1]; jA++) + for (jA = A_offd_i[i]; jA < A_offd_i[i + 1]; jA++) { jj = A_offd_j[jA]; - if (CF_marker_offd[jj] == SMRK) { + if (CF_marker_offd[jj] == SMRK) + { if (A_offd_data[jA] <= strength_threshold * row_scale) { S_temp_offd_j[jA] = -1; @@ -1006,17 +1022,20 @@ hypre_BoomerAMGCreateSFromCFMarker(hypre_ParCSRMatrix *A, S_temp_offd_j[jA] = jj; ++jS_offd; } - } else { + } + else + { S_temp_offd_j[jA] = -1; } } } /* diag < 0 */ else { - for (jA = A_diag_i[i]+1; jA < A_diag_i[i+1]; jA++) + for (jA = A_diag_i[i] + 1; jA < A_diag_i[i + 1]; jA++) { jj = A_diag_j[jA]; - if (CF_marker[jj] == SMRK) { + if (CF_marker[jj] == SMRK) + { if (A_diag_data[jA] >= strength_threshold * row_scale) { S_temp_diag_j[jA] = -1; @@ -1026,14 +1045,17 @@ hypre_BoomerAMGCreateSFromCFMarker(hypre_ParCSRMatrix *A, S_temp_diag_j[jA] = jj; ++jS_diag; } - } else { + } + else + { S_temp_diag_j[jA] = -1; } } - for (jA = A_offd_i[i]; jA < A_offd_i[i+1]; jA++) + for (jA = A_offd_i[i]; jA < A_offd_i[i + 1]; jA++) { jj = A_offd_j[jA]; - if (CF_marker_offd[jj] == SMRK) { + if (CF_marker_offd[jj] == SMRK) + { if (A_offd_data[jA] >= strength_threshold * row_scale) { S_temp_offd_j[jA] = -1; @@ -1043,7 +1065,9 @@ hypre_BoomerAMGCreateSFromCFMarker(hypre_ParCSRMatrix *A, S_temp_offd_j[jA] = jj; ++jS_offd; } - } else { + } + else + { S_temp_offd_j[jA] = -1; } } @@ -1059,19 +1083,20 @@ hypre_BoomerAMGCreateSFromCFMarker(hypre_ParCSRMatrix *A, S_offd_i[i] = jS_offd; } - for (jA = A_diag_i[i]; jA < A_diag_i[i+1]; jA++) + for (jA = A_diag_i[i]; jA < A_diag_i[i + 1]; jA++) { S_temp_diag_j[jA] = -1; } - for (jA = A_offd_i[i]; jA < A_offd_i[i+1]; jA++) + for (jA = A_offd_i[i]; jA < A_offd_i[i + 1]; jA++) { S_temp_offd_j[jA] = -1; } } /* CF_marker != SMRK */ } /* for each variable */ - hypre_prefix_sum_pair(&jS_diag, S_diag_i + num_variables, &jS_offd, S_offd_i + num_variables, prefix_sum_workspace); + hypre_prefix_sum_pair(&jS_diag, S_diag_i + num_variables, &jS_offd, + S_offd_i + num_variables, prefix_sum_workspace); /*-------------------------------------------------------------- * "Compress" the strength matrix. @@ -1089,7 +1114,7 @@ hypre_BoomerAMGCreateSFromCFMarker(hypre_ParCSRMatrix *A, S_offd_i[i] += jS_offd; jS = S_diag_i[i]; - for (jA = A_diag_i[i]; jA < A_diag_i[i+1]; jA++) + for (jA = A_diag_i[i]; jA < A_diag_i[i + 1]; jA++) { if (S_temp_diag_j[jA] > -1) { @@ -1099,7 +1124,7 @@ hypre_BoomerAMGCreateSFromCFMarker(hypre_ParCSRMatrix *A, } jS = S_offd_i[i]; - for (jA = A_offd_i[i]; jA < A_offd_i[i+1]; jA++) + for (jA = A_offd_i[i]; jA < A_offd_i[i + 1]; jA++) { if (S_temp_offd_j[jA] > -1) { @@ -1121,7 +1146,9 @@ hypre_BoomerAMGCreateSFromCFMarker(hypre_ParCSRMatrix *A, hypre_ParCSRMatrixCommPkg(S) = NULL; - *S_ptr = S; + hypre_ParCSRMatrixMigrate(S, memloc); + + *S_ptr = S; hypre_TFree(prefix_sum_workspace, HYPRE_MEMORY_HOST); hypre_TFree(S_temp_diag_j, HYPRE_MEMORY_HOST); @@ -1269,10 +1296,10 @@ hypre_BoomerAMGCreateSabsHost(hypre_ParCSRMatrix *A, num_cols_offd, num_nonzeros_diag, num_nonzeros_offd); S_diag = hypre_ParCSRMatrixDiag(S); - hypre_CSRMatrixI(S_diag) = hypre_CTAlloc(HYPRE_Int, num_variables+1, memory_location); + hypre_CSRMatrixI(S_diag) = hypre_CTAlloc(HYPRE_Int, num_variables + 1, memory_location); hypre_CSRMatrixJ(S_diag) = hypre_CTAlloc(HYPRE_Int, num_nonzeros_diag, memory_location); S_offd = hypre_ParCSRMatrixOffd(S); - hypre_CSRMatrixI(S_offd) = hypre_CTAlloc(HYPRE_Int, num_variables+1, memory_location); + hypre_CSRMatrixI(S_offd) = hypre_CTAlloc(HYPRE_Int, num_variables + 1, memory_location); S_diag_i = hypre_CSRMatrixI(S_diag); S_diag_j = hypre_CSRMatrixJ(S_diag); @@ -1309,14 +1336,15 @@ hypre_BoomerAMGCreateSabsHost(hypre_ParCSRMatrix *A, num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); if (num_functions > 1) { - int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), HYPRE_MEMORY_HOST); + int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); index = 0; for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j=start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { - int_buf_data[index++] = dof_func[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + int_buf_data[index++] = dof_func[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } } @@ -1327,10 +1355,10 @@ hypre_BoomerAMGCreateSabsHost(hypre_ParCSRMatrix *A, } /* give S same nonzero structure as A */ - hypre_ParCSRMatrixCopy(A,S,0); + hypre_ParCSRMatrixCopy(A, S, 0); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,diag,row_scale,row_sum,jA) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,diag,row_scale,row_sum,jA) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < num_variables; i++) { @@ -1338,50 +1366,50 @@ hypre_BoomerAMGCreateSabsHost(hypre_ParCSRMatrix *A, /* compute scaling factor and row sum */ row_scale = 0.0; - row_sum = fabs(diag); + row_sum = hypre_abs(diag); if (num_functions > 1) { - for (jA = A_diag_i[i]+1; jA < A_diag_i[i+1]; jA++) + for (jA = A_diag_i[i] + 1; jA < A_diag_i[i + 1]; jA++) { if (dof_func[i] == dof_func[A_diag_j[jA]]) { - row_scale = hypre_max(row_scale, fabs(A_diag_data[jA])); - row_sum += fabs(A_diag_data[jA]); + row_scale = hypre_max(row_scale, hypre_abs(A_diag_data[jA])); + row_sum += hypre_abs(A_diag_data[jA]); } } - for (jA = A_offd_i[i]; jA < A_offd_i[i+1]; jA++) + for (jA = A_offd_i[i]; jA < A_offd_i[i + 1]; jA++) { if (dof_func[i] == dof_func_offd[A_offd_j[jA]]) { - row_scale = hypre_max(row_scale, fabs(A_offd_data[jA])); - row_sum += fabs(A_offd_data[jA]); + row_scale = hypre_max(row_scale, hypre_abs(A_offd_data[jA])); + row_sum += hypre_abs(A_offd_data[jA]); } } } else { - for (jA = A_diag_i[i]+1; jA < A_diag_i[i+1]; jA++) + for (jA = A_diag_i[i] + 1; jA < A_diag_i[i + 1]; jA++) { - row_scale = hypre_max(row_scale, fabs(A_diag_data[jA])); - row_sum += fabs(A_diag_data[jA]); + row_scale = hypre_max(row_scale, hypre_abs(A_diag_data[jA])); + row_sum += hypre_abs(A_diag_data[jA]); } - for (jA = A_offd_i[i]; jA < A_offd_i[i+1]; jA++) + for (jA = A_offd_i[i]; jA < A_offd_i[i + 1]; jA++) { - row_scale = hypre_max(row_scale, fabs(A_offd_data[jA])); - row_sum += fabs(A_offd_data[jA]); + row_scale = hypre_max(row_scale, hypre_abs(A_offd_data[jA])); + row_sum += hypre_abs(A_offd_data[jA]); } } /* compute row entries of S */ S_diag_j[A_diag_i[i]] = -1; /* reject diag entry */ - if ( fabs(row_sum) < fabs(diag)*(2.0-max_row_sum) && max_row_sum < 1.0 ) + if ( hypre_abs(row_sum) < hypre_abs(diag) * (2.0 - max_row_sum) && max_row_sum < 1.0 ) { /* make all dependencies weak */ - for (jA = A_diag_i[i]+1; jA < A_diag_i[i+1]; jA++) + for (jA = A_diag_i[i] + 1; jA < A_diag_i[i + 1]; jA++) { S_diag_j[jA] = -1; } - for (jA = A_offd_i[i]; jA < A_offd_i[i+1]; jA++) + for (jA = A_offd_i[i]; jA < A_offd_i[i + 1]; jA++) { S_offd_j[jA] = -1; } @@ -1390,18 +1418,18 @@ hypre_BoomerAMGCreateSabsHost(hypre_ParCSRMatrix *A, { if (num_functions > 1) { - for (jA = A_diag_i[i]+1; jA < A_diag_i[i+1]; jA++) + for (jA = A_diag_i[i] + 1; jA < A_diag_i[i + 1]; jA++) { - if (fabs(A_diag_data[jA]) <= strength_threshold * row_scale - || dof_func[i] != dof_func[A_diag_j[jA]]) + if (hypre_abs(A_diag_data[jA]) <= strength_threshold * row_scale + || dof_func[i] != dof_func[A_diag_j[jA]]) { S_diag_j[jA] = -1; } } - for (jA = A_offd_i[i]; jA < A_offd_i[i+1]; jA++) + for (jA = A_offd_i[i]; jA < A_offd_i[i + 1]; jA++) { - if (fabs(A_offd_data[jA]) <= strength_threshold * row_scale - || dof_func[i] != dof_func_offd[A_offd_j[jA]]) + if (hypre_abs(A_offd_data[jA]) <= strength_threshold * row_scale + || dof_func[i] != dof_func_offd[A_offd_j[jA]]) { S_offd_j[jA] = -1; } @@ -1409,16 +1437,16 @@ hypre_BoomerAMGCreateSabsHost(hypre_ParCSRMatrix *A, } else { - for (jA = A_diag_i[i]+1; jA < A_diag_i[i+1]; jA++) + for (jA = A_diag_i[i] + 1; jA < A_diag_i[i + 1]; jA++) { - if (fabs(A_diag_data[jA]) <= strength_threshold * row_scale) + if (hypre_abs(A_diag_data[jA]) <= strength_threshold * row_scale) { S_diag_j[jA] = -1; } } - for (jA = A_offd_i[i]; jA < A_offd_i[i+1]; jA++) + for (jA = A_offd_i[i]; jA < A_offd_i[i + 1]; jA++) { - if (fabs(A_offd_data[jA]) <= strength_threshold * row_scale) + if (hypre_abs(A_offd_data[jA]) <= strength_threshold * row_scale) { S_offd_j[jA] = -1; } @@ -1442,7 +1470,7 @@ hypre_BoomerAMGCreateSabsHost(hypre_ParCSRMatrix *A, for (i = 0; i < num_variables; i++) { S_diag_i[i] = jS; - for (jA = A_diag_i[i]; jA < A_diag_i[i+1]; jA++) + for (jA = A_diag_i[i]; jA < A_diag_i[i + 1]; jA++) { if (S_diag_j[jA] > -1) { @@ -1459,7 +1487,7 @@ hypre_BoomerAMGCreateSabsHost(hypre_ParCSRMatrix *A, for (i = 0; i < num_variables; i++) { S_offd_i[i] = jS; - for (jA = A_offd_i[i]; jA < A_offd_i[i+1]; jA++) + for (jA = A_offd_i[i]; jA < A_offd_i[i + 1]; jA++) { if (S_offd_j[jA] > -1) { @@ -1487,28 +1515,26 @@ hypre_BoomerAMGCreateSabs(hypre_ParCSRMatrix *A, HYPRE_Int *dof_func, hypre_ParCSRMatrix **S_ptr) { -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_GpuProfilingPushRange("CreateSabs"); -#endif HYPRE_Int ierr = 0; -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(A) ); if (exec == HYPRE_EXEC_DEVICE) { - ierr = hypre_BoomerAMGCreateSDevice(A,1,strength_threshold,max_row_sum,num_functions,dof_func,S_ptr); + ierr = hypre_BoomerAMGCreateSDevice(A, 1, strength_threshold, max_row_sum, num_functions, dof_func, + S_ptr); } else #endif { - ierr = hypre_BoomerAMGCreateSabsHost(A,strength_threshold,max_row_sum,num_functions,dof_func,S_ptr); + ierr = hypre_BoomerAMGCreateSabsHost(A, strength_threshold, max_row_sum, num_functions, dof_func, + S_ptr); } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_GpuProfilingPopRange(); -#endif return ierr; } @@ -1524,7 +1550,7 @@ hypre_BoomerAMGCreateSCommPkg(hypre_ParCSRMatrix *A, hypre_MPI_Status *status; hypre_MPI_Request *requests; hypre_ParCSRCommPkg *comm_pkg_A = hypre_ParCSRMatrixCommPkg(A); - hypre_ParCSRCommPkg *comm_pkg_S; + hypre_ParCSRCommPkg *comm_pkg_S = NULL; hypre_ParCSRCommHandle *comm_handle; hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); HYPRE_BigInt *col_map_offd_A = hypre_ParCSRMatrixColMapOffd(A); @@ -1570,12 +1596,16 @@ hypre_BoomerAMGCreateSCommPkg(hypre_ParCSRMatrix *A, S_marker = NULL; if (num_cols_offd_A) + { S_marker = hypre_CTAlloc(HYPRE_Int, num_cols_offd_A, HYPRE_MEMORY_HOST); + } - for (i=0; i < num_cols_offd_A; i++) + for (i = 0; i < num_cols_offd_A; i++) + { S_marker[i] = -1; + } - for (i=0; i < num_nonzeros; i++) + for (i = 0; i < num_nonzeros; i++) { jcol = S_offd_j[i]; S_marker[jcol] = 0; @@ -1585,9 +1615,9 @@ hypre_BoomerAMGCreateSCommPkg(hypre_ParCSRMatrix *A, proc_cnt = 0; cnt = 0; num_recvs_S = 0; - for (i=0; i < num_recvs_A; i++) + for (i = 0; i < num_recvs_A; i++) { - for (j=recv_vec_starts_A[i]; j < recv_vec_starts_A[i+1]; j++) + for (j = recv_vec_starts_A[i]; j < recv_vec_starts_A[i + 1]; j++) { if (!S_marker[j]) { @@ -1604,13 +1634,13 @@ hypre_BoomerAMGCreateSCommPkg(hypre_ParCSRMatrix *A, recv_change = NULL; recv_procs_S = NULL; send_change = NULL; - if (col_map_offd_S) hypre_TFree(col_map_offd_S, HYPRE_MEMORY_HOST); + if (col_map_offd_S) { hypre_TFree(col_map_offd_S, HYPRE_MEMORY_HOST); } col_map_offd_S = NULL; col_offd_S_to_A = NULL; - if (num_recvs_A) recv_change = hypre_CTAlloc(HYPRE_Int, num_recvs_A, HYPRE_MEMORY_HOST); - if (num_sends_A) send_change = hypre_CTAlloc(HYPRE_Int, num_sends_A, HYPRE_MEMORY_HOST); - if (num_recvs_S) recv_procs_S = hypre_CTAlloc(HYPRE_Int, num_recvs_S, HYPRE_MEMORY_HOST); - recv_vec_starts_S = hypre_CTAlloc(HYPRE_Int, num_recvs_S+1, HYPRE_MEMORY_HOST); + if (num_recvs_A) { recv_change = hypre_CTAlloc(HYPRE_Int, num_recvs_A, HYPRE_MEMORY_HOST); } + if (num_sends_A) { send_change = hypre_CTAlloc(HYPRE_Int, num_sends_A, HYPRE_MEMORY_HOST); } + if (num_recvs_S) { recv_procs_S = hypre_CTAlloc(HYPRE_Int, num_recvs_S, HYPRE_MEMORY_HOST); } + recv_vec_starts_S = hypre_CTAlloc(HYPRE_Int, num_recvs_S + 1, HYPRE_MEMORY_HOST); if (num_cols_offd_S) { col_map_offd_S = hypre_CTAlloc(HYPRE_BigInt, num_cols_offd_S, HYPRE_MEMORY_HOST); @@ -1618,7 +1648,7 @@ hypre_BoomerAMGCreateSCommPkg(hypre_ParCSRMatrix *A, } if (num_cols_offd_S < num_cols_offd_A) { - for (i=0; i < num_nonzeros; i++) + for (i = 0; i < num_nonzeros; i++) { jcol = S_offd_j[i]; S_offd_j[i] = S_marker[jcol]; @@ -1628,9 +1658,9 @@ hypre_BoomerAMGCreateSCommPkg(hypre_ParCSRMatrix *A, proc_cnt = 0; cnt = 0; recv_vec_starts_S[0] = 0; - for (i=0; i < num_recvs_A; i++) + for (i = 0; i < num_recvs_A; i++) { - for (j=recv_vec_starts_A[i]; j < recv_vec_starts_A[i+1]; j++) + for (j = recv_vec_starts_A[i]; j < recv_vec_starts_A[i + 1]; j++) { if (S_marker[j] != -1) { @@ -1639,7 +1669,7 @@ hypre_BoomerAMGCreateSCommPkg(hypre_ParCSRMatrix *A, proc = 1; } } - recv_change[i] = j-cnt-recv_vec_starts_A[i]+recv_vec_starts_S[proc_cnt]; + recv_change[i] = j - cnt - recv_vec_starts_A[i] + recv_vec_starts_S[proc_cnt]; if (proc) { recv_procs_S[proc_cnt++] = recv_procs_A[i]; @@ -1650,9 +1680,9 @@ hypre_BoomerAMGCreateSCommPkg(hypre_ParCSRMatrix *A, } else { - for (i=0; i < num_recvs_A; i++) + for (i = 0; i < num_recvs_A; i++) { - for (j=recv_vec_starts_A[i]; j < recv_vec_starts_A[i+1]; j++) + for (j = recv_vec_starts_A[i]; j < recv_vec_starts_A[i + 1]; j++) { col_map_offd_S[j] = col_map_offd_A[j]; col_offd_S_to_A[j] = j; @@ -1663,37 +1693,47 @@ hypre_BoomerAMGCreateSCommPkg(hypre_ParCSRMatrix *A, recv_vec_starts_S[num_recvs_A] = recv_vec_starts_A[num_recvs_A]; } - requests = hypre_CTAlloc(hypre_MPI_Request, num_sends_A+num_recvs_A, HYPRE_MEMORY_HOST); - j=0; - for (i=0; i < num_sends_A; i++) - hypre_MPI_Irecv(&send_change[i],1,HYPRE_MPI_INT,send_procs_A[i], 0,comm,&requests[j++]); + requests = hypre_CTAlloc(hypre_MPI_Request, num_sends_A + num_recvs_A, HYPRE_MEMORY_HOST); + j = 0; + for (i = 0; i < num_sends_A; i++) + { + hypre_MPI_Irecv(&send_change[i], 1, HYPRE_MPI_INT, send_procs_A[i], 0, comm, &requests[j++]); + } - for (i=0; i < num_recvs_A; i++) - hypre_MPI_Isend(&recv_change[i],1,HYPRE_MPI_INT,recv_procs_A[i], 0,comm,&requests[j++]); + for (i = 0; i < num_recvs_A; i++) + { + hypre_MPI_Isend(&recv_change[i], 1, HYPRE_MPI_INT, recv_procs_A[i], 0, comm, &requests[j++]); + } status = hypre_CTAlloc(hypre_MPI_Status, j, HYPRE_MEMORY_HOST); - hypre_MPI_Waitall(j,requests,status); + hypre_MPI_Waitall(j, requests, status); hypre_TFree(status, HYPRE_MEMORY_HOST); hypre_TFree(requests, HYPRE_MEMORY_HOST); num_sends_S = 0; total_nz = send_map_starts_A[num_sends_A]; - for (i=0; i < num_sends_A; i++) + for (i = 0; i < num_sends_A; i++) { if (send_change[i]) { - if ((send_map_starts_A[i+1]-send_map_starts_A[i]) > send_change[i]) + if ((send_map_starts_A[i + 1] - send_map_starts_A[i]) > send_change[i]) + { num_sends_S++; + } } else + { num_sends_S++; + } total_nz -= send_change[i]; } send_procs_S = NULL; if (num_sends_S) + { send_procs_S = hypre_CTAlloc(HYPRE_Int, num_sends_S, HYPRE_MEMORY_HOST); - send_map_starts_S = hypre_CTAlloc(HYPRE_Int, num_sends_S+1, HYPRE_MEMORY_HOST); + } + send_map_starts_S = hypre_CTAlloc(HYPRE_Int, num_sends_S + 1, HYPRE_MEMORY_HOST); send_map_elmts_S = NULL; if (total_nz) { @@ -1701,38 +1741,37 @@ hypre_BoomerAMGCreateSCommPkg(hypre_ParCSRMatrix *A, big_send_map_elmts_S = hypre_CTAlloc(HYPRE_BigInt, total_nz, HYPRE_MEMORY_HOST); } - proc = 0; proc_cnt = 0; - for (i=0; i < num_sends_A; i++) + for (i = 0; i < num_sends_A; i++) { - cnt = send_map_starts_A[i+1]-send_map_starts_A[i]-send_change[i]; + cnt = send_map_starts_A[i + 1] - send_map_starts_A[i] - send_change[i]; if (cnt) { send_procs_S[proc_cnt++] = send_procs_A[i]; - send_map_starts_S[proc_cnt] = send_map_starts_S[proc_cnt-1]+cnt; + send_map_starts_S[proc_cnt] = send_map_starts_S[proc_cnt - 1] + cnt; } } - comm_pkg_S = hypre_CTAlloc(hypre_ParCSRCommPkg, 1, HYPRE_MEMORY_HOST); - hypre_ParCSRCommPkgComm(comm_pkg_S) = comm; - hypre_ParCSRCommPkgNumRecvs(comm_pkg_S) = num_recvs_S; - hypre_ParCSRCommPkgRecvProcs(comm_pkg_S) = recv_procs_S; - hypre_ParCSRCommPkgRecvVecStarts(comm_pkg_S) = recv_vec_starts_S; - hypre_ParCSRCommPkgNumSends(comm_pkg_S) = num_sends_S; - hypre_ParCSRCommPkgSendProcs(comm_pkg_S) = send_procs_S; - hypre_ParCSRCommPkgSendMapStarts(comm_pkg_S) = send_map_starts_S; + /* Create communication package for S */ + hypre_ParCSRCommPkgCreateAndFill(comm, + num_recvs_S, recv_procs_S, recv_vec_starts_S, + num_sends_S, send_procs_S, send_map_starts_S, + send_map_elmts_S, + &comm_pkg_S); comm_handle = hypre_ParCSRCommHandleCreate(22, comm_pkg_S, col_map_offd_S, - big_send_map_elmts_S); + big_send_map_elmts_S); hypre_ParCSRCommHandleDestroy(comm_handle); first_row = hypre_ParCSRMatrixFirstRowIndex(A); if (first_row) - for (i=0; i < send_map_starts_S[num_sends_S]; i++) - send_map_elmts_S[i] = (HYPRE_Int)(big_send_map_elmts_S[i]-first_row); - - hypre_ParCSRCommPkgSendMapElmts(comm_pkg_S) = send_map_elmts_S; + { + for (i = 0; i < send_map_starts_S[num_sends_S]; i++) + { + send_map_elmts_S[i] = (HYPRE_Int)(big_send_map_elmts_S[i] - first_row); + } + } hypre_ParCSRMatrixCommPkg(S) = comm_pkg_S; hypre_ParCSRMatrixColMapOffd(S) = col_map_offd_S; @@ -1765,7 +1804,7 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, MPI_Comm comm = hypre_ParCSRMatrixComm(S); hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(S); - hypre_ParCSRCommPkg *tmp_comm_pkg; + hypre_ParCSRCommPkg *tmp_comm_pkg = NULL; hypre_ParCSRCommHandle *comm_handle; hypre_CSRMatrix *S_diag = hypre_ParCSRMatrixDiag(S); @@ -1794,7 +1833,7 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, /*HYPRE_Int *C_offd_data=NULL;*/ HYPRE_Int *C_offd_i; - HYPRE_Int *C_offd_j=NULL; + HYPRE_Int *C_offd_j = NULL; HYPRE_Int num_cols_offd_C = 0; @@ -1849,7 +1888,7 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, /*HYPRE_Int prefix_sum_workspace[2*(hypre_NumThreads() + 1)];*/ HYPRE_Int *prefix_sum_workspace; HYPRE_Int *num_coarse_prefix_sum; - prefix_sum_workspace = hypre_TAlloc(HYPRE_Int, 2*(hypre_NumThreads() + 1), HYPRE_MEMORY_HOST); + prefix_sum_workspace = hypre_TAlloc(HYPRE_Int, 2 * (hypre_NumThreads() + 1), HYPRE_MEMORY_HOST); num_coarse_prefix_sum = hypre_TAlloc(HYPRE_Int, hypre_NumThreads() + 1, HYPRE_MEMORY_HOST); /*----------------------------------------------------------------------- @@ -1861,9 +1900,9 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, hypre_MPI_Comm_rank(comm, &my_id); my_first_cpt = coarse_row_starts[0]; - my_last_cpt = coarse_row_starts[1]-1; - if (my_id == (num_procs -1)) global_num_coarse = coarse_row_starts[1]; - hypre_MPI_Bcast(&global_num_coarse, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); + my_last_cpt = coarse_row_starts[1] - 1; + if (my_id == (num_procs - 1)) { global_num_coarse = coarse_row_starts[1]; } + hypre_MPI_Bcast(&global_num_coarse, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); if (num_cols_offd_S) { @@ -1881,7 +1920,7 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, /*HYPRE_Int num_coarse_prefix_sum[hypre_NumThreads() + 1];*/ #ifdef HYPRE_USING_OPENMP -#pragma omp parallel private(i) + #pragma omp parallel private(i) #endif { HYPRE_Int num_coarse_private = 0; @@ -1891,7 +1930,7 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, for (i = i_begin; i < i_end; i++) { - if (CF_marker[i] > 0) num_coarse_private++; + if (CF_marker[i] > 0) { num_coarse_private++; } } hypre_prefix_sum(&num_coarse_private, &num_coarse, num_coarse_prefix_sum); @@ -1929,21 +1968,22 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, HYPRE_Int end = send_map_starts[num_sends]; big_int_buf_data = hypre_TAlloc(HYPRE_BigInt, end, HYPRE_MEMORY_HOST); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for HYPRE_SMP_SCHEDULE + #pragma omp parallel for HYPRE_SMP_SCHEDULE #endif for (index = begin; index < end; index++) { - big_int_buf_data[index - begin] = (HYPRE_BigInt)fine_to_coarse[send_map_elmts[index]] + my_first_cpt; + big_int_buf_data[index - begin] = (HYPRE_BigInt)fine_to_coarse[send_map_elmts[index]] + + my_first_cpt; } comm_handle = hypre_ParCSRCommHandleCreate( 21, comm_pkg, big_int_buf_data, - fine_to_coarse_offd); + fine_to_coarse_offd); hypre_ParCSRCommHandleDestroy(comm_handle); int_buf_data = hypre_TAlloc(HYPRE_Int, end, HYPRE_MEMORY_HOST); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for HYPRE_SMP_SCHEDULE + #pragma omp parallel for HYPRE_SMP_SCHEDULE #endif for (index = begin; index < end; index++) { @@ -1951,14 +1991,14 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, } comm_handle = hypre_ParCSRCommHandleCreate(11, comm_pkg, int_buf_data, - CF_marker_offd); + CF_marker_offd); hypre_ParCSRCommHandleDestroy(comm_handle); hypre_TFree(int_buf_data, HYPRE_MEMORY_HOST); hypre_TFree(big_int_buf_data, HYPRE_MEMORY_HOST); - S_int_i = hypre_TAlloc(HYPRE_Int, end+1, HYPRE_MEMORY_HOST); - S_ext_i = hypre_CTAlloc(HYPRE_Int, recv_vec_starts[num_recvs]+1, HYPRE_MEMORY_HOST); + S_int_i = hypre_TAlloc(HYPRE_Int, end + 1, HYPRE_MEMORY_HOST); + S_ext_i = hypre_CTAlloc(HYPRE_Int, recv_vec_starts[num_recvs] + 1, HYPRE_MEMORY_HOST); /*-------------------------------------------------------------------------- * generate S_int_i through adding number of coarse row-elements of offd and diag @@ -1968,19 +2008,19 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, S_int_i[0] = 0; num_nonzeros = 0; #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(j,k) reduction(+:num_nonzeros) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(j,k) reduction(+:num_nonzeros) HYPRE_SMP_SCHEDULE #endif for (j = begin; j < end; j++) { HYPRE_Int jrow = send_map_elmts[j]; HYPRE_Int index = 0; - for (k = S_diag_i[jrow]; k < S_diag_i[jrow+1]; k++) + for (k = S_diag_i[jrow]; k < S_diag_i[jrow + 1]; k++) { - if (CF_marker[S_diag_j[k]] > 0) index++; + if (CF_marker[S_diag_j[k]] > 0) { index++; } } - for (k = S_offd_i[jrow]; k < S_offd_i[jrow+1]; k++) + for (k = S_offd_i[jrow]; k < S_offd_i[jrow + 1]; k++) { - if (CF_marker_offd[S_offd_j[k]] > 0) index++; + if (CF_marker_offd[S_offd_j[k]] > 0) { index++; } } S_int_i[j - begin + 1] = index; num_nonzeros += S_int_i[j - begin + 1]; @@ -1990,41 +2030,50 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, * initialize communication *--------------------------------------------------------------------------*/ if (num_procs > 1) - comm_handle = hypre_ParCSRCommHandleCreate(11,comm_pkg,&S_int_i[1],&S_ext_i[1]); + { + comm_handle = hypre_ParCSRCommHandleCreate(11, comm_pkg, &S_int_i[1], &S_ext_i[1]); + } - if (num_nonzeros) S_int_j = hypre_TAlloc(HYPRE_BigInt, num_nonzeros, HYPRE_MEMORY_HOST); + if (num_nonzeros) { S_int_j = hypre_TAlloc(HYPRE_BigInt, num_nonzeros, HYPRE_MEMORY_HOST); } - tmp_send_map_starts = hypre_CTAlloc(HYPRE_Int, num_sends+1, HYPRE_MEMORY_HOST); - tmp_recv_vec_starts = hypre_CTAlloc(HYPRE_Int, num_recvs+1, HYPRE_MEMORY_HOST); + tmp_send_map_starts = hypre_CTAlloc(HYPRE_Int, num_sends + 1, HYPRE_MEMORY_HOST); + tmp_recv_vec_starts = hypre_CTAlloc(HYPRE_Int, num_recvs + 1, HYPRE_MEMORY_HOST); tmp_send_map_starts[0] = 0; j_cnt = 0; - for (i=0; i < num_sends; i++) + for (i = 0; i < num_sends; i++) { - for (j = send_map_starts[i]; j < send_map_starts[i+1]; j++) + for (j = send_map_starts[i]; j < send_map_starts[i + 1]; j++) { jrow = send_map_elmts[j]; - for (k=S_diag_i[jrow]; k < S_diag_i[jrow+1]; k++) + for (k = S_diag_i[jrow]; k < S_diag_i[jrow + 1]; k++) { if (CF_marker[S_diag_j[k]] > 0) - S_int_j[j_cnt++] = (HYPRE_BigInt)fine_to_coarse[S_diag_j[k]]+my_first_cpt; + { + S_int_j[j_cnt++] = (HYPRE_BigInt)fine_to_coarse[S_diag_j[k]] + my_first_cpt; + } } - for (k=S_offd_i[jrow]; k < S_offd_i[jrow+1]; k++) + for (k = S_offd_i[jrow]; k < S_offd_i[jrow + 1]; k++) { if (CF_marker_offd[S_offd_j[k]] > 0) + { S_int_j[j_cnt++] = fine_to_coarse_offd[S_offd_j[k]]; + } } } - tmp_send_map_starts[i+1] = j_cnt; + tmp_send_map_starts[i + 1] = j_cnt; } - tmp_comm_pkg = hypre_CTAlloc(hypre_ParCSRCommPkg, 1, HYPRE_MEMORY_HOST); - hypre_ParCSRCommPkgComm(tmp_comm_pkg) = comm; - hypre_ParCSRCommPkgNumSends(tmp_comm_pkg) = num_sends; - hypre_ParCSRCommPkgNumRecvs(tmp_comm_pkg) = num_recvs; - hypre_ParCSRCommPkgSendProcs(tmp_comm_pkg) = hypre_ParCSRCommPkgSendProcs(comm_pkg); - hypre_ParCSRCommPkgRecvProcs(tmp_comm_pkg) = hypre_ParCSRCommPkgRecvProcs(comm_pkg); - hypre_ParCSRCommPkgSendMapStarts(tmp_comm_pkg) = tmp_send_map_starts; + /* Create temporary communication package */ + hypre_ParCSRCommPkgCreateAndFill(comm, + num_recvs, + hypre_ParCSRCommPkgRecvProcs(comm_pkg), + tmp_recv_vec_starts, + num_sends, + hypre_ParCSRCommPkgSendProcs(comm_pkg), + tmp_send_map_starts, + NULL, + &tmp_comm_pkg); hypre_ParCSRCommHandleDestroy(comm_handle); comm_handle = NULL; @@ -2034,20 +2083,24 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, * evaluate S_ext_i and compute num_nonzeros for S_ext *--------------------------------------------------------------------------*/ - for (i=0; i < recv_vec_starts[num_recvs]; i++) - S_ext_i[i+1] += S_ext_i[i]; + for (i = 0; i < recv_vec_starts[num_recvs]; i++) + { + S_ext_i[i + 1] += S_ext_i[i]; + } num_nonzeros = S_ext_i[recv_vec_starts[num_recvs]]; - if (num_nonzeros) S_ext_j = hypre_TAlloc(HYPRE_BigInt, num_nonzeros, HYPRE_MEMORY_HOST); - - tmp_recv_vec_starts[0] = 0; - for (i=0; i < num_recvs; i++) - tmp_recv_vec_starts[i+1] = S_ext_i[recv_vec_starts[i+1]]; + if (num_nonzeros) + { + S_ext_j = hypre_TAlloc(HYPRE_BigInt, num_nonzeros, HYPRE_MEMORY_HOST); + } - hypre_ParCSRCommPkgRecvVecStarts(tmp_comm_pkg) = tmp_recv_vec_starts; + for (i = 0; i < num_recvs; i++) + { + tmp_recv_vec_starts[i + 1] = S_ext_i[recv_vec_starts[i + 1]]; + } - comm_handle = hypre_ParCSRCommHandleCreate(21,tmp_comm_pkg,S_int_j,S_ext_j); + comm_handle = hypre_ParCSRCommHandleCreate(21, tmp_comm_pkg, S_int_j, S_ext_j); hypre_ParCSRCommHandleDestroy(comm_handle); comm_handle = NULL; @@ -2064,15 +2117,16 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, #ifdef HYPRE_CONCURRENT_HOPSCOTCH HYPRE_BigInt *S_big_offd_j = NULL; - S_ext_diag_i = hypre_TAlloc(HYPRE_Int, num_cols_offd_S+1, HYPRE_MEMORY_HOST); + S_ext_diag_i = hypre_TAlloc(HYPRE_Int, num_cols_offd_S + 1, HYPRE_MEMORY_HOST); S_ext_diag_i[0] = 0; - S_ext_offd_i = hypre_TAlloc(HYPRE_Int, num_cols_offd_S+1, HYPRE_MEMORY_HOST); + S_ext_offd_i = hypre_TAlloc(HYPRE_Int, num_cols_offd_S + 1, HYPRE_MEMORY_HOST); S_ext_offd_i[0] = 0; hypre_UnorderedBigIntSet found_set; - hypre_UnorderedBigIntSetCreate(&found_set, S_ext_i[num_cols_offd_S] + num_cols_offd_S, 16*hypre_NumThreads()); + hypre_UnorderedBigIntSetCreate(&found_set, S_ext_i[num_cols_offd_S] + num_cols_offd_S, + 16 * hypre_NumThreads()); -#pragma omp parallel private(i,j, big_i1) + #pragma omp parallel private(i,j, big_i1) { HYPRE_Int S_ext_offd_size_private = 0; HYPRE_Int S_ext_diag_size_private = 0; @@ -2086,7 +2140,7 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, { hypre_UnorderedBigIntSetPut(&found_set, fine_to_coarse_offd[i]); } - for (j=S_ext_i[i]; j < S_ext_i[i+1]; j++) + for (j = S_ext_i[i]; j < S_ext_i[i + 1]; j++) { big_i1 = S_ext_j[j]; if (big_i1 < my_first_cpt || big_i1 > my_last_cpt) @@ -2095,19 +2149,23 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, hypre_UnorderedBigIntSetPut(&found_set, big_i1); } else + { S_ext_diag_size_private++; + } } } hypre_prefix_sum_pair( - &S_ext_diag_size_private, &S_ext_diag_size, - &S_ext_offd_size_private, &S_ext_offd_size, - prefix_sum_workspace); + &S_ext_diag_size_private, &S_ext_diag_size, + &S_ext_offd_size_private, &S_ext_offd_size, + prefix_sum_workspace); -#pragma omp master + #pragma omp master { if (S_ext_diag_size) + { S_ext_diag_j = hypre_TAlloc(HYPRE_Int, S_ext_diag_size, HYPRE_MEMORY_HOST); + } if (S_ext_offd_size) { S_ext_offd_j = hypre_TAlloc(HYPRE_Int, S_ext_offd_size, HYPRE_MEMORY_HOST); @@ -2115,18 +2173,22 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, } } -#pragma omp barrier + #pragma omp barrier for (i = i_begin; i < i_end; i++) { - for (j=S_ext_i[i]; j < S_ext_i[i+1]; j++) + for (j = S_ext_i[i]; j < S_ext_i[i + 1]; j++) { big_i1 = S_ext_j[j]; if (big_i1 < my_first_cpt || big_i1 > my_last_cpt) + { S_big_offd_j[S_ext_offd_size_private++] = big_i1; + } //S_ext_offd_j[S_ext_offd_size_private++] = big_i1; else + { S_ext_diag_j[S_ext_diag_size_private++] = (HYPRE_Int)(big_i1 - my_first_cpt); + } } S_ext_diag_i[i + 1] = S_ext_diag_size_private; S_ext_offd_i[i + 1] = S_ext_offd_size_private; @@ -2139,33 +2201,40 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, hypre_TFree(S_ext_i, HYPRE_MEMORY_HOST); hypre_UnorderedBigIntMap col_map_offd_C_inverse; - hypre_big_sort_and_create_inverse_map(temp, num_cols_offd_C, &col_map_offd_C, &col_map_offd_C_inverse); + hypre_big_sort_and_create_inverse_map(temp, num_cols_offd_C, &col_map_offd_C, + &col_map_offd_C_inverse); -#pragma omp parallel for HYPRE_SMP_SCHEDULE - for (i=0 ; i < S_ext_offd_size; i++) + #pragma omp parallel for HYPRE_SMP_SCHEDULE + for (i = 0 ; i < S_ext_offd_size; i++) + { S_ext_offd_j[i] = hypre_UnorderedBigIntMapGet(&col_map_offd_C_inverse, S_big_offd_j[i]); + } //S_ext_offd_j[i] = hypre_UnorderedIntMapGet(&col_map_offd_C_inverse, S_ext_offd_j[i]); hypre_TFree(S_ext_j, HYPRE_MEMORY_HOST); hypre_TFree(S_big_offd_j, HYPRE_MEMORY_HOST); - if (num_cols_offd_C) hypre_UnorderedBigIntMapDestroy(&col_map_offd_C_inverse); + if (num_cols_offd_C) { hypre_UnorderedBigIntMapDestroy(&col_map_offd_C_inverse); } #else /* !HYPRE_CONCURRENT_HOPSCOTCH */ HYPRE_Int cnt_offd, cnt_diag, cnt, value; S_ext_diag_size = 0; S_ext_offd_size = 0; - for (i=0; i < num_cols_offd_S; i++) + for (i = 0; i < num_cols_offd_S; i++) { - for (j=S_ext_i[i]; j < S_ext_i[i+1]; j++) + for (j = S_ext_i[i]; j < S_ext_i[i + 1]; j++) { if (S_ext_j[j] < my_first_cpt || S_ext_j[j] > my_last_cpt) + { S_ext_offd_size++; + } else + { S_ext_diag_size++; + } } } - S_ext_diag_i = hypre_CTAlloc(HYPRE_Int, num_cols_offd_S+1, HYPRE_MEMORY_HOST); - S_ext_offd_i = hypre_CTAlloc(HYPRE_Int, num_cols_offd_S+1, HYPRE_MEMORY_HOST); + S_ext_diag_i = hypre_CTAlloc(HYPRE_Int, num_cols_offd_S + 1, HYPRE_MEMORY_HOST); + S_ext_offd_i = hypre_CTAlloc(HYPRE_Int, num_cols_offd_S + 1, HYPRE_MEMORY_HOST); if (S_ext_diag_size) { @@ -2180,17 +2249,21 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, cnt_diag = 0; cnt = 0; HYPRE_Int num_coarse_offd = 0; - for (i=0; i < num_cols_offd_S; i++) + for (i = 0; i < num_cols_offd_S; i++) { - if (CF_marker_offd[i] > 0) num_coarse_offd++; + if (CF_marker_offd[i] > 0) { num_coarse_offd++; } - for (j=S_ext_i[i]; j < S_ext_i[i+1]; j++) + for (j = S_ext_i[i]; j < S_ext_i[i + 1]; j++) { big_i1 = S_ext_j[j]; if (big_i1 < my_first_cpt || big_i1 > my_last_cpt) + { S_ext_j[cnt_offd++] = big_i1; + } else + { S_ext_diag_j[cnt_diag++] = (HYPRE_Int)(big_i1 - my_first_cpt); + } } S_ext_diag_i[++cnt] = cnt_diag; S_ext_offd_i[cnt] = cnt_offd; @@ -2201,20 +2274,22 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, cnt = 0; if (S_ext_offd_size || num_coarse_offd) { - temp = hypre_CTAlloc(HYPRE_BigInt, S_ext_offd_size+num_coarse_offd, HYPRE_MEMORY_HOST); - for (i=0; i < S_ext_offd_size; i++) + temp = hypre_CTAlloc(HYPRE_BigInt, S_ext_offd_size + num_coarse_offd, HYPRE_MEMORY_HOST); + for (i = 0; i < S_ext_offd_size; i++) + { temp[i] = S_ext_j[i]; + } cnt = S_ext_offd_size; - for (i=0; i < num_cols_offd_S; i++) - if (CF_marker_offd[i] > 0) temp[cnt++] = fine_to_coarse_offd[i]; + for (i = 0; i < num_cols_offd_S; i++) + if (CF_marker_offd[i] > 0) { temp[cnt++] = fine_to_coarse_offd[i]; } } if (cnt) { - hypre_BigQsort0(temp, 0, cnt-1); + hypre_BigQsort0(temp, 0, cnt - 1); num_cols_offd_C = 1; value = temp[0]; - for (i=1; i < cnt; i++) + for (i = 1; i < cnt; i++) { if (temp[i] > value) { @@ -2225,15 +2300,21 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, } if (num_cols_offd_C) + { col_map_offd_C = hypre_CTAlloc(HYPRE_BigInt, num_cols_offd_C, HYPRE_MEMORY_HOST); + } - for (i=0; i < num_cols_offd_C; i++) + for (i = 0; i < num_cols_offd_C; i++) + { col_map_offd_C[i] = temp[i]; + } if (S_ext_offd_size || num_coarse_offd) + { hypre_TFree(temp, HYPRE_MEMORY_HOST); + } - for (i=0 ; i < S_ext_offd_size; i++) + for (i = 0 ; i < S_ext_offd_size; i++) S_ext_offd_j[i] = hypre_BigBinarySearch(col_map_offd_C, S_ext_j[i], num_cols_offd_C); @@ -2246,7 +2327,7 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, map_S_to_C = hypre_TAlloc(HYPRE_Int, num_cols_offd_S, HYPRE_MEMORY_HOST); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel private(i) + #pragma omp parallel private(i) #endif { HYPRE_Int i_begin, i_end; @@ -2257,10 +2338,11 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, { if (CF_marker_offd[i] > 0) { - cnt = hypre_BigLowerBound(col_map_offd_C + cnt, col_map_offd_C + num_cols_offd_C, fine_to_coarse_offd[i]) - col_map_offd_C; + cnt = hypre_BigLowerBound(col_map_offd_C + cnt, col_map_offd_C + num_cols_offd_C, + fine_to_coarse_offd[i]) - col_map_offd_C; map_S_to_C[i] = cnt++; } - else map_S_to_C[i] = -1; + else { map_S_to_C[i] = -1; } } } /* omp parallel */ } @@ -2275,8 +2357,8 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, *-----------------------------------------------------------------------*/ HYPRE_Int *S_marker_array = NULL, *S_marker_offd_array = NULL; - if (num_coarse) S_marker_array = hypre_TAlloc(HYPRE_Int, num_coarse*hypre_NumThreads(), HYPRE_MEMORY_HOST); - if (num_cols_offd_C) S_marker_offd_array = hypre_TAlloc(HYPRE_Int, num_cols_offd_C*hypre_NumThreads(), HYPRE_MEMORY_HOST); + if (num_coarse) { S_marker_array = hypre_TAlloc(HYPRE_Int, num_coarse * hypre_NumThreads(), HYPRE_MEMORY_HOST); } + if (num_cols_offd_C) { S_marker_offd_array = hypre_TAlloc(HYPRE_Int, num_cols_offd_C * hypre_NumThreads(), HYPRE_MEMORY_HOST); } HYPRE_Int *C_temp_offd_j_array = NULL; HYPRE_Int *C_temp_diag_j_array = NULL; @@ -2285,22 +2367,25 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, if (num_paths > 1) { - C_temp_diag_j_array = hypre_TAlloc(HYPRE_Int, num_coarse*hypre_NumThreads(), HYPRE_MEMORY_HOST); - C_temp_offd_j_array = hypre_TAlloc(HYPRE_Int, num_cols_offd_C*hypre_NumThreads(), HYPRE_MEMORY_HOST); - - C_temp_diag_data_array = hypre_TAlloc(HYPRE_Int, num_coarse*hypre_NumThreads(), HYPRE_MEMORY_HOST); - C_temp_offd_data_array = hypre_TAlloc(HYPRE_Int, num_cols_offd_C*hypre_NumThreads(), HYPRE_MEMORY_HOST); + C_temp_diag_j_array = hypre_TAlloc(HYPRE_Int, num_coarse * hypre_NumThreads(), HYPRE_MEMORY_HOST); + C_temp_offd_j_array = hypre_TAlloc(HYPRE_Int, num_cols_offd_C * hypre_NumThreads(), + HYPRE_MEMORY_HOST); + + C_temp_diag_data_array = hypre_TAlloc(HYPRE_Int, num_coarse * hypre_NumThreads(), + HYPRE_MEMORY_HOST); + C_temp_offd_data_array = hypre_TAlloc(HYPRE_Int, num_cols_offd_C * hypre_NumThreads(), + HYPRE_MEMORY_HOST); } - C_diag_i = hypre_CTAlloc(HYPRE_Int, num_coarse+1, HYPRE_MEMORY_HOST); - C_offd_i = hypre_CTAlloc(HYPRE_Int, num_coarse+1, HYPRE_MEMORY_HOST); + C_diag_i = hypre_CTAlloc(HYPRE_Int, num_coarse + 1, HYPRE_MEMORY_HOST); + C_offd_i = hypre_CTAlloc(HYPRE_Int, num_coarse + 1, HYPRE_MEMORY_HOST); /*----------------------------------------------------------------------- * Loop over rows of S *-----------------------------------------------------------------------*/ #ifdef HYPRE_USING_OPENMP -#pragma omp parallel private(i1,i2,i3,jj1,jj2,index) + #pragma omp parallel private(i1,i2,i3,jj1,jj2,index) #endif { HYPRE_Int my_thread_num = hypre_GetThreadNum(); @@ -2313,16 +2398,16 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, if (num_paths > 1) { - C_temp_diag_j = C_temp_diag_j_array + num_coarse*my_thread_num; - C_temp_offd_j = C_temp_offd_j_array + num_cols_offd_C*my_thread_num; + C_temp_diag_j = C_temp_diag_j_array + num_coarse * my_thread_num; + C_temp_offd_j = C_temp_offd_j_array + num_cols_offd_C * my_thread_num; - C_temp_diag_data = C_temp_diag_data_array + num_coarse*my_thread_num; - C_temp_offd_data = C_temp_offd_data_array + num_cols_offd_C*my_thread_num; + C_temp_diag_data = C_temp_diag_data_array + num_coarse * my_thread_num; + C_temp_offd_data = C_temp_offd_data_array + num_cols_offd_C * my_thread_num; } HYPRE_Int *S_marker = NULL, *S_marker_offd = NULL; - if (num_coarse) S_marker = S_marker_array + num_coarse*my_thread_num; - if (num_cols_offd_C) S_marker_offd = S_marker_offd_array + num_cols_offd_C*my_thread_num; + if (num_coarse) { S_marker = S_marker_array + num_coarse * my_thread_num; } + if (num_cols_offd_C) { S_marker_offd = S_marker_offd_array + num_cols_offd_C * my_thread_num; } for (i1 = 0; i1 < num_coarse; i1++) { S_marker[i1] = -1; @@ -2363,7 +2448,7 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, C_offd_i[ic] = num_nonzeros_offd; } - for (jj1 = S_diag_i[i1]; jj1 < S_diag_i[i1+1]; jj1++) + for (jj1 = S_diag_i[i1]; jj1 < S_diag_i[i1 + 1]; jj1++) { i2 = S_diag_j[jj1]; if (CF_marker[i2] > 0) @@ -2375,7 +2460,7 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, num_nonzeros_diag++; } } - for (jj2 = S_diag_i[i2]; jj2 < S_diag_i[i2+1]; jj2++) + for (jj2 = S_diag_i[i2]; jj2 < S_diag_i[i2 + 1]; jj2++) { i3 = S_diag_j[jj2]; if (CF_marker[i3] > 0) @@ -2388,7 +2473,7 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, } } } - for (jj2 = S_offd_i[i2]; jj2 < S_offd_i[i2+1]; jj2++) + for (jj2 = S_offd_i[i2]; jj2 < S_offd_i[i2 + 1]; jj2++) { i3 = S_offd_j[jj2]; if (CF_marker_offd[i3] > 0) @@ -2402,7 +2487,7 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, } } } - for (jj1 = S_offd_i[i1]; jj1 < S_offd_i[i1+1]; jj1++) + for (jj1 = S_offd_i[i1]; jj1 < S_offd_i[i1 + 1]; jj1++) { i2 = S_offd_j[jj1]; if (CF_marker_offd[i2] > 0) @@ -2414,7 +2499,7 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, num_nonzeros_offd++; } } - for (jj2 = S_ext_diag_i[i2]; jj2 < S_ext_diag_i[i2+1]; jj2++) + for (jj2 = S_ext_diag_i[i2]; jj2 < S_ext_diag_i[i2 + 1]; jj2++) { i3 = S_ext_diag_j[jj2]; if (i3 != ic && S_marker[i3] < jj_row_begin_diag) @@ -2423,7 +2508,7 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, num_nonzeros_diag++; } } - for (jj2 = S_ext_offd_i[i2]; jj2 < S_ext_offd_i[i2+1]; jj2++) + for (jj2 = S_ext_offd_i[i2]; jj2 < S_ext_offd_i[i2 + 1]; jj2++) { i3 = S_ext_offd_j[jj2]; if (S_marker_offd[i3] < jj_row_begin_offd) @@ -2455,7 +2540,7 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, C_offd_i[ic] = num_nonzeros_offd; } - for (jj1 = S_diag_i[i1]; jj1 < S_diag_i[i1+1]; jj1++) + for (jj1 = S_diag_i[i1]; jj1 < S_diag_i[i1 + 1]; jj1++) { i2 = S_diag_j[jj1]; if (CF_marker[i2] > 0) @@ -2472,7 +2557,7 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, C_temp_diag_data[S_marker[index] - jj_row_begin_diag] += 2; } } - for (jj2 = S_diag_i[i2]; jj2 < S_diag_i[i2+1]; jj2++) + for (jj2 = S_diag_i[i2]; jj2 < S_diag_i[i2 + 1]; jj2++) { i3 = S_diag_j[jj2]; if (CF_marker[i3] > 0 && fine_to_coarse[i3] != ic) @@ -2490,7 +2575,7 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, } } } - for (jj2 = S_offd_i[i2]; jj2 < S_offd_i[i2+1]; jj2++) + for (jj2 = S_offd_i[i2]; jj2 < S_offd_i[i2 + 1]; jj2++) { i3 = S_offd_j[jj2]; if (CF_marker_offd[i3] > 0) @@ -2509,7 +2594,7 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, } } } - for (jj1 = S_offd_i[i1]; jj1 < S_offd_i[i1+1]; jj1++) + for (jj1 = S_offd_i[i1]; jj1 < S_offd_i[i1 + 1]; jj1++) { i2 = S_offd_j[jj1]; if (CF_marker_offd[i2] > 0) @@ -2526,7 +2611,7 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, C_temp_offd_data[S_marker_offd[index] - jj_row_begin_offd] += 2; } } - for (jj2 = S_ext_diag_i[i2]; jj2 < S_ext_diag_i[i2+1]; jj2++) + for (jj2 = S_ext_diag_i[i2]; jj2 < S_ext_diag_i[i2 + 1]; jj2++) { i3 = S_ext_diag_j[jj2]; if (i3 != ic) @@ -2543,7 +2628,7 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, } } } - for (jj2 = S_ext_offd_i[i2]; jj2 < S_ext_offd_i[i2+1]; jj2++) + for (jj2 = S_ext_offd_i[i2]; jj2 < S_ext_offd_i[i2 + 1]; jj2++) { i3 = S_ext_offd_j[jj2]; if (S_marker_offd[i3] < jj_row_begin_offd) @@ -2579,9 +2664,9 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, } /* num_paths > 1 */ hypre_prefix_sum_pair( - &num_nonzeros_diag, &C_diag_i[num_coarse], - &num_nonzeros_offd, &C_offd_i[num_coarse], - prefix_sum_workspace); + &num_nonzeros_diag, &C_diag_i[num_coarse], + &num_nonzeros_offd, &C_offd_i[num_coarse], + prefix_sum_workspace); for (i1 = 0; i1 < num_coarse; i1++) { @@ -2593,8 +2678,8 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier -#pragma omp master + #pragma omp barrier + #pragma omp master #endif { if (C_diag_i[num_coarse]) @@ -2607,13 +2692,15 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, } } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif for (ic = ic_begin; ic < ic_end - 1; ic++) { - if (C_diag_i[ic+1] == C_diag_i[ic] && C_offd_i[ic+1] == C_offd_i[ic]) + if (C_diag_i[ic + 1] == C_diag_i[ic] && C_offd_i[ic + 1] == C_offd_i[ic]) + { CF_marker[coarse_to_fine[ic]] = 2; + } C_diag_i[ic] += num_nonzeros_diag; C_offd_i[ic] += num_nonzeros_offd; @@ -2623,11 +2710,13 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, C_diag_i[ic] += num_nonzeros_diag; C_offd_i[ic] += num_nonzeros_offd; - HYPRE_Int next_C_diag_i = prefix_sum_workspace[2*(my_thread_num + 1)]; - HYPRE_Int next_C_offd_i = prefix_sum_workspace[2*(my_thread_num + 1) + 1]; + HYPRE_Int next_C_diag_i = prefix_sum_workspace[2 * (my_thread_num + 1)]; + HYPRE_Int next_C_offd_i = prefix_sum_workspace[2 * (my_thread_num + 1) + 1]; if (next_C_diag_i == C_diag_i[ic] && next_C_offd_i == C_offd_i[ic]) + { CF_marker[coarse_to_fine[ic]] = 2; + } } if (num_paths == 1) @@ -2643,7 +2732,7 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, HYPRE_Int jj_row_begin_diag = num_nonzeros_diag; HYPRE_Int jj_row_begin_offd = num_nonzeros_offd; - for (jj1 = S_diag_i[i1]; jj1 < S_diag_i[i1+1]; jj1++) + for (jj1 = S_diag_i[i1]; jj1 < S_diag_i[i1 + 1]; jj1++) { i2 = S_diag_j[jj1]; if (CF_marker[i2] > 0) @@ -2656,7 +2745,7 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, num_nonzeros_diag++; } } - for (jj2 = S_diag_i[i2]; jj2 < S_diag_i[i2+1]; jj2++) + for (jj2 = S_diag_i[i2]; jj2 < S_diag_i[i2 + 1]; jj2++) { i3 = S_diag_j[jj2]; if (CF_marker[i3] > 0) @@ -2670,7 +2759,7 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, } } } - for (jj2 = S_offd_i[i2]; jj2 < S_offd_i[i2+1]; jj2++) + for (jj2 = S_offd_i[i2]; jj2 < S_offd_i[i2 + 1]; jj2++) { i3 = S_offd_j[jj2]; if (CF_marker_offd[i3] > 0) @@ -2685,7 +2774,7 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, } } } - for (jj1 = S_offd_i[i1]; jj1 < S_offd_i[i1+1]; jj1++) + for (jj1 = S_offd_i[i1]; jj1 < S_offd_i[i1 + 1]; jj1++) { i2 = S_offd_j[jj1]; if (CF_marker_offd[i2] > 0) @@ -2698,7 +2787,7 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, num_nonzeros_offd++; } } - for (jj2 = S_ext_diag_i[i2]; jj2 < S_ext_diag_i[i2+1]; jj2++) + for (jj2 = S_ext_diag_i[i2]; jj2 < S_ext_diag_i[i2 + 1]; jj2++) { i3 = S_ext_diag_j[jj2]; if (i3 != ic && S_marker[i3] < jj_row_begin_diag) @@ -2708,7 +2797,7 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, num_nonzeros_diag++; } } - for (jj2 = S_ext_offd_i[i2]; jj2 < S_ext_offd_i[i2+1]; jj2++) + for (jj2 = S_ext_offd_i[i2]; jj2 < S_ext_offd_i[i2 + 1]; jj2++) { i3 = S_ext_offd_j[jj2]; if (S_marker_offd[i3] < jj_row_begin_offd) @@ -2738,7 +2827,7 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, HYPRE_Int jj_row_begin_diag = jj_count_diag; HYPRE_Int jj_row_begin_offd = jj_count_offd; - for (jj1 = S_diag_i[i1]; jj1 < S_diag_i[i1+1]; jj1++) + for (jj1 = S_diag_i[i1]; jj1 < S_diag_i[i1 + 1]; jj1++) { i2 = S_diag_j[jj1]; if (CF_marker[i2] > 0) @@ -2756,7 +2845,7 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, C_temp_diag_data[S_marker[index] - jj_row_begin_diag] += 2; } } - for (jj2 = S_diag_i[i2]; jj2 < S_diag_i[i2+1]; jj2++) + for (jj2 = S_diag_i[i2]; jj2 < S_diag_i[i2 + 1]; jj2++) { i3 = S_diag_j[jj2]; if (CF_marker[i3] > 0 && fine_to_coarse[i3] != ic) @@ -2775,7 +2864,7 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, } } } - for (jj2 = S_offd_i[i2]; jj2 < S_offd_i[i2+1]; jj2++) + for (jj2 = S_offd_i[i2]; jj2 < S_offd_i[i2 + 1]; jj2++) { i3 = S_offd_j[jj2]; if (CF_marker_offd[i3] > 0) @@ -2795,7 +2884,7 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, } } } - for (jj1 = S_offd_i[i1]; jj1 < S_offd_i[i1+1]; jj1++) + for (jj1 = S_offd_i[i1]; jj1 < S_offd_i[i1 + 1]; jj1++) { i2 = S_offd_j[jj1]; if (CF_marker_offd[i2] > 0) @@ -2813,7 +2902,7 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, C_temp_offd_data[S_marker_offd[index] - jj_row_begin_offd] += 2; } } - for (jj2 = S_ext_diag_i[i2]; jj2 < S_ext_diag_i[i2+1]; jj2++) + for (jj2 = S_ext_diag_i[i2]; jj2 < S_ext_diag_i[i2 + 1]; jj2++) { i3 = S_ext_diag_j[jj2]; if (i3 != ic) @@ -2831,7 +2920,7 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, } } } - for (jj2 = S_ext_offd_i[i2]; jj2 < S_ext_offd_i[i2+1]; jj2++) + for (jj2 = S_ext_offd_i[i2]; jj2 < S_ext_offd_i[i2 + 1]; jj2++) { i3 = S_ext_offd_j[jj2]; if (S_marker_offd[i3] < jj_row_begin_offd) @@ -2869,12 +2958,12 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, } /* omp parallel */ S2 = hypre_ParCSRMatrixCreate(comm, global_num_coarse, - global_num_coarse, coarse_row_starts, - coarse_row_starts, num_cols_offd_C, C_diag_i[num_coarse], C_offd_i[num_coarse]); + global_num_coarse, coarse_row_starts, + coarse_row_starts, num_cols_offd_C, C_diag_i[num_coarse], C_offd_i[num_coarse]); C_diag = hypre_ParCSRMatrixDiag(S2); hypre_CSRMatrixI(C_diag) = C_diag_i; - if (C_diag_i[num_coarse]) hypre_CSRMatrixJ(C_diag) = C_diag_j; + if (C_diag_i[num_coarse]) { hypre_CSRMatrixJ(C_diag) = C_diag_j; } C_offd = hypre_ParCSRMatrixOffd(S2); hypre_CSRMatrixI(C_offd) = C_offd_i; @@ -2882,7 +2971,7 @@ hypre_BoomerAMGCreate2ndSHost( hypre_ParCSRMatrix *S, if (num_cols_offd_C) { - if (C_offd_i[num_coarse]) hypre_CSRMatrixJ(C_offd) = C_offd_j; + if (C_offd_i[num_coarse]) { hypre_CSRMatrixJ(C_offd) = C_offd_j; } hypre_ParCSRMatrixColMapOffd(S2) = col_map_offd_C; } @@ -2942,13 +3031,11 @@ hypre_BoomerAMGCreate2ndS( hypre_ParCSRMatrix *S, HYPRE_BigInt *coarse_row_starts, hypre_ParCSRMatrix **C_ptr) { -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_GpuProfilingPushRange("Create2ndS"); -#endif HYPRE_Int ierr = 0; -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(S) ); if (exec == HYPRE_EXEC_DEVICE) @@ -2961,9 +3048,7 @@ hypre_BoomerAMGCreate2ndS( hypre_ParCSRMatrix *S, ierr = hypre_BoomerAMGCreate2ndSHost( S, CF_marker, num_paths, coarse_row_starts, C_ptr ); } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_GpuProfilingPopRange(); -#endif return ierr; } @@ -2978,12 +3063,19 @@ hypre_BoomerAMGCorrectCFMarkerHost(hypre_IntArray *CF_marker, hypre_IntArray *ne HYPRE_Int i, cnt; cnt = 0; - for (i=0; i < hypre_IntArraySize(CF_marker); i++) + for (i = 0; i < hypre_IntArraySize(CF_marker); i++) { if (hypre_IntArrayData(CF_marker)[i] > 0 ) { - if (hypre_IntArrayData(CF_marker)[i] == 1) hypre_IntArrayData(CF_marker)[i] = hypre_IntArrayData(new_CF_marker)[cnt++]; - else { hypre_IntArrayData(CF_marker)[i] = 1; cnt++;} + if (hypre_IntArrayData(CF_marker)[i] == 1) + { + hypre_IntArrayData(CF_marker)[i] = hypre_IntArrayData(new_CF_marker)[cnt++]; + } + else + { + hypre_IntArrayData(CF_marker)[i] = 1; + cnt++; + } } } @@ -2999,12 +3091,18 @@ hypre_BoomerAMGCorrectCFMarker2Host(hypre_IntArray *CF_marker, hypre_IntArray *n HYPRE_Int i, cnt; cnt = 0; - for (i=0; i < hypre_IntArraySize(CF_marker); i++) + for (i = 0; i < hypre_IntArraySize(CF_marker); i++) { if (hypre_IntArrayData(CF_marker)[i] > 0 ) { - if (hypre_IntArrayData(new_CF_marker)[cnt] == -1) hypre_IntArrayData(CF_marker)[i] = -2; - else hypre_IntArrayData(CF_marker)[i] = 1; + if (hypre_IntArrayData(new_CF_marker)[cnt] == -1) + { + hypre_IntArrayData(CF_marker)[i] = -2; + } + else + { + hypre_IntArrayData(CF_marker)[i] = 1; + } cnt++; } } @@ -3019,11 +3117,9 @@ HYPRE_Int hypre_BoomerAMGCorrectCFMarker(hypre_IntArray *CF_marker, hypre_IntArray *new_CF_marker) { -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_GpuProfilingPushRange("CorrectCFMarker"); -#endif -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy2( hypre_IntArrayMemoryLocation(CF_marker), hypre_IntArrayMemoryLocation(new_CF_marker)); @@ -3037,9 +3133,7 @@ hypre_BoomerAMGCorrectCFMarker(hypre_IntArray *CF_marker, hypre_IntArray *new_CF hypre_BoomerAMGCorrectCFMarkerHost(CF_marker, new_CF_marker); } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_GpuProfilingPopRange(); -#endif return hypre_error_flag; } @@ -3051,11 +3145,9 @@ HYPRE_Int hypre_BoomerAMGCorrectCFMarker2(hypre_IntArray *CF_marker, hypre_IntArray *new_CF_marker) { -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_GpuProfilingPushRange("CorrectCFMarker2"); -#endif -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy2( hypre_IntArrayMemoryLocation(CF_marker), hypre_IntArrayMemoryLocation(new_CF_marker)); @@ -3069,9 +3161,7 @@ hypre_BoomerAMGCorrectCFMarker2(hypre_IntArray *CF_marker, hypre_IntArray *new_C hypre_BoomerAMGCorrectCFMarker2Host(CF_marker, new_CF_marker); } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_GpuProfilingPopRange(); -#endif return hypre_error_flag; } diff --git a/external/hypre/src/parcsr_ls/par_strength2nd_device.c b/external/hypre/src/parcsr_ls/par_strength2nd_device.c index 87f28e30..d2db35d4 100644 --- a/external/hypre/src/parcsr_ls/par_strength2nd_device.c +++ b/external/hypre/src/parcsr_ls/par_strength2nd_device.c @@ -1,10 +1,11 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ +#include "_hypre_onedpl.hpp" #include "HYPRE.h" #include "HYPRE_parcsr_mv.h" #include "HYPRE_IJ_mv.h" @@ -16,12 +17,12 @@ #include "_hypre_parcsr_mv.h" #include "HYPRE_utilities.h" -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) //----------------------------------------------------------------------- HYPRE_Int hypre_BoomerAMGCreate2ndSDevice( hypre_ParCSRMatrix *S, - HYPRE_Int *CF_marker_host, + HYPRE_Int *CF_marker, HYPRE_Int num_paths, HYPRE_BigInt *coarse_row_starts, hypre_ParCSRMatrix **S2_ptr) @@ -31,10 +32,9 @@ hypre_BoomerAMGCreate2ndSDevice( hypre_ParCSRMatrix *S, hypre_CSRMatrix *S_offd = hypre_ParCSRMatrixOffd(S); HYPRE_Int S_diag_nnz = hypre_CSRMatrixNumNonzeros(S_diag); HYPRE_Int S_offd_nnz = hypre_CSRMatrixNumNonzeros(S_offd); - hypre_ParCSRMatrix *SI = hypre_CTAlloc(hypre_ParCSRMatrix, 1, HYPRE_MEMORY_HOST); hypre_CSRMatrix *Id, *SI_diag; hypre_ParCSRMatrix *S_XC, *S_CX, *S2; - HYPRE_Int *CF_marker, *new_end; + HYPRE_Int *new_end; HYPRE_Complex coeff = 2.0; /* @@ -44,29 +44,27 @@ hypre_BoomerAMGCreate2ndSDevice( hypre_ParCSRMatrix *S, hypre_MPI_Comm_rank(comm, &myid); */ - CF_marker = hypre_TAlloc(HYPRE_Int, S_nr_local, HYPRE_MEMORY_DEVICE); - hypre_TMemcpy(CF_marker, CF_marker_host, HYPRE_Int, S_nr_local, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - /* 1. Create new matrix with added diagonal */ hypre_GpuProfilingPushRange("Setup"); /* give S data arrays */ hypre_CSRMatrixData(S_diag) = hypre_TAlloc(HYPRE_Complex, S_diag_nnz, HYPRE_MEMORY_DEVICE ); - HYPRE_THRUST_CALL( fill, - hypre_CSRMatrixData(S_diag), - hypre_CSRMatrixData(S_diag) + S_diag_nnz, - 1.0 ); + hypreDevice_ComplexFilln( hypre_CSRMatrixData(S_diag), + S_diag_nnz, + 1.0 ); hypre_CSRMatrixData(S_offd) = hypre_TAlloc(HYPRE_Complex, S_offd_nnz, HYPRE_MEMORY_DEVICE ); - HYPRE_THRUST_CALL( fill, - hypre_CSRMatrixData(S_offd), - hypre_CSRMatrixData(S_offd) + S_offd_nnz, - 1.0 ); + hypreDevice_ComplexFilln( hypre_CSRMatrixData(S_offd), + S_offd_nnz, + 1.0 ); - hypre_MatvecCommPkgCreate(S); + if (!hypre_ParCSRMatrixCommPkg(S)) + { + hypre_MatvecCommPkgCreate(S); + } /* S(C, :) and S(:, C) */ - hypre_ParCSRMatrixGenerate1DCFDevice(S, CF_marker_host, coarse_row_starts, NULL, &S_CX, &S_XC); + hypre_ParCSRMatrixGenerate1DCFDevice(S, CF_marker, coarse_row_starts, NULL, &S_CX, &S_XC); hypre_assert(S_nr_local == hypre_ParCSRMatrixNumCols(S_CX)); @@ -77,6 +75,18 @@ hypre_BoomerAMGCreate2ndSDevice( hypre_ParCSRMatrix *S, hypre_CSRMatrixInitialize_v2(Id, 0, HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_SYCL) + hypreSycl_sequence( hypre_CSRMatrixI(Id), + hypre_CSRMatrixI(Id) + hypre_ParCSRMatrixNumRows(S_CX) + 1, + 0 ); + + oneapi::dpl::counting_iterator count(0); + new_end = hypreSycl_copy_if( count, + count + hypre_ParCSRMatrixNumCols(S_CX), + CF_marker, + hypre_CSRMatrixJ(Id), + is_nonnegative() ); +#else HYPRE_THRUST_CALL( sequence, hypre_CSRMatrixI(Id), hypre_CSRMatrixI(Id) + hypre_ParCSRMatrixNumRows(S_CX) + 1, @@ -88,15 +98,13 @@ hypre_BoomerAMGCreate2ndSDevice( hypre_ParCSRMatrix *S, CF_marker, hypre_CSRMatrixJ(Id), is_nonnegative() ); +#endif hypre_assert(new_end - hypre_CSRMatrixJ(Id) == hypre_ParCSRMatrixNumRows(S_CX)); - hypre_TFree(CF_marker, HYPRE_MEMORY_DEVICE); - - HYPRE_THRUST_CALL( fill, - hypre_CSRMatrixData(Id), - hypre_CSRMatrixData(Id) + hypre_ParCSRMatrixNumRows(S_CX), - coeff ); + hypreDevice_ComplexFilln( hypre_CSRMatrixData(Id), + hypre_ParCSRMatrixNumRows(S_CX), + coeff ); SI_diag = hypre_CSRMatrixAddDevice(1.0, hypre_ParCSRMatrixDiag(S_CX), 1.0, Id); @@ -144,4 +152,4 @@ hypre_BoomerAMGCreate2ndSDevice( hypre_ParCSRMatrix *S, return 0; } -#endif /* #if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) */ +#endif /* #if defined(HYPRE_USING_GPU) */ diff --git a/external/hypre/src/parcsr_ls/par_strength_device.c b/external/hypre/src/parcsr_ls/par_strength_device.c index 196ebd00..7bc351bb 100644 --- a/external/hypre/src/parcsr_ls/par_strength_device.c +++ b/external/hypre/src/parcsr_ls/par_strength_device.c @@ -1,23 +1,26 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ +#include "_hypre_onedpl.hpp" #include "_hypre_parcsr_ls.h" #include "_hypre_utilities.hpp" -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) -__global__ void hypre_BoomerAMGCreateS_rowcount( HYPRE_Int nr_of_rows, +__global__ void hypre_BoomerAMGCreateS_rowcount( hypre_DeviceItem &item, + HYPRE_Int nr_of_rows, HYPRE_Real max_row_sum, HYPRE_Real strength_threshold, HYPRE_Real* A_diag_data, HYPRE_Int* A_diag_i, HYPRE_Int* A_diag_j, HYPRE_Real* A_offd_data, HYPRE_Int* A_offd_i, HYPRE_Int* A_offd_j, HYPRE_Int* S_temp_diag_j, HYPRE_Int* S_temp_offd_j, HYPRE_Int num_functions, HYPRE_Int* dof_func, HYPRE_Int* dof_func_offd, HYPRE_Int* jS_diag, HYPRE_Int* jS_offd ); -__global__ void hypre_BoomerAMGCreateSabs_rowcount( HYPRE_Int nr_of_rows, +__global__ void hypre_BoomerAMGCreateSabs_rowcount( hypre_DeviceItem &item, + HYPRE_Int nr_of_rows, HYPRE_Real max_row_sum, HYPRE_Real strength_threshold, HYPRE_Real* A_diag_data, HYPRE_Int* A_diag_i, HYPRE_Int* A_diag_j, HYPRE_Real* A_offd_data, HYPRE_Int* A_offd_i, HYPRE_Int* A_offd_j, @@ -53,7 +56,7 @@ hypre_BoomerAMGCreateSDevice(hypre_ParCSRMatrix *A, HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); HYPRE_BigInt *row_starts = hypre_ParCSRMatrixRowStarts(A); HYPRE_Int num_variables = hypre_CSRMatrixNumRows(A_diag); - HYPRE_Int global_num_vars = hypre_ParCSRMatrixGlobalNumRows(A); + HYPRE_BigInt global_num_vars = hypre_ParCSRMatrixGlobalNumRows(A); HYPRE_Int num_nonzeros_diag; HYPRE_Int num_nonzeros_offd; HYPRE_Int num_cols_offd = hypre_CSRMatrixNumCols(A_offd); @@ -93,8 +96,8 @@ hypre_BoomerAMGCreateSDevice(hypre_ParCSRMatrix *A, num_nonzeros_diag = hypre_CSRMatrixNumNonzeros(A_diag); num_nonzeros_offd = hypre_CSRMatrixNumNonzeros(A_offd); - S_diag_i = hypre_TAlloc(HYPRE_Int, num_variables+1, memory_location); - S_offd_i = hypre_TAlloc(HYPRE_Int, num_variables+1, memory_location); + S_diag_i = hypre_TAlloc(HYPRE_Int, num_variables + 1, memory_location); + S_offd_i = hypre_TAlloc(HYPRE_Int, num_variables + 1, memory_location); S_temp_diag_j = hypre_TAlloc(HYPRE_Int, num_nonzeros_diag, HYPRE_MEMORY_DEVICE); S_temp_offd_j = hypre_TAlloc(HYPRE_Int, num_nonzeros_offd, HYPRE_MEMORY_DEVICE); @@ -103,9 +106,9 @@ hypre_BoomerAMGCreateSDevice(hypre_ParCSRMatrix *A, dof_func_offd_dev = hypre_TAlloc(HYPRE_Int, num_cols_offd, HYPRE_MEMORY_DEVICE); } - /*------------------------------------------------------------------- - * Get the dof_func data for the off-processor columns - *-------------------------------------------------------------------*/ + /*------------------------------------------------------------------- + * Get the dof_func data for the off-processor columns + *-------------------------------------------------------------------*/ if (!comm_pkg) { hypre_MatvecCommPkgCreate(A); @@ -116,15 +119,32 @@ hypre_BoomerAMGCreateSDevice(hypre_ParCSRMatrix *A, if (num_functions > 1) { - HYPRE_Int *int_buf_data = hypre_TAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), HYPRE_MEMORY_DEVICE); + HYPRE_Int *int_buf_data = hypre_TAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, + num_sends), HYPRE_MEMORY_DEVICE); hypre_ParCSRCommPkgCopySendMapElmtsToDevice(comm_pkg); +#if defined(HYPRE_USING_SYCL) + hypreSycl_gather( hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + + hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + dof_func, + int_buf_data ); +#else HYPRE_THRUST_CALL( gather, hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), dof_func, int_buf_data ); +#endif + +#if defined(HYPRE_USING_THRUST_NOSYNC) + /* RL: make sure int_buf_data is ready before issuing GPU-GPU MPI */ + if (hypre_GetGpuAwareMPI()) + { + hypre_ForceSyncComputeStream(); + } +#endif comm_handle = hypre_ParCSRCommHandleCreate_v2(11, comm_pkg, HYPRE_MEMORY_DEVICE, int_buf_data, HYPRE_MEMORY_DEVICE, dof_func_offd_dev); @@ -134,46 +154,63 @@ hypre_BoomerAMGCreateSDevice(hypre_ParCSRMatrix *A, } /* count the row nnz of S */ - dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(num_variables, "warp", bDim); + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(num_variables, "warp", bDim); if (abs_soc) { - HYPRE_CUDA_LAUNCH( hypre_BoomerAMGCreateSabs_rowcount, gDim, bDim, - num_variables, max_row_sum, strength_threshold, - A_diag_data, A_diag_i, A_diag_j, - A_offd_data, A_offd_i, A_offd_j, - S_temp_diag_j, S_temp_offd_j, - num_functions, dof_func, dof_func_offd_dev, - S_diag_i, S_offd_i ); + HYPRE_GPU_LAUNCH( hypre_BoomerAMGCreateSabs_rowcount, gDim, bDim, + num_variables, max_row_sum, strength_threshold, + A_diag_data, A_diag_i, A_diag_j, + A_offd_data, A_offd_i, A_offd_j, + S_temp_diag_j, S_temp_offd_j, + num_functions, dof_func, dof_func_offd_dev, + S_diag_i, S_offd_i ); } else { - HYPRE_CUDA_LAUNCH( hypre_BoomerAMGCreateS_rowcount, gDim, bDim, - num_variables, max_row_sum, strength_threshold, - A_diag_data, A_diag_i, A_diag_j, - A_offd_data, A_offd_i, A_offd_j, - S_temp_diag_j, S_temp_offd_j, - num_functions, dof_func, dof_func_offd_dev, - S_diag_i, S_offd_i ); + HYPRE_GPU_LAUNCH( hypre_BoomerAMGCreateS_rowcount, gDim, bDim, + num_variables, max_row_sum, strength_threshold, + A_diag_data, A_diag_i, A_diag_j, + A_offd_data, A_offd_i, A_offd_j, + S_temp_diag_j, S_temp_offd_j, + num_functions, dof_func, dof_func_offd_dev, + S_diag_i, S_offd_i ); } + hypre_Memset(S_diag_i + num_variables, 0, sizeof(HYPRE_Int), HYPRE_MEMORY_DEVICE); + hypre_Memset(S_offd_i + num_variables, 0, sizeof(HYPRE_Int), HYPRE_MEMORY_DEVICE); + hypreDevice_IntegerExclusiveScan(num_variables + 1, S_diag_i); hypreDevice_IntegerExclusiveScan(num_variables + 1, S_offd_i); HYPRE_Int *tmp, S_num_nonzeros_diag, S_num_nonzeros_offd; - hypre_TMemcpy(&S_num_nonzeros_diag, &S_diag_i[num_variables], HYPRE_Int, 1, HYPRE_MEMORY_HOST, memory_location); - hypre_TMemcpy(&S_num_nonzeros_offd, &S_offd_i[num_variables], HYPRE_Int, 1, HYPRE_MEMORY_HOST, memory_location); + hypre_TMemcpy(&S_num_nonzeros_diag, &S_diag_i[num_variables], HYPRE_Int, 1, HYPRE_MEMORY_HOST, + memory_location); + hypre_TMemcpy(&S_num_nonzeros_offd, &S_offd_i[num_variables], HYPRE_Int, 1, HYPRE_MEMORY_HOST, + memory_location); S_diag_j = hypre_TAlloc(HYPRE_Int, S_num_nonzeros_diag, memory_location); S_offd_j = hypre_TAlloc(HYPRE_Int, S_num_nonzeros_offd, memory_location); - tmp = HYPRE_THRUST_CALL(copy_if, S_temp_diag_j, S_temp_diag_j + num_nonzeros_diag, S_diag_j, is_nonnegative()); +#if defined(HYPRE_USING_SYCL) + tmp = HYPRE_ONEDPL_CALL(std::copy_if, S_temp_diag_j, S_temp_diag_j + num_nonzeros_diag, S_diag_j, + is_nonnegative()); +#else + tmp = HYPRE_THRUST_CALL(copy_if, S_temp_diag_j, S_temp_diag_j + num_nonzeros_diag, S_diag_j, + is_nonnegative()); +#endif hypre_assert(S_num_nonzeros_diag == tmp - S_diag_j); - tmp = HYPRE_THRUST_CALL(copy_if, S_temp_offd_j, S_temp_offd_j + num_nonzeros_offd, S_offd_j, is_nonnegative()); +#if defined(HYPRE_USING_SYCL) + tmp = HYPRE_ONEDPL_CALL(std::copy_if, S_temp_offd_j, S_temp_offd_j + num_nonzeros_offd, S_offd_j, + is_nonnegative()); +#else + tmp = HYPRE_THRUST_CALL(copy_if, S_temp_offd_j, S_temp_offd_j + num_nonzeros_offd, S_offd_j, + is_nonnegative()); +#endif hypre_assert(S_num_nonzeros_offd == tmp - S_offd_j); @@ -217,22 +254,23 @@ hypre_BoomerAMGCreateSDevice(hypre_ParCSRMatrix *A, } /*-----------------------------------------------------------------------*/ - __global__ void hypre_BoomerAMGCreateS_rowcount( HYPRE_Int nr_of_rows, - HYPRE_Real max_row_sum, - HYPRE_Real strength_threshold, - HYPRE_Real *A_diag_data, - HYPRE_Int *A_diag_i, - HYPRE_Int *A_diag_j, - HYPRE_Real *A_offd_data, - HYPRE_Int *A_offd_i, - HYPRE_Int *A_offd_j, - HYPRE_Int *S_temp_diag_j, - HYPRE_Int *S_temp_offd_j, - HYPRE_Int num_functions, - HYPRE_Int *dof_func, - HYPRE_Int *dof_func_offd, - HYPRE_Int *jS_diag, - HYPRE_Int *jS_offd ) +__global__ void hypre_BoomerAMGCreateS_rowcount( hypre_DeviceItem &item, + HYPRE_Int nr_of_rows, + HYPRE_Real max_row_sum, + HYPRE_Real strength_threshold, + HYPRE_Real *A_diag_data, + HYPRE_Int *A_diag_i, + HYPRE_Int *A_diag_j, + HYPRE_Real *A_offd_data, + HYPRE_Int *A_offd_i, + HYPRE_Int *A_offd_j, + HYPRE_Int *S_temp_diag_j, + HYPRE_Int *S_temp_offd_j, + HYPRE_Int num_functions, + HYPRE_Int *dof_func, + HYPRE_Int *dof_func_offd, + HYPRE_Int *jS_diag, + HYPRE_Int *jS_offd ) { /*-----------------------------------------------------------------------*/ /* @@ -255,45 +293,42 @@ hypre_BoomerAMGCreateSDevice(hypre_ParCSRMatrix *A, HYPRE_Real row_scale = 0.0, row_sum = 0.0, row_max = 0.0, row_min = 0.0, diag = 0.0; HYPRE_Int row_nnz_diag = 0, row_nnz_offd = 0, diag_pos = -1; - HYPRE_Int row = hypre_cuda_get_grid_warp_id<1,1>(); + HYPRE_Int row = hypre_gpu_get_grid_warp_id<1, 1>(item); if (row >= nr_of_rows) { return; } - HYPRE_Int lane = hypre_cuda_get_lane_id<1>(); - HYPRE_Int p_diag, q_diag, p_offd, q_offd; + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); + HYPRE_Int p_diag = 0, q_diag, p_offd = 0, q_offd; /* diag part */ if (lane < 2) { p_diag = read_only_load(A_diag_i + row + lane); } - q_diag = __shfl_sync(HYPRE_WARP_FULL_MASK, p_diag, 1); - p_diag = __shfl_sync(HYPRE_WARP_FULL_MASK, p_diag, 0); + q_diag = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_diag, 1); + p_diag = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_diag, 0); - for (HYPRE_Int i = p_diag + lane; __any_sync(HYPRE_WARP_FULL_MASK, i < q_diag); i += HYPRE_WARP_SIZE) + for (HYPRE_Int i = p_diag + lane; i < q_diag; i += HYPRE_WARP_SIZE) { - if (i < q_diag) - { - const HYPRE_Int col = read_only_load(&A_diag_j[i]); + const HYPRE_Int col = read_only_load(&A_diag_j[i]); - if ( num_functions == 1 || row == col || - read_only_load(&dof_func[row]) == read_only_load(&dof_func[col]) ) + if ( num_functions == 1 || row == col || + read_only_load(&dof_func[row]) == read_only_load(&dof_func[col]) ) + { + const HYPRE_Real v = read_only_load(&A_diag_data[i]); + row_sum += v; + if (row == col) + { + diag = v; + diag_pos = i; + } + else { - const HYPRE_Real v = read_only_load(&A_diag_data[i]); - row_sum += v; - if (row == col) - { - diag = v; - diag_pos = i; - } - else - { - row_max = hypre_max(row_max, v); - row_min = hypre_min(row_min, v); - } + row_max = hypre_max(row_max, v); + row_min = hypre_min(row_min, v); } } } @@ -303,56 +338,50 @@ hypre_BoomerAMGCreateSDevice(hypre_ParCSRMatrix *A, { p_offd = read_only_load(A_offd_i + row + lane); } - q_offd = __shfl_sync(HYPRE_WARP_FULL_MASK, p_offd, 1); - p_offd = __shfl_sync(HYPRE_WARP_FULL_MASK, p_offd, 0); + q_offd = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_offd, 1); + p_offd = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_offd, 0); - for (HYPRE_Int i = p_offd + lane; __any_sync(HYPRE_WARP_FULL_MASK, i < q_offd); i += HYPRE_WARP_SIZE) + for (HYPRE_Int i = p_offd + lane; i < q_offd; i += HYPRE_WARP_SIZE) { - if (i < q_offd) + if ( num_functions == 1 || + read_only_load(&dof_func[row]) == read_only_load(&dof_func_offd[read_only_load(&A_offd_j[i])]) ) { - if ( num_functions == 1 || - read_only_load(&dof_func[row]) == read_only_load(&dof_func_offd[read_only_load(&A_offd_j[i])]) ) - { - const HYPRE_Real v = read_only_load(&A_offd_data[i]); - row_sum += v; - row_max = hypre_max(row_max, v); - row_min = hypre_min(row_min, v); - } + const HYPRE_Real v = read_only_load(&A_offd_data[i]); + row_sum += v; + row_max = hypre_max(row_max, v); + row_min = hypre_min(row_min, v); } } - diag = warp_allreduce_sum(diag); + diag = warp_allreduce_sum(item, diag); /* sign of diag */ const HYPRE_Int sdiag = diag > 0.0 ? 1 : -1; /* compute scaling factor and row sum */ - row_sum = warp_allreduce_sum(row_sum); + row_sum = warp_allreduce_sum(item, row_sum); if (diag > 0.0) { - row_scale = warp_allreduce_min(row_min); + row_scale = warp_allreduce_min(item, row_min); } else { - row_scale = warp_allreduce_max(row_max); + row_scale = warp_allreduce_max(item, row_max); } /* compute row of S */ - HYPRE_Int all_weak = max_row_sum < 1.0 && fabs(row_sum) > fabs(diag) * max_row_sum; + HYPRE_Int all_weak = max_row_sum < 1.0 && hypre_abs(row_sum) > hypre_abs(diag) * max_row_sum; const HYPRE_Real thresh = sdiag * strength_threshold * row_scale; - for (HYPRE_Int i = p_diag + lane; __any_sync(HYPRE_WARP_FULL_MASK, i < q_diag); i += HYPRE_WARP_SIZE) + for (HYPRE_Int i = p_diag + lane; i < q_diag; i += HYPRE_WARP_SIZE) { - if (i < q_diag) - { - const HYPRE_Int cond = all_weak == 0 && diag_pos != i && - ( num_functions == 1 || read_only_load(&dof_func[row]) == - read_only_load(&dof_func[read_only_load(&A_diag_j[i])]) ) && - sdiag * read_only_load(&A_diag_data[i]) < thresh; - S_temp_diag_j[i] = cond * (1 + read_only_load(&A_diag_j[i])) - 1; - row_nnz_diag += cond; - } + const HYPRE_Int cond = all_weak == 0 && diag_pos != i && + ( num_functions == 1 || read_only_load(&dof_func[row]) == + read_only_load(&dof_func[read_only_load(&A_diag_j[i])]) ) && + sdiag * read_only_load(&A_diag_data[i]) < thresh; + S_temp_diag_j[i] = cond * (1 + read_only_load(&A_diag_j[i])) - 1; + row_nnz_diag += cond; } /* !!! mark diagonal as -2 !!! */ @@ -361,21 +390,18 @@ hypre_BoomerAMGCreateSDevice(hypre_ParCSRMatrix *A, S_temp_diag_j[diag_pos] = -2; } - for (HYPRE_Int i = p_offd + lane; __any_sync(HYPRE_WARP_FULL_MASK, i < q_offd); i += HYPRE_WARP_SIZE) + for (HYPRE_Int i = p_offd + lane; i < q_offd; i += HYPRE_WARP_SIZE) { - if (i < q_offd) - { - const HYPRE_Int cond = all_weak == 0 && - ( num_functions == 1 || read_only_load(&dof_func[row]) == - read_only_load(&dof_func_offd[read_only_load(&A_offd_j[i])]) ) && - sdiag * read_only_load(&A_offd_data[i]) < thresh; - S_temp_offd_j[i] = cond * (1 + read_only_load(&A_offd_j[i])) - 1; - row_nnz_offd += cond; - } + const HYPRE_Int cond = all_weak == 0 && + ( num_functions == 1 || read_only_load(&dof_func[row]) == + read_only_load(&dof_func_offd[read_only_load(&A_offd_j[i])]) ) && + sdiag * read_only_load(&A_offd_data[i]) < thresh; + S_temp_offd_j[i] = cond * (1 + read_only_load(&A_offd_j[i])) - 1; + row_nnz_offd += cond; } - row_nnz_diag = warp_reduce_sum(row_nnz_diag); - row_nnz_offd = warp_reduce_sum(row_nnz_offd); + row_nnz_diag = warp_reduce_sum(item, row_nnz_diag); + row_nnz_offd = warp_reduce_sum(item, row_nnz_offd); if (0 == lane) { @@ -412,22 +438,23 @@ hypre_BoomerAMGMakeSocFromSDevice( hypre_ParCSRMatrix *A, } /*-----------------------------------------------------------------------*/ - __global__ void hypre_BoomerAMGCreateSabs_rowcount( HYPRE_Int nr_of_rows, - HYPRE_Real max_row_sum, - HYPRE_Real strength_threshold, - HYPRE_Real *A_diag_data, - HYPRE_Int *A_diag_i, - HYPRE_Int *A_diag_j, - HYPRE_Real *A_offd_data, - HYPRE_Int *A_offd_i, - HYPRE_Int *A_offd_j, - HYPRE_Int *S_temp_diag_j, - HYPRE_Int *S_temp_offd_j, - HYPRE_Int num_functions, - HYPRE_Int *dof_func, - HYPRE_Int *dof_func_offd, - HYPRE_Int *jS_diag, - HYPRE_Int *jS_offd ) +__global__ void hypre_BoomerAMGCreateSabs_rowcount( hypre_DeviceItem &item, + HYPRE_Int nr_of_rows, + HYPRE_Real max_row_sum, + HYPRE_Real strength_threshold, + HYPRE_Real *A_diag_data, + HYPRE_Int *A_diag_i, + HYPRE_Int *A_diag_j, + HYPRE_Real *A_offd_data, + HYPRE_Int *A_offd_i, + HYPRE_Int *A_offd_j, + HYPRE_Int *S_temp_diag_j, + HYPRE_Int *S_temp_offd_j, + HYPRE_Int num_functions, + HYPRE_Int *dof_func, + HYPRE_Int *dof_func_offd, + HYPRE_Int *jS_diag, + HYPRE_Int *jS_offd ) { /*-----------------------------------------------------------------------*/ /* @@ -450,44 +477,41 @@ hypre_BoomerAMGMakeSocFromSDevice( hypre_ParCSRMatrix *A, HYPRE_Real row_scale = 0.0, row_sum = 0.0, diag = 0.0; HYPRE_Int row_nnz_diag = 0, row_nnz_offd = 0, diag_pos = -1; - HYPRE_Int row = hypre_cuda_get_grid_warp_id<1,1>(); + HYPRE_Int row = hypre_gpu_get_grid_warp_id<1, 1>(item); if (row >= nr_of_rows) { return; } - HYPRE_Int lane = hypre_cuda_get_lane_id<1>(); - HYPRE_Int p_diag, q_diag, p_offd, q_offd; + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); + HYPRE_Int p_diag = 0, q_diag, p_offd = 0, q_offd; /* diag part */ if (lane < 2) { p_diag = read_only_load(A_diag_i + row + lane); } - q_diag = __shfl_sync(HYPRE_WARP_FULL_MASK, p_diag, 1); - p_diag = __shfl_sync(HYPRE_WARP_FULL_MASK, p_diag, 0); + q_diag = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_diag, 1); + p_diag = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_diag, 0); - for (HYPRE_Int i = p_diag + lane; __any_sync(HYPRE_WARP_FULL_MASK, i < q_diag); i += HYPRE_WARP_SIZE) + for (HYPRE_Int i = p_diag + lane; i < q_diag; i += HYPRE_WARP_SIZE) { - if (i < q_diag) - { - const HYPRE_Int col = read_only_load(&A_diag_j[i]); + const HYPRE_Int col = read_only_load(&A_diag_j[i]); - if ( num_functions == 1 || row == col || - read_only_load(&dof_func[row]) == read_only_load(&dof_func[col]) ) + if ( num_functions == 1 || row == col || + read_only_load(&dof_func[row]) == read_only_load(&dof_func[col]) ) + { + const HYPRE_Real v = hypre_cabs( read_only_load(&A_diag_data[i]) ); + row_sum += v; + if (row == col) { - const HYPRE_Real v = hypre_cabs( read_only_load(&A_diag_data[i]) ); - row_sum += v; - if (row == col) - { - diag = v; - diag_pos = i; - } - else - { - row_scale = hypre_max(row_scale, v); - } + diag = v; + diag_pos = i; + } + else + { + row_scale = hypre_max(row_scale, v); } } } @@ -497,44 +521,40 @@ hypre_BoomerAMGMakeSocFromSDevice( hypre_ParCSRMatrix *A, { p_offd = read_only_load(A_offd_i + row + lane); } - q_offd = __shfl_sync(HYPRE_WARP_FULL_MASK, p_offd, 1); - p_offd = __shfl_sync(HYPRE_WARP_FULL_MASK, p_offd, 0); + q_offd = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_offd, 1); + p_offd = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_offd, 0); - for (HYPRE_Int i = p_offd + lane; __any_sync(HYPRE_WARP_FULL_MASK, i < q_offd); i += HYPRE_WARP_SIZE) + for (HYPRE_Int i = p_offd + lane; i < q_offd; i += HYPRE_WARP_SIZE) { - if (i < q_offd) + if ( num_functions == 1 || + read_only_load(&dof_func[row]) == read_only_load(&dof_func_offd[read_only_load(&A_offd_j[i])]) ) { - if ( num_functions == 1 || - read_only_load(&dof_func[row]) == read_only_load(&dof_func_offd[read_only_load(&A_offd_j[i])]) ) - { - const HYPRE_Real v = hypre_cabs( read_only_load(&A_offd_data[i]) ); - row_sum += v; - row_scale = hypre_max(row_scale, v); - } + const HYPRE_Real v = hypre_cabs( read_only_load(&A_offd_data[i]) ); + row_sum += v; + row_scale = hypre_max(row_scale, v); } } - diag = warp_allreduce_sum(diag); + diag = warp_allreduce_sum(item, diag); /* compute scaling factor and row sum */ - row_sum = warp_allreduce_sum(row_sum); - row_scale = warp_allreduce_max(row_scale); + row_sum = warp_allreduce_sum(item, row_sum); + row_scale = warp_allreduce_max(item, row_scale); /* compute row of S */ - HYPRE_Int all_weak = max_row_sum < 1.0 && fabs(row_sum) < fabs(diag) * (2.0 - max_row_sum); + HYPRE_Int all_weak = max_row_sum < 1.0 && + hypre_abs(row_sum) < hypre_abs(diag) * (2.0 - max_row_sum); const HYPRE_Real thresh = strength_threshold * row_scale; - for (HYPRE_Int i = p_diag + lane; __any_sync(HYPRE_WARP_FULL_MASK, i < q_diag); i += HYPRE_WARP_SIZE) + for (HYPRE_Int i = p_diag + lane; i < q_diag; + i += HYPRE_WARP_SIZE) { - if (i < q_diag) - { - const HYPRE_Int cond = all_weak == 0 && diag_pos != i && - ( num_functions == 1 || read_only_load(&dof_func[row]) == - read_only_load(&dof_func[read_only_load(&A_diag_j[i])]) ) && - hypre_cabs( read_only_load(&A_diag_data[i]) ) > thresh; - S_temp_diag_j[i] = cond * (1 + read_only_load(&A_diag_j[i])) - 1; - row_nnz_diag += cond; - } + const HYPRE_Int cond = all_weak == 0 && diag_pos != i && + ( num_functions == 1 || read_only_load(&dof_func[row]) == + read_only_load(&dof_func[read_only_load(&A_diag_j[i])]) ) && + hypre_cabs( read_only_load(&A_diag_data[i]) ) > thresh; + S_temp_diag_j[i] = cond * (1 + read_only_load(&A_diag_j[i])) - 1; + row_nnz_diag += cond; } /* !!! mark diagonal as -2 !!! */ @@ -543,21 +563,18 @@ hypre_BoomerAMGMakeSocFromSDevice( hypre_ParCSRMatrix *A, S_temp_diag_j[diag_pos] = -2; } - for (HYPRE_Int i = p_offd + lane; __any_sync(HYPRE_WARP_FULL_MASK, i < q_offd); i += HYPRE_WARP_SIZE) + for (HYPRE_Int i = p_offd + lane; i < q_offd; i += HYPRE_WARP_SIZE) { - if (i < q_offd) - { - const HYPRE_Int cond = all_weak == 0 && - ( num_functions == 1 || read_only_load(&dof_func[row]) == - read_only_load(&dof_func_offd[read_only_load(&A_offd_j[i])]) ) && - hypre_cabs( read_only_load(&A_offd_data[i]) ) > thresh; - S_temp_offd_j[i] = cond * (1 + read_only_load(&A_offd_j[i])) - 1; - row_nnz_offd += cond; - } + const HYPRE_Int cond = all_weak == 0 && + ( num_functions == 1 || read_only_load(&dof_func[row]) == + read_only_load(&dof_func_offd[read_only_load(&A_offd_j[i])]) ) && + hypre_cabs( read_only_load(&A_offd_data[i]) ) > thresh; + S_temp_offd_j[i] = cond * (1 + read_only_load(&A_offd_j[i])) - 1; + row_nnz_offd += cond; } - row_nnz_diag = warp_reduce_sum(row_nnz_diag); - row_nnz_offd = warp_reduce_sum(row_nnz_offd); + row_nnz_diag = warp_reduce_sum(item, row_nnz_diag); + row_nnz_offd = warp_reduce_sum(item, row_nnz_offd); if (0 == lane) { @@ -579,7 +596,34 @@ hypre_BoomerAMGCorrectCFMarkerDevice(hypre_IntArray *CF_marker, hypre_IntArray * HYPRE_Int *indices = hypre_CTAlloc(HYPRE_Int, n_coarse, HYPRE_MEMORY_DEVICE); HYPRE_Int *CF_C = hypre_CTAlloc(HYPRE_Int, n_coarse, HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_SYCL) + /* save CF_marker values at C points in CF_C and C point indices */ + HYPRE_ONEDPL_CALL( std::copy_if, + hypre_IntArrayData(CF_marker), + hypre_IntArrayData(CF_marker) + n_fine, + CF_C, + is_positive() ); + hypreSycl_copy_if( oneapi::dpl::counting_iterator(0), + oneapi::dpl::counting_iterator(n_fine), + hypre_IntArrayData(CF_marker), + indices, + is_positive() ); + + /* replace CF_marker at C points with 1 */ + HYPRE_ONEDPL_CALL( std::replace_if, + hypre_IntArrayData(CF_marker), + hypre_IntArrayData(CF_marker) + n_fine, + is_positive(), + 1 ); + /* update with new_CF_marker wherever C point value was initially 1 */ + hypreSycl_scatter_if( hypre_IntArrayData(new_CF_marker), + hypre_IntArrayData(new_CF_marker) + n_coarse, + indices, + CF_C, + hypre_IntArrayData(CF_marker), + equal(1) ); +#else /* save CF_marker values at C points in CF_C and C point indices */ HYPRE_THRUST_CALL( copy_if, hypre_IntArrayData(CF_marker), @@ -608,6 +652,7 @@ hypre_BoomerAMGCorrectCFMarkerDevice(hypre_IntArray *CF_marker, hypre_IntArray * CF_C, hypre_IntArrayData(CF_marker), equal(1) ); +#endif hypre_TFree(indices, HYPRE_MEMORY_DEVICE); hypre_TFree(CF_C, HYPRE_MEMORY_DEVICE); @@ -627,6 +672,30 @@ hypre_BoomerAMGCorrectCFMarker2Device(hypre_IntArray *CF_marker, hypre_IntArray HYPRE_Int *indices = hypre_CTAlloc(HYPRE_Int, n_coarse, HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_SYCL) + /* save C point indices */ + hypreSycl_copy_if( oneapi::dpl::counting_iterator(0), + oneapi::dpl::counting_iterator(n_fine), + hypre_IntArrayData(CF_marker), + indices, + is_positive() ); + + /* replace CF_marker at C points with 1 */ + HYPRE_ONEDPL_CALL( std::replace_if, + hypre_IntArrayData(CF_marker), + hypre_IntArrayData(CF_marker) + n_fine, + is_positive(), + 1 ); + + /* update values in CF_marker to -2 wherever new_CF_marker == -1 */ + hypreSycl_transform_if( oneapi::dpl::make_permutation_iterator(hypre_IntArrayData(CF_marker), + indices), + oneapi::dpl::make_permutation_iterator(hypre_IntArrayData(CF_marker), indices) + n_coarse, + hypre_IntArrayData(new_CF_marker), + oneapi::dpl::make_permutation_iterator(hypre_IntArrayData(CF_marker), indices), + [] (const auto & x) { return -2; }, + equal(-1) ); +#else /* save C point indices */ HYPRE_THRUST_CALL( copy_if, thrust::counting_iterator(0), @@ -650,10 +719,11 @@ hypre_BoomerAMGCorrectCFMarker2Device(hypre_IntArray *CF_marker, hypre_IntArray hypre_IntArrayData(new_CF_marker), hypre_IntArrayData(CF_marker), equal(-1) ); +#endif hypre_TFree(indices, HYPRE_MEMORY_DEVICE); return 0; } -#endif /* #if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) */ +#endif /* #if defined(HYPRE_USING_GPU) */ diff --git a/external/hypre/src/parcsr_ls/par_sv_interp.c b/external/hypre/src/parcsr_ls/par_sv_interp.c index 80b73feb..50759176 100644 --- a/external/hypre/src/parcsr_ls/par_sv_interp.c +++ b/external/hypre/src/parcsr_ls/par_sv_interp.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -22,18 +22,20 @@ *******************************************************************************/ HYPRE_Int hypre_BoomerAMGSmoothInterpVectors(hypre_ParCSRMatrix *A, - HYPRE_Int num_smooth_vecs, - hypre_ParVector **smooth_vecs, - HYPRE_Int smooth_steps) + HYPRE_Int num_smooth_vecs, + hypre_ParVector **smooth_vecs, + HYPRE_Int smooth_steps) { - HYPRE_Int i,j; + HYPRE_Int i, j; hypre_ParVector *f, *v, *z; hypre_ParVector *new_vector; if (num_smooth_vecs == 0) + { return hypre_error_flag; + } if (smooth_steps) { @@ -107,7 +109,9 @@ hypre_BoomerAMGCoarsenInterpVectors( hypre_ParCSRMatrix *P, hypre_ParVector **new_vector_array; if (num_smooth_vecs == 0) + { return hypre_error_flag; + } new_vector_array = hypre_CTAlloc(hypre_ParVector*, num_smooth_vecs, HYPRE_MEMORY_HOST); @@ -133,20 +137,24 @@ hypre_BoomerAMGCoarsenInterpVectors( hypre_ParCSRMatrix *P, orig_nf = num_functions - num_smooth_vecs; /* nodal coarsening, so just check the first dof in each node, i.e. loop through nodes */ - for (j = 0; j < n_old_local; j+=orig_nf) + for (j = 0; j < n_old_local; j += orig_nf) { - if (CF_marker[j]>= 0) + if (CF_marker[j] >= 0) { - for (k=0; k < orig_nf; k++) /* orig dofs */ + for (k = 0; k < orig_nf; k++) /* orig dofs */ { - new_vector_data[counter++] = old_vector_data[j+k]; + new_vector_data[counter++] = old_vector_data[j + k]; } - for (k=0; k< num_smooth_vecs; k++ ) /* new dofs */ + for (k = 0; k < num_smooth_vecs; k++ ) /* new dofs */ { if (k == i) + { new_vector_data[counter++] = 1.0; + } else + { new_vector_data[counter++] = 0.0; + } /* there is nothing to copy, so just put a 1.0 or 0.0 here - then the next level works correctly - this value not used anyhow - but now it is nice @@ -157,10 +165,12 @@ hypre_BoomerAMGCoarsenInterpVectors( hypre_ParCSRMatrix *P, } else /* normal level */ { - for (j=0; j < n_old_local; j++) + for (j = 0; j < n_old_local; j++) { - if (CF_marker[j]>= 0) + if (CF_marker[j] >= 0) + { new_vector_data[counter++] = old_vector_data[j]; + } } } @@ -228,7 +238,7 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, HYPRE_Int interp_vec_first_level) { - HYPRE_Int i,j, k; + HYPRE_Int i, j, k; hypre_ParCSRMatrix *new_P; @@ -284,7 +294,7 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, HYPRE_Real *offd_vec_data; HYPRE_Int orig_nf; - HYPRE_BigInt *new_col_starts; + HYPRE_BigInt new_col_starts[2]; HYPRE_Int num_functions = *nf; HYPRE_Int *c_dof_func = hypre_IntArrayData(*coarse_dof_func); HYPRE_Int modify = 0; @@ -293,7 +303,7 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, HYPRE_Real value; HYPRE_Real trunc_value = 0.0; HYPRE_Real theta_2D[] = {.5, .5}; - HYPRE_Real theta_3D[] = {1.0/3.0, 1.0/3.0, 1.0/3.0}; + HYPRE_Real theta_3D[] = {1.0 / 3.0, 1.0 / 3.0, 1.0 / 3.0}; HYPRE_Real *theta; @@ -304,7 +314,7 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, HYPRE_Real *q_trunc_data = NULL; HYPRE_Int *is_q = NULL; - HYPRE_Int q_alloc= 0; + HYPRE_Int q_alloc = 0; HYPRE_BigInt *aux_j = NULL; HYPRE_Real *aux_data = NULL; HYPRE_Int *is_diag = NULL; @@ -312,7 +322,8 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, HYPRE_Int *col_map; HYPRE_Int *coarse_to_fine; HYPRE_Int coarse_counter; - HYPRE_Int fine_index, index; + HYPRE_Int fine_index = 0; + HYPRE_Int index; HYPRE_BigInt big_index, big_new_col, cur_col, g_nc; HYPRE_Int new_col; @@ -322,15 +333,17 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, HYPRE_Real *lost_value_sv = NULL; HYPRE_Real *q_dist_value_sv = NULL; - + HYPRE_MemoryLocation memory_location_P = hypre_ParCSRMatrixMemoryLocation(A); /* only doing 2 variants */ if (variant < 1 || variant > 2) + { variant = 2; + } - /* variant 2 needs off proc sv data (Variant 1 needs it if we - * use_truc_data = 1 )*/ + /* variant 2 needs off proc sv data (Variant 1 needs it if we + * use_truc_data = 1 )*/ if (!comm_pkg) { @@ -355,25 +368,29 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, if (!myid) { - hypre_sprintf(new_file,"%s.level.%d","P_new_orig", level ); + hypre_sprintf(new_file, "%s.level.%d", "P_new_orig", level ); if (P_CSR) + { hypre_CSRMatrixPrint(P_CSR, new_file); + } } hypre_CSRMatrixDestroy(P_CSR); - if (level ==interp_vec_first_level || variant == 2) + if (level == interp_vec_first_level || variant == 2) { - for (i=0; i < num_smooth_vecs; i++) + for (i = 0; i < num_smooth_vecs; i++) { sv = hypre_ParVectorToVectorAll(smooth_vecs[i]); if (!myid) { - hypre_sprintf(new_file,"%s.%d.level.%d","smoothvec", i, level ); + hypre_sprintf(new_file, "%s.%d.level.%d", "smoothvec", i, level ); if (sv) + { hypre_SeqVectorPrint(sv, new_file); + } } hypre_SeqVectorDestroy(sv); @@ -384,9 +401,11 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, P_CSR = hypre_ParCSRMatrixToCSRMatrixAll(A); if (!myid) { - hypre_sprintf(new_file,"%s.level.%d","A", level ); + hypre_sprintf(new_file, "%s.level.%d", "A", level ); if (P_CSR) + { hypre_CSRMatrixPrint(P_CSR, new_file); + } } hypre_CSRMatrixDestroy(P_CSR); @@ -404,13 +423,17 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, /* add Q? */ /* only on first level for variants other than 2 */ - if (variant ==2 || level == interp_vec_first_level) + if (variant == 2 || level == interp_vec_first_level) + { add_q = 1; + } /* modify P_s? */ if (variant == 2) + { modify = 1; + } /* use different values to truncate? */ if (variant == 1 ) @@ -423,7 +446,7 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, /* First we need to make room for the new entries to P*/ /*number of coarse variables for each unknown */ - ncv_peru = ncv/num_functions; + ncv_peru = ncv / num_functions; if (level == interp_vec_first_level) { @@ -443,9 +466,13 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, if (weights == NULL) { if (orig_nf == 2) + { theta = theta_2D; + } else + { theta = theta_3D; + } } else { @@ -454,8 +481,8 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, } - /* if level = first_level, we need to fix the col numbering to leave - * space for the new unknowns */ + /* if level = first_level, we need to fix the col numbering to leave + * space for the new unknowns */ col_map = hypre_CTAlloc(HYPRE_Int, ncv, HYPRE_MEMORY_HOST); @@ -465,7 +492,7 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, { /* map from old col number to new col number (leave spaces * for new unknowns to be interleaved */ - col_map[i] = i + (i/num_functions) * num_smooth_vecs; + col_map[i] = i + (i / num_functions) * num_smooth_vecs; } } else @@ -481,23 +508,27 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, /* new number of nonzeros - these are overestimates if level > first_level*/ /* we will have the same sparsity in Q as in P */ - new_nnz_diag = nnz_diag + nnz_diag*num_smooth_vecs; - new_nnz_offd = nnz_offd + nnz_offd*num_smooth_vecs; + new_nnz_diag = nnz_diag + nnz_diag * num_smooth_vecs; + new_nnz_offd = nnz_offd + nnz_offd * num_smooth_vecs; /* new number of coarse variables */ if (level == interp_vec_first_level ) - new_ncv = ncv + ncv_peru*num_smooth_vecs; + { + new_ncv = ncv + ncv_peru * num_smooth_vecs; + } else - new_ncv = ncv; /* unchanged on level > 0 */ + { + new_ncv = ncv; /* unchanged on level > 0 */ + } - P_diag_j_new = hypre_CTAlloc(HYPRE_Int, new_nnz_diag, HYPRE_MEMORY_DEVICE); - P_diag_data_new = hypre_CTAlloc(HYPRE_Real, new_nnz_diag, HYPRE_MEMORY_DEVICE); - P_diag_i_new = hypre_CTAlloc(HYPRE_Int, nv + 1, HYPRE_MEMORY_DEVICE); + P_diag_j_new = hypre_CTAlloc(HYPRE_Int, new_nnz_diag, memory_location_P); + P_diag_data_new = hypre_CTAlloc(HYPRE_Real, new_nnz_diag, memory_location_P); + P_diag_i_new = hypre_CTAlloc(HYPRE_Int, nv + 1, memory_location_P); P_offd_j_big = hypre_CTAlloc(HYPRE_BigInt, new_nnz_offd, HYPRE_MEMORY_HOST); - P_offd_j_new = hypre_CTAlloc(HYPRE_Int, new_nnz_offd, HYPRE_MEMORY_DEVICE); - P_offd_data_new = hypre_CTAlloc(HYPRE_Real, new_nnz_offd, HYPRE_MEMORY_DEVICE); - P_offd_i_new = hypre_CTAlloc(HYPRE_Int, nv + 1, HYPRE_MEMORY_DEVICE); + P_offd_j_new = hypre_CTAlloc(HYPRE_Int, new_nnz_offd, memory_location_P); + P_offd_data_new = hypre_CTAlloc(HYPRE_Real, new_nnz_offd, memory_location_P); + P_offd_i_new = hypre_CTAlloc(HYPRE_Int, nv + 1, memory_location_P); P_diag_i_new[0] = P_diag_i[0]; P_offd_i_new[0] = P_offd_i[0]; @@ -509,28 +540,30 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, { /* what is max elements per row? */ q_count = 0; - for (i=0; i < num_rows_P; i++) + for (i = 0; i < num_rows_P; i++) { - num_elements = P_diag_i[i+1]-P_diag_i[i]; - num_elements += (P_offd_i[i+1]-P_offd_i[i]); + num_elements = P_diag_i[i + 1] - P_diag_i[i]; + num_elements += (P_offd_i[i + 1] - P_offd_i[i]); - if (num_elements > q_count) q_count = num_elements; + if (num_elements > q_count) { q_count = num_elements; } } - q_alloc = q_count*(num_smooth_vecs + 1); - q_data = hypre_CTAlloc(HYPRE_Real, q_alloc , HYPRE_MEMORY_HOST); - q_trunc_data = hypre_CTAlloc(HYPRE_Real, q_alloc , HYPRE_MEMORY_HOST); - is_q = hypre_CTAlloc(HYPRE_Int, q_alloc , HYPRE_MEMORY_HOST); + q_alloc = q_count * (num_smooth_vecs + 1); + q_data = hypre_CTAlloc(HYPRE_Real, q_alloc, HYPRE_MEMORY_HOST); + q_trunc_data = hypre_CTAlloc(HYPRE_Real, q_alloc, HYPRE_MEMORY_HOST); + is_q = hypre_CTAlloc(HYPRE_Int, q_alloc, HYPRE_MEMORY_HOST); aux_data = hypre_CTAlloc(HYPRE_Real, q_alloc, HYPRE_MEMORY_HOST); aux_j = hypre_CTAlloc(HYPRE_BigInt, q_alloc, HYPRE_MEMORY_HOST); - is_diag = hypre_CTAlloc(HYPRE_Int, q_alloc , HYPRE_MEMORY_HOST); + is_diag = hypre_CTAlloc(HYPRE_Int, q_alloc, HYPRE_MEMORY_HOST); /* for truncation routines */ - q_count_sv = hypre_CTAlloc(HYPRE_Int, num_smooth_vecs, HYPRE_MEMORY_HOST); /* number of new q entries for each smoothvec */ + q_count_sv = hypre_CTAlloc(HYPRE_Int, num_smooth_vecs, + HYPRE_MEMORY_HOST); /* number of new q entries for each smoothvec */ num_lost_sv = hypre_CTAlloc(HYPRE_Int, num_smooth_vecs, HYPRE_MEMORY_HOST); /* value dropped */ lost_counter_q_sv = hypre_CTAlloc(HYPRE_Int, num_smooth_vecs, HYPRE_MEMORY_HOST); - lost_value_sv = hypre_CTAlloc(HYPRE_Real, num_smooth_vecs, HYPRE_MEMORY_HOST); /* how many to drop */ + lost_value_sv = hypre_CTAlloc(HYPRE_Real, num_smooth_vecs, + HYPRE_MEMORY_HOST); /* how many to drop */ q_dist_value_sv = hypre_CTAlloc(HYPRE_Real, num_smooth_vecs, HYPRE_MEMORY_HOST); ; } } @@ -538,7 +571,7 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, /* create the coarse to fine*/ coarse_to_fine = hypre_CTAlloc(HYPRE_Int, ncv, HYPRE_MEMORY_HOST); coarse_counter = 0; - for (i=0; i < num_rows_P; i++) + for (i = 0; i < num_rows_P; i++) { if (CF_marker[i] >= 0) { @@ -554,10 +587,10 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, HYPRE_Int start, c_index; hypre_ParCSRCommHandle *comm_handle; - smooth_vec_offd = hypre_CTAlloc(HYPRE_Real, num_cols_P_offd*num_smooth_vecs, HYPRE_MEMORY_HOST); + smooth_vec_offd = hypre_CTAlloc(HYPRE_Real, num_cols_P_offd * num_smooth_vecs, HYPRE_MEMORY_HOST); /* for now, do a seperate comm for each smooth vector */ - for (k = 0; k< num_smooth_vecs; k++) + for (k = 0; k < num_smooth_vecs; k++) { vector = smooth_vecs[k]; @@ -565,23 +598,22 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); dbl_buf_data = hypre_CTAlloc(HYPRE_Real, hypre_ParCSRCommPkgSendMapStart(comm_pkg, - num_sends), HYPRE_MEMORY_HOST); + num_sends), HYPRE_MEMORY_HOST); /* point into smooth_vec_offd */ - offd_vec_data = smooth_vec_offd + k*num_cols_P_offd; + offd_vec_data = smooth_vec_offd + k * num_cols_P_offd; index = 0; for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { /* we need to do the coarse/fine conversion here */ - c_index = hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j); + c_index = hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j); fine_index = coarse_to_fine[c_index]; dbl_buf_data[index++] = vec_data[fine_index]; } - } comm_handle = hypre_ParCSRCommHandleCreate( 1, comm_pkg, dbl_buf_data, @@ -602,13 +634,13 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, orig_diag_start = 0; orig_offd_start = 0; - for (i=0; i < num_rows_P; i++) + for (i = 0; i < num_rows_P; i++) { q_count = 0; /* number of entries of q added for this row */ /* zero entries */ - for (j = 0; j< q_alloc; j++) + for (j = 0; j < q_alloc; j++) { is_q[j] = 0; q_data[j] = 0.0; @@ -619,11 +651,14 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, fcn_num = (HYPRE_Int) fmod(i, num_functions); if (fcn_num != dof_func[i]) - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"WARNING - ROWS incorrectly ordered in hypre_BoomerAMG_GMExpandInterp!\n"); + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "WARNING - ROWS incorrectly ordered in hypre_BoomerAMG_GMExpandInterp!\n"); + } /* number of elements in row */ - num_diag_elements = P_diag_i[i+1] - orig_diag_start; - num_offd_elements = P_offd_i[i+1] - orig_offd_start; + num_diag_elements = P_diag_i[i + 1] - orig_diag_start; + num_offd_elements = P_offd_i[i + 1] - orig_offd_start; /* loop through elements - copy each to new_P and create Q corresp to each smooth vec for the orig functions */ @@ -634,35 +669,37 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, if (fcn_num < orig_nf) { - + row_sum = 1.0; if ((variant == 1 || variant == 2) && add_q) { /* calc. row sum */ row_sum = 0.0; - for (j=0; j < num_diag_elements; j++) + for (j = 0; j < num_diag_elements; j++) { - row_sum += P_diag_data[orig_diag_start+j]; + row_sum += P_diag_data[orig_diag_start + j]; } - for (j=0; j < num_offd_elements; j++) + for (j = 0; j < num_offd_elements; j++) { - row_sum += P_offd_data[orig_offd_start+j]; + row_sum += P_offd_data[orig_offd_start + j]; } num_elements = num_diag_elements + num_offd_elements; - if (num_elements && fabs(row_sum) < 1e-15) + if (num_elements && hypre_abs(row_sum) < 1e-15) + { row_sum = 1.0; + } } /**** first do diag elements *****/ - for (j=0; j < num_diag_elements; j++) + for (j = 0; j < num_diag_elements; j++) { /* first copy original entry corresponding to P */ - new_col = col_map[P_diag_j[orig_diag_start+j]]; + new_col = col_map[P_diag_j[orig_diag_start + j]]; P_diag_j_new[j_diag_pos] = new_col; - P_diag_data_new[j_diag_pos] = P_diag_data[orig_diag_start+j]; + P_diag_data_new[j_diag_pos] = P_diag_data[orig_diag_start + j]; j_diag_pos++; p_count_diag++; @@ -685,49 +722,54 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, new_col = cur_col + (HYPRE_BigInt)((orig_nf - fcn_num) + k); /* Determine the Q entry value*/ - if (variant == 2 ) + if (variant == 2) { /*HYPRE_Real dt;*/ /* Q: P_ij(v_i/row_sum - vc_j) - ** notice we use fine and coarse smooth vecs */ - - index = P_diag_j[orig_diag_start+j]; /* don't want to use col_map here + index = P_diag_j[orig_diag_start + j]; /* don't want to use col_map here because we will index into the smooth vector */ fine_index = coarse_to_fine[index]; /*dt = P_diag_data[orig_diag_start+j]; dt = (vec_data[i]/row_sum - vec_data[fine_index]);*/ - value = P_diag_data[orig_diag_start+j]*(vec_data[i]/row_sum - vec_data[fine_index]); - + value = P_diag_data[orig_diag_start + j] * + (vec_data[i] / row_sum - vec_data[fine_index]); } else /* variant 1 */ { /* create new entry for Q: P_ij*v_i /sum(P_ij)*/ - value = (P_diag_data[orig_diag_start+j]*vec_data[i])/row_sum; + value = (P_diag_data[orig_diag_start + j] * vec_data[i]) / row_sum; if (abs_trunc > 0.0 && use_trunc_data ) { - fine_index = P_diag_j[orig_diag_start+j]; + fine_index = P_diag_j[orig_diag_start + j]; fine_index = coarse_to_fine[fine_index]; - - /* this is Tzanios's suggestion */ + /* this is Tzanio's suggestion */ if (vec_data[fine_index] != 0.0 ) - trunc_value = P_diag_data[orig_diag_start+j]*(vec_data[i])/(vec_data[fine_index]); + { + trunc_value = P_diag_data[orig_diag_start + j] * (vec_data[i]) / + (vec_data[fine_index]); + } else - trunc_value = P_diag_data[orig_diag_start+j]*(vec_data[i]); + { + trunc_value = P_diag_data[orig_diag_start + j] * (vec_data[i]); + } } } /* end of var 2 */ /* add the new entry to to P */ - if (fabs(value) > 0.0) + if (hypre_abs(value) > 0.0) { if (q_max > 0 || abs_trunc > 0.0) { if (use_trunc_data) - q_trunc_data[p_count_diag] = trunc_value; /* note that this goes in the p_count entry to line + { + q_trunc_data[p_count_diag] = trunc_value; + } /* note that this goes in the p_count entry to line up with is_q */ is_q[p_count_diag] = k + 1; /* so we know which k*/ q_data[q_count++] = value; @@ -743,12 +785,12 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, /**** now do offd elements *****/ p_count_offd = p_count_diag; - for (j=0; j < num_offd_elements; j++) + for (j = 0; j < num_offd_elements; j++) { /* first copy original entry corresponding to P (but j needs to go back to regular numbering - will be compressed later when col_map_offd is generated*/ - index = P_offd_j[orig_offd_start+j]; + index = P_offd_j[orig_offd_start + j]; /* convert to the global col number using col_map_offd */ big_index = col_map_offd_P[index]; @@ -757,7 +799,7 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, * use col_map[index]*/ if (num_smooth_vecs && (level == interp_vec_first_level)) { - big_new_col = big_index + (big_index/(HYPRE_BigInt)num_functions) * (HYPRE_BigInt)num_smooth_vecs; + big_new_col = big_index + (big_index / (HYPRE_BigInt)num_functions) * (HYPRE_BigInt)num_smooth_vecs; } else /* no adjustment */ { @@ -765,7 +807,7 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, } P_offd_j_big[j_offd_pos] = big_new_col; - P_offd_data_new[j_offd_pos] = P_offd_data[orig_offd_start+j]; + P_offd_data_new[j_offd_pos] = P_offd_data[orig_offd_start + j]; j_offd_pos++; p_count_offd++; @@ -784,7 +826,7 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, vec_data = hypre_VectorData(hypre_ParVectorLocalVector(vector)); /* point to the offd smooth vector */ - offd_vec_data = smooth_vec_offd + k*num_cols_P_offd; + offd_vec_data = smooth_vec_offd + k * num_cols_P_offd; /* add an entry */ @@ -797,7 +839,7 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, /*HYPRE_Real dt;*/ /* Q: P_ij(v_i/row_sum - vc_j) - * notice we use fine and coarse smooth vecs */ - index = P_offd_j[orig_offd_start+j]; /* don't want to use col_map here + index = P_offd_j[orig_offd_start + j]; /* don't want to use col_map here because we will index into the smooth vector */ @@ -806,7 +848,7 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, /*dt = P_offd_data[orig_offd_start+j]; dt = (vec_data[i]/row_sum - offd_vec_data[index]);*/ - value = P_offd_data[orig_offd_start+j]*(vec_data[i]/row_sum - offd_vec_data[index]); + value = P_offd_data[orig_offd_start + j] * (vec_data[i] / row_sum - offd_vec_data[index]); /* dt = (vec_data[i]/row_sum - c_vec_data[cur_col]); @@ -817,29 +859,35 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, else /* variant 1 */ { /* create new entry for Q: P_ij*v_i /sum(P_ij)*/ - value = (P_offd_data[orig_offd_start+j]*vec_data[i])/row_sum; + value = (P_offd_data[orig_offd_start + j] * vec_data[i]) / row_sum; if (abs_trunc > 0.0 && use_trunc_data ) { - index = P_offd_j[orig_offd_start+j]; - + index = P_offd_j[orig_offd_start + j]; - /* this is Tzanios's suggestion */ + /* this is Tzanio's suggestion */ if (offd_vec_data[fine_index] != 0.0 ) - trunc_value = P_offd_data[orig_offd_start+j]*(vec_data[i])/(offd_vec_data[index]); + { + trunc_value = P_offd_data[orig_offd_start + j] * (vec_data[i]) / + (offd_vec_data[index]); + } else - trunc_value = P_offd_data[orig_offd_start+j]*(vec_data[i]); + { + trunc_value = P_offd_data[orig_offd_start + j] * (vec_data[i]); + } } } /* end of var 2 */ /* add the new entry to to P */ - if (fabs(value) > 0.0) + if (hypre_abs(value) > 0.0) { if (q_max > 0 || abs_trunc > 0.0) { if (use_trunc_data) - q_trunc_data[p_count_offd] = trunc_value; /* note that this goes in the p_count entry to line + { + q_trunc_data[p_count_offd] = trunc_value; + } /* note that this goes in the p_count entry to line up with is_q */ is_q[p_count_offd] = k + 1; /* so we know which k*/ q_data[q_count++] = value; @@ -866,18 +914,18 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, /*HYPRE_Real tmp;*/ /**** first do diag elements *****/ - for (j=0; j < num_diag_elements; j++) + for (j = 0; j < num_diag_elements; j++) { m_val = 0.0; - for (m = 0; m< orig_nf; m++) + for (m = 0; m < orig_nf; m++) { - m_pos = P_diag_i[i - (fcn_num - m)]+ j; /* recall - nodal coarsening */ + m_pos = P_diag_i[i - (fcn_num - m)] + j; /* recall - nodal coarsening */ /*tmp = P_diag_data[m_pos];*/ - m_val += theta[m]*P_diag_data[m_pos]; + m_val += theta[m] * P_diag_data[m_pos]; } /*m_val = m_val/orig_nf;*/ - P_diag_j_new[j_diag_pos] = P_diag_j[orig_diag_start+j]; + P_diag_j_new[j_diag_pos] = P_diag_j[orig_diag_start + j]; P_diag_data_new[j_diag_pos++] = m_val; p_count_diag++; } @@ -886,18 +934,18 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, will be compressed later when col_map_offd is generated*/ p_count_offd = p_count_diag; - for (j=0; j < num_offd_elements; j++) + for (j = 0; j < num_offd_elements; j++) { m_val = 0.0; - for (m = 0; m< orig_nf; m++) + for (m = 0; m < orig_nf; m++) { - m_pos = P_offd_i[i - (fcn_num - m)]+ j; /* recall - nodal coarsening */ + m_pos = P_offd_i[i - (fcn_num - m)] + j; /* recall - nodal coarsening */ /*tmp = P_offd_data[m_pos];*/ - m_val += theta[m]*P_offd_data[m_pos]; + m_val += theta[m] * P_offd_data[m_pos]; } /*m_val = m_val/orig_nf;*/ - index = P_offd_j[orig_offd_start+j]; + index = P_offd_j[orig_offd_start + j]; big_index = col_map_offd_P[index]; P_offd_j_big[j_offd_pos] = big_index; @@ -909,10 +957,10 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, unk-based interp on new dof */ { /**** first do diag elements *****/ - for (j=0; j < num_diag_elements; j++) + for (j = 0; j < num_diag_elements; j++) { - P_diag_j_new[j_diag_pos] = P_diag_j[orig_diag_start+j]; - P_diag_data_new[j_diag_pos++] = P_diag_data[orig_diag_start+j]; + P_diag_j_new[j_diag_pos] = P_diag_j[orig_diag_start + j]; + P_diag_data_new[j_diag_pos++] = P_diag_data[orig_diag_start + j]; p_count_diag++; } /**** now offd elements *****/ @@ -920,13 +968,13 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, will be compressed later when col_map_offd is generated*/ p_count_offd = p_count_diag; - for (j=0; j < num_offd_elements; j++) + for (j = 0; j < num_offd_elements; j++) { - index = P_offd_j[orig_offd_start+j]; + index = P_offd_j[orig_offd_start + j]; big_index = col_map_offd_P[index]; P_offd_j_big[j_offd_pos] = big_index; - P_offd_data_new[j_offd_pos++] = P_offd_data[orig_offd_start+j]; + P_offd_data_new[j_offd_pos++] = P_offd_data[orig_offd_start + j]; p_count_offd++; } @@ -970,7 +1018,7 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, j_counter = 0; /* diag loop */ - for(j = P_diag_i_new[i]; j < P_diag_i_new[i] + p_count_diag; j++) + for (j = P_diag_i_new[i]; j < P_diag_i_new[i] + p_count_diag; j++) { if (is_q[j_counter]) /* if > 0 then belongs to q */ { @@ -978,9 +1026,13 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, q_count_sv[which_q]++; if (!use_trunc_data) - value = fabs(P_diag_data_new[j]); + { + value = hypre_abs(P_diag_data_new[j]); + } else - value = fabs(q_trunc_data[j_counter]); + { + value = hypre_abs(q_trunc_data[j_counter]); + } if (value < abs_trunc ) { @@ -991,7 +1043,7 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, j_counter++; } /* offd loop - don't reset j_counter*/ - for(j = P_offd_i_new[i]; j < P_offd_i_new[i] + p_count_offd; j++) + for (j = P_offd_i_new[i]; j < P_offd_i_new[i] + p_count_offd; j++) { if (is_q[j_counter]) /* if > 0 then belongs to q */ { @@ -999,9 +1051,13 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, q_count_sv[which_q]++; if (!use_trunc_data) - value = fabs(P_offd_data_new[j]); + { + value = hypre_abs(P_offd_data_new[j]); + } else - value = fabs(q_trunc_data[j_counter]); + { + value = hypre_abs(q_trunc_data[j_counter]); + } if (value < abs_trunc ) { @@ -1031,7 +1087,7 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, { if ((q_count_sv[j] - num_lost_sv[j]) > 0) { - q_dist_value_sv[j] = lost_value_sv[j]/(q_count_sv[j] - num_lost_sv[j]); + q_dist_value_sv[j] = lost_value_sv[j] / (q_count_sv[j] - num_lost_sv[j]); } } @@ -1040,12 +1096,16 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, /* diag entries */ new_diag_pos = P_diag_i_new[i]; - for(j = P_diag_i_new[i]; j < P_diag_i_new[i] + p_count_diag; j++) + for (j = P_diag_i_new[i]; j < P_diag_i_new[i] + p_count_diag; j++) { if (!use_trunc_data) - value = fabs(P_diag_data_new[j]); + { + value = hypre_abs(P_diag_data_new[j]); + } else - value = fabs(q_trunc_data[j_counter]); + { + value = hypre_abs(q_trunc_data[j_counter]); + } if ( is_q[j_counter] && (value < abs_trunc) ) { @@ -1076,12 +1136,16 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, /* offd entries */ new_offd_pos = P_offd_i_new[i]; - for(j = P_offd_i_new[i]; j < P_offd_i_new[i] + p_count_offd; j++) + for (j = P_offd_i_new[i]; j < P_offd_i_new[i] + p_count_offd; j++) { if (!use_trunc_data) - value = fabs(P_offd_data_new[j]); + { + value = hypre_abs(P_offd_data_new[j]); + } else - value = fabs(q_trunc_data[j_counter]); + { + value = hypre_abs(q_trunc_data[j_counter]); + } if ( is_q[j_counter] && (value < abs_trunc) ) @@ -1120,7 +1184,9 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, if (tot_num_lost != (lost_counter_diag + lost_counter_offd)) - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"hypre_BoomerAMG_GMExpandInterp: 1st Truncation error \n"); + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "hypre_BoomerAMG_GMExpandInterp: 1st Truncation error \n"); + } }/* end of num_lost */ @@ -1157,7 +1223,7 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, j_counter++; } /* offd loop - don't reset j_counter*/ - for(j = P_offd_i_new[i]; j < P_offd_i_new[i] + p_count_offd; j++) + for (j = P_offd_i_new[i]; j < P_offd_i_new[i] + p_count_offd; j++) { if (is_q[j_counter]) /* if > 0 then belongs to q */ { @@ -1182,7 +1248,9 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, num_lost_sv[j] = q_count_sv[j] - q_max;; /* don't want num_lost to be negative */ if (num_lost_sv[j] < 0) + { num_lost_sv[j] = 0; + } tot_num_lost += num_lost_sv[j]; } @@ -1192,7 +1260,7 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, p_count_tot = p_count_diag + p_count_offd; /* only keep q_max elements - get rid of smallest */ - hypre_BigQsort4_abs(aux_data, aux_j, is_q, is_diag, 0 , p_count_tot -1); + hypre_BigQsort4_abs(aux_data, aux_j, is_q, is_diag, 0, p_count_tot - 1); lost_counter_diag = 0; lost_counter_offd = 0; @@ -1203,7 +1271,7 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, new_j_counter = 0; /* have to do diag and offd together because of sorting*/ - for(j = 0; j < p_count_tot; j++) + for (j = 0; j < p_count_tot; j++) { which_q = 0; @@ -1231,7 +1299,7 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, } /* technically only need to do this the last time */ - q_dist_value_sv[which_q] = lost_value_sv[which_q]/q_max; + q_dist_value_sv[which_q] = lost_value_sv[which_q] / q_max; } else { @@ -1279,20 +1347,22 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, }/* end of TRUNCATION */ /* modify i */ - orig_diag_start = P_diag_i[i+1]; - orig_offd_start = P_offd_i[i+1]; + orig_diag_start = P_diag_i[i + 1]; + orig_offd_start = P_offd_i[i + 1]; - P_diag_i_new[i+1] = P_diag_i_new[i] + p_count_diag; - P_offd_i_new[i+1] = P_offd_i_new[i] + p_count_offd; + P_diag_i_new[i + 1] = P_diag_i_new[i] + p_count_diag; + P_offd_i_new[i + 1] = P_offd_i_new[i] + p_count_offd; - if (j_diag_pos != P_diag_i_new[i+1]) + if (j_diag_pos != P_diag_i_new[i + 1]) { - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Warning - diag Row Problem in hypre_BoomerAMG_GMExpandInterp!\n"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "Warning - diag Row Problem in hypre_BoomerAMG_GMExpandInterp!\n"); } - if (j_offd_pos != P_offd_i_new[i+1]) + if (j_offd_pos != P_offd_i_new[i + 1]) { - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Warning - off-diag Row Problem in hypre_BoomerAMG_GMExpandInterp!\n"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "Warning - off-diag Row Problem in hypre_BoomerAMG_GMExpandInterp!\n"); } @@ -1302,18 +1372,19 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, /* Done looping through rows - NOW FINISH THINGS UP! */ /* if level = first_level , we need to update the number of - * funcs and the dof_func */ + * funcs and the dof_func */ if (level == interp_vec_first_level ) { HYPRE_Int spot; - c_dof_func = hypre_TReAlloc_v2(c_dof_func, HYPRE_Int, hypre_IntArraySize(*coarse_dof_func), HYPRE_Int, new_ncv, hypre_IntArrayMemoryLocation(*coarse_dof_func)); + c_dof_func = hypre_TReAlloc_v2(c_dof_func, HYPRE_Int, hypre_IntArraySize(*coarse_dof_func), + HYPRE_Int, new_ncv, hypre_IntArrayMemoryLocation(*coarse_dof_func)); spot = 0; for (i = 0; i < ncv_peru; i++) { - for (k = 0; k< num_functions + num_smooth_vecs; k++) + for (k = 0; k < num_functions + num_smooth_vecs; k++) { c_dof_func[spot++] = k; } @@ -1331,12 +1402,11 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, /* assumes that unknowns are together on a procsessor with * nodal coarsening */ - new_col_starts = hypre_CTAlloc(HYPRE_BigInt, 2, HYPRE_MEMORY_HOST); - new_col_starts[0] = (col_starts[0]/(HYPRE_BigInt)num_functions)*(HYPRE_BigInt)new_nf ; - new_col_starts[1] = (col_starts[1]/(HYPRE_BigInt)num_functions)*(HYPRE_BigInt)new_nf; + new_col_starts[0] = (col_starts[0] / (HYPRE_BigInt)num_functions) * (HYPRE_BigInt)new_nf ; + new_col_starts[1] = (col_starts[1] / (HYPRE_BigInt)num_functions) * (HYPRE_BigInt)new_nf; - if (myid == (num_procs -1)) g_nc = new_col_starts[1]; - hypre_MPI_Bcast(&g_nc, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); + if (myid == (num_procs - 1)) { g_nc = new_col_starts[1]; } + hypre_MPI_Bcast(&g_nc, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); } else /* not first level */ { @@ -1344,7 +1414,6 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, g_nc = hypre_ParCSRMatrixGlobalNumCols(*P); /* copy col starts */ - new_col_starts = hypre_CTAlloc(HYPRE_BigInt, 2, HYPRE_MEMORY_HOST); new_col_starts[0] = col_starts[0]; new_col_starts[1] = col_starts[1]; } @@ -1373,8 +1442,6 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, hypre_CSRMatrixData(P_offd) = P_offd_data_new; hypre_CSRMatrixI(P_offd) = P_offd_i_new; - hypre_TFree(new_col_starts, HYPRE_MEMORY_HOST); - /* If parallel we need to do the col map offd! */ if (num_procs > 1) { @@ -1392,16 +1459,18 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, /*first copy the j entries (these are GLOBAL numbers) */ j_copy = hypre_CTAlloc(HYPRE_BigInt, P_offd_new_size, HYPRE_MEMORY_HOST); - for (i=0; i < P_offd_new_size; i++) + for (i = 0; i < P_offd_new_size; i++) + { j_copy[i] = P_offd_j_big[i]; + } /* now sort them */ - hypre_BigQsort0(j_copy, 0, P_offd_new_size-1); + hypre_BigQsort0(j_copy, 0, P_offd_new_size - 1); /* now copy to col_map offd - but only each col once */ new_col_map_offd_P[0] = j_copy[0]; count = 0; - for (i=0; i < P_offd_new_size; i++) + for (i = 0; i < P_offd_new_size; i++) { if (j_copy[i] > new_col_map_offd_P[count]) { @@ -1412,10 +1481,10 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, num_cols_P_offd = count + 1; /* reset the j entries to be local */ - for (i=0; i < P_offd_new_size; i++) + for (i = 0; i < P_offd_new_size; i++) P_offd_j_new[i] = hypre_BigBinarySearch(new_col_map_offd_P, - P_offd_j_big[i], - num_cols_P_offd); + P_offd_j_big[i], + num_cols_P_offd); hypre_TFree(j_copy, HYPRE_MEMORY_HOST); } @@ -1439,9 +1508,11 @@ hypre_BoomerAMG_GMExpandInterp( hypre_ParCSRMatrix *A, if (!myid) { - hypre_sprintf(new_file,"%s.level.%d","P_new_new", level ); + hypre_sprintf(new_file, "%s.level.%d", "P_new_new", level ); if (P_CSR) + { hypre_CSRMatrixPrint(P_CSR, new_file); + } } hypre_CSRMatrixDestroy(P_CSR); @@ -1494,9 +1565,9 @@ hypre_BoomerAMGRefineInterp( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, HYPRE_Int level) { - HYPRE_Int i,j, k, pp; + HYPRE_UNUSED_VAR(level); - //printf(" hypre_BoomerAMGRefineInterp \n"); + HYPRE_Int i, j, k, pp; hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); HYPRE_Real *A_diag_data = hypre_CSRMatrixData(A_diag); HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); @@ -1565,11 +1636,10 @@ hypre_BoomerAMGRefineInterp( hypre_ParCSRMatrix *A, HYPRE_Int use_alt_w, kk, kk_count, cur_spot; HYPRE_Int dist_coarse; - hypre_CSRMatrix *P_ext; - - HYPRE_Real *P_ext_data; - HYPRE_Int *P_ext_i; - HYPRE_BigInt *P_ext_j; + hypre_CSRMatrix *P_ext = NULL; + HYPRE_Real *P_ext_data = NULL; + HYPRE_Int *P_ext_i = NULL; + HYPRE_BigInt *P_ext_j = NULL; HYPRE_Int num_sends_A, index, start; HYPRE_Int myid = 0, num_procs = 1; @@ -1579,15 +1649,12 @@ hypre_BoomerAMGRefineInterp( hypre_ParCSRMatrix *A, HYPRE_Int *int_buf_data = NULL; HYPRE_BigInt *big_buf_data = NULL; - if (!comm_pkg_P) { - hypre_MatvecCommPkgCreate ( P ); + hypre_MatvecCommPkgCreate (P); comm_pkg_P = hypre_ParCSRMatrixCommPkg(P); - } - - comm = hypre_ParCSRCommPkgComm(comm_pkg_A); + comm = hypre_ParCSRCommPkgComm(comm_pkg_A); hypre_MPI_Comm_size(comm, &num_procs); hypre_MPI_Comm_rank(comm, &myid); @@ -1601,9 +1668,11 @@ hypre_BoomerAMGRefineInterp( hypre_ParCSRMatrix *A, P_CSR = hypre_ParCSRMatrixToCSRMatrixAll(P); if (!myid) { - hypre_sprintf(new_file,"%s.level.%d","P_new_orig", level ); - if (P_CSR) - hypre_CSRMatrixPrint(P_CSR, new_file); + hypre_sprintf(new_file, "%s.level.%d", "P_new_orig", level ); + if (P_CSR) + { + hypre_CSRMatrixPrint(P_CSR, new_file); + } } hypre_CSRMatrixDestroy(P_CSR); @@ -1612,9 +1681,11 @@ hypre_BoomerAMGRefineInterp( hypre_ParCSRMatrix *A, P_CSR = hypre_ParCSRMatrixToCSRMatrixAll(A); if (!myid) { - hypre_sprintf(new_file,"%s.level.%d","A", level ); + hypre_sprintf(new_file, "%s.level.%d", "A", level ); if (P_CSR) + { hypre_CSRMatrixPrint(P_CSR, new_file); + } } hypre_CSRMatrixDestroy(P_CSR); @@ -1626,14 +1697,14 @@ hypre_BoomerAMGRefineInterp( hypre_ParCSRMatrix *A, num_sends_A = hypre_ParCSRCommPkgNumSends(comm_pkg_A); big_buf_data = hypre_CTAlloc(HYPRE_BigInt, hypre_ParCSRCommPkgSendMapStart(comm_pkg_A, - num_sends_A), HYPRE_MEMORY_HOST); + num_sends_A), HYPRE_MEMORY_HOST); int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg_A, - num_sends_A), HYPRE_MEMORY_HOST); + num_sends_A), HYPRE_MEMORY_HOST); -/*----------------------------------------------------------------------- - * Send and receive fine_to_coarse info. - *-----------------------------------------------------------------------*/ + /*----------------------------------------------------------------------- + * Send and receive fine_to_coarse info. + *-----------------------------------------------------------------------*/ { HYPRE_BigInt my_first_cpt; HYPRE_Int tmp_i; @@ -1642,10 +1713,10 @@ hypre_BoomerAMGRefineInterp( hypre_ParCSRMatrix *A, /* need a fine-to-coarse mapping (num row P = num rows A)*/ fine_to_coarse = hypre_CTAlloc(HYPRE_Int, num_rows_P, HYPRE_MEMORY_HOST); - for (i = 0; i < num_rows_P; i++) fine_to_coarse[i] = -1; + for (i = 0; i < num_rows_P; i++) { fine_to_coarse[i] = -1; } coarse_counter = 0; - for (i=0; i < num_rows_P; i++) + for (i = 0; i < num_rows_P; i++) { if (CF_marker[i] >= 0) { @@ -1661,10 +1732,10 @@ hypre_BoomerAMGRefineInterp( hypre_ParCSRMatrix *A, for (i = 0; i < num_sends_A; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg_A, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg_A, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg_A, i + 1); j++) { - tmp_i = fine_to_coarse[hypre_ParCSRCommPkgSendMapElmt(comm_pkg_A,j)]; + tmp_i = fine_to_coarse[hypre_ParCSRCommPkgSendMapElmt(comm_pkg_A, j)]; big_buf_data[index++] = (HYPRE_BigInt)tmp_i + my_first_cpt; /* makes it global */ } @@ -1684,18 +1755,22 @@ hypre_BoomerAMGRefineInterp( hypre_ParCSRMatrix *A, { if (num_cols_A_offd) + { CF_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); + } if (num_functions > 1 && num_cols_A_offd) + { dof_func_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); + } index = 0; for (i = 0; i < num_sends_A; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg_A, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg_A, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg_A, i + 1); j++) { - int_buf_data[index++] = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg_A,j)]; + int_buf_data[index++] = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg_A, j)]; } } @@ -1710,10 +1785,10 @@ hypre_BoomerAMGRefineInterp( hypre_ParCSRMatrix *A, for (i = 0; i < num_sends_A; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg_A, i); - for (j=start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg_A, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg_A, i + 1); j++) { int_buf_data[index++] - = dof_func[hypre_ParCSRCommPkgSendMapElmt(comm_pkg_A,j)]; + = dof_func[hypre_ParCSRCommPkgSendMapElmt(comm_pkg_A, j)]; } } @@ -1740,7 +1815,7 @@ hypre_BoomerAMGRefineInterp( hypre_ParCSRMatrix *A, { /* need the rows of P on other processors associated with the offd cols of A */ - P_ext = hypre_ParCSRMatrixExtractBExt(P,A,1); + P_ext = hypre_ParCSRMatrixExtractBExt(P, A, 1); P_ext_i = hypre_CSRMatrixI(P_ext); P_ext_j = hypre_CSRMatrixBigJ(P_ext); P_ext_data = hypre_CSRMatrixData(P_ext); @@ -1748,9 +1823,9 @@ hypre_BoomerAMGRefineInterp( hypre_ParCSRMatrix *A, index = 0; /* now check whether each col is in the diag of offd part of P)*/ - for (i=0; i < num_cols_A_offd; i++) + for (i = 0; i < num_cols_A_offd; i++) { - for (j=P_ext_i[i]; j < P_ext_i[i+1]; j++) + for (j = P_ext_i[i]; j < P_ext_i[i + 1]; j++) { big_k = P_ext_j[j]; /* is it in the diag ?*/ @@ -1762,12 +1837,12 @@ hypre_BoomerAMGRefineInterp( hypre_ParCSRMatrix *A, else { /* off diag entry */ - kc = hypre_BigBinarySearch(col_map_offd_P, big_k ,num_cols_P_offd); + kc = hypre_BigBinarySearch(col_map_offd_P, big_k, num_cols_P_offd); /* now this corresponds to the location in the col_map_offd ( so it is a local column number */ if (kc > -1) { - P_ext_j[index] = (HYPRE_BigInt)(-kc-1); /* make negative */ + P_ext_j[index] = (HYPRE_BigInt)(-kc - 1); /* make negative */ P_ext_data[index++] = P_ext_data[j]; } } @@ -1775,537 +1850,546 @@ hypre_BoomerAMGRefineInterp( hypre_ParCSRMatrix *A, P_ext_i[i] = index; } for (i = num_cols_A_offd; i > 0; i--) - P_ext_i[i] = P_ext_i[i-1]; + { + P_ext_i[i] = P_ext_i[i - 1]; + } - if (num_procs > 1) P_ext_i[0] = 0; + if (num_procs > 1) { P_ext_i[0] = 0; } } /* end of ghost rows */ - /* initialized to zero */ - P_diag_data_new = hypre_CTAlloc(HYPRE_Real, P_diag_size, HYPRE_MEMORY_DEVICE); - P_offd_data_new = hypre_CTAlloc(HYPRE_Real, P_offd_size, HYPRE_MEMORY_DEVICE); - - j_diag_pos = 0; - j_offd_pos = 0; - - /*------------------------------------------------------------------- - *loop through rows - *-------------------------------------------------------------------*/ - for (i=0; i < num_rows_P; i++) - { - new_row_sum = 0.0; - use_alt_w = 0; - scale_row = 0; - orig_row_sum = 0.0; - - fcn_num = (HYPRE_Int) fmod(i, num_functions); - if (fcn_num != dof_func[i]) - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"WARNING - ROWS incorrectly ordered in hypre_BoomerAMGRefineInterp!\n"); - - /* number of elements in row of p*/ - orig_diag_start = P_diag_i[i]; - orig_offd_start = P_offd_i[i]; - - /* number of elements in row */ - p_num_diag_elements = P_diag_i[i+1] - orig_diag_start; - p_num_offd_elements = P_offd_i[i+1] - orig_offd_start; - - if (CF_marker[i] >= 0) /* row corres. to coarse point - just copy orig */ - { - /* diag */ - for (j=0; j < p_num_diag_elements; j++) - { - P_diag_data_new[j_diag_pos++] = P_diag_data[orig_diag_start + j]; - } - /*offd */ - for (j=0; j < p_num_offd_elements; j++) - { - P_offd_data_new[j_offd_pos++] = P_offd_data[orig_offd_start + j]; - } - } - else /* row is for fine point - make new interpolation*/ - { - /* make orig entries zero*/ - for (j=0; j < p_num_diag_elements; j++) - { - orig_row_sum += P_diag_data[orig_diag_start + j]; - P_diag_data_new[j_diag_pos++] = 0.0; - } - for (j=0; j < p_num_offd_elements; j++) - { - orig_row_sum += P_offd_data[orig_offd_start + j]; - P_offd_data_new[j_offd_pos++] = 0.0; - } - - /*get diagonal of A */ - diagonal = A_diag_data[A_diag_i[i]]; - - /* loop over elements in row i of A (except diagonal element)*/ - /* diag*/ - for (j = A_diag_i[i]+1; j < A_diag_i[i+1]; j++) - { - j_point = A_diag_j[j]; - - /* only want like unknowns */ - if (fcn_num != dof_func[j_point]) - continue; - - dist_coarse = 0; - a_ij = A_diag_data[j]; - - found = 0; - if (CF_marker[j_point] >= 0) /*coarse*/ - { - j_point_c = fine_to_coarse[j_point]; - - /* find P(i,j_c) and put value there (there may not be - an entry in P if this coarse connection was not a - strong connection */ - - /* we are looping in the diag of this row, so we only - * need to look in P_diag */ - for (k = P_diag_i[i]; k < P_diag_i[i+1]; k ++) - { - if (P_diag_j[k] == j_point_c) - { - P_diag_data_new[k] += a_ij; - found = 1; - break; - } - } - if (!found) - { - /*this is a weakly connected c-point - does - not contribute - so no error - but this messes up row sum*/ - /* we need to distribute this */ - dist_coarse = 1; - } - } - else /*fine connection */ - { - - sum = 0.0; - - /*loop over diag and offd of row of P for j_point and - get the sum of the connections to c-points of i - (diag and offd)*/ - /*diag*/ - for (pp = P_diag_i[j_point]; pp < P_diag_i[j_point+1]; pp++) - { - p_point = P_diag_j[pp];/* this is a coarse index */ - /* is p_point in row i also ? check the diag part*/ - for (k = P_diag_i[i]; k < P_diag_i[i+1]; k ++) - { - k_point = P_diag_j[k]; /* this is a coarse index */ - if (p_point == k_point) - { - /* add p_jk to sum */ - sum += P_diag_data[pp]; - - break; - } - }/* end loop k over row i */ - - } /* end loop pp over row j_point for diag */ - /* now offd */ - for (pp = P_offd_i[j_point]; pp < P_offd_i[j_point+1]; pp++) - { - p_point = P_offd_j[pp];/* this is a coarse index */ - /* is p_point in row i also ? check the offd part*/ - for (k = P_offd_i[i]; k < P_offd_i[i+1]; k ++) - { - k_point = P_offd_j[k]; /* this is a coarse index */ - if (p_point == k_point) - { - /* add p_jk to sum */ - sum += P_offd_data[pp]; - - break; - } - }/* end loop k over row i */ - - } /* end loop pp over row j_point */ - - if (fabs(sum) < 1e-12) - { - sum = 1.0; - use_alt_w = 1; - } - - if (use_alt_w) - { - /* distribute a_ij equally among coarse points */ - aw = a_ij/(p_num_diag_elements + p_num_offd_elements); - kk_count = 0; - /* loop through row i of orig p*/ - /* diag */ - for (kk = P_diag_i[i]; kk < P_diag_i[i+1]; kk++) - { - cur_spot = P_diag_i[i] + kk_count; - P_diag_data_new[cur_spot] += aw; - - kk_count++; - } - /* offd */ - kk_count = 0; - for (kk = P_offd_i[i]; kk < P_offd_i[i+1]; kk++) - { - cur_spot = P_offd_i[i] + kk_count; - P_offd_data_new[cur_spot] += aw; - - kk_count++; - } - /* did each element of p */ - - /* skip out to next jj of A */ - continue; - - }/* end of alt w */ - - /* Now we need to do the distributing */ - - /* loop through row i (diag and offd )of p*/ - /* first diag part */ - for (k = P_diag_i[i]; k < P_diag_i[i+1]; k ++) - { - k_point = P_diag_j[k]; /* this is a coarse index */ - /* now is there an entry for P(j_point, k_point)? - - need to look through row j_point (on -proc since - j came from A_diag */ - for (pp = P_diag_i[j_point]; pp < P_diag_i[j_point+1]; pp++) - { - if (P_diag_j[pp] == k_point) - { - /* a_ij*w_jk */ - aw = a_ij*P_diag_data[pp]; - aw = aw/sum; - - P_diag_data_new[k] += aw; - break; - } - } /* end loop pp over row j_point */ - } /* end loop k over diag row i of P */ - for (k = P_offd_i[i]; k < P_offd_i[i+1]; k ++) - { - k_point = P_offd_j[k]; /* this is a coarse index */ - /* now is there an entry for P(j_point, k_point)? - - need to look through offd part of row j_point - (this is on -proc since j came from A_diag */ - for (pp = P_offd_i[j_point]; pp < P_offd_i[j_point+1]; pp++) - { - if (P_offd_j[pp] == k_point) - { - /* a_ij*w_jk */ - aw = a_ij*P_offd_data[pp]; - aw = aw/sum; - - P_offd_data_new[k] += aw; - break; - } - } /* end loop pp over row j_point */ - } /* end loop k over row i of P */ - - } /* end of fine connection in row of A*/ - - if (dist_coarse) - { - /* coarse not in orig interp.(weakly connected) */ - /* distribute a_ij equally among coarse points */ - aw = a_ij/(p_num_diag_elements + p_num_offd_elements); - kk_count = 0; - /* loop through row i of orig p*/ - for (kk = P_diag_i[i]; kk < P_diag_i[i+1]; kk++) - { - cur_spot = P_diag_i[i] + kk_count; - P_diag_data_new[cur_spot] += aw; - - kk_count++; - } - kk_count = 0; - for (kk = P_offd_i[i]; kk < P_offd_i[i+1]; kk++) - { - cur_spot = P_offd_i[i] + kk_count; - P_offd_data_new[cur_spot] += aw; - - kk_count++; - } - } - - }/* end loop j over row i of A_diag */ - - /* loop over offd of A */ + /* initialized to zero */ + P_diag_data_new = hypre_CTAlloc(HYPRE_Real, P_diag_size, memory_location); + P_offd_data_new = hypre_CTAlloc(HYPRE_Real, P_offd_size, memory_location); + + j_diag_pos = 0; + j_offd_pos = 0; + + /*------------------------------------------------------------------- + *loop through rows + *-------------------------------------------------------------------*/ + for (i = 0; i < num_rows_P; i++) + { + new_row_sum = 0.0; + use_alt_w = 0; + scale_row = 0; + orig_row_sum = 0.0; + + fcn_num = (HYPRE_Int) fmod(i, num_functions); + if (fcn_num != dof_func[i]) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "WARNING - ROWS incorrectly ordered in hypre_BoomerAMGRefineInterp!\n"); + } + + /* number of elements in row of p*/ + orig_diag_start = P_diag_i[i]; + orig_offd_start = P_offd_i[i]; + + /* number of elements in row */ + p_num_diag_elements = P_diag_i[i + 1] - orig_diag_start; + p_num_offd_elements = P_offd_i[i + 1] - orig_offd_start; + + if (CF_marker[i] >= 0) /* row corres. to coarse point - just copy orig */ + { + /* diag */ + for (j = 0; j < p_num_diag_elements; j++) + { + P_diag_data_new[j_diag_pos++] = P_diag_data[orig_diag_start + j]; + } + /*offd */ + for (j = 0; j < p_num_offd_elements; j++) + { + P_offd_data_new[j_offd_pos++] = P_offd_data[orig_offd_start + j]; + } + } + else /* row is for fine point - make new interpolation*/ + { + /* make orig entries zero*/ + for (j = 0; j < p_num_diag_elements; j++) + { + orig_row_sum += P_diag_data[orig_diag_start + j]; + P_diag_data_new[j_diag_pos++] = 0.0; + } + for (j = 0; j < p_num_offd_elements; j++) + { + orig_row_sum += P_offd_data[orig_offd_start + j]; + P_offd_data_new[j_offd_pos++] = 0.0; + } + + /*get diagonal of A */ + diagonal = A_diag_data[A_diag_i[i]]; + + /* loop over elements in row i of A (except diagonal element)*/ + /* diag*/ + for (j = A_diag_i[i] + 1; j < A_diag_i[i + 1]; j++) + { + j_point = A_diag_j[j]; + + /* only want like unknowns */ + if (fcn_num != dof_func[j_point]) + { + continue; + } + + dist_coarse = 0; + a_ij = A_diag_data[j]; + + found = 0; + if (CF_marker[j_point] >= 0) /*coarse*/ + { + j_point_c = fine_to_coarse[j_point]; + + /* find P(i,j_c) and put value there (there may not be + an entry in P if this coarse connection was not a + strong connection */ + + /* we are looping in the diag of this row, so we only + * need to look in P_diag */ + for (k = P_diag_i[i]; k < P_diag_i[i + 1]; k ++) + { + if (P_diag_j[k] == j_point_c) + { + P_diag_data_new[k] += a_ij; + found = 1; + break; + } + } + if (!found) + { + /*this is a weakly connected c-point - does + not contribute - so no error - but this messes up row sum*/ + /* we need to distribute this */ + dist_coarse = 1; + } + } + else /*fine connection */ + { + + sum = 0.0; + + /*loop over diag and offd of row of P for j_point and + get the sum of the connections to c-points of i + (diag and offd)*/ + /*diag*/ + for (pp = P_diag_i[j_point]; pp < P_diag_i[j_point + 1]; pp++) + { + p_point = P_diag_j[pp];/* this is a coarse index */ + /* is p_point in row i also ? check the diag part*/ + for (k = P_diag_i[i]; k < P_diag_i[i + 1]; k ++) + { + k_point = P_diag_j[k]; /* this is a coarse index */ + if (p_point == k_point) + { + /* add p_jk to sum */ + sum += P_diag_data[pp]; + + break; + } + }/* end loop k over row i */ + + } /* end loop pp over row j_point for diag */ + /* now offd */ + for (pp = P_offd_i[j_point]; pp < P_offd_i[j_point + 1]; pp++) + { + p_point = P_offd_j[pp];/* this is a coarse index */ + /* is p_point in row i also ? check the offd part*/ + for (k = P_offd_i[i]; k < P_offd_i[i + 1]; k ++) + { + k_point = P_offd_j[k]; /* this is a coarse index */ + if (p_point == k_point) + { + /* add p_jk to sum */ + sum += P_offd_data[pp]; + + break; + } + }/* end loop k over row i */ + + } /* end loop pp over row j_point */ + + if (hypre_abs(sum) < 1e-12) + { + sum = 1.0; + use_alt_w = 1; + } + + if (use_alt_w) + { + /* distribute a_ij equally among coarse points */ + aw = a_ij / (p_num_diag_elements + p_num_offd_elements); + kk_count = 0; + /* loop through row i of orig p*/ + /* diag */ + for (kk = P_diag_i[i]; kk < P_diag_i[i + 1]; kk++) + { + cur_spot = P_diag_i[i] + kk_count; + P_diag_data_new[cur_spot] += aw; + + kk_count++; + } + /* offd */ + kk_count = 0; + for (kk = P_offd_i[i]; kk < P_offd_i[i + 1]; kk++) + { + cur_spot = P_offd_i[i] + kk_count; + P_offd_data_new[cur_spot] += aw; + + kk_count++; + } + /* did each element of p */ + + /* skip out to next jj of A */ + continue; + + }/* end of alt w */ + + /* Now we need to do the distributing */ + + /* loop through row i (diag and offd )of p*/ + /* first diag part */ + for (k = P_diag_i[i]; k < P_diag_i[i + 1]; k ++) + { + k_point = P_diag_j[k]; /* this is a coarse index */ + /* now is there an entry for P(j_point, k_point)? + - need to look through row j_point (on -proc since + j came from A_diag */ + for (pp = P_diag_i[j_point]; pp < P_diag_i[j_point + 1]; pp++) + { + if (P_diag_j[pp] == k_point) + { + /* a_ij*w_jk */ + aw = a_ij * P_diag_data[pp]; + aw = aw / sum; + + P_diag_data_new[k] += aw; + break; + } + } /* end loop pp over row j_point */ + } /* end loop k over diag row i of P */ + for (k = P_offd_i[i]; k < P_offd_i[i + 1]; k ++) + { + k_point = P_offd_j[k]; /* this is a coarse index */ + /* now is there an entry for P(j_point, k_point)? + - need to look through offd part of row j_point + (this is on -proc since j came from A_diag */ + for (pp = P_offd_i[j_point]; pp < P_offd_i[j_point + 1]; pp++) + { + if (P_offd_j[pp] == k_point) + { + /* a_ij*w_jk */ + aw = a_ij * P_offd_data[pp]; + aw = aw / sum; + + P_offd_data_new[k] += aw; + break; + } + } /* end loop pp over row j_point */ + } /* end loop k over row i of P */ + + } /* end of fine connection in row of A*/ + + if (dist_coarse) + { + /* coarse not in orig interp.(weakly connected) */ + /* distribute a_ij equally among coarse points */ + aw = a_ij / (p_num_diag_elements + p_num_offd_elements); + kk_count = 0; + /* loop through row i of orig p*/ + for (kk = P_diag_i[i]; kk < P_diag_i[i + 1]; kk++) + { + cur_spot = P_diag_i[i] + kk_count; + P_diag_data_new[cur_spot] += aw; + + kk_count++; + } + kk_count = 0; + for (kk = P_offd_i[i]; kk < P_offd_i[i + 1]; kk++) + { + cur_spot = P_offd_i[i] + kk_count; + P_offd_data_new[cur_spot] += aw; + + kk_count++; + } + } + + }/* end loop j over row i of A_diag */ + + /* loop over offd of A */ /* loop over elements in row i of A_offd )*/ - for (j = A_offd_i[i]; j < A_offd_i[i+1]; j++) - { - j_point = A_offd_j[j]; - - /* only want like unknowns - check the offd dof func*/ - if (fcn_num != dof_func_offd[j_point]) - continue; - - dist_coarse = 0; - a_ij = A_offd_data[j]; - - found = 0; - - if (CF_marker_offd[j_point] >= 0) /*check the offd marker*/ - { - /* coarse */ - big_j_point_c = fine_to_coarse_offd[j_point]; /* now its global!! */ - - /* find P(i,j_c) and put value there (there may not be - an entry in P if this coarse connection was not a - strong connection */ - - /* we are looping in the off diag of this row, so we only - * need to look in P_offd */ - for (k = P_offd_i[i]; k < P_offd_i[i+1]; k ++) - { - index = P_offd_j[k]; /* local number */ - big_index = col_map_offd_P[index]; /*global number + for (j = A_offd_i[i]; j < A_offd_i[i + 1]; j++) + { + j_point = A_offd_j[j]; + + /* only want like unknowns - check the offd dof func*/ + if (fcn_num != dof_func_offd[j_point]) + { + continue; + } + + dist_coarse = 0; + a_ij = A_offd_data[j]; + + found = 0; + + if (CF_marker_offd[j_point] >= 0) /*check the offd marker*/ + { + /* coarse */ + big_j_point_c = fine_to_coarse_offd[j_point]; /* now its global!! */ + + /* find P(i,j_c) and put value there (there may not be + an entry in P if this coarse connection was not a + strong connection */ + + /* we are looping in the off diag of this row, so we only + * need to look in P_offd */ + for (k = P_offd_i[i]; k < P_offd_i[i + 1]; k ++) + { + index = P_offd_j[k]; /* local number */ + big_index = col_map_offd_P[index]; /*global number * (becuz j_point_c * is global */ - /* if (P_offd_j[k] == j_point_c)*/ - if (big_index == big_j_point_c) - { - P_offd_data_new[k] += a_ij; - found = 1; - break; - } - } - if (!found) - { - /*this is a weakly connected c-point - does - not contribute - so no error - but this messes up row sum*/ - /* we need to distribute this */ - dist_coarse = 1; - } - } - else /*fine connection */ - { - - sum = 0.0; - - /*loop over row of P for j_point and get the sum of - the connections to c-points of i (diag and offd) - - now the row for j_point is on another processor - - and j_point is an index of A - need to convert it to - corresponding index of P */ - - /* j_point is an index of A_off d - so */ - /* now this is the row in P, but these are stored in - * P_ext according to offd of A */ - j_ext_index = j_point; - - for (pp = P_ext_i[j_ext_index]; pp < P_ext_i[j_ext_index+1]; pp++) - { - p_point = (HYPRE_Int)P_ext_j[pp];/* this is a coarse index */ - /* is p_point in row i of P also ? check the diag and - offd part or row i of P */ - - if (p_point > -1) /* in diag part */ - { - for (k = P_diag_i[i]; k < P_diag_i[i+1]; k ++) - { - k_point = P_diag_j[k]; /* this is a coarse index */ - if (p_point == k_point) - { - /* add p_jk to sum */ - sum += P_ext_data[pp]; - - break; - } - }/* end loop k over row i */ - } - else /* in offd diag part */ - { - p_point = -p_point-1; - /* p_point is a local col number for P now */ - for (k = P_offd_i[i]; k < P_offd_i[i+1]; k ++) - { - k_point = P_offd_j[k]; /* this is a coarse index */ - if (p_point == k_point) - { - /* add p_jk to sum */ - sum += P_ext_data[pp]; - - break; - } - }/* end loop k over row i */ - }/* end diag or offd */ - }/* end loop over row P for j_point */ - - if (fabs(sum) < 1e-12) - { - sum = 1.0; - use_alt_w = 1; - } - - if (use_alt_w) - { - /* distribute a_ij equally among coarse points */ - aw = a_ij/(p_num_diag_elements + p_num_offd_elements); - kk_count = 0; - /* loop through row i of orig p*/ - /* diag */ - for (kk = P_diag_i[i]; kk < P_diag_i[i+1]; kk++) - { - cur_spot = P_diag_i[i] + kk_count; - P_diag_data_new[cur_spot] += aw; - - kk_count++; - } - /* offd */ - kk_count = 0; - for (kk = P_offd_i[i]; kk < P_offd_i[i+1]; kk++) - { - cur_spot = P_offd_i[i] + kk_count; - P_offd_data_new[cur_spot] += aw; - - kk_count++; - } - /* did each element of p */ - - /* skip out to next jj of A */ - continue; - - }/* end of alt w */ - - /* Now we need to do the distributing */ - - /* loop through row i (diag and offd )of p*/ - /* first diag part */ - for (k = P_diag_i[i]; k < P_diag_i[i+1]; k ++) - { - k_point = P_diag_j[k]; /* this is a coarse index */ - /* now is there an entry for P(j_point, k_point)? - - need to look through row j_point - this will - be off-proc */ - - for (pp = P_ext_i[j_ext_index]; pp < P_ext_i[j_ext_index+1]; pp++) - { - p_point = (HYPRE_Int)P_ext_j[pp]; - if (p_point > -1) /* diag part */ - { - if (p_point == k_point) - { - /* a_ij*w_jk */ - aw = a_ij*P_ext_data[pp]; - aw = aw/sum; - - P_diag_data_new[k] += aw; - break; - } - } - - } /* end loop pp over row j_point */ - } /* end loop k over diag row i of P */ - for (k = P_offd_i[i]; k < P_offd_i[i+1]; k ++) - { - k_point = P_offd_j[k]; /* this is a coarse index */ - /* now is there an entry for P(j_point, k_point)? + /* if (P_offd_j[k] == j_point_c)*/ + if (big_index == big_j_point_c) + { + P_offd_data_new[k] += a_ij; + found = 1; + break; + } + } + if (!found) + { + /*this is a weakly connected c-point - does + not contribute - so no error - but this messes up row sum*/ + /* we need to distribute this */ + dist_coarse = 1; + } + } + else /*fine connection */ + { + + sum = 0.0; + + /*loop over row of P for j_point and get the sum of + the connections to c-points of i (diag and offd) - + now the row for j_point is on another processor - + and j_point is an index of A - need to convert it to + corresponding index of P */ + + /* j_point is an index of A_off d - so */ + /* now this is the row in P, but these are stored in + * P_ext according to offd of A */ + j_ext_index = j_point; + + for (pp = P_ext_i[j_ext_index]; pp < P_ext_i[j_ext_index + 1]; pp++) + { + p_point = (HYPRE_Int)P_ext_j[pp];/* this is a coarse index */ + /* is p_point in row i of P also ? check the diag and + offd part or row i of P */ + + if (p_point > -1) /* in diag part */ + { + for (k = P_diag_i[i]; k < P_diag_i[i + 1]; k ++) + { + k_point = P_diag_j[k]; /* this is a coarse index */ + if (p_point == k_point) + { + /* add p_jk to sum */ + sum += P_ext_data[pp]; + + break; + } + }/* end loop k over row i */ + } + else /* in offd diag part */ + { + p_point = -p_point - 1; + /* p_point is a local col number for P now */ + for (k = P_offd_i[i]; k < P_offd_i[i + 1]; k ++) + { + k_point = P_offd_j[k]; /* this is a coarse index */ + if (p_point == k_point) + { + /* add p_jk to sum */ + sum += P_ext_data[pp]; + + break; + } + }/* end loop k over row i */ + }/* end diag or offd */ + }/* end loop over row P for j_point */ + + if (hypre_abs(sum) < 1e-12) + { + sum = 1.0; + use_alt_w = 1; + } + + if (use_alt_w) + { + /* distribute a_ij equally among coarse points */ + aw = a_ij / (p_num_diag_elements + p_num_offd_elements); + kk_count = 0; + /* loop through row i of orig p*/ + /* diag */ + for (kk = P_diag_i[i]; kk < P_diag_i[i + 1]; kk++) + { + cur_spot = P_diag_i[i] + kk_count; + P_diag_data_new[cur_spot] += aw; + + kk_count++; + } + /* offd */ + kk_count = 0; + for (kk = P_offd_i[i]; kk < P_offd_i[i + 1]; kk++) + { + cur_spot = P_offd_i[i] + kk_count; + P_offd_data_new[cur_spot] += aw; + + kk_count++; + } + /* did each element of p */ + + /* skip out to next jj of A */ + continue; + + }/* end of alt w */ + + /* Now we need to do the distributing */ + + /* loop through row i (diag and offd )of p*/ + /* first diag part */ + for (k = P_diag_i[i]; k < P_diag_i[i + 1]; k ++) + { + k_point = P_diag_j[k]; /* this is a coarse index */ + /* now is there an entry for P(j_point, k_point)? - need to look through row j_point - this will - be off-proc */ - for (pp = P_ext_i[j_ext_index]; pp < P_ext_i[j_ext_index+1]; pp++) - { - p_point = (HYPRE_Int) P_ext_j[pp]; - if (p_point < 0) /* in offd part */ - { - p_point = - p_point - 1; - if (p_point == k_point) - { - /* a_ij*w_jk */ - aw = a_ij*P_ext_data[pp]; - aw = aw/sum; + be off-proc */ + + for (pp = P_ext_i[j_ext_index]; pp < P_ext_i[j_ext_index + 1]; pp++) + { + p_point = (HYPRE_Int) P_ext_j[pp]; + if (p_point > -1) /* diag part */ + { + if (p_point == k_point) + { + /* a_ij*w_jk */ + aw = a_ij * P_ext_data[pp]; + aw = aw / sum; + + P_diag_data_new[k] += aw; + break; + } + } - P_offd_data_new[k] += aw; - break; - } - } + } /* end loop pp over row j_point */ + } /* end loop k over diag row i of P */ + for (k = P_offd_i[i]; k < P_offd_i[i + 1]; k ++) + { + k_point = P_offd_j[k]; /* this is a coarse index */ + /* now is there an entry for P(j_point, k_point)? + - need to look through row j_point - this will + be off-proc */ + for (pp = P_ext_i[j_ext_index]; pp < P_ext_i[j_ext_index + 1]; pp++) + { + p_point = (HYPRE_Int) P_ext_j[pp]; + if (p_point < 0) /* in offd part */ + { + p_point = - p_point - 1; + if (p_point == k_point) + { + /* a_ij*w_jk */ + aw = a_ij * P_ext_data[pp]; + aw = aw / sum; + + P_offd_data_new[k] += aw; + break; + } + } - } /* end loop pp over row j_point */ + } /* end loop pp over row j_point */ - } /* end loop k over row i of P */ + } /* end loop k over row i of P */ - } /* end of fine connection in row of A*/ + } /* end of fine connection in row of A*/ - if (dist_coarse) - { - /* coarse not in orig interp.(weakly connected) */ - /* distribute a_ij equally among coarse points */ - aw = a_ij/(p_num_diag_elements + p_num_offd_elements); - kk_count = 0; - /* loop through row i of orig p*/ - for (kk = P_diag_i[i]; kk < P_diag_i[i+1]; kk++) - { - cur_spot = P_diag_i[i] + kk_count; - P_diag_data_new[cur_spot] += aw; + if (dist_coarse) + { + /* coarse not in orig interp.(weakly connected) */ + /* distribute a_ij equally among coarse points */ + aw = a_ij / (p_num_diag_elements + p_num_offd_elements); + kk_count = 0; + /* loop through row i of orig p*/ + for (kk = P_diag_i[i]; kk < P_diag_i[i + 1]; kk++) + { + cur_spot = P_diag_i[i] + kk_count; + P_diag_data_new[cur_spot] += aw; - kk_count++; - } - kk_count = 0; - for (kk = P_offd_i[i]; kk < P_offd_i[i+1]; kk++) - { - cur_spot = P_offd_i[i] + kk_count; - P_offd_data_new[cur_spot] += aw; + kk_count++; + } + kk_count = 0; + for (kk = P_offd_i[i]; kk < P_offd_i[i + 1]; kk++) + { + cur_spot = P_offd_i[i] + kk_count; + P_offd_data_new[cur_spot] += aw; - kk_count++; - } - } + kk_count++; + } + } - }/* end loop j over row i of A_offd */ + }/* end loop j over row i of A_offd */ - /* now divide by the diagonal and we are finished with this row!*/ - if (fabs(diagonal) > 0.0) - { - for (k = P_diag_i[i] ; k < P_diag_i[i+1]; k++) - { - P_diag_data_new[k] /= -(diagonal); - new_row_sum += P_diag_data_new[k]; + /* now divide by the diagonal and we are finished with this row!*/ + if (hypre_abs(diagonal) > 0.0) + { + for (k = P_diag_i[i] ; k < P_diag_i[i + 1]; k++) + { + P_diag_data_new[k] /= -(diagonal); + new_row_sum += P_diag_data_new[k]; - } - for (k = P_offd_i[i] ; k < P_offd_i[i+1]; k++) - { - P_offd_data_new[k] /= -(diagonal); - new_row_sum += P_offd_data_new[k]; + } + for (k = P_offd_i[i] ; k < P_offd_i[i + 1]; k++) + { + P_offd_data_new[k] /= -(diagonal); + new_row_sum += P_offd_data_new[k]; - } + } - /* now re-scale */ - if (scale_row) - { + /* now re-scale */ + if (scale_row) + { - for (k = P_diag_i[i] ; k < P_diag_i[i+1]; k++) - { - P_diag_data_new[k] *= (orig_row_sum/new_row_sum); + for (k = P_diag_i[i] ; k < P_diag_i[i + 1]; k++) + { + P_diag_data_new[k] *= (orig_row_sum / new_row_sum); - } - for (k = P_offd_i[i] ; k < P_offd_i[i+1]; k++) - { - P_offd_data_new[k] *= (orig_row_sum/new_row_sum); + } + for (k = P_offd_i[i] ; k < P_offd_i[i + 1]; k++) + { + P_offd_data_new[k] *= (orig_row_sum / new_row_sum); - } + } - } + } - } + } - } /* end of row of P is fine point - build interp */ + } /* end of row of P is fine point - build interp */ - } /* end of i loop throw rows */ + } /* end of i loop throw rows */ - /* modify P - only need to replace the data (i and j are the same)*/ - hypre_TFree(P_diag_data, memory_location); - hypre_TFree(P_offd_data, memory_location); + /* modify P - only need to replace the data (i and j are the same)*/ + hypre_TFree(P_diag_data, memory_location); + hypre_TFree(P_offd_data, memory_location); - hypre_CSRMatrixData(P_diag) = P_diag_data_new; - hypre_CSRMatrixData(P_offd) = P_offd_data_new; + hypre_CSRMatrixData(P_diag) = P_diag_data_new; + hypre_CSRMatrixData(P_offd) = P_offd_data_new; #if SV_DEBUG @@ -2317,9 +2401,11 @@ hypre_BoomerAMGRefineInterp( hypre_ParCSRMatrix *A, if (!myid) { - hypre_sprintf(new_file,"%s.level.%d","P_new_new", level ); + hypre_sprintf(new_file, "%s.level.%d", "P_new_new", level ); if (P_CSR) + { hypre_CSRMatrixPrint(P_CSR, new_file); + } } hypre_CSRMatrixDestroy(P_CSR); @@ -2327,15 +2413,14 @@ hypre_BoomerAMGRefineInterp( hypre_ParCSRMatrix *A, #endif - /* clean up */ - hypre_TFree(CF_marker_offd, HYPRE_MEMORY_HOST); - hypre_TFree(dof_func_offd, HYPRE_MEMORY_HOST); - hypre_TFree(fine_to_coarse, HYPRE_MEMORY_HOST); - hypre_TFree(fine_to_coarse_offd, HYPRE_MEMORY_HOST); - hypre_TFree(int_buf_data, HYPRE_MEMORY_HOST); - hypre_TFree(big_buf_data, HYPRE_MEMORY_HOST); - - if (num_procs > 1) hypre_CSRMatrixDestroy(P_ext); + /* clean up */ + hypre_TFree(CF_marker_offd, HYPRE_MEMORY_HOST); + hypre_TFree(dof_func_offd, HYPRE_MEMORY_HOST); + hypre_TFree(fine_to_coarse, HYPRE_MEMORY_HOST); + hypre_TFree(fine_to_coarse_offd, HYPRE_MEMORY_HOST); + hypre_TFree(int_buf_data, HYPRE_MEMORY_HOST); + hypre_TFree(big_buf_data, HYPRE_MEMORY_HOST); + hypre_CSRMatrixDestroy(P_ext); - return hypre_error_flag; + return hypre_error_flag; } diff --git a/external/hypre/src/parcsr_ls/par_sv_interp_ln.c b/external/hypre/src/parcsr_ls/par_sv_interp_ln.c index c0d5288b..336fd2e2 100644 --- a/external/hypre/src/parcsr_ls/par_sv_interp_ln.c +++ b/external/hypre/src/parcsr_ls/par_sv_interp_ln.c @@ -1,7 +1,7 @@ /****************************************************************************** *dof_func_ptr = dof_func; - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -31,21 +31,21 @@ ******************************************************************************/ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, - hypre_ParCSRMatrix **P, - HYPRE_BigInt *num_cpts_global, - HYPRE_Int *nf, - HYPRE_Int *dof_func, - hypre_IntArray **coarse_dof_func, - HYPRE_Int *CF_marker, - HYPRE_Int level, - HYPRE_Real *weights, - HYPRE_Int num_smooth_vecs, - hypre_ParVector **smooth_vecs, - HYPRE_Real abs_trunc, HYPRE_Int q_max, - HYPRE_Int interp_vec_first_level ) + hypre_ParCSRMatrix **P, + HYPRE_BigInt *num_cpts_global, + HYPRE_Int *nf, + HYPRE_Int *dof_func, + hypre_IntArray **coarse_dof_func, + HYPRE_Int *CF_marker, + HYPRE_Int level, + HYPRE_Real *weights, + HYPRE_Int num_smooth_vecs, + hypre_ParVector **smooth_vecs, + HYPRE_Real abs_trunc, HYPRE_Int q_max, + HYPRE_Int interp_vec_first_level ) { - HYPRE_Int i,j, k,kk, pp, jj; + HYPRE_Int i, j, k, kk, pp, jj; hypre_ParCSRMatrix *new_P; @@ -83,7 +83,8 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, HYPRE_BigInt *new_col_map_offd_P = NULL; - HYPRE_Real orig_row_sum, new_row_sum, gm_row_sum; + /* HYPRE_Real orig_row_sum, new_row_sum; */ + HYPRE_Real gm_row_sum = 1.0; HYPRE_Int orig_diag_start, orig_offd_start, j_offd_pos, j_diag_pos; HYPRE_Int new_nnz_diag, new_nnz_offd; @@ -146,12 +147,12 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, HYPRE_Int *col_map; HYPRE_Int *coarse_to_fine; - HYPRE_BigInt *new_col_starts; + HYPRE_BigInt new_col_starts[2]; HYPRE_Real af_sum; HYPRE_Real theta_2D[] = {.5, .5}; - HYPRE_Real theta_3D[] = {1.0/3.0, 1.0/3.0, 1.0/3.0}; + HYPRE_Real theta_3D[] = {1.0 / 3.0, 1.0 / 3.0, 1.0 / 3.0}; HYPRE_Real *theta; @@ -168,16 +169,16 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, HYPRE_Int *dof_func_offd = NULL; HYPRE_BigInt *fine_to_coarse_offd; - hypre_CSRMatrix *P_ext; - HYPRE_Real *P_ext_data; - HYPRE_Int *P_ext_i; - HYPRE_BigInt *P_ext_j; + hypre_CSRMatrix *P_ext = NULL; + HYPRE_Real *P_ext_data = NULL; + HYPRE_Int *P_ext_i = NULL; + HYPRE_BigInt *P_ext_j = NULL; HYPRE_Int num_sends_A, index, start; HYPRE_Int myid = 0, num_procs = 1; /* truncation */ HYPRE_Int *is_q = NULL; - HYPRE_Int q_alloc= 0; + HYPRE_Int q_alloc = 0; HYPRE_BigInt *aux_j = NULL; HYPRE_Real *aux_data = NULL; HYPRE_Int *is_diag = NULL; @@ -193,19 +194,21 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, HYPRE_BigInt *big_buf_data = NULL; HYPRE_Real *dbl_buf_data = NULL; - HYPRE_Int g_nc; + HYPRE_BigInt g_nc; + + HYPRE_MemoryLocation memory_location_P = hypre_ParCSRMatrixMemoryLocation(A); #if SV_DEBUG { char new_file[80]; - hypre_sprintf(new_file,"%s.level.%d","P_orig", level); + hypre_sprintf(new_file, "%s.level.%d", "P_orig", level); hypre_ParCSRMatrixPrint(*P, new_file); - for (i=0; i < num_smooth_vecs; i++) + for (i = 0; i < num_smooth_vecs; i++) { - hypre_sprintf(new_file,"%s.%d.level.%d","smoothvec", i, level ); + hypre_sprintf(new_file, "%s.%d.level.%d", "smoothvec", i, level ); hypre_ParVectorPrint(smooth_vecs[i], new_file); } } @@ -233,23 +236,27 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, if (!myid) { - hypre_sprintf(new_file,"%s.level.%d","P_new_orig", level ); + hypre_sprintf(new_file, "%s.level.%d", "P_new_orig", level ); if (P_CSR) + { hypre_CSRMatrixPrint(P_CSR, new_file); + } } hypre_CSRMatrixDestroy(P_CSR); - for (i=0; i < num_smooth_vecs; i++) + for (i = 0; i < num_smooth_vecs; i++) { sv = hypre_ParVectorToVectorAll(smooth_vecs[i]); if (!myid) { - hypre_sprintf(new_file,"%s.%d.level.%d","smoothvec", i, level ); + hypre_sprintf(new_file, "%s.%d.level.%d", "smoothvec", i, level ); if (sv) + { hypre_SeqVectorPrint(sv, new_file); + } } hypre_SeqVectorDestroy(sv); @@ -259,9 +266,11 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, P_CSR = hypre_ParCSRMatrixToCSRMatrixAll(A); if (!myid) { - hypre_sprintf(new_file,"%s.level.%d","A", level ); + hypre_sprintf(new_file, "%s.level.%d", "A", level ); if (P_CSR) + { hypre_CSRMatrixPrint(P_CSR, new_file); + } } hypre_CSRMatrixDestroy(P_CSR); @@ -279,7 +288,7 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, nnz_offd = P_offd_size; /*number of coarse variables for each unknown */ - ncv_peru = ncv/num_functions; + ncv_peru = ncv / num_functions; if (level == interp_vec_first_level) { @@ -293,15 +302,19 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, /*orig_ncv = ncv - ncv_peru*num_smooth_vecs;*/ } - /*weights for P_s */ + /*weights for P_s */ if (modify) { if (weights == NULL) { if (orig_nf == 2) + { theta = theta_2D; + } else + { theta = theta_3D; + } } else { @@ -311,11 +324,12 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, /* for communication */ num_sends_A = hypre_ParCSRCommPkgNumSends(comm_pkg_A); - int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg_A, - num_sends_A), HYPRE_MEMORY_HOST); - big_buf_data = hypre_CTAlloc(HYPRE_BigInt, hypre_ParCSRCommPkgSendMapStart(comm_pkg_A, - num_sends_A), HYPRE_MEMORY_HOST); - + int_buf_data = hypre_CTAlloc(HYPRE_Int, + hypre_ParCSRCommPkgSendMapStart(comm_pkg_A, num_sends_A), + HYPRE_MEMORY_HOST); + big_buf_data = hypre_CTAlloc(HYPRE_BigInt, + hypre_ParCSRCommPkgSendMapStart(comm_pkg_A, num_sends_A), + HYPRE_MEMORY_HOST); /*----------------------------------------------------------------------- * create and send and receive fine_to_coarse info. @@ -325,17 +339,19 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, HYPRE_BigInt my_first_cpt; HYPRE_Int tmp_i; - my_first_cpt = num_cpts_global[0]; - /* create the fine to coarse and coarse to fine*/ - fine_to_coarse = hypre_CTAlloc(HYPRE_Int, num_rows_P, HYPRE_MEMORY_HOST); - for (i = 0; i < num_rows_P; i++) fine_to_coarse[i] = -1; + /* create the fine to coarse and coarse to fine */ + fine_to_coarse = hypre_CTAlloc(HYPRE_Int, num_rows_P, HYPRE_MEMORY_HOST); + for (i = 0; i < num_rows_P; i++) + { + fine_to_coarse[i] = -1; + } - coarse_to_fine = hypre_CTAlloc(HYPRE_Int, ncv, HYPRE_MEMORY_HOST); + coarse_to_fine = hypre_CTAlloc(HYPRE_Int, ncv, HYPRE_MEMORY_HOST); coarse_counter = 0; - for (i=0; i < num_rows_P; i++) + for (i = 0; i < num_rows_P; i++) { if (CF_marker[i] >= 0) { @@ -352,17 +368,15 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, for (i = 0; i < num_sends_A; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg_A, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg_A, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg_A, i + 1); j++) { - - tmp_i = fine_to_coarse[hypre_ParCSRCommPkgSendMapElmt(comm_pkg_A,j)]; + tmp_i = fine_to_coarse[hypre_ParCSRCommPkgSendMapElmt(comm_pkg_A, j)]; big_buf_data[index++] = (HYPRE_BigInt)tmp_i + my_first_cpt; /* makes it global*/ } - } - comm_handle = hypre_ParCSRCommHandleCreate( 21, comm_pkg_A, big_buf_data, - fine_to_coarse_offd); + comm_handle = hypre_ParCSRCommHandleCreate(21, comm_pkg_A, big_buf_data, + fine_to_coarse_offd); hypre_ParCSRCommHandleDestroy(comm_handle); } /* end fine to coarse {} */ @@ -371,25 +385,28 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, * Get the CF_marker data for the off-processor columns of A *-------------------------------------------------------------------*/ { - if (num_cols_A_offd) + { CF_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); + } if (num_functions > 1 && num_cols_A_offd) + { dof_func_offd = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); + } index = 0; for (i = 0; i < num_sends_A; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg_A, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg_A, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg_A, i + 1); j++) { - int_buf_data[index++] = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg_A,j)]; + int_buf_data[index++] = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg_A, j)]; } } - comm_handle = hypre_ParCSRCommHandleCreate( 11, comm_pkg_A, int_buf_data, - CF_marker_offd); + comm_handle = hypre_ParCSRCommHandleCreate(11, comm_pkg_A, int_buf_data, + CF_marker_offd); hypre_ParCSRCommHandleDestroy(comm_handle); if (num_functions > 1) @@ -398,15 +415,15 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, for (i = 0; i < num_sends_A; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg_A, i); - for (j=start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg_A, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg_A, i + 1); j++) { int_buf_data[index++] - = dof_func[hypre_ParCSRCommPkgSendMapElmt(comm_pkg_A,j)]; + = dof_func[hypre_ParCSRCommPkgSendMapElmt(comm_pkg_A, j)]; } } - comm_handle = hypre_ParCSRCommHandleCreate( 11, comm_pkg_A, int_buf_data, - dof_func_offd); + comm_handle = hypre_ParCSRCommHandleCreate(11, comm_pkg_A, int_buf_data, + dof_func_offd); hypre_ParCSRCommHandleDestroy(comm_handle); } @@ -416,17 +433,17 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, /*------------------------------------------------------------------- * Get the ghost rows of P *-------------------------------------------------------------------*/ - { + { HYPRE_Int kc; HYPRE_BigInt col_1 = hypre_ParCSRMatrixFirstColDiag(*P); - HYPRE_BigInt col_n = col_1 + (HYPRE_BigInt)hypre_CSRMatrixNumCols(P_diag); + HYPRE_BigInt col_n = col_1 + (HYPRE_BigInt) hypre_CSRMatrixNumCols(P_diag); if (num_procs > 1) { /* need the rows of P on other processors associated with the offd cols of A */ - P_ext = hypre_ParCSRMatrixExtractBExt(*P,A,1); + P_ext = hypre_ParCSRMatrixExtractBExt(*P, A, 1); P_ext_i = hypre_CSRMatrixI(P_ext); P_ext_j = hypre_CSRMatrixBigJ(P_ext); P_ext_data = hypre_CSRMatrixData(P_ext); @@ -434,9 +451,9 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, index = 0; /* now check whether each col is in the diag of offd part of P)*/ - for (i=0; i < num_cols_A_offd; i++) + for (i = 0; i < num_cols_A_offd; i++) { - for (j=P_ext_i[i]; j < P_ext_i[i+1]; j++) + for (j = P_ext_i[i]; j < P_ext_i[i + 1]; j++) { big_k = P_ext_j[j]; /* is it in the diag ?*/ @@ -448,12 +465,12 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, else { /* off diag entry */ - kc = hypre_BigBinarySearch(col_map_offd_P, big_k ,num_cols_P_offd); + kc = hypre_BigBinarySearch(col_map_offd_P, big_k, num_cols_P_offd); /* now this corresponds to the location in the col_map_offd ( so it is a local column number */ if (kc > -1) { - P_ext_j[index] = (HYPRE_BigInt)(-kc-1); /* make negative */ + P_ext_j[index] = (HYPRE_BigInt)(-kc - 1); /* make negative */ P_ext_data[index++] = P_ext_data[j]; } } @@ -461,11 +478,14 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, P_ext_i[i] = index; } for (i = num_cols_A_offd; i > 0; i--) - P_ext_i[i] = P_ext_i[i-1]; - - if (num_procs > 1) P_ext_i[0] = 0; - + { + P_ext_i[i] = P_ext_i[i - 1]; + } + if (num_procs > 1) + { + P_ext_i[0] = 0; + } } /* end of ghost rows */ /*------------------------------------------------------------------- @@ -474,7 +494,7 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, /* if level = first_level, we need to fix the col numbering to leave * space for the new unknowns */ - col_map = hypre_CTAlloc(HYPRE_Int, ncv, HYPRE_MEMORY_HOST); + col_map = hypre_CTAlloc(HYPRE_Int, ncv, HYPRE_MEMORY_HOST); if (num_smooth_vecs && level == interp_vec_first_level) { @@ -482,7 +502,7 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, { /* map from old col number to new col number (leave spaces * for new unknowns to be interleaved */ - col_map[i] = i + (i/num_functions) * num_smooth_vecs; + col_map[i] = i + (i / num_functions) * num_smooth_vecs; } } else @@ -495,46 +515,47 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, } /* we will have the same sparsity in Q as in P */ - new_nnz_diag = nnz_diag + nnz_diag*num_smooth_vecs; - new_nnz_offd = nnz_offd + nnz_offd*num_smooth_vecs; - + new_nnz_diag = nnz_diag + nnz_diag * num_smooth_vecs; + new_nnz_offd = nnz_offd + nnz_offd * num_smooth_vecs; /* new number of coarse variables */ if (level == interp_vec_first_level ) - new_ncv = ncv + ncv_peru*num_smooth_vecs; + { + new_ncv = ncv + ncv_peru * num_smooth_vecs; + } else - new_ncv = ncv; /* unchanged on level > first_level */ - + { + new_ncv = ncv; /* unchanged on level > first_level */ + } /* allocations */ - P_diag_j_new = hypre_CTAlloc(HYPRE_Int, new_nnz_diag, HYPRE_MEMORY_DEVICE); - P_diag_data_new = hypre_CTAlloc(HYPRE_Real, new_nnz_diag, HYPRE_MEMORY_DEVICE); - P_diag_i_new = hypre_CTAlloc(HYPRE_Int, num_rows_P + 1, HYPRE_MEMORY_DEVICE); + P_diag_j_new = hypre_CTAlloc(HYPRE_Int, new_nnz_diag, memory_location_P); + P_diag_data_new = hypre_CTAlloc(HYPRE_Real, new_nnz_diag, memory_location_P); + P_diag_i_new = hypre_CTAlloc(HYPRE_Int, num_rows_P + 1, memory_location_P); P_offd_j_big = hypre_CTAlloc(HYPRE_BigInt, new_nnz_offd, HYPRE_MEMORY_HOST); - P_offd_j_new = hypre_CTAlloc(HYPRE_Int, new_nnz_offd, HYPRE_MEMORY_DEVICE); - P_offd_data_new = hypre_CTAlloc(HYPRE_Real, new_nnz_offd, HYPRE_MEMORY_DEVICE); - P_offd_i_new = hypre_CTAlloc(HYPRE_Int, num_rows_P + 1, HYPRE_MEMORY_DEVICE); + P_offd_j_new = hypre_CTAlloc(HYPRE_Int, new_nnz_offd, memory_location_P); + P_offd_data_new = hypre_CTAlloc(HYPRE_Real, new_nnz_offd, memory_location_P); + P_offd_i_new = hypre_CTAlloc(HYPRE_Int, num_rows_P + 1, memory_location_P); P_diag_i_new[0] = P_diag_i[0]; P_offd_i_new[0] = P_offd_i[0]; - /* doing truncation? if so, need some more allocations*/ if (q_max > 0 || abs_trunc > 0.0) { q_count = 0; - for (i=0; i < num_rows_P; i++) + for (i = 0; i < num_rows_P; i++) { - p_num_elements = P_diag_i[i+1]-P_diag_i[i]; - p_num_elements += (P_offd_i[i+1]-P_offd_i[i]); - if (p_num_elements > q_count) q_count = p_num_elements; + p_num_elements = P_diag_i[i + 1] - P_diag_i[i]; + p_num_elements += (P_offd_i[i + 1] - P_offd_i[i]); + if (p_num_elements > q_count) { q_count = p_num_elements; } } - q_alloc = q_count*(num_smooth_vecs + 1); - is_q = hypre_CTAlloc(HYPRE_Int, q_alloc , HYPRE_MEMORY_HOST); + q_alloc = q_count * (num_smooth_vecs + 1); + is_q = hypre_CTAlloc(HYPRE_Int, q_alloc, HYPRE_MEMORY_HOST); aux_data = hypre_CTAlloc(HYPRE_Real, q_alloc, HYPRE_MEMORY_HOST); aux_j = hypre_CTAlloc(HYPRE_BigInt, q_alloc, HYPRE_MEMORY_HOST); - is_diag = hypre_CTAlloc(HYPRE_Int, q_alloc , HYPRE_MEMORY_HOST); + is_diag = hypre_CTAlloc(HYPRE_Int, q_alloc, HYPRE_MEMORY_HOST); } /*------------------------------------------------------------------- @@ -544,107 +565,106 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, { HYPRE_Int fine_index; - smooth_vec_offd = hypre_CTAlloc(HYPRE_Real, num_cols_A_offd*num_smooth_vecs, HYPRE_MEMORY_HOST); + smooth_vec_offd = hypre_CTAlloc(HYPRE_Real, + num_cols_A_offd * num_smooth_vecs, + HYPRE_MEMORY_HOST); /* for now, do a seperate comm for each smooth vector */ - for (k = 0; k< num_smooth_vecs; k++) + for (k = 0; k < num_smooth_vecs; k++) { vector = smooth_vecs[k]; vec_data = hypre_VectorData(hypre_ParVectorLocalVector(vector)); - dbl_buf_data = hypre_CTAlloc(HYPRE_Real, hypre_ParCSRCommPkgSendMapStart(comm_pkg_A, - num_sends_A), HYPRE_MEMORY_HOST); + dbl_buf_data = hypre_CTAlloc(HYPRE_Real, + hypre_ParCSRCommPkgSendMapStart(comm_pkg_A, num_sends_A), + HYPRE_MEMORY_HOST); + /* point into smooth_vec_offd */ - offd_vec_data = smooth_vec_offd + k*num_cols_A_offd; + offd_vec_data = smooth_vec_offd + k * num_cols_A_offd; index = 0; for (i = 0; i < num_sends_A; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg_A, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg_A, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg_A, i + 1); j++) { - - fine_index = hypre_ParCSRCommPkgSendMapElmt(comm_pkg_A,j); + fine_index = hypre_ParCSRCommPkgSendMapElmt(comm_pkg_A, j); dbl_buf_data[index++] = vec_data[fine_index]; } - } - comm_handle = hypre_ParCSRCommHandleCreate( 1, comm_pkg_A, dbl_buf_data, - offd_vec_data); + comm_handle = hypre_ParCSRCommHandleCreate(1, comm_pkg_A, dbl_buf_data, offd_vec_data); hypre_ParCSRCommHandleDestroy(comm_handle); hypre_TFree(dbl_buf_data, HYPRE_MEMORY_HOST); } /* end of smooth vecs */ }/*end num procs > 1 */ - - /*------------------------------------------------------------------- - * Get smooth vec components for the off-processor columns of P - * TO Do: would be less storage to get the offd coarse to fine - * instead of this... - *-------------------------------------------------------------------*/ + /*------------------------------------------------------------------- + * Get smooth vec components for the off-processor columns of P + * TO Do: would be less storage to get the offd coarse to fine + * instead of this... + *-------------------------------------------------------------------*/ if (num_procs > 1) { HYPRE_Int c_index, fine_index; - smooth_vec_offd_P = hypre_CTAlloc(HYPRE_Real, num_cols_P_offd*num_smooth_vecs, HYPRE_MEMORY_HOST); + smooth_vec_offd_P = hypre_CTAlloc(HYPRE_Real, + num_cols_P_offd * num_smooth_vecs, + HYPRE_MEMORY_HOST); /* for now, do a seperate comm for each smooth vector */ - for (k = 0; k< num_smooth_vecs; k++) + for (k = 0; k < num_smooth_vecs; k++) { - vector = smooth_vecs[k]; vec_data = hypre_VectorData(hypre_ParVectorLocalVector(vector)); num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg_P); - dbl_buf_data = hypre_CTAlloc(HYPRE_Real, hypre_ParCSRCommPkgSendMapStart(comm_pkg_P, - num_sends), HYPRE_MEMORY_HOST); + dbl_buf_data = hypre_CTAlloc(HYPRE_Real, + hypre_ParCSRCommPkgSendMapStart(comm_pkg_P, num_sends), + HYPRE_MEMORY_HOST); + /* point into smooth_vec_offd_P */ - offd_vec_data_P = smooth_vec_offd_P + k*num_cols_P_offd; + offd_vec_data_P = smooth_vec_offd_P + k * num_cols_P_offd; index = 0; for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg_P, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg_P, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg_P, i + 1); j++) { /* we need to do the coarse/fine conversion here */ - c_index = hypre_ParCSRCommPkgSendMapElmt(comm_pkg_P,j); + c_index = hypre_ParCSRCommPkgSendMapElmt(comm_pkg_P, j); fine_index = coarse_to_fine[c_index]; dbl_buf_data[index++] = vec_data[fine_index]; } - } - comm_handle = hypre_ParCSRCommHandleCreate( 1, comm_pkg_P, dbl_buf_data, - offd_vec_data_P); + comm_handle = hypre_ParCSRCommHandleCreate(1, comm_pkg_P, dbl_buf_data, + offd_vec_data_P); hypre_ParCSRCommHandleDestroy(comm_handle); hypre_TFree(dbl_buf_data, HYPRE_MEMORY_HOST); } - - }/*end num procs > 1 */ - + } /*end num procs > 1 */ /*------------------------------------------------------------------- * Main loop! *-------------------------------------------------------------------*/ - - /******** loop through rows - only operate on rows of original functions******/ + /******** loop through rows - only operate on rows of original functions******/ j_diag_pos = 0; j_offd_pos = 0; orig_diag_start = 0; orig_offd_start = 0; - for (i=0; i < num_rows_P; i++) + for (i = 0; i < num_rows_P; i++) { - orig_row_sum = 0.0; - new_row_sum = 0.0; + /* orig_row_sum = 0.0; */ + /* new_row_sum = 0.0; */ num_new_p_diag = 0; num_new_p_offd = 0; @@ -653,18 +673,21 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, p_count_diag = 0;/* number of entries of p added */ p_count_offd = 0; q_count = 0; /* number of entries of q added */ - for (j = 0; j< q_alloc; j++) + for (j = 0; j < q_alloc; j++) { is_q[j] = 0; } - fcn_num = (HYPRE_Int) fmod(i, num_functions); + fcn_num = (HYPRE_Int) hypre_fmod(i, num_functions); if (fcn_num != dof_func[i]) - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"WARNING - ROWS incorrectly ordered in hypre_BoomerAMG_LNExpandInterp!\n"); + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "WARNING - ROWS incorrectly ordered in hypre_BoomerAMG_LNExpandInterp!\n"); + } /* number of elements in row of p*/ - p_num_diag_elements = P_diag_i[i+1] - P_diag_i[i]; - p_num_offd_elements = P_offd_i[i+1] - P_offd_i[i]; + p_num_diag_elements = P_diag_i[i + 1] - P_diag_i[i]; + p_num_offd_elements = P_offd_i[i + 1] - P_offd_i[i]; num_new_p_diag = p_num_diag_elements; num_new_p_offd = p_num_offd_elements; @@ -672,26 +695,28 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, orig_diag_start = P_diag_i[i]; orig_offd_start = P_offd_i[i]; - /* if original function dofs? or a new one that we don't want * to modify*/ if (fcn_num < orig_nf || modify == 0 ) { - /* for this row, will we add q entries ? */ if (fcn_num < orig_nf && num_smooth_vecs) + { add_q = 1; + } else + { add_q = 0; + } if (CF_marker[i] >= 0) /* row corres. to coarse point - just copy orig */ { /* diag elements */ - for (j=0; j < p_num_diag_elements; j++) + for (j = 0; j < p_num_diag_elements; j++) { - P_diag_data_new[j_diag_pos] = P_diag_data[orig_diag_start+j]; + P_diag_data_new[j_diag_pos] = P_diag_data[orig_diag_start + j]; - new_col = col_map[ P_diag_j[orig_diag_start+j]]; + new_col = col_map[ P_diag_j[orig_diag_start + j]]; P_diag_j_new[j_diag_pos] = new_col; j_diag_pos++; @@ -701,14 +726,14 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, /* offd elements */ p_count_offd = p_count_diag; - for (j=0; j < p_num_offd_elements; j++) + for (j = 0; j < p_num_offd_elements; j++) { - P_offd_data_new[j_diag_pos] = P_offd_data[orig_offd_start+j]; + P_offd_data_new[j_diag_pos] = P_offd_data[orig_offd_start + j]; /* note that even though we are copying, j needs to go back to regular numbering - will be compressed later when col_map_offd is generated*/ - index = P_offd_j[orig_offd_start+j]; + index = P_offd_j[orig_offd_start + j]; /* convert to the global col number using col_map_offd */ big_index = col_map_offd_P[index]; @@ -717,7 +742,9 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, * use col_map[index]*/ if (num_smooth_vecs && (level == interp_vec_first_level)) { - big_new_col = big_index + (big_index/(HYPRE_BigInt)num_functions) * (HYPRE_BigInt)num_smooth_vecs; + big_new_col = big_index + + (big_index / (HYPRE_BigInt)num_functions) * + (HYPRE_BigInt)num_smooth_vecs; } else /* no adjustment */ { @@ -736,18 +763,20 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, entries of q */ /* diag entries */ - for (j=0; j < p_num_diag_elements; j++) + for (j = 0; j < p_num_diag_elements; j++) { - orig_row_sum += P_diag_data[orig_diag_start+j]; + /* orig_row_sum += P_diag_data[orig_diag_start + j]; */ P_diag_data_new[j_diag_pos] = 0.0; - new_col = col_map[ P_diag_j[orig_diag_start+j]]; + new_col = col_map[P_diag_j[orig_diag_start + j]]; P_diag_j_new[j_diag_pos] = new_col; j_diag_pos++; if (q_alloc) - is_q[p_count_diag] = 0; /* this entry is for orig p*/ + { + is_q[p_count_diag] = 0; /* this entry is for orig p*/ + } p_count_diag++; if (add_q) { @@ -760,25 +789,27 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, j_diag_pos++; if (q_alloc) - is_q[p_count_diag] = k+1; /* this entry is for smoothvec k*/ + { + is_q[p_count_diag] = k + 1; /* this entry is for smoothvec k*/ + } num_new_p_diag++; q_count++; p_count_diag++; - } } } + /* offd */ p_count_offd = p_count_diag; /* for indexing into is_q*/ - for (j=0; j < p_num_offd_elements; j++) + for (j = 0; j < p_num_offd_elements; j++) { - orig_row_sum += P_offd_data[orig_offd_start+j]; + /* orig_row_sum += P_offd_data[orig_offd_start + j]; */ P_offd_data_new[j_offd_pos] = 0.0; /* j needs to go back to regular numbering - will be compressed later when col_map_offd is generated*/ - index = P_offd_j[orig_offd_start+j]; + index = P_offd_j[orig_offd_start + j]; /* convert to the global col number using col_map_offd */ big_index = col_map_offd_P[index]; @@ -787,7 +818,8 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, * use col_map[index]*/ if (num_smooth_vecs && (level == interp_vec_first_level)) { - big_new_col = big_index + (big_index/(HYPRE_BigInt) num_functions) * (HYPRE_BigInt)num_smooth_vecs; + big_new_col = big_index + (big_index / (HYPRE_BigInt) num_functions) * + (HYPRE_BigInt)num_smooth_vecs; } else /* no adjustment */ { @@ -799,7 +831,9 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, j_offd_pos++; if (q_alloc) - is_q[p_count_offd] = 0; /* this entry is for orig p*/ + { + is_q[p_count_offd] = 0; /* this entry is for orig p*/ + } p_count_offd++; if (add_q) @@ -813,12 +847,13 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, j_offd_pos++; if (q_alloc) - is_q[p_count_offd] = k+1; /* this entry is for smoothvec k*/ + { + is_q[p_count_offd] = k + 1; /* this entry is for smoothvec k*/ + } num_new_p_offd++; q_count++; p_count_offd++; - } } } @@ -834,51 +869,56 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, for (k = 0; k < num_smooth_vecs; k++) { vector = smooth_vecs[k]; - vec_data = hypre_VectorData(hypre_ParVectorLocalVector(vector)); - - for (jj = A_diag_i[i]; jj < A_diag_i[i+1]; jj++) - { + vec_data = hypre_VectorData(hypre_ParVectorLocalVector(vector)); - i1 = A_diag_j[jj]; - if (dof_func[i1] == fcn_num) - r_extra[k] += A_diag_data[jj]*vec_data[i1]; + for (jj = A_diag_i[i]; jj < A_diag_i[i + 1]; jj++) + { - } + i1 = A_diag_j[jj]; + if (dof_func[i1] == fcn_num) + { + r_extra[k] += A_diag_data[jj] * vec_data[i1]; + } + } - offd_vec_data = smooth_vec_offd + k*num_cols_A_offd; + offd_vec_data = smooth_vec_offd + k * num_cols_A_offd; - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) - { + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) + { - i1 = A_offd_j[jj]; - if (dof_func_offd[i1] == fcn_num) - r_extra[k] += A_offd_data[jj]*offd_vec_data[i1]; + i1 = A_offd_j[jj]; + if (dof_func_offd[i1] == fcn_num) + { + r_extra[k] += A_offd_data[jj] * offd_vec_data[i1]; + } - } + } } /*find sum(a_if) */ af_sum = 0.0; - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) { i1 = A_diag_j[jj]; if (dof_func[i1] == fcn_num && CF_marker[i1] < 0) + { af_sum += A_diag_data[jj]; - + } } - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { i1 = A_offd_j[jj]; if (dof_func_offd[i1] == fcn_num && CF_marker_offd[i1] < 0) + { af_sum += A_offd_data[jj]; - + } } if (af_sum != 0.0) { for (k = 0; k < num_smooth_vecs; k++) { - adj[k] = r_extra[k]/af_sum; + adj[k] = r_extra[k] / af_sum; } } else /* there are no fine connections */ @@ -887,24 +927,27 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, } /* now we will use the adjustment later */ - /* now if we have any coarse connections with no corresponding point in orig p, then these we have to distibute and treat as fine, basically*/ /* diag first */ - for (jj = A_diag_i[i]+ 1; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) { found = 0; jj_point = A_diag_j[jj]; /* fine index */ /* only want like unknowns */ if (fcn_num != dof_func[jj_point]) + { continue; + } /*only look at coarse connections */ if (CF_marker[jj_point] < 0) /*fine*/ + { continue; + } a_ij = A_diag_data[jj]; @@ -928,31 +971,37 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, { for (k = 0; k < num_smooth_vecs; k++) { - adj[k] = r_extra[k]/af_sum; + adj[k] = r_extra[k] / af_sum; } } } } /* end diag loop */ + /* now offd loop */ - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { found = 0; jj_point = A_offd_j[jj]; /* fine index */ /* only want like unknowns */ if (fcn_num != dof_func_offd[jj_point]) + { continue; + } /*only look at coarse connections */ if (CF_marker_offd[jj_point] < 0) /*fine*/ + { continue; + } a_ij = A_offd_data[jj]; big_jj_point_c = fine_to_coarse_offd[jj_point]; /* now global num */ /* now need to adjust for new cols */ /* TO DO: VERIFY THIS! */ - big_jj_point_c = big_jj_point_c + (big_jj_point_c/(HYPRE_BigInt)num_functions) * (HYPRE_BigInt)num_smooth_vecs; + big_jj_point_c = big_jj_point_c + (big_jj_point_c / (HYPRE_BigInt)num_functions) * + (HYPRE_BigInt)num_smooth_vecs; /* is there a P(i,jj_c)? */ for (kk = P_offd_i_new[i]; kk < P_offd_i_new[i] + num_new_p_offd; kk ++) @@ -976,7 +1025,7 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, { for (k = 0; k < num_smooth_vecs; k++) { - adj[k] = r_extra[k]/af_sum; + adj[k] = r_extra[k] / af_sum; } } } @@ -1004,16 +1053,18 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, rows! (var 6 )*/ gm_row_sum = 0.0; - for (j=0; j < p_num_diag_elements; j++) + for (j = 0; j < p_num_diag_elements; j++) { - gm_row_sum += P_diag_data[orig_diag_start+j]; + gm_row_sum += P_diag_data[orig_diag_start + j]; } - for (j=0; j < p_num_offd_elements; j++) + for (j = 0; j < p_num_offd_elements; j++) { - gm_row_sum += P_offd_data[orig_offd_start+j]; + gm_row_sum += P_offd_data[orig_offd_start + j]; } - if( (p_num_diag_elements+p_num_offd_elements) && (fabs(gm_row_sum) < 1e-15)) + if ( (p_num_diag_elements + p_num_offd_elements) && (hypre_abs(gm_row_sum) < 1e-15)) + { gm_row_sum = 1.0; + } } @@ -1027,13 +1078,15 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, /* FIRST LOOP OVER DIAG ELEMENTS */ /* loop over elements in row i of A (except diagonal)*/ - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) { jj_point = A_diag_j[jj]; /* fine index */ /* only want like unknowns */ if (fcn_num != dof_func[jj_point]) + { continue; + } dist_coarse = 0; a_ij = A_diag_data[jj]; @@ -1042,7 +1095,6 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, /* if (a_ij*d_sign > 0) continue;*/ - found = 0; if (CF_marker[jj_point] >= 0) /*coarse*/ { @@ -1074,7 +1126,7 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, /*hypre_printf("dist coarse in i = %d\n", i);*/ dist_coarse = 1; } - } + } else /*fine connection */ { use_alt_w = 0; @@ -1084,12 +1136,12 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, ( need to do diag and offd) */ /* diag */ - for (pp = P_diag_i[jj_point]; pp < P_diag_i[jj_point+1]; pp++) + for (pp = P_diag_i[jj_point]; pp < P_diag_i[jj_point + 1]; pp++) { p_point = P_diag_j[pp];/* this is a coarse index */ /* is p_point in row i also ? */ - for (kk = P_diag_i[i]; kk < P_diag_i[i+1]; kk ++) + for (kk = P_diag_i[i]; kk < P_diag_i[i + 1]; kk ++) { kk_point = P_diag_j[kk]; /* this is a coarse index */ if (p_point == kk_point) @@ -1102,12 +1154,12 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, }/* end loop kk over row i */ } /* end diag (end loop pp over row jj_point) */ /* offd */ - for (pp = P_offd_i[jj_point]; pp < P_offd_i[jj_point+1]; pp++) + for (pp = P_offd_i[jj_point]; pp < P_offd_i[jj_point + 1]; pp++) { p_point = P_offd_j[pp];/* this is a coarse index */ /* is p_point in row i also ? check the offd part*/ - for (kk = P_offd_i[i]; kk < P_offd_i[i+1]; kk ++) + for (kk = P_offd_i[i]; kk < P_offd_i[i + 1]; kk ++) { kk_point = P_offd_j[kk]; /* this is a coarse index */ if (p_point == kk_point) @@ -1120,7 +1172,7 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, }/* end loop kk over row i */ } /* end offd */ - if (fabs(sum) < 1e-12) + if (hypre_abs(sum) < 1e-12) { sum = 1.0; use_alt_w = 1; @@ -1129,20 +1181,22 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, if (use_alt_w) { /* distribute a_ij equally among coarse points */ - aw = a_ij/( p_num_diag_elements + p_num_offd_elements); + aw = a_ij / ( p_num_diag_elements + p_num_offd_elements); kk_count = 0; /* loop through row i of orig p*/ /* diag first */ - for (kk = P_diag_i[i]; kk < P_diag_i[i+1]; kk++) + for (kk = P_diag_i[i]; kk < P_diag_i[i + 1]; kk++) { kk_point = P_diag_j[kk]; /* this is a coarse index */ if (add_q) { - cur_spot = P_diag_i_new[i] + kk_count*(num_smooth_vecs+1); + cur_spot = P_diag_i_new[i] + kk_count * (num_smooth_vecs + 1); } else - cur_spot = P_diag_i_new[i] + kk_count; + { + cur_spot = P_diag_i_new[i] + kk_count; + } P_diag_data_new[cur_spot] += aw; @@ -1159,22 +1213,21 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, fine_kk = coarse_to_fine[kk_point]; tmp_d1 = vec_data[jj_point] - adj[k]; tmp_d2 = vec_data[fine_kk]; - q_val = aw*(tmp_d1 - tmp_d2); + q_val = aw * (tmp_d1 - tmp_d2); - P_diag_data_new[cur_spot + k + 1]+= q_val; + P_diag_data_new[cur_spot + k + 1] += q_val; } - } kk_count++; } /* did each element of p_diag */ /* now do offd */ kk_count = 0; - for (kk = P_offd_i[i]; kk < P_offd_i[i+1]; kk++) + for (kk = P_offd_i[i]; kk < P_offd_i[i + 1]; kk++) { kk_point = P_offd_j[kk]; /* this is a coarse index */ if (add_q) { - cur_spot = P_offd_i_new[i] + kk_count*(num_smooth_vecs+1); + cur_spot = P_offd_i_new[i] + kk_count * (num_smooth_vecs + 1); } else { @@ -1190,7 +1243,7 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, vector = smooth_vecs[k]; vec_data = hypre_VectorData(hypre_ParVectorLocalVector(vector)); /* alias the offd smooth vector */ - offd_vec_data_P = smooth_vec_offd_P + k*num_cols_P_offd; + offd_vec_data_P = smooth_vec_offd_P + k * num_cols_P_offd; /* q_val = a_ij* w_jk*[s(j) - s(k)] */ @@ -1200,8 +1253,8 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, tmp_d1 = vec_data[jj_point] - adj[k]; tmp_d2 = offd_vec_data_P[kk_point]; - q_val = aw*(tmp_d1 - tmp_d2); - P_offd_data_new[cur_spot + k + 1]+= q_val; + q_val = aw * (tmp_d1 - tmp_d2); + P_offd_data_new[cur_spot + k + 1] += q_val; } } @@ -1213,13 +1266,13 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, }/* end of alt w */ - /* Now we need to do the distributing (THIS COULD BE CODED MORE - EFFICIENTLY (like classical interp )*/ + /* Now we need to do the distributing (THIS COULD BE CODED MORE + EFFICIENTLY (like classical interp )*/ /* loop through row i (diag and off d) of orig p*/ /* first the diag part */ kk_count = 0; - for (kk = P_diag_i[i]; kk < P_diag_i[i+1]; kk++) + for (kk = P_diag_i[i]; kk < P_diag_i[i + 1]; kk++) { kk_point = P_diag_j[kk]; /* this is a coarse index */ @@ -1228,21 +1281,23 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, j came from A_diag */ found = 0; - for (pp = P_diag_i[jj_point]; pp < P_diag_i[jj_point+1]; pp++) + for (pp = P_diag_i[jj_point]; pp < P_diag_i[jj_point + 1]; pp++) { if (P_diag_j[pp] == kk_point) { found = 1; /* a_ij*w_jk */ - aw = a_ij*P_diag_data[pp]; - aw = aw/sum; + aw = a_ij * P_diag_data[pp]; + aw = aw / sum; /* loc in new P */ if (add_q) { - cur_spot = P_diag_i_new[i] + kk_count*(num_smooth_vecs+1); + cur_spot = P_diag_i_new[i] + kk_count * (num_smooth_vecs + 1); } else + { cur_spot = P_diag_i_new[i] + kk_count; + } /* P_diag_data_new[k] += aw; */ P_diag_data_new[cur_spot] += aw; @@ -1259,9 +1314,9 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, fine_kk = coarse_to_fine[kk_point]; tmp_d1 = vec_data[jj_point] - adj[k]; tmp_d2 = vec_data[fine_kk]; - q_val = aw*(tmp_d1 - tmp_d2); + q_val = aw * (tmp_d1 - tmp_d2); - P_diag_data_new[cur_spot + k + 1]+= q_val; + P_diag_data_new[cur_spot + k + 1] += q_val; } } break; @@ -1273,23 +1328,23 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, } /* end loop kk over row i of Pdiag */ /* now do the offd part */ kk_count = 0; - for (kk = P_offd_i[i]; kk < P_offd_i[i+1]; kk++) + for (kk = P_offd_i[i]; kk < P_offd_i[i + 1]; kk++) { kk_point = P_offd_j[kk]; /* this is a coarse index */ found = 0; - for (pp = P_offd_i[jj_point]; pp < P_offd_i[jj_point+1]; pp++) + for (pp = P_offd_i[jj_point]; pp < P_offd_i[jj_point + 1]; pp++) { if (P_offd_j[pp] == kk_point) { found = 1; /* a_ij*w_jk */ - aw = a_ij*P_offd_data[pp]; - aw = aw/sum; + aw = a_ij * P_offd_data[pp]; + aw = aw / sum; /* loc in new P */ if (add_q) { - cur_spot = P_offd_i_new[i] + kk_count*(num_smooth_vecs+1); + cur_spot = P_offd_i_new[i] + kk_count * (num_smooth_vecs + 1); } else { @@ -1305,16 +1360,16 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, vec_data = hypre_VectorData(hypre_ParVectorLocalVector(vector)); /* alias the offd smooth vector */ - offd_vec_data_P = smooth_vec_offd_P + k*num_cols_P_offd; + offd_vec_data_P = smooth_vec_offd_P + k * num_cols_P_offd; /* jj_point is a fine index and kk_point is a coarse index that is offd */ /* q_val = a_ij* w_jk*[s(j) - s(k)] */ tmp_d1 = vec_data[jj_point] - adj[k]; /* jj point is in diag */ tmp_d2 = offd_vec_data_P[kk_point]; - q_val = aw*(tmp_d1 - tmp_d2); + q_val = aw * (tmp_d1 - tmp_d2); - P_offd_data_new[cur_spot + k + 1]+= q_val; + P_offd_data_new[cur_spot + k + 1] += q_val; } }/* end of add_q */ break; @@ -1330,17 +1385,17 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, { /* coarse not in orig interp (weakly connected) */ /* distribute a_ij equally among coarse points */ - aw = a_ij/(p_num_diag_elements + p_num_offd_elements); + aw = a_ij / (p_num_diag_elements + p_num_offd_elements); kk_count = 0; /* loop through row i of orig p (diag and offd)*/ /* diag */ - for (kk = P_diag_i[i]; kk < P_diag_i[i+1]; kk++) + for (kk = P_diag_i[i]; kk < P_diag_i[i + 1]; kk++) { kk_point = P_diag_j[kk]; /* this is a coarse index */ if (add_q) { - cur_spot = P_diag_i_new[i] + kk_count*(num_smooth_vecs+1); + cur_spot = P_diag_i_new[i] + kk_count * (num_smooth_vecs + 1); } else { @@ -1361,21 +1416,21 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, fine_kk = coarse_to_fine[kk_point]; tmp_d1 = vec_data[jj_point] - adj[k]; tmp_d2 = vec_data[fine_kk]; - q_val = aw*(tmp_d1 - tmp_d2); + q_val = aw * (tmp_d1 - tmp_d2); - P_diag_data_new[cur_spot + k + 1]+= q_val; + P_diag_data_new[cur_spot + k + 1] += q_val; } } kk_count++; } /* did each diag element of p */ /* now off diag */ kk_count = 0; - for (kk = P_offd_i[i]; kk < P_offd_i[i+1]; kk++) + for (kk = P_offd_i[i]; kk < P_offd_i[i + 1]; kk++) { kk_point = P_offd_j[kk]; /* this is a coarse index */ if (add_q) { - cur_spot = P_offd_i_new[i] + kk_count*(num_smooth_vecs+1); + cur_spot = P_offd_i_new[i] + kk_count * (num_smooth_vecs + 1); } else { @@ -1387,12 +1442,12 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, { for (k = 0; k < num_smooth_vecs; k++) { - /* point to the smooth vector */ + /* point to the smooth vector */ vector = smooth_vecs[k]; vec_data = hypre_VectorData(hypre_ParVectorLocalVector(vector)); /* alias the offd smooth vector */ - offd_vec_data_P = smooth_vec_offd_P + k*num_cols_P_offd; + offd_vec_data_P = smooth_vec_offd_P + k * num_cols_P_offd; /* q_val = a_ij* w_jk*[s(j) - s(k)] */ @@ -1402,8 +1457,8 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, tmp_d1 = vec_data[jj_point] - adj[k]; tmp_d2 = offd_vec_data_P[kk_point]; - q_val = aw*(tmp_d1 - tmp_d2); - P_offd_data_new[cur_spot + k + 1]+= q_val; + q_val = aw * (tmp_d1 - tmp_d2); + P_offd_data_new[cur_spot + k + 1] += q_val; } } kk_count++; @@ -1412,9 +1467,9 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, }/* end loop jj over row i (diag part) of A */ - /* Still looping over ith row of A - NOW LOOP OVER OFFD! */ + /* Still looping over ith row of A - NOW LOOP OVER OFFD! */ - for (jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { jj_point = A_offd_j[jj]; /* fine index */ @@ -1422,7 +1477,9 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, /* only want like unknowns */ if (fcn_num != dof_func_offd[jj_point]) + { continue; + } dist_coarse = 0; a_ij = A_offd_data[jj]; @@ -1435,13 +1492,13 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, /* CHECK THIS - changed on 11/24!! */ - /* find P(i,j_c) and put value there (there may not be - an entry in P if this coarse connection was not a - strong connection */ + /* find P(i,j_c) and put value there (there may not be + an entry in P if this coarse connection was not a + strong connection */ - /* we are looping in the off diag of this row, so we only - * need to look in P_offd - look in orig P*/ - for (kk = P_offd_i[i]; kk < P_offd_i[i+1]; kk ++) + /* we are looping in the off diag of this row, so we only + * need to look in P_offd - look in orig P*/ + for (kk = P_offd_i[i]; kk < P_offd_i[i + 1]; kk ++) { index = P_offd_j[kk]; /* local number */ @@ -1455,7 +1512,8 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, * into account the new unknowns*/ if (num_smooth_vecs && (level == interp_vec_first_level)) { - big_new_col = big_jj_point_c + (big_jj_point_c/(HYPRE_BigInt)num_functions) * (HYPRE_BigInt)num_smooth_vecs; + big_new_col = big_jj_point_c + (big_jj_point_c / (HYPRE_BigInt)num_functions) * + (HYPRE_BigInt)num_smooth_vecs; } else /* no adjustment */ { @@ -1499,14 +1557,14 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, /* now this is the row in P, but these are stored in P_ext according to offd of A */ j_ext_index = jj_point; - for (pp = P_ext_i[j_ext_index]; pp < P_ext_i[j_ext_index+1]; pp++) + for (pp = P_ext_i[j_ext_index]; pp < P_ext_i[j_ext_index + 1]; pp++) { p_point = (HYPRE_Int)P_ext_j[pp];/* this is a coarse index */ /* is p_point in row i also ? check the diag of offd part*/ if (p_point > -1) /* in diag part */ { - for (kk = P_diag_i[i]; kk < P_diag_i[i+1]; kk++) + for (kk = P_diag_i[i]; kk < P_diag_i[i + 1]; kk++) { kk_point = P_diag_j[kk]; /* this is a coarse index */ if (p_point == kk_point) @@ -1520,9 +1578,9 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, } else /* in offd diag part */ { - p_point = -p_point-1; + p_point = -p_point - 1; /* p_point is a local col number for P now */ - for (kk = P_offd_i[i]; kk < P_offd_i[i+1]; kk ++) + for (kk = P_offd_i[i]; kk < P_offd_i[i + 1]; kk ++) { kk_point = P_offd_j[kk]; /* this is a coarse index */ if (p_point == kk_point) @@ -1536,7 +1594,7 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, }/* end if diag or offd */ }/* end loop over pp for j_ext_index */ - if (fabs(sum) < 1e-12) + if (hypre_abs(sum) < 1e-12) { sum = 1.0; use_alt_w = 1; @@ -1544,21 +1602,23 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, if (use_alt_w) { /* distribute a_ij equally among coarse points */ - aw = a_ij/( p_num_diag_elements + p_num_offd_elements); + aw = a_ij / ( p_num_diag_elements + p_num_offd_elements); kk_count = 0; /* loop through row i of orig p*/ /* diag first */ - for (kk = P_diag_i[i]; kk < P_diag_i[i+1]; kk++) + for (kk = P_diag_i[i]; kk < P_diag_i[i + 1]; kk++) { kk_point = P_diag_j[kk]; /* this is a coarse index */ if (add_q) { - cur_spot = P_diag_i_new[i] + kk_count*(num_smooth_vecs+1); + cur_spot = P_diag_i_new[i] + kk_count * (num_smooth_vecs + 1); } else + { cur_spot = P_diag_i_new[i] + kk_count; + } P_diag_data_new[cur_spot] += aw; @@ -1570,15 +1630,15 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, /* point to the smooth vector */ vector = smooth_vecs[k]; vec_data = hypre_VectorData(hypre_ParVectorLocalVector(vector)); - offd_vec_data = smooth_vec_offd + k*num_cols_A_offd; + offd_vec_data = smooth_vec_offd + k * num_cols_A_offd; /* q_val = a_ij* w_jk*[s(j) - s(k)] */ fine_kk = coarse_to_fine[kk_point]; /** kk point is a diag index */ tmp_d1 = offd_vec_data[jj_point] - adj[k]; /* jj_point is an offd index */ tmp_d2 = vec_data[fine_kk]; - q_val = aw*(tmp_d1 - tmp_d2); + q_val = aw * (tmp_d1 - tmp_d2); - P_diag_data_new[cur_spot + k + 1]+= q_val; + P_diag_data_new[cur_spot + k + 1] += q_val; } } @@ -1586,12 +1646,12 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, } /* did each element of p_diag */ /* now do offd */ kk_count = 0; - for (kk = P_offd_i[i]; kk < P_offd_i[i+1]; kk++) + for (kk = P_offd_i[i]; kk < P_offd_i[i + 1]; kk++) { kk_point = P_offd_j[kk]; /* this is a coarse index */ if (add_q) { - cur_spot = P_offd_i_new[i] + kk_count*(num_smooth_vecs+1); + cur_spot = P_offd_i_new[i] + kk_count * (num_smooth_vecs + 1); } else { @@ -1604,8 +1664,8 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, for (k = 0; k < num_smooth_vecs; k++) { /* alias the offd smooth vector */ - offd_vec_data = smooth_vec_offd + k*num_cols_A_offd; - offd_vec_data_P = smooth_vec_offd_P + k*num_cols_P_offd; + offd_vec_data = smooth_vec_offd + k * num_cols_A_offd; + offd_vec_data_P = smooth_vec_offd_P + k * num_cols_P_offd; /* q_val = a_ij* w_jk*[s(j) - s(k)] */ @@ -1615,8 +1675,8 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, tmp_d1 = offd_vec_data[jj_point] - adj[k]; tmp_d2 = offd_vec_data_P[kk_point]; - q_val = aw*(tmp_d1 - tmp_d2); - P_offd_data_new[cur_spot + k + 1]+= q_val; + q_val = aw * (tmp_d1 - tmp_d2); + P_offd_data_new[cur_spot + k + 1] += q_val; } } @@ -1632,31 +1692,33 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, /* loop through row i (diag and off d) of orig p*/ /* first the diag part */ kk_count = 0; - for (kk = P_diag_i[i]; kk < P_diag_i[i+1]; kk++) + for (kk = P_diag_i[i]; kk < P_diag_i[i + 1]; kk++) { kk_point = P_diag_j[kk]; /* this is a coarse index */ /* now is there an entry for P(jj_point, kk_point)? - need to look through row jj_point (now off-proc since jj came from A_offd */ found = 0; - for (pp = P_ext_i[j_ext_index]; pp < P_ext_i[j_ext_index+1]; pp++) + for (pp = P_ext_i[j_ext_index]; pp < P_ext_i[j_ext_index + 1]; pp++) { - p_point = (HYPRE_Int)P_ext_j[pp]; + p_point = (HYPRE_Int) P_ext_j[pp]; if (p_point > -1) /* diag part */ { if (p_point == kk_point) { found = 1; /* a_ij*w_jk */ - aw = a_ij*P_ext_data[pp]; - aw = aw/sum; + aw = a_ij * P_ext_data[pp]; + aw = aw / sum; /* loc in new P */ if (add_q) { - cur_spot = P_diag_i_new[i] + kk_count*(num_smooth_vecs+1); + cur_spot = P_diag_i_new[i] + kk_count * (num_smooth_vecs + 1); } else + { cur_spot = P_diag_i_new[i] + kk_count; + } /* P_diag_data_new[k] += aw; */ P_diag_data_new[cur_spot] += aw; @@ -1668,15 +1730,15 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, /* point to the smooth vector */ vector = smooth_vecs[k]; vec_data = hypre_VectorData(hypre_ParVectorLocalVector(vector)); - offd_vec_data = smooth_vec_offd + k*num_cols_A_offd; + offd_vec_data = smooth_vec_offd + k * num_cols_A_offd; /* q_val = a_ij* w_jk*[s(j) - s(k)] */ fine_kk = coarse_to_fine[kk_point]; /** kk point is a diag index */ tmp_d1 = offd_vec_data[jj_point] - adj[k];/* jj_point is an offd index */ tmp_d2 = vec_data[fine_kk]; - q_val = aw*(tmp_d1 - tmp_d2); + q_val = aw * (tmp_d1 - tmp_d2); - P_diag_data_new[cur_spot + k + 1]+= q_val; + P_diag_data_new[cur_spot + k + 1] += q_val; } }/* end addq */ @@ -1686,16 +1748,16 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, } /* end loop pp over P_ext_i[jj_point]*/ kk_count++; } /* end loop kk over row i of Pdiag */ - /* now do the offd part */ + /* now do the offd part */ kk_count = 0; - for (kk = P_offd_i[i]; kk < P_offd_i[i+1]; kk++) + for (kk = P_offd_i[i]; kk < P_offd_i[i + 1]; kk++) { kk_point = P_offd_j[kk]; /* this is a coarse index */ found = 0; /* now is there an entry for P(jj_point, kk_point)? - need to look through row j_point (on offproc since jj came from A_offd */ - for (pp = P_ext_i[j_ext_index]; pp < P_ext_i[j_ext_index+1]; pp++) + for (pp = P_ext_i[j_ext_index]; pp < P_ext_i[j_ext_index + 1]; pp++) { p_point = (HYPRE_Int)P_ext_j[pp]; if (p_point < 0) /* in offd part */ @@ -1705,13 +1767,13 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, { found = 1; /* a_ij*w_jk */ - aw = a_ij*P_ext_data[pp]; - aw = aw/sum; + aw = a_ij * P_ext_data[pp]; + aw = aw / sum; /* loc in new P */ if (add_q) { - cur_spot = P_offd_i_new[i] + kk_count*(num_smooth_vecs+1); + cur_spot = P_offd_i_new[i] + kk_count * (num_smooth_vecs + 1); } else { @@ -1724,17 +1786,17 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, { /* alias the offd smooth vector */ - offd_vec_data = smooth_vec_offd + k*num_cols_A_offd; - offd_vec_data_P = smooth_vec_offd_P + k*num_cols_P_offd; + offd_vec_data = smooth_vec_offd + k * num_cols_A_offd; + offd_vec_data_P = smooth_vec_offd_P + k * num_cols_P_offd; /* jj_point is a fine index and kk_point is a coarse index */ /* q_val = a_ij* w_jk*[s(j) - s(k)] */ tmp_d1 = offd_vec_data[jj_point] - adj[k]; tmp_d2 = offd_vec_data_P[kk_point]; - q_val = aw*(tmp_d1 - tmp_d2); + q_val = aw * (tmp_d1 - tmp_d2); - P_offd_data_new[cur_spot + k + 1]+= q_val; + P_offd_data_new[cur_spot + k + 1] += q_val; } }/* end of add_q */ break; @@ -1750,17 +1812,17 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, { /* coarse not in orig interp (weakly connected) */ /* distribute a_ij equally among coarse points */ - aw = a_ij/(p_num_diag_elements + p_num_offd_elements); + aw = a_ij / (p_num_diag_elements + p_num_offd_elements); kk_count = 0; /* loop through row i of orig p (diag and offd)*/ /* diag */ - for (kk = P_diag_i[i]; kk < P_diag_i[i+1]; kk++) + for (kk = P_diag_i[i]; kk < P_diag_i[i + 1]; kk++) { kk_point = P_diag_j[kk]; /* this is a coarse index */ if (add_q) { - cur_spot = P_diag_i_new[i] + kk_count*(num_smooth_vecs+1); + cur_spot = P_diag_i_new[i] + kk_count * (num_smooth_vecs + 1); } else { @@ -1768,7 +1830,7 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, } P_diag_data_new[cur_spot] += aw; - /*add q? */ + /*add q? */ if (add_q) { for (k = 0; k < num_smooth_vecs; k++) @@ -1776,29 +1838,29 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, /* point to the smooth vector */ vector = smooth_vecs[k]; vec_data = hypre_VectorData(hypre_ParVectorLocalVector(vector)); - offd_vec_data = smooth_vec_offd + k*num_cols_A_offd; + offd_vec_data = smooth_vec_offd + k * num_cols_A_offd; /* q_val = a_ij* w_jk*[s(j) - s(k)] */ fine_kk = coarse_to_fine[kk_point];/** kk point is a diag index */ tmp_d1 = offd_vec_data[jj_point] - adj[k];/* jj_point is an offd index */ tmp_d2 = vec_data[fine_kk]; - q_val = aw*(tmp_d1 - tmp_d2); + q_val = aw * (tmp_d1 - tmp_d2); - P_diag_data_new[cur_spot + k + 1]+= q_val; + P_diag_data_new[cur_spot + k + 1] += q_val; } } kk_count++; } /* did each diag element of p */ - /* now off-diag */ + /* now off-diag */ kk_count = 0; - for (kk = P_offd_i[i]; kk < P_offd_i[i+1]; kk++) + for (kk = P_offd_i[i]; kk < P_offd_i[i + 1]; kk++) { kk_point = P_offd_j[kk]; /* this is a coarse index */ if (add_q) { - cur_spot = P_offd_i_new[i] + kk_count*(num_smooth_vecs+1); + cur_spot = P_offd_i_new[i] + kk_count * (num_smooth_vecs + 1); } else { @@ -1811,8 +1873,8 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, for (k = 0; k < num_smooth_vecs; k++) { /* alias the offd smooth vector */ - offd_vec_data = smooth_vec_offd + k*num_cols_A_offd; - offd_vec_data_P = smooth_vec_offd_P + k*num_cols_P_offd; + offd_vec_data = smooth_vec_offd + k * num_cols_A_offd; + offd_vec_data_P = smooth_vec_offd_P + k * num_cols_P_offd; /* q_val = a_ij* w_jk*[s(j) - s(k)] */ @@ -1822,8 +1884,8 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, tmp_d1 = offd_vec_data[jj_point] - adj[k]; tmp_d2 = offd_vec_data_P[kk_point]; - q_val = aw*(tmp_d1 - tmp_d2); - P_offd_data_new[cur_spot + k + 1]+= q_val; + q_val = aw * (tmp_d1 - tmp_d2); + P_offd_data_new[cur_spot + k + 1] += q_val; } } kk_count++; @@ -1834,7 +1896,7 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, } /* end of jj loop over offd of A */ /* now divide by the diagonal and we are finished with this row!*/ - if (fabs(diagonal) > 0.0) + if (hypre_abs(diagonal) > 0.0) { for (kk = P_diag_i_new[i] ; kk < P_diag_i_new[i] + num_new_p_diag; kk++) { @@ -1842,13 +1904,18 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, /* want new_row_sum only to be orig p elements (not q) */ new_col = P_diag_j_new[kk]; if (level == interp_vec_first_level) - fcn_num = (HYPRE_Int) fmod(new_col, num_functions + num_smooth_vecs); + { + fcn_num = (HYPRE_Int) hypre_fmod(new_col, num_functions + num_smooth_vecs); + } else - fcn_num = (HYPRE_Int) fmod(new_col, num_functions); - - if (fcn_num < orig_nf) - new_row_sum += P_diag_data_new[kk]; + { + fcn_num = (HYPRE_Int) hypre_fmod(new_col, num_functions); + } + /* if (fcn_num < orig_nf) */ + /* { */ + /* new_row_sum += P_diag_data_new[kk]; */ + /* } */ } for (kk = P_offd_i_new[i] ; kk < P_offd_i_new[i] + num_new_p_offd; kk++) { @@ -1856,13 +1923,18 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, /* want new_row_sum only to be orig p elements (not q) */ big_new_col = P_offd_j_big[kk]; if (level == interp_vec_first_level) - fcn_num = (HYPRE_Int) fmod((HYPRE_Real)big_new_col, num_functions + num_smooth_vecs); + { + fcn_num = (HYPRE_Int) hypre_fmod((HYPRE_Real)big_new_col, num_functions + num_smooth_vecs); + } else - fcn_num = (HYPRE_Int) fmod((HYPRE_Real)big_new_col, num_functions); - - if (fcn_num < orig_nf) - new_row_sum += P_offd_data_new[kk]; + { + fcn_num = (HYPRE_Int) hypre_fmod((HYPRE_Real)big_new_col, num_functions); + } + /* if (fcn_num < orig_nf) */ + /* { */ + /* new_row_sum += P_offd_data_new[kk]; */ + /* } */ } } /* if we had no fc, then the Q entries are zero - let's do @@ -1877,19 +1949,27 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, { new_col = P_diag_j_new[kk]; if (level == interp_vec_first_level) + { num_f = num_functions + num_smooth_vecs; + } else + { num_f = num_functions; + } - fcn_num = (HYPRE_Int) fmod(new_col, num_f); + fcn_num = (HYPRE_Int) hypre_fmod(new_col, num_f); if (fcn_num < orig_nf) { /* get the old col number back to index into vector */ if (level == interp_vec_first_level ) - c_col = new_col - (HYPRE_Int) floor((HYPRE_Real) new_col/ (HYPRE_Real) num_f); + { + c_col = new_col - (HYPRE_Int) hypre_floor((HYPRE_Real) new_col / (HYPRE_Real) num_f); + } else + { c_col = new_col; + } c_col = coarse_to_fine[c_col]; @@ -1900,7 +1980,7 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, vec_data = hypre_VectorData(hypre_ParVectorLocalVector(vector)); /*dt = P_diag_data_new[kk]; dt = (vec_data[i]/gm_row_sum - vec_data[c_col]);*/ - value = P_diag_data_new[kk]*(vec_data[i]/gm_row_sum - vec_data[c_col]); + value = P_diag_data_new[kk] * (vec_data[i] / gm_row_sum - vec_data[c_col]); P_diag_data_new[kk + k + 1] = value; } @@ -1911,18 +1991,27 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, { big_new_col = P_offd_j_big[kk]; if (level == interp_vec_first_level) + { num_f = num_functions + num_smooth_vecs; + } else + { num_f = num_functions; - fcn_num = (HYPRE_Int) fmod((HYPRE_Real)big_new_col, num_f); + } + fcn_num = (HYPRE_Int) hypre_fmod((HYPRE_Real)big_new_col, num_f); if (fcn_num < orig_nf) { if (level == interp_vec_first_level ) /* get the old col number back to index into vector */ - c_col = (HYPRE_Int) big_new_col - floor((HYPRE_Real) big_new_col/ (HYPRE_Real) num_f); + { + c_col = (HYPRE_Int)((HYPRE_Int) big_new_col - hypre_floor((HYPRE_Real) big_new_col / + (HYPRE_Real) num_f)); + } else + { c_col = (HYPRE_Int) big_new_col; + } for (k = 0; k < num_smooth_vecs; k++) { @@ -1930,11 +2019,11 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, vec_data = hypre_VectorData(hypre_ParVectorLocalVector(vector)); /* alias the offd smooth vector */ - offd_vec_data_P = smooth_vec_offd_P + k*num_cols_P_offd; + offd_vec_data_P = smooth_vec_offd_P + k * num_cols_P_offd; /*dt = P_offd_data_new[kk]; dt = (vec_data[i]/gm_row_sum - offd_vec_data_P[c_col]);*/ - value = P_offd_data_new[kk]*(vec_data[i]/gm_row_sum - offd_vec_data_P[c_col]); + value = P_offd_data_new[kk] * (vec_data[i] / gm_row_sum - offd_vec_data_P[c_col]); P_offd_data_new[kk + k + 1] = value; } @@ -1951,26 +2040,26 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, if (CF_marker[i] >= 0) /* row corres. to coarse point - just copy orig */ { /* diag */ - for (j=0; j < p_num_diag_elements; j++) + for (j = 0; j < p_num_diag_elements; j++) { - P_diag_data_new[j_diag_pos] = P_diag_data[orig_diag_start+j]; + P_diag_data_new[j_diag_pos] = P_diag_data[orig_diag_start + j]; - new_col = col_map[ P_diag_j[orig_diag_start+j]]; - P_diag_j_new[j_diag_pos] =new_col; + new_col = col_map[ P_diag_j[orig_diag_start + j]]; + P_diag_j_new[j_diag_pos] = new_col; j_diag_pos++; p_count_diag++; } /* offd elements */ p_count_offd = p_count_diag; - for (j=0; j < p_num_offd_elements; j++) + for (j = 0; j < p_num_offd_elements; j++) { - P_offd_data_new[j_offd_pos] = P_offd_data[orig_offd_start+j]; + P_offd_data_new[j_offd_pos] = P_offd_data[orig_offd_start + j]; /* note that even though we are copying, j needs to go back to regular numbering - will be compressed later when col_map_offd is generated*/ - index = P_offd_j[orig_offd_start+j]; + index = P_offd_j[orig_offd_start + j]; /* convert to the global col number using col_map_offd */ big_index = col_map_offd_P[index]; @@ -1979,7 +2068,7 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, * use col_map[index]*/ if (num_smooth_vecs && (level == interp_vec_first_level)) { - big_new_col = big_index + (big_index/(HYPRE_BigInt)num_functions) * (HYPRE_BigInt)num_smooth_vecs; + big_new_col = big_index + (big_index / (HYPRE_BigInt)num_functions) * (HYPRE_BigInt)num_smooth_vecs; } else /* no adjustment */ { @@ -2002,31 +2091,31 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, /* replace each element of P*/ /* DIAG */ - for (j=0; j < p_num_diag_elements; j++) + for (j = 0; j < p_num_diag_elements; j++) { m_val = 0.0; - for (m = 0; m< orig_nf; m++) + for (m = 0; m < orig_nf; m++) { - m_pos = P_diag_i[i - (fcn_num - m)]+ j; /* recall - nodal coarsening */ - m_val += theta[m]*P_diag_data[m_pos]; + m_pos = P_diag_i[i - (fcn_num - m)] + j; /* recall - nodal coarsening */ + m_val += theta[m] * P_diag_data[m_pos]; } - P_diag_j_new[j_diag_pos] = P_diag_j[orig_diag_start+j]; + P_diag_j_new[j_diag_pos] = P_diag_j[orig_diag_start + j]; P_diag_data_new[j_diag_pos] = m_val; j_diag_pos++; p_count_diag++; } /* OFF-DIAG */ p_count_offd = p_count_diag; - for (j=0; j < p_num_offd_elements; j++) + for (j = 0; j < p_num_offd_elements; j++) { m_val = 0.0; - for (m = 0; m< orig_nf; m++) + for (m = 0; m < orig_nf; m++) { - m_pos = P_offd_i[i - (fcn_num - m)]+ j; /* recall - nodal coarsening */ - m_val += theta[m]*P_offd_data[m_pos]; + m_pos = P_offd_i[i - (fcn_num - m)] + j; /* recall - nodal coarsening */ + m_val += theta[m] * P_offd_data[m_pos]; } - index = P_offd_j[orig_offd_start+j]; + index = P_offd_j[orig_offd_start + j]; /* convert to the global col number using col_map_offd */ big_index = col_map_offd_P[index]; @@ -2038,319 +2127,322 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, }/*end of modify */ - /* update i */ - P_diag_i_new[i+1] = P_diag_i_new[i] + num_new_p_diag; - P_offd_i_new[i+1] = P_offd_i_new[i] + num_new_p_offd; - + /* update i */ + P_diag_i_new[i + 1] = P_diag_i_new[i] + num_new_p_diag; + P_offd_i_new[i + 1] = P_offd_i_new[i] + num_new_p_offd; /* adjust p_count_offd to not include diag*/ p_count_offd = p_count_offd - p_count_diag; - if (p_count_diag != num_new_p_diag) - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Error diag p_count in hypre_BoomerAMG_LNExpandInterp!\n"); + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Error diag p_count in hypre_BoomerAMG_LNExpandInterp!\n"); + } if (p_count_offd != num_new_p_offd) - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Error offd p_count in hypre_BoomerAMG_LNExpandInterp!\n"); - - - /* NOW TRUNCATE Q ?*/ - if ( add_q && q_count > 0 && (q_max > 0 || abs_trunc > 0.0)) - { - HYPRE_Real value, lost_value, q_dist_value; - HYPRE_Int q_count_k, num_lost, p_count_tot; - HYPRE_Int lost_counter_diag, lost_counter_offd, j_counter; - HYPRE_Int new_num_q, new_j_counter, new_diag_pos, new_offd_pos; - HYPRE_Int i_qmax, lost_counter_q; - /* loop through the smooth vectors - we have to do the q - with each smooth vec separately - TO DO: re-write to not have this outter loop (like the GM - interpolation.) I am not doing this now as we may change - the LN truncation strategy entirely :) - */ - for (k = 0; k < num_smooth_vecs; k++) - { - q_count_k = 0; - lost_value = 0.0; - num_lost = 0; - i_qmax = 0; - - /* first do absolute truncation */ - if (abs_trunc > 0.0) - { - /* find out if any will be dropped */ - j_counter = 0; - /* diag loop */ - for(j = P_diag_i_new[i]; j < P_diag_i_new[i] + p_count_diag; j++) - { - if (is_q[j_counter] == (k+1)) - { - q_count_k++; - value = fabs(P_diag_data_new[j]); - if (value < abs_trunc) - { - num_lost ++; - lost_value += P_diag_data_new[j]; - } - } - j_counter++; - } - /* offd loop - don't reset j_counter*/ - for(j = P_offd_i_new[i]; j < P_offd_i_new[i] + p_count_offd; j++) - { - if (is_q[j_counter] == (k+1)) - { - q_count_k++; - value = fabs(P_offd_data_new[j]); - if (value < abs_trunc) - { - num_lost ++; - lost_value += P_offd_data_new[j]; - } - } - j_counter++; - } - /* now drop and adjust values of other entries in Q */ - if (num_lost) - { - if ((q_count_k - num_lost) > 0) - { - q_dist_value = lost_value/(q_count_k - num_lost); - } - else - { - /* originall had this, but this makes it - * imposssible to get low complexities */ - /* i_qmax = 1; - num_lost = 0; - hypre_printf("Warning: dropping all of Q; level = %d, i = %d, num = %d\n", level, i, num_lost);*/ - } - } - if (num_lost) - { - - new_j_counter = 0; - lost_counter_diag = 0; - q_dist_value = 0.0; - - /* diag */ - new_diag_pos = P_diag_i_new[i]; - j_counter = 0; - for(j = P_diag_i_new[i]; j < P_diag_i_new[i] + p_count_diag ; j++) - { - - value = fabs(P_diag_data_new[j]); - - if ( is_q[j_counter] == (k+1) && (value < abs_trunc) ) - { - /* drop */ - lost_counter_diag++; - } - else /* keep */ - { - /* for k, keep this q and add the q_dist (also copy the - * orig. p and other q not corres to this - * k) */ - value = P_diag_data_new[j]; - if (is_q[j_counter] == (k+1)) - { - value += q_dist_value; - } - P_diag_data_new[new_diag_pos] = value; - P_diag_j_new[new_diag_pos] = P_diag_j_new[j]; - new_diag_pos++; - - is_q[new_j_counter] = is_q[j_counter]; - new_j_counter++; - - } - j_counter++; - } /* end loop though j */ - - p_count_diag -= lost_counter_diag; - j_diag_pos -= lost_counter_diag; - - /* offd */ - lost_counter_offd = 0; - new_offd_pos = P_offd_i_new[i]; - for(j = P_offd_i_new[i]; j < P_offd_i_new[i] + p_count_offd ; j++) - { - value = fabs(P_offd_data_new[j]); - - if ( is_q[j_counter] == (k+1) && (value < abs_trunc) ) - { - /* drop */ - lost_counter_offd++; - } - else /* keep */ - { - /* for k, keep this q and add the q_dist (also copy the - * orig. p and other q not corres to this - * k) */ - value = P_offd_data_new[j]; - if (is_q[j_counter] == (k+1)) - { - value += q_dist_value; - } - P_offd_data_new[new_offd_pos] = value; - P_offd_j_big[new_offd_pos] = P_offd_j_big[j]; - new_offd_pos++; - - is_q[new_j_counter] = is_q[j_counter]; - new_j_counter++; - - } - j_counter++; - } /* end loop though j */ - - p_count_offd -= lost_counter_offd; - j_offd_pos -= lost_counter_offd; - - } /* end if num_lost */ - } - - /* now max num elements truncation */ - if (i_qmax) - loop_q_max = 1; /* not used currently */ - else - loop_q_max = q_max; - - if (loop_q_max > 0) - { - /* copy all elements for the row and count the q's for - * this smoothvec*/ - q_count_k = 0; - j_counter = 0; - for (j = P_diag_i_new[i]; j < P_diag_i_new[i]+ p_count_diag; j++) - { - if (is_q[j_counter] == (k+1)) - q_count_k++; - - aux_j[j_counter] = (HYPRE_BigInt)P_diag_j_new[j]; - aux_data[j_counter] = P_diag_data_new[j]; - is_diag[j_counter] = 1; - j_counter++; - - } - - - /* offd loop - don't reset j_counter*/ - for (j = P_offd_i_new[i]; j < P_offd_i_new[i]+ p_count_offd; j++) - { - if (is_q[j_counter] == (k+1)) - q_count_k++; - - aux_j[j_counter] = P_offd_j_big[j]; - aux_data[j_counter] = P_offd_data_new[j]; - is_diag[j_counter] = 0; - j_counter++; - - } - - new_num_q = q_count_k; - num_lost = q_count_k - loop_q_max; - - if (num_lost > 0) - { - - p_count_tot = p_count_diag + p_count_offd; - - /* only keep loop_q_max elements - get rid of smallest */ - hypre_BigQsort4_abs(aux_data, aux_j, is_q, is_diag, 0 , p_count_tot -1); - - lost_value = 0.0; - lost_counter_q = 0; - lost_counter_diag = 0; - lost_counter_offd = 0; - - j_counter = 0; - - new_diag_pos = P_diag_i_new[i]; - new_offd_pos = P_offd_i_new[i]; - - new_j_counter = 0; - - /* have to do diag and offd together because of sorting*/ - for(j = 0; j < p_count_tot; j++) - { - - if ((is_q[j_counter] == (k+1)) && (lost_counter_q < num_lost)) - { - - /*drop*/ - lost_value += aux_data[j_counter]; - lost_counter_q++; - - /* check whether this is diag or offd element */ - if (is_diag[j]) - { - lost_counter_diag++; - } - else - { - lost_counter_offd++; - } - new_num_q--; - - /* technically only need to do this the last time */ - q_dist_value = lost_value/loop_q_max; - } - else - { - /* keep and add to the q values (copy q)*/ - value = aux_data[j_counter]; - if (is_q[j_counter] == (k+1)) - value += q_dist_value; - - if (is_diag[j]) - { - P_diag_data_new[new_diag_pos] = value; - P_diag_j_new[new_diag_pos] = aux_j[j_counter]; - new_diag_pos++; - - is_q[new_j_counter] = is_q[j_counter]; - new_j_counter++; - } - else - { - P_offd_data_new[new_offd_pos] = value; - P_offd_j_big[new_offd_pos] = aux_j[j]; - new_offd_pos++; - is_q[new_j_counter] = is_q[j]; - new_j_counter++; - } - } - j_counter++; + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Error offd p_count in hypre_BoomerAMG_LNExpandInterp!\n"); + } - }/* end element loop */ - /* adjust p_count and j_pos */ - p_count_diag -= lost_counter_diag; - p_count_offd -= lost_counter_offd; + /* NOW TRUNCATE Q ?*/ + if (add_q && q_count > 0 && (q_max > 0 || abs_trunc > 0.0)) + { + HYPRE_Real value, lost_value, q_dist_value = 0.0; + HYPRE_Int q_count_k, num_lost, p_count_tot; + HYPRE_Int lost_counter_diag, lost_counter_offd, j_counter; + HYPRE_Int new_j_counter, new_diag_pos, new_offd_pos; + //HYPRE_Int new_num_q; + HYPRE_Int i_qmax, lost_counter_q; + /* loop through the smooth vectors - we have to do the q + with each smooth vec separately + TO DO: re-write to not have this outter loop (like the GM + interpolation.) I am not doing this now as we may change + the LN truncation strategy entirely :) + */ + for (k = 0; k < num_smooth_vecs; k++) + { + q_count_k = 0; + lost_value = 0.0; + num_lost = 0; + i_qmax = 0; - j_diag_pos -= lost_counter_diag; - j_offd_pos -= lost_counter_offd; + /* first do absolute truncation */ + if (abs_trunc > 0.0) + { + /* find out if any will be dropped */ + j_counter = 0; + /* diag loop */ + for (j = P_diag_i_new[i]; j < P_diag_i_new[i] + p_count_diag; j++) + { + if (is_q[j_counter] == (k + 1)) + { + q_count_k++; + value = hypre_abs(P_diag_data_new[j]); + if (value < abs_trunc) + { + num_lost ++; + lost_value += P_diag_data_new[j]; + } + } + j_counter++; + } - } /* end num lost > 0 */ + /* offd loop - don't reset j_counter*/ + for (j = P_offd_i_new[i]; j < P_offd_i_new[i] + p_count_offd; j++) + { + if (is_q[j_counter] == (k + 1)) + { + q_count_k++; + value = hypre_abs(P_offd_data_new[j]); + if (value < abs_trunc) + { + num_lost ++; + lost_value += P_offd_data_new[j]; + } + } + j_counter++; + } - } /* end loop_q_max > 0 - element truncation */ - - - }/* end of loop through smoothvecs */ + /* now drop and adjust values of other entries in Q */ + if (num_lost) + { + if ((q_count_k - num_lost) > 0) + { + q_dist_value = lost_value / (q_count_k - num_lost); + } + else + { + /* originall had this, but this makes it + * imposssible to get low complexities */ + /* i_qmax = 1; + num_lost = 0; + hypre_printf("Warning: dropping all of Q; level = %d, i = %d, num = %d\n", level, i, num_lost);*/ + } + } - P_diag_i_new[i+1] = P_diag_i_new[i] + p_count_diag; - P_offd_i_new[i+1] = P_offd_i_new[i] + p_count_offd; - - }/* end of truncation*/ + if (num_lost) + { + new_j_counter = 0; + lost_counter_diag = 0; + q_dist_value = 0.0; - if (j_diag_pos != P_diag_i_new[i+1]) - { - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Warning - diag Row Problem in hypre_BoomerAMG_LNExpandInterp!\n"); - } - if (j_offd_pos != P_offd_i_new[i+1]) - { - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Warning - off-diag Row Problem in hypre_BoomerAMG_LNExpandInterp!\n"); - } + /* diag */ + new_diag_pos = P_diag_i_new[i]; + j_counter = 0; + for (j = P_diag_i_new[i]; j < P_diag_i_new[i] + p_count_diag ; j++) + { + + value = hypre_abs(P_diag_data_new[j]); + + if ( is_q[j_counter] == (k + 1) && (value < abs_trunc) ) + { + /* drop */ + lost_counter_diag++; + } + else /* keep */ + { + /* for k, keep this q and add the q_dist (also copy the + * orig. p and other q not corres to this + * k) */ + value = P_diag_data_new[j]; + if (is_q[j_counter] == (k + 1)) + { + value += q_dist_value; + } + P_diag_data_new[new_diag_pos] = value; + P_diag_j_new[new_diag_pos] = P_diag_j_new[j]; + new_diag_pos++; + + is_q[new_j_counter] = is_q[j_counter]; + new_j_counter++; + + } + j_counter++; + } /* end loop though j */ + + p_count_diag -= lost_counter_diag; + j_diag_pos -= lost_counter_diag; + + /* offd */ + lost_counter_offd = 0; + new_offd_pos = P_offd_i_new[i]; + for (j = P_offd_i_new[i]; j < P_offd_i_new[i] + p_count_offd ; j++) + { + value = hypre_abs(P_offd_data_new[j]); + + if ( is_q[j_counter] == (k + 1) && (value < abs_trunc) ) + { + /* drop */ + lost_counter_offd++; + } + else /* keep */ + { + /* for k, keep this q and add the q_dist (also copy the + * orig. p and other q not corres to this + * k) */ + value = P_offd_data_new[j]; + if (is_q[j_counter] == (k + 1)) + { + value += q_dist_value; + } + P_offd_data_new[new_offd_pos] = value; + P_offd_j_big[new_offd_pos] = P_offd_j_big[j]; + new_offd_pos++; + + is_q[new_j_counter] = is_q[j_counter]; + new_j_counter++; + + } + j_counter++; + } /* end loop though j */ + + p_count_offd -= lost_counter_offd; + j_offd_pos -= lost_counter_offd; + } /* end if num_lost */ + } + + /* now max num elements truncation */ + if (i_qmax) + { + loop_q_max = 1; /* not used currently */ + } + else + { + loop_q_max = q_max; + } + + if (loop_q_max > 0) + { + /* copy all elements for the row and count the q's for + * this smoothvec*/ + q_count_k = 0; + j_counter = 0; + for (j = P_diag_i_new[i]; j < P_diag_i_new[i] + p_count_diag; j++) + { + if (is_q[j_counter] == (k + 1)) + { + q_count_k++; + } + + aux_j[j_counter] = (HYPRE_BigInt)P_diag_j_new[j]; + aux_data[j_counter] = P_diag_data_new[j]; + is_diag[j_counter] = 1; + j_counter++; + } + + /* offd loop - don't reset j_counter*/ + for (j = P_offd_i_new[i]; j < P_offd_i_new[i] + p_count_offd; j++) + { + if (is_q[j_counter] == (k + 1)) + { + q_count_k++; + } + + aux_j[j_counter] = P_offd_j_big[j]; + aux_data[j_counter] = P_offd_data_new[j]; + is_diag[j_counter] = 0; + j_counter++; + } + + //new_num_q = q_count_k; + num_lost = q_count_k - loop_q_max; + + if (num_lost > 0) + { + p_count_tot = p_count_diag + p_count_offd; + + /* only keep loop_q_max elements - get rid of smallest */ + hypre_BigQsort4_abs(aux_data, aux_j, is_q, is_diag, 0, p_count_tot - 1); + + lost_value = 0.0; + lost_counter_q = 0; + lost_counter_diag = 0; + lost_counter_offd = 0; + + j_counter = 0; + + new_diag_pos = P_diag_i_new[i]; + new_offd_pos = P_offd_i_new[i]; + + new_j_counter = 0; + + /* have to do diag and offd together because of sorting*/ + for (j = 0; j < p_count_tot; j++) + { + if ((is_q[j_counter] == (k + 1)) && (lost_counter_q < num_lost)) + { + /* drop */ + lost_value += aux_data[j_counter]; + lost_counter_q++; + + /* check whether this is diag or offd element */ + if (is_diag[j]) + { + lost_counter_diag++; + } + else + { + lost_counter_offd++; + } + //new_num_q--; + + /* technically only need to do this the last time */ + q_dist_value = lost_value / loop_q_max; + } + else + { + /* keep and add to the q values (copy q)*/ + value = aux_data[j_counter]; + if (is_q[j_counter] == (k + 1)) + { + value += q_dist_value; + } + + if (is_diag[j]) + { + P_diag_data_new[new_diag_pos] = value; + P_diag_j_new[new_diag_pos] = aux_j[j_counter]; + new_diag_pos++; + + is_q[new_j_counter] = is_q[j_counter]; + new_j_counter++; + } + else + { + P_offd_data_new[new_offd_pos] = value; + P_offd_j_big[new_offd_pos] = aux_j[j]; + new_offd_pos++; + is_q[new_j_counter] = is_q[j]; + new_j_counter++; + } + } + j_counter++; + }/* end element loop */ + /* adjust p_count and j_pos */ + p_count_diag -= lost_counter_diag; + p_count_offd -= lost_counter_offd; + + j_diag_pos -= lost_counter_diag; + j_offd_pos -= lost_counter_offd; + } /* end num lost > 0 */ + } /* end loop_q_max > 0 - element truncation */ + } /* end of loop through smoothvecs */ + + P_diag_i_new[i + 1] = P_diag_i_new[i] + p_count_diag; + P_offd_i_new[i + 1] = P_offd_i_new[i] + p_count_offd; + } /* end of truncation*/ + + if (j_diag_pos != P_diag_i_new[i + 1]) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "Warning - diag Row Problem in hypre_BoomerAMG_LNExpandInterp!\n"); + } + if (j_offd_pos != P_offd_i_new[i + 1]) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "Warning - off-diag Row Problem in hypre_BoomerAMG_LNExpandInterp!\n"); + } } /* end of MAIN LOOP i loop through rows of P*/ @@ -2364,11 +2456,13 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, { HYPRE_Int new_nf; - c_dof_func = hypre_TReAlloc_v2(c_dof_func, HYPRE_Int, hypre_IntArraySize(*coarse_dof_func), HYPRE_Int, new_ncv, hypre_IntArrayMemoryLocation(*coarse_dof_func)); + c_dof_func = hypre_TReAlloc_v2(c_dof_func, HYPRE_Int, hypre_IntArraySize(*coarse_dof_func), + HYPRE_Int, new_ncv, + hypre_IntArrayMemoryLocation(*coarse_dof_func)); cur_spot = 0; for (i = 0; i < ncv_peru; i++) { - for (k = 0; k< num_functions + num_smooth_vecs; k++) + for (k = 0; k < num_functions + num_smooth_vecs; k++) { c_dof_func[cur_spot++] = k; } @@ -2379,17 +2473,18 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, hypre_IntArrayData(*coarse_dof_func) = c_dof_func; hypre_IntArraySize(*coarse_dof_func) = new_ncv; - /* also we need to update the col starts and global num columns*/ /* assumes that unknowns are together on a procsessor with * nodal coarsening */ - new_col_starts = hypre_CTAlloc(HYPRE_BigInt, 2, HYPRE_MEMORY_HOST); - new_col_starts[0] = (col_starts[0]/(HYPRE_BigInt)num_functions)*(HYPRE_BigInt)new_nf ; - new_col_starts[1] = (col_starts[1]/(HYPRE_BigInt)num_functions)*(HYPRE_BigInt)new_nf; + new_col_starts[0] = (col_starts[0] / (HYPRE_BigInt) num_functions) * (HYPRE_BigInt) new_nf; + new_col_starts[1] = (col_starts[1] / (HYPRE_BigInt) num_functions) * (HYPRE_BigInt) new_nf; - if (myid == (num_procs -1)) g_nc = new_col_starts[1]; - hypre_MPI_Bcast(&g_nc, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); + if (myid == (num_procs - 1)) + { + g_nc = new_col_starts[1]; + } + hypre_MPI_Bcast(&g_nc, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); } else /* not first level */ { @@ -2397,10 +2492,9 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, g_nc = hypre_ParCSRMatrixGlobalNumCols(*P); /* copy col starts */ - new_col_starts = hypre_CTAlloc(HYPRE_BigInt, 2, HYPRE_MEMORY_HOST); new_col_starts[0] = col_starts[0]; new_col_starts[1] = col_starts[1]; - } + } /* modify P - now P has more entries and possibly more cols */ new_P = hypre_ParCSRMatrixCreate(comm, @@ -2424,8 +2518,6 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, hypre_CSRMatrixI(P_offd) = P_offd_i_new; hypre_CSRMatrixJ(P_offd) = P_offd_j_new; - hypre_TFree(new_col_starts, HYPRE_MEMORY_HOST); - /* If parallel we need to do the col map offd! */ if (num_procs > 1) { @@ -2443,16 +2535,18 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, /*first copy the j entries (these are GLOBAL numbers) */ j_copy = hypre_CTAlloc(HYPRE_BigInt, P_offd_new_size, HYPRE_MEMORY_HOST); - for (i=0; i < P_offd_new_size; i++) + for (i = 0; i < P_offd_new_size; i++) + { j_copy[i] = P_offd_j_big[i]; + } /* now sort them */ - hypre_BigQsort0(j_copy, 0, P_offd_new_size-1); + hypre_BigQsort0(j_copy, 0, P_offd_new_size - 1); /* now copy to col_map offd - but only each col once */ new_col_map_offd_P[0] = j_copy[0]; count = 0; - for (i=0; i < P_offd_new_size; i++) + for (i = 0; i < P_offd_new_size; i++) { if (j_copy[i] > new_col_map_offd_P[count]) { @@ -2463,10 +2557,10 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, num_cols_P_offd = count + 1; /* reset the j entries to be local */ - for (i=0; i < P_offd_new_size; i++) + for (i = 0; i < P_offd_new_size; i++) P_offd_j_new[i] = hypre_BigBinarySearch(new_col_map_offd_P, - P_offd_j_big[i], - num_cols_P_offd); + P_offd_j_big[i], + num_cols_P_offd); hypre_TFree(j_copy, HYPRE_MEMORY_HOST); } @@ -2495,16 +2589,18 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, if (!myid) { - hypre_sprintf(new_file,"%s.level.%d","P_new_new", level ); + hypre_sprintf(new_file, "%s.level.%d", "P_new_new", level ); if (P_CSR) + { hypre_CSRMatrixPrint(P_CSR, new_file); + } } hypre_CSRMatrixDestroy(P_CSR); } #endif - /* clean */ + /* clean */ hypre_TFree(coarse_to_fine, HYPRE_MEMORY_HOST); hypre_TFree(fine_to_coarse, HYPRE_MEMORY_HOST); hypre_TFree(fine_to_coarse_offd, HYPRE_MEMORY_HOST); @@ -2519,7 +2615,7 @@ HYPRE_Int hypre_BoomerAMG_LNExpandInterp( hypre_ParCSRMatrix *A, hypre_TFree(smooth_vec_offd, HYPRE_MEMORY_HOST); hypre_TFree(smooth_vec_offd_P, HYPRE_MEMORY_HOST); - if (num_procs > 1) hypre_CSRMatrixDestroy(P_ext); + hypre_CSRMatrixDestroy(P_ext); return hypre_error_flag; } diff --git a/external/hypre/src/parcsr_ls/par_sv_interp_lsfit.c b/external/hypre/src/parcsr_ls/par_sv_interp_lsfit.c index aeae201e..c22f7d3b 100644 --- a/external/hypre/src/parcsr_ls/par_sv_interp_lsfit.c +++ b/external/hypre/src/parcsr_ls/par_sv_interp_lsfit.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -47,16 +47,16 @@ HYPRE_Int hypre_BoomerAMGFitInterpVectors( hypre_ParCSRMatrix *A, hypre_ParVector **smooth_vecs, hypre_ParVector **coarse_smooth_vecs, HYPRE_Real delta, - HYPRE_Int num_functions, + HYPRE_Int num_functions, HYPRE_Int *dof_func, - HYPRE_Int *CF_marker, - HYPRE_Int max_elmts, - HYPRE_Real trunc_factor, - HYPRE_Int variant, HYPRE_Int level) + HYPRE_Int *CF_marker, + HYPRE_Int max_elmts, + HYPRE_Real trunc_factor, + HYPRE_Int variant, HYPRE_Int level) { - - HYPRE_Int i,j, k; - + + HYPRE_Int i, j, k; + HYPRE_Int one_i = 1; HYPRE_Int info; HYPRE_Int coarse_index;; @@ -76,7 +76,7 @@ HYPRE_Int hypre_BoomerAMGFitInterpVectors( hypre_ParCSRMatrix *A, HYPRE_Real *w; HYPRE_Real *w_old; HYPRE_Real *B_s; - + HYPRE_Real tmp_double; HYPRE_Real one = 1.0; HYPRE_Real mone = -1.0;; @@ -90,7 +90,7 @@ HYPRE_Int hypre_BoomerAMGFitInterpVectors( hypre_ParCSRMatrix *A, HYPRE_Real *P_offd_data = hypre_CSRMatrixData(P_offd); HYPRE_Int *P_offd_i = hypre_CSRMatrixI(P_offd); HYPRE_Int *P_offd_j = hypre_CSRMatrixJ(P_offd); - HYPRE_Int num_rows_P = hypre_CSRMatrixNumRows(P_diag); + HYPRE_Int num_rows_P = hypre_CSRMatrixNumRows(P_diag); HYPRE_Int P_diag_size = P_diag_i[num_rows_P]; HYPRE_Int P_offd_size = P_offd_i[num_rows_P]; HYPRE_Int num_cols_P_offd = hypre_CSRMatrixNumCols(P_offd); @@ -102,64 +102,70 @@ HYPRE_Int hypre_BoomerAMGFitInterpVectors( hypre_ParCSRMatrix *A, hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(*P); hypre_ParCSRCommHandle *comm_handle; MPI_Comm comm; - + HYPRE_Real *dbl_buf_data; HYPRE_Real *smooth_vec_offd = NULL; HYPRE_Real *offd_vec_data; - + HYPRE_Int index, start; HYPRE_Int *P_marker; HYPRE_Int num_procs; - + hypre_ParVector *vector; - + HYPRE_Int new_nnz, orig_start, j_pos, fcn_num, num_elements; HYPRE_Int *P_diag_j_new; HYPRE_Real *P_diag_data_new; HYPRE_Int adjust_3D[] = {1, 2, -1, 1, -2, -1}; HYPRE_Int adjust_2D[] = {1, -1}; HYPRE_Int *adjust_list; - - if (variant ==1 && num_functions > 1) + + if (variant == 1 && num_functions > 1) { - /* First add new entries to P with value 0.0 corresponding to weights from + /* First add new entries to P with value 0.0 corresponding to weights from other unknowns on the same grid point */ /* Loop through each row */ - - new_nnz = P_diag_size*num_functions; /* this is an over-estimate */ + + new_nnz = P_diag_size * num_functions; /* this is an over-estimate */ P_diag_j_new = hypre_CTAlloc(HYPRE_Int, new_nnz, HYPRE_MEMORY_HOST); P_diag_data_new = hypre_CTAlloc(HYPRE_Real, new_nnz, HYPRE_MEMORY_HOST); - - if (num_functions ==2) + + if (num_functions == 2) + { adjust_list = adjust_2D; - else if (num_functions ==3) + } + else if (num_functions == 3) + { adjust_list = adjust_3D; - + } + j_pos = 0; orig_start = 0; /* loop through rows */ - for (i=0; i < num_rows_P; i++) + for (i = 0; i < num_rows_P; i++) { fcn_num = (HYPRE_Int) fmod(i, num_functions); - if (fcn_num != dof_func[i]) + if (fcn_num != dof_func[i]) + { printf("WARNING - ROWS incorrectly ordered!\n"); - + } + /* loop through elements */ - num_elements = P_diag_i[i+1] - orig_start; - + num_elements = P_diag_i[i + 1] - orig_start; + /* add zeros corrresponding to other unknowns */ if (num_elements > 1) { - for (j=0; j < num_elements; j++) + for (j = 0; j < num_elements; j++) { - P_diag_j_new[j_pos] = P_diag_j[orig_start+j]; - P_diag_data_new[j_pos++] = P_diag_data[orig_start+j]; - - for (k=0; k < num_functions-1; k++) + P_diag_j_new[j_pos] = P_diag_j[orig_start + j]; + P_diag_data_new[j_pos++] = P_diag_data[orig_start + j]; + + for (k = 0; k < num_functions - 1; k++) { - P_diag_j_new[j_pos] = P_diag_j[orig_start+j]+ ADJUST(fcn_num,k); + P_diag_j_new[j_pos] = P_diag_j[orig_start + j] + ADJUST(fcn_num, k); P_diag_data_new[j_pos++] = 0.0; } } @@ -169,14 +175,18 @@ HYPRE_Int hypre_BoomerAMGFitInterpVectors( hypre_ParCSRMatrix *A, P_diag_j_new[j_pos] = P_diag_j[orig_start]; P_diag_data_new[j_pos++] = P_diag_data[orig_start]; } - orig_start = P_diag_i[i+1]; + orig_start = P_diag_i[i + 1]; if (num_elements > 1) - P_diag_i[i+1] = P_diag_i[i] + num_elements*num_functions; + { + P_diag_i[i + 1] = P_diag_i[i] + num_elements * num_functions; + } else - P_diag_i[i+1] = P_diag_i[i] + num_elements; + { + P_diag_i[i + 1] = P_diag_i[i] + num_elements; + } + + if (j_pos != P_diag_i[i + 1]) { printf("Problem!\n"); } - if (j_pos != P_diag_i[i+1]) printf("Problem!\n"); - }/* end loop through rows */ @@ -188,21 +198,21 @@ HYPRE_Int hypre_BoomerAMGFitInterpVectors( hypre_ParCSRMatrix *A, hypre_CSRMatrixNumNonzeros(P_diag) = P_diag_i[num_rows_P]; P_diag_j = P_diag_j_new; P_diag_data = P_diag_data_new; - + /* check if there is already a comm pkg - if so, destroy*/ if (comm_pkg) { - hypre_MatvecCommPkgDestroy(comm_pkg ); - comm_pkg = NULL; - + hypre_MatvecCommPkgDestroy(comm_pkg ); + comm_pkg = NULL; + } - + } /* end variant == 1 and num functions > 0 */ - /* For each row, we are updating the weights by + /* For each row, we are updating the weights by solving w = w_old + (delta)(Beta^T)Bs^(-1)(alpha - (Beta)w_old). let s = num_smooth_vectors let k = # of interp points for fine point i @@ -222,143 +232,151 @@ HYPRE_Int hypre_BoomerAMGFitInterpVectors( hypre_ParCSRMatrix *A, { char new_file[80]; - for (i=0; i < num_smooth_vecs; i++) + for (i = 0; i < num_smooth_vecs; i++) { - sprintf(new_file,"%s.%d.level.%d","smoothvec", i, level ); - hypre_ParVectorPrint(smooth_vecs[i], new_file); + sprintf(new_file, "%s.%d.level.%d", "smoothvec", i, level ); + hypre_ParVectorPrint(smooth_vecs[i], new_file); } } - + #endif /*initial*/ if (num_smooth_vecs == 0) + { return hypre_error_flag; + } if (!comm_pkg) { hypre_MatvecCommPkgCreate ( *P ); comm_pkg = hypre_ParCSRMatrixCommPkg(*P); } - + comm = hypre_ParCSRCommPkgComm(comm_pkg); hypre_MPI_Comm_size(comm, &num_procs); num_nonzeros = hypre_CSRMatrixNumNonzeros(P_diag) - + hypre_CSRMatrixNumNonzeros(P_offd); - + + hypre_CSRMatrixNumNonzeros(P_offd); + /* number of coarse points = number of cols */ coarse_points = hypre_CSRMatrixNumCols(P_diag) + hypre_CSRMatrixNumCols(P_offd); /* allocate */ alpha = hypre_CTAlloc(HYPRE_Real, num_smooth_vecs, HYPRE_MEMORY_HOST); piv = hypre_CTAlloc(HYPRE_Int, num_smooth_vecs, HYPRE_MEMORY_HOST); - B_s = hypre_CTAlloc(HYPRE_Real, num_smooth_vecs*num_smooth_vecs, HYPRE_MEMORY_HOST); + B_s = hypre_CTAlloc(HYPRE_Real, num_smooth_vecs * num_smooth_vecs, HYPRE_MEMORY_HOST); /*estimate the max number of weights per row (coarse points only have one weight)*/ - k_alloc = (num_nonzeros - coarse_points)/(num_rows_P - coarse_points); + k_alloc = (num_nonzeros - coarse_points) / (num_rows_P - coarse_points); k_alloc += 5; - Beta = hypre_CTAlloc(HYPRE_Real, k_alloc*num_smooth_vecs, HYPRE_MEMORY_HOST); - w = hypre_CTAlloc(HYPRE_Real, k_alloc, HYPRE_MEMORY_HOST); - w_old = hypre_CTAlloc(HYPRE_Real, k_alloc, HYPRE_MEMORY_HOST); + Beta = hypre_CTAlloc(HYPRE_Real, k_alloc * num_smooth_vecs, HYPRE_MEMORY_HOST); + w = hypre_CTAlloc(HYPRE_Real, k_alloc, HYPRE_MEMORY_HOST); + w_old = hypre_CTAlloc(HYPRE_Real, k_alloc, HYPRE_MEMORY_HOST); /* Get smooth vec components for the off-processor columns */ if (num_procs > 1) { - - smooth_vec_offd = hypre_CTAlloc(HYPRE_Real, num_cols_P_offd*num_smooth_vecs, HYPRE_MEMORY_HOST); - + + smooth_vec_offd = hypre_CTAlloc(HYPRE_Real, num_cols_P_offd * num_smooth_vecs, HYPRE_MEMORY_HOST); + /* for now, do a seperate comm for each smooth vector */ - for (k = 0; k< num_smooth_vecs; k++) + for (k = 0; k < num_smooth_vecs; k++) { - + vector = smooth_vecs[k]; vec_data = hypre_VectorData(hypre_ParVectorLocalVector(vector)); - + num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - dbl_buf_data = hypre_CTAlloc(HYPRE_Real, hypre_ParCSRCommPkgSendMapStart(comm_pkg, - num_sends), HYPRE_MEMORY_HOST); + dbl_buf_data = hypre_CTAlloc(HYPRE_Real, hypre_ParCSRCommPkgSendMapStart(comm_pkg, + num_sends), HYPRE_MEMORY_HOST); /* point into smooth_vec_offd */ - offd_vec_data = smooth_vec_offd + k*num_cols_P_offd; - + offd_vec_data = smooth_vec_offd + k * num_cols_P_offd; + index = 0; for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) - dbl_buf_data[index++] - = vec_data[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) + dbl_buf_data[index++] + = vec_data[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } - - comm_handle = hypre_ParCSRCommHandleCreate( 1, comm_pkg, dbl_buf_data, + + comm_handle = hypre_ParCSRCommHandleCreate( 1, comm_pkg, dbl_buf_data, offd_vec_data); - - hypre_ParCSRCommHandleDestroy(comm_handle); - + + hypre_ParCSRCommHandleDestroy(comm_handle); + hypre_TFree(dbl_buf_data, HYPRE_MEMORY_HOST); } }/*end num procs > 1 */ /* now off-proc smooth vec data is in smoothvec_offd */ /* Loop through each row */ - for (i=0; i < num_rows_P; i++) + for (i = 0; i < num_rows_P; i++) { /* only need to modify rows belonging to fine points */ if (CF_marker[i] >= 0) /* coarse */ + { continue; + } - num_coarse_diag = P_diag_i[i+1] - P_diag_i[i]; - num_coarse_offd = P_offd_i[i+1] - P_offd_i[i]; + num_coarse_diag = P_diag_i[i + 1] - P_diag_i[i]; + num_coarse_offd = P_offd_i[i + 1] - P_offd_i[i]; k_size = num_coarse_diag + num_coarse_offd; - + /* only need to modify rows that interpolate from coarse points */ if (k_size == 0) + { continue; + } #if 0 /* only change the weights if we have at least as many coarse points as smooth vectors - do we want to do this? NO */ - + too_few = 0; if (k_size < num_smooth_vecs) { too_few++; continue; } -#endif +#endif /*verify that we have enough space allocated */ if (k_size > k_alloc) { k_alloc = k_size + 2; - Beta = hypre_TReAlloc(Beta, HYPRE_Real, k_alloc*num_smooth_vecs, HYPRE_MEMORY_HOST); + Beta = hypre_TReAlloc(Beta, HYPRE_Real, k_alloc * num_smooth_vecs, HYPRE_MEMORY_HOST); w = hypre_TReAlloc(w, HYPRE_Real, k_alloc, HYPRE_MEMORY_HOST); w_old = hypre_TReAlloc(w_old, HYPRE_Real, k_alloc, HYPRE_MEMORY_HOST); } /* put current weights into w*/ counter = 0; - for (j=P_diag_i[i];j < P_diag_i[i+1]; j++) + for (j = P_diag_i[i]; j < P_diag_i[i + 1]; j++) { w[counter++] = P_diag_data[j]; } - for (j=P_offd_i[i];j < P_offd_i[i+1]; j++) + for (j = P_offd_i[i]; j < P_offd_i[i + 1]; j++) { w[counter++] = P_offd_data[j]; } /* copy w to w_old */ - for (j=0; j< k_size; j++) + for (j = 0; j < k_size; j++) + { w_old[j] = w[j]; - + } + /* get alpha and Beta */ /* alpha is the smooth vector values at fine point i */ /* Beta is the smooth vector values at the points that @@ -367,34 +385,34 @@ HYPRE_Int hypre_BoomerAMGFitInterpVectors( hypre_ParCSRMatrix *A, /* Note - for using BLAS/LAPACK - need to store Beta in * column-major order */ - for (j = 0; j< num_smooth_vecs; j++) + for (j = 0; j < num_smooth_vecs; j++) { vector = smooth_vecs[j]; vec_data = hypre_VectorData(hypre_ParVectorLocalVector(vector)); /* point into smooth_vec_offd */ - offd_vec_data = smooth_vec_offd + j*num_cols_P_offd; + offd_vec_data = smooth_vec_offd + j * num_cols_P_offd; alpha[j] = vec_data[i]; - + vector = coarse_smooth_vecs[j]; vec_data = hypre_VectorData(hypre_ParVectorLocalVector(vector)); /* on processor */ counter = 0; - - for (k = P_diag_i[i]; k < P_diag_i[i+1]; k++) + + for (k = P_diag_i[i]; k < P_diag_i[i + 1]; k++) { coarse_index = P_diag_j[k]; /*Beta(j, counter) */ - Beta[counter*num_smooth_vecs + j] = vec_data[coarse_index]; + Beta[counter * num_smooth_vecs + j] = vec_data[coarse_index]; counter++; } /* off-processor */ - for (k = P_offd_i[i];k < P_offd_i[i+1]; k++) + for (k = P_offd_i[i]; k < P_offd_i[i + 1]; k++) { coarse_index = P_offd_j[k]; - Beta[counter*num_smooth_vecs + j] = offd_vec_data[coarse_index]; + Beta[counter * num_smooth_vecs + j] = offd_vec_data[coarse_index]; counter++; - + } } @@ -403,57 +421,61 @@ HYPRE_Int hypre_BoomerAMGFitInterpVectors( hypre_ParCSRMatrix *A, /* first B_s <- (1-delta)*I_s */ tmp_double = 1.0 - delta; - for (j = 0; j < num_smooth_vecs*num_smooth_vecs; j++) + for (j = 0; j < num_smooth_vecs * num_smooth_vecs; j++) + { B_s[j] = 0.0; - for (j = 0; j < num_smooth_vecs; j++) - B_s[j*num_smooth_vecs + j] = tmp_double; - - /* now B_s <-delta*Beta*Beta^T + B_s */ - /* usage: DGEMM(TRANSA,TRANSB,M,N,K,ALPHA,A,LDA,B,LDB,BETA,C,LDC) - C := alpha*op( A )*op( B ) + beta*C */ - hypre_dgemm("N", "T", &num_smooth_vecs, - &num_smooth_vecs, &k_size, - &delta, Beta, &num_smooth_vecs, Beta, - &num_smooth_vecs, &one, B_s, &num_smooth_vecs); - - /* now do alpha <- (alpha - beta*w)*/ - /* usage: DGEMV(TRANS,M,N,ALPHA,A,LDA,X,INCX,BETA,Y,INCY) - y := alpha*A*x + beta*y */ - hypre_dgemv("N", &num_smooth_vecs, &k_size, &mone, - Beta, &num_smooth_vecs, w_old, &one_i, - &one, alpha, &one_i); - - /* now get alpha <- inv(B_s)*alpha */ - /*write over B_s with LU */ - hypre_dgetrf(&num_smooth_vecs, &num_smooth_vecs, - B_s, &num_smooth_vecs, piv, &info); - - /*now get alpha */ - hypre_dgetrs("N", &num_smooth_vecs, &one_i, B_s, - &num_smooth_vecs, piv, alpha, - &num_smooth_vecs, &info); - - /* now w <- w + (delta)*(Beta)^T*(alpha) */ - hypre_dgemv("T", &num_smooth_vecs, &k_size, &delta, - Beta, &num_smooth_vecs, alpha, &one_i, - &one, w, &one_i); - - /* note:we have w_old still, but we don't need it unless we - * want to use it in the future for something */ - - /* now update the weights in P*/ - counter = 0; - for (j=P_diag_i[i];j < P_diag_i[i+1]; j++) - { - P_diag_data[j] = w[counter++]; - } - for (j=P_offd_i[i];j < P_offd_i[i+1]; j++) - { - P_offd_data[j] = w[counter++]; - } + } + for (j = 0; j < num_smooth_vecs; j++) + { + B_s[j * num_smooth_vecs + j] = tmp_double; + } + + /* now B_s <-delta*Beta*Beta^T + B_s */ + /* usage: DGEMM(TRANSA,TRANSB,M,N,K,ALPHA,A,LDA,B,LDB,BETA,C,LDC) + C := alpha*op( A )*op( B ) + beta*C */ + hypre_dgemm("N", "T", &num_smooth_vecs, + &num_smooth_vecs, &k_size, + &delta, Beta, &num_smooth_vecs, Beta, + &num_smooth_vecs, &one, B_s, &num_smooth_vecs); + + /* now do alpha <- (alpha - beta*w)*/ + /* usage: DGEMV(TRANS,M,N,ALPHA,A,LDA,X,INCX,BETA,Y,INCY) + y := alpha*A*x + beta*y */ + hypre_dgemv("N", &num_smooth_vecs, &k_size, &mone, + Beta, &num_smooth_vecs, w_old, &one_i, + &one, alpha, &one_i); + + /* now get alpha <- inv(B_s)*alpha */ + /*write over B_s with LU */ + hypre_dgetrf(&num_smooth_vecs, &num_smooth_vecs, + B_s, &num_smooth_vecs, piv, &info); + + /*now get alpha */ + hypre_dgetrs("N", &num_smooth_vecs, &one_i, B_s, + &num_smooth_vecs, piv, alpha, + &num_smooth_vecs, &info); + + /* now w <- w + (delta)*(Beta)^T*(alpha) */ + hypre_dgemv("T", &num_smooth_vecs, &k_size, &delta, + Beta, &num_smooth_vecs, alpha, &one_i, + &one, w, &one_i); + + /* note:we have w_old still, but we don't need it unless we + * want to use it in the future for something */ + + /* now update the weights in P*/ + counter = 0; + for (j = P_diag_i[i]; j < P_diag_i[i + 1]; j++) + { + P_diag_data[j] = w[counter++]; + } + for (j = P_offd_i[i]; j < P_offd_i[i + 1]; j++) + { + P_offd_data[j] = w[counter++]; + } }/* end of loop through each row */ - - + + /* clean up from L.S. fitting*/ hypre_TFree(alpha, HYPRE_MEMORY_HOST); hypre_TFree(Beta, HYPRE_MEMORY_HOST); @@ -462,11 +484,11 @@ HYPRE_Int hypre_BoomerAMGFitInterpVectors( hypre_ParCSRMatrix *A, hypre_TFree(piv, HYPRE_MEMORY_HOST); hypre_TFree(B_s, HYPRE_MEMORY_HOST); hypre_TFree(smooth_vec_offd, HYPRE_MEMORY_HOST); - + /* Now we truncate here (instead of after forming the interp matrix) */ /* SAME code as in othr interp routines: - Compress P, removing coefficients smaller than trunc_factor * Max , + Compress P, removing coefficients smaller than trunc_factor * Max , or when there are more than max_elements*/ if (trunc_factor != 0.0 || max_elmts > 0) @@ -475,7 +497,7 @@ HYPRE_Int hypre_BoomerAMGFitInterpVectors( hypre_ParCSRMatrix *A, /* To DO: THIS HAS A BUG IN PARALLEL! */ tmp_int = P_offd_size; - + hypre_BoomerAMGInterpTruncation(*P, trunc_factor, max_elmts); P_diag_data = hypre_CSRMatrixData(P_diag); P_diag_i = hypre_CSRMatrixI(P_diag); @@ -484,22 +506,24 @@ HYPRE_Int hypre_BoomerAMGFitInterpVectors( hypre_ParCSRMatrix *A, P_offd_i = hypre_CSRMatrixI(P_offd); P_offd_j = hypre_CSRMatrixJ(P_offd); P_diag_size = P_diag_i[num_rows_P]; - + P_offd_size = P_offd_i[num_rows_P]; - + /* if truncation occurred, we need to re-do the col_map_offd... */ if (tmp_int != P_offd_size) { - HYPRE_Int *tmp_map_offd; + HYPRE_Int *tmp_map_offd; num_cols_P_offd = 0; P_marker = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_HOST); - for (i=0; i < num_cols_A_offd; i++) + for (i = 0; i < num_cols_A_offd; i++) + { P_marker[i] = 0; + } num_cols_P_offd = 0; - for (i=0; i < P_offd_size; i++) + for (i = 0; i < P_offd_size; i++) { index = P_offd_j[i]; if (!P_marker[index]) @@ -513,16 +537,16 @@ HYPRE_Int hypre_BoomerAMGFitInterpVectors( hypre_ParCSRMatrix *A, tmp_map_offd = hypre_CTAlloc(HYPRE_Int, num_cols_P_offd, HYPRE_MEMORY_HOST); index = 0; - for (i=0; i < num_cols_P_offd; i++) + for (i = 0; i < num_cols_P_offd; i++) { - while (P_marker[index]==0) index++; + while (P_marker[index] == 0) { index++; } tmp_map_offd[i] = index++; } - for (i=0; i < P_offd_size; i++) + for (i = 0; i < P_offd_size; i++) P_offd_j[i] = hypre_BinarySearch(tmp_map_offd, P_offd_j[i], num_cols_P_offd); - hypre_TFree(P_marker, HYPRE_MEMORY_HOST); + hypre_TFree(P_marker, HYPRE_MEMORY_HOST); hypre_TFree( hypre_ParCSRMatrixColMapOffd(*P), HYPRE_MEMORY_HOST); /* assign new col map */ @@ -536,10 +560,10 @@ HYPRE_Int hypre_BoomerAMGFitInterpVectors( hypre_ParCSRMatrix *A, hypre_TFree(tmp_map_offd); }/*end re-do col_map_offd */ - + }/*end trucation */ - + return hypre_error_flag; - - + + } diff --git a/external/hypre/src/parcsr_ls/par_vardifconv.c b/external/hypre/src/parcsr_ls/par_vardifconv.c index f0483b8e..2ec17846 100644 --- a/external/hypre/src/parcsr_ls/par_vardifconv.c +++ b/external/hypre/src/parcsr_ls/par_vardifconv.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -36,10 +36,10 @@ GenerateVarDifConv( MPI_Comm comm, HYPRE_Int *diag_j; HYPRE_Real *diag_data; - HYPRE_Int *offd_i; - HYPRE_Int *offd_j; - HYPRE_BigInt *big_offd_j; - HYPRE_Real *offd_data; + HYPRE_Int *offd_i = NULL; + HYPRE_Int *offd_j = NULL; + HYPRE_BigInt *big_offd_j = NULL; + HYPRE_Real *offd_data = NULL; HYPRE_BigInt global_part[2]; HYPRE_BigInt ix, iy, iz; @@ -47,7 +47,7 @@ GenerateVarDifConv( MPI_Comm comm, HYPRE_Int local_num_rows; HYPRE_BigInt *col_map_offd; HYPRE_Int row_index; - HYPRE_Int i,j; + HYPRE_Int i, j; HYPRE_Int nx_local, ny_local, nz_local; HYPRE_Int num_cols_offd; @@ -64,62 +64,64 @@ GenerateVarDifConv( MPI_Comm comm, HYPRE_Real xx, yy, zz; HYPRE_Real afp, afm, bfp, bfm, cfp, cfm, df, ef, ff, gf; - hypre_MPI_Comm_size(comm,&num_procs); + hypre_MPI_Comm_size(comm, &num_procs); - grid_size = nx*ny*nz; + grid_size = nx * ny * nz; - hypre_GeneratePartitioning(nx,P,&nx_part); - hypre_GeneratePartitioning(ny,Q,&ny_part); - hypre_GeneratePartitioning(nz,R,&nz_part); + hypre_GeneratePartitioning(nx, P, &nx_part); + hypre_GeneratePartitioning(ny, Q, &ny_part); + hypre_GeneratePartitioning(nz, R, &nz_part); - nx_local = (HYPRE_Int)(nx_part[p+1] - nx_part[p]); - ny_local = (HYPRE_Int)(ny_part[q+1] - ny_part[q]); - nz_local = (HYPRE_Int)(nz_part[r+1] - nz_part[r]); + nx_local = (HYPRE_Int)(nx_part[p + 1] - nx_part[p]); + ny_local = (HYPRE_Int)(ny_part[q + 1] - ny_part[q]); + nz_local = (HYPRE_Int)(nz_part[r + 1] - nz_part[r]); - local_num_rows = nx_local*ny_local*nz_local; + local_num_rows = nx_local * ny_local * nz_local; - global_part[0] = nz_part[r]*nx*ny+(ny_part[q]*nx+nx_part[p]*ny_local)*nz_local; + global_part[0] = nz_part[r] * nx * ny + (ny_part[q] * nx + nx_part[p] * ny_local) * nz_local; global_part[1] = global_part[0] + (HYPRE_BigInt)local_num_rows; - diag_i = hypre_CTAlloc(HYPRE_Int, local_num_rows+1, HYPRE_MEMORY_HOST); - offd_i = hypre_CTAlloc(HYPRE_Int, local_num_rows+1, HYPRE_MEMORY_HOST); + diag_i = hypre_CTAlloc(HYPRE_Int, local_num_rows + 1, HYPRE_MEMORY_HOST); + offd_i = hypre_CTAlloc(HYPRE_Int, local_num_rows + 1, HYPRE_MEMORY_HOST); rhs_data = hypre_CTAlloc(HYPRE_Real, local_num_rows, HYPRE_MEMORY_HOST); - P_busy = hypre_min(nx,P); - Q_busy = hypre_min(ny,Q); - R_busy = hypre_min(nz,R); + P_busy = hypre_min(nx, P); + Q_busy = hypre_min(ny, Q); + R_busy = hypre_min(nz, R); num_cols_offd = 0; - if (p) num_cols_offd += ny_local*nz_local; - if (p < P_busy-1) num_cols_offd += ny_local*nz_local; - if (q) num_cols_offd += nx_local*nz_local; - if (q < Q_busy-1) num_cols_offd += nx_local*nz_local; - if (r) num_cols_offd += nx_local*ny_local; - if (r < R_busy-1) num_cols_offd += nx_local*ny_local; + if (p) { num_cols_offd += ny_local * nz_local; } + if (p < P_busy - 1) { num_cols_offd += ny_local * nz_local; } + if (q) { num_cols_offd += nx_local * nz_local; } + if (q < Q_busy - 1) { num_cols_offd += nx_local * nz_local; } + if (r) { num_cols_offd += nx_local * ny_local; } + if (r < R_busy - 1) { num_cols_offd += nx_local * ny_local; } - if (!local_num_rows) num_cols_offd = 0; + if (!local_num_rows) { num_cols_offd = 0; } col_map_offd = hypre_CTAlloc(HYPRE_BigInt, num_cols_offd, HYPRE_MEMORY_HOST); - hhx = 1.0/(HYPRE_Real)(nx+1); - hhy = 1.0/(HYPRE_Real)(ny+1); - hhz = 1.0/(HYPRE_Real)(nz+1); + hhx = 1.0 / (HYPRE_Real)(nx + 1); + hhy = 1.0 / (HYPRE_Real)(ny + 1); + hhz = 1.0 / (HYPRE_Real)(nz + 1); cnt = 1; o_cnt = 1; diag_i[0] = 0; offd_i[0] = 0; - for (iz = nz_part[r]; iz < nz_part[r+1]; iz++) + for (iz = nz_part[r]; iz < nz_part[r + 1]; iz++) { - for (iy = ny_part[q]; iy < ny_part[q+1]; iy++) + for (iy = ny_part[q]; iy < ny_part[q + 1]; iy++) { - for (ix = nx_part[p]; ix < nx_part[p+1]; ix++) + for (ix = nx_part[p]; ix < nx_part[p + 1]; ix++) { - diag_i[cnt] = diag_i[cnt-1]; - offd_i[o_cnt] = offd_i[o_cnt-1]; + diag_i[cnt] = diag_i[cnt - 1]; + offd_i[o_cnt] = offd_i[o_cnt - 1]; diag_i[cnt]++; if (iz > nz_part[r]) + { diag_i[cnt]++; + } else { if (iz) @@ -128,7 +130,9 @@ GenerateVarDifConv( MPI_Comm comm, } } if (iy > ny_part[q]) + { diag_i[cnt]++; + } else { if (iy) @@ -137,7 +141,9 @@ GenerateVarDifConv( MPI_Comm comm, } } if (ix > nx_part[p]) + { diag_i[cnt]++; + } else { if (ix) @@ -145,29 +151,35 @@ GenerateVarDifConv( MPI_Comm comm, offd_i[o_cnt]++; } } - if (ix+1 < nx_part[p+1]) + if (ix + 1 < nx_part[p + 1]) + { diag_i[cnt]++; + } else { - if (ix+1 < nx) + if (ix + 1 < nx) { offd_i[o_cnt]++; } } - if (iy+1 < ny_part[q+1]) + if (iy + 1 < ny_part[q + 1]) + { diag_i[cnt]++; + } else { - if (iy+1 < ny) + if (iy + 1 < ny) { offd_i[o_cnt]++; } } - if (iz+1 < nz_part[r+1]) + if (iz + 1 < nz_part[r + 1]) + { diag_i[cnt]++; + } else { - if (iz+1 < nz) + if (iz + 1 < nz) { offd_i[o_cnt]++; } @@ -191,116 +203,116 @@ GenerateVarDifConv( MPI_Comm comm, row_index = 0; cnt = 0; o_cnt = 0; - for (iz = nz_part[r]; iz < nz_part[r+1]; iz++) + for (iz = nz_part[r]; iz < nz_part[r + 1]; iz++) { - zz = (HYPRE_Real)(iz+1)*hhz; - for (iy = ny_part[q]; iy < ny_part[q+1]; iy++) + zz = (HYPRE_Real)(iz + 1) * hhz; + for (iy = ny_part[q]; iy < ny_part[q + 1]; iy++) { - yy = (HYPRE_Real)(iy+1)*hhy; - for (ix = nx_part[p]; ix < nx_part[p+1]; ix++) + yy = (HYPRE_Real)(iy + 1) * hhy; + for (ix = nx_part[p]; ix < nx_part[p + 1]; ix++) { - xx = (HYPRE_Real)(ix+1)*hhx; - afp = eps*afun(xx+0.5*hhx,yy,zz)/hhx/hhx; - afm = eps*afun(xx-0.5*hhx,yy,zz)/hhx/hhx; - bfp = eps*bfun(xx,yy+0.5*hhy,zz)/hhy/hhy; - bfm = eps*bfun(xx,yy-0.5*hhy,zz)/hhy/hhy; - cfp = eps*cfun(xx,yy,zz+0.5*hhz)/hhz/hhz; - cfm = eps*cfun(xx,yy,zz-0.5*hhz)/hhz/hhz; - df = dfun(xx,yy,zz)/hhx; - ef = efun(xx,yy,zz)/hhy; - ff = ffun(xx,yy,zz)/hhz; - gf = gfun(xx,yy,zz); + xx = (HYPRE_Real)(ix + 1) * hhx; + afp = eps * afun(xx + 0.5 * hhx, yy, zz) / hhx / hhx; + afm = eps * afun(xx - 0.5 * hhx, yy, zz) / hhx / hhx; + bfp = eps * bfun(xx, yy + 0.5 * hhy, zz) / hhy / hhy; + bfm = eps * bfun(xx, yy - 0.5 * hhy, zz) / hhy / hhy; + cfp = eps * cfun(xx, yy, zz + 0.5 * hhz) / hhz / hhz; + cfm = eps * cfun(xx, yy, zz - 0.5 * hhz) / hhz / hhz; + df = dfun(xx, yy, zz) / hhx; + ef = efun(xx, yy, zz) / hhy; + ff = ffun(xx, yy, zz) / hhz; + gf = gfun(xx, yy, zz); diag_j[cnt] = row_index; - diag_data[cnt++] = afp+afm+bfp+bfm+cfp+cfm+gf-df-ef-ff; - rhs_data[row_index] = rfun(xx,yy,zz); - if (ix == 0) rhs_data[row_index] += afm*bndfun(0,yy,zz); - if (iy == 0) rhs_data[row_index] += bfm*bndfun(xx,0,zz); - if (iz == 0) rhs_data[row_index] += cfm*bndfun(xx,yy,0); - if (ix+1 == nx) rhs_data[row_index] += (afp-df)*bndfun(1.0,yy,zz); - if (iy+1 == ny) rhs_data[row_index] += (bfp-ef)*bndfun(xx,1.0,zz); - if (iz+1 == nz) rhs_data[row_index] += (cfp-ff)*bndfun(xx,yy,1.0); + diag_data[cnt++] = afp + afm + bfp + bfm + cfp + cfm + gf - df - ef - ff; + rhs_data[row_index] = rfun(xx, yy, zz); + if (ix == 0) { rhs_data[row_index] += afm * bndfun(0, yy, zz); } + if (iy == 0) { rhs_data[row_index] += bfm * bndfun(xx, 0, zz); } + if (iz == 0) { rhs_data[row_index] += cfm * bndfun(xx, yy, 0); } + if (ix + 1 == nx) { rhs_data[row_index] += (afp - df) * bndfun(1.0, yy, zz); } + if (iy + 1 == ny) { rhs_data[row_index] += (bfp - ef) * bndfun(xx, 1.0, zz); } + if (iz + 1 == nz) { rhs_data[row_index] += (cfp - ff) * bndfun(xx, yy, 1.0); } if (iz > nz_part[r]) { - diag_j[cnt] = row_index-nx_local*ny_local; + diag_j[cnt] = row_index - nx_local * ny_local; diag_data[cnt++] = -cfm; } else { if (iz) { - big_offd_j[o_cnt] = hypre_map(ix,iy,iz-1,p,q,r-1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix, iy, iz - 1, p, q, r - 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = -cfm; } } if (iy > ny_part[q]) { - diag_j[cnt] = row_index-nx_local; + diag_j[cnt] = row_index - nx_local; diag_data[cnt++] = -bfm; } else { if (iy) { - big_offd_j[o_cnt] = hypre_map(ix,iy-1,iz,p,q-1,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix, iy - 1, iz, p, q - 1, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = -bfm; } } if (ix > nx_part[p]) { - diag_j[cnt] = row_index-1; + diag_j[cnt] = row_index - 1; diag_data[cnt++] = -afm; } else { if (ix) { - big_offd_j[o_cnt] = hypre_map(ix-1,iy,iz,p-1,q,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix - 1, iy, iz, p - 1, q, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = -afm; } } - if (ix+1 < nx_part[p+1]) + if (ix + 1 < nx_part[p + 1]) { - diag_j[cnt] = row_index+1; - diag_data[cnt++] = -afp+df; + diag_j[cnt] = row_index + 1; + diag_data[cnt++] = -afp + df; } else { - if (ix+1 < nx) + if (ix + 1 < nx) { - big_offd_j[o_cnt] = hypre_map(ix+1,iy,iz,p+1,q,r,nx,ny, - nx_part,ny_part,nz_part); - offd_data[o_cnt++] = -afp+df; + big_offd_j[o_cnt] = hypre_map(ix + 1, iy, iz, p + 1, q, r, nx, ny, + nx_part, ny_part, nz_part); + offd_data[o_cnt++] = -afp + df; } } - if (iy+1 < ny_part[q+1]) + if (iy + 1 < ny_part[q + 1]) { - diag_j[cnt] = row_index+nx_local; - diag_data[cnt++] = -bfp +ef; + diag_j[cnt] = row_index + nx_local; + diag_data[cnt++] = -bfp + ef; } else { - if (iy+1 < ny) + if (iy + 1 < ny) { - big_offd_j[o_cnt] = hypre_map(ix,iy+1,iz,p,q+1,r,nx,ny, - nx_part,ny_part,nz_part); - offd_data[o_cnt++] = -bfp+ef; + big_offd_j[o_cnt] = hypre_map(ix, iy + 1, iz, p, q + 1, r, nx, ny, + nx_part, ny_part, nz_part); + offd_data[o_cnt++] = -bfp + ef; } } - if (iz+1 < nz_part[r+1]) + if (iz + 1 < nz_part[r + 1]) { - diag_j[cnt] = row_index+nx_local*ny_local; - diag_data[cnt++] = -cfp+ff; + diag_j[cnt] = row_index + nx_local * ny_local; + diag_data[cnt++] = -cfp + ff; } else { - if (iz+1 < nz) + if (iz + 1 < nz) { - big_offd_j[o_cnt] = hypre_map(ix,iy,iz+1,p,q,r+1,nx,ny, - nx_part,ny_part,nz_part); - offd_data[o_cnt++] = -cfp+ff; + big_offd_j[o_cnt] = hypre_map(ix, iy, iz + 1, p, q, r + 1, nx, ny, + nx_part, ny_part, nz_part); + offd_data[o_cnt++] = -cfp + ff; } } row_index++; @@ -310,13 +322,15 @@ GenerateVarDifConv( MPI_Comm comm, if (num_procs > 1) { - for (i=0; i < num_cols_offd; i++) + for (i = 0; i < num_cols_offd; i++) + { col_map_offd[i] = big_offd_j[i]; + } - hypre_BigQsort0(col_map_offd, 0, num_cols_offd-1); + hypre_BigQsort0(col_map_offd, 0, num_cols_offd - 1); - for (i=0; i < num_cols_offd; i++) - for (j=0; j < num_cols_offd; j++) + for (i = 0; i < num_cols_offd; i++) + for (j = 0; j < num_cols_offd; j++) if (big_offd_j[i] == col_map_offd[j]) { offd_j[i] = j; @@ -368,56 +382,68 @@ GenerateVarDifConv( MPI_Comm comm, HYPRE_Real afun(HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz) { HYPRE_Real value; - /* value = 1.0 + 1000.0*fabs(xx-yy); */ + /* value = 1.0 + 1000.0*hypre_abs(xx-yy); */ if ((xx < 0.1 && yy < 0.1 && zz < 0.1) - || (xx < 0.1 && yy < 0.1 && zz > 0.9) - || (xx < 0.1 && yy > 0.9 && zz < 0.1) - || (xx > 0.9 && yy < 0.1 && zz < 0.1) - || (xx > 0.9 && yy > 0.9 && zz < 0.1) - || (xx > 0.9 && yy < 0.1 && zz > 0.9) - || (xx < 0.1 && yy > 0.9 && zz > 0.9) - || (xx > 0.9 && yy > 0.9 && zz > 0.9)) + || (xx < 0.1 && yy < 0.1 && zz > 0.9) + || (xx < 0.1 && yy > 0.9 && zz < 0.1) + || (xx > 0.9 && yy < 0.1 && zz < 0.1) + || (xx > 0.9 && yy > 0.9 && zz < 0.1) + || (xx > 0.9 && yy < 0.1 && zz > 0.9) + || (xx < 0.1 && yy > 0.9 && zz > 0.9) + || (xx > 0.9 && yy > 0.9 && zz > 0.9)) + { value = 0.01; + } else if (xx >= 0.1 && xx <= 0.9 - && yy >= 0.1 && yy <= 0.9 - && zz >= 0.1 && zz <= 0.9) + && yy >= 0.1 && yy <= 0.9 + && zz >= 0.1 && zz <= 0.9) + { value = 1000.0; + } else + { value = 1.0 ; + } /* HYPRE_Real value, pi; - pi = 4.0 * atan(1.0); - value = cos(pi*xx)*cos(pi*yy); */ + pi = 4.0 * hypre_atan(1.0); + value = hypre_cos(pi*xx)*hypre_cos(pi*yy); */ return value; } HYPRE_Real bfun(HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz) { HYPRE_Real value; - /* value = 1.0 + 1000.0*fabs(xx-yy); */ + /* value = 1.0 + 1000.0*hypre_abs(xx-yy); */ if ((xx < 0.1 && yy < 0.1 && zz < 0.1) - || (xx < 0.1 && yy < 0.1 && zz > 0.9) - || (xx < 0.1 && yy > 0.9 && zz < 0.1) - || (xx > 0.9 && yy < 0.1 && zz < 0.1) - || (xx > 0.9 && yy > 0.9 && zz < 0.1) - || (xx > 0.9 && yy < 0.1 && zz > 0.9) - || (xx < 0.1 && yy > 0.9 && zz > 0.9) - || (xx > 0.9 && yy > 0.9 && zz > 0.9)) + || (xx < 0.1 && yy < 0.1 && zz > 0.9) + || (xx < 0.1 && yy > 0.9 && zz < 0.1) + || (xx > 0.9 && yy < 0.1 && zz < 0.1) + || (xx > 0.9 && yy > 0.9 && zz < 0.1) + || (xx > 0.9 && yy < 0.1 && zz > 0.9) + || (xx < 0.1 && yy > 0.9 && zz > 0.9) + || (xx > 0.9 && yy > 0.9 && zz > 0.9)) + { value = 0.01; + } else if (xx >= 0.1 && xx <= 0.9 - && yy >= 0.1 && yy <= 0.9 - && zz >= 0.1 && zz <= 0.9) + && yy >= 0.1 && yy <= 0.9 + && zz >= 0.1 && zz <= 0.9) + { value = 1000.0; + } else + { value = 1.0 ; + } /* HYPRE_Real value, pi; - pi = 4.0 * atan(1.0); + pi = 4.0 * hypre_atan(1.0); value = 1.0 - 2.0*xx; - value = cos(pi*xx)*cos(pi*yy); */ + value = hypre_cos(pi*xx)*hypre_cos(pi*yy); */ /* HYPRE_Real value; - value = 1.0 + 1000.0 * fabs(xx-yy); + value = 1.0 + 1000.0 * hypre_abs(xx-yy); HYPRE_Real value, x0, y0; - x0 = fabs(xx - 0.5); - y0 = fabs(yy - 0.5); + x0 = hypre_abs(xx - 0.5); + y0 = hypre_abs(yy - 0.5); if (y0 > x0) x0 = y0; if (x0 >= 0.125 && x0 <= 0.25) value = 1.0; @@ -430,20 +456,26 @@ HYPRE_Real cfun(HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz) { HYPRE_Real value; if ((xx < 0.1 && yy < 0.1 && zz < 0.1) - || (xx < 0.1 && yy < 0.1 && zz > 0.9) - || (xx < 0.1 && yy > 0.9 && zz < 0.1) - || (xx > 0.9 && yy < 0.1 && zz < 0.1) - || (xx > 0.9 && yy > 0.9 && zz < 0.1) - || (xx > 0.9 && yy < 0.1 && zz > 0.9) - || (xx < 0.1 && yy > 0.9 && zz > 0.9) - || (xx > 0.9 && yy > 0.9 && zz > 0.9)) + || (xx < 0.1 && yy < 0.1 && zz > 0.9) + || (xx < 0.1 && yy > 0.9 && zz < 0.1) + || (xx > 0.9 && yy < 0.1 && zz < 0.1) + || (xx > 0.9 && yy > 0.9 && zz < 0.1) + || (xx > 0.9 && yy < 0.1 && zz > 0.9) + || (xx < 0.1 && yy > 0.9 && zz > 0.9) + || (xx > 0.9 && yy > 0.9 && zz > 0.9)) + { value = 0.01; + } else if (xx >= 0.1 && xx <= 0.9 - && yy >= 0.1 && yy <= 0.9 - && zz >= 0.1 && zz <= 0.9) + && yy >= 0.1 && yy <= 0.9 + && zz >= 0.1 && zz <= 0.9) + { value = 1000.0; + } else + { value = 1.0 ; + } /*if (xx <= 0.75 && yy <= 0.75 && zz <= 0.75) value = 0.1; else if (xx > 0.75 && yy > 0.75 && zz > 0.75) @@ -455,26 +487,38 @@ HYPRE_Real cfun(HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz) HYPRE_Real dfun(HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz) { + HYPRE_UNUSED_VAR(xx); + HYPRE_UNUSED_VAR(yy); + HYPRE_UNUSED_VAR(zz); + HYPRE_Real value; /*HYPRE_Real pi; - pi = 4.0 * atan(1.0); - value = -sin(pi*xx)*cos(pi*yy);*/ + pi = 4.0 * hypre_atan(1.0); + value = -hypre_sin(pi*xx)*hypre_cos(pi*yy);*/ value = 0; return value; } HYPRE_Real efun(HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz) { + HYPRE_UNUSED_VAR(xx); + HYPRE_UNUSED_VAR(yy); + HYPRE_UNUSED_VAR(zz); + HYPRE_Real value; /*HYPRE_Real pi; - pi = 4.0 * atan(1.0); - value = sin(pi*yy)*cos(pi*xx);*/ + pi = 4.0 * hypre_atan(1.0); + value = hypre_sin(pi*yy)*hypre_cos(pi*xx);*/ value = 0; return value; } HYPRE_Real ffun(HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz) { + HYPRE_UNUSED_VAR(xx); + HYPRE_UNUSED_VAR(yy); + HYPRE_UNUSED_VAR(zz); + HYPRE_Real value; value = 0.0; return value; @@ -482,6 +526,10 @@ HYPRE_Real ffun(HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz) HYPRE_Real gfun(HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz) { + HYPRE_UNUSED_VAR(xx); + HYPRE_UNUSED_VAR(yy); + HYPRE_UNUSED_VAR(zz); + HYPRE_Real value; value = 0.0; return value; @@ -489,9 +537,13 @@ HYPRE_Real gfun(HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz) HYPRE_Real rfun(HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz) { + HYPRE_UNUSED_VAR(xx); + HYPRE_UNUSED_VAR(yy); + HYPRE_UNUSED_VAR(zz); + /* HYPRE_Real value, pi; - pi = 4.0 * atan(1.0); - value = -4.0*pi*pi*sin(pi*xx)*sin(pi*yy)*cos(pi*xx)*cos(pi*yy); */ + pi = 4.0 * hypre_atan(1.0); + value = -4.0*pi*pi*hypre_sin(pi*xx)*hypre_sin(pi*yy)*hypre_cos(pi*xx)*hypre_cos(pi*yy); */ HYPRE_Real value; /* value = xx*(1.0-xx)*yy*(1.0-yy); */ value = 1.0; @@ -500,10 +552,14 @@ HYPRE_Real rfun(HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz) HYPRE_Real bndfun(HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz) { + HYPRE_UNUSED_VAR(xx); + HYPRE_UNUSED_VAR(yy); + HYPRE_UNUSED_VAR(zz); + HYPRE_Real value; /*HYPRE_Real pi; pi = 4.0 * atan(1.0); - value = sin(pi*xx)+sin(13*pi*xx)+sin(pi*yy)+sin(13*pi*yy);*/ + value = hypre_sin(pi*xx)+hypre_sin(13*pi*xx)+hypre_sin(pi*yy)+hypre_sin(13*pi*yy);*/ value = 0.0; return value; } diff --git a/external/hypre/src/parcsr_ls/par_vardifconv_rs.c b/external/hypre/src/parcsr_ls/par_vardifconv_rs.c index 5e5cb20b..6a9a1d11 100644 --- a/external/hypre/src/parcsr_ls/par_vardifconv_rs.c +++ b/external/hypre/src/parcsr_ls/par_vardifconv_rs.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -21,19 +21,19 @@ static HYPRE_Real rs_l = 3.0; *--------------------------------------------------------------------------*/ HYPRE_ParCSRMatrix -GenerateRSVarDifConv( MPI_Comm comm, - HYPRE_BigInt nx, - HYPRE_BigInt ny, - HYPRE_BigInt nz, - HYPRE_Int P, - HYPRE_Int Q, - HYPRE_Int R, - HYPRE_Int p, - HYPRE_Int q, - HYPRE_Int r, - HYPRE_Real eps, - HYPRE_ParVector *rhs_ptr, - HYPRE_Int type) +GenerateRSVarDifConv( MPI_Comm comm, + HYPRE_BigInt nx, + HYPRE_BigInt ny, + HYPRE_BigInt nz, + HYPRE_Int P, + HYPRE_Int Q, + HYPRE_Int R, + HYPRE_Int p, + HYPRE_Int q, + HYPRE_Int r, + HYPRE_Real eps, + HYPRE_ParVector *rhs_ptr, + HYPRE_Int type) { hypre_ParCSRMatrix *A; hypre_CSRMatrix *diag; @@ -46,18 +46,18 @@ GenerateRSVarDifConv( MPI_Comm comm, HYPRE_Int *diag_j; HYPRE_Real *diag_data; - HYPRE_Int *offd_i; - HYPRE_Int *offd_j; - HYPRE_BigInt *big_offd_j; - HYPRE_Real *offd_data; + HYPRE_Int *offd_i = NULL; + HYPRE_Int *offd_j = NULL; + HYPRE_BigInt *big_offd_j = NULL; + HYPRE_Real *offd_data = NULL; - HYPRE_BigInt *global_part; + HYPRE_BigInt global_part[2]; HYPRE_BigInt ix, iy, iz; HYPRE_Int cnt, o_cnt; HYPRE_Int local_num_rows; HYPRE_BigInt *col_map_offd; HYPRE_Int row_index; - HYPRE_Int i,j; + HYPRE_Int i, j; HYPRE_Int nx_local, ny_local, nz_local; HYPRE_Int num_cols_offd; @@ -76,70 +76,70 @@ GenerateRSVarDifConv( MPI_Comm comm, HYPRE_Real afp, afm, bfp, bfm, cfp, cfm, di, ai, mux, ei, bi, muy, fi, ci, muz, dfm, dfp, efm, efp, ffm, ffp, gi; - hypre_MPI_Comm_size(comm,&num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); if (type >= 1 && type <= 3) { - rs_example = type; + rs_example = type; } - grid_size = nx*ny*nz; + grid_size = nx * ny * nz; - hypre_GeneratePartitioning(nx,P,&nx_part); - hypre_GeneratePartitioning(ny,Q,&ny_part); - hypre_GeneratePartitioning(nz,R,&nz_part); + hypre_GeneratePartitioning(nx, P, &nx_part); + hypre_GeneratePartitioning(ny, Q, &ny_part); + hypre_GeneratePartitioning(nz, R, &nz_part); - nx_local = (HYPRE_Int)(nx_part[p+1] - nx_part[p]); - ny_local = (HYPRE_Int)(ny_part[q+1] - ny_part[q]); - nz_local = (HYPRE_Int)(nz_part[r+1] - nz_part[r]); + nx_local = (HYPRE_Int)(nx_part[p + 1] - nx_part[p]); + ny_local = (HYPRE_Int)(ny_part[q + 1] - ny_part[q]); + nz_local = (HYPRE_Int)(nz_part[r + 1] - nz_part[r]); - local_num_rows = nx_local*ny_local*nz_local; + local_num_rows = nx_local * ny_local * nz_local; - - global_part = hypre_CTAlloc(HYPRE_BigInt,2,HYPRE_MEMORY_HOST); - global_part[0] = nz_part[r]*nx*ny+(ny_part[q]*nx+nx_part[p]*ny_local)*nz_local; + global_part[0] = nz_part[r] * nx * ny + (ny_part[q] * nx + nx_part[p] * ny_local) * nz_local; global_part[1] = global_part[0] + (HYPRE_BigInt)local_num_rows; - diag_i = hypre_CTAlloc(HYPRE_Int, local_num_rows+1, HYPRE_MEMORY_HOST); - offd_i = hypre_CTAlloc(HYPRE_Int, local_num_rows+1, HYPRE_MEMORY_HOST); + diag_i = hypre_CTAlloc(HYPRE_Int, local_num_rows + 1, HYPRE_MEMORY_HOST); + offd_i = hypre_CTAlloc(HYPRE_Int, local_num_rows + 1, HYPRE_MEMORY_HOST); rhs_data = hypre_CTAlloc(HYPRE_Real, local_num_rows, HYPRE_MEMORY_HOST); - P_busy = hypre_min(nx,P); - Q_busy = hypre_min(ny,Q); - R_busy = hypre_min(nz,R); + P_busy = hypre_min(nx, P); + Q_busy = hypre_min(ny, Q); + R_busy = hypre_min(nz, R); num_cols_offd = 0; - if (p) num_cols_offd += ny_local*nz_local; - if (p < P_busy-1) num_cols_offd += ny_local*nz_local; - if (q) num_cols_offd += nx_local*nz_local; - if (q < Q_busy-1) num_cols_offd += nx_local*nz_local; - if (r) num_cols_offd += nx_local*ny_local; - if (r < R_busy-1) num_cols_offd += nx_local*ny_local; + if (p) { num_cols_offd += ny_local * nz_local; } + if (p < P_busy - 1) { num_cols_offd += ny_local * nz_local; } + if (q) { num_cols_offd += nx_local * nz_local; } + if (q < Q_busy - 1) { num_cols_offd += nx_local * nz_local; } + if (r) { num_cols_offd += nx_local * ny_local; } + if (r < R_busy - 1) { num_cols_offd += nx_local * ny_local; } - if (!local_num_rows) num_cols_offd = 0; + if (!local_num_rows) { num_cols_offd = 0; } col_map_offd = hypre_CTAlloc(HYPRE_BigInt, num_cols_offd, HYPRE_MEMORY_HOST); - hhx = 1.0/(HYPRE_Real)(nx+1); - hhy = 1.0/(HYPRE_Real)(ny+1); - hhz = 1.0/(HYPRE_Real)(nz+1); + hhx = 1.0 / (HYPRE_Real)(nx + 1); + hhy = 1.0 / (HYPRE_Real)(ny + 1); + hhz = 1.0 / (HYPRE_Real)(nz + 1); cnt = 1; o_cnt = 1; diag_i[0] = 0; offd_i[0] = 0; - for (iz = nz_part[r]; iz < nz_part[r+1]; iz++) + for (iz = nz_part[r]; iz < nz_part[r + 1]; iz++) { - for (iy = ny_part[q]; iy < ny_part[q+1]; iy++) + for (iy = ny_part[q]; iy < ny_part[q + 1]; iy++) { - for (ix = nx_part[p]; ix < nx_part[p+1]; ix++) + for (ix = nx_part[p]; ix < nx_part[p + 1]; ix++) { - diag_i[cnt] = diag_i[cnt-1]; - offd_i[o_cnt] = offd_i[o_cnt-1]; + diag_i[cnt] = diag_i[cnt - 1]; + offd_i[o_cnt] = offd_i[o_cnt - 1]; diag_i[cnt]++; if (iz > nz_part[r]) + { diag_i[cnt]++; + } else { if (iz) @@ -148,7 +148,9 @@ GenerateRSVarDifConv( MPI_Comm comm, } } if (iy > ny_part[q]) + { diag_i[cnt]++; + } else { if (iy) @@ -157,7 +159,9 @@ GenerateRSVarDifConv( MPI_Comm comm, } } if (ix > nx_part[p]) + { diag_i[cnt]++; + } else { if (ix) @@ -165,29 +169,35 @@ GenerateRSVarDifConv( MPI_Comm comm, offd_i[o_cnt]++; } } - if (ix+1 < nx_part[p+1]) + if (ix + 1 < nx_part[p + 1]) + { diag_i[cnt]++; + } else { - if (ix+1 < nx) + if (ix + 1 < nx) { offd_i[o_cnt]++; } } - if (iy+1 < ny_part[q+1]) + if (iy + 1 < ny_part[q + 1]) + { diag_i[cnt]++; + } else { - if (iy+1 < ny) + if (iy + 1 < ny) { offd_i[o_cnt]++; } } - if (iz+1 < nz_part[r+1]) + if (iz + 1 < nz_part[r + 1]) + { diag_i[cnt]++; + } else { - if (iz+1 < nz) + if (iz + 1 < nz) { offd_i[o_cnt]++; } @@ -211,100 +221,100 @@ GenerateRSVarDifConv( MPI_Comm comm, row_index = 0; cnt = 0; o_cnt = 0; - for (iz = nz_part[r]; iz < nz_part[r+1]; iz++) + for (iz = nz_part[r]; iz < nz_part[r + 1]; iz++) { - zz = (HYPRE_Real)(iz+1)*hhz; - for (iy = ny_part[q]; iy < ny_part[q+1]; iy++) + zz = (HYPRE_Real)(iz + 1) * hhz; + for (iy = ny_part[q]; iy < ny_part[q + 1]; iy++) { - yy = (HYPRE_Real)(iy+1)*hhy; - for (ix = nx_part[p]; ix < nx_part[p+1]; ix++) + yy = (HYPRE_Real)(iy + 1) * hhy; + for (ix = nx_part[p]; ix < nx_part[p + 1]; ix++) { - xx = (HYPRE_Real)(ix+1)*hhx; - afp = -eps*afun_rs(xx+0.5*hhx,yy,zz)/hhx/hhx; - afm = -eps*afun_rs(xx-0.5*hhx,yy,zz)/hhx/hhx; - bfp = -eps*bfun_rs(xx,yy+0.5*hhy,zz)/hhy/hhy; - bfm = -eps*bfun_rs(xx,yy-0.5*hhy,zz)/hhy/hhy; - cfp = -eps*cfun_rs(xx,yy,zz+0.5*hhz)/hhz/hhz; - cfm = -eps*cfun_rs(xx,yy,zz-0.5*hhz)/hhz/hhz; + xx = (HYPRE_Real)(ix + 1) * hhx; + afp = -eps * afun_rs(xx + 0.5 * hhx, yy, zz) / hhx / hhx; + afm = -eps * afun_rs(xx - 0.5 * hhx, yy, zz) / hhx / hhx; + bfp = -eps * bfun_rs(xx, yy + 0.5 * hhy, zz) / hhy / hhy; + bfm = -eps * bfun_rs(xx, yy - 0.5 * hhy, zz) / hhy / hhy; + cfp = -eps * cfun_rs(xx, yy, zz + 0.5 * hhz) / hhz / hhz; + cfm = -eps * cfun_rs(xx, yy, zz - 0.5 * hhz) / hhz / hhz; /* first order terms */ /* x-direction */ di = dfun_rs(xx, yy, zz); ai = afun_rs(xx, yy, zz); if (di * hhx > eps * ai) { - mux = eps * ai / (2.0 * di * hhx); + mux = eps * ai / (2.0 * di * hhx); } else if (di * hhx < -eps * ai) { - mux = 1.0 + eps * ai / (2.0 * di * hhx); + mux = 1.0 + eps * ai / (2.0 * di * hhx); } else { - mux = 0.5; + mux = 0.5; } /* y-direction */ ei = efun_rs(xx, yy, zz); bi = bfun_rs(xx, yy, zz); if (ei * hhy > eps * bi) { - muy = eps * bi / (2.0 * ei * hhy); + muy = eps * bi / (2.0 * ei * hhy); } else if (ei * hhy < -eps * bi) { - muy = 1.0 + eps * bi / (2.0 * ei * hhy); + muy = 1.0 + eps * bi / (2.0 * ei * hhy); } else { - muy = 0.5; + muy = 0.5; } /* z-direction */ fi = ffun_rs(xx, yy, zz); ci = cfun_rs(xx, yy, zz); if (fi * hhz > eps * ci) { - muz = eps * ci / (2.0 * fi * hhz); + muz = eps * ci / (2.0 * fi * hhz); } else if (fi * hhz < -eps * ci) { - muz = 1.0 + eps * ci / (2.0 * fi * hhz); + muz = 1.0 + eps * ci / (2.0 * fi * hhz); } else { - muz = 0.5; + muz = 0.5; } - dfm = di * (mux - 1.0) / hhx; + dfm = di * (mux - 1.0) / hhx; dfp = di * mux / hhx; - efm = ei * (muy - 1.0) / hhy; + efm = ei * (muy - 1.0) / hhy; efp = ei * muy / hhy; ffm = fi * (muz - 1.0) / hhz; - ffp = fi * muz / hhz; - gi = gfun_rs(xx, yy, zz); + ffp = fi * muz / hhz; + gi = gfun_rs(xx, yy, zz); /* stencil: center */ diag_j[cnt] = row_index; diag_data[cnt++] = -(afp + afm + bfp + bfm + cfp + cfm + dfp + dfm + efp + efm + ffp + ffm) + gi; /* rhs vector */ - rhs_data[row_index] = rfun_rs(xx,yy,zz); - /* apply boundary conditions */ - if (ix == 0) rhs_data[row_index] -= (afm+dfm) * bndfun_rs(0,yy,zz); - if (iy == 0) rhs_data[row_index] -= (bfm+efm) * bndfun_rs(xx,0,zz); - if (iz == 0) rhs_data[row_index] -= (cfm+ffm) * bndfun_rs(xx,yy,0); - if (ix+1 == nx) rhs_data[row_index] -= (afp+dfp) * bndfun_rs(1.0,yy,zz); - if (iy+1 == ny) rhs_data[row_index] -= (bfp+efp) * bndfun_rs(xx,1.0,zz); - if (iz+1 == nz) rhs_data[row_index] -= (cfp+ffp) * bndfun_rs(xx,yy,1.0); + rhs_data[row_index] = rfun_rs(xx, yy, zz); + /* apply boundary conditions */ + if (ix == 0) { rhs_data[row_index] -= (afm + dfm) * bndfun_rs(0, yy, zz); } + if (iy == 0) { rhs_data[row_index] -= (bfm + efm) * bndfun_rs(xx, 0, zz); } + if (iz == 0) { rhs_data[row_index] -= (cfm + ffm) * bndfun_rs(xx, yy, 0); } + if (ix + 1 == nx) { rhs_data[row_index] -= (afp + dfp) * bndfun_rs(1.0, yy, zz); } + if (iy + 1 == ny) { rhs_data[row_index] -= (bfp + efp) * bndfun_rs(xx, 1.0, zz); } + if (iz + 1 == nz) { rhs_data[row_index] -= (cfp + ffp) * bndfun_rs(xx, yy, 1.0); } /* stencil: z- */ if (iz > nz_part[r]) { - diag_j[cnt] = row_index - nx_local*ny_local; + diag_j[cnt] = row_index - nx_local * ny_local; diag_data[cnt++] = cfm + ffm; } else { if (iz) { - big_offd_j[o_cnt] = hypre_map(ix,iy,iz-1,p,q,r-1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix, iy, iz - 1, p, q, r - 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = cfm + ffm; } } @@ -318,8 +328,8 @@ GenerateRSVarDifConv( MPI_Comm comm, { if (iy) { - big_offd_j[o_cnt] = hypre_map(ix,iy-1,iz,p,q-1,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix, iy - 1, iz, p, q - 1, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = bfm + efm; } } @@ -333,53 +343,53 @@ GenerateRSVarDifConv( MPI_Comm comm, { if (ix) { - big_offd_j[o_cnt] = hypre_map(ix-1,iy,iz,p-1,q,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix - 1, iy, iz, p - 1, q, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = afm + dfm; } } /* stencil: x+ */ - if (ix+1 < nx_part[p+1]) + if (ix + 1 < nx_part[p + 1]) { diag_j[cnt] = row_index + 1; diag_data[cnt++] = afp + dfp; } else { - if (ix+1 < nx) + if (ix + 1 < nx) { - big_offd_j[o_cnt] = hypre_map(ix+1,iy,iz,p+1,q,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix + 1, iy, iz, p + 1, q, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = afp + dfp; } } /* stencil: y+ */ - if (iy+1 < ny_part[q+1]) + if (iy + 1 < ny_part[q + 1]) { diag_j[cnt] = row_index + nx_local; diag_data[cnt++] = bfp + efp; } else { - if (iy+1 < ny) + if (iy + 1 < ny) { - big_offd_j[o_cnt] = hypre_map(ix,iy+1,iz,p,q+1,r,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix, iy + 1, iz, p, q + 1, r, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = bfp + efp; } } /* stencil: z+ */ - if (iz+1 < nz_part[r+1]) + if (iz + 1 < nz_part[r + 1]) { - diag_j[cnt] = row_index + nx_local*ny_local; + diag_j[cnt] = row_index + nx_local * ny_local; diag_data[cnt++] = cfp + ffp; } else { - if (iz+1 < nz) + if (iz + 1 < nz) { - big_offd_j[o_cnt] = hypre_map(ix,iy,iz+1,p,q,r+1,nx,ny, - nx_part,ny_part,nz_part); + big_offd_j[o_cnt] = hypre_map(ix, iy, iz + 1, p, q, r + 1, nx, ny, + nx_part, ny_part, nz_part); offd_data[o_cnt++] = cfp + ffp; } } @@ -391,13 +401,15 @@ GenerateRSVarDifConv( MPI_Comm comm, if (num_procs > 1) { - for (i=0; i < num_cols_offd; i++) + for (i = 0; i < num_cols_offd; i++) + { col_map_offd[i] = big_offd_j[i]; + } - hypre_BigQsort0(col_map_offd, 0, num_cols_offd-1); + hypre_BigQsort0(col_map_offd, 0, num_cols_offd - 1); - for (i=0; i < num_cols_offd; i++) - for (j=0; j < num_cols_offd; j++) + for (i = 0; i < num_cols_offd; i++) + for (j = 0; j < num_cols_offd; j++) if (big_offd_j[i] == col_map_offd[j]) { offd_j[i] = j; @@ -441,6 +453,10 @@ GenerateRSVarDifConv( MPI_Comm comm, HYPRE_Real afun_rs(HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz) { + HYPRE_UNUSED_VAR(xx); + HYPRE_UNUSED_VAR(yy); + HYPRE_UNUSED_VAR(zz); + HYPRE_Real value; value = 1.0; return value; @@ -448,6 +464,10 @@ HYPRE_Real afun_rs(HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz) HYPRE_Real bfun_rs(HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz) { + HYPRE_UNUSED_VAR(xx); + HYPRE_UNUSED_VAR(yy); + HYPRE_UNUSED_VAR(zz); + HYPRE_Real value; value = 1.0; return value; @@ -455,6 +475,10 @@ HYPRE_Real bfun_rs(HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz) HYPRE_Real cfun_rs(HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz) { + HYPRE_UNUSED_VAR(xx); + HYPRE_UNUSED_VAR(yy); + HYPRE_UNUSED_VAR(zz); + HYPRE_Real value; value = 1.0; return value; @@ -462,36 +486,40 @@ HYPRE_Real cfun_rs(HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz) HYPRE_Real dfun_rs(HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz) { + HYPRE_UNUSED_VAR(zz); + HYPRE_Real value; if (rs_example == 1) { - value = sin(rs_l*M_PI/8.0); + value = hypre_sin(rs_l * M_PI / 8.0); } else if (rs_example == 2) { - value = (2.0*yy-1.0)*(1.0-xx*xx); + value = (2.0 * yy - 1.0) * (1.0 - xx * xx); } else { - value = 4.0*xx*(xx-1.0)*(1.0-2.0*yy); + value = 4.0 * xx * (xx - 1.0) * (1.0 - 2.0 * yy); } return value; } HYPRE_Real efun_rs(HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz) { + HYPRE_UNUSED_VAR(zz); + HYPRE_Real value; if (rs_example == 1) { - value = cos(rs_l*M_PI/8.0); + value = hypre_cos(rs_l * M_PI / 8.0); } else if (rs_example == 2) { - value = 2.0*xx*yy*(yy-1.0); + value = 2.0 * xx * yy * (yy - 1.0); } else { - value = -4.0*yy*(yy-1.0)*(1.0-2.0*xx); + value = -4.0 * yy * (yy - 1.0) * (1.0 - 2.0 * xx); } return value; } @@ -505,6 +533,10 @@ HYPRE_Real ffun_rs(HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz) HYPRE_Real gfun_rs(HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz) { + HYPRE_UNUSED_VAR(xx); + HYPRE_UNUSED_VAR(yy); + HYPRE_UNUSED_VAR(zz); + HYPRE_Real value; value = 0.0; return value; @@ -512,6 +544,10 @@ HYPRE_Real gfun_rs(HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz) HYPRE_Real rfun_rs(HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz) { + HYPRE_UNUSED_VAR(xx); + HYPRE_UNUSED_VAR(yy); + HYPRE_UNUSED_VAR(zz); + HYPRE_Real value; value = 1.0; return value; @@ -519,6 +555,10 @@ HYPRE_Real rfun_rs(HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz) HYPRE_Real bndfun_rs(HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz) { + HYPRE_UNUSED_VAR(xx); + HYPRE_UNUSED_VAR(yy); + HYPRE_UNUSED_VAR(zz); + HYPRE_Real value; value = 0.0; return value; diff --git a/external/hypre/src/parcsr_ls/partial.c b/external/hypre/src/parcsr_ls/partial.c index 8aa42b69..ec763ed0 100644 --- a/external/hypre/src/parcsr_ls/partial.c +++ b/external/hypre/src/parcsr_ls/partial.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -13,12 +13,17 @@ * Comment: *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_BoomerAMGBuildPartialExtPIInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, - hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, - HYPRE_BigInt *num_old_cpts_global, - HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int debug_flag, - HYPRE_Real trunc_factor, HYPRE_Int max_elmts, - hypre_ParCSRMatrix **P_ptr) +hypre_BoomerAMGBuildPartialExtPIInterp(hypre_ParCSRMatrix *A, + HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, + HYPRE_BigInt *num_cpts_global, + HYPRE_BigInt *num_old_cpts_global, + HYPRE_Int num_functions, + HYPRE_Int *dof_func, + HYPRE_Int debug_flag, + HYPRE_Real trunc_factor, + HYPRE_Int max_elmts, + hypre_ParCSRMatrix **P_ptr) { #ifdef HYPRE_PROFILE hypre_profile_times[HYPRE_TIMER_ID_PARTIAL_INTERP] -= hypre_MPI_Wtime(); @@ -79,10 +84,10 @@ hypre_BoomerAMGBuildPartialExtPIInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_mark HYPRE_Int *dof_func_offd = NULL; /* Full row information for columns of A that are off diag*/ - hypre_CSRMatrix *A_ext; - HYPRE_Real *A_ext_data; - HYPRE_Int *A_ext_i; - HYPRE_BigInt *A_ext_j; + hypre_CSRMatrix *A_ext = NULL; + HYPRE_Real *A_ext_data = NULL; + HYPRE_Int *A_ext_i = NULL; + HYPRE_BigInt *A_ext_j = NULL; HYPRE_Int *fine_to_coarse = NULL; HYPRE_BigInt *fine_to_coarse_offd = NULL; @@ -90,9 +95,9 @@ hypre_BoomerAMGBuildPartialExtPIInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_mark HYPRE_Int full_off_procNodes; - hypre_CSRMatrix *Sop; - HYPRE_Int *Sop_i; - HYPRE_BigInt *Sop_j; + hypre_CSRMatrix *Sop = NULL; + HYPRE_Int *Sop_i = NULL; + HYPRE_BigInt *Sop_j = NULL; HYPRE_Int sgn; @@ -127,24 +132,24 @@ hypre_BoomerAMGBuildPartialExtPIInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_mark hypre_ParCSRCommPkg *extend_comm_pkg = NULL; - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } /* BEGIN */ hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_rank(comm, &my_id); max_num_threads = hypre_NumThreads(); my_first_cpt = num_cpts_global[0]; /*my_first_old_cpt = num_old_cpts_global[0];*/ n_coarse_old = (HYPRE_Int)(num_old_cpts_global[1] - num_old_cpts_global[0]); /*n_coarse = num_cpts_global[1] - num_cpts_global[0];*/ - if (my_id == (num_procs -1)) + if (my_id == (num_procs - 1)) { total_global_cpts = num_cpts_global[1]; total_old_global_cpts = num_old_cpts_global[1]; } - hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); - hypre_MPI_Bcast(&total_old_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); + hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); + hypre_MPI_Bcast(&total_old_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); if (!comm_pkg) { @@ -183,8 +188,8 @@ hypre_BoomerAMGBuildPartialExtPIInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_mark /*----------------------------------------------------------------------- * Intialize counters and allocate mapping vector. *-----------------------------------------------------------------------*/ - P_diag_i = hypre_CTAlloc(HYPRE_Int, n_coarse_old+1, HYPRE_MEMORY_HOST); - P_offd_i = hypre_CTAlloc(HYPRE_Int, n_coarse_old+1, HYPRE_MEMORY_HOST); + P_diag_i = hypre_CTAlloc(HYPRE_Int, n_coarse_old + 1, HYPRE_MEMORY_HOST); + P_offd_i = hypre_CTAlloc(HYPRE_Int, n_coarse_old + 1, HYPRE_MEMORY_HOST); if (n_fine) { @@ -204,7 +209,7 @@ hypre_BoomerAMGBuildPartialExtPIInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_mark fine_to_coarse_offd, P_marker, P_marker_offd, tmp_CF_marker_offd);*/ - for (i=0; i < full_off_procNodes; i++) + for (i = 0; i < full_off_procNodes; i++) { fine_to_coarse_offd[i] = -1; tmp_CF_marker_offd[i] = -1; @@ -226,13 +231,13 @@ hypre_BoomerAMGBuildPartialExtPIInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_mark } } - P_diag_array = hypre_CTAlloc(HYPRE_Int, max_num_threads+1, HYPRE_MEMORY_HOST); - P_offd_array = hypre_CTAlloc(HYPRE_Int, max_num_threads+1, HYPRE_MEMORY_HOST); + P_diag_array = hypre_CTAlloc(HYPRE_Int, max_num_threads + 1, HYPRE_MEMORY_HOST); + P_offd_array = hypre_CTAlloc(HYPRE_Int, max_num_threads + 1, HYPRE_MEMORY_HOST); /*----------------------------------------------------------------------- * Loop over fine grid. *-----------------------------------------------------------------------*/ #ifdef HYPRE_USING_OPENMP -#pragma omp parallel private(i, diagonal, distribute, sgn, sum) + #pragma omp parallel private(i, diagonal, distribute, sgn, sum) #endif { HYPRE_Int ii, jj_counter, jj_counter_offd, jj, kk, i1, i2, k1, jj1; @@ -248,26 +253,30 @@ hypre_BoomerAMGBuildPartialExtPIInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_mark num_threads = hypre_NumActiveThreads(); my_thread_num = hypre_GetThreadNum(); - size = n_coarse_old/num_threads; - rest = n_coarse_old - size*num_threads; + size = n_coarse_old / num_threads; + rest = n_coarse_old - size * num_threads; if (my_thread_num < rest) { - ns = my_thread_num*(size+1); - ne = (my_thread_num+1)*(size+1); + ns = my_thread_num * (size + 1); + ne = (my_thread_num + 1) * (size + 1); } else { - ns = my_thread_num*size+rest; - ne = (my_thread_num+1)*size+rest; + ns = my_thread_num * size + rest; + ne = (my_thread_num + 1) * size + rest; } - if (n_fine) P_marker = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); - for (ii=0; ii < n_fine; ii++) + if (n_fine) { P_marker = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); } + for (ii = 0; ii < n_fine; ii++) + { P_marker[ii] = -1; - if (full_off_procNodes) P_marker_offd = hypre_CTAlloc(HYPRE_Int, full_off_procNodes, HYPRE_MEMORY_HOST); - for (ii=0; ii < full_off_procNodes; ii++) + } + if (full_off_procNodes) { P_marker_offd = hypre_CTAlloc(HYPRE_Int, full_off_procNodes, HYPRE_MEMORY_HOST); } + for (ii = 0; ii < full_off_procNodes; ii++) + { P_marker_offd[ii] = -1; + } /*coarse_counter = 0; coarse_counter_offd = 0;*/ @@ -296,11 +305,12 @@ hypre_BoomerAMGBuildPartialExtPIInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_mark *--------------------------------------------------------------------*/ else if (CF_marker[i] == -2) { - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) { i1 = S_diag_j[jj]; if (CF_marker[i1] > 0) - { /* i1 is a C point */ + { + /* i1 is a C point */ if (P_marker[i1] < jj_begin_row) { P_marker[i1] = jj_counter; @@ -308,27 +318,28 @@ hypre_BoomerAMGBuildPartialExtPIInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_mark } } else if (CF_marker[i1] != -3) - { /* i1 is a F point, loop through it's strong neighbors */ - for (kk = S_diag_i[i1]; kk < S_diag_i[i1+1]; kk++) + { + /* i1 is a F point, loop through it's strong neighbors */ + for (kk = S_diag_i[i1]; kk < S_diag_i[i1 + 1]; kk++) { k1 = S_diag_j[kk]; if (CF_marker[k1] > 0) { - if(P_marker[k1] < jj_begin_row) + if (P_marker[k1] < jj_begin_row) { P_marker[k1] = jj_counter; jj_counter++; } } } - if(num_procs > 1) + if (num_procs > 1) { - for (kk = S_offd_i[i1]; kk < S_offd_i[i1+1]; kk++) + for (kk = S_offd_i[i1]; kk < S_offd_i[i1 + 1]; kk++) { k1 = S_offd_j[kk]; if (CF_marker_offd[k1] > 0) { - if(P_marker_offd[k1] < jj_begin_row_offd) + if (P_marker_offd[k1] < jj_begin_row_offd) { tmp_CF_marker_offd[k1] = 1; P_marker_offd[k1] = jj_counter_offd; @@ -342,12 +353,12 @@ hypre_BoomerAMGBuildPartialExtPIInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_mark /* Look at off diag strong connections of i */ if (num_procs > 1) { - for (jj = S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) { i1 = S_offd_j[jj]; if (CF_marker_offd[i1] > 0) { - if(P_marker_offd[i1] < jj_begin_row_offd) + if (P_marker_offd[i1] < jj_begin_row_offd) { tmp_CF_marker_offd[i1] = 1; P_marker_offd[i1] = jj_counter_offd; @@ -355,16 +366,18 @@ hypre_BoomerAMGBuildPartialExtPIInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_mark } } else if (CF_marker_offd[i1] != -3) - { /* F point; look at neighbors of i1. Sop contains global col - * numbers and entries that could be in S_diag or S_offd or - * neither. */ - for(kk = Sop_i[i1]; kk < Sop_i[i1+1]; kk++) + { + /* F point; look at neighbors of i1. Sop contains global col + * numbers and entries that could be in S_diag or S_offd or + * neither. */ + for (kk = Sop_i[i1]; kk < Sop_i[i1 + 1]; kk++) { big_k1 = Sop_j[kk]; - if(big_k1 >= col_1 && big_k1 < col_n) - { /* In S_diag */ - loc_col = (HYPRE_Int)(big_k1-col_1); - if(P_marker[loc_col] < jj_begin_row) + if (big_k1 >= col_1 && big_k1 < col_n) + { + /* In S_diag */ + loc_col = (HYPRE_Int)(big_k1 - col_1); + if (P_marker[loc_col] < jj_begin_row) { P_marker[loc_col] = jj_counter; jj_counter++; @@ -373,7 +386,7 @@ hypre_BoomerAMGBuildPartialExtPIInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_mark else { loc_col = -(HYPRE_Int)big_k1 - 1; - if(P_marker_offd[loc_col] < jj_begin_row_offd) + if (P_marker_offd[loc_col] < jj_begin_row_offd) { P_marker_offd[loc_col] = jj_counter_offd; tmp_CF_marker_offd[loc_col] = 1; @@ -389,12 +402,12 @@ hypre_BoomerAMGBuildPartialExtPIInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_mark P_offd_array[my_thread_num] = jj_counter_offd; } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif if (my_thread_num == 0) { - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d determine structure %f\n", @@ -405,12 +418,12 @@ hypre_BoomerAMGBuildPartialExtPIInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_mark * Allocate arrays. *-----------------------------------------------------------------------*/ - if (debug_flag== 4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } - for (i=0; i < max_num_threads; i++) + for (i = 0; i < max_num_threads; i++) { - P_diag_array[i+1] += P_diag_array[i]; - P_offd_array[i+1] += P_offd_array[i]; + P_diag_array[i + 1] += P_diag_array[i]; + P_offd_array[i + 1] += P_offd_array[i]; } P_diag_size = P_diag_array[max_num_threads]; P_offd_size = P_offd_array[max_num_threads]; @@ -431,7 +444,7 @@ hypre_BoomerAMGBuildPartialExtPIInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_mark P_offd_i[n_coarse_old] = P_offd_size; /* Fine to coarse mapping */ - if(num_procs > 1) + if (num_procs > 1) { hypre_big_insert_new_nodes(comm_pkg, extend_comm_pkg, fine_to_coarse, full_off_procNodes, my_first_cpt, @@ -440,20 +453,24 @@ hypre_BoomerAMGBuildPartialExtPIInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_mark } for (i = 0; i < n_fine; i++) + { P_marker[i] = -1; + } for (i = 0; i < full_off_procNodes; i++) + { P_marker_offd[i] = -1; + } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif jj_counter = start_indexing; jj_counter_offd = start_indexing; if (my_thread_num) { - jj_counter = P_diag_array[my_thread_num-1]; - jj_counter_offd = P_offd_array[my_thread_num-1]; + jj_counter = P_diag_array[my_thread_num - 1]; + jj_counter_offd = P_offd_array[my_thread_num - 1]; } /*----------------------------------------------------------------------- * Loop over fine grid points. @@ -483,7 +500,7 @@ hypre_BoomerAMGBuildPartialExtPIInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_mark else if (CF_marker[i] == -2) { strong_f_marker--; - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) { i1 = S_diag_j[jj]; @@ -505,12 +522,12 @@ hypre_BoomerAMGBuildPartialExtPIInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_mark else if (CF_marker[i1] != -3) { P_marker[i1] = strong_f_marker; - for (kk = S_diag_i[i1]; kk < S_diag_i[i1+1]; kk++) + for (kk = S_diag_i[i1]; kk < S_diag_i[i1 + 1]; kk++) { k1 = S_diag_j[kk]; if (CF_marker[k1] >= 0) { - if(P_marker[k1] < jj_begin_row) + if (P_marker[k1] < jj_begin_row) { P_marker[k1] = jj_counter; P_diag_j[jj_counter] = fine_to_coarse[k1]; @@ -519,14 +536,14 @@ hypre_BoomerAMGBuildPartialExtPIInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_mark } } } - if(num_procs > 1) + if (num_procs > 1) { - for (kk = S_offd_i[i1]; kk < S_offd_i[i1+1]; kk++) + for (kk = S_offd_i[i1]; kk < S_offd_i[i1 + 1]; kk++) { k1 = S_offd_j[kk]; - if(CF_marker_offd[k1] >= 0) + if (CF_marker_offd[k1] >= 0) { - if(P_marker_offd[k1] < jj_begin_row_offd) + if (P_marker_offd[k1] < jj_begin_row_offd) { P_marker_offd[k1] = jj_counter_offd; P_offd_j[jj_counter_offd] = k1; @@ -541,12 +558,12 @@ hypre_BoomerAMGBuildPartialExtPIInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_mark if ( num_procs > 1) { - for (jj=S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) { i1 = S_offd_j[jj]; if ( CF_marker_offd[i1] >= 0) { - if(P_marker_offd[i1] < jj_begin_row_offd) + if (P_marker_offd[i1] < jj_begin_row_offd) { P_marker_offd[i1] = jj_counter_offd; P_offd_j[jj_counter_offd] = i1; @@ -557,14 +574,14 @@ hypre_BoomerAMGBuildPartialExtPIInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_mark else if (CF_marker_offd[i1] != -3) { P_marker_offd[i1] = strong_f_marker; - for(kk = Sop_i[i1]; kk < Sop_i[i1+1]; kk++) + for (kk = Sop_i[i1]; kk < Sop_i[i1 + 1]; kk++) { big_k1 = Sop_j[kk]; /* Find local col number */ - if(big_k1 >= col_1 && big_k1 < col_n) + if (big_k1 >= col_1 && big_k1 < col_n) { - loc_col = (HYPRE_Int)(big_k1-col_1); - if(P_marker[loc_col] < jj_begin_row) + loc_col = (HYPRE_Int)(big_k1 - col_1); + if (P_marker[loc_col] < jj_begin_row) { P_marker[loc_col] = jj_counter; P_diag_j[jj_counter] = fine_to_coarse[loc_col]; @@ -575,10 +592,10 @@ hypre_BoomerAMGBuildPartialExtPIInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_mark else { loc_col = -(HYPRE_Int)big_k1 - 1; - if(P_marker_offd[loc_col] < jj_begin_row_offd) + if (P_marker_offd[loc_col] < jj_begin_row_offd) { P_marker_offd[loc_col] = jj_counter_offd; - P_offd_j[jj_counter_offd]=loc_col; + P_offd_j[jj_counter_offd] = loc_col; P_offd_data[jj_counter_offd] = zero; jj_counter_offd++; } @@ -593,59 +610,66 @@ hypre_BoomerAMGBuildPartialExtPIInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_mark diagonal = A_diag_data[A_diag_i[i]]; - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) - { /* i1 is a c-point and strongly influences i, accumulate - * a_(i,i1) into interpolation weight */ + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) + { + /* i1 is a c-point and strongly influences i, accumulate + * a_(i,i1) into interpolation weight */ i1 = A_diag_j[jj]; if (P_marker[i1] >= jj_begin_row) { P_diag_data[P_marker[i1]] += A_diag_data[jj]; } - else if(P_marker[i1] == strong_f_marker) + else if (P_marker[i1] == strong_f_marker) { sum = zero; sgn = 1; - if(A_diag_data[A_diag_i[i1]] < 0) sgn = -1; + if (A_diag_data[A_diag_i[i1]] < 0) { sgn = -1; } /* Loop over row of A for point i1 and calculate the sum * of the connections to c-points that strongly incluence i. */ - for(jj1 = A_diag_i[i1]+1; jj1 < A_diag_i[i1+1]; jj1++) + for (jj1 = A_diag_i[i1] + 1; jj1 < A_diag_i[i1 + 1]; jj1++) { i2 = A_diag_j[jj1]; - if((P_marker[i2] >= jj_begin_row || i2 == i) && (sgn*A_diag_data[jj1]) < 0) + if ((P_marker[i2] >= jj_begin_row || i2 == i) && (sgn * A_diag_data[jj1]) < 0) + { sum += A_diag_data[jj1]; + } } - if(num_procs > 1) + if (num_procs > 1) { - for(jj1 = A_offd_i[i1]; jj1< A_offd_i[i1+1]; jj1++) + for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1 + 1]; jj1++) { i2 = A_offd_j[jj1]; - if(P_marker_offd[i2] >= jj_begin_row_offd && - (sgn*A_offd_data[jj1]) < 0) + if (P_marker_offd[i2] >= jj_begin_row_offd && + (sgn * A_offd_data[jj1]) < 0) + { sum += A_offd_data[jj1]; + } } } - if(sum != 0) + if (sum != 0) { - distribute = A_diag_data[jj]/sum; + distribute = A_diag_data[jj] / sum; /* Loop over row of A for point i1 and do the distribution */ - for(jj1 = A_diag_i[i1]+1; jj1 < A_diag_i[i1+1]; jj1++) + for (jj1 = A_diag_i[i1] + 1; jj1 < A_diag_i[i1 + 1]; jj1++) { i2 = A_diag_j[jj1]; - if(P_marker[i2] >= jj_begin_row && (sgn*A_diag_data[jj1]) < 0) + if (P_marker[i2] >= jj_begin_row && (sgn * A_diag_data[jj1]) < 0) P_diag_data[P_marker[i2]] += - distribute*A_diag_data[jj1]; - if(i2 == i && (sgn*A_diag_data[jj1]) < 0) - diagonal += distribute*A_diag_data[jj1]; + distribute * A_diag_data[jj1]; + if (i2 == i && (sgn * A_diag_data[jj1]) < 0) + { + diagonal += distribute * A_diag_data[jj1]; + } } - if(num_procs > 1) + if (num_procs > 1) { - for(jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1+1]; jj1++) + for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1 + 1]; jj1++) { i2 = A_offd_j[jj1]; - if(P_marker_offd[i2] >= jj_begin_row_offd && - (sgn*A_offd_data[jj1]) < 0) + if (P_marker_offd[i2] >= jj_begin_row_offd && + (sgn * A_offd_data[jj1]) < 0) P_offd_data[P_marker_offd[i2]] += - distribute*A_offd_data[jj1]; + distribute * A_offd_data[jj1]; } } } @@ -658,57 +682,69 @@ hypre_BoomerAMGBuildPartialExtPIInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_mark * diagonal */ else if (CF_marker[i1] != -3) { - if(num_functions == 1 || dof_func[i] == dof_func[i1]) + if (num_functions == 1 || dof_func[i] == dof_func[i1]) + { diagonal += A_diag_data[jj]; + } } } - if(num_procs > 1) + if (num_procs > 1) { - for(jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { i1 = A_offd_j[jj]; - if(P_marker_offd[i1] >= jj_begin_row_offd) + if (P_marker_offd[i1] >= jj_begin_row_offd) + { P_offd_data[P_marker_offd[i1]] += A_offd_data[jj]; - else if(P_marker_offd[i1] == strong_f_marker) + } + else if (P_marker_offd[i1] == strong_f_marker) { sum = zero; - for(jj1 = A_ext_i[i1]; jj1 < A_ext_i[i1+1]; jj1++) + for (jj1 = A_ext_i[i1]; jj1 < A_ext_i[i1 + 1]; jj1++) { big_k1 = A_ext_j[jj1]; - if(big_k1 >= col_1 && big_k1 < col_n) - { /* diag */ + if (big_k1 >= col_1 && big_k1 < col_n) + { + /* diag */ loc_col = (HYPRE_Int)(big_k1 - col_1); - if(P_marker[loc_col] >= jj_begin_row || loc_col == i) + if (P_marker[loc_col] >= jj_begin_row || loc_col == i) + { sum += A_ext_data[jj1]; + } } else { loc_col = -(HYPRE_Int)big_k1 - 1; - if(P_marker_offd[loc_col] >= jj_begin_row_offd) + if (P_marker_offd[loc_col] >= jj_begin_row_offd) + { sum += A_ext_data[jj1]; + } } } - if(sum != 0) + if (sum != 0) { distribute = A_offd_data[jj] / sum; - for(jj1 = A_ext_i[i1]; jj1 < A_ext_i[i1+1]; jj1++) + for (jj1 = A_ext_i[i1]; jj1 < A_ext_i[i1 + 1]; jj1++) { big_k1 = A_ext_j[jj1]; - if(big_k1 >= col_1 && big_k1 < col_n) - { /* diag */ + if (big_k1 >= col_1 && big_k1 < col_n) + { + /* diag */ loc_col = (HYPRE_Int)(big_k1 - col_1); - if(P_marker[loc_col] >= jj_begin_row) - P_diag_data[P_marker[loc_col]] += distribute* - A_ext_data[jj1]; - if(loc_col == i) - diagonal += distribute*A_ext_data[jj1]; + if (P_marker[loc_col] >= jj_begin_row) + P_diag_data[P_marker[loc_col]] += distribute * + A_ext_data[jj1]; + if (loc_col == i) + { + diagonal += distribute * A_ext_data[jj1]; + } } else { loc_col = -(HYPRE_Int)big_k1 - 1; - if(P_marker_offd[loc_col] >= jj_begin_row_offd) - P_offd_data[P_marker_offd[loc_col]] += distribute* - A_ext_data[jj1]; + if (P_marker_offd[loc_col] >= jj_begin_row_offd) + P_offd_data[P_marker_offd[loc_col]] += distribute * + A_ext_data[jj1]; } } } @@ -719,17 +755,23 @@ hypre_BoomerAMGBuildPartialExtPIInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_mark } else if (CF_marker_offd[i1] != -3) { - if(num_functions == 1 || dof_func[i] == dof_func_offd[i1]) + if (num_functions == 1 || dof_func[i] == dof_func_offd[i1]) + { diagonal += A_offd_data[jj]; + } } } } if (diagonal) { - for(jj = jj_begin_row; jj < jj_end_row; jj++) + for (jj = jj_begin_row; jj < jj_end_row; jj++) + { P_diag_data[jj] /= -diagonal; - for(jj = jj_begin_row_offd; jj < jj_end_row_offd; jj++) + } + for (jj = jj_begin_row_offd; jj < jj_end_row_offd; jj++) + { P_offd_data[jj] /= -diagonal; + } } } strong_f_marker--; @@ -738,7 +780,7 @@ hypre_BoomerAMGBuildPartialExtPIInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_mark hypre_TFree(P_marker_offd, HYPRE_MEMORY_HOST); } /* end parallel region */ - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d fill structure %f\n", @@ -786,15 +828,15 @@ hypre_BoomerAMGBuildPartialExtPIInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_mark /* This builds col_map, col_map should be monotone increasing and contain * global numbers. */ - if(P_offd_size) + if (P_offd_size) { hypre_build_interp_colmap(P, full_off_procNodes, tmp_CF_marker_offd, fine_to_coarse_offd); } hypre_MatvecCommPkgCreate(P); - for (i=0; i < n_fine; i++) - if (CF_marker[i] < -1) CF_marker[i] = -1; + for (i = 0; i < n_fine; i++) + if (CF_marker[i] < -1) { CF_marker[i] = -1; } *P_ptr = P; @@ -811,8 +853,10 @@ hypre_BoomerAMGBuildPartialExtPIInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_mark hypre_TFree(fine_to_coarse_offd, HYPRE_MEMORY_HOST); hypre_TFree(CF_marker_offd, HYPRE_MEMORY_HOST); hypre_TFree(tmp_CF_marker_offd, HYPRE_MEMORY_HOST); - if(num_functions > 1) + if (num_functions > 1) + { hypre_TFree(dof_func_offd, HYPRE_MEMORY_HOST); + } hypre_MatvecCommPkgDestroy(extend_comm_pkg); @@ -835,18 +879,23 @@ hypre_BoomerAMGBuildPartialExtPIInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_mark *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_BoomerAMGBuildPartialStdInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, - hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, - HYPRE_BigInt *num_old_cpts_global, - HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int debug_flag, - HYPRE_Real trunc_factor, HYPRE_Int max_elmts, - HYPRE_Int sep_weight, - hypre_ParCSRMatrix **P_ptr) +hypre_BoomerAMGBuildPartialStdInterp(hypre_ParCSRMatrix *A, + HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, + HYPRE_BigInt *num_cpts_global, + HYPRE_BigInt *num_old_cpts_global, + HYPRE_Int num_functions, + HYPRE_Int *dof_func, + HYPRE_Int debug_flag, + HYPRE_Real trunc_factor, + HYPRE_Int max_elmts, + HYPRE_Int sep_weight, + hypre_ParCSRMatrix **P_ptr) { /* Communication Variables */ MPI_Comm comm = hypre_ParCSRMatrixComm(A); hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); - HYPRE_Int my_id, num_procs; + HYPRE_Int my_id, num_procs; /* Variables to store input variables */ hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); @@ -896,10 +945,10 @@ hypre_BoomerAMGBuildPartialStdInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker HYPRE_Int *dof_func_offd = NULL; /* Full row information for columns of A that are off diag*/ - hypre_CSRMatrix *A_ext; - HYPRE_Real *A_ext_data; - HYPRE_Int *A_ext_i; - HYPRE_BigInt *A_ext_j; + hypre_CSRMatrix *A_ext = NULL; + HYPRE_Real *A_ext_data = NULL; + HYPRE_Int *A_ext_i = NULL; + HYPRE_BigInt *A_ext_j = NULL; HYPRE_Int *fine_to_coarse = NULL; HYPRE_BigInt *fine_to_coarse_offd = NULL; @@ -908,16 +957,16 @@ hypre_BoomerAMGBuildPartialStdInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker HYPRE_Int loc_col; HYPRE_Int full_off_procNodes; - hypre_CSRMatrix *Sop; - HYPRE_Int *Sop_i; - HYPRE_BigInt *Sop_j; + hypre_CSRMatrix *Sop = NULL; + HYPRE_Int *Sop_i = NULL; + HYPRE_BigInt *Sop_j = NULL; /* Variables to keep count of interpolatory points */ HYPRE_Int jj_counter, jj_counter_offd; HYPRE_Int jj_begin_row, jj_end_row; HYPRE_Int jj_begin_row_offd = 0; HYPRE_Int jj_end_row_offd = 0; - HYPRE_Int coarse_counter; + //HYPRE_Int coarse_counter; HYPRE_Int n_coarse_old; HYPRE_BigInt total_old_global_cpts; @@ -932,7 +981,7 @@ hypre_BoomerAMGBuildPartialStdInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker HYPRE_Real *ahat_offd = NULL; HYPRE_Real sum_pos, sum_pos_C, sum_neg, sum_neg_C, sum, sum_C; HYPRE_Real diagonal, distribute; - HYPRE_Real alfa, beta; + HYPRE_Real alpha, beta; /* Loop variables */ /*HYPRE_Int index;*/ @@ -945,32 +994,31 @@ hypre_BoomerAMGBuildPartialStdInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker /* Definitions */ HYPRE_Real zero = 0.0; HYPRE_Real one = 1.0; - HYPRE_Real wall_time; - HYPRE_Real wall_1 = 0; - HYPRE_Real wall_2 = 0; - HYPRE_Real wall_3 = 0; - + HYPRE_Real wall_time = 0.0; + HYPRE_Real wall_1 = 0.0; + HYPRE_Real wall_2 = 0.0; + HYPRE_Real wall_3 = 0.0; hypre_ParCSRCommPkg *extend_comm_pkg = NULL; - if (debug_flag== 4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } /* BEGIN */ hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_rank(comm, &my_id); my_first_cpt = num_cpts_global[0]; /*my_first_old_cpt = num_old_cpts_global[0];*/ n_coarse_old = (HYPRE_Int)(num_old_cpts_global[1] - num_old_cpts_global[0]); /*n_coarse = num_cpts_global[1] - num_cpts_global[0];*/ - if (my_id == (num_procs -1)) + if (my_id == (num_procs - 1)) { total_global_cpts = num_cpts_global[1]; total_old_global_cpts = num_old_cpts_global[1]; } - hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); - hypre_MPI_Bcast(&total_old_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); + hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); + hypre_MPI_Bcast(&total_old_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); if (!comm_pkg) { @@ -1009,8 +1057,8 @@ hypre_BoomerAMGBuildPartialStdInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker /*----------------------------------------------------------------------- * Intialize counters and allocate mapping vector. *-----------------------------------------------------------------------*/ - P_diag_i = hypre_CTAlloc(HYPRE_Int, n_coarse_old+1, HYPRE_MEMORY_HOST); - P_offd_i = hypre_CTAlloc(HYPRE_Int, n_coarse_old+1, HYPRE_MEMORY_HOST); + P_diag_i = hypre_CTAlloc(HYPRE_Int, n_coarse_old + 1, HYPRE_MEMORY_HOST); + P_offd_i = hypre_CTAlloc(HYPRE_Int, n_coarse_old + 1, HYPRE_MEMORY_HOST); if (n_fine) { @@ -1032,7 +1080,7 @@ hypre_BoomerAMGBuildPartialStdInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker jj_counter = start_indexing; jj_counter_offd = start_indexing; - coarse_counter = 0; + //coarse_counter = 0; cnt = 0; old_cnt = 0; @@ -1057,13 +1105,15 @@ hypre_BoomerAMGBuildPartialStdInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker { P_diag_i[ii] = jj_counter; if (num_procs > 1) + { P_offd_i[ii] = jj_counter_offd; + } i = old_coarse_to_fine[ii]; if (CF_marker[i] > 0) { jj_counter++; - coarse_counter++; + //coarse_counter++; } /*-------------------------------------------------------------------- @@ -1073,11 +1123,12 @@ hypre_BoomerAMGBuildPartialStdInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker *--------------------------------------------------------------------*/ else if (CF_marker[i] == -2) { - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) { i1 = S_diag_j[jj]; if (CF_marker[i1] > 0) - { /* i1 is a C point */ + { + /* i1 is a C point */ if (P_marker[i1] < P_diag_i[ii]) { P_marker[i1] = jj_counter; @@ -1085,27 +1136,28 @@ hypre_BoomerAMGBuildPartialStdInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker } } else if (CF_marker[i1] != -3) - { /* i1 is a F point, loop through it's strong neighbors */ - for (kk = S_diag_i[i1]; kk < S_diag_i[i1+1]; kk++) + { + /* i1 is a F point, loop through it's strong neighbors */ + for (kk = S_diag_i[i1]; kk < S_diag_i[i1 + 1]; kk++) { k1 = S_diag_j[kk]; if (CF_marker[k1] > 0) { - if(P_marker[k1] < P_diag_i[ii]) + if (P_marker[k1] < P_diag_i[ii]) { P_marker[k1] = jj_counter; jj_counter++; } } } - if(num_procs > 1) + if (num_procs > 1) { - for (kk = S_offd_i[i1]; kk < S_offd_i[i1+1]; kk++) + for (kk = S_offd_i[i1]; kk < S_offd_i[i1 + 1]; kk++) { k1 = S_offd_j[kk]; if (CF_marker_offd[k1] > 0) { - if(P_marker_offd[k1] < P_offd_i[ii]) + if (P_marker_offd[k1] < P_offd_i[ii]) { tmp_CF_marker_offd[k1] = 1; P_marker_offd[k1] = jj_counter_offd; @@ -1119,12 +1171,12 @@ hypre_BoomerAMGBuildPartialStdInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker /* Look at off diag strong connections of i */ if (num_procs > 1) { - for (jj = S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) { i1 = S_offd_j[jj]; if (CF_marker_offd[i1] > 0) { - if(P_marker_offd[i1] < P_offd_i[ii]) + if (P_marker_offd[i1] < P_offd_i[ii]) { tmp_CF_marker_offd[i1] = 1; P_marker_offd[i1] = jj_counter_offd; @@ -1132,18 +1184,20 @@ hypre_BoomerAMGBuildPartialStdInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker } } else if (CF_marker_offd[i1] != -3) - { /* F point; look at neighbors of i1. Sop contains global col - * numbers and entries that could be in S_diag or S_offd or - * neither. */ - for(kk = Sop_i[i1]; kk < Sop_i[i1+1]; kk++) + { + /* F point; look at neighbors of i1. Sop contains global col + * numbers and entries that could be in S_diag or S_offd or + * neither. */ + for (kk = Sop_i[i1]; kk < Sop_i[i1 + 1]; kk++) { big_k1 = Sop_j[kk]; - if(big_k1 >= col_1 && big_k1 < col_n) - { /* In S_diag */ - loc_col = (HYPRE_Int)(big_k1-col_1); - if(CF_marker[loc_col] >= 0) + if (big_k1 >= col_1 && big_k1 < col_n) + { + /* In S_diag */ + loc_col = (HYPRE_Int)(big_k1 - col_1); + if (CF_marker[loc_col] >= 0) { - if(P_marker[loc_col] < P_diag_i[ii]) + if (P_marker[loc_col] < P_diag_i[ii]) { P_marker[loc_col] = jj_counter; jj_counter++; @@ -1153,9 +1207,9 @@ hypre_BoomerAMGBuildPartialStdInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker else { loc_col = -(HYPRE_Int)big_k1 - 1; - if(CF_marker_offd[loc_col] >= 0) + if (CF_marker_offd[loc_col] >= 0) { - if(P_marker_offd[loc_col] < P_offd_i[ii]) + if (P_marker_offd[loc_col] < P_offd_i[ii]) { P_marker_offd[loc_col] = jj_counter_offd; tmp_CF_marker_offd[loc_col] = 1; @@ -1170,7 +1224,7 @@ hypre_BoomerAMGBuildPartialStdInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker } } - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d determine structure %f\n", @@ -1205,7 +1259,7 @@ hypre_BoomerAMGBuildPartialStdInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker jj_counter_offd = start_indexing; /* Fine to coarse mapping */ - if(num_procs > 1) + if (num_procs > 1) { hypre_big_insert_new_nodes(comm_pkg, extend_comm_pkg, fine_to_coarse, full_off_procNodes, my_first_cpt, @@ -1266,9 +1320,9 @@ hypre_BoomerAMGBuildPartialStdInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker else if (CF_marker[i] == -2) { - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } strong_f_marker--; - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) { i1 = S_diag_j[jj]; @@ -1290,12 +1344,12 @@ hypre_BoomerAMGBuildPartialStdInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker else if (CF_marker[i1] != -3) { P_marker[i1] = strong_f_marker; - for (kk = S_diag_i[i1]; kk < S_diag_i[i1+1]; kk++) + for (kk = S_diag_i[i1]; kk < S_diag_i[i1 + 1]; kk++) { k1 = S_diag_j[kk]; if (CF_marker[k1] > 0) { - if(P_marker[k1] < jj_begin_row) + if (P_marker[k1] < jj_begin_row) { P_marker[k1] = jj_counter; P_diag_j[jj_counter] = k1; @@ -1304,14 +1358,14 @@ hypre_BoomerAMGBuildPartialStdInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker } } } - if(num_procs > 1) + if (num_procs > 1) { - for (kk = S_offd_i[i1]; kk < S_offd_i[i1+1]; kk++) + for (kk = S_offd_i[i1]; kk < S_offd_i[i1 + 1]; kk++) { k1 = S_offd_j[kk]; - if(CF_marker_offd[k1] > 0) + if (CF_marker_offd[k1] > 0) { - if(P_marker_offd[k1] < jj_begin_row_offd) + if (P_marker_offd[k1] < jj_begin_row_offd) { P_marker_offd[k1] = jj_counter_offd; P_offd_j[jj_counter_offd] = k1; @@ -1326,15 +1380,15 @@ hypre_BoomerAMGBuildPartialStdInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker if ( num_procs > 1) { - for (jj=S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) { i1 = S_offd_j[jj]; if ( CF_marker_offd[i1] > 0) { - if(P_marker_offd[i1] < jj_begin_row_offd) + if (P_marker_offd[i1] < jj_begin_row_offd) { P_marker_offd[i1] = jj_counter_offd; - P_offd_j[jj_counter_offd]=i1; + P_offd_j[jj_counter_offd] = i1; P_offd_data[jj_counter_offd] = zero; jj_counter_offd++; } @@ -1342,15 +1396,15 @@ hypre_BoomerAMGBuildPartialStdInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker else if (CF_marker_offd[i1] != -3) { P_marker_offd[i1] = strong_f_marker; - for(kk = Sop_i[i1]; kk < Sop_i[i1+1]; kk++) + for (kk = Sop_i[i1]; kk < Sop_i[i1 + 1]; kk++) { big_k1 = Sop_j[kk]; - if(big_k1 >= col_1 && big_k1 < col_n) + if (big_k1 >= col_1 && big_k1 < col_n) { - loc_col = (HYPRE_Int)(big_k1-col_1); - if(CF_marker[loc_col] > 0) + loc_col = (HYPRE_Int)(big_k1 - col_1); + if (CF_marker[loc_col] > 0) { - if(P_marker[loc_col] < jj_begin_row) + if (P_marker[loc_col] < jj_begin_row) { P_marker[loc_col] = jj_counter; P_diag_j[jj_counter] = loc_col; @@ -1362,12 +1416,12 @@ hypre_BoomerAMGBuildPartialStdInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker else { loc_col = -(HYPRE_Int)big_k1 - 1; - if(CF_marker_offd[loc_col] > 0) + if (CF_marker_offd[loc_col] > 0) { - if(P_marker_offd[loc_col] < jj_begin_row_offd) + if (P_marker_offd[loc_col] < jj_begin_row_offd) { P_marker_offd[loc_col] = jj_counter_offd; - P_offd_j[jj_counter_offd]=loc_col; + P_offd_j[jj_counter_offd] = loc_col; P_offd_data[jj_counter_offd] = zero; jj_counter_offd++; } @@ -1381,28 +1435,31 @@ hypre_BoomerAMGBuildPartialStdInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker jj_end_row = jj_counter; jj_end_row_offd = jj_counter_offd; - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; wall_1 += wall_time; fflush(NULL); } - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } cnt_c = 0; - cnt_f = jj_end_row-jj_begin_row; + cnt_f = jj_end_row - jj_begin_row; cnt_c_offd = 0; - cnt_f_offd = jj_end_row_offd-jj_begin_row_offd; + cnt_f_offd = jj_end_row_offd - jj_begin_row_offd; ihat[i] = cnt_f; ipnt[cnt_f] = i; ahat[cnt_f++] = A_diag_data[A_diag_i[i]]; - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) - { /* i1 is direct neighbor */ + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) + { + /* i1 is direct neighbor */ i1 = A_diag_j[jj]; if (P_marker[i1] != strong_f_marker) { indx = ihat[i1]; if (indx > -1) + { ahat[indx] += A_diag_data[jj]; + } else if (P_marker[i1] >= jj_begin_row) { ihat[i1] = cnt_c; @@ -1418,49 +1475,53 @@ hypre_BoomerAMGBuildPartialStdInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker } else { - if(num_functions == 1 || dof_func[i] == dof_func[i1]) + if (num_functions == 1 || dof_func[i] == dof_func[i1]) { - distribute = A_diag_data[jj]/A_diag_data[A_diag_i[i1]]; - for (kk = A_diag_i[i1]+1; kk < A_diag_i[i1+1]; kk++) + distribute = A_diag_data[jj] / A_diag_data[A_diag_i[i1]]; + for (kk = A_diag_i[i1] + 1; kk < A_diag_i[i1 + 1]; kk++) { k1 = A_diag_j[kk]; indx = ihat[k1]; if (indx > -1) - ahat[indx] -= A_diag_data[kk]*distribute; + { + ahat[indx] -= A_diag_data[kk] * distribute; + } else if (P_marker[k1] >= jj_begin_row) { ihat[k1] = cnt_c; ipnt[cnt_c] = k1; - ahat[cnt_c++] -= A_diag_data[kk]*distribute; + ahat[cnt_c++] -= A_diag_data[kk] * distribute; } else { ihat[k1] = cnt_f; ipnt[cnt_f] = k1; - ahat[cnt_f++] -= A_diag_data[kk]*distribute; + ahat[cnt_f++] -= A_diag_data[kk] * distribute; } } - if(num_procs > 1) + if (num_procs > 1) { - for (kk = A_offd_i[i1]; kk < A_offd_i[i1+1]; kk++) + for (kk = A_offd_i[i1]; kk < A_offd_i[i1 + 1]; kk++) { k1 = A_offd_j[kk]; indx = ihat_offd[k1]; - if(num_functions == 1 || dof_func[i1] == dof_func_offd[k1]) + if (num_functions == 1 || dof_func[i1] == dof_func_offd[k1]) { if (indx > -1) - ahat_offd[indx] -= A_offd_data[kk]*distribute; + { + ahat_offd[indx] -= A_offd_data[kk] * distribute; + } else if (P_marker_offd[k1] >= jj_begin_row_offd) { ihat_offd[k1] = cnt_c_offd; ipnt_offd[cnt_c_offd] = k1; - ahat_offd[cnt_c_offd++] -= A_offd_data[kk]*distribute; + ahat_offd[cnt_c_offd++] -= A_offd_data[kk] * distribute; } else { ihat_offd[k1] = cnt_f_offd; ipnt_offd[cnt_f_offd] = k1; - ahat_offd[cnt_f_offd++] -= A_offd_data[kk]*distribute; + ahat_offd[cnt_f_offd++] -= A_offd_data[kk] * distribute; } } } @@ -1468,16 +1529,18 @@ hypre_BoomerAMGBuildPartialStdInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker } } } - if(num_procs > 1) + if (num_procs > 1) { - for(jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { i1 = A_offd_j[jj]; - if(P_marker_offd[i1] != strong_f_marker) + if (P_marker_offd[i1] != strong_f_marker) { indx = ihat_offd[i1]; if (indx > -1) + { ahat_offd[indx] += A_offd_data[jj]; + } else if (P_marker_offd[i1] >= jj_begin_row_offd) { ihat_offd[i1] = cnt_c_offd; @@ -1493,51 +1556,56 @@ hypre_BoomerAMGBuildPartialStdInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker } else { - if(num_functions == 1 || dof_func[i] == dof_func_offd[i1]) + if (num_functions == 1 || dof_func[i] == dof_func_offd[i1]) { - distribute = A_offd_data[jj]/A_ext_data[A_ext_i[i1]]; - for (kk = A_ext_i[i1]+1; kk < A_ext_i[i1+1]; kk++) + distribute = A_offd_data[jj] / A_ext_data[A_ext_i[i1]]; + for (kk = A_ext_i[i1] + 1; kk < A_ext_i[i1 + 1]; kk++) { big_k1 = A_ext_j[kk]; - if(big_k1 >= col_1 && big_k1 < col_n) - { /*diag*/ + if (big_k1 >= col_1 && big_k1 < col_n) + { + /*diag*/ loc_col = (HYPRE_Int)(big_k1 - col_1); indx = ihat[loc_col]; if (indx > -1) - ahat[indx] -= A_ext_data[kk]*distribute; + { + ahat[indx] -= A_ext_data[kk] * distribute; + } else if (P_marker[loc_col] >= jj_begin_row) { ihat[loc_col] = cnt_c; ipnt[cnt_c] = loc_col; - ahat[cnt_c++] -= A_ext_data[kk]*distribute; + ahat[cnt_c++] -= A_ext_data[kk] * distribute; } else { ihat[loc_col] = cnt_f; ipnt[cnt_f] = loc_col; - ahat[cnt_f++] -= A_ext_data[kk]*distribute; + ahat[cnt_f++] -= A_ext_data[kk] * distribute; } } else { loc_col = -(HYPRE_Int)big_k1 - 1; - if(num_functions == 1 || - dof_func_offd[loc_col] == dof_func_offd[i1]) + if (num_functions == 1 || + dof_func_offd[loc_col] == dof_func_offd[i1]) { indx = ihat_offd[loc_col]; if (indx > -1) - ahat_offd[indx] -= A_ext_data[kk]*distribute; - else if(P_marker_offd[loc_col] >= jj_begin_row_offd) + { + ahat_offd[indx] -= A_ext_data[kk] * distribute; + } + else if (P_marker_offd[loc_col] >= jj_begin_row_offd) { ihat_offd[loc_col] = cnt_c_offd; ipnt_offd[cnt_c_offd] = loc_col; - ahat_offd[cnt_c_offd++] -= A_ext_data[kk]*distribute; + ahat_offd[cnt_c_offd++] -= A_ext_data[kk] * distribute; } else { ihat_offd[loc_col] = cnt_f_offd; ipnt_offd[cnt_f_offd] = loc_col; - ahat_offd[cnt_f_offd++] -= A_ext_data[kk]*distribute; + ahat_offd[cnt_f_offd++] -= A_ext_data[kk] * distribute; } } } @@ -1546,14 +1614,14 @@ hypre_BoomerAMGBuildPartialStdInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker } } } - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; wall_2 += wall_time; fflush(NULL); } - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } diagonal = ahat[cnt_c]; ahat[cnt_c] = 0; sum_pos = 0; @@ -1562,9 +1630,9 @@ hypre_BoomerAMGBuildPartialStdInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker sum_neg_C = 0; sum = 0; sum_C = 0; - if(sep_weight == 1) + if (sep_weight == 1) { - for (jj=0; jj < cnt_c; jj++) + for (jj = 0; jj < cnt_c; jj++) { if (ahat[jj] > 0) { @@ -1575,9 +1643,9 @@ hypre_BoomerAMGBuildPartialStdInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker sum_neg_C += ahat[jj]; } } - if(num_procs > 1) + if (num_procs > 1) { - for (jj=0; jj < cnt_c_offd; jj++) + for (jj = 0; jj < cnt_c_offd; jj++) { if (ahat_offd[jj] > 0) { @@ -1591,7 +1659,7 @@ hypre_BoomerAMGBuildPartialStdInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker } sum_pos = sum_pos_C; sum_neg = sum_neg_C; - for (jj=cnt_c+1; jj < cnt_f; jj++) + for (jj = cnt_c + 1; jj < cnt_f; jj++) { if (ahat[jj] > 0) { @@ -1603,9 +1671,10 @@ hypre_BoomerAMGBuildPartialStdInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker } ahat[jj] = 0; } - if(num_procs > 1) + + if (num_procs > 1) { - for (jj=cnt_c_offd; jj < cnt_f_offd; jj++) + for (jj = cnt_c_offd; jj < cnt_f_offd; jj++) { if (ahat_offd[jj] > 0) { @@ -1618,8 +1687,9 @@ hypre_BoomerAMGBuildPartialStdInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker ahat_offd[jj] = 0; } } - if (sum_neg_C*diagonal != 0.0) alfa = sum_neg/sum_neg_C/diagonal; - if (sum_pos_C*diagonal != 0.0) beta = sum_pos/sum_pos_C/diagonal; + + alpha = (sum_neg_C * diagonal != 0.0) ? (sum_neg / sum_neg_C / diagonal) : 1.0; + beta = (sum_pos_C * diagonal != 0.0) ? (sum_pos / sum_pos_C / diagonal) : 1.0; /*----------------------------------------------------------------- * Set interpolation weight by dividing by the diagonal. @@ -1629,59 +1699,71 @@ hypre_BoomerAMGBuildPartialStdInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker { j1 = ihat[P_diag_j[jj]]; if (ahat[j1] > 0) - P_diag_data[jj] = -beta*ahat[j1]; + { + P_diag_data[jj] = -beta * ahat[j1]; + } else - P_diag_data[jj] = -alfa*ahat[j1]; + { + P_diag_data[jj] = -alpha * ahat[j1]; + } P_diag_j[jj] = fine_to_coarse[P_diag_j[jj]]; ahat[j1] = 0; } - for (jj=0; jj < cnt_f; jj++) + for (jj = 0; jj < cnt_f; jj++) + { ihat[ipnt[jj]] = -1; - if(num_procs > 1) + } + if (num_procs > 1) { for (jj = jj_begin_row_offd; jj < jj_end_row_offd; jj++) { j1 = ihat_offd[P_offd_j[jj]]; if (ahat_offd[j1] > 0) - P_offd_data[jj] = -beta*ahat_offd[j1]; + { + P_offd_data[jj] = - beta * ahat_offd[j1]; + } else - P_offd_data[jj] = -alfa*ahat_offd[j1]; + { + P_offd_data[jj] = - alpha * ahat_offd[j1]; + } ahat_offd[j1] = 0; } - for (jj=0; jj < cnt_f_offd; jj++) + for (jj = 0; jj < cnt_f_offd; jj++) + { ihat_offd[ipnt_offd[jj]] = -1; + } } } else { - for (jj=0; jj < cnt_c; jj++) + for (jj = 0; jj < cnt_c; jj++) { sum_C += ahat[jj]; } - if(num_procs > 1) + if (num_procs > 1) { - for (jj=0; jj < cnt_c_offd; jj++) + for (jj = 0; jj < cnt_c_offd; jj++) { sum_C += ahat_offd[jj]; } } sum = sum_C; - for (jj=cnt_c+1; jj < cnt_f; jj++) + for (jj = cnt_c + 1; jj < cnt_f; jj++) { sum += ahat[jj]; ahat[jj] = 0; } - if(num_procs > 1) + if (num_procs > 1) { - for (jj=cnt_c_offd; jj < cnt_f_offd; jj++) + for (jj = cnt_c_offd; jj < cnt_f_offd; jj++) { sum += ahat_offd[jj]; ahat_offd[jj] = 0; } } - if (sum_C*diagonal != 0.0) alfa = sum/sum_C/diagonal; + alpha = (sum_C * diagonal != 0.0) ? (sum / sum_C / diagonal) : 1.0; /*----------------------------------------------------------------- * Set interpolation weight by dividing by the diagonal. @@ -1690,25 +1772,29 @@ hypre_BoomerAMGBuildPartialStdInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker for (jj = jj_begin_row; jj < jj_end_row; jj++) { j1 = ihat[P_diag_j[jj]]; - P_diag_data[jj] = -alfa*ahat[j1]; + P_diag_data[jj] = - alpha * ahat[j1]; P_diag_j[jj] = fine_to_coarse[P_diag_j[jj]]; ahat[j1] = 0; } - for (jj=0; jj < cnt_f; jj++) + for (jj = 0; jj < cnt_f; jj++) + { ihat[ipnt[jj]] = -1; - if(num_procs > 1) + } + if (num_procs > 1) { for (jj = jj_begin_row_offd; jj < jj_end_row_offd; jj++) { j1 = ihat_offd[P_offd_j[jj]]; - P_offd_data[jj] = -alfa*ahat_offd[j1]; + P_offd_data[jj] = - alpha * ahat_offd[j1]; ahat_offd[j1] = 0; } - for (jj=0; jj < cnt_f_offd; jj++) + for (jj = 0; jj < cnt_f_offd; jj++) + { ihat_offd[ipnt_offd[jj]] = -1; + } } } - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; wall_3 += wall_time; @@ -1717,7 +1803,7 @@ hypre_BoomerAMGBuildPartialStdInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker } } - if (debug_flag==4) + if (debug_flag == 4) { hypre_printf("Proc = %d fill part 1 %f part 2 %f part 3 %f\n", my_id, wall_1, wall_2, wall_3); @@ -1760,15 +1846,15 @@ hypre_BoomerAMGBuildPartialStdInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker /* This builds col_map, col_map should be monotone increasing and contain * global numbers. */ - if(P_offd_size) + if (P_offd_size) { hypre_build_interp_colmap(P, full_off_procNodes, tmp_CF_marker_offd, fine_to_coarse_offd); } hypre_MatvecCommPkgCreate(P); - for (i=0; i < n_fine; i++) - if (CF_marker[i] < -1) CF_marker[i] = -1; + for (i = 0; i < n_fine; i++) + if (CF_marker[i] < -1) { CF_marker[i] = -1; } *P_ptr = P; @@ -1795,8 +1881,10 @@ hypre_BoomerAMGBuildPartialStdInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker hypre_TFree(CF_marker_offd, HYPRE_MEMORY_HOST); hypre_TFree(tmp_CF_marker_offd, HYPRE_MEMORY_HOST); - if(num_functions > 1) + if (num_functions > 1) + { hypre_TFree(dof_func_offd, HYPRE_MEMORY_HOST); + } hypre_MatvecCommPkgDestroy(extend_comm_pkg); @@ -1873,10 +1961,10 @@ hypre_BoomerAMGBuildPartialExtInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker HYPRE_Int *dof_func_offd = NULL; /* Full row information for columns of A that are off diag*/ - hypre_CSRMatrix *A_ext; - HYPRE_Real *A_ext_data; - HYPRE_Int *A_ext_i; - HYPRE_BigInt *A_ext_j; + hypre_CSRMatrix *A_ext = NULL; + HYPRE_Real *A_ext_data = NULL; + HYPRE_Int *A_ext_i = NULL; + HYPRE_BigInt *A_ext_j = NULL; HYPRE_Int *fine_to_coarse = NULL; HYPRE_BigInt *fine_to_coarse_offd = NULL; @@ -1885,9 +1973,9 @@ hypre_BoomerAMGBuildPartialExtInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker HYPRE_Int loc_col; HYPRE_Int full_off_procNodes; - hypre_CSRMatrix *Sop; - HYPRE_Int *Sop_i; - HYPRE_BigInt *Sop_j; + hypre_CSRMatrix *Sop = NULL; + HYPRE_Int *Sop_i = NULL; + HYPRE_BigInt *Sop_j = NULL; HYPRE_Int sgn; @@ -1896,7 +1984,7 @@ hypre_BoomerAMGBuildPartialExtInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker HYPRE_Int jj_begin_row, jj_end_row; HYPRE_Int jj_begin_row_offd = 0; HYPRE_Int jj_end_row_offd = 0; - HYPRE_Int coarse_counter; + //HYPRE_Int coarse_counter; HYPRE_Int n_coarse_old; HYPRE_BigInt total_old_global_cpts; @@ -1914,28 +2002,27 @@ hypre_BoomerAMGBuildPartialExtInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker /* Definitions */ HYPRE_Real zero = 0.0; HYPRE_Real one = 1.0; - HYPRE_Real wall_time; - + HYPRE_Real wall_time = 0.0; hypre_ParCSRCommPkg *extend_comm_pkg = NULL; - if (debug_flag==4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } /* BEGIN */ hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_rank(comm, &my_id); my_first_cpt = num_cpts_global[0]; /*my_first_old_cpt = num_old_cpts_global[0];*/ n_coarse_old = (HYPRE_Int)(num_old_cpts_global[1] - num_old_cpts_global[0]); /*n_coarse = num_cpts_global[1] - num_cpts_global[0];*/ - if (my_id == (num_procs -1)) + if (my_id == (num_procs - 1)) { total_global_cpts = num_cpts_global[1]; total_old_global_cpts = num_old_cpts_global[1]; } - hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); - hypre_MPI_Bcast(&total_old_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); + hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); + hypre_MPI_Bcast(&total_old_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); if (!comm_pkg) { @@ -1974,8 +2061,8 @@ hypre_BoomerAMGBuildPartialExtInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker /*----------------------------------------------------------------------- * Intialize counters and allocate mapping vector. *-----------------------------------------------------------------------*/ - P_diag_i = hypre_CTAlloc(HYPRE_Int, n_coarse_old+1, HYPRE_MEMORY_HOST); - P_offd_i = hypre_CTAlloc(HYPRE_Int, n_coarse_old+1, HYPRE_MEMORY_HOST); + P_diag_i = hypre_CTAlloc(HYPRE_Int, n_coarse_old + 1, HYPRE_MEMORY_HOST); + P_offd_i = hypre_CTAlloc(HYPRE_Int, n_coarse_old + 1, HYPRE_MEMORY_HOST); if (n_fine) { @@ -1997,7 +2084,7 @@ hypre_BoomerAMGBuildPartialExtInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker jj_counter = start_indexing; jj_counter_offd = start_indexing; - coarse_counter = 0; + //coarse_counter = 0; cnt = 0; old_cnt = 0; @@ -2022,13 +2109,15 @@ hypre_BoomerAMGBuildPartialExtInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker { P_diag_i[ii] = jj_counter; if (num_procs > 1) + { P_offd_i[ii] = jj_counter_offd; + } i = old_coarse_to_fine[ii]; if (CF_marker[i] > 0) { jj_counter++; - coarse_counter++; + //coarse_counter++; } /*-------------------------------------------------------------------- @@ -2038,11 +2127,12 @@ hypre_BoomerAMGBuildPartialExtInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker *--------------------------------------------------------------------*/ else if (CF_marker[i] == -2) { - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) { i1 = S_diag_j[jj]; if (CF_marker[i1] > 0) - { /* i1 is a C point */ + { + /* i1 is a C point */ if (P_marker[i1] < P_diag_i[ii]) { P_marker[i1] = jj_counter; @@ -2050,27 +2140,28 @@ hypre_BoomerAMGBuildPartialExtInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker } } else if (CF_marker[i1] != -3) - { /* i1 is a F point, loop through it's strong neighbors */ - for (kk = S_diag_i[i1]; kk < S_diag_i[i1+1]; kk++) + { + /* i1 is a F point, loop through it's strong neighbors */ + for (kk = S_diag_i[i1]; kk < S_diag_i[i1 + 1]; kk++) { k1 = S_diag_j[kk]; if (CF_marker[k1] > 0) { - if(P_marker[k1] < P_diag_i[ii]) + if (P_marker[k1] < P_diag_i[ii]) { P_marker[k1] = jj_counter; jj_counter++; } } } - if(num_procs > 1) + if (num_procs > 1) { - for (kk = S_offd_i[i1]; kk < S_offd_i[i1+1]; kk++) + for (kk = S_offd_i[i1]; kk < S_offd_i[i1 + 1]; kk++) { k1 = S_offd_j[kk]; if (CF_marker_offd[k1] > 0) { - if(P_marker_offd[k1] < P_offd_i[ii]) + if (P_marker_offd[k1] < P_offd_i[ii]) { tmp_CF_marker_offd[k1] = 1; P_marker_offd[k1] = jj_counter_offd; @@ -2084,12 +2175,12 @@ hypre_BoomerAMGBuildPartialExtInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker /* Look at off diag strong connections of i */ if (num_procs > 1) { - for (jj = S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) { i1 = S_offd_j[jj]; if (CF_marker_offd[i1] > 0) { - if(P_marker_offd[i1] < P_offd_i[ii]) + if (P_marker_offd[i1] < P_offd_i[ii]) { tmp_CF_marker_offd[i1] = 1; P_marker_offd[i1] = jj_counter_offd; @@ -2097,16 +2188,18 @@ hypre_BoomerAMGBuildPartialExtInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker } } else if (CF_marker_offd[i1] != -3) - { /* F point; look at neighbors of i1. Sop contains global col - * numbers and entries that could be in S_diag or S_offd or - * neither. */ - for(kk = Sop_i[i1]; kk < Sop_i[i1+1]; kk++) + { + /* F point; look at neighbors of i1. Sop contains global col + * numbers and entries that could be in S_diag or S_offd or + * neither. */ + for (kk = Sop_i[i1]; kk < Sop_i[i1 + 1]; kk++) { big_k1 = Sop_j[kk]; - if(big_k1 >= col_1 && big_k1 < col_n) - { /* In S_diag */ - loc_col = (HYPRE_Int)(big_k1-col_1); - if(P_marker[loc_col] < P_diag_i[ii]) + if (big_k1 >= col_1 && big_k1 < col_n) + { + /* In S_diag */ + loc_col = (HYPRE_Int)(big_k1 - col_1); + if (P_marker[loc_col] < P_diag_i[ii]) { P_marker[loc_col] = jj_counter; jj_counter++; @@ -2115,7 +2208,7 @@ hypre_BoomerAMGBuildPartialExtInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker else { loc_col = -(HYPRE_Int)big_k1 - 1; - if(P_marker_offd[loc_col] < P_offd_i[ii]) + if (P_marker_offd[loc_col] < P_offd_i[ii]) { P_marker_offd[loc_col] = jj_counter_offd; tmp_CF_marker_offd[loc_col] = 1; @@ -2129,7 +2222,7 @@ hypre_BoomerAMGBuildPartialExtInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker } } - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d determine structure %f\n", @@ -2140,7 +2233,7 @@ hypre_BoomerAMGBuildPartialExtInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker * Allocate arrays. *-----------------------------------------------------------------------*/ - if (debug_flag== 4) wall_time = time_getWallclockSeconds(); + if (debug_flag == 4) { wall_time = time_getWallclockSeconds(); } P_diag_size = jj_counter; P_offd_size = jj_counter_offd; @@ -2164,7 +2257,7 @@ hypre_BoomerAMGBuildPartialExtInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker jj_counter_offd = start_indexing; /* Fine to coarse mapping */ - if(num_procs > 1) + if (num_procs > 1) { hypre_big_insert_new_nodes(comm_pkg, extend_comm_pkg, fine_to_coarse, full_off_procNodes, my_first_cpt, @@ -2172,10 +2265,14 @@ hypre_BoomerAMGBuildPartialExtInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker } for (i = 0; i < n_fine; i++) + { P_marker[i] = -1; + } for (i = 0; i < full_off_procNodes; i++) + { P_marker_offd[i] = -1; + } /*----------------------------------------------------------------------- * Loop over fine grid points. @@ -2203,7 +2300,7 @@ hypre_BoomerAMGBuildPartialExtInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker else if (CF_marker[i] == -2) { strong_f_marker--; - for (jj = S_diag_i[i]; jj < S_diag_i[i+1]; jj++) + for (jj = S_diag_i[i]; jj < S_diag_i[i + 1]; jj++) { i1 = S_diag_j[jj]; @@ -2225,12 +2322,12 @@ hypre_BoomerAMGBuildPartialExtInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker else if (CF_marker[i1] != -3) { P_marker[i1] = strong_f_marker; - for (kk = S_diag_i[i1]; kk < S_diag_i[i1+1]; kk++) + for (kk = S_diag_i[i1]; kk < S_diag_i[i1 + 1]; kk++) { k1 = S_diag_j[kk]; if (CF_marker[k1] >= 0) { - if(P_marker[k1] < jj_begin_row) + if (P_marker[k1] < jj_begin_row) { P_marker[k1] = jj_counter; P_diag_j[jj_counter] = fine_to_coarse[k1]; @@ -2239,14 +2336,14 @@ hypre_BoomerAMGBuildPartialExtInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker } } } - if(num_procs > 1) + if (num_procs > 1) { - for (kk = S_offd_i[i1]; kk < S_offd_i[i1+1]; kk++) + for (kk = S_offd_i[i1]; kk < S_offd_i[i1 + 1]; kk++) { k1 = S_offd_j[kk]; - if(CF_marker_offd[k1] >= 0) + if (CF_marker_offd[k1] >= 0) { - if(P_marker_offd[k1] < jj_begin_row_offd) + if (P_marker_offd[k1] < jj_begin_row_offd) { P_marker_offd[k1] = jj_counter_offd; P_offd_j[jj_counter_offd] = k1; @@ -2261,12 +2358,12 @@ hypre_BoomerAMGBuildPartialExtInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker if ( num_procs > 1) { - for (jj=S_offd_i[i]; jj < S_offd_i[i+1]; jj++) + for (jj = S_offd_i[i]; jj < S_offd_i[i + 1]; jj++) { i1 = S_offd_j[jj]; if ( CF_marker_offd[i1] >= 0) { - if(P_marker_offd[i1] < jj_begin_row_offd) + if (P_marker_offd[i1] < jj_begin_row_offd) { P_marker_offd[i1] = jj_counter_offd; P_offd_j[jj_counter_offd] = i1; @@ -2277,14 +2374,14 @@ hypre_BoomerAMGBuildPartialExtInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker else if (CF_marker_offd[i1] != -3) { P_marker_offd[i1] = strong_f_marker; - for(kk = Sop_i[i1]; kk < Sop_i[i1+1]; kk++) + for (kk = Sop_i[i1]; kk < Sop_i[i1 + 1]; kk++) { big_k1 = Sop_j[kk]; /* Find local col number */ - if(big_k1 >= col_1 && big_k1 < col_n) + if (big_k1 >= col_1 && big_k1 < col_n) { - loc_col = (HYPRE_Int)(big_k1-col_1); - if(P_marker[loc_col] < jj_begin_row) + loc_col = (HYPRE_Int)(big_k1 - col_1); + if (P_marker[loc_col] < jj_begin_row) { P_marker[loc_col] = jj_counter; P_diag_j[jj_counter] = fine_to_coarse[loc_col]; @@ -2295,10 +2392,10 @@ hypre_BoomerAMGBuildPartialExtInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker else { loc_col = -(HYPRE_Int)big_k1 - 1; - if(P_marker_offd[loc_col] < jj_begin_row_offd) + if (P_marker_offd[loc_col] < jj_begin_row_offd) { P_marker_offd[loc_col] = jj_counter_offd; - P_offd_j[jj_counter_offd]=loc_col; + P_offd_j[jj_counter_offd] = loc_col; P_offd_data[jj_counter_offd] = zero; jj_counter_offd++; } @@ -2313,57 +2410,62 @@ hypre_BoomerAMGBuildPartialExtInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker diagonal = A_diag_data[A_diag_i[i]]; - for (jj = A_diag_i[i]+1; jj < A_diag_i[i+1]; jj++) - { /* i1 is a c-point and strongly influences i, accumulate - * a_(i,i1) into interpolation weight */ + for (jj = A_diag_i[i] + 1; jj < A_diag_i[i + 1]; jj++) + { + /* i1 is a c-point and strongly influences i, accumulate + * a_(i,i1) into interpolation weight */ i1 = A_diag_j[jj]; if (P_marker[i1] >= jj_begin_row) { P_diag_data[P_marker[i1]] += A_diag_data[jj]; } - else if(P_marker[i1] == strong_f_marker) + else if (P_marker[i1] == strong_f_marker) { sum = zero; sgn = 1; - if(A_diag_data[A_diag_i[i1]] < 0) sgn = -1; + if (A_diag_data[A_diag_i[i1]] < 0) { sgn = -1; } /* Loop over row of A for point i1 and calculate the sum * of the connections to c-points that strongly incluence i. */ - for(jj1 = A_diag_i[i1]+1; jj1 < A_diag_i[i1+1]; jj1++) + for (jj1 = A_diag_i[i1] + 1; jj1 < A_diag_i[i1 + 1]; jj1++) { i2 = A_diag_j[jj1]; - if((P_marker[i2] >= jj_begin_row) && (sgn*A_diag_data[jj1]) < 0) + if ((P_marker[i2] >= jj_begin_row) && (sgn * A_diag_data[jj1]) < 0) + { sum += A_diag_data[jj1]; + } } - if(num_procs > 1) + if (num_procs > 1) { - for(jj1 = A_offd_i[i1]; jj1< A_offd_i[i1+1]; jj1++) + for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1 + 1]; jj1++) { i2 = A_offd_j[jj1]; - if(P_marker_offd[i2] >= jj_begin_row_offd && - (sgn*A_offd_data[jj1]) < 0) + if (P_marker_offd[i2] >= jj_begin_row_offd && + (sgn * A_offd_data[jj1]) < 0) + { sum += A_offd_data[jj1]; + } } } - if(sum != 0) + if (sum != 0) { - distribute = A_diag_data[jj]/sum; + distribute = A_diag_data[jj] / sum; /* Loop over row of A for point i1 and do the distribution */ - for(jj1 = A_diag_i[i1]+1; jj1 < A_diag_i[i1+1]; jj1++) + for (jj1 = A_diag_i[i1] + 1; jj1 < A_diag_i[i1 + 1]; jj1++) { i2 = A_diag_j[jj1]; - if(P_marker[i2] >= jj_begin_row && (sgn*A_diag_data[jj1]) < 0) + if (P_marker[i2] >= jj_begin_row && (sgn * A_diag_data[jj1]) < 0) P_diag_data[P_marker[i2]] += - distribute*A_diag_data[jj1]; + distribute * A_diag_data[jj1]; } - if(num_procs > 1) + if (num_procs > 1) { - for(jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1+1]; jj1++) + for (jj1 = A_offd_i[i1]; jj1 < A_offd_i[i1 + 1]; jj1++) { i2 = A_offd_j[jj1]; - if(P_marker_offd[i2] >= jj_begin_row_offd && - (sgn*A_offd_data[jj1]) < 0) + if (P_marker_offd[i2] >= jj_begin_row_offd && + (sgn * A_offd_data[jj1]) < 0) P_offd_data[P_marker_offd[i2]] += - distribute*A_offd_data[jj1]; + distribute * A_offd_data[jj1]; } } } @@ -2376,57 +2478,67 @@ hypre_BoomerAMGBuildPartialExtInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker * diagonal */ else if (CF_marker[i1] != -3) { - if(num_functions == 1 || dof_func[i] == dof_func[i1]) + if (num_functions == 1 || dof_func[i] == dof_func[i1]) + { diagonal += A_diag_data[jj]; + } } } - if(num_procs > 1) + if (num_procs > 1) { - for(jj = A_offd_i[i]; jj < A_offd_i[i+1]; jj++) + for (jj = A_offd_i[i]; jj < A_offd_i[i + 1]; jj++) { i1 = A_offd_j[jj]; - if(P_marker_offd[i1] >= jj_begin_row_offd) + if (P_marker_offd[i1] >= jj_begin_row_offd) + { P_offd_data[P_marker_offd[i1]] += A_offd_data[jj]; - else if(P_marker_offd[i1] == strong_f_marker) + } + else if (P_marker_offd[i1] == strong_f_marker) { sum = zero; sgn = 1; - for(jj1 = A_ext_i[i1]; jj1 < A_ext_i[i1+1]; jj1++) + for (jj1 = A_ext_i[i1]; jj1 < A_ext_i[i1 + 1]; jj1++) { big_k1 = A_ext_j[jj1]; - if(big_k1 >= col_1 && big_k1 < col_n) - { /* diag */ + if (big_k1 >= col_1 && big_k1 < col_n) + { + /* diag */ loc_col = (HYPRE_Int)(big_k1 - col_1); - if(P_marker[loc_col] >= jj_begin_row ) + if (P_marker[loc_col] >= jj_begin_row ) + { sum += A_ext_data[jj1]; + } } else { loc_col = -(HYPRE_Int)big_k1 - 1; - if(P_marker_offd[loc_col] >= jj_begin_row_offd && - (sgn*A_ext_data[jj1]) < 0) + if (P_marker_offd[loc_col] >= jj_begin_row_offd && + (sgn * A_ext_data[jj1]) < 0) + { sum += A_ext_data[jj1]; + } } } - if(sum != 0) + if (sum != 0) { distribute = A_offd_data[jj] / sum; - for(jj1 = A_ext_i[i1]; jj1 < A_ext_i[i1+1]; jj1++) + for (jj1 = A_ext_i[i1]; jj1 < A_ext_i[i1 + 1]; jj1++) { big_k1 = A_ext_j[jj1]; - if(big_k1 >= col_1 && big_k1 < col_n) - { /* diag */ + if (big_k1 >= col_1 && big_k1 < col_n) + { + /* diag */ loc_col = (HYPRE_Int)(big_k1 - col_1); - if(P_marker[loc_col] >= jj_begin_row) - P_diag_data[P_marker[loc_col]] += distribute* - A_ext_data[jj1]; + if (P_marker[loc_col] >= jj_begin_row) + P_diag_data[P_marker[loc_col]] += distribute * + A_ext_data[jj1]; } else { loc_col = -(HYPRE_Int)big_k1 - 1; - if(P_marker_offd[loc_col] >= jj_begin_row_offd) - P_offd_data[P_marker_offd[loc_col]] += distribute* - A_ext_data[jj1]; + if (P_marker_offd[loc_col] >= jj_begin_row_offd) + P_offd_data[P_marker_offd[loc_col]] += distribute * + A_ext_data[jj1]; } } } @@ -2437,23 +2549,29 @@ hypre_BoomerAMGBuildPartialExtInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker } else if (CF_marker_offd[i1] != -3) { - if(num_functions == 1 || dof_func[i] == dof_func_offd[i1]) + if (num_functions == 1 || dof_func[i] == dof_func_offd[i1]) + { diagonal += A_offd_data[jj]; + } } } } if (diagonal) { - for(jj = jj_begin_row; jj < jj_end_row; jj++) + for (jj = jj_begin_row; jj < jj_end_row; jj++) + { P_diag_data[jj] /= -diagonal; - for(jj = jj_begin_row_offd; jj < jj_end_row_offd; jj++) + } + for (jj = jj_begin_row_offd; jj < jj_end_row_offd; jj++) + { P_offd_data[jj] /= -diagonal; + } } } strong_f_marker--; } - if (debug_flag==4) + if (debug_flag == 4) { wall_time = time_getWallclockSeconds() - wall_time; hypre_printf("Proc = %d fill structure %f\n", @@ -2501,15 +2619,15 @@ hypre_BoomerAMGBuildPartialExtInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker /* This builds col_map, col_map should be monotone increasing and contain * global numbers. */ - if(P_offd_size) + if (P_offd_size) { hypre_build_interp_colmap(P, full_off_procNodes, tmp_CF_marker_offd, fine_to_coarse_offd); } hypre_MatvecCommPkgCreate(P); - for (i=0; i < n_fine; i++) - if (CF_marker[i] < -1) CF_marker[i] = -1; + for (i = 0; i < n_fine; i++) + if (CF_marker[i] < -1) { CF_marker[i] = -1; } *P_ptr = P; @@ -2526,8 +2644,10 @@ hypre_BoomerAMGBuildPartialExtInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker hypre_TFree(P_marker_offd, HYPRE_MEMORY_HOST); hypre_TFree(CF_marker_offd, HYPRE_MEMORY_HOST); hypre_TFree(tmp_CF_marker_offd, HYPRE_MEMORY_HOST); - if(num_functions > 1) + if (num_functions > 1) + { hypre_TFree(dof_func_offd, HYPRE_MEMORY_HOST); + } hypre_MatvecCommPkgDestroy(extend_comm_pkg); } diff --git a/external/hypre/src/parcsr_ls/protos.h b/external/hypre/src/parcsr_ls/protos.h index 2df4bfa6..09642cc4 100644 --- a/external/hypre/src/parcsr_ls/protos.h +++ b/external/hypre/src/parcsr_ls/protos.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -8,756 +8,1004 @@ /* ads.c */ void *hypre_ADSCreate ( void ); HYPRE_Int hypre_ADSDestroy ( void *solver ); -HYPRE_Int hypre_ADSSetDiscreteCurl ( void *solver , hypre_ParCSRMatrix *C ); -HYPRE_Int hypre_ADSSetDiscreteGradient ( void *solver , hypre_ParCSRMatrix *G ); -HYPRE_Int hypre_ADSSetCoordinateVectors ( void *solver , hypre_ParVector *x , hypre_ParVector *y , hypre_ParVector *z ); -HYPRE_Int hypre_ADSSetInterpolations ( void *solver , hypre_ParCSRMatrix *RT_Pi , hypre_ParCSRMatrix *RT_Pix , hypre_ParCSRMatrix *RT_Piy , hypre_ParCSRMatrix *RT_Piz , hypre_ParCSRMatrix *ND_Pi , hypre_ParCSRMatrix *ND_Pix , hypre_ParCSRMatrix *ND_Piy , hypre_ParCSRMatrix *ND_Piz ); -HYPRE_Int hypre_ADSSetMaxIter ( void *solver , HYPRE_Int maxit ); -HYPRE_Int hypre_ADSSetTol ( void *solver , HYPRE_Real tol ); -HYPRE_Int hypre_ADSSetCycleType ( void *solver , HYPRE_Int cycle_type ); -HYPRE_Int hypre_ADSSetPrintLevel ( void *solver , HYPRE_Int print_level ); -HYPRE_Int hypre_ADSSetSmoothingOptions ( void *solver , HYPRE_Int A_relax_type , HYPRE_Int A_relax_times , HYPRE_Real A_relax_weight , HYPRE_Real A_omega ); -HYPRE_Int hypre_ADSSetChebySmoothingOptions ( void *solver , HYPRE_Int A_cheby_order , HYPRE_Int A_cheby_fraction ); -HYPRE_Int hypre_ADSSetAMSOptions ( void *solver , HYPRE_Int B_C_cycle_type , HYPRE_Int B_C_coarsen_type , HYPRE_Int B_C_agg_levels , HYPRE_Int B_C_relax_type , HYPRE_Real B_C_theta , HYPRE_Int B_C_interp_type , HYPRE_Int B_C_Pmax ); -HYPRE_Int hypre_ADSSetAMGOptions ( void *solver , HYPRE_Int B_Pi_coarsen_type , HYPRE_Int B_Pi_agg_levels , HYPRE_Int B_Pi_relax_type , HYPRE_Real B_Pi_theta , HYPRE_Int B_Pi_interp_type , HYPRE_Int B_Pi_Pmax ); -HYPRE_Int hypre_ADSComputePi ( hypre_ParCSRMatrix *A , hypre_ParCSRMatrix *C , hypre_ParCSRMatrix *G , hypre_ParVector *x , hypre_ParVector *y , hypre_ParVector *z , hypre_ParCSRMatrix *PiNDx , hypre_ParCSRMatrix *PiNDy , hypre_ParCSRMatrix *PiNDz , hypre_ParCSRMatrix **Pi_ptr ); -HYPRE_Int hypre_ADSComputePixyz ( hypre_ParCSRMatrix *A , hypre_ParCSRMatrix *C , hypre_ParCSRMatrix *G , hypre_ParVector *x , hypre_ParVector *y , hypre_ParVector *z , hypre_ParCSRMatrix *PiNDx , hypre_ParCSRMatrix *PiNDy , hypre_ParCSRMatrix *PiNDz , hypre_ParCSRMatrix **Pix_ptr , hypre_ParCSRMatrix **Piy_ptr , hypre_ParCSRMatrix **Piz_ptr ); -HYPRE_Int hypre_ADSSetup ( void *solver , hypre_ParCSRMatrix *A , hypre_ParVector *b , hypre_ParVector *x ); -HYPRE_Int hypre_ADSSolve ( void *solver , hypre_ParCSRMatrix *A , hypre_ParVector *b , hypre_ParVector *x ); -HYPRE_Int hypre_ADSGetNumIterations ( void *solver , HYPRE_Int *num_iterations ); -HYPRE_Int hypre_ADSGetFinalRelativeResidualNorm ( void *solver , HYPRE_Real *rel_resid_norm ); +HYPRE_Int hypre_ADSSetDiscreteCurl ( void *solver, hypre_ParCSRMatrix *C ); +HYPRE_Int hypre_ADSSetDiscreteGradient ( void *solver, hypre_ParCSRMatrix *G ); +HYPRE_Int hypre_ADSSetCoordinateVectors ( void *solver, hypre_ParVector *x, hypre_ParVector *y, + hypre_ParVector *z ); +HYPRE_Int hypre_ADSSetInterpolations ( void *solver, hypre_ParCSRMatrix *RT_Pi, + hypre_ParCSRMatrix *RT_Pix, hypre_ParCSRMatrix *RT_Piy, + hypre_ParCSRMatrix *RT_Piz, hypre_ParCSRMatrix *ND_Pi, + hypre_ParCSRMatrix *ND_Pix, hypre_ParCSRMatrix *ND_Piy, + hypre_ParCSRMatrix *ND_Piz ); +HYPRE_Int hypre_ADSSetMaxIter ( void *solver, HYPRE_Int maxit ); +HYPRE_Int hypre_ADSSetTol ( void *solver, HYPRE_Real tol ); +HYPRE_Int hypre_ADSSetCycleType ( void *solver, HYPRE_Int cycle_type ); +HYPRE_Int hypre_ADSSetPrintLevel ( void *solver, HYPRE_Int print_level ); +HYPRE_Int hypre_ADSSetSmoothingOptions ( void *solver, HYPRE_Int A_relax_type, + HYPRE_Int A_relax_times, HYPRE_Real A_relax_weight, HYPRE_Real A_omega ); +HYPRE_Int hypre_ADSSetChebySmoothingOptions ( void *solver, HYPRE_Int A_cheby_order, + HYPRE_Real A_cheby_fraction ); +HYPRE_Int hypre_ADSSetAMSOptions ( void *solver, HYPRE_Int B_C_cycle_type, + HYPRE_Int B_C_coarsen_type, HYPRE_Int B_C_agg_levels, HYPRE_Int B_C_relax_type, + HYPRE_Real B_C_theta, HYPRE_Int B_C_interp_type, HYPRE_Int B_C_Pmax ); +HYPRE_Int hypre_ADSSetAMGOptions ( void *solver, HYPRE_Int B_Pi_coarsen_type, + HYPRE_Int B_Pi_agg_levels, HYPRE_Int B_Pi_relax_type, HYPRE_Real B_Pi_theta, + HYPRE_Int B_Pi_interp_type, HYPRE_Int B_Pi_Pmax ); +HYPRE_Int hypre_ADSComputePi ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *C, hypre_ParCSRMatrix *G, + hypre_ParVector *x, hypre_ParVector *y, hypre_ParVector *z, hypre_ParCSRMatrix *PiNDx, + hypre_ParCSRMatrix *PiNDy, hypre_ParCSRMatrix *PiNDz, hypre_ParCSRMatrix **Pi_ptr ); +HYPRE_Int hypre_ADSComputePixyz ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *C, + hypre_ParCSRMatrix *G, hypre_ParVector *x, hypre_ParVector *y, hypre_ParVector *z, + hypre_ParCSRMatrix *PiNDx, hypre_ParCSRMatrix *PiNDy, hypre_ParCSRMatrix *PiNDz, + hypre_ParCSRMatrix **Pix_ptr, hypre_ParCSRMatrix **Piy_ptr, hypre_ParCSRMatrix **Piz_ptr ); +HYPRE_Int hypre_ADSSetup ( void *solver, hypre_ParCSRMatrix *A, hypre_ParVector *b, + hypre_ParVector *x ); +HYPRE_Int hypre_ADSSolve ( void *solver, hypre_ParCSRMatrix *A, hypre_ParVector *b, + hypre_ParVector *x ); +HYPRE_Int hypre_ADSGetNumIterations ( void *solver, HYPRE_Int *num_iterations ); +HYPRE_Int hypre_ADSGetFinalRelativeResidualNorm ( void *solver, HYPRE_Real *rel_resid_norm ); /* ame.c */ void *hypre_AMECreate ( void ); HYPRE_Int hypre_AMEDestroy ( void *esolver ); -HYPRE_Int hypre_AMESetAMSSolver ( void *esolver , void *ams_solver ); -HYPRE_Int hypre_AMESetMassMatrix ( void *esolver , hypre_ParCSRMatrix *M ); -HYPRE_Int hypre_AMESetBlockSize ( void *esolver , HYPRE_Int block_size ); -HYPRE_Int hypre_AMESetMaxIter ( void *esolver , HYPRE_Int maxit ); -HYPRE_Int hypre_AMESetTol ( void *esolver , HYPRE_Real tol ); -HYPRE_Int hypre_AMESetRTol ( void *esolver , HYPRE_Real tol ); -HYPRE_Int hypre_AMESetPrintLevel ( void *esolver , HYPRE_Int print_level ); +HYPRE_Int hypre_AMESetAMSSolver ( void *esolver, void *ams_solver ); +HYPRE_Int hypre_AMESetMassMatrix ( void *esolver, hypre_ParCSRMatrix *M ); +HYPRE_Int hypre_AMESetBlockSize ( void *esolver, HYPRE_Int block_size ); +HYPRE_Int hypre_AMESetMaxIter ( void *esolver, HYPRE_Int maxit ); +HYPRE_Int hypre_AMESetMaxPCGIter ( void *esolver, HYPRE_Int maxit ); +HYPRE_Int hypre_AMESetTol ( void *esolver, HYPRE_Real tol ); +HYPRE_Int hypre_AMESetRTol ( void *esolver, HYPRE_Real tol ); +HYPRE_Int hypre_AMESetPrintLevel ( void *esolver, HYPRE_Int print_level ); HYPRE_Int hypre_AMESetup ( void *esolver ); -HYPRE_Int hypre_AMEDiscrDivFreeComponent ( void *esolver , hypre_ParVector *b ); -void hypre_AMEOperatorA ( void *data , void *x , void *y ); -void hypre_AMEMultiOperatorA ( void *data , void *x , void *y ); -void hypre_AMEOperatorM ( void *data , void *x , void *y ); -void hypre_AMEMultiOperatorM ( void *data , void *x , void *y ); -void hypre_AMEOperatorB ( void *data , void *x , void *y ); -void hypre_AMEMultiOperatorB ( void *data , void *x , void *y ); +HYPRE_Int hypre_AMEDiscrDivFreeComponent ( void *esolver, hypre_ParVector *b ); +void hypre_AMEOperatorA ( void *data, void *x, void *y ); +void hypre_AMEMultiOperatorA ( void *data, void *x, void *y ); +void hypre_AMEOperatorM ( void *data, void *x, void *y ); +void hypre_AMEMultiOperatorM ( void *data, void *x, void *y ); +void hypre_AMEOperatorB ( void *data, void *x, void *y ); +void hypre_AMEMultiOperatorB ( void *data, void *x, void *y ); HYPRE_Int hypre_AMESolve ( void *esolver ); -HYPRE_Int hypre_AMEGetEigenvectors ( void *esolver , HYPRE_ParVector **eigenvectors_ptr ); -HYPRE_Int hypre_AMEGetEigenvalues ( void *esolver , HYPRE_Real **eigenvalues_ptr ); +HYPRE_Int hypre_AMEGetEigenvectors ( void *esolver, HYPRE_ParVector **eigenvectors_ptr ); +HYPRE_Int hypre_AMEGetEigenvalues ( void *esolver, HYPRE_Real **eigenvalues_ptr ); /* amg_hybrid.c */ void *hypre_AMGHybridCreate ( void ); HYPRE_Int hypre_AMGHybridDestroy ( void *AMGhybrid_vdata ); -HYPRE_Int hypre_AMGHybridSetTol ( void *AMGhybrid_vdata , HYPRE_Real tol ); -HYPRE_Int hypre_AMGHybridSetAbsoluteTol ( void *AMGhybrid_vdata , HYPRE_Real a_tol ); -HYPRE_Int hypre_AMGHybridSetConvergenceTol ( void *AMGhybrid_vdata , HYPRE_Real cf_tol ); -HYPRE_Int hypre_AMGHybridSetNonGalerkinTol ( void *AMGhybrid_vdata , HYPRE_Int nongalerk_num_tol, HYPRE_Real *nongalerkin_tol ); -HYPRE_Int hypre_AMGHybridSetDSCGMaxIter ( void *AMGhybrid_vdata , HYPRE_Int dscg_max_its ); -HYPRE_Int hypre_AMGHybridSetPCGMaxIter ( void *AMGhybrid_vdata , HYPRE_Int pcg_max_its ); -HYPRE_Int hypre_AMGHybridSetSetupType ( void *AMGhybrid_vdata , HYPRE_Int setup_type ); -HYPRE_Int hypre_AMGHybridSetSolverType ( void *AMGhybrid_vdata , HYPRE_Int solver_type ); -HYPRE_Int hypre_AMGHybridSetRecomputeResidual ( void *AMGhybrid_vdata , HYPRE_Int recompute_residual ); -HYPRE_Int hypre_AMGHybridGetRecomputeResidual ( void *AMGhybrid_vdata , HYPRE_Int *recompute_residual ); -HYPRE_Int hypre_AMGHybridSetRecomputeResidualP ( void *AMGhybrid_vdata , HYPRE_Int recompute_residual_p ); -HYPRE_Int hypre_AMGHybridGetRecomputeResidualP ( void *AMGhybrid_vdata , HYPRE_Int *recompute_residual_p ); -HYPRE_Int hypre_AMGHybridSetKDim ( void *AMGhybrid_vdata , HYPRE_Int k_dim ); -HYPRE_Int hypre_AMGHybridSetStopCrit ( void *AMGhybrid_vdata , HYPRE_Int stop_crit ); -HYPRE_Int hypre_AMGHybridSetTwoNorm ( void *AMGhybrid_vdata , HYPRE_Int two_norm ); -HYPRE_Int hypre_AMGHybridSetRelChange ( void *AMGhybrid_vdata , HYPRE_Int rel_change ); -HYPRE_Int hypre_AMGHybridSetPrecond ( void *pcg_vdata , HYPRE_Int (*pcg_precond_solve )(void*,void*,void*,void*), HYPRE_Int (*pcg_precond_setup )(void*,void*,void*,void*), void *pcg_precond ); -HYPRE_Int hypre_AMGHybridSetLogging ( void *AMGhybrid_vdata , HYPRE_Int logging ); -HYPRE_Int hypre_AMGHybridSetPrintLevel ( void *AMGhybrid_vdata , HYPRE_Int print_level ); -HYPRE_Int hypre_AMGHybridSetStrongThreshold ( void *AMGhybrid_vdata , HYPRE_Real strong_threshold ); -HYPRE_Int hypre_AMGHybridSetMaxRowSum ( void *AMGhybrid_vdata , HYPRE_Real max_row_sum ); -HYPRE_Int hypre_AMGHybridSetTruncFactor ( void *AMGhybrid_vdata , HYPRE_Real trunc_factor ); -HYPRE_Int hypre_AMGHybridSetPMaxElmts ( void *AMGhybrid_vdata , HYPRE_Int P_max_elmts ); -HYPRE_Int hypre_AMGHybridSetMaxLevels ( void *AMGhybrid_vdata , HYPRE_Int max_levels ); -HYPRE_Int hypre_AMGHybridSetMeasureType ( void *AMGhybrid_vdata , HYPRE_Int measure_type ); -HYPRE_Int hypre_AMGHybridSetCoarsenType ( void *AMGhybrid_vdata , HYPRE_Int coarsen_type ); -HYPRE_Int hypre_AMGHybridSetInterpType ( void *AMGhybrid_vdata , HYPRE_Int interp_type ); -HYPRE_Int hypre_AMGHybridSetCycleType ( void *AMGhybrid_vdata , HYPRE_Int cycle_type ); -HYPRE_Int hypre_AMGHybridSetNumSweeps ( void *AMGhybrid_vdata , HYPRE_Int num_sweeps ); -HYPRE_Int hypre_AMGHybridSetCycleNumSweeps ( void *AMGhybrid_vdata , HYPRE_Int num_sweeps , HYPRE_Int k ); -HYPRE_Int hypre_AMGHybridSetRelaxType ( void *AMGhybrid_vdata , HYPRE_Int relax_type ); -HYPRE_Int hypre_AMGHybridSetKeepTranspose ( void *AMGhybrid_vdata , HYPRE_Int keepT ); -HYPRE_Int hypre_AMGHybridSetSplittingStrategy( void *AMGhybrid_vdata , HYPRE_Int splitting_strategy ); -HYPRE_Int hypre_AMGHybridSetCycleRelaxType ( void *AMGhybrid_vdata , HYPRE_Int relax_type , HYPRE_Int k ); -HYPRE_Int hypre_AMGHybridSetRelaxOrder ( void *AMGhybrid_vdata , HYPRE_Int relax_order ); -HYPRE_Int hypre_AMGHybridSetMaxCoarseSize ( void *AMGhybrid_vdata , HYPRE_Int max_coarse_size ); -HYPRE_Int hypre_AMGHybridSetMinCoarseSize ( void *AMGhybrid_vdata , HYPRE_Int min_coarse_size ); -HYPRE_Int hypre_AMGHybridSetSeqThreshold ( void *AMGhybrid_vdata , HYPRE_Int seq_threshold ); -HYPRE_Int hypre_AMGHybridSetNumGridSweeps ( void *AMGhybrid_vdata , HYPRE_Int *num_grid_sweeps ); -HYPRE_Int hypre_AMGHybridSetGridRelaxType ( void *AMGhybrid_vdata , HYPRE_Int *grid_relax_type ); -HYPRE_Int hypre_AMGHybridSetGridRelaxPoints ( void *AMGhybrid_vdata , HYPRE_Int **grid_relax_points ); -HYPRE_Int hypre_AMGHybridSetRelaxWeight ( void *AMGhybrid_vdata , HYPRE_Real *relax_weight ); -HYPRE_Int hypre_AMGHybridSetOmega ( void *AMGhybrid_vdata , HYPRE_Real *omega ); -HYPRE_Int hypre_AMGHybridSetRelaxWt ( void *AMGhybrid_vdata , HYPRE_Real relax_wt ); -HYPRE_Int hypre_AMGHybridSetLevelRelaxWt ( void *AMGhybrid_vdata , HYPRE_Real relax_wt , HYPRE_Int level ); -HYPRE_Int hypre_AMGHybridSetOuterWt ( void *AMGhybrid_vdata , HYPRE_Real outer_wt ); -HYPRE_Int hypre_AMGHybridSetLevelOuterWt ( void *AMGhybrid_vdata , HYPRE_Real outer_wt , HYPRE_Int level ); -HYPRE_Int hypre_AMGHybridSetNumPaths ( void *AMGhybrid_vdata , HYPRE_Int num_paths ); -HYPRE_Int hypre_AMGHybridSetDofFunc ( void *AMGhybrid_vdata , HYPRE_Int *dof_func ); -HYPRE_Int hypre_AMGHybridSetAggNumLevels ( void *AMGhybrid_vdata , HYPRE_Int agg_num_levels ); -HYPRE_Int hypre_AMGHybridSetAggInterpType ( void *AMGhybrid_vdata , HYPRE_Int agg_interp_type ); -HYPRE_Int hypre_AMGHybridSetNumFunctions ( void *AMGhybrid_vdata , HYPRE_Int num_functions ); -HYPRE_Int hypre_AMGHybridSetNodal ( void *AMGhybrid_vdata , HYPRE_Int nodal ); +HYPRE_Int hypre_AMGHybridSetTol ( void *AMGhybrid_vdata, HYPRE_Real tol ); +HYPRE_Int hypre_AMGHybridSetAbsoluteTol ( void *AMGhybrid_vdata, HYPRE_Real a_tol ); +HYPRE_Int hypre_AMGHybridSetConvergenceTol ( void *AMGhybrid_vdata, HYPRE_Real cf_tol ); +HYPRE_Int hypre_AMGHybridSetNonGalerkinTol ( void *AMGhybrid_vdata, HYPRE_Int nongalerk_num_tol, + HYPRE_Real *nongalerkin_tol ); +HYPRE_Int hypre_AMGHybridSetDSCGMaxIter ( void *AMGhybrid_vdata, HYPRE_Int dscg_max_its ); +HYPRE_Int hypre_AMGHybridSetPCGMaxIter ( void *AMGhybrid_vdata, HYPRE_Int pcg_max_its ); +HYPRE_Int hypre_AMGHybridSetSetupType ( void *AMGhybrid_vdata, HYPRE_Int setup_type ); +HYPRE_Int hypre_AMGHybridSetSolverType ( void *AMGhybrid_vdata, HYPRE_Int solver_type ); +HYPRE_Int hypre_AMGHybridSetRecomputeResidual ( void *AMGhybrid_vdata, + HYPRE_Int recompute_residual ); +HYPRE_Int hypre_AMGHybridGetRecomputeResidual ( void *AMGhybrid_vdata, + HYPRE_Int *recompute_residual ); +HYPRE_Int hypre_AMGHybridSetRecomputeResidualP ( void *AMGhybrid_vdata, + HYPRE_Int recompute_residual_p ); +HYPRE_Int hypre_AMGHybridGetRecomputeResidualP ( void *AMGhybrid_vdata, + HYPRE_Int *recompute_residual_p ); +HYPRE_Int hypre_AMGHybridSetKDim ( void *AMGhybrid_vdata, HYPRE_Int k_dim ); +HYPRE_Int hypre_AMGHybridSetStopCrit ( void *AMGhybrid_vdata, HYPRE_Int stop_crit ); +HYPRE_Int hypre_AMGHybridSetTwoNorm ( void *AMGhybrid_vdata, HYPRE_Int two_norm ); +HYPRE_Int hypre_AMGHybridSetRelChange ( void *AMGhybrid_vdata, HYPRE_Int rel_change ); +HYPRE_Int hypre_AMGHybridSetPrecond ( void *pcg_vdata, HYPRE_Int (*pcg_precond_solve )(void*, void*, + void*, void*), HYPRE_Int (*pcg_precond_setup )(void*, void*, void*, void*), void *pcg_precond ); +HYPRE_Int hypre_AMGHybridSetLogging ( void *AMGhybrid_vdata, HYPRE_Int logging ); +HYPRE_Int hypre_AMGHybridSetPrintLevel ( void *AMGhybrid_vdata, HYPRE_Int print_level ); +HYPRE_Int hypre_AMGHybridSetStrongThreshold ( void *AMGhybrid_vdata, HYPRE_Real strong_threshold ); +HYPRE_Int hypre_AMGHybridSetMaxRowSum ( void *AMGhybrid_vdata, HYPRE_Real max_row_sum ); +HYPRE_Int hypre_AMGHybridSetTruncFactor ( void *AMGhybrid_vdata, HYPRE_Real trunc_factor ); +HYPRE_Int hypre_AMGHybridSetPMaxElmts ( void *AMGhybrid_vdata, HYPRE_Int P_max_elmts ); +HYPRE_Int hypre_AMGHybridSetMaxLevels ( void *AMGhybrid_vdata, HYPRE_Int max_levels ); +HYPRE_Int hypre_AMGHybridSetMeasureType ( void *AMGhybrid_vdata, HYPRE_Int measure_type ); +HYPRE_Int hypre_AMGHybridSetCoarsenType ( void *AMGhybrid_vdata, HYPRE_Int coarsen_type ); +HYPRE_Int hypre_AMGHybridSetInterpType ( void *AMGhybrid_vdata, HYPRE_Int interp_type ); +HYPRE_Int hypre_AMGHybridSetCycleType ( void *AMGhybrid_vdata, HYPRE_Int cycle_type ); +HYPRE_Int hypre_AMGHybridSetNumSweeps ( void *AMGhybrid_vdata, HYPRE_Int num_sweeps ); +HYPRE_Int hypre_AMGHybridSetCycleNumSweeps ( void *AMGhybrid_vdata, HYPRE_Int num_sweeps, + HYPRE_Int k ); +HYPRE_Int hypre_AMGHybridSetRelaxType ( void *AMGhybrid_vdata, HYPRE_Int relax_type ); +HYPRE_Int hypre_AMGHybridSetKeepTranspose ( void *AMGhybrid_vdata, HYPRE_Int keepT ); +HYPRE_Int hypre_AMGHybridSetSplittingStrategy( void *AMGhybrid_vdata, + HYPRE_Int splitting_strategy ); +HYPRE_Int hypre_AMGHybridSetCycleRelaxType ( void *AMGhybrid_vdata, HYPRE_Int relax_type, + HYPRE_Int k ); +HYPRE_Int hypre_AMGHybridSetRelaxOrder ( void *AMGhybrid_vdata, HYPRE_Int relax_order ); +HYPRE_Int hypre_AMGHybridSetMaxCoarseSize ( void *AMGhybrid_vdata, HYPRE_Int max_coarse_size ); +HYPRE_Int hypre_AMGHybridSetMinCoarseSize ( void *AMGhybrid_vdata, HYPRE_Int min_coarse_size ); +HYPRE_Int hypre_AMGHybridSetSeqThreshold ( void *AMGhybrid_vdata, HYPRE_Int seq_threshold ); +HYPRE_Int hypre_AMGHybridSetNumGridSweeps ( void *AMGhybrid_vdata, HYPRE_Int *num_grid_sweeps ); +HYPRE_Int hypre_AMGHybridSetGridRelaxType ( void *AMGhybrid_vdata, HYPRE_Int *grid_relax_type ); +HYPRE_Int hypre_AMGHybridSetGridRelaxPoints ( void *AMGhybrid_vdata, + HYPRE_Int **grid_relax_points ); +HYPRE_Int hypre_AMGHybridSetRelaxWeight ( void *AMGhybrid_vdata, HYPRE_Real *relax_weight ); +HYPRE_Int hypre_AMGHybridSetOmega ( void *AMGhybrid_vdata, HYPRE_Real *omega ); +HYPRE_Int hypre_AMGHybridSetRelaxWt ( void *AMGhybrid_vdata, HYPRE_Real relax_wt ); +HYPRE_Int hypre_AMGHybridSetLevelRelaxWt ( void *AMGhybrid_vdata, HYPRE_Real relax_wt, + HYPRE_Int level ); +HYPRE_Int hypre_AMGHybridSetOuterWt ( void *AMGhybrid_vdata, HYPRE_Real outer_wt ); +HYPRE_Int hypre_AMGHybridSetLevelOuterWt ( void *AMGhybrid_vdata, HYPRE_Real outer_wt, + HYPRE_Int level ); +HYPRE_Int hypre_AMGHybridSetNumPaths ( void *AMGhybrid_vdata, HYPRE_Int num_paths ); +HYPRE_Int hypre_AMGHybridSetDofFunc ( void *AMGhybrid_vdata, HYPRE_Int *dof_func ); +HYPRE_Int hypre_AMGHybridSetAggNumLevels ( void *AMGhybrid_vdata, HYPRE_Int agg_num_levels ); +HYPRE_Int hypre_AMGHybridSetAggInterpType ( void *AMGhybrid_vdata, HYPRE_Int agg_interp_type ); +HYPRE_Int hypre_AMGHybridSetNumFunctions ( void *AMGhybrid_vdata, HYPRE_Int num_functions ); +HYPRE_Int hypre_AMGHybridSetNodal ( void *AMGhybrid_vdata, HYPRE_Int nodal ); HYPRE_Int hypre_AMGHybridGetSetupSolveTime( void *AMGhybrid_vdata, HYPRE_Real *time ); -HYPRE_Int hypre_AMGHybridGetNumIterations ( void *AMGhybrid_vdata , HYPRE_Int *num_its ); -HYPRE_Int hypre_AMGHybridGetDSCGNumIterations ( void *AMGhybrid_vdata , HYPRE_Int *dscg_num_its ); -HYPRE_Int hypre_AMGHybridGetPCGNumIterations ( void *AMGhybrid_vdata , HYPRE_Int *pcg_num_its ); -HYPRE_Int hypre_AMGHybridGetFinalRelativeResidualNorm ( void *AMGhybrid_vdata , HYPRE_Real *final_rel_res_norm ); -HYPRE_Int hypre_AMGHybridSetup ( void *AMGhybrid_vdata , hypre_ParCSRMatrix *A , hypre_ParVector *b , hypre_ParVector *x ); -HYPRE_Int hypre_AMGHybridSolve ( void *AMGhybrid_vdata , hypre_ParCSRMatrix *A , hypre_ParVector *b , hypre_ParVector *x ); +HYPRE_Int hypre_AMGHybridGetNumIterations ( void *AMGhybrid_vdata, HYPRE_Int *num_its ); +HYPRE_Int hypre_AMGHybridGetDSCGNumIterations ( void *AMGhybrid_vdata, HYPRE_Int *dscg_num_its ); +HYPRE_Int hypre_AMGHybridGetPCGNumIterations ( void *AMGhybrid_vdata, HYPRE_Int *pcg_num_its ); +HYPRE_Int hypre_AMGHybridGetFinalRelativeResidualNorm ( void *AMGhybrid_vdata, + HYPRE_Real *final_rel_res_norm ); +HYPRE_Int hypre_AMGHybridSetup ( void *AMGhybrid_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *b, + hypre_ParVector *x ); +HYPRE_Int hypre_AMGHybridSolve ( void *AMGhybrid_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *b, + hypre_ParVector *x ); /* ams.c */ -HYPRE_Int hypre_ParCSRRelax ( hypre_ParCSRMatrix *A , hypre_ParVector *f , HYPRE_Int relax_type , HYPRE_Int relax_times , HYPRE_Real *l1_norms , HYPRE_Real relax_weight , HYPRE_Real omega , HYPRE_Real max_eig_est , HYPRE_Real min_eig_est , HYPRE_Int cheby_order , HYPRE_Real cheby_fraction , hypre_ParVector *u , hypre_ParVector *v , hypre_ParVector *z ); +HYPRE_Int hypre_ParCSRRelax ( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int relax_type, + HYPRE_Int relax_times, HYPRE_Real *l1_norms, HYPRE_Real relax_weight, HYPRE_Real omega, + HYPRE_Real max_eig_est, HYPRE_Real min_eig_est, HYPRE_Int cheby_order, HYPRE_Real cheby_fraction, + hypre_ParVector *u, hypre_ParVector *v, hypre_ParVector *z ); hypre_ParVector *hypre_ParVectorInRangeOf ( hypre_ParCSRMatrix *A ); hypre_ParVector *hypre_ParVectorInDomainOf ( hypre_ParCSRMatrix *A ); -HYPRE_Int hypre_ParVectorBlockSplit ( hypre_ParVector *x , hypre_ParVector *x_ [3 ], HYPRE_Int dim ); -HYPRE_Int hypre_ParVectorBlockGather ( hypre_ParVector *x , hypre_ParVector *x_ [3 ], HYPRE_Int dim ); -HYPRE_Int hypre_BoomerAMGBlockSolve ( void *B , hypre_ParCSRMatrix *A , hypre_ParVector *b , hypre_ParVector *x ); +HYPRE_Int hypre_ParVectorBlockSplit ( hypre_ParVector *x, hypre_ParVector *x_ [3 ], HYPRE_Int dim ); +HYPRE_Int hypre_ParVectorBlockGather ( hypre_ParVector *x, hypre_ParVector *x_ [3 ], + HYPRE_Int dim ); +HYPRE_Int hypre_BoomerAMGBlockSolve ( void *B, hypre_ParCSRMatrix *A, hypre_ParVector *b, + hypre_ParVector *x ); HYPRE_Int hypre_ParCSRMatrixFixZeroRows ( hypre_ParCSRMatrix *A ); -HYPRE_Int hypre_ParCSRComputeL1Norms ( hypre_ParCSRMatrix *A , HYPRE_Int option , HYPRE_Int *cf_marker , HYPRE_Real **l1_norm_ptr ); -HYPRE_Int hypre_ParCSRMatrixSetDiagRows ( hypre_ParCSRMatrix *A , HYPRE_Real d ); +HYPRE_Int hypre_ParCSRComputeL1Norms ( hypre_ParCSRMatrix *A, HYPRE_Int option, + HYPRE_Int *cf_marker, HYPRE_Real **l1_norm_ptr ); +HYPRE_Int hypre_ParCSRMatrixSetDiagRows ( hypre_ParCSRMatrix *A, HYPRE_Real d ); void *hypre_AMSCreate ( void ); HYPRE_Int hypre_AMSDestroy ( void *solver ); -HYPRE_Int hypre_AMSSetDimension ( void *solver , HYPRE_Int dim ); -HYPRE_Int hypre_AMSSetDiscreteGradient ( void *solver , hypre_ParCSRMatrix *G ); -HYPRE_Int hypre_AMSSetCoordinateVectors ( void *solver , hypre_ParVector *x , hypre_ParVector *y , hypre_ParVector *z ); -HYPRE_Int hypre_AMSSetEdgeConstantVectors ( void *solver , hypre_ParVector *Gx , hypre_ParVector *Gy , hypre_ParVector *Gz ); -HYPRE_Int hypre_AMSSetInterpolations ( void *solver , hypre_ParCSRMatrix *Pi , hypre_ParCSRMatrix *Pix , hypre_ParCSRMatrix *Piy , hypre_ParCSRMatrix *Piz ); -HYPRE_Int hypre_AMSSetAlphaPoissonMatrix ( void *solver , hypre_ParCSRMatrix *A_Pi ); -HYPRE_Int hypre_AMSSetBetaPoissonMatrix ( void *solver , hypre_ParCSRMatrix *A_G ); -HYPRE_Int hypre_AMSSetInteriorNodes ( void *solver , hypre_ParVector *interior_nodes ); -HYPRE_Int hypre_AMSSetProjectionFrequency ( void *solver , HYPRE_Int projection_frequency ); -HYPRE_Int hypre_AMSSetMaxIter ( void *solver , HYPRE_Int maxit ); -HYPRE_Int hypre_AMSSetTol ( void *solver , HYPRE_Real tol ); -HYPRE_Int hypre_AMSSetCycleType ( void *solver , HYPRE_Int cycle_type ); -HYPRE_Int hypre_AMSSetPrintLevel ( void *solver , HYPRE_Int print_level ); -HYPRE_Int hypre_AMSSetSmoothingOptions ( void *solver , HYPRE_Int A_relax_type , HYPRE_Int A_relax_times , HYPRE_Real A_relax_weight , HYPRE_Real A_omega ); -HYPRE_Int hypre_AMSSetChebySmoothingOptions ( void *solver , HYPRE_Int A_cheby_order , HYPRE_Int A_cheby_fraction ); -HYPRE_Int hypre_AMSSetAlphaAMGOptions ( void *solver , HYPRE_Int B_Pi_coarsen_type , HYPRE_Int B_Pi_agg_levels , HYPRE_Int B_Pi_relax_type , HYPRE_Real B_Pi_theta , HYPRE_Int B_Pi_interp_type , HYPRE_Int B_Pi_Pmax ); -HYPRE_Int hypre_AMSSetAlphaAMGCoarseRelaxType ( void *solver , HYPRE_Int B_Pi_coarse_relax_type ); -HYPRE_Int hypre_AMSSetBetaAMGOptions ( void *solver , HYPRE_Int B_G_coarsen_type , HYPRE_Int B_G_agg_levels , HYPRE_Int B_G_relax_type , HYPRE_Real B_G_theta , HYPRE_Int B_G_interp_type , HYPRE_Int B_G_Pmax ); -HYPRE_Int hypre_AMSSetBetaAMGCoarseRelaxType ( void *solver , HYPRE_Int B_G_coarse_relax_type ); -HYPRE_Int hypre_AMSComputePi ( hypre_ParCSRMatrix *A , hypre_ParCSRMatrix *G , hypre_ParVector *Gx , hypre_ParVector *Gy , hypre_ParVector *Gz , HYPRE_Int dim , hypre_ParCSRMatrix **Pi_ptr ); -HYPRE_Int hypre_AMSComputePixyz ( hypre_ParCSRMatrix *A , hypre_ParCSRMatrix *G , hypre_ParVector *Gx , hypre_ParVector *Gy , hypre_ParVector *Gz , HYPRE_Int dim , hypre_ParCSRMatrix **Pix_ptr , hypre_ParCSRMatrix **Piy_ptr , hypre_ParCSRMatrix **Piz_ptr ); -HYPRE_Int hypre_AMSComputeGPi ( hypre_ParCSRMatrix *A , hypre_ParCSRMatrix *G , hypre_ParVector *Gx , hypre_ParVector *Gy , hypre_ParVector *Gz , HYPRE_Int dim , hypre_ParCSRMatrix **GPi_ptr ); -HYPRE_Int hypre_AMSSetup ( void *solver , hypre_ParCSRMatrix *A , hypre_ParVector *b , hypre_ParVector *x ); -HYPRE_Int hypre_AMSSolve ( void *solver , hypre_ParCSRMatrix *A , hypre_ParVector *b , hypre_ParVector *x ); -HYPRE_Int hypre_ParCSRSubspacePrec ( hypre_ParCSRMatrix *A0 , HYPRE_Int A0_relax_type , HYPRE_Int A0_relax_times , HYPRE_Real *A0_l1_norms , HYPRE_Real A0_relax_weight , HYPRE_Real A0_omega , HYPRE_Real A0_max_eig_est , HYPRE_Real A0_min_eig_est , HYPRE_Int A0_cheby_order , HYPRE_Real A0_cheby_fraction , hypre_ParCSRMatrix **A , HYPRE_Solver *B , HYPRE_PtrToSolverFcn *HB , hypre_ParCSRMatrix **P , hypre_ParVector **r , hypre_ParVector **g , hypre_ParVector *x , hypre_ParVector *y , hypre_ParVector *r0 , hypre_ParVector *g0 , char *cycle , hypre_ParVector *z ); -HYPRE_Int hypre_AMSGetNumIterations ( void *solver , HYPRE_Int *num_iterations ); -HYPRE_Int hypre_AMSGetFinalRelativeResidualNorm ( void *solver , HYPRE_Real *rel_resid_norm ); -HYPRE_Int hypre_AMSProjectOutGradients ( void *solver , hypre_ParVector *x ); -HYPRE_Int hypre_AMSConstructDiscreteGradient ( hypre_ParCSRMatrix *A , hypre_ParVector *x_coord , HYPRE_BigInt *edge_vertex , HYPRE_Int edge_orientation , hypre_ParCSRMatrix **G_ptr ); -HYPRE_Int hypre_AMSFEISetup ( void *solver , hypre_ParCSRMatrix *A , hypre_ParVector *b , hypre_ParVector *x , HYPRE_Int num_vert , HYPRE_Int num_local_vert , HYPRE_BigInt *vert_number , HYPRE_Real *vert_coord , HYPRE_Int num_edges , HYPRE_BigInt *edge_vertex ); +HYPRE_Int hypre_AMSSetDimension ( void *solver, HYPRE_Int dim ); +HYPRE_Int hypre_AMSSetDiscreteGradient ( void *solver, hypre_ParCSRMatrix *G ); +HYPRE_Int hypre_AMSSetCoordinateVectors ( void *solver, hypre_ParVector *x, hypre_ParVector *y, + hypre_ParVector *z ); +HYPRE_Int hypre_AMSSetEdgeConstantVectors ( void *solver, hypre_ParVector *Gx, hypre_ParVector *Gy, + hypre_ParVector *Gz ); +HYPRE_Int hypre_AMSSetInterpolations ( void *solver, hypre_ParCSRMatrix *Pi, + hypre_ParCSRMatrix *Pix, hypre_ParCSRMatrix *Piy, hypre_ParCSRMatrix *Piz ); +HYPRE_Int hypre_AMSSetAlphaPoissonMatrix ( void *solver, hypre_ParCSRMatrix *A_Pi ); +HYPRE_Int hypre_AMSSetBetaPoissonMatrix ( void *solver, hypre_ParCSRMatrix *A_G ); +HYPRE_Int hypre_AMSSetInteriorNodes ( void *solver, hypre_ParVector *interior_nodes ); +HYPRE_Int hypre_AMSSetProjectionFrequency ( void *solver, HYPRE_Int projection_frequency ); +HYPRE_Int hypre_AMSSetMaxIter ( void *solver, HYPRE_Int maxit ); +HYPRE_Int hypre_AMSSetTol ( void *solver, HYPRE_Real tol ); +HYPRE_Int hypre_AMSSetCycleType ( void *solver, HYPRE_Int cycle_type ); +HYPRE_Int hypre_AMSSetPrintLevel ( void *solver, HYPRE_Int print_level ); +HYPRE_Int hypre_AMSSetSmoothingOptions ( void *solver, HYPRE_Int A_relax_type, + HYPRE_Int A_relax_times, HYPRE_Real A_relax_weight, HYPRE_Real A_omega ); +HYPRE_Int hypre_AMSSetChebySmoothingOptions ( void *solver, HYPRE_Int A_cheby_order, + HYPRE_Real A_cheby_fraction ); +HYPRE_Int hypre_AMSSetAlphaAMGOptions ( void *solver, HYPRE_Int B_Pi_coarsen_type, + HYPRE_Int B_Pi_agg_levels, HYPRE_Int B_Pi_relax_type, HYPRE_Real B_Pi_theta, + HYPRE_Int B_Pi_interp_type, HYPRE_Int B_Pi_Pmax ); +HYPRE_Int hypre_AMSSetAlphaAMGCoarseRelaxType ( void *solver, HYPRE_Int B_Pi_coarse_relax_type ); +HYPRE_Int hypre_AMSSetBetaAMGOptions ( void *solver, HYPRE_Int B_G_coarsen_type, + HYPRE_Int B_G_agg_levels, HYPRE_Int B_G_relax_type, HYPRE_Real B_G_theta, HYPRE_Int B_G_interp_type, + HYPRE_Int B_G_Pmax ); +HYPRE_Int hypre_AMSSetBetaAMGCoarseRelaxType ( void *solver, HYPRE_Int B_G_coarse_relax_type ); +HYPRE_Int hypre_AMSComputePi ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *G, hypre_ParVector *Gx, + hypre_ParVector *Gy, hypre_ParVector *Gz, HYPRE_Int dim, hypre_ParCSRMatrix **Pi_ptr ); +HYPRE_Int hypre_AMSComputePixyz ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *G, hypre_ParVector *Gx, + hypre_ParVector *Gy, hypre_ParVector *Gz, HYPRE_Int dim, hypre_ParCSRMatrix **Pix_ptr, + hypre_ParCSRMatrix **Piy_ptr, hypre_ParCSRMatrix **Piz_ptr ); +HYPRE_Int hypre_AMSComputeGPi ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *G, hypre_ParVector *Gx, + hypre_ParVector *Gy, hypre_ParVector *Gz, HYPRE_Int dim, hypre_ParCSRMatrix **GPi_ptr ); +HYPRE_Int hypre_AMSSetup ( void *solver, hypre_ParCSRMatrix *A, hypre_ParVector *b, + hypre_ParVector *x ); +HYPRE_Int hypre_AMSSolve ( void *solver, hypre_ParCSRMatrix *A, hypre_ParVector *b, + hypre_ParVector *x ); +HYPRE_Int hypre_ParCSRSubspacePrec ( hypre_ParCSRMatrix *A0, HYPRE_Int A0_relax_type, + HYPRE_Int A0_relax_times, HYPRE_Real *A0_l1_norms, HYPRE_Real A0_relax_weight, HYPRE_Real A0_omega, + HYPRE_Real A0_max_eig_est, HYPRE_Real A0_min_eig_est, HYPRE_Int A0_cheby_order, + HYPRE_Real A0_cheby_fraction, hypre_ParCSRMatrix **A, HYPRE_Solver *B, HYPRE_PtrToSolverFcn *HB, + hypre_ParCSRMatrix **P, hypre_ParVector **r, hypre_ParVector **g, hypre_ParVector *x, + hypre_ParVector *y, hypre_ParVector *r0, hypre_ParVector *g0, char *cycle, hypre_ParVector *z ); +HYPRE_Int hypre_AMSGetNumIterations ( void *solver, HYPRE_Int *num_iterations ); +HYPRE_Int hypre_AMSGetFinalRelativeResidualNorm ( void *solver, HYPRE_Real *rel_resid_norm ); +HYPRE_Int hypre_AMSProjectOutGradients ( void *solver, hypre_ParVector *x ); +HYPRE_Int hypre_AMSConstructDiscreteGradient ( hypre_ParCSRMatrix *A, hypre_ParVector *x_coord, + HYPRE_BigInt *edge_vertex, HYPRE_Int edge_orientation, hypre_ParCSRMatrix **G_ptr ); +HYPRE_Int hypre_AMSFEISetup ( void *solver, hypre_ParCSRMatrix *A, hypre_ParVector *b, + hypre_ParVector *x, HYPRE_Int num_vert, HYPRE_Int num_local_vert, HYPRE_BigInt *vert_number, + HYPRE_Real *vert_coord, HYPRE_Int num_edges, HYPRE_BigInt *edge_vertex ); HYPRE_Int hypre_AMSFEIDestroy ( void *solver ); -HYPRE_Int hypre_ParCSRComputeL1NormsThreads ( hypre_ParCSRMatrix *A , HYPRE_Int option , HYPRE_Int num_threads , HYPRE_Int *cf_marker , HYPRE_Real **l1_norm_ptr ); +HYPRE_Int hypre_ParCSRComputeL1NormsThreads ( hypre_ParCSRMatrix *A, HYPRE_Int option, + HYPRE_Int num_threads, HYPRE_Int *cf_marker, HYPRE_Real **l1_norm_ptr ); /* aux_interp.c */ -HYPRE_Int hypre_alt_insert_new_nodes ( hypre_ParCSRCommPkg *comm_pkg , hypre_ParCSRCommPkg *extend_comm_pkg , HYPRE_Int *IN_marker , HYPRE_Int full_off_procNodes , HYPRE_Int *OUT_marker ); -HYPRE_Int hypre_big_insert_new_nodes ( hypre_ParCSRCommPkg *comm_pkg , hypre_ParCSRCommPkg *extend_comm_pkg , HYPRE_Int *IN_marker , HYPRE_Int full_off_procNodes , HYPRE_BigInt offset , HYPRE_BigInt *OUT_marker ); -HYPRE_Int hypre_ssort ( HYPRE_BigInt *data , HYPRE_Int n ); -HYPRE_Int hypre_index_of_minimum ( HYPRE_BigInt *data , HYPRE_Int n ); -void hypre_swap_int ( HYPRE_BigInt *data , HYPRE_Int a , HYPRE_Int b ); -void hypre_initialize_vecs ( HYPRE_Int diag_n , HYPRE_Int offd_n , HYPRE_Int *diag_ftc , HYPRE_BigInt *offd_ftc , HYPRE_Int *diag_pm , HYPRE_Int *offd_pm , HYPRE_Int *tmp_CF ); +HYPRE_Int hypre_alt_insert_new_nodes ( hypre_ParCSRCommPkg *comm_pkg, + hypre_ParCSRCommPkg *extend_comm_pkg, HYPRE_Int *IN_marker, HYPRE_Int full_off_procNodes, + HYPRE_Int *OUT_marker ); +HYPRE_Int hypre_big_insert_new_nodes ( hypre_ParCSRCommPkg *comm_pkg, + hypre_ParCSRCommPkg *extend_comm_pkg, HYPRE_Int *IN_marker, HYPRE_Int full_off_procNodes, + HYPRE_BigInt offset, HYPRE_BigInt *OUT_marker ); +HYPRE_Int hypre_ssort ( HYPRE_BigInt *data, HYPRE_Int n ); +HYPRE_Int hypre_index_of_minimum ( HYPRE_BigInt *data, HYPRE_Int n ); +void hypre_swap_int ( HYPRE_BigInt *data, HYPRE_Int a, HYPRE_Int b ); +void hypre_initialize_vecs ( HYPRE_Int diag_n, HYPRE_Int offd_n, HYPRE_Int *diag_ftc, + HYPRE_BigInt *offd_ftc, HYPRE_Int *diag_pm, HYPRE_Int *offd_pm, HYPRE_Int *tmp_CF ); /*HYPRE_Int hypre_new_offd_nodes(HYPRE_Int **found , HYPRE_Int num_cols_A_offd , HYPRE_Int *A_ext_i , HYPRE_Int *A_ext_j, HYPRE_Int num_cols_S_offd, HYPRE_Int *col_map_offd, HYPRE_Int col_1, HYPRE_Int col_n, HYPRE_Int *Sop_i, HYPRE_Int *Sop_j, HYPRE_Int *CF_marker_offd );*/ -HYPRE_Int hypre_exchange_marker(hypre_ParCSRCommPkg *comm_pkg, HYPRE_Int *IN_marker, HYPRE_Int *OUT_marker); -HYPRE_Int hypre_exchange_interp_data( HYPRE_Int **CF_marker_offd, HYPRE_Int **dof_func_offd, hypre_CSRMatrix **A_ext, HYPRE_Int *full_off_procNodes, hypre_CSRMatrix **Sop, hypre_ParCSRCommPkg **extend_comm_pkg, hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, hypre_ParCSRMatrix *S, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int skip_fine_or_same_sign); -void hypre_build_interp_colmap(hypre_ParCSRMatrix *P, HYPRE_Int full_off_procNodes, HYPRE_Int *tmp_CF_marker_offd, HYPRE_BigInt *fine_to_coarse_offd); +HYPRE_Int hypre_exchange_marker(hypre_ParCSRCommPkg *comm_pkg, HYPRE_Int *IN_marker, + HYPRE_Int *OUT_marker); +HYPRE_Int hypre_exchange_interp_data( HYPRE_Int **CF_marker_offd, HYPRE_Int **dof_func_offd, + hypre_CSRMatrix **A_ext, HYPRE_Int *full_off_procNodes, hypre_CSRMatrix **Sop, + hypre_ParCSRCommPkg **extend_comm_pkg, hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int skip_fine_or_same_sign); +void hypre_build_interp_colmap(hypre_ParCSRMatrix *P, HYPRE_Int full_off_procNodes, + HYPRE_Int *tmp_CF_marker_offd, HYPRE_BigInt *fine_to_coarse_offd); /* block_tridiag.c */ void *hypre_BlockTridiagCreate ( void ); HYPRE_Int hypre_BlockTridiagDestroy ( void *data ); -HYPRE_Int hypre_BlockTridiagSetup ( void *data , hypre_ParCSRMatrix *A , hypre_ParVector *b , hypre_ParVector *x ); -HYPRE_Int hypre_BlockTridiagSolve ( void *data , hypre_ParCSRMatrix *A , hypre_ParVector *b , hypre_ParVector *x ); -HYPRE_Int hypre_BlockTridiagSetIndexSet ( void *data , HYPRE_Int n , HYPRE_Int *inds ); -HYPRE_Int hypre_BlockTridiagSetAMGStrengthThreshold ( void *data , HYPRE_Real thresh ); -HYPRE_Int hypre_BlockTridiagSetAMGNumSweeps ( void *data , HYPRE_Int nsweeps ); -HYPRE_Int hypre_BlockTridiagSetAMGRelaxType ( void *data , HYPRE_Int relax_type ); -HYPRE_Int hypre_BlockTridiagSetPrintLevel ( void *data , HYPRE_Int print_level ); +HYPRE_Int hypre_BlockTridiagSetup ( void *data, hypre_ParCSRMatrix *A, hypre_ParVector *b, + hypre_ParVector *x ); +HYPRE_Int hypre_BlockTridiagSolve ( void *data, hypre_ParCSRMatrix *A, hypre_ParVector *b, + hypre_ParVector *x ); +HYPRE_Int hypre_BlockTridiagSetIndexSet ( void *data, HYPRE_Int n, HYPRE_Int *inds ); +HYPRE_Int hypre_BlockTridiagSetAMGStrengthThreshold ( void *data, HYPRE_Real thresh ); +HYPRE_Int hypre_BlockTridiagSetAMGNumSweeps ( void *data, HYPRE_Int nsweeps ); +HYPRE_Int hypre_BlockTridiagSetAMGRelaxType ( void *data, HYPRE_Int relax_type ); +HYPRE_Int hypre_BlockTridiagSetPrintLevel ( void *data, HYPRE_Int print_level ); /* driver.c */ -HYPRE_Int BuildParFromFile ( HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildParLaplacian ( HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildParDifConv ( HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildParFromOneFile ( HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildRhsParFromOneFile ( HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix A , HYPRE_ParVector *b_ptr ); -HYPRE_Int BuildParLaplacian9pt ( HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildParLaplacian27pt ( HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildParFromFile ( HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildParLaplacian ( HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildParDifConv ( HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildParFromOneFile ( HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildRhsParFromOneFile ( HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix A, HYPRE_ParVector *b_ptr ); +HYPRE_Int BuildParLaplacian9pt ( HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildParLaplacian27pt ( HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr ); /* gen_redcs_mat.c */ -HYPRE_Int hypre_seqAMGSetup ( hypre_ParAMGData *amg_data , HYPRE_Int p_level , HYPRE_Int coarse_threshold ); -HYPRE_Int hypre_seqAMGCycle ( hypre_ParAMGData *amg_data , HYPRE_Int p_level , hypre_ParVector **Par_F_array , hypre_ParVector **Par_U_array ); -HYPRE_Int hypre_GenerateSubComm ( MPI_Comm comm , HYPRE_Int participate , MPI_Comm *new_comm_ptr ); -void hypre_merge_lists ( HYPRE_Int *list1 , HYPRE_Int *list2 , hypre_int *np1 , hypre_MPI_Datatype *dptr ); +HYPRE_Int hypre_seqAMGSetup ( hypre_ParAMGData *amg_data, HYPRE_Int p_level, + HYPRE_Int coarse_threshold ); +HYPRE_Int hypre_seqAMGCycle ( hypre_ParAMGData *amg_data, HYPRE_Int p_level, + hypre_ParVector **Par_F_array, hypre_ParVector **Par_U_array ); +HYPRE_Int hypre_GenerateSubComm ( MPI_Comm comm, HYPRE_Int participate, MPI_Comm *new_comm_ptr ); +void hypre_merge_lists ( HYPRE_Int *list1, HYPRE_Int *list2, hypre_int *np1, + hypre_MPI_Datatype *dptr ); /* HYPRE_ads.c */ HYPRE_Int HYPRE_ADSCreate ( HYPRE_Solver *solver ); HYPRE_Int HYPRE_ADSDestroy ( HYPRE_Solver solver ); -HYPRE_Int HYPRE_ADSSetup ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ADSSolve ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ADSSetDiscreteCurl ( HYPRE_Solver solver , HYPRE_ParCSRMatrix C ); -HYPRE_Int HYPRE_ADSSetDiscreteGradient ( HYPRE_Solver solver , HYPRE_ParCSRMatrix G ); -HYPRE_Int HYPRE_ADSSetCoordinateVectors ( HYPRE_Solver solver , HYPRE_ParVector x , HYPRE_ParVector y , HYPRE_ParVector z ); -HYPRE_Int HYPRE_ADSSetInterpolations ( HYPRE_Solver solver , HYPRE_ParCSRMatrix RT_Pi , HYPRE_ParCSRMatrix RT_Pix , HYPRE_ParCSRMatrix RT_Piy , HYPRE_ParCSRMatrix RT_Piz , HYPRE_ParCSRMatrix ND_Pi , HYPRE_ParCSRMatrix ND_Pix , HYPRE_ParCSRMatrix ND_Piy , HYPRE_ParCSRMatrix ND_Piz ); -HYPRE_Int HYPRE_ADSSetMaxIter ( HYPRE_Solver solver , HYPRE_Int maxit ); -HYPRE_Int HYPRE_ADSSetTol ( HYPRE_Solver solver , HYPRE_Real tol ); -HYPRE_Int HYPRE_ADSSetCycleType ( HYPRE_Solver solver , HYPRE_Int cycle_type ); -HYPRE_Int HYPRE_ADSSetPrintLevel ( HYPRE_Solver solver , HYPRE_Int print_level ); -HYPRE_Int HYPRE_ADSSetSmoothingOptions ( HYPRE_Solver solver , HYPRE_Int relax_type , HYPRE_Int relax_times , HYPRE_Real relax_weight , HYPRE_Real omega ); -HYPRE_Int HYPRE_ADSSetChebySmoothingOptions ( HYPRE_Solver solver , HYPRE_Int cheby_order , HYPRE_Int cheby_fraction ); -HYPRE_Int HYPRE_ADSSetAMSOptions ( HYPRE_Solver solver , HYPRE_Int cycle_type , HYPRE_Int coarsen_type , HYPRE_Int agg_levels , HYPRE_Int relax_type , HYPRE_Real strength_threshold , HYPRE_Int interp_type , HYPRE_Int Pmax ); -HYPRE_Int HYPRE_ADSSetAMGOptions ( HYPRE_Solver solver , HYPRE_Int coarsen_type , HYPRE_Int agg_levels , HYPRE_Int relax_type , HYPRE_Real strength_threshold , HYPRE_Int interp_type , HYPRE_Int Pmax ); -HYPRE_Int HYPRE_ADSGetNumIterations ( HYPRE_Solver solver , HYPRE_Int *num_iterations ); -HYPRE_Int HYPRE_ADSGetFinalRelativeResidualNorm ( HYPRE_Solver solver , HYPRE_Real *rel_resid_norm ); +HYPRE_Int HYPRE_ADSSetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ADSSolve ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ADSSetDiscreteCurl ( HYPRE_Solver solver, HYPRE_ParCSRMatrix C ); +HYPRE_Int HYPRE_ADSSetDiscreteGradient ( HYPRE_Solver solver, HYPRE_ParCSRMatrix G ); +HYPRE_Int HYPRE_ADSSetCoordinateVectors ( HYPRE_Solver solver, HYPRE_ParVector x, HYPRE_ParVector y, + HYPRE_ParVector z ); +HYPRE_Int HYPRE_ADSSetInterpolations ( HYPRE_Solver solver, HYPRE_ParCSRMatrix RT_Pi, + HYPRE_ParCSRMatrix RT_Pix, HYPRE_ParCSRMatrix RT_Piy, HYPRE_ParCSRMatrix RT_Piz, + HYPRE_ParCSRMatrix ND_Pi, HYPRE_ParCSRMatrix ND_Pix, HYPRE_ParCSRMatrix ND_Piy, + HYPRE_ParCSRMatrix ND_Piz ); +HYPRE_Int HYPRE_ADSSetMaxIter ( HYPRE_Solver solver, HYPRE_Int maxit ); +HYPRE_Int HYPRE_ADSSetTol ( HYPRE_Solver solver, HYPRE_Real tol ); +HYPRE_Int HYPRE_ADSSetCycleType ( HYPRE_Solver solver, HYPRE_Int cycle_type ); +HYPRE_Int HYPRE_ADSSetPrintLevel ( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int HYPRE_ADSSetSmoothingOptions ( HYPRE_Solver solver, HYPRE_Int relax_type, + HYPRE_Int relax_times, HYPRE_Real relax_weight, HYPRE_Real omega ); +HYPRE_Int HYPRE_ADSSetChebySmoothingOptions ( HYPRE_Solver solver, HYPRE_Int cheby_order, + HYPRE_Real cheby_fraction ); +HYPRE_Int HYPRE_ADSSetAMSOptions ( HYPRE_Solver solver, HYPRE_Int cycle_type, + HYPRE_Int coarsen_type, HYPRE_Int agg_levels, HYPRE_Int relax_type, HYPRE_Real strength_threshold, + HYPRE_Int interp_type, HYPRE_Int Pmax ); +HYPRE_Int HYPRE_ADSSetAMGOptions ( HYPRE_Solver solver, HYPRE_Int coarsen_type, + HYPRE_Int agg_levels, HYPRE_Int relax_type, HYPRE_Real strength_threshold, HYPRE_Int interp_type, + HYPRE_Int Pmax ); +HYPRE_Int HYPRE_ADSGetNumIterations ( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int HYPRE_ADSGetFinalRelativeResidualNorm ( HYPRE_Solver solver, HYPRE_Real *rel_resid_norm ); /* HYPRE_ame.c */ HYPRE_Int HYPRE_AMECreate ( HYPRE_Solver *esolver ); HYPRE_Int HYPRE_AMEDestroy ( HYPRE_Solver esolver ); HYPRE_Int HYPRE_AMESetup ( HYPRE_Solver esolver ); HYPRE_Int HYPRE_AMESolve ( HYPRE_Solver esolver ); -HYPRE_Int HYPRE_AMESetAMSSolver ( HYPRE_Solver esolver , HYPRE_Solver ams_solver ); -HYPRE_Int HYPRE_AMESetMassMatrix ( HYPRE_Solver esolver , HYPRE_ParCSRMatrix M ); -HYPRE_Int HYPRE_AMESetBlockSize ( HYPRE_Solver esolver , HYPRE_Int block_size ); -HYPRE_Int HYPRE_AMESetMaxIter ( HYPRE_Solver esolver , HYPRE_Int maxit ); -HYPRE_Int HYPRE_AMESetTol ( HYPRE_Solver esolver , HYPRE_Real tol ); -HYPRE_Int HYPRE_AMESetRTol ( HYPRE_Solver esolver , HYPRE_Real tol ); -HYPRE_Int HYPRE_AMESetPrintLevel ( HYPRE_Solver esolver , HYPRE_Int print_level ); -HYPRE_Int HYPRE_AMEGetEigenvalues ( HYPRE_Solver esolver , HYPRE_Real **eigenvalues ); -HYPRE_Int HYPRE_AMEGetEigenvectors ( HYPRE_Solver esolver , HYPRE_ParVector **eigenvectors ); +HYPRE_Int HYPRE_AMESetAMSSolver ( HYPRE_Solver esolver, HYPRE_Solver ams_solver ); +HYPRE_Int HYPRE_AMESetMassMatrix ( HYPRE_Solver esolver, HYPRE_ParCSRMatrix M ); +HYPRE_Int HYPRE_AMESetBlockSize ( HYPRE_Solver esolver, HYPRE_Int block_size ); +HYPRE_Int HYPRE_AMESetMaxIter ( HYPRE_Solver esolver, HYPRE_Int maxit ); +HYPRE_Int HYPRE_AMESetMaxPCGIter ( HYPRE_Solver esolver, HYPRE_Int maxit ); +HYPRE_Int HYPRE_AMESetTol ( HYPRE_Solver esolver, HYPRE_Real tol ); +HYPRE_Int HYPRE_AMESetRTol ( HYPRE_Solver esolver, HYPRE_Real tol ); +HYPRE_Int HYPRE_AMESetPrintLevel ( HYPRE_Solver esolver, HYPRE_Int print_level ); +HYPRE_Int HYPRE_AMEGetEigenvalues ( HYPRE_Solver esolver, HYPRE_Real **eigenvalues ); +HYPRE_Int HYPRE_AMEGetEigenvectors ( HYPRE_Solver esolver, HYPRE_ParVector **eigenvectors ); /* HYPRE_ams.c */ HYPRE_Int HYPRE_AMSCreate ( HYPRE_Solver *solver ); HYPRE_Int HYPRE_AMSDestroy ( HYPRE_Solver solver ); -HYPRE_Int HYPRE_AMSSetup ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_AMSSolve ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_AMSSetDimension ( HYPRE_Solver solver , HYPRE_Int dim ); -HYPRE_Int HYPRE_AMSSetDiscreteGradient ( HYPRE_Solver solver , HYPRE_ParCSRMatrix G ); -HYPRE_Int HYPRE_AMSSetCoordinateVectors ( HYPRE_Solver solver , HYPRE_ParVector x , HYPRE_ParVector y , HYPRE_ParVector z ); -HYPRE_Int HYPRE_AMSSetEdgeConstantVectors ( HYPRE_Solver solver , HYPRE_ParVector Gx , HYPRE_ParVector Gy , HYPRE_ParVector Gz ); -HYPRE_Int HYPRE_AMSSetInterpolations ( HYPRE_Solver solver , HYPRE_ParCSRMatrix Pi , HYPRE_ParCSRMatrix Pix , HYPRE_ParCSRMatrix Piy , HYPRE_ParCSRMatrix Piz ); -HYPRE_Int HYPRE_AMSSetAlphaPoissonMatrix ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A_alpha ); -HYPRE_Int HYPRE_AMSSetBetaPoissonMatrix ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A_beta ); -HYPRE_Int HYPRE_AMSSetInteriorNodes ( HYPRE_Solver solver , HYPRE_ParVector interior_nodes ); -HYPRE_Int HYPRE_AMSSetProjectionFrequency ( HYPRE_Solver solver , HYPRE_Int projection_frequency ); -HYPRE_Int HYPRE_AMSSetMaxIter ( HYPRE_Solver solver , HYPRE_Int maxit ); -HYPRE_Int HYPRE_AMSSetTol ( HYPRE_Solver solver , HYPRE_Real tol ); -HYPRE_Int HYPRE_AMSSetCycleType ( HYPRE_Solver solver , HYPRE_Int cycle_type ); -HYPRE_Int HYPRE_AMSSetPrintLevel ( HYPRE_Solver solver , HYPRE_Int print_level ); -HYPRE_Int HYPRE_AMSSetSmoothingOptions ( HYPRE_Solver solver , HYPRE_Int relax_type , HYPRE_Int relax_times , HYPRE_Real relax_weight , HYPRE_Real omega ); -HYPRE_Int HYPRE_AMSSetChebySmoothingOptions ( HYPRE_Solver solver , HYPRE_Int cheby_order , HYPRE_Int cheby_fraction ); -HYPRE_Int HYPRE_AMSSetAlphaAMGOptions ( HYPRE_Solver solver , HYPRE_Int alpha_coarsen_type , HYPRE_Int alpha_agg_levels , HYPRE_Int alpha_relax_type , HYPRE_Real alpha_strength_threshold , HYPRE_Int alpha_interp_type , HYPRE_Int alpha_Pmax ); -HYPRE_Int HYPRE_AMSSetAlphaAMGCoarseRelaxType ( HYPRE_Solver solver , HYPRE_Int alpha_coarse_relax_type ); -HYPRE_Int HYPRE_AMSSetBetaAMGOptions ( HYPRE_Solver solver , HYPRE_Int beta_coarsen_type , HYPRE_Int beta_agg_levels , HYPRE_Int beta_relax_type , HYPRE_Real beta_strength_threshold , HYPRE_Int beta_interp_type , HYPRE_Int beta_Pmax ); -HYPRE_Int HYPRE_AMSSetBetaAMGCoarseRelaxType ( HYPRE_Solver solver , HYPRE_Int beta_coarse_relax_type ); -HYPRE_Int HYPRE_AMSGetNumIterations ( HYPRE_Solver solver , HYPRE_Int *num_iterations ); -HYPRE_Int HYPRE_AMSGetFinalRelativeResidualNorm ( HYPRE_Solver solver , HYPRE_Real *rel_resid_norm ); -HYPRE_Int HYPRE_AMSProjectOutGradients ( HYPRE_Solver solver , HYPRE_ParVector x ); -HYPRE_Int HYPRE_AMSConstructDiscreteGradient ( HYPRE_ParCSRMatrix A , HYPRE_ParVector x_coord , HYPRE_BigInt *edge_vertex , HYPRE_Int edge_orientation , HYPRE_ParCSRMatrix *G ); -HYPRE_Int HYPRE_AMSFEISetup ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x , HYPRE_BigInt *EdgeNodeList_ , HYPRE_BigInt *NodeNumbers_ , HYPRE_Int numEdges_ , HYPRE_Int numLocalNodes_ , HYPRE_Int numNodes_ , HYPRE_Real *NodalCoord_ ); +HYPRE_Int HYPRE_AMSSetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_AMSSolve ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_AMSSetDimension ( HYPRE_Solver solver, HYPRE_Int dim ); +HYPRE_Int HYPRE_AMSSetDiscreteGradient ( HYPRE_Solver solver, HYPRE_ParCSRMatrix G ); +HYPRE_Int HYPRE_AMSSetCoordinateVectors ( HYPRE_Solver solver, HYPRE_ParVector x, HYPRE_ParVector y, + HYPRE_ParVector z ); +HYPRE_Int HYPRE_AMSSetEdgeConstantVectors ( HYPRE_Solver solver, HYPRE_ParVector Gx, + HYPRE_ParVector Gy, HYPRE_ParVector Gz ); +HYPRE_Int HYPRE_AMSSetInterpolations ( HYPRE_Solver solver, HYPRE_ParCSRMatrix Pi, + HYPRE_ParCSRMatrix Pix, HYPRE_ParCSRMatrix Piy, HYPRE_ParCSRMatrix Piz ); +HYPRE_Int HYPRE_AMSSetAlphaPoissonMatrix ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A_alpha ); +HYPRE_Int HYPRE_AMSSetBetaPoissonMatrix ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A_beta ); +HYPRE_Int HYPRE_AMSSetInteriorNodes ( HYPRE_Solver solver, HYPRE_ParVector interior_nodes ); +HYPRE_Int HYPRE_AMSSetProjectionFrequency ( HYPRE_Solver solver, HYPRE_Int projection_frequency ); +HYPRE_Int HYPRE_AMSSetMaxIter ( HYPRE_Solver solver, HYPRE_Int maxit ); +HYPRE_Int HYPRE_AMSSetTol ( HYPRE_Solver solver, HYPRE_Real tol ); +HYPRE_Int HYPRE_AMSSetCycleType ( HYPRE_Solver solver, HYPRE_Int cycle_type ); +HYPRE_Int HYPRE_AMSSetPrintLevel ( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int HYPRE_AMSSetSmoothingOptions ( HYPRE_Solver solver, HYPRE_Int relax_type, + HYPRE_Int relax_times, HYPRE_Real relax_weight, HYPRE_Real omega ); +HYPRE_Int HYPRE_AMSSetChebySmoothingOptions ( HYPRE_Solver solver, HYPRE_Int cheby_order, + HYPRE_Real cheby_fraction ); +HYPRE_Int HYPRE_AMSSetAlphaAMGOptions ( HYPRE_Solver solver, HYPRE_Int alpha_coarsen_type, + HYPRE_Int alpha_agg_levels, HYPRE_Int alpha_relax_type, HYPRE_Real alpha_strength_threshold, + HYPRE_Int alpha_interp_type, HYPRE_Int alpha_Pmax ); +HYPRE_Int HYPRE_AMSSetAlphaAMGCoarseRelaxType ( HYPRE_Solver solver, + HYPRE_Int alpha_coarse_relax_type ); +HYPRE_Int HYPRE_AMSSetBetaAMGOptions ( HYPRE_Solver solver, HYPRE_Int beta_coarsen_type, + HYPRE_Int beta_agg_levels, HYPRE_Int beta_relax_type, HYPRE_Real beta_strength_threshold, + HYPRE_Int beta_interp_type, HYPRE_Int beta_Pmax ); +HYPRE_Int HYPRE_AMSSetBetaAMGCoarseRelaxType ( HYPRE_Solver solver, + HYPRE_Int beta_coarse_relax_type ); +HYPRE_Int HYPRE_AMSGetNumIterations ( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int HYPRE_AMSGetFinalRelativeResidualNorm ( HYPRE_Solver solver, HYPRE_Real *rel_resid_norm ); +HYPRE_Int HYPRE_AMSProjectOutGradients ( HYPRE_Solver solver, HYPRE_ParVector x ); +HYPRE_Int HYPRE_AMSConstructDiscreteGradient ( HYPRE_ParCSRMatrix A, HYPRE_ParVector x_coord, + HYPRE_BigInt *edge_vertex, HYPRE_Int edge_orientation, HYPRE_ParCSRMatrix *G ); +HYPRE_Int HYPRE_AMSFEISetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x, HYPRE_BigInt *EdgeNodeList_, HYPRE_BigInt *NodeNumbers_, HYPRE_Int numEdges_, + HYPRE_Int numLocalNodes_, HYPRE_Int numNodes_, HYPRE_Real *NodalCoord_ ); HYPRE_Int HYPRE_AMSFEIDestroy ( HYPRE_Solver solver ); /* HYPRE_parcsr_amg.c */ HYPRE_Int HYPRE_BoomerAMGCreate ( HYPRE_Solver *solver ); HYPRE_Int HYPRE_BoomerAMGDestroy ( HYPRE_Solver solver ); -HYPRE_Int HYPRE_BoomerAMGSetup ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_BoomerAMGSolve ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_BoomerAMGSolveT ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_BoomerAMGSetRestriction ( HYPRE_Solver solver , HYPRE_Int restr_par ); -HYPRE_Int HYPRE_BoomerAMGSetIsTriangular ( HYPRE_Solver solver , HYPRE_Int is_triangular ); -HYPRE_Int HYPRE_BoomerAMGSetGMRESSwitchR ( HYPRE_Solver solver , HYPRE_Int gmres_switch ); -HYPRE_Int HYPRE_BoomerAMGSetMaxLevels ( HYPRE_Solver solver , HYPRE_Int max_levels ); -HYPRE_Int HYPRE_BoomerAMGGetMaxLevels ( HYPRE_Solver solver , HYPRE_Int *max_levels ); -HYPRE_Int HYPRE_BoomerAMGSetMaxCoarseSize ( HYPRE_Solver solver , HYPRE_Int max_coarse_size ); -HYPRE_Int HYPRE_BoomerAMGGetMaxCoarseSize ( HYPRE_Solver solver , HYPRE_Int *max_coarse_size ); -HYPRE_Int HYPRE_BoomerAMGSetMinCoarseSize ( HYPRE_Solver solver , HYPRE_Int min_coarse_size ); -HYPRE_Int HYPRE_BoomerAMGGetMinCoarseSize ( HYPRE_Solver solver , HYPRE_Int *min_coarse_size ); -HYPRE_Int HYPRE_BoomerAMGSetSeqThreshold ( HYPRE_Solver solver , HYPRE_Int seq_threshold ); -HYPRE_Int HYPRE_BoomerAMGGetSeqThreshold ( HYPRE_Solver solver , HYPRE_Int *seq_threshold ); -HYPRE_Int HYPRE_BoomerAMGSetRedundant ( HYPRE_Solver solver , HYPRE_Int redundant ); -HYPRE_Int HYPRE_BoomerAMGGetRedundant ( HYPRE_Solver solver , HYPRE_Int *redundant ); +HYPRE_Int HYPRE_BoomerAMGSetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_BoomerAMGSolve ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_BoomerAMGSolveT ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_BoomerAMGSetRestriction ( HYPRE_Solver solver, HYPRE_Int restr_par ); +HYPRE_Int HYPRE_BoomerAMGSetIsTriangular ( HYPRE_Solver solver, HYPRE_Int is_triangular ); +HYPRE_Int HYPRE_BoomerAMGSetGMRESSwitchR ( HYPRE_Solver solver, HYPRE_Int gmres_switch ); +HYPRE_Int HYPRE_BoomerAMGSetMaxLevels ( HYPRE_Solver solver, HYPRE_Int max_levels ); +HYPRE_Int HYPRE_BoomerAMGGetMaxLevels ( HYPRE_Solver solver, HYPRE_Int *max_levels ); +HYPRE_Int HYPRE_BoomerAMGSetMaxCoarseSize ( HYPRE_Solver solver, HYPRE_Int max_coarse_size ); +HYPRE_Int HYPRE_BoomerAMGGetMaxCoarseSize ( HYPRE_Solver solver, HYPRE_Int *max_coarse_size ); +HYPRE_Int HYPRE_BoomerAMGSetMinCoarseSize ( HYPRE_Solver solver, HYPRE_Int min_coarse_size ); +HYPRE_Int HYPRE_BoomerAMGGetMinCoarseSize ( HYPRE_Solver solver, HYPRE_Int *min_coarse_size ); +HYPRE_Int HYPRE_BoomerAMGSetSeqThreshold ( HYPRE_Solver solver, HYPRE_Int seq_threshold ); +HYPRE_Int HYPRE_BoomerAMGGetSeqThreshold ( HYPRE_Solver solver, HYPRE_Int *seq_threshold ); +HYPRE_Int HYPRE_BoomerAMGSetRedundant ( HYPRE_Solver solver, HYPRE_Int redundant ); +HYPRE_Int HYPRE_BoomerAMGGetRedundant ( HYPRE_Solver solver, HYPRE_Int *redundant ); HYPRE_Int HYPRE_BoomerAMGSetCoarsenCutFactor( HYPRE_Solver solver, HYPRE_Int coarsen_cut_factor ); HYPRE_Int HYPRE_BoomerAMGGetCoarsenCutFactor( HYPRE_Solver solver, HYPRE_Int *coarsen_cut_factor ); -HYPRE_Int HYPRE_BoomerAMGSetStrongThreshold ( HYPRE_Solver solver , HYPRE_Real strong_threshold ); -HYPRE_Int HYPRE_BoomerAMGGetStrongThreshold ( HYPRE_Solver solver , HYPRE_Real *strong_threshold ); -HYPRE_Int HYPRE_BoomerAMGSetStrongThresholdR ( HYPRE_Solver solver , HYPRE_Real strong_threshold ); -HYPRE_Int HYPRE_BoomerAMGGetStrongThresholdR ( HYPRE_Solver solver , HYPRE_Real *strong_threshold ); -HYPRE_Int HYPRE_BoomerAMGSetFilterThresholdR ( HYPRE_Solver solver , HYPRE_Real filter_threshold ); -HYPRE_Int HYPRE_BoomerAMGGetFilterThresholdR ( HYPRE_Solver solver , HYPRE_Real *filter_threshold ); -HYPRE_Int HYPRE_BoomerAMGSetGMRESSwitchR ( HYPRE_Solver solver , HYPRE_Int gmres_switch ); -HYPRE_Int HYPRE_BoomerAMGSetSabs ( HYPRE_Solver solver , HYPRE_Int Sabs ); -HYPRE_Int HYPRE_BoomerAMGSetMaxRowSum ( HYPRE_Solver solver , HYPRE_Real max_row_sum ); -HYPRE_Int HYPRE_BoomerAMGGetMaxRowSum ( HYPRE_Solver solver , HYPRE_Real *max_row_sum ); -HYPRE_Int HYPRE_BoomerAMGSetTruncFactor ( HYPRE_Solver solver , HYPRE_Real trunc_factor ); -HYPRE_Int HYPRE_BoomerAMGGetTruncFactor ( HYPRE_Solver solver , HYPRE_Real *trunc_factor ); -HYPRE_Int HYPRE_BoomerAMGSetPMaxElmts ( HYPRE_Solver solver , HYPRE_Int P_max_elmts ); -HYPRE_Int HYPRE_BoomerAMGGetPMaxElmts ( HYPRE_Solver solver , HYPRE_Int *P_max_elmts ); -HYPRE_Int HYPRE_BoomerAMGSetJacobiTruncThreshold ( HYPRE_Solver solver , HYPRE_Real jacobi_trunc_threshold ); -HYPRE_Int HYPRE_BoomerAMGGetJacobiTruncThreshold ( HYPRE_Solver solver , HYPRE_Real *jacobi_trunc_threshold ); -HYPRE_Int HYPRE_BoomerAMGSetPostInterpType ( HYPRE_Solver solver , HYPRE_Int post_interp_type ); -HYPRE_Int HYPRE_BoomerAMGGetPostInterpType ( HYPRE_Solver solver , HYPRE_Int *post_interp_type ); -HYPRE_Int HYPRE_BoomerAMGSetSCommPkgSwitch ( HYPRE_Solver solver , HYPRE_Real S_commpkg_switch ); -HYPRE_Int HYPRE_BoomerAMGSetInterpType ( HYPRE_Solver solver , HYPRE_Int interp_type ); -HYPRE_Int HYPRE_BoomerAMGSetSepWeight ( HYPRE_Solver solver , HYPRE_Int sep_weight ); -HYPRE_Int HYPRE_BoomerAMGSetMinIter ( HYPRE_Solver solver , HYPRE_Int min_iter ); -HYPRE_Int HYPRE_BoomerAMGSetMaxIter ( HYPRE_Solver solver , HYPRE_Int max_iter ); -HYPRE_Int HYPRE_BoomerAMGGetMaxIter ( HYPRE_Solver solver , HYPRE_Int *max_iter ); -HYPRE_Int HYPRE_BoomerAMGSetCoarsenType ( HYPRE_Solver solver , HYPRE_Int coarsen_type ); -HYPRE_Int HYPRE_BoomerAMGGetCoarsenType ( HYPRE_Solver solver , HYPRE_Int *coarsen_type ); -HYPRE_Int HYPRE_BoomerAMGSetMeasureType ( HYPRE_Solver solver , HYPRE_Int measure_type ); -HYPRE_Int HYPRE_BoomerAMGGetMeasureType ( HYPRE_Solver solver , HYPRE_Int *measure_type ); -HYPRE_Int HYPRE_BoomerAMGSetSetupType ( HYPRE_Solver solver , HYPRE_Int setup_type ); +HYPRE_Int HYPRE_BoomerAMGSetStrongThreshold ( HYPRE_Solver solver, HYPRE_Real strong_threshold ); +HYPRE_Int HYPRE_BoomerAMGGetStrongThreshold ( HYPRE_Solver solver, HYPRE_Real *strong_threshold ); +HYPRE_Int HYPRE_BoomerAMGSetStrongThresholdR ( HYPRE_Solver solver, HYPRE_Real strong_threshold ); +HYPRE_Int HYPRE_BoomerAMGGetStrongThresholdR ( HYPRE_Solver solver, HYPRE_Real *strong_threshold ); +HYPRE_Int HYPRE_BoomerAMGSetFilterThresholdR ( HYPRE_Solver solver, HYPRE_Real filter_threshold ); +HYPRE_Int HYPRE_BoomerAMGGetFilterThresholdR ( HYPRE_Solver solver, HYPRE_Real *filter_threshold ); +HYPRE_Int HYPRE_BoomerAMGSetGMRESSwitchR ( HYPRE_Solver solver, HYPRE_Int gmres_switch ); +HYPRE_Int HYPRE_BoomerAMGSetSabs ( HYPRE_Solver solver, HYPRE_Int Sabs ); +HYPRE_Int HYPRE_BoomerAMGSetMaxRowSum ( HYPRE_Solver solver, HYPRE_Real max_row_sum ); +HYPRE_Int HYPRE_BoomerAMGGetMaxRowSum ( HYPRE_Solver solver, HYPRE_Real *max_row_sum ); +HYPRE_Int HYPRE_BoomerAMGSetTruncFactor ( HYPRE_Solver solver, HYPRE_Real trunc_factor ); +HYPRE_Int HYPRE_BoomerAMGGetTruncFactor ( HYPRE_Solver solver, HYPRE_Real *trunc_factor ); +HYPRE_Int HYPRE_BoomerAMGSetPMaxElmts ( HYPRE_Solver solver, HYPRE_Int P_max_elmts ); +HYPRE_Int HYPRE_BoomerAMGGetPMaxElmts ( HYPRE_Solver solver, HYPRE_Int *P_max_elmts ); +HYPRE_Int HYPRE_BoomerAMGSetJacobiTruncThreshold ( HYPRE_Solver solver, + HYPRE_Real jacobi_trunc_threshold ); +HYPRE_Int HYPRE_BoomerAMGGetJacobiTruncThreshold ( HYPRE_Solver solver, + HYPRE_Real *jacobi_trunc_threshold ); +HYPRE_Int HYPRE_BoomerAMGSetPostInterpType ( HYPRE_Solver solver, HYPRE_Int post_interp_type ); +HYPRE_Int HYPRE_BoomerAMGGetPostInterpType ( HYPRE_Solver solver, HYPRE_Int *post_interp_type ); +HYPRE_Int HYPRE_BoomerAMGSetSCommPkgSwitch ( HYPRE_Solver solver, HYPRE_Real S_commpkg_switch ); +HYPRE_Int HYPRE_BoomerAMGSetInterpType ( HYPRE_Solver solver, HYPRE_Int interp_type ); +HYPRE_Int HYPRE_BoomerAMGSetSepWeight ( HYPRE_Solver solver, HYPRE_Int sep_weight ); +HYPRE_Int HYPRE_BoomerAMGSetMinIter ( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int HYPRE_BoomerAMGSetMaxIter ( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int HYPRE_BoomerAMGGetMaxIter ( HYPRE_Solver solver, HYPRE_Int *max_iter ); +HYPRE_Int HYPRE_BoomerAMGSetCoarsenType ( HYPRE_Solver solver, HYPRE_Int coarsen_type ); +HYPRE_Int HYPRE_BoomerAMGGetCoarsenType ( HYPRE_Solver solver, HYPRE_Int *coarsen_type ); +HYPRE_Int HYPRE_BoomerAMGSetMeasureType ( HYPRE_Solver solver, HYPRE_Int measure_type ); +HYPRE_Int HYPRE_BoomerAMGGetMeasureType ( HYPRE_Solver solver, HYPRE_Int *measure_type ); +HYPRE_Int HYPRE_BoomerAMGSetSetupType ( HYPRE_Solver solver, HYPRE_Int setup_type ); HYPRE_Int HYPRE_BoomerAMGSetOldDefault ( HYPRE_Solver solver ); -HYPRE_Int HYPRE_BoomerAMGSetFCycle ( HYPRE_Solver solver , HYPRE_Int fcycle ); -HYPRE_Int HYPRE_BoomerAMGGetFCycle ( HYPRE_Solver solver , HYPRE_Int *fcycle ); -HYPRE_Int HYPRE_BoomerAMGSetCycleType ( HYPRE_Solver solver , HYPRE_Int cycle_type ); -HYPRE_Int HYPRE_BoomerAMGGetCycleType ( HYPRE_Solver solver , HYPRE_Int *cycle_type ); -HYPRE_Int HYPRE_BoomerAMGSetConvergeType ( HYPRE_Solver solver , HYPRE_Int type ); -HYPRE_Int HYPRE_BoomerAMGGetConvergeType ( HYPRE_Solver solver , HYPRE_Int *type ); -HYPRE_Int HYPRE_BoomerAMGSetTol ( HYPRE_Solver solver , HYPRE_Real tol ); -HYPRE_Int HYPRE_BoomerAMGGetTol ( HYPRE_Solver solver , HYPRE_Real *tol ); -HYPRE_Int HYPRE_BoomerAMGSetNumGridSweeps ( HYPRE_Solver solver , HYPRE_Int *num_grid_sweeps ); -HYPRE_Int HYPRE_BoomerAMGSetNumSweeps ( HYPRE_Solver solver , HYPRE_Int num_sweeps ); -HYPRE_Int HYPRE_BoomerAMGSetCycleNumSweeps ( HYPRE_Solver solver , HYPRE_Int num_sweeps , HYPRE_Int k ); -HYPRE_Int HYPRE_BoomerAMGGetCycleNumSweeps ( HYPRE_Solver solver , HYPRE_Int *num_sweeps , HYPRE_Int k ); -HYPRE_Int HYPRE_BoomerAMGInitGridRelaxation ( HYPRE_Int **num_grid_sweeps_ptr , HYPRE_Int **grid_relax_type_ptr , HYPRE_Int ***grid_relax_points_ptr , HYPRE_Int coarsen_type , HYPRE_Real **relax_weights_ptr , HYPRE_Int max_levels ); -HYPRE_Int HYPRE_BoomerAMGSetGridRelaxType ( HYPRE_Solver solver , HYPRE_Int *grid_relax_type ); -HYPRE_Int HYPRE_BoomerAMGSetRelaxType ( HYPRE_Solver solver , HYPRE_Int relax_type ); -HYPRE_Int HYPRE_BoomerAMGSetCycleRelaxType ( HYPRE_Solver solver , HYPRE_Int relax_type , HYPRE_Int k ); -HYPRE_Int HYPRE_BoomerAMGGetCycleRelaxType ( HYPRE_Solver solver , HYPRE_Int *relax_type , HYPRE_Int k ); -HYPRE_Int HYPRE_BoomerAMGSetRelaxOrder ( HYPRE_Solver solver , HYPRE_Int relax_order ); -HYPRE_Int HYPRE_BoomerAMGSetGridRelaxPoints ( HYPRE_Solver solver , HYPRE_Int **grid_relax_points ); -HYPRE_Int HYPRE_BoomerAMGSetRelaxWeight ( HYPRE_Solver solver , HYPRE_Real *relax_weight ); -HYPRE_Int HYPRE_BoomerAMGSetRelaxWt ( HYPRE_Solver solver , HYPRE_Real relax_wt ); -HYPRE_Int HYPRE_BoomerAMGSetLevelRelaxWt ( HYPRE_Solver solver , HYPRE_Real relax_wt , HYPRE_Int level ); -HYPRE_Int HYPRE_BoomerAMGSetOmega ( HYPRE_Solver solver , HYPRE_Real *omega ); -HYPRE_Int HYPRE_BoomerAMGSetOuterWt ( HYPRE_Solver solver , HYPRE_Real outer_wt ); -HYPRE_Int HYPRE_BoomerAMGSetLevelOuterWt ( HYPRE_Solver solver , HYPRE_Real outer_wt , HYPRE_Int level ); -HYPRE_Int HYPRE_BoomerAMGSetSmoothType ( HYPRE_Solver solver , HYPRE_Int smooth_type ); -HYPRE_Int HYPRE_BoomerAMGGetSmoothType ( HYPRE_Solver solver , HYPRE_Int *smooth_type ); -HYPRE_Int HYPRE_BoomerAMGSetSmoothNumLevels ( HYPRE_Solver solver , HYPRE_Int smooth_num_levels ); -HYPRE_Int HYPRE_BoomerAMGGetSmoothNumLevels ( HYPRE_Solver solver , HYPRE_Int *smooth_num_levels ); -HYPRE_Int HYPRE_BoomerAMGSetSmoothNumSweeps ( HYPRE_Solver solver , HYPRE_Int smooth_num_sweeps ); -HYPRE_Int HYPRE_BoomerAMGGetSmoothNumSweeps ( HYPRE_Solver solver , HYPRE_Int *smooth_num_sweeps ); -HYPRE_Int HYPRE_BoomerAMGSetLogging ( HYPRE_Solver solver , HYPRE_Int logging ); -HYPRE_Int HYPRE_BoomerAMGGetLogging ( HYPRE_Solver solver , HYPRE_Int *logging ); -HYPRE_Int HYPRE_BoomerAMGSetPrintLevel ( HYPRE_Solver solver , HYPRE_Int print_level ); -HYPRE_Int HYPRE_BoomerAMGGetPrintLevel ( HYPRE_Solver solver , HYPRE_Int *print_level ); -HYPRE_Int HYPRE_BoomerAMGSetPrintFileName ( HYPRE_Solver solver , const char *print_file_name ); -HYPRE_Int HYPRE_BoomerAMGSetDebugFlag ( HYPRE_Solver solver , HYPRE_Int debug_flag ); -HYPRE_Int HYPRE_BoomerAMGGetDebugFlag ( HYPRE_Solver solver , HYPRE_Int *debug_flag ); -HYPRE_Int HYPRE_BoomerAMGGetNumIterations ( HYPRE_Solver solver , HYPRE_Int *num_iterations ); -HYPRE_Int HYPRE_BoomerAMGGetCumNumIterations ( HYPRE_Solver solver , HYPRE_Int *cum_num_iterations ); -HYPRE_Int HYPRE_BoomerAMGGetResidual ( HYPRE_Solver solver , HYPRE_ParVector *residual ); -HYPRE_Int HYPRE_BoomerAMGGetFinalRelativeResidualNorm ( HYPRE_Solver solver , HYPRE_Real *rel_resid_norm ); -HYPRE_Int HYPRE_BoomerAMGSetVariant ( HYPRE_Solver solver , HYPRE_Int variant ); -HYPRE_Int HYPRE_BoomerAMGGetVariant ( HYPRE_Solver solver , HYPRE_Int *variant ); -HYPRE_Int HYPRE_BoomerAMGSetOverlap ( HYPRE_Solver solver , HYPRE_Int overlap ); -HYPRE_Int HYPRE_BoomerAMGGetOverlap ( HYPRE_Solver solver , HYPRE_Int *overlap ); -HYPRE_Int HYPRE_BoomerAMGSetDomainType ( HYPRE_Solver solver , HYPRE_Int domain_type ); -HYPRE_Int HYPRE_BoomerAMGGetDomainType ( HYPRE_Solver solver , HYPRE_Int *domain_type ); -HYPRE_Int HYPRE_BoomerAMGSetSchwarzRlxWeight ( HYPRE_Solver solver , HYPRE_Real schwarz_rlx_weight ); -HYPRE_Int HYPRE_BoomerAMGGetSchwarzRlxWeight ( HYPRE_Solver solver , HYPRE_Real *schwarz_rlx_weight ); -HYPRE_Int HYPRE_BoomerAMGSetSchwarzUseNonSymm ( HYPRE_Solver solver , HYPRE_Int use_nonsymm ); -HYPRE_Int HYPRE_BoomerAMGSetSym ( HYPRE_Solver solver , HYPRE_Int sym ); -HYPRE_Int HYPRE_BoomerAMGSetLevel ( HYPRE_Solver solver , HYPRE_Int level ); -HYPRE_Int HYPRE_BoomerAMGSetThreshold ( HYPRE_Solver solver , HYPRE_Real threshold ); -HYPRE_Int HYPRE_BoomerAMGSetFilter ( HYPRE_Solver solver , HYPRE_Real filter ); -HYPRE_Int HYPRE_BoomerAMGSetDropTol ( HYPRE_Solver solver , HYPRE_Real drop_tol ); -HYPRE_Int HYPRE_BoomerAMGSetMaxNzPerRow ( HYPRE_Solver solver , HYPRE_Int max_nz_per_row ); -HYPRE_Int HYPRE_BoomerAMGSetEuclidFile ( HYPRE_Solver solver , char *euclidfile ); -HYPRE_Int HYPRE_BoomerAMGSetEuLevel ( HYPRE_Solver solver , HYPRE_Int eu_level ); -HYPRE_Int HYPRE_BoomerAMGSetEuSparseA ( HYPRE_Solver solver , HYPRE_Real eu_sparse_A ); -HYPRE_Int HYPRE_BoomerAMGSetEuBJ ( HYPRE_Solver solver , HYPRE_Int eu_bj ); +HYPRE_Int HYPRE_BoomerAMGSetFCycle ( HYPRE_Solver solver, HYPRE_Int fcycle ); +HYPRE_Int HYPRE_BoomerAMGGetFCycle ( HYPRE_Solver solver, HYPRE_Int *fcycle ); +HYPRE_Int HYPRE_BoomerAMGSetCycleType ( HYPRE_Solver solver, HYPRE_Int cycle_type ); +HYPRE_Int HYPRE_BoomerAMGGetCycleType ( HYPRE_Solver solver, HYPRE_Int *cycle_type ); +HYPRE_Int HYPRE_BoomerAMGSetConvergeType ( HYPRE_Solver solver, HYPRE_Int type ); +HYPRE_Int HYPRE_BoomerAMGGetConvergeType ( HYPRE_Solver solver, HYPRE_Int *type ); +HYPRE_Int HYPRE_BoomerAMGSetTol ( HYPRE_Solver solver, HYPRE_Real tol ); +HYPRE_Int HYPRE_BoomerAMGGetTol ( HYPRE_Solver solver, HYPRE_Real *tol ); +HYPRE_Int HYPRE_BoomerAMGSetNumGridSweeps ( HYPRE_Solver solver, HYPRE_Int *num_grid_sweeps ); +HYPRE_Int HYPRE_BoomerAMGSetNumSweeps ( HYPRE_Solver solver, HYPRE_Int num_sweeps ); +HYPRE_Int HYPRE_BoomerAMGSetCycleNumSweeps ( HYPRE_Solver solver, HYPRE_Int num_sweeps, + HYPRE_Int k ); +HYPRE_Int HYPRE_BoomerAMGGetCycleNumSweeps ( HYPRE_Solver solver, HYPRE_Int *num_sweeps, + HYPRE_Int k ); +HYPRE_Int HYPRE_BoomerAMGInitGridRelaxation ( HYPRE_Int **num_grid_sweeps_ptr, + HYPRE_Int **grid_relax_type_ptr, HYPRE_Int ***grid_relax_points_ptr, HYPRE_Int coarsen_type, + HYPRE_Real **relax_weights_ptr, HYPRE_Int max_levels ); +HYPRE_Int HYPRE_BoomerAMGSetGridRelaxType ( HYPRE_Solver solver, HYPRE_Int *grid_relax_type ); +HYPRE_Int HYPRE_BoomerAMGSetRelaxType ( HYPRE_Solver solver, HYPRE_Int relax_type ); +HYPRE_Int HYPRE_BoomerAMGSetCycleRelaxType ( HYPRE_Solver solver, HYPRE_Int relax_type, + HYPRE_Int k ); +HYPRE_Int HYPRE_BoomerAMGGetCycleRelaxType ( HYPRE_Solver solver, HYPRE_Int *relax_type, + HYPRE_Int k ); +HYPRE_Int HYPRE_BoomerAMGSetRelaxOrder ( HYPRE_Solver solver, HYPRE_Int relax_order ); +HYPRE_Int HYPRE_BoomerAMGSetGridRelaxPoints ( HYPRE_Solver solver, HYPRE_Int **grid_relax_points ); +HYPRE_Int HYPRE_BoomerAMGSetRelaxWeight ( HYPRE_Solver solver, HYPRE_Real *relax_weight ); +HYPRE_Int HYPRE_BoomerAMGSetRelaxWt ( HYPRE_Solver solver, HYPRE_Real relax_wt ); +HYPRE_Int HYPRE_BoomerAMGSetLevelRelaxWt ( HYPRE_Solver solver, HYPRE_Real relax_wt, + HYPRE_Int level ); +HYPRE_Int HYPRE_BoomerAMGSetOmega ( HYPRE_Solver solver, HYPRE_Real *omega ); +HYPRE_Int HYPRE_BoomerAMGSetOuterWt ( HYPRE_Solver solver, HYPRE_Real outer_wt ); +HYPRE_Int HYPRE_BoomerAMGSetLevelOuterWt ( HYPRE_Solver solver, HYPRE_Real outer_wt, + HYPRE_Int level ); +HYPRE_Int HYPRE_BoomerAMGSetSmoothType ( HYPRE_Solver solver, HYPRE_Int smooth_type ); +HYPRE_Int HYPRE_BoomerAMGGetSmoothType ( HYPRE_Solver solver, HYPRE_Int *smooth_type ); +HYPRE_Int HYPRE_BoomerAMGSetSmoothNumLevels ( HYPRE_Solver solver, HYPRE_Int smooth_num_levels ); +HYPRE_Int HYPRE_BoomerAMGGetSmoothNumLevels ( HYPRE_Solver solver, HYPRE_Int *smooth_num_levels ); +HYPRE_Int HYPRE_BoomerAMGSetSmoothNumSweeps ( HYPRE_Solver solver, HYPRE_Int smooth_num_sweeps ); +HYPRE_Int HYPRE_BoomerAMGGetSmoothNumSweeps ( HYPRE_Solver solver, HYPRE_Int *smooth_num_sweeps ); +HYPRE_Int HYPRE_BoomerAMGSetLogging ( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int HYPRE_BoomerAMGGetLogging ( HYPRE_Solver solver, HYPRE_Int *logging ); +HYPRE_Int HYPRE_BoomerAMGSetPrintLevel ( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int HYPRE_BoomerAMGGetPrintLevel ( HYPRE_Solver solver, HYPRE_Int *print_level ); +HYPRE_Int HYPRE_BoomerAMGSetPrintFileName ( HYPRE_Solver solver, const char *print_file_name ); +HYPRE_Int HYPRE_BoomerAMGSetDebugFlag ( HYPRE_Solver solver, HYPRE_Int debug_flag ); +HYPRE_Int HYPRE_BoomerAMGGetDebugFlag ( HYPRE_Solver solver, HYPRE_Int *debug_flag ); +HYPRE_Int HYPRE_BoomerAMGGetNumIterations ( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int HYPRE_BoomerAMGGetCumNumIterations ( HYPRE_Solver solver, HYPRE_Int *cum_num_iterations ); +HYPRE_Int HYPRE_BoomerAMGGetResidual ( HYPRE_Solver solver, HYPRE_ParVector *residual ); +HYPRE_Int HYPRE_BoomerAMGGetFinalRelativeResidualNorm ( HYPRE_Solver solver, + HYPRE_Real *rel_resid_norm ); +HYPRE_Int HYPRE_BoomerAMGSetVariant ( HYPRE_Solver solver, HYPRE_Int variant ); +HYPRE_Int HYPRE_BoomerAMGGetVariant ( HYPRE_Solver solver, HYPRE_Int *variant ); +HYPRE_Int HYPRE_BoomerAMGSetOverlap ( HYPRE_Solver solver, HYPRE_Int overlap ); +HYPRE_Int HYPRE_BoomerAMGGetOverlap ( HYPRE_Solver solver, HYPRE_Int *overlap ); +HYPRE_Int HYPRE_BoomerAMGSetDomainType ( HYPRE_Solver solver, HYPRE_Int domain_type ); +HYPRE_Int HYPRE_BoomerAMGGetDomainType ( HYPRE_Solver solver, HYPRE_Int *domain_type ); +HYPRE_Int HYPRE_BoomerAMGSetSchwarzRlxWeight ( HYPRE_Solver solver, HYPRE_Real schwarz_rlx_weight ); +HYPRE_Int HYPRE_BoomerAMGGetSchwarzRlxWeight ( HYPRE_Solver solver, + HYPRE_Real *schwarz_rlx_weight ); +HYPRE_Int HYPRE_BoomerAMGSetSchwarzUseNonSymm ( HYPRE_Solver solver, HYPRE_Int use_nonsymm ); +HYPRE_Int HYPRE_BoomerAMGSetSym ( HYPRE_Solver solver, HYPRE_Int sym ); +HYPRE_Int HYPRE_BoomerAMGSetLevel ( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int HYPRE_BoomerAMGSetThreshold ( HYPRE_Solver solver, HYPRE_Real threshold ); +HYPRE_Int HYPRE_BoomerAMGSetFilter ( HYPRE_Solver solver, HYPRE_Real filter ); +HYPRE_Int HYPRE_BoomerAMGSetDropTol ( HYPRE_Solver solver, HYPRE_Real drop_tol ); +HYPRE_Int HYPRE_BoomerAMGSetMaxNzPerRow ( HYPRE_Solver solver, HYPRE_Int max_nz_per_row ); +HYPRE_Int HYPRE_BoomerAMGSetEuclidFile ( HYPRE_Solver solver, char *euclidfile ); +HYPRE_Int HYPRE_BoomerAMGSetEuLevel ( HYPRE_Solver solver, HYPRE_Int eu_level ); +HYPRE_Int HYPRE_BoomerAMGSetEuSparseA ( HYPRE_Solver solver, HYPRE_Real eu_sparse_A ); +HYPRE_Int HYPRE_BoomerAMGSetEuBJ ( HYPRE_Solver solver, HYPRE_Int eu_bj ); HYPRE_Int HYPRE_BoomerAMGSetILUType( HYPRE_Solver solver, HYPRE_Int ilu_type); HYPRE_Int HYPRE_BoomerAMGSetILULevel( HYPRE_Solver solver, HYPRE_Int ilu_lfil); HYPRE_Int HYPRE_BoomerAMGSetILUMaxRowNnz( HYPRE_Solver solver, HYPRE_Int ilu_max_row_nnz); HYPRE_Int HYPRE_BoomerAMGSetILUMaxIter( HYPRE_Solver solver, HYPRE_Int ilu_max_iter); HYPRE_Int HYPRE_BoomerAMGSetILUDroptol( HYPRE_Solver solver, HYPRE_Real ilu_droptol); +HYPRE_Int HYPRE_BoomerAMGSetILUTriSolve( HYPRE_Solver solver, HYPRE_Int ilu_tri_solve); +HYPRE_Int HYPRE_BoomerAMGSetILULowerJacobiIters( HYPRE_Solver solver, + HYPRE_Int ilu_lower_jacobi_iters); +HYPRE_Int HYPRE_BoomerAMGSetILUUpperJacobiIters( HYPRE_Solver solver, + HYPRE_Int ilu_upper_jacobi_iters); HYPRE_Int HYPRE_BoomerAMGSetILULocalReordering( HYPRE_Solver solver, HYPRE_Int ilu_reordering_type); -HYPRE_Int HYPRE_BoomerAMGSetNumFunctions ( HYPRE_Solver solver , HYPRE_Int num_functions ); -HYPRE_Int HYPRE_BoomerAMGGetNumFunctions ( HYPRE_Solver solver , HYPRE_Int *num_functions ); -HYPRE_Int HYPRE_BoomerAMGSetNodal ( HYPRE_Solver solver , HYPRE_Int nodal ); -HYPRE_Int HYPRE_BoomerAMGSetNodalLevels ( HYPRE_Solver solver , HYPRE_Int nodal_levels ); -HYPRE_Int HYPRE_BoomerAMGSetNodalDiag ( HYPRE_Solver solver , HYPRE_Int nodal ); -HYPRE_Int HYPRE_BoomerAMGSetKeepSameSign ( HYPRE_Solver solver , HYPRE_Int keep_same_sign ); -HYPRE_Int HYPRE_BoomerAMGSetDofFunc ( HYPRE_Solver solver , HYPRE_Int *dof_func ); -HYPRE_Int HYPRE_BoomerAMGSetNumPaths ( HYPRE_Solver solver , HYPRE_Int num_paths ); -HYPRE_Int HYPRE_BoomerAMGSetAggNumLevels ( HYPRE_Solver solver , HYPRE_Int agg_num_levels ); -HYPRE_Int HYPRE_BoomerAMGSetAggInterpType ( HYPRE_Solver solver , HYPRE_Int agg_interp_type ); -HYPRE_Int HYPRE_BoomerAMGSetAggTruncFactor ( HYPRE_Solver solver , HYPRE_Real agg_trunc_factor ); -HYPRE_Int HYPRE_BoomerAMGSetAddTruncFactor ( HYPRE_Solver solver , HYPRE_Real add_trunc_factor ); -HYPRE_Int HYPRE_BoomerAMGSetMultAddTruncFactor ( HYPRE_Solver solver , HYPRE_Real add_trunc_factor ); -HYPRE_Int HYPRE_BoomerAMGSetAggP12TruncFactor ( HYPRE_Solver solver , HYPRE_Real agg_P12_trunc_factor ); -HYPRE_Int HYPRE_BoomerAMGSetAggPMaxElmts ( HYPRE_Solver solver , HYPRE_Int agg_P_max_elmts ); -HYPRE_Int HYPRE_BoomerAMGSetAddPMaxElmts ( HYPRE_Solver solver , HYPRE_Int add_P_max_elmts ); -HYPRE_Int HYPRE_BoomerAMGSetMultAddPMaxElmts ( HYPRE_Solver solver , HYPRE_Int add_P_max_elmts ); -HYPRE_Int HYPRE_BoomerAMGSetAddRelaxType ( HYPRE_Solver solver , HYPRE_Int add_rlx_type ); -HYPRE_Int HYPRE_BoomerAMGSetAddRelaxWt ( HYPRE_Solver solver , HYPRE_Real add_rlx_wt ); -HYPRE_Int HYPRE_BoomerAMGSetAggP12MaxElmts ( HYPRE_Solver solver , HYPRE_Int agg_P12_max_elmts ); -HYPRE_Int HYPRE_BoomerAMGSetNumCRRelaxSteps ( HYPRE_Solver solver , HYPRE_Int num_CR_relax_steps ); -HYPRE_Int HYPRE_BoomerAMGSetCRRate ( HYPRE_Solver solver , HYPRE_Real CR_rate ); -HYPRE_Int HYPRE_BoomerAMGSetCRStrongTh ( HYPRE_Solver solver , HYPRE_Real CR_strong_th ); +HYPRE_Int HYPRE_BoomerAMGSetFSAIAlgoType ( HYPRE_Solver solver, HYPRE_Int algo_type ); +HYPRE_Int HYPRE_BoomerAMGSetFSAILocalSolveType ( HYPRE_Solver solver, HYPRE_Int local_solve_type ); +HYPRE_Int HYPRE_BoomerAMGSetFSAIMaxSteps ( HYPRE_Solver solver, HYPRE_Int max_steps ); +HYPRE_Int HYPRE_BoomerAMGSetFSAIMaxStepSize ( HYPRE_Solver solver, HYPRE_Int max_step_size ); +HYPRE_Int HYPRE_BoomerAMGSetFSAIMaxNnzRow ( HYPRE_Solver solver, HYPRE_Int max_nnz_row ); +HYPRE_Int HYPRE_BoomerAMGSetFSAINumLevels ( HYPRE_Solver solver, HYPRE_Int num_levels ); +HYPRE_Int HYPRE_BoomerAMGSetFSAIEigMaxIters ( HYPRE_Solver solver, HYPRE_Int eig_max_iters ); +HYPRE_Int HYPRE_BoomerAMGSetFSAIThreshold ( HYPRE_Solver solver, HYPRE_Real threshold ); +HYPRE_Int HYPRE_BoomerAMGSetFSAIKapTolerance ( HYPRE_Solver solver, HYPRE_Real kap_tolerance ); +HYPRE_Int HYPRE_BoomerAMGSetNumFunctions ( HYPRE_Solver solver, HYPRE_Int num_functions ); +HYPRE_Int HYPRE_BoomerAMGGetNumFunctions ( HYPRE_Solver solver, HYPRE_Int *num_functions ); +HYPRE_Int HYPRE_BoomerAMGSetFilterFunctions ( HYPRE_Solver solver, HYPRE_Int filter_functions ); +HYPRE_Int HYPRE_BoomerAMGGetFilterFunctions ( HYPRE_Solver solver, HYPRE_Int *filter_functions ); +HYPRE_Int HYPRE_BoomerAMGSetNodal ( HYPRE_Solver solver, HYPRE_Int nodal ); +HYPRE_Int HYPRE_BoomerAMGSetNodalLevels ( HYPRE_Solver solver, HYPRE_Int nodal_levels ); +HYPRE_Int HYPRE_BoomerAMGSetNodalDiag ( HYPRE_Solver solver, HYPRE_Int nodal ); +HYPRE_Int HYPRE_BoomerAMGSetKeepSameSign ( HYPRE_Solver solver, HYPRE_Int keep_same_sign ); +HYPRE_Int HYPRE_BoomerAMGSetDofFunc ( HYPRE_Solver solver, HYPRE_Int *dof_func ); +HYPRE_Int HYPRE_BoomerAMGSetNumPaths ( HYPRE_Solver solver, HYPRE_Int num_paths ); +HYPRE_Int HYPRE_BoomerAMGSetAggNumLevels ( HYPRE_Solver solver, HYPRE_Int agg_num_levels ); +HYPRE_Int HYPRE_BoomerAMGSetAggInterpType ( HYPRE_Solver solver, HYPRE_Int agg_interp_type ); +HYPRE_Int HYPRE_BoomerAMGSetAggTruncFactor ( HYPRE_Solver solver, HYPRE_Real agg_trunc_factor ); +HYPRE_Int HYPRE_BoomerAMGSetAddTruncFactor ( HYPRE_Solver solver, HYPRE_Real add_trunc_factor ); +HYPRE_Int HYPRE_BoomerAMGSetMultAddTruncFactor ( HYPRE_Solver solver, HYPRE_Real add_trunc_factor ); +HYPRE_Int HYPRE_BoomerAMGSetAggP12TruncFactor ( HYPRE_Solver solver, + HYPRE_Real agg_P12_trunc_factor ); +HYPRE_Int HYPRE_BoomerAMGSetAggPMaxElmts ( HYPRE_Solver solver, HYPRE_Int agg_P_max_elmts ); +HYPRE_Int HYPRE_BoomerAMGSetAddPMaxElmts ( HYPRE_Solver solver, HYPRE_Int add_P_max_elmts ); +HYPRE_Int HYPRE_BoomerAMGSetMultAddPMaxElmts ( HYPRE_Solver solver, HYPRE_Int add_P_max_elmts ); +HYPRE_Int HYPRE_BoomerAMGSetAddRelaxType ( HYPRE_Solver solver, HYPRE_Int add_rlx_type ); +HYPRE_Int HYPRE_BoomerAMGSetAddRelaxWt ( HYPRE_Solver solver, HYPRE_Real add_rlx_wt ); +HYPRE_Int HYPRE_BoomerAMGSetAggP12MaxElmts ( HYPRE_Solver solver, HYPRE_Int agg_P12_max_elmts ); +HYPRE_Int HYPRE_BoomerAMGSetNumCRRelaxSteps ( HYPRE_Solver solver, HYPRE_Int num_CR_relax_steps ); +HYPRE_Int HYPRE_BoomerAMGSetCRRate ( HYPRE_Solver solver, HYPRE_Real CR_rate ); +HYPRE_Int HYPRE_BoomerAMGSetCRStrongTh ( HYPRE_Solver solver, HYPRE_Real CR_strong_th ); HYPRE_Int HYPRE_BoomerAMGSetADropTol( HYPRE_Solver solver, HYPRE_Real A_drop_tol ); HYPRE_Int HYPRE_BoomerAMGSetADropType( HYPRE_Solver solver, HYPRE_Int A_drop_type ); -HYPRE_Int HYPRE_BoomerAMGSetISType ( HYPRE_Solver solver , HYPRE_Int IS_type ); -HYPRE_Int HYPRE_BoomerAMGSetCRUseCG ( HYPRE_Solver solver , HYPRE_Int CR_use_CG ); -HYPRE_Int HYPRE_BoomerAMGSetGSMG ( HYPRE_Solver solver , HYPRE_Int gsmg ); -HYPRE_Int HYPRE_BoomerAMGSetNumSamples ( HYPRE_Solver solver , HYPRE_Int gsmg ); -HYPRE_Int HYPRE_BoomerAMGSetCGCIts ( HYPRE_Solver solver , HYPRE_Int its ); -HYPRE_Int HYPRE_BoomerAMGSetPlotGrids ( HYPRE_Solver solver , HYPRE_Int plotgrids ); -HYPRE_Int HYPRE_BoomerAMGSetPlotFileName ( HYPRE_Solver solver , const char *plotfilename ); -HYPRE_Int HYPRE_BoomerAMGSetCoordDim ( HYPRE_Solver solver , HYPRE_Int coorddim ); -HYPRE_Int HYPRE_BoomerAMGSetCoordinates ( HYPRE_Solver solver , float *coordinates ); +HYPRE_Int HYPRE_BoomerAMGSetISType ( HYPRE_Solver solver, HYPRE_Int IS_type ); +HYPRE_Int HYPRE_BoomerAMGSetCRUseCG ( HYPRE_Solver solver, HYPRE_Int CR_use_CG ); +HYPRE_Int HYPRE_BoomerAMGSetGSMG ( HYPRE_Solver solver, HYPRE_Int gsmg ); +HYPRE_Int HYPRE_BoomerAMGSetNumSamples ( HYPRE_Solver solver, HYPRE_Int gsmg ); +HYPRE_Int HYPRE_BoomerAMGSetCGCIts ( HYPRE_Solver solver, HYPRE_Int its ); +HYPRE_Int HYPRE_BoomerAMGSetPlotGrids ( HYPRE_Solver solver, HYPRE_Int plotgrids ); +HYPRE_Int HYPRE_BoomerAMGSetPlotFileName ( HYPRE_Solver solver, const char *plotfilename ); +HYPRE_Int HYPRE_BoomerAMGSetCoordDim ( HYPRE_Solver solver, HYPRE_Int coorddim ); +HYPRE_Int HYPRE_BoomerAMGSetCoordinates ( HYPRE_Solver solver, float *coordinates ); HYPRE_Int HYPRE_BoomerAMGGetGridHierarchy(HYPRE_Solver solver, HYPRE_Int *cgrid ); -HYPRE_Int HYPRE_BoomerAMGSetChebyOrder ( HYPRE_Solver solver , HYPRE_Int order ); -HYPRE_Int HYPRE_BoomerAMGSetChebyFraction ( HYPRE_Solver solver , HYPRE_Real ratio ); -HYPRE_Int HYPRE_BoomerAMGSetChebyEigEst ( HYPRE_Solver solver , HYPRE_Int eig_est ); -HYPRE_Int HYPRE_BoomerAMGSetChebyVariant ( HYPRE_Solver solver , HYPRE_Int variant ); -HYPRE_Int HYPRE_BoomerAMGSetChebyScale ( HYPRE_Solver solver , HYPRE_Int scale ); -HYPRE_Int HYPRE_BoomerAMGSetInterpVectors ( HYPRE_Solver solver , HYPRE_Int num_vectors , HYPRE_ParVector *vectors ); -HYPRE_Int HYPRE_BoomerAMGSetInterpVecVariant ( HYPRE_Solver solver , HYPRE_Int num ); -HYPRE_Int HYPRE_BoomerAMGSetInterpVecQMax ( HYPRE_Solver solver , HYPRE_Int q_max ); -HYPRE_Int HYPRE_BoomerAMGSetInterpVecAbsQTrunc ( HYPRE_Solver solver , HYPRE_Real q_trunc ); -HYPRE_Int HYPRE_BoomerAMGSetSmoothInterpVectors ( HYPRE_Solver solver , HYPRE_Int smooth_interp_vectors ); -HYPRE_Int HYPRE_BoomerAMGSetInterpRefine ( HYPRE_Solver solver , HYPRE_Int num_refine ); -HYPRE_Int HYPRE_BoomerAMGSetInterpVecFirstLevel ( HYPRE_Solver solver , HYPRE_Int level ); -HYPRE_Int HYPRE_BoomerAMGSetAdditive ( HYPRE_Solver solver , HYPRE_Int additive ); -HYPRE_Int HYPRE_BoomerAMGGetAdditive ( HYPRE_Solver solver , HYPRE_Int *additive ); -HYPRE_Int HYPRE_BoomerAMGSetMultAdditive ( HYPRE_Solver solver , HYPRE_Int mult_additive ); -HYPRE_Int HYPRE_BoomerAMGGetMultAdditive ( HYPRE_Solver solver , HYPRE_Int *mult_additive ); -HYPRE_Int HYPRE_BoomerAMGSetSimple ( HYPRE_Solver solver , HYPRE_Int simple ); -HYPRE_Int HYPRE_BoomerAMGGetSimple ( HYPRE_Solver solver , HYPRE_Int *simple ); -HYPRE_Int HYPRE_BoomerAMGSetAddLastLvl ( HYPRE_Solver solver , HYPRE_Int add_last_lvl ); -HYPRE_Int HYPRE_BoomerAMGSetNonGalerkinTol ( HYPRE_Solver solver , HYPRE_Real nongalerkin_tol ); -HYPRE_Int HYPRE_BoomerAMGSetLevelNonGalerkinTol ( HYPRE_Solver solver , HYPRE_Real nongalerkin_tol , HYPRE_Int level ); -HYPRE_Int HYPRE_BoomerAMGSetNonGalerkTol ( HYPRE_Solver solver , HYPRE_Int nongalerk_num_tol , HYPRE_Real *nongalerk_tol ); -HYPRE_Int HYPRE_BoomerAMGSetRAP2 ( HYPRE_Solver solver , HYPRE_Int rap2 ); -HYPRE_Int HYPRE_BoomerAMGSetModuleRAP2 ( HYPRE_Solver solver , HYPRE_Int mod_rap2 ); -HYPRE_Int HYPRE_BoomerAMGSetKeepTranspose ( HYPRE_Solver solver , HYPRE_Int keepTranspose ); +HYPRE_Int HYPRE_BoomerAMGSetChebyOrder ( HYPRE_Solver solver, HYPRE_Int order ); +HYPRE_Int HYPRE_BoomerAMGSetChebyFraction ( HYPRE_Solver solver, HYPRE_Real ratio ); +HYPRE_Int HYPRE_BoomerAMGSetChebyEigEst ( HYPRE_Solver solver, HYPRE_Int eig_est ); +HYPRE_Int HYPRE_BoomerAMGSetChebyVariant ( HYPRE_Solver solver, HYPRE_Int variant ); +HYPRE_Int HYPRE_BoomerAMGSetChebyScale ( HYPRE_Solver solver, HYPRE_Int scale ); +HYPRE_Int HYPRE_BoomerAMGSetInterpVectors ( HYPRE_Solver solver, HYPRE_Int num_vectors, + HYPRE_ParVector *vectors ); +HYPRE_Int HYPRE_BoomerAMGSetInterpVecVariant ( HYPRE_Solver solver, HYPRE_Int num ); +HYPRE_Int HYPRE_BoomerAMGSetInterpVecQMax ( HYPRE_Solver solver, HYPRE_Int q_max ); +HYPRE_Int HYPRE_BoomerAMGSetInterpVecAbsQTrunc ( HYPRE_Solver solver, HYPRE_Real q_trunc ); +HYPRE_Int HYPRE_BoomerAMGSetSmoothInterpVectors ( HYPRE_Solver solver, + HYPRE_Int smooth_interp_vectors ); +HYPRE_Int HYPRE_BoomerAMGSetInterpRefine ( HYPRE_Solver solver, HYPRE_Int num_refine ); +HYPRE_Int HYPRE_BoomerAMGSetInterpVecFirstLevel ( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int HYPRE_BoomerAMGSetAdditive ( HYPRE_Solver solver, HYPRE_Int additive ); +HYPRE_Int HYPRE_BoomerAMGGetAdditive ( HYPRE_Solver solver, HYPRE_Int *additive ); +HYPRE_Int HYPRE_BoomerAMGSetMultAdditive ( HYPRE_Solver solver, HYPRE_Int mult_additive ); +HYPRE_Int HYPRE_BoomerAMGGetMultAdditive ( HYPRE_Solver solver, HYPRE_Int *mult_additive ); +HYPRE_Int HYPRE_BoomerAMGSetSimple ( HYPRE_Solver solver, HYPRE_Int simple ); +HYPRE_Int HYPRE_BoomerAMGGetSimple ( HYPRE_Solver solver, HYPRE_Int *simple ); +HYPRE_Int HYPRE_BoomerAMGSetAddLastLvl ( HYPRE_Solver solver, HYPRE_Int add_last_lvl ); +HYPRE_Int HYPRE_BoomerAMGSetNonGalerkinTol ( HYPRE_Solver solver, HYPRE_Real nongalerkin_tol ); +HYPRE_Int HYPRE_BoomerAMGSetLevelNonGalerkinTol ( HYPRE_Solver solver, HYPRE_Real nongalerkin_tol, + HYPRE_Int level ); +HYPRE_Int HYPRE_BoomerAMGSetNonGalerkTol ( HYPRE_Solver solver, HYPRE_Int nongalerk_num_tol, + HYPRE_Real *nongalerk_tol ); +HYPRE_Int HYPRE_BoomerAMGSetRAP2 ( HYPRE_Solver solver, HYPRE_Int rap2 ); +HYPRE_Int HYPRE_BoomerAMGSetModuleRAP2 ( HYPRE_Solver solver, HYPRE_Int mod_rap2 ); +HYPRE_Int HYPRE_BoomerAMGSetKeepTranspose ( HYPRE_Solver solver, HYPRE_Int keepTranspose ); #ifdef HYPRE_USING_DSUPERLU -HYPRE_Int HYPRE_BoomerAMGSetDSLUThreshold ( HYPRE_Solver solver , HYPRE_Int slu_threshold ); +HYPRE_Int HYPRE_BoomerAMGSetDSLUThreshold ( HYPRE_Solver solver, HYPRE_Int slu_threshold ); #endif -HYPRE_Int HYPRE_BoomerAMGSetCpointsToKeep( HYPRE_Solver solver, HYPRE_Int cpt_coarse_level, HYPRE_Int num_cpt_coarse, HYPRE_BigInt *cpt_coarse_index); -HYPRE_Int HYPRE_BoomerAMGSetCPoints( HYPRE_Solver solver, HYPRE_Int cpt_coarse_level, HYPRE_Int num_cpt_coarse, HYPRE_BigInt *cpt_coarse_index); -HYPRE_Int HYPRE_BoomerAMGSetIsolatedFPoints( HYPRE_Solver solver, HYPRE_Int num_isolated_fpt, HYPRE_BigInt *isolated_fpt_index ); -HYPRE_Int HYPRE_BoomerAMGSetFPoints( HYPRE_Solver solver, HYPRE_Int num_fpt, HYPRE_BigInt *fpt_index ); +HYPRE_Int HYPRE_BoomerAMGSetCpointsToKeep( HYPRE_Solver solver, HYPRE_Int cpt_coarse_level, + HYPRE_Int num_cpt_coarse, HYPRE_BigInt *cpt_coarse_index); +HYPRE_Int HYPRE_BoomerAMGSetCPoints( HYPRE_Solver solver, HYPRE_Int cpt_coarse_level, + HYPRE_Int num_cpt_coarse, HYPRE_BigInt *cpt_coarse_index); +HYPRE_Int HYPRE_BoomerAMGSetIsolatedFPoints( HYPRE_Solver solver, HYPRE_Int num_isolated_fpt, + HYPRE_BigInt *isolated_fpt_index ); +HYPRE_Int HYPRE_BoomerAMGSetFPoints( HYPRE_Solver solver, HYPRE_Int num_fpt, + HYPRE_BigInt *fpt_index ); +HYPRE_Int HYPRE_BoomerAMGSetCumNnzAP ( HYPRE_Solver solver, HYPRE_Real cum_nnz_AP ); +HYPRE_Int HYPRE_BoomerAMGGetCumNnzAP ( HYPRE_Solver solver, HYPRE_Real *cum_nnz_AP ); /* HYPRE_parcsr_amgdd.c */ -HYPRE_Int HYPRE_BoomerAMGDDSetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); -HYPRE_Int HYPRE_BoomerAMGDDSolve ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); -HYPRE_Int HYPRE_BoomerAMGDDSetStartLevel ( HYPRE_Solver solver , HYPRE_Int start_level ); -HYPRE_Int HYPRE_BoomerAMGDDGetStartLevel ( HYPRE_Solver solver , HYPRE_Int *start_level ); -HYPRE_Int HYPRE_BoomerAMGDDSetFACNumCycles ( HYPRE_Solver solver , HYPRE_Int fac_num_cycles ); -HYPRE_Int HYPRE_BoomerAMGDDGetFACNumCycles ( HYPRE_Solver solver , HYPRE_Int *fac_num_cycles ); -HYPRE_Int HYPRE_BoomerAMGDDSetFACCycleType ( HYPRE_Solver solver , HYPRE_Int fac_cycle_type ); -HYPRE_Int HYPRE_BoomerAMGDDGetFACCycleType ( HYPRE_Solver solver , HYPRE_Int *fac_cycle_type ); -HYPRE_Int HYPRE_BoomerAMGDDSetFACNumRelax ( HYPRE_Solver solver , HYPRE_Int fac_num_relax ); -HYPRE_Int HYPRE_BoomerAMGDDGetFACNumRelax ( HYPRE_Solver solver , HYPRE_Int *fac_num_relax ); -HYPRE_Int HYPRE_BoomerAMGDDSetFACRelaxType ( HYPRE_Solver solver , HYPRE_Int fac_relax_type ); -HYPRE_Int HYPRE_BoomerAMGDDGetFACRelaxType ( HYPRE_Solver solver , HYPRE_Int *fac_relax_type ); -HYPRE_Int HYPRE_BoomerAMGDDSetFACRelaxWeight ( HYPRE_Solver solver , HYPRE_Real fac_relax_weight ); -HYPRE_Int HYPRE_BoomerAMGDDGetFACRelaxWeight ( HYPRE_Solver solver , HYPRE_Real *fac_relax_weight ); -HYPRE_Int HYPRE_BoomerAMGDDSetPadding ( HYPRE_Solver solver , HYPRE_Int padding ); -HYPRE_Int HYPRE_BoomerAMGDDGetPadding ( HYPRE_Solver solver , HYPRE_Int *padding ); -HYPRE_Int HYPRE_BoomerAMGDDSetNumGhostLayers ( HYPRE_Solver solver , HYPRE_Int num_ghost_layers ); -HYPRE_Int HYPRE_BoomerAMGDDGetNumGhostLayers ( HYPRE_Solver solver , HYPRE_Int *num_ghost_layers ); -HYPRE_Int HYPRE_BoomerAMGDDSetUserFACRelaxation( HYPRE_Solver solver, HYPRE_Int (*userFACRelaxation)( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ) ); -HYPRE_Int HYPRE_BoomerAMGDDGetAMG ( HYPRE_Solver solver , HYPRE_Solver *amg_solver ); +HYPRE_Int HYPRE_BoomerAMGDDSetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_BoomerAMGDDSolve ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_BoomerAMGDDSetStartLevel ( HYPRE_Solver solver, HYPRE_Int start_level ); +HYPRE_Int HYPRE_BoomerAMGDDGetStartLevel ( HYPRE_Solver solver, HYPRE_Int *start_level ); +HYPRE_Int HYPRE_BoomerAMGDDSetFACNumCycles ( HYPRE_Solver solver, HYPRE_Int fac_num_cycles ); +HYPRE_Int HYPRE_BoomerAMGDDGetFACNumCycles ( HYPRE_Solver solver, HYPRE_Int *fac_num_cycles ); +HYPRE_Int HYPRE_BoomerAMGDDSetFACCycleType ( HYPRE_Solver solver, HYPRE_Int fac_cycle_type ); +HYPRE_Int HYPRE_BoomerAMGDDGetFACCycleType ( HYPRE_Solver solver, HYPRE_Int *fac_cycle_type ); +HYPRE_Int HYPRE_BoomerAMGDDSetFACNumRelax ( HYPRE_Solver solver, HYPRE_Int fac_num_relax ); +HYPRE_Int HYPRE_BoomerAMGDDGetFACNumRelax ( HYPRE_Solver solver, HYPRE_Int *fac_num_relax ); +HYPRE_Int HYPRE_BoomerAMGDDSetFACRelaxType ( HYPRE_Solver solver, HYPRE_Int fac_relax_type ); +HYPRE_Int HYPRE_BoomerAMGDDGetFACRelaxType ( HYPRE_Solver solver, HYPRE_Int *fac_relax_type ); +HYPRE_Int HYPRE_BoomerAMGDDSetFACRelaxWeight ( HYPRE_Solver solver, HYPRE_Real fac_relax_weight ); +HYPRE_Int HYPRE_BoomerAMGDDGetFACRelaxWeight ( HYPRE_Solver solver, HYPRE_Real *fac_relax_weight ); +HYPRE_Int HYPRE_BoomerAMGDDSetPadding ( HYPRE_Solver solver, HYPRE_Int padding ); +HYPRE_Int HYPRE_BoomerAMGDDGetPadding ( HYPRE_Solver solver, HYPRE_Int *padding ); +HYPRE_Int HYPRE_BoomerAMGDDSetNumGhostLayers ( HYPRE_Solver solver, HYPRE_Int num_ghost_layers ); +HYPRE_Int HYPRE_BoomerAMGDDGetNumGhostLayers ( HYPRE_Solver solver, HYPRE_Int *num_ghost_layers ); +HYPRE_Int HYPRE_BoomerAMGDDSetUserFACRelaxation( HYPRE_Solver solver, + HYPRE_Int (*userFACRelaxation)( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ) ); +HYPRE_Int HYPRE_BoomerAMGDDGetAMG ( HYPRE_Solver solver, HYPRE_Solver *amg_solver ); /* HYPRE_parcsr_bicgstab.c */ -HYPRE_Int HYPRE_ParCSRBiCGSTABCreate ( MPI_Comm comm , HYPRE_Solver *solver ); +HYPRE_Int HYPRE_ParCSRBiCGSTABCreate ( MPI_Comm comm, HYPRE_Solver *solver ); HYPRE_Int HYPRE_ParCSRBiCGSTABDestroy ( HYPRE_Solver solver ); -HYPRE_Int HYPRE_ParCSRBiCGSTABSetup ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParCSRBiCGSTABSolve ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParCSRBiCGSTABSetTol ( HYPRE_Solver solver , HYPRE_Real tol ); -HYPRE_Int HYPRE_ParCSRBiCGSTABSetAbsoluteTol ( HYPRE_Solver solver , HYPRE_Real a_tol ); -HYPRE_Int HYPRE_ParCSRBiCGSTABSetMinIter ( HYPRE_Solver solver , HYPRE_Int min_iter ); -HYPRE_Int HYPRE_ParCSRBiCGSTABSetMaxIter ( HYPRE_Solver solver , HYPRE_Int max_iter ); -HYPRE_Int HYPRE_ParCSRBiCGSTABSetStopCrit ( HYPRE_Solver solver , HYPRE_Int stop_crit ); -HYPRE_Int HYPRE_ParCSRBiCGSTABSetPrecond ( HYPRE_Solver solver , HYPRE_PtrToParSolverFcn precond , HYPRE_PtrToParSolverFcn precond_setup , HYPRE_Solver precond_solver ); -HYPRE_Int HYPRE_ParCSRBiCGSTABGetPrecond ( HYPRE_Solver solver , HYPRE_Solver *precond_data_ptr ); -HYPRE_Int HYPRE_ParCSRBiCGSTABSetLogging ( HYPRE_Solver solver , HYPRE_Int logging ); -HYPRE_Int HYPRE_ParCSRBiCGSTABSetPrintLevel ( HYPRE_Solver solver , HYPRE_Int print_level ); -HYPRE_Int HYPRE_ParCSRBiCGSTABGetNumIterations ( HYPRE_Solver solver , HYPRE_Int *num_iterations ); -HYPRE_Int HYPRE_ParCSRBiCGSTABGetFinalRelativeResidualNorm ( HYPRE_Solver solver , HYPRE_Real *norm ); -HYPRE_Int HYPRE_ParCSRBiCGSTABGetResidual ( HYPRE_Solver solver , HYPRE_ParVector *residual ); +HYPRE_Int HYPRE_ParCSRBiCGSTABSetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParCSRBiCGSTABSolve ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParCSRBiCGSTABSetTol ( HYPRE_Solver solver, HYPRE_Real tol ); +HYPRE_Int HYPRE_ParCSRBiCGSTABSetAbsoluteTol ( HYPRE_Solver solver, HYPRE_Real a_tol ); +HYPRE_Int HYPRE_ParCSRBiCGSTABSetMinIter ( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int HYPRE_ParCSRBiCGSTABSetMaxIter ( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int HYPRE_ParCSRBiCGSTABSetStopCrit ( HYPRE_Solver solver, HYPRE_Int stop_crit ); +HYPRE_Int HYPRE_ParCSRBiCGSTABSetPrecond ( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, + HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int HYPRE_ParCSRBiCGSTABGetPrecond ( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int HYPRE_ParCSRBiCGSTABSetLogging ( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int HYPRE_ParCSRBiCGSTABSetPrintLevel ( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int HYPRE_ParCSRBiCGSTABGetNumIterations ( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int HYPRE_ParCSRBiCGSTABGetFinalRelativeResidualNorm ( HYPRE_Solver solver, + HYPRE_Real *norm ); +HYPRE_Int HYPRE_ParCSRBiCGSTABGetResidual ( HYPRE_Solver solver, HYPRE_ParVector *residual ); /* HYPRE_parcsr_block.c */ HYPRE_Int HYPRE_BlockTridiagCreate ( HYPRE_Solver *solver ); HYPRE_Int HYPRE_BlockTridiagDestroy ( HYPRE_Solver solver ); -HYPRE_Int HYPRE_BlockTridiagSetup ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_BlockTridiagSolve ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_BlockTridiagSetIndexSet ( HYPRE_Solver solver , HYPRE_Int n , HYPRE_Int *inds ); -HYPRE_Int HYPRE_BlockTridiagSetAMGStrengthThreshold ( HYPRE_Solver solver , HYPRE_Real thresh ); -HYPRE_Int HYPRE_BlockTridiagSetAMGNumSweeps ( HYPRE_Solver solver , HYPRE_Int num_sweeps ); -HYPRE_Int HYPRE_BlockTridiagSetAMGRelaxType ( HYPRE_Solver solver , HYPRE_Int relax_type ); -HYPRE_Int HYPRE_BlockTridiagSetPrintLevel ( HYPRE_Solver solver , HYPRE_Int print_level ); +HYPRE_Int HYPRE_BlockTridiagSetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_BlockTridiagSolve ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_BlockTridiagSetIndexSet ( HYPRE_Solver solver, HYPRE_Int n, HYPRE_Int *inds ); +HYPRE_Int HYPRE_BlockTridiagSetAMGStrengthThreshold ( HYPRE_Solver solver, HYPRE_Real thresh ); +HYPRE_Int HYPRE_BlockTridiagSetAMGNumSweeps ( HYPRE_Solver solver, HYPRE_Int num_sweeps ); +HYPRE_Int HYPRE_BlockTridiagSetAMGRelaxType ( HYPRE_Solver solver, HYPRE_Int relax_type ); +HYPRE_Int HYPRE_BlockTridiagSetPrintLevel ( HYPRE_Solver solver, HYPRE_Int print_level ); /* HYPRE_parcsr_cgnr.c */ -HYPRE_Int HYPRE_ParCSRCGNRCreate ( MPI_Comm comm , HYPRE_Solver *solver ); +HYPRE_Int HYPRE_ParCSRCGNRCreate ( MPI_Comm comm, HYPRE_Solver *solver ); HYPRE_Int HYPRE_ParCSRCGNRDestroy ( HYPRE_Solver solver ); -HYPRE_Int HYPRE_ParCSRCGNRSetup ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParCSRCGNRSolve ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParCSRCGNRSetTol ( HYPRE_Solver solver , HYPRE_Real tol ); -HYPRE_Int HYPRE_ParCSRCGNRSetMinIter ( HYPRE_Solver solver , HYPRE_Int min_iter ); -HYPRE_Int HYPRE_ParCSRCGNRSetMaxIter ( HYPRE_Solver solver , HYPRE_Int max_iter ); -HYPRE_Int HYPRE_ParCSRCGNRSetStopCrit ( HYPRE_Solver solver , HYPRE_Int stop_crit ); -HYPRE_Int HYPRE_ParCSRCGNRSetPrecond ( HYPRE_Solver solver , HYPRE_PtrToParSolverFcn precond , HYPRE_PtrToParSolverFcn precondT , HYPRE_PtrToParSolverFcn precond_setup , HYPRE_Solver precond_solver ); -HYPRE_Int HYPRE_ParCSRCGNRGetPrecond ( HYPRE_Solver solver , HYPRE_Solver *precond_data_ptr ); -HYPRE_Int HYPRE_ParCSRCGNRSetLogging ( HYPRE_Solver solver , HYPRE_Int logging ); -HYPRE_Int HYPRE_ParCSRCGNRGetNumIterations ( HYPRE_Solver solver , HYPRE_Int *num_iterations ); -HYPRE_Int HYPRE_ParCSRCGNRGetFinalRelativeResidualNorm ( HYPRE_Solver solver , HYPRE_Real *norm ); +HYPRE_Int HYPRE_ParCSRCGNRSetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParCSRCGNRSolve ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParCSRCGNRSetTol ( HYPRE_Solver solver, HYPRE_Real tol ); +HYPRE_Int HYPRE_ParCSRCGNRSetMinIter ( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int HYPRE_ParCSRCGNRSetMaxIter ( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int HYPRE_ParCSRCGNRSetStopCrit ( HYPRE_Solver solver, HYPRE_Int stop_crit ); +HYPRE_Int HYPRE_ParCSRCGNRSetPrecond ( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, + HYPRE_PtrToParSolverFcn precondT, HYPRE_PtrToParSolverFcn precond_setup, + HYPRE_Solver precond_solver ); +HYPRE_Int HYPRE_ParCSRCGNRGetPrecond ( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int HYPRE_ParCSRCGNRSetLogging ( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int HYPRE_ParCSRCGNRGetNumIterations ( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int HYPRE_ParCSRCGNRGetFinalRelativeResidualNorm ( HYPRE_Solver solver, HYPRE_Real *norm ); /* HYPRE_parcsr_Euclid.c */ -HYPRE_Int HYPRE_EuclidCreate ( MPI_Comm comm , HYPRE_Solver *solver ); +HYPRE_Int HYPRE_EuclidCreate ( MPI_Comm comm, HYPRE_Solver *solver ); HYPRE_Int HYPRE_EuclidDestroy ( HYPRE_Solver solver ); -HYPRE_Int HYPRE_EuclidSetup ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_EuclidSolve ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector bb , HYPRE_ParVector xx ); -HYPRE_Int HYPRE_EuclidSetParams ( HYPRE_Solver solver , HYPRE_Int argc , char *argv []); -HYPRE_Int HYPRE_EuclidSetParamsFromFile ( HYPRE_Solver solver , char *filename ); -HYPRE_Int HYPRE_EuclidSetLevel ( HYPRE_Solver solver , HYPRE_Int level ); -HYPRE_Int HYPRE_EuclidSetBJ ( HYPRE_Solver solver , HYPRE_Int bj ); -HYPRE_Int HYPRE_EuclidSetStats ( HYPRE_Solver solver , HYPRE_Int eu_stats ); -HYPRE_Int HYPRE_EuclidSetMem ( HYPRE_Solver solver , HYPRE_Int eu_mem ); -HYPRE_Int HYPRE_EuclidSetSparseA ( HYPRE_Solver solver , HYPRE_Real sparse_A ); -HYPRE_Int HYPRE_EuclidSetRowScale ( HYPRE_Solver solver , HYPRE_Int row_scale ); -HYPRE_Int HYPRE_EuclidSetILUT ( HYPRE_Solver solver , HYPRE_Real ilut ); +HYPRE_Int HYPRE_EuclidSetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_EuclidSolve ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector bb, + HYPRE_ParVector xx ); +HYPRE_Int HYPRE_EuclidSetParams ( HYPRE_Solver solver, HYPRE_Int argc, char *argv []); +HYPRE_Int HYPRE_EuclidSetParamsFromFile ( HYPRE_Solver solver, char *filename ); +HYPRE_Int HYPRE_EuclidSetLevel ( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int HYPRE_EuclidSetBJ ( HYPRE_Solver solver, HYPRE_Int bj ); +HYPRE_Int HYPRE_EuclidSetStats ( HYPRE_Solver solver, HYPRE_Int eu_stats ); +HYPRE_Int HYPRE_EuclidSetMem ( HYPRE_Solver solver, HYPRE_Int eu_mem ); +HYPRE_Int HYPRE_EuclidSetSparseA ( HYPRE_Solver solver, HYPRE_Real sparse_A ); +HYPRE_Int HYPRE_EuclidSetRowScale ( HYPRE_Solver solver, HYPRE_Int row_scale ); +HYPRE_Int HYPRE_EuclidSetILUT ( HYPRE_Solver solver, HYPRE_Real ilut ); /* HYPRE_parcsr_flexgmres.c */ -HYPRE_Int HYPRE_ParCSRFlexGMRESCreate ( MPI_Comm comm , HYPRE_Solver *solver ); +HYPRE_Int HYPRE_ParCSRFlexGMRESCreate ( MPI_Comm comm, HYPRE_Solver *solver ); HYPRE_Int HYPRE_ParCSRFlexGMRESDestroy ( HYPRE_Solver solver ); -HYPRE_Int HYPRE_ParCSRFlexGMRESSetup ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParCSRFlexGMRESSolve ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParCSRFlexGMRESSetKDim ( HYPRE_Solver solver , HYPRE_Int k_dim ); -HYPRE_Int HYPRE_ParCSRFlexGMRESSetTol ( HYPRE_Solver solver , HYPRE_Real tol ); -HYPRE_Int HYPRE_ParCSRFlexGMRESSetAbsoluteTol ( HYPRE_Solver solver , HYPRE_Real a_tol ); -HYPRE_Int HYPRE_ParCSRFlexGMRESSetMinIter ( HYPRE_Solver solver , HYPRE_Int min_iter ); -HYPRE_Int HYPRE_ParCSRFlexGMRESSetMaxIter ( HYPRE_Solver solver , HYPRE_Int max_iter ); -HYPRE_Int HYPRE_ParCSRFlexGMRESSetPrecond ( HYPRE_Solver solver , HYPRE_PtrToParSolverFcn precond , HYPRE_PtrToParSolverFcn precond_setup , HYPRE_Solver precond_solver ); -HYPRE_Int HYPRE_ParCSRFlexGMRESGetPrecond ( HYPRE_Solver solver , HYPRE_Solver *precond_data_ptr ); -HYPRE_Int HYPRE_ParCSRFlexGMRESSetLogging ( HYPRE_Solver solver , HYPRE_Int logging ); -HYPRE_Int HYPRE_ParCSRFlexGMRESSetPrintLevel ( HYPRE_Solver solver , HYPRE_Int print_level ); -HYPRE_Int HYPRE_ParCSRFlexGMRESGetNumIterations ( HYPRE_Solver solver , HYPRE_Int *num_iterations ); -HYPRE_Int HYPRE_ParCSRFlexGMRESGetFinalRelativeResidualNorm ( HYPRE_Solver solver , HYPRE_Real *norm ); -HYPRE_Int HYPRE_ParCSRFlexGMRESGetResidual ( HYPRE_Solver solver , HYPRE_ParVector *residual ); -HYPRE_Int HYPRE_ParCSRFlexGMRESSetModifyPC ( HYPRE_Solver solver , HYPRE_PtrToModifyPCFcn modify_pc ); +HYPRE_Int HYPRE_ParCSRFlexGMRESSetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParCSRFlexGMRESSolve ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParCSRFlexGMRESSetKDim ( HYPRE_Solver solver, HYPRE_Int k_dim ); +HYPRE_Int HYPRE_ParCSRFlexGMRESSetTol ( HYPRE_Solver solver, HYPRE_Real tol ); +HYPRE_Int HYPRE_ParCSRFlexGMRESSetAbsoluteTol ( HYPRE_Solver solver, HYPRE_Real a_tol ); +HYPRE_Int HYPRE_ParCSRFlexGMRESSetMinIter ( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int HYPRE_ParCSRFlexGMRESSetMaxIter ( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int HYPRE_ParCSRFlexGMRESSetPrecond ( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, + HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int HYPRE_ParCSRFlexGMRESGetPrecond ( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int HYPRE_ParCSRFlexGMRESSetLogging ( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int HYPRE_ParCSRFlexGMRESSetPrintLevel ( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int HYPRE_ParCSRFlexGMRESGetNumIterations ( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int HYPRE_ParCSRFlexGMRESGetFinalRelativeResidualNorm ( HYPRE_Solver solver, + HYPRE_Real *norm ); +HYPRE_Int HYPRE_ParCSRFlexGMRESGetResidual ( HYPRE_Solver solver, HYPRE_ParVector *residual ); +HYPRE_Int HYPRE_ParCSRFlexGMRESSetModifyPC ( HYPRE_Solver solver, + HYPRE_PtrToModifyPCFcn modify_pc ); /* HYPRE_parcsr_gmres.c */ -HYPRE_Int HYPRE_ParCSRGMRESCreate ( MPI_Comm comm , HYPRE_Solver *solver ); +HYPRE_Int HYPRE_ParCSRGMRESCreate ( MPI_Comm comm, HYPRE_Solver *solver ); HYPRE_Int HYPRE_ParCSRGMRESDestroy ( HYPRE_Solver solver ); -HYPRE_Int HYPRE_ParCSRGMRESSetup ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParCSRGMRESSolve ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParCSRGMRESSetKDim ( HYPRE_Solver solver , HYPRE_Int k_dim ); -HYPRE_Int HYPRE_ParCSRGMRESSetTol ( HYPRE_Solver solver , HYPRE_Real tol ); -HYPRE_Int HYPRE_ParCSRGMRESSetAbsoluteTol ( HYPRE_Solver solver , HYPRE_Real a_tol ); -HYPRE_Int HYPRE_ParCSRGMRESSetMinIter ( HYPRE_Solver solver , HYPRE_Int min_iter ); -HYPRE_Int HYPRE_ParCSRGMRESSetMaxIter ( HYPRE_Solver solver , HYPRE_Int max_iter ); -HYPRE_Int HYPRE_ParCSRGMRESSetStopCrit ( HYPRE_Solver solver , HYPRE_Int stop_crit ); -HYPRE_Int HYPRE_ParCSRGMRESSetPrecond ( HYPRE_Solver solver , HYPRE_PtrToParSolverFcn precond , HYPRE_PtrToParSolverFcn precond_setup , HYPRE_Solver precond_solver ); -HYPRE_Int HYPRE_ParCSRGMRESGetPrecond ( HYPRE_Solver solver , HYPRE_Solver *precond_data_ptr ); -HYPRE_Int HYPRE_ParCSRGMRESSetLogging ( HYPRE_Solver solver , HYPRE_Int logging ); -HYPRE_Int HYPRE_ParCSRGMRESSetPrintLevel ( HYPRE_Solver solver , HYPRE_Int print_level ); -HYPRE_Int HYPRE_ParCSRGMRESGetNumIterations ( HYPRE_Solver solver , HYPRE_Int *num_iterations ); -HYPRE_Int HYPRE_ParCSRGMRESGetFinalRelativeResidualNorm ( HYPRE_Solver solver , HYPRE_Real *norm ); -HYPRE_Int HYPRE_ParCSRGMRESGetResidual ( HYPRE_Solver solver , HYPRE_ParVector *residual ); +HYPRE_Int HYPRE_ParCSRGMRESSetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParCSRGMRESSolve ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParCSRGMRESSetKDim ( HYPRE_Solver solver, HYPRE_Int k_dim ); +HYPRE_Int HYPRE_ParCSRGMRESSetTol ( HYPRE_Solver solver, HYPRE_Real tol ); +HYPRE_Int HYPRE_ParCSRGMRESSetAbsoluteTol ( HYPRE_Solver solver, HYPRE_Real a_tol ); +HYPRE_Int HYPRE_ParCSRGMRESSetMinIter ( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int HYPRE_ParCSRGMRESSetMaxIter ( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int HYPRE_ParCSRGMRESSetStopCrit ( HYPRE_Solver solver, HYPRE_Int stop_crit ); +HYPRE_Int HYPRE_ParCSRGMRESSetPrecond ( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, + HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int HYPRE_ParCSRGMRESGetPrecond ( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int HYPRE_ParCSRGMRESSetLogging ( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int HYPRE_ParCSRGMRESSetPrintLevel ( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int HYPRE_ParCSRGMRESGetNumIterations ( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int HYPRE_ParCSRGMRESGetFinalRelativeResidualNorm ( HYPRE_Solver solver, HYPRE_Real *norm ); +HYPRE_Int HYPRE_ParCSRGMRESGetResidual ( HYPRE_Solver solver, HYPRE_ParVector *residual ); /*HYPRE_parcsr_cogmres.c*/ -HYPRE_Int HYPRE_ParCSRCOGMRESCreate ( MPI_Comm comm , HYPRE_Solver *solver ); +HYPRE_Int HYPRE_ParCSRCOGMRESCreate ( MPI_Comm comm, HYPRE_Solver *solver ); HYPRE_Int HYPRE_ParCSRCOGMRESDestroy ( HYPRE_Solver solver ); -HYPRE_Int HYPRE_ParCSRCOGMRESSetup ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParCSRCOGMRESSolve ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParCSRCOGMRESSetKDim ( HYPRE_Solver solver , HYPRE_Int k_dim ); -HYPRE_Int HYPRE_ParCSRCOGMRESSetCGS2 ( HYPRE_Solver solver , HYPRE_Int cgs2 ); -HYPRE_Int HYPRE_ParCSRCOGMRESSetTol ( HYPRE_Solver solver , HYPRE_Real tol ); -HYPRE_Int HYPRE_ParCSRCOGMRESSetAbsoluteTol ( HYPRE_Solver solver , HYPRE_Real a_tol ); -HYPRE_Int HYPRE_ParCSRCOGMRESSetMinIter ( HYPRE_Solver solver , HYPRE_Int min_iter ); -HYPRE_Int HYPRE_ParCSRCOGMRESSetMaxIter ( HYPRE_Solver solver , HYPRE_Int max_iter ); -HYPRE_Int HYPRE_ParCSRCOGMRESSetPrecond ( HYPRE_Solver solver , HYPRE_PtrToParSolverFcn precond , HYPRE_PtrToParSolverFcn precond_setup , HYPRE_Solver precond_solver ); -HYPRE_Int HYPRE_ParCSRCOGMRESGetPrecond ( HYPRE_Solver solver , HYPRE_Solver *precond_data_ptr ); -HYPRE_Int HYPRE_ParCSRCOGMRESSetLogging ( HYPRE_Solver solver , HYPRE_Int logging ); -HYPRE_Int HYPRE_ParCSRCOGMRESSetPrintLevel ( HYPRE_Solver solver , HYPRE_Int print_level ); -HYPRE_Int HYPRE_ParCSRCOGMRESGetNumIterations ( HYPRE_Solver solver , HYPRE_Int *num_iterations ); -HYPRE_Int HYPRE_ParCSRCOGMRESGetFinalRelativeResidualNorm ( HYPRE_Solver solver , HYPRE_Real *norm ); -HYPRE_Int HYPRE_ParCSRCOGMRESGetResidual ( HYPRE_Solver solver , HYPRE_ParVector *residual ); +HYPRE_Int HYPRE_ParCSRCOGMRESSetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParCSRCOGMRESSolve ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParCSRCOGMRESSetKDim ( HYPRE_Solver solver, HYPRE_Int k_dim ); +HYPRE_Int HYPRE_ParCSRCOGMRESSetCGS2 ( HYPRE_Solver solver, HYPRE_Int cgs2 ); +HYPRE_Int HYPRE_ParCSRCOGMRESSetTol ( HYPRE_Solver solver, HYPRE_Real tol ); +HYPRE_Int HYPRE_ParCSRCOGMRESSetAbsoluteTol ( HYPRE_Solver solver, HYPRE_Real a_tol ); +HYPRE_Int HYPRE_ParCSRCOGMRESSetMinIter ( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int HYPRE_ParCSRCOGMRESSetMaxIter ( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int HYPRE_ParCSRCOGMRESSetPrecond ( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, + HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int HYPRE_ParCSRCOGMRESGetPrecond ( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int HYPRE_ParCSRCOGMRESSetLogging ( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int HYPRE_ParCSRCOGMRESSetPrintLevel ( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int HYPRE_ParCSRCOGMRESGetNumIterations ( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int HYPRE_ParCSRCOGMRESGetFinalRelativeResidualNorm ( HYPRE_Solver solver, HYPRE_Real *norm ); +HYPRE_Int HYPRE_ParCSRCOGMRESGetResidual ( HYPRE_Solver solver, HYPRE_ParVector *residual ); /* HYPRE_parcsr_hybrid.c */ HYPRE_Int HYPRE_ParCSRHybridCreate ( HYPRE_Solver *solver ); HYPRE_Int HYPRE_ParCSRHybridDestroy ( HYPRE_Solver solver ); -HYPRE_Int HYPRE_ParCSRHybridSetup ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParCSRHybridSolve ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParCSRHybridSetTol ( HYPRE_Solver solver , HYPRE_Real tol ); -HYPRE_Int HYPRE_ParCSRHybridSetAbsoluteTol ( HYPRE_Solver solver , HYPRE_Real tol ); -HYPRE_Int HYPRE_ParCSRHybridSetConvergenceTol ( HYPRE_Solver solver , HYPRE_Real cf_tol ); -HYPRE_Int HYPRE_ParCSRHybridSetDSCGMaxIter ( HYPRE_Solver solver , HYPRE_Int dscg_max_its ); -HYPRE_Int HYPRE_ParCSRHybridSetPCGMaxIter ( HYPRE_Solver solver , HYPRE_Int pcg_max_its ); -HYPRE_Int HYPRE_ParCSRHybridSetSetupType ( HYPRE_Solver solver , HYPRE_Int setup_type ); -HYPRE_Int HYPRE_ParCSRHybridSetSolverType ( HYPRE_Solver solver , HYPRE_Int solver_type ); -HYPRE_Int HYPRE_ParCSRHybridSetKDim ( HYPRE_Solver solver , HYPRE_Int k_dim ); -HYPRE_Int HYPRE_ParCSRHybridSetTwoNorm ( HYPRE_Solver solver , HYPRE_Int two_norm ); -HYPRE_Int HYPRE_ParCSRHybridSetStopCrit ( HYPRE_Solver solver , HYPRE_Int stop_crit ); -HYPRE_Int HYPRE_ParCSRHybridSetRelChange ( HYPRE_Solver solver , HYPRE_Int rel_change ); -HYPRE_Int HYPRE_ParCSRHybridSetPrecond ( HYPRE_Solver solver , HYPRE_PtrToParSolverFcn precond , HYPRE_PtrToParSolverFcn precond_setup , HYPRE_Solver precond_solver ); -HYPRE_Int HYPRE_ParCSRHybridSetLogging ( HYPRE_Solver solver , HYPRE_Int logging ); -HYPRE_Int HYPRE_ParCSRHybridSetPrintLevel ( HYPRE_Solver solver , HYPRE_Int print_level ); -HYPRE_Int HYPRE_ParCSRHybridSetStrongThreshold ( HYPRE_Solver solver , HYPRE_Real strong_threshold ); -HYPRE_Int HYPRE_ParCSRHybridSetMaxRowSum ( HYPRE_Solver solver , HYPRE_Real max_row_sum ); -HYPRE_Int HYPRE_ParCSRHybridSetTruncFactor ( HYPRE_Solver solver , HYPRE_Real trunc_factor ); -HYPRE_Int HYPRE_ParCSRHybridSetPMaxElmts ( HYPRE_Solver solver , HYPRE_Int p_max ); -HYPRE_Int HYPRE_ParCSRHybridSetMaxLevels ( HYPRE_Solver solver , HYPRE_Int max_levels ); -HYPRE_Int HYPRE_ParCSRHybridSetMeasureType ( HYPRE_Solver solver , HYPRE_Int measure_type ); -HYPRE_Int HYPRE_ParCSRHybridSetCoarsenType ( HYPRE_Solver solver , HYPRE_Int coarsen_type ); -HYPRE_Int HYPRE_ParCSRHybridSetInterpType ( HYPRE_Solver solver , HYPRE_Int interp_type ); -HYPRE_Int HYPRE_ParCSRHybridSetCycleType ( HYPRE_Solver solver , HYPRE_Int cycle_type ); -HYPRE_Int HYPRE_ParCSRHybridSetNumGridSweeps ( HYPRE_Solver solver , HYPRE_Int *num_grid_sweeps ); -HYPRE_Int HYPRE_ParCSRHybridSetGridRelaxType ( HYPRE_Solver solver , HYPRE_Int *grid_relax_type ); -HYPRE_Int HYPRE_ParCSRHybridSetGridRelaxPoints ( HYPRE_Solver solver , HYPRE_Int **grid_relax_points ); -HYPRE_Int HYPRE_ParCSRHybridSetNumSweeps ( HYPRE_Solver solver , HYPRE_Int num_sweeps ); -HYPRE_Int HYPRE_ParCSRHybridSetCycleNumSweeps ( HYPRE_Solver solver , HYPRE_Int num_sweeps , HYPRE_Int k ); -HYPRE_Int HYPRE_ParCSRHybridSetRelaxType ( HYPRE_Solver solver , HYPRE_Int relax_type ); -HYPRE_Int HYPRE_ParCSRHybridSetKeepTranspose ( HYPRE_Solver solver , HYPRE_Int keepT ); -HYPRE_Int HYPRE_ParCSRHybridSetCycleRelaxType ( HYPRE_Solver solver , HYPRE_Int relax_type , HYPRE_Int k ); -HYPRE_Int HYPRE_ParCSRHybridSetRelaxOrder ( HYPRE_Solver solver , HYPRE_Int relax_order ); -HYPRE_Int HYPRE_ParCSRHybridSetMaxCoarseSize ( HYPRE_Solver solver , HYPRE_Int max_coarse_size ); -HYPRE_Int HYPRE_ParCSRHybridSetMinCoarseSize ( HYPRE_Solver solver , HYPRE_Int min_coarse_size ); -HYPRE_Int HYPRE_ParCSRHybridSetSeqThreshold ( HYPRE_Solver solver , HYPRE_Int seq_threshold ); -HYPRE_Int HYPRE_ParCSRHybridSetRelaxWt ( HYPRE_Solver solver , HYPRE_Real relax_wt ); -HYPRE_Int HYPRE_ParCSRHybridSetLevelRelaxWt ( HYPRE_Solver solver , HYPRE_Real relax_wt , HYPRE_Int level ); -HYPRE_Int HYPRE_ParCSRHybridSetOuterWt ( HYPRE_Solver solver , HYPRE_Real outer_wt ); -HYPRE_Int HYPRE_ParCSRHybridSetLevelOuterWt ( HYPRE_Solver solver , HYPRE_Real outer_wt , HYPRE_Int level ); -HYPRE_Int HYPRE_ParCSRHybridSetRelaxWeight ( HYPRE_Solver solver , HYPRE_Real *relax_weight ); -HYPRE_Int HYPRE_ParCSRHybridSetOmega ( HYPRE_Solver solver , HYPRE_Real *omega ); -HYPRE_Int HYPRE_ParCSRHybridSetAggNumLevels ( HYPRE_Solver solver , HYPRE_Int agg_num_levels ); -HYPRE_Int HYPRE_ParCSRHybridSetNumPaths ( HYPRE_Solver solver , HYPRE_Int num_paths ); -HYPRE_Int HYPRE_ParCSRHybridSetNumFunctions ( HYPRE_Solver solver , HYPRE_Int num_functions ); -HYPRE_Int HYPRE_ParCSRHybridSetNodal ( HYPRE_Solver solver , HYPRE_Int nodal ); -HYPRE_Int HYPRE_ParCSRHybridSetDofFunc ( HYPRE_Solver solver , HYPRE_Int *dof_func ); -HYPRE_Int HYPRE_ParCSRHybridSetNonGalerkinTol ( HYPRE_Solver solver , HYPRE_Int nongalerk_num_tol, HYPRE_Real *nongalerkin_tol ); -HYPRE_Int HYPRE_ParCSRHybridGetNumIterations ( HYPRE_Solver solver , HYPRE_Int *num_its ); -HYPRE_Int HYPRE_ParCSRHybridGetDSCGNumIterations ( HYPRE_Solver solver , HYPRE_Int *dscg_num_its ); -HYPRE_Int HYPRE_ParCSRHybridGetPCGNumIterations ( HYPRE_Solver solver , HYPRE_Int *pcg_num_its ); -HYPRE_Int HYPRE_ParCSRHybridGetFinalRelativeResidualNorm ( HYPRE_Solver solver , HYPRE_Real *norm ); +HYPRE_Int HYPRE_ParCSRHybridSetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParCSRHybridSolve ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParCSRHybridSetTol ( HYPRE_Solver solver, HYPRE_Real tol ); +HYPRE_Int HYPRE_ParCSRHybridSetAbsoluteTol ( HYPRE_Solver solver, HYPRE_Real tol ); +HYPRE_Int HYPRE_ParCSRHybridSetConvergenceTol ( HYPRE_Solver solver, HYPRE_Real cf_tol ); +HYPRE_Int HYPRE_ParCSRHybridSetDSCGMaxIter ( HYPRE_Solver solver, HYPRE_Int dscg_max_its ); +HYPRE_Int HYPRE_ParCSRHybridSetPCGMaxIter ( HYPRE_Solver solver, HYPRE_Int pcg_max_its ); +HYPRE_Int HYPRE_ParCSRHybridSetSetupType ( HYPRE_Solver solver, HYPRE_Int setup_type ); +HYPRE_Int HYPRE_ParCSRHybridSetSolverType ( HYPRE_Solver solver, HYPRE_Int solver_type ); +HYPRE_Int HYPRE_ParCSRHybridSetKDim ( HYPRE_Solver solver, HYPRE_Int k_dim ); +HYPRE_Int HYPRE_ParCSRHybridSetTwoNorm ( HYPRE_Solver solver, HYPRE_Int two_norm ); +HYPRE_Int HYPRE_ParCSRHybridSetStopCrit ( HYPRE_Solver solver, HYPRE_Int stop_crit ); +HYPRE_Int HYPRE_ParCSRHybridSetRelChange ( HYPRE_Solver solver, HYPRE_Int rel_change ); +HYPRE_Int HYPRE_ParCSRHybridSetPrecond ( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, + HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int HYPRE_ParCSRHybridSetLogging ( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int HYPRE_ParCSRHybridSetPrintLevel ( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int HYPRE_ParCSRHybridSetStrongThreshold ( HYPRE_Solver solver, HYPRE_Real strong_threshold ); +HYPRE_Int HYPRE_ParCSRHybridSetMaxRowSum ( HYPRE_Solver solver, HYPRE_Real max_row_sum ); +HYPRE_Int HYPRE_ParCSRHybridSetTruncFactor ( HYPRE_Solver solver, HYPRE_Real trunc_factor ); +HYPRE_Int HYPRE_ParCSRHybridSetPMaxElmts ( HYPRE_Solver solver, HYPRE_Int p_max ); +HYPRE_Int HYPRE_ParCSRHybridSetMaxLevels ( HYPRE_Solver solver, HYPRE_Int max_levels ); +HYPRE_Int HYPRE_ParCSRHybridSetMeasureType ( HYPRE_Solver solver, HYPRE_Int measure_type ); +HYPRE_Int HYPRE_ParCSRHybridSetCoarsenType ( HYPRE_Solver solver, HYPRE_Int coarsen_type ); +HYPRE_Int HYPRE_ParCSRHybridSetInterpType ( HYPRE_Solver solver, HYPRE_Int interp_type ); +HYPRE_Int HYPRE_ParCSRHybridSetCycleType ( HYPRE_Solver solver, HYPRE_Int cycle_type ); +HYPRE_Int HYPRE_ParCSRHybridSetNumGridSweeps ( HYPRE_Solver solver, HYPRE_Int *num_grid_sweeps ); +HYPRE_Int HYPRE_ParCSRHybridSetGridRelaxType ( HYPRE_Solver solver, HYPRE_Int *grid_relax_type ); +HYPRE_Int HYPRE_ParCSRHybridSetGridRelaxPoints ( HYPRE_Solver solver, + HYPRE_Int **grid_relax_points ); +HYPRE_Int HYPRE_ParCSRHybridSetNumSweeps ( HYPRE_Solver solver, HYPRE_Int num_sweeps ); +HYPRE_Int HYPRE_ParCSRHybridSetCycleNumSweeps ( HYPRE_Solver solver, HYPRE_Int num_sweeps, + HYPRE_Int k ); +HYPRE_Int HYPRE_ParCSRHybridSetRelaxType ( HYPRE_Solver solver, HYPRE_Int relax_type ); +HYPRE_Int HYPRE_ParCSRHybridSetKeepTranspose ( HYPRE_Solver solver, HYPRE_Int keepT ); +HYPRE_Int HYPRE_ParCSRHybridSetCycleRelaxType ( HYPRE_Solver solver, HYPRE_Int relax_type, + HYPRE_Int k ); +HYPRE_Int HYPRE_ParCSRHybridSetRelaxOrder ( HYPRE_Solver solver, HYPRE_Int relax_order ); +HYPRE_Int HYPRE_ParCSRHybridSetMaxCoarseSize ( HYPRE_Solver solver, HYPRE_Int max_coarse_size ); +HYPRE_Int HYPRE_ParCSRHybridSetMinCoarseSize ( HYPRE_Solver solver, HYPRE_Int min_coarse_size ); +HYPRE_Int HYPRE_ParCSRHybridSetSeqThreshold ( HYPRE_Solver solver, HYPRE_Int seq_threshold ); +HYPRE_Int HYPRE_ParCSRHybridSetRelaxWt ( HYPRE_Solver solver, HYPRE_Real relax_wt ); +HYPRE_Int HYPRE_ParCSRHybridSetLevelRelaxWt ( HYPRE_Solver solver, HYPRE_Real relax_wt, + HYPRE_Int level ); +HYPRE_Int HYPRE_ParCSRHybridSetOuterWt ( HYPRE_Solver solver, HYPRE_Real outer_wt ); +HYPRE_Int HYPRE_ParCSRHybridSetLevelOuterWt ( HYPRE_Solver solver, HYPRE_Real outer_wt, + HYPRE_Int level ); +HYPRE_Int HYPRE_ParCSRHybridSetRelaxWeight ( HYPRE_Solver solver, HYPRE_Real *relax_weight ); +HYPRE_Int HYPRE_ParCSRHybridSetOmega ( HYPRE_Solver solver, HYPRE_Real *omega ); +HYPRE_Int HYPRE_ParCSRHybridSetAggNumLevels ( HYPRE_Solver solver, HYPRE_Int agg_num_levels ); +HYPRE_Int HYPRE_ParCSRHybridSetNumPaths ( HYPRE_Solver solver, HYPRE_Int num_paths ); +HYPRE_Int HYPRE_ParCSRHybridSetNumFunctions ( HYPRE_Solver solver, HYPRE_Int num_functions ); +HYPRE_Int HYPRE_ParCSRHybridSetNodal ( HYPRE_Solver solver, HYPRE_Int nodal ); +HYPRE_Int HYPRE_ParCSRHybridSetDofFunc ( HYPRE_Solver solver, HYPRE_Int *dof_func ); +HYPRE_Int HYPRE_ParCSRHybridSetNonGalerkinTol ( HYPRE_Solver solver, HYPRE_Int nongalerk_num_tol, + HYPRE_Real *nongalerkin_tol ); +HYPRE_Int HYPRE_ParCSRHybridGetNumIterations ( HYPRE_Solver solver, HYPRE_Int *num_its ); +HYPRE_Int HYPRE_ParCSRHybridGetDSCGNumIterations ( HYPRE_Solver solver, HYPRE_Int *dscg_num_its ); +HYPRE_Int HYPRE_ParCSRHybridGetPCGNumIterations ( HYPRE_Solver solver, HYPRE_Int *pcg_num_its ); +HYPRE_Int HYPRE_ParCSRHybridGetFinalRelativeResidualNorm ( HYPRE_Solver solver, HYPRE_Real *norm ); HYPRE_Int HYPRE_ParCSRHybridGetSetupSolveTime( HYPRE_Solver solver, HYPRE_Real *time ); /* HYPRE_parcsr_int.c */ -HYPRE_Int hypre_ParSetRandomValues ( void *v , HYPRE_Int seed ); -HYPRE_Int hypre_ParPrintVector ( void *v , const char *file ); -void *hypre_ParReadVector ( MPI_Comm comm , const char *file ); +HYPRE_Int hypre_ParSetRandomValues ( void *v, HYPRE_Int seed ); +HYPRE_Int hypre_ParPrintVector ( void *v, const char *file ); +void *hypre_ParReadVector ( MPI_Comm comm, const char *file ); HYPRE_Int hypre_ParVectorSize ( void *x ); -HYPRE_Int HYPRE_ParCSRMultiVectorPrint ( void *x_ , const char *fileName ); -void *HYPRE_ParCSRMultiVectorRead ( MPI_Comm comm , void *ii_ , const char *fileName ); -HYPRE_Int aux_maskCount ( HYPRE_Int n , HYPRE_Int *mask ); -void aux_indexFromMask ( HYPRE_Int n , HYPRE_Int *mask , HYPRE_Int *index ); +HYPRE_Int HYPRE_ParCSRMultiVectorPrint ( void *x_, const char *fileName ); +void *HYPRE_ParCSRMultiVectorRead ( MPI_Comm comm, void *ii_, const char *fileName ); +HYPRE_Int aux_maskCount ( HYPRE_Int n, HYPRE_Int *mask ); +void aux_indexFromMask ( HYPRE_Int n, HYPRE_Int *mask, HYPRE_Int *index ); HYPRE_Int HYPRE_TempParCSRSetupInterpreter ( mv_InterfaceInterpreter *i ); HYPRE_Int HYPRE_ParCSRSetupInterpreter ( mv_InterfaceInterpreter *i ); HYPRE_Int HYPRE_ParCSRSetupMatvec ( HYPRE_MatvecFunctions *mv ); /* HYPRE_parcsr_lgmres.c */ -HYPRE_Int HYPRE_ParCSRLGMRESCreate ( MPI_Comm comm , HYPRE_Solver *solver ); +HYPRE_Int HYPRE_ParCSRLGMRESCreate ( MPI_Comm comm, HYPRE_Solver *solver ); HYPRE_Int HYPRE_ParCSRLGMRESDestroy ( HYPRE_Solver solver ); -HYPRE_Int HYPRE_ParCSRLGMRESSetup ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParCSRLGMRESSolve ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParCSRLGMRESSetKDim ( HYPRE_Solver solver , HYPRE_Int k_dim ); -HYPRE_Int HYPRE_ParCSRLGMRESSetAugDim ( HYPRE_Solver solver , HYPRE_Int aug_dim ); -HYPRE_Int HYPRE_ParCSRLGMRESSetTol ( HYPRE_Solver solver , HYPRE_Real tol ); -HYPRE_Int HYPRE_ParCSRLGMRESSetAbsoluteTol ( HYPRE_Solver solver , HYPRE_Real a_tol ); -HYPRE_Int HYPRE_ParCSRLGMRESSetMinIter ( HYPRE_Solver solver , HYPRE_Int min_iter ); -HYPRE_Int HYPRE_ParCSRLGMRESSetMaxIter ( HYPRE_Solver solver , HYPRE_Int max_iter ); -HYPRE_Int HYPRE_ParCSRLGMRESSetPrecond ( HYPRE_Solver solver , HYPRE_PtrToParSolverFcn precond , HYPRE_PtrToParSolverFcn precond_setup , HYPRE_Solver precond_solver ); -HYPRE_Int HYPRE_ParCSRLGMRESGetPrecond ( HYPRE_Solver solver , HYPRE_Solver *precond_data_ptr ); -HYPRE_Int HYPRE_ParCSRLGMRESSetLogging ( HYPRE_Solver solver , HYPRE_Int logging ); -HYPRE_Int HYPRE_ParCSRLGMRESSetPrintLevel ( HYPRE_Solver solver , HYPRE_Int print_level ); -HYPRE_Int HYPRE_ParCSRLGMRESGetNumIterations ( HYPRE_Solver solver , HYPRE_Int *num_iterations ); -HYPRE_Int HYPRE_ParCSRLGMRESGetFinalRelativeResidualNorm ( HYPRE_Solver solver , HYPRE_Real *norm ); -HYPRE_Int HYPRE_ParCSRLGMRESGetResidual ( HYPRE_Solver solver , HYPRE_ParVector *residual ); +HYPRE_Int HYPRE_ParCSRLGMRESSetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParCSRLGMRESSolve ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParCSRLGMRESSetKDim ( HYPRE_Solver solver, HYPRE_Int k_dim ); +HYPRE_Int HYPRE_ParCSRLGMRESSetAugDim ( HYPRE_Solver solver, HYPRE_Int aug_dim ); +HYPRE_Int HYPRE_ParCSRLGMRESSetTol ( HYPRE_Solver solver, HYPRE_Real tol ); +HYPRE_Int HYPRE_ParCSRLGMRESSetAbsoluteTol ( HYPRE_Solver solver, HYPRE_Real a_tol ); +HYPRE_Int HYPRE_ParCSRLGMRESSetMinIter ( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int HYPRE_ParCSRLGMRESSetMaxIter ( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int HYPRE_ParCSRLGMRESSetPrecond ( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, + HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int HYPRE_ParCSRLGMRESGetPrecond ( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int HYPRE_ParCSRLGMRESSetLogging ( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int HYPRE_ParCSRLGMRESSetPrintLevel ( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int HYPRE_ParCSRLGMRESGetNumIterations ( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int HYPRE_ParCSRLGMRESGetFinalRelativeResidualNorm ( HYPRE_Solver solver, HYPRE_Real *norm ); +HYPRE_Int HYPRE_ParCSRLGMRESGetResidual ( HYPRE_Solver solver, HYPRE_ParVector *residual ); /* HYPRE_parcsr_ParaSails.c */ -HYPRE_Int HYPRE_ParCSRParaSailsCreate ( MPI_Comm comm , HYPRE_Solver *solver ); +HYPRE_Int HYPRE_ParCSRParaSailsCreate ( MPI_Comm comm, HYPRE_Solver *solver ); HYPRE_Int HYPRE_ParCSRParaSailsDestroy ( HYPRE_Solver solver ); -HYPRE_Int HYPRE_ParCSRParaSailsSetup ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParCSRParaSailsSolve ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParCSRParaSailsSetParams ( HYPRE_Solver solver , HYPRE_Real thresh , HYPRE_Int nlevels ); -HYPRE_Int HYPRE_ParCSRParaSailsSetFilter ( HYPRE_Solver solver , HYPRE_Real filter ); -HYPRE_Int HYPRE_ParCSRParaSailsGetFilter ( HYPRE_Solver solver , HYPRE_Real *filter ); -HYPRE_Int HYPRE_ParCSRParaSailsSetSym ( HYPRE_Solver solver , HYPRE_Int sym ); -HYPRE_Int HYPRE_ParCSRParaSailsSetLoadbal ( HYPRE_Solver solver , HYPRE_Real loadbal ); -HYPRE_Int HYPRE_ParCSRParaSailsGetLoadbal ( HYPRE_Solver solver , HYPRE_Real *loadbal ); -HYPRE_Int HYPRE_ParCSRParaSailsSetReuse ( HYPRE_Solver solver , HYPRE_Int reuse ); -HYPRE_Int HYPRE_ParCSRParaSailsSetLogging ( HYPRE_Solver solver , HYPRE_Int logging ); -HYPRE_Int HYPRE_ParaSailsCreate ( MPI_Comm comm , HYPRE_Solver *solver ); +HYPRE_Int HYPRE_ParCSRParaSailsSetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParCSRParaSailsSolve ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParCSRParaSailsSetParams ( HYPRE_Solver solver, HYPRE_Real thresh, + HYPRE_Int nlevels ); +HYPRE_Int HYPRE_ParCSRParaSailsSetFilter ( HYPRE_Solver solver, HYPRE_Real filter ); +HYPRE_Int HYPRE_ParCSRParaSailsGetFilter ( HYPRE_Solver solver, HYPRE_Real *filter ); +HYPRE_Int HYPRE_ParCSRParaSailsSetSym ( HYPRE_Solver solver, HYPRE_Int sym ); +HYPRE_Int HYPRE_ParCSRParaSailsSetLoadbal ( HYPRE_Solver solver, HYPRE_Real loadbal ); +HYPRE_Int HYPRE_ParCSRParaSailsGetLoadbal ( HYPRE_Solver solver, HYPRE_Real *loadbal ); +HYPRE_Int HYPRE_ParCSRParaSailsSetReuse ( HYPRE_Solver solver, HYPRE_Int reuse ); +HYPRE_Int HYPRE_ParCSRParaSailsSetLogging ( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int HYPRE_ParaSailsCreate ( MPI_Comm comm, HYPRE_Solver *solver ); HYPRE_Int HYPRE_ParaSailsDestroy ( HYPRE_Solver solver ); -HYPRE_Int HYPRE_ParaSailsSetup ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParaSailsSolve ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParaSailsSetParams ( HYPRE_Solver solver , HYPRE_Real thresh , HYPRE_Int nlevels ); -HYPRE_Int HYPRE_ParaSailsSetThresh ( HYPRE_Solver solver , HYPRE_Real thresh ); -HYPRE_Int HYPRE_ParaSailsGetThresh ( HYPRE_Solver solver , HYPRE_Real *thresh ); -HYPRE_Int HYPRE_ParaSailsSetNlevels ( HYPRE_Solver solver , HYPRE_Int nlevels ); -HYPRE_Int HYPRE_ParaSailsGetNlevels ( HYPRE_Solver solver , HYPRE_Int *nlevels ); -HYPRE_Int HYPRE_ParaSailsSetFilter ( HYPRE_Solver solver , HYPRE_Real filter ); -HYPRE_Int HYPRE_ParaSailsGetFilter ( HYPRE_Solver solver , HYPRE_Real *filter ); -HYPRE_Int HYPRE_ParaSailsSetSym ( HYPRE_Solver solver , HYPRE_Int sym ); -HYPRE_Int HYPRE_ParaSailsGetSym ( HYPRE_Solver solver , HYPRE_Int *sym ); -HYPRE_Int HYPRE_ParaSailsSetLoadbal ( HYPRE_Solver solver , HYPRE_Real loadbal ); -HYPRE_Int HYPRE_ParaSailsGetLoadbal ( HYPRE_Solver solver , HYPRE_Real *loadbal ); -HYPRE_Int HYPRE_ParaSailsSetReuse ( HYPRE_Solver solver , HYPRE_Int reuse ); -HYPRE_Int HYPRE_ParaSailsGetReuse ( HYPRE_Solver solver , HYPRE_Int *reuse ); -HYPRE_Int HYPRE_ParaSailsSetLogging ( HYPRE_Solver solver , HYPRE_Int logging ); -HYPRE_Int HYPRE_ParaSailsGetLogging ( HYPRE_Solver solver , HYPRE_Int *logging ); -HYPRE_Int HYPRE_ParaSailsBuildIJMatrix ( HYPRE_Solver solver , HYPRE_IJMatrix *pij_A ); +HYPRE_Int HYPRE_ParaSailsSetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParaSailsSolve ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParaSailsSetParams ( HYPRE_Solver solver, HYPRE_Real thresh, HYPRE_Int nlevels ); +HYPRE_Int HYPRE_ParaSailsSetThresh ( HYPRE_Solver solver, HYPRE_Real thresh ); +HYPRE_Int HYPRE_ParaSailsGetThresh ( HYPRE_Solver solver, HYPRE_Real *thresh ); +HYPRE_Int HYPRE_ParaSailsSetNlevels ( HYPRE_Solver solver, HYPRE_Int nlevels ); +HYPRE_Int HYPRE_ParaSailsGetNlevels ( HYPRE_Solver solver, HYPRE_Int *nlevels ); +HYPRE_Int HYPRE_ParaSailsSetFilter ( HYPRE_Solver solver, HYPRE_Real filter ); +HYPRE_Int HYPRE_ParaSailsGetFilter ( HYPRE_Solver solver, HYPRE_Real *filter ); +HYPRE_Int HYPRE_ParaSailsSetSym ( HYPRE_Solver solver, HYPRE_Int sym ); +HYPRE_Int HYPRE_ParaSailsGetSym ( HYPRE_Solver solver, HYPRE_Int *sym ); +HYPRE_Int HYPRE_ParaSailsSetLoadbal ( HYPRE_Solver solver, HYPRE_Real loadbal ); +HYPRE_Int HYPRE_ParaSailsGetLoadbal ( HYPRE_Solver solver, HYPRE_Real *loadbal ); +HYPRE_Int HYPRE_ParaSailsSetReuse ( HYPRE_Solver solver, HYPRE_Int reuse ); +HYPRE_Int HYPRE_ParaSailsGetReuse ( HYPRE_Solver solver, HYPRE_Int *reuse ); +HYPRE_Int HYPRE_ParaSailsSetLogging ( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int HYPRE_ParaSailsGetLogging ( HYPRE_Solver solver, HYPRE_Int *logging ); +HYPRE_Int HYPRE_ParaSailsBuildIJMatrix ( HYPRE_Solver solver, HYPRE_IJMatrix *pij_A ); + +/* HYPRE_parcsr_fsai.c */ +HYPRE_Int HYPRE_FSAICreate ( HYPRE_Solver *solver); +HYPRE_Int HYPRE_FSAIDestroy ( HYPRE_Solver solver ); +HYPRE_Int HYPRE_FSAISetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_FSAISolve ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_FSAISetAlgoType ( HYPRE_Solver solver, HYPRE_Int algo_type ); +HYPRE_Int HYPRE_FSAIGetAlgoType ( HYPRE_Solver solver, HYPRE_Int *algo_type ); +HYPRE_Int HYPRE_FSAISetLocalSolveType ( HYPRE_Solver solver, HYPRE_Int local_solve_type ); +HYPRE_Int HYPRE_FSAIGetLocalSolveType ( HYPRE_Solver solver, HYPRE_Int *local_solve_type ); +HYPRE_Int HYPRE_FSAISetMaxSteps ( HYPRE_Solver solver, HYPRE_Int max_steps ); +HYPRE_Int HYPRE_FSAIGetMaxSteps ( HYPRE_Solver solver, HYPRE_Int *max_steps ); +HYPRE_Int HYPRE_FSAISetMaxStepSize ( HYPRE_Solver solver, HYPRE_Int max_step_size ); +HYPRE_Int HYPRE_FSAIGetMaxStepSize ( HYPRE_Solver solver, HYPRE_Int *max_step_size ); +HYPRE_Int HYPRE_FSAISetMaxNnzRow ( HYPRE_Solver solver, HYPRE_Int max_nnz_row ); +HYPRE_Int HYPRE_FSAIGetMaxNnzRow ( HYPRE_Solver solver, HYPRE_Int *max_nnz_row ); +HYPRE_Int HYPRE_FSAISetNumLevels ( HYPRE_Solver solver, HYPRE_Int num_levels ); +HYPRE_Int HYPRE_FSAIGetNumLevels ( HYPRE_Solver solver, HYPRE_Int *num_levels ); +HYPRE_Int HYPRE_FSAISetThreshold ( HYPRE_Solver solver, HYPRE_Real threshold ); +HYPRE_Int HYPRE_FSAIGetThreshold ( HYPRE_Solver solver, HYPRE_Real *threshold ); +HYPRE_Int HYPRE_FSAISetKapTolerance ( HYPRE_Solver solver, HYPRE_Real kap_tolerance ); +HYPRE_Int HYPRE_FSAIGetKapTolerance ( HYPRE_Solver solver, HYPRE_Real *kap_tolerance ); +HYPRE_Int HYPRE_FSAISetTolerance ( HYPRE_Solver solver, HYPRE_Real tolerance ); +HYPRE_Int HYPRE_FSAIGetTolerance ( HYPRE_Solver solver, HYPRE_Real *tolerance ); +HYPRE_Int HYPRE_FSAISetOmega ( HYPRE_Solver solver, HYPRE_Real omega ); +HYPRE_Int HYPRE_FSAIGetOmega ( HYPRE_Solver solver, HYPRE_Real *omega ); +HYPRE_Int HYPRE_FSAISetMaxIterations ( HYPRE_Solver solver, HYPRE_Int max_iterations ); +HYPRE_Int HYPRE_FSAIGetMaxIterations ( HYPRE_Solver solver, HYPRE_Int *max_iterations ); +HYPRE_Int HYPRE_FSAISetEigMaxIters ( HYPRE_Solver solver, HYPRE_Int eig_max_iters ); +HYPRE_Int HYPRE_FSAIGetEigMaxIters ( HYPRE_Solver solver, HYPRE_Int *eig_max_iters ); +HYPRE_Int HYPRE_FSAISetZeroGuess ( HYPRE_Solver solver, HYPRE_Int zero_guess ); +HYPRE_Int HYPRE_FSAIGetZeroGuess ( HYPRE_Solver solver, HYPRE_Int *zero_guess ); +HYPRE_Int HYPRE_FSAISetPrintLevel ( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int HYPRE_FSAIGetPrintLevel ( HYPRE_Solver solver, HYPRE_Int *print_level ); /* HYPRE_parcsr_pcg.c */ -HYPRE_Int HYPRE_ParCSRPCGCreate ( MPI_Comm comm , HYPRE_Solver *solver ); +HYPRE_Int HYPRE_ParCSRPCGCreate ( MPI_Comm comm, HYPRE_Solver *solver ); HYPRE_Int HYPRE_ParCSRPCGDestroy ( HYPRE_Solver solver ); -HYPRE_Int HYPRE_ParCSRPCGSetup ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParCSRPCGSolve ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParCSRPCGSetTol ( HYPRE_Solver solver , HYPRE_Real tol ); -HYPRE_Int HYPRE_ParCSRPCGSetAbsoluteTol ( HYPRE_Solver solver , HYPRE_Real a_tol ); -HYPRE_Int HYPRE_ParCSRPCGSetMaxIter ( HYPRE_Solver solver , HYPRE_Int max_iter ); -HYPRE_Int HYPRE_ParCSRPCGSetStopCrit ( HYPRE_Solver solver , HYPRE_Int stop_crit ); -HYPRE_Int HYPRE_ParCSRPCGSetTwoNorm ( HYPRE_Solver solver , HYPRE_Int two_norm ); -HYPRE_Int HYPRE_ParCSRPCGSetRelChange ( HYPRE_Solver solver , HYPRE_Int rel_change ); -HYPRE_Int HYPRE_ParCSRPCGSetPrecond ( HYPRE_Solver solver , HYPRE_PtrToParSolverFcn precond , HYPRE_PtrToParSolverFcn precond_setup , HYPRE_Solver precond_solver ); -HYPRE_Int HYPRE_ParCSRPCGGetPrecond ( HYPRE_Solver solver , HYPRE_Solver *precond_data_ptr ); -HYPRE_Int HYPRE_ParCSRPCGSetPrintLevel ( HYPRE_Solver solver , HYPRE_Int level ); -HYPRE_Int HYPRE_ParCSRPCGSetLogging ( HYPRE_Solver solver , HYPRE_Int level ); -HYPRE_Int HYPRE_ParCSRPCGGetNumIterations ( HYPRE_Solver solver , HYPRE_Int *num_iterations ); -HYPRE_Int HYPRE_ParCSRPCGGetFinalRelativeResidualNorm ( HYPRE_Solver solver , HYPRE_Real *norm ); -HYPRE_Int HYPRE_ParCSRPCGGetResidual ( HYPRE_Solver solver , HYPRE_ParVector *residual ); -HYPRE_Int HYPRE_ParCSRDiagScaleSetup ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector y , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParCSRDiagScale ( HYPRE_Solver solver , HYPRE_ParCSRMatrix HA , HYPRE_ParVector Hy , HYPRE_ParVector Hx ); -HYPRE_Int HYPRE_ParCSROnProcTriSetup ( HYPRE_Solver solver , HYPRE_ParCSRMatrix HA , HYPRE_ParVector Hy , HYPRE_ParVector Hx ); -HYPRE_Int HYPRE_ParCSROnProcTriSolve ( HYPRE_Solver solver , HYPRE_ParCSRMatrix HA , HYPRE_ParVector Hy , HYPRE_ParVector Hx ); +HYPRE_Int HYPRE_ParCSRPCGSetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParCSRPCGSolve ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParCSRPCGSetTol ( HYPRE_Solver solver, HYPRE_Real tol ); +HYPRE_Int HYPRE_ParCSRPCGSetAbsoluteTol ( HYPRE_Solver solver, HYPRE_Real a_tol ); +HYPRE_Int HYPRE_ParCSRPCGSetMaxIter ( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int HYPRE_ParCSRPCGSetStopCrit ( HYPRE_Solver solver, HYPRE_Int stop_crit ); +HYPRE_Int HYPRE_ParCSRPCGSetTwoNorm ( HYPRE_Solver solver, HYPRE_Int two_norm ); +HYPRE_Int HYPRE_ParCSRPCGSetRelChange ( HYPRE_Solver solver, HYPRE_Int rel_change ); +HYPRE_Int HYPRE_ParCSRPCGSetPrecond ( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, + HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int HYPRE_ParCSRPCGGetPrecond ( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int HYPRE_ParCSRPCGSetPrintLevel ( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int HYPRE_ParCSRPCGSetLogging ( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int HYPRE_ParCSRPCGGetNumIterations ( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int HYPRE_ParCSRPCGGetFinalRelativeResidualNorm ( HYPRE_Solver solver, HYPRE_Real *norm ); +HYPRE_Int HYPRE_ParCSRPCGGetResidual ( HYPRE_Solver solver, HYPRE_ParVector *residual ); +HYPRE_Int HYPRE_ParCSRDiagScaleSetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector y, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParCSRDiagScale ( HYPRE_Solver solver, HYPRE_ParCSRMatrix HA, HYPRE_ParVector Hy, + HYPRE_ParVector Hx ); +HYPRE_Int HYPRE_ParCSROnProcTriSetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix HA, + HYPRE_ParVector Hy, HYPRE_ParVector Hx ); +HYPRE_Int HYPRE_ParCSROnProcTriSolve ( HYPRE_Solver solver, HYPRE_ParCSRMatrix HA, + HYPRE_ParVector Hy, HYPRE_ParVector Hx ); /* HYPRE_parcsr_pilut.c */ -HYPRE_Int HYPRE_ParCSRPilutCreate ( MPI_Comm comm , HYPRE_Solver *solver ); +HYPRE_Int HYPRE_ParCSRPilutCreate ( MPI_Comm comm, HYPRE_Solver *solver ); HYPRE_Int HYPRE_ParCSRPilutDestroy ( HYPRE_Solver solver ); -HYPRE_Int HYPRE_ParCSRPilutSetup ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParCSRPilutSolve ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParCSRPilutSetMaxIter ( HYPRE_Solver solver , HYPRE_Int max_iter ); -HYPRE_Int HYPRE_ParCSRPilutSetDropTolerance ( HYPRE_Solver solver , HYPRE_Real tol ); -HYPRE_Int HYPRE_ParCSRPilutSetFactorRowSize ( HYPRE_Solver solver , HYPRE_Int size ); +HYPRE_Int HYPRE_ParCSRPilutSetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParCSRPilutSolve ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParCSRPilutSetMaxIter ( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int HYPRE_ParCSRPilutSetDropTolerance ( HYPRE_Solver solver, HYPRE_Real tol ); +HYPRE_Int HYPRE_ParCSRPilutSetFactorRowSize ( HYPRE_Solver solver, HYPRE_Int size ); /* HYPRE_parcsr_schwarz.c */ HYPRE_Int HYPRE_SchwarzCreate ( HYPRE_Solver *solver ); HYPRE_Int HYPRE_SchwarzDestroy ( HYPRE_Solver solver ); -HYPRE_Int HYPRE_SchwarzSetup ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_SchwarzSolve ( HYPRE_Solver solver , HYPRE_ParCSRMatrix A , HYPRE_ParVector b , HYPRE_ParVector x ); -HYPRE_Int HYPRE_SchwarzSetVariant ( HYPRE_Solver solver , HYPRE_Int variant ); -HYPRE_Int HYPRE_SchwarzSetOverlap ( HYPRE_Solver solver , HYPRE_Int overlap ); -HYPRE_Int HYPRE_SchwarzSetDomainType ( HYPRE_Solver solver , HYPRE_Int domain_type ); -HYPRE_Int HYPRE_SchwarzSetDomainStructure ( HYPRE_Solver solver , HYPRE_CSRMatrix domain_structure ); -HYPRE_Int HYPRE_SchwarzSetNumFunctions ( HYPRE_Solver solver , HYPRE_Int num_functions ); -HYPRE_Int HYPRE_SchwarzSetNonSymm ( HYPRE_Solver solver , HYPRE_Int use_nonsymm ); -HYPRE_Int HYPRE_SchwarzSetRelaxWeight ( HYPRE_Solver solver , HYPRE_Real relax_weight ); -HYPRE_Int HYPRE_SchwarzSetDofFunc ( HYPRE_Solver solver , HYPRE_Int *dof_func ); +HYPRE_Int HYPRE_SchwarzSetup ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_SchwarzSolve ( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, + HYPRE_ParVector x ); +HYPRE_Int HYPRE_SchwarzSetVariant ( HYPRE_Solver solver, HYPRE_Int variant ); +HYPRE_Int HYPRE_SchwarzSetOverlap ( HYPRE_Solver solver, HYPRE_Int overlap ); +HYPRE_Int HYPRE_SchwarzSetDomainType ( HYPRE_Solver solver, HYPRE_Int domain_type ); +HYPRE_Int HYPRE_SchwarzSetDomainStructure ( HYPRE_Solver solver, HYPRE_CSRMatrix domain_structure ); +HYPRE_Int HYPRE_SchwarzSetNumFunctions ( HYPRE_Solver solver, HYPRE_Int num_functions ); +HYPRE_Int HYPRE_SchwarzSetNonSymm ( HYPRE_Solver solver, HYPRE_Int use_nonsymm ); +HYPRE_Int HYPRE_SchwarzSetRelaxWeight ( HYPRE_Solver solver, HYPRE_Real relax_weight ); +HYPRE_Int HYPRE_SchwarzSetDofFunc ( HYPRE_Solver solver, HYPRE_Int *dof_func ); /* par_add_cycle.c */ HYPRE_Int hypre_BoomerAMGAdditiveCycle ( void *amg_vdata ); @@ -767,596 +1015,1082 @@ HYPRE_Int hypre_CreateDinv ( void *amg_vdata ); /* par_amg.c */ void *hypre_BoomerAMGCreate ( void ); HYPRE_Int hypre_BoomerAMGDestroy ( void *data ); -HYPRE_Int hypre_BoomerAMGSetRestriction ( void *data , HYPRE_Int restr_par ); -HYPRE_Int hypre_BoomerAMGSetIsTriangular ( void *data , HYPRE_Int is_triangular ); -HYPRE_Int hypre_BoomerAMGSetGMRESSwitchR ( void *data , HYPRE_Int gmres_switch ); -HYPRE_Int hypre_BoomerAMGSetMaxLevels ( void *data , HYPRE_Int max_levels ); -HYPRE_Int hypre_BoomerAMGGetMaxLevels ( void *data , HYPRE_Int *max_levels ); -HYPRE_Int hypre_BoomerAMGSetMaxCoarseSize ( void *data , HYPRE_Int max_coarse_size ); -HYPRE_Int hypre_BoomerAMGGetMaxCoarseSize ( void *data , HYPRE_Int *max_coarse_size ); -HYPRE_Int hypre_BoomerAMGSetMinCoarseSize ( void *data , HYPRE_Int min_coarse_size ); -HYPRE_Int hypre_BoomerAMGGetMinCoarseSize ( void *data , HYPRE_Int *min_coarse_size ); -HYPRE_Int hypre_BoomerAMGSetSeqThreshold ( void *data , HYPRE_Int seq_threshold ); -HYPRE_Int hypre_BoomerAMGGetSeqThreshold ( void *data , HYPRE_Int *seq_threshold ); +HYPRE_Int hypre_BoomerAMGSetRestriction ( void *data, HYPRE_Int restr_par ); +HYPRE_Int hypre_BoomerAMGSetIsTriangular ( void *data, HYPRE_Int is_triangular ); +HYPRE_Int hypre_BoomerAMGSetGMRESSwitchR ( void *data, HYPRE_Int gmres_switch ); +HYPRE_Int hypre_BoomerAMGSetMaxLevels ( void *data, HYPRE_Int max_levels ); +HYPRE_Int hypre_BoomerAMGGetMaxLevels ( void *data, HYPRE_Int *max_levels ); +HYPRE_Int hypre_BoomerAMGSetMaxCoarseSize ( void *data, HYPRE_Int max_coarse_size ); +HYPRE_Int hypre_BoomerAMGGetMaxCoarseSize ( void *data, HYPRE_Int *max_coarse_size ); +HYPRE_Int hypre_BoomerAMGSetMinCoarseSize ( void *data, HYPRE_Int min_coarse_size ); +HYPRE_Int hypre_BoomerAMGGetMinCoarseSize ( void *data, HYPRE_Int *min_coarse_size ); +HYPRE_Int hypre_BoomerAMGSetSeqThreshold ( void *data, HYPRE_Int seq_threshold ); +HYPRE_Int hypre_BoomerAMGGetSeqThreshold ( void *data, HYPRE_Int *seq_threshold ); HYPRE_Int hypre_BoomerAMGSetCoarsenCutFactor( void *data, HYPRE_Int coarsen_cut_factor ); HYPRE_Int hypre_BoomerAMGGetCoarsenCutFactor( void *data, HYPRE_Int *coarsen_cut_factor ); -HYPRE_Int hypre_BoomerAMGSetRedundant ( void *data , HYPRE_Int redundant ); -HYPRE_Int hypre_BoomerAMGGetRedundant ( void *data , HYPRE_Int *redundant ); -HYPRE_Int hypre_BoomerAMGSetStrongThreshold ( void *data , HYPRE_Real strong_threshold ); -HYPRE_Int hypre_BoomerAMGGetStrongThreshold ( void *data , HYPRE_Real *strong_threshold ); -HYPRE_Int hypre_BoomerAMGSetStrongThresholdR ( void *data , HYPRE_Real strong_threshold ); -HYPRE_Int hypre_BoomerAMGGetStrongThresholdR ( void *data , HYPRE_Real *strong_threshold ); -HYPRE_Int hypre_BoomerAMGSetFilterThresholdR ( void *data , HYPRE_Real filter_threshold ); -HYPRE_Int hypre_BoomerAMGGetFilterThresholdR ( void *data , HYPRE_Real *filter_threshold ); -HYPRE_Int hypre_BoomerAMGSetSabs ( void *data , HYPRE_Int Sabs ); -HYPRE_Int hypre_BoomerAMGSetMaxRowSum ( void *data , HYPRE_Real max_row_sum ); -HYPRE_Int hypre_BoomerAMGGetMaxRowSum ( void *data , HYPRE_Real *max_row_sum ); -HYPRE_Int hypre_BoomerAMGSetTruncFactor ( void *data , HYPRE_Real trunc_factor ); -HYPRE_Int hypre_BoomerAMGGetTruncFactor ( void *data , HYPRE_Real *trunc_factor ); -HYPRE_Int hypre_BoomerAMGSetPMaxElmts ( void *data , HYPRE_Int P_max_elmts ); -HYPRE_Int hypre_BoomerAMGGetPMaxElmts ( void *data , HYPRE_Int *P_max_elmts ); -HYPRE_Int hypre_BoomerAMGSetJacobiTruncThreshold ( void *data , HYPRE_Real jacobi_trunc_threshold ); -HYPRE_Int hypre_BoomerAMGGetJacobiTruncThreshold ( void *data , HYPRE_Real *jacobi_trunc_threshold ); -HYPRE_Int hypre_BoomerAMGSetPostInterpType ( void *data , HYPRE_Int post_interp_type ); -HYPRE_Int hypre_BoomerAMGGetPostInterpType ( void *data , HYPRE_Int *post_interp_type ); -HYPRE_Int hypre_BoomerAMGSetInterpType ( void *data , HYPRE_Int interp_type ); -HYPRE_Int hypre_BoomerAMGGetInterpType ( void *data , HYPRE_Int *interp_type ); -HYPRE_Int hypre_BoomerAMGSetSepWeight ( void *data , HYPRE_Int sep_weight ); -HYPRE_Int hypre_BoomerAMGSetMinIter ( void *data , HYPRE_Int min_iter ); -HYPRE_Int hypre_BoomerAMGGetMinIter ( void *data , HYPRE_Int *min_iter ); -HYPRE_Int hypre_BoomerAMGSetMaxIter ( void *data , HYPRE_Int max_iter ); -HYPRE_Int hypre_BoomerAMGGetMaxIter ( void *data , HYPRE_Int *max_iter ); -HYPRE_Int hypre_BoomerAMGSetCoarsenType ( void *data , HYPRE_Int coarsen_type ); -HYPRE_Int hypre_BoomerAMGGetCoarsenType ( void *data , HYPRE_Int *coarsen_type ); -HYPRE_Int hypre_BoomerAMGSetMeasureType ( void *data , HYPRE_Int measure_type ); -HYPRE_Int hypre_BoomerAMGGetMeasureType ( void *data , HYPRE_Int *measure_type ); -HYPRE_Int hypre_BoomerAMGSetSetupType ( void *data , HYPRE_Int setup_type ); -HYPRE_Int hypre_BoomerAMGGetSetupType ( void *data , HYPRE_Int *setup_type ); -HYPRE_Int hypre_BoomerAMGSetFCycle ( void *data , HYPRE_Int fcycle ); -HYPRE_Int hypre_BoomerAMGGetFCycle ( void *data , HYPRE_Int *fcycle ); -HYPRE_Int hypre_BoomerAMGSetCycleType ( void *data , HYPRE_Int cycle_type ); -HYPRE_Int hypre_BoomerAMGGetCycleType ( void *data , HYPRE_Int *cycle_type ); -HYPRE_Int hypre_BoomerAMGSetConvergeType ( void *data , HYPRE_Int type ); -HYPRE_Int hypre_BoomerAMGGetConvergeType ( void *data , HYPRE_Int *type ); -HYPRE_Int hypre_BoomerAMGSetTol ( void *data , HYPRE_Real tol ); -HYPRE_Int hypre_BoomerAMGGetTol ( void *data , HYPRE_Real *tol ); -HYPRE_Int hypre_BoomerAMGSetNumSweeps ( void *data , HYPRE_Int num_sweeps ); -HYPRE_Int hypre_BoomerAMGSetCycleNumSweeps ( void *data , HYPRE_Int num_sweeps , HYPRE_Int k ); -HYPRE_Int hypre_BoomerAMGGetCycleNumSweeps ( void *data , HYPRE_Int *num_sweeps , HYPRE_Int k ); -HYPRE_Int hypre_BoomerAMGSetNumGridSweeps ( void *data , HYPRE_Int *num_grid_sweeps ); -HYPRE_Int hypre_BoomerAMGGetNumGridSweeps ( void *data , HYPRE_Int **num_grid_sweeps ); -HYPRE_Int hypre_BoomerAMGSetRelaxType ( void *data , HYPRE_Int relax_type ); -HYPRE_Int hypre_BoomerAMGSetCycleRelaxType ( void *data , HYPRE_Int relax_type , HYPRE_Int k ); -HYPRE_Int hypre_BoomerAMGGetCycleRelaxType ( void *data , HYPRE_Int *relax_type , HYPRE_Int k ); -HYPRE_Int hypre_BoomerAMGSetRelaxOrder ( void *data , HYPRE_Int relax_order ); -HYPRE_Int hypre_BoomerAMGGetRelaxOrder ( void *data , HYPRE_Int *relax_order ); -HYPRE_Int hypre_BoomerAMGSetGridRelaxType ( void *data , HYPRE_Int *grid_relax_type ); -HYPRE_Int hypre_BoomerAMGGetGridRelaxType ( void *data , HYPRE_Int **grid_relax_type ); -HYPRE_Int hypre_BoomerAMGSetGridRelaxPoints ( void *data , HYPRE_Int **grid_relax_points ); -HYPRE_Int hypre_BoomerAMGGetGridRelaxPoints ( void *data , HYPRE_Int ***grid_relax_points ); -HYPRE_Int hypre_BoomerAMGSetRelaxWeight ( void *data , HYPRE_Real *relax_weight ); -HYPRE_Int hypre_BoomerAMGGetRelaxWeight ( void *data , HYPRE_Real **relax_weight ); -HYPRE_Int hypre_BoomerAMGSetRelaxWt ( void *data , HYPRE_Real relax_weight ); -HYPRE_Int hypre_BoomerAMGSetLevelRelaxWt ( void *data , HYPRE_Real relax_weight , HYPRE_Int level ); -HYPRE_Int hypre_BoomerAMGGetLevelRelaxWt ( void *data , HYPRE_Real *relax_weight , HYPRE_Int level ); -HYPRE_Int hypre_BoomerAMGSetOmega ( void *data , HYPRE_Real *omega ); -HYPRE_Int hypre_BoomerAMGGetOmega ( void *data , HYPRE_Real **omega ); -HYPRE_Int hypre_BoomerAMGSetOuterWt ( void *data , HYPRE_Real omega ); -HYPRE_Int hypre_BoomerAMGSetLevelOuterWt ( void *data , HYPRE_Real omega , HYPRE_Int level ); -HYPRE_Int hypre_BoomerAMGGetLevelOuterWt ( void *data , HYPRE_Real *omega , HYPRE_Int level ); -HYPRE_Int hypre_BoomerAMGSetSmoothType ( void *data , HYPRE_Int smooth_type ); -HYPRE_Int hypre_BoomerAMGGetSmoothType ( void *data , HYPRE_Int *smooth_type ); -HYPRE_Int hypre_BoomerAMGSetSmoothNumLevels ( void *data , HYPRE_Int smooth_num_levels ); -HYPRE_Int hypre_BoomerAMGGetSmoothNumLevels ( void *data , HYPRE_Int *smooth_num_levels ); -HYPRE_Int hypre_BoomerAMGSetSmoothNumSweeps ( void *data , HYPRE_Int smooth_num_sweeps ); -HYPRE_Int hypre_BoomerAMGGetSmoothNumSweeps ( void *data , HYPRE_Int *smooth_num_sweeps ); -HYPRE_Int hypre_BoomerAMGSetLogging ( void *data , HYPRE_Int logging ); -HYPRE_Int hypre_BoomerAMGGetLogging ( void *data , HYPRE_Int *logging ); -HYPRE_Int hypre_BoomerAMGSetPrintLevel ( void *data , HYPRE_Int print_level ); -HYPRE_Int hypre_BoomerAMGGetPrintLevel ( void *data , HYPRE_Int *print_level ); -HYPRE_Int hypre_BoomerAMGSetPrintFileName ( void *data , const char *print_file_name ); -HYPRE_Int hypre_BoomerAMGGetPrintFileName ( void *data , char **print_file_name ); -HYPRE_Int hypre_BoomerAMGSetNumIterations ( void *data , HYPRE_Int num_iterations ); -HYPRE_Int hypre_BoomerAMGSetDebugFlag ( void *data , HYPRE_Int debug_flag ); -HYPRE_Int hypre_BoomerAMGGetDebugFlag ( void *data , HYPRE_Int *debug_flag ); -HYPRE_Int hypre_BoomerAMGSetGSMG ( void *data , HYPRE_Int par ); -HYPRE_Int hypre_BoomerAMGSetNumSamples ( void *data , HYPRE_Int par ); -HYPRE_Int hypre_BoomerAMGSetCGCIts ( void *data , HYPRE_Int its ); -HYPRE_Int hypre_BoomerAMGSetPlotGrids ( void *data , HYPRE_Int plotgrids ); -HYPRE_Int hypre_BoomerAMGSetPlotFileName ( void *data , const char *plot_file_name ); -HYPRE_Int hypre_BoomerAMGSetCoordDim ( void *data , HYPRE_Int coorddim ); -HYPRE_Int hypre_BoomerAMGSetCoordinates ( void *data , float *coordinates ); +HYPRE_Int hypre_BoomerAMGSetRedundant ( void *data, HYPRE_Int redundant ); +HYPRE_Int hypre_BoomerAMGGetRedundant ( void *data, HYPRE_Int *redundant ); +HYPRE_Int hypre_BoomerAMGSetStrongThreshold ( void *data, HYPRE_Real strong_threshold ); +HYPRE_Int hypre_BoomerAMGGetStrongThreshold ( void *data, HYPRE_Real *strong_threshold ); +HYPRE_Int hypre_BoomerAMGSetStrongThresholdR ( void *data, HYPRE_Real strong_threshold ); +HYPRE_Int hypre_BoomerAMGGetStrongThresholdR ( void *data, HYPRE_Real *strong_threshold ); +HYPRE_Int hypre_BoomerAMGSetFilterThresholdR ( void *data, HYPRE_Real filter_threshold ); +HYPRE_Int hypre_BoomerAMGGetFilterThresholdR ( void *data, HYPRE_Real *filter_threshold ); +HYPRE_Int hypre_BoomerAMGSetSabs ( void *data, HYPRE_Int Sabs ); +HYPRE_Int hypre_BoomerAMGSetMaxRowSum ( void *data, HYPRE_Real max_row_sum ); +HYPRE_Int hypre_BoomerAMGGetMaxRowSum ( void *data, HYPRE_Real *max_row_sum ); +HYPRE_Int hypre_BoomerAMGSetTruncFactor ( void *data, HYPRE_Real trunc_factor ); +HYPRE_Int hypre_BoomerAMGGetTruncFactor ( void *data, HYPRE_Real *trunc_factor ); +HYPRE_Int hypre_BoomerAMGSetPMaxElmts ( void *data, HYPRE_Int P_max_elmts ); +HYPRE_Int hypre_BoomerAMGGetPMaxElmts ( void *data, HYPRE_Int *P_max_elmts ); +HYPRE_Int hypre_BoomerAMGSetJacobiTruncThreshold ( void *data, HYPRE_Real jacobi_trunc_threshold ); +HYPRE_Int hypre_BoomerAMGGetJacobiTruncThreshold ( void *data, HYPRE_Real *jacobi_trunc_threshold ); +HYPRE_Int hypre_BoomerAMGSetPostInterpType ( void *data, HYPRE_Int post_interp_type ); +HYPRE_Int hypre_BoomerAMGGetPostInterpType ( void *data, HYPRE_Int *post_interp_type ); +HYPRE_Int hypre_BoomerAMGSetInterpType ( void *data, HYPRE_Int interp_type ); +HYPRE_Int hypre_BoomerAMGGetInterpType ( void *data, HYPRE_Int *interp_type ); +HYPRE_Int hypre_BoomerAMGSetSepWeight ( void *data, HYPRE_Int sep_weight ); +HYPRE_Int hypre_BoomerAMGSetMinIter ( void *data, HYPRE_Int min_iter ); +HYPRE_Int hypre_BoomerAMGGetMinIter ( void *data, HYPRE_Int *min_iter ); +HYPRE_Int hypre_BoomerAMGSetMaxIter ( void *data, HYPRE_Int max_iter ); +HYPRE_Int hypre_BoomerAMGGetMaxIter ( void *data, HYPRE_Int *max_iter ); +HYPRE_Int hypre_BoomerAMGSetCoarsenType ( void *data, HYPRE_Int coarsen_type ); +HYPRE_Int hypre_BoomerAMGGetCoarsenType ( void *data, HYPRE_Int *coarsen_type ); +HYPRE_Int hypre_BoomerAMGSetMeasureType ( void *data, HYPRE_Int measure_type ); +HYPRE_Int hypre_BoomerAMGGetMeasureType ( void *data, HYPRE_Int *measure_type ); +HYPRE_Int hypre_BoomerAMGSetSetupType ( void *data, HYPRE_Int setup_type ); +HYPRE_Int hypre_BoomerAMGGetSetupType ( void *data, HYPRE_Int *setup_type ); +HYPRE_Int hypre_BoomerAMGSetFCycle ( void *data, HYPRE_Int fcycle ); +HYPRE_Int hypre_BoomerAMGGetFCycle ( void *data, HYPRE_Int *fcycle ); +HYPRE_Int hypre_BoomerAMGSetCycleType ( void *data, HYPRE_Int cycle_type ); +HYPRE_Int hypre_BoomerAMGGetCycleType ( void *data, HYPRE_Int *cycle_type ); +HYPRE_Int hypre_BoomerAMGSetConvergeType ( void *data, HYPRE_Int type ); +HYPRE_Int hypre_BoomerAMGGetConvergeType ( void *data, HYPRE_Int *type ); +HYPRE_Int hypre_BoomerAMGSetTol ( void *data, HYPRE_Real tol ); +HYPRE_Int hypre_BoomerAMGGetTol ( void *data, HYPRE_Real *tol ); +HYPRE_Int hypre_BoomerAMGSetNumSweeps ( void *data, HYPRE_Int num_sweeps ); +HYPRE_Int hypre_BoomerAMGSetCycleNumSweeps ( void *data, HYPRE_Int num_sweeps, HYPRE_Int k ); +HYPRE_Int hypre_BoomerAMGGetCycleNumSweeps ( void *data, HYPRE_Int *num_sweeps, HYPRE_Int k ); +HYPRE_Int hypre_BoomerAMGSetNumGridSweeps ( void *data, HYPRE_Int *num_grid_sweeps ); +HYPRE_Int hypre_BoomerAMGGetNumGridSweeps ( void *data, HYPRE_Int **num_grid_sweeps ); +HYPRE_Int hypre_BoomerAMGSetRelaxType ( void *data, HYPRE_Int relax_type ); +HYPRE_Int hypre_BoomerAMGSetCycleRelaxType ( void *data, HYPRE_Int relax_type, HYPRE_Int k ); +HYPRE_Int hypre_BoomerAMGGetCycleRelaxType ( void *data, HYPRE_Int *relax_type, HYPRE_Int k ); +HYPRE_Int hypre_BoomerAMGSetRelaxOrder ( void *data, HYPRE_Int relax_order ); +HYPRE_Int hypre_BoomerAMGGetRelaxOrder ( void *data, HYPRE_Int *relax_order ); +HYPRE_Int hypre_BoomerAMGSetGridRelaxType ( void *data, HYPRE_Int *grid_relax_type ); +HYPRE_Int hypre_BoomerAMGGetGridRelaxType ( void *data, HYPRE_Int **grid_relax_type ); +HYPRE_Int hypre_BoomerAMGSetGridRelaxPoints ( void *data, HYPRE_Int **grid_relax_points ); +HYPRE_Int hypre_BoomerAMGGetGridRelaxPoints ( void *data, HYPRE_Int ***grid_relax_points ); +HYPRE_Int hypre_BoomerAMGSetRelaxWeight ( void *data, HYPRE_Real *relax_weight ); +HYPRE_Int hypre_BoomerAMGGetRelaxWeight ( void *data, HYPRE_Real **relax_weight ); +HYPRE_Int hypre_BoomerAMGSetRelaxWt ( void *data, HYPRE_Real relax_weight ); +HYPRE_Int hypre_BoomerAMGSetLevelRelaxWt ( void *data, HYPRE_Real relax_weight, HYPRE_Int level ); +HYPRE_Int hypre_BoomerAMGGetLevelRelaxWt ( void *data, HYPRE_Real *relax_weight, HYPRE_Int level ); +HYPRE_Int hypre_BoomerAMGSetOmega ( void *data, HYPRE_Real *omega ); +HYPRE_Int hypre_BoomerAMGGetOmega ( void *data, HYPRE_Real **omega ); +HYPRE_Int hypre_BoomerAMGSetOuterWt ( void *data, HYPRE_Real omega ); +HYPRE_Int hypre_BoomerAMGSetLevelOuterWt ( void *data, HYPRE_Real omega, HYPRE_Int level ); +HYPRE_Int hypre_BoomerAMGGetLevelOuterWt ( void *data, HYPRE_Real *omega, HYPRE_Int level ); +HYPRE_Int hypre_BoomerAMGSetSmoothType ( void *data, HYPRE_Int smooth_type ); +HYPRE_Int hypre_BoomerAMGGetSmoothType ( void *data, HYPRE_Int *smooth_type ); +HYPRE_Int hypre_BoomerAMGSetSmoothNumLevels ( void *data, HYPRE_Int smooth_num_levels ); +HYPRE_Int hypre_BoomerAMGGetSmoothNumLevels ( void *data, HYPRE_Int *smooth_num_levels ); +HYPRE_Int hypre_BoomerAMGSetSmoothNumSweeps ( void *data, HYPRE_Int smooth_num_sweeps ); +HYPRE_Int hypre_BoomerAMGGetSmoothNumSweeps ( void *data, HYPRE_Int *smooth_num_sweeps ); +HYPRE_Int hypre_BoomerAMGSetLogging ( void *data, HYPRE_Int logging ); +HYPRE_Int hypre_BoomerAMGGetLogging ( void *data, HYPRE_Int *logging ); +HYPRE_Int hypre_BoomerAMGSetPrintLevel ( void *data, HYPRE_Int print_level ); +HYPRE_Int hypre_BoomerAMGGetPrintLevel ( void *data, HYPRE_Int *print_level ); +HYPRE_Int hypre_BoomerAMGSetPrintFileName ( void *data, const char *print_file_name ); +HYPRE_Int hypre_BoomerAMGGetPrintFileName ( void *data, char **print_file_name ); +HYPRE_Int hypre_BoomerAMGSetNumIterations ( void *data, HYPRE_Int num_iterations ); +HYPRE_Int hypre_BoomerAMGSetDebugFlag ( void *data, HYPRE_Int debug_flag ); +HYPRE_Int hypre_BoomerAMGGetDebugFlag ( void *data, HYPRE_Int *debug_flag ); +HYPRE_Int hypre_BoomerAMGSetGSMG ( void *data, HYPRE_Int par ); +HYPRE_Int hypre_BoomerAMGSetNumSamples ( void *data, HYPRE_Int par ); +HYPRE_Int hypre_BoomerAMGSetCGCIts ( void *data, HYPRE_Int its ); +HYPRE_Int hypre_BoomerAMGSetPlotGrids ( void *data, HYPRE_Int plotgrids ); +HYPRE_Int hypre_BoomerAMGSetPlotFileName ( void *data, const char *plot_file_name ); +HYPRE_Int hypre_BoomerAMGSetCoordDim ( void *data, HYPRE_Int coorddim ); +HYPRE_Int hypre_BoomerAMGSetCoordinates ( void *data, float *coordinates ); HYPRE_Int hypre_BoomerAMGGetGridHierarchy(void *data, HYPRE_Int *cgrid ); -HYPRE_Int hypre_BoomerAMGSetNumFunctions ( void *data , HYPRE_Int num_functions ); -HYPRE_Int hypre_BoomerAMGGetNumFunctions ( void *data , HYPRE_Int *num_functions ); -HYPRE_Int hypre_BoomerAMGSetNodal ( void *data , HYPRE_Int nodal ); -HYPRE_Int hypre_BoomerAMGSetNodalLevels ( void *data , HYPRE_Int nodal_levels ); -HYPRE_Int hypre_BoomerAMGSetNodalDiag ( void *data , HYPRE_Int nodal ); -HYPRE_Int hypre_BoomerAMGSetKeepSameSign ( void *data , HYPRE_Int keep_same_sign ); -HYPRE_Int hypre_BoomerAMGSetNumPaths ( void *data , HYPRE_Int num_paths ); -HYPRE_Int hypre_BoomerAMGSetAggNumLevels ( void *data , HYPRE_Int agg_num_levels ); -HYPRE_Int hypre_BoomerAMGSetAggInterpType ( void *data , HYPRE_Int agg_interp_type ); -HYPRE_Int hypre_BoomerAMGSetAggPMaxElmts ( void *data , HYPRE_Int agg_P_max_elmts ); -HYPRE_Int hypre_BoomerAMGSetMultAddPMaxElmts ( void *data , HYPRE_Int add_P_max_elmts ); -HYPRE_Int hypre_BoomerAMGSetAddRelaxType ( void *data , HYPRE_Int add_rlx_type ); -HYPRE_Int hypre_BoomerAMGSetAddRelaxWt ( void *data , HYPRE_Real add_rlx_wt ); -HYPRE_Int hypre_BoomerAMGSetAggP12MaxElmts ( void *data , HYPRE_Int agg_P12_max_elmts ); -HYPRE_Int hypre_BoomerAMGSetAggTruncFactor ( void *data , HYPRE_Real agg_trunc_factor ); -HYPRE_Int hypre_BoomerAMGSetMultAddTruncFactor ( void *data , HYPRE_Real add_trunc_factor ); -HYPRE_Int hypre_BoomerAMGSetAggP12TruncFactor ( void *data , HYPRE_Real agg_P12_trunc_factor ); -HYPRE_Int hypre_BoomerAMGSetNumCRRelaxSteps ( void *data , HYPRE_Int num_CR_relax_steps ); -HYPRE_Int hypre_BoomerAMGSetCRRate ( void *data , HYPRE_Real CR_rate ); -HYPRE_Int hypre_BoomerAMGSetCRStrongTh ( void *data , HYPRE_Real CR_strong_th ); +HYPRE_Int hypre_BoomerAMGSetNumFunctions ( void *data, HYPRE_Int num_functions ); +HYPRE_Int hypre_BoomerAMGGetNumFunctions ( void *data, HYPRE_Int *num_functions ); +HYPRE_Int hypre_BoomerAMGSetFilterFunctions ( void *data, HYPRE_Int filter_functions ); +HYPRE_Int hypre_BoomerAMGGetFilterFunctions ( void *data, HYPRE_Int *filter_functions ); +HYPRE_Int hypre_BoomerAMGSetNodal ( void *data, HYPRE_Int nodal ); +HYPRE_Int hypre_BoomerAMGSetNodalLevels ( void *data, HYPRE_Int nodal_levels ); +HYPRE_Int hypre_BoomerAMGSetNodalDiag ( void *data, HYPRE_Int nodal ); +HYPRE_Int hypre_BoomerAMGSetKeepSameSign ( void *data, HYPRE_Int keep_same_sign ); +HYPRE_Int hypre_BoomerAMGSetNumPaths ( void *data, HYPRE_Int num_paths ); +HYPRE_Int hypre_BoomerAMGSetAggNumLevels ( void *data, HYPRE_Int agg_num_levels ); +HYPRE_Int hypre_BoomerAMGSetAggInterpType ( void *data, HYPRE_Int agg_interp_type ); +HYPRE_Int hypre_BoomerAMGSetAggPMaxElmts ( void *data, HYPRE_Int agg_P_max_elmts ); +HYPRE_Int hypre_BoomerAMGSetMultAddPMaxElmts ( void *data, HYPRE_Int add_P_max_elmts ); +HYPRE_Int hypre_BoomerAMGSetAddRelaxType ( void *data, HYPRE_Int add_rlx_type ); +HYPRE_Int hypre_BoomerAMGSetAddRelaxWt ( void *data, HYPRE_Real add_rlx_wt ); +HYPRE_Int hypre_BoomerAMGSetAggP12MaxElmts ( void *data, HYPRE_Int agg_P12_max_elmts ); +HYPRE_Int hypre_BoomerAMGSetAggTruncFactor ( void *data, HYPRE_Real agg_trunc_factor ); +HYPRE_Int hypre_BoomerAMGSetMultAddTruncFactor ( void *data, HYPRE_Real add_trunc_factor ); +HYPRE_Int hypre_BoomerAMGSetAggP12TruncFactor ( void *data, HYPRE_Real agg_P12_trunc_factor ); +HYPRE_Int hypre_BoomerAMGSetNumCRRelaxSteps ( void *data, HYPRE_Int num_CR_relax_steps ); +HYPRE_Int hypre_BoomerAMGSetCRRate ( void *data, HYPRE_Real CR_rate ); +HYPRE_Int hypre_BoomerAMGSetCRStrongTh ( void *data, HYPRE_Real CR_strong_th ); HYPRE_Int hypre_BoomerAMGSetADropTol( void *data, HYPRE_Real A_drop_tol ); HYPRE_Int hypre_BoomerAMGSetADropType( void *data, HYPRE_Int A_drop_type ); -HYPRE_Int hypre_BoomerAMGSetISType ( void *data , HYPRE_Int IS_type ); -HYPRE_Int hypre_BoomerAMGSetCRUseCG ( void *data , HYPRE_Int CR_use_CG ); -HYPRE_Int hypre_BoomerAMGSetNumPoints ( void *data , HYPRE_Int num_points ); -HYPRE_Int hypre_BoomerAMGSetDofFunc ( void *data , HYPRE_Int *dof_func ); -HYPRE_Int hypre_BoomerAMGSetPointDofMap ( void *data , HYPRE_Int *point_dof_map ); -HYPRE_Int hypre_BoomerAMGSetDofPoint ( void *data , HYPRE_Int *dof_point ); -HYPRE_Int hypre_BoomerAMGGetNumIterations ( void *data , HYPRE_Int *num_iterations ); -HYPRE_Int hypre_BoomerAMGGetCumNumIterations ( void *data , HYPRE_Int *cum_num_iterations ); -HYPRE_Int hypre_BoomerAMGGetResidual ( void *data , hypre_ParVector **resid ); -HYPRE_Int hypre_BoomerAMGGetRelResidualNorm ( void *data , HYPRE_Real *rel_resid_norm ); -HYPRE_Int hypre_BoomerAMGSetVariant ( void *data , HYPRE_Int variant ); -HYPRE_Int hypre_BoomerAMGGetVariant ( void *data , HYPRE_Int *variant ); -HYPRE_Int hypre_BoomerAMGSetOverlap ( void *data , HYPRE_Int overlap ); -HYPRE_Int hypre_BoomerAMGGetOverlap ( void *data , HYPRE_Int *overlap ); -HYPRE_Int hypre_BoomerAMGSetDomainType ( void *data , HYPRE_Int domain_type ); -HYPRE_Int hypre_BoomerAMGGetDomainType ( void *data , HYPRE_Int *domain_type ); -HYPRE_Int hypre_BoomerAMGSetSchwarzRlxWeight ( void *data , HYPRE_Real schwarz_rlx_weight ); -HYPRE_Int hypre_BoomerAMGGetSchwarzRlxWeight ( void *data , HYPRE_Real *schwarz_rlx_weight ); -HYPRE_Int hypre_BoomerAMGSetSchwarzUseNonSymm ( void *data , HYPRE_Int use_nonsymm ); -HYPRE_Int hypre_BoomerAMGSetSym ( void *data , HYPRE_Int sym ); -HYPRE_Int hypre_BoomerAMGSetLevel ( void *data , HYPRE_Int level ); -HYPRE_Int hypre_BoomerAMGSetThreshold ( void *data , HYPRE_Real thresh ); -HYPRE_Int hypre_BoomerAMGSetFilter ( void *data , HYPRE_Real filter ); -HYPRE_Int hypre_BoomerAMGSetDropTol ( void *data , HYPRE_Real drop_tol ); -HYPRE_Int hypre_BoomerAMGSetMaxNzPerRow ( void *data , HYPRE_Int max_nz_per_row ); -HYPRE_Int hypre_BoomerAMGSetEuclidFile ( void *data , char *euclidfile ); -HYPRE_Int hypre_BoomerAMGSetEuLevel ( void *data , HYPRE_Int eu_level ); -HYPRE_Int hypre_BoomerAMGSetEuSparseA ( void *data , HYPRE_Real eu_sparse_A ); -HYPRE_Int hypre_BoomerAMGSetEuBJ ( void *data , HYPRE_Int eu_bj ); -HYPRE_Int hypre_BoomerAMGSetILUType( void *data, HYPRE_Int ilu_type); -HYPRE_Int hypre_BoomerAMGSetILULevel( void *data, HYPRE_Int ilu_lfil); -HYPRE_Int hypre_BoomerAMGSetILUDroptol( void *data, HYPRE_Real ilu_droptol); -HYPRE_Int hypre_BoomerAMGSetILUMaxIter( void *data, HYPRE_Int ilu_max_iter); -HYPRE_Int hypre_BoomerAMGSetILUMaxRowNnz( void *data, HYPRE_Int ilu_max_row_nnz); -HYPRE_Int hypre_BoomerAMGSetILULocalReordering( void *data, HYPRE_Int ilu_reordering_type); -HYPRE_Int hypre_BoomerAMGSetChebyOrder ( void *data , HYPRE_Int order ); -HYPRE_Int hypre_BoomerAMGSetChebyFraction ( void *data , HYPRE_Real ratio ); -HYPRE_Int hypre_BoomerAMGSetChebyEigEst ( void *data , HYPRE_Int eig_est ); -HYPRE_Int hypre_BoomerAMGSetChebyVariant ( void *data , HYPRE_Int variant ); -HYPRE_Int hypre_BoomerAMGSetChebyScale ( void *data , HYPRE_Int scale ); -HYPRE_Int hypre_BoomerAMGSetInterpVectors ( void *solver , HYPRE_Int num_vectors , hypre_ParVector **interp_vectors ); -HYPRE_Int hypre_BoomerAMGSetInterpVecVariant ( void *solver , HYPRE_Int var ); -HYPRE_Int hypre_BoomerAMGSetInterpVecQMax ( void *data , HYPRE_Int q_max ); -HYPRE_Int hypre_BoomerAMGSetInterpVecAbsQTrunc ( void *data , HYPRE_Real q_trunc ); -HYPRE_Int hypre_BoomerAMGSetSmoothInterpVectors ( void *solver , HYPRE_Int smooth_interp_vectors ); -HYPRE_Int hypre_BoomerAMGSetInterpRefine ( void *data , HYPRE_Int num_refine ); -HYPRE_Int hypre_BoomerAMGSetInterpVecFirstLevel ( void *data , HYPRE_Int level ); -HYPRE_Int hypre_BoomerAMGSetAdditive ( void *data , HYPRE_Int additive ); -HYPRE_Int hypre_BoomerAMGGetAdditive ( void *data , HYPRE_Int *additive ); -HYPRE_Int hypre_BoomerAMGSetMultAdditive ( void *data , HYPRE_Int mult_additive ); -HYPRE_Int hypre_BoomerAMGGetMultAdditive ( void *data , HYPRE_Int *mult_additive ); -HYPRE_Int hypre_BoomerAMGSetSimple ( void *data , HYPRE_Int simple ); -HYPRE_Int hypre_BoomerAMGGetSimple ( void *data , HYPRE_Int *simple ); -HYPRE_Int hypre_BoomerAMGSetAddLastLvl ( void *data , HYPRE_Int add_last_lvl ); -HYPRE_Int hypre_BoomerAMGSetNonGalerkinTol ( void *data , HYPRE_Real nongalerkin_tol ); -HYPRE_Int hypre_BoomerAMGSetLevelNonGalerkinTol ( void *data , HYPRE_Real nongalerkin_tol , HYPRE_Int level ); -HYPRE_Int hypre_BoomerAMGSetNonGalerkTol ( void *data , HYPRE_Int nongalerk_num_tol , HYPRE_Real *nongalerk_tol ); -HYPRE_Int hypre_BoomerAMGSetRAP2 ( void *data , HYPRE_Int rap2 ); -HYPRE_Int hypre_BoomerAMGSetModuleRAP2 ( void *data , HYPRE_Int mod_rap2 ); -HYPRE_Int hypre_BoomerAMGSetKeepTranspose ( void *data , HYPRE_Int keepTranspose ); +HYPRE_Int hypre_BoomerAMGSetISType ( void *data, HYPRE_Int IS_type ); +HYPRE_Int hypre_BoomerAMGSetCRUseCG ( void *data, HYPRE_Int CR_use_CG ); +HYPRE_Int hypre_BoomerAMGSetNumPoints ( void *data, HYPRE_Int num_points ); +HYPRE_Int hypre_BoomerAMGSetDofFunc ( void *data, HYPRE_Int *dof_func ); +HYPRE_Int hypre_BoomerAMGSetPointDofMap ( void *data, HYPRE_Int *point_dof_map ); +HYPRE_Int hypre_BoomerAMGSetDofPoint ( void *data, HYPRE_Int *dof_point ); +HYPRE_Int hypre_BoomerAMGGetNumIterations ( void *data, HYPRE_Int *num_iterations ); +HYPRE_Int hypre_BoomerAMGGetCumNumIterations ( void *data, HYPRE_Int *cum_num_iterations ); +HYPRE_Int hypre_BoomerAMGGetResidual ( void *data, hypre_ParVector **resid ); +HYPRE_Int hypre_BoomerAMGGetRelResidualNorm ( void *data, HYPRE_Real *rel_resid_norm ); +HYPRE_Int hypre_BoomerAMGSetVariant ( void *data, HYPRE_Int variant ); +HYPRE_Int hypre_BoomerAMGGetVariant ( void *data, HYPRE_Int *variant ); +HYPRE_Int hypre_BoomerAMGSetOverlap ( void *data, HYPRE_Int overlap ); +HYPRE_Int hypre_BoomerAMGGetOverlap ( void *data, HYPRE_Int *overlap ); +HYPRE_Int hypre_BoomerAMGSetDomainType ( void *data, HYPRE_Int domain_type ); +HYPRE_Int hypre_BoomerAMGGetDomainType ( void *data, HYPRE_Int *domain_type ); +HYPRE_Int hypre_BoomerAMGSetSchwarzRlxWeight ( void *data, HYPRE_Real schwarz_rlx_weight ); +HYPRE_Int hypre_BoomerAMGGetSchwarzRlxWeight ( void *data, HYPRE_Real *schwarz_rlx_weight ); +HYPRE_Int hypre_BoomerAMGSetSchwarzUseNonSymm ( void *data, HYPRE_Int use_nonsymm ); +HYPRE_Int hypre_BoomerAMGSetSym ( void *data, HYPRE_Int sym ); +HYPRE_Int hypre_BoomerAMGSetLevel ( void *data, HYPRE_Int level ); +HYPRE_Int hypre_BoomerAMGSetThreshold ( void *data, HYPRE_Real thresh ); +HYPRE_Int hypre_BoomerAMGSetFilter ( void *data, HYPRE_Real filter ); +HYPRE_Int hypre_BoomerAMGSetDropTol ( void *data, HYPRE_Real drop_tol ); +HYPRE_Int hypre_BoomerAMGSetMaxNzPerRow ( void *data, HYPRE_Int max_nz_per_row ); +HYPRE_Int hypre_BoomerAMGSetEuclidFile ( void *data, char *euclidfile ); +HYPRE_Int hypre_BoomerAMGSetEuLevel ( void *data, HYPRE_Int eu_level ); +HYPRE_Int hypre_BoomerAMGSetEuSparseA ( void *data, HYPRE_Real eu_sparse_A ); +HYPRE_Int hypre_BoomerAMGSetEuBJ ( void *data, HYPRE_Int eu_bj ); +HYPRE_Int hypre_BoomerAMGSetILUType( void *data, HYPRE_Int ilu_type ); +HYPRE_Int hypre_BoomerAMGSetILULevel( void *data, HYPRE_Int ilu_lfil ); +HYPRE_Int hypre_BoomerAMGSetILUDroptol( void *data, HYPRE_Real ilu_droptol ); +HYPRE_Int hypre_BoomerAMGSetILUTriSolve( void *data, HYPRE_Int ilu_tri_solve ); +HYPRE_Int hypre_BoomerAMGSetILULowerJacobiIters( void *data, HYPRE_Int ilu_lower_jacobi_iters ); +HYPRE_Int hypre_BoomerAMGSetILUUpperJacobiIters( void *data, HYPRE_Int ilu_upper_jacobi_iters ); +HYPRE_Int hypre_BoomerAMGSetILUMaxIter( void *data, HYPRE_Int ilu_max_iter ); +HYPRE_Int hypre_BoomerAMGSetILUMaxRowNnz( void *data, HYPRE_Int ilu_max_row_nnz ); +HYPRE_Int hypre_BoomerAMGSetILULocalReordering( void *data, HYPRE_Int ilu_reordering_type ); +HYPRE_Int hypre_BoomerAMGSetILUIterSetupType( void *data, HYPRE_Int ilu_iter_setup_type ); +HYPRE_Int hypre_BoomerAMGSetILUIterSetupOption( void *data, HYPRE_Int ilu_iter_setup_option ); +HYPRE_Int hypre_BoomerAMGSetILUIterSetupMaxIter( void *data, HYPRE_Int ilu_iter_setup_max_iter ); +HYPRE_Int hypre_BoomerAMGSetILUIterSetupTolerance( void *data, + HYPRE_Real ilu_iter_setup_tolerance ); +HYPRE_Int hypre_BoomerAMGSetFSAIAlgoType ( void *data, HYPRE_Int fsai_algo_type ); +HYPRE_Int hypre_BoomerAMGSetFSAILocalSolveType ( void *data, HYPRE_Int local_solve_type ); +HYPRE_Int hypre_BoomerAMGSetFSAIMaxSteps ( void *data, HYPRE_Int fsai_max_steps ); +HYPRE_Int hypre_BoomerAMGSetFSAIMaxStepSize ( void *data, HYPRE_Int fsai_max_step_size ); +HYPRE_Int hypre_BoomerAMGSetFSAIMaxNnzRow ( void *data, HYPRE_Int fsai_max_nnz_row ); +HYPRE_Int hypre_BoomerAMGSetFSAINumLevels ( void *data, HYPRE_Int fsai_num_levels ); +HYPRE_Int hypre_BoomerAMGSetFSAIEigMaxIters ( void *data, HYPRE_Int fsai_eig_max_iters ); +HYPRE_Int hypre_BoomerAMGSetFSAIThreshold ( void *data, HYPRE_Real fsai_threshold ); +HYPRE_Int hypre_BoomerAMGSetFSAIKapTolerance ( void *data, HYPRE_Real fsai_kap_tolerance ); +HYPRE_Int hypre_BoomerAMGSetChebyOrder ( void *data, HYPRE_Int order ); +HYPRE_Int hypre_BoomerAMGSetChebyFraction ( void *data, HYPRE_Real ratio ); +HYPRE_Int hypre_BoomerAMGSetChebyEigEst ( void *data, HYPRE_Int eig_est ); +HYPRE_Int hypre_BoomerAMGSetChebyVariant ( void *data, HYPRE_Int variant ); +HYPRE_Int hypre_BoomerAMGSetChebyScale ( void *data, HYPRE_Int scale ); +HYPRE_Int hypre_BoomerAMGSetInterpVectors ( void *solver, HYPRE_Int num_vectors, + hypre_ParVector **interp_vectors ); +HYPRE_Int hypre_BoomerAMGSetInterpVecVariant ( void *solver, HYPRE_Int var ); +HYPRE_Int hypre_BoomerAMGSetInterpVecQMax ( void *data, HYPRE_Int q_max ); +HYPRE_Int hypre_BoomerAMGSetInterpVecAbsQTrunc ( void *data, HYPRE_Real q_trunc ); +HYPRE_Int hypre_BoomerAMGSetSmoothInterpVectors ( void *solver, HYPRE_Int smooth_interp_vectors ); +HYPRE_Int hypre_BoomerAMGSetInterpRefine ( void *data, HYPRE_Int num_refine ); +HYPRE_Int hypre_BoomerAMGSetInterpVecFirstLevel ( void *data, HYPRE_Int level ); +HYPRE_Int hypre_BoomerAMGSetAdditive ( void *data, HYPRE_Int additive ); +HYPRE_Int hypre_BoomerAMGGetAdditive ( void *data, HYPRE_Int *additive ); +HYPRE_Int hypre_BoomerAMGSetMultAdditive ( void *data, HYPRE_Int mult_additive ); +HYPRE_Int hypre_BoomerAMGGetMultAdditive ( void *data, HYPRE_Int *mult_additive ); +HYPRE_Int hypre_BoomerAMGSetSimple ( void *data, HYPRE_Int simple ); +HYPRE_Int hypre_BoomerAMGGetSimple ( void *data, HYPRE_Int *simple ); +HYPRE_Int hypre_BoomerAMGSetAddLastLvl ( void *data, HYPRE_Int add_last_lvl ); +HYPRE_Int hypre_BoomerAMGSetNonGalerkinTol ( void *data, HYPRE_Real nongalerkin_tol ); +HYPRE_Int hypre_BoomerAMGSetLevelNonGalerkinTol ( void *data, HYPRE_Real nongalerkin_tol, + HYPRE_Int level ); +HYPRE_Int hypre_BoomerAMGSetNonGalerkTol ( void *data, HYPRE_Int nongalerk_num_tol, + HYPRE_Real *nongalerk_tol ); +HYPRE_Int hypre_BoomerAMGSetRAP2 ( void *data, HYPRE_Int rap2 ); +HYPRE_Int hypre_BoomerAMGSetModuleRAP2 ( void *data, HYPRE_Int mod_rap2 ); +HYPRE_Int hypre_BoomerAMGSetKeepTranspose ( void *data, HYPRE_Int keepTranspose ); #ifdef HYPRE_USING_DSUPERLU -HYPRE_Int hypre_BoomerAMGSetDSLUThreshold ( void *data , HYPRE_Int slu_threshold ); +HYPRE_Int hypre_BoomerAMGSetDSLUThreshold ( void *data, HYPRE_Int slu_threshold ); #endif -HYPRE_Int hypre_BoomerAMGSetCPoints( void *data, HYPRE_Int cpt_coarse_level, HYPRE_Int num_cpt_coarse, HYPRE_BigInt *cpt_coarse_index ); -HYPRE_Int hypre_BoomerAMGSetFPoints( void *data, HYPRE_Int isolated, HYPRE_Int num_points, HYPRE_BigInt *indices ); +HYPRE_Int hypre_BoomerAMGSetCPoints( void *data, HYPRE_Int cpt_coarse_level, + HYPRE_Int num_cpt_coarse, HYPRE_BigInt *cpt_coarse_index ); +HYPRE_Int hypre_BoomerAMGSetFPoints( void *data, HYPRE_Int isolated, HYPRE_Int num_points, + HYPRE_BigInt *indices ); +HYPRE_Int hypre_BoomerAMGSetCumNnzAP ( void *data, HYPRE_Real cum_nnz_AP ); +HYPRE_Int hypre_BoomerAMGGetCumNnzAP ( void *data, HYPRE_Real *cum_nnz_AP ); /* par_amg_setup.c */ -HYPRE_Int hypre_BoomerAMGSetup ( void *amg_vdata , hypre_ParCSRMatrix *A , hypre_ParVector *f , hypre_ParVector *u ); +HYPRE_Int hypre_BoomerAMGSetup ( void *amg_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, + hypre_ParVector *u ); /* par_amg_solve.c */ -HYPRE_Int hypre_BoomerAMGSolve ( void *amg_vdata , hypre_ParCSRMatrix *A , hypre_ParVector *f , hypre_ParVector *u ); +HYPRE_Int hypre_BoomerAMGSolve ( void *amg_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, + hypre_ParVector *u ); /* par_amg_solveT.c */ -HYPRE_Int hypre_BoomerAMGSolveT ( void *amg_vdata , hypre_ParCSRMatrix *A , hypre_ParVector *f , hypre_ParVector *u ); -HYPRE_Int hypre_BoomerAMGCycleT ( void *amg_vdata , hypre_ParVector **F_array , hypre_ParVector **U_array ); -HYPRE_Int hypre_BoomerAMGRelaxT ( hypre_ParCSRMatrix *A , hypre_ParVector *f , HYPRE_Int *cf_marker , HYPRE_Int relax_type , HYPRE_Int relax_points , HYPRE_Real relax_weight , hypre_ParVector *u , hypre_ParVector *Vtemp ); +HYPRE_Int hypre_BoomerAMGSolveT ( void *amg_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, + hypre_ParVector *u ); +HYPRE_Int hypre_BoomerAMGCycleT ( void *amg_vdata, hypre_ParVector **F_array, + hypre_ParVector **U_array ); +HYPRE_Int hypre_BoomerAMGRelaxT ( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, + HYPRE_Int relax_type, HYPRE_Int relax_points, HYPRE_Real relax_weight, hypre_ParVector *u, + hypre_ParVector *Vtemp ); /* par_cgc_coarsen.c */ -HYPRE_Int hypre_BoomerAMGCoarsenCGCb ( hypre_ParCSRMatrix *S , hypre_ParCSRMatrix *A , HYPRE_Int measure_type , HYPRE_Int coarsen_type , HYPRE_Int cgc_its , HYPRE_Int debug_flag , hypre_IntArray **CF_marker_ptr ); -HYPRE_Int hypre_BoomerAMGCoarsenCGC ( hypre_ParCSRMatrix *S , HYPRE_Int numberofgrids , HYPRE_Int coarsen_type , HYPRE_Int *CF_marker ); -HYPRE_Int hypre_AmgCGCPrepare ( hypre_ParCSRMatrix *S , HYPRE_Int nlocal , HYPRE_Int *CF_marker , HYPRE_Int **CF_marker_offd , HYPRE_Int coarsen_type , HYPRE_Int **vrange ); +HYPRE_Int hypre_BoomerAMGCoarsenCGCb ( hypre_ParCSRMatrix *S, hypre_ParCSRMatrix *A, + HYPRE_Int measure_type, HYPRE_Int coarsen_type, HYPRE_Int cgc_its, HYPRE_Int debug_flag, + hypre_IntArray **CF_marker_ptr ); +HYPRE_Int hypre_BoomerAMGCoarsenCGC ( hypre_ParCSRMatrix *S, HYPRE_Int numberofgrids, + HYPRE_Int coarsen_type, HYPRE_Int *CF_marker ); +HYPRE_Int hypre_AmgCGCPrepare ( hypre_ParCSRMatrix *S, HYPRE_Int nlocal, HYPRE_Int *CF_marker, + HYPRE_Int **CF_marker_offd, HYPRE_Int coarsen_type, HYPRE_Int **vrange ); //HYPRE_Int hypre_AmgCGCPrepare ( hypre_ParCSRMatrix *S , HYPRE_Int nlocal , HYPRE_Int *CF_marker , HYPRE_BigInt **CF_marker_offd , HYPRE_Int coarsen_type , HYPRE_BigInt **vrange ); -HYPRE_Int hypre_AmgCGCGraphAssemble ( hypre_ParCSRMatrix *S , HYPRE_Int *vertexrange , HYPRE_Int *CF_marker, HYPRE_Int *CF_marker_offd , HYPRE_Int coarsen_type , HYPRE_IJMatrix *ijG ); -HYPRE_Int hypre_AmgCGCChoose ( hypre_CSRMatrix *G , HYPRE_Int *vertexrange , HYPRE_Int mpisize , HYPRE_Int **coarse ); -HYPRE_Int hypre_AmgCGCBoundaryFix ( hypre_ParCSRMatrix *S , HYPRE_Int *CF_marker , HYPRE_Int *CF_marker_offd ); +HYPRE_Int hypre_AmgCGCGraphAssemble ( hypre_ParCSRMatrix *S, HYPRE_Int *vertexrange, + HYPRE_Int *CF_marker, HYPRE_Int *CF_marker_offd, HYPRE_Int coarsen_type, HYPRE_IJMatrix *ijG ); +HYPRE_Int hypre_AmgCGCChoose ( hypre_CSRMatrix *G, HYPRE_Int *vertexrange, HYPRE_Int mpisize, + HYPRE_Int **coarse ); +HYPRE_Int hypre_AmgCGCBoundaryFix ( hypre_ParCSRMatrix *S, HYPRE_Int *CF_marker, + HYPRE_Int *CF_marker_offd ); /* par_cg_relax_wt.c */ -HYPRE_Int hypre_BoomerAMGCGRelaxWt ( void *amg_vdata , HYPRE_Int level , HYPRE_Int num_cg_sweeps , HYPRE_Real *rlx_wt_ptr ); -HYPRE_Int hypre_Bisection ( HYPRE_Int n , HYPRE_Real *diag , HYPRE_Real *offd , HYPRE_Real y , HYPRE_Real z , HYPRE_Real tol , HYPRE_Int k , HYPRE_Real *ev_ptr ); +HYPRE_Int hypre_BoomerAMGCGRelaxWt ( void *amg_vdata, HYPRE_Int level, HYPRE_Int num_cg_sweeps, + HYPRE_Real *rlx_wt_ptr ); +HYPRE_Int hypre_Bisection ( HYPRE_Int n, HYPRE_Real *diag, HYPRE_Real *offd, HYPRE_Real y, + HYPRE_Real z, HYPRE_Real tol, HYPRE_Int k, HYPRE_Real *ev_ptr ); /* par_cheby.c */ -HYPRE_Int hypre_ParCSRRelax_Cheby_Setup ( hypre_ParCSRMatrix *A , HYPRE_Real max_eig , HYPRE_Real min_eig , HYPRE_Real fraction , HYPRE_Int order , HYPRE_Int scale , HYPRE_Int variant , HYPRE_Real **coefs_ptr , HYPRE_Real **ds_ptr ); -HYPRE_Int hypre_ParCSRRelax_Cheby_Solve ( hypre_ParCSRMatrix *A , hypre_ParVector *f , HYPRE_Real *ds_data , HYPRE_Real *coefs , HYPRE_Int order , HYPRE_Int scale , HYPRE_Int variant , hypre_ParVector *u , hypre_ParVector *v , hypre_ParVector *r , hypre_ParVector *orig_u_vec, hypre_ParVector *tmp_vec); - -HYPRE_Int hypre_ParCSRRelax_Cheby_SolveHost ( hypre_ParCSRMatrix *A , hypre_ParVector *f , HYPRE_Real *ds_data , HYPRE_Real *coefs , HYPRE_Int order , HYPRE_Int scale , HYPRE_Int variant , hypre_ParVector *u , hypre_ParVector *v , hypre_ParVector *r, hypre_ParVector *orig_u_vec, hypre_ParVector *tmp_vec); +HYPRE_Int hypre_ParCSRRelax_Cheby_Setup ( hypre_ParCSRMatrix *A, HYPRE_Real max_eig, + HYPRE_Real min_eig, HYPRE_Real fraction, HYPRE_Int order, HYPRE_Int scale, HYPRE_Int variant, + HYPRE_Real **coefs_ptr, HYPRE_Real **ds_ptr ); +HYPRE_Int hypre_ParCSRRelax_Cheby_Solve ( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Real *ds_data, HYPRE_Real *coefs, HYPRE_Int order, HYPRE_Int scale, HYPRE_Int variant, + hypre_ParVector *u, hypre_ParVector *v, hypre_ParVector *r, hypre_ParVector *orig_u_vec, + hypre_ParVector *tmp_vec); + +HYPRE_Int hypre_ParCSRRelax_Cheby_SolveHost ( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Real *ds_data, HYPRE_Real *coefs, HYPRE_Int order, HYPRE_Int scale, HYPRE_Int variant, + hypre_ParVector *u, hypre_ParVector *v, hypre_ParVector *r, hypre_ParVector *orig_u_vec, + hypre_ParVector *tmp_vec); /* par_cheby_device.c */ -HYPRE_Int hypre_ParCSRRelax_Cheby_SolveDevice ( hypre_ParCSRMatrix *A , hypre_ParVector *f , HYPRE_Real *ds_data , HYPRE_Real *coefs , HYPRE_Int order , HYPRE_Int scale , HYPRE_Int variant , hypre_ParVector *u , hypre_ParVector *v , hypre_ParVector *r, hypre_ParVector *orig_u_vec, hypre_ParVector *tmp_vec); +HYPRE_Int hypre_ParCSRRelax_Cheby_SolveDevice ( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Real *ds_data, HYPRE_Real *coefs, HYPRE_Int order, HYPRE_Int scale, HYPRE_Int variant, + hypre_ParVector *u, hypre_ParVector *v, hypre_ParVector *r, hypre_ParVector *orig_u_vec, + hypre_ParVector *tmp_vec); /* par_coarsen.c */ -HYPRE_Int hypre_BoomerAMGCoarsen ( hypre_ParCSRMatrix *S , hypre_ParCSRMatrix *A , HYPRE_Int CF_init , HYPRE_Int debug_flag , hypre_IntArray **CF_marker_ptr ); -HYPRE_Int hypre_BoomerAMGCoarsenRuge ( hypre_ParCSRMatrix *S , hypre_ParCSRMatrix *A , HYPRE_Int measure_type , HYPRE_Int coarsen_type , HYPRE_Int cut_factor , HYPRE_Int debug_flag , hypre_IntArray **CF_marker_ptr ); -HYPRE_Int hypre_BoomerAMGCoarsenFalgout ( hypre_ParCSRMatrix *S , hypre_ParCSRMatrix *A , HYPRE_Int measure_type , HYPRE_Int cut_factor , HYPRE_Int debug_flag , hypre_IntArray **CF_marker_ptr ); -HYPRE_Int hypre_BoomerAMGCoarsenHMIS ( hypre_ParCSRMatrix *S , hypre_ParCSRMatrix *A , HYPRE_Int measure_type , HYPRE_Int cut_factor , HYPRE_Int debug_flag , hypre_IntArray **CF_marker_ptr ); -HYPRE_Int hypre_BoomerAMGCoarsenPMIS ( hypre_ParCSRMatrix *S , hypre_ParCSRMatrix *A , HYPRE_Int CF_init , HYPRE_Int debug_flag , hypre_IntArray **CF_marker_ptr ); -HYPRE_Int hypre_BoomerAMGCoarsenPMISHost ( hypre_ParCSRMatrix *S , hypre_ParCSRMatrix *A , HYPRE_Int CF_init , HYPRE_Int debug_flag , hypre_IntArray **CF_marker_ptr ); - -HYPRE_Int hypre_BoomerAMGCoarsenPMISDevice( hypre_ParCSRMatrix *S, hypre_ParCSRMatrix *A, HYPRE_Int CF_init, HYPRE_Int debug_flag, hypre_IntArray **CF_marker_ptr ); +HYPRE_Int hypre_BoomerAMGCoarsen ( hypre_ParCSRMatrix *S, hypre_ParCSRMatrix *A, HYPRE_Int CF_init, + HYPRE_Int debug_flag, hypre_IntArray **CF_marker_ptr ); +HYPRE_Int hypre_BoomerAMGCoarsenRuge ( hypre_ParCSRMatrix *S, hypre_ParCSRMatrix *A, + HYPRE_Int measure_type, HYPRE_Int coarsen_type, HYPRE_Int cut_factor, HYPRE_Int debug_flag, + hypre_IntArray **CF_marker_ptr ); +HYPRE_Int hypre_BoomerAMGCoarsenFalgout ( hypre_ParCSRMatrix *S, hypre_ParCSRMatrix *A, + HYPRE_Int measure_type, HYPRE_Int cut_factor, HYPRE_Int debug_flag, + hypre_IntArray **CF_marker_ptr ); +HYPRE_Int hypre_BoomerAMGCoarsenHMIS ( hypre_ParCSRMatrix *S, hypre_ParCSRMatrix *A, + HYPRE_Int measure_type, HYPRE_Int cut_factor, HYPRE_Int debug_flag, + hypre_IntArray **CF_marker_ptr ); +HYPRE_Int hypre_BoomerAMGCoarsenPMIS ( hypre_ParCSRMatrix *S, hypre_ParCSRMatrix *A, + HYPRE_Int CF_init, HYPRE_Int debug_flag, hypre_IntArray **CF_marker_ptr ); +HYPRE_Int hypre_BoomerAMGCoarsenPMISHost ( hypre_ParCSRMatrix *S, hypre_ParCSRMatrix *A, + HYPRE_Int CF_init, HYPRE_Int debug_flag, hypre_IntArray **CF_marker_ptr ); + +HYPRE_Int hypre_BoomerAMGCoarsenPMISDevice( hypre_ParCSRMatrix *S, hypre_ParCSRMatrix *A, + HYPRE_Int CF_init, HYPRE_Int debug_flag, hypre_IntArray **CF_marker_ptr ); /* par_coarsen_device.c */ -HYPRE_Int hypre_GetGlobalMeasureDevice( hypre_ParCSRMatrix *S, hypre_ParCSRCommPkg *comm_pkg, HYPRE_Int CF_init, HYPRE_Int aug_rand, HYPRE_Real *measure_diag, HYPRE_Real *measure_offd, HYPRE_Real *real_send_buf ); +HYPRE_Int hypre_GetGlobalMeasureDevice( hypre_ParCSRMatrix *S, hypre_ParCSRCommPkg *comm_pkg, + HYPRE_Int CF_init, HYPRE_Int aug_rand, HYPRE_Real *measure_diag, HYPRE_Real *measure_offd, + HYPRE_Real *real_send_buf ); /* par_coarse_parms.c */ -HYPRE_Int hypre_BoomerAMGCoarseParms ( MPI_Comm comm , HYPRE_Int local_num_variables , HYPRE_Int num_functions , hypre_IntArray *dof_func , hypre_IntArray *CF_marker , hypre_IntArray **coarse_dof_func_ptr , HYPRE_BigInt **coarse_pnts_global_ptr ); -HYPRE_Int hypre_BoomerAMGCoarseParmsHost ( MPI_Comm comm , HYPRE_Int local_num_variables , HYPRE_Int num_functions , hypre_IntArray *dof_func , hypre_IntArray *CF_marker , hypre_IntArray **coarse_dof_func_ptr , HYPRE_BigInt **coarse_pnts_global_ptr ); -HYPRE_Int hypre_BoomerAMGCoarseParmsDevice ( MPI_Comm comm , HYPRE_Int local_num_variables , HYPRE_Int num_functions , hypre_IntArray *dof_func , hypre_IntArray *CF_marker , hypre_IntArray **coarse_dof_func_ptr , HYPRE_BigInt **coarse_pnts_global_ptr ); -HYPRE_Int hypre_BoomerAMGInitDofFuncDevice( HYPRE_Int *dof_func, HYPRE_Int local_size, HYPRE_Int offset, HYPRE_Int num_functions ); +HYPRE_Int hypre_BoomerAMGCoarseParms ( MPI_Comm comm, HYPRE_Int local_num_variables, + HYPRE_Int num_functions, hypre_IntArray *dof_func, hypre_IntArray *CF_marker, + hypre_IntArray **coarse_dof_func_ptr, HYPRE_BigInt *coarse_pnts_global ); +HYPRE_Int hypre_BoomerAMGCoarseParmsHost ( MPI_Comm comm, HYPRE_Int local_num_variables, + HYPRE_Int num_functions, hypre_IntArray *dof_func, hypre_IntArray *CF_marker, + hypre_IntArray **coarse_dof_func_ptr, HYPRE_BigInt *coarse_pnts_global ); +HYPRE_Int hypre_BoomerAMGCoarseParmsDevice ( MPI_Comm comm, HYPRE_Int local_num_variables, + HYPRE_Int num_functions, hypre_IntArray *dof_func, hypre_IntArray *CF_marker, + hypre_IntArray **coarse_dof_func_ptr, HYPRE_BigInt *coarse_pnts_global ); +HYPRE_Int hypre_BoomerAMGInitDofFuncDevice( HYPRE_Int *dof_func, HYPRE_Int local_size, + HYPRE_Int offset, HYPRE_Int num_functions ); /* par_coordinates.c */ -float *GenerateCoordinates ( MPI_Comm comm , HYPRE_BigInt nx , HYPRE_BigInt ny , HYPRE_BigInt nz , HYPRE_Int P , HYPRE_Int Q , HYPRE_Int R , HYPRE_Int p , HYPRE_Int q , HYPRE_Int r , HYPRE_Int coorddim ); +float *hypre_GenerateCoordinates ( MPI_Comm comm, HYPRE_BigInt nx, HYPRE_BigInt ny, + HYPRE_BigInt nz, HYPRE_Int P, HYPRE_Int Q, HYPRE_Int R, + HYPRE_Int p, HYPRE_Int q, HYPRE_Int r, HYPRE_Int coorddim ); /* par_cr.c */ -HYPRE_Int hypre_BoomerAMGCoarsenCR1 ( hypre_ParCSRMatrix *A , hypre_IntArray **CF_marker_ptr , HYPRE_BigInt *coarse_size_ptr , HYPRE_Int num_CR_relax_steps , HYPRE_Int IS_type , HYPRE_Int CRaddCpoints ); -HYPRE_Int hypre_cr ( HYPRE_Int *A_i , HYPRE_Int *A_j , HYPRE_Real *A_data , HYPRE_Int n , HYPRE_Int *cf , HYPRE_Int rlx , HYPRE_Real omega , HYPRE_Real tg , HYPRE_Int mu ); -HYPRE_Int hypre_GraphAdd ( Link *list , HYPRE_Int *head , HYPRE_Int *tail , HYPRE_Int index , HYPRE_Int istack ); -HYPRE_Int hypre_GraphRemove ( Link *list , HYPRE_Int *head , HYPRE_Int *tail , HYPRE_Int index ); -HYPRE_Int hypre_IndepSetGreedy ( HYPRE_Int *A_i , HYPRE_Int *A_j , HYPRE_Int n , HYPRE_Int *cf ); -HYPRE_Int hypre_IndepSetGreedyS ( HYPRE_Int *A_i , HYPRE_Int *A_j , HYPRE_Int n , HYPRE_Int *cf ); -HYPRE_Int hypre_fptjaccr ( HYPRE_Int *cf , HYPRE_Int *A_i , HYPRE_Int *A_j , HYPRE_Real *A_data , HYPRE_Int n , HYPRE_Real *e0 , HYPRE_Real omega , HYPRE_Real *e1 ); -HYPRE_Int hypre_fptgscr ( HYPRE_Int *cf , HYPRE_Int *A_i , HYPRE_Int *A_j , HYPRE_Real *A_data , HYPRE_Int n , HYPRE_Real *e0 , HYPRE_Real *e1 ); -HYPRE_Int hypre_formu ( HYPRE_Int *cf , HYPRE_Int n , HYPRE_Real *e1 , HYPRE_Int *A_i , HYPRE_Real rho ); -HYPRE_Int hypre_BoomerAMGIndepRS ( hypre_ParCSRMatrix *S , HYPRE_Int measure_type , HYPRE_Int debug_flag , HYPRE_Int *CF_marker ); -HYPRE_Int hypre_BoomerAMGIndepRSa ( hypre_ParCSRMatrix *S , HYPRE_Int measure_type , HYPRE_Int debug_flag , HYPRE_Int *CF_marker ); -HYPRE_Int hypre_BoomerAMGIndepHMIS ( hypre_ParCSRMatrix *S , HYPRE_Int measure_type , HYPRE_Int debug_flag , HYPRE_Int *CF_marker ); -HYPRE_Int hypre_BoomerAMGIndepHMISa ( hypre_ParCSRMatrix *S , HYPRE_Int measure_type , HYPRE_Int debug_flag , HYPRE_Int *CF_marker ); -HYPRE_Int hypre_BoomerAMGIndepPMIS ( hypre_ParCSRMatrix *S , HYPRE_Int CF_init , HYPRE_Int debug_flag , HYPRE_Int *CF_marker ); -HYPRE_Int hypre_BoomerAMGIndepPMISa ( hypre_ParCSRMatrix *S , HYPRE_Int CF_init , HYPRE_Int debug_flag , HYPRE_Int *CF_marker ); -HYPRE_Int hypre_BoomerAMGCoarsenCR ( hypre_ParCSRMatrix *A , hypre_IntArray **CF_marker_ptr , HYPRE_BigInt *coarse_size_ptr , HYPRE_Int num_CR_relax_steps , HYPRE_Int IS_type , HYPRE_Int num_functions , HYPRE_Int rlx_type , HYPRE_Real relax_weight , HYPRE_Real omega , HYPRE_Real theta , HYPRE_Solver smoother , hypre_ParCSRMatrix *AN , HYPRE_Int useCG , hypre_ParCSRMatrix *S ); +HYPRE_Int hypre_BoomerAMGCoarsenCR1 ( hypre_ParCSRMatrix *A, hypre_IntArray **CF_marker_ptr, + HYPRE_BigInt *coarse_size_ptr, HYPRE_Int num_CR_relax_steps, HYPRE_Int IS_type, + HYPRE_Int CRaddCpoints ); +HYPRE_Int hypre_cr ( HYPRE_Int *A_i, HYPRE_Int *A_j, HYPRE_Real *A_data, HYPRE_Int n, HYPRE_Int *cf, + HYPRE_Int rlx, HYPRE_Real omega, HYPRE_Real tg, HYPRE_Int mu ); +HYPRE_Int hypre_GraphAdd ( Link *list, HYPRE_Int *head, HYPRE_Int *tail, HYPRE_Int index, + HYPRE_Int istack ); +HYPRE_Int hypre_GraphRemove ( Link *list, HYPRE_Int *head, HYPRE_Int *tail, HYPRE_Int index ); +HYPRE_Int hypre_IndepSetGreedy ( HYPRE_Int *A_i, HYPRE_Int *A_j, HYPRE_Int n, HYPRE_Int *cf ); +HYPRE_Int hypre_IndepSetGreedyS ( HYPRE_Int *A_i, HYPRE_Int *A_j, HYPRE_Int n, HYPRE_Int *cf ); +HYPRE_Int hypre_fptjaccr ( HYPRE_Int *cf, HYPRE_Int *A_i, HYPRE_Int *A_j, HYPRE_Real *A_data, + HYPRE_Int n, HYPRE_Real *e0, HYPRE_Real omega, HYPRE_Real *e1 ); +HYPRE_Int hypre_fptgscr ( HYPRE_Int *cf, HYPRE_Int *A_i, HYPRE_Int *A_j, HYPRE_Real *A_data, + HYPRE_Int n, HYPRE_Real *e0, HYPRE_Real *e1 ); +HYPRE_Int hypre_formu ( HYPRE_Int *cf, HYPRE_Int n, HYPRE_Real *e1, HYPRE_Int *A_i, + HYPRE_Real rho ); +HYPRE_Int hypre_BoomerAMGIndepRS ( hypre_ParCSRMatrix *S, HYPRE_Int measure_type, + HYPRE_Int debug_flag, HYPRE_Int *CF_marker ); +HYPRE_Int hypre_BoomerAMGIndepRSa ( hypre_ParCSRMatrix *S, HYPRE_Int measure_type, + HYPRE_Int debug_flag, HYPRE_Int *CF_marker ); +HYPRE_Int hypre_BoomerAMGIndepHMIS ( hypre_ParCSRMatrix *S, HYPRE_Int measure_type, + HYPRE_Int debug_flag, HYPRE_Int *CF_marker ); +HYPRE_Int hypre_BoomerAMGIndepHMISa ( hypre_ParCSRMatrix *S, HYPRE_Int measure_type, + HYPRE_Int debug_flag, HYPRE_Int *CF_marker ); +HYPRE_Int hypre_BoomerAMGIndepPMIS ( hypre_ParCSRMatrix *S, HYPRE_Int CF_init, HYPRE_Int debug_flag, + HYPRE_Int *CF_marker ); +HYPRE_Int hypre_BoomerAMGIndepPMISa ( hypre_ParCSRMatrix *S, HYPRE_Int CF_init, + HYPRE_Int debug_flag, HYPRE_Int *CF_marker ); +HYPRE_Int hypre_BoomerAMGCoarsenCR ( hypre_ParCSRMatrix *A, hypre_IntArray **CF_marker_ptr, + HYPRE_BigInt *coarse_size_ptr, HYPRE_Int num_CR_relax_steps, HYPRE_Int IS_type, + HYPRE_Int num_functions, HYPRE_Int rlx_type, HYPRE_Real relax_weight, HYPRE_Real omega, + HYPRE_Real theta, HYPRE_Solver smoother, hypre_ParCSRMatrix *AN, HYPRE_Int useCG, + hypre_ParCSRMatrix *S ); /* par_cycle.c */ -HYPRE_Int hypre_BoomerAMGCycle ( void *amg_vdata , hypre_ParVector **F_array , hypre_ParVector **U_array ); +HYPRE_Int hypre_BoomerAMGCycle ( void *amg_vdata, hypre_ParVector **F_array, + hypre_ParVector **U_array ); /* par_difconv.c */ -HYPRE_ParCSRMatrix GenerateDifConv ( MPI_Comm comm , HYPRE_BigInt nx , HYPRE_BigInt ny , HYPRE_BigInt nz , HYPRE_Int P , HYPRE_Int Q , HYPRE_Int R , HYPRE_Int p , HYPRE_Int q , HYPRE_Int r , HYPRE_Real *value ); +HYPRE_ParCSRMatrix GenerateDifConv ( MPI_Comm comm, HYPRE_BigInt nx, HYPRE_BigInt ny, + HYPRE_BigInt nz, HYPRE_Int P, HYPRE_Int Q, HYPRE_Int R, HYPRE_Int p, HYPRE_Int q, HYPRE_Int r, + HYPRE_Real *value ); /* par_gsmg.c */ -HYPRE_Int hypre_ParCSRMatrixFillSmooth ( HYPRE_Int nsamples , HYPRE_Real *samples , hypre_ParCSRMatrix *S , hypre_ParCSRMatrix *A , HYPRE_Int num_functions , HYPRE_Int *dof_func ); +HYPRE_Int hypre_ParCSRMatrixFillSmooth ( HYPRE_Int nsamples, HYPRE_Real *samples, + hypre_ParCSRMatrix *S, hypre_ParCSRMatrix *A, HYPRE_Int num_functions, HYPRE_Int *dof_func ); HYPRE_Real hypre_ParCSRMatrixChooseThresh ( hypre_ParCSRMatrix *S ); -HYPRE_Int hypre_ParCSRMatrixThreshold ( hypre_ParCSRMatrix *A , HYPRE_Real thresh ); -HYPRE_Int hypre_BoomerAMGCreateSmoothVecs ( void *data , hypre_ParCSRMatrix *A , HYPRE_Int num_sweeps , HYPRE_Int level , HYPRE_Real **SmoothVecs_p ); -HYPRE_Int hypre_BoomerAMGCreateSmoothDirs ( void *data , hypre_ParCSRMatrix *A , HYPRE_Real *SmoothVecs , HYPRE_Real thresh , HYPRE_Int num_functions , HYPRE_Int *dof_func , hypre_ParCSRMatrix **S_ptr ); -HYPRE_Int hypre_BoomerAMGNormalizeVecs ( HYPRE_Int n , HYPRE_Int num , HYPRE_Real *V ); -HYPRE_Int hypre_BoomerAMGFitVectors ( HYPRE_Int ip , HYPRE_Int n , HYPRE_Int num , const HYPRE_Real *V , HYPRE_Int nc , const HYPRE_Int *ind , HYPRE_Real *val ); -HYPRE_Int hypre_BoomerAMGBuildInterpLS ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int num_smooth , HYPRE_Real *SmoothVecs , hypre_ParCSRMatrix **P_ptr ); -HYPRE_Int hypre_BoomerAMGBuildInterpGSMG ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_ParCSRMatrixThreshold ( hypre_ParCSRMatrix *A, HYPRE_Real thresh ); +HYPRE_Int hypre_BoomerAMGCreateSmoothVecs ( void *data, hypre_ParCSRMatrix *A, HYPRE_Int num_sweeps, + HYPRE_Int level, HYPRE_Real **SmoothVecs_p ); +HYPRE_Int hypre_BoomerAMGCreateSmoothDirs ( void *data, hypre_ParCSRMatrix *A, + HYPRE_Real *SmoothVecs, HYPRE_Real thresh, HYPRE_Int num_functions, HYPRE_Int *dof_func, + hypre_ParCSRMatrix **S_ptr ); +HYPRE_Int hypre_BoomerAMGNormalizeVecs ( HYPRE_Int n, HYPRE_Int num, HYPRE_Real *V ); +HYPRE_Int hypre_BoomerAMGFitVectors ( HYPRE_Int ip, HYPRE_Int n, HYPRE_Int num, const HYPRE_Real *V, + HYPRE_Int nc, const HYPRE_Int *ind, HYPRE_Real *val ); +HYPRE_Int hypre_BoomerAMGBuildInterpLS ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int num_smooth, HYPRE_Real *SmoothVecs, + hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGBuildInterpGSMG ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, HYPRE_Real trunc_factor, hypre_ParCSRMatrix **P_ptr ); /* par_indepset.c */ -HYPRE_Int hypre_BoomerAMGIndepSetInit ( hypre_ParCSRMatrix *S , HYPRE_Real *measure_array , HYPRE_Int seq_rand ); -HYPRE_Int hypre_BoomerAMGIndepSet ( hypre_ParCSRMatrix *S , HYPRE_Real *measure_array , HYPRE_Int *graph_array , HYPRE_Int graph_array_size , HYPRE_Int *graph_array_offd , HYPRE_Int graph_array_offd_size , HYPRE_Int *IS_marker , HYPRE_Int *IS_marker_offd ); +HYPRE_Int hypre_BoomerAMGIndepSetInit ( hypre_ParCSRMatrix *S, HYPRE_Real *measure_array, + HYPRE_Int seq_rand ); +HYPRE_Int hypre_BoomerAMGIndepSet ( hypre_ParCSRMatrix *S, HYPRE_Real *measure_array, + HYPRE_Int *graph_array, HYPRE_Int graph_array_size, HYPRE_Int *graph_array_offd, + HYPRE_Int graph_array_offd_size, HYPRE_Int *IS_marker, HYPRE_Int *IS_marker_offd ); -HYPRE_Int hypre_BoomerAMGIndepSetInitDevice( hypre_ParCSRMatrix *S, HYPRE_Real *measure_array, HYPRE_Int aug_rand); +HYPRE_Int hypre_BoomerAMGIndepSetInitDevice( hypre_ParCSRMatrix *S, HYPRE_Real *measure_array, + HYPRE_Int aug_rand); -HYPRE_Int hypre_BoomerAMGIndepSetDevice( hypre_ParCSRMatrix *S, HYPRE_Real *measure_diag, HYPRE_Real *measure_offd, HYPRE_Int graph_diag_size, HYPRE_Int *graph_diag, HYPRE_Int *IS_marker_diag, HYPRE_Int *IS_marker_offd, hypre_ParCSRCommPkg *comm_pkg, HYPRE_Int *int_send_buf ); +HYPRE_Int hypre_BoomerAMGIndepSetDevice( hypre_ParCSRMatrix *S, HYPRE_Real *measure_diag, + HYPRE_Real *measure_offd, HYPRE_Int graph_diag_size, HYPRE_Int *graph_diag, + HYPRE_Int *IS_marker_diag, HYPRE_Int *IS_marker_offd, hypre_ParCSRCommPkg *comm_pkg, + HYPRE_Int *int_send_buf ); /* par_interp.c */ -HYPRE_Int hypre_BoomerAMGBuildInterp ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int max_elmts , hypre_ParCSRMatrix **P_ptr ); -HYPRE_Int hypre_BoomerAMGBuildInterpHE ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int max_elmts , hypre_ParCSRMatrix **P_ptr ); -HYPRE_Int hypre_BoomerAMGBuildDirInterp ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int max_elmts , HYPRE_Int interp_type, hypre_ParCSRMatrix **P_ptr ); -HYPRE_Int hypre_BoomerAMGBuildDirInterpDevice( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int max_elmts , HYPRE_Int interp_type, hypre_ParCSRMatrix **P_ptr ); - -HYPRE_Int hypre_BoomerAMGInterpTruncation ( hypre_ParCSRMatrix *P, HYPRE_Real trunc_factor, HYPRE_Int max_elmts ); -HYPRE_Int hypre_BoomerAMGInterpTruncationDevice( hypre_ParCSRMatrix *P, HYPRE_Real trunc_factor, HYPRE_Int max_elmts ); - -HYPRE_Int hypre_BoomerAMGBuildInterpModUnk ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int max_elmts , hypre_ParCSRMatrix **P_ptr ); -HYPRE_Int hypre_BoomerAMGTruncandBuild ( hypre_ParCSRMatrix *P , HYPRE_Real trunc_factor , HYPRE_Int max_elmts ); -hypre_ParCSRMatrix *hypre_CreateC ( hypre_ParCSRMatrix *A , HYPRE_Real w ); - -HYPRE_Int hypre_BoomerAMGBuildInterpOnePntHost( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int debug_flag, hypre_ParCSRMatrix **P_ptr); -HYPRE_Int hypre_BoomerAMGBuildInterpOnePntDevice( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int debug_flag, hypre_ParCSRMatrix **P_ptr); -HYPRE_Int hypre_BoomerAMGBuildInterpOnePnt( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int debug_flag, hypre_ParCSRMatrix **P_ptr); +HYPRE_Int hypre_BoomerAMGBuildInterp ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGBuildInterpHE ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGBuildDirInterp ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int max_elmts, HYPRE_Int interp_type, + hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGBuildDirInterpDevice( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int max_elmts, HYPRE_Int interp_type, + hypre_ParCSRMatrix **P_ptr ); + +HYPRE_Int hypre_BoomerAMGInterpTruncation ( hypre_ParCSRMatrix *P, HYPRE_Real trunc_factor, + HYPRE_Int max_elmts ); +HYPRE_Int hypre_BoomerAMGInterpTruncationDevice( hypre_ParCSRMatrix *P, HYPRE_Real trunc_factor, + HYPRE_Int max_elmts ); + +HYPRE_Int hypre_BoomerAMGBuildInterpModUnk ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGTruncandBuild ( hypre_ParCSRMatrix *P, HYPRE_Real trunc_factor, + HYPRE_Int max_elmts ); +hypre_ParCSRMatrix *hypre_CreateC ( hypre_ParCSRMatrix *A, HYPRE_Real w ); + +HYPRE_Int hypre_BoomerAMGBuildInterpOnePntHost( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, hypre_ParCSRMatrix **P_ptr); +HYPRE_Int hypre_BoomerAMGBuildInterpOnePntDevice( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, hypre_ParCSRMatrix **P_ptr); +HYPRE_Int hypre_BoomerAMGBuildInterpOnePnt( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, hypre_ParCSRMatrix **P_ptr); /* par_jacobi_interp.c */ -void hypre_BoomerAMGJacobiInterp ( hypre_ParCSRMatrix *A , hypre_ParCSRMatrix **P , hypre_ParCSRMatrix *S , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int *CF_marker , HYPRE_Int level , HYPRE_Real truncation_threshold , HYPRE_Real truncation_threshold_minus ); -void hypre_BoomerAMGJacobiInterp_1 ( hypre_ParCSRMatrix *A , hypre_ParCSRMatrix **P , hypre_ParCSRMatrix *S , HYPRE_Int *CF_marker , HYPRE_Int level , HYPRE_Real truncation_threshold , HYPRE_Real truncation_threshold_minus , HYPRE_Int *dof_func , HYPRE_Int *dof_func_offd , HYPRE_Real weight_AF ); -void hypre_BoomerAMGTruncateInterp ( hypre_ParCSRMatrix *P , HYPRE_Real eps , HYPRE_Real dlt , HYPRE_Int *CF_marker ); -HYPRE_Int hypre_ParCSRMatrix_dof_func_offd ( hypre_ParCSRMatrix *A , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int **dof_func_offd ); +void hypre_BoomerAMGJacobiInterp ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **P, + hypre_ParCSRMatrix *S, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int *CF_marker, + HYPRE_Int level, HYPRE_Real truncation_threshold, HYPRE_Real truncation_threshold_minus ); +void hypre_BoomerAMGJacobiInterp_1 ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **P, + hypre_ParCSRMatrix *S, HYPRE_Int *CF_marker, HYPRE_Int level, HYPRE_Real truncation_threshold, + HYPRE_Real truncation_threshold_minus, HYPRE_Int *dof_func, HYPRE_Int *dof_func_offd, + HYPRE_Real weight_AF ); +void hypre_BoomerAMGTruncateInterp ( hypre_ParCSRMatrix *P, HYPRE_Real eps, HYPRE_Real dlt, + HYPRE_Int *CF_marker ); +HYPRE_Int hypre_ParCSRMatrix_dof_func_offd ( hypre_ParCSRMatrix *A, HYPRE_Int num_functions, + HYPRE_Int *dof_func, HYPRE_Int **dof_func_offd ); /* par_laplace_27pt.c */ -HYPRE_ParCSRMatrix GenerateLaplacian27pt ( MPI_Comm comm , HYPRE_BigInt nx , HYPRE_BigInt ny , HYPRE_BigInt nz , HYPRE_Int P , HYPRE_Int Q , HYPRE_Int R , HYPRE_Int p , HYPRE_Int q , HYPRE_Int r , HYPRE_Real *value ); -HYPRE_Int hypre_map3 ( HYPRE_BigInt ix , HYPRE_BigInt iy , HYPRE_BigInt iz , HYPRE_Int p , HYPRE_Int q , HYPRE_Int r , HYPRE_Int P , HYPRE_Int Q , HYPRE_Int R , HYPRE_BigInt *nx_part , HYPRE_BigInt *ny_part , HYPRE_BigInt *nz_part ); +HYPRE_ParCSRMatrix GenerateLaplacian27pt ( MPI_Comm comm, HYPRE_BigInt nx, HYPRE_BigInt ny, + HYPRE_BigInt nz, HYPRE_Int P, HYPRE_Int Q, HYPRE_Int R, HYPRE_Int p, HYPRE_Int q, HYPRE_Int r, + HYPRE_Real *value ); +HYPRE_Int hypre_map3 ( HYPRE_BigInt ix, HYPRE_BigInt iy, HYPRE_BigInt iz, HYPRE_Int p, HYPRE_Int q, + HYPRE_Int r, HYPRE_Int P, HYPRE_Int Q, HYPRE_Int R, HYPRE_BigInt *nx_part, HYPRE_BigInt *ny_part, + HYPRE_BigInt *nz_part ); /* par_laplace_9pt.c */ -HYPRE_ParCSRMatrix GenerateLaplacian9pt ( MPI_Comm comm , HYPRE_BigInt nx , HYPRE_BigInt ny , HYPRE_Int P , HYPRE_Int Q , HYPRE_Int p , HYPRE_Int q , HYPRE_Real *value ); -HYPRE_BigInt hypre_map2 ( HYPRE_BigInt ix , HYPRE_BigInt iy , HYPRE_Int p , HYPRE_Int q , HYPRE_BigInt nx , HYPRE_BigInt *nx_part , HYPRE_BigInt *ny_part ); +HYPRE_ParCSRMatrix GenerateLaplacian9pt ( MPI_Comm comm, HYPRE_BigInt nx, HYPRE_BigInt ny, + HYPRE_Int P, HYPRE_Int Q, HYPRE_Int p, HYPRE_Int q, HYPRE_Real *value ); +HYPRE_BigInt hypre_map2 ( HYPRE_BigInt ix, HYPRE_BigInt iy, HYPRE_Int p, HYPRE_Int q, + HYPRE_BigInt nx, HYPRE_BigInt *nx_part, HYPRE_BigInt *ny_part ); /* par_laplace.c */ -HYPRE_ParCSRMatrix GenerateLaplacian ( MPI_Comm comm , HYPRE_BigInt ix , HYPRE_BigInt ny , HYPRE_BigInt nz , HYPRE_Int P , HYPRE_Int Q , HYPRE_Int R , HYPRE_Int p , HYPRE_Int q , HYPRE_Int r , HYPRE_Real *value ); -HYPRE_BigInt hypre_map ( HYPRE_BigInt ix , HYPRE_BigInt iy , HYPRE_BigInt iz , HYPRE_Int p, HYPRE_Int q, HYPRE_Int r, HYPRE_BigInt nx , HYPRE_BigInt ny, HYPRE_BigInt *nx_part, HYPRE_BigInt *ny_part, HYPRE_BigInt *nz_part ); -HYPRE_ParCSRMatrix GenerateSysLaplacian ( MPI_Comm comm , HYPRE_BigInt nx , HYPRE_BigInt ny , HYPRE_BigInt nz , HYPRE_Int P , HYPRE_Int Q , HYPRE_Int R , HYPRE_Int p , HYPRE_Int q , HYPRE_Int r , HYPRE_Int num_fun , HYPRE_Real *mtrx , HYPRE_Real *value ); -HYPRE_ParCSRMatrix GenerateSysLaplacianVCoef ( MPI_Comm comm , HYPRE_BigInt nx , HYPRE_BigInt ny , HYPRE_BigInt nz , HYPRE_Int P , HYPRE_Int Q , HYPRE_Int R , HYPRE_Int p , HYPRE_Int q , HYPRE_Int r , HYPRE_Int num_fun , HYPRE_Real *mtrx , HYPRE_Real *value ); +HYPRE_ParCSRMatrix GenerateLaplacian ( MPI_Comm comm, HYPRE_BigInt ix, HYPRE_BigInt ny, + HYPRE_BigInt nz, HYPRE_Int P, HYPRE_Int Q, HYPRE_Int R, HYPRE_Int p, HYPRE_Int q, HYPRE_Int r, + HYPRE_Real *value ); +HYPRE_BigInt hypre_map ( HYPRE_BigInt ix, HYPRE_BigInt iy, HYPRE_BigInt iz, HYPRE_Int p, + HYPRE_Int q, HYPRE_Int r, HYPRE_BigInt nx, HYPRE_BigInt ny, HYPRE_BigInt *nx_part, + HYPRE_BigInt *ny_part, HYPRE_BigInt *nz_part ); +HYPRE_ParCSRMatrix GenerateSysLaplacian ( MPI_Comm comm, HYPRE_BigInt nx, HYPRE_BigInt ny, + HYPRE_BigInt nz, HYPRE_Int P, HYPRE_Int Q, HYPRE_Int R, HYPRE_Int p, HYPRE_Int q, HYPRE_Int r, + HYPRE_Int num_fun, HYPRE_Real *mtrx, HYPRE_Real *value ); +HYPRE_ParCSRMatrix GenerateSysLaplacianVCoef ( MPI_Comm comm, HYPRE_BigInt nx, HYPRE_BigInt ny, + HYPRE_BigInt nz, HYPRE_Int P, HYPRE_Int Q, HYPRE_Int R, HYPRE_Int p, HYPRE_Int q, HYPRE_Int r, + HYPRE_Int num_fun, HYPRE_Real *mtrx, HYPRE_Real *value ); /* par_lr_interp.c */ -HYPRE_Int hypre_BoomerAMGBuildStdInterp ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int max_elmts , HYPRE_Int sep_weight , hypre_ParCSRMatrix **P_ptr ); -HYPRE_Int hypre_BoomerAMGBuildExtPIInterp ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int max_elmts , hypre_ParCSRMatrix **P_ptr ); -HYPRE_Int hypre_BoomerAMGBuildExtPIInterpHost ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int max_elmts , hypre_ParCSRMatrix **P_ptr ); -HYPRE_Int hypre_BoomerAMGBuildExtPICCInterp ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int max_elmts , hypre_ParCSRMatrix **P_ptr ); -HYPRE_Int hypre_BoomerAMGBuildFFInterp ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int max_elmts , hypre_ParCSRMatrix **P_ptr ); -HYPRE_Int hypre_BoomerAMGBuildFF1Interp ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int max_elmts , hypre_ParCSRMatrix **P_ptr ); -HYPRE_Int hypre_BoomerAMGBuildExtInterp ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int max_elmts , hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypreDevice_extendWtoP ( HYPRE_Int P_nr_of_rows, HYPRE_Int W_nr_of_rows, + HYPRE_Int W_nr_of_cols, HYPRE_Int *CF_marker, + HYPRE_Int W_diag_nnz, HYPRE_Int *W_diag_i, + HYPRE_Int *W_diag_j, HYPRE_Complex *W_diag_data, + HYPRE_Int *P_diag_i, HYPRE_Int *P_diag_j, + HYPRE_Complex *P_diag_data, HYPRE_Int *W_offd_i, + HYPRE_Int *P_offd_i ); +HYPRE_Int hypre_BoomerAMGBuildStdInterp ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, + HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, HYPRE_Real trunc_factor, + HYPRE_Int max_elmts, HYPRE_Int sep_weight, + hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGBuildExtPIInterp ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, + HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, HYPRE_Real trunc_factor, + HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGBuildExtPIInterpHost ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, + HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, HYPRE_Real trunc_factor, + HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGBuildExtPICCInterp ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, + HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, HYPRE_Real trunc_factor, + HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGBuildFFInterp ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, + HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, HYPRE_Real trunc_factor, + HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGBuildFF1Interp ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, + HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, HYPRE_Real trunc_factor, + HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGBuildExtInterp ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, + HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, HYPRE_Real trunc_factor, + HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); /* par_lr_interp_device.c */ -HYPRE_Int hypre_BoomerAMGBuildExtInterpDevice(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr); -HYPRE_Int hypre_BoomerAMGBuildExtPIInterpDevice( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr); -HYPRE_Int hypre_BoomerAMGBuildExtPEInterpDevice(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr); +HYPRE_Int hypre_BoomerAMGBuildExtInterpDevice(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, + HYPRE_Int *dof_func, HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int max_elmts, + hypre_ParCSRMatrix **P_ptr); +HYPRE_Int hypre_BoomerAMGBuildExtPIInterpDevice( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr); +HYPRE_Int hypre_BoomerAMGBuildExtPEInterpDevice(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, + HYPRE_Int *dof_func, HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int max_elmts, + hypre_ParCSRMatrix **P_ptr); /* par_mod_lr_interp.c */ -HYPRE_Int hypre_BoomerAMGBuildModExtInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr); -HYPRE_Int hypre_BoomerAMGBuildModExtPIInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr); -HYPRE_Int hypre_BoomerAMGBuildModExtPEInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr); +HYPRE_Int hypre_BoomerAMGBuildModExtInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr); +HYPRE_Int hypre_BoomerAMGBuildModExtPIInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr); +HYPRE_Int hypre_BoomerAMGBuildModExtPEInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr); /* par_2s_interp.c */ -HYPRE_Int hypre_BoomerAMGBuildModPartialExtInterpHost ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_BigInt *num_old_cpts_global , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int max_elmts , hypre_ParCSRMatrix **P_ptr ); -HYPRE_Int hypre_BoomerAMGBuildModPartialExtInterpDevice ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_BigInt *num_old_cpts_global , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int max_elmts , hypre_ParCSRMatrix **P_ptr ); -HYPRE_Int hypre_BoomerAMGBuildModPartialExtInterp ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_BigInt *num_old_cpts_global , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int max_elmts , hypre_ParCSRMatrix **P_ptr ); -HYPRE_Int hypre_BoomerAMGBuildModPartialExtPEInterpHost ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_BigInt *num_old_cpts_global , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int max_elmts , hypre_ParCSRMatrix **P_ptr ); -HYPRE_Int hypre_BoomerAMGBuildModPartialExtPEInterpDevice ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_BigInt *num_old_cpts_global , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int max_elmts , hypre_ParCSRMatrix **P_ptr ); -HYPRE_Int hypre_BoomerAMGBuildModPartialExtPEInterp ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_BigInt *num_old_cpts_global , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int max_elmts , hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGBuildModPartialExtInterpHost ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_BigInt *num_old_cpts_global, + HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int debug_flag, HYPRE_Real trunc_factor, + HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGBuildModPartialExtInterpDevice ( hypre_ParCSRMatrix *A, + HYPRE_Int *CF_marker, hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, + HYPRE_BigInt *num_old_cpts_global, HYPRE_Int debug_flag, HYPRE_Real trunc_factor, + HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGBuildModPartialExtInterp ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_BigInt *num_old_cpts_global, + HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int debug_flag, HYPRE_Real trunc_factor, + HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGBuildModPartialExtPEInterpHost ( hypre_ParCSRMatrix *A, + HYPRE_Int *CF_marker, hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, + HYPRE_BigInt *num_old_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGBuildModPartialExtPEInterpDevice ( hypre_ParCSRMatrix *A, + HYPRE_Int *CF_marker, hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, + HYPRE_BigInt *num_old_cpts_global, HYPRE_Int debug_flag, HYPRE_Real trunc_factor, + HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGBuildModPartialExtPEInterp ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_BigInt *num_old_cpts_global, + HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int debug_flag, HYPRE_Real trunc_factor, + HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); + +/* par_mod_multi_interp.c */ +HYPRE_Int hypre_BoomerAMGBuildModMultipass ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Real trunc_factor, + HYPRE_Int P_max_elmts, HYPRE_Int interp_type, HYPRE_Int num_functions, HYPRE_Int *dof_func, + hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGBuildModMultipassHost ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Real trunc_factor, + HYPRE_Int P_max_elmts, HYPRE_Int interp_type, HYPRE_Int num_functions, HYPRE_Int *dof_func, + hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_GenerateMultipassPi ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *S, + HYPRE_BigInt *c_pts_starts, HYPRE_Int *pass_order, HYPRE_Int *pass_marker, + HYPRE_Int *pass_marker_offd, HYPRE_Int num_points, HYPRE_Int color, HYPRE_Real *row_sums, + hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_GenerateMultiPi ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *S, + hypre_ParCSRMatrix *P, HYPRE_BigInt *c_pts_starts, HYPRE_Int *pass_order, HYPRE_Int *pass_marker, + HYPRE_Int *pass_marker_offd, HYPRE_Int num_points, HYPRE_Int color, HYPRE_Int num_functions, + HYPRE_Int *dof_func, HYPRE_Int *dof_func_offd, hypre_ParCSRMatrix **Pi_ptr ); +HYPRE_Int hypre_BoomerAMGBuildModMultipassDevice ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Real trunc_factor, + HYPRE_Int P_max_elmts, HYPRE_Int interp_type, HYPRE_Int num_functions, HYPRE_Int *dof_func, + hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_GenerateMultipassPiDevice ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *S, + HYPRE_BigInt *c_pts_starts, HYPRE_Int *pass_order, HYPRE_Int *pass_marker, + HYPRE_Int *pass_marker_offd, HYPRE_Int num_points, HYPRE_Int color, HYPRE_Real *row_sums, + hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_GenerateMultiPiDevice ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *S, + hypre_ParCSRMatrix *P, HYPRE_BigInt *c_pts_starts, HYPRE_Int *pass_order, HYPRE_Int *pass_marker, + HYPRE_Int *pass_marker_offd, HYPRE_Int num_points, HYPRE_Int color, HYPRE_Int num_functions, + HYPRE_Int *dof_func, HYPRE_Int *dof_func_offd, hypre_ParCSRMatrix **Pi_ptr ); /* par_multi_interp.c */ -HYPRE_Int hypre_BoomerAMGBuildMultipass ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int P_max_elmts , HYPRE_Int weight_option , hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGBuildMultipass ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int P_max_elmts, HYPRE_Int weight_option, + hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGBuildMultipassHost ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int P_max_elmts, HYPRE_Int weight_option, + hypre_ParCSRMatrix **P_ptr ); /* par_nodal_systems.c */ -HYPRE_Int hypre_BoomerAMGCreateNodalA ( hypre_ParCSRMatrix *A , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int option , HYPRE_Int diag_option , hypre_ParCSRMatrix **AN_ptr ); -HYPRE_Int hypre_BoomerAMGCreateScalarCFS ( hypre_ParCSRMatrix *SN , hypre_ParCSRMatrix *A , HYPRE_Int *CFN_marker , HYPRE_Int num_functions , HYPRE_Int nodal , HYPRE_Int keep_same_sign , hypre_IntArray **dof_func_ptr , hypre_IntArray **CF_marker_ptr , hypre_ParCSRMatrix **S_ptr ); -HYPRE_Int hypre_BoomerAMGCreateScalarCF ( HYPRE_Int *CFN_marker , HYPRE_Int num_functions , HYPRE_Int num_nodes , hypre_IntArray **dof_func_ptr , hypre_IntArray **CF_marker_ptr ); +HYPRE_Int hypre_BoomerAMGCreateNodalA ( hypre_ParCSRMatrix *A, HYPRE_Int num_functions, + HYPRE_Int *dof_func, HYPRE_Int option, HYPRE_Int diag_option, hypre_ParCSRMatrix **AN_ptr ); +HYPRE_Int hypre_BoomerAMGCreateScalarCFS ( hypre_ParCSRMatrix *SN, hypre_ParCSRMatrix *A, + HYPRE_Int *CFN_marker, HYPRE_Int num_functions, HYPRE_Int nodal, HYPRE_Int keep_same_sign, + hypre_IntArray **dof_func_ptr, hypre_IntArray **CF_marker_ptr, hypre_ParCSRMatrix **S_ptr ); +HYPRE_Int hypre_BoomerAMGCreateScalarCF ( HYPRE_Int *CFN_marker, HYPRE_Int num_functions, + HYPRE_Int num_nodes, hypre_IntArray **dof_func_ptr, hypre_IntArray **CF_marker_ptr ); /* par_nongalerkin.c */ -HYPRE_Int hypre_GrabSubArray ( HYPRE_Int *indices , HYPRE_Int start , HYPRE_Int end , HYPRE_BigInt *array , HYPRE_BigInt *output ); -HYPRE_Int hypre_IntersectTwoArrays ( HYPRE_Int *x , HYPRE_Real *x_data , HYPRE_Int x_length , HYPRE_Int *y , HYPRE_Int y_length , HYPRE_Int *z , HYPRE_Real *output_x_data , HYPRE_Int *intersect_length ); -HYPRE_Int hypre_IntersectTwoBigArrays ( HYPRE_BigInt *x , HYPRE_Real *x_data , HYPRE_Int x_length , HYPRE_BigInt *y , HYPRE_Int y_length , HYPRE_BigInt *z , HYPRE_Real *output_x_data , HYPRE_Int *intersect_length ); -HYPRE_Int hypre_SortedCopyParCSRData ( hypre_ParCSRMatrix *A , hypre_ParCSRMatrix *B ); -HYPRE_Int hypre_BoomerAMG_MyCreateS ( hypre_ParCSRMatrix *A , HYPRE_Real strength_threshold , HYPRE_Real max_row_sum , HYPRE_Int num_functions , HYPRE_Int *dof_func , hypre_ParCSRMatrix **S_ptr ); -HYPRE_Int hypre_BoomerAMGCreateSFromCFMarker(hypre_ParCSRMatrix *A, HYPRE_Real strength_threshold, HYPRE_Real max_row_sum, HYPRE_Int *CF_marker, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int SMRK, hypre_ParCSRMatrix **S_ptr); -HYPRE_Int hypre_NonGalerkinIJBufferInit ( HYPRE_Int *ijbuf_cnt , HYPRE_Int *ijbuf_rowcounter , HYPRE_Int *ijbuf_numcols ); -HYPRE_Int hypre_NonGalerkinIJBigBufferInit ( HYPRE_Int *ijbuf_cnt , HYPRE_Int *ijbuf_rowcounter , HYPRE_BigInt *ijbuf_numcols ); -HYPRE_Int hypre_NonGalerkinIJBufferNewRow ( HYPRE_BigInt *ijbuf_rownums , HYPRE_Int *ijbuf_numcols , HYPRE_Int *ijbuf_rowcounter , HYPRE_BigInt new_row ); -HYPRE_Int hypre_NonGalerkinIJBufferCompressRow ( HYPRE_Int *ijbuf_cnt , HYPRE_Int ijbuf_rowcounter , HYPRE_Real *ijbuf_data , HYPRE_BigInt *ijbuf_cols , HYPRE_BigInt *ijbuf_rownums , HYPRE_Int *ijbuf_numcols ); -HYPRE_Int hypre_NonGalerkinIJBufferCompress ( HYPRE_Int ijbuf_size , HYPRE_Int *ijbuf_cnt , HYPRE_Int *ijbuf_rowcounter , HYPRE_Real **ijbuf_data , HYPRE_BigInt **ijbuf_cols , HYPRE_BigInt **ijbuf_rownums , HYPRE_Int **ijbuf_numcols ); -HYPRE_Int hypre_NonGalerkinIJBufferWrite ( HYPRE_IJMatrix B , HYPRE_Int *ijbuf_cnt , HYPRE_Int ijbuf_size , HYPRE_Int *ijbuf_rowcounter , HYPRE_Real **ijbuf_data , HYPRE_BigInt **ijbuf_cols , HYPRE_BigInt **ijbuf_rownums , HYPRE_Int **ijbuf_numcols , HYPRE_BigInt row_to_write , HYPRE_BigInt col_to_write , HYPRE_Real val_to_write ); -HYPRE_Int hypre_NonGalerkinIJBufferEmpty ( HYPRE_IJMatrix B , HYPRE_Int ijbuf_size , HYPRE_Int *ijbuf_cnt , HYPRE_Int ijbuf_rowcounter , HYPRE_Real **ijbuf_data , HYPRE_BigInt **ijbuf_cols , HYPRE_BigInt **ijbuf_rownums , HYPRE_Int **ijbuf_numcols ); -hypre_ParCSRMatrix * hypre_NonGalerkinSparsityPattern(hypre_ParCSRMatrix *R_IAP, hypre_ParCSRMatrix *RAP, HYPRE_Int * CF_marker, HYPRE_Real droptol, HYPRE_Int sym_collapse, HYPRE_Int collapse_beta ); -HYPRE_Int hypre_BoomerAMGBuildNonGalerkinCoarseOperator( hypre_ParCSRMatrix **RAP_ptr, hypre_ParCSRMatrix *AP, HYPRE_Real strong_threshold, HYPRE_Real max_row_sum, HYPRE_Int num_functions, HYPRE_Int * dof_func_value, HYPRE_Int * CF_marker, HYPRE_Real droptol, HYPRE_Int sym_collapse, HYPRE_Real lump_percent, HYPRE_Int collapse_beta ); +HYPRE_Int hypre_GrabSubArray ( HYPRE_Int *indices, HYPRE_Int start, HYPRE_Int end, + HYPRE_BigInt *array, HYPRE_BigInt *output ); +HYPRE_Int hypre_IntersectTwoArrays ( HYPRE_Int *x, HYPRE_Real *x_data, HYPRE_Int x_length, + HYPRE_Int *y, HYPRE_Int y_length, HYPRE_Int *z, HYPRE_Real *output_x_data, + HYPRE_Int *intersect_length ); +HYPRE_Int hypre_IntersectTwoBigArrays ( HYPRE_BigInt *x, HYPRE_Real *x_data, HYPRE_Int x_length, + HYPRE_BigInt *y, HYPRE_Int y_length, HYPRE_BigInt *z, HYPRE_Real *output_x_data, + HYPRE_Int *intersect_length ); +HYPRE_Int hypre_SortedCopyParCSRData ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B ); +HYPRE_Int hypre_BoomerAMG_MyCreateS ( hypre_ParCSRMatrix *A, HYPRE_Real strength_threshold, + HYPRE_Real max_row_sum, HYPRE_Int num_functions, HYPRE_Int *dof_func, hypre_ParCSRMatrix **S_ptr ); +HYPRE_Int hypre_BoomerAMGCreateSFromCFMarker(hypre_ParCSRMatrix *A, + HYPRE_Real strength_threshold, HYPRE_Real max_row_sum, HYPRE_Int *CF_marker, + HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int SMRK, hypre_ParCSRMatrix **S_ptr); +HYPRE_Int hypre_NonGalerkinIJBufferInit ( HYPRE_Int *ijbuf_cnt, HYPRE_Int *ijbuf_rowcounter, + HYPRE_Int *ijbuf_numcols ); +HYPRE_Int hypre_NonGalerkinIJBigBufferInit ( HYPRE_Int *ijbuf_cnt, HYPRE_Int *ijbuf_rowcounter, + HYPRE_BigInt *ijbuf_numcols ); +HYPRE_Int hypre_NonGalerkinIJBufferNewRow ( HYPRE_BigInt *ijbuf_rownums, HYPRE_Int *ijbuf_numcols, + HYPRE_Int *ijbuf_rowcounter, HYPRE_BigInt new_row ); +HYPRE_Int hypre_NonGalerkinIJBufferCompressRow ( HYPRE_Int *ijbuf_cnt, HYPRE_Int ijbuf_rowcounter, + HYPRE_Real *ijbuf_data, HYPRE_BigInt *ijbuf_cols, HYPRE_BigInt *ijbuf_rownums, + HYPRE_Int *ijbuf_numcols ); +HYPRE_Int hypre_NonGalerkinIJBufferCompress ( HYPRE_MemoryLocation memory_location, + HYPRE_Int ijbuf_size, HYPRE_Int *ijbuf_cnt, + HYPRE_Int *ijbuf_rowcounter, HYPRE_Real **ijbuf_data, HYPRE_BigInt **ijbuf_cols, + HYPRE_BigInt **ijbuf_rownums, HYPRE_Int **ijbuf_numcols ); +HYPRE_Int hypre_NonGalerkinIJBufferWrite ( HYPRE_IJMatrix B, HYPRE_Int *ijbuf_cnt, + HYPRE_Int ijbuf_size, HYPRE_Int *ijbuf_rowcounter, HYPRE_Real **ijbuf_data, + HYPRE_BigInt **ijbuf_cols, HYPRE_BigInt **ijbuf_rownums, HYPRE_Int **ijbuf_numcols, + HYPRE_BigInt row_to_write, HYPRE_BigInt col_to_write, HYPRE_Real val_to_write ); +HYPRE_Int hypre_NonGalerkinIJBufferEmpty ( HYPRE_IJMatrix B, HYPRE_Int ijbuf_size, + HYPRE_Int *ijbuf_cnt, HYPRE_Int ijbuf_rowcounter, HYPRE_Real **ijbuf_data, + HYPRE_BigInt **ijbuf_cols, HYPRE_BigInt **ijbuf_rownums, HYPRE_Int **ijbuf_numcols ); +hypre_ParCSRMatrix * hypre_NonGalerkinSparsityPattern(hypre_ParCSRMatrix *R_IAP, + hypre_ParCSRMatrix *RAP, HYPRE_Int * CF_marker, HYPRE_Real droptol, HYPRE_Int sym_collapse, + HYPRE_Int collapse_beta ); +HYPRE_Int hypre_BoomerAMGBuildNonGalerkinCoarseOperator( hypre_ParCSRMatrix **RAP_ptr, + hypre_ParCSRMatrix *AP, HYPRE_Real strong_threshold, HYPRE_Real max_row_sum, + HYPRE_Int num_functions, HYPRE_Int * dof_func_value, HYPRE_Int * CF_marker, HYPRE_Real droptol, + HYPRE_Int sym_collapse, HYPRE_Real lump_percent, HYPRE_Int collapse_beta ); /* par_rap.c */ -HYPRE_Int hypre_BoomerAMGBuildCoarseOperator ( hypre_ParCSRMatrix *RT , hypre_ParCSRMatrix *A , hypre_ParCSRMatrix *P , hypre_ParCSRMatrix **RAP_ptr ); -HYPRE_Int hypre_BoomerAMGBuildCoarseOperatorKT ( hypre_ParCSRMatrix *RT , hypre_ParCSRMatrix *A , hypre_ParCSRMatrix *P , HYPRE_Int keepTranspose, hypre_ParCSRMatrix **RAP_ptr ); +HYPRE_Int hypre_BoomerAMGBuildCoarseOperator ( hypre_ParCSRMatrix *RT, hypre_ParCSRMatrix *A, + hypre_ParCSRMatrix *P, hypre_ParCSRMatrix **RAP_ptr ); +HYPRE_Int hypre_BoomerAMGBuildCoarseOperatorKT ( hypre_ParCSRMatrix *RT, hypre_ParCSRMatrix *A, + hypre_ParCSRMatrix *P, HYPRE_Int keepTranspose, hypre_ParCSRMatrix **RAP_ptr ); /* par_rap_communication.c */ -HYPRE_Int hypre_GetCommPkgRTFromCommPkgA ( hypre_ParCSRMatrix *RT , hypre_ParCSRMatrix *A , HYPRE_Int *fine_to_coarse, HYPRE_Int *tmp_map_offd ); -HYPRE_Int hypre_GenerateSendMapAndCommPkg ( MPI_Comm comm , HYPRE_Int num_sends , HYPRE_Int num_recvs , HYPRE_Int *recv_procs , HYPRE_Int *send_procs , HYPRE_Int *recv_vec_starts , hypre_ParCSRMatrix *A ); +HYPRE_Int hypre_GetCommPkgRTFromCommPkgA ( hypre_ParCSRMatrix *RT, hypre_ParCSRMatrix *A, + HYPRE_Int *fine_to_coarse, HYPRE_Int *tmp_map_offd ); +HYPRE_Int hypre_GenerateSendMapAndCommPkg ( MPI_Comm comm, HYPRE_Int num_sends, HYPRE_Int num_recvs, + HYPRE_Int *recv_procs, HYPRE_Int *send_procs, HYPRE_Int *recv_vec_starts, hypre_ParCSRMatrix *A ); + +/* par_ge_device.c */ +HYPRE_Int hypre_GaussElimSetupDevice ( hypre_ParAMGData *amg_data, HYPRE_Int level, + HYPRE_Int solver_type ); +HYPRE_Int hypre_GaussElimSolveDevice ( hypre_ParAMGData *amg_data, HYPRE_Int level, + HYPRE_Int solver_type ); + +/* par_gauss_elim.c */ +HYPRE_Int hypre_GaussElimSetup ( hypre_ParAMGData *amg_data, HYPRE_Int level, + HYPRE_Int solver_type ); +HYPRE_Int hypre_GaussElimSolve ( hypre_ParAMGData *amg_data, HYPRE_Int level, + HYPRE_Int solver_type ); /* par_relax.c */ -HYPRE_Int hypre_BoomerAMGRelax ( hypre_ParCSRMatrix *A , hypre_ParVector *f , HYPRE_Int *cf_marker , HYPRE_Int relax_type , HYPRE_Int relax_points , HYPRE_Real relax_weight , HYPRE_Real omega , HYPRE_Real *l1_norms , hypre_ParVector *u , hypre_ParVector *Vtemp , hypre_ParVector *Ztemp ); -HYPRE_Int hypre_GaussElimSetup ( hypre_ParAMGData *amg_data , HYPRE_Int level , HYPRE_Int relax_type ); -HYPRE_Int hypre_GaussElimSolve ( hypre_ParAMGData *amg_data , HYPRE_Int level , HYPRE_Int relax_type ); -HYPRE_Int hypre_BoomerAMGRelaxHybridGaussSeidel_core( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, HYPRE_Real *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp, HYPRE_Int GS_order, HYPRE_Int Symm, HYPRE_Int Skip_diag, HYPRE_Int forced_seq, HYPRE_Int Topo_order ); -HYPRE_Int hypre_BoomerAMGRelax0WeightedJacobi( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, hypre_ParVector *u, hypre_ParVector *Vtemp ); - -HYPRE_Int hypre_BoomerAMGRelax1GaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_ParVector *u ); - -HYPRE_Int hypre_BoomerAMGRelax2GaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_ParVector *u ); - -HYPRE_Int hypre_BoomerAMGRelax5ChaoticHybridGaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_ParVector *u ); - -HYPRE_Int hypre_BoomerAMGRelax3HybridGaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); - -HYPRE_Int hypre_BoomerAMGRelax4HybridGaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); - -HYPRE_Int hypre_BoomerAMGRelax6HybridSSOR( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); - -HYPRE_Int hypre_BoomerAMGRelax7Jacobi( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp ); - -HYPRE_Int hypre_BoomerAMGRelax8HybridL1SSOR( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, HYPRE_Real *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); - -HYPRE_Int hypre_BoomerAMGRelax10TopoOrderedGaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); - -HYPRE_Int hypre_BoomerAMGRelax13HybridL1GaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, HYPRE_Real *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); - -HYPRE_Int hypre_BoomerAMGRelax14HybridL1GaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, HYPRE_Real *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); - -HYPRE_Int hypre_BoomerAMGRelax18WeightedL1Jacobi( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp ); - -HYPRE_Int hypre_BoomerAMGRelax19GaussElim( hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); - -HYPRE_Int hypre_BoomerAMGRelax98GaussElimPivot( hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); - -HYPRE_Int hypre_BoomerAMGRelaxKaczmarz( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Real omega, HYPRE_Real *l1_norms, hypre_ParVector *u ); - -HYPRE_Int hypre_BoomerAMGRelaxTwoStageGaussSeidelDevice ( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Real relax_weight, HYPRE_Real omega, hypre_ParVector *u, hypre_ParVector *r, hypre_ParVector *z, HYPRE_Int choice); - -HYPRE_Int hypre_BoomerAMGRelaxTwoStageGaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp, HYPRE_Int num_inner_iters ); - -HYPRE_Int hypre_BoomerAMGRelax11TwoStageGaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); - -HYPRE_Int hypre_BoomerAMGRelax12TwoStageGaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); - -/* par_realx_device.c */ -HYPRE_Int hypre_BoomerAMGRelaxHybridGaussSeidelDevice( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, HYPRE_Real *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp, HYPRE_Int GS_order, HYPRE_Int Symm ); +HYPRE_Int hypre_BoomerAMGRelax ( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, + HYPRE_Int relax_type, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, + HYPRE_Real *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); +HYPRE_Int hypre_BoomerAMGRelaxHybridGaussSeidel_core( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, + HYPRE_Real *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp, + HYPRE_Int GS_order, HYPRE_Int Symm, HYPRE_Int Skip_diag, HYPRE_Int forced_seq, + HYPRE_Int Topo_order ); +HYPRE_Int hypre_BoomerAMGRelax0WeightedJacobi( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, hypre_ParVector *u, + hypre_ParVector *Vtemp ); + +HYPRE_Int hypre_BoomerAMGRelaxHybridSOR( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, + HYPRE_Real *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp, + HYPRE_Int direction, HYPRE_Int symm, HYPRE_Int skip_diag, HYPRE_Int force_seq ); + +HYPRE_Int hypre_BoomerAMGRelax1GaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_ParVector *u ); + +HYPRE_Int hypre_BoomerAMGRelax2GaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_ParVector *u ); + +HYPRE_Int hypre_BoomerAMGRelax5ChaoticHybridGaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_ParVector *u ); + +HYPRE_Int hypre_BoomerAMGRelax3HybridGaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, + hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); + +HYPRE_Int hypre_BoomerAMGRelax4HybridGaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, + hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); + +HYPRE_Int hypre_BoomerAMGRelax6HybridSSOR( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, + hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); + +HYPRE_Int hypre_BoomerAMGRelax7Jacobi( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real *l1_norms, + hypre_ParVector *u, hypre_ParVector *Vtemp ); + +HYPRE_Int hypre_BoomerAMGRelax8HybridL1SSOR( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, + HYPRE_Real *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); + +HYPRE_Int hypre_BoomerAMGRelax10TopoOrderedGaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, + hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); + +HYPRE_Int hypre_BoomerAMGRelax13HybridL1GaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, + HYPRE_Real *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); + +HYPRE_Int hypre_BoomerAMGRelax14HybridL1GaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, + HYPRE_Real *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); + +HYPRE_Int hypre_BoomerAMGRelax88HybridL1SSOR( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, + HYPRE_Real *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); + +HYPRE_Int hypre_BoomerAMGRelax89HybridL1SSOR( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real omega, + HYPRE_Real *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); + +HYPRE_Int hypre_BoomerAMGRelax18WeightedL1Jacobi( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real *l1_norms, + hypre_ParVector *u, hypre_ParVector *Vtemp ); + +HYPRE_Int hypre_BoomerAMGRelaxKaczmarz( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Real omega, + HYPRE_Real *l1_norms, hypre_ParVector *u ); + +HYPRE_Int hypre_BoomerAMGRelaxTwoStageGaussSeidelDevice ( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Real relax_weight, HYPRE_Real omega, + HYPRE_Real *A_diag_diag, hypre_ParVector *u, + hypre_ParVector *r, hypre_ParVector *z, + HYPRE_Int choice ); + +HYPRE_Int hypre_BoomerAMGRelax11TwoStageGaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *cf_marker, HYPRE_Int relax_points, + HYPRE_Real relax_weight, HYPRE_Real omega, + HYPRE_Real *A_diag_diag, hypre_ParVector *u, + hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); + +HYPRE_Int hypre_BoomerAMGRelax12TwoStageGaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *cf_marker, HYPRE_Int relax_points, + HYPRE_Real relax_weight, HYPRE_Real omega, + HYPRE_Real *A_diag_diag, hypre_ParVector *u, + hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); + +HYPRE_Int hypre_BoomerAMGRelaxComputeL1Norms( hypre_ParCSRMatrix *A, HYPRE_Int relax_type, + HYPRE_Int relax_order, HYPRE_Int coarsest_lvl, + hypre_IntArray *CF_marker, + HYPRE_Real **l1_norms_data_ptr ); + +/* par_relax_device.c */ +HYPRE_Int hypre_BoomerAMGRelaxHybridGaussSeidelDevice( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *cf_marker, HYPRE_Int relax_points, + HYPRE_Real relax_weight, HYPRE_Real omega, + HYPRE_Real *l1_norms, hypre_ParVector *u, + hypre_ParVector *Vtemp, hypre_ParVector *Ztemp, + HYPRE_Int GS_order, HYPRE_Int Symm ); /* par_relax_interface.c */ -HYPRE_Int hypre_BoomerAMGRelaxIF ( hypre_ParCSRMatrix *A , hypre_ParVector *f , HYPRE_Int *cf_marker , HYPRE_Int relax_type , HYPRE_Int relax_order , HYPRE_Int cycle_type , HYPRE_Real relax_weight , HYPRE_Real omega , HYPRE_Real *l1_norms , hypre_ParVector *u , hypre_ParVector *Vtemp , hypre_ParVector *Ztemp ); +HYPRE_Int hypre_BoomerAMGRelaxIF ( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, + HYPRE_Int relax_type, HYPRE_Int relax_order, HYPRE_Int cycle_type, HYPRE_Real relax_weight, + HYPRE_Real omega, HYPRE_Real *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, + hypre_ParVector *Ztemp ); /* par_relax_more.c */ -HYPRE_Int hypre_ParCSRMaxEigEstimate ( hypre_ParCSRMatrix *A , HYPRE_Int scale , HYPRE_Real *max_eig, HYPRE_Real *min_eig ); -HYPRE_Int hypre_ParCSRMaxEigEstimateHost ( hypre_ParCSRMatrix *A , HYPRE_Int scale , HYPRE_Real *max_eig, HYPRE_Real *min_eig ); -HYPRE_Int hypre_ParCSRMaxEigEstimateCG ( hypre_ParCSRMatrix *A , HYPRE_Int scale , HYPRE_Int max_iter , HYPRE_Real *max_eig , HYPRE_Real *min_eig ); -HYPRE_Int hypre_ParCSRMaxEigEstimateCGHost ( hypre_ParCSRMatrix *A , HYPRE_Int scale , HYPRE_Int max_iter , HYPRE_Real *max_eig , HYPRE_Real *min_eig ); -HYPRE_Int hypre_ParCSRRelax_Cheby ( hypre_ParCSRMatrix *A , hypre_ParVector *f , HYPRE_Real max_eig , HYPRE_Real min_eig , HYPRE_Real fraction , HYPRE_Int order , HYPRE_Int scale , HYPRE_Int variant , hypre_ParVector *u , hypre_ParVector *v , hypre_ParVector *r ); -HYPRE_Int hypre_BoomerAMGRelax_FCFJacobi ( hypre_ParCSRMatrix *A , hypre_ParVector *f , HYPRE_Int *cf_marker , HYPRE_Real relax_weight , hypre_ParVector *u , hypre_ParVector *Vtemp ); -HYPRE_Int hypre_ParCSRRelax_CG ( HYPRE_Solver solver , hypre_ParCSRMatrix *A , hypre_ParVector *f , hypre_ParVector *u , HYPRE_Int num_its ); -HYPRE_Int hypre_LINPACKcgtql1 ( HYPRE_Int *n , HYPRE_Real *d , HYPRE_Real *e , HYPRE_Int *ierr ); -HYPRE_Real hypre_LINPACKcgpthy ( HYPRE_Real *a , HYPRE_Real *b ); -HYPRE_Int hypre_ParCSRRelax_L1_Jacobi ( hypre_ParCSRMatrix *A , hypre_ParVector *f , HYPRE_Int *cf_marker , HYPRE_Int relax_points , HYPRE_Real relax_weight , HYPRE_Real *l1_norms , hypre_ParVector *u , hypre_ParVector *Vtemp ); -HYPRE_Int hypre_LINPACKcgtql1(HYPRE_Int*,HYPRE_Real *,HYPRE_Real *,HYPRE_Int *); +HYPRE_Int hypre_ParCSRMaxEigEstimate ( hypre_ParCSRMatrix *A, HYPRE_Int scale, HYPRE_Real *max_eig, + HYPRE_Real *min_eig ); +HYPRE_Int hypre_ParCSRMaxEigEstimateHost ( hypre_ParCSRMatrix *A, HYPRE_Int scale, + HYPRE_Real *max_eig, HYPRE_Real *min_eig ); +HYPRE_Int hypre_ParCSRMaxEigEstimateCG ( hypre_ParCSRMatrix *A, HYPRE_Int scale, HYPRE_Int max_iter, + HYPRE_Real *max_eig, HYPRE_Real *min_eig ); +HYPRE_Int hypre_ParCSRMaxEigEstimateCGHost ( hypre_ParCSRMatrix *A, HYPRE_Int scale, + HYPRE_Int max_iter, HYPRE_Real *max_eig, HYPRE_Real *min_eig ); +HYPRE_Int hypre_ParCSRRelax_Cheby ( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Real max_eig, + HYPRE_Real min_eig, HYPRE_Real fraction, HYPRE_Int order, HYPRE_Int scale, HYPRE_Int variant, + hypre_ParVector *u, hypre_ParVector *v, hypre_ParVector *r ); +HYPRE_Int hypre_BoomerAMGRelax_FCFJacobi ( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *cf_marker, HYPRE_Real relax_weight, + hypre_ParVector *u, hypre_ParVector *Vtemp ); +HYPRE_Int hypre_ParCSRRelax_CG ( HYPRE_Solver solver, hypre_ParCSRMatrix *A, hypre_ParVector *f, + hypre_ParVector *u, HYPRE_Int num_its ); +HYPRE_Int hypre_LINPACKcgtql1 ( HYPRE_Int *n, HYPRE_Real *d, HYPRE_Real *e, HYPRE_Int *ierr ); +HYPRE_Real hypre_LINPACKcgpthy ( HYPRE_Real *a, HYPRE_Real *b ); +HYPRE_Int hypre_ParCSRRelax_L1_Jacobi ( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *cf_marker, HYPRE_Int relax_points, HYPRE_Real relax_weight, HYPRE_Real *l1_norms, + hypre_ParVector *u, hypre_ParVector *Vtemp ); +HYPRE_Int hypre_LINPACKcgtql1(HYPRE_Int*, HYPRE_Real *, HYPRE_Real *, HYPRE_Int *); HYPRE_Real hypre_LINPACKcgpthy(HYPRE_Real*, HYPRE_Real*); /* par_relax_more_device.c */ -HYPRE_Int hypre_ParCSRMaxEigEstimateDevice ( hypre_ParCSRMatrix *A , HYPRE_Int scale , HYPRE_Real *max_eig , HYPRE_Real *min_eig ); -HYPRE_Int hypre_ParCSRMaxEigEstimateCGDevice ( hypre_ParCSRMatrix *A , HYPRE_Int scale , HYPRE_Int max_iter , HYPRE_Real *max_eig , HYPRE_Real *min_eig ); +HYPRE_Int hypre_ParCSRMaxEigEstimateDevice ( hypre_ParCSRMatrix *A, HYPRE_Int scale, + HYPRE_Real *max_eig, HYPRE_Real *min_eig ); +HYPRE_Int hypre_ParCSRMaxEigEstimateCGDevice ( hypre_ParCSRMatrix *A, HYPRE_Int scale, + HYPRE_Int max_iter, HYPRE_Real *max_eig, HYPRE_Real *min_eig ); /* par_rotate_7pt.c */ -HYPRE_ParCSRMatrix GenerateRotate7pt ( MPI_Comm comm , HYPRE_BigInt nx , HYPRE_BigInt ny , HYPRE_Int P , HYPRE_Int Q , HYPRE_Int p , HYPRE_Int q , HYPRE_Real alpha , HYPRE_Real eps ); +HYPRE_ParCSRMatrix GenerateRotate7pt ( MPI_Comm comm, HYPRE_BigInt nx, HYPRE_BigInt ny, HYPRE_Int P, + HYPRE_Int Q, HYPRE_Int p, HYPRE_Int q, HYPRE_Real alpha, HYPRE_Real eps ); /* par_scaled_matnorm.c */ -HYPRE_Int hypre_ParCSRMatrixScaledNorm ( hypre_ParCSRMatrix *A , HYPRE_Real *scnorm ); +HYPRE_Int hypre_ParCSRMatrixScaledNorm ( hypre_ParCSRMatrix *A, HYPRE_Real *scnorm ); /* par_schwarz.c */ void *hypre_SchwarzCreate ( void ); HYPRE_Int hypre_SchwarzDestroy ( void *data ); -HYPRE_Int hypre_SchwarzSetup ( void *schwarz_vdata , hypre_ParCSRMatrix *A , hypre_ParVector *f , hypre_ParVector *u ); -HYPRE_Int hypre_SchwarzSolve ( void *schwarz_vdata , hypre_ParCSRMatrix *A , hypre_ParVector *f , hypre_ParVector *u ); -HYPRE_Int hypre_SchwarzCFSolve ( void *schwarz_vdata , hypre_ParCSRMatrix *A , hypre_ParVector *f , hypre_ParVector *u , HYPRE_Int *CF_marker , HYPRE_Int rlx_pt ); -HYPRE_Int hypre_SchwarzSetVariant ( void *data , HYPRE_Int variant ); -HYPRE_Int hypre_SchwarzSetDomainType ( void *data , HYPRE_Int domain_type ); -HYPRE_Int hypre_SchwarzSetOverlap ( void *data , HYPRE_Int overlap ); -HYPRE_Int hypre_SchwarzSetNumFunctions ( void *data , HYPRE_Int num_functions ); -HYPRE_Int hypre_SchwarzSetNonSymm ( void *data , HYPRE_Int value ); -HYPRE_Int hypre_SchwarzSetRelaxWeight ( void *data , HYPRE_Real relax_weight ); -HYPRE_Int hypre_SchwarzSetDomainStructure ( void *data , hypre_CSRMatrix *domain_structure ); -HYPRE_Int hypre_SchwarzSetScale ( void *data , HYPRE_Real *scale ); -HYPRE_Int hypre_SchwarzReScale ( void *data , HYPRE_Int size , HYPRE_Real value ); -HYPRE_Int hypre_SchwarzSetDofFunc ( void *data , HYPRE_Int *dof_func ); +HYPRE_Int hypre_SchwarzSetup ( void *schwarz_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, + hypre_ParVector *u ); +HYPRE_Int hypre_SchwarzSolve ( void *schwarz_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, + hypre_ParVector *u ); +HYPRE_Int hypre_SchwarzCFSolve ( void *schwarz_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, + hypre_ParVector *u, HYPRE_Int *CF_marker, HYPRE_Int rlx_pt ); +HYPRE_Int hypre_SchwarzSetVariant ( void *data, HYPRE_Int variant ); +HYPRE_Int hypre_SchwarzSetDomainType ( void *data, HYPRE_Int domain_type ); +HYPRE_Int hypre_SchwarzSetOverlap ( void *data, HYPRE_Int overlap ); +HYPRE_Int hypre_SchwarzSetNumFunctions ( void *data, HYPRE_Int num_functions ); +HYPRE_Int hypre_SchwarzSetNonSymm ( void *data, HYPRE_Int value ); +HYPRE_Int hypre_SchwarzSetRelaxWeight ( void *data, HYPRE_Real relax_weight ); +HYPRE_Int hypre_SchwarzSetDomainStructure ( void *data, hypre_CSRMatrix *domain_structure ); +HYPRE_Int hypre_SchwarzSetScale ( void *data, HYPRE_Real *scale ); +HYPRE_Int hypre_SchwarzReScale ( void *data, HYPRE_Int size, HYPRE_Real value ); +HYPRE_Int hypre_SchwarzSetDofFunc ( void *data, HYPRE_Int *dof_func ); /* par_stats.c */ -HYPRE_Int hypre_BoomerAMGSetupStats ( void *amg_vdata , hypre_ParCSRMatrix *A ); +HYPRE_Int hypre_BoomerAMGSetupStats ( void *amg_vdata, hypre_ParCSRMatrix *A ); HYPRE_Int hypre_BoomerAMGWriteSolverParams ( void *data ); +const char* hypre_BoomerAMGGetProlongationName( hypre_ParAMGData *amg_data ); +const char* hypre_BoomerAMGGetAggProlongationName( hypre_ParAMGData *amg_data ); +const char* hypre_BoomerAMGGetCoarseningName( hypre_ParAMGData *amg_data ); +const char* hypre_BoomerAMGGetCycleName( hypre_ParAMGData *amg_data ); +HYPRE_Int hypre_BoomerAMGPrintGeneralInfo( hypre_ParAMGData *amg_data, HYPRE_Int shift ); /* par_strength.c */ -HYPRE_Int hypre_BoomerAMGCreateS ( hypre_ParCSRMatrix *A , HYPRE_Real strength_threshold , HYPRE_Real max_row_sum , HYPRE_Int num_functions , HYPRE_Int *dof_func , hypre_ParCSRMatrix **S_ptr ); -HYPRE_Int hypre_BoomerAMGCreateSabs ( hypre_ParCSRMatrix *A , HYPRE_Real strength_threshold , HYPRE_Real max_row_sum , HYPRE_Int num_functions , HYPRE_Int *dof_func , hypre_ParCSRMatrix **S_ptr ); -HYPRE_Int hypre_BoomerAMGCreateSCommPkg ( hypre_ParCSRMatrix *A , hypre_ParCSRMatrix *S , HYPRE_Int **col_offd_S_to_A_ptr ); -HYPRE_Int hypre_BoomerAMGCreate2ndS ( hypre_ParCSRMatrix *S , HYPRE_Int *CF_marker , HYPRE_Int num_paths , HYPRE_BigInt *coarse_row_starts , hypre_ParCSRMatrix **C_ptr ); -HYPRE_Int hypre_BoomerAMGCorrectCFMarker ( hypre_IntArray *CF_marker , hypre_IntArray *new_CF_marker ); -HYPRE_Int hypre_BoomerAMGCorrectCFMarkerHost ( hypre_IntArray *CF_marker , hypre_IntArray *new_CF_marker ); -HYPRE_Int hypre_BoomerAMGCorrectCFMarkerDevice ( hypre_IntArray *CF_marker , hypre_IntArray *new_CF_marker ); -HYPRE_Int hypre_BoomerAMGCorrectCFMarker2 ( hypre_IntArray *CF_marker , hypre_IntArray *new_CF_marker ); -HYPRE_Int hypre_BoomerAMGCorrectCFMarker2Host ( hypre_IntArray *CF_marker , hypre_IntArray *new_CF_marker ); -HYPRE_Int hypre_BoomerAMGCorrectCFMarker2Device ( hypre_IntArray *CF_marker , hypre_IntArray *new_CF_marker ); -HYPRE_Int hypre_BoomerAMGCreateSHost(hypre_ParCSRMatrix *A, HYPRE_Real strength_threshold, HYPRE_Real max_row_sum, HYPRE_Int num_functions, HYPRE_Int *dof_func, hypre_ParCSRMatrix **S_ptr); -HYPRE_Int hypre_BoomerAMGCreateSDevice(hypre_ParCSRMatrix *A, HYPRE_Int abs_soc, HYPRE_Real strength_threshold, HYPRE_Real max_row_sum, HYPRE_Int num_functions, HYPRE_Int *dof_func, hypre_ParCSRMatrix **S_ptr); -HYPRE_Int hypre_BoomerAMGCreateSabsHost ( hypre_ParCSRMatrix *A , HYPRE_Real strength_threshold , HYPRE_Real max_row_sum , HYPRE_Int num_functions , HYPRE_Int *dof_func , hypre_ParCSRMatrix **S_ptr ); -HYPRE_Int hypre_BoomerAMGCreate2ndSDevice( hypre_ParCSRMatrix *S, HYPRE_Int *CF_marker, HYPRE_Int num_paths, HYPRE_BigInt *coarse_row_starts, hypre_ParCSRMatrix **C_ptr); +HYPRE_Int hypre_BoomerAMGCreateS ( hypre_ParCSRMatrix *A, HYPRE_Real strength_threshold, + HYPRE_Real max_row_sum, HYPRE_Int num_functions, HYPRE_Int *dof_func, hypre_ParCSRMatrix **S_ptr ); +HYPRE_Int hypre_BoomerAMGCreateSabs ( hypre_ParCSRMatrix *A, HYPRE_Real strength_threshold, + HYPRE_Real max_row_sum, HYPRE_Int num_functions, HYPRE_Int *dof_func, hypre_ParCSRMatrix **S_ptr ); +HYPRE_Int hypre_BoomerAMGCreateSCommPkg ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *S, + HYPRE_Int **col_offd_S_to_A_ptr ); +HYPRE_Int hypre_BoomerAMGCreate2ndS ( hypre_ParCSRMatrix *S, HYPRE_Int *CF_marker, + HYPRE_Int num_paths, HYPRE_BigInt *coarse_row_starts, hypre_ParCSRMatrix **C_ptr ); +HYPRE_Int hypre_BoomerAMGCorrectCFMarker ( hypre_IntArray *CF_marker, + hypre_IntArray *new_CF_marker ); +HYPRE_Int hypre_BoomerAMGCorrectCFMarkerHost ( hypre_IntArray *CF_marker, + hypre_IntArray *new_CF_marker ); +HYPRE_Int hypre_BoomerAMGCorrectCFMarkerDevice ( hypre_IntArray *CF_marker, + hypre_IntArray *new_CF_marker ); +HYPRE_Int hypre_BoomerAMGCorrectCFMarker2 ( hypre_IntArray *CF_marker, + hypre_IntArray *new_CF_marker ); +HYPRE_Int hypre_BoomerAMGCorrectCFMarker2Host ( hypre_IntArray *CF_marker, + hypre_IntArray *new_CF_marker ); +HYPRE_Int hypre_BoomerAMGCorrectCFMarker2Device ( hypre_IntArray *CF_marker, + hypre_IntArray *new_CF_marker ); +HYPRE_Int hypre_BoomerAMGCreateSHost(hypre_ParCSRMatrix *A, HYPRE_Real strength_threshold, + HYPRE_Real max_row_sum, HYPRE_Int num_functions, HYPRE_Int *dof_func, hypre_ParCSRMatrix **S_ptr); +HYPRE_Int hypre_BoomerAMGCreateSDevice(hypre_ParCSRMatrix *A, HYPRE_Int abs_soc, + HYPRE_Real strength_threshold, HYPRE_Real max_row_sum, HYPRE_Int num_functions, HYPRE_Int *dof_func, + hypre_ParCSRMatrix **S_ptr); +HYPRE_Int hypre_BoomerAMGCreateSabsHost ( hypre_ParCSRMatrix *A, HYPRE_Real strength_threshold, + HYPRE_Real max_row_sum, HYPRE_Int num_functions, HYPRE_Int *dof_func, hypre_ParCSRMatrix **S_ptr ); +HYPRE_Int hypre_BoomerAMGCreate2ndSDevice( hypre_ParCSRMatrix *S, HYPRE_Int *CF_marker, + HYPRE_Int num_paths, HYPRE_BigInt *coarse_row_starts, hypre_ParCSRMatrix **C_ptr); HYPRE_Int hypre_BoomerAMGMakeSocFromSDevice( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *S); /* par_sv_interp.c */ -HYPRE_Int hypre_BoomerAMGSmoothInterpVectors ( hypre_ParCSRMatrix *A , HYPRE_Int num_smooth_vecs , hypre_ParVector **smooth_vecs , HYPRE_Int smooth_steps ); -HYPRE_Int hypre_BoomerAMGCoarsenInterpVectors ( hypre_ParCSRMatrix *P , HYPRE_Int num_smooth_vecs , hypre_ParVector **smooth_vecs , HYPRE_Int *CF_marker , hypre_ParVector ***new_smooth_vecs , HYPRE_Int expand_level , HYPRE_Int num_functions ); -HYPRE_Int hypre_BoomerAMG_GMExpandInterp ( hypre_ParCSRMatrix *A , hypre_ParCSRMatrix **P , HYPRE_Int num_smooth_vecs , hypre_ParVector **smooth_vecs , HYPRE_Int *nf , HYPRE_Int *dof_func , hypre_IntArray **coarse_dof_func , HYPRE_Int variant , HYPRE_Int level , HYPRE_Real abs_trunc , HYPRE_Real *weights , HYPRE_Int q_max , HYPRE_Int *CF_marker , HYPRE_Int interp_vec_first_level ); -HYPRE_Int hypre_BoomerAMGRefineInterp ( hypre_ParCSRMatrix *A , hypre_ParCSRMatrix *P , HYPRE_BigInt *num_cpts_global , HYPRE_Int *nf , HYPRE_Int *dof_func , HYPRE_Int *CF_marker , HYPRE_Int level ); +HYPRE_Int hypre_BoomerAMGSmoothInterpVectors ( hypre_ParCSRMatrix *A, HYPRE_Int num_smooth_vecs, + hypre_ParVector **smooth_vecs, HYPRE_Int smooth_steps ); +HYPRE_Int hypre_BoomerAMGCoarsenInterpVectors ( hypre_ParCSRMatrix *P, HYPRE_Int num_smooth_vecs, + hypre_ParVector **smooth_vecs, HYPRE_Int *CF_marker, hypre_ParVector ***new_smooth_vecs, + HYPRE_Int expand_level, HYPRE_Int num_functions ); +HYPRE_Int hypre_BoomerAMG_GMExpandInterp ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **P, + HYPRE_Int num_smooth_vecs, hypre_ParVector **smooth_vecs, HYPRE_Int *nf, HYPRE_Int *dof_func, + hypre_IntArray **coarse_dof_func, HYPRE_Int variant, HYPRE_Int level, HYPRE_Real abs_trunc, + HYPRE_Real *weights, HYPRE_Int q_max, HYPRE_Int *CF_marker, HYPRE_Int interp_vec_first_level ); +HYPRE_Int hypre_BoomerAMGRefineInterp ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P, + HYPRE_BigInt *num_cpts_global, HYPRE_Int *nf, HYPRE_Int *dof_func, HYPRE_Int *CF_marker, + HYPRE_Int level ); /* par_sv_interp_ln.c */ -HYPRE_Int hypre_BoomerAMG_LNExpandInterp ( hypre_ParCSRMatrix *A , hypre_ParCSRMatrix **P , HYPRE_BigInt *num_cpts_global , HYPRE_Int *nf , HYPRE_Int *dof_func , hypre_IntArray **coarse_dof_func , HYPRE_Int *CF_marker , HYPRE_Int level , HYPRE_Real *weights , HYPRE_Int num_smooth_vecs , hypre_ParVector **smooth_vecs , HYPRE_Real abs_trunc , HYPRE_Int q_max , HYPRE_Int interp_vec_first_level ); +HYPRE_Int hypre_BoomerAMG_LNExpandInterp ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **P, + HYPRE_BigInt *num_cpts_global, HYPRE_Int *nf, HYPRE_Int *dof_func, hypre_IntArray **coarse_dof_func, + HYPRE_Int *CF_marker, HYPRE_Int level, HYPRE_Real *weights, HYPRE_Int num_smooth_vecs, + hypre_ParVector **smooth_vecs, HYPRE_Real abs_trunc, HYPRE_Int q_max, + HYPRE_Int interp_vec_first_level ); /* par_sv_interp_lsfit.c */ -HYPRE_Int hypre_BoomerAMGFitInterpVectors ( hypre_ParCSRMatrix *A , hypre_ParCSRMatrix **P , HYPRE_Int num_smooth_vecs , hypre_ParVector **smooth_vecs , hypre_ParVector **coarse_smooth_vecs , HYPRE_Real delta , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int *CF_marker , HYPRE_Int max_elmts , HYPRE_Real trunc_factor , HYPRE_Int variant , HYPRE_Int level ); +HYPRE_Int hypre_BoomerAMGFitInterpVectors ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **P, + HYPRE_Int num_smooth_vecs, hypre_ParVector **smooth_vecs, hypre_ParVector **coarse_smooth_vecs, + HYPRE_Real delta, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int *CF_marker, + HYPRE_Int max_elmts, HYPRE_Real trunc_factor, HYPRE_Int variant, HYPRE_Int level ); /* partial.c */ -HYPRE_Int hypre_BoomerAMGBuildPartialExtPIInterp ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_BigInt *num_old_cpts_global , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int max_elmts , hypre_ParCSRMatrix **P_ptr ); -HYPRE_Int hypre_BoomerAMGBuildPartialStdInterp ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_BigInt *num_old_cpts_global , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int max_elmts , HYPRE_Int sep_weight , hypre_ParCSRMatrix **P_ptr ); -HYPRE_Int hypre_BoomerAMGBuildPartialExtInterp ( hypre_ParCSRMatrix *A , HYPRE_Int *CF_marker , hypre_ParCSRMatrix *S , HYPRE_BigInt *num_cpts_global , HYPRE_BigInt *num_old_cpts_global , HYPRE_Int num_functions , HYPRE_Int *dof_func , HYPRE_Int debug_flag , HYPRE_Real trunc_factor , HYPRE_Int max_elmts , hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGBuildPartialExtPIInterp ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_BigInt *num_old_cpts_global, + HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int debug_flag, HYPRE_Real trunc_factor, + HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGBuildPartialStdInterp ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_BigInt *num_old_cpts_global, + HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int debug_flag, HYPRE_Real trunc_factor, + HYPRE_Int max_elmts, HYPRE_Int sep_weight, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_BoomerAMGBuildPartialExtInterp ( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_BigInt *num_old_cpts_global, + HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int debug_flag, HYPRE_Real trunc_factor, + HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); /* par_vardifconv.c */ -HYPRE_ParCSRMatrix GenerateVarDifConv ( MPI_Comm comm , HYPRE_BigInt nx , HYPRE_BigInt ny , HYPRE_BigInt nz , HYPRE_Int P , HYPRE_Int Q , HYPRE_Int R , HYPRE_Int p , HYPRE_Int q , HYPRE_Int r , HYPRE_Real eps , HYPRE_ParVector *rhs_ptr ); -HYPRE_Real afun ( HYPRE_Real xx , HYPRE_Real yy , HYPRE_Real zz ); -HYPRE_Real bfun ( HYPRE_Real xx , HYPRE_Real yy , HYPRE_Real zz ); -HYPRE_Real cfun ( HYPRE_Real xx , HYPRE_Real yy , HYPRE_Real zz ); -HYPRE_Real dfun ( HYPRE_Real xx , HYPRE_Real yy , HYPRE_Real zz ); -HYPRE_Real efun ( HYPRE_Real xx , HYPRE_Real yy , HYPRE_Real zz ); -HYPRE_Real ffun ( HYPRE_Real xx , HYPRE_Real yy , HYPRE_Real zz ); -HYPRE_Real gfun ( HYPRE_Real xx , HYPRE_Real yy , HYPRE_Real zz ); -HYPRE_Real rfun ( HYPRE_Real xx , HYPRE_Real yy , HYPRE_Real zz ); -HYPRE_Real bndfun ( HYPRE_Real xx , HYPRE_Real yy , HYPRE_Real zz ); +HYPRE_ParCSRMatrix GenerateVarDifConv ( MPI_Comm comm, HYPRE_BigInt nx, HYPRE_BigInt ny, + HYPRE_BigInt nz, HYPRE_Int P, HYPRE_Int Q, HYPRE_Int R, HYPRE_Int p, HYPRE_Int q, HYPRE_Int r, + HYPRE_Real eps, HYPRE_ParVector *rhs_ptr ); +HYPRE_Real afun ( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ); +HYPRE_Real bfun ( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ); +HYPRE_Real cfun ( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ); +HYPRE_Real dfun ( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ); +HYPRE_Real efun ( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ); +HYPRE_Real ffun ( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ); +HYPRE_Real gfun ( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ); +HYPRE_Real rfun ( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ); +HYPRE_Real bndfun ( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ); /* par_vardifconv_rs.c */ -HYPRE_ParCSRMatrix GenerateRSVarDifConv ( MPI_Comm comm , HYPRE_BigInt nx , HYPRE_BigInt ny , HYPRE_BigInt nz , HYPRE_Int P , HYPRE_Int Q , HYPRE_Int R , HYPRE_Int p , HYPRE_Int q , HYPRE_Int r , HYPRE_Real eps , HYPRE_ParVector *rhs_ptr, HYPRE_Int type ); -HYPRE_Real afun_rs ( HYPRE_Real xx , HYPRE_Real yy , HYPRE_Real zz ); -HYPRE_Real bfun_rs ( HYPRE_Real xx , HYPRE_Real yy , HYPRE_Real zz ); -HYPRE_Real cfun_rs ( HYPRE_Real xx , HYPRE_Real yy , HYPRE_Real zz ); -HYPRE_Real dfun_rs ( HYPRE_Real xx , HYPRE_Real yy , HYPRE_Real zz ); -HYPRE_Real efun_rs ( HYPRE_Real xx , HYPRE_Real yy , HYPRE_Real zz ); -HYPRE_Real ffun_rs ( HYPRE_Real xx , HYPRE_Real yy , HYPRE_Real zz ); -HYPRE_Real gfun_rs ( HYPRE_Real xx , HYPRE_Real yy , HYPRE_Real zz ); -HYPRE_Real rfun_rs ( HYPRE_Real xx , HYPRE_Real yy , HYPRE_Real zz ); -HYPRE_Real bndfun_rs ( HYPRE_Real xx , HYPRE_Real yy , HYPRE_Real zz ); +HYPRE_ParCSRMatrix GenerateRSVarDifConv ( MPI_Comm comm, HYPRE_BigInt nx, HYPRE_BigInt ny, + HYPRE_BigInt nz, HYPRE_Int P, HYPRE_Int Q, HYPRE_Int R, HYPRE_Int p, HYPRE_Int q, HYPRE_Int r, + HYPRE_Real eps, HYPRE_ParVector *rhs_ptr, HYPRE_Int type ); +HYPRE_Real afun_rs ( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ); +HYPRE_Real bfun_rs ( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ); +HYPRE_Real cfun_rs ( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ); +HYPRE_Real dfun_rs ( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ); +HYPRE_Real efun_rs ( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ); +HYPRE_Real ffun_rs ( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ); +HYPRE_Real gfun_rs ( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ); +HYPRE_Real rfun_rs ( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ); +HYPRE_Real bndfun_rs ( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ); /* pcg_par.c */ -void *hypre_ParKrylovCAlloc ( size_t count , size_t elt_size, HYPRE_MemoryLocation location ); +void *hypre_ParKrylovCAlloc ( size_t count, size_t elt_size, HYPRE_MemoryLocation location ); HYPRE_Int hypre_ParKrylovFree ( void *ptr ); void *hypre_ParKrylovCreateVector ( void *vvector ); -void *hypre_ParKrylovCreateVectorArray ( HYPRE_Int n , void *vvector ); +void *hypre_ParKrylovCreateVectorArray ( HYPRE_Int n, void *vvector ); HYPRE_Int hypre_ParKrylovDestroyVector ( void *vvector ); -void *hypre_ParKrylovMatvecCreate ( void *A , void *x ); -HYPRE_Int hypre_ParKrylovMatvec ( void *matvec_data , HYPRE_Complex alpha , void *A , void *x , HYPRE_Complex beta , void *y ); -HYPRE_Int hypre_ParKrylovMatvecT ( void *matvec_data , HYPRE_Complex alpha , void *A , void *x , HYPRE_Complex beta , void *y ); +void *hypre_ParKrylovMatvecCreate ( void *A, void *x ); +HYPRE_Int hypre_ParKrylovMatvec ( void *matvec_data, HYPRE_Complex alpha, void *A, void *x, + HYPRE_Complex beta, void *y ); +HYPRE_Int hypre_ParKrylovMatvecT ( void *matvec_data, HYPRE_Complex alpha, void *A, void *x, + HYPRE_Complex beta, void *y ); HYPRE_Int hypre_ParKrylovMatvecDestroy ( void *matvec_data ); -HYPRE_Real hypre_ParKrylovInnerProd ( void *x , void *y ); -HYPRE_Int hypre_ParKrylovMassInnerProd ( void *x , void **y, HYPRE_Int k, HYPRE_Int unroll, void *result ); -HYPRE_Int hypre_ParKrylovMassDotpTwo ( void *x , void *y , void **z, HYPRE_Int k, HYPRE_Int unroll, void *result_x, void *result_y ); -HYPRE_Int hypre_ParKrylovMassAxpy( HYPRE_Complex *alpha, void **x, void *y, HYPRE_Int k, HYPRE_Int unroll); -HYPRE_Int hypre_ParKrylovCopyVector ( void *x , void *y ); +HYPRE_Real hypre_ParKrylovInnerProd ( void *x, void *y ); +HYPRE_Int hypre_ParKrylovMassInnerProd ( void *x, void **y, HYPRE_Int k, HYPRE_Int unroll, + void *result ); +HYPRE_Int hypre_ParKrylovMassDotpTwo ( void *x, void *y, void **z, HYPRE_Int k, HYPRE_Int unroll, + void *result_x, void *result_y ); +HYPRE_Int hypre_ParKrylovMassAxpy( HYPRE_Complex *alpha, void **x, void *y, HYPRE_Int k, + HYPRE_Int unroll); +HYPRE_Int hypre_ParKrylovCopyVector ( void *x, void *y ); HYPRE_Int hypre_ParKrylovClearVector ( void *x ); -HYPRE_Int hypre_ParKrylovScaleVector ( HYPRE_Complex alpha , void *x ); -HYPRE_Int hypre_ParKrylovAxpy ( HYPRE_Complex alpha , void *x , void *y ); -HYPRE_Int hypre_ParKrylovCommInfo ( void *A , HYPRE_Int *my_id , HYPRE_Int *num_procs ); -HYPRE_Int hypre_ParKrylovIdentitySetup ( void *vdata , void *A , void *b , void *x ); -HYPRE_Int hypre_ParKrylovIdentity ( void *vdata , void *A , void *b , void *x ); +HYPRE_Int hypre_ParKrylovScaleVector ( HYPRE_Complex alpha, void *x ); +HYPRE_Int hypre_ParKrylovAxpy ( HYPRE_Complex alpha, void *x, void *y ); +HYPRE_Int hypre_ParKrylovCommInfo ( void *A, HYPRE_Int *my_id, HYPRE_Int *num_procs ); +HYPRE_Int hypre_ParKrylovIdentitySetup ( void *vdata, void *A, void *b, void *x ); +HYPRE_Int hypre_ParKrylovIdentity ( void *vdata, void *A, void *b, void *x ); /* schwarz.c */ -HYPRE_Int hypre_AMGNodalSchwarzSmoother ( hypre_CSRMatrix *A , HYPRE_Int num_functions , HYPRE_Int option , hypre_CSRMatrix **domain_structure_pointer ); -HYPRE_Int hypre_ParMPSchwarzSolve ( hypre_ParCSRMatrix *par_A , hypre_CSRMatrix *A_boundary , hypre_ParVector *rhs_vector , hypre_CSRMatrix *domain_structure , hypre_ParVector *par_x , HYPRE_Real relax_wt , HYPRE_Real *scale , hypre_ParVector *Vtemp , HYPRE_Int *pivots , HYPRE_Int use_nonsymm ); -HYPRE_Int hypre_MPSchwarzSolve ( hypre_ParCSRMatrix *par_A , hypre_Vector *rhs_vector , hypre_CSRMatrix *domain_structure , hypre_ParVector *par_x , HYPRE_Real relax_wt , hypre_Vector *aux_vector , HYPRE_Int *pivots , HYPRE_Int use_nonsymm ); -HYPRE_Int hypre_MPSchwarzCFSolve ( hypre_ParCSRMatrix *par_A , hypre_Vector *rhs_vector , hypre_CSRMatrix *domain_structure , hypre_ParVector *par_x , HYPRE_Real relax_wt , hypre_Vector *aux_vector , HYPRE_Int *CF_marker , HYPRE_Int rlx_pt , HYPRE_Int *pivots , HYPRE_Int use_nonsymm ); -HYPRE_Int hypre_MPSchwarzFWSolve ( hypre_ParCSRMatrix *par_A , hypre_Vector *rhs_vector , hypre_CSRMatrix *domain_structure , hypre_ParVector *par_x , HYPRE_Real relax_wt , hypre_Vector *aux_vector , HYPRE_Int *pivots , HYPRE_Int use_nonsymm ); -HYPRE_Int hypre_MPSchwarzCFFWSolve ( hypre_ParCSRMatrix *par_A , hypre_Vector *rhs_vector , hypre_CSRMatrix *domain_structure , hypre_ParVector *par_x , HYPRE_Real relax_wt , hypre_Vector *aux_vector , HYPRE_Int *CF_marker , HYPRE_Int rlx_pt , HYPRE_Int *pivots , HYPRE_Int use_nonsymm ); -HYPRE_Int transpose_matrix_create ( HYPRE_Int **i_face_element_pointer , HYPRE_Int **j_face_element_pointer , HYPRE_Int *i_element_face , HYPRE_Int *j_element_face , HYPRE_Int num_elements , HYPRE_Int num_faces ); -HYPRE_Int matrix_matrix_product ( HYPRE_Int **i_element_edge_pointer , HYPRE_Int **j_element_edge_pointer , HYPRE_Int *i_element_face , HYPRE_Int *j_element_face , HYPRE_Int *i_face_edge , HYPRE_Int *j_face_edge , HYPRE_Int num_elements , HYPRE_Int num_faces , HYPRE_Int num_edges ); -HYPRE_Int hypre_AMGCreateDomainDof ( hypre_CSRMatrix *A , HYPRE_Int domain_type , HYPRE_Int overlap , HYPRE_Int num_functions , HYPRE_Int *dof_func , hypre_CSRMatrix **domain_structure_pointer , HYPRE_Int **piv_pointer , HYPRE_Int use_nonsymm ); -HYPRE_Int hypre_AMGeAgglomerate ( HYPRE_Int *i_AE_element , HYPRE_Int *j_AE_element , HYPRE_Int *i_face_face , HYPRE_Int *j_face_face , HYPRE_Int *w_face_face , HYPRE_Int *i_face_element , HYPRE_Int *j_face_element , HYPRE_Int *i_element_face , HYPRE_Int *j_element_face , HYPRE_Int *i_face_to_prefer_weight , HYPRE_Int *i_face_weight , HYPRE_Int num_faces , HYPRE_Int num_elements , HYPRE_Int *num_AEs_pointer ); -HYPRE_Int hypre_update_entry ( HYPRE_Int weight , HYPRE_Int *weight_max , HYPRE_Int *previous , HYPRE_Int *next , HYPRE_Int *first , HYPRE_Int *last , HYPRE_Int head , HYPRE_Int tail , HYPRE_Int i ); -HYPRE_Int hypre_remove_entry ( HYPRE_Int weight , HYPRE_Int *weight_max , HYPRE_Int *previous , HYPRE_Int *next , HYPRE_Int *first , HYPRE_Int *last , HYPRE_Int head , HYPRE_Int tail , HYPRE_Int i ); -HYPRE_Int hypre_move_entry ( HYPRE_Int weight , HYPRE_Int *weight_max , HYPRE_Int *previous , HYPRE_Int *next , HYPRE_Int *first , HYPRE_Int *last , HYPRE_Int head , HYPRE_Int tail , HYPRE_Int i ); -HYPRE_Int hypre_matinv ( HYPRE_Real *x , HYPRE_Real *a , HYPRE_Int k ); -HYPRE_Int hypre_parCorrRes ( hypre_ParCSRMatrix *A , hypre_ParVector *x , hypre_Vector *rhs , hypre_Vector **tmp_ptr ); -HYPRE_Int hypre_AdSchwarzSolve ( hypre_ParCSRMatrix *par_A , hypre_ParVector *par_rhs , hypre_CSRMatrix *domain_structure , HYPRE_Real *scale , hypre_ParVector *par_x , hypre_ParVector *par_aux , HYPRE_Int *pivots , HYPRE_Int use_nonsymm ); -HYPRE_Int hypre_AdSchwarzCFSolve ( hypre_ParCSRMatrix *par_A , hypre_ParVector *par_rhs , hypre_CSRMatrix *domain_structure , HYPRE_Real *scale , hypre_ParVector *par_x , hypre_ParVector *par_aux , HYPRE_Int *CF_marker , HYPRE_Int rlx_pt , HYPRE_Int *pivots , HYPRE_Int use_nonsymm ); -HYPRE_Int hypre_GenerateScale ( hypre_CSRMatrix *domain_structure , HYPRE_Int num_variables , HYPRE_Real relaxation_weight , HYPRE_Real **scale_pointer ); -HYPRE_Int hypre_ParAdSchwarzSolve ( hypre_ParCSRMatrix *A , hypre_ParVector *F , hypre_CSRMatrix *domain_structure , HYPRE_Real *scale , hypre_ParVector *X , hypre_ParVector *Vtemp , HYPRE_Int *pivots , HYPRE_Int use_nonsymm ); -HYPRE_Int hypre_ParAMGCreateDomainDof ( hypre_ParCSRMatrix *A , HYPRE_Int domain_type , HYPRE_Int overlap , HYPRE_Int num_functions , HYPRE_Int *dof_func , hypre_CSRMatrix **domain_structure_pointer , HYPRE_Int **piv_pointer , HYPRE_Int use_nonsymm ); -HYPRE_Int hypre_ParGenerateScale ( hypre_ParCSRMatrix *A , hypre_CSRMatrix *domain_structure , HYPRE_Real relaxation_weight , HYPRE_Real **scale_pointer ); -HYPRE_Int hypre_ParGenerateHybridScale ( hypre_ParCSRMatrix *A , hypre_CSRMatrix *domain_structure , hypre_CSRMatrix **A_boundary_pointer , HYPRE_Real **scale_pointer ); +HYPRE_Int hypre_AMGNodalSchwarzSmoother ( hypre_CSRMatrix *A, HYPRE_Int num_functions, + HYPRE_Int option, hypre_CSRMatrix **domain_structure_pointer ); +HYPRE_Int hypre_ParMPSchwarzSolve ( hypre_ParCSRMatrix *par_A, hypre_CSRMatrix *A_boundary, + hypre_ParVector *rhs_vector, hypre_CSRMatrix *domain_structure, hypre_ParVector *par_x, + HYPRE_Real relax_wt, HYPRE_Real *scale, hypre_ParVector *Vtemp, HYPRE_Int *pivots, + HYPRE_Int use_nonsymm ); +HYPRE_Int hypre_MPSchwarzSolve ( hypre_ParCSRMatrix *par_A, hypre_Vector *rhs_vector, + hypre_CSRMatrix *domain_structure, hypre_ParVector *par_x, HYPRE_Real relax_wt, + hypre_Vector *aux_vector, HYPRE_Int *pivots, HYPRE_Int use_nonsymm ); +HYPRE_Int hypre_MPSchwarzCFSolve ( hypre_ParCSRMatrix *par_A, hypre_Vector *rhs_vector, + hypre_CSRMatrix *domain_structure, hypre_ParVector *par_x, HYPRE_Real relax_wt, + hypre_Vector *aux_vector, HYPRE_Int *CF_marker, HYPRE_Int rlx_pt, HYPRE_Int *pivots, + HYPRE_Int use_nonsymm ); +HYPRE_Int hypre_MPSchwarzFWSolve ( hypre_ParCSRMatrix *par_A, hypre_Vector *rhs_vector, + hypre_CSRMatrix *domain_structure, hypre_ParVector *par_x, HYPRE_Real relax_wt, + hypre_Vector *aux_vector, HYPRE_Int *pivots, HYPRE_Int use_nonsymm ); +HYPRE_Int hypre_MPSchwarzCFFWSolve ( hypre_ParCSRMatrix *par_A, hypre_Vector *rhs_vector, + hypre_CSRMatrix *domain_structure, hypre_ParVector *par_x, HYPRE_Real relax_wt, + hypre_Vector *aux_vector, HYPRE_Int *CF_marker, HYPRE_Int rlx_pt, HYPRE_Int *pivots, + HYPRE_Int use_nonsymm ); +HYPRE_Int transpose_matrix_create ( HYPRE_Int **i_face_element_pointer, + HYPRE_Int **j_face_element_pointer, HYPRE_Int *i_element_face, HYPRE_Int *j_element_face, + HYPRE_Int num_elements, HYPRE_Int num_faces ); +HYPRE_Int matrix_matrix_product ( HYPRE_Int **i_element_edge_pointer, + HYPRE_Int **j_element_edge_pointer, HYPRE_Int *i_element_face, HYPRE_Int *j_element_face, + HYPRE_Int *i_face_edge, HYPRE_Int *j_face_edge, HYPRE_Int num_elements, HYPRE_Int num_faces, + HYPRE_Int num_edges ); +HYPRE_Int hypre_AMGCreateDomainDof ( hypre_CSRMatrix *A, HYPRE_Int domain_type, HYPRE_Int overlap, + HYPRE_Int num_functions, HYPRE_Int *dof_func, hypre_CSRMatrix **domain_structure_pointer, + HYPRE_Int **piv_pointer, HYPRE_Int use_nonsymm ); +HYPRE_Int hypre_AMGeAgglomerate ( HYPRE_Int *i_AE_element, HYPRE_Int *j_AE_element, + HYPRE_Int *i_face_face, HYPRE_Int *j_face_face, HYPRE_Int *w_face_face, HYPRE_Int *i_face_element, + HYPRE_Int *j_face_element, HYPRE_Int *i_element_face, HYPRE_Int *j_element_face, + HYPRE_Int *i_face_to_prefer_weight, HYPRE_Int *i_face_weight, HYPRE_Int num_faces, + HYPRE_Int num_elements, HYPRE_Int *num_AEs_pointer ); +HYPRE_Int hypre_update_entry ( HYPRE_Int weight, HYPRE_Int *weight_max, HYPRE_Int *previous, + HYPRE_Int *next, HYPRE_Int *first, HYPRE_Int *last, HYPRE_Int head, HYPRE_Int tail, HYPRE_Int i ); +HYPRE_Int hypre_remove_entry ( HYPRE_Int weight, HYPRE_Int *weight_max, HYPRE_Int *previous, + HYPRE_Int *next, HYPRE_Int *first, HYPRE_Int *last, HYPRE_Int head, HYPRE_Int tail, HYPRE_Int i ); +HYPRE_Int hypre_move_entry ( HYPRE_Int weight, HYPRE_Int *weight_max, HYPRE_Int *previous, + HYPRE_Int *next, HYPRE_Int *first, HYPRE_Int *last, HYPRE_Int head, HYPRE_Int tail, HYPRE_Int i ); +HYPRE_Int hypre_matinv ( HYPRE_Real *x, HYPRE_Real *a, HYPRE_Int k ); +HYPRE_Int hypre_parCorrRes ( hypre_ParCSRMatrix *A, hypre_ParVector *x, hypre_Vector *rhs, + hypre_Vector **tmp_ptr ); +HYPRE_Int hypre_AdSchwarzSolve ( hypre_ParCSRMatrix *par_A, hypre_ParVector *par_rhs, + hypre_CSRMatrix *domain_structure, HYPRE_Real *scale, hypre_ParVector *par_x, + hypre_ParVector *par_aux, HYPRE_Int *pivots, HYPRE_Int use_nonsymm ); +HYPRE_Int hypre_AdSchwarzCFSolve ( hypre_ParCSRMatrix *par_A, hypre_ParVector *par_rhs, + hypre_CSRMatrix *domain_structure, HYPRE_Real *scale, hypre_ParVector *par_x, + hypre_ParVector *par_aux, HYPRE_Int *CF_marker, HYPRE_Int rlx_pt, HYPRE_Int *pivots, + HYPRE_Int use_nonsymm ); +HYPRE_Int hypre_GenerateScale ( hypre_CSRMatrix *domain_structure, HYPRE_Int num_variables, + HYPRE_Real relaxation_weight, HYPRE_Real **scale_pointer ); +HYPRE_Int hypre_ParAdSchwarzSolve ( hypre_ParCSRMatrix *A, hypre_ParVector *F, + hypre_CSRMatrix *domain_structure, HYPRE_Real *scale, hypre_ParVector *X, hypre_ParVector *Vtemp, + HYPRE_Int *pivots, HYPRE_Int use_nonsymm ); +HYPRE_Int hypre_ParAMGCreateDomainDof ( hypre_ParCSRMatrix *A, HYPRE_Int domain_type, + HYPRE_Int overlap, HYPRE_Int num_functions, HYPRE_Int *dof_func, + hypre_CSRMatrix **domain_structure_pointer, HYPRE_Int **piv_pointer, HYPRE_Int use_nonsymm ); +HYPRE_Int hypre_ParGenerateScale ( hypre_ParCSRMatrix *A, hypre_CSRMatrix *domain_structure, + HYPRE_Real relaxation_weight, HYPRE_Real **scale_pointer ); +HYPRE_Int hypre_ParGenerateHybridScale ( hypre_ParCSRMatrix *A, hypre_CSRMatrix *domain_structure, + hypre_CSRMatrix **A_boundary_pointer, HYPRE_Real **scale_pointer ); /* par_restr.c, par_lr_restr.c */ -HYPRE_Int hypre_BoomerAMGBuildRestrAIR( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Real filter_thresholdR, HYPRE_Int debug_flag, hypre_ParCSRMatrix **R_ptr, HYPRE_Int is_triangular, HYPRE_Int gmres_switch); -HYPRE_Int hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Real filter_thresholdR, HYPRE_Int debug_flag, hypre_ParCSRMatrix **R_ptr, HYPRE_Int AIR1_5, HYPRE_Int is_triangular, HYPRE_Int gmres_switch); -HYPRE_Int hypre_BoomerAMGBuildRestrNeumannAIR( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int NeumannDeg, HYPRE_Real strong_thresholdR, HYPRE_Real filter_thresholdR, HYPRE_Int debug_flag, hypre_ParCSRMatrix **R_ptr); -HYPRE_Int hypre_BoomerAMGBuildRestrNeumannAIRDevice( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int NeumannDeg, HYPRE_Real strong_thresholdR, HYPRE_Real filter_thresholdR, HYPRE_Int debug_flag, hypre_ParCSRMatrix **R_ptr); +HYPRE_Int hypre_BoomerAMGBuildRestrAIR( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Real filter_thresholdR, HYPRE_Int debug_flag, hypre_ParCSRMatrix **R_ptr, + HYPRE_Int is_triangular, HYPRE_Int gmres_switch); +HYPRE_Int hypre_BoomerAMGBuildRestrDist2AIR( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, + HYPRE_Real filter_thresholdR, HYPRE_Int debug_flag, hypre_ParCSRMatrix **R_ptr, HYPRE_Int AIR1_5, + HYPRE_Int is_triangular, HYPRE_Int gmres_switch); +HYPRE_Int hypre_BoomerAMGBuildRestrNeumannAIR( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int NeumannDeg, + HYPRE_Real strong_thresholdR, HYPRE_Real filter_thresholdR, HYPRE_Int debug_flag, + hypre_ParCSRMatrix **R_ptr); +HYPRE_Int hypre_BoomerAMGBuildRestrNeumannAIRDevice( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int NeumannDeg, + HYPRE_Real strong_thresholdR, HYPRE_Real filter_thresholdR, HYPRE_Int debug_flag, + hypre_ParCSRMatrix **R_ptr); HYPRE_Int hypre_BoomerAMGCFMarkerTo1minus1Device( HYPRE_Int *CF_marker, HYPRE_Int size ); #ifdef HYPRE_USING_DSUPERLU @@ -1370,46 +2104,101 @@ HYPRE_Int hypre_SLUDistDestroy( void* solver); void *hypre_MGRCreate ( void ); HYPRE_Int hypre_MGRDestroy ( void *mgr_vdata ); HYPRE_Int hypre_MGRCycle( void *mgr_vdata, hypre_ParVector **F_array, hypre_ParVector **U_array ); -void *hypre_MGRCreateFrelaxVcycleData(); +void *hypre_MGRCreateFrelaxVcycleData( void ); HYPRE_Int hypre_MGRDestroyFrelaxVcycleData( void *mgr_vdata ); -HYPRE_Int hypre_MGRSetupFrelaxVcycleData( void *mgr_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int level); +void *hypre_MGRCreateGSElimData( void ); +HYPRE_Int hypre_MGRDestroyGSElimData( void *mgr_vdata ); +HYPRE_Int hypre_MGRSetupFrelaxVcycleData( void *mgr_vdata, hypre_ParCSRMatrix *A, + hypre_ParVector *f, hypre_ParVector *u, + HYPRE_Int level ); HYPRE_Int hypre_MGRFrelaxVcycle ( void *mgr_vdata, hypre_ParVector *f, hypre_ParVector *u ); -HYPRE_Int hypre_MGRSetCpointsByBlock( void *mgr_vdata, HYPRE_Int block_size, HYPRE_Int max_num_levels, HYPRE_Int *block_num_coarse_points, HYPRE_Int **block_coarse_indexes); -HYPRE_Int hypre_MGRSetCpointsByContiguousBlock( void *mgr_vdata, HYPRE_Int block_size, HYPRE_Int max_num_levels, HYPRE_BigInt *begin_idx_array, HYPRE_Int *block_num_coarse_points, HYPRE_Int **block_coarse_indexes); -HYPRE_Int hypre_MGRSetCpointsByPointMarkerArray( void *mgr_vdata, HYPRE_Int block_size, HYPRE_Int max_num_levels, HYPRE_Int *block_num_coarse_points, HYPRE_Int **block_coarse_indexes, HYPRE_Int *point_marker_array); -HYPRE_Int hypre_MGRCoarsen(hypre_ParCSRMatrix *S, hypre_ParCSRMatrix *A,HYPRE_Int final_coarse_size,HYPRE_Int *final_coarse_indexes,HYPRE_Int debug_flag,hypre_IntArray **CF_marker,HYPRE_Int last_level); -HYPRE_Int hypre_MGRSetReservedCoarseNodes(void *mgr_vdata, HYPRE_Int reserved_coarse_size, HYPRE_BigInt *reserved_coarse_nodes); -HYPRE_Int hypre_MGRSetReservedCpointsLevelToKeep( void *mgr_vdata, HYPRE_Int level); -HYPRE_Int hypre_MGRSetMaxGlobalsmoothIters( void *mgr_vdata, HYPRE_Int max_iter ); -HYPRE_Int hypre_MGRSetGlobalsmoothType( void *mgr_vdata, HYPRE_Int iter_type ); -HYPRE_Int hypre_MGRSetNonCpointsToFpoints( void *mgr_vdata, HYPRE_Int nonCptToFptFlag); - +HYPRE_Int hypre_MGRSetCpointsByBlock( void *mgr_vdata, HYPRE_Int block_size, + HYPRE_Int max_num_levels, + HYPRE_Int *block_num_coarse_points, + HYPRE_Int **block_coarse_indexes ); +HYPRE_Int hypre_MGRSetCpointsByContiguousBlock( void *mgr_vdata, HYPRE_Int block_size, + HYPRE_Int max_num_levels, + HYPRE_BigInt *begin_idx_array, + HYPRE_Int *block_num_coarse_points, + HYPRE_Int **block_coarse_indexes ); +HYPRE_Int hypre_MGRSetCpointsByPointMarkerArray( void *mgr_vdata, HYPRE_Int block_size, + HYPRE_Int max_num_levels, + HYPRE_Int *block_num_coarse_points, + HYPRE_Int **block_coarse_indexes, + HYPRE_Int *point_marker_array ); +HYPRE_Int hypre_MGRCoarsen( hypre_ParCSRMatrix *S, hypre_ParCSRMatrix *A, + HYPRE_Int final_coarse_size, HYPRE_Int *final_coarse_indexes, + HYPRE_Int debug_flag, hypre_IntArray **CF_marker, + HYPRE_Int last_level ); +HYPRE_Int hypre_MGRSetReservedCoarseNodes( void *mgr_vdata, HYPRE_Int reserved_coarse_size, + HYPRE_BigInt *reserved_coarse_nodes ); +HYPRE_Int hypre_MGRSetReservedCpointsLevelToKeep( void *mgr_vdata, HYPRE_Int level ); +HYPRE_Int hypre_MGRSetMaxGlobalSmoothIters( void *mgr_vdata, HYPRE_Int max_iter ); +HYPRE_Int hypre_MGRSetGlobalSmoothType( void *mgr_vdata, HYPRE_Int iter_type ); +HYPRE_Int hypre_MGRSetNonCpointsToFpoints( void *mgr_vdata, HYPRE_Int nonCptToFptFlag ); //HYPRE_Int hypre_MGRInitCFMarker(HYPRE_Int num_variables, HYPRE_Int *CF_marker, HYPRE_Int initial_coarse_size,HYPRE_Int *initial_coarse_indexes); //HYPRE_Int hypre_MGRUpdateCoarseIndexes(HYPRE_Int num_variables, HYPRE_Int *CF_marker, HYPRE_Int initial_coarse_size,HYPRE_Int *initial_coarse_indexes); -HYPRE_Int hypre_MGRBuildInterp(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P, HYPRE_Int method, HYPRE_Int numsweeps); -HYPRE_Int hypre_MGRBuildRestrict(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int debug_flag, HYPRE_Real trunc_factor, HYPRE_Int max_elmts, HYPRE_Real strong_threshold, HYPRE_Real max_row_sum, hypre_ParCSRMatrix **RT, HYPRE_Int method, HYPRE_Int numsweeps); -//HYPRE_Int hypre_MGRBuildRestrictionToper(hypre_ParCSRMatrix *AT, HYPRE_Int *CF_marker, hypre_ParCSRMatrix *ST, HYPRE_Int *num_cpts_global,HYPRE_Int num_functions,HYPRE_Int *dof_func,HYPRE_Int debug_flag,HYPRE_Real trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **RT,HYPRE_Int last_level,HYPRE_Int level, HYPRE_Int numsweeps); -//HYPRE_Int hypre_BoomerAMGBuildInjectionInterp( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, HYPRE_Int *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int debug_flag,HYPRE_Int init_data,hypre_ParCSRMatrix **P_ptr); -HYPRE_Int hypre_MGRSetCoarseSolver( void *mgr_vdata, HYPRE_Int (*coarse_grid_solver_solve)(void*,void*,void*,void*), HYPRE_Int (*coarse_grid_solver_setup)(void*,void*,void*,void*), void *coarse_grid_solver ); -HYPRE_Int hypre_MGRSetFSolver( void *mgr_vdata, HYPRE_Int (*fine_grid_solver_solve)(void*,void*,void*,void*), HYPRE_Int (*fine_grid_solver_setup)(void*,void*,void*,void*), void *fsolver ); -HYPRE_Int hypre_MGRSetup( void *mgr_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); -HYPRE_Int hypre_MGRSolve( void *mgr_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); -HYPRE_Int hypre_block_jacobi_scaling(hypre_ParCSRMatrix *A,hypre_ParCSRMatrix **B_ptr,void *mgr_vdata,HYPRE_Int debug_flag); -HYPRE_Int hypre_blockRelax_solve(hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Real blk_size, HYPRE_Int n_block, HYPRE_Int left_size, HYPRE_Int method, HYPRE_Real *diaginv, hypre_ParVector *Vtemp); -HYPRE_Int hypre_blockRelax_setup(hypre_ParCSRMatrix *A,HYPRE_Int blk_size, HYPRE_Int reserved_coarse_size, HYPRE_Real **diaginvptr); -HYPRE_Int hypre_blockRelax(hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int blk_size, HYPRE_Int reserved_coarse_size, HYPRE_Int method, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp); - +HYPRE_Int hypre_ParCSRMatrixExtractBlockDiagHost( hypre_ParCSRMatrix *par_A, HYPRE_Int blk_size, + HYPRE_Int num_points, HYPRE_Int point_type, + HYPRE_Int *CF_marker, HYPRE_Int diag_size, + HYPRE_Int diag_type, HYPRE_Real *diag_data ); +HYPRE_Int hypre_ParCSRMatrixBlockDiagMatrix( hypre_ParCSRMatrix *A, HYPRE_Int blk_size, + HYPRE_Int point_type, HYPRE_Int *CF_marker, + HYPRE_Int diag_type, hypre_ParCSRMatrix **B_ptr ); +HYPRE_Int hypre_ParCSRMatrixBlockDiagMatrixHost( hypre_ParCSRMatrix *A, HYPRE_Int blk_size, + HYPRE_Int point_type, HYPRE_Int *CF_marker, + HYPRE_Int diag_type, + hypre_ParCSRMatrix **B_ptr ); +HYPRE_Int hypre_MGRSetCoarseSolver( void *mgr_vdata, + HYPRE_Int (*cgrid_solver_solve)(void*, void*, void*, void*), + HYPRE_Int (*cgrid_solver_setup)(void*, void*, void*, void*), + void *coarse_grid_solver ); +HYPRE_Int hypre_MGRSetFSolver( void *mgr_vdata, + HYPRE_Int (*fine_grid_solver_solve)(void*, void*, void*, void*), + HYPRE_Int (*fine_grid_solver_setup)(void*, void*, void*, void*), + void *fsolver ); +HYPRE_Int hypre_MGRSetFSolverAtLevel( void *mgr_vdata, void *fsolver, HYPRE_Int level ); +HYPRE_Int hypre_MGRSetup( void *mgr_vdata, hypre_ParCSRMatrix *A, + hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int hypre_MGRSolve( void *mgr_vdata, hypre_ParCSRMatrix *A, + hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int hypre_block_jacobi_scaling( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **B_ptr, + void *mgr_vdata, HYPRE_Int debug_flag ); +HYPRE_Int hypre_MGRBlockRelaxSolveDevice( hypre_ParCSRMatrix *B, hypre_ParCSRMatrix *A, + hypre_ParVector *f, hypre_ParVector *u, + hypre_ParVector *Vtemp, HYPRE_Real relax_weight ); +HYPRE_Int hypre_MGRBlockRelaxSolve( hypre_ParCSRMatrix *A, hypre_ParVector *f, + hypre_ParVector *u, HYPRE_Int blk_size, + HYPRE_Int n_block, HYPRE_Int left_size, + HYPRE_Int method, HYPRE_Real *diaginv, + hypre_ParVector *Vtemp ); +HYPRE_Int hypre_BlockDiagInvLapack( HYPRE_Real *diag, HYPRE_Int N, HYPRE_Int blk_size ); +HYPRE_Int hypre_MGRBlockRelaxSetup( hypre_ParCSRMatrix *A, HYPRE_Int blk_size, + HYPRE_Real **diaginvptr ); +//HYPRE_Int hypre_blockRelax(hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, +// HYPRE_Int blk_size, HYPRE_Int reserved_coarse_size, HYPRE_Int method, hypre_ParVector *Vtemp, +// hypre_ParVector *Ztemp); +HYPRE_Int hypre_block_jacobi_solve( hypre_ParCSRMatrix *A, hypre_ParVector *f, + hypre_ParVector *u, HYPRE_Int blk_size, + HYPRE_Int method, HYPRE_Real *diaginv, + hypre_ParVector *Vtemp ); //HYPRE_Int hypre_MGRBuildAffRAP( MPI_Comm comm, HYPRE_Int local_num_variables, HYPRE_Int num_functions, //HYPRE_Int *dof_func, HYPRE_Int *CF_marker, HYPRE_Int **coarse_dof_func_ptr, HYPRE_BigInt **coarse_pnts_global_ptr, //hypre_ParCSRMatrix *A, HYPRE_Int debug_flag, hypre_ParCSRMatrix **P_f_ptr, hypre_ParCSRMatrix **A_ff_ptr ); -HYPRE_Int hypre_MGRGetSubBlock( hypre_ParCSRMatrix *A, HYPRE_Int *row_cf_marker, HYPRE_Int *col_cf_marker, HYPRE_Int debug_flag, hypre_ParCSRMatrix **A_ff_ptr ); -HYPRE_Int hypre_MGRBuildAff( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, HYPRE_Int debug_flag, hypre_ParCSRMatrix **A_ff_ptr ); -HYPRE_Int hypre_MGRApproximateInverse(hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **A_inv); -HYPRE_Int hypre_MGRAddVectorP ( HYPRE_Int *CF_marker, HYPRE_Int point_type, HYPRE_Real a, hypre_ParVector *fromVector, HYPRE_Real b, hypre_ParVector **toVector ); -HYPRE_Int hypre_MGRAddVectorR ( HYPRE_Int *CF_marker, HYPRE_Int point_type, HYPRE_Real a, hypre_ParVector *fromVector, HYPRE_Real b, hypre_ParVector **toVector ); -HYPRE_Int hypre_MGRComputeNonGalerkinCoarseGrid(hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P, hypre_ParCSRMatrix *RT, HYPRE_Int bsize, HYPRE_Int ordering, HYPRE_Int method, HYPRE_Int Pmax, HYPRE_Int keep_stencil, HYPRE_Int *CF_marker, hypre_ParCSRMatrix **A_h_ptr); - -HYPRE_Int hypre_MGRWriteSolverParams(void *mgr_vdata); +HYPRE_Int hypre_MGRGetSubBlock( hypre_ParCSRMatrix *A, HYPRE_Int *row_cf_marker, + HYPRE_Int *col_cf_marker, HYPRE_Int debug_flag, + hypre_ParCSRMatrix **A_ff_ptr ); +HYPRE_Int hypre_MGRBuildAff( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, HYPRE_Int debug_flag, + hypre_ParCSRMatrix **A_ff_ptr ); +HYPRE_Int hypre_MGRApproximateInverse( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **A_inv ); +HYPRE_Int hypre_MGRAddVectorP( hypre_IntArray *CF_marker, HYPRE_Int point_type, HYPRE_Real a, + hypre_ParVector *fromVector, HYPRE_Real b, + hypre_ParVector **toVector ); +HYPRE_Int hypre_MGRAddVectorR( hypre_IntArray *CF_marker, HYPRE_Int point_type, HYPRE_Real a, + hypre_ParVector *fromVector, HYPRE_Real b, + hypre_ParVector **toVector ); +HYPRE_Int hypre_MGRTruncateAcfCPRDevice( hypre_ParCSRMatrix *A_CF, + hypre_ParCSRMatrix **A_CF_new_ptr ); HYPRE_Int hypre_MGRSetAffSolverType( void *systg_vdata, HYPRE_Int *aff_solver_type ); HYPRE_Int hypre_MGRSetCoarseSolverType( void *systg_vdata, HYPRE_Int coarse_solver_type ); HYPRE_Int hypre_MGRSetCoarseSolverIter( void *systg_vdata, HYPRE_Int coarse_solver_iter ); @@ -1418,30 +2207,43 @@ HYPRE_Int hypre_MGRSetFineSolverMaxLevels( void *systg_vdata, HYPRE_Int fine_sol HYPRE_Int hypre_MGRSetMaxCoarseLevels( void *mgr_vdata, HYPRE_Int maxlev ); HYPRE_Int hypre_MGRSetBlockSize( void *mgr_vdata, HYPRE_Int bsize ); HYPRE_Int hypre_MGRSetRelaxType( void *mgr_vdata, HYPRE_Int relax_type ); -HYPRE_Int hypre_MGRSetFRelaxMethod( void *mgr_vdata, HYPRE_Int relax_method); -HYPRE_Int hypre_MGRSetLevelFRelaxMethod( void *mgr_vdata, HYPRE_Int *relax_method); -HYPRE_Int hypre_MGRSetLevelFRelaxNumFunctions( void *mgr_vdata, HYPRE_Int *num_functions); -HYPRE_Int hypre_MGRSetCoarseGridMethod( void *mgr_vdata, HYPRE_Int *cg_method); -HYPRE_Int hypre_MGRSetRestrictType( void *mgr_vdata, HYPRE_Int restrictType); -HYPRE_Int hypre_MGRSetLevelRestrictType( void *mgr_vdata, HYPRE_Int *restrictType); -HYPRE_Int hypre_MGRSetInterpType( void *mgr_vdata, HYPRE_Int interpType); -HYPRE_Int hypre_MGRSetLevelInterpType( void *mgr_vdata, HYPRE_Int *interpType); +HYPRE_Int hypre_MGRSetFRelaxMethod( void *mgr_vdata, HYPRE_Int relax_method ); +HYPRE_Int hypre_MGRSetLevelFRelaxMethod( void *mgr_vdata, HYPRE_Int *relax_method ); +HYPRE_Int hypre_MGRSetLevelFRelaxType( void *mgr_vdata, HYPRE_Int *relax_type ); +HYPRE_Int hypre_MGRSetLevelFRelaxNumFunctions( void *mgr_vdata, HYPRE_Int *num_functions ); +HYPRE_Int hypre_MGRSetCoarseGridMethod( void *mgr_vdata, HYPRE_Int *cg_method ); +HYPRE_Int hypre_MGRSetNonGalerkinMaxElmts( void *mgr_vdata, HYPRE_Int max_elmts ); +HYPRE_Int hypre_MGRSetLevelNonGalerkinMaxElmts( void *mgr_vdata, HYPRE_Int *max_elmts ); +HYPRE_Int hypre_MGRSetRestrictType( void *mgr_vdata, HYPRE_Int restrictType ); +HYPRE_Int hypre_MGRSetLevelRestrictType( void *mgr_vdata, HYPRE_Int *restrictType ); +HYPRE_Int hypre_MGRSetInterpType( void *mgr_vdata, HYPRE_Int interpType ); +HYPRE_Int hypre_MGRSetLevelInterpType( void *mgr_vdata, HYPRE_Int *interpType ); HYPRE_Int hypre_MGRSetNumRelaxSweeps( void *mgr_vdata, HYPRE_Int nsweeps ); +HYPRE_Int hypre_MGRSetLevelNumRelaxSweeps( void *mgr_vdata, HYPRE_Int *nsweeps ); HYPRE_Int hypre_MGRSetNumInterpSweeps( void *mgr_vdata, HYPRE_Int nsweeps ); HYPRE_Int hypre_MGRSetNumRestrictSweeps( void *mgr_vdata, HYPRE_Int nsweeps ); +HYPRE_Int hypre_MGRSetLevelSmoothType( void *mgr_vdata, HYPRE_Int *level_smooth_type ); +HYPRE_Int hypre_MGRSetLevelSmoothIters( void *mgr_vdata, HYPRE_Int *level_smooth_iters ); +HYPRE_Int hypre_MGRSetGlobalSmoothCycle( void *mgr_vdata, HYPRE_Int global_smooth_cycle ); +HYPRE_Int hypre_MGRSetGlobalSmootherAtLevel( void *mgr_vdata, HYPRE_Solver smoother, + HYPRE_Int level ); HYPRE_Int hypre_MGRSetPrintLevel( void *mgr_vdata, HYPRE_Int print_level ); HYPRE_Int hypre_MGRSetFrelaxPrintLevel( void *mgr_vdata, HYPRE_Int print_level ); HYPRE_Int hypre_MGRSetCoarseGridPrintLevel( void *mgr_vdata, HYPRE_Int print_level ); -HYPRE_Int hypre_MGRSetTruncateCoarseGridThreshold( void *mgr_vdata, HYPRE_Real threshold); +HYPRE_Int hypre_MGRSetTruncateCoarseGridThreshold( void *mgr_vdata, HYPRE_Real threshold ); +HYPRE_Int hypre_MGRSetBlockJacobiBlockSize( void *mgr_vdata, HYPRE_Int blk_size ); HYPRE_Int hypre_MGRSetLogging( void *mgr_vdata, HYPRE_Int logging ); HYPRE_Int hypre_MGRSetMaxIter( void *mgr_vdata, HYPRE_Int max_iter ); -HYPRE_Int hypre_MGRSetPMaxElmts( void *mgr_vdata, HYPRE_Int P_max_elmts); +HYPRE_Int hypre_MGRSetPMaxElmts( void *mgr_vdata, HYPRE_Int P_max_elmts ); +HYPRE_Int hypre_MGRSetLevelPMaxElmts( void *mgr_vdata, HYPRE_Int *P_max_elmts ); HYPRE_Int hypre_MGRSetTol( void *mgr_vdata, HYPRE_Real tol ); -HYPRE_Int hypre_MGRSetAffInv( void *mgr_vdata, hypre_ParCSRMatrix *A_ff_inv); +HYPRE_Int hypre_MGRDataPrint(void *mgr_vdata); #ifdef HYPRE_USING_DSUPERLU void *hypre_MGRDirectSolverCreate( void ); -HYPRE_Int hypre_MGRDirectSolverSetup( void *solver, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u); -HYPRE_Int hypre_MGRDirectSolverSolve( void *solver, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u); +HYPRE_Int hypre_MGRDirectSolverSetup( void *solver, hypre_ParCSRMatrix *A, + hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int hypre_MGRDirectSolverSolve( void *solver, hypre_ParCSRMatrix *A, + hypre_ParVector *f, hypre_ParVector *u ); HYPRE_Int hypre_MGRDirectSolverDestroy( void *solver ); #endif // Accessor functions @@ -1449,6 +2251,89 @@ HYPRE_Int hypre_MGRGetNumIterations( void *mgr_vdata, HYPRE_Int *num_iterations HYPRE_Int hypre_MGRGetFinalRelativeResidualNorm( void *mgr_vdata, HYPRE_Real *res_norm ); HYPRE_Int hypre_MGRGetCoarseGridConvergenceFactor( void *mgr_data, HYPRE_Real *conv_factor ); +/* par_mgr_interp.c */ +HYPRE_Int hypre_MGRBuildInterp( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *A_FF, + hypre_ParCSRMatrix *A_FC, hypre_ParCSRMatrix *S, + hypre_IntArray *CF_marker, HYPRE_BigInt *num_cpts_global, + HYPRE_Real trunc_factor, HYPRE_Int max_elmts, + HYPRE_Int block_jacobi_bsize, HYPRE_Int method, + HYPRE_Int num_sweeps_post, hypre_ParCSRMatrix **Wp_ptr, + hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_MGRBuildRestrict( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *A_FF, + hypre_ParCSRMatrix *A_FC, hypre_ParCSRMatrix *A_CF, + hypre_IntArray *CF_marker, HYPRE_BigInt *num_cpts_global, + HYPRE_Real trunc_factor, HYPRE_Int max_elmts, + HYPRE_Real strong_threshold, HYPRE_Real max_row_sum, + HYPRE_Int blk_size, HYPRE_Int method, + hypre_ParCSRMatrix **W_ptr, hypre_ParCSRMatrix **R_ptr, + hypre_ParCSRMatrix **RT_ptr ); +HYPRE_Int hypre_MGRBuildPFromWp( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *Wp, + HYPRE_Int *CF_marker, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_MGRBuildPFromWpHost( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *Wp, + HYPRE_Int *CF_marker, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_MGRBuildBlockJacobiWp( hypre_ParCSRMatrix *A_FF, hypre_ParCSRMatrix *A_FC, + HYPRE_Int blk_size, hypre_ParCSRMatrix **Wp_ptr ); +HYPRE_Int hypre_MGRBuildBlockJacobiP( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *A_FF, + hypre_ParCSRMatrix *A_FC, hypre_ParCSRMatrix *Wp, + HYPRE_Int blk_size, HYPRE_Int *CF_marker, + hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_MGRBuildP( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + HYPRE_BigInt *num_cpts_global, HYPRE_Int method, + HYPRE_Int debug_flag, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_MGRBuildPHost( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *A_FF, + hypre_ParCSRMatrix *A_FC, HYPRE_Int *CF_marker, + HYPRE_BigInt *num_cpts_global, HYPRE_Int method, + hypre_ParCSRMatrix **Wp_ptr, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_MGRBuildInterpApproximateInverse( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + HYPRE_BigInt *num_cpts_global, + hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_MGRTruncateAcfCPR( hypre_ParCSRMatrix *A_CF, hypre_ParCSRMatrix **A_CF_new_ptr ); +HYPRE_Int hypre_MGRBuildRFromWr( hypre_IntArray *C_map, hypre_IntArray *F_map, + HYPRE_BigInt global_num_rows_R, HYPRE_BigInt global_num_cols_R, + HYPRE_BigInt *row_starts_R, HYPRE_BigInt *col_starts_R, + hypre_ParCSRMatrix *Wr, hypre_ParCSRMatrix **R_ptr ); +HYPRE_Int hypre_MGRBlockColLumpedRestrict( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *A_FF, + hypre_ParCSRMatrix *A_CF, hypre_IntArray *CF_marker, + HYPRE_Int blk_dim, hypre_ParCSRMatrix **Wr_ptr, + hypre_ParCSRMatrix **R_ptr); +HYPRE_Int hypre_MGRColLumpedRestrict(hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *A_FF, + hypre_ParCSRMatrix *A_CF, hypre_IntArray *CF_marker, + hypre_ParCSRMatrix **Wr_ptr, hypre_ParCSRMatrix **R_ptr); + +/* par_mgr_rap.c */ +HYPRE_Int hypre_MGRBuildCoarseOperator(void *mgr_data, hypre_ParCSRMatrix *A_FF, + hypre_ParCSRMatrix *A_FC, hypre_ParCSRMatrix *A_CF, + hypre_ParCSRMatrix **A_CC_ptr, hypre_ParCSRMatrix *Wp, + hypre_ParCSRMatrix *Wr, HYPRE_Int level); + +/* par_mgr_coarsen.c */ +HYPRE_Int hypre_MGRCoarseParms( MPI_Comm comm, HYPRE_Int num_rows, hypre_IntArray *CF_marker, + HYPRE_BigInt *row_starts_cpts, HYPRE_BigInt *row_starts_fpts ); + +/* par_mgr_device.c */ +HYPRE_Int hypre_MGRRelaxL1JacobiDevice( hypre_ParCSRMatrix *A, hypre_ParVector *f, + HYPRE_Int *CF_marker_host, HYPRE_Int relax_points, + HYPRE_Real relax_weight, HYPRE_Real *l1_norms, + hypre_ParVector *u, hypre_ParVector *Vtemp ); +HYPRE_Int hypre_MGRBuildPFromWpDevice( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *Wp, + HYPRE_Int *CF_marker, hypre_ParCSRMatrix **P_ptr); +HYPRE_Int hypre_MGRBuildPDevice( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + HYPRE_BigInt *num_cpts_global, HYPRE_Int method, + hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int hypre_ParCSRMatrixExtractBlockDiagDevice( hypre_ParCSRMatrix *A, HYPRE_Int blk_size, + HYPRE_Int num_points, HYPRE_Int point_type, + HYPRE_Int *CF_marker, HYPRE_Int diag_size, + HYPRE_Int diag_type, HYPRE_Int *B_diag_i, + HYPRE_Int *B_diag_j, + HYPRE_Complex *B_diag_data ); +HYPRE_Int hypre_ParCSRMatrixBlockDiagMatrixDevice( hypre_ParCSRMatrix *A, HYPRE_Int blk_size, + HYPRE_Int point_type, HYPRE_Int *CF_marker, + HYPRE_Int diag_type, + hypre_ParCSRMatrix **B_ptr ); + +/* par_mgr_stats.c */ +HYPRE_Int hypre_MGRSetupStats( void *mgr_vdata ); + /* par_ilu.c */ void *hypre_ILUCreate ( void ); HYPRE_Int hypre_ILUDestroy ( void *ilu_vdata ); @@ -1459,12 +2344,18 @@ HYPRE_Int hypre_ILUSetDropThresholdArray( void *ilu_vdata, HYPRE_Real *threshold HYPRE_Int hypre_ILUSetType( void *ilu_vdata, HYPRE_Int ilu_type ); HYPRE_Int hypre_ILUSetMaxIter( void *ilu_vdata, HYPRE_Int max_iter ); HYPRE_Int hypre_ILUSetTol( void *ilu_vdata, HYPRE_Real tol ); -HYPRE_Int hypre_ILUSetup( void *ilu_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); -HYPRE_Int hypre_ILUSolve( void *ilu_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int hypre_ILUSetIterativeSetupType( void *ilu_vdata, HYPRE_Int iter_setup_type ); +HYPRE_Int hypre_ILUSetIterativeSetupOption( void *ilu_vdata, HYPRE_Int iter_setup_option ); +HYPRE_Int hypre_ILUSetIterativeSetupMaxIter( void *ilu_vdata, HYPRE_Int iter_setup_max_iter ); +HYPRE_Int hypre_ILUSetIterativeSetupTolerance( void *ilu_vdata, HYPRE_Real iter_setup_tolerance ); +HYPRE_Int hypre_ILUGetIterativeSetupHistory( void *ilu_vdata, + HYPRE_Complex **iter_setup_history ); +HYPRE_Int hypre_ILUSetTriSolve( void *ilu_vdata, HYPRE_Int tri_solve ); +HYPRE_Int hypre_ILUSetLowerJacobiIters( void *ilu_vdata, HYPRE_Int lower_jacobi_iters ); +HYPRE_Int hypre_ILUSetUpperJacobiIters( void *ilu_vdata, HYPRE_Int upper_jacobi_iters ); HYPRE_Int hypre_ILUSetPrintLevel( void *ilu_vdata, HYPRE_Int print_level ); HYPRE_Int hypre_ILUSetLogging( void *ilu_vdata, HYPRE_Int logging ); HYPRE_Int hypre_ILUSetLocalReordering( void *ilu_vdata, HYPRE_Int ordering_type ); -HYPRE_Int hypre_ILUSetSchurSolverKDIM( void *ilu_vdata, HYPRE_Int ss_kDim ); HYPRE_Int hypre_ILUSetSchurSolverMaxIter( void *ilu_vdata, HYPRE_Int ss_max_iter ); HYPRE_Int hypre_ILUSetSchurSolverTol( void *ilu_vdata, HYPRE_Real ss_tol ); HYPRE_Int hypre_ILUSetSchurSolverAbsoluteTol( void *ilu_vdata, HYPRE_Real ss_absolute_tol ); @@ -1473,70 +2364,98 @@ HYPRE_Int hypre_ILUSetSchurSolverPrintLevel( void *ilu_vdata, HYPRE_Int ss_print HYPRE_Int hypre_ILUSetSchurSolverRelChange( void *ilu_vdata, HYPRE_Int ss_rel_change ); HYPRE_Int hypre_ILUSetSchurPrecondILUType( void *ilu_vdata, HYPRE_Int sp_ilu_type ); HYPRE_Int hypre_ILUSetSchurPrecondILULevelOfFill( void *ilu_vdata, HYPRE_Int sp_ilu_lfil ); -HYPRE_Int hypre_ILUSetSchurPrecondILUMaxNnzPerRow( void *ilu_vdata, HYPRE_Int sp_ilu_max_row_nnz ); +HYPRE_Int hypre_ILUSetSchurPrecondILUMaxNnzPerRow( void *ilu_vdata, + HYPRE_Int sp_ilu_max_row_nnz ); HYPRE_Int hypre_ILUSetSchurPrecondILUDropThreshold( void *ilu_vdata, HYPRE_Real sp_ilu_droptol ); -HYPRE_Int hypre_ILUSetSchurPrecondILUDropThresholdArray( void *ilu_vdata, HYPRE_Real *sp_ilu_droptol ); +HYPRE_Int hypre_ILUSetSchurPrecondILUDropThresholdArray( void *ilu_vdata, + HYPRE_Real *sp_ilu_droptol ); HYPRE_Int hypre_ILUSetSchurPrecondPrintLevel( void *ilu_vdata, HYPRE_Int sp_print_level ); HYPRE_Int hypre_ILUSetSchurPrecondMaxIter( void *ilu_vdata, HYPRE_Int sp_max_iter ); +HYPRE_Int hypre_ILUSetSchurPrecondTriSolve( void *ilu_vdata, HYPRE_Int sp_tri_solve ); +HYPRE_Int hypre_ILUSetSchurPrecondLowerJacobiIters( void *ilu_vdata, + HYPRE_Int sp_lower_jacobi_iters ); +HYPRE_Int hypre_ILUSetSchurPrecondUpperJacobiIters( void *ilu_vdata, + HYPRE_Int sp_upper_jacobi_iters ); HYPRE_Int hypre_ILUSetSchurPrecondTol( void *ilu_vdata, HYPRE_Int sp_tol ); -HYPRE_Int hypre_ILUMinHeapAddI(HYPRE_Int *heap, HYPRE_Int len); -HYPRE_Int hypre_ILUMinHeapAddIIIi(HYPRE_Int *heap, HYPRE_Int *I1, HYPRE_Int *Ii1, HYPRE_Int len); -HYPRE_Int hypre_ILUMinHeapAddIRIi(HYPRE_Int *heap, HYPRE_Real *I1, HYPRE_Int *Ii1, HYPRE_Int len); -HYPRE_Int hypre_ILUMaxHeapAddRabsIIi(HYPRE_Real *heap, HYPRE_Int *I1, HYPRE_Int *Ii1, HYPRE_Int len); -HYPRE_Int hypre_ILUMaxrHeapAddRabsI(HYPRE_Real *heap, HYPRE_Int *I1, HYPRE_Int len); -HYPRE_Int hypre_ILUMinHeapRemoveI(HYPRE_Int *heap, HYPRE_Int len); -HYPRE_Int hypre_ILUMinHeapRemoveIIIi(HYPRE_Int *heap, HYPRE_Int *I1, HYPRE_Int *Ii1, HYPRE_Int len); -HYPRE_Int hypre_ILUMinHeapRemoveIRIi(HYPRE_Int *heap, HYPRE_Real *I1, HYPRE_Int *Ii1, HYPRE_Int len); -HYPRE_Int hypre_ILUMaxHeapRemoveRabsIIi(HYPRE_Real *heap, HYPRE_Int *I1, HYPRE_Int *Ii1, HYPRE_Int len); -HYPRE_Int hypre_ILUMaxrHeapRemoveRabsI(HYPRE_Real *heap, HYPRE_Int *I1, HYPRE_Int len); -HYPRE_Int hypre_ILUMaxQSplitRI(HYPRE_Real *array, HYPRE_Int *I1, HYPRE_Int left, HYPRE_Int bound, HYPRE_Int right); -HYPRE_Int hypre_ILUMaxQSplitRabsI(HYPRE_Real *array, HYPRE_Int *I1, HYPRE_Int left, HYPRE_Int bound, HYPRE_Int right); -//HYPRE_Int hypre_quickSortIR (HYPRE_Int *a, HYPRE_Real *b, HYPRE_Int *iw, const HYPRE_Int lo, const HYPRE_Int hi); -HYPRE_Int hypre_ILUSortOffdColmap(hypre_ParCSRMatrix *A); -HYPRE_Int hypre_ILUMaxRabs(HYPRE_Real *array_data, HYPRE_Int *array_j, HYPRE_Int start, HYPRE_Int end, HYPRE_Int nLU, HYPRE_Int *rperm, HYPRE_Real *value, HYPRE_Int *index, HYPRE_Real *l1_norm, HYPRE_Int *nnz); -HYPRE_Int hypre_ILUGetPermddPQPre(HYPRE_Int n, HYPRE_Int nLU, HYPRE_Int *A_diag_i, HYPRE_Int *A_diag_j, HYPRE_Real *A_diag_data, HYPRE_Real tol, HYPRE_Int *perm, HYPRE_Int *rperm, HYPRE_Int *pperm_pre, HYPRE_Int *qperm_pre, HYPRE_Int *nB); -HYPRE_Int hypre_ILUGetPermddPQ(hypre_ParCSRMatrix *A, HYPRE_Int **pperm, HYPRE_Int **qperm, HYPRE_Real tol, HYPRE_Int *nB, HYPRE_Int *nI, HYPRE_Int reordering_type); -HYPRE_Int hypre_ILUGetInteriorExteriorPerm(hypre_ParCSRMatrix *A, HYPRE_Int **perm, HYPRE_Int *nLU, HYPRE_Int reordering_type); -HYPRE_Int hypre_ILUGetLocalPerm(hypre_ParCSRMatrix *A, HYPRE_Int **perm, HYPRE_Int *nLU, HYPRE_Int reordering_type); -HYPRE_Int hypre_ILUWriteSolverParams(void *ilu_vdata); -HYPRE_Int hypre_ILUBuildRASExternalMatrix(hypre_ParCSRMatrix *A, HYPRE_Int *rperm, HYPRE_Int **E_i, HYPRE_Int **E_j, HYPRE_Real **E_data); -HYPRE_Int hypre_ILUSetupILU0(hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int *qperm, HYPRE_Int nLU, HYPRE_Int nI, hypre_ParCSRMatrix **Lptr, HYPRE_Real** Dptr, hypre_ParCSRMatrix **Uptr, hypre_ParCSRMatrix **Sptr, HYPRE_Int **u_end); -HYPRE_Int hypre_ILUSetupMILU0(hypre_ParCSRMatrix *A, HYPRE_Int *permp, HYPRE_Int *qpermp, HYPRE_Int nLU, HYPRE_Int nI, hypre_ParCSRMatrix **Lptr, HYPRE_Real** Dptr, hypre_ParCSRMatrix **Uptr, hypre_ParCSRMatrix **Sptr, HYPRE_Int **u_end, HYPRE_Int modified); -HYPRE_Int hypre_ILUSetupILUK(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *permp, HYPRE_Int *qpermp, HYPRE_Int nLU, HYPRE_Int nI, hypre_ParCSRMatrix **Lptr, HYPRE_Real** Dptr, hypre_ParCSRMatrix **Uptr, hypre_ParCSRMatrix **Sptr, HYPRE_Int **u_end); -HYPRE_Int hypre_ILUSetupILUKSymbolic(HYPRE_Int n, HYPRE_Int *A_diag_i, HYPRE_Int *A_diag_j, HYPRE_Int lfil, HYPRE_Int *perm, HYPRE_Int *rperm, HYPRE_Int *iw, HYPRE_Int nLU, HYPRE_Int *L_diag_i, HYPRE_Int *U_diag_i, HYPRE_Int *S_diag_i, HYPRE_Int **L_diag_j, HYPRE_Int **U_diag_j, HYPRE_Int **S_diag_j, HYPRE_Int **u_end); -HYPRE_Int hypre_ILUSetupILUT(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, HYPRE_Int *permp, HYPRE_Int *qpermp, HYPRE_Int nLU, HYPRE_Int nI, hypre_ParCSRMatrix **Lptr, HYPRE_Real** Dptr, hypre_ParCSRMatrix **Uptr, hypre_ParCSRMatrix **Sptr, HYPRE_Int **u_end); -HYPRE_Int hypre_ILUSetupILU0RAS(hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int nLU, hypre_ParCSRMatrix **Lptr, HYPRE_Real** Dptr, hypre_ParCSRMatrix **Uptr); -HYPRE_Int hypre_ILUSetupILUKRASSymbolic(HYPRE_Int n, HYPRE_Int *A_diag_i, HYPRE_Int *A_diag_j, HYPRE_Int *A_offd_i, HYPRE_Int *A_offd_j, HYPRE_Int *E_i, HYPRE_Int *E_j, HYPRE_Int ext, HYPRE_Int lfil, HYPRE_Int *perm, HYPRE_Int *rperm, HYPRE_Int *iw, HYPRE_Int nLU, HYPRE_Int *L_diag_i, HYPRE_Int *U_diag_i, HYPRE_Int **L_diag_j, HYPRE_Int **U_diag_j); -HYPRE_Int hypre_ILUSetupILUKRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *perm, HYPRE_Int nLU, hypre_ParCSRMatrix **Lptr, HYPRE_Real** Dptr, hypre_ParCSRMatrix **Uptr); -HYPRE_Int hypre_ILUSetupILUTRAS(hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, HYPRE_Int *perm, HYPRE_Int nLU, hypre_ParCSRMatrix **Lptr, HYPRE_Real** Dptr, hypre_ParCSRMatrix **Uptr); -HYPRE_Int hypre_ILUSolveLU(hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int *perm, HYPRE_Int nLU, hypre_ParCSRMatrix *L, HYPRE_Real* D, hypre_ParCSRMatrix *U, hypre_ParVector *utemp, hypre_ParVector *ftemp); -HYPRE_Int hypre_ILUSolveSchurGMRES(hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int *perm, HYPRE_Int *qperm, HYPRE_Int nLU, hypre_ParCSRMatrix *L, HYPRE_Real* D, hypre_ParCSRMatrix *U, hypre_ParCSRMatrix *S, hypre_ParVector *ftemp, hypre_ParVector *utemp, HYPRE_Solver schur_solver, HYPRE_Solver schur_precond, hypre_ParVector *rhs, hypre_ParVector *x, HYPRE_Int *u_end); -HYPRE_Int hypre_ILUSolveSchurNSH(hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int *perm, HYPRE_Int nLU, hypre_ParCSRMatrix *L, HYPRE_Real* D, hypre_ParCSRMatrix *U, hypre_ParCSRMatrix *S, hypre_ParVector *ftemp, hypre_ParVector *utemp, HYPRE_Solver schur_solver, hypre_ParVector *rhs, hypre_ParVector *x, HYPRE_Int *u_end); -HYPRE_Int hypre_ILUSolveLURAS(hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int *perm, hypre_ParCSRMatrix *L, HYPRE_Real* D, hypre_ParCSRMatrix *U, hypre_ParVector *ftemp, hypre_ParVector *utemp, HYPRE_Real *fext, HYPRE_Real *uext); -HYPRE_Int hypre_ILUSetSchurNSHDropThreshold( void *ilu_vdata, HYPRE_Real threshold); -HYPRE_Int hypre_ILUSetSchurNSHDropThresholdArray( void *ilu_vdata, HYPRE_Real *threshold); -HYPRE_Int hypre_ILUSetupRAPILU0(hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int n, HYPRE_Int nLU, hypre_ParCSRMatrix **Lptr, HYPRE_Real **Dptr, hypre_ParCSRMatrix **Uptr, hypre_ParCSRMatrix **mLptr, HYPRE_Real **mDptr, hypre_ParCSRMatrix **mUptr, HYPRE_Int **u_end); -HYPRE_Int hypre_ILUSolveRAPGMRESHOST(hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int *perm, HYPRE_Int nLU, hypre_ParCSRMatrix *L, HYPRE_Real *D, hypre_ParCSRMatrix *U, hypre_ParCSRMatrix *mL, HYPRE_Real *mD, hypre_ParCSRMatrix *mU, hypre_ParVector *ftemp, hypre_ParVector *utemp,hypre_ParVector *xtemp, hypre_ParVector *ytemp, HYPRE_Solver schur_solver, HYPRE_Solver schur_precond, hypre_ParVector *rhs, hypre_ParVector *x, HYPRE_Int *u_end); -HYPRE_Int hypre_ParILURAPSchurGMRESSolveH( void *ilu_vdata, void *ilu_vdata2, hypre_ParVector *f, hypre_ParVector *u ); -HYPRE_Int hypre_ParILURAPSchurGMRESDummySetupH(void *a, void *b, void *c, void *d); -HYPRE_Int hypre_ParILURAPSchurGMRESCommInfoH( void *ilu_vdata, HYPRE_Int *my_id, HYPRE_Int *num_procs); -void *hypre_ParILURAPSchurGMRESMatvecCreateH(void *ilu_vdata, void *x); -HYPRE_Int hypre_ParILURAPSchurGMRESMatvecH(void *matvec_data, HYPRE_Complex alpha, void *ilu_vdata, void *x, HYPRE_Complex beta, void *y); -HYPRE_Int hypre_ParILURAPSchurGMRESMatvecDestroyH(void *matvec_data ); -HYPRE_Int hypre_ILULocalRCM( hypre_CSRMatrix *A, HYPRE_Int start, HYPRE_Int end, HYPRE_Int **permp, HYPRE_Int **qpermp, HYPRE_Int sym); -HYPRE_Int hypre_ILULocalRCMNumbering(hypre_CSRMatrix *A, HYPRE_Int root, HYPRE_Int *marker, HYPRE_Int *perm, HYPRE_Int *current_nump); -HYPRE_Int hypre_ILULocalRCMFindPPNode( hypre_CSRMatrix *A, HYPRE_Int *rootp, HYPRE_Int *marker); -HYPRE_Int hypre_ILULocalRCMMindegree(HYPRE_Int n, HYPRE_Int *degree, HYPRE_Int *marker, HYPRE_Int *rootp); -HYPRE_Int hypre_ILULocalRCMOrder( hypre_CSRMatrix *A, HYPRE_Int *perm); -HYPRE_Int hypre_ILULocalRCMBuildLevel(hypre_CSRMatrix *A, HYPRE_Int root, HYPRE_Int *marker, HYPRE_Int *level_i, HYPRE_Int *level_j, HYPRE_Int *nlevp); -HYPRE_Int hypre_ILULocalRCMQsort(HYPRE_Int *perm, HYPRE_Int start, HYPRE_Int end, HYPRE_Int *degree); -HYPRE_Int hypre_ILULocalRCMReverse(HYPRE_Int *perm, HYPRE_Int start, HYPRE_Int end); -// Newton-Schultz-Hotelling (NSH) functions -void * hypre_NSHCreate(); +HYPRE_Int hypre_ILUSetSchurNSHDropThreshold( void *ilu_vdata, HYPRE_Real threshold ); +HYPRE_Int hypre_ILUSetSchurNSHDropThresholdArray( void *ilu_vdata, HYPRE_Real *threshold ); +HYPRE_Int hypre_ILUGetNumIterations( void *ilu_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int hypre_ILUGetFinalRelativeResidualNorm( void *ilu_vdata, HYPRE_Real *res_norm ); +HYPRE_Int hypre_ILUWriteSolverParams( void *ilu_vdata ); + +HYPRE_Int hypre_ILUMinHeapAddI( HYPRE_Int *heap, HYPRE_Int len ); +HYPRE_Int hypre_ILUMinHeapAddIIIi( HYPRE_Int *heap, HYPRE_Int *I1, + HYPRE_Int *Ii1, HYPRE_Int len ); +HYPRE_Int hypre_ILUMinHeapAddIRIi( HYPRE_Int *heap, HYPRE_Real *I1, + HYPRE_Int *Ii1, HYPRE_Int len ); +HYPRE_Int hypre_ILUMaxrHeapAddRabsI( HYPRE_Real *heap, HYPRE_Int *I1, HYPRE_Int len ); +HYPRE_Int hypre_ILUMinHeapRemoveI( HYPRE_Int *heap, HYPRE_Int len ); +HYPRE_Int hypre_ILUMinHeapRemoveIIIi( HYPRE_Int *heap, HYPRE_Int *I1, + HYPRE_Int *Ii1, HYPRE_Int len ); +HYPRE_Int hypre_ILUMinHeapRemoveIRIi( HYPRE_Int *heap, HYPRE_Real *I1, + HYPRE_Int *Ii1, HYPRE_Int len ); +HYPRE_Int hypre_ILUMaxrHeapRemoveRabsI( HYPRE_Real *heap, HYPRE_Int *I1, HYPRE_Int len ); +HYPRE_Int hypre_ILUMaxQSplitRabsI( HYPRE_Real *arrayR, HYPRE_Int *arrayI, HYPRE_Int left, + HYPRE_Int bound, HYPRE_Int right ); +HYPRE_Int hypre_ILUMaxRabs( HYPRE_Real *array_data, HYPRE_Int *array_j, HYPRE_Int start, + HYPRE_Int end, HYPRE_Int nLU, HYPRE_Int *rperm, HYPRE_Real *value, + HYPRE_Int *index, HYPRE_Real *l1_norm, HYPRE_Int *nnz ); + +HYPRE_Int hypre_ILUGetPermddPQPre( HYPRE_Int n, HYPRE_Int nLU, HYPRE_Int *A_diag_i, + HYPRE_Int *A_diag_j, HYPRE_Real *A_diag_data, + HYPRE_Real tol, HYPRE_Int *perm, HYPRE_Int *rperm, + HYPRE_Int *pperm_pre, HYPRE_Int *qperm_pre, HYPRE_Int *nB ); +HYPRE_Int hypre_ILUGetPermddPQ( hypre_ParCSRMatrix *A, HYPRE_Int **io_pperm, HYPRE_Int **io_qperm, + HYPRE_Real tol, HYPRE_Int *nB, HYPRE_Int *nI, + HYPRE_Int reordering_type ); +HYPRE_Int hypre_ILUGetInteriorExteriorPerm( hypre_ParCSRMatrix *A, + HYPRE_MemoryLocation memory_location, + HYPRE_Int **perm, HYPRE_Int *nLU, + HYPRE_Int reordering_type ); +HYPRE_Int hypre_ILUGetLocalPerm( hypre_ParCSRMatrix *A, HYPRE_Int **perm_ptr, + HYPRE_Int *nLU, HYPRE_Int reordering_type ); +HYPRE_Int hypre_ILUBuildRASExternalMatrix( hypre_ParCSRMatrix *A, HYPRE_Int *rperm, + HYPRE_Int **E_i, HYPRE_Int **E_j, HYPRE_Real **E_data ); +HYPRE_Int hypre_ILUSortOffdColmap( hypre_ParCSRMatrix *A ); +HYPRE_Int hypre_ILULocalRCMBuildFinalPerm( HYPRE_Int start, HYPRE_Int end, + HYPRE_Int * G_perm, HYPRE_Int *perm, HYPRE_Int *qperm, + HYPRE_Int **permp, HYPRE_Int **qpermp ); +HYPRE_Int hypre_ILULocalRCM( hypre_CSRMatrix *A, HYPRE_Int start, HYPRE_Int end, + HYPRE_Int **permp, HYPRE_Int **qpermp, HYPRE_Int sym ); +HYPRE_Int hypre_ILULocalRCMMindegree( HYPRE_Int n, HYPRE_Int *degree, + HYPRE_Int *marker, HYPRE_Int *rootp ); +HYPRE_Int hypre_ILULocalRCMOrder( hypre_CSRMatrix *A, HYPRE_Int *perm ); +HYPRE_Int hypre_ILULocalRCMFindPPNode( hypre_CSRMatrix *A, HYPRE_Int *rootp, HYPRE_Int *marker ); +HYPRE_Int hypre_ILULocalRCMBuildLevel( hypre_CSRMatrix *A, HYPRE_Int root, HYPRE_Int *marker, + HYPRE_Int *level_i, HYPRE_Int *level_j, HYPRE_Int *nlevp ); +HYPRE_Int hypre_ILULocalRCMNumbering( hypre_CSRMatrix *A, HYPRE_Int root, HYPRE_Int *marker, + HYPRE_Int *perm, HYPRE_Int *current_nump ); +HYPRE_Int hypre_ILULocalRCMQsort( HYPRE_Int *perm, HYPRE_Int start, HYPRE_Int end, + HYPRE_Int *degree ); +HYPRE_Int hypre_ILULocalRCMReverse( HYPRE_Int *perm, HYPRE_Int start, HYPRE_Int end ); + +#if defined(HYPRE_USING_GPU) +HYPRE_Int hypre_ParILUSchurGMRESDummySolveDevice( void *ilu_vdata, void *ilu_vdata2, + hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int hypre_ParILUSchurGMRESCommInfoDevice( void *ilu_vdata, HYPRE_Int *my_id, + HYPRE_Int *num_procs ); +HYPRE_Int hypre_ParILURAPSchurGMRESSolveDevice( void *ilu_vdata, void *ilu_vdata2, + hypre_ParVector *par_f, hypre_ParVector *par_u ); +HYPRE_Int hypre_ParILURAPSchurGMRESMatvecDevice( void *matvec_data, HYPRE_Complex alpha, + void *ilu_vdata, void *x, + HYPRE_Complex beta, void *y ); +#endif +HYPRE_Int hypre_ParILURAPSchurGMRESCommInfoHost( void *ilu_vdata, HYPRE_Int *my_id, + HYPRE_Int *num_procs ); +HYPRE_Int hypre_ParILURAPSchurGMRESSolveHost( void *ilu_vdata, void *ilu_vdata2, + hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int hypre_ParILURAPSchurGMRESMatvecHost( void *matvec_data, HYPRE_Complex alpha, + void *ilu_vdata, void *x, + HYPRE_Complex beta, void *y ); + +void * hypre_NSHCreate( void ); HYPRE_Int hypre_NSHDestroy( void *data ); -HYPRE_Int hypre_NSHSetup( void *nsh_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); -HYPRE_Int hypre_NSHSolve( void *nsh_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); -HYPRE_Int hypre_NSHWriteSolverParams(void *nsh_vdata); +HYPRE_Int hypre_NSHWriteSolverParams( void *nsh_vdata ); HYPRE_Int hypre_NSHSetPrintLevel( void *nsh_vdata, HYPRE_Int print_level ); HYPRE_Int hypre_NSHSetLogging( void *nsh_vdata, HYPRE_Int logging ); HYPRE_Int hypre_NSHSetMaxIter( void *nsh_vdata, HYPRE_Int max_iter ); @@ -1551,109 +2470,425 @@ HYPRE_Int hypre_NSHSetColVersion( void *nsh_vdata, HYPRE_Int mr_col_version ); HYPRE_Int hypre_NSHSetNSHMaxIter( void *nsh_vdata, HYPRE_Int nsh_max_iter ); HYPRE_Int hypre_NSHSetNSHTol( void *nsh_vdata, HYPRE_Real nsh_tol ); HYPRE_Int hypre_NSHSetNSHMaxRowNnz( void *nsh_vdata, HYPRE_Int nsh_max_row_nnz ); -HYPRE_Int hypre_CSRMatrixNormFro(hypre_CSRMatrix *A, HYPRE_Real *norm_io); -HYPRE_Int hypre_CSRMatrixResNormFro(hypre_CSRMatrix *A, HYPRE_Real *norm_io); -HYPRE_Int hypre_ParCSRMatrixNormFro(hypre_ParCSRMatrix *A, HYPRE_Real *norm_io); -HYPRE_Int hypre_ParCSRMatrixResNormFro(hypre_ParCSRMatrix *A, HYPRE_Real *norm_io); -HYPRE_Int hypre_CSRMatrixTrace(hypre_CSRMatrix *A, HYPRE_Real *trace_io); -HYPRE_Int hypre_CSRMatrixDropInplace(hypre_CSRMatrix *A, HYPRE_Real droptol, HYPRE_Int max_row_nnz); -HYPRE_Int hypre_ILUCSRMatrixInverseSelfPrecondMRGlobal(hypre_CSRMatrix *matA, hypre_CSRMatrix **M, HYPRE_Real droptol, HYPRE_Real tol, HYPRE_Real eps_tol, HYPRE_Int max_row_nnz, HYPRE_Int max_iter, HYPRE_Int print_level ); -HYPRE_Int hypre_ILUParCSRInverseNSH(hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **M, HYPRE_Real *droptol, HYPRE_Real mr_tol, HYPRE_Real nsh_tol, HYPRE_Real eps_tol, HYPRE_Int mr_max_row_nnz, HYPRE_Int nsh_max_row_nnz, HYPRE_Int mr_max_iter, HYPRE_Int nsh_max_iter, HYPRE_Int mr_col_version, HYPRE_Int print_level); -HYPRE_Int hypre_NSHSolveInverse(hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, hypre_ParCSRMatrix *M, hypre_ParVector *ftemp, hypre_ParVector *utemp); -// Accessor functions -HYPRE_Int hypre_ILUGetNumIterations( void *ilu_vdata, HYPRE_Int *num_iterations ); -HYPRE_Int hypre_ILUGetFinalRelativeResidualNorm( void *ilu_vdata, HYPRE_Real *res_norm ); +HYPRE_Int hypre_CSRMatrixNormFro( hypre_CSRMatrix *A, HYPRE_Real *norm_io); +HYPRE_Int hypre_CSRMatrixResNormFro( hypre_CSRMatrix *A, HYPRE_Real *norm_io); +HYPRE_Int hypre_ParCSRMatrixNormFro( hypre_ParCSRMatrix *A, HYPRE_Real *norm_io); +HYPRE_Int hypre_ParCSRMatrixResNormFro( hypre_ParCSRMatrix *A, HYPRE_Real *norm_io); +HYPRE_Int hypre_CSRMatrixTrace( hypre_CSRMatrix *A, HYPRE_Real *trace_io); +HYPRE_Int hypre_CSRMatrixDropInplace( hypre_CSRMatrix *A, HYPRE_Real droptol, + HYPRE_Int max_row_nnz ); +HYPRE_Int hypre_ILUCSRMatrixInverseSelfPrecondMRGlobal( hypre_CSRMatrix *matA, + hypre_CSRMatrix **M, + HYPRE_Real droptol, HYPRE_Real tol, + HYPRE_Real eps_tol, HYPRE_Int max_row_nnz, + HYPRE_Int max_iter, + HYPRE_Int print_level ); +HYPRE_Int hypre_ILUParCSRInverseNSH( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **M, + HYPRE_Real *droptol, HYPRE_Real mr_tol, + HYPRE_Real nsh_tol, HYPRE_Real eps_tol, + HYPRE_Int mr_max_row_nnz, HYPRE_Int nsh_max_row_nnz, + HYPRE_Int mr_max_iter, HYPRE_Int nsh_max_iter, + HYPRE_Int mr_col_version, HYPRE_Int print_level ); + +/* par_ilu_setup.c */ +HYPRE_Int hypre_ILUSetup( void *ilu_vdata, hypre_ParCSRMatrix *A, + hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int hypre_ParILUExtractEBFC( hypre_CSRMatrix *A_diag, HYPRE_Int nLU, + hypre_CSRMatrix **Bp, hypre_CSRMatrix **Cp, + hypre_CSRMatrix **Ep, hypre_CSRMatrix **Fp ); +HYPRE_Int hypre_ParILURAPReorder( hypre_ParCSRMatrix *A, HYPRE_Int *perm, + HYPRE_Int *rqperm, hypre_ParCSRMatrix **A_pq ); +HYPRE_Int hypre_ILUSetupLDUtoCusparse( hypre_ParCSRMatrix *L, HYPRE_Real *D, + hypre_ParCSRMatrix *U, hypre_ParCSRMatrix **LDUp ); +HYPRE_Int hypre_ILUSetupRAPMILU0( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **ALUp, + HYPRE_Int modified ); +HYPRE_Int hypre_ILUSetupRAPILU0Device( hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int n, + HYPRE_Int nLU, hypre_ParCSRMatrix **Apermptr, + hypre_ParCSRMatrix **matSptr, hypre_CSRMatrix **ALUptr, + hypre_CSRMatrix **BLUptr, hypre_CSRMatrix **CLUptr, + hypre_CSRMatrix **Eptr, hypre_CSRMatrix **Fptr, + HYPRE_Int test_opt ); +HYPRE_Int hypre_ILUSetupRAPILU0( hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int n, + HYPRE_Int nLU, hypre_ParCSRMatrix **Lptr, HYPRE_Real **Dptr, + hypre_ParCSRMatrix **Uptr, hypre_ParCSRMatrix **mLptr, + HYPRE_Real **mDptr, hypre_ParCSRMatrix **mUptr, + HYPRE_Int **u_end ); +HYPRE_Int hypre_ILUSetupILU0( hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int *qperm, + HYPRE_Int nLU, HYPRE_Int nI, hypre_ParCSRMatrix **Lptr, + HYPRE_Real **Dptr, hypre_ParCSRMatrix **Uptr, + hypre_ParCSRMatrix **Sptr, HYPRE_Int **u_end ); +HYPRE_Int hypre_ILUSetupMILU0( hypre_ParCSRMatrix *A, HYPRE_Int *permp, + HYPRE_Int *qpermp, HYPRE_Int nLU, HYPRE_Int nI, + hypre_ParCSRMatrix **Lptr, HYPRE_Real **Dptr, + hypre_ParCSRMatrix **Uptr, hypre_ParCSRMatrix **Sptr, + HYPRE_Int **u_end, HYPRE_Int modified ); +HYPRE_Int hypre_ILUSetupILUKSymbolic( HYPRE_Int n, HYPRE_Int *A_diag_i, HYPRE_Int *A_diag_j, + HYPRE_Int lfil, HYPRE_Int *perm, HYPRE_Int *rperm, + HYPRE_Int *iw, HYPRE_Int nLU, HYPRE_Int *L_diag_i, + HYPRE_Int *U_diag_i, HYPRE_Int *S_diag_i, + HYPRE_Int **L_diag_j, HYPRE_Int **U_diag_j, + HYPRE_Int **S_diag_j, HYPRE_Int **u_end ); +HYPRE_Int hypre_ILUSetupILUK( hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *permp, + HYPRE_Int *qpermp, HYPRE_Int nLU, HYPRE_Int nI, + hypre_ParCSRMatrix **Lptr, HYPRE_Real **Dptr, + hypre_ParCSRMatrix **Uptr, hypre_ParCSRMatrix **Sptr, + HYPRE_Int **u_end ); +HYPRE_Int hypre_ILUSetupILUT( hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Real *tol, + HYPRE_Int *permp, HYPRE_Int *qpermp, HYPRE_Int nLU, + HYPRE_Int nI, hypre_ParCSRMatrix **Lptr, HYPRE_Real **Dptr, + hypre_ParCSRMatrix **Uptr, hypre_ParCSRMatrix **Sptr, + HYPRE_Int **u_end ); +HYPRE_Int hypre_NSHSetup( void *nsh_vdata, hypre_ParCSRMatrix *A, + hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int hypre_ILUSetupILU0RAS( hypre_ParCSRMatrix *A, HYPRE_Int *perm, + HYPRE_Int nLU, hypre_ParCSRMatrix **Lptr, + HYPRE_Real **Dptr, hypre_ParCSRMatrix **Uptr ); +HYPRE_Int hypre_ILUSetupILUKRASSymbolic( HYPRE_Int n, HYPRE_Int *A_diag_i, HYPRE_Int *A_diag_j, + HYPRE_Int *A_offd_i, HYPRE_Int *A_offd_j, + HYPRE_Int *E_i, HYPRE_Int *E_j, HYPRE_Int ext, + HYPRE_Int lfil, HYPRE_Int *perm, HYPRE_Int *rperm, + HYPRE_Int *iw, HYPRE_Int nLU, HYPRE_Int *L_diag_i, + HYPRE_Int *U_diag_i, HYPRE_Int **L_diag_j, + HYPRE_Int **U_diag_j ); +HYPRE_Int hypre_ILUSetupILUKRAS( hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *perm, + HYPRE_Int nLU, hypre_ParCSRMatrix **Lptr, + HYPRE_Real **Dptr, hypre_ParCSRMatrix **Uptr ); +HYPRE_Int hypre_ILUSetupILUTRAS( hypre_ParCSRMatrix *A, HYPRE_Int lfil, + HYPRE_Real *tol, HYPRE_Int *perm, HYPRE_Int nLU, + hypre_ParCSRMatrix **Lptr, HYPRE_Real **Dptr, + hypre_ParCSRMatrix **Uptr ); + +/* par_ilu_setup_device.c */ +#if defined(HYPRE_USING_GPU) +HYPRE_Int hypre_ILUSetupDevice(hypre_ParILUData *ilu_data, hypre_ParCSRMatrix *A, + HYPRE_Int *perm_data, HYPRE_Int *qperm_data, + HYPRE_Int n, HYPRE_Int nLU, hypre_CSRMatrix **BLUptr, + hypre_ParCSRMatrix **matSptr, hypre_CSRMatrix **Eptr, + hypre_CSRMatrix **Fptr); +HYPRE_Int hypre_ILUSetupIterativeILU0Device( hypre_CSRMatrix *A, HYPRE_Int type, + HYPRE_Int option, HYPRE_Int max_iter, + HYPRE_Real tolerance, HYPRE_Int *num_iter_ptr, + HYPRE_Real **history_ptr ); +#endif + +/* par_ilu_solve.c */ +HYPRE_Int hypre_ILUSolve( void *ilu_vdata, hypre_ParCSRMatrix *A, + hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int hypre_ILUSolveSchurGMRES( hypre_ParCSRMatrix *A, hypre_ParVector *f, + hypre_ParVector *u, HYPRE_Int *perm, + HYPRE_Int *qperm, HYPRE_Int nLU, + hypre_ParCSRMatrix *L, HYPRE_Real *D, + hypre_ParCSRMatrix *U, hypre_ParCSRMatrix *S, + hypre_ParVector *ftemp, hypre_ParVector *utemp, + HYPRE_Solver schur_solver, HYPRE_Solver schur_precond, + hypre_ParVector *rhs, hypre_ParVector *x, HYPRE_Int *u_end ); +HYPRE_Int hypre_ILUSolveSchurNSH( hypre_ParCSRMatrix *A, hypre_ParVector *f, + hypre_ParVector *u, HYPRE_Int *perm, HYPRE_Int nLU, + hypre_ParCSRMatrix *L, HYPRE_Real *D, + hypre_ParCSRMatrix *U, hypre_ParCSRMatrix *S, + hypre_ParVector *ftemp, hypre_ParVector *utemp, + HYPRE_Solver schur_solver, hypre_ParVector *rhs, + hypre_ParVector *x, HYPRE_Int *u_end ); +HYPRE_Int hypre_ILUSolveLU( hypre_ParCSRMatrix *A, hypre_ParVector *f, + hypre_ParVector *u, HYPRE_Int *perm, HYPRE_Int nLU, + hypre_ParCSRMatrix *L, HYPRE_Real *D, hypre_ParCSRMatrix *U, + hypre_ParVector *ftemp, hypre_ParVector *utemp ); +HYPRE_Int hypre_ILUSolveLUIter( hypre_ParCSRMatrix *A, hypre_ParVector *f, + hypre_ParVector *u, HYPRE_Int *perm, HYPRE_Int nLU, + hypre_ParCSRMatrix *L, HYPRE_Real *D, hypre_ParCSRMatrix *U, + hypre_ParVector *ftemp, hypre_ParVector *utemp, + HYPRE_Int lower_jacobi_iters, HYPRE_Int upper_jacobi_iters ); +HYPRE_Int hypre_ILUSolveLURAS( hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, + HYPRE_Int *perm, hypre_ParCSRMatrix *L, HYPRE_Real *D, + hypre_ParCSRMatrix *U, hypre_ParVector *ftemp, + hypre_ParVector *utemp, HYPRE_Real *fext, HYPRE_Real *uext ); +HYPRE_Int hypre_ILUSolveRAPGMRESHost( hypre_ParCSRMatrix *A, hypre_ParVector *f, + hypre_ParVector *u, HYPRE_Int *perm, HYPRE_Int nLU, + hypre_ParCSRMatrix *L, HYPRE_Real *D, hypre_ParCSRMatrix *U, + hypre_ParCSRMatrix *mL, HYPRE_Real *mD, + hypre_ParCSRMatrix *mU, hypre_ParVector *ftemp, + hypre_ParVector *utemp, hypre_ParVector *xtemp, + hypre_ParVector *ytemp, HYPRE_Solver schur_solver, + HYPRE_Solver schur_precond, hypre_ParVector *rhs, + hypre_ParVector *x, HYPRE_Int *u_end ); +HYPRE_Int hypre_NSHSolve( void *nsh_vdata, hypre_ParCSRMatrix *A, + hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int hypre_NSHSolveInverse( hypre_ParCSRMatrix *A, hypre_ParVector *f, + hypre_ParVector *u, hypre_ParCSRMatrix *M, + hypre_ParVector *ftemp, hypre_ParVector *utemp ); + +/* par_ilu_solve_device.c */ +#if defined(HYPRE_USING_GPU) +HYPRE_Int hypre_ILUSolveLUDevice( hypre_ParCSRMatrix *A, hypre_CSRMatrix *matLU_d, + hypre_ParVector *f, hypre_ParVector *u, + HYPRE_Int *perm, hypre_ParVector *ftemp, + hypre_ParVector *utemp ); +HYPRE_Int hypre_ILUApplyLowerJacIterDevice( hypre_CSRMatrix *A, hypre_Vector *input, + hypre_Vector *work, hypre_Vector *output, + HYPRE_Int lower_jacobi_iters ); +HYPRE_Int hypre_ILUApplyUpperJacIterDevice( hypre_CSRMatrix *A, hypre_Vector *input, + hypre_Vector *work, hypre_Vector *output, + hypre_Vector *diag, HYPRE_Int upper_jacobi_iters ); +HYPRE_Int hypre_ILUApplyLowerUpperJacIterDevice( hypre_CSRMatrix *A, hypre_Vector *work1, + hypre_Vector *work2, hypre_Vector *inout, + hypre_Vector *diag, HYPRE_Int lower_jacobi_iters, + HYPRE_Int upper_jacobi_iters ); +HYPRE_Int hypre_ILUSolveLUIterDevice( hypre_ParCSRMatrix *A, hypre_CSRMatrix *matLU, + hypre_ParVector *f, hypre_ParVector *u, + HYPRE_Int *perm, hypre_ParVector *ftemp, + hypre_ParVector *utemp, hypre_ParVector *xtemp, + hypre_Vector **diag_ptr, HYPRE_Int lower_jacobi_iters, + HYPRE_Int upper_jacobi_iters ); +HYPRE_Int hypre_ParILUSchurGMRESMatvecDevice( void *matvec_data, HYPRE_Complex alpha, + void *ilu_vdata, void *x, + HYPRE_Complex beta, void *y ); +HYPRE_Int hypre_ILUSolveSchurGMRESDevice( hypre_ParCSRMatrix *A, hypre_ParVector *f, + hypre_ParVector *u, HYPRE_Int *perm, + HYPRE_Int nLU, hypre_ParCSRMatrix *S, + hypre_ParVector *ftemp, hypre_ParVector *utemp, + HYPRE_Solver schur_solver, HYPRE_Solver schur_precond, + hypre_ParVector *rhs, hypre_ParVector *x, + HYPRE_Int *u_end, hypre_CSRMatrix *matBLU_d, + hypre_CSRMatrix *matE_d, hypre_CSRMatrix *matF_d ); +HYPRE_Int hypre_ILUSolveSchurGMRESJacIterDevice( hypre_ParCSRMatrix *A, hypre_ParVector *f, + hypre_ParVector *u, HYPRE_Int *perm, + HYPRE_Int nLU, hypre_ParCSRMatrix *S, + hypre_ParVector *ftemp, hypre_ParVector *utemp, + HYPRE_Solver schur_solver, + HYPRE_Solver schur_precond, + hypre_ParVector *rhs, hypre_ParVector *x, + HYPRE_Int *u_end, hypre_CSRMatrix *matBLU_d, + hypre_CSRMatrix *matE_d, hypre_CSRMatrix *matF_d, + hypre_ParVector *ztemp, + hypre_Vector **Adiag_diag, + hypre_Vector **Sdiag_diag, + HYPRE_Int lower_jacobi_iters, + HYPRE_Int upper_jacobi_iters ); +HYPRE_Int hypre_ParILUSchurGMRESMatvecJacIterDevice( void *matvec_data, HYPRE_Complex alpha, + void *ilu_vdata, void *x, HYPRE_Complex beta, + void *y ); +HYPRE_Int hypre_ILUSolveRAPGMRESDevice( hypre_ParCSRMatrix *A, hypre_ParVector *f, + hypre_ParVector *u, HYPRE_Int *perm, HYPRE_Int nLU, + hypre_ParCSRMatrix *S, hypre_ParVector *ftemp, + hypre_ParVector *utemp, hypre_ParVector *xtemp, + hypre_ParVector *ytemp, HYPRE_Solver schur_solver, + HYPRE_Solver schur_precond, hypre_ParVector *rhs, + hypre_ParVector *x, HYPRE_Int *u_end, + hypre_ParCSRMatrix *Aperm, hypre_CSRMatrix *matALU_d, + hypre_CSRMatrix *matBLU_d, hypre_CSRMatrix *matE_d, + hypre_CSRMatrix *matF_d, HYPRE_Int test_opt ); +#endif /* par_amgdd.c */ void *hypre_BoomerAMGDDCreate ( void ); HYPRE_Int hypre_BoomerAMGDDDestroy ( void *data ); -HYPRE_Int hypre_BoomerAMGDDSetStartLevel ( void *data , HYPRE_Int start_level ); -HYPRE_Int hypre_BoomerAMGDDGetStartLevel ( void *data , HYPRE_Int *start_level ); -HYPRE_Int hypre_BoomerAMGDDSetFACNumCycles ( void *data , HYPRE_Int fac_num_cycles ); -HYPRE_Int hypre_BoomerAMGDDGetFACNumCycles ( void *data , HYPRE_Int *fac_num_cycles ); -HYPRE_Int hypre_BoomerAMGDDSetFACCycleType ( void *data , HYPRE_Int fac_cycle_type ); -HYPRE_Int hypre_BoomerAMGDDGetFACCycleType ( void *data , HYPRE_Int *fac_cycle_type ); -HYPRE_Int hypre_BoomerAMGDDSetFACNumRelax ( void *data , HYPRE_Int fac_num_relax ); -HYPRE_Int hypre_BoomerAMGDDGetFACNumRelax ( void *data , HYPRE_Int *fac_num_relax ); -HYPRE_Int hypre_BoomerAMGDDSetFACRelaxType ( void *data , HYPRE_Int fac_relax_type ); -HYPRE_Int hypre_BoomerAMGDDGetFACRelaxType ( void *data , HYPRE_Int *fac_relax_type ); -HYPRE_Int hypre_BoomerAMGDDSetFACRelaxWeight ( void *data , HYPRE_Real fac_relax_weight ); -HYPRE_Int hypre_BoomerAMGDDGetFACRelaxWeight ( void *data , HYPRE_Real *fac_relax_weight ); -HYPRE_Int hypre_BoomerAMGDDSetPadding ( void *data , HYPRE_Int padding ); -HYPRE_Int hypre_BoomerAMGDDGetPadding ( void *data , HYPRE_Int *padding ); -HYPRE_Int hypre_BoomerAMGDDSetNumGhostLayers ( void *data , HYPRE_Int num_ghost_layers ); -HYPRE_Int hypre_BoomerAMGDDGetNumGhostLayers ( void *data , HYPRE_Int *num_ghost_layers ); -HYPRE_Int hypre_BoomerAMGDDSetUserFACRelaxation( void *data , HYPRE_Int (*userFACRelaxation)( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ) ); -HYPRE_Int hypre_BoomerAMGDDGetAMG ( void *data , void **amg_solver ); +HYPRE_Int hypre_BoomerAMGDDSetStartLevel ( void *data, HYPRE_Int start_level ); +HYPRE_Int hypre_BoomerAMGDDGetStartLevel ( void *data, HYPRE_Int *start_level ); +HYPRE_Int hypre_BoomerAMGDDSetFACNumCycles ( void *data, HYPRE_Int fac_num_cycles ); +HYPRE_Int hypre_BoomerAMGDDGetFACNumCycles ( void *data, HYPRE_Int *fac_num_cycles ); +HYPRE_Int hypre_BoomerAMGDDSetFACCycleType ( void *data, HYPRE_Int fac_cycle_type ); +HYPRE_Int hypre_BoomerAMGDDGetFACCycleType ( void *data, HYPRE_Int *fac_cycle_type ); +HYPRE_Int hypre_BoomerAMGDDSetFACNumRelax ( void *data, HYPRE_Int fac_num_relax ); +HYPRE_Int hypre_BoomerAMGDDGetFACNumRelax ( void *data, HYPRE_Int *fac_num_relax ); +HYPRE_Int hypre_BoomerAMGDDSetFACRelaxType ( void *data, HYPRE_Int fac_relax_type ); +HYPRE_Int hypre_BoomerAMGDDGetFACRelaxType ( void *data, HYPRE_Int *fac_relax_type ); +HYPRE_Int hypre_BoomerAMGDDSetFACRelaxWeight ( void *data, HYPRE_Real fac_relax_weight ); +HYPRE_Int hypre_BoomerAMGDDGetFACRelaxWeight ( void *data, HYPRE_Real *fac_relax_weight ); +HYPRE_Int hypre_BoomerAMGDDSetPadding ( void *data, HYPRE_Int padding ); +HYPRE_Int hypre_BoomerAMGDDGetPadding ( void *data, HYPRE_Int *padding ); +HYPRE_Int hypre_BoomerAMGDDSetNumGhostLayers ( void *data, HYPRE_Int num_ghost_layers ); +HYPRE_Int hypre_BoomerAMGDDGetNumGhostLayers ( void *data, HYPRE_Int *num_ghost_layers ); +HYPRE_Int hypre_BoomerAMGDDSetUserFACRelaxation( void *data, + HYPRE_Int (*userFACRelaxation)( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ) ); +HYPRE_Int hypre_BoomerAMGDDGetAMG ( void *data, void **amg_solver ); /* par_amgdd_solve.c */ -HYPRE_Int hypre_BoomerAMGDDSolve ( void *solver, hypre_ParCSRMatrix *A, hypre_ParVector *b,hypre_ParVector *x ); +HYPRE_Int hypre_BoomerAMGDDSolve ( void *solver, hypre_ParCSRMatrix *A, hypre_ParVector *b, + hypre_ParVector *x ); HYPRE_Int hypre_BoomerAMGDD_Cycle ( hypre_ParAMGDDData *amgdd_data ); HYPRE_Int hypre_BoomerAMGDD_ResidualCommunication ( hypre_ParAMGDDData *amgdd_data ); -HYPRE_Complex* hypre_BoomerAMGDD_PackResidualBuffer ( hypre_AMGDDCompGrid **compGrid, hypre_AMGDDCommPkg *compGridCommPkg, HYPRE_Int current_level, HYPRE_Int proc ); -HYPRE_Int hypre_BoomerAMGDD_UnpackResidualBuffer ( HYPRE_Complex *buffer, hypre_AMGDDCompGrid **compGrid, hypre_AMGDDCommPkg *compGridCommPkg, HYPRE_Int current_level, HYPRE_Int proc ); +HYPRE_Complex* hypre_BoomerAMGDD_PackResidualBuffer ( hypre_AMGDDCompGrid **compGrid, + hypre_AMGDDCommPkg *compGridCommPkg, HYPRE_Int current_level, HYPRE_Int proc ); +HYPRE_Int hypre_BoomerAMGDD_UnpackResidualBuffer ( HYPRE_Complex *buffer, + hypre_AMGDDCompGrid **compGrid, hypre_AMGDDCommPkg *compGridCommPkg, HYPRE_Int current_level, + HYPRE_Int proc ); /* par_amgdd_setup.c */ -HYPRE_Int hypre_BoomerAMGDDSetup ( void *amgdd_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ); +HYPRE_Int hypre_BoomerAMGDDSetup ( void *amgdd_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *b, + hypre_ParVector *x ); /* par_amgdd_fac_cycle.c */ HYPRE_Int hypre_BoomerAMGDD_FAC ( void *amgdd_vdata, HYPRE_Int first_iteration ); -HYPRE_Int hypre_BoomerAMGDD_FAC_Cycle ( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_type, HYPRE_Int first_iteration ); +HYPRE_Int hypre_BoomerAMGDD_FAC_Cycle ( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_type, + HYPRE_Int first_iteration ); HYPRE_Int hypre_BoomerAMGDD_FAC_FCycle ( void *amgdd_vdata, HYPRE_Int first_iteration ); -HYPRE_Int hypre_BoomerAMGDD_FAC_Interpolate ( hypre_AMGDDCompGrid *compGrid_f, hypre_AMGDDCompGrid *compGrid_c ); -HYPRE_Int hypre_BoomerAMGDD_FAC_Restrict ( hypre_AMGDDCompGrid *compGrid_f, hypre_AMGDDCompGrid *compGrid_c, HYPRE_Int first_iteration ); +HYPRE_Int hypre_BoomerAMGDD_FAC_Interpolate ( hypre_AMGDDCompGrid *compGrid_f, + hypre_AMGDDCompGrid *compGrid_c ); +HYPRE_Int hypre_BoomerAMGDD_FAC_Restrict ( hypre_AMGDDCompGrid *compGrid_f, + hypre_AMGDDCompGrid *compGrid_c, HYPRE_Int first_iteration ); HYPRE_Int hypre_BoomerAMGDD_FAC_Relax ( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ); -HYPRE_Int hypre_BoomerAMGDD_FAC_CFL1JacobiHost ( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int relax_set ); -HYPRE_Int hypre_BoomerAMGDD_FAC_Jacobi ( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ); +HYPRE_Int hypre_BoomerAMGDD_FAC_CFL1JacobiHost ( void *amgdd_vdata, HYPRE_Int level, + HYPRE_Int relax_set ); +HYPRE_Int hypre_BoomerAMGDD_FAC_Jacobi ( void *amgdd_vdata, HYPRE_Int level, + HYPRE_Int cycle_param ); HYPRE_Int hypre_BoomerAMGDD_FAC_JacobiHost ( void *amgdd_vdata, HYPRE_Int level ); -HYPRE_Int hypre_BoomerAMGDD_FAC_GaussSeidel ( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ); -HYPRE_Int hypre_BoomerAMGDD_FAC_CFL1Jacobi ( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ); -HYPRE_Int hypre_BoomerAMGDD_FAC_OrderedGaussSeidel ( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ); +HYPRE_Int hypre_BoomerAMGDD_FAC_GaussSeidel ( void *amgdd_vdata, HYPRE_Int level, + HYPRE_Int cycle_param ); +HYPRE_Int hypre_BoomerAMGDD_FAC_CFL1Jacobi ( void *amgdd_vdata, HYPRE_Int level, + HYPRE_Int cycle_param ); +HYPRE_Int hypre_BoomerAMGDD_FAC_OrderedGaussSeidel ( void *amgdd_vdata, HYPRE_Int level, + HYPRE_Int cycle_param ); /* par_amgdd_fac_cycles_device.c */ HYPRE_Int hypre_BoomerAMGDD_FAC_JacobiDevice ( void *amgdd_vdata, HYPRE_Int level ); -HYPRE_Int hypre_BoomerAMGDD_FAC_CFL1JacobiDevice ( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int relax_set ); +HYPRE_Int hypre_BoomerAMGDD_FAC_CFL1JacobiDevice ( void *amgdd_vdata, HYPRE_Int level, + HYPRE_Int relax_set ); /* par_amgdd_comp_grid.c */ -hypre_AMGDDCompGridMatrix* hypre_AMGDDCompGridMatrixCreate(); +hypre_AMGDDCompGridMatrix* hypre_AMGDDCompGridMatrixCreate( void ); HYPRE_Int hypre_AMGDDCompGridMatrixDestroy ( hypre_AMGDDCompGridMatrix *matrix ); -HYPRE_Int hypre_AMGDDCompGridMatvec ( HYPRE_Complex alpha, hypre_AMGDDCompGridMatrix *A, hypre_AMGDDCompGridVector *x, HYPRE_Complex beta, hypre_AMGDDCompGridVector *y ); -HYPRE_Int hypre_AMGDDCompGridRealMatvec ( HYPRE_Complex alpha, hypre_AMGDDCompGridMatrix *A, hypre_AMGDDCompGridVector *x, HYPRE_Complex beta, hypre_AMGDDCompGridVector *y ); -hypre_AMGDDCompGridVector* hypre_AMGDDCompGridVectorCreate(); -HYPRE_Int hypre_AMGDDCompGridVectorInitialize ( hypre_AMGDDCompGridVector *vector, HYPRE_Int num_owned, HYPRE_Int num_nonowned, HYPRE_Int num_real ); +HYPRE_Int hypre_AMGDDCompGridMatvec ( HYPRE_Complex alpha, hypre_AMGDDCompGridMatrix *A, + hypre_AMGDDCompGridVector *x, HYPRE_Complex beta, hypre_AMGDDCompGridVector *y ); +HYPRE_Int hypre_AMGDDCompGridRealMatvec ( HYPRE_Complex alpha, hypre_AMGDDCompGridMatrix *A, + hypre_AMGDDCompGridVector *x, HYPRE_Complex beta, hypre_AMGDDCompGridVector *y ); +hypre_AMGDDCompGridVector* hypre_AMGDDCompGridVectorCreate( void ); +HYPRE_Int hypre_AMGDDCompGridVectorInitialize ( hypre_AMGDDCompGridVector *vector, + HYPRE_Int num_owned, HYPRE_Int num_nonowned, HYPRE_Int num_real ); HYPRE_Int hypre_AMGDDCompGridVectorDestroy ( hypre_AMGDDCompGridVector *vector ); -HYPRE_Real hypre_AMGDDCompGridVectorInnerProd ( hypre_AMGDDCompGridVector *x, hypre_AMGDDCompGridVector *y ); -HYPRE_Real hypre_AMGDDCompGridVectorRealInnerProd ( hypre_AMGDDCompGridVector *x, hypre_AMGDDCompGridVector *y ); +HYPRE_Real hypre_AMGDDCompGridVectorInnerProd ( hypre_AMGDDCompGridVector *x, + hypre_AMGDDCompGridVector *y ); +HYPRE_Real hypre_AMGDDCompGridVectorRealInnerProd ( hypre_AMGDDCompGridVector *x, + hypre_AMGDDCompGridVector *y ); HYPRE_Int hypre_AMGDDCompGridVectorScale ( HYPRE_Complex alpha, hypre_AMGDDCompGridVector *x ); HYPRE_Int hypre_AMGDDCompGridVectorRealScale ( HYPRE_Complex alpha, hypre_AMGDDCompGridVector *x ); -HYPRE_Int hypre_AMGDDCompGridVectorAxpy ( HYPRE_Complex alpha, hypre_AMGDDCompGridVector *x, hypre_AMGDDCompGridVector *y ); -HYPRE_Int hypre_AMGDDCompGridVectorRealAxpy ( HYPRE_Complex alpha, hypre_AMGDDCompGridVector *x, hypre_AMGDDCompGridVector *y ); -HYPRE_Int hypre_AMGDDCompGridVectorSetConstantValues ( hypre_AMGDDCompGridVector *vector, HYPRE_Complex value ); -HYPRE_Int hypre_AMGDDCompGridVectorRealSetConstantValues ( hypre_AMGDDCompGridVector *vector, HYPRE_Complex value ); -HYPRE_Int hypre_AMGDDCompGridVectorCopy ( hypre_AMGDDCompGridVector *x, hypre_AMGDDCompGridVector *y ); -HYPRE_Int hypre_AMGDDCompGridVectorRealCopy ( hypre_AMGDDCompGridVector *x, hypre_AMGDDCompGridVector *y ); -hypre_AMGDDCompGrid *hypre_AMGDDCompGridCreate(); +HYPRE_Int hypre_AMGDDCompGridVectorAxpy ( HYPRE_Complex alpha, hypre_AMGDDCompGridVector *x, + hypre_AMGDDCompGridVector *y ); +HYPRE_Int hypre_AMGDDCompGridVectorRealAxpy ( HYPRE_Complex alpha, hypre_AMGDDCompGridVector *x, + hypre_AMGDDCompGridVector *y ); +HYPRE_Int hypre_AMGDDCompGridVectorSetConstantValues ( hypre_AMGDDCompGridVector *vector, + HYPRE_Complex value ); +HYPRE_Int hypre_AMGDDCompGridVectorRealSetConstantValues ( hypre_AMGDDCompGridVector *vector, + HYPRE_Complex value ); +HYPRE_Int hypre_AMGDDCompGridVectorCopy ( hypre_AMGDDCompGridVector *x, + hypre_AMGDDCompGridVector *y ); +HYPRE_Int hypre_AMGDDCompGridVectorRealCopy ( hypre_AMGDDCompGridVector *x, + hypre_AMGDDCompGridVector *y ); +hypre_AMGDDCompGrid *hypre_AMGDDCompGridCreate( void ); HYPRE_Int hypre_AMGDDCompGridDestroy ( hypre_AMGDDCompGrid *compGrid ); -HYPRE_Int hypre_AMGDDCompGridInitialize ( hypre_ParAMGDDData *amgdd_data, HYPRE_Int padding, HYPRE_Int level ); +HYPRE_Int hypre_AMGDDCompGridInitialize ( hypre_ParAMGDDData *amgdd_data, HYPRE_Int padding, + HYPRE_Int level ); HYPRE_Int hypre_AMGDDCompGridSetupRelax ( hypre_ParAMGDDData *amgdd_data ); HYPRE_Int hypre_AMGDDCompGridFinalize ( hypre_ParAMGDDData *amgdd_data ); -HYPRE_Int hypre_AMGDDCompGridSetupRealDofMarker ( hypre_AMGDDCompGrid **compGrid, HYPRE_Int num_levels, HYPRE_Int num_ghost_layers ); -HYPRE_Int hypre_AMGDDCompGridResize ( hypre_AMGDDCompGrid *compGrid, HYPRE_Int new_size, HYPRE_Int need_coarse_info ); -HYPRE_Int hypre_AMGDDCompGridSetupLocalIndices ( hypre_AMGDDCompGrid **compGrid, HYPRE_Int *num_added_nodes, HYPRE_Int ****recv_map, HYPRE_Int num_recv_procs, HYPRE_Int **A_tmp_info, HYPRE_Int start_level, HYPRE_Int num_levels ); +HYPRE_Int hypre_AMGDDCompGridSetupRealDofMarker ( hypre_AMGDDCompGrid **compGrid, + HYPRE_Int num_levels, HYPRE_Int num_ghost_layers ); +HYPRE_Int hypre_AMGDDCompGridResize ( hypre_AMGDDCompGrid *compGrid, HYPRE_Int new_size, + HYPRE_Int need_coarse_info ); +HYPRE_Int hypre_AMGDDCompGridSetupLocalIndices ( hypre_AMGDDCompGrid **compGrid, + HYPRE_Int *num_added_nodes, HYPRE_Int ****recv_map, HYPRE_Int num_recv_procs, + HYPRE_Int **A_tmp_info, HYPRE_Int start_level, HYPRE_Int num_levels ); HYPRE_Int hypre_AMGDDCompGridSetupLocalIndicesP ( hypre_ParAMGDDData *amgdd_data ); hypre_AMGDDCommPkg *hypre_AMGDDCommPkgCreate ( HYPRE_Int num_levels ); -HYPRE_Int hypre_AMGDDCommPkgSendLevelDestroy ( hypre_AMGDDCommPkg *amgddCommPkg, HYPRE_Int level, HYPRE_Int proc ); -HYPRE_Int hypre_AMGDDCommPkgRecvLevelDestroy ( hypre_AMGDDCommPkg *amgddCommPkg, HYPRE_Int level, HYPRE_Int proc ); +HYPRE_Int hypre_AMGDDCommPkgSendLevelDestroy ( hypre_AMGDDCommPkg *amgddCommPkg, HYPRE_Int level, + HYPRE_Int proc ); +HYPRE_Int hypre_AMGDDCommPkgRecvLevelDestroy ( hypre_AMGDDCommPkg *amgddCommPkg, HYPRE_Int level, + HYPRE_Int proc ); HYPRE_Int hypre_AMGDDCommPkgDestroy ( hypre_AMGDDCommPkg *compGridCommPkg ); -HYPRE_Int hypre_AMGDDCommPkgFinalize ( hypre_ParAMGData* amg_data, hypre_AMGDDCommPkg *compGridCommPkg, hypre_AMGDDCompGrid **compGrid ); +HYPRE_Int hypre_AMGDDCommPkgFinalize ( hypre_ParAMGData* amg_data, + hypre_AMGDDCommPkg *compGridCommPkg, hypre_AMGDDCompGrid **compGrid ); /* par_amgdd_helpers.c */ -HYPRE_Int hypre_BoomerAMGDD_SetupNearestProcessorNeighbors ( hypre_ParCSRMatrix *A, hypre_AMGDDCommPkg *compGridCommPkg, HYPRE_Int level, HYPRE_Int *padding, HYPRE_Int num_ghost_layers ); -HYPRE_Int hypre_BoomerAMGDD_RecursivelyBuildPsiComposite ( HYPRE_Int node, HYPRE_Int m, hypre_AMGDDCompGrid *compGrid, HYPRE_Int *add_flag, HYPRE_Int use_sort ); -HYPRE_Int hypre_BoomerAMGDD_MarkCoarse ( HYPRE_Int *list, HYPRE_Int *marker, HYPRE_Int *owned_coarse_indices, HYPRE_Int *nonowned_coarse_indices, HYPRE_Int *sort_map, HYPRE_Int num_owned, HYPRE_Int total_num_nodes, HYPRE_Int num_owned_coarse, HYPRE_Int list_size, HYPRE_Int dist, HYPRE_Int use_sort, HYPRE_Int *nodes_to_add ); -HYPRE_Int hypre_BoomerAMGDD_UnpackRecvBuffer ( hypre_ParAMGDDData *amgdd_data, HYPRE_Int *recv_buffer, HYPRE_Int **A_tmp_info, HYPRE_Int *recv_map_send_buffer_size, HYPRE_Int *nodes_added_on_level, HYPRE_Int current_level, HYPRE_Int buffer_number ); -HYPRE_Int* hypre_BoomerAMGDD_PackSendBuffer ( hypre_ParAMGDDData *amgdd_data, HYPRE_Int proc, HYPRE_Int current_level, HYPRE_Int *padding, HYPRE_Int *send_flag_buffer_size ); -HYPRE_Int hypre_BoomerAMGDD_PackRecvMapSendBuffer ( HYPRE_Int *recv_map_send_buffer, HYPRE_Int **recv_red_marker, HYPRE_Int *num_recv_nodes, HYPRE_Int *recv_buffer_size, HYPRE_Int current_level, HYPRE_Int num_levels ); -HYPRE_Int hypre_BoomerAMGDD_UnpackSendFlagBuffer ( hypre_AMGDDCompGrid **compGrid, HYPRE_Int *send_flag_buffer, HYPRE_Int **send_flag, HYPRE_Int *num_send_nodes, HYPRE_Int *send_buffer_size, HYPRE_Int current_level, HYPRE_Int num_levels ); +HYPRE_Int hypre_BoomerAMGDD_SetupNearestProcessorNeighbors ( hypre_ParCSRMatrix *A, + hypre_AMGDDCommPkg *compGridCommPkg, HYPRE_Int level, HYPRE_Int *padding, + HYPRE_Int num_ghost_layers ); +HYPRE_Int hypre_BoomerAMGDD_RecursivelyBuildPsiComposite ( HYPRE_Int node, HYPRE_Int m, + hypre_AMGDDCompGrid *compGrid, HYPRE_Int *add_flag, HYPRE_Int use_sort ); +HYPRE_Int hypre_BoomerAMGDD_MarkCoarse ( HYPRE_Int *list, HYPRE_Int *marker, + HYPRE_Int *owned_coarse_indices, HYPRE_Int *nonowned_coarse_indices, HYPRE_Int *sort_map, + HYPRE_Int num_owned, HYPRE_Int total_num_nodes, HYPRE_Int num_owned_coarse, HYPRE_Int list_size, + HYPRE_Int dist, HYPRE_Int use_sort, HYPRE_Int *nodes_to_add ); +HYPRE_Int hypre_BoomerAMGDD_UnpackRecvBuffer ( hypre_ParAMGDDData *amgdd_data, + HYPRE_Int *recv_buffer, HYPRE_Int **A_tmp_info, HYPRE_Int *recv_map_send_buffer_size, + HYPRE_Int *nodes_added_on_level, HYPRE_Int current_level, HYPRE_Int buffer_number ); +HYPRE_Int* hypre_BoomerAMGDD_PackSendBuffer ( hypre_ParAMGDDData *amgdd_data, HYPRE_Int proc, + HYPRE_Int current_level, HYPRE_Int *padding, HYPRE_Int *send_flag_buffer_size ); +HYPRE_Int hypre_BoomerAMGDD_PackRecvMapSendBuffer ( HYPRE_Int *recv_map_send_buffer, + HYPRE_Int **recv_red_marker, HYPRE_Int *num_recv_nodes, HYPRE_Int *recv_buffer_size, + HYPRE_Int current_level, HYPRE_Int num_levels ); +HYPRE_Int hypre_BoomerAMGDD_UnpackSendFlagBuffer ( hypre_AMGDDCompGrid **compGrid, + HYPRE_Int *send_flag_buffer, HYPRE_Int **send_flag, HYPRE_Int *num_send_nodes, + HYPRE_Int *send_buffer_size, HYPRE_Int current_level, HYPRE_Int num_levels ); HYPRE_Int hypre_BoomerAMGDD_CommunicateRemainingMatrixInfo ( hypre_ParAMGDDData* amgdd_data ); -HYPRE_Int hypre_BoomerAMGDD_FixUpRecvMaps ( hypre_AMGDDCompGrid **compGrid, hypre_AMGDDCommPkg *compGridCommPkg, HYPRE_Int start_level, HYPRE_Int num_levels ); +HYPRE_Int hypre_BoomerAMGDD_FixUpRecvMaps ( hypre_AMGDDCompGrid **compGrid, + hypre_AMGDDCommPkg *compGridCommPkg, HYPRE_Int start_level, HYPRE_Int num_levels ); + +/* par_fsai.c */ +void* hypre_FSAICreate( void ); +HYPRE_Int hypre_FSAIDestroy ( void *data ); +HYPRE_Int hypre_FSAISetAlgoType ( void *data, HYPRE_Int algo_type ); +HYPRE_Int hypre_FSAISetLocalSolveType ( void *data, HYPRE_Int local_solve_type ); +HYPRE_Int hypre_FSAISetMaxSteps ( void *data, HYPRE_Int max_steps ); +HYPRE_Int hypre_FSAISetMaxStepSize ( void *data, HYPRE_Int max_step_size ); +HYPRE_Int hypre_FSAISetMaxNnzRow ( void *data, HYPRE_Int max_nnz_row ); +HYPRE_Int hypre_FSAISetNumLevels ( void *data, HYPRE_Int num_levels ); +HYPRE_Int hypre_FSAISetThreshold ( void *data, HYPRE_Real threshold ); +HYPRE_Int hypre_FSAISetKapTolerance ( void *data, HYPRE_Real kap_tolerance ); +HYPRE_Int hypre_FSAISetMaxIterations ( void *data, HYPRE_Int max_iterations ); +HYPRE_Int hypre_FSAISetEigMaxIters ( void *data, HYPRE_Int eig_max_iters ); +HYPRE_Int hypre_FSAISetZeroGuess ( void *data, HYPRE_Int zero_guess ); +HYPRE_Int hypre_FSAISetTolerance ( void *data, HYPRE_Real tolerance ); +HYPRE_Int hypre_FSAISetOmega ( void *data, HYPRE_Real omega ); +HYPRE_Int hypre_FSAISetLogging ( void *data, HYPRE_Int logging ); +HYPRE_Int hypre_FSAISetNumIterations ( void *data, HYPRE_Int num_iterations ); +HYPRE_Int hypre_FSAISetPrintLevel ( void *data, HYPRE_Int print_level ); +HYPRE_Int hypre_FSAIGetAlgoType ( void *data, HYPRE_Int *algo_type ); +HYPRE_Int hypre_FSAIGetLocalSolveType ( void *data, HYPRE_Int *local_solve_type ); +HYPRE_Int hypre_FSAIGetMaxSteps ( void *data, HYPRE_Int *max_steps ); +HYPRE_Int hypre_FSAIGetMaxStepSize ( void *data, HYPRE_Int *max_step_size ); +HYPRE_Int hypre_FSAIGetMaxNnzRow ( void *data, HYPRE_Int *max_nnz_row ); +HYPRE_Int hypre_FSAIGetNumLevels ( void *data, HYPRE_Int *num_levels ); +HYPRE_Int hypre_FSAIGetThreshold ( void *data, HYPRE_Real *threshold ); +HYPRE_Int hypre_FSAIGetKapTolerance ( void *data, HYPRE_Real *kap_tolerance ); +HYPRE_Int hypre_FSAIGetMaxIterations ( void *data, HYPRE_Int *max_iterations ); +HYPRE_Int hypre_FSAIGetEigMaxIters ( void *data, HYPRE_Int *eig_max_iters ); +HYPRE_Int hypre_FSAIGetZeroGuess ( void *data, HYPRE_Int *zero_guess ); +HYPRE_Int hypre_FSAIGetTolerance ( void *data, HYPRE_Real *tolerance ); +HYPRE_Int hypre_FSAIGetOmega ( void *data, HYPRE_Real *omega ); +HYPRE_Int hypre_FSAIGetLogging ( void *data, HYPRE_Int *logging ); +HYPRE_Int hypre_FSAIGetNumIterations ( void *data, HYPRE_Int *num_iterations ); +HYPRE_Int hypre_FSAIGetPrintLevel ( void *data, HYPRE_Int *print_level ); + +/* par_fsai_setup.c */ +HYPRE_Int hypre_CSRMatrixExtractDenseMat ( hypre_CSRMatrix *A, hypre_Vector *A_sub, + HYPRE_Int *S_Pattern, HYPRE_Int S_nnz, + HYPRE_Int *marker ); +HYPRE_Int hypre_CSRMatrixExtractDenseRow ( hypre_CSRMatrix *A, hypre_Vector *A_subrow, + HYPRE_Int *marker, HYPRE_Int row_num ); +HYPRE_Int hypre_FindKapGrad ( hypre_CSRMatrix *A_diag, hypre_Vector *kaporin_gradient, + HYPRE_Int *kap_grad_nonzeros, hypre_Vector *G_temp, + HYPRE_Int *S_Pattern, HYPRE_Int S_nnz, + HYPRE_Int max_row_size, HYPRE_Int row_num, HYPRE_Int *kg_marker ); +HYPRE_Int hypre_AddToPattern ( hypre_Vector *kaporin_gradient, HYPRE_Int *kap_grad_nonzeros, + HYPRE_Int *S_Pattern, HYPRE_Int *S_nnz, HYPRE_Int *kg_marker, + HYPRE_Int max_step_size ); +HYPRE_Int hypre_FSAISetup ( void *fsai_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, + hypre_ParVector *u ); +HYPRE_Int hypre_FSAISetupNative ( void *fsai_vdata, hypre_ParCSRMatrix *A, + hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int hypre_FSAISetupOMPDyn ( void *fsai_vdata, hypre_ParCSRMatrix *A, + hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int hypre_FSAIPrintStats ( void *fsai_vdata, hypre_ParCSRMatrix *A ); +HYPRE_Int hypre_FSAIComputeOmega ( void *fsai_vdata, hypre_ParCSRMatrix *A ); +void hypre_swap2_ci ( HYPRE_Complex *v, HYPRE_Int *w, HYPRE_Int i, HYPRE_Int j ); +void hypre_qsort2_ci ( HYPRE_Complex *v, HYPRE_Int *w, HYPRE_Int left, HYPRE_Int right ); +HYPRE_Int hypre_FSAIDumpLocalLSDense ( void *fsai_vdata, const char *filename, + hypre_ParCSRMatrix *A ); + +/* par_fsai_solve.c */ +HYPRE_Int hypre_FSAISolve ( void *fsai_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *b, + hypre_ParVector *x ); +HYPRE_Int hypre_FSAIApply ( void *fsai_vdata, HYPRE_Complex alpha, hypre_ParVector *b, + hypre_ParVector *x ); + +/* par_fsai_device.c */ +HYPRE_Int hypre_FSAISetupDevice( void *fsai_vdata, hypre_ParCSRMatrix *A, + hypre_ParVector *f, hypre_ParVector *u ); diff --git a/external/hypre/src/parcsr_ls/schwarz.c b/external/hypre/src/parcsr_ls/schwarz.c index c68ed892..c3645ea7 100644 --- a/external/hypre/src/parcsr_ls/schwarz.c +++ b/external/hypre/src/parcsr_ls/schwarz.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -25,10 +25,10 @@ *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_AMGNodalSchwarzSmoother( hypre_CSRMatrix *A, - HYPRE_Int num_functions, - HYPRE_Int option, - hypre_CSRMatrix **domain_structure_pointer) +hypre_AMGNodalSchwarzSmoother( hypre_CSRMatrix *A, + HYPRE_Int num_functions, + HYPRE_Int option, + hypre_CSRMatrix **domain_structure_pointer) { /* option = 0: nodal symGS; 1: next to nodal symGS (overlapping Schwarz) */ @@ -54,7 +54,7 @@ hypre_AMGNodalSchwarzSmoother( hypre_CSRMatrix *A, HYPRE_Int ierr = 0; - HYPRE_Int i,j,k, l_loc, i_loc, j_loc; + HYPRE_Int i, j, k, l_loc, i_loc, j_loc; HYPRE_Int i_dof, j_dof; HYPRE_Int *i_local_to_global; HYPRE_Int *i_global_to_local; @@ -62,7 +62,7 @@ hypre_AMGNodalSchwarzSmoother( hypre_CSRMatrix *A, HYPRE_Int *i_int; HYPRE_Int *i_int_to_local; - HYPRE_Int int_dof_counter, local_dof_counter, max_local_dof_counter=0; + HYPRE_Int int_dof_counter, local_dof_counter, max_local_dof_counter = 0; HYPRE_Int domain_dof_counter = 0, domain_matrixinverse_counter = 0; @@ -72,13 +72,6 @@ hypre_AMGNodalSchwarzSmoother( hypre_CSRMatrix *A, HYPRE_Int cnt; - /* PCG arrays: --------------------------------------------------- - HYPRE_Real *x, *rhs, *v, *w, *d, *aux; - - HYPRE_Int max_iter; - - ------------------------------------------------------------------ */ - /* build dof_node graph: ----------------------------------------- */ num_nodes = num_dofs / num_functions; @@ -86,15 +79,21 @@ hypre_AMGNodalSchwarzSmoother( hypre_CSRMatrix *A, /*hypre_printf("\nnum_nodes: %d, num_dofs: %d = %d x %d\n", num_nodes, num_dofs, num_nodes, num_functions);*/ - i_dof_node = hypre_CTAlloc(HYPRE_Int, num_dofs+1, HYPRE_MEMORY_HOST); - j_dof_node = hypre_CTAlloc(HYPRE_Int, num_dofs, HYPRE_MEMORY_HOST); + i_dof_node = hypre_CTAlloc(HYPRE_Int, num_dofs + 1, HYPRE_MEMORY_HOST); + j_dof_node = hypre_CTAlloc(HYPRE_Int, num_dofs, HYPRE_MEMORY_HOST); - for (i=0; i < num_dofs+1; i++) + for (i = 0; i < num_dofs + 1; i++) + { i_dof_node[i] = i; + } for (j = 0; j < num_nodes; j++) + { for (k = 0; k < num_functions; k++) - j_dof_node[j*num_functions+k] = j; + { + j_dof_node[j * num_functions + k] = j; + } + } /* build node_dof graph: ----------------------------------------- */ @@ -125,18 +124,20 @@ hypre_AMGNodalSchwarzSmoother( hypre_CSRMatrix *A, i_global_to_local = i_dof_node; - for (i_dof =0; i_dof < num_dofs; i_dof++) + for (i_dof = 0; i_dof < num_dofs; i_dof++) + { i_global_to_local[i_dof] = -1; + } domain_matrixinverse_counter = 0; domain_dof_counter = 0; - for (i=0; i < num_nodes; i++) + for (i = 0; i < num_nodes; i++) { local_dof_counter = 0; - for (j=i_node_node[i]; j < i_node_node[i+1]; j++) - for (k=i_node_dof[j_node_node[j]]; - k max_local_dof_counter) + { max_local_dof_counter = local_dof_counter; + } - for (j=i_node_node[i]; j < i_node_node[i+1]; j++) - for (k=i_node_dof[j_node_node[j]]; - k=0) + if (j_loc >= 0) + { AE[i_loc + j_loc * local_dof_counter] = a_dof_dof[j]; + } } } /* get block for Schwarz smoother: ============================= */ /* ierr = hypre_matinv(XE, AE, local_dof_counter); */ /* hypre_printf("ierr_AE_inv: %d\n", ierr); */ - hypre_dpotrf(&uplo, &local_dof_counter, AE, - &local_dof_counter, &ierr); - if (ierr == 1) hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Error! Matrix not SPD\n"); + hypre_dpotrf(&uplo, &local_dof_counter, AE, &local_dof_counter, &ierr); + if (ierr == 1) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Error! Matrix not SPD\n"); + } - for (i_loc=0; i_loc < local_dof_counter; i_loc++) - j_domain_dof[domain_dof_counter+i_loc] - = i_local_to_global[i_loc]; + for (i_loc = 0; i_loc < local_dof_counter; i_loc++) + { + j_domain_dof[domain_dof_counter + i_loc] = i_local_to_global[i_loc]; + } } if (option == 0) { AE = &domain_matrixinverse[domain_matrixinverse_counter]; - for (i_loc=0; i_loc < int_dof_counter; i_loc++) - for (j_loc=0; j_loc < int_dof_counter; j_loc++) + for (i_loc = 0; i_loc < int_dof_counter; i_loc++) + { + for (j_loc = 0; j_loc < int_dof_counter; j_loc++) + { AE[i_loc + j_loc * int_dof_counter] = 0.e0; + } + } - for (l_loc=0; l_loc < int_dof_counter; l_loc++) + for (l_loc = 0; l_loc < int_dof_counter; l_loc++) { i_loc = i_int_to_local[l_loc]; i_dof = i_local_to_global[i_loc]; - for (j=i_dof_dof[i_dof]; j < i_dof_dof[i_dof+1]; j++) + for (j = i_dof_dof[i_dof]; j < i_dof_dof[i_dof + 1]; j++) { j_loc = i_global_to_local[j_dof_dof[j]]; - if (j_loc >=0) - if (i_int[j_loc] >=0) - AE[i_loc + i_int[j_loc] * int_dof_counter] - = a_dof_dof[j]; + if (j_loc >= 0) + { + if (i_int[j_loc] >= 0) + { + AE[i_loc + i_int[j_loc] * int_dof_counter] = a_dof_dof[j]; + } + } } } /* ierr = hypre_matinv(XE, AE, int_dof_counter); */ - hypre_dpotrf(&uplo, &local_dof_counter, AE, - &local_dof_counter, &ierr); - - if (ierr) hypre_error_w_msg(HYPRE_ERROR_GENERIC," error in dpotrf !!!\n"); + hypre_dpotrf(&uplo, &local_dof_counter, AE, &local_dof_counter, &ierr); + if (ierr) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, " error in dpotrf !!!\n"); + } - for (i_loc=0; i_loc < int_dof_counter; i_loc++) + for (i_loc = 0; i_loc < int_dof_counter; i_loc++) { j_domain_dof[domain_dof_counter + i_loc] = i_local_to_global[i_int_to_local[i_loc]]; - for (j_loc=0; j_loc < int_dof_counter; j_loc++) + for (j_loc = 0; j_loc < int_dof_counter; j_loc++) + { domain_matrixinverse[domain_matrixinverse_counter + i_loc + j_loc * int_dof_counter] = AE[i_loc + j_loc * int_dof_counter]; + } } - domain_dof_counter+=int_dof_counter; - domain_matrixinverse_counter+=int_dof_counter*int_dof_counter; + domain_dof_counter += int_dof_counter; + domain_matrixinverse_counter += int_dof_counter * int_dof_counter; } else { - domain_dof_counter+=local_dof_counter; - domain_matrixinverse_counter+=local_dof_counter*local_dof_counter; + domain_dof_counter += local_dof_counter; + domain_matrixinverse_counter += local_dof_counter * local_dof_counter; } - for (l_loc=0; l_loc < local_dof_counter; l_loc++) + for (l_loc = 0; l_loc < local_dof_counter; l_loc++) { i_int[l_loc] = -1; i_global_to_local[i_local_to_global[l_loc]] = -1; @@ -312,7 +342,6 @@ hypre_AMGNodalSchwarzSmoother( hypre_CSRMatrix *A, hypre_TFree(i_dof_node, HYPRE_MEMORY_HOST); hypre_TFree(j_dof_node, HYPRE_MEMORY_HOST); - hypre_TFree(i_node_dof, HYPRE_MEMORY_HOST); hypre_TFree(j_node_dof, HYPRE_MEMORY_HOST); hypre_TFree(i_node_node, HYPRE_MEMORY_HOST); @@ -320,7 +349,6 @@ hypre_AMGNodalSchwarzSmoother( hypre_CSRMatrix *A, hypre_TFree(i_int, HYPRE_MEMORY_HOST); hypre_TFree(i_int_to_local, HYPRE_MEMORY_HOST); - hypre_TFree(i_local_to_global, HYPRE_MEMORY_HOST); domain_structure = hypre_CSRMatrixCreate(num_domains, max_local_dof_counter, @@ -334,15 +362,17 @@ hypre_AMGNodalSchwarzSmoother( hypre_CSRMatrix *A, return hypre_error_flag; } -HYPRE_Int hypre_ParMPSchwarzSolve(hypre_ParCSRMatrix *par_A, - hypre_CSRMatrix *A_boundary, - hypre_ParVector *rhs_vector, - hypre_CSRMatrix *domain_structure, - hypre_ParVector *par_x, - HYPRE_Real relax_wt, - HYPRE_Real *scale, - hypre_ParVector *Vtemp, HYPRE_Int *pivots, - HYPRE_Int use_nonsymm) +HYPRE_Int +hypre_ParMPSchwarzSolve(hypre_ParCSRMatrix *par_A, + hypre_CSRMatrix *A_boundary, + hypre_ParVector *rhs_vector, + hypre_CSRMatrix *domain_structure, + hypre_ParVector *par_x, + HYPRE_Real relax_wt, + HYPRE_Real *scale, + hypre_ParVector *Vtemp, + HYPRE_Int *pivots, + HYPRE_Int use_nonsymm) { hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(par_A); HYPRE_Int num_sends = 0; @@ -358,27 +388,27 @@ HYPRE_Int hypre_ParMPSchwarzSolve(hypre_ParCSRMatrix *par_A, HYPRE_Int *A_diag_j; HYPRE_Real *A_diag_data; hypre_CSRMatrix *A_offd; - HYPRE_Int *A_offd_i; - HYPRE_Int *A_offd_j; - HYPRE_Real *A_offd_data; + HYPRE_Int *A_offd_i = NULL; + HYPRE_Int *A_offd_j = NULL; + HYPRE_Real *A_offd_data = NULL; HYPRE_Real *x; - HYPRE_Real *x_ext; - HYPRE_Real *x_ext_old; + HYPRE_Real *x_ext = NULL; + HYPRE_Real *x_ext_old = NULL; HYPRE_Real *rhs; - HYPRE_Real *rhs_ext; + HYPRE_Real *rhs_ext = NULL; HYPRE_Real *vtemp_data; HYPRE_Real *aux; - HYPRE_Real *buf_data; -/*hypre_Vector *x_vector;*/ + HYPRE_Real *buf_data = NULL; + /*hypre_Vector *x_vector;*/ MPI_Comm comm = hypre_ParCSRMatrixComm(par_A); HYPRE_Int num_domains = hypre_CSRMatrixNumRows(domain_structure); HYPRE_Int max_domain_size = hypre_CSRMatrixNumCols(domain_structure); HYPRE_Int *i_domain_dof = hypre_CSRMatrixI(domain_structure); HYPRE_Int *j_domain_dof = hypre_CSRMatrixJ(domain_structure); HYPRE_Real *domain_matrixinverse = hypre_CSRMatrixData(domain_structure); - HYPRE_Int *A_boundary_i; - HYPRE_Int *A_boundary_j; - HYPRE_Real *A_boundary_data; + HYPRE_Int *A_boundary_i = NULL; + HYPRE_Int *A_boundary_j = NULL; + HYPRE_Real *A_boundary_data = NULL; HYPRE_Int num_variables; HYPRE_Int num_cols_offd; @@ -386,14 +416,14 @@ HYPRE_Int hypre_ParMPSchwarzSolve(hypre_ParCSRMatrix *par_A, HYPRE_Int one = 1; char uplo = 'L'; - HYPRE_Int jj,i,j,k, j_loc, k_loc; + HYPRE_Int jj, i, j, k, j_loc, k_loc; HYPRE_Int index; HYPRE_Int matrix_size, matrix_size_counter = 0; HYPRE_Int num_procs; - hypre_MPI_Comm_size(comm,&num_procs); + hypre_MPI_Comm_size(comm, &num_procs); /* initiate: ----------------------------------------------- */ /* num_dofs = hypre_CSRMatrixNumRows(A); */ @@ -407,7 +437,9 @@ HYPRE_Int hypre_ParMPSchwarzSolve(hypre_ParCSRMatrix *par_A, rhs = hypre_VectorData(hypre_ParVectorLocalVector(rhs_vector)); if (use_nonsymm) + { uplo = 'N'; + } /*x_vector = hypre_ParVectorLocalVector(par_x);*/ A_diag_i = hypre_CSRMatrixI(A_diag); @@ -424,8 +456,8 @@ HYPRE_Int hypre_ParMPSchwarzSolve(hypre_ParCSRMatrix *par_A, } aux = hypre_CTAlloc(HYPRE_Real, max_domain_size, HYPRE_MEMORY_HOST); - hypre_ParVectorCopy(rhs_vector,Vtemp); - hypre_ParCSRMatrixMatvec(-1.0,par_A,par_x,1.0,Vtemp); + hypre_ParVectorCopy(rhs_vector, Vtemp); + hypre_ParCSRMatrixMatvec(-1.0, par_A, par_x, 1.0, Vtemp); if (comm_pkg) { @@ -439,76 +471,95 @@ HYPRE_Int hypre_ParMPSchwarzSolve(hypre_ParCSRMatrix *par_A, rhs_ext = hypre_CTAlloc(HYPRE_Real, num_cols_offd, HYPRE_MEMORY_HOST); index = 0; - for (i=0; i < num_sends; i++) + for (i = 0; i < num_sends; i++) { - for (j = send_map_starts[i]; j < send_map_starts[i+1]; j++) + for (j = send_map_starts[i]; j < send_map_starts[i + 1]; j++) + { buf_data[index++] = vtemp_data[send_map_elmts[j]]; + } } - comm_handle = hypre_ParCSRCommHandleCreate(1,comm_pkg,buf_data, + comm_handle = hypre_ParCSRCommHandleCreate(1, comm_pkg, buf_data, rhs_ext); hypre_ParCSRCommHandleDestroy(comm_handle); comm_handle = NULL; index = 0; - for (i=0; i < num_sends; i++) + for (i = 0; i < num_sends; i++) { - for (j = send_map_starts[i]; j < send_map_starts[i+1]; j++) + for (j = send_map_starts[i]; j < send_map_starts[i + 1]; j++) + { buf_data[index++] = x[send_map_elmts[j]]; + } } - comm_handle = hypre_ParCSRCommHandleCreate(1,comm_pkg,buf_data,x_ext); + comm_handle = hypre_ParCSRCommHandleCreate(1, comm_pkg, buf_data, x_ext); hypre_ParCSRCommHandleDestroy(comm_handle); comm_handle = NULL; } /* correction of residual for exterior points to be updated locally */ - for (i=0; i < num_cols_offd; i++) + for (i = 0; i < num_cols_offd; i++) { x_ext_old[i] = x_ext[i]; - for (j = A_boundary_i[i]; j < A_boundary_i[i+1]; j++) + for (j = A_boundary_i[i]; j < A_boundary_i[i + 1]; j++) { k_loc = A_boundary_j[j]; if (k_loc < num_variables) - rhs_ext[i] += A_boundary_data[j]*x[k_loc]; + { + rhs_ext[i] += A_boundary_data[j] * x[k_loc]; + } else - rhs_ext[i] += A_boundary_data[j]*x_ext[k_loc-num_variables]; + { + rhs_ext[i] += A_boundary_data[j] * x_ext[k_loc - num_variables]; + } } } - /* forward solve: ----------------------------------------------- */ + /* forward solve: ----------------------------------------------- */ matrix_size_counter = 0; - for (i=0; i < num_domains; i++) + for (i = 0; i < num_domains; i++) { - matrix_size = i_domain_dof[i+1] - i_domain_dof[i]; + matrix_size = i_domain_dof[i + 1] - i_domain_dof[i]; /* compute residual: ---------------------------------------- */ - jj = 0; - for (j=i_domain_dof[i]; j < i_domain_dof[i+1]; j++) + for (j = i_domain_dof[i]; j < i_domain_dof[i + 1]; j++) { j_loc = j_domain_dof[j]; if (j_loc < num_variables) { aux[jj] = rhs[j_loc]; - for (k=A_diag_i[j_loc]; k -1; i--) + for (i = num_domains - 1; i > -1; i--) { - matrix_size = i_domain_dof[i+1] - i_domain_dof[i]; + matrix_size = i_domain_dof[i + 1] - i_domain_dof[i]; matrix_size_counter -= matrix_size * matrix_size; piv_counter -= matrix_size; /* compute residual: ---------------------------------------- */ jj = 0; - for (j=i_domain_dof[i]; j < i_domain_dof[i+1]; j++) + for (j = i_domain_dof[i]; j < i_domain_dof[i + 1]; j++) { j_loc = j_domain_dof[j]; if (j_loc < num_variables) { aux[jj] = rhs[j_loc]; - for (k=A_diag_i[j_loc]; k 1) { @@ -759,23 +838,24 @@ HYPRE_Int hypre_MPSchwarzSolve(hypre_ParCSRMatrix *par_A, } /* forward solve: ----------------------------------------------- */ - matrix_size_counter = 0; - for (i=0; i < num_domains; i++) + for (i = 0; i < num_domains; i++) { - matrix_size = i_domain_dof[i+1] - i_domain_dof[i]; + matrix_size = i_domain_dof[i + 1] - i_domain_dof[i]; /* compute residual: ---------------------------------------- */ - jj = 0; - for (j=i_domain_dof[i]; j < i_domain_dof[i+1]; j++) + for (j = i_domain_dof[i]; j < i_domain_dof[i + 1]; j++) { aux[jj] = hypre_VectorData(rhs)[j_domain_dof[j]]; - for (k=i_dof_dof[j_domain_dof[j]]; - k -1; i--) + for (i = num_domains - 1; i > -1; i--) { - matrix_size = i_domain_dof[i+1] - i_domain_dof[i]; + matrix_size = i_domain_dof[i + 1] - i_domain_dof[i]; matrix_size_counter -= matrix_size * matrix_size; piv_counter -= matrix_size; /* compute residual: ---------------------------------------- */ - jj = 0; - for (j=i_domain_dof[i]; j < i_domain_dof[i+1]; j++) + for (j = i_domain_dof[i]; j < i_domain_dof[i + 1]; j++) { aux[jj] = hypre_VectorData(rhs)[j_domain_dof[j]]; - for (k=i_dof_dof[j_domain_dof[j]]; - k 1) { @@ -916,28 +1000,29 @@ HYPRE_Int hypre_MPSchwarzCFSolve(hypre_ParCSRMatrix *par_A, } /* forward solve: ----------------------------------------------- */ - matrix_size_counter = 0; - for (i=0; i < num_domains; i++) + for (i = 0; i < num_domains; i++) { if (CF_marker[i] == rlx_pt) { - matrix_size = i_domain_dof[i+1] - i_domain_dof[i]; + matrix_size = i_domain_dof[i + 1] - i_domain_dof[i]; /* compute residual: ---------------------------------------- */ - jj = 0; - for (j=i_domain_dof[i]; j < i_domain_dof[i+1]; j++) + for (j = i_domain_dof[i]; j < i_domain_dof[i + 1]; j++) { aux[jj] = hypre_VectorData(rhs)[j_domain_dof[j]]; if (CF_marker[j_domain_dof[j]] == rlx_pt) { - for (k=i_dof_dof[j_domain_dof[j]]; - k -1; i--) + for (i = num_domains - 1; i > -1; i--) { if (CF_marker[i] == rlx_pt) { - matrix_size = i_domain_dof[i+1] - i_domain_dof[i]; + matrix_size = i_domain_dof[i + 1] - i_domain_dof[i]; matrix_size_counter -= matrix_size * matrix_size; piv_counter -= matrix_size; /* compute residual: ---------------------------------------- */ jj = 0; - for (j=i_domain_dof[i]; j < i_domain_dof[i+1]; j++) + for (j = i_domain_dof[i]; j < i_domain_dof[i + 1]; j++) { aux[jj] = hypre_VectorData(rhs)[j_domain_dof[j]]; if (CF_marker[j_domain_dof[j]] == rlx_pt) { - for (k=i_dof_dof[j_domain_dof[j]]; - k 1) { @@ -1198,26 +1289,28 @@ HYPRE_Int hypre_MPSchwarzCFFWSolve(hypre_ParCSRMatrix *par_A, /* forward solve: ----------------------------------------------- */ matrix_size_counter = 0; - for (i=0; i < num_domains; i++) + for (i = 0; i < num_domains; i++) { if (CF_marker[i] == rlx_pt) { - matrix_size = i_domain_dof[i+1] - i_domain_dof[i]; + matrix_size = i_domain_dof[i + 1] - i_domain_dof[i]; /* compute residual: ---------------------------------------- */ - jj = 0; - for (j=i_domain_dof[i]; j < i_domain_dof[i+1]; j++) + for (j = i_domain_dof[i]; j < i_domain_dof[i + 1]; j++) { aux[jj] = hypre_VectorData(rhs)[j_domain_dof[j]]; if (CF_marker[j_domain_dof[j]] == rlx_pt) { - for (k=i_dof_dof[j_domain_dof[j]]; - k -1; i--) - i_face_element[i] = i_face_element[i+1] - i_face_element[i]; + for (i = num_faces - 1; i > -1; i--) + { + i_face_element[i] = i_face_element[i + 1] - i_face_element[i]; + } - for (i=0; i < num_elements; i++) - for (j=i_element_face[i]; j < i_element_face[i+1]; j++) + for (i = 0; i < num_elements; i++) + { + for (j = i_element_face[i]; j < i_element_face[i + 1]; j++) { j_face_element[i_face_element[j_element_face[j]]] = i; i_face_element[j_element_face[j]]++; } + } - for (i=num_faces-1; i > -1; i--) - i_face_element[i+1] = i_face_element[i]; + for (i = num_faces - 1; i > -1; i--) + { + i_face_element[i + 1] = i_face_element[i]; + } i_face_element[0] = 0; @@ -1305,15 +1405,21 @@ transpose_matrix_create( HYPRE_Int **i_face_element_pointer, *j_face_element_pointer = j_face_element; return 0; - } + HYPRE_Int -matrix_matrix_product( HYPRE_Int **i_element_edge_pointer, - HYPRE_Int **j_element_edge_pointer, - HYPRE_Int *i_element_face, HYPRE_Int *j_element_face, - HYPRE_Int *i_face_edge, HYPRE_Int *j_face_edge, - HYPRE_Int num_elements, HYPRE_Int num_faces, HYPRE_Int num_edges) +matrix_matrix_product(HYPRE_Int **i_element_edge_pointer, + HYPRE_Int **j_element_edge_pointer, + HYPRE_Int *i_element_face, + HYPRE_Int *j_element_face, + HYPRE_Int *i_face_edge, + HYPRE_Int *j_face_edge, + HYPRE_Int num_elements, + HYPRE_Int num_faces, + HYPRE_Int num_edges) { + HYPRE_UNUSED_VAR(num_faces); + /* FILE *f; */ HYPRE_Int i, j, k, l, m; @@ -1323,21 +1429,22 @@ matrix_matrix_product( HYPRE_Int **i_element_edge_pointer, HYPRE_Int *i_element_edge, *j_element_edge; - j_local_element_edge = hypre_TAlloc(HYPRE_Int, (num_edges+1) , HYPRE_MEMORY_HOST); + j_local_element_edge = hypre_TAlloc(HYPRE_Int, (num_edges + 1), HYPRE_MEMORY_HOST); + i_element_edge = hypre_TAlloc(HYPRE_Int, (num_elements + 1), HYPRE_MEMORY_HOST); - i_element_edge = hypre_TAlloc(HYPRE_Int, (num_elements+1) , HYPRE_MEMORY_HOST); - - for (i=0; i < num_elements+1; i++) + for (i = 0; i < num_elements + 1; i++) + { i_element_edge[i] = 0; + } - for (i=0; i < num_elements; i++) + for (i = 0; i < num_elements; i++) { local_element_edge_counter = 0; - for (j=i_element_face[i]; j < i_element_face[i+1]; j++) + for (j = i_element_face[i]; j < i_element_face[i + 1]; j++) { k = j_element_face[j]; - for (l=i_face_edge[k]; l < i_face_edge[k+1]; l++) + for (l = i_face_edge[k]; l < i_face_edge[k + 1]; l++) { /* element i and edge j_face_edge[l] are connected */ @@ -1345,18 +1452,19 @@ matrix_matrix_product( HYPRE_Int **i_element_edge_pointer, i, j_face_edge[l]); */ i_edge_on_local_list = -1; - for (m=0; m < local_element_edge_counter; m++) + for (m = 0; m < local_element_edge_counter; m++) + { if (j_local_element_edge[m] == j_face_edge[l]) { i_edge_on_local_list++; break; } + } if (i_edge_on_local_list == -1) { i_element_edge[i]++; - j_local_element_edge[local_element_edge_counter]= - j_face_edge[l]; + j_local_element_edge[local_element_edge_counter] = j_face_edge[l]; local_element_edge_counter++; } } @@ -1365,55 +1473,55 @@ matrix_matrix_product( HYPRE_Int **i_element_edge_pointer, hypre_TFree(j_local_element_edge, HYPRE_MEMORY_HOST); - for (i=0; i < num_elements; i++) - i_element_edge[i+1] += i_element_edge[i]; + for (i = 0; i < num_elements; i++) + { + i_element_edge[i + 1] += i_element_edge[i]; + } - for (i=num_elements; i>0; i--) - i_element_edge[i] = i_element_edge[i-1]; + for (i = num_elements; i > 0; i--) + { + i_element_edge[i] = i_element_edge[i - 1]; + } i_element_edge[0] = 0; - - j_element_edge = hypre_TAlloc(HYPRE_Int, i_element_edge[num_elements] - , HYPRE_MEMORY_HOST); + j_element_edge = hypre_TAlloc(HYPRE_Int, i_element_edge[num_elements], HYPRE_MEMORY_HOST); /* fill--in the actual j_element_edge array: --------------------- */ element_edge_counter = 0; - for (i=0; i < num_elements; i++) + for (i = 0; i < num_elements; i++) { i_element_edge[i] = element_edge_counter; - for (j=i_element_face[i]; j < i_element_face[i+1]; j++) + for (j = i_element_face[i]; j < i_element_face[i + 1]; j++) { - for (k=i_face_edge[j_element_face[j]]; - k= i_element_edge[num_elements]) { - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"error in j_element_edge size: \n"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "error in j_element_edge size: \n"); break; } - j_element_edge[element_edge_counter] = - j_face_edge[k]; + j_element_edge[element_edge_counter] = j_face_edge[k]; element_edge_counter++; } } } - } i_element_edge[num_elements] = element_edge_counter; @@ -1456,12 +1564,16 @@ matrix_matrix_product( HYPRE_Int **i_element_edge_pointer, * *****************************************************************************/ HYPRE_Int -hypre_AMGCreateDomainDof(hypre_CSRMatrix *A, - HYPRE_Int domain_type, HYPRE_Int overlap, - HYPRE_Int num_functions, HYPRE_Int *dof_func, - hypre_CSRMatrix **domain_structure_pointer, - HYPRE_Int **piv_pointer, HYPRE_Int use_nonsymm) +hypre_AMGCreateDomainDof(hypre_CSRMatrix *A, + HYPRE_Int domain_type, + HYPRE_Int overlap, + HYPRE_Int num_functions, + HYPRE_Int *dof_func, + hypre_CSRMatrix **domain_structure_pointer, + HYPRE_Int **piv_pointer, + HYPRE_Int use_nonsymm) { + HYPRE_UNUSED_VAR(dof_func); HYPRE_Int *i_domain_dof, *j_domain_dof; HYPRE_Real *domain_matrixinverse; @@ -1475,18 +1587,18 @@ hypre_AMGCreateDomainDof(hypre_CSRMatrix *A, /* HYPRE_Int *i_dof_to_accept_weight; */ HYPRE_Int *i_dof_to_prefer_weight, - *w_dof_dof, *i_dof_weight; + *w_dof_dof, *i_dof_weight; HYPRE_Int *i_dof_to_aggregate, *i_aggregate_dof, *j_aggregate_dof; HYPRE_Int *i_dof_index; HYPRE_Int ierr = 0; - HYPRE_Int i,j,k, l_loc, i_loc, j_loc; + HYPRE_Int i, j, k, l_loc, i_loc, j_loc; HYPRE_Int i_dof; HYPRE_Int *i_local_to_global; HYPRE_Int *i_global_to_local; - HYPRE_Int local_dof_counter, max_local_dof_counter=0; + HYPRE_Int local_dof_counter, max_local_dof_counter = 0; HYPRE_Int domain_dof_counter = 0, domain_matrixinverse_counter = 0; HYPRE_Int nf; @@ -1511,14 +1623,13 @@ hypre_AMGCreateDomainDof(hypre_CSRMatrix *A, if (num_dofs == 0) { *domain_structure_pointer = domain_structure; - *piv_pointer = piv; return hypre_error_flag; } - i_aggregate_dof = hypre_CTAlloc(HYPRE_Int, num_dofs+1, HYPRE_MEMORY_HOST); - j_aggregate_dof= hypre_CTAlloc(HYPRE_Int, num_dofs, HYPRE_MEMORY_HOST); + i_aggregate_dof = hypre_CTAlloc(HYPRE_Int, num_dofs + 1, HYPRE_MEMORY_HOST); + j_aggregate_dof = hypre_CTAlloc(HYPRE_Int, num_dofs, HYPRE_MEMORY_HOST); if (domain_type == 2) { @@ -1526,14 +1637,20 @@ hypre_AMGCreateDomainDof(hypre_CSRMatrix *A, w_dof_dof = hypre_CTAlloc(HYPRE_Int, i_dof_dof[num_dofs], HYPRE_MEMORY_HOST); i_dof_weight = hypre_CTAlloc(HYPRE_Int, num_dofs, HYPRE_MEMORY_HOST); - for (i=0; i= i - && i_dof_index[j_dof_dof[k]]==-1) + for (j = i_aggregate_dof[i]; j < i_aggregate_dof[i + 1]; j++) + { + i_dof_index[j_aggregate_dof[j]] = -1; + } + + for (j = i_aggregate_dof[i]; j < i_aggregate_dof[i + 1]; j++) + { + for (k = i_dof_dof[j_aggregate_dof[j]]; k < i_dof_dof[j_aggregate_dof[j] + 1]; k++) + { + if (i_dof_to_aggregate[j_dof_dof[k]] >= i && i_dof_index[j_dof_dof[k]] == -1) { i_dof_index[j_dof_dof[k]]++; domain_dof_counter++; } + } + } } i_domain_dof[num_domains] = domain_dof_counter; j_domain_dof = hypre_CTAlloc(HYPRE_Int, domain_dof_counter, HYPRE_MEMORY_HOST); - for (i=0; i < num_dofs; i++) + for (i = 0; i < num_dofs; i++) + { i_dof_index[i] = -1; + } - domain_dof_counter=0; - for (i=0; i < num_domains; i++) + domain_dof_counter = 0; + for (i = 0; i < num_domains; i++) { - for (j=i_aggregate_dof[i]; j < i_aggregate_dof[i+1]; j++) - i_dof_index[j_aggregate_dof[j]]=-1; + for (j = i_aggregate_dof[i]; j < i_aggregate_dof[i + 1]; j++) + { + i_dof_index[j_aggregate_dof[j]] = -1; + } - for (j=i_aggregate_dof[i]; j < i_aggregate_dof[i+1]; j++) - for (k=i_dof_dof[j_aggregate_dof[j]]; - k= i - && i_dof_index[j_dof_dof[k]]==-1) + for (j = i_aggregate_dof[i]; j < i_aggregate_dof[i + 1]; j++) + { + for (k = i_dof_dof[j_aggregate_dof[j]]; k < i_dof_dof[j_aggregate_dof[j] + 1]; k++) + { + if (i_dof_to_aggregate[j_dof_dof[k]] >= i && i_dof_index[j_dof_dof[k]] == -1) { i_dof_index[j_dof_dof[k]]++; j_domain_dof[domain_dof_counter] = j_dof_dof[k]; domain_dof_counter++; } + } + } } hypre_TFree(i_aggregate_dof, HYPRE_MEMORY_HOST); @@ -1649,56 +1780,73 @@ hypre_AMGCreateDomainDof(hypre_CSRMatrix *A, } else if (overlap == 2) { - i_domain_dof = hypre_CTAlloc(HYPRE_Int, num_domains+1, HYPRE_MEMORY_HOST); + i_domain_dof = hypre_CTAlloc(HYPRE_Int, num_domains + 1, HYPRE_MEMORY_HOST); i_dof_index = hypre_CTAlloc(HYPRE_Int, num_dofs, HYPRE_MEMORY_HOST); - for (i=0; i < num_dofs; i++) + for (i = 0; i < num_dofs; i++) + { i_dof_index[i] = -1; + } - domain_dof_counter=0; - for (i=0; i < num_domains; i++) + domain_dof_counter = 0; + for (i = 0; i < num_domains; i++) { i_domain_dof[i] = domain_dof_counter; - for (j=i_aggregate_dof[i]; j < i_aggregate_dof[i+1]; j++) - for (k=i_dof_dof[j_aggregate_dof[j]]; - k max_local_dof_counter) + { max_local_dof_counter = local_dof_counter; + } } - domain_matrixinverse = hypre_CTAlloc(HYPRE_Real, domain_matrixinverse_counter, HYPRE_MEMORY_HOST); + domain_matrixinverse = hypre_CTAlloc(HYPRE_Real, domain_matrixinverse_counter, + HYPRE_MEMORY_HOST); if (use_nonsymm) + { piv = hypre_CTAlloc(HYPRE_Int, piv_counter, HYPRE_MEMORY_HOST); + } i_local_to_global = hypre_CTAlloc(HYPRE_Int, max_local_dof_counter, HYPRE_MEMORY_HOST); - i_global_to_local = hypre_CTAlloc(HYPRE_Int, num_dofs, HYPRE_MEMORY_HOST); - for (i=0; i < num_dofs; i++) + for (i = 0; i < num_dofs; i++) + { i_global_to_local[i] = -1; + } piv_counter = 0; domain_matrixinverse_counter = 0; - for (i=0; i < num_domains; i++) + for (i = 0; i < num_domains; i++) { local_dof_counter = 0; - for (j=i_domain_dof[i]; j < i_domain_dof[i+1]; j++) + for (j = i_domain_dof[i]; j < i_domain_dof[i + 1]; j++) { i_global_to_local[j_domain_dof[j]] = local_dof_counter; i_local_to_global[local_dof_counter] = j_domain_dof[j]; @@ -1755,18 +1909,24 @@ hypre_AMGCreateDomainDof(hypre_CSRMatrix *A, AE = &domain_matrixinverse[domain_matrixinverse_counter]; ipiv = &piv[piv_counter]; - for (i_loc=0; i_loc < local_dof_counter; i_loc++) - for (j_loc=0; j_loc < local_dof_counter; j_loc++) + for (i_loc = 0; i_loc < local_dof_counter; i_loc++) + { + for (j_loc = 0; j_loc < local_dof_counter; j_loc++) + { AE[cnt++] = 0.e0; + } + } - for (i_loc=0; i_loc < local_dof_counter; i_loc++) + for (i_loc = 0; i_loc < local_dof_counter; i_loc++) { i_dof = i_local_to_global[i_loc]; - for (j=i_dof_dof[i_dof]; j < i_dof_dof[i_dof+1]; j++) + for (j = i_dof_dof[i_dof]; j < i_dof_dof[i_dof + 1]; j++) { j_loc = i_global_to_local[j_dof_dof[j]]; - if (j_loc >=0) + if (j_loc >= 0) + { AE[i_loc + j_loc * local_dof_counter] = a_dof_dof[j]; + } } } @@ -1775,20 +1935,20 @@ hypre_AMGCreateDomainDof(hypre_CSRMatrix *A, hypre_dgetrf(&local_dof_counter, &local_dof_counter, AE, &local_dof_counter, ipiv, &ierr); - piv_counter +=local_dof_counter; + piv_counter += local_dof_counter; } - else { - hypre_dpotrf(&uplo,&local_dof_counter, AE, + hypre_dpotrf(&uplo, &local_dof_counter, AE, &local_dof_counter, &ierr); } - domain_matrixinverse_counter+=local_dof_counter*local_dof_counter; + domain_matrixinverse_counter += local_dof_counter * local_dof_counter; - for (l_loc=0; l_loc < local_dof_counter; l_loc++) + for (l_loc = 0; l_loc < local_dof_counter; l_loc++) + { i_global_to_local[i_local_to_global[l_loc]] = -1; - + } } hypre_TFree(i_local_to_global, HYPRE_MEMORY_HOST); @@ -1812,14 +1972,21 @@ hypre_AMGCreateDomainDof(hypre_CSRMatrix *A, /* unacceptable faces: i_face_to_prefer_weight[] = -1; ------------------*/ -HYPRE_Int hypre_AMGeAgglomerate(HYPRE_Int *i_AE_element, HYPRE_Int *j_AE_element, - HYPRE_Int *i_face_face, HYPRE_Int *j_face_face, HYPRE_Int *w_face_face, - HYPRE_Int *i_face_element, HYPRE_Int *j_face_element, - HYPRE_Int *i_element_face, HYPRE_Int *j_element_face, - HYPRE_Int *i_face_to_prefer_weight, - HYPRE_Int *i_face_weight, - HYPRE_Int num_faces, HYPRE_Int num_elements, - HYPRE_Int *num_AEs_pointer) +HYPRE_Int +hypre_AMGeAgglomerate(HYPRE_Int *i_AE_element, + HYPRE_Int *j_AE_element, + HYPRE_Int *i_face_face, + HYPRE_Int *j_face_face, + HYPRE_Int *w_face_face, + HYPRE_Int *i_face_element, + HYPRE_Int *j_face_element, + HYPRE_Int *i_element_face, + HYPRE_Int *j_element_face, + HYPRE_Int *i_face_to_prefer_weight, + HYPRE_Int *i_face_weight, + HYPRE_Int num_faces, + HYPRE_Int num_elements, + HYPRE_Int *num_AEs_pointer) { HYPRE_Int ierr = 0; HYPRE_Int i, j, k, l; @@ -1827,7 +1994,7 @@ HYPRE_Int hypre_AMGeAgglomerate(HYPRE_Int *i_AE_element, HYPRE_Int *j_AE_element HYPRE_Int face_to_eliminate; HYPRE_Int max_weight_old, max_weight; - HYPRE_Int AE_counter=0, AE_element_counter=0; + HYPRE_Int AE_counter = 0, AE_element_counter = 0; /* HYPRE_Int i_element_face_counter; */ @@ -1841,34 +2008,40 @@ HYPRE_Int hypre_AMGeAgglomerate(HYPRE_Int *i_AE_element, HYPRE_Int *j_AE_element HYPRE_Int weight, weight_max; max_weight = 1; - for (i=0; i < num_faces; i++) + for (i = 0; i < num_faces; i++) { weight = 1; - for (j=i_face_face[i]; j < i_face_face[i+1]; j++) - weight+= w_face_face[j]; - if (max_weight < weight) max_weight = weight; - } - - first = hypre_CTAlloc(HYPRE_Int, max_weight+1, HYPRE_MEMORY_HOST); + for (j = i_face_face[i]; j < i_face_face[i + 1]; j++) + { + weight += w_face_face[j]; + } - next = hypre_CTAlloc(HYPRE_Int, num_faces, HYPRE_MEMORY_HOST); + if (max_weight < weight) + { + max_weight = weight; + } + } - previous = hypre_CTAlloc(HYPRE_Int, num_faces+1, HYPRE_MEMORY_HOST); + first = hypre_CTAlloc(HYPRE_Int, max_weight + 1, HYPRE_MEMORY_HOST); + next = hypre_CTAlloc(HYPRE_Int, num_faces, HYPRE_MEMORY_HOST); + previous = hypre_CTAlloc(HYPRE_Int, num_faces + 1, HYPRE_MEMORY_HOST); tail = num_faces; head = -1; - for (i=0; i < num_faces; i++) + for (i = 0; i < num_faces; i++) { - next[i] = i+1; - previous[i] = i-1; + next[i] = i + 1; + previous[i] = i - 1; } - last = num_faces-1; + last = num_faces - 1; previous[tail] = last; - for (weight=1; weight <= max_weight; weight++) + for (weight = 1; weight <= max_weight; weight++) + { first[weight] = tail; + } i_element_to_AE = hypre_CTAlloc(HYPRE_Int, num_elements, HYPRE_MEMORY_HOST); @@ -1876,11 +2049,15 @@ HYPRE_Int hypre_AMGeAgglomerate(HYPRE_Int *i_AE_element, HYPRE_Int *j_AE_element AGGLOMERATION PROCEDURE: ======================================================================= */ - for (k=0; k < num_elements; k++) + for (k = 0; k < num_elements; k++) + { i_element_to_AE[k] = -1; + } - for (k=0; k < num_faces; k++) + for (k = 0; k < num_faces; k++) + { i_face_weight[k] = 1; + } first[0] = 0; first[1] = 0; @@ -1890,14 +2067,16 @@ HYPRE_Int hypre_AMGeAgglomerate(HYPRE_Int *i_AE_element, HYPRE_Int *j_AE_element k = last; face_max_weight = -1; - while (k!= head) + while (k != head) { if (i_face_to_prefer_weight[k] > -1) + { face_max_weight = k; + } - if (face_max_weight > -1) break; + if (face_max_weight > -1) { break; } - k=previous[k]; + k = previous[k]; } /* this will be used if the faces have been sorted: ***************** @@ -1953,12 +2132,13 @@ HYPRE_Int hypre_AMGeAgglomerate(HYPRE_Int *i_AE_element, HYPRE_Int *j_AE_element if (face_max_weight == -1) { - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"all faces are unacceptable, i.e., no faces to eliminate !\n"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "all faces are unacceptable, i.e., no faces to eliminate !\n"); *num_AEs_pointer = 1; i_AE_element[0] = 0; - for (i=0; i < num_elements; i++) + for (i = 0; i < num_elements; i++) { i_element_to_AE[i] = 0; j_AE_element[i] = i; @@ -1969,14 +2149,18 @@ HYPRE_Int hypre_AMGeAgglomerate(HYPRE_Int *i_AE_element, HYPRE_Int *j_AE_element return hypre_error_flag; } - for (k=0; k < num_faces; k++) + for (k = 0; k < num_faces; k++) + { if (i_face_to_prefer_weight[k] > i_face_to_prefer_weight[face_max_weight]) + { face_max_weight = k; + } + } max_weight = i_face_weight[face_max_weight]; - AE_counter=0; - AE_element_counter=0; + AE_counter = 0; + AE_element_counter = 0; i_AE_element[AE_counter] = AE_element_counter; @@ -1984,17 +2168,14 @@ HYPRE_Int hypre_AMGeAgglomerate(HYPRE_Int *i_AE_element, HYPRE_Int *j_AE_element face_local_max_weight = face_max_weight; - eliminate_face: +eliminate_face: face_to_eliminate = face_local_max_weight; max_weight = i_face_weight[face_to_eliminate]; last = previous[tail]; - if (last == head) - weight_max = 0; - else - weight_max = i_face_weight[last]; + weight_max = (last == head) ? 0 : i_face_weight[last]; ierr = hypre_remove_entry(max_weight, &weight_max, previous, next, first, &last, @@ -2010,11 +2191,9 @@ HYPRE_Int hypre_AMGeAgglomerate(HYPRE_Int *i_AE_element, HYPRE_Int *j_AE_element * that share face "face_to_eliminate"; *----------------------------------------------------------*/ - for (k = i_face_element[face_to_eliminate]; - k < i_face_element[face_to_eliminate+1]; k++) + for (k = i_face_element[face_to_eliminate]; k < i_face_element[face_to_eliminate + 1]; k++) { /* check if element j_face_element[k] is already on the list: */ - if (j_face_element[k] < num_elements) { if (i_element_to_AE[j_face_element[k]] == -1) @@ -2028,35 +2207,27 @@ HYPRE_Int hypre_AMGeAgglomerate(HYPRE_Int *i_AE_element, HYPRE_Int *j_AE_element /* local update & search:==================================== */ - for (j=i_face_face[face_to_eliminate]; - j 0) { - weight = i_face_weight[j_face_face[j]]; - - - last = previous[tail]; - if (last == head) - weight_max = 0; - else - weight_max = i_face_weight[last]; + weight = i_face_weight[j_face_face[j]]; + last = previous[tail]; + weight_max = (last == head) ? 0 : i_face_weight[last]; ierr = hypre_move_entry(weight, &weight_max, previous, next, first, &last, head, tail, j_face_face[j]); - i_face_weight[j_face_face[j]]+=w_face_face[j]; + i_face_weight[j_face_face[j]] += w_face_face[j]; weight = i_face_weight[j_face_face[j]]; /* hypre_printf("update entry: %d\n", j_face_face[j]); */ last = previous[tail]; - if (last == head) - weight_max = 0; - else - weight_max = i_face_weight[last]; + weight_max = (last == head) ? 0 : i_face_weight[last]; ierr = hypre_update_entry(weight, &weight_max, previous, next, first, &last, @@ -2065,29 +2236,30 @@ HYPRE_Int hypre_AMGeAgglomerate(HYPRE_Int *i_AE_element, HYPRE_Int *j_AE_element last = previous[tail]; if (last == head) + { weight_max = 0; + } else + { weight_max = i_face_weight[last]; + } } + } /* find a face of the elements that have already been agglomerated with a maximal weight: ====================================== */ max_weight_old = max_weight; - face_local_max_weight = -1; preferred_weight = -1; - for (l = i_AE_element[AE_counter]; - l < AE_element_counter; l++) + for (l = i_AE_element[AE_counter]; l < AE_element_counter; l++) { - for (j=i_element_face[j_AE_element[l]]; - j 1 && i_face_weight[i] > 0 && - i_face_to_prefer_weight[i] > -1) + if (max_weight_old > 1 && i_face_weight[i] > 0 && i_face_to_prefer_weight[i] > -1) { if ( max_weight < i_face_weight[i]) { @@ -2096,8 +2268,7 @@ HYPRE_Int hypre_AMGeAgglomerate(HYPRE_Int *i_AE_element, HYPRE_Int *j_AE_element preferred_weight = i_face_to_prefer_weight[i]; } - if ( max_weight == i_face_weight[i] - && i_face_to_prefer_weight[i] > preferred_weight) + if ( max_weight == i_face_weight[i] && i_face_to_prefer_weight[i] > preferred_weight) { face_local_max_weight = i; preferred_weight = i_face_to_prefer_weight[i]; @@ -2106,7 +2277,10 @@ HYPRE_Int hypre_AMGeAgglomerate(HYPRE_Int *i_AE_element, HYPRE_Int *j_AE_element } } - if (face_local_max_weight > -1) goto eliminate_face; + if (face_local_max_weight > -1) + { + goto eliminate_face; + } /* ---------------------------------------------------------------- * eliminate and label with i_face_weight[ ] = -1 @@ -2118,17 +2292,20 @@ HYPRE_Int hypre_AMGeAgglomerate(HYPRE_Int *i_AE_element, HYPRE_Int *j_AE_element for (k = i_AE_element[AE_counter]; k < AE_element_counter; k++) { for (j = i_element_face[j_AE_element[k]]; - j < i_element_face[j_AE_element[k]+1]; j++) + j < i_element_face[j_AE_element[k] + 1]; j++) { if (i_face_weight[j_element_face[j]] > 0) { weight = i_face_weight[j_element_face[j]]; last = previous[tail]; if (last == head) + { weight_max = 0; + } else + { weight_max = i_face_weight[last]; - + } ierr = hypre_remove_entry(weight, &weight_max, previous, next, first, &last, @@ -2136,7 +2313,6 @@ HYPRE_Int hypre_AMGeAgglomerate(HYPRE_Int *i_AE_element, HYPRE_Int *j_AE_element j_element_face[j]); i_face_weight[j_element_face[j]] = -1; - } } } @@ -2153,7 +2329,10 @@ HYPRE_Int hypre_AMGeAgglomerate(HYPRE_Int *i_AE_element, HYPRE_Int *j_AE_element /* find a face with maximal weight: ---------------------------*/ last = previous[tail]; - if (last == head) goto end_agglomerate; + if (last == head) + { + goto end_agglomerate; + } weight_max = i_face_weight[last]; @@ -2165,7 +2344,9 @@ HYPRE_Int hypre_AMGeAgglomerate(HYPRE_Int *i_AE_element, HYPRE_Int *j_AE_element while (k != head) { if (i_face_to_prefer_weight[k] > -1) + { face_max_weight = k; + } if (face_max_weight > -1) { @@ -2174,69 +2355,74 @@ HYPRE_Int hypre_AMGeAgglomerate(HYPRE_Int *i_AE_element, HYPRE_Int *j_AE_element while (previous[l] != head) { - if (i_face_weight[previous[l]] < max_weight) + { break; + } + else if (i_face_to_prefer_weight[previous[l]] > + i_face_to_prefer_weight[face_max_weight]) + { + l = previous[l]; + face_max_weight = l; + } else - if (i_face_to_prefer_weight[previous[l]] > - i_face_to_prefer_weight[face_max_weight]) - { - l = previous[l]; - face_max_weight = l; - } - else - l = previous[l]; + { + l = previous[l]; + } } break; } - l =previous[k]; + l = previous[k]; /* remove face k: ---------------------------------------*/ - weight = i_face_weight[k]; - last = previous[tail]; - if (last == head) - weight_max = 0; - else - weight_max = i_face_weight[last]; - + weight = i_face_weight[k]; + last = previous[tail]; + weight_max = (last == head) ? 0 : i_face_weight[last]; ierr = hypre_remove_entry(weight, &weight_max, previous, next, first, &last, head, tail, k); - /* i_face_weight[k] = -1; */ - k=l; + k = l; } - if (face_max_weight == -1) goto end_agglomerate; + if (face_max_weight == -1) + { + goto end_agglomerate; + } max_weight = i_face_weight[face_max_weight]; - face_local_max_weight = face_max_weight; goto eliminate_face; - end_agglomerate: +end_agglomerate: /* eliminate isolated elements: ----------------------------------*/ - for (i=0; i -1) - for (k=i_face_element[j_element_face[j]]; - k -1; i--) - i_AE_element[i] = i_AE_element[i+1] - i_AE_element[i]; + for (i = AE_counter - 1; i > -1; i--) + { + i_AE_element[i] = i_AE_element[i + 1] - i_AE_element[i]; + } - for (i=0; i < num_elements; i++) + for (i = 0; i < num_elements; i++) { j_AE_element[i_AE_element[i_element_to_AE[i]]] = i; i_AE_element[i_element_to_AE[i]]++; } - for (i=AE_counter-1; i > -1; i--) - i_AE_element[i+1] = i_AE_element[i]; + for (i = AE_counter - 1; i > -1; i--) + { + i_AE_element[i + 1] = i_AE_element[i]; + } i_AE_element[0] = 0; /*--------------------------------------------------------------------*/ - for (i=0; i < num_faces; i++) - if (i_face_to_prefer_weight[i] == -1) i_face_weight[i] = -1; - + for (i = 0; i < num_faces; i++) + { + if (i_face_to_prefer_weight[i] == -1) + { + i_face_weight[i] = -1; + } + } hypre_TFree(i_element_to_AE, HYPRE_MEMORY_HOST); - hypre_TFree(previous, HYPRE_MEMORY_HOST); hypre_TFree(next, HYPRE_MEMORY_HOST); hypre_TFree(first, HYPRE_MEMORY_HOST); @@ -2306,15 +2503,23 @@ HYPRE_Int hypre_AMGeAgglomerate(HYPRE_Int *i_AE_element, HYPRE_Int *j_AE_element return ierr; } -HYPRE_Int hypre_update_entry(HYPRE_Int weight, HYPRE_Int *weight_max, - HYPRE_Int *previous, HYPRE_Int *next, HYPRE_Int *first, HYPRE_Int *last, - HYPRE_Int head, HYPRE_Int tail, - HYPRE_Int i) +HYPRE_Int +hypre_update_entry(HYPRE_Int weight, + HYPRE_Int *weight_max, + HYPRE_Int *previous, + HYPRE_Int *next, + HYPRE_Int *first, + HYPRE_Int *last, + HYPRE_Int head, + HYPRE_Int tail, + HYPRE_Int i) { + HYPRE_UNUSED_VAR(last); + HYPRE_Int weight0; - if (previous[i] != head) next[previous[i]] = next[i]; + if (previous[i] != head) { next[previous[i]] = next[i]; } previous[next[i]] = previous[i]; if (first[weight] == tail) @@ -2326,7 +2531,7 @@ HYPRE_Int hypre_update_entry(HYPRE_Int weight, HYPRE_Int *weight_max, weight, weight_max[0]); return -1; } - for (weight0=weight_max[0]+1; weight0 <= weight; weight0++) + for (weight0 = weight_max[0] + 1; weight0 <= weight; weight0++) { first[weight0] = i; /* hypre_printf("create first[%d] = %d\n", weight0, i); */ @@ -2335,7 +2540,9 @@ HYPRE_Int hypre_update_entry(HYPRE_Int weight, HYPRE_Int *weight_max, previous[i] = previous[tail]; next[i] = tail; if (previous[tail] > head) + { next[previous[tail]] = i; + } previous[tail] = i; } @@ -2346,30 +2553,48 @@ HYPRE_Int hypre_update_entry(HYPRE_Int weight, HYPRE_Int *weight_max, next[i] = first[weight]; if (previous[first[weight]] != head) + { next[previous[first[weight]]] = i; + } previous[first[weight]] = i; - for (weight0=1; weight0 <= weight; weight0++) + for (weight0 = 1; weight0 <= weight; weight0++) + { if (first[weight0] == first[weight]) + { first[weight0] = i; - + } + } } return 0; } -HYPRE_Int hypre_remove_entry(HYPRE_Int weight, HYPRE_Int *weight_max, - HYPRE_Int *previous, HYPRE_Int *next, HYPRE_Int *first, HYPRE_Int *last, - HYPRE_Int head, HYPRE_Int tail, - HYPRE_Int i) +HYPRE_Int +hypre_remove_entry(HYPRE_Int weight, + HYPRE_Int *weight_max, + HYPRE_Int *previous, + HYPRE_Int *next, + HYPRE_Int *first, + HYPRE_Int *last, + HYPRE_Int head, + HYPRE_Int tail, + HYPRE_Int i) { + HYPRE_UNUSED_VAR(weight); + HYPRE_UNUSED_VAR(last); + HYPRE_UNUSED_VAR(tail); + HYPRE_Int weight0; - if (previous[i] != head) next[previous[i]] = next[i]; + if (previous[i] != head) + { + next[previous[i]] = next[i]; + } previous[next[i]] = previous[i]; - for (weight0=1; weight0 <= weight_max[0]; weight0++) + for (weight0 = 1; weight0 <= weight_max[0]; weight0++) { /* hypre_printf("first[%d}: %d\n", weight0, first[weight0]); */ if (first[weight0] == i) @@ -2388,20 +2613,35 @@ HYPRE_Int hypre_remove_entry(HYPRE_Int weight, HYPRE_Int *weight_max, return 0; } -HYPRE_Int hypre_move_entry(HYPRE_Int weight, HYPRE_Int *weight_max, - HYPRE_Int *previous, HYPRE_Int *next, HYPRE_Int *first, HYPRE_Int *last, - HYPRE_Int head, HYPRE_Int tail, - HYPRE_Int i) +HYPRE_Int +hypre_move_entry(HYPRE_Int weight, + HYPRE_Int *weight_max, + HYPRE_Int *previous, + HYPRE_Int *next, + HYPRE_Int *first, + HYPRE_Int *last, + HYPRE_Int head, + HYPRE_Int tail, + HYPRE_Int i) { + HYPRE_UNUSED_VAR(weight); + HYPRE_UNUSED_VAR(last); + HYPRE_UNUSED_VAR(tail); + HYPRE_Int weight0; - if (previous[i] != head) next[previous[i]] = next[i]; + if (previous[i] != head) + { + next[previous[i]] = next[i]; + } previous[next[i]] = previous[i]; - for (weight0=1; weight0 <= weight_max[0]; weight0++) + for (weight0 = 1; weight0 <= weight_max[0]; weight0++) { if (first[weight0] == i) + { first[weight0] = next[i]; + } } return 0; @@ -2411,15 +2651,18 @@ HYPRE_Int hypre_move_entry(HYPRE_Int weight, HYPRE_Int *weight_max, hypre_matinv: X <-- A**(-1) ; A IS POSITIVE DEFINITE (non--symmetric); ---------------------------------------------------------------------*/ -HYPRE_Int hypre_matinv(HYPRE_Real *x, HYPRE_Real *a, HYPRE_Int k) +HYPRE_Int +hypre_matinv(HYPRE_Real *x, + HYPRE_Real *a, + HYPRE_Int k) { - HYPRE_Int i,j,l, ierr =0; + HYPRE_Int i, j, l, ierr = 0; - for (i=0; i < k; i++) + for (i = 0; i < k; i++) { - if (a[i+i*k] <= 0.e0) + if (a[i + i * k] <= 0.e0) { - if (i < k-1) + if (i < k - 1) { /********* hypre_printf("indefinite singular matrix in *** matinv ***:\n"); @@ -2428,47 +2671,49 @@ HYPRE_Int hypre_matinv(HYPRE_Real *x, HYPRE_Real *a, HYPRE_Int k) ierr = -1; } - a[i+i*k] = 0.e0; + a[i + i * k] = 0.e0; } else - a[i+k*i] = 1.0 / a[i+i*k]; + { + a[i + k * i] = 1.0 / a[i + i * k]; + } - for (j=1; j < k-i; j++) + for (j = 1; j < k - i; j++) { - for (l=1; l < k-i; l++) + for (l = 1; l < k - i; l++) { - a[i+l+k*(i+j)] -= a[i+l+k*i] * a[i+k*i] * a[i+k*(i+j)]; + a[i + l + k * (i + j)] -= a[i + l + k * i] * a[i + k * i] * a[i + k * (i + j)]; } } - for (j=1; j < k-i; j++) + for (j = 1; j < k - i; j++) { - a[i+j+k*i] = a[i+j+k*i] * a[i+k*i]; - a[i+k*(i+j)] = a[i+k*(i+j)] * a[i+k*i]; + a[i + j + k * i] = a[i + j + k * i] * a[i + k * i]; + a[i + k * (i + j)] = a[i + k * (i + j)] * a[i + k * i]; } } /* FULL INVERSION: --------------------------------------------*/ - x[k*k-1] = a[k*k-1]; - for (i=k-1; i > -1; i--) + x[k * k - 1] = a[k * k - 1]; + for (i = k - 1; i > -1; i--) { - for (j=1; j < k-i; j++) + for (j = 1; j < k - i; j++) { - x[i+j+k*i] =0; - x[i+k*(i+j)] =0; + x[i + j + k * i] = 0; + x[i + k * (i + j)] = 0; - for (l=1; l< k-i; l++) + for (l = 1; l < k - i; l++) { - x[i+j+k*i] -= x[i+j+k*(i+l)] * a[i+l+k*i]; - x[i+k*(i+j)] -= a[i+k*(i+l)] * x[i+l+k*(i+j)]; + x[i + j + k * i] -= x[i + j + k * (i + l)] * a[i + l + k * i]; + x[i + k * (i + j)] -= a[i + k * (i + l)] * x[i + l + k * (i + j)]; } } - x[i+k*i] = a[i+k*i]; - for (j=1; j 1) { - hypre_MatvecCommPkgCreate(A); comm_pkg = hypre_ParCSRMatrixCommPkg(A); @@ -3131,87 +3402,108 @@ hypre_ParAMGCreateDomainDof(hypre_ParCSRMatrix *A, recv_vec_starts = hypre_ParCSRCommPkgRecvVecStarts(comm_pkg); } - for (i=0; i < num_recvs; i++) - for (indx=recv_vec_starts[i]; indx < recv_vec_starts[i+1]; indx++) + for (i = 0; i < num_recvs; i++) + { + for (indx = recv_vec_starts[i]; indx < recv_vec_starts[i + 1]; indx++) + { i_proc[indx] = i; + } + } /* make domains from aggregates: *********************************/ - i_dof_index = hypre_CTAlloc(HYPRE_Int, num_variables, HYPRE_MEMORY_HOST); + i_dof_index = hypre_CTAlloc(HYPRE_Int, num_variables, HYPRE_MEMORY_HOST); + i_dof_index_offd = hypre_CTAlloc(HYPRE_Int, num_cols_offd, HYPRE_MEMORY_HOST); - i_dof_index_offd = hypre_CTAlloc(HYPRE_Int, num_cols_offd, HYPRE_MEMORY_HOST); - - for (i=0; i < num_variables; i++) + for (i = 0; i < num_variables; i++) + { i_dof_index[i] = -1; + } - for (i=0; i < num_cols_offd; i++) + for (i = 0; i < num_cols_offd; i++) + { i_dof_index_offd[i] = -1; + } - domain_dof_counter=0; - for (i=0; i < num_domains; i++) + domain_dof_counter = 0; + for (i = 0; i < num_domains; i++) { i_domain_dof[i] = domain_dof_counter; - for (j=i_aggregate_dof[i]; j < i_aggregate_dof[i+1]; j++) + for (j = i_aggregate_dof[i]; j < i_aggregate_dof[i + 1]; j++) { - i_dof_index[j_aggregate_dof[j]]=-1; + i_dof_index[j_aggregate_dof[j]] = -1; } - for (j=i_aggregate_dof[i]; j < i_aggregate_dof[i+1]; j++) + for (j = i_aggregate_dof[i]; j < i_aggregate_dof[i + 1]; j++) { - for (k=a_diag_i[j_aggregate_dof[j]]; - k= i - && i_dof_index[a_diag_j[k]]==-1) + && i_dof_index[a_diag_j[k]] == -1) { i_dof_index[a_diag_j[k]]++; domain_dof_counter++; } - for (k=a_offd_i[j_aggregate_dof[j]]; - k my_id - && i_dof_index_offd[a_offd_j[k]]==-1) + && i_dof_index_offd[a_offd_j[k]] == -1) { i_dof_index_offd[a_offd_j[k]]++; domain_dof_counter++; } + } } } - for (i=0; i < num_variables; i++) + for (i = 0; i < num_variables; i++) + { i_dof_index[i] = -1; + } - for (i=0; i < num_cols_offd; i++) + for (i = 0; i < num_cols_offd; i++) + { i_dof_index_offd[i] = -1; + } - i_domain_dof[num_domains] = domain_dof_counter; - j_domain_dof = hypre_CTAlloc(HYPRE_Int, domain_dof_counter, HYPRE_MEMORY_HOST); + i_domain_dof[num_domains] = domain_dof_counter; + j_domain_dof = hypre_CTAlloc(HYPRE_Int, domain_dof_counter, HYPRE_MEMORY_HOST); - domain_dof_counter=0; - for (i=0; i < num_domains; i++) + domain_dof_counter = 0; + for (i = 0; i < num_domains; i++) { - for (j=i_aggregate_dof[i]; j < i_aggregate_dof[i+1]; j++) + for (j = i_aggregate_dof[i]; j < i_aggregate_dof[i + 1]; j++) { - i_dof_index[j_aggregate_dof[j]]=-1; + i_dof_index[j_aggregate_dof[j]] = -1; } - for (j=i_aggregate_dof[i]; j < i_aggregate_dof[i+1]; j++) + for (j = i_aggregate_dof[i]; j < i_aggregate_dof[i + 1]; j++) { - for (k=a_diag_i[j_aggregate_dof[j]]; - k= i - && i_dof_index[a_diag_j[k]]==-1) + for (k = a_diag_i[j_aggregate_dof[j]]; + k < a_diag_i[j_aggregate_dof[j] + 1]; k++) + { + if ( (i_dof_to_aggregate[a_diag_j[k]] >= i) && + (i_dof_index[a_diag_j[k]] == -1) ) { i_dof_index[a_diag_j[k]]++; j_domain_dof[domain_dof_counter] = a_diag_j[k]; domain_dof_counter++; } - for (k=a_offd_i[j_aggregate_dof[j]]; - k my_id - && i_dof_index_offd[a_offd_j[k]]==-1) + } + + for (k = a_offd_i[j_aggregate_dof[j]]; + k < a_offd_i[j_aggregate_dof[j] + 1]; k++) + { + if ( (i_proc[a_offd_j[k]] > my_id) && + (i_dof_index_offd[a_offd_j[k]] == -1) ) { i_dof_index_offd[a_offd_j[k]]++; - j_domain_dof[domain_dof_counter] = a_offd_j[k]+num_variables; + j_domain_dof[domain_dof_counter] = a_offd_j[k] + num_variables; domain_dof_counter++; } + } } } @@ -3224,97 +3516,126 @@ hypre_ParAMGCreateDomainDof(hypre_ParCSRMatrix *A, } else if (overlap == 2) { - i_domain_dof = hypre_CTAlloc(HYPRE_Int, num_domains+1, HYPRE_MEMORY_HOST); + i_domain_dof = hypre_CTAlloc(HYPRE_Int, num_domains + 1, HYPRE_MEMORY_HOST); + i_dof_to_aggregate = hypre_CTAlloc(HYPRE_Int, num_variables, HYPRE_MEMORY_HOST); - i_dof_to_aggregate = hypre_CTAlloc(HYPRE_Int, num_variables, HYPRE_MEMORY_HOST); - for (i=0; i < num_domains; i++) - for (j=i_aggregate_dof[i]; j < i_aggregate_dof[i+1]; j++) + for (i = 0; i < num_domains; i++) + { + for (j = i_aggregate_dof[i]; j < i_aggregate_dof[i + 1]; j++) + { i_dof_to_aggregate[j_aggregate_dof[j]] = i; + } + } /* make domains from aggregates: *********************************/ - i_dof_index = hypre_CTAlloc(HYPRE_Int, num_variables, HYPRE_MEMORY_HOST); + i_dof_index = hypre_CTAlloc(HYPRE_Int, num_variables, HYPRE_MEMORY_HOST); + i_dof_index_offd = hypre_CTAlloc(HYPRE_Int, num_cols_offd, HYPRE_MEMORY_HOST); - i_dof_index_offd = hypre_CTAlloc(HYPRE_Int, num_cols_offd, HYPRE_MEMORY_HOST); - - for (i=0; i < num_variables; i++) + for (i = 0; i < num_variables; i++) + { i_dof_index[i] = -1; + } - for (i=0; i < num_cols_offd; i++) + for (i = 0; i < num_cols_offd; i++) + { i_dof_index_offd[i] = -1; + } - domain_dof_counter=0; - for (i=0; i < num_domains; i++) + domain_dof_counter = 0; + for (i = 0; i < num_domains; i++) { i_domain_dof[i] = domain_dof_counter; - for (j=i_aggregate_dof[i]; j < i_aggregate_dof[i+1]; j++) + for (j = i_aggregate_dof[i]; j < i_aggregate_dof[i + 1]; j++) { - for (k=a_diag_i[j_aggregate_dof[j]]; - k max_local_dof_counter) + { max_local_dof_counter = local_dof_counter; + } } - domain_matrixinverse = hypre_CTAlloc(HYPRE_Real, domain_matrixinverse_counter, HYPRE_MEMORY_HOST); + domain_matrixinverse = hypre_CTAlloc(HYPRE_Real, domain_matrixinverse_counter, + HYPRE_MEMORY_HOST); if (use_nonsymm) - piv = hypre_CTAlloc(HYPRE_Int, piv_counter, HYPRE_MEMORY_HOST); + { + piv = hypre_CTAlloc(HYPRE_Int, piv_counter, HYPRE_MEMORY_HOST); + } if (num_procs > 1) { - A_ext = hypre_ParCSRMatrixExtractBExt(A,A,1); + A_ext = hypre_ParCSRMatrixExtractBExt(A, A, 1); a_ext_i = hypre_CSRMatrixI(A_ext); a_ext_j = hypre_CSRMatrixBigJ(A_ext); a_ext_data = hypre_CSRMatrixData(A_ext); } else + { A_ext = NULL; + } - i_local_to_global = hypre_CTAlloc(HYPRE_Int, max_local_dof_counter, HYPRE_MEMORY_HOST); - - i_global_to_local = hypre_CTAlloc(HYPRE_Int, num_variables+num_cols_offd, HYPRE_MEMORY_HOST); + i_local_to_global = hypre_CTAlloc(HYPRE_Int, max_local_dof_counter, HYPRE_MEMORY_HOST); + i_global_to_local = hypre_CTAlloc(HYPRE_Int, num_variables + num_cols_offd, HYPRE_MEMORY_HOST); - for (i=0; i < num_variables+num_cols_offd; i++) + for (i = 0; i < num_variables + num_cols_offd; i++) + { i_global_to_local[i] = -1; + } piv_counter = 0; domain_matrixinverse_counter = 0; - for (i=0; i < num_domains; i++) + for (i = 0; i < num_domains; i++) { local_dof_counter = 0; - for (j=i_domain_dof[i]; j < i_domain_dof[i+1]; j++) + for (j = i_domain_dof[i]; j < i_domain_dof[i + 1]; j++) { i_global_to_local[j_domain_dof[j]] = local_dof_counter; i_local_to_global[local_dof_counter] = j_domain_dof[j]; @@ -3385,26 +3714,34 @@ hypre_ParAMGCreateDomainDof(hypre_ParCSRMatrix *A, ipiv = &piv[piv_counter]; cnt = 0; - for (i_loc=0; i_loc < local_dof_counter; i_loc++) - for (j_loc=0; j_loc < local_dof_counter; j_loc++) + for (i_loc = 0; i_loc < local_dof_counter; i_loc++) + { + for (j_loc = 0; j_loc < local_dof_counter; j_loc++) + { AE[cnt++] = 0.e0; + } + } - for (i_loc=0; i_loc < local_dof_counter; i_loc++) + for (i_loc = 0; i_loc < local_dof_counter; i_loc++) { i_dof = i_local_to_global[i_loc]; if (i_dof < num_variables) { - for (j=a_diag_i[i_dof]; j < a_diag_i[i_dof+1]; j++) + for (j = a_diag_i[i_dof]; j < a_diag_i[i_dof + 1]; j++) { j_loc = i_global_to_local[a_diag_j[j]]; - if (j_loc >=0) + if (j_loc >= 0) + { AE[i_loc + j_loc * local_dof_counter] = a_diag_data[j]; + } } - for (j=a_offd_i[i_dof]; j < a_offd_i[i_dof+1]; j++) + for (j = a_offd_i[i_dof]; j < a_offd_i[i_dof + 1]; j++) { - j_loc = i_global_to_local[a_offd_j[j]+num_variables]; - if (j_loc >=0) + j_loc = i_global_to_local[a_offd_j[j] + num_variables]; + if (j_loc >= 0) + { AE[i_loc + j_loc * local_dof_counter] = a_offd_data[j]; + } } } else @@ -3412,7 +3749,7 @@ hypre_ParAMGCreateDomainDof(hypre_ParCSRMatrix *A, HYPRE_BigInt jj; HYPRE_Int j2; i_dof -= num_variables; - for (j=a_ext_i[i_dof]; j < a_ext_i[i_dof+1]; j++) + for (j = a_ext_i[i_dof]; j < a_ext_i[i_dof + 1]; j++) { jj = a_ext_j[j]; if (jj > col_0 && jj < col_n) @@ -3421,14 +3758,16 @@ hypre_ParAMGCreateDomainDof(hypre_ParCSRMatrix *A, } else { - j2 = hypre_BigBinarySearch(col_map_offd,jj,num_cols_offd); - if (j2 > -1) j2 += num_variables; + j2 = hypre_BigBinarySearch(col_map_offd, jj, num_cols_offd); + if (j2 > -1) { j2 += num_variables; } } if (j2 > -1) { j_loc = i_global_to_local[j2]; - if (j_loc >=0) + if (j_loc >= 0) + { AE[i_loc + j_loc * local_dof_counter] = a_ext_data[j]; + } } } } @@ -3439,22 +3778,20 @@ hypre_ParAMGCreateDomainDof(hypre_ParCSRMatrix *A, hypre_dgetrf(&local_dof_counter, &local_dof_counter, AE, &local_dof_counter, ipiv, &ierr); - piv_counter +=local_dof_counter; + piv_counter += local_dof_counter; } - else { - hypre_dpotrf(&uplo,&local_dof_counter, AE, + hypre_dpotrf(&uplo, &local_dof_counter, AE, &local_dof_counter, &ierr); } - domain_matrixinverse_counter+=local_dof_counter*local_dof_counter; - + domain_matrixinverse_counter += local_dof_counter * local_dof_counter; - - for (l_loc=0; l_loc < local_dof_counter; l_loc++) + for (l_loc = 0; l_loc < local_dof_counter; l_loc++) + { i_global_to_local[i_local_to_global[l_loc]] = -1; - + } } hypre_TFree(i_local_to_global, HYPRE_MEMORY_HOST); @@ -3474,27 +3811,26 @@ hypre_ParAMGCreateDomainDof(hypre_ParCSRMatrix *A, } HYPRE_Int -hypre_ParGenerateScale(hypre_ParCSRMatrix *A, - hypre_CSRMatrix *domain_structure, - HYPRE_Real relaxation_weight, - HYPRE_Real **scale_pointer) +hypre_ParGenerateScale(hypre_ParCSRMatrix *A, + hypre_CSRMatrix *domain_structure, + HYPRE_Real relaxation_weight, + HYPRE_Real **scale_pointer) { - HYPRE_Int num_domains = hypre_CSRMatrixNumRows(domain_structure); - HYPRE_Int *i_domain_dof = hypre_CSRMatrixI(domain_structure); - HYPRE_Int *j_domain_dof = hypre_CSRMatrixJ(domain_structure); - HYPRE_Int i, j; - HYPRE_Real *scale; - HYPRE_Real *scale_ext; - HYPRE_Real *scale_int; + HYPRE_Int num_domains = hypre_CSRMatrixNumRows(domain_structure); + HYPRE_Int *i_domain_dof = hypre_CSRMatrixI(domain_structure); + HYPRE_Int *j_domain_dof = hypre_CSRMatrixJ(domain_structure); + HYPRE_Real *scale = NULL; + HYPRE_Real *scale_ext = NULL; + HYPRE_Real *scale_int = NULL; hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); - HYPRE_Int num_sends = 0; - HYPRE_Int *send_map_starts; - HYPRE_Int *send_map_elmts; + HYPRE_Int num_sends = 0; + HYPRE_Int *send_map_starts = NULL; + HYPRE_Int *send_map_elmts = NULL; - HYPRE_Int num_variables = hypre_ParCSRMatrixNumRows(A); - HYPRE_Int num_cols_offd = hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(A)); - HYPRE_Int j_loc, index, start; + HYPRE_Int num_variables = hypre_ParCSRMatrixNumRows(A); + HYPRE_Int num_cols_offd = hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(A)); + HYPRE_Int i, j, j_loc, index, start; hypre_ParCSRCommHandle *comm_handle; @@ -3505,42 +3841,51 @@ hypre_ParGenerateScale(hypre_ParCSRMatrix *A, send_map_elmts = hypre_ParCSRCommPkgSendMapElmts(comm_pkg); } - scale = hypre_CTAlloc(HYPRE_Real, num_variables, HYPRE_MEMORY_HOST); - if (num_cols_offd) scale_ext = hypre_CTAlloc(HYPRE_Real, num_cols_offd, HYPRE_MEMORY_HOST); + scale = hypre_CTAlloc(HYPRE_Real, num_variables, HYPRE_MEMORY_HOST); + scale_ext = hypre_CTAlloc(HYPRE_Real, num_cols_offd, HYPRE_MEMORY_HOST); - for (i=0; i < num_domains; i++) + for (i = 0; i < num_domains; i++) { - for (j=i_domain_dof[i]; j < i_domain_dof[i+1]; j++) + for (j = i_domain_dof[i]; j < i_domain_dof[i + 1]; j++) { j_loc = j_domain_dof[j]; if (j_loc < num_variables) + { scale[j_loc] += 1.0; + } else - scale_ext[j_loc-num_variables] += 1.0; + { + scale_ext[j_loc - num_variables] += 1.0; + } } } + if (comm_pkg) { - scale_int = hypre_CTAlloc(HYPRE_Real, send_map_starts[num_sends], HYPRE_MEMORY_HOST); - comm_handle = hypre_ParCSRCommHandleCreate (2,comm_pkg,scale_ext,scale_int); + scale_int = hypre_CTAlloc(HYPRE_Real, send_map_starts[num_sends], HYPRE_MEMORY_HOST); + comm_handle = hypre_ParCSRCommHandleCreate (2, comm_pkg, scale_ext, scale_int); hypre_ParCSRCommHandleDestroy(comm_handle); comm_handle = NULL; } index = 0; - for (i=0; i < num_sends; i++) + for (i = 0; i < num_sends; i++) { start = send_map_starts[i]; - for (j=start; j < send_map_starts[i+1]; j++) + for (j = start; j < send_map_starts[i + 1]; j++) + { scale[send_map_elmts[j]] += scale_int[index++]; + } } - if (comm_pkg) hypre_TFree(scale_int, HYPRE_MEMORY_HOST); - if (num_cols_offd) hypre_TFree(scale_ext, HYPRE_MEMORY_HOST); + hypre_TFree(scale_int, HYPRE_MEMORY_HOST); + hypre_TFree(scale_ext, HYPRE_MEMORY_HOST); - for (i=0; i < num_variables; i++) - scale[i] = relaxation_weight/scale[i]; + for (i = 0; i < num_variables; i++) + { + scale[i] = relaxation_weight / scale[i]; + } *scale_pointer = scale; @@ -3568,14 +3913,14 @@ hypre_ParGenerateHybridScale(hypre_ParCSRMatrix *A, HYPRE_Int *j_domain_dof = hypre_CSRMatrixJ(domain_structure); HYPRE_Int i, j, jj; HYPRE_Real *scale; - HYPRE_Real *scale_ext; - HYPRE_Real *scale_int; + HYPRE_Real *scale_ext = NULL; + HYPRE_Real *scale_int = NULL; hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); HYPRE_Int num_sends = 0; HYPRE_Int *send_map_starts; HYPRE_Int *send_map_elmts; - HYPRE_Int *index_ext; + HYPRE_Int *index_ext = NULL; HYPRE_Int num_variables = hypre_ParCSRMatrixNumRows(A); HYPRE_Int num_cols_offd = hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(A)); @@ -3585,8 +3930,8 @@ hypre_ParGenerateHybridScale(hypre_ParCSRMatrix *A, hypre_ParCSRCommHandle *comm_handle; - col_0 = hypre_ParCSRMatrixFirstColDiag(A)-1; - col_n = col_0+(HYPRE_Int)num_variables; + col_0 = hypre_ParCSRMatrixFirstColDiag(A) - 1; + col_n = col_0 + (HYPRE_Int)num_variables; A_boundary = NULL; @@ -3604,15 +3949,19 @@ hypre_ParGenerateHybridScale(hypre_ParCSRMatrix *A, index_ext = hypre_CTAlloc(HYPRE_Int, num_cols_offd, HYPRE_MEMORY_HOST); } - for (i=0; i < num_variables; i++) + for (i = 0; i < num_variables; i++) + { scale[i] = 1; + } - for (i=0; i < num_cols_offd; i++) + for (i = 0; i < num_cols_offd; i++) + { index_ext[i] = -1; + } - for (i=0; i < num_domains; i++) + for (i = 0; i < num_domains; i++) { - for (j=i_domain_dof[i]; j < i_domain_dof[i+1]; j++) + for (j = i_domain_dof[i]; j < i_domain_dof[i + 1]; j++) { j_loc = j_domain_dof[j]; if (j_loc >= num_variables) @@ -3626,39 +3975,41 @@ hypre_ParGenerateHybridScale(hypre_ParCSRMatrix *A, } } } + if (comm_pkg) { - scale_int = hypre_CTAlloc(HYPRE_Real, send_map_starts[num_sends], HYPRE_MEMORY_HOST); - comm_handle=hypre_ParCSRCommHandleCreate(2,comm_pkg,scale_ext,scale_int); + scale_int = hypre_CTAlloc(HYPRE_Real, send_map_starts[num_sends], HYPRE_MEMORY_HOST); + comm_handle = hypre_ParCSRCommHandleCreate(2, comm_pkg, scale_ext, scale_int); hypre_ParCSRCommHandleDestroy(comm_handle); comm_handle = NULL; - A_ext = hypre_ParCSRMatrixExtractBExt(A,A,1); + A_ext = hypre_ParCSRMatrixExtractBExt(A, A, 1); A_ext_i = hypre_CSRMatrixI(A_ext); - A_boundary_i = hypre_CTAlloc(HYPRE_Int, num_cols_offd+1, HYPRE_MEMORY_HOST); + A_boundary_i = hypre_CTAlloc(HYPRE_Int, num_cols_offd + 1, HYPRE_MEMORY_HOST); A_ext_j = hypre_CSRMatrixBigJ(A_ext); A_ext_data = hypre_CSRMatrixData(A_ext); + /* compress A_ext to contain only local data and necessary boundary points*/ index = 0; - for (i=0; i < num_cols_offd; i++) + for (i = 0; i < num_cols_offd; i++) { A_boundary_i[i] = index; - for (j = A_ext_i[i]; j < A_ext_i[i+1]; j++) + for (j = A_ext_i[i]; j < A_ext_i[i + 1]; j++) { HYPRE_BigInt j_col; j_col = A_ext_j[j]; if (j_col > col_0 && j_col < col_n) { - A_ext_j[j] = j_col-col_0; + A_ext_j[j] = j_col - col_0; index++; } else { - jj = hypre_BigBinarySearch(col_map_offd,j_col,num_cols_offd); + jj = hypre_BigBinarySearch(col_map_offd, j_col, num_cols_offd); if (jj > -1 && (scale_ext[jj] > 0)) { - A_ext_j[j] = num_variables+jj; + A_ext_j[j] = num_variables + jj; index++; } else @@ -3669,7 +4020,6 @@ hypre_ParGenerateHybridScale(hypre_ParCSRMatrix *A, } } A_boundary_i[num_cols_offd] = index; - A_boundary_j = NULL; A_boundary_data = NULL; @@ -3680,16 +4030,16 @@ hypre_ParGenerateHybridScale(hypre_ParCSRMatrix *A, } index = 0; - for (i=0; i < A_ext_i[num_cols_offd]; i++) + for (i = 0; i < A_ext_i[num_cols_offd]; i++) { if (A_ext_j[i] > -1) { - A_boundary_j[index] = (HYPRE_Int)A_ext_j[i]; + A_boundary_j[index] = (HYPRE_Int) A_ext_j[i]; A_boundary_data[index] = A_ext_data[i]; index++; } } - A_boundary = hypre_CSRMatrixCreate(num_cols_offd,num_variables, index); + A_boundary = hypre_CSRMatrixCreate(num_cols_offd, num_variables, index); hypre_CSRMatrixI(A_boundary) = A_boundary_i; hypre_CSRMatrixJ(A_boundary) = A_boundary_j; hypre_CSRMatrixData(A_boundary) = A_boundary_data; @@ -3697,26 +4047,26 @@ hypre_ParGenerateHybridScale(hypre_ParCSRMatrix *A, } index = 0; - for (i=0; i < num_sends; i++) + for (i = 0; i < num_sends; i++) { start = send_map_starts[i]; - for (j=start; j < send_map_starts[i+1]; j++) + for (j = start; j < send_map_starts[i + 1]; j++) + { scale[send_map_elmts[j]] += scale_int[index++]; + } } - if (comm_pkg) hypre_TFree(scale_int, HYPRE_MEMORY_HOST); - if (num_cols_offd) + hypre_TFree(scale_int, HYPRE_MEMORY_HOST); + hypre_TFree(scale_ext, HYPRE_MEMORY_HOST); + hypre_TFree(index_ext, HYPRE_MEMORY_HOST); + + for (i = 0; i < num_variables; i++) { - hypre_TFree(scale_ext, HYPRE_MEMORY_HOST); - hypre_TFree(index_ext, HYPRE_MEMORY_HOST); + scale[i] = 1.0 / scale[i]; } - for (i=0; i < num_variables; i++) - scale[i] = 1.0/scale[i]; - *scale_pointer = scale; *A_boundary_pointer = A_boundary; return hypre_error_flag; } - diff --git a/external/hypre/src/parcsr_ls/schwarz.h b/external/hypre/src/parcsr_ls/schwarz.h index 63a8c5b9..e7a751dd 100644 --- a/external/hypre/src/parcsr_ls/schwarz.h +++ b/external/hypre/src/parcsr_ls/schwarz.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -18,7 +18,7 @@ typedef struct HYPRE_Int domain_type; HYPRE_Int overlap; HYPRE_Int num_functions; - HYPRE_Int use_nonsymm; + HYPRE_Int use_nonsymm; HYPRE_Real relax_weight; hypre_CSRMatrix *domain_structure; @@ -27,8 +27,8 @@ typedef struct HYPRE_Real *scale; HYPRE_Int *dof_func; HYPRE_Int *pivots; - - + + } hypre_SchwarzData; diff --git a/external/hypre/src/parcsr_mv/CMakeLists.txt b/external/hypre/src/parcsr_mv/CMakeLists.txt index 6c40d366..68bfb287 100644 --- a/external/hypre/src/parcsr_mv/CMakeLists.txt +++ b/external/hypre/src/parcsr_mv/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -24,10 +24,16 @@ set(SRCS par_csr_bool_matop.c par_csr_bool_matrix.c par_csr_communication.c + par_csr_filter.c + par_csr_filter_device.c par_csr_matop.c par_csr_matrix.c + par_csr_matrix_stats.c + par_csr_matmat.c + par_csr_matmat_device.c par_csr_matop_marked.c par_csr_matvec.c + par_csr_matvec_device.c par_vector.c par_vector_batched.c par_make_system.c @@ -43,16 +49,18 @@ target_sources(${PROJECT_NAME} ${HDRS} ) -if (HYPRE_USING_CUDA) - set(CUDA_SRCS - par_csr_matvec.c +if (HYPRE_USING_GPU) + set(GPU_SRCS + par_csr_matmat_device.c + par_csr_matvec_device.c par_csr_fffc_device.c + par_csr_filter_device.c par_csr_matop_device.c par_csr_triplemat_device.c par_vector_device.c ) - convert_filenames_to_full_paths(CUDA_SRCS) - set(HYPRE_CUDA_SOURCES ${HYPRE_CUDA_SOURCES} ${CUDA_SRCS} PARENT_SCOPE) + convert_filenames_to_full_paths(GPU_SRCS) + set(HYPRE_GPU_SOURCES ${HYPRE_GPU_SOURCES} ${GPU_SRCS} PARENT_SCOPE) endif () convert_filenames_to_full_paths(HDRS) diff --git a/external/hypre/src/parcsr_mv/F90_HYPRE_parcsr_matrix.c b/external/hypre/src/parcsr_mv/F90_HYPRE_parcsr_matrix.c index c4cd01c1..5849ff6b 100644 --- a/external/hypre/src/parcsr_mv/F90_HYPRE_parcsr_matrix.c +++ b/external/hypre/src/parcsr_mv/F90_HYPRE_parcsr_matrix.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,49 +17,49 @@ #ifdef __cplusplus extern "C" { #endif - + /*-------------------------------------------------------------------------- * HYPRE_ParCSRMatrixCreate *--------------------------------------------------------------------------*/ - + void hypre_F90_IFACE(hypre_parcsrmatrixcreate, HYPRE_PARCSRMATRIXCREATE) - ( hypre_F90_Comm *comm, - hypre_F90_BigInt *global_num_rows, - hypre_F90_BigInt *global_num_cols, - hypre_F90_BigIntArray *row_starts, - hypre_F90_BigIntArray *col_starts, - hypre_F90_Int *num_cols_offd, - hypre_F90_Int *num_nonzeros_diag, - hypre_F90_Int *num_nonzeros_offd, - hypre_F90_Obj *matrix, - hypre_F90_Int *ierr ) +( hypre_F90_Comm *comm, + hypre_F90_BigInt *global_num_rows, + hypre_F90_BigInt *global_num_cols, + hypre_F90_BigIntArray *row_starts, + hypre_F90_BigIntArray *col_starts, + hypre_F90_Int *num_cols_offd, + hypre_F90_Int *num_nonzeros_diag, + hypre_F90_Int *num_nonzeros_offd, + hypre_F90_Obj *matrix, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRMatrixCreate( - hypre_F90_PassComm (comm), - hypre_F90_PassBigInt (global_num_rows), - hypre_F90_PassBigInt (global_num_cols), - hypre_F90_PassBigIntArray (row_starts), - hypre_F90_PassBigIntArray (col_starts), - hypre_F90_PassInt (num_cols_offd), - hypre_F90_PassInt (num_nonzeros_diag), - hypre_F90_PassInt (num_nonzeros_offd), - hypre_F90_PassObjRef (HYPRE_ParCSRMatrix, matrix) ) ); + ( HYPRE_ParCSRMatrixCreate( + hypre_F90_PassComm (comm), + hypre_F90_PassBigInt (global_num_rows), + hypre_F90_PassBigInt (global_num_cols), + hypre_F90_PassBigIntArray (row_starts), + hypre_F90_PassBigIntArray (col_starts), + hypre_F90_PassInt (num_cols_offd), + hypre_F90_PassInt (num_nonzeros_diag), + hypre_F90_PassInt (num_nonzeros_offd), + hypre_F90_PassObjRef (HYPRE_ParCSRMatrix, matrix) ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRMatrixDestroy *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_parcsrmatrixdestroy, HYPRE_PARCSRMATRIXDESTROY) - ( hypre_F90_Obj *matrix, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *matrix, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRMatrixDestroy( - hypre_F90_PassObj (HYPRE_ParCSRMatrix, matrix) ) ); + ( HYPRE_ParCSRMatrixDestroy( + hypre_F90_PassObj (HYPRE_ParCSRMatrix, matrix) ) ); } /*-------------------------------------------------------------------------- @@ -68,30 +68,30 @@ hypre_F90_IFACE(hypre_parcsrmatrixdestroy, HYPRE_PARCSRMATRIXDESTROY) void hypre_F90_IFACE(hypre_parcsrmatrixinitialize, HYPRE_PARCSRMATRIXINITIALIZE) - ( hypre_F90_Obj *matrix, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *matrix, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRMatrixInitialize( - hypre_F90_PassObj (HYPRE_ParCSRMatrix, matrix) ) ); + ( HYPRE_ParCSRMatrixInitialize( + hypre_F90_PassObj (HYPRE_ParCSRMatrix, matrix) ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRMatrixRead *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_parcsrmatrixread, HYPRE_PARCSRMATRIXREAD) - ( hypre_F90_Comm *comm, - char *file_name, - hypre_F90_Obj *matrix, - hypre_F90_Int *ierr ) +( hypre_F90_Comm *comm, + char *file_name, + hypre_F90_Obj *matrix, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRMatrixRead( - hypre_F90_PassComm (comm), - (char *) file_name, - hypre_F90_PassObjRef (HYPRE_ParCSRMatrix, matrix) ) ); + ( HYPRE_ParCSRMatrixRead( + hypre_F90_PassComm (comm), + (char *) file_name, + hypre_F90_PassObjRef (HYPRE_ParCSRMatrix, matrix) ) ); } @@ -101,10 +101,10 @@ hypre_F90_IFACE(hypre_parcsrmatrixread, HYPRE_PARCSRMATRIXREAD) void hypre_F90_IFACE(hypre_parcsrmatrixprint, HYPRE_PARCSRMATRIXPRINT) - ( hypre_F90_Obj *matrix, - char *fort_file_name, - hypre_F90_Int *fort_file_name_size, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *matrix, + char *fort_file_name, + hypre_F90_Int *fort_file_name_size, + hypre_F90_Int *ierr ) { HYPRE_Int i; char *c_file_name; @@ -117,9 +117,9 @@ hypre_F90_IFACE(hypre_parcsrmatrixprint, HYPRE_PARCSRMATRIXPRINT) } *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRMatrixPrint( - hypre_F90_PassObj (HYPRE_ParCSRMatrix, matrix), - (char *) c_file_name ) ); + ( HYPRE_ParCSRMatrixPrint( + hypre_F90_PassObj (HYPRE_ParCSRMatrix, matrix), + (char *) c_file_name ) ); hypre_TFree(c_file_name, HYPRE_MEMORY_HOST); @@ -129,51 +129,51 @@ hypre_F90_IFACE(hypre_parcsrmatrixprint, HYPRE_PARCSRMATRIXPRINT) * HYPRE_ParCSRMatrixGetComm *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_parcsrmatrixgetcomm, HYPRE_PARCSRMATRIXGETCOMM) - ( hypre_F90_Obj *matrix, - hypre_F90_Comm *comm, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *matrix, + hypre_F90_Comm *comm, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRMatrixGetComm( - hypre_F90_PassObj (HYPRE_ParCSRMatrix, matrix), - (MPI_Comm *) comm ) ); + ( HYPRE_ParCSRMatrixGetComm( + hypre_F90_PassObj (HYPRE_ParCSRMatrix, matrix), + (MPI_Comm *) comm ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRMatrixGetDims *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_parcsrmatrixgetdims, HYPRE_PARCSRMATRIXGETDIMS) - ( hypre_F90_Obj *matrix, - hypre_F90_BigInt *M, - hypre_F90_BigInt *N, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *matrix, + hypre_F90_BigInt *M, + hypre_F90_BigInt *N, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRMatrixGetDims( - hypre_F90_PassObj (HYPRE_ParCSRMatrix, matrix), - hypre_F90_PassBigIntRef (M), - hypre_F90_PassBigIntRef (N) ) ); + ( HYPRE_ParCSRMatrixGetDims( + hypre_F90_PassObj (HYPRE_ParCSRMatrix, matrix), + hypre_F90_PassBigIntRef (M), + hypre_F90_PassBigIntRef (N) ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRMatrixGetRowPartitioning *--------------------------------------------------------------------------*/ - + void hypre_F90_IFACE(hypre_parcsrmatrixgetrowpartiti, HYPRE_PARCSRMATRIXGETROWPARTITI) - ( hypre_F90_Obj *matrix, - hypre_F90_Obj *row_partitioning_ptr, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *matrix, + hypre_F90_Obj *row_partitioning_ptr, + hypre_F90_Int *ierr ) { HYPRE_Int *row_partitioning; *ierr = (hypre_F90_Int) HYPRE_ParCSRMatrixGetRowPartitioning( - hypre_F90_PassObj (HYPRE_ParCSRMatrix, matrix), - (HYPRE_BigInt **) &row_partitioning ); + hypre_F90_PassObj (HYPRE_ParCSRMatrix, matrix), + (HYPRE_BigInt **) &row_partitioning ); *row_partitioning_ptr = (hypre_F90_Obj) row_partitioning; } @@ -181,18 +181,18 @@ hypre_F90_IFACE(hypre_parcsrmatrixgetrowpartiti, HYPRE_PARCSRMATRIXGETROWPARTITI /*-------------------------------------------------------------------------- * HYPRE_ParCSRMatrixGetColPartitioning *--------------------------------------------------------------------------*/ - + void hypre_F90_IFACE(hypre_parcsrmatrixgetcolpartiti, HYPRE_PARCSRMATRIXGETCOLPARTITI) - ( hypre_F90_Obj *matrix, - hypre_F90_Obj *col_partitioning_ptr, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *matrix, + hypre_F90_Obj *col_partitioning_ptr, + hypre_F90_Int *ierr ) { HYPRE_Int *col_partitioning; *ierr = (hypre_F90_Int) HYPRE_ParCSRMatrixGetColPartitioning( - hypre_F90_PassObj (HYPRE_ParCSRMatrix, matrix), - (HYPRE_BigInt **) &col_partitioning ); + hypre_F90_PassObj (HYPRE_ParCSRMatrix, matrix), + (HYPRE_BigInt **) &col_partitioning ); *col_partitioning_ptr = (hypre_F90_Obj) col_partitioning; } @@ -201,46 +201,46 @@ hypre_F90_IFACE(hypre_parcsrmatrixgetcolpartiti, HYPRE_PARCSRMATRIXGETCOLPARTITI * HYPRE_ParCSRMatrixGetLocalRange *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_parcsrmatrixgetlocalrange, HYPRE_PARCSRMATRIXGETLOCALRANGE) - ( hypre_F90_Obj *matrix, - hypre_F90_BigInt *row_start, - hypre_F90_BigInt *row_end, - hypre_F90_BigInt *col_start, - hypre_F90_BigInt *col_end, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *matrix, + hypre_F90_BigInt *row_start, + hypre_F90_BigInt *row_end, + hypre_F90_BigInt *col_start, + hypre_F90_BigInt *col_end, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRMatrixGetLocalRange( - hypre_F90_PassObj (HYPRE_ParCSRMatrix, matrix), - hypre_F90_PassBigIntRef (row_start), - hypre_F90_PassBigIntRef (row_end), - hypre_F90_PassBigIntRef (col_start), - hypre_F90_PassBigIntRef (col_end)) ); + ( HYPRE_ParCSRMatrixGetLocalRange( + hypre_F90_PassObj (HYPRE_ParCSRMatrix, matrix), + hypre_F90_PassBigIntRef (row_start), + hypre_F90_PassBigIntRef (row_end), + hypre_F90_PassBigIntRef (col_start), + hypre_F90_PassBigIntRef (col_end)) ); } /*-------------------------------------------------------------------------- * HYPRE_ParCSRMatrixGetRow *--------------------------------------------------------------------------*/ - + void hypre_F90_IFACE(hypre_parcsrmatrixgetrow, HYPRE_PARCSRMATRIXGETROW) - ( hypre_F90_Obj *matrix, - hypre_F90_BigInt *row, - hypre_F90_Int *size, - hypre_F90_Obj *col_ind_ptr, - hypre_F90_Obj *values_ptr, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *matrix, + hypre_F90_BigInt *row, + hypre_F90_Int *size, + hypre_F90_Obj *col_ind_ptr, + hypre_F90_Obj *values_ptr, + hypre_F90_Int *ierr ) { HYPRE_Int *col_ind; HYPRE_Complex *values; *ierr = (hypre_F90_Int) HYPRE_ParCSRMatrixGetRow( - hypre_F90_PassObj (HYPRE_ParCSRMatrix, matrix), - hypre_F90_PassBigInt (row), - hypre_F90_PassIntRef (size), - (HYPRE_BigInt **) &col_ind, - (HYPRE_Complex **) &values ); + hypre_F90_PassObj (HYPRE_ParCSRMatrix, matrix), + hypre_F90_PassBigInt (row), + hypre_F90_PassIntRef (size), + (HYPRE_BigInt **) &col_ind, + (HYPRE_Complex **) &values ); *col_ind_ptr = (hypre_F90_Obj) col_ind; *values_ptr = (hypre_F90_Obj) values; @@ -252,22 +252,22 @@ hypre_F90_IFACE(hypre_parcsrmatrixgetrow, HYPRE_PARCSRMATRIXGETROW) void hypre_F90_IFACE(hypre_parcsrmatrixrestorerow, HYPRE_PARCSRMATRIXRESTOREROW) - ( hypre_F90_Obj *matrix, - hypre_F90_BigInt *row, - hypre_F90_Int *size, - hypre_F90_Obj *col_ind_ptr, - hypre_F90_Obj *values_ptr, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *matrix, + hypre_F90_BigInt *row, + hypre_F90_Int *size, + hypre_F90_Obj *col_ind_ptr, + hypre_F90_Obj *values_ptr, + hypre_F90_Int *ierr ) { - HYPRE_Int *col_ind; + HYPRE_Int *col_ind; HYPRE_Complex *values; *ierr = (hypre_F90_Int) HYPRE_ParCSRMatrixRestoreRow( - hypre_F90_PassObj (HYPRE_ParCSRMatrix, matrix), - hypre_F90_PassBigInt (row), - hypre_F90_PassIntRef (size), - (HYPRE_BigInt **) &col_ind, - (HYPRE_Complex **) &values ); + hypre_F90_PassObj (HYPRE_ParCSRMatrix, matrix), + hypre_F90_PassBigInt (row), + hypre_F90_PassIntRef (size), + (HYPRE_BigInt **) &col_ind, + (HYPRE_Complex **) &values ); *col_ind_ptr = (hypre_F90_Obj) col_ind; *values_ptr = (hypre_F90_Obj) values; @@ -279,21 +279,21 @@ hypre_F90_IFACE(hypre_parcsrmatrixrestorerow, HYPRE_PARCSRMATRIXRESTOREROW) void hypre_F90_IFACE(hypre_csrmatrixtoparcsrmatrix, HYPRE_CSRMATRIXTOPARCSRMATRIX) - (hypre_F90_Comm *comm, - hypre_F90_Obj *A_CSR, - hypre_F90_BigIntArray *row_partitioning, - hypre_F90_BigIntArray *col_partitioning, - hypre_F90_Obj *matrix, - hypre_F90_Int *ierr ) +(hypre_F90_Comm *comm, + hypre_F90_Obj *A_CSR, + hypre_F90_BigIntArray *row_partitioning, + hypre_F90_BigIntArray *col_partitioning, + hypre_F90_Obj *matrix, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_CSRMatrixToParCSRMatrix( - hypre_F90_PassComm (comm), - hypre_F90_PassObj (HYPRE_CSRMatrix, A_CSR), - hypre_F90_PassBigIntArray (row_partitioning), - hypre_F90_PassBigIntArray (col_partitioning), - hypre_F90_PassObjRef (HYPRE_ParCSRMatrix, matrix) ) ); + ( HYPRE_CSRMatrixToParCSRMatrix( + hypre_F90_PassComm (comm), + hypre_F90_PassObj (HYPRE_CSRMatrix, A_CSR), + hypre_F90_PassBigIntArray (row_partitioning), + hypre_F90_PassBigIntArray (col_partitioning), + hypre_F90_PassObjRef (HYPRE_ParCSRMatrix, matrix) ) ); } /*-------------------------------------------------------------------------- @@ -301,18 +301,19 @@ hypre_F90_IFACE(hypre_csrmatrixtoparcsrmatrix, HYPRE_CSRMATRIXTOPARCSRMATRIX) *--------------------------------------------------------------------------*/ void -hypre_F90_IFACE(hypre_csrmatrixtoparcsrmatrix_withnewpartitioning, HYPRE_CSRMATRIXTOPARCSRMATRIX_WITHNEWPARTITIONING) - (hypre_F90_Comm *comm, - hypre_F90_Obj *A_CSR, - hypre_F90_Obj *matrix, - hypre_F90_Int *ierr ) +hypre_F90_IFACE(hypre_csrmatrixtoparcsrmatrix_withnewpartitioning, + HYPRE_CSRMATRIXTOPARCSRMATRIX_WITHNEWPARTITIONING) +(hypre_F90_Comm *comm, + hypre_F90_Obj *A_CSR, + hypre_F90_Obj *matrix, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_CSRMatrixToParCSRMatrix_WithNewPartitioning( - hypre_F90_PassComm (comm), - hypre_F90_PassObj (HYPRE_CSRMatrix, A_CSR), - hypre_F90_PassObjRef (HYPRE_ParCSRMatrix, matrix) ) ); + ( HYPRE_CSRMatrixToParCSRMatrix_WithNewPartitioning( + hypre_F90_PassComm (comm), + hypre_F90_PassObj (HYPRE_CSRMatrix, A_CSR), + hypre_F90_PassObjRef (HYPRE_ParCSRMatrix, matrix) ) ); } /*-------------------------------------------------------------------------- @@ -321,21 +322,21 @@ hypre_F90_IFACE(hypre_csrmatrixtoparcsrmatrix_withnewpartitioning, HYPRE_CSRMATR void hypre_F90_IFACE(hypre_parcsrmatrixmatvec, HYPRE_PARCSRMATRIXMATVEC) - ( hypre_F90_Complex *alpha, - hypre_F90_Obj *A, - hypre_F90_Obj *x, - hypre_F90_Complex *beta, - hypre_F90_Obj *y, - hypre_F90_Int *ierr ) +( hypre_F90_Complex *alpha, + hypre_F90_Obj *A, + hypre_F90_Obj *x, + hypre_F90_Complex *beta, + hypre_F90_Obj *y, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRMatrixMatvec( - hypre_F90_PassComplex (alpha), - hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), - hypre_F90_PassObj (HYPRE_ParVector, x), - hypre_F90_PassComplex (beta), - hypre_F90_PassObj (HYPRE_ParVector, y) ) ); + ( HYPRE_ParCSRMatrixMatvec( + hypre_F90_PassComplex (alpha), + hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), + hypre_F90_PassObj (HYPRE_ParVector, x), + hypre_F90_PassComplex (beta), + hypre_F90_PassObj (HYPRE_ParVector, y) ) ); } /*-------------------------------------------------------------------------- @@ -344,23 +345,23 @@ hypre_F90_IFACE(hypre_parcsrmatrixmatvec, HYPRE_PARCSRMATRIXMATVEC) void hypre_F90_IFACE(hypre_parcsrmatrixmatvect, HYPRE_PARCSRMATRIXMATVECT) - ( hypre_F90_Complex *alpha, - hypre_F90_Obj *A, - hypre_F90_Obj *x, - hypre_F90_Complex *beta, - hypre_F90_Obj *y, - hypre_F90_Int *ierr ) +( hypre_F90_Complex *alpha, + hypre_F90_Obj *A, + hypre_F90_Obj *x, + hypre_F90_Complex *beta, + hypre_F90_Obj *y, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParCSRMatrixMatvecT( - hypre_F90_PassComplex (alpha), - hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), - hypre_F90_PassObj (HYPRE_ParVector, x), - hypre_F90_PassComplex (beta), - hypre_F90_PassObj (HYPRE_ParVector, y) ) ); + ( HYPRE_ParCSRMatrixMatvecT( + hypre_F90_PassComplex (alpha), + hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), + hypre_F90_PassObj (HYPRE_ParVector, x), + hypre_F90_PassComplex (beta), + hypre_F90_PassObj (HYPRE_ParVector, y) ) ); } - + #ifdef __cplusplus } #endif diff --git a/external/hypre/src/parcsr_mv/F90_HYPRE_parcsr_vector.c b/external/hypre/src/parcsr_mv/F90_HYPRE_parcsr_vector.c index 8ceaf63a..2bbc952b 100644 --- a/external/hypre/src/parcsr_mv/F90_HYPRE_parcsr_vector.c +++ b/external/hypre/src/parcsr_mv/F90_HYPRE_parcsr_vector.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,24 +17,24 @@ #ifdef __cplusplus extern "C" { #endif - + /*-------------------------------------------------------------------------- * HYPRE_ParVectorCreate *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_parvectorcreate, HYPRE_PARVECTORCREATE) - ( hypre_F90_Comm *comm, - hypre_F90_BigInt *global_size, - hypre_F90_BigIntArray *partitioning, - hypre_F90_Obj *vector, - hypre_F90_Int *ierr ) +( hypre_F90_Comm *comm, + hypre_F90_BigInt *global_size, + hypre_F90_BigIntArray *partitioning, + hypre_F90_Obj *vector, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) HYPRE_ParVectorCreate( - hypre_F90_PassComm (comm), - hypre_F90_PassBigInt (global_size), - hypre_F90_PassBigIntArray (partitioning), - hypre_F90_PassObjRef (HYPRE_ParVector, vector) ); + hypre_F90_PassComm (comm), + hypre_F90_PassBigInt (global_size), + hypre_F90_PassBigIntArray (partitioning), + hypre_F90_PassObjRef (HYPRE_ParVector, vector) ); } @@ -44,19 +44,19 @@ hypre_F90_IFACE(hypre_parvectorcreate, HYPRE_PARVECTORCREATE) void hypre_F90_IFACE(hypre_parmultivectorcreate, HYPRE_PARMULTIVECTORCREATE) - ( hypre_F90_Comm *comm, - hypre_F90_BigInt *global_size, - hypre_F90_BigIntArray *partitioning, - hypre_F90_Int *number_vectors, - hypre_F90_Obj *vector, - hypre_F90_Int *ierr ) +( hypre_F90_Comm *comm, + hypre_F90_BigInt *global_size, + hypre_F90_BigIntArray *partitioning, + hypre_F90_Int *number_vectors, + hypre_F90_Obj *vector, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) HYPRE_ParMultiVectorCreate( - hypre_F90_PassComm (comm), - hypre_F90_PassBigInt (global_size), - hypre_F90_PassBigIntArray (partitioning), - hypre_F90_PassInt (number_vectors), - hypre_F90_PassObjRef (HYPRE_ParVector, vector) ); + hypre_F90_PassComm (comm), + hypre_F90_PassBigInt (global_size), + hypre_F90_PassBigIntArray (partitioning), + hypre_F90_PassInt (number_vectors), + hypre_F90_PassObjRef (HYPRE_ParVector, vector) ); } @@ -64,14 +64,14 @@ hypre_F90_IFACE(hypre_parmultivectorcreate, HYPRE_PARMULTIVECTORCREATE) * HYPRE_ParVectorDestroy *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_parvectordestroy, HYPRE_PARVECTORDESTROY) - ( hypre_F90_Obj *vector, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *vector, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParVectorDestroy( - hypre_F90_PassObj (HYPRE_ParVector, vector) ) ); + ( HYPRE_ParVectorDestroy( + hypre_F90_PassObj (HYPRE_ParVector, vector) ) ); } /*-------------------------------------------------------------------------- @@ -80,30 +80,30 @@ hypre_F90_IFACE(hypre_parvectordestroy, HYPRE_PARVECTORDESTROY) void hypre_F90_IFACE(hypre_parvectorinitialize, HYPRE_PARVECTORINITIALIZE) - ( hypre_F90_Obj *vector, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *vector, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParVectorInitialize( - hypre_F90_PassObj (HYPRE_ParVector, vector) ) ); + ( HYPRE_ParVectorInitialize( + hypre_F90_PassObj (HYPRE_ParVector, vector) ) ); } /*-------------------------------------------------------------------------- * HYPRE_ParVectorRead *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_parvectorread, HYPRE_PARVECTORREAD) - ( hypre_F90_Comm *comm, - hypre_F90_Obj *vector, - char *file_name, - hypre_F90_Int *ierr ) +( hypre_F90_Comm *comm, + hypre_F90_Obj *vector, + char *file_name, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParVectorRead( - hypre_F90_PassComm (comm), - (char *) file_name, - hypre_F90_PassObjRef (HYPRE_ParVector, vector) ) ); + ( HYPRE_ParVectorRead( + hypre_F90_PassComm (comm), + (char *) file_name, + hypre_F90_PassObjRef (HYPRE_ParVector, vector) ) ); } @@ -113,10 +113,10 @@ hypre_F90_IFACE(hypre_parvectorread, HYPRE_PARVECTORREAD) void hypre_F90_IFACE(hypre_parvectorprint, HYPRE_PARVECTORPRINT) - ( hypre_F90_Obj *vector, - char *fort_file_name, - hypre_F90_Int *fort_file_name_size, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *vector, + char *fort_file_name, + hypre_F90_Int *fort_file_name_size, + hypre_F90_Int *ierr ) { HYPRE_Int i; char *c_file_name; @@ -129,9 +129,9 @@ hypre_F90_IFACE(hypre_parvectorprint, HYPRE_PARVECTORPRINT) } *ierr = (hypre_F90_Int) - ( HYPRE_ParVectorPrint( - hypre_F90_PassObj (HYPRE_ParVector, vector), - (char *) c_file_name ) ); + ( HYPRE_ParVectorPrint( + hypre_F90_PassObj (HYPRE_ParVector, vector), + (char *) c_file_name ) ); hypre_TFree(c_file_name, HYPRE_MEMORY_HOST); @@ -143,14 +143,14 @@ hypre_F90_IFACE(hypre_parvectorprint, HYPRE_PARVECTORPRINT) void hypre_F90_IFACE(hypre_parvectorsetconstantvalue, HYPRE_PARVECTORSETCONSTANTVALUE) - ( hypre_F90_Obj *vector, - hypre_F90_Complex *value, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *vector, + hypre_F90_Complex *value, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParVectorSetConstantValues( - hypre_F90_PassObj (HYPRE_ParVector, vector), - hypre_F90_PassComplex (value)) ); + ( HYPRE_ParVectorSetConstantValues( + hypre_F90_PassObj (HYPRE_ParVector, vector), + hypre_F90_PassComplex (value)) ); } /*-------------------------------------------------------------------------- @@ -159,14 +159,14 @@ hypre_F90_IFACE(hypre_parvectorsetconstantvalue, HYPRE_PARVECTORSETCONSTANTVALUE void hypre_F90_IFACE(hypre_parvectorsetrandomvalues, HYPRE_PARVECTORSETRANDOMVALUES) - ( hypre_F90_Obj *vector, - hypre_F90_Int *seed, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *vector, + hypre_F90_Int *seed, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParVectorSetRandomValues( - hypre_F90_PassObj (HYPRE_ParVector, vector), - hypre_F90_PassInt (seed)) ); + ( HYPRE_ParVectorSetRandomValues( + hypre_F90_PassObj (HYPRE_ParVector, vector), + hypre_F90_PassInt (seed)) ); } /*-------------------------------------------------------------------------- @@ -175,14 +175,14 @@ hypre_F90_IFACE(hypre_parvectorsetrandomvalues, HYPRE_PARVECTORSETRANDOMVALUES) void hypre_F90_IFACE(hypre_parvectorcopy, HYPRE_PARVECTORCOPY) - ( hypre_F90_Obj *x, - hypre_F90_Obj *y, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *x, + hypre_F90_Obj *y, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParVectorCopy( - hypre_F90_PassObj (HYPRE_ParVector, x), - hypre_F90_PassObj (HYPRE_ParVector, y)) ); + ( HYPRE_ParVectorCopy( + hypre_F90_PassObj (HYPRE_ParVector, x), + hypre_F90_PassObj (HYPRE_ParVector, y)) ); } /*-------------------------------------------------------------------------- @@ -191,13 +191,13 @@ hypre_F90_IFACE(hypre_parvectorcopy, HYPRE_PARVECTORCOPY) void hypre_F90_IFACE(hypre_parvectorcloneshallow, HYPRE_PARVECTORCLONESHALLOW) - ( hypre_F90_Obj *x, - hypre_F90_Obj *xclone, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *x, + hypre_F90_Obj *xclone, + hypre_F90_Int *ierr ) { *xclone = (hypre_F90_Obj) - ( HYPRE_ParVectorCloneShallow( - hypre_F90_PassObj (HYPRE_ParVector, x) ) ); + ( HYPRE_ParVectorCloneShallow( + hypre_F90_PassObj (HYPRE_ParVector, x) ) ); *ierr = 0; } @@ -207,14 +207,14 @@ hypre_F90_IFACE(hypre_parvectorcloneshallow, HYPRE_PARVECTORCLONESHALLOW) void hypre_F90_IFACE(hypre_parvectorscale, HYPRE_PARVECTORSCALE) - ( hypre_F90_Complex *value, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Complex *value, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParVectorScale( - hypre_F90_PassComplex (value), - hypre_F90_PassObj (HYPRE_ParVector, x) ) ); + ( HYPRE_ParVectorScale( + hypre_F90_PassComplex (value), + hypre_F90_PassObj (HYPRE_ParVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -223,16 +223,16 @@ hypre_F90_IFACE(hypre_parvectorscale, HYPRE_PARVECTORSCALE) void hypre_F90_IFACE(hypre_parvectoraxpy, HYPRE_PARVECTORAXPY) - ( hypre_F90_Complex *value, - hypre_F90_Obj *x, - hypre_F90_Obj *y, - hypre_F90_Int *ierr ) +( hypre_F90_Complex *value, + hypre_F90_Obj *x, + hypre_F90_Obj *y, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParVectorAxpy( - hypre_F90_PassComplex (value), - hypre_F90_PassObj (HYPRE_ParVector, x), - hypre_F90_PassObj (HYPRE_ParVector, y) ) ); + ( HYPRE_ParVectorAxpy( + hypre_F90_PassComplex (value), + hypre_F90_PassObj (HYPRE_ParVector, x), + hypre_F90_PassObj (HYPRE_ParVector, y) ) ); } /*-------------------------------------------------------------------------- @@ -241,18 +241,18 @@ hypre_F90_IFACE(hypre_parvectoraxpy, HYPRE_PARVECTORAXPY) void hypre_F90_IFACE(hypre_parvectorinnerprod, HYPRE_PARVECTORINNERPROD) - (hypre_F90_Obj *x, - hypre_F90_Obj *y, - hypre_F90_Complex *prod, - hypre_F90_Int *ierr ) +(hypre_F90_Obj *x, + hypre_F90_Obj *y, + hypre_F90_Complex *prod, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_ParVectorInnerProd( - hypre_F90_PassObj (HYPRE_ParVector, x), - hypre_F90_PassObj (HYPRE_ParVector, y), - hypre_F90_PassRealRef (prod) ) ); + ( HYPRE_ParVectorInnerProd( + hypre_F90_PassObj (HYPRE_ParVector, x), + hypre_F90_PassObj (HYPRE_ParVector, y), + hypre_F90_PassRealRef (prod) ) ); } - + #ifdef __cplusplus } #endif diff --git a/external/hypre/src/parcsr_mv/F90_par_vector.c b/external/hypre/src/parcsr_mv/F90_par_vector.c index 15b9d714..bb8f2c5b 100644 --- a/external/hypre/src/parcsr_mv/F90_par_vector.c +++ b/external/hypre/src/parcsr_mv/F90_par_vector.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -24,14 +24,14 @@ extern "C" { void hypre_F90_IFACE(hypre_setparvectordataowner, HYPRE_SETPARVECTORDATAOWNER) - ( hypre_F90_Obj *vector, - hypre_F90_Int *owns_data, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *vector, + hypre_F90_Int *owns_data, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( hypre_ParVectorSetDataOwner( - (hypre_ParVector *) *vector, - hypre_F90_PassInt (owns_data) ) ); + ( hypre_ParVectorSetDataOwner( + (hypre_ParVector *) *vector, + hypre_F90_PassInt (owns_data) ) ); } /*-------------------------------------------------------------------------- @@ -40,14 +40,14 @@ hypre_F90_IFACE(hypre_setparvectordataowner, HYPRE_SETPARVECTORDATAOWNER) void hypre_F90_IFACE(hypre_setparvectorconstantvalue, HYPRE_SETPARVECTORCONSTANTVALUE) - ( hypre_F90_Obj *vector, - hypre_F90_Complex *value, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *vector, + hypre_F90_Complex *value, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( hypre_ParVectorSetConstantValues( - (hypre_ParVector *) *vector, - hypre_F90_PassComplex (value) ) ); + ( hypre_ParVectorSetConstantValues( + (hypre_ParVector *) *vector, + hypre_F90_PassComplex (value) ) ); } /*-------------------------------------------------------------------------- @@ -56,14 +56,14 @@ hypre_F90_IFACE(hypre_setparvectorconstantvalue, HYPRE_SETPARVECTORCONSTANTVALUE void hypre_F90_IFACE(hypre_setparvectorrandomvalues, HYPRE_SETPARVECTORRANDOMVALUES) - ( hypre_F90_Obj *vector, - hypre_F90_Int *seed, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *vector, + hypre_F90_Int *seed, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( hypre_ParVectorSetRandomValues( - (hypre_ParVector *) *vector, - hypre_F90_PassInt (seed) ) ); + ( hypre_ParVectorSetRandomValues( + (hypre_ParVector *) *vector, + hypre_F90_PassInt (seed) ) ); } /*-------------------------------------------------------------------------- @@ -72,14 +72,14 @@ hypre_F90_IFACE(hypre_setparvectorrandomvalues, HYPRE_SETPARVECTORRANDOMVALUES) void hypre_F90_IFACE(hypre_copyparvector, HYPRE_COPYPARVECTOR) - ( hypre_F90_Obj *x, - hypre_F90_Obj *y, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *x, + hypre_F90_Obj *y, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( hypre_ParVectorCopy( - (hypre_ParVector *) *x, - (hypre_ParVector *) *y ) ); + ( hypre_ParVectorCopy( + (hypre_ParVector *) *x, + (hypre_ParVector *) *y ) ); } /*-------------------------------------------------------------------------- @@ -88,14 +88,14 @@ hypre_F90_IFACE(hypre_copyparvector, HYPRE_COPYPARVECTOR) void hypre_F90_IFACE(hypre_scaleparvector, HYPRE_SCALEPARVECTOR) - ( hypre_F90_Obj *vector, - hypre_F90_Complex *scale, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *vector, + hypre_F90_Complex *scale, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( hypre_ParVectorScale( - hypre_F90_PassComplex (scale), - (hypre_ParVector *) *vector ) ); + ( hypre_ParVectorScale( + hypre_F90_PassComplex (scale), + (hypre_ParVector *) *vector ) ); } /*-------------------------------------------------------------------------- @@ -104,16 +104,16 @@ hypre_F90_IFACE(hypre_scaleparvector, HYPRE_SCALEPARVECTOR) void hypre_F90_IFACE(hypre_paraxpy, HYPRE_PARAXPY) - ( hypre_F90_Complex *a, - hypre_F90_Obj *x, - hypre_F90_Obj *y, - hypre_F90_Int *ierr ) +( hypre_F90_Complex *a, + hypre_F90_Obj *x, + hypre_F90_Obj *y, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( hypre_ParVectorAxpy( - hypre_F90_PassComplex (a), - (hypre_ParVector *) *x, - (hypre_ParVector *) *y ) ); + ( hypre_ParVectorAxpy( + hypre_F90_PassComplex (a), + (hypre_ParVector *) *x, + (hypre_ParVector *) *y ) ); } /*-------------------------------------------------------------------------- @@ -122,15 +122,15 @@ hypre_F90_IFACE(hypre_paraxpy, HYPRE_PARAXPY) void hypre_F90_IFACE(hypre_parinnerprod, HYPRE_PARINNERPROD) - ( hypre_F90_Obj *x, - hypre_F90_Obj *y, - hypre_F90_Complex *inner_prod, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *x, + hypre_F90_Obj *y, + hypre_F90_Complex *inner_prod, + hypre_F90_Int *ierr ) { *inner_prod = (hypre_F90_Complex) - ( hypre_ParVectorInnerProd( - (hypre_ParVector *) *x, - (hypre_ParVector *) *y ) ); + ( hypre_ParVectorInnerProd( + (hypre_ParVector *) *x, + (hypre_ParVector *) *y ) ); *ierr = 0; } @@ -141,17 +141,17 @@ hypre_F90_IFACE(hypre_parinnerprod, HYPRE_PARINNERPROD) void hypre_F90_IFACE(hypre_vectortoparvector, HYPRE_VECTORTOPARVECTOR) - ( hypre_F90_Comm *comm, - hypre_F90_Obj *vector, - hypre_F90_BigIntArray *vec_starts, - hypre_F90_Obj *par_vector, - hypre_F90_Int *ierr ) +( hypre_F90_Comm *comm, + hypre_F90_Obj *vector, + hypre_F90_BigIntArray *vec_starts, + hypre_F90_Obj *par_vector, + hypre_F90_Int *ierr ) { *par_vector = (hypre_F90_Obj) - ( hypre_VectorToParVector( - hypre_F90_PassComm (comm), - (hypre_Vector *) *vector, - hypre_F90_PassBigIntArray (vec_starts) ) ); + ( hypre_VectorToParVector( + hypre_F90_PassComm (comm), + (hypre_Vector *) *vector, + hypre_F90_PassBigIntArray (vec_starts) ) ); *ierr = 0; } @@ -162,13 +162,13 @@ hypre_F90_IFACE(hypre_vectortoparvector, HYPRE_VECTORTOPARVECTOR) void hypre_F90_IFACE(hypre_parvectortovectorall, HYPRE_PARVECTORTOVECTORALL) - ( hypre_F90_Obj *par_vector, - hypre_F90_Obj *vector, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *par_vector, + hypre_F90_Obj *vector, + hypre_F90_Int *ierr ) { *vector = (hypre_F90_Obj)( - hypre_ParVectorToVectorAll - ( (hypre_ParVector *) *par_vector ) ); + hypre_ParVectorToVectorAll + ( (hypre_ParVector *) *par_vector )); *ierr = 0; } diff --git a/external/hypre/src/parcsr_mv/F90_parcsr_matrix.c b/external/hypre/src/parcsr_mv/F90_parcsr_matrix.c index fd55c806..b446c5b5 100644 --- a/external/hypre/src/parcsr_mv/F90_parcsr_matrix.c +++ b/external/hypre/src/parcsr_mv/F90_parcsr_matrix.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,20 +17,20 @@ #ifdef __cplusplus extern "C" { #endif - + /*-------------------------------------------------------------------------- * hypre_ParCSRMatrixGlobalNumRows *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_parcsrmatrixglobalnumrows, HYPRE_PARCSRMATRIXGLOBALNUMROWS) - ( hypre_F90_Obj *matrix, - hypre_F90_BigInt *num_rows, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *matrix, + hypre_F90_BigInt *num_rows, + hypre_F90_Int *ierr ) { *num_rows = (hypre_F90_BigInt) - ( hypre_ParCSRMatrixGlobalNumRows( - (hypre_ParCSRMatrix *) *matrix ) ); + ( hypre_ParCSRMatrixGlobalNumRows( + (hypre_ParCSRMatrix *) *matrix ) ); *ierr = 0; } @@ -39,15 +39,15 @@ hypre_F90_IFACE(hypre_parcsrmatrixglobalnumrows, HYPRE_PARCSRMATRIXGLOBALNUMROWS * hypre_ParCSRMatrixRowStarts *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_parcsrmatrixrowstarts, HYPRE_PARCSRMATRIXROWSTARTS) - ( hypre_F90_Obj *matrix, - hypre_F90_Obj *row_starts, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *matrix, + hypre_F90_Obj *row_starts, + hypre_F90_Int *ierr ) { *row_starts = (hypre_F90_Obj) - ( hypre_ParCSRMatrixRowStarts( - (hypre_ParCSRMatrix *) *matrix ) ); + ( hypre_ParCSRMatrixRowStarts( + (hypre_ParCSRMatrix *) *matrix ) ); *ierr = 0; } diff --git a/external/hypre/src/parcsr_mv/HYPRE_parcsr_matrix.c b/external/hypre/src/parcsr_mv/HYPRE_parcsr_matrix.c index 5805b864..1595425d 100644 --- a/external/hypre/src/parcsr_mv/HYPRE_parcsr_matrix.c +++ b/external/hypre/src/parcsr_mv/HYPRE_parcsr_matrix.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -35,9 +35,9 @@ HYPRE_ParCSRMatrixCreate( MPI_Comm comm, } *matrix = (HYPRE_ParCSRMatrix) - hypre_ParCSRMatrixCreate(comm, global_num_rows, global_num_cols, - row_starts, col_starts, num_cols_offd, - num_nonzeros_diag, num_nonzeros_offd); + hypre_ParCSRMatrixCreate(comm, global_num_rows, global_num_cols, + row_starts, col_starts, num_cols_offd, + num_nonzeros_diag, num_nonzeros_offd); return hypre_error_flag; } @@ -49,7 +49,7 @@ HYPRE_ParCSRMatrixCreate( MPI_Comm comm, HYPRE_Int HYPRE_ParCSRMatrixDestroy( HYPRE_ParCSRMatrix matrix ) { - return( hypre_ParCSRMatrixDestroy( (hypre_ParCSRMatrix *) matrix ) ); + return ( hypre_ParCSRMatrixDestroy( (hypre_ParCSRMatrix *) matrix ) ); } /*-------------------------------------------------------------------------- @@ -150,10 +150,12 @@ HYPRE_ParCSRMatrixGetRowPartitioning( HYPRE_ParCSRMatrix matrix, hypre_MPI_Comm_size(hypre_ParCSRMatrixComm((hypre_ParCSRMatrix *) matrix), &num_procs); row_starts = hypre_ParCSRMatrixRowStarts((hypre_ParCSRMatrix *) matrix); - if (!row_starts) return -1; - row_partitioning = hypre_CTAlloc(HYPRE_BigInt, num_procs+1, HYPRE_MEMORY_HOST); - for (i=0; i < num_procs + 1; i++) + if (!row_starts) { return -1; } + row_partitioning = hypre_CTAlloc(HYPRE_BigInt, num_procs + 1, HYPRE_MEMORY_HOST); + for (i = 0; i < num_procs + 1; i++) + { row_partitioning[i] = row_starts[i]; + } *row_partitioning_ptr = row_partitioning; return hypre_error_flag; @@ -186,7 +188,7 @@ HYPRE_ParCSRMatrixGetGlobalRowPartitioning( HYPRE_ParCSRMatrix matrix, hypre_MPI_Comm_size(comm, &num_procs); if (my_id == 0 || all_procs) { - row_partitioning = hypre_CTAlloc(HYPRE_BigInt, num_procs+1, HYPRE_MEMORY_HOST); + row_partitioning = hypre_CTAlloc(HYPRE_BigInt, num_procs + 1, HYPRE_MEMORY_HOST); } row_start = hypre_ParCSRMatrixFirstRowIndex((hypre_ParCSRMatrix *) matrix); @@ -231,10 +233,12 @@ HYPRE_ParCSRMatrixGetColPartitioning( HYPRE_ParCSRMatrix matrix, hypre_MPI_Comm_size(hypre_ParCSRMatrixComm((hypre_ParCSRMatrix *) matrix), &num_procs); col_starts = hypre_ParCSRMatrixColStarts((hypre_ParCSRMatrix *) matrix); - if (!col_starts) return -1; - col_partitioning = hypre_CTAlloc(HYPRE_BigInt, num_procs+1, HYPRE_MEMORY_HOST); - for (i=0; i < num_procs + 1; i++) + if (!col_starts) { return -1; } + col_partitioning = hypre_CTAlloc(HYPRE_BigInt, num_procs + 1, HYPRE_MEMORY_HOST); + for (i = 0; i < num_procs + 1; i++) + { col_partitioning[i] = col_starts[i]; + } *col_partitioning_ptr = col_partitioning; return hypre_error_flag; @@ -345,8 +349,8 @@ HYPRE_CSRMatrixToParCSRMatrix( MPI_Comm comm, return hypre_error_flag; } *matrix = (HYPRE_ParCSRMatrix) - hypre_CSRMatrixToParCSRMatrix( comm, (hypre_CSRMatrix *) A_CSR, - row_partitioning, col_partitioning) ; + hypre_CSRMatrixToParCSRMatrix( comm, (hypre_CSRMatrix *) A_CSR, + row_partitioning, col_partitioning) ; return hypre_error_flag; } @@ -369,7 +373,7 @@ HYPRE_CSRMatrixToParCSRMatrix_WithNewPartitioning( return hypre_error_flag; } *matrix = (HYPRE_ParCSRMatrix) - hypre_CSRMatrixToParCSRMatrix( comm, (hypre_CSRMatrix *) A_CSR, NULL, NULL ) ; + hypre_CSRMatrixToParCSRMatrix( comm, (hypre_CSRMatrix *) A_CSR, NULL, NULL ) ; return hypre_error_flag; } diff --git a/external/hypre/src/parcsr_mv/HYPRE_parcsr_mv.h b/external/hypre/src/parcsr_mv/HYPRE_parcsr_mv.h index a9927a08..807f81f0 100644 --- a/external/hypre/src/parcsr_mv/HYPRE_parcsr_mv.h +++ b/external/hypre/src/parcsr_mv/HYPRE_parcsr_mv.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -35,39 +35,54 @@ typedef struct hypre_ParVector_struct *HYPRE_ParVector; *--------------------------------------------------------------------------*/ /* HYPRE_parcsr_matrix.c */ -HYPRE_Int HYPRE_ParCSRMatrixCreate( MPI_Comm comm , HYPRE_BigInt global_num_rows , HYPRE_BigInt global_num_cols , HYPRE_BigInt *row_starts , HYPRE_BigInt *col_starts , HYPRE_Int num_cols_offd , HYPRE_Int num_nonzeros_diag , HYPRE_Int num_nonzeros_offd , HYPRE_ParCSRMatrix *matrix ); +HYPRE_Int HYPRE_ParCSRMatrixCreate( MPI_Comm comm, HYPRE_BigInt global_num_rows, + HYPRE_BigInt global_num_cols, HYPRE_BigInt *row_starts, HYPRE_BigInt *col_starts, + HYPRE_Int num_cols_offd, HYPRE_Int num_nonzeros_diag, HYPRE_Int num_nonzeros_offd, + HYPRE_ParCSRMatrix *matrix ); HYPRE_Int HYPRE_ParCSRMatrixDestroy( HYPRE_ParCSRMatrix matrix ); HYPRE_Int HYPRE_ParCSRMatrixInitialize( HYPRE_ParCSRMatrix matrix ); -HYPRE_Int HYPRE_ParCSRMatrixRead( MPI_Comm comm , const char *file_name , HYPRE_ParCSRMatrix *matrix ); -HYPRE_Int HYPRE_ParCSRMatrixPrint( HYPRE_ParCSRMatrix matrix , const char *file_name ); -HYPRE_Int HYPRE_ParCSRMatrixGetComm( HYPRE_ParCSRMatrix matrix , MPI_Comm *comm ); -HYPRE_Int HYPRE_ParCSRMatrixGetDims( HYPRE_ParCSRMatrix matrix , HYPRE_BigInt *M , HYPRE_BigInt *N ); -HYPRE_Int HYPRE_ParCSRMatrixGetRowPartitioning( HYPRE_ParCSRMatrix matrix , HYPRE_BigInt **row_partitioning_ptr ); -HYPRE_Int HYPRE_ParCSRMatrixGetColPartitioning( HYPRE_ParCSRMatrix matrix , HYPRE_BigInt **col_partitioning_ptr ); -HYPRE_Int HYPRE_ParCSRMatrixGetLocalRange( HYPRE_ParCSRMatrix matrix , HYPRE_BigInt *row_start , HYPRE_BigInt *row_end , HYPRE_BigInt *col_start , HYPRE_BigInt *col_end ); -HYPRE_Int HYPRE_ParCSRMatrixGetRow( HYPRE_ParCSRMatrix matrix , HYPRE_BigInt row , HYPRE_Int *size , HYPRE_BigInt **col_ind , HYPRE_Complex **values ); -HYPRE_Int HYPRE_ParCSRMatrixRestoreRow( HYPRE_ParCSRMatrix matrix , HYPRE_BigInt row , HYPRE_Int *size , HYPRE_BigInt **col_ind , HYPRE_Complex **values ); -HYPRE_Int HYPRE_CSRMatrixToParCSRMatrix( MPI_Comm comm , HYPRE_CSRMatrix A_CSR , HYPRE_BigInt *row_partitioning , HYPRE_BigInt *col_partitioning , HYPRE_ParCSRMatrix *matrix ); -HYPRE_Int HYPRE_ParCSRMatrixMatvec( HYPRE_Complex alpha , HYPRE_ParCSRMatrix A , HYPRE_ParVector x , HYPRE_Complex beta , HYPRE_ParVector y ); -HYPRE_Int HYPRE_ParCSRMatrixMatvecT( HYPRE_Complex alpha , HYPRE_ParCSRMatrix A , HYPRE_ParVector x , HYPRE_Complex beta , HYPRE_ParVector y ); +HYPRE_Int HYPRE_ParCSRMatrixRead( MPI_Comm comm, const char *file_name, + HYPRE_ParCSRMatrix *matrix ); +HYPRE_Int HYPRE_ParCSRMatrixPrint( HYPRE_ParCSRMatrix matrix, const char *file_name ); +HYPRE_Int HYPRE_ParCSRMatrixGetComm( HYPRE_ParCSRMatrix matrix, MPI_Comm *comm ); +HYPRE_Int HYPRE_ParCSRMatrixGetDims( HYPRE_ParCSRMatrix matrix, HYPRE_BigInt *M, HYPRE_BigInt *N ); +HYPRE_Int HYPRE_ParCSRMatrixGetRowPartitioning( HYPRE_ParCSRMatrix matrix, + HYPRE_BigInt **row_partitioning_ptr ); +HYPRE_Int HYPRE_ParCSRMatrixGetColPartitioning( HYPRE_ParCSRMatrix matrix, + HYPRE_BigInt **col_partitioning_ptr ); +HYPRE_Int HYPRE_ParCSRMatrixGetLocalRange( HYPRE_ParCSRMatrix matrix, HYPRE_BigInt *row_start, + HYPRE_BigInt *row_end, HYPRE_BigInt *col_start, HYPRE_BigInt *col_end ); +HYPRE_Int HYPRE_ParCSRMatrixGetRow( HYPRE_ParCSRMatrix matrix, HYPRE_BigInt row, HYPRE_Int *size, + HYPRE_BigInt **col_ind, HYPRE_Complex **values ); +HYPRE_Int HYPRE_ParCSRMatrixRestoreRow( HYPRE_ParCSRMatrix matrix, HYPRE_BigInt row, + HYPRE_Int *size, HYPRE_BigInt **col_ind, HYPRE_Complex **values ); +HYPRE_Int HYPRE_CSRMatrixToParCSRMatrix( MPI_Comm comm, HYPRE_CSRMatrix A_CSR, + HYPRE_BigInt *row_partitioning, HYPRE_BigInt *col_partitioning, HYPRE_ParCSRMatrix *matrix ); +HYPRE_Int HYPRE_ParCSRMatrixMatvec( HYPRE_Complex alpha, HYPRE_ParCSRMatrix A, HYPRE_ParVector x, + HYPRE_Complex beta, HYPRE_ParVector y ); +HYPRE_Int HYPRE_ParCSRMatrixMatvecT( HYPRE_Complex alpha, HYPRE_ParCSRMatrix A, HYPRE_ParVector x, + HYPRE_Complex beta, HYPRE_ParVector y ); /* HYPRE_parcsr_vector.c */ -HYPRE_Int HYPRE_ParVectorCreate( MPI_Comm comm , HYPRE_BigInt global_size , HYPRE_BigInt *partitioning , HYPRE_ParVector *vector ); +HYPRE_Int HYPRE_ParVectorCreate( MPI_Comm comm, HYPRE_BigInt global_size, + HYPRE_BigInt *partitioning, HYPRE_ParVector *vector ); HYPRE_Int HYPRE_ParVectorDestroy( HYPRE_ParVector vector ); HYPRE_Int HYPRE_ParVectorInitialize( HYPRE_ParVector vector ); -HYPRE_Int HYPRE_ParVectorRead( MPI_Comm comm , const char *file_name , HYPRE_ParVector *vector ); -HYPRE_Int HYPRE_ParVectorPrint( HYPRE_ParVector vector , const char *file_name ); -HYPRE_Int HYPRE_ParVectorSetConstantValues( HYPRE_ParVector vector , HYPRE_Complex value ); -HYPRE_Int HYPRE_ParVectorSetRandomValues( HYPRE_ParVector vector , HYPRE_Int seed ); -HYPRE_Int HYPRE_ParVectorCopy( HYPRE_ParVector x , HYPRE_ParVector y ); -HYPRE_Int HYPRE_ParVectorScale( HYPRE_Complex value , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParVectorInnerProd( HYPRE_ParVector x , HYPRE_ParVector y , HYPRE_Real *prod ); -HYPRE_Int HYPRE_VectorToParVector( MPI_Comm comm , HYPRE_Vector b , HYPRE_BigInt *partitioning , HYPRE_ParVector *vector ); -HYPRE_Int HYPRE_ParVectorGetValues( HYPRE_ParVector vector , HYPRE_Int num_values , HYPRE_BigInt *indices, HYPRE_Complex *values ); +HYPRE_Int HYPRE_ParVectorRead( MPI_Comm comm, const char *file_name, HYPRE_ParVector *vector ); +HYPRE_Int HYPRE_ParVectorPrint( HYPRE_ParVector vector, const char *file_name ); +HYPRE_Int HYPRE_ParVectorPrintBinaryIJ( HYPRE_ParVector vector, const char *file_name ); +HYPRE_Int HYPRE_ParVectorSetConstantValues( HYPRE_ParVector vector, HYPRE_Complex value ); +HYPRE_Int HYPRE_ParVectorSetRandomValues( HYPRE_ParVector vector, HYPRE_Int seed ); +HYPRE_Int HYPRE_ParVectorCopy( HYPRE_ParVector x, HYPRE_ParVector y ); +HYPRE_Int HYPRE_ParVectorScale( HYPRE_Complex value, HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParVectorInnerProd( HYPRE_ParVector x, HYPRE_ParVector y, HYPRE_Real *prod ); +HYPRE_Int HYPRE_VectorToParVector( MPI_Comm comm, HYPRE_Vector b, HYPRE_BigInt *partitioning, + HYPRE_ParVector *vector ); +HYPRE_Int HYPRE_ParVectorGetValues( HYPRE_ParVector vector, HYPRE_Int num_values, + HYPRE_BigInt *indices, HYPRE_Complex *values ); #ifdef __cplusplus } #endif #endif - diff --git a/external/hypre/src/parcsr_mv/HYPRE_parcsr_vector.c b/external/hypre/src/parcsr_mv/HYPRE_parcsr_vector.c index 748aa73e..083847ca 100644 --- a/external/hypre/src/parcsr_mv/HYPRE_parcsr_vector.c +++ b/external/hypre/src/parcsr_mv/HYPRE_parcsr_vector.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -29,7 +29,7 @@ HYPRE_ParVectorCreate( MPI_Comm comm, return hypre_error_flag; } *vector = (HYPRE_ParVector) - hypre_ParVectorCreate(comm, global_size, partitioning) ; + hypre_ParVectorCreate(comm, global_size, partitioning) ; return hypre_error_flag; } @@ -50,7 +50,7 @@ HYPRE_ParMultiVectorCreate( MPI_Comm comm, return hypre_error_flag; } *vector = (HYPRE_ParVector) - hypre_ParMultiVectorCreate( comm, global_size, partitioning, number_vectors ); + hypre_ParMultiVectorCreate( comm, global_size, partitioning, number_vectors ); return hypre_error_flag; } @@ -104,6 +104,18 @@ HYPRE_ParVectorPrint( HYPRE_ParVector vector, file_name ) ); } +/*-------------------------------------------------------------------------- + * HYPRE_ParVectorPrintBinaryIJ + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParVectorPrintBinaryIJ( HYPRE_ParVector vector, + const char *file_name ) +{ + return ( hypre_ParVectorPrintBinaryIJ( (hypre_ParVector *) vector, + file_name ) ); +} + /*-------------------------------------------------------------------------- * HYPRE_ParVectorSetConstantValues *--------------------------------------------------------------------------*/ @@ -165,6 +177,7 @@ HYPRE_ParVectorScale( HYPRE_Complex value, /*-------------------------------------------------------------------------- * HYPRE_ParVectorAxpy *--------------------------------------------------------------------------*/ + HYPRE_Int HYPRE_ParVectorAxpy( HYPRE_Complex alpha, HYPRE_ParVector x, @@ -215,7 +228,7 @@ HYPRE_VectorToParVector( MPI_Comm comm, return hypre_error_flag; } *vector = (HYPRE_ParVector) - hypre_VectorToParVector (comm, (hypre_Vector *) b, partitioning); + hypre_VectorToParVector (comm, (hypre_Vector *) b, partitioning); return hypre_error_flag; } diff --git a/external/hypre/src/parcsr_mv/_hypre_parcsr_mv.h b/external/hypre/src/parcsr_mv/_hypre_parcsr_mv.h index 358313cb..b920dc4f 100644 --- a/external/hypre/src/parcsr_mv/_hypre_parcsr_mv.h +++ b/external/hypre/src/parcsr_mv/_hypre_parcsr_mv.h @@ -7,6 +7,7 @@ #include #include "HYPRE_parcsr_mv.h" #include "_hypre_utilities.h" +#include "_hypre_seq_block_mv.h" #include "seq_mv.h" #ifdef __cplusplus @@ -14,7 +15,7 @@ extern "C" { #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -65,31 +66,27 @@ typedef hypre_ParCSRCommHandle hypre_ParCSRPersistentCommHandle; typedef struct _hypre_ParCSRCommPkg { - MPI_Comm comm; - - HYPRE_Int num_sends; - HYPRE_Int *send_procs; - HYPRE_Int *send_map_starts; - HYPRE_Int *send_map_elmts; - HYPRE_Int *device_send_map_elmts; - - HYPRE_Int num_recvs; - HYPRE_Int *recv_procs; - HYPRE_Int *recv_vec_starts; - + MPI_Comm comm; + HYPRE_Int num_components; + HYPRE_Int num_sends; + HYPRE_Int *send_procs; + HYPRE_Int *send_map_starts; + HYPRE_Int *send_map_elmts; + HYPRE_Int *device_send_map_elmts; + HYPRE_Int num_recvs; + HYPRE_Int *recv_procs; + HYPRE_Int *recv_vec_starts; /* remote communication information */ - hypre_MPI_Datatype *send_mpi_types; - hypre_MPI_Datatype *recv_mpi_types; - + hypre_MPI_Datatype *send_mpi_types; + hypre_MPI_Datatype *recv_mpi_types; #ifdef HYPRE_USING_PERSISTENT_COMM hypre_ParCSRPersistentCommHandle *persistent_comm_handles[NUM_OF_COMM_PKG_JOB_TYPE]; #endif - +#if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) /* temporary memory for matvec. cudaMalloc is expensive. alloc once and reuse */ -#if defined(HYPRE_USING_GPU) - HYPRE_Complex *tmp_data; - HYPRE_Complex *buf_data; - char *work_space; + HYPRE_Complex *tmp_data; + HYPRE_Complex *buf_data; + hypre_CSRMatrix *matrix_E; /* for matvecT */ #endif } hypre_ParCSRCommPkg; @@ -98,6 +95,7 @@ typedef struct _hypre_ParCSRCommPkg *--------------------------------------------------------------------------*/ #define hypre_ParCSRCommPkgComm(comm_pkg) (comm_pkg -> comm) +#define hypre_ParCSRCommPkgNumComponents(comm_pkg) (comm_pkg -> num_components) #define hypre_ParCSRCommPkgNumSends(comm_pkg) (comm_pkg -> num_sends) #define hypre_ParCSRCommPkgSendProcs(comm_pkg) (comm_pkg -> send_procs) #define hypre_ParCSRCommPkgSendProc(comm_pkg, i) (comm_pkg -> send_procs[i]) @@ -117,25 +115,34 @@ typedef struct _hypre_ParCSRCommPkg #define hypre_ParCSRCommPkgRecvMPITypes(comm_pkg) (comm_pkg -> recv_mpi_types) #define hypre_ParCSRCommPkgRecvMPIType(comm_pkg,i) (comm_pkg -> recv_mpi_types[i]) -#if defined(HYPRE_USING_GPU) +#if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) #define hypre_ParCSRCommPkgTmpData(comm_pkg) ((comm_pkg) -> tmp_data) #define hypre_ParCSRCommPkgBufData(comm_pkg) ((comm_pkg) -> buf_data) -#define hypre_ParCSRCommPkgWorkSpace(comm_pkg) ((comm_pkg) -> work_space) +#define hypre_ParCSRCommPkgMatrixE(comm_pkg) ((comm_pkg) -> matrix_E) #endif -static inline void +static inline HYPRE_MAYBE_UNUSED_FUNC void hypre_ParCSRCommPkgCopySendMapElmtsToDevice(hypre_ParCSRCommPkg *comm_pkg) { -#if defined(HYPRE_USING_GPU) +#if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) + HYPRE_Int num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); + if (hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) == NULL) { hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) = - hypre_TAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, hypre_ParCSRCommPkgNumSends(comm_pkg)), HYPRE_MEMORY_DEVICE); - - hypre_TMemcpy(hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), hypre_ParCSRCommPkgSendMapElmts(comm_pkg), - HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, hypre_ParCSRCommPkgNumSends(comm_pkg)), - HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); + hypre_TAlloc(HYPRE_Int, + hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_DEVICE); + + hypre_TMemcpy(hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), + hypre_ParCSRCommPkgSendMapElmts(comm_pkg), + HYPRE_Int, + hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_DEVICE, + HYPRE_MEMORY_HOST); } +#else + HYPRE_UNUSED_VAR(comm_pkg); #endif } @@ -158,7 +165,7 @@ hypre_ParCSRCommPkgCopySendMapElmtsToDevice(hypre_ParCSRCommPkg *comm_pkg) #endif /* HYPRE_PAR_CSR_COMMUNICATION_HEADER */ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -181,7 +188,7 @@ typedef struct #endif /* hypre_PARCSR_ASSUMED_PART */ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -204,7 +211,7 @@ typedef struct #endif /* hypre_NEW_COMMPKG */ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -242,6 +249,8 @@ typedef struct hypre_ParVector_struct /* Does the Vector create/destroy `data'? */ HYPRE_Int owns_data; + /* If the vector is all zeros */ + HYPRE_Int all_zeros; hypre_IJAssumedPart *assumed_partition; /* only populated if this partition needed (for setting off-proc elements, for example)*/ @@ -257,13 +266,19 @@ typedef struct hypre_ParVector_struct #define hypre_ParVectorLastIndex(vector) ((vector) -> last_index) #define hypre_ParVectorPartitioning(vector) ((vector) -> partitioning) #define hypre_ParVectorActualLocalSize(vector) ((vector) -> actual_local_size) -#define hypre_ParVectorLocalVector(vector) ((vector) -> local_vector) #define hypre_ParVectorOwnsData(vector) ((vector) -> owns_data) -#define hypre_ParVectorNumVectors(vector) (hypre_VectorNumVectors(hypre_ParVectorLocalVector(vector))) +#define hypre_ParVectorAllZeros(vector) ((vector) -> all_zeros) +#define hypre_ParVectorLocalVector(vector) ((vector) -> local_vector) +#define hypre_ParVectorLocalSize(vector) ((vector) -> local_vector -> size) +#define hypre_ParVectorLocalData(vector) ((vector) -> local_vector -> data) +#define hypre_ParVectorLocalStorage(vector) ((vector) -> local_vector -> multivec_storage_method) +#define hypre_ParVectorNumVectors(vector) ((vector) -> local_vector -> num_vectors) +#define hypre_ParVectorEntryI(vector, i) (hypre_VectorEntryI((vector) -> local_vector, i)) +#define hypre_ParVectorEntryIJ(vector, i, j) (hypre_VectorEntryIJ((vector) -> local_vector, i, j)) #define hypre_ParVectorAssumedPartition(vector) ((vector) -> assumed_partition) -static inline HYPRE_MemoryLocation +static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_MemoryLocation hypre_ParVectorMemoryLocation(hypre_ParVector *vector) { return hypre_VectorMemoryLocation(hypre_ParVectorLocalVector(vector)); @@ -271,7 +286,7 @@ hypre_ParVectorMemoryLocation(hypre_ParVector *vector) #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -303,6 +318,9 @@ typedef struct hypre_ParCSRMatrix_struct HYPRE_BigInt global_num_rows; HYPRE_BigInt global_num_cols; HYPRE_BigInt global_num_rownnz; + HYPRE_BigInt num_nonzeros; + HYPRE_Real d_num_nonzeros; + HYPRE_BigInt first_row_index; HYPRE_BigInt first_col_diag; /* need to know entire local range in case row_starts and col_starts @@ -330,9 +348,6 @@ typedef struct hypre_ParCSRMatrix_struct /* Does the ParCSRMatrix create/destroy `diag', `offd', `col_map_offd'? */ HYPRE_Int owns_data; - HYPRE_BigInt num_nonzeros; - HYPRE_Real d_num_nonzeros; - /* Buffers used by GetRow to hold row currently being accessed. AJC, 4/99 */ HYPRE_BigInt *rowindices; HYPRE_Complex *rowvalues; @@ -349,7 +364,7 @@ typedef struct hypre_ParCSRMatrix_struct HYPRE_Complex *bdiaginv; hypre_ParCSRCommPkg *bdiaginv_comm_pkg; -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) /* these two arrays are reserveed for SoC matrices on GPUs to help build interpolation */ HYPRE_Int *soc_diag_j; HYPRE_Int *soc_offd_j; @@ -365,6 +380,8 @@ typedef struct hypre_ParCSRMatrix_struct #define hypre_ParCSRMatrixGlobalNumRows(matrix) ((matrix) -> global_num_rows) #define hypre_ParCSRMatrixGlobalNumCols(matrix) ((matrix) -> global_num_cols) #define hypre_ParCSRMatrixGlobalNumRownnz(matrix) ((matrix) -> global_num_rownnz) +#define hypre_ParCSRMatrixNumNonzeros(matrix) ((matrix) -> num_nonzeros) +#define hypre_ParCSRMatrixDNumNonzeros(matrix) ((matrix) -> d_num_nonzeros) #define hypre_ParCSRMatrixFirstRowIndex(matrix) ((matrix) -> first_row_index) #define hypre_ParCSRMatrixFirstColDiag(matrix) ((matrix) -> first_col_diag) #define hypre_ParCSRMatrixLastRowIndex(matrix) ((matrix) -> last_row_index) @@ -380,15 +397,13 @@ typedef struct hypre_ParCSRMatrix_struct #define hypre_ParCSRMatrixCommPkg(matrix) ((matrix) -> comm_pkg) #define hypre_ParCSRMatrixCommPkgT(matrix) ((matrix) -> comm_pkgT) #define hypre_ParCSRMatrixOwnsData(matrix) ((matrix) -> owns_data) -#define hypre_ParCSRMatrixNumNonzeros(matrix) ((matrix) -> num_nonzeros) -#define hypre_ParCSRMatrixDNumNonzeros(matrix) ((matrix) -> d_num_nonzeros) #define hypre_ParCSRMatrixRowindices(matrix) ((matrix) -> rowindices) #define hypre_ParCSRMatrixRowvalues(matrix) ((matrix) -> rowvalues) #define hypre_ParCSRMatrixGetrowactive(matrix) ((matrix) -> getrowactive) #define hypre_ParCSRMatrixAssumedPartition(matrix) ((matrix) -> assumed_partition) #define hypre_ParCSRMatrixOwnsAssumedPartition(matrix) ((matrix) -> owns_assumed_partition) #define hypre_ParCSRMatrixProcOrdering(matrix) ((matrix) -> proc_ordering) -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) #define hypre_ParCSRMatrixSocDiagJ(matrix) ((matrix) -> soc_diag_j) #define hypre_ParCSRMatrixSocOffdJ(matrix) ((matrix) -> soc_offd_j) #endif @@ -396,18 +411,38 @@ typedef struct hypre_ParCSRMatrix_struct #define hypre_ParCSRMatrixNumRows(matrix) hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(matrix)) #define hypre_ParCSRMatrixNumCols(matrix) hypre_CSRMatrixNumCols(hypre_ParCSRMatrixDiag(matrix)) -static inline HYPRE_MemoryLocation +static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_MemoryLocation hypre_ParCSRMatrixMemoryLocation(hypre_ParCSRMatrix *matrix) { - HYPRE_MemoryLocation memory_diag = hypre_CSRMatrixMemoryLocation(hypre_ParCSRMatrixDiag(matrix)); - HYPRE_MemoryLocation memory_offd = hypre_CSRMatrixMemoryLocation(hypre_ParCSRMatrixOffd(matrix)); + if (!matrix) { return HYPRE_MEMORY_UNDEFINED; } - if (memory_diag != memory_offd) + hypre_CSRMatrix *diag = hypre_ParCSRMatrixDiag(matrix); + hypre_CSRMatrix *offd = hypre_ParCSRMatrixOffd(matrix); + HYPRE_MemoryLocation memory_diag = diag ? hypre_CSRMatrixMemoryLocation( + diag) : HYPRE_MEMORY_UNDEFINED; + HYPRE_MemoryLocation memory_offd = offd ? hypre_CSRMatrixMemoryLocation( + offd) : HYPRE_MEMORY_UNDEFINED; + + if (diag && offd) { - hypre_printf("Warning: ParCSRMatrix Memory Location Diag (%d) != Offd (%d)\n", memory_diag, memory_offd); - hypre_assert(0); + if (memory_diag != memory_offd) + { + char err_msg[1024]; + hypre_sprintf(err_msg, "Error: ParCSRMatrix Memory Location Diag (%d) != Offd (%d)\n", memory_diag, + memory_offd); + hypre_error_w_msg(HYPRE_ERROR_MEMORY, err_msg); + hypre_assert(0); + + return HYPRE_MEMORY_UNDEFINED; + } + + return memory_diag; } - return memory_diag; + + if (diag) { return memory_diag; } + if (offd) { return memory_offd; } + + return HYPRE_MEMORY_UNDEFINED; } /*-------------------------------------------------------------------------- @@ -469,7 +504,7 @@ typedef struct #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -515,7 +550,7 @@ typedef struct hypre_NumbersNode #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -606,7 +641,7 @@ typedef struct #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -625,16 +660,25 @@ typedef struct #endif /* hypre_PAR_MAKE_SYSTEM */ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ /* communicationT.c */ -void hypre_RowsWithColumn_original ( HYPRE_Int *rowmin , HYPRE_Int *rowmax , HYPRE_BigInt column , hypre_ParCSRMatrix *A ); -void hypre_RowsWithColumn ( HYPRE_Int *rowmin , HYPRE_Int *rowmax , HYPRE_BigInt column , HYPRE_Int num_rows_diag , HYPRE_BigInt firstColDiag , HYPRE_BigInt *colMapOffd , HYPRE_Int *mat_i_diag , HYPRE_Int *mat_j_diag , HYPRE_Int *mat_i_offd , HYPRE_Int *mat_j_offd ); -void hypre_MatTCommPkgCreate_core ( MPI_Comm comm , HYPRE_BigInt *col_map_offd , HYPRE_BigInt first_col_diag , HYPRE_BigInt *col_starts , HYPRE_Int num_rows_diag , HYPRE_Int num_cols_diag , HYPRE_Int num_cols_offd , HYPRE_BigInt *row_starts , HYPRE_BigInt firstColDiag , HYPRE_BigInt *colMapOffd , HYPRE_Int *mat_i_diag , HYPRE_Int *mat_j_diag , HYPRE_Int *mat_i_offd , HYPRE_Int *mat_j_offd , HYPRE_Int data , HYPRE_Int *p_num_recvs , HYPRE_Int **p_recv_procs , HYPRE_Int **p_recv_vec_starts , HYPRE_Int *p_num_sends , HYPRE_Int **p_send_procs , HYPRE_Int **p_send_map_starts , HYPRE_Int **p_send_map_elmts ); +void hypre_RowsWithColumn_original ( HYPRE_Int *rowmin, HYPRE_Int *rowmax, HYPRE_BigInt column, + hypre_ParCSRMatrix *A ); +void hypre_RowsWithColumn ( HYPRE_Int *rowmin, HYPRE_Int *rowmax, HYPRE_BigInt column, + HYPRE_Int num_rows_diag, HYPRE_BigInt firstColDiag, HYPRE_BigInt *colMapOffd, HYPRE_Int *mat_i_diag, + HYPRE_Int *mat_j_diag, HYPRE_Int *mat_i_offd, HYPRE_Int *mat_j_offd ); +void hypre_MatTCommPkgCreate_core ( MPI_Comm comm, HYPRE_BigInt *col_map_offd, + HYPRE_BigInt first_col_diag, HYPRE_BigInt *col_starts, HYPRE_Int num_rows_diag, + HYPRE_Int num_cols_diag, HYPRE_Int num_cols_offd, HYPRE_BigInt *row_starts, + HYPRE_BigInt firstColDiag, HYPRE_BigInt *colMapOffd, HYPRE_Int *mat_i_diag, HYPRE_Int *mat_j_diag, + HYPRE_Int *mat_i_offd, HYPRE_Int *mat_j_offd, HYPRE_Int data, HYPRE_Int *p_num_recvs, + HYPRE_Int **p_recv_procs, HYPRE_Int **p_recv_vec_starts, HYPRE_Int *p_num_sends, + HYPRE_Int **p_send_procs, HYPRE_Int **p_send_map_starts, HYPRE_Int **p_send_map_elmts ); HYPRE_Int hypre_MatTCommPkgCreate ( hypre_ParCSRMatrix *A ); /* driver_aat.c */ @@ -654,293 +698,626 @@ HYPRE_Int hypre_MatTCommPkgCreate ( hypre_ParCSRMatrix *A ); /* driver_multivec.c */ /* HYPRE_parcsr_matrix.c */ -HYPRE_Int HYPRE_ParCSRMatrixCreate ( MPI_Comm comm , HYPRE_BigInt global_num_rows , HYPRE_BigInt global_num_cols , HYPRE_BigInt *row_starts , HYPRE_BigInt *col_starts , HYPRE_Int num_cols_offd , HYPRE_Int num_nonzeros_diag , HYPRE_Int num_nonzeros_offd , HYPRE_ParCSRMatrix *matrix ); +HYPRE_Int HYPRE_ParCSRMatrixCreate ( MPI_Comm comm, HYPRE_BigInt global_num_rows, + HYPRE_BigInt global_num_cols, HYPRE_BigInt *row_starts, HYPRE_BigInt *col_starts, + HYPRE_Int num_cols_offd, HYPRE_Int num_nonzeros_diag, HYPRE_Int num_nonzeros_offd, + HYPRE_ParCSRMatrix *matrix ); HYPRE_Int HYPRE_ParCSRMatrixDestroy ( HYPRE_ParCSRMatrix matrix ); HYPRE_Int HYPRE_ParCSRMatrixInitialize ( HYPRE_ParCSRMatrix matrix ); HYPRE_Int HYPRE_ParCSRMatrixBigInitialize ( HYPRE_ParCSRMatrix matrix ); -HYPRE_Int HYPRE_ParCSRMatrixRead ( MPI_Comm comm , const char *file_name , HYPRE_ParCSRMatrix *matrix ); -HYPRE_Int HYPRE_ParCSRMatrixPrint ( HYPRE_ParCSRMatrix matrix , const char *file_name ); -HYPRE_Int HYPRE_ParCSRMatrixGetComm ( HYPRE_ParCSRMatrix matrix , MPI_Comm *comm ); -HYPRE_Int HYPRE_ParCSRMatrixGetDims ( HYPRE_ParCSRMatrix matrix , HYPRE_BigInt *M , HYPRE_BigInt *N ); -HYPRE_Int HYPRE_ParCSRMatrixGetRowPartitioning ( HYPRE_ParCSRMatrix matrix , HYPRE_BigInt **row_partitioning_ptr ); -HYPRE_Int HYPRE_ParCSRMatrixGetGlobalRowPartitioning ( HYPRE_ParCSRMatrix matrix , HYPRE_Int all_procs, HYPRE_BigInt **row_partitioning_ptr ); -HYPRE_Int HYPRE_ParCSRMatrixGetColPartitioning ( HYPRE_ParCSRMatrix matrix , HYPRE_BigInt **col_partitioning_ptr ); -HYPRE_Int HYPRE_ParCSRMatrixGetLocalRange ( HYPRE_ParCSRMatrix matrix , HYPRE_BigInt *row_start , HYPRE_BigInt *row_end , HYPRE_BigInt *col_start , HYPRE_BigInt *col_end ); -HYPRE_Int HYPRE_ParCSRMatrixGetRow ( HYPRE_ParCSRMatrix matrix , HYPRE_BigInt row , HYPRE_Int *size , HYPRE_BigInt **col_ind , HYPRE_Complex **values ); -HYPRE_Int HYPRE_ParCSRMatrixRestoreRow ( HYPRE_ParCSRMatrix matrix , HYPRE_BigInt row , HYPRE_Int *size , HYPRE_BigInt **col_ind , HYPRE_Complex **values ); -HYPRE_Int HYPRE_CSRMatrixToParCSRMatrix ( MPI_Comm comm , HYPRE_CSRMatrix A_CSR , HYPRE_BigInt *row_partitioning , HYPRE_BigInt *col_partitioning , HYPRE_ParCSRMatrix *matrix ); -HYPRE_Int HYPRE_CSRMatrixToParCSRMatrix_WithNewPartitioning ( MPI_Comm comm , HYPRE_CSRMatrix A_CSR , HYPRE_ParCSRMatrix *matrix ); -HYPRE_Int HYPRE_ParCSRMatrixMatvec ( HYPRE_Complex alpha , HYPRE_ParCSRMatrix A , HYPRE_ParVector x , HYPRE_Complex beta , HYPRE_ParVector y ); -HYPRE_Int HYPRE_ParCSRMatrixMatvecT ( HYPRE_Complex alpha , HYPRE_ParCSRMatrix A , HYPRE_ParVector x , HYPRE_Complex beta , HYPRE_ParVector y ); -HYPRE_Int hypre_ParCSRMatrixTruncate(hypre_ParCSRMatrix *A, HYPRE_Real tol, HYPRE_Int max_row_elmts, HYPRE_Int rescale, HYPRE_Int nrm_type); +HYPRE_Int HYPRE_ParCSRMatrixRead ( MPI_Comm comm, const char *file_name, + HYPRE_ParCSRMatrix *matrix ); +HYPRE_Int HYPRE_ParCSRMatrixPrint ( HYPRE_ParCSRMatrix matrix, const char *file_name ); +HYPRE_Int HYPRE_ParCSRMatrixGetComm ( HYPRE_ParCSRMatrix matrix, MPI_Comm *comm ); +HYPRE_Int HYPRE_ParCSRMatrixGetDims ( HYPRE_ParCSRMatrix matrix, HYPRE_BigInt *M, HYPRE_BigInt *N ); +HYPRE_Int HYPRE_ParCSRMatrixGetRowPartitioning ( HYPRE_ParCSRMatrix matrix, + HYPRE_BigInt **row_partitioning_ptr ); +HYPRE_Int HYPRE_ParCSRMatrixGetGlobalRowPartitioning ( HYPRE_ParCSRMatrix matrix, + HYPRE_Int all_procs, HYPRE_BigInt **row_partitioning_ptr ); +HYPRE_Int HYPRE_ParCSRMatrixGetColPartitioning ( HYPRE_ParCSRMatrix matrix, + HYPRE_BigInt **col_partitioning_ptr ); +HYPRE_Int HYPRE_ParCSRMatrixGetLocalRange ( HYPRE_ParCSRMatrix matrix, HYPRE_BigInt *row_start, + HYPRE_BigInt *row_end, HYPRE_BigInt *col_start, HYPRE_BigInt *col_end ); +HYPRE_Int HYPRE_ParCSRMatrixGetRow ( HYPRE_ParCSRMatrix matrix, HYPRE_BigInt row, HYPRE_Int *size, + HYPRE_BigInt **col_ind, HYPRE_Complex **values ); +HYPRE_Int HYPRE_ParCSRMatrixRestoreRow ( HYPRE_ParCSRMatrix matrix, HYPRE_BigInt row, + HYPRE_Int *size, HYPRE_BigInt **col_ind, HYPRE_Complex **values ); +HYPRE_Int HYPRE_CSRMatrixToParCSRMatrix ( MPI_Comm comm, HYPRE_CSRMatrix A_CSR, + HYPRE_BigInt *row_partitioning, HYPRE_BigInt *col_partitioning, HYPRE_ParCSRMatrix *matrix ); +HYPRE_Int HYPRE_CSRMatrixToParCSRMatrix_WithNewPartitioning ( MPI_Comm comm, HYPRE_CSRMatrix A_CSR, + HYPRE_ParCSRMatrix *matrix ); +HYPRE_Int HYPRE_ParCSRMatrixMatvec ( HYPRE_Complex alpha, HYPRE_ParCSRMatrix A, HYPRE_ParVector x, + HYPRE_Complex beta, HYPRE_ParVector y ); +HYPRE_Int HYPRE_ParCSRMatrixMatvecT ( HYPRE_Complex alpha, HYPRE_ParCSRMatrix A, HYPRE_ParVector x, + HYPRE_Complex beta, HYPRE_ParVector y ); + /* HYPRE_parcsr_vector.c */ -HYPRE_Int HYPRE_ParVectorCreate ( MPI_Comm comm , HYPRE_BigInt global_size , HYPRE_BigInt *partitioning , HYPRE_ParVector *vector ); -HYPRE_Int HYPRE_ParMultiVectorCreate ( MPI_Comm comm , HYPRE_BigInt global_size , HYPRE_BigInt *partitioning , HYPRE_Int number_vectors , HYPRE_ParVector *vector ); +HYPRE_Int HYPRE_ParVectorCreate ( MPI_Comm comm, HYPRE_BigInt global_size, + HYPRE_BigInt *partitioning, HYPRE_ParVector *vector ); +HYPRE_Int HYPRE_ParMultiVectorCreate ( MPI_Comm comm, HYPRE_BigInt global_size, + HYPRE_BigInt *partitioning, HYPRE_Int number_vectors, HYPRE_ParVector *vector ); HYPRE_Int HYPRE_ParVectorDestroy ( HYPRE_ParVector vector ); HYPRE_Int HYPRE_ParVectorInitialize ( HYPRE_ParVector vector ); -HYPRE_Int HYPRE_ParVectorRead ( MPI_Comm comm , const char *file_name , HYPRE_ParVector *vector ); -HYPRE_Int HYPRE_ParVectorPrint ( HYPRE_ParVector vector , const char *file_name ); -HYPRE_Int HYPRE_ParVectorSetConstantValues ( HYPRE_ParVector vector , HYPRE_Complex value ); -HYPRE_Int HYPRE_ParVectorSetRandomValues ( HYPRE_ParVector vector , HYPRE_Int seed ); -HYPRE_Int HYPRE_ParVectorCopy ( HYPRE_ParVector x , HYPRE_ParVector y ); +HYPRE_Int HYPRE_ParVectorRead ( MPI_Comm comm, const char *file_name, HYPRE_ParVector *vector ); +HYPRE_Int HYPRE_ParVectorPrint ( HYPRE_ParVector vector, const char *file_name ); +HYPRE_Int HYPRE_ParVectorPrintBinaryIJ ( HYPRE_ParVector vector, const char *file_name ); +HYPRE_Int HYPRE_ParVectorSetConstantValues ( HYPRE_ParVector vector, HYPRE_Complex value ); +HYPRE_Int HYPRE_ParVectorSetRandomValues ( HYPRE_ParVector vector, HYPRE_Int seed ); +HYPRE_Int HYPRE_ParVectorCopy ( HYPRE_ParVector x, HYPRE_ParVector y ); +HYPRE_Int hypre_ParVectorStridedCopy( hypre_ParVector *x, HYPRE_Int istride, HYPRE_Int ostride, + HYPRE_Int size, HYPRE_Complex *data ); HYPRE_ParVector HYPRE_ParVectorCloneShallow ( HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParVectorScale ( HYPRE_Complex value , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParVectorAxpy ( HYPRE_Complex alpha , HYPRE_ParVector x , HYPRE_ParVector y ); -HYPRE_Int HYPRE_ParVectorInnerProd ( HYPRE_ParVector x , HYPRE_ParVector y , HYPRE_Real *prod ); -HYPRE_Int HYPRE_VectorToParVector ( MPI_Comm comm , HYPRE_Vector b , HYPRE_BigInt *partitioning , HYPRE_ParVector *vector ); -HYPRE_Int HYPRE_ParVectorGetValues ( HYPRE_ParVector vector, HYPRE_Int num_values, HYPRE_BigInt *indices , HYPRE_Complex *values); - -/*gen_fffc.c */ -HYPRE_Int hypre_ParCSRMatrixGenerateFFFC(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker , HYPRE_BigInt *cpts_starts , hypre_ParCSRMatrix *S, hypre_ParCSRMatrix **A_FC_ptr , hypre_ParCSRMatrix **A_FF_ptr ) ; -HYPRE_Int hypre_ParCSRMatrixGenerateFFFC3(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker , HYPRE_BigInt *cpts_starts , hypre_ParCSRMatrix *S, hypre_ParCSRMatrix **A_FC_ptr , hypre_ParCSRMatrix **A_FF_ptr ) ; -HYPRE_Int hypre_ParCSRMatrixGenerateFFFCD3(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker , HYPRE_BigInt *cpts_starts , hypre_ParCSRMatrix *S, hypre_ParCSRMatrix **A_FC_ptr , hypre_ParCSRMatrix **A_FF_ptr , HYPRE_Real **D_lambda_ptr ) ; -HYPRE_Int hypre_ParCSRMatrixGenerateFFFC3Device(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker , HYPRE_BigInt *cpts_starts , hypre_ParCSRMatrix *S, hypre_ParCSRMatrix **A_FC_ptr , hypre_ParCSRMatrix **A_FF_ptr ) ; -HYPRE_Int hypre_ParCSRMatrixGenerateCFDevice( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker_host, HYPRE_BigInt *cpts_starts, hypre_ParCSRMatrix *S, hypre_ParCSRMatrix **ACF_ptr) ; -HYPRE_Int hypre_ParCSRMatrixGenerateCCDevice( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker_host, HYPRE_BigInt *cpts_starts, hypre_ParCSRMatrix *S, hypre_ParCSRMatrix **ACC_ptr) ; -HYPRE_Int hypre_ParCSRMatrixGenerate1DCFDevice( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker_host, HYPRE_BigInt *cpts_starts, hypre_ParCSRMatrix *S, hypre_ParCSRMatrix **ACX_ptr, hypre_ParCSRMatrix **AXC_ptr ) ; +HYPRE_Int HYPRE_ParVectorScale ( HYPRE_Complex value, HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParVectorAxpy ( HYPRE_Complex alpha, HYPRE_ParVector x, HYPRE_ParVector y ); +HYPRE_Int HYPRE_ParVectorInnerProd ( HYPRE_ParVector x, HYPRE_ParVector y, HYPRE_Real *prod ); +HYPRE_Int HYPRE_VectorToParVector ( MPI_Comm comm, HYPRE_Vector b, HYPRE_BigInt *partitioning, + HYPRE_ParVector *vector ); +HYPRE_Int HYPRE_ParVectorGetValues ( HYPRE_ParVector vector, HYPRE_Int num_values, + HYPRE_BigInt *indices, HYPRE_Complex *values); + +/* gen_fffc.c */ +HYPRE_Int hypre_ParCSRMatrixGenerateFFFCHost( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + HYPRE_BigInt *cpts_starts, hypre_ParCSRMatrix *S, + hypre_ParCSRMatrix **A_FC_ptr, + hypre_ParCSRMatrix **A_FF_ptr ) ; +HYPRE_Int hypre_ParCSRMatrixGenerateFFFC( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + HYPRE_BigInt *cpts_starts, hypre_ParCSRMatrix *S, + hypre_ParCSRMatrix **A_FC_ptr, + hypre_ParCSRMatrix **A_FF_ptr ) ; +HYPRE_Int hypre_ParCSRMatrixGenerateFFFC3(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + HYPRE_BigInt *cpts_starts, hypre_ParCSRMatrix *S, hypre_ParCSRMatrix **A_FC_ptr, + hypre_ParCSRMatrix **A_FF_ptr ) ; +HYPRE_Int hypre_ParCSRMatrixGenerateFFFCD3(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + HYPRE_BigInt *cpts_starts, hypre_ParCSRMatrix *S, hypre_ParCSRMatrix **A_FC_ptr, + hypre_ParCSRMatrix **A_FF_ptr, HYPRE_Real **D_lambda_ptr ) ; +HYPRE_Int hypre_ParCSRMatrixGenerateFFFC3Device(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + HYPRE_BigInt *cpts_starts, hypre_ParCSRMatrix *S, hypre_ParCSRMatrix **A_FC_ptr, + hypre_ParCSRMatrix **A_FF_ptr ) ; +HYPRE_Int hypre_ParCSRMatrixGenerateCFDevice( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + HYPRE_BigInt *cpts_starts, hypre_ParCSRMatrix *S, hypre_ParCSRMatrix **ACF_ptr) ; +HYPRE_Int hypre_ParCSRMatrixGenerateCCDevice( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + HYPRE_BigInt *cpts_starts, hypre_ParCSRMatrix *S, hypre_ParCSRMatrix **ACC_ptr) ; +HYPRE_Int hypre_ParCSRMatrixGenerate1DCFDevice( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + HYPRE_BigInt *cpts_starts, hypre_ParCSRMatrix *S, hypre_ParCSRMatrix **ACX_ptr, + hypre_ParCSRMatrix **AXC_ptr ) ; /* new_commpkg.c */ -HYPRE_Int hypre_PrintCommpkg ( hypre_ParCSRMatrix *A , const char *file_name ); -HYPRE_Int hypre_ParCSRCommPkgCreateApart_core ( MPI_Comm comm , HYPRE_BigInt *col_map_off_d , HYPRE_BigInt first_col_diag , HYPRE_Int num_cols_off_d , HYPRE_BigInt global_num_cols , HYPRE_Int *p_num_recvs , HYPRE_Int **p_recv_procs , HYPRE_Int **p_recv_vec_starts , HYPRE_Int *p_num_sends , HYPRE_Int **p_send_procs , HYPRE_Int **p_send_map_starts , HYPRE_Int **p_send_map_elements , hypre_IJAssumedPart *apart ); -HYPRE_Int hypre_ParCSRCommPkgCreateApart ( MPI_Comm comm, HYPRE_BigInt *col_map_off_d, HYPRE_BigInt first_col_diag, HYPRE_Int num_cols_off_d, HYPRE_BigInt global_num_cols, hypre_IJAssumedPart *apart, hypre_ParCSRCommPkg *comm_pkg ); +HYPRE_Int hypre_PrintCommpkg ( hypre_ParCSRMatrix *A, const char *file_name ); +HYPRE_Int hypre_ParCSRCommPkgCreateApart_core ( MPI_Comm comm, HYPRE_BigInt *col_map_off_d, + HYPRE_BigInt first_col_diag, HYPRE_Int num_cols_off_d, HYPRE_BigInt global_num_cols, + HYPRE_Int *p_num_recvs, HYPRE_Int **p_recv_procs, HYPRE_Int **p_recv_vec_starts, + HYPRE_Int *p_num_sends, HYPRE_Int **p_send_procs, HYPRE_Int **p_send_map_starts, + HYPRE_Int **p_send_map_elements, hypre_IJAssumedPart *apart ); +HYPRE_Int hypre_ParCSRCommPkgCreateApart ( MPI_Comm comm, HYPRE_BigInt *col_map_off_d, + HYPRE_BigInt first_col_diag, HYPRE_Int num_cols_off_d, HYPRE_BigInt global_num_cols, + hypre_IJAssumedPart *apart, hypre_ParCSRCommPkg *comm_pkg ); HYPRE_Int hypre_NewCommPkgDestroy ( hypre_ParCSRMatrix *parcsr_A ); -HYPRE_Int hypre_RangeFillResponseIJDetermineRecvProcs ( void *p_recv_contact_buf , HYPRE_Int contact_size , HYPRE_Int contact_proc , void *ro , MPI_Comm comm , void **p_send_response_buf , HYPRE_Int *response_message_size ); -HYPRE_Int hypre_FillResponseIJDetermineSendProcs ( void *p_recv_contact_buf , HYPRE_Int contact_size , HYPRE_Int contact_proc , void *ro , MPI_Comm comm , void **p_send_response_buf , HYPRE_Int *response_message_size ); +HYPRE_Int hypre_RangeFillResponseIJDetermineRecvProcs ( void *p_recv_contact_buf, + HYPRE_Int contact_size, HYPRE_Int contact_proc, void *ro, MPI_Comm comm, void **p_send_response_buf, + HYPRE_Int *response_message_size ); +HYPRE_Int hypre_FillResponseIJDetermineSendProcs ( void *p_recv_contact_buf, HYPRE_Int contact_size, + HYPRE_Int contact_proc, void *ro, MPI_Comm comm, void **p_send_response_buf, + HYPRE_Int *response_message_size ); /* numbers.c */ hypre_NumbersNode *hypre_NumbersNewNode ( void ); void hypre_NumbersDeleteNode ( hypre_NumbersNode *node ); -HYPRE_Int hypre_NumbersEnter ( hypre_NumbersNode *node , const HYPRE_Int n ); +HYPRE_Int hypre_NumbersEnter ( hypre_NumbersNode *node, const HYPRE_Int n ); HYPRE_Int hypre_NumbersNEntered ( hypre_NumbersNode *node ); -HYPRE_Int hypre_NumbersQuery ( hypre_NumbersNode *node , const HYPRE_Int n ); +HYPRE_Int hypre_NumbersQuery ( hypre_NumbersNode *node, const HYPRE_Int n ); HYPRE_Int *hypre_NumbersArray ( hypre_NumbersNode *node ); /* parchord_to_parcsr.c */ -void hypre_ParChordMatrix_RowStarts ( hypre_ParChordMatrix *Ac , MPI_Comm comm , HYPRE_BigInt **row_starts , HYPRE_BigInt *global_num_cols ); -HYPRE_Int hypre_ParChordMatrixToParCSRMatrix ( hypre_ParChordMatrix *Ac , MPI_Comm comm , hypre_ParCSRMatrix **pAp ); -HYPRE_Int hypre_ParCSRMatrixToParChordMatrix ( hypre_ParCSRMatrix *Ap , MPI_Comm comm , hypre_ParChordMatrix **pAc ); +void hypre_ParChordMatrix_RowStarts ( hypre_ParChordMatrix *Ac, MPI_Comm comm, + HYPRE_BigInt **row_starts, HYPRE_BigInt *global_num_cols ); +HYPRE_Int hypre_ParChordMatrixToParCSRMatrix ( hypre_ParChordMatrix *Ac, MPI_Comm comm, + hypre_ParCSRMatrix **pAp ); +HYPRE_Int hypre_ParCSRMatrixToParChordMatrix ( hypre_ParCSRMatrix *Ap, MPI_Comm comm, + hypre_ParChordMatrix **pAc ); /* par_csr_aat.c */ -void hypre_ParAat_RowSizes ( HYPRE_Int **C_diag_i , HYPRE_Int **C_offd_i , HYPRE_Int *B_marker , HYPRE_Int *A_diag_i , HYPRE_Int *A_diag_j , HYPRE_Int *A_offd_i , HYPRE_Int *A_offd_j , HYPRE_BigInt *A_col_map_offd , HYPRE_Int *A_ext_i , HYPRE_BigInt *A_ext_j , HYPRE_BigInt *A_ext_row_map , HYPRE_Int *C_diag_size , HYPRE_Int *C_offd_size , HYPRE_Int num_rows_diag_A , HYPRE_Int num_cols_offd_A , HYPRE_Int num_rows_A_ext , HYPRE_BigInt first_col_diag_A , HYPRE_BigInt first_row_index_A ); +void hypre_ParAat_RowSizes ( HYPRE_Int **C_diag_i, HYPRE_Int **C_offd_i, HYPRE_Int *B_marker, + HYPRE_Int *A_diag_i, HYPRE_Int *A_diag_j, HYPRE_Int *A_offd_i, HYPRE_Int *A_offd_j, + HYPRE_BigInt *A_col_map_offd, HYPRE_Int *A_ext_i, HYPRE_BigInt *A_ext_j, + HYPRE_BigInt *A_ext_row_map, HYPRE_Int *C_diag_size, HYPRE_Int *C_offd_size, + HYPRE_Int num_rows_diag_A, HYPRE_Int num_cols_offd_A, HYPRE_Int num_rows_A_ext, + HYPRE_BigInt first_col_diag_A, HYPRE_BigInt first_row_index_A ); hypre_ParCSRMatrix *hypre_ParCSRAAt ( hypre_ParCSRMatrix *A ); -hypre_CSRMatrix *hypre_ParCSRMatrixExtractAExt ( hypre_ParCSRMatrix *A , HYPRE_Int data , HYPRE_BigInt **pA_ext_row_map ); +hypre_CSRMatrix *hypre_ParCSRMatrixExtractAExt ( hypre_ParCSRMatrix *A, HYPRE_Int data, + HYPRE_BigInt **pA_ext_row_map ); /* par_csr_assumed_part.c */ -HYPRE_Int hypre_LocateAssumedPartition ( MPI_Comm comm , HYPRE_BigInt row_start , HYPRE_BigInt row_end , HYPRE_BigInt global_first_row , HYPRE_BigInt global_num_rows , hypre_IJAssumedPart *part , HYPRE_Int myid ); -hypre_IJAssumedPart *hypre_AssumedPartitionCreate ( MPI_Comm comm , HYPRE_BigInt global_num , HYPRE_BigInt start , HYPRE_BigInt end ); +HYPRE_Int hypre_LocateAssumedPartition ( MPI_Comm comm, HYPRE_BigInt row_start, + HYPRE_BigInt row_end, HYPRE_BigInt global_first_row, HYPRE_BigInt global_num_rows, + hypre_IJAssumedPart *part, HYPRE_Int myid ); +hypre_IJAssumedPart *hypre_AssumedPartitionCreate ( MPI_Comm comm, HYPRE_BigInt global_num, + HYPRE_BigInt start, HYPRE_BigInt end ); HYPRE_Int hypre_ParCSRMatrixCreateAssumedPartition ( hypre_ParCSRMatrix *matrix ); HYPRE_Int hypre_AssumedPartitionDestroy ( hypre_IJAssumedPart *apart ); -HYPRE_Int hypre_GetAssumedPartitionProcFromRow ( MPI_Comm comm , HYPRE_BigInt row , HYPRE_BigInt global_first_row , HYPRE_BigInt global_num_rows , HYPRE_Int *proc_id ); -HYPRE_Int hypre_GetAssumedPartitionRowRange ( MPI_Comm comm , HYPRE_Int proc_id , HYPRE_BigInt global_first_row , HYPRE_BigInt global_num_rows , HYPRE_BigInt *row_start , HYPRE_BigInt *row_end ); +HYPRE_Int hypre_GetAssumedPartitionProcFromRow ( MPI_Comm comm, HYPRE_BigInt row, + HYPRE_BigInt global_first_row, HYPRE_BigInt global_num_rows, HYPRE_Int *proc_id ); +HYPRE_Int hypre_GetAssumedPartitionRowRange ( MPI_Comm comm, HYPRE_Int proc_id, + HYPRE_BigInt global_first_row, HYPRE_BigInt global_num_rows, HYPRE_BigInt *row_start, + HYPRE_BigInt *row_end ); HYPRE_Int hypre_ParVectorCreateAssumedPartition ( hypre_ParVector *vector ); /* par_csr_bool_matop.c */ -hypre_ParCSRBooleanMatrix *hypre_ParBooleanMatmul ( hypre_ParCSRBooleanMatrix *A , hypre_ParCSRBooleanMatrix *B ); -hypre_CSRBooleanMatrix *hypre_ParCSRBooleanMatrixExtractBExt ( hypre_ParCSRBooleanMatrix *B , hypre_ParCSRBooleanMatrix *A ); -hypre_CSRBooleanMatrix *hypre_ParCSRBooleanMatrixExtractAExt ( hypre_ParCSRBooleanMatrix *A , HYPRE_BigInt **pA_ext_row_map ); +hypre_ParCSRBooleanMatrix *hypre_ParBooleanMatmul ( hypre_ParCSRBooleanMatrix *A, + hypre_ParCSRBooleanMatrix *B ); +hypre_CSRBooleanMatrix *hypre_ParCSRBooleanMatrixExtractBExt ( hypre_ParCSRBooleanMatrix *B, + hypre_ParCSRBooleanMatrix *A ); +hypre_CSRBooleanMatrix *hypre_ParCSRBooleanMatrixExtractAExt ( hypre_ParCSRBooleanMatrix *A, + HYPRE_BigInt **pA_ext_row_map ); hypre_ParCSRBooleanMatrix *hypre_ParBooleanAAt ( hypre_ParCSRBooleanMatrix *A ); HYPRE_Int hypre_BooleanMatTCommPkgCreate ( hypre_ParCSRBooleanMatrix *A ); HYPRE_Int hypre_BooleanMatvecCommPkgCreate ( hypre_ParCSRBooleanMatrix *A ); /* par_csr_bool_matrix.c */ -hypre_CSRBooleanMatrix *hypre_CSRBooleanMatrixCreate ( HYPRE_Int num_rows , HYPRE_Int num_cols , HYPRE_Int num_nonzeros ); +hypre_CSRBooleanMatrix *hypre_CSRBooleanMatrixCreate ( HYPRE_Int num_rows, HYPRE_Int num_cols, + HYPRE_Int num_nonzeros ); HYPRE_Int hypre_CSRBooleanMatrixDestroy ( hypre_CSRBooleanMatrix *matrix ); HYPRE_Int hypre_CSRBooleanMatrixInitialize ( hypre_CSRBooleanMatrix *matrix ); HYPRE_Int hypre_CSRBooleanMatrixBigInitialize ( hypre_CSRBooleanMatrix *matrix ); -HYPRE_Int hypre_CSRBooleanMatrixSetDataOwner ( hypre_CSRBooleanMatrix *matrix , HYPRE_Int owns_data ); -HYPRE_Int hypre_CSRBooleanMatrixSetBigDataOwner ( hypre_CSRBooleanMatrix *matrix , HYPRE_Int owns_data ); +HYPRE_Int hypre_CSRBooleanMatrixSetDataOwner ( hypre_CSRBooleanMatrix *matrix, + HYPRE_Int owns_data ); +HYPRE_Int hypre_CSRBooleanMatrixSetBigDataOwner ( hypre_CSRBooleanMatrix *matrix, + HYPRE_Int owns_data ); hypre_CSRBooleanMatrix *hypre_CSRBooleanMatrixRead ( const char *file_name ); -HYPRE_Int hypre_CSRBooleanMatrixPrint ( hypre_CSRBooleanMatrix *matrix , const char *file_name ); -hypre_ParCSRBooleanMatrix *hypre_ParCSRBooleanMatrixCreate ( MPI_Comm comm , HYPRE_BigInt global_num_rows , HYPRE_BigInt global_num_cols , HYPRE_BigInt *row_starts , HYPRE_BigInt *col_starts , HYPRE_Int num_cols_offd , HYPRE_Int num_nonzeros_diag , HYPRE_Int num_nonzeros_offd ); +HYPRE_Int hypre_CSRBooleanMatrixPrint ( hypre_CSRBooleanMatrix *matrix, const char *file_name ); +hypre_ParCSRBooleanMatrix *hypre_ParCSRBooleanMatrixCreate ( MPI_Comm comm, + HYPRE_BigInt global_num_rows, HYPRE_BigInt global_num_cols, HYPRE_BigInt *row_starts, + HYPRE_BigInt *col_starts, HYPRE_Int num_cols_offd, HYPRE_Int num_nonzeros_diag, + HYPRE_Int num_nonzeros_offd ); HYPRE_Int hypre_ParCSRBooleanMatrixDestroy ( hypre_ParCSRBooleanMatrix *matrix ); HYPRE_Int hypre_ParCSRBooleanMatrixInitialize ( hypre_ParCSRBooleanMatrix *matrix ); HYPRE_Int hypre_ParCSRBooleanMatrixSetNNZ ( hypre_ParCSRBooleanMatrix *matrix ); -HYPRE_Int hypre_ParCSRBooleanMatrixSetDataOwner ( hypre_ParCSRBooleanMatrix *matrix , HYPRE_Int owns_data ); -HYPRE_Int hypre_ParCSRBooleanMatrixSetRowStartsOwner ( hypre_ParCSRBooleanMatrix *matrix , HYPRE_Int owns_row_starts ); -HYPRE_Int hypre_ParCSRBooleanMatrixSetColStartsOwner ( hypre_ParCSRBooleanMatrix *matrix , HYPRE_Int owns_col_starts ); -hypre_ParCSRBooleanMatrix *hypre_ParCSRBooleanMatrixRead ( MPI_Comm comm , const char *file_name ); -HYPRE_Int hypre_ParCSRBooleanMatrixPrint ( hypre_ParCSRBooleanMatrix *matrix , const char *file_name ); -HYPRE_Int hypre_ParCSRBooleanMatrixPrintIJ ( hypre_ParCSRBooleanMatrix *matrix , const char *filename ); -HYPRE_Int hypre_ParCSRBooleanMatrixGetLocalRange ( hypre_ParCSRBooleanMatrix *matrix , HYPRE_BigInt *row_start , HYPRE_BigInt *row_end , HYPRE_BigInt *col_start , HYPRE_BigInt *col_end ); -HYPRE_Int hypre_ParCSRBooleanMatrixGetRow ( hypre_ParCSRBooleanMatrix *mat , HYPRE_BigInt row , HYPRE_Int *size , HYPRE_BigInt **col_ind ); -HYPRE_Int hypre_ParCSRBooleanMatrixRestoreRow ( hypre_ParCSRBooleanMatrix *matrix , HYPRE_BigInt row , HYPRE_Int *size , HYPRE_BigInt **col_ind ); -HYPRE_Int hypre_BuildCSRBooleanMatrixMPIDataType ( HYPRE_Int num_nonzeros , HYPRE_Int num_rows , HYPRE_Int *a_i , HYPRE_Int *a_j , hypre_MPI_Datatype *csr_matrix_datatype ); -hypre_ParCSRBooleanMatrix *hypre_CSRBooleanMatrixToParCSRBooleanMatrix ( MPI_Comm comm , hypre_CSRBooleanMatrix *A , HYPRE_BigInt *row_starts , HYPRE_BigInt *col_starts ); -HYPRE_Int hypre_BooleanGenerateDiagAndOffd ( hypre_CSRBooleanMatrix *A , hypre_ParCSRBooleanMatrix *matrix , HYPRE_BigInt first_col_diag , HYPRE_BigInt last_col_diag ); +HYPRE_Int hypre_ParCSRBooleanMatrixSetDataOwner ( hypre_ParCSRBooleanMatrix *matrix, + HYPRE_Int owns_data ); +HYPRE_Int hypre_ParCSRBooleanMatrixSetRowStartsOwner ( hypre_ParCSRBooleanMatrix *matrix, + HYPRE_Int owns_row_starts ); +HYPRE_Int hypre_ParCSRBooleanMatrixSetColStartsOwner ( hypre_ParCSRBooleanMatrix *matrix, + HYPRE_Int owns_col_starts ); +hypre_ParCSRBooleanMatrix *hypre_ParCSRBooleanMatrixRead ( MPI_Comm comm, const char *file_name ); +HYPRE_Int hypre_ParCSRBooleanMatrixPrint ( hypre_ParCSRBooleanMatrix *matrix, + const char *file_name ); +HYPRE_Int hypre_ParCSRBooleanMatrixPrintIJ ( hypre_ParCSRBooleanMatrix *matrix, + const char *filename ); +HYPRE_Int hypre_ParCSRBooleanMatrixGetLocalRange ( hypre_ParCSRBooleanMatrix *matrix, + HYPRE_BigInt *row_start, HYPRE_BigInt *row_end, HYPRE_BigInt *col_start, HYPRE_BigInt *col_end ); +HYPRE_Int hypre_ParCSRBooleanMatrixGetRow ( hypre_ParCSRBooleanMatrix *mat, HYPRE_BigInt row, + HYPRE_Int *size, HYPRE_BigInt **col_ind ); +HYPRE_Int hypre_ParCSRBooleanMatrixRestoreRow ( hypre_ParCSRBooleanMatrix *matrix, HYPRE_BigInt row, + HYPRE_Int *size, HYPRE_BigInt **col_ind ); +HYPRE_Int hypre_BuildCSRBooleanMatrixMPIDataType ( HYPRE_Int num_nonzeros, HYPRE_Int num_rows, + HYPRE_Int *a_i, HYPRE_Int *a_j, hypre_MPI_Datatype *csr_matrix_datatype ); +hypre_ParCSRBooleanMatrix *hypre_CSRBooleanMatrixToParCSRBooleanMatrix ( MPI_Comm comm, + hypre_CSRBooleanMatrix *A, HYPRE_BigInt *row_starts, HYPRE_BigInt *col_starts ); +HYPRE_Int hypre_BooleanGenerateDiagAndOffd ( hypre_CSRBooleanMatrix *A, + hypre_ParCSRBooleanMatrix *matrix, HYPRE_BigInt first_col_diag, HYPRE_BigInt last_col_diag ); /* par_csr_communication.c */ -hypre_ParCSRCommHandle *hypre_ParCSRCommHandleCreate ( HYPRE_Int job , hypre_ParCSRCommPkg *comm_pkg , void *send_data , void *recv_data ); -hypre_ParCSRCommHandle *hypre_ParCSRCommHandleCreate_v2 ( HYPRE_Int job, hypre_ParCSRCommPkg *comm_pkg, HYPRE_MemoryLocation send_memory_location, void *send_data_in, HYPRE_MemoryLocation recv_memory_location, void *recv_data_in ); +hypre_ParCSRCommHandle *hypre_ParCSRCommHandleCreate ( HYPRE_Int job, hypre_ParCSRCommPkg *comm_pkg, + void *send_data, void *recv_data ); +hypre_ParCSRCommHandle *hypre_ParCSRCommHandleCreate_v2 ( HYPRE_Int job, + hypre_ParCSRCommPkg *comm_pkg, + HYPRE_MemoryLocation send_memory_location, + void *send_data_in, + HYPRE_MemoryLocation recv_memory_location, + void *recv_data_in ); HYPRE_Int hypre_ParCSRCommHandleDestroy ( hypre_ParCSRCommHandle *comm_handle ); -void hypre_ParCSRCommPkgCreate_core ( MPI_Comm comm , HYPRE_BigInt *col_map_offd , HYPRE_BigInt first_col_diag , HYPRE_BigInt *col_starts , HYPRE_Int num_cols_diag , HYPRE_Int num_cols_offd , HYPRE_Int *p_num_recvs , HYPRE_Int **p_recv_procs , HYPRE_Int **p_recv_vec_starts , HYPRE_Int *p_num_sends , HYPRE_Int **p_send_procs , HYPRE_Int **p_send_map_starts , HYPRE_Int **p_send_map_elmts ); -HYPRE_Int -hypre_ParCSRCommPkgCreate(MPI_Comm comm, HYPRE_BigInt *col_map_offd, HYPRE_BigInt first_col_diag, HYPRE_BigInt *col_starts, HYPRE_Int num_cols_diag, HYPRE_Int num_cols_offd, hypre_ParCSRCommPkg *comm_pkg); +void hypre_ParCSRCommPkgCreate_core ( MPI_Comm comm, HYPRE_BigInt *col_map_offd, + HYPRE_BigInt first_col_diag, HYPRE_BigInt *col_starts, HYPRE_Int num_cols_diag, + HYPRE_Int num_cols_offd, HYPRE_Int *p_num_recvs, HYPRE_Int **p_recv_procs, + HYPRE_Int **p_recv_vec_starts, HYPRE_Int *p_num_sends, HYPRE_Int **p_send_procs, + HYPRE_Int **p_send_map_starts, HYPRE_Int **p_send_map_elmts ); +HYPRE_Int hypre_ParCSRCommPkgCreate(MPI_Comm comm, HYPRE_BigInt *col_map_offd, + HYPRE_BigInt first_col_diag, HYPRE_BigInt *col_starts, + HYPRE_Int num_cols_diag, HYPRE_Int num_cols_offd, + hypre_ParCSRCommPkg *comm_pkg); +HYPRE_Int hypre_ParCSRCommPkgCreateAndFill ( MPI_Comm comm, HYPRE_Int num_recvs, + HYPRE_Int *recv_procs, HYPRE_Int *recv_vec_starts, + HYPRE_Int num_sends, HYPRE_Int *send_procs, + HYPRE_Int *send_map_starts, HYPRE_Int *send_map_elmts, + hypre_ParCSRCommPkg **comm_pkg_ptr ); +HYPRE_Int hypre_ParCSRCommPkgUpdateVecStarts ( hypre_ParCSRCommPkg *comm_pkg, + HYPRE_Int num_components_in, + HYPRE_Int vecstride, HYPRE_Int idxstride ); HYPRE_Int hypre_MatvecCommPkgCreate ( hypre_ParCSRMatrix *A ); HYPRE_Int hypre_MatvecCommPkgDestroy ( hypre_ParCSRCommPkg *comm_pkg ); -HYPRE_Int hypre_BuildCSRMatrixMPIDataType ( HYPRE_Int num_nonzeros , HYPRE_Int num_rows , HYPRE_Complex *a_data , HYPRE_Int *a_i , HYPRE_Int *a_j , hypre_MPI_Datatype *csr_matrix_datatype ); -HYPRE_Int hypre_BuildCSRJDataType ( HYPRE_Int num_nonzeros , HYPRE_Complex *a_data , HYPRE_Int *a_j , hypre_MPI_Datatype *csr_jdata_datatype ); -HYPRE_Int hypre_ParCSRFindExtendCommPkg(MPI_Comm comm, HYPRE_BigInt global_num_cols, HYPRE_BigInt first_col_diag, HYPRE_Int num_cols_diag, HYPRE_BigInt *col_starts, hypre_IJAssumedPart *apart, HYPRE_Int indices_len, HYPRE_BigInt *indices, hypre_ParCSRCommPkg **extend_comm_pkg); +HYPRE_Int hypre_BuildCSRMatrixMPIDataType ( HYPRE_Int num_nonzeros, HYPRE_Int num_rows, + HYPRE_Complex *a_data, HYPRE_Int *a_i, HYPRE_Int *a_j, + hypre_MPI_Datatype *csr_matrix_datatype ); +HYPRE_Int hypre_BuildCSRJDataType ( HYPRE_Int num_nonzeros, HYPRE_Complex *a_data, HYPRE_Int *a_j, + hypre_MPI_Datatype *csr_jdata_datatype ); +HYPRE_Int hypre_ParCSRFindExtendCommPkg(MPI_Comm comm, HYPRE_BigInt global_num_cols, + HYPRE_BigInt first_col_diag, HYPRE_Int num_cols_diag, HYPRE_BigInt *col_starts, + hypre_IJAssumedPart *apart, HYPRE_Int indices_len, HYPRE_BigInt *indices, + hypre_ParCSRCommPkg **extend_comm_pkg); + +/* par_csr_filter.c */ +HYPRE_Int hypre_ParCSRMatrixBlkFilter(hypre_ParCSRMatrix *A, + HYPRE_Int block_size, hypre_ParCSRMatrix **B_ptr); /* par_csr_matop.c */ HYPRE_Int hypre_ParCSRMatrixScale(hypre_ParCSRMatrix *A, HYPRE_Complex scalar); -void hypre_ParMatmul_RowSizes ( HYPRE_MemoryLocation memory_location , HYPRE_Int **C_diag_i , HYPRE_Int **C_offd_i , HYPRE_Int *rownnz_A , HYPRE_Int *A_diag_i , HYPRE_Int *A_diag_j , HYPRE_Int *A_offd_i , HYPRE_Int *A_offd_j , HYPRE_Int *B_diag_i , HYPRE_Int *B_diag_j , HYPRE_Int *B_offd_i , HYPRE_Int *B_offd_j , HYPRE_Int *B_ext_diag_i , HYPRE_Int *B_ext_diag_j , HYPRE_Int *B_ext_offd_i , HYPRE_Int *B_ext_offd_j , HYPRE_Int *map_B_to_C , HYPRE_Int *C_diag_size , HYPRE_Int *C_offd_size , HYPRE_Int num_rownnz_A , HYPRE_Int num_rows_diag_A , HYPRE_Int num_cols_offd_A , HYPRE_Int allsquare , HYPRE_Int num_cols_diag_B , HYPRE_Int num_cols_offd_B , HYPRE_Int num_cols_offd_C ); -hypre_ParCSRMatrix *hypre_ParMatmul ( hypre_ParCSRMatrix *A , hypre_ParCSRMatrix *B ); -void hypre_ParCSRMatrixExtractBExt_Arrays ( HYPRE_Int **pB_ext_i , HYPRE_BigInt **pB_ext_j , HYPRE_Complex **pB_ext_data , HYPRE_BigInt **pB_ext_row_map , HYPRE_Int *num_nonzeros , HYPRE_Int data , HYPRE_Int find_row_map , MPI_Comm comm , hypre_ParCSRCommPkg *comm_pkg , HYPRE_Int num_cols_B , HYPRE_Int num_recvs , HYPRE_Int num_sends , HYPRE_BigInt first_col_diag , HYPRE_BigInt *row_starts , HYPRE_Int *recv_vec_starts , HYPRE_Int *send_map_starts , HYPRE_Int *send_map_elmts , HYPRE_Int *diag_i , HYPRE_Int *diag_j , HYPRE_Int *offd_i , HYPRE_Int *offd_j , HYPRE_BigInt *col_map_offd , HYPRE_Real *diag_data , HYPRE_Real *offd_data ); -void hypre_ParCSRMatrixExtractBExt_Arrays_Overlap ( HYPRE_Int **pB_ext_i , HYPRE_BigInt **pB_ext_j , HYPRE_Complex **pB_ext_data , HYPRE_BigInt **pB_ext_row_map , HYPRE_Int *num_nonzeros , HYPRE_Int data , HYPRE_Int find_row_map , MPI_Comm comm , hypre_ParCSRCommPkg *comm_pkg , HYPRE_Int num_cols_B , HYPRE_Int num_recvs , HYPRE_Int num_sends , HYPRE_BigInt first_col_diag , HYPRE_BigInt *row_starts , HYPRE_Int *recv_vec_starts , HYPRE_Int *send_map_starts , HYPRE_Int *send_map_elmts , HYPRE_Int *diag_i , HYPRE_Int *diag_j , HYPRE_Int *offd_i , HYPRE_Int *offd_j , HYPRE_BigInt *col_map_offd , HYPRE_Real *diag_data , HYPRE_Real *offd_data, hypre_ParCSRCommHandle **comm_handle_idx, hypre_ParCSRCommHandle **comm_handle_data, HYPRE_Int *CF_marker, HYPRE_Int *CF_marker_offd, HYPRE_Int skip_fine, HYPRE_Int skip_same_sign ); -hypre_CSRMatrix *hypre_ParCSRMatrixExtractBExt ( hypre_ParCSRMatrix *B , hypre_ParCSRMatrix *A , HYPRE_Int data ); -hypre_CSRMatrix *hypre_ParCSRMatrixExtractBExt_Overlap ( hypre_ParCSRMatrix *B , hypre_ParCSRMatrix *A , HYPRE_Int data, hypre_ParCSRCommHandle **comm_handle_idx, hypre_ParCSRCommHandle **comm_handle_data, HYPRE_Int *CF_marker, HYPRE_Int *CF_marker_offd, HYPRE_Int skip_fine, HYPRE_Int skip_same_sign ); -HYPRE_Int hypre_ParCSRMatrixExtractBExtDeviceInit( hypre_ParCSRMatrix *B, hypre_ParCSRMatrix *A, HYPRE_Int want_data, void **request_ptr); +void hypre_ParMatmul_RowSizes ( HYPRE_MemoryLocation memory_location, HYPRE_Int **C_diag_i, + HYPRE_Int **C_offd_i, HYPRE_Int *rownnz_A, HYPRE_Int *A_diag_i, HYPRE_Int *A_diag_j, + HYPRE_Int *A_offd_i, HYPRE_Int *A_offd_j, HYPRE_Int *B_diag_i, HYPRE_Int *B_diag_j, + HYPRE_Int *B_offd_i, HYPRE_Int *B_offd_j, HYPRE_Int *B_ext_diag_i, HYPRE_Int *B_ext_diag_j, + HYPRE_Int *B_ext_offd_i, HYPRE_Int *B_ext_offd_j, HYPRE_Int *map_B_to_C, HYPRE_Int *C_diag_size, + HYPRE_Int *C_offd_size, HYPRE_Int num_rownnz_A, HYPRE_Int num_rows_diag_A, + HYPRE_Int num_cols_offd_A, HYPRE_Int allsquare, HYPRE_Int num_cols_diag_B, + HYPRE_Int num_cols_offd_B, HYPRE_Int num_cols_offd_C ); +hypre_ParCSRMatrix *hypre_ParMatmul ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B ); +void hypre_ParCSRMatrixExtractBExt_Arrays ( HYPRE_Int **pB_ext_i, HYPRE_BigInt **pB_ext_j, + HYPRE_Complex **pB_ext_data, HYPRE_BigInt **pB_ext_row_map, HYPRE_Int *num_nonzeros, HYPRE_Int data, + HYPRE_Int find_row_map, MPI_Comm comm, hypre_ParCSRCommPkg *comm_pkg, HYPRE_Int num_cols_B, + HYPRE_Int num_recvs, HYPRE_Int num_sends, HYPRE_BigInt first_col_diag, HYPRE_BigInt *row_starts, + HYPRE_Int *recv_vec_starts, HYPRE_Int *send_map_starts, HYPRE_Int *send_map_elmts, + HYPRE_Int *diag_i, HYPRE_Int *diag_j, HYPRE_Int *offd_i, HYPRE_Int *offd_j, + HYPRE_BigInt *col_map_offd, HYPRE_Real *diag_data, HYPRE_Real *offd_data ); +void hypre_ParCSRMatrixExtractBExt_Arrays_Overlap ( HYPRE_Int **pB_ext_i, HYPRE_BigInt **pB_ext_j, + HYPRE_Complex **pB_ext_data, HYPRE_BigInt **pB_ext_row_map, HYPRE_Int *num_nonzeros, HYPRE_Int data, + HYPRE_Int find_row_map, MPI_Comm comm, hypre_ParCSRCommPkg *comm_pkg, HYPRE_Int num_cols_B, + HYPRE_Int num_recvs, HYPRE_Int num_sends, HYPRE_BigInt first_col_diag, HYPRE_BigInt *row_starts, + HYPRE_Int *recv_vec_starts, HYPRE_Int *send_map_starts, HYPRE_Int *send_map_elmts, + HYPRE_Int *diag_i, HYPRE_Int *diag_j, HYPRE_Int *offd_i, HYPRE_Int *offd_j, + HYPRE_BigInt *col_map_offd, HYPRE_Real *diag_data, HYPRE_Real *offd_data, + hypre_ParCSRCommHandle **comm_handle_idx, hypre_ParCSRCommHandle **comm_handle_data, + HYPRE_Int *CF_marker, HYPRE_Int *CF_marker_offd, HYPRE_Int skip_fine, HYPRE_Int skip_same_sign ); +hypre_CSRMatrix *hypre_ParCSRMatrixExtractBExt ( hypre_ParCSRMatrix *B, hypre_ParCSRMatrix *A, + HYPRE_Int data ); +hypre_CSRMatrix *hypre_ParCSRMatrixExtractBExt_Overlap ( hypre_ParCSRMatrix *B, + hypre_ParCSRMatrix *A, HYPRE_Int data, hypre_ParCSRCommHandle **comm_handle_idx, + hypre_ParCSRCommHandle **comm_handle_data, HYPRE_Int *CF_marker, HYPRE_Int *CF_marker_offd, + HYPRE_Int skip_fine, HYPRE_Int skip_same_sign ); +HYPRE_Int hypre_ParCSRMatrixExtractBExtDeviceInit( hypre_ParCSRMatrix *B, hypre_ParCSRMatrix *A, + HYPRE_Int want_data, void **request_ptr); hypre_CSRMatrix* hypre_ParCSRMatrixExtractBExtDeviceWait(void *request); -hypre_CSRMatrix* hypre_ParCSRMatrixExtractBExtDevice( hypre_ParCSRMatrix *B, hypre_ParCSRMatrix *A, HYPRE_Int want_data ); -HYPRE_Int hypre_ParCSRMatrixTranspose ( hypre_ParCSRMatrix *A , hypre_ParCSRMatrix **AT_ptr , HYPRE_Int data ); -HYPRE_Int hypre_ParCSRMatrixTransposeHost ( hypre_ParCSRMatrix *A , hypre_ParCSRMatrix **AT_ptr , HYPRE_Int data ); -HYPRE_Int hypre_ParCSRMatrixTransposeDevice ( hypre_ParCSRMatrix *A , hypre_ParCSRMatrix **AT_ptr , HYPRE_Int data ); -void hypre_ParCSRMatrixGenSpanningTree ( hypre_ParCSRMatrix *G_csr , HYPRE_Int **indices , HYPRE_Int G_type ); -void hypre_ParCSRMatrixExtractSubmatrices ( hypre_ParCSRMatrix *A_csr , HYPRE_Int *indices2 , hypre_ParCSRMatrix ***submatrices ); -void hypre_ParCSRMatrixExtractRowSubmatrices ( hypre_ParCSRMatrix *A_csr , HYPRE_Int *indices2 , hypre_ParCSRMatrix ***submatrices ); +hypre_CSRMatrix* hypre_ParCSRMatrixExtractBExtDevice( hypre_ParCSRMatrix *B, hypre_ParCSRMatrix *A, + HYPRE_Int want_data ); +HYPRE_Int hypre_ParCSRMatrixLocalTranspose( hypre_ParCSRMatrix *A ); +HYPRE_Int hypre_ParCSRMatrixTranspose ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **AT_ptr, + HYPRE_Int data ); +HYPRE_Int hypre_ParCSRMatrixTransposeHost ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **AT_ptr, + HYPRE_Int data ); +HYPRE_Int hypre_ParCSRMatrixTransposeDevice ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **AT_ptr, + HYPRE_Int data ); +void hypre_ParCSRMatrixGenSpanningTree ( hypre_ParCSRMatrix *G_csr, HYPRE_Int **indices, + HYPRE_Int G_type ); +void hypre_ParCSRMatrixExtractSubmatrices ( hypre_ParCSRMatrix *A_csr, HYPRE_Int *indices2, + hypre_ParCSRMatrix ***submatrices ); +void hypre_ParCSRMatrixExtractRowSubmatrices ( hypre_ParCSRMatrix *A_csr, HYPRE_Int *indices2, + hypre_ParCSRMatrix ***submatrices ); HYPRE_Complex hypre_ParCSRMatrixLocalSumElts ( hypre_ParCSRMatrix *A ); -HYPRE_Int hypre_ParCSRMatrixAminvDB ( hypre_ParCSRMatrix *A , hypre_ParCSRMatrix *B , HYPRE_Complex *d , hypre_ParCSRMatrix **C_ptr ); -hypre_ParCSRMatrix *hypre_ParTMatmul ( hypre_ParCSRMatrix *A , hypre_ParCSRMatrix *B ); +HYPRE_Int hypre_ParCSRMatrixAminvDB ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B, + HYPRE_Complex *d, hypre_ParCSRMatrix **C_ptr ); +hypre_ParCSRMatrix *hypre_ParTMatmul ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B ); HYPRE_Real hypre_ParCSRMatrixFnorm( hypre_ParCSRMatrix *A ); -HYPRE_Int hypre_ParCSRMatrixInfNorm ( hypre_ParCSRMatrix *A , HYPRE_Real *norm ); -HYPRE_Int hypre_ExchangeExternalRowsInit( hypre_CSRMatrix *B_ext, hypre_ParCSRCommPkg *comm_pkg_A, void **request_ptr); +HYPRE_Int hypre_ParCSRMatrixInfNorm ( hypre_ParCSRMatrix *A, HYPRE_Real *norm ); +HYPRE_Int hypre_ExchangeExternalRowsInit( hypre_CSRMatrix *B_ext, hypre_ParCSRCommPkg *comm_pkg_A, + void **request_ptr); hypre_CSRMatrix* hypre_ExchangeExternalRowsWait(void *vequest); -HYPRE_Int hypre_ExchangeExternalRowsDeviceInit( hypre_CSRMatrix *B_ext, hypre_ParCSRCommPkg *comm_pkg_A, HYPRE_Int want_data, void **request_ptr); +HYPRE_Int hypre_ExchangeExternalRowsDeviceInit( hypre_CSRMatrix *B_ext, + hypre_ParCSRCommPkg *comm_pkg_A, HYPRE_Int want_data, void **request_ptr); hypre_CSRMatrix* hypre_ExchangeExternalRowsDeviceWait(void *vrequest); -HYPRE_Int hypre_ParCSRMatrixGenerateFFFCDevice( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker_host, HYPRE_BigInt *cpts_starts, hypre_ParCSRMatrix *S, hypre_ParCSRMatrix **A_FC_ptr, hypre_ParCSRMatrix **A_FF_ptr ); -HYPRE_Int hypre_ParCSRMatrixGenerateFFCFDevice( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker_host, HYPRE_BigInt *cpts_starts, hypre_ParCSRMatrix *S, hypre_ParCSRMatrix **A_CF_ptr, hypre_ParCSRMatrix **A_FF_ptr ); +HYPRE_Int hypre_ParCSRMatrixGenerateFFFCDevice( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + HYPRE_BigInt *cpts_starts, hypre_ParCSRMatrix *S, + hypre_ParCSRMatrix **A_FC_ptr, + hypre_ParCSRMatrix **A_FF_ptr ); +HYPRE_Int hypre_ParCSRMatrixGenerateFFCFDevice( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + HYPRE_BigInt *cpts_starts, hypre_ParCSRMatrix *S, + hypre_ParCSRMatrix **A_CF_ptr, + hypre_ParCSRMatrix **A_FF_ptr ); +HYPRE_Int hypre_ParCSRMatrixGenerateCCCFDevice( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + HYPRE_BigInt *cpts_starts, hypre_ParCSRMatrix *S, + hypre_ParCSRMatrix **A_CF_ptr, + hypre_ParCSRMatrix **A_CC_ptr ); hypre_CSRMatrix* hypre_ConcatDiagAndOffdDevice(hypre_ParCSRMatrix *A); -HYPRE_Int hypre_ConcatDiagOffdAndExtDevice(hypre_ParCSRMatrix *A, hypre_CSRMatrix *E, hypre_CSRMatrix **B_ptr, HYPRE_Int *num_cols_offd_ptr, HYPRE_BigInt **cols_map_offd_ptr); -HYPRE_Int hypre_ParCSRMatrixGetRowDevice( hypre_ParCSRMatrix *mat, HYPRE_BigInt row, HYPRE_Int *size, HYPRE_BigInt **col_ind, HYPRE_Complex **values ); -HYPRE_Int hypre_ParCSRDiagScale( HYPRE_ParCSRMatrix HA, HYPRE_ParVector Hy, HYPRE_ParVector Hx ); -HYPRE_Int hypre_ParCSRMatrixDropSmallEntries( hypre_ParCSRMatrix *A, HYPRE_Real tol, HYPRE_Int type); -HYPRE_Int hypre_ParCSRMatrixDropSmallEntriesHost( hypre_ParCSRMatrix *A, HYPRE_Real tol, HYPRE_Int type); -HYPRE_Int hypre_ParCSRMatrixDropSmallEntriesDevice( hypre_ParCSRMatrix *A, HYPRE_Complex tol, HYPRE_Int type); +HYPRE_Int hypre_ConcatDiagOffdAndExtDevice(hypre_ParCSRMatrix *A, hypre_CSRMatrix *E, + hypre_CSRMatrix **B_ptr, HYPRE_Int *num_cols_offd_ptr, HYPRE_BigInt **cols_map_offd_ptr); +HYPRE_Int hypre_ParCSRMatrixGetRowDevice( hypre_ParCSRMatrix *mat, HYPRE_BigInt row, + HYPRE_Int *size, HYPRE_BigInt **col_ind, HYPRE_Complex **values ); +HYPRE_Int hypre_ParCSRDiagScaleVector( hypre_ParCSRMatrix *par_A, hypre_ParVector *par_y, + hypre_ParVector *par_x ); +HYPRE_Int hypre_ParCSRDiagScaleVectorHost( hypre_ParCSRMatrix *par_A, hypre_ParVector *par_y, + hypre_ParVector *par_x ); +HYPRE_Int hypre_ParCSRDiagScaleVectorDevice( hypre_ParCSRMatrix *par_A, hypre_ParVector *par_y, + hypre_ParVector *par_x ); +HYPRE_Int hypre_ParCSRMatrixDropSmallEntries( hypre_ParCSRMatrix *A, HYPRE_Real tol, + HYPRE_Int type); +HYPRE_Int hypre_ParCSRMatrixDropSmallEntriesHost( hypre_ParCSRMatrix *A, HYPRE_Real tol, + HYPRE_Int type); +HYPRE_Int hypre_ParCSRMatrixDropSmallEntriesDevice( hypre_ParCSRMatrix *A, HYPRE_Complex tol, + HYPRE_Int type); + +HYPRE_Int hypre_ParCSRCommPkgCreateMatrixE( hypre_ParCSRCommPkg *comm_pkg, HYPRE_Int local_ncols ); #ifdef HYPRE_USING_PERSISTENT_COMM -hypre_ParCSRPersistentCommHandle* hypre_ParCSRPersistentCommHandleCreate(HYPRE_Int job, hypre_ParCSRCommPkg *comm_pkg); -hypre_ParCSRPersistentCommHandle* hypre_ParCSRCommPkgGetPersistentCommHandle(HYPRE_Int job, hypre_ParCSRCommPkg *comm_pkg); +hypre_ParCSRPersistentCommHandle* hypre_ParCSRPersistentCommHandleCreate(HYPRE_Int job, + hypre_ParCSRCommPkg *comm_pkg); +hypre_ParCSRPersistentCommHandle* hypre_ParCSRCommPkgGetPersistentCommHandle(HYPRE_Int job, + hypre_ParCSRCommPkg *comm_pkg); void hypre_ParCSRPersistentCommHandleDestroy(hypre_ParCSRPersistentCommHandle *comm_handle); -void hypre_ParCSRPersistentCommHandleStart(hypre_ParCSRPersistentCommHandle *comm_handle, HYPRE_MemoryLocation send_memory_location, void *send_data); -void hypre_ParCSRPersistentCommHandleWait(hypre_ParCSRPersistentCommHandle *comm_handle, HYPRE_MemoryLocation recv_memory_location, void *recv_data); +void hypre_ParCSRPersistentCommHandleStart(hypre_ParCSRPersistentCommHandle *comm_handle, + HYPRE_MemoryLocation send_memory_location, void *send_data); +void hypre_ParCSRPersistentCommHandleWait(hypre_ParCSRPersistentCommHandle *comm_handle, + HYPRE_MemoryLocation recv_memory_location, void *recv_data); #endif -HYPRE_Int hypre_ParcsrGetExternalRowsInit( hypre_ParCSRMatrix *A, HYPRE_Int indices_len, HYPRE_BigInt *indices, hypre_ParCSRCommPkg *comm_pkg, HYPRE_Int want_data, void **request_ptr); +HYPRE_Int hypre_ParcsrGetExternalRowsInit( hypre_ParCSRMatrix *A, HYPRE_Int indices_len, + HYPRE_BigInt *indices, hypre_ParCSRCommPkg *comm_pkg, HYPRE_Int want_data, void **request_ptr); hypre_CSRMatrix* hypre_ParcsrGetExternalRowsWait(void *vrequest); -HYPRE_Int hypre_ParcsrGetExternalRowsDeviceInit( hypre_ParCSRMatrix *A, HYPRE_Int indices_len, HYPRE_BigInt *indices, hypre_ParCSRCommPkg *comm_pkg, HYPRE_Int want_data, void **request_ptr); +HYPRE_Int hypre_ParcsrGetExternalRowsDeviceInit( hypre_ParCSRMatrix *A, HYPRE_Int indices_len, + HYPRE_BigInt *indices, hypre_ParCSRCommPkg *comm_pkg, HYPRE_Int want_data, void **request_ptr); hypre_CSRMatrix* hypre_ParcsrGetExternalRowsDeviceWait(void *vrequest); -HYPRE_Int hypre_ParvecBdiagInvScal( hypre_ParVector *b, HYPRE_Int blockSize, hypre_ParVector **bs, hypre_ParCSRMatrix *A); +HYPRE_Int hypre_ParvecBdiagInvScal( hypre_ParVector *b, HYPRE_Int blockSize, hypre_ParVector **bs, + hypre_ParCSRMatrix *A); -HYPRE_Int hypre_ParcsrBdiagInvScal( hypre_ParCSRMatrix *A, HYPRE_Int blockSize, hypre_ParCSRMatrix **As); +HYPRE_Int hypre_ParcsrBdiagInvScal( hypre_ParCSRMatrix *A, HYPRE_Int blockSize, + hypre_ParCSRMatrix **As); -HYPRE_Int hypre_ParCSRMatrixExtractSubmatrixFC( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, HYPRE_BigInt *cpts_starts, const char *job, hypre_ParCSRMatrix **B_ptr, HYPRE_Real strength_thresh); +HYPRE_Int hypre_ParCSRMatrixExtractSubmatrixFC( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + HYPRE_BigInt *cpts_starts, const char *job, + hypre_ParCSRMatrix **B_ptr, + HYPRE_Real strength_thresh); +HYPRE_Int hypre_ParCSRMatrixDiagScale( hypre_ParCSRMatrix *par_A, hypre_ParVector *par_ld, + hypre_ParVector *par_rd ); HYPRE_Int hypre_ParCSRMatrixReorder ( hypre_ParCSRMatrix *A ); -HYPRE_Int hypre_ParCSRMatrixAdd( HYPRE_Complex alpha, hypre_ParCSRMatrix *A, HYPRE_Complex beta, hypre_ParCSRMatrix *B, hypre_ParCSRMatrix **Cout); -HYPRE_Int hypre_ParCSRMatrixAddHost( HYPRE_Complex alpha, hypre_ParCSRMatrix *A, HYPRE_Complex beta, hypre_ParCSRMatrix *B, hypre_ParCSRMatrix **Cout); -HYPRE_Int hypre_ParCSRMatrixAddDevice( HYPRE_Complex alpha, hypre_ParCSRMatrix *A, HYPRE_Complex beta, hypre_ParCSRMatrix *B, hypre_ParCSRMatrix **Cout); +HYPRE_Int hypre_ParCSRMatrixAdd( HYPRE_Complex alpha, hypre_ParCSRMatrix *A, HYPRE_Complex beta, + hypre_ParCSRMatrix *B, hypre_ParCSRMatrix **Cout); +HYPRE_Int hypre_ParCSRMatrixAddHost( HYPRE_Complex alpha, hypre_ParCSRMatrix *A, + HYPRE_Complex beta, hypre_ParCSRMatrix *B, + hypre_ParCSRMatrix **Cout); +HYPRE_Int hypre_ParCSRMatrixAddDevice( HYPRE_Complex alpha, hypre_ParCSRMatrix *A, + HYPRE_Complex beta, hypre_ParCSRMatrix *B, + hypre_ParCSRMatrix **Cout); +HYPRE_Int hypre_ParCSRMatrixBlockColSum( hypre_ParCSRMatrix *A, HYPRE_Int row_major, + HYPRE_Int num_rows_block, HYPRE_Int num_cols_block, + hypre_DenseBlockMatrix **B_ptr ); +HYPRE_Int hypre_ParCSRMatrixColSum( hypre_ParCSRMatrix *A, hypre_ParVector **B_ptr ); + +/* par_csr_filter_device.c */ +HYPRE_Int hypre_ParCSRMatrixBlkFilterDevice(hypre_ParCSRMatrix *A, HYPRE_Int block_size, + hypre_ParCSRMatrix **B_ptr); + +/* par_csr_matop_device.c */ +HYPRE_Int hypre_ParCSRMatrixDiagScaleDevice ( hypre_ParCSRMatrix *par_A, hypre_ParVector *par_ld, + hypre_ParVector *par_rd ); +HYPRE_Int hypre_ParCSRMatrixCompressOffdMapDevice(hypre_ParCSRMatrix *A); +HYPRE_Int hypre_ParCSRMatrixCompressOffdMap(hypre_ParCSRMatrix *A); /* par_csr_matop_marked.c */ -void hypre_ParMatmul_RowSizes_Marked ( HYPRE_Int **C_diag_i , HYPRE_Int **C_offd_i , HYPRE_Int **B_marker , HYPRE_Int *A_diag_i , HYPRE_Int *A_diag_j , HYPRE_Int *A_offd_i , HYPRE_Int *A_offd_j , HYPRE_Int *B_diag_i , HYPRE_Int *B_diag_j , HYPRE_Int *B_offd_i , HYPRE_Int *B_offd_j , HYPRE_Int *B_ext_diag_i , HYPRE_Int *B_ext_diag_j , HYPRE_Int *B_ext_offd_i , HYPRE_Int *B_ext_offd_j , HYPRE_Int *map_B_to_C , HYPRE_Int *C_diag_size , HYPRE_Int *C_offd_size , HYPRE_Int num_rows_diag_A , HYPRE_Int num_cols_offd_A , HYPRE_Int allsquare , HYPRE_Int num_cols_diag_B , HYPRE_Int num_cols_offd_B , HYPRE_Int num_cols_offd_C , HYPRE_Int *CF_marker , HYPRE_Int *dof_func , HYPRE_Int *dof_func_offd ); -hypre_ParCSRMatrix *hypre_ParMatmul_FC ( hypre_ParCSRMatrix *A , hypre_ParCSRMatrix *P , HYPRE_Int *CF_marker , HYPRE_Int *dof_func , HYPRE_Int *dof_func_offd ); -void hypre_ParMatScaleDiagInv_F ( hypre_ParCSRMatrix *C , hypre_ParCSRMatrix *A , HYPRE_Complex weight , HYPRE_Int *CF_marker ); -hypre_ParCSRMatrix *hypre_ParMatMinus_F ( hypre_ParCSRMatrix *P , hypre_ParCSRMatrix *C , HYPRE_Int *CF_marker ); -void hypre_ParCSRMatrixZero_F ( hypre_ParCSRMatrix *P , HYPRE_Int *CF_marker ); -void hypre_ParCSRMatrixCopy_C ( hypre_ParCSRMatrix *P , hypre_ParCSRMatrix *C , HYPRE_Int *CF_marker ); -void hypre_ParCSRMatrixDropEntries ( hypre_ParCSRMatrix *C , hypre_ParCSRMatrix *P , HYPRE_Int *CF_marker ); +void hypre_ParMatmul_RowSizes_Marked ( HYPRE_Int **C_diag_i, HYPRE_Int **C_offd_i, + HYPRE_Int **B_marker, HYPRE_Int *A_diag_i, + HYPRE_Int *A_diag_j, HYPRE_Int *A_offd_i, + HYPRE_Int *A_offd_j, HYPRE_Int *B_diag_i, + HYPRE_Int *B_diag_j, HYPRE_Int *B_offd_i, + HYPRE_Int *B_offd_j, HYPRE_Int *B_ext_diag_i, + HYPRE_Int *B_ext_diag_j, HYPRE_Int *B_ext_offd_i, + HYPRE_Int *B_ext_offd_j, HYPRE_Int *map_B_to_C, + HYPRE_Int *C_diag_size, HYPRE_Int *C_offd_size, + HYPRE_Int num_rows_diag_A, HYPRE_Int num_cols_offd_A, + HYPRE_Int allsquare, HYPRE_Int num_cols_diag_B, + HYPRE_Int num_cols_offd_B, HYPRE_Int num_cols_offd_C, + HYPRE_Int *CF_marker, HYPRE_Int *dof_func, + HYPRE_Int *dof_func_offd ); +hypre_ParCSRMatrix *hypre_ParMatmul_FC ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P, + HYPRE_Int *CF_marker, HYPRE_Int *dof_func, + HYPRE_Int *dof_func_offd ); +void hypre_ParMatScaleDiagInv_F ( hypre_ParCSRMatrix *C, hypre_ParCSRMatrix *A, + HYPRE_Complex weight, HYPRE_Int *CF_marker ); +hypre_ParCSRMatrix *hypre_ParMatMinus_F ( hypre_ParCSRMatrix *P, hypre_ParCSRMatrix *C, + HYPRE_Int *CF_marker ); +void hypre_ParCSRMatrixZero_F ( hypre_ParCSRMatrix *P, HYPRE_Int *CF_marker ); +void hypre_ParCSRMatrixCopy_C ( hypre_ParCSRMatrix *P, hypre_ParCSRMatrix *C, + HYPRE_Int *CF_marker ); +void hypre_ParCSRMatrixDropEntries ( hypre_ParCSRMatrix *C, hypre_ParCSRMatrix *P, + HYPRE_Int *CF_marker ); /* par_csr_matrix.c */ -hypre_ParCSRMatrix *hypre_ParCSRMatrixCreate ( MPI_Comm comm , HYPRE_BigInt global_num_rows , HYPRE_BigInt global_num_cols , HYPRE_BigInt *row_starts_in , HYPRE_BigInt *col_starts_in , HYPRE_Int num_cols_offd , HYPRE_Int num_nonzeros_diag , HYPRE_Int num_nonzeros_offd ); +hypre_ParCSRMatrix *hypre_ParCSRMatrixCreate ( MPI_Comm comm, HYPRE_BigInt global_num_rows, + HYPRE_BigInt global_num_cols, + HYPRE_BigInt *row_starts_in, + HYPRE_BigInt *col_starts_in, + HYPRE_Int num_cols_offd, + HYPRE_Int num_nonzeros_diag, + HYPRE_Int num_nonzeros_offd ); HYPRE_Int hypre_ParCSRMatrixDestroy ( hypre_ParCSRMatrix *matrix ); -HYPRE_Int hypre_ParCSRMatrixInitialize_v2( hypre_ParCSRMatrix *matrix, HYPRE_MemoryLocation memory_location ); +HYPRE_Int hypre_ParCSRMatrixInitialize_v2( hypre_ParCSRMatrix *matrix, + HYPRE_MemoryLocation memory_location ); HYPRE_Int hypre_ParCSRMatrixInitialize ( hypre_ParCSRMatrix *matrix ); HYPRE_Int hypre_ParCSRMatrixSetNumNonzeros ( hypre_ParCSRMatrix *matrix ); HYPRE_Int hypre_ParCSRMatrixSetDNumNonzeros ( hypre_ParCSRMatrix *matrix ); HYPRE_Int hypre_ParCSRMatrixSetNumRownnz ( hypre_ParCSRMatrix *matrix ); -HYPRE_Int hypre_ParCSRMatrixSetDataOwner ( hypre_ParCSRMatrix *matrix , HYPRE_Int owns_data ); -hypre_ParCSRMatrix *hypre_ParCSRMatrixRead ( MPI_Comm comm , const char *file_name ); -HYPRE_Int hypre_ParCSRMatrixPrint ( hypre_ParCSRMatrix *matrix , const char *file_name ); -HYPRE_Int hypre_ParCSRMatrixPrintIJ ( const hypre_ParCSRMatrix *matrix , const HYPRE_Int base_i , const HYPRE_Int base_j , const char *filename ); -HYPRE_Int hypre_ParCSRMatrixReadIJ ( MPI_Comm comm , const char *filename , HYPRE_Int *base_i_ptr , HYPRE_Int *base_j_ptr , hypre_ParCSRMatrix **matrix_ptr ); -HYPRE_Int hypre_ParCSRMatrixGetLocalRange ( hypre_ParCSRMatrix *matrix , HYPRE_BigInt *row_start , HYPRE_BigInt *row_end , HYPRE_BigInt *col_start , HYPRE_BigInt *col_end ); -HYPRE_Int hypre_ParCSRMatrixGetRow ( hypre_ParCSRMatrix *mat , HYPRE_BigInt row , HYPRE_Int *size , HYPRE_BigInt **col_ind , HYPRE_Complex **values ); -HYPRE_Int hypre_ParCSRMatrixRestoreRow ( hypre_ParCSRMatrix *matrix , HYPRE_BigInt row , HYPRE_Int *size , HYPRE_BigInt **col_ind , HYPRE_Complex **values ); -hypre_ParCSRMatrix *hypre_CSRMatrixToParCSRMatrix ( MPI_Comm comm , hypre_CSRMatrix *A , HYPRE_BigInt *row_starts , HYPRE_BigInt *col_starts ); -HYPRE_Int GenerateDiagAndOffd ( hypre_CSRMatrix *A , hypre_ParCSRMatrix *matrix , HYPRE_BigInt first_col_diag , HYPRE_BigInt last_col_diag ); +HYPRE_Int hypre_ParCSRMatrixSetDataOwner ( hypre_ParCSRMatrix *matrix, HYPRE_Int owns_data ); +HYPRE_Int hypre_ParCSRMatrixSetPatternOnly( hypre_ParCSRMatrix *matrix, HYPRE_Int pattern_only); +hypre_ParCSRMatrix* hypre_ParCSRMatrixCreateFromDenseBlockMatrix(MPI_Comm comm, + HYPRE_BigInt global_num_rows, + HYPRE_BigInt global_num_cols, + HYPRE_BigInt *row_starts, + HYPRE_BigInt *col_starts, + hypre_DenseBlockMatrix *B); +hypre_ParCSRMatrix* hypre_ParCSRMatrixCreateFromParVector(hypre_ParVector *b, + HYPRE_BigInt global_num_rows, + HYPRE_BigInt global_num_cols, + HYPRE_BigInt *row_starts, + HYPRE_BigInt *col_starts); +hypre_ParCSRMatrix *hypre_ParCSRMatrixRead ( MPI_Comm comm, const char *file_name ); +HYPRE_Int hypre_ParCSRMatrixPrint ( hypre_ParCSRMatrix *matrix, const char *file_name ); +HYPRE_Int hypre_ParCSRMatrixPrintIJ ( const hypre_ParCSRMatrix *matrix, const HYPRE_Int base_i, + const HYPRE_Int base_j, const char *filename ); +HYPRE_Int hypre_ParCSRMatrixPrintBinaryIJ ( hypre_ParCSRMatrix *matrix, HYPRE_Int base_i, + HYPRE_Int base_j, const char *filename ); +HYPRE_Int hypre_ParCSRMatrixReadIJ ( MPI_Comm comm, const char *filename, HYPRE_Int *base_i_ptr, + HYPRE_Int *base_j_ptr, hypre_ParCSRMatrix **matrix_ptr ); +HYPRE_Int hypre_ParCSRMatrixGetLocalRange ( hypre_ParCSRMatrix *matrix, HYPRE_BigInt *row_start, + HYPRE_BigInt *row_end, HYPRE_BigInt *col_start, HYPRE_BigInt *col_end ); +HYPRE_Int hypre_ParCSRMatrixGetRow ( hypre_ParCSRMatrix *mat, HYPRE_BigInt row, HYPRE_Int *size, + HYPRE_BigInt **col_ind, HYPRE_Complex **values ); +HYPRE_Int hypre_ParCSRMatrixRestoreRow ( hypre_ParCSRMatrix *matrix, HYPRE_BigInt row, + HYPRE_Int *size, HYPRE_BigInt **col_ind, HYPRE_Complex **values ); +hypre_ParCSRMatrix *hypre_CSRMatrixToParCSRMatrix ( MPI_Comm comm, hypre_CSRMatrix *A, + HYPRE_BigInt *row_starts, HYPRE_BigInt *col_starts ); +HYPRE_Int GenerateDiagAndOffd ( hypre_CSRMatrix *A, hypre_ParCSRMatrix *matrix, + HYPRE_BigInt first_col_diag, HYPRE_BigInt last_col_diag ); hypre_CSRMatrix *hypre_MergeDiagAndOffd ( hypre_ParCSRMatrix *par_matrix ); hypre_CSRMatrix *hypre_MergeDiagAndOffdDevice ( hypre_ParCSRMatrix *par_matrix ); hypre_CSRMatrix *hypre_ParCSRMatrixToCSRMatrixAll ( hypre_ParCSRMatrix *par_matrix ); -HYPRE_Int hypre_ParCSRMatrixCopy ( hypre_ParCSRMatrix *A , hypre_ParCSRMatrix *B , HYPRE_Int copy_data ); -HYPRE_Int hypre_FillResponseParToCSRMatrix ( void *p_recv_contact_buf , HYPRE_Int contact_size , HYPRE_Int contact_proc , void *ro , MPI_Comm comm , void **p_send_response_buf , HYPRE_Int *response_message_size ); -hypre_ParCSRMatrix *hypre_ParCSRMatrixUnion ( hypre_ParCSRMatrix *A , hypre_ParCSRMatrix *B ); +hypre_CSRMatrix *hypre_ParCSRMatrixToCSRMatrixAll_v2 ( hypre_ParCSRMatrix *par_matrix, + HYPRE_MemoryLocation memory_location ); +HYPRE_Int hypre_ParCSRMatrixCopy ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B, + HYPRE_Int copy_data ); +HYPRE_Int hypre_FillResponseParToCSRMatrix ( void *p_recv_contact_buf, HYPRE_Int contact_size, + HYPRE_Int contact_proc, void *ro, MPI_Comm comm, void **p_send_response_buf, + HYPRE_Int *response_message_size ); +hypre_ParCSRMatrix *hypre_ParCSRMatrixUnion ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B ); hypre_ParCSRMatrix* hypre_ParCSRMatrixClone ( hypre_ParCSRMatrix *A, HYPRE_Int copy_data ); #define hypre_ParCSRMatrixCompleteClone(A) hypre_ParCSRMatrixClone(A,0) -hypre_ParCSRMatrix* hypre_ParCSRMatrixClone_v2 ( hypre_ParCSRMatrix *A, HYPRE_Int copy_data, HYPRE_MemoryLocation memory_location ); +hypre_ParCSRMatrix* hypre_ParCSRMatrixClone_v2 ( hypre_ParCSRMatrix *A, HYPRE_Int copy_data, + HYPRE_MemoryLocation memory_location ); +HYPRE_Int hypre_ParCSRMatrixTruncate(hypre_ParCSRMatrix *A, HYPRE_Real tol, + HYPRE_Int max_row_elmts, HYPRE_Int rescale, + HYPRE_Int nrm_type); HYPRE_Int hypre_ParCSRMatrixMigrate(hypre_ParCSRMatrix *A, HYPRE_MemoryLocation memory_location); HYPRE_Int hypre_ParCSRMatrixSetConstantValues( hypre_ParCSRMatrix *A, HYPRE_Complex value ); void hypre_ParCSRMatrixCopyColMapOffdToDevice(hypre_ParCSRMatrix *A); +void hypre_ParCSRMatrixCopyColMapOffdToHost(hypre_ParCSRMatrix *A); + +/* par_csr_matrix_stats.c */ +HYPRE_Int hypre_ParCSRMatrixStatsArrayCompute( HYPRE_Int num_matrices, + hypre_ParCSRMatrix **matrices, + hypre_MatrixStatsArray *stats_array ); + +/* par_csr_matmat_device.c */ +HYPRE_Int hypre_ParCSRMatMatDiagDevice( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *BT, + hypre_ParCSRMatrix *C ); + +/* par_csr_matmat.c */ +HYPRE_Int hypre_ParCSRMatMatDiag( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B, + hypre_ParCSRMatrix **C_ptr ); /* par_csr_matvec.c */ // y = alpha*A*x + beta*b -HYPRE_Int hypre_ParCSRMatrixMatvecOutOfPlace ( HYPRE_Complex alpha , hypre_ParCSRMatrix *A , hypre_ParVector *x , HYPRE_Complex beta , hypre_ParVector *b, hypre_ParVector *y ); +HYPRE_Int hypre_ParCSRMatrixMatvecOutOfPlace ( HYPRE_Complex alpha, hypre_ParCSRMatrix *A, + hypre_ParVector *x, HYPRE_Complex beta, + hypre_ParVector *b, hypre_ParVector *y ); +HYPRE_Int hypre_ParCSRMatrixMatvecOutOfPlaceDevice ( HYPRE_Complex alpha, hypre_ParCSRMatrix *A, + hypre_ParVector *x, HYPRE_Complex beta, + hypre_ParVector *b, hypre_ParVector *y ); // y = alpha*A*x + beta*y -HYPRE_Int hypre_ParCSRMatrixMatvec ( HYPRE_Complex alpha , hypre_ParCSRMatrix *A , hypre_ParVector *x , HYPRE_Complex beta , hypre_ParVector *y ); -HYPRE_Int hypre_ParCSRMatrixMatvecT ( HYPRE_Complex alpha , hypre_ParCSRMatrix *A , hypre_ParVector *x , HYPRE_Complex beta , hypre_ParVector *y ); -HYPRE_Int hypre_ParCSRMatrixMatvec_FF ( HYPRE_Complex alpha , hypre_ParCSRMatrix *A , hypre_ParVector *x , HYPRE_Complex beta , hypre_ParVector *y , HYPRE_Int *CF_marker , HYPRE_Int fpt ); +HYPRE_Int hypre_ParCSRMatrixMatvec ( HYPRE_Complex alpha, hypre_ParCSRMatrix *A, hypre_ParVector *x, + HYPRE_Complex beta, hypre_ParVector *y ); +HYPRE_Int hypre_ParCSRMatrixMatvecT ( HYPRE_Complex alpha, hypre_ParCSRMatrix *A, + hypre_ParVector *x, HYPRE_Complex beta, hypre_ParVector *y ); +HYPRE_Int hypre_ParCSRMatrixMatvecTDevice ( HYPRE_Complex alpha, hypre_ParCSRMatrix *A, + hypre_ParVector *x, HYPRE_Complex beta, + hypre_ParVector *y ); +HYPRE_Int hypre_ParCSRMatrixMatvecT_unpack( hypre_ParCSRCommPkg *comm_pkg, HYPRE_Int num_cols, + HYPRE_Complex *recv_data, HYPRE_Complex *local_data ); +HYPRE_Int hypre_ParCSRMatrixMatvec_FF ( HYPRE_Complex alpha, hypre_ParCSRMatrix *A, + hypre_ParVector *x, HYPRE_Complex beta, hypre_ParVector *y, + HYPRE_Int *CF_marker, HYPRE_Int fpt ); /* par_csr_triplemat.c */ +HYPRE_Int hypre_ParCSRTMatMatPartialAddDevice( hypre_ParCSRCommPkg *comm_pkg_A, + HYPRE_Int num_cols_A, HYPRE_Int num_cols_B, HYPRE_BigInt first_col_diag_B, + HYPRE_BigInt last_col_diag_B, HYPRE_Int num_cols_offd_B, HYPRE_BigInt *col_map_offd_B, + HYPRE_Int local_nnz_Cbar, hypre_CSRMatrix *Cbar, hypre_CSRMatrix *Cext, + hypre_CSRMatrix **C_diag_ptr, hypre_CSRMatrix **C_offd_ptr, HYPRE_Int *num_cols_offd_C_ptr, + HYPRE_BigInt **col_map_offd_C_ptr ); hypre_ParCSRMatrix *hypre_ParCSRMatMat( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B ); hypre_ParCSRMatrix *hypre_ParCSRMatMatHost( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B ); hypre_ParCSRMatrix *hypre_ParCSRMatMatDevice( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B ); - -hypre_ParCSRMatrix *hypre_ParCSRTMatMatKTHost( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B, HYPRE_Int keep_transpose); -hypre_ParCSRMatrix *hypre_ParCSRTMatMatKTDevice( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B, HYPRE_Int keep_transpose); -hypre_ParCSRMatrix *hypre_ParCSRTMatMatKT( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B, HYPRE_Int keep_transpose); +hypre_ParCSRMatrix *hypre_ParCSRTMatMatKTHost( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B, + HYPRE_Int keep_transpose); +hypre_ParCSRMatrix *hypre_ParCSRTMatMatKTDevice( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B, + HYPRE_Int keep_transpose); +hypre_ParCSRMatrix *hypre_ParCSRTMatMatKT( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B, + HYPRE_Int keep_transpose); hypre_ParCSRMatrix *hypre_ParCSRTMatMat( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B); -hypre_ParCSRMatrix *hypre_ParCSRMatrixRAPKT( hypre_ParCSRMatrix *R, hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P , HYPRE_Int keepTranspose ); -hypre_ParCSRMatrix *hypre_ParCSRMatrixRAP( hypre_ParCSRMatrix *R, hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P ); -hypre_ParCSRMatrix* hypre_ParCSRMatrixRAPKTDevice( hypre_ParCSRMatrix *R, hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P, HYPRE_Int keep_transpose ); -hypre_ParCSRMatrix* hypre_ParCSRMatrixRAPKTHost( hypre_ParCSRMatrix *R, hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P, HYPRE_Int keep_transpose ); +hypre_ParCSRMatrix *hypre_ParCSRMatrixRAPKT( hypre_ParCSRMatrix *R, hypre_ParCSRMatrix *A, + hypre_ParCSRMatrix *P, HYPRE_Int keepTranspose ); +hypre_ParCSRMatrix *hypre_ParCSRMatrixRAP( hypre_ParCSRMatrix *R, hypre_ParCSRMatrix *A, + hypre_ParCSRMatrix *P ); +hypre_ParCSRMatrix* hypre_ParCSRMatrixRAPKTDevice( hypre_ParCSRMatrix *R, hypre_ParCSRMatrix *A, + hypre_ParCSRMatrix *P, HYPRE_Int keep_transpose ); +hypre_ParCSRMatrix* hypre_ParCSRMatrixRAPKTHost( hypre_ParCSRMatrix *R, hypre_ParCSRMatrix *A, + hypre_ParCSRMatrix *P, HYPRE_Int keep_transpose ); /* par_make_system.c */ -HYPRE_ParCSR_System_Problem *HYPRE_Generate2DSystem ( HYPRE_ParCSRMatrix H_L1 , HYPRE_ParCSRMatrix H_L2 , HYPRE_ParVector H_b1 , HYPRE_ParVector H_b2 , HYPRE_ParVector H_x1 , HYPRE_ParVector H_x2 , HYPRE_Complex *M_vals ); +HYPRE_ParCSR_System_Problem *HYPRE_Generate2DSystem ( HYPRE_ParCSRMatrix H_L1, + HYPRE_ParCSRMatrix H_L2, HYPRE_ParVector H_b1, HYPRE_ParVector H_b2, HYPRE_ParVector H_x1, + HYPRE_ParVector H_x2, HYPRE_Complex *M_vals ); HYPRE_Int HYPRE_Destroy2DSystem ( HYPRE_ParCSR_System_Problem *sys_prob ); /* par_vector.c */ -hypre_ParVector *hypre_ParVectorCreate ( MPI_Comm comm , HYPRE_BigInt global_size , HYPRE_BigInt *partitioning_in ); -hypre_ParVector *hypre_ParMultiVectorCreate ( MPI_Comm comm , HYPRE_BigInt global_size , HYPRE_BigInt *partitioning , HYPRE_Int num_vectors ); +hypre_ParVector *hypre_ParVectorCreate ( MPI_Comm comm, HYPRE_BigInt global_size, + HYPRE_BigInt *partitioning_in ); +hypre_ParVector *hypre_ParMultiVectorCreate ( MPI_Comm comm, HYPRE_BigInt global_size, + HYPRE_BigInt *partitioning, HYPRE_Int num_vectors ); HYPRE_Int hypre_ParVectorDestroy ( hypre_ParVector *vector ); +HYPRE_Int hypre_ParVectorInitializeShell( hypre_ParVector *vector ); +HYPRE_Int hypre_ParVectorSetData( hypre_ParVector *vector, HYPRE_Complex *data ); HYPRE_Int hypre_ParVectorInitialize ( hypre_ParVector *vector ); -HYPRE_Int hypre_ParVectorInitialize_v2( hypre_ParVector *vector, HYPRE_MemoryLocation memory_location ); -HYPRE_Int hypre_ParVectorSetDataOwner ( hypre_ParVector *vector , HYPRE_Int owns_data ); -HYPRE_Int hypre_ParVectorSetNumVectors ( hypre_ParVector *vector , HYPRE_Int num_vectors ); -hypre_ParVector *hypre_ParVectorRead ( MPI_Comm comm , const char *file_name ); -HYPRE_Int hypre_ParVectorPrint ( hypre_ParVector *vector , const char *file_name ); -HYPRE_Int hypre_ParVectorSetConstantValues ( hypre_ParVector *v , HYPRE_Complex value ); -HYPRE_Int hypre_ParVectorSetRandomValues ( hypre_ParVector *v , HYPRE_Int seed ); -HYPRE_Int hypre_ParVectorCopy ( hypre_ParVector *x , hypre_ParVector *y ); +HYPRE_Int hypre_ParVectorInitialize_v2( hypre_ParVector *vector, + HYPRE_MemoryLocation memory_location ); +HYPRE_Int hypre_ParVectorSetDataOwner ( hypre_ParVector *vector, HYPRE_Int owns_data ); +HYPRE_Int hypre_ParVectorSetLocalSize ( hypre_ParVector *vector, HYPRE_Int local_size ); +HYPRE_Int hypre_ParVectorSetNumVectors ( hypre_ParVector *vector, HYPRE_Int num_vectors ); +HYPRE_Int hypre_ParVectorSetComponent ( hypre_ParVector *vector, HYPRE_Int component ); +HYPRE_Int hypre_ParVectorResize ( hypre_ParVector *vector, HYPRE_Int num_vectors ); +hypre_ParVector *hypre_ParVectorRead ( MPI_Comm comm, const char *file_name ); +HYPRE_Int hypre_ParVectorSetConstantValues ( hypre_ParVector *v, HYPRE_Complex value ); +HYPRE_Int hypre_ParVectorSetZeros( hypre_ParVector *v ); +HYPRE_Int hypre_ParVectorSetRandomValues ( hypre_ParVector *v, HYPRE_Int seed ); +HYPRE_Int hypre_ParVectorCopy ( hypre_ParVector *x, hypre_ParVector *y ); hypre_ParVector *hypre_ParVectorCloneShallow ( hypre_ParVector *x ); -hypre_ParVector *hypre_ParVectorCloneDeep_v2( hypre_ParVector *x, HYPRE_MemoryLocation memory_location ); +hypre_ParVector *hypre_ParVectorCloneDeep_v2( hypre_ParVector *x, + HYPRE_MemoryLocation memory_location ); HYPRE_Int hypre_ParVectorMigrate(hypre_ParVector *x, HYPRE_MemoryLocation memory_location); -HYPRE_Int hypre_ParVectorScale ( HYPRE_Complex alpha , hypre_ParVector *y ); -HYPRE_Int hypre_ParVectorAxpy ( HYPRE_Complex alpha , hypre_ParVector *x , hypre_ParVector *y ); -HYPRE_Int hypre_ParVectorMassAxpy ( HYPRE_Complex *alpha, hypre_ParVector **x, hypre_ParVector *y, HYPRE_Int k, HYPRE_Int unroll); -HYPRE_Real hypre_ParVectorInnerProd ( hypre_ParVector *x , hypre_ParVector *y ); -HYPRE_Int hypre_ParVectorMassInnerProd ( hypre_ParVector *x , hypre_ParVector **y , HYPRE_Int k, HYPRE_Int unroll, HYPRE_Real *prod ); -HYPRE_Int hypre_ParVectorMassDotpTwo ( hypre_ParVector *x , hypre_ParVector *y , hypre_ParVector **z, HYPRE_Int k, HYPRE_Int unroll, HYPRE_Real *prod_x , HYPRE_Real *prod_y ); -hypre_ParVector *hypre_VectorToParVector ( MPI_Comm comm , hypre_Vector *v , HYPRE_BigInt *vec_starts ); +HYPRE_Int hypre_ParVectorScale ( HYPRE_Complex alpha, hypre_ParVector *y ); +HYPRE_Int hypre_ParVectorAxpy ( HYPRE_Complex alpha, hypre_ParVector *x, hypre_ParVector *y ); +HYPRE_Int hypre_ParVectorAxpyz ( HYPRE_Complex alpha, hypre_ParVector *x, + HYPRE_Complex beta, hypre_ParVector *y, + hypre_ParVector *z ); +HYPRE_Int hypre_ParVectorMassAxpy ( HYPRE_Complex *alpha, hypre_ParVector **x, hypre_ParVector *y, + HYPRE_Int k, HYPRE_Int unroll); +HYPRE_Real hypre_ParVectorInnerProd ( hypre_ParVector *x, hypre_ParVector *y ); +HYPRE_Int hypre_ParVectorMassInnerProd ( hypre_ParVector *x, hypre_ParVector **y, HYPRE_Int k, + HYPRE_Int unroll, HYPRE_Real *prod ); +HYPRE_Int hypre_ParVectorMassDotpTwo ( hypre_ParVector *x, hypre_ParVector *y, hypre_ParVector **z, + HYPRE_Int k, HYPRE_Int unroll, HYPRE_Real *prod_x, HYPRE_Real *prod_y ); +hypre_ParVector *hypre_VectorToParVector ( MPI_Comm comm, hypre_Vector *v, + HYPRE_BigInt *vec_starts ); hypre_Vector *hypre_ParVectorToVectorAll ( hypre_ParVector *par_v ); -HYPRE_Int hypre_ParVectorPrintIJ ( hypre_ParVector *vector , HYPRE_Int base_j , const char *filename ); -HYPRE_Int hypre_ParVectorReadIJ ( MPI_Comm comm , const char *filename , HYPRE_Int *base_j_ptr , hypre_ParVector **vector_ptr ); -HYPRE_Int hypre_FillResponseParToVectorAll ( void *p_recv_contact_buf , HYPRE_Int contact_size , HYPRE_Int contact_proc , void *ro , MPI_Comm comm , void **p_send_response_buf , HYPRE_Int *response_message_size ); +hypre_Vector *hypre_ParVectorToVectorAll_v2 ( hypre_ParVector *par_v, + HYPRE_MemoryLocation memory_location ); +HYPRE_Int hypre_ParVectorPrint ( hypre_ParVector *vector, const char *file_name ); +HYPRE_Int hypre_ParVectorPrintIJ ( hypre_ParVector *vector, HYPRE_Int base_j, + const char *filename ); +HYPRE_Int hypre_ParVectorPrintBinaryIJ ( hypre_ParVector *par_vector, const char *filename ); +HYPRE_Int hypre_ParVectorReadIJ ( MPI_Comm comm, const char *filename, HYPRE_Int *base_j_ptr, + hypre_ParVector **vector_ptr ); +HYPRE_Int hypre_FillResponseParToVectorAll ( void *p_recv_contact_buf, HYPRE_Int contact_size, + HYPRE_Int contact_proc, void *ro, MPI_Comm comm, void **p_send_response_buf, + HYPRE_Int *response_message_size ); HYPRE_Complex hypre_ParVectorLocalSumElts ( hypre_ParVector *vector ); -HYPRE_Int hypre_ParVectorGetValues ( hypre_ParVector *vector, HYPRE_Int num_values, HYPRE_BigInt *indices , HYPRE_Complex *values); -HYPRE_Int hypre_ParVectorGetValues2( hypre_ParVector *vector, HYPRE_Int num_values, HYPRE_BigInt *indices, HYPRE_BigInt base, HYPRE_Complex *values ); -HYPRE_Int hypre_ParVectorGetValuesHost(hypre_ParVector *vector, HYPRE_Int num_values, HYPRE_BigInt *indices, HYPRE_BigInt base, HYPRE_Complex *values); +HYPRE_Int hypre_ParVectorGetValues ( hypre_ParVector *vector, HYPRE_Int num_values, + HYPRE_BigInt *indices, HYPRE_Complex *values); +HYPRE_Int hypre_ParVectorGetValues2( hypre_ParVector *vector, HYPRE_Int num_values, + HYPRE_BigInt *indices, HYPRE_BigInt base, HYPRE_Complex *values ); +HYPRE_Int hypre_ParVectorGetValuesHost(hypre_ParVector *vector, HYPRE_Int num_values, + HYPRE_BigInt *indices, HYPRE_BigInt base, HYPRE_Complex *values); HYPRE_Int hypre_ParVectorElmdivpy( hypre_ParVector *x, hypre_ParVector *b, hypre_ParVector *y ); -HYPRE_Int hypre_ParVectorElmdivpyMarked( hypre_ParVector *x, hypre_ParVector *b, hypre_ParVector *y, HYPRE_Int *marker, HYPRE_Int marker_val ); +HYPRE_Int hypre_ParVectorElmdivpyMarked( hypre_ParVector *x, hypre_ParVector *b, + hypre_ParVector *y, HYPRE_Int *marker, + HYPRE_Int marker_val ); /* par_vector_device.c */ -HYPRE_Int hypre_ParVectorGetValuesDevice(hypre_ParVector *vector, HYPRE_Int num_values, HYPRE_BigInt *indices, HYPRE_BigInt base, HYPRE_Complex *values); +HYPRE_Int hypre_ParVectorGetValuesDevice(hypre_ParVector *vector, HYPRE_Int num_values, + HYPRE_BigInt *indices, HYPRE_BigInt base, + HYPRE_Complex *values); #ifdef __cplusplus } diff --git a/external/hypre/src/parcsr_mv/communicationT.c b/external/hypre/src/parcsr_mv/communicationT.c index 2c9fff18..f9436d88 100644 --- a/external/hypre/src/parcsr_mv/communicationT.c +++ b/external/hypre/src/parcsr_mv/communicationT.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -27,13 +27,16 @@ void hypre_RowsWithColumn_original *rowmin = num_rows; *rowmax = -1; - for ( i=0; i*rowmax ? i : *rowmax; + *rowmin = i < *rowmin ? i : *rowmin; + *rowmax = i > *rowmax ? i : *rowmax; break; } } @@ -42,22 +45,25 @@ void hypre_RowsWithColumn_original mat_j = hypre_CSRMatrixJ(offd); num_rows = hypre_CSRMatrixNumRows(offd); colMapOffd = hypre_ParCSRMatrixColMapOffd(A); - for ( i=0; i*rowmax ? i : *rowmax; + *rowmin = i < *rowmin ? i : *rowmin; + *rowmax = i > *rowmax ? i : *rowmax; break; } } } -/* global col no.: mat_j[j]+hypre_ParCSRMatrixFirstColDiag(A) - or hypre_ParCSRMatrixColMapOffd(A)[ mat_j[j] ] - global row no.: i + hypre_ParCSRMatrixFirstRowIndex(A) -*/ + /* global col no.: mat_j[j]+hypre_ParCSRMatrixFirstColDiag(A) + or hypre_ParCSRMatrixColMapOffd(A)[ mat_j[j] ] + global row no.: i + hypre_ParCSRMatrixFirstRowIndex(A) + */ } @@ -83,33 +89,39 @@ void hypre_RowsWithColumn *rowmin = num_rows_diag; *rowmax = -1; - for ( i=0; i*rowmax ? i : *rowmax; + *rowmin = i < *rowmin ? i : *rowmin; + *rowmax = i > *rowmax ? i : *rowmax; break; } } } - for ( i=0; i*rowmax ? i : *rowmax; + *rowmin = i < *rowmin ? i : *rowmin; + *rowmax = i > *rowmax ? i : *rowmax; break; } } } -/* global col no.: mat_j[j]+hypre_ParCSRMatrixFirstColDiag(A) - or hypre_ParCSRMatrixColMapOffd(A)[ mat_j[j] ] - global row no.: i + hypre_ParCSRMatrixFirstRowIndex(A) -*/ + /* global col no.: mat_j[j]+hypre_ParCSRMatrixFirstColDiag(A) + or hypre_ParCSRMatrixColMapOffd(A)[ mat_j[j] ] + global row no.: i + hypre_ParCSRMatrixFirstRowIndex(A) + */ } @@ -124,7 +136,7 @@ void hypre_RowsWithColumn void hypre_MatTCommPkgCreate_core ( -/* input args: */ + /* input args: */ MPI_Comm comm, HYPRE_BigInt * col_map_offd, HYPRE_BigInt first_col_diag, HYPRE_BigInt *col_starts, HYPRE_Int num_rows_diag, HYPRE_Int num_cols_diag, HYPRE_Int num_cols_offd, HYPRE_BigInt *row_starts, HYPRE_BigInt firstColDiag, HYPRE_BigInt *colMapOffd, @@ -132,25 +144,27 @@ hypre_MatTCommPkgCreate_core ( HYPRE_Int data, /* = 1 for a matrix with floating-point data, =0 for Boolean matrix */ -/* pointers to output args: */ + /* pointers to output args: */ HYPRE_Int * p_num_recvs, HYPRE_Int ** p_recv_procs, HYPRE_Int ** p_recv_vec_starts, HYPRE_Int * p_num_sends, HYPRE_Int ** p_send_procs, HYPRE_Int ** p_send_map_starts, HYPRE_Int ** p_send_map_elmts - ) +) { - HYPRE_Int num_sends; - HYPRE_Int *send_procs; - HYPRE_Int *send_map_starts; - HYPRE_Int *send_map_elmts; - HYPRE_Int num_recvs; - HYPRE_Int *recv_procs; - HYPRE_Int *recv_vec_starts; - HYPRE_Int i, j, j2, k, ir, rowmin, rowmax; - HYPRE_BigInt *tmp, *recv_buf; - HYPRE_Int *displs, *info, *send_buf, *all_num_sends3; - HYPRE_Int num_procs, my_id, num_elmts; - HYPRE_Int local_info, index, index2; + HYPRE_UNUSED_VAR(data); + + HYPRE_Int num_sends; + HYPRE_Int *send_procs; + HYPRE_Int *send_map_starts; + HYPRE_Int *send_map_elmts; + HYPRE_Int num_recvs; + HYPRE_Int *recv_procs; + HYPRE_Int *recv_vec_starts; + HYPRE_Int i, j, j2, k, ir, rowmin, rowmax; + HYPRE_BigInt *tmp, *recv_buf; + HYPRE_Int *displs, *info, *send_buf, *all_num_sends3; + HYPRE_Int num_procs, my_id, num_elmts; + HYPRE_Int local_info, index, index2; HYPRE_Int pmatch, p; HYPRE_BigInt col, kc; HYPRE_Int * recv_sz_buf; @@ -161,143 +175,153 @@ hypre_MatTCommPkgCreate_core ( info = hypre_CTAlloc(HYPRE_Int, num_procs, HYPRE_MEMORY_HOST); -/* ---------------------------------------------------------------------- - * determine which processors to receive from (set proc_mark) and num_recvs, - * at the end of the loop proc_mark[i] contains the number of elements to be - * received from Proc. i - * - * - For A*b or A*B: for each off-diagonal column i of A, you want to identify - * the processor which has the corresponding element i of b (row i of B) - * (columns in the local diagonal block, just multiply local rows of B). - * You do it by finding the processor which has that column of A in its - * _diagonal_ block - assuming b or B is distributed the same, which I believe - * is evenly among processors, by row. There is a unique solution because - * the diag/offd blocking is defined by which processor owns which rows of A. - * - * - For A*A^T: A^T is not distributed by rows as B or any 'normal' matrix is. - * For each off-diagonal row,column k,i element of A, you want to identify - * the processors which have the corresponding row,column i,j elements of A^T - * i.e., row,column j,i elements of A (all i,j,k for which these entries are - * nonzero, row k of A lives on this processor, and row j of A lives on - * a different processor). So, given a column i in the local A-offd or A-diag, - * we want to find all the processors which have column i, in diag or offd - * blocks. Unlike the A*B case, I don't think you can eliminate looking at - * any class of blocks. - * ---------------------------------------------------------------------*/ - -/* The algorithm for A*B was: - For each of my columns i (in offd block), use known information on data - distribution of columns in _diagonal_ blocks to find the processor p which - owns row i. (Note that for i in diag block, I own the row, nothing to do.) - Count up such i's for each processor in proc_mark. Construct a data - structure, recv_buf, made by appending a structure tmp from each processor. - The data structure tmp looks like (p, no. of i's, i1, i2,...) (p=0,...) . - There are two communication steps: gather size information (local_info) from - all processors (into info), then gather the data (tmp) from all processors - (into recv_buf). Then you go through recv_buf. For each (sink) processor p - you search for for the appearance of my (source) processor number - (most of recv_buf pertains to other processors and is ignored). - When you find the appropriate section, pull out the i's, count them and - save them, in send_map_elmts, and save p in send_procs and index information - in send_map_starts. -*/ -/* The algorithm for A*A^T: - [ Originally I had planned to figure out approximately which processors - had the information (for A*B it could be done exactly) to save on - communication. But even for A*B where the data owner is known, all data is - sent to all processors, so that's not worth worrying about on the first cut. - One consequence is that proc_mark is not needed.] - Construct a data structure, recv_buf, made by appending a structure tmp for - each processor. It simply consists of (no. of i's, i1, i2,...) where i is - the global number of a column in the offd block. There are still two - communication steps: gather size information (local_info) from all processors - (into info), then gather the data (tmp) from all processors (into recv_buf). - Then you go through recv_buf. For each (sink) processor p you go through - all its column numbers in recv_buf. Check each one for whether you have - data in that column. If so, put in in send_map_elmts, p in send_procs, - and update the index information in send_map_starts. Note that these - arrays don't mean quite the same thing as for A*B. -*/ - - num_recvs=num_procs-1; + /* ---------------------------------------------------------------------- + * determine which processors to receive from (set proc_mark) and num_recvs, + * at the end of the loop proc_mark[i] contains the number of elements to be + * received from Proc. i + * + * - For A*b or A*B: for each off-diagonal column i of A, you want to identify + * the processor which has the corresponding element i of b (row i of B) + * (columns in the local diagonal block, just multiply local rows of B). + * You do it by finding the processor which has that column of A in its + * _diagonal_ block - assuming b or B is distributed the same, which I believe + * is evenly among processors, by row. There is a unique solution because + * the diag/offd blocking is defined by which processor owns which rows of A. + * + * - For A*A^T: A^T is not distributed by rows as B or any 'normal' matrix is. + * For each off-diagonal row,column k,i element of A, you want to identify + * the processors which have the corresponding row,column i,j elements of A^T + * i.e., row,column j,i elements of A (all i,j,k for which these entries are + * nonzero, row k of A lives on this processor, and row j of A lives on + * a different processor). So, given a column i in the local A-offd or A-diag, + * we want to find all the processors which have column i, in diag or offd + * blocks. Unlike the A*B case, I don't think you can eliminate looking at + * any class of blocks. + * ---------------------------------------------------------------------*/ + + /* The algorithm for A*B was: + For each of my columns i (in offd block), use known information on data + distribution of columns in _diagonal_ blocks to find the processor p which + owns row i. (Note that for i in diag block, I own the row, nothing to do.) + Count up such i's for each processor in proc_mark. Construct a data + structure, recv_buf, made by appending a structure tmp from each processor. + The data structure tmp looks like (p, no. of i's, i1, i2,...) (p=0,...) . + There are two communication steps: gather size information (local_info) from + all processors (into info), then gather the data (tmp) from all processors + (into recv_buf). Then you go through recv_buf. For each (sink) processor p + you search for for the appearance of my (source) processor number + (most of recv_buf pertains to other processors and is ignored). + When you find the appropriate section, pull out the i's, count them and + save them, in send_map_elmts, and save p in send_procs and index information + in send_map_starts. + */ + /* The algorithm for A*A^T: + [ Originally I had planned to figure out approximately which processors + had the information (for A*B it could be done exactly) to save on + communication. But even for A*B where the data owner is known, all data is + sent to all processors, so that's not worth worrying about on the first cut. + One consequence is that proc_mark is not needed.] + Construct a data structure, recv_buf, made by appending a structure tmp for + each processor. It simply consists of (no. of i's, i1, i2,...) where i is + the global number of a column in the offd block. There are still two + communication steps: gather size information (local_info) from all processors + (into info), then gather the data (tmp) from all processors (into recv_buf). + Then you go through recv_buf. For each (sink) processor p you go through + all its column numbers in recv_buf. Check each one for whether you have + data in that column. If so, put in in send_map_elmts, p in send_procs, + and update the index information in send_map_starts. Note that these + arrays don't mean quite the same thing as for A*B. + */ + + num_recvs = num_procs - 1; local_info = num_procs + num_cols_offd + num_cols_diag; hypre_MPI_Allgather(&local_info, 1, HYPRE_MPI_INT, info, 1, HYPRE_MPI_INT, comm); -/* ---------------------------------------------------------------------- - * generate information to be send: tmp contains for each recv_proc: - * {deleted: id of recv_procs}, number of elements to be received for this processor, - * indices of elements (in this order) - * ---------------------------------------------------------------------*/ + /* ---------------------------------------------------------------------- + * generate information to be send: tmp contains for each recv_proc: + * {deleted: id of recv_procs}, number of elements to be received for this processor, + * indices of elements (in this order) + * ---------------------------------------------------------------------*/ - displs = hypre_CTAlloc(HYPRE_Int, num_procs+1, HYPRE_MEMORY_HOST); + displs = hypre_CTAlloc(HYPRE_Int, num_procs + 1, HYPRE_MEMORY_HOST); displs[0] = 0; - for (i=1; i < num_procs+1; i++) - displs[i] = displs[i-1]+info[i-1]; + for (i = 1; i < num_procs + 1; i++) + { + displs[i] = displs[i - 1] + info[i - 1]; + } recv_buf = hypre_CTAlloc(HYPRE_BigInt, displs[num_procs], HYPRE_MEMORY_HOST); tmp = hypre_CTAlloc(HYPRE_BigInt, local_info, HYPRE_MEMORY_HOST); j = 0; - for (i=0; i < num_procs; i++) { + for (i = 0; i < num_procs; i++) + { j2 = j++; tmp[j2] = 0; - for (k=0; k < num_cols_offd; k++) + for (k = 0; k < num_cols_offd; k++) if (col_map_offd[k] >= col_starts[i] && - col_map_offd[k] < col_starts[i+1]) { + col_map_offd[k] < col_starts[i + 1]) + { tmp[j++] = col_map_offd[k]; ++(tmp[j2]); }; - for (k=0; k < num_cols_diag; k++) - if ( (HYPRE_BigInt)k+first_col_diag >= col_starts[i] && - (HYPRE_BigInt)k+first_col_diag < col_starts[i+1] ) { + for (k = 0; k < num_cols_diag; k++) + if ( (HYPRE_BigInt)k + first_col_diag >= col_starts[i] && + (HYPRE_BigInt)k + first_col_diag < col_starts[i + 1] ) + { tmp[j++] = (HYPRE_BigInt)k + first_col_diag; ++(tmp[j2]); } } - hypre_MPI_Allgatherv(tmp,local_info,HYPRE_MPI_BIG_INT,recv_buf,info,displs,HYPRE_MPI_INT,comm); - - -/* ---------------------------------------------------------------------- - * determine send_procs and actual elements to be send (in send_map_elmts) - * and send_map_starts whose i-th entry points to the beginning of the - * elements to be send to proc. i - * ---------------------------------------------------------------------*/ -/* Meanings of arrays being set here, more verbosely stated: - send_procs: processors p to send to - send_map_starts: for each p, gives range of indices in send_map_elmts; - send_map_elmts: Each element is a send_map_elmts[i], with i in a range given - by send_map_starts[p..p+1], for some p. This element is is the global - column number for a column in the offd block of p which is to be multiplied - by data from this processor. - For A*B, send_map_elmts[i] is therefore a row of B belonging to this - processor, to be sent to p. For A*A^T, send_map_elmts[i] is a row of A - belonging to this processor, to be sent to p; this row was selected - because it has a nonzero on a _column_ needed by p. -*/ + hypre_MPI_Allgatherv(tmp, local_info, HYPRE_MPI_BIG_INT, + recv_buf, info, displs, HYPRE_MPI_BIG_INT, + comm); + + /* ---------------------------------------------------------------------- + * determine send_procs and actual elements to be send (in send_map_elmts) + * and send_map_starts whose i-th entry points to the beginning of the + * elements to be send to proc. i + * ---------------------------------------------------------------------*/ + /* Meanings of arrays being set here, more verbosely stated: + send_procs: processors p to send to + send_map_starts: for each p, gives range of indices in send_map_elmts; + send_map_elmts: Each element is a send_map_elmts[i], with i in a range given + by send_map_starts[p..p+1], for some p. This element is is the global + column number for a column in the offd block of p which is to be multiplied + by data from this processor. + For A*B, send_map_elmts[i] is therefore a row of B belonging to this + processor, to be sent to p. For A*A^T, send_map_elmts[i] is a row of A + belonging to this processor, to be sent to p; this row was selected + because it has a nonzero on a _column_ needed by p. + */ num_sends = num_procs; /* may turn out to be less, but we can't know yet */ - num_elmts = (num_procs-1)*num_rows_diag; + num_elmts = (num_procs - 1) * num_rows_diag; /* ... a crude upper bound; should try to do better even if more comm required */ send_procs = hypre_CTAlloc(HYPRE_Int, num_sends, HYPRE_MEMORY_HOST); - send_map_starts = hypre_CTAlloc(HYPRE_Int, num_sends+1, HYPRE_MEMORY_HOST); + send_map_starts = hypre_CTAlloc(HYPRE_Int, num_sends + 1, HYPRE_MEMORY_HOST); send_map_elmts = hypre_CTAlloc(HYPRE_Int, num_elmts, HYPRE_MEMORY_HOST); row_marker = hypre_CTAlloc(HYPRE_Int, num_rows_diag, HYPRE_MEMORY_HOST); index = 0; index2 = 0; send_map_starts[0] = 0; - for (i=0; i < num_procs; i++) { - send_map_starts[index+1] = send_map_starts[index]; + for (i = 0; i < num_procs; i++) + { + send_map_starts[index + 1] = send_map_starts[index]; j = displs[i]; pmatch = 0; - for ( ir=0; ir 0) { - cpt_array[my_thread_num+1]++; + cpt_array[my_thread_num + 1]++; } else { - fpt_array[my_thread_num+1]++; + fpt_array[my_thread_num + 1]++; } } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif if (my_thread_num == 0) { - for (i=1; i < num_threads; i++) + for (i = 1; i < num_threads; i++) { - cpt_array[i+1] += cpt_array[i]; - fpt_array[i+1] += fpt_array[i]; + cpt_array[i + 1] += cpt_array[i]; + fpt_array[i + 1] += fpt_array[i]; } } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif cpt = cpt_array[my_thread_num]; fpt = fpt_array[my_thread_num]; - for (i=start; i < stop; i++) + for (i = start; i < stop; i++) { if (CF_marker[i] > 0) { @@ -156,7 +161,7 @@ hypre_ParCSRMatrixGenerateFFFC( hypre_ParCSRMatrix *A, } } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif if (my_thread_num == 0) @@ -165,22 +170,21 @@ hypre_ParCSRMatrixGenerateFFFC( hypre_ParCSRMatrix *A, n_Fpts = fpt_array[num_threads]; big_Fpts = n_Fpts; - fpts_starts = hypre_CTAlloc(HYPRE_BigInt, 2, HYPRE_MEMORY_HOST); - hypre_MPI_Scan(&big_Fpts, fpts_starts+1, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); + hypre_MPI_Scan(&big_Fpts, fpts_starts + 1, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); fpts_starts[0] = fpts_starts[1] - big_Fpts; if (my_id == num_procs - 1) { total_global_fpts = fpts_starts[1]; total_global_cpts = cpts_starts[1]; } - hypre_MPI_Bcast(&total_global_fpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); - hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); + hypre_MPI_Bcast(&total_global_fpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); + hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif - for (i=start; i < stop; i++) + for (i = start; i < stop; i++) { if (CF_marker[i] > 0) { @@ -193,7 +197,7 @@ hypre_ParCSRMatrixGenerateFFFC( hypre_ParCSRMatrix *A, } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif if (my_thread_num == 0) { @@ -206,15 +210,17 @@ hypre_ParCSRMatrixGenerateFFFC( hypre_ParCSRMatrix *A, } index = 0; num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), HYPRE_MEMORY_HOST); - big_buf_data = hypre_CTAlloc(HYPRE_BigInt, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), HYPRE_MEMORY_HOST); + int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); + big_buf_data = hypre_CTAlloc(HYPRE_BigInt, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); for (i = 0; i < num_sends; i++) { startc = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = startc; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = startc; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { - int_buf_data[index] = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; - big_buf_data[index++] = big_convert[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + int_buf_data[index] = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; + big_buf_data[index++] = big_convert[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } } @@ -231,7 +237,7 @@ hypre_ParCSRMatrixGenerateFFFC( hypre_ParCSRMatrix *A, { if (CF_marker[i] < 0) { - for (j = S_offd_i[i]; j < S_offd_i[i+1]; j++) + for (j = S_offd_i[i]; j < S_offd_i[i + 1]; j++) { marker_offd[S_offd_j[j]] = 1; } @@ -242,7 +248,7 @@ hypre_ParCSRMatrixGenerateFFFC( hypre_ParCSRMatrix *A, num_cols_offd_A_FF = 0; if (num_cols_A_offd) { - for (i=0; i < num_cols_A_offd; i++) + for (i = 0; i < num_cols_A_offd; i++) { if (CF_marker_offd[i] > 0 && marker_offd[i] > 0) { @@ -261,7 +267,7 @@ hypre_ParCSRMatrixGenerateFFFC( hypre_ParCSRMatrix *A, cpt = 0; fpt = 0; - for (i=0; i < num_cols_A_offd; i++) + for (i = 0; i < num_cols_A_offd; i++) { if (CF_marker_offd[i] > 0 && marker_offd[i] > 0) { @@ -274,43 +280,51 @@ hypre_ParCSRMatrixGenerateFFFC( hypre_ParCSRMatrix *A, } } - A_FF_diag_i = hypre_CTAlloc(HYPRE_Int,n_Fpts+1, memory_location_P); - A_FC_diag_i = hypre_CTAlloc(HYPRE_Int,n_Fpts+1, memory_location_P); - A_FF_offd_i = hypre_CTAlloc(HYPRE_Int,n_Fpts+1, memory_location_P); - A_FC_offd_i = hypre_CTAlloc(HYPRE_Int,n_Fpts+1, memory_location_P); + A_FF_diag_i = hypre_CTAlloc(HYPRE_Int, n_Fpts + 1, memory_location_P); + A_FC_diag_i = hypre_CTAlloc(HYPRE_Int, n_Fpts + 1, memory_location_P); + A_FF_offd_i = hypre_CTAlloc(HYPRE_Int, n_Fpts + 1, memory_location_P); + A_FC_offd_i = hypre_CTAlloc(HYPRE_Int, n_Fpts + 1, memory_location_P); } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif d_count_FC = 0; d_count_FF = 0; o_count_FC = 0; o_count_FF = 0; row = fpt_array[my_thread_num]; - for (i=start; i < stop; i++) + for (i = start; i < stop; i++) { if (CF_marker[i] < 0) { row++; d_count_FF++; /* account for diagonal element */ - for (j = S_diag_i[i]; j < S_diag_i[i+1]; j++) + for (j = S_diag_i[i] + skip_diag; j < S_diag_i[i + 1]; j++) { jj = S_diag_j[j]; if (CF_marker[jj] > 0) + { d_count_FC++; + } else + { d_count_FF++; + } } A_FF_diag_i[row] = d_count_FF; A_FC_diag_i[row] = d_count_FC; - for (j = S_offd_i[i]; j < S_offd_i[i+1]; j++) + for (j = S_offd_i[i]; j < S_offd_i[i + 1]; j++) { jj = S_offd_j[j]; if (CF_marker_offd[jj] > 0) + { o_count_FC++; + } else + { o_count_FF++; + } } A_FF_offd_i[row] = o_count_FF; A_FC_offd_i[row] = o_count_FC; @@ -318,15 +332,15 @@ hypre_ParCSRMatrixGenerateFFFC( hypre_ParCSRMatrix *A, } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif if (my_thread_num == 0) { HYPRE_Int fpt2; - for (i=1; i 0) { A_FC_diag_j[d_count_FC] = fine_to_coarse[A_diag_j[jA]]; @@ -388,11 +402,11 @@ hypre_ParCSRMatrixGenerateFFFC( hypre_ParCSRMatrix *A, } A_FF_diag_i[row] = d_count_FF; A_FC_diag_i[row] = d_count_FC; - for (j = S_offd_i[i]; j < S_offd_i[i+1]; j++) + for (j = S_offd_i[i]; j < S_offd_i[i + 1]; j++) { jA = A_offd_i[i]; jS = S_offd_j[j]; - while (jS != A_offd_j[jA]) jA++; + while (jS != A_offd_j[jA]) { jA++; } if (CF_marker_offd[S_offd_j[j]] > 0) { A_FC_offd_j[o_count_FC] = fine_to_coarse_offd[A_offd_j[jA]]; @@ -411,22 +425,22 @@ hypre_ParCSRMatrixGenerateFFFC( hypre_ParCSRMatrix *A, } /*end parallel region */ A_FC = hypre_ParCSRMatrixCreate(comm, - total_global_fpts, - total_global_cpts, - fpts_starts, - cpts_starts, - num_cols_offd_A_FC, - A_FC_diag_i[n_Fpts], - A_FC_offd_i[n_Fpts]); + total_global_fpts, + total_global_cpts, + fpts_starts, + cpts_starts, + num_cols_offd_A_FC, + A_FC_diag_i[n_Fpts], + A_FC_offd_i[n_Fpts]); A_FF = hypre_ParCSRMatrixCreate(comm, - total_global_fpts, - total_global_fpts, - fpts_starts, - fpts_starts, - num_cols_offd_A_FF, - A_FF_diag_i[n_Fpts], - A_FF_offd_i[n_Fpts]); + total_global_fpts, + total_global_fpts, + fpts_starts, + fpts_starts, + num_cols_offd_A_FF, + A_FF_diag_i[n_Fpts], + A_FF_offd_i[n_Fpts]); A_FC_diag = hypre_ParCSRMatrixDiag(A_FC); hypre_CSRMatrixData(A_FC_diag) = A_FC_diag_data; @@ -466,7 +480,6 @@ hypre_ParCSRMatrixGenerateFFFC( hypre_ParCSRMatrix *A, hypre_TFree(marker_offd, HYPRE_MEMORY_HOST); hypre_TFree(cpt_array, HYPRE_MEMORY_HOST); hypre_TFree(fpt_array, HYPRE_MEMORY_HOST); - hypre_TFree(fpts_starts, HYPRE_MEMORY_HOST); *A_FC_ptr = A_FC; *A_FF_ptr = A_FF; @@ -474,9 +487,45 @@ hypre_ParCSRMatrixGenerateFFFC( hypre_ParCSRMatrix *A, return hypre_error_flag; } -/* ----------------------------------------------------------------------------- +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixGenerateFFFC + * + * Generate AFF or AFC + * + * TODO (VPM): build the communication package of the resulting matrices + * (A_FF and A_FC) from the communication package of the original matrix + * without doing MPI calls. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixGenerateFFFC( hypre_ParCSRMatrix *A, + HYPRE_Int *CF_marker, + HYPRE_BigInt *cpts_starts, + hypre_ParCSRMatrix *S, + hypre_ParCSRMatrix **A_FC_ptr, + hypre_ParCSRMatrix **A_FF_ptr) +{ +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(A) ); + + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_ParCSRMatrixGenerateFFFCDevice(A, CF_marker, cpts_starts, S, A_FC_ptr, A_FF_ptr); + } + else +#endif + { + hypre_ParCSRMatrixGenerateFFFCHost(A, CF_marker, cpts_starts, S, A_FC_ptr, A_FF_ptr); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixGenerateFFFC3 + * * generate AFF, AFC, for 2 stage extended interpolation - * ----------------------------------------------------------------------------- */ + *--------------------------------------------------------------------------*/ HYPRE_Int hypre_ParCSRMatrixGenerateFFFC3( hypre_ParCSRMatrix *A, @@ -496,6 +545,7 @@ hypre_ParCSRMatrixGenerateFFFC3( hypre_ParCSRMatrix *A, HYPRE_Complex *A_diag_data = hypre_CSRMatrixData(A_diag); HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); + /* off-diag part of A */ hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); HYPRE_Complex *A_offd_data = hypre_CSRMatrixData(A_offd); @@ -509,6 +559,7 @@ hypre_ParCSRMatrixGenerateFFFC3( hypre_ParCSRMatrix *A, hypre_CSRMatrix *S_diag = hypre_ParCSRMatrixDiag(S); HYPRE_Int *S_diag_i = hypre_CSRMatrixI(S_diag); HYPRE_Int *S_diag_j = hypre_CSRMatrixJ(S_diag); + /* off-diag part of S */ hypre_CSRMatrix *S_offd = hypre_ParCSRMatrixOffd(S); HYPRE_Int *S_offd_i = hypre_CSRMatrixI(S_offd); @@ -516,8 +567,8 @@ hypre_ParCSRMatrixGenerateFFFC3( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *A_FC; hypre_CSRMatrix *A_FC_diag, *A_FC_offd; - HYPRE_Int *A_FC_diag_i, *A_FC_diag_j, *A_FC_offd_i, *A_FC_offd_j=NULL; - HYPRE_Complex *A_FC_diag_data, *A_FC_offd_data=NULL; + HYPRE_Int *A_FC_diag_i, *A_FC_diag_j, *A_FC_offd_i, *A_FC_offd_j = NULL; + HYPRE_Complex *A_FC_diag_data, *A_FC_offd_data = NULL; HYPRE_Int num_cols_offd_A_FC; HYPRE_BigInt *col_map_offd_A_FC = NULL; @@ -543,7 +594,7 @@ hypre_ParCSRMatrixGenerateFFFC3( hypre_ParCSRMatrix *A, HYPRE_BigInt *big_buf_data = NULL; HYPRE_BigInt total_global_fpts, total_global_cpts, total_global_new_fpts; - HYPRE_BigInt *fpts_starts, *new_fpts_starts; + HYPRE_BigInt fpts_starts[2], new_fpts_starts[2]; HYPRE_Int my_id, num_procs, num_sends; HYPRE_Int d_count_FF, d_count_FC, o_count_FF, o_count_FC; HYPRE_Int n_Fpts; @@ -562,60 +613,60 @@ hypre_ParCSRMatrixGenerateFFFC3( hypre_ParCSRMatrix *A, fine_to_fine = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); big_convert = hypre_CTAlloc(HYPRE_BigInt, n_fine, HYPRE_MEMORY_HOST); - cpt_array = hypre_CTAlloc(HYPRE_Int, num_threads+1, HYPRE_MEMORY_HOST); - fpt_array = hypre_CTAlloc(HYPRE_Int, num_threads+1, HYPRE_MEMORY_HOST); - new_fpt_array = hypre_CTAlloc(HYPRE_Int, num_threads+1, HYPRE_MEMORY_HOST); + cpt_array = hypre_CTAlloc(HYPRE_Int, num_threads + 1, HYPRE_MEMORY_HOST); + fpt_array = hypre_CTAlloc(HYPRE_Int, num_threads + 1, HYPRE_MEMORY_HOST); + new_fpt_array = hypre_CTAlloc(HYPRE_Int, num_threads + 1, HYPRE_MEMORY_HOST); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel private(i,j,jj,start,stop,row,rowc,cpt,new_fpt,fpt,d_count_FC,d_count_FF,o_count_FC,o_count_FF) + #pragma omp parallel private(i,j,jj,start,stop,row,rowc,cpt,new_fpt,fpt,d_count_FC,d_count_FF,o_count_FC,o_count_FF) #endif { HYPRE_Int my_thread_num = hypre_GetThreadNum(); - start = (n_fine/num_threads)*my_thread_num; - if (my_thread_num == num_threads-1) + start = (n_fine / num_threads) * my_thread_num; + if (my_thread_num == num_threads - 1) { stop = n_fine; } else { - stop = (n_fine/num_threads)*(my_thread_num+1); + stop = (n_fine / num_threads) * (my_thread_num + 1); } - for (i=start; i < stop; i++) + for (i = start; i < stop; i++) { if (CF_marker[i] > 0) { - cpt_array[my_thread_num+1]++; + cpt_array[my_thread_num + 1]++; } else if (CF_marker[i] == -2) { - new_fpt_array[my_thread_num+1]++; - fpt_array[my_thread_num+1]++; + new_fpt_array[my_thread_num + 1]++; + fpt_array[my_thread_num + 1]++; } else { - fpt_array[my_thread_num+1]++; + fpt_array[my_thread_num + 1]++; } } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif if (my_thread_num == 0) { - for (i=1; i < num_threads; i++) + for (i = 1; i < num_threads; i++) { - cpt_array[i+1] += cpt_array[i]; - fpt_array[i+1] += fpt_array[i]; - new_fpt_array[i+1] += new_fpt_array[i]; + cpt_array[i + 1] += cpt_array[i]; + fpt_array[i + 1] += fpt_array[i]; + new_fpt_array[i + 1] += new_fpt_array[i]; } } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif cpt = cpt_array[my_thread_num]; fpt = fpt_array[my_thread_num]; - for (i=start; i < stop; i++) + for (i = start; i < stop; i++) { if (CF_marker[i] > 0) { @@ -629,7 +680,7 @@ hypre_ParCSRMatrixGenerateFFFC3( hypre_ParCSRMatrix *A, } } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif if (my_thread_num == 0) @@ -640,10 +691,8 @@ hypre_ParCSRMatrixGenerateFFFC3( hypre_ParCSRMatrix *A, big_Fpts = n_Fpts; big_new_Fpts = n_new_Fpts; - fpts_starts = hypre_CTAlloc(HYPRE_BigInt, 2, HYPRE_MEMORY_HOST); - new_fpts_starts = hypre_CTAlloc(HYPRE_BigInt, 2, HYPRE_MEMORY_HOST); - hypre_MPI_Scan(&big_Fpts, fpts_starts+1, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); - hypre_MPI_Scan(&big_new_Fpts, new_fpts_starts+1, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); + hypre_MPI_Scan(&big_Fpts, fpts_starts + 1, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); + hypre_MPI_Scan(&big_new_Fpts, new_fpts_starts + 1, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); fpts_starts[0] = fpts_starts[1] - big_Fpts; new_fpts_starts[0] = new_fpts_starts[1] - big_new_Fpts; if (my_id == num_procs - 1) @@ -652,15 +701,15 @@ hypre_ParCSRMatrixGenerateFFFC3( hypre_ParCSRMatrix *A, total_global_fpts = fpts_starts[1]; total_global_cpts = cpts_starts[1]; } - hypre_MPI_Bcast(&total_global_new_fpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); - hypre_MPI_Bcast(&total_global_fpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); - hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); + hypre_MPI_Bcast(&total_global_new_fpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); + hypre_MPI_Bcast(&total_global_fpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); + hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif - for (i=start; i < stop; i++) + for (i = start; i < stop; i++) { if (CF_marker[i] > 0) { @@ -673,7 +722,7 @@ hypre_ParCSRMatrixGenerateFFFC3( hypre_ParCSRMatrix *A, } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif if (my_thread_num == 0) { @@ -686,15 +735,19 @@ hypre_ParCSRMatrixGenerateFFFC3( hypre_ParCSRMatrix *A, } index = 0; num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), HYPRE_MEMORY_HOST); - big_buf_data = hypre_CTAlloc(HYPRE_BigInt, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), HYPRE_MEMORY_HOST); + int_buf_data = hypre_CTAlloc(HYPRE_Int, + hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); + big_buf_data = hypre_CTAlloc(HYPRE_BigInt, + hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); for (i = 0; i < num_sends; i++) { startc = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = startc; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = startc; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { - int_buf_data[index] = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; - big_buf_data[index++] = big_convert[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + int_buf_data[index] = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; + big_buf_data[index++] = big_convert[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } } @@ -702,7 +755,7 @@ hypre_ParCSRMatrixGenerateFFFC3( hypre_ParCSRMatrix *A, hypre_ParCSRCommHandleDestroy(comm_handle); - comm_handle = hypre_ParCSRCommHandleCreate( 21, comm_pkg, big_buf_data, big_convert_offd); + comm_handle = hypre_ParCSRCommHandleCreate(21, comm_pkg, big_buf_data, big_convert_offd); hypre_ParCSRCommHandleDestroy(comm_handle); @@ -710,7 +763,7 @@ hypre_ParCSRMatrixGenerateFFFC3( hypre_ParCSRMatrix *A, num_cols_offd_A_FF = 0; if (num_cols_A_offd) { - for (i=0; i < num_cols_A_offd; i++) + for (i = 0; i < num_cols_A_offd; i++) { if (CF_marker_offd[i] > 0) { @@ -729,7 +782,7 @@ hypre_ParCSRMatrixGenerateFFFC3( hypre_ParCSRMatrix *A, cpt = 0; fpt = 0; - for (i=0; i < num_cols_A_offd; i++) + for (i = 0; i < num_cols_A_offd; i++) { if (CF_marker_offd[i] > 0) { @@ -737,19 +790,19 @@ hypre_ParCSRMatrixGenerateFFFC3( hypre_ParCSRMatrix *A, } else { - col_map_offd_A_FF[fpt++] = big_convert_offd[i]; + col_map_offd_A_FF[fpt++] = big_convert_offd[i]; } } } - A_FF_diag_i = hypre_CTAlloc(HYPRE_Int,n_new_Fpts+1, memory_location_P); - A_FC_diag_i = hypre_CTAlloc(HYPRE_Int,n_Fpts+1, memory_location_P); - A_FF_offd_i = hypre_CTAlloc(HYPRE_Int,n_new_Fpts+1, memory_location_P); - A_FC_offd_i = hypre_CTAlloc(HYPRE_Int,n_Fpts+1, memory_location_P); + A_FF_diag_i = hypre_CTAlloc(HYPRE_Int, n_new_Fpts + 1, memory_location_P); + A_FC_diag_i = hypre_CTAlloc(HYPRE_Int, n_Fpts + 1, memory_location_P); + A_FF_offd_i = hypre_CTAlloc(HYPRE_Int, n_new_Fpts + 1, memory_location_P); + A_FC_offd_i = hypre_CTAlloc(HYPRE_Int, n_Fpts + 1, memory_location_P); } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif d_count_FC = 0; d_count_FF = 0; @@ -757,30 +810,38 @@ hypre_ParCSRMatrixGenerateFFFC3( hypre_ParCSRMatrix *A, o_count_FF = 0; row = new_fpt_array[my_thread_num]; rowc = fpt_array[my_thread_num]; - for (i=start; i < stop; i++) + for (i = start; i < stop; i++) { if (CF_marker[i] == -2) { row++; rowc++; d_count_FF++; /* account for diagonal element */ - for (j = S_diag_i[i]; j < S_diag_i[i+1]; j++) + for (j = S_diag_i[i]; j < S_diag_i[i + 1]; j++) { jj = S_diag_j[j]; if (CF_marker[jj] > 0) + { d_count_FC++; + } else + { d_count_FF++; + } } A_FF_diag_i[row] = d_count_FF; A_FC_diag_i[rowc] = d_count_FC; - for (j = S_offd_i[i]; j < S_offd_i[i+1]; j++) + for (j = S_offd_i[i]; j < S_offd_i[i + 1]; j++) { jj = S_offd_j[j]; if (CF_marker_offd[jj] > 0) + { o_count_FC++; + } else + { o_count_FF++; + } } A_FF_offd_i[row] = o_count_FF; A_FC_offd_i[rowc] = o_count_FC; @@ -788,35 +849,39 @@ hypre_ParCSRMatrixGenerateFFFC3( hypre_ParCSRMatrix *A, else if (CF_marker[i] < 0) { rowc++; - for (j = S_diag_i[i]; j < S_diag_i[i+1]; j++) + for (j = S_diag_i[i]; j < S_diag_i[i + 1]; j++) { jj = S_diag_j[j]; if (CF_marker[jj] > 0) + { d_count_FC++; + } } A_FC_diag_i[rowc] = d_count_FC; - for (j = S_offd_i[i]; j < S_offd_i[i+1]; j++) + for (j = S_offd_i[i]; j < S_offd_i[i + 1]; j++) { jj = S_offd_j[j]; if (CF_marker_offd[jj] > 0) + { o_count_FC++; + } } A_FC_offd_i[rowc] = o_count_FC; } } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif if (my_thread_num == 0) { HYPRE_Int fpt2, new_fpt2; - for (i=1; i 0) { A_FC_diag_j[d_count_FC] = fine_to_coarse[A_diag_j[jA]]; @@ -881,11 +946,11 @@ hypre_ParCSRMatrixGenerateFFFC3( hypre_ParCSRMatrix *A, } A_FF_diag_i[row] = d_count_FF; A_FC_diag_i[rowc] = d_count_FC; - for (j = S_offd_i[i]; j < S_offd_i[i+1]; j++) + for (j = S_offd_i[i]; j < S_offd_i[i + 1]; j++) { jA = A_offd_i[i]; jS = S_offd_j[j]; - while (jS != A_offd_j[jA]) jA++; + while (jS != A_offd_j[jA]) { jA++; } if (CF_marker_offd[S_offd_j[j]] > 0) { A_FC_offd_j[o_count_FC] = fine_to_coarse_offd[A_offd_j[jA]]; @@ -904,11 +969,11 @@ hypre_ParCSRMatrixGenerateFFFC3( hypre_ParCSRMatrix *A, { HYPRE_Int jS, jA; rowc++; - for (j = S_diag_i[i]; j < S_diag_i[i+1]; j++) + for (j = S_diag_i[i]; j < S_diag_i[i + 1]; j++) { - jA = A_diag_i[i]+1; + jA = A_diag_i[i] + 1; jS = S_diag_j[j]; - while (A_diag_j[jA] != jS) jA++; + while (A_diag_j[jA] != jS) { jA++; } if (CF_marker[S_diag_j[j]] > 0) { A_FC_diag_j[d_count_FC] = fine_to_coarse[A_diag_j[jA]]; @@ -916,11 +981,11 @@ hypre_ParCSRMatrixGenerateFFFC3( hypre_ParCSRMatrix *A, } } A_FC_diag_i[rowc] = d_count_FC; - for (j = S_offd_i[i]; j < S_offd_i[i+1]; j++) + for (j = S_offd_i[i]; j < S_offd_i[i + 1]; j++) { jA = A_offd_i[i]; jS = S_offd_j[j]; - while (jS != A_offd_j[jA]) jA++; + while (jS != A_offd_j[jA]) { jA++; } if (CF_marker_offd[S_offd_j[j]] > 0) { A_FC_offd_j[o_count_FC] = fine_to_coarse_offd[A_offd_j[jA]]; @@ -933,22 +998,22 @@ hypre_ParCSRMatrixGenerateFFFC3( hypre_ParCSRMatrix *A, } /*end parallel region */ A_FC = hypre_ParCSRMatrixCreate(comm, - total_global_fpts, - total_global_cpts, - fpts_starts, - cpts_starts, - num_cols_offd_A_FC, - A_FC_diag_i[n_Fpts], - A_FC_offd_i[n_Fpts]); + total_global_fpts, + total_global_cpts, + fpts_starts, + cpts_starts, + num_cols_offd_A_FC, + A_FC_diag_i[n_Fpts], + A_FC_offd_i[n_Fpts]); A_FF = hypre_ParCSRMatrixCreate(comm, - total_global_new_fpts, - total_global_fpts, - new_fpts_starts, - fpts_starts, - num_cols_offd_A_FF, - A_FF_diag_i[n_new_Fpts], - A_FF_offd_i[n_new_Fpts]); + total_global_new_fpts, + total_global_fpts, + new_fpts_starts, + fpts_starts, + num_cols_offd_A_FF, + A_FF_diag_i[n_new_Fpts], + A_FF_offd_i[n_new_Fpts]); A_FC_diag = hypre_ParCSRMatrixDiag(A_FC); hypre_CSRMatrixData(A_FC_diag) = A_FC_diag_data; @@ -989,17 +1054,18 @@ hypre_ParCSRMatrixGenerateFFFC3( hypre_ParCSRMatrix *A, hypre_TFree(cpt_array, HYPRE_MEMORY_HOST); hypre_TFree(fpt_array, HYPRE_MEMORY_HOST); hypre_TFree(new_fpt_array, HYPRE_MEMORY_HOST); - hypre_TFree(fpts_starts, HYPRE_MEMORY_HOST); - hypre_TFree(new_fpts_starts, HYPRE_MEMORY_HOST); *A_FC_ptr = A_FC; *A_FF_ptr = A_FF; return hypre_error_flag; } -/* ----------------------------------------------------------------------------- - * generate AFF, AFC, AFFC for 2 stage extended+i(e)interpolation - * ----------------------------------------------------------------------------- */ + +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixGenerateFFFCD3 + * + * Generate AFF, AFC, AFFC for 2 stage extended+i(e)interpolation + *--------------------------------------------------------------------------*/ HYPRE_Int hypre_ParCSRMatrixGenerateFFFCD3( hypre_ParCSRMatrix *A, @@ -1041,8 +1107,8 @@ hypre_ParCSRMatrixGenerateFFFCD3( hypre_ParCSRMatrix *A, HYPRE_Real *D_lambda; hypre_ParCSRMatrix *A_FC; hypre_CSRMatrix *A_FC_diag, *A_FC_offd; - HYPRE_Int *A_FC_diag_i, *A_FC_diag_j, *A_FC_offd_i, *A_FC_offd_j=NULL; - HYPRE_Complex *A_FC_diag_data, *A_FC_offd_data=NULL; + HYPRE_Int *A_FC_diag_i, *A_FC_diag_j, *A_FC_offd_i, *A_FC_offd_j = NULL; + HYPRE_Complex *A_FC_diag_data, *A_FC_offd_data = NULL; HYPRE_Int num_cols_offd_A_FC; HYPRE_BigInt *col_map_offd_A_FC = NULL; @@ -1068,7 +1134,7 @@ hypre_ParCSRMatrixGenerateFFFCD3( hypre_ParCSRMatrix *A, HYPRE_BigInt *big_buf_data = NULL; HYPRE_BigInt total_global_fpts, total_global_cpts, total_global_new_fpts; - HYPRE_BigInt *fpts_starts, *new_fpts_starts; + HYPRE_BigInt fpts_starts[2], new_fpts_starts[2]; HYPRE_Int my_id, num_procs, num_sends; HYPRE_Int d_count_FF, d_count_FC, o_count_FF, o_count_FC; HYPRE_Int n_Fpts; @@ -1087,60 +1153,60 @@ hypre_ParCSRMatrixGenerateFFFCD3( hypre_ParCSRMatrix *A, fine_to_fine = hypre_CTAlloc(HYPRE_Int, n_fine, HYPRE_MEMORY_HOST); big_convert = hypre_CTAlloc(HYPRE_BigInt, n_fine, HYPRE_MEMORY_HOST); - cpt_array = hypre_CTAlloc(HYPRE_Int, num_threads+1, HYPRE_MEMORY_HOST); - fpt_array = hypre_CTAlloc(HYPRE_Int, num_threads+1, HYPRE_MEMORY_HOST); - new_fpt_array = hypre_CTAlloc(HYPRE_Int, num_threads+1, HYPRE_MEMORY_HOST); + cpt_array = hypre_CTAlloc(HYPRE_Int, num_threads + 1, HYPRE_MEMORY_HOST); + fpt_array = hypre_CTAlloc(HYPRE_Int, num_threads + 1, HYPRE_MEMORY_HOST); + new_fpt_array = hypre_CTAlloc(HYPRE_Int, num_threads + 1, HYPRE_MEMORY_HOST); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel private(i,j,jj,start,stop,row,rowc,cpt,new_fpt,fpt,d_count_FC,d_count_FF,o_count_FC,o_count_FF) + #pragma omp parallel private(i,j,jj,start,stop,row,rowc,cpt,new_fpt,fpt,d_count_FC,d_count_FF,o_count_FC,o_count_FF) #endif { HYPRE_Int my_thread_num = hypre_GetThreadNum(); - start = (n_fine/num_threads)*my_thread_num; - if (my_thread_num == num_threads-1) + start = (n_fine / num_threads) * my_thread_num; + if (my_thread_num == num_threads - 1) { stop = n_fine; } else { - stop = (n_fine/num_threads)*(my_thread_num+1); + stop = (n_fine / num_threads) * (my_thread_num + 1); } - for (i=start; i < stop; i++) + for (i = start; i < stop; i++) { if (CF_marker[i] > 0) { - cpt_array[my_thread_num+1]++; + cpt_array[my_thread_num + 1]++; } else if (CF_marker[i] == -2) { - new_fpt_array[my_thread_num+1]++; - fpt_array[my_thread_num+1]++; + new_fpt_array[my_thread_num + 1]++; + fpt_array[my_thread_num + 1]++; } else { - fpt_array[my_thread_num+1]++; + fpt_array[my_thread_num + 1]++; } } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif if (my_thread_num == 0) { - for (i=1; i < num_threads; i++) + for (i = 1; i < num_threads; i++) { - cpt_array[i+1] += cpt_array[i]; - fpt_array[i+1] += fpt_array[i]; - new_fpt_array[i+1] += new_fpt_array[i]; + cpt_array[i + 1] += cpt_array[i]; + fpt_array[i + 1] += fpt_array[i]; + new_fpt_array[i + 1] += new_fpt_array[i]; } } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif cpt = cpt_array[my_thread_num]; fpt = fpt_array[my_thread_num]; - for (i=start; i < stop; i++) + for (i = start; i < stop; i++) { if (CF_marker[i] > 0) { @@ -1154,7 +1220,7 @@ hypre_ParCSRMatrixGenerateFFFCD3( hypre_ParCSRMatrix *A, } } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif if (my_thread_num == 0) @@ -1165,10 +1231,9 @@ hypre_ParCSRMatrixGenerateFFFCD3( hypre_ParCSRMatrix *A, big_Fpts = n_Fpts; big_new_Fpts = n_new_Fpts; - fpts_starts = hypre_CTAlloc(HYPRE_BigInt, 2, HYPRE_MEMORY_HOST); - new_fpts_starts = hypre_CTAlloc(HYPRE_BigInt, 2, HYPRE_MEMORY_HOST); - hypre_MPI_Scan(&big_Fpts, fpts_starts+1, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); - hypre_MPI_Scan(&big_new_Fpts, new_fpts_starts+1, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); + hypre_MPI_Scan(&big_Fpts, fpts_starts + 1, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); + hypre_MPI_Scan(&big_new_Fpts, new_fpts_starts + 1, 1, HYPRE_MPI_BIG_INT, + hypre_MPI_SUM, comm); fpts_starts[0] = fpts_starts[1] - big_Fpts; new_fpts_starts[0] = new_fpts_starts[1] - big_new_Fpts; if (my_id == num_procs - 1) @@ -1177,15 +1242,15 @@ hypre_ParCSRMatrixGenerateFFFCD3( hypre_ParCSRMatrix *A, total_global_fpts = fpts_starts[1]; total_global_cpts = cpts_starts[1]; } - hypre_MPI_Bcast(&total_global_new_fpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); - hypre_MPI_Bcast(&total_global_fpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); - hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); + hypre_MPI_Bcast(&total_global_new_fpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); + hypre_MPI_Bcast(&total_global_fpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); + hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif - for (i=start; i < stop; i++) + for (i = start; i < stop; i++) { if (CF_marker[i] > 0) { @@ -1198,7 +1263,7 @@ hypre_ParCSRMatrixGenerateFFFCD3( hypre_ParCSRMatrix *A, } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif if (my_thread_num == 0) { @@ -1211,23 +1276,27 @@ hypre_ParCSRMatrixGenerateFFFCD3( hypre_ParCSRMatrix *A, } index = 0; num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), HYPRE_MEMORY_HOST); - big_buf_data = hypre_CTAlloc(HYPRE_BigInt, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), HYPRE_MEMORY_HOST); + int_buf_data = hypre_CTAlloc(HYPRE_Int, + hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); + big_buf_data = hypre_CTAlloc(HYPRE_BigInt, + hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); for (i = 0; i < num_sends; i++) { startc = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = startc; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = startc; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { - int_buf_data[index] = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; - big_buf_data[index++] = big_convert[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + int_buf_data[index] = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; + big_buf_data[index++] = big_convert[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } } - comm_handle = hypre_ParCSRCommHandleCreate( 11, comm_pkg, int_buf_data, CF_marker_offd); + comm_handle = hypre_ParCSRCommHandleCreate(11, comm_pkg, int_buf_data, CF_marker_offd); hypre_ParCSRCommHandleDestroy(comm_handle); - comm_handle = hypre_ParCSRCommHandleCreate( 21, comm_pkg, big_buf_data, big_convert_offd); + comm_handle = hypre_ParCSRCommHandleCreate(21, comm_pkg, big_buf_data, big_convert_offd); hypre_ParCSRCommHandleDestroy(comm_handle); @@ -1235,7 +1304,7 @@ hypre_ParCSRMatrixGenerateFFFCD3( hypre_ParCSRMatrix *A, num_cols_offd_A_FF = 0; if (num_cols_A_offd) { - for (i=0; i < num_cols_A_offd; i++) + for (i = 0; i < num_cols_A_offd; i++) { if (CF_marker_offd[i] > 0) { @@ -1254,7 +1323,7 @@ hypre_ParCSRMatrixGenerateFFFCD3( hypre_ParCSRMatrix *A, cpt = 0; fpt = 0; - for (i=0; i < num_cols_A_offd; i++) + for (i = 0; i < num_cols_A_offd; i++) { if (CF_marker_offd[i] > 0) { @@ -1262,20 +1331,20 @@ hypre_ParCSRMatrixGenerateFFFCD3( hypre_ParCSRMatrix *A, } else { - col_map_offd_A_FF[fpt++] = big_convert_offd[i]; + col_map_offd_A_FF[fpt++] = big_convert_offd[i]; } } } - A_FF_diag_i = hypre_CTAlloc(HYPRE_Int,n_new_Fpts+1, memory_location_P); - A_FC_diag_i = hypre_CTAlloc(HYPRE_Int,n_Fpts+1, memory_location_P); - A_FF_offd_i = hypre_CTAlloc(HYPRE_Int,n_new_Fpts+1, memory_location_P); - A_FC_offd_i = hypre_CTAlloc(HYPRE_Int,n_Fpts+1, memory_location_P); + A_FF_diag_i = hypre_CTAlloc(HYPRE_Int, n_new_Fpts + 1, memory_location_P); + A_FC_diag_i = hypre_CTAlloc(HYPRE_Int, n_Fpts + 1, memory_location_P); + A_FF_offd_i = hypre_CTAlloc(HYPRE_Int, n_new_Fpts + 1, memory_location_P); + A_FC_offd_i = hypre_CTAlloc(HYPRE_Int, n_Fpts + 1, memory_location_P); D_lambda = hypre_CTAlloc(HYPRE_Real, n_Fpts, memory_location_P); } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif d_count_FC = 0; d_count_FF = 0; @@ -1283,30 +1352,38 @@ hypre_ParCSRMatrixGenerateFFFCD3( hypre_ParCSRMatrix *A, o_count_FF = 0; row = new_fpt_array[my_thread_num]; rowc = fpt_array[my_thread_num]; - for (i=start; i < stop; i++) + for (i = start; i < stop; i++) { if (CF_marker[i] == -2) { row++; rowc++; d_count_FF++; /* account for diagonal element */ - for (j = S_diag_i[i]; j < S_diag_i[i+1]; j++) + for (j = S_diag_i[i]; j < S_diag_i[i + 1]; j++) { jj = S_diag_j[j]; if (CF_marker[jj] > 0) + { d_count_FC++; + } else + { d_count_FF++; + } } A_FF_diag_i[row] = d_count_FF; A_FC_diag_i[rowc] = d_count_FC; - for (j = S_offd_i[i]; j < S_offd_i[i+1]; j++) + for (j = S_offd_i[i]; j < S_offd_i[i + 1]; j++) { jj = S_offd_j[j]; if (CF_marker_offd[jj] > 0) + { o_count_FC++; + } else + { o_count_FF++; + } } A_FF_offd_i[row] = o_count_FF; A_FC_offd_i[rowc] = o_count_FC; @@ -1314,35 +1391,39 @@ hypre_ParCSRMatrixGenerateFFFCD3( hypre_ParCSRMatrix *A, else if (CF_marker[i] < 0) { rowc++; - for (j = S_diag_i[i]; j < S_diag_i[i+1]; j++) + for (j = S_diag_i[i]; j < S_diag_i[i + 1]; j++) { jj = S_diag_j[j]; if (CF_marker[jj] > 0) + { d_count_FC++; + } } A_FC_diag_i[rowc] = d_count_FC; - for (j = S_offd_i[i]; j < S_offd_i[i+1]; j++) + for (j = S_offd_i[i]; j < S_offd_i[i + 1]; j++) { jj = S_offd_j[j]; if (CF_marker_offd[jj] > 0) + { o_count_FC++; + } } A_FC_offd_i[rowc] = o_count_FC; } } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif if (my_thread_num == 0) { HYPRE_Int fpt2, new_fpt2; - for (i=1; i 0) { A_FC_diag_j[d_count_FC] = fine_to_coarse[A_diag_j[jA]]; @@ -1407,11 +1488,11 @@ hypre_ParCSRMatrixGenerateFFFCD3( hypre_ParCSRMatrix *A, A_FF_diag_data[d_count_FF++] = A_diag_data[jA++]; } } - for (j = S_offd_i[i]; j < S_offd_i[i+1]; j++) + for (j = S_offd_i[i]; j < S_offd_i[i + 1]; j++) { jA = A_offd_i[i]; jS = S_offd_j[j]; - while (jS != A_offd_j[jA]) jA++; + while (jS != A_offd_j[jA]) { jA++; } if (CF_marker_offd[S_offd_j[j]] > 0) { A_FC_offd_j[o_count_FC] = fine_to_coarse_offd[A_offd_j[jA]]; @@ -1425,7 +1506,7 @@ hypre_ParCSRMatrixGenerateFFFCD3( hypre_ParCSRMatrix *A, A_FF_offd_data[o_count_FF++] = A_offd_data[jA++]; } } - if (sum) D_lambda[rowc] = D_lambda[rowc]/sum; + if (sum) { D_lambda[rowc] = D_lambda[rowc] / sum; } rowc++; A_FF_diag_i[row] = d_count_FF; A_FC_diag_i[rowc] = d_count_FC; @@ -1436,11 +1517,11 @@ hypre_ParCSRMatrixGenerateFFFCD3( hypre_ParCSRMatrix *A, { HYPRE_Int jS, jA; HYPRE_Real sum = 0; - for (j = S_diag_i[i]; j < S_diag_i[i+1]; j++) + for (j = S_diag_i[i]; j < S_diag_i[i + 1]; j++) { - jA = A_diag_i[i]+1; + jA = A_diag_i[i] + 1; jS = S_diag_j[j]; - while (A_diag_j[jA] != jS) jA++; + while (A_diag_j[jA] != jS) { jA++; } if (CF_marker[S_diag_j[j]] > 0) { A_FC_diag_j[d_count_FC] = fine_to_coarse[A_diag_j[jA]]; @@ -1452,11 +1533,11 @@ hypre_ParCSRMatrixGenerateFFFCD3( hypre_ParCSRMatrix *A, D_lambda[rowc] += A_diag_data[jA]; } } - for (j = S_offd_i[i]; j < S_offd_i[i+1]; j++) + for (j = S_offd_i[i]; j < S_offd_i[i + 1]; j++) { jA = A_offd_i[i]; jS = S_offd_j[j]; - while (jS != A_offd_j[jA]) jA++; + while (jS != A_offd_j[jA]) { jA++; } if (CF_marker_offd[S_offd_j[j]] > 0) { A_FC_offd_j[o_count_FC] = fine_to_coarse_offd[A_offd_j[jA]]; @@ -1468,7 +1549,7 @@ hypre_ParCSRMatrixGenerateFFFCD3( hypre_ParCSRMatrix *A, D_lambda[rowc] += A_offd_data[jA]; } } - if (sum) D_lambda[rowc] = D_lambda[rowc]/sum; + if (sum) { D_lambda[rowc] = D_lambda[rowc] / sum; } rowc++; A_FC_diag_i[rowc] = d_count_FC; A_FC_offd_i[rowc] = o_count_FC; @@ -1477,22 +1558,22 @@ hypre_ParCSRMatrixGenerateFFFCD3( hypre_ParCSRMatrix *A, } /*end parallel region */ A_FC = hypre_ParCSRMatrixCreate(comm, - total_global_fpts, - total_global_cpts, - fpts_starts, - cpts_starts, - num_cols_offd_A_FC, - A_FC_diag_i[n_Fpts], - A_FC_offd_i[n_Fpts]); + total_global_fpts, + total_global_cpts, + fpts_starts, + cpts_starts, + num_cols_offd_A_FC, + A_FC_diag_i[n_Fpts], + A_FC_offd_i[n_Fpts]); A_FF = hypre_ParCSRMatrixCreate(comm, - total_global_new_fpts, - total_global_fpts, - new_fpts_starts, - fpts_starts, - num_cols_offd_A_FF, - A_FF_diag_i[n_new_Fpts], - A_FF_offd_i[n_new_Fpts]); + total_global_new_fpts, + total_global_fpts, + new_fpts_starts, + fpts_starts, + num_cols_offd_A_FF, + A_FF_diag_i[n_new_Fpts], + A_FF_offd_i[n_new_Fpts]); A_FC_diag = hypre_ParCSRMatrixDiag(A_FC); hypre_CSRMatrixData(A_FC_diag) = A_FC_diag_data; @@ -1533,8 +1614,6 @@ hypre_ParCSRMatrixGenerateFFFCD3( hypre_ParCSRMatrix *A, hypre_TFree(cpt_array, HYPRE_MEMORY_HOST); hypre_TFree(fpt_array, HYPRE_MEMORY_HOST); hypre_TFree(new_fpt_array, HYPRE_MEMORY_HOST); - hypre_TFree(fpts_starts, HYPRE_MEMORY_HOST); - hypre_TFree(new_fpts_starts, HYPRE_MEMORY_HOST); *A_FC_ptr = A_FC; *A_FF_ptr = A_FF; diff --git a/external/hypre/src/parcsr_mv/headers b/external/hypre/src/parcsr_mv/headers old mode 100644 new mode 100755 index 1fd98021..dd9a4351 --- a/external/hypre/src/parcsr_mv/headers +++ b/external/hypre/src/parcsr_mv/headers @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -20,6 +20,7 @@ cat > $INTERNAL_HEADER <<@ #include #include "HYPRE_parcsr_mv.h" #include "_hypre_utilities.h" +#include "_hypre_seq_block_mv.h" #include "seq_mv.h" #ifdef __cplusplus @@ -57,4 +58,3 @@ cat >> $INTERNAL_HEADER <<@ #endif @ - diff --git a/external/hypre/src/parcsr_mv/new_commpkg.c b/external/hypre/src/parcsr_mv/new_commpkg.c index 74e1eb43..f835fa3e 100644 --- a/external/hypre/src/parcsr_mv/new_commpkg.c +++ b/external/hypre/src/parcsr_mv/new_commpkg.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,32 +17,25 @@ /*==========================================================================*/ - - -HYPRE_Int hypre_PrintCommpkg(hypre_ParCSRMatrix *A, const char *file_name) +HYPRE_Int +hypre_PrintCommpkg(hypre_ParCSRMatrix *A, const char *file_name) { - - HYPRE_Int num_sends, num_recvs; + HYPRE_Int num_components, num_sends, num_recvs; HYPRE_Int *recv_vec_starts, *recv_procs; HYPRE_Int *send_map_starts, *send_map_elements, *send_procs; - HYPRE_Int i; - HYPRE_Int my_id; - - MPI_Comm comm; - + HYPRE_Int i; + HYPRE_Int my_id; + MPI_Comm comm; hypre_ParCSRCommPkg *comm_pkg; - char new_file[80]; FILE *fp; - comm_pkg = hypre_ParCSRMatrixCommPkg(A); - - - comm = hypre_ParCSRCommPkgComm(comm_pkg); - + comm_pkg = hypre_ParCSRMatrixCommPkg(A); + comm = hypre_ParCSRCommPkgComm(comm_pkg); + num_components = hypre_ParCSRCommPkgNumComponents(comm_pkg); num_recvs = hypre_ParCSRCommPkgNumRecvs(comm_pkg); recv_procs = hypre_ParCSRCommPkgRecvProcs(comm_pkg); recv_vec_starts = hypre_ParCSRCommPkgRecvVecStarts(comm_pkg); @@ -51,25 +44,27 @@ HYPRE_Int hypre_PrintCommpkg(hypre_ParCSRMatrix *A, const char *file_name) send_map_starts = hypre_ParCSRCommPkgSendMapStarts(comm_pkg); send_map_elements = hypre_ParCSRCommPkgSendMapElmts(comm_pkg); - hypre_MPI_Comm_rank(comm, &my_id); - hypre_sprintf(new_file,"%s.%d",file_name,my_id); + hypre_sprintf(new_file, "%s.%d", file_name, my_id); fp = fopen(new_file, "w"); + hypre_fprintf(fp, "num_components = %d\n", num_components); hypre_fprintf(fp, "num_recvs = %d\n", num_recvs); - for (i=0; i < num_recvs; i++) + for (i = 0; i < num_recvs; i++) { - hypre_fprintf(fp, "recv_proc [start, end] = %d [%d, %d] \n", recv_procs[i], recv_vec_starts[i], recv_vec_starts[i+1]-1); + hypre_fprintf(fp, "recv_proc [start, end] = %d [%d, %d] \n", recv_procs[i], recv_vec_starts[i], + recv_vec_starts[i + 1] - 1); } hypre_fprintf(fp, "num_sends = %d\n", num_sends); - for (i=0; i < num_sends; i++) + for (i = 0; i < num_sends; i++) { - hypre_fprintf(fp, "send_proc [start, end] = %d [%d, %d] \n", send_procs[i], send_map_starts[i], send_map_starts[i+1]-1); + hypre_fprintf(fp, "send_proc [start, end] = %d [%d, %d] \n", send_procs[i], send_map_starts[i], + send_map_starts[i + 1] - 1); } - for (i = 0; i< send_map_starts[num_sends]; i++) + for (i = 0; i < send_map_starts[num_sends]; i++) { hypre_fprintf(fp, "send_map_elements (%d) = %d\n", i, send_map_elements[i]); } @@ -77,18 +72,14 @@ HYPRE_Int hypre_PrintCommpkg(hypre_ParCSRMatrix *A, const char *file_name) fclose(fp); return hypre_error_flag; - - - } - -/*------------------------------------------------------------------ +/*------------------------------------------------------------------------------ * hypre_ParCSRCommPkgCreateApart_core * * This does the work for hypre_ParCSRCommPkgCreateApart - we have to split it * off so that it can also be used for block matrices. - *--------------------------------------------------------------------------*/ + *------------------------------------------------------------------------------*/ HYPRE_Int hypre_ParCSRCommPkgCreateApart_core( @@ -108,7 +99,6 @@ hypre_ParCSRCommPkgCreateApart_core( HYPRE_Int **p_send_map_elements, /* additional input assumed part */ hypre_IJAssumedPart *apart) - { HYPRE_Int num_procs, myid; HYPRE_Int j, i; @@ -118,20 +108,20 @@ hypre_ParCSRCommPkgCreateApart_core( HYPRE_Int size; HYPRE_Int count; - HYPRE_Int num_recvs, *recv_procs = NULL, *recv_vec_starts=NULL; + HYPRE_Int num_recvs, *recv_procs = NULL, *recv_vec_starts = NULL; HYPRE_Int tmp_id, prev_id; HYPRE_Int num_sends; - HYPRE_Int ex_num_contacts, *ex_contact_procs=NULL, *ex_contact_vec_starts=NULL; - HYPRE_BigInt *ex_contact_buf=NULL; + HYPRE_Int ex_num_contacts, *ex_contact_procs = NULL, *ex_contact_vec_starts = NULL; + HYPRE_BigInt *ex_contact_buf = NULL; HYPRE_Int num_ranges; HYPRE_BigInt upper_bound; HYPRE_BigInt *response_buf = NULL; - HYPRE_Int *response_buf_starts=NULL; + HYPRE_Int *response_buf_starts = NULL; HYPRE_Int max_response_size; @@ -148,21 +138,20 @@ hypre_ParCSRCommPkgCreateApart_core( #if mydebug - hypre_printf("myid = %i, my assumed local range: [%i, %i]\n", myid, - apart->row_start, apart->row_end); + hypre_printf("myid = %i, my assumed local range: [%i, %i]\n", myid, + apart->row_start, apart->row_end); - for (i=0; iproc_list[i], apart->row_start_list[i], - apart->row_end_list[i]); - } + for (i = 0; i < apart.length; i++) + { + hypre_printf("myid = %d, proc %d owns assumed partition range = [%d, %d]\n", + myid, apart->proc_list[i], apart->row_start_list[i], + apart->row_end_list[i]); + } - hypre_printf("myid = %d, length of apart = %d\n", myid, apart->length); + hypre_printf("myid = %d, length of apart = %d\n", myid, apart->length); #endif - /*----------------------------------------------------------- * Everyone knows where their assumed range is located * (because of the assumed partition object (apart). @@ -174,16 +163,14 @@ hypre_ParCSRCommPkgCreateApart_core( * entries in its rows. Each proc should know this from the user. *-----------------------------------------------------------*/ - /*------------------------------------------------------------ * First, get the receive processors * each par_csr matrix will have a certain number of columns * (num_cols_off_d) given in col_map_offd[] for which it needs * data from another processor. - * *------------------------------------------------------------*/ - /*calculate the assumed receive processors*/ + /*calculate the assumed receive processors*/ /* need to populate num_recvs, *recv_procs, and *recv_vec_starts (correlates to starts in col_map_off_d for recv_procs) for @@ -197,68 +184,70 @@ hypre_ParCSRCommPkgCreateApart_core( /*estimate the storage needed*/ if (num_cols_off_d > 0 && (apart->row_end - apart->row_start) > 0 ) { - big_size = col_map_off_d[num_cols_off_d-1] - col_map_off_d[0]; + big_size = col_map_off_d[num_cols_off_d - 1] - col_map_off_d[0]; - size = (HYPRE_Int)(big_size/(apart->row_end - apart->row_start)) + 2; + size = (HYPRE_Int)(big_size / (apart->row_end - apart->row_start)) + 2; } else { size = 0; } - /*we will contact each with a range of cols that we need*/ /* it is ok to contact yourself - because then there doesn't need to be separate code */ ex_contact_procs = hypre_CTAlloc(HYPRE_Int, size, HYPRE_MEMORY_HOST); - ex_contact_vec_starts = hypre_CTAlloc(HYPRE_Int, size+1, HYPRE_MEMORY_HOST); - ex_contact_buf = hypre_CTAlloc(HYPRE_BigInt, size*2, HYPRE_MEMORY_HOST); + ex_contact_vec_starts = hypre_CTAlloc(HYPRE_Int, size + 1, HYPRE_MEMORY_HOST); + ex_contact_buf = hypre_CTAlloc(HYPRE_BigInt, size * 2, HYPRE_MEMORY_HOST); range_end = -1; - for (i=0; i< num_cols_off_d; i++) + for (i = 0; i < num_cols_off_d; i++) { if (col_map_off_d[i] > range_end) { - - hypre_GetAssumedPartitionProcFromRow(comm, col_map_off_d[i], 0, global_num_cols, &tmp_id); if (ex_num_contacts == size) /*need more space? */ { - size += 20; - ex_contact_procs = hypre_TReAlloc(ex_contact_procs, HYPRE_Int, size, HYPRE_MEMORY_HOST); - ex_contact_vec_starts = hypre_TReAlloc(ex_contact_vec_starts, HYPRE_Int, size+1, HYPRE_MEMORY_HOST); - ex_contact_buf = hypre_TReAlloc(ex_contact_buf, HYPRE_BigInt, size*2, HYPRE_MEMORY_HOST); + size += 20; + ex_contact_procs = hypre_TReAlloc(ex_contact_procs, HYPRE_Int, size, HYPRE_MEMORY_HOST); + ex_contact_vec_starts = hypre_TReAlloc(ex_contact_vec_starts, HYPRE_Int, size + 1, + HYPRE_MEMORY_HOST); + ex_contact_buf = hypre_TReAlloc(ex_contact_buf, HYPRE_BigInt, size * 2, + HYPRE_MEMORY_HOST); } /* end of prev. range */ - if (ex_num_contacts > 0) ex_contact_buf[ex_num_contacts*2 - 1] = col_map_off_d[i-1]; - - /*start new range*/ - ex_contact_procs[ex_num_contacts] = tmp_id; - ex_contact_vec_starts[ex_num_contacts] = ex_num_contacts*2; - ex_contact_buf[ex_num_contacts*2] = col_map_off_d[i]; + if (ex_num_contacts > 0) + { + ex_contact_buf[ex_num_contacts * 2 - 1] = col_map_off_d[i - 1]; + } + /*start new range*/ + ex_contact_procs[ex_num_contacts] = tmp_id; + ex_contact_vec_starts[ex_num_contacts] = ex_num_contacts * 2; + ex_contact_buf[ex_num_contacts * 2] = col_map_off_d[i]; ex_num_contacts++; hypre_GetAssumedPartitionRowRange(comm, tmp_id, 0, global_num_cols, &range_start, &range_end); - } } /*finish the starts*/ - ex_contact_vec_starts[ex_num_contacts] = ex_num_contacts*2; - /*finish the last range*/ - if (ex_num_contacts > 0) ex_contact_buf[ex_num_contacts*2 - 1] = col_map_off_d[num_cols_off_d-1]; + ex_contact_vec_starts[ex_num_contacts] = ex_num_contacts * 2; + /*finish the last range*/ + if (ex_num_contacts > 0) + { + ex_contact_buf[ex_num_contacts * 2 - 1] = col_map_off_d[num_cols_off_d - 1]; + } /*don't allocate space for responses */ - /*create response object*/ response_obj1.fill_response = hypre_RangeFillResponseIJDetermineRecvProcs; response_obj1.data1 = apart; /* this is necessary so we can fill responses*/ @@ -266,41 +255,36 @@ hypre_ParCSRCommPkgCreateApart_core( max_response_size = 6; /* 6 means we can fit 3 ranges*/ - hypre_DataExchangeList(ex_num_contacts, ex_contact_procs, ex_contact_buf, ex_contact_vec_starts, sizeof(HYPRE_BigInt), sizeof(HYPRE_BigInt), &response_obj1, max_response_size, 1, comm, (void**) &response_buf, &response_buf_starts); - - /*now create recv_procs[] and recv_vec_starts[] and num_recvs from the complete data in response_buf - this array contains a proc_id followed by an upper bound for the range. */ - /*initialize */ num_recvs = 0; - size = ex_num_contacts+20; /* num of recv procs should be roughly similar size + size = ex_num_contacts + 20; /* num of recv procs should be roughly similar size to number of contacts - add a buffer of 20*/ - recv_procs = hypre_CTAlloc(HYPRE_Int, size, HYPRE_MEMORY_HOST); - recv_vec_starts = hypre_CTAlloc(HYPRE_Int, size+1, HYPRE_MEMORY_HOST); + recv_vec_starts = hypre_CTAlloc(HYPRE_Int, size + 1, HYPRE_MEMORY_HOST); recv_vec_starts[0] = 0; /*how many ranges were returned?*/ num_ranges = response_buf_starts[ex_num_contacts]; - num_ranges = num_ranges/2; + num_ranges = num_ranges / 2; prev_id = -1; j = 0; count = 0; /* loop through ranges */ - for (i=0; i 0) { /*add the range if the proc id != myid*/ - tmp_id = response_buf[i*2]; + tmp_id = response_buf[i * 2]; if (tmp_id != myid) { if (tmp_id != prev_id) /*increment the number of recvs */ @@ -319,15 +303,15 @@ hypre_ParCSRCommPkgCreateApart_core( /*check size of recv buffers*/ if (num_recvs == size) { - size+=20; + size += 20; recv_procs = hypre_TReAlloc(recv_procs, HYPRE_Int, size, HYPRE_MEMORY_HOST); - recv_vec_starts = hypre_TReAlloc(recv_vec_starts, HYPRE_Int, size+1, HYPRE_MEMORY_HOST); + recv_vec_starts = hypre_TReAlloc(recv_vec_starts, HYPRE_Int, + size + 1, HYPRE_MEMORY_HOST); } - recv_vec_starts[num_recvs+1] = j; /*the new start is at this element*/ + recv_vec_starts[num_recvs + 1] = j; /*the new start is at this element*/ recv_procs[num_recvs] = tmp_id; /*add the new processor*/ num_recvs++; - } else { @@ -336,28 +320,21 @@ hypre_ParCSRCommPkgCreateApart_core( } } prev_id = tmp_id; - } - } - - - #if mydebug - for (i=0; i < num_recvs; i++) - { - hypre_printf("myid = %d, recv proc = %d, vec_starts = [%d : %d]\n", - myid, recv_procs[i], recv_vec_starts[i],recv_vec_starts[i+1]-1); - } + for (i = 0; i < num_recvs; i++) + { + hypre_printf("myid = %d, recv proc = %d, vec_starts = [%d : %d]\n", + myid, recv_procs[i], recv_vec_starts[i], recv_vec_starts[i + 1] - 1); + } #endif - /*------------------------------------------------------------ * determine the send processors * each processor contacts its recv procs to let them * know they are a send processor - * *-------------------------------------------------------------*/ /* the contact information is the recv_processor infomation - so @@ -375,10 +352,12 @@ hypre_ParCSRCommPkgCreateApart_core( send_proc_obj.length = 0; send_proc_obj.storage_length = num_recvs + 5; send_proc_obj.id = hypre_CTAlloc(HYPRE_Int, send_proc_obj.storage_length, HYPRE_MEMORY_HOST); - send_proc_obj.vec_starts = hypre_CTAlloc(HYPRE_Int, send_proc_obj.storage_length + 1, HYPRE_MEMORY_HOST); + send_proc_obj.vec_starts = hypre_CTAlloc(HYPRE_Int, send_proc_obj.storage_length + 1, + HYPRE_MEMORY_HOST); send_proc_obj.vec_starts[0] = 0; send_proc_obj.element_storage_length = num_cols_off_d; - send_proc_obj.elements = hypre_CTAlloc(HYPRE_BigInt, send_proc_obj.element_storage_length, HYPRE_MEMORY_HOST); + send_proc_obj.elements = hypre_CTAlloc(HYPRE_BigInt, send_proc_obj.element_storage_length, + HYPRE_MEMORY_HOST); response_obj2.fill_response = hypre_FillResponseIJDetermineSendProcs; response_obj2.data1 = NULL; @@ -386,15 +365,11 @@ hypre_ParCSRCommPkgCreateApart_core( max_response_size = 0; - - hypre_DataExchangeList(num_recvs, recv_procs, col_map_off_d, recv_vec_starts, sizeof(HYPRE_BigInt), sizeof(HYPRE_BigInt), &response_obj2, max_response_size, 2, comm, (void **) &response_buf, &response_buf_starts); - - num_sends = send_proc_obj.length; /*send procs are in send_proc_object.id */ @@ -402,14 +377,14 @@ hypre_ParCSRCommPkgCreateApart_core( #if mydebug hypre_printf("myid = %d, num_sends = %d\n", myid, num_sends); - for (i=0; i < num_sends; i++) + for (i = 0; i < num_sends; i++) { - tmp_int = send_proc_obj.vec_starts[i+1] - send_proc_obj.vec_starts[i]; + tmp_int = send_proc_obj.vec_starts[i + 1] - send_proc_obj.vec_starts[i]; index = send_proc_obj.vec_starts[i]; - for (j=0; j< tmp_int; j++) + for (j = 0; j < tmp_int; j++) { - hypre_printf("myid = %d, send proc = %d, send element = %d\n",myid, - send_proc_obj.id[i],send_proc_obj.elements[index+j]); + hypre_printf("myid = %d, send proc = %d, send element = %d\n", myid, + send_proc_obj.id[i], send_proc_obj.elements[index + j]); } } #endif @@ -428,33 +403,34 @@ hypre_ParCSRCommPkgCreateApart_core( HYPRE_Int ct, sz, pos; orig_order = hypre_CTAlloc(HYPRE_Int, num_sends, HYPRE_MEMORY_HOST); - orig_send_map_starts = hypre_CTAlloc(HYPRE_Int, num_sends+1, HYPRE_MEMORY_HOST); - orig_send_elements = hypre_CTAlloc(HYPRE_BigInt, send_proc_obj.vec_starts[num_sends], HYPRE_MEMORY_HOST); + orig_send_map_starts = hypre_CTAlloc(HYPRE_Int, num_sends + 1, HYPRE_MEMORY_HOST); + orig_send_elements = hypre_CTAlloc(HYPRE_BigInt, send_proc_obj.vec_starts[num_sends], + HYPRE_MEMORY_HOST); orig_send_map_starts[0] = 0; /* copy send map starts and elements */ - for (i=0; i< num_sends; i++) + for (i = 0; i < num_sends; i++) { orig_order[i] = i; - orig_send_map_starts[i+1] = send_proc_obj.vec_starts[i+1]; + orig_send_map_starts[i + 1] = send_proc_obj.vec_starts[i + 1]; } - for (i=0; i< send_proc_obj.vec_starts[num_sends]; i++) + for (i = 0; i < send_proc_obj.vec_starts[num_sends]; i++) { orig_send_elements[i] = send_proc_obj.elements[i]; } /* sort processor ids - keep track of original order */ - hypre_qsort2i( send_proc_obj.id, orig_order, 0, num_sends-1 ); + hypre_qsort2i( send_proc_obj.id, orig_order, 0, num_sends - 1 ); /* now rearrange vec starts and send elements to correspond to proc ids */ ct = 0; - for (i=0; i< num_sends; i++) + for (i = 0; i < num_sends; i++) { pos = orig_order[i]; sz = orig_send_map_starts[pos + 1] - orig_send_map_starts[pos]; - send_proc_obj.vec_starts[i+1] = ct + sz; - for (j = 0; j< sz; j++) + send_proc_obj.vec_starts[i + 1] = ct + sz; + for (j = 0; j < sz; j++) { - send_proc_obj.elements[ct +j] = orig_send_elements[orig_send_map_starts[pos]+j]; + send_proc_obj.elements[ct + j] = orig_send_elements[orig_send_map_starts[pos] + j]; } ct += sz; } @@ -464,7 +440,6 @@ hypre_ParCSRCommPkgCreateApart_core( hypre_TFree(orig_send_map_starts, HYPRE_MEMORY_HOST); } - /*----------------------------------------------------------- * Return output info for setting up the comm package *-----------------------------------------------------------*/ @@ -480,7 +455,6 @@ hypre_ParCSRCommPkgCreateApart_core( send_proc_obj.id = NULL; } - *p_num_recvs = num_recvs; *p_recv_procs = recv_procs; *p_recv_vec_starts = recv_vec_starts; @@ -488,14 +462,14 @@ hypre_ParCSRCommPkgCreateApart_core( *p_send_procs = send_proc_obj.id; *p_send_map_starts = send_proc_obj.vec_starts; - /*send map elements have global index - need local instead*/ /*need to fix this !!! */ if (num_sends) { - HYPRE_Int *tmp_elements = hypre_CTAlloc(HYPRE_Int, send_proc_obj.vec_starts[num_sends], HYPRE_MEMORY_HOST); - for (i=0; irow_end_list[part->sort_index[j]]; - tmp_id = part->proc_list[part->sort_index[j]]; + tmp_id = part->proc_list[part->sort_index[j]]; /*check storage in send_buf for adding the ranges */ - size = 2*(part->length); + size = 2 * (part->length); - if ( response_obj->send_response_storage < size ) + if (response_obj->send_response_storage < size) { response_obj->send_response_storage = hypre_max(size, 20); - send_response_buf = hypre_TReAlloc( send_response_buf, HYPRE_BigInt, - response_obj->send_response_storage + overhead , HYPRE_MEMORY_HOST); + send_response_buf = hypre_TReAlloc(send_response_buf, HYPRE_BigInt, + response_obj->send_response_storage + overhead, + HYPRE_MEMORY_HOST); *p_send_response_buf = send_response_buf; /* needed when using ReAlloc */ } - while (row_val > row_end) /*which partition to start in */ { j++; @@ -709,43 +668,43 @@ hypre_RangeFillResponseIJDetermineRecvProcs(void *p_recv_contact_buf, j++; /*increase j to look in next partition */ - /*any more? - now compare with end of range value*/ row_val = recv_contact_buf[1]; /*end of range*/ - while ( j < part->length && row_val > row_end ) + while (j < part->length && row_val > row_end ) { row_end = part->row_end_list[part->sort_index[j]]; tmp_id = part->proc_list[part->sort_index[j]]; - send_response_buf[index++] = (HYPRE_BigInt)tmp_id; + send_response_buf[index++] = (HYPRE_BigInt) tmp_id; send_response_buf[index++] = row_end; j++; - } - *response_message_size = index; *p_send_response_buf = send_response_buf; return hypre_error_flag; - } - - /*-------------------------------------------------------------------- * hypre_FillResponseIJDetermineSendProcs + * * Fill response function for determining the send processors * data exchange *--------------------------------------------------------------------*/ HYPRE_Int -hypre_FillResponseIJDetermineSendProcs(void *p_recv_contact_buf, - HYPRE_Int contact_size, HYPRE_Int contact_proc, void *ro, - MPI_Comm comm, void **p_send_response_buf, - HYPRE_Int *response_message_size ) +hypre_FillResponseIJDetermineSendProcs(void *p_recv_contact_buf, + HYPRE_Int contact_size, + HYPRE_Int contact_proc, + void *ro, + MPI_Comm comm, + void **p_send_response_buf, + HYPRE_Int *response_message_size ) { + HYPRE_UNUSED_VAR(p_send_response_buf); + HYPRE_Int myid; HYPRE_Int i, index, count, elength; @@ -758,15 +717,15 @@ hypre_FillResponseIJDetermineSendProcs(void *p_recv_contact_buf, hypre_MPI_Comm_rank(comm, &myid ); - /*check to see if we need to allocate more space in send_proc_obj for ids*/ if (send_proc_obj->length == send_proc_obj->storage_length) { - send_proc_obj->storage_length +=20; /*add space for 20 more processors*/ + send_proc_obj->storage_length += 20; /*add space for 20 more processors*/ send_proc_obj->id = hypre_TReAlloc(send_proc_obj->id, HYPRE_Int, send_proc_obj->storage_length, HYPRE_MEMORY_HOST); send_proc_obj->vec_starts = hypre_TReAlloc(send_proc_obj->vec_starts, HYPRE_Int, - send_proc_obj->storage_length + 1, HYPRE_MEMORY_HOST); + send_proc_obj->storage_length + 1, + HYPRE_MEMORY_HOST); } /*initialize*/ @@ -777,7 +736,7 @@ hypre_FillResponseIJDetermineSendProcs(void *p_recv_contact_buf, send_proc_obj->id[count] = contact_proc; /*do we need more storage for the elements?*/ - if (send_proc_obj->element_storage_length < index + contact_size) + if (send_proc_obj->element_storage_length < index + contact_size) { elength = hypre_max(contact_size, 50); elength += index; @@ -786,18 +745,15 @@ hypre_FillResponseIJDetermineSendProcs(void *p_recv_contact_buf, send_proc_obj->element_storage_length = elength; } /*populate send_proc_obj*/ - for (i=0; i< contact_size; i++) + for (i = 0; i < contact_size; i++) { send_proc_obj->elements[index++] = recv_contact_buf[i]; } - send_proc_obj->vec_starts[count+1] = index; + send_proc_obj->vec_starts[count + 1] = index; send_proc_obj->length++; - - /*output - no message to return (confirmation) */ + /*output - no message to return (confirmation) */ *response_message_size = 0; return hypre_error_flag; - } - diff --git a/external/hypre/src/parcsr_mv/new_commpkg.h b/external/hypre/src/parcsr_mv/new_commpkg.h index af851319..0712be29 100644 --- a/external/hypre/src/parcsr_mv/new_commpkg.h +++ b/external/hypre/src/parcsr_mv/new_commpkg.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/parcsr_mv/numbers.c b/external/hypre/src/parcsr_mv/numbers.c index 61429da7..ac6fb868 100644 --- a/external/hypre/src/parcsr_mv/numbers.c +++ b/external/hypre/src/parcsr_mv/numbers.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -11,12 +11,12 @@ #include "_hypre_parcsr_mv.h" -hypre_NumbersNode * hypre_NumbersNewNode() +hypre_NumbersNode * hypre_NumbersNewNode( void ) /* makes a new node for a tree representing numbers */ { HYPRE_Int i; - hypre_NumbersNode * newnode = hypre_CTAlloc( hypre_NumbersNode, 1 , HYPRE_MEMORY_HOST); - for ( i=0; i<=10; ++i ) newnode->digit[i] = NULL; + hypre_NumbersNode * newnode = hypre_CTAlloc( hypre_NumbersNode, 1, HYPRE_MEMORY_HOST); + for ( i = 0; i <= 10; ++i ) { newnode->digit[i] = NULL; } return newnode; } @@ -24,29 +24,35 @@ void hypre_NumbersDeleteNode( hypre_NumbersNode * node ) /* deletes a node and the tree of which it is root */ { HYPRE_Int i; - for ( i=0; i<=10; ++i ) if ( node->digit[i] != NULL ) { - hypre_NumbersDeleteNode( node->digit[i] ); - node->digit[i] = NULL; - }; - hypre_TFree( node , HYPRE_MEMORY_HOST); + for ( i = 0; i <= 10; ++i ) if ( node->digit[i] != NULL ) + { + hypre_NumbersDeleteNode( node->digit[i] ); + node->digit[i] = NULL; + }; + hypre_TFree( node, HYPRE_MEMORY_HOST); } HYPRE_Int hypre_NumbersEnter( hypre_NumbersNode * node, const HYPRE_Int n ) /* enters a number in the tree starting with 'node'. */ { HYPRE_Int newN = 0; - HYPRE_Int q = n/10; - HYPRE_Int r = n%10; - hypre_assert( n>=0 ); - if ( node->digit[r] == NULL ) { + HYPRE_Int q = n / 10; + HYPRE_Int r = n % 10; + hypre_assert( n >= 0 ); + if ( node->digit[r] == NULL ) + { node->digit[r] = hypre_NumbersNewNode(); newN = 1; }; - if ( q<10 ) { /* q is a one-digit number; point to terminal object */ + if ( q < 10 ) /* q is a one-digit number; point to terminal object */ + { if ( (node->digit[r])->digit[10] == NULL ) + { (node->digit[r])->digit[10] = hypre_NumbersNewNode(); + } } - else { /* multidigit number; place for this digit points to next node */ + else /* multidigit number; place for this digit points to next node */ + { newN = hypre_NumbersEnter(node->digit[r], q ); } return newN; @@ -57,29 +63,38 @@ HYPRE_Int hypre_NumbersNEntered( hypre_NumbersNode * node ) { HYPRE_Int i; HYPRE_Int count = 0; - if ( node==NULL ) return 0; - for ( i=0; i<10; ++i ) if ( node->digit[i] != NULL ) - count += hypre_NumbersNEntered( node->digit[i] ); - if ( node->digit[10] != NULL ) ++count; + if ( node == NULL ) { return 0; } + for ( i = 0; i < 10; ++i ) if ( node->digit[i] != NULL ) + { + count += hypre_NumbersNEntered( node->digit[i] ); + } + if ( node->digit[10] != NULL ) { ++count; } return count; } HYPRE_Int hypre_NumbersQuery( hypre_NumbersNode * node, const HYPRE_Int n ) /* returns 1 if n is on the tree with root 'node', 0 otherwise */ { - HYPRE_Int q = n/10; - HYPRE_Int r = n%10; - hypre_assert( n>=0 ); - if ( node->digit[r] == NULL ) { /* low order digit of n not on tree */ + HYPRE_Int q = n / 10; + HYPRE_Int r = n % 10; + hypre_assert( n >= 0 ); + if ( node->digit[r] == NULL ) /* low order digit of n not on tree */ + { return 0; } - else if ( q<10 ) { /* q is a one-digit number; check terminal object */ + else if ( q < 10 ) /* q is a one-digit number; check terminal object */ + { if ( (node->digit[r])->digit[10] == NULL ) + { return 0; + } else + { return 1; + } } - else { /* look for higher order digits of n on tree of its low order digit r */ + else /* look for higher order digits of n on tree of its low order digit r */ + { return hypre_NumbersQuery( node->digit[r], q ); } } @@ -93,16 +108,19 @@ HYPRE_Int * hypre_NumbersArray( hypre_NumbersNode * node ) HYPRE_Int k = 0; HYPRE_Int N = hypre_NumbersNEntered(node); HYPRE_Int * array, * temp; - array = hypre_CTAlloc( HYPRE_Int, N , HYPRE_MEMORY_HOST); - if ( node==NULL ) return array; - for ( i=0; i<10; ++i ) if ( node->digit[i] != NULL ) { - Ntemp = hypre_NumbersNEntered( node->digit[i] ); - temp = hypre_NumbersArray( node->digit[i] ); - for ( j=0; jdigit[10] != NULL ) array[k++] = 0; - hypre_assert( k==N ); + array = hypre_CTAlloc( HYPRE_Int, N, HYPRE_MEMORY_HOST); + if ( node == NULL ) { return array; } + for ( i = 0; i < 10; ++i ) if ( node->digit[i] != NULL ) + { + Ntemp = hypre_NumbersNEntered( node->digit[i] ); + temp = hypre_NumbersArray( node->digit[i] ); + for ( j = 0; j < Ntemp; ++j ) + { + array[k++] = temp[j] * 10 + i; + } + hypre_TFree(temp, HYPRE_MEMORY_HOST); + } + if ( node->digit[10] != NULL ) { array[k++] = 0; } + hypre_assert( k == N ); return array; } diff --git a/external/hypre/src/parcsr_mv/numbers.h b/external/hypre/src/parcsr_mv/numbers.h index fcb32b75..b9cd913f 100644 --- a/external/hypre/src/parcsr_mv/numbers.h +++ b/external/hypre/src/parcsr_mv/numbers.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/parcsr_mv/par_chord_matrix.h b/external/hypre/src/parcsr_mv/par_chord_matrix.h index 6360839b..1080b0ca 100644 --- a/external/hypre/src/parcsr_mv/par_chord_matrix.h +++ b/external/hypre/src/parcsr_mv/par_chord_matrix.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/parcsr_mv/par_csr_aat.c b/external/hypre/src/parcsr_mv/par_csr_aat.c index 0d648ce3..3375a535 100644 --- a/external/hypre/src/parcsr_mv/par_csr_aat.c +++ b/external/hypre/src/parcsr_mv/par_csr_aat.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -34,7 +34,7 @@ void hypre_ParAat_RowSizes( HYPRE_Int num_rows_A_ext, HYPRE_BigInt first_col_diag_A, HYPRE_BigInt first_row_index_A - ) +) /* computes the sizes of the rows of C = A * A^T. Out: HYPRE_Int** C_diag_i, C_offd_i Workspace provided: HYPRE_Int * B_marker @@ -52,17 +52,17 @@ void hypre_ParAat_RowSizes( HYPRE_Int i1, i3, jj2, jj3; HYPRE_BigInt big_i2; HYPRE_Int jj_count_diag, jj_count_offd, jj_row_begin_diag, jj_row_begin_offd; - HYPRE_Int last_col_diag_C; + HYPRE_BigInt last_col_diag_C; HYPRE_Int start_indexing = 0; /* start indexing for C_data at 0 */ - *C_diag_i = hypre_CTAlloc(HYPRE_Int, num_rows_diag_A+1, HYPRE_MEMORY_HOST); - *C_offd_i = hypre_CTAlloc(HYPRE_Int, num_rows_diag_A+1, HYPRE_MEMORY_HOST); + *C_diag_i = hypre_CTAlloc(HYPRE_Int, num_rows_diag_A + 1, HYPRE_MEMORY_HOST); + *C_offd_i = hypre_CTAlloc(HYPRE_Int, num_rows_diag_A + 1, HYPRE_MEMORY_HOST); - last_col_diag_C = first_row_index_A + num_rows_diag_A - 1; + last_col_diag_C = first_row_index_A + (HYPRE_BigInt) num_rows_diag_A - 1; jj_count_diag = start_indexing; jj_count_offd = start_indexing; - for (i1 = 0; i1 < num_rows_diag_A+num_rows_A_ext; i1++) + for (i1 = 0; i1 < num_rows_diag_A + num_rows_A_ext; i1++) { B_marker[i1] = -1; } @@ -92,7 +92,7 @@ void hypre_ParAat_RowSizes( if (num_cols_offd_A) { - for (jj2 = A_offd_i[i1]; jj2 < A_offd_i[i1+1]; jj2++) + for (jj2 = A_offd_i[i1]; jj2 < A_offd_i[i1 + 1]; jj2++) { big_i2 = A_col_map_offd[ A_offd_j[jj2] ]; @@ -106,9 +106,12 @@ void hypre_ParAat_RowSizes( * as a potential nonzero. *-----------------------------------------------------------*/ - for ( i3=0; i3 last_col_diag_C ) { /* offd */ - if (B_marker[i3+num_rows_diag_A] < jj_row_begin_offd) { - B_marker[i3+num_rows_diag_A] = jj_count_offd; + A_ext_row_map[i3] > last_col_diag_C ) /* offd */ + { + if (B_marker[i3 + num_rows_diag_A] < jj_row_begin_offd) + { + B_marker[i3 + num_rows_diag_A] = jj_count_offd; jj_count_offd++; } } - else { /* diag */ - if (B_marker[i3+num_rows_diag_A] < jj_row_begin_diag) { - B_marker[i3+num_rows_diag_A] = jj_count_diag; + else /* diag */ + { + if (B_marker[i3 + num_rows_diag_A] < jj_row_begin_diag) + { + B_marker[i3 + num_rows_diag_A] = jj_count_diag; jj_count_diag++; } } @@ -146,10 +153,13 @@ void hypre_ParAat_RowSizes( * as a potential nonzero. *-----------------------------------------------------------*/ - for ( i3=0; i3 last_col_diag_C ) { /* offd */ - if (B_marker[i3+num_rows_diag_A] < jj_row_begin_offd) { - B_marker[i3+num_rows_diag_A] = jj_count_offd; + A_ext_row_map[i3] > last_col_diag_C ) /* offd */ + { + if (B_marker[i3 + num_rows_diag_A] < jj_row_begin_offd) + { + B_marker[i3 + num_rows_diag_A] = jj_count_offd; jj_count_offd++; } } - else { /* diag */ - if (B_marker[i3+num_rows_diag_A] < jj_row_begin_diag) { - B_marker[i3+num_rows_diag_A] = jj_count_diag; + else /* diag */ + { + if (B_marker[i3 + num_rows_diag_A] < jj_row_begin_diag) + { + B_marker[i3 + num_rows_diag_A] = jj_count_diag; jj_count_diag++; } } @@ -228,7 +245,7 @@ void hypre_ParAat_RowSizes( * on this processor. *-----------------------------------------------------------------*/ - for (jj2 = A_diag_i[i1]; jj2 < A_diag_i[i1+1]; jj2++) + for (jj2 = A_diag_i[i1]; jj2 < A_diag_i[i1 + 1]; jj2++) { big_i2 = (HYPRE_BigInt)A_diag_j[jj2] + first_col_diag_A ; @@ -242,9 +259,12 @@ void hypre_ParAat_RowSizes( * For each entry (i2,i3) of A^T, mark C(i1,i3) * as a potential nonzero. *-----------------------------------------------------------*/ - for ( i3=0; i3 last_col_diag_C ) { /* offd */ - if (B_marker[i3+num_rows_diag_A] < jj_row_begin_offd) { - B_marker[i3+num_rows_diag_A] = jj_count_offd; + A_ext_row_map[i3] > last_col_diag_C ) /* offd */ + { + if (B_marker[i3 + num_rows_diag_A] < jj_row_begin_offd) + { + B_marker[i3 + num_rows_diag_A] = jj_count_offd; C_offd_data[jj_count_offd] = a_b_product; C_offd_j[jj_count_offd] = i3; jj_count_offd++; } else - C_offd_data[B_marker[i3+num_rows_diag_A]] += a_b_product; + { + C_offd_data[B_marker[i3 + num_rows_diag_A]] += a_b_product; + } } - else { /* diag */ - if (B_marker[i3+num_rows_diag_A] < jj_row_begin_diag) { - B_marker[i3+num_rows_diag_A] = jj_count_diag; + else /* diag */ + { + if (B_marker[i3 + num_rows_diag_A] < jj_row_begin_diag) + { + B_marker[i3 + num_rows_diag_A] = jj_count_diag; C_diag_data[jj_count_diag] = a_b_product; - C_diag_j[jj_count_diag] = (HYPRE_Int)(i3-first_col_diag_A); + C_diag_j[jj_count_diag] = (HYPRE_Int)(i3 - first_col_diag_A); jj_count_diag++; } else - C_diag_data[B_marker[i3+num_rows_diag_A]] += a_b_product; + { + C_diag_data[B_marker[i3 + num_rows_diag_A]] += a_b_product; + } } } } @@ -550,7 +579,7 @@ hypre_ParCSRMatrix *hypre_ParCSRAAt( hypre_ParCSRMatrix *A ) if (num_cols_offd_A) { - for (jj2 = A_offd_i[i1]; jj2 < A_offd_i[i1+1]; jj2++) + for (jj2 = A_offd_i[i1]; jj2 < A_offd_i[i1 + 1]; jj2++) { i2 = A_offd_j[jj2]; a_entry = A_offd_data[jj2]; @@ -566,9 +595,12 @@ hypre_ParCSRMatrix *hypre_ParCSRAAt( hypre_ParCSRMatrix *A ) * blocks of C. *-----------------------------------------------------------*/ - for ( i3=0; i3 last_col_diag_C ) { /* offd */ - if (B_marker[i3+num_rows_diag_A] < jj_row_begin_offd) { - B_marker[i3+num_rows_diag_A] = jj_count_offd; + A_ext_row_map[i3] > last_col_diag_C ) /* offd */ + { + if (B_marker[i3 + num_rows_diag_A] < jj_row_begin_offd) + { + B_marker[i3 + num_rows_diag_A] = jj_count_offd; C_offd_data[jj_count_offd] = a_b_product; C_offd_j[jj_count_offd] = i3; jj_count_offd++; } else - C_offd_data[B_marker[i3+num_rows_diag_A]] += a_b_product; + { + C_offd_data[B_marker[i3 + num_rows_diag_A]] += a_b_product; + } } - else { /* diag */ - if (B_marker[i3+num_rows_diag_A] < jj_row_begin_diag) { - B_marker[i3+num_rows_diag_A] = jj_count_diag; + else /* diag */ + { + if (B_marker[i3 + num_rows_diag_A] < jj_row_begin_diag) + { + B_marker[i3 + num_rows_diag_A] = jj_count_diag; C_diag_data[jj_count_diag] = a_b_product; - C_diag_j[jj_count_diag] = (HYPRE_Int)(i3-first_row_index_A); + C_diag_j[jj_count_diag] = (HYPRE_Int)(i3 - first_row_index_A); jj_count_diag++; } else - C_diag_data[B_marker[i3+num_rows_diag_A]] += a_b_product; + { + C_diag_data[B_marker[i3 + num_rows_diag_A]] += a_b_product; + } } } } @@ -616,7 +656,7 @@ hypre_ParCSRMatrix *hypre_ParCSRAAt( hypre_ParCSRMatrix *A ) * on this processor. *-----------------------------------------------------------------*/ - for (jj2 = A_diag_i[i1]; jj2 < A_diag_i[i1+1]; jj2++) + for (jj2 = A_diag_i[i1]; jj2 < A_diag_i[i1 + 1]; jj2++) { i2 = A_diag_j[jj2]; a_entry = A_diag_data[jj2]; @@ -631,9 +671,12 @@ hypre_ParCSRMatrix *hypre_ParCSRAAt( hypre_ParCSRMatrix *A ) * For each entry (i2,i3) of A^T, add A(i1,i2)*A(i3,i2) * to C(i1,i3) *-----------------------------------------------------------*/ - for ( i3=0; i3row_starts, - recv_vec_starts, send_map_starts, send_map_elmts, - diag_i, diag_j, offd_i, offd_j, col_map_offd, - diag_data, offd_data - ); - - A_ext = hypre_CSRMatrixCreate(num_rows_A_ext,num_cols_A,num_nonzeros); + ( &A_ext_i, &A_ext_j, &A_ext_data, pA_ext_row_map, + &num_nonzeros, + data, 1, comm, comm_pkg, + num_cols_A, num_recvs, num_sends, + first_col_diag, A->row_starts, + recv_vec_starts, send_map_starts, send_map_elmts, + diag_i, diag_j, offd_i, offd_j, col_map_offd, + diag_data, offd_data + ); + + A_ext = hypre_CSRMatrixCreate(num_rows_A_ext, num_cols_A, num_nonzeros); hypre_CSRMatrixI(A_ext) = A_ext_i; hypre_CSRMatrixBigJ(A_ext) = A_ext_j; - if (data) hypre_CSRMatrixData(A_ext) = A_ext_data; + if (data) { hypre_CSRMatrixData(A_ext) = A_ext_data; } return A_ext; } diff --git a/external/hypre/src/parcsr_mv/par_csr_assumed_part.c b/external/hypre/src/parcsr_mv/par_csr_assumed_part.c index e0ee4438..7356168d 100644 --- a/external/hypre/src/parcsr_mv/par_csr_assumed_part.c +++ b/external/hypre/src/parcsr_mv/par_csr_assumed_part.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -57,16 +57,18 @@ hypre_LocateAssumedPartition(MPI_Comm comm, HYPRE_BigInt row_start, HYPRE_BigInt * which rows do I have that others are assumed responsible for? * (at most two ranges - maybe none) *-----------------------------------------------------------*/ - contact_row_start[0]=0; - contact_row_end[0]=0; - contact_row_start[1]=0; - contact_row_end[1]=0; + contact_row_start[0] = 0; + contact_row_end[0] = 0; + contact_row_start[1] = 0; + contact_row_end[1] = 0; contact_ranges = 0; if (row_start <= row_end ) - { /*must own at least one row*/ + { + /*must own at least one row*/ if ( part->row_end < row_start || row_end < part->row_start ) - { /*no overlap - so all of my rows and only one range*/ + { + /*no overlap - so all of my rows and only one range*/ contact_row_start[0] = row_start; contact_row_end[0] = row_end; contact_ranges++; @@ -84,12 +86,12 @@ hypre_LocateAssumedPartition(MPI_Comm comm, HYPRE_BigInt row_start, HYPRE_BigInt { if (contact_ranges) /* already found one range */ { - contact_row_start[1] = part->row_end +1; + contact_row_start[1] = part->row_end + 1; contact_row_end[1] = row_end; } else { - contact_row_start[0] = part->row_end +1; + contact_row_start[0] = part->row_end + 1; contact_row_end[0] = row_end; } contact_ranges++; @@ -106,16 +108,17 @@ hypre_LocateAssumedPartition(MPI_Comm comm, HYPRE_BigInt row_start, HYPRE_BigInt contact_list_length = 0; contact_list_storage = 5; - contact_list = hypre_TAlloc(HYPRE_BigInt, contact_list_storage*3, HYPRE_MEMORY_HOST); /*each contact needs 3 ints */ + contact_list = hypre_TAlloc(HYPRE_BigInt, contact_list_storage * 3, + HYPRE_MEMORY_HOST); /*each contact needs 3 ints */ - for (i=0; i= contact_row_end[i]) { @@ -154,7 +158,8 @@ hypre_LocateAssumedPartition(MPI_Comm comm, HYPRE_BigInt row_start, HYPRE_BigInt { /*allocate more space*/ contact_list_storage += 5; - contact_list = hypre_TReAlloc(contact_list, HYPRE_BigInt, (contact_list_storage*3), HYPRE_MEMORY_HOST); + contact_list = hypre_TReAlloc(contact_list, HYPRE_BigInt, (contact_list_storage * 3), + HYPRE_MEMORY_HOST); } @@ -163,7 +168,7 @@ hypre_LocateAssumedPartition(MPI_Comm comm, HYPRE_BigInt row_start, HYPRE_BigInt CONTACT(contact_list_length, 2) = tmp_row_end; /*end row */ contact_list_length++; owner_start++; /*processors are seqential */ - } + } } } @@ -171,11 +176,11 @@ hypre_LocateAssumedPartition(MPI_Comm comm, HYPRE_BigInt row_start, HYPRE_BigInt statuses = hypre_CTAlloc(hypre_MPI_Status, contact_list_length, HYPRE_MEMORY_HOST); /*send out messages */ - for (i=0; i< contact_list_length; i++) + for (i = 0; i < contact_list_length; i++) { - hypre_MPI_Isend(&CONTACT(i,1) ,2, HYPRE_MPI_BIG_INT, CONTACT(i,0), flag1 , - comm, &requests[i]); - /*hypre_MPI_COMM_WORLD, &requests[i]);*/ + hypre_MPI_Isend(&CONTACT(i, 1), 2, HYPRE_MPI_BIG_INT, CONTACT(i, 0), flag1, + comm, &requests[i]); + /*hypre_MPI_COMM_WORLD, &requests[i]);*/ } /*----------------------------------------------------------- @@ -194,7 +199,7 @@ hypre_LocateAssumedPartition(MPI_Comm comm, HYPRE_BigInt row_start, HYPRE_BigInt /*locate_ranges = 0;*/ if (part->row_end < row_start || row_end < part->row_start ) - /*no overlap - so all of my assumed rows */ + /*no overlap - so all of my assumed rows */ { /*locate_row_start[0] = part->row_start;*/ /*locate_ranges++;*/ @@ -203,10 +208,11 @@ hypre_LocateAssumedPartition(MPI_Comm comm, HYPRE_BigInt row_start, HYPRE_BigInt else /* the two regions overlap */ { if (part->row_start < row_start) - {/* check for locate rows on the low end of the local range */ + { + /* check for locate rows on the low end of the local range */ /*locate_row_start[0] = part->row_start;*/ /*locate_ranges++;*/ - locate_row_count += (row_start-1) - part->row_start + 1; + locate_row_count += (row_start - 1) - part->row_start + 1; } if (row_end < part->row_end) /* check the high end */ { @@ -224,15 +230,15 @@ hypre_LocateAssumedPartition(MPI_Comm comm, HYPRE_BigInt row_start, HYPRE_BigInt } - /*----------------------------------------------------------- - * Receive messages from other procs telling us where - * all our locate rows actually reside - *-----------------------------------------------------------*/ + /*----------------------------------------------------------- + * Receive messages from other procs telling us where + * all our locate rows actually reside + *-----------------------------------------------------------*/ - /* we will keep a partition of our assumed partition - list ourselves - first. We will sort later with an additional index. - In practice, this should only contain a few processors */ + /* we will keep a partition of our assumed partition - list ourselves + first. We will sort later with an additional index. + In practice, this should only contain a few processors */ /*which part do I own?*/ tmp_row_start = hypre_max(part->row_start, row_start); @@ -254,43 +260,46 @@ hypre_LocateAssumedPartition(MPI_Comm comm, HYPRE_BigInt row_start, HYPRE_BigInt while (rows_found != locate_row_count) { - hypre_MPI_Recv( tmp_range, 2 , HYPRE_MPI_BIG_INT, hypre_MPI_ANY_SOURCE, - flag1 , comm, &status0); - /*flag1 , hypre_MPI_COMM_WORLD, &status0);*/ + hypre_MPI_Recv( tmp_range, 2, HYPRE_MPI_BIG_INT, hypre_MPI_ANY_SOURCE, + flag1, comm, &status0); + /*flag1 , hypre_MPI_COMM_WORLD, &status0);*/ - if (part->length==part->storage_length) + if (part->length == part->storage_length) { - part->storage_length+=10; - part->proc_list = hypre_TReAlloc(part->proc_list, HYPRE_Int, part->storage_length, HYPRE_MEMORY_HOST); - part->row_start_list = hypre_TReAlloc(part->row_start_list, HYPRE_BigInt, part->storage_length, HYPRE_MEMORY_HOST); - part->row_end_list = hypre_TReAlloc(part->row_end_list, HYPRE_BigInt, part->storage_length, HYPRE_MEMORY_HOST); + part->storage_length += 10; + part->proc_list = hypre_TReAlloc(part->proc_list, HYPRE_Int, part->storage_length, + HYPRE_MEMORY_HOST); + part->row_start_list = hypre_TReAlloc(part->row_start_list, HYPRE_BigInt, part->storage_length, + HYPRE_MEMORY_HOST); + part->row_end_list = hypre_TReAlloc(part->row_end_list, HYPRE_BigInt, part->storage_length, + HYPRE_MEMORY_HOST); } part->row_start_list[part->length] = tmp_range[0]; part->row_end_list[part->length] = tmp_range[1]; part->proc_list[part->length] = status0.hypre_MPI_SOURCE; - rows_found += tmp_range[1]- tmp_range[0] + 1; + rows_found += tmp_range[1] - tmp_range[0] + 1; part->length++; } /*In case the partition of the assumed partition is longish, we would like to know the sorted order */ - si= hypre_CTAlloc(HYPRE_Int, part->length, HYPRE_MEMORY_HOST); + si = hypre_CTAlloc(HYPRE_Int, part->length, HYPRE_MEMORY_HOST); sortme = hypre_CTAlloc(HYPRE_BigInt, part->length, HYPRE_MEMORY_HOST); - for (i=0; ilength; i++) + for (i = 0; i < part->length; i++) { - si[i] = i; - sortme[i] = part->row_start_list[i]; + si[i] = i; + sortme[i] = part->row_start_list[i]; } - hypre_BigQsortbi( sortme, si, 0, (part->length)-1); + hypre_BigQsortbi( sortme, si, 0, (part->length) - 1); part->sort_index = si; /*free the requests */ hypre_MPI_Waitall(contact_list_length, requests, - statuses); + statuses); hypre_TFree(statuses, HYPRE_MEMORY_HOST); hypre_TFree(requests, HYPRE_MEMORY_HOST); @@ -348,7 +357,7 @@ hypre_ParCSRMatrixCreateAssumedPartition( hypre_ParCSRMatrix *matrix) { HYPRE_BigInt global_num_cols; /* HYPRE_Int myid; */ - HYPRE_BigInt row_start=0, row_end=0, col_start = 0, col_end = 0; + HYPRE_BigInt row_start = 0, row_end = 0, col_start = 0, col_end = 0; MPI_Comm comm; @@ -417,16 +426,16 @@ hypre_GetAssumedPartitionProcFromRow( MPI_Comm comm, HYPRE_BigInt row, errors make this difficult!!!!! */ size = global_num_rows / (HYPRE_BigInt)num_procs; - extra = global_num_rows - size*(HYPRE_BigInt)num_procs; - switch_row = global_first_row + (size + 1)*extra; + extra = global_num_rows - size * (HYPRE_BigInt)num_procs; + switch_row = global_first_row + (size + 1) * extra; if (row >= switch_row) { - *proc_id = (HYPRE_Int)(extra + (row - switch_row)/size); + *proc_id = (HYPRE_Int)(extra + (row - switch_row) / size); } else { - *proc_id = (HYPRE_Int)((row - global_first_row)/(size+1)); + *proc_id = (HYPRE_Int)((row - global_first_row) / (size + 1)); } @@ -452,19 +461,19 @@ hypre_GetAssumedPartitionRowRange( MPI_Comm comm, HYPRE_Int proc_id, HYPRE_BigIn /*hypre_MPI_Comm_size(hypre_MPI_COMM_WORLD, &num_procs );*/ - /* this may look non-intuitive, but we have to be very careful that - this function and the next are inverses - and avoiding overflow and - rounding errors makes this difficult! */ + /* this may look non-intuitive, but we have to be very careful that + this function and the next are inverses - and avoiding overflow and + rounding errors makes this difficult! */ size = global_num_rows / (HYPRE_BigInt)num_procs; - extra = (HYPRE_Int)(global_num_rows - size*(HYPRE_BigInt)num_procs); + extra = (HYPRE_Int)(global_num_rows - size * (HYPRE_BigInt)num_procs); - *row_start = global_first_row + size*(HYPRE_BigInt)proc_id; + *row_start = global_first_row + size * (HYPRE_BigInt)proc_id; *row_start += (HYPRE_BigInt) hypre_min(proc_id, extra); - *row_end = global_first_row + size*(HYPRE_BigInt)(proc_id+1); - *row_end += (HYPRE_BigInt)hypre_min(proc_id+1, extra); + *row_end = global_first_row + size * (HYPRE_BigInt)(proc_id + 1); + *row_end += (HYPRE_BigInt)hypre_min(proc_id + 1, extra); *row_end = *row_end - 1; @@ -488,7 +497,7 @@ hypre_ParVectorCreateAssumedPartition( hypre_ParVector *vector) { HYPRE_BigInt global_num; HYPRE_Int myid; - HYPRE_BigInt start=0, end=0; + HYPRE_BigInt start = 0, end = 0; MPI_Comm comm; @@ -509,7 +518,7 @@ hypre_ParVectorCreateAssumedPartition( hypre_ParVector *vector) /* get my assumed partitioning - we want partitioning of the vector that the matrix multiplies - so we use the col start and end */ hypre_GetAssumedPartitionRowRange( comm, myid, 0, global_num, &(apart->row_start), - &(apart->row_end)); + &(apart->row_end)); /*allocate some space for the partition of the assumed partition */ apart->length = 0; diff --git a/external/hypre/src/parcsr_mv/par_csr_assumed_part.h b/external/hypre/src/parcsr_mv/par_csr_assumed_part.h index fde9ac93..ea877d44 100644 --- a/external/hypre/src/parcsr_mv/par_csr_assumed_part.h +++ b/external/hypre/src/parcsr_mv/par_csr_assumed_part.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/parcsr_mv/par_csr_bool_matop.c b/external/hypre/src/parcsr_mv/par_csr_bool_matop.c index a452ac0f..87026046 100644 --- a/external/hypre/src/parcsr_mv/par_csr_bool_matop.c +++ b/external/hypre/src/parcsr_mv/par_csr_bool_matop.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -11,7 +11,7 @@ hypre_ParCSRBooleanMatrix* hypre_ParBooleanMatmul( hypre_ParCSRBooleanMatrix *A, hypre_ParCSRBooleanMatrix *B ) { - MPI_Comm comm = hypre_ParCSRBooleanMatrix_Get_Comm(A); + MPI_Comm comm = hypre_ParCSRBooleanMatrix_Get_Comm(A); hypre_CSRBooleanMatrix *A_diag = hypre_ParCSRBooleanMatrix_Get_Diag(A); HYPRE_Int *A_diag_i = hypre_CSRBooleanMatrix_Get_I(A_diag); @@ -22,57 +22,57 @@ hypre_ParBooleanMatmul( hypre_ParCSRBooleanMatrix *A, HYPRE_Int *A_offd_j = hypre_CSRBooleanMatrix_Get_J(A_offd); HYPRE_BigInt *row_starts_A = hypre_ParCSRBooleanMatrix_Get_RowStarts(A); - HYPRE_Int num_rows_diag_A = hypre_CSRBooleanMatrix_Get_NRows(A_diag); - HYPRE_Int num_cols_diag_A = hypre_CSRBooleanMatrix_Get_NCols(A_diag); - HYPRE_Int num_cols_offd_A = hypre_CSRBooleanMatrix_Get_NCols(A_offd); + HYPRE_Int num_rows_diag_A = hypre_CSRBooleanMatrix_Get_NRows(A_diag); + HYPRE_Int num_cols_diag_A = hypre_CSRBooleanMatrix_Get_NCols(A_diag); + HYPRE_Int num_cols_offd_A = hypre_CSRBooleanMatrix_Get_NCols(A_offd); hypre_CSRBooleanMatrix *B_diag = hypre_ParCSRBooleanMatrix_Get_Diag(B); HYPRE_Int *B_diag_i = hypre_CSRBooleanMatrix_Get_I(B_diag); HYPRE_Int *B_diag_j = hypre_CSRBooleanMatrix_Get_J(B_diag); hypre_CSRBooleanMatrix *B_offd = hypre_ParCSRBooleanMatrix_Get_Offd(B); - HYPRE_BigInt *col_map_offd_B = hypre_ParCSRBooleanMatrix_Get_ColMapOffd(B); + HYPRE_BigInt *col_map_offd_B = hypre_ParCSRBooleanMatrix_Get_ColMapOffd(B); HYPRE_Int *B_offd_i = hypre_CSRBooleanMatrix_Get_I(B_offd); HYPRE_Int *B_offd_j = hypre_CSRBooleanMatrix_Get_J(B_offd); - HYPRE_BigInt first_col_diag_B = hypre_ParCSRBooleanMatrix_Get_FirstColDiag(B); - HYPRE_BigInt last_col_diag_B; + HYPRE_BigInt first_col_diag_B = hypre_ParCSRBooleanMatrix_Get_FirstColDiag(B); + HYPRE_BigInt last_col_diag_B; HYPRE_BigInt *col_starts_B = hypre_ParCSRBooleanMatrix_Get_ColStarts(B); - HYPRE_Int num_rows_diag_B = hypre_CSRBooleanMatrix_Get_NRows(B_diag); - HYPRE_Int num_cols_diag_B = hypre_CSRBooleanMatrix_Get_NCols(B_diag); - HYPRE_Int num_cols_offd_B = hypre_CSRBooleanMatrix_Get_NCols(B_offd); + HYPRE_Int num_rows_diag_B = hypre_CSRBooleanMatrix_Get_NRows(B_diag); + HYPRE_Int num_cols_diag_B = hypre_CSRBooleanMatrix_Get_NCols(B_diag); + HYPRE_Int num_cols_offd_B = hypre_CSRBooleanMatrix_Get_NCols(B_offd); hypre_ParCSRBooleanMatrix *C; - HYPRE_BigInt *col_map_offd_C; - HYPRE_Int *map_B_to_C=NULL; + HYPRE_BigInt *col_map_offd_C = NULL; + HYPRE_Int *map_B_to_C = NULL; hypre_CSRBooleanMatrix *C_diag; HYPRE_Int *C_diag_i; HYPRE_Int *C_diag_j; hypre_CSRBooleanMatrix *C_offd; - HYPRE_Int *C_offd_i=NULL; - HYPRE_Int *C_offd_j=NULL; + HYPRE_Int *C_offd_i = NULL; + HYPRE_Int *C_offd_j = NULL; HYPRE_Int C_diag_size; HYPRE_Int C_offd_size; - HYPRE_Int num_cols_offd_C = 0; + HYPRE_Int num_cols_offd_C = 0; - hypre_CSRBooleanMatrix *Bs_ext; - HYPRE_Int *Bs_ext_i; - HYPRE_BigInt *Bs_ext_j; + hypre_CSRBooleanMatrix *Bs_ext = NULL; + HYPRE_Int *Bs_ext_i = NULL; + HYPRE_BigInt *Bs_ext_j = NULL; - HYPRE_Int *B_ext_diag_i; - HYPRE_Int *B_ext_diag_j; - HYPRE_Int B_ext_diag_size; + HYPRE_Int *B_ext_diag_i = NULL; + HYPRE_Int *B_ext_diag_j = NULL; + HYPRE_Int B_ext_diag_size; - HYPRE_Int *B_ext_offd_i; - HYPRE_Int *B_ext_offd_j; - HYPRE_BigInt *B_tmp_offd_j; - HYPRE_Int B_ext_offd_size; + HYPRE_Int *B_ext_offd_i = NULL; + HYPRE_Int *B_ext_offd_j = NULL; + HYPRE_BigInt *B_tmp_offd_j = NULL; + HYPRE_Int B_ext_offd_size; - HYPRE_Int *B_marker; - HYPRE_BigInt *temp; + HYPRE_Int *B_marker; + HYPRE_BigInt *temp; HYPRE_Int i, j; HYPRE_Int i1, i2, i3; @@ -81,12 +81,12 @@ hypre_ParBooleanMatmul( hypre_ParCSRBooleanMatrix *A, HYPRE_Int jj_count_diag, jj_count_offd; HYPRE_Int jj_row_begin_diag, jj_row_begin_offd; HYPRE_Int start_indexing = 0; /* start indexing for C_data at 0 */ - HYPRE_BigInt n_rows_A, n_cols_A; - HYPRE_BigInt n_rows_B, n_cols_B; + HYPRE_BigInt n_rows_A, n_cols_A; + HYPRE_BigInt n_rows_B, n_cols_B; HYPRE_Int allsquare = 0; HYPRE_Int cnt, cnt_offd, cnt_diag; HYPRE_Int num_procs; - HYPRE_Int value; + HYPRE_BigInt value; n_rows_A = hypre_ParCSRBooleanMatrix_Get_GlobalNRows(A); n_cols_A = hypre_ParCSRBooleanMatrix_Get_GlobalNCols(A); @@ -95,10 +95,10 @@ hypre_ParBooleanMatmul( hypre_ParCSRBooleanMatrix *A, if (n_cols_A != n_rows_B || num_cols_diag_A != num_rows_diag_B) { - hypre_error_w_msg(HYPRE_ERROR_GENERIC," Error! Incompatible matrix dimensions!\n"); - return NULL; + hypre_error_w_msg(HYPRE_ERROR_GENERIC, " Error! Incompatible matrix dimensions!\n"); + return NULL; } - if ( num_rows_diag_A==num_cols_diag_B ) allsquare = 1; + if ( num_rows_diag_A == num_cols_diag_B ) { allsquare = 1; } /*----------------------------------------------------------------------- * Extract B_ext, i.e. portion of B that is stored on neighbor procs @@ -109,39 +109,45 @@ hypre_ParBooleanMatmul( hypre_ParCSRBooleanMatrix *A, if (num_procs > 1) { - /*--------------------------------------------------------------------- - * If there exists no CommPkg for A, a CommPkg is generated using - * equally load balanced partitionings - *--------------------------------------------------------------------*/ - if (!hypre_ParCSRBooleanMatrix_Get_CommPkg(A)) - { - hypre_BooleanMatvecCommPkgCreate(A); - } - - Bs_ext = hypre_ParCSRBooleanMatrixExtractBExt(B,A); - Bs_ext_i = hypre_CSRBooleanMatrix_Get_I(Bs_ext); - Bs_ext_j = hypre_CSRBooleanMatrix_Get_BigJ(Bs_ext); + /*--------------------------------------------------------------------- + * If there exists no CommPkg for A, a CommPkg is generated using + * equally load balanced partitionings + *--------------------------------------------------------------------*/ + if (!hypre_ParCSRBooleanMatrix_Get_CommPkg(A)) + { + hypre_BooleanMatvecCommPkgCreate(A); + } + + Bs_ext = hypre_ParCSRBooleanMatrixExtractBExt(B, A); + Bs_ext_i = hypre_CSRBooleanMatrix_Get_I(Bs_ext); + Bs_ext_j = hypre_CSRBooleanMatrix_Get_BigJ(Bs_ext); } - B_ext_diag_i = hypre_CTAlloc(HYPRE_Int, num_cols_offd_A+1, HYPRE_MEMORY_HOST); - B_ext_offd_i = hypre_CTAlloc(HYPRE_Int, num_cols_offd_A+1, HYPRE_MEMORY_HOST); + B_ext_diag_i = hypre_CTAlloc(HYPRE_Int, num_cols_offd_A + 1, HYPRE_MEMORY_HOST); + B_ext_offd_i = hypre_CTAlloc(HYPRE_Int, num_cols_offd_A + 1, HYPRE_MEMORY_HOST); B_ext_diag_size = 0; B_ext_offd_size = 0; - last_col_diag_B = first_col_diag_B + num_cols_diag_B -1; + last_col_diag_B = first_col_diag_B + num_cols_diag_B - 1; - for (i=0; i < num_cols_offd_A; i++) + for (i = 0; i < num_cols_offd_A; i++) { - for (j=Bs_ext_i[i]; j < Bs_ext_i[i+1]; j++) + for (j = Bs_ext_i[i]; j < Bs_ext_i[i + 1]; j++) if (Bs_ext_j[j] < first_col_diag_B || Bs_ext_j[j] > last_col_diag_B) + { B_ext_offd_size++; + } else + { B_ext_diag_size++; - B_ext_diag_i[i+1] = B_ext_diag_size; - B_ext_offd_i[i+1] = B_ext_offd_size; + } + B_ext_diag_i[i + 1] = B_ext_diag_size; + B_ext_offd_i[i + 1] = B_ext_offd_size; } if (B_ext_diag_size) + { B_ext_diag_j = hypre_CTAlloc(HYPRE_Int, B_ext_diag_size, HYPRE_MEMORY_HOST); + } if (B_ext_offd_size) { @@ -151,9 +157,9 @@ hypre_ParBooleanMatmul( hypre_ParCSRBooleanMatrix *A, cnt_offd = 0; cnt_diag = 0; - for (i=0; i < num_cols_offd_A; i++) + for (i = 0; i < num_cols_offd_A; i++) { - for (j=Bs_ext_i[i]; j < Bs_ext_i[i+1]; j++) + for (j = Bs_ext_i[i]; j < Bs_ext_i[i + 1]; j++) if (Bs_ext_j[j] < first_col_diag_B || Bs_ext_j[j] > last_col_diag_B) { B_tmp_offd_j[cnt_offd++] = Bs_ext_j[j]; @@ -174,20 +180,24 @@ hypre_ParBooleanMatmul( hypre_ParCSRBooleanMatrix *A, cnt = 0; if (B_ext_offd_size || num_cols_offd_B) { - temp = hypre_CTAlloc(HYPRE_BigInt, B_ext_offd_size+num_cols_offd_B, HYPRE_MEMORY_HOST); - for (i=0; i < B_ext_offd_size; i++) + temp = hypre_CTAlloc(HYPRE_BigInt, B_ext_offd_size + num_cols_offd_B, HYPRE_MEMORY_HOST); + for (i = 0; i < B_ext_offd_size; i++) + { temp[i] = B_tmp_offd_j[i]; + } cnt = B_ext_offd_size; - for (i=0; i < num_cols_offd_B; i++) + for (i = 0; i < num_cols_offd_B; i++) + { temp[cnt++] = col_map_offd_B[i]; + } } if (cnt) { - hypre_BigQsort0(temp, 0, cnt-1); + hypre_BigQsort0(temp, 0, cnt - 1); num_cols_offd_C = 1; value = temp[0]; - for (i=1; i < cnt; i++) + for (i = 1; i < cnt; i++) { if (temp[i] > value) { @@ -198,37 +208,46 @@ hypre_ParBooleanMatmul( hypre_ParCSRBooleanMatrix *A, } if (num_cols_offd_C) - col_map_offd_C = hypre_CTAlloc(HYPRE_BigInt, num_cols_offd_C, HYPRE_MEMORY_HOST); + { + col_map_offd_C = hypre_CTAlloc(HYPRE_BigInt, num_cols_offd_C, HYPRE_MEMORY_HOST); + } - for (i=0; i < num_cols_offd_C; i++) + for (i = 0; i < num_cols_offd_C; i++) + { col_map_offd_C[i] = temp[i]; + } if (B_ext_offd_size || num_cols_offd_B) + { hypre_TFree(temp, HYPRE_MEMORY_HOST); + } - for (i=0 ; i < B_ext_offd_size; i++) + for (i = 0 ; i < B_ext_offd_size; i++) B_ext_offd_j[i] = hypre_BigBinarySearch(col_map_offd_C, - B_tmp_offd_j[i], - num_cols_offd_C); + B_tmp_offd_j[i], + num_cols_offd_C); if (B_ext_offd_size) + { hypre_TFree(B_tmp_offd_j, HYPRE_MEMORY_HOST); + } if (num_cols_offd_B) { map_B_to_C = hypre_CTAlloc(HYPRE_Int, num_cols_offd_B, HYPRE_MEMORY_HOST); cnt = 0; - for (i=0; i < num_cols_offd_C; i++) + for (i = 0; i < num_cols_offd_C; i++) if (col_map_offd_C[i] == col_map_offd_B[cnt]) { map_B_to_C[cnt++] = i; - if (cnt == num_cols_offd_B) break; + if (cnt == num_cols_offd_B) { break; } } } hypre_ParMatmul_RowSizes( /*&C_diag_i, &C_offd_i, &B_marker,*/ - HYPRE_MEMORY_DEVICE, /* RL: XXX */ + /* BooleanMatrix only uses HOST memory for now */ + HYPRE_MEMORY_HOST, &C_diag_i, &C_offd_i, NULL, A_diag_i, A_diag_j, A_offd_i, A_offd_j, B_diag_i, B_diag_j, B_offd_i, B_offd_j, @@ -239,7 +258,7 @@ hypre_ParBooleanMatmul( hypre_ParCSRBooleanMatrix *A, num_cols_offd_A, allsquare, num_cols_diag_B, num_cols_offd_B, num_cols_offd_C - ); + ); /*----------------------------------------------------------------------- @@ -251,7 +270,7 @@ hypre_ParBooleanMatmul( hypre_ParCSRBooleanMatrix *A, C_diag_j = hypre_CTAlloc(HYPRE_Int, C_diag_size, HYPRE_MEMORY_HOST); if (C_offd_size) { - C_offd_j = hypre_CTAlloc(HYPRE_Int, C_offd_size, HYPRE_MEMORY_HOST); + C_offd_j = hypre_CTAlloc(HYPRE_Int, C_offd_size, HYPRE_MEMORY_HOST); } @@ -264,7 +283,7 @@ hypre_ParBooleanMatmul( hypre_ParCSRBooleanMatrix *A, * Allocate marker array. *-----------------------------------------------------------------------*/ - B_marker = hypre_CTAlloc(HYPRE_Int, num_cols_diag_B+num_cols_offd_C, HYPRE_MEMORY_HOST); + B_marker = hypre_CTAlloc(HYPRE_Int, num_cols_diag_B + num_cols_offd_C, HYPRE_MEMORY_HOST); /*----------------------------------------------------------------------- * Initialize some stuff. @@ -272,7 +291,7 @@ hypre_ParBooleanMatmul( hypre_ParCSRBooleanMatrix *A, jj_count_diag = start_indexing; jj_count_offd = start_indexing; - for (i1 = 0; i1 < num_cols_diag_B+num_cols_offd_C; i1++) + for (i1 = 0; i1 < num_cols_diag_B + num_cols_offd_C; i1++) { B_marker[i1] = -1; } @@ -290,114 +309,115 @@ hypre_ParBooleanMatmul( hypre_ParCSRBooleanMatrix *A, jj_row_begin_diag = jj_count_diag; jj_row_begin_offd = jj_count_offd; - if ( allsquare ) { + if ( allsquare ) + { B_marker[i1] = jj_count_diag; C_diag_j[jj_count_diag] = i1; jj_count_diag++; } - /*----------------------------------------------------------------- - * Loop over entries in row i1 of A_offd. - *-----------------------------------------------------------------*/ + /*----------------------------------------------------------------- + * Loop over entries in row i1 of A_offd. + *-----------------------------------------------------------------*/ - if (num_cols_offd_A) - { - for (jj2 = A_offd_i[i1]; jj2 < A_offd_i[i1+1]; jj2++) - { + if (num_cols_offd_A) + { + for (jj2 = A_offd_i[i1]; jj2 < A_offd_i[i1 + 1]; jj2++) + { i2 = A_offd_j[jj2]; - /*----------------------------------------------------------- - * Loop over entries in row i2 of B_ext. - *-----------------------------------------------------------*/ + /*----------------------------------------------------------- + * Loop over entries in row i2 of B_ext. + *-----------------------------------------------------------*/ - for (jj3 = B_ext_offd_i[i2]; jj3 < B_ext_offd_i[i2+1]; jj3++) - { - i3 = num_cols_diag_B+B_ext_offd_j[jj3]; + for (jj3 = B_ext_offd_i[i2]; jj3 < B_ext_offd_i[i2 + 1]; jj3++) + { + i3 = num_cols_diag_B + B_ext_offd_j[jj3]; - /*-------------------------------------------------------- - * Check B_marker to see that C_{i1,i3} has not already - * been accounted for. If it has not, create a new entry. - * If it has, add new contribution. - *--------------------------------------------------------*/ - if (B_marker[i3] < jj_row_begin_offd) - { - B_marker[i3] = jj_count_offd; - C_offd_j[jj_count_offd] = i3-num_cols_diag_B; - jj_count_offd++; - } - } - for (jj3 = B_ext_diag_i[i2]; jj3 < B_ext_diag_i[i2+1]; jj3++) + /*-------------------------------------------------------- + * Check B_marker to see that C_{i1,i3} has not already + * been accounted for. If it has not, create a new entry. + * If it has, add new contribution. + *--------------------------------------------------------*/ + if (B_marker[i3] < jj_row_begin_offd) { - i3 = B_ext_diag_j[jj3]; + B_marker[i3] = jj_count_offd; + C_offd_j[jj_count_offd] = i3 - num_cols_diag_B; + jj_count_offd++; + } + } + for (jj3 = B_ext_diag_i[i2]; jj3 < B_ext_diag_i[i2 + 1]; jj3++) + { + i3 = B_ext_diag_j[jj3]; - if (B_marker[i3] < jj_row_begin_diag) - { - B_marker[i3] = jj_count_diag; - C_diag_j[jj_count_diag] = i3; - jj_count_diag++; - } + if (B_marker[i3] < jj_row_begin_diag) + { + B_marker[i3] = jj_count_diag; + C_diag_j[jj_count_diag] = i3; + jj_count_diag++; } } } + } - /*----------------------------------------------------------------- - * Loop over entries in row i1 of A_diag. - *-----------------------------------------------------------------*/ - - for (jj2 = A_diag_i[i1]; jj2 < A_diag_i[i1+1]; jj2++) - { - i2 = A_diag_j[jj2]; + /*----------------------------------------------------------------- + * Loop over entries in row i1 of A_diag. + *-----------------------------------------------------------------*/ - /*----------------------------------------------------------- - * Loop over entries in row i2 of B_diag. - *-----------------------------------------------------------*/ + for (jj2 = A_diag_i[i1]; jj2 < A_diag_i[i1 + 1]; jj2++) + { + i2 = A_diag_j[jj2]; - for (jj3 = B_diag_i[i2]; jj3 < B_diag_i[i2+1]; jj3++) - { - i3 = B_diag_j[jj3]; + /*----------------------------------------------------------- + * Loop over entries in row i2 of B_diag. + *-----------------------------------------------------------*/ - /*-------------------------------------------------------- - * Check B_marker to see that C_{i1,i3} has not already - * been accounted for. If it has not, create a new entry. - * If it has, add new contribution. - *--------------------------------------------------------*/ + for (jj3 = B_diag_i[i2]; jj3 < B_diag_i[i2 + 1]; jj3++) + { + i3 = B_diag_j[jj3]; + + /*-------------------------------------------------------- + * Check B_marker to see that C_{i1,i3} has not already + * been accounted for. If it has not, create a new entry. + * If it has, add new contribution. + *--------------------------------------------------------*/ + + if (B_marker[i3] < jj_row_begin_diag) + { + B_marker[i3] = jj_count_diag; + C_diag_j[jj_count_diag] = i3; + jj_count_diag++; + } + } + if (num_cols_offd_B) + { + for (jj3 = B_offd_i[i2]; jj3 < B_offd_i[i2 + 1]; jj3++) + { + i3 = num_cols_diag_B + map_B_to_C[B_offd_j[jj3]]; - if (B_marker[i3] < jj_row_begin_diag) - { - B_marker[i3] = jj_count_diag; - C_diag_j[jj_count_diag] = i3; - jj_count_diag++; - } - } - if (num_cols_offd_B) - { - for (jj3 = B_offd_i[i2]; jj3 < B_offd_i[i2+1]; jj3++) - { - i3 = num_cols_diag_B+map_B_to_C[B_offd_j[jj3]]; + /*-------------------------------------------------------- + * Check B_marker to see that C_{i1,i3} has not already + * been accounted for. If it has not, create a new entry. + * If it has, add new contribution. + *--------------------------------------------------------*/ - /*-------------------------------------------------------- - * Check B_marker to see that C_{i1,i3} has not already - * been accounted for. If it has not, create a new entry. - * If it has, add new contribution. - *--------------------------------------------------------*/ - - if (B_marker[i3] < jj_row_begin_offd) - { - B_marker[i3] = jj_count_offd; - C_offd_j[jj_count_offd] = i3-num_cols_diag_B; - jj_count_offd++; - } - } + if (B_marker[i3] < jj_row_begin_offd) + { + B_marker[i3] = jj_count_offd; + C_offd_j[jj_count_offd] = i3 - num_cols_diag_B; + jj_count_offd++; } + } } + } } C = hypre_ParCSRBooleanMatrixCreate(comm, n_rows_A, n_cols_B, row_starts_A, - col_starts_B, num_cols_offd_C, C_diag_size, C_offd_size); + col_starts_B, num_cols_offd_C, C_diag_size, C_offd_size); -/* Note that C does not own the partitionings */ - hypre_ParCSRBooleanMatrixSetRowStartsOwner(C,0); - hypre_ParCSRBooleanMatrixSetColStartsOwner(C,0); + /* Note that C does not own the partitionings */ + hypre_ParCSRBooleanMatrixSetRowStartsOwner(C, 0); + hypre_ParCSRBooleanMatrixSetColStartsOwner(C, 0); C_diag = hypre_ParCSRBooleanMatrix_Get_Diag(C); hypre_CSRBooleanMatrix_Get_I(C_diag) = C_diag_i; @@ -420,11 +440,15 @@ hypre_ParBooleanMatmul( hypre_ParCSRBooleanMatrix *A, hypre_TFree(B_marker, HYPRE_MEMORY_HOST); hypre_TFree(B_ext_diag_i, HYPRE_MEMORY_HOST); if (B_ext_diag_size) + { hypre_TFree(B_ext_diag_j, HYPRE_MEMORY_HOST); + } hypre_TFree(B_ext_offd_i, HYPRE_MEMORY_HOST); if (B_ext_offd_size) + { hypre_TFree(B_ext_offd_j, HYPRE_MEMORY_HOST); - if (num_cols_offd_B) hypre_TFree(map_B_to_C, HYPRE_MEMORY_HOST); + } + if (num_cols_offd_B) { hypre_TFree(map_B_to_C, HYPRE_MEMORY_HOST); } return C; @@ -470,25 +494,25 @@ hypre_ParCSRBooleanMatrixExtractBExt HYPRE_Int *B_ext_i; HYPRE_BigInt *B_ext_j; - HYPRE_Complex *B_ext_data=NULL, *diag_data=NULL, *offd_data=NULL; - HYPRE_BigInt *B_ext_row_map=NULL; + HYPRE_Complex *B_ext_data = NULL, *diag_data = NULL, *offd_data = NULL; + HYPRE_BigInt *B_ext_row_map = NULL; /* ... not referenced, but needed for function call */ num_cols_B = hypre_ParCSRBooleanMatrix_Get_GlobalNCols(B); num_rows_B_ext = recv_vec_starts[num_recvs]; hypre_ParCSRMatrixExtractBExt_Arrays - ( &B_ext_i, &B_ext_j, &B_ext_data, &B_ext_row_map, - &num_nonzeros, - 0, 0, comm, comm_pkg, - num_cols_B, num_recvs, num_sends, - first_col_diag, B->row_starts, - recv_vec_starts, send_map_starts, send_map_elmts, - diag_i, diag_j, offd_i, offd_j, col_map_offd, - diag_data, offd_data - ); - - B_ext = hypre_CSRBooleanMatrixCreate(num_rows_B_ext,num_cols_B,num_nonzeros); + ( &B_ext_i, &B_ext_j, &B_ext_data, &B_ext_row_map, + &num_nonzeros, + 0, 0, comm, comm_pkg, + num_cols_B, num_recvs, num_sends, + first_col_diag, B->row_starts, + recv_vec_starts, send_map_starts, send_map_elmts, + diag_i, diag_j, offd_i, offd_j, col_map_offd, + diag_data, offd_data + ); + + B_ext = hypre_CSRBooleanMatrixCreate(num_rows_B_ext, num_cols_B, num_nonzeros); hypre_CSRBooleanMatrix_Get_I(B_ext) = B_ext_i; hypre_CSRBooleanMatrix_Get_BigJ(B_ext) = B_ext_j; @@ -504,7 +528,7 @@ hypre_ParCSRBooleanMatrixExtractBExt hypre_CSRBooleanMatrix * hypre_ParCSRBooleanMatrixExtractAExt( hypre_ParCSRBooleanMatrix *A, - HYPRE_BigInt ** pA_ext_row_map ) + HYPRE_BigInt ** pA_ext_row_map ) { /* Note that A's role as the first factor in A*A^T is used only through ...CommPkgT(A), which basically says which rows of A @@ -545,24 +569,24 @@ hypre_ParCSRBooleanMatrixExtractAExt( hypre_ParCSRBooleanMatrix *A, HYPRE_BigInt *A_ext_j; HYPRE_Int data = 0; - HYPRE_Complex *A_ext_data = NULL, *diag_data=NULL, *offd_data=NULL; + HYPRE_Complex *A_ext_data = NULL, *diag_data = NULL, *offd_data = NULL; /* ... not referenced, but needed for function call */ num_cols_A = hypre_ParCSRBooleanMatrix_Get_GlobalNCols(A); num_rows_A_ext = recv_vec_starts[num_recvs]; hypre_ParCSRMatrixExtractBExt_Arrays - ( &A_ext_i, &A_ext_j, &A_ext_data, pA_ext_row_map, - &num_nonzeros, - data, 1, comm, comm_pkg, - num_cols_A, num_recvs, num_sends, - first_col_diag, A->row_starts, - recv_vec_starts, send_map_starts, send_map_elmts, - diag_i, diag_j, offd_i, offd_j, col_map_offd, - diag_data, offd_data - ); - - A_ext = hypre_CSRBooleanMatrixCreate(num_rows_A_ext,num_cols_A,num_nonzeros); + ( &A_ext_i, &A_ext_j, &A_ext_data, pA_ext_row_map, + &num_nonzeros, + data, 1, comm, comm_pkg, + num_cols_A, num_recvs, num_sends, + first_col_diag, A->row_starts, + recv_vec_starts, send_map_starts, send_map_elmts, + diag_i, diag_j, offd_i, offd_j, col_map_offd, + diag_data, offd_data + ); + + A_ext = hypre_CSRBooleanMatrixCreate(num_rows_A_ext, num_cols_A, num_nonzeros); hypre_CSRBooleanMatrix_Get_I(A_ext) = A_ext_i; hypre_CSRBooleanMatrix_Get_BigJ(A_ext) = A_ext_j; @@ -576,9 +600,10 @@ hypre_ParCSRBooleanMatrixExtractAExt( hypre_ParCSRBooleanMatrix *A, * This is based on hypre_ParCSRAAt. *--------------------------------------------------------------------------*/ -hypre_ParCSRBooleanMatrix * hypre_ParBooleanAAt( hypre_ParCSRBooleanMatrix * A ) +hypre_ParCSRBooleanMatrix* +hypre_ParBooleanAAt(hypre_ParCSRBooleanMatrix *A) { - MPI_Comm comm = hypre_ParCSRBooleanMatrix_Get_Comm(A); + MPI_Comm comm = hypre_ParCSRBooleanMatrix_Get_Comm(A); hypre_CSRBooleanMatrix *A_diag = hypre_ParCSRBooleanMatrix_Get_Diag(A); @@ -593,11 +618,11 @@ hypre_ParCSRBooleanMatrix * hypre_ParBooleanAAt( hypre_ParCSRBooleanMatrix * A HYPRE_BigInt *A_ext_row_map; HYPRE_BigInt *row_starts_A = hypre_ParCSRBooleanMatrix_Get_RowStarts(A); - HYPRE_Int num_rows_diag_A = hypre_CSRBooleanMatrix_Get_NRows(A_diag); - HYPRE_Int num_cols_offd_A = hypre_CSRBooleanMatrix_Get_NCols(A_offd); + HYPRE_Int num_rows_diag_A = hypre_CSRBooleanMatrix_Get_NRows(A_diag); + HYPRE_Int num_cols_offd_A = hypre_CSRBooleanMatrix_Get_NCols(A_offd); hypre_ParCSRBooleanMatrix *C; - HYPRE_BigInt *col_map_offd_C; + HYPRE_BigInt *col_map_offd_C; hypre_CSRBooleanMatrix *C_diag; @@ -606,24 +631,24 @@ hypre_ParCSRBooleanMatrix * hypre_ParBooleanAAt( hypre_ParCSRBooleanMatrix * A hypre_CSRBooleanMatrix *C_offd; - HYPRE_Int *C_offd_i=NULL; - HYPRE_Int *C_offd_j=NULL; + HYPRE_Int *C_offd_i = NULL; + HYPRE_Int *C_offd_j = NULL; HYPRE_Int *new_C_offd_j; HYPRE_Int C_diag_size; HYPRE_Int C_offd_size; - HYPRE_Int last_col_diag_C; - HYPRE_Int num_cols_offd_C; + HYPRE_BigInt last_col_diag_C; + HYPRE_Int num_cols_offd_C; - hypre_CSRBooleanMatrix *A_ext; + hypre_CSRBooleanMatrix *A_ext = NULL; - HYPRE_Int *A_ext_i; - HYPRE_BigInt *A_ext_j; - HYPRE_Int num_rows_A_ext=0; + HYPRE_Int *A_ext_i = NULL; + HYPRE_BigInt *A_ext_j = NULL; + HYPRE_Int num_rows_A_ext = 0; - HYPRE_BigInt first_row_index_A = hypre_ParCSRBooleanMatrix_Get_FirstRowIndex(A); - HYPRE_BigInt first_col_diag_A = hypre_ParCSRBooleanMatrix_Get_FirstColDiag(A); - HYPRE_Int *B_marker; + HYPRE_BigInt first_row_index_A = hypre_ParCSRBooleanMatrix_Get_FirstRowIndex(A); + HYPRE_BigInt first_col_diag_A = hypre_ParCSRBooleanMatrix_Get_FirstColDiag(A); + HYPRE_Int *B_marker; HYPRE_Int i; HYPRE_Int i1, i2, i3; @@ -632,16 +657,16 @@ hypre_ParCSRBooleanMatrix * hypre_ParBooleanAAt( hypre_ParCSRBooleanMatrix * A HYPRE_Int jj_count_diag, jj_count_offd; HYPRE_Int jj_row_begin_diag, jj_row_begin_offd; HYPRE_Int start_indexing = 0; /* start indexing for C_data at 0 */ - HYPRE_Int count; - HYPRE_BigInt n_rows_A, n_cols_A; + HYPRE_Int count; + HYPRE_BigInt n_rows_A, n_cols_A; n_rows_A = hypre_ParCSRBooleanMatrix_Get_GlobalNRows(A); n_cols_A = hypre_ParCSRBooleanMatrix_Get_GlobalNCols(A); if (n_cols_A != n_rows_A) { - hypre_error_w_msg(HYPRE_ERROR_GENERIC," Error! Incompatible matrix dimensions!\n"); - return NULL; + hypre_error_w_msg(HYPRE_ERROR_GENERIC, " Error! Incompatible matrix dimensions!\n"); + return NULL; } /*----------------------------------------------------------------------- * Extract A_ext, i.e. portion of A that is stored on neighbor procs @@ -650,31 +675,31 @@ hypre_ParCSRBooleanMatrix * hypre_ParBooleanAAt( hypre_ParCSRBooleanMatrix * A if ((HYPRE_BigInt)num_rows_diag_A != n_rows_A) { - /*--------------------------------------------------------------------- - * If there exists no CommPkg for A, a CommPkg is generated using - * equally load balanced partitionings - *--------------------------------------------------------------------*/ - if (!hypre_ParCSRBooleanMatrix_Get_CommPkg(A)) - { - hypre_BooleanMatTCommPkgCreate(A); - } - - A_ext = hypre_ParCSRBooleanMatrixExtractAExt( A, &A_ext_row_map ); - A_ext_i = hypre_CSRBooleanMatrix_Get_I(A_ext); - A_ext_j = hypre_CSRBooleanMatrix_Get_BigJ(A_ext); - num_rows_A_ext = hypre_CSRBooleanMatrix_Get_NRows(A_ext); + /*--------------------------------------------------------------------- + * If there exists no CommPkg for A, a CommPkg is generated using + * equally load balanced partitionings + *--------------------------------------------------------------------*/ + if (!hypre_ParCSRBooleanMatrix_Get_CommPkg(A)) + { + hypre_BooleanMatTCommPkgCreate(A); + } + + A_ext = hypre_ParCSRBooleanMatrixExtractAExt( A, &A_ext_row_map ); + A_ext_i = hypre_CSRBooleanMatrix_Get_I(A_ext); + A_ext_j = hypre_CSRBooleanMatrix_Get_BigJ(A_ext); + num_rows_A_ext = hypre_CSRBooleanMatrix_Get_NRows(A_ext); } /*----------------------------------------------------------------------- * Allocate marker array. *-----------------------------------------------------------------------*/ - B_marker = hypre_CTAlloc(HYPRE_Int, num_rows_diag_A+num_rows_A_ext , HYPRE_MEMORY_HOST); + B_marker = hypre_CTAlloc(HYPRE_Int, num_rows_diag_A + num_rows_A_ext, HYPRE_MEMORY_HOST); /*----------------------------------------------------------------------- * Initialize some stuff. *-----------------------------------------------------------------------*/ - for ( i1=0; i1 last_col_diag_C ) { /* offd */ - if (B_marker[i3+num_rows_diag_A] < jj_row_begin_offd) { - B_marker[i3+num_rows_diag_A] = jj_count_offd; + A_ext_row_map[i3] > last_col_diag_C ) /* offd */ + { + if (B_marker[i3 + num_rows_diag_A] < jj_row_begin_offd) + { + B_marker[i3 + num_rows_diag_A] = jj_count_offd; C_offd_j[jj_count_offd] = i3; jj_count_offd++; } } - else { /* diag */ - if (B_marker[i3+num_rows_diag_A] < jj_row_begin_diag) { - B_marker[i3+num_rows_diag_A] = jj_count_diag; - C_diag_j[jj_count_diag] = i3-(HYPRE_Int)first_col_diag_A; + else /* diag */ + { + if (B_marker[i3 + num_rows_diag_A] < jj_row_begin_diag) + { + B_marker[i3 + num_rows_diag_A] = jj_count_diag; + C_diag_j[jj_count_diag] = i3 - (HYPRE_Int)first_col_diag_A; jj_count_diag++; } } @@ -807,7 +839,7 @@ hypre_ParCSRBooleanMatrix * hypre_ParBooleanAAt( hypre_ParCSRBooleanMatrix * A if (num_cols_offd_A) { - for (jj2 = A_offd_i[i1]; jj2 < A_offd_i[i1+1]; jj2++) + for (jj2 = A_offd_i[i1]; jj2 < A_offd_i[i1 + 1]; jj2++) { i2 = A_offd_j[jj2]; @@ -822,9 +854,12 @@ hypre_ParCSRBooleanMatrix * hypre_ParBooleanAAt( hypre_ParCSRBooleanMatrix * A * blocks of C. *-----------------------------------------------------------*/ - for ( i3=0; i3 last_col_diag_C ) { /* offd */ - if (B_marker[i3+num_rows_diag_A] < jj_row_begin_offd) { - B_marker[i3+num_rows_diag_A] = jj_count_offd; + A_ext_row_map[i3] > last_col_diag_C ) /* offd */ + { + if (B_marker[i3 + num_rows_diag_A] < jj_row_begin_offd) + { + B_marker[i3 + num_rows_diag_A] = jj_count_offd; C_offd_j[jj_count_offd] = i3; jj_count_offd++; } } - else { /* diag */ - if (B_marker[i3+num_rows_diag_A] < jj_row_begin_diag) { - B_marker[i3+num_rows_diag_A] = jj_count_diag; - C_diag_j[jj_count_diag] = i3-(HYPRE_Int)first_row_index_A; + else /* diag */ + { + if (B_marker[i3 + num_rows_diag_A] < jj_row_begin_diag) + { + B_marker[i3 + num_rows_diag_A] = jj_count_diag; + C_diag_j[jj_count_diag] = i3 - (HYPRE_Int)first_row_index_A; jj_count_diag++; } } @@ -864,7 +903,7 @@ hypre_ParCSRBooleanMatrix * hypre_ParBooleanAAt( hypre_ParCSRBooleanMatrix * A * on this processor. *-----------------------------------------------------------------*/ - for (jj2 = A_diag_i[i1]; jj2 < A_diag_i[i1+1]; jj2++) + for (jj2 = A_diag_i[i1]; jj2 < A_diag_i[i1 + 1]; jj2++) { i2 = A_diag_j[jj2]; @@ -878,9 +917,12 @@ hypre_ParCSRBooleanMatrix * hypre_ParBooleanAAt( hypre_ParCSRBooleanMatrix * A * For each entry (i2,i3) of A^T, A(i1,i2)*A(i3,i2) defines * to C(i1,i3) *-----------------------------------------------------------*/ - for ( i3=0; i3= 0; i--) - if (row_starts[i] != col_starts[i]) - { - equal = 0; - break; - } + for (i = num_procs; i >= 0; i--) + if (row_starts[i] != col_starts[i]) + { + equal = 0; + break; + } if (equal) { - hypre_TFree(col_starts, HYPRE_MEMORY_HOST); - col_starts = row_starts; + hypre_TFree(col_starts, HYPRE_MEMORY_HOST); + col_starts = row_starts; } - + diag = hypre_CSRBooleanMatrixRead(new_file_d); local_num_rows = hypre_CSRBooleanMatrix_Get_NRows(diag); if (num_cols_offd) { - offd = hypre_CSRBooleanMatrixRead(new_file_o); + offd = hypre_CSRBooleanMatrixRead(new_file_o); } else - offd = hypre_CSRBooleanMatrixCreate(local_num_rows,0,0); + { + offd = hypre_CSRBooleanMatrixCreate(local_num_rows, 0, 0); + } + - matrix = hypre_CTAlloc(hypre_ParCSRBooleanMatrix, 1, HYPRE_MEMORY_HOST); - + hypre_ParCSRBooleanMatrix_Get_Comm(matrix) = comm; hypre_ParCSRBooleanMatrix_Get_GlobalNRows(matrix) = global_num_rows; hypre_ParCSRBooleanMatrix_Get_GlobalNCols(matrix) = global_num_cols; @@ -463,14 +488,20 @@ hypre_ParCSRBooleanMatrixRead( MPI_Comm comm, const char *file_name ) hypre_ParCSRBooleanMatrix_Get_OwnsRowStarts(matrix) = 1; hypre_ParCSRBooleanMatrix_Get_OwnsColStarts(matrix) = 1; if (row_starts == col_starts) - hypre_ParCSRBooleanMatrix_Get_OwnsColStarts(matrix) = 0; + { + hypre_ParCSRBooleanMatrix_Get_OwnsColStarts(matrix) = 0; + } hypre_ParCSRBooleanMatrix_Get_Diag(matrix) = diag; hypre_ParCSRBooleanMatrix_Get_Offd(matrix) = offd; if (num_cols_offd) - hypre_ParCSRBooleanMatrix_Get_ColMapOffd(matrix) = col_map_offd; + { + hypre_ParCSRBooleanMatrix_Get_ColMapOffd(matrix) = col_map_offd; + } else - hypre_ParCSRBooleanMatrix_Get_ColMapOffd(matrix) = NULL; + { + hypre_ParCSRBooleanMatrix_Get_ColMapOffd(matrix) = NULL; + } return matrix; } @@ -479,8 +510,8 @@ hypre_ParCSRBooleanMatrixRead( MPI_Comm comm, const char *file_name ) * hypre_ParCSRBooleanMatrixPrint *--------------------------------------------------------------------------*/ -HYPRE_Int hypre_ParCSRBooleanMatrixPrint( hypre_ParCSRBooleanMatrix *matrix, - const char *file_name ) +HYPRE_Int hypre_ParCSRBooleanMatrixPrint( hypre_ParCSRBooleanMatrix *matrix, + const char *file_name ) { MPI_Comm comm = hypre_ParCSRBooleanMatrix_Get_Comm(matrix); HYPRE_BigInt global_num_rows = hypre_ParCSRBooleanMatrix_Get_GlobalNRows(matrix); @@ -494,28 +525,32 @@ HYPRE_Int hypre_ParCSRBooleanMatrixPrint( hypre_ParCSRBooleanMatrix *matrix, FILE *fp; HYPRE_Int num_cols_offd = 0; - if (hypre_ParCSRBooleanMatrix_Get_Offd(matrix)) num_cols_offd = - hypre_CSRBooleanMatrix_Get_NCols(hypre_ParCSRBooleanMatrix_Get_Offd(matrix)); + if (hypre_ParCSRBooleanMatrix_Get_Offd(matrix)) num_cols_offd = + hypre_CSRBooleanMatrix_Get_NCols(hypre_ParCSRBooleanMatrix_Get_Offd(matrix)); hypre_MPI_Comm_rank(comm, &my_id); hypre_MPI_Comm_size(comm, &num_procs); - - hypre_sprintf(new_file_d,"%s.D.%d",file_name,my_id); - hypre_sprintf(new_file_o,"%s.O.%d",file_name,my_id); - hypre_sprintf(new_file_info,"%s.INFO.%d",file_name,my_id); - hypre_CSRBooleanMatrixPrint(hypre_ParCSRBooleanMatrix_Get_Diag(matrix),new_file_d); + + hypre_sprintf(new_file_d, "%s.D.%d", file_name, my_id); + hypre_sprintf(new_file_o, "%s.O.%d", file_name, my_id); + hypre_sprintf(new_file_info, "%s.INFO.%d", file_name, my_id); + hypre_CSRBooleanMatrixPrint(hypre_ParCSRBooleanMatrix_Get_Diag(matrix), new_file_d); if (num_cols_offd != 0) hypre_CSRBooleanMatrixPrint(hypre_ParCSRBooleanMatrix_Get_Offd(matrix), - new_file_o); - + new_file_o); + fp = fopen(new_file_info, "w"); hypre_fprintf(fp, "%b\n", global_num_rows); hypre_fprintf(fp, "%b\n", global_num_cols); hypre_fprintf(fp, "%d\n", num_cols_offd); - for (i=0; i < num_procs; i++) + for (i = 0; i < num_procs; i++) + { hypre_fprintf(fp, "%b %b\n", row_starts[i], col_starts[i]); - for (i=0; i < num_cols_offd; i++) + } + for (i = 0; i < num_cols_offd; i++) + { hypre_fprintf(fp, "%b\n", col_map_offd[i]); + } fclose(fp); return ierr; @@ -525,8 +560,9 @@ HYPRE_Int hypre_ParCSRBooleanMatrixPrint( hypre_ParCSRBooleanMatrix *matrix, * hypre_ParCSRBooleanMatrixPrintIJ *--------------------------------------------------------------------------*/ -HYPRE_Int hypre_ParCSRBooleanMatrixPrintIJ( hypre_ParCSRBooleanMatrix *matrix, - const char *filename ) +HYPRE_Int +hypre_ParCSRBooleanMatrixPrintIJ( hypre_ParCSRBooleanMatrix *matrix, + const char *filename ) { MPI_Comm comm = hypre_ParCSRBooleanMatrix_Get_Comm(matrix); HYPRE_BigInt global_num_rows = hypre_ParCSRBooleanMatrix_Get_GlobalNRows(matrix); @@ -537,8 +573,8 @@ HYPRE_Int hypre_ParCSRBooleanMatrixPrintIJ( hypre_ParCSRBooleanMatrix *matrix, HYPRE_Int num_rows = hypre_ParCSRBooleanMatrix_Get_NRows(matrix); HYPRE_Int *diag_i; HYPRE_Int *diag_j; - HYPRE_Int *offd_i; - HYPRE_Int *offd_j; + HYPRE_Int *offd_i = NULL; + HYPRE_Int *offd_j = NULL; HYPRE_Int myid, i, j; HYPRE_BigInt I, J; HYPRE_Int ierr = 0; @@ -548,12 +584,12 @@ HYPRE_Int hypre_ParCSRBooleanMatrixPrintIJ( hypre_ParCSRBooleanMatrix *matrix, hypre_CSRBooleanMatrix *offd = hypre_ParCSRBooleanMatrix_Get_Offd(matrix); HYPRE_Int num_cols_offd = 0; - if (offd) num_cols_offd = - hypre_CSRBooleanMatrix_Get_NCols(hypre_ParCSRBooleanMatrix_Get_Offd(matrix)); + if (offd) num_cols_offd = + hypre_CSRBooleanMatrix_Get_NCols(hypre_ParCSRBooleanMatrix_Get_Offd(matrix)); hypre_MPI_Comm_rank(comm, &myid); - - hypre_sprintf(new_filename,"%s.%05d", filename, myid); + + hypre_sprintf(new_filename, "%s.%05d", filename, myid); if ((file = fopen(new_filename, "w")) == NULL) { @@ -576,7 +612,7 @@ HYPRE_Int hypre_ParCSRBooleanMatrixPrintIJ( hypre_ParCSRBooleanMatrix *matrix, I = first_row_index + i; /* print diag columns */ - for (j = diag_i[i]; j < diag_i[i+1]; j++) + for (j = diag_i[i]; j < diag_i[i + 1]; j++) { J = first_col_diag + diag_j[j]; hypre_fprintf(file, "%b, %b\n", I, J ); @@ -585,7 +621,7 @@ HYPRE_Int hypre_ParCSRBooleanMatrixPrintIJ( hypre_ParCSRBooleanMatrix *matrix, /* print offd columns */ if (num_cols_offd) { - for (j = offd_i[i]; j < offd_i[i+1]; j++) + for (j = offd_i[i]; j < offd_i[i + 1]; j++) { J = col_map_offd[offd_j[j]]; hypre_fprintf(file, "%b, %b \n", I, J); @@ -605,20 +641,20 @@ HYPRE_Int hypre_ParCSRBooleanMatrixPrintIJ( hypre_ParCSRBooleanMatrix *matrix, *--------------------------------------------------------------------------*/ HYPRE_Int hypre_ParCSRBooleanMatrixGetLocalRange(hypre_ParCSRBooleanMatrix *matrix, - HYPRE_BigInt *row_start, HYPRE_BigInt *row_end, - HYPRE_BigInt *col_start, HYPRE_BigInt *col_end ) -{ - HYPRE_Int ierr=0; + HYPRE_BigInt *row_start, HYPRE_BigInt *row_end, + HYPRE_BigInt *col_start, HYPRE_BigInt *col_end ) +{ + HYPRE_Int ierr = 0; HYPRE_Int my_id; hypre_MPI_Comm_rank( hypre_ParCSRBooleanMatrix_Get_Comm(matrix), &my_id ); *row_start = hypre_ParCSRBooleanMatrix_Get_RowStarts(matrix)[ my_id ]; - *row_end = hypre_ParCSRBooleanMatrix_Get_RowStarts(matrix)[ my_id + 1 ]-1; + *row_end = hypre_ParCSRBooleanMatrix_Get_RowStarts(matrix)[ my_id + 1 ] - 1; *col_start = hypre_ParCSRBooleanMatrix_Get_ColStarts(matrix)[ my_id ]; - *col_end = hypre_ParCSRBooleanMatrix_Get_ColStarts(matrix)[ my_id + 1 ]-1; + *col_end = hypre_ParCSRBooleanMatrix_Get_ColStarts(matrix)[ my_id + 1 ] - 1; - return( ierr ); + return ( ierr ); } /*-------------------------------------------------------------------------- @@ -629,8 +665,8 @@ HYPRE_Int hypre_ParCSRBooleanMatrixGetLocalRange(hypre_ParCSRBooleanMatrix *matr * store the local data, storing them in the hypre_ParCSRBooleanMatrix structure. * Only a single row can be accessed via this function at any one time; the * corresponding RestoreRow function must be called, to avoid bleeding memory, - * and to be able to look at another row. All indices are returned in 0-based - * indexing, no matter what is used under the hood. + * and to be able to look at another row. All indices are returned in 0-based + * indexing, no matter what is used under the hood. * EXCEPTION: currently this only works if the local CSR matrices * use 0-based indexing. * This code, semantics, implementation, etc., are all based on PETSc's hypre_MPI_AIJ @@ -639,19 +675,19 @@ HYPRE_Int hypre_ParCSRBooleanMatrixGetLocalRange(hypre_ParCSRBooleanMatrix *matr *--------------------------------------------------------------------------*/ HYPRE_Int hypre_ParCSRBooleanMatrixGetRow(hypre_ParCSRBooleanMatrix *mat, - HYPRE_BigInt row, HYPRE_Int *size, HYPRE_BigInt **col_ind) -{ - HYPRE_Int i, m, ierr=0, max=1, tmp, my_id; + HYPRE_BigInt row, HYPRE_Int *size, HYPRE_BigInt **col_ind) +{ + HYPRE_Int i, m, ierr = 0, max = 1, tmp, my_id; HYPRE_BigInt row_start, row_end, cstart; - HYPRE_Int *cworkA, *cworkB; + HYPRE_Int *cworkA, *cworkB; HYPRE_Int nztot, nzA, nzB, lrow; HYPRE_BigInt *cmap, *idx_p; hypre_CSRBooleanMatrix *Aa, *Ba; Aa = (hypre_CSRBooleanMatrix *) hypre_ParCSRBooleanMatrix_Get_Diag(mat); Ba = (hypre_CSRBooleanMatrix *) hypre_ParCSRBooleanMatrix_Get_Offd(mat); - - if (hypre_ParCSRBooleanMatrix_Get_Getrowactive(mat)) return(-1); + + if (hypre_ParCSRBooleanMatrix_Get_Getrowactive(mat)) { return (-1); } hypre_MPI_Comm_rank( hypre_ParCSRBooleanMatrix_Get_Comm(mat), &my_id ); @@ -661,83 +697,90 @@ HYPRE_Int hypre_ParCSRBooleanMatrixGetRow(hypre_ParCSRBooleanMatrix *mat, row_start = hypre_ParCSRBooleanMatrix_Get_RowStarts(mat)[ my_id ]; lrow = (HYPRE_Int)(row - row_start); - if (row < row_start || row >= row_end) return(-1); + if (row < row_start || row >= row_end) { return (-1); } - if ( col_ind ) + if ( col_ind ) { - m = (HYPRE_Int)(row_end-row_start); - for ( i=0; i -1) + if (imark > -1) { - for ( i=0; i (HYPRE_Int)last_col_diag) - { - if (!marker[a_j[j]]) - { - marker[a_j[j]] = 1; - num_cols_offd++; - } - jo++; - } - else - { - jd++; - } - } - offd_i[num_rows] = jo; - diag_i[num_rows] = jd; - - hypre_ParCSRBooleanMatrix_Get_ColMapOffd(matrix) = - hypre_CTAlloc(HYPRE_BigInt, num_cols_offd, HYPRE_MEMORY_HOST); - col_map_offd = hypre_ParCSRBooleanMatrix_Get_ColMapOffd(matrix); - - counter = 0; - for (i=0; i < num_cols; i++) - if (marker[i]) - { - col_map_offd[counter] = (HYPRE_BigInt)i; - marker[i] = counter; - counter++; - } - - hypre_CSRBooleanMatrix_Get_NNZ(diag) = jd; - hypre_CSRBooleanMatrixInitialize(diag); - diag_j = hypre_CSRBooleanMatrix_Get_J(diag); - - hypre_CSRBooleanMatrix_Get_NNZ(offd) = jo; - hypre_CSRBooleanMatrix_Get_NCols(offd) = num_cols_offd; - hypre_CSRBooleanMatrixInitialize(offd); - offd_j = hypre_CSRBooleanMatrix_Get_J(offd); - - jo = 0; - jd = 0; - for (i=0; i < num_rows; i++) - { - for (j=a_i[i]-first_elmt; j < a_i[i+1]-first_elmt; j++) - if (a_j[j] < first_col_diag || a_j[j] > last_col_diag) - { - offd_j[jo++] = marker[a_j[j]]; - } - else - { - diag_j[jd++] = a_j[j]-(HYPRE_Int)first_col_diag; - } - } - hypre_TFree(marker, HYPRE_MEMORY_HOST); + hypre_CSRBooleanMatrixInitialize(diag); + diag_i = hypre_CSRBooleanMatrix_Get_I(diag); + + hypre_CSRBooleanMatrixInitialize(offd); + offd_i = hypre_CSRBooleanMatrix_Get_I(offd); + marker = hypre_CTAlloc(HYPRE_Int, num_cols, HYPRE_MEMORY_HOST); + + for (i = 0; i < num_cols; i++) + { + marker[i] = 0; + } + + jo = 0; + jd = 0; + for (i = 0; i < num_rows; i++) + { + offd_i[i] = jo; + diag_i[i] = jd; + + for (j = a_i[i] - first_elmt; j < a_i[i + 1] - first_elmt; j++) + if (a_j[j] < (HYPRE_Int)first_col_diag || a_j[j] > (HYPRE_Int)last_col_diag) + { + if (!marker[a_j[j]]) + { + marker[a_j[j]] = 1; + num_cols_offd++; + } + jo++; + } + else + { + jd++; + } + } + offd_i[num_rows] = jo; + diag_i[num_rows] = jd; + + hypre_ParCSRBooleanMatrix_Get_ColMapOffd(matrix) = + hypre_CTAlloc(HYPRE_BigInt, num_cols_offd, HYPRE_MEMORY_HOST); + col_map_offd = hypre_ParCSRBooleanMatrix_Get_ColMapOffd(matrix); + + counter = 0; + for (i = 0; i < num_cols; i++) + if (marker[i]) + { + col_map_offd[counter] = (HYPRE_BigInt)i; + marker[i] = counter; + counter++; + } + + hypre_CSRBooleanMatrix_Get_NNZ(diag) = jd; + hypre_CSRBooleanMatrixInitialize(diag); + diag_j = hypre_CSRBooleanMatrix_Get_J(diag); + + hypre_CSRBooleanMatrix_Get_NNZ(offd) = jo; + hypre_CSRBooleanMatrix_Get_NCols(offd) = num_cols_offd; + hypre_CSRBooleanMatrixInitialize(offd); + offd_j = hypre_CSRBooleanMatrix_Get_J(offd); + + jo = 0; + jd = 0; + for (i = 0; i < num_rows; i++) + { + for (j = a_i[i] - first_elmt; j < a_i[i + 1] - first_elmt; j++) + if (a_j[j] < first_col_diag || a_j[j] > last_col_diag) + { + offd_j[jo++] = marker[a_j[j]]; + } + else + { + diag_j[jd++] = a_j[j] - (HYPRE_Int)first_col_diag; + } + } + hypre_TFree(marker, HYPRE_MEMORY_HOST); } - else + else { - hypre_CSRBooleanMatrix_Get_NNZ(diag) = num_nonzeros; - hypre_CSRBooleanMatrixInitialize(diag); - diag_i = hypre_CSRBooleanMatrix_Get_I(diag); - diag_j = hypre_CSRBooleanMatrix_Get_J(diag); - - for (i=0; i < num_nonzeros; i++) - { - diag_j[i] = a_j[i]; - } - offd_i = hypre_CTAlloc(HYPRE_Int, num_rows+1, HYPRE_MEMORY_HOST); - - for (i=0; i < num_rows+1; i++) - { - diag_i[i] = a_i[i]; - offd_i[i] = 0; - } - - hypre_CSRBooleanMatrix_Get_NCols(offd) = 0; - hypre_CSRBooleanMatrix_Get_I(offd) = offd_i; + hypre_CSRBooleanMatrix_Get_NNZ(diag) = num_nonzeros; + hypre_CSRBooleanMatrixInitialize(diag); + diag_i = hypre_CSRBooleanMatrix_Get_I(diag); + diag_j = hypre_CSRBooleanMatrix_Get_J(diag); + + for (i = 0; i < num_nonzeros; i++) + { + diag_j[i] = a_j[i]; + } + offd_i = hypre_CTAlloc(HYPRE_Int, num_rows + 1, HYPRE_MEMORY_HOST); + + for (i = 0; i < num_rows + 1; i++) + { + diag_i[i] = a_i[i]; + offd_i[i] = 0; + } + + hypre_CSRBooleanMatrix_Get_NCols(offd) = 0; + hypre_CSRBooleanMatrix_Get_I(offd) = offd_i; } - + return ierr; } - - diff --git a/external/hypre/src/parcsr_mv/par_csr_communication.c b/external/hypre/src/parcsr_mv/par_csr_communication.c index 8b1f773e..d28ea322 100644 --- a/external/hypre/src/parcsr_mv/par_csr_communication.c +++ b/external/hypre/src/parcsr_mv/par_csr_communication.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -38,17 +38,21 @@ static CommPkgJobType getJobTypeOf(HYPRE_Int job) return job_type; } -/** - * When send_data and recv_data are NULL, buffers are internally allocated - * and CommHandle owns the buffer - */ +/*------------------------------------------------------------------ + * hypre_ParCSRPersistentCommHandleCreate + * + * When send_data and recv_data are NULL, buffers are internally + * allocated and CommHandle owns the buffer + *------------------------------------------------------------------*/ + hypre_ParCSRPersistentCommHandle* hypre_ParCSRPersistentCommHandleCreate( HYPRE_Int job, hypre_ParCSRCommPkg *comm_pkg ) { HYPRE_Int i; size_t num_bytes_send, num_bytes_recv; - hypre_ParCSRPersistentCommHandle *comm_handle = hypre_CTAlloc(hypre_ParCSRPersistentCommHandle, 1, HYPRE_MEMORY_HOST); + hypre_ParCSRPersistentCommHandle *comm_handle = hypre_CTAlloc(hypre_ParCSRPersistentCommHandle, 1, + HYPRE_MEMORY_HOST); CommPkgJobType job_type = getJobTypeOf(job); @@ -69,15 +73,17 @@ hypre_ParCSRPersistentCommHandleCreate( HYPRE_Int job, hypre_ParCSRCommPkg *comm case HYPRE_COMM_PKG_JOB_COMPLEX: num_bytes_send = sizeof(HYPRE_Complex) * hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends); num_bytes_recv = sizeof(HYPRE_Complex) * hypre_ParCSRCommPkgRecvVecStart(comm_pkg, num_recvs); - send_buff = hypre_TAlloc(HYPRE_Complex, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), HYPRE_MEMORY_HOST); - recv_buff = hypre_TAlloc(HYPRE_Complex, hypre_ParCSRCommPkgRecvVecStart(comm_pkg, num_recvs), HYPRE_MEMORY_HOST); + send_buff = hypre_TAlloc(HYPRE_Complex, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); + recv_buff = hypre_TAlloc(HYPRE_Complex, hypre_ParCSRCommPkgRecvVecStart(comm_pkg, num_recvs), + HYPRE_MEMORY_HOST); for (i = 0; i < num_recvs; ++i) { HYPRE_Int ip = hypre_ParCSRCommPkgRecvProc(comm_pkg, i); HYPRE_Int vec_start = hypre_ParCSRCommPkgRecvVecStart(comm_pkg, i); HYPRE_Int vec_len = hypre_ParCSRCommPkgRecvVecStart(comm_pkg, i + 1) - vec_start; hypre_MPI_Recv_init( (HYPRE_Complex *)recv_buff + vec_start, vec_len, HYPRE_MPI_COMPLEX, - ip, 0, comm, requests + i ); + ip, 0, comm, requests + i ); } for (i = 0; i < num_sends; ++i) { @@ -92,8 +98,10 @@ hypre_ParCSRPersistentCommHandleCreate( HYPRE_Int job, hypre_ParCSRCommPkg *comm case HYPRE_COMM_PKG_JOB_COMPLEX_TRANSPOSE: num_bytes_recv = sizeof(HYPRE_Complex) * hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends); num_bytes_send = sizeof(HYPRE_Complex) * hypre_ParCSRCommPkgRecvVecStart(comm_pkg, num_recvs); - recv_buff = hypre_TAlloc(HYPRE_Complex, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), HYPRE_MEMORY_HOST); - send_buff = hypre_TAlloc(HYPRE_Complex, hypre_ParCSRCommPkgRecvVecStart(comm_pkg, num_recvs), HYPRE_MEMORY_HOST); + recv_buff = hypre_TAlloc(HYPRE_Complex, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); + send_buff = hypre_TAlloc(HYPRE_Complex, hypre_ParCSRCommPkgRecvVecStart(comm_pkg, num_recvs), + HYPRE_MEMORY_HOST); for (i = 0; i < num_sends; ++i) { HYPRE_Int ip = hypre_ParCSRCommPkgSendProc(comm_pkg, i); @@ -115,8 +123,10 @@ hypre_ParCSRPersistentCommHandleCreate( HYPRE_Int job, hypre_ParCSRCommPkg *comm case HYPRE_COMM_PKG_JOB_INT: num_bytes_send = sizeof(HYPRE_Int) * hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends); num_bytes_recv = sizeof(HYPRE_Int) * hypre_ParCSRCommPkgRecvVecStart(comm_pkg, num_recvs); - send_buff = hypre_TAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), HYPRE_MEMORY_HOST); - recv_buff = hypre_TAlloc(HYPRE_Int, hypre_ParCSRCommPkgRecvVecStart(comm_pkg, num_recvs), HYPRE_MEMORY_HOST); + send_buff = hypre_TAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); + recv_buff = hypre_TAlloc(HYPRE_Int, hypre_ParCSRCommPkgRecvVecStart(comm_pkg, num_recvs), + HYPRE_MEMORY_HOST); for (i = 0; i < num_recvs; ++i) { HYPRE_Int ip = hypre_ParCSRCommPkgRecvProc(comm_pkg, i); @@ -138,8 +148,10 @@ hypre_ParCSRPersistentCommHandleCreate( HYPRE_Int job, hypre_ParCSRCommPkg *comm case HYPRE_COMM_PKG_JOB_INT_TRANSPOSE: num_bytes_recv = sizeof(HYPRE_Int) * hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends); num_bytes_send = sizeof(HYPRE_Int) * hypre_ParCSRCommPkgRecvVecStart(comm_pkg, num_recvs); - recv_buff = hypre_TAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), HYPRE_MEMORY_HOST); - send_buff = hypre_TAlloc(HYPRE_Int, hypre_ParCSRCommPkgRecvVecStart(comm_pkg, num_recvs), HYPRE_MEMORY_HOST); + recv_buff = hypre_TAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); + send_buff = hypre_TAlloc(HYPRE_Int, hypre_ParCSRCommPkgRecvVecStart(comm_pkg, num_recvs), + HYPRE_MEMORY_HOST); for (i = 0; i < num_sends; ++i) { HYPRE_Int ip = hypre_ParCSRCommPkgSendProc(comm_pkg, i); @@ -161,14 +173,17 @@ hypre_ParCSRPersistentCommHandleCreate( HYPRE_Int job, hypre_ParCSRCommPkg *comm case HYPRE_COMM_PKG_JOB_BIGINT: num_bytes_send = sizeof(HYPRE_BigInt) * hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends); num_bytes_recv = sizeof(HYPRE_BigInt) * hypre_ParCSRCommPkgRecvVecStart(comm_pkg, num_recvs); - send_buff = hypre_TAlloc(HYPRE_BigInt, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), HYPRE_MEMORY_HOST); - recv_buff = hypre_TAlloc(HYPRE_BigInt, hypre_ParCSRCommPkgRecvVecStart(comm_pkg, num_recvs), HYPRE_MEMORY_HOST); + send_buff = hypre_TAlloc(HYPRE_BigInt, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); + recv_buff = hypre_TAlloc(HYPRE_BigInt, hypre_ParCSRCommPkgRecvVecStart(comm_pkg, num_recvs), + HYPRE_MEMORY_HOST); for (i = 0; i < num_recvs; ++i) { HYPRE_Int ip = hypre_ParCSRCommPkgRecvProc(comm_pkg, i); HYPRE_Int vec_start = hypre_ParCSRCommPkgRecvVecStart(comm_pkg, i); HYPRE_Int vec_len = hypre_ParCSRCommPkgRecvVecStart(comm_pkg, i + 1) - vec_start; - hypre_MPI_Recv_init( (HYPRE_BigInt *)recv_buff + (HYPRE_BigInt)vec_start, vec_len, HYPRE_MPI_BIG_INT, + hypre_MPI_Recv_init( (HYPRE_BigInt *)recv_buff + (HYPRE_BigInt)vec_start, vec_len, + HYPRE_MPI_BIG_INT, ip, 0, comm, requests + i ); } for (i = 0; i < num_sends; ++i) @@ -176,7 +191,8 @@ hypre_ParCSRPersistentCommHandleCreate( HYPRE_Int job, hypre_ParCSRCommPkg *comm HYPRE_Int ip = hypre_ParCSRCommPkgSendProc(comm_pkg, i); HYPRE_Int vec_start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); HYPRE_Int vec_len = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1) - vec_start; - hypre_MPI_Send_init( (HYPRE_BigInt *)send_buff + (HYPRE_BigInt)vec_start, vec_len, HYPRE_MPI_BIG_INT, + hypre_MPI_Send_init( (HYPRE_BigInt *)send_buff + (HYPRE_BigInt)vec_start, vec_len, + HYPRE_MPI_BIG_INT, ip, 0, comm, requests + num_recvs + i); } break; @@ -184,14 +200,17 @@ hypre_ParCSRPersistentCommHandleCreate( HYPRE_Int job, hypre_ParCSRCommPkg *comm case HYPRE_COMM_PKG_JOB_BIGINT_TRANSPOSE: num_bytes_recv = sizeof(HYPRE_BigInt) * hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends); num_bytes_send = sizeof(HYPRE_BigInt) * hypre_ParCSRCommPkgRecvVecStart(comm_pkg, num_recvs); - recv_buff = hypre_TAlloc(HYPRE_BigInt, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), HYPRE_MEMORY_HOST); - send_buff = hypre_TAlloc(HYPRE_BigInt, hypre_ParCSRCommPkgRecvVecStart(comm_pkg, num_recvs), HYPRE_MEMORY_HOST); + recv_buff = hypre_TAlloc(HYPRE_BigInt, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); + send_buff = hypre_TAlloc(HYPRE_BigInt, hypre_ParCSRCommPkgRecvVecStart(comm_pkg, num_recvs), + HYPRE_MEMORY_HOST); for (i = 0; i < num_sends; ++i) { HYPRE_Int ip = hypre_ParCSRCommPkgSendProc(comm_pkg, i); HYPRE_Int vec_start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); HYPRE_Int vec_len = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1) - vec_start; - hypre_MPI_Recv_init( (HYPRE_BigInt *)recv_buff + (HYPRE_BigInt)vec_start, vec_len, HYPRE_MPI_BIG_INT, + hypre_MPI_Recv_init( (HYPRE_BigInt *)recv_buff + (HYPRE_BigInt)vec_start, vec_len, + HYPRE_MPI_BIG_INT, ip, 0, comm, requests + i ); } for (i = 0; i < num_recvs; ++i) @@ -200,7 +219,8 @@ hypre_ParCSRPersistentCommHandleCreate( HYPRE_Int job, hypre_ParCSRCommPkg *comm HYPRE_Int vec_start = hypre_ParCSRCommPkgRecvVecStart(comm_pkg, i); HYPRE_Int vec_len = hypre_ParCSRCommPkgRecvVecStart(comm_pkg, i + 1) - vec_start; - hypre_MPI_Send_init( (HYPRE_BigInt *)send_buff + (HYPRE_BigInt)vec_start, vec_len, HYPRE_MPI_BIG_INT, + hypre_MPI_Send_init( (HYPRE_BigInt *)send_buff + (HYPRE_BigInt)vec_start, vec_len, + HYPRE_MPI_BIG_INT, ip, 0, comm, requests + num_sends + i); } break; @@ -217,6 +237,9 @@ hypre_ParCSRPersistentCommHandleCreate( HYPRE_Int job, hypre_ParCSRCommPkg *comm return ( comm_handle ); } +/*------------------------------------------------------------------ + * hypre_ParCSRCommPkgGetPersistentCommHandle + *------------------------------------------------------------------*/ hypre_ParCSRPersistentCommHandle* hypre_ParCSRCommPkgGetPersistentCommHandle( HYPRE_Int job, hypre_ParCSRCommPkg *comm_pkg ) @@ -225,24 +248,38 @@ hypre_ParCSRCommPkgGetPersistentCommHandle( HYPRE_Int job, hypre_ParCSRCommPkg * if (!comm_pkg->persistent_comm_handles[type]) { /* data is owned by persistent comm handle */ - comm_pkg->persistent_comm_handles[type] = hypre_ParCSRPersistentCommHandleCreate(job, comm_pkg); + comm_pkg->persistent_comm_handles[type] = + hypre_ParCSRPersistentCommHandleCreate(job, comm_pkg); } return comm_pkg->persistent_comm_handles[type]; } +/*------------------------------------------------------------------ + * hypre_ParCSRPersistentCommHandleDestroy + *------------------------------------------------------------------*/ + void hypre_ParCSRPersistentCommHandleDestroy( hypre_ParCSRPersistentCommHandle *comm_handle ) { - hypre_TFree(hypre_ParCSRCommHandleSendDataBuffer(comm_handle), HYPRE_MEMORY_HOST); - hypre_TFree(hypre_ParCSRCommHandleRecvDataBuffer(comm_handle), HYPRE_MEMORY_HOST); - hypre_TFree(comm_handle->requests, HYPRE_MEMORY_HOST); - hypre_TFree(comm_handle, HYPRE_MEMORY_HOST); + if (comm_handle) + { + hypre_TFree(hypre_ParCSRCommHandleSendDataBuffer(comm_handle), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_ParCSRCommHandleRecvDataBuffer(comm_handle), HYPRE_MEMORY_HOST); + hypre_TFree(comm_handle->requests, HYPRE_MEMORY_HOST); + + hypre_TFree(comm_handle, HYPRE_MEMORY_HOST); + } } -void hypre_ParCSRPersistentCommHandleStart( hypre_ParCSRPersistentCommHandle *comm_handle, - HYPRE_MemoryLocation send_memory_location, - void *send_data ) +/*------------------------------------------------------------------ + * hypre_ParCSRPersistentCommHandleStart + *------------------------------------------------------------------*/ + +void +hypre_ParCSRPersistentCommHandleStart( hypre_ParCSRPersistentCommHandle *comm_handle, + HYPRE_MemoryLocation send_memory_location, + void *send_data ) { hypre_ParCSRCommHandleSendData(comm_handle) = send_data; hypre_ParCSRCommHandleSendMemoryLocation(comm_handle) = send_memory_location; @@ -260,15 +297,20 @@ void hypre_ParCSRPersistentCommHandleStart( hypre_ParCSRPersistentCommHandle *co hypre_ParCSRCommHandleRequests(comm_handle)); if (hypre_MPI_SUCCESS != ret) { - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"MPI error\n"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "MPI error\n"); /*hypre_printf("MPI error %d in %s (%s, line %u)\n", ret, __FUNCTION__, __FILE__, __LINE__);*/ } } } -void hypre_ParCSRPersistentCommHandleWait( hypre_ParCSRPersistentCommHandle *comm_handle, - HYPRE_MemoryLocation recv_memory_location, - void *recv_data ) +/*------------------------------------------------------------------ + * hypre_ParCSRPersistentCommHandleWait + *------------------------------------------------------------------*/ + +void +hypre_ParCSRPersistentCommHandleWait( hypre_ParCSRPersistentCommHandle *comm_handle, + HYPRE_MemoryLocation recv_memory_location, + void *recv_data ) { hypre_ParCSRCommHandleRecvData(comm_handle) = recv_data; hypre_ParCSRCommHandleRecvMemoryLocation(comm_handle) = recv_memory_location; @@ -280,7 +322,7 @@ void hypre_ParCSRPersistentCommHandleWait( hypre_ParCSRPersistentCommHandle *com hypre_MPI_STATUSES_IGNORE); if (hypre_MPI_SUCCESS != ret) { - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"MPI error\n"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "MPI error\n"); /*hypre_printf("MPI error %d in %s (%s, line %u)\n", ret, __FUNCTION__, __FILE__, __LINE__);*/ } @@ -294,6 +336,10 @@ void hypre_ParCSRPersistentCommHandleWait( hypre_ParCSRPersistentCommHandle *com } #endif // HYPRE_USING_PERSISTENT_COMM +/*------------------------------------------------------------------ + * hypre_ParCSRCommHandleCreate + *------------------------------------------------------------------*/ + hypre_ParCSRCommHandle* hypre_ParCSRCommHandleCreate ( HYPRE_Int job, hypre_ParCSRCommPkg *comm_pkg, @@ -304,6 +350,10 @@ hypre_ParCSRCommHandleCreate ( HYPRE_Int job, HYPRE_MEMORY_HOST, recv_data); } +/*------------------------------------------------------------------ + * hypre_ParCSRCommHandleCreate_v2 + *------------------------------------------------------------------*/ + hypre_ParCSRCommHandle* hypre_ParCSRCommHandleCreate_v2 ( HYPRE_Int job, hypre_ParCSRCommPkg *comm_pkg, @@ -312,6 +362,8 @@ hypre_ParCSRCommHandleCreate_v2 ( HYPRE_Int job, HYPRE_MemoryLocation recv_memory_location, void *recv_data_in ) { + hypre_GpuProfilingPushRange("hypre_ParCSRCommHandleCreate_v2"); + HYPRE_Int num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); HYPRE_Int num_recvs = hypre_ParCSRCommPkgNumRecvs(comm_pkg); MPI_Comm comm = hypre_ParCSRCommPkgComm(comm_pkg); @@ -356,66 +408,72 @@ hypre_ParCSRCommHandleCreate_v2 ( HYPRE_Int job, * datatypes need to point to absolute * addresses, e.g. generated using hypre_MPI_Address . *--------------------------------------------------------------------*/ -#ifndef HYPRE_WITH_GPU_AWARE_MPI - switch (job) + + if (!hypre_GetGpuAwareMPI()) { - case 1: - num_send_bytes = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends) * sizeof(HYPRE_Complex); - num_recv_bytes = hypre_ParCSRCommPkgRecvVecStart(comm_pkg, num_recvs) * sizeof(HYPRE_Complex); - break; - case 2: - num_send_bytes = hypre_ParCSRCommPkgRecvVecStart(comm_pkg, num_recvs) * sizeof(HYPRE_Complex); - num_recv_bytes = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends) * sizeof(HYPRE_Complex); - break; - case 11: - num_send_bytes = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends) * sizeof(HYPRE_Int); - num_recv_bytes = hypre_ParCSRCommPkgRecvVecStart(comm_pkg, num_recvs) * sizeof(HYPRE_Int); - break; - case 12: - num_send_bytes = hypre_ParCSRCommPkgRecvVecStart(comm_pkg, num_recvs) * sizeof(HYPRE_Int); - num_recv_bytes = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends) * sizeof(HYPRE_Int); - break; - case 21: - num_send_bytes = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends) * sizeof(HYPRE_BigInt); - num_recv_bytes = hypre_ParCSRCommPkgRecvVecStart(comm_pkg, num_recvs) * sizeof(HYPRE_BigInt); - break; - case 22: - num_send_bytes = hypre_ParCSRCommPkgRecvVecStart(comm_pkg, num_recvs) * sizeof(HYPRE_BigInt); - num_recv_bytes = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends) * sizeof(HYPRE_BigInt); - break; - } + switch (job) + { + case 1: + num_send_bytes = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends) * sizeof(HYPRE_Complex); + num_recv_bytes = hypre_ParCSRCommPkgRecvVecStart(comm_pkg, num_recvs) * sizeof(HYPRE_Complex); + break; + case 2: + num_send_bytes = hypre_ParCSRCommPkgRecvVecStart(comm_pkg, num_recvs) * sizeof(HYPRE_Complex); + num_recv_bytes = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends) * sizeof(HYPRE_Complex); + break; + case 11: + num_send_bytes = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends) * sizeof(HYPRE_Int); + num_recv_bytes = hypre_ParCSRCommPkgRecvVecStart(comm_pkg, num_recvs) * sizeof(HYPRE_Int); + break; + case 12: + num_send_bytes = hypre_ParCSRCommPkgRecvVecStart(comm_pkg, num_recvs) * sizeof(HYPRE_Int); + num_recv_bytes = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends) * sizeof(HYPRE_Int); + break; + case 21: + num_send_bytes = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends) * sizeof(HYPRE_BigInt); + num_recv_bytes = hypre_ParCSRCommPkgRecvVecStart(comm_pkg, num_recvs) * sizeof(HYPRE_BigInt); + break; + case 22: + num_send_bytes = hypre_ParCSRCommPkgRecvVecStart(comm_pkg, num_recvs) * sizeof(HYPRE_BigInt); + num_recv_bytes = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends) * sizeof(HYPRE_BigInt); + break; + } - hypre_MemoryLocation act_send_memory_location = hypre_GetActualMemLocation(send_memory_location); + hypre_MemoryLocation act_send_memory_location = hypre_GetActualMemLocation(send_memory_location); - if ( act_send_memory_location == hypre_MEMORY_DEVICE || act_send_memory_location == hypre_MEMORY_UNIFIED ) - { - //send_data = _hypre_TAlloc(char, num_send_bytes, hypre_MEMORY_HOST_PINNED); - send_data = hypre_TAlloc(char, num_send_bytes, HYPRE_MEMORY_HOST); - hypre_TMemcpy(send_data, send_data_in, char, num_send_bytes, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); - } - else - { - send_data = send_data_in; - } + if ( act_send_memory_location == hypre_MEMORY_DEVICE || + act_send_memory_location == hypre_MEMORY_UNIFIED ) + { + //send_data = _hypre_TAlloc(char, num_send_bytes, hypre_MEMORY_HOST_PINNED); + send_data = hypre_TAlloc(char, num_send_bytes, HYPRE_MEMORY_HOST); + hypre_GpuProfilingPushRange("MPI-D2H"); + hypre_TMemcpy(send_data, send_data_in, char, num_send_bytes, HYPRE_MEMORY_HOST, + HYPRE_MEMORY_DEVICE); + hypre_GpuProfilingPopRange(); + } + else + { + send_data = send_data_in; + } - hypre_MemoryLocation act_recv_memory_location = hypre_GetActualMemLocation(recv_memory_location); + hypre_MemoryLocation act_recv_memory_location = hypre_GetActualMemLocation(recv_memory_location); - if ( act_recv_memory_location == hypre_MEMORY_DEVICE || act_recv_memory_location == hypre_MEMORY_UNIFIED ) - { - //recv_data = hypre_TAlloc(char, num_recv_bytes, hypre_MEMORY_HOST_PINNED); - recv_data = hypre_TAlloc(char, num_recv_bytes, HYPRE_MEMORY_HOST); + if ( act_recv_memory_location == hypre_MEMORY_DEVICE || + act_recv_memory_location == hypre_MEMORY_UNIFIED ) + { + //recv_data = hypre_TAlloc(char, num_recv_bytes, hypre_MEMORY_HOST_PINNED); + recv_data = hypre_TAlloc(char, num_recv_bytes, HYPRE_MEMORY_HOST); + } + else + { + recv_data = recv_data_in; + } } else { + send_data = send_data_in; recv_data = recv_data_in; } -#else /* #ifndef HYPRE_WITH_GPU_AWARE_MPI */ - send_data = send_data_in; - recv_data = recv_data_in; - // TODO RL: it seems that we need to sync the CUDA stream before doing GPU-GPU MPI. - // Need to check MPI documentation whether this is acutally true - hypre_SyncCudaComputeStream(hypre_handle()); -#endif num_requests = num_sends + num_recvs; requests = hypre_CTAlloc(hypre_MPI_Request, num_requests, HYPRE_MEMORY_HOST); @@ -433,8 +491,8 @@ hypre_ParCSRCommHandleCreate_v2 ( HYPRE_Int job, for (i = 0; i < num_recvs; i++) { ip = hypre_ParCSRCommPkgRecvProc(comm_pkg, i); - vec_start = hypre_ParCSRCommPkgRecvVecStart(comm_pkg,i); - vec_len = hypre_ParCSRCommPkgRecvVecStart(comm_pkg,i+1)-vec_start; + vec_start = hypre_ParCSRCommPkgRecvVecStart(comm_pkg, i); + vec_len = hypre_ParCSRCommPkgRecvVecStart(comm_pkg, i + 1) - vec_start; hypre_MPI_Irecv(&d_recv_data[vec_start], vec_len, HYPRE_MPI_COMPLEX, ip, 0, comm, &requests[j++]); } @@ -442,7 +500,7 @@ hypre_ParCSRCommHandleCreate_v2 ( HYPRE_Int job, { ip = hypre_ParCSRCommPkgSendProc(comm_pkg, i); vec_start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - vec_len = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1)-vec_start; + vec_len = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1) - vec_start; hypre_MPI_Isend(&d_send_data[vec_start], vec_len, HYPRE_MPI_COMPLEX, ip, 0, comm, &requests[j++]); } @@ -456,15 +514,15 @@ hypre_ParCSRCommHandleCreate_v2 ( HYPRE_Int job, { ip = hypre_ParCSRCommPkgSendProc(comm_pkg, i); vec_start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - vec_len = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1) - vec_start; + vec_len = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1) - vec_start; hypre_MPI_Irecv(&d_recv_data[vec_start], vec_len, HYPRE_MPI_COMPLEX, ip, 0, comm, &requests[j++]); } for (i = 0; i < num_recvs; i++) { ip = hypre_ParCSRCommPkgRecvProc(comm_pkg, i); - vec_start = hypre_ParCSRCommPkgRecvVecStart(comm_pkg,i); - vec_len = hypre_ParCSRCommPkgRecvVecStart(comm_pkg,i+1)-vec_start; + vec_start = hypre_ParCSRCommPkgRecvVecStart(comm_pkg, i); + vec_len = hypre_ParCSRCommPkgRecvVecStart(comm_pkg, i + 1) - vec_start; hypre_MPI_Isend(&d_send_data[vec_start], vec_len, HYPRE_MPI_COMPLEX, ip, 0, comm, &requests[j++]); } @@ -477,8 +535,8 @@ hypre_ParCSRCommHandleCreate_v2 ( HYPRE_Int job, for (i = 0; i < num_recvs; i++) { ip = hypre_ParCSRCommPkgRecvProc(comm_pkg, i); - vec_start = hypre_ParCSRCommPkgRecvVecStart(comm_pkg,i); - vec_len = hypre_ParCSRCommPkgRecvVecStart(comm_pkg,i+1)-vec_start; + vec_start = hypre_ParCSRCommPkgRecvVecStart(comm_pkg, i); + vec_len = hypre_ParCSRCommPkgRecvVecStart(comm_pkg, i + 1) - vec_start; hypre_MPI_Irecv(&i_recv_data[vec_start], vec_len, HYPRE_MPI_INT, ip, 0, comm, &requests[j++]); } @@ -486,7 +544,7 @@ hypre_ParCSRCommHandleCreate_v2 ( HYPRE_Int job, { ip = hypre_ParCSRCommPkgSendProc(comm_pkg, i); vec_start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - vec_len = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1)-vec_start; + vec_len = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1) - vec_start; hypre_MPI_Isend(&i_send_data[vec_start], vec_len, HYPRE_MPI_INT, ip, 0, comm, &requests[j++]); } @@ -500,15 +558,15 @@ hypre_ParCSRCommHandleCreate_v2 ( HYPRE_Int job, { ip = hypre_ParCSRCommPkgSendProc(comm_pkg, i); vec_start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - vec_len = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1) - vec_start; + vec_len = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1) - vec_start; hypre_MPI_Irecv(&i_recv_data[vec_start], vec_len, HYPRE_MPI_INT, ip, 0, comm, &requests[j++]); } for (i = 0; i < num_recvs; i++) { ip = hypre_ParCSRCommPkgRecvProc(comm_pkg, i); - vec_start = hypre_ParCSRCommPkgRecvVecStart(comm_pkg,i); - vec_len = hypre_ParCSRCommPkgRecvVecStart(comm_pkg,i+1)-vec_start; + vec_start = hypre_ParCSRCommPkgRecvVecStart(comm_pkg, i); + vec_len = hypre_ParCSRCommPkgRecvVecStart(comm_pkg, i + 1) - vec_start; hypre_MPI_Isend(&i_send_data[vec_start], vec_len, HYPRE_MPI_INT, ip, 0, comm, &requests[j++]); } @@ -521,15 +579,15 @@ hypre_ParCSRCommHandleCreate_v2 ( HYPRE_Int job, for (i = 0; i < num_recvs; i++) { ip = hypre_ParCSRCommPkgRecvProc(comm_pkg, i); - vec_start = hypre_ParCSRCommPkgRecvVecStart(comm_pkg,i); - vec_len = hypre_ParCSRCommPkgRecvVecStart(comm_pkg,i+1)-vec_start; + vec_start = hypre_ParCSRCommPkgRecvVecStart(comm_pkg, i); + vec_len = hypre_ParCSRCommPkgRecvVecStart(comm_pkg, i + 1) - vec_start; hypre_MPI_Irecv(&i_recv_data[vec_start], vec_len, HYPRE_MPI_BIG_INT, ip, 0, comm, &requests[j++]); } for (i = 0; i < num_sends; i++) { vec_start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - vec_len = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1)-vec_start; + vec_len = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1) - vec_start; ip = hypre_ParCSRCommPkgSendProc(comm_pkg, i); hypre_MPI_Isend(&i_send_data[vec_start], vec_len, HYPRE_MPI_BIG_INT, ip, 0, comm, &requests[j++]); @@ -543,7 +601,7 @@ hypre_ParCSRCommHandleCreate_v2 ( HYPRE_Int job, for (i = 0; i < num_sends; i++) { vec_start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - vec_len = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1) - vec_start; + vec_len = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1) - vec_start; ip = hypre_ParCSRCommPkgSendProc(comm_pkg, i); hypre_MPI_Irecv(&i_recv_data[vec_start], vec_len, HYPRE_MPI_BIG_INT, ip, 0, comm, &requests[j++]); @@ -551,8 +609,8 @@ hypre_ParCSRCommHandleCreate_v2 ( HYPRE_Int job, for (i = 0; i < num_recvs; i++) { ip = hypre_ParCSRCommPkgRecvProc(comm_pkg, i); - vec_start = hypre_ParCSRCommPkgRecvVecStart(comm_pkg,i); - vec_len = hypre_ParCSRCommPkgRecvVecStart(comm_pkg,i+1)-vec_start; + vec_start = hypre_ParCSRCommPkgRecvVecStart(comm_pkg, i); + vec_len = hypre_ParCSRCommPkgRecvVecStart(comm_pkg, i + 1) - vec_start; hypre_MPI_Isend(&i_send_data[vec_start], vec_len, HYPRE_MPI_BIG_INT, ip, 0, comm, &requests[j++]); } @@ -577,9 +635,15 @@ hypre_ParCSRCommHandleCreate_v2 ( HYPRE_Int job, hypre_ParCSRCommHandleNumRequests(comm_handle) = num_requests; hypre_ParCSRCommHandleRequests(comm_handle) = requests; + hypre_GpuProfilingPopRange(); + return ( comm_handle ); } +/*------------------------------------------------------------------ + * hypre_ParCSRCommHandleDestroy + *------------------------------------------------------------------*/ + HYPRE_Int hypre_ParCSRCommHandleDestroy( hypre_ParCSRCommHandle *comm_handle ) { @@ -588,51 +652,69 @@ hypre_ParCSRCommHandleDestroy( hypre_ParCSRCommHandle *comm_handle ) return hypre_error_flag; } + hypre_GpuProfilingPushRange("hypre_ParCSRCommHandleDestroy"); + if (hypre_ParCSRCommHandleNumRequests(comm_handle)) { hypre_MPI_Status *status0; status0 = hypre_CTAlloc(hypre_MPI_Status, hypre_ParCSRCommHandleNumRequests(comm_handle), HYPRE_MEMORY_HOST); + hypre_GpuProfilingPushRange("hypre_MPI_Waitall"); hypre_MPI_Waitall(hypre_ParCSRCommHandleNumRequests(comm_handle), hypre_ParCSRCommHandleRequests(comm_handle), status0); + hypre_GpuProfilingPopRange(); hypre_TFree(status0, HYPRE_MEMORY_HOST); } -#ifndef HYPRE_WITH_GPU_AWARE_MPI - hypre_MemoryLocation act_send_memory_location = hypre_GetActualMemLocation(hypre_ParCSRCommHandleSendMemoryLocation(comm_handle)); - if ( act_send_memory_location == hypre_MEMORY_DEVICE || act_send_memory_location == hypre_MEMORY_UNIFIED ) + if (!hypre_GetGpuAwareMPI()) { - //hypre_HostPinnedFree(hypre_ParCSRCommHandleSendDataBuffer(comm_handle)); - hypre_TFree(hypre_ParCSRCommHandleSendDataBuffer(comm_handle), HYPRE_MEMORY_HOST); - } + hypre_MemoryLocation act_send_memory_location = + hypre_GetActualMemLocation(hypre_ParCSRCommHandleSendMemoryLocation(comm_handle)); - hypre_MemoryLocation act_recv_memory_location = hypre_GetActualMemLocation(hypre_ParCSRCommHandleRecvMemoryLocation(comm_handle)); - if ( act_recv_memory_location == hypre_MEMORY_DEVICE || act_recv_memory_location == hypre_MEMORY_UNIFIED ) - { - hypre_TMemcpy( hypre_ParCSRCommHandleRecvData(comm_handle), - hypre_ParCSRCommHandleRecvDataBuffer(comm_handle), - char, - hypre_ParCSRCommHandleNumRecvBytes(comm_handle), - HYPRE_MEMORY_DEVICE, - HYPRE_MEMORY_HOST ); + if ( act_send_memory_location == hypre_MEMORY_DEVICE || + act_send_memory_location == hypre_MEMORY_UNIFIED ) + { + //hypre_HostPinnedFree(hypre_ParCSRCommHandleSendDataBuffer(comm_handle)); + hypre_TFree(hypre_ParCSRCommHandleSendDataBuffer(comm_handle), HYPRE_MEMORY_HOST); + } - //hypre_HostPinnedFree(hypre_ParCSRCommHandleRecvDataBuffer(comm_handle)); - hypre_TFree(hypre_ParCSRCommHandleRecvDataBuffer(comm_handle), HYPRE_MEMORY_HOST); + hypre_MemoryLocation act_recv_memory_location = + hypre_GetActualMemLocation(hypre_ParCSRCommHandleRecvMemoryLocation(comm_handle)); + + if ( act_recv_memory_location == hypre_MEMORY_DEVICE || + act_recv_memory_location == hypre_MEMORY_UNIFIED ) + { + hypre_GpuProfilingPushRange("MPI-H2D"); + hypre_TMemcpy( hypre_ParCSRCommHandleRecvData(comm_handle), + hypre_ParCSRCommHandleRecvDataBuffer(comm_handle), + char, + hypre_ParCSRCommHandleNumRecvBytes(comm_handle), + HYPRE_MEMORY_DEVICE, + HYPRE_MEMORY_HOST ); + hypre_GpuProfilingPopRange(); + //hypre_HostPinnedFree(hypre_ParCSRCommHandleRecvDataBuffer(comm_handle)); + hypre_TFree(hypre_ParCSRCommHandleRecvDataBuffer(comm_handle), HYPRE_MEMORY_HOST); + } } -#endif hypre_TFree(hypre_ParCSRCommHandleRequests(comm_handle), HYPRE_MEMORY_HOST); hypre_TFree(comm_handle, HYPRE_MEMORY_HOST); + hypre_GpuProfilingPopRange(); + return hypre_error_flag; } - -/* hypre_MatCommPkgCreate_core does all the communications and computations for - hypre_MatCommPkgCreate ( hypre_ParCSRMatrix *A) and - hypre_BoolMatCommPkgCreate ( hypre_ParCSRBooleanMatrix *A) To support both - data types, it has hardly any data structures other than HYPRE_Int*. -*/ +/*------------------------------------------------------------------ + * hypre_ParCSRCommPkgCreate_core + * + * This function does all the communications and computations for + * hypre_ParCSRCommPkgCreate(hypre_ParCSRMatrix *A) and + * hypre_BooleanMatvecCommPkgCreate(hypre_ParCSRBooleanMatrix *A) + * + * To support both data types, it has hardly any data structures + * other than HYPRE_Int*. + *------------------------------------------------------------------*/ void hypre_ParCSRCommPkgCreate_core( @@ -651,7 +733,7 @@ hypre_ParCSRCommPkgCreate_core( HYPRE_Int **p_send_procs, HYPRE_Int **p_send_map_starts, HYPRE_Int **p_send_map_elmts - ) +) { HYPRE_Int i, j; HYPRE_Int num_procs, my_id, proc_num, num_elmts; @@ -664,8 +746,8 @@ hypre_ParCSRCommPkgCreate_core( HYPRE_Int num_sends, *send_procs, *send_map_starts, *send_map_elmts; HYPRE_Int ip, vec_start, vec_len, num_requests; - hypre_MPI_Request *requests; - hypre_MPI_Status *status; + hypre_MPI_Request *requests = NULL; + hypre_MPI_Status *status = NULL; hypre_MPI_Comm_size(comm, &num_procs); hypre_MPI_Comm_rank(comm, &my_id); @@ -680,27 +762,36 @@ hypre_ParCSRCommPkgCreate_core( * received from Proc. i * ---------------------------------------------------------------------*/ - for (i=0; i < num_procs; i++) - proc_add[i] = 0; - proc_num = 0; - if (num_cols_offd) offd_col = col_map_offd[0]; - num_recvs=0; - j = 0; - for (i=0; i < num_cols_offd; i++) + if (num_cols_offd) + { + offd_col = col_map_offd[0]; + } + + num_recvs = 0; + for (i = 0; i < num_cols_offd; i++) { if (num_cols_diag) - proc_num = hypre_min(num_procs-1, (HYPRE_Int)(offd_col / (HYPRE_BigInt)num_cols_diag)); + { + proc_num = hypre_min(num_procs - 1, (HYPRE_Int)(offd_col / (HYPRE_BigInt)num_cols_diag)); + } + while (col_starts[proc_num] > offd_col ) - proc_num = proc_num-1; - while (col_starts[proc_num+1]-1 < offd_col ) - proc_num = proc_num+1; + { + proc_num = proc_num - 1; + } + + while (col_starts[proc_num + 1] - 1 < offd_col ) + { + proc_num = proc_num + 1; + } + proc_mark[num_recvs] = proc_num; j = i; - while (col_starts[proc_num+1] > offd_col) + while (col_starts[proc_num + 1] > offd_col) { proc_add[num_recvs]++; - if (j < num_cols_offd-1) + if (j < num_cols_offd - 1) { j++; offd_col = col_map_offd[j]; @@ -712,11 +803,11 @@ hypre_ParCSRCommPkgCreate_core( } } num_recvs++; - if (j < num_cols_offd) i = j-1; - else i=j; + + i = (j < num_cols_offd) ? (j - 1) : j; } - local_info = 2*num_recvs; + local_info = 2 * num_recvs; hypre_MPI_Allgather(&local_info, 1, HYPRE_MPI_INT, info, 1, HYPRE_MPI_INT, comm); @@ -726,10 +817,11 @@ hypre_ParCSRCommPkgCreate_core( * indices of elements (in this order) * ---------------------------------------------------------------------*/ - displs = hypre_CTAlloc(HYPRE_Int, num_procs+1, HYPRE_MEMORY_HOST); - displs[0] = 0; - for (i=1; i < num_procs+1; i++) - displs[i] = displs[i-1]+info[i-1]; + displs = hypre_CTAlloc(HYPRE_Int, num_procs + 1, HYPRE_MEMORY_HOST); + for (i = 1; i < num_procs + 1; i++) + { + displs[i] = displs[i - 1] + info[i - 1]; + } recv_buf = hypre_CTAlloc(HYPRE_Int, displs[num_procs], HYPRE_MEMORY_HOST); recv_procs = NULL; @@ -739,21 +831,20 @@ hypre_ParCSRCommPkgCreate_core( recv_procs = hypre_CTAlloc(HYPRE_Int, num_recvs, HYPRE_MEMORY_HOST); tmp = hypre_CTAlloc(HYPRE_Int, local_info, HYPRE_MEMORY_HOST); } - recv_vec_starts = hypre_CTAlloc(HYPRE_Int, num_recvs+1, HYPRE_MEMORY_HOST); + recv_vec_starts = hypre_CTAlloc(HYPRE_Int, num_recvs + 1, HYPRE_MEMORY_HOST); j = 0; - if (num_recvs) recv_vec_starts[0] = 0; - for (i=0; i < num_recvs; i++) + for (i = 0; i < num_recvs; i++) { num_elmts = proc_add[i]; recv_procs[i] = proc_mark[i]; - recv_vec_starts[i+1] = recv_vec_starts[i]+num_elmts; + recv_vec_starts[i + 1] = recv_vec_starts[i] + num_elmts; tmp[j++] = proc_mark[i]; tmp[j++] = num_elmts; } - hypre_MPI_Allgatherv(tmp,local_info,HYPRE_MPI_INT,recv_buf,info, - displs,HYPRE_MPI_INT,comm); + hypre_MPI_Allgatherv(tmp, local_info, HYPRE_MPI_INT, recv_buf, info, + displs, HYPRE_MPI_INT, comm); /* ---------------------------------------------------------------------- * determine num_sends and number of elements to be sent @@ -762,16 +853,16 @@ hypre_ParCSRCommPkgCreate_core( num_sends = 0; num_elmts = 0; proc_add[0] = 0; - for (i=0; i < num_procs; i++) + for (i = 0; i < num_procs; i++) { j = displs[i]; - while ( j < displs[i+1]) + while ( j < displs[i + 1]) { if (recv_buf[j++] == my_id) { proc_mark[num_sends] = i; num_sends++; - proc_add[num_sends] = proc_add[num_sends-1]+recv_buf[j]; + proc_add[num_sends] = proc_add[num_sends - 1] + recv_buf[j]; break; } j++; @@ -793,34 +884,33 @@ hypre_ParCSRCommPkgCreate_core( send_map_elmts = hypre_CTAlloc(HYPRE_Int, proc_add[num_sends], HYPRE_MEMORY_HOST); big_buf_data = hypre_CTAlloc(HYPRE_BigInt, proc_add[num_sends], HYPRE_MEMORY_HOST); } - send_map_starts = hypre_CTAlloc(HYPRE_Int, num_sends+1, HYPRE_MEMORY_HOST); - num_requests = num_recvs+num_sends; + send_map_starts = hypre_CTAlloc(HYPRE_Int, num_sends + 1, HYPRE_MEMORY_HOST); + num_requests = num_recvs + num_sends; if (num_requests) { requests = hypre_CTAlloc(hypre_MPI_Request, num_requests, HYPRE_MEMORY_HOST); status = hypre_CTAlloc(hypre_MPI_Status, num_requests, HYPRE_MEMORY_HOST); } - if (num_sends) send_map_starts[0] = 0; - for (i=0; i < num_sends; i++) + for (i = 0; i < num_sends; i++) { - send_map_starts[i+1] = proc_add[i+1]; + send_map_starts[i + 1] = proc_add[i + 1]; send_procs[i] = proc_mark[i]; } - j=0; - for (i=0; i < num_sends; i++) + j = 0; + for (i = 0; i < num_sends; i++) { vec_start = send_map_starts[i]; - vec_len = send_map_starts[i+1] - vec_start; + vec_len = send_map_starts[i + 1] - vec_start; ip = send_procs[i]; hypre_MPI_Irecv(&big_buf_data[vec_start], vec_len, HYPRE_MPI_BIG_INT, ip, 0, comm, &requests[j++]); } - for (i=0; i < num_recvs; i++) + for (i = 0; i < num_recvs; i++) { vec_start = recv_vec_starts[i]; - vec_len = recv_vec_starts[i+1] - vec_start; + vec_len = recv_vec_starts[i + 1] - vec_start; ip = recv_procs[i]; hypre_MPI_Isend(&col_map_offd[vec_start], vec_len, HYPRE_MPI_BIG_INT, ip, 0, comm, &requests[j++]); @@ -835,8 +925,10 @@ hypre_ParCSRCommPkgCreate_core( if (num_sends) { - for (i=0; ipersistent_comm_handles[i] = NULL; + } +#endif + + /* Set input info */ + hypre_ParCSRCommPkgComm(comm_pkg) = comm; + hypre_ParCSRCommPkgNumRecvs(comm_pkg) = num_recvs; + hypre_ParCSRCommPkgRecvProcs(comm_pkg) = recv_procs; hypre_ParCSRCommPkgRecvVecStarts(comm_pkg) = recv_vec_starts; - hypre_ParCSRCommPkgNumSends (comm_pkg) = num_sends; - hypre_ParCSRCommPkgSendProcs (comm_pkg) = send_procs; + hypre_ParCSRCommPkgNumSends(comm_pkg) = num_sends; + hypre_ParCSRCommPkgSendProcs(comm_pkg) = send_procs; hypre_ParCSRCommPkgSendMapStarts(comm_pkg) = send_map_starts; - hypre_ParCSRCommPkgSendMapElmts (comm_pkg) = send_map_elmts; + hypre_ParCSRCommPkgSendMapElmts(comm_pkg) = send_map_elmts; + + /* Set output pointer */ + *comm_pkg_ptr = comm_pkg; + + return hypre_error_flag; +} + +/*------------------------------------------------------------------ + * hypre_ParCSRCommPkgUpdateVecStarts + *------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRCommPkgUpdateVecStarts( hypre_ParCSRCommPkg *comm_pkg, + HYPRE_Int num_components_in, + HYPRE_Int vecstride, + HYPRE_Int idxstride ) +{ + HYPRE_Int num_components = hypre_ParCSRCommPkgNumComponents(comm_pkg); + HYPRE_Int num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); + HYPRE_Int num_recvs = hypre_ParCSRCommPkgNumRecvs(comm_pkg); + HYPRE_Int *recv_vec_starts = hypre_ParCSRCommPkgRecvVecStarts(comm_pkg); + HYPRE_Int *send_map_starts = hypre_ParCSRCommPkgSendMapStarts(comm_pkg); + HYPRE_Int *send_map_elmts = hypre_ParCSRCommPkgSendMapElmts(comm_pkg); + + HYPRE_Int *send_map_elmts_new; + + HYPRE_Int i, j; + + hypre_assert(num_components > 0); + + if (num_components_in != num_components) + { + /* Update number of components in the communication package */ + hypre_ParCSRCommPkgNumComponents(comm_pkg) = num_components_in; + + /* Allocate send_maps_elmts */ + send_map_elmts_new = hypre_CTAlloc(HYPRE_Int, + send_map_starts[num_sends] * num_components_in, + HYPRE_MEMORY_HOST); + + /* Update send_maps_elmts */ + if (num_components_in > num_components) + { + if (num_components == 1) + { + for (i = 0; i < send_map_starts[num_sends]; i++) + { + for (j = 0; j < num_components_in; j++) + { + send_map_elmts_new[i * num_components_in + j] = send_map_elmts[i] * idxstride + + j * vecstride; + } + } + } + else + { + for (i = 0; i < send_map_starts[num_sends]; i++) + { + for (j = 0; j < num_components_in; j++) + { + send_map_elmts_new[i * num_components_in + j] = + send_map_elmts[i * num_components] * idxstride + j * vecstride; + } + } + } + } + else + { + /* num_components_in < num_components */ + if (num_components_in == 1) + { + for (i = 0; i < send_map_starts[num_sends]; i++) + { + send_map_elmts_new[i] = send_map_elmts[i * num_components]; + } + } + else + { + for (i = 0; i < send_map_starts[num_sends]; i++) + { + for (j = 0; j < num_components_in; j++) + { + send_map_elmts_new[i * num_components_in + j] = + send_map_elmts[i * num_components + j]; + } + } + } + } + hypre_ParCSRCommPkgSendMapElmts(comm_pkg) = send_map_elmts_new; + + /* Free memory */ + hypre_TFree(send_map_elmts, HYPRE_MEMORY_HOST); + hypre_TFree(hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) + hypre_CSRMatrixDestroy(hypre_ParCSRCommPkgMatrixE(comm_pkg)); + hypre_ParCSRCommPkgMatrixE(comm_pkg) = NULL; +#endif + + /* Update send_map_starts */ + for (i = 0; i < num_sends + 1; i++) + { + send_map_starts[i] *= num_components_in / num_components; + } + + /* Update recv_vec_starts */ + for (i = 0; i < num_recvs + 1; i++) + { + recv_vec_starts[i] *= num_components_in / num_components; + } + } return hypre_error_flag; } -/* ---------------------------------------------------------------------- +/*------------------------------------------------------------------ * hypre_MatvecCommPkgCreate - * generates the comm_pkg for A - * if no row and/or column partitioning is given, the routine determines - * them with MPE_Decomp1d - * ---------------------------------------------------------------------*/ + * + * Generates the communication package for A using assumed partition + *------------------------------------------------------------------*/ HYPRE_Int hypre_MatvecCommPkgCreate ( hypre_ParCSRMatrix *A ) @@ -932,7 +1191,8 @@ hypre_MatvecCommPkgCreate ( hypre_ParCSRMatrix *A ) /*----------------------------------------------------------- * setup commpkg *----------------------------------------------------------*/ - comm_pkg = hypre_CTAlloc(hypre_ParCSRCommPkg, 1, HYPRE_MEMORY_HOST); + + comm_pkg = hypre_TAlloc(hypre_ParCSRCommPkg, 1, HYPRE_MEMORY_HOST); hypre_ParCSRMatrixCommPkg(A) = comm_pkg; hypre_ParCSRCommPkgCreateApart( comm, col_map_offd, first_col_diag, num_cols_offd, global_num_cols, @@ -944,6 +1204,10 @@ hypre_MatvecCommPkgCreate ( hypre_ParCSRMatrix *A ) return hypre_error_flag; } +/*------------------------------------------------------------------ + * hypre_MatvecCommPkgDestroy + *------------------------------------------------------------------*/ + HYPRE_Int hypre_MatvecCommPkgDestroy( hypre_ParCSRCommPkg *comm_pkg ) { @@ -975,12 +1239,10 @@ hypre_MatvecCommPkgDestroy( hypre_ParCSRCommPkg *comm_pkg ) /* if (hypre_ParCSRCommPkgRecvMPITypes(comm_pkg)) hypre_TFree(hypre_ParCSRCommPkgRecvMPITypes(comm_pkg), HYPRE_MEMORY_HOST); */ -#if defined(HYPRE_USING_GPU) - hypre_TFree(hypre_ParCSRCommPkgTmpData(comm_pkg), HYPRE_MEMORY_DEVICE); - hypre_TFree(hypre_ParCSRCommPkgBufData(comm_pkg), HYPRE_MEMORY_DEVICE); - //_hypre_TFree(hypre_ParCSRCommPkgTmpData(comm_pkg), hypre_MEMORY_DEVICE); - //_hypre_TFree(hypre_ParCSRCommPkgBufData(comm_pkg), hypre_MEMORY_DEVICE); - hypre_TFree(hypre_ParCSRCommPkgWorkSpace(comm_pkg), HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) + hypre_TFree(hypre_ParCSRCommPkgTmpData(comm_pkg), HYPRE_MEMORY_DEVICE); + hypre_TFree(hypre_ParCSRCommPkgBufData(comm_pkg), HYPRE_MEMORY_DEVICE); + hypre_CSRMatrixDestroy(hypre_ParCSRCommPkgMatrixE(comm_pkg)); #endif hypre_TFree(comm_pkg, HYPRE_MEMORY_HOST); @@ -988,11 +1250,16 @@ hypre_MatvecCommPkgDestroy( hypre_ParCSRCommPkg *comm_pkg ) return hypre_error_flag; } -/* AHB 11/06 : alternate to the extend function below - creates a +/*------------------------------------------------------------------ + * hypre_ParCSRFindExtendCommPkg + * + * AHB 11/06 : alternate to the extend function below - creates a * second comm pkg based on indices - this makes it easier to use the * global partition + * * RL: renamed and moved it here - */ + *------------------------------------------------------------------*/ + HYPRE_Int hypre_ParCSRFindExtendCommPkg(MPI_Comm comm, HYPRE_BigInt global_num, @@ -1004,19 +1271,23 @@ hypre_ParCSRFindExtendCommPkg(MPI_Comm comm, HYPRE_BigInt *indices, hypre_ParCSRCommPkg **extend_comm_pkg) { - /*----------------------------------------------------------- - * setup commpkg - *----------------------------------------------------------*/ - hypre_ParCSRCommPkg *new_comm_pkg = hypre_CTAlloc(hypre_ParCSRCommPkg, 1, HYPRE_MEMORY_HOST); - *extend_comm_pkg = new_comm_pkg; + HYPRE_UNUSED_VAR(local_num); + HYPRE_UNUSED_VAR(starts); + + hypre_ParCSRCommPkg *new_comm_pkg = hypre_TAlloc(hypre_ParCSRCommPkg, 1, HYPRE_MEMORY_HOST); hypre_assert(apart != NULL); - hypre_ParCSRCommPkgCreateApart ( comm, indices, my_first, indices_len, global_num, apart, - new_comm_pkg ); + hypre_ParCSRCommPkgCreateApart(comm, indices, my_first, indices_len, + global_num, apart, new_comm_pkg); + + *extend_comm_pkg = new_comm_pkg; return hypre_error_flag; } +/*------------------------------------------------------------------ + * hypre_BuildCSRMatrixMPIDataType + *------------------------------------------------------------------*/ HYPRE_Int hypre_BuildCSRMatrixMPIDataType( HYPRE_Int num_nonzeros, @@ -1031,7 +1302,7 @@ hypre_BuildCSRMatrixMPIDataType( HYPRE_Int num_nonzeros, hypre_MPI_Datatype types[3]; block_lens[0] = num_nonzeros; - block_lens[1] = num_rows+1; + block_lens[1] = num_rows + 1; block_lens[2] = num_nonzeros; types[0] = HYPRE_MPI_COMPLEX; @@ -1041,12 +1312,16 @@ hypre_BuildCSRMatrixMPIDataType( HYPRE_Int num_nonzeros, hypre_MPI_Address(a_data, &displ[0]); hypre_MPI_Address(a_i, &displ[1]); hypre_MPI_Address(a_j, &displ[2]); - hypre_MPI_Type_struct(3,block_lens,displ,types,csr_matrix_datatype); + hypre_MPI_Type_struct(3, block_lens, displ, types, csr_matrix_datatype); hypre_MPI_Type_commit(csr_matrix_datatype); return hypre_error_flag; } +/*------------------------------------------------------------------ + * hypre_BuildCSRMatrixMPIDataType + *------------------------------------------------------------------*/ + HYPRE_Int hypre_BuildCSRJDataType( HYPRE_Int num_nonzeros, HYPRE_Complex *a_data, @@ -1066,7 +1341,7 @@ hypre_BuildCSRJDataType( HYPRE_Int num_nonzeros, hypre_MPI_Address(a_data, &displs[0]); hypre_MPI_Address(a_j, &displs[1]); - hypre_MPI_Type_struct(2,block_lens,displs,types,csr_jdata_datatype); + hypre_MPI_Type_struct(2, block_lens, displs, types, csr_jdata_datatype); hypre_MPI_Type_commit(csr_jdata_datatype); return hypre_error_flag; diff --git a/external/hypre/src/parcsr_mv/par_csr_communication.h b/external/hypre/src/parcsr_mv/par_csr_communication.h index 47b07ec9..50fa4cb4 100644 --- a/external/hypre/src/parcsr_mv/par_csr_communication.h +++ b/external/hypre/src/parcsr_mv/par_csr_communication.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -50,31 +50,27 @@ typedef hypre_ParCSRCommHandle hypre_ParCSRPersistentCommHandle; typedef struct _hypre_ParCSRCommPkg { - MPI_Comm comm; - - HYPRE_Int num_sends; - HYPRE_Int *send_procs; - HYPRE_Int *send_map_starts; - HYPRE_Int *send_map_elmts; - HYPRE_Int *device_send_map_elmts; - - HYPRE_Int num_recvs; - HYPRE_Int *recv_procs; - HYPRE_Int *recv_vec_starts; - + MPI_Comm comm; + HYPRE_Int num_components; + HYPRE_Int num_sends; + HYPRE_Int *send_procs; + HYPRE_Int *send_map_starts; + HYPRE_Int *send_map_elmts; + HYPRE_Int *device_send_map_elmts; + HYPRE_Int num_recvs; + HYPRE_Int *recv_procs; + HYPRE_Int *recv_vec_starts; /* remote communication information */ - hypre_MPI_Datatype *send_mpi_types; - hypre_MPI_Datatype *recv_mpi_types; - + hypre_MPI_Datatype *send_mpi_types; + hypre_MPI_Datatype *recv_mpi_types; #ifdef HYPRE_USING_PERSISTENT_COMM hypre_ParCSRPersistentCommHandle *persistent_comm_handles[NUM_OF_COMM_PKG_JOB_TYPE]; #endif - +#if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) /* temporary memory for matvec. cudaMalloc is expensive. alloc once and reuse */ -#if defined(HYPRE_USING_GPU) - HYPRE_Complex *tmp_data; - HYPRE_Complex *buf_data; - char *work_space; + HYPRE_Complex *tmp_data; + HYPRE_Complex *buf_data; + hypre_CSRMatrix *matrix_E; /* for matvecT */ #endif } hypre_ParCSRCommPkg; @@ -83,6 +79,7 @@ typedef struct _hypre_ParCSRCommPkg *--------------------------------------------------------------------------*/ #define hypre_ParCSRCommPkgComm(comm_pkg) (comm_pkg -> comm) +#define hypre_ParCSRCommPkgNumComponents(comm_pkg) (comm_pkg -> num_components) #define hypre_ParCSRCommPkgNumSends(comm_pkg) (comm_pkg -> num_sends) #define hypre_ParCSRCommPkgSendProcs(comm_pkg) (comm_pkg -> send_procs) #define hypre_ParCSRCommPkgSendProc(comm_pkg, i) (comm_pkg -> send_procs[i]) @@ -102,25 +99,34 @@ typedef struct _hypre_ParCSRCommPkg #define hypre_ParCSRCommPkgRecvMPITypes(comm_pkg) (comm_pkg -> recv_mpi_types) #define hypre_ParCSRCommPkgRecvMPIType(comm_pkg,i) (comm_pkg -> recv_mpi_types[i]) -#if defined(HYPRE_USING_GPU) +#if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) #define hypre_ParCSRCommPkgTmpData(comm_pkg) ((comm_pkg) -> tmp_data) #define hypre_ParCSRCommPkgBufData(comm_pkg) ((comm_pkg) -> buf_data) -#define hypre_ParCSRCommPkgWorkSpace(comm_pkg) ((comm_pkg) -> work_space) +#define hypre_ParCSRCommPkgMatrixE(comm_pkg) ((comm_pkg) -> matrix_E) #endif -static inline void +static inline HYPRE_MAYBE_UNUSED_FUNC void hypre_ParCSRCommPkgCopySendMapElmtsToDevice(hypre_ParCSRCommPkg *comm_pkg) { -#if defined(HYPRE_USING_GPU) +#if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) + HYPRE_Int num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); + if (hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) == NULL) { hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) = - hypre_TAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, hypre_ParCSRCommPkgNumSends(comm_pkg)), HYPRE_MEMORY_DEVICE); - - hypre_TMemcpy(hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), hypre_ParCSRCommPkgSendMapElmts(comm_pkg), - HYPRE_Int, hypre_ParCSRCommPkgSendMapStart(comm_pkg, hypre_ParCSRCommPkgNumSends(comm_pkg)), - HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); + hypre_TAlloc(HYPRE_Int, + hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_DEVICE); + + hypre_TMemcpy(hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), + hypre_ParCSRCommPkgSendMapElmts(comm_pkg), + HYPRE_Int, + hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_DEVICE, + HYPRE_MEMORY_HOST); } +#else + HYPRE_UNUSED_VAR(comm_pkg); #endif } diff --git a/external/hypre/src/parcsr_mv/par_csr_fffc_device.c b/external/hypre/src/parcsr_mv/par_csr_fffc_device.c index 83f1f0e4..8ab72672 100644 --- a/external/hypre/src/parcsr_mv/par_csr_fffc_device.c +++ b/external/hypre/src/parcsr_mv/par_csr_fffc_device.c @@ -1,23 +1,31 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ +#include "_hypre_onedpl.hpp" #include "_hypre_utilities.h" #include "_hypre_parcsr_mv.h" #include "_hypre_utilities.hpp" -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) + +#if defined(HYPRE_USING_SYCL) +namespace thrust = std; +#endif typedef thrust::tuple Tuple; -//typedef thrust::tuple Tuple3; /* transform from local F/C index to global F/C index, * where F index "x" are saved as "-x-1" */ +#if (defined(THRUST_VERSION) && THRUST_VERSION < 101000) struct FFFC_functor : public thrust::unary_function +#else +struct FFFC_functor +#endif { HYPRE_BigInt CF_first[2]; @@ -33,14 +41,18 @@ struct FFFC_functor : public thrust::unary_function const HYPRE_Int local_idx = thrust::get<0>(t); const HYPRE_Int cf_marker = thrust::get<1>(t); const HYPRE_Int s = cf_marker < 0; - const HYPRE_Int m = 1 - 2*s; - return m*(local_idx + CF_first[s] + s); + const HYPRE_Int m = 1 - 2 * s; + return m * (local_idx + CF_first[s] + s); } }; /* this predicate selects A^s_{FF} */ template +#if (defined(THRUST_VERSION) && THRUST_VERSION < 101000) struct FF_pred : public thrust::unary_function +#else +struct FF_pred +#endif { HYPRE_Int option; HYPRE_Int *row_CF_marker; @@ -62,19 +74,23 @@ struct FF_pred : public thrust::unary_function if (option == 1) { /* A_{F,F} */ - return row_CF_marker[i] < 0 && (j == -2 || j >= 0 && col_CF_marker[j] < 0); + return row_CF_marker[i] < 0 && (j == -2 || (j >= 0 && col_CF_marker[j] < 0)); } else { /* A_{F2, F} */ - return row_CF_marker[i] == -2 && (j == -2 || j >= 0 && col_CF_marker[j] < 0); + return row_CF_marker[i] == -2 && (j == -2 || (j >= 0 && col_CF_marker[j] < 0)); } } }; /* this predicate selects A^s_{FC} */ template +#if (defined(THRUST_VERSION) && THRUST_VERSION < 101000) +struct FC_pred +#else struct FC_pred : public thrust::unary_function +#endif { HYPRE_Int *row_CF_marker; T *col_CF_marker; @@ -97,7 +113,11 @@ struct FC_pred : public thrust::unary_function /* this predicate selects A^s_{CF} */ template +#if (defined(THRUST_VERSION) && THRUST_VERSION < 101000) struct CF_pred : public thrust::unary_function +#else +struct CF_pred +#endif { HYPRE_Int *row_CF_marker; T *col_CF_marker; @@ -120,7 +140,11 @@ struct CF_pred : public thrust::unary_function /* this predicate selects A^s_{CC} */ template +#if (defined(THRUST_VERSION) && THRUST_VERSION < 101000) struct CC_pred : public thrust::unary_function +#else +struct CC_pred +#endif { HYPRE_Int *row_CF_marker; T *col_CF_marker; @@ -137,12 +161,16 @@ struct CC_pred : public thrust::unary_function const HYPRE_Int i = thrust::get<0>(t); const HYPRE_Int j = thrust::get<1>(t); - return row_CF_marker[i] >= 0 && (j == -2 || j >= 0 && col_CF_marker[j] >= 0); + return row_CF_marker[i] >= 0 && (j == -2 || (j >= 0 && col_CF_marker[j] >= 0)); } }; /* this predicate selects A^s_{C,:} */ +#if (defined(THRUST_VERSION) && THRUST_VERSION < 101000) struct CX_pred : public thrust::unary_function +#else +struct CX_pred +#endif { HYPRE_Int *row_CF_marker; @@ -163,7 +191,11 @@ struct CX_pred : public thrust::unary_function /* this predicate selects A^s_{:,C} */ template +#if (defined(THRUST_VERSION) && THRUST_VERSION < 101000) struct XC_pred : public thrust::unary_function +#else +struct XC_pred +#endif { T *col_CF_marker; @@ -211,6 +243,10 @@ hypre_ParCSRMatrixGenerateFFFCDevice_core( hypre_ParCSRMatrix *A, HYPRE_Int option ) { MPI_Comm comm = hypre_ParCSRMatrixComm(A); + if (!hypre_ParCSRMatrixCommPkg(A)) + { + hypre_MatvecCommPkgCreate(A); + } hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); hypre_ParCSRCommHandle *comm_handle; HYPRE_Int num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); @@ -236,26 +272,27 @@ hypre_ParCSRMatrixGenerateFFFCDevice_core( hypre_ParCSRMatrix *A, HYPRE_Int my_id, num_procs; /* nF and nC */ HYPRE_Int n_local, nF_local, nC_local, nF2_local = 0; - HYPRE_BigInt *fpts_starts, *row_starts, *f2pts_starts = NULL; + HYPRE_BigInt fpts_starts[2], *row_starts, f2pts_starts[2]; HYPRE_BigInt nF_global, nC_global, nF2_global = 0; HYPRE_BigInt F_first, C_first; /* work arrays */ HYPRE_Int *map2FC, *map2F2 = NULL, *itmp, *A_diag_ii, *A_offd_ii, *offd_mark; HYPRE_BigInt *send_buf, *recv_buf; + hypre_GpuProfilingPushRange("ParCSRMatrixGenerateFFFC"); + hypre_MPI_Comm_size(comm, &num_procs); hypre_MPI_Comm_rank(comm, &my_id); n_local = hypre_ParCSRMatrixNumRows(A); row_starts = hypre_ParCSRMatrixRowStarts(A); - if (my_id == (num_procs -1)) + if (my_id == (num_procs - 1)) { nC_global = cpts_starts[1]; } - hypre_MPI_Bcast(&nC_global, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); + hypre_MPI_Bcast(&nC_global, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); nC_local = (HYPRE_Int) (cpts_starts[1] - cpts_starts[0]); - fpts_starts = hypre_TAlloc(HYPRE_BigInt, 2, HYPRE_MEMORY_HOST); fpts_starts[0] = row_starts[0] - cpts_starts[0]; fpts_starts[1] = row_starts[1] - cpts_starts[1]; F_first = fpts_starts[0]; @@ -269,24 +306,50 @@ hypre_ParCSRMatrixGenerateFFFCDevice_core( hypre_ParCSRMatrix *A, if (option == 2) { +#if defined(HYPRE_USING_SYCL) + nF2_local = HYPRE_ONEDPL_CALL( std::count, + CF_marker, + CF_marker + n_local, + -2 ); +#else nF2_local = HYPRE_THRUST_CALL( count, CF_marker, CF_marker + n_local, -2 ); +#endif HYPRE_BigInt nF2_local_big = nF2_local; - f2pts_starts = hypre_TAlloc(HYPRE_BigInt, 2, HYPRE_MEMORY_HOST); hypre_MPI_Scan(&nF2_local_big, f2pts_starts + 1, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); f2pts_starts[0] = f2pts_starts[1] - nF2_local_big; - if (my_id == (num_procs -1)) + if (my_id == (num_procs - 1)) { nF2_global = f2pts_starts[1]; } - hypre_MPI_Bcast(&nF2_global, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); + hypre_MPI_Bcast(&nF2_global, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); } /* map from all points (i.e, F+C) to F/C indices */ +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::exclusive_scan, + oneapi::dpl::make_transform_iterator(CF_marker, is_negative()), + oneapi::dpl::make_transform_iterator(CF_marker + n_local, is_negative()), + map2FC, /* F */ + HYPRE_Int(0) ); + + HYPRE_ONEDPL_CALL( std::exclusive_scan, + oneapi::dpl::make_transform_iterator(CF_marker, is_nonnegative()), + oneapi::dpl::make_transform_iterator(CF_marker + n_local, is_nonnegative()), + itmp, /* C */ + HYPRE_Int(0) ); + + hypreSycl_scatter_if( itmp, + itmp + n_local, + oneapi::dpl::counting_iterator(0), + CF_marker, + map2FC, + is_nonnegative() ); /* FC combined */ +#else HYPRE_THRUST_CALL( exclusive_scan, thrust::make_transform_iterator(CF_marker, is_negative()), thrust::make_transform_iterator(CF_marker + n_local, is_negative()), @@ -305,17 +368,26 @@ hypre_ParCSRMatrixGenerateFFFCDevice_core( hypre_ParCSRMatrix *A, thrust::counting_iterator(0), thrust::make_transform_iterator(CF_marker, is_nonnegative()), map2FC ); /* FC combined */ +#endif hypre_TFree(itmp, HYPRE_MEMORY_DEVICE); if (option == 2) { map2F2 = hypre_TAlloc(HYPRE_Int, n_local, HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::exclusive_scan, + oneapi::dpl::make_transform_iterator(CF_marker, equal(-2)), + oneapi::dpl::make_transform_iterator(CF_marker + n_local, equal(-2)), + map2F2, /* F2 */ + HYPRE_Int(0) ); /* *MUST* pass init value since input and output types diff. */ +#else HYPRE_THRUST_CALL( exclusive_scan, thrust::make_transform_iterator(CF_marker, equal(-2)), thrust::make_transform_iterator(CF_marker + n_local, equal(-2)), map2F2, /* F2 */ HYPRE_Int(0) ); /* *MUST* pass init value since input and output types diff. */ +#endif } /* send_buf: global F/C indices. Note F-pts "x" are saved as "-x-1" */ @@ -324,19 +396,35 @@ hypre_ParCSRMatrixGenerateFFFCDevice_core( hypre_ParCSRMatrix *A, hypre_ParCSRCommPkgCopySendMapElmtsToDevice(comm_pkg); FFFC_functor functor(F_first, C_first); +#if defined(HYPRE_USING_SYCL) + hypreSycl_gather( hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + num_elem_send, + oneapi::dpl::make_transform_iterator( + oneapi::dpl::make_zip_iterator(map2FC, CF_marker), functor), + send_buf ); +#else HYPRE_THRUST_CALL( gather, hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + num_elem_send, - thrust::make_transform_iterator(thrust::make_zip_iterator(thrust::make_tuple(map2FC, CF_marker)), functor), + thrust::make_transform_iterator(thrust::make_zip_iterator(thrust::make_tuple(map2FC, CF_marker)), + functor), send_buf ); +#endif - comm_handle = hypre_ParCSRCommHandleCreate_v2(21, comm_pkg, HYPRE_MEMORY_DEVICE, send_buf, HYPRE_MEMORY_DEVICE, recv_buf); +#if defined(HYPRE_USING_THRUST_NOSYNC) + /* RL: make sure send_buf is ready before issuing GPU-GPU MPI */ + if (hypre_GetGpuAwareMPI()) + { + hypre_ForceSyncComputeStream(); + } +#endif + + comm_handle = hypre_ParCSRCommHandleCreate_v2(21, comm_pkg, HYPRE_MEMORY_DEVICE, send_buf, + HYPRE_MEMORY_DEVICE, recv_buf); hypre_ParCSRCommHandleDestroy(comm_handle); hypre_TFree(send_buf, HYPRE_MEMORY_DEVICE); - thrust::zip_iterator< thrust::tuple > new_end; - A_diag_ii = hypre_TAlloc(HYPRE_Int, A_diag_nnz, HYPRE_MEMORY_DEVICE); A_offd_ii = hypre_TAlloc(HYPRE_Int, A_offd_nnz, HYPRE_MEMORY_DEVICE); offd_mark = hypre_TAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_DEVICE); @@ -358,22 +446,50 @@ hypre_ParCSRMatrixGenerateFFFCDevice_core( hypre_ParCSRMatrix *A, /* AFF Diag */ FF_pred AFF_pred_diag(option, CF_marker, CF_marker); +#if defined(HYPRE_USING_SYCL) + AFF_diag_nnz = HYPRE_ONEDPL_CALL( std::count_if, + oneapi::dpl::make_zip_iterator(A_diag_ii, Soc_diag_j), + oneapi::dpl::make_zip_iterator(A_diag_ii, Soc_diag_j) + A_diag_nnz, + AFF_pred_diag ); +#else AFF_diag_nnz = HYPRE_THRUST_CALL( count_if, thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, Soc_diag_j)), thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, Soc_diag_j)) + A_diag_nnz, AFF_pred_diag ); +#endif AFF_diag_ii = hypre_TAlloc(HYPRE_Int, AFF_diag_nnz, HYPRE_MEMORY_DEVICE); AFF_diag_j = hypre_TAlloc(HYPRE_Int, AFF_diag_nnz, HYPRE_MEMORY_DEVICE); AFF_diag_a = hypre_TAlloc(HYPRE_Complex, AFF_diag_nnz, HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_SYCL) /* Notice that we cannot use Soc_diag_j in the first two arguments since the diagonal is marked as -2 */ - new_end = HYPRE_THRUST_CALL( copy_if, - thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, A_diag_j, A_diag_a)), - thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, A_diag_j, A_diag_a)) + A_diag_nnz, - thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, Soc_diag_j)), - thrust::make_zip_iterator(thrust::make_tuple(AFF_diag_ii, AFF_diag_j, AFF_diag_a)), - AFF_pred_diag ); + auto new_end = hypreSycl_copy_if( oneapi::dpl::make_zip_iterator(A_diag_ii, A_diag_j, A_diag_a), + oneapi::dpl::make_zip_iterator(A_diag_ii, A_diag_j, A_diag_a) + A_diag_nnz, + oneapi::dpl::make_zip_iterator(A_diag_ii, Soc_diag_j), + oneapi::dpl::make_zip_iterator(AFF_diag_ii, AFF_diag_j, AFF_diag_a), + AFF_pred_diag ); + + hypre_assert( std::get<0>(new_end.base()) == AFF_diag_ii + AFF_diag_nnz ); + + hypreSycl_gather( AFF_diag_j, + AFF_diag_j + AFF_diag_nnz, + map2FC, + AFF_diag_j ); + + hypreSycl_gather( AFF_diag_ii, + AFF_diag_ii + AFF_diag_nnz, + option == 1 ? map2FC : map2F2, + AFF_diag_ii ); + +#else + /* Notice that we cannot use Soc_diag_j in the first two arguments since the diagonal is marked as -2 */ + auto new_end = HYPRE_THRUST_CALL( copy_if, + thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, A_diag_j, A_diag_a)), + thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, A_diag_j, A_diag_a)) + A_diag_nnz, + thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, Soc_diag_j)), + thrust::make_zip_iterator(thrust::make_tuple(AFF_diag_ii, AFF_diag_j, AFF_diag_a)), + AFF_pred_diag ); hypre_assert( thrust::get<0>(new_end.get_iterator_tuple()) == AFF_diag_ii + AFF_diag_nnz ); @@ -388,21 +504,44 @@ hypre_ParCSRMatrixGenerateFFFCDevice_core( hypre_ParCSRMatrix *A, AFF_diag_ii + AFF_diag_nnz, option == 1 ? map2FC : map2F2, AFF_diag_ii ); +#endif - AFF_diag_i = hypreDevice_CsrRowIndicesToPtrs(option == 1 ? nF_local : nF2_local, AFF_diag_nnz, AFF_diag_ii); + AFF_diag_i = hypreDevice_CsrRowIndicesToPtrs(option == 1 ? nF_local : nF2_local, AFF_diag_nnz, + AFF_diag_ii); hypre_TFree(AFF_diag_ii, HYPRE_MEMORY_DEVICE); /* AFF Offd */ FF_pred AFF_pred_offd(option, CF_marker, recv_buf); +#if defined(HYPRE_USING_SYCL) + AFF_offd_nnz = HYPRE_ONEDPL_CALL( std::count_if, + oneapi::dpl::make_zip_iterator(A_offd_ii, Soc_offd_j), + oneapi::dpl::make_zip_iterator(A_offd_ii, Soc_offd_j) + A_offd_nnz, + AFF_pred_offd ); +#else AFF_offd_nnz = HYPRE_THRUST_CALL( count_if, thrust::make_zip_iterator(thrust::make_tuple(A_offd_ii, Soc_offd_j)), thrust::make_zip_iterator(thrust::make_tuple(A_offd_ii, Soc_offd_j)) + A_offd_nnz, AFF_pred_offd ); +#endif AFF_offd_ii = hypre_TAlloc(HYPRE_Int, AFF_offd_nnz, HYPRE_MEMORY_DEVICE); AFF_offd_j = hypre_TAlloc(HYPRE_Int, AFF_offd_nnz, HYPRE_MEMORY_DEVICE); AFF_offd_a = hypre_TAlloc(HYPRE_Complex, AFF_offd_nnz, HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_SYCL) + new_end = hypreSycl_copy_if( oneapi::dpl::make_zip_iterator(A_offd_ii, Soc_offd_j, A_offd_a), + oneapi::dpl::make_zip_iterator(A_offd_ii, Soc_offd_j, A_offd_a) + A_offd_nnz, + oneapi::dpl::make_zip_iterator(A_offd_ii, Soc_offd_j), + oneapi::dpl::make_zip_iterator(AFF_offd_ii, AFF_offd_j, AFF_offd_a), + AFF_pred_offd ); + + hypre_assert( std::get<0>(new_end.base()) == AFF_offd_ii + AFF_offd_nnz ); + + hypreSycl_gather( AFF_offd_ii, + AFF_offd_ii + AFF_offd_nnz, + option == 1 ? map2FC : map2F2, + AFF_offd_ii ); +#else new_end = HYPRE_THRUST_CALL( copy_if, thrust::make_zip_iterator(thrust::make_tuple(A_offd_ii, Soc_offd_j, A_offd_a)), thrust::make_zip_iterator(thrust::make_tuple(A_offd_ii, Soc_offd_j, A_offd_a)) + A_offd_nnz, @@ -417,25 +556,60 @@ hypre_ParCSRMatrixGenerateFFFCDevice_core( hypre_ParCSRMatrix *A, AFF_offd_ii + AFF_offd_nnz, option == 1 ? map2FC : map2F2, AFF_offd_ii ); +#endif - AFF_offd_i = hypreDevice_CsrRowIndicesToPtrs(option == 1 ? nF_local : nF2_local, AFF_offd_nnz, AFF_offd_ii); + AFF_offd_i = hypreDevice_CsrRowIndicesToPtrs(option == 1 ? nF_local : nF2_local, AFF_offd_nnz, + AFF_offd_ii); hypre_TFree(AFF_offd_ii, HYPRE_MEMORY_DEVICE); /* col_map_offd_AFF */ - HYPRE_Int *tmp_j = hypre_TAlloc(HYPRE_Int, hypre_max(AFF_offd_nnz, num_cols_A_offd), HYPRE_MEMORY_DEVICE); + HYPRE_Int *tmp_j = hypre_TAlloc(HYPRE_Int, hypre_max(AFF_offd_nnz, num_cols_A_offd), + HYPRE_MEMORY_DEVICE); hypre_TMemcpy(tmp_j, AFF_offd_j, HYPRE_Int, AFF_offd_nnz, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); - HYPRE_THRUST_CALL( sort, +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::sort, tmp_j, tmp_j + AFF_offd_nnz ); - HYPRE_Int *tmp_end = HYPRE_THRUST_CALL( unique, + HYPRE_Int *tmp_end = HYPRE_ONEDPL_CALL( std::unique, tmp_j, tmp_j + AFF_offd_nnz ); num_cols_AFF_offd = tmp_end - tmp_j; - HYPRE_THRUST_CALL( fill_n, + HYPRE_ONEDPL_CALL( std::fill_n, offd_mark, num_cols_A_offd, 0 ); - hypreDevice_ScatterConstant(offd_mark, num_cols_AFF_offd, tmp_j, 1); + hypreDevice_ScatterConstant(offd_mark, num_cols_AFF_offd, tmp_j, (HYPRE_Int) 1); + HYPRE_ONEDPL_CALL( std::exclusive_scan, + offd_mark, + offd_mark + num_cols_A_offd, + tmp_j, + 0 ); + hypreSycl_gather( AFF_offd_j, + AFF_offd_j + AFF_offd_nnz, + tmp_j, + AFF_offd_j ); + col_map_offd_AFF = hypre_TAlloc(HYPRE_BigInt, num_cols_AFF_offd, HYPRE_MEMORY_DEVICE); + HYPRE_BigInt *tmp_end_big = hypreSycl_copy_if( recv_buf, + recv_buf + num_cols_A_offd, + offd_mark, + col_map_offd_AFF, + [] (const auto & x) {return x;} ); + HYPRE_ONEDPL_CALL( std::transform, + col_map_offd_AFF, + col_map_offd_AFF + num_cols_AFF_offd, + col_map_offd_AFF, + [] (auto const & x) { return -x - 1; } ); + hypre_assert(tmp_end_big - col_map_offd_AFF == num_cols_AFF_offd); +#else + HYPRE_THRUST_CALL( sort, + tmp_j, + tmp_j + AFF_offd_nnz ); + HYPRE_Int *tmp_end = HYPRE_THRUST_CALL( unique, + tmp_j, + tmp_j + AFF_offd_nnz ); + num_cols_AFF_offd = tmp_end - tmp_j; + hypreDevice_IntFilln( offd_mark, num_cols_A_offd, 0 ); + hypreDevice_ScatterConstant(offd_mark, num_cols_AFF_offd, tmp_j, (HYPRE_Int) 1); HYPRE_THRUST_CALL( exclusive_scan, offd_mark, offd_mark + num_cols_A_offd, @@ -447,12 +621,13 @@ hypre_ParCSRMatrixGenerateFFFCDevice_core( hypre_ParCSRMatrix *A, AFF_offd_j ); col_map_offd_AFF = hypre_TAlloc(HYPRE_BigInt, num_cols_AFF_offd, HYPRE_MEMORY_DEVICE); HYPRE_BigInt *tmp_end_big = HYPRE_THRUST_CALL( copy_if, - thrust::make_transform_iterator(recv_buf, -_1-1), - thrust::make_transform_iterator(recv_buf, -_1-1) + num_cols_A_offd, + thrust::make_transform_iterator(recv_buf, -_1 - 1), + thrust::make_transform_iterator(recv_buf, -_1 - 1) + num_cols_A_offd, offd_mark, col_map_offd_AFF, thrust::identity() ); hypre_assert(tmp_end_big - col_map_offd_AFF == num_cols_AFF_offd); +#endif hypre_TFree(tmp_j, HYPRE_MEMORY_DEVICE); AFF = hypre_ParCSRMatrixCreate(comm, @@ -478,7 +653,8 @@ hypre_ParCSRMatrixGenerateFFFCDevice_core( hypre_ParCSRMatrix *A, hypre_CSRMatrixMemoryLocation(AFF_offd) = HYPRE_MEMORY_DEVICE; hypre_ParCSRMatrixDeviceColMapOffd(AFF) = col_map_offd_AFF; - hypre_ParCSRMatrixColMapOffd(AFF) = hypre_TAlloc(HYPRE_BigInt, num_cols_AFF_offd, HYPRE_MEMORY_HOST); + hypre_ParCSRMatrixColMapOffd(AFF) = hypre_TAlloc(HYPRE_BigInt, num_cols_AFF_offd, + HYPRE_MEMORY_HOST); hypre_TMemcpy(hypre_ParCSRMatrixColMapOffd(AFF), col_map_offd_AFF, HYPRE_BigInt, num_cols_AFF_offd, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); @@ -503,21 +679,47 @@ hypre_ParCSRMatrixGenerateFFFCDevice_core( hypre_ParCSRMatrix *A, /* AFC Diag */ FC_pred AFC_pred_diag(CF_marker, CF_marker); +#if defined(HYPRE_USING_SYCL) + AFC_diag_nnz = HYPRE_ONEDPL_CALL( std::count_if, + oneapi::dpl::make_zip_iterator(A_diag_ii, Soc_diag_j), + oneapi::dpl::make_zip_iterator(A_diag_ii, Soc_diag_j) + A_diag_nnz, + AFC_pred_diag ); +#else AFC_diag_nnz = HYPRE_THRUST_CALL( count_if, thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, Soc_diag_j)), thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, Soc_diag_j)) + A_diag_nnz, AFC_pred_diag ); +#endif AFC_diag_ii = hypre_TAlloc(HYPRE_Int, AFC_diag_nnz, HYPRE_MEMORY_DEVICE); AFC_diag_j = hypre_TAlloc(HYPRE_Int, AFC_diag_nnz, HYPRE_MEMORY_DEVICE); AFC_diag_a = hypre_TAlloc(HYPRE_Complex, AFC_diag_nnz, HYPRE_MEMORY_DEVICE); - new_end = HYPRE_THRUST_CALL( copy_if, - thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, Soc_diag_j, A_diag_a)), - thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, Soc_diag_j, A_diag_a)) + A_diag_nnz, - thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, Soc_diag_j)), - thrust::make_zip_iterator(thrust::make_tuple(AFC_diag_ii, AFC_diag_j, AFC_diag_a)), - AFC_pred_diag ); +#if defined(HYPRE_USING_SYCL) + auto new_end = hypreSycl_copy_if( oneapi::dpl::make_zip_iterator(A_diag_ii, Soc_diag_j, A_diag_a), + oneapi::dpl::make_zip_iterator(A_diag_ii, Soc_diag_j, A_diag_a) + A_diag_nnz, + oneapi::dpl::make_zip_iterator(A_diag_ii, Soc_diag_j), + oneapi::dpl::make_zip_iterator(AFC_diag_ii, AFC_diag_j, AFC_diag_a), + AFC_pred_diag ); + + hypre_assert( std::get<0>(new_end.base()) == AFC_diag_ii + AFC_diag_nnz ); + + hypreSycl_gather( AFC_diag_j, + AFC_diag_j + AFC_diag_nnz, + map2FC, + AFC_diag_j ); + + hypreSycl_gather( AFC_diag_ii, + AFC_diag_ii + AFC_diag_nnz, + map2FC, + AFC_diag_ii ); +#else + auto new_end = HYPRE_THRUST_CALL( copy_if, + thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, Soc_diag_j, A_diag_a)), + thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, Soc_diag_j, A_diag_a)) + A_diag_nnz, + thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, Soc_diag_j)), + thrust::make_zip_iterator(thrust::make_tuple(AFC_diag_ii, AFC_diag_j, AFC_diag_a)), + AFC_pred_diag ); hypre_assert( thrust::get<0>(new_end.get_iterator_tuple()) == AFC_diag_ii + AFC_diag_nnz ); @@ -532,21 +734,43 @@ hypre_ParCSRMatrixGenerateFFFCDevice_core( hypre_ParCSRMatrix *A, AFC_diag_ii + AFC_diag_nnz, map2FC, AFC_diag_ii ); +#endif AFC_diag_i = hypreDevice_CsrRowIndicesToPtrs(nF_local, AFC_diag_nnz, AFC_diag_ii); hypre_TFree(AFC_diag_ii, HYPRE_MEMORY_DEVICE); /* AFC Offd */ FC_pred AFC_pred_offd(CF_marker, recv_buf); +#if defined(HYPRE_USING_SYCL) + AFC_offd_nnz = HYPRE_ONEDPL_CALL( std::count_if, + oneapi::dpl::make_zip_iterator(A_offd_ii, Soc_offd_j), + oneapi::dpl::make_zip_iterator(A_offd_ii, Soc_offd_j) + A_offd_nnz, + AFC_pred_offd ); +#else AFC_offd_nnz = HYPRE_THRUST_CALL( count_if, thrust::make_zip_iterator(thrust::make_tuple(A_offd_ii, Soc_offd_j)), thrust::make_zip_iterator(thrust::make_tuple(A_offd_ii, Soc_offd_j)) + A_offd_nnz, AFC_pred_offd ); +#endif AFC_offd_ii = hypre_TAlloc(HYPRE_Int, AFC_offd_nnz, HYPRE_MEMORY_DEVICE); AFC_offd_j = hypre_TAlloc(HYPRE_Int, AFC_offd_nnz, HYPRE_MEMORY_DEVICE); AFC_offd_a = hypre_TAlloc(HYPRE_Complex, AFC_offd_nnz, HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_SYCL) + new_end = hypreSycl_copy_if( oneapi::dpl::make_zip_iterator(A_offd_ii, Soc_offd_j, A_offd_a), + oneapi::dpl::make_zip_iterator(A_offd_ii, Soc_offd_j, A_offd_a) + A_offd_nnz, + oneapi::dpl::make_zip_iterator(A_offd_ii, Soc_offd_j), + oneapi::dpl::make_zip_iterator(AFC_offd_ii, AFC_offd_j, AFC_offd_a), + AFC_pred_offd ); + + hypre_assert( std::get<0>(new_end.base()) == AFC_offd_ii + AFC_offd_nnz ); + + hypreSycl_gather( AFC_offd_ii, + AFC_offd_ii + AFC_offd_nnz, + map2FC, + AFC_offd_ii ); +#else new_end = HYPRE_THRUST_CALL( copy_if, thrust::make_zip_iterator(thrust::make_tuple(A_offd_ii, Soc_offd_j, A_offd_a)), thrust::make_zip_iterator(thrust::make_tuple(A_offd_ii, Soc_offd_j, A_offd_a)) + A_offd_nnz, @@ -561,25 +785,53 @@ hypre_ParCSRMatrixGenerateFFFCDevice_core( hypre_ParCSRMatrix *A, AFC_offd_ii + AFC_offd_nnz, map2FC, AFC_offd_ii ); +#endif AFC_offd_i = hypreDevice_CsrRowIndicesToPtrs(nF_local, AFC_offd_nnz, AFC_offd_ii); hypre_TFree(AFC_offd_ii, HYPRE_MEMORY_DEVICE); /* col_map_offd_AFC */ - HYPRE_Int *tmp_j = hypre_TAlloc(HYPRE_Int, hypre_max(AFC_offd_nnz, num_cols_A_offd), HYPRE_MEMORY_DEVICE); + HYPRE_Int *tmp_j = hypre_TAlloc(HYPRE_Int, hypre_max(AFC_offd_nnz, num_cols_A_offd), + HYPRE_MEMORY_DEVICE); hypre_TMemcpy(tmp_j, AFC_offd_j, HYPRE_Int, AFC_offd_nnz, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); - HYPRE_THRUST_CALL( sort, +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::sort, tmp_j, tmp_j + AFC_offd_nnz ); - HYPRE_Int *tmp_end = HYPRE_THRUST_CALL( unique, + HYPRE_Int *tmp_end = HYPRE_ONEDPL_CALL( std::unique, tmp_j, tmp_j + AFC_offd_nnz ); num_cols_AFC_offd = tmp_end - tmp_j; - HYPRE_THRUST_CALL( fill_n, + HYPRE_ONEDPL_CALL( std::fill_n, offd_mark, num_cols_A_offd, 0 ); - hypreDevice_ScatterConstant(offd_mark, num_cols_AFC_offd, tmp_j, 1); + hypreDevice_ScatterConstant(offd_mark, num_cols_AFC_offd, tmp_j, (HYPRE_Int) 1); + HYPRE_ONEDPL_CALL( std::exclusive_scan, + offd_mark, + offd_mark + num_cols_A_offd, + tmp_j, + 0); + hypreSycl_gather( AFC_offd_j, + AFC_offd_j + AFC_offd_nnz, + tmp_j, + AFC_offd_j ); + col_map_offd_AFC = hypre_TAlloc(HYPRE_BigInt, num_cols_AFC_offd, HYPRE_MEMORY_DEVICE); + HYPRE_BigInt *tmp_end_big = hypreSycl_copy_if( recv_buf, + recv_buf + num_cols_A_offd, + offd_mark, + col_map_offd_AFC, + [] (const auto & x) {return x;}); +#else + HYPRE_THRUST_CALL( sort, + tmp_j, + tmp_j + AFC_offd_nnz ); + HYPRE_Int *tmp_end = HYPRE_THRUST_CALL( unique, + tmp_j, + tmp_j + AFC_offd_nnz ); + num_cols_AFC_offd = tmp_end - tmp_j; + hypreDevice_IntFilln( offd_mark, num_cols_A_offd, 0 ); + hypreDevice_ScatterConstant(offd_mark, num_cols_AFC_offd, tmp_j, (HYPRE_Int) 1); HYPRE_THRUST_CALL( exclusive_scan, offd_mark, offd_mark + num_cols_A_offd, @@ -596,6 +848,7 @@ hypre_ParCSRMatrixGenerateFFFCDevice_core( hypre_ParCSRMatrix *A, offd_mark, col_map_offd_AFC, thrust::identity()); +#endif hypre_assert(tmp_end_big - col_map_offd_AFC == num_cols_AFC_offd); hypre_TFree(tmp_j, HYPRE_MEMORY_DEVICE); @@ -623,7 +876,8 @@ hypre_ParCSRMatrixGenerateFFFCDevice_core( hypre_ParCSRMatrix *A, hypre_CSRMatrixMemoryLocation(AFC_offd) = HYPRE_MEMORY_DEVICE; hypre_ParCSRMatrixDeviceColMapOffd(AFC) = col_map_offd_AFC; - hypre_ParCSRMatrixColMapOffd(AFC) = hypre_TAlloc(HYPRE_BigInt, num_cols_AFC_offd, HYPRE_MEMORY_HOST); + hypre_ParCSRMatrixColMapOffd(AFC) = hypre_TAlloc(HYPRE_BigInt, num_cols_AFC_offd, + HYPRE_MEMORY_HOST); hypre_TMemcpy(hypre_ParCSRMatrixColMapOffd(AFC), col_map_offd_AFC, HYPRE_BigInt, num_cols_AFC_offd, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); @@ -648,21 +902,47 @@ hypre_ParCSRMatrixGenerateFFFCDevice_core( hypre_ParCSRMatrix *A, /* ACF Diag */ CF_pred ACF_pred_diag(CF_marker, CF_marker); +#if defined(HYPRE_USING_SYCL) + ACF_diag_nnz = HYPRE_ONEDPL_CALL( std::count_if, + oneapi::dpl::make_zip_iterator(A_diag_ii, Soc_diag_j), + oneapi::dpl::make_zip_iterator(A_diag_ii, Soc_diag_j) + A_diag_nnz, + ACF_pred_diag ); +#else ACF_diag_nnz = HYPRE_THRUST_CALL( count_if, thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, Soc_diag_j)), thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, Soc_diag_j)) + A_diag_nnz, ACF_pred_diag ); +#endif ACF_diag_ii = hypre_TAlloc(HYPRE_Int, ACF_diag_nnz, HYPRE_MEMORY_DEVICE); ACF_diag_j = hypre_TAlloc(HYPRE_Int, ACF_diag_nnz, HYPRE_MEMORY_DEVICE); ACF_diag_a = hypre_TAlloc(HYPRE_Complex, ACF_diag_nnz, HYPRE_MEMORY_DEVICE); - new_end = HYPRE_THRUST_CALL( copy_if, - thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, Soc_diag_j, A_diag_a)), - thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, Soc_diag_j, A_diag_a)) + A_diag_nnz, - thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, Soc_diag_j)), - thrust::make_zip_iterator(thrust::make_tuple(ACF_diag_ii, ACF_diag_j, ACF_diag_a)), - ACF_pred_diag ); +#if defined(HYPRE_USING_SYCL) + auto new_end = hypreSycl_copy_if( oneapi::dpl::make_zip_iterator(A_diag_ii, Soc_diag_j, A_diag_a), + oneapi::dpl::make_zip_iterator(A_diag_ii, Soc_diag_j, A_diag_a) + A_diag_nnz, + oneapi::dpl::make_zip_iterator(A_diag_ii, Soc_diag_j), + oneapi::dpl::make_zip_iterator(ACF_diag_ii, ACF_diag_j, ACF_diag_a), + ACF_pred_diag ); + + hypre_assert( std::get<0>(new_end.base()) == ACF_diag_ii + ACF_diag_nnz ); + + hypreSycl_gather( ACF_diag_j, + ACF_diag_j + ACF_diag_nnz, + map2FC, + ACF_diag_j ); + + hypreSycl_gather( ACF_diag_ii, + ACF_diag_ii + ACF_diag_nnz, + map2FC, + ACF_diag_ii ); +#else + auto new_end = HYPRE_THRUST_CALL( copy_if, + thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, Soc_diag_j, A_diag_a)), + thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, Soc_diag_j, A_diag_a)) + A_diag_nnz, + thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, Soc_diag_j)), + thrust::make_zip_iterator(thrust::make_tuple(ACF_diag_ii, ACF_diag_j, ACF_diag_a)), + ACF_pred_diag ); hypre_assert( thrust::get<0>(new_end.get_iterator_tuple()) == ACF_diag_ii + ACF_diag_nnz ); @@ -677,21 +957,43 @@ hypre_ParCSRMatrixGenerateFFFCDevice_core( hypre_ParCSRMatrix *A, ACF_diag_ii + ACF_diag_nnz, map2FC, ACF_diag_ii ); +#endif ACF_diag_i = hypreDevice_CsrRowIndicesToPtrs(nC_local, ACF_diag_nnz, ACF_diag_ii); hypre_TFree(ACF_diag_ii, HYPRE_MEMORY_DEVICE); /* ACF Offd */ CF_pred ACF_pred_offd(CF_marker, recv_buf); +#if defined(HYPRE_USING_SYCL) + ACF_offd_nnz = HYPRE_ONEDPL_CALL( std::count_if, + oneapi::dpl::make_zip_iterator(A_offd_ii, Soc_offd_j), + oneapi::dpl::make_zip_iterator(A_offd_ii, Soc_offd_j) + A_offd_nnz, + ACF_pred_offd ); +#else ACF_offd_nnz = HYPRE_THRUST_CALL( count_if, thrust::make_zip_iterator(thrust::make_tuple(A_offd_ii, Soc_offd_j)), thrust::make_zip_iterator(thrust::make_tuple(A_offd_ii, Soc_offd_j)) + A_offd_nnz, ACF_pred_offd ); +#endif ACF_offd_ii = hypre_TAlloc(HYPRE_Int, ACF_offd_nnz, HYPRE_MEMORY_DEVICE); ACF_offd_j = hypre_TAlloc(HYPRE_Int, ACF_offd_nnz, HYPRE_MEMORY_DEVICE); ACF_offd_a = hypre_TAlloc(HYPRE_Complex, ACF_offd_nnz, HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_SYCL) + new_end = hypreSycl_copy_if( oneapi::dpl::make_zip_iterator(A_offd_ii, Soc_offd_j, A_offd_a), + oneapi::dpl::make_zip_iterator(A_offd_ii, Soc_offd_j, A_offd_a) + A_offd_nnz, + oneapi::dpl::make_zip_iterator(A_offd_ii, Soc_offd_j), + oneapi::dpl::make_zip_iterator(ACF_offd_ii, ACF_offd_j, ACF_offd_a), + ACF_pred_offd ); + + hypre_assert( std::get<0>(new_end.base()) == ACF_offd_ii + ACF_offd_nnz ); + + hypreSycl_gather( ACF_offd_ii, + ACF_offd_ii + ACF_offd_nnz, + map2FC, + ACF_offd_ii ); +#else new_end = HYPRE_THRUST_CALL( copy_if, thrust::make_zip_iterator(thrust::make_tuple(A_offd_ii, Soc_offd_j, A_offd_a)), thrust::make_zip_iterator(thrust::make_tuple(A_offd_ii, Soc_offd_j, A_offd_a)) + A_offd_nnz, @@ -706,25 +1008,58 @@ hypre_ParCSRMatrixGenerateFFFCDevice_core( hypre_ParCSRMatrix *A, ACF_offd_ii + ACF_offd_nnz, map2FC, ACF_offd_ii ); +#endif ACF_offd_i = hypreDevice_CsrRowIndicesToPtrs(nC_local, ACF_offd_nnz, ACF_offd_ii); hypre_TFree(ACF_offd_ii, HYPRE_MEMORY_DEVICE); /* col_map_offd_ACF */ - HYPRE_Int *tmp_j = hypre_TAlloc(HYPRE_Int, hypre_max(ACF_offd_nnz, num_cols_A_offd), HYPRE_MEMORY_DEVICE); + HYPRE_Int *tmp_j = hypre_TAlloc(HYPRE_Int, hypre_max(ACF_offd_nnz, num_cols_A_offd), + HYPRE_MEMORY_DEVICE); hypre_TMemcpy(tmp_j, ACF_offd_j, HYPRE_Int, ACF_offd_nnz, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); - HYPRE_THRUST_CALL( sort, +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::sort, tmp_j, tmp_j + ACF_offd_nnz ); - HYPRE_Int *tmp_end = HYPRE_THRUST_CALL( unique, + HYPRE_Int *tmp_end = HYPRE_ONEDPL_CALL( std::unique, tmp_j, tmp_j + ACF_offd_nnz ); num_cols_ACF_offd = tmp_end - tmp_j; - HYPRE_THRUST_CALL( fill_n, + HYPRE_ONEDPL_CALL( std::fill_n, offd_mark, num_cols_A_offd, 0 ); - hypreDevice_ScatterConstant(offd_mark, num_cols_ACF_offd, tmp_j, 1); + hypreDevice_ScatterConstant(offd_mark, num_cols_ACF_offd, tmp_j, (HYPRE_Int) 1); + HYPRE_ONEDPL_CALL( std::exclusive_scan, + offd_mark, + offd_mark + num_cols_A_offd, + tmp_j, + 0); + hypreSycl_gather( ACF_offd_j, + ACF_offd_j + ACF_offd_nnz, + tmp_j, + ACF_offd_j ); + col_map_offd_ACF = hypre_TAlloc(HYPRE_BigInt, num_cols_ACF_offd, HYPRE_MEMORY_DEVICE); + HYPRE_BigInt *tmp_end_big = hypreSycl_copy_if( recv_buf, + recv_buf + num_cols_A_offd, + offd_mark, + col_map_offd_ACF, + [] (const auto & x) {return x;} ); + HYPRE_ONEDPL_CALL( std::transform, + col_map_offd_ACF, + col_map_offd_ACF + num_cols_ACF_offd, + col_map_offd_ACF, + [] (const auto & x) {return -x - 1;} ); +#else + HYPRE_THRUST_CALL( sort, + tmp_j, + tmp_j + ACF_offd_nnz ); + HYPRE_Int *tmp_end = HYPRE_THRUST_CALL( unique, + tmp_j, + tmp_j + ACF_offd_nnz ); + num_cols_ACF_offd = tmp_end - tmp_j; + hypreDevice_IntFilln( offd_mark, num_cols_A_offd, 0 ); + hypreDevice_ScatterConstant(offd_mark, num_cols_ACF_offd, tmp_j, (HYPRE_Int) 1); HYPRE_THRUST_CALL( exclusive_scan, offd_mark, offd_mark + num_cols_A_offd, @@ -736,11 +1071,12 @@ hypre_ParCSRMatrixGenerateFFFCDevice_core( hypre_ParCSRMatrix *A, ACF_offd_j ); col_map_offd_ACF = hypre_TAlloc(HYPRE_BigInt, num_cols_ACF_offd, HYPRE_MEMORY_DEVICE); HYPRE_BigInt *tmp_end_big = HYPRE_THRUST_CALL( copy_if, - thrust::make_transform_iterator(recv_buf, -_1-1), - thrust::make_transform_iterator(recv_buf, -_1-1) + num_cols_A_offd, + thrust::make_transform_iterator(recv_buf, -_1 - 1), + thrust::make_transform_iterator(recv_buf, -_1 - 1) + num_cols_A_offd, offd_mark, col_map_offd_ACF, thrust::identity()); +#endif hypre_assert(tmp_end_big - col_map_offd_ACF == num_cols_ACF_offd); hypre_TFree(tmp_j, HYPRE_MEMORY_DEVICE); @@ -768,7 +1104,8 @@ hypre_ParCSRMatrixGenerateFFFCDevice_core( hypre_ParCSRMatrix *A, hypre_CSRMatrixMemoryLocation(ACF_offd) = HYPRE_MEMORY_DEVICE; hypre_ParCSRMatrixDeviceColMapOffd(ACF) = col_map_offd_ACF; - hypre_ParCSRMatrixColMapOffd(ACF) = hypre_TAlloc(HYPRE_BigInt, num_cols_ACF_offd, HYPRE_MEMORY_HOST); + hypre_ParCSRMatrixColMapOffd(ACF) = hypre_TAlloc(HYPRE_BigInt, num_cols_ACF_offd, + HYPRE_MEMORY_HOST); hypre_TMemcpy(hypre_ParCSRMatrixColMapOffd(ACF), col_map_offd_ACF, HYPRE_BigInt, num_cols_ACF_offd, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); @@ -793,22 +1130,48 @@ hypre_ParCSRMatrixGenerateFFFCDevice_core( hypre_ParCSRMatrix *A, /* ACC Diag */ CC_pred ACC_pred_diag(CF_marker, CF_marker); +#if defined(HYPRE_USING_SYCL) + ACC_diag_nnz = HYPRE_ONEDPL_CALL( std::count_if, + oneapi::dpl::make_zip_iterator(A_diag_ii, Soc_diag_j), + oneapi::dpl::make_zip_iterator(A_diag_ii, Soc_diag_j) + A_diag_nnz, + ACC_pred_diag ); +#else ACC_diag_nnz = HYPRE_THRUST_CALL( count_if, thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, Soc_diag_j)), thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, Soc_diag_j)) + A_diag_nnz, ACC_pred_diag ); +#endif ACC_diag_ii = hypre_TAlloc(HYPRE_Int, ACC_diag_nnz, HYPRE_MEMORY_DEVICE); ACC_diag_j = hypre_TAlloc(HYPRE_Int, ACC_diag_nnz, HYPRE_MEMORY_DEVICE); ACC_diag_a = hypre_TAlloc(HYPRE_Complex, ACC_diag_nnz, HYPRE_MEMORY_DEVICE); /* Notice that we cannot use Soc_diag_j in the first two arguments since the diagonal is marked as -2 */ - new_end = HYPRE_THRUST_CALL( copy_if, - thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, A_diag_j, A_diag_a)), - thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, A_diag_j, A_diag_a)) + A_diag_nnz, - thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, Soc_diag_j)), - thrust::make_zip_iterator(thrust::make_tuple(ACC_diag_ii, ACC_diag_j, ACC_diag_a)), - ACC_pred_diag ); +#if defined(HYPRE_USING_SYCL) + auto new_end = hypreSycl_copy_if( oneapi::dpl::make_zip_iterator(A_diag_ii, A_diag_j, A_diag_a), + oneapi::dpl::make_zip_iterator(A_diag_ii, A_diag_j, A_diag_a) + A_diag_nnz, + oneapi::dpl::make_zip_iterator(A_diag_ii, Soc_diag_j), + oneapi::dpl::make_zip_iterator(ACC_diag_ii, ACC_diag_j, ACC_diag_a), + ACC_pred_diag ); + + hypre_assert( std::get<0>(new_end.base()) == ACC_diag_ii + ACC_diag_nnz ); + + hypreSycl_gather( ACC_diag_j, + ACC_diag_j + ACC_diag_nnz, + map2FC, + ACC_diag_j ); + + hypreSycl_gather( ACC_diag_ii, + ACC_diag_ii + ACC_diag_nnz, + map2FC, + ACC_diag_ii ); +#else + auto new_end = HYPRE_THRUST_CALL( copy_if, + thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, A_diag_j, A_diag_a)), + thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, A_diag_j, A_diag_a)) + A_diag_nnz, + thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, Soc_diag_j)), + thrust::make_zip_iterator(thrust::make_tuple(ACC_diag_ii, ACC_diag_j, ACC_diag_a)), + ACC_pred_diag ); hypre_assert( thrust::get<0>(new_end.get_iterator_tuple()) == ACC_diag_ii + ACC_diag_nnz ); @@ -823,21 +1186,43 @@ hypre_ParCSRMatrixGenerateFFFCDevice_core( hypre_ParCSRMatrix *A, ACC_diag_ii + ACC_diag_nnz, map2FC, ACC_diag_ii ); +#endif ACC_diag_i = hypreDevice_CsrRowIndicesToPtrs(nC_local, ACC_diag_nnz, ACC_diag_ii); hypre_TFree(ACC_diag_ii, HYPRE_MEMORY_DEVICE); /* ACC Offd */ CC_pred ACC_pred_offd(CF_marker, recv_buf); +#if defined(HYPRE_USING_SYCL) + ACC_offd_nnz = HYPRE_ONEDPL_CALL( std::count_if, + oneapi::dpl::make_zip_iterator(A_offd_ii, Soc_offd_j), + oneapi::dpl::make_zip_iterator(A_offd_ii, Soc_offd_j) + A_offd_nnz, + ACC_pred_offd ); +#else ACC_offd_nnz = HYPRE_THRUST_CALL( count_if, thrust::make_zip_iterator(thrust::make_tuple(A_offd_ii, Soc_offd_j)), thrust::make_zip_iterator(thrust::make_tuple(A_offd_ii, Soc_offd_j)) + A_offd_nnz, ACC_pred_offd ); +#endif ACC_offd_ii = hypre_TAlloc(HYPRE_Int, ACC_offd_nnz, HYPRE_MEMORY_DEVICE); ACC_offd_j = hypre_TAlloc(HYPRE_Int, ACC_offd_nnz, HYPRE_MEMORY_DEVICE); ACC_offd_a = hypre_TAlloc(HYPRE_Complex, ACC_offd_nnz, HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_SYCL) + new_end = hypreSycl_copy_if( oneapi::dpl::make_zip_iterator(A_offd_ii, Soc_offd_j, A_offd_a), + oneapi::dpl::make_zip_iterator(A_offd_ii, Soc_offd_j, A_offd_a) + A_offd_nnz, + oneapi::dpl::make_zip_iterator(A_offd_ii, Soc_offd_j), + oneapi::dpl::make_zip_iterator(ACC_offd_ii, ACC_offd_j, ACC_offd_a), + ACC_pred_offd ); + + hypre_assert( std::get<0>(new_end.base()) == ACC_offd_ii + ACC_offd_nnz ); + + hypreSycl_gather( ACC_offd_ii, + ACC_offd_ii + ACC_offd_nnz, + map2FC, + ACC_offd_ii ); +#else new_end = HYPRE_THRUST_CALL( copy_if, thrust::make_zip_iterator(thrust::make_tuple(A_offd_ii, Soc_offd_j, A_offd_a)), thrust::make_zip_iterator(thrust::make_tuple(A_offd_ii, Soc_offd_j, A_offd_a)) + A_offd_nnz, @@ -852,25 +1237,53 @@ hypre_ParCSRMatrixGenerateFFFCDevice_core( hypre_ParCSRMatrix *A, ACC_offd_ii + ACC_offd_nnz, map2FC, ACC_offd_ii ); +#endif ACC_offd_i = hypreDevice_CsrRowIndicesToPtrs(nC_local, ACC_offd_nnz, ACC_offd_ii); hypre_TFree(ACC_offd_ii, HYPRE_MEMORY_DEVICE); /* col_map_offd_ACC */ - HYPRE_Int *tmp_j = hypre_TAlloc(HYPRE_Int, hypre_max(ACC_offd_nnz, num_cols_A_offd), HYPRE_MEMORY_DEVICE); + HYPRE_Int *tmp_j = hypre_TAlloc(HYPRE_Int, hypre_max(ACC_offd_nnz, num_cols_A_offd), + HYPRE_MEMORY_DEVICE); hypre_TMemcpy(tmp_j, ACC_offd_j, HYPRE_Int, ACC_offd_nnz, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); - HYPRE_THRUST_CALL( sort, +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::sort, tmp_j, tmp_j + ACC_offd_nnz ); - HYPRE_Int *tmp_end = HYPRE_THRUST_CALL( unique, + HYPRE_Int *tmp_end = HYPRE_ONEDPL_CALL( std::unique, tmp_j, tmp_j + ACC_offd_nnz ); num_cols_ACC_offd = tmp_end - tmp_j; - HYPRE_THRUST_CALL( fill_n, + HYPRE_ONEDPL_CALL( std::fill_n, offd_mark, num_cols_A_offd, 0 ); - hypreDevice_ScatterConstant(offd_mark, num_cols_ACC_offd, tmp_j, 1); + hypreDevice_ScatterConstant(offd_mark, num_cols_ACC_offd, tmp_j, (HYPRE_Int) 1); + HYPRE_ONEDPL_CALL( std::exclusive_scan, + offd_mark, + offd_mark + num_cols_A_offd, + tmp_j, + 0); + hypreSycl_gather( ACC_offd_j, + ACC_offd_j + ACC_offd_nnz, + tmp_j, + ACC_offd_j ); + col_map_offd_ACC = hypre_TAlloc(HYPRE_BigInt, num_cols_ACC_offd, HYPRE_MEMORY_DEVICE); + HYPRE_BigInt *tmp_end_big = hypreSycl_copy_if( recv_buf, + recv_buf + num_cols_A_offd, + offd_mark, + col_map_offd_ACC, + [] (const auto & x) {return x;} ); +#else + HYPRE_THRUST_CALL( sort, + tmp_j, + tmp_j + ACC_offd_nnz ); + HYPRE_Int *tmp_end = HYPRE_THRUST_CALL( unique, + tmp_j, + tmp_j + ACC_offd_nnz ); + num_cols_ACC_offd = tmp_end - tmp_j; + hypreDevice_IntFilln( offd_mark, num_cols_A_offd, 0 ); + hypreDevice_ScatterConstant(offd_mark, num_cols_ACC_offd, tmp_j, (HYPRE_Int) 1); HYPRE_THRUST_CALL( exclusive_scan, offd_mark, offd_mark + num_cols_A_offd, @@ -887,6 +1300,7 @@ hypre_ParCSRMatrixGenerateFFFCDevice_core( hypre_ParCSRMatrix *A, offd_mark, col_map_offd_ACC, thrust::identity()); +#endif hypre_assert(tmp_end_big - col_map_offd_ACC == num_cols_ACC_offd); hypre_TFree(tmp_j, HYPRE_MEMORY_DEVICE); @@ -914,7 +1328,8 @@ hypre_ParCSRMatrixGenerateFFFCDevice_core( hypre_ParCSRMatrix *A, hypre_CSRMatrixMemoryLocation(ACC_offd) = HYPRE_MEMORY_DEVICE; hypre_ParCSRMatrixDeviceColMapOffd(ACC) = col_map_offd_ACC; - hypre_ParCSRMatrixColMapOffd(ACC) = hypre_TAlloc(HYPRE_BigInt, num_cols_ACC_offd, HYPRE_MEMORY_HOST); + hypre_ParCSRMatrixColMapOffd(ACC) = hypre_TAlloc(HYPRE_BigInt, num_cols_ACC_offd, + HYPRE_MEMORY_HOST); hypre_TMemcpy(hypre_ParCSRMatrixColMapOffd(ACC), col_map_offd_ACC, HYPRE_BigInt, num_cols_ACC_offd, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); @@ -932,9 +1347,15 @@ hypre_ParCSRMatrixGenerateFFFCDevice_core( hypre_ParCSRMatrix *A, hypre_TFree(map2F2, HYPRE_MEMORY_DEVICE); hypre_TFree(recv_buf, HYPRE_MEMORY_DEVICE); + hypre_GpuProfilingPopRange(); + return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixGenerateFFFCDevice + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_ParCSRMatrixGenerateFFFCDevice( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, @@ -943,9 +1364,15 @@ hypre_ParCSRMatrixGenerateFFFCDevice( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **AFC_ptr, hypre_ParCSRMatrix **AFF_ptr ) { - return hypre_ParCSRMatrixGenerateFFFCDevice_core(A, CF_marker, cpts_starts, S, AFC_ptr, AFF_ptr, NULL, NULL, 1); + return hypre_ParCSRMatrixGenerateFFFCDevice_core(A, CF_marker, cpts_starts, S, + AFC_ptr, AFF_ptr, + NULL, NULL, 1); } +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixGenerateFFFC3Device + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_ParCSRMatrixGenerateFFFC3Device( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, @@ -954,9 +1381,15 @@ hypre_ParCSRMatrixGenerateFFFC3Device( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **AFC_ptr, hypre_ParCSRMatrix **AFF_ptr) { - return hypre_ParCSRMatrixGenerateFFFCDevice_core(A, CF_marker, cpts_starts, S, AFC_ptr, AFF_ptr, NULL, NULL, 2); + return hypre_ParCSRMatrixGenerateFFFCDevice_core(A, CF_marker, cpts_starts, S, + AFC_ptr, AFF_ptr, + NULL, NULL, 2); } +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixGenerateFFCFDevice + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_ParCSRMatrixGenerateFFCFDevice( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, @@ -965,9 +1398,14 @@ hypre_ParCSRMatrixGenerateFFCFDevice( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **ACF_ptr, hypre_ParCSRMatrix **AFF_ptr ) { - return hypre_ParCSRMatrixGenerateFFFCDevice_core(A, CF_marker, cpts_starts, S, NULL, AFF_ptr, ACF_ptr, NULL, 1); + return hypre_ParCSRMatrixGenerateFFFCDevice_core(A, CF_marker, cpts_starts, S, + NULL, AFF_ptr, + ACF_ptr, NULL, 1); } +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixGenerateCFDevice + *--------------------------------------------------------------------------*/ HYPRE_Int hypre_ParCSRMatrixGenerateCFDevice( hypre_ParCSRMatrix *A, @@ -976,9 +1414,15 @@ hypre_ParCSRMatrixGenerateCFDevice( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *S, hypre_ParCSRMatrix **ACF_ptr) { - return hypre_ParCSRMatrixGenerateFFFCDevice_core(A, CF_marker, cpts_starts, S, NULL, NULL, ACF_ptr, NULL, 1); + return hypre_ParCSRMatrixGenerateFFFCDevice_core(A, CF_marker, cpts_starts, S, + NULL, NULL, + ACF_ptr, NULL, 1); } +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixGenerateCCDevice + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_ParCSRMatrixGenerateCCDevice( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, @@ -986,9 +1430,32 @@ hypre_ParCSRMatrixGenerateCCDevice( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *S, hypre_ParCSRMatrix **ACC_ptr) { - return hypre_ParCSRMatrixGenerateFFFCDevice_core(A, CF_marker, cpts_starts, S, NULL, NULL, NULL, ACC_ptr, 1); + return hypre_ParCSRMatrixGenerateFFFCDevice_core(A, CF_marker, cpts_starts, S, + NULL, NULL, + NULL, ACC_ptr, 1); +} + +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixGenerateCCCFDevice + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixGenerateCCCFDevice( hypre_ParCSRMatrix *A, + HYPRE_Int *CF_marker, + HYPRE_BigInt *cpts_starts, + hypre_ParCSRMatrix *S, + hypre_ParCSRMatrix **ACF_ptr, + hypre_ParCSRMatrix **ACC_ptr) +{ + return hypre_ParCSRMatrixGenerateFFFCDevice_core(A, CF_marker, cpts_starts, S, + NULL, NULL, + ACF_ptr, ACC_ptr, 1); } +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixGenerate1DCFDevice + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_ParCSRMatrixGenerate1DCFDevice( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, @@ -1024,7 +1491,7 @@ hypre_ParCSRMatrixGenerate1DCFDevice( hypre_ParCSRMatrix *A, HYPRE_Int my_id, num_procs; /* nF and nC */ HYPRE_Int n_local, /*nF_local,*/ nC_local; - HYPRE_BigInt *fpts_starts, *row_starts; + HYPRE_BigInt fpts_starts[2], *row_starts; HYPRE_BigInt /*nF_global,*/ nC_global; HYPRE_BigInt F_first, C_first; /* work arrays */ @@ -1045,13 +1512,12 @@ hypre_ParCSRMatrixGenerate1DCFDevice( hypre_ParCSRMatrix *A, hypre_ParCSRMatrixDeviceColMapOffd(A) = col_map_offd_A; } - if (my_id == (num_procs -1)) + if (my_id == (num_procs - 1)) { nC_global = cpts_starts[1]; } - hypre_MPI_Bcast(&nC_global, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); + hypre_MPI_Bcast(&nC_global, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); nC_local = (HYPRE_Int) (cpts_starts[1] - cpts_starts[0]); - fpts_starts = hypre_TAlloc(HYPRE_BigInt, 2, HYPRE_MEMORY_HOST); fpts_starts[0] = row_starts[0] - cpts_starts[0]; fpts_starts[1] = row_starts[1] - cpts_starts[1]; F_first = fpts_starts[0]; @@ -1065,6 +1531,27 @@ hypre_ParCSRMatrixGenerate1DCFDevice( hypre_ParCSRMatrix *A, itmp = hypre_TAlloc(HYPRE_Int, n_local, HYPRE_MEMORY_DEVICE); recv_buf = hypre_TAlloc(HYPRE_BigInt, num_cols_A_offd, HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_SYCL) + /* map from all points (i.e, F+C) to F/C indices */ + HYPRE_ONEDPL_CALL( std::exclusive_scan, + oneapi::dpl::make_transform_iterator(CF_marker, is_negative()), + oneapi::dpl::make_transform_iterator(CF_marker + n_local, is_negative()), + map2FC, /* F */ + HYPRE_Int(0) ); /* *MUST* pass init value since input and output types diff. */ + + HYPRE_ONEDPL_CALL( std::exclusive_scan, + oneapi::dpl::make_transform_iterator(CF_marker, is_nonnegative()), + oneapi::dpl::make_transform_iterator(CF_marker + n_local, is_nonnegative()), + itmp, /* C */ + HYPRE_Int(0) ); /* *MUST* pass init value since input and output types diff. */ + + hypreSycl_scatter_if( itmp, + itmp + n_local, + oneapi::dpl::counting_iterator(0), + CF_marker, + map2FC, /* FC combined */ + is_nonnegative() ); +#else /* map from all points (i.e, F+C) to F/C indices */ HYPRE_THRUST_CALL( exclusive_scan, thrust::make_transform_iterator(CF_marker, is_negative()), @@ -1084,6 +1571,7 @@ hypre_ParCSRMatrixGenerate1DCFDevice( hypre_ParCSRMatrix *A, thrust::counting_iterator(0), thrust::make_transform_iterator(CF_marker, is_nonnegative()), map2FC ); /* FC combined */ +#endif hypre_TFree(itmp, HYPRE_MEMORY_DEVICE); @@ -1093,19 +1581,35 @@ hypre_ParCSRMatrixGenerate1DCFDevice( hypre_ParCSRMatrix *A, hypre_ParCSRCommPkgCopySendMapElmtsToDevice(comm_pkg); FFFC_functor functor(F_first, C_first); +#if defined(HYPRE_USING_SYCL) + auto zip = oneapi::dpl::make_zip_iterator(map2FC, CF_marker); + hypreSycl_gather( hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), + hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + num_elem_send, + oneapi::dpl::make_transform_iterator(zip, functor), + send_buf ); +#else HYPRE_THRUST_CALL( gather, hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + num_elem_send, - thrust::make_transform_iterator(thrust::make_zip_iterator(thrust::make_tuple(map2FC, CF_marker)), functor), + thrust::make_transform_iterator(thrust::make_zip_iterator(thrust::make_tuple(map2FC, CF_marker)), + functor), send_buf ); +#endif + +#if defined(HYPRE_USING_THRUST_NOSYNC) + /* RL: make sure send_buf is ready before issuing GPU-GPU MPI */ + if (hypre_GetGpuAwareMPI()) + { + hypre_ForceSyncComputeStream(); + } +#endif - comm_handle = hypre_ParCSRCommHandleCreate_v2(21, comm_pkg, HYPRE_MEMORY_DEVICE, send_buf, HYPRE_MEMORY_DEVICE, recv_buf); + comm_handle = hypre_ParCSRCommHandleCreate_v2(21, comm_pkg, HYPRE_MEMORY_DEVICE, send_buf, + HYPRE_MEMORY_DEVICE, recv_buf); hypre_ParCSRCommHandleDestroy(comm_handle); hypre_TFree(send_buf, HYPRE_MEMORY_DEVICE); - thrust::zip_iterator< thrust::tuple > new_end; - A_diag_ii = hypre_TAlloc(HYPRE_Int, A_diag_nnz, HYPRE_MEMORY_DEVICE); A_offd_ii = hypre_TAlloc(HYPRE_Int, A_offd_nnz, HYPRE_MEMORY_DEVICE); offd_mark = hypre_TAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_DEVICE); @@ -1127,22 +1631,43 @@ hypre_ParCSRMatrixGenerate1DCFDevice( hypre_ParCSRMatrix *A, /* ACX Diag */ CX_pred ACX_pred(CF_marker); +#if defined(HYPRE_USING_SYCL) + ACX_diag_nnz = HYPRE_ONEDPL_CALL( std::count_if, + oneapi::dpl::make_zip_iterator(A_diag_ii, Soc_diag_j), + oneapi::dpl::make_zip_iterator(A_diag_ii, Soc_diag_j) + A_diag_nnz, + ACX_pred ); +#else ACX_diag_nnz = HYPRE_THRUST_CALL( count_if, thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, Soc_diag_j)), thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, Soc_diag_j)) + A_diag_nnz, ACX_pred ); +#endif ACX_diag_ii = hypre_TAlloc(HYPRE_Int, ACX_diag_nnz, HYPRE_MEMORY_DEVICE); ACX_diag_j = hypre_TAlloc(HYPRE_Int, ACX_diag_nnz, HYPRE_MEMORY_DEVICE); ACX_diag_a = hypre_TAlloc(HYPRE_Complex, ACX_diag_nnz, HYPRE_MEMORY_DEVICE); /* Notice that we cannot use Soc_diag_j in the first two arguments since the diagonal is marked as -2 */ - new_end = HYPRE_THRUST_CALL( copy_if, - thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, A_diag_j, A_diag_a)), - thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, A_diag_j, A_diag_a)) + A_diag_nnz, - thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, Soc_diag_j)), - thrust::make_zip_iterator(thrust::make_tuple(ACX_diag_ii, ACX_diag_j, ACX_diag_a)), - ACX_pred ); +#if defined(HYPRE_USING_SYCL) + auto new_end = hypreSycl_copy_if( oneapi::dpl::make_zip_iterator(A_diag_ii, A_diag_j, A_diag_a), + oneapi::dpl::make_zip_iterator(A_diag_ii, A_diag_j, A_diag_a) + A_diag_nnz, + oneapi::dpl::make_zip_iterator(A_diag_ii, Soc_diag_j), + oneapi::dpl::make_zip_iterator(ACX_diag_ii, ACX_diag_j, ACX_diag_a), + ACX_pred ); + + hypre_assert( std::get<0>(new_end.base()) == ACX_diag_ii + ACX_diag_nnz ); + + hypreSycl_gather( ACX_diag_ii, + ACX_diag_ii + ACX_diag_nnz, + map2FC, + ACX_diag_ii ); +#else + auto new_end = HYPRE_THRUST_CALL( copy_if, + thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, A_diag_j, A_diag_a)), + thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, A_diag_j, A_diag_a)) + A_diag_nnz, + thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, Soc_diag_j)), + thrust::make_zip_iterator(thrust::make_tuple(ACX_diag_ii, ACX_diag_j, ACX_diag_a)), + ACX_pred ); hypre_assert( thrust::get<0>(new_end.get_iterator_tuple()) == ACX_diag_ii + ACX_diag_nnz ); @@ -1151,20 +1676,42 @@ hypre_ParCSRMatrixGenerate1DCFDevice( hypre_ParCSRMatrix *A, ACX_diag_ii + ACX_diag_nnz, map2FC, ACX_diag_ii ); +#endif ACX_diag_i = hypreDevice_CsrRowIndicesToPtrs(nC_local, ACX_diag_nnz, ACX_diag_ii); hypre_TFree(ACX_diag_ii, HYPRE_MEMORY_DEVICE); /* ACX Offd */ +#if defined(HYPRE_USING_SYCL) + ACX_offd_nnz = HYPRE_ONEDPL_CALL( std::count_if, + oneapi::dpl::make_zip_iterator(A_offd_ii, Soc_offd_j), + oneapi::dpl::make_zip_iterator(A_offd_ii, Soc_offd_j) + A_offd_nnz, + ACX_pred ); +#else ACX_offd_nnz = HYPRE_THRUST_CALL( count_if, thrust::make_zip_iterator(thrust::make_tuple(A_offd_ii, Soc_offd_j)), thrust::make_zip_iterator(thrust::make_tuple(A_offd_ii, Soc_offd_j)) + A_offd_nnz, ACX_pred ); +#endif ACX_offd_ii = hypre_TAlloc(HYPRE_Int, ACX_offd_nnz, HYPRE_MEMORY_DEVICE); ACX_offd_j = hypre_TAlloc(HYPRE_Int, ACX_offd_nnz, HYPRE_MEMORY_DEVICE); ACX_offd_a = hypre_TAlloc(HYPRE_Complex, ACX_offd_nnz, HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_SYCL) + new_end = hypreSycl_copy_if( oneapi::dpl::make_zip_iterator(A_offd_ii, Soc_offd_j, A_offd_a), + oneapi::dpl::make_zip_iterator(A_offd_ii, Soc_offd_j, A_offd_a) + A_offd_nnz, + oneapi::dpl::make_zip_iterator(A_offd_ii, Soc_offd_j), + oneapi::dpl::make_zip_iterator(ACX_offd_ii, ACX_offd_j, ACX_offd_a), + ACX_pred ); + + hypre_assert( std::get<0>(new_end.base()) == ACX_offd_ii + ACX_offd_nnz ); + + hypreSycl_gather( ACX_offd_ii, + ACX_offd_ii + ACX_offd_nnz, + map2FC, + ACX_offd_ii ); +#else new_end = HYPRE_THRUST_CALL( copy_if, thrust::make_zip_iterator(thrust::make_tuple(A_offd_ii, Soc_offd_j, A_offd_a)), thrust::make_zip_iterator(thrust::make_tuple(A_offd_ii, Soc_offd_j, A_offd_a)) + A_offd_nnz, @@ -1179,25 +1726,50 @@ hypre_ParCSRMatrixGenerate1DCFDevice( hypre_ParCSRMatrix *A, ACX_offd_ii + ACX_offd_nnz, map2FC, ACX_offd_ii ); +#endif ACX_offd_i = hypreDevice_CsrRowIndicesToPtrs(nC_local, ACX_offd_nnz, ACX_offd_ii); hypre_TFree(ACX_offd_ii, HYPRE_MEMORY_DEVICE); /* col_map_offd_ACX */ - HYPRE_Int *tmp_j = hypre_TAlloc(HYPRE_Int, hypre_max(ACX_offd_nnz, num_cols_A_offd), HYPRE_MEMORY_DEVICE); + HYPRE_Int *tmp_j = hypre_TAlloc(HYPRE_Int, hypre_max(ACX_offd_nnz, num_cols_A_offd), + HYPRE_MEMORY_DEVICE); hypre_TMemcpy(tmp_j, ACX_offd_j, HYPRE_Int, ACX_offd_nnz, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::sort, + tmp_j, + tmp_j + ACX_offd_nnz ); + HYPRE_Int *tmp_end = HYPRE_ONEDPL_CALL( std::unique, + tmp_j, + tmp_j + ACX_offd_nnz ); +#else HYPRE_THRUST_CALL( sort, tmp_j, tmp_j + ACX_offd_nnz ); HYPRE_Int *tmp_end = HYPRE_THRUST_CALL( unique, tmp_j, tmp_j + ACX_offd_nnz ); +#endif num_cols_ACX_offd = tmp_end - tmp_j; - HYPRE_THRUST_CALL( fill_n, + hypreDevice_IntFilln( offd_mark, num_cols_A_offd, 0 ); + hypreDevice_ScatterConstant(offd_mark, num_cols_ACX_offd, tmp_j, (HYPRE_Int) 1); +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::exclusive_scan, offd_mark, - num_cols_A_offd, + offd_mark + num_cols_A_offd, + tmp_j, 0 ); - hypreDevice_ScatterConstant(offd_mark, num_cols_ACX_offd, tmp_j, 1); + hypreSycl_gather( ACX_offd_j, + ACX_offd_j + ACX_offd_nnz, + tmp_j, + ACX_offd_j ); + col_map_offd_ACX = hypre_TAlloc(HYPRE_BigInt, num_cols_ACX_offd, HYPRE_MEMORY_DEVICE); + HYPRE_BigInt *tmp_end_big = hypreSycl_copy_if( col_map_offd_A, + col_map_offd_A + num_cols_A_offd, + offd_mark, + col_map_offd_ACX, + [] (const auto & x) {return x;} ); +#else HYPRE_THRUST_CALL( exclusive_scan, offd_mark, offd_mark + num_cols_A_offd, @@ -1214,6 +1786,7 @@ hypre_ParCSRMatrixGenerate1DCFDevice( hypre_ParCSRMatrix *A, offd_mark, col_map_offd_ACX, thrust::identity()); +#endif hypre_assert(tmp_end_big - col_map_offd_ACX == num_cols_ACX_offd); hypre_TFree(tmp_j, HYPRE_MEMORY_DEVICE); @@ -1241,7 +1814,8 @@ hypre_ParCSRMatrixGenerate1DCFDevice( hypre_ParCSRMatrix *A, hypre_CSRMatrixMemoryLocation(ACX_offd) = HYPRE_MEMORY_DEVICE; hypre_ParCSRMatrixDeviceColMapOffd(ACX) = col_map_offd_ACX; - hypre_ParCSRMatrixColMapOffd(ACX) = hypre_TAlloc(HYPRE_BigInt, num_cols_ACX_offd, HYPRE_MEMORY_HOST); + hypre_ParCSRMatrixColMapOffd(ACX) = hypre_TAlloc(HYPRE_BigInt, num_cols_ACX_offd, + HYPRE_MEMORY_HOST); hypre_TMemcpy(hypre_ParCSRMatrixColMapOffd(ACX), col_map_offd_ACX, HYPRE_BigInt, num_cols_ACX_offd, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); @@ -1266,22 +1840,43 @@ hypre_ParCSRMatrixGenerate1DCFDevice( hypre_ParCSRMatrix *A, /* AXC Diag */ XC_pred AXC_pred_diag(CF_marker); +#if defined(HYPRE_USING_SYCL) + AXC_diag_nnz = HYPRE_ONEDPL_CALL( std::count_if, + oneapi::dpl::make_zip_iterator(A_diag_ii, Soc_diag_j), + oneapi::dpl::make_zip_iterator(A_diag_ii, Soc_diag_j) + A_diag_nnz, + AXC_pred_diag ); +#else AXC_diag_nnz = HYPRE_THRUST_CALL( count_if, thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, Soc_diag_j)), thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, Soc_diag_j)) + A_diag_nnz, AXC_pred_diag ); +#endif AXC_diag_ii = hypre_TAlloc(HYPRE_Int, AXC_diag_nnz, HYPRE_MEMORY_DEVICE); AXC_diag_j = hypre_TAlloc(HYPRE_Int, AXC_diag_nnz, HYPRE_MEMORY_DEVICE); AXC_diag_a = hypre_TAlloc(HYPRE_Complex, AXC_diag_nnz, HYPRE_MEMORY_DEVICE); /* Notice that we cannot use Soc_diag_j in the first two arguments since the diagonal is marked as -2 */ - new_end = HYPRE_THRUST_CALL( copy_if, - thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, A_diag_j, A_diag_a)), - thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, A_diag_j, A_diag_a)) + A_diag_nnz, - thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, Soc_diag_j)), - thrust::make_zip_iterator(thrust::make_tuple(AXC_diag_ii, AXC_diag_j, AXC_diag_a)), - AXC_pred_diag ); +#if defined(HYPRE_USING_SYCL) + auto new_end = hypreSycl_copy_if( oneapi::dpl::make_zip_iterator(A_diag_ii, A_diag_j, A_diag_a), + oneapi::dpl::make_zip_iterator(A_diag_ii, A_diag_j, A_diag_a) + A_diag_nnz, + oneapi::dpl::make_zip_iterator(A_diag_ii, Soc_diag_j), + oneapi::dpl::make_zip_iterator(AXC_diag_ii, AXC_diag_j, AXC_diag_a), + AXC_pred_diag ); + + hypre_assert( std::get<0>(new_end.base()) == AXC_diag_ii + AXC_diag_nnz ); + + hypreSycl_gather( AXC_diag_j, + AXC_diag_j + AXC_diag_nnz, + map2FC, + AXC_diag_j ); +#else + auto new_end = HYPRE_THRUST_CALL( copy_if, + thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, A_diag_j, A_diag_a)), + thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, A_diag_j, A_diag_a)) + A_diag_nnz, + thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, Soc_diag_j)), + thrust::make_zip_iterator(thrust::make_tuple(AXC_diag_ii, AXC_diag_j, AXC_diag_a)), + AXC_pred_diag ); hypre_assert( thrust::get<0>(new_end.get_iterator_tuple()) == AXC_diag_ii + AXC_diag_nnz ); @@ -1290,21 +1885,38 @@ hypre_ParCSRMatrixGenerate1DCFDevice( hypre_ParCSRMatrix *A, AXC_diag_j + AXC_diag_nnz, map2FC, AXC_diag_j ); +#endif AXC_diag_i = hypreDevice_CsrRowIndicesToPtrs(n_local, AXC_diag_nnz, AXC_diag_ii); hypre_TFree(AXC_diag_ii, HYPRE_MEMORY_DEVICE); /* AXC Offd */ XC_pred AXC_pred_offd(recv_buf); +#if defined(HYPRE_USING_SYCL) + AXC_offd_nnz = HYPRE_ONEDPL_CALL( std::count_if, + oneapi::dpl::make_zip_iterator(A_offd_ii, Soc_offd_j), + oneapi::dpl::make_zip_iterator(A_offd_ii, Soc_offd_j) + A_offd_nnz, + AXC_pred_offd ); +#else AXC_offd_nnz = HYPRE_THRUST_CALL( count_if, thrust::make_zip_iterator(thrust::make_tuple(A_offd_ii, Soc_offd_j)), thrust::make_zip_iterator(thrust::make_tuple(A_offd_ii, Soc_offd_j)) + A_offd_nnz, AXC_pred_offd ); +#endif AXC_offd_ii = hypre_TAlloc(HYPRE_Int, AXC_offd_nnz, HYPRE_MEMORY_DEVICE); AXC_offd_j = hypre_TAlloc(HYPRE_Int, AXC_offd_nnz, HYPRE_MEMORY_DEVICE); AXC_offd_a = hypre_TAlloc(HYPRE_Complex, AXC_offd_nnz, HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_SYCL) + new_end = hypreSycl_copy_if( oneapi::dpl::make_zip_iterator(A_offd_ii, Soc_offd_j, A_offd_a), + oneapi::dpl::make_zip_iterator(A_offd_ii, Soc_offd_j, A_offd_a) + A_offd_nnz, + oneapi::dpl::make_zip_iterator(A_offd_ii, Soc_offd_j), + oneapi::dpl::make_zip_iterator(AXC_offd_ii, AXC_offd_j, AXC_offd_a), + AXC_pred_offd ); + + hypre_assert( std::get<0>(new_end.base()) == AXC_offd_ii + AXC_offd_nnz ); +#else new_end = HYPRE_THRUST_CALL( copy_if, thrust::make_zip_iterator(thrust::make_tuple(A_offd_ii, Soc_offd_j, A_offd_a)), thrust::make_zip_iterator(thrust::make_tuple(A_offd_ii, Soc_offd_j, A_offd_a)) + A_offd_nnz, @@ -1313,25 +1925,50 @@ hypre_ParCSRMatrixGenerate1DCFDevice( hypre_ParCSRMatrix *A, AXC_pred_offd ); hypre_assert( thrust::get<0>(new_end.get_iterator_tuple()) == AXC_offd_ii + AXC_offd_nnz ); +#endif AXC_offd_i = hypreDevice_CsrRowIndicesToPtrs(n_local, AXC_offd_nnz, AXC_offd_ii); hypre_TFree(AXC_offd_ii, HYPRE_MEMORY_DEVICE); /* col_map_offd_AXC */ - HYPRE_Int *tmp_j = hypre_TAlloc(HYPRE_Int, hypre_max(AXC_offd_nnz, num_cols_A_offd), HYPRE_MEMORY_DEVICE); + HYPRE_Int *tmp_j = hypre_TAlloc(HYPRE_Int, hypre_max(AXC_offd_nnz, num_cols_A_offd), + HYPRE_MEMORY_DEVICE); hypre_TMemcpy(tmp_j, AXC_offd_j, HYPRE_Int, AXC_offd_nnz, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::sort, + tmp_j, + tmp_j + AXC_offd_nnz ); + HYPRE_Int *tmp_end = HYPRE_ONEDPL_CALL( std::unique, + tmp_j, + tmp_j + AXC_offd_nnz ); +#else HYPRE_THRUST_CALL( sort, tmp_j, tmp_j + AXC_offd_nnz ); HYPRE_Int *tmp_end = HYPRE_THRUST_CALL( unique, tmp_j, tmp_j + AXC_offd_nnz ); +#endif num_cols_AXC_offd = tmp_end - tmp_j; - HYPRE_THRUST_CALL( fill_n, + hypreDevice_IntFilln( offd_mark, num_cols_A_offd, 0 ); + hypreDevice_ScatterConstant(offd_mark, num_cols_AXC_offd, tmp_j, (HYPRE_Int) 1); +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::exclusive_scan, offd_mark, - num_cols_A_offd, + offd_mark + num_cols_A_offd, + tmp_j, 0 ); - hypreDevice_ScatterConstant(offd_mark, num_cols_AXC_offd, tmp_j, 1); + hypreSycl_gather( AXC_offd_j, + AXC_offd_j + AXC_offd_nnz, + tmp_j, + AXC_offd_j ); + col_map_offd_AXC = hypre_TAlloc(HYPRE_BigInt, num_cols_AXC_offd, HYPRE_MEMORY_DEVICE); + HYPRE_BigInt *tmp_end_big = hypreSycl_copy_if( recv_buf, + recv_buf + num_cols_A_offd, + offd_mark, + col_map_offd_AXC, + [] (const auto & x) {return x;} ); +#else HYPRE_THRUST_CALL( exclusive_scan, offd_mark, offd_mark + num_cols_A_offd, @@ -1348,6 +1985,7 @@ hypre_ParCSRMatrixGenerate1DCFDevice( hypre_ParCSRMatrix *A, offd_mark, col_map_offd_AXC, thrust::identity()); +#endif hypre_assert(tmp_end_big - col_map_offd_AXC == num_cols_AXC_offd); hypre_TFree(tmp_j, HYPRE_MEMORY_DEVICE); @@ -1375,7 +2013,8 @@ hypre_ParCSRMatrixGenerate1DCFDevice( hypre_ParCSRMatrix *A, hypre_CSRMatrixMemoryLocation(AXC_offd) = HYPRE_MEMORY_DEVICE; hypre_ParCSRMatrixDeviceColMapOffd(AXC) = col_map_offd_AXC; - hypre_ParCSRMatrixColMapOffd(AXC) = hypre_TAlloc(HYPRE_BigInt, num_cols_AXC_offd, HYPRE_MEMORY_HOST); + hypre_ParCSRMatrixColMapOffd(AXC) = hypre_TAlloc(HYPRE_BigInt, num_cols_AXC_offd, + HYPRE_MEMORY_HOST); hypre_TMemcpy(hypre_ParCSRMatrixColMapOffd(AXC), col_map_offd_AXC, HYPRE_BigInt, num_cols_AXC_offd, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); @@ -1395,4 +2034,4 @@ hypre_ParCSRMatrixGenerate1DCFDevice( hypre_ParCSRMatrix *A, return hypre_error_flag; } -#endif // #if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#endif // #if defined(HYPRE_USING_GPU) diff --git a/external/hypre/src/parcsr_mv/par_csr_filter.c b/external/hypre/src/parcsr_mv/par_csr_filter.c new file mode 100644 index 00000000..ae433d63 --- /dev/null +++ b/external/hypre/src/parcsr_mv/par_csr_filter.c @@ -0,0 +1,218 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +/****************************************************************************** + * + * Member functions for hypre_ParCSRMatrix class. + * + *****************************************************************************/ + +#include "_hypre_parcsr_mv.h" + +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixBlkFilterHost + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixBlkFilterHost( hypre_ParCSRMatrix *A, + HYPRE_Int block_size, + hypre_ParCSRMatrix **B_ptr ) +{ + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + HYPRE_BigInt global_num_rows = hypre_ParCSRMatrixGlobalNumRows(A); + HYPRE_BigInt global_num_cols = hypre_ParCSRMatrixGlobalNumCols(A); + HYPRE_BigInt *row_starts = hypre_ParCSRMatrixRowStarts(A); + HYPRE_BigInt *col_starts = hypre_ParCSRMatrixColStarts(A); + HYPRE_BigInt *col_map_offd_A = hypre_ParCSRMatrixColMapOffd(A); + HYPRE_MemoryLocation memory_location = hypre_ParCSRMatrixMemoryLocation(A); + + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + HYPRE_Int num_rows = hypre_CSRMatrixNumRows(A_diag); + HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); + HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); + HYPRE_Complex *A_diag_a = hypre_CSRMatrixData(A_diag); + + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); + HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); + HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); + HYPRE_Complex *A_offd_a = hypre_CSRMatrixData(A_offd); + HYPRE_Int num_cols_offd_A = hypre_CSRMatrixNumCols(A_offd); + + /* Output matrix variables */ + hypre_ParCSRMatrix *B; + hypre_CSRMatrix *B_diag, *B_offd; + HYPRE_Int *B_diag_i, *B_offd_i; + HYPRE_Int *B_diag_j, *B_offd_j; + HYPRE_Complex *B_diag_a, *B_offd_a; + HYPRE_BigInt *col_map_offd_B; + HYPRE_Int num_cols_offd_B; + HYPRE_Int B_diag_nnz, B_offd_nnz; + + /* Local variables */ + HYPRE_BigInt big_block_size = (HYPRE_BigInt) block_size; + HYPRE_Int i, j, c; + HYPRE_Int *marker; + + /*----------------------------------------------------------------------- + * Sanity checks + *-----------------------------------------------------------------------*/ + + if (block_size < 1) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "block size must be greater than one!\n"); + return hypre_error_flag; + } + + if (global_num_rows % big_block_size) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "block size is not a divisor of the number of rows!\n"); + return hypre_error_flag; + } + + if (row_starts[0] % big_block_size) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "block size is not a divisor of the first global row!\n"); + return hypre_error_flag; + } + + if (global_num_rows != global_num_cols) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Function not implemented for rectangular matrices!\n"); + return hypre_error_flag; + } + + /*----------------------------------------------------------------------- + * First pass: compute nonzero counts of B + *-----------------------------------------------------------------------*/ + + B_diag_nnz = B_offd_nnz = 0; + for (i = 0; i < num_rows; i++) + { + c = i % block_size; + + for (j = A_diag_i[i]; j < A_diag_i[i + 1]; j++) + { + if (c == (A_diag_j[j] % block_size)) + { + B_diag_nnz++; + } + } + + for (j = A_offd_i[i]; j < A_offd_i[i + 1]; j++) + { + if (c == (HYPRE_Int) (col_map_offd_A[A_offd_j[j]] % big_block_size)) + { + B_offd_nnz++; + } + } + } + + /*----------------------------------------------------------------------- + * Create and initialize output matrix + *-----------------------------------------------------------------------*/ + + B = hypre_ParCSRMatrixCreate(comm, global_num_rows, global_num_cols, + row_starts, col_starts, num_cols_offd_A, + B_diag_nnz, B_offd_nnz); + + hypre_ParCSRMatrixInitialize_v2(B, memory_location); + + B_diag = hypre_ParCSRMatrixDiag(B); + B_diag_i = hypre_CSRMatrixI(B_diag); + B_diag_j = hypre_CSRMatrixJ(B_diag); + B_diag_a = hypre_CSRMatrixData(B_diag); + + B_offd = hypre_ParCSRMatrixOffd(B); + B_offd_i = hypre_CSRMatrixI(B_offd); + B_offd_j = hypre_CSRMatrixJ(B_offd); + B_offd_a = hypre_CSRMatrixData(B_offd); + + col_map_offd_B = hypre_ParCSRMatrixColMapOffd(B); + + /*----------------------------------------------------------------------- + * Second pass: Fill entries of B + *-----------------------------------------------------------------------*/ + + marker = hypre_CTAlloc(HYPRE_Int, num_cols_offd_A, HYPRE_MEMORY_HOST); + + for (i = 0; i < num_rows; i++) + { + c = i % block_size; + + B_diag_i[i + 1] = B_diag_i[i]; + for (j = A_diag_i[i]; j < A_diag_i[i + 1]; j++) + { + if (c == (A_diag_j[j] % block_size)) + { + B_diag_j[B_diag_i[i + 1]] = A_diag_j[j]; + B_diag_a[B_diag_i[i + 1]] = A_diag_a[j]; + B_diag_i[i + 1]++; + } + } + + B_offd_i[i + 1] = B_offd_i[i]; + for (j = A_offd_i[i]; j < A_offd_i[i + 1]; j++) + { + if (c == (HYPRE_Int) (col_map_offd_A[A_offd_j[j]] % big_block_size)) + { + B_offd_j[B_offd_i[i + 1]] = A_offd_j[j]; + B_offd_a[B_offd_i[i + 1]] = A_offd_a[j]; + B_offd_i[i + 1]++; + marker[A_offd_j[j]] = 1; + } + } + } + + /* Update col_map array */ + num_cols_offd_B = 0; + for (i = 0; i < num_cols_offd_A; i++) + { + if (marker[i]) + { + col_map_offd_B[num_cols_offd_B++] = col_map_offd_A[i]; + } + } + hypre_CSRMatrixNumCols(B_offd) = num_cols_offd_B; + hypre_TFree(marker, HYPRE_MEMORY_HOST); + + /* Update global nonzeros */ + hypre_ParCSRMatrixSetDNumNonzeros(B); + hypre_ParCSRMatrixNumNonzeros(B) = (HYPRE_BigInt) hypre_ParCSRMatrixDNumNonzeros(B); + hypre_MatvecCommPkgCreate(B); + + /* Set output pointer */ + *B_ptr = B; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixBlkFilter + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixBlkFilter( hypre_ParCSRMatrix *A, + HYPRE_Int block_size, + hypre_ParCSRMatrix **B_ptr ) +{ + HYPRE_ANNOTATE_FUNC_BEGIN; + +#if defined(HYPRE_USING_GPU) + if (hypre_GetExecPolicy1(hypre_ParCSRMatrixMemoryLocation(A)) == HYPRE_EXEC_DEVICE) + { + hypre_ParCSRMatrixBlkFilterDevice(A, block_size, B_ptr); + } + else +#endif + { + hypre_ParCSRMatrixBlkFilterHost(A, block_size, B_ptr); + } + + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} diff --git a/external/hypre/src/parcsr_mv/par_csr_filter_device.c b/external/hypre/src/parcsr_mv/par_csr_filter_device.c new file mode 100644 index 00000000..30316b2a --- /dev/null +++ b/external/hypre/src/parcsr_mv/par_csr_filter_device.c @@ -0,0 +1,358 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#include "_hypre_onedpl.hpp" +#include "_hypre_parcsr_mv.h" +#include "_hypre_utilities.hpp" + +#if defined(HYPRE_USING_GPU) + +/*-------------------------------------------------------------------------- + * hypreGPUKernel_ParCSRMatrixBlkFilterCount + *--------------------------------------------------------------------------*/ + +__global__ void +hypreGPUKernel_ParCSRMatrixBlkFilterCount(hypre_DeviceItem &item, + HYPRE_Int num_rows, + HYPRE_Int block_size, + HYPRE_Int *A_diag_i, + HYPRE_Int *A_diag_j, + HYPRE_Int *A_offd_i, + HYPRE_Int *A_offd_j, + HYPRE_BigInt *A_col_map_offd, + HYPRE_Int *B_diag_i, + HYPRE_Int *B_offd_i) +{ + HYPRE_Int row = hypre_gpu_get_grid_warp_id<1, 1>(item); + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); + HYPRE_BigInt big_block_size = (HYPRE_BigInt) block_size; + + if (row < num_rows) + { + HYPRE_Int p = 0, q = 0, pA, qA; + + if (lane < 2) + { + p = read_only_load(A_diag_i + row + lane); + q = read_only_load(A_offd_i + row + lane); + } + pA = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 1); + p = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 0); + qA = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, q, 1); + q = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, q, 0); + + HYPRE_Int diag_count = 0; + HYPRE_Int offd_count = 0; + + for (HYPRE_Int j = p + lane; + warp_any_sync(item, HYPRE_WARP_FULL_MASK, j < pA); + j += HYPRE_WARP_SIZE) + { + if (j < pA) + { + const HYPRE_Int col = read_only_load(A_diag_j + j); + if ((col % block_size) == (row % block_size)) + { + diag_count++; + } + } + } + + for (HYPRE_Int j = q + lane; + warp_any_sync(item, HYPRE_WARP_FULL_MASK, j < qA); + j += HYPRE_WARP_SIZE) + { + if (j < qA) + { + const HYPRE_Int col = read_only_load(A_offd_j + j); + const HYPRE_BigInt global_col = read_only_load(A_col_map_offd + col); + if ((HYPRE_Int) (global_col % big_block_size) == (row % block_size)) + { + offd_count++; + } + } + } + + diag_count = warp_reduce_sum(item, diag_count); + offd_count = warp_reduce_sum(item, offd_count); + + if (lane == 0) + { + B_diag_i[row] = diag_count; + B_offd_i[row] = offd_count; + } + } +} + +/*-------------------------------------------------------------------------- + * hypreGPUKernel_ParCSRMatrixBlkFilterFill + *--------------------------------------------------------------------------*/ + +__global__ void +hypreGPUKernel_ParCSRMatrixBlkFilterFill(hypre_DeviceItem &item, + HYPRE_Int num_rows, + HYPRE_Int block_size, + HYPRE_Int A_num_cols_offd, + HYPRE_Int *A_diag_i, + HYPRE_Int *A_diag_j, + HYPRE_Complex *A_diag_a, + HYPRE_Int *A_offd_i, + HYPRE_Int *A_offd_j, + HYPRE_Complex *A_offd_a, + HYPRE_BigInt *A_col_map_offd, + HYPRE_Int *B_diag_i, + HYPRE_Int *B_diag_j, + HYPRE_Complex *B_diag_a, + HYPRE_Int *B_offd_i, + HYPRE_Int *B_offd_j, + HYPRE_Complex *B_offd_a, + HYPRE_Int *col_map_marker) +{ + const HYPRE_Int row = hypre_gpu_get_grid_warp_id<1, 1>(item); + const HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); + HYPRE_Int p = 0, q = 0, pA, qA; + HYPRE_BigInt big_block_size = (HYPRE_BigInt) block_size; + + if (row >= num_rows) + { + return; + } + + if (lane < 2) + { + p = read_only_load(A_diag_i + row + lane); + q = read_only_load(A_offd_i + row + lane); + } + pA = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 1); + p = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 0); + qA = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, q, 1); + q = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, q, 0); + + HYPRE_Int diag_offset = B_diag_i[row]; + for (HYPRE_Int j = p + lane; + warp_any_sync(item, HYPRE_WARP_FULL_MASK, j < pA); + j += HYPRE_WARP_SIZE) + { + const HYPRE_Int col = (j < pA) ? read_only_load(A_diag_j + j) : 0; + HYPRE_Int write = (j < pA && (col % block_size) == (row % block_size)); + hypre_mask ballot = hypre_ballot_sync(item, HYPRE_WARP_FULL_MASK, write); + HYPRE_Int laneoff = hypre_popc(ballot & ((hypre_mask_one << lane) - 1)); + + if (write) + { + HYPRE_Int idx = diag_offset + laneoff; + B_diag_j[idx] = col; + B_diag_a[idx] = A_diag_a[j]; + } + + diag_offset += hypre_popc(ballot); + } + + if (col_map_marker) + { + HYPRE_Int offd_offset = B_offd_i[row]; + for (HYPRE_Int j = q + lane; + warp_any_sync(item, HYPRE_WARP_FULL_MASK, j < qA); + j += HYPRE_WARP_SIZE) + { + const HYPRE_Int col = (j < qA) ? read_only_load(A_offd_j + j) : 0; + const HYPRE_BigInt global_col = (j < qA) ? read_only_load(A_col_map_offd + col) : 0; + HYPRE_Int write = (j < qA) && + (HYPRE_Int) (global_col % big_block_size) == (row % block_size); + hypre_mask ballot = hypre_ballot_sync(item, HYPRE_WARP_FULL_MASK, write); + HYPRE_Int laneoff = hypre_popc(ballot & ((hypre_mask_one << lane) - 1)); + + if (write) + { + HYPRE_Int idx = offd_offset + laneoff; + B_offd_j[idx] = col; + B_offd_a[idx] = A_offd_a[j]; + + if (col < A_num_cols_offd) + { + col_map_marker[col] = 1; + } + } + + offd_offset += hypre_popc(ballot); + } + } +} + +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixBlkFilterDevice + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixBlkFilterDevice(hypre_ParCSRMatrix *A, + HYPRE_Int block_size, + hypre_ParCSRMatrix **B_ptr) +{ + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + HYPRE_BigInt global_num_rows = hypre_ParCSRMatrixGlobalNumRows(A); + HYPRE_BigInt global_num_cols = hypre_ParCSRMatrixGlobalNumCols(A); + HYPRE_BigInt *row_starts = hypre_ParCSRMatrixRowStarts(A); + HYPRE_BigInt *col_starts = hypre_ParCSRMatrixColStarts(A); + HYPRE_BigInt *A_col_map_offd = hypre_ParCSRMatrixDeviceColMapOffd(A); + HYPRE_MemoryLocation memory_location = hypre_ParCSRMatrixMemoryLocation(A); + + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + HYPRE_Int num_rows = hypre_CSRMatrixNumRows(A_diag); + HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); + HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); + HYPRE_Complex *A_diag_a = hypre_CSRMatrixData(A_diag); + + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); + HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); + HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); + HYPRE_Complex *A_offd_a = hypre_CSRMatrixData(A_offd); + HYPRE_Int num_cols_offd = hypre_CSRMatrixNumCols(A_offd); + + hypre_ParCSRMatrix *B; + hypre_CSRMatrix *B_diag; + hypre_CSRMatrix *B_offd; + HYPRE_Int *B_diag_i; + HYPRE_Int *B_diag_j; + HYPRE_Complex *B_diag_a; + HYPRE_Int *B_offd_i; + HYPRE_Int *B_offd_j; + HYPRE_Complex *B_offd_a; + + HYPRE_Int B_diag_nnz, B_offd_nnz; + HYPRE_BigInt *B_col_map_offd; + HYPRE_Int *col_map_marker; + HYPRE_BigInt *col_map_end; + + const dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + const dim3 gDim = hypre_GetDefaultDeviceGridDimension(num_rows, + "w", bDim); + + hypre_GpuProfilingPushRange("ParCSRMatrixBlkFilter"); + + /* Create A's device column map */ + if (!hypre_ParCSRMatrixDeviceColMapOffd(A) && + hypre_ParCSRMatrixColMapOffd(A)) + { + hypre_ParCSRMatrixCopyColMapOffdToDevice(A); + A_col_map_offd = hypre_ParCSRMatrixDeviceColMapOffd(A); + } + + /* Create and initialize output matrix B */ + B = hypre_ParCSRMatrixCreate(comm, global_num_rows, global_num_cols, + row_starts, col_starts, num_cols_offd, + 0, 0); + hypre_ParCSRMatrixInitialize_v2(B, memory_location); + + B_diag = hypre_ParCSRMatrixDiag(B); + B_offd = hypre_ParCSRMatrixOffd(B); + + B_diag_i = hypre_CSRMatrixI(B_diag); + B_offd_i = hypre_CSRMatrixI(B_offd); + + /* First pass: count nonzeros */ + HYPRE_GPU_LAUNCH( hypreGPUKernel_ParCSRMatrixBlkFilterCount, gDim, bDim, + num_rows, block_size, + A_diag_i, A_diag_j, + A_offd_i, A_offd_j, + A_col_map_offd, + B_diag_i, B_offd_i ); + + /* Compute row pointers and get total number of nonzeros */ + hypreDevice_IntegerExclusiveScan(num_rows + 1, B_diag_i); + hypreDevice_IntegerExclusiveScan(num_rows + 1, B_offd_i); + hypre_TMemcpy(&B_diag_nnz, B_diag_i + num_rows, HYPRE_Int, 1, + HYPRE_MEMORY_HOST, memory_location); + hypre_TMemcpy(&B_offd_nnz, B_offd_i + num_rows, HYPRE_Int, 1, + HYPRE_MEMORY_HOST, memory_location); + + /* Allocate memory for B */ + B_diag_j = hypre_TAlloc(HYPRE_Int, B_diag_nnz, memory_location); + B_offd_j = hypre_TAlloc(HYPRE_Int, B_offd_nnz, memory_location); + B_diag_a = hypre_TAlloc(HYPRE_Complex, B_diag_nnz, memory_location); + B_offd_a = hypre_TAlloc(HYPRE_Complex, B_offd_nnz, memory_location); + + /* Create a marker for used columns */ + if (num_cols_offd > 0) + { + col_map_marker = hypre_CTAlloc(HYPRE_Int, num_cols_offd, memory_location); + } + else + { + col_map_marker = NULL; + } + + /* Second pass: fill B */ + HYPRE_GPU_LAUNCH( hypreGPUKernel_ParCSRMatrixBlkFilterFill, gDim, bDim, + num_rows, block_size, num_cols_offd, + A_diag_i, A_diag_j, A_diag_a, + A_offd_i, A_offd_j, A_offd_a, + A_col_map_offd, + B_diag_i, B_diag_j, B_diag_a, + B_offd_i, B_offd_j, B_offd_a, + col_map_marker ); + + /* Update CSR matrix structures */ + hypre_CSRMatrixJ(B_diag) = B_diag_j; + hypre_CSRMatrixData(B_diag) = B_diag_a; + hypre_CSRMatrixNumNonzeros(B_diag) = B_diag_nnz; + hypre_CSRMatrixJ(B_offd) = B_offd_j; + hypre_CSRMatrixData(B_offd) = B_offd_a; + hypre_CSRMatrixNumNonzeros(B_offd) = B_offd_nnz; + + /* Set up B's col_map_offd */ + if (B_offd_nnz > 0) + { + /* Create B's device column map */ + hypre_ParCSRMatrixDeviceColMapOffd(B) = hypre_CTAlloc(HYPRE_BigInt, + num_cols_offd, + HYPRE_MEMORY_DEVICE); + B_col_map_offd = hypre_ParCSRMatrixDeviceColMapOffd(B); + +#if defined(HYPRE_USING_SYCL) + /* Copy used columns to B's col_map_offd */ + col_map_end = hypreSycl_copy_if(A_col_map_offd, + A_col_map_offd + num_cols_offd, + col_map_marker, + B_col_map_offd, + [] (const auto & x) {return x;} ); +#else + /* Copy used columns to B's col_map_offd */ + col_map_end = HYPRE_THRUST_CALL(copy_if, + A_col_map_offd, + A_col_map_offd + num_cols_offd, + col_map_marker, + B_col_map_offd, + thrust::identity()); +#endif + + hypre_CSRMatrixNumCols(B_offd) = (HYPRE_Int) (col_map_end - B_col_map_offd); + + /* Copy B's column map to host */ + hypre_TMemcpy(hypre_ParCSRMatrixColMapOffd(B), + hypre_ParCSRMatrixDeviceColMapOffd(B), + HYPRE_BigInt, + hypre_CSRMatrixNumCols(B_offd), + HYPRE_MEMORY_HOST, + HYPRE_MEMORY_DEVICE); + } + + /* Update global nonzeros */ + hypre_ParCSRMatrixSetDNumNonzeros(B); + hypre_ParCSRMatrixNumNonzeros(B) = (HYPRE_BigInt) hypre_ParCSRMatrixDNumNonzeros(B); + + /* TODO (VPM): compute B's commpkg directly from A's commpkg */ + hypre_MatvecCommPkgCreate(B); + + /* Set output pointer */ + *B_ptr = B; + + hypre_TFree(col_map_marker, memory_location); + hypre_GpuProfilingPopRange(); + return hypre_error_flag; +} + +#endif /* if defined(HYPRE_USING_GPU) */ diff --git a/external/hypre/src/parcsr_mv/par_csr_matmat.c b/external/hypre/src/parcsr_mv/par_csr_matmat.c new file mode 100644 index 00000000..4fa407cf --- /dev/null +++ b/external/hypre/src/parcsr_mv/par_csr_matmat.c @@ -0,0 +1,159 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#include "_hypre_parcsr_mv.h" + +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatMatDiagHost + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatMatDiagHost(hypre_ParCSRMatrix *A, + hypre_ParCSRMatrix *BT, + hypre_ParCSRMatrix *C) +{ + HYPRE_Int num_rows = hypre_ParCSRMatrixNumRows(A); + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); + + hypre_CSRMatrix *BT_diag, *BT_offd, *C_diag; + HYPRE_Int *A_diag_i, *BT_diag_i, *C_diag_i; + HYPRE_Int *A_offd_i, *BT_offd_i; + HYPRE_Int *A_diag_j, *BT_diag_j, *C_diag_j; + HYPRE_Int *A_offd_j, *BT_offd_j; + HYPRE_Complex *A_diag_a, *BT_diag_a, *C_diag_a; + HYPRE_Complex *A_offd_a, *BT_offd_a; + HYPRE_BigInt *A_col_map_offd; + HYPRE_BigInt *BT_col_map_offd; + + HYPRE_Int i, kA, kB; + HYPRE_Complex diag; + + /* Load pointers */ + BT_diag = hypre_ParCSRMatrixDiag(BT); + BT_offd = hypre_ParCSRMatrixOffd(BT); + BT_diag_i = hypre_CSRMatrixI(BT_diag); + BT_offd_i = hypre_CSRMatrixI(BT_offd); + BT_diag_j = hypre_CSRMatrixJ(BT_diag); + BT_offd_j = hypre_CSRMatrixJ(BT_offd); + BT_diag_a = hypre_CSRMatrixData(BT_diag); + BT_offd_a = hypre_CSRMatrixData(BT_offd); + A_diag_i = hypre_CSRMatrixI(A_diag); + A_offd_i = hypre_CSRMatrixI(A_offd); + A_diag_j = hypre_CSRMatrixJ(A_diag); + A_offd_j = hypre_CSRMatrixJ(A_offd); + A_diag_a = hypre_CSRMatrixData(A_diag); + A_offd_a = hypre_CSRMatrixData(A_offd); + C_diag = hypre_ParCSRMatrixDiag(C); + C_diag_i = hypre_CSRMatrixI(C_diag); + C_diag_j = hypre_CSRMatrixJ(C_diag); + C_diag_a = hypre_CSRMatrixData(C_diag); + + BT_col_map_offd = hypre_ParCSRMatrixColMapOffd(BT); + A_col_map_offd = hypre_ParCSRMatrixColMapOffd(A); + + /* Compute C = diag(A .* BT) */ +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i, kA, kB, diag) +#endif + for (i = 0; i < num_rows; i++) + { + /* Compute diagonal matrix contributions */ + diag = 0.0; + for (kA = A_diag_i[i], kB = BT_diag_i[i]; + kA < A_diag_i[i + 1] && kB < BT_diag_i[i + 1];) + { + if (A_diag_j[kA] < BT_diag_j[kB]) + { + kA++; + } + else if (A_diag_j[kA] > BT_diag_j[kB]) + { + kB++; + } + else + { + diag += A_diag_a[kA] * BT_diag_a[kB]; + kA++; kB++; + } + } + + /* Compute off-diagonal matrix contributions */ + for (kA = A_offd_i[i], kB = BT_offd_i[i]; + kA < A_offd_i[i + 1] && kB < BT_offd_i[i + 1];) + { + if (A_col_map_offd[A_offd_j[kA]] < BT_col_map_offd[BT_offd_j[kB]]) + { + kA++; + } + else if (A_col_map_offd[A_offd_j[kA]] > BT_col_map_offd[BT_offd_j[kB]]) + { + kB++; + } + else + { + diag += A_offd_a[kA] * BT_offd_a[kB]; + kA++; kB++; + } + } + + C_diag_a[i] = diag; + C_diag_j[i] = i; + C_diag_i[i + 1] = i + 1; + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatMatDiag + * + * Computes C = diag(A * B) + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatMatDiag(hypre_ParCSRMatrix *A, + hypre_ParCSRMatrix *B, + hypre_ParCSRMatrix **C_ptr) +{ + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + HYPRE_BigInt global_num_rows = hypre_ParCSRMatrixGlobalNumRows(A); + HYPRE_BigInt global_num_cols = hypre_ParCSRMatrixGlobalNumCols(B); + HYPRE_Int num_rows = hypre_ParCSRMatrixNumRows(A); + HYPRE_BigInt *row_starts = hypre_ParCSRMatrixRowStarts(A); + HYPRE_MemoryLocation memory_location = hypre_ParCSRMatrixMemoryLocation(A); + hypre_ParCSRMatrix *C, *BT; + + /* Create and initialize output matrix C */ + C = hypre_ParCSRMatrixCreate(comm, global_num_rows, global_num_cols, + row_starts, row_starts, 0, num_rows, 0); + hypre_ParCSRMatrixInitialize_v2(C, memory_location); + + /* Transpose B for easier multiplication with A */ + hypre_ParCSRMatrixTranspose(B, &BT, 1); + +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy2(hypre_ParCSRMatrixMemoryLocation(A), + hypre_ParCSRMatrixMemoryLocation(BT)); + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_ParCSRMatMatDiagDevice(A, BT, C); + } + else +#endif + { + hypre_ParCSRMatMatDiagHost(A, BT, C); + } + + /* Output pointer */ + *C_ptr = C; + + /* Free memory */ + hypre_ParCSRMatrixDestroy(BT); + + return hypre_error_flag; +} diff --git a/external/hypre/src/parcsr_mv/par_csr_matmat_device.c b/external/hypre/src/parcsr_mv/par_csr_matmat_device.c new file mode 100644 index 00000000..df65d5cd --- /dev/null +++ b/external/hypre/src/parcsr_mv/par_csr_matmat_device.c @@ -0,0 +1,152 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#include "_hypre_onedpl.hpp" +#include "_hypre_parcsr_mv.h" +#include "_hypre_utilities.hpp" + +#if defined(HYPRE_USING_GPU) + +/*-------------------------------------------------------------------------- + * hypreGPUKernel_ParCSRMatMatDiag + *--------------------------------------------------------------------------*/ + +__global__ void +hypreGPUKernel_ParCSRMatMatDiag(hypre_DeviceItem &item, + HYPRE_Int num_rows, + HYPRE_Int *A_diag_i, + HYPRE_Int *A_diag_j, + HYPRE_Complex *A_diag_data, + HYPRE_Int *A_offd_i, + HYPRE_Int *A_offd_j, + HYPRE_Complex *A_offd_data, + HYPRE_Int *BT_diag_i, + HYPRE_Int *BT_diag_j, + HYPRE_Complex *BT_diag_data, + HYPRE_Int *BT_offd_i, + HYPRE_Int *BT_offd_j, + HYPRE_Complex *BT_offd_data, + HYPRE_BigInt *A_col_map_offd, + HYPRE_BigInt *BT_col_map_offd, + HYPRE_Complex *C_diag_data) +{ + const HYPRE_Int row = hypre_gpu_get_thread_id<1>(item); + + if (row < num_rows) + { + HYPRE_Complex sum = 0.0; + + /* Process diagonal part of A */ + HYPRE_Int kA = A_diag_i[row]; + HYPRE_Int kB = BT_diag_i[row]; + while (kA < A_diag_i[row + 1] && kB < BT_diag_i[row + 1]) + { + if (A_diag_j[kA] < BT_diag_j[kB]) + { + kA++; + } + else if (A_diag_j[kA] > BT_diag_j[kB]) + { + kB++; + } + else + { + sum += A_diag_data[kA] * BT_diag_data[kB]; + kA++; + kB++; + } + } + + /* Process off-diagonal part of A */ + kA = A_offd_i[row]; + kB = BT_offd_i[row]; + while (kA < A_offd_i[row + 1] && kB < BT_offd_i[row + 1]) + { + HYPRE_BigInt col_A = A_col_map_offd[A_offd_j[kA]]; + HYPRE_BigInt col_B = BT_col_map_offd[BT_offd_j[kB]]; + if (col_A < col_B) + { + kA++; + } + else if (col_A > col_B) + { + kB++; + } + else + { + sum += A_offd_data[kA] * BT_offd_data[kB]; + kA++; + kB++; + } + } + + C_diag_data[row] = sum; + } +} + +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatMatDiagDevice + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatMatDiagDevice(hypre_ParCSRMatrix *A, + hypre_ParCSRMatrix *BT, + hypre_ParCSRMatrix *C) +{ + HYPRE_Int num_rows = hypre_ParCSRMatrixNumRows(A); + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); + hypre_CSRMatrix *BT_diag = hypre_ParCSRMatrixDiag(BT); + hypre_CSRMatrix *BT_offd = hypre_ParCSRMatrixOffd(BT); + hypre_CSRMatrix *C_diag = hypre_ParCSRMatrixDiag(C); + + HYPRE_Int *C_diag_i = hypre_CSRMatrixI(C_diag); + HYPRE_Int *C_diag_j = hypre_CSRMatrixJ(C_diag); + + hypre_GpuProfilingPushRange("ParCSRMatMatDiag"); + + /* Set up C_diag_i and C_diag_j */ +#if defined(HYPRE_USING_SYCL) + hypreSycl_sequence(C_diag_i, C_diag_i + num_rows + 1, 0); + hypreSycl_sequence(C_diag_j, C_diag_j + num_rows, 0); +#else + HYPRE_THRUST_CALL(sequence, C_diag_i, C_diag_i + num_rows + 1, 0); + HYPRE_THRUST_CALL(sequence, C_diag_j, C_diag_j + num_rows, 0); +#endif + + /* Update device column maps if needed */ + hypre_ParCSRMatrixCopyColMapOffdToDevice(A); + hypre_ParCSRMatrixCopyColMapOffdToDevice(BT); + + /* Launch GPU kernel */ + const dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + const dim3 gDim = hypre_GetDefaultDeviceGridDimension(num_rows, "threads", bDim); + + HYPRE_GPU_LAUNCH( hypreGPUKernel_ParCSRMatMatDiag, gDim, bDim, + num_rows, + hypre_CSRMatrixI(A_diag), + hypre_CSRMatrixJ(A_diag), + hypre_CSRMatrixData(A_diag), + hypre_CSRMatrixI(A_offd), + hypre_CSRMatrixJ(A_offd), + hypre_CSRMatrixData(A_offd), + hypre_CSRMatrixI(BT_diag), + hypre_CSRMatrixJ(BT_diag), + hypre_CSRMatrixData(BT_diag), + hypre_CSRMatrixI(BT_offd), + hypre_CSRMatrixJ(BT_offd), + hypre_CSRMatrixData(BT_offd), + hypre_ParCSRMatrixDeviceColMapOffd(A), + hypre_ParCSRMatrixDeviceColMapOffd(BT), + hypre_CSRMatrixData(C_diag) ); + + hypre_GpuProfilingPopRange(); + + return hypre_error_flag; +} + +#endif /* if defined(HYPRE_USING_GPU) */ diff --git a/external/hypre/src/parcsr_mv/par_csr_matop.c b/external/hypre/src/parcsr_mv/par_csr_matop.c index 096d8957..24a8939c 100644 --- a/external/hypre/src/parcsr_mv/par_csr_matop.c +++ b/external/hypre/src/parcsr_mv/par_csr_matop.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -70,8 +70,8 @@ hypre_ParMatmul_RowSizes( HYPRE_MemoryLocation memory_location, HYPRE_Int start_indexing = 0; /* start indexing for C_data at 0 */ HYPRE_Int num_threads = hypre_NumThreads(); - *C_diag_i = hypre_CTAlloc(HYPRE_Int, num_rows_diag_A+1, memory_location); - *C_offd_i = hypre_CTAlloc(HYPRE_Int, num_rows_diag_A+1, memory_location); + *C_diag_i = hypre_CTAlloc(HYPRE_Int, num_rows_diag_A + 1, memory_location); + *C_offd_i = hypre_CTAlloc(HYPRE_Int, num_rows_diag_A + 1, memory_location); jj_count_diag_array = hypre_CTAlloc(HYPRE_Int, num_threads, HYPRE_MEMORY_HOST); jj_count_offd_array = hypre_CTAlloc(HYPRE_Int, num_threads, HYPRE_MEMORY_HOST); @@ -80,7 +80,7 @@ hypre_ParMatmul_RowSizes( HYPRE_MemoryLocation memory_location, * Loop over rows of A *-----------------------------------------------------------------------*/ #ifdef HYPRE_USING_OPENMP -#pragma omp parallel + #pragma omp parallel #endif { HYPRE_Int *B_marker = NULL; @@ -91,19 +91,19 @@ hypre_ParMatmul_RowSizes( HYPRE_MemoryLocation memory_location, HYPRE_Int ii, ns, ne; num_threads = hypre_NumActiveThreads(); - size = num_rownnz_A/num_threads; - rest = num_rownnz_A - size*num_threads; + size = num_rownnz_A / num_threads; + rest = num_rownnz_A - size * num_threads; ii = hypre_GetThreadNum(); if (ii < rest) { - ns = ii*size+ii; - ne = (ii+1)*size+ii+1; + ns = ii * size + ii; + ne = (ii + 1) * size + ii + 1; } else { - ns = ii*size+rest; - ne = (ii+1)*size+rest; + ns = ii * size + rest; + ne = (ii + 1) * size + rest; } jj_count_diag = start_indexing; jj_count_offd = start_indexing; @@ -147,7 +147,7 @@ hypre_ParMatmul_RowSizes( HYPRE_MemoryLocation memory_location, if (num_cols_offd_A) { - for (jj2 = A_offd_i[ii1]; jj2 < A_offd_i[ii1+1]; jj2++) + for (jj2 = A_offd_i[ii1]; jj2 < A_offd_i[ii1 + 1]; jj2++) { i2 = A_offd_j[jj2]; @@ -155,9 +155,9 @@ hypre_ParMatmul_RowSizes( HYPRE_MemoryLocation memory_location, * Loop over entries in row i2 of B_ext. *-----------------------------------------------------------*/ - for (jj3 = B_ext_offd_i[i2]; jj3 < B_ext_offd_i[i2+1]; jj3++) + for (jj3 = B_ext_offd_i[i2]; jj3 < B_ext_offd_i[i2 + 1]; jj3++) { - i3 = num_cols_diag_B+B_ext_offd_j[jj3]; + i3 = num_cols_diag_B + B_ext_offd_j[jj3]; /*-------------------------------------------------------- * Check B_marker to see that C_{ii1,i3} has not already @@ -172,7 +172,7 @@ hypre_ParMatmul_RowSizes( HYPRE_MemoryLocation memory_location, } } - for (jj3 = B_ext_diag_i[i2]; jj3 < B_ext_diag_i[i2+1]; jj3++) + for (jj3 = B_ext_diag_i[i2]; jj3 < B_ext_diag_i[i2 + 1]; jj3++) { i3 = B_ext_diag_j[jj3]; @@ -189,7 +189,7 @@ hypre_ParMatmul_RowSizes( HYPRE_MemoryLocation memory_location, * Loop over entries in row ii1 of A_diag. *-----------------------------------------------------------------*/ - for (jj2 = A_diag_i[ii1]; jj2 < A_diag_i[ii1+1]; jj2++) + for (jj2 = A_diag_i[ii1]; jj2 < A_diag_i[ii1 + 1]; jj2++) { i2 = A_diag_j[jj2]; @@ -197,7 +197,7 @@ hypre_ParMatmul_RowSizes( HYPRE_MemoryLocation memory_location, * Loop over entries in row i2 of B_diag. *-----------------------------------------------------------*/ - for (jj3 = B_diag_i[i2]; jj3 < B_diag_i[i2+1]; jj3++) + for (jj3 = B_diag_i[i2]; jj3 < B_diag_i[i2 + 1]; jj3++) { i3 = B_diag_j[jj3]; @@ -220,9 +220,9 @@ hypre_ParMatmul_RowSizes( HYPRE_MemoryLocation memory_location, if (num_cols_offd_B) { - for (jj3 = B_offd_i[i2]; jj3 < B_offd_i[i2+1]; jj3++) + for (jj3 = B_offd_i[i2]; jj3 < B_offd_i[i2 + 1]; jj3++) { - i3 = num_cols_diag_B+map_B_to_C[B_offd_j[jj3]]; + i3 = num_cols_diag_B + map_B_to_C[B_offd_j[jj3]]; /*-------------------------------------------------------- * Check B_marker to see that C_{ii1,i3} has not already @@ -252,7 +252,7 @@ hypre_ParMatmul_RowSizes( HYPRE_MemoryLocation memory_location, hypre_TFree(B_marker, HYPRE_MEMORY_HOST); #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif /* Correct diag_i and offd_i - phase 1 */ @@ -288,20 +288,20 @@ hypre_ParMatmul_RowSizes( HYPRE_MemoryLocation memory_location, if (rownnz_A != NULL) { #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif - for (i1 = ns; i1 < (ne-1); i1++) + for (i1 = ns; i1 < (ne - 1); i1++) { - for (ii1 = rownnz_A[i1] + 1; ii1 < rownnz_A[i1+1]; ii1++) + for (ii1 = rownnz_A[i1] + 1; ii1 < rownnz_A[i1 + 1]; ii1++) { - (*C_diag_i)[ii1] = (*C_diag_i)[rownnz_A[i1+1]]; - (*C_offd_i)[ii1] = (*C_offd_i)[rownnz_A[i1+1]]; + (*C_diag_i)[ii1] = (*C_diag_i)[rownnz_A[i1 + 1]]; + (*C_offd_i)[ii1] = (*C_offd_i)[rownnz_A[i1 + 1]]; } } if (ii < (num_threads - 1)) { - for (ii1 = rownnz_A[ne-1] + 1; ii1 < rownnz_A[ne]; ii1++) + for (ii1 = rownnz_A[ne - 1] + 1; ii1 < rownnz_A[ne]; ii1++) { (*C_diag_i)[ii1] = (*C_diag_i)[rownnz_A[ne]]; (*C_offd_i)[ii1] = (*C_offd_i)[rownnz_A[ne]]; @@ -309,7 +309,7 @@ hypre_ParMatmul_RowSizes( HYPRE_MemoryLocation memory_location, } else { - for (ii1 = rownnz_A[ne-1] + 1; ii1 < num_rows_diag_A; ii1++) + for (ii1 = rownnz_A[ne - 1] + 1; ii1 < num_rows_diag_A; ii1++) { (*C_diag_i)[ii1] = (*C_diag_i)[num_rows_diag_A]; (*C_offd_i)[ii1] = (*C_offd_i)[num_rows_diag_A]; @@ -326,8 +326,8 @@ hypre_ParMatmul_RowSizes( HYPRE_MemoryLocation memory_location, for (i = 0; i < num_rows_diag_A; i++) { - hypre_assert((*C_diag_i)[i] <= (*C_diag_i)[i+1]); - hypre_assert((*C_offd_i)[i] <= (*C_offd_i)[i+1]); + hypre_assert((*C_diag_i)[i] <= (*C_diag_i)[i + 1]); + hypre_assert((*C_offd_i)[i] <= (*C_offd_i)[i + 1]); } #endif @@ -405,7 +405,7 @@ hypre_ParMatmul( hypre_ParCSRMatrix *A, /* ParCSRMatrix C */ hypre_ParCSRMatrix *C; - HYPRE_BigInt *col_map_offd_C; + HYPRE_BigInt *col_map_offd_C = NULL; HYPRE_Int *map_B_to_C = NULL; /* C_diag */ @@ -424,17 +424,17 @@ hypre_ParMatmul( hypre_ParCSRMatrix *A, HYPRE_Int C_diag_size; /* Bs_ext */ - hypre_CSRMatrix *Bs_ext; - HYPRE_Complex *Bs_ext_data; - HYPRE_Int *Bs_ext_i; - HYPRE_BigInt *Bs_ext_j; - HYPRE_Complex *B_ext_diag_data; + hypre_CSRMatrix *Bs_ext = NULL; + HYPRE_Complex *Bs_ext_data = NULL; + HYPRE_Int *Bs_ext_i = NULL; + HYPRE_BigInt *Bs_ext_j = NULL; + HYPRE_Complex *B_ext_diag_data = NULL; HYPRE_Int *B_ext_diag_i; - HYPRE_Int *B_ext_diag_j; + HYPRE_Int *B_ext_diag_j = NULL; HYPRE_Int B_ext_diag_size; - HYPRE_Complex *B_ext_offd_data; + HYPRE_Complex *B_ext_offd_data = NULL; HYPRE_Int *B_ext_offd_i; - HYPRE_Int *B_ext_offd_j; + HYPRE_Int *B_ext_offd_j = NULL; HYPRE_BigInt *B_big_offd_j = NULL; HYPRE_Int B_ext_offd_size; @@ -467,7 +467,7 @@ hypre_ParMatmul( hypre_ParCSRMatrix *A, if (ncols_A != nrows_B || num_cols_diag_A != num_rows_diag_B) { - hypre_error_w_msg(HYPRE_ERROR_GENERIC," Error! Incompatible matrix dimensions!\n"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, " Error! Incompatible matrix dimensions!\n"); HYPRE_ANNOTATE_FUNC_END; return NULL; @@ -483,9 +483,20 @@ hypre_ParMatmul( hypre_ParCSRMatrix *A, if (num_rownnz_diag_A != num_rows_diag_A && num_rownnz_offd_A != num_rows_offd_A ) { - hypre_MergeOrderedArrays(num_rownnz_diag_A, A_diag_ir, - num_rownnz_offd_A, A_offd_ir, - &num_rownnz_A, &rownnz_A); + hypre_IntArray arr_diag; + hypre_IntArray arr_offd; + hypre_IntArray arr_rownnz; + + hypre_IntArrayData(&arr_diag) = A_diag_ir; + hypre_IntArrayData(&arr_offd) = A_offd_ir; + hypre_IntArraySize(&arr_diag) = num_rownnz_diag_A; + hypre_IntArraySize(&arr_offd) = num_rownnz_offd_A; + hypre_IntArrayMemoryLocation(&arr_rownnz) = memory_location_A; + + hypre_IntArrayMergeOrdered(&arr_diag, &arr_offd, &arr_rownnz); + + num_rownnz_A = hypre_IntArraySize(&arr_rownnz); + rownnz_A = hypre_IntArrayData(&arr_rownnz); } else { @@ -510,13 +521,13 @@ hypre_ParMatmul( hypre_ParCSRMatrix *A, * equally load balanced partitionings within * hypre_ParCSRMatrixExtractBExt *--------------------------------------------------------------------*/ - Bs_ext = hypre_ParCSRMatrixExtractBExt(B,A,1); + Bs_ext = hypre_ParCSRMatrixExtractBExt(B, A, 1); Bs_ext_data = hypre_CSRMatrixData(Bs_ext); Bs_ext_i = hypre_CSRMatrixI(Bs_ext); Bs_ext_j = hypre_CSRMatrixBigJ(Bs_ext); } - B_ext_diag_i = hypre_CTAlloc(HYPRE_Int, num_cols_offd_A+1, HYPRE_MEMORY_HOST); - B_ext_offd_i = hypre_CTAlloc(HYPRE_Int, num_cols_offd_A+1, HYPRE_MEMORY_HOST); + B_ext_diag_i = hypre_CTAlloc(HYPRE_Int, num_cols_offd_A + 1, HYPRE_MEMORY_HOST); + B_ext_offd_i = hypre_CTAlloc(HYPRE_Int, num_cols_offd_A + 1, HYPRE_MEMORY_HOST); B_ext_diag_size = 0; B_ext_offd_size = 0; last_col_diag_B = first_col_diag_B + (HYPRE_BigInt) num_cols_diag_B - 1; @@ -524,7 +535,7 @@ hypre_ParMatmul( hypre_ParCSRMatrix *A, #ifdef HYPRE_CONCURRENT_HOPSCOTCH hypre_UnorderedBigIntSet set; -#pragma omp parallel + #pragma omp parallel { HYPRE_Int size, rest, ii; HYPRE_Int ns, ne; @@ -533,18 +544,18 @@ hypre_ParMatmul( hypre_ParCSRMatrix *A, HYPRE_Int cnt_offd, cnt_diag; HYPRE_Int num_threads = hypre_NumActiveThreads(); - size = num_cols_offd_A/num_threads; - rest = num_cols_offd_A - size*num_threads; + size = num_cols_offd_A / num_threads; + rest = num_cols_offd_A - size * num_threads; ii = hypre_GetThreadNum(); if (ii < rest) { - ns = ii*size+ii; - ne = (ii+1)*size+ii+1; + ns = ii * size + ii; + ne = (ii + 1) * size + ii + 1; } else { - ns = ii*size+rest; - ne = (ii+1)*size+rest; + ns = ii * size + rest; + ne = (ii + 1) * size + rest; } my_diag_size = 0; @@ -553,7 +564,7 @@ hypre_ParMatmul( hypre_ParCSRMatrix *A, { B_ext_diag_i[i] = my_diag_size; B_ext_offd_i[i] = my_offd_size; - for (j = Bs_ext_i[i]; j < Bs_ext_i[i+1]; j++) + for (j = Bs_ext_i[i]; j < Bs_ext_i[i + 1]; j++) { if (Bs_ext_j[j] < first_col_diag_B || Bs_ext_j[j] > last_col_diag_B) @@ -569,7 +580,7 @@ hypre_ParMatmul( hypre_ParCSRMatrix *A, my_diag_array[ii] = my_diag_size; my_offd_array[ii] = my_offd_size; -#pragma omp barrier + #pragma omp barrier if (ii) { @@ -610,17 +621,17 @@ hypre_ParMatmul( hypre_ParCSRMatrix *A, B_big_offd_j = hypre_CTAlloc(HYPRE_BigInt, B_ext_offd_size, HYPRE_MEMORY_HOST); B_ext_offd_data = hypre_CTAlloc(HYPRE_Complex, B_ext_offd_size, HYPRE_MEMORY_HOST); } - hypre_UnorderedBigIntSetCreate(&set, B_ext_offd_size + num_cols_offd_B, 16*hypre_NumThreads()); + hypre_UnorderedBigIntSetCreate(&set, B_ext_offd_size + num_cols_offd_B, 16 * hypre_NumThreads()); } -#pragma omp barrier + #pragma omp barrier cnt_offd = B_ext_offd_i[ns]; cnt_diag = B_ext_diag_i[ns]; for (i = ns; i < ne; i++) { - for (j = Bs_ext_i[i]; j < Bs_ext_i[i+1]; j++) + for (j = Bs_ext_i[i]; j < Bs_ext_i[i + 1]; j++) { if (Bs_ext_j[j] < first_col_diag_B || Bs_ext_j[j] > last_col_diag_B) @@ -655,10 +666,10 @@ hypre_ParMatmul( hypre_ParCSRMatrix *A, &col_map_offd_C_inverse); HYPRE_Int i, j; -#pragma omp parallel for private(j) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(j) HYPRE_SMP_SCHEDULE for (i = 0; i < num_cols_offd_A; i++) { - for (j = B_ext_offd_i[i]; j < B_ext_offd_i[i+1]; j++) + for (j = B_ext_offd_i[i]; j < B_ext_offd_i[i + 1]; j++) { //B_ext_offd_j[j] = hypre_UnorderedIntMapGet(&col_map_offd_C_inverse, B_ext_offd_j[j]); B_ext_offd_j[j] = hypre_UnorderedBigIntMapGet(&col_map_offd_C_inverse, B_big_offd_j[j]); @@ -678,12 +689,12 @@ hypre_ParMatmul( hypre_ParCSRMatrix *A, HYPRE_Int i; map_B_to_C = hypre_CTAlloc(HYPRE_Int, num_cols_offd_B, HYPRE_MEMORY_HOST); -#pragma omp parallel private(i) + #pragma omp parallel private(i) { HYPRE_Int i_begin, i_end; hypre_GetSimpleThreadPartition(&i_begin, &i_end, num_cols_offd_C); - HYPRE_Int cnt; + HYPRE_Int cnt = 0; if (i_end > i_begin) { cnt = hypre_BigLowerBound(col_map_offd_B, @@ -708,9 +719,9 @@ hypre_ParMatmul( hypre_ParCSRMatrix *A, #else /* !HYPRE_CONCURRENT_HOPSCOTCH */ - HYPRE_BigInt *temp; + HYPRE_BigInt *temp = NULL; #ifdef HYPRE_USING_OPENMP -#pragma omp parallel + #pragma omp parallel #endif { HYPRE_Int size, rest, ii; @@ -721,18 +732,18 @@ hypre_ParMatmul( hypre_ParCSRMatrix *A, HYPRE_Int num_threads = hypre_NumActiveThreads(); - size = num_cols_offd_A/num_threads; - rest = num_cols_offd_A - size*num_threads; + size = num_cols_offd_A / num_threads; + rest = num_cols_offd_A - size * num_threads; ii = hypre_GetThreadNum(); if (ii < rest) { - ns = ii*size+ii; - ne = (ii+1)*size+ii+1; + ns = ii * size + ii; + ne = (ii + 1) * size + ii + 1; } else { - ns = ii*size+rest; - ne = (ii+1)*size+rest; + ns = ii * size + rest; + ne = (ii + 1) * size + rest; } my_diag_size = 0; @@ -741,7 +752,7 @@ hypre_ParMatmul( hypre_ParCSRMatrix *A, { B_ext_diag_i[i] = my_diag_size; B_ext_offd_i[i] = my_offd_size; - for (j = Bs_ext_i[i]; j < Bs_ext_i[i+1]; j++) + for (j = Bs_ext_i[i]; j < Bs_ext_i[i + 1]; j++) { if (Bs_ext_j[j] < first_col_diag_B || Bs_ext_j[j] > last_col_diag_B) @@ -758,7 +769,7 @@ hypre_ParMatmul( hypre_ParCSRMatrix *A, my_offd_array[ii] = my_offd_size; #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif if (ii) @@ -804,19 +815,19 @@ hypre_ParMatmul( hypre_ParCSRMatrix *A, if (B_ext_offd_size || num_cols_offd_B) { - temp = hypre_CTAlloc(HYPRE_BigInt, B_ext_offd_size+num_cols_offd_B, HYPRE_MEMORY_HOST); + temp = hypre_CTAlloc(HYPRE_BigInt, B_ext_offd_size + num_cols_offd_B, HYPRE_MEMORY_HOST); } } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif cnt_offd = B_ext_offd_i[ns]; cnt_diag = B_ext_diag_i[ns]; for (i = ns; i < ne; i++) { - for (j = Bs_ext_i[i]; j < Bs_ext_i[i+1]; j++) + for (j = Bs_ext_i[i]; j < Bs_ext_i[i + 1]; j++) { if (Bs_ext_j[j] < first_col_diag_B || Bs_ext_j[j] > last_col_diag_B) @@ -835,7 +846,7 @@ hypre_ParMatmul( hypre_ParCSRMatrix *A, } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif if (ii == 0) @@ -861,7 +872,7 @@ hypre_ParMatmul( hypre_ParCSRMatrix *A, { HYPRE_BigInt value; - hypre_BigQsort0(temp, 0, cnt-1); + hypre_BigQsort0(temp, 0, cnt - 1); num_cols_offd_C = 1; value = temp[0]; for (i = 1; i < cnt; i++) @@ -890,16 +901,16 @@ hypre_ParMatmul( hypre_ParCSRMatrix *A, #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif for (i = ns; i < ne; i++) { - for (j = B_ext_offd_i[i]; j < B_ext_offd_i[i+1]; j++) + for (j = B_ext_offd_i[i]; j < B_ext_offd_i[i + 1]; j++) { B_ext_offd_j[j] = hypre_BigBinarySearch(col_map_offd_C, B_big_offd_j[j], - //B_ext_offd_j[j] = hypre_BigBinarySearch(col_map_offd_C, Bs_ext_j[j], - num_cols_offd_C); + //B_ext_offd_j[j] = hypre_BigBinarySearch(col_map_offd_C, Bs_ext_j[j], + num_cols_offd_C); } } @@ -920,7 +931,7 @@ hypre_ParMatmul( hypre_ParCSRMatrix *A, if (col_map_offd_C[i] == col_map_offd_B[cnt]) { map_B_to_C[cnt++] = i; - if (cnt == num_cols_offd_B) break; + if (cnt == num_cols_offd_B) { break; } } } } @@ -967,7 +978,7 @@ hypre_ParMatmul( hypre_ParCSRMatrix *A, HYPRE_ANNOTATE_REGION_BEGIN("%s", "Second pass"); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel + #pragma omp parallel #endif { HYPRE_Int *B_marker = NULL; @@ -979,19 +990,19 @@ hypre_ParMatmul( hypre_ParCSRMatrix *A, HYPRE_Complex a_entry; /*, a_b_product;*/ num_threads = hypre_NumActiveThreads(); - size = num_rownnz_A/num_threads; - rest = num_rownnz_A - size*num_threads; + size = num_rownnz_A / num_threads; + rest = num_rownnz_A - size * num_threads; ii = hypre_GetThreadNum(); if (ii < rest) { - ns = ii*size+ii; - ne = (ii+1)*size+ii+1; + ns = ii * size + ii; + ne = (ii + 1) * size + ii + 1; } else { - ns = ii*size+rest; - ne = (ii+1)*size+rest; + ns = ii * size + rest; + ne = (ii + 1) * size + rest; } jj_count_diag = C_diag_i[rownnz_A ? rownnz_A[ns] : ns]; jj_count_offd = C_offd_i[rownnz_A ? rownnz_A[ns] : ns]; @@ -1040,7 +1051,7 @@ hypre_ParMatmul( hypre_ParCSRMatrix *A, if (num_cols_offd_A) { - for (jj2 = A_offd_i[ii1]; jj2 < A_offd_i[ii1+1]; jj2++) + for (jj2 = A_offd_i[ii1]; jj2 < A_offd_i[ii1 + 1]; jj2++) { i2 = A_offd_j[jj2]; a_entry = A_offd_data[jj2]; @@ -1049,9 +1060,9 @@ hypre_ParMatmul( hypre_ParCSRMatrix *A, * Loop over entries in row i2 of B_ext. *-----------------------------------------------------------*/ - for (jj3 = B_ext_offd_i[i2]; jj3 < B_ext_offd_i[i2+1]; jj3++) + for (jj3 = B_ext_offd_i[i2]; jj3 < B_ext_offd_i[i2 + 1]; jj3++) { - i3 = num_cols_diag_B+B_ext_offd_j[jj3]; + i3 = num_cols_diag_B + B_ext_offd_j[jj3]; /*-------------------------------------------------------- * Check B_marker to see that C_{ii1,i3} has not already @@ -1062,28 +1073,28 @@ hypre_ParMatmul( hypre_ParCSRMatrix *A, if (B_marker[i3] < jj_row_begin_offd) { B_marker[i3] = jj_count_offd; - C_offd_data[jj_count_offd] = a_entry*B_ext_offd_data[jj3]; - C_offd_j[jj_count_offd] = i3-num_cols_diag_B; + C_offd_data[jj_count_offd] = a_entry * B_ext_offd_data[jj3]; + C_offd_j[jj_count_offd] = i3 - num_cols_diag_B; jj_count_offd++; } else { - C_offd_data[B_marker[i3]] += a_entry*B_ext_offd_data[jj3]; + C_offd_data[B_marker[i3]] += a_entry * B_ext_offd_data[jj3]; } } - for (jj3 = B_ext_diag_i[i2]; jj3 < B_ext_diag_i[i2+1]; jj3++) + for (jj3 = B_ext_diag_i[i2]; jj3 < B_ext_diag_i[i2 + 1]; jj3++) { i3 = B_ext_diag_j[jj3]; if (B_marker[i3] < jj_row_begin_diag) { B_marker[i3] = jj_count_diag; - C_diag_data[jj_count_diag] = a_entry*B_ext_diag_data[jj3]; + C_diag_data[jj_count_diag] = a_entry * B_ext_diag_data[jj3]; C_diag_j[jj_count_diag] = i3; jj_count_diag++; } else { - C_diag_data[B_marker[i3]] += a_entry*B_ext_diag_data[jj3]; + C_diag_data[B_marker[i3]] += a_entry * B_ext_diag_data[jj3]; } } } @@ -1093,7 +1104,7 @@ hypre_ParMatmul( hypre_ParCSRMatrix *A, * Loop over entries in row ii1 of A_diag. *-----------------------------------------------------------------*/ - for (jj2 = A_diag_i[ii1]; jj2 < A_diag_i[ii1+1]; jj2++) + for (jj2 = A_diag_i[ii1]; jj2 < A_diag_i[ii1 + 1]; jj2++) { i2 = A_diag_j[jj2]; a_entry = A_diag_data[jj2]; @@ -1102,7 +1113,7 @@ hypre_ParMatmul( hypre_ParCSRMatrix *A, * Loop over entries in row i2 of B_diag. *-----------------------------------------------------------*/ - for (jj3 = B_diag_i[i2]; jj3 < B_diag_i[i2+1]; jj3++) + for (jj3 = B_diag_i[i2]; jj3 < B_diag_i[i2 + 1]; jj3++) { i3 = B_diag_j[jj3]; @@ -1115,20 +1126,20 @@ hypre_ParMatmul( hypre_ParCSRMatrix *A, if (B_marker[i3] < jj_row_begin_diag) { B_marker[i3] = jj_count_diag; - C_diag_data[jj_count_diag] = a_entry*B_diag_data[jj3]; + C_diag_data[jj_count_diag] = a_entry * B_diag_data[jj3]; C_diag_j[jj_count_diag] = i3; jj_count_diag++; } else { - C_diag_data[B_marker[i3]] += a_entry*B_diag_data[jj3]; + C_diag_data[B_marker[i3]] += a_entry * B_diag_data[jj3]; } } if (num_cols_offd_B) { - for (jj3 = B_offd_i[i2]; jj3 < B_offd_i[i2+1]; jj3++) + for (jj3 = B_offd_i[i2]; jj3 < B_offd_i[i2 + 1]; jj3++) { - i3 = num_cols_diag_B+map_B_to_C[B_offd_j[jj3]]; + i3 = num_cols_diag_B + map_B_to_C[B_offd_j[jj3]]; /*-------------------------------------------------------- * Check B_marker to see that C_{ii1,i3} has not already @@ -1139,13 +1150,13 @@ hypre_ParMatmul( hypre_ParCSRMatrix *A, if (B_marker[i3] < jj_row_begin_offd) { B_marker[i3] = jj_count_offd; - C_offd_data[jj_count_offd] = a_entry*B_offd_data[jj3]; - C_offd_j[jj_count_offd] = i3-num_cols_diag_B; + C_offd_data[jj_count_offd] = a_entry * B_offd_data[jj3]; + C_offd_j[jj_count_offd] = i3 - num_cols_diag_B; jj_count_offd++; } else { - C_offd_data[B_marker[i3]] += a_entry*B_offd_data[jj3]; + C_offd_data[B_marker[i3]] += a_entry * B_offd_data[jj3]; } } } @@ -1164,6 +1175,7 @@ hypre_ParMatmul( hypre_ParCSRMatrix *A, hypre_CSRMatrixData(C_diag) = C_diag_data; hypre_CSRMatrixI(C_diag) = C_diag_i; hypre_CSRMatrixJ(C_diag) = C_diag_j; + hypre_CSRMatrixMemoryLocation(C_diag) = memory_location_C; hypre_CSRMatrixSetRownnz(C_diag); C_offd = hypre_ParCSRMatrixOffd(C); @@ -1175,10 +1187,9 @@ hypre_ParMatmul( hypre_ParCSRMatrix *A, hypre_CSRMatrixJ(C_offd) = C_offd_j; hypre_ParCSRMatrixColMapOffd(C) = col_map_offd_C; } + hypre_CSRMatrixMemoryLocation(C_offd) = memory_location_C; hypre_CSRMatrixSetRownnz(C_offd); - hypre_CSRMatrixMemoryLocation(C_diag) = memory_location_C; - hypre_CSRMatrixMemoryLocation(C_offd) = memory_location_C; /*----------------------------------------------------------------------- * Free various arrays @@ -1199,7 +1210,7 @@ hypre_ParMatmul( hypre_ParCSRMatrix *A, { hypre_TFree(map_B_to_C, HYPRE_MEMORY_HOST); } - hypre_TFree(rownnz_A, HYPRE_MEMORY_HOST); + hypre_TFree(rownnz_A, memory_location_A); #ifdef HYPRE_PROFILE hypre_profile_times[HYPRE_TIMER_ID_MATMUL] += hypre_MPI_Wtime(); @@ -1210,14 +1221,17 @@ hypre_ParMatmul( hypre_ParCSRMatrix *A, return C; } -/* The following function was formerly part of hypre_ParCSRMatrixExtractBExt - but the code was removed so it can be used for a corresponding function - for Boolean matrices - - JSP: to allow communication overlapping, it returns comm_handle_idx and - comm_handle_data. Before accessing B, they should be destroyed (including - send_data contained in the comm_handle). -*/ +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixExtractBExt_Arrays_Overlap + * + * The following function was formerly part of hypre_ParCSRMatrixExtractBExt + * but the code was removed so it can be used for a corresponding function + * for Boolean matrices + * + * JSP: to allow communication overlapping, it returns comm_handle_idx and + * comm_handle_data. Before accessing B, they should be destroyed (including + * send_data contained in the comm_handle). + *--------------------------------------------------------------------------*/ void hypre_ParCSRMatrixExtractBExt_Arrays_Overlap( HYPRE_Int ** pB_ext_i, @@ -1251,18 +1265,20 @@ void hypre_ParCSRMatrixExtractBExt_Arrays_Overlap( HYPRE_Int skip_same_sign /* 1 if only points that have the same sign are needed */ // extended based long range interpolation: skip_fine = 1, skip_same_sign = 0 for S matrix, skip_fine = 1, skip_same_sign = 1 for A matrix // other interpolation: skip_fine = 0, skip_same_sign = 0 - ) +) { + HYPRE_UNUSED_VAR(num_cols_B); + hypre_ParCSRCommHandle *comm_handle, *row_map_comm_handle = NULL; - hypre_ParCSRCommPkg *tmp_comm_pkg; + hypre_ParCSRCommPkg *tmp_comm_pkg = NULL; HYPRE_Int *B_int_i; HYPRE_BigInt *B_int_j; HYPRE_Int *B_ext_i; HYPRE_BigInt * B_ext_j; - HYPRE_Complex * B_ext_data; - HYPRE_Complex * B_int_data; - HYPRE_BigInt * B_int_row_map; - HYPRE_BigInt * B_ext_row_map; + HYPRE_Complex * B_ext_data = NULL; + HYPRE_Complex * B_int_data = NULL; + HYPRE_BigInt * B_int_row_map = NULL; + HYPRE_BigInt * B_ext_row_map = NULL; HYPRE_Int num_procs, my_id; HYPRE_Int *jdata_recv_vec_starts; HYPRE_Int *jdata_send_map_starts; @@ -1273,26 +1289,28 @@ void hypre_ParCSRMatrixExtractBExt_Arrays_Overlap( HYPRE_Int num_rows_B_ext; HYPRE_Int *prefix_sum_workspace; - hypre_MPI_Comm_size(comm,&num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); HYPRE_BigInt first_row_index = row_starts[0]; num_rows_B_ext = recv_vec_starts[num_recvs]; - if ( num_rows_B_ext < 0 ) { /* no B_ext, no communication */ + if ( num_rows_B_ext < 0 ) /* no B_ext, no communication */ + { *pB_ext_i = NULL; *pB_ext_j = NULL; - if ( data ) *pB_ext_data = NULL; - if ( find_row_map ) *pB_ext_row_map = NULL; + if ( data ) { *pB_ext_data = NULL; } + if ( find_row_map ) { *pB_ext_row_map = NULL; } *num_nonzeros = 0; return; }; - B_int_i = hypre_CTAlloc(HYPRE_Int, send_map_starts[num_sends]+1, HYPRE_MEMORY_HOST); - B_ext_i = hypre_CTAlloc(HYPRE_Int, num_rows_B_ext+1, HYPRE_MEMORY_HOST); + B_int_i = hypre_CTAlloc(HYPRE_Int, send_map_starts[num_sends] + 1, HYPRE_MEMORY_HOST); + B_ext_i = hypre_CTAlloc(HYPRE_Int, num_rows_B_ext + 1, HYPRE_MEMORY_HOST); *pB_ext_i = B_ext_i; - if ( find_row_map ) { - B_int_row_map = hypre_CTAlloc( HYPRE_BigInt, send_map_starts[num_sends]+1 , HYPRE_MEMORY_HOST); - B_ext_row_map = hypre_CTAlloc( HYPRE_BigInt, num_rows_B_ext+1 , HYPRE_MEMORY_HOST); + if ( find_row_map ) + { + B_int_row_map = hypre_CTAlloc( HYPRE_BigInt, send_map_starts[num_sends] + 1, HYPRE_MEMORY_HOST); + B_ext_row_map = hypre_CTAlloc( HYPRE_BigInt, num_rows_B_ext + 1, HYPRE_MEMORY_HOST); *pB_ext_row_map = B_ext_row_map; }; @@ -1302,21 +1320,22 @@ void hypre_ParCSRMatrixExtractBExt_Arrays_Overlap( * a row j (which is determined through send_map_elmts) *--------------------------------------------------------------------------*/ - jdata_send_map_starts = hypre_CTAlloc(HYPRE_Int, num_sends+1, HYPRE_MEMORY_HOST); - jdata_recv_vec_starts = hypre_CTAlloc(HYPRE_Int, num_recvs+1, HYPRE_MEMORY_HOST); + jdata_send_map_starts = hypre_CTAlloc(HYPRE_Int, num_sends + 1, HYPRE_MEMORY_HOST); + jdata_recv_vec_starts = hypre_CTAlloc(HYPRE_Int, num_recvs + 1, HYPRE_MEMORY_HOST); jdata_send_map_starts[0] = B_int_i[0] = 0; /*HYPRE_Int prefix_sum_workspace[(hypre_NumThreads() + 1)*num_sends];*/ - prefix_sum_workspace = hypre_TAlloc(HYPRE_Int, (hypre_NumThreads() + 1)*num_sends, HYPRE_MEMORY_HOST); + prefix_sum_workspace = hypre_TAlloc(HYPRE_Int, (hypre_NumThreads() + 1) * num_sends, + HYPRE_MEMORY_HOST); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel private(i,j,k) + #pragma omp parallel private(i,j,k) #endif { /*HYPRE_Int counts[num_sends];*/ HYPRE_Int *counts; counts = hypre_TAlloc(HYPRE_Int, num_sends, HYPRE_MEMORY_HOST); - for (i=0; i < num_sends; i++) + for (i = 0; i < num_sends; i++) { HYPRE_Int j_begin, j_end; hypre_GetSimpleThreadPartition(&j_begin, &j_end, send_map_starts[i + 1] - send_map_starts[i]); @@ -1335,22 +1354,22 @@ void hypre_ParCSRMatrixExtractBExt_Arrays_Overlap( { for (k = diag_i[jrow] + 1; k < diag_i[jrow + 1]; k++) { - if (diag_data[k] < 0 && CF_marker[diag_j[k]] >= 0) len++; + if (diag_data[k] < 0 && CF_marker[diag_j[k]] >= 0) { len++; } } for (k = offd_i[jrow]; k < offd_i[jrow + 1]; k++) { - if (offd_data[k] < 0) len++; + if (offd_data[k] < 0) { len++; } } } else { for (k = diag_i[jrow] + 1; k < diag_i[jrow + 1]; k++) { - if (diag_data[k] > 0 && CF_marker[diag_j[k]] >= 0) len++; + if (diag_data[k] > 0 && CF_marker[diag_j[k]] >= 0) { len++; } } for (k = offd_i[jrow]; k < offd_i[jrow + 1]; k++) { - if (offd_data[k] > 0) len++; + if (offd_data[k] > 0) { len++; } } } @@ -1367,11 +1386,11 @@ void hypre_ParCSRMatrixExtractBExt_Arrays_Overlap( for (k = diag_i[jrow]; k < diag_i[jrow + 1]; k++) { - if (CF_marker[diag_j[k]] >= 0) len++; + if (CF_marker[diag_j[k]] >= 0) { len++; } } for (k = offd_i[jrow]; k < offd_i[jrow + 1]; k++) { - if (CF_marker_offd[offd_j[k]] >= 0) len++; + if (CF_marker_offd[offd_j[k]] >= 0) { len++; } } B_int_i[j + 1] = len; @@ -1405,7 +1424,7 @@ void hypre_ParCSRMatrixExtractBExt_Arrays_Overlap( hypre_prefix_sum_multiple(counts, jdata_send_map_starts + 1, num_sends, prefix_sum_workspace); #ifdef HYPRE_USING_OPENMP -#pragma omp master + #pragma omp master #endif { for (i = 1; i < num_sends; i++) @@ -1417,20 +1436,20 @@ void hypre_ParCSRMatrixExtractBExt_Arrays_Overlap( * initialize communication *--------------------------------------------------------------------------*/ - comm_handle = hypre_ParCSRCommHandleCreate(11,comm_pkg, - &B_int_i[1],&(B_ext_i[1]) ); + comm_handle = hypre_ParCSRCommHandleCreate(11, comm_pkg, + &B_int_i[1], &(B_ext_i[1]) ); if ( find_row_map ) { /* scatter/gather B_int row numbers to form array of B_ext row numbers */ row_map_comm_handle = hypre_ParCSRCommHandleCreate - (21,comm_pkg, B_int_row_map, B_ext_row_map ); + (21, comm_pkg, B_int_row_map, B_ext_row_map ); } B_int_j = hypre_TAlloc(HYPRE_BigInt, jdata_send_map_starts[num_sends], HYPRE_MEMORY_HOST); - if (data) B_int_data = hypre_TAlloc(HYPRE_Complex, jdata_send_map_starts[num_sends], HYPRE_MEMORY_HOST); + if (data) { B_int_data = hypre_TAlloc(HYPRE_Complex, jdata_send_map_starts[num_sends], HYPRE_MEMORY_HOST); } } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif for (i = 0; i < num_sends; i++) @@ -1457,7 +1476,7 @@ void hypre_ParCSRMatrixExtractBExt_Arrays_Overlap( { if (diag_data[k] < 0 && CF_marker[diag_j[k]] >= 0) { - B_int_j[count] = (HYPRE_BigInt)diag_j[k]+first_col_diag; + B_int_j[count] = (HYPRE_BigInt)diag_j[k] + first_col_diag; B_int_data[count] = diag_data[k]; count++; } @@ -1480,7 +1499,7 @@ void hypre_ParCSRMatrixExtractBExt_Arrays_Overlap( { if (diag_data[k] > 0 && CF_marker[diag_j[k]] >= 0) { - B_int_j[count] = (HYPRE_BigInt)diag_j[k]+first_col_diag; + B_int_j[count] = (HYPRE_BigInt)diag_j[k] + first_col_diag; B_int_data[count] = diag_data[k]; count++; } @@ -1501,15 +1520,16 @@ void hypre_ParCSRMatrixExtractBExt_Arrays_Overlap( } else { - for (j = j_begin; j < j_end; ++j) { + for (j = j_begin; j < j_end; ++j) + { HYPRE_Int jrow = send_map_elmts[j]; - for (k = diag_i[jrow]; k < diag_i[jrow+1]; k++) + for (k = diag_i[jrow]; k < diag_i[jrow + 1]; k++) { - B_int_j[count] = (HYPRE_BigInt)diag_j[k]+first_col_diag; + B_int_j[count] = (HYPRE_BigInt)diag_j[k] + first_col_diag; B_int_data[count] = diag_data[k]; count++; } - for (k = offd_i[jrow]; k < offd_i[jrow+1]; k++) + for (k = offd_i[jrow]; k < offd_i[jrow + 1]; k++) { B_int_j[count] = col_map_offd[offd_j[k]]; B_int_data[count] = offd_data[k]; @@ -1545,14 +1565,15 @@ void hypre_ParCSRMatrixExtractBExt_Arrays_Overlap( } else { - for (j = j_begin; j < j_end; ++j) { + for (j = j_begin; j < j_end; ++j) + { HYPRE_Int jrow = send_map_elmts[j]; - for (k = diag_i[jrow]; k < diag_i[jrow+1]; k++) + for (k = diag_i[jrow]; k < diag_i[jrow + 1]; k++) { - B_int_j[count] = (HYPRE_BigInt)diag_j[k]+first_col_diag; + B_int_j[count] = (HYPRE_BigInt)diag_j[k] + first_col_diag; count++; } - for (k = offd_i[jrow]; k < offd_i[jrow+1]; k++) + for (k = offd_i[jrow]; k < offd_i[jrow + 1]; k++) { B_int_j[count] = col_map_offd[offd_j[k]]; count++; @@ -1565,15 +1586,16 @@ void hypre_ParCSRMatrixExtractBExt_Arrays_Overlap( } /* omp parallel. JSP: this takes most of time in this function */ hypre_TFree(prefix_sum_workspace, HYPRE_MEMORY_HOST); - tmp_comm_pkg = hypre_CTAlloc(hypre_ParCSRCommPkg, 1, HYPRE_MEMORY_HOST); - hypre_ParCSRCommPkgComm(tmp_comm_pkg) = comm; - hypre_ParCSRCommPkgNumSends(tmp_comm_pkg) = num_sends; - hypre_ParCSRCommPkgNumRecvs(tmp_comm_pkg) = num_recvs; - hypre_ParCSRCommPkgSendProcs(tmp_comm_pkg) = - hypre_ParCSRCommPkgSendProcs(comm_pkg); - hypre_ParCSRCommPkgRecvProcs(tmp_comm_pkg) = - hypre_ParCSRCommPkgRecvProcs(comm_pkg); - hypre_ParCSRCommPkgSendMapStarts(tmp_comm_pkg) = jdata_send_map_starts; + /* Create temporary communication package */ + hypre_ParCSRCommPkgCreateAndFill(comm, + num_recvs, + hypre_ParCSRCommPkgRecvProcs(comm_pkg), + jdata_recv_vec_starts, + num_sends, + hypre_ParCSRCommPkgSendProcs(comm_pkg), + jdata_send_map_starts, + NULL, + &tmp_comm_pkg); hypre_ParCSRCommHandleDestroy(comm_handle); comm_handle = NULL; @@ -1586,9 +1608,9 @@ void hypre_ParCSRMatrixExtractBExt_Arrays_Overlap( for (i = 0; i < num_recvs; i++) { - for (j = recv_vec_starts[i]; j < recv_vec_starts[i+1]; j++) + for (j = recv_vec_starts[i]; j < recv_vec_starts[i + 1]; j++) { - B_ext_i[j+1] += B_ext_i[j]; + B_ext_i[j + 1] += B_ext_i[j]; } } @@ -1605,34 +1627,39 @@ void hypre_ParCSRMatrixExtractBExt_Arrays_Overlap( for (i = 0; i < num_recvs; i++) { start_index = B_ext_i[recv_vec_starts[i]]; - *num_nonzeros = B_ext_i[recv_vec_starts[i+1]]-start_index; - jdata_recv_vec_starts[i+1] = B_ext_i[recv_vec_starts[i+1]]; + *num_nonzeros = B_ext_i[recv_vec_starts[i + 1]] - start_index; + jdata_recv_vec_starts[i + 1] = B_ext_i[recv_vec_starts[i + 1]]; } - hypre_ParCSRCommPkgRecvVecStarts(tmp_comm_pkg) = jdata_recv_vec_starts; - - *comm_handle_idx = hypre_ParCSRCommHandleCreate(21,tmp_comm_pkg,B_int_j,B_ext_j); + *comm_handle_idx = hypre_ParCSRCommHandleCreate(21, tmp_comm_pkg, B_int_j, B_ext_j); if (data) { - *comm_handle_data = hypre_ParCSRCommHandleCreate(1,tmp_comm_pkg,B_int_data, + *comm_handle_data = hypre_ParCSRCommHandleCreate(1, tmp_comm_pkg, B_int_data, B_ext_data); } + /* Free memory */ + hypre_TFree(jdata_send_map_starts, HYPRE_MEMORY_HOST); + hypre_TFree(jdata_recv_vec_starts, HYPRE_MEMORY_HOST); + hypre_TFree(tmp_comm_pkg, HYPRE_MEMORY_HOST); if (row_map_comm_handle) { hypre_ParCSRCommHandleDestroy(row_map_comm_handle); row_map_comm_handle = NULL; } - - hypre_TFree(jdata_send_map_starts, HYPRE_MEMORY_HOST); - hypre_TFree(jdata_recv_vec_starts, HYPRE_MEMORY_HOST); - hypre_TFree(tmp_comm_pkg, HYPRE_MEMORY_HOST); + if (find_row_map) + { + hypre_TFree(B_int_row_map, HYPRE_MEMORY_HOST); + } hypre_TFree(B_int_i, HYPRE_MEMORY_HOST); - if ( find_row_map ) hypre_TFree(B_int_row_map, HYPRE_MEMORY_HOST); /* end generic part */ } +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixExtractBExt_Arrays + *--------------------------------------------------------------------------*/ + void hypre_ParCSRMatrixExtractBExt_Arrays( HYPRE_Int ** pB_ext_i, HYPRE_BigInt ** pB_ext_j, @@ -1658,7 +1685,7 @@ void hypre_ParCSRMatrixExtractBExt_Arrays( HYPRE_BigInt * col_map_offd, HYPRE_Real * diag_data, HYPRE_Real * offd_data - ) +) { hypre_ParCSRCommHandle *comm_handle_idx, *comm_handle_data; @@ -1753,24 +1780,24 @@ hypre_ParCSRMatrixExtractBExt_Overlap( hypre_ParCSRMatrix *B, num_rows_B_ext = recv_vec_starts[num_recvs]; hypre_ParCSRMatrixExtractBExt_Arrays_Overlap - ( &B_ext_i, &B_ext_j, &B_ext_data, &idummy, - &num_nonzeros, - data, 0, comm, comm_pkg, - num_cols_B, num_recvs, num_sends, - first_col_diag, B->row_starts, - recv_vec_starts, send_map_starts, send_map_elmts, - diag_i, diag_j, offd_i, offd_j, col_map_offd, - diag_data, offd_data, - comm_handle_idx, comm_handle_data, - CF_marker, CF_marker_offd, - skip_fine, skip_same_sign - ); - - B_ext = hypre_CSRMatrixCreate(num_rows_B_ext,num_cols_B,num_nonzeros); + ( &B_ext_i, &B_ext_j, &B_ext_data, &idummy, + &num_nonzeros, + data, 0, comm, comm_pkg, + num_cols_B, num_recvs, num_sends, + first_col_diag, B->row_starts, + recv_vec_starts, send_map_starts, send_map_elmts, + diag_i, diag_j, offd_i, offd_j, col_map_offd, + diag_data, offd_data, + comm_handle_idx, comm_handle_data, + CF_marker, CF_marker_offd, + skip_fine, skip_same_sign + ); + + B_ext = hypre_CSRMatrixCreate(num_rows_B_ext, num_cols_B, num_nonzeros); hypre_CSRMatrixMemoryLocation(B_ext) = HYPRE_MEMORY_HOST; hypre_CSRMatrixI(B_ext) = B_ext_i; hypre_CSRMatrixBigJ(B_ext) = B_ext_j; - if (data) hypre_CSRMatrixData(B_ext) = B_ext_data; + if (data) { hypre_CSRMatrixData(B_ext) = B_ext_data; } return B_ext; } @@ -1783,7 +1810,8 @@ hypre_ParCSRMatrixExtractBExt( hypre_ParCSRMatrix *B, #if 0 hypre_ParCSRCommHandle *comm_handle_idx, *comm_handle_data; - hypre_CSRMatrix *B_ext = hypre_ParCSRMatrixExtractBExt_Overlap(B, A, want_data, &comm_handle_idx, &comm_handle_data, NULL, NULL, 0, 0); + hypre_CSRMatrix *B_ext = hypre_ParCSRMatrixExtractBExt_Overlap(B, A, want_data, &comm_handle_idx, + &comm_handle_data, NULL, NULL, 0, 0); HYPRE_Int *send_idx = (HYPRE_Int *)comm_handle_idx->send_data; hypre_ParCSRCommHandleDestroy(comm_handle_idx); @@ -1839,7 +1867,7 @@ hypre_ParCSRMatrixTransposeHost( hypre_ParCSRMatrix *A, HYPRE_BigInt *col_starts = hypre_ParCSRMatrixColStarts(A); HYPRE_Int num_cols_offd = hypre_CSRMatrixNumCols(A_offd); - HYPRE_Int num_sends, num_recvs, num_cols_offd_AT; + HYPRE_Int num_sends = 0, num_recvs = 0, num_cols_offd_AT; HYPRE_Int i, j, k, index, counter, j_row; HYPRE_BigInt value; @@ -1854,11 +1882,11 @@ hypre_ParCSRMatrixTransposeHost( hypre_ParCSRMatrix *A, HYPRE_Int *AT_tmp_i; HYPRE_Int *AT_tmp_j; HYPRE_BigInt *AT_big_j = NULL; - HYPRE_Complex *AT_tmp_data; + HYPRE_Complex *AT_tmp_data = NULL; - HYPRE_Int *AT_buf_i; - HYPRE_BigInt *AT_buf_j; - HYPRE_Complex *AT_buf_data; + HYPRE_Int *AT_buf_i = NULL; + HYPRE_BigInt *AT_buf_j = NULL; + HYPRE_Complex *AT_buf_data = NULL; HYPRE_Int *AT_offd_i; HYPRE_Int *AT_offd_j; @@ -1869,17 +1897,18 @@ hypre_ParCSRMatrixTransposeHost( hypre_ParCSRMatrix *A, HYPRE_Int num_procs, my_id; - HYPRE_Int *recv_procs, *send_procs; - HYPRE_Int *recv_vec_starts; - HYPRE_Int *send_map_starts; - HYPRE_Int *send_map_elmts; + HYPRE_Int *recv_procs = NULL; + HYPRE_Int *send_procs = NULL; + HYPRE_Int *recv_vec_starts = NULL; + HYPRE_Int *send_map_starts = NULL; + HYPRE_Int *send_map_elmts = NULL; HYPRE_Int *tmp_recv_vec_starts; HYPRE_Int *tmp_send_map_starts; - hypre_ParCSRCommPkg *tmp_comm_pkg; - hypre_ParCSRCommHandle *comm_handle; + hypre_ParCSRCommPkg *tmp_comm_pkg = NULL; + hypre_ParCSRCommHandle *comm_handle = NULL; - hypre_MPI_Comm_size(comm,&num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); num_cols_offd_AT = 0; counter = 0; @@ -1928,12 +1957,12 @@ hypre_ParCSRMatrixTransposeHost( hypre_ParCSRMatrix *A, for (i = 0; i < AT_tmp_i[num_cols_offd]; i++) { //AT_tmp_j[i] += first_row_index; - AT_big_j[i] = (HYPRE_BigInt)AT_tmp_j[i]+first_row_index; + AT_big_j[i] = (HYPRE_BigInt)AT_tmp_j[i] + first_row_index; } for (i = 0; i < num_cols_offd; i++) { - AT_tmp_i[i] = AT_tmp_i[i+1]-AT_tmp_i[i]; + AT_tmp_i[i] = AT_tmp_i[i + 1] - AT_tmp_i[i]; } comm_handle = hypre_ParCSRCommHandleCreate(12, comm_pkg, AT_tmp_i, AT_buf_i); @@ -1941,49 +1970,47 @@ hypre_ParCSRMatrixTransposeHost( hypre_ParCSRMatrix *A, hypre_CSRMatrixTranspose(A_diag, &AT_diag, data); - AT_offd_i = hypre_CTAlloc(HYPRE_Int, num_cols+1, memory_location); + AT_offd_i = hypre_CTAlloc(HYPRE_Int, num_cols + 1, memory_location); if (num_procs > 1) { hypre_ParCSRCommHandleDestroy(comm_handle); comm_handle = NULL; - tmp_send_map_starts = hypre_CTAlloc(HYPRE_Int, num_sends+1, HYPRE_MEMORY_HOST); - tmp_recv_vec_starts = hypre_CTAlloc(HYPRE_Int, num_recvs+1, HYPRE_MEMORY_HOST); + tmp_send_map_starts = hypre_CTAlloc(HYPRE_Int, num_sends + 1, HYPRE_MEMORY_HOST); + tmp_recv_vec_starts = hypre_CTAlloc(HYPRE_Int, num_recvs + 1, HYPRE_MEMORY_HOST); tmp_send_map_starts[0] = send_map_starts[0]; for (i = 0; i < num_sends; i++) { - tmp_send_map_starts[i+1] = tmp_send_map_starts[i]; - for (j = send_map_starts[i]; j < send_map_starts[i+1]; j++) + tmp_send_map_starts[i + 1] = tmp_send_map_starts[i]; + for (j = send_map_starts[i]; j < send_map_starts[i + 1]; j++) { - tmp_send_map_starts[i+1] += AT_buf_i[j]; - AT_offd_i[send_map_elmts[j]+1] += AT_buf_i[j]; + tmp_send_map_starts[i + 1] += AT_buf_i[j]; + AT_offd_i[send_map_elmts[j] + 1] += AT_buf_i[j]; } } for (i = 0; i < num_cols; i++) { - AT_offd_i[i+1] += AT_offd_i[i]; + AT_offd_i[i + 1] += AT_offd_i[i]; } tmp_recv_vec_starts[0] = recv_vec_starts[0]; for (i = 0; i < num_recvs; i++) { - tmp_recv_vec_starts[i+1] = tmp_recv_vec_starts[i]; - for (j = recv_vec_starts[i]; j < recv_vec_starts[i+1]; j++) + tmp_recv_vec_starts[i + 1] = tmp_recv_vec_starts[i]; + for (j = recv_vec_starts[i]; j < recv_vec_starts[i + 1]; j++) { - tmp_recv_vec_starts[i+1] += AT_tmp_i[j]; + tmp_recv_vec_starts[i + 1] += AT_tmp_i[j]; } } - tmp_comm_pkg = hypre_CTAlloc(hypre_ParCSRCommPkg, 1, HYPRE_MEMORY_HOST); - hypre_ParCSRCommPkgComm(tmp_comm_pkg) = comm; - hypre_ParCSRCommPkgNumSends(tmp_comm_pkg) = num_sends; - hypre_ParCSRCommPkgNumRecvs(tmp_comm_pkg) = num_recvs; - hypre_ParCSRCommPkgRecvProcs(tmp_comm_pkg) = recv_procs; - hypre_ParCSRCommPkgSendProcs(tmp_comm_pkg) = send_procs; - hypre_ParCSRCommPkgRecvVecStarts(tmp_comm_pkg) = tmp_recv_vec_starts; - hypre_ParCSRCommPkgSendMapStarts(tmp_comm_pkg) = tmp_send_map_starts; + /* Create temporary communication package */ + hypre_ParCSRCommPkgCreateAndFill(comm, + num_recvs, recv_procs, tmp_recv_vec_starts, + num_sends, send_procs, tmp_send_map_starts, + NULL, + &tmp_comm_pkg); AT_buf_j = hypre_CTAlloc(HYPRE_BigInt, tmp_send_map_starts[num_sends], HYPRE_MEMORY_HOST); comm_handle = hypre_ParCSRCommHandleCreate(22, tmp_comm_pkg, AT_big_j, @@ -1995,7 +2022,7 @@ hypre_ParCSRMatrixTransposeHost( hypre_ParCSRMatrix *A, if (data) { AT_buf_data = hypre_CTAlloc(HYPRE_Complex, tmp_send_map_starts[num_sends], HYPRE_MEMORY_HOST); - comm_handle = hypre_ParCSRCommHandleCreate(2,tmp_comm_pkg,AT_tmp_data, + comm_handle = hypre_ParCSRCommHandleCreate(2, tmp_comm_pkg, AT_tmp_data, AT_buf_data); hypre_ParCSRCommHandleDestroy(comm_handle); comm_handle = NULL; @@ -2024,7 +2051,7 @@ hypre_ParCSRMatrixTransposeHost( hypre_ParCSRMatrix *A, counter = 0; for (i = 0; i < num_sends; i++) { - for (j = send_map_starts[i]; j < send_map_starts[i+1]; j++) + for (j = send_map_starts[i]; j < send_map_starts[i + 1]; j++) { j_row = send_map_elmts[j]; index = AT_offd_i[j_row]; @@ -2041,13 +2068,13 @@ hypre_ParCSRMatrixTransposeHost( hypre_ParCSRMatrix *A, } for (i = num_cols; i > 0; i--) { - AT_offd_i[i] = AT_offd_i[i-1]; + AT_offd_i[i] = AT_offd_i[i - 1]; } AT_offd_i[0] = 0; if (counter) { - hypre_BigQsort0(AT_buf_j,0,counter-1); + hypre_BigQsort0(AT_buf_j, 0, counter - 1); num_cols_offd_AT = 1; value = AT_buf_j[0]; for (i = 1; i < counter; i++) @@ -2082,7 +2109,7 @@ hypre_ParCSRMatrixTransposeHost( hypre_ParCSRMatrix *A, for (i = 0; i < counter; i++) { - AT_offd_j[i] = hypre_BigBinarySearch(col_map_offd_AT,AT_big_j[i], + AT_offd_j[i] = hypre_BigBinarySearch(col_map_offd_AT, AT_big_j[i], num_cols_offd_AT); } hypre_TFree(AT_big_j, HYPRE_MEMORY_HOST); @@ -2103,8 +2130,8 @@ hypre_ParCSRMatrixTransposeHost( hypre_ParCSRMatrix *A, first_row_index_AT = row_starts_AT[0]; first_col_diag_AT = col_starts_AT[0]; - local_num_rows_AT = (HYPRE_Int)(row_starts_AT[1]-first_row_index_AT ); - local_num_cols_AT = (HYPRE_Int)(col_starts_AT[1]-first_col_diag_AT); + local_num_rows_AT = (HYPRE_Int)(row_starts_AT[1] - first_row_index_AT ); + local_num_cols_AT = (HYPRE_Int)(col_starts_AT[1] - first_col_diag_AT); AT = hypre_CTAlloc(hypre_ParCSRMatrix, 1, HYPRE_MEMORY_HOST); hypre_ParCSRMatrixComm(AT) = comm; @@ -2148,11 +2175,9 @@ hypre_ParCSRMatrixTranspose( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **AT_ptr, HYPRE_Int data ) { -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_GpuProfilingPushRange("ParCSRMatrixTranspose"); -#endif -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(A) ); if (exec == HYPRE_EXEC_DEVICE) @@ -2165,17 +2190,49 @@ hypre_ParCSRMatrixTranspose( hypre_ParCSRMatrix *A, hypre_ParCSRMatrixTransposeHost(A, AT_ptr, data); } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_GpuProfilingPopRange(); -#endif return hypre_error_flag; } -/* ----------------------------------------------------------------------------- +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixLocalTranspose + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixLocalTranspose( hypre_ParCSRMatrix *A ) +{ + if (!hypre_ParCSRMatrixDiagT(A)) + { + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + if (A_diag) + { + hypre_CSRMatrix *AT_diag = NULL; + hypre_CSRMatrixTranspose(A_diag, &AT_diag, 1); + hypre_ParCSRMatrixDiagT(A) = AT_diag; + } + } + + if (!hypre_ParCSRMatrixOffdT(A)) + { + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); + if (A_offd) + { + hypre_CSRMatrix *AT_offd = NULL; + hypre_CSRMatrixTranspose(A_offd, &AT_offd, 1); + hypre_ParCSRMatrixOffdT(A) = AT_offd; + } + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixGenSpanningTree + * * generate a parallel spanning tree (for Maxwell Equation) * G_csr is the node to edge connectivity matrix - * ----------------------------------------------------------------------------- */ + *--------------------------------------------------------------------------*/ void hypre_ParCSRMatrixGenSpanningTree( hypre_ParCSRMatrix *G_csr, @@ -2210,16 +2267,16 @@ hypre_ParCSRMatrixGenSpanningTree( hypre_ParCSRMatrix *G_csr, G_diag = hypre_ParCSRMatrixDiag(G_csr); T_diag_i = hypre_CSRMatrixI(G_diag); T_diag_j = hypre_CSRMatrixJ(G_diag); - counts = hypre_TAlloc(HYPRE_Int, nrows_G , HYPRE_MEMORY_HOST); - for (i = 0; i < nrows_G; i++) counts[i] = 0; - for (i = 0; i < T_diag_i[ncols_G]; i++) counts[T_diag_j[i]]++; - G_diag_i = hypre_TAlloc(HYPRE_Int, (nrows_G+1) , HYPRE_MEMORY_HOST); - G_diag_j = hypre_TAlloc(HYPRE_Int, T_diag_i[ncols_G] , HYPRE_MEMORY_HOST); + counts = hypre_TAlloc(HYPRE_Int, nrows_G, HYPRE_MEMORY_HOST); + for (i = 0; i < nrows_G; i++) { counts[i] = 0; } + for (i = 0; i < T_diag_i[ncols_G]; i++) { counts[T_diag_j[i]]++; } + G_diag_i = hypre_TAlloc(HYPRE_Int, (nrows_G + 1), HYPRE_MEMORY_HOST); + G_diag_j = hypre_TAlloc(HYPRE_Int, T_diag_i[ncols_G], HYPRE_MEMORY_HOST); G_diag_i[0] = 0; - for (i = 1; i <= nrows_G; i++) G_diag_i[i] = G_diag_i[i-1] + counts[i-1]; + for (i = 1; i <= nrows_G; i++) { G_diag_i[i] = G_diag_i[i - 1] + counts[i - 1]; } for (i = 0; i < ncols_G; i++) { - for (j = T_diag_i[i]; j < T_diag_i[i+1]; j++) + for (j = T_diag_i[i]; j < T_diag_i[i + 1]; j++) { k = T_diag_j[j]; offset = G_diag_i[k]++; @@ -2229,49 +2286,49 @@ hypre_ParCSRMatrixGenSpanningTree( hypre_ParCSRMatrix *G_csr, G_diag_i[0] = 0; for (i = 1; i <= nrows_G; i++) { - G_diag_i[i] = G_diag_i[i-1] + counts[i-1]; + G_diag_i[i] = G_diag_i[i - 1] + counts[i - 1]; } hypre_TFree(counts, HYPRE_MEMORY_HOST); } /* form G transpose in special form (2 nodes per edge max) */ - GT_diag_mat = hypre_TAlloc(HYPRE_Int, 2 * ncols_G , HYPRE_MEMORY_HOST); - for (i = 0; i < 2 * ncols_G; i++) GT_diag_mat[i] = -1; + GT_diag_mat = hypre_TAlloc(HYPRE_Int, 2 * ncols_G, HYPRE_MEMORY_HOST); + for (i = 0; i < 2 * ncols_G; i++) { GT_diag_mat[i] = -1; } for (i = 0; i < nrows_G; i++) { - for (j = G_diag_i[i]; j < G_diag_i[i+1]; j++) + for (j = G_diag_i[i]; j < G_diag_i[i + 1]; j++) { edge = G_diag_j[j]; - if (GT_diag_mat[edge*2] == -1) GT_diag_mat[edge*2] = i; - else GT_diag_mat[edge*2+1] = i; + if (GT_diag_mat[edge * 2] == -1) { GT_diag_mat[edge * 2] = i; } + else { GT_diag_mat[edge * 2 + 1] = i; } } } /* BFS on the local matrix graph to find tree */ - nodes_marked = hypre_TAlloc(HYPRE_Int, nrows_G , HYPRE_MEMORY_HOST); - edges_marked = hypre_TAlloc(HYPRE_Int, ncols_G , HYPRE_MEMORY_HOST); - for (i = 0; i < nrows_G; i++) nodes_marked[i] = 0; - for (i = 0; i < ncols_G; i++) edges_marked[i] = 0; - queue = hypre_TAlloc(HYPRE_Int, nrows_G , HYPRE_MEMORY_HOST); + nodes_marked = hypre_TAlloc(HYPRE_Int, nrows_G, HYPRE_MEMORY_HOST); + edges_marked = hypre_TAlloc(HYPRE_Int, ncols_G, HYPRE_MEMORY_HOST); + for (i = 0; i < nrows_G; i++) { nodes_marked[i] = 0; } + for (i = 0; i < ncols_G; i++) { edges_marked[i] = 0; } + queue = hypre_TAlloc(HYPRE_Int, nrows_G, HYPRE_MEMORY_HOST); queue_head = 0; queue_tail = 1; queue[0] = 0; nodes_marked[0] = 1; - while ((queue_tail-queue_head) > 0) + while ((queue_tail - queue_head) > 0) { - node = queue[queue_tail-1]; + node = queue[queue_tail - 1]; queue_tail--; - for (i = G_diag_i[node]; i < G_diag_i[node+1]; i++) + for (i = G_diag_i[node]; i < G_diag_i[node + 1]; i++) { edge = G_diag_j[i]; if (edges_marked[edge] == 0) { - if (GT_diag_mat[2*edge+1] != -1) + if (GT_diag_mat[2 * edge + 1] != -1) { - node2 = GT_diag_mat[2*edge]; - if (node2 == node) node2 = GT_diag_mat[2*edge+1]; + node2 = GT_diag_mat[2 * edge]; + if (node2 == node) { node2 = GT_diag_mat[2 * edge + 1]; } if (nodes_marked[node2] == 0) { nodes_marked[node2] = 1; @@ -2313,44 +2370,48 @@ hypre_ParCSRMatrixGenSpanningTree( hypre_ParCSRMatrix *G_csr, nrecvs = hypre_ParCSRCommPkgNumRecvs(comm_pkg); recv_procs = hypre_ParCSRCommPkgRecvProcs(comm_pkg); proc_array = NULL; - if ((nsends+nrecvs) > 0) + if ((nsends + nrecvs) > 0) { n_proc_array = 0; - proc_array = hypre_TAlloc(HYPRE_Int, (nsends+nrecvs) , HYPRE_MEMORY_HOST); - for (i = 0; i < nsends; i++) proc_array[i] = send_procs[i]; - for (i = 0; i < nrecvs; i++) proc_array[nsends+i] = recv_procs[i]; - hypre_qsort0(proc_array, 0, nsends+nrecvs-1); + proc_array = hypre_TAlloc(HYPRE_Int, (nsends + nrecvs), HYPRE_MEMORY_HOST); + for (i = 0; i < nsends; i++) { proc_array[i] = send_procs[i]; } + for (i = 0; i < nrecvs; i++) { proc_array[nsends + i] = recv_procs[i]; } + hypre_qsort0(proc_array, 0, nsends + nrecvs - 1); n_proc_array = 1; - for (i = 1; i < nrecvs+nsends; i++) + for (i = 1; i < nrecvs + nsends; i++) if (proc_array[i] != proc_array[n_proc_array]) + { proc_array[n_proc_array++] = proc_array[i]; + } } - pgraph_i = hypre_TAlloc(HYPRE_Int, (nprocs+1) , HYPRE_MEMORY_HOST); - recv_cnts = hypre_TAlloc(HYPRE_Int, nprocs , HYPRE_MEMORY_HOST); + pgraph_i = hypre_TAlloc(HYPRE_Int, (nprocs + 1), HYPRE_MEMORY_HOST); + recv_cnts = hypre_TAlloc(HYPRE_Int, nprocs, HYPRE_MEMORY_HOST); hypre_MPI_Allgather(&n_proc_array, 1, HYPRE_MPI_INT, recv_cnts, 1, HYPRE_MPI_INT, comm); pgraph_i[0] = 0; for (i = 1; i <= nprocs; i++) - pgraph_i[i] = pgraph_i[i-1] + recv_cnts[i-1]; - pgraph_j = hypre_TAlloc(HYPRE_Int, pgraph_i[nprocs] , HYPRE_MEMORY_HOST); + { + pgraph_i[i] = pgraph_i[i - 1] + recv_cnts[i - 1]; + } + pgraph_j = hypre_TAlloc(HYPRE_Int, pgraph_i[nprocs], HYPRE_MEMORY_HOST); hypre_MPI_Allgatherv(proc_array, n_proc_array, HYPRE_MPI_INT, pgraph_j, recv_cnts, pgraph_i, HYPRE_MPI_INT, comm); hypre_TFree(recv_cnts, HYPRE_MEMORY_HOST); /* BFS on the processor graph to determine parent and children */ - nodes_marked = hypre_TAlloc(HYPRE_Int, nprocs , HYPRE_MEMORY_HOST); - for (i = 0; i < nprocs; i++) nodes_marked[i] = -1; - queue = hypre_TAlloc(HYPRE_Int, nprocs , HYPRE_MEMORY_HOST); + nodes_marked = hypre_TAlloc(HYPRE_Int, nprocs, HYPRE_MEMORY_HOST); + for (i = 0; i < nprocs; i++) { nodes_marked[i] = -1; } + queue = hypre_TAlloc(HYPRE_Int, nprocs, HYPRE_MEMORY_HOST); queue_head = 0; queue_tail = 1; node = 0; queue[0] = node; - while ((queue_tail-queue_head) > 0) + while ((queue_tail - queue_head) > 0) { - proc = queue[queue_tail-1]; + proc = queue[queue_tail - 1]; queue_tail--; - for (i = pgraph_i[proc]; i < pgraph_i[proc+1]; i++) + for (i = pgraph_i[proc]; i < pgraph_i[proc + 1]; i++) { proc2 = pgraph_j[i]; if (nodes_marked[proc2] < 0) @@ -2363,14 +2424,14 @@ hypre_ParCSRMatrixGenSpanningTree( hypre_ParCSRMatrix *G_csr, } parent = nodes_marked[mypid]; n_children = 0; - for (i = 0; i < nprocs; i++) if (nodes_marked[i] == mypid) n_children++; + for (i = 0; i < nprocs; i++) if (nodes_marked[i] == mypid) { n_children++; } if (n_children == 0) {n_children = 0; children = NULL;} else { - children = hypre_TAlloc(HYPRE_Int, n_children , HYPRE_MEMORY_HOST); + children = hypre_TAlloc(HYPRE_Int, n_children, HYPRE_MEMORY_HOST); n_children = 0; for (i = 0; i < nprocs; i++) - if (nodes_marked[i] == mypid) children[n_children++] = i; + if (nodes_marked[i] == mypid) { children[n_children++] = i; } } hypre_TFree(nodes_marked, HYPRE_MEMORY_HOST); hypre_TFree(queue, HYPRE_MEMORY_HOST); @@ -2402,8 +2463,8 @@ hypre_ParCSRMatrixGenSpanningTree( hypre_ParCSRMatrix *G_csr, proc = hypre_ParCSRCommPkgSendProc(comm_pkg, i); if (proc == parent) { - k = hypre_ParCSRCommPkgSendMapStart(comm_pkg,i); - edge = hypre_ParCSRCommPkgSendMapElmt(comm_pkg,k); + k = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); + edge = hypre_ParCSRCommPkgSendMapElmt(comm_pkg, k); edges_marked[edge] = 1; break; } @@ -2422,8 +2483,8 @@ hypre_ParCSRMatrixGenSpanningTree( hypre_ParCSRMatrix *G_csr, proc2 = hypre_ParCSRCommPkgSendProc(comm_pkg, i); if (proc == proc2) { - k = hypre_ParCSRCommPkgSendMapStart(comm_pkg,i); - edge = hypre_ParCSRCommPkgSendMapElmt(comm_pkg,k); + k = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); + edge = hypre_ParCSRCommPkgSendMapElmt(comm_pkg, k); edges_marked[edge] = 1; break; } @@ -2438,12 +2499,12 @@ hypre_ParCSRMatrixGenSpanningTree( hypre_ParCSRMatrix *G_csr, tree_size = 0; for (i = 0; i < ncols_G; i++) - if (edges_marked[i] == 1) tree_size++; - t_indices = hypre_TAlloc(HYPRE_Int, (tree_size+1) , HYPRE_MEMORY_HOST); + if (edges_marked[i] == 1) { tree_size++; } + t_indices = hypre_TAlloc(HYPRE_Int, (tree_size + 1), HYPRE_MEMORY_HOST); t_indices[0] = tree_size; tree_size = 1; for (i = 0; i < ncols_G; i++) - if (edges_marked[i] == 1) t_indices[tree_size++] = i; + if (edges_marked[i] == 1) { t_indices[tree_size++] = i; } (*indices) = t_indices; hypre_TFree(edges_marked, HYPRE_MEMORY_HOST); if (G_type != 0) @@ -2479,7 +2540,7 @@ void hypre_ParCSRMatrixExtractSubmatrices( hypre_ParCSRMatrix *A_csr, nindices = indices2[0]; indices = &(indices2[1]); - hypre_qsort0(indices, 0, nindices-1); + hypre_qsort0(indices, 0, nindices - 1); /* ----------------------------------------------------- * fetch matrix information @@ -2495,7 +2556,7 @@ void hypre_ParCSRMatrixExtractSubmatrices( hypre_ParCSRMatrix *A_csr, hypre_MPI_Comm_size(comm, &nprocs); if (nprocs > 1) { - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"ExtractSubmatrices: cannot handle nprocs > 1 yet.\n"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ExtractSubmatrices: cannot handle nprocs > 1 yet.\n"); exit(1); } @@ -2503,8 +2564,8 @@ void hypre_ParCSRMatrixExtractSubmatrices( hypre_ParCSRMatrix *A_csr, * compute new matrix dimensions * ----------------------------------------------------- */ - proc_offsets1 = hypre_TAlloc(HYPRE_Int, (nprocs+1) , HYPRE_MEMORY_HOST); - proc_offsets2 = hypre_TAlloc(HYPRE_Int, (nprocs+1) , HYPRE_MEMORY_HOST); + proc_offsets1 = hypre_TAlloc(HYPRE_Int, (nprocs + 1), HYPRE_MEMORY_HOST); + proc_offsets2 = hypre_TAlloc(HYPRE_Int, (nprocs + 1), HYPRE_MEMORY_HOST); hypre_MPI_Allgather(&nindices, 1, HYPRE_MPI_INT, proc_offsets1, 1, HYPRE_MPI_INT, comm); k = 0; @@ -2525,14 +2586,14 @@ void hypre_ParCSRMatrixExtractSubmatrices( hypre_ParCSRMatrix *A_csr, * assign id's to row and col for later processing * ----------------------------------------------------- */ - exp_indices = hypre_TAlloc(HYPRE_Int, nrows_A , HYPRE_MEMORY_HOST); - for (i = 0; i < nrows_A; i++) exp_indices[i] = -1; + exp_indices = hypre_TAlloc(HYPRE_Int, nrows_A, HYPRE_MEMORY_HOST); + for (i = 0; i < nrows_A; i++) { exp_indices[i] = -1; } for (i = 0; i < nindices; i++) { - if (exp_indices[indices[i]] == -1) exp_indices[indices[i]] = i; + if (exp_indices[indices[i]] == -1) { exp_indices[indices[i]] = i; } else { - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"ExtractSubmatrices: wrong index %d %d\n"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ExtractSubmatrices: wrong index %d %d\n"); exit(1); } } @@ -2555,20 +2616,20 @@ void hypre_ParCSRMatrixExtractSubmatrices( hypre_ParCSRMatrix *A_csr, { if (exp_indices[i] >= 0) { - for (j = A_diag_i[i]; j < A_diag_i[i+1]; j++) + for (j = A_diag_i[i]; j < A_diag_i[i + 1]; j++) { col = A_diag_j[j]; - if (exp_indices[col] >= 0) nnz11++; - else nnz12++; + if (exp_indices[col] >= 0) { nnz11++; } + else { nnz12++; } } } else { - for (j = A_diag_i[i]; j < A_diag_i[i+1]; j++) + for (j = A_diag_i[i]; j < A_diag_i[i + 1]; j++) { col = A_diag_j[j]; - if (exp_indices[col] >= 0) nnz21++; - else nnz22++; + if (exp_indices[col] >= 0) { nnz21++; } + else { nnz22++; } } } } @@ -2589,7 +2650,7 @@ void hypre_ParCSRMatrixExtractSubmatrices( hypre_ParCSRMatrix *A_csr, row_starts, col_starts, ncols_offd, nnz_diag, nnz_offd); nrows = nindices; - diag_i = hypre_CTAlloc(HYPRE_Int, nrows+1, HYPRE_MEMORY_HOST); + diag_i = hypre_CTAlloc(HYPRE_Int, nrows + 1, HYPRE_MEMORY_HOST); diag_j = hypre_CTAlloc(HYPRE_Int, nnz_diag, HYPRE_MEMORY_HOST); diag_a = hypre_CTAlloc(HYPRE_Complex, nnz_diag, HYPRE_MEMORY_HOST); nnz = 0; @@ -2599,7 +2660,7 @@ void hypre_ParCSRMatrixExtractSubmatrices( hypre_ParCSRMatrix *A_csr, { if (exp_indices[i] >= 0) { - for (j = A_diag_i[i]; j < A_diag_i[i+1]; j++) + for (j = A_diag_i[i]; j < A_diag_i[i + 1]; j++) { col = A_diag_j[j]; if (exp_indices[col] >= 0) @@ -2617,8 +2678,8 @@ void hypre_ParCSRMatrixExtractSubmatrices( hypre_ParCSRMatrix *A_csr, hypre_CSRMatrixJ(diag) = diag_j; hypre_CSRMatrixData(diag) = diag_a; - offd_i = hypre_CTAlloc(HYPRE_Int, nrows+1, HYPRE_MEMORY_HOST); - for (i = 0; i <= nrows; i++) offd_i[i] = 0; + offd_i = hypre_CTAlloc(HYPRE_Int, nrows + 1, HYPRE_MEMORY_HOST); + for (i = 0; i <= nrows; i++) { offd_i[i] = 0; } offd = hypre_ParCSRMatrixOffd(A11_csr); hypre_CSRMatrixI(offd) = offd_i; hypre_CSRMatrixJ(offd) = NULL; @@ -2633,8 +2694,8 @@ void hypre_ParCSRMatrixExtractSubmatrices( hypre_ParCSRMatrix *A_csr, nnz_diag = nnz12; global_nrows = (HYPRE_BigInt)proc_offsets1[nprocs]; global_ncols = (HYPRE_BigInt)proc_offsets2[nprocs]; - row_starts = hypre_CTAlloc(HYPRE_BigInt, nprocs+1, HYPRE_MEMORY_HOST); - col_starts = hypre_CTAlloc(HYPRE_BigInt, nprocs+1, HYPRE_MEMORY_HOST); + row_starts = hypre_CTAlloc(HYPRE_BigInt, nprocs + 1, HYPRE_MEMORY_HOST); + col_starts = hypre_CTAlloc(HYPRE_BigInt, nprocs + 1, HYPRE_MEMORY_HOST); for (i = 0; i <= nprocs; i++) { row_starts[i] = (HYPRE_BigInt)proc_offsets1[i]; @@ -2644,7 +2705,7 @@ void hypre_ParCSRMatrixExtractSubmatrices( hypre_ParCSRMatrix *A_csr, row_starts, col_starts, ncols_offd, nnz_diag, nnz_offd); nrows = nindices; - diag_i = hypre_CTAlloc(HYPRE_Int, nrows+1, HYPRE_MEMORY_HOST); + diag_i = hypre_CTAlloc(HYPRE_Int, nrows + 1, HYPRE_MEMORY_HOST); diag_j = hypre_CTAlloc(HYPRE_Int, nnz_diag, HYPRE_MEMORY_HOST); diag_a = hypre_CTAlloc(HYPRE_Complex, nnz_diag, HYPRE_MEMORY_HOST); nnz = 0; @@ -2654,7 +2715,7 @@ void hypre_ParCSRMatrixExtractSubmatrices( hypre_ParCSRMatrix *A_csr, { if (exp_indices[i] >= 0) { - for (j = A_diag_i[i]; j < A_diag_i[i+1]; j++) + for (j = A_diag_i[i]; j < A_diag_i[i + 1]; j++) { col = A_diag_j[j]; if (exp_indices[col] < 0) @@ -2679,8 +2740,8 @@ void hypre_ParCSRMatrixExtractSubmatrices( hypre_ParCSRMatrix *A_csr, hypre_CSRMatrixJ(diag) = diag_j; hypre_CSRMatrixData(diag) = diag_a; - offd_i = hypre_CTAlloc(HYPRE_Int, nrows+1, HYPRE_MEMORY_HOST); - for (i = 0; i <= nrows; i++) offd_i[i] = 0; + offd_i = hypre_CTAlloc(HYPRE_Int, nrows + 1, HYPRE_MEMORY_HOST); + for (i = 0; i <= nrows; i++) { offd_i[i] = 0; } offd = hypre_ParCSRMatrixOffd(A12_csr); hypre_CSRMatrixI(offd) = offd_i; hypre_CSRMatrixJ(offd) = NULL; @@ -2697,8 +2758,8 @@ void hypre_ParCSRMatrixExtractSubmatrices( hypre_ParCSRMatrix *A_csr, nnz_diag = nnz21; global_nrows = (HYPRE_BigInt)proc_offsets2[nprocs]; global_ncols = (HYPRE_BigInt)proc_offsets1[nprocs]; - row_starts = hypre_CTAlloc(HYPRE_BigInt, nprocs+1, HYPRE_MEMORY_HOST); - col_starts = hypre_CTAlloc(HYPRE_BigInt, nprocs+1, HYPRE_MEMORY_HOST); + row_starts = hypre_CTAlloc(HYPRE_BigInt, nprocs + 1, HYPRE_MEMORY_HOST); + col_starts = hypre_CTAlloc(HYPRE_BigInt, nprocs + 1, HYPRE_MEMORY_HOST); for (i = 0; i <= nprocs; i++) { row_starts[i] = (HYPRE_BigInt)proc_offsets2[i]; @@ -2708,7 +2769,7 @@ void hypre_ParCSRMatrixExtractSubmatrices( hypre_ParCSRMatrix *A_csr, row_starts, col_starts, ncols_offd, nnz_diag, nnz_offd); nrows = nrows_A - nindices; - diag_i = hypre_CTAlloc(HYPRE_Int, nrows+1, HYPRE_MEMORY_HOST); + diag_i = hypre_CTAlloc(HYPRE_Int, nrows + 1, HYPRE_MEMORY_HOST); diag_j = hypre_CTAlloc(HYPRE_Int, nnz_diag, HYPRE_MEMORY_HOST); diag_a = hypre_CTAlloc(HYPRE_Complex, nnz_diag, HYPRE_MEMORY_HOST); nnz = 0; @@ -2718,7 +2779,7 @@ void hypre_ParCSRMatrixExtractSubmatrices( hypre_ParCSRMatrix *A_csr, { if (exp_indices[i] < 0) { - for (j = A_diag_i[i]; j < A_diag_i[i+1]; j++) + for (j = A_diag_i[i]; j < A_diag_i[i + 1]; j++) { col = A_diag_j[j]; if (exp_indices[col] >= 0) @@ -2736,8 +2797,8 @@ void hypre_ParCSRMatrixExtractSubmatrices( hypre_ParCSRMatrix *A_csr, hypre_CSRMatrixJ(diag) = diag_j; hypre_CSRMatrixData(diag) = diag_a; - offd_i = hypre_CTAlloc(HYPRE_Int, nrows+1, HYPRE_MEMORY_HOST); - for (i = 0; i <= nrows; i++) offd_i[i] = 0; + offd_i = hypre_CTAlloc(HYPRE_Int, nrows + 1, HYPRE_MEMORY_HOST); + for (i = 0; i <= nrows; i++) { offd_i[i] = 0; } offd = hypre_ParCSRMatrixOffd(A21_csr); hypre_CSRMatrixI(offd) = offd_i; hypre_CSRMatrixJ(offd) = NULL; @@ -2754,8 +2815,8 @@ void hypre_ParCSRMatrixExtractSubmatrices( hypre_ParCSRMatrix *A_csr, nnz_diag = nnz22; global_nrows = (HYPRE_BigInt)proc_offsets2[nprocs]; global_ncols = (HYPRE_BigInt)proc_offsets2[nprocs]; - row_starts = hypre_CTAlloc(HYPRE_BigInt, nprocs+1, HYPRE_MEMORY_HOST); - col_starts = hypre_CTAlloc(HYPRE_BigInt, nprocs+1, HYPRE_MEMORY_HOST); + row_starts = hypre_CTAlloc(HYPRE_BigInt, nprocs + 1, HYPRE_MEMORY_HOST); + col_starts = hypre_CTAlloc(HYPRE_BigInt, nprocs + 1, HYPRE_MEMORY_HOST); for (i = 0; i <= nprocs; i++) { row_starts[i] = (HYPRE_BigInt)proc_offsets2[i]; @@ -2765,7 +2826,7 @@ void hypre_ParCSRMatrixExtractSubmatrices( hypre_ParCSRMatrix *A_csr, row_starts, col_starts, ncols_offd, nnz_diag, nnz_offd); nrows = nrows_A - nindices; - diag_i = hypre_CTAlloc(HYPRE_Int, nrows+1, HYPRE_MEMORY_HOST); + diag_i = hypre_CTAlloc(HYPRE_Int, nrows + 1, HYPRE_MEMORY_HOST); diag_j = hypre_CTAlloc(HYPRE_Int, nnz_diag, HYPRE_MEMORY_HOST); diag_a = hypre_CTAlloc(HYPRE_Complex, nnz_diag, HYPRE_MEMORY_HOST); nnz = 0; @@ -2775,7 +2836,7 @@ void hypre_ParCSRMatrixExtractSubmatrices( hypre_ParCSRMatrix *A_csr, { if (exp_indices[i] < 0) { - for (j = A_diag_i[i]; j < A_diag_i[i+1]; j++) + for (j = A_diag_i[i]; j < A_diag_i[i + 1]; j++) { col = A_diag_j[j]; if (exp_indices[col] < 0) @@ -2793,8 +2854,8 @@ void hypre_ParCSRMatrixExtractSubmatrices( hypre_ParCSRMatrix *A_csr, hypre_CSRMatrixJ(diag) = diag_j; hypre_CSRMatrixData(diag) = diag_a; - offd_i = hypre_CTAlloc(HYPRE_Int, nrows+1, HYPRE_MEMORY_HOST); - for (i = 0; i <= nrows; i++) offd_i[i] = 0; + offd_i = hypre_CTAlloc(HYPRE_Int, nrows + 1, HYPRE_MEMORY_HOST); + for (i = 0; i <= nrows; i++) { offd_i[i] = 0; } offd = hypre_ParCSRMatrixOffd(A22_csr); hypre_CSRMatrixI(offd) = offd_i; hypre_CSRMatrixJ(offd) = NULL; @@ -2841,7 +2902,7 @@ void hypre_ParCSRMatrixExtractRowSubmatrices( hypre_ParCSRMatrix *A_csr, nindices = indices2[0]; indices = &(indices2[1]); - hypre_qsort0(indices, 0, nindices-1); + hypre_qsort0(indices, 0, nindices - 1); /* ----------------------------------------------------- * fetch matrix information @@ -2863,8 +2924,8 @@ void hypre_ParCSRMatrixExtractRowSubmatrices( hypre_ParCSRMatrix *A_csr, * compute new matrix dimensions * ----------------------------------------------------- */ - proc_offsets1 = hypre_TAlloc(HYPRE_Int, (nprocs+1) , HYPRE_MEMORY_HOST); - proc_offsets2 = hypre_TAlloc(HYPRE_Int, (nprocs+1) , HYPRE_MEMORY_HOST); + proc_offsets1 = hypre_TAlloc(HYPRE_Int, (nprocs + 1), HYPRE_MEMORY_HOST); + proc_offsets2 = hypre_TAlloc(HYPRE_Int, (nprocs + 1), HYPRE_MEMORY_HOST); hypre_MPI_Allgather(&nindices, 1, HYPRE_MPI_INT, proc_offsets1, 1, HYPRE_MPI_INT, comm); k = 0; @@ -2877,20 +2938,22 @@ void hypre_ParCSRMatrixExtractRowSubmatrices( hypre_ParCSRMatrix *A_csr, proc_offsets1[nprocs] = k; itmp_array = hypre_ParCSRMatrixRowStarts(A_csr); for (i = 0; i <= nprocs; i++) + { proc_offsets2[i] = (HYPRE_Int)(itmp_array[i] - proc_offsets1[i]); + } /* ----------------------------------------------------- * assign id's to row and col for later processing * ----------------------------------------------------- */ - exp_indices = hypre_TAlloc(HYPRE_Int, nrows_A , HYPRE_MEMORY_HOST); - for (i = 0; i < nrows_A; i++) exp_indices[i] = -1; + exp_indices = hypre_TAlloc(HYPRE_Int, nrows_A, HYPRE_MEMORY_HOST); + for (i = 0; i < nrows_A; i++) { exp_indices[i] = -1; } for (i = 0; i < nindices; i++) { - if (exp_indices[indices[i]] == -1) exp_indices[indices[i]] = i; + if (exp_indices[indices[i]] == -1) { exp_indices[indices[i]] = i; } else { - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"ExtractRowSubmatrices: wrong index %d %d\n"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ExtractRowSubmatrices: wrong index %d %d\n"); exit(1); } } @@ -2913,21 +2976,21 @@ void hypre_ParCSRMatrixExtractRowSubmatrices( hypre_ParCSRMatrix *A_csr, { if (exp_indices[i] >= 0) { - for (j = A_diag_i[i]; j < A_diag_i[i+1]; j++) + for (j = A_diag_i[i]; j < A_diag_i[i + 1]; j++) { col = A_diag_j[j]; - if (exp_indices[col] >= 0) nnz11++; + if (exp_indices[col] >= 0) { nnz11++; } } - nnz11_offd += A_offd_i[i+1] - A_offd_i[i]; + nnz11_offd += A_offd_i[i + 1] - A_offd_i[i]; } else { - for (j = A_diag_i[i]; j < A_diag_i[i+1]; j++) + for (j = A_diag_i[i]; j < A_diag_i[i + 1]; j++) { col = A_diag_j[j]; - if (exp_indices[col] < 0) nnz21++; + if (exp_indices[col] < 0) { nnz21++; } } - nnz21_offd += A_offd_i[i+1] - A_offd_i[i]; + nnz21_offd += A_offd_i[i + 1] - A_offd_i[i]; } } @@ -2942,8 +3005,8 @@ void hypre_ParCSRMatrixExtractRowSubmatrices( hypre_ParCSRMatrix *A_csr, global_nrows = (HYPRE_BigInt)proc_offsets1[nprocs]; itmp_array = hypre_ParCSRMatrixColStarts(A_csr); global_ncols = itmp_array[nprocs]; - row_starts = hypre_CTAlloc(HYPRE_BigInt, nprocs+1, HYPRE_MEMORY_HOST); - col_starts = hypre_CTAlloc(HYPRE_BigInt, nprocs+1, HYPRE_MEMORY_HOST); + row_starts = hypre_CTAlloc(HYPRE_BigInt, nprocs + 1, HYPRE_MEMORY_HOST); + col_starts = hypre_CTAlloc(HYPRE_BigInt, nprocs + 1, HYPRE_MEMORY_HOST); for (i = 0; i <= nprocs; i++) { row_starts[i] = (HYPRE_BigInt)proc_offsets1[i]; @@ -2953,7 +3016,7 @@ void hypre_ParCSRMatrixExtractRowSubmatrices( hypre_ParCSRMatrix *A_csr, row_starts, col_starts, ncols_offd, nnz_diag, nnz_offd); nrows = nindices; - diag_i = hypre_CTAlloc(HYPRE_Int, nrows+1, HYPRE_MEMORY_HOST); + diag_i = hypre_CTAlloc(HYPRE_Int, nrows + 1, HYPRE_MEMORY_HOST); diag_j = hypre_CTAlloc(HYPRE_Int, nnz_diag, HYPRE_MEMORY_HOST); diag_a = hypre_CTAlloc(HYPRE_Complex, nnz_diag, HYPRE_MEMORY_HOST); nnz = 0; @@ -2963,7 +3026,7 @@ void hypre_ParCSRMatrixExtractRowSubmatrices( hypre_ParCSRMatrix *A_csr, { if (exp_indices[i] >= 0) { - for (j = A_diag_i[i]; j < A_diag_i[i+1]; j++) + for (j = A_diag_i[i]; j < A_diag_i[i + 1]; j++) { col = A_diag_j[j]; if (exp_indices[col] >= 0) @@ -2981,7 +3044,7 @@ void hypre_ParCSRMatrixExtractRowSubmatrices( hypre_ParCSRMatrix *A_csr, hypre_CSRMatrixJ(diag) = diag_j; hypre_CSRMatrixData(diag) = diag_a; - offd_i = hypre_CTAlloc(HYPRE_Int, nrows+1, HYPRE_MEMORY_HOST); + offd_i = hypre_CTAlloc(HYPRE_Int, nrows + 1, HYPRE_MEMORY_HOST); offd_j = hypre_CTAlloc(HYPRE_Int, nnz_offd, HYPRE_MEMORY_HOST); offd_a = hypre_CTAlloc(HYPRE_Complex, nnz_offd, HYPRE_MEMORY_HOST); nnz = 0; @@ -2991,7 +3054,7 @@ void hypre_ParCSRMatrixExtractRowSubmatrices( hypre_ParCSRMatrix *A_csr, { if (exp_indices[i] >= 0) { - for (j = A_offd_i[i]; j < A_offd_i[i+1]; j++) + for (j = A_offd_i[i]; j < A_offd_i[i + 1]; j++) { offd_j[nnz] = A_offd_j[j]; offd_a[nnz++] = A_diag_a[j]; @@ -3017,8 +3080,8 @@ void hypre_ParCSRMatrixExtractRowSubmatrices( hypre_ParCSRMatrix *A_csr, global_nrows = (HYPRE_BigInt)proc_offsets2[nprocs]; itmp_array = hypre_ParCSRMatrixColStarts(A_csr); global_ncols = itmp_array[nprocs]; - row_starts = hypre_CTAlloc(HYPRE_BigInt, nprocs+1, HYPRE_MEMORY_HOST); - col_starts = hypre_CTAlloc(HYPRE_BigInt, nprocs+1, HYPRE_MEMORY_HOST); + row_starts = hypre_CTAlloc(HYPRE_BigInt, nprocs + 1, HYPRE_MEMORY_HOST); + col_starts = hypre_CTAlloc(HYPRE_BigInt, nprocs + 1, HYPRE_MEMORY_HOST); for (i = 0; i <= nprocs; i++) { row_starts[i] = (HYPRE_BigInt)proc_offsets2[i]; @@ -3028,7 +3091,7 @@ void hypre_ParCSRMatrixExtractRowSubmatrices( hypre_ParCSRMatrix *A_csr, row_starts, col_starts, ncols_offd, nnz_diag, nnz_offd); nrows = nrows_A - nindices; - diag_i = hypre_CTAlloc(HYPRE_Int, nrows+1, HYPRE_MEMORY_HOST); + diag_i = hypre_CTAlloc(HYPRE_Int, nrows + 1, HYPRE_MEMORY_HOST); diag_j = hypre_CTAlloc(HYPRE_Int, nnz_diag, HYPRE_MEMORY_HOST); diag_a = hypre_CTAlloc(HYPRE_Complex, nnz_diag, HYPRE_MEMORY_HOST); nnz = 0; @@ -3038,7 +3101,7 @@ void hypre_ParCSRMatrixExtractRowSubmatrices( hypre_ParCSRMatrix *A_csr, { if (exp_indices[i] < 0) { - for (j = A_diag_i[i]; j < A_diag_i[i+1]; j++) + for (j = A_diag_i[i]; j < A_diag_i[i + 1]; j++) { diag_j[nnz] = A_diag_j[j]; diag_a[nnz++] = A_diag_a[j]; @@ -3052,7 +3115,7 @@ void hypre_ParCSRMatrixExtractRowSubmatrices( hypre_ParCSRMatrix *A_csr, hypre_CSRMatrixJ(diag) = diag_j; hypre_CSRMatrixData(diag) = diag_a; - offd_i = hypre_CTAlloc(HYPRE_Int, nrows+1, HYPRE_MEMORY_HOST); + offd_i = hypre_CTAlloc(HYPRE_Int, nrows + 1, HYPRE_MEMORY_HOST); offd_j = hypre_CTAlloc(HYPRE_Int, nnz_offd, HYPRE_MEMORY_HOST); offd_a = hypre_CTAlloc(HYPRE_Complex, nnz_offd, HYPRE_MEMORY_HOST); nnz = 0; @@ -3062,7 +3125,7 @@ void hypre_ParCSRMatrixExtractRowSubmatrices( hypre_ParCSRMatrix *A_csr, { if (exp_indices[i] < 0) { - for (j = A_offd_i[i]; j < A_offd_i[i+1]; j++) + for (j = A_offd_i[i]; j < A_offd_i[i + 1]; j++) { offd_j[nnz] = A_offd_j[j]; offd_a[nnz++] = A_diag_a[j]; @@ -3108,76 +3171,73 @@ HYPRE_Complex hypre_ParCSRMatrixLocalSumElts( hypre_ParCSRMatrix * A ) *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_ParCSRMatrixAminvDB( hypre_ParCSRMatrix *A, - hypre_ParCSRMatrix *B, - HYPRE_Complex *d, +hypre_ParCSRMatrixAminvDB( hypre_ParCSRMatrix *A, + hypre_ParCSRMatrix *B, + HYPRE_Complex *d, hypre_ParCSRMatrix **C_ptr) { - MPI_Comm comm = hypre_ParCSRMatrixComm(B); - hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); - hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); - hypre_ParCSRMatrix *C = NULL; - HYPRE_Int num_cols_offd_A = hypre_CSRMatrixNumCols(A_offd); - - hypre_ParCSRCommPkg *comm_pkg_B = hypre_ParCSRMatrixCommPkg(B); - hypre_CSRMatrix *B_diag = hypre_ParCSRMatrixDiag(B); - hypre_CSRMatrix *B_offd = hypre_ParCSRMatrixOffd(B); - HYPRE_Int num_cols_offd_B = hypre_CSRMatrixNumCols(B_offd); - HYPRE_Int num_sends_B, num_recvs_B; - HYPRE_Int i, j, cnt; - - HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); - HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); - HYPRE_Complex *A_diag_data = hypre_CSRMatrixData(A_diag); - HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); - HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); - HYPRE_Complex *A_offd_data = hypre_CSRMatrixData(A_offd); - HYPRE_BigInt *col_map_offd_A = hypre_ParCSRMatrixColMapOffd(A); - - HYPRE_Int num_rows = hypre_CSRMatrixNumRows(B_diag); - HYPRE_Int *B_diag_i = hypre_CSRMatrixI(B_diag); - HYPRE_Int *B_diag_j = hypre_CSRMatrixJ(B_diag); - HYPRE_Complex *B_diag_data = hypre_CSRMatrixData(B_diag); - HYPRE_Int *B_offd_i = hypre_CSRMatrixI(B_offd); - HYPRE_Int *B_offd_j = hypre_CSRMatrixJ(B_offd); - HYPRE_Complex *B_offd_data = hypre_CSRMatrixData(B_offd); - HYPRE_BigInt *col_map_offd_B = hypre_ParCSRMatrixColMapOffd(B); - - hypre_CSRMatrix *C_diag = NULL; - hypre_CSRMatrix *C_offd = NULL; - HYPRE_Int *C_diag_i = NULL; - HYPRE_Int *C_diag_j = NULL; - HYPRE_Complex *C_diag_data = NULL; - HYPRE_Int *C_offd_i = NULL; - HYPRE_Int *C_offd_j = NULL; - HYPRE_Complex *C_offd_data = NULL; - - HYPRE_Int num_procs, my_id; + MPI_Comm comm = hypre_ParCSRMatrixComm(B); + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); + HYPRE_Int num_cols_offd_A = hypre_CSRMatrixNumCols(A_offd); + + hypre_ParCSRCommPkg *comm_pkg_B = hypre_ParCSRMatrixCommPkg(B); + hypre_CSRMatrix *B_diag = hypre_ParCSRMatrixDiag(B); + hypre_CSRMatrix *B_offd = hypre_ParCSRMatrixOffd(B); + HYPRE_Int num_cols_offd_B = hypre_CSRMatrixNumCols(B_offd); + HYPRE_Int num_sends_B; + HYPRE_Int num_recvs_B; + HYPRE_Int i, j, cnt; + + HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); + HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); + HYPRE_Complex *A_diag_data = hypre_CSRMatrixData(A_diag); + + HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); + HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); + HYPRE_Complex *A_offd_data = hypre_CSRMatrixData(A_offd); + HYPRE_BigInt *col_map_offd_A = hypre_ParCSRMatrixColMapOffd(A); + + HYPRE_Int num_rows = hypre_CSRMatrixNumRows(B_diag); + HYPRE_Int *B_diag_i = hypre_CSRMatrixI(B_diag); + HYPRE_Int *B_diag_j = hypre_CSRMatrixJ(B_diag); + HYPRE_Complex *B_diag_data = hypre_CSRMatrixData(B_diag); + + HYPRE_Int *B_offd_i = hypre_CSRMatrixI(B_offd); + HYPRE_Int *B_offd_j = hypre_CSRMatrixJ(B_offd); + HYPRE_Complex *B_offd_data = hypre_CSRMatrixData(B_offd); + HYPRE_BigInt *col_map_offd_B = hypre_ParCSRMatrixColMapOffd(B); + + hypre_ParCSRMatrix *C = NULL; + hypre_CSRMatrix *C_diag = NULL; + hypre_CSRMatrix *C_offd = NULL; + HYPRE_Int *C_diag_i = NULL; + HYPRE_Int *C_diag_j = NULL; + HYPRE_Complex *C_diag_data = NULL; + HYPRE_Int *C_offd_i = NULL; + HYPRE_Int *C_offd_j = NULL; + HYPRE_Complex *C_offd_data = NULL; + + HYPRE_Int num_procs, my_id; + HYPRE_Int *recv_procs_B; + HYPRE_Int *send_procs_B; + HYPRE_Int *recv_vec_starts_B; + HYPRE_Int *send_map_starts_B; + HYPRE_Int *send_map_elmts_B; + hypre_ParCSRCommPkg *comm_pkg_C = NULL; + HYPRE_Int *recv_procs_C; + HYPRE_Int *send_procs_C; + HYPRE_Int *recv_vec_starts_C; + HYPRE_Int *send_map_starts_C; + HYPRE_Int *send_map_elmts_C; + HYPRE_Int *map_to_B = NULL; + HYPRE_Complex *D_tmp; + HYPRE_Int size, rest, num_threads, ii; - HYPRE_Int *recv_procs_B; - HYPRE_Int *send_procs_B; - HYPRE_Int *recv_vec_starts_B; - HYPRE_Int *send_map_starts_B; - HYPRE_Int *send_map_elmts_B; - hypre_ParCSRCommPkg *comm_pkg_C; - HYPRE_Int *recv_procs_C; - HYPRE_Int *send_procs_C; - HYPRE_Int *recv_vec_starts_C; - HYPRE_Int *send_map_starts_C; - HYPRE_Int *send_map_elmts_C; - HYPRE_Int *map_to_B; - - /*HYPRE_Int *C_diag_array; - HYPRE_Int *C_offd_array;*/ - HYPRE_Complex *D_tmp; - HYPRE_Int size, rest, num_threads, ii; - - hypre_MPI_Comm_size(comm,&num_procs); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); num_threads = hypre_NumThreads(); - /*C_diag_array = hypre_CTAlloc(HYPRE_Int, num_threads); - C_offd_array = hypre_CTAlloc(HYPRE_Int, num_threads, HYPRE_MEMORY_HOST);*/ /*--------------------------------------------------------------------- * If there exists no CommPkg for B, a CommPkg is generated @@ -3201,8 +3261,8 @@ hypre_ParCSRMatrixAminvDB( hypre_ParCSRMatrix *A, C_offd_j = hypre_CSRMatrixJ(C_offd); C_offd_data = hypre_CSRMatrixData(C_offd); - size = num_rows/num_threads; - rest = num_rows - size*num_threads; + size = num_rows / num_threads; + rest = num_rows - size * num_threads; D_tmp = hypre_CTAlloc(HYPRE_Complex, num_rows, HYPRE_MEMORY_HOST); @@ -3222,21 +3282,21 @@ hypre_ParCSRMatrixAminvDB( hypre_ParCSRMatrix *A, } #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(ii, i, j) + #pragma omp parallel for private(ii, i, j) #endif - for (ii=0; ii < num_threads; ii++) + for (ii = 0; ii < num_threads; ii++) { HYPRE_Int *A_marker = NULL; HYPRE_Int ns, ne, A_col, num_cols, nmax; if (ii < rest) { - ns = ii*size+ii; - ne = (ii+1)*size+ii+1; + ns = ii * size + ii; + ne = (ii + 1) * size + ii + 1; } else { - ns = ii*size+rest; - ne = (ii+1)*size+rest; + ns = ii * size + rest; + ne = (ii + 1) * size + rest; } nmax = hypre_max(num_rows, num_cols_offd_B); A_marker = hypre_CTAlloc(HYPRE_Int, nmax, HYPRE_MEMORY_HOST); @@ -3248,13 +3308,13 @@ hypre_ParCSRMatrixAminvDB( hypre_ParCSRMatrix *A, for (i = ns; i < ne; i++) { - D_tmp[i] = 1.0/d[i]; + D_tmp[i] = 1.0 / d[i]; } num_cols = C_diag_i[ns]; for (i = ns; i < ne; i++) { - for (j = A_diag_i[i]; j < A_diag_i[i+1]; j++) + for (j = A_diag_i[i]; j < A_diag_i[i + 1]; j++) { A_col = A_diag_j[j]; if (A_marker[A_col] < C_diag_i[i]) @@ -3269,19 +3329,19 @@ hypre_ParCSRMatrixAminvDB( hypre_ParCSRMatrix *A, C_diag_data[A_marker[A_col]] += A_diag_data[j]; } } - for (j = B_diag_i[i]; j < B_diag_i[i+1]; j++) + for (j = B_diag_i[i]; j < B_diag_i[i + 1]; j++) { A_col = B_diag_j[j]; if (A_marker[A_col] < C_diag_i[i]) { A_marker[A_col] = num_cols; C_diag_j[num_cols] = A_col; - C_diag_data[num_cols] = -D_tmp[i]*B_diag_data[j]; + C_diag_data[num_cols] = -D_tmp[i] * B_diag_data[j]; num_cols++; } else { - C_diag_data[A_marker[A_col]] -= D_tmp[i]*B_diag_data[j]; + C_diag_data[A_marker[A_col]] -= D_tmp[i] * B_diag_data[j]; } } } @@ -3294,7 +3354,7 @@ hypre_ParCSRMatrixAminvDB( hypre_ParCSRMatrix *A, num_cols = C_offd_i[ns]; for (i = ns; i < ne; i++) { - for (j = A_offd_i[i]; j < A_offd_i[i+1]; j++) + for (j = A_offd_i[i]; j < A_offd_i[i + 1]; j++) { A_col = map_to_B[A_offd_j[j]]; if (A_marker[A_col] < B_offd_i[i]) @@ -3309,19 +3369,19 @@ hypre_ParCSRMatrixAminvDB( hypre_ParCSRMatrix *A, C_offd_data[A_marker[A_col]] += A_offd_data[j]; } } - for (j = B_offd_i[i]; j < B_offd_i[i+1]; j++) + for (j = B_offd_i[i]; j < B_offd_i[i + 1]; j++) { A_col = B_offd_j[j]; if (A_marker[A_col] < B_offd_i[i]) { A_marker[A_col] = num_cols; C_offd_j[num_cols] = A_col; - C_offd_data[num_cols] = -D_tmp[i]*B_offd_data[j]; + C_offd_data[num_cols] = -D_tmp[i] * B_offd_data[j]; num_cols++; } else { - C_offd_data[A_marker[A_col]] -= D_tmp[i]*B_offd_data[j]; + C_offd_data[A_marker[A_col]] -= D_tmp[i] * B_offd_data[j]; } } } @@ -3332,49 +3392,59 @@ hypre_ParCSRMatrixAminvDB( hypre_ParCSRMatrix *A, /*for (i=0; i < num_cols_offd_B; i++) col_map_offd_C[i] = col_map_offd_B[i]; */ - num_sends_B = hypre_ParCSRCommPkgNumSends(comm_pkg_B); - num_recvs_B = hypre_ParCSRCommPkgNumRecvs(comm_pkg_B); - recv_procs_B = hypre_ParCSRCommPkgRecvProcs(comm_pkg_B); + num_sends_B = hypre_ParCSRCommPkgNumSends(comm_pkg_B); + num_recvs_B = hypre_ParCSRCommPkgNumRecvs(comm_pkg_B); + recv_procs_B = hypre_ParCSRCommPkgRecvProcs(comm_pkg_B); recv_vec_starts_B = hypre_ParCSRCommPkgRecvVecStarts(comm_pkg_B); - send_procs_B = hypre_ParCSRCommPkgSendProcs(comm_pkg_B); + send_procs_B = hypre_ParCSRCommPkgSendProcs(comm_pkg_B); send_map_starts_B = hypre_ParCSRCommPkgSendMapStarts(comm_pkg_B); - send_map_elmts_B = hypre_ParCSRCommPkgSendMapElmts(comm_pkg_B); + send_map_elmts_B = hypre_ParCSRCommPkgSendMapElmts(comm_pkg_B); - recv_procs_C = hypre_CTAlloc(HYPRE_Int, num_recvs_B, HYPRE_MEMORY_HOST); - recv_vec_starts_C = hypre_CTAlloc(HYPRE_Int, num_recvs_B+1, HYPRE_MEMORY_HOST); - send_procs_C = hypre_CTAlloc(HYPRE_Int, num_sends_B, HYPRE_MEMORY_HOST); - send_map_starts_C = hypre_CTAlloc(HYPRE_Int, num_sends_B+1, HYPRE_MEMORY_HOST); - send_map_elmts_C = hypre_CTAlloc(HYPRE_Int, send_map_starts_B[num_sends_B], HYPRE_MEMORY_HOST); + recv_procs_C = hypre_CTAlloc(HYPRE_Int, num_recvs_B, HYPRE_MEMORY_HOST); + recv_vec_starts_C = hypre_CTAlloc(HYPRE_Int, num_recvs_B + 1, HYPRE_MEMORY_HOST); + send_procs_C = hypre_CTAlloc(HYPRE_Int, num_sends_B, HYPRE_MEMORY_HOST); + send_map_starts_C = hypre_CTAlloc(HYPRE_Int, num_sends_B + 1, HYPRE_MEMORY_HOST); + send_map_elmts_C = hypre_CTAlloc(HYPRE_Int, send_map_starts_B[num_sends_B], HYPRE_MEMORY_HOST); - for (i=0; i < num_recvs_B; i++) + for (i = 0; i < num_recvs_B; i++) + { recv_procs_C[i] = recv_procs_B[i]; - for (i=0; i < num_recvs_B+1; i++) + } + for (i = 0; i < num_recvs_B + 1; i++) + { recv_vec_starts_C[i] = recv_vec_starts_B[i]; - for (i=0; i < num_sends_B; i++) + } + for (i = 0; i < num_sends_B; i++) + { send_procs_C[i] = send_procs_B[i]; - for (i=0; i < num_sends_B+1; i++) + } + for (i = 0; i < num_sends_B + 1; i++) + { send_map_starts_C[i] = send_map_starts_B[i]; - for (i=0; i < send_map_starts_B[num_sends_B]; i++) + } + for (i = 0; i < send_map_starts_B[num_sends_B]; i++) + { send_map_elmts_C[i] = send_map_elmts_B[i]; + } - comm_pkg_C = hypre_CTAlloc(hypre_ParCSRCommPkg, 1, HYPRE_MEMORY_HOST); - hypre_ParCSRCommPkgComm(comm_pkg_C) = comm; - hypre_ParCSRCommPkgNumRecvs(comm_pkg_C) = num_recvs_B; - hypre_ParCSRCommPkgRecvProcs(comm_pkg_C) = recv_procs_C; - hypre_ParCSRCommPkgRecvVecStarts(comm_pkg_C) = recv_vec_starts_C; - hypre_ParCSRCommPkgNumSends(comm_pkg_C) = num_sends_B; - hypre_ParCSRCommPkgSendProcs(comm_pkg_C) = send_procs_C; - hypre_ParCSRCommPkgSendMapStarts(comm_pkg_C) = send_map_starts_C; - hypre_ParCSRCommPkgSendMapElmts(comm_pkg_C) = send_map_elmts_C; + /* Create communication package */ + hypre_ParCSRCommPkgCreateAndFill(comm, + num_recvs_B, recv_procs_C, recv_vec_starts_C, + num_sends_B, send_procs_C, send_map_starts_C, + send_map_elmts_C, + &comm_pkg_C); hypre_ParCSRMatrixCommPkg(C) = comm_pkg_C; hypre_TFree(D_tmp, HYPRE_MEMORY_HOST); - if (num_cols_offd_A) hypre_TFree(map_to_B, HYPRE_MEMORY_HOST); + if (num_cols_offd_A) + { + hypre_TFree(map_to_B, HYPRE_MEMORY_HOST); + } *C_ptr = C; - return (hypre_error_flag); + return hypre_error_flag; } /*-------------------------------------------------------------------------- @@ -3417,7 +3487,7 @@ hypre_ParTMatmul( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *C; HYPRE_BigInt *col_map_offd_C = NULL; - HYPRE_Int *map_B_to_C; + HYPRE_Int *map_B_to_C = NULL; hypre_CSRMatrix *C_diag = NULL; hypre_CSRMatrix *C_tmp_diag = NULL; @@ -3432,34 +3502,34 @@ hypre_ParTMatmul( hypre_ParCSRMatrix *A, hypre_CSRMatrix *C_tmp_offd = NULL; hypre_CSRMatrix *C_int = NULL; hypre_CSRMatrix *C_ext = NULL; - HYPRE_Int *C_ext_i; - HYPRE_BigInt *C_ext_j; - HYPRE_Complex *C_ext_data; - HYPRE_Int *C_ext_diag_i; - HYPRE_Int *C_ext_diag_j; - HYPRE_Complex *C_ext_diag_data; - HYPRE_Int *C_ext_offd_i; - HYPRE_Int *C_ext_offd_j; - HYPRE_Complex *C_ext_offd_data; + HYPRE_Int *C_ext_i = NULL; + HYPRE_BigInt *C_ext_j = NULL; + HYPRE_Complex *C_ext_data = NULL; + HYPRE_Int *C_ext_diag_i = NULL; + HYPRE_Int *C_ext_diag_j = NULL; + HYPRE_Complex *C_ext_diag_data = NULL; + HYPRE_Int *C_ext_offd_i = NULL; + HYPRE_Int *C_ext_offd_j = NULL; + HYPRE_Complex *C_ext_offd_data = NULL; HYPRE_Int C_ext_size = 0; HYPRE_Int C_ext_diag_size = 0; HYPRE_Int C_ext_offd_size = 0; HYPRE_Int *C_tmp_diag_i; - HYPRE_Int *C_tmp_diag_j; - HYPRE_Complex *C_tmp_diag_data; - HYPRE_Int *C_tmp_offd_i; - HYPRE_Int *C_tmp_offd_j; - HYPRE_Complex *C_tmp_offd_data; + HYPRE_Int *C_tmp_diag_j = NULL; + HYPRE_Complex *C_tmp_diag_data = NULL; + HYPRE_Int *C_tmp_offd_i = NULL; + HYPRE_Int *C_tmp_offd_j = NULL; + HYPRE_Complex *C_tmp_offd_data = NULL; - HYPRE_Complex *C_offd_data=NULL; - HYPRE_Int *C_offd_i=NULL; - HYPRE_Int *C_offd_j=NULL; + HYPRE_Complex *C_offd_data = NULL; + HYPRE_Int *C_offd_i = NULL; + HYPRE_Int *C_offd_j = NULL; HYPRE_BigInt *temp; - HYPRE_Int *send_map_starts_A; - HYPRE_Int *send_map_elmts_A; - HYPRE_Int num_sends_A; + HYPRE_Int *send_map_starts_A = NULL; + HYPRE_Int *send_map_elmts_A = NULL; + HYPRE_Int num_sends_A = 0; HYPRE_Int num_cols_offd_C = 0; @@ -3486,13 +3556,13 @@ hypre_ParTMatmul( hypre_ParCSRMatrix *A, nrows_B = hypre_ParCSRMatrixGlobalNumRows(B); ncols_B = hypre_ParCSRMatrixGlobalNumCols(B); - hypre_MPI_Comm_size(comm,&num_procs); + hypre_MPI_Comm_size(comm, &num_procs); hypre_MPI_Comm_rank(comm, &my_id); max_num_threads = hypre_NumThreads(); if (nrows_A != nrows_B || num_rows_diag_A != num_rows_diag_B) { - hypre_error_w_msg(HYPRE_ERROR_GENERIC," Error! Incompatible matrix dimensions!\n"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, " Error! Incompatible matrix dimensions!\n"); return NULL; } @@ -3583,14 +3653,14 @@ hypre_ParTMatmul( hypre_ParCSRMatrix *A, send_map_elmts_A = hypre_ParCSRCommPkgSendMapElmts(comm_pkg_A); C_ext_num_rows = send_map_starts_A[num_sends_A]; - C_ext_diag_i = hypre_CTAlloc(HYPRE_Int, C_ext_num_rows+1, HYPRE_MEMORY_HOST); - C_ext_offd_i = hypre_CTAlloc(HYPRE_Int, C_ext_num_rows+1, HYPRE_MEMORY_HOST); - temp = hypre_CTAlloc(HYPRE_BigInt, C_ext_size+num_cols_offd_B, HYPRE_MEMORY_HOST); + C_ext_diag_i = hypre_CTAlloc(HYPRE_Int, C_ext_num_rows + 1, HYPRE_MEMORY_HOST); + C_ext_offd_i = hypre_CTAlloc(HYPRE_Int, C_ext_num_rows + 1, HYPRE_MEMORY_HOST); + temp = hypre_CTAlloc(HYPRE_BigInt, C_ext_size + num_cols_offd_B, HYPRE_MEMORY_HOST); C_ext_diag_size = 0; C_ext_offd_size = 0; for (i = 0; i < C_ext_num_rows; i++) { - for (j = C_ext_i[i]; j < C_ext_i[i+1]; j++) + for (j = C_ext_i[i]; j < C_ext_i[i + 1]; j++) { if (C_ext_j[j] < first_col_diag_C || C_ext_j[j] > last_col_diag_C) @@ -3602,8 +3672,8 @@ hypre_ParTMatmul( hypre_ParCSRMatrix *A, C_ext_diag_size++; } } - C_ext_diag_i[i+1] = C_ext_diag_size; - C_ext_offd_i[i+1] = C_ext_offd_size; + C_ext_diag_i[i + 1] = C_ext_diag_size; + C_ext_offd_i[i + 1] = C_ext_offd_size; } cnt = C_ext_offd_size; for (i = 0; i < num_cols_offd_B; i++) @@ -3613,7 +3683,7 @@ hypre_ParTMatmul( hypre_ParCSRMatrix *A, if (cnt) { - hypre_BigQsort0(temp,0,cnt-1); + hypre_BigQsort0(temp, 0, cnt - 1); value = temp[0]; num_cols_offd_C = 1; for (i = 1; i < cnt; i++) @@ -3659,7 +3729,7 @@ hypre_ParTMatmul( hypre_ParCSRMatrix *A, cnt_diag = 0; for (i = 0; i < C_ext_num_rows; i++) { - for (j = C_ext_i[i]; j < C_ext_i[i+1]; j++) + for (j = C_ext_i[i]; j < C_ext_i[i + 1]; j++) { if (C_ext_j[j] < first_col_diag_C || C_ext_j[j] > last_col_diag_C) @@ -3694,7 +3764,7 @@ hypre_ParTMatmul( hypre_ParCSRMatrix *A, if (col_map_offd_C[i] == col_map_offd_B[cnt]) { map_B_to_C[cnt++] = i; - if (cnt == num_cols_offd_B) break; + if (cnt == num_cols_offd_B) { break; } } } for (i = 0; i < hypre_CSRMatrixI(C_tmp_offd)[hypre_CSRMatrixNumRows(C_tmp_offd)]; i++) @@ -3714,14 +3784,14 @@ hypre_ParTMatmul( hypre_ParCSRMatrix *A, if (C_ext_size || num_cols_offd_B) { - C_diag_i = hypre_CTAlloc(HYPRE_Int, num_cols_diag_A+1, memory_location_C); - C_offd_i = hypre_CTAlloc(HYPRE_Int, num_cols_diag_A+1, memory_location_C); + C_diag_i = hypre_CTAlloc(HYPRE_Int, num_cols_diag_A + 1, memory_location_C); + C_offd_i = hypre_CTAlloc(HYPRE_Int, num_cols_diag_A + 1, memory_location_C); C_diag_array = hypre_CTAlloc(HYPRE_Int, max_num_threads, HYPRE_MEMORY_HOST); C_offd_array = hypre_CTAlloc(HYPRE_Int, max_num_threads, HYPRE_MEMORY_HOST); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel + #pragma omp parallel #endif { HYPRE_Int *B_marker = NULL; @@ -3731,18 +3801,18 @@ hypre_ParTMatmul( hypre_ParCSRMatrix *A, HYPRE_Int rest, size; HYPRE_Int num_threads = hypre_NumActiveThreads(); - size = num_cols_diag_A/num_threads; - rest = num_cols_diag_A - size*num_threads; + size = num_cols_diag_A / num_threads; + rest = num_cols_diag_A - size * num_threads; ii = hypre_GetThreadNum(); if (ii < rest) { - ns = ii*size+ii; - ne = (ii+1)*size+ii+1; + ns = ii * size + ii; + ne = (ii + 1) * size + ii + 1; } else { - ns = ii*size+rest; - ne = (ii+1)*size+rest; + ns = ii * size + rest; + ne = (ii + 1) * size + rest; } B_marker = hypre_CTAlloc(HYPRE_Int, num_cols_diag_B, HYPRE_MEMORY_HOST); @@ -3762,14 +3832,14 @@ hypre_ParTMatmul( hypre_ParCSRMatrix *A, nnz_o = 0; for (ik = ns; ik < ne; ik++) { - for (jk = C_tmp_diag_i[ik]; jk < C_tmp_diag_i[ik+1]; jk++) + for (jk = C_tmp_diag_i[ik]; jk < C_tmp_diag_i[ik + 1]; jk++) { jcol = C_tmp_diag_j[jk]; B_marker[jcol] = ik; nnz_d++; } - for (jk = C_tmp_offd_i[ik]; jk < C_tmp_offd_i[ik+1]; jk++) + for (jk = C_tmp_offd_i[ik]; jk < C_tmp_offd_i[ik + 1]; jk++) { jcol = C_tmp_offd_j[jk]; B_marker_offd[jcol] = ik; @@ -3778,11 +3848,11 @@ hypre_ParTMatmul( hypre_ParCSRMatrix *A, for (jk = 0; jk < num_sends_A; jk++) { - for (j1 = send_map_starts_A[jk]; j1 < send_map_starts_A[jk+1]; j1++) + for (j1 = send_map_starts_A[jk]; j1 < send_map_starts_A[jk + 1]; j1++) { if (send_map_elmts_A[j1] == ik) { - for (j2 = C_ext_diag_i[j1]; j2 < C_ext_diag_i[j1+1]; j2++) + for (j2 = C_ext_diag_i[j1]; j2 < C_ext_diag_i[j1 + 1]; j2++) { jcol = C_ext_diag_j[j2]; if (B_marker[jcol] < ik) @@ -3791,7 +3861,7 @@ hypre_ParTMatmul( hypre_ParCSRMatrix *A, nnz_d++; } } - for (j2 = C_ext_offd_i[j1]; j2 < C_ext_offd_i[j1+1]; j2++) + for (j2 = C_ext_offd_i[j1]; j2 < C_ext_offd_i[j1 + 1]; j2++) { jcol = C_ext_offd_j[j2]; if (B_marker_offd[jcol] < ik) @@ -3808,20 +3878,20 @@ hypre_ParTMatmul( hypre_ParCSRMatrix *A, C_offd_array[ii] = nnz_o; } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif if (ii == 0) { nnz_d = 0; nnz_o = 0; - for (ik = 0; ik < num_threads-1; ik++) + for (ik = 0; ik < num_threads - 1; ik++) { - C_diag_array[ik+1] += C_diag_array[ik]; - C_offd_array[ik+1] += C_offd_array[ik]; + C_diag_array[ik + 1] += C_diag_array[ik]; + C_offd_array[ik + 1] += C_offd_array[ik]; } - nnz_d = C_diag_array[num_threads-1]; - nnz_o = C_offd_array[num_threads-1]; + nnz_d = C_diag_array[num_threads - 1]; + nnz_o = C_offd_array[num_threads - 1]; C_diag_i[num_cols_diag_A] = nnz_d; C_offd_i[num_cols_diag_A] = nnz_o; @@ -3837,7 +3907,7 @@ hypre_ParTMatmul( hypre_ParCSRMatrix *A, C_offd_data = hypre_CSRMatrixData(C_offd); } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif /*----------------------------------------------------------------------- @@ -3864,14 +3934,14 @@ hypre_ParTMatmul( hypre_ParCSRMatrix *A, nnz_o = 0; if (ii) { - nnz_d = C_diag_array[ii-1]; - nnz_o = C_offd_array[ii-1]; + nnz_d = C_diag_array[ii - 1]; + nnz_o = C_offd_array[ii - 1]; } for (ik = ns; ik < ne; ik++) { C_diag_i[ik] = nnz_d; C_offd_i[ik] = nnz_o; - for (jk = C_tmp_diag_i[ik]; jk < C_tmp_diag_i[ik+1]; jk++) + for (jk = C_tmp_diag_i[ik]; jk < C_tmp_diag_i[ik + 1]; jk++) { jcol = C_tmp_diag_j[jk]; C_diag_j[nnz_d] = jcol; @@ -3880,7 +3950,7 @@ hypre_ParTMatmul( hypre_ParCSRMatrix *A, nnz_d++; } - for (jk = C_tmp_offd_i[ik]; jk < C_tmp_offd_i[ik+1]; jk++) + for (jk = C_tmp_offd_i[ik]; jk < C_tmp_offd_i[ik + 1]; jk++) { jcol = C_tmp_offd_j[jk]; C_offd_j[nnz_o] = jcol; @@ -3891,11 +3961,11 @@ hypre_ParTMatmul( hypre_ParCSRMatrix *A, for (jk = 0; jk < num_sends_A; jk++) { - for (j1 = send_map_starts_A[jk]; j1 < send_map_starts_A[jk+1]; j1++) + for (j1 = send_map_starts_A[jk]; j1 < send_map_starts_A[jk + 1]; j1++) { if (send_map_elmts_A[j1] == ik) { - for (j2 = C_ext_diag_i[j1]; j2 < C_ext_diag_i[j1+1]; j2++) + for (j2 = C_ext_diag_i[j1]; j2 < C_ext_diag_i[j1 + 1]; j2++) { jcol = C_ext_diag_j[j2]; if (B_marker[jcol] < C_diag_i[ik]) @@ -3910,7 +3980,7 @@ hypre_ParTMatmul( hypre_ParCSRMatrix *A, C_diag_data[B_marker[jcol]] += C_ext_diag_data[j2]; } } - for (j2 = C_ext_offd_i[j1]; j2 < C_ext_offd_i[j1+1]; j2++) + for (j2 = C_ext_offd_i[j1]; j2 < C_ext_offd_i[j1 + 1]; j2++) { jcol = C_ext_offd_j[j2]; if (B_marker_offd[jcol] < C_offd_i[ik]) @@ -3947,9 +4017,9 @@ hypre_ParTMatmul( hypre_ParCSRMatrix *A, /* row_starts[0] is start of local rows. row_starts[1] is start of next processor's rows */ first_row_index = col_starts_A[0]; - local_num_rows = (HYPRE_Int)(col_starts_A[1]-first_row_index ); + local_num_rows = (HYPRE_Int)(col_starts_A[1] - first_row_index ); first_col_diag = col_starts_B[0]; - local_num_cols = (HYPRE_Int)(col_starts_B[1]-first_col_diag); + local_num_cols = (HYPRE_Int)(col_starts_B[1] - first_col_diag); C = hypre_CTAlloc(hypre_ParCSRMatrix, 1, HYPRE_MEMORY_HOST); hypre_ParCSRMatrixComm(C) = comm; @@ -3996,8 +4066,8 @@ hypre_ParTMatmul( hypre_ParCSRMatrix *A, hypre_ParCSRMatrixOffd(C) = C_tmp_offd; } - hypre_CSRMatrixMemoryLocation(hypre_ParCSRMatrixDiag(C)) = memory_location_C; - hypre_CSRMatrixMemoryLocation(hypre_ParCSRMatrixOffd(C)) = memory_location_C; + hypre_assert(hypre_CSRMatrixMemoryLocation(hypre_ParCSRMatrixDiag(C)) == memory_location_C); + hypre_assert(hypre_CSRMatrixMemoryLocation(hypre_ParCSRMatrixOffd(C)) == memory_location_C); if (num_cols_offd_C) { @@ -4084,14 +4154,14 @@ hypre_ParTMatmul( hypre_ParCSRMatrix *A, if (C_offd) { - hypre_CSRMatrixDestroy(C_tmp_offd); + hypre_CSRMatrixDestroy(C_tmp_offd); } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if ( hypre_GetExecPolicy2(memory_location_A, memory_location_B) == HYPRE_EXEC_DEVICE ) { hypre_CSRMatrixMoveDiagFirstDevice(hypre_ParCSRMatrixDiag(C)); - hypre_SyncCudaComputeStream(hypre_handle()); + hypre_SyncComputeStream(); } #endif @@ -4115,13 +4185,15 @@ hypre_ParvecBdiagInvScal( hypre_ParVector *b, hypre_MPI_Comm_rank(comm, &my_id); hypre_MPI_Comm_size(comm, &num_procs); - HYPRE_Int i, j, s, block_start, block_end; + HYPRE_Int i, j, s; + HYPRE_BigInt block_start, block_end; HYPRE_BigInt nrow_global = hypre_ParVectorGlobalSize(b); HYPRE_BigInt first_row = hypre_ParVectorFirstIndex(b); HYPRE_BigInt last_row = hypre_ParVectorLastIndex(b); HYPRE_BigInt end_row = last_row + 1; /* one past-the-last */ HYPRE_BigInt first_row_block = first_row / (HYPRE_BigInt)(blockSize) * (HYPRE_BigInt)blockSize; - HYPRE_BigInt end_row_block = hypre_min( (last_row / (HYPRE_BigInt)blockSize + 1) * (HYPRE_BigInt)blockSize, nrow_global ); + HYPRE_BigInt end_row_block = hypre_min( (last_row / (HYPRE_BigInt)blockSize + 1) * + (HYPRE_BigInt)blockSize, nrow_global ); hypre_assert(blockSize == A->bdiag_size); HYPRE_Complex *bdiaginv = A->bdiaginv; @@ -4145,12 +4217,9 @@ hypre_ParvecBdiagInvScal( hypre_ParVector *b, HYPRE_Int num_rows_recv = hypre_ParCSRCommPkgRecvVecStart(comm_pkg, num_recvs); hypre_ParCSRCommHandle *comm_handle; - HYPRE_BigInt *part = hypre_TAlloc(HYPRE_BigInt, 2, HYPRE_MEMORY_HOST); - hypre_TMemcpy(part, hypre_ParVectorPartitioning(b), HYPRE_BigInt, 2, - HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); - hypre_ParVector *bnew = hypre_ParVectorCreate( hypre_ParVectorComm(b), - hypre_ParVectorGlobalSize(b), part ); + hypre_ParVectorGlobalSize(b), + hypre_ParVectorPartitioning(b) ); hypre_ParVectorInitialize(bnew); hypre_Vector *bnew_local = hypre_ParVectorLocalVector(bnew); HYPRE_Complex *bnew_local_data = hypre_VectorData(bnew_local); @@ -4188,7 +4257,7 @@ hypre_ParvecBdiagInvScal( hypre_ParVector *b, for (j = 0; j < s; j++) { HYPRE_BigInt global_rid = block_start + (HYPRE_BigInt)j; - HYPRE_Complex val = dense[block_i + j*blockSize]; + HYPRE_Complex val = dense[block_i + j * blockSize]; if (val == 0.0) { continue; @@ -4224,14 +4293,12 @@ hypre_ParvecBdiagInvScal( hypre_ParVector *b, return hypre_error_flag; } -/** - * @brief Compute As = B^{-1}*A, where B is the block diagonal of A - * @param[in] A : - * @param[in] blockSize: block size - * @param[out] B : - * @return - * @warning - */ +/*-------------------------------------------------------------------------- + * hypre_ParcsrBdiagInvScal + * + * Compute As = B^{-1}*A, where B is the block diagonal of A. + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_ParcsrBdiagInvScal( hypre_ParCSRMatrix *A, HYPRE_Int blockSize, @@ -4276,7 +4343,7 @@ hypre_ParcsrBdiagInvScal( hypre_ParCSRMatrix *A, /* if square globally and locally */ HYPRE_Int square2 = (nrow_global == ncol_global) && (nrow_local == ncol_local) && - (first_row == first_col); + (first_row == first_col); if (nrow_global != ncol_global) { @@ -4286,8 +4353,10 @@ hypre_ParcsrBdiagInvScal( hypre_ParCSRMatrix *A, /* in block diagonals, row range of the blocks this proc span */ HYPRE_BigInt first_row_block = first_row / (HYPRE_BigInt)blockSize * (HYPRE_BigInt)blockSize; - HYPRE_BigInt end_row_block = hypre_min( (last_row / (HYPRE_BigInt)blockSize + 1) * (HYPRE_BigInt)blockSize, nrow_global ); - HYPRE_Int num_blocks = (HYPRE_Int)(last_row / (HYPRE_BigInt)blockSize + 1 - first_row / (HYPRE_BigInt)blockSize); + HYPRE_BigInt end_row_block = hypre_min( (last_row / (HYPRE_BigInt)blockSize + 1) * + (HYPRE_BigInt)blockSize, nrow_global ); + HYPRE_Int num_blocks = (HYPRE_Int)(last_row / (HYPRE_BigInt)blockSize + 1 - first_row / + (HYPRE_BigInt)blockSize); //for (i=first_row_block; i < end_row; i+=blockSize) ; //printf("===[%d %d), [ %d %d ) %d === \n", first_row, end_row, first_row_block, end_row_block, i); @@ -4303,7 +4372,8 @@ hypre_ParcsrBdiagInvScal( hypre_ParCSRMatrix *A, HYPRE_Int *A_ext_i = NULL; HYPRE_BigInt *A_ext_j = NULL; - HYPRE_Real *dense_all = hypre_CTAlloc(HYPRE_Complex, num_blocks*blockSize*blockSize, HYPRE_MEMORY_HOST); + HYPRE_Real *dense_all = hypre_CTAlloc(HYPRE_Complex, num_blocks * blockSize * blockSize, + HYPRE_MEMORY_HOST); HYPRE_Real *dense = dense_all; HYPRE_Int *IPIV = hypre_TAlloc(HYPRE_Int, blockSize, HYPRE_MEMORY_HOST); HYPRE_Complex *dgetri_work = NULL; @@ -4380,10 +4450,10 @@ hypre_ParcsrBdiagInvScal( hypre_ParCSRMatrix *A, } } /* remove duplicates after sorting (TODO better ways?) */ - hypre_BigQsort0(ext_offd, 0, j-1); + hypre_BigQsort0(ext_offd, 0, j - 1); for (i = 0, k = 0; i < j; i++) { - if (i == 0 || ext_offd[i] != ext_offd[i-1]) + if (i == 0 || ext_offd[i] != ext_offd[i - 1]) { ext_offd[k++] = ext_offd[i]; } @@ -4433,7 +4503,8 @@ hypre_ParcsrBdiagInvScal( hypre_ParCSRMatrix *A, } /* outer most loop for blocks */ - for (block_start = first_row_block; block_start < end_row_block; block_start += (HYPRE_BigInt)blockSize) + for (block_start = first_row_block; block_start < end_row_block; + block_start += (HYPRE_BigInt)blockSize) { HYPRE_BigInt big_i; block_end = hypre_min(block_start + (HYPRE_BigInt)blockSize, nrow_global); @@ -4450,22 +4521,22 @@ hypre_ParcsrBdiagInvScal( hypre_ParCSRMatrix *A, { /* is a local row */ j = (HYPRE_Int)(big_i - first_row); - for (k = A_diag_i[j]; k < A_diag_i[j+1]; k++) + for (k = A_diag_i[j]; k < A_diag_i[j + 1]; k++) { HYPRE_BigInt cid = (HYPRE_BigInt)A_diag_j[k] + first_col; if (cid >= block_start && cid < block_end) { - dense[block_i + (HYPRE_Int)(cid-block_start)*blockSize] = A_diag_a[k]; + dense[block_i + (HYPRE_Int)(cid - block_start)*blockSize] = A_diag_a[k]; } } if (num_cols_A_offd) { - for (k = A_offd_i[j]; k < A_offd_i[j+1]; k++) + for (k = A_offd_i[j]; k < A_offd_i[j + 1]; k++) { HYPRE_BigInt cid = col_map_offd_A[A_offd_j[k]]; if (cid >= block_start && cid < block_end) { - dense[block_i + (HYPRE_Int)(cid-block_start)*blockSize] = A_offd_a[k]; + dense[block_i + (HYPRE_Int)(cid - block_start)*blockSize] = A_offd_a[k]; } } } @@ -4481,14 +4552,14 @@ hypre_ParcsrBdiagInvScal( hypre_ParCSRMatrix *A, { j = (HYPRE_Int)(first_row - first_row_block + big_i - end_row); } - for (k = A_ext_i[j]; k < A_ext_i[j+1]; k++) + for (k = A_ext_i[j]; k < A_ext_i[j + 1]; k++) { HYPRE_BigInt cid = A_ext_j[k]; /* recover the global index */ - cid = cid < (HYPRE_BigInt)ncol_local ? cid + first_col : col_map_offd_A_new[cid-ncol_local]; + cid = cid < (HYPRE_BigInt)ncol_local ? cid + first_col : col_map_offd_A_new[cid - ncol_local]; if (cid >= block_start && cid < block_end) { - dense[block_i + (HYPRE_Int)(cid-block_start)*blockSize] = A_ext_a[k]; + dense[block_i + (HYPRE_Int)(cid - block_start)*blockSize] = A_ext_a[k]; } } } @@ -4510,7 +4581,7 @@ hypre_ParcsrBdiagInvScal( hypre_ParCSRMatrix *A, if (lwork_opt > dgetri_lwork) { - dgetri_lwork = lwork_opt; + dgetri_lwork = (HYPRE_Int)lwork_opt; dgetri_work = hypre_TReAlloc(dgetri_work, HYPRE_Complex, dgetri_lwork, HYPRE_MEMORY_HOST); } @@ -4525,20 +4596,20 @@ hypre_ParcsrBdiagInvScal( hypre_ParCSRMatrix *A, { for (j = 0; j < s; j++) { - HYPRE_Complex t = dense[j+i*blockSize]; + HYPRE_Complex t = dense[j + i * blockSize]; Fnorm += t * t; } } - Fnorm = sqrt(Fnorm); + Fnorm = hypre_sqrt(Fnorm); for (i = 0; i < s; i++) { for (j = 0; j < s; j++) { - if ( hypre_abs(dense[j+i*blockSize]) < eps * Fnorm ) + if ( hypre_abs(dense[j + i * blockSize]) < eps * Fnorm ) { - dense[j+i*blockSize] = 0.0; + dense[j + i * blockSize] = 0.0; } } } @@ -4581,7 +4652,7 @@ hypre_ParcsrBdiagInvScal( hypre_ParCSRMatrix *A, /* row to combine: global row id */ HYPRE_BigInt global_rid = block_start + (HYPRE_BigInt)j; /* the multipiler */ - HYPRE_Complex val = dense[block_i + j*blockSize]; + HYPRE_Complex val = dense[block_i + j * blockSize]; if (val == 0.0) { @@ -4594,7 +4665,7 @@ hypre_ParcsrBdiagInvScal( hypre_ParCSRMatrix *A, HYPRE_Int rid = (HYPRE_Int)(global_rid - first_row); HYPRE_Int ii; - for (ii = A_diag_i[rid]; ii < A_diag_i[rid+1]; ii++) + for (ii = A_diag_i[rid]; ii < A_diag_i[rid + 1]; ii++) { HYPRE_Int col = A_diag_j[ii]; HYPRE_Complex vv = A_diag_a[ii]; @@ -4624,7 +4695,7 @@ hypre_ParcsrBdiagInvScal( hypre_ParCSRMatrix *A, } } - for (ii = A_offd_i[rid]; ii < A_offd_i[rid+1]; ii++) + for (ii = A_offd_i[rid]; ii < A_offd_i[rid + 1]; ii++) { HYPRE_Int col = A_offd_j[ii]; /* use the mapper to map to new offd */ @@ -4670,7 +4741,7 @@ hypre_ParcsrBdiagInvScal( hypre_ParCSRMatrix *A, rid = (HYPRE_Int)(first_row - first_row_block + global_rid - end_row); } - for (ii = A_ext_i[rid]; ii < A_ext_i[rid+1]; ii++) + for (ii = A_ext_i[rid]; ii < A_ext_i[rid + 1]; ii++) { HYPRE_Int col = (HYPRE_Int)A_ext_j[ii]; HYPRE_Complex vv = A_ext_a[ii]; @@ -4848,35 +4919,36 @@ hypre_ParcsrGetExternalRowsInit( hypre_ParCSRMatrix *A, HYPRE_Int want_data, void **request_ptr) { - HYPRE_Int i, j, k; - HYPRE_Int num_sends, num_rows_send, num_nnz_send, *send_i, - num_recvs, num_rows_recv, num_nnz_recv, *recv_i, - *send_jstarts, *recv_jstarts, *send_i_offset; - HYPRE_BigInt *send_j, *recv_j; - HYPRE_Complex *send_a = NULL, *recv_a = NULL; - hypre_ParCSRCommPkg *comm_pkg_j; - hypre_ParCSRCommHandle *comm_handle, *comm_handle_j, *comm_handle_a; - /* HYPRE_Int global_num_rows = hypre_ParCSRMatrixGlobalNumRows(A); */ + HYPRE_UNUSED_VAR(indices); + + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + HYPRE_BigInt first_col = hypre_ParCSRMatrixFirstColDiag(A); + HYPRE_BigInt *col_map_offd_A = hypre_ParCSRMatrixColMapOffd(A); + /* diag part of A */ - hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); - HYPRE_Real *A_diag_a = hypre_CSRMatrixData(A_diag); - HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); - HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); - /* HYPRE_Int local_num_rows = hypre_CSRMatrixNumRows(A_diag); */ + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + HYPRE_Real *A_diag_a = hypre_CSRMatrixData(A_diag); + HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); + HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); + /* off-diag part of A */ - hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); - HYPRE_Real *A_offd_a = hypre_CSRMatrixData(A_offd); - HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); - HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); - /* HYPRE_BigInt *row_starts = hypre_ParCSRMatrixRowStarts(A); */ - /* HYPRE_BigInt first_row = hypre_ParCSRMatrixFirstRowIndex(A); */ - HYPRE_BigInt first_col = hypre_ParCSRMatrixFirstColDiag(A); - HYPRE_BigInt *col_map_offd_A = hypre_ParCSRMatrixColMapOffd(A); - MPI_Comm comm = hypre_ParCSRMatrixComm(A); - HYPRE_Int num_procs; - HYPRE_Int my_id; - void **vrequest; - hypre_CSRMatrix *A_ext; + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); + HYPRE_Real *A_offd_a = hypre_CSRMatrixData(A_offd); + HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); + HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); + + hypre_CSRMatrix *A_ext; + HYPRE_Int num_procs, my_id; + void **vrequest; + + HYPRE_Int i, j, k; + HYPRE_Int num_sends, num_rows_send, num_nnz_send, *send_i; + HYPRE_Int num_recvs, num_rows_recv, num_nnz_recv, *recv_i; + HYPRE_Int *send_jstarts, *recv_jstarts, *send_i_offset; + HYPRE_BigInt *send_j, *recv_j; + HYPRE_Complex *send_a = NULL, *recv_a = NULL; + hypre_ParCSRCommPkg *comm_pkg_j = NULL; + hypre_ParCSRCommHandle *comm_handle, *comm_handle_j, *comm_handle_a; hypre_MPI_Comm_size(comm, &num_procs); hypre_MPI_Comm_rank(comm, &my_id); @@ -4902,12 +4974,12 @@ hypre_ParcsrGetExternalRowsInit( hypre_ParCSRMatrix *A, { /* j: row index to send */ j = hypre_ParCSRCommPkgSendMapElmt(comm_pkg, i); - send_i[i] = A_diag_i[j+1] - A_diag_i[j] + A_offd_i[j+1] - A_offd_i[j]; + send_i[i] = A_diag_i[j + 1] - A_diag_i[j] + A_offd_i[j + 1] - A_offd_i[j]; num_nnz_send += send_i[i]; } /* send this array out: note the shift in recv_i by one (async) */ - comm_handle = hypre_ParCSRCommHandleCreate(11, comm_pkg, send_i, recv_i+1); + comm_handle = hypre_ParCSRCommHandleCreate(11, comm_pkg, send_i, recv_i + 1); /* prepare data to send out. overlap with the above commmunication */ send_j = hypre_TAlloc(HYPRE_BigInt, num_nnz_send, HYPRE_MEMORY_HOST); @@ -4923,14 +4995,14 @@ hypre_ParcsrGetExternalRowsInit( hypre_ParCSRMatrix *A, /* prefix sum. TODO: OMP parallelization */ for (i = 1; i <= num_rows_send; i++) { - send_i_offset[i] += send_i_offset[i-1]; + send_i_offset[i] += send_i_offset[i - 1]; } hypre_assert(send_i_offset[num_rows_send] == num_nnz_send); /* pointers to each proc in send_j */ send_jstarts = hypre_TAlloc(HYPRE_Int, num_sends + 1, HYPRE_MEMORY_HOST); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for HYPRE_SMP_SCHEDULE + #pragma omp parallel for HYPRE_SMP_SCHEDULE #endif for (i = 0; i <= num_sends; i++) { @@ -4940,35 +5012,35 @@ hypre_ParcsrGetExternalRowsInit( hypre_ParCSRMatrix *A, /* fill the CSR matrix: j and a */ #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for HYPRE_SMP_SCHEDULE private(i,j,k) + #pragma omp parallel for HYPRE_SMP_SCHEDULE private(i,j,k) #endif for (i = 0; i < num_rows_send; i++) { HYPRE_Int i1 = send_i_offset[i]; j = hypre_ParCSRCommPkgSendMapElmt(comm_pkg, i); /* open row j and fill ja and a to send */ - for (k = A_diag_i[j]; k < A_diag_i[j+1]; k++) + for (k = A_diag_i[j]; k < A_diag_i[j + 1]; k++) { send_j[i1] = first_col + A_diag_j[k]; if (want_data) { send_a[i1] = A_diag_a[k]; } - i1++; - } - if (num_procs > 1) + i1++; + } + if (num_procs > 1) + { + for (k = A_offd_i[j]; k < A_offd_i[j + 1]; k++) { - for (k = A_offd_i[j]; k < A_offd_i[j+1]; k++) - { - send_j[i1] = col_map_offd_A[A_offd_j[k]]; + send_j[i1] = col_map_offd_A[A_offd_j[k]]; if (want_data) { send_a[i1] = A_offd_a[k]; } - i1++; - } + i1++; } - hypre_assert(send_i_offset[i+1] == i1); + } + hypre_assert(send_i_offset[i + 1] == i1); } /* finish the above communication: send_i/recv_i */ @@ -4977,7 +5049,7 @@ hypre_ParcsrGetExternalRowsInit( hypre_ParCSRMatrix *A, /* adjust recv_i to ptrs */ for (i = 1; i <= num_rows_recv; i++) { - recv_i[i] += recv_i[i-1]; + recv_i[i] += recv_i[i - 1]; } num_nnz_recv = recv_i[num_rows_recv]; recv_j = hypre_CTAlloc(HYPRE_BigInt, num_nnz_recv, HYPRE_MEMORY_HOST); @@ -4992,15 +5064,16 @@ hypre_ParcsrGetExternalRowsInit( hypre_ParCSRMatrix *A, recv_jstarts[i] = recv_i[j]; } - /* ready to send and recv: create a communication package for data */ - comm_pkg_j = hypre_CTAlloc(hypre_ParCSRCommPkg, 1, HYPRE_MEMORY_HOST); - hypre_ParCSRCommPkgComm (comm_pkg_j) = comm; - hypre_ParCSRCommPkgNumSends (comm_pkg_j) = num_sends; - hypre_ParCSRCommPkgSendProcs (comm_pkg_j) = hypre_ParCSRCommPkgSendProcs(comm_pkg); - hypre_ParCSRCommPkgSendMapStarts(comm_pkg_j) = send_jstarts; - hypre_ParCSRCommPkgNumRecvs (comm_pkg_j) = num_recvs; - hypre_ParCSRCommPkgRecvProcs (comm_pkg_j) = hypre_ParCSRCommPkgRecvProcs(comm_pkg); - hypre_ParCSRCommPkgRecvVecStarts(comm_pkg_j) = recv_jstarts; + /* Create communication package */ + hypre_ParCSRCommPkgCreateAndFill(comm, + num_recvs, + hypre_ParCSRCommPkgRecvProcs(comm_pkg), + recv_jstarts, + num_sends, + hypre_ParCSRCommPkgSendProcs(comm_pkg), + send_jstarts, + NULL, + &comm_pkg_j); /* init communication */ /* ja */ @@ -5038,6 +5111,10 @@ hypre_ParcsrGetExternalRowsInit( hypre_ParCSRMatrix *A, return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_ParcsrGetExternalRowsWait + *--------------------------------------------------------------------------*/ + hypre_CSRMatrix* hypre_ParcsrGetExternalRowsWait(void *vrequest) { @@ -5047,7 +5124,8 @@ hypre_ParcsrGetExternalRowsWait(void *vrequest) hypre_ParCSRCommHandle *comm_handle_a = (hypre_ParCSRCommHandle *) request[1]; hypre_CSRMatrix *A_ext = (hypre_CSRMatrix *) request[2]; hypre_ParCSRCommPkg *comm_pkg_j = (hypre_ParCSRCommPkg *) request[3]; - HYPRE_BigInt *send_j = (HYPRE_BigInt *) hypre_ParCSRCommHandleSendData(comm_handle_j); + HYPRE_BigInt *send_j = (HYPRE_BigInt *) hypre_ParCSRCommHandleSendData( + comm_handle_j); if (comm_handle_a) { @@ -5069,10 +5147,11 @@ hypre_ParcsrGetExternalRowsWait(void *vrequest) } /*-------------------------------------------------------------------------- - * hypre_ParCSRMatrixAdd: performs C = alpha*A + beta*B + * hypre_ParCSRMatrixAddHost * - * A and B are assumed to have the same row and column partitionings + * Host (CPU) version of hypre_ParCSRMatrixAdd *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_ParCSRMatrixAddHost( HYPRE_Complex alpha, hypre_ParCSRMatrix *A, @@ -5169,9 +5248,20 @@ hypre_ParCSRMatrixAddHost( HYPRE_Complex alpha, if ((num_rownnz_diag_A < num_rows_diag_A) && (num_rownnz_diag_B < num_rows_diag_B)) { - hypre_MergeOrderedArrays( num_rownnz_diag_A, rownnz_diag_A, - num_rownnz_diag_B, rownnz_diag_B, - &num_rownnz_diag_C, &rownnz_diag_C); + hypre_IntArray arr_diagA; + hypre_IntArray arr_diagB; + hypre_IntArray arr_diagC; + + hypre_IntArrayData(&arr_diagA) = rownnz_diag_A; + hypre_IntArrayData(&arr_diagB) = rownnz_diag_B; + hypre_IntArraySize(&arr_diagA) = num_rownnz_diag_A; + hypre_IntArraySize(&arr_diagB) = num_rownnz_diag_B; + hypre_IntArrayMemoryLocation(&arr_diagC) = memory_location_C; + + hypre_IntArrayMergeOrdered(&arr_diagA, &arr_diagB, &arr_diagC); + + num_rownnz_diag_C = hypre_IntArraySize(&arr_diagC); + rownnz_diag_C = hypre_IntArrayData(&arr_diagC); } /* Set nonzero rows data of offd_C */ @@ -5179,14 +5269,25 @@ hypre_ParCSRMatrixAddHost( HYPRE_Complex alpha, if ((num_rownnz_offd_A < num_rows_offd_A) && (num_rownnz_offd_B < num_rows_offd_B)) { - hypre_MergeOrderedArrays( num_rownnz_offd_A, rownnz_offd_A, - num_rownnz_offd_B, rownnz_offd_B, - &num_rownnz_offd_C, &rownnz_offd_C); + hypre_IntArray arr_offdA; + hypre_IntArray arr_offdB; + hypre_IntArray arr_offdC; + + hypre_IntArrayData(&arr_offdA) = rownnz_offd_A; + hypre_IntArrayData(&arr_offdB) = rownnz_offd_B; + hypre_IntArraySize(&arr_offdA) = num_rownnz_offd_A; + hypre_IntArraySize(&arr_offdB) = num_rownnz_offd_B; + hypre_IntArrayMemoryLocation(&arr_offdC) = memory_location_C; + + hypre_IntArrayMergeOrdered(&arr_offdA, &arr_offdB, &arr_offdC); + + num_rownnz_offd_C = hypre_IntArraySize(&arr_offdC); + rownnz_offd_C = hypre_IntArrayData(&arr_offdC); } /* Set diag_C */ #ifdef HYPRE_USING_OPENMP -#pragma omp parallel + #pragma omp parallel #endif { HYPRE_Int ii, num_threads; @@ -5197,21 +5298,21 @@ hypre_ParCSRMatrixAddHost( HYPRE_Complex alpha, ii = hypre_GetThreadNum(); num_threads = hypre_NumActiveThreads(); - /*----------------------------------------------------------------------- - * Compute C_diag = alpha*A_diag + beta*B_diag - *-----------------------------------------------------------------------*/ + /*----------------------------------------------------------------------- + * Compute C_diag = alpha*A_diag + beta*B_diag + *-----------------------------------------------------------------------*/ - size = num_rownnz_diag_C/num_threads; - rest = num_rownnz_diag_C - size*num_threads; + size = num_rownnz_diag_C / num_threads; + rest = num_rownnz_diag_C - size * num_threads; if (ii < rest) { - ns = ii*size+ii; - ne = (ii+1)*size+ii+1; + ns = ii * size + ii; + ne = (ii + 1) * size + ii + 1; } else { - ns = ii*size+rest; - ne = (ii+1)*size+rest; + ns = ii * size + rest; + ne = (ii + 1) * size + rest; } marker_diag = hypre_TAlloc(HYPRE_Int, num_cols_diag_A, HYPRE_MEMORY_HOST); @@ -5220,26 +5321,26 @@ hypre_ParCSRMatrixAddHost( HYPRE_Complex alpha, num_rows_diag_C, num_rownnz_diag_C, num_cols_diag_C, rownnz_diag_C, memory_location_C, C_diag_i, &C_diag); - hypre_CSRMatrixAddSecondPass(ns, ne, twspace, marker_diag, + hypre_CSRMatrixAddSecondPass(ns, ne, marker_diag, NULL, NULL, rownnz_diag_C, alpha, beta, A_diag, B_diag, C_diag); hypre_TFree(marker_diag, HYPRE_MEMORY_HOST); - /*----------------------------------------------------------------------- - * Compute C_offd = alpha*A_offd + beta*B_offd - *-----------------------------------------------------------------------*/ + /*----------------------------------------------------------------------- + * Compute C_offd = alpha*A_offd + beta*B_offd + *-----------------------------------------------------------------------*/ - size = num_rownnz_offd_C/num_threads; - rest = num_rownnz_offd_C - size*num_threads; + size = num_rownnz_offd_C / num_threads; + rest = num_rownnz_offd_C - size * num_threads; if (ii < rest) { - ns = ii*size+ii; - ne = (ii+1)*size+ii+1; + ns = ii * size + ii; + ne = (ii + 1) * size + ii + 1; } else { - ns = ii*size+rest; - ne = (ii+1)*size+rest; + ns = ii * size + rest; + ne = (ii + 1) * size + rest; } marker_offd = hypre_TAlloc(HYPRE_Int, num_cols_offd_C, HYPRE_MEMORY_HOST); @@ -5248,7 +5349,7 @@ hypre_ParCSRMatrixAddHost( HYPRE_Complex alpha, num_rows_offd_C, num_rownnz_offd_C, num_cols_offd_C, rownnz_offd_C, memory_location_C, C_offd_i, &C_offd); - hypre_CSRMatrixAddSecondPass(ns, ne, twspace, marker_offd, + hypre_CSRMatrixAddSecondPass(ns, ne, marker_offd, A2C_offd, B2C_offd, rownnz_offd_C, alpha, beta, A_offd, B_offd, C_offd); hypre_TFree(marker_offd, HYPRE_MEMORY_HOST); @@ -5287,6 +5388,14 @@ hypre_ParCSRMatrixAddHost( HYPRE_Complex alpha, return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixAdd + * + * Interface for Host/Device functions for computing C = alpha*A + beta*B + * + * A and B are assumed to have the same row and column partitionings + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_ParCSRMatrixAdd( HYPRE_Complex alpha, hypre_ParCSRMatrix *A, @@ -5299,7 +5408,7 @@ hypre_ParCSRMatrixAdd( HYPRE_Complex alpha, hypre_assert(hypre_ParCSRMatrixNumRows(A) == hypre_ParCSRMatrixNumRows(B)); hypre_assert(hypre_ParCSRMatrixNumCols(A) == hypre_ParCSRMatrixNumCols(B)); -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if ( hypre_GetExecPolicy2( hypre_ParCSRMatrixMemoryLocation(A), hypre_ParCSRMatrixMemoryLocation(B) ) == HYPRE_EXEC_DEVICE ) { @@ -5330,7 +5439,7 @@ hypre_ParCSRMatrixFnorm( hypre_ParCSRMatrix *A ) hypre_MPI_Allreduce(&local_result, &result, 1, HYPRE_MPI_REAL, hypre_MPI_SUM, comm); - return sqrt(result); + return hypre_sqrt(result); } /*-------------------------------------------------------------------------- @@ -5365,23 +5474,23 @@ hypre_ParCSRMatrixInfNorm( hypre_ParCSRMatrix *A, #ifdef _MSC_VER #ifdef HYPRE_USING_OPENMP -#pragma omp parallel private(i,j,rowsum) + #pragma omp parallel private(i,j,rowsum) #endif { HYPRE_Real maxsum_local; maxsum_local = 0.0; #ifdef HYPRE_USING_OPENMP -#pragma omp for HYPRE_SMP_SCHEDULE + #pragma omp for HYPRE_SMP_SCHEDULE #endif for (i = 0; i < num_rows_diag_A; i++) { rowsum = 0.0; - for (j = A_diag_i[i]; j < A_diag_i[i+1]; j++) + for (j = A_diag_i[i]; j < A_diag_i[i + 1]; j++) { rowsum += hypre_cabs(A_diag_a[j]); } - for (j = A_offd_i[i]; j < A_offd_i[i+1]; j++) + for (j = A_offd_i[i]; j < A_offd_i[i + 1]; j++) { rowsum += hypre_cabs(A_offd_a[j]); } @@ -5390,7 +5499,7 @@ hypre_ParCSRMatrixInfNorm( hypre_ParCSRMatrix *A, } #ifdef HYPRE_USING_OPENMP -#pragma omp critical + #pragma omp critical #endif { maxsum = hypre_max(maxsum, maxsum_local); @@ -5398,16 +5507,16 @@ hypre_ParCSRMatrixInfNorm( hypre_ParCSRMatrix *A, } #else #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,j,rowsum) reduction(max:maxsum) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,j,rowsum) reduction(max:maxsum) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < num_rows_diag_A; i++) { rowsum = 0.0; - for (j = A_diag_i[i]; j < A_diag_i[i+1]; j++) + for (j = A_diag_i[i]; j < A_diag_i[i + 1]; j++) { rowsum += hypre_cabs(A_diag_a[j]); } - for (j = A_offd_i[i]; j < A_offd_i[i+1]; j++) + for (j = A_offd_i[i]; j < A_offd_i[i + 1]; j++) { rowsum += hypre_cabs(A_offd_a[j]); } @@ -5460,7 +5569,7 @@ hypre_ExchangeExternalRowsInit( hypre_CSRMatrix *B_ext, HYPRE_Int B_int_nnz; hypre_ParCSRCommHandle *comm_handle, *comm_handle_j, *comm_handle_a; - hypre_ParCSRCommPkg *comm_pkg_j; + hypre_ParCSRCommPkg *comm_pkg_j = NULL; HYPRE_Int *jdata_recv_vec_starts; HYPRE_Int *jdata_send_map_starts; @@ -5471,7 +5580,7 @@ hypre_ExchangeExternalRowsInit( hypre_CSRMatrix *B_ext, hypre_MPI_Comm_size(comm, &num_procs); - jdata_send_map_starts = hypre_TAlloc(HYPRE_Int, num_sends+1, HYPRE_MEMORY_HOST); + jdata_send_map_starts = hypre_TAlloc(HYPRE_Int, num_sends + 1, HYPRE_MEMORY_HOST); /*-------------------------------------------------------------------------- * B_ext_rownnz contains the number of elements of row j @@ -5479,7 +5588,7 @@ hypre_ExchangeExternalRowsInit( hypre_CSRMatrix *B_ext, *--------------------------------------------------------------------------*/ for (i = 0; i < B_ext_nrows; i++) { - B_ext_rownnz[i] = B_ext_i[i+1] - B_ext_i[i]; + B_ext_rownnz[i] = B_ext_i[i + 1] - B_ext_i[i]; } /*-------------------------------------------------------------------------- @@ -5495,12 +5604,12 @@ hypre_ExchangeExternalRowsInit( hypre_CSRMatrix *B_ext, jdata_recv_vec_starts[i] = B_ext_i[recv_vec_starts[i]]; } - comm_pkg_j = hypre_CTAlloc(hypre_ParCSRCommPkg, 1, HYPRE_MEMORY_HOST); - hypre_ParCSRCommPkgComm(comm_pkg_j) = comm; - hypre_ParCSRCommPkgNumSends(comm_pkg_j) = num_recvs; - hypre_ParCSRCommPkgNumRecvs(comm_pkg_j) = num_sends; - hypre_ParCSRCommPkgSendProcs(comm_pkg_j) = recv_procs; - hypre_ParCSRCommPkgRecvProcs(comm_pkg_j) = send_procs; + /* Create communication package - note the order of send/recv is reversed */ + hypre_ParCSRCommPkgCreateAndFill(comm, + num_sends, send_procs, jdata_send_map_starts, + num_recvs, recv_procs, jdata_recv_vec_starts, + NULL, + &comm_pkg_j); hypre_ParCSRCommHandleDestroy(comm_handle); @@ -5510,7 +5619,7 @@ hypre_ExchangeExternalRowsInit( hypre_CSRMatrix *B_ext, B_int_i[0] = 0; for (i = 1; i <= B_int_nrows; i++) { - B_int_i[i] += B_int_i[i-1]; + B_int_i[i] += B_int_i[i - 1]; } B_int_nnz = B_int_i[B_int_nrows]; @@ -5523,10 +5632,6 @@ hypre_ExchangeExternalRowsInit( hypre_CSRMatrix *B_ext, jdata_send_map_starts[i] = B_int_i[send_map_starts[i]]; } - /* note the order of send/recv is reversed */ - hypre_ParCSRCommPkgRecvVecStarts(comm_pkg_j) = jdata_send_map_starts; - hypre_ParCSRCommPkgSendMapStarts(comm_pkg_j) = jdata_recv_vec_starts; - /* send/recv CSR rows */ comm_handle_a = hypre_ParCSRCommHandleCreate( 1, comm_pkg_j, B_ext_data, B_int_data); comm_handle_j = hypre_ParCSRCommHandleCreate(21, comm_pkg_j, B_ext_j, B_int_j); @@ -5579,18 +5684,19 @@ hypre_ExchangeExternalRowsWait(void *vrequest) return B_int; } - /*-------------------------------------------------------------------------- * hypre_ParCSRMatrixExtractSubmatrixFC * * extract submatrix A_{FF}, A_{FC}, A_{CF} or A_{CC} * char job[2] = "FF", "FC", "CF" or "CC" + * + * TODO (VPM): Can we do the same with hypre_ParCSRMatrixGenerateFFFC? *--------------------------------------------------------------------------*/ HYPRE_Int hypre_ParCSRMatrixExtractSubmatrixFC( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, - HYPRE_BigInt *cpts_starts_in, + HYPRE_BigInt *cpts_starts, const char *job, hypre_ParCSRMatrix **B_ptr, HYPRE_Real strength_thresh) @@ -5625,8 +5731,8 @@ hypre_ParCSRMatrixExtractSubmatrixFC( hypre_ParCSRMatrix *A, HYPRE_BigInt B_nrow_global, B_ncol_global; HYPRE_Int A_nlocal, B_nrow_local, B_ncol_local, B_nnz_diag, B_nnz_offd; - HYPRE_BigInt total_global_fpts, total_global_cpts, *fpts_starts, *cpts_starts; - HYPRE_Int nf_local, nc_local; + HYPRE_BigInt total_global_fpts, total_global_cpts, fpts_starts[2]; + HYPRE_Int nf_local, nc_local = 0; HYPRE_BigInt big_nf_local; HYPRE_Int row_set, col_set; HYPRE_BigInt *B_row_starts, *B_col_starts, B_first_col; @@ -5649,18 +5755,11 @@ hypre_ParCSRMatrixExtractSubmatrixFC( hypre_ParCSRMatrix *A, * assuming cpts_starts is given */ if (row_set == 1 || col_set == 1) { - /* copy cpts_starts first */ - HYPRE_Int len; - len = 2; - cpts_starts = hypre_TAlloc(HYPRE_BigInt, len, HYPRE_MEMORY_HOST); - hypre_TMemcpy(cpts_starts, cpts_starts_in, HYPRE_BigInt, len, - HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); - - if (my_id == (num_procs -1)) + if (my_id == (num_procs - 1)) { total_global_cpts = cpts_starts[1]; } - hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); + hypre_MPI_Bcast(&total_global_cpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); nc_local = (HYPRE_Int)(cpts_starts[1] - cpts_starts[0]); } @@ -5676,14 +5775,13 @@ hypre_ParCSRMatrixExtractSubmatrixFC( hypre_ParCSRMatrix *A, } } big_nf_local = (HYPRE_BigInt) nf_local; - fpts_starts = hypre_TAlloc(HYPRE_BigInt, 2, HYPRE_MEMORY_HOST); - hypre_MPI_Scan(&big_nf_local, fpts_starts+1, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); + hypre_MPI_Scan(&big_nf_local, fpts_starts + 1, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); fpts_starts[0] = fpts_starts[1] - nf_local; if (my_id == num_procs - 1) { total_global_fpts = fpts_starts[1]; } - hypre_MPI_Bcast(&total_global_fpts, 1, HYPRE_MPI_BIG_INT, num_procs-1, comm); + hypre_MPI_Bcast(&total_global_fpts, 1, HYPRE_MPI_BIG_INT, num_procs - 1, comm); } if (row_set == -1 && col_set == -1) @@ -5750,14 +5848,15 @@ hypre_ParCSRMatrixExtractSubmatrixFC( hypre_ParCSRMatrix *A, hypre_assert(k == B_ncol_local); num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - send_buf_data = hypre_TAlloc(HYPRE_BigInt, hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + send_buf_data = hypre_TAlloc(HYPRE_BigInt, + hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), HYPRE_MEMORY_HOST); k = 0; for (i = 0; i < num_sends; i++) { /* start pos of elements sent to send_proc[i] */ HYPRE_Int si = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - HYPRE_Int ei = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); + HYPRE_Int ei = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); /* loop through all elems to send_proc[i] */ for (j = si; j < ei; j++) { @@ -5803,8 +5902,8 @@ hypre_ParCSRMatrixExtractSubmatrixFC( hypre_ParCSRMatrix *A, /* count nnz and set ia */ B_nnz_diag = B_nnz_offd = 0; B_maxel_row = hypre_TAlloc(HYPRE_Real, B_nrow_local, HYPRE_MEMORY_HOST); - B_diag_i = hypre_TAlloc(HYPRE_Int, B_nrow_local+1, HYPRE_MEMORY_HOST); - B_offd_i = hypre_TAlloc(HYPRE_Int, B_nrow_local+1, HYPRE_MEMORY_HOST); + B_diag_i = hypre_TAlloc(HYPRE_Int, B_nrow_local + 1, HYPRE_MEMORY_HOST); + B_offd_i = hypre_TAlloc(HYPRE_Int, B_nrow_local + 1, HYPRE_MEMORY_HOST); B_diag_i[0] = B_offd_i[0] = 0; for (i = 0, k = 0; i < A_nlocal; i++) @@ -5818,15 +5917,16 @@ hypre_ParCSRMatrixExtractSubmatrixFC( hypre_ParCSRMatrix *A, // Get max abs-value element of this row HYPRE_Real temp_max = 0; - if (strength_thresh > 0) { - for (j = A_diag_i[i]+1; j < A_diag_i[i+1]; j++) + if (strength_thresh > 0) + { + for (j = A_diag_i[i] + 1; j < A_diag_i[i + 1]; j++) { if (hypre_cabs(A_diag_a[j]) > temp_max) { temp_max = hypre_cabs(A_diag_a[j]); } } - for (j = A_offd_i[i]; j < A_offd_i[i+1]; j++) + for (j = A_offd_i[i]; j < A_offd_i[i + 1]; j++) { if (hypre_cabs(A_offd_a[j]) > temp_max) { @@ -5834,7 +5934,7 @@ hypre_ParCSRMatrixExtractSubmatrixFC( hypre_ParCSRMatrix *A, } } } - B_maxel_row[k-1] = temp_max; + B_maxel_row[k - 1] = temp_max; // add one for diagonal element j = A_diag_i[i]; @@ -5844,18 +5944,18 @@ hypre_ParCSRMatrixExtractSubmatrixFC( hypre_ParCSRMatrix *A, } // Count nnzs larger than tolerance times max row element - for (j = A_diag_i[i]+1; j < A_diag_i[i+1]; j++) + for (j = A_diag_i[i] + 1; j < A_diag_i[i + 1]; j++) { if ( (sub_idx_diag[A_diag_j[j]] != -1) && - (hypre_cabs(A_diag_a[j]) > (strength_thresh*temp_max)) ) + (hypre_cabs(A_diag_a[j]) > (strength_thresh * temp_max)) ) { B_nnz_diag++; } } - for (j = A_offd_i[i]; j < A_offd_i[i+1]; j++) + for (j = A_offd_i[i]; j < A_offd_i[i + 1]; j++) { if ( (sub_idx_offd[A_offd_j[j]] != -1) && - (hypre_cabs(A_offd_a[j]) > (strength_thresh*temp_max)) ) + (hypre_cabs(A_offd_a[j]) > (strength_thresh * temp_max)) ) { B_nnz_offd++; } @@ -5871,7 +5971,7 @@ hypre_ParCSRMatrixExtractSubmatrixFC( hypre_ParCSRMatrix *A, B_offd_j = hypre_TAlloc(HYPRE_Int, B_nnz_offd, HYPRE_MEMORY_HOST); B_offd_a = hypre_TAlloc(HYPRE_Complex, B_nnz_offd, HYPRE_MEMORY_HOST); - for (i = 0, k=0, k1 = 0, k2 = 0; i < A_nlocal; i++) + for (i = 0, k = 0, k1 = 0, k2 = 0; i < A_nlocal; i++) { HYPRE_Int CF_i = CF_marker[i] > 0 ? 1 : -1; if (CF_i != row_set) @@ -5881,20 +5981,20 @@ hypre_ParCSRMatrixExtractSubmatrixFC( hypre_ParCSRMatrix *A, HYPRE_Real maxel = B_maxel_row[k]; k++; - for (j = A_diag_i[i]; j < A_diag_i[i+1]; j++) + for (j = A_diag_i[i]; j < A_diag_i[i + 1]; j++) { HYPRE_Int j1 = sub_idx_diag[A_diag_j[j]]; - if ( (j1 != -1) && ( (hypre_cabs(A_diag_a[j]) > (strength_thresh*maxel)) || j==A_diag_i[i] ) ) + if ( (j1 != -1) && ( (hypre_cabs(A_diag_a[j]) > (strength_thresh * maxel)) || j == A_diag_i[i] ) ) { B_diag_j[k1] = j1; B_diag_a[k1] = A_diag_a[j]; k1++; } } - for (j = A_offd_i[i]; j < A_offd_i[i+1]; j++) + for (j = A_offd_i[i]; j < A_offd_i[i + 1]; j++) { - HYPRE_Int j1 = sub_idx_offd[A_offd_j[j]]; - if ((j1 != -1) && (hypre_cabs(A_offd_a[j]) > (strength_thresh*maxel))) + HYPRE_Int j1 = (HYPRE_Int) sub_idx_offd[A_offd_j[j]]; + if ((j1 != -1) && (hypre_cabs(A_offd_a[j]) > (strength_thresh * maxel))) { hypre_assert(j1 >= 0 && j1 < num_cols_B_offd); B_offd_j[k2] = j1; @@ -5937,15 +6037,6 @@ hypre_ParCSRMatrixExtractSubmatrixFC( hypre_ParCSRMatrix *A, *B_ptr = B; - if (B_row_starts == B_col_starts) - { - hypre_TFree(B_row_starts, HYPRE_MEMORY_HOST); - } - else - { - hypre_TFree(B_row_starts, HYPRE_MEMORY_HOST); - hypre_TFree(B_col_starts, HYPRE_MEMORY_HOST); - } hypre_TFree(B_maxel_row, HYPRE_MEMORY_HOST); hypre_TFree(send_buf_data, HYPRE_MEMORY_HOST); hypre_TFree(sub_idx_diag, HYPRE_MEMORY_HOST); @@ -5954,11 +6045,16 @@ hypre_ParCSRMatrixExtractSubmatrixFC( hypre_ParCSRMatrix *A, return hypre_error_flag; } -/* drop the entries that are not on the diagonal and smaller than: +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixDropSmallEntriesHost + * + * drop the entries that are not on the diagonal and smaller than: * type 0: tol (TODO) * type 1: tol*(1-norm of row) * type 2: tol*(2-norm of row) - * type -1: tol*(infinity norm of row) */ + * type -1: tol*(infinity norm of row) + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_ParCSRMatrixDropSmallEntriesHost( hypre_ParCSRMatrix *A, HYPRE_Real tol, @@ -5985,6 +6081,7 @@ hypre_ParCSRMatrixDropSmallEntriesHost( hypre_ParCSRMatrix *A, HYPRE_BigInt first_row = hypre_ParCSRMatrixFirstRowIndex(A); HYPRE_Int nrow_local = hypre_CSRMatrixNumRows(A_diag); HYPRE_Int my_id, num_procs; + /* MPI size and rank*/ hypre_MPI_Comm_size(comm, &num_procs); hypre_MPI_Comm_rank(comm, &my_id); @@ -5996,53 +6093,53 @@ hypre_ParCSRMatrixDropSmallEntriesHost( hypre_ParCSRMatrix *A, { /* compute row norm */ HYPRE_Real row_nrm = 0.0; - for (j = A_diag_i_i; j < A_diag_i[i+1]; j++) + for (j = A_diag_i_i; j < A_diag_i[i + 1]; j++) { HYPRE_Complex v = A_diag_a[j]; if (type == 1) { - row_nrm += fabs(v); + row_nrm += hypre_cabs(v); } else if (type == 2) { - row_nrm += v*v; + row_nrm += v * v; } else { - row_nrm = hypre_max(row_nrm, fabs(v)); + row_nrm = hypre_max(row_nrm, hypre_cabs(v)); } } if (num_procs > 1) { - for (j = A_offd_i_i; j < A_offd_i[i+1]; j++) + for (j = A_offd_i_i; j < A_offd_i[i + 1]; j++) { HYPRE_Complex v = A_offd_a[j]; if (type == 1) { - row_nrm += fabs(v); + row_nrm += hypre_cabs(v); } else if (type == 2) { - row_nrm += v*v; + row_nrm += v * v; } else { - row_nrm = hypre_max(row_nrm, fabs(v)); + row_nrm = hypre_max(row_nrm, hypre_cabs(v)); } } } if (type == 2) { - row_nrm = sqrt(row_nrm); + row_nrm = hypre_sqrt(row_nrm); } /* drop small entries based on tol and row norm */ - for (j = A_diag_i_i; j < A_diag_i[i+1]; j++) + for (j = A_diag_i_i; j < A_diag_i[i + 1]; j++) { HYPRE_Int col = A_diag_j[j]; HYPRE_Complex val = A_diag_a[j]; - if (i == col || fabs(val) >= tol * row_nrm) + if (i == col || hypre_cabs(val) >= tol * row_nrm) { A_diag_j[nnz_diag] = col; A_diag_a[nnz_diag] = val; @@ -6051,13 +6148,13 @@ hypre_ParCSRMatrixDropSmallEntriesHost( hypre_ParCSRMatrix *A, } if (num_procs > 1) { - for (j = A_offd_i_i; j < A_offd_i[i+1]; j++) + for (j = A_offd_i_i; j < A_offd_i[i + 1]; j++) { HYPRE_Int col = A_offd_j[j]; HYPRE_Complex val = A_offd_a[j]; /* in normal cases: diagonal entry should not * appear in A_offd (but this can still be possible) */ - if (i + first_row == col_map_offd_A[col] || fabs(val) >= tol * row_nrm) + if (i + first_row == col_map_offd_A[col] || hypre_cabs(val) >= tol * row_nrm) { if (0 == marker_offd[col]) { @@ -6069,10 +6166,10 @@ hypre_ParCSRMatrixDropSmallEntriesHost( hypre_ParCSRMatrix *A, } } } - A_diag_i_i = A_diag_i[i+1]; - A_offd_i_i = A_offd_i[i+1]; - A_diag_i[i+1] = nnz_diag; - A_offd_i[i+1] = nnz_offd; + A_diag_i_i = A_diag_i[i + 1]; + A_offd_i_i = A_offd_i[i + 1]; + A_diag_i[i + 1] = nnz_diag; + A_offd_i[i + 1] = nnz_offd; } hypre_CSRMatrixNumNonzeros(A_diag) = nnz_diag; @@ -6106,12 +6203,17 @@ hypre_ParCSRMatrixDropSmallEntriesHost( hypre_ParCSRMatrix *A, return hypre_error_flag; } -/* drop the entries that are not on the diagonal and smaller than +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixDropSmallEntries + * + * drop the entries that are not on the diagonal and smaller than * type 0: tol * type 1: tol*(1-norm of row) * type 2: tol*(2-norm of row) * type -1: tol*(infinity norm of row) - * NOTE: some type options above unavailable on either host or device */ + * NOTE: some type options above unavailable on either host or device + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_ParCSRMatrixDropSmallEntries( hypre_ParCSRMatrix *A, HYPRE_Real tol, @@ -6122,36 +6224,28 @@ hypre_ParCSRMatrixDropSmallEntries( hypre_ParCSRMatrix *A, return hypre_error_flag; } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - hypre_GpuProfilingPushRange("ParCSRMatrixDropSmallEntries"); -#endif - - HYPRE_Int ierr = 0; - -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(A) ); if (exec == HYPRE_EXEC_DEVICE) { - ierr = hypre_ParCSRMatrixDropSmallEntriesDevice(A, tol, type); + hypre_ParCSRMatrixDropSmallEntriesDevice(A, tol, type); } else #endif { - ierr = hypre_ParCSRMatrixDropSmallEntriesHost(A, tol, type); + hypre_ParCSRMatrixDropSmallEntriesHost(A, tol, type); } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - hypre_GpuProfilingPopRange(); -#endif - - return ierr; + return hypre_error_flag; } -/* Scale ParCSR matrix A = scalar * A - * A: the target CSR matrix - * scalar: real number - */ +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixScale + * + * Computes A = scalar * A + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_ParCSRMatrixScale(hypre_ParCSRMatrix *A, HYPRE_Complex scalar) @@ -6166,26 +6260,796 @@ hypre_ParCSRMatrixScale(hypre_ParCSRMatrix *A, } /*-------------------------------------------------------------------------- - * hypre_ParCSRMatrixReorder: + * hypre_ParCSRMatrixDiagScaleHost + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixDiagScaleHost( hypre_ParCSRMatrix *par_A, + hypre_ParVector *par_ld, + hypre_ParVector *par_rd ) +{ + /* Input variables */ + hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(par_A); + HYPRE_Int num_sends; + HYPRE_Int *send_map_elmts; + HYPRE_Int *send_map_starts; + + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(par_A); + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(par_A); + HYPRE_Int num_cols_offd = hypre_CSRMatrixNumCols(A_offd); + + hypre_Vector *ld = (par_ld) ? hypre_ParVectorLocalVector(par_ld) : NULL; + hypre_Vector *rd = hypre_ParVectorLocalVector(par_rd); + HYPRE_Complex *rd_data = hypre_VectorData(rd); + + /* Local variables */ + HYPRE_Int i; + hypre_Vector *rdbuf; + HYPRE_Complex *recv_rdbuf_data; + HYPRE_Complex *send_rdbuf_data; + + /*--------------------------------------------------------------------- + * Communication phase + *--------------------------------------------------------------------*/ + + /* Create buffer vectors */ + rdbuf = hypre_SeqVectorCreate(num_cols_offd); + + /* If there exists no CommPkg for A, create it. */ + if (!comm_pkg) + { + hypre_MatvecCommPkgCreate(par_A); + comm_pkg = hypre_ParCSRMatrixCommPkg(par_A); + } + num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); + send_map_elmts = hypre_ParCSRCommPkgSendMapElmts(comm_pkg); + send_map_starts = hypre_ParCSRCommPkgSendMapStarts(comm_pkg); + +#if defined(HYPRE_USING_PERSISTENT_COMM) + hypre_ParCSRPersistentCommHandle *comm_handle = + hypre_ParCSRCommPkgGetPersistentCommHandle(1, comm_pkg); + + hypre_VectorData(rdbuf) = (HYPRE_Complex *) + hypre_ParCSRCommHandleRecvDataBuffer(comm_handle); + hypre_SeqVectorSetDataOwner(rdbuf, 0); + +#else + hypre_ParCSRCommHandle *comm_handle; +#endif + + /* Initialize rdbuf */ + hypre_SeqVectorInitialize_v2(rdbuf, HYPRE_MEMORY_HOST); + recv_rdbuf_data = hypre_VectorData(rdbuf); + + /* Allocate send buffer for rdbuf */ +#if defined(HYPRE_USING_PERSISTENT_COMM) + send_rdbuf_data = (HYPRE_Complex *) hypre_ParCSRCommHandleSendDataBuffer(comm_handle); +#else + send_rdbuf_data = hypre_TAlloc(HYPRE_Complex, send_map_starts[num_sends], HYPRE_MEMORY_HOST); +#endif + + /* Pack send data */ +#if defined(HYPRE_USING_OPENMP) + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif + for (i = send_map_starts[0]; i < send_map_starts[num_sends]; i++) + { + send_rdbuf_data[i] = rd_data[send_map_elmts[i]]; + } + + /* Non-blocking communication starts */ +#ifdef HYPRE_USING_PERSISTENT_COMM + hypre_ParCSRPersistentCommHandleStart(comm_handle, HYPRE_MEMORY_HOST, send_rdbuf_data); + +#else + comm_handle = hypre_ParCSRCommHandleCreate_v2(1, comm_pkg, + HYPRE_MEMORY_HOST, send_rdbuf_data, + HYPRE_MEMORY_HOST, recv_rdbuf_data); +#endif + + /*--------------------------------------------------------------------- + * Computation phase + *--------------------------------------------------------------------*/ + + /* A_diag = diag(ld) * A_diag * diag(rd) */ + hypre_CSRMatrixDiagScale(A_diag, ld, rd); + + /* Non-blocking communication ends */ +#ifdef HYPRE_USING_PERSISTENT_COMM + hypre_ParCSRPersistentCommHandleWait(comm_handle, HYPRE_MEMORY_HOST, recv_rdbuf_data); +#else + hypre_ParCSRCommHandleDestroy(comm_handle); +#endif + + /* A_offd = diag(ld) * A_offd * diag(rd) */ + hypre_CSRMatrixDiagScale(A_offd, ld, rdbuf); + + /* Free memory */ + hypre_SeqVectorDestroy(rdbuf); +#if !defined(HYPRE_USING_PERSISTENT_COMM) + hypre_TFree(send_rdbuf_data, HYPRE_MEMORY_HOST); +#endif + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixDiagScale * - * Reorders the column and data arrays of a the diagonal component of a square - * ParCSR matrix, such that the first entry in each row is the diagonal one. + * Computes A = diag(ld) * A * diag(rd), where the diagonal matrices + * "diag(ld)" and "diag(rd)" are stored as distributed vectors. *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_ParCSRMatrixReorder(hypre_ParCSRMatrix *A) +hypre_ParCSRMatrixDiagScale( hypre_ParCSRMatrix *par_A, + hypre_ParVector *par_ld, + hypre_ParVector *par_rd ) { - HYPRE_BigInt nrows_A = hypre_ParCSRMatrixGlobalNumRows(A); - HYPRE_BigInt ncols_A = hypre_ParCSRMatrixGlobalNumCols(A); - hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + /* Input variables */ + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(par_A); + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(par_A); + hypre_Vector *ld; - if (nrows_A != ncols_A) + /* Sanity check */ + if (!par_rd && !par_ld) { - hypre_error_w_msg(HYPRE_ERROR_GENERIC," Error! Matrix should be square!\n"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Scaling matrices are not set!\n"); return hypre_error_flag; } - hypre_CSRMatrixReorder(A_diag); + /* Perform row scaling only (no communication) */ + if (!par_rd && par_ld) + { + ld = hypre_ParVectorLocalVector(par_ld); + + hypre_CSRMatrixDiagScale(A_diag, ld, NULL); + hypre_CSRMatrixDiagScale(A_offd, ld, NULL); + + return hypre_error_flag; + } + +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(par_A) ); + + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_ParCSRMatrixDiagScaleDevice(par_A, par_ld, par_rd); + } + else +#endif + { + hypre_ParCSRMatrixDiagScaleHost(par_A, par_ld, par_rd); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixReorder: + * + * Reorders the column and data arrays of a the diagonal component of a square + * ParCSR matrix, such that the first entry in each row is the diagonal one. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixReorder(hypre_ParCSRMatrix *A) +{ + HYPRE_BigInt nrows_A = hypre_ParCSRMatrixGlobalNumRows(A); + HYPRE_BigInt ncols_A = hypre_ParCSRMatrixGlobalNumCols(A); + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + + if (nrows_A != ncols_A) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, " Error! Matrix should be square!\n"); + return hypre_error_flag; + } + + hypre_CSRMatrixReorder(A_diag); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixCompressOffdMap + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixCompressOffdMap(hypre_ParCSRMatrix *A) +{ +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(A) ); + + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_ParCSRMatrixCompressOffdMapDevice(A); + } +#else + // RL: I guess it's not needed for the host code [?] + HYPRE_UNUSED_VAR(A); +#endif + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * HYPRE_ParCSRDiagScaleVectorHost + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRDiagScaleVectorHost( hypre_ParCSRMatrix *par_A, + hypre_ParVector *par_y, + hypre_ParVector *par_x ) +{ + /* Local Matrix and Vectors */ + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(par_A); + hypre_Vector *x = hypre_ParVectorLocalVector(par_x); + hypre_Vector *y = hypre_ParVectorLocalVector(par_y); + + /* Local vector x info */ + HYPRE_Complex *x_data = hypre_VectorData(x); + HYPRE_Int x_num_vectors = hypre_VectorNumVectors(x); + HYPRE_Int x_vecstride = hypre_VectorVectorStride(x); + + /* Local vector y info */ + HYPRE_Complex *y_data = hypre_VectorData(y); + HYPRE_Int y_vecstride = hypre_VectorVectorStride(y); + + /* Local matrix A info */ + HYPRE_Complex *A_data = hypre_CSRMatrixData(A_diag); + HYPRE_Int *A_i = hypre_CSRMatrixI(A_diag); + HYPRE_Int num_rows = hypre_CSRMatrixNumRows(A_diag); + + /* Local variables */ + HYPRE_Int i, k; + HYPRE_Complex coef; + + switch (x_num_vectors) + { + case 1: +#if defined(HYPRE_USING_OPENMP) + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < num_rows; i++) + { + x_data[i] = y_data[i] / A_data[A_i[i]]; + } + break; + + case 2: +#if defined(HYPRE_USING_OPENMP) + #pragma omp parallel for private(i, coef) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < num_rows; i++) + { + coef = 1.0 / A_data[A_i[i]]; + + x_data[i] = y_data[i] * coef; + x_data[i + x_vecstride] = y_data[i + y_vecstride] * coef; + } + break; + + case 3: +#if defined(HYPRE_USING_OPENMP) + #pragma omp parallel for private(i, coef) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < num_rows; i++) + { + coef = 1.0 / A_data[A_i[i]]; + + x_data[i] = y_data[i] * coef; + x_data[i + x_vecstride] = y_data[i + y_vecstride] * coef; + x_data[i + 2 * x_vecstride] = y_data[i + 2 * y_vecstride] * coef; + } + break; + + case 4: +#if defined(HYPRE_USING_OPENMP) + #pragma omp parallel for private(i, coef) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < num_rows; i++) + { + coef = 1.0 / A_data[A_i[i]]; + + x_data[i] = y_data[i] * coef; + x_data[i + x_vecstride] = y_data[i + y_vecstride] * coef; + x_data[i + 2 * x_vecstride] = y_data[i + 2 * y_vecstride] * coef; + x_data[i + 3 * x_vecstride] = y_data[i + 3 * y_vecstride] * coef; + } + break; + + default: +#if defined(HYPRE_USING_OPENMP) + #pragma omp parallel for private(i, k, coef) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < num_rows; i++) + { + coef = 1.0 / A_data[A_i[i]]; + + for (k = 0; k < x_num_vectors; k++) + { + x_data[i + k * x_vecstride] = y_data[i + k * y_vecstride] * coef; + } + } + break; + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_ParCSRDiagScaleVector + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRDiagScaleVector( hypre_ParCSRMatrix *par_A, + hypre_ParVector *par_y, + hypre_ParVector *par_x ) +{ + /* Local Matrix and Vectors */ + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(par_A); + hypre_Vector *x = hypre_ParVectorLocalVector(par_x); + hypre_Vector *y = hypre_ParVectorLocalVector(par_y); + + /* Local vector x info */ + HYPRE_Int x_size = hypre_VectorSize(x); + HYPRE_Int x_num_vectors = hypre_VectorNumVectors(x); + HYPRE_Int x_vecstride = hypre_VectorVectorStride(x); + + /* Local vector y info */ + HYPRE_Int y_size = hypre_VectorSize(y); + HYPRE_Int y_num_vectors = hypre_VectorNumVectors(y); + HYPRE_Int y_vecstride = hypre_VectorVectorStride(y); + + /* Local matrix A info */ + HYPRE_Int num_rows = hypre_CSRMatrixNumRows(A_diag); + + /*--------------------------------------------- + * Sanity checks + *---------------------------------------------*/ + + if (x_num_vectors != y_num_vectors) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Error! incompatible number of vectors!\n"); + return hypre_error_flag; + } + + if (num_rows != x_size) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Error! incompatible x size!\n"); + return hypre_error_flag; + } + + if (x_size > 0 && x_vecstride <= 0) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Error! non-positive x vector stride!\n"); + return hypre_error_flag; + } + + if (y_size > 0 && y_vecstride <= 0) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Error! non-positive y vector stride!\n"); + return hypre_error_flag; + } + + if (num_rows != y_size) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Error! incompatible y size!\n"); + return hypre_error_flag; + } + + /*--------------------------------------------- + * Computation + *---------------------------------------------*/ + +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(par_A) ); + + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_ParCSRDiagScaleVectorDevice(par_A, par_y, par_x); + } + else +#endif + { + hypre_ParCSRDiagScaleVectorHost(par_A, par_y, par_x); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixBlockColSumHost + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixBlockColSumHost( hypre_ParCSRMatrix *A, + hypre_DenseBlockMatrix *B ) +{ + /* ParCSRMatrix A */ + HYPRE_MemoryLocation memory_location = hypre_ParCSRMatrixMemoryLocation(A); + + /* A_diag */ + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + HYPRE_Complex *A_diag_data = hypre_CSRMatrixData(A_diag); + HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); + HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); + HYPRE_Int num_rows_diag_A = hypre_CSRMatrixNumRows(A_diag); + + /* A_offd */ + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); + HYPRE_Complex *A_offd_data = hypre_CSRMatrixData(A_offd); + HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); + HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); + HYPRE_Int num_rows_offd_A = hypre_CSRMatrixNumRows(A_offd); + HYPRE_Int num_cols_offd_A = hypre_CSRMatrixNumCols(A_offd); + + /* Output vector variables */ + HYPRE_Int num_rows_block_B = hypre_DenseBlockMatrixNumRowsBlock(B); + HYPRE_Int num_cols_block_B = hypre_DenseBlockMatrixNumColsBlock(B); + + /* Local variables */ + HYPRE_Int i, j, col; + HYPRE_Int ib, ir, jr; + HYPRE_Complex *recv_data; + HYPRE_Complex *send_data; + + /* Communication variables */ + hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); + HYPRE_Int num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); + HYPRE_Int *send_map_elmts; + HYPRE_Int *send_map_starts; +#if defined(HYPRE_USING_PERSISTENT_COMM) + hypre_ParCSRPersistentCommHandle *comm_handle; +#else + hypre_ParCSRCommHandle *comm_handle; +#endif + + /* Update commpkg offsets */ + hypre_ParCSRCommPkgUpdateVecStarts(comm_pkg, 1, 0, 1); + send_map_elmts = hypre_ParCSRCommPkgSendMapElmts(comm_pkg); + send_map_starts = hypre_ParCSRCommPkgSendMapStarts(comm_pkg); + + /* Allocate the recv and send buffers */ +#if defined(HYPRE_USING_PERSISTENT_COMM) + comm_handle = hypre_ParCSRCommPkgGetPersistentCommHandle(HYPRE_COMM_PKG_JOB_COMPLEX, comm_pkg); + recv_data = (HYPRE_Complex *) hypre_ParCSRCommHandleRecvDataBuffer(comm_handle); + send_data = (HYPRE_Complex *) hypre_ParCSRCommHandleSendDataBuffer(comm_handle); + send_data = hypre_Memset((void *) send_data, 0, + (size_t) (num_cols_offd_A) * sizeof(HYPRE_Complex), + memory_location); +#else + send_data = hypre_CTAlloc(HYPRE_Complex, num_cols_offd_A, memory_location); + recv_data = hypre_TAlloc(HYPRE_Complex, send_map_starts[num_sends], memory_location); +#endif + + /* Pack send data */ + if (A_offd_i[num_rows_offd_A] - A_offd_i[0] > 0) + { + for (i = 0; i < num_rows_offd_A; i++) + { + for (j = A_offd_i[i]; j < A_offd_i[i + 1]; j++) + { + col = A_offd_j[j]; + send_data[col] += A_offd_data[j]; + } + } + } + + /* Non-blocking communication starts */ +#if defined(HYPRE_USING_PERSISTENT_COMM) + hypre_ParCSRPersistentCommHandleStart(comm_handle, memory_location, send_data); + +#else + comm_handle = hypre_ParCSRCommHandleCreate_v2(2, comm_pkg, + memory_location, send_data, + memory_location, recv_data); +#endif + + /* Overlapped local computation. */ + for (i = 0; i < num_rows_diag_A; i++) + { + ir = i % num_rows_block_B; + for (j = A_diag_i[i]; j < A_diag_i[i + 1]; j++) + { + col = A_diag_j[j]; + ib = col / num_cols_block_B; + jr = col % num_cols_block_B; + + hypre_assert(hypre_DenseBlockMatrixNumNonzerosBlock(B) * ib + + hypre_DenseBlockMatrixRowStride(B) * ir + + hypre_DenseBlockMatrixColStride(B) * jr < + hypre_DenseBlockMatrixNumNonzeros(B)); + + hypre_DenseBlockMatrixDataBIJ(B, ib, ir, jr) += A_diag_data[j]; + } + } + + /* Non-blocking communication ends */ +#if defined(HYPRE_USING_PERSISTENT_COMM) + hypre_ParCSRPersistentCommHandleWait(comm_handle, memory_location, recv_data); +#else + hypre_ParCSRCommHandleDestroy(comm_handle); +#endif + + /* Unpack recv data */ + for (i = send_map_starts[0]; i < send_map_starts[num_sends]; i++) + { + col = send_map_elmts[i]; + ib = col / num_cols_block_B; + ir = col % num_rows_block_B; + jr = col % num_cols_block_B; + + hypre_assert(hypre_DenseBlockMatrixNumNonzerosBlock(B) * ib + + hypre_DenseBlockMatrixRowStride(B) * ir + + hypre_DenseBlockMatrixColStride(B) * jr < + hypre_DenseBlockMatrixNumNonzeros(B)); + + hypre_DenseBlockMatrixDataBIJ(B, ib, ir, jr) += recv_data[i]; + } + + /* Free memory */ +#if !defined(HYPRE_USING_PERSISTENT_COMM) + hypre_TFree(send_data, memory_location); + hypre_TFree(recv_data, memory_location); +#endif + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixBlockColSum + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixBlockColSum( hypre_ParCSRMatrix *A, + HYPRE_Int row_major, + HYPRE_Int num_rows_block, + HYPRE_Int num_cols_block, + hypre_DenseBlockMatrix **B_ptr ) +{ + HYPRE_MemoryLocation memory_location = hypre_ParCSRMatrixMemoryLocation(A); + HYPRE_BigInt num_rows_A = hypre_ParCSRMatrixGlobalNumRows(A); + HYPRE_BigInt num_cols_A = hypre_ParCSRMatrixGlobalNumCols(A); + + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + HYPRE_Int num_rows_diag_A = hypre_CSRMatrixNumRows(A_diag); + HYPRE_Int num_cols_diag_A = hypre_CSRMatrixNumCols(A_diag); + + hypre_DenseBlockMatrix *B; + + /*--------------------------------------------- + * Sanity checks + *---------------------------------------------*/ + + if (num_rows_block < 1 || num_cols_block < 1) + { + *B_ptr = NULL; + return hypre_error_flag; + } + + if (num_rows_A % ((HYPRE_BigInt) num_rows_block)) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "Global number of rows is not divisable by the block dimension"); + return hypre_error_flag; + } + + if (num_cols_A % ((HYPRE_BigInt) num_cols_block)) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "Global number of columns is not divisable by the block dimension"); + return hypre_error_flag; + } + + HYPRE_ANNOTATE_FUNC_BEGIN; + if (!hypre_ParCSRMatrixCommPkg(A)) + { + hypre_MatvecCommPkgCreate(A); + } + + /*--------------------------------------------- + * Compute block column sum matrix + *---------------------------------------------*/ + + /* Create output matrix */ + B = hypre_DenseBlockMatrixCreate(row_major, + num_rows_diag_A, num_cols_diag_A, + num_rows_block, num_cols_block); + + /* Initialize the output matrix */ + hypre_DenseBlockMatrixInitializeOn(B, memory_location); + +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1(memory_location); + + if (exec == HYPRE_EXEC_DEVICE) + { + /* TODO (VPM): hypre_ParCSRMatrixColSumReduceDevice */ + hypre_ParCSRMatrixMigrate(A, HYPRE_MEMORY_HOST); + hypre_ParCSRMatrixBlockColSumHost(A, B); + hypre_ParCSRMatrixMigrate(A, HYPRE_MEMORY_DEVICE); + hypre_DenseBlockMatrixMigrate(B, HYPRE_MEMORY_DEVICE); + } + else +#endif + { + hypre_ParCSRMatrixBlockColSumHost(A, B); + } + + /* Set output pointer */ + *B_ptr = B; + + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixColSumHost + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixColSumHost( hypre_ParCSRMatrix *A, + hypre_ParVector *b ) +{ + /* ParCSRMatrix A */ + HYPRE_MemoryLocation memory_location = hypre_ParCSRMatrixMemoryLocation(A); + + /* A_diag */ + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + HYPRE_Complex *A_diag_data = hypre_CSRMatrixData(A_diag); + HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); + HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); + HYPRE_Int num_rows_diag_A = hypre_CSRMatrixNumRows(A_diag); + + /* A_offd */ + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); + HYPRE_Complex *A_offd_data = hypre_CSRMatrixData(A_offd); + HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); + HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); + HYPRE_Int num_rows_offd_A = hypre_CSRMatrixNumRows(A_offd); + HYPRE_Int num_cols_offd_A = hypre_CSRMatrixNumCols(A_offd); + + /* Local variables */ + HYPRE_Int i, j, col; + HYPRE_Complex *recv_data; + HYPRE_Complex *send_data; + + /* Communication variables */ + hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); + HYPRE_Int num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); + HYPRE_Int *send_map_elmts; + HYPRE_Int *send_map_starts; +#if defined(HYPRE_USING_PERSISTENT_COMM) + hypre_ParCSRPersistentCommHandle *comm_handle; +#else + hypre_ParCSRCommHandle *comm_handle; +#endif + + /* Update commpkg offsets */ + hypre_ParCSRCommPkgUpdateVecStarts(comm_pkg, 1, 0, 1); + send_map_elmts = hypre_ParCSRCommPkgSendMapElmts(comm_pkg); + send_map_starts = hypre_ParCSRCommPkgSendMapStarts(comm_pkg); + + /* Allocate the recv and send buffers */ +#if defined(HYPRE_USING_PERSISTENT_COMM) + comm_handle = hypre_ParCSRCommPkgGetPersistentCommHandle(HYPRE_COMM_PKG_JOB_COMPLEX, comm_pkg); + recv_data = (HYPRE_Complex *) hypre_ParCSRCommHandleRecvDataBuffer(comm_handle); + send_data = (HYPRE_Complex *) hypre_ParCSRCommHandleSendDataBuffer(comm_handle); + send_data = hypre_Memset((void *) send_data, 0, + (size_t) (num_cols_offd_A) * sizeof(HYPRE_Complex), + memory_location); +#else + send_data = hypre_CTAlloc(HYPRE_Complex, num_cols_offd_A, memory_location); + recv_data = hypre_TAlloc(HYPRE_Complex, send_map_starts[num_sends], memory_location); +#endif + + /* Pack send data */ + for (i = 0; i < num_rows_offd_A; i++) + { + for (j = A_offd_i[i]; j < A_offd_i[i + 1]; j++) + { + col = A_offd_j[j]; + send_data[col] += A_offd_data[j]; + } + } + + /* Non-blocking communication starts */ +#if defined(HYPRE_USING_PERSISTENT_COMM) + hypre_ParCSRPersistentCommHandleStart(comm_handle, memory_location, send_data); + +#else + comm_handle = hypre_ParCSRCommHandleCreate_v2(2, comm_pkg, + memory_location, send_data, + memory_location, recv_data); +#endif + + /* Overlapped local computation. */ + for (i = 0; i < num_rows_diag_A; i++) + { + for (j = A_diag_i[i]; j < A_diag_i[i + 1]; j++) + { + col = A_diag_j[j]; + hypre_ParVectorEntryI(b, col) += A_diag_data[j]; + } + } + + /* Non-blocking communication ends */ +#if defined(HYPRE_USING_PERSISTENT_COMM) + hypre_ParCSRPersistentCommHandleWait(comm_handle, memory_location, recv_data); +#else + hypre_ParCSRCommHandleDestroy(comm_handle); +#endif + + /* Unpack recv data */ + for (i = send_map_starts[0]; i < send_map_starts[num_sends]; i++) + { + col = send_map_elmts[i]; + hypre_ParVectorEntryI(b, col) += recv_data[i]; + } + + /* Free memory */ +#if !defined(HYPRE_USING_PERSISTENT_COMM) + hypre_TFree(send_data, memory_location); + hypre_TFree(recv_data, memory_location); +#endif + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixColSum + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixColSum( hypre_ParCSRMatrix *A, + hypre_ParVector **b_ptr ) +{ + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + HYPRE_BigInt global_num_cols = hypre_ParCSRMatrixGlobalNumCols(A); + HYPRE_BigInt *col_starts = hypre_ParCSRMatrixColStarts(A); + HYPRE_MemoryLocation memory_location = hypre_ParCSRMatrixMemoryLocation(A); + + hypre_ParVector *b; + + HYPRE_ANNOTATE_FUNC_BEGIN; + if (!hypre_ParCSRMatrixCommPkg(A)) + { + hypre_MatvecCommPkgCreate(A); + } + + /* Create output vector */ + b = hypre_ParVectorCreate(comm, global_num_cols, col_starts); + + /* Initialize the output vector */ + hypre_ParVectorInitialize_v2(b, memory_location); + + /*--------------------------------------------- + * Compute column sum vector + *---------------------------------------------*/ + +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1(memory_location); + + if (exec == HYPRE_EXEC_DEVICE) + { + /* TODO (VPM): hypre_ParCSRMatrixColSumDevice */ + hypre_ParCSRMatrixMigrate(A, HYPRE_MEMORY_HOST); + hypre_ParVectorMigrate(b, HYPRE_MEMORY_HOST); + hypre_ParCSRMatrixColSumHost(A, b); + hypre_ParCSRMatrixMigrate(A, HYPRE_MEMORY_DEVICE); + hypre_ParVectorMigrate(b, HYPRE_MEMORY_DEVICE); + } + else +#endif + { + hypre_ParCSRMatrixColSumHost(A, b); + } + + /* Set output pointer */ + *b_ptr = b; + + HYPRE_ANNOTATE_FUNC_END; return hypre_error_flag; } diff --git a/external/hypre/src/parcsr_mv/par_csr_matop_device.c b/external/hypre/src/parcsr_mv/par_csr_matop_device.c index c0d44f3d..77fdd650 100644 --- a/external/hypre/src/parcsr_mv/par_csr_matop_device.c +++ b/external/hypre/src/parcsr_mv/par_csr_matop_device.c @@ -1,311 +1,449 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ +#include "_hypre_onedpl.hpp" #include "_hypre_utilities.h" #include "_hypre_parcsr_mv.h" #include "_hypre_utilities.hpp" -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) -HYPRE_Int -hypre_ParcsrGetExternalRowsDeviceInit( hypre_ParCSRMatrix *A, - HYPRE_Int indices_len, - HYPRE_BigInt *indices, - hypre_ParCSRCommPkg *comm_pkg, - HYPRE_Int want_data, - void **request_ptr) +/* return B = [Adiag, Aoffd] */ +#if 1 +__global__ void +hypreGPUKernel_ConcatDiagAndOffd( hypre_DeviceItem &item, + HYPRE_Int nrows, HYPRE_Int diag_ncol, + HYPRE_Int *d_diag_i, HYPRE_Int *d_diag_j, HYPRE_Complex *d_diag_a, + HYPRE_Int *d_offd_i, HYPRE_Int *d_offd_j, HYPRE_Complex *d_offd_a, + HYPRE_Int *cols_offd_map, + HYPRE_Int *d_ib, HYPRE_Int *d_jb, HYPRE_Complex *d_ab) { - HYPRE_Int i, j; - HYPRE_Int num_sends, num_rows_send, num_nnz_send, num_recvs, num_rows_recv, num_nnz_recv; - HYPRE_Int *d_send_i, *send_i, *d_send_map, *d_recv_i, *recv_i; - HYPRE_BigInt *d_send_j, *d_recv_j; - HYPRE_Int *send_jstarts, *recv_jstarts; - HYPRE_Complex *d_send_a = NULL, *d_recv_a = NULL; - hypre_ParCSRCommPkg *comm_pkg_j; - hypre_ParCSRCommHandle *comm_handle, *comm_handle_j, *comm_handle_a; - /* HYPRE_Int global_num_rows = hypre_ParCSRMatrixGlobalNumRows(A); */ - /* diag part of A */ - hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); - HYPRE_Complex *A_diag_a = hypre_CSRMatrixData(A_diag); - HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); - HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); - /* HYPRE_Int local_num_rows = hypre_CSRMatrixNumRows(A_diag); */ - /* off-diag part of A */ - hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); - HYPRE_Complex *A_offd_a = hypre_CSRMatrixData(A_offd); - HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); - HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); - - /* HYPRE_Int *row_starts = hypre_ParCSRMatrixRowStarts(A); */ - /* HYPRE_Int first_row = hypre_ParCSRMatrixFirstRowIndex(A); */ - HYPRE_Int first_col = hypre_ParCSRMatrixFirstColDiag(A); - HYPRE_BigInt *col_map_offd_A = hypre_ParCSRMatrixColMapOffd(A); - HYPRE_Int num_cols_A_offd = hypre_CSRMatrixNumCols(A_offd); - HYPRE_BigInt *d_col_map_offd_A = hypre_ParCSRMatrixDeviceColMapOffd(A); - - MPI_Comm comm = hypre_ParCSRMatrixComm(A); - - HYPRE_Int num_procs; - HYPRE_Int my_id; - void **vrequest; - - hypre_CSRMatrix *A_ext; - - hypre_MPI_Comm_size(comm, &num_procs); - hypre_MPI_Comm_rank(comm, &my_id); - - /* number of sends (#procs) */ - num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - /* number of rows to send */ - num_rows_send = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends); - /* number of recvs (#procs) */ - num_recvs = hypre_ParCSRCommPkgNumRecvs(comm_pkg); - /* number of rows to recv */ - num_rows_recv = hypre_ParCSRCommPkgRecvVecStart(comm_pkg, num_recvs); - - /* must be true if indices contains proper offd indices */ - hypre_assert(indices_len == num_rows_recv); - - /* send_i/recv_i: - * the arrays to send and recv: we first send and recv the row lengths */ - d_send_i = hypre_TAlloc(HYPRE_Int, num_rows_send + 1, HYPRE_MEMORY_DEVICE); - d_send_map = hypre_TAlloc(HYPRE_Int, num_rows_send, HYPRE_MEMORY_DEVICE); - send_i = hypre_TAlloc(HYPRE_Int, num_rows_send, HYPRE_MEMORY_HOST); - recv_i = hypre_TAlloc(HYPRE_Int, num_rows_recv + 1, HYPRE_MEMORY_HOST); - d_recv_i = hypre_TAlloc(HYPRE_Int, num_rows_recv + 1, HYPRE_MEMORY_DEVICE); - - /* fill the send array with row lengths */ - hypre_TMemcpy(d_send_map, hypre_ParCSRCommPkgSendMapElmts(comm_pkg), HYPRE_Int, - num_rows_send, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - - hypre_Memset(d_send_i, 0, sizeof(HYPRE_Int), HYPRE_MEMORY_DEVICE); - hypreDevice_GetRowNnz(num_rows_send, d_send_map, A_diag_i, A_offd_i, d_send_i+1); - - /* send array send_i out: deviceTohost first and MPI (async) - * note the shift in recv_i by one */ - hypre_TMemcpy(send_i, d_send_i+1, HYPRE_Int, num_rows_send, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); - - comm_handle = hypre_ParCSRCommHandleCreate(11, comm_pkg, send_i, recv_i+1); + const HYPRE_Int row = hypre_gpu_get_grid_warp_id<1, 1>(item); - hypreDevice_IntegerInclusiveScan(num_rows_send + 1, d_send_i); - - /* total number of nnz to send */ - hypre_TMemcpy(&num_nnz_send, d_send_i+num_rows_send, HYPRE_Int, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); - - /* prepare data to send out. overlap with the above commmunication */ - d_send_j = hypre_TAlloc(HYPRE_BigInt, num_nnz_send, HYPRE_MEMORY_DEVICE); - if (want_data) - { - d_send_a = hypre_TAlloc(HYPRE_Complex, num_nnz_send, HYPRE_MEMORY_DEVICE); - } - - if (d_col_map_offd_A == NULL) + if (row >= nrows) { - d_col_map_offd_A = hypre_TAlloc(HYPRE_BigInt, num_cols_A_offd, HYPRE_MEMORY_DEVICE); - hypre_TMemcpy(d_col_map_offd_A, col_map_offd_A, HYPRE_BigInt, num_cols_A_offd, - HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - hypre_ParCSRMatrixDeviceColMapOffd(A) = d_col_map_offd_A; + return; } - /* job == 2, d_send_i is input that contains row ptrs (length num_rows_send) */ - hypreDevice_CopyParCSRRows(num_rows_send, d_send_map, 2, num_procs > 1, - first_col, d_col_map_offd_A, - A_diag_i, A_diag_j, A_diag_a, - A_offd_i, A_offd_j, A_offd_a, - d_send_i, d_send_j, d_send_a); + /* lane id inside the warp */ + const HYPRE_Int lane_id = hypre_gpu_get_lane_id<1>(item); + HYPRE_Int i, j = 0, k = 0, p, istart, iend, bstart; - /* pointers to each proc in send_j */ - send_jstarts = hypre_TAlloc(HYPRE_Int, num_sends + 1, HYPRE_MEMORY_HOST); - send_jstarts[0] = 0; - for (i = 1; i <= num_sends; i++) + /* diag part */ + if (lane_id < 2) { - send_jstarts[i] = send_jstarts[i-1]; - for ( j = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i-1); - j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - j++ ) - { - send_jstarts[i] += send_i[j]; - } + j = read_only_load(d_diag_i + row + lane_id); } - hypre_assert(send_jstarts[num_sends] == num_nnz_send); - - /* finish the above communication: send_i/recv_i */ - hypre_ParCSRCommHandleDestroy(comm_handle); - - /* adjust recv_i to ptrs */ - recv_i[0] = 0; - for (i = 1; i <= num_rows_recv; i++) + if (lane_id == 0) { - recv_i[i] += recv_i[i-1]; + k = read_only_load(d_ib + row); } - num_nnz_recv = recv_i[num_rows_recv]; + istart = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, j, 0); + iend = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, j, 1); + bstart = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, k, 0); - /* allocate device memory for j and a */ - d_recv_j = hypre_TAlloc(HYPRE_BigInt, num_nnz_recv, HYPRE_MEMORY_DEVICE); - if (want_data) + p = bstart - istart; + for (i = istart + lane_id; i < iend; i += HYPRE_WARP_SIZE) { - d_recv_a = hypre_TAlloc(HYPRE_Complex, num_nnz_recv, HYPRE_MEMORY_DEVICE); + d_jb[p + i] = read_only_load(d_diag_j + i); + d_ab[p + i] = read_only_load(d_diag_a + i); } - recv_jstarts = hypre_TAlloc(HYPRE_Int, num_recvs + 1, HYPRE_MEMORY_HOST); - recv_jstarts[0] = 0; - for (i = 1; i <= num_recvs; i++) + /* offd part */ + if (lane_id < 2) { - j = hypre_ParCSRCommPkgRecvVecStart(comm_pkg, i); - recv_jstarts[i] = recv_i[j]; + j = read_only_load(d_offd_i + row + lane_id); } + bstart += iend - istart; + istart = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, j, 0); + iend = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, j, 1); - /* ready to send and recv: create a communication package for data */ - comm_pkg_j = hypre_CTAlloc(hypre_ParCSRCommPkg, 1, HYPRE_MEMORY_HOST); - hypre_ParCSRCommPkgComm (comm_pkg_j) = comm; - hypre_ParCSRCommPkgNumSends (comm_pkg_j) = num_sends; - hypre_ParCSRCommPkgSendProcs (comm_pkg_j) = hypre_ParCSRCommPkgSendProcs(comm_pkg); - hypre_ParCSRCommPkgSendMapStarts(comm_pkg_j) = send_jstarts; - hypre_ParCSRCommPkgNumRecvs (comm_pkg_j) = num_recvs; - hypre_ParCSRCommPkgRecvProcs (comm_pkg_j) = hypre_ParCSRCommPkgRecvProcs(comm_pkg); - hypre_ParCSRCommPkgRecvVecStarts(comm_pkg_j) = recv_jstarts; - - /* init communication */ - /* ja */ - comm_handle_j = hypre_ParCSRCommHandleCreate_v2(21, comm_pkg_j, - HYPRE_MEMORY_DEVICE, d_send_j, - HYPRE_MEMORY_DEVICE, d_recv_j); - if (want_data) - { - /* a */ - comm_handle_a = hypre_ParCSRCommHandleCreate_v2(1, comm_pkg_j, - HYPRE_MEMORY_DEVICE, d_send_a, - HYPRE_MEMORY_DEVICE, d_recv_a); - } - else + p = bstart - istart; + for (i = istart + lane_id; i < iend; i += HYPRE_WARP_SIZE) { - comm_handle_a = NULL; + const HYPRE_Int t = read_only_load(d_offd_j + i); + d_jb[p + i] = (cols_offd_map ? read_only_load(&cols_offd_map[t]) : t) + diag_ncol; + d_ab[p + i] = read_only_load(d_offd_a + i); } - - hypre_TMemcpy(d_recv_i, recv_i, HYPRE_Int, num_rows_recv+1, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - - /* create A_ext: on device */ - A_ext = hypre_CSRMatrixCreate(num_rows_recv, hypre_ParCSRMatrixGlobalNumCols(A), num_nnz_recv); - hypre_CSRMatrixI (A_ext) = d_recv_i; - hypre_CSRMatrixBigJ(A_ext) = d_recv_j; - hypre_CSRMatrixData(A_ext) = d_recv_a; - hypre_CSRMatrixMemoryLocation(A_ext) = HYPRE_MEMORY_DEVICE; - - /* output */ - vrequest = hypre_TAlloc(void *, 3, HYPRE_MEMORY_HOST); - vrequest[0] = (void *) comm_handle_j; - vrequest[1] = (void *) comm_handle_a; - vrequest[2] = (void *) A_ext; - - *request_ptr = (void *) vrequest; - - /* free */ - hypre_TFree(send_i, HYPRE_MEMORY_HOST); - hypre_TFree(recv_i, HYPRE_MEMORY_HOST); - hypre_TFree(d_send_i, HYPRE_MEMORY_DEVICE); - hypre_TFree(d_send_map, HYPRE_MEMORY_DEVICE); - - hypre_TFree(hypre_ParCSRCommPkgSendMapStarts(comm_pkg_j), HYPRE_MEMORY_HOST); - hypre_TFree(hypre_ParCSRCommPkgRecvVecStarts(comm_pkg_j), HYPRE_MEMORY_HOST); - hypre_TFree(comm_pkg_j, HYPRE_MEMORY_HOST); - - return hypre_error_flag; } hypre_CSRMatrix* -hypre_ParcsrGetExternalRowsDeviceWait(void *vrequest) +hypre_ConcatDiagAndOffdDevice(hypre_ParCSRMatrix *A) { - void **request = (void **) vrequest; + hypre_GpuProfilingPushRange("ConcatDiagAndOffdDevice"); - hypre_ParCSRCommHandle *comm_handle_j = (hypre_ParCSRCommHandle *) request[0]; - hypre_ParCSRCommHandle *comm_handle_a = (hypre_ParCSRCommHandle *) request[1]; - hypre_CSRMatrix *A_ext = (hypre_CSRMatrix *) request[2]; - HYPRE_BigInt *send_j = comm_handle_j ? (HYPRE_BigInt *) hypre_ParCSRCommHandleSendData(comm_handle_j) : NULL; - HYPRE_Complex *send_a = comm_handle_a ? (HYPRE_Complex *) hypre_ParCSRCommHandleSendData(comm_handle_a) : NULL; + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); - hypre_ParCSRCommHandleDestroy(comm_handle_j); - hypre_ParCSRCommHandleDestroy(comm_handle_a); + hypre_CSRMatrix *B = hypre_CSRMatrixCreate( hypre_CSRMatrixNumRows(A_diag), + hypre_CSRMatrixNumCols(A_diag) + hypre_CSRMatrixNumCols(A_offd), + hypre_CSRMatrixNumNonzeros(A_diag) + hypre_CSRMatrixNumNonzeros(A_offd) ); - hypre_TFree(send_j, HYPRE_MEMORY_DEVICE); - hypre_TFree(send_a, HYPRE_MEMORY_DEVICE); + hypre_CSRMatrixInitialize_v2(B, 0, HYPRE_MEMORY_DEVICE); - hypre_TFree(request, HYPRE_MEMORY_HOST); + hypreDevice_GetRowNnz(hypre_CSRMatrixNumRows(B), NULL, hypre_CSRMatrixI(A_diag), + hypre_CSRMatrixI(A_offd), hypre_CSRMatrixI(B)); + + hypreDevice_IntegerExclusiveScan(hypre_CSRMatrixNumRows(B) + 1, hypre_CSRMatrixI(B)); + + const dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + const dim3 gDim = hypre_GetDefaultDeviceGridDimension(hypre_CSRMatrixNumRows(A_diag), "warp", bDim); + + HYPRE_Int nrows = hypre_CSRMatrixNumRows(A_diag); + HYPRE_Int diag_ncol = hypre_CSRMatrixNumCols(A_diag); + HYPRE_Int *d_diag_i = hypre_CSRMatrixI(A_diag); + HYPRE_Int *d_diag_j = hypre_CSRMatrixJ(A_diag); + HYPRE_Complex *d_diag_a = hypre_CSRMatrixData(A_diag); + HYPRE_Int *d_offd_i = hypre_CSRMatrixI(A_offd); + HYPRE_Int *d_offd_j = hypre_CSRMatrixJ(A_offd); + HYPRE_Complex *d_offd_a = hypre_CSRMatrixData(A_offd); + HYPRE_Int *cols_offd_map = NULL; + HYPRE_Int *d_ib = hypre_CSRMatrixI(B); + HYPRE_Int *d_jb = hypre_CSRMatrixJ(B); + HYPRE_Complex *d_ab = hypre_CSRMatrixData(B); + HYPRE_GPU_LAUNCH( hypreGPUKernel_ConcatDiagAndOffd, + gDim, bDim, + nrows, + diag_ncol, + d_diag_i, + d_diag_j, + d_diag_a, + d_offd_i, + d_offd_j, + d_offd_a, + cols_offd_map, + d_ib, + d_jb, + d_ab ); + + hypre_GpuProfilingPopRange(); - return A_ext; + return B; } - +#else hypre_CSRMatrix* -hypre_MergeDiagAndOffdDevice(hypre_ParCSRMatrix *A) +hypre_ConcatDiagAndOffdDevice(hypre_ParCSRMatrix *A) { - MPI_Comm comm = hypre_ParCSRMatrixComm(A); - hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); - HYPRE_Complex *A_diag_a = hypre_CSRMatrixData(A_diag); - HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); - HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); - hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); - HYPRE_Complex *A_offd_a = hypre_CSRMatrixData(A_offd); - HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); - HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); - - HYPRE_Int local_num_rows = hypre_CSRMatrixNumRows(A_diag); - HYPRE_BigInt glbal_num_cols = hypre_ParCSRMatrixGlobalNumCols(A); - HYPRE_BigInt first_col = hypre_ParCSRMatrixFirstColDiag(A); - HYPRE_Int num_cols_A_offd = hypre_CSRMatrixNumCols(A_offd); - HYPRE_BigInt *col_map_offd_A = hypre_ParCSRMatrixColMapOffd(A); - HYPRE_BigInt *d_col_map_offd_A = hypre_ParCSRMatrixDeviceColMapOffd(A); + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); + HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); + HYPRE_Complex *A_diag_a = hypre_CSRMatrixData(A_diag); + HYPRE_Int A_diag_nnz = hypre_CSRMatrixNumNonzeros(A_diag); + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); + HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); + HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); + HYPRE_Complex *A_offd_a = hypre_CSRMatrixData(A_offd); + HYPRE_Int A_offd_nnz = hypre_CSRMatrixNumNonzeros(A_offd); hypre_CSRMatrix *B; - HYPRE_Int B_nrows = local_num_rows; - HYPRE_BigInt B_ncols = glbal_num_cols; - HYPRE_Int *B_i = hypre_TAlloc(HYPRE_Int, B_nrows + 1, HYPRE_MEMORY_DEVICE); - HYPRE_BigInt *B_j; - HYPRE_Complex *B_a; - HYPRE_Int B_nnz; - - HYPRE_Int num_procs; - - hypre_MPI_Comm_size(comm, &num_procs); + HYPRE_Int B_nrows = hypre_CSRMatrixNumRows(A_diag); + HYPRE_Int B_ncols = hypre_CSRMatrixNumCols(A_diag) + hypre_CSRMatrixNumCols(A_offd); + HYPRE_Int B_nnz = A_diag_nnz + A_offd_nnz; + HYPRE_Int *B_ii = hypre_TAlloc(HYPRE_Int, B_nnz, HYPRE_MEMORY_DEVICE); + HYPRE_Int *B_j = hypre_TAlloc(HYPRE_Int, B_nnz, HYPRE_MEMORY_DEVICE); + HYPRE_Complex *B_a = hypre_TAlloc(HYPRE_Complex, B_nnz, HYPRE_MEMORY_DEVICE); - hypre_Memset(B_i, 0, sizeof(HYPRE_Int), HYPRE_MEMORY_DEVICE); + // Adiag + HYPRE_Int *A_diag_ii = hypreDevice_CsrRowPtrsToIndices(B_nrows, A_diag_nnz, A_diag_i); + HYPRE_THRUST_CALL( copy_n, + thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, A_diag_j, A_diag_a)), + A_diag_nnz, + thrust::make_zip_iterator(thrust::make_tuple(B_ii, B_j, B_a)) ); + hypre_TFree(A_diag_ii, HYPRE_MEMORY_DEVICE); - hypreDevice_GetRowNnz(B_nrows, NULL, A_diag_i, A_offd_i, B_i+1); + // Aoffd + HYPRE_Int *A_offd_ii = hypreDevice_CsrRowPtrsToIndices(B_nrows, A_offd_nnz, A_offd_i); + HYPRE_THRUST_CALL( copy_n, + thrust::make_zip_iterator(thrust::make_tuple(A_offd_ii, A_offd_a)), + A_offd_nnz, + thrust::make_zip_iterator(thrust::make_tuple(B_ii, B_a)) + A_diag_nnz ); + hypre_TFree(A_offd_ii, HYPRE_MEMORY_DEVICE); - hypreDevice_IntegerInclusiveScan(B_nrows+1, B_i); + HYPRE_THRUST_CALL( transform, + A_offd_j, + A_offd_j + A_offd_nnz, + thrust::make_constant_iterator(hypre_CSRMatrixNumCols(A_diag)), + B_j + A_diag_nnz, + thrust::plus() ); - /* total number of nnz */ - hypre_TMemcpy(&B_nnz, B_i+B_nrows, HYPRE_Int, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); + // B + HYPRE_THRUST_CALL( stable_sort_by_key, + B_ii, + B_ii + B_nnz, + thrust::make_zip_iterator(thrust::make_tuple(B_j, B_a)) ); - B_j = hypre_TAlloc(HYPRE_BigInt, B_nnz, HYPRE_MEMORY_DEVICE); - B_a = hypre_TAlloc(HYPRE_Complex, B_nnz, HYPRE_MEMORY_DEVICE); + HYPRE_Int *B_i = hypreDevice_CsrRowIndicesToPtrs(B_nrows, B_nnz, B_ii); + hypre_TFree(B_ii, HYPRE_MEMORY_DEVICE); - if (d_col_map_offd_A == NULL) - { - d_col_map_offd_A = hypre_TAlloc(HYPRE_BigInt, num_cols_A_offd, HYPRE_MEMORY_DEVICE); - hypre_TMemcpy(d_col_map_offd_A, col_map_offd_A, HYPRE_BigInt, num_cols_A_offd, - HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - hypre_ParCSRMatrixDeviceColMapOffd(A) = d_col_map_offd_A; - } + B = hypre_CSRMatrixCreate(B_nrows, B_ncols, B_nnz); + hypre_CSRMatrixI(B) = B_i; + hypre_CSRMatrixJ(B) = B_j; + hypre_CSRMatrixData(B) = B_a; + hypre_CSRMatrixMemoryLocation(B) = HYPRE_MEMORY_DEVICE; - hypreDevice_CopyParCSRRows(B_nrows, NULL, 2, num_procs > 1, first_col, d_col_map_offd_A, - A_diag_i, A_diag_j, A_diag_a, A_offd_i, A_offd_j, A_offd_a, - B_i, B_j, B_a); + return B; +} +#endif - /* output */ - B = hypre_CSRMatrixCreate(B_nrows, B_ncols, B_nnz); - hypre_CSRMatrixI (B) = B_i; - hypre_CSRMatrixBigJ(B) = B_j; +/* return B = [Adiag, Aoffd; E] */ +#if 1 +HYPRE_Int +hypre_ConcatDiagOffdAndExtDevice(hypre_ParCSRMatrix *A, + hypre_CSRMatrix *E, + hypre_CSRMatrix **B_ptr, + HYPRE_Int *num_cols_offd_ptr, + HYPRE_BigInt **cols_map_offd_ptr) +{ + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); + hypre_CSRMatrix *E_diag, *E_offd, *B; + HYPRE_Int *cols_offd_map, num_cols_offd; + HYPRE_BigInt *cols_map_offd; + + hypre_CSRMatrixSplitDevice(E, hypre_ParCSRMatrixFirstColDiag(A), hypre_ParCSRMatrixLastColDiag(A), + hypre_CSRMatrixNumCols(A_offd), hypre_ParCSRMatrixDeviceColMapOffd(A), + &cols_offd_map, &num_cols_offd, &cols_map_offd, &E_diag, &E_offd); + + B = hypre_CSRMatrixCreate(hypre_ParCSRMatrixNumRows(A) + hypre_CSRMatrixNumRows(E), + hypre_ParCSRMatrixNumCols(A) + num_cols_offd, + hypre_CSRMatrixNumNonzeros(A_diag) + hypre_CSRMatrixNumNonzeros(A_offd) + + hypre_CSRMatrixNumNonzeros(E)); + + hypre_CSRMatrixInitialize_v2(B, 0, HYPRE_MEMORY_DEVICE); + + hypreDevice_GetRowNnz(hypre_ParCSRMatrixNumRows(A), NULL, hypre_CSRMatrixI(A_diag), + hypre_CSRMatrixI(A_offd), hypre_CSRMatrixI(B)); + hypreDevice_IntegerExclusiveScan(hypre_ParCSRMatrixNumRows(A) + 1, hypre_CSRMatrixI(B)); + + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(hypre_ParCSRMatrixNumRows(A), "warp", bDim); + + HYPRE_Int nrows = hypre_CSRMatrixNumRows(A_diag); + HYPRE_Int diag_ncol = hypre_CSRMatrixNumCols(A_diag); + HYPRE_Int *d_diag_i = hypre_CSRMatrixI(A_diag); + HYPRE_Int *d_diag_j = hypre_CSRMatrixJ(A_diag); + HYPRE_Complex *d_diag_a = hypre_CSRMatrixData(A_diag); + HYPRE_Int *d_offd_i = hypre_CSRMatrixI(A_offd); + HYPRE_Int *d_offd_j = hypre_CSRMatrixJ(A_offd); + HYPRE_Complex *d_offd_a = hypre_CSRMatrixData(A_offd); + HYPRE_Int *d_ib = hypre_CSRMatrixI(B); + HYPRE_Int *d_jb = hypre_CSRMatrixJ(B); + HYPRE_Complex *d_ab = hypre_CSRMatrixData(B); + HYPRE_GPU_LAUNCH( hypreGPUKernel_ConcatDiagAndOffd, + gDim, bDim, + nrows, + diag_ncol, + d_diag_i, + d_diag_j, + d_diag_a, + d_offd_i, + d_offd_j, + d_offd_a, + cols_offd_map, + d_ib, + d_jb, + d_ab ); + + hypre_TFree(cols_offd_map, HYPRE_MEMORY_DEVICE); + + hypre_TMemcpy(hypre_CSRMatrixI(B) + hypre_ParCSRMatrixNumRows(A) + 1, hypre_CSRMatrixI(E) + 1, + HYPRE_Int, hypre_CSRMatrixNumRows(E), + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); +#ifdef HYPRE_USING_SYCL + HYPRE_ONEDPL_CALL( std::transform, + hypre_CSRMatrixI(B) + hypre_ParCSRMatrixNumRows(A) + 1, + hypre_CSRMatrixI(B) + hypre_ParCSRMatrixNumRows(A) + hypre_CSRMatrixNumRows(E) + 1, + hypre_CSRMatrixI(B) + hypre_ParCSRMatrixNumRows(A) + 1, + [const_val = hypre_CSRMatrixNumNonzeros(A_diag) + hypre_CSRMatrixNumNonzeros(A_offd)] ( + const auto & x) {return x + const_val;} ); +#else + HYPRE_THRUST_CALL( transform, + hypre_CSRMatrixI(B) + hypre_ParCSRMatrixNumRows(A) + 1, + hypre_CSRMatrixI(B) + hypre_ParCSRMatrixNumRows(A) + hypre_CSRMatrixNumRows(E) + 1, + thrust::make_constant_iterator(hypre_CSRMatrixNumNonzeros(A_diag) + hypre_CSRMatrixNumNonzeros( + A_offd)), + hypre_CSRMatrixI(B) + hypre_ParCSRMatrixNumRows(A) + 1, + thrust::plus() ); +#endif + + gDim = hypre_GetDefaultDeviceGridDimension(hypre_CSRMatrixNumRows(E), "warp", bDim); + + hypre_assert(hypre_CSRMatrixNumCols(E_diag) == hypre_CSRMatrixNumCols(A_diag)); + + nrows = hypre_CSRMatrixNumRows(E_diag); + diag_ncol = hypre_CSRMatrixNumCols(E_diag); + d_diag_i = hypre_CSRMatrixI(E_diag); + d_diag_j = hypre_CSRMatrixJ(E_diag); + d_diag_a = hypre_CSRMatrixData(E_diag); + d_offd_i = hypre_CSRMatrixI(E_offd); + d_offd_j = hypre_CSRMatrixJ(E_offd); + d_offd_a = hypre_CSRMatrixData(E_offd); + cols_offd_map = NULL; + d_ib = hypre_CSRMatrixI(B) + hypre_ParCSRMatrixNumRows(A); + d_jb = hypre_CSRMatrixJ(B); + d_ab = hypre_CSRMatrixData(B); + HYPRE_GPU_LAUNCH( hypreGPUKernel_ConcatDiagAndOffd, + gDim, bDim, + nrows, + diag_ncol, + d_diag_i, + d_diag_j, + d_diag_a, + d_offd_i, + d_offd_j, + d_offd_a, + cols_offd_map, + d_ib, + d_jb, + d_ab ); + + hypre_CSRMatrixDestroy(E_diag); + hypre_CSRMatrixDestroy(E_offd); + + *B_ptr = B; + *num_cols_offd_ptr = num_cols_offd; + *cols_map_offd_ptr = cols_map_offd; + + return hypre_error_flag; +} +#else +HYPRE_Int +hypre_ConcatDiagOffdAndExtDevice(hypre_ParCSRMatrix *A, + hypre_CSRMatrix *E, + hypre_CSRMatrix **B_ptr, + HYPRE_Int *num_cols_offd_ptr, + HYPRE_BigInt **cols_map_offd_ptr) +{ + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + HYPRE_Int A_nrows = hypre_CSRMatrixNumRows(A_diag); + HYPRE_Int A_ncols = hypre_CSRMatrixNumCols(A_diag); + HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); + HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); + HYPRE_Complex *A_diag_a = hypre_CSRMatrixData(A_diag); + HYPRE_Int A_diag_nnz = hypre_CSRMatrixNumNonzeros(A_diag); + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); + HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); + HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); + HYPRE_Complex *A_offd_a = hypre_CSRMatrixData(A_offd); + HYPRE_Int A_offd_nnz = hypre_CSRMatrixNumNonzeros(A_offd); + HYPRE_BigInt first_col_A = hypre_ParCSRMatrixFirstColDiag(A); + HYPRE_BigInt last_col_A = hypre_ParCSRMatrixLastColDiag(A); + HYPRE_Int num_cols_offd_A = hypre_CSRMatrixNumCols(A_offd); + HYPRE_BigInt *col_map_offd_A = hypre_ParCSRMatrixDeviceColMapOffd(A); + + HYPRE_Int *E_i = hypre_CSRMatrixI(E); + HYPRE_BigInt *E_bigj = hypre_CSRMatrixBigJ(E); + HYPRE_Complex *E_a = hypre_CSRMatrixData(E); + HYPRE_Int E_nrows = hypre_CSRMatrixNumRows(E); + HYPRE_Int E_nnz = hypre_CSRMatrixNumNonzeros(E); + HYPRE_Int E_diag_nnz, E_offd_nnz; + + hypre_CSRMatrix *B; + HYPRE_Int B_nnz = A_diag_nnz + A_offd_nnz + E_nnz; + HYPRE_Int *B_ii = hypre_TAlloc(HYPRE_Int, B_nnz, HYPRE_MEMORY_DEVICE); + HYPRE_Int *B_j = hypre_TAlloc(HYPRE_Int, B_nnz, HYPRE_MEMORY_DEVICE); + HYPRE_Complex *B_a = hypre_TAlloc(HYPRE_Complex, B_nnz, HYPRE_MEMORY_DEVICE); + + // E + hypre_CSRMatrixSplitDevice_core(0, E_nrows, E_nnz, NULL, E_bigj, NULL, NULL, first_col_A, + last_col_A, num_cols_offd_A, + NULL, NULL, NULL, NULL, &E_diag_nnz, NULL, NULL, NULL, NULL, &E_offd_nnz, + NULL, NULL, NULL, NULL); + + HYPRE_Int *cols_offd_map, num_cols_offd; + HYPRE_BigInt *cols_map_offd; + HYPRE_Int *E_ii = hypreDevice_CsrRowPtrsToIndices(E_nrows, E_nnz, E_i); + + hypre_CSRMatrixSplitDevice_core(1, + E_nrows, E_nnz, E_ii, E_bigj, E_a, NULL, + first_col_A, last_col_A, num_cols_offd_A, col_map_offd_A, + &cols_offd_map, &num_cols_offd, &cols_map_offd, + &E_diag_nnz, + B_ii + A_diag_nnz + A_offd_nnz, + B_j + A_diag_nnz + A_offd_nnz, + B_a + A_diag_nnz + A_offd_nnz, + NULL, + &E_offd_nnz, + B_ii + A_diag_nnz + A_offd_nnz + E_diag_nnz, + B_j + A_diag_nnz + A_offd_nnz + E_diag_nnz, + B_a + A_diag_nnz + A_offd_nnz + E_diag_nnz, + NULL); + hypre_TFree(E_ii, HYPRE_MEMORY_DEVICE); + + HYPRE_THRUST_CALL( transform, + B_ii + A_diag_nnz + A_offd_nnz, + B_ii + B_nnz, + thrust::make_constant_iterator(A_nrows), + B_ii + A_diag_nnz + A_offd_nnz, + thrust::plus() ); + + // Adiag + HYPRE_Int *A_diag_ii = hypreDevice_CsrRowPtrsToIndices(A_nrows, A_diag_nnz, A_diag_i); + HYPRE_THRUST_CALL( copy_n, + thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, A_diag_j, A_diag_a)), + A_diag_nnz, + thrust::make_zip_iterator(thrust::make_tuple(B_ii, B_j, B_a)) ); + hypre_TFree(A_diag_ii, HYPRE_MEMORY_DEVICE); + + // Aoffd + HYPRE_Int *A_offd_ii = hypreDevice_CsrRowPtrsToIndices(A_nrows, A_offd_nnz, A_offd_i); + HYPRE_THRUST_CALL( copy_n, + thrust::make_zip_iterator(thrust::make_tuple(A_offd_ii, A_offd_a)), + A_offd_nnz, + thrust::make_zip_iterator(thrust::make_tuple(B_ii, B_a)) + A_diag_nnz ); + hypre_TFree(A_offd_ii, HYPRE_MEMORY_DEVICE); + + HYPRE_THRUST_CALL( gather, + A_offd_j, + A_offd_j + A_offd_nnz, + cols_offd_map, + B_j + A_diag_nnz); + + hypre_TFree(cols_offd_map, HYPRE_MEMORY_DEVICE); + + HYPRE_THRUST_CALL( transform, + B_j + A_diag_nnz, + B_j + A_diag_nnz + A_offd_nnz, + thrust::make_constant_iterator(A_ncols), + B_j + A_diag_nnz, + thrust::plus() ); + + HYPRE_THRUST_CALL( transform, + B_j + A_diag_nnz + A_offd_nnz + E_diag_nnz, + B_j + B_nnz, + thrust::make_constant_iterator(A_ncols), + B_j + A_diag_nnz + A_offd_nnz + E_diag_nnz, + thrust::plus() ); + + // B + HYPRE_THRUST_CALL( stable_sort_by_key, + B_ii, + B_ii + B_nnz, + thrust::make_zip_iterator(thrust::make_tuple(B_j, B_a)) ); + + HYPRE_Int *B_i = hypreDevice_CsrRowIndicesToPtrs(A_nrows + E_nrows, B_nnz, B_ii); + hypre_TFree(B_ii, HYPRE_MEMORY_DEVICE); + + B = hypre_CSRMatrixCreate(A_nrows + E_nrows, A_ncols + num_cols_offd, B_nnz); + hypre_CSRMatrixI(B) = B_i; + hypre_CSRMatrixJ(B) = B_j; hypre_CSRMatrixData(B) = B_a; hypre_CSRMatrixMemoryLocation(B) = HYPRE_MEMORY_DEVICE; - hypre_SyncCudaComputeStream(hypre_handle()); + *B_ptr = B; + *num_cols_offd_ptr = num_cols_offd; + *cols_map_offd_ptr = cols_map_offd; - return B; + return hypre_error_flag; } +#endif +/* The input B_ext is a BigJ matrix, so is the output */ +/* RL: TODO FIX the num of columns of the output (from B_ext 'big' num cols) */ HYPRE_Int hypre_ExchangeExternalRowsDeviceInit( hypre_CSRMatrix *B_ext, hypre_ParCSRCommPkg *comm_pkg_A, @@ -346,7 +484,7 @@ hypre_ExchangeExternalRowsDeviceInit( hypre_CSRMatrix *B_ext, HYPRE_Int B_int_nnz; hypre_ParCSRCommHandle *comm_handle, *comm_handle_j, *comm_handle_a; - hypre_ParCSRCommPkg *comm_pkg_j; + hypre_ParCSRCommPkg *comm_pkg_j = NULL; HYPRE_Int *jdata_recv_vec_starts; HYPRE_Int *jdata_send_map_starts; @@ -358,13 +496,17 @@ hypre_ExchangeExternalRowsDeviceInit( hypre_CSRMatrix *B_ext, hypre_MPI_Comm_size(comm, &num_procs); hypre_MPI_Comm_rank(comm, &my_id); - jdata_send_map_starts = hypre_TAlloc(HYPRE_Int, num_sends+1, HYPRE_MEMORY_HOST); + jdata_send_map_starts = hypre_TAlloc(HYPRE_Int, num_sends + 1, HYPRE_MEMORY_HOST); /*-------------------------------------------------------------------------- * B_ext_rownnz contains the number of elements of row j * (to be determined through send_map_elmnts on the receiving end) *--------------------------------------------------------------------------*/ +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL(std::adjacent_difference, B_ext_i_d, B_ext_i_d + B_ext_nrows + 1, B_ext_rownnz_d); +#else HYPRE_THRUST_CALL(adjacent_difference, B_ext_i_d, B_ext_i_d + B_ext_nrows + 1, B_ext_rownnz_d); +#endif hypre_TMemcpy(B_ext_rownnz_h, B_ext_rownnz_d + 1, HYPRE_Int, B_ext_nrows, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); @@ -378,10 +520,11 @@ hypre_ExchangeExternalRowsDeviceInit( hypre_CSRMatrix *B_ext, jdata_recv_vec_starts[0] = 0; B_ext_i_h[0] = 0; - hypre_TMemcpy(B_ext_i_h + 1, B_ext_rownnz_h, HYPRE_Int, B_ext_nrows, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + hypre_TMemcpy(B_ext_i_h + 1, B_ext_rownnz_h, HYPRE_Int, B_ext_nrows, HYPRE_MEMORY_HOST, + HYPRE_MEMORY_HOST); for (i = 1; i <= B_ext_nrows; i++) { - B_ext_i_h[i] += B_ext_i_h[i-1]; + B_ext_i_h[i] += B_ext_i_h[i - 1]; } hypre_assert(B_ext_i_h[B_ext_nrows] == B_ext_nnz); @@ -391,12 +534,12 @@ hypre_ExchangeExternalRowsDeviceInit( hypre_CSRMatrix *B_ext, jdata_recv_vec_starts[i] = B_ext_i_h[recv_vec_starts[i]]; } - comm_pkg_j = hypre_CTAlloc(hypre_ParCSRCommPkg, 1, HYPRE_MEMORY_HOST); - hypre_ParCSRCommPkgComm(comm_pkg_j) = comm; - hypre_ParCSRCommPkgNumSends(comm_pkg_j) = num_recvs; - hypre_ParCSRCommPkgNumRecvs(comm_pkg_j) = num_sends; - hypre_ParCSRCommPkgSendProcs(comm_pkg_j) = recv_procs; - hypre_ParCSRCommPkgRecvProcs(comm_pkg_j) = send_procs; + /* Create the communication package - note the order of send/recv is reversed */ + hypre_ParCSRCommPkgCreateAndFill(comm, + num_sends, send_procs, jdata_send_map_starts, + num_recvs, recv_procs, jdata_recv_vec_starts, + NULL, + &comm_pkg_j); hypre_ParCSRCommHandleDestroy(comm_handle); @@ -406,12 +549,12 @@ hypre_ExchangeExternalRowsDeviceInit( hypre_CSRMatrix *B_ext, B_int_i_h[0] = 0; for (i = 1; i <= B_int_nrows; i++) { - B_int_i_h[i] += B_int_i_h[i-1]; + B_int_i_h[i] += B_int_i_h[i - 1]; } B_int_nnz = B_int_i_h[B_int_nrows]; - B_int_j_d = hypre_TAlloc(HYPRE_BigInt, B_int_nnz, HYPRE_MEMORY_DEVICE); + B_int_j_d = hypre_TAlloc(HYPRE_BigInt, B_int_nnz, HYPRE_MEMORY_DEVICE); if (want_data) { B_int_a_d = hypre_TAlloc(HYPRE_Complex, B_int_nnz, HYPRE_MEMORY_DEVICE); @@ -422,10 +565,7 @@ hypre_ExchangeExternalRowsDeviceInit( hypre_CSRMatrix *B_ext, jdata_send_map_starts[i] = B_int_i_h[send_map_starts[i]]; } - /* note the order of send/recv is reversed */ - hypre_ParCSRCommPkgRecvVecStarts(comm_pkg_j) = jdata_send_map_starts; - hypre_ParCSRCommPkgSendMapStarts(comm_pkg_j) = jdata_recv_vec_starts; - + /* RL: assume B_ext_a_d and B_ext_j_d are ready at input */ /* send/recv CSR rows */ if (want_data) { @@ -442,7 +582,8 @@ hypre_ExchangeExternalRowsDeviceInit( hypre_CSRMatrix *B_ext, HYPRE_MEMORY_DEVICE, B_ext_j_d, HYPRE_MEMORY_DEVICE, B_int_j_d ); - hypre_TMemcpy(B_int_i_d, B_int_i_h, HYPRE_Int, B_int_nrows+1, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); + hypre_TMemcpy(B_int_i_d, B_int_i_h, HYPRE_Int, B_int_nrows + 1, HYPRE_MEMORY_DEVICE, + HYPRE_MEMORY_HOST); /* create CSR: on device */ B_int_d = hypre_CSRMatrixCreate(B_int_nrows, B_int_ncols, B_int_nnz); @@ -490,11 +631,6 @@ hypre_ExchangeExternalRowsDeviceWait(void *vrequest) return B_int_d; } - -/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ - HYPRE_Int hypre_ParCSRMatrixExtractBExtDeviceInit( hypre_ParCSRMatrix *B, hypre_ParCSRMatrix *A, @@ -540,497 +676,367 @@ hypre_ParCSRMatrixExtractBExtDevice( hypre_ParCSRMatrix *B, return hypre_ParCSRMatrixExtractBExtDeviceWait(request); } -/* return B = [Adiag, Aoffd] */ -#if 1 -__global__ void -hypreCUDAKernel_ConcatDiagAndOffd(HYPRE_Int nrows, HYPRE_Int diag_ncol, - HYPRE_Int *d_diag_i, HYPRE_Int *d_diag_j, HYPRE_Complex *d_diag_a, - HYPRE_Int *d_offd_i, HYPRE_Int *d_offd_j, HYPRE_Complex *d_offd_a, - HYPRE_Int *cols_offd_map, - HYPRE_Int *d_ib, HYPRE_Int *d_jb, HYPRE_Complex *d_ab) +HYPRE_Int +hypre_ParcsrGetExternalRowsDeviceInit( hypre_ParCSRMatrix *A, + HYPRE_Int indices_len, + HYPRE_BigInt *indices, + hypre_ParCSRCommPkg *comm_pkg, + HYPRE_Int want_data, + void **request_ptr) { - const HYPRE_Int row = hypre_cuda_get_grid_warp_id<1,1>(); + HYPRE_UNUSED_VAR(indices); + HYPRE_UNUSED_VAR(indices_len); - if (row >= nrows) - { - return; - } - - /* lane id inside the warp */ - const HYPRE_Int lane_id = hypre_cuda_get_lane_id<1>(); - HYPRE_Int i, j, k, p, istart, iend, bstart; - - /* diag part */ - if (lane_id < 2) - { - j = read_only_load(d_diag_i + row + lane_id); - } - if (lane_id == 0) - { - k = read_only_load(d_ib + row); - } - istart = __shfl_sync(HYPRE_WARP_FULL_MASK, j, 0); - iend = __shfl_sync(HYPRE_WARP_FULL_MASK, j, 1); - bstart = __shfl_sync(HYPRE_WARP_FULL_MASK, k, 0); - - p = bstart - istart; - for (i = istart + lane_id; i < iend; i += HYPRE_WARP_SIZE) - { - d_jb[p+i] = read_only_load(d_diag_j + i); - d_ab[p+i] = read_only_load(d_diag_a + i); - } - - /* offd part */ - if (lane_id < 2) - { - j = read_only_load(d_offd_i + row + lane_id); - } - bstart += iend - istart; - istart = __shfl_sync(HYPRE_WARP_FULL_MASK, j, 0); - iend = __shfl_sync(HYPRE_WARP_FULL_MASK, j, 1); - - p = bstart - istart; - for (i = istart + lane_id; i < iend; i += HYPRE_WARP_SIZE) - { - const HYPRE_Int t = read_only_load(d_offd_j + i); - d_jb[p+i] = (cols_offd_map ? read_only_load(&cols_offd_map[t]) : t) + diag_ncol; - d_ab[p+i] = read_only_load(d_offd_a + i); - } -} - -hypre_CSRMatrix* -hypre_ConcatDiagAndOffdDevice(hypre_ParCSRMatrix *A) -{ - hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); - hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); - - hypre_CSRMatrix *B = hypre_CSRMatrixCreate( hypre_CSRMatrixNumRows(A_diag), - hypre_CSRMatrixNumCols(A_diag) + hypre_CSRMatrixNumCols(A_offd), - hypre_CSRMatrixNumNonzeros(A_diag) + hypre_CSRMatrixNumNonzeros(A_offd) ); - - hypre_CSRMatrixInitialize_v2(B, 0, HYPRE_MEMORY_DEVICE); - - hypreDevice_GetRowNnz(hypre_CSRMatrixNumRows(B), NULL, hypre_CSRMatrixI(A_diag), hypre_CSRMatrixI(A_offd), hypre_CSRMatrixI(B)); - - HYPRE_THRUST_CALL( exclusive_scan, - hypre_CSRMatrixI(B), - hypre_CSRMatrixI(B) + hypre_CSRMatrixNumRows(B) + 1, - hypre_CSRMatrixI(B) ); - - const dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - const dim3 gDim = hypre_GetDefaultCUDAGridDimension(hypre_CSRMatrixNumRows(A_diag), "warp", bDim); - - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_ConcatDiagAndOffd, - gDim, bDim, - hypre_CSRMatrixNumRows(A_diag), - hypre_CSRMatrixNumCols(A_diag), - hypre_CSRMatrixI(A_diag), - hypre_CSRMatrixJ(A_diag), - hypre_CSRMatrixData(A_diag), - hypre_CSRMatrixI(A_offd), - hypre_CSRMatrixJ(A_offd), - hypre_CSRMatrixData(A_offd), - NULL, - hypre_CSRMatrixI(B), - hypre_CSRMatrixJ(B), - hypre_CSRMatrixData(B) ); - - return B; -} -#else -hypre_CSRMatrix* -hypre_ConcatDiagAndOffdDevice(hypre_ParCSRMatrix *A) -{ - hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); - HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); - HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); - HYPRE_Complex *A_diag_a = hypre_CSRMatrixData(A_diag); - HYPRE_Int A_diag_nnz = hypre_CSRMatrixNumNonzeros(A_diag); - hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); - HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); - HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); - HYPRE_Complex *A_offd_a = hypre_CSRMatrixData(A_offd); - HYPRE_Int A_offd_nnz = hypre_CSRMatrixNumNonzeros(A_offd); - - hypre_CSRMatrix *B; - HYPRE_Int B_nrows = hypre_CSRMatrixNumRows(A_diag); - HYPRE_Int B_ncols = hypre_CSRMatrixNumCols(A_diag) + hypre_CSRMatrixNumCols(A_offd); - HYPRE_Int B_nnz = A_diag_nnz + A_offd_nnz; - HYPRE_Int *B_ii = hypre_TAlloc(HYPRE_Int, B_nnz, HYPRE_MEMORY_DEVICE); - HYPRE_Int *B_j = hypre_TAlloc(HYPRE_Int, B_nnz, HYPRE_MEMORY_DEVICE); - HYPRE_Complex *B_a = hypre_TAlloc(HYPRE_Complex, B_nnz, HYPRE_MEMORY_DEVICE); + HYPRE_Int i, j; + HYPRE_Int num_sends, num_rows_send, num_nnz_send, num_recvs, num_rows_recv, num_nnz_recv; + HYPRE_Int *d_send_i, *send_i, *d_send_map, *d_recv_i, *recv_i; + HYPRE_BigInt *d_send_j, *d_recv_j; + HYPRE_Int *send_jstarts, *recv_jstarts; + HYPRE_Complex *d_send_a = NULL, *d_recv_a = NULL; + hypre_ParCSRCommPkg *comm_pkg_j = NULL; + hypre_ParCSRCommHandle *comm_handle, *comm_handle_j, *comm_handle_a; + /* HYPRE_Int global_num_rows = hypre_ParCSRMatrixGlobalNumRows(A); */ + /* diag part of A */ + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + HYPRE_Complex *A_diag_a = hypre_CSRMatrixData(A_diag); + HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); + HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); + /* HYPRE_Int local_num_rows = hypre_CSRMatrixNumRows(A_diag); */ + /* off-diag part of A */ + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); + HYPRE_Complex *A_offd_a = hypre_CSRMatrixData(A_offd); + HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); + HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); - // Adiag - HYPRE_Int *A_diag_ii = hypreDevice_CsrRowPtrsToIndices(B_nrows, A_diag_nnz, A_diag_i); - HYPRE_THRUST_CALL( copy_n, - thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, A_diag_j, A_diag_a)), - A_diag_nnz, - thrust::make_zip_iterator(thrust::make_tuple(B_ii, B_j, B_a)) ); - hypre_TFree(A_diag_ii, HYPRE_MEMORY_DEVICE); + /* HYPRE_Int *row_starts = hypre_ParCSRMatrixRowStarts(A); */ + /* HYPRE_Int first_row = hypre_ParCSRMatrixFirstRowIndex(A); */ + HYPRE_BigInt first_col = hypre_ParCSRMatrixFirstColDiag(A); + HYPRE_BigInt *col_map_offd_A = hypre_ParCSRMatrixColMapOffd(A); + HYPRE_Int num_cols_A_offd = hypre_CSRMatrixNumCols(A_offd); + HYPRE_BigInt *d_col_map_offd_A = hypre_ParCSRMatrixDeviceColMapOffd(A); - // Aoffd - HYPRE_Int *A_offd_ii = hypreDevice_CsrRowPtrsToIndices(B_nrows, A_offd_nnz, A_offd_i); - HYPRE_THRUST_CALL( copy_n, - thrust::make_zip_iterator(thrust::make_tuple(A_offd_ii, A_offd_a)), - A_offd_nnz, - thrust::make_zip_iterator(thrust::make_tuple(B_ii, B_a)) + A_diag_nnz ); - hypre_TFree(A_offd_ii, HYPRE_MEMORY_DEVICE); + MPI_Comm comm = hypre_ParCSRMatrixComm(A); - HYPRE_THRUST_CALL( transform, - A_offd_j, - A_offd_j + A_offd_nnz, - thrust::make_constant_iterator(hypre_CSRMatrixNumCols(A_diag)), - B_j + A_diag_nnz, - thrust::plus() ); + HYPRE_Int num_procs; + HYPRE_Int my_id; + void **vrequest; - // B - HYPRE_THRUST_CALL( stable_sort_by_key, - B_ii, - B_ii + B_nnz, - thrust::make_zip_iterator(thrust::make_tuple(B_j, B_a)) ); + hypre_CSRMatrix *A_ext; - HYPRE_Int *B_i = hypreDevice_CsrRowIndicesToPtrs(B_nrows, B_nnz, B_ii); - hypre_TFree(B_ii, HYPRE_MEMORY_DEVICE); + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &my_id); - B = hypre_CSRMatrixCreate(B_nrows, B_ncols, B_nnz); - hypre_CSRMatrixI(B) = B_i; - hypre_CSRMatrixJ(B) = B_j; - hypre_CSRMatrixData(B) = B_a; - hypre_CSRMatrixMemoryLocation(B) = HYPRE_MEMORY_DEVICE; + /* number of sends (#procs) */ + num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); + /* number of rows to send */ + num_rows_send = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends); + /* number of recvs (#procs) */ + num_recvs = hypre_ParCSRCommPkgNumRecvs(comm_pkg); + /* number of rows to recv */ + num_rows_recv = hypre_ParCSRCommPkgRecvVecStart(comm_pkg, num_recvs); - return B; -} -#endif + /* must be true if indices contains proper offd indices */ + hypre_assert(indices_len == num_rows_recv); -/* return B = [Adiag, Aoffd; E] */ -#if 1 -HYPRE_Int -hypre_ConcatDiagOffdAndExtDevice(hypre_ParCSRMatrix *A, - hypre_CSRMatrix *E, - hypre_CSRMatrix **B_ptr, - HYPRE_Int *num_cols_offd_ptr, - HYPRE_BigInt **cols_map_offd_ptr) -{ - hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); - hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); - hypre_CSRMatrix *E_diag, *E_offd, *B; - HYPRE_Int *cols_offd_map, num_cols_offd; - HYPRE_BigInt *cols_map_offd; + /* send_i/recv_i: + * the arrays to send and recv: we first send and recv the row lengths */ + d_send_i = hypre_TAlloc(HYPRE_Int, num_rows_send + 1, HYPRE_MEMORY_DEVICE); + d_send_map = hypre_TAlloc(HYPRE_Int, num_rows_send, HYPRE_MEMORY_DEVICE); + send_i = hypre_TAlloc(HYPRE_Int, num_rows_send, HYPRE_MEMORY_HOST); + recv_i = hypre_TAlloc(HYPRE_Int, num_rows_recv + 1, HYPRE_MEMORY_HOST); + d_recv_i = hypre_TAlloc(HYPRE_Int, num_rows_recv + 1, HYPRE_MEMORY_DEVICE); - hypre_CSRMatrixSplitDevice(E, hypre_ParCSRMatrixFirstColDiag(A), hypre_ParCSRMatrixLastColDiag(A), - hypre_CSRMatrixNumCols(A_offd), hypre_ParCSRMatrixDeviceColMapOffd(A), - &cols_offd_map, &num_cols_offd, &cols_map_offd, &E_diag, &E_offd); + /* fill the send array with row lengths */ + hypre_TMemcpy(d_send_map, hypre_ParCSRCommPkgSendMapElmts(comm_pkg), HYPRE_Int, + num_rows_send, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - B = hypre_CSRMatrixCreate(hypre_ParCSRMatrixNumRows(A) + hypre_CSRMatrixNumRows(E), - hypre_ParCSRMatrixNumCols(A) + num_cols_offd, - hypre_CSRMatrixNumNonzeros(A_diag) + hypre_CSRMatrixNumNonzeros(A_offd) + hypre_CSRMatrixNumNonzeros(E)); - hypre_CSRMatrixInitialize_v2(B, 0, HYPRE_MEMORY_DEVICE); + hypre_Memset(d_send_i, 0, sizeof(HYPRE_Int), HYPRE_MEMORY_DEVICE); + hypreDevice_GetRowNnz(num_rows_send, d_send_map, A_diag_i, A_offd_i, d_send_i + 1); - hypreDevice_GetRowNnz(hypre_ParCSRMatrixNumRows(A), NULL, hypre_CSRMatrixI(A_diag), hypre_CSRMatrixI(A_offd), hypre_CSRMatrixI(B)); - HYPRE_THRUST_CALL( exclusive_scan, - hypre_CSRMatrixI(B), - hypre_CSRMatrixI(B) + hypre_ParCSRMatrixNumRows(A) + 1, - hypre_CSRMatrixI(B) ); - - dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(hypre_ParCSRMatrixNumRows(A), "warp", bDim); - - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_ConcatDiagAndOffd, - gDim, bDim, - hypre_CSRMatrixNumRows(A_diag), - hypre_CSRMatrixNumCols(A_diag), - hypre_CSRMatrixI(A_diag), - hypre_CSRMatrixJ(A_diag), - hypre_CSRMatrixData(A_diag), - hypre_CSRMatrixI(A_offd), - hypre_CSRMatrixJ(A_offd), - hypre_CSRMatrixData(A_offd), - cols_offd_map, - hypre_CSRMatrixI(B), - hypre_CSRMatrixJ(B), - hypre_CSRMatrixData(B) ); + /* send array send_i out: deviceTohost first and MPI (async) + * note the shift in recv_i by one */ + hypre_TMemcpy(send_i, d_send_i + 1, HYPRE_Int, num_rows_send, HYPRE_MEMORY_HOST, + HYPRE_MEMORY_DEVICE); - hypre_TFree(cols_offd_map, HYPRE_MEMORY_DEVICE); + comm_handle = hypre_ParCSRCommHandleCreate(11, comm_pkg, send_i, recv_i + 1); - hypre_TMemcpy(hypre_CSRMatrixI(B) + hypre_ParCSRMatrixNumRows(A) + 1, hypre_CSRMatrixI(E) + 1, HYPRE_Int, hypre_CSRMatrixNumRows(E), - HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); - HYPRE_THRUST_CALL( transform, - hypre_CSRMatrixI(B) + hypre_ParCSRMatrixNumRows(A) + 1, - hypre_CSRMatrixI(B) + hypre_ParCSRMatrixNumRows(A) + hypre_CSRMatrixNumRows(E) + 1, - thrust::make_constant_iterator(hypre_CSRMatrixNumNonzeros(A_diag) + hypre_CSRMatrixNumNonzeros(A_offd)), - hypre_CSRMatrixI(B) + hypre_ParCSRMatrixNumRows(A) + 1, - thrust::plus() ); + hypreDevice_IntegerInclusiveScan(num_rows_send + 1, d_send_i); - gDim = hypre_GetDefaultCUDAGridDimension(hypre_CSRMatrixNumRows(E), "warp", bDim); + /* total number of nnz to send */ + hypre_TMemcpy(&num_nnz_send, d_send_i + num_rows_send, HYPRE_Int, 1, HYPRE_MEMORY_HOST, + HYPRE_MEMORY_DEVICE); - hypre_assert(hypre_CSRMatrixNumCols(E_diag) == hypre_CSRMatrixNumCols(A_diag)); + /* prepare data to send out. overlap with the above commmunication */ + d_send_j = hypre_TAlloc(HYPRE_BigInt, num_nnz_send, HYPRE_MEMORY_DEVICE); + if (want_data) + { + d_send_a = hypre_TAlloc(HYPRE_Complex, num_nnz_send, HYPRE_MEMORY_DEVICE); + } - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_ConcatDiagAndOffd, - gDim, bDim, - hypre_CSRMatrixNumRows(E_diag), - hypre_CSRMatrixNumCols(E_diag), - hypre_CSRMatrixI(E_diag), - hypre_CSRMatrixJ(E_diag), - hypre_CSRMatrixData(E_diag), - hypre_CSRMatrixI(E_offd), - hypre_CSRMatrixJ(E_offd), - hypre_CSRMatrixData(E_offd), - NULL, - hypre_CSRMatrixI(B) + hypre_ParCSRMatrixNumRows(A), - hypre_CSRMatrixJ(B), - hypre_CSRMatrixData(B) ); + if (d_col_map_offd_A == NULL) + { + d_col_map_offd_A = hypre_TAlloc(HYPRE_BigInt, num_cols_A_offd, HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(d_col_map_offd_A, col_map_offd_A, HYPRE_BigInt, num_cols_A_offd, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); + hypre_ParCSRMatrixDeviceColMapOffd(A) = d_col_map_offd_A; + } - hypre_CSRMatrixDestroy(E_diag); - hypre_CSRMatrixDestroy(E_offd); + /* job == 2, d_send_i is input that contains row ptrs (length num_rows_send) */ + hypreDevice_CopyParCSRRows(num_rows_send, d_send_map, 2, num_procs > 1, + first_col, d_col_map_offd_A, + A_diag_i, A_diag_j, A_diag_a, + A_offd_i, A_offd_j, A_offd_a, + d_send_i, d_send_j, d_send_a); - *B_ptr = B; - *num_cols_offd_ptr = num_cols_offd; - *cols_map_offd_ptr = cols_map_offd; + /* pointers to each proc in send_j */ + send_jstarts = hypre_TAlloc(HYPRE_Int, num_sends + 1, HYPRE_MEMORY_HOST); + send_jstarts[0] = 0; + for (i = 1; i <= num_sends; i++) + { + send_jstarts[i] = send_jstarts[i - 1]; + for ( j = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i - 1); + j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); + j++ ) + { + send_jstarts[i] += send_i[j]; + } + } + hypre_assert(send_jstarts[num_sends] == num_nnz_send); - return hypre_error_flag; -} -#else -HYPRE_Int -hypre_ConcatDiagOffdAndExtDevice(hypre_ParCSRMatrix *A, - hypre_CSRMatrix *E, - hypre_CSRMatrix **B_ptr, - HYPRE_Int *num_cols_offd_ptr, - HYPRE_BigInt **cols_map_offd_ptr) -{ - hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); - HYPRE_Int A_nrows = hypre_CSRMatrixNumRows(A_diag); - HYPRE_Int A_ncols = hypre_CSRMatrixNumCols(A_diag); - HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); - HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); - HYPRE_Complex *A_diag_a = hypre_CSRMatrixData(A_diag); - HYPRE_Int A_diag_nnz = hypre_CSRMatrixNumNonzeros(A_diag); - hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); - HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); - HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); - HYPRE_Complex *A_offd_a = hypre_CSRMatrixData(A_offd); - HYPRE_Int A_offd_nnz = hypre_CSRMatrixNumNonzeros(A_offd); - HYPRE_BigInt first_col_A = hypre_ParCSRMatrixFirstColDiag(A); - HYPRE_BigInt last_col_A = hypre_ParCSRMatrixLastColDiag(A); - HYPRE_Int num_cols_offd_A = hypre_CSRMatrixNumCols(A_offd); - HYPRE_BigInt *col_map_offd_A = hypre_ParCSRMatrixDeviceColMapOffd(A); + /* finish the above communication: send_i/recv_i */ + hypre_ParCSRCommHandleDestroy(comm_handle); - HYPRE_Int *E_i = hypre_CSRMatrixI(E); - HYPRE_BigInt *E_bigj = hypre_CSRMatrixBigJ(E); - HYPRE_Complex *E_a = hypre_CSRMatrixData(E); - HYPRE_Int E_nrows = hypre_CSRMatrixNumRows(E); - HYPRE_Int E_nnz = hypre_CSRMatrixNumNonzeros(E); - HYPRE_Int E_diag_nnz, E_offd_nnz; + /* adjust recv_i to ptrs */ + recv_i[0] = 0; + for (i = 1; i <= num_rows_recv; i++) + { + recv_i[i] += recv_i[i - 1]; + } + num_nnz_recv = recv_i[num_rows_recv]; - hypre_CSRMatrix *B; - HYPRE_Int B_nnz = A_diag_nnz + A_offd_nnz + E_nnz; - HYPRE_Int *B_ii = hypre_TAlloc(HYPRE_Int, B_nnz, HYPRE_MEMORY_DEVICE); - HYPRE_Int *B_j = hypre_TAlloc(HYPRE_Int, B_nnz, HYPRE_MEMORY_DEVICE); - HYPRE_Complex *B_a = hypre_TAlloc(HYPRE_Complex, B_nnz, HYPRE_MEMORY_DEVICE); + /* allocate device memory for j and a */ + d_recv_j = hypre_TAlloc(HYPRE_BigInt, num_nnz_recv, HYPRE_MEMORY_DEVICE); + if (want_data) + { + d_recv_a = hypre_TAlloc(HYPRE_Complex, num_nnz_recv, HYPRE_MEMORY_DEVICE); + } - // E - hypre_CSRMatrixSplitDevice_core(0, E_nrows, E_nnz, NULL, E_bigj, NULL, NULL, first_col_A, last_col_A, num_cols_offd_A, - NULL, NULL, NULL, NULL, &E_diag_nnz, NULL, NULL, NULL, NULL, &E_offd_nnz, - NULL, NULL, NULL, NULL); + recv_jstarts = hypre_TAlloc(HYPRE_Int, num_recvs + 1, HYPRE_MEMORY_HOST); + recv_jstarts[0] = 0; + for (i = 1; i <= num_recvs; i++) + { + j = hypre_ParCSRCommPkgRecvVecStart(comm_pkg, i); + recv_jstarts[i] = recv_i[j]; + } - HYPRE_Int *cols_offd_map, num_cols_offd; - HYPRE_BigInt *cols_map_offd; - HYPRE_Int *E_ii = hypreDevice_CsrRowPtrsToIndices(E_nrows, E_nnz, E_i); + /* ready to send and recv: create a communication package for data */ + hypre_ParCSRCommPkgCreateAndFill(comm, + num_recvs, + hypre_ParCSRCommPkgRecvProcs(comm_pkg), + recv_jstarts, + num_sends, + hypre_ParCSRCommPkgSendProcs(comm_pkg), + send_jstarts, + NULL, + &comm_pkg_j); + + /* RL: make sure d_send_j/d_send_a is ready before issuing GPU-GPU MPI */ + if (hypre_GetGpuAwareMPI()) + { + hypre_ForceSyncComputeStream(); + } - hypre_CSRMatrixSplitDevice_core(1, - E_nrows, E_nnz, E_ii, E_bigj, E_a, NULL, - first_col_A, last_col_A, num_cols_offd_A, col_map_offd_A, - &cols_offd_map, &num_cols_offd, &cols_map_offd, - &E_diag_nnz, - B_ii + A_diag_nnz + A_offd_nnz, - B_j + A_diag_nnz + A_offd_nnz, - B_a + A_diag_nnz + A_offd_nnz, - NULL, - &E_offd_nnz, - B_ii + A_diag_nnz + A_offd_nnz + E_diag_nnz, - B_j + A_diag_nnz + A_offd_nnz + E_diag_nnz, - B_a + A_diag_nnz + A_offd_nnz + E_diag_nnz, - NULL); - hypre_TFree(E_ii, HYPRE_MEMORY_DEVICE); + /* init communication */ + /* ja */ + comm_handle_j = hypre_ParCSRCommHandleCreate_v2(21, comm_pkg_j, + HYPRE_MEMORY_DEVICE, d_send_j, + HYPRE_MEMORY_DEVICE, d_recv_j); + if (want_data) + { + /* a */ + comm_handle_a = hypre_ParCSRCommHandleCreate_v2(1, comm_pkg_j, + HYPRE_MEMORY_DEVICE, d_send_a, + HYPRE_MEMORY_DEVICE, d_recv_a); + } + else + { + comm_handle_a = NULL; + } - HYPRE_THRUST_CALL( transform, - B_ii + A_diag_nnz + A_offd_nnz, - B_ii + B_nnz, - thrust::make_constant_iterator(A_nrows), - B_ii + A_diag_nnz + A_offd_nnz, - thrust::plus() ); + hypre_TMemcpy(d_recv_i, recv_i, HYPRE_Int, num_rows_recv + 1, HYPRE_MEMORY_DEVICE, + HYPRE_MEMORY_HOST); - // Adiag - HYPRE_Int *A_diag_ii = hypreDevice_CsrRowPtrsToIndices(A_nrows, A_diag_nnz, A_diag_i); - HYPRE_THRUST_CALL( copy_n, - thrust::make_zip_iterator(thrust::make_tuple(A_diag_ii, A_diag_j, A_diag_a)), - A_diag_nnz, - thrust::make_zip_iterator(thrust::make_tuple(B_ii, B_j, B_a)) ); - hypre_TFree(A_diag_ii, HYPRE_MEMORY_DEVICE); + /* create A_ext: on device */ + A_ext = hypre_CSRMatrixCreate(num_rows_recv, hypre_ParCSRMatrixGlobalNumCols(A), num_nnz_recv); + hypre_CSRMatrixI (A_ext) = d_recv_i; + hypre_CSRMatrixBigJ(A_ext) = d_recv_j; + hypre_CSRMatrixData(A_ext) = d_recv_a; + hypre_CSRMatrixMemoryLocation(A_ext) = HYPRE_MEMORY_DEVICE; - // Aoffd - HYPRE_Int *A_offd_ii = hypreDevice_CsrRowPtrsToIndices(A_nrows, A_offd_nnz, A_offd_i); - HYPRE_THRUST_CALL( copy_n, - thrust::make_zip_iterator(thrust::make_tuple(A_offd_ii, A_offd_a)), - A_offd_nnz, - thrust::make_zip_iterator(thrust::make_tuple(B_ii, B_a)) + A_diag_nnz ); - hypre_TFree(A_offd_ii, HYPRE_MEMORY_DEVICE); + /* output */ + vrequest = hypre_TAlloc(void *, 3, HYPRE_MEMORY_HOST); + vrequest[0] = (void *) comm_handle_j; + vrequest[1] = (void *) comm_handle_a; + vrequest[2] = (void *) A_ext; - HYPRE_THRUST_CALL( gather, - A_offd_j, - A_offd_j + A_offd_nnz, - cols_offd_map, - B_j + A_diag_nnz); + *request_ptr = (void *) vrequest; - hypre_TFree(cols_offd_map, HYPRE_MEMORY_DEVICE); + /* free */ + hypre_TFree(send_i, HYPRE_MEMORY_HOST); + hypre_TFree(recv_i, HYPRE_MEMORY_HOST); + hypre_TFree(d_send_i, HYPRE_MEMORY_DEVICE); + hypre_TFree(d_send_map, HYPRE_MEMORY_DEVICE); - HYPRE_THRUST_CALL( transform, - B_j + A_diag_nnz, - B_j + A_diag_nnz + A_offd_nnz, - thrust::make_constant_iterator(A_ncols), - B_j + A_diag_nnz, - thrust::plus() ); + hypre_TFree(hypre_ParCSRCommPkgSendMapStarts(comm_pkg_j), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_ParCSRCommPkgRecvVecStarts(comm_pkg_j), HYPRE_MEMORY_HOST); + hypre_TFree(comm_pkg_j, HYPRE_MEMORY_HOST); - HYPRE_THRUST_CALL( transform, - B_j + A_diag_nnz + A_offd_nnz + E_diag_nnz, - B_j + B_nnz, - thrust::make_constant_iterator(A_ncols), - B_j + A_diag_nnz + A_offd_nnz + E_diag_nnz, - thrust::plus() ); + return hypre_error_flag; +} - // B - HYPRE_THRUST_CALL( stable_sort_by_key, - B_ii, - B_ii + B_nnz, - thrust::make_zip_iterator(thrust::make_tuple(B_j, B_a)) ); +hypre_CSRMatrix* +hypre_ParcsrGetExternalRowsDeviceWait(void *vrequest) +{ + void **request = (void **) vrequest; - HYPRE_Int *B_i = hypreDevice_CsrRowIndicesToPtrs(A_nrows + E_nrows, B_nnz, B_ii); - hypre_TFree(B_ii, HYPRE_MEMORY_DEVICE); + hypre_ParCSRCommHandle *comm_handle_j = (hypre_ParCSRCommHandle *) request[0]; + hypre_ParCSRCommHandle *comm_handle_a = (hypre_ParCSRCommHandle *) request[1]; + hypre_CSRMatrix *A_ext = (hypre_CSRMatrix *) request[2]; + HYPRE_BigInt *send_j = comm_handle_j ? (HYPRE_BigInt *) + hypre_ParCSRCommHandleSendData(comm_handle_j) : NULL; + HYPRE_Complex *send_a = comm_handle_a ? (HYPRE_Complex *) + hypre_ParCSRCommHandleSendData(comm_handle_a) : NULL; - B = hypre_CSRMatrixCreate(A_nrows + E_nrows, A_ncols + num_cols_offd, B_nnz); - hypre_CSRMatrixI(B) = B_i; - hypre_CSRMatrixJ(B) = B_j; - hypre_CSRMatrixData(B) = B_a; - hypre_CSRMatrixMemoryLocation(B) = HYPRE_MEMORY_DEVICE; + hypre_ParCSRCommHandleDestroy(comm_handle_j); + hypre_ParCSRCommHandleDestroy(comm_handle_a); - *B_ptr = B; - *num_cols_offd_ptr = num_cols_offd; - *cols_map_offd_ptr = cols_map_offd; + hypre_TFree(send_j, HYPRE_MEMORY_DEVICE); + hypre_TFree(send_a, HYPRE_MEMORY_DEVICE); - return hypre_error_flag; + hypre_TFree(request, HYPRE_MEMORY_HOST); + + return A_ext; } -#endif HYPRE_Int -hypre_ParCSRMatrixGetRowDevice( hypre_ParCSRMatrix *mat, - HYPRE_BigInt row, - HYPRE_Int *size, - HYPRE_BigInt **col_ind, - HYPRE_Complex **values ) +hypre_ParCSRCommPkgCreateMatrixE( hypre_ParCSRCommPkg *comm_pkg, + HYPRE_Int num_cols ) { - HYPRE_Int nrows, local_row; - HYPRE_BigInt row_start, row_end; - hypre_CSRMatrix *Aa; - hypre_CSRMatrix *Ba; - - if (!mat) + /* Input variables */ + HYPRE_Int num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); + HYPRE_Int num_elements = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends); + HYPRE_Int num_components = hypre_ParCSRCommPkgNumComponents(comm_pkg); + HYPRE_Int *send_map = hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg); + HYPRE_Int *send_map_def; + + /* Local variables */ + hypre_CSRMatrix *matrix_E; + HYPRE_Int *e_i; + HYPRE_Int *e_ii; + HYPRE_Int *e_j; + HYPRE_Int *new_end; + HYPRE_Int nid; + + /* Update number of elements exchanged when communicating multivectors */ + num_elements /= num_components; + + /* Create matrix_E */ + matrix_E = hypre_CSRMatrixCreate(num_cols, num_elements, num_elements); + hypre_CSRMatrixMemoryLocation(matrix_E) = HYPRE_MEMORY_DEVICE; + + /* Build default (original) send_map_elements array */ + if (num_components > 1) { - hypre_error_in_arg(1); - return hypre_error_flag; + send_map_def = hypre_TAlloc(HYPRE_Int, num_elements, HYPRE_MEMORY_DEVICE); + hypreDevice_IntStridedCopy(num_elements, num_components, send_map, send_map_def); } - - Aa = (hypre_CSRMatrix *) hypre_ParCSRMatrixDiag(mat); - Ba = (hypre_CSRMatrix *) hypre_ParCSRMatrixOffd(mat); - - if (hypre_ParCSRMatrixGetrowactive(mat)) + else { - return(-1); + send_map_def = send_map; } - hypre_ParCSRMatrixGetrowactive(mat) = 1; - - row_start = hypre_ParCSRMatrixFirstRowIndex(mat); - row_end = hypre_ParCSRMatrixLastRowIndex(mat) + 1; - nrows = row_end - row_start; + /* Allocate arrays */ + e_ii = hypre_TAlloc(HYPRE_Int, num_elements, HYPRE_MEMORY_DEVICE); + e_j = hypre_TAlloc(HYPRE_Int, num_elements, HYPRE_MEMORY_DEVICE); - if (row < row_start || row >= row_end) - { - return(-1); - } + /* Build e_ii and e_j */ + hypre_TMemcpy(e_ii, send_map_def, HYPRE_Int, num_elements, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_SYCL) + hypreSycl_sequence(e_j, e_j + num_elements, 0); + hypreSycl_stable_sort_by_key(e_ii, e_ii + num_elements, e_j); +#else + HYPRE_THRUST_CALL(sequence, e_j, e_j + num_elements); + HYPRE_THRUST_CALL(stable_sort_by_key, e_ii, e_ii + num_elements, e_j); +#endif - local_row = row - row_start; + /* Construct row pointers from row indices */ + e_i = hypreDevice_CsrRowIndicesToPtrs(num_cols, num_elements, e_ii); - /* if buffer is not allocated and some information is requested, allocate buffer with the max row_nnz */ - if ( !hypre_ParCSRMatrixRowvalues(mat) && (col_ind || values) ) - { - HYPRE_Int max_row_nnz; - HYPRE_Int *row_nnz = hypre_TAlloc(HYPRE_Int, nrows, HYPRE_MEMORY_DEVICE); + /* Find row indices with nonzero coefficients */ +#if defined(HYPRE_USING_SYCL) + new_end = HYPRE_ONEDPL_CALL(std::unique, e_ii, e_ii + num_elements); +#else + new_end = HYPRE_THRUST_CALL(unique, e_ii, e_ii + num_elements); +#endif + nid = new_end - e_ii; + e_ii = hypre_TReAlloc_v2(e_ii, HYPRE_Int, num_elements, + HYPRE_Int, nid, HYPRE_MEMORY_DEVICE); - hypreDevice_GetRowNnz(nrows, NULL, hypre_CSRMatrixI(Aa), hypre_CSRMatrixI(Ba), row_nnz); + /* Set matrix_E pointers */ + hypre_CSRMatrixI(matrix_E) = e_i; + hypre_CSRMatrixJ(matrix_E) = e_j; + hypre_CSRMatrixNumRownnz(matrix_E) = nid; + hypre_CSRMatrixRownnz(matrix_E) = e_ii; - hypre_TMemcpy(size, row_nnz + local_row, HYPRE_Int, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); + /* Set matrix_E */ + hypre_ParCSRCommPkgMatrixE(comm_pkg) = matrix_E; - max_row_nnz = HYPRE_THRUST_CALL(reduce, row_nnz, row_nnz + nrows, 0, thrust::maximum()); + /* Free memory */ + if (num_components > 1) + { + hypre_TFree(send_map_def, HYPRE_MEMORY_DEVICE); + } -/* - HYPRE_Int *max_row_nnz_d = HYPRE_THRUST_CALL(max_element, row_nnz, row_nnz + nrows); - hypre_TMemcpy( &max_row_nnz, max_row_nnz_d, - HYPRE_Int, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE ); -*/ + return hypre_error_flag; +} - hypre_TFree(row_nnz, HYPRE_MEMORY_DEVICE); +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixCompressOffdMapDevice + *--------------------------------------------------------------------------*/ - hypre_ParCSRMatrixRowvalues(mat) = - (HYPRE_Complex *) hypre_TAlloc(HYPRE_Complex, max_row_nnz, hypre_ParCSRMatrixMemoryLocation(mat)); - hypre_ParCSRMatrixRowindices(mat) = - (HYPRE_BigInt *) hypre_TAlloc(HYPRE_BigInt, max_row_nnz, hypre_ParCSRMatrixMemoryLocation(mat)); - } - else - { - HYPRE_Int *size_d = hypre_TAlloc(HYPRE_Int, 1, HYPRE_MEMORY_DEVICE); - hypreDevice_GetRowNnz(1, NULL, hypre_CSRMatrixI(Aa) + local_row, hypre_CSRMatrixI(Ba) + local_row, size_d); - hypre_TMemcpy(size, size_d, HYPRE_Int, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); - hypre_TFree(size_d, HYPRE_MEMORY_DEVICE); - } +HYPRE_Int +hypre_ParCSRMatrixCompressOffdMapDevice(hypre_ParCSRMatrix *A) +{ + hypre_GpuProfilingPushRange("CompressOffdMap"); + hypre_ParCSRMatrixCopyColMapOffdToDevice(A); - if (col_ind || values) - { - if (hypre_ParCSRMatrixDeviceColMapOffd(mat) == NULL) - { - hypre_ParCSRMatrixDeviceColMapOffd(mat) = - hypre_TAlloc(HYPRE_BigInt, hypre_CSRMatrixNumCols(Ba), HYPRE_MEMORY_DEVICE); + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); + HYPRE_Int num_cols_A_offd = hypre_CSRMatrixNumCols(A_offd); + HYPRE_BigInt *col_map_offd_A = hypre_ParCSRMatrixDeviceColMapOffd(A); + HYPRE_BigInt *col_map_offd_A_new; + HYPRE_Int num_cols_A_offd_new; - hypre_TMemcpy( hypre_ParCSRMatrixDeviceColMapOffd(mat), - hypre_ParCSRMatrixColMapOffd(mat), - HYPRE_BigInt, - hypre_CSRMatrixNumCols(Ba), - HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST ); - } + hypre_CSRMatrixCompressColumnsDevice(A_offd, col_map_offd_A, NULL, &col_map_offd_A_new); - hypreDevice_CopyParCSRRows( 1, NULL, -1, Ba != NULL, - hypre_ParCSRMatrixFirstColDiag(mat), - hypre_ParCSRMatrixDeviceColMapOffd(mat), - hypre_CSRMatrixI(Aa) + local_row, - hypre_CSRMatrixJ(Aa), - hypre_CSRMatrixData(Aa), - hypre_CSRMatrixI(Ba) + local_row, - hypre_CSRMatrixJ(Ba), - hypre_CSRMatrixData(Ba), - NULL, - hypre_ParCSRMatrixRowindices(mat), - hypre_ParCSRMatrixRowvalues(mat) ); - } + num_cols_A_offd_new = hypre_CSRMatrixNumCols(A_offd); - if (col_ind) + if (num_cols_A_offd_new < num_cols_A_offd) { - *col_ind = hypre_ParCSRMatrixRowindices(mat); - } + hypre_TFree(col_map_offd_A, HYPRE_MEMORY_DEVICE); + hypre_ParCSRMatrixDeviceColMapOffd(A) = col_map_offd_A_new; - if (values) - { - *values = hypre_ParCSRMatrixRowvalues(mat); + hypre_ParCSRMatrixColMapOffd(A) = hypre_TReAlloc(hypre_ParCSRMatrixColMapOffd(A), + HYPRE_BigInt, num_cols_A_offd_new, + HYPRE_MEMORY_HOST); + + hypre_TMemcpy(hypre_ParCSRMatrixColMapOffd(A), + hypre_ParCSRMatrixDeviceColMapOffd(A), + HYPRE_BigInt, num_cols_A_offd_new, + HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); } - hypre_SyncCudaComputeStream(hypre_handle()); + hypre_GpuProfilingPopRange(); return hypre_error_flag; } @@ -1046,7 +1052,8 @@ hypre_ParCSRMatrixGetRowDevice( hypre_ParCSRMatrix *mat, */ template __global__ void -hypre_ParCSRMatrixDropSmallEntriesDevice_getElmtTols( HYPRE_Int nrows, +hypre_ParCSRMatrixDropSmallEntriesDevice_getElmtTols( hypre_DeviceItem &item, + HYPRE_Int nrows, HYPRE_Real tol, HYPRE_Int *A_diag_i, HYPRE_Int *A_diag_j, @@ -1056,23 +1063,23 @@ hypre_ParCSRMatrixDropSmallEntriesDevice_getElmtTols( HYPRE_Int nrows, HYPRE_Real *elmt_tols_diag, HYPRE_Real *elmt_tols_offd) { - HYPRE_Int row_i = hypre_cuda_get_grid_warp_id<1,1>(); + HYPRE_Int row_i = hypre_gpu_get_grid_warp_id<1, 1>(item); if (row_i >= nrows) { return; } - HYPRE_Int lane = hypre_cuda_get_lane_id<1>(); - HYPRE_Int p_diag, p_offd, q_diag, q_offd; + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); + HYPRE_Int p_diag = 0, p_offd = 0, q_diag, q_offd; /* sum row norm over diag part */ if (lane < 2) { p_diag = read_only_load(A_diag_i + row_i + lane); } - q_diag = __shfl_sync(HYPRE_WARP_FULL_MASK, p_diag, 1); - p_diag = __shfl_sync(HYPRE_WARP_FULL_MASK, p_diag, 0); + q_diag = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_diag, 1); + p_diag = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_diag, 0); HYPRE_Real row_norm_i = 0.0; @@ -1099,8 +1106,8 @@ hypre_ParCSRMatrixDropSmallEntriesDevice_getElmtTols( HYPRE_Int nrows, { p_offd = read_only_load(A_offd_i + row_i + lane); } - q_offd = __shfl_sync(HYPRE_WARP_FULL_MASK, p_offd, 1); - p_offd = __shfl_sync(HYPRE_WARP_FULL_MASK, p_offd, 0); + q_offd = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_offd, 1); + p_offd = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p_offd, 0); for (HYPRE_Int j = p_offd + lane; j < q_offd; j += HYPRE_WARP_SIZE) { @@ -1120,164 +1127,323 @@ hypre_ParCSRMatrixDropSmallEntriesDevice_getElmtTols( HYPRE_Int nrows, } } - /* allreduce to get the row norm on all threads */ - if (type == -1) - { - row_norm_i = warp_allreduce_max(row_norm_i); - } - else - { - row_norm_i = warp_allreduce_sum(row_norm_i); - } - if (type == 2) + /* allreduce to get the row norm on all threads */ + if (type == -1) + { + row_norm_i = warp_allreduce_max(item, row_norm_i); + } + else + { + row_norm_i = warp_allreduce_sum(item, row_norm_i); + } + if (type == 2) + { + row_norm_i = hypre_sqrt(row_norm_i); + } + + /* set elmt_tols_diag */ + for (HYPRE_Int j = p_diag + lane; j < q_diag; j += HYPRE_WARP_SIZE) + { + HYPRE_Int col = A_diag_j[j]; + + /* elmt_tol = 0.0 ensures diagonal will be kept */ + if (col == row_i) + { + elmt_tols_diag[j] = 0.0; + } + else + { + elmt_tols_diag[j] = tol * row_norm_i; + } + } + + /* set elmt_tols_offd */ + for (HYPRE_Int j = p_offd + lane; j < q_offd; j += HYPRE_WARP_SIZE) + { + elmt_tols_offd[j] = tol * row_norm_i; + } + +} + +/* drop the entries that are not on the diagonal and smaller than: + * type 0: tol + * type 1: tol*(1-norm of row) + * type 2: tol*(2-norm of row) + * type -1: tol*(infinity norm of row) */ +HYPRE_Int +hypre_ParCSRMatrixDropSmallEntriesDevice( hypre_ParCSRMatrix *A, + HYPRE_Complex tol, + HYPRE_Int type) +{ + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); + HYPRE_Int num_cols_A_offd = hypre_CSRMatrixNumCols(A_offd); + HYPRE_BigInt *h_col_map_offd_A = hypre_ParCSRMatrixColMapOffd(A); + HYPRE_BigInt *col_map_offd_A = hypre_ParCSRMatrixDeviceColMapOffd(A); + + HYPRE_Real *elmt_tols_diag = NULL; + HYPRE_Real *elmt_tols_offd = NULL; + + /* Exit if tolerance is zero */ + if (tol < HYPRE_REAL_MIN) + { + return hypre_error_flag; + } + + hypre_GpuProfilingPushRange("ParCSRMatrixDropSmallEntries"); + + if (col_map_offd_A == NULL) + { + col_map_offd_A = hypre_TAlloc(HYPRE_BigInt, num_cols_A_offd, HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(col_map_offd_A, h_col_map_offd_A, HYPRE_BigInt, num_cols_A_offd, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); + hypre_ParCSRMatrixDeviceColMapOffd(A) = col_map_offd_A; + } + + /* get elmement-wise tolerances if needed */ + if (type != 0) + { + elmt_tols_diag = hypre_TAlloc(HYPRE_Real, hypre_CSRMatrixNumNonzeros(A_diag), HYPRE_MEMORY_DEVICE); + elmt_tols_offd = hypre_TAlloc(HYPRE_Real, hypre_CSRMatrixNumNonzeros(A_offd), HYPRE_MEMORY_DEVICE); + } + + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(hypre_CSRMatrixNumRows(A_diag), "warp", bDim); + + HYPRE_Int A_diag_nrows = hypre_CSRMatrixNumRows(A_diag); + HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); + HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); + HYPRE_Complex *A_diag_data = hypre_CSRMatrixData(A_diag); + HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); + HYPRE_Complex *A_offd_data = hypre_CSRMatrixData(A_offd); + if (type == -1) + { + HYPRE_GPU_LAUNCH( hypre_ParCSRMatrixDropSmallEntriesDevice_getElmtTols < -1 >, gDim, bDim, + A_diag_nrows, tol, A_diag_i, + A_diag_j, A_diag_data, A_offd_i, + A_offd_data, elmt_tols_diag, elmt_tols_offd); + } + if (type == 1) + { + HYPRE_GPU_LAUNCH( hypre_ParCSRMatrixDropSmallEntriesDevice_getElmtTols<1>, gDim, bDim, + A_diag_nrows, tol, A_diag_i, + A_diag_j, A_diag_data, A_offd_i, + A_offd_data, elmt_tols_diag, elmt_tols_offd); + } + if (type == 2) + { + HYPRE_GPU_LAUNCH( hypre_ParCSRMatrixDropSmallEntriesDevice_getElmtTols<2>, gDim, bDim, + A_diag_nrows, tol, A_diag_i, + A_diag_j, A_diag_data, A_offd_i, + A_offd_data, elmt_tols_diag, elmt_tols_offd); + } + + /* drop entries from diag and offd CSR matrices */ + hypre_CSRMatrixDropSmallEntriesDevice(A_diag, tol, elmt_tols_diag); + hypre_CSRMatrixDropSmallEntriesDevice(A_offd, tol, elmt_tols_offd); + + hypre_ParCSRMatrixSetNumNonzeros(A); + hypre_ParCSRMatrixDNumNonzeros(A) = (HYPRE_Real) hypre_ParCSRMatrixNumNonzeros(A); + + /* squeeze out zero columns of A_offd */ + hypre_ParCSRMatrixCompressOffdMapDevice(A); + + if (type != 0) + { + hypre_TFree(elmt_tols_diag, HYPRE_MEMORY_DEVICE); + hypre_TFree(elmt_tols_offd, HYPRE_MEMORY_DEVICE); + } + + hypre_GpuProfilingPopRange(); + + return hypre_error_flag; +} + +hypre_CSRMatrix* +hypre_MergeDiagAndOffdDevice(hypre_ParCSRMatrix *A) +{ + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + HYPRE_Complex *A_diag_a = hypre_CSRMatrixData(A_diag); + HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); + HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); + HYPRE_Complex *A_offd_a = hypre_CSRMatrixData(A_offd); + HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); + HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); + + HYPRE_Int local_num_rows = hypre_CSRMatrixNumRows(A_diag); + HYPRE_BigInt glbal_num_cols = hypre_ParCSRMatrixGlobalNumCols(A); + HYPRE_BigInt first_col = hypre_ParCSRMatrixFirstColDiag(A); + HYPRE_Int num_cols_A_offd = hypre_CSRMatrixNumCols(A_offd); + HYPRE_BigInt *col_map_offd_A = hypre_ParCSRMatrixColMapOffd(A); + HYPRE_BigInt *d_col_map_offd_A = hypre_ParCSRMatrixDeviceColMapOffd(A); + + hypre_CSRMatrix *B; + HYPRE_Int B_nrows = local_num_rows; + HYPRE_BigInt B_ncols = glbal_num_cols; + HYPRE_Int *B_i = hypre_TAlloc(HYPRE_Int, B_nrows + 1, HYPRE_MEMORY_DEVICE); + HYPRE_BigInt *B_j; + HYPRE_Complex *B_a; + HYPRE_Int B_nnz; + + HYPRE_Int num_procs; + + hypre_MPI_Comm_size(comm, &num_procs); + + hypre_Memset(B_i, 0, sizeof(HYPRE_Int), HYPRE_MEMORY_DEVICE); + + hypreDevice_GetRowNnz(B_nrows, NULL, A_diag_i, A_offd_i, B_i + 1); + + hypreDevice_IntegerInclusiveScan(B_nrows + 1, B_i); + + /* total number of nnz */ + hypre_TMemcpy(&B_nnz, B_i + B_nrows, HYPRE_Int, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); + + B_j = hypre_TAlloc(HYPRE_BigInt, B_nnz, HYPRE_MEMORY_DEVICE); + B_a = hypre_TAlloc(HYPRE_Complex, B_nnz, HYPRE_MEMORY_DEVICE); + + if (d_col_map_offd_A == NULL) { - row_norm_i = sqrt(row_norm_i); + d_col_map_offd_A = hypre_TAlloc(HYPRE_BigInt, num_cols_A_offd, HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(d_col_map_offd_A, col_map_offd_A, HYPRE_BigInt, num_cols_A_offd, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); + hypre_ParCSRMatrixDeviceColMapOffd(A) = d_col_map_offd_A; } - /* set elmt_tols_diag */ - for (HYPRE_Int j = p_diag + lane; j < q_diag; j += HYPRE_WARP_SIZE) - { - HYPRE_Int col = A_diag_j[j]; + hypreDevice_CopyParCSRRows(B_nrows, NULL, 2, num_procs > 1, first_col, d_col_map_offd_A, + A_diag_i, A_diag_j, A_diag_a, A_offd_i, A_offd_j, A_offd_a, + B_i, B_j, B_a); - /* elmt_tol = 0.0 ensures diagonal will be kept */ - if (col == row_i) - { - elmt_tols_diag[j] = 0.0; - } - else - { - elmt_tols_diag[j] = tol * row_norm_i; - } - } + /* output */ + B = hypre_CSRMatrixCreate(B_nrows, B_ncols, B_nnz); + hypre_CSRMatrixI (B) = B_i; + hypre_CSRMatrixBigJ(B) = B_j; + hypre_CSRMatrixData(B) = B_a; + hypre_CSRMatrixMemoryLocation(B) = HYPRE_MEMORY_DEVICE; - /* set elmt_tols_offd */ - for (HYPRE_Int j = p_offd + lane; j < q_offd; j += HYPRE_WARP_SIZE) - { - elmt_tols_offd[j] = tol * row_norm_i; - } + hypre_SyncComputeStream(); + return B; } -/* drop the entries that are not on the diagonal and smaller than: - * type 0: tol - * type 1: tol*(1-norm of row) - * type 2: tol*(2-norm of row) - * type -1: tol*(infinity norm of row) */ HYPRE_Int -hypre_ParCSRMatrixDropSmallEntriesDevice( hypre_ParCSRMatrix *A, - HYPRE_Complex tol, - HYPRE_Int type) +hypre_ParCSRMatrixGetRowDevice( hypre_ParCSRMatrix *mat, + HYPRE_BigInt row, + HYPRE_Int *size, + HYPRE_BigInt **col_ind, + HYPRE_Complex **values ) { - hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); - hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); - HYPRE_Int num_cols_A_offd = hypre_CSRMatrixNumCols(A_offd); - HYPRE_BigInt *h_col_map_offd_A = hypre_ParCSRMatrixColMapOffd(A); - HYPRE_BigInt *col_map_offd_A = hypre_ParCSRMatrixDeviceColMapOffd(A); - - HYPRE_Real *elmt_tols_diag = NULL; - HYPRE_Real *elmt_tols_offd = NULL; + HYPRE_Int nrows, local_row; + HYPRE_BigInt row_start, row_end; + hypre_CSRMatrix *Aa; + hypre_CSRMatrix *Ba; - if (col_map_offd_A == NULL) + if (!mat) { - col_map_offd_A = hypre_TAlloc(HYPRE_BigInt, num_cols_A_offd, HYPRE_MEMORY_DEVICE); - hypre_TMemcpy(col_map_offd_A, h_col_map_offd_A, HYPRE_BigInt, num_cols_A_offd, - HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - hypre_ParCSRMatrixDeviceColMapOffd(A) = col_map_offd_A; + hypre_error_in_arg(1); + return hypre_error_flag; } - /* get elmement-wise tolerances if needed */ - if (type != 0) + Aa = (hypre_CSRMatrix *) hypre_ParCSRMatrixDiag(mat); + Ba = (hypre_CSRMatrix *) hypre_ParCSRMatrixOffd(mat); + + if (hypre_ParCSRMatrixGetrowactive(mat)) { - elmt_tols_diag = hypre_TAlloc(HYPRE_Real, hypre_CSRMatrixNumNonzeros(A_diag), HYPRE_MEMORY_DEVICE); - elmt_tols_offd = hypre_TAlloc(HYPRE_Real, hypre_CSRMatrixNumNonzeros(A_offd), HYPRE_MEMORY_DEVICE); + return (-1); } - dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(hypre_CSRMatrixNumRows(A_diag), "warp", bDim); + hypre_ParCSRMatrixGetrowactive(mat) = 1; - if (type == -1) - { - HYPRE_CUDA_LAUNCH( hypre_ParCSRMatrixDropSmallEntriesDevice_getElmtTols<-1>, gDim, bDim, - hypre_CSRMatrixNumRows(A_diag), tol, hypre_CSRMatrixI(A_diag), - hypre_CSRMatrixJ(A_diag), hypre_CSRMatrixData(A_diag), hypre_CSRMatrixI(A_offd), - hypre_CSRMatrixData(A_offd), elmt_tols_diag, elmt_tols_offd); - } - if (type == 1) + row_start = hypre_ParCSRMatrixFirstRowIndex(mat); + row_end = hypre_ParCSRMatrixLastRowIndex(mat) + 1; + nrows = row_end - row_start; + + if (row < row_start || row >= row_end) { - HYPRE_CUDA_LAUNCH( hypre_ParCSRMatrixDropSmallEntriesDevice_getElmtTols<1>, gDim, bDim, - hypre_CSRMatrixNumRows(A_diag), tol, hypre_CSRMatrixI(A_diag), - hypre_CSRMatrixJ(A_diag), hypre_CSRMatrixData(A_diag), hypre_CSRMatrixI(A_offd), - hypre_CSRMatrixData(A_offd), elmt_tols_diag, elmt_tols_offd); + return (-1); } - if (type == 2) + + local_row = row - row_start; + + /* if buffer is not allocated and some information is requested, allocate buffer with the max row_nnz */ + if ( !hypre_ParCSRMatrixRowvalues(mat) && (col_ind || values) ) { - HYPRE_CUDA_LAUNCH( hypre_ParCSRMatrixDropSmallEntriesDevice_getElmtTols<2>, gDim, bDim, - hypre_CSRMatrixNumRows(A_diag), tol, hypre_CSRMatrixI(A_diag), - hypre_CSRMatrixJ(A_diag), hypre_CSRMatrixData(A_diag), hypre_CSRMatrixI(A_offd), - hypre_CSRMatrixData(A_offd), elmt_tols_diag, elmt_tols_offd); - } + HYPRE_Int max_row_nnz; + HYPRE_Int *row_nnz = hypre_TAlloc(HYPRE_Int, nrows, HYPRE_MEMORY_DEVICE); - /* drop entries from diag and offd CSR matrices */ - hypre_CSRMatrixDropSmallEntriesDevice(A_diag, tol, elmt_tols_diag); - hypre_CSRMatrixDropSmallEntriesDevice(A_offd, tol, elmt_tols_offd); + hypreDevice_GetRowNnz(nrows, NULL, hypre_CSRMatrixI(Aa), hypre_CSRMatrixI(Ba), row_nnz); - hypre_ParCSRMatrixSetNumNonzeros(A); - hypre_ParCSRMatrixDNumNonzeros(A) = (HYPRE_Real) hypre_ParCSRMatrixNumNonzeros(A); + hypre_TMemcpy(size, row_nnz + local_row, HYPRE_Int, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); - /* squeeze out zero columns of A_offd */ - HYPRE_Int *tmp_j, *tmp_end, num_cols_A_offd_new; - tmp_j = hypre_TAlloc(HYPRE_Int, hypre_CSRMatrixNumNonzeros(A_offd), HYPRE_MEMORY_DEVICE); - hypre_TMemcpy(tmp_j, hypre_CSRMatrixJ(A_offd), HYPRE_Int, hypre_CSRMatrixNumNonzeros(A_offd), - HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); - HYPRE_THRUST_CALL( sort, - tmp_j, - tmp_j + hypre_CSRMatrixNumNonzeros(A_offd) ); - tmp_end = HYPRE_THRUST_CALL( unique, - tmp_j, - tmp_j + hypre_CSRMatrixNumNonzeros(A_offd) ); - num_cols_A_offd_new = tmp_end - tmp_j; +#if defined(HYPRE_USING_SYCL) + max_row_nnz = HYPRE_ONEDPL_CALL(std::reduce, row_nnz, row_nnz + nrows, 0, + oneapi::dpl::maximum()); +#else + max_row_nnz = HYPRE_THRUST_CALL(reduce, row_nnz, row_nnz + nrows, 0, thrust::maximum()); +#endif - hypre_assert(num_cols_A_offd_new <= num_cols_A_offd); + /* + HYPRE_Int *max_row_nnz_d = HYPRE_THRUST_CALL(max_element, row_nnz, row_nnz + nrows); + hypre_TMemcpy( &max_row_nnz, max_row_nnz_d, + HYPRE_Int, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE ); + */ - if (num_cols_A_offd_new < num_cols_A_offd) + hypre_TFree(row_nnz, HYPRE_MEMORY_DEVICE); + + hypre_ParCSRMatrixRowvalues(mat) = + (HYPRE_Complex *) hypre_TAlloc(HYPRE_Complex, max_row_nnz, hypre_ParCSRMatrixMemoryLocation(mat)); + hypre_ParCSRMatrixRowindices(mat) = + (HYPRE_BigInt *) hypre_TAlloc(HYPRE_BigInt, max_row_nnz, hypre_ParCSRMatrixMemoryLocation(mat)); + } + else { - hypre_CSRMatrixNumCols(A_offd) = num_cols_A_offd_new; + HYPRE_Int *size_d = hypre_TAlloc(HYPRE_Int, 1, HYPRE_MEMORY_DEVICE); + hypreDevice_GetRowNnz(1, NULL, hypre_CSRMatrixI(Aa) + local_row, hypre_CSRMatrixI(Ba) + local_row, + size_d); + hypre_TMemcpy(size, size_d, HYPRE_Int, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); + hypre_TFree(size_d, HYPRE_MEMORY_DEVICE); + } - HYPRE_Int *offd_mark = hypre_CTAlloc(HYPRE_Int, num_cols_A_offd, HYPRE_MEMORY_DEVICE); - HYPRE_BigInt *col_map_offd_A_new = hypre_TAlloc(HYPRE_BigInt, num_cols_A_offd_new, HYPRE_MEMORY_DEVICE); + if (col_ind || values) + { + if (hypre_ParCSRMatrixDeviceColMapOffd(mat) == NULL) + { + hypre_ParCSRMatrixDeviceColMapOffd(mat) = + hypre_TAlloc(HYPRE_BigInt, hypre_CSRMatrixNumCols(Ba), HYPRE_MEMORY_DEVICE); - HYPRE_THRUST_CALL( scatter, - thrust::counting_iterator(0), - thrust::counting_iterator(num_cols_A_offd_new), - tmp_j, - offd_mark ); - HYPRE_THRUST_CALL( gather, - hypre_CSRMatrixJ(A_offd), - hypre_CSRMatrixJ(A_offd) + hypre_CSRMatrixNumNonzeros(A_offd), - offd_mark, - hypre_CSRMatrixJ(A_offd) ); - HYPRE_THRUST_CALL( gather, - tmp_j, - tmp_j + num_cols_A_offd_new, - col_map_offd_A, - col_map_offd_A_new ); + hypre_TMemcpy( hypre_ParCSRMatrixDeviceColMapOffd(mat), + hypre_ParCSRMatrixColMapOffd(mat), + HYPRE_BigInt, + hypre_CSRMatrixNumCols(Ba), + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST ); + } - hypre_TFree(offd_mark, HYPRE_MEMORY_DEVICE); - hypre_TFree(col_map_offd_A, HYPRE_MEMORY_DEVICE); - hypre_TFree(h_col_map_offd_A, HYPRE_MEMORY_HOST); + hypreDevice_CopyParCSRRows( 1, NULL, -1, Ba != NULL, + hypre_ParCSRMatrixFirstColDiag(mat), + hypre_ParCSRMatrixDeviceColMapOffd(mat), + hypre_CSRMatrixI(Aa) + local_row, + hypre_CSRMatrixJ(Aa), + hypre_CSRMatrixData(Aa), + hypre_CSRMatrixI(Ba) + local_row, + hypre_CSRMatrixJ(Ba), + hypre_CSRMatrixData(Ba), + NULL, + hypre_ParCSRMatrixRowindices(mat), + hypre_ParCSRMatrixRowvalues(mat) ); + } - hypre_ParCSRMatrixDeviceColMapOffd(A) = col_map_offd_A_new; - hypre_ParCSRMatrixColMapOffd(A) = hypre_TAlloc(HYPRE_BigInt, num_cols_A_offd_new, HYPRE_MEMORY_HOST); - hypre_TMemcpy(hypre_ParCSRMatrixColMapOffd(A), col_map_offd_A_new, HYPRE_BigInt, num_cols_A_offd_new, - HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); + if (col_ind) + { + *col_ind = hypre_ParCSRMatrixRowindices(mat); } - if (type != 0) + if (values) { - hypre_TFree(elmt_tols_diag, HYPRE_MEMORY_DEVICE); - hypre_TFree(elmt_tols_offd, HYPRE_MEMORY_DEVICE); + *values = hypre_ParCSRMatrixRowvalues(mat); } - hypre_TFree(tmp_j, HYPRE_MEMORY_DEVICE); + + hypre_SyncComputeStream(); return hypre_error_flag; } @@ -1311,14 +1477,31 @@ hypre_ParCSRMatrixTransposeDevice( hypre_ParCSRMatrix *A, HYPRE_BigInt *tmp_bigj; hypre_CSRMatrixTranspose(A_offd, &A_offdT, data); - hypre_CSRMatrixBigJ(A_offdT) = hypre_TAlloc(HYPRE_BigInt, hypre_CSRMatrixNumNonzeros(A_offdT), HYPRE_MEMORY_DEVICE); + hypre_CSRMatrixBigJ(A_offdT) = hypre_TAlloc(HYPRE_BigInt, hypre_CSRMatrixNumNonzeros(A_offdT), + HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::transform, + hypre_CSRMatrixJ(A_offdT), + hypre_CSRMatrixJ(A_offdT) + hypre_CSRMatrixNumNonzeros(A_offdT), + hypre_CSRMatrixBigJ(A_offdT), + [y = hypre_ParCSRMatrixFirstRowIndex(A)] (const auto & x) {return x + y;} ); +#else HYPRE_THRUST_CALL( transform, hypre_CSRMatrixJ(A_offdT), hypre_CSRMatrixJ(A_offdT) + hypre_CSRMatrixNumNonzeros(A_offdT), thrust::make_constant_iterator(hypre_ParCSRMatrixFirstRowIndex(A)), hypre_CSRMatrixBigJ(A_offdT), thrust::plus() ); +#endif + +#if defined(HYPRE_USING_THRUST_NOSYNC) + /* RL: make sure A_offdT is ready before issuing GPU-GPU MPI */ + if (hypre_GetGpuAwareMPI()) + { + hypre_ForceSyncComputeStream(); + } +#endif if (!hypre_ParCSRMatrixCommPkg(A)) { @@ -1335,19 +1518,37 @@ hypre_ParCSRMatrixTransposeDevice( hypre_ParCSRMatrix *A, // Aext contains offd of AT Aext_nnz = hypre_CSRMatrixNumNonzeros(Aext); - Aext_ii = hypreDevice_CsrRowPtrsToIndices(hypre_CSRMatrixNumRows(Aext), Aext_nnz, hypre_CSRMatrixI(Aext)); + Aext_ii = hypreDevice_CsrRowPtrsToIndices(hypre_CSRMatrixNumRows(Aext), Aext_nnz, + hypre_CSRMatrixI(Aext)); hypre_ParCSRCommPkgCopySendMapElmtsToDevice(hypre_ParCSRMatrixCommPkg(A)); +#if defined(HYPRE_USING_SYCL) + hypreSycl_gather( Aext_ii, + Aext_ii + Aext_nnz, + hypre_ParCSRCommPkgDeviceSendMapElmts(hypre_ParCSRMatrixCommPkg(A)), + Aext_ii ); +#else HYPRE_THRUST_CALL( gather, Aext_ii, Aext_ii + Aext_nnz, hypre_ParCSRCommPkgDeviceSendMapElmts(hypre_ParCSRMatrixCommPkg(A)), Aext_ii ); +#endif tmp_bigj = hypre_TAlloc(HYPRE_BigInt, Aext_nnz, HYPRE_MEMORY_DEVICE); - hypre_TMemcpy(tmp_bigj, hypre_CSRMatrixBigJ(Aext), HYPRE_BigInt, Aext_nnz, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(tmp_bigj, hypre_CSRMatrixBigJ(Aext), HYPRE_BigInt, Aext_nnz, HYPRE_MEMORY_DEVICE, + HYPRE_MEMORY_DEVICE); + +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::sort, + tmp_bigj, + tmp_bigj + Aext_nnz ); + HYPRE_BigInt *new_end = HYPRE_ONEDPL_CALL( std::unique, + tmp_bigj, + tmp_bigj + Aext_nnz ); +#else HYPRE_THRUST_CALL( sort, tmp_bigj, tmp_bigj + Aext_nnz ); @@ -1355,21 +1556,32 @@ hypre_ParCSRMatrixTransposeDevice( hypre_ParCSRMatrix *A, HYPRE_BigInt *new_end = HYPRE_THRUST_CALL( unique, tmp_bigj, tmp_bigj + Aext_nnz ); +#endif num_cols_offd_AT = new_end - tmp_bigj; col_map_offd_AT = hypre_TAlloc(HYPRE_BigInt, num_cols_offd_AT, HYPRE_MEMORY_DEVICE); - hypre_TMemcpy(col_map_offd_AT, tmp_bigj, HYPRE_BigInt, num_cols_offd_AT, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(col_map_offd_AT, tmp_bigj, HYPRE_BigInt, num_cols_offd_AT, HYPRE_MEMORY_DEVICE, + HYPRE_MEMORY_DEVICE); hypre_TFree(tmp_bigj, HYPRE_MEMORY_DEVICE); Aext_j = hypre_TAlloc(HYPRE_Int, Aext_nnz, HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( oneapi::dpl::lower_bound, + col_map_offd_AT, + col_map_offd_AT + num_cols_offd_AT, + hypre_CSRMatrixBigJ(Aext), + hypre_CSRMatrixBigJ(Aext) + Aext_nnz, + Aext_j ); +#else HYPRE_THRUST_CALL( lower_bound, col_map_offd_AT, col_map_offd_AT + num_cols_offd_AT, hypre_CSRMatrixBigJ(Aext), hypre_CSRMatrixBigJ(Aext) + Aext_nnz, Aext_j ); +#endif Aext_data = hypre_CSRMatrixData(Aext); hypre_CSRMatrixData(Aext) = NULL; @@ -1381,16 +1593,24 @@ hypre_ParCSRMatrixTransposeDevice( hypre_ParCSRMatrix *A, } else { +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::stable_sort, + oneapi::dpl::make_zip_iterator(Aext_ii, Aext_j), + oneapi::dpl::make_zip_iterator(Aext_ii, Aext_j) + Aext_nnz, + [] (const auto & x, const auto & y) {return std::get<0>(x) < std::get<0>(y);} ); +#else HYPRE_THRUST_CALL( stable_sort, thrust::make_zip_iterator(thrust::make_tuple(Aext_ii, Aext_j)), thrust::make_zip_iterator(thrust::make_tuple(Aext_ii, Aext_j)) + Aext_nnz ); +#endif } AT_offd = hypre_CSRMatrixCreate(hypre_ParCSRMatrixNumCols(A), num_cols_offd_AT, Aext_nnz); hypre_CSRMatrixJ(AT_offd) = Aext_j; hypre_CSRMatrixData(AT_offd) = Aext_data; hypre_CSRMatrixInitialize_v2(AT_offd, 0, HYPRE_MEMORY_DEVICE); - hypreDevice_CsrRowIndicesToPtrs_v2(hypre_CSRMatrixNumRows(AT_offd), Aext_nnz, Aext_ii, hypre_CSRMatrixI(AT_offd)); + hypreDevice_CsrRowIndicesToPtrs_v2(hypre_CSRMatrixNumRows(AT_offd), Aext_nnz, Aext_ii, + hypre_CSRMatrixI(AT_offd)); hypre_TFree(Aext_ii, HYPRE_MEMORY_DEVICE); } else @@ -1447,6 +1667,7 @@ hypre_ParCSRMatrixAddDevice( HYPRE_Complex alpha, HYPRE_Int num_procs; hypre_MPI_Comm_size(hypre_ParCSRMatrixComm(A), &num_procs); + hypre_GpuProfilingPushRange("hypre_ParCSRMatrixAdd"); hypre_CSRMatrix *C_diag = hypre_CSRMatrixAddDevice(alpha, A_diag, beta, B_diag); hypre_CSRMatrix *C_offd; @@ -1457,18 +1678,52 @@ hypre_ParCSRMatrixAddDevice( HYPRE_Complex alpha, hypre_ParCSRMatrixCopyColMapOffdToDevice(A); hypre_ParCSRMatrixCopyColMapOffdToDevice(B); - HYPRE_BigInt *tmp = hypre_TAlloc(HYPRE_BigInt, num_cols_offd_A + num_cols_offd_B, HYPRE_MEMORY_DEVICE); - hypre_TMemcpy(tmp, hypre_ParCSRMatrixDeviceColMapOffd(A), HYPRE_BigInt, num_cols_offd_A, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); - hypre_TMemcpy(tmp + num_cols_offd_A, hypre_ParCSRMatrixDeviceColMapOffd(B), HYPRE_BigInt, num_cols_offd_B, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + HYPRE_BigInt *tmp = hypre_TAlloc(HYPRE_BigInt, num_cols_offd_A + num_cols_offd_B, + HYPRE_MEMORY_DEVICE); + + hypre_TMemcpy(tmp, hypre_ParCSRMatrixDeviceColMapOffd(A), HYPRE_BigInt, + num_cols_offd_A, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(tmp + num_cols_offd_A, hypre_ParCSRMatrixDeviceColMapOffd(B), HYPRE_BigInt, + num_cols_offd_B, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::sort, tmp, tmp + num_cols_offd_A + num_cols_offd_B ); + HYPRE_BigInt *new_end = HYPRE_ONEDPL_CALL( std::unique, tmp, + tmp + num_cols_offd_A + num_cols_offd_B ); +#else HYPRE_THRUST_CALL( sort, tmp, tmp + num_cols_offd_A + num_cols_offd_B ); - HYPRE_BigInt *new_end = HYPRE_THRUST_CALL( unique, tmp, tmp + num_cols_offd_A + num_cols_offd_B ); + HYPRE_BigInt *new_end = HYPRE_THRUST_CALL( unique, tmp, + tmp + num_cols_offd_A + num_cols_offd_B ); +#endif num_cols_offd_C = new_end - tmp; d_col_map_offd_C = hypre_TAlloc(HYPRE_BigInt, num_cols_offd_C, HYPRE_MEMORY_DEVICE); - hypre_TMemcpy(d_col_map_offd_C, tmp, HYPRE_BigInt, num_cols_offd_C, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(d_col_map_offd_C, tmp, HYPRE_BigInt, num_cols_offd_C, HYPRE_MEMORY_DEVICE, + HYPRE_MEMORY_DEVICE); /* reuse memory of tmp */ HYPRE_Int *offd_A2C = (HYPRE_Int *) tmp; HYPRE_Int *offd_B2C = offd_A2C + num_cols_offd_A; +#if defined(HYPRE_USING_SYCL) + /* WM: todo - getting an error when num_cols_offd_A is zero */ + if (num_cols_offd_A > 0) + { + HYPRE_ONEDPL_CALL( oneapi::dpl::lower_bound, + d_col_map_offd_C, + d_col_map_offd_C + num_cols_offd_C, + hypre_ParCSRMatrixDeviceColMapOffd(A), + hypre_ParCSRMatrixDeviceColMapOffd(A) + num_cols_offd_A, + offd_A2C ); + } + /* WM: todo - getting an error when num_cols_offd_B is zero */ + if (num_cols_offd_B > 0) + { + HYPRE_ONEDPL_CALL( oneapi::dpl::lower_bound, + d_col_map_offd_C, + d_col_map_offd_C + num_cols_offd_C, + hypre_ParCSRMatrixDeviceColMapOffd(B), + hypre_ParCSRMatrixDeviceColMapOffd(B) + num_cols_offd_B, + offd_B2C ); + } +#else HYPRE_THRUST_CALL( lower_bound, d_col_map_offd_C, d_col_map_offd_C + num_cols_offd_C, @@ -1481,13 +1736,13 @@ hypre_ParCSRMatrixAddDevice( HYPRE_Complex alpha, hypre_ParCSRMatrixDeviceColMapOffd(B), hypre_ParCSRMatrixDeviceColMapOffd(B) + num_cols_offd_B, offd_B2C ); +#endif HYPRE_Int *C_offd_i, *C_offd_j, nnzC_offd; HYPRE_Complex *C_offd_a; hypreDevice_CSRSpAdd( hypre_CSRMatrixNumRows(A_offd), hypre_CSRMatrixNumRows(B_offd), - num_cols_offd_C, hypre_CSRMatrixNumNonzeros(A_offd), hypre_CSRMatrixNumNonzeros(B_offd), hypre_CSRMatrixI(A_offd), @@ -1521,18 +1776,11 @@ hypre_ParCSRMatrixAddDevice( HYPRE_Complex alpha, } /* Create ParCSRMatrix C */ - HYPRE_BigInt *row_starts_C = hypre_TAlloc(HYPRE_BigInt, 2, HYPRE_MEMORY_HOST); - HYPRE_BigInt *col_starts_C = hypre_TAlloc(HYPRE_BigInt, 2, HYPRE_MEMORY_HOST); - hypre_TMemcpy(row_starts_C, hypre_ParCSRMatrixRowStarts(A), HYPRE_BigInt, 2, - HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); - hypre_TMemcpy(col_starts_C, hypre_ParCSRMatrixColStarts(A), HYPRE_BigInt, 2, - HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); - hypre_ParCSRMatrix *C = hypre_ParCSRMatrixCreate(hypre_ParCSRMatrixComm(A), hypre_ParCSRMatrixGlobalNumRows(A), hypre_ParCSRMatrixGlobalNumCols(A), - row_starts_C, - col_starts_C, + hypre_ParCSRMatrixRowStarts(A), + hypre_ParCSRMatrixColStarts(A), num_cols_offd_C, hypre_CSRMatrixNumNonzeros(C_diag), hypre_CSRMatrixNumNonzeros(C_offd)); @@ -1546,8 +1794,11 @@ hypre_ParCSRMatrixAddDevice( HYPRE_Complex alpha, { hypre_ParCSRMatrixDeviceColMapOffd(C) = d_col_map_offd_C; - hypre_ParCSRMatrixColMapOffd(C) = hypre_TAlloc(HYPRE_BigInt, num_cols_offd_C, HYPRE_MEMORY_HOST); - hypre_TMemcpy(hypre_ParCSRMatrixColMapOffd(C), d_col_map_offd_C, HYPRE_BigInt, num_cols_offd_C, + hypre_ParCSRMatrixColMapOffd(C) = hypre_TAlloc(HYPRE_BigInt, + num_cols_offd_C, + HYPRE_MEMORY_HOST); + hypre_TMemcpy(hypre_ParCSRMatrixColMapOffd(C), d_col_map_offd_C, + HYPRE_BigInt, num_cols_offd_C, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); } @@ -1559,44 +1810,219 @@ hypre_ParCSRMatrixAddDevice( HYPRE_Complex alpha, *C_ptr = C; + hypre_GpuProfilingPopRange(); + return hypre_error_flag; } -#endif // #if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#endif // #if defined(HYPRE_USING_GPU) + +#if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) /*-------------------------------------------------------------------------- - * HYPRE_ParCSRDiagScale + * hypre_ParCSRMatrixDiagScaleDevice *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_ParCSRDiagScale( HYPRE_ParCSRMatrix HA, - HYPRE_ParVector Hy, - HYPRE_ParVector Hx ) +hypre_ParCSRMatrixDiagScaleDevice( hypre_ParCSRMatrix *par_A, + hypre_ParVector *par_ld, + hypre_ParVector *par_rd ) { - hypre_ParCSRMatrix *A = (hypre_ParCSRMatrix *) HA; - hypre_ParVector *y = (hypre_ParVector *) Hy; - hypre_ParVector *x = (hypre_ParVector *) Hx; - HYPRE_Real *x_data = hypre_VectorData(hypre_ParVectorLocalVector(x)); - HYPRE_Real *y_data = hypre_VectorData(hypre_ParVectorLocalVector(y)); - HYPRE_Real *A_data = hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(A)); - HYPRE_Int *A_i = hypre_CSRMatrixI(hypre_ParCSRMatrixDiag(A)); - HYPRE_Int local_size = hypre_VectorSize(hypre_ParVectorLocalVector(x)); - HYPRE_Int ierr = 0; -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - hypreDevice_DiagScaleVector(local_size, A_i, A_data, y_data, 0.0, x_data); - //hypre_SyncCudaComputeStream(hypre_handle()); -#else /* #if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) */ - HYPRE_Int i; + /* Input variables */ + hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(par_A); + hypre_ParCSRCommHandle *comm_handle; + HYPRE_Int num_sends; + HYPRE_Int *d_send_map_elmts; + HYPRE_Int send_map_num_elmts; + + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(par_A); + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(par_A); + HYPRE_Int num_cols_offd = hypre_CSRMatrixNumCols(A_offd); + + hypre_Vector *ld = (par_ld) ? hypre_ParVectorLocalVector(par_ld) : NULL; + hypre_Vector *rd = hypre_ParVectorLocalVector(par_rd); + HYPRE_Complex *rd_data = hypre_VectorData(rd); + + /* Local variables */ + hypre_Vector *rdbuf; + HYPRE_Complex *recv_rdbuf_data; + HYPRE_Complex *send_rdbuf_data; + HYPRE_Int sync_stream; + + /*--------------------------------------------------------------------- + * Setup communication info + *--------------------------------------------------------------------*/ + + hypre_GetSyncCudaCompute(&sync_stream); + hypre_SetSyncCudaCompute(0); + + /* Create buffer vectors */ + rdbuf = hypre_SeqVectorCreate(num_cols_offd); + + /* If there exists no CommPkg for A, create it. */ + if (!comm_pkg) + { + hypre_MatvecCommPkgCreate(par_A); + comm_pkg = hypre_ParCSRMatrixCommPkg(par_A); + } + + /* Communicate a single vector component */ + hypre_ParCSRCommPkgUpdateVecStarts(comm_pkg, + hypre_VectorNumVectors(rd), + hypre_VectorVectorStride(rd), + hypre_VectorIndexStride(rd)); + + /* send_map_elmts on device */ + hypre_ParCSRCommPkgCopySendMapElmtsToDevice(comm_pkg); + + /* Set variables */ + num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); + d_send_map_elmts = hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg); + send_map_num_elmts = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends); + + /*--------------------------------------------------------------------- + * Allocate/reuse receive data buffer + *--------------------------------------------------------------------*/ + + if (!hypre_ParCSRCommPkgTmpData(comm_pkg)) + { + hypre_ParCSRCommPkgTmpData(comm_pkg) = hypre_TAlloc(HYPRE_Complex, + num_cols_offd, + HYPRE_MEMORY_DEVICE); + } + hypre_VectorData(rdbuf) = recv_rdbuf_data = hypre_ParCSRCommPkgTmpData(comm_pkg); + hypre_SeqVectorSetDataOwner(rdbuf, 0); + hypre_SeqVectorInitialize_v2(rdbuf, HYPRE_MEMORY_DEVICE); + + /*--------------------------------------------------------------------- + * Allocate/reuse send data buffer + *--------------------------------------------------------------------*/ + + if (!hypre_ParCSRCommPkgBufData(comm_pkg)) + { + hypre_ParCSRCommPkgBufData(comm_pkg) = hypre_TAlloc(HYPRE_Complex, + send_map_num_elmts, + HYPRE_MEMORY_DEVICE); + } + send_rdbuf_data = hypre_ParCSRCommPkgBufData(comm_pkg); + + /*--------------------------------------------------------------------- + * Pack send data + *--------------------------------------------------------------------*/ + #if defined(HYPRE_USING_DEVICE_OPENMP) -#pragma omp target teams distribute parallel for private(i) is_device_ptr(x_data,y_data,A_data,A_i) -#elif defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + HYPRE_Int i; + + #pragma omp target teams distribute parallel for private(i) is_device_ptr(send_rdbuf_data, rd_data, d_send_map_elmts) + for (i = 0; i < send_map_num_elmts; i++) + { + send_rdbuf_data[i] = rd_data[d_send_map_elmts[i]]; + } +#else +#if defined(HYPRE_USING_SYCL) + auto permuted_source = oneapi::dpl::make_permutation_iterator(rd_data, + d_send_map_elmts); + HYPRE_ONEDPL_CALL( std::copy, + permuted_source, + permuted_source + send_map_num_elmts, + send_rdbuf_data ); +#else + HYPRE_THRUST_CALL( gather, + d_send_map_elmts, + d_send_map_elmts + send_map_num_elmts, + rd_data, + send_rdbuf_data ); +#endif +#endif + + +#if defined(HYPRE_USING_THRUST_NOSYNC) + /* make sure send_rdbuf_data is ready before issuing GPU-GPU MPI */ + if (hypre_GetGpuAwareMPI()) + { + hypre_ForceSyncComputeStream(); + } #endif - for (i = 0; i < local_size; i++) + + /* A_diag = diag(ld) * A_diag * diag(rd) */ + hypre_CSRMatrixDiagScale(A_diag, ld, rd); + + /* Communication phase */ + comm_handle = hypre_ParCSRCommHandleCreate_v2(1, comm_pkg, + HYPRE_MEMORY_DEVICE, send_rdbuf_data, + HYPRE_MEMORY_DEVICE, recv_rdbuf_data); + hypre_ParCSRCommHandleDestroy(comm_handle); + + /* A_offd = diag(ld) * A_offd * diag(rd) */ + hypre_CSRMatrixDiagScale(A_offd, ld, rdbuf); + +#if defined(HYPRE_USING_GPU) + /*--------------------------------------------------------------------- + * Synchronize calls + *--------------------------------------------------------------------*/ + hypre_SetSyncCudaCompute(sync_stream); + hypre_SyncComputeStream(); +#endif + + /* Free memory */ + hypre_SeqVectorDestroy(rdbuf); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * HYPRE_ParCSRDiagScaleVectorDevice + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRDiagScaleVectorDevice( hypre_ParCSRMatrix *par_A, + hypre_ParVector *par_y, + hypre_ParVector *par_x ) +{ + /* Local Matrix and Vectors */ + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(par_A); + hypre_Vector *x = hypre_ParVectorLocalVector(par_x); + hypre_Vector *y = hypre_ParVectorLocalVector(par_y); + + /* Local vector x info */ + HYPRE_Complex *x_data = hypre_VectorData(x); + HYPRE_Int x_size = hypre_VectorSize(x); + HYPRE_Int x_num_vectors = hypre_VectorNumVectors(x); + HYPRE_Int x_vecstride = hypre_VectorVectorStride(x); + + /* Local vector y info */ + HYPRE_Complex *y_data = hypre_VectorData(y); + HYPRE_Int y_size = hypre_VectorSize(y); + HYPRE_Int y_num_vectors = hypre_VectorNumVectors(y); + HYPRE_Int y_vecstride = hypre_VectorVectorStride(y); + + /* Local matrix A info */ + HYPRE_Int num_rows = hypre_CSRMatrixNumRows(A_diag); + HYPRE_Int *A_i = hypre_CSRMatrixI(A_diag); + HYPRE_Complex *A_data = hypre_CSRMatrixData(A_diag); + + /* Sanity checks */ + hypre_assert(x_vecstride == x_size); + hypre_assert(y_vecstride == y_size); + hypre_assert(x_num_vectors == y_num_vectors); + + hypre_GpuProfilingPushRange("ParCSRDiagScaleVector"); + +#if defined(HYPRE_USING_DEVICE_OPENMP) + HYPRE_Int i; + + #pragma omp target teams distribute parallel for private(i) is_device_ptr(x_data,y_data,A_data,A_i) + for (i = 0; i < num_rows; i++) { x_data[i] = y_data[i] / A_data[A_i[i]]; } -#endif /* #if defined(HYPRE_USING_CUDA) */ +#else + hypreDevice_DiagScaleVector(x_num_vectors, num_rows, A_i, A_data, y_data, 0.0, x_data); +#endif // #if defined(HYPRE_USING_DEVICE_OPENMP) + + hypre_GpuProfilingPopRange(); - return ierr; + return hypre_error_flag; } + +#endif // #if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) diff --git a/external/hypre/src/parcsr_mv/par_csr_matop_marked.c b/external/hypre/src/parcsr_mv/par_csr_matop_marked.c index b109a7f9..b6c44e70 100644 --- a/external/hypre/src/parcsr_mv/par_csr_matop_marked.c +++ b/external/hypre/src/parcsr_mv/par_csr_matop_marked.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -23,7 +23,7 @@ void hypre_ParMatmul_RowSizes_Marked( HYPRE_Int num_rows_diag_A, HYPRE_Int num_cols_offd_A, HYPRE_Int allsquare, HYPRE_Int num_cols_diag_B, HYPRE_Int num_cols_offd_B, HYPRE_Int num_cols_offd_C, HYPRE_Int * CF_marker, HYPRE_Int * dof_func, HYPRE_Int * dof_func_offd - ) +) /* Compute row sizes of result of a matrix multiplication A*B. But we only consider rows designated by CF_marker(i)<0 ("Fine" rows). This function is the same as hypre_ParMatmul_RowSizes,but with a little code @@ -49,14 +49,14 @@ void hypre_ParMatmul_RowSizes_Marked( first_col_diag_B, n_cols_B, num_cols_offd_B, num_cols_diag_B */ - *C_diag_i = hypre_CTAlloc(HYPRE_Int, num_rows_diag_A+1, HYPRE_MEMORY_HOST); - *C_offd_i = hypre_CTAlloc(HYPRE_Int, num_rows_diag_A+1, HYPRE_MEMORY_HOST); + *C_diag_i = hypre_CTAlloc(HYPRE_Int, num_rows_diag_A + 1, HYPRE_MEMORY_HOST); + *C_offd_i = hypre_CTAlloc(HYPRE_Int, num_rows_diag_A + 1, HYPRE_MEMORY_HOST); /* ... CTAlloc initializes to 0, so entries ignored due to CF_marker will be returned as 0 */ jj_count_diag = start_indexing; jj_count_offd = start_indexing; - for (i1 = 0; i1 < num_cols_diag_B+num_cols_offd_C; i1++) + for (i1 = 0; i1 < num_cols_diag_B + num_cols_offd_C; i1++) { (*B_marker)[i1] = -1; } @@ -75,8 +75,8 @@ void hypre_ParMatmul_RowSizes_Marked( /* To make the C row i1 the same size as the B row i1: */ jj_row_begin_diag = jj_count_diag; jj_row_begin_offd = jj_count_offd; - jj_count_diag += B_diag_i[i1+1] - B_diag_i[i1]; - jj_count_offd += B_offd_i[i1+1] - B_offd_i[i1]; + jj_count_diag += B_diag_i[i1 + 1] - B_diag_i[i1]; + jj_count_offd += B_offd_i[i1 + 1] - B_offd_i[i1]; (*C_diag_i)[i1] = jj_row_begin_diag; (*C_offd_i)[i1] = jj_row_begin_offd; } @@ -92,7 +92,8 @@ void hypre_ParMatmul_RowSizes_Marked( jj_row_begin_diag = jj_count_diag; jj_row_begin_offd = jj_count_offd; - if ( allsquare ) { + if ( allsquare ) + { (*B_marker)[i1] = jj_count_diag; jj_count_diag++; } @@ -103,19 +104,20 @@ void hypre_ParMatmul_RowSizes_Marked( if (num_cols_offd_A) { - for (jj2 = A_offd_i[i1]; jj2 < A_offd_i[i1+1]; jj2++) + for (jj2 = A_offd_i[i1]; jj2 < A_offd_i[i1 + 1]; jj2++) { i2 = A_offd_j[jj2]; - if ( dof_func==NULL || dof_func[i1] == dof_func_offd[i2] ) - {/* interpolate only like "functions" */ + if ( dof_func == NULL || dof_func[i1] == dof_func_offd[i2] ) + { + /* interpolate only like "functions" */ /*----------------------------------------------------------- * Loop over entries in row i2 of B_ext. *-----------------------------------------------------------*/ - for (jj3 = B_ext_offd_i[i2]; jj3 < B_ext_offd_i[i2+1]; jj3++) + for (jj3 = B_ext_offd_i[i2]; jj3 < B_ext_offd_i[i2 + 1]; jj3++) { - i3 = num_cols_diag_B+B_ext_offd_j[jj3]; + i3 = num_cols_diag_B + B_ext_offd_j[jj3]; /*-------------------------------------------------------- * Check B_marker to see that C_{i1,i3} has not already @@ -129,7 +131,7 @@ void hypre_ParMatmul_RowSizes_Marked( jj_count_offd++; } } - for (jj3 = B_ext_diag_i[i2]; jj3 < B_ext_diag_i[i2+1]; jj3++) + for (jj3 = B_ext_diag_i[i2]; jj3 < B_ext_diag_i[i2 + 1]; jj3++) { i3 = B_ext_diag_j[jj3]; @@ -146,17 +148,18 @@ void hypre_ParMatmul_RowSizes_Marked( * Loop over entries in row i1 of A_diag. *-----------------------------------------------------------------*/ - for (jj2 = A_diag_i[i1]; jj2 < A_diag_i[i1+1]; jj2++) + for (jj2 = A_diag_i[i1]; jj2 < A_diag_i[i1 + 1]; jj2++) { i2 = A_diag_j[jj2]; - if( dof_func==NULL || dof_func[i1] == dof_func[i2] ) - { /* interpolate only like "functions" */ + if ( dof_func == NULL || dof_func[i1] == dof_func[i2] ) + { + /* interpolate only like "functions" */ /*----------------------------------------------------------- * Loop over entries in row i2 of B_diag. *-----------------------------------------------------------*/ - for (jj3 = B_diag_i[i2]; jj3 < B_diag_i[i2+1]; jj3++) + for (jj3 = B_diag_i[i2]; jj3 < B_diag_i[i2 + 1]; jj3++) { i3 = B_diag_j[jj3]; @@ -178,9 +181,9 @@ void hypre_ParMatmul_RowSizes_Marked( if (num_cols_offd_B) { - for (jj3 = B_offd_i[i2]; jj3 < B_offd_i[i2+1]; jj3++) + for (jj3 = B_offd_i[i2]; jj3 < B_offd_i[i2 + 1]; jj3++) { - i3 = num_cols_diag_B+map_B_to_C[B_offd_j[jj3]]; + i3 = num_cols_diag_B + map_B_to_C[B_offd_j[jj3]]; /*-------------------------------------------------------- * Check B_marker to see that C_{i1,i3} has not already @@ -284,7 +287,7 @@ hypre_ParCSRMatrix * hypre_ParMatmul_FC( hypre_ParCSRMatrix *C; HYPRE_BigInt *col_map_offd_C; - HYPRE_Int *map_P_to_C; + HYPRE_Int *map_P_to_C = NULL; hypre_CSRMatrix *C_diag; @@ -294,26 +297,26 @@ hypre_ParCSRMatrix * hypre_ParMatmul_FC( hypre_CSRMatrix *C_offd; - HYPRE_Complex *C_offd_data=NULL; - HYPRE_Int *C_offd_i=NULL; - HYPRE_Int *C_offd_j=NULL; + HYPRE_Complex *C_offd_data = NULL; + HYPRE_Int *C_offd_i = NULL; + HYPRE_Int *C_offd_j = NULL; HYPRE_Int C_diag_size; HYPRE_Int C_offd_size; HYPRE_Int num_cols_offd_C = 0; - hypre_CSRMatrix *Ps_ext; + hypre_CSRMatrix *Ps_ext = NULL; - HYPRE_Complex *Ps_ext_data; - HYPRE_Int *Ps_ext_i; - HYPRE_BigInt *Ps_ext_j; + HYPRE_Complex *Ps_ext_data = NULL; + HYPRE_Int *Ps_ext_i = NULL; + HYPRE_BigInt *Ps_ext_j = NULL; - HYPRE_Complex *P_ext_diag_data; + HYPRE_Complex *P_ext_diag_data = NULL; HYPRE_Int *P_ext_diag_i; - HYPRE_Int *P_ext_diag_j; + HYPRE_Int *P_ext_diag_j = NULL; HYPRE_Int P_ext_diag_size; - HYPRE_Complex *P_ext_offd_data; + HYPRE_Complex *P_ext_offd_data = NULL; HYPRE_Int *P_ext_offd_i; HYPRE_Int *P_ext_offd_j = NULL; HYPRE_BigInt *P_ext_tmp_j = NULL; @@ -365,26 +368,30 @@ hypre_ParCSRMatrix * hypre_ParMatmul_FC( * equally load balanced partitionings within * hypre_ParCSRMatrixExtractBExt *--------------------------------------------------------------------*/ - Ps_ext = hypre_ParCSRMatrixExtractBExt(P,A,1); + Ps_ext = hypre_ParCSRMatrixExtractBExt(P, A, 1); Ps_ext_data = hypre_CSRMatrixData(Ps_ext); Ps_ext_i = hypre_CSRMatrixI(Ps_ext); Ps_ext_j = hypre_CSRMatrixBigJ(Ps_ext); } - P_ext_diag_i = hypre_CTAlloc(HYPRE_Int, num_cols_offd_A+1, HYPRE_MEMORY_HOST); - P_ext_offd_i = hypre_CTAlloc(HYPRE_Int, num_cols_offd_A+1, HYPRE_MEMORY_HOST); + P_ext_diag_i = hypre_CTAlloc(HYPRE_Int, num_cols_offd_A + 1, HYPRE_MEMORY_HOST); + P_ext_offd_i = hypre_CTAlloc(HYPRE_Int, num_cols_offd_A + 1, HYPRE_MEMORY_HOST); P_ext_diag_size = 0; P_ext_offd_size = 0; - last_col_diag_P = first_col_diag_P + num_cols_diag_P -1; + last_col_diag_P = first_col_diag_P + num_cols_diag_P - 1; - for (i=0; i < num_cols_offd_A; i++) + for (i = 0; i < num_cols_offd_A; i++) { - for (j=Ps_ext_i[i]; j < Ps_ext_i[i+1]; j++) + for (j = Ps_ext_i[i]; j < Ps_ext_i[i + 1]; j++) if (Ps_ext_j[j] < first_col_diag_P || Ps_ext_j[j] > last_col_diag_P) + { P_ext_offd_size++; + } else + { P_ext_diag_size++; - P_ext_diag_i[i+1] = P_ext_diag_size; - P_ext_offd_i[i+1] = P_ext_offd_size; + } + P_ext_diag_i[i + 1] = P_ext_diag_size; + P_ext_offd_i[i + 1] = P_ext_offd_size; } if (P_ext_diag_size) @@ -401,9 +408,9 @@ hypre_ParCSRMatrix * hypre_ParMatmul_FC( cnt_offd = 0; cnt_diag = 0; - for (i=0; i < num_cols_offd_A; i++) + for (i = 0; i < num_cols_offd_A; i++) { - for (j=Ps_ext_i[i]; j < Ps_ext_i[i+1]; j++) + for (j = Ps_ext_i[i]; j < Ps_ext_i[i + 1]; j++) if (Ps_ext_j[j] < first_col_diag_P || Ps_ext_j[j] > last_col_diag_P) { P_ext_tmp_j[cnt_offd] = Ps_ext_j[j]; @@ -426,20 +433,24 @@ hypre_ParCSRMatrix * hypre_ParMatmul_FC( cnt = 0; if (P_ext_offd_size || num_cols_offd_P) { - temp = hypre_CTAlloc(HYPRE_BigInt, P_ext_offd_size+num_cols_offd_P, HYPRE_MEMORY_HOST); - for (i=0; i < P_ext_offd_size; i++) + temp = hypre_CTAlloc(HYPRE_BigInt, P_ext_offd_size + num_cols_offd_P, HYPRE_MEMORY_HOST); + for (i = 0; i < P_ext_offd_size; i++) + { temp[i] = P_ext_offd_j[i]; + } cnt = P_ext_offd_size; - for (i=0; i < num_cols_offd_P; i++) + for (i = 0; i < num_cols_offd_P; i++) + { temp[cnt++] = col_map_offd_P[i]; + } } if (cnt) { - hypre_BigQsort0(temp, 0, cnt-1); + hypre_BigQsort0(temp, 0, cnt - 1); num_cols_offd_C = 1; value = temp[0]; - for (i=1; i < cnt; i++) + for (i = 1; i < cnt; i++) { if (temp[i] > value) { @@ -449,45 +460,52 @@ hypre_ParCSRMatrix * hypre_ParMatmul_FC( } } - if (num_cols_offd_C) - col_map_offd_C = hypre_CTAlloc(HYPRE_BigInt, num_cols_offd_C, HYPRE_MEMORY_HOST); - - for (i=0; i < num_cols_offd_C; i++) + col_map_offd_C = hypre_CTAlloc(HYPRE_BigInt, num_cols_offd_C, HYPRE_MEMORY_HOST); + for (i = 0; i < num_cols_offd_C; i++) + { col_map_offd_C[i] = temp[i]; + } if (P_ext_offd_size || num_cols_offd_P) + { hypre_TFree(temp, HYPRE_MEMORY_HOST); + } - for (i=0 ; i < P_ext_offd_size; i++) + for (i = 0; i < P_ext_offd_size; i++) + { P_ext_offd_j[i] = hypre_BigBinarySearch(col_map_offd_C, - Ps_ext_j[i], - num_cols_offd_C); + Ps_ext_j[i], + num_cols_offd_C); + } + if (num_cols_offd_P) { map_P_to_C = hypre_CTAlloc(HYPRE_Int, num_cols_offd_P, HYPRE_MEMORY_HOST); cnt = 0; - for (i=0; i < num_cols_offd_C; i++) + for (i = 0; i < num_cols_offd_C; i++) + { if (col_map_offd_C[i] == col_map_offd_P[cnt]) { map_P_to_C[cnt++] = i; - if (cnt == num_cols_offd_P) break; + if (cnt == num_cols_offd_P) { break; } } + } } - if (num_procs > 1) hypre_CSRMatrixDestroy(Ps_ext); + if (num_procs > 1) { hypre_CSRMatrixDestroy(Ps_ext); } /*----------------------------------------------------------------------- * Allocate marker array. *-----------------------------------------------------------------------*/ - P_marker = hypre_CTAlloc(HYPRE_Int, num_cols_diag_P+num_cols_offd_C, HYPRE_MEMORY_HOST); + P_marker = hypre_CTAlloc(HYPRE_Int, num_cols_diag_P + num_cols_offd_C, HYPRE_MEMORY_HOST); /*----------------------------------------------------------------------- * Initialize some stuff. *-----------------------------------------------------------------------*/ - for (i1 = 0; i1 < num_cols_diag_P+num_cols_offd_C; i1++) + for (i1 = 0; i1 < num_cols_diag_P + num_cols_offd_C; i1++) { P_marker[i1] = -1; } @@ -505,7 +523,7 @@ hypre_ParCSRMatrix * hypre_ParMatmul_FC( num_rows_diag_A, num_cols_offd_A, allsquare, num_cols_diag_P, num_cols_offd_P, num_cols_offd_C, CF_marker, dof_func, dof_func_offd - ); + ); /* The above call of hypre_ParMatmul_RowSizes_Marked computed two scalars: C_diag_size, C_offd_size, @@ -539,7 +557,7 @@ hypre_ParCSRMatrix * hypre_ParMatmul_FC( jj_count_diag = start_indexing; jj_count_offd = start_indexing; - for (i1 = 0; i1 < num_cols_diag_P+num_cols_offd_C; i1++) + for (i1 = 0; i1 < num_cols_diag_P + num_cols_offd_C; i1++) { P_marker[i1] = -1; } @@ -570,20 +588,21 @@ hypre_ParCSRMatrix * hypre_ParMatmul_FC( if (num_cols_offd_A) { - for (jj2 = A_offd_i[i1]; jj2 < A_offd_i[i1+1]; jj2++) + for (jj2 = A_offd_i[i1]; jj2 < A_offd_i[i1 + 1]; jj2++) { i2 = A_offd_j[jj2]; - if( dof_func==NULL || dof_func[i1] == dof_func_offd[i2] ) - { /* interpolate only like "functions" */ + if ( dof_func == NULL || dof_func[i1] == dof_func_offd[i2] ) + { + /* interpolate only like "functions" */ a_entry = A_offd_data[jj2]; /*----------------------------------------------------------- * Loop over entries in row i2 of P_ext. *-----------------------------------------------------------*/ - for (jj3 = P_ext_offd_i[i2]; jj3 < P_ext_offd_i[i2+1]; jj3++) + for (jj3 = P_ext_offd_i[i2]; jj3 < P_ext_offd_i[i2 + 1]; jj3++) { - i3 = num_cols_diag_P+P_ext_offd_j[jj3]; + i3 = num_cols_diag_P + P_ext_offd_j[jj3]; a_b_product = a_entry * P_ext_offd_data[jj3]; /*-------------------------------------------------------- @@ -595,13 +614,15 @@ hypre_ParCSRMatrix * hypre_ParMatmul_FC( { P_marker[i3] = jj_count_offd; C_offd_data[jj_count_offd] = a_b_product; - C_offd_j[jj_count_offd] = i3-num_cols_diag_P; + C_offd_j[jj_count_offd] = i3 - num_cols_diag_P; jj_count_offd++; } else + { C_offd_data[P_marker[i3]] += a_b_product; + } } - for (jj3 = P_ext_diag_i[i2]; jj3 < P_ext_diag_i[i2+1]; jj3++) + for (jj3 = P_ext_diag_i[i2]; jj3 < P_ext_diag_i[i2 + 1]; jj3++) { i3 = P_ext_diag_j[jj3]; a_b_product = a_entry * P_ext_diag_data[jj3]; @@ -614,11 +635,14 @@ hypre_ParCSRMatrix * hypre_ParMatmul_FC( jj_count_diag++; } else + { C_diag_data[P_marker[i3]] += a_b_product; + } } } else - { /* Interpolation mat should be 0 where i1 and i2 correspond to + { + /* Interpolation mat should be 0 where i1 and i2 correspond to different "functions". As we haven't created an entry for C(i1,i2), nothing needs to be done. */ } @@ -630,18 +654,19 @@ hypre_ParCSRMatrix * hypre_ParMatmul_FC( * Loop over entries in row i1 of A_diag. *-----------------------------------------------------------------*/ - for (jj2 = A_diag_i[i1]; jj2 < A_diag_i[i1+1]; jj2++) + for (jj2 = A_diag_i[i1]; jj2 < A_diag_i[i1 + 1]; jj2++) { i2 = A_diag_j[jj2]; - if( dof_func==NULL || dof_func[i1] == dof_func[i2] ) - { /* interpolate only like "functions" */ + if ( dof_func == NULL || dof_func[i1] == dof_func[i2] ) + { + /* interpolate only like "functions" */ a_entry = A_diag_data[jj2]; /*----------------------------------------------------------- * Loop over entries in row i2 of P_diag. *-----------------------------------------------------------*/ - for (jj3 = P_diag_i[i2]; jj3 < P_diag_i[i2+1]; jj3++) + for (jj3 = P_diag_i[i2]; jj3 < P_diag_i[i2 + 1]; jj3++) { i3 = P_diag_j[jj3]; a_b_product = a_entry * P_diag_data[jj3]; @@ -666,9 +691,9 @@ hypre_ParCSRMatrix * hypre_ParMatmul_FC( } if (num_cols_offd_P) { - for (jj3 = P_offd_i[i2]; jj3 < P_offd_i[i2+1]; jj3++) + for (jj3 = P_offd_i[i2]; jj3 < P_offd_i[i2 + 1]; jj3++) { - i3 = num_cols_diag_P+map_P_to_C[P_offd_j[jj3]]; + i3 = num_cols_diag_P + map_P_to_C[P_offd_j[jj3]]; a_b_product = a_entry * P_offd_data[jj3]; /*-------------------------------------------------------- @@ -681,7 +706,7 @@ hypre_ParCSRMatrix * hypre_ParMatmul_FC( { P_marker[i3] = jj_count_offd; C_offd_data[jj_count_offd] = a_b_product; - C_offd_j[jj_count_offd] = i3-num_cols_diag_P; + C_offd_j[jj_count_offd] = i3 - num_cols_diag_P; jj_count_offd++; } else @@ -692,7 +717,8 @@ hypre_ParCSRMatrix * hypre_ParMatmul_FC( } } else - { /* Interpolation mat should be 0 where i1 and i2 correspond to + { + /* Interpolation mat should be 0 where i1 and i2 correspond to different "functions". As we haven't created an entry for C(i1,i2), nothing needs to be done. */ } @@ -704,14 +730,14 @@ hypre_ParCSRMatrix * hypre_ParMatmul_FC( { if (num_cols_offd_P) { - for (jj2 = P_offd_i[i1]; jj2 < P_offd_i[i1+1]; jj2++) + for (jj2 = P_offd_i[i1]; jj2 < P_offd_i[i1 + 1]; jj2++) { C_offd_j[jj_count_offd] = P_offd_j[jj_count_offd]; C_offd_data[jj_count_offd] = P_offd_data[jj_count_offd]; ++jj_count_offd; } } - for (jj2 = P_diag_i[i1]; jj2 < P_diag_i[i1+1]; jj2++) + for (jj2 = P_diag_i[i1]; jj2 < P_diag_i[i1 + 1]; jj2++) { C_diag_j[jj_count_diag] = P_diag_j[jj2]; C_diag_data[jj_count_diag] = P_diag_data[jj2]; @@ -721,8 +747,8 @@ hypre_ParCSRMatrix * hypre_ParMatmul_FC( } C = hypre_ParCSRMatrixCreate( - comm, n_rows_A_global, n_cols_P_global, - row_starts_A, col_starts_P, num_cols_offd_C, C_diag_size, C_offd_size ); + comm, n_rows_A_global, n_cols_P_global, + row_starts_A, col_starts_P, num_cols_offd_C, C_diag_size, C_offd_size ); C_diag = hypre_ParCSRMatrixDiag(C); hypre_CSRMatrixData(C_diag) = C_diag_data; @@ -757,7 +783,7 @@ hypre_ParCSRMatrix * hypre_ParMatmul_FC( hypre_TFree(P_ext_offd_j, HYPRE_MEMORY_HOST); hypre_TFree(P_ext_offd_data, HYPRE_MEMORY_HOST); } - if (num_cols_offd_P) hypre_TFree(map_P_to_C, HYPRE_MEMORY_HOST); + if (num_cols_offd_P) { hypre_TFree(map_P_to_C, HYPRE_MEMORY_HOST); } return C; @@ -816,10 +842,10 @@ void hypre_ParMatScaleDiagInv_F( * Loop over A_diag data *-----------------------------------------------------------------*/ - for (jj2 = A_diag_i[i1]; jj2 < A_diag_i[i1+1]; jj2++) + for (jj2 = A_diag_i[i1]; jj2 < A_diag_i[i1 + 1]; jj2++) { i2 = A_diag_j[jj2]; - if ( i1==i2 ) /* diagonal of A only */ + if ( i1 == i2 ) /* diagonal of A only */ { a_entry = A_diag_data[jj2] * weight; @@ -827,7 +853,7 @@ void hypre_ParMatScaleDiagInv_F( * Loop over entries in current row of C_diag. *-----------------------------------------------------------*/ - for (jj3 = C_diag_i[i2]; jj3 < C_diag_i[i2+1]; jj3++) + for (jj3 = C_diag_i[i2]; jj3 < C_diag_i[i2 + 1]; jj3++) { C_diag_data[jj3] = C_diag_data[jj3] / a_entry; @@ -839,7 +865,7 @@ void hypre_ParMatScaleDiagInv_F( if ( num_cols_offd_C ) { - for (jj3 = C_offd_i[i2]; jj3 < C_offd_i[i2+1]; jj3++) + for (jj3 = C_offd_i[i2]; jj3 < C_offd_i[i2 + 1]; jj3++) { C_offd_data[jj3] = C_offd_data[jj3] / a_entry; } @@ -943,35 +969,35 @@ hypre_ParCSRMatrix * hypre_ParMatMinus_F( algorithm I'm using for the offd block is really any slower than the more complicated "linear" algorithm here. */ jrange = 0; - jrangem1=-1; + jrangem1 = -1; for ( i1 = 0; i1 < num_rows_diag_C; i1++ ) { /* only Fine rows matter */ - if ( CF_marker[i1]<0 && hypre_CSRMatrixNumNonzeros(Pnew_diag)>0 ) + if ( CF_marker[i1] < 0 && hypre_CSRMatrixNumNonzeros(Pnew_diag) > 0 ) { jmin = Pnew_diag_j[ Pnew_diag_i[i1] ]; - jmax = Pnew_diag_j[ Pnew_diag_i[i1+1]-1 ]; - jrangem1 = jmax-jmin; - jrange = hypre_max(jrange,jrangem1+1); + jmax = Pnew_diag_j[ Pnew_diag_i[i1 + 1] - 1 ]; + jrangem1 = jmax - jmin; + jrange = hypre_max(jrange, jrangem1 + 1); /* If columns (of a given row) were in increasing order, the above would be sufficient. If not, the following would be necessary (and sufficient) */ jmin = Pnew_diag_j[ Pnew_diag_i[i1] ]; jmax = Pnew_diag_j[ Pnew_diag_i[i1] ]; - for ( m=Pnew_diag_i[i1]+1; m0 ) + if ( CF_marker[i1] < 0 && hypre_CSRMatrixNumNonzeros(Pnew_diag) > 0 ) { /* just needed for an assertion below... */ - for ( j=0; j=0 ); - hypre_assert( j-jmin= 0 ); + hypre_assert( j - jmin < jrange ); + Pnew_j2m[ j - jmin ] = m; } /*----------------------------------------------------------------------- @@ -1017,12 +1043,12 @@ hypre_ParCSRMatrix * hypre_ParMatMinus_F( * Subtract each C data entry from the corresponding Pnew entry. *-----------------------------------------------------------------------*/ - for ( mc=C_diag_i[i1]; mc=0 ); + m = Pnew_j2m[jc - jmin]; + hypre_assert( m >= 0 ); Pnew_diag_data[m] -= dc; } @@ -1031,12 +1057,12 @@ hypre_ParCSRMatrix * hypre_ParMatMinus_F( * Add each P data entry from the corresponding Pnew entry. *-----------------------------------------------------------------------*/ - for ( mp=P_diag_i[i1]; mp=0 ); + m = Pnew_j2m[jp - jmin]; + hypre_assert( m >= 0 ); Pnew_diag_data[m] += dp; } } @@ -1049,30 +1075,30 @@ hypre_ParCSRMatrix * hypre_ParMatMinus_F( for ( i1 = 0; i1 < num_rows_offd_Pnew; i1++ ) { /* Fine data only */ - if ( CF_marker[i1]<0 && hypre_CSRMatrixNumNonzeros(Pnew_offd)>0 ) + if ( CF_marker[i1] < 0 && hypre_CSRMatrixNumNonzeros(Pnew_offd) > 0 ) { if ( num_cols_offd_Pnew ) { /* This is a simple quadratic algorithm. If necessary I may try to implement the ideas used on the diag block later. */ - for ( m = Pnew_offd_i[i1]; m= 0 ) /* Coarse rows only */ { - for ( m=C_diag_i[i1]; m= 0 ) /* Coarse rows only */ { - for ( m=C_offd_i[i1]; m=0) are always kept. The arrays are not re-allocated, so there will generally be unused space at the ends of the arrays. */ - new_C_diag_i = hypre_CTAlloc( HYPRE_Int, num_rows_diag_C+1 , HYPRE_MEMORY_HOST); - new_C_offd_i = hypre_CTAlloc( HYPRE_Int, num_rows_offd_C+1 , HYPRE_MEMORY_HOST); + new_C_diag_i = hypre_CTAlloc( HYPRE_Int, num_rows_diag_C + 1, HYPRE_MEMORY_HOST); + new_C_offd_i = hypre_CTAlloc( HYPRE_Int, num_rows_offd_C + 1, HYPRE_MEMORY_HOST); m1d = C_diag_i[0]; m1o = C_offd_i[0]; for ( i1 = 0; i1 < num_rows_diag_C; i1++ ) { old_sum = 0; new_sum = 0; - for ( m=C_diag_i[i1]; m=0 || keep==1 ) - { /* keep v in C */ + if ( CF_marker[i1] >= 0 || keep == 1 ) + { + /* keep v in C */ new_sum += v; C_diag_j[m1d] = C_diag_j[m]; C_diag_data[m1d] = C_diag_data[m]; ++m1d; } else - { /* discard v */ + { + /* discard v */ --num_nonzeros_diag; } } - for ( m=C_offd_i[i1]; m=0 || v>=vmax || v<=vmin ) /* RDF: Always true!? */ - { /* keep v in C */ + if ( CF_marker[i1] >= 0 || v >= vmax || v <= vmin ) /* RDF: Always true!? */ + { + /* keep v in C */ new_sum += v; C_offd_j[m1o] = C_offd_j[m]; C_offd_data[m1o] = C_offd_data[m]; ++m1o; } else - { /* discard v */ + { + /* discard v */ --num_nonzeros_offd; } } - new_C_diag_i[i1+1] = m1d; - if ( i10 ) hypre_TFree( new_C_offd_i , HYPRE_MEMORY_HOST); + hypre_TFree( new_C_diag_i, HYPRE_MEMORY_HOST); + if ( num_rows_offd_C > 0 ) { hypre_TFree( new_C_offd_i, HYPRE_MEMORY_HOST); } hypre_CSRMatrixNumNonzeros(C_diag) = num_nonzeros_diag; hypre_CSRMatrixNumNonzeros(C_offd) = num_nonzeros_offd; diff --git a/external/hypre/src/parcsr_mv/par_csr_matrix.c b/external/hypre/src/parcsr_mv/par_csr_matrix.c index 34699f0e..620f0c5f 100644 --- a/external/hypre/src/parcsr_mv/par_csr_matrix.c +++ b/external/hypre/src/parcsr_mv/par_csr_matrix.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -22,7 +22,8 @@ accessor functions become proper functions at some later date, this will not be necessary. AJC 4/99 */ -HYPRE_Int hypre_FillResponseParToCSRMatrix(void*, HYPRE_Int, HYPRE_Int, void*, MPI_Comm, void**, HYPRE_Int*); +HYPRE_Int hypre_FillResponseParToCSRMatrix(void*, HYPRE_Int, HYPRE_Int, void*, MPI_Comm, void**, + HYPRE_Int*); /*-------------------------------------------------------------------------- * hypre_ParCSRMatrixCreate @@ -52,8 +53,8 @@ hypre_ParCSRMatrixCreate( MPI_Comm comm, matrix = hypre_CTAlloc(hypre_ParCSRMatrix, 1, HYPRE_MEMORY_HOST); - hypre_MPI_Comm_rank(comm,&my_id); - hypre_MPI_Comm_size(comm,&num_procs); + hypre_MPI_Comm_rank(comm, &my_id); + hypre_MPI_Comm_size(comm, &num_procs); if (!row_starts_in) { @@ -94,6 +95,8 @@ hypre_ParCSRMatrixCreate( MPI_Comm comm, hypre_ParCSRMatrixGlobalNumRows(matrix) = global_num_rows; hypre_ParCSRMatrixGlobalNumCols(matrix) = global_num_cols; hypre_ParCSRMatrixGlobalNumRownnz(matrix) = global_num_rows; + hypre_ParCSRMatrixNumNonzeros(matrix) = -1; /* Uninitialized */ + hypre_ParCSRMatrixDNumNonzeros(matrix) = -1.0; /* Uninitialized */ hypre_ParCSRMatrixFirstRowIndex(matrix) = first_row_index; hypre_ParCSRMatrixFirstColDiag(matrix) = first_col_diag; hypre_ParCSRMatrixLastRowIndex(matrix) = first_row_index + local_num_rows - 1; @@ -124,7 +127,7 @@ hypre_ParCSRMatrixCreate( MPI_Comm comm, matrix->bdiaginv_comm_pkg = NULL; matrix->bdiag_size = -1; -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) hypre_ParCSRMatrixSocDiagJ(matrix) = NULL; hypre_ParCSRMatrixSocOffdJ(matrix) = NULL; #endif @@ -184,7 +187,8 @@ hypre_ParCSRMatrixDestroy( hypre_ParCSRMatrix *matrix ) hypre_TFree(hypre_ParCSRMatrixRowindices(matrix), memory_location); hypre_TFree(hypre_ParCSRMatrixRowvalues(matrix), memory_location); - if ( hypre_ParCSRMatrixAssumedPartition(matrix) && hypre_ParCSRMatrixOwnsAssumedPartition(matrix) ) + if ( hypre_ParCSRMatrixAssumedPartition(matrix) && + hypre_ParCSRMatrixOwnsAssumedPartition(matrix) ) { hypre_AssumedPartitionDestroy(hypre_ParCSRMatrixAssumedPartition(matrix)); } @@ -200,7 +204,7 @@ hypre_ParCSRMatrixDestroy( hypre_ParCSRMatrix *matrix ) hypre_MatvecCommPkgDestroy(matrix->bdiaginv_comm_pkg); } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) hypre_TFree(hypre_ParCSRMatrixSocDiagJ(matrix), HYPRE_MEMORY_DEVICE); hypre_TFree(hypre_ParCSRMatrixSocOffdJ(matrix), HYPRE_MEMORY_DEVICE); #endif @@ -212,11 +216,12 @@ hypre_ParCSRMatrixDestroy( hypre_ParCSRMatrix *matrix ) } /*-------------------------------------------------------------------------- - * hypre_ParCSRMatrixInitialize + * hypre_ParCSRMatrixInitialize_v2 *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_ParCSRMatrixInitialize_v2( hypre_ParCSRMatrix *matrix, HYPRE_MemoryLocation memory_location ) +hypre_ParCSRMatrixInitialize_v2( hypre_ParCSRMatrix *matrix, + HYPRE_MemoryLocation memory_location ) { if (!matrix) { @@ -228,12 +233,17 @@ hypre_ParCSRMatrixInitialize_v2( hypre_ParCSRMatrix *matrix, HYPRE_MemoryLocatio hypre_CSRMatrixInitialize_v2(hypre_ParCSRMatrixOffd(matrix), 0, memory_location); hypre_ParCSRMatrixColMapOffd(matrix) = - hypre_CTAlloc(HYPRE_BigInt, hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(matrix)), + hypre_CTAlloc(HYPRE_BigInt, + hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(matrix)), HYPRE_MEMORY_HOST); return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixInitialize + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_ParCSRMatrixInitialize( hypre_ParCSRMatrix *matrix ) { @@ -248,10 +258,14 @@ hypre_ParCSRMatrixInitialize( hypre_ParCSRMatrix *matrix ) *--------------------------------------------------------------------------*/ hypre_ParCSRMatrix* -hypre_ParCSRMatrixClone_v2(hypre_ParCSRMatrix *A, HYPRE_Int copy_data, HYPRE_MemoryLocation memory_location) +hypre_ParCSRMatrixClone_v2(hypre_ParCSRMatrix *A, + HYPRE_Int copy_data, + HYPRE_MemoryLocation memory_location) { hypre_ParCSRMatrix *S; + hypre_GpuProfilingPushRange("hypre_ParCSRMatrixClone"); + S = hypre_ParCSRMatrixCreate( hypre_ParCSRMatrixComm(A), hypre_ParCSRMatrixGlobalNumRows(A), hypre_ParCSRMatrixGlobalNumCols(A), @@ -268,17 +282,28 @@ hypre_ParCSRMatrixClone_v2(hypre_ParCSRMatrix *A, HYPRE_Int copy_data, HYPRE_Mem hypre_ParCSRMatrixCopy(A, S, copy_data); + hypre_GpuProfilingPopRange(); + return S; } +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixClone + *--------------------------------------------------------------------------*/ + hypre_ParCSRMatrix* hypre_ParCSRMatrixClone(hypre_ParCSRMatrix *A, HYPRE_Int copy_data) { return hypre_ParCSRMatrixClone_v2(A, copy_data, hypre_ParCSRMatrixMemoryLocation(A)); } +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixMigrate + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ParCSRMatrixMigrate(hypre_ParCSRMatrix *A, HYPRE_MemoryLocation memory_location) +hypre_ParCSRMatrixMigrate(hypre_ParCSRMatrix *A, + HYPRE_MemoryLocation memory_location) { if (!A) { @@ -287,30 +312,27 @@ hypre_ParCSRMatrixMigrate(hypre_ParCSRMatrix *A, HYPRE_MemoryLocation memory_loc HYPRE_MemoryLocation old_memory_location = hypre_ParCSRMatrixMemoryLocation(A); - if ( hypre_GetActualMemLocation(memory_location) != hypre_GetActualMemLocation(old_memory_location) ) - { - hypre_CSRMatrix *A_diag = hypre_CSRMatrixClone_v2(hypre_ParCSRMatrixDiag(A), 1, memory_location); - hypre_CSRMatrixDestroy(hypre_ParCSRMatrixDiag(A)); - hypre_ParCSRMatrixDiag(A) = A_diag; - - hypre_CSRMatrix *A_offd = hypre_CSRMatrixClone_v2(hypre_ParCSRMatrixOffd(A), 1, memory_location); - hypre_CSRMatrixDestroy(hypre_ParCSRMatrixOffd(A)); - hypre_ParCSRMatrixOffd(A) = A_offd; + hypre_CSRMatrixMigrate(hypre_ParCSRMatrixDiag(A), memory_location); + hypre_CSRMatrixMigrate(hypre_ParCSRMatrixOffd(A), memory_location); + /* Free buffers */ + if ( hypre_GetActualMemLocation(memory_location) != + hypre_GetActualMemLocation(old_memory_location) ) + { hypre_TFree(hypre_ParCSRMatrixRowindices(A), old_memory_location); hypre_TFree(hypre_ParCSRMatrixRowvalues(A), old_memory_location); } - else - { - hypre_CSRMatrixMemoryLocation(hypre_ParCSRMatrixDiag(A)) = memory_location; - hypre_CSRMatrixMemoryLocation(hypre_ParCSRMatrixOffd(A)) = memory_location; - } return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixSetNumNonzeros_core + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_ParCSRMatrixSetNumNonzeros_core( hypre_ParCSRMatrix *matrix, const char* format ) +hypre_ParCSRMatrixSetNumNonzeros_core( hypre_ParCSRMatrix *matrix, + const char *format ) { MPI_Comm comm; hypre_CSRMatrix *diag; @@ -326,9 +348,10 @@ hypre_ParCSRMatrixSetNumNonzeros_core( hypre_ParCSRMatrix *matrix, const char* f diag = hypre_ParCSRMatrixDiag(matrix); offd = hypre_ParCSRMatrixOffd(matrix); - /* TODO in HYPRE_DEBUG ? */ +#if defined(HYPRE_DEBUG) hypre_CSRMatrixCheckSetNumNonzeros(diag); hypre_CSRMatrixCheckSetNumNonzeros(offd); +#endif if (format[0] == 'I') { @@ -366,6 +389,7 @@ hypre_ParCSRMatrixSetNumNonzeros_core( hypre_ParCSRMatrix *matrix, const char* f /*-------------------------------------------------------------------------- * hypre_ParCSRMatrixSetNumNonzeros *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_ParCSRMatrixSetNumNonzeros( hypre_ParCSRMatrix *matrix ) { @@ -437,7 +461,7 @@ hypre_ParCSRMatrixSetNumRownnz( hypre_ParCSRMatrix *matrix ) HYPRE_Int hypre_ParCSRMatrixSetDataOwner( hypre_ParCSRMatrix *matrix, - HYPRE_Int owns_data ) + HYPRE_Int owns_data ) { if (!matrix) { @@ -450,6 +474,246 @@ hypre_ParCSRMatrixSetDataOwner( hypre_ParCSRMatrix *matrix, return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixSetPatternOnly + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixSetPatternOnly( hypre_ParCSRMatrix *matrix, + HYPRE_Int pattern_only) +{ + if (!matrix) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + if (hypre_ParCSRMatrixDiag(matrix)) + { + hypre_CSRMatrixSetPatternOnly(hypre_ParCSRMatrixDiag(matrix), pattern_only); + } + + if (hypre_ParCSRMatrixOffd(matrix)) + { + hypre_CSRMatrixSetPatternOnly(hypre_ParCSRMatrixOffd(matrix), pattern_only); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixCreateFromDenseBlockMatrix + *--------------------------------------------------------------------------*/ + +hypre_ParCSRMatrix* +hypre_ParCSRMatrixCreateFromDenseBlockMatrix(MPI_Comm comm, + HYPRE_BigInt global_num_rows, + HYPRE_BigInt global_num_cols, + HYPRE_BigInt *row_starts, + HYPRE_BigInt *col_starts, + hypre_DenseBlockMatrix *B) +{ + /* Input matrix variables */ + HYPRE_Int num_rows_diag = hypre_DenseBlockMatrixNumRows(B); + HYPRE_Int num_nonzeros_diag = hypre_DenseBlockMatrixNumNonzeros(B); + HYPRE_Int num_rows_block = hypre_DenseBlockMatrixNumRowsBlock(B); + HYPRE_Int num_cols_block = hypre_DenseBlockMatrixNumColsBlock(B); + HYPRE_Int num_cols_offd = 0; + HYPRE_Int num_nonzeros_offd = 0; + HYPRE_MemoryLocation memory_location = hypre_DenseBlockMatrixMemoryLocation(B); + + /* Output matrix variables */ + hypre_ParCSRMatrix *A; + hypre_CSRMatrix *A_diag; + hypre_CSRMatrix *A_offd; + HYPRE_Int *A_diag_i; + HYPRE_Int *A_diag_j; + + /* Local variables */ + HYPRE_Int i, j, ib; + + /* Create output matrix */ + A = hypre_ParCSRMatrixCreate(comm, global_num_rows, global_num_cols, + row_starts, col_starts, num_cols_offd, + num_nonzeros_diag, num_nonzeros_offd); + A_diag = hypre_ParCSRMatrixDiag(A); + A_offd = hypre_ParCSRMatrixOffd(A); + + /* Set memory locations */ + hypre_CSRMatrixMemoryLocation(A_diag) = memory_location; + hypre_CSRMatrixMemoryLocation(A_offd) = memory_location; + + /* Set diag's data pointer */ + if (hypre_DenseBlockMatrixOwnsData(B)) + { + hypre_CSRMatrixData(A_diag) = hypre_DenseBlockMatrixData(B); + } + else + { + hypre_CSRMatrixData(A_diag) = hypre_CTAlloc(HYPRE_Complex, + num_nonzeros_diag, + memory_location); + hypre_TMemcpy(hypre_CSRMatrixData(A_diag), + hypre_DenseBlockMatrixData(B), + HYPRE_Complex, + num_nonzeros_diag, + memory_location, memory_location); + } + hypre_DenseBlockMatrixOwnsData(B) = 0; + + /* Set diag's row pointer and column indices */ + A_diag_i = hypre_CTAlloc(HYPRE_Int, num_rows_diag + 1, HYPRE_MEMORY_HOST); + A_diag_j = hypre_CTAlloc(HYPRE_Int, num_nonzeros_diag, HYPRE_MEMORY_HOST); + +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i, ib, j) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < num_rows_diag; i++) + { + ib = i / num_rows_block; + A_diag_i[i] = i * num_cols_block; + for (j = A_diag_i[i]; j < (i + 1) * num_cols_block; j++) + { + A_diag_j[j] = ib * num_cols_block + (j - A_diag_i[i]); + } + } + A_diag_i[num_rows_diag] = num_rows_diag * num_cols_block; + + /* Migrate to dest. memory location */ + if (memory_location != HYPRE_MEMORY_HOST) + { + hypre_CSRMatrixI(A_diag) = hypre_TAlloc(HYPRE_Int, num_rows_diag + 1, memory_location); + hypre_CSRMatrixJ(A_diag) = hypre_TAlloc(HYPRE_Int, num_nonzeros_diag, memory_location); + + hypre_TMemcpy(hypre_CSRMatrixI(A_diag), A_diag_i, + HYPRE_Int, num_rows_diag + 1, + memory_location, HYPRE_MEMORY_HOST); + + hypre_TMemcpy(hypre_CSRMatrixJ(A_diag), A_diag_j, + HYPRE_Int, num_nonzeros_diag, + memory_location, HYPRE_MEMORY_HOST); + } + else + { + hypre_CSRMatrixI(A_diag) = A_diag_i; + hypre_CSRMatrixJ(A_diag) = A_diag_j; + } + + return A; +} + +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixCreateFromParVector + *--------------------------------------------------------------------------*/ + +hypre_ParCSRMatrix* +hypre_ParCSRMatrixCreateFromParVector(hypre_ParVector *b, + HYPRE_BigInt global_num_rows, + HYPRE_BigInt global_num_cols, + HYPRE_BigInt *row_starts, + HYPRE_BigInt *col_starts) +{ + /* Input vector variables */ + MPI_Comm comm = hypre_ParVectorComm(b); + hypre_Vector *local_vector = hypre_ParVectorLocalVector(b); + HYPRE_MemoryLocation memory_location = hypre_ParVectorMemoryLocation(b); + + /* Auxiliary variables */ + HYPRE_Int num_rows = (HYPRE_Int) row_starts[1] - row_starts[0]; + HYPRE_Int num_cols = (HYPRE_Int) col_starts[1] - col_starts[0]; + HYPRE_Int num_nonzeros = hypre_min(num_rows, num_cols); + + /* Output matrix variables */ + hypre_ParCSRMatrix *A; + hypre_CSRMatrix *A_diag; + hypre_CSRMatrix *A_offd; + HYPRE_Int *A_diag_i; + HYPRE_Int *A_diag_j; + + /* Local variables */ + HYPRE_Int i; + + /* Sanity check */ + if (hypre_ParVectorNumVectors(b) > 1) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Not implemented for multi-component vectors"); + return NULL; + } + + /* Create output matrix */ + A = hypre_ParCSRMatrixCreate(comm, global_num_rows, global_num_cols, + row_starts, col_starts, 0, num_nonzeros, 0); + A_diag = hypre_ParCSRMatrixDiag(A); + A_offd = hypre_ParCSRMatrixOffd(A); + + /* Set memory locations */ + hypre_CSRMatrixMemoryLocation(A_diag) = memory_location; + hypre_CSRMatrixMemoryLocation(A_offd) = memory_location; + + /* Set diag's data pointer */ + if (hypre_VectorOwnsData(local_vector)) + { + hypre_CSRMatrixData(A_diag) = hypre_VectorData(local_vector); + hypre_VectorOwnsData(local_vector) = 0; + } + else + { + hypre_CSRMatrixData(A_diag) = hypre_CTAlloc(HYPRE_Complex, num_nonzeros, memory_location); + hypre_TMemcpy(hypre_CSRMatrixData(A_diag), + hypre_VectorData(local_vector), + HYPRE_Complex, num_nonzeros, + memory_location, memory_location); + } + + /* Set diag's row pointer and column indices */ + A_diag_i = hypre_CTAlloc(HYPRE_Int, num_rows + 1, HYPRE_MEMORY_HOST); + A_diag_j = hypre_CTAlloc(HYPRE_Int, num_nonzeros, HYPRE_MEMORY_HOST); + +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < num_nonzeros; i++) + { + A_diag_i[i] = A_diag_j[i] = i; + } + +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for HYPRE_SMP_SCHEDULE +#endif + for (i = num_nonzeros; i < num_rows + 1; i++) + { + A_diag_i[i] = num_nonzeros; + } + + /* Initialize offd portion */ + hypre_CSRMatrixInitialize_v2(A_offd, 0, memory_location); + + /* Migrate to dest. memory location */ + if (memory_location != HYPRE_MEMORY_HOST) + { + hypre_CSRMatrixI(A_diag) = hypre_TAlloc(HYPRE_Int, num_rows + 1, memory_location); + hypre_CSRMatrixJ(A_diag) = hypre_TAlloc(HYPRE_Int, num_nonzeros, memory_location); + + hypre_TMemcpy(hypre_CSRMatrixI(A_diag), A_diag_i, + HYPRE_Int, num_rows + 1, + memory_location, HYPRE_MEMORY_HOST); + + hypre_TMemcpy(hypre_CSRMatrixJ(A_diag), A_diag_j, + HYPRE_Int, num_nonzeros, + memory_location, HYPRE_MEMORY_HOST); + + hypre_TFree(A_diag_i, HYPRE_MEMORY_HOST); + hypre_TFree(A_diag_j, HYPRE_MEMORY_HOST); + } + else + { + hypre_CSRMatrixI(A_diag) = A_diag_i; + hypre_CSRMatrixJ(A_diag) = A_diag_j; + } + + return A; +} + /*-------------------------------------------------------------------------- * hypre_ParCSRMatrixRead *--------------------------------------------------------------------------*/ @@ -473,20 +737,22 @@ hypre_ParCSRMatrixRead( MPI_Comm comm, HYPRE_BigInt global_num_rows, global_num_cols; FILE *fp; - char new_file_d[80], new_file_o[80], new_file_info[80]; + char new_file_d[HYPRE_MAX_FILE_NAME_LEN]; + char new_file_o[HYPRE_MAX_FILE_NAME_LEN]; + char new_file_info[HYPRE_MAX_FILE_NAME_LEN]; - hypre_MPI_Comm_rank(comm,&my_id); - hypre_MPI_Comm_size(comm,&num_procs); + hypre_MPI_Comm_rank(comm, &my_id); + hypre_MPI_Comm_size(comm, &num_procs); - hypre_sprintf(new_file_d,"%s.D.%d",file_name,my_id); - hypre_sprintf(new_file_o,"%s.O.%d",file_name,my_id); - hypre_sprintf(new_file_info,"%s.INFO.%d",file_name,my_id); + hypre_sprintf(new_file_d, "%s.D.%d", file_name, my_id); + hypre_sprintf(new_file_o, "%s.O.%d", file_name, my_id); + hypre_sprintf(new_file_info, "%s.INFO.%d", file_name, my_id); fp = fopen(new_file_info, "r"); hypre_fscanf(fp, "%b", &global_num_rows); hypre_fscanf(fp, "%b", &global_num_cols); hypre_fscanf(fp, "%d", &num_cols_offd); /* the bgl input file should only contain the EXACT range for local processor */ - hypre_fscanf(fp, "%d %d %d %d", &row_s, &row_e, &col_s, &col_e); + hypre_fscanf(fp, "%b %b %b %b", &row_s, &row_e, &col_s, &col_e); row_starts[0] = row_s; row_starts[1] = row_e; col_starts[0] = col_s; @@ -510,8 +776,8 @@ hypre_ParCSRMatrixRead( MPI_Comm comm, } else { - offd = hypre_CSRMatrixCreate(local_num_rows,0,0); - hypre_CSRMatrixInitialize(offd); + offd = hypre_CSRMatrixCreate(local_num_rows, 0, 0); + hypre_CSRMatrixInitialize_v2(offd, 0, HYPRE_MEMORY_HOST); } matrix = hypre_CTAlloc(hypre_ParCSRMatrix, 1, HYPRE_MEMORY_HOST); @@ -555,15 +821,19 @@ HYPRE_Int hypre_ParCSRMatrixPrint( hypre_ParCSRMatrix *matrix, const char *file_name ) { - MPI_Comm comm; - HYPRE_BigInt global_num_rows; - HYPRE_BigInt global_num_cols; + MPI_Comm comm; + HYPRE_BigInt global_num_rows; + HYPRE_BigInt global_num_cols; HYPRE_BigInt *col_map_offd; - HYPRE_Int my_id, i, num_procs; - char new_file_d[80], new_file_o[80], new_file_info[80]; - FILE *fp; - HYPRE_Int num_cols_offd = 0; - HYPRE_BigInt row_s, row_e, col_s, col_e; + HYPRE_Int my_id, i, num_procs; + + char new_file_d[HYPRE_MAX_FILE_NAME_LEN]; + char new_file_o[HYPRE_MAX_FILE_NAME_LEN]; + char new_file_info[HYPRE_MAX_FILE_NAME_LEN]; + FILE *fp; + HYPRE_Int num_cols_offd = 0; + HYPRE_BigInt row_s, row_e, col_s, col_e; + if (!matrix) { hypre_error_in_arg(1); @@ -574,17 +844,21 @@ hypre_ParCSRMatrixPrint( hypre_ParCSRMatrix *matrix, global_num_cols = hypre_ParCSRMatrixGlobalNumCols(matrix); col_map_offd = hypre_ParCSRMatrixColMapOffd(matrix); if (hypre_ParCSRMatrixOffd(matrix)) + { num_cols_offd = hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(matrix)); + } hypre_MPI_Comm_rank(comm, &my_id); hypre_MPI_Comm_size(comm, &num_procs); - hypre_sprintf(new_file_d,"%s.D.%d",file_name,my_id); - hypre_sprintf(new_file_o,"%s.O.%d",file_name,my_id); - hypre_sprintf(new_file_info,"%s.INFO.%d",file_name,my_id); - hypre_CSRMatrixPrint(hypre_ParCSRMatrixDiag(matrix),new_file_d); + hypre_sprintf(new_file_d, "%s.D.%d", file_name, my_id); + hypre_sprintf(new_file_o, "%s.O.%d", file_name, my_id); + hypre_sprintf(new_file_info, "%s.INFO.%d", file_name, my_id); + hypre_CSRMatrixPrint(hypre_ParCSRMatrixDiag(matrix), new_file_d); if (num_cols_offd != 0) - hypre_CSRMatrixPrint(hypre_ParCSRMatrixOffd(matrix),new_file_o); + { + hypre_CSRMatrixPrint(hypre_ParCSRMatrixOffd(matrix), new_file_o); + } fp = fopen(new_file_info, "w"); hypre_fprintf(fp, "%b\n", global_num_rows); @@ -594,10 +868,13 @@ hypre_ParCSRMatrixPrint( hypre_ParCSRMatrix *matrix, row_e = hypre_ParCSRMatrixLastRowIndex(matrix); col_s = hypre_ParCSRMatrixFirstColDiag(matrix); col_e = hypre_ParCSRMatrixLastColDiag(matrix); + /* add 1 to the ends because this is a starts partition */ hypre_fprintf(fp, "%b %b %b %b\n", row_s, row_e + 1, col_s, col_e + 1); - for (i=0; i < num_cols_offd; i++) + for (i = 0; i < num_cols_offd; i++) + { hypre_fprintf(fp, "%b\n", col_map_offd[i]); + } fclose(fp); return hypre_error_flag; @@ -613,6 +890,8 @@ hypre_ParCSRMatrixPrintIJ( const hypre_ParCSRMatrix *matrix, const HYPRE_Int base_j, const char *filename ) { + hypre_ParCSRMatrix *h_matrix; + MPI_Comm comm; HYPRE_BigInt first_row_index; HYPRE_BigInt first_col_diag; @@ -626,38 +905,51 @@ hypre_ParCSRMatrixPrintIJ( const hypre_ParCSRMatrix *matrix, HYPRE_Int *diag_i; HYPRE_Int *diag_j; HYPRE_Complex *offd_data; - HYPRE_Int *offd_i; + HYPRE_Int *offd_i = NULL; HYPRE_Int *offd_j; HYPRE_Int myid, num_procs, i, j; HYPRE_BigInt I, J; - char new_filename[255]; + char new_filename[HYPRE_MAX_FILE_NAME_LEN]; FILE *file; HYPRE_Int num_nonzeros_offd; HYPRE_BigInt ilower, iupper, jlower, jupper; + HYPRE_MemoryLocation memory_location = + hypre_ParCSRMatrixMemoryLocation((hypre_ParCSRMatrix*) matrix); + if (!matrix) { hypre_error_in_arg(1); return hypre_error_flag; } - comm = hypre_ParCSRMatrixComm(matrix); - first_row_index = hypre_ParCSRMatrixFirstRowIndex(matrix); - first_col_diag = hypre_ParCSRMatrixFirstColDiag(matrix); - diag = hypre_ParCSRMatrixDiag(matrix); - offd = hypre_ParCSRMatrixOffd(matrix); - col_map_offd = hypre_ParCSRMatrixColMapOffd(matrix); - num_rows = hypre_ParCSRMatrixNumRows(matrix); - row_starts = hypre_ParCSRMatrixRowStarts(matrix); - col_starts = hypre_ParCSRMatrixColStarts(matrix); + /* Create temporary matrix on host memory if needed */ + if (hypre_GetActualMemLocation(memory_location) == hypre_MEMORY_HOST) + { + h_matrix = (hypre_ParCSRMatrix *) matrix; + } + else + { + h_matrix = hypre_ParCSRMatrixClone_v2((hypre_ParCSRMatrix *) matrix, 1, HYPRE_MEMORY_HOST); + } + + comm = hypre_ParCSRMatrixComm(h_matrix); + first_row_index = hypre_ParCSRMatrixFirstRowIndex(h_matrix); + first_col_diag = hypre_ParCSRMatrixFirstColDiag(h_matrix); + diag = hypre_ParCSRMatrixDiag(h_matrix); + offd = hypre_ParCSRMatrixOffd(h_matrix); + col_map_offd = hypre_ParCSRMatrixColMapOffd(h_matrix); + num_rows = hypre_ParCSRMatrixNumRows(h_matrix); + row_starts = hypre_ParCSRMatrixRowStarts(h_matrix); + col_starts = hypre_ParCSRMatrixColStarts(h_matrix); hypre_MPI_Comm_rank(comm, &myid); hypre_MPI_Comm_size(comm, &num_procs); - hypre_sprintf(new_filename,"%s.%05d", filename, myid); + hypre_sprintf(new_filename, "%s.%05d", filename, myid); if ((file = fopen(new_filename, "w")) == NULL) { - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Error: can't open output file %s\n"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Error: can't open output file %s\n"); return hypre_error_flag; } @@ -685,7 +977,7 @@ hypre_ParCSRMatrixPrintIJ( const hypre_ParCSRMatrix *matrix, I = first_row_index + (HYPRE_BigInt)(i + base_i); /* print diag columns */ - for (j = diag_i[i]; j < diag_i[i+1]; j++) + for (j = diag_i[i]; j < diag_i[i + 1]; j++) { J = first_col_diag + (HYPRE_BigInt)(diag_j[j] + base_j); if (diag_data) @@ -706,7 +998,7 @@ hypre_ParCSRMatrixPrintIJ( const hypre_ParCSRMatrix *matrix, /* print offd columns */ if (num_nonzeros_offd) { - for (j = offd_i[i]; j < offd_i[i+1]; j++) + for (j = offd_i[i]; j < offd_i[i + 1]; j++) { J = col_map_offd[offd_j[j]] + (HYPRE_BigInt) base_j; if (offd_data) @@ -728,6 +1020,343 @@ hypre_ParCSRMatrixPrintIJ( const hypre_ParCSRMatrix *matrix, fclose(file); + /* Free temporary matrix */ + if (hypre_GetActualMemLocation(memory_location) != hypre_MEMORY_HOST) + { + hypre_ParCSRMatrixDestroy(h_matrix); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixPrintBinaryIJ + * + * Prints a ParCSRMatrix in binary format. The data from each process is + * printed to a separate file. Metadata info about the matrix is printed in + * the header section of every file, and it is followed by the raw data, i.e., + * row, column, and coefficients. + * + * The header section is composed by 11 entries stored in 88 bytes (8 bytes + * each) and their meanings are: + * + * 0) Header version + * 1) Number of bytes for storing an integer type (row and columns) + * 2) Number of bytes for storing a real type (coefficients) + * 3) Number of rows in the matrix + * 4) Number of columns in the matrix + * 5) Number of nonzero coefficients in the matrix + * 6) Number of local nonzero coefficients in the current matrix block + * 7) Global index of the first row of the current matrix block + * 8) Global index of the last row of the current matrix block + * 9) Global index of the first column in the diagonal matrix block + * 10) Global index of the last column in the diagonal matrix block + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixPrintBinaryIJ( hypre_ParCSRMatrix *matrix, + HYPRE_Int base_i, + HYPRE_Int base_j, + const char *filename ) +{ + MPI_Comm comm = hypre_ParCSRMatrixComm(matrix); + HYPRE_MemoryLocation memory_location = hypre_ParCSRMatrixMemoryLocation(matrix); + hypre_ParCSRMatrix *h_matrix; + + HYPRE_BigInt first_row_index; + HYPRE_BigInt first_col_diag; + hypre_CSRMatrix *diag, *offd; + HYPRE_BigInt *col_map_offd; + HYPRE_Int num_rows; + HYPRE_BigInt *row_starts, *col_starts; + + HYPRE_Complex *diag_data; + HYPRE_Int *diag_i, *diag_j; + HYPRE_Int diag_nnz; + + HYPRE_Complex *offd_data; + HYPRE_Int *offd_i, *offd_j; + HYPRE_Int offd_nnz; + + /* Local buffers */ + hypre_uint32 *i32buffer = NULL; + hypre_uint64 *i64buffer = NULL; + hypre_float *f32buffer = NULL; + hypre_double *f64buffer = NULL; + + /* Local variables */ + char new_filename[HYPRE_MAX_FILE_NAME_LEN]; + FILE *fp; + hypre_uint64 header[11]; + size_t count, k; + HYPRE_Int one = 1; + HYPRE_Int myid, i, j; + HYPRE_BigInt bigI, bigJ; + HYPRE_BigInt ilower, iupper, jlower, jupper; + HYPRE_Complex val; + + /* Exit if trying to write from big-endian machine */ + if ((*(char*)&one) == 0) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Support to big-endian machines is incomplete!\n"); + return hypre_error_flag; + } + + /* MPI variables */ + hypre_MPI_Comm_rank(comm, &myid); + + /* Create temporary matrix on host memory if needed */ + h_matrix = (hypre_GetActualMemLocation(memory_location) == hypre_MEMORY_DEVICE) ? + hypre_ParCSRMatrixClone_v2(matrix, 1, HYPRE_MEMORY_HOST) : matrix; + + /* Update global number of nonzeros */ + hypre_ParCSRMatrixSetDNumNonzeros(h_matrix); + + /* Matrix variables */ + first_row_index = hypre_ParCSRMatrixFirstRowIndex(h_matrix); + first_col_diag = hypre_ParCSRMatrixFirstColDiag(h_matrix); + diag = hypre_ParCSRMatrixDiag(h_matrix); + offd = hypre_ParCSRMatrixOffd(h_matrix); + col_map_offd = hypre_ParCSRMatrixColMapOffd(h_matrix); + num_rows = hypre_ParCSRMatrixNumRows(h_matrix); + row_starts = hypre_ParCSRMatrixRowStarts(h_matrix); + col_starts = hypre_ParCSRMatrixColStarts(h_matrix); + + /* Diagonal matrix variables */ + diag_nnz = hypre_CSRMatrixNumNonzeros(diag); + diag_data = hypre_CSRMatrixData(diag); + diag_i = hypre_CSRMatrixI(diag); + diag_j = hypre_CSRMatrixJ(diag); + + /* Off-diagonal matrix variables */ + offd_nnz = hypre_CSRMatrixNumNonzeros(offd); + offd_data = hypre_CSRMatrixData(offd); + offd_i = hypre_CSRMatrixI(offd); + offd_j = hypre_CSRMatrixJ(offd); + + /* Set global matrix bounds */ + ilower = row_starts[0] + (HYPRE_BigInt) base_i; + iupper = row_starts[1] + (HYPRE_BigInt) base_i - 1; + jlower = col_starts[0] + (HYPRE_BigInt) base_j; + jupper = col_starts[1] + (HYPRE_BigInt) base_j - 1; + + /* Open binary file */ + hypre_sprintf(new_filename, "%s.%05d.bin", filename, myid); + if ((fp = fopen(new_filename, "wb")) == NULL) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Could not open output file!"); + return hypre_error_flag; + } + + /*--------------------------------------------- + * Write header (88 bytes) + *---------------------------------------------*/ + + count = 11; + header[0] = (hypre_uint64) 1; /* Header version */ + header[1] = (hypre_uint64) sizeof(HYPRE_BigInt); + header[2] = (hypre_uint64) sizeof(HYPRE_Complex); + header[3] = (hypre_uint64) hypre_ParCSRMatrixGlobalNumRows(h_matrix);; + header[4] = (hypre_uint64) hypre_ParCSRMatrixGlobalNumCols(h_matrix);; + header[5] = (hypre_uint64) hypre_ParCSRMatrixDNumNonzeros(h_matrix); + header[6] = (hypre_uint64) diag_nnz + offd_nnz; /* local number of nonzeros*/ + header[7] = (hypre_uint64) ilower; + header[8] = (hypre_uint64) iupper; + header[9] = (hypre_uint64) jlower; + header[10] = (hypre_uint64) jupper; + if (fwrite((const void*) header, sizeof(hypre_uint64), count, fp) != count) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Could not write all header entries\n"); + return hypre_error_flag; + } + + /* Allocate memory for buffers */ + if (sizeof(HYPRE_BigInt) == sizeof(hypre_uint32)) + { + i32buffer = hypre_TAlloc(hypre_uint32, header[6], HYPRE_MEMORY_HOST); + } + else if (sizeof(HYPRE_BigInt) == sizeof(hypre_uint64)) + { + i64buffer = hypre_TAlloc(hypre_uint64, header[6], HYPRE_MEMORY_HOST); + } + else + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unsupported data type for row/column indices\n"); + return hypre_error_flag; + } + + /* Allocate memory for buffers */ + if (sizeof(HYPRE_Complex) == sizeof(hypre_float)) + { + f32buffer = hypre_TAlloc(hypre_float, header[6], HYPRE_MEMORY_HOST); + } + else if (sizeof(HYPRE_Complex) == sizeof(hypre_double)) + { + f64buffer = hypre_TAlloc(hypre_double, header[6], HYPRE_MEMORY_HOST); + } + else + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unsupported data type for matrix coefficients\n"); + return hypre_error_flag; + } + + /*--------------------------------------------- + * Write row indices to file + *---------------------------------------------*/ + + for (i = 0, k = 0; i < num_rows; i++) + { + bigI = first_row_index + (HYPRE_BigInt)(i + base_i); + + for (j = 0; j < (diag_i[i + 1] - diag_i[i]) + (offd_i[i + 1] - offd_i[i]); j++) + { + if (i32buffer) + { + i32buffer[k++] = (hypre_uint32) bigI; + } + else + { + i64buffer[k++] = (hypre_uint64) bigI; + } + } + } + + /* Write buffer */ + if (i32buffer) + { + count = fwrite((const void*) i32buffer, sizeof(hypre_uint32), k, fp); + } + else if (i64buffer) + { + count = fwrite((const void*) i64buffer, sizeof(hypre_uint64), k, fp); + } + + if (count != k) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Could not write all row indices entries\n"); + return hypre_error_flag; + } + + /*--------------------------------------------- + * Write columns indices to file + *---------------------------------------------*/ + + for (i = 0, k = 0; i < num_rows; i++) + { + for (j = diag_i[i]; j < diag_i[i + 1]; j++) + { + bigJ = first_col_diag + (HYPRE_BigInt)(diag_j[j] + base_j); + + if (i32buffer) + { + i32buffer[k++] = (hypre_uint32) bigJ; + } + else + { + i64buffer[k++] = (hypre_uint64) bigJ; + } + } + + for (j = offd_i[i]; j < offd_i[i + 1]; j++) + { + bigJ = col_map_offd[offd_j[j]] + (HYPRE_BigInt) base_j; + + if (i32buffer) + { + i32buffer[k++] = (hypre_uint32) bigJ; + } + else + { + i64buffer[k++] = (hypre_uint64) bigJ; + } + } + } + + /* Write buffer */ + if (i32buffer) + { + count = fwrite((const void*) i32buffer, sizeof(hypre_uint32), k, fp); + } + else if (i64buffer) + { + count = fwrite((const void*) i64buffer, sizeof(hypre_uint64), k, fp); + } + + if (count != k) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Could not write all column indices entries\n"); + return hypre_error_flag; + } + + /*--------------------------------------------- + * Write coefficients indices to file + *---------------------------------------------*/ + + if (diag_data) + { + for (i = 0, k = 0; i < num_rows; i++) + { + for (j = diag_i[i]; j < diag_i[i + 1]; j++) + { + val = diag_data[j]; + + if (f32buffer) + { + f32buffer[k++] = (hypre_float) val; + } + else + { + f64buffer[k++] = (hypre_double) val; + } + } + + for (j = offd_i[i]; j < offd_i[i + 1]; j++) + { + val = offd_data[j]; + + if (f32buffer) + { + f32buffer[k++] = (hypre_float) val; + } + else + { + f64buffer[k++] = (hypre_double) val; + } + } + } + + /* Write buffer */ + if (f32buffer) + { + count = fwrite((const void*) f32buffer, sizeof(hypre_float), k, fp); + } + else if (f64buffer) + { + count = fwrite((const void*) f64buffer, sizeof(hypre_double), k, fp); + } + + if (count != k) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Could not write all matrix coefficients\n"); + return hypre_error_flag; + } + } + + fclose(fp); + + /*--------------------------------------------- + * Free memory + *---------------------------------------------*/ + + if (h_matrix != matrix) + { + hypre_ParCSRMatrixDestroy(h_matrix); + } + hypre_TFree(i32buffer, HYPRE_MEMORY_HOST); + hypre_TFree(i64buffer, HYPRE_MEMORY_HOST); + hypre_TFree(f32buffer, HYPRE_MEMORY_HOST); + hypre_TFree(f64buffer, HYPRE_MEMORY_HOST); + return hypre_error_flag; } @@ -759,14 +1388,14 @@ hypre_ParCSRMatrixReadIJ( MPI_Comm comm, HYPRE_Complex *diag_data; HYPRE_Int *diag_i; HYPRE_Int *diag_j; - HYPRE_Complex *offd_data; + HYPRE_Complex *offd_data = NULL; HYPRE_Int *offd_i; - HYPRE_Int *offd_j; - HYPRE_BigInt *tmp_j; + HYPRE_Int *offd_j = NULL; + HYPRE_BigInt *tmp_j = NULL; HYPRE_BigInt *aux_offd_j; HYPRE_BigInt I, J; HYPRE_Int myid, num_procs, i, i2, j; - char new_filename[255]; + char new_filename[HYPRE_MAX_FILE_NAME_LEN]; FILE *file; HYPRE_Int num_cols_offd, num_nonzeros_diag, num_nonzeros_offd; HYPRE_Int i_col, num_cols; @@ -776,11 +1405,11 @@ hypre_ParCSRMatrixReadIJ( MPI_Comm comm, hypre_MPI_Comm_size(comm, &num_procs); hypre_MPI_Comm_rank(comm, &myid); - hypre_sprintf(new_filename,"%s.%05d", filename, myid); + hypre_sprintf(new_filename, "%s.%05d", filename, myid); if ((file = fopen(new_filename, "r")) == NULL) { - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Error: can't open output file %s\n"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Error: can't open output file %s\n"); return hypre_error_flag; } @@ -816,16 +1445,16 @@ hypre_ParCSRMatrixReadIJ( MPI_Comm comm, first_row_index = hypre_ParCSRMatrixFirstRowIndex(matrix); first_col_diag = hypre_ParCSRMatrixFirstColDiag(matrix); - last_col_diag = first_col_diag+(HYPRE_BigInt)num_cols-1; + last_col_diag = first_col_diag + (HYPRE_BigInt)num_cols - 1; diag_cnt = 0; offd_cnt = 0; row_cnt = 0; - for (i = 0; i < num_nonzeros_diag+num_nonzeros_offd; i++) + for (i = 0; i < num_nonzeros_diag + num_nonzeros_offd; i++) { /* read values */ hypre_fscanf(file, "%b %b %le", &I, &J, &data); - i2 = (HYPRE_Int)(I-big_base_i-first_row_index); + i2 = (HYPRE_Int)(I - big_base_i - first_row_index); J -= big_base_j; if (i2 > row_cnt) { @@ -853,18 +1482,22 @@ hypre_ParCSRMatrixReadIJ( MPI_Comm comm, if (num_nonzeros_offd) { aux_offd_j = hypre_CTAlloc(HYPRE_BigInt, num_nonzeros_offd, HYPRE_MEMORY_HOST); - for (i=0; i < num_nonzeros_offd; i++) + for (i = 0; i < num_nonzeros_offd; i++) + { aux_offd_j[i] = (HYPRE_BigInt)offd_j[i]; - hypre_BigQsort0(aux_offd_j,0,num_nonzeros_offd-1); + } + hypre_BigQsort0(aux_offd_j, 0, num_nonzeros_offd - 1); col_map_offd = hypre_ParCSRMatrixColMapOffd(matrix); col_map_offd[0] = aux_offd_j[0]; offd_cnt = 0; - for (i=1; i < num_nonzeros_offd; i++) + for (i = 1; i < num_nonzeros_offd; i++) { if (aux_offd_j[i] > col_map_offd[offd_cnt]) + { col_map_offd[++offd_cnt] = aux_offd_j[i]; + } } - for (i=0; i < num_nonzeros_offd; i++) + for (i = 0; i < num_nonzeros_offd; i++) { offd_j[i] = hypre_BigBinarySearch(col_map_offd, tmp_j[i], num_cols_offd); } @@ -873,10 +1506,10 @@ hypre_ParCSRMatrixReadIJ( MPI_Comm comm, } /* move diagonal element in first position in each row */ - for (i=0; i < num_rows; i++) + for (i = 0; i < num_rows; i++) { i_col = diag_i[i]; - for (j=i_col; j < diag_i[i+1]; j++) + for (j = i_col; j < diag_i[i + 1]; j++) { if (diag_j[j] == i) { @@ -970,7 +1603,7 @@ hypre_ParCSRMatrixGetRowHost( hypre_ParCSRMatrix *mat, if (hypre_ParCSRMatrixGetrowactive(mat)) { - return(-1); + return (-1); } hypre_MPI_Comm_rank( hypre_ParCSRMatrixComm(mat), &my_id ); @@ -980,7 +1613,7 @@ hypre_ParCSRMatrixGetRowHost( hypre_ParCSRMatrix *mat, row_end = hypre_ParCSRMatrixLastRowIndex(mat) + 1; if (row < row_start || row >= row_end) { - return(-1); + return (-1); } /* if buffer is not allocated and some information is requested, @@ -990,14 +1623,14 @@ hypre_ParCSRMatrixGetRowHost( hypre_ParCSRMatrix *mat, /* allocate enough space to hold information from the longest row. */ - HYPRE_Int max = 1,tmp; + HYPRE_Int max = 1, tmp; HYPRE_Int i; HYPRE_Int m = row_end - row_start; for ( i = 0; i < m; i++ ) { - tmp = hypre_CSRMatrixI(Aa)[i+1] - hypre_CSRMatrixI(Aa)[i] + - hypre_CSRMatrixI(Ba)[i+1] - hypre_CSRMatrixI(Ba)[i]; + tmp = hypre_CSRMatrixI(Aa)[i + 1] - hypre_CSRMatrixI(Aa)[i] + + hypre_CSRMatrixI(Ba)[i + 1] - hypre_CSRMatrixI(Ba)[i]; if (max < tmp) { max = tmp; @@ -1015,14 +1648,14 @@ hypre_ParCSRMatrixGetRowHost( hypre_ParCSRMatrix *mat, HYPRE_Complex *vworkA, *vworkB, *v_p; HYPRE_Int i, *cworkA, *cworkB; HYPRE_BigInt cstart = hypre_ParCSRMatrixFirstColDiag(mat); - HYPRE_Int nztot, nzA, nzB, lrow = (HYPRE_Int)(row-row_start); + HYPRE_Int nztot, nzA, nzB, lrow = (HYPRE_Int)(row - row_start); HYPRE_BigInt *cmap, *idx_p; - nzA = hypre_CSRMatrixI(Aa)[lrow+1] - hypre_CSRMatrixI(Aa)[lrow]; + nzA = hypre_CSRMatrixI(Aa)[lrow + 1] - hypre_CSRMatrixI(Aa)[lrow]; cworkA = &( hypre_CSRMatrixJ(Aa)[ hypre_CSRMatrixI(Aa)[lrow] ] ); vworkA = &( hypre_CSRMatrixData(Aa)[ hypre_CSRMatrixI(Aa)[lrow] ] ); - nzB = hypre_CSRMatrixI(Ba)[lrow+1] - hypre_CSRMatrixI(Ba)[lrow]; + nzB = hypre_CSRMatrixI(Ba)[lrow + 1] - hypre_CSRMatrixI(Ba)[lrow]; cworkB = &( hypre_CSRMatrixJ(Ba)[ hypre_CSRMatrixI(Ba)[lrow] ] ); vworkB = &( hypre_CSRMatrixData(Ba)[ hypre_CSRMatrixI(Ba)[lrow] ] ); @@ -1054,11 +1687,11 @@ hypre_ParCSRMatrixGetRowHost( hypre_ParCSRMatrix *mat, imark = i; for ( i = 0; i < nzA; i++ ) { - v_p[imark+i] = vworkA[i]; + v_p[imark + i] = vworkA[i]; } for ( i = imark; i < nzB; i++ ) { - v_p[nzA+i] = vworkB[i]; + v_p[nzA + i] = vworkB[i]; } } @@ -1089,11 +1722,11 @@ hypre_ParCSRMatrixGetRowHost( hypre_ParCSRMatrix *mat, } for ( i = 0; i < nzA; i++ ) { - idx_p[imark+i] = cstart + cworkA[i]; + idx_p[imark + i] = cstart + cworkA[i]; } for ( i = imark; i < nzB; i++ ) { - idx_p[nzA+i] = cmap[cworkB[i]]; + idx_p[nzA + i] = cmap[cworkB[i]]; } } } @@ -1124,17 +1757,17 @@ hypre_ParCSRMatrixGetRow( hypre_ParCSRMatrix *mat, HYPRE_BigInt **col_ind, HYPRE_Complex **values ) { -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(mat) ); if (exec == HYPRE_EXEC_DEVICE) { - return hypre_ParCSRMatrixGetRowDevice(mat, row, size, col_ind, values); + hypre_ParCSRMatrixGetRowDevice(mat, row, size, col_ind, values); } else #endif { - return hypre_ParCSRMatrixGetRowHost(mat, row, size, col_ind, values); + hypre_ParCSRMatrixGetRowHost(mat, row, size, col_ind, values); } return hypre_error_flag; @@ -1151,6 +1784,11 @@ hypre_ParCSRMatrixRestoreRow( hypre_ParCSRMatrix *matrix, HYPRE_BigInt **col_ind, HYPRE_Complex **values ) { + HYPRE_UNUSED_VAR(row); + HYPRE_UNUSED_VAR(size); + HYPRE_UNUSED_VAR(col_ind); + HYPRE_UNUSED_VAR(values); + if (!hypre_ParCSRMatrixGetrowactive(matrix)) { hypre_error(HYPRE_ERROR_GENERIC); @@ -1186,13 +1824,13 @@ hypre_CSRMatrixToParCSRMatrix( MPI_Comm comm, HYPRE_Int num_procs, my_id; HYPRE_Int *num_rows_proc; HYPRE_Int *num_nonzeros_proc; - HYPRE_BigInt *row_starts = NULL; - HYPRE_BigInt *col_starts = NULL; + HYPRE_BigInt row_starts[2]; + HYPRE_BigInt col_starts[2]; hypre_CSRMatrix *local_A; - HYPRE_Complex *A_data; - HYPRE_Int *A_i; - HYPRE_Int *A_j; + HYPRE_Complex *A_data = NULL; + HYPRE_Int *A_i = NULL; + HYPRE_Int *A_j = NULL; hypre_MPI_Request *requests; hypre_MPI_Status *status, status0; @@ -1214,7 +1852,7 @@ hypre_CSRMatrixToParCSRMatrix( MPI_Comm comm, total_size = 4; if (my_id == 0) { - total_size += 2*(num_procs + 1); + total_size += 2 * (num_procs + 1); } global_data = hypre_CTAlloc(HYPRE_BigInt, total_size, HYPRE_MEMORY_HOST); @@ -1233,14 +1871,14 @@ hypre_CSRMatrixToParCSRMatrix( MPI_Comm comm, if 2: both global_row_starts and global_col_starts given if 3: only global_col_starts given, global_row_starts = NULL */ global_data[3] = 2; - global_size += (HYPRE_BigInt) (2*(num_procs + 1) + 1); + global_size += (HYPRE_BigInt) (2 * (num_procs + 1) + 1); for (i = 0; i < (num_procs + 1); i++) { - global_data[i+4] = global_row_starts[i]; + global_data[i + 4] = global_row_starts[i]; } for (i = 0; i < (num_procs + 1); i++) { - global_data[i+num_procs+5] = global_col_starts[i]; + global_data[i + num_procs + 5] = global_col_starts[i]; } } else @@ -1249,7 +1887,7 @@ hypre_CSRMatrixToParCSRMatrix( MPI_Comm comm, global_size += (HYPRE_BigInt) ((num_procs + 1) + 1); for (i = 0; i < (num_procs + 1); i++) { - global_data[i+4] = global_row_starts[i]; + global_data[i + 4] = global_row_starts[i]; } } } @@ -1259,7 +1897,7 @@ hypre_CSRMatrixToParCSRMatrix( MPI_Comm comm, global_size += (HYPRE_BigInt) ((num_procs + 1) + 1); for (i = 0; i < (num_procs + 1); i++) { - global_data[i+4] = global_row_starts[i]; + global_data[i + 4] = global_row_starts[i]; } } } @@ -1271,7 +1909,7 @@ hypre_CSRMatrixToParCSRMatrix( MPI_Comm comm, global_size += (HYPRE_BigInt) ((num_procs + 1) + 1); for (i = 0; i < (num_procs + 1); i++) { - global_data[i+4] = global_col_starts[i]; + global_data[i + 4] = global_col_starts[i]; } } } @@ -1294,9 +1932,6 @@ hypre_CSRMatrixToParCSRMatrix( MPI_Comm comm, if (global_data[3] == 2) { - row_starts = hypre_CTAlloc(HYPRE_BigInt, 2, HYPRE_MEMORY_HOST); - col_starts = hypre_CTAlloc(HYPRE_BigInt, 2, HYPRE_MEMORY_HOST); - send_start = 4; hypre_MPI_Scatter(&global_data[send_start], 1, HYPRE_MPI_BIG_INT, &row_starts[0], 1, HYPRE_MPI_BIG_INT, 0, comm); @@ -1315,8 +1950,6 @@ hypre_CSRMatrixToParCSRMatrix( MPI_Comm comm, } else if ((global_data[3] == 0) || (global_data[3] == 1)) { - row_starts = hypre_CTAlloc(HYPRE_BigInt, 2, HYPRE_MEMORY_HOST); - send_start = 4; hypre_MPI_Scatter(&global_data[send_start], 1, HYPRE_MPI_BIG_INT, &row_starts[0], 1, HYPRE_MPI_BIG_INT, 0, comm); @@ -1327,13 +1960,12 @@ hypre_CSRMatrixToParCSRMatrix( MPI_Comm comm, if (global_data[3] == 0) { - col_starts = row_starts; + col_starts[0] = row_starts[0]; + col_starts[1] = row_starts[1]; } } else { - col_starts = hypre_CTAlloc(HYPRE_BigInt, 2, HYPRE_MEMORY_HOST); - send_start = 4; hypre_MPI_Scatter(&global_data[send_start], 1, HYPRE_MPI_BIG_INT, &col_starts[0], 1, HYPRE_MPI_BIG_INT, 0, comm); @@ -1348,8 +1980,6 @@ hypre_CSRMatrixToParCSRMatrix( MPI_Comm comm, // Create ParCSR matrix parcsr_A = hypre_ParCSRMatrixCreate(comm, global_num_rows, global_num_cols, row_starts, col_starts, 0, 0, 0); - hypre_TFree(row_starts, HYPRE_MEMORY_HOST); - hypre_TFree(col_starts, HYPRE_MEMORY_HOST); // Allocate memory for building ParCSR matrix num_rows_proc = hypre_CTAlloc(HYPRE_Int, num_procs, HYPRE_MEMORY_HOST); @@ -1370,8 +2000,8 @@ hypre_CSRMatrixToParCSRMatrix( MPI_Comm comm, for (i = 0; i < num_procs; i++) { - num_rows_proc[i] = (HYPRE_Int) (global_row_starts[i+1] - global_row_starts[i]); - num_nonzeros_proc[i] = A_i[(HYPRE_Int)global_row_starts[i+1]] - + num_rows_proc[i] = (HYPRE_Int) (global_row_starts[i + 1] - global_row_starts[i]); + num_nonzeros_proc[i] = A_i[(HYPRE_Int)global_row_starts[i + 1]] - A_i[(HYPRE_Int)global_row_starts[i]]; } //num_nonzeros_proc[num_procs-1] = A_i[(HYPRE_Int)global_num_rows] - A_i[(HYPRE_Int)row_starts[num_procs-1]]; @@ -1385,8 +2015,8 @@ hypre_CSRMatrixToParCSRMatrix( MPI_Comm comm, csr_matrix_datatypes = hypre_CTAlloc(hypre_MPI_Datatype, num_procs, HYPRE_MEMORY_HOST); if (my_id == 0) { - requests = hypre_CTAlloc(hypre_MPI_Request, num_procs-1, HYPRE_MEMORY_HOST); - status = hypre_CTAlloc(hypre_MPI_Status, num_procs-1, HYPRE_MEMORY_HOST); + requests = hypre_CTAlloc(hypre_MPI_Request, num_procs - 1, HYPRE_MEMORY_HOST); + status = hypre_CTAlloc(hypre_MPI_Status, num_procs - 1, HYPRE_MEMORY_HOST); for (i = 1; i < num_procs; i++) { ind = A_i[(HYPRE_Int) global_row_starts[i]]; @@ -1398,7 +2028,7 @@ hypre_CSRMatrixToParCSRMatrix( MPI_Comm comm, &A_j[ind], &csr_matrix_datatypes[i]); hypre_MPI_Isend(hypre_MPI_BOTTOM, 1, csr_matrix_datatypes[i], i, 0, comm, - &requests[i-1]); + &requests[i - 1]); hypre_MPI_Type_free(&csr_matrix_datatypes[i]); } hypre_CSRMatrixData(local_A) = A_data; @@ -1406,7 +2036,7 @@ hypre_CSRMatrixToParCSRMatrix( MPI_Comm comm, hypre_CSRMatrixJ(local_A) = A_j; hypre_CSRMatrixOwnsData(local_A) = 0; - hypre_MPI_Waitall(num_procs-1, requests, status); + hypre_MPI_Waitall(num_procs - 1, requests, status); hypre_TFree(requests, HYPRE_MEMORY_HOST); hypre_TFree(status, HYPRE_MEMORY_HOST); @@ -1480,10 +2110,10 @@ GenerateDiagAndOffd(hypre_CSRMatrix *A, HYPRE_Int *marker; HYPRE_Int num_cols_diag, num_cols_offd; HYPRE_Int first_elmt = a_i[0]; - HYPRE_Int num_nonzeros = a_i[num_rows]-first_elmt; + HYPRE_Int num_nonzeros = a_i[num_rows] - first_elmt; HYPRE_Int counter; - num_cols_diag = (HYPRE_Int)(last_col_diag - first_col_diag +1); + num_cols_diag = (HYPRE_Int)(last_col_diag - first_col_diag + 1); num_cols_offd = 0; HYPRE_MemoryLocation memory_location = hypre_CSRMatrixMemoryLocation(A); @@ -1497,7 +2127,7 @@ GenerateDiagAndOffd(hypre_CSRMatrix *A, offd_i = hypre_CSRMatrixI(offd); marker = hypre_CTAlloc(HYPRE_Int, num_cols, HYPRE_MEMORY_HOST); - for (i=0; i < num_cols; i++) + for (i = 0; i < num_cols; i++) { marker[i] = 0; } @@ -1509,7 +2139,7 @@ GenerateDiagAndOffd(hypre_CSRMatrix *A, offd_i[i] = jo; diag_i[i] = jd; - for (j = a_i[i]-first_elmt; j < a_i[i+1]-first_elmt; j++) + for (j = a_i[i] - first_elmt; j < a_i[i + 1] - first_elmt; j++) { if (a_j[j] < first_col_diag || a_j[j] > last_col_diag) { @@ -1529,7 +2159,8 @@ GenerateDiagAndOffd(hypre_CSRMatrix *A, offd_i[num_rows] = jo; diag_i[num_rows] = jd; - hypre_ParCSRMatrixColMapOffd(matrix) = hypre_CTAlloc(HYPRE_BigInt, num_cols_offd, HYPRE_MEMORY_HOST); + hypre_ParCSRMatrixColMapOffd(matrix) = hypre_CTAlloc(HYPRE_BigInt, num_cols_offd, + HYPRE_MEMORY_HOST); col_map_offd = hypre_ParCSRMatrixColMapOffd(matrix); counter = 0; @@ -1556,9 +2187,9 @@ GenerateDiagAndOffd(hypre_CSRMatrix *A, jo = 0; jd = 0; - for (i=0; i < num_rows; i++) + for (i = 0; i < num_rows; i++) { - for (j=a_i[i]-first_elmt; j < a_i[i+1]-first_elmt; j++) + for (j = a_i[i] - first_elmt; j < a_i[i + 1] - first_elmt; j++) { if (a_j[j] < (HYPRE_Int)first_col_diag || a_j[j] > (HYPRE_Int)last_col_diag) { @@ -1568,7 +2199,7 @@ GenerateDiagAndOffd(hypre_CSRMatrix *A, else { diag_data[jd] = a_data[j]; - diag_j[jd++] = (HYPRE_Int)(a_j[j]-first_col_diag); + diag_j[jd++] = (HYPRE_Int)(a_j[j] - first_col_diag); } } } @@ -1582,14 +2213,14 @@ GenerateDiagAndOffd(hypre_CSRMatrix *A, diag_i = hypre_CSRMatrixI(diag); diag_j = hypre_CSRMatrixJ(diag); - for (i=0; i < num_nonzeros; i++) + for (i = 0; i < num_nonzeros; i++) { diag_data[i] = a_data[i]; diag_j[i] = a_j[i]; } - offd_i = hypre_CTAlloc(HYPRE_Int, num_rows+1, HYPRE_MEMORY_HOST); + offd_i = hypre_CTAlloc(HYPRE_Int, num_rows + 1, HYPRE_MEMORY_HOST); - for (i=0; i < num_rows+1; i++) + for (i = 0; i < num_rows + 1; i++) { diag_i[i] = a_i[i]; offd_i[i] = 0; @@ -1603,7 +2234,7 @@ GenerateDiagAndOffd(hypre_CSRMatrix *A, } hypre_CSRMatrix * -hypre_MergeDiagAndOffd(hypre_ParCSRMatrix *par_matrix) +hypre_MergeDiagAndOffdHost(hypre_ParCSRMatrix *par_matrix) { hypre_CSRMatrix *diag = hypre_ParCSRMatrixDiag(par_matrix); hypre_CSRMatrix *offd = hypre_ParCSRMatrixOffd(par_matrix); @@ -1633,7 +2264,7 @@ hypre_MergeDiagAndOffd(hypre_ParCSRMatrix *par_matrix) num_nonzeros = diag_i[num_rows] + offd_i[num_rows]; - matrix = hypre_CSRMatrixCreate(num_rows,num_cols,num_nonzeros); + matrix = hypre_CSRMatrixCreate(num_rows, num_cols, num_nonzeros); hypre_CSRMatrixMemoryLocation(matrix) = memory_location; hypre_CSRMatrixBigInitialize(matrix); @@ -1641,35 +2272,35 @@ hypre_MergeDiagAndOffd(hypre_ParCSRMatrix *par_matrix) matrix_j = hypre_CSRMatrixBigJ(matrix); matrix_data = hypre_CSRMatrixData(matrix); num_threads = hypre_NumThreads(); - size = num_rows/num_threads; - rest = num_rows - size*num_threads; + size = num_rows / num_threads; + rest = num_rows - size * num_threads; #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(ii, i, j, count) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(ii, i, j, count) HYPRE_SMP_SCHEDULE #endif for (ii = 0; ii < num_threads; ii++) { HYPRE_Int ns, ne; if (ii < rest) { - ns = ii*size+ii; - ne = (ii+1)*size+ii+1; + ns = ii * size + ii; + ne = (ii + 1) * size + ii + 1; } else { - ns = ii*size+rest; - ne = (ii+1)*size+rest; + ns = ii * size + rest; + ne = (ii + 1) * size + rest; } - count = diag_i[ns]+offd_i[ns];; + count = diag_i[ns] + offd_i[ns];; for (i = ns; i < ne; i++) { matrix_i[i] = count; - for (j=diag_i[i]; j < diag_i[i+1]; j++) + for (j = diag_i[i]; j < diag_i[i + 1]; j++) { matrix_data[count] = diag_data[j]; - matrix_j[count++] = (HYPRE_BigInt)diag_j[j]+first_col_diag; + matrix_j[count++] = (HYPRE_BigInt)diag_j[j] + first_col_diag; } - for (j=offd_i[i]; j < offd_i[i+1]; j++) + for (j = offd_i[i]; j < offd_i[i + 1]; j++) { matrix_data[count] = offd_data[j]; matrix_j[count++] = col_map_offd[offd_j[j]]; @@ -1682,88 +2313,123 @@ hypre_MergeDiagAndOffd(hypre_ParCSRMatrix *par_matrix) return matrix; } +hypre_CSRMatrix * +hypre_MergeDiagAndOffd(hypre_ParCSRMatrix *par_matrix) +{ +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(par_matrix) ); + + if (exec == HYPRE_EXEC_DEVICE) + { + return hypre_MergeDiagAndOffdDevice(par_matrix); + } + else +#endif + { + return hypre_MergeDiagAndOffdHost(par_matrix); + } +} + +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixToCSRMatrixAll + * + * The resulting matrix is stored in the space given by memory_location + *--------------------------------------------------------------------------*/ + +hypre_CSRMatrix* +hypre_ParCSRMatrixToCSRMatrixAll(hypre_ParCSRMatrix *par_A) +{ + return hypre_ParCSRMatrixToCSRMatrixAll_v2(par_A, hypre_ParCSRMatrixMemoryLocation(par_A)); +} + /*-------------------------------------------------------------------------- - * hypre_ParCSRMatrixToCSRMatrixAll: - * generates a CSRMatrix from a ParCSRMatrix on all processors that have + * hypre_ParCSRMatrixToCSRMatrixAll_v2 + * + * Generates a CSRMatrix from a ParCSRMatrix on all processors that have * parts of the ParCSRMatrix - * Warning: this only works for a ParCSRMatrix that is smaller than 2^31-1 + * + * Warning: This only works for a ParCSRMatrix with num_rows < 2,147,483,647 *--------------------------------------------------------------------------*/ -hypre_CSRMatrix * -hypre_ParCSRMatrixToCSRMatrixAll(hypre_ParCSRMatrix *par_matrix) +hypre_CSRMatrix* +hypre_ParCSRMatrixToCSRMatrixAll_v2( hypre_ParCSRMatrix *par_matrix, + HYPRE_MemoryLocation memory_location ) { - MPI_Comm comm = hypre_ParCSRMatrixComm(par_matrix); - hypre_CSRMatrix *matrix; - hypre_CSRMatrix *local_matrix; - HYPRE_Int num_rows = (HYPRE_Int)hypre_ParCSRMatrixGlobalNumRows(par_matrix); - HYPRE_Int num_cols = (HYPRE_Int)hypre_ParCSRMatrixGlobalNumCols(par_matrix); - HYPRE_Int *matrix_i; - HYPRE_Int *matrix_j; - HYPRE_Complex *matrix_data; - - HYPRE_Int *local_matrix_i; - HYPRE_Int *local_matrix_j; - HYPRE_Complex *local_matrix_data; - - HYPRE_Int i, j; - HYPRE_Int local_num_rows; - HYPRE_Int local_num_nonzeros; - HYPRE_Int num_nonzeros; - HYPRE_Int num_data; - HYPRE_Int num_requests; - HYPRE_Int vec_len, offset; - HYPRE_Int start_index; - HYPRE_Int proc_id; - HYPRE_Int num_procs, my_id; - HYPRE_Int num_types; - HYPRE_Int *used_procs; - - hypre_MPI_Request *requests; - hypre_MPI_Status *status; - - HYPRE_Int *new_vec_starts; - - HYPRE_Int num_contacts; - HYPRE_Int contact_proc_list[1]; - HYPRE_Int contact_send_buf[1]; - HYPRE_Int contact_send_buf_starts[2]; - HYPRE_Int max_response_size; - HYPRE_Int *response_recv_buf=NULL; - HYPRE_Int *response_recv_buf_starts = NULL; + MPI_Comm comm = hypre_ParCSRMatrixComm(par_matrix); + HYPRE_Int num_rows = (HYPRE_Int) hypre_ParCSRMatrixGlobalNumRows(par_matrix); + HYPRE_Int num_cols = (HYPRE_Int) hypre_ParCSRMatrixGlobalNumCols(par_matrix); + HYPRE_BigInt first_row_index = hypre_ParCSRMatrixFirstRowIndex(par_matrix); + HYPRE_BigInt last_row_index = hypre_ParCSRMatrixLastRowIndex(par_matrix); + + hypre_ParCSRMatrix *par_temp; + hypre_CSRMatrix *matrix; + HYPRE_Int *matrix_i; + HYPRE_Int *matrix_j; + HYPRE_Complex *matrix_data; + + hypre_CSRMatrix *local_matrix; + HYPRE_Int local_num_rows; + HYPRE_Int local_num_nonzeros; + HYPRE_Int *local_matrix_i; + HYPRE_Int *local_matrix_j; + HYPRE_Complex *local_matrix_data; + + HYPRE_Int i, j; + HYPRE_Int num_nonzeros; + HYPRE_Int num_data; + HYPRE_Int num_requests; + HYPRE_Int vec_len, offset; + HYPRE_Int start_index; + HYPRE_Int proc_id; + HYPRE_Int num_procs, my_id; + HYPRE_Int num_types; + HYPRE_Int *used_procs; + HYPRE_Int *new_vec_starts; + hypre_MPI_Request *requests; + hypre_MPI_Status *status; + HYPRE_Int num_contacts; + HYPRE_Int contact_proc_list[1]; + HYPRE_Int contact_send_buf[1]; + HYPRE_Int contact_send_buf_starts[2]; + HYPRE_Int max_response_size; + HYPRE_Int *response_recv_buf = NULL; + HYPRE_Int *response_recv_buf_starts = NULL; hypre_DataExchangeResponse response_obj; - hypre_ProcListElements send_proc_obj; + hypre_ProcListElements send_proc_obj; - HYPRE_Int *send_info = NULL; - hypre_MPI_Status status1; - HYPRE_Int count, tag1 = 11112, tag2 = 22223, tag3 = 33334; - HYPRE_Int start; + HYPRE_Int *send_info = NULL; + hypre_MPI_Status status1; + HYPRE_Int count, start; + HYPRE_Int tag1 = 11112, tag2 = 22223, tag3 = 33334; hypre_MPI_Comm_size(comm, &num_procs); hypre_MPI_Comm_rank(comm, &my_id); - local_num_rows = (HYPRE_Int)(hypre_ParCSRMatrixLastRowIndex(par_matrix) - - hypre_ParCSRMatrixFirstRowIndex(par_matrix) + 1); + /* Clone input matrix to host memory */ + par_temp = hypre_ParCSRMatrixClone_v2(par_matrix, 1, HYPRE_MEMORY_HOST); + + /* Creates local matrix on host memory */ + local_matrix = hypre_MergeDiagAndOffd(par_temp); + hypre_ParCSRMatrixDestroy(par_temp); + /* copies big_j to j */ + hypre_CSRMatrixBigJtoJ(local_matrix); - local_matrix = hypre_MergeDiagAndOffd(par_matrix); /* creates matrix */ - hypre_CSRMatrixBigJtoJ(local_matrix); /* copies big_j to j */ local_matrix_i = hypre_CSRMatrixI(local_matrix); local_matrix_j = hypre_CSRMatrixJ(local_matrix); local_matrix_data = hypre_CSRMatrixData(local_matrix); - + local_num_rows = (HYPRE_Int) (last_row_index - first_row_index + 1); /* determine procs that have vector data and store their ids in used_procs */ /* we need to do an exchange data for this. If I own row then I will contact processor 0 with the endpoint of my local range */ - if (local_num_rows > 0) { num_contacts = 1; contact_proc_list[0] = 0; - contact_send_buf[0] = (HYPRE_Int)hypre_ParCSRMatrixLastRowIndex(par_matrix); + contact_send_buf[0] = (HYPRE_Int) hypre_ParCSRMatrixLastRowIndex(par_matrix); contact_send_buf_starts[0] = 0; contact_send_buf_starts[1] = 1; - } else { @@ -1775,20 +2441,19 @@ hypre_ParCSRMatrixToCSRMatrixAll(hypre_ParCSRMatrix *par_matrix) /*send_proc_obj will be for saving info from contacts */ send_proc_obj.length = 0; send_proc_obj.storage_length = 10; - send_proc_obj.id = hypre_CTAlloc(HYPRE_Int, send_proc_obj.storage_length, HYPRE_MEMORY_HOST); - send_proc_obj.vec_starts = - hypre_CTAlloc(HYPRE_Int, send_proc_obj.storage_length + 1, HYPRE_MEMORY_HOST); + send_proc_obj.id = hypre_CTAlloc(HYPRE_Int, send_proc_obj.storage_length, HYPRE_MEMORY_HOST); + send_proc_obj.vec_starts = hypre_CTAlloc(HYPRE_Int, send_proc_obj.storage_length + 1, + HYPRE_MEMORY_HOST); send_proc_obj.vec_starts[0] = 0; send_proc_obj.element_storage_length = 10; - send_proc_obj.elements = - hypre_CTAlloc(HYPRE_BigInt, send_proc_obj.element_storage_length, HYPRE_MEMORY_HOST); + send_proc_obj.elements = hypre_CTAlloc(HYPRE_BigInt, send_proc_obj.element_storage_length, + HYPRE_MEMORY_HOST); max_response_size = 0; /* each response is null */ response_obj.fill_response = hypre_FillResponseParToCSRMatrix; response_obj.data1 = NULL; response_obj.data2 = &send_proc_obj; /*this is where we keep info from contacts*/ - hypre_DataExchangeList(num_contacts, contact_proc_list, contact_send_buf, contact_send_buf_starts, sizeof(HYPRE_Int), @@ -1808,21 +2473,21 @@ hypre_ParCSRMatrixToCSRMatrixAll(hypre_ParCSRMatrix *par_matrix) hypre_MPI_Probe(0, tag1, comm, &status1); hypre_MPI_Get_count(&status1, HYPRE_MPI_INT, &count); - send_info = hypre_CTAlloc(HYPRE_Int, count, HYPRE_MEMORY_HOST); + send_info = hypre_CTAlloc(HYPRE_Int, count, HYPRE_MEMORY_HOST); hypre_MPI_Recv(send_info, count, HYPRE_MPI_INT, 0, tag1, comm, &status1); /* now unpack */ num_types = send_info[0]; - used_procs = hypre_CTAlloc(HYPRE_Int, num_types, HYPRE_MEMORY_HOST); - new_vec_starts = hypre_CTAlloc(HYPRE_Int, num_types+1, HYPRE_MEMORY_HOST); + used_procs = hypre_CTAlloc(HYPRE_Int, num_types, HYPRE_MEMORY_HOST); + new_vec_starts = hypre_CTAlloc(HYPRE_Int, num_types + 1, HYPRE_MEMORY_HOST); - for (i=1; i<= num_types; i++) + for (i = 1; i <= num_types; i++) { - used_procs[i-1] = send_info[i]; + used_procs[i - 1] = send_info[i]; } - for (i=num_types+1; i< count; i++) + for (i = num_types + 1; i < count; i++) { - new_vec_starts[i-num_types-1] = send_info[i] ; + new_vec_starts[i - num_types - 1] = send_info[i] ; } } else /* clean up and exit */ @@ -1830,46 +2495,42 @@ hypre_ParCSRMatrixToCSRMatrixAll(hypre_ParCSRMatrix *par_matrix) hypre_TFree(send_proc_obj.vec_starts, HYPRE_MEMORY_HOST); hypre_TFree(send_proc_obj.id, HYPRE_MEMORY_HOST); hypre_TFree(send_proc_obj.elements, HYPRE_MEMORY_HOST); - if(response_recv_buf) hypre_TFree(response_recv_buf, HYPRE_MEMORY_HOST); - if(response_recv_buf_starts) hypre_TFree(response_recv_buf_starts, HYPRE_MEMORY_HOST); - - - if (hypre_CSRMatrixOwnsData(local_matrix)) - hypre_CSRMatrixDestroy(local_matrix); - else - hypre_TFree(local_matrix, HYPRE_MEMORY_HOST); + hypre_TFree(response_recv_buf, HYPRE_MEMORY_HOST); + hypre_TFree(response_recv_buf_starts, HYPRE_MEMORY_HOST); + hypre_CSRMatrixDestroy(local_matrix); return NULL; } } else /* my_id ==0 */ { - num_types = send_proc_obj.length; - used_procs = hypre_CTAlloc(HYPRE_Int, num_types, HYPRE_MEMORY_HOST); - new_vec_starts = hypre_CTAlloc(HYPRE_Int, num_types+1, HYPRE_MEMORY_HOST); + num_types = send_proc_obj.length; + used_procs = hypre_CTAlloc(HYPRE_Int, num_types, HYPRE_MEMORY_HOST); + new_vec_starts = hypre_CTAlloc(HYPRE_Int, num_types + 1, HYPRE_MEMORY_HOST); new_vec_starts[0] = 0; - for (i=0; i< num_types; i++) + for (i = 0; i < num_types; i++) { used_procs[i] = send_proc_obj.id[i]; - new_vec_starts[i+1] = send_proc_obj.elements[i]+1; + new_vec_starts[i + 1] = send_proc_obj.elements[i] + 1; } - hypre_qsort0(used_procs, 0, num_types-1); + hypre_qsort0(used_procs, 0, num_types - 1); hypre_qsort0(new_vec_starts, 0, num_types); - /*now we need to put into an array to send */ - count = 2*num_types+2; - send_info = hypre_CTAlloc(HYPRE_Int, count, HYPRE_MEMORY_HOST); + + /* Now we need to put into an array to send */ + count = 2 * num_types + 2; + send_info = hypre_CTAlloc(HYPRE_Int, count, HYPRE_MEMORY_HOST); send_info[0] = num_types; - for (i=1; i<= num_types; i++) + for (i = 1; i <= num_types; i++) { - send_info[i] = (HYPRE_BigInt)used_procs[i-1]; + send_info[i] = (HYPRE_BigInt) used_procs[i - 1]; } - for (i=num_types+1; i< count; i++) + for (i = num_types + 1; i < count; i++) { - send_info[i] = new_vec_starts[i-num_types-1]; + send_info[i] = new_vec_starts[i - num_types - 1]; } - requests = hypre_CTAlloc(hypre_MPI_Request, num_types, HYPRE_MEMORY_HOST); - status = hypre_CTAlloc(hypre_MPI_Status, num_types, HYPRE_MEMORY_HOST); + requests = hypre_CTAlloc(hypre_MPI_Request, num_types, HYPRE_MEMORY_HOST); + status = hypre_CTAlloc(hypre_MPI_Status, num_types, HYPRE_MEMORY_HOST); /* don't send to myself - these are sorted so my id would be first*/ start = 0; @@ -1878,32 +2539,29 @@ hypre_ParCSRMatrixToCSRMatrixAll(hypre_ParCSRMatrix *par_matrix) start = 1; } - for (i=start; i < num_types; i++) + for (i = start; i < num_types; i++) { hypre_MPI_Isend(send_info, count, HYPRE_MPI_INT, used_procs[i], tag1, - comm, &requests[i-start]); + comm, &requests[i - start]); } - hypre_MPI_Waitall(num_types-start, requests, status); + hypre_MPI_Waitall(num_types - start, requests, status); hypre_TFree(status, HYPRE_MEMORY_HOST); hypre_TFree(requests, HYPRE_MEMORY_HOST); } - /* clean up */ + + /* Clean up */ hypre_TFree(send_proc_obj.vec_starts, HYPRE_MEMORY_HOST); hypre_TFree(send_proc_obj.id, HYPRE_MEMORY_HOST); hypre_TFree(send_proc_obj.elements, HYPRE_MEMORY_HOST); hypre_TFree(send_info, HYPRE_MEMORY_HOST); - if(response_recv_buf) hypre_TFree(response_recv_buf, HYPRE_MEMORY_HOST); - if(response_recv_buf_starts) hypre_TFree(response_recv_buf_starts, HYPRE_MEMORY_HOST); + hypre_TFree(response_recv_buf, HYPRE_MEMORY_HOST); + hypre_TFree(response_recv_buf_starts, HYPRE_MEMORY_HOST); /* now proc 0 can exit if it has no rows */ if (!local_num_rows) { - if (hypre_CSRMatrixOwnsData(local_matrix)) - hypre_CSRMatrixDestroy(local_matrix); - else - hypre_TFree(local_matrix, HYPRE_MEMORY_HOST); - + hypre_CSRMatrixDestroy(local_matrix); hypre_TFree(new_vec_starts, HYPRE_MEMORY_HOST); hypre_TFree(used_procs, HYPRE_MEMORY_HOST); @@ -1913,20 +2571,19 @@ hypre_ParCSRMatrixToCSRMatrixAll(hypre_ParCSRMatrix *par_matrix) /* everyone left has rows and knows: new_vec_starts, num_types, and used_procs */ /* this matrix should be rather small */ - matrix_i = hypre_CTAlloc(HYPRE_Int, num_rows+1, HYPRE_MEMORY_HOST); + matrix_i = hypre_CTAlloc(HYPRE_Int, num_rows + 1, HYPRE_MEMORY_HOST); - num_requests = 4*num_types; - requests = hypre_CTAlloc(hypre_MPI_Request, num_requests, HYPRE_MEMORY_HOST); - status = hypre_CTAlloc(hypre_MPI_Status, num_requests, HYPRE_MEMORY_HOST); + num_requests = 4 * num_types; + requests = hypre_CTAlloc(hypre_MPI_Request, num_requests, HYPRE_MEMORY_HOST); + status = hypre_CTAlloc(hypre_MPI_Status, num_requests, HYPRE_MEMORY_HOST); /* exchange contents of local_matrix_i - here we are sending to ourself also*/ - j = 0; for (i = 0; i < num_types; i++) { proc_id = used_procs[i]; - vec_len = (HYPRE_Int)(new_vec_starts[i+1] - new_vec_starts[i]); - hypre_MPI_Irecv(&matrix_i[new_vec_starts[i]+1], vec_len, HYPRE_MPI_INT, + vec_len = (HYPRE_Int)(new_vec_starts[i + 1] - new_vec_starts[i]); + hypre_MPI_Irecv(&matrix_i[new_vec_starts[i] + 1], vec_len, HYPRE_MPI_INT, proc_id, tag2, comm, &requests[j++]); } for (i = 0; i < num_types; i++) @@ -1935,46 +2592,43 @@ hypre_ParCSRMatrixToCSRMatrixAll(hypre_ParCSRMatrix *par_matrix) hypre_MPI_Isend(&local_matrix_i[1], local_num_rows, HYPRE_MPI_INT, proc_id, tag2, comm, &requests[j++]); } - hypre_MPI_Waitall(j, requests, status); /* generate matrix_i from received data */ /* global numbering?*/ offset = matrix_i[new_vec_starts[1]]; - for (i=1; i < num_types; i++) + for (i = 1; i < num_types; i++) { - for (j = new_vec_starts[i]; j < new_vec_starts[i+1]; j++) - matrix_i[j+1] += offset; - offset = matrix_i[new_vec_starts[i+1]]; + for (j = new_vec_starts[i]; j < new_vec_starts[i + 1]; j++) + { + matrix_i[j + 1] += offset; + } + offset = matrix_i[new_vec_starts[i + 1]]; } num_nonzeros = matrix_i[num_rows]; matrix = hypre_CSRMatrixCreate(num_rows, num_cols, num_nonzeros); - - hypre_CSRMatrixMemoryLocation(matrix) = HYPRE_MEMORY_HOST; - hypre_CSRMatrixI(matrix) = matrix_i; - hypre_CSRMatrixInitialize(matrix); + hypre_CSRMatrixInitialize_v2(matrix, 0, HYPRE_MEMORY_HOST); matrix_j = hypre_CSRMatrixJ(matrix); matrix_data = hypre_CSRMatrixData(matrix); /* generate datatypes for further data exchange and exchange remaining data, i.e. column info and actual data */ - j = 0; for (i = 0; i < num_types; i++) { proc_id = used_procs[i]; start_index = matrix_i[(HYPRE_Int)new_vec_starts[i]]; - num_data = matrix_i[(HYPRE_Int)new_vec_starts[i+1]] - start_index; + num_data = matrix_i[(HYPRE_Int)new_vec_starts[i + 1]] - start_index; hypre_MPI_Irecv(&matrix_data[start_index], num_data, HYPRE_MPI_COMPLEX, used_procs[i], tag1, comm, &requests[j++]); hypre_MPI_Irecv(&matrix_j[start_index], num_data, HYPRE_MPI_INT, used_procs[i], tag3, comm, &requests[j++]); } local_num_nonzeros = local_matrix_i[local_num_rows]; - for (i=0; i < num_types; i++) + for (i = 0; i < num_types; i++) { hypre_MPI_Isend(local_matrix_data, local_num_nonzeros, HYPRE_MPI_COMPLEX, used_procs[i], tag1, comm, &requests[j++]); @@ -1982,22 +2636,18 @@ hypre_ParCSRMatrixToCSRMatrixAll(hypre_ParCSRMatrix *par_matrix) used_procs[i], tag3, comm, &requests[j++]); } - hypre_MPI_Waitall(num_requests, requests, status); - hypre_TFree(new_vec_starts, HYPRE_MEMORY_HOST); - - if (hypre_CSRMatrixOwnsData(local_matrix)) - hypre_CSRMatrixDestroy(local_matrix); - else - hypre_TFree(local_matrix, HYPRE_MEMORY_HOST); - if (num_requests) { hypre_TFree(requests, HYPRE_MEMORY_HOST); hypre_TFree(status, HYPRE_MEMORY_HOST); hypre_TFree(used_procs, HYPRE_MEMORY_HOST); } + hypre_CSRMatrixDestroy(local_matrix); + + /* Move resulting matrix to the memory location passed as input */ + hypre_CSRMatrixMigrate(matrix, memory_location); return matrix; } @@ -2078,6 +2728,8 @@ hypre_FillResponseParToCSRMatrix( void *p_recv_contact_buf, void **p_send_response_buf, HYPRE_Int *response_message_size ) { + HYPRE_UNUSED_VAR(p_send_response_buf); + HYPRE_Int myid; HYPRE_Int i, index, count, elength; @@ -2092,7 +2744,7 @@ hypre_FillResponseParToCSRMatrix( void *p_recv_contact_buf, /*check to see if we need to allocate more space in send_proc_obj for ids*/ if (send_proc_obj->length == send_proc_obj->storage_length) { - send_proc_obj->storage_length +=10; /*add space for 10 more processors*/ + send_proc_obj->storage_length += 10; /*add space for 10 more processors*/ send_proc_obj->id = hypre_TReAlloc(send_proc_obj->id, HYPRE_Int, send_proc_obj->storage_length, HYPRE_MEMORY_HOST); send_proc_obj->vec_starts = @@ -2117,11 +2769,11 @@ hypre_FillResponseParToCSRMatrix( void *p_recv_contact_buf, send_proc_obj->element_storage_length = elength; } /*populate send_proc_obj*/ - for (i=0; i< contact_size; i++) + for (i = 0; i < contact_size; i++) { send_proc_obj->elements[index++] = recv_contact_buf[i]; } - send_proc_obj->vec_starts[count+1] = index; + send_proc_obj->vec_starts[count + 1] = index; send_proc_obj->length++; /*output - no message to return (confirmation) */ @@ -2132,15 +2784,20 @@ hypre_FillResponseParToCSRMatrix( void *p_recv_contact_buf, /*-------------------------------------------------------------------------- * hypre_ParCSRMatrixUnion + * * Creates and returns a new matrix whose elements are the union of A and B. * Data is not copied, only structural information is created. * A and B must have the same communicator, numbers and distributions of rows * and columns (they can differ in which row-column pairs are nonzero, thus * in which columns are in a offd block) + * + * TODO (VPM): This function should use hypre_ParCSRMatrixCreate to create + * the matrix. *--------------------------------------------------------------------------*/ -hypre_ParCSRMatrix * hypre_ParCSRMatrixUnion( hypre_ParCSRMatrix * A, - hypre_ParCSRMatrix * B ) +hypre_ParCSRMatrix* +hypre_ParCSRMatrixUnion( hypre_ParCSRMatrix *A, + hypre_ParCSRMatrix *B ) { hypre_ParCSRMatrix *C; HYPRE_BigInt *col_map_offd_C = NULL; @@ -2149,7 +2806,7 @@ hypre_ParCSRMatrix * hypre_ParCSRMatrixUnion( hypre_ParCSRMatrix * A, hypre_MPI_Comm_rank(comm, &my_id); - C = hypre_CTAlloc( hypre_ParCSRMatrix, 1 , HYPRE_MEMORY_HOST); + C = hypre_CTAlloc( hypre_ParCSRMatrix, 1, HYPRE_MEMORY_HOST); hypre_ParCSRMatrixComm( C ) = hypre_ParCSRMatrixComm( A ); hypre_ParCSRMatrixGlobalNumRows( C ) = hypre_ParCSRMatrixGlobalNumRows( A ); hypre_ParCSRMatrixGlobalNumCols( C ) = hypre_ParCSRMatrixGlobalNumCols( A ); @@ -2192,20 +2849,27 @@ hypre_ParCSRMatrix * hypre_ParCSRMatrixUnion( hypre_ParCSRMatrix * A, return C; } -/* Perform dual truncation of ParCSR matrix. +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixTruncate + * + * Perform dual truncation of ParCSR matrix. + * * This code is adapted from original BoomerAMGInterpTruncate() + * * A: parCSR matrix to be modified * tol: relative tolerance or truncation factor for dropping small terms * max_row_elmts: maximum number of (largest) nonzero elements to keep. * rescale: Boolean on whether or not to scale resulting matrix. Scaling for - * each row satisfies: sum(nonzero values before dropping)/ sum(nonzero values after dropping), - * this way, the application of the truncated matrix on a constant vector is the same as that of - * the original matrix. + * each row satisfies: sum(nonzero values before dropping) / + * sum(nonzero values after dropping), + * this way, the application of the truncated matrix on a constant vector + * is the same as that of the original matrix. * nrm_type: type of norm used for dropping with tol. * -- 0 = infinity-norm * -- 1 = 1-norm * -- 2 = 2-norm -*/ + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_ParCSRMatrixTruncate(hypre_ParCSRMatrix *A, HYPRE_Real tol, @@ -2238,7 +2902,7 @@ hypre_ParCSRMatrixTruncate(hypre_ParCSRMatrix *A, HYPRE_Int next_open; HYPRE_Int now_checking; HYPRE_Int num_lost; - HYPRE_Int num_lost_global=0; + HYPRE_Int num_lost_global = 0; HYPRE_Int next_open_offd; HYPRE_Int now_checking_offd; HYPRE_Int num_lost_offd; @@ -2277,7 +2941,7 @@ hypre_ParCSRMatrixTruncate(hypre_ParCSRMatrix *A, } #ifdef HYPRE_USING_OPENMP -#pragma omp parallel private(i,my_thread_num,num_threads,row_nrm, drop_coeff,j,start_j,row_sum,scale,num_lost,now_checking,next_open,num_lost_offd,now_checking_offd,next_open_offd,start,stop,cnt_diag,cnt_offd,num_elmts,cnt) + #pragma omp parallel private(i,my_thread_num,num_threads,row_nrm, drop_coeff,j,start_j,row_sum,scale,num_lost,now_checking,next_open,num_lost_offd,now_checking_offd,next_open_offd,start,stop,cnt_diag,cnt_offd,num_elmts,cnt) #endif { my_thread_num = hypre_GetThreadNum(); @@ -2292,7 +2956,7 @@ hypre_ParCSRMatrixTruncate(hypre_ParCSRMatrix *A, /* my row range */ start = (n_fine / num_threads) * my_thread_num; - if (my_thread_num == num_threads-1) + if (my_thread_num == num_threads - 1) { stop = n_fine; } @@ -2321,43 +2985,43 @@ hypre_ParCSRMatrixTruncate(hypre_ParCSRMatrix *A, if (nrm_type == 0) { /* infty-norm */ - for (j = A_diag_i[i]; j < A_diag_i[i+1]; j++) + for (j = A_diag_i[i]; j < A_diag_i[i + 1]; j++) { - row_nrm = (row_nrm < fabs(A_diag_data[j])) ? - fabs(A_diag_data[j]) : row_nrm; + row_nrm = (row_nrm < hypre_cabs(A_diag_data[j])) ? + hypre_cabs(A_diag_data[j]) : row_nrm; } - for (j = A_offd_i[i]; j < A_offd_i[i+1]; j++) + for (j = A_offd_i[i]; j < A_offd_i[i + 1]; j++) { - row_nrm = (row_nrm < fabs(A_offd_data[j])) ? - fabs(A_offd_data[j]) : row_nrm; + row_nrm = (row_nrm < hypre_cabs(A_offd_data[j])) ? + hypre_cabs(A_offd_data[j]) : row_nrm; } } if (nrm_type == 1) { /* 1-norm */ - for (j = A_diag_i[i]; j < A_diag_i[i+1]; j++) + for (j = A_diag_i[i]; j < A_diag_i[i + 1]; j++) { - row_nrm += fabs(A_diag_data[j]); + row_nrm += hypre_cabs(A_diag_data[j]); } - for (j = A_offd_i[i]; j < A_offd_i[i+1]; j++) + for (j = A_offd_i[i]; j < A_offd_i[i + 1]; j++) { - row_nrm += fabs(A_offd_data[j]); + row_nrm += hypre_cabs(A_offd_data[j]); } } if (nrm_type == 2) { /* 2-norm */ - for (j = A_diag_i[i]; j < A_diag_i[i+1]; j++) + for (j = A_diag_i[i]; j < A_diag_i[i + 1]; j++) { HYPRE_Complex v = A_diag_data[j]; - row_nrm += v*v; + row_nrm += v * v; } - for (j = A_offd_i[i]; j < A_offd_i[i+1]; j++) + for (j = A_offd_i[i]; j < A_offd_i[i + 1]; j++) { HYPRE_Complex v = A_offd_data[j]; - row_nrm += v*v; + row_nrm += v * v; } - row_nrm = sqrt(row_nrm); + row_nrm = hypre_sqrt(row_nrm); } drop_coeff = tol * row_nrm; @@ -2368,10 +3032,10 @@ hypre_ParCSRMatrixTruncate(hypre_ParCSRMatrix *A, } row_sum = 0; scale = 0; - for (j = start_j; j < A_diag_i[i+1]; j++) + for (j = start_j; j < A_diag_i[i + 1]; j++) { row_sum += A_diag_data[now_checking]; - if (fabs(A_diag_data[now_checking]) < drop_coeff) + if (hypre_cabs(A_diag_data[now_checking]) < drop_coeff) { num_lost++; now_checking++; @@ -2392,10 +3056,10 @@ hypre_ParCSRMatrixTruncate(hypre_ParCSRMatrix *A, A_offd_i[i] -= num_lost_offd; } - for (j = start_j; j < A_offd_i[i+1]; j++) + for (j = start_j; j < A_offd_i[i + 1]; j++) { row_sum += A_offd_data[now_checking_offd]; - if (fabs(A_offd_data[now_checking_offd]) < drop_coeff) + if (hypre_cabs(A_offd_data[now_checking_offd]) < drop_coeff) { num_lost_offd++; now_checking_offd++; @@ -2415,12 +3079,12 @@ hypre_ParCSRMatrixTruncate(hypre_ParCSRMatrix *A, { if (scale != row_sum) { - scale = row_sum/scale; - for (j = A_diag_i[i]; j < (A_diag_i[i+1]-num_lost); j++) + scale = row_sum / scale; + for (j = A_diag_i[i]; j < (A_diag_i[i + 1] - num_lost); j++) { A_diag_data[j] *= scale; } - for (j = A_offd_i[i]; j < (A_offd_i[i+1]-num_lost_offd); j++) + for (j = A_offd_i[i]; j < (A_offd_i[i + 1] - num_lost_offd); j++) { A_offd_data[j] *= scale; } @@ -2450,18 +3114,18 @@ hypre_ParCSRMatrixTruncate(hypre_ParCSRMatrix *A, /* find maximum row length locally over this row range */ A_mxnum = 0; - for (i=start; i A_mxnum) { A_mxnum = cnt1; @@ -2485,16 +3149,16 @@ hypre_ParCSRMatrixTruncate(hypre_ParCSRMatrix *A, { /* Note A_diag_i[stop] is the starting point for the next thread * in j and data, not the stop point for this thread */ - last_index = A_diag_i[i+1]; - last_index_offd = A_offd_i[i+1]; - if (i == stop-1) + last_index = A_diag_i[i + 1]; + last_index_offd = A_offd_i[i + 1]; + if (i == stop - 1) { last_index -= num_lost_per_thread[my_thread_num]; last_index_offd -= num_lost_offd_per_thread[my_thread_num]; } row_sum = 0; - num_elmts = last_index-A_diag_i[i] + last_index_offd-A_offd_i[i]; + num_elmts = last_index - A_diag_i[i] + last_index_offd - A_offd_i[i]; if (max_row_elmts < num_elmts) { /* copy both diagonal and off-diag parts of row i to _aux_ arrays */ @@ -2509,14 +3173,14 @@ hypre_ParCSRMatrixTruncate(hypre_ParCSRMatrix *A, cnt1 = cnt; for (j = A_offd_i[i]; j < last_index_offd; j++) { - A_aux_j[cnt] = A_offd_j[j]+num_cols; + A_aux_j[cnt] = A_offd_j[j] + num_cols; A_aux_data[cnt++] = A_offd_data[j]; row_sum += A_offd_data[j]; } - num_lost_offd += cnt-cnt1; + num_lost_offd += cnt - cnt1; /* sort data */ - hypre_qsort2_abs(A_aux_j,A_aux_data,0,cnt-1); + hypre_qsort2_abs(A_aux_j, A_aux_data, 0, cnt - 1); scale = 0; if (i > start) { @@ -2533,19 +3197,19 @@ hypre_ParCSRMatrixTruncate(hypre_ParCSRMatrix *A, } else { - A_offd_j[cnt_offd] = A_aux_j[j]-num_cols; + A_offd_j[cnt_offd] = A_aux_j[j] - num_cols; A_offd_data[cnt_offd++] = A_aux_data[j]; } } - num_lost -= cnt_diag-A_diag_i[i]; - num_lost_offd -= cnt_offd-A_offd_i[i]; + num_lost -= cnt_diag - A_diag_i[i]; + num_lost_offd -= cnt_offd - A_offd_i[i]; /* scale row of A */ if (rescale && (scale != 0.)) { if (scale != row_sum) { - scale = row_sum/scale; + scale = row_sum / scale; for (j = A_diag_i[i]; j < cnt_diag; j++) { A_diag_data[j] *= scale; @@ -2573,7 +3237,7 @@ hypre_ParCSRMatrixTruncate(hypre_ParCSRMatrix *A, } else { - cnt_diag += last_index-A_diag_i[i]; + cnt_diag += last_index - A_diag_i[i]; } if (A_offd_i[i] != cnt_offd) @@ -2588,7 +3252,7 @@ hypre_ParCSRMatrixTruncate(hypre_ParCSRMatrix *A, } else { - cnt_offd += last_index_offd-A_offd_i[i]; + cnt_offd += last_index_offd - A_offd_i[i]; } } } /* end for (i = 0; i < n_fine; i++) */ @@ -2604,7 +3268,7 @@ hypre_ParCSRMatrixTruncate(hypre_ParCSRMatrix *A, /* Sum up num_lost_global */ #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif if (my_thread_num == 0) { @@ -2617,7 +3281,7 @@ hypre_ParCSRMatrixTruncate(hypre_ParCSRMatrix *A, } } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif /* @@ -2642,7 +3306,7 @@ hypre_ParCSRMatrixTruncate(hypre_ParCSRMatrix *A, A_diag_size -= num_lost_per_thread[i]; if (i > 0) { - cum_lost_per_thread[i] = num_lost_per_thread[i] + cum_lost_per_thread[i-1]; + cum_lost_per_thread[i] = num_lost_per_thread[i] + cum_lost_per_thread[i - 1]; } else { @@ -2654,7 +3318,7 @@ hypre_ParCSRMatrixTruncate(hypre_ParCSRMatrix *A, A_diag_data_new = hypre_CTAlloc(HYPRE_Real, A_diag_size, memory_location_diag); } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif /* points to next open spot in new data structures for this thread */ @@ -2666,7 +3330,7 @@ hypre_ParCSRMatrixTruncate(hypre_ParCSRMatrix *A, { /* remember, cum_lost_per_thread[k] stores the num dropped up to and * including thread k */ - next_open = A_diag_i[start] - cum_lost_per_thread[my_thread_num-1]; + next_open = A_diag_i[start] - cum_lost_per_thread[my_thread_num - 1]; } /* copy the j and data arrays over */ @@ -2678,15 +3342,15 @@ hypre_ParCSRMatrixTruncate(hypre_ParCSRMatrix *A, } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif /* update A_diag_i with number of dropped entries by all lower ranked * threads */ if (my_thread_num > 0) { - for (i=start; i 0) { - cum_lost_per_thread[i] = num_lost_offd_per_thread[i] + cum_lost_per_thread[i-1]; + cum_lost_per_thread[i] = num_lost_offd_per_thread[i] + cum_lost_per_thread[i - 1]; } else { @@ -2732,7 +3396,7 @@ hypre_ParCSRMatrixTruncate(hypre_ParCSRMatrix *A, A_offd_data_new = hypre_CTAlloc(HYPRE_Real, A_offd_size, memory_location_offd); } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif /* points to next open spot in new data structures for this thread */ @@ -2744,7 +3408,7 @@ hypre_ParCSRMatrixTruncate(hypre_ParCSRMatrix *A, { /* remember, cum_lost_per_thread[k] stores the num dropped up to and * including thread k */ - next_open = A_offd_i[start] - cum_lost_per_thread[my_thread_num-1]; + next_open = A_offd_i[start] - cum_lost_per_thread[my_thread_num - 1]; } /* copy the j and data arrays over */ @@ -2756,15 +3420,15 @@ hypre_ParCSRMatrixTruncate(hypre_ParCSRMatrix *A, } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif /* update A_offd_i with number of dropped entries by all lower ranked * threads */ if (my_thread_num > 0) { - for (i=start; i global_num_rows) #define hypre_ParCSRMatrixGlobalNumCols(matrix) ((matrix) -> global_num_cols) #define hypre_ParCSRMatrixGlobalNumRownnz(matrix) ((matrix) -> global_num_rownnz) +#define hypre_ParCSRMatrixNumNonzeros(matrix) ((matrix) -> num_nonzeros) +#define hypre_ParCSRMatrixDNumNonzeros(matrix) ((matrix) -> d_num_nonzeros) #define hypre_ParCSRMatrixFirstRowIndex(matrix) ((matrix) -> first_row_index) #define hypre_ParCSRMatrixFirstColDiag(matrix) ((matrix) -> first_col_diag) #define hypre_ParCSRMatrixLastRowIndex(matrix) ((matrix) -> last_row_index) @@ -108,15 +110,13 @@ typedef struct hypre_ParCSRMatrix_struct #define hypre_ParCSRMatrixCommPkg(matrix) ((matrix) -> comm_pkg) #define hypre_ParCSRMatrixCommPkgT(matrix) ((matrix) -> comm_pkgT) #define hypre_ParCSRMatrixOwnsData(matrix) ((matrix) -> owns_data) -#define hypre_ParCSRMatrixNumNonzeros(matrix) ((matrix) -> num_nonzeros) -#define hypre_ParCSRMatrixDNumNonzeros(matrix) ((matrix) -> d_num_nonzeros) #define hypre_ParCSRMatrixRowindices(matrix) ((matrix) -> rowindices) #define hypre_ParCSRMatrixRowvalues(matrix) ((matrix) -> rowvalues) #define hypre_ParCSRMatrixGetrowactive(matrix) ((matrix) -> getrowactive) #define hypre_ParCSRMatrixAssumedPartition(matrix) ((matrix) -> assumed_partition) #define hypre_ParCSRMatrixOwnsAssumedPartition(matrix) ((matrix) -> owns_assumed_partition) #define hypre_ParCSRMatrixProcOrdering(matrix) ((matrix) -> proc_ordering) -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) #define hypre_ParCSRMatrixSocDiagJ(matrix) ((matrix) -> soc_diag_j) #define hypre_ParCSRMatrixSocOffdJ(matrix) ((matrix) -> soc_offd_j) #endif @@ -124,18 +124,38 @@ typedef struct hypre_ParCSRMatrix_struct #define hypre_ParCSRMatrixNumRows(matrix) hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(matrix)) #define hypre_ParCSRMatrixNumCols(matrix) hypre_CSRMatrixNumCols(hypre_ParCSRMatrixDiag(matrix)) -static inline HYPRE_MemoryLocation +static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_MemoryLocation hypre_ParCSRMatrixMemoryLocation(hypre_ParCSRMatrix *matrix) { - HYPRE_MemoryLocation memory_diag = hypre_CSRMatrixMemoryLocation(hypre_ParCSRMatrixDiag(matrix)); - HYPRE_MemoryLocation memory_offd = hypre_CSRMatrixMemoryLocation(hypre_ParCSRMatrixOffd(matrix)); + if (!matrix) { return HYPRE_MEMORY_UNDEFINED; } - if (memory_diag != memory_offd) + hypre_CSRMatrix *diag = hypre_ParCSRMatrixDiag(matrix); + hypre_CSRMatrix *offd = hypre_ParCSRMatrixOffd(matrix); + HYPRE_MemoryLocation memory_diag = diag ? hypre_CSRMatrixMemoryLocation( + diag) : HYPRE_MEMORY_UNDEFINED; + HYPRE_MemoryLocation memory_offd = offd ? hypre_CSRMatrixMemoryLocation( + offd) : HYPRE_MEMORY_UNDEFINED; + + if (diag && offd) { - hypre_printf("Warning: ParCSRMatrix Memory Location Diag (%d) != Offd (%d)\n", memory_diag, memory_offd); - hypre_assert(0); + if (memory_diag != memory_offd) + { + char err_msg[1024]; + hypre_sprintf(err_msg, "Error: ParCSRMatrix Memory Location Diag (%d) != Offd (%d)\n", memory_diag, + memory_offd); + hypre_error_w_msg(HYPRE_ERROR_MEMORY, err_msg); + hypre_assert(0); + + return HYPRE_MEMORY_UNDEFINED; + } + + return memory_diag; } - return memory_diag; + + if (diag) { return memory_diag; } + if (offd) { return memory_offd; } + + return HYPRE_MEMORY_UNDEFINED; } /*-------------------------------------------------------------------------- diff --git a/external/hypre/src/parcsr_mv/par_csr_matrix_stats.c b/external/hypre/src/parcsr_mv/par_csr_matrix_stats.c new file mode 100644 index 00000000..6842272a --- /dev/null +++ b/external/hypre/src/parcsr_mv/par_csr_matrix_stats.c @@ -0,0 +1,497 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +/****************************************************************************** + * + * Member functions for matrix statistics specialized to ParCSRMatrix types + * + *****************************************************************************/ + +#include "_hypre_parcsr_mv.h" + +/* Shortcuts */ +#define sendbuffer(i, j, lda) sendbuffer[i * lda + j] +#define recvbuffer(i, j, lda) recvbuffer[i * lda + j] + +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixStatsComputePassOneLocalHost + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixStatsComputePassOneLocalHost(hypre_ParCSRMatrix *A, + hypre_MatrixStats *stats) +{ + /* Diag matrix data */ + hypre_CSRMatrix *diag; + HYPRE_Int *diag_i; + HYPRE_Complex *diag_a; + + /* Offd matrix data */ + hypre_CSRMatrix *offd; + HYPRE_Int *offd_i; + HYPRE_Complex *offd_a; + + /* Local arrays */ + hypre_ulonglongint *actual_nonzeros; + HYPRE_Int *nnzrow_min; + HYPRE_Int *nnzrow_max; + HYPRE_Real *rowsum_min; + HYPRE_Real *rowsum_max; + HYPRE_Real *rowsum_avg; + + /* Local variables */ + HYPRE_Int i, j; + HYPRE_Int num_rows; + HYPRE_Int num_threads = hypre_NumThreads(); + + /* Allocate memory */ + actual_nonzeros = hypre_TAlloc(hypre_ulonglongint, num_threads, HYPRE_MEMORY_HOST); + nnzrow_min = hypre_TAlloc(HYPRE_Int, num_threads, HYPRE_MEMORY_HOST); + nnzrow_max = hypre_TAlloc(HYPRE_Int, num_threads, HYPRE_MEMORY_HOST); + rowsum_min = hypre_TAlloc(HYPRE_Real, num_threads, HYPRE_MEMORY_HOST); + rowsum_max = hypre_TAlloc(HYPRE_Real, num_threads, HYPRE_MEMORY_HOST); + rowsum_avg = hypre_TAlloc(HYPRE_Real, num_threads, HYPRE_MEMORY_HOST); + + /* ParCSRMatrix info */ + num_rows = hypre_ParCSRMatrixNumRows(A); + + /* Diag matrix data */ + diag = hypre_ParCSRMatrixDiag(A); + diag_i = hypre_CSRMatrixI(diag); + diag_a = hypre_CSRMatrixData(diag); + + /* Offd matrix data */ + offd = hypre_ParCSRMatrixOffd(A); + offd_i = hypre_CSRMatrixI(offd); + offd_a = hypre_CSRMatrixData(offd); + + /* Initialize local thread arrays */ + for (i = 0; i < num_threads; i++) + { + actual_nonzeros[i] = 0ULL; + nnzrow_min[i] = hypre_pow2(30); + nnzrow_max[i] = 0; + rowsum_min[i] = hypre_pow(2, 100); + rowsum_max[i] = - hypre_pow(2, 100); + rowsum_avg[i] = 0.0; + } + +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel private(i, j) +#endif + { + HYPRE_Int nnzrow, ns, ne; + HYPRE_Int mytid = hypre_GetThreadNum(); + HYPRE_Real threshold = hypre_MatrixStatsActualThreshold(stats); + HYPRE_Real rowsum; + + hypre_partition1D(num_rows, hypre_NumActiveThreads(), mytid, &ns, &ne); + + for (i = ns; i < ne; i++) + { + nnzrow = (diag_i[i + 1] - diag_i[i]) + (offd_i[i + 1] - offd_i[i]); + + rowsum = 0.0; + for (j = diag_i[i]; j < diag_i[i + 1]; j++) + { + actual_nonzeros[mytid] += (hypre_cabs(diag_a[j]) > threshold) ? 1 : 0; + rowsum += diag_a[j]; + } + + for (j = offd_i[i]; j < offd_i[i + 1]; j++) + { + actual_nonzeros[mytid] += (hypre_cabs(offd_a[j]) > threshold) ? 1 : 0; + rowsum += offd_a[j]; + } + + /* Update sum quantities */ + rowsum_avg[mytid] += rowsum; + + /* Update min quantities */ + nnzrow_min[mytid] = (nnzrow_min[mytid] > nnzrow) ? nnzrow : nnzrow_min[mytid]; + rowsum_min[mytid] = (rowsum_min[mytid] > rowsum) ? rowsum : rowsum_min[mytid]; + + /* Update max quantities */ + nnzrow_max[mytid] = (nnzrow_max[mytid] < nnzrow) ? nnzrow : nnzrow_max[mytid]; + rowsum_max[mytid] = (rowsum_max[mytid] < rowsum) ? rowsum : rowsum_max[mytid]; + } + } /* end of parallel region */ + + /* Reduce along threads */ + for (i = 1; i < num_threads; i++) + { + actual_nonzeros[0] += actual_nonzeros[i]; + rowsum_avg[0] += rowsum_avg[i]; + + nnzrow_min[0] = hypre_min(nnzrow_min[0], nnzrow_min[i]); + nnzrow_max[0] = hypre_max(nnzrow_max[0], nnzrow_max[i]); + + rowsum_min[0] = hypre_min(rowsum_min[0], rowsum_min[i]); + rowsum_max[0] = hypre_max(rowsum_max[0], rowsum_max[i]); + } + + /* Set output values */ + hypre_MatrixStatsActualNonzeros(stats) = actual_nonzeros[0]; + + hypre_MatrixStatsNnzrowMin(stats) = nnzrow_min[0]; + hypre_MatrixStatsNnzrowMax(stats) = nnzrow_max[0]; + + hypre_MatrixStatsRowsumMin(stats) = rowsum_min[0]; + hypre_MatrixStatsRowsumMax(stats) = rowsum_max[0]; + hypre_MatrixStatsRowsumAvg(stats) = rowsum_avg[0]; + + /* Free memory */ + hypre_TFree(actual_nonzeros, HYPRE_MEMORY_HOST); + hypre_TFree(nnzrow_min, HYPRE_MEMORY_HOST); + hypre_TFree(nnzrow_max, HYPRE_MEMORY_HOST); + hypre_TFree(rowsum_min, HYPRE_MEMORY_HOST); + hypre_TFree(rowsum_max, HYPRE_MEMORY_HOST); + hypre_TFree(rowsum_avg, HYPRE_MEMORY_HOST); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixStatsComputePassTwoLocalHost + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixStatsComputePassTwoLocalHost(hypre_ParCSRMatrix *A, + hypre_MatrixStats *stats) +{ + /* Diag matrix data */ + hypre_CSRMatrix *diag; + HYPRE_Int *diag_i; + HYPRE_Complex *diag_a; + + /* Offd matrix data */ + hypre_CSRMatrix *offd; + HYPRE_Int *offd_i; + HYPRE_Complex *offd_a; + + /* Local arrays */ + HYPRE_Real *nnzrow_avg; + HYPRE_Real *rowsum_avg; + HYPRE_Real *nnzrow_sqsum; + HYPRE_Real *rowsum_sqsum; + + /* Local variables */ + HYPRE_Int i, j; + HYPRE_Int num_rows; + HYPRE_Int num_threads = hypre_NumThreads(); + HYPRE_Int nnzrow; + + /* Allocate memory */ + nnzrow_avg = hypre_TAlloc(HYPRE_Real, num_threads, HYPRE_MEMORY_HOST); + rowsum_avg = hypre_TAlloc(HYPRE_Real, num_threads, HYPRE_MEMORY_HOST); + nnzrow_sqsum = hypre_TAlloc(HYPRE_Real, num_threads, HYPRE_MEMORY_HOST); + rowsum_sqsum = hypre_TAlloc(HYPRE_Real, num_threads, HYPRE_MEMORY_HOST); + + /* Initialize matrix variables */ + diag = hypre_ParCSRMatrixDiag(A); + offd = hypre_ParCSRMatrixOffd(A); + diag_i = hypre_CSRMatrixI(diag); + offd_i = hypre_CSRMatrixI(offd); + diag_a = hypre_CSRMatrixData(diag); + offd_a = hypre_CSRMatrixData(offd); + num_rows = hypre_CSRMatrixNumRows(diag); + + /* Initialize local thread variables */ + for (i = 0; i < num_threads; i++) + { + rowsum_avg[i] = hypre_MatrixStatsRowsumAvg(stats); + nnzrow_avg[i] = hypre_MatrixStatsNnzrowAvg(stats); + nnzrow_sqsum[i] = 0.0; + rowsum_sqsum[i] = 0.0; + } + +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel private(i, j) +#endif + { + HYPRE_Int ns, ne; + HYPRE_Int mytid = hypre_GetThreadNum(); + HYPRE_Real rowsum; + + hypre_partition1D(num_rows, hypre_NumActiveThreads(), mytid, &ns, &ne); + + for (i = ns; i < ne; i++) + { + nnzrow = (diag_i[i + 1] - diag_i[i]) + (offd_i[i + 1] - offd_i[i]); + + rowsum = 0.0; + for (j = diag_i[i]; j < diag_i[i + 1]; j++) + { + rowsum += diag_a[j]; + } + + for (j = offd_i[i]; j < offd_i[i + 1]; j++) + { + rowsum += offd_a[j]; + } + + /* Update sum quantities */ + nnzrow_sqsum[mytid] += hypre_squared((HYPRE_Real) nnzrow - nnzrow_avg[mytid]); + rowsum_sqsum[mytid] += hypre_squared(rowsum - rowsum_avg[mytid]); + } + } /* end of parallel region */ + + /* Reduce along threads */ + for (i = 1; i < num_threads; i++) + { + nnzrow_sqsum[0] += nnzrow_sqsum[i]; + rowsum_sqsum[0] += rowsum_sqsum[i]; + } + + /* Set output values */ + hypre_MatrixStatsNnzrowSqsum(stats) = nnzrow_sqsum[0]; + hypre_MatrixStatsRowsumSqsum(stats) = rowsum_sqsum[0]; + + /* Free memory */ + hypre_TFree(nnzrow_sqsum, HYPRE_MEMORY_HOST); + hypre_TFree(rowsum_sqsum, HYPRE_MEMORY_HOST); + hypre_TFree(nnzrow_avg, HYPRE_MEMORY_HOST); + hypre_TFree(rowsum_avg, HYPRE_MEMORY_HOST); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixStatsComputePassOneLocal + * + * Compute the first pass of matrix statistics locally on a rank consisting + * of average (avg), minimum (min) and maximum (max) quantities. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixStatsComputePassOneLocal(hypre_ParCSRMatrix *A, + hypre_MatrixStats *stats) +{ + /* Call backend implementations */ +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1(hypre_ParCSRMatrixMemoryLocation(A)); + + if (exec == HYPRE_EXEC_DEVICE) + { + /* TODO (VPM): Implement computation on device */ + hypre_ParCSRMatrix *h_A = hypre_ParCSRMatrixClone_v2(A, 1, HYPRE_MEMORY_HOST); + hypre_ParCSRMatrixStatsComputePassOneLocalHost(h_A, stats); + hypre_ParCSRMatrixDestroy(h_A); + } + else +#endif + { + hypre_ParCSRMatrixStatsComputePassOneLocalHost(A, stats); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixStatsComputePassTwoLocal + * + * Compute the second pass of matrix statistics locally on a rank consisting + * of squared sum (sqsum) and standard deviation (stdev) quantities. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixStatsComputePassTwoLocal(hypre_ParCSRMatrix *A, + hypre_MatrixStats *stats) +{ + /* Call backend implementations */ +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1(hypre_ParCSRMatrixMemoryLocation(A)); + + if (exec == HYPRE_EXEC_DEVICE) + { + /* TODO (VPM): Implement computation on device */ + hypre_ParCSRMatrix *h_A = hypre_ParCSRMatrixClone_v2(A, 1, HYPRE_MEMORY_HOST); + hypre_ParCSRMatrixStatsComputePassTwoLocalHost(h_A, stats); + hypre_ParCSRMatrixDestroy(h_A); + } + else +#endif + { + hypre_ParCSRMatrixStatsComputePassTwoLocalHost(A, stats); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixStatsArrayCompute + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixStatsArrayCompute(HYPRE_Int num_matrices, + hypre_ParCSRMatrix **matrices, + hypre_MatrixStatsArray *stats_array) +{ + hypre_MatrixStats *stats; + + /* MPI buffers */ + HYPRE_Real *recvbuffer; + HYPRE_Real *sendbuffer; + + /* Local variables */ + MPI_Comm comm; + hypre_CSRMatrix *diag; + hypre_CSRMatrix *offd; + HYPRE_Int i; + HYPRE_BigInt global_num_rows; + HYPRE_Real global_size; + + /* Sanity check */ + if (num_matrices < 1) + { + return hypre_error_flag; + } + + /* We assume all MPI communicators are equal */ + comm = hypre_ParCSRMatrixComm(matrices[0]); + + /* Allocate MPI buffers */ + recvbuffer = hypre_CTAlloc(HYPRE_Real, 4 * num_matrices, HYPRE_MEMORY_HOST); + sendbuffer = hypre_CTAlloc(HYPRE_Real, 4 * num_matrices, HYPRE_MEMORY_HOST); + + /* Set matrix dimensions */ + for (i = 0; i < num_matrices; i++) + { + stats = hypre_MatrixStatsArrayEntry(stats_array, i); + + hypre_MatrixStatsNumRows(stats) = hypre_ParCSRMatrixGlobalNumRows(matrices[i]); + hypre_MatrixStatsNumCols(stats) = hypre_ParCSRMatrixGlobalNumCols(matrices[i]); + } + + /*------------------------------------------------- + * First pass for computing statistics + *-------------------------------------------------*/ + + for (i = 0; i < num_matrices; i++) + { + stats = hypre_MatrixStatsArrayEntry(stats_array, i); + + hypre_ParCSRMatrixStatsComputePassOneLocal(matrices[i], stats); + } + + /*------------------------------------------------- + * Global reduce for min/max quantities + *-------------------------------------------------*/ + + /* Pack MPI buffers */ + for (i = 0; i < num_matrices; i++) + { + stats = hypre_MatrixStatsArrayEntry(stats_array, i); + + sendbuffer(i, 0, 4) = (HYPRE_Real) - hypre_MatrixStatsNnzrowMin(stats); + sendbuffer(i, 1, 4) = (HYPRE_Real) hypre_MatrixStatsNnzrowMax(stats); + sendbuffer(i, 2, 4) = (HYPRE_Real) - hypre_MatrixStatsRowsumMin(stats); + sendbuffer(i, 3, 4) = (HYPRE_Real) hypre_MatrixStatsRowsumMax(stats); + } + + hypre_MPI_Reduce(sendbuffer, recvbuffer, 4 * num_matrices, + HYPRE_MPI_REAL, hypre_MPI_MAX, 0, comm); + + /* Unpack MPI buffers */ + for (i = 0; i < num_matrices; i++) + { + stats = hypre_MatrixStatsArrayEntry(stats_array, i); + + hypre_MatrixStatsNnzrowMin(stats) = (HYPRE_Int) - recvbuffer(i, 0, 4); + hypre_MatrixStatsNnzrowMax(stats) = (HYPRE_Int) recvbuffer(i, 1, 4); + hypre_MatrixStatsRowsumMin(stats) = (HYPRE_Real) - recvbuffer(i, 2, 4); + hypre_MatrixStatsRowsumMax(stats) = (HYPRE_Real) recvbuffer(i, 3, 4); + } + + /*------------------------------------------------- + * Global reduce for summation quantities + *-------------------------------------------------*/ + + /* Pack MPI buffers */ + for (i = 0; i < num_matrices; i++) + { + stats = hypre_MatrixStatsArrayEntry(stats_array, i); + diag = hypre_ParCSRMatrixDiag(matrices[i]); + offd = hypre_ParCSRMatrixOffd(matrices[i]); + + sendbuffer(i, 0, 3) = (HYPRE_Real) (hypre_CSRMatrixNumNonzeros(diag) + + hypre_CSRMatrixNumNonzeros(offd)); + sendbuffer(i, 1, 3) = (HYPRE_Real) hypre_MatrixStatsActualNonzeros(stats); + sendbuffer(i, 2, 3) = (HYPRE_Real) hypre_MatrixStatsRowsumAvg(stats); + } + + hypre_MPI_Reduce(sendbuffer, recvbuffer, 3 * num_matrices, + HYPRE_MPI_REAL, hypre_MPI_SUM, 0, comm); + + /* Unpack MPI buffers */ + for (i = 0; i < num_matrices; i++) + { + stats = hypre_MatrixStatsArrayEntry(stats_array, i); + global_num_rows = hypre_ParCSRMatrixGlobalNumRows(matrices[i]); + global_size = hypre_squared((HYPRE_Real) global_num_rows); + + hypre_MatrixStatsNumNonzeros(stats) = (hypre_ulonglongint) recvbuffer(i, 0, 3); + hypre_MatrixStatsActualNonzeros(stats) = (hypre_ulonglongint) recvbuffer(i, 1, 3); + hypre_MatrixStatsRowsumAvg(stats) = (HYPRE_Real) recvbuffer(i, 2, 3) / + (HYPRE_Real) global_num_rows; + hypre_MatrixStatsNnzrowAvg(stats) = (HYPRE_Real) recvbuffer(i, 0, 3) / + (HYPRE_Real) global_num_rows; + + hypre_MatrixStatsSparsity(stats) = 100.0 * (1.0 - recvbuffer(i, 0, 3) / global_size); + + hypre_ParCSRMatrixNumNonzeros(matrices[i]) = (HYPRE_Int) recvbuffer(i, 0, 3); + hypre_ParCSRMatrixDNumNonzeros(matrices[i]) = (HYPRE_Real) recvbuffer(i, 0, 3); + } + + /*------------------------------------------------- + * Second pass for computing statistics + *-------------------------------------------------*/ + + for (i = 0; i < num_matrices; i++) + { + stats = hypre_MatrixStatsArrayEntry(stats_array, i); + + hypre_ParCSRMatrixStatsComputePassTwoLocal(matrices[i], stats); + } + + /*------------------------------------------------- + * Global reduce for summation quantities + *-------------------------------------------------*/ + + /* Pack MPI buffers */ + for (i = 0; i < num_matrices; i++) + { + stats = hypre_MatrixStatsArrayEntry(stats_array, i); + + sendbuffer(i, 0, 2) = hypre_MatrixStatsNnzrowSqsum(stats); + sendbuffer(i, 1, 2) = hypre_MatrixStatsRowsumSqsum(stats); + } + + hypre_MPI_Reduce(sendbuffer, recvbuffer, 2 * num_matrices, + HYPRE_MPI_REAL, hypre_MPI_SUM, 0, comm); + + /* Unpack MPI buffers */ + for (i = 0; i < num_matrices; i++) + { + stats = hypre_MatrixStatsArrayEntry(stats_array, i); + global_num_rows = hypre_ParCSRMatrixGlobalNumRows(matrices[i]); + + hypre_MatrixStatsNnzrowSqsum(stats) = recvbuffer(i, 0, 2); + hypre_MatrixStatsRowsumSqsum(stats) = recvbuffer(i, 1, 2); + + hypre_MatrixStatsNnzrowStDev(stats) = hypre_sqrt(recvbuffer(i, 0, 2) / + (HYPRE_Real) global_num_rows); + hypre_MatrixStatsRowsumStDev(stats) = hypre_sqrt(recvbuffer(i, 1, 2) / + (HYPRE_Real) global_num_rows); + } + + /* Free MPI buffers */ + hypre_TFree(recvbuffer, HYPRE_MEMORY_HOST); + hypre_TFree(sendbuffer, HYPRE_MEMORY_HOST); + + return hypre_error_flag; +} diff --git a/external/hypre/src/parcsr_mv/par_csr_matvec.c b/external/hypre/src/parcsr_mv/par_csr_matvec.c index a2f6ff84..d9ff56f7 100644 --- a/external/hypre/src/parcsr_mv/par_csr_matvec.c +++ b/external/hypre/src/parcsr_mv/par_csr_matvec.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -12,53 +12,45 @@ *****************************************************************************/ #include "_hypre_parcsr_mv.h" -#include "_hypre_utilities.hpp" //RL: TODO par_csr_matvec_device.c, include cuda there /*-------------------------------------------------------------------------- - * hypre_ParCSRMatrixMatvec + * hypre_ParCSRMatrixMatvecOutOfPlaceHost *--------------------------------------------------------------------------*/ -// y = alpha*A*x + beta*b + HYPRE_Int -hypre_ParCSRMatrixMatvecOutOfPlace( HYPRE_Complex alpha, - hypre_ParCSRMatrix *A, - hypre_ParVector *x, - HYPRE_Complex beta, - hypre_ParVector *b, - hypre_ParVector *y ) +hypre_ParCSRMatrixMatvecOutOfPlaceHost( HYPRE_Complex alpha, + hypre_ParCSRMatrix *A, + hypre_ParVector *x, + HYPRE_Complex beta, + hypre_ParVector *b, + hypre_ParVector *y ) { - hypre_ParCSRCommHandle **comm_handle; hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); - hypre_CSRMatrix *diag = hypre_ParCSRMatrixDiag(A); - hypre_CSRMatrix *offd = hypre_ParCSRMatrixOffd(A); + hypre_CSRMatrix *diag = hypre_ParCSRMatrixDiag(A); + hypre_CSRMatrix *offd = hypre_ParCSRMatrixOffd(A); - hypre_Vector *x_local = hypre_ParVectorLocalVector(x); - hypre_Vector *b_local = hypre_ParVectorLocalVector(b); - hypre_Vector *y_local = hypre_ParVectorLocalVector(y); - hypre_Vector *x_tmp; + hypre_Vector *x_local = hypre_ParVectorLocalVector(x); + hypre_Vector *b_local = hypre_ParVectorLocalVector(b); + hypre_Vector *y_local = hypre_ParVectorLocalVector(y); + hypre_Vector *x_tmp; - HYPRE_BigInt num_rows = hypre_ParCSRMatrixGlobalNumRows(A); - HYPRE_BigInt num_cols = hypre_ParCSRMatrixGlobalNumCols(A); - HYPRE_BigInt x_size = hypre_ParVectorGlobalSize(x); - HYPRE_BigInt b_size = hypre_ParVectorGlobalSize(b); - HYPRE_BigInt y_size = hypre_ParVectorGlobalSize(y); + HYPRE_BigInt num_rows = hypre_ParCSRMatrixGlobalNumRows(A); + HYPRE_BigInt num_cols = hypre_ParCSRMatrixGlobalNumCols(A); + HYPRE_BigInt x_size = hypre_ParVectorGlobalSize(x); + HYPRE_BigInt b_size = hypre_ParVectorGlobalSize(b); + HYPRE_BigInt y_size = hypre_ParVectorGlobalSize(y); - HYPRE_Int num_vectors = hypre_VectorNumVectors(x_local); - HYPRE_Int num_cols_offd = hypre_CSRMatrixNumCols(offd); - HYPRE_Int ierr = 0; - HYPRE_Int num_sends, jv; + HYPRE_Int num_cols_offd = hypre_CSRMatrixNumCols(offd); + HYPRE_Int num_recvs, num_sends; + HYPRE_Int ierr = 0; - HYPRE_Int vecstride = hypre_VectorVectorStride( x_local ); - HYPRE_Int idxstride = hypre_VectorIndexStride( x_local ); - - HYPRE_Complex *x_tmp_data, **x_buf_data; - HYPRE_Complex *x_local_data = hypre_VectorData(x_local); - -#if defined(HYPRE_USING_GPU) - HYPRE_Int sync_stream; - hypre_GetSyncCudaCompute(&sync_stream); - hypre_SetSyncCudaCompute(0); -#endif + HYPRE_Int i; + HYPRE_Int idxstride = hypre_VectorIndexStride(x_local); + HYPRE_Int num_vectors = hypre_VectorNumVectors(x_local); + HYPRE_Complex *x_local_data = hypre_VectorData(x_local); + HYPRE_Complex *x_tmp_data; + HYPRE_Complex *x_buf_data; HYPRE_ANNOTATE_FUNC_BEGIN; @@ -72,7 +64,7 @@ hypre_ParCSRMatrixMatvecOutOfPlace( HYPRE_Complex alpha, * these conditions terminates processing, and the ierr flag * is informational only. *--------------------------------------------------------------------*/ - hypre_assert( idxstride>0 ); + hypre_assert( idxstride > 0 ); if (num_cols != x_size) { @@ -92,14 +84,15 @@ hypre_ParCSRMatrixMatvecOutOfPlace( HYPRE_Complex alpha, hypre_assert( hypre_VectorNumVectors(b_local) == num_vectors ); hypre_assert( hypre_VectorNumVectors(y_local) == num_vectors ); - if ( num_vectors == 1 ) + if (num_vectors == 1) { - x_tmp = hypre_SeqVectorCreate( num_cols_offd ); + x_tmp = hypre_SeqVectorCreate(num_cols_offd); } else { - hypre_assert( num_vectors > 1 ); - x_tmp = hypre_SeqMultiVectorCreate( num_cols_offd, num_vectors ); + hypre_assert(num_vectors > 1); + x_tmp = hypre_SeqMultiVectorCreate(num_cols_offd, num_vectors); + hypre_VectorMultiVecStorageMethod(x_tmp) = 1; } /*--------------------------------------------------------------------- @@ -112,155 +105,73 @@ hypre_ParCSRMatrixMatvecOutOfPlace( HYPRE_Complex alpha, comm_pkg = hypre_ParCSRMatrixCommPkg(A); } + /* Update send_map_starts, send_map_elmts, and recv_vec_starts when doing + sparse matrix/multivector product */ + hypre_ParCSRCommPkgUpdateVecStarts(comm_pkg, num_vectors, + hypre_VectorVectorStride(hypre_ParVectorLocalVector(x)), + hypre_VectorIndexStride(hypre_ParVectorLocalVector(x))); + + num_recvs = hypre_ParCSRCommPkgNumRecvs(comm_pkg); num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - hypre_assert( num_cols_offd == hypre_ParCSRCommPkgRecvVecStart(comm_pkg, hypre_ParCSRCommPkgNumRecvs(comm_pkg)) ); + + hypre_assert( num_cols_offd * num_vectors == + hypre_ParCSRCommPkgRecvVecStart(comm_pkg, num_recvs) ); + hypre_assert( hypre_ParCSRCommPkgRecvVecStart(comm_pkg, 0) == 0 ); hypre_assert( hypre_ParCSRCommPkgSendMapStart(comm_pkg, 0) == 0 ); #ifdef HYPRE_PROFILE hypre_profile_times[HYPRE_TIMER_ID_PACK_UNPACK] -= hypre_MPI_Wtime(); #endif - HYPRE_Int use_persistent_comm = 0; - -#ifdef HYPRE_USING_PERSISTENT_COMM - use_persistent_comm = num_vectors == 1; - // JSP TODO: we can use persistent communication for multi-vectors, - // but then we need different communication handles for different - // num_vectors. - hypre_ParCSRPersistentCommHandle *persistent_comm_handle; +#if defined(HYPRE_USING_PERSISTENT_COMM) + hypre_ParCSRPersistentCommHandle *persistent_comm_handle = + hypre_ParCSRCommPkgGetPersistentCommHandle(1, comm_pkg); +#else + hypre_ParCSRCommHandle *comm_handle; #endif - if (use_persistent_comm) - { -#ifdef HYPRE_USING_PERSISTENT_COMM - persistent_comm_handle = hypre_ParCSRCommPkgGetPersistentCommHandle(1, comm_pkg); -#endif - } - else - { - comm_handle = hypre_CTAlloc(hypre_ParCSRCommHandle*, num_vectors, HYPRE_MEMORY_HOST); - } + /*--------------------------------------------------------------------- + * Allocate (during hypre_SeqVectorInitialize_v2) or retrieve + * persistent receive data buffer for x_tmp (if persistent is enabled). + *--------------------------------------------------------------------*/ - /* x_tmp */ -#if defined(HYPRE_USING_GPU) - /* for GPU and single vector, alloc persistent memory for x_tmp (in comm_pkg) and reuse */ - if (num_vectors == 1) - { - if (!hypre_ParCSRCommPkgTmpData(comm_pkg)) - { -#if 1 - hypre_ParCSRCommPkgTmpData(comm_pkg) = hypre_TAlloc(HYPRE_Complex, num_cols_offd, HYPRE_MEMORY_DEVICE); -#else - hypre_ParCSRCommPkgTmpData(comm_pkg) = _hypre_TAlloc(HYPRE_Complex, num_cols_offd, hypre_MEMORY_DEVICE); -#endif - } - hypre_VectorData(x_tmp) = hypre_ParCSRCommPkgTmpData(comm_pkg); - hypre_SeqVectorSetDataOwner(x_tmp, 0); - } -#else - if (use_persistent_comm) - { -#ifdef HYPRE_USING_PERSISTENT_COMM - hypre_VectorData(x_tmp) = (HYPRE_Complex *) hypre_ParCSRCommHandleRecvDataBuffer(persistent_comm_handle); - hypre_SeqVectorSetDataOwner(x_tmp, 0); -#endif - } +#if defined(HYPRE_USING_PERSISTENT_COMM) + hypre_VectorData(x_tmp) = (HYPRE_Complex *) + hypre_ParCSRCommHandleRecvDataBuffer(persistent_comm_handle); + hypre_SeqVectorSetDataOwner(x_tmp, 0); #endif - hypre_SeqVectorInitialize_v2(x_tmp, HYPRE_MEMORY_DEVICE); + hypre_SeqVectorInitialize_v2(x_tmp, HYPRE_MEMORY_HOST); x_tmp_data = hypre_VectorData(x_tmp); - /* x_buff_data */ - x_buf_data = hypre_CTAlloc(HYPRE_Complex*, num_vectors, HYPRE_MEMORY_HOST); + /*--------------------------------------------------------------------- + * Allocate data send buffer + *--------------------------------------------------------------------*/ + +#if defined(HYPRE_USING_PERSISTENT_COMM) + x_buf_data = (HYPRE_Complex *) hypre_ParCSRCommHandleSendDataBuffer(persistent_comm_handle); - for (jv = 0; jv < num_vectors; ++jv) - { -#if defined(HYPRE_USING_GPU) - if (jv == 0) - { - if (!hypre_ParCSRCommPkgBufData(comm_pkg)) - { -#if 1 - hypre_ParCSRCommPkgBufData(comm_pkg) = hypre_TAlloc(HYPRE_Complex, - hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), - HYPRE_MEMORY_DEVICE); #else - hypre_ParCSRCommPkgBufData(comm_pkg) = _hypre_TAlloc(HYPRE_Complex, - hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), - hypre_MEMORY_DEVICE); -#endif - } - x_buf_data[0] = hypre_ParCSRCommPkgBufData(comm_pkg); - continue; - } + x_buf_data = hypre_TAlloc(HYPRE_Complex, + hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); #endif - if (use_persistent_comm) - { -#ifdef HYPRE_USING_PERSISTENT_COMM - x_buf_data[0] = (HYPRE_Complex *) hypre_ParCSRCommHandleSendDataBuffer(persistent_comm_handle); - continue; -#endif - } - - x_buf_data[jv] = hypre_TAlloc(HYPRE_Complex, - hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), - HYPRE_MEMORY_DEVICE); - } - - /* The assert is because the following loop only works for 'column' - storage of a multivector. This needs to be fixed to work more generally, - at least for 'row' storage. This in turn, means either change CommPkg so - num_sends is no.zones*no.vectors (not no.zones) or, less dangerously, put - a stride in the logic of CommHandleCreate (stride either from a new arg or - a new variable inside CommPkg). Or put the num_vector iteration inside - CommHandleCreate (perhaps a new multivector variant of it). - */ - hypre_assert( idxstride == 1 ); + /* The assert is because this code has been tested for column-wise vector storage only. */ + hypre_assert(idxstride == 1); - //hypre_SeqVectorPrefetch(x_local, HYPRE_MEMORY_DEVICE); - - /* send_map_elmts on device */ - hypre_ParCSRCommPkgCopySendMapElmtsToDevice(comm_pkg); + /*--------------------------------------------------------------------- + * Pack send data + *--------------------------------------------------------------------*/ - for (jv = 0; jv < num_vectors; ++jv) - { - HYPRE_Complex *send_data = (HYPRE_Complex *) x_buf_data[jv]; - HYPRE_Complex *locl_data = x_local_data + jv * vecstride; - - /* if on device, no need to Sync: send_data is on device memory */ -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - /* pack send data on device */ - HYPRE_THRUST_CALL( gather, - hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), - hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg) + - hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), - locl_data, - send_data ); -#elif defined(HYPRE_USING_DEVICE_OPENMP) - /* pack send data on device */ - HYPRE_Int i; - HYPRE_Int *device_send_map_elmts = hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg); - HYPRE_Int start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, 0); - HYPRE_Int end = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends); -#pragma omp target teams distribute parallel for private(i) is_device_ptr(send_data, locl_data, device_send_map_elmts) - for (i = start; i < end; i++) - { - send_data[i] = locl_data[device_send_map_elmts[i]]; - } -#else - HYPRE_Int i; - /* pack send data on host */ #if defined(HYPRE_USING_OPENMP) -#pragma omp parallel for HYPRE_SMP_SCHEDULE -#endif - for (i = hypre_ParCSRCommPkgSendMapStart(comm_pkg, 0); - i < hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends); - i ++) - { - send_data[i] = locl_data[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,i)]; - } + #pragma omp parallel for HYPRE_SMP_SCHEDULE #endif + for (i = hypre_ParCSRCommPkgSendMapStart(comm_pkg, 0); + i < hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends); + i++) + { + x_buf_data[i] = x_local_data[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, i)]; } #ifdef HYPRE_PROFILE @@ -268,49 +179,33 @@ hypre_ParCSRMatrixMatvecOutOfPlace( HYPRE_Complex alpha, hypre_profile_times[HYPRE_TIMER_ID_HALO_EXCHANGE] -= hypre_MPI_Wtime(); #endif - /* nonblocking communication starts */ - if (use_persistent_comm) - { + /* Non-blocking communication starts */ #ifdef HYPRE_USING_PERSISTENT_COMM - hypre_ParCSRPersistentCommHandleStart(persistent_comm_handle, HYPRE_MEMORY_DEVICE, x_buf_data[0]); + hypre_ParCSRPersistentCommHandleStart(persistent_comm_handle, + HYPRE_MEMORY_HOST, x_buf_data); +#else + comm_handle = hypre_ParCSRCommHandleCreate_v2(1, comm_pkg, + HYPRE_MEMORY_HOST, x_buf_data, + HYPRE_MEMORY_HOST, x_tmp_data); #endif - } - else - { - for ( jv = 0; jv < num_vectors; ++jv ) - { - comm_handle[jv] = hypre_ParCSRCommHandleCreate_v2( 1, comm_pkg, HYPRE_MEMORY_DEVICE, x_buf_data[jv], - HYPRE_MEMORY_DEVICE, &x_tmp_data[jv*num_cols_offd] ); - } - } #ifdef HYPRE_PROFILE hypre_profile_times[HYPRE_TIMER_ID_HALO_EXCHANGE] += hypre_MPI_Wtime(); #endif /* overlapped local computation */ - hypre_CSRMatrixMatvecOutOfPlace( alpha, diag, x_local, beta, b_local, y_local, 0 ); + hypre_CSRMatrixMatvecOutOfPlace(alpha, diag, x_local, beta, b_local, y_local, 0); #ifdef HYPRE_PROFILE hypre_profile_times[HYPRE_TIMER_ID_HALO_EXCHANGE] -= hypre_MPI_Wtime(); #endif - /* nonblocking communication ends */ - if (use_persistent_comm) - { + /* Non-blocking communication ends */ #ifdef HYPRE_USING_PERSISTENT_COMM - hypre_ParCSRPersistentCommHandleWait(persistent_comm_handle, HYPRE_MEMORY_DEVICE, x_tmp_data); + hypre_ParCSRPersistentCommHandleWait(persistent_comm_handle, HYPRE_MEMORY_HOST, x_tmp_data); +#else + hypre_ParCSRCommHandleDestroy(comm_handle); #endif - } - else - { - for ( jv = 0; jv < num_vectors; ++jv ) - { - hypre_ParCSRCommHandleDestroy(comm_handle[jv]); - comm_handle[jv] = NULL; - } - hypre_TFree(comm_handle, HYPRE_MEMORY_HOST); - } #ifdef HYPRE_PROFILE hypre_profile_times[HYPRE_TIMER_ID_HALO_EXCHANGE] += hypre_MPI_Wtime(); @@ -319,44 +214,62 @@ hypre_ParCSRMatrixMatvecOutOfPlace( HYPRE_Complex alpha, /* computation offd part */ if (num_cols_offd) { - hypre_CSRMatrixMatvec( alpha, offd, x_tmp, 1.0, y_local ); + hypre_CSRMatrixMatvec(alpha, offd, x_tmp, 1.0, y_local); } -#ifdef HYPRE_PROFILE - hypre_profile_times[HYPRE_TIMER_ID_PACK_UNPACK] -= hypre_MPI_Wtime(); + /*--------------------------------------------------------------------- + * Free memory + *--------------------------------------------------------------------*/ + hypre_SeqVectorDestroy(x_tmp); + +#if !defined(HYPRE_USING_PERSISTENT_COMM) + hypre_TFree(x_buf_data, HYPRE_MEMORY_HOST); #endif - hypre_SeqVectorDestroy(x_tmp); x_tmp = NULL; + HYPRE_ANNOTATE_FUNC_END; - if (!use_persistent_comm) - { - for ( jv = 0; jv < num_vectors; ++jv ) - { -#if defined(HYPRE_USING_GPU) - if (jv == 0) - { - continue; - } -#endif - hypre_TFree(x_buf_data[jv], HYPRE_MEMORY_DEVICE); - } - hypre_TFree(x_buf_data, HYPRE_MEMORY_HOST); - } + return ierr; +} + +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixMatvecOutOfPlace + * + * Performs y <- alpha * A * x + beta * b + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixMatvecOutOfPlace( HYPRE_Complex alpha, + hypre_ParCSRMatrix *A, + hypre_ParVector *x, + HYPRE_Complex beta, + hypre_ParVector *b, + hypre_ParVector *y ) +{ + HYPRE_Int ierr = 0; #if defined(HYPRE_USING_GPU) - hypre_SetSyncCudaCompute(sync_stream); - hypre_SyncCudaComputeStream(hypre_handle()); -#endif + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy2( hypre_ParCSRMatrixMemoryLocation(A), + hypre_ParVectorMemoryLocation(x) ); -#ifdef HYPRE_PROFILE - hypre_profile_times[HYPRE_TIMER_ID_PACK_UNPACK] += hypre_MPI_Wtime(); + if (exec == HYPRE_EXEC_DEVICE) + { + ierr = hypre_ParCSRMatrixMatvecOutOfPlaceDevice(alpha, A, x, beta, b, y); + } + else #endif - - HYPRE_ANNOTATE_FUNC_END; + { + ierr = hypre_ParCSRMatrixMatvecOutOfPlaceHost(alpha, A, x, beta, b, y); + } return ierr; } +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixMatvec + * + * Performs y <- alpha * A * x + beta * y + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_ParCSRMatrixMatvec( HYPRE_Complex alpha, hypre_ParCSRMatrix *A, @@ -368,52 +281,42 @@ hypre_ParCSRMatrixMatvec( HYPRE_Complex alpha, } /*-------------------------------------------------------------------------- - * hypre_ParCSRMatrixMatvecT - * - * Performs y <- alpha * A^T * x + beta * y - * + * hypre_ParCSRMatrixMatvecTHost *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_ParCSRMatrixMatvecT( HYPRE_Complex alpha, - hypre_ParCSRMatrix *A, - hypre_ParVector *x, - HYPRE_Complex beta, - hypre_ParVector *y ) +hypre_ParCSRMatrixMatvecTHost( HYPRE_Complex alpha, + hypre_ParCSRMatrix *A, + hypre_ParVector *x, + HYPRE_Complex beta, + hypre_ParVector *y ) { - hypre_ParCSRCommHandle **comm_handle; - hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); - - hypre_CSRMatrix *diag = hypre_ParCSRMatrixDiag(A); - hypre_CSRMatrix *offd = hypre_ParCSRMatrixOffd(A); - hypre_CSRMatrix *diagT = hypre_ParCSRMatrixDiagT(A); - hypre_CSRMatrix *offdT = hypre_ParCSRMatrixOffdT(A); - - hypre_Vector *x_local = hypre_ParVectorLocalVector(x); - hypre_Vector *y_local = hypre_ParVectorLocalVector(y); - hypre_Vector *y_tmp; - - HYPRE_BigInt num_rows = hypre_ParCSRMatrixGlobalNumRows(A); - HYPRE_BigInt num_cols = hypre_ParCSRMatrixGlobalNumCols(A); - HYPRE_BigInt x_size = hypre_ParVectorGlobalSize(x); - HYPRE_BigInt y_size = hypre_ParVectorGlobalSize(y); - - HYPRE_Int num_vectors = hypre_VectorNumVectors(y_local); - HYPRE_Int num_cols_offd = hypre_CSRMatrixNumCols(offd); - HYPRE_Int ierr = 0; - HYPRE_Int num_sends, jv; - - HYPRE_Int vecstride = hypre_VectorVectorStride(y_local); - HYPRE_Int idxstride = hypre_VectorIndexStride(y_local); - - HYPRE_Complex *y_tmp_data, **y_buf_data; - HYPRE_Complex *y_local_data = hypre_VectorData(y_local); - -#if defined(HYPRE_USING_GPU) - HYPRE_Int sync_stream; - hypre_GetSyncCudaCompute(&sync_stream); - hypre_SetSyncCudaCompute(0); -#endif + hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); + + hypre_CSRMatrix *diag = hypre_ParCSRMatrixDiag(A); + hypre_CSRMatrix *offd = hypre_ParCSRMatrixOffd(A); + hypre_CSRMatrix *diagT = hypre_ParCSRMatrixDiagT(A); + hypre_CSRMatrix *offdT = hypre_ParCSRMatrixOffdT(A); + + hypre_Vector *x_local = hypre_ParVectorLocalVector(x); + hypre_Vector *y_local = hypre_ParVectorLocalVector(y); + hypre_Vector *y_tmp; + + HYPRE_Int num_cols_offd = hypre_CSRMatrixNumCols(offd); + HYPRE_BigInt num_rows = hypre_ParCSRMatrixGlobalNumRows(A); + HYPRE_BigInt num_cols = hypre_ParCSRMatrixGlobalNumCols(A); + HYPRE_BigInt x_size = hypre_ParVectorGlobalSize(x); + HYPRE_BigInt y_size = hypre_ParVectorGlobalSize(y); + + HYPRE_Complex *y_tmp_data; + HYPRE_Complex *y_buf_data; + HYPRE_Complex *y_local_data = hypre_VectorData(y_local); + HYPRE_Int idxstride = hypre_VectorIndexStride(y_local); + HYPRE_Int num_vectors = hypre_VectorNumVectors(y_local); + HYPRE_Int num_sends; + HYPRE_Int num_recvs; + HYPRE_Int i; + HYPRE_Int ierr = 0; HYPRE_ANNOTATE_FUNC_BEGIN; @@ -445,14 +348,15 @@ hypre_ParCSRMatrixMatvecT( HYPRE_Complex alpha, hypre_assert( hypre_VectorNumVectors(x_local) == num_vectors ); hypre_assert( hypre_VectorNumVectors(y_local) == num_vectors ); - if ( num_vectors == 1 ) + if (num_vectors == 1) { y_tmp = hypre_SeqVectorCreate(num_cols_offd); } else { - hypre_assert( num_vectors > 1 ); + hypre_assert(num_vectors > 1); y_tmp = hypre_SeqMultiVectorCreate(num_cols_offd, num_vectors); + hypre_VectorMultiVecStorageMethod(y_tmp) = 1; } /*--------------------------------------------------------------------- @@ -465,105 +369,62 @@ hypre_ParCSRMatrixMatvecT( HYPRE_Complex alpha, comm_pkg = hypre_ParCSRMatrixCommPkg(A); } + /* Update send_map_starts, send_map_elmts, and recv_vec_starts for SpMV with multivecs */ + hypre_ParCSRCommPkgUpdateVecStarts(comm_pkg, num_vectors, + hypre_VectorVectorStride(hypre_ParVectorLocalVector(y)), + hypre_VectorIndexStride(hypre_ParVectorLocalVector(y))); + + num_recvs = hypre_ParCSRCommPkgNumRecvs(comm_pkg); num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - hypre_assert( num_cols_offd == hypre_ParCSRCommPkgRecvVecStart(comm_pkg, hypre_ParCSRCommPkgNumRecvs(comm_pkg)) ); + + hypre_assert( num_cols_offd * num_vectors == + hypre_ParCSRCommPkgRecvVecStart(comm_pkg, num_recvs) ); + hypre_assert( hypre_ParCSRCommPkgRecvVecStart(comm_pkg, 0) == 0 ); hypre_assert( hypre_ParCSRCommPkgSendMapStart(comm_pkg, 0) == 0 ); #ifdef HYPRE_PROFILE hypre_profile_times[HYPRE_TIMER_ID_PACK_UNPACK] -= hypre_MPI_Wtime(); #endif - HYPRE_Int use_persistent_comm = 0; - -#ifdef HYPRE_USING_PERSISTENT_COMM - use_persistent_comm = num_vectors == 1; - // JSP TODO: we can use persistent communication for multi-vectors, - // but then we need different communication handles for different - // num_vectors. - hypre_ParCSRPersistentCommHandle *persistent_comm_handle; +#if defined(HYPRE_USING_PERSISTENT_COMM) + hypre_ParCSRPersistentCommHandle *persistent_comm_handle = + hypre_ParCSRCommPkgGetPersistentCommHandle(2, comm_pkg); +#else + hypre_ParCSRCommHandle *comm_handle; #endif - if (use_persistent_comm) - { -#ifdef HYPRE_USING_PERSISTENT_COMM - persistent_comm_handle = hypre_ParCSRCommPkgGetPersistentCommHandle(2, comm_pkg); -#endif - } - else - { - comm_handle = hypre_CTAlloc(hypre_ParCSRCommHandle*, num_vectors, HYPRE_MEMORY_HOST); - } + /*--------------------------------------------------------------------- + * Allocate (during hypre_SeqVectorInitialize_v2) or retrieve + * persistent send data buffer for y_tmp (if persistent is enabled). + *--------------------------------------------------------------------*/ - /* y_tmp */ -#if defined(HYPRE_USING_GPU) - /* for GPU and single vector, alloc persistent memory for y_tmp (in comm_pkg) and reuse */ - if (num_vectors == 1) - { - if (!hypre_ParCSRCommPkgTmpData(comm_pkg)) - { -#if 1 - hypre_ParCSRCommPkgTmpData(comm_pkg) = hypre_TAlloc(HYPRE_Complex, num_cols_offd, HYPRE_MEMORY_DEVICE); -#else - hypre_ParCSRCommPkgTmpData(comm_pkg) = _hypre_TAlloc(HYPRE_Complex, num_cols_offd, hypre_MEMORY_DEVICE); -#endif - } - hypre_VectorData(y_tmp) = hypre_ParCSRCommPkgTmpData(comm_pkg); - hypre_SeqVectorSetDataOwner(y_tmp, 0); - } -#else - if (use_persistent_comm) - { -#ifdef HYPRE_USING_PERSISTENT_COMM - hypre_VectorData(y_tmp) = (HYPRE_Complex *) hypre_ParCSRCommHandleSendDataBuffer(persistent_comm_handle); - hypre_SeqVectorSetDataOwner(y_tmp, 0); -#endif - } +#if defined(HYPRE_USING_PERSISTENT_COMM) + hypre_VectorData(y_tmp) = (HYPRE_Complex *) + hypre_ParCSRCommHandleSendDataBuffer(persistent_comm_handle); + hypre_SeqVectorSetDataOwner(y_tmp, 0); #endif - hypre_SeqVectorInitialize_v2(y_tmp, HYPRE_MEMORY_DEVICE); + hypre_SeqVectorInitialize_v2(y_tmp, HYPRE_MEMORY_HOST); y_tmp_data = hypre_VectorData(y_tmp); - /* y_buf_data */ - y_buf_data = hypre_CTAlloc(HYPRE_Complex*, num_vectors, HYPRE_MEMORY_HOST); + /*--------------------------------------------------------------------- + * Allocate receive data buffer + *--------------------------------------------------------------------*/ + +#if defined(HYPRE_USING_PERSISTENT_COMM) + y_buf_data = (HYPRE_Complex *) hypre_ParCSRCommHandleRecvDataBuffer(persistent_comm_handle); - for (jv = 0; jv < num_vectors; ++jv) - { -#if defined(HYPRE_USING_GPU) - if (jv == 0) - { - if (!hypre_ParCSRCommPkgBufData(comm_pkg)) - { -#if 1 - hypre_ParCSRCommPkgBufData(comm_pkg) = hypre_TAlloc(HYPRE_Complex, - hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), - HYPRE_MEMORY_DEVICE); #else - hypre_ParCSRCommPkgBufData(comm_pkg) = _hypre_TAlloc(HYPRE_Complex, - hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), - hypre_MEMORY_DEVICE); -#endif - } - y_buf_data[0] = hypre_ParCSRCommPkgBufData(comm_pkg); - continue; - } + y_buf_data = hypre_TAlloc(HYPRE_Complex, + hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), + HYPRE_MEMORY_HOST); #endif - if (use_persistent_comm) - { -#ifdef HYPRE_USING_PERSISTENT_COMM - y_buf_data[0] = (HYPRE_Complex *) hypre_ParCSRCommHandleRecvDataBuffer(persistent_comm_handle); - continue; -#endif - } - - y_buf_data[jv] = hypre_TAlloc(HYPRE_Complex, - hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), - HYPRE_MEMORY_DEVICE); - } #ifdef HYPRE_PROFILE hypre_profile_times[HYPRE_TIMER_ID_PACK_UNPACK] += hypre_MPI_Wtime(); #endif + /* Compute y_tmp = offd^T * x_local */ if (num_cols_offd) { if (offdT) @@ -581,30 +442,24 @@ hypre_ParCSRMatrixMatvecT( HYPRE_Complex alpha, hypre_profile_times[HYPRE_TIMER_ID_HALO_EXCHANGE] -= hypre_MPI_Wtime(); #endif - if (use_persistent_comm) - { -#ifdef HYPRE_USING_PERSISTENT_COMM - hypre_ParCSRPersistentCommHandleStart(persistent_comm_handle, HYPRE_MEMORY_DEVICE, y_tmp_data); + /* Non-blocking communication starts */ +#if defined(HYPRE_USING_PERSISTENT_COMM) + hypre_ParCSRPersistentCommHandleStart(persistent_comm_handle, HYPRE_MEMORY_HOST, y_tmp_data); + +#else + comm_handle = hypre_ParCSRCommHandleCreate_v2(2, comm_pkg, + HYPRE_MEMORY_HOST, y_tmp_data, + HYPRE_MEMORY_HOST, y_buf_data ); #endif - } - else - { - for ( jv = 0; jv < num_vectors; ++jv ) - { - /* this is where we assume multivectors are 'column' storage */ - comm_handle[jv] = hypre_ParCSRCommHandleCreate_v2( 2, comm_pkg, HYPRE_MEMORY_DEVICE, &y_tmp_data[jv*num_cols_offd], - HYPRE_MEMORY_DEVICE, y_buf_data[jv] ); - } - } #ifdef HYPRE_PROFILE hypre_profile_times[HYPRE_TIMER_ID_HALO_EXCHANGE] += hypre_MPI_Wtime(); #endif - /* overlapped local computation */ + /* Overlapped local computation. + diagT is optional. Used only if it's present. */ if (diagT) { - // diagT is optional. Used only if it's present. hypre_CSRMatrixMatvec(alpha, diagT, x_local, beta, y_local); } else @@ -616,114 +471,76 @@ hypre_ParCSRMatrixMatvecT( HYPRE_Complex alpha, hypre_profile_times[HYPRE_TIMER_ID_HALO_EXCHANGE] -= hypre_MPI_Wtime(); #endif - /* nonblocking communication ends */ - if (use_persistent_comm) - { -#ifdef HYPRE_USING_PERSISTENT_COMM - hypre_ParCSRPersistentCommHandleWait(persistent_comm_handle, HYPRE_MEMORY_DEVICE, y_buf_data[0]); + /* Non-blocking communication ends */ +#if defined(HYPRE_USING_PERSISTENT_COMM) + hypre_ParCSRPersistentCommHandleWait(persistent_comm_handle, + HYPRE_MEMORY_HOST, y_buf_data); +#else + hypre_ParCSRCommHandleDestroy(comm_handle); #endif - } - else - { - for ( jv = 0; jv < num_vectors; ++jv ) - { - hypre_ParCSRCommHandleDestroy(comm_handle[jv]); - comm_handle[jv] = NULL; - } - hypre_TFree(comm_handle, HYPRE_MEMORY_HOST); - } #ifdef HYPRE_PROFILE hypre_profile_times[HYPRE_TIMER_ID_HALO_EXCHANGE] += hypre_MPI_Wtime(); - hypre_profile_times[HYPRE_TIMER_ID_PACK_UNPACK] -= hypre_MPI_Wtime(); + hypre_profile_times[HYPRE_TIMER_ID_PACK_UNPACK] -= hypre_MPI_Wtime(); #endif - /* The assert is because the following loop only works for 'column' - storage of a multivector. This needs to be fixed to work more generally, - at least for 'row' storage. This in turn, means either change CommPkg so - num_sends is no.zones*no.vectors (not no.zones) or, less dangerously, put - a stride in the logic of CommHandleCreate (stride either from a new arg or - a new variable inside CommPkg). Or put the num_vector iteration inside - CommHandleCreate (perhaps a new multivector variant of it). - */ - - hypre_assert( idxstride == 1 ); + /* The assert is here because this code has been tested for column-wise vector storage only. */ + hypre_assert(idxstride == 1); - /* send_map_elmts on device */ - hypre_ParCSRCommPkgCopySendMapElmtsToDevice(comm_pkg); - - for (jv = 0; jv < num_vectors; ++jv) + /* unpack recv data on host, TODO OMP? */ + for (i = hypre_ParCSRCommPkgSendMapStart(comm_pkg, 0); + i < hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends); + i ++) { - HYPRE_Complex *recv_data = (HYPRE_Complex *) y_buf_data[jv]; - HYPRE_Complex *locl_data = y_local_data + jv * vecstride; - -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - /* unpack recv data on device */ - if (!hypre_ParCSRCommPkgWorkSpace(comm_pkg)) - { - hypre_ParCSRCommPkgWorkSpace(comm_pkg) = - hypre_TAlloc( char, - (2*sizeof(HYPRE_Int)+sizeof(HYPRE_Real)) * hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), - HYPRE_MEMORY_DEVICE ); - } - hypreDevice_GenScatterAdd(locl_data, - hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), - hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg), - recv_data, - hypre_ParCSRCommPkgWorkSpace(comm_pkg)); -#elif defined(HYPRE_USING_DEVICE_OPENMP) - HYPRE_Int i, j; - /* unpack recv data on device */ - for (i = 0; i < num_sends; i++) - { - HYPRE_Int *device_send_map_elmts = hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg); - HYPRE_Int start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - HYPRE_Int end = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); -#pragma omp target teams distribute parallel for private(j) is_device_ptr(recv_data, locl_data, device_send_map_elmts) - for (j = start; j < end; j++) - { - locl_data[device_send_map_elmts[j]] += recv_data[j]; - } - } -#else - HYPRE_Int i; - /* unpack recv data on host, TODO OMP? */ - for (i = hypre_ParCSRCommPkgSendMapStart(comm_pkg, 0); - i < hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends); - i ++) - { - locl_data[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,i)] += recv_data[i]; - } -#endif + y_local_data[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, i)] += y_buf_data[i]; } - hypre_SeqVectorDestroy(y_tmp); y_tmp = NULL; + /*--------------------------------------------------------------------- + * Free memory + *--------------------------------------------------------------------*/ + hypre_SeqVectorDestroy(y_tmp); - if (!use_persistent_comm) - { - for ( jv = 0; jv < num_vectors; ++jv ) - { -#if defined(HYPRE_USING_GPU) - if (jv == 0) - { - continue; - } +#if !defined(HYPRE_USING_PERSISTENT_COMM) + hypre_TFree(y_buf_data, HYPRE_MEMORY_HOST); #endif - hypre_TFree(y_buf_data[jv], HYPRE_MEMORY_DEVICE); - } - hypre_TFree(y_buf_data, HYPRE_MEMORY_HOST); - } -#if defined(HYPRE_USING_GPU) - hypre_SetSyncCudaCompute(sync_stream); - hypre_SyncCudaComputeStream(hypre_handle()); -#endif + HYPRE_ANNOTATE_FUNC_END; #ifdef HYPRE_PROFILE hypre_profile_times[HYPRE_TIMER_ID_PACK_UNPACK] += hypre_MPI_Wtime(); #endif - HYPRE_ANNOTATE_FUNC_END; + return ierr; +} + +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixMatvecT + * + * Performs y <- alpha * A^T * x + beta * y + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixMatvecT( HYPRE_Complex alpha, + hypre_ParCSRMatrix *A, + hypre_ParVector *x, + HYPRE_Complex beta, + hypre_ParVector *y ) +{ + HYPRE_Int ierr = 0; + +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy2( hypre_ParCSRMatrixMemoryLocation(A), + hypre_ParVectorMemoryLocation(x) ); + + if (exec == HYPRE_EXEC_DEVICE) + { + ierr = hypre_ParCSRMatrixMatvecTDevice(alpha, A, x, beta, y); + } + else +#endif + { + ierr = hypre_ParCSRMatrixMatvecTHost(alpha, A, x, beta, y); + } return ierr; } @@ -731,6 +548,7 @@ hypre_ParCSRMatrixMatvecT( HYPRE_Complex alpha, /*-------------------------------------------------------------------------- * hypre_ParCSRMatrixMatvec_FF *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_ParCSRMatrixMatvec_FF( HYPRE_Complex alpha, hypre_ParCSRMatrix *A, @@ -741,7 +559,7 @@ hypre_ParCSRMatrixMatvec_FF( HYPRE_Complex alpha, HYPRE_Int fpt ) { MPI_Comm comm = hypre_ParCSRMatrixComm(A); - hypre_ParCSRCommHandle *comm_handle; + hypre_ParCSRCommHandle *comm_handle = NULL; hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); hypre_CSRMatrix *diag = hypre_ParCSRMatrixDiag(A); hypre_CSRMatrix *offd = hypre_ParCSRMatrixOffd(A); @@ -750,12 +568,12 @@ hypre_ParCSRMatrixMatvec_FF( HYPRE_Complex alpha, HYPRE_BigInt num_rows = hypre_ParCSRMatrixGlobalNumRows(A); HYPRE_BigInt num_cols = hypre_ParCSRMatrixGlobalNumCols(A); - hypre_Vector *x_tmp; + hypre_Vector *x_tmp = NULL; HYPRE_BigInt x_size = hypre_ParVectorGlobalSize(x); HYPRE_BigInt y_size = hypre_ParVectorGlobalSize(y); HYPRE_Int num_cols_offd = hypre_CSRMatrixNumCols(offd); HYPRE_Int ierr = 0; - HYPRE_Int num_sends, i, j, index, start, num_procs; + HYPRE_Int num_sends = 0, i, j, index, start, num_procs; HYPRE_Int *int_buf_data = NULL; HYPRE_Int *CF_marker_offd = NULL; @@ -773,16 +591,22 @@ hypre_ParCSRMatrixMatvec_FF( HYPRE_Complex alpha, * is informational only. *--------------------------------------------------------------------*/ - hypre_MPI_Comm_size(comm,&num_procs); + hypre_MPI_Comm_size(comm, &num_procs); if (num_cols != x_size) + { ierr = 11; + } if (num_rows != y_size) + { ierr = 12; + } if (num_cols != x_size && num_rows != y_size) + { ierr = 13; + } if (num_procs > 1) { @@ -812,9 +636,9 @@ hypre_ParCSRMatrixMatvec_FF( HYPRE_Complex alpha, for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) x_buf_data[index++] - = x_local_data[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + = x_local_data[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } comm_handle = hypre_ParCSRCommHandleCreate ( 1, comm_pkg, x_buf_data, x_tmp_data ); @@ -830,23 +654,23 @@ hypre_ParCSRMatrixMatvec_FF( HYPRE_Complex alpha, if (num_sends) int_buf_data = hypre_CTAlloc(HYPRE_Int, hypre_ParCSRCommPkgSendMapStart (comm_pkg, num_sends), HYPRE_MEMORY_HOST); - if (num_cols_offd) CF_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_offd, HYPRE_MEMORY_HOST); + if (num_cols_offd) { CF_marker_offd = hypre_CTAlloc(HYPRE_Int, num_cols_offd, HYPRE_MEMORY_HOST); } index = 0; for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) int_buf_data[index++] - = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j)]; + = CF_marker[hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j)]; } comm_handle = - hypre_ParCSRCommHandleCreate(11,comm_pkg,int_buf_data,CF_marker_offd ); + hypre_ParCSRCommHandleCreate(11, comm_pkg, int_buf_data, CF_marker_offd ); hypre_ParCSRCommHandleDestroy(comm_handle); comm_handle = NULL; - if (num_cols_offd) hypre_CSRMatrixMatvec_FF( alpha, offd, x_tmp, 1.0, y_local, - CF_marker, CF_marker_offd, fpt); + if (num_cols_offd) hypre_CSRMatrixMatvec_FF(alpha, offd, x_tmp, 1.0, y_local, + CF_marker, CF_marker_offd, fpt); hypre_SeqVectorDestroy(x_tmp); x_tmp = NULL; diff --git a/external/hypre/src/parcsr_mv/par_csr_matvec_device.c b/external/hypre/src/parcsr_mv/par_csr_matvec_device.c new file mode 100644 index 00000000..e25c7bf7 --- /dev/null +++ b/external/hypre/src/parcsr_mv/par_csr_matvec_device.c @@ -0,0 +1,593 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +/****************************************************************************** + * + * Matvec functions for hypre_CSRMatrix class. + * + *****************************************************************************/ + +#include "_hypre_onedpl.hpp" +#include "_hypre_parcsr_mv.h" +#include "_hypre_utilities.hpp" + +#if defined(HYPRE_USING_GPU) + +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixMatvecOutOfPlaceDevice + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixMatvecOutOfPlaceDevice( HYPRE_Complex alpha, + hypre_ParCSRMatrix *A, + hypre_ParVector *x, + HYPRE_Complex beta, + hypre_ParVector *b, + hypre_ParVector *y ) +{ + hypre_GpuProfilingPushRange("Matvec"); + + hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); + hypre_ParCSRCommHandle *comm_handle; + HYPRE_Int *d_send_map_elmts; + HYPRE_Int send_map_num_elmts; + + hypre_CSRMatrix *diag = hypre_ParCSRMatrixDiag(A); + hypre_CSRMatrix *offd = hypre_ParCSRMatrixOffd(A); + + hypre_Vector *x_local = hypre_ParVectorLocalVector(x); + hypre_Vector *b_local = hypre_ParVectorLocalVector(b); + hypre_Vector *y_local = hypre_ParVectorLocalVector(y); + hypre_Vector *x_tmp; + + HYPRE_BigInt num_rows = hypre_ParCSRMatrixGlobalNumRows(A); + HYPRE_BigInt num_cols = hypre_ParCSRMatrixGlobalNumCols(A); + HYPRE_BigInt x_size = hypre_ParVectorGlobalSize(x); + HYPRE_BigInt b_size = hypre_ParVectorGlobalSize(b); + HYPRE_BigInt y_size = hypre_ParVectorGlobalSize(y); + + HYPRE_Int num_cols_offd = hypre_CSRMatrixNumCols(offd); + HYPRE_Int num_recvs, num_sends; + HYPRE_Int ierr = 0; + + HYPRE_Int idxstride = hypre_VectorIndexStride(x_local); + HYPRE_Int num_vectors = hypre_VectorNumVectors(x_local); + HYPRE_Complex *x_local_data = hypre_VectorData(x_local); + HYPRE_Complex *x_tmp_data; + HYPRE_Complex *x_buf_data; + + HYPRE_Int sync_stream; + + HYPRE_ANNOTATE_FUNC_BEGIN; + + hypre_GetSyncCudaCompute(&sync_stream); + hypre_SetSyncCudaCompute(0); + + /*--------------------------------------------------------------------- + * Check for size compatibility. ParMatvec returns ierr = 11 if + * length of X doesn't equal the number of columns of A, + * ierr = 12 if the length of Y doesn't equal the number of rows + * of A, and ierr = 13 if both are true. + * + * Because temporary vectors are often used in ParMatvec, none of + * these conditions terminates processing, and the ierr flag + * is informational only. + *--------------------------------------------------------------------*/ + hypre_assert( idxstride > 0 ); + + if (num_cols != x_size) + { + ierr = 11; + } + + if (num_rows != y_size || num_rows != b_size) + { + ierr = 12; + } + + if (num_cols != x_size && (num_rows != y_size || num_rows != b_size)) + { + ierr = 13; + } + + hypre_assert( hypre_VectorNumVectors(b_local) == num_vectors ); + hypre_assert( hypre_VectorNumVectors(y_local) == num_vectors ); + + if (num_vectors == 1) + { + x_tmp = hypre_SeqVectorCreate(num_cols_offd); + } + else + { + hypre_assert(num_vectors > 1); + x_tmp = hypre_SeqMultiVectorCreate(num_cols_offd, num_vectors); + hypre_VectorMultiVecStorageMethod(x_tmp) = 1; + } + + /*--------------------------------------------------------------------- + * If there exists no CommPkg for A, a CommPkg is generated using + * equally load balanced partitionings + *--------------------------------------------------------------------*/ + if (!comm_pkg) + { + hypre_MatvecCommPkgCreate(A); + comm_pkg = hypre_ParCSRMatrixCommPkg(A); + } + + /* Update send_map_starts, send_map_elmts, and recv_vec_starts when doing + sparse matrix/multivector product */ + hypre_ParCSRCommPkgUpdateVecStarts(comm_pkg, num_vectors, + hypre_VectorVectorStride(hypre_ParVectorLocalVector(x)), + hypre_VectorIndexStride(hypre_ParVectorLocalVector(x))); + + /* Copy send_map_elmts to the device if not already there */ + hypre_ParCSRCommPkgCopySendMapElmtsToDevice(comm_pkg); + + /* Get information from the communication package*/ + num_recvs = hypre_ParCSRCommPkgNumRecvs(comm_pkg); + num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); + d_send_map_elmts = hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg); + send_map_num_elmts = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends); + + /* Sanity checks */ + hypre_assert( num_cols_offd * num_vectors == + hypre_ParCSRCommPkgRecvVecStart(comm_pkg, num_recvs) ); + hypre_assert( hypre_ParCSRCommPkgRecvVecStart(comm_pkg, 0) == 0 ); + hypre_assert( hypre_ParCSRCommPkgSendMapStart(comm_pkg, 0) == 0 ); + +#ifdef HYPRE_PROFILE + hypre_profile_times[HYPRE_TIMER_ID_PACK_UNPACK] -= hypre_MPI_Wtime(); +#endif + + /*--------------------------------------------------------------------- + * Allocate or reuse receive data buffer for x_tmp + *--------------------------------------------------------------------*/ + + if (!hypre_ParCSRCommPkgTmpData(comm_pkg)) + { + hypre_ParCSRCommPkgTmpData(comm_pkg) = hypre_TAlloc(HYPRE_Complex, + num_cols_offd * num_vectors, + HYPRE_MEMORY_DEVICE); + } + hypre_VectorData(x_tmp) = x_tmp_data = hypre_ParCSRCommPkgTmpData(comm_pkg); + hypre_SeqVectorSetDataOwner(x_tmp, 0); + hypre_SeqVectorInitialize_v2(x_tmp, HYPRE_MEMORY_DEVICE); + + /*--------------------------------------------------------------------- + * Allocate or reuse send data buffer + *--------------------------------------------------------------------*/ + + if (!hypre_ParCSRCommPkgBufData(comm_pkg)) + { + hypre_ParCSRCommPkgBufData(comm_pkg) = hypre_TAlloc(HYPRE_Complex, + send_map_num_elmts, + HYPRE_MEMORY_DEVICE); + } + x_buf_data = hypre_ParCSRCommPkgBufData(comm_pkg); + + /* The assert is because this code has been tested for column-wise vector storage only. */ + hypre_assert(idxstride == 1); + + //hypre_SeqVectorPrefetch(x_local, HYPRE_MEMORY_DEVICE); + + /*--------------------------------------------------------------------- + * Pack send data + *--------------------------------------------------------------------*/ + +#if defined(HYPRE_USING_DEVICE_OPENMP) + HYPRE_Int i; + + #pragma omp target teams distribute parallel for private(i) is_device_ptr(x_buf_data, x_local_data, d_send_map_elmts) + for (i = 0; i < send_map_num_elmts; i++) + { + x_buf_data[i] = x_local_data[d_send_map_elmts[i]]; + } +#else +#if defined(HYPRE_USING_SYCL) + auto permuted_source = oneapi::dpl::make_permutation_iterator(x_local_data, + d_send_map_elmts); + HYPRE_ONEDPL_CALL( std::copy, + permuted_source, + permuted_source + send_map_num_elmts, + x_buf_data ); +#else + HYPRE_THRUST_CALL( gather, + d_send_map_elmts, + d_send_map_elmts + send_map_num_elmts, + x_local_data, + x_buf_data ); +#endif +#endif + +#ifdef HYPRE_PROFILE + hypre_profile_times[HYPRE_TIMER_ID_PACK_UNPACK] += hypre_MPI_Wtime(); +#endif + +#if defined(HYPRE_USING_THRUST_NOSYNC) + /* RL: make sure x_buf_data is ready before issuing GPU-GPU MPI */ + if (hypre_GetGpuAwareMPI()) + { + hypre_ForceSyncComputeStream(); + } +#endif + + /* when using GPUs, start local matvec first in order to overlap with communication */ + hypre_CSRMatrixMatvecOutOfPlace(alpha, diag, x_local, beta, b_local, y_local, 0); + +#ifdef HYPRE_PROFILE + hypre_profile_times[HYPRE_TIMER_ID_HALO_EXCHANGE] -= hypre_MPI_Wtime(); +#endif + + /* Non-blocking communication starts */ + comm_handle = hypre_ParCSRCommHandleCreate_v2(1, comm_pkg, + HYPRE_MEMORY_DEVICE, x_buf_data, + HYPRE_MEMORY_DEVICE, x_tmp_data); + + /* Non-blocking communication ends */ + hypre_ParCSRCommHandleDestroy(comm_handle); + +#ifdef HYPRE_PROFILE + hypre_profile_times[HYPRE_TIMER_ID_HALO_EXCHANGE] += hypre_MPI_Wtime(); +#endif + + /* computation offd part */ + if (num_cols_offd) + { + hypre_CSRMatrixMatvec(alpha, offd, x_tmp, 1.0, y_local); + } + +#ifdef HYPRE_PROFILE + hypre_profile_times[HYPRE_TIMER_ID_PACK_UNPACK] -= hypre_MPI_Wtime(); +#endif + + /*--------------------------------------------------------------------- + * Free memory + *--------------------------------------------------------------------*/ + hypre_SeqVectorDestroy(x_tmp); + + /*--------------------------------------------------------------------- + * Synchronize calls + *--------------------------------------------------------------------*/ + hypre_SetSyncCudaCompute(sync_stream); + hypre_SyncComputeStream(); + + /*--------------------------------------------------------------------- + * Performance profiling + *--------------------------------------------------------------------*/ +#ifdef HYPRE_PROFILE + hypre_profile_times[HYPRE_TIMER_ID_PACK_UNPACK] += hypre_MPI_Wtime(); +#endif + + HYPRE_ANNOTATE_FUNC_END; + + hypre_GpuProfilingPopRange(); + + return ierr; +} + +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixMatvecTDevice + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixMatvecTDevice( HYPRE_Complex alpha, + hypre_ParCSRMatrix *A, + hypre_ParVector *x, + HYPRE_Complex beta, + hypre_ParVector *y ) +{ + hypre_GpuProfilingPushRange("MatvecT"); + + hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); + hypre_ParCSRCommHandle *comm_handle; + HYPRE_Int send_map_num_elmts; + + hypre_CSRMatrix *diag = hypre_ParCSRMatrixDiag(A); + hypre_CSRMatrix *offd = hypre_ParCSRMatrixOffd(A); + hypre_CSRMatrix *diagT = hypre_ParCSRMatrixDiagT(A); + hypre_CSRMatrix *offdT = hypre_ParCSRMatrixOffdT(A); + + hypre_Vector *x_local = hypre_ParVectorLocalVector(x); + hypre_Vector *y_local = hypre_ParVectorLocalVector(y); + hypre_Vector *y_tmp; + + HYPRE_Int num_cols_diag = hypre_CSRMatrixNumCols(diag); + HYPRE_Int num_cols_offd = hypre_CSRMatrixNumCols(offd); + HYPRE_BigInt num_rows = hypre_ParCSRMatrixGlobalNumRows(A); + HYPRE_BigInt num_cols = hypre_ParCSRMatrixGlobalNumCols(A); + HYPRE_BigInt x_size = hypre_ParVectorGlobalSize(x); + HYPRE_BigInt y_size = hypre_ParVectorGlobalSize(y); + + HYPRE_Complex *y_tmp_data; + HYPRE_Complex *y_buf_data; + HYPRE_Complex *y_local_data = hypre_VectorData(y_local); + HYPRE_Int idxstride = hypre_VectorIndexStride(y_local); + HYPRE_Int num_vectors = hypre_VectorNumVectors(y_local); + HYPRE_Int num_sends; + HYPRE_Int num_recvs; + HYPRE_Int ierr = 0; + HYPRE_Int sync_stream; + + HYPRE_ANNOTATE_FUNC_BEGIN; + + hypre_GetSyncCudaCompute(&sync_stream); + hypre_SetSyncCudaCompute(0); + + /*--------------------------------------------------------------------- + * Check for size compatibility. MatvecT returns ierr = 1 if + * length of X doesn't equal the number of rows of A, + * ierr = 2 if the length of Y doesn't equal the number of + * columns of A, and ierr = 3 if both are true. + * + * Because temporary vectors are often used in MatvecT, none of + * these conditions terminates processing, and the ierr flag + * is informational only. + *--------------------------------------------------------------------*/ + if (num_rows != x_size) + { + ierr = 1; + } + + if (num_cols != y_size) + { + ierr = 2; + } + + if (num_rows != x_size && num_cols != y_size) + { + ierr = 3; + } + + hypre_assert( hypre_VectorNumVectors(x_local) == num_vectors ); + hypre_assert( hypre_VectorNumVectors(y_local) == num_vectors ); + + if (num_vectors == 1) + { + y_tmp = hypre_SeqVectorCreate(num_cols_offd); + } + else + { + hypre_assert(num_vectors > 1); + y_tmp = hypre_SeqMultiVectorCreate(num_cols_offd, num_vectors); + hypre_VectorMultiVecStorageMethod(y_tmp) = 1; + } + + /*--------------------------------------------------------------------- + * If there exists no CommPkg for A, a CommPkg is generated using + * equally load balanced partitionings + *--------------------------------------------------------------------*/ + if (!comm_pkg) + { + hypre_MatvecCommPkgCreate(A); + comm_pkg = hypre_ParCSRMatrixCommPkg(A); + } + + /* Update send_map_starts, send_map_elmts, and recv_vec_starts for SpMV with multivecs */ + hypre_ParCSRCommPkgUpdateVecStarts(comm_pkg, num_vectors, + hypre_VectorVectorStride(hypre_ParVectorLocalVector(y)), + hypre_VectorIndexStride(hypre_ParVectorLocalVector(y))); + + /* Update send_map_elmts on device */ + hypre_ParCSRCommPkgCopySendMapElmtsToDevice(comm_pkg); + + /* Get information from the communication package*/ + num_recvs = hypre_ParCSRCommPkgNumRecvs(comm_pkg); + num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); + send_map_num_elmts = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends); + + /* Sanity checks */ + hypre_assert( num_cols_offd * num_vectors == + hypre_ParCSRCommPkgRecvVecStart(comm_pkg, num_recvs) ); + hypre_assert( hypre_ParCSRCommPkgRecvVecStart(comm_pkg, 0) == 0 ); + hypre_assert( hypre_ParCSRCommPkgSendMapStart(comm_pkg, 0) == 0 ); + +#ifdef HYPRE_PROFILE + hypre_profile_times[HYPRE_TIMER_ID_PACK_UNPACK] -= hypre_MPI_Wtime(); +#endif + + /*--------------------------------------------------------------------- + * Allocate or reuse send data buffer for y_tmp + *--------------------------------------------------------------------*/ + + if (!hypre_ParCSRCommPkgTmpData(comm_pkg)) + { + hypre_ParCSRCommPkgTmpData(comm_pkg) = hypre_TAlloc(HYPRE_Complex, + num_cols_offd * num_vectors, + HYPRE_MEMORY_DEVICE); + } + hypre_VectorData(y_tmp) = y_tmp_data = hypre_ParCSRCommPkgTmpData(comm_pkg); + hypre_SeqVectorSetDataOwner(y_tmp, 0); + hypre_SeqVectorInitialize_v2(y_tmp, HYPRE_MEMORY_DEVICE); + + /*--------------------------------------------------------------------- + * Allocate receive data buffer + *--------------------------------------------------------------------*/ + + if (!hypre_ParCSRCommPkgBufData(comm_pkg)) + { + hypre_ParCSRCommPkgBufData(comm_pkg) = hypre_TAlloc(HYPRE_Complex, + send_map_num_elmts, + HYPRE_MEMORY_DEVICE); + } + y_buf_data = hypre_ParCSRCommPkgBufData(comm_pkg); + +#ifdef HYPRE_PROFILE + hypre_profile_times[HYPRE_TIMER_ID_PACK_UNPACK] += hypre_MPI_Wtime(); +#endif + + /* Compute y_tmp = offd^T * x_local */ + if (num_cols_offd) + { + if (offdT) + { + // offdT is optional. Used only if it's present + hypre_CSRMatrixMatvec(alpha, offdT, x_local, 0.0, y_tmp); + } + else + { + hypre_CSRMatrixMatvecT(alpha, offd, x_local, 0.0, y_tmp); + } + } + + /* RL: make sure y_tmp is ready before issuing GPU-GPU MPI */ + if (hypre_GetGpuAwareMPI()) + { + hypre_ForceSyncComputeStream(); + } + + /* when using GPUs, start local matvec first in order to overlap with communication */ + if (diagT) + { + // diagT is optional. Used only if it's present. + hypre_CSRMatrixMatvec(alpha, diagT, x_local, beta, y_local); + } + else + { + hypre_CSRMatrixMatvecT(alpha, diag, x_local, beta, y_local); + } + +#ifdef HYPRE_PROFILE + hypre_profile_times[HYPRE_TIMER_ID_HALO_EXCHANGE] -= hypre_MPI_Wtime(); +#endif + + /* Non-blocking communication starts */ + comm_handle = hypre_ParCSRCommHandleCreate_v2(2, comm_pkg, + HYPRE_MEMORY_DEVICE, y_tmp_data, + HYPRE_MEMORY_DEVICE, y_buf_data ); + + /* Non-blocking communication ends */ + hypre_ParCSRCommHandleDestroy(comm_handle); + +#ifdef HYPRE_PROFILE + hypre_profile_times[HYPRE_TIMER_ID_HALO_EXCHANGE] += hypre_MPI_Wtime(); + hypre_profile_times[HYPRE_TIMER_ID_PACK_UNPACK] -= hypre_MPI_Wtime(); +#endif + + /* The assert is here because this code has been tested for column-wise vector storage only. */ + hypre_assert( idxstride == 1 ); + + /*--------------------------------------------------------------------- + * Unpack receive data + *--------------------------------------------------------------------*/ + +#if defined(HYPRE_USING_DEVICE_OPENMP) + HYPRE_Int *d_send_map_elmts = hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg); + HYPRE_Int i, j; + + for (i = 0; i < num_sends; i++) + { + HYPRE_Int start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); + HYPRE_Int end = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); + + #pragma omp target teams distribute parallel for private(j) is_device_ptr(y_buf_data, y_local_data, d_send_map_elmts) + for (j = start; j < end; j++) + { + y_local_data[d_send_map_elmts[j]] += y_buf_data[j]; + } + } +#else + /* Use SpMV to unpack data */ + hypre_ParCSRMatrixMatvecT_unpack(comm_pkg, num_cols_diag, y_buf_data, y_local_data); +#endif + + /*--------------------------------------------------------------------- + * Free memory + *--------------------------------------------------------------------*/ + + hypre_SeqVectorDestroy(y_tmp); + + /*--------------------------------------------------------------------- + * Synchronize when using GPUs + *--------------------------------------------------------------------*/ + +#if defined(HYPRE_USING_GPU) + hypre_SetSyncCudaCompute(sync_stream); + hypre_SyncComputeStream(); +#endif + + /*--------------------------------------------------------------------- + * Performance profiling + *--------------------------------------------------------------------*/ + +#ifdef HYPRE_PROFILE + hypre_profile_times[HYPRE_TIMER_ID_PACK_UNPACK] += hypre_MPI_Wtime(); +#endif + + HYPRE_ANNOTATE_FUNC_END; + + hypre_GpuProfilingPopRange(); + + return ierr; +} + +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixMatvecT_unpack + * + * Computes on the device: + * + * local_data[send_map_elmts] += recv_data + * + * with hypre's internal SpMV. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixMatvecT_unpack( hypre_ParCSRCommPkg *comm_pkg, + HYPRE_Int num_cols, + HYPRE_Complex *recv_data, + HYPRE_Complex *local_data ) +{ + /* Input variables */ + hypre_CSRMatrix *matrix_E = hypre_ParCSRCommPkgMatrixE(comm_pkg); + HYPRE_Int num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); + HYPRE_Int num_elements = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends); + HYPRE_Int num_components = hypre_ParCSRCommPkgNumComponents(comm_pkg); + + /* Local variables */ + hypre_Vector vec_x; + hypre_Vector vec_y; + HYPRE_Int trans = 0; + HYPRE_Int fill = 0; + HYPRE_Complex alpha = 1.0; + HYPRE_Complex beta = 1.0; + + if (num_elements == 0) + { + return hypre_error_flag; + } + + /* Create matrix E if it not exists */ + if (!matrix_E) + { + hypre_ParCSRCommPkgCreateMatrixE(comm_pkg, num_cols); + matrix_E = hypre_ParCSRCommPkgMatrixE(comm_pkg); + } + + /* Set vector x */ + hypre_VectorData(&vec_x) = recv_data; + hypre_VectorOwnsData(&vec_x) = 0; + hypre_VectorSize(&vec_x) = num_elements / num_components; + hypre_VectorVectorStride(&vec_x) = 1; + hypre_VectorIndexStride(&vec_x) = num_components; + hypre_VectorNumVectors(&vec_x) = num_components; + hypre_VectorMultiVecStorageMethod(&vec_x) = 1; + + /* Set vector y */ + hypre_VectorData(&vec_y) = local_data; + hypre_VectorOwnsData(&vec_y) = 0; + hypre_VectorSize(&vec_y) = num_cols; + hypre_VectorVectorStride(&vec_y) = num_cols; + hypre_VectorIndexStride(&vec_y) = 1; + hypre_VectorNumVectors(&vec_y) = num_components; + hypre_VectorMultiVecStorageMethod(&vec_y) = 0; + + /* Compute y += E*x */ + hypre_CSRMatrixSpMVDevice(trans, alpha, matrix_E, &vec_x, beta, &vec_y, fill); + + return hypre_error_flag; +} + +#endif /* #if defined(HYPRE_USING_GPU) */ diff --git a/external/hypre/src/parcsr_mv/par_csr_triplemat.c b/external/hypre/src/parcsr_mv/par_csr_triplemat.c index 9f421666..3a230539 100644 --- a/external/hypre/src/parcsr_mv/par_csr_triplemat.c +++ b/external/hypre/src/parcsr_mv/par_csr_triplemat.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -11,10 +11,9 @@ #include "../parcsr_mv/_hypre_parcsr_mv.h" /*-------------------------------------------------------------------------- - * hypre_ParCSRMatMat : multiplies two ParCSRMatrices A and B and returns - * the product in ParCSRMatrix C - * Note that C does not own the partitionings since its row_starts - * is owned by A and col_starts by B. + * hypre_ParCSRMatMatHost + * + * Host implementation of hypre_ParCSRMatMat (C = A * B) *--------------------------------------------------------------------------*/ hypre_ParCSRMatrix* @@ -45,7 +44,7 @@ hypre_ParCSRMatMatHost( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *C; HYPRE_BigInt *col_map_offd_C = NULL; - HYPRE_Int *map_B_to_C=NULL; + HYPRE_Int *map_B_to_C = NULL; hypre_CSRMatrix *C_diag = NULL; @@ -91,7 +90,7 @@ hypre_ParCSRMatMatHost( hypre_ParCSRMatrix *A, hypre_MPI_Comm_size(comm, &num_procs); hypre_MPI_Comm_rank(comm, &my_id); - last_col_diag_B = first_col_diag_B + num_cols_diag_B -1; + last_col_diag_B = first_col_diag_B + num_cols_diag_B - 1; if (num_procs > 1) { @@ -103,7 +102,6 @@ hypre_ParCSRMatMatHost( hypre_ParCSRMatrix *A, Bs_ext = hypre_ParCSRMatrixExtractBExt(B, A, 1); /* contains communication which should be explicitly included to allow for overlap */ - hypre_CSRMatrixSplit(Bs_ext, first_col_diag_B, last_col_diag_B, num_cols_offd_B, col_map_offd_B, &num_cols_offd_C, &col_map_offd_C, &Bext_diag, &Bext_offd); @@ -122,7 +120,6 @@ hypre_ParCSRMatMatHost( hypre_ParCSRMatrix *A, if (num_cols_offd_B) { - HYPRE_Int i; map_B_to_C = hypre_CTAlloc(HYPRE_Int, num_cols_offd_B, HYPRE_MEMORY_HOST); cnt = 0; @@ -140,7 +137,7 @@ hypre_ParCSRMatMatHost( hypre_ParCSRMatrix *A, } AB_offd_num_nonzeros = hypre_CSRMatrixNumNonzeros(AB_offd); AB_offd_j = hypre_CSRMatrixJ(AB_offd); - for (i=0; i < AB_offd_num_nonzeros; i++) + for (i = 0; i < AB_offd_num_nonzeros; i++) { AB_offd_j[i] = map_B_to_C[AB_offd_j[i]]; } @@ -192,42 +189,45 @@ hypre_ParCSRMatMatHost( hypre_ParCSRMatrix *A, return C; } +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatMat + * + * Computes C = A*B + *--------------------------------------------------------------------------*/ + hypre_ParCSRMatrix* hypre_ParCSRMatMat( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B ) { -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - hypre_GpuProfilingPushRange("Mat-Mat"); -#endif - hypre_ParCSRMatrix *C = NULL; -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("Mat-Mat"); + +#if defined(HYPRE_USING_GPU) HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy2( hypre_ParCSRMatrixMemoryLocation(A), hypre_ParCSRMatrixMemoryLocation(B) ); if (exec == HYPRE_EXEC_DEVICE) { - C = hypre_ParCSRMatMatDevice(A,B); + C = hypre_ParCSRMatMatDevice(A, B); } else #endif { - C = hypre_ParCSRMatMatHost(A,B); + C = hypre_ParCSRMatMatHost(A, B); } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_GpuProfilingPopRange(); -#endif + HYPRE_ANNOTATE_FUNC_END; return C; } /*-------------------------------------------------------------------------- - * hypre_ParCSRTMatMatKT : multiplies two ParCSRMatrices transpose(A) and B and returns - * the product in ParCSRMatrix C - * Note that C does not own the partitionings since its row_starts - * is owned by A and col_starts by B. + * hypre_ParCSRTMatMatKTHost + * + * Host implementation of hypre_ParCSRTMatMatKT (C = A^T * B) *--------------------------------------------------------------------------*/ hypre_ParCSRMatrix* @@ -238,56 +238,64 @@ hypre_ParCSRTMatMatKTHost( hypre_ParCSRMatrix *A, MPI_Comm comm = hypre_ParCSRMatrixComm(A); hypre_ParCSRCommPkg *comm_pkg_A = NULL; - hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); - hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); - hypre_CSRMatrix *B_diag = hypre_ParCSRMatrixDiag(B); - hypre_CSRMatrix *B_offd = hypre_ParCSRMatrixOffd(B); - hypre_CSRMatrix *AT_diag = NULL; - - HYPRE_Int num_rows_diag_A = hypre_CSRMatrixNumRows(A_diag); - HYPRE_Int num_cols_diag_A = hypre_CSRMatrixNumCols(A_diag); - HYPRE_Int num_rows_diag_B = hypre_CSRMatrixNumRows(B_diag); - HYPRE_Int num_cols_diag_B = hypre_CSRMatrixNumCols(B_diag); - HYPRE_Int num_cols_offd_B = hypre_CSRMatrixNumCols(B_offd); - HYPRE_BigInt first_col_diag_B = hypre_ParCSRMatrixFirstColDiag(B); - - HYPRE_BigInt *col_map_offd_B = hypre_ParCSRMatrixColMapOffd(B); - - HYPRE_BigInt *col_starts_A = hypre_ParCSRMatrixColStarts(A); - HYPRE_BigInt *col_starts_B = hypre_ParCSRMatrixColStarts(B); - - hypre_ParCSRMatrix *C; - hypre_CSRMatrix *C_diag = NULL; - hypre_CSRMatrix *C_offd = NULL; - - HYPRE_BigInt *col_map_offd_C = NULL; - HYPRE_Int *map_B_to_C; - HYPRE_BigInt first_col_diag_C; - HYPRE_BigInt last_col_diag_C; - HYPRE_Int num_cols_offd_C = 0; - - HYPRE_BigInt n_rows_A, n_cols_A; - HYPRE_BigInt n_rows_B, n_cols_B; - HYPRE_Int j_indx, cnt; - HYPRE_Int num_procs, my_id; + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); + hypre_CSRMatrix *B_diag = hypre_ParCSRMatrixDiag(B); + hypre_CSRMatrix *B_offd = hypre_ParCSRMatrixOffd(B); + hypre_CSRMatrix *AT_diag; + hypre_CSRMatrix *AT_offd; + + HYPRE_Int num_rows_diag_A = hypre_CSRMatrixNumRows(A_diag); + HYPRE_Int num_cols_diag_A = hypre_CSRMatrixNumCols(A_diag); + HYPRE_Int num_rows_diag_B = hypre_CSRMatrixNumRows(B_diag); + HYPRE_Int num_cols_diag_B = hypre_CSRMatrixNumCols(B_diag); + HYPRE_Int num_cols_offd_B = hypre_CSRMatrixNumCols(B_offd); + HYPRE_BigInt first_col_diag_B = hypre_ParCSRMatrixFirstColDiag(B); + + HYPRE_BigInt *col_map_offd_B = hypre_ParCSRMatrixColMapOffd(B); + HYPRE_BigInt *col_starts_A = hypre_ParCSRMatrixColStarts(A); + HYPRE_BigInt *col_starts_B = hypre_ParCSRMatrixColStarts(B); + + hypre_ParCSRMatrix *C; + hypre_CSRMatrix *C_diag = NULL; + hypre_CSRMatrix *C_offd = NULL; + + HYPRE_BigInt *col_map_offd_C = NULL; + HYPRE_Int *map_B_to_C; + HYPRE_BigInt first_col_diag_C; + HYPRE_BigInt last_col_diag_C; + HYPRE_Int num_cols_offd_C = 0; + + HYPRE_BigInt n_rows_A, n_cols_A; + HYPRE_BigInt n_rows_B, n_cols_B; + HYPRE_Int j_indx, cnt; + HYPRE_Int num_procs, my_id; n_rows_A = hypre_ParCSRMatrixGlobalNumRows(A); n_cols_A = hypre_ParCSRMatrixGlobalNumCols(A); n_rows_B = hypre_ParCSRMatrixGlobalNumRows(B); n_cols_B = hypre_ParCSRMatrixGlobalNumCols(B); - hypre_MPI_Comm_size(comm,&num_procs); + hypre_MPI_Comm_size(comm, &num_procs); hypre_MPI_Comm_rank(comm, &my_id); if (n_rows_A != n_rows_B || num_rows_diag_A != num_rows_diag_B) { - hypre_error_w_msg(HYPRE_ERROR_GENERIC," Error! Incompatible matrix dimensions!\n"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, " Error! Incompatible matrix dimensions!\n"); return NULL; } /*if (num_cols_diag_A == num_cols_diag_B) allsquare = 1;*/ - hypre_CSRMatrixTranspose(A_diag, &AT_diag, 1); + /* Compute AT_diag if necessary */ + if (!hypre_ParCSRMatrixDiagT(A)) + { + hypre_CSRMatrixTranspose(A_diag, &AT_diag, 1); + } + else + { + AT_diag = hypre_ParCSRMatrixDiagT(A); + } if (num_procs == 1) { @@ -295,34 +303,33 @@ hypre_ParCSRTMatMatKTHost( hypre_ParCSRMatrix *A, C_offd = hypre_CSRMatrixCreate(num_cols_diag_A, 0, 0); hypre_CSRMatrixInitialize_v2(C_offd, 0, hypre_CSRMatrixMemoryLocation(C_diag)); hypre_CSRMatrixNumRownnz(C_offd) = 0; - if (keep_transpose) - { - A->diagT = AT_diag; + } + else + { + hypre_CSRMatrix *C_tmp_diag = NULL; + hypre_CSRMatrix *C_tmp_offd = NULL; + hypre_CSRMatrix *C_int = NULL; + hypre_CSRMatrix *C_ext = NULL; + hypre_CSRMatrix *C_ext_diag = NULL; + hypre_CSRMatrix *C_ext_offd = NULL; + hypre_CSRMatrix *C_int_diag = NULL; + hypre_CSRMatrix *C_int_offd = NULL; + + HYPRE_Int i; + HYPRE_Int *C_tmp_offd_i; + HYPRE_Int *C_tmp_offd_j; + HYPRE_Int *send_map_elmts_A; + void *request; + + /* Compute AT_offd if necessary */ + if (!hypre_ParCSRMatrixOffdT(A)) + { + hypre_CSRMatrixTranspose(A_offd, &AT_offd, 1); } else { - hypre_CSRMatrixDestroy(AT_diag); + AT_offd = hypre_ParCSRMatrixOffdT(A); } - } - else - { - hypre_CSRMatrix *AT_offd = NULL; - hypre_CSRMatrix *C_tmp_diag = NULL; - hypre_CSRMatrix *C_tmp_offd = NULL; - hypre_CSRMatrix *C_int = NULL; - hypre_CSRMatrix *C_ext = NULL; - hypre_CSRMatrix *C_ext_diag = NULL; - hypre_CSRMatrix *C_ext_offd = NULL; - hypre_CSRMatrix *C_int_diag = NULL; - hypre_CSRMatrix *C_int_offd = NULL; - - HYPRE_Int i; - HYPRE_Int *C_tmp_offd_i; - HYPRE_Int *C_tmp_offd_j; - HYPRE_Int *send_map_elmts_A; - void *request; - - hypre_CSRMatrixTranspose(A_offd, &AT_offd, 1); C_int_diag = hypre_CSRMatrixMultiplyHost(AT_offd, B_diag); C_int_offd = hypre_CSRMatrixMultiplyHost(AT_offd, B_offd); @@ -352,22 +359,16 @@ hypre_ParCSRTMatMatKTHost( hypre_ParCSRMatrix *A, C_tmp_diag = hypre_CSRMatrixMultiplyHost(AT_diag, B_diag); C_tmp_offd = hypre_CSRMatrixMultiplyHost(AT_diag, B_offd); - if (keep_transpose) - { - A->diagT = AT_diag; - } - else - { - hypre_CSRMatrixDestroy(AT_diag); - } - - if (keep_transpose) + if (!hypre_ParCSRMatrixOffdT(A)) { - A->offdT = AT_offd; - } - else - { - hypre_CSRMatrixDestroy(AT_offd); + if (keep_transpose) + { + hypre_ParCSRMatrixOffdT(A) = AT_offd; + } + else + { + hypre_CSRMatrixDestroy(AT_offd); + } } /*----------------------------------------------------------------------- @@ -398,7 +399,7 @@ hypre_ParCSRTMatMatKTHost( hypre_ParCSRMatrix *A, map_B_to_C = hypre_CTAlloc(HYPRE_Int, num_cols_offd_B, HYPRE_MEMORY_HOST); cnt = 0; - for (i=0; i < num_cols_offd_C; i++) + for (i = 0; i < num_cols_offd_C; i++) { if (col_map_offd_C[i] == col_map_offd_B[cnt]) { @@ -409,7 +410,7 @@ hypre_ParCSRTMatMatKTHost( hypre_ParCSRMatrix *A, } } } - for (i=0; i < C_tmp_offd_i[hypre_CSRMatrixNumRows(C_tmp_offd)]; i++) + for (i = 0; i < C_tmp_offd_i[hypre_CSRMatrixNumRows(C_tmp_offd)]; i++) { j_indx = C_tmp_offd_j[i]; C_tmp_offd_j[i] = map_B_to_C[j_indx]; @@ -432,6 +433,18 @@ hypre_ParCSRTMatMatKTHost( hypre_ParCSRMatrix *A, hypre_CSRMatrixDestroy(C_ext_offd); } + if (!hypre_ParCSRMatrixDiagT(A)) + { + if (keep_transpose) + { + hypre_ParCSRMatrixDiagT(A) = AT_diag; + } + else + { + hypre_CSRMatrixDestroy(AT_diag); + } + } + C = hypre_ParCSRMatrixCreate(comm, n_cols_A, n_cols_B, col_starts_A, col_starts_B, num_cols_offd_C, C_diag->num_nonzeros, C_offd->num_nonzeros); @@ -446,18 +459,26 @@ hypre_ParCSRTMatMatKTHost( hypre_ParCSRMatrix *A, return C; } +/*-------------------------------------------------------------------------- + * hypre_ParCSRTMatMatKT + * + * Multiplies two ParCSRMatrices transpose(A) and B and returns + * the product in ParCSRMatrix C. + * + * If either AT_diag or AT_offd don't exist and the flag keep_transpose is + * true, these local matrices are saved in the ParCSRMatrix A + *--------------------------------------------------------------------------*/ + hypre_ParCSRMatrix* hypre_ParCSRTMatMatKT( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B, HYPRE_Int keep_transpose) { -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_GpuProfilingPushRange("Mat-T-Mat"); -#endif hypre_ParCSRMatrix *C = NULL; -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy2( hypre_ParCSRMatrixMemoryLocation(A), hypre_ParCSRMatrixMemoryLocation(B) ); @@ -471,129 +492,130 @@ hypre_ParCSRTMatMatKT( hypre_ParCSRMatrix *A, C = hypre_ParCSRTMatMatKTHost(A, B, keep_transpose); } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_GpuProfilingPopRange(); -#endif return C; } +/*-------------------------------------------------------------------------- + * hypre_ParCSRTMatMat + * + * Computes "C = A^T * B" and discards the temporary local matrices generated + * in the algorithm (keep_transpose = 0). + *--------------------------------------------------------------------------*/ + hypre_ParCSRMatrix* hypre_ParCSRTMatMat( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B) { - return hypre_ParCSRTMatMatKT( A, B, 0); + return hypre_ParCSRTMatMatKT(A, B, 0); } +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixRAPKTHost + * + * Host implementation of hypre_ParCSRMatrixRAPKT + *--------------------------------------------------------------------------*/ + hypre_ParCSRMatrix* hypre_ParCSRMatrixRAPKTHost( hypre_ParCSRMatrix *R, hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P, HYPRE_Int keep_transpose ) { - MPI_Comm comm = hypre_ParCSRMatrixComm(A); + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + + hypre_ParCSRCommPkg *comm_pkg_R = hypre_ParCSRMatrixCommPkg(R); + HYPRE_BigInt n_rows_R = hypre_ParCSRMatrixGlobalNumRows(R); + HYPRE_BigInt n_cols_R = hypre_ParCSRMatrixGlobalNumCols(R); + hypre_CSRMatrix *R_diag = hypre_ParCSRMatrixDiag(R); + hypre_CSRMatrix *RT_diag = hypre_ParCSRMatrixDiagT(R); + hypre_CSRMatrix *R_offd = hypre_ParCSRMatrixOffd(R); + hypre_CSRMatrix *RT_offd = hypre_ParCSRMatrixOffdT(R); + + HYPRE_Int num_rows_diag_R = hypre_CSRMatrixNumRows(R_diag); + HYPRE_Int num_cols_diag_R = hypre_CSRMatrixNumCols(R_diag); + HYPRE_Int num_cols_offd_R = hypre_CSRMatrixNumCols(R_offd); + HYPRE_BigInt *col_starts_R = hypre_ParCSRMatrixColStarts(R); + + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); + HYPRE_BigInt n_rows_A = hypre_ParCSRMatrixGlobalNumRows(A); + HYPRE_BigInt n_cols_A = hypre_ParCSRMatrixGlobalNumCols(A); + HYPRE_BigInt *row_starts_A = hypre_ParCSRMatrixRowStarts(A); + + HYPRE_Int num_rows_diag_A = hypre_CSRMatrixNumRows(A_diag); + HYPRE_Int num_cols_diag_A = hypre_CSRMatrixNumCols(A_diag); + HYPRE_Int num_cols_offd_A = hypre_CSRMatrixNumCols(A_offd); + + HYPRE_BigInt n_rows_P = hypre_ParCSRMatrixGlobalNumRows(P); + HYPRE_BigInt n_cols_P = hypre_ParCSRMatrixGlobalNumCols(P); + HYPRE_BigInt *col_map_offd_P = hypre_ParCSRMatrixColMapOffd(P); + hypre_CSRMatrix *P_diag = hypre_ParCSRMatrixDiag(P); + hypre_CSRMatrix *P_offd = hypre_ParCSRMatrixOffd(P); + + HYPRE_BigInt first_col_diag_P = hypre_ParCSRMatrixFirstColDiag(P); + HYPRE_BigInt *col_starts_P = hypre_ParCSRMatrixColStarts(P); + HYPRE_Int num_rows_diag_P = hypre_CSRMatrixNumRows(P_diag); + HYPRE_Int num_cols_diag_P = hypre_CSRMatrixNumCols(P_diag); + HYPRE_Int num_cols_offd_P = hypre_CSRMatrixNumCols(P_offd); + + hypre_ParCSRMatrix *Q; + HYPRE_BigInt *col_map_offd_Q = NULL; + HYPRE_Int *map_P_to_Q = NULL; + + hypre_CSRMatrix *Q_diag = NULL; + hypre_CSRMatrix *Q_offd = NULL; + + HYPRE_Int num_cols_offd_Q = 0; + + hypre_CSRMatrix *Ps_ext; + hypre_CSRMatrix *Pext_diag; + hypre_CSRMatrix *Pext_offd; + + hypre_CSRMatrix *AP_diag; + hypre_CSRMatrix *AP_offd; + HYPRE_Int AP_offd_num_nonzeros; + HYPRE_Int *AP_offd_j; + hypre_CSRMatrix *APext_diag = NULL; + hypre_CSRMatrix *APext_offd = NULL; + + hypre_ParCSRMatrix *C; + HYPRE_BigInt *col_map_offd_C = NULL; + HYPRE_Int *map_Q_to_C; + hypre_CSRMatrix *C_diag = NULL; + hypre_CSRMatrix *C_offd = NULL; + HYPRE_BigInt first_col_diag_C; + HYPRE_BigInt last_col_diag_C; + + HYPRE_Int num_cols_offd_C = 0; + HYPRE_Int j_indx; + HYPRE_Int num_procs, my_id; + HYPRE_Int cnt, i; - hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); - - hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); - - HYPRE_BigInt *row_starts_A = hypre_ParCSRMatrixRowStarts(A); - HYPRE_Int num_rows_diag_A = hypre_CSRMatrixNumRows(A_diag); - HYPRE_Int num_cols_diag_A = hypre_CSRMatrixNumCols(A_diag); - HYPRE_Int num_cols_offd_A = hypre_CSRMatrixNumCols(A_offd); - - hypre_CSRMatrix *P_diag = hypre_ParCSRMatrixDiag(P); - - hypre_CSRMatrix *P_offd = hypre_ParCSRMatrixOffd(P); - HYPRE_BigInt *col_map_offd_P = hypre_ParCSRMatrixColMapOffd(P); - - HYPRE_BigInt first_col_diag_P = hypre_ParCSRMatrixFirstColDiag(P); - HYPRE_BigInt *col_starts_P = hypre_ParCSRMatrixColStarts(P); - HYPRE_Int num_rows_diag_P = hypre_CSRMatrixNumRows(P_diag); - HYPRE_Int num_cols_diag_P = hypre_CSRMatrixNumCols(P_diag); - HYPRE_Int num_cols_offd_P = hypre_CSRMatrixNumCols(P_offd); - - hypre_ParCSRMatrix *Q; - HYPRE_BigInt *col_map_offd_Q = NULL; - HYPRE_Int *map_P_to_Q=NULL; - - hypre_CSRMatrix *Q_diag = NULL; - - hypre_CSRMatrix *Q_offd = NULL; - - HYPRE_Int num_cols_offd_Q = 0; - - hypre_CSRMatrix *Ps_ext; - - hypre_CSRMatrix *Pext_diag; - - hypre_CSRMatrix *Pext_offd; - - hypre_CSRMatrix *AP_diag; - hypre_CSRMatrix *AP_offd; - HYPRE_Int AP_offd_num_nonzeros; - HYPRE_Int *AP_offd_j; - hypre_CSRMatrix *APext_diag; - hypre_CSRMatrix *APext_offd; - - hypre_ParCSRCommPkg *comm_pkg_R = hypre_ParCSRMatrixCommPkg(R); - - hypre_CSRMatrix *R_diag = hypre_ParCSRMatrixDiag(R); - hypre_CSRMatrix *RT_diag = NULL; - - hypre_CSRMatrix *R_offd = hypre_ParCSRMatrixOffd(R); - - HYPRE_Int num_rows_diag_R = hypre_CSRMatrixNumRows(R_diag); - HYPRE_Int num_cols_diag_R = hypre_CSRMatrixNumCols(R_diag); - HYPRE_Int num_cols_offd_R = hypre_CSRMatrixNumCols(R_offd); - - HYPRE_BigInt *col_starts_R = hypre_ParCSRMatrixColStarts(R); - - hypre_ParCSRMatrix *C; - HYPRE_BigInt *col_map_offd_C = NULL; - HYPRE_Int *map_Q_to_C; - - hypre_CSRMatrix *C_diag = NULL; - - HYPRE_BigInt first_col_diag_C; - HYPRE_BigInt last_col_diag_C; - - hypre_CSRMatrix *C_offd = NULL; - - HYPRE_Int num_cols_offd_C = 0; - - HYPRE_Int j_indx; - - HYPRE_BigInt n_rows_R, n_cols_R; - HYPRE_Int num_procs, my_id; - HYPRE_BigInt n_rows_A, n_cols_A; - HYPRE_BigInt n_rows_P, n_cols_P; - HYPRE_Int cnt, i; - - n_rows_R = hypre_ParCSRMatrixGlobalNumRows(R); - n_cols_R = hypre_ParCSRMatrixGlobalNumCols(R); - n_rows_A = hypre_ParCSRMatrixGlobalNumRows(A); - n_cols_A = hypre_ParCSRMatrixGlobalNumCols(A); - n_rows_P = hypre_ParCSRMatrixGlobalNumRows(P); - n_cols_P = hypre_ParCSRMatrixGlobalNumCols(P); - - hypre_MPI_Comm_size(comm,&num_procs); + hypre_MPI_Comm_size(comm, &num_procs); hypre_MPI_Comm_rank(comm, &my_id); if ( n_rows_R != n_rows_A || num_rows_diag_R != num_rows_diag_A || n_cols_A != n_rows_P || num_cols_diag_A != num_rows_diag_P ) { - hypre_error_w_msg(HYPRE_ERROR_GENERIC," Error! Incompatible matrix dimensions!\n"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, " Error! Incompatible matrix dimensions!\n"); return NULL; } - - /*hypre_CSRMatrixTranspose(R_diag, &RT_diag, 1);*/ + /* Compute RT_diag if necessary */ + if (!hypre_ParCSRMatrixDiagT(R)) + { + hypre_CSRMatrixTranspose(R_diag, &RT_diag, 1); + } + else + { + RT_diag = hypre_ParCSRMatrixDiagT(R); + } if (num_procs > 1) { HYPRE_BigInt last_col_diag_P; - hypre_CSRMatrix *RT_offd = NULL; hypre_CSRMatrix *C_tmp_diag = NULL; hypre_CSRMatrix *C_tmp_offd = NULL; hypre_CSRMatrix *C_int = NULL; @@ -603,11 +625,12 @@ hypre_ParCSRMatrixRAPKTHost( hypre_ParCSRMatrix *R, hypre_CSRMatrix *C_int_diag = NULL; hypre_CSRMatrix *C_int_offd = NULL; - HYPRE_Int *C_tmp_offd_i; - HYPRE_Int *C_tmp_offd_j; + HYPRE_Int *C_tmp_offd_i; + HYPRE_Int *C_tmp_offd_j; + + HYPRE_Int *send_map_elmts_R; + void *request; - HYPRE_Int *send_map_elmts_R; - void *request; /*--------------------------------------------------------------------- * If there exists no CommPkg for A, a CommPkg is generated using * equally load balanced partitionings within @@ -617,7 +640,7 @@ hypre_ParCSRMatrixRAPKTHost( hypre_ParCSRMatrix *R, which should be explicitly included to allow for overlap */ if (num_cols_offd_A) { - last_col_diag_P = first_col_diag_P + num_cols_diag_P -1; + last_col_diag_P = first_col_diag_P + num_cols_diag_P - 1; hypre_CSRMatrixSplit(Ps_ext, first_col_diag_P, last_col_diag_P, num_cols_offd_P, col_map_offd_P, &num_cols_offd_Q, &col_map_offd_Q, &Pext_diag, &Pext_offd); /* These require data from other processes */ @@ -631,25 +654,25 @@ hypre_ParCSRMatrixRAPKTHost( hypre_ParCSRMatrix *R, { num_cols_offd_Q = num_cols_offd_P; col_map_offd_Q = hypre_CTAlloc(HYPRE_BigInt, num_cols_offd_Q, HYPRE_MEMORY_HOST); - for (i=0; i < num_cols_offd_P; i++) + for (i = 0; i < num_cols_offd_P; i++) { col_map_offd_Q[i] = col_map_offd_P[i]; } } hypre_CSRMatrixDestroy(Ps_ext); + /* These are local and could be overlapped with communication */ AP_diag = hypre_CSRMatrixMultiplyHost(A_diag, P_diag); if (num_cols_offd_P) { - HYPRE_Int i; AP_offd = hypre_CSRMatrixMultiplyHost(A_diag, P_offd); if (num_cols_offd_Q > num_cols_offd_P) { - map_P_to_Q = hypre_CTAlloc(HYPRE_Int,num_cols_offd_P, HYPRE_MEMORY_HOST); + map_P_to_Q = hypre_CTAlloc(HYPRE_Int, num_cols_offd_P, HYPRE_MEMORY_HOST); cnt = 0; - for (i=0; i < num_cols_offd_Q; i++) + for (i = 0; i < num_cols_offd_Q; i++) { if (col_map_offd_Q[i] == col_map_offd_P[cnt]) { @@ -662,7 +685,7 @@ hypre_ParCSRMatrixRAPKTHost( hypre_ParCSRMatrix *R, } AP_offd_num_nonzeros = hypre_CSRMatrixNumNonzeros(AP_offd); AP_offd_j = hypre_CSRMatrixJ(AP_offd); - for (i=0; i < AP_offd_num_nonzeros; i++) + for (i = 0; i < AP_offd_num_nonzeros; i++) { AP_offd_j[i] = map_P_to_Q[AP_offd_j[i]]; } @@ -712,7 +735,6 @@ hypre_ParCSRMatrixRAPKTHost( hypre_ParCSRMatrix *R, hypre_ParCSRMatrixOffd(Q) = Q_offd; hypre_ParCSRMatrixColMapOffd(Q) = col_map_offd_Q; - hypre_CSRMatrixTranspose(R_diag, &RT_diag, 1); C_tmp_diag = hypre_CSRMatrixMultiplyHost(RT_diag, Q_diag); if (num_cols_offd_Q) { @@ -724,18 +746,18 @@ hypre_ParCSRMatrixRAPKTHost( hypre_ParCSRMatrix *R, hypre_CSRMatrixNumRows(C_tmp_offd) = num_cols_diag_R; } - if (keep_transpose) - { - R->diagT = RT_diag; - } - else - { - hypre_CSRMatrixDestroy(RT_diag); - } - if (num_cols_offd_R) { - hypre_CSRMatrixTranspose(R_offd, &RT_offd, 1); + /* Compute RT_offd if necessary */ + if (!hypre_ParCSRMatrixOffdT(R)) + { + hypre_CSRMatrixTranspose(R_offd, &RT_offd, 1); + } + else + { + RT_offd = hypre_ParCSRMatrixOffdT(R); + } + C_int_diag = hypre_CSRMatrixMultiplyHost(RT_offd, Q_diag); C_int_offd = hypre_CSRMatrixMultiplyHost(RT_offd, Q_offd); @@ -747,7 +769,7 @@ hypre_ParCSRMatrixRAPKTHost( hypre_ParCSRMatrix *R, } else { - C_int = hypre_CSRMatrixCreate(0,0,0); + C_int = hypre_CSRMatrixCreate(0, 0, 0); hypre_CSRMatrixInitialize(C_int); } @@ -760,13 +782,17 @@ hypre_ParCSRMatrixRAPKTHost( hypre_ParCSRMatrix *R, { hypre_CSRMatrixDestroy(C_int_diag); hypre_CSRMatrixDestroy(C_int_offd); - if (keep_transpose) - { - R->offdT = RT_offd; - } - else + + if (!hypre_ParCSRMatrixOffdT(R)) { - hypre_CSRMatrixDestroy(RT_offd); + if (keep_transpose) + { + hypre_ParCSRMatrixOffdT(R) = RT_offd; + } + else + { + hypre_CSRMatrixDestroy(RT_offd); + } } } @@ -797,10 +823,10 @@ hypre_ParCSRMatrixRAPKTHost( hypre_ParCSRMatrix *R, C_tmp_offd_i = hypre_CSRMatrixI(C_tmp_offd); C_tmp_offd_j = hypre_CSRMatrixJ(C_tmp_offd); - map_Q_to_C = hypre_CTAlloc(HYPRE_Int,num_cols_offd_Q, HYPRE_MEMORY_HOST); + map_Q_to_C = hypre_CTAlloc(HYPRE_Int, num_cols_offd_Q, HYPRE_MEMORY_HOST); cnt = 0; - for (i=0; i < num_cols_offd_C; i++) + for (i = 0; i < num_cols_offd_C; i++) { if (col_map_offd_C[i] == col_map_offd_Q[cnt]) { @@ -811,7 +837,7 @@ hypre_ParCSRMatrixRAPKTHost( hypre_ParCSRMatrix *R, } } } - for (i=0; i < C_tmp_offd_i[hypre_CSRMatrixNumRows(C_tmp_offd)]; i++) + for (i = 0; i < C_tmp_offd_i[hypre_CSRMatrixNumRows(C_tmp_offd)]; i++) { j_indx = C_tmp_offd_j[i]; C_tmp_offd_j[i] = map_Q_to_C[j_indx]; @@ -825,6 +851,7 @@ hypre_ParCSRMatrixRAPKTHost( hypre_ParCSRMatrix *R, * Need to compute C_diag = C_tmp_diag + C_ext_diag * and C_offd = C_tmp_offd + C_ext_offd !!!! *-----------------------------------------------------------------------*/ + send_map_elmts_R = hypre_ParCSRCommPkgSendMapElmts(comm_pkg_R); if (C_ext_diag) { @@ -836,6 +863,7 @@ hypre_ParCSRMatrixRAPKTHost( hypre_ParCSRMatrix *R, { C_diag = C_tmp_diag; } + if (C_ext_offd) { C_offd = hypre_CSRMatrixAddPartial(C_tmp_offd, C_ext_offd, send_map_elmts_R); @@ -850,19 +878,22 @@ hypre_ParCSRMatrixRAPKTHost( hypre_ParCSRMatrix *R, else { Q_diag = hypre_CSRMatrixMultiplyHost(A_diag, P_diag); - hypre_CSRMatrixTranspose(R_diag, &RT_diag, 1); C_diag = hypre_CSRMatrixMultiplyHost(RT_diag, Q_diag); C_offd = hypre_CSRMatrixCreate(num_cols_diag_R, 0, 0); hypre_CSRMatrixInitialize_v2(C_offd, 0, hypre_CSRMatrixMemoryLocation(C_diag)); + hypre_CSRMatrixDestroy(Q_diag); + } + + if (!hypre_ParCSRMatrixDiagT(R)) + { if (keep_transpose) { - R->diagT = RT_diag; + hypre_ParCSRMatrixDiagT(R) = RT_diag; } else { hypre_CSRMatrixDestroy(RT_diag); } - hypre_CSRMatrixDestroy(Q_diag); } C = hypre_ParCSRMatrixCreate(comm, n_cols_R, n_cols_P, col_starts_R, @@ -894,19 +925,27 @@ hypre_ParCSRMatrixRAPKTHost( hypre_ParCSRMatrix *R, return C; } +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixRAPKT + * + * Computes "C = R * A * P". + * + * If either RT_diag or RT_offd don't exist and the flag keep_transpose is + * true, these local matrices are saved in the ParCSRMatrix R + *--------------------------------------------------------------------------*/ + hypre_ParCSRMatrix* hypre_ParCSRMatrixRAPKT( hypre_ParCSRMatrix *R, hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P, HYPRE_Int keep_transpose) { -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - hypre_GpuProfilingPushRange("TripleMat-RAP"); -#endif - hypre_ParCSRMatrix *C = NULL; -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("TripleMat-RAP"); + +#if defined(HYPRE_USING_GPU) HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy2( hypre_ParCSRMatrixMemoryLocation(R), hypre_ParCSRMatrixMemoryLocation(A) ); @@ -920,13 +959,19 @@ hypre_ParCSRMatrixRAPKT( hypre_ParCSRMatrix *R, C = hypre_ParCSRMatrixRAPKTHost(R, A, P, keep_transpose); } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_GpuProfilingPopRange(); -#endif + HYPRE_ANNOTATE_FUNC_END; return C; } +/*-------------------------------------------------------------------------- + * hypre_ParCSRMatrixRAP + * + * Computes "C = R * A * P" and discards the temporary local matrices generated + * in the algorithm (keep_transpose = 0). + *--------------------------------------------------------------------------*/ + hypre_ParCSRMatrix* hypre_ParCSRMatrixRAP( hypre_ParCSRMatrix *R, hypre_ParCSRMatrix *A, diff --git a/external/hypre/src/parcsr_mv/par_csr_triplemat_device.c b/external/hypre/src/parcsr_mv/par_csr_triplemat_device.c index 7ec3238d..28e7ad86 100644 --- a/external/hypre/src/parcsr_mv/par_csr_triplemat_device.c +++ b/external/hypre/src/parcsr_mv/par_csr_triplemat_device.c @@ -1,20 +1,27 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ +#include "_hypre_onedpl.hpp" #include "_hypre_parcsr_mv.h" #include "_hypre_utilities.hpp" -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#define PARCSRGEMM_TIMING 0 + +#if defined(HYPRE_USING_GPU) /* option == 1, T = HYPRE_BigInt * option == 2, T = HYPRE_Int, */ template +#if (defined(THRUST_VERSION) && THRUST_VERSION < 101000) struct RAP_functor : public thrust::unary_function +#else +struct RAP_functor +#endif { HYPRE_Int num_col; T first_col; @@ -44,11 +51,11 @@ struct RAP_functor : public thrust::unary_function if (option == 1) { - return col_map[x-num_col]; + return col_map[x - num_col]; } else { - return col_map[x-num_col] + num_col; + return col_map[x - num_col] + num_col; } } }; @@ -65,7 +72,8 @@ hypre_ParCSRMatMatDevice( hypre_ParCSRMatrix *A, HYPRE_BigInt *col_map_offd_C = NULL; HYPRE_Int num_procs; - hypre_MPI_Comm_size(hypre_ParCSRMatrixComm(A), &num_procs); + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + hypre_MPI_Comm_size(comm, &num_procs); if ( hypre_ParCSRMatrixGlobalNumCols(A) != hypre_ParCSRMatrixGlobalNumRows(B) || hypre_ParCSRMatrixNumCols(A) != hypre_ParCSRMatrixNumRows(B) ) @@ -75,6 +83,15 @@ hypre_ParCSRMatMatDevice( hypre_ParCSRMatrix *A, return NULL; } +#if PARCSRGEMM_TIMING > 0 + HYPRE_Real ta, tb; + ta = hypre_MPI_Wtime(); +#endif + +#if PARCSRGEMM_TIMING > 1 + HYPRE_Real t1, t2; +#endif + /*----------------------------------------------------------------------- * Extract B_ext, i.e. portion of B that is stored on neighbor procs * and needed locally for matrix matrix product @@ -88,15 +105,50 @@ hypre_ParCSRMatMatDevice( hypre_ParCSRMatrix *A, * equally load balanced partitionings within * hypre_ParCSRMatrixExtractBExt *--------------------------------------------------------------------*/ + +#if PARCSRGEMM_TIMING > 1 + t1 = hypre_MPI_Wtime(); +#endif /* contains communication which should be explicitly included to allow for overlap */ hypre_ParCSRMatrixExtractBExtDeviceInit(B, A, 1, &request); +#if PARCSRGEMM_TIMING > 1 + t2 = hypre_MPI_Wtime(); +#endif Abar = hypre_ConcatDiagAndOffdDevice(A); +#if PARCSRGEMM_TIMING > 1 + hypre_ForceSyncComputeStream(); + t2 = hypre_MPI_Wtime() - t2; + hypre_ParPrintf(comm, "Time Concat %f\n", t2); +#endif Bext = hypre_ParCSRMatrixExtractBExtDeviceWait(request); - +#if PARCSRGEMM_TIMING > 1 + hypre_ForceSyncComputeStream(); + t2 = hypre_MPI_Wtime() - t1 - t2; + hypre_ParPrintf(comm, "Time Bext %f\n", t2); + hypre_ParPrintf(comm, "Size Bext %d %d %d\n", hypre_CSRMatrixNumRows(Bext), + hypre_CSRMatrixNumCols(Bext), hypre_CSRMatrixNumNonzeros(Bext)); +#endif + +#if PARCSRGEMM_TIMING > 1 + t1 = hypre_MPI_Wtime(); +#endif hypre_ConcatDiagOffdAndExtDevice(B, Bext, &Bbar, &num_cols_offd_C, &col_map_offd_C); hypre_CSRMatrixDestroy(Bext); - +#if PARCSRGEMM_TIMING > 1 + hypre_ForceSyncComputeStream(); + t2 = hypre_MPI_Wtime() - t1; + hypre_ParPrintf(comm, "Time Concat %f\n", t2); +#endif + +#if PARCSRGEMM_TIMING > 1 + t1 = hypre_MPI_Wtime(); +#endif Cbar = hypre_CSRMatrixMultiplyDevice(Abar, Bbar); +#if PARCSRGEMM_TIMING > 1 + hypre_ForceSyncComputeStream(); + t2 = hypre_MPI_Wtime() - t1; + hypre_ParPrintf(comm, "Time SpGemm %f\n", t2); +#endif hypre_CSRMatrixDestroy(Abar); hypre_CSRMatrixDestroy(Bbar); @@ -105,14 +157,25 @@ hypre_ParCSRMatMatDevice( hypre_ParCSRMatrix *A, hypre_assert(hypre_CSRMatrixNumCols(Cbar) == hypre_ParCSRMatrixNumCols(B) + num_cols_offd_C); // split into diag and offd +#if PARCSRGEMM_TIMING > 1 + t1 = hypre_MPI_Wtime(); +#endif in_range pred(0, hypre_ParCSRMatrixNumCols(B) - 1); +#if defined(HYPRE_USING_SYCL) + HYPRE_Int nnz_C_diag = HYPRE_ONEDPL_CALL( std::count_if, + hypre_CSRMatrixJ(Cbar), + hypre_CSRMatrixJ(Cbar) + hypre_CSRMatrixNumNonzeros(Cbar), + pred ); +#else HYPRE_Int nnz_C_diag = HYPRE_THRUST_CALL( count_if, hypre_CSRMatrixJ(Cbar), hypre_CSRMatrixJ(Cbar) + hypre_CSRMatrixNumNonzeros(Cbar), pred ); +#endif HYPRE_Int nnz_C_offd = hypre_CSRMatrixNumNonzeros(Cbar) - nnz_C_diag; - C_diag = hypre_CSRMatrixCreate(hypre_ParCSRMatrixNumRows(A), hypre_ParCSRMatrixNumCols(B), nnz_C_diag); + C_diag = hypre_CSRMatrixCreate(hypre_ParCSRMatrixNumRows(A), hypre_ParCSRMatrixNumCols(B), + nnz_C_diag); hypre_CSRMatrixInitialize_v2(C_diag, 0, HYPRE_MEMORY_DEVICE); HYPRE_Int *C_diag_ii = hypre_TAlloc(HYPRE_Int, nnz_C_diag, HYPRE_MEMORY_DEVICE); HYPRE_Int *C_diag_j = hypre_CSRMatrixJ(C_diag); @@ -122,15 +185,29 @@ hypre_ParCSRMatMatDevice( hypre_ParCSRMatrix *A, hypre_CSRMatrixNumNonzeros(Cbar), hypre_CSRMatrixI(Cbar)); +#if defined(HYPRE_USING_SYCL) + auto new_end = hypreSycl_copy_if( oneapi::dpl::make_zip_iterator(Cbar_ii, hypre_CSRMatrixJ(Cbar), + hypre_CSRMatrixData(Cbar)), + oneapi::dpl::make_zip_iterator(Cbar_ii, hypre_CSRMatrixJ(Cbar), + hypre_CSRMatrixData(Cbar)) + hypre_CSRMatrixNumNonzeros(Cbar), + hypre_CSRMatrixJ(Cbar), + oneapi::dpl::make_zip_iterator(C_diag_ii, C_diag_j, C_diag_a), + pred ); + hypre_assert( std::get<0>(new_end.base()) == C_diag_ii + nnz_C_diag ); +#else auto new_end = HYPRE_THRUST_CALL( - copy_if, - thrust::make_zip_iterator(thrust::make_tuple(Cbar_ii, hypre_CSRMatrixJ(Cbar), hypre_CSRMatrixData(Cbar))), - thrust::make_zip_iterator(thrust::make_tuple(Cbar_ii, hypre_CSRMatrixJ(Cbar), hypre_CSRMatrixData(Cbar))) + hypre_CSRMatrixNumNonzeros(Cbar), - hypre_CSRMatrixJ(Cbar), - thrust::make_zip_iterator(thrust::make_tuple(C_diag_ii, C_diag_j, C_diag_a)), - pred ); + copy_if, + thrust::make_zip_iterator(thrust::make_tuple(Cbar_ii, hypre_CSRMatrixJ(Cbar), + hypre_CSRMatrixData(Cbar))), + thrust::make_zip_iterator(thrust::make_tuple(Cbar_ii, hypre_CSRMatrixJ(Cbar), + hypre_CSRMatrixData(Cbar))) + hypre_CSRMatrixNumNonzeros(Cbar), + hypre_CSRMatrixJ(Cbar), + thrust::make_zip_iterator(thrust::make_tuple(C_diag_ii, C_diag_j, C_diag_a)), + pred ); hypre_assert( thrust::get<0>(new_end.get_iterator_tuple()) == C_diag_ii + nnz_C_diag ); - hypreDevice_CsrRowIndicesToPtrs_v2(hypre_CSRMatrixNumRows(C_diag), nnz_C_diag, C_diag_ii, hypre_CSRMatrixI(C_diag)); +#endif + hypreDevice_CsrRowIndicesToPtrs_v2(hypre_CSRMatrixNumRows(C_diag), nnz_C_diag, C_diag_ii, + hypre_CSRMatrixI(C_diag)); hypre_TFree(C_diag_ii, HYPRE_MEMORY_DEVICE); C_offd = hypre_CSRMatrixCreate(hypre_ParCSRMatrixNumRows(A), num_cols_offd_C, nnz_C_offd); @@ -138,30 +215,66 @@ hypre_ParCSRMatMatDevice( hypre_ParCSRMatrix *A, HYPRE_Int *C_offd_ii = hypre_TAlloc(HYPRE_Int, nnz_C_offd, HYPRE_MEMORY_DEVICE); HYPRE_Int *C_offd_j = hypre_CSRMatrixJ(C_offd); HYPRE_Complex *C_offd_a = hypre_CSRMatrixData(C_offd); +#if defined(HYPRE_USING_SYCL) + new_end = hypreSycl_copy_if( oneapi::dpl::make_zip_iterator(Cbar_ii, hypre_CSRMatrixJ(Cbar), + hypre_CSRMatrixData(Cbar)), + oneapi::dpl::make_zip_iterator(Cbar_ii, hypre_CSRMatrixJ(Cbar), + hypre_CSRMatrixData(Cbar)) + hypre_CSRMatrixNumNonzeros(Cbar), + hypre_CSRMatrixJ(Cbar), + oneapi::dpl::make_zip_iterator(C_offd_ii, C_offd_j, C_offd_a), + std::not_fn(pred) ); + hypre_assert( std::get<0>(new_end.base()) == C_offd_ii + nnz_C_offd ); +#else new_end = HYPRE_THRUST_CALL( - copy_if, - thrust::make_zip_iterator(thrust::make_tuple(Cbar_ii, hypre_CSRMatrixJ(Cbar), hypre_CSRMatrixData(Cbar))), - thrust::make_zip_iterator(thrust::make_tuple(Cbar_ii, hypre_CSRMatrixJ(Cbar), hypre_CSRMatrixData(Cbar))) + hypre_CSRMatrixNumNonzeros(Cbar), - hypre_CSRMatrixJ(Cbar), - thrust::make_zip_iterator(thrust::make_tuple(C_offd_ii, C_offd_j, C_offd_a)), - thrust::not1(pred) ); + copy_if, + thrust::make_zip_iterator(thrust::make_tuple(Cbar_ii, hypre_CSRMatrixJ(Cbar), + hypre_CSRMatrixData(Cbar))), + thrust::make_zip_iterator(thrust::make_tuple(Cbar_ii, hypre_CSRMatrixJ(Cbar), + hypre_CSRMatrixData(Cbar))) + hypre_CSRMatrixNumNonzeros(Cbar), + hypre_CSRMatrixJ(Cbar), + thrust::make_zip_iterator(thrust::make_tuple(C_offd_ii, C_offd_j, C_offd_a)), + HYPRE_THRUST_NOT(pred) ); hypre_assert( thrust::get<0>(new_end.get_iterator_tuple()) == C_offd_ii + nnz_C_offd ); - hypreDevice_CsrRowIndicesToPtrs_v2(hypre_CSRMatrixNumRows(C_offd), nnz_C_offd, C_offd_ii, hypre_CSRMatrixI(C_offd)); +#endif + + hypreDevice_CsrRowIndicesToPtrs_v2(hypre_CSRMatrixNumRows(C_offd), nnz_C_offd, C_offd_ii, + hypre_CSRMatrixI(C_offd)); hypre_TFree(C_offd_ii, HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::transform, + C_offd_j, + C_offd_j + nnz_C_offd, + C_offd_j, + [const_val = hypre_ParCSRMatrixNumCols(B)] (const auto & x) {return x - const_val;} ); +#else HYPRE_THRUST_CALL( transform, C_offd_j, C_offd_j + nnz_C_offd, thrust::make_constant_iterator(hypre_ParCSRMatrixNumCols(B)), C_offd_j, thrust::minus() ); +#endif hypre_TFree(Cbar_ii, HYPRE_MEMORY_DEVICE); hypre_CSRMatrixDestroy(Cbar); +#if PARCSRGEMM_TIMING > 1 + hypre_ForceSyncComputeStream(); + t2 = hypre_MPI_Wtime() - t1; + hypre_ParPrintf(comm, "Time Split %f\n", t2); +#endif } else { +#if PARCSRGEMM_TIMING > 1 + t1 = hypre_MPI_Wtime(); +#endif C_diag = hypre_CSRMatrixMultiplyDevice(hypre_ParCSRMatrixDiag(A), hypre_ParCSRMatrixDiag(B)); +#if PARCSRGEMM_TIMING > 1 + hypre_ForceSyncComputeStream(); + t2 = hypre_MPI_Wtime() - t1; + hypre_ParPrintf(comm, "Time SpGemm %f\n", t2); +#endif C_offd = hypre_CSRMatrixCreate(hypre_ParCSRMatrixNumRows(A), 0, 0); hypre_CSRMatrixInitialize_v2(C_offd, 0, HYPRE_MEMORY_DEVICE); } @@ -184,12 +297,16 @@ hypre_ParCSRMatMatDevice( hypre_ParCSRMatrix *A, if (num_cols_offd_C) { hypre_ParCSRMatrixDeviceColMapOffd(C) = col_map_offd_C; - - hypre_ParCSRMatrixColMapOffd(C) = hypre_TAlloc(HYPRE_BigInt, num_cols_offd_C, HYPRE_MEMORY_HOST); - hypre_TMemcpy(hypre_ParCSRMatrixColMapOffd(C), col_map_offd_C, HYPRE_BigInt, num_cols_offd_C, - HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); } + hypre_ParCSRMatrixCopyColMapOffdToHost(C); + +#if PARCSRGEMM_TIMING > 0 + hypre_ForceSyncComputeStream(); + tb = hypre_MPI_Wtime() - ta; + hypre_ParPrintf(comm, "Time hypre_ParCSRMatMatDevice %f\n", tb); +#endif + return C; } @@ -209,17 +326,25 @@ hypre_ParCSRTMatMatKTDevice( hypre_ParCSRMatrix *A, HYPRE_BigInt *col_map_offd_C = NULL; HYPRE_Int num_procs; - hypre_MPI_Comm_size(hypre_ParCSRMatrixComm(A), &num_procs); - //HYPRE_Int my_id; - //hypre_MPI_Comm_rank(hypre_ParCSRMatrixComm(A), &my_id); + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + hypre_MPI_Comm_size(comm, &num_procs); if (hypre_ParCSRMatrixGlobalNumRows(A) != hypre_ParCSRMatrixGlobalNumRows(B) || hypre_ParCSRMatrixNumRows(A) != hypre_ParCSRMatrixNumRows(B)) { - hypre_error_w_msg(HYPRE_ERROR_GENERIC," Error! Incompatible matrix dimensions!\n"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, " Error! Incompatible matrix dimensions!\n"); return NULL; } +#if PARCSRGEMM_TIMING > 0 + HYPRE_Real ta, tb; + ta = hypre_MPI_Wtime(); +#endif + +#if PARCSRGEMM_TIMING > 1 + HYPRE_Real t1, t2; +#endif + if (num_procs > 1) { void *request; @@ -227,31 +352,99 @@ hypre_ParCSRTMatMatKTDevice( hypre_ParCSRMatrix *A, hypre_CSRMatrix *B_offd = hypre_ParCSRMatrixOffd(B); HYPRE_Int local_nnz_Cbar; +#if PARCSRGEMM_TIMING > 1 + t1 = hypre_MPI_Wtime(); +#endif Bbar = hypre_ConcatDiagAndOffdDevice(B); +#if PARCSRGEMM_TIMING > 1 + hypre_ForceSyncComputeStream(); + t2 = hypre_MPI_Wtime() - t1; + hypre_ParPrintf(comm, "Time Concat %f\n", t2); +#endif - hypre_CSRMatrixTranspose(A_diag, &AT_diag, 1); - hypre_CSRMatrixTranspose(A_offd, &AT_offd, 1); - AbarT = hypre_CSRMatrixStack2Device(AT_diag, AT_offd); +#if PARCSRGEMM_TIMING > 1 + t1 = hypre_MPI_Wtime(); +#endif - if (keep_transpose) + if (hypre_ParCSRMatrixDiagT(A)) { - hypre_ParCSRMatrixDiagT(A) = AT_diag; - hypre_ParCSRMatrixOffdT(A) = AT_offd; + AT_diag = hypre_ParCSRMatrixDiagT(A); } else { - hypre_CSRMatrixDestroy(AT_diag); - hypre_CSRMatrixDestroy(AT_offd); + hypre_CSRMatrixTranspose(A_diag, &AT_diag, 1); + } + + if (hypre_ParCSRMatrixOffdT(A)) + { + AT_offd = hypre_ParCSRMatrixOffdT(A); + } + else + { + hypre_CSRMatrixTranspose(A_offd, &AT_offd, 1); } +#if PARCSRGEMM_TIMING > 1 + hypre_ForceSyncComputeStream(); + t2 = hypre_MPI_Wtime() - t1; + hypre_ParPrintf(comm, "Time Transpose %f\n", t2); +#endif + +#if PARCSRGEMM_TIMING > 1 + t1 = hypre_MPI_Wtime(); +#endif + AbarT = hypre_CSRMatrixStack2Device(AT_diag, AT_offd); +#if PARCSRGEMM_TIMING > 1 + hypre_ForceSyncComputeStream(); + t2 = hypre_MPI_Wtime() - t1; + hypre_ParPrintf(comm, "Time Stack %f\n", t2); +#endif + + if (!hypre_ParCSRMatrixDiagT(A)) + { + if (keep_transpose) + { + hypre_ParCSRMatrixDiagT(A) = AT_diag; + } + else + { + hypre_CSRMatrixDestroy(AT_diag); + } + } + + if (!hypre_ParCSRMatrixOffdT(A)) + { + if (keep_transpose) + { + hypre_ParCSRMatrixOffdT(A) = AT_offd; + } + else + { + hypre_CSRMatrixDestroy(AT_offd); + } + } + +#if PARCSRGEMM_TIMING > 1 + t1 = hypre_MPI_Wtime(); +#endif Cbar = hypre_CSRMatrixMultiplyDevice(AbarT, Bbar); +#if PARCSRGEMM_TIMING > 1 + hypre_ForceSyncComputeStream(); + t2 = hypre_MPI_Wtime() - t1; + hypre_ParPrintf(comm, "Time SpGemm %f\n", t2); +#endif hypre_CSRMatrixDestroy(AbarT); hypre_CSRMatrixDestroy(Bbar); - hypre_assert(hypre_CSRMatrixNumRows(Cbar) == hypre_ParCSRMatrixNumCols(A) + hypre_CSRMatrixNumCols(A_offd)); - hypre_assert(hypre_CSRMatrixNumCols(Cbar) == hypre_ParCSRMatrixNumCols(B) + hypre_CSRMatrixNumCols(B_offd)); + hypre_assert(hypre_CSRMatrixNumRows(Cbar) == hypre_ParCSRMatrixNumCols(A) + hypre_CSRMatrixNumCols( + A_offd)); + hypre_assert(hypre_CSRMatrixNumCols(Cbar) == hypre_ParCSRMatrixNumCols(B) + hypre_CSRMatrixNumCols( + B_offd)); +#if PARCSRGEMM_TIMING > 1 + t1 = hypre_MPI_Wtime(); +#endif hypre_TMemcpy(&local_nnz_Cbar, hypre_CSRMatrixI(Cbar) + hypre_ParCSRMatrixNumCols(A), HYPRE_Int, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); @@ -262,26 +455,62 @@ hypre_ParCSRTMatMatKTDevice( hypre_ParCSRMatrix *A, hypre_CSRMatrixOwnsData(Cint) = 0; hypre_CSRMatrixI(Cint) = hypre_CSRMatrixI(Cbar) + hypre_ParCSRMatrixNumCols(A); +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::transform, + hypre_CSRMatrixI(Cint), + hypre_CSRMatrixI(Cint) + hypre_CSRMatrixNumRows(Cint) + 1, + hypre_CSRMatrixI(Cint), + [const_val = local_nnz_Cbar] (const auto & x) {return x - const_val;} ); +#else HYPRE_THRUST_CALL( transform, hypre_CSRMatrixI(Cint), hypre_CSRMatrixI(Cint) + hypre_CSRMatrixNumRows(Cint) + 1, thrust::make_constant_iterator(local_nnz_Cbar), hypre_CSRMatrixI(Cint), thrust::minus() ); +#endif - hypre_CSRMatrixBigJ(Cint) = hypre_TAlloc(HYPRE_BigInt, hypre_CSRMatrixNumNonzeros(Cint), HYPRE_MEMORY_DEVICE); + // Change Cint into a BigJ matrix + // RL: TODO FIX the 'big' num of columns to global size + hypre_CSRMatrixBigJ(Cint) = hypre_TAlloc(HYPRE_BigInt, hypre_CSRMatrixNumNonzeros(Cint), + HYPRE_MEMORY_DEVICE); RAP_functor<1, HYPRE_BigInt> func1( hypre_ParCSRMatrixNumCols(B), hypre_ParCSRMatrixFirstColDiag(B), hypre_ParCSRMatrixDeviceColMapOffd(B) ); +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::transform, + hypre_CSRMatrixJ(Cbar) + local_nnz_Cbar, + hypre_CSRMatrixJ(Cbar) + hypre_CSRMatrixNumNonzeros(Cbar), + hypre_CSRMatrixBigJ(Cint), + func1 ); +#else HYPRE_THRUST_CALL( transform, hypre_CSRMatrixJ(Cbar) + local_nnz_Cbar, hypre_CSRMatrixJ(Cbar) + hypre_CSRMatrixNumNonzeros(Cbar), hypre_CSRMatrixBigJ(Cint), func1 ); +#endif + +#if defined(HYPRE_USING_THRUST_NOSYNC) + /* RL: make sure Cint is ready before issuing GPU-GPU MPI */ + if (hypre_GetGpuAwareMPI()) + { + hypre_ForceSyncComputeStream(); + } +#endif hypre_CSRMatrixData(Cint) = hypre_CSRMatrixData(Cbar) + local_nnz_Cbar; +#if PARCSRGEMM_TIMING > 1 + hypre_ForceSyncComputeStream(); + t2 = hypre_MPI_Wtime() - t1; + hypre_ParPrintf(comm, "Time Cint %f\n", t2); +#endif + +#if PARCSRGEMM_TIMING > 1 + t1 = hypre_MPI_Wtime(); +#endif hypre_ExchangeExternalRowsDeviceInit(Cint, hypre_ParCSRMatrixCommPkg(A), 1, &request); Cext = hypre_ExchangeExternalRowsDeviceWait(request); @@ -290,156 +519,52 @@ hypre_ParCSRTMatMatKTDevice( hypre_ParCSRMatrix *A, hypre_TMemcpy(hypre_CSRMatrixI(Cbar) + hypre_ParCSRMatrixNumCols(A), &local_nnz_Cbar, HYPRE_Int, 1, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - - // to hold Cbar local and Cext - HYPRE_Int tmp_s = local_nnz_Cbar + hypre_CSRMatrixNumNonzeros(Cext); - HYPRE_Int *tmp_i = hypre_TAlloc(HYPRE_Int, tmp_s, HYPRE_MEMORY_DEVICE); - HYPRE_Int *tmp_j = hypre_TAlloc(HYPRE_Int, tmp_s, HYPRE_MEMORY_DEVICE); - HYPRE_Complex *tmp_a = hypre_TAlloc(HYPRE_Complex, tmp_s, HYPRE_MEMORY_DEVICE); - HYPRE_Int Cext_diag_nnz, Cext_offd_nnz, *offd_map_to_C; - - hypre_CSRMatrixSplitDevice_core(0, - hypre_CSRMatrixNumRows(Cext), - hypre_CSRMatrixNumNonzeros(Cext), - NULL, - hypre_CSRMatrixBigJ(Cext), NULL, NULL, - hypre_ParCSRMatrixFirstColDiag(B), - hypre_ParCSRMatrixLastColDiag(B), - hypre_CSRMatrixNumCols(B_offd), - NULL, NULL, NULL, NULL, - &Cext_diag_nnz, - NULL, NULL, NULL, NULL, - &Cext_offd_nnz, - NULL, NULL, NULL, NULL); - - HYPRE_Int *Cext_ii = hypreDevice_CsrRowPtrsToIndices(hypre_CSRMatrixNumRows(Cext), hypre_CSRMatrixNumNonzeros(Cext), - hypre_CSRMatrixI(Cext)); - - hypre_CSRMatrixSplitDevice_core(1, - hypre_CSRMatrixNumRows(Cext), - hypre_CSRMatrixNumNonzeros(Cext), - Cext_ii, - hypre_CSRMatrixBigJ(Cext), - hypre_CSRMatrixData(Cext), - NULL, - hypre_ParCSRMatrixFirstColDiag(B), - hypre_ParCSRMatrixLastColDiag(B), - hypre_CSRMatrixNumCols(B_offd), - hypre_ParCSRMatrixDeviceColMapOffd(B), - &offd_map_to_C, - &num_cols_offd_C, - &col_map_offd_C, - &Cext_diag_nnz, - tmp_i + local_nnz_Cbar, - tmp_j + local_nnz_Cbar, - tmp_a + local_nnz_Cbar, - NULL, - &Cext_offd_nnz, - tmp_i + local_nnz_Cbar + Cext_diag_nnz, - tmp_j + local_nnz_Cbar + Cext_diag_nnz, - tmp_a + local_nnz_Cbar + Cext_diag_nnz, - NULL); - - hypre_CSRMatrixDestroy(Cext); - hypre_TFree(Cext_ii, HYPRE_MEMORY_DEVICE); - - hypre_ParCSRCommPkgCopySendMapElmtsToDevice(hypre_ParCSRMatrixCommPkg(A)); - - HYPRE_THRUST_CALL( gather, - tmp_i + local_nnz_Cbar, - tmp_i + tmp_s, - hypre_ParCSRCommPkgDeviceSendMapElmts(hypre_ParCSRMatrixCommPkg(A)), - tmp_i + local_nnz_Cbar ); - - HYPRE_THRUST_CALL( transform, - tmp_j + local_nnz_Cbar + Cext_diag_nnz, - tmp_j + tmp_s, - thrust::make_constant_iterator(hypre_ParCSRMatrixNumCols(B)), - tmp_j + local_nnz_Cbar + Cext_diag_nnz, - thrust::plus() ); - - hypreDevice_CsrRowPtrsToIndices_v2(hypre_ParCSRMatrixNumCols(A), local_nnz_Cbar, hypre_CSRMatrixI(Cbar), tmp_i); - hypre_TMemcpy(tmp_a, hypre_CSRMatrixData(Cbar), HYPRE_Complex, local_nnz_Cbar, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); - RAP_functor<2, HYPRE_Int> func2(hypre_ParCSRMatrixNumCols(B), 0, offd_map_to_C); - HYPRE_THRUST_CALL( transform, - hypre_CSRMatrixJ(Cbar), - hypre_CSRMatrixJ(Cbar) + local_nnz_Cbar, - tmp_j, - func2 ); - - hypre_CSRMatrixDestroy(Cbar); - hypre_TFree(offd_map_to_C, HYPRE_MEMORY_DEVICE); - - // add Cext to Cbar local. Note: type 2, diagonal entries are put at the first in the rows - hypreDevice_StableSortByTupleKey(tmp_s, tmp_i, tmp_j, tmp_a, 2); - - HYPRE_Int *zmp_i = hypre_TAlloc(HYPRE_Int, tmp_s, HYPRE_MEMORY_DEVICE); - HYPRE_Int *zmp_j = hypre_TAlloc(HYPRE_Int, tmp_s, HYPRE_MEMORY_DEVICE); - HYPRE_Complex *zmp_a = hypre_TAlloc(HYPRE_Complex, tmp_s, HYPRE_MEMORY_DEVICE); - - HYPRE_Int local_nnz_C = hypreDevice_ReduceByTupleKey(tmp_s, tmp_i, tmp_j, tmp_a, zmp_i, zmp_j, zmp_a); - - hypre_TFree(tmp_i, HYPRE_MEMORY_DEVICE); - hypre_TFree(tmp_j, HYPRE_MEMORY_DEVICE); - hypre_TFree(tmp_a, HYPRE_MEMORY_DEVICE); - - // split into diag and offd - in_range pred(0, hypre_ParCSRMatrixNumCols(B) - 1); - - HYPRE_Int nnz_C_diag = HYPRE_THRUST_CALL( count_if, - zmp_j, - zmp_j + local_nnz_C, - pred ); - HYPRE_Int nnz_C_offd = local_nnz_C - nnz_C_diag; - - C_diag = hypre_CSRMatrixCreate(hypre_ParCSRMatrixNumCols(A), hypre_ParCSRMatrixNumCols(B), nnz_C_diag); - hypre_CSRMatrixInitialize_v2(C_diag, 0, HYPRE_MEMORY_DEVICE); - HYPRE_Int *C_diag_ii = hypre_TAlloc(HYPRE_Int, nnz_C_diag, HYPRE_MEMORY_DEVICE); - HYPRE_Int *C_diag_j = hypre_CSRMatrixJ(C_diag); - HYPRE_Complex *C_diag_a = hypre_CSRMatrixData(C_diag); - - auto new_end = HYPRE_THRUST_CALL( copy_if, - thrust::make_zip_iterator(thrust::make_tuple(zmp_i, zmp_j, zmp_a)), - thrust::make_zip_iterator(thrust::make_tuple(zmp_i, zmp_j, zmp_a)) + local_nnz_C, - zmp_j, - thrust::make_zip_iterator(thrust::make_tuple(C_diag_ii, C_diag_j, C_diag_a)), - pred ); - hypre_assert( thrust::get<0>(new_end.get_iterator_tuple()) == C_diag_ii + nnz_C_diag ); - hypreDevice_CsrRowIndicesToPtrs_v2(hypre_CSRMatrixNumRows(C_diag), nnz_C_diag, C_diag_ii, hypre_CSRMatrixI(C_diag)); - hypre_TFree(C_diag_ii, HYPRE_MEMORY_DEVICE); - - C_offd = hypre_CSRMatrixCreate(hypre_ParCSRMatrixNumCols(A), num_cols_offd_C, nnz_C_offd); - hypre_CSRMatrixInitialize_v2(C_offd, 0, HYPRE_MEMORY_DEVICE); - HYPRE_Int *C_offd_ii = hypre_TAlloc(HYPRE_Int, nnz_C_offd, HYPRE_MEMORY_DEVICE); - HYPRE_Int *C_offd_j = hypre_CSRMatrixJ(C_offd); - HYPRE_Complex *C_offd_a = hypre_CSRMatrixData(C_offd); - new_end = HYPRE_THRUST_CALL( copy_if, - thrust::make_zip_iterator(thrust::make_tuple(zmp_i, zmp_j, zmp_a)), - thrust::make_zip_iterator(thrust::make_tuple(zmp_i, zmp_j, zmp_a)) + local_nnz_C, - zmp_j, - thrust::make_zip_iterator(thrust::make_tuple(C_offd_ii, C_offd_j, C_offd_a)), - thrust::not1(pred) ); - hypre_assert( thrust::get<0>(new_end.get_iterator_tuple()) == C_offd_ii + nnz_C_offd ); - hypreDevice_CsrRowIndicesToPtrs_v2(hypre_CSRMatrixNumRows(C_offd), nnz_C_offd, C_offd_ii, hypre_CSRMatrixI(C_offd)); - hypre_TFree(C_offd_ii, HYPRE_MEMORY_DEVICE); - - HYPRE_THRUST_CALL( transform, - C_offd_j, - C_offd_j + nnz_C_offd, - thrust::make_constant_iterator(hypre_ParCSRMatrixNumCols(B)), - C_offd_j, - thrust::minus() ); - - hypre_TFree(zmp_i, HYPRE_MEMORY_DEVICE); - hypre_TFree(zmp_j, HYPRE_MEMORY_DEVICE); - hypre_TFree(zmp_a, HYPRE_MEMORY_DEVICE); +#if PARCSRGEMM_TIMING > 1 + hypre_ForceSyncComputeStream(); + t2 = hypre_MPI_Wtime() - t1; + hypre_ParPrintf(comm, "Time Cext %f\n", t2); + hypre_ParPrintf(comm, "Size Cext %d %d %d\n", hypre_CSRMatrixNumRows(Cext), + hypre_CSRMatrixNumCols(Cext), hypre_CSRMatrixNumNonzeros(Cext)); +#endif + + /* add Cext to local part of Cbar */ + hypre_ParCSRTMatMatPartialAddDevice(hypre_ParCSRMatrixCommPkg(A), + hypre_ParCSRMatrixNumCols(A), + hypre_ParCSRMatrixNumCols(B), + hypre_ParCSRMatrixFirstColDiag(B), + hypre_ParCSRMatrixLastColDiag(B), + hypre_CSRMatrixNumCols(B_offd), + hypre_ParCSRMatrixDeviceColMapOffd(B), + local_nnz_Cbar, + Cbar, + Cext, + &C_diag, + &C_offd, + &num_cols_offd_C, + &col_map_offd_C); } else { hypre_CSRMatrix *AT_diag; hypre_CSRMatrix *B_diag = hypre_ParCSRMatrixDiag(B); +#if PARCSRGEMM_TIMING > 1 + t1 = hypre_MPI_Wtime(); +#endif hypre_CSRMatrixTransposeDevice(A_diag, &AT_diag, 1); +#if PARCSRGEMM_TIMING > 1 + hypre_ForceSyncComputeStream(); + t2 = hypre_MPI_Wtime() - t1; + hypre_ParPrintf(comm, "Time Transpose %f\n", t2); +#endif +#if PARCSRGEMM_TIMING > 1 + t1 = hypre_MPI_Wtime(); +#endif C_diag = hypre_CSRMatrixMultiplyDevice(AT_diag, B_diag); +#if PARCSRGEMM_TIMING > 1 + hypre_ForceSyncComputeStream(); + t2 = hypre_MPI_Wtime() - t1; + hypre_ParPrintf(comm, "Time SpGemm %f\n", t2); +#endif C_offd = hypre_CSRMatrixCreate(hypre_ParCSRMatrixNumCols(A), 0, 0); hypre_CSRMatrixInitialize_v2(C_offd, 0, HYPRE_MEMORY_DEVICE); if (keep_transpose) @@ -450,10 +575,11 @@ hypre_ParCSRTMatMatKTDevice( hypre_ParCSRMatrix *A, { hypre_CSRMatrixDestroy(AT_diag); } - /* Move the diagonal entry to the first of each row */ - hypre_CSRMatrixMoveDiagFirstDevice(C_diag); } + /* Move the diagonal entry to the first of each row */ + hypre_CSRMatrixMoveDiagFirstDevice(C_diag); + C = hypre_ParCSRMatrixCreate(hypre_ParCSRMatrixComm(A), hypre_ParCSRMatrixGlobalNumCols(A), hypre_ParCSRMatrixGlobalNumCols(B), @@ -469,23 +595,25 @@ hypre_ParCSRTMatMatKTDevice( hypre_ParCSRMatrix *A, hypre_CSRMatrixDestroy(hypre_ParCSRMatrixOffd(C)); hypre_ParCSRMatrixOffd(C) = C_offd; - if (num_cols_offd_C) - { - hypre_ParCSRMatrixDeviceColMapOffd(C) = col_map_offd_C; + hypre_ParCSRMatrixDeviceColMapOffd(C) = col_map_offd_C; - hypre_ParCSRMatrixColMapOffd(C) = hypre_TAlloc(HYPRE_BigInt, num_cols_offd_C, HYPRE_MEMORY_HOST); - hypre_TMemcpy(hypre_ParCSRMatrixColMapOffd(C), col_map_offd_C, HYPRE_BigInt, num_cols_offd_C, - HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); - } + hypre_ParCSRMatrixCompressOffdMapDevice(C); + + hypre_ParCSRMatrixCopyColMapOffdToHost(C); hypre_assert(!hypre_CSRMatrixCheckDiagFirstDevice(hypre_ParCSRMatrixDiag(C))); - hypre_SyncCudaComputeStream(hypre_handle()); + hypre_SyncComputeStream(); + +#if PARCSRGEMM_TIMING > 0 + hypre_ForceSyncComputeStream(); + tb = hypre_MPI_Wtime() - ta; + hypre_ParPrintf(comm, "Time hypre_ParCSRTMatMatKTDevice %f\n", tb); +#endif return C; } - /* C = R^{T} * A * P */ hypre_ParCSRMatrix* hypre_ParCSRMatrixRAPKTDevice( hypre_ParCSRMatrix *R, @@ -493,19 +621,19 @@ hypre_ParCSRMatrixRAPKTDevice( hypre_ParCSRMatrix *R, hypre_ParCSRMatrix *P, HYPRE_Int keep_transpose ) { - hypre_CSRMatrix *R_diag = hypre_ParCSRMatrixDiag(R); - hypre_CSRMatrix *R_offd = hypre_ParCSRMatrixOffd(R); + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + hypre_CSRMatrix *R_diag = hypre_ParCSRMatrixDiag(R); + hypre_CSRMatrix *R_offd = hypre_ParCSRMatrixOffd(R); - hypre_ParCSRMatrix *C; - hypre_CSRMatrix *C_diag; - hypre_CSRMatrix *C_offd; - HYPRE_Int num_cols_offd_C = 0; - HYPRE_BigInt *col_map_offd_C = NULL; + hypre_ParCSRMatrix *C; + hypre_CSRMatrix *C_diag; + hypre_CSRMatrix *C_offd; + HYPRE_Int num_cols_offd_C = 0; + HYPRE_BigInt *col_map_offd_C = NULL; - HYPRE_Int num_procs; - hypre_MPI_Comm_size(hypre_ParCSRMatrixComm(A), &num_procs); - //HYPRE_Int my_id; - //hypre_MPI_Comm_rank(hypre_ParCSRMatrixComm(A), &my_id); + HYPRE_Int num_procs; + + hypre_MPI_Comm_size(comm, &num_procs); if ( hypre_ParCSRMatrixGlobalNumRows(R) != hypre_ParCSRMatrixGlobalNumRows(A) || hypre_ParCSRMatrixGlobalNumCols(A) != hypre_ParCSRMatrixGlobalNumRows(P) ) @@ -534,19 +662,48 @@ hypre_ParCSRMatrixRAPKTDevice( hypre_ParCSRMatrix *R, Abar = hypre_ConcatDiagAndOffdDevice(A); - hypre_CSRMatrixTransposeDevice(R_diag, &R_diagT, 1); - hypre_CSRMatrixTransposeDevice(R_offd, &R_offdT, 1); - RbarT = hypre_CSRMatrixStack2Device(R_diagT, R_offdT); + if (hypre_ParCSRMatrixDiagT(R)) + { + R_diagT = hypre_ParCSRMatrixDiagT(R); + } + else + { + hypre_CSRMatrixTransposeDevice(R_diag, &R_diagT, 1); + } - if (keep_transpose) + if (hypre_ParCSRMatrixOffdT(R)) { - hypre_ParCSRMatrixDiagT(R) = R_diagT; - hypre_ParCSRMatrixOffdT(R) = R_offdT; + R_offdT = hypre_ParCSRMatrixOffdT(R); } else { - hypre_CSRMatrixDestroy(R_diagT); - hypre_CSRMatrixDestroy(R_offdT); + hypre_CSRMatrixTransposeDevice(R_offd, &R_offdT, 1); + } + + RbarT = hypre_CSRMatrixStack2Device(R_diagT, R_offdT); + + if (!hypre_ParCSRMatrixDiagT(R)) + { + if (keep_transpose) + { + hypre_ParCSRMatrixDiagT(R) = R_diagT; + } + else + { + hypre_CSRMatrixDestroy(R_diagT); + } + } + + if (!hypre_ParCSRMatrixOffdT(R)) + { + if (keep_transpose) + { + hypre_ParCSRMatrixOffdT(R) = R_offdT; + } + else + { + hypre_CSRMatrixDestroy(R_offdT); + } } Pext = hypre_ParCSRMatrixExtractBExtDeviceWait(request); @@ -559,11 +716,14 @@ hypre_ParCSRMatrixRAPKTDevice( hypre_ParCSRMatrix *R, hypre_CSRMatrixDestroy(Abar); hypre_CSRMatrixDestroy(Pbar); - hypre_assert(hypre_CSRMatrixNumRows(Cbar) == hypre_ParCSRMatrixNumCols(R) + hypre_CSRMatrixNumCols(R_offd)); - hypre_assert(hypre_CSRMatrixNumCols(Cbar) == hypre_ParCSRMatrixNumCols(P) + num_cols_offd); + hypre_assert(hypre_CSRMatrixNumRows(Cbar) == + hypre_ParCSRMatrixNumCols(R) + hypre_CSRMatrixNumCols(R_offd)); + hypre_assert(hypre_CSRMatrixNumCols(Cbar) == + hypre_ParCSRMatrixNumCols(P) + num_cols_offd); - hypre_TMemcpy(&local_nnz_Cbar, hypre_CSRMatrixI(Cbar) + hypre_ParCSRMatrixNumCols(R), HYPRE_Int, 1, - HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(&local_nnz_Cbar, + hypre_CSRMatrixI(Cbar) + hypre_ParCSRMatrixNumCols(R), + HYPRE_Int, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); // Cint is the bottom part of Cbar Cint = hypre_CSRMatrixCreate(hypre_CSRMatrixNumCols(R_offd), hypre_CSRMatrixNumCols(Cbar), @@ -572,21 +732,51 @@ hypre_ParCSRMatrixRAPKTDevice( hypre_ParCSRMatrix *R, hypre_CSRMatrixOwnsData(Cint) = 0; hypre_CSRMatrixI(Cint) = hypre_CSRMatrixI(Cbar) + hypre_ParCSRMatrixNumCols(R); +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::transform, + hypre_CSRMatrixI(Cint), + hypre_CSRMatrixI(Cint) + hypre_CSRMatrixNumRows(Cint) + 1, + hypre_CSRMatrixI(Cint), + [const_val = local_nnz_Cbar] (const auto & x) {return x - const_val;} ); +#else HYPRE_THRUST_CALL( transform, hypre_CSRMatrixI(Cint), hypre_CSRMatrixI(Cint) + hypre_CSRMatrixNumRows(Cint) + 1, thrust::make_constant_iterator(local_nnz_Cbar), hypre_CSRMatrixI(Cint), thrust::minus() ); - - hypre_CSRMatrixBigJ(Cint) = hypre_TAlloc(HYPRE_BigInt, hypre_CSRMatrixNumNonzeros(Cint), HYPRE_MEMORY_DEVICE); - - RAP_functor<1, HYPRE_BigInt> func1(hypre_ParCSRMatrixNumCols(P), hypre_ParCSRMatrixFirstColDiag(P), col_map_offd); +#endif + + // Change Cint into a BigJ matrix + // RL: TODO FIX the 'big' num of columns to global size + hypre_CSRMatrixBigJ(Cint) = hypre_TAlloc(HYPRE_BigInt, + hypre_CSRMatrixNumNonzeros(Cint), + HYPRE_MEMORY_DEVICE); + + RAP_functor<1, HYPRE_BigInt> func1(hypre_ParCSRMatrixNumCols(P), + hypre_ParCSRMatrixFirstColDiag(P), + col_map_offd); +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::transform, + hypre_CSRMatrixJ(Cbar) + local_nnz_Cbar, + hypre_CSRMatrixJ(Cbar) + hypre_CSRMatrixNumNonzeros(Cbar), + hypre_CSRMatrixBigJ(Cint), + func1 ); +#else HYPRE_THRUST_CALL( transform, hypre_CSRMatrixJ(Cbar) + local_nnz_Cbar, hypre_CSRMatrixJ(Cbar) + hypre_CSRMatrixNumNonzeros(Cbar), hypre_CSRMatrixBigJ(Cint), func1 ); +#endif + +#if defined(HYPRE_USING_THRUST_NOSYNC) + /* RL: make sure Cint is ready before issuing GPU-GPU MPI */ + if (hypre_GetGpuAwareMPI()) + { + hypre_ForceSyncComputeStream(); + } +#endif hypre_CSRMatrixData(Cint) = hypre_CSRMatrixData(Cbar) + local_nnz_Cbar; @@ -596,172 +786,60 @@ hypre_ParCSRMatrixRAPKTDevice( hypre_ParCSRMatrix *R, hypre_TFree(hypre_CSRMatrixBigJ(Cint), HYPRE_MEMORY_DEVICE); hypre_TFree(Cint, HYPRE_MEMORY_HOST); - hypre_TMemcpy(hypre_CSRMatrixI(Cbar) + hypre_ParCSRMatrixNumCols(R), &local_nnz_Cbar, HYPRE_Int, 1, + hypre_TMemcpy(hypre_CSRMatrixI(Cbar) + hypre_ParCSRMatrixNumCols(R), + &local_nnz_Cbar, HYPRE_Int, 1, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - // to hold Cbar local and Cext - HYPRE_Int tmp_s = local_nnz_Cbar + hypre_CSRMatrixNumNonzeros(Cext); - HYPRE_Int *tmp_i = hypre_TAlloc(HYPRE_Int, tmp_s, HYPRE_MEMORY_DEVICE); - HYPRE_Int *tmp_j = hypre_TAlloc(HYPRE_Int, tmp_s, HYPRE_MEMORY_DEVICE); - HYPRE_Complex *tmp_a = hypre_TAlloc(HYPRE_Complex, tmp_s, HYPRE_MEMORY_DEVICE); - HYPRE_Int Cext_diag_nnz, Cext_offd_nnz, *offd_map_to_C; - - hypre_CSRMatrixSplitDevice_core(0, - hypre_CSRMatrixNumRows(Cext), - hypre_CSRMatrixNumNonzeros(Cext), - NULL, - hypre_CSRMatrixBigJ(Cext), NULL, NULL, - hypre_ParCSRMatrixFirstColDiag(P), - hypre_ParCSRMatrixLastColDiag(P), - num_cols_offd, - NULL, NULL, NULL, NULL, - &Cext_diag_nnz, - NULL, NULL, NULL, NULL, - &Cext_offd_nnz, - NULL, NULL, NULL, NULL); - - HYPRE_Int *Cext_ii = hypreDevice_CsrRowPtrsToIndices(hypre_CSRMatrixNumRows(Cext), hypre_CSRMatrixNumNonzeros(Cext), - hypre_CSRMatrixI(Cext)); - - hypre_CSRMatrixSplitDevice_core(1, - hypre_CSRMatrixNumRows(Cext), - hypre_CSRMatrixNumNonzeros(Cext), - Cext_ii, - hypre_CSRMatrixBigJ(Cext), - hypre_CSRMatrixData(Cext), - NULL, - hypre_ParCSRMatrixFirstColDiag(P), - hypre_ParCSRMatrixLastColDiag(P), - num_cols_offd, - col_map_offd, - &offd_map_to_C, - &num_cols_offd_C, - &col_map_offd_C, - &Cext_diag_nnz, - tmp_i + local_nnz_Cbar, - tmp_j + local_nnz_Cbar, - tmp_a + local_nnz_Cbar, - NULL, - &Cext_offd_nnz, - tmp_i + local_nnz_Cbar + Cext_diag_nnz, - tmp_j + local_nnz_Cbar + Cext_diag_nnz, - tmp_a + local_nnz_Cbar + Cext_diag_nnz, - NULL); + /* add Cext to local part of Cbar */ + hypre_ParCSRTMatMatPartialAddDevice(hypre_ParCSRMatrixCommPkg(R), + hypre_ParCSRMatrixNumCols(R), + hypre_ParCSRMatrixNumCols(P), + hypre_ParCSRMatrixFirstColDiag(P), + hypre_ParCSRMatrixLastColDiag(P), + num_cols_offd, + col_map_offd, + local_nnz_Cbar, + Cbar, + Cext, + &C_diag, + &C_offd, + &num_cols_offd_C, + &col_map_offd_C); - hypre_CSRMatrixDestroy(Cext); - hypre_TFree(Cext_ii, HYPRE_MEMORY_DEVICE); hypre_TFree(col_map_offd, HYPRE_MEMORY_DEVICE); - - hypre_ParCSRCommPkgCopySendMapElmtsToDevice(hypre_ParCSRMatrixCommPkg(R)); - - HYPRE_THRUST_CALL( gather, - tmp_i + local_nnz_Cbar, - tmp_i + tmp_s, - hypre_ParCSRCommPkgDeviceSendMapElmts(hypre_ParCSRMatrixCommPkg(R)), - tmp_i + local_nnz_Cbar ); - - HYPRE_THRUST_CALL( transform, - tmp_j + local_nnz_Cbar + Cext_diag_nnz, - tmp_j + tmp_s, - thrust::make_constant_iterator(hypre_ParCSRMatrixNumCols(P)), - tmp_j + local_nnz_Cbar + Cext_diag_nnz, - thrust::plus() ); - - hypreDevice_CsrRowPtrsToIndices_v2(hypre_ParCSRMatrixNumCols(R), local_nnz_Cbar, hypre_CSRMatrixI(Cbar), tmp_i); - hypre_TMemcpy(tmp_a, hypre_CSRMatrixData(Cbar), HYPRE_Complex, local_nnz_Cbar, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); - RAP_functor<2, HYPRE_Int> func2(hypre_ParCSRMatrixNumCols(P), 0, offd_map_to_C); - HYPRE_THRUST_CALL( transform, - hypre_CSRMatrixJ(Cbar), - hypre_CSRMatrixJ(Cbar) + local_nnz_Cbar, - tmp_j, - func2 ); - - hypre_CSRMatrixDestroy(Cbar); - hypre_TFree(offd_map_to_C, HYPRE_MEMORY_DEVICE); - - // add Cext to Cbar local. Note: type 2, diagonal entries are put at the first in the rows - hypreDevice_StableSortByTupleKey(tmp_s, tmp_i, tmp_j, tmp_a, 2); - - HYPRE_Int *zmp_i = hypre_TAlloc(HYPRE_Int, tmp_s, HYPRE_MEMORY_DEVICE); - HYPRE_Int *zmp_j = hypre_TAlloc(HYPRE_Int, tmp_s, HYPRE_MEMORY_DEVICE); - HYPRE_Complex *zmp_a = hypre_TAlloc(HYPRE_Complex, tmp_s, HYPRE_MEMORY_DEVICE); - - HYPRE_Int local_nnz_C = hypreDevice_ReduceByTupleKey(tmp_s, tmp_i, tmp_j, tmp_a, zmp_i, zmp_j, zmp_a); - - hypre_TFree(tmp_i, HYPRE_MEMORY_DEVICE); - hypre_TFree(tmp_j, HYPRE_MEMORY_DEVICE); - hypre_TFree(tmp_a, HYPRE_MEMORY_DEVICE); - - // split into diag and offd - in_range pred(0, hypre_ParCSRMatrixNumCols(P) - 1); - - HYPRE_Int nnz_C_diag = HYPRE_THRUST_CALL( count_if, - zmp_j, - zmp_j + local_nnz_C, - pred ); - HYPRE_Int nnz_C_offd = local_nnz_C - nnz_C_diag; - - C_diag = hypre_CSRMatrixCreate(hypre_ParCSRMatrixNumCols(R), hypre_ParCSRMatrixNumCols(P), nnz_C_diag); - hypre_CSRMatrixInitialize_v2(C_diag, 0, HYPRE_MEMORY_DEVICE); - HYPRE_Int *C_diag_ii = hypre_TAlloc(HYPRE_Int, nnz_C_diag, HYPRE_MEMORY_DEVICE); - HYPRE_Int *C_diag_j = hypre_CSRMatrixJ(C_diag); - HYPRE_Complex *C_diag_a = hypre_CSRMatrixData(C_diag); - - auto new_end = HYPRE_THRUST_CALL( copy_if, - thrust::make_zip_iterator(thrust::make_tuple(zmp_i, zmp_j, zmp_a)), - thrust::make_zip_iterator(thrust::make_tuple(zmp_i, zmp_j, zmp_a)) + local_nnz_C, - zmp_j, - thrust::make_zip_iterator(thrust::make_tuple(C_diag_ii, C_diag_j, C_diag_a)), - pred ); - hypre_assert( thrust::get<0>(new_end.get_iterator_tuple()) == C_diag_ii + nnz_C_diag ); - hypreDevice_CsrRowIndicesToPtrs_v2(hypre_CSRMatrixNumRows(C_diag), nnz_C_diag, C_diag_ii, hypre_CSRMatrixI(C_diag)); - hypre_TFree(C_diag_ii, HYPRE_MEMORY_DEVICE); - - C_offd = hypre_CSRMatrixCreate(hypre_ParCSRMatrixNumCols(R), num_cols_offd_C, nnz_C_offd); - hypre_CSRMatrixInitialize_v2(C_offd, 0, HYPRE_MEMORY_DEVICE); - HYPRE_Int *C_offd_ii = hypre_TAlloc(HYPRE_Int, nnz_C_offd, HYPRE_MEMORY_DEVICE); - HYPRE_Int *C_offd_j = hypre_CSRMatrixJ(C_offd); - HYPRE_Complex *C_offd_a = hypre_CSRMatrixData(C_offd); - new_end = HYPRE_THRUST_CALL( copy_if, - thrust::make_zip_iterator(thrust::make_tuple(zmp_i, zmp_j, zmp_a)), - thrust::make_zip_iterator(thrust::make_tuple(zmp_i, zmp_j, zmp_a)) + local_nnz_C, - zmp_j, - thrust::make_zip_iterator(thrust::make_tuple(C_offd_ii, C_offd_j, C_offd_a)), - thrust::not1(pred) ); - hypre_assert( thrust::get<0>(new_end.get_iterator_tuple()) == C_offd_ii + nnz_C_offd ); - hypreDevice_CsrRowIndicesToPtrs_v2(hypre_CSRMatrixNumRows(C_offd), nnz_C_offd, C_offd_ii, hypre_CSRMatrixI(C_offd)); - hypre_TFree(C_offd_ii, HYPRE_MEMORY_DEVICE); - - HYPRE_THRUST_CALL( transform, - C_offd_j, - C_offd_j + nnz_C_offd, - thrust::make_constant_iterator(hypre_ParCSRMatrixNumCols(P)), - C_offd_j, - thrust::minus() ); - - hypre_TFree(zmp_i, HYPRE_MEMORY_DEVICE); - hypre_TFree(zmp_j, HYPRE_MEMORY_DEVICE); - hypre_TFree(zmp_a, HYPRE_MEMORY_DEVICE); } else { hypre_CSRMatrix *R_diagT; hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); hypre_CSRMatrix *P_diag = hypre_ParCSRMatrixDiag(P); - hypre_CSRMatrixTransposeDevice(R_diag, &R_diagT, 1); - C_diag = hypre_CSRMatrixTripleMultiplyDevice(R_diagT, A_diag, P_diag); - C_offd = hypre_CSRMatrixCreate(hypre_ParCSRMatrixNumCols(R), 0, 0); - hypre_CSRMatrixInitialize_v2(C_offd, 0, HYPRE_MEMORY_DEVICE); - if (keep_transpose) + + /* Recover or compute transpose of R_diag */ + if (hypre_ParCSRMatrixDiagT(R)) { - hypre_ParCSRMatrixDiagT(R) = R_diagT; + R_diagT = hypre_ParCSRMatrixDiagT(R); } else { - hypre_CSRMatrixDestroy(R_diagT); + hypre_CSRMatrixTransposeDevice(R_diag, &R_diagT, 1); + } + + C_diag = hypre_CSRMatrixTripleMultiplyDevice(R_diagT, A_diag, P_diag); + C_offd = hypre_CSRMatrixCreate(hypre_ParCSRMatrixNumCols(R), 0, 0); + hypre_CSRMatrixInitialize_v2(C_offd, 0, HYPRE_MEMORY_DEVICE); + + /* Keep or destroy transpose of R_diag */ + if (!hypre_ParCSRMatrixDiagT(R)) + { + if (keep_transpose) + { + hypre_ParCSRMatrixDiagT(R) = R_diagT; + } + else + { + hypre_CSRMatrixDestroy(R_diagT); + } } - /* Move the diagonal entry to the first of each row */ - hypre_CSRMatrixMoveDiagFirstDevice(C_diag); } C = hypre_ParCSRMatrixCreate(hypre_ParCSRMatrixComm(A), @@ -779,20 +857,422 @@ hypre_ParCSRMatrixRAPKTDevice( hypre_ParCSRMatrix *R, hypre_CSRMatrixDestroy(hypre_ParCSRMatrixOffd(C)); hypre_ParCSRMatrixOffd(C) = C_offd; - if (num_cols_offd_C) + hypre_ParCSRMatrixDeviceColMapOffd(C) = col_map_offd_C; + + hypre_ParCSRMatrixCompressOffdMapDevice(C); + hypre_ParCSRMatrixCopyColMapOffdToHost(C); + + /* Ensure that the diagonal entries exist in the matrix structure (even if numerically zero) */ + if (hypre_CSRMatrixCheckForMissingDiagonal(C_diag)) { - hypre_ParCSRMatrixDeviceColMapOffd(C) = col_map_offd_C; + hypre_CSRMatrix *zero = hypre_CSRMatrixIdentityDevice(hypre_CSRMatrixNumRows(C_diag), 0.0); - hypre_ParCSRMatrixColMapOffd(C) = hypre_TAlloc(HYPRE_BigInt, num_cols_offd_C, HYPRE_MEMORY_HOST); - hypre_TMemcpy(hypre_ParCSRMatrixColMapOffd(C), col_map_offd_C, HYPRE_BigInt, num_cols_offd_C, - HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); + hypre_CSRMatrix *C_diag_new = hypre_CSRMatrixAddDevice(1.0, C_diag, 1.0, zero); + + hypre_CSRMatrixDestroy(C_diag); + hypre_CSRMatrixDestroy(zero); + + hypre_ParCSRMatrixDiag(C) = C_diag_new; } + /* Move the diagonal entry to the first of each row */ + hypre_CSRMatrixMoveDiagFirstDevice(hypre_ParCSRMatrixDiag(C)); + hypre_assert(!hypre_CSRMatrixCheckDiagFirstDevice(hypre_ParCSRMatrixDiag(C))); - hypre_SyncCudaComputeStream(hypre_handle()); + hypre_SyncComputeStream(); return C; } -#endif // #if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +HYPRE_Int +hypre_ParCSRTMatMatPartialAddDevice( hypre_ParCSRCommPkg *comm_pkg, + HYPRE_Int num_rows, + HYPRE_Int num_cols, + HYPRE_BigInt first_col_diag, + HYPRE_BigInt last_col_diag, + HYPRE_Int num_cols_offd, + HYPRE_BigInt *col_map_offd, + HYPRE_Int local_nnz_Cbar, + hypre_CSRMatrix *Cbar, + hypre_CSRMatrix *Cext, + hypre_CSRMatrix **C_diag_ptr, + hypre_CSRMatrix **C_offd_ptr, + HYPRE_Int *num_cols_offd_C_ptr, + HYPRE_BigInt **col_map_offd_C_ptr ) +{ +#if PARCSRGEMM_TIMING > 1 + MPI_Comm comm = hypre_ParCSRCommPkgComm(comm_pkg); + HYPRE_Real t1, t2; + t1 = hypre_MPI_Wtime(); +#endif + + HYPRE_Int Cext_nnz = hypre_CSRMatrixNumNonzeros(Cext); + HYPRE_Int num_cols_offd_C; + HYPRE_BigInt *col_map_offd_C; + hypre_CSRMatrix *Cz; + + // local part of Cbar + hypre_CSRMatrix *Cbar_local = hypre_CSRMatrixCreate(num_rows, hypre_CSRMatrixNumCols(Cbar), + local_nnz_Cbar); + hypre_CSRMatrixI(Cbar_local) = hypre_CSRMatrixI(Cbar); + hypre_CSRMatrixJ(Cbar_local) = hypre_CSRMatrixJ(Cbar); + hypre_CSRMatrixData(Cbar_local) = hypre_CSRMatrixData(Cbar); + hypre_CSRMatrixOwnsData(Cbar_local) = 0; + hypre_CSRMatrixMemoryLocation(Cbar_local) = HYPRE_MEMORY_DEVICE; + + if (!Cext_nnz) + { + num_cols_offd_C = num_cols_offd; + col_map_offd_C = hypre_TAlloc(HYPRE_BigInt, num_cols_offd, HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(col_map_offd_C, col_map_offd, HYPRE_BigInt, num_cols_offd, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + Cz = Cbar_local; + } + else + { + in_range pred1(first_col_diag, last_col_diag); + + if (!hypre_CSRMatrixJ(Cext)) + { + hypre_CSRMatrixJ(Cext) = hypre_TAlloc(HYPRE_Int, Cext_nnz, HYPRE_MEMORY_DEVICE); + } + + HYPRE_BigInt *Cext_bigj = hypre_CSRMatrixBigJ(Cext); + HYPRE_BigInt *big_work = hypre_TAlloc(HYPRE_BigInt, Cext_nnz, HYPRE_MEMORY_DEVICE); + HYPRE_Int *work = hypre_TAlloc(HYPRE_Int, Cext_nnz, HYPRE_MEMORY_DEVICE); + HYPRE_Int *map_offd_to_C; + + // Convert Cext from BigJ to J + // Cext offd +#if defined(HYPRE_USING_SYCL) + auto off_end = hypreSycl_copy_if( oneapi::dpl::make_zip_iterator(oneapi::dpl::counting_iterator(0), + Cext_bigj), + oneapi::dpl::make_zip_iterator(oneapi::dpl::counting_iterator(0), + Cext_bigj) + Cext_nnz, + Cext_bigj, + oneapi::dpl::make_zip_iterator(work, big_work), + std::not_fn(pred1) ); + + HYPRE_Int Cext_offd_nnz = std::get<0>(off_end.base()) - work; +#else + auto off_end = HYPRE_THRUST_CALL( copy_if, + thrust::make_zip_iterator(thrust::make_tuple(thrust::make_counting_iterator(0), Cext_bigj)), + thrust::make_zip_iterator(thrust::make_tuple(thrust::make_counting_iterator(0), + Cext_bigj)) + Cext_nnz, + Cext_bigj, + thrust::make_zip_iterator(thrust::make_tuple(work, big_work)), + HYPRE_THRUST_NOT(pred1) ); + + HYPRE_Int Cext_offd_nnz = thrust::get<0>(off_end.get_iterator_tuple()) - work; +#endif + + hypre_CSRMatrixMergeColMapOffd(num_cols_offd, col_map_offd, Cext_offd_nnz, big_work, + &num_cols_offd_C, &col_map_offd_C, &map_offd_to_C); + +#if defined(HYPRE_USING_SYCL) + /* WM: onedpl lower_bound currently does not accept zero length values */ + if (Cext_offd_nnz > 0) + { + HYPRE_ONEDPL_CALL( oneapi::dpl::lower_bound, + col_map_offd_C, + col_map_offd_C + num_cols_offd_C, + big_work, + big_work + Cext_offd_nnz, + oneapi::dpl::make_permutation_iterator(hypre_CSRMatrixJ(Cext), work) ); + } + + HYPRE_ONEDPL_CALL( std::transform, + oneapi::dpl::make_permutation_iterator(hypre_CSRMatrixJ(Cext), work), + oneapi::dpl::make_permutation_iterator(hypre_CSRMatrixJ(Cext), work) + Cext_offd_nnz, + oneapi::dpl::make_permutation_iterator(hypre_CSRMatrixJ(Cext), work), + [const_val = num_cols] (const auto & x) {return x + const_val;} ); +#else + HYPRE_THRUST_CALL( lower_bound, + col_map_offd_C, + col_map_offd_C + num_cols_offd_C, + big_work, + big_work + Cext_offd_nnz, + thrust::make_permutation_iterator(hypre_CSRMatrixJ(Cext), work) ); + + HYPRE_THRUST_CALL( transform, + thrust::make_permutation_iterator(hypre_CSRMatrixJ(Cext), work), + thrust::make_permutation_iterator(hypre_CSRMatrixJ(Cext), work) + Cext_offd_nnz, + thrust::make_constant_iterator(num_cols), + thrust::make_permutation_iterator(hypre_CSRMatrixJ(Cext), work), + thrust::plus() ); +#endif + + // Cext diag +#if defined(HYPRE_USING_SYCL) + auto dia_end = hypreSycl_copy_if( oneapi::dpl::make_zip_iterator(oneapi::dpl::counting_iterator(0), + Cext_bigj), + oneapi::dpl::make_zip_iterator(oneapi::dpl::counting_iterator(0), + Cext_bigj) + Cext_nnz, + Cext_bigj, + oneapi::dpl::make_zip_iterator(work, big_work), + pred1 ); + + HYPRE_Int Cext_diag_nnz = std::get<0>(dia_end.base()) - work; +#else + auto dia_end = HYPRE_THRUST_CALL( copy_if, + thrust::make_zip_iterator(thrust::make_tuple(thrust::make_counting_iterator(0), Cext_bigj)), + thrust::make_zip_iterator(thrust::make_tuple(thrust::make_counting_iterator(0), + Cext_bigj)) + Cext_nnz, + Cext_bigj, + thrust::make_zip_iterator(thrust::make_tuple(work, big_work)), + pred1 ); + + HYPRE_Int Cext_diag_nnz = thrust::get<0>(dia_end.get_iterator_tuple()) - work; +#endif + + hypre_assert(Cext_diag_nnz + Cext_offd_nnz == Cext_nnz); + +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::transform, + big_work, + big_work + Cext_diag_nnz, + oneapi::dpl::make_permutation_iterator(hypre_CSRMatrixJ(Cext), work), + [const_val = first_col_diag](const auto & x) {return x - const_val;} ); +#else + HYPRE_THRUST_CALL( transform, + big_work, + big_work + Cext_diag_nnz, + thrust::make_constant_iterator(first_col_diag), + thrust::make_permutation_iterator(hypre_CSRMatrixJ(Cext), work), + thrust::minus()); +#endif + + hypre_CSRMatrixNumCols(Cext) = num_cols + num_cols_offd_C; + + // transform Cbar_local J index + RAP_functor<2, HYPRE_Int> func2(num_cols, 0, map_offd_to_C); +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::transform, + hypre_CSRMatrixJ(Cbar_local), + hypre_CSRMatrixJ(Cbar_local) + local_nnz_Cbar, + hypre_CSRMatrixJ(Cbar_local), + func2 ); +#else + HYPRE_THRUST_CALL( transform, + hypre_CSRMatrixJ(Cbar_local), + hypre_CSRMatrixJ(Cbar_local) + local_nnz_Cbar, + hypre_CSRMatrixJ(Cbar_local), + func2 ); +#endif + + hypre_CSRMatrixNumCols(Cbar_local) = num_cols + num_cols_offd_C; + + hypre_TFree(big_work, HYPRE_MEMORY_DEVICE); + hypre_TFree(work, HYPRE_MEMORY_DEVICE); + hypre_TFree(map_offd_to_C, HYPRE_MEMORY_DEVICE); + hypre_TFree(Cext_bigj, HYPRE_MEMORY_DEVICE); + hypre_CSRMatrixBigJ(Cext) = NULL; + +#if PARCSRGEMM_TIMING > 1 + hypre_ForceSyncComputeStream(); + t2 = hypre_MPI_Wtime() - t1; + hypre_ParPrintf(comm, "Time PartialAdd1 %f\n", t2); +#endif + +#if PARCSRGEMM_TIMING > 1 + t1 = hypre_MPI_Wtime(); +#endif + + // IE = [I, E] + hypre_ParCSRCommPkgCopySendMapElmtsToDevice(comm_pkg); + + HYPRE_Int num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); + HYPRE_Int num_elemt = hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends); + HYPRE_Int *send_map = hypre_ParCSRCommPkgDeviceSendMapElmts(comm_pkg); + + hypre_CSRMatrix *IE = hypre_CSRMatrixCreate(num_rows, num_rows + num_elemt, + num_rows + num_elemt); + hypre_CSRMatrixMemoryLocation(IE) = HYPRE_MEMORY_DEVICE; + + HYPRE_Int *ie_ii = hypre_TAlloc(HYPRE_Int, num_rows + num_elemt, HYPRE_MEMORY_DEVICE); + HYPRE_Int *ie_j = hypre_TAlloc(HYPRE_Int, num_rows + num_elemt, HYPRE_MEMORY_DEVICE); + HYPRE_Complex *ie_a = NULL; + + if (hypre_HandleSpgemmUseVendor(hypre_handle())) + { + ie_a = hypre_TAlloc(HYPRE_Complex, num_rows + num_elemt, HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL(std::fill, ie_a, ie_a + num_rows + num_elemt, 1.0); +#else + HYPRE_THRUST_CALL(fill, ie_a, ie_a + num_rows + num_elemt, 1.0); +#endif + } + +#if defined(HYPRE_USING_SYCL) + hypreSycl_sequence(ie_ii, ie_ii + num_rows, 0); + HYPRE_ONEDPL_CALL( std::copy, send_map, send_map + num_elemt, ie_ii + num_rows); + hypreSycl_sequence(ie_j, ie_j + num_rows + num_elemt, 0); + auto zipped_begin = oneapi::dpl::make_zip_iterator(ie_ii, ie_j); + HYPRE_ONEDPL_CALL( std::stable_sort, zipped_begin, zipped_begin + num_rows + num_elemt, + [](auto lhs, auto rhs) { return std::get<0>(lhs) < std::get<0>(rhs); } ); +#else + HYPRE_THRUST_CALL( sequence, ie_ii, ie_ii + num_rows); + HYPRE_THRUST_CALL( copy, send_map, send_map + num_elemt, ie_ii + num_rows); + HYPRE_THRUST_CALL( sequence, ie_j, ie_j + num_rows + num_elemt); + HYPRE_THRUST_CALL( stable_sort_by_key, ie_ii, ie_ii + num_rows + num_elemt, ie_j ); +#endif + + HYPRE_Int *ie_i = hypreDevice_CsrRowIndicesToPtrs(num_rows, num_rows + num_elemt, ie_ii); + hypre_TFree(ie_ii, HYPRE_MEMORY_DEVICE); + + hypre_CSRMatrixI(IE) = ie_i; + hypre_CSRMatrixJ(IE) = ie_j; + hypre_CSRMatrixData(IE) = ie_a; + + // CC = [Cbar_local; Cext] + hypre_CSRMatrix *CC = hypre_CSRMatrixStack2Device(Cbar_local, Cext); + hypre_CSRMatrixDestroy(Cbar); + hypre_CSRMatrixDestroy(Cext); + +#if PARCSRGEMM_TIMING > 1 + hypre_ForceSyncComputeStream(); + t2 = hypre_MPI_Wtime() - t1; + hypre_ParPrintf(comm, "Time PartialAdd2 %f\n", t2); +#endif + + // Cz = IE * CC +#if PARCSRGEMM_TIMING > 1 + t1 = hypre_MPI_Wtime(); +#endif + Cz = hypre_CSRMatrixMultiplyDevice(IE, CC); + + hypre_CSRMatrixDestroy(IE); + hypre_CSRMatrixDestroy(CC); + +#if PARCSRGEMM_TIMING > 1 + hypre_ForceSyncComputeStream(); + t2 = hypre_MPI_Wtime() - t1; + hypre_ParPrintf(comm, "Time PartialAdd-SpGemm %f\n", t2); +#endif + } + +#if PARCSRGEMM_TIMING > 1 + t1 = hypre_MPI_Wtime(); +#endif + + // split into diag and offd + HYPRE_Int local_nnz_C = hypre_CSRMatrixNumNonzeros(Cz); + + HYPRE_Int *zmp_i = hypreDevice_CsrRowPtrsToIndices(num_rows, local_nnz_C, hypre_CSRMatrixI(Cz)); + HYPRE_Int *zmp_j = hypre_CSRMatrixJ(Cz); + HYPRE_Complex *zmp_a = hypre_CSRMatrixData(Cz); + + in_range pred(0, num_cols - 1); + +#if defined(HYPRE_USING_SYCL) + HYPRE_Int nnz_C_diag = HYPRE_ONEDPL_CALL( std::count_if, + zmp_j, + zmp_j + local_nnz_C, + pred ); +#else + HYPRE_Int nnz_C_diag = HYPRE_THRUST_CALL( count_if, + zmp_j, + zmp_j + local_nnz_C, + pred ); +#endif + HYPRE_Int nnz_C_offd = local_nnz_C - nnz_C_diag; + + // diag + hypre_CSRMatrix *C_diag = hypre_CSRMatrixCreate(num_rows, num_cols, nnz_C_diag); + hypre_CSRMatrixInitialize_v2(C_diag, 0, HYPRE_MEMORY_DEVICE); + HYPRE_Int *C_diag_ii = hypre_TAlloc(HYPRE_Int, nnz_C_diag, HYPRE_MEMORY_DEVICE); + HYPRE_Int *C_diag_j = hypre_CSRMatrixJ(C_diag); + HYPRE_Complex *C_diag_a = hypre_CSRMatrixData(C_diag); + +#if defined(HYPRE_USING_SYCL) + auto new_end = hypreSycl_copy_if( oneapi::dpl::make_zip_iterator(zmp_i, zmp_j, zmp_a), + oneapi::dpl::make_zip_iterator(zmp_i, zmp_j, zmp_a) + local_nnz_C, + zmp_j, + oneapi::dpl::make_zip_iterator(C_diag_ii, C_diag_j, C_diag_a), + pred ); + hypre_assert( std::get<0>(new_end.base()) == C_diag_ii + nnz_C_diag ); +#else + auto new_end = HYPRE_THRUST_CALL( copy_if, + thrust::make_zip_iterator(thrust::make_tuple(zmp_i, zmp_j, zmp_a)), + thrust::make_zip_iterator(thrust::make_tuple(zmp_i, zmp_j, zmp_a)) + local_nnz_C, + zmp_j, + thrust::make_zip_iterator(thrust::make_tuple(C_diag_ii, C_diag_j, C_diag_a)), + pred ); + hypre_assert( thrust::get<0>(new_end.get_iterator_tuple()) == C_diag_ii + nnz_C_diag ); +#endif + hypreDevice_CsrRowIndicesToPtrs_v2(hypre_CSRMatrixNumRows(C_diag), nnz_C_diag, C_diag_ii, + hypre_CSRMatrixI(C_diag)); + hypre_TFree(C_diag_ii, HYPRE_MEMORY_DEVICE); + + // offd + hypre_CSRMatrix *C_offd = hypre_CSRMatrixCreate(num_rows, num_cols_offd_C, nnz_C_offd); + hypre_CSRMatrixInitialize_v2(C_offd, 0, HYPRE_MEMORY_DEVICE); + HYPRE_Int *C_offd_ii = hypre_TAlloc(HYPRE_Int, nnz_C_offd, HYPRE_MEMORY_DEVICE); + HYPRE_Int *C_offd_j = hypre_CSRMatrixJ(C_offd); + HYPRE_Complex *C_offd_a = hypre_CSRMatrixData(C_offd); +#if defined(HYPRE_USING_SYCL) + new_end = hypreSycl_copy_if( oneapi::dpl::make_zip_iterator(zmp_i, zmp_j, zmp_a), + oneapi::dpl::make_zip_iterator(zmp_i, zmp_j, zmp_a) + local_nnz_C, + zmp_j, + oneapi::dpl::make_zip_iterator(C_offd_ii, C_offd_j, C_offd_a), + std::not_fn(pred) ); + hypre_assert( std::get<0>(new_end.base()) == C_offd_ii + nnz_C_offd ); +#else + new_end = HYPRE_THRUST_CALL( copy_if, + thrust::make_zip_iterator(thrust::make_tuple(zmp_i, zmp_j, zmp_a)), + thrust::make_zip_iterator(thrust::make_tuple(zmp_i, zmp_j, zmp_a)) + local_nnz_C, + zmp_j, + thrust::make_zip_iterator(thrust::make_tuple(C_offd_ii, C_offd_j, C_offd_a)), + HYPRE_THRUST_NOT(pred) ); + hypre_assert( thrust::get<0>(new_end.get_iterator_tuple()) == C_offd_ii + nnz_C_offd ); +#endif + hypreDevice_CsrRowIndicesToPtrs_v2(hypre_CSRMatrixNumRows(C_offd), nnz_C_offd, C_offd_ii, + hypre_CSRMatrixI(C_offd)); + hypre_TFree(C_offd_ii, HYPRE_MEMORY_DEVICE); + +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::transform, + C_offd_j, + C_offd_j + nnz_C_offd, + C_offd_j, + [const_val = num_cols] (const auto & x) {return x - const_val;} ); +#else + HYPRE_THRUST_CALL( transform, + C_offd_j, + C_offd_j + nnz_C_offd, + thrust::make_constant_iterator(num_cols), + C_offd_j, + thrust::minus() ); +#endif + + // free + hypre_TFree(Cbar_local, HYPRE_MEMORY_HOST); + hypre_TFree(zmp_i, HYPRE_MEMORY_DEVICE); + + if (!Cext_nnz) + { + hypre_CSRMatrixDestroy(Cbar); + hypre_CSRMatrixDestroy(Cext); + } + else + { + hypre_CSRMatrixDestroy(Cz); + } + +#if PARCSRGEMM_TIMING > 1 + hypre_ForceSyncComputeStream(); + t2 = hypre_MPI_Wtime() - t1; + hypre_ParPrintf(comm, "Time Split %f\n", t2); +#endif + + // output + *C_diag_ptr = C_diag; + *C_offd_ptr = C_offd; + *num_cols_offd_C_ptr = num_cols_offd_C; + *col_map_offd_C_ptr = col_map_offd_C; + + return hypre_error_flag; +} + +#endif /* #if defined(HYPRE_USING_GPU) */ diff --git a/external/hypre/src/parcsr_mv/par_make_system.c b/external/hypre/src/parcsr_mv/par_make_system.c index 7bf70cf0..9da5146d 100644 --- a/external/hypre/src/parcsr_mv/par_make_system.c +++ b/external/hypre/src/parcsr_mv/par_make_system.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -91,8 +91,8 @@ HYPRE_Generate2DSystem(HYPRE_ParCSRMatrix H_L1, HYPRE_ParCSRMatrix H_L2, HYPRE_BigInt *L1_col_map_offd = hypre_ParCSRMatrixColMapOffd(L1); HYPRE_BigInt *L2_col_map_offd = hypre_ParCSRMatrixColMapOffd(L2); - HYPRE_BigInt *A_row_starts; - HYPRE_BigInt *A_col_starts; + HYPRE_BigInt A_row_starts[2]; + HYPRE_BigInt A_col_starts[2]; HYPRE_BigInt *A_col_map_offd = NULL; @@ -112,15 +112,13 @@ HYPRE_Generate2DSystem(HYPRE_ParCSRMatrix H_L1, HYPRE_ParCSRMatrix H_L2, sys_prob = hypre_CTAlloc(HYPRE_ParCSR_System_Problem, 1, HYPRE_MEMORY_HOST); /* global number of variables */ - n = L_n*(HYPRE_BigInt)dim; + n = L_n * (HYPRE_BigInt)dim; /* global row/col starts */ - A_row_starts = hypre_CTAlloc(HYPRE_BigInt, 2, HYPRE_MEMORY_HOST); - A_col_starts = hypre_CTAlloc(HYPRE_BigInt, 2, HYPRE_MEMORY_HOST); - for(i = 0; i < 2; i++) + for (i = 0; i < 2; i++) { - A_row_starts[i] = L_row_starts[i]*(HYPRE_BigInt)dim; - A_col_starts[i] = L_row_starts[i]*(HYPRE_BigInt)dim; + A_row_starts[i] = L_row_starts[i] * (HYPRE_BigInt)dim; + A_col_starts[i] = L_row_starts[i] * (HYPRE_BigInt)dim; } /***** first we will do the diag part ******/ @@ -135,12 +133,12 @@ HYPRE_Generate2DSystem(HYPRE_ParCSRMatrix H_L1, HYPRE_ParCSRMatrix H_L2, /* assume m11 and m22 are nonzero */ A_nnz_diag = L1_nnz_diag + L2_nnz_diag; - if (m12) A_nnz_diag += L2_nnz_diag; - if (m21) A_nnz_diag += L1_nnz_diag; + if (m12) { A_nnz_diag += L2_nnz_diag; } + if (m21) { A_nnz_diag += L1_nnz_diag; } - A_diag_i = hypre_CTAlloc(HYPRE_Int, A_num_rows +1, HYPRE_MEMORY_HOST); + A_diag_i = hypre_CTAlloc(HYPRE_Int, A_num_rows + 1, HYPRE_MEMORY_HOST); A_diag_j = hypre_CTAlloc(HYPRE_Int, A_nnz_diag, HYPRE_MEMORY_HOST); - A_diag_data = hypre_CTAlloc(HYPRE_Complex, A_nnz_diag , HYPRE_MEMORY_HOST); + A_diag_data = hypre_CTAlloc(HYPRE_Complex, A_nnz_diag, HYPRE_MEMORY_HOST); A_diag_i[0] = 0; @@ -148,38 +146,38 @@ HYPRE_Generate2DSystem(HYPRE_ParCSRMatrix H_L1, HYPRE_ParCSRMatrix H_L2, L1_j_count = 0; L2_j_count = 0; - for (i=0; i< L_num_rows; i++) + for (i = 0; i < L_num_rows; i++) { - num1 = L1_diag_i[i+1] - L1_diag_i[i]; - num2 = (L2_diag_i[i+1] - L2_diag_i[i]); + num1 = L1_diag_i[i + 1] - L1_diag_i[i]; + num2 = (L2_diag_i[i + 1] - L2_diag_i[i]); /* unknown 1*/ if (m12 == 0.0) { - A_diag_i[i*2 + 1] = num1 + A_diag_i[i*2]; + A_diag_i[i * 2 + 1] = num1 + A_diag_i[i * 2]; - for (k=0; k< num1; k++) + for (k = 0; k < num1; k++) { - A_diag_j[A_j_count + k] = dim*L1_diag_j[L1_j_count + k]; - A_diag_data[A_j_count + k] = m11*L1_diag_data[L1_j_count + k]; + A_diag_j[A_j_count + k] = dim * L1_diag_j[L1_j_count + k]; + A_diag_data[A_j_count + k] = m11 * L1_diag_data[L1_j_count + k]; } A_j_count += num1; } else /* m12 is nonzero */ { - A_diag_i[i*2 + 1] = num1 + num2 + A_diag_i[i*2]; + A_diag_i[i * 2 + 1] = num1 + num2 + A_diag_i[i * 2]; - for (k=0; k< num1; k++) + for (k = 0; k < num1; k++) { - A_diag_j[A_j_count + k] = dim*L1_diag_j[L1_j_count + k]; - A_diag_data[A_j_count + k] = m11*L1_diag_data[L1_j_count + k]; + A_diag_j[A_j_count + k] = dim * L1_diag_j[L1_j_count + k]; + A_diag_data[A_j_count + k] = m11 * L1_diag_data[L1_j_count + k]; } A_j_count += num1; - for (k=0; k< num2; k++) + for (k = 0; k < num2; k++) { - A_diag_j[A_j_count + k] = 1 + dim*L2_diag_j[L2_j_count + k]; - A_diag_data[A_j_count + k] = m12*L2_diag_data[L2_j_count + k]; + A_diag_j[A_j_count + k] = 1 + dim * L2_diag_j[L2_j_count + k]; + A_diag_data[A_j_count + k] = m12 * L2_diag_data[L2_j_count + k]; } A_j_count += num2; @@ -190,38 +188,38 @@ HYPRE_Generate2DSystem(HYPRE_ParCSRMatrix H_L1, HYPRE_ParCSRMatrix H_L2, /* unknown 2*/ if (m21 == 0.0) { - A_diag_i[i*2 + 2] = num2 + A_diag_i[i*2 + 1]; + A_diag_i[i * 2 + 2] = num2 + A_diag_i[i * 2 + 1]; - for (k=0; k< num2; k++) + for (k = 0; k < num2; k++) { - A_diag_j[A_j_count + k] = 1 + dim*L2_diag_j[L2_j_count + k]; - A_diag_data[A_j_count + k] = m22*L2_diag_data[L2_j_count + k]; + A_diag_j[A_j_count + k] = 1 + dim * L2_diag_j[L2_j_count + k]; + A_diag_data[A_j_count + k] = m22 * L2_diag_data[L2_j_count + k]; } A_j_count += num2; } else /* m21 is nonzero */ { - A_diag_i[i*2 + 2] = num1 + num2 + A_diag_i[i*2 + 1]; + A_diag_i[i * 2 + 2] = num1 + num2 + A_diag_i[i * 2 + 1]; - for (k=0; k< num2; k++) + for (k = 0; k < num2; k++) { - A_diag_j[A_j_count+k] = 1 + dim*L2_diag_j[L2_j_count + k]; - A_diag_data[A_j_count+k] = m22*L2_diag_data[L2_j_count + k]; + A_diag_j[A_j_count + k] = 1 + dim * L2_diag_j[L2_j_count + k]; + A_diag_data[A_j_count + k] = m22 * L2_diag_data[L2_j_count + k]; } A_j_count += num2; - for (k=0; k< num1; k++) + for (k = 0; k < num1; k++) { - A_diag_j[A_j_count+k] = dim*L1_diag_j[L1_j_count + k]; - A_diag_data[A_j_count+k] = m21*L1_diag_data[L1_j_count + k]; + A_diag_j[A_j_count + k] = dim * L1_diag_j[L1_j_count + k]; + A_diag_data[A_j_count + k] = m21 * L1_diag_data[L1_j_count + k]; } A_j_count += num1; } /* end unknown 2 */ - L1_j_count +=num1; + L1_j_count += num1; L2_j_count += num2; @@ -242,14 +240,14 @@ HYPRE_Generate2DSystem(HYPRE_ParCSRMatrix H_L1, HYPRE_ParCSRMatrix H_L2, A_num_rows = L_num_rows * dim; A_nnz_offd = L1_nnz_offd + L2_nnz_offd; - if (m12) A_nnz_offd += L2_nnz_offd; - if (m21) A_nnz_offd += L1_nnz_offd; + if (m12) { A_nnz_offd += L2_nnz_offd; } + if (m21) { A_nnz_offd += L1_nnz_offd; } A_num_cols_offd = L1_num_cols_offd + L2_num_cols_offd; - A_offd_i = hypre_CTAlloc(HYPRE_Int, A_num_rows +1, HYPRE_MEMORY_HOST); + A_offd_i = hypre_CTAlloc(HYPRE_Int, A_num_rows + 1, HYPRE_MEMORY_HOST); A_offd_j = hypre_CTAlloc(HYPRE_Int, A_nnz_offd, HYPRE_MEMORY_HOST); - A_offd_data = hypre_CTAlloc(HYPRE_Complex, A_nnz_offd , HYPRE_MEMORY_HOST); + A_offd_data = hypre_CTAlloc(HYPRE_Complex, A_nnz_offd, HYPRE_MEMORY_HOST); A_col_map_offd = hypre_CTAlloc(HYPRE_BigInt, A_num_cols_offd, HYPRE_MEMORY_HOST); @@ -270,8 +268,8 @@ HYPRE_Generate2DSystem(HYPRE_ParCSRMatrix H_L1, HYPRE_ParCSRMatrix H_L2, if (L1_map_count < L1_num_cols_offd && L2_map_count < L2_num_cols_offd) { - ent1 = L1_col_map_offd[L1_map_count]*2; - ent2 = L2_col_map_offd[L2_map_count]*2 + 1; + ent1 = L1_col_map_offd[L1_map_count] * 2; + ent2 = L2_col_map_offd[L2_map_count] * 2 + 1; if (ent1 < ent2) { A_col_map_offd[i] = ent1; @@ -285,13 +283,13 @@ HYPRE_Generate2DSystem(HYPRE_ParCSRMatrix H_L1, HYPRE_ParCSRMatrix H_L2, } else if (L1_map_count >= L1_num_cols_offd) { - ent2 = L2_col_map_offd[L2_map_count]*2 + 1; + ent2 = L2_col_map_offd[L2_map_count] * 2 + 1; A_col_map_offd[i] = ent2; L2_map_to_new[L2_map_count++] = i; } else if (L2_map_count >= L2_num_cols_offd) { - ent1 = L1_col_map_offd[L1_map_count]*2; + ent1 = L1_col_map_offd[L1_map_count] * 2; A_col_map_offd[i] = ent1; L1_map_to_new[L1_map_count++] = i; } @@ -310,21 +308,21 @@ HYPRE_Generate2DSystem(HYPRE_ParCSRMatrix H_L1, HYPRE_ParCSRMatrix H_L2, L2_j_count = 0; A_offd_i[0] = 0; - for (i=0; i< L_num_rows; i++) + for (i = 0; i < L_num_rows; i++) { - num1 = L1_offd_i[i+1] - L1_offd_i[i]; - num2 = (L2_offd_i[i+1] - L2_offd_i[i]); + num1 = L1_offd_i[i + 1] - L1_offd_i[i]; + num2 = (L2_offd_i[i + 1] - L2_offd_i[i]); /* unknown 1*/ if (m12 == 0.0) { - A_offd_i[i*2 + 1] = num1 + A_offd_i[i*2]; + A_offd_i[i * 2 + 1] = num1 + A_offd_i[i * 2]; - for (k=0; k< num1; k++) + for (k = 0; k < num1; k++) { tmp_i = L1_offd_j[L1_j_count + k]; A_offd_j[A_j_count + k] = L1_map_to_new[tmp_i]; - A_offd_data[A_j_count + k] = m11*L1_offd_data[L1_j_count + k]; + A_offd_data[A_j_count + k] = m11 * L1_offd_data[L1_j_count + k]; } A_j_count += num1; @@ -332,21 +330,21 @@ HYPRE_Generate2DSystem(HYPRE_ParCSRMatrix H_L1, HYPRE_ParCSRMatrix H_L2, } else /* m12 is nonzero */ { - A_offd_i[i*2 + 1] = num1 + num2 + A_offd_i[i*2]; + A_offd_i[i * 2 + 1] = num1 + num2 + A_offd_i[i * 2]; - for (k=0; k< num1; k++) + for (k = 0; k < num1; k++) { tmp_i = L1_offd_j[L1_j_count + k]; A_offd_j[A_j_count + k] = L1_map_to_new[tmp_i]; - A_offd_data[A_j_count + k] = m11*L1_offd_data[L1_j_count + k]; + A_offd_data[A_j_count + k] = m11 * L1_offd_data[L1_j_count + k]; } A_j_count += num1; - for (k=0; k< num2; k++) + for (k = 0; k < num2; k++) { tmp_i = L2_offd_j[L2_j_count + k]; A_offd_j[A_j_count + k] = L2_map_to_new[tmp_i]; - A_offd_data[A_j_count + k] = m12*L2_offd_data[L2_j_count + k]; + A_offd_data[A_j_count + k] = m12 * L2_offd_data[L2_j_count + k]; } A_j_count += num2; @@ -354,41 +352,41 @@ HYPRE_Generate2DSystem(HYPRE_ParCSRMatrix H_L1, HYPRE_ParCSRMatrix H_L2, /* unknown 2*/ if (m21 == 0.0) { - A_offd_i[i*2 + 2] = num2 + A_offd_i[i*2 + 1]; + A_offd_i[i * 2 + 2] = num2 + A_offd_i[i * 2 + 1]; - for (k=0; k< num2; k++) + for (k = 0; k < num2; k++) { tmp_i = L2_offd_j[L2_j_count + k]; A_offd_j[A_j_count + k] = L2_map_to_new[tmp_i]; - A_offd_data[A_j_count + k] = m22*L2_offd_data[L2_j_count + k]; + A_offd_data[A_j_count + k] = m22 * L2_offd_data[L2_j_count + k]; } A_j_count += num2; } else /* m21 is nonzero */ { - A_offd_i[i*2 + 2] = num1 + num2 + A_offd_i[i*2 + 1]; + A_offd_i[i * 2 + 2] = num1 + num2 + A_offd_i[i * 2 + 1]; - for (k=0; k< num2; k++) + for (k = 0; k < num2; k++) { tmp_i = L2_offd_j[L2_j_count + k]; A_offd_j[A_j_count + k] = L2_map_to_new[tmp_i]; - A_offd_data[A_j_count + k] = m22*L2_offd_data[L2_j_count + k]; + A_offd_data[A_j_count + k] = m22 * L2_offd_data[L2_j_count + k]; } A_j_count += num2; - for (k=0; k< num1; k++) + for (k = 0; k < num1; k++) { tmp_i = L1_offd_j[L1_j_count + k]; A_offd_j[A_j_count + k] = L1_map_to_new[tmp_i]; - A_offd_data[A_j_count + k] = m21*L1_offd_data[L1_j_count + k]; + A_offd_data[A_j_count + k] = m21 * L1_offd_data[L1_j_count + k]; } A_j_count += num1; } /* end unknown 2 */ - L1_j_count +=num1; + L1_j_count += num1; L2_j_count += num2; @@ -435,12 +433,12 @@ HYPRE_Generate2DSystem(HYPRE_ParCSRMatrix H_L1, HYPRE_ParCSRMatrix H_L2, HYPRE_Complex *b1_data = hypre_VectorData(b1_local); HYPRE_Complex *b2_data = hypre_VectorData(b2_local); - b_data = hypre_CTAlloc(HYPRE_Complex, size*2, HYPRE_MEMORY_HOST); + b_data = hypre_CTAlloc(HYPRE_Complex, size * 2, HYPRE_MEMORY_HOST); for (i = 0; i < size; i++) { - b_data[i*2] = b1_data[i]; - b_data[i*2+1] = b2_data[i]; + b_data[i * 2] = b1_data[i]; + b_data[i * 2 + 1] = b2_data[i]; } b = hypre_ParVectorCreate( comm, n, A_row_starts); @@ -449,7 +447,7 @@ HYPRE_Generate2DSystem(HYPRE_ParCSRMatrix H_L1, HYPRE_ParCSRMatrix H_L2, hypre_TFree(hypre_VectorData(hypre_ParVectorLocalVector(b)), HYPRE_MEMORY_HOST); hypre_VectorData(hypre_ParVectorLocalVector(b)) = b_data; - hypre_ParVectorSetDataOwner(b,1); + hypre_ParVectorSetDataOwner(b, 1); } /* create x */ @@ -460,12 +458,12 @@ HYPRE_Generate2DSystem(HYPRE_ParCSRMatrix H_L1, HYPRE_ParCSRMatrix H_L2, HYPRE_Complex *x1_data = hypre_VectorData(x1_local); HYPRE_Complex *x2_data = hypre_VectorData(x2_local); - x_data = hypre_CTAlloc(HYPRE_Complex, size*2, HYPRE_MEMORY_HOST); + x_data = hypre_CTAlloc(HYPRE_Complex, size * 2, HYPRE_MEMORY_HOST); for (i = 0; i < size; i++) { - x_data[i*2] = x1_data[i]; - x_data[i*2+1] = x2_data[i]; + x_data[i * 2] = x1_data[i]; + x_data[i * 2 + 1] = x2_data[i]; } x = hypre_ParVectorCreate( comm, n, A_row_starts); @@ -474,7 +472,7 @@ HYPRE_Generate2DSystem(HYPRE_ParCSRMatrix H_L1, HYPRE_ParCSRMatrix H_L2, hypre_TFree(hypre_VectorData(hypre_ParVectorLocalVector(x)), HYPRE_MEMORY_HOST); hypre_VectorData(hypre_ParVectorLocalVector(x)) = x_data; - hypre_ParVectorSetDataOwner(x,1); + hypre_ParVectorSetDataOwner(x, 1); } sys_prob->A = A; diff --git a/external/hypre/src/parcsr_mv/par_make_system.h b/external/hypre/src/parcsr_mv/par_make_system.h index 93703186..87f2a1d8 100644 --- a/external/hypre/src/parcsr_mv/par_make_system.h +++ b/external/hypre/src/parcsr_mv/par_make_system.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/parcsr_mv/par_vector.c b/external/hypre/src/parcsr_mv/par_vector.c index 44908790..32b1907c 100644 --- a/external/hypre/src/parcsr_mv/par_vector.c +++ b/external/hypre/src/parcsr_mv/par_vector.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -13,16 +13,17 @@ #include "_hypre_parcsr_mv.h" -HYPRE_Int hypre_FillResponseParToVectorAll(void*, HYPRE_Int, HYPRE_Int, void*, MPI_Comm, void**, HYPRE_Int*); +HYPRE_Int hypre_FillResponseParToVectorAll(void*, HYPRE_Int, HYPRE_Int, void*, MPI_Comm, void**, + HYPRE_Int*); /*-------------------------------------------------------------------------- * hypre_ParVectorCreate + * + * If create is called and partitioning is NOT null, then it is assumed that it + * is array of length 2 containing the start row of the calling processor + * followed by the start row of the next processor - AHB 6/05 *--------------------------------------------------------------------------*/ -/* If create is called and partitioning is NOT null, then it is assumed that it - is array of length 2 containing the start row of the calling processor - followed by the start row of the next processor - AHB 6/05 */ - hypre_ParVector * hypre_ParVectorCreate( MPI_Comm comm, HYPRE_BigInt global_size, @@ -38,11 +39,12 @@ hypre_ParVectorCreate( MPI_Comm comm, return NULL; } vector = hypre_CTAlloc(hypre_ParVector, 1, HYPRE_MEMORY_HOST); - hypre_MPI_Comm_rank(comm,&my_id); + + hypre_MPI_Comm_rank(comm, &my_id); if (!partitioning_in) { - hypre_MPI_Comm_size(comm,&num_procs); + hypre_MPI_Comm_size(comm, &num_procs); hypre_GenerateLocalPartitioning(global_size, num_procs, my_id, partitioning); } else @@ -59,7 +61,7 @@ hypre_ParVectorCreate( MPI_Comm comm, hypre_ParVectorPartitioning(vector)[0] = partitioning[0]; hypre_ParVectorPartitioning(vector)[1] = partitioning[1]; hypre_ParVectorFirstIndex(vector) = hypre_ParVectorPartitioning(vector)[0]; - hypre_ParVectorLastIndex(vector) = hypre_ParVectorPartitioning(vector)[1]-1; + hypre_ParVectorLastIndex(vector) = hypre_ParVectorPartitioning(vector)[1] - 1; hypre_ParVectorLocalVector(vector) = hypre_SeqVectorCreate(local_size); /* set defaults */ @@ -111,30 +113,85 @@ hypre_ParVectorDestroy( hypre_ParVector *vector ) } /*-------------------------------------------------------------------------- - * hypre_ParVectorInitialize + * hypre_ParVectorInitializeShell *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_ParVectorInitialize_v2( hypre_ParVector *vector, HYPRE_MemoryLocation memory_location ) +hypre_ParVectorInitializeShell(hypre_ParVector *vector) { if (!vector) { hypre_error_in_arg(1); return hypre_error_flag; } - hypre_SeqVectorInitialize_v2(hypre_ParVectorLocalVector(vector), memory_location); - hypre_ParVectorActualLocalSize(vector) = hypre_VectorSize(hypre_ParVectorLocalVector(vector)); + hypre_Vector *local_vector = hypre_ParVectorLocalVector(vector); + + hypre_SeqVectorInitializeShell(local_vector); + hypre_ParVectorActualLocalSize(vector) = hypre_VectorSize(local_vector); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_ParVectorSetData + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorSetData(hypre_ParVector *vector, + HYPRE_Complex *data) +{ + hypre_SeqVectorSetData(hypre_ParVectorLocalVector(vector), data); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_ParVectorInitialize_v2 + * + * Initialize a hypre_ParVector at a given memory location + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorInitialize_v2( hypre_ParVector *vector, + HYPRE_MemoryLocation memory_location ) +{ + hypre_Vector *local_vector = hypre_ParVectorLocalVector(vector); + + hypre_ParVectorInitializeShell(vector); + hypre_SeqVectorInitialize_v2(local_vector, memory_location); return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_ParVectorInitialize + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_ParVectorInitialize( hypre_ParVector *vector ) { return hypre_ParVectorInitialize_v2(vector, hypre_ParVectorMemoryLocation(vector)); } +/*-------------------------------------------------------------------------- + * hypre_ParVectorSetComponent + * + * Set the identifier of the active component of a hypre_ParVector for the + * purpose of Set/AddTo/Get values functions. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorSetComponent( hypre_ParVector *vector, + HYPRE_Int component ) +{ + hypre_Vector *local_vector = hypre_ParVectorLocalVector(vector); + + hypre_VectorComponent(local_vector) = component; + + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- * hypre_ParVectorSetDataOwner *--------------------------------------------------------------------------*/ @@ -153,6 +210,21 @@ hypre_ParVectorSetDataOwner( hypre_ParVector *vector, return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_ParVectorSetLocalSize + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorSetLocalSize( hypre_ParVector *vector, + HYPRE_Int local_size ) +{ + hypre_Vector *local_vector = hypre_ParVectorLocalVector(vector); + + hypre_SeqVectorSetSize(local_vector, local_size); + + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- * hypre_ParVectorSetNumVectors * call before calling hypre_ParVectorInitialize @@ -163,7 +235,7 @@ HYPRE_Int hypre_ParVectorSetNumVectors( hypre_ParVector *vector, HYPRE_Int num_vectors ) { - HYPRE_Int ierr=0; + HYPRE_Int ierr = 0; hypre_Vector *local_vector = hypre_ParVectorLocalVector(v); hypre_SeqVectorSetNumVectors( local_vector, num_vectors ); @@ -172,6 +244,22 @@ hypre_ParVectorSetNumVectors( hypre_ParVector *vector, } #endif +/*-------------------------------------------------------------------------- + * hypre_ParVectorResize + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorResize( hypre_ParVector *vector, + HYPRE_Int num_vectors ) +{ + if (vector) + { + hypre_SeqVectorResize(hypre_ParVectorLocalVector(vector), num_vectors); + } + + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- * hypre_ParVectorRead *--------------------------------------------------------------------------*/ @@ -180,7 +268,7 @@ hypre_ParVector* hypre_ParVectorRead( MPI_Comm comm, const char *file_name ) { - char new_file_name[80]; + char new_file_name[256]; hypre_ParVector *par_vector; HYPRE_Int my_id; HYPRE_BigInt partitioning[2]; @@ -189,7 +277,7 @@ hypre_ParVectorRead( MPI_Comm comm, hypre_MPI_Comm_rank(comm, &my_id); - hypre_sprintf(new_file_name,"%s.INFO.%d",file_name,my_id); + hypre_sprintf(new_file_name, "%s.INFO.%d", file_name, my_id); fp = fopen(new_file_name, "r"); hypre_fscanf(fp, "%b\n", &global_size); hypre_fscanf(fp, "%b\n", &partitioning[0]); @@ -201,14 +289,14 @@ hypre_ParVectorRead( MPI_Comm comm, hypre_ParVectorGlobalSize(par_vector) = global_size; hypre_ParVectorFirstIndex(par_vector) = partitioning[0]; - hypre_ParVectorLastIndex(par_vector) = partitioning[1]-1; + hypre_ParVectorLastIndex(par_vector) = partitioning[1] - 1; hypre_ParVectorPartitioning(par_vector)[0] = partitioning[0]; hypre_ParVectorPartitioning(par_vector)[1] = partitioning[1]; hypre_ParVectorOwnsData(par_vector) = 1; - hypre_sprintf(new_file_name,"%s.%d",file_name,my_id); + hypre_sprintf(new_file_name, "%s.%d", file_name, my_id); hypre_ParVectorLocalVector(par_vector) = hypre_SeqVectorRead(new_file_name); /* multivector code not written yet */ @@ -225,7 +313,7 @@ HYPRE_Int hypre_ParVectorPrint( hypre_ParVector *vector, const char *file_name ) { - char new_file_name[80]; + char new_file_name[256]; hypre_Vector *local_vector; MPI_Comm comm; HYPRE_Int my_id; @@ -244,10 +332,10 @@ hypre_ParVectorPrint( hypre_ParVector *vector, partitioning = hypre_ParVectorPartitioning(vector); global_size = hypre_ParVectorGlobalSize(vector); - hypre_MPI_Comm_rank(comm,&my_id); - hypre_sprintf(new_file_name,"%s.%d",file_name,my_id); - hypre_SeqVectorPrint(local_vector,new_file_name); - hypre_sprintf(new_file_name,"%s.INFO.%d",file_name,my_id); + hypre_MPI_Comm_rank(comm, &my_id); + hypre_sprintf(new_file_name, "%s.%d", file_name, my_id); + hypre_SeqVectorPrint(local_vector, new_file_name); + hypre_sprintf(new_file_name, "%s.INFO.%d", file_name, my_id); fp = fopen(new_file_name, "w"); hypre_fprintf(fp, "%b\n", global_size); hypre_fprintf(fp, "%b\n", partitioning[0]); @@ -268,7 +356,19 @@ hypre_ParVectorSetConstantValues( hypre_ParVector *v, { hypre_Vector *v_local = hypre_ParVectorLocalVector(v); - return hypre_SeqVectorSetConstantValues(v_local,value); + return hypre_SeqVectorSetConstantValues(v_local, value); +} + +/*-------------------------------------------------------------------------- + * hypre_ParVectorSetZeros + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorSetZeros( hypre_ParVector *v ) +{ + hypre_ParVectorAllZeros(v) = 1; + + return hypre_ParVectorSetConstantValues(v, 0.0); } /*-------------------------------------------------------------------------- @@ -283,9 +383,9 @@ hypre_ParVectorSetRandomValues( hypre_ParVector *v, hypre_Vector *v_local = hypre_ParVectorLocalVector(v); MPI_Comm comm = hypre_ParVectorComm(v); - hypre_MPI_Comm_rank(comm,&my_id); + hypre_MPI_Comm_rank(comm, &my_id); - seed *= (my_id+1); + seed *= (my_id + 1); return hypre_SeqVectorSetRandomValues(v_local, seed); } @@ -300,12 +400,30 @@ hypre_ParVectorCopy( hypre_ParVector *x, { hypre_Vector *x_local = hypre_ParVectorLocalVector(x); hypre_Vector *y_local = hypre_ParVectorLocalVector(y); + return hypre_SeqVectorCopy(x_local, y_local); } +/*-------------------------------------------------------------------------- + * hypre_ParVectorStridedCopy + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorStridedCopy( hypre_ParVector *x, + HYPRE_Int istride, + HYPRE_Int ostride, + HYPRE_Int size, + HYPRE_Complex *data) +{ + hypre_Vector *x_local = hypre_ParVectorLocalVector(x); + + return hypre_SeqVectorStridedCopy(x_local, istride, ostride, size, data); +} + /*-------------------------------------------------------------------------- * hypre_ParVectorCloneShallow - * returns a complete copy of a hypre_ParVector x - a shallow copy, re-using + * + * Returns a complete copy of a hypre_ParVector x - a shallow copy, re-using * the partitioning and data arrays of x *--------------------------------------------------------------------------*/ @@ -326,6 +444,10 @@ hypre_ParVectorCloneShallow( hypre_ParVector *x ) return y; } +/*-------------------------------------------------------------------------- + * hypre_ParVectorCloneDeep_v2 + *--------------------------------------------------------------------------*/ + hypre_ParVector * hypre_ParVectorCloneDeep_v2( hypre_ParVector *x, HYPRE_MemoryLocation memory_location ) { @@ -342,6 +464,10 @@ hypre_ParVectorCloneDeep_v2( hypre_ParVector *x, HYPRE_MemoryLocation memory_loc return y; } +/*-------------------------------------------------------------------------- + * hypre_ParVectorMigrate + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_ParVectorMigrate(hypre_ParVector *x, HYPRE_MemoryLocation memory_location) { @@ -365,7 +491,6 @@ hypre_ParVectorMigrate(hypre_ParVector *x, HYPRE_MemoryLocation memory_location) return hypre_error_flag; } - /*-------------------------------------------------------------------------- * hypre_ParVectorScale *--------------------------------------------------------------------------*/ @@ -376,7 +501,7 @@ hypre_ParVectorScale( HYPRE_Complex alpha, { hypre_Vector *y_local = hypre_ParVectorLocalVector(y); - return hypre_SeqVectorScale( alpha, y_local); + return hypre_SeqVectorScale(alpha, y_local); } /*-------------------------------------------------------------------------- @@ -391,7 +516,25 @@ hypre_ParVectorAxpy( HYPRE_Complex alpha, hypre_Vector *x_local = hypre_ParVectorLocalVector(x); hypre_Vector *y_local = hypre_ParVectorLocalVector(y); - return hypre_SeqVectorAxpy( alpha, x_local, y_local); + return hypre_SeqVectorAxpy(alpha, x_local, y_local); +} + +/*-------------------------------------------------------------------------- + * hypre_ParVectorAxpyz + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorAxpyz( HYPRE_Complex alpha, + hypre_ParVector *x, + HYPRE_Complex beta, + hypre_ParVector *y, + hypre_ParVector *z ) +{ + hypre_Vector *x_local = hypre_ParVectorLocalVector(x); + hypre_Vector *y_local = hypre_ParVectorLocalVector(y); + hypre_Vector *z_local = hypre_ParVectorLocalVector(z); + + return hypre_SeqVectorAxpyz(alpha, x_local, beta, y_local, z_local); } /*-------------------------------------------------------------------------- @@ -423,6 +566,7 @@ hypre_ParVectorInnerProd( hypre_ParVector *x, /*-------------------------------------------------------------------------- * hypre_ParVectorElmdivpy + * * y = y + x ./ b [MATLAB Notation] *--------------------------------------------------------------------------*/ @@ -440,7 +584,8 @@ hypre_ParVectorElmdivpy( hypre_ParVector *x, /*-------------------------------------------------------------------------- * hypre_ParVectorElmdivpyMarked - * y[i] += x[i] / b[i] where marker[i] == marker_val + * + * y[i] += x[i] / b[i] where marker[i] == marker_val *--------------------------------------------------------------------------*/ HYPRE_Int @@ -458,8 +603,9 @@ hypre_ParVectorElmdivpyMarked( hypre_ParVector *x, } /*-------------------------------------------------------------------------- - * hypre_VectorToParVector: - * generates a ParVector from a Vector on proc 0 and distributes the pieces + * hypre_VectorToParVector + * + * Generates a ParVector from a Vector on proc 0 and distributes the pieces * to the other procs in comm *--------------------------------------------------------------------------*/ @@ -478,7 +624,7 @@ hypre_VectorToParVector ( MPI_Comm comm, HYPRE_Int global_vecstride, vecstride, idxstride; hypre_ParVector *par_vector; hypre_Vector *local_vector; - HYPRE_Complex *v_data; + HYPRE_Complex *v_data = NULL; HYPRE_Complex *local_data; hypre_MPI_Request *requests; hypre_MPI_Status *status, status0; @@ -495,11 +641,11 @@ hypre_VectorToParVector ( MPI_Comm comm, global_vecstride = hypre_VectorVectorStride(v); } - hypre_MPI_Bcast(&global_size,1,HYPRE_MPI_INT,0,comm); - hypre_MPI_Bcast(&num_vectors,1,HYPRE_MPI_INT,0,comm); - hypre_MPI_Bcast(&global_vecstride,1,HYPRE_MPI_INT,0,comm); + hypre_MPI_Bcast(&global_size, 1, HYPRE_MPI_BIG_INT, 0, comm); + hypre_MPI_Bcast(&num_vectors, 1, HYPRE_MPI_INT, 0, comm); + hypre_MPI_Bcast(&global_vecstride, 1, HYPRE_MPI_INT, 0, comm); - if (num_vectors == 1) + if (num_vectors == 1) { par_vector = hypre_ParVectorCreate(comm, global_size, vec_starts); } @@ -515,10 +661,10 @@ hypre_VectorToParVector ( MPI_Comm comm, if (my_id == 0) { - global_vec_starts = hypre_CTAlloc(HYPRE_BigInt, num_procs+1, HYPRE_MEMORY_HOST); + global_vec_starts = hypre_CTAlloc(HYPRE_BigInt, num_procs + 1, HYPRE_MEMORY_HOST); } hypre_MPI_Gather(&first_index, 1, HYPRE_MPI_BIG_INT, global_vec_starts, - 1, HYPRE_MPI_BIG_INT, 0, comm); + 1, HYPRE_MPI_BIG_INT, 0, comm); if (my_id == 0) { global_vec_starts[num_procs] = hypre_ParVectorGlobalSize(par_vector); @@ -530,42 +676,46 @@ hypre_VectorToParVector ( MPI_Comm comm, vecstride = hypre_VectorVectorStride(local_vector); idxstride = hypre_VectorIndexStride(local_vector); /* so far the only implemented multivector StorageMethod is 0 */ - hypre_assert( idxstride==1 ); + hypre_assert( idxstride == 1 ); if (my_id == 0) { - requests = hypre_CTAlloc(hypre_MPI_Request, num_vectors*(num_procs-1), HYPRE_MEMORY_HOST); - status = hypre_CTAlloc(hypre_MPI_Status, num_vectors*(num_procs-1), HYPRE_MEMORY_HOST); + requests = hypre_CTAlloc(hypre_MPI_Request, num_vectors * (num_procs - 1), HYPRE_MEMORY_HOST); + status = hypre_CTAlloc(hypre_MPI_Status, num_vectors * (num_procs - 1), HYPRE_MEMORY_HOST); k = 0; - for (p = 1; p 1) { - hypre_fprintf(file, "%b ", partitioning[i] + base_j); + hypre_fprintf(file, "%d %d %d %d\n", + hypre_VectorNumVectors(local_vector), + hypre_VectorMultiVecStorageMethod(local_vector), + hypre_VectorVectorStride(local_vector), + hypre_VectorIndexStride(local_vector)); } - hypre_fprintf(file, "\n"); - part0 = partitioning[0]; - for (j = part0; j < partitioning[1]; j++) + /* Write coefficients */ + if (hypre_ParVectorNumVectors(vector) > 1) { - hypre_fprintf(file, "%b %.14e\n", j + base_j, local_data[(HYPRE_Int)(j-part0)]); + /* Multi-component vectors */ + for (i = 0; i < local_size; i++) + { + hypre_fprintf(file, "%b", (HYPRE_BigInt) (i + base_j) + partitioning[0]); + for (j = 0; j < hypre_VectorNumVectors(local_vector); j++) + { + hypre_fprintf(file, " %.14e", hypre_VectorEntryIJ(local_vector, i, j)); + } + hypre_fprintf(file, "\n"); + } + } + else + { + /* Single-component (regular) vectors */ + for (j = 0; j < local_size; j++) + { + hypre_fprintf(file, "%b %.14e\n", + (HYPRE_BigInt) (j + base_j) + partitioning[0], + hypre_VectorEntryI(local_vector, j)); + } } - fclose(file); return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_ParVectorPrintBinaryIJ + * + * Prints a ParVector in binary format. The data from each process is + * printed to a separate file. Metadata info about the vector is printed in + * the header section of every file, and followed by the vector entries + * + * The header section is composed by 8 entries stored in 64 bytes (8 bytes + * each) and their meanings are: + * + * 0) Header version + * 1) Number of bytes for storing a real type (vector entries) + * 2) Global index of the first vector entry in this process + * 3) Global index of the last vector entry in this process + * 4) Number of entries of a global vector + * 5) Number of entries of a local vector + * 6) Number of components of a vector + * 7) Storage method for multi-component vectors + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorPrintBinaryIJ( hypre_ParVector *par_vector, + const char *filename ) +{ + MPI_Comm comm = hypre_ParVectorComm(par_vector); + HYPRE_BigInt global_size = hypre_ParVectorGlobalSize(par_vector); + HYPRE_BigInt *partitioning = hypre_ParVectorPartitioning(par_vector); + HYPRE_MemoryLocation memory_location = hypre_ParVectorMemoryLocation(par_vector); + + hypre_ParVector *h_parvector; + hypre_Vector *h_vector; + HYPRE_Int size; + HYPRE_Int num_components; + HYPRE_Int storage_method; + + /* Local variables */ + char new_filename[HYPRE_MAX_FILE_NAME_LEN]; + FILE *fp; + size_t count, total_size; + hypre_uint64 header[8]; + HYPRE_Int one = 1; + HYPRE_Complex *data; + HYPRE_Int myid; + + /* Exit if trying to write from big-endian machine */ + if ((*(char*)&one) == 0) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Support to big-endian machines is incomplete!\n"); + return hypre_error_flag; + } + + /* MPI variables */ + hypre_MPI_Comm_rank(comm, &myid); + + /* Create temporary vector on host memory if needed */ + h_parvector = (hypre_GetActualMemLocation(memory_location) == hypre_MEMORY_DEVICE) ? + hypre_ParVectorCloneDeep_v2(par_vector, HYPRE_MEMORY_HOST) : par_vector; + + + /* Local vector variables */ + h_vector = hypre_ParVectorLocalVector(h_parvector); + num_components = hypre_VectorNumVectors(h_vector); + storage_method = hypre_VectorMultiVecStorageMethod(h_vector); + data = hypre_VectorData(h_vector); + size = hypre_VectorSize(h_vector); + total_size = size * num_components; + + /* Open binary file */ + hypre_sprintf(new_filename, "%s.%05d.bin", filename, myid); + if ((fp = fopen(new_filename, "wb")) == NULL) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Could not open output file!"); + return hypre_error_flag; + } + + /*--------------------------------------------- + * Write header (64 bytes) + *---------------------------------------------*/ + + count = 8; + header[0] = (hypre_uint64) 1; /* Header version */ + header[1] = (hypre_uint64) sizeof(HYPRE_Complex); + header[2] = (hypre_uint64) partitioning[0]; + header[3] = (hypre_uint64) partitioning[1]; + header[4] = (hypre_uint64) global_size; + header[5] = (hypre_uint64) size; + header[6] = (hypre_uint64) num_components; + header[7] = (hypre_uint64) storage_method; + if (fwrite((const void*) header, sizeof(hypre_uint64), count, fp) != count) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Could not write all header entries\n"); + return hypre_error_flag; + } + + /*--------------------------------------------- + * Write vector coefficients + *---------------------------------------------*/ + + count = fwrite((const void*) data, sizeof(HYPRE_Complex), total_size, fp); + if (count != total_size) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Could not write all entries\n"); + return hypre_error_flag; + } + + /*--------------------------------------------- + * Finalize + *---------------------------------------------*/ + + fclose(fp); + if (h_parvector != par_vector) + { + hypre_ParVectorDestroy(h_parvector); + } + + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- * hypre_ParVectorReadIJ * Warning: wrong base for assumed partition if base > 0 @@ -893,44 +1210,40 @@ hypre_ParVectorReadIJ( MPI_Comm comm, hypre_ParVector *vector; hypre_Vector *local_vector; HYPRE_Complex *local_data; - HYPRE_BigInt *partitioning; + HYPRE_BigInt big_local_size; + HYPRE_BigInt partitioning[2] = {0, 0}; HYPRE_Int base_j; - HYPRE_Int myid, num_procs, i, j; - char new_filename[255]; + HYPRE_Int myid, num_procs, j; + char new_filename[HYPRE_MAX_FILE_NAME_LEN]; FILE *file; hypre_MPI_Comm_size(comm, &num_procs); hypre_MPI_Comm_rank(comm, &myid); - hypre_sprintf(new_filename,"%s.%05d", filename, myid); + hypre_sprintf(new_filename, "%s.%05d", filename, myid); if ((file = fopen(new_filename, "r")) == NULL) { - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Error: can't open output file %s\n"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Error: can't open output file %s\n"); return hypre_error_flag; } - hypre_fscanf(file, "%b", &global_size); /* this may need to be changed so that the base is available in the file! */ - partitioning = hypre_CTAlloc(HYPRE_BigInt, 2, HYPRE_MEMORY_HOST); + hypre_fscanf(file, "%b %b", partitioning[0], partitioning[1]); + big_local_size = partitioning[1] - partitioning[0] + 1; + hypre_MPI_Allreduce(&big_local_size, &global_size, 1, HYPRE_MPI_BIG_INT, + hypre_MPI_SUM, comm); - hypre_fscanf(file, "%b", partitioning); - for (i = 0; i < 2; i++) - { - hypre_fscanf(file, "%b", partitioning+i); - } /* This is not yet implemented correctly! */ base_j = 0; - vector = hypre_ParVectorCreate(comm, global_size, - partitioning); - - hypre_ParVectorInitialize(vector); + vector = hypre_ParVectorCreate(comm, global_size, partitioning); + hypre_ParVectorInitialize_v2(vector, HYPRE_MEMORY_HOST); local_vector = hypre_ParVectorLocalVector(vector); local_data = hypre_VectorData(local_vector); - for (j = 0; j < (HYPRE_Int)(partitioning[1] - partitioning[0]); j++) + for (j = 0; j < (HYPRE_Int) big_local_size; j++) { hypre_fscanf(file, "%b %le", &J, local_data + j); } @@ -942,7 +1255,7 @@ hypre_ParVectorReadIJ( MPI_Comm comm, /* multivector code not written yet */ hypre_assert( hypre_ParVectorNumVectors(vector) == 1 ); - if ( hypre_ParVectorNumVectors(vector) != 1 ) hypre_error(HYPRE_ERROR_GENERIC); + if ( hypre_ParVectorNumVectors(vector) != 1 ) { hypre_error(HYPRE_ERROR_GENERIC); } return hypre_error_flag; } @@ -962,6 +1275,8 @@ hypre_FillResponseParToVectorAll( void *p_recv_contact_buf, void **p_send_response_buf, HYPRE_Int *response_message_size ) { + HYPRE_UNUSED_VAR(p_send_response_buf); + HYPRE_Int myid; HYPRE_Int i, index, count, elength; @@ -975,7 +1290,7 @@ hypre_FillResponseParToVectorAll( void *p_recv_contact_buf, /*check to see if we need to allocate more space in send_proc_obj for ids*/ if (send_proc_obj->length == send_proc_obj->storage_length) { - send_proc_obj->storage_length +=10; /*add space for 10 more processors*/ + send_proc_obj->storage_length += 10; /*add space for 10 more processors*/ send_proc_obj->id = hypre_TReAlloc(send_proc_obj->id, HYPRE_Int, send_proc_obj->storage_length, HYPRE_MEMORY_HOST); send_proc_obj->vec_starts = @@ -1000,11 +1315,11 @@ hypre_FillResponseParToVectorAll( void *p_recv_contact_buf, send_proc_obj->element_storage_length = elength; } /*populate send_proc_obj*/ - for (i=0; i< contact_size; i++) + for (i = 0; i < contact_size; i++) { send_proc_obj->elements[index++] = recv_contact_buf[i]; } - send_proc_obj->vec_starts[count+1] = index; + send_proc_obj->vec_starts[count + 1] = index; send_proc_obj->length++; /*output - no message to return (confirmation) */ @@ -1013,15 +1328,22 @@ hypre_FillResponseParToVectorAll( void *p_recv_contact_buf, return hypre_error_flag; } -/* ----------------------------------------------------------------------------- - * return the sum of all local elements of the vector - * ----------------------------------------------------------------------------- */ +/*-------------------------------------------------------------------- + * hypre_ParVectorLocalSumElts + * + * Return the sum of all local elements of the vector + *--------------------------------------------------------------------*/ -HYPRE_Complex hypre_ParVectorLocalSumElts( hypre_ParVector * vector ) +HYPRE_Complex +hypre_ParVectorLocalSumElts( hypre_ParVector *vector ) { return hypre_SeqVectorSumElts( hypre_ParVectorLocalVector(vector) ); } +/*-------------------------------------------------------------------- + * hypre_ParVectorGetValuesHost + *--------------------------------------------------------------------*/ + HYPRE_Int hypre_ParVectorGetValuesHost(hypre_ParVector *vector, HYPRE_Int num_values, @@ -1029,43 +1351,41 @@ hypre_ParVectorGetValuesHost(hypre_ParVector *vector, HYPRE_BigInt base, HYPRE_Complex *values) { - HYPRE_Int i, ierr = 0; - HYPRE_BigInt first_index = hypre_ParVectorFirstIndex(vector); - HYPRE_BigInt last_index = hypre_ParVectorLastIndex(vector); - hypre_Vector *local_vector = hypre_ParVectorLocalVector(vector); - HYPRE_Complex *data = hypre_VectorData(local_vector); + HYPRE_BigInt first_index = hypre_ParVectorFirstIndex(vector); + HYPRE_BigInt last_index = hypre_ParVectorLastIndex(vector); + hypre_Vector *local_vector = hypre_ParVectorLocalVector(vector); - /* - if (hypre_VectorOwnsData(local_vector) == 0) - { - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Vector does not own data! -- hypre_ParVectorGetValues."); - return hypre_error_flag; - } - */ + HYPRE_Int component = hypre_VectorComponent(local_vector); + HYPRE_Int vecstride = hypre_VectorVectorStride(local_vector); + HYPRE_Int idxstride = hypre_VectorIndexStride(local_vector); + HYPRE_Complex *data = hypre_VectorData(local_vector); + HYPRE_Int vecoffset = component * vecstride; + + HYPRE_Int i, ierr = 0; if (indices) { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) reduction(+:ierr) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) reduction(+:ierr) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < num_values; i++) { HYPRE_BigInt index = indices[i] - base; if (index < first_index || index > last_index) { - ierr ++; + ierr++; } else { HYPRE_Int local_index = (HYPRE_Int) (index - first_index); - values[i] = data[local_index]; + values[i] = data[vecoffset + local_index * idxstride]; } } if (ierr) { hypre_error_in_arg(3); - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Index out of range! -- hypre_ParVectorGetValues."); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Index out of range! -- hypre_ParVectorGetValues."); hypre_printf("Index out of range! -- hypre_ParVectorGetValues\n"); } } @@ -1078,17 +1398,21 @@ hypre_ParVectorGetValuesHost(hypre_ParVector *vector, } #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < num_values; i++) { - values[i] = data[i]; + values[i] = data[vecoffset + i * idxstride]; } } return hypre_error_flag; } +/*-------------------------------------------------------------------- + * hypre_ParVectorGetValues2 + *--------------------------------------------------------------------*/ + HYPRE_Int hypre_ParVectorGetValues2(hypre_ParVector *vector, HYPRE_Int num_values, @@ -1096,7 +1420,7 @@ hypre_ParVectorGetValues2(hypre_ParVector *vector, HYPRE_BigInt base, HYPRE_Complex *values) { -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) if (HYPRE_EXEC_DEVICE == hypre_GetExecPolicy1( hypre_ParVectorMemoryLocation(vector) )) { hypre_ParVectorGetValuesDevice(vector, num_values, indices, base, values); @@ -1110,6 +1434,10 @@ hypre_ParVectorGetValues2(hypre_ParVector *vector, return hypre_error_flag; } +/*-------------------------------------------------------------------- + * hypre_ParVectorGetValues + *--------------------------------------------------------------------*/ + HYPRE_Int hypre_ParVectorGetValues(hypre_ParVector *vector, HYPRE_Int num_values, diff --git a/external/hypre/src/parcsr_mv/par_vector.h b/external/hypre/src/parcsr_mv/par_vector.h index d483a953..cc2316b8 100644 --- a/external/hypre/src/parcsr_mv/par_vector.h +++ b/external/hypre/src/parcsr_mv/par_vector.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -37,6 +37,8 @@ typedef struct hypre_ParVector_struct /* Does the Vector create/destroy `data'? */ HYPRE_Int owns_data; + /* If the vector is all zeros */ + HYPRE_Int all_zeros; hypre_IJAssumedPart *assumed_partition; /* only populated if this partition needed (for setting off-proc elements, for example)*/ @@ -52,13 +54,19 @@ typedef struct hypre_ParVector_struct #define hypre_ParVectorLastIndex(vector) ((vector) -> last_index) #define hypre_ParVectorPartitioning(vector) ((vector) -> partitioning) #define hypre_ParVectorActualLocalSize(vector) ((vector) -> actual_local_size) -#define hypre_ParVectorLocalVector(vector) ((vector) -> local_vector) #define hypre_ParVectorOwnsData(vector) ((vector) -> owns_data) -#define hypre_ParVectorNumVectors(vector) (hypre_VectorNumVectors(hypre_ParVectorLocalVector(vector))) +#define hypre_ParVectorAllZeros(vector) ((vector) -> all_zeros) +#define hypre_ParVectorLocalVector(vector) ((vector) -> local_vector) +#define hypre_ParVectorLocalSize(vector) ((vector) -> local_vector -> size) +#define hypre_ParVectorLocalData(vector) ((vector) -> local_vector -> data) +#define hypre_ParVectorLocalStorage(vector) ((vector) -> local_vector -> multivec_storage_method) +#define hypre_ParVectorNumVectors(vector) ((vector) -> local_vector -> num_vectors) +#define hypre_ParVectorEntryI(vector, i) (hypre_VectorEntryI((vector) -> local_vector, i)) +#define hypre_ParVectorEntryIJ(vector, i, j) (hypre_VectorEntryIJ((vector) -> local_vector, i, j)) #define hypre_ParVectorAssumedPartition(vector) ((vector) -> assumed_partition) -static inline HYPRE_MemoryLocation +static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_MemoryLocation hypre_ParVectorMemoryLocation(hypre_ParVector *vector) { return hypre_VectorMemoryLocation(hypre_ParVectorLocalVector(vector)); diff --git a/external/hypre/src/parcsr_mv/par_vector_batched.c b/external/hypre/src/parcsr_mv/par_vector_batched.c index cf0a6e42..18dc8f80 100644 --- a/external/hypre/src/parcsr_mv/par_vector_batched.c +++ b/external/hypre/src/parcsr_mv/par_vector_batched.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -29,7 +29,7 @@ hypre_ParVectorMassAxpy( HYPRE_Complex *alpha, hypre_Vector *y_local = hypre_ParVectorLocalVector(y); x_local = hypre_TAlloc(hypre_Vector *, k, HYPRE_MEMORY_HOST); - for (i=0; i < k; i++) + for (i = 0; i < k; i++) { x_local[i] = hypre_ParVectorLocalVector(x[i]); } @@ -59,7 +59,7 @@ hypre_ParVectorMassInnerProd( hypre_ParVector *x, hypre_Vector **y_local; y_local = hypre_TAlloc(hypre_Vector *, k, HYPRE_MEMORY_HOST); - for (i=0; i < k; i++) + for (i = 0; i < k; i++) { y_local[i] = (hypre_Vector *) hypre_ParVectorLocalVector(y[i]); } @@ -104,29 +104,30 @@ hypre_ParVectorMassDotpTwo ( hypre_ParVector *x, hypre_Vector **z_local; z_local = hypre_TAlloc(hypre_Vector*, k, HYPRE_MEMORY_HOST); - for (i=0; i < k; i++) + for (i = 0; i < k; i++) { z_local[i] = (hypre_Vector *) hypre_ParVectorLocalVector(z[i]); } - local_result = hypre_CTAlloc(HYPRE_Real, 2*k, HYPRE_MEMORY_HOST); - result = hypre_CTAlloc(HYPRE_Real, 2*k, HYPRE_MEMORY_HOST); + local_result = hypre_CTAlloc(HYPRE_Real, 2 * k, HYPRE_MEMORY_HOST); + result = hypre_CTAlloc(HYPRE_Real, 2 * k, HYPRE_MEMORY_HOST); - hypre_SeqVectorMassDotpTwo(x_local, y_local, z_local, k, unroll, &local_result[0], &local_result[k]); + hypre_SeqVectorMassDotpTwo(x_local, y_local, z_local, k, unroll, &local_result[0], + &local_result[k]); #ifdef HYPRE_PROFILE hypre_profile_times[HYPRE_TIMER_ID_ALL_REDUCE] -= hypre_MPI_Wtime(); #endif - hypre_MPI_Allreduce(local_result, result, 2*k, HYPRE_MPI_REAL, + hypre_MPI_Allreduce(local_result, result, 2 * k, HYPRE_MPI_REAL, hypre_MPI_SUM, comm); #ifdef HYPRE_PROFILE hypre_profile_times[HYPRE_TIMER_ID_ALL_REDUCE] += hypre_MPI_Wtime(); #endif - for (i=0; i < k; i++) + for (i = 0; i < k; i++) { result_x[i] = result[i]; - result_y[i] = result[k+i]; + result_y[i] = result[k + i]; } hypre_TFree(z_local, HYPRE_MEMORY_HOST); hypre_TFree(local_result, HYPRE_MEMORY_HOST); diff --git a/external/hypre/src/parcsr_mv/par_vector_device.c b/external/hypre/src/parcsr_mv/par_vector_device.c index e1b998ee..edd452bc 100644 --- a/external/hypre/src/parcsr_mv/par_vector_device.c +++ b/external/hypre/src/parcsr_mv/par_vector_device.c @@ -1,13 +1,14 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ +#include "_hypre_onedpl.hpp" #include "_hypre_parcsr_mv.h" #include "_hypre_utilities.hpp" -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) HYPRE_Int hypre_ParVectorGetValuesDevice(hypre_ParVector *vector, @@ -16,31 +17,70 @@ hypre_ParVectorGetValuesDevice(hypre_ParVector *vector, HYPRE_BigInt base, HYPRE_Complex *values) { - HYPRE_Int ierr = 0; - HYPRE_BigInt first_index = hypre_ParVectorFirstIndex(vector); - HYPRE_BigInt last_index = hypre_ParVectorLastIndex(vector); - hypre_Vector *local_vector = hypre_ParVectorLocalVector(vector); - HYPRE_Complex *data = hypre_VectorData(local_vector); + HYPRE_BigInt first_index = hypre_ParVectorFirstIndex(vector); + HYPRE_BigInt last_index = hypre_ParVectorLastIndex(vector); + hypre_Vector *local_vector = hypre_ParVectorLocalVector(vector); + + HYPRE_Int component = hypre_VectorComponent(local_vector); + HYPRE_Int vecstride = hypre_VectorVectorStride(local_vector); + HYPRE_Int idxstride = hypre_VectorIndexStride(local_vector); + HYPRE_Complex *data = hypre_VectorData(local_vector); + HYPRE_Int vecoffset = component * vecstride; + + HYPRE_Int ierr = 0; + + if (idxstride != 1) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "hypre_ParVectorGetValuesDevice not implemented for non-columnwise vector storage\n"); + return hypre_error_flag; + } /* If indices == NULL, assume that num_values components are to be retrieved from block starting at vec_start */ if (indices) { +#if defined(HYPRE_USING_SYCL) + ierr = HYPRE_ONEDPL_CALL( std::count_if, + indices, + indices + num_values, + out_of_range(first_index + base, last_index + base) ); +#else ierr = HYPRE_THRUST_CALL( count_if, indices, indices + num_values, out_of_range(first_index + base, last_index + base) ); +#endif if (ierr) { hypre_error_in_arg(3); - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Index out of range! -- hypre_ParVectorGetValues."); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Index out of range! -- hypre_ParVectorGetValues."); hypre_printf(" error: %d indices out of range! -- hypre_ParVectorGetValues\n", ierr); +#if defined(HYPRE_USING_SYCL) + auto trans_it = oneapi::dpl::make_transform_iterator(indices, [base, + first_index] (const auto & x) {return x - base - first_index;} ); + hypreSycl_gather_if( trans_it, + trans_it + num_values, + indices, + data + vecoffset, + values, + in_range(first_index + base, last_index + base) ); + } + else + { + auto trans_it = oneapi::dpl::make_transform_iterator(indices, [base, + first_index] (const auto & x) {return x - base - first_index;} ); + hypreSycl_gather( trans_it, + trans_it + num_values, + data + vecoffset, + values); +#else HYPRE_THRUST_CALL( gather_if, thrust::make_transform_iterator(indices, _1 - base - first_index), thrust::make_transform_iterator(indices, _1 - base - first_index) + num_values, indices, - data, + data + vecoffset, values, in_range(first_index + base, last_index + base) ); } @@ -49,8 +89,9 @@ hypre_ParVectorGetValuesDevice(hypre_ParVector *vector, HYPRE_THRUST_CALL( gather, thrust::make_transform_iterator(indices, _1 - base - first_index), thrust::make_transform_iterator(indices, _1 - base - first_index) + num_values, - data, + data + vecoffset, values); +#endif } } else @@ -61,10 +102,11 @@ hypre_ParVectorGetValuesDevice(hypre_ParVector *vector, return hypre_error_flag; } - hypre_TMemcpy(values, data, HYPRE_Complex, num_values, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(values, data + vecoffset, HYPRE_Complex, num_values, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); } return hypre_error_flag; } -#endif // #if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#endif // #if defined(HYPRE_USING_GPU) diff --git a/external/hypre/src/parcsr_mv/parchord_to_parcsr.c b/external/hypre/src/parcsr_mv/parchord_to_parcsr.c index af08590b..ea023755 100644 --- a/external/hypre/src/parcsr_mv/parchord_to_parcsr.c +++ b/external/hypre/src/parcsr_mv/parchord_to_parcsr.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -22,37 +22,37 @@ void hypre_ParChordMatrix_RowStarts( hypre_ParChordMatrix *Ac, MPI_Comm comm, HYPRE_BigInt ** row_starts, HYPRE_BigInt * global_num_cols ) - /* This function computes the ParCSRMatrix-style row_starts from a chord matrix. - It requires the the idofs of the chord matrix be partitioned among - processors, so their numbering is monotonic with the processor number; - see below. - - The algorithm: each proc. p knows its min & max global row & col numbers. - Mins are first_index_rdof[p], first_index_idof[p] - ***IF*** these were in proper order (see below), - first_index_rdof[p] is row_starts[p]. - Add num_rdofs-1 to get the max, i.e. add num_rdofs - to get row_starts[p+1] (IF the processors are ordered thus). - Compute these, then broadcast to the other processors to form - row_starts. - (We also could get global_num_rows by an AllReduce num_idofs.) - We get global_num_cols by taking the min and max over processors of - the min and max col no.s on each processor. - - If the chord matrix is not ordered so the above will work, then we - would need to to completely move matrices around sometimes, a very expensive - operation. - The problem is that the chord matrix format makes no assumptions about - processor order, but the ParCSR format assumes that - p (local row numbers of p) < (local row numbers of q) - Maybe instead I could change the global numbering scheme as part of this - conversion. - A closely related ordering-type problem to watch for: row_starts must be - a partition for a ParCSRMatrix. In a ChordMatrix, the struct itself - makes no guarantees, but Panayot said, in essence, that row_starts will - be a partition. - col_starts should be NULL; later we shall let the Create function compute one. - */ +/* This function computes the ParCSRMatrix-style row_starts from a chord matrix. + It requires the the idofs of the chord matrix be partitioned among + processors, so their numbering is monotonic with the processor number; + see below. + + The algorithm: each proc. p knows its min & max global row & col numbers. + Mins are first_index_rdof[p], first_index_idof[p] + ***IF*** these were in proper order (see below), + first_index_rdof[p] is row_starts[p]. + Add num_rdofs-1 to get the max, i.e. add num_rdofs + to get row_starts[p+1] (IF the processors are ordered thus). + Compute these, then broadcast to the other processors to form + row_starts. + (We also could get global_num_rows by an AllReduce num_idofs.) + We get global_num_cols by taking the min and max over processors of + the min and max col no.s on each processor. + + If the chord matrix is not ordered so the above will work, then we + would need to to completely move matrices around sometimes, a very expensive + operation. + The problem is that the chord matrix format makes no assumptions about + processor order, but the ParCSR format assumes that + p (local row numbers of p) < (local row numbers of q) + Maybe instead I could change the global numbering scheme as part of this + conversion. + A closely related ordering-type problem to watch for: row_starts must be + a partition for a ParCSRMatrix. In a ChordMatrix, the struct itself + makes no guarantees, but Panayot said, in essence, that row_starts will + be a partition. + col_starts should be NULL; later we shall let the Create function compute one. +*/ { HYPRE_BigInt * fis_idof = hypre_ParChordMatrixFirstindexIdof(Ac); HYPRE_BigInt * fis_rdof = hypre_ParChordMatrixFirstindexRdof(Ac); @@ -66,8 +66,8 @@ void hypre_ParChordMatrix_RowStarts( hypre_MPI_Comm_rank(comm, &my_id); hypre_MPI_Comm_size(comm, &num_procs); - request = hypre_CTAlloc(hypre_MPI_Request, 1 , HYPRE_MEMORY_HOST); - status = hypre_CTAlloc(hypre_MPI_Status, 1 , HYPRE_MEMORY_HOST); + request = hypre_CTAlloc(hypre_MPI_Request, 1, HYPRE_MEMORY_HOST); + status = hypre_CTAlloc(hypre_MPI_Status, 1, HYPRE_MEMORY_HOST); min_rdof = fis_rdof[my_id]; max_rdof = min_rdof + num_rdofs; @@ -75,32 +75,41 @@ void hypre_ParChordMatrix_RowStarts( lens[1] = num_rdofs; /* row_starts (except last value */ - *row_starts = hypre_CTAlloc( HYPRE_BigInt, num_procs+1 , HYPRE_MEMORY_HOST); - for ( p=0; p0 ) - hypre_MPI_Recv( lastlens, 2, HYPRE_MPI_INT, my_id-1, 0, comm, status ); - if ( my_id0 ) - hypre_assert( (*row_starts)[my_id] == (*row_starts)[my_id-1] + (HYPRE_BigInt)lastlens[0] ); - hypre_TFree( request , HYPRE_MEMORY_HOST); - hypre_TFree( status , HYPRE_MEMORY_HOST); + if ( my_id < num_procs - 1 ) + { + hypre_MPI_Isend( lens, 2, HYPRE_MPI_INT, my_id + 1, 0, comm, request ); + } + if ( my_id > 0 ) + { + hypre_MPI_Recv( lastlens, 2, HYPRE_MPI_INT, my_id - 1, 0, comm, status ); + } + if ( my_id < num_procs - 1 ) + { + hypre_MPI_Waitall( 1, request, status); + } + if ( my_id > 0 ) + { + hypre_assert( (*row_starts)[my_id] == (*row_starts)[my_id - 1] + (HYPRE_BigInt)lastlens[0] ); + } + hypre_TFree( request, HYPRE_MEMORY_HOST); + hypre_TFree( status, HYPRE_MEMORY_HOST); /* Get the upper bound for all the rows */ - hypre_MPI_Bcast( lens, 2, HYPRE_MPI_INT, num_procs-1, comm ); - (*row_starts)[num_procs] = (*row_starts)[num_procs-1] + (HYPRE_Int)lens[0]; + hypre_MPI_Bcast( lens, 2, HYPRE_MPI_INT, num_procs - 1, comm ); + (*row_starts)[num_procs] = (*row_starts)[num_procs - 1] + (HYPRE_Int)lens[0]; /* Global number of columns */ -/* hypre_MPI_Allreduce( &num_rdofs, global_num_cols, 1, HYPRE_MPI_INT, hypre_MPI_SUM, comm );*/ - hypre_MPI_Allreduce( &min_rdof, &global_min_rdof, 1, HYPRE_MPI_INT, hypre_MPI_MIN, comm ); - hypre_MPI_Allreduce( &max_rdof, &global_max_rdof, 1, HYPRE_MPI_INT, hypre_MPI_MAX, comm ); + /* hypre_MPI_Allreduce( &num_rdofs, global_num_cols, 1, HYPRE_MPI_INT, hypre_MPI_SUM, comm );*/ + hypre_MPI_Allreduce( &min_rdof, &global_min_rdof, 1, HYPRE_MPI_BIG_INT, hypre_MPI_MIN, comm ); + hypre_MPI_Allreduce( &max_rdof, &global_max_rdof, 1, HYPRE_MPI_BIG_INT, hypre_MPI_MAX, comm ); *global_num_cols = global_max_rdof - global_min_rdof; } @@ -118,10 +127,10 @@ hypre_ParChordMatrixToParCSRMatrix( HYPRE_Int my_id, num_procs; HYPRE_Int num_cols_offd, num_nonzeros_diag, num_nonzeros_offd; HYPRE_Int *local_num_rows; -/* not computed HYPRE_Int *local_num_nonzeros; */ + /* not computed HYPRE_Int *local_num_nonzeros; */ HYPRE_Int num_nonzeros; HYPRE_BigInt first_col_diag, last_col_diag; - HYPRE_Int i,ic,ij,ir,ilocal,p,r,r_p,r_global,r_local, jlen; + HYPRE_Int i, ic, ij, ir, ilocal, p, r, r_p, r_global, r_local, jlen; HYPRE_Int *a_i, *a_j, *ilen; HYPRE_Int **rdofs, **ps; HYPRE_Complex data; @@ -133,7 +142,7 @@ hypre_ParChordMatrixToParCSRMatrix( hypre_MPI_Comm_size(comm, &num_procs); hypre_ParChordMatrix_RowStarts - ( Ac, comm, &row_starts, &global_num_cols ); + ( Ac, comm, &row_starts, &global_num_cols ); /* ... this function works correctly only under some assumptions; see the function definition for details */ global_num_rows = row_starts[num_procs] - row_starts[0]; @@ -146,19 +155,22 @@ hypre_ParChordMatrixToParCSRMatrix( num_nonzeros_offd = 0; Ap = hypre_ParCSRMatrixCreate( comm, global_num_rows, global_num_cols, - row_starts, col_starts, - num_cols_offd, num_nonzeros_diag, num_nonzeros_offd); + row_starts, col_starts, + num_cols_offd, num_nonzeros_diag, num_nonzeros_offd); *pAp = Ap; row_starts = hypre_ParCSRMatrixRowStarts(Ap); col_starts = hypre_ParCSRMatrixColStarts(Ap); local_num_rows = hypre_CTAlloc(HYPRE_Int, num_procs, HYPRE_MEMORY_HOST); - for (i=0; i < num_procs; i++) - local_num_rows[i] = (HYPRE_Int)(row_starts[i+1] - row_starts[i]); + for (i = 0; i < num_procs; i++) + { + local_num_rows[i] = (HYPRE_Int)(row_starts[i + 1] - row_starts[i]); + } num_nonzeros = 0; - for ( p=0; p= row_starts[p] && j_global= row_starts[p] && j_global < row_starts[p + 1] ) + { + pcr[p] = 1; + /* not used yet... pj[jj] = p;*/ break; } } @@ -321,13 +342,16 @@ hypre_ParCSRMatrixToParChordMatrix( /* pcr[my_id] = 1; ...for square matrices (with nonzero diag block) this one line would do the job of the following nested loop. For non-square matrices, the data distribution is too arbitrary. */ - for ( jj=0; jj= row_starts[p] && j_global= row_starts[p] && j_global < row_starts[p + 1] ) + { + pcr[p] = 1; + /* not used yet... pj[jj+jjd] = p;*/ break; } } @@ -340,21 +364,21 @@ hypre_ParCSRMatrixToParChordMatrix( The array of such q's is the array Inprocessor. */ num_inprocessors = 0; - for ( q=0; q 0 && hypre_CSRMatrixNumCols(offd) > 0 ) first_index_rdof[my_id] = - col_starts[my_id]=0 ); + for ( q = 0; q < num_inprocessors; ++q ) if ( inprocessor[q] == my_id ) { my_q = q; } + hypre_assert( my_q >= 0 ); /* diag block: first count chords (from my_id to my_id), then set them from diag block's CSR data structure */ num_idofs = hypre_CSRMatrixNumRows(diag); rdofs = hypre_NumbersNewNode(); - for ( row=0; row=col_starts[p] && - row_global< col_starts[p+1] ) { - /* row is one of the diag columns of p */ - ++num_inchords[q]; - inproc[i] = q; - break; + for ( q = 0; q < num_inprocessors; ++q ) if (q != my_q) + { + p = inprocessor[q]; + row_global = row + hypre_ParCSRMatrixFirstRowIndex(Ap); + if ( row_global >= col_starts[p] && + row_global < col_starts[p + 1] ) + { + /* row is one of the diag columns of p */ + ++num_inchords[q]; + inproc[i] = q; + break; + } } - } } - hypre_assert( inproc[i]>=0 ); + hypre_assert( inproc[i] >= 0 ); /* Find the processor pto (local index qto) from the toprocessor list, which owns the row(idof) which is the same as this processor's column(rdof) j_global. Update num_rdofs_toprocessor for pto. Save pto as toproc[i] for quick recall later. It represents the toprocessor connected to a chord i. */ - for ( qto=0; qto= row_starts[pto] && j_global= row_starts[pto] && j_global < row_starts[pto + 1] ) + { hypre_assert( qto < len_num_rdofs_toprocessor ); ++num_rdofs_toprocessor[qto]; /* ... an overestimate, as if two chords share an rdof, that @@ -557,31 +605,37 @@ hypre_ParCSRMatrixToParChordMatrix( num_rdofs += hypre_NumbersNEntered(rdofs); hypre_NumbersDeleteNode(rdofs); - for ( q=0; q=0 ) { + if ( qto >= 0 ) + { /* There is an rdof processor for this chord */ rdof_toprocessor[qto][chordto[qto]] = j; ++chordto[qto]; @@ -603,22 +658,27 @@ hypre_ParCSRMatrixToParChordMatrix( /* fix up overestimate of num_rdofs_toprocessor. We're not going to bother to fix the excessive size which has been allocated to rdof_toprocessor... */ - for ( qto=0; qto>> to set... + /* >>> to set... - hypre_ParChordMatrixNumIdofsInprocessor(Ac) (low priority - not used); - hypre_ParChordMatrixIdofInprocessor(Ac) (low priority - not used); -*/ + hypre_ParChordMatrixNumIdofsInprocessor(Ac) (low priority - not used); + hypre_ParChordMatrixIdofInprocessor(Ac) (low priority - not used); + */ return 0; - } +} diff --git a/external/hypre/src/parcsr_mv/protos.h b/external/hypre/src/parcsr_mv/protos.h index 28efef93..12749756 100644 --- a/external/hypre/src/parcsr_mv/protos.h +++ b/external/hypre/src/parcsr_mv/protos.h @@ -1,14 +1,23 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ /* communicationT.c */ -void hypre_RowsWithColumn_original ( HYPRE_Int *rowmin , HYPRE_Int *rowmax , HYPRE_BigInt column , hypre_ParCSRMatrix *A ); -void hypre_RowsWithColumn ( HYPRE_Int *rowmin , HYPRE_Int *rowmax , HYPRE_BigInt column , HYPRE_Int num_rows_diag , HYPRE_BigInt firstColDiag , HYPRE_BigInt *colMapOffd , HYPRE_Int *mat_i_diag , HYPRE_Int *mat_j_diag , HYPRE_Int *mat_i_offd , HYPRE_Int *mat_j_offd ); -void hypre_MatTCommPkgCreate_core ( MPI_Comm comm , HYPRE_BigInt *col_map_offd , HYPRE_BigInt first_col_diag , HYPRE_BigInt *col_starts , HYPRE_Int num_rows_diag , HYPRE_Int num_cols_diag , HYPRE_Int num_cols_offd , HYPRE_BigInt *row_starts , HYPRE_BigInt firstColDiag , HYPRE_BigInt *colMapOffd , HYPRE_Int *mat_i_diag , HYPRE_Int *mat_j_diag , HYPRE_Int *mat_i_offd , HYPRE_Int *mat_j_offd , HYPRE_Int data , HYPRE_Int *p_num_recvs , HYPRE_Int **p_recv_procs , HYPRE_Int **p_recv_vec_starts , HYPRE_Int *p_num_sends , HYPRE_Int **p_send_procs , HYPRE_Int **p_send_map_starts , HYPRE_Int **p_send_map_elmts ); +void hypre_RowsWithColumn_original ( HYPRE_Int *rowmin, HYPRE_Int *rowmax, HYPRE_BigInt column, + hypre_ParCSRMatrix *A ); +void hypre_RowsWithColumn ( HYPRE_Int *rowmin, HYPRE_Int *rowmax, HYPRE_BigInt column, + HYPRE_Int num_rows_diag, HYPRE_BigInt firstColDiag, HYPRE_BigInt *colMapOffd, HYPRE_Int *mat_i_diag, + HYPRE_Int *mat_j_diag, HYPRE_Int *mat_i_offd, HYPRE_Int *mat_j_offd ); +void hypre_MatTCommPkgCreate_core ( MPI_Comm comm, HYPRE_BigInt *col_map_offd, + HYPRE_BigInt first_col_diag, HYPRE_BigInt *col_starts, HYPRE_Int num_rows_diag, + HYPRE_Int num_cols_diag, HYPRE_Int num_cols_offd, HYPRE_BigInt *row_starts, + HYPRE_BigInt firstColDiag, HYPRE_BigInt *colMapOffd, HYPRE_Int *mat_i_diag, HYPRE_Int *mat_j_diag, + HYPRE_Int *mat_i_offd, HYPRE_Int *mat_j_offd, HYPRE_Int data, HYPRE_Int *p_num_recvs, + HYPRE_Int **p_recv_procs, HYPRE_Int **p_recv_vec_starts, HYPRE_Int *p_num_sends, + HYPRE_Int **p_send_procs, HYPRE_Int **p_send_map_starts, HYPRE_Int **p_send_map_elmts ); HYPRE_Int hypre_MatTCommPkgCreate ( hypre_ParCSRMatrix *A ); /* driver_aat.c */ @@ -28,290 +37,623 @@ HYPRE_Int hypre_MatTCommPkgCreate ( hypre_ParCSRMatrix *A ); /* driver_multivec.c */ /* HYPRE_parcsr_matrix.c */ -HYPRE_Int HYPRE_ParCSRMatrixCreate ( MPI_Comm comm , HYPRE_BigInt global_num_rows , HYPRE_BigInt global_num_cols , HYPRE_BigInt *row_starts , HYPRE_BigInt *col_starts , HYPRE_Int num_cols_offd , HYPRE_Int num_nonzeros_diag , HYPRE_Int num_nonzeros_offd , HYPRE_ParCSRMatrix *matrix ); +HYPRE_Int HYPRE_ParCSRMatrixCreate ( MPI_Comm comm, HYPRE_BigInt global_num_rows, + HYPRE_BigInt global_num_cols, HYPRE_BigInt *row_starts, HYPRE_BigInt *col_starts, + HYPRE_Int num_cols_offd, HYPRE_Int num_nonzeros_diag, HYPRE_Int num_nonzeros_offd, + HYPRE_ParCSRMatrix *matrix ); HYPRE_Int HYPRE_ParCSRMatrixDestroy ( HYPRE_ParCSRMatrix matrix ); HYPRE_Int HYPRE_ParCSRMatrixInitialize ( HYPRE_ParCSRMatrix matrix ); HYPRE_Int HYPRE_ParCSRMatrixBigInitialize ( HYPRE_ParCSRMatrix matrix ); -HYPRE_Int HYPRE_ParCSRMatrixRead ( MPI_Comm comm , const char *file_name , HYPRE_ParCSRMatrix *matrix ); -HYPRE_Int HYPRE_ParCSRMatrixPrint ( HYPRE_ParCSRMatrix matrix , const char *file_name ); -HYPRE_Int HYPRE_ParCSRMatrixGetComm ( HYPRE_ParCSRMatrix matrix , MPI_Comm *comm ); -HYPRE_Int HYPRE_ParCSRMatrixGetDims ( HYPRE_ParCSRMatrix matrix , HYPRE_BigInt *M , HYPRE_BigInt *N ); -HYPRE_Int HYPRE_ParCSRMatrixGetRowPartitioning ( HYPRE_ParCSRMatrix matrix , HYPRE_BigInt **row_partitioning_ptr ); -HYPRE_Int HYPRE_ParCSRMatrixGetGlobalRowPartitioning ( HYPRE_ParCSRMatrix matrix , HYPRE_Int all_procs, HYPRE_BigInt **row_partitioning_ptr ); -HYPRE_Int HYPRE_ParCSRMatrixGetColPartitioning ( HYPRE_ParCSRMatrix matrix , HYPRE_BigInt **col_partitioning_ptr ); -HYPRE_Int HYPRE_ParCSRMatrixGetLocalRange ( HYPRE_ParCSRMatrix matrix , HYPRE_BigInt *row_start , HYPRE_BigInt *row_end , HYPRE_BigInt *col_start , HYPRE_BigInt *col_end ); -HYPRE_Int HYPRE_ParCSRMatrixGetRow ( HYPRE_ParCSRMatrix matrix , HYPRE_BigInt row , HYPRE_Int *size , HYPRE_BigInt **col_ind , HYPRE_Complex **values ); -HYPRE_Int HYPRE_ParCSRMatrixRestoreRow ( HYPRE_ParCSRMatrix matrix , HYPRE_BigInt row , HYPRE_Int *size , HYPRE_BigInt **col_ind , HYPRE_Complex **values ); -HYPRE_Int HYPRE_CSRMatrixToParCSRMatrix ( MPI_Comm comm , HYPRE_CSRMatrix A_CSR , HYPRE_BigInt *row_partitioning , HYPRE_BigInt *col_partitioning , HYPRE_ParCSRMatrix *matrix ); -HYPRE_Int HYPRE_CSRMatrixToParCSRMatrix_WithNewPartitioning ( MPI_Comm comm , HYPRE_CSRMatrix A_CSR , HYPRE_ParCSRMatrix *matrix ); -HYPRE_Int HYPRE_ParCSRMatrixMatvec ( HYPRE_Complex alpha , HYPRE_ParCSRMatrix A , HYPRE_ParVector x , HYPRE_Complex beta , HYPRE_ParVector y ); -HYPRE_Int HYPRE_ParCSRMatrixMatvecT ( HYPRE_Complex alpha , HYPRE_ParCSRMatrix A , HYPRE_ParVector x , HYPRE_Complex beta , HYPRE_ParVector y ); -HYPRE_Int hypre_ParCSRMatrixTruncate(hypre_ParCSRMatrix *A, HYPRE_Real tol, HYPRE_Int max_row_elmts, HYPRE_Int rescale, HYPRE_Int nrm_type); +HYPRE_Int HYPRE_ParCSRMatrixRead ( MPI_Comm comm, const char *file_name, + HYPRE_ParCSRMatrix *matrix ); +HYPRE_Int HYPRE_ParCSRMatrixPrint ( HYPRE_ParCSRMatrix matrix, const char *file_name ); +HYPRE_Int HYPRE_ParCSRMatrixGetComm ( HYPRE_ParCSRMatrix matrix, MPI_Comm *comm ); +HYPRE_Int HYPRE_ParCSRMatrixGetDims ( HYPRE_ParCSRMatrix matrix, HYPRE_BigInt *M, HYPRE_BigInt *N ); +HYPRE_Int HYPRE_ParCSRMatrixGetRowPartitioning ( HYPRE_ParCSRMatrix matrix, + HYPRE_BigInt **row_partitioning_ptr ); +HYPRE_Int HYPRE_ParCSRMatrixGetGlobalRowPartitioning ( HYPRE_ParCSRMatrix matrix, + HYPRE_Int all_procs, HYPRE_BigInt **row_partitioning_ptr ); +HYPRE_Int HYPRE_ParCSRMatrixGetColPartitioning ( HYPRE_ParCSRMatrix matrix, + HYPRE_BigInt **col_partitioning_ptr ); +HYPRE_Int HYPRE_ParCSRMatrixGetLocalRange ( HYPRE_ParCSRMatrix matrix, HYPRE_BigInt *row_start, + HYPRE_BigInt *row_end, HYPRE_BigInt *col_start, HYPRE_BigInt *col_end ); +HYPRE_Int HYPRE_ParCSRMatrixGetRow ( HYPRE_ParCSRMatrix matrix, HYPRE_BigInt row, HYPRE_Int *size, + HYPRE_BigInt **col_ind, HYPRE_Complex **values ); +HYPRE_Int HYPRE_ParCSRMatrixRestoreRow ( HYPRE_ParCSRMatrix matrix, HYPRE_BigInt row, + HYPRE_Int *size, HYPRE_BigInt **col_ind, HYPRE_Complex **values ); +HYPRE_Int HYPRE_CSRMatrixToParCSRMatrix ( MPI_Comm comm, HYPRE_CSRMatrix A_CSR, + HYPRE_BigInt *row_partitioning, HYPRE_BigInt *col_partitioning, HYPRE_ParCSRMatrix *matrix ); +HYPRE_Int HYPRE_CSRMatrixToParCSRMatrix_WithNewPartitioning ( MPI_Comm comm, HYPRE_CSRMatrix A_CSR, + HYPRE_ParCSRMatrix *matrix ); +HYPRE_Int HYPRE_ParCSRMatrixMatvec ( HYPRE_Complex alpha, HYPRE_ParCSRMatrix A, HYPRE_ParVector x, + HYPRE_Complex beta, HYPRE_ParVector y ); +HYPRE_Int HYPRE_ParCSRMatrixMatvecT ( HYPRE_Complex alpha, HYPRE_ParCSRMatrix A, HYPRE_ParVector x, + HYPRE_Complex beta, HYPRE_ParVector y ); + /* HYPRE_parcsr_vector.c */ -HYPRE_Int HYPRE_ParVectorCreate ( MPI_Comm comm , HYPRE_BigInt global_size , HYPRE_BigInt *partitioning , HYPRE_ParVector *vector ); -HYPRE_Int HYPRE_ParMultiVectorCreate ( MPI_Comm comm , HYPRE_BigInt global_size , HYPRE_BigInt *partitioning , HYPRE_Int number_vectors , HYPRE_ParVector *vector ); +HYPRE_Int HYPRE_ParVectorCreate ( MPI_Comm comm, HYPRE_BigInt global_size, + HYPRE_BigInt *partitioning, HYPRE_ParVector *vector ); +HYPRE_Int HYPRE_ParMultiVectorCreate ( MPI_Comm comm, HYPRE_BigInt global_size, + HYPRE_BigInt *partitioning, HYPRE_Int number_vectors, HYPRE_ParVector *vector ); HYPRE_Int HYPRE_ParVectorDestroy ( HYPRE_ParVector vector ); HYPRE_Int HYPRE_ParVectorInitialize ( HYPRE_ParVector vector ); -HYPRE_Int HYPRE_ParVectorRead ( MPI_Comm comm , const char *file_name , HYPRE_ParVector *vector ); -HYPRE_Int HYPRE_ParVectorPrint ( HYPRE_ParVector vector , const char *file_name ); -HYPRE_Int HYPRE_ParVectorSetConstantValues ( HYPRE_ParVector vector , HYPRE_Complex value ); -HYPRE_Int HYPRE_ParVectorSetRandomValues ( HYPRE_ParVector vector , HYPRE_Int seed ); -HYPRE_Int HYPRE_ParVectorCopy ( HYPRE_ParVector x , HYPRE_ParVector y ); +HYPRE_Int HYPRE_ParVectorRead ( MPI_Comm comm, const char *file_name, HYPRE_ParVector *vector ); +HYPRE_Int HYPRE_ParVectorPrint ( HYPRE_ParVector vector, const char *file_name ); +HYPRE_Int HYPRE_ParVectorPrintBinaryIJ ( HYPRE_ParVector vector, const char *file_name ); +HYPRE_Int HYPRE_ParVectorSetConstantValues ( HYPRE_ParVector vector, HYPRE_Complex value ); +HYPRE_Int HYPRE_ParVectorSetRandomValues ( HYPRE_ParVector vector, HYPRE_Int seed ); +HYPRE_Int HYPRE_ParVectorCopy ( HYPRE_ParVector x, HYPRE_ParVector y ); +HYPRE_Int hypre_ParVectorStridedCopy( hypre_ParVector *x, HYPRE_Int istride, HYPRE_Int ostride, + HYPRE_Int size, HYPRE_Complex *data ); HYPRE_ParVector HYPRE_ParVectorCloneShallow ( HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParVectorScale ( HYPRE_Complex value , HYPRE_ParVector x ); -HYPRE_Int HYPRE_ParVectorAxpy ( HYPRE_Complex alpha , HYPRE_ParVector x , HYPRE_ParVector y ); -HYPRE_Int HYPRE_ParVectorInnerProd ( HYPRE_ParVector x , HYPRE_ParVector y , HYPRE_Real *prod ); -HYPRE_Int HYPRE_VectorToParVector ( MPI_Comm comm , HYPRE_Vector b , HYPRE_BigInt *partitioning , HYPRE_ParVector *vector ); -HYPRE_Int HYPRE_ParVectorGetValues ( HYPRE_ParVector vector, HYPRE_Int num_values, HYPRE_BigInt *indices , HYPRE_Complex *values); - -/*gen_fffc.c */ -HYPRE_Int hypre_ParCSRMatrixGenerateFFFC(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker , HYPRE_BigInt *cpts_starts , hypre_ParCSRMatrix *S, hypre_ParCSRMatrix **A_FC_ptr , hypre_ParCSRMatrix **A_FF_ptr ) ; -HYPRE_Int hypre_ParCSRMatrixGenerateFFFC3(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker , HYPRE_BigInt *cpts_starts , hypre_ParCSRMatrix *S, hypre_ParCSRMatrix **A_FC_ptr , hypre_ParCSRMatrix **A_FF_ptr ) ; -HYPRE_Int hypre_ParCSRMatrixGenerateFFFCD3(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker , HYPRE_BigInt *cpts_starts , hypre_ParCSRMatrix *S, hypre_ParCSRMatrix **A_FC_ptr , hypre_ParCSRMatrix **A_FF_ptr , HYPRE_Real **D_lambda_ptr ) ; -HYPRE_Int hypre_ParCSRMatrixGenerateFFFC3Device(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker , HYPRE_BigInt *cpts_starts , hypre_ParCSRMatrix *S, hypre_ParCSRMatrix **A_FC_ptr , hypre_ParCSRMatrix **A_FF_ptr ) ; -HYPRE_Int hypre_ParCSRMatrixGenerateCFDevice( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker_host, HYPRE_BigInt *cpts_starts, hypre_ParCSRMatrix *S, hypre_ParCSRMatrix **ACF_ptr) ; -HYPRE_Int hypre_ParCSRMatrixGenerateCCDevice( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker_host, HYPRE_BigInt *cpts_starts, hypre_ParCSRMatrix *S, hypre_ParCSRMatrix **ACC_ptr) ; -HYPRE_Int hypre_ParCSRMatrixGenerate1DCFDevice( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker_host, HYPRE_BigInt *cpts_starts, hypre_ParCSRMatrix *S, hypre_ParCSRMatrix **ACX_ptr, hypre_ParCSRMatrix **AXC_ptr ) ; +HYPRE_Int HYPRE_ParVectorScale ( HYPRE_Complex value, HYPRE_ParVector x ); +HYPRE_Int HYPRE_ParVectorAxpy ( HYPRE_Complex alpha, HYPRE_ParVector x, HYPRE_ParVector y ); +HYPRE_Int HYPRE_ParVectorInnerProd ( HYPRE_ParVector x, HYPRE_ParVector y, HYPRE_Real *prod ); +HYPRE_Int HYPRE_VectorToParVector ( MPI_Comm comm, HYPRE_Vector b, HYPRE_BigInt *partitioning, + HYPRE_ParVector *vector ); +HYPRE_Int HYPRE_ParVectorGetValues ( HYPRE_ParVector vector, HYPRE_Int num_values, + HYPRE_BigInt *indices, HYPRE_Complex *values); + +/* gen_fffc.c */ +HYPRE_Int hypre_ParCSRMatrixGenerateFFFCHost( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + HYPRE_BigInt *cpts_starts, hypre_ParCSRMatrix *S, + hypre_ParCSRMatrix **A_FC_ptr, + hypre_ParCSRMatrix **A_FF_ptr ) ; +HYPRE_Int hypre_ParCSRMatrixGenerateFFFC( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + HYPRE_BigInt *cpts_starts, hypre_ParCSRMatrix *S, + hypre_ParCSRMatrix **A_FC_ptr, + hypre_ParCSRMatrix **A_FF_ptr ) ; +HYPRE_Int hypre_ParCSRMatrixGenerateFFFC3(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + HYPRE_BigInt *cpts_starts, hypre_ParCSRMatrix *S, hypre_ParCSRMatrix **A_FC_ptr, + hypre_ParCSRMatrix **A_FF_ptr ) ; +HYPRE_Int hypre_ParCSRMatrixGenerateFFFCD3(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + HYPRE_BigInt *cpts_starts, hypre_ParCSRMatrix *S, hypre_ParCSRMatrix **A_FC_ptr, + hypre_ParCSRMatrix **A_FF_ptr, HYPRE_Real **D_lambda_ptr ) ; +HYPRE_Int hypre_ParCSRMatrixGenerateFFFC3Device(hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + HYPRE_BigInt *cpts_starts, hypre_ParCSRMatrix *S, hypre_ParCSRMatrix **A_FC_ptr, + hypre_ParCSRMatrix **A_FF_ptr ) ; +HYPRE_Int hypre_ParCSRMatrixGenerateCFDevice( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + HYPRE_BigInt *cpts_starts, hypre_ParCSRMatrix *S, hypre_ParCSRMatrix **ACF_ptr) ; +HYPRE_Int hypre_ParCSRMatrixGenerateCCDevice( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + HYPRE_BigInt *cpts_starts, hypre_ParCSRMatrix *S, hypre_ParCSRMatrix **ACC_ptr) ; +HYPRE_Int hypre_ParCSRMatrixGenerate1DCFDevice( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + HYPRE_BigInt *cpts_starts, hypre_ParCSRMatrix *S, hypre_ParCSRMatrix **ACX_ptr, + hypre_ParCSRMatrix **AXC_ptr ) ; /* new_commpkg.c */ -HYPRE_Int hypre_PrintCommpkg ( hypre_ParCSRMatrix *A , const char *file_name ); -HYPRE_Int hypre_ParCSRCommPkgCreateApart_core ( MPI_Comm comm , HYPRE_BigInt *col_map_off_d , HYPRE_BigInt first_col_diag , HYPRE_Int num_cols_off_d , HYPRE_BigInt global_num_cols , HYPRE_Int *p_num_recvs , HYPRE_Int **p_recv_procs , HYPRE_Int **p_recv_vec_starts , HYPRE_Int *p_num_sends , HYPRE_Int **p_send_procs , HYPRE_Int **p_send_map_starts , HYPRE_Int **p_send_map_elements , hypre_IJAssumedPart *apart ); -HYPRE_Int hypre_ParCSRCommPkgCreateApart ( MPI_Comm comm, HYPRE_BigInt *col_map_off_d, HYPRE_BigInt first_col_diag, HYPRE_Int num_cols_off_d, HYPRE_BigInt global_num_cols, hypre_IJAssumedPart *apart, hypre_ParCSRCommPkg *comm_pkg ); +HYPRE_Int hypre_PrintCommpkg ( hypre_ParCSRMatrix *A, const char *file_name ); +HYPRE_Int hypre_ParCSRCommPkgCreateApart_core ( MPI_Comm comm, HYPRE_BigInt *col_map_off_d, + HYPRE_BigInt first_col_diag, HYPRE_Int num_cols_off_d, HYPRE_BigInt global_num_cols, + HYPRE_Int *p_num_recvs, HYPRE_Int **p_recv_procs, HYPRE_Int **p_recv_vec_starts, + HYPRE_Int *p_num_sends, HYPRE_Int **p_send_procs, HYPRE_Int **p_send_map_starts, + HYPRE_Int **p_send_map_elements, hypre_IJAssumedPart *apart ); +HYPRE_Int hypre_ParCSRCommPkgCreateApart ( MPI_Comm comm, HYPRE_BigInt *col_map_off_d, + HYPRE_BigInt first_col_diag, HYPRE_Int num_cols_off_d, HYPRE_BigInt global_num_cols, + hypre_IJAssumedPart *apart, hypre_ParCSRCommPkg *comm_pkg ); HYPRE_Int hypre_NewCommPkgDestroy ( hypre_ParCSRMatrix *parcsr_A ); -HYPRE_Int hypre_RangeFillResponseIJDetermineRecvProcs ( void *p_recv_contact_buf , HYPRE_Int contact_size , HYPRE_Int contact_proc , void *ro , MPI_Comm comm , void **p_send_response_buf , HYPRE_Int *response_message_size ); -HYPRE_Int hypre_FillResponseIJDetermineSendProcs ( void *p_recv_contact_buf , HYPRE_Int contact_size , HYPRE_Int contact_proc , void *ro , MPI_Comm comm , void **p_send_response_buf , HYPRE_Int *response_message_size ); +HYPRE_Int hypre_RangeFillResponseIJDetermineRecvProcs ( void *p_recv_contact_buf, + HYPRE_Int contact_size, HYPRE_Int contact_proc, void *ro, MPI_Comm comm, void **p_send_response_buf, + HYPRE_Int *response_message_size ); +HYPRE_Int hypre_FillResponseIJDetermineSendProcs ( void *p_recv_contact_buf, HYPRE_Int contact_size, + HYPRE_Int contact_proc, void *ro, MPI_Comm comm, void **p_send_response_buf, + HYPRE_Int *response_message_size ); /* numbers.c */ hypre_NumbersNode *hypre_NumbersNewNode ( void ); void hypre_NumbersDeleteNode ( hypre_NumbersNode *node ); -HYPRE_Int hypre_NumbersEnter ( hypre_NumbersNode *node , const HYPRE_Int n ); +HYPRE_Int hypre_NumbersEnter ( hypre_NumbersNode *node, const HYPRE_Int n ); HYPRE_Int hypre_NumbersNEntered ( hypre_NumbersNode *node ); -HYPRE_Int hypre_NumbersQuery ( hypre_NumbersNode *node , const HYPRE_Int n ); +HYPRE_Int hypre_NumbersQuery ( hypre_NumbersNode *node, const HYPRE_Int n ); HYPRE_Int *hypre_NumbersArray ( hypre_NumbersNode *node ); /* parchord_to_parcsr.c */ -void hypre_ParChordMatrix_RowStarts ( hypre_ParChordMatrix *Ac , MPI_Comm comm , HYPRE_BigInt **row_starts , HYPRE_BigInt *global_num_cols ); -HYPRE_Int hypre_ParChordMatrixToParCSRMatrix ( hypre_ParChordMatrix *Ac , MPI_Comm comm , hypre_ParCSRMatrix **pAp ); -HYPRE_Int hypre_ParCSRMatrixToParChordMatrix ( hypre_ParCSRMatrix *Ap , MPI_Comm comm , hypre_ParChordMatrix **pAc ); +void hypre_ParChordMatrix_RowStarts ( hypre_ParChordMatrix *Ac, MPI_Comm comm, + HYPRE_BigInt **row_starts, HYPRE_BigInt *global_num_cols ); +HYPRE_Int hypre_ParChordMatrixToParCSRMatrix ( hypre_ParChordMatrix *Ac, MPI_Comm comm, + hypre_ParCSRMatrix **pAp ); +HYPRE_Int hypre_ParCSRMatrixToParChordMatrix ( hypre_ParCSRMatrix *Ap, MPI_Comm comm, + hypre_ParChordMatrix **pAc ); /* par_csr_aat.c */ -void hypre_ParAat_RowSizes ( HYPRE_Int **C_diag_i , HYPRE_Int **C_offd_i , HYPRE_Int *B_marker , HYPRE_Int *A_diag_i , HYPRE_Int *A_diag_j , HYPRE_Int *A_offd_i , HYPRE_Int *A_offd_j , HYPRE_BigInt *A_col_map_offd , HYPRE_Int *A_ext_i , HYPRE_BigInt *A_ext_j , HYPRE_BigInt *A_ext_row_map , HYPRE_Int *C_diag_size , HYPRE_Int *C_offd_size , HYPRE_Int num_rows_diag_A , HYPRE_Int num_cols_offd_A , HYPRE_Int num_rows_A_ext , HYPRE_BigInt first_col_diag_A , HYPRE_BigInt first_row_index_A ); +void hypre_ParAat_RowSizes ( HYPRE_Int **C_diag_i, HYPRE_Int **C_offd_i, HYPRE_Int *B_marker, + HYPRE_Int *A_diag_i, HYPRE_Int *A_diag_j, HYPRE_Int *A_offd_i, HYPRE_Int *A_offd_j, + HYPRE_BigInt *A_col_map_offd, HYPRE_Int *A_ext_i, HYPRE_BigInt *A_ext_j, + HYPRE_BigInt *A_ext_row_map, HYPRE_Int *C_diag_size, HYPRE_Int *C_offd_size, + HYPRE_Int num_rows_diag_A, HYPRE_Int num_cols_offd_A, HYPRE_Int num_rows_A_ext, + HYPRE_BigInt first_col_diag_A, HYPRE_BigInt first_row_index_A ); hypre_ParCSRMatrix *hypre_ParCSRAAt ( hypre_ParCSRMatrix *A ); -hypre_CSRMatrix *hypre_ParCSRMatrixExtractAExt ( hypre_ParCSRMatrix *A , HYPRE_Int data , HYPRE_BigInt **pA_ext_row_map ); +hypre_CSRMatrix *hypre_ParCSRMatrixExtractAExt ( hypre_ParCSRMatrix *A, HYPRE_Int data, + HYPRE_BigInt **pA_ext_row_map ); /* par_csr_assumed_part.c */ -HYPRE_Int hypre_LocateAssumedPartition ( MPI_Comm comm , HYPRE_BigInt row_start , HYPRE_BigInt row_end , HYPRE_BigInt global_first_row , HYPRE_BigInt global_num_rows , hypre_IJAssumedPart *part , HYPRE_Int myid ); -hypre_IJAssumedPart *hypre_AssumedPartitionCreate ( MPI_Comm comm , HYPRE_BigInt global_num , HYPRE_BigInt start , HYPRE_BigInt end ); +HYPRE_Int hypre_LocateAssumedPartition ( MPI_Comm comm, HYPRE_BigInt row_start, + HYPRE_BigInt row_end, HYPRE_BigInt global_first_row, HYPRE_BigInt global_num_rows, + hypre_IJAssumedPart *part, HYPRE_Int myid ); +hypre_IJAssumedPart *hypre_AssumedPartitionCreate ( MPI_Comm comm, HYPRE_BigInt global_num, + HYPRE_BigInt start, HYPRE_BigInt end ); HYPRE_Int hypre_ParCSRMatrixCreateAssumedPartition ( hypre_ParCSRMatrix *matrix ); HYPRE_Int hypre_AssumedPartitionDestroy ( hypre_IJAssumedPart *apart ); -HYPRE_Int hypre_GetAssumedPartitionProcFromRow ( MPI_Comm comm , HYPRE_BigInt row , HYPRE_BigInt global_first_row , HYPRE_BigInt global_num_rows , HYPRE_Int *proc_id ); -HYPRE_Int hypre_GetAssumedPartitionRowRange ( MPI_Comm comm , HYPRE_Int proc_id , HYPRE_BigInt global_first_row , HYPRE_BigInt global_num_rows , HYPRE_BigInt *row_start , HYPRE_BigInt *row_end ); +HYPRE_Int hypre_GetAssumedPartitionProcFromRow ( MPI_Comm comm, HYPRE_BigInt row, + HYPRE_BigInt global_first_row, HYPRE_BigInt global_num_rows, HYPRE_Int *proc_id ); +HYPRE_Int hypre_GetAssumedPartitionRowRange ( MPI_Comm comm, HYPRE_Int proc_id, + HYPRE_BigInt global_first_row, HYPRE_BigInt global_num_rows, HYPRE_BigInt *row_start, + HYPRE_BigInt *row_end ); HYPRE_Int hypre_ParVectorCreateAssumedPartition ( hypre_ParVector *vector ); /* par_csr_bool_matop.c */ -hypre_ParCSRBooleanMatrix *hypre_ParBooleanMatmul ( hypre_ParCSRBooleanMatrix *A , hypre_ParCSRBooleanMatrix *B ); -hypre_CSRBooleanMatrix *hypre_ParCSRBooleanMatrixExtractBExt ( hypre_ParCSRBooleanMatrix *B , hypre_ParCSRBooleanMatrix *A ); -hypre_CSRBooleanMatrix *hypre_ParCSRBooleanMatrixExtractAExt ( hypre_ParCSRBooleanMatrix *A , HYPRE_BigInt **pA_ext_row_map ); +hypre_ParCSRBooleanMatrix *hypre_ParBooleanMatmul ( hypre_ParCSRBooleanMatrix *A, + hypre_ParCSRBooleanMatrix *B ); +hypre_CSRBooleanMatrix *hypre_ParCSRBooleanMatrixExtractBExt ( hypre_ParCSRBooleanMatrix *B, + hypre_ParCSRBooleanMatrix *A ); +hypre_CSRBooleanMatrix *hypre_ParCSRBooleanMatrixExtractAExt ( hypre_ParCSRBooleanMatrix *A, + HYPRE_BigInt **pA_ext_row_map ); hypre_ParCSRBooleanMatrix *hypre_ParBooleanAAt ( hypre_ParCSRBooleanMatrix *A ); HYPRE_Int hypre_BooleanMatTCommPkgCreate ( hypre_ParCSRBooleanMatrix *A ); HYPRE_Int hypre_BooleanMatvecCommPkgCreate ( hypre_ParCSRBooleanMatrix *A ); /* par_csr_bool_matrix.c */ -hypre_CSRBooleanMatrix *hypre_CSRBooleanMatrixCreate ( HYPRE_Int num_rows , HYPRE_Int num_cols , HYPRE_Int num_nonzeros ); +hypre_CSRBooleanMatrix *hypre_CSRBooleanMatrixCreate ( HYPRE_Int num_rows, HYPRE_Int num_cols, + HYPRE_Int num_nonzeros ); HYPRE_Int hypre_CSRBooleanMatrixDestroy ( hypre_CSRBooleanMatrix *matrix ); HYPRE_Int hypre_CSRBooleanMatrixInitialize ( hypre_CSRBooleanMatrix *matrix ); HYPRE_Int hypre_CSRBooleanMatrixBigInitialize ( hypre_CSRBooleanMatrix *matrix ); -HYPRE_Int hypre_CSRBooleanMatrixSetDataOwner ( hypre_CSRBooleanMatrix *matrix , HYPRE_Int owns_data ); -HYPRE_Int hypre_CSRBooleanMatrixSetBigDataOwner ( hypre_CSRBooleanMatrix *matrix , HYPRE_Int owns_data ); +HYPRE_Int hypre_CSRBooleanMatrixSetDataOwner ( hypre_CSRBooleanMatrix *matrix, + HYPRE_Int owns_data ); +HYPRE_Int hypre_CSRBooleanMatrixSetBigDataOwner ( hypre_CSRBooleanMatrix *matrix, + HYPRE_Int owns_data ); hypre_CSRBooleanMatrix *hypre_CSRBooleanMatrixRead ( const char *file_name ); -HYPRE_Int hypre_CSRBooleanMatrixPrint ( hypre_CSRBooleanMatrix *matrix , const char *file_name ); -hypre_ParCSRBooleanMatrix *hypre_ParCSRBooleanMatrixCreate ( MPI_Comm comm , HYPRE_BigInt global_num_rows , HYPRE_BigInt global_num_cols , HYPRE_BigInt *row_starts , HYPRE_BigInt *col_starts , HYPRE_Int num_cols_offd , HYPRE_Int num_nonzeros_diag , HYPRE_Int num_nonzeros_offd ); +HYPRE_Int hypre_CSRBooleanMatrixPrint ( hypre_CSRBooleanMatrix *matrix, const char *file_name ); +hypre_ParCSRBooleanMatrix *hypre_ParCSRBooleanMatrixCreate ( MPI_Comm comm, + HYPRE_BigInt global_num_rows, HYPRE_BigInt global_num_cols, HYPRE_BigInt *row_starts, + HYPRE_BigInt *col_starts, HYPRE_Int num_cols_offd, HYPRE_Int num_nonzeros_diag, + HYPRE_Int num_nonzeros_offd ); HYPRE_Int hypre_ParCSRBooleanMatrixDestroy ( hypre_ParCSRBooleanMatrix *matrix ); HYPRE_Int hypre_ParCSRBooleanMatrixInitialize ( hypre_ParCSRBooleanMatrix *matrix ); HYPRE_Int hypre_ParCSRBooleanMatrixSetNNZ ( hypre_ParCSRBooleanMatrix *matrix ); -HYPRE_Int hypre_ParCSRBooleanMatrixSetDataOwner ( hypre_ParCSRBooleanMatrix *matrix , HYPRE_Int owns_data ); -HYPRE_Int hypre_ParCSRBooleanMatrixSetRowStartsOwner ( hypre_ParCSRBooleanMatrix *matrix , HYPRE_Int owns_row_starts ); -HYPRE_Int hypre_ParCSRBooleanMatrixSetColStartsOwner ( hypre_ParCSRBooleanMatrix *matrix , HYPRE_Int owns_col_starts ); -hypre_ParCSRBooleanMatrix *hypre_ParCSRBooleanMatrixRead ( MPI_Comm comm , const char *file_name ); -HYPRE_Int hypre_ParCSRBooleanMatrixPrint ( hypre_ParCSRBooleanMatrix *matrix , const char *file_name ); -HYPRE_Int hypre_ParCSRBooleanMatrixPrintIJ ( hypre_ParCSRBooleanMatrix *matrix , const char *filename ); -HYPRE_Int hypre_ParCSRBooleanMatrixGetLocalRange ( hypre_ParCSRBooleanMatrix *matrix , HYPRE_BigInt *row_start , HYPRE_BigInt *row_end , HYPRE_BigInt *col_start , HYPRE_BigInt *col_end ); -HYPRE_Int hypre_ParCSRBooleanMatrixGetRow ( hypre_ParCSRBooleanMatrix *mat , HYPRE_BigInt row , HYPRE_Int *size , HYPRE_BigInt **col_ind ); -HYPRE_Int hypre_ParCSRBooleanMatrixRestoreRow ( hypre_ParCSRBooleanMatrix *matrix , HYPRE_BigInt row , HYPRE_Int *size , HYPRE_BigInt **col_ind ); -HYPRE_Int hypre_BuildCSRBooleanMatrixMPIDataType ( HYPRE_Int num_nonzeros , HYPRE_Int num_rows , HYPRE_Int *a_i , HYPRE_Int *a_j , hypre_MPI_Datatype *csr_matrix_datatype ); -hypre_ParCSRBooleanMatrix *hypre_CSRBooleanMatrixToParCSRBooleanMatrix ( MPI_Comm comm , hypre_CSRBooleanMatrix *A , HYPRE_BigInt *row_starts , HYPRE_BigInt *col_starts ); -HYPRE_Int hypre_BooleanGenerateDiagAndOffd ( hypre_CSRBooleanMatrix *A , hypre_ParCSRBooleanMatrix *matrix , HYPRE_BigInt first_col_diag , HYPRE_BigInt last_col_diag ); +HYPRE_Int hypre_ParCSRBooleanMatrixSetDataOwner ( hypre_ParCSRBooleanMatrix *matrix, + HYPRE_Int owns_data ); +HYPRE_Int hypre_ParCSRBooleanMatrixSetRowStartsOwner ( hypre_ParCSRBooleanMatrix *matrix, + HYPRE_Int owns_row_starts ); +HYPRE_Int hypre_ParCSRBooleanMatrixSetColStartsOwner ( hypre_ParCSRBooleanMatrix *matrix, + HYPRE_Int owns_col_starts ); +hypre_ParCSRBooleanMatrix *hypre_ParCSRBooleanMatrixRead ( MPI_Comm comm, const char *file_name ); +HYPRE_Int hypre_ParCSRBooleanMatrixPrint ( hypre_ParCSRBooleanMatrix *matrix, + const char *file_name ); +HYPRE_Int hypre_ParCSRBooleanMatrixPrintIJ ( hypre_ParCSRBooleanMatrix *matrix, + const char *filename ); +HYPRE_Int hypre_ParCSRBooleanMatrixGetLocalRange ( hypre_ParCSRBooleanMatrix *matrix, + HYPRE_BigInt *row_start, HYPRE_BigInt *row_end, HYPRE_BigInt *col_start, HYPRE_BigInt *col_end ); +HYPRE_Int hypre_ParCSRBooleanMatrixGetRow ( hypre_ParCSRBooleanMatrix *mat, HYPRE_BigInt row, + HYPRE_Int *size, HYPRE_BigInt **col_ind ); +HYPRE_Int hypre_ParCSRBooleanMatrixRestoreRow ( hypre_ParCSRBooleanMatrix *matrix, HYPRE_BigInt row, + HYPRE_Int *size, HYPRE_BigInt **col_ind ); +HYPRE_Int hypre_BuildCSRBooleanMatrixMPIDataType ( HYPRE_Int num_nonzeros, HYPRE_Int num_rows, + HYPRE_Int *a_i, HYPRE_Int *a_j, hypre_MPI_Datatype *csr_matrix_datatype ); +hypre_ParCSRBooleanMatrix *hypre_CSRBooleanMatrixToParCSRBooleanMatrix ( MPI_Comm comm, + hypre_CSRBooleanMatrix *A, HYPRE_BigInt *row_starts, HYPRE_BigInt *col_starts ); +HYPRE_Int hypre_BooleanGenerateDiagAndOffd ( hypre_CSRBooleanMatrix *A, + hypre_ParCSRBooleanMatrix *matrix, HYPRE_BigInt first_col_diag, HYPRE_BigInt last_col_diag ); /* par_csr_communication.c */ -hypre_ParCSRCommHandle *hypre_ParCSRCommHandleCreate ( HYPRE_Int job , hypre_ParCSRCommPkg *comm_pkg , void *send_data , void *recv_data ); -hypre_ParCSRCommHandle *hypre_ParCSRCommHandleCreate_v2 ( HYPRE_Int job, hypre_ParCSRCommPkg *comm_pkg, HYPRE_MemoryLocation send_memory_location, void *send_data_in, HYPRE_MemoryLocation recv_memory_location, void *recv_data_in ); +hypre_ParCSRCommHandle *hypre_ParCSRCommHandleCreate ( HYPRE_Int job, hypre_ParCSRCommPkg *comm_pkg, + void *send_data, void *recv_data ); +hypre_ParCSRCommHandle *hypre_ParCSRCommHandleCreate_v2 ( HYPRE_Int job, + hypre_ParCSRCommPkg *comm_pkg, + HYPRE_MemoryLocation send_memory_location, + void *send_data_in, + HYPRE_MemoryLocation recv_memory_location, + void *recv_data_in ); HYPRE_Int hypre_ParCSRCommHandleDestroy ( hypre_ParCSRCommHandle *comm_handle ); -void hypre_ParCSRCommPkgCreate_core ( MPI_Comm comm , HYPRE_BigInt *col_map_offd , HYPRE_BigInt first_col_diag , HYPRE_BigInt *col_starts , HYPRE_Int num_cols_diag , HYPRE_Int num_cols_offd , HYPRE_Int *p_num_recvs , HYPRE_Int **p_recv_procs , HYPRE_Int **p_recv_vec_starts , HYPRE_Int *p_num_sends , HYPRE_Int **p_send_procs , HYPRE_Int **p_send_map_starts , HYPRE_Int **p_send_map_elmts ); -HYPRE_Int -hypre_ParCSRCommPkgCreate(MPI_Comm comm, HYPRE_BigInt *col_map_offd, HYPRE_BigInt first_col_diag, HYPRE_BigInt *col_starts, HYPRE_Int num_cols_diag, HYPRE_Int num_cols_offd, hypre_ParCSRCommPkg *comm_pkg); +void hypre_ParCSRCommPkgCreate_core ( MPI_Comm comm, HYPRE_BigInt *col_map_offd, + HYPRE_BigInt first_col_diag, HYPRE_BigInt *col_starts, HYPRE_Int num_cols_diag, + HYPRE_Int num_cols_offd, HYPRE_Int *p_num_recvs, HYPRE_Int **p_recv_procs, + HYPRE_Int **p_recv_vec_starts, HYPRE_Int *p_num_sends, HYPRE_Int **p_send_procs, + HYPRE_Int **p_send_map_starts, HYPRE_Int **p_send_map_elmts ); +HYPRE_Int hypre_ParCSRCommPkgCreate(MPI_Comm comm, HYPRE_BigInt *col_map_offd, + HYPRE_BigInt first_col_diag, HYPRE_BigInt *col_starts, + HYPRE_Int num_cols_diag, HYPRE_Int num_cols_offd, + hypre_ParCSRCommPkg *comm_pkg); +HYPRE_Int hypre_ParCSRCommPkgCreateAndFill ( MPI_Comm comm, HYPRE_Int num_recvs, + HYPRE_Int *recv_procs, HYPRE_Int *recv_vec_starts, + HYPRE_Int num_sends, HYPRE_Int *send_procs, + HYPRE_Int *send_map_starts, HYPRE_Int *send_map_elmts, + hypre_ParCSRCommPkg **comm_pkg_ptr ); +HYPRE_Int hypre_ParCSRCommPkgUpdateVecStarts ( hypre_ParCSRCommPkg *comm_pkg, + HYPRE_Int num_components_in, + HYPRE_Int vecstride, HYPRE_Int idxstride ); HYPRE_Int hypre_MatvecCommPkgCreate ( hypre_ParCSRMatrix *A ); HYPRE_Int hypre_MatvecCommPkgDestroy ( hypre_ParCSRCommPkg *comm_pkg ); -HYPRE_Int hypre_BuildCSRMatrixMPIDataType ( HYPRE_Int num_nonzeros , HYPRE_Int num_rows , HYPRE_Complex *a_data , HYPRE_Int *a_i , HYPRE_Int *a_j , hypre_MPI_Datatype *csr_matrix_datatype ); -HYPRE_Int hypre_BuildCSRJDataType ( HYPRE_Int num_nonzeros , HYPRE_Complex *a_data , HYPRE_Int *a_j , hypre_MPI_Datatype *csr_jdata_datatype ); -HYPRE_Int hypre_ParCSRFindExtendCommPkg(MPI_Comm comm, HYPRE_BigInt global_num_cols, HYPRE_BigInt first_col_diag, HYPRE_Int num_cols_diag, HYPRE_BigInt *col_starts, hypre_IJAssumedPart *apart, HYPRE_Int indices_len, HYPRE_BigInt *indices, hypre_ParCSRCommPkg **extend_comm_pkg); +HYPRE_Int hypre_BuildCSRMatrixMPIDataType ( HYPRE_Int num_nonzeros, HYPRE_Int num_rows, + HYPRE_Complex *a_data, HYPRE_Int *a_i, HYPRE_Int *a_j, + hypre_MPI_Datatype *csr_matrix_datatype ); +HYPRE_Int hypre_BuildCSRJDataType ( HYPRE_Int num_nonzeros, HYPRE_Complex *a_data, HYPRE_Int *a_j, + hypre_MPI_Datatype *csr_jdata_datatype ); +HYPRE_Int hypre_ParCSRFindExtendCommPkg(MPI_Comm comm, HYPRE_BigInt global_num_cols, + HYPRE_BigInt first_col_diag, HYPRE_Int num_cols_diag, HYPRE_BigInt *col_starts, + hypre_IJAssumedPart *apart, HYPRE_Int indices_len, HYPRE_BigInt *indices, + hypre_ParCSRCommPkg **extend_comm_pkg); + +/* par_csr_filter.c */ +HYPRE_Int hypre_ParCSRMatrixBlkFilter(hypre_ParCSRMatrix *A, + HYPRE_Int block_size, hypre_ParCSRMatrix **B_ptr); /* par_csr_matop.c */ HYPRE_Int hypre_ParCSRMatrixScale(hypre_ParCSRMatrix *A, HYPRE_Complex scalar); -void hypre_ParMatmul_RowSizes ( HYPRE_MemoryLocation memory_location , HYPRE_Int **C_diag_i , HYPRE_Int **C_offd_i , HYPRE_Int *rownnz_A , HYPRE_Int *A_diag_i , HYPRE_Int *A_diag_j , HYPRE_Int *A_offd_i , HYPRE_Int *A_offd_j , HYPRE_Int *B_diag_i , HYPRE_Int *B_diag_j , HYPRE_Int *B_offd_i , HYPRE_Int *B_offd_j , HYPRE_Int *B_ext_diag_i , HYPRE_Int *B_ext_diag_j , HYPRE_Int *B_ext_offd_i , HYPRE_Int *B_ext_offd_j , HYPRE_Int *map_B_to_C , HYPRE_Int *C_diag_size , HYPRE_Int *C_offd_size , HYPRE_Int num_rownnz_A , HYPRE_Int num_rows_diag_A , HYPRE_Int num_cols_offd_A , HYPRE_Int allsquare , HYPRE_Int num_cols_diag_B , HYPRE_Int num_cols_offd_B , HYPRE_Int num_cols_offd_C ); -hypre_ParCSRMatrix *hypre_ParMatmul ( hypre_ParCSRMatrix *A , hypre_ParCSRMatrix *B ); -void hypre_ParCSRMatrixExtractBExt_Arrays ( HYPRE_Int **pB_ext_i , HYPRE_BigInt **pB_ext_j , HYPRE_Complex **pB_ext_data , HYPRE_BigInt **pB_ext_row_map , HYPRE_Int *num_nonzeros , HYPRE_Int data , HYPRE_Int find_row_map , MPI_Comm comm , hypre_ParCSRCommPkg *comm_pkg , HYPRE_Int num_cols_B , HYPRE_Int num_recvs , HYPRE_Int num_sends , HYPRE_BigInt first_col_diag , HYPRE_BigInt *row_starts , HYPRE_Int *recv_vec_starts , HYPRE_Int *send_map_starts , HYPRE_Int *send_map_elmts , HYPRE_Int *diag_i , HYPRE_Int *diag_j , HYPRE_Int *offd_i , HYPRE_Int *offd_j , HYPRE_BigInt *col_map_offd , HYPRE_Real *diag_data , HYPRE_Real *offd_data ); -void hypre_ParCSRMatrixExtractBExt_Arrays_Overlap ( HYPRE_Int **pB_ext_i , HYPRE_BigInt **pB_ext_j , HYPRE_Complex **pB_ext_data , HYPRE_BigInt **pB_ext_row_map , HYPRE_Int *num_nonzeros , HYPRE_Int data , HYPRE_Int find_row_map , MPI_Comm comm , hypre_ParCSRCommPkg *comm_pkg , HYPRE_Int num_cols_B , HYPRE_Int num_recvs , HYPRE_Int num_sends , HYPRE_BigInt first_col_diag , HYPRE_BigInt *row_starts , HYPRE_Int *recv_vec_starts , HYPRE_Int *send_map_starts , HYPRE_Int *send_map_elmts , HYPRE_Int *diag_i , HYPRE_Int *diag_j , HYPRE_Int *offd_i , HYPRE_Int *offd_j , HYPRE_BigInt *col_map_offd , HYPRE_Real *diag_data , HYPRE_Real *offd_data, hypre_ParCSRCommHandle **comm_handle_idx, hypre_ParCSRCommHandle **comm_handle_data, HYPRE_Int *CF_marker, HYPRE_Int *CF_marker_offd, HYPRE_Int skip_fine, HYPRE_Int skip_same_sign ); -hypre_CSRMatrix *hypre_ParCSRMatrixExtractBExt ( hypre_ParCSRMatrix *B , hypre_ParCSRMatrix *A , HYPRE_Int data ); -hypre_CSRMatrix *hypre_ParCSRMatrixExtractBExt_Overlap ( hypre_ParCSRMatrix *B , hypre_ParCSRMatrix *A , HYPRE_Int data, hypre_ParCSRCommHandle **comm_handle_idx, hypre_ParCSRCommHandle **comm_handle_data, HYPRE_Int *CF_marker, HYPRE_Int *CF_marker_offd, HYPRE_Int skip_fine, HYPRE_Int skip_same_sign ); -HYPRE_Int hypre_ParCSRMatrixExtractBExtDeviceInit( hypre_ParCSRMatrix *B, hypre_ParCSRMatrix *A, HYPRE_Int want_data, void **request_ptr); +void hypre_ParMatmul_RowSizes ( HYPRE_MemoryLocation memory_location, HYPRE_Int **C_diag_i, + HYPRE_Int **C_offd_i, HYPRE_Int *rownnz_A, HYPRE_Int *A_diag_i, HYPRE_Int *A_diag_j, + HYPRE_Int *A_offd_i, HYPRE_Int *A_offd_j, HYPRE_Int *B_diag_i, HYPRE_Int *B_diag_j, + HYPRE_Int *B_offd_i, HYPRE_Int *B_offd_j, HYPRE_Int *B_ext_diag_i, HYPRE_Int *B_ext_diag_j, + HYPRE_Int *B_ext_offd_i, HYPRE_Int *B_ext_offd_j, HYPRE_Int *map_B_to_C, HYPRE_Int *C_diag_size, + HYPRE_Int *C_offd_size, HYPRE_Int num_rownnz_A, HYPRE_Int num_rows_diag_A, + HYPRE_Int num_cols_offd_A, HYPRE_Int allsquare, HYPRE_Int num_cols_diag_B, + HYPRE_Int num_cols_offd_B, HYPRE_Int num_cols_offd_C ); +hypre_ParCSRMatrix *hypre_ParMatmul ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B ); +void hypre_ParCSRMatrixExtractBExt_Arrays ( HYPRE_Int **pB_ext_i, HYPRE_BigInt **pB_ext_j, + HYPRE_Complex **pB_ext_data, HYPRE_BigInt **pB_ext_row_map, HYPRE_Int *num_nonzeros, HYPRE_Int data, + HYPRE_Int find_row_map, MPI_Comm comm, hypre_ParCSRCommPkg *comm_pkg, HYPRE_Int num_cols_B, + HYPRE_Int num_recvs, HYPRE_Int num_sends, HYPRE_BigInt first_col_diag, HYPRE_BigInt *row_starts, + HYPRE_Int *recv_vec_starts, HYPRE_Int *send_map_starts, HYPRE_Int *send_map_elmts, + HYPRE_Int *diag_i, HYPRE_Int *diag_j, HYPRE_Int *offd_i, HYPRE_Int *offd_j, + HYPRE_BigInt *col_map_offd, HYPRE_Real *diag_data, HYPRE_Real *offd_data ); +void hypre_ParCSRMatrixExtractBExt_Arrays_Overlap ( HYPRE_Int **pB_ext_i, HYPRE_BigInt **pB_ext_j, + HYPRE_Complex **pB_ext_data, HYPRE_BigInt **pB_ext_row_map, HYPRE_Int *num_nonzeros, HYPRE_Int data, + HYPRE_Int find_row_map, MPI_Comm comm, hypre_ParCSRCommPkg *comm_pkg, HYPRE_Int num_cols_B, + HYPRE_Int num_recvs, HYPRE_Int num_sends, HYPRE_BigInt first_col_diag, HYPRE_BigInt *row_starts, + HYPRE_Int *recv_vec_starts, HYPRE_Int *send_map_starts, HYPRE_Int *send_map_elmts, + HYPRE_Int *diag_i, HYPRE_Int *diag_j, HYPRE_Int *offd_i, HYPRE_Int *offd_j, + HYPRE_BigInt *col_map_offd, HYPRE_Real *diag_data, HYPRE_Real *offd_data, + hypre_ParCSRCommHandle **comm_handle_idx, hypre_ParCSRCommHandle **comm_handle_data, + HYPRE_Int *CF_marker, HYPRE_Int *CF_marker_offd, HYPRE_Int skip_fine, HYPRE_Int skip_same_sign ); +hypre_CSRMatrix *hypre_ParCSRMatrixExtractBExt ( hypre_ParCSRMatrix *B, hypre_ParCSRMatrix *A, + HYPRE_Int data ); +hypre_CSRMatrix *hypre_ParCSRMatrixExtractBExt_Overlap ( hypre_ParCSRMatrix *B, + hypre_ParCSRMatrix *A, HYPRE_Int data, hypre_ParCSRCommHandle **comm_handle_idx, + hypre_ParCSRCommHandle **comm_handle_data, HYPRE_Int *CF_marker, HYPRE_Int *CF_marker_offd, + HYPRE_Int skip_fine, HYPRE_Int skip_same_sign ); +HYPRE_Int hypre_ParCSRMatrixExtractBExtDeviceInit( hypre_ParCSRMatrix *B, hypre_ParCSRMatrix *A, + HYPRE_Int want_data, void **request_ptr); hypre_CSRMatrix* hypre_ParCSRMatrixExtractBExtDeviceWait(void *request); -hypre_CSRMatrix* hypre_ParCSRMatrixExtractBExtDevice( hypre_ParCSRMatrix *B, hypre_ParCSRMatrix *A, HYPRE_Int want_data ); -HYPRE_Int hypre_ParCSRMatrixTranspose ( hypre_ParCSRMatrix *A , hypre_ParCSRMatrix **AT_ptr , HYPRE_Int data ); -HYPRE_Int hypre_ParCSRMatrixTransposeHost ( hypre_ParCSRMatrix *A , hypre_ParCSRMatrix **AT_ptr , HYPRE_Int data ); -HYPRE_Int hypre_ParCSRMatrixTransposeDevice ( hypre_ParCSRMatrix *A , hypre_ParCSRMatrix **AT_ptr , HYPRE_Int data ); -void hypre_ParCSRMatrixGenSpanningTree ( hypre_ParCSRMatrix *G_csr , HYPRE_Int **indices , HYPRE_Int G_type ); -void hypre_ParCSRMatrixExtractSubmatrices ( hypre_ParCSRMatrix *A_csr , HYPRE_Int *indices2 , hypre_ParCSRMatrix ***submatrices ); -void hypre_ParCSRMatrixExtractRowSubmatrices ( hypre_ParCSRMatrix *A_csr , HYPRE_Int *indices2 , hypre_ParCSRMatrix ***submatrices ); +hypre_CSRMatrix* hypre_ParCSRMatrixExtractBExtDevice( hypre_ParCSRMatrix *B, hypre_ParCSRMatrix *A, + HYPRE_Int want_data ); +HYPRE_Int hypre_ParCSRMatrixLocalTranspose( hypre_ParCSRMatrix *A ); +HYPRE_Int hypre_ParCSRMatrixTranspose ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **AT_ptr, + HYPRE_Int data ); +HYPRE_Int hypre_ParCSRMatrixTransposeHost ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **AT_ptr, + HYPRE_Int data ); +HYPRE_Int hypre_ParCSRMatrixTransposeDevice ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **AT_ptr, + HYPRE_Int data ); +void hypre_ParCSRMatrixGenSpanningTree ( hypre_ParCSRMatrix *G_csr, HYPRE_Int **indices, + HYPRE_Int G_type ); +void hypre_ParCSRMatrixExtractSubmatrices ( hypre_ParCSRMatrix *A_csr, HYPRE_Int *indices2, + hypre_ParCSRMatrix ***submatrices ); +void hypre_ParCSRMatrixExtractRowSubmatrices ( hypre_ParCSRMatrix *A_csr, HYPRE_Int *indices2, + hypre_ParCSRMatrix ***submatrices ); HYPRE_Complex hypre_ParCSRMatrixLocalSumElts ( hypre_ParCSRMatrix *A ); -HYPRE_Int hypre_ParCSRMatrixAminvDB ( hypre_ParCSRMatrix *A , hypre_ParCSRMatrix *B , HYPRE_Complex *d , hypre_ParCSRMatrix **C_ptr ); -hypre_ParCSRMatrix *hypre_ParTMatmul ( hypre_ParCSRMatrix *A , hypre_ParCSRMatrix *B ); +HYPRE_Int hypre_ParCSRMatrixAminvDB ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B, + HYPRE_Complex *d, hypre_ParCSRMatrix **C_ptr ); +hypre_ParCSRMatrix *hypre_ParTMatmul ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B ); HYPRE_Real hypre_ParCSRMatrixFnorm( hypre_ParCSRMatrix *A ); -HYPRE_Int hypre_ParCSRMatrixInfNorm ( hypre_ParCSRMatrix *A , HYPRE_Real *norm ); -HYPRE_Int hypre_ExchangeExternalRowsInit( hypre_CSRMatrix *B_ext, hypre_ParCSRCommPkg *comm_pkg_A, void **request_ptr); +HYPRE_Int hypre_ParCSRMatrixInfNorm ( hypre_ParCSRMatrix *A, HYPRE_Real *norm ); +HYPRE_Int hypre_ExchangeExternalRowsInit( hypre_CSRMatrix *B_ext, hypre_ParCSRCommPkg *comm_pkg_A, + void **request_ptr); hypre_CSRMatrix* hypre_ExchangeExternalRowsWait(void *vequest); -HYPRE_Int hypre_ExchangeExternalRowsDeviceInit( hypre_CSRMatrix *B_ext, hypre_ParCSRCommPkg *comm_pkg_A, HYPRE_Int want_data, void **request_ptr); +HYPRE_Int hypre_ExchangeExternalRowsDeviceInit( hypre_CSRMatrix *B_ext, + hypre_ParCSRCommPkg *comm_pkg_A, HYPRE_Int want_data, void **request_ptr); hypre_CSRMatrix* hypre_ExchangeExternalRowsDeviceWait(void *vrequest); -HYPRE_Int hypre_ParCSRMatrixGenerateFFFCDevice( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker_host, HYPRE_BigInt *cpts_starts, hypre_ParCSRMatrix *S, hypre_ParCSRMatrix **A_FC_ptr, hypre_ParCSRMatrix **A_FF_ptr ); -HYPRE_Int hypre_ParCSRMatrixGenerateFFCFDevice( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker_host, HYPRE_BigInt *cpts_starts, hypre_ParCSRMatrix *S, hypre_ParCSRMatrix **A_CF_ptr, hypre_ParCSRMatrix **A_FF_ptr ); +HYPRE_Int hypre_ParCSRMatrixGenerateFFFCDevice( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + HYPRE_BigInt *cpts_starts, hypre_ParCSRMatrix *S, + hypre_ParCSRMatrix **A_FC_ptr, + hypre_ParCSRMatrix **A_FF_ptr ); +HYPRE_Int hypre_ParCSRMatrixGenerateFFCFDevice( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + HYPRE_BigInt *cpts_starts, hypre_ParCSRMatrix *S, + hypre_ParCSRMatrix **A_CF_ptr, + hypre_ParCSRMatrix **A_FF_ptr ); +HYPRE_Int hypre_ParCSRMatrixGenerateCCCFDevice( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + HYPRE_BigInt *cpts_starts, hypre_ParCSRMatrix *S, + hypre_ParCSRMatrix **A_CF_ptr, + hypre_ParCSRMatrix **A_CC_ptr ); hypre_CSRMatrix* hypre_ConcatDiagAndOffdDevice(hypre_ParCSRMatrix *A); -HYPRE_Int hypre_ConcatDiagOffdAndExtDevice(hypre_ParCSRMatrix *A, hypre_CSRMatrix *E, hypre_CSRMatrix **B_ptr, HYPRE_Int *num_cols_offd_ptr, HYPRE_BigInt **cols_map_offd_ptr); -HYPRE_Int hypre_ParCSRMatrixGetRowDevice( hypre_ParCSRMatrix *mat, HYPRE_BigInt row, HYPRE_Int *size, HYPRE_BigInt **col_ind, HYPRE_Complex **values ); -HYPRE_Int hypre_ParCSRDiagScale( HYPRE_ParCSRMatrix HA, HYPRE_ParVector Hy, HYPRE_ParVector Hx ); -HYPRE_Int hypre_ParCSRMatrixDropSmallEntries( hypre_ParCSRMatrix *A, HYPRE_Real tol, HYPRE_Int type); -HYPRE_Int hypre_ParCSRMatrixDropSmallEntriesHost( hypre_ParCSRMatrix *A, HYPRE_Real tol, HYPRE_Int type); -HYPRE_Int hypre_ParCSRMatrixDropSmallEntriesDevice( hypre_ParCSRMatrix *A, HYPRE_Complex tol, HYPRE_Int type); +HYPRE_Int hypre_ConcatDiagOffdAndExtDevice(hypre_ParCSRMatrix *A, hypre_CSRMatrix *E, + hypre_CSRMatrix **B_ptr, HYPRE_Int *num_cols_offd_ptr, HYPRE_BigInt **cols_map_offd_ptr); +HYPRE_Int hypre_ParCSRMatrixGetRowDevice( hypre_ParCSRMatrix *mat, HYPRE_BigInt row, + HYPRE_Int *size, HYPRE_BigInt **col_ind, HYPRE_Complex **values ); +HYPRE_Int hypre_ParCSRDiagScaleVector( hypre_ParCSRMatrix *par_A, hypre_ParVector *par_y, + hypre_ParVector *par_x ); +HYPRE_Int hypre_ParCSRDiagScaleVectorHost( hypre_ParCSRMatrix *par_A, hypre_ParVector *par_y, + hypre_ParVector *par_x ); +HYPRE_Int hypre_ParCSRDiagScaleVectorDevice( hypre_ParCSRMatrix *par_A, hypre_ParVector *par_y, + hypre_ParVector *par_x ); +HYPRE_Int hypre_ParCSRMatrixDropSmallEntries( hypre_ParCSRMatrix *A, HYPRE_Real tol, + HYPRE_Int type); +HYPRE_Int hypre_ParCSRMatrixDropSmallEntriesHost( hypre_ParCSRMatrix *A, HYPRE_Real tol, + HYPRE_Int type); +HYPRE_Int hypre_ParCSRMatrixDropSmallEntriesDevice( hypre_ParCSRMatrix *A, HYPRE_Complex tol, + HYPRE_Int type); + +HYPRE_Int hypre_ParCSRCommPkgCreateMatrixE( hypre_ParCSRCommPkg *comm_pkg, HYPRE_Int local_ncols ); #ifdef HYPRE_USING_PERSISTENT_COMM -hypre_ParCSRPersistentCommHandle* hypre_ParCSRPersistentCommHandleCreate(HYPRE_Int job, hypre_ParCSRCommPkg *comm_pkg); -hypre_ParCSRPersistentCommHandle* hypre_ParCSRCommPkgGetPersistentCommHandle(HYPRE_Int job, hypre_ParCSRCommPkg *comm_pkg); +hypre_ParCSRPersistentCommHandle* hypre_ParCSRPersistentCommHandleCreate(HYPRE_Int job, + hypre_ParCSRCommPkg *comm_pkg); +hypre_ParCSRPersistentCommHandle* hypre_ParCSRCommPkgGetPersistentCommHandle(HYPRE_Int job, + hypre_ParCSRCommPkg *comm_pkg); void hypre_ParCSRPersistentCommHandleDestroy(hypre_ParCSRPersistentCommHandle *comm_handle); -void hypre_ParCSRPersistentCommHandleStart(hypre_ParCSRPersistentCommHandle *comm_handle, HYPRE_MemoryLocation send_memory_location, void *send_data); -void hypre_ParCSRPersistentCommHandleWait(hypre_ParCSRPersistentCommHandle *comm_handle, HYPRE_MemoryLocation recv_memory_location, void *recv_data); +void hypre_ParCSRPersistentCommHandleStart(hypre_ParCSRPersistentCommHandle *comm_handle, + HYPRE_MemoryLocation send_memory_location, void *send_data); +void hypre_ParCSRPersistentCommHandleWait(hypre_ParCSRPersistentCommHandle *comm_handle, + HYPRE_MemoryLocation recv_memory_location, void *recv_data); #endif -HYPRE_Int hypre_ParcsrGetExternalRowsInit( hypre_ParCSRMatrix *A, HYPRE_Int indices_len, HYPRE_BigInt *indices, hypre_ParCSRCommPkg *comm_pkg, HYPRE_Int want_data, void **request_ptr); +HYPRE_Int hypre_ParcsrGetExternalRowsInit( hypre_ParCSRMatrix *A, HYPRE_Int indices_len, + HYPRE_BigInt *indices, hypre_ParCSRCommPkg *comm_pkg, HYPRE_Int want_data, void **request_ptr); hypre_CSRMatrix* hypre_ParcsrGetExternalRowsWait(void *vrequest); -HYPRE_Int hypre_ParcsrGetExternalRowsDeviceInit( hypre_ParCSRMatrix *A, HYPRE_Int indices_len, HYPRE_BigInt *indices, hypre_ParCSRCommPkg *comm_pkg, HYPRE_Int want_data, void **request_ptr); +HYPRE_Int hypre_ParcsrGetExternalRowsDeviceInit( hypre_ParCSRMatrix *A, HYPRE_Int indices_len, + HYPRE_BigInt *indices, hypre_ParCSRCommPkg *comm_pkg, HYPRE_Int want_data, void **request_ptr); hypre_CSRMatrix* hypre_ParcsrGetExternalRowsDeviceWait(void *vrequest); -HYPRE_Int hypre_ParvecBdiagInvScal( hypre_ParVector *b, HYPRE_Int blockSize, hypre_ParVector **bs, hypre_ParCSRMatrix *A); +HYPRE_Int hypre_ParvecBdiagInvScal( hypre_ParVector *b, HYPRE_Int blockSize, hypre_ParVector **bs, + hypre_ParCSRMatrix *A); -HYPRE_Int hypre_ParcsrBdiagInvScal( hypre_ParCSRMatrix *A, HYPRE_Int blockSize, hypre_ParCSRMatrix **As); +HYPRE_Int hypre_ParcsrBdiagInvScal( hypre_ParCSRMatrix *A, HYPRE_Int blockSize, + hypre_ParCSRMatrix **As); -HYPRE_Int hypre_ParCSRMatrixExtractSubmatrixFC( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, HYPRE_BigInt *cpts_starts, const char *job, hypre_ParCSRMatrix **B_ptr, HYPRE_Real strength_thresh); +HYPRE_Int hypre_ParCSRMatrixExtractSubmatrixFC( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, + HYPRE_BigInt *cpts_starts, const char *job, + hypre_ParCSRMatrix **B_ptr, + HYPRE_Real strength_thresh); +HYPRE_Int hypre_ParCSRMatrixDiagScale( hypre_ParCSRMatrix *par_A, hypre_ParVector *par_ld, + hypre_ParVector *par_rd ); HYPRE_Int hypre_ParCSRMatrixReorder ( hypre_ParCSRMatrix *A ); -HYPRE_Int hypre_ParCSRMatrixAdd( HYPRE_Complex alpha, hypre_ParCSRMatrix *A, HYPRE_Complex beta, hypre_ParCSRMatrix *B, hypre_ParCSRMatrix **Cout); -HYPRE_Int hypre_ParCSRMatrixAddHost( HYPRE_Complex alpha, hypre_ParCSRMatrix *A, HYPRE_Complex beta, hypre_ParCSRMatrix *B, hypre_ParCSRMatrix **Cout); -HYPRE_Int hypre_ParCSRMatrixAddDevice( HYPRE_Complex alpha, hypre_ParCSRMatrix *A, HYPRE_Complex beta, hypre_ParCSRMatrix *B, hypre_ParCSRMatrix **Cout); +HYPRE_Int hypre_ParCSRMatrixAdd( HYPRE_Complex alpha, hypre_ParCSRMatrix *A, HYPRE_Complex beta, + hypre_ParCSRMatrix *B, hypre_ParCSRMatrix **Cout); +HYPRE_Int hypre_ParCSRMatrixAddHost( HYPRE_Complex alpha, hypre_ParCSRMatrix *A, + HYPRE_Complex beta, hypre_ParCSRMatrix *B, + hypre_ParCSRMatrix **Cout); +HYPRE_Int hypre_ParCSRMatrixAddDevice( HYPRE_Complex alpha, hypre_ParCSRMatrix *A, + HYPRE_Complex beta, hypre_ParCSRMatrix *B, + hypre_ParCSRMatrix **Cout); +HYPRE_Int hypre_ParCSRMatrixBlockColSum( hypre_ParCSRMatrix *A, HYPRE_Int row_major, + HYPRE_Int num_rows_block, HYPRE_Int num_cols_block, + hypre_DenseBlockMatrix **B_ptr ); +HYPRE_Int hypre_ParCSRMatrixColSum( hypre_ParCSRMatrix *A, hypre_ParVector **B_ptr ); + +/* par_csr_filter_device.c */ +HYPRE_Int hypre_ParCSRMatrixBlkFilterDevice(hypre_ParCSRMatrix *A, HYPRE_Int block_size, + hypre_ParCSRMatrix **B_ptr); + +/* par_csr_matop_device.c */ +HYPRE_Int hypre_ParCSRMatrixDiagScaleDevice ( hypre_ParCSRMatrix *par_A, hypre_ParVector *par_ld, + hypre_ParVector *par_rd ); +HYPRE_Int hypre_ParCSRMatrixCompressOffdMapDevice(hypre_ParCSRMatrix *A); +HYPRE_Int hypre_ParCSRMatrixCompressOffdMap(hypre_ParCSRMatrix *A); /* par_csr_matop_marked.c */ -void hypre_ParMatmul_RowSizes_Marked ( HYPRE_Int **C_diag_i , HYPRE_Int **C_offd_i , HYPRE_Int **B_marker , HYPRE_Int *A_diag_i , HYPRE_Int *A_diag_j , HYPRE_Int *A_offd_i , HYPRE_Int *A_offd_j , HYPRE_Int *B_diag_i , HYPRE_Int *B_diag_j , HYPRE_Int *B_offd_i , HYPRE_Int *B_offd_j , HYPRE_Int *B_ext_diag_i , HYPRE_Int *B_ext_diag_j , HYPRE_Int *B_ext_offd_i , HYPRE_Int *B_ext_offd_j , HYPRE_Int *map_B_to_C , HYPRE_Int *C_diag_size , HYPRE_Int *C_offd_size , HYPRE_Int num_rows_diag_A , HYPRE_Int num_cols_offd_A , HYPRE_Int allsquare , HYPRE_Int num_cols_diag_B , HYPRE_Int num_cols_offd_B , HYPRE_Int num_cols_offd_C , HYPRE_Int *CF_marker , HYPRE_Int *dof_func , HYPRE_Int *dof_func_offd ); -hypre_ParCSRMatrix *hypre_ParMatmul_FC ( hypre_ParCSRMatrix *A , hypre_ParCSRMatrix *P , HYPRE_Int *CF_marker , HYPRE_Int *dof_func , HYPRE_Int *dof_func_offd ); -void hypre_ParMatScaleDiagInv_F ( hypre_ParCSRMatrix *C , hypre_ParCSRMatrix *A , HYPRE_Complex weight , HYPRE_Int *CF_marker ); -hypre_ParCSRMatrix *hypre_ParMatMinus_F ( hypre_ParCSRMatrix *P , hypre_ParCSRMatrix *C , HYPRE_Int *CF_marker ); -void hypre_ParCSRMatrixZero_F ( hypre_ParCSRMatrix *P , HYPRE_Int *CF_marker ); -void hypre_ParCSRMatrixCopy_C ( hypre_ParCSRMatrix *P , hypre_ParCSRMatrix *C , HYPRE_Int *CF_marker ); -void hypre_ParCSRMatrixDropEntries ( hypre_ParCSRMatrix *C , hypre_ParCSRMatrix *P , HYPRE_Int *CF_marker ); +void hypre_ParMatmul_RowSizes_Marked ( HYPRE_Int **C_diag_i, HYPRE_Int **C_offd_i, + HYPRE_Int **B_marker, HYPRE_Int *A_diag_i, + HYPRE_Int *A_diag_j, HYPRE_Int *A_offd_i, + HYPRE_Int *A_offd_j, HYPRE_Int *B_diag_i, + HYPRE_Int *B_diag_j, HYPRE_Int *B_offd_i, + HYPRE_Int *B_offd_j, HYPRE_Int *B_ext_diag_i, + HYPRE_Int *B_ext_diag_j, HYPRE_Int *B_ext_offd_i, + HYPRE_Int *B_ext_offd_j, HYPRE_Int *map_B_to_C, + HYPRE_Int *C_diag_size, HYPRE_Int *C_offd_size, + HYPRE_Int num_rows_diag_A, HYPRE_Int num_cols_offd_A, + HYPRE_Int allsquare, HYPRE_Int num_cols_diag_B, + HYPRE_Int num_cols_offd_B, HYPRE_Int num_cols_offd_C, + HYPRE_Int *CF_marker, HYPRE_Int *dof_func, + HYPRE_Int *dof_func_offd ); +hypre_ParCSRMatrix *hypre_ParMatmul_FC ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P, + HYPRE_Int *CF_marker, HYPRE_Int *dof_func, + HYPRE_Int *dof_func_offd ); +void hypre_ParMatScaleDiagInv_F ( hypre_ParCSRMatrix *C, hypre_ParCSRMatrix *A, + HYPRE_Complex weight, HYPRE_Int *CF_marker ); +hypre_ParCSRMatrix *hypre_ParMatMinus_F ( hypre_ParCSRMatrix *P, hypre_ParCSRMatrix *C, + HYPRE_Int *CF_marker ); +void hypre_ParCSRMatrixZero_F ( hypre_ParCSRMatrix *P, HYPRE_Int *CF_marker ); +void hypre_ParCSRMatrixCopy_C ( hypre_ParCSRMatrix *P, hypre_ParCSRMatrix *C, + HYPRE_Int *CF_marker ); +void hypre_ParCSRMatrixDropEntries ( hypre_ParCSRMatrix *C, hypre_ParCSRMatrix *P, + HYPRE_Int *CF_marker ); /* par_csr_matrix.c */ -hypre_ParCSRMatrix *hypre_ParCSRMatrixCreate ( MPI_Comm comm , HYPRE_BigInt global_num_rows , HYPRE_BigInt global_num_cols , HYPRE_BigInt *row_starts_in , HYPRE_BigInt *col_starts_in , HYPRE_Int num_cols_offd , HYPRE_Int num_nonzeros_diag , HYPRE_Int num_nonzeros_offd ); +hypre_ParCSRMatrix *hypre_ParCSRMatrixCreate ( MPI_Comm comm, HYPRE_BigInt global_num_rows, + HYPRE_BigInt global_num_cols, + HYPRE_BigInt *row_starts_in, + HYPRE_BigInt *col_starts_in, + HYPRE_Int num_cols_offd, + HYPRE_Int num_nonzeros_diag, + HYPRE_Int num_nonzeros_offd ); HYPRE_Int hypre_ParCSRMatrixDestroy ( hypre_ParCSRMatrix *matrix ); -HYPRE_Int hypre_ParCSRMatrixInitialize_v2( hypre_ParCSRMatrix *matrix, HYPRE_MemoryLocation memory_location ); +HYPRE_Int hypre_ParCSRMatrixInitialize_v2( hypre_ParCSRMatrix *matrix, + HYPRE_MemoryLocation memory_location ); HYPRE_Int hypre_ParCSRMatrixInitialize ( hypre_ParCSRMatrix *matrix ); HYPRE_Int hypre_ParCSRMatrixSetNumNonzeros ( hypre_ParCSRMatrix *matrix ); HYPRE_Int hypre_ParCSRMatrixSetDNumNonzeros ( hypre_ParCSRMatrix *matrix ); HYPRE_Int hypre_ParCSRMatrixSetNumRownnz ( hypre_ParCSRMatrix *matrix ); -HYPRE_Int hypre_ParCSRMatrixSetDataOwner ( hypre_ParCSRMatrix *matrix , HYPRE_Int owns_data ); -hypre_ParCSRMatrix *hypre_ParCSRMatrixRead ( MPI_Comm comm , const char *file_name ); -HYPRE_Int hypre_ParCSRMatrixPrint ( hypre_ParCSRMatrix *matrix , const char *file_name ); -HYPRE_Int hypre_ParCSRMatrixPrintIJ ( const hypre_ParCSRMatrix *matrix , const HYPRE_Int base_i , const HYPRE_Int base_j , const char *filename ); -HYPRE_Int hypre_ParCSRMatrixReadIJ ( MPI_Comm comm , const char *filename , HYPRE_Int *base_i_ptr , HYPRE_Int *base_j_ptr , hypre_ParCSRMatrix **matrix_ptr ); -HYPRE_Int hypre_ParCSRMatrixGetLocalRange ( hypre_ParCSRMatrix *matrix , HYPRE_BigInt *row_start , HYPRE_BigInt *row_end , HYPRE_BigInt *col_start , HYPRE_BigInt *col_end ); -HYPRE_Int hypre_ParCSRMatrixGetRow ( hypre_ParCSRMatrix *mat , HYPRE_BigInt row , HYPRE_Int *size , HYPRE_BigInt **col_ind , HYPRE_Complex **values ); -HYPRE_Int hypre_ParCSRMatrixRestoreRow ( hypre_ParCSRMatrix *matrix , HYPRE_BigInt row , HYPRE_Int *size , HYPRE_BigInt **col_ind , HYPRE_Complex **values ); -hypre_ParCSRMatrix *hypre_CSRMatrixToParCSRMatrix ( MPI_Comm comm , hypre_CSRMatrix *A , HYPRE_BigInt *row_starts , HYPRE_BigInt *col_starts ); -HYPRE_Int GenerateDiagAndOffd ( hypre_CSRMatrix *A , hypre_ParCSRMatrix *matrix , HYPRE_BigInt first_col_diag , HYPRE_BigInt last_col_diag ); +HYPRE_Int hypre_ParCSRMatrixSetDataOwner ( hypre_ParCSRMatrix *matrix, HYPRE_Int owns_data ); +HYPRE_Int hypre_ParCSRMatrixSetPatternOnly( hypre_ParCSRMatrix *matrix, HYPRE_Int pattern_only); +hypre_ParCSRMatrix* hypre_ParCSRMatrixCreateFromDenseBlockMatrix(MPI_Comm comm, + HYPRE_BigInt global_num_rows, + HYPRE_BigInt global_num_cols, + HYPRE_BigInt *row_starts, + HYPRE_BigInt *col_starts, + hypre_DenseBlockMatrix *B); +hypre_ParCSRMatrix* hypre_ParCSRMatrixCreateFromParVector(hypre_ParVector *b, + HYPRE_BigInt global_num_rows, + HYPRE_BigInt global_num_cols, + HYPRE_BigInt *row_starts, + HYPRE_BigInt *col_starts); +hypre_ParCSRMatrix *hypre_ParCSRMatrixRead ( MPI_Comm comm, const char *file_name ); +HYPRE_Int hypre_ParCSRMatrixPrint ( hypre_ParCSRMatrix *matrix, const char *file_name ); +HYPRE_Int hypre_ParCSRMatrixPrintIJ ( const hypre_ParCSRMatrix *matrix, const HYPRE_Int base_i, + const HYPRE_Int base_j, const char *filename ); +HYPRE_Int hypre_ParCSRMatrixPrintBinaryIJ ( hypre_ParCSRMatrix *matrix, HYPRE_Int base_i, + HYPRE_Int base_j, const char *filename ); +HYPRE_Int hypre_ParCSRMatrixReadIJ ( MPI_Comm comm, const char *filename, HYPRE_Int *base_i_ptr, + HYPRE_Int *base_j_ptr, hypre_ParCSRMatrix **matrix_ptr ); +HYPRE_Int hypre_ParCSRMatrixGetLocalRange ( hypre_ParCSRMatrix *matrix, HYPRE_BigInt *row_start, + HYPRE_BigInt *row_end, HYPRE_BigInt *col_start, HYPRE_BigInt *col_end ); +HYPRE_Int hypre_ParCSRMatrixGetRow ( hypre_ParCSRMatrix *mat, HYPRE_BigInt row, HYPRE_Int *size, + HYPRE_BigInt **col_ind, HYPRE_Complex **values ); +HYPRE_Int hypre_ParCSRMatrixRestoreRow ( hypre_ParCSRMatrix *matrix, HYPRE_BigInt row, + HYPRE_Int *size, HYPRE_BigInt **col_ind, HYPRE_Complex **values ); +hypre_ParCSRMatrix *hypre_CSRMatrixToParCSRMatrix ( MPI_Comm comm, hypre_CSRMatrix *A, + HYPRE_BigInt *row_starts, HYPRE_BigInt *col_starts ); +HYPRE_Int GenerateDiagAndOffd ( hypre_CSRMatrix *A, hypre_ParCSRMatrix *matrix, + HYPRE_BigInt first_col_diag, HYPRE_BigInt last_col_diag ); hypre_CSRMatrix *hypre_MergeDiagAndOffd ( hypre_ParCSRMatrix *par_matrix ); hypre_CSRMatrix *hypre_MergeDiagAndOffdDevice ( hypre_ParCSRMatrix *par_matrix ); hypre_CSRMatrix *hypre_ParCSRMatrixToCSRMatrixAll ( hypre_ParCSRMatrix *par_matrix ); -HYPRE_Int hypre_ParCSRMatrixCopy ( hypre_ParCSRMatrix *A , hypre_ParCSRMatrix *B , HYPRE_Int copy_data ); -HYPRE_Int hypre_FillResponseParToCSRMatrix ( void *p_recv_contact_buf , HYPRE_Int contact_size , HYPRE_Int contact_proc , void *ro , MPI_Comm comm , void **p_send_response_buf , HYPRE_Int *response_message_size ); -hypre_ParCSRMatrix *hypre_ParCSRMatrixUnion ( hypre_ParCSRMatrix *A , hypre_ParCSRMatrix *B ); +hypre_CSRMatrix *hypre_ParCSRMatrixToCSRMatrixAll_v2 ( hypre_ParCSRMatrix *par_matrix, + HYPRE_MemoryLocation memory_location ); +HYPRE_Int hypre_ParCSRMatrixCopy ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B, + HYPRE_Int copy_data ); +HYPRE_Int hypre_FillResponseParToCSRMatrix ( void *p_recv_contact_buf, HYPRE_Int contact_size, + HYPRE_Int contact_proc, void *ro, MPI_Comm comm, void **p_send_response_buf, + HYPRE_Int *response_message_size ); +hypre_ParCSRMatrix *hypre_ParCSRMatrixUnion ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B ); hypre_ParCSRMatrix* hypre_ParCSRMatrixClone ( hypre_ParCSRMatrix *A, HYPRE_Int copy_data ); #define hypre_ParCSRMatrixCompleteClone(A) hypre_ParCSRMatrixClone(A,0) -hypre_ParCSRMatrix* hypre_ParCSRMatrixClone_v2 ( hypre_ParCSRMatrix *A, HYPRE_Int copy_data, HYPRE_MemoryLocation memory_location ); +hypre_ParCSRMatrix* hypre_ParCSRMatrixClone_v2 ( hypre_ParCSRMatrix *A, HYPRE_Int copy_data, + HYPRE_MemoryLocation memory_location ); +HYPRE_Int hypre_ParCSRMatrixTruncate(hypre_ParCSRMatrix *A, HYPRE_Real tol, + HYPRE_Int max_row_elmts, HYPRE_Int rescale, + HYPRE_Int nrm_type); HYPRE_Int hypre_ParCSRMatrixMigrate(hypre_ParCSRMatrix *A, HYPRE_MemoryLocation memory_location); HYPRE_Int hypre_ParCSRMatrixSetConstantValues( hypre_ParCSRMatrix *A, HYPRE_Complex value ); void hypre_ParCSRMatrixCopyColMapOffdToDevice(hypre_ParCSRMatrix *A); +void hypre_ParCSRMatrixCopyColMapOffdToHost(hypre_ParCSRMatrix *A); + +/* par_csr_matrix_stats.c */ +HYPRE_Int hypre_ParCSRMatrixStatsArrayCompute( HYPRE_Int num_matrices, + hypre_ParCSRMatrix **matrices, + hypre_MatrixStatsArray *stats_array ); + +/* par_csr_matmat_device.c */ +HYPRE_Int hypre_ParCSRMatMatDiagDevice( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *BT, + hypre_ParCSRMatrix *C ); + +/* par_csr_matmat.c */ +HYPRE_Int hypre_ParCSRMatMatDiag( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B, + hypre_ParCSRMatrix **C_ptr ); /* par_csr_matvec.c */ // y = alpha*A*x + beta*b -HYPRE_Int hypre_ParCSRMatrixMatvecOutOfPlace ( HYPRE_Complex alpha , hypre_ParCSRMatrix *A , hypre_ParVector *x , HYPRE_Complex beta , hypre_ParVector *b, hypre_ParVector *y ); +HYPRE_Int hypre_ParCSRMatrixMatvecOutOfPlace ( HYPRE_Complex alpha, hypre_ParCSRMatrix *A, + hypre_ParVector *x, HYPRE_Complex beta, + hypre_ParVector *b, hypre_ParVector *y ); +HYPRE_Int hypre_ParCSRMatrixMatvecOutOfPlaceDevice ( HYPRE_Complex alpha, hypre_ParCSRMatrix *A, + hypre_ParVector *x, HYPRE_Complex beta, + hypre_ParVector *b, hypre_ParVector *y ); // y = alpha*A*x + beta*y -HYPRE_Int hypre_ParCSRMatrixMatvec ( HYPRE_Complex alpha , hypre_ParCSRMatrix *A , hypre_ParVector *x , HYPRE_Complex beta , hypre_ParVector *y ); -HYPRE_Int hypre_ParCSRMatrixMatvecT ( HYPRE_Complex alpha , hypre_ParCSRMatrix *A , hypre_ParVector *x , HYPRE_Complex beta , hypre_ParVector *y ); -HYPRE_Int hypre_ParCSRMatrixMatvec_FF ( HYPRE_Complex alpha , hypre_ParCSRMatrix *A , hypre_ParVector *x , HYPRE_Complex beta , hypre_ParVector *y , HYPRE_Int *CF_marker , HYPRE_Int fpt ); +HYPRE_Int hypre_ParCSRMatrixMatvec ( HYPRE_Complex alpha, hypre_ParCSRMatrix *A, hypre_ParVector *x, + HYPRE_Complex beta, hypre_ParVector *y ); +HYPRE_Int hypre_ParCSRMatrixMatvecT ( HYPRE_Complex alpha, hypre_ParCSRMatrix *A, + hypre_ParVector *x, HYPRE_Complex beta, hypre_ParVector *y ); +HYPRE_Int hypre_ParCSRMatrixMatvecTDevice ( HYPRE_Complex alpha, hypre_ParCSRMatrix *A, + hypre_ParVector *x, HYPRE_Complex beta, + hypre_ParVector *y ); +HYPRE_Int hypre_ParCSRMatrixMatvecT_unpack( hypre_ParCSRCommPkg *comm_pkg, HYPRE_Int num_cols, + HYPRE_Complex *recv_data, HYPRE_Complex *local_data ); +HYPRE_Int hypre_ParCSRMatrixMatvec_FF ( HYPRE_Complex alpha, hypre_ParCSRMatrix *A, + hypre_ParVector *x, HYPRE_Complex beta, hypre_ParVector *y, + HYPRE_Int *CF_marker, HYPRE_Int fpt ); /* par_csr_triplemat.c */ +HYPRE_Int hypre_ParCSRTMatMatPartialAddDevice( hypre_ParCSRCommPkg *comm_pkg_A, + HYPRE_Int num_cols_A, HYPRE_Int num_cols_B, HYPRE_BigInt first_col_diag_B, + HYPRE_BigInt last_col_diag_B, HYPRE_Int num_cols_offd_B, HYPRE_BigInt *col_map_offd_B, + HYPRE_Int local_nnz_Cbar, hypre_CSRMatrix *Cbar, hypre_CSRMatrix *Cext, + hypre_CSRMatrix **C_diag_ptr, hypre_CSRMatrix **C_offd_ptr, HYPRE_Int *num_cols_offd_C_ptr, + HYPRE_BigInt **col_map_offd_C_ptr ); hypre_ParCSRMatrix *hypre_ParCSRMatMat( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B ); hypre_ParCSRMatrix *hypre_ParCSRMatMatHost( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B ); hypre_ParCSRMatrix *hypre_ParCSRMatMatDevice( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B ); - -hypre_ParCSRMatrix *hypre_ParCSRTMatMatKTHost( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B, HYPRE_Int keep_transpose); -hypre_ParCSRMatrix *hypre_ParCSRTMatMatKTDevice( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B, HYPRE_Int keep_transpose); -hypre_ParCSRMatrix *hypre_ParCSRTMatMatKT( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B, HYPRE_Int keep_transpose); +hypre_ParCSRMatrix *hypre_ParCSRTMatMatKTHost( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B, + HYPRE_Int keep_transpose); +hypre_ParCSRMatrix *hypre_ParCSRTMatMatKTDevice( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B, + HYPRE_Int keep_transpose); +hypre_ParCSRMatrix *hypre_ParCSRTMatMatKT( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B, + HYPRE_Int keep_transpose); hypre_ParCSRMatrix *hypre_ParCSRTMatMat( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B); -hypre_ParCSRMatrix *hypre_ParCSRMatrixRAPKT( hypre_ParCSRMatrix *R, hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P , HYPRE_Int keepTranspose ); -hypre_ParCSRMatrix *hypre_ParCSRMatrixRAP( hypre_ParCSRMatrix *R, hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P ); -hypre_ParCSRMatrix* hypre_ParCSRMatrixRAPKTDevice( hypre_ParCSRMatrix *R, hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P, HYPRE_Int keep_transpose ); -hypre_ParCSRMatrix* hypre_ParCSRMatrixRAPKTHost( hypre_ParCSRMatrix *R, hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P, HYPRE_Int keep_transpose ); +hypre_ParCSRMatrix *hypre_ParCSRMatrixRAPKT( hypre_ParCSRMatrix *R, hypre_ParCSRMatrix *A, + hypre_ParCSRMatrix *P, HYPRE_Int keepTranspose ); +hypre_ParCSRMatrix *hypre_ParCSRMatrixRAP( hypre_ParCSRMatrix *R, hypre_ParCSRMatrix *A, + hypre_ParCSRMatrix *P ); +hypre_ParCSRMatrix* hypre_ParCSRMatrixRAPKTDevice( hypre_ParCSRMatrix *R, hypre_ParCSRMatrix *A, + hypre_ParCSRMatrix *P, HYPRE_Int keep_transpose ); +hypre_ParCSRMatrix* hypre_ParCSRMatrixRAPKTHost( hypre_ParCSRMatrix *R, hypre_ParCSRMatrix *A, + hypre_ParCSRMatrix *P, HYPRE_Int keep_transpose ); /* par_make_system.c */ -HYPRE_ParCSR_System_Problem *HYPRE_Generate2DSystem ( HYPRE_ParCSRMatrix H_L1 , HYPRE_ParCSRMatrix H_L2 , HYPRE_ParVector H_b1 , HYPRE_ParVector H_b2 , HYPRE_ParVector H_x1 , HYPRE_ParVector H_x2 , HYPRE_Complex *M_vals ); +HYPRE_ParCSR_System_Problem *HYPRE_Generate2DSystem ( HYPRE_ParCSRMatrix H_L1, + HYPRE_ParCSRMatrix H_L2, HYPRE_ParVector H_b1, HYPRE_ParVector H_b2, HYPRE_ParVector H_x1, + HYPRE_ParVector H_x2, HYPRE_Complex *M_vals ); HYPRE_Int HYPRE_Destroy2DSystem ( HYPRE_ParCSR_System_Problem *sys_prob ); /* par_vector.c */ -hypre_ParVector *hypre_ParVectorCreate ( MPI_Comm comm , HYPRE_BigInt global_size , HYPRE_BigInt *partitioning_in ); -hypre_ParVector *hypre_ParMultiVectorCreate ( MPI_Comm comm , HYPRE_BigInt global_size , HYPRE_BigInt *partitioning , HYPRE_Int num_vectors ); +hypre_ParVector *hypre_ParVectorCreate ( MPI_Comm comm, HYPRE_BigInt global_size, + HYPRE_BigInt *partitioning_in ); +hypre_ParVector *hypre_ParMultiVectorCreate ( MPI_Comm comm, HYPRE_BigInt global_size, + HYPRE_BigInt *partitioning, HYPRE_Int num_vectors ); HYPRE_Int hypre_ParVectorDestroy ( hypre_ParVector *vector ); +HYPRE_Int hypre_ParVectorInitializeShell( hypre_ParVector *vector ); +HYPRE_Int hypre_ParVectorSetData( hypre_ParVector *vector, HYPRE_Complex *data ); HYPRE_Int hypre_ParVectorInitialize ( hypre_ParVector *vector ); -HYPRE_Int hypre_ParVectorInitialize_v2( hypre_ParVector *vector, HYPRE_MemoryLocation memory_location ); -HYPRE_Int hypre_ParVectorSetDataOwner ( hypre_ParVector *vector , HYPRE_Int owns_data ); -HYPRE_Int hypre_ParVectorSetNumVectors ( hypre_ParVector *vector , HYPRE_Int num_vectors ); -hypre_ParVector *hypre_ParVectorRead ( MPI_Comm comm , const char *file_name ); -HYPRE_Int hypre_ParVectorPrint ( hypre_ParVector *vector , const char *file_name ); -HYPRE_Int hypre_ParVectorSetConstantValues ( hypre_ParVector *v , HYPRE_Complex value ); -HYPRE_Int hypre_ParVectorSetRandomValues ( hypre_ParVector *v , HYPRE_Int seed ); -HYPRE_Int hypre_ParVectorCopy ( hypre_ParVector *x , hypre_ParVector *y ); +HYPRE_Int hypre_ParVectorInitialize_v2( hypre_ParVector *vector, + HYPRE_MemoryLocation memory_location ); +HYPRE_Int hypre_ParVectorSetDataOwner ( hypre_ParVector *vector, HYPRE_Int owns_data ); +HYPRE_Int hypre_ParVectorSetLocalSize ( hypre_ParVector *vector, HYPRE_Int local_size ); +HYPRE_Int hypre_ParVectorSetNumVectors ( hypre_ParVector *vector, HYPRE_Int num_vectors ); +HYPRE_Int hypre_ParVectorSetComponent ( hypre_ParVector *vector, HYPRE_Int component ); +HYPRE_Int hypre_ParVectorResize ( hypre_ParVector *vector, HYPRE_Int num_vectors ); +hypre_ParVector *hypre_ParVectorRead ( MPI_Comm comm, const char *file_name ); +HYPRE_Int hypre_ParVectorSetConstantValues ( hypre_ParVector *v, HYPRE_Complex value ); +HYPRE_Int hypre_ParVectorSetZeros( hypre_ParVector *v ); +HYPRE_Int hypre_ParVectorSetRandomValues ( hypre_ParVector *v, HYPRE_Int seed ); +HYPRE_Int hypre_ParVectorCopy ( hypre_ParVector *x, hypre_ParVector *y ); hypre_ParVector *hypre_ParVectorCloneShallow ( hypre_ParVector *x ); -hypre_ParVector *hypre_ParVectorCloneDeep_v2( hypre_ParVector *x, HYPRE_MemoryLocation memory_location ); +hypre_ParVector *hypre_ParVectorCloneDeep_v2( hypre_ParVector *x, + HYPRE_MemoryLocation memory_location ); HYPRE_Int hypre_ParVectorMigrate(hypre_ParVector *x, HYPRE_MemoryLocation memory_location); -HYPRE_Int hypre_ParVectorScale ( HYPRE_Complex alpha , hypre_ParVector *y ); -HYPRE_Int hypre_ParVectorAxpy ( HYPRE_Complex alpha , hypre_ParVector *x , hypre_ParVector *y ); -HYPRE_Int hypre_ParVectorMassAxpy ( HYPRE_Complex *alpha, hypre_ParVector **x, hypre_ParVector *y, HYPRE_Int k, HYPRE_Int unroll); -HYPRE_Real hypre_ParVectorInnerProd ( hypre_ParVector *x , hypre_ParVector *y ); -HYPRE_Int hypre_ParVectorMassInnerProd ( hypre_ParVector *x , hypre_ParVector **y , HYPRE_Int k, HYPRE_Int unroll, HYPRE_Real *prod ); -HYPRE_Int hypre_ParVectorMassDotpTwo ( hypre_ParVector *x , hypre_ParVector *y , hypre_ParVector **z, HYPRE_Int k, HYPRE_Int unroll, HYPRE_Real *prod_x , HYPRE_Real *prod_y ); -hypre_ParVector *hypre_VectorToParVector ( MPI_Comm comm , hypre_Vector *v , HYPRE_BigInt *vec_starts ); +HYPRE_Int hypre_ParVectorScale ( HYPRE_Complex alpha, hypre_ParVector *y ); +HYPRE_Int hypre_ParVectorAxpy ( HYPRE_Complex alpha, hypre_ParVector *x, hypre_ParVector *y ); +HYPRE_Int hypre_ParVectorAxpyz ( HYPRE_Complex alpha, hypre_ParVector *x, + HYPRE_Complex beta, hypre_ParVector *y, + hypre_ParVector *z ); +HYPRE_Int hypre_ParVectorMassAxpy ( HYPRE_Complex *alpha, hypre_ParVector **x, hypre_ParVector *y, + HYPRE_Int k, HYPRE_Int unroll); +HYPRE_Real hypre_ParVectorInnerProd ( hypre_ParVector *x, hypre_ParVector *y ); +HYPRE_Int hypre_ParVectorMassInnerProd ( hypre_ParVector *x, hypre_ParVector **y, HYPRE_Int k, + HYPRE_Int unroll, HYPRE_Real *prod ); +HYPRE_Int hypre_ParVectorMassDotpTwo ( hypre_ParVector *x, hypre_ParVector *y, hypre_ParVector **z, + HYPRE_Int k, HYPRE_Int unroll, HYPRE_Real *prod_x, HYPRE_Real *prod_y ); +hypre_ParVector *hypre_VectorToParVector ( MPI_Comm comm, hypre_Vector *v, + HYPRE_BigInt *vec_starts ); hypre_Vector *hypre_ParVectorToVectorAll ( hypre_ParVector *par_v ); -HYPRE_Int hypre_ParVectorPrintIJ ( hypre_ParVector *vector , HYPRE_Int base_j , const char *filename ); -HYPRE_Int hypre_ParVectorReadIJ ( MPI_Comm comm , const char *filename , HYPRE_Int *base_j_ptr , hypre_ParVector **vector_ptr ); -HYPRE_Int hypre_FillResponseParToVectorAll ( void *p_recv_contact_buf , HYPRE_Int contact_size , HYPRE_Int contact_proc , void *ro , MPI_Comm comm , void **p_send_response_buf , HYPRE_Int *response_message_size ); +hypre_Vector *hypre_ParVectorToVectorAll_v2 ( hypre_ParVector *par_v, + HYPRE_MemoryLocation memory_location ); +HYPRE_Int hypre_ParVectorPrint ( hypre_ParVector *vector, const char *file_name ); +HYPRE_Int hypre_ParVectorPrintIJ ( hypre_ParVector *vector, HYPRE_Int base_j, + const char *filename ); +HYPRE_Int hypre_ParVectorPrintBinaryIJ ( hypre_ParVector *par_vector, const char *filename ); +HYPRE_Int hypre_ParVectorReadIJ ( MPI_Comm comm, const char *filename, HYPRE_Int *base_j_ptr, + hypre_ParVector **vector_ptr ); +HYPRE_Int hypre_FillResponseParToVectorAll ( void *p_recv_contact_buf, HYPRE_Int contact_size, + HYPRE_Int contact_proc, void *ro, MPI_Comm comm, void **p_send_response_buf, + HYPRE_Int *response_message_size ); HYPRE_Complex hypre_ParVectorLocalSumElts ( hypre_ParVector *vector ); -HYPRE_Int hypre_ParVectorGetValues ( hypre_ParVector *vector, HYPRE_Int num_values, HYPRE_BigInt *indices , HYPRE_Complex *values); -HYPRE_Int hypre_ParVectorGetValues2( hypre_ParVector *vector, HYPRE_Int num_values, HYPRE_BigInt *indices, HYPRE_BigInt base, HYPRE_Complex *values ); -HYPRE_Int hypre_ParVectorGetValuesHost(hypre_ParVector *vector, HYPRE_Int num_values, HYPRE_BigInt *indices, HYPRE_BigInt base, HYPRE_Complex *values); +HYPRE_Int hypre_ParVectorGetValues ( hypre_ParVector *vector, HYPRE_Int num_values, + HYPRE_BigInt *indices, HYPRE_Complex *values); +HYPRE_Int hypre_ParVectorGetValues2( hypre_ParVector *vector, HYPRE_Int num_values, + HYPRE_BigInt *indices, HYPRE_BigInt base, HYPRE_Complex *values ); +HYPRE_Int hypre_ParVectorGetValuesHost(hypre_ParVector *vector, HYPRE_Int num_values, + HYPRE_BigInt *indices, HYPRE_BigInt base, HYPRE_Complex *values); HYPRE_Int hypre_ParVectorElmdivpy( hypre_ParVector *x, hypre_ParVector *b, hypre_ParVector *y ); -HYPRE_Int hypre_ParVectorElmdivpyMarked( hypre_ParVector *x, hypre_ParVector *b, hypre_ParVector *y, HYPRE_Int *marker, HYPRE_Int marker_val ); +HYPRE_Int hypre_ParVectorElmdivpyMarked( hypre_ParVector *x, hypre_ParVector *b, + hypre_ParVector *y, HYPRE_Int *marker, + HYPRE_Int marker_val ); /* par_vector_device.c */ -HYPRE_Int hypre_ParVectorGetValuesDevice(hypre_ParVector *vector, HYPRE_Int num_values, HYPRE_BigInt *indices, HYPRE_BigInt base, HYPRE_Complex *values); +HYPRE_Int hypre_ParVectorGetValuesDevice(hypre_ParVector *vector, HYPRE_Int num_values, + HYPRE_BigInt *indices, HYPRE_BigInt base, + HYPRE_Complex *values); diff --git a/external/hypre/src/seq_block_mv/CMakeLists.txt b/external/hypre/src/seq_block_mv/CMakeLists.txt new file mode 100644 index 00000000..59fbccf7 --- /dev/null +++ b/external/hypre/src/seq_block_mv/CMakeLists.txt @@ -0,0 +1,29 @@ +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +set(HDRS + _hypre_seq_block_mv.h +) + +set(SRCS + dense_block_matrix.c + dense_block_matmult.c +) + +target_sources(${PROJECT_NAME} + PRIVATE ${SRCS} + ${HDRS} +) + +# if (HYPRE_USING_GPU) +# set(GPU_SRCS +# # File name here +# ) +# convert_filenames_to_full_paths(GPU_SRCS) +# set(HYPRE_GPU_SOURCES ${HYPRE_GPU_SOURCES} ${GPU_SRCS} PARENT_SCOPE) +# endif () + +convert_filenames_to_full_paths(HDRS) +set(HYPRE_HEADERS ${HYPRE_HEADERS} ${HDRS} PARENT_SCOPE) diff --git a/external/hypre/src/seq_block_mv/_hypre_seq_block_mv.h b/external/hypre/src/seq_block_mv/_hypre_seq_block_mv.h new file mode 100644 index 00000000..129c54df --- /dev/null +++ b/external/hypre/src/seq_block_mv/_hypre_seq_block_mv.h @@ -0,0 +1,114 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use 'headers' to generate) ***/ + +#ifndef hypre_SEQ_BLOCK_MV_HEADER +#define hypre_SEQ_BLOCK_MV_HEADER + +#include +#include "seq_mv.h" + +#ifdef __cplusplus +extern "C" { +#endif +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#ifndef hypre_DENSE_BLOCK_MATRIX_HEADER +#define hypre_DENSE_BLOCK_MATRIX_HEADER + +/*-------------------------------------------------------------------------- + * Uniformly blocked dense matrix data structure + *--------------------------------------------------------------------------*/ + +typedef struct hypre_DenseBlockMatrix_struct +{ + HYPRE_Int row_major; /* Flag indicating storage format (false: col major)*/ + HYPRE_Int num_rows; /* Number of rows of entire matrix */ + HYPRE_Int num_cols; /* Number of columns of entire matrix */ + HYPRE_Int num_nonzeros; /* Number of nonzero coefficients of entire matrix */ + HYPRE_Int num_blocks; /* Number of sub-matrices (blocks) */ + + /* Local info for a individual block (sub-matrix) */ + HYPRE_Int row_stride; /* Stride for accessing row values */ + HYPRE_Int col_stride; /* Stride for accessing column values */ + HYPRE_Int num_rows_block; /* Number of rows per block */ + HYPRE_Int num_cols_block; /* Number of columns per block */ + HYPRE_Int num_nonzeros_block; /* Number of nonzero coefficients per block */ + + /* Matrix coefficients array */ + HYPRE_Int owns_data; /* Flag indicating ownership of the data array */ + HYPRE_Complex *data; /* Matrix coefficients */ + HYPRE_Complex **data_aop; /* Array of pointers to data */ + HYPRE_MemoryLocation memory_location; /* Memory location of data array */ +} hypre_DenseBlockMatrix; + +/*-------------------------------------------------------------------------- + * Accessor functions for the uniform batched matrix structure + *--------------------------------------------------------------------------*/ + +#define hypre_DenseBlockMatrixRowMajor(matrix) ((matrix) -> row_major) +#define hypre_DenseBlockMatrixNumRows(matrix) ((matrix) -> num_rows) +#define hypre_DenseBlockMatrixNumCols(matrix) ((matrix) -> num_cols) +#define hypre_DenseBlockMatrixNumNonzeros(matrix) ((matrix) -> num_nonzeros) +#define hypre_DenseBlockMatrixNumBlocks(matrix) ((matrix) -> num_blocks) + +#define hypre_DenseBlockMatrixRowStride(matrix) ((matrix) -> row_stride) +#define hypre_DenseBlockMatrixColStride(matrix) ((matrix) -> col_stride) +#define hypre_DenseBlockMatrixNumRowsBlock(matrix) ((matrix) -> num_rows_block) +#define hypre_DenseBlockMatrixNumColsBlock(matrix) ((matrix) -> num_cols_block) +#define hypre_DenseBlockMatrixNumNonzerosBlock(matrix) ((matrix) -> num_nonzeros_block) + +#define hypre_DenseBlockMatrixOwnsData(matrix) ((matrix) -> owns_data) +#define hypre_DenseBlockMatrixData(matrix) ((matrix) -> data) +#define hypre_DenseBlockMatrixDataAOP(matrix) ((matrix) -> data_aop) +#define hypre_DenseBlockMatrixMemoryLocation(matrix) ((matrix) -> memory_location) +#define hypre_DenseBlockMatrixDataIJ(matrix, d, i, j) \ + (d[(matrix) -> row_stride * i + \ + (matrix) -> col_stride * j]) +#define hypre_DenseBlockMatrixDataBIJ(matrix, b, i, j) \ + ((matrix) -> data[(matrix) -> num_nonzeros_block * b + \ + (matrix) -> row_stride * i + \ + (matrix) -> col_stride * j]) + +#endif +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +/* dense_block_matrix.c */ +hypre_DenseBlockMatrix* hypre_DenseBlockMatrixCreate(HYPRE_Int, HYPRE_Int, HYPRE_Int, + HYPRE_Int, HYPRE_Int); +hypre_DenseBlockMatrix* hypre_DenseBlockMatrixCreateByBlock(HYPRE_Int, HYPRE_Int, + HYPRE_Int, HYPRE_Int); +hypre_DenseBlockMatrix* hypre_DenseBlockMatrixClone(hypre_DenseBlockMatrix*, HYPRE_Int); +HYPRE_Int hypre_DenseBlockMatrixDestroy(hypre_DenseBlockMatrix*); +HYPRE_Int hypre_DenseBlockMatrixInitializeOn(hypre_DenseBlockMatrix*, HYPRE_MemoryLocation); +HYPRE_Int hypre_DenseBlockMatrixInitialize(hypre_DenseBlockMatrix*); +HYPRE_Int hypre_DenseBlockMatrixBuildAOP(hypre_DenseBlockMatrix*); +HYPRE_Int hypre_DenseBlockMatrixCopy(hypre_DenseBlockMatrix*, hypre_DenseBlockMatrix*); +HYPRE_Int hypre_DenseBlockMatrixMigrate(hypre_DenseBlockMatrix*, HYPRE_MemoryLocation); +HYPRE_Int hypre_DenseBlockMatrixPrint(MPI_Comm, hypre_DenseBlockMatrix*, const char*); + +/* dense_block_matmult.c */ +HYPRE_Int hypre_DenseBlockMatrixMultiply(hypre_DenseBlockMatrix*, hypre_DenseBlockMatrix*, + hypre_DenseBlockMatrix**); + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/external/hypre/src/seq_block_mv/dense_block_matmult.c b/external/hypre/src/seq_block_mv/dense_block_matmult.c new file mode 100644 index 00000000..46c69475 --- /dev/null +++ b/external/hypre/src/seq_block_mv/dense_block_matmult.c @@ -0,0 +1,136 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#include "_hypre_seq_block_mv.h" + +/*-------------------------------------------------------------------------- + * hypre_DenseBlockMatrixMultiplyHost + * + * TODO (VPM): implement special cases such as (locally): + * 1) A = 1x2 and B = 2x2 + * 2) A = 1x3 and B = 3x3 + * 3) A = 1x4 and B = 4x4 + * + * TODO (VPM): use lapack's dgemm for large matrices (local blocks). + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_DenseBlockMatrixMultiplyHost( hypre_DenseBlockMatrix *A, + hypre_DenseBlockMatrix *B, + hypre_DenseBlockMatrix *C) +{ + HYPRE_Int num_blocks = hypre_DenseBlockMatrixNumBlocks(A); + HYPRE_Int num_rows_block_C = hypre_DenseBlockMatrixNumRowsBlock(C); + HYPRE_Int num_cols_block_C = hypre_DenseBlockMatrixNumColsBlock(C); + HYPRE_Int num_rows_block_B = hypre_DenseBlockMatrixNumRowsBlock(B); + + HYPRE_Int num_nonzeros_block_A = hypre_DenseBlockMatrixNumNonzerosBlock(A); + HYPRE_Int num_nonzeros_block_B = hypre_DenseBlockMatrixNumNonzerosBlock(B); + HYPRE_Int num_nonzeros_block_C = hypre_DenseBlockMatrixNumNonzerosBlock(C); + + HYPRE_Int ib; + +#if defined(HYPRE_USING_OPENMP) + #pragma omp parallel for private(ib) HYPRE_SMP_SCHEDULE +#endif + for (ib = 0; ib < num_blocks; ib++) + { + HYPRE_Int i, j, k; + HYPRE_Complex *data_A = hypre_DenseBlockMatrixData(A) + ib * num_nonzeros_block_A; + HYPRE_Complex *data_B = hypre_DenseBlockMatrixData(B) + ib * num_nonzeros_block_B; + HYPRE_Complex *data_C = hypre_DenseBlockMatrixData(C) + ib * num_nonzeros_block_C; + + for (i = 0; i < num_rows_block_C; i++) + { + for (j = 0; j < num_cols_block_C; j++) + { + for (k = 0; k < num_rows_block_B; k++) + { + /* C[i][j] += A[i][k] * B[k][j]; */ + hypre_DenseBlockMatrixDataIJ(C, data_C, i, j) += + hypre_DenseBlockMatrixDataIJ(A, data_A, i, k) * + hypre_DenseBlockMatrixDataIJ(B, data_B, k, j); + } + } + } + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_DenseBlockMatrixMultiply + * + * Computes: C = A * B. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_DenseBlockMatrixMultiply( hypre_DenseBlockMatrix *A, + hypre_DenseBlockMatrix *B, + hypre_DenseBlockMatrix **C_ptr) +{ + hypre_DenseBlockMatrix *C = *C_ptr; + + /* Check if multiplication makes sense */ + if (hypre_DenseBlockMatrixNumCols(A) != hypre_DenseBlockMatrixNumRows(B)) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "cols(A) != rows(B)"); + return hypre_error_flag; + } + + if (hypre_DenseBlockMatrixNumColsBlock(A) != hypre_DenseBlockMatrixNumRowsBlock(B)) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "local cols(A) != local rows(B)"); + return hypre_error_flag; + } + + /* Create and initialize output matrix if necessary */ + if (!C) + { + /* Use same storage layout as A */ + C = hypre_DenseBlockMatrixCreate(hypre_DenseBlockMatrixRowMajor(A), + hypre_DenseBlockMatrixNumRows(A), + hypre_DenseBlockMatrixNumCols(B), + hypre_DenseBlockMatrixNumRowsBlock(A), + hypre_DenseBlockMatrixNumColsBlock(B)); + hypre_DenseBlockMatrixInitializeOn(C, hypre_DenseBlockMatrixMemoryLocation(A)); + } + else + { + /* Reset output coefficients to zero */ + hypre_Memset(hypre_DenseBlockMatrixData(C), 0, + hypre_DenseBlockMatrixNumNonzeros(C) * sizeof(HYPRE_Complex), + hypre_DenseBlockMatrixMemoryLocation(C)); + } + + /* Compute matrix C */ +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy2(hypre_DenseBlockMatrixMemoryLocation(A), + hypre_DenseBlockMatrixMemoryLocation(B)); + + if (exec == HYPRE_EXEC_DEVICE) + { + /* TODO (VPM): Implement hypre_DenseBlockMatrixMultiplyDevice */ + hypre_DenseBlockMatrixMigrate(A, HYPRE_MEMORY_HOST); + hypre_DenseBlockMatrixMigrate(B, HYPRE_MEMORY_HOST); + hypre_DenseBlockMatrixMigrate(C, HYPRE_MEMORY_HOST); + hypre_DenseBlockMatrixMultiplyHost(A, B, C); + hypre_DenseBlockMatrixMigrate(A, HYPRE_MEMORY_DEVICE); + hypre_DenseBlockMatrixMigrate(B, HYPRE_MEMORY_DEVICE); + hypre_DenseBlockMatrixMigrate(C, HYPRE_MEMORY_DEVICE); + } + else +#endif + { + hypre_DenseBlockMatrixMultiplyHost(A, B, C); + } + + /* Set output pointer */ + *C_ptr = C; + + return hypre_error_flag; +} diff --git a/external/hypre/src/seq_block_mv/dense_block_matrix.c b/external/hypre/src/seq_block_mv/dense_block_matrix.c new file mode 100644 index 00000000..cd3c5d6d --- /dev/null +++ b/external/hypre/src/seq_block_mv/dense_block_matrix.c @@ -0,0 +1,335 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +/****************************************************************************** + * + * Member functions for hypre_DenseBlockMatrix class. + * + *****************************************************************************/ + +#include "_hypre_seq_block_mv.h" + +/*-------------------------------------------------------------------------- + * hypre_DenseBlockMatrixCreate + *--------------------------------------------------------------------------*/ + +hypre_DenseBlockMatrix * +hypre_DenseBlockMatrixCreate( HYPRE_Int row_major, + HYPRE_Int num_rows, + HYPRE_Int num_cols, + HYPRE_Int num_rows_block, + HYPRE_Int num_cols_block ) +{ + hypre_DenseBlockMatrix *A; + HYPRE_Int num_blocks[2]; + + /* Compute number of blocks */ + num_blocks[0] = hypre_ceildiv(num_rows, num_rows_block); + num_blocks[1] = hypre_ceildiv(num_cols, num_cols_block); + if (num_blocks[0] != num_blocks[1]) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Invalid number of blocks!"); + return NULL; + } + + /* Allocate memory */ + A = hypre_TAlloc(hypre_DenseBlockMatrix, 1, HYPRE_MEMORY_HOST); + + hypre_DenseBlockMatrixRowMajor(A) = row_major; + hypre_DenseBlockMatrixNumRowsBlock(A) = num_rows_block; + hypre_DenseBlockMatrixNumColsBlock(A) = num_cols_block; + hypre_DenseBlockMatrixNumBlocks(A) = num_blocks[0]; + hypre_DenseBlockMatrixNumRows(A) = num_blocks[0] * hypre_DenseBlockMatrixNumRowsBlock(A); + hypre_DenseBlockMatrixNumCols(A) = num_blocks[0] * hypre_DenseBlockMatrixNumColsBlock(A); + hypre_DenseBlockMatrixNumNonzerosBlock(A) = hypre_DenseBlockMatrixNumRowsBlock(A) * + hypre_DenseBlockMatrixNumColsBlock(A); + hypre_DenseBlockMatrixNumNonzeros(A) = num_blocks[0] * + hypre_DenseBlockMatrixNumNonzerosBlock(A); + hypre_DenseBlockMatrixOwnsData(A) = 0; + hypre_DenseBlockMatrixData(A) = NULL; + hypre_DenseBlockMatrixDataAOP(A) = NULL; + hypre_DenseBlockMatrixMemoryLocation(A) = hypre_HandleMemoryLocation(hypre_handle()); + + if (row_major) + { + hypre_DenseBlockMatrixRowStride(A) = 1; + hypre_DenseBlockMatrixColStride(A) = hypre_DenseBlockMatrixNumColsBlock(A); + } + else + { + hypre_DenseBlockMatrixRowStride(A) = hypre_DenseBlockMatrixNumRowsBlock(A); + hypre_DenseBlockMatrixColStride(A) = 1; + } + + return A; +} + +/*-------------------------------------------------------------------------- + * hypre_DenseBlockMatrixCreateByBlock + *--------------------------------------------------------------------------*/ + +hypre_DenseBlockMatrix * +hypre_DenseBlockMatrixCreateByBlock( HYPRE_Int row_major, + HYPRE_Int num_blocks, + HYPRE_Int num_rows_block, + HYPRE_Int num_cols_block ) +{ + return hypre_DenseBlockMatrixCreate(row_major, + num_blocks * num_rows_block, + num_blocks * num_cols_block, + num_rows_block, + num_cols_block); +} + +/*-------------------------------------------------------------------------- + * hypre_DenseBlockMatrixClone + *--------------------------------------------------------------------------*/ + +hypre_DenseBlockMatrix* +hypre_DenseBlockMatrixClone( hypre_DenseBlockMatrix *A, + HYPRE_Int copy_data ) +{ + HYPRE_Int row_major = hypre_DenseBlockMatrixRowMajor(A); + HYPRE_Int num_rows = hypre_DenseBlockMatrixNumRows(A); + HYPRE_Int num_cols = hypre_DenseBlockMatrixNumCols(A); + HYPRE_Int num_rows_block = hypre_DenseBlockMatrixNumRowsBlock(A); + HYPRE_Int num_cols_block = hypre_DenseBlockMatrixNumColsBlock(A); + + hypre_DenseBlockMatrix *B; + + /* Create new matrix */ + B = hypre_DenseBlockMatrixCreate(row_major, + num_rows, num_cols, + num_rows_block, num_cols_block); + + /* Initialize matrix */ + hypre_DenseBlockMatrixInitializeOn(B, hypre_DenseBlockMatrixMemoryLocation(A)); + + /* Copy data array */ + if (copy_data) + { + hypre_DenseBlockMatrixCopy(A, B); + } + + return B; +} + +/*-------------------------------------------------------------------------- + * hypre_DenseBlockMatrixDestroy + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_DenseBlockMatrixDestroy( hypre_DenseBlockMatrix *A ) +{ + if (A) + { + HYPRE_MemoryLocation memory_location = hypre_DenseBlockMatrixMemoryLocation(A); + + if (hypre_DenseBlockMatrixOwnsData(A)) + { + hypre_TFree(hypre_DenseBlockMatrixData(A), memory_location); + } + + /* data_aop is always owned by a hypre_DenseBlockMatrix */ + hypre_TFree(hypre_DenseBlockMatrixDataAOP(A), memory_location); + + /* Free matrix pointer */ + hypre_TFree(A, HYPRE_MEMORY_HOST); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_DenseBlockMatrixInitializeOn + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_DenseBlockMatrixInitializeOn( hypre_DenseBlockMatrix *A, + HYPRE_MemoryLocation memory_location ) +{ + hypre_DenseBlockMatrixMemoryLocation(A) = memory_location; + + /* Allocate memory for data */ + if (!hypre_DenseBlockMatrixData(A) && hypre_DenseBlockMatrixNumNonzeros(A)) + { + hypre_DenseBlockMatrixData(A) = hypre_CTAlloc(HYPRE_Complex, + hypre_DenseBlockMatrixNumNonzeros(A), + memory_location); + hypre_DenseBlockMatrixOwnsData(A) = 1; + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_DenseBlockMatrixInitialize + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_DenseBlockMatrixInitialize( hypre_DenseBlockMatrix *A ) +{ + return hypre_DenseBlockMatrixInitializeOn(A, hypre_DenseBlockMatrixMemoryLocation(A)); +} + +/*-------------------------------------------------------------------------- + * hypre_DenseBlockMatrixBuildAOP + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_DenseBlockMatrixBuildAOP( hypre_DenseBlockMatrix *A ) +{ + HYPRE_MemoryLocation memory_location = hypre_DenseBlockMatrixMemoryLocation(A); + + /* Allocate memory if we need */ + if (!hypre_DenseBlockMatrixDataAOP(A)) + { + hypre_DenseBlockMatrixDataAOP(A) = hypre_TAlloc(HYPRE_Complex *, + hypre_DenseBlockMatrixNumBlocks(A), + memory_location); + } + + /* Build array of pointers to the matrix data */ +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1(memory_location); + + if (exec == HYPRE_EXEC_DEVICE) + { + hypreDevice_ComplexArrayToArrayOfPtrs(hypre_DenseBlockMatrixNumBlocks(A), + hypre_DenseBlockMatrixNumNonzerosBlock(A), + hypre_DenseBlockMatrixData(A), + hypre_DenseBlockMatrixDataAOP(A)); + } +#endif + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_DenseBlockMatrixCopy + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_DenseBlockMatrixCopy( hypre_DenseBlockMatrix *A, + hypre_DenseBlockMatrix *B ) +{ + /* Copy coeficients from matrix A to B */ + hypre_TMemcpy(hypre_DenseBlockMatrixData(B), + hypre_DenseBlockMatrixData(A), + HYPRE_Complex, + hypre_DenseBlockMatrixNumNonzeros(A), + hypre_DenseBlockMatrixMemoryLocation(B), + hypre_DenseBlockMatrixMemoryLocation(A)); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_DenseBlockMatrixMigrate + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_DenseBlockMatrixMigrate( hypre_DenseBlockMatrix *A, + HYPRE_MemoryLocation memory_location ) +{ + /* Input matrix info */ + HYPRE_MemoryLocation old_memory_location = hypre_DenseBlockMatrixMemoryLocation(A); + HYPRE_Int num_nonzeros = hypre_DenseBlockMatrixNumNonzeros(A); + HYPRE_Complex *A_data = hypre_DenseBlockMatrixData(A); + + /* Output matrix info */ + HYPRE_Complex *B_data; + + /* Update A's memory location */ + hypre_DenseBlockMatrixMemoryLocation(A) = memory_location; + + if ( hypre_GetActualMemLocation(memory_location) != + hypre_GetActualMemLocation(old_memory_location) ) + { + if (A_data) + { + B_data = hypre_TAlloc(HYPRE_Complex, num_nonzeros, memory_location); + hypre_TMemcpy(B_data, A_data, HYPRE_Complex, num_nonzeros, + memory_location, old_memory_location); + hypre_TFree(A_data, old_memory_location); + hypre_DenseBlockMatrixData(A) = B_data; + } + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_DenseBlockMatrixPrint + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_DenseBlockMatrixPrint( MPI_Comm comm, + hypre_DenseBlockMatrix *A, + const char* filename ) +{ + /* Input matrix info */ + HYPRE_MemoryLocation memory_location = hypre_DenseBlockMatrixMemoryLocation(A); + + /* Local variables */ + char new_filename[HYPRE_MAX_FILE_NAME_LEN]; + HYPRE_Int myid, ib, i, j; + FILE *file; + + /* Move matrix to host */ + hypre_DenseBlockMatrixMigrate(A, HYPRE_MEMORY_HOST); + + /* Open file */ + hypre_MPI_Comm_rank(comm, &myid); + hypre_sprintf(new_filename, "%s.%05d", filename, myid); + if ((file = fopen(new_filename, "w")) == NULL) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Cannot open output file!"); + return hypre_error_flag; + } + + /*--------------------------------------------- + * Write the header + *---------------------------------------------*/ + + /* 1st header line: matrix info */ + hypre_fprintf(file, "%d %d\n", + hypre_DenseBlockMatrixNumRows(A), + hypre_DenseBlockMatrixNumCols(A)); + + /* 2nd header line: local block info */ + hypre_fprintf(file, "%d %d %d %d\n", + hypre_DenseBlockMatrixRowMajor(A), + hypre_DenseBlockMatrixNumBlocks(A), + hypre_DenseBlockMatrixNumRowsBlock(A), + hypre_DenseBlockMatrixNumColsBlock(A)); + + /*--------------------------------------------- + * Write coefficients + *---------------------------------------------*/ + + for (ib = 0; ib < hypre_DenseBlockMatrixNumBlocks(A); ib++) + { + hypre_fprintf(file, "%d\n", ib); + for (i = 0; i < hypre_DenseBlockMatrixNumRowsBlock(A); i++) + { + for (j = 0; j < hypre_DenseBlockMatrixNumColsBlock(A); j++) + { + hypre_fprintf(file, " %22.15e", + hypre_DenseBlockMatrixDataBIJ(A, ib, i, j)); + } + hypre_fprintf(file, ";\n"); + } + } + + fclose(file); + + /* Move matrix back to original lcoation */ + hypre_DenseBlockMatrixMigrate(A, memory_location); + + return hypre_error_flag; +} diff --git a/external/hypre/src/seq_block_mv/dense_block_matrix.h b/external/hypre/src/seq_block_mv/dense_block_matrix.h new file mode 100644 index 00000000..75ec0bba --- /dev/null +++ b/external/hypre/src/seq_block_mv/dense_block_matrix.h @@ -0,0 +1,65 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#ifndef hypre_DENSE_BLOCK_MATRIX_HEADER +#define hypre_DENSE_BLOCK_MATRIX_HEADER + +/*-------------------------------------------------------------------------- + * Uniformly blocked dense matrix data structure + *--------------------------------------------------------------------------*/ + +typedef struct hypre_DenseBlockMatrix_struct +{ + HYPRE_Int row_major; /* Flag indicating storage format (false: col major)*/ + HYPRE_Int num_rows; /* Number of rows of entire matrix */ + HYPRE_Int num_cols; /* Number of columns of entire matrix */ + HYPRE_Int num_nonzeros; /* Number of nonzero coefficients of entire matrix */ + HYPRE_Int num_blocks; /* Number of sub-matrices (blocks) */ + + /* Local info for a individual block (sub-matrix) */ + HYPRE_Int row_stride; /* Stride for accessing row values */ + HYPRE_Int col_stride; /* Stride for accessing column values */ + HYPRE_Int num_rows_block; /* Number of rows per block */ + HYPRE_Int num_cols_block; /* Number of columns per block */ + HYPRE_Int num_nonzeros_block; /* Number of nonzero coefficients per block */ + + /* Matrix coefficients array */ + HYPRE_Int owns_data; /* Flag indicating ownership of the data array */ + HYPRE_Complex *data; /* Matrix coefficients */ + HYPRE_Complex **data_aop; /* Array of pointers to data */ + HYPRE_MemoryLocation memory_location; /* Memory location of data array */ +} hypre_DenseBlockMatrix; + +/*-------------------------------------------------------------------------- + * Accessor functions for the uniform batched matrix structure + *--------------------------------------------------------------------------*/ + +#define hypre_DenseBlockMatrixRowMajor(matrix) ((matrix) -> row_major) +#define hypre_DenseBlockMatrixNumRows(matrix) ((matrix) -> num_rows) +#define hypre_DenseBlockMatrixNumCols(matrix) ((matrix) -> num_cols) +#define hypre_DenseBlockMatrixNumNonzeros(matrix) ((matrix) -> num_nonzeros) +#define hypre_DenseBlockMatrixNumBlocks(matrix) ((matrix) -> num_blocks) + +#define hypre_DenseBlockMatrixRowStride(matrix) ((matrix) -> row_stride) +#define hypre_DenseBlockMatrixColStride(matrix) ((matrix) -> col_stride) +#define hypre_DenseBlockMatrixNumRowsBlock(matrix) ((matrix) -> num_rows_block) +#define hypre_DenseBlockMatrixNumColsBlock(matrix) ((matrix) -> num_cols_block) +#define hypre_DenseBlockMatrixNumNonzerosBlock(matrix) ((matrix) -> num_nonzeros_block) + +#define hypre_DenseBlockMatrixOwnsData(matrix) ((matrix) -> owns_data) +#define hypre_DenseBlockMatrixData(matrix) ((matrix) -> data) +#define hypre_DenseBlockMatrixDataAOP(matrix) ((matrix) -> data_aop) +#define hypre_DenseBlockMatrixMemoryLocation(matrix) ((matrix) -> memory_location) +#define hypre_DenseBlockMatrixDataIJ(matrix, d, i, j) \ + (d[(matrix) -> row_stride * i + \ + (matrix) -> col_stride * j]) +#define hypre_DenseBlockMatrixDataBIJ(matrix, b, i, j) \ + ((matrix) -> data[(matrix) -> num_nonzeros_block * b + \ + (matrix) -> row_stride * i + \ + (matrix) -> col_stride * j]) + +#endif diff --git a/external/hypre/src/seq_block_mv/headers b/external/hypre/src/seq_block_mv/headers new file mode 100755 index 00000000..4215eed0 --- /dev/null +++ b/external/hypre/src/seq_block_mv/headers @@ -0,0 +1,49 @@ +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +INTERNAL_HEADER=_hypre_seq_block_mv.h + +#=========================================================================== +# Include guards and other includes +#=========================================================================== + +cat > $INTERNAL_HEADER <<@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use 'headers' to generate) ***/ + +#ifndef hypre_SEQ_BLOCK_MV_HEADER +#define hypre_SEQ_BLOCK_MV_HEADER + +#include +#include "seq_mv.h" + +#ifdef __cplusplus +extern "C" { +#endif +@ + +cat dense_block_matrix.h >> $INTERNAL_HEADER +cat protos.h >> $INTERNAL_HEADER + +#=========================================================================== +# Include guards +#=========================================================================== + +cat >> $INTERNAL_HEADER <<@ + +#ifdef __cplusplus +} +#endif + +#endif + +@ diff --git a/external/hypre/src/seq_block_mv/protos.h b/external/hypre/src/seq_block_mv/protos.h new file mode 100644 index 00000000..799deffa --- /dev/null +++ b/external/hypre/src/seq_block_mv/protos.h @@ -0,0 +1,24 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +/* dense_block_matrix.c */ +hypre_DenseBlockMatrix* hypre_DenseBlockMatrixCreate(HYPRE_Int, HYPRE_Int, HYPRE_Int, + HYPRE_Int, HYPRE_Int); +hypre_DenseBlockMatrix* hypre_DenseBlockMatrixCreateByBlock(HYPRE_Int, HYPRE_Int, + HYPRE_Int, HYPRE_Int); +hypre_DenseBlockMatrix* hypre_DenseBlockMatrixClone(hypre_DenseBlockMatrix*, HYPRE_Int); +HYPRE_Int hypre_DenseBlockMatrixDestroy(hypre_DenseBlockMatrix*); +HYPRE_Int hypre_DenseBlockMatrixInitializeOn(hypre_DenseBlockMatrix*, HYPRE_MemoryLocation); +HYPRE_Int hypre_DenseBlockMatrixInitialize(hypre_DenseBlockMatrix*); +HYPRE_Int hypre_DenseBlockMatrixBuildAOP(hypre_DenseBlockMatrix*); +HYPRE_Int hypre_DenseBlockMatrixCopy(hypre_DenseBlockMatrix*, hypre_DenseBlockMatrix*); +HYPRE_Int hypre_DenseBlockMatrixMigrate(hypre_DenseBlockMatrix*, HYPRE_MemoryLocation); +HYPRE_Int hypre_DenseBlockMatrixPrint(MPI_Comm, hypre_DenseBlockMatrix*, const char*); + +/* dense_block_matmult.c */ +HYPRE_Int hypre_DenseBlockMatrixMultiply(hypre_DenseBlockMatrix*, hypre_DenseBlockMatrix*, + hypre_DenseBlockMatrix**); diff --git a/external/hypre/src/seq_mv/.gitignore b/external/hypre/src/seq_mv/.gitignore new file mode 100644 index 00000000..11ea4d63 --- /dev/null +++ b/external/hypre/src/seq_mv/.gitignore @@ -0,0 +1,7 @@ +##################### +# Autogenerated files +##################### +csr_spgemm_device_numer[1-9].c +csr_spgemm_device_numer10.c +csr_spgemm_device_symbl[1-9].c +csr_spgemm_device_symbl10.c diff --git a/external/hypre/src/seq_mv/CMakeLists.txt b/external/hypre/src/seq_mv/CMakeLists.txt index 80942d36..c7962b47 100644 --- a/external/hypre/src/seq_mv/CMakeLists.txt +++ b/external/hypre/src/seq_mv/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -9,61 +9,126 @@ set(HDRS ) set(SRCS + csr_filter.c csr_matop.c - csr_matop_device.c csr_matrix.c - csr_matrix_cuda_utils.c csr_matvec.c + genpart.c + HYPRE_csr_matrix.c + HYPRE_mapped_matrix.c + HYPRE_multiblock_matrix.c + HYPRE_vector.c + mapped_matrix.c + multiblock_matrix.c + vector_batched.c + csr_matop_device.c + csr_matrix_cuda_utils.c csr_matvec_device.c csr_matvec_oomp.c csr_spadd_device.c csr_spgemm_device.c - csr_spgemm_device_attempt.c - csr_spgemm_device_confident.c csr_spgemm_device_cusparse.c + csr_spgemm_device_numblocks.c + csr_spgemm_device_numer.c + csr_spgemm_device_numer1.c + csr_spgemm_device_numer2.c + csr_spgemm_device_numer3.c + csr_spgemm_device_numer4.c + csr_spgemm_device_numer5.c + csr_spgemm_device_numer6.c + csr_spgemm_device_numer7.c + csr_spgemm_device_numer8.c + csr_spgemm_device_numer9.c + csr_spgemm_device_numer10.c + csr_spgemm_device_onemklsparse.c csr_spgemm_device_rocsparse.c - csr_spgemm_device_rowbound.c csr_spgemm_device_rowest.c + csr_spgemm_device_symbl.c + csr_spgemm_device_symbl1.c + csr_spgemm_device_symbl2.c + csr_spgemm_device_symbl3.c + csr_spgemm_device_symbl4.c + csr_spgemm_device_symbl5.c + csr_spgemm_device_symbl6.c + csr_spgemm_device_symbl7.c + csr_spgemm_device_symbl8.c + csr_spgemm_device_symbl9.c + csr_spgemm_device_symbl10.c csr_spgemm_device_util.c csr_spmv_device.c csr_sptrans_device.c - genpart.c - HYPRE_csr_matrix.c - HYPRE_mapped_matrix.c - HYPRE_multiblock_matrix.c - HYPRE_vector.c - mapped_matrix.c - multiblock_matrix.c vector.c - vector_batched.c + vector_device.c ) +# Autogenerate csr_spgemm_device_numer$ files +file(READ "csr_spgemm_device_numer.in" CONTENTS) +foreach(number RANGE 1 10) + # Check if file exists, then don't recreate + set(fn "csr_spgemm_device_numer${number}.c") + if (NOT EXISTS ${fn}) + file(WRITE ${fn} "#define HYPRE_SPGEMM_BIN ${number}") + file(APPEND ${fn} "${CONTENTS}") + endif (NOT EXISTS ${fn}) +endforeach(number RANGE 1 10) + +# Autogenerate csr_spgemm_device_symbl$ files +file(READ "csr_spgemm_device_symbl.in" CONTENTS) +foreach(number RANGE 1 10) + set(fn "csr_spgemm_device_symbl${number}.c") + if (NOT EXISTS ${fn}) + file(WRITE ${fn} "#define HYPRE_SPGEMM_BIN ${number}") + file(APPEND ${fn} "${CONTENTS}") + endif (NOT EXISTS ${fn}) +endforeach(number RANGE 1 10) + target_sources(${PROJECT_NAME} PRIVATE ${SRCS} ${HDRS} ) -if (HYPRE_USING_CUDA) - set(CUDA_SRCS +if (HYPRE_USING_GPU) + set(GPU_SRCS csr_matop_device.c csr_matrix_cuda_utils.c csr_matvec_device.c csr_matvec_oomp.c csr_spadd_device.c csr_spgemm_device.c - csr_spgemm_device_attempt.c - csr_spgemm_device_confident.c csr_spgemm_device_cusparse.c + csr_spgemm_device_numblocks.c + csr_spgemm_device_numer.c + csr_spgemm_device_numer1.c + csr_spgemm_device_numer2.c + csr_spgemm_device_numer3.c + csr_spgemm_device_numer4.c + csr_spgemm_device_numer5.c + csr_spgemm_device_numer6.c + csr_spgemm_device_numer7.c + csr_spgemm_device_numer8.c + csr_spgemm_device_numer9.c + csr_spgemm_device_numer10.c + csr_spgemm_device_onemklsparse.c csr_spgemm_device_rocsparse.c - csr_spgemm_device_rowbound.c csr_spgemm_device_rowest.c + csr_spgemm_device_symbl.c + csr_spgemm_device_symbl1.c + csr_spgemm_device_symbl2.c + csr_spgemm_device_symbl3.c + csr_spgemm_device_symbl4.c + csr_spgemm_device_symbl5.c + csr_spgemm_device_symbl6.c + csr_spgemm_device_symbl7.c + csr_spgemm_device_symbl8.c + csr_spgemm_device_symbl9.c + csr_spgemm_device_symbl10.c csr_spgemm_device_util.c csr_spmv_device.c csr_sptrans_device.c - vector.c + vector_device.c ) - convert_filenames_to_full_paths(CUDA_SRCS) - set(HYPRE_CUDA_SOURCES ${HYPRE_CUDA_SOURCES} ${CUDA_SRCS} PARENT_SCOPE) + convert_filenames_to_full_paths(GPU_SRCS) + set(HYPRE_GPU_SOURCES ${HYPRE_GPU_SOURCES} ${GPU_SRCS} PARENT_SCOPE) endif () convert_filenames_to_full_paths(HDRS) diff --git a/external/hypre/src/seq_mv/HYPRE_csr_matrix.c b/external/hypre/src/seq_mv/HYPRE_csr_matrix.c index 4e0ecf4e..4fc71515 100644 --- a/external/hypre/src/seq_mv/HYPRE_csr_matrix.c +++ b/external/hypre/src/seq_mv/HYPRE_csr_matrix.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -30,7 +30,7 @@ HYPRE_CSRMatrixCreate( HYPRE_Int num_rows, matrix_i[0] = 0; for (i = 0; i < num_rows; i++) { - matrix_i[i+1] = matrix_i[i] + row_sizes[i]; + matrix_i[i + 1] = matrix_i[i] + row_sizes[i]; } matrix = hypre_CSRMatrixCreate(num_rows, num_cols, matrix_i[num_rows]); @@ -46,7 +46,7 @@ HYPRE_CSRMatrixCreate( HYPRE_Int num_rows, HYPRE_Int HYPRE_CSRMatrixDestroy( HYPRE_CSRMatrix matrix ) { - return( hypre_CSRMatrixDestroy( (hypre_CSRMatrix *) matrix ) ); + return ( hypre_CSRMatrixDestroy( (hypre_CSRMatrix *) matrix ) ); } /*-------------------------------------------------------------------------- diff --git a/external/hypre/src/seq_mv/HYPRE_mapped_matrix.c b/external/hypre/src/seq_mv/HYPRE_mapped_matrix.c index 405fd388..24355b32 100644 --- a/external/hypre/src/seq_mv/HYPRE_mapped_matrix.c +++ b/external/hypre/src/seq_mv/HYPRE_mapped_matrix.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,8 +17,8 @@ * HYPRE_MappedMatrixCreate *--------------------------------------------------------------------------*/ -HYPRE_MappedMatrix -HYPRE_MappedMatrixCreate( ) +HYPRE_MappedMatrix +HYPRE_MappedMatrixCreate( void ) { return ( (HYPRE_MappedMatrix) hypre_MappedMatrixCreate( )); @@ -28,20 +28,20 @@ HYPRE_MappedMatrixCreate( ) * HYPRE_MappedMatrixDestroy *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_MappedMatrixDestroy( HYPRE_MappedMatrix matrix ) { - return( hypre_MappedMatrixDestroy( (hypre_MappedMatrix *) matrix ) ); + return ( hypre_MappedMatrixDestroy( (hypre_MappedMatrix *) matrix ) ); } /*-------------------------------------------------------------------------- * HYPRE_MappedMatrixLimitedDestroy *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_MappedMatrixLimitedDestroy( HYPRE_MappedMatrix matrix ) { - return( hypre_MappedMatrixLimitedDestroy( (hypre_MappedMatrix *) matrix ) ); + return ( hypre_MappedMatrixLimitedDestroy( (hypre_MappedMatrix *) matrix ) ); } /*-------------------------------------------------------------------------- @@ -59,10 +59,10 @@ HYPRE_MappedMatrixInitialize( HYPRE_MappedMatrix matrix ) * HYPRE_MappedMatrixAssemble *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_MappedMatrixAssemble( HYPRE_MappedMatrix matrix ) { - return( hypre_MappedMatrixAssemble( (hypre_MappedMatrix *) matrix ) ); + return ( hypre_MappedMatrixAssemble( (hypre_MappedMatrix *) matrix ) ); } @@ -71,7 +71,7 @@ HYPRE_MappedMatrixAssemble( HYPRE_MappedMatrix matrix ) * HYPRE_MappedMatrixPrint *--------------------------------------------------------------------------*/ -void +void HYPRE_MappedMatrixPrint( HYPRE_MappedMatrix matrix ) { hypre_MappedMatrixPrint( (hypre_MappedMatrix *) matrix ); @@ -89,7 +89,7 @@ HYPRE_MappedMatrixPrint( HYPRE_MappedMatrix matrix ) HYPRE_Int HYPRE_MappedMatrixGetColIndex( HYPRE_MappedMatrix matrix, HYPRE_Int j ) { - return( hypre_MappedMatrixGetColIndex( (hypre_MappedMatrix *) matrix, j )); + return ( hypre_MappedMatrixGetColIndex( (hypre_MappedMatrix *) matrix, j )); } /*-------------------------------------------------------------------------- @@ -99,7 +99,7 @@ HYPRE_MappedMatrixGetColIndex( HYPRE_MappedMatrix matrix, HYPRE_Int j ) void * HYPRE_MappedMatrixGetMatrix( HYPRE_MappedMatrix matrix ) { - return( hypre_MappedMatrixGetMatrix( (hypre_MappedMatrix *) matrix )); + return ( hypre_MappedMatrixGetMatrix( (hypre_MappedMatrix *) matrix )); } /*-------------------------------------------------------------------------- @@ -109,7 +109,7 @@ HYPRE_MappedMatrixGetMatrix( HYPRE_MappedMatrix matrix ) HYPRE_Int HYPRE_MappedMatrixSetMatrix( HYPRE_MappedMatrix matrix, void *matrix_data ) { - return( hypre_MappedMatrixSetMatrix( (hypre_MappedMatrix *) matrix, matrix_data ) ); + return ( hypre_MappedMatrixSetMatrix( (hypre_MappedMatrix *) matrix, matrix_data ) ); } /*-------------------------------------------------------------------------- @@ -119,7 +119,7 @@ HYPRE_MappedMatrixSetMatrix( HYPRE_MappedMatrix matrix, void *matrix_data ) HYPRE_Int HYPRE_MappedMatrixSetColMap( HYPRE_MappedMatrix matrix, HYPRE_Int (*ColMap)(HYPRE_Int, void *) ) { - return( hypre_MappedMatrixSetColMap( (hypre_MappedMatrix *) matrix, ColMap ) ); + return ( hypre_MappedMatrixSetColMap( (hypre_MappedMatrix *) matrix, ColMap ) ); } /*-------------------------------------------------------------------------- @@ -129,5 +129,5 @@ HYPRE_MappedMatrixSetColMap( HYPRE_MappedMatrix matrix, HYPRE_Int (*ColMap)(HYPR HYPRE_Int HYPRE_MappedMatrixSetMapData( HYPRE_MappedMatrix matrix, void *MapData ) { - return( hypre_MappedMatrixSetMapData( (hypre_MappedMatrix *) matrix, MapData ) ); + return ( hypre_MappedMatrixSetMapData( (hypre_MappedMatrix *) matrix, MapData ) ); } diff --git a/external/hypre/src/seq_mv/HYPRE_multiblock_matrix.c b/external/hypre/src/seq_mv/HYPRE_multiblock_matrix.c index d5f50173..09c081f2 100644 --- a/external/hypre/src/seq_mv/HYPRE_multiblock_matrix.c +++ b/external/hypre/src/seq_mv/HYPRE_multiblock_matrix.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,8 +17,8 @@ * HYPRE_MultiblockMatrixCreate *--------------------------------------------------------------------------*/ -HYPRE_MultiblockMatrix -HYPRE_MultiblockMatrixCreate( ) +HYPRE_MultiblockMatrix +HYPRE_MultiblockMatrixCreate( void ) { return ( (HYPRE_MultiblockMatrix) hypre_MultiblockMatrixCreate( )); @@ -28,20 +28,20 @@ HYPRE_MultiblockMatrixCreate( ) * HYPRE_MultiblockMatrixDestroy *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_MultiblockMatrixDestroy( HYPRE_MultiblockMatrix matrix ) { - return( hypre_MultiblockMatrixDestroy( (hypre_MultiblockMatrix *) matrix ) ); + return ( hypre_MultiblockMatrixDestroy( (hypre_MultiblockMatrix *) matrix ) ); } /*-------------------------------------------------------------------------- * HYPRE_MultiblockMatrixLimitedDestroy *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_MultiblockMatrixLimitedDestroy( HYPRE_MultiblockMatrix matrix ) { - return( hypre_MultiblockMatrixLimitedDestroy( (hypre_MultiblockMatrix *) matrix ) ); + return ( hypre_MultiblockMatrixLimitedDestroy( (hypre_MultiblockMatrix *) matrix ) ); } /*-------------------------------------------------------------------------- @@ -59,10 +59,10 @@ HYPRE_MultiblockMatrixInitialize( HYPRE_MultiblockMatrix matrix ) * HYPRE_MultiblockMatrixAssemble *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_MultiblockMatrixAssemble( HYPRE_MultiblockMatrix matrix ) { - return( hypre_MultiblockMatrixAssemble( (hypre_MultiblockMatrix *) matrix ) ); + return ( hypre_MultiblockMatrixAssemble( (hypre_MultiblockMatrix *) matrix ) ); } @@ -71,7 +71,7 @@ HYPRE_MultiblockMatrixAssemble( HYPRE_MultiblockMatrix matrix ) * HYPRE_MultiblockMatrixPrint *--------------------------------------------------------------------------*/ -void +void HYPRE_MultiblockMatrixPrint( HYPRE_MultiblockMatrix matrix ) { hypre_MultiblockMatrixPrint( (hypre_MultiblockMatrix *) matrix ); @@ -86,22 +86,22 @@ HYPRE_MultiblockMatrixPrint( HYPRE_MultiblockMatrix matrix ) * HYPRE_MultiblockMatrixSetNumSubmatrices *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_MultiblockMatrixSetNumSubmatrices( HYPRE_MultiblockMatrix matrix, HYPRE_Int n ) { - return( hypre_MultiblockMatrixSetNumSubmatrices( - (hypre_MultiblockMatrix *) matrix, n ) ); + return ( hypre_MultiblockMatrixSetNumSubmatrices( + (hypre_MultiblockMatrix *) matrix, n ) ); } /*-------------------------------------------------------------------------- * HYPRE_MultiblockMatrixSetSubmatrixType *--------------------------------------------------------------------------*/ -HYPRE_Int -HYPRE_MultiblockMatrixSetSubmatrixType( HYPRE_MultiblockMatrix matrix, - HYPRE_Int j, - HYPRE_Int type ) +HYPRE_Int +HYPRE_MultiblockMatrixSetSubmatrixType( HYPRE_MultiblockMatrix matrix, + HYPRE_Int j, + HYPRE_Int type ) { - return( hypre_MultiblockMatrixSetSubmatrixType( - (hypre_MultiblockMatrix *) matrix, j, type ) ); + return ( hypre_MultiblockMatrixSetSubmatrixType( + (hypre_MultiblockMatrix *) matrix, j, type ) ); } diff --git a/external/hypre/src/seq_mv/HYPRE_seq_mv.h b/external/hypre/src/seq_mv/HYPRE_seq_mv.h index cea9e23f..57e812a8 100644 --- a/external/hypre/src/seq_mv/HYPRE_seq_mv.h +++ b/external/hypre/src/seq_mv/HYPRE_seq_mv.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -30,23 +30,19 @@ struct hypre_MappedMatrix_struct; typedef struct hypre_MappedMatrix_struct *HYPRE_MappedMatrix; struct hypre_MultiblockMatrix_struct; typedef struct hypre_MultiblockMatrix_struct *HYPRE_MultiblockMatrix; -#ifndef HYPRE_VECTOR_STRUCT -#define HYPRE_VECTOR_STRUCT -struct hypre_Vector_struct; -typedef struct hypre_Vector_struct *HYPRE_Vector; -#endif /*-------------------------------------------------------------------------- * Prototypes *--------------------------------------------------------------------------*/ /* HYPRE_csr_matrix.c */ -HYPRE_CSRMatrix HYPRE_CSRMatrixCreate( HYPRE_Int num_rows , HYPRE_Int num_cols , HYPRE_Int *row_sizes ); +HYPRE_CSRMatrix HYPRE_CSRMatrixCreate( HYPRE_Int num_rows, HYPRE_Int num_cols, + HYPRE_Int *row_sizes ); HYPRE_Int HYPRE_CSRMatrixDestroy( HYPRE_CSRMatrix matrix ); HYPRE_Int HYPRE_CSRMatrixInitialize( HYPRE_CSRMatrix matrix ); HYPRE_CSRMatrix HYPRE_CSRMatrixRead( char *file_name ); -void HYPRE_CSRMatrixPrint( HYPRE_CSRMatrix matrix , char *file_name ); -HYPRE_Int HYPRE_CSRMatrixGetNumRows( HYPRE_CSRMatrix matrix , HYPRE_Int *num_rows ); +void HYPRE_CSRMatrixPrint( HYPRE_CSRMatrix matrix, char *file_name ); +HYPRE_Int HYPRE_CSRMatrixGetNumRows( HYPRE_CSRMatrix matrix, HYPRE_Int *num_rows ); /* HYPRE_mapped_matrix.c */ HYPRE_MappedMatrix HYPRE_MappedMatrixCreate( void ); @@ -55,11 +51,12 @@ HYPRE_Int HYPRE_MappedMatrixLimitedDestroy( HYPRE_MappedMatrix matrix ); HYPRE_Int HYPRE_MappedMatrixInitialize( HYPRE_MappedMatrix matrix ); HYPRE_Int HYPRE_MappedMatrixAssemble( HYPRE_MappedMatrix matrix ); void HYPRE_MappedMatrixPrint( HYPRE_MappedMatrix matrix ); -HYPRE_Int HYPRE_MappedMatrixGetColIndex( HYPRE_MappedMatrix matrix , HYPRE_Int j ); +HYPRE_Int HYPRE_MappedMatrixGetColIndex( HYPRE_MappedMatrix matrix, HYPRE_Int j ); void *HYPRE_MappedMatrixGetMatrix( HYPRE_MappedMatrix matrix ); -HYPRE_Int HYPRE_MappedMatrixSetMatrix( HYPRE_MappedMatrix matrix , void *matrix_data ); -HYPRE_Int HYPRE_MappedMatrixSetColMap( HYPRE_MappedMatrix matrix , HYPRE_Int (*ColMap )(HYPRE_Int ,void *)); -HYPRE_Int HYPRE_MappedMatrixSetMapData( HYPRE_MappedMatrix matrix , void *MapData ); +HYPRE_Int HYPRE_MappedMatrixSetMatrix( HYPRE_MappedMatrix matrix, void *matrix_data ); +HYPRE_Int HYPRE_MappedMatrixSetColMap( HYPRE_MappedMatrix matrix, HYPRE_Int (*ColMap )(HYPRE_Int, + void *)); +HYPRE_Int HYPRE_MappedMatrixSetMapData( HYPRE_MappedMatrix matrix, void *MapData ); /* HYPRE_multiblock_matrix.c */ HYPRE_MultiblockMatrix HYPRE_MultiblockMatrixCreate( void ); @@ -68,14 +65,15 @@ HYPRE_Int HYPRE_MultiblockMatrixLimitedDestroy( HYPRE_MultiblockMatrix matrix ); HYPRE_Int HYPRE_MultiblockMatrixInitialize( HYPRE_MultiblockMatrix matrix ); HYPRE_Int HYPRE_MultiblockMatrixAssemble( HYPRE_MultiblockMatrix matrix ); void HYPRE_MultiblockMatrixPrint( HYPRE_MultiblockMatrix matrix ); -HYPRE_Int HYPRE_MultiblockMatrixSetNumSubmatrices( HYPRE_MultiblockMatrix matrix , HYPRE_Int n ); -HYPRE_Int HYPRE_MultiblockMatrixSetSubmatrixType( HYPRE_MultiblockMatrix matrix , HYPRE_Int j , HYPRE_Int type ); +HYPRE_Int HYPRE_MultiblockMatrixSetNumSubmatrices( HYPRE_MultiblockMatrix matrix, HYPRE_Int n ); +HYPRE_Int HYPRE_MultiblockMatrixSetSubmatrixType( HYPRE_MultiblockMatrix matrix, HYPRE_Int j, + HYPRE_Int type ); /* HYPRE_vector.c */ HYPRE_Vector HYPRE_VectorCreate( HYPRE_Int size ); HYPRE_Int HYPRE_VectorDestroy( HYPRE_Vector vector ); HYPRE_Int HYPRE_VectorInitialize( HYPRE_Vector vector ); -HYPRE_Int HYPRE_VectorPrint( HYPRE_Vector vector , char *file_name ); +HYPRE_Int HYPRE_VectorPrint( HYPRE_Vector vector, char *file_name ); HYPRE_Vector HYPRE_VectorRead( char *file_name ); typedef enum HYPRE_TimerID @@ -122,12 +120,12 @@ typedef enum HYPRE_TimerID HYPRE_TIMER_ID_MERGE, // csr matop - HYPRE_TIMER_ID_SPMM_ROWNNZ, - HYPRE_TIMER_ID_SPMM_ATTEMPT1, - HYPRE_TIMER_ID_SPMM_ATTEMPT2, - HYPRE_TIMER_ID_SPMM_SYMBOLIC, - HYPRE_TIMER_ID_SPMM_NUMERIC, - HYPRE_TIMER_ID_SPMM, + HYPRE_TIMER_ID_SPGEMM_ROWNNZ, + HYPRE_TIMER_ID_SPGEMM_ATTEMPT1, + HYPRE_TIMER_ID_SPGEMM_ATTEMPT2, + HYPRE_TIMER_ID_SPGEMM_SYMBOLIC, + HYPRE_TIMER_ID_SPGEMM_NUMERIC, + HYPRE_TIMER_ID_SPGEMM, HYPRE_TIMER_ID_SPADD, HYPRE_TIMER_ID_SPTRANS, diff --git a/external/hypre/src/seq_mv/HYPRE_vector.c b/external/hypre/src/seq_mv/HYPRE_vector.c index c9665c18..fb9f708d 100644 --- a/external/hypre/src/seq_mv/HYPRE_vector.c +++ b/external/hypre/src/seq_mv/HYPRE_vector.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -27,7 +27,7 @@ HYPRE_VectorCreate( HYPRE_Int size ) * HYPRE_VectorDestroy *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_VectorDestroy( HYPRE_Vector vector ) { return ( hypre_SeqVectorDestroy( (hypre_Vector *) vector ) ); @@ -37,7 +37,7 @@ HYPRE_VectorDestroy( HYPRE_Vector vector ) * HYPRE_VectorInitialize *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_VectorInitialize( HYPRE_Vector vector ) { return ( hypre_SeqVectorInitialize( (hypre_Vector *) vector ) ); @@ -52,7 +52,7 @@ HYPRE_VectorPrint( HYPRE_Vector vector, char *file_name ) { return ( hypre_SeqVectorPrint( (hypre_Vector *) vector, - file_name ) ); + file_name ) ); } /*-------------------------------------------------------------------------- diff --git a/external/hypre/src/seq_mv/MakeIRIX b/external/hypre/src/seq_mv/MakeIRIX index c9057fee..a6478b10 100644 --- a/external/hypre/src/seq_mv/MakeIRIX +++ b/external/hypre/src/seq_mv/MakeIRIX @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/seq_mv/csr_filter.c b/external/hypre/src/seq_mv/csr_filter.c new file mode 100644 index 00000000..af371cc9 --- /dev/null +++ b/external/hypre/src/seq_mv/csr_filter.c @@ -0,0 +1,52 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +/****************************************************************************** + * + * Methods for matrix truncation/filtering + * + *****************************************************************************/ + +#include "seq_mv.h" + +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixTruncateDiag + * + * Truncates the input matrix to its diagonal portion. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixTruncateDiag(hypre_CSRMatrix *A) +{ + HYPRE_MemoryLocation memory_location = hypre_CSRMatrixMemoryLocation(A); + HYPRE_Int num_rows = hypre_CSRMatrixNumRows(A); + HYPRE_Complex *A_a; + HYPRE_Int *A_i, *A_j; + + /* Extract diagonal */ + A_a = hypre_TAlloc(HYPRE_Complex, num_rows, memory_location); + hypre_CSRMatrixExtractDiagonal(A, A_a, 0); + + /* Free old matrix data */ + hypre_TFree(hypre_CSRMatrixData(A), memory_location); + hypre_TFree(hypre_CSRMatrixI(A), memory_location); + hypre_TFree(hypre_CSRMatrixJ(A), memory_location); + + /* Update matrix sparsity pattern */ + A_i = hypre_TAlloc(HYPRE_Int, num_rows + 1, memory_location); + A_j = hypre_TAlloc(HYPRE_Int, num_rows, memory_location); + hypre_IntSequence(memory_location, num_rows + 1, A_i); + hypre_IntSequence(memory_location, num_rows, A_j); + + /* Update matrix pointers and number of nonzero entries */ + hypre_CSRMatrixNumNonzeros(A) = num_rows; + hypre_CSRMatrixI(A) = A_i; + hypre_CSRMatrixJ(A) = A_j; + hypre_CSRMatrixData(A) = A_a; + + return hypre_error_flag; +} diff --git a/external/hypre/src/seq_mv/csr_matop.c b/external/hypre/src/seq_mv/csr_matop.c index a68b0f96..cbedfb8c 100644 --- a/external/hypre/src/seq_mv/csr_matop.c +++ b/external/hypre/src/seq_mv/csr_matop.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -73,7 +73,7 @@ hypre_CSRMatrixAddFirstPass( HYPRE_Int firstrow, if (map_A2C) { - for (ia = A_i[iic]; ia < A_i[iic+1]; ia++) + for (ia = A_i[iic]; ia < A_i[iic + 1]; ia++) { jcol = map_A2C[A_j[ia]]; marker[jcol] = iic; @@ -82,7 +82,7 @@ hypre_CSRMatrixAddFirstPass( HYPRE_Int firstrow, } else { - for (ia = A_i[iic]; ia < A_i[iic+1]; ia++) + for (ia = A_i[iic]; ia < A_i[iic + 1]; ia++) { jcol = A_j[ia]; marker[jcol] = iic; @@ -92,7 +92,7 @@ hypre_CSRMatrixAddFirstPass( HYPRE_Int firstrow, if (map_B2C) { - for (ib = B_i[iic]; ib < B_i[iic+1]; ib++) + for (ib = B_i[iic]; ib < B_i[iic + 1]; ib++) { jcol = map_B2C[B_j[ib]]; if (marker[jcol] != iic) @@ -104,7 +104,7 @@ hypre_CSRMatrixAddFirstPass( HYPRE_Int firstrow, } else { - for (ib = B_i[iic]; ib < B_i[iic+1]; ib++) + for (ib = B_i[iic]; ib < B_i[iic + 1]; ib++) { jcol = B_j[ib]; if (marker[jcol] != iic) @@ -114,12 +114,12 @@ hypre_CSRMatrixAddFirstPass( HYPRE_Int firstrow, } } } - C_i[iic+1] = num_nonzeros; + C_i[iic + 1] = num_nonzeros; } twspace[ii] = num_nonzeros; #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif /* Correct C_i - phase 1 */ @@ -134,7 +134,7 @@ hypre_CSRMatrixAddFirstPass( HYPRE_Int firstrow, for (ic = firstrow; ic < lastrow; ic++) { iic = rownnz_C ? rownnz_C[ic] : ic; - C_i[iic+1] += jj; + C_i[iic + 1] += jj; } } else @@ -156,37 +156,37 @@ hypre_CSRMatrixAddFirstPass( HYPRE_Int firstrow, if (rownnz_C != NULL) { #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif - for (ic = firstrow; ic < (lastrow-1); ic++) + for (ic = firstrow; ic < (lastrow - 1); ic++) { - for (iic = rownnz_C[ic] + 1; iic < rownnz_C[ic+1]; iic++) + for (iic = rownnz_C[ic] + 1; iic < rownnz_C[ic + 1]; iic++) { - hypre_assert(C_i[iic+1] == 0); - C_i[iic+1] = C_i[rownnz_C[ic]+1]; + hypre_assert(C_i[iic + 1] == 0); + C_i[iic + 1] = C_i[rownnz_C[ic] + 1]; } } if (ii < (num_threads - 1)) { - for (iic = rownnz_C[lastrow-1] + 1; iic < rownnz_C[lastrow]; iic++) + for (iic = rownnz_C[lastrow - 1] + 1; iic < rownnz_C[lastrow]; iic++) { - hypre_assert(C_i[iic+1] == 0); - C_i[iic+1] = C_i[rownnz_C[lastrow-1]+1]; + hypre_assert(C_i[iic + 1] == 0); + C_i[iic + 1] = C_i[rownnz_C[lastrow - 1] + 1]; } } else { - for (iic = rownnz_C[lastrow-1] + 1; iic < nrows_C; iic++) + for (iic = rownnz_C[lastrow - 1] + 1; iic < nrows_C; iic++) { - hypre_assert(C_i[iic+1] == 0); - C_i[iic+1] = C_i[rownnz_C[lastrow-1]+1]; + hypre_assert(C_i[iic + 1] == 0); + C_i[iic + 1] = C_i[rownnz_C[lastrow - 1] + 1]; } } } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif #ifdef HYPRE_DEBUG @@ -194,12 +194,12 @@ hypre_CSRMatrixAddFirstPass( HYPRE_Int firstrow, { for (i = 0; i < nrows_C; i++) { - hypre_assert(C_i[i] <= C_i[i+1]); - hypre_assert(((A_i[i+1] - A_i[i]) + - (B_i[i+1] - B_i[i])) >= - (C_i[i+1] - C_i[i])); - hypre_assert((C_i[i+1] - C_i[i]) >= (A_i[i+1] - A_i[i])); - hypre_assert((C_i[i+1] - C_i[i]) >= (B_i[i+1] - B_i[i])); + hypre_assert(C_i[i] <= C_i[i + 1]); + hypre_assert(((A_i[i + 1] - A_i[i]) + + (B_i[i + 1] - B_i[i])) >= + (C_i[i + 1] - C_i[i])); + hypre_assert((C_i[i + 1] - C_i[i]) >= (A_i[i + 1] - A_i[i])); + hypre_assert((C_i[i + 1] - C_i[i]) >= (B_i[i + 1] - B_i[i])); } hypre_assert((C_i[nrows_C] - C_i[0]) == num_nonzeros); } @@ -219,7 +219,6 @@ hypre_CSRMatrixAddFirstPass( HYPRE_Int firstrow, HYPRE_Int hypre_CSRMatrixAddSecondPass( HYPRE_Int firstrow, HYPRE_Int lastrow, - HYPRE_Int *twspace, HYPRE_Int *marker, HYPRE_Int *map_A2C, HYPRE_Int *map_B2C, @@ -266,32 +265,32 @@ hypre_CSRMatrixAddSecondPass( HYPRE_Int firstrow, { iic = rownnz_C ? rownnz_C[ic] : ic; - for (ia = A_i[iic]; ia < A_i[iic+1]; ia++) + for (ia = A_i[iic]; ia < A_i[iic + 1]; ia++) { jcol = map_A2C[A_j[ia]]; C_j[pos] = jcol; - C_data[pos] = alpha*A_data[ia]; + C_data[pos] = alpha * A_data[ia]; marker[jcol] = pos; pos++; } - for (ib = B_i[iic]; ib < B_i[iic+1]; ib++) + for (ib = B_i[iic]; ib < B_i[iic + 1]; ib++) { jcol = map_B2C[B_j[ib]]; if (marker[jcol] < C_i[iic]) { C_j[pos] = jcol; - C_data[pos] = beta*B_data[ib]; + C_data[pos] = beta * B_data[ib]; marker[jcol] = pos; pos++; } else { hypre_assert(C_j[marker[jcol]] == jcol); - C_data[marker[jcol]] += beta*B_data[ib]; + C_data[marker[jcol]] += beta * B_data[ib]; } } - hypre_assert(pos == C_i[iic+1]); + hypre_assert(pos == C_i[iic + 1]); } /* end for loop */ } else @@ -300,35 +299,35 @@ hypre_CSRMatrixAddSecondPass( HYPRE_Int firstrow, { iic = rownnz_C ? rownnz_C[ic] : ic; - for (ia = A_i[iic]; ia < A_i[iic+1]; ia++) + for (ia = A_i[iic]; ia < A_i[iic + 1]; ia++) { jcol = A_j[ia]; C_j[pos] = jcol; - C_data[pos] = alpha*A_data[ia]; + C_data[pos] = alpha * A_data[ia]; marker[jcol] = pos; pos++; } - for (ib = B_i[iic]; ib < B_i[iic+1]; ib++) + for (ib = B_i[iic]; ib < B_i[iic + 1]; ib++) { jcol = B_j[ib]; if (marker[jcol] < C_i[iic]) { C_j[pos] = jcol; - C_data[pos] = beta*B_data[ib]; + C_data[pos] = beta * B_data[ib]; marker[jcol] = pos; pos++; } else { hypre_assert(C_j[marker[jcol]] == jcol); - C_data[marker[jcol]] += beta*B_data[ib]; + C_data[marker[jcol]] += beta * B_data[ib]; } } - hypre_assert(pos == C_i[iic+1]); + hypre_assert(pos == C_i[iic + 1]); } /* end for loop */ } - hypre_assert(pos == C_i[rownnz_C ? rownnz_C[lastrow-1] + 1 : lastrow]); + hypre_assert(pos == C_i[rownnz_C ? rownnz_C[lastrow - 1] + 1 : lastrow]); return hypre_error_flag; } @@ -384,7 +383,7 @@ hypre_CSRMatrixAddHost ( HYPRE_Complex alpha, if (nrows_A != nrows_B || ncols_A != ncols_B) { - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Warning! incompatible matrix dimensions!\n"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Warning! incompatible matrix dimensions!\n"); return NULL; } @@ -396,9 +395,20 @@ hypre_CSRMatrixAddHost ( HYPRE_Complex alpha, nnzrows_C = nrows_A; if ((nnzrows_A < nrows_A) && (nnzrows_B < nrows_B)) { - hypre_MergeOrderedArrays(nnzrows_A, rownnz_A, - nnzrows_B, rownnz_B, - &nnzrows_C, &rownnz_C); + hypre_IntArray arr_A; + hypre_IntArray arr_B; + hypre_IntArray arr_C; + + hypre_IntArrayData(&arr_A) = rownnz_A; + hypre_IntArrayData(&arr_B) = rownnz_B; + hypre_IntArraySize(&arr_A) = nnzrows_A; + hypre_IntArraySize(&arr_B) = nnzrows_B; + hypre_IntArrayMemoryLocation(&arr_C) = memory_location_C; + + hypre_IntArrayMergeOrdered(&arr_A, &arr_B, &arr_C); + + nnzrows_C = hypre_IntArraySize(&arr_C); + rownnz_C = hypre_IntArrayData(&arr_C); } else { @@ -406,7 +416,7 @@ hypre_CSRMatrixAddHost ( HYPRE_Complex alpha, } #ifdef HYPRE_USING_OPENMP -#pragma omp parallel + #pragma omp parallel #endif { HYPRE_Int ns, ne; @@ -420,7 +430,7 @@ hypre_CSRMatrixAddHost ( HYPRE_Complex alpha, A, B, nrows_A, nnzrows_C, ncols_A, rownnz_C, memory_location_C, C_i, &C); - hypre_CSRMatrixAddSecondPass(ns, ne, twspace, marker, NULL, NULL, + hypre_CSRMatrixAddSecondPass(ns, ne, marker, NULL, NULL, rownnz_C, alpha, beta, A, B, C); hypre_TFree(marker, HYPRE_MEMORY_HOST); @@ -509,7 +519,7 @@ hypre_CSRMatrixBigAdd( hypre_CSRMatrix *A, if (nrows_A != nrows_B || ncols_A != ncols_B) { - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Warning! incompatible matrix dimensions!\n"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Warning! incompatible matrix dimensions!\n"); return NULL; } @@ -518,7 +528,7 @@ hypre_CSRMatrixBigAdd( hypre_CSRMatrix *A, C_i = hypre_CTAlloc(HYPRE_Int, nrows_A + 1, memory_location_C); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel + #pragma omp parallel #endif { HYPRE_Int ia, ib, ic, num_nonzeros; @@ -543,14 +553,14 @@ hypre_CSRMatrixBigAdd( hypre_CSRMatrix *A, for (ic = ns; ic < ne; ic++) { C_i[ic] = num_nonzeros; - for (ia = A_i[ic]; ia < A_i[ic+1]; ia++) + for (ia = A_i[ic]; ia < A_i[ic + 1]; ia++) { jcol = A_j[ia]; marker[jcol] = ic; num_nonzeros++; } - for (ib = B_i[ic]; ib < B_i[ic+1]; ib++) + for (ib = B_i[ic]; ib < B_i[ic + 1]; ib++) { jcol = B_j[ib]; if (marker[jcol] != ic) @@ -559,12 +569,12 @@ hypre_CSRMatrixBigAdd( hypre_CSRMatrix *A, num_nonzeros++; } } - C_i[ic+1] = num_nonzeros; + C_i[ic + 1] = num_nonzeros; } twspace[ii] = num_nonzeros; #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif /* Correct row pointer */ @@ -605,7 +615,7 @@ hypre_CSRMatrixBigAdd( hypre_CSRMatrix *A, pos = C_i[ns]; for (ic = ns; ic < ne; ic++) { - for (ia = A_i[ic]; ia < A_i[ic+1]; ia++) + for (ia = A_i[ic]; ia < A_i[ic + 1]; ia++) { jcol = A_j[ia]; C_j[pos] = jcol; @@ -614,7 +624,7 @@ hypre_CSRMatrixBigAdd( hypre_CSRMatrix *A, pos++; } - for (ib = B_i[ic]; ib < B_i[ic+1]; ib++) + for (ib = B_i[ic]; ib < B_i[ic + 1]; ib++) { jcol = B_j[ib]; if (marker[jcol] < C_i[ic]) @@ -697,7 +707,7 @@ hypre_CSRMatrixMultiplyHost( hypre_CSRMatrix *A, if (ncols_A != nrows_B) { - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Warning! incompatible matrix dimensions!\n"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Warning! incompatible matrix dimensions!\n"); return NULL; } @@ -717,10 +727,10 @@ hypre_CSRMatrixMultiplyHost( hypre_CSRMatrix *A, /* Allocate memory */ twspace = hypre_TAlloc(HYPRE_Int, hypre_NumThreads(), HYPRE_MEMORY_HOST); - C_i = hypre_CTAlloc(HYPRE_Int, nrows_A+1, memory_location_C); + C_i = hypre_CTAlloc(HYPRE_Int, nrows_A + 1, memory_location_C); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel private(ia, ib, ic, ja, jb, num_nonzeros, counter, a_entry, b_entry) + #pragma omp parallel private(ia, ib, ic, ja, jb, num_nonzeros, counter, a_entry, b_entry) #endif { HYPRE_Int *B_marker = NULL; @@ -760,10 +770,10 @@ hypre_CSRMatrixMultiplyHost( hypre_CSRMatrix *A, } } - for (ia = A_i[iic]; ia < A_i[iic+1]; ia++) + for (ia = A_i[iic]; ia < A_i[iic + 1]; ia++) { ja = A_j[ia]; - for (ib = B_i[ja]; ib < B_i[ja+1]; ib++) + for (ib = B_i[ja]; ib < B_i[ja + 1]; ib++) { jb = B_j[ib]; if (B_marker[jb] != iic) @@ -777,7 +787,7 @@ hypre_CSRMatrixMultiplyHost( hypre_CSRMatrix *A, twspace[ii] = num_nonzeros; #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif /* Correct C_i - phase 1 */ @@ -814,26 +824,26 @@ hypre_CSRMatrixMultiplyHost( hypre_CSRMatrix *A, if (rownnz_A != NULL) { #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif - for (ic = ns; ic < (ne-1); ic++) + for (ic = ns; ic < (ne - 1); ic++) { - for (iic = rownnz_A[ic] + 1; iic < rownnz_A[ic+1]; iic++) + for (iic = rownnz_A[ic] + 1; iic < rownnz_A[ic + 1]; iic++) { - C_i[iic] = C_i[rownnz_A[ic+1]]; + C_i[iic] = C_i[rownnz_A[ic + 1]]; } } if (ii < (num_threads - 1)) { - for (iic = rownnz_A[ne-1] + 1; iic < rownnz_A[ne]; iic++) + for (iic = rownnz_A[ne - 1] + 1; iic < rownnz_A[ne]; iic++) { C_i[iic] = C_i[rownnz_A[ne]]; } } else { - for (iic = rownnz_A[ne-1] + 1; iic < nrows_A; iic++) + for (iic = rownnz_A[ne - 1] + 1; iic < nrows_A; iic++) { C_i[iic] = C_i[nrows_A]; } @@ -843,7 +853,7 @@ hypre_CSRMatrixMultiplyHost( hypre_CSRMatrix *A, HYPRE_ANNOTATE_REGION_END("%s", "First pass"); #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif /* Second pass: Fill in C_data and C_j. */ @@ -872,11 +882,11 @@ hypre_CSRMatrixMultiplyHost( hypre_CSRMatrix *A, } } - for (ia = A_i[iic]; ia < A_i[iic+1]; ia++) + for (ia = A_i[iic]; ia < A_i[iic + 1]; ia++) { ja = A_j[ia]; a_entry = A_data[ia]; - for (ib = B_i[ja]; ib < B_i[ja+1]; ib++) + for (ib = B_i[ja]; ib < B_i[ja + 1]; ib++) { jb = B_j[ib]; b_entry = B_data[ib]; @@ -884,12 +894,12 @@ hypre_CSRMatrixMultiplyHost( hypre_CSRMatrix *A, { B_marker[jb] = counter; C_j[B_marker[jb]] = jb; - C_data[B_marker[jb]] = a_entry*b_entry; + C_data[B_marker[jb]] = a_entry * b_entry; counter++; } else { - C_data[B_marker[jb]] += a_entry*b_entry; + C_data[B_marker[jb]] += a_entry * b_entry; } } } @@ -903,7 +913,7 @@ hypre_CSRMatrixMultiplyHost( hypre_CSRMatrix *A, #ifdef HYPRE_DEBUG for (ic = 0; ic < nrows_A; ic++) { - hypre_assert(C_i[ic] <= C_i[ic+1]); + hypre_assert(C_i[ic] <= C_i[ic + 1]); } #endif @@ -922,18 +932,18 @@ hypre_CSRMatrixMultiply( hypre_CSRMatrix *A, { hypre_CSRMatrix *C = NULL; -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy2( hypre_CSRMatrixMemoryLocation(A), - hypre_CSRMatrixMemoryLocation(B) ); + hypre_CSRMatrixMemoryLocation(B) ); if (exec == HYPRE_EXEC_DEVICE) { - C = hypre_CSRMatrixMultiplyDevice(A,B); + C = hypre_CSRMatrixMultiplyDevice(A, B); } else #endif { - C = hypre_CSRMatrixMultiplyHost(A,B); + C = hypre_CSRMatrixMultiplyHost(A, B); } return C; @@ -974,7 +984,7 @@ hypre_CSRMatrixDeleteZeros( hypre_CSRMatrix *A, if (zeros) { - B = hypre_CSRMatrixCreate(nrows_A,ncols_A,num_nonzeros-zeros); + B = hypre_CSRMatrixCreate(nrows_A, ncols_A, num_nonzeros - zeros); hypre_CSRMatrixInitialize(B); B_i = hypre_CSRMatrixI(B); B_j = hypre_CSRMatrixJ(B); @@ -983,7 +993,7 @@ hypre_CSRMatrixDeleteZeros( hypre_CSRMatrix *A, pos_A = pos_B = 0; for (i = 0; i < nrows_A; i++) { - for (j = A_i[i]; j < A_i[i+1]; j++) + for (j = A_i[i]; j < A_i[i + 1]; j++) { if (hypre_cabs(A_data[j]) <= tol) { @@ -997,7 +1007,7 @@ hypre_CSRMatrixDeleteZeros( hypre_CSRMatrix *A, pos_A++; } } - B_i[i+1] = pos_B; + B_i[i + 1] = pos_B; } return B; @@ -1022,7 +1032,7 @@ hypre_CSRMatrixDeleteZeros( hypre_CSRMatrix *A, static inline HYPRE_Int transpose_idx (HYPRE_Int idx, HYPRE_Int dim1, HYPRE_Int dim2) { - return idx%dim1*dim2 + idx/dim1; + return idx % dim1 * dim2 + idx / dim1; } /*-------------------------------------------------------------------------- @@ -1045,7 +1055,7 @@ hypre_CSRMatrixTransposeHost(hypre_CSRMatrix *A, HYPRE_Int num_nnzs_A = hypre_CSRMatrixNumNonzeros(A); HYPRE_MemoryLocation memory_location = hypre_CSRMatrixMemoryLocation(A); - HYPRE_Complex *AT_data; + HYPRE_Complex *AT_data = NULL; HYPRE_Int *AT_j; HYPRE_Int num_rows_AT; HYPRE_Int num_cols_AT; @@ -1060,7 +1070,7 @@ hypre_CSRMatrixTransposeHost(hypre_CSRMatrix *A, *--------------------------------------------------------------*/ HYPRE_ANNOTATE_FUNC_BEGIN; - if (!num_nnzs_A) + if (!num_nnzs_A && A_i) { num_nnzs_A = A_i[num_rows_A]; } @@ -1070,7 +1080,7 @@ hypre_CSRMatrixTransposeHost(hypre_CSRMatrix *A, max_col = -1; for (i = 0; i < num_rows_A; ++i) { - for (j = A_i[i]; j < A_i[i+1]; j++) + for (j = A_i[i]; j < A_i[i + 1]; j++) { if (A_j[j] > max_col) { @@ -1109,11 +1119,11 @@ hypre_CSRMatrixTransposeHost(hypre_CSRMatrix *A, /*----------------------------------------------------------------- * Parallel count sort *-----------------------------------------------------------------*/ - HYPRE_Int *bucket = hypre_CTAlloc(HYPRE_Int, (num_cols_A + 1)*hypre_NumThreads(), + HYPRE_Int *bucket = hypre_CTAlloc(HYPRE_Int, (num_cols_A + 1) * hypre_NumThreads(), HYPRE_MEMORY_HOST); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel + #pragma omp parallel #endif { HYPRE_Int ii, num_threads, ns, ne; @@ -1137,7 +1147,7 @@ hypre_CSRMatrixTransposeHost(hypre_CSRMatrix *A, { for (j = A_i[ns]; j < A_i[ne]; ++j) { - bucket[ii*num_cols_A + A_j[j]]++; + bucket[ii * num_cols_A + A_j[j]]++; } } else @@ -1145,9 +1155,9 @@ hypre_CSRMatrixTransposeHost(hypre_CSRMatrix *A, for (i = ns; i < ne; i++) { ir = rownnz_A[i]; - for (j = A_i[ir]; j < A_i[ir+1]; ++j) + for (j = A_i[ir]; j < A_i[ir + 1]; ++j) { - bucket[ii*num_cols_A + A_j[j]]++; + bucket[ii * num_cols_A + A_j[j]]++; } } } @@ -1157,10 +1167,10 @@ hypre_CSRMatrixTransposeHost(hypre_CSRMatrix *A, * accessed as if it is transposed as HYPRE_Int[num_colsA][num_threads] *-----------------------------------------------------------------*/ #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif - for (i = ii*num_cols_A + 1; i < (ii + 1)*num_cols_A; ++i) + for (i = ii * num_cols_A + 1; i < (ii + 1)*num_cols_A; ++i) { transpose_i = transpose_idx(i, num_threads, num_cols_A); transpose_i_minus_1 = transpose_idx(i - 1, num_threads, num_cols_A); @@ -1169,14 +1179,14 @@ hypre_CSRMatrixTransposeHost(hypre_CSRMatrix *A, } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier -#pragma omp master + #pragma omp barrier + #pragma omp master #endif { for (i = 1; i < num_threads; ++i) { - j0 = num_cols_A*i - 1; - j1 = num_cols_A*(i + 1) - 1; + j0 = num_cols_A * i - 1; + j1 = num_cols_A * (i + 1) - 1; transpose_j0 = transpose_idx(j0, num_threads, num_cols_A); transpose_j1 = transpose_idx(j1, num_threads, num_cols_A); @@ -1184,15 +1194,15 @@ hypre_CSRMatrixTransposeHost(hypre_CSRMatrix *A, } } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif if (ii > 0) { - transpose_i0 = transpose_idx(num_cols_A*ii - 1, num_threads, num_cols_A); + transpose_i0 = transpose_idx(num_cols_A * ii - 1, num_threads, num_cols_A); offset = bucket[transpose_i0]; - for (i = ii*num_cols_A; i < (ii + 1)*num_cols_A - 1; ++i) + for (i = ii * num_cols_A; i < (ii + 1)*num_cols_A - 1; ++i) { transpose_i = transpose_idx(i, num_threads, num_cols_A); @@ -1201,7 +1211,7 @@ hypre_CSRMatrixTransposeHost(hypre_CSRMatrix *A, } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif /*---------------------------------------------------------------- @@ -1216,9 +1226,9 @@ hypre_CSRMatrixTransposeHost(hypre_CSRMatrix *A, for (j = A_i[ir + 1] - 1; j >= A_i[ir]; --j) { idx = A_j[j]; - --bucket[ii*num_cols_A + idx]; + --bucket[ii * num_cols_A + idx]; - offset = bucket[ii*num_cols_A + idx]; + offset = bucket[ii * num_cols_A + idx]; AT_data[offset] = A_data[j]; AT_j[offset] = ir; } @@ -1232,9 +1242,9 @@ hypre_CSRMatrixTransposeHost(hypre_CSRMatrix *A, for (j = A_i[ir + 1] - 1; j >= A_i[ir]; --j) { idx = A_j[j]; - --bucket[ii*num_cols_A + idx]; + --bucket[ii * num_cols_A + idx]; - offset = bucket[ii*num_cols_A + idx]; + offset = bucket[ii * num_cols_A + idx]; AT_j[offset] = ir; } } @@ -1242,7 +1252,8 @@ hypre_CSRMatrixTransposeHost(hypre_CSRMatrix *A, } /* end parallel region */ hypre_CSRMatrixI(*AT) = hypre_TAlloc(HYPRE_Int, num_cols_A + 1, memory_location); - hypre_TMemcpy(hypre_CSRMatrixI(*AT), bucket, HYPRE_Int, num_cols_A + 1, memory_location, HYPRE_MEMORY_HOST); + hypre_TMemcpy(hypre_CSRMatrixI(*AT), bucket, HYPRE_Int, num_cols_A + 1, memory_location, + HYPRE_MEMORY_HOST); hypre_CSRMatrixI(*AT)[num_cols_A] = num_nnzs_A; hypre_TFree(bucket, HYPRE_MEMORY_HOST); @@ -1268,7 +1279,7 @@ hypre_CSRMatrixTranspose(hypre_CSRMatrix *A, { HYPRE_Int ierr = 0; -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_CSRMatrixMemoryLocation(A) ); if (exec == HYPRE_EXEC_DEVICE) @@ -1281,6 +1292,8 @@ hypre_CSRMatrixTranspose(hypre_CSRMatrix *A, ierr = hypre_CSRMatrixTransposeHost(A, AT, data); } + hypre_CSRMatrixSetPatternOnly(*AT, hypre_CSRMatrixPatternOnly(A)); + return ierr; } @@ -1289,15 +1302,16 @@ hypre_CSRMatrixTranspose(hypre_CSRMatrix *A, *--------------------------------------------------------------------------*/ /* RL: TODO add memory locations */ -HYPRE_Int hypre_CSRMatrixSplit(hypre_CSRMatrix *Bs_ext, - HYPRE_BigInt first_col_diag_B, - HYPRE_BigInt last_col_diag_B, - HYPRE_Int num_cols_offd_B, - HYPRE_BigInt *col_map_offd_B, - HYPRE_Int *num_cols_offd_C_ptr, - HYPRE_BigInt **col_map_offd_C_ptr, - hypre_CSRMatrix **Bext_diag_ptr, - hypre_CSRMatrix **Bext_offd_ptr) +HYPRE_Int +hypre_CSRMatrixSplit(hypre_CSRMatrix *Bs_ext, + HYPRE_BigInt first_col_diag_B, + HYPRE_BigInt last_col_diag_B, + HYPRE_Int num_cols_offd_B, + HYPRE_BigInt *col_map_offd_B, + HYPRE_Int *num_cols_offd_C_ptr, + HYPRE_BigInt **col_map_offd_C_ptr, + hypre_CSRMatrix **Bext_diag_ptr, + hypre_CSRMatrix **Bext_offd_ptr) { HYPRE_Complex *Bs_ext_data = hypre_CSRMatrixData(Bs_ext); HYPRE_Int *Bs_ext_i = hypre_CSRMatrixI(Bs_ext); @@ -1310,10 +1324,11 @@ HYPRE_Int hypre_CSRMatrixSplit(hypre_CSRMatrix *Bs_ext, HYPRE_Complex *B_ext_diag_data = NULL; HYPRE_Int *B_ext_offd_i = NULL; HYPRE_Int *B_ext_offd_j = NULL; + HYPRE_BigInt *B_ext_offd_bigj = NULL; HYPRE_Complex *B_ext_offd_data = NULL; HYPRE_Int *my_diag_array; HYPRE_Int *my_offd_array; - HYPRE_BigInt *temp; + HYPRE_BigInt *temp = NULL; HYPRE_Int max_num_threads; HYPRE_Int cnt = 0; hypre_CSRMatrix *Bext_diag = NULL; @@ -1321,15 +1336,15 @@ HYPRE_Int hypre_CSRMatrixSplit(hypre_CSRMatrix *Bs_ext, HYPRE_BigInt *col_map_offd_C = NULL; HYPRE_Int num_cols_offd_C = 0; - B_ext_diag_i = hypre_CTAlloc(HYPRE_Int, num_rows_Bext+1, HYPRE_MEMORY_HOST); - B_ext_offd_i = hypre_CTAlloc(HYPRE_Int, num_rows_Bext+1, HYPRE_MEMORY_HOST); + B_ext_diag_i = hypre_CTAlloc(HYPRE_Int, num_rows_Bext + 1, HYPRE_MEMORY_HOST); + B_ext_offd_i = hypre_CTAlloc(HYPRE_Int, num_rows_Bext + 1, HYPRE_MEMORY_HOST); max_num_threads = hypre_NumThreads(); my_diag_array = hypre_CTAlloc(HYPRE_Int, max_num_threads, HYPRE_MEMORY_HOST); my_offd_array = hypre_CTAlloc(HYPRE_Int, max_num_threads, HYPRE_MEMORY_HOST); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel + #pragma omp parallel #endif { HYPRE_Int ns, ne, ii, num_threads; @@ -1343,11 +1358,11 @@ HYPRE_Int hypre_CSRMatrixSplit(hypre_CSRMatrix *Bs_ext, my_diag_size = 0; my_offd_size = 0; - for (i=ns; i < ne; i++) + for (i = ns; i < ne; i++) { B_ext_diag_i[i] = my_diag_size; B_ext_offd_i[i] = my_offd_size; - for (j = Bs_ext_i[i]; j < Bs_ext_i[i+1]; j++) + for (j = Bs_ext_i[i]; j < Bs_ext_i[i + 1]; j++) { if (Bs_ext_j[j] < first_col_diag_B || Bs_ext_j[j] > last_col_diag_B) { @@ -1363,7 +1378,7 @@ HYPRE_Int hypre_CSRMatrixSplit(hypre_CSRMatrix *Bs_ext, my_offd_array[ii] = my_offd_size; #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif if (ii) @@ -1394,41 +1409,37 @@ HYPRE_Int hypre_CSRMatrixSplit(hypre_CSRMatrix *Bs_ext, B_ext_diag_i[num_rows_Bext] = B_ext_diag_size; B_ext_offd_i[num_rows_Bext] = B_ext_offd_size; - if (B_ext_diag_size) - { - B_ext_diag_j = hypre_CTAlloc(HYPRE_Int, B_ext_diag_size, HYPRE_MEMORY_HOST); - B_ext_diag_data = hypre_CTAlloc(HYPRE_Complex, B_ext_diag_size, HYPRE_MEMORY_HOST); - } - if (B_ext_offd_size) - { - B_ext_offd_j = hypre_CTAlloc(HYPRE_Int, B_ext_offd_size, HYPRE_MEMORY_HOST); - B_ext_offd_data = hypre_CTAlloc(HYPRE_Complex, B_ext_offd_size, HYPRE_MEMORY_HOST); - } + B_ext_diag_j = hypre_CTAlloc(HYPRE_Int, B_ext_diag_size, HYPRE_MEMORY_HOST); + B_ext_diag_data = hypre_CTAlloc(HYPRE_Complex, B_ext_diag_size, HYPRE_MEMORY_HOST); + B_ext_offd_j = hypre_CTAlloc(HYPRE_Int, B_ext_offd_size, HYPRE_MEMORY_HOST); + B_ext_offd_bigj = hypre_CTAlloc(HYPRE_BigInt, B_ext_offd_size, HYPRE_MEMORY_HOST); + B_ext_offd_data = hypre_CTAlloc(HYPRE_Complex, B_ext_offd_size, HYPRE_MEMORY_HOST); if (B_ext_offd_size || num_cols_offd_B) { - temp = hypre_CTAlloc(HYPRE_BigInt, B_ext_offd_size + num_cols_offd_B, HYPRE_MEMORY_HOST); + temp = hypre_CTAlloc(HYPRE_BigInt, B_ext_offd_size + num_cols_offd_B, + HYPRE_MEMORY_HOST); } } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif cnt_offd = B_ext_offd_i[ns]; cnt_diag = B_ext_diag_i[ns]; for (i = ns; i < ne; i++) { - for (j = Bs_ext_i[i]; j < Bs_ext_i[i+1]; j++) + for (j = Bs_ext_i[i]; j < Bs_ext_i[i + 1]; j++) { if (Bs_ext_j[j] < first_col_diag_B || Bs_ext_j[j] > last_col_diag_B) { temp[cnt_offd] = Bs_ext_j[j]; - B_ext_offd_j[cnt_offd] = Bs_ext_j[j]; + B_ext_offd_bigj[cnt_offd] = Bs_ext_j[j]; B_ext_offd_data[cnt_offd++] = Bs_ext_data[j]; } else { - B_ext_diag_j[cnt_diag] = Bs_ext_j[j] - first_col_diag_B; + B_ext_diag_j[cnt_diag] = (HYPRE_Int) (Bs_ext_j[j] - first_col_diag_B); B_ext_diag_data[cnt_diag++] = Bs_ext_data[j]; } } @@ -1436,7 +1447,7 @@ HYPRE_Int hypre_CSRMatrixSplit(hypre_CSRMatrix *Bs_ext, /* This computes the mappings */ #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif if (ii == 0) @@ -1445,13 +1456,13 @@ HYPRE_Int hypre_CSRMatrixSplit(hypre_CSRMatrix *Bs_ext, if (B_ext_offd_size || num_cols_offd_B) { cnt = B_ext_offd_size; - for (i=0; i < num_cols_offd_B; i++) + for (i = 0; i < num_cols_offd_B; i++) { temp[cnt++] = col_map_offd_B[i]; } if (cnt) { - hypre_BigQsort0(temp, 0, cnt-1); + hypre_BigQsort0(temp, 0, cnt - 1); num_cols_offd_C = 1; HYPRE_BigInt value = temp[0]; for (i = 1; i < cnt; i++) @@ -1479,22 +1490,27 @@ HYPRE_Int hypre_CSRMatrixSplit(hypre_CSRMatrix *Bs_ext, } #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif for (i = ns; i < ne; i++) { - for (j = B_ext_offd_i[i]; j < B_ext_offd_i[i+1]; j++) + for (j = B_ext_offd_i[i]; j < B_ext_offd_i[i + 1]; j++) { - B_ext_offd_j[j] = hypre_BigBinarySearch(col_map_offd_C, B_ext_offd_j[j], num_cols_offd_C); + B_ext_offd_j[j] = hypre_BigBinarySearch(col_map_offd_C, + B_ext_offd_bigj[j], + num_cols_offd_C); } } } /* end parallel region */ hypre_TFree(my_diag_array, HYPRE_MEMORY_HOST); hypre_TFree(my_offd_array, HYPRE_MEMORY_HOST); + hypre_TFree(B_ext_offd_bigj, HYPRE_MEMORY_HOST); - Bext_diag = hypre_CSRMatrixCreate(num_rows_Bext, last_col_diag_B-first_col_diag_B+1, B_ext_diag_size); + Bext_diag = hypre_CSRMatrixCreate(num_rows_Bext, + (HYPRE_Int) (last_col_diag_B - first_col_diag_B + 1), + B_ext_diag_size); hypre_CSRMatrixMemoryLocation(Bext_diag) = HYPRE_MEMORY_HOST; Bext_offd = hypre_CSRMatrixCreate(num_rows_Bext, num_cols_offd_C, B_ext_offd_size); hypre_CSRMatrixMemoryLocation(Bext_offd) = HYPRE_MEMORY_HOST; @@ -1537,12 +1553,12 @@ hypre_CSRMatrixReorderHost(hypre_CSRMatrix *A) } #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i, ii, j) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i, ii, j) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < nnzrows_A; i++) { ii = rownnz_A ? rownnz_A[i] : i; - for (j = A_i[ii]; j < A_i[ii+1]; j++) + for (j = A_i[ii]; j < A_i[ii + 1]; j++) { if (A_j[j] == ii) { @@ -1571,7 +1587,7 @@ hypre_CSRMatrixReorder(hypre_CSRMatrix *A) { HYPRE_Int ierr = 0; -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_CSRMatrixMemoryLocation(A) ); if (exec == HYPRE_EXEC_DEVICE) @@ -1636,22 +1652,22 @@ hypre_CSRMatrixAddPartial( hypre_CSRMatrix *A, if (ncols_A != ncols_B) { - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Warning! incompatible matrix dimensions!\n"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Warning! incompatible matrix dimensions!\n"); return NULL; } map = hypre_CTAlloc(HYPRE_Int, nrows_B, HYPRE_MEMORY_HOST); temp = hypre_CTAlloc(HYPRE_Int, nrows_B, HYPRE_MEMORY_HOST); - for (i=0; i < nrows_B; i++) + for (i = 0; i < nrows_B; i++) { map[i] = i; temp[i] = row_nums[i]; } - hypre_qsort2i(temp,map,0,nrows_B-1); + hypre_qsort2i(temp, map, 0, nrows_B - 1); marker = hypre_CTAlloc(HYPRE_Int, ncols_A, HYPRE_MEMORY_HOST); - C_i = hypre_CTAlloc(HYPRE_Int, nrows_A+1, memory_location_C); + C_i = hypre_CTAlloc(HYPRE_Int, nrows_A + 1, memory_location_C); for (ia = 0; ia < ncols_A; ia++) { @@ -1663,7 +1679,7 @@ hypre_CSRMatrixAddPartial( hypre_CSRMatrix *A, cnt = 0; for (ic = 0; ic < nrows_A; ic++) { - for (ia = A_i[ic]; ia < A_i[ic+1]; ia++) + for (ia = A_i[ic]; ia < A_i[ic + 1]; ia++) { jcol = A_j[ia]; marker[jcol] = ic; @@ -1676,7 +1692,7 @@ hypre_CSRMatrixAddPartial( hypre_CSRMatrix *A, if (temp[j] == ic) { i2 = map[cnt++]; - for (ib = B_i[i2]; ib < B_i[i2+1]; ib++) + for (ib = B_i[i2]; ib < B_i[i2 + 1]; ib++) { jcol = B_j[ib]; if (marker[jcol] != ic) @@ -1692,7 +1708,7 @@ hypre_CSRMatrixAddPartial( hypre_CSRMatrix *A, } } } - C_i[ic+1] = num_nonzeros; + C_i[ic + 1] = num_nonzeros; } C = hypre_CSRMatrixCreate(nrows_A, ncols_A, num_nonzeros); @@ -1710,7 +1726,7 @@ hypre_CSRMatrixAddPartial( hypre_CSRMatrix *A, pos = 0; for (ic = 0; ic < nrows_A; ic++) { - for (ia = A_i[ic]; ia < A_i[ic+1]; ia++) + for (ia = A_i[ic]; ia < A_i[ic + 1]; ia++) { jcol = A_j[ia]; C_j[pos] = jcol; @@ -1725,7 +1741,7 @@ hypre_CSRMatrixAddPartial( hypre_CSRMatrix *A, if (temp[j] == ic) { i2 = map[cnt++]; - for (ib = B_i[i2]; ib < B_i[i2+1]; ib++) + for (ib = B_i[i2]; ib < B_i[i2 + 1]; ib++) { jcol = B_j[ib]; if (marker[jcol] < C_i[ic]) @@ -1770,7 +1786,7 @@ hypre_CSRMatrixSumElts( hypre_CSRMatrix *A ) HYPRE_Int i; #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) reduction(+:sum) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) reduction(+:sum) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < num_nonzeros; i++) { @@ -1797,7 +1813,7 @@ hypre_CSRMatrixFnorm( hypre_CSRMatrix *A ) hypre_assert(num_nonzeros == A_i[nrows]); #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) reduction(+:sum) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) reduction(+:sum) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < num_nonzeros; ++i) { @@ -1805,7 +1821,7 @@ hypre_CSRMatrixFnorm( hypre_CSRMatrix *A ) sum += v * v; } - return sqrt(sum); + return hypre_sqrt(sum); } /*-------------------------------------------------------------------------- @@ -1836,7 +1852,7 @@ hypre_CSRMatrixComputeRowSumHost( hypre_CSRMatrix *A, { HYPRE_Complex row_sum_i = set_or_add[0] == 's' ? 0.0 : row_sum[i]; - for (j = A_i[i]; j < A_i[i+1]; j++) + for (j = A_i[i]; j < A_i[i + 1]; j++) { if (CF_i && CF_j && CF_i[i] != CF_j[A_j[j]]) { @@ -1849,7 +1865,7 @@ hypre_CSRMatrixComputeRowSumHost( hypre_CSRMatrix *A, } else if (type == 1) { - row_sum_i += scal * fabs(A_data[j]); + row_sum_i += scal * hypre_cabs(A_data[j]); } else if (type == 2) { @@ -1876,7 +1892,7 @@ hypre_CSRMatrixComputeRowSum( hypre_CSRMatrix *A, { hypre_assert( (CF_i && CF_j) || (!CF_i && !CF_j) ); -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_CSRMatrixMemoryLocation(A) ); if (exec == HYPRE_EXEC_DEVICE) @@ -1899,7 +1915,7 @@ hypre_CSRMatrixComputeRowSum( hypre_CSRMatrix *A, * 4: abs diag inverse sqrt *--------------------------------------------------------------------------*/ -void +HYPRE_Int hypre_CSRMatrixExtractDiagonalHost( hypre_CSRMatrix *A, HYPRE_Complex *d, HYPRE_Int type) @@ -1910,11 +1926,12 @@ hypre_CSRMatrixExtractDiagonalHost( hypre_CSRMatrix *A, HYPRE_Int *A_j = hypre_CSRMatrixJ(A); HYPRE_Int i, j; HYPRE_Complex d_i; + char msg[HYPRE_MAX_MSG_LEN]; for (i = 0; i < nrows; i++) { d_i = 0.0; - for (j = A_i[i]; j < A_i[i+1]; j++) + for (j = A_i[i]; j < A_i[i + 1]; j++) { if (A_j[j] == i) { @@ -1924,25 +1941,35 @@ hypre_CSRMatrixExtractDiagonalHost( hypre_CSRMatrix *A, } else if (type == 1) { - d_i = fabs(A_data[j]); + d_i = hypre_cabs(A_data[j]); } - else if (type == 2) - { - d_i = 1.0 /(A_data[j]); - } - else if (type == 3) - { - d_i = 1.0 /(sqrt(A_data[j])); - } - else if (type == 4) + else { - d_i = 1.0 /(sqrt(fabs(A_data[j]))); + if (A_data[j] == 0.0) + { + hypre_sprintf(msg, "Zero diagonal found at row %i!", i); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, msg); + } + else if (type == 2) + { + d_i = 1.0 / A_data[j]; + } + else if (type == 3) + { + d_i = 1.0 / hypre_sqrt(A_data[j]); + } + else if (type == 4) + { + d_i = 1.0 / hypre_sqrt(hypre_cabs(A_data[j])); + } } break; } } d[i] = d_i; } + + return hypre_error_flag; } /*-------------------------------------------------------------------------- @@ -1954,12 +1981,12 @@ hypre_CSRMatrixExtractDiagonalHost( hypre_CSRMatrix *A, * 3: diag inverse sqrt *--------------------------------------------------------------------------*/ -void +HYPRE_Int hypre_CSRMatrixExtractDiagonal( hypre_CSRMatrix *A, HYPRE_Complex *d, HYPRE_Int type) { -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_CSRMatrixMemoryLocation(A) ); if (exec == HYPRE_EXEC_DEVICE) @@ -1971,10 +1998,16 @@ hypre_CSRMatrixExtractDiagonal( hypre_CSRMatrix *A, { hypre_CSRMatrixExtractDiagonalHost(A, d, type); } + + return hypre_error_flag; } -/* Scale CSR matrix A = scalar * A - */ +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixScale + * + * Scales CSR matrix: A = scalar * A. + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_CSRMatrixScale( hypre_CSRMatrix *A, HYPRE_Complex scalar) @@ -1983,12 +2016,12 @@ hypre_CSRMatrixScale( hypre_CSRMatrix *A, HYPRE_Int i; HYPRE_Int k = hypre_CSRMatrixNumNonzeros(A); -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_CSRMatrixMemoryLocation(A) ); if (exec == HYPRE_EXEC_DEVICE) { - hypreDevice_Scalen(data, k, scalar); + hypreDevice_ComplexScalen(data, k, data, scalar); } else #endif @@ -2002,6 +2035,152 @@ hypre_CSRMatrixScale( hypre_CSRMatrix *A, return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixDiagScaleHost + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixDiagScaleHost( hypre_CSRMatrix *A, + hypre_Vector *ld, + hypre_Vector *rd) +{ + + HYPRE_Int nrows = hypre_CSRMatrixNumRows(A); + HYPRE_Complex *A_data = hypre_CSRMatrixData(A); + HYPRE_Int *A_i = hypre_CSRMatrixI(A); + HYPRE_Int *A_j = hypre_CSRMatrixJ(A); + + HYPRE_Complex *ldata = ld ? hypre_VectorData(ld) : NULL; + HYPRE_Complex *rdata = rd ? hypre_VectorData(rd) : NULL; + HYPRE_Int lsize = ld ? hypre_VectorSize(ld) : 0; + HYPRE_Int rsize = rd ? hypre_VectorSize(rd) : 0; + + HYPRE_Int i, j; + HYPRE_Complex sl; + HYPRE_Complex sr; + + if (ldata && rdata) + { +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i, j, sl, sr) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < nrows; i++) + { + sl = ldata[i]; + for (j = A_i[i]; j < A_i[i + 1]; j++) + { + sr = rdata[A_j[j]]; + A_data[j] = sl * A_data[j] * sr; + } + } + } + else if (ldata && !rdata) + { +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i, j, sl) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < nrows; i++) + { + sl = ldata[i]; + for (j = A_i[i]; j < A_i[i + 1]; j++) + { + A_data[j] = sl * A_data[j]; + } + } + } + else if (!ldata && rdata) + { +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i, j, sr) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < nrows; i++) + { + for (j = A_i[i]; j < A_i[i + 1]; j++) + { + sr = rdata[A_j[j]]; + A_data[j] = A_data[j] * sr; + } + } + } + else + { + /* Throw an error if the scaling factors should have a size different than zero */ + if (lsize || rsize) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Scaling matrices are not set!\n"); + } + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixDiagScale + * + * Computes A = diag(ld) * A * diag(rd), where the diagonal matrices + * "diag(ld)" and "diag(rd)" are stored as local vectors. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixDiagScale( hypre_CSRMatrix *A, + hypre_Vector *ld, + hypre_Vector *rd) +{ + /* Sanity checks */ + if (ld && hypre_VectorSize(ld) && !hypre_VectorData(ld)) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ld scaling coefficients are not set\n"); + return hypre_error_flag; + } + + if (rd && hypre_VectorSize(rd) && !hypre_VectorData(rd)) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "rd scaling coefficients are not set\n"); + return hypre_error_flag; + } + + if (!rd && !ld) + { + return hypre_error_flag; + } + +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec; + + if (ld && rd) + { + /* TODO (VPM): replace with GetExecPolicy3 */ + exec = hypre_GetExecPolicy2(hypre_CSRMatrixMemoryLocation(A), + hypre_VectorMemoryLocation(ld)); + } + else if (ld) + { + exec = hypre_GetExecPolicy2(hypre_CSRMatrixMemoryLocation(A), + hypre_VectorMemoryLocation(ld)); + } + else + { + exec = hypre_GetExecPolicy2(hypre_CSRMatrixMemoryLocation(A), + hypre_VectorMemoryLocation(rd)); + } + + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_CSRMatrixDiagScaleDevice(A, ld, rd); + } + else +#endif + { + hypre_CSRMatrixDiagScaleHost(A, ld, rd); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixSetConstantValues + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_CSRMatrixSetConstantValues( hypre_CSRMatrix *A, HYPRE_Complex value) @@ -2014,12 +2193,12 @@ hypre_CSRMatrixSetConstantValues( hypre_CSRMatrix *A, hypre_CSRMatrixData(A) = hypre_TAlloc(HYPRE_Complex, nnz, hypre_CSRMatrixMemoryLocation(A)); } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_CSRMatrixMemoryLocation(A) ); if (exec == HYPRE_EXEC_DEVICE) { - hypreDevice_Filln(hypre_CSRMatrixData(A), nnz, value); + hypreDevice_ComplexFilln(hypre_CSRMatrixData(A), nnz, value); } else #endif @@ -2032,4 +2211,3 @@ hypre_CSRMatrixSetConstantValues( hypre_CSRMatrix *A, return hypre_error_flag; } - diff --git a/external/hypre/src/seq_mv/csr_matop_device.c b/external/hypre/src/seq_mv/csr_matop_device.c index e4a5c98e..3f397b24 100644 --- a/external/hypre/src/seq_mv/csr_matop_device.c +++ b/external/hypre/src/seq_mv/csr_matop_device.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -11,53 +11,92 @@ * *****************************************************************************/ +#include "_hypre_onedpl.hpp" #include "seq_mv.h" #include "_hypre_utilities.hpp" #include "seq_mv.hpp" -#if defined(HYPRE_USING_CUSPARSE) || defined(HYPRE_USING_ROCSPARSE) +#if defined(HYPRE_USING_CUSPARSE) ||\ + defined(HYPRE_USING_ROCSPARSE) ||\ + defined(HYPRE_USING_ONEMKLSPARSE) + +/*-------------------------------------------------------------------------- + * hypre_CsrsvDataCreate + *--------------------------------------------------------------------------*/ + hypre_CsrsvData* hypre_CsrsvDataCreate() { hypre_CsrsvData *data = hypre_CTAlloc(hypre_CsrsvData, 1, HYPRE_MEMORY_HOST); +#if defined(HYPRE_USING_CUSPARSE) + HYPRE_CUSPARSE_CALL( hypre_cusparseSpSV_createDescr(&hypre_CsrsvDataInfoL(data)) ); + HYPRE_CUSPARSE_CALL( hypre_cusparseSpSV_createDescr(&hypre_CsrsvDataInfoU(data)) ); + +#elif defined(HYPRE_USING_ROCSPARSE) + HYPRE_ROCSPARSE_CALL( rocsparse_create_mat_info(&(hypre_CsrsvDataInfoL(data)) ) ); + HYPRE_ROCSPARSE_CALL( rocsparse_create_mat_info(&(hypre_CsrsvDataInfoU(data)) ) ); +#endif + + hypre_CsrsvDataAnalyzedL(data) = 0; + hypre_CsrsvDataAnalyzedU(data) = 0; + return data; } -void +/*-------------------------------------------------------------------------- + * hypre_CsrsvDataDestroy + *--------------------------------------------------------------------------*/ + +HYPRE_Int hypre_CsrsvDataDestroy(hypre_CsrsvData* data) { - if (!data) - { - return; - } - - if ( hypre_CsrsvDataInfoL(data) ) + if (data) { +#if !defined(HYPRE_USING_ONEMKLSPARSE) + /* Lower matrix info */ + if (hypre_CsrsvDataInfoL(data)) + { #if defined(HYPRE_USING_CUSPARSE) - HYPRE_CUSPARSE_CALL( cusparseDestroyCsrsv2Info( hypre_CsrsvDataInfoL(data) ) ); + HYPRE_CUSPARSE_CALL( hypre_cusparseSpSV_destroyDescr(hypre_CsrsvDataInfoL(data)) ); + #elif defined(HYPRE_USING_ROCSPARSE) - HYPRE_ROCSPARSE_CALL( rocsparse_destroy_mat_info( hypre_CsrsvDataInfoL(data) ) ); + HYPRE_ROCSPARSE_CALL( rocsparse_destroy_mat_info(hypre_CsrsvDataInfoL(data)) ); #endif - } + } - if ( hypre_CsrsvDataInfoU(data) ) - { + /* Upper matrix info */ + if (hypre_CsrsvDataInfoU(data)) + { #if defined(HYPRE_USING_CUSPARSE) - HYPRE_CUSPARSE_CALL( cusparseDestroyCsrsv2Info( hypre_CsrsvDataInfoU(data) ) ); + HYPRE_CUSPARSE_CALL( hypre_cusparseSpSV_destroyDescr(hypre_CsrsvDataInfoU(data)) ); + #elif defined(HYPRE_USING_ROCSPARSE) - HYPRE_ROCSPARSE_CALL( rocsparse_destroy_mat_info( hypre_CsrsvDataInfoU(data) ) ); + HYPRE_ROCSPARSE_CALL( rocsparse_destroy_mat_info(hypre_CsrsvDataInfoU(data)) ); #endif - } + } - if ( hypre_CsrsvDataBuffer(data) ) - { + /* Buffers */ +#if defined(HYPRE_USING_CUSPARSE) && (CUSPARSE_VERSION >= CUSPARSE_SPSV_VERSION) + hypre_TFree(hypre_CsrsvDataBufferL(data), HYPRE_MEMORY_DEVICE); + hypre_TFree(hypre_CsrsvDataBufferU(data), HYPRE_MEMORY_DEVICE); +#else hypre_TFree(hypre_CsrsvDataBuffer(data), HYPRE_MEMORY_DEVICE); +#endif +#endif // #if !defined(HYPRE_USING_ONEMKLSPARSE) + hypre_TFree(hypre_CsrsvDataMatData(data), HYPRE_MEMORY_DEVICE); + + /* Free data structure pointer */ + hypre_TFree(data, HYPRE_MEMORY_HOST); } - hypre_TFree(data, HYPRE_MEMORY_HOST); + return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_GpuMatDataCreate + *--------------------------------------------------------------------------*/ + hypre_GpuMatData * hypre_GpuMatDataCreate() { @@ -65,55 +104,109 @@ hypre_GpuMatDataCreate() #if defined(HYPRE_USING_CUSPARSE) cusparseMatDescr_t mat_descr; + HYPRE_CUSPARSE_CALL( cusparseCreateMatDescr(&mat_descr) ); HYPRE_CUSPARSE_CALL( cusparseSetMatType(mat_descr, CUSPARSE_MATRIX_TYPE_GENERAL) ); HYPRE_CUSPARSE_CALL( cusparseSetMatIndexBase(mat_descr, CUSPARSE_INDEX_BASE_ZERO) ); - hypre_GpuMatDataMatDecsr(data) = mat_descr; -#endif + hypre_GpuMatDataMatDescr(data) = mat_descr; -#if defined(HYPRE_USING_ROCSPARSE) +#elif defined(HYPRE_USING_ROCSPARSE) rocsparse_mat_descr mat_descr; rocsparse_mat_info info; + HYPRE_ROCSPARSE_CALL( rocsparse_create_mat_descr(&mat_descr) ); HYPRE_ROCSPARSE_CALL( rocsparse_set_mat_type(mat_descr, rocsparse_matrix_type_general) ); HYPRE_ROCSPARSE_CALL( rocsparse_set_mat_index_base(mat_descr, rocsparse_index_base_zero) ); - hypre_GpuMatDataMatDecsr(data) = mat_descr; HYPRE_ROCSPARSE_CALL( rocsparse_create_mat_info(&info) ); + + hypre_GpuMatDataMatDescr(data) = mat_descr; hypre_GpuMatDataMatInfo(data) = info; + +#elif defined(HYPRE_USING_ONEMKLSPARSE) + oneapi::mkl::sparse::matrix_handle_t mat_handle; + HYPRE_ONEMKL_CALL( oneapi::mkl::sparse::init_matrix_handle(&mat_handle) ); + hypre_GpuMatDataMatHandle(data) = mat_handle; #endif return data; } -void +/*-------------------------------------------------------------------------- + * hypre_GPUMatDataSetCSRData + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GPUMatDataSetCSRData(hypre_CSRMatrix *matrix) +{ +#if defined(HYPRE_USING_ONEMKLSPARSE) +#if defined(HYPRE_BIGINT) + HYPRE_ONEMKL_CALL( oneapi::mkl::sparse::set_csr_data(*hypre_HandleComputeStream(hypre_handle()), + hypre_CSRMatrixGPUMatHandle(matrix), + hypre_CSRMatrixNumRows(matrix), + hypre_CSRMatrixNumCols(matrix), + oneapi::mkl::index_base::zero, + reinterpret_cast(hypre_CSRMatrixI(matrix)), + reinterpret_cast(hypre_CSRMatrixJ(matrix)), + hypre_CSRMatrixData(matrix)) ); +#else + HYPRE_ONEMKL_CALL( oneapi::mkl::sparse::set_csr_data(*hypre_HandleComputeStream(hypre_handle()), + hypre_CSRMatrixGPUMatHandle(matrix), + hypre_CSRMatrixNumRows(matrix), + hypre_CSRMatrixNumCols(matrix), + oneapi::mkl::index_base::zero, + hypre_CSRMatrixI(matrix), + hypre_CSRMatrixJ(matrix), + hypre_CSRMatrixData(matrix)) ); +#endif +#else + HYPRE_UNUSED_VAR(matrix); +#endif + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_GpuMatDataDestroy + *--------------------------------------------------------------------------*/ + +HYPRE_Int hypre_GpuMatDataDestroy(hypre_GpuMatData *data) { - if (!data) + if (data) { - return; - } - #if defined(HYPRE_USING_CUSPARSE) - HYPRE_CUSPARSE_CALL( cusparseDestroyMatDescr(hypre_GpuMatDataMatDecsr(data)) ); -#endif + HYPRE_CUSPARSE_CALL( cusparseDestroyMatDescr(hypre_GpuMatDataMatDescr(data)) ); + hypre_TFree(hypre_GpuMatDataSpMVBuffer(data), HYPRE_MEMORY_DEVICE); -#if defined(HYPRE_USING_ROCSPARSE) - HYPRE_ROCSPARSE_CALL( rocsparse_destroy_mat_descr(hypre_GpuMatDataMatDecsr(data)) ); - HYPRE_ROCSPARSE_CALL( rocsparse_destroy_mat_info(hypre_GpuMatDataMatInfo(data)) ); +#elif defined(HYPRE_USING_ROCSPARSE) + HYPRE_ROCSPARSE_CALL( rocsparse_destroy_mat_descr(hypre_GpuMatDataMatDescr(data)) ); + HYPRE_ROCSPARSE_CALL( rocsparse_destroy_mat_info(hypre_GpuMatDataMatInfo(data)) ); + +#elif defined(HYPRE_USING_ONEMKLSPARSE) + HYPRE_ONEMKL_CALL( oneapi::mkl::sparse::release_matrix_handle(*hypre_HandleComputeStream( + hypre_handle()), + &hypre_GpuMatDataMatHandle(data)) ); #endif + } + + hypre_TFree(data, HYPRE_MEMORY_HOST); - hypre_TFree(data, HYPRE_MEMORY_HOST); + return hypre_error_flag; } -#endif /* #if defined(HYPRE_USING_CUSPARSE) || defined(HYPRE_USING_ROCSPARSE) */ +#endif /* #if defined(HYPRE_USING_CUSPARSE) || defined(HYPRE_USING_ROCSPARSE) || defined(HYPRE_USING_ONEMKLSPARSE) */ + +#if defined(HYPRE_USING_GPU) -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixAddDevice + *--------------------------------------------------------------------------*/ hypre_CSRMatrix* -hypre_CSRMatrixAddDevice ( HYPRE_Complex alpha, - hypre_CSRMatrix *A, - HYPRE_Complex beta, - hypre_CSRMatrix *B ) +hypre_CSRMatrixAddDevice( HYPRE_Complex alpha, + hypre_CSRMatrix *A, + HYPRE_Complex beta, + hypre_CSRMatrix *B ) { HYPRE_Complex *A_data = hypre_CSRMatrixData(A); HYPRE_Int *A_i = hypre_CSRMatrixI(A); @@ -135,13 +228,14 @@ hypre_CSRMatrixAddDevice ( HYPRE_Complex alpha, if (nrows_A != nrows_B || ncols_A != ncols_B) { - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Warning! Incompatible matrix dimensions!\n"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Warning! Incompatible matrix dimensions!\n"); return NULL; } - hypreDevice_CSRSpAdd(nrows_A, nrows_B, ncols_A, nnz_A, nnz_B, - A_i, A_j, alpha, A_data, NULL, B_i, B_j, beta, B_data, NULL, NULL, + hypreDevice_CSRSpAdd(nrows_A, nrows_B, nnz_A, nnz_B, + A_i, A_j, alpha, A_data, NULL, B_i, B_j, + beta, B_data, NULL, NULL, &nnzC, &C_i, &C_j, &C_data); C = hypre_CSRMatrixCreate(nrows_A, ncols_B, nnzC); @@ -150,14 +244,18 @@ hypre_CSRMatrixAddDevice ( HYPRE_Complex alpha, hypre_CSRMatrixData(C) = C_data; hypre_CSRMatrixMemoryLocation(C) = HYPRE_MEMORY_DEVICE; - hypre_SyncCudaComputeStream(hypre_handle()); + hypre_SyncComputeStream(); return C; } +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixMultiplyDevice + *--------------------------------------------------------------------------*/ + hypre_CSRMatrix* hypre_CSRMatrixMultiplyDevice( hypre_CSRMatrix *A, - hypre_CSRMatrix *B) + hypre_CSRMatrix *B ) { HYPRE_Int ncols_A = hypre_CSRMatrixNumCols(A); HYPRE_Int nrows_B = hypre_CSRMatrixNumRows(B); @@ -166,18 +264,26 @@ hypre_CSRMatrixMultiplyDevice( hypre_CSRMatrix *A, if (ncols_A != nrows_B) { hypre_printf("Warning! incompatible matrix dimensions!\n"); - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Warning! incompatible matrix dimensions!\n"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Warning! incompatible matrix dimensions!\n"); return NULL; } + hypre_GpuProfilingPushRange("CSRMatrixMultiply"); + hypreDevice_CSRSpGemm(A, B, &C); - hypre_SyncCudaComputeStream(hypre_handle()); + hypre_SyncComputeStream(); + + hypre_GpuProfilingPopRange(); return C; } +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixTripleMultiplyDevice + *--------------------------------------------------------------------------*/ + hypre_CSRMatrix* hypre_CSRMatrixTripleMultiplyDevice ( hypre_CSRMatrix *A, hypre_CSRMatrix *B, @@ -191,29 +297,17 @@ hypre_CSRMatrixTripleMultiplyDevice ( hypre_CSRMatrix *A, return ABC; } -HYPRE_Int -hypre_CSRMatrixTriLowerUpperSolveDevice(char uplo, - hypre_CSRMatrix *A, - HYPRE_Real *l1_norms, - hypre_Vector *f, - hypre_Vector *u ) -{ -#if defined(HYPRE_USING_CUSPARSE) - hypre_CSRMatrixTriLowerUpperSolveCusparse(uplo, A, l1_norms, f, u); -#elif defined(HYPRE_USING_ROCSPARSE) - hypre_CSRMatrixTriLowerUpperSolveRocsparse(uplo, A, l1_norms, f, u); -#else - hypre_error_w_msg(HYPRE_ERROR_GENERIC, "hypre_CSRMatrixTriLowerUpperSolveDevice requires configuration with either cusparse or rocsparse\n"); -#endif - return hypre_error_flag; -} - -/* split CSR matrix B_ext (extended rows of parcsr B) into diag part and offd part - * corresponding to B. - * Input col_map_offd_B: - * Output col_map_offd_C: union of col_map_offd_B and offd-indices of Bext_offd - * map_B_to_C: mapping from col_map_offd_B to col_map_offd_C - */ +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixSplitDevice + * + * Split CSR matrix B_ext (extended rows of parcsr B) into diag part and + * offd part corresponding to B. + * + * Input - col_map_offd_B: + * Output - col_map_offd_C: union of col_map_offd_B and offd-indices of + * Bext_offd + * map_B_to_C: mapping from col_map_offd_B to col_map_offd_C + *--------------------------------------------------------------------------*/ HYPRE_Int hypre_CSRMatrixSplitDevice( hypre_CSRMatrix *B_ext, @@ -305,7 +399,8 @@ hypre_CSRMatrixSplitDevice( hypre_CSRMatrix *B_ext, hypre_TFree(B_ext_offd_ii, HYPRE_MEMORY_DEVICE); /* create diag and offd CSR */ - hypre_CSRMatrix *B_ext_diag = hypre_CSRMatrixCreate(num_rows, last_col_diag_B - first_col_diag_B + 1, B_ext_diag_nnz); + hypre_CSRMatrix *B_ext_diag = hypre_CSRMatrixCreate(num_rows, + last_col_diag_B - first_col_diag_B + 1, B_ext_diag_nnz); hypre_CSRMatrix *B_ext_offd = hypre_CSRMatrixCreate(num_rows, *num_cols_offd_C_ptr, B_ext_offd_nnz); hypre_CSRMatrixI(B_ext_diag) = B_ext_diag_i; @@ -323,37 +418,137 @@ hypre_CSRMatrixSplitDevice( hypre_CSRMatrix *B_ext, *B_ext_diag_ptr = B_ext_diag; *B_ext_offd_ptr = B_ext_offd; - hypre_SyncCudaComputeStream(hypre_handle()); + hypre_SyncComputeStream(); return ierr; } +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixMergeColMapOffd + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixMergeColMapOffd( HYPRE_Int num_cols_offd_B, + HYPRE_BigInt *col_map_offd_B, + HYPRE_Int B_ext_offd_nnz, + HYPRE_BigInt *B_ext_offd_bigj, + HYPRE_Int *num_cols_offd_C_ptr, + HYPRE_BigInt **col_map_offd_C_ptr, + HYPRE_Int **map_B_to_C_ptr ) +{ + /* offd map of B_ext_offd Union col_map_offd_B */ + HYPRE_BigInt *col_map_offd_C = hypre_TAlloc(HYPRE_BigInt, B_ext_offd_nnz + num_cols_offd_B, + HYPRE_MEMORY_DEVICE); + + hypre_TMemcpy(col_map_offd_C, B_ext_offd_bigj, HYPRE_BigInt, B_ext_offd_nnz, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + + hypre_TMemcpy(col_map_offd_C + B_ext_offd_nnz, col_map_offd_B, HYPRE_BigInt, num_cols_offd_B, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::sort, + col_map_offd_C, + col_map_offd_C + B_ext_offd_nnz + num_cols_offd_B ); + + HYPRE_BigInt *new_end = HYPRE_ONEDPL_CALL( std::unique, + col_map_offd_C, + col_map_offd_C + B_ext_offd_nnz + num_cols_offd_B ); +#else + HYPRE_THRUST_CALL( sort, + col_map_offd_C, + col_map_offd_C + B_ext_offd_nnz + num_cols_offd_B ); + + HYPRE_BigInt *new_end = HYPRE_THRUST_CALL( unique, + col_map_offd_C, + col_map_offd_C + B_ext_offd_nnz + num_cols_offd_B ); +#endif + + HYPRE_Int num_cols_offd_C = new_end - col_map_offd_C; + +#if 1 + HYPRE_BigInt *tmp = hypre_TAlloc(HYPRE_BigInt, num_cols_offd_C, HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(tmp, col_map_offd_C, HYPRE_BigInt, num_cols_offd_C, HYPRE_MEMORY_DEVICE, + HYPRE_MEMORY_DEVICE); + hypre_TFree(col_map_offd_C, HYPRE_MEMORY_DEVICE); + col_map_offd_C = tmp; +#else + col_map_offd_C = hypre_TReAlloc_v2(col_map_offd_C, HYPRE_BigInt, B_ext_offd_nnz + num_cols_offd_B, + HYPRE_Int, num_cols_offd_C, HYPRE_MEMORY_DEVICE); +#endif + + /* create map from col_map_offd_B */ + HYPRE_Int *map_B_to_C = hypre_TAlloc(HYPRE_Int, num_cols_offd_B, HYPRE_MEMORY_DEVICE); + + if (num_cols_offd_B) + { +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( oneapi::dpl::lower_bound, + col_map_offd_C, + col_map_offd_C + num_cols_offd_C, + col_map_offd_B, + col_map_offd_B + num_cols_offd_B, + map_B_to_C ); +#else + HYPRE_THRUST_CALL( lower_bound, + col_map_offd_C, + col_map_offd_C + num_cols_offd_C, + col_map_offd_B, + col_map_offd_B + num_cols_offd_B, + map_B_to_C ); +#endif + } + + *map_B_to_C_ptr = map_B_to_C; + *num_cols_offd_C_ptr = num_cols_offd_C; + *col_map_offd_C_ptr = col_map_offd_C; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixSplitDevice_core + * + * job = 0: query B_ext_diag/offd_nnz; 1: real computation + * + * NOTES: + * B_ext_ii: NOT row pointers of CSR but row indices of COO + * B_ext_bigj: [BigInt] global column indices + * B_ext_xata: companion data with B_ext_data; NULL if none + * B_ext_diag_ii: memory allocated outside + * B_ext_diag_xata: companion with B_ext_diag_data_ptr; NULL if none + * B_ext_offd_ii: memory allocated outside + * B_ext_offd_xata: companion with B_ext_offd_data_ptr; NULL if none + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_CSRMatrixSplitDevice_core( HYPRE_Int job, /* 0: query B_ext_diag_nnz and B_ext_offd_nnz; 1: the real computation */ - HYPRE_Int num_rows, - HYPRE_Int B_ext_nnz, - HYPRE_Int *B_ext_ii, /* Note: this is NOT row pointers as in CSR but row indices as in COO */ - HYPRE_BigInt *B_ext_bigj, /* Note: [BigInt] global column indices */ - HYPRE_Complex *B_ext_data, - char *B_ext_xata, /* companion data with B_ext_data; NULL if none */ - HYPRE_BigInt first_col_diag_B, - HYPRE_BigInt last_col_diag_B, - HYPRE_Int num_cols_offd_B, - HYPRE_BigInt *col_map_offd_B, - HYPRE_Int **map_B_to_C_ptr, - HYPRE_Int *num_cols_offd_C_ptr, - HYPRE_BigInt **col_map_offd_C_ptr, - HYPRE_Int *B_ext_diag_nnz_ptr, - HYPRE_Int *B_ext_diag_ii, /* memory allocated outside */ - HYPRE_Int *B_ext_diag_j, - HYPRE_Complex *B_ext_diag_data, - char *B_ext_diag_xata, /* companion with B_ext_diag_data_ptr; NULL if none */ - HYPRE_Int *B_ext_offd_nnz_ptr, - HYPRE_Int *B_ext_offd_ii, /* memory allocated outside */ - HYPRE_Int *B_ext_offd_j, - HYPRE_Complex *B_ext_offd_data, - char *B_ext_offd_xata /* companion with B_ext_offd_data_ptr; NULL if none */ ) +hypre_CSRMatrixSplitDevice_core( HYPRE_Int job, + HYPRE_Int num_rows, + HYPRE_Int B_ext_nnz, + HYPRE_Int *B_ext_ii, + HYPRE_BigInt *B_ext_bigj, + HYPRE_Complex *B_ext_data, + char *B_ext_xata, + HYPRE_BigInt first_col_diag_B, + HYPRE_BigInt last_col_diag_B, + HYPRE_Int num_cols_offd_B, + HYPRE_BigInt *col_map_offd_B, + HYPRE_Int **map_B_to_C_ptr, + HYPRE_Int *num_cols_offd_C_ptr, + HYPRE_BigInt **col_map_offd_C_ptr, + HYPRE_Int *B_ext_diag_nnz_ptr, + HYPRE_Int *B_ext_diag_ii, + HYPRE_Int *B_ext_diag_j, + HYPRE_Complex *B_ext_diag_data, + char *B_ext_diag_xata, + HYPRE_Int *B_ext_offd_nnz_ptr, + HYPRE_Int *B_ext_offd_ii, + HYPRE_Int *B_ext_offd_j, + HYPRE_Complex *B_ext_offd_data, + char *B_ext_offd_xata ) { + HYPRE_UNUSED_VAR(num_rows); + HYPRE_Int B_ext_diag_nnz; HYPRE_Int B_ext_offd_nnz; HYPRE_BigInt *B_ext_diag_bigj = NULL; @@ -362,21 +557,32 @@ hypre_CSRMatrixSplitDevice_core( HYPRE_Int job, /* 0: qu HYPRE_Int *map_B_to_C = NULL; HYPRE_Int num_cols_offd_C; + hypre_GpuProfilingPushRange("CSRMatrixSplitDevice_core"); + in_range pred1(first_col_diag_B, last_col_diag_B); /* get diag and offd nnz */ if (job == 0) { /* query the nnz's */ +#if defined(HYPRE_USING_SYCL) + B_ext_diag_nnz = HYPRE_ONEDPL_CALL( std::count_if, + B_ext_bigj, + B_ext_bigj + B_ext_nnz, + pred1 ); +#else B_ext_diag_nnz = HYPRE_THRUST_CALL( count_if, B_ext_bigj, B_ext_bigj + B_ext_nnz, pred1 ); +#endif B_ext_offd_nnz = B_ext_nnz - B_ext_diag_nnz; *B_ext_diag_nnz_ptr = B_ext_diag_nnz; *B_ext_offd_nnz_ptr = B_ext_offd_nnz; + hypre_GpuProfilingPopRange(); + return hypre_error_flag; } else @@ -390,36 +596,72 @@ hypre_CSRMatrixSplitDevice_core( HYPRE_Int job, /* 0: qu if (B_ext_diag_xata) { +#if defined(HYPRE_USING_SYCL) + auto first = oneapi::dpl::make_zip_iterator(B_ext_ii, B_ext_bigj, B_ext_data, B_ext_xata); + auto new_end = hypreSycl_copy_if( + first, /* first */ + first + B_ext_nnz, /* last */ + B_ext_bigj, /* stencil */ + oneapi::dpl::make_zip_iterator(B_ext_diag_ii, B_ext_diag_bigj, B_ext_diag_data, + B_ext_diag_xata), /* result */ + pred1 ); + hypre_assert( std::get<0>(new_end.base()) == B_ext_diag_ii + B_ext_diag_nnz ); +#else auto new_end = HYPRE_THRUST_CALL( - copy_if, - thrust::make_zip_iterator(thrust::make_tuple(B_ext_ii, B_ext_bigj, B_ext_data, B_ext_xata)), /* first */ - thrust::make_zip_iterator(thrust::make_tuple(B_ext_ii, B_ext_bigj, B_ext_data, B_ext_xata)) + B_ext_nnz, /* last */ - B_ext_bigj, /* stencil */ - thrust::make_zip_iterator(thrust::make_tuple(B_ext_diag_ii, B_ext_diag_bigj, B_ext_diag_data, B_ext_diag_xata)), /* result */ - pred1 ); + copy_if, + thrust::make_zip_iterator(thrust::make_tuple(B_ext_ii, B_ext_bigj, B_ext_data, + B_ext_xata)), /* first */ + thrust::make_zip_iterator(thrust::make_tuple(B_ext_ii, B_ext_bigj, B_ext_data, + B_ext_xata)) + B_ext_nnz, /* last */ + B_ext_bigj, /* stencil */ + thrust::make_zip_iterator(thrust::make_tuple(B_ext_diag_ii, B_ext_diag_bigj, B_ext_diag_data, + B_ext_diag_xata)), /* result */ + pred1 ); hypre_assert( thrust::get<0>(new_end.get_iterator_tuple()) == B_ext_diag_ii + B_ext_diag_nnz ); +#endif } else { +#if defined(HYPRE_USING_SYCL) + auto first = oneapi::dpl::make_zip_iterator(B_ext_ii, B_ext_bigj, B_ext_data); + auto new_end = hypreSycl_copy_if( + first, /* first */ + first + B_ext_nnz, /* last */ + B_ext_bigj, /* stencil */ + oneapi::dpl::make_zip_iterator(B_ext_diag_ii, B_ext_diag_bigj, B_ext_diag_data), /* result */ + pred1 ); + hypre_assert( std::get<0>(new_end.base()) == B_ext_diag_ii + B_ext_diag_nnz ); +#else auto new_end = HYPRE_THRUST_CALL( - copy_if, - thrust::make_zip_iterator(thrust::make_tuple(B_ext_ii, B_ext_bigj, B_ext_data)), /* first */ - thrust::make_zip_iterator(thrust::make_tuple(B_ext_ii, B_ext_bigj, B_ext_data)) + B_ext_nnz, /* last */ - B_ext_bigj, /* stencil */ - thrust::make_zip_iterator(thrust::make_tuple(B_ext_diag_ii, B_ext_diag_bigj, B_ext_diag_data)), /* result */ - pred1 ); + copy_if, + thrust::make_zip_iterator(thrust::make_tuple(B_ext_ii, B_ext_bigj, + B_ext_data)), /* first */ + thrust::make_zip_iterator(thrust::make_tuple(B_ext_ii, B_ext_bigj, + B_ext_data)) + B_ext_nnz, /* last */ + B_ext_bigj, /* stencil */ + thrust::make_zip_iterator(thrust::make_tuple(B_ext_diag_ii, B_ext_diag_bigj, + B_ext_diag_data)), /* result */ + pred1 ); hypre_assert( thrust::get<0>(new_end.get_iterator_tuple()) == B_ext_diag_ii + B_ext_diag_nnz ); +#endif } +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::transform, + B_ext_diag_bigj, + B_ext_diag_bigj + B_ext_diag_nnz, + B_ext_diag_j, + [const_val = first_col_diag_B](const auto & x) {return x - const_val;} ); +#else HYPRE_THRUST_CALL( transform, B_ext_diag_bigj, B_ext_diag_bigj + B_ext_diag_nnz, thrust::make_constant_iterator(first_col_diag_B), B_ext_diag_j, thrust::minus()); - +#endif hypre_TFree(B_ext_diag_bigj, HYPRE_MEMORY_DEVICE); /* copy to offd */ @@ -427,138 +669,338 @@ hypre_CSRMatrixSplitDevice_core( HYPRE_Int job, /* 0: qu if (B_ext_offd_xata) { +#if defined(HYPRE_USING_SYCL) + auto first = oneapi::dpl::make_zip_iterator(B_ext_ii, B_ext_bigj, B_ext_data, B_ext_xata); + auto new_end = hypreSycl_copy_if( + first, /* first */ + first + B_ext_nnz, /* last */ + B_ext_bigj, /* stencil */ + oneapi::dpl::make_zip_iterator(B_ext_offd_ii, B_ext_offd_bigj, B_ext_offd_data, + B_ext_offd_xata), /* result */ + std::not_fn(pred1) ); + hypre_assert( std::get<0>(new_end.base()) == B_ext_offd_ii + B_ext_offd_nnz ); +#else auto new_end = HYPRE_THRUST_CALL( - copy_if, - thrust::make_zip_iterator(thrust::make_tuple(B_ext_ii, B_ext_bigj, B_ext_data, B_ext_xata)), /* first */ - thrust::make_zip_iterator(thrust::make_tuple(B_ext_ii, B_ext_bigj, B_ext_data, B_ext_xata)) + B_ext_nnz, /* last */ - B_ext_bigj, /* stencil */ - thrust::make_zip_iterator(thrust::make_tuple(B_ext_offd_ii, B_ext_offd_bigj, B_ext_offd_data, B_ext_offd_xata)), /* result */ - thrust::not1(pred1) ); + copy_if, + thrust::make_zip_iterator(thrust::make_tuple(B_ext_ii, B_ext_bigj, B_ext_data, + B_ext_xata)), /* first */ + thrust::make_zip_iterator(thrust::make_tuple(B_ext_ii, B_ext_bigj, B_ext_data, + B_ext_xata)) + B_ext_nnz, /* last */ + B_ext_bigj, /* stencil */ + thrust::make_zip_iterator(thrust::make_tuple(B_ext_offd_ii, B_ext_offd_bigj, B_ext_offd_data, + B_ext_offd_xata)), /* result */ + HYPRE_THRUST_NOT(pred1) ); hypre_assert( thrust::get<0>(new_end.get_iterator_tuple()) == B_ext_offd_ii + B_ext_offd_nnz ); +#endif } else { +#if defined(HYPRE_USING_SYCL) + auto first = oneapi::dpl::make_zip_iterator(B_ext_ii, B_ext_bigj, B_ext_data); + auto new_end = hypreSycl_copy_if( + first, /* first */ + first + B_ext_nnz, /* last */ + B_ext_bigj, /* stencil */ + oneapi::dpl::make_zip_iterator(B_ext_offd_ii, B_ext_offd_bigj, B_ext_offd_data), /* result */ + std::not_fn(pred1) ); + hypre_assert( std::get<0>(new_end.base()) == B_ext_offd_ii + B_ext_offd_nnz ); +#else auto new_end = HYPRE_THRUST_CALL( - copy_if, - thrust::make_zip_iterator(thrust::make_tuple(B_ext_ii, B_ext_bigj, B_ext_data)), /* first */ - thrust::make_zip_iterator(thrust::make_tuple(B_ext_ii, B_ext_bigj, B_ext_data)) + B_ext_nnz, /* last */ - B_ext_bigj, /* stencil */ - thrust::make_zip_iterator(thrust::make_tuple(B_ext_offd_ii, B_ext_offd_bigj, B_ext_offd_data)), /* result */ - thrust::not1(pred1) ); + copy_if, + thrust::make_zip_iterator(thrust::make_tuple(B_ext_ii, B_ext_bigj, + B_ext_data)), /* first */ + thrust::make_zip_iterator(thrust::make_tuple(B_ext_ii, B_ext_bigj, + B_ext_data)) + B_ext_nnz, /* last */ + B_ext_bigj, /* stencil */ + thrust::make_zip_iterator(thrust::make_tuple(B_ext_offd_ii, B_ext_offd_bigj, + B_ext_offd_data)), /* result */ + HYPRE_THRUST_NOT(pred1) ); hypre_assert( thrust::get<0>(new_end.get_iterator_tuple()) == B_ext_offd_ii + B_ext_offd_nnz ); +#endif } - /* offd map of B_ext_offd Union col_map_offd_B */ - col_map_offd_C = hypre_TAlloc(HYPRE_BigInt, B_ext_offd_nnz + num_cols_offd_B, HYPRE_MEMORY_DEVICE); - hypre_TMemcpy(col_map_offd_C, B_ext_offd_bigj, HYPRE_BigInt, B_ext_offd_nnz, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); - hypre_TMemcpy(col_map_offd_C + B_ext_offd_nnz, col_map_offd_B, HYPRE_BigInt, num_cols_offd_B, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); - - HYPRE_THRUST_CALL( sort, - col_map_offd_C, - col_map_offd_C + B_ext_offd_nnz + num_cols_offd_B ); - - HYPRE_BigInt *new_end = HYPRE_THRUST_CALL( unique, - col_map_offd_C, - col_map_offd_C + B_ext_offd_nnz + num_cols_offd_B ); - - num_cols_offd_C = new_end - col_map_offd_C; - -#if 1 - HYPRE_BigInt *tmp = hypre_TAlloc(HYPRE_BigInt, num_cols_offd_C, HYPRE_MEMORY_DEVICE); - hypre_TMemcpy(tmp, col_map_offd_C, HYPRE_BigInt, num_cols_offd_C, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); - hypre_TFree(col_map_offd_C, HYPRE_MEMORY_DEVICE); - col_map_offd_C = tmp; -#else - col_map_offd_C = hypre_TReAlloc_v2(col_map_offd_C, HYPRE_BigInt, B_ext_offd_nnz + num_cols_offd_B, HYPRE_Int, num_cols_offd_C, HYPRE_MEMORY_DEVICE); -#endif + hypre_CSRMatrixMergeColMapOffd(num_cols_offd_B, col_map_offd_B, B_ext_offd_nnz, B_ext_offd_bigj, + &num_cols_offd_C, &col_map_offd_C, &map_B_to_C); - /* create map from col_map_offd_B */ - if (num_cols_offd_B) +#if defined(HYPRE_USING_SYCL) + if (num_cols_offd_C > 0 && B_ext_offd_nnz > 0) { - map_B_to_C = hypre_TAlloc(HYPRE_Int, num_cols_offd_B, HYPRE_MEMORY_DEVICE); - HYPRE_THRUST_CALL( lower_bound, + HYPRE_ONEDPL_CALL( oneapi::dpl::lower_bound, col_map_offd_C, col_map_offd_C + num_cols_offd_C, - col_map_offd_B, - col_map_offd_B + num_cols_offd_B, - map_B_to_C ); + B_ext_offd_bigj, + B_ext_offd_bigj + B_ext_offd_nnz, + B_ext_offd_j ); } - +#else HYPRE_THRUST_CALL( lower_bound, col_map_offd_C, col_map_offd_C + num_cols_offd_C, B_ext_offd_bigj, B_ext_offd_bigj + B_ext_offd_nnz, B_ext_offd_j ); +#endif hypre_TFree(B_ext_offd_bigj, HYPRE_MEMORY_DEVICE); - if (map_B_to_C_ptr) - { - *map_B_to_C_ptr = map_B_to_C; - } + *map_B_to_C_ptr = map_B_to_C; *num_cols_offd_C_ptr = num_cols_offd_C; *col_map_offd_C_ptr = col_map_offd_C; + hypre_GpuProfilingPopRange(); + return hypre_error_flag; } /*-------------------------------------------------------------------------- - * hypre_CSRMatrixAddPartial: - * adds matrix rows in the CSR matrix B to the CSR Matrix A, where row_nums[i] - * defines to which row of A the i-th row of B is added, and returns a CSR Matrix C; - * Repeated row indices are allowed in row_nums - * Note: The routine does not check for 0-elements which might be generated - * through cancellation of elements in A and B or already contained - * in A and B. To remove those, use hypre_CSRMatrixDeleteZeros + * hypre_CSRMatrixCompressColumnsDevice *--------------------------------------------------------------------------*/ -hypre_CSRMatrix* -hypre_CSRMatrixAddPartialDevice( hypre_CSRMatrix *A, - hypre_CSRMatrix *B, - HYPRE_Int *row_nums) +HYPRE_Int +hypre_CSRMatrixCompressColumnsDevice(hypre_CSRMatrix *A, + HYPRE_BigInt *col_map, + HYPRE_Int **col_idx_new_ptr, + HYPRE_BigInt **col_map_new_ptr) { - HYPRE_Complex *A_data = hypre_CSRMatrixData(A); - HYPRE_Int *A_i = hypre_CSRMatrixI(A); - HYPRE_Int *A_j = hypre_CSRMatrixJ(A); - HYPRE_Int nrows_A = hypre_CSRMatrixNumRows(A); - HYPRE_Int ncols_A = hypre_CSRMatrixNumCols(A); - HYPRE_Int nnz_A = hypre_CSRMatrixNumNonzeros(A); - HYPRE_Complex *B_data = hypre_CSRMatrixData(B); - HYPRE_Int *B_i = hypre_CSRMatrixI(B); - HYPRE_Int *B_j = hypre_CSRMatrixJ(B); - HYPRE_Int nrows_B = hypre_CSRMatrixNumRows(B); - HYPRE_Int ncols_B = hypre_CSRMatrixNumCols(B); - HYPRE_Int nnz_B = hypre_CSRMatrixNumNonzeros(B); - HYPRE_Complex *C_data; - HYPRE_Int *C_i; - HYPRE_Int *C_j; - HYPRE_Int nnzC; - hypre_CSRMatrix *C; + HYPRE_Int num_cols = hypre_CSRMatrixNumCols(A); + HYPRE_Int nnz = hypre_CSRMatrixNumNonzeros(A); + HYPRE_Int *A_j = hypre_CSRMatrixJ(A); + HYPRE_Int *tmp_j = hypre_TAlloc(HYPRE_Int, nnz, HYPRE_MEMORY_DEVICE); + HYPRE_Int *tmp_end; + HYPRE_Int num_cols_new; + + hypre_TMemcpy(tmp_j, A_j, HYPRE_Int, nnz, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL(std::sort, tmp_j, tmp_j + nnz); + tmp_end = HYPRE_ONEDPL_CALL(std::unique, tmp_j, tmp_j + nnz); +#else + HYPRE_THRUST_CALL(sort, tmp_j, tmp_j + nnz); + tmp_end = HYPRE_THRUST_CALL(unique, tmp_j, tmp_j + nnz); +#endif + num_cols_new = tmp_end - tmp_j; - if (ncols_A != ncols_B) + hypre_assert(num_cols_new <= num_cols); + + if (num_cols_new < num_cols) { - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Warning! incompatible matrix dimensions!\n"); + HYPRE_Int *offd_mark = NULL; + HYPRE_BigInt *col_map_new; - return NULL; - } + if (num_cols_new) + { + offd_mark = hypre_TAlloc(HYPRE_Int, num_cols, HYPRE_MEMORY_DEVICE); + } - hypreDevice_CSRSpAdd(nrows_A, nrows_B, ncols_A, nnz_A, nnz_B, A_i, A_j, 1.0, A_data, NULL, B_i, B_j, 1.0, B_data, NULL, row_nums, - &nnzC, &C_i, &C_j, &C_data); + if (col_map_new_ptr) + { + col_map_new = hypre_TAlloc(HYPRE_BigInt, num_cols_new, HYPRE_MEMORY_DEVICE); + } - C = hypre_CSRMatrixCreate(nrows_A, ncols_B, nnzC); +#if defined(HYPRE_USING_SYCL) + oneapi::dpl::counting_iterator count(0); + hypreSycl_scatter( count, + count + num_cols_new, + tmp_j, + offd_mark ); + + hypreSycl_gather(A_j, A_j + nnz, offd_mark, A_j); + + if (col_map_new_ptr) + { + hypreSycl_gather(tmp_j, tmp_j + num_cols_new, col_map, col_map_new); + } +#else + HYPRE_THRUST_CALL( scatter, + thrust::counting_iterator(0), + thrust::counting_iterator(num_cols_new), + tmp_j, + offd_mark ); + + HYPRE_THRUST_CALL(gather, A_j, A_j + nnz, offd_mark, A_j); + + if (col_map_new_ptr) + { + HYPRE_THRUST_CALL(gather, tmp_j, tmp_j + num_cols_new, col_map, col_map_new); + } +#endif + + hypre_TFree(offd_mark, HYPRE_MEMORY_DEVICE); + + hypre_CSRMatrixNumCols(A) = num_cols_new; + + if (col_idx_new_ptr) + { + *col_idx_new_ptr = tmp_j; + } + else + { + hypre_TFree(tmp_j, HYPRE_MEMORY_DEVICE); + } + + if (col_map_new_ptr) + { + *col_map_new_ptr = col_map_new; + } + } + else + { + if (col_idx_new_ptr) + { + *col_idx_new_ptr = NULL; + } + + if (col_map_new_ptr) + { + *col_map_new_ptr = NULL; + } + + hypre_TFree(tmp_j, HYPRE_MEMORY_DEVICE); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixTriLowerUpperSolveDevice_core + * + * TODO (VPM): The analysis portion (setup phase) of the triangular solve + * is embedded into the vendor libraries wrappers. + * Should we create a separate function "Setup" function? + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixTriLowerUpperSolveDevice_core(char uplo, + HYPRE_Int unit_diag, + hypre_CSRMatrix *A, + HYPRE_Real *l1_norms, + hypre_Vector *f, + HYPRE_Int offset_f, + hypre_Vector *u, + HYPRE_Int offset_u) +{ + /* Trivial case: no rows */ + if (hypre_CSRMatrixNumRows(A) <= 0) + { + return hypre_error_flag; + } + + /* Trivial case: empty rows */ + if (hypre_CSRMatrixNumNonzeros(A) <= 0) + { + return hypre_error_flag; + } + + /* Sanity check */ + if (hypre_CSRMatrixNumRows(A) != hypre_CSRMatrixNumCols(A)) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "Triangular matrix solver works only for square matrices!"); + return hypre_error_flag; + } + + /* Call vendor specific implementations */ +#if defined(HYPRE_USING_CUSPARSE) + hypre_CSRMatrixTriLowerUpperSolveCusparse(uplo, unit_diag, A, + l1_norms, + hypre_VectorData(f) + offset_f, + hypre_VectorData(u) + offset_u); +#elif defined(HYPRE_USING_ROCSPARSE) + hypre_CSRMatrixTriLowerUpperSolveRocsparse(uplo, unit_diag, A, + l1_norms, + hypre_VectorData(f) + offset_f, + hypre_VectorData(u) + offset_u); +#elif defined(HYPRE_USING_ONEMKLSPARSE) + hypre_CSRMatrixTriLowerUpperSolveOnemklsparse(uplo, unit_diag, A, + l1_norms, + hypre_VectorData(f) + offset_f, + hypre_VectorData(u) + offset_u); +#else + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "hypre_CSRMatrixTriLowerUpperSolveDevice requires configuration with either cuSPARSE or rocSPARSE\n"); +#endif + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixTriLowerUpperSolveDevice + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixTriLowerUpperSolveDevice(char uplo, + HYPRE_Int unit_diag, + hypre_CSRMatrix *A, + HYPRE_Real *l1_norms, + hypre_Vector *f, + hypre_Vector *u ) +{ + return hypre_CSRMatrixTriLowerUpperSolveDevice_core(uplo, unit_diag, A, l1_norms, f, 0, u, 0); +} + +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixAddPartial + * + * Adds matrix rows in the CSR matrix B to the CSR Matrix A, where row_nums[i] + * defines to which row of A the i-th row of B is added, and returns a CSR + * Matrix C. Repeated row indices are allowed in row_nums + * + * Note: The routine does not check for 0-elements which might be generated + * through cancellation of elements in A and B or already contained + * in A and B. To remove those, use hypre_CSRMatrixDeleteZeros + *--------------------------------------------------------------------------*/ + +hypre_CSRMatrix* +hypre_CSRMatrixAddPartialDevice( hypre_CSRMatrix *A, + hypre_CSRMatrix *B, + HYPRE_Int *row_nums) +{ + HYPRE_Complex *A_data = hypre_CSRMatrixData(A); + HYPRE_Int *A_i = hypre_CSRMatrixI(A); + HYPRE_Int *A_j = hypre_CSRMatrixJ(A); + HYPRE_Int nrows_A = hypre_CSRMatrixNumRows(A); + HYPRE_Int ncols_A = hypre_CSRMatrixNumCols(A); + HYPRE_Int nnz_A = hypre_CSRMatrixNumNonzeros(A); + HYPRE_Complex *B_data = hypre_CSRMatrixData(B); + HYPRE_Int *B_i = hypre_CSRMatrixI(B); + HYPRE_Int *B_j = hypre_CSRMatrixJ(B); + HYPRE_Int nrows_B = hypre_CSRMatrixNumRows(B); + HYPRE_Int ncols_B = hypre_CSRMatrixNumCols(B); + HYPRE_Int nnz_B = hypre_CSRMatrixNumNonzeros(B); + HYPRE_Complex *C_data; + HYPRE_Int *C_i; + HYPRE_Int *C_j; + HYPRE_Int nnzC; + hypre_CSRMatrix *C; + + if (ncols_A != ncols_B) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Warning! incompatible matrix dimensions!\n"); + + return NULL; + } + + hypreDevice_CSRSpAdd(nrows_A, nrows_B, nnz_A, nnz_B, + A_i, A_j, 1.0, A_data, NULL, B_i, B_j, + 1.0, B_data, NULL, row_nums, + &nnzC, &C_i, &C_j, &C_data); + + C = hypre_CSRMatrixCreate(nrows_A, ncols_B, nnzC); hypre_CSRMatrixI(C) = C_i; hypre_CSRMatrixJ(C) = C_j; hypre_CSRMatrixData(C) = C_data; hypre_CSRMatrixMemoryLocation(C) = HYPRE_MEMORY_DEVICE; - hypre_SyncCudaComputeStream(hypre_handle()); + hypre_SyncComputeStream(); return C; } +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixColNNzRealDevice + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_CSRMatrixColNNzRealDevice( hypre_CSRMatrix *A, HYPRE_Real *colnnz) @@ -573,58 +1015,86 @@ hypre_CSRMatrixColNNzRealDevice( hypre_CSRMatrix *A, A_j_sorted = hypre_TAlloc(HYPRE_Int, nnz_A, HYPRE_MEMORY_DEVICE); hypre_TMemcpy(A_j_sorted, A_j, HYPRE_Int, nnz_A, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL(std::sort, A_j_sorted, A_j_sorted + nnz_A); +#else HYPRE_THRUST_CALL(sort, A_j_sorted, A_j_sorted + nnz_A); +#endif reduced_col_indices = hypre_TAlloc(HYPRE_Int, ncols_A, HYPRE_MEMORY_DEVICE); reduced_col_nnz = hypre_TAlloc(HYPRE_Int, ncols_A, HYPRE_MEMORY_DEVICE); - thrust::pair new_end = - HYPRE_THRUST_CALL(reduce_by_key, A_j_sorted, A_j_sorted + nnz_A, - thrust::make_constant_iterator(1), - reduced_col_indices, - reduced_col_nnz); +#if defined(HYPRE_USING_SYCL) + auto new_end = HYPRE_ONEDPL_CALL( oneapi::dpl::reduce_by_segment, + A_j_sorted, + A_j_sorted + nnz_A, + dpct::constant_iterator(1), + reduced_col_indices, + reduced_col_nnz); hypre_assert(new_end.first - reduced_col_indices == new_end.second - reduced_col_nnz); - num_reduced_col_indices = new_end.first - reduced_col_indices; +#else + thrust::pair new_end = + HYPRE_THRUST_CALL(reduce_by_key, A_j_sorted, A_j_sorted + nnz_A, + thrust::make_constant_iterator(1), + reduced_col_indices, + reduced_col_nnz); + hypre_assert(new_end.first - reduced_col_indices == new_end.second - reduced_col_nnz); + num_reduced_col_indices = new_end.first - reduced_col_indices; +#endif + hypre_Memset(colnnz, 0, ncols_A * sizeof(HYPRE_Real), HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::copy, reduced_col_nnz, reduced_col_nnz + num_reduced_col_indices, + oneapi::dpl::make_permutation_iterator(colnnz, reduced_col_indices) ); +#else HYPRE_THRUST_CALL(scatter, reduced_col_nnz, reduced_col_nnz + num_reduced_col_indices, reduced_col_indices, colnnz); +#endif hypre_TFree(A_j_sorted, HYPRE_MEMORY_DEVICE); hypre_TFree(reduced_col_indices, HYPRE_MEMORY_DEVICE); hypre_TFree(reduced_col_nnz, HYPRE_MEMORY_DEVICE); - hypre_SyncCudaComputeStream(hypre_handle()); + hypre_SyncComputeStream(); return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypreGPUKernel_CSRMoveDiagFirst + *--------------------------------------------------------------------------*/ + __global__ void -hypreCUDAKernel_CSRMoveDiagFirst( HYPRE_Int nrows, - HYPRE_Int *ia, - HYPRE_Int *ja, - HYPRE_Complex *aa ) +hypreGPUKernel_CSRMoveDiagFirst( hypre_DeviceItem &item, + HYPRE_Int nrows, + HYPRE_Int *ia, + HYPRE_Int *ja, + HYPRE_Complex *aa ) { - HYPRE_Int row = hypre_cuda_get_grid_warp_id<1,1>(); + HYPRE_Int row = hypre_gpu_get_grid_warp_id<1, 1>(item); + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); if (row >= nrows) { return; } - HYPRE_Int lane = hypre_cuda_get_lane_id<1>(); HYPRE_Int p = 0, q = 0; if (lane < 2) { p = read_only_load(ia + row + lane); } - q = __shfl_sync(HYPRE_WARP_FULL_MASK, p, 1); - p = __shfl_sync(HYPRE_WARP_FULL_MASK, p, 0); - for (HYPRE_Int j = p + lane + 1; __any_sync(HYPRE_WARP_FULL_MASK, j < q); j += HYPRE_WARP_SIZE) + q = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 1); + p = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 0); + + for (HYPRE_Int j = p + lane + 1; warp_any_sync(item, HYPRE_WARP_FULL_MASK, j < q); + j += HYPRE_WARP_SIZE) { hypre_int find_diag = j < q && ja[j] == row; @@ -637,13 +1107,17 @@ hypreCUDAKernel_CSRMoveDiagFirst( HYPRE_Int nrows, aa[j] = tmp; } - if ( __any_sync(HYPRE_WARP_FULL_MASK, find_diag) ) + if ( warp_any_sync(item, HYPRE_WARP_FULL_MASK, find_diag) ) { break; } } } +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixMoveDiagFirstDevice + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_CSRMatrixMoveDiagFirstDevice( hypre_CSRMatrix *A ) { @@ -651,178 +1125,637 @@ hypre_CSRMatrixMoveDiagFirstDevice( hypre_CSRMatrix *A ) HYPRE_Complex *A_data = hypre_CSRMatrixData(A); HYPRE_Int *A_i = hypre_CSRMatrixI(A); HYPRE_Int *A_j = hypre_CSRMatrixJ(A); - dim3 bDim, gDim; - bDim = hypre_GetDefaultCUDABlockDimension(); - gDim = hypre_GetDefaultCUDAGridDimension(nrows, "warp", bDim); + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(nrows, "warp", bDim); - HYPRE_CUDA_LAUNCH(hypreCUDAKernel_CSRMoveDiagFirst, gDim, bDim, - nrows, A_i, A_j, A_data); + HYPRE_GPU_LAUNCH(hypreGPUKernel_CSRMoveDiagFirst, gDim, bDim, + nrows, A_i, A_j, A_data); - hypre_SyncCudaComputeStream(hypre_handle()); + hypre_SyncComputeStream(); return hypre_error_flag; } -/* check if diagonal entry is the first one at each row +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixStack2Device + * + * return C = [A; B] + *--------------------------------------------------------------------------*/ + +hypre_CSRMatrix* +hypre_CSRMatrixStack2Device(hypre_CSRMatrix *A, hypre_CSRMatrix *B) +{ + hypre_GpuProfilingPushRange("CSRMatrixStack2"); + + hypre_assert( hypre_CSRMatrixNumCols(A) == hypre_CSRMatrixNumCols(B) ); + + hypre_CSRMatrix *C = hypre_CSRMatrixCreate( hypre_CSRMatrixNumRows(A) + hypre_CSRMatrixNumRows(B), + hypre_CSRMatrixNumCols(A), + hypre_CSRMatrixNumNonzeros(A) + hypre_CSRMatrixNumNonzeros(B) ); + + HYPRE_Int *C_i = hypre_TAlloc(HYPRE_Int, hypre_CSRMatrixNumRows(C) + 1, + HYPRE_MEMORY_DEVICE); + HYPRE_Int *C_j = hypre_TAlloc(HYPRE_Int, hypre_CSRMatrixNumNonzeros(C), + HYPRE_MEMORY_DEVICE); + HYPRE_Complex *C_a = hypre_TAlloc(HYPRE_Complex, hypre_CSRMatrixNumNonzeros(C), + HYPRE_MEMORY_DEVICE); + + hypre_TMemcpy(C_i, hypre_CSRMatrixI(A), HYPRE_Int, hypre_CSRMatrixNumRows(A) + 1, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(C_i + hypre_CSRMatrixNumRows(A) + 1, hypre_CSRMatrixI(B) + 1, HYPRE_Int, + hypre_CSRMatrixNumRows(B), + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::transform, + C_i + hypre_CSRMatrixNumRows(A) + 1, + C_i + hypre_CSRMatrixNumRows(C) + 1, + C_i + hypre_CSRMatrixNumRows(A) + 1, + [const_val = hypre_CSRMatrixNumNonzeros(A)] (const auto & x) {return x + const_val;} ); +#else + HYPRE_THRUST_CALL( transform, + C_i + hypre_CSRMatrixNumRows(A) + 1, + C_i + hypre_CSRMatrixNumRows(C) + 1, + thrust::make_constant_iterator(hypre_CSRMatrixNumNonzeros(A)), + C_i + hypre_CSRMatrixNumRows(A) + 1, + thrust::plus() ); +#endif + + hypre_TMemcpy(C_j, hypre_CSRMatrixJ(A), HYPRE_Int, hypre_CSRMatrixNumNonzeros(A), + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(C_j + hypre_CSRMatrixNumNonzeros(A), hypre_CSRMatrixJ(B), HYPRE_Int, + hypre_CSRMatrixNumNonzeros(B), + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + + hypre_TMemcpy(C_a, hypre_CSRMatrixData(A), HYPRE_Complex, hypre_CSRMatrixNumNonzeros(A), + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(C_a + hypre_CSRMatrixNumNonzeros(A), hypre_CSRMatrixData(B), HYPRE_Complex, + hypre_CSRMatrixNumNonzeros(B), + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + + hypre_CSRMatrixI(C) = C_i; + hypre_CSRMatrixJ(C) = C_j; + hypre_CSRMatrixData(C) = C_a; + hypre_CSRMatrixMemoryLocation(C) = HYPRE_MEMORY_DEVICE; + + hypre_GpuProfilingPopRange(); + + return C; +} + +/*-------------------------------------------------------------------------- + * hypreGPUKernel_CSRRowSum + * + * type == 0, sum, + * 1, abs sum (l-1) + * 2, square sum (l-2) + *--------------------------------------------------------------------------*/ + +template +__global__ void +hypreGPUKernel_CSRRowSum( hypre_DeviceItem &item, + HYPRE_Int nrows, + HYPRE_Int *ia, + HYPRE_Int *ja, + HYPRE_Complex *aa, + HYPRE_Int *CF_i, + HYPRE_Int *CF_j, + HYPRE_Complex *row_sum, + HYPRE_Complex scal, + HYPRE_Int set) +{ + HYPRE_Int row_i = hypre_gpu_get_grid_warp_id<1, 1>(item); + + if (row_i >= nrows) + { + return; + } + + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); + HYPRE_Int p = 0, q = 0; + + if (lane < 2) + { + p = read_only_load(ia + row_i + lane); + } + q = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 1); + p = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 0); + + HYPRE_Complex row_sum_i = 0.0; + + for (HYPRE_Int j = p + lane; j < q; j += HYPRE_WARP_SIZE) + { + if ( CF_i && CF_j && read_only_load(&CF_i[row_i]) != read_only_load(&CF_j[ja[j]]) ) + { + continue; + } + + HYPRE_Complex aii = aa[j]; + + if (type == 0) + { + row_sum_i += aii; + } + else if (type == 1) + { + row_sum_i += hypre_abs(aii); + } + else if (type == 2) + { + row_sum_i += aii * aii; + } + } + + row_sum_i = warp_reduce_sum(item, row_sum_i); + + if (lane == 0) + { + if (set) + { + row_sum[row_i] = scal * row_sum_i; + } + else + { + row_sum[row_i] += scal * row_sum_i; + } + } +} + +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixComputeRowSumDevice + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixComputeRowSumDevice( hypre_CSRMatrix *A, + HYPRE_Int *CF_i, + HYPRE_Int *CF_j, + HYPRE_Complex *row_sum, + HYPRE_Int type, + HYPRE_Complex scal, + const char *set_or_add) +{ + HYPRE_Int nrows = hypre_CSRMatrixNumRows(A); + HYPRE_Complex *A_data = hypre_CSRMatrixData(A); + HYPRE_Int *A_i = hypre_CSRMatrixI(A); + HYPRE_Int *A_j = hypre_CSRMatrixJ(A); + + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(nrows, "warp", bDim); + + HYPRE_Int set = set_or_add[0] == 's'; + if (type == 0) + { + HYPRE_GPU_LAUNCH( hypreGPUKernel_CSRRowSum<0>, gDim, bDim, + nrows, A_i, A_j, A_data, + CF_i, CF_j, row_sum, scal, set ); + } + else if (type == 1) + { + HYPRE_GPU_LAUNCH( hypreGPUKernel_CSRRowSum<1>, gDim, bDim, + nrows, A_i, A_j, A_data, + CF_i, CF_j, row_sum, scal, set ); + } + else if (type == 2) + { + HYPRE_GPU_LAUNCH( hypreGPUKernel_CSRRowSum<2>, gDim, bDim, + nrows, A_i, A_j, A_data, CF_i, CF_j, + row_sum, scal, set ); + } + + hypre_SyncComputeStream(); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypreGPUKernel_CSRMatrixIntersectPattern + * + * mark is of size nA + * diag_option: 1: special treatment for diag entries, mark as -2 + *--------------------------------------------------------------------------*/ + +__global__ void +hypreGPUKernel_CSRMatrixIntersectPattern(hypre_DeviceItem &item, + HYPRE_Int n, + HYPRE_Int nA, + HYPRE_Int *rowid, + HYPRE_Int *colid, + HYPRE_Int *idx, + HYPRE_Int *mark, + HYPRE_Int diag_option) +{ + HYPRE_Int i = hypre_gpu_get_grid_thread_id<1, 1>(item); + + if (i >= n) + { + return; + } + + HYPRE_Int r1 = read_only_load(&rowid[i]); + HYPRE_Int c1 = read_only_load(&colid[i]); + HYPRE_Int j = read_only_load(&idx[i]); + + if (0 == diag_option) + { + if (j < nA) + { + HYPRE_Int r2 = i < n - 1 ? read_only_load(&rowid[i + 1]) : -1; + HYPRE_Int c2 = i < n - 1 ? read_only_load(&colid[i + 1]) : -1; + if (r1 == r2 && c1 == c2) + { + mark[j] = c1; + } + else + { + mark[j] = -1; + } + } + } + else if (1 == diag_option) + { + if (j < nA) + { + if (r1 == c1) + { + mark[j] = -2; + } + else + { + HYPRE_Int r2 = i < n - 1 ? read_only_load(&rowid[i + 1]) : -1; + HYPRE_Int c2 = i < n - 1 ? read_only_load(&colid[i + 1]) : -1; + if (r1 == r2 && c1 == c2) + { + mark[j] = c1; + } + else + { + mark[j] = -1; + } + } + } + } +} + +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixIntersectPattern + * + * markA: array of size nnz(A), for pattern of (A and B), markA is the + * column indices as in A_J. Otherwise, mark pattern not in A-B as -1 in markA + * + * Note the special treatment for diagonal entries of A (marked as -2) + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixIntersectPattern(hypre_CSRMatrix *A, + hypre_CSRMatrix *B, + HYPRE_Int *markA, + HYPRE_Int diag_opt) +{ + HYPRE_Int nrows = hypre_CSRMatrixNumRows(A); + HYPRE_Int nnzA = hypre_CSRMatrixNumNonzeros(A); + HYPRE_Int nnzB = hypre_CSRMatrixNumNonzeros(B); + + HYPRE_Int *Cii = hypre_TAlloc(HYPRE_Int, nnzA + nnzB, HYPRE_MEMORY_DEVICE); + HYPRE_Int *Cjj = hypre_TAlloc(HYPRE_Int, nnzA + nnzB, HYPRE_MEMORY_DEVICE); + HYPRE_Int *idx = hypre_TAlloc(HYPRE_Int, nnzA + nnzB, HYPRE_MEMORY_DEVICE); + + hypreDevice_CsrRowPtrsToIndices_v2(nrows, nnzA, hypre_CSRMatrixI(A), Cii); + hypreDevice_CsrRowPtrsToIndices_v2(nrows, nnzB, hypre_CSRMatrixI(B), Cii + nnzA); + hypre_TMemcpy(Cjj, hypre_CSRMatrixJ(A), HYPRE_Int, nnzA, HYPRE_MEMORY_DEVICE, + HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(Cjj + nnzA, hypre_CSRMatrixJ(B), HYPRE_Int, nnzB, HYPRE_MEMORY_DEVICE, + HYPRE_MEMORY_DEVICE); + +#if defined(HYPRE_USING_SYCL) + hypreSycl_sequence(idx, idx + nnzA + nnzB, 0); + + auto zipped_begin = oneapi::dpl::make_zip_iterator(Cii, Cjj, idx); + HYPRE_ONEDPL_CALL( std::stable_sort, zipped_begin, zipped_begin + nnzA + nnzB, + [](auto lhs, auto rhs) + { + if (std::get<0>(lhs) == std::get<0>(rhs)) + { + return std::get<1>(lhs) < std::get<1>(rhs); + } + else + { + return std::get<0>(lhs) < std::get<0>(rhs); + } + } ); +#else + HYPRE_THRUST_CALL( sequence, idx, idx + nnzA + nnzB ); + + HYPRE_THRUST_CALL( stable_sort_by_key, + thrust::make_zip_iterator(thrust::make_tuple(Cii, Cjj)), + thrust::make_zip_iterator(thrust::make_tuple(Cii, Cjj)) + nnzA + nnzB, + idx ); +#endif + + hypre_TMemcpy(markA, hypre_CSRMatrixJ(A), HYPRE_Int, nnzA, HYPRE_MEMORY_DEVICE, + HYPRE_MEMORY_DEVICE); + + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(nnzA + nnzB, "thread", bDim); + + HYPRE_GPU_LAUNCH( hypreGPUKernel_CSRMatrixIntersectPattern, gDim, bDim, + nnzA + nnzB, nnzA, Cii, Cjj, idx, markA, diag_opt ); + + hypre_TFree(Cii, HYPRE_MEMORY_DEVICE); + hypre_TFree(Cjj, HYPRE_MEMORY_DEVICE); + hypre_TFree(idx, HYPRE_MEMORY_DEVICE); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypreGPUKernel_CSRExtractDiag + * + * type 0: diag + * 1: abs diag + * 2: diag inverse + * 3: diag inverse sqrt + * 4: abs diag inverse sqrt + *--------------------------------------------------------------------------*/ + +__global__ void +hypreGPUKernel_CSRExtractDiag( hypre_DeviceItem &item, + HYPRE_Int nrows, + HYPRE_Int *ia, + HYPRE_Int *ja, + HYPRE_Complex *aa, + HYPRE_Complex *d, + HYPRE_Int type) +{ + HYPRE_Int row = hypre_gpu_get_grid_warp_id<1, 1>(item); + + if (row >= nrows) + { + return; + } + + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); + HYPRE_Int p = 0, q = 0; + + if (lane < 2) + { + p = read_only_load(ia + row + lane); + } + q = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 1); + p = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 0); + + HYPRE_Int has_diag = 0; + + for (HYPRE_Int j = p + lane; + warp_any_sync(item, HYPRE_WARP_FULL_MASK, j < q); + j += HYPRE_WARP_SIZE) + { + hypre_int find_diag = j < q && ja[j] == row; + + if (find_diag) + { + if (type == 0) + { + d[row] = aa[j]; + } + else if (type == 1) + { + d[row] = hypre_abs(aa[j]); + } + else + { + if (aa[j] == 0.0) + { + d[row] = 0.0; + } + else if (type == 2) + { + d[row] = 1.0 / aa[j]; + } + else if (type == 3) + { + d[row] = 1.0 / hypre_sqrt(aa[j]); + } + else if (type == 4) + { + d[row] = 1.0 / hypre_sqrt(hypre_abs(aa[j])); + } + } + } + + if (warp_any_sync(item, HYPRE_WARP_FULL_MASK, find_diag)) + { + has_diag = 1; + break; + } + } + + if (!has_diag && lane == 0) + { + d[row] = 0.0; + } +} + +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixExtractDiagonalDevice + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixExtractDiagonalDevice( hypre_CSRMatrix *A, + HYPRE_Complex *d, + HYPRE_Int type) +{ + HYPRE_Int nrows = hypre_CSRMatrixNumRows(A); + HYPRE_Complex *A_data = hypre_CSRMatrixData(A); + HYPRE_Int *A_i = hypre_CSRMatrixI(A); + HYPRE_Int *A_j = hypre_CSRMatrixJ(A); + + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(nrows, "warp", bDim); + + HYPRE_GPU_LAUNCH( hypreGPUKernel_CSRExtractDiag, gDim, bDim, nrows, + A_i, A_j, A_data, d, type ); + + hypre_SyncComputeStream(); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypreGPUKernel_CSRCheckDiagFirst + * + * check if diagonal entry is the first one at each row * Return: the number of rows that do not have the first entry as diagonal * RL: only check if it's a non-empty row - */ + *--------------------------------------------------------------------------*/ + __global__ void -hypreCUDAKernel_CSRCheckDiagFirst( HYPRE_Int nrows, - HYPRE_Int *ia, - HYPRE_Int *ja, - HYPRE_Int *result ) +hypreGPUKernel_CSRCheckDiagFirst( hypre_DeviceItem &item, + HYPRE_Int nrows, + HYPRE_Int *ia, + HYPRE_Int *ja, + HYPRE_Int *result ) { - const HYPRE_Int row = hypre_cuda_get_grid_thread_id<1,1>(); + const HYPRE_Int row = hypre_gpu_get_grid_thread_id<1, 1>(item); if (row < nrows) { - result[row] = (ia[row+1] > ia[row]) && (ja[ia[row]] != row); + result[row] = (ia[row + 1] > ia[row]) && (ja[ia[row]] != row); } } +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixCheckDiagFirstDevice + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_CSRMatrixCheckDiagFirstDevice( hypre_CSRMatrix *A ) { + HYPRE_Int *A_i = hypre_CSRMatrixI(A); + HYPRE_Int *A_j = hypre_CSRMatrixJ(A); + HYPRE_Int num_rows = hypre_CSRMatrixNumRows(A); + HYPRE_Int *result; + HYPRE_Int ierr; + + /* Sanity check */ if (hypre_CSRMatrixNumRows(A) != hypre_CSRMatrixNumCols(A)) { return 0; } - dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(hypre_CSRMatrixNumRows(A), "thread", bDim); + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(hypre_CSRMatrixNumRows(A), "thread", bDim); - HYPRE_Int *result = hypre_TAlloc(HYPRE_Int, hypre_CSRMatrixNumRows(A), HYPRE_MEMORY_DEVICE); - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_CSRCheckDiagFirst, gDim, bDim, - hypre_CSRMatrixNumRows(A), - hypre_CSRMatrixI(A), hypre_CSRMatrixJ(A), result ); + result = hypre_TAlloc(HYPRE_Int, num_rows, HYPRE_MEMORY_DEVICE); + HYPRE_GPU_LAUNCH( hypreGPUKernel_CSRCheckDiagFirst, gDim, bDim, + num_rows, A_i, A_j, result ); - HYPRE_Int ierr = HYPRE_THRUST_CALL( reduce, - result, - result + hypre_CSRMatrixNumRows(A) ); + /* Compute number of rows in which the diagonal is not the first entry */ +#if defined(HYPRE_USING_SYCL) + ierr = HYPRE_ONEDPL_CALL( std::reduce, + result, + result + hypre_CSRMatrixNumRows(A) ); +#else + ierr = HYPRE_THRUST_CALL( reduce, + result, + result + hypre_CSRMatrixNumRows(A) ); +#endif hypre_TFree(result, HYPRE_MEMORY_DEVICE); - - hypre_SyncCudaComputeStream(hypre_handle()); + hypre_SyncComputeStream(); return ierr; } +/*-------------------------------------------------------------------------- + * hypreGPUKernel_CSRMatrixCheckForMissingDiagonal + *--------------------------------------------------------------------------*/ + __global__ void -hypreCUDAKernel_CSRMatrixFixZeroDiagDevice( HYPRE_Complex v, - HYPRE_Int nrows, - HYPRE_Int *ia, - HYPRE_Int *ja, - HYPRE_Complex *data, - HYPRE_Real tol, - HYPRE_Int *result ) +hypreGPUKernel_CSRMatrixCheckForMissingDiagonal( hypre_DeviceItem &item, + HYPRE_Int nrows, + HYPRE_Int *ia, + HYPRE_Int *ja, + HYPRE_Int *result ) { - const HYPRE_Int row = hypre_cuda_get_grid_warp_id<1,1>(); + const HYPRE_Int row = hypre_gpu_get_grid_warp_id<1, 1>(item); if (row >= nrows) { return; } - HYPRE_Int lane = hypre_cuda_get_lane_id<1>(); + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); HYPRE_Int p = 0, q = 0; - bool has_diag = false; + bool missing_diagonal = true; if (lane < 2) { p = read_only_load(ia + row + lane); } - q = __shfl_sync(HYPRE_WARP_FULL_MASK, p, 1); - p = __shfl_sync(HYPRE_WARP_FULL_MASK, p, 0); + q = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 1); + p = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 0); - for (HYPRE_Int j = p + lane; __any_sync(HYPRE_WARP_FULL_MASK, j < q); j += HYPRE_WARP_SIZE) + for (HYPRE_Int j = p + lane; warp_any_sync(item, HYPRE_WARP_FULL_MASK, j < q); j += HYPRE_WARP_SIZE) { hypre_int find_diag = j < q && read_only_load(&ja[j]) == row; - if (find_diag) - { - if (fabs(data[j]) <= tol) - { - data[j] = v; - } - } - - if ( __any_sync(HYPRE_WARP_FULL_MASK, find_diag) ) + if ( warp_any_sync(item, HYPRE_WARP_FULL_MASK, find_diag) ) { - has_diag = true; + missing_diagonal = false; break; } } - if (result && !has_diag && lane == 0) + if (missing_diagonal && lane == 0) { result[row] = 1; } } -/* For square A, find numerical zeros (absolute values <= tol) on its diagonal and replace with v - * Does NOT assume diagonal is the first entry of each row of A - * In debug mode: - * Returns the number of rows that do not have diag in the pattern - * (i.e., structural zeroes on the diagonal) - */ +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixCheckForMissingDiagonal + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_CSRMatrixFixZeroDiagDevice( hypre_CSRMatrix *A, - HYPRE_Complex v, - HYPRE_Real tol ) +hypre_CSRMatrixCheckForMissingDiagonal( hypre_CSRMatrix *A ) { - HYPRE_Int ierr = 0; + HYPRE_Int *A_i = hypre_CSRMatrixI(A); + HYPRE_Int *A_j = hypre_CSRMatrixJ(A); + HYPRE_Int num_rows = hypre_CSRMatrixNumRows(A); + HYPRE_Int *result; + HYPRE_Int ierr; + /* This test is only for square matrices */ if (hypre_CSRMatrixNumRows(A) != hypre_CSRMatrixNumCols(A)) { - return ierr; + return 0; } - dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(hypre_CSRMatrixNumRows(A), "warp", bDim); - -#if HYPRE_DEBUG - HYPRE_Int *result = hypre_CTAlloc(HYPRE_Int, hypre_CSRMatrixNumRows(A), HYPRE_MEMORY_DEVICE); -#else - HYPRE_Int *result = NULL; -#endif + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(hypre_CSRMatrixNumRows(A), "thread", bDim); - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_CSRMatrixFixZeroDiagDevice, gDim, bDim, - v, hypre_CSRMatrixNumRows(A), - hypre_CSRMatrixI(A), hypre_CSRMatrixJ(A), hypre_CSRMatrixData(A), - tol, result ); + result = hypre_CTAlloc(HYPRE_Int, num_rows, HYPRE_MEMORY_DEVICE); + HYPRE_GPU_LAUNCH( hypreGPUKernel_CSRMatrixCheckForMissingDiagonal, gDim, bDim, + num_rows, A_i, A_j, result ); -#if HYPRE_DEBUG + /* Compute number of rows in which the diagonal is not the first entry */ +#if defined(HYPRE_USING_SYCL) + ierr = HYPRE_ONEDPL_CALL( std::reduce, + result, + result + hypre_CSRMatrixNumRows(A) ); +#else ierr = HYPRE_THRUST_CALL( reduce, result, result + hypre_CSRMatrixNumRows(A) ); - - hypre_TFree(result, HYPRE_MEMORY_DEVICE); #endif - hypre_SyncCudaComputeStream(hypre_handle()); + hypre_TFree(result, HYPRE_MEMORY_DEVICE); return ierr; } +/*-------------------------------------------------------------------------- + * hypreGPUKernel_CSRMatrixReplaceDiagDevice + *--------------------------------------------------------------------------*/ + __global__ void -hypreCUDAKernel_CSRMatrixReplaceDiagDevice( HYPRE_Complex *new_diag, - HYPRE_Complex v, - HYPRE_Int nrows, - HYPRE_Int *ia, - HYPRE_Int *ja, - HYPRE_Complex *data, - HYPRE_Real tol, - HYPRE_Int *result ) +hypreGPUKernel_CSRMatrixReplaceDiagDevice( hypre_DeviceItem &item, + HYPRE_Complex *new_diag, + HYPRE_Complex v, + HYPRE_Int nrows, + HYPRE_Int *ia, + HYPRE_Int *ja, + HYPRE_Complex *data, + HYPRE_Real tol, + HYPRE_Int *result ) { - const HYPRE_Int row = hypre_cuda_get_grid_warp_id<1,1>(); + const HYPRE_Int row = hypre_gpu_get_grid_warp_id<1, 1>(item); if (row >= nrows) { return; } - HYPRE_Int lane = hypre_cuda_get_lane_id<1>(); + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); HYPRE_Int p = 0, q = 0; bool has_diag = false; @@ -830,24 +1763,30 @@ hypreCUDAKernel_CSRMatrixReplaceDiagDevice( HYPRE_Complex *new_diag, { p = read_only_load(ia + row + lane); } - q = __shfl_sync(HYPRE_WARP_FULL_MASK, p, 1); - p = __shfl_sync(HYPRE_WARP_FULL_MASK, p, 0); + q = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 1); + p = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 0); - for (HYPRE_Int j = p + lane; __any_sync(HYPRE_WARP_FULL_MASK, j < q); j += HYPRE_WARP_SIZE) + for (HYPRE_Int j = p + lane; warp_any_sync(item, HYPRE_WARP_FULL_MASK, j < q); j += HYPRE_WARP_SIZE) { hypre_int find_diag = j < q && read_only_load(&ja[j]) == row; if (find_diag) { - HYPRE_Complex d = read_only_load(&new_diag[row]); - if (fabs(d) <= tol) + if (new_diag) + { + HYPRE_Complex d = read_only_load(&new_diag[row]); + data[j] = hypre_abs(d) <= tol ? v : d; + } + else { - d = v; + if (hypre_abs(data[j]) <= tol) + { + data[j] = v; + } } - data[j] = d; } - if ( __any_sync(HYPRE_WARP_FULL_MASK, find_diag) ) + if ( warp_any_sync(item, HYPRE_WARP_FULL_MASK, find_diag) ) { has_diag = true; break; @@ -860,21 +1799,23 @@ hypreCUDAKernel_CSRMatrixReplaceDiagDevice( HYPRE_Complex *new_diag, } } +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixReplaceDiagDevice + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_CSRMatrixReplaceDiagDevice( hypre_CSRMatrix *A, HYPRE_Complex *new_diag, HYPRE_Complex v, HYPRE_Real tol ) { - HYPRE_Int ierr = 0; - if (hypre_CSRMatrixNumRows(A) != hypre_CSRMatrixNumCols(A)) { - return ierr; + return hypre_error_flag; } - dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(hypre_CSRMatrixNumRows(A), "warp", bDim); + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(hypre_CSRMatrixNumRows(A), "warp", bDim); #if HYPRE_DEBUG HYPRE_Int *result = hypre_CTAlloc(HYPRE_Int, hypre_CSRMatrixNumRows(A), HYPRE_MEMORY_DEVICE); @@ -882,26 +1823,56 @@ hypre_CSRMatrixReplaceDiagDevice( hypre_CSRMatrix *A, HYPRE_Int *result = NULL; #endif - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_CSRMatrixReplaceDiagDevice, gDim, bDim, - new_diag, v, hypre_CSRMatrixNumRows(A), - hypre_CSRMatrixI(A), hypre_CSRMatrixJ(A), hypre_CSRMatrixData(A), - tol, result ); + HYPRE_Int num_rows = hypre_CSRMatrixNumRows(A); + HYPRE_Int *A_i = hypre_CSRMatrixI(A); + HYPRE_Int *A_j = hypre_CSRMatrixJ(A); + HYPRE_Complex *A_data = hypre_CSRMatrixData(A); + HYPRE_GPU_LAUNCH( hypreGPUKernel_CSRMatrixReplaceDiagDevice, gDim, bDim, + new_diag, v, num_rows, + A_i, A_j, A_data, + tol, result ); #if HYPRE_DEBUG - ierr = HYPRE_THRUST_CALL( reduce, - result, - result + hypre_CSRMatrixNumRows(A) ); + /* the number of structural zero in A */ +#if defined(HYPRE_USING_SYCL) + HYPRE_Int num_zeros = HYPRE_ONEDPL_CALL( std::reduce, + result, + result + hypre_CSRMatrixNumRows(A) ); +#else + HYPRE_Int num_zeros = HYPRE_THRUST_CALL( reduce, + result, + result + hypre_CSRMatrixNumRows(A) ); +#endif hypre_TFree(result, HYPRE_MEMORY_DEVICE); + + if (num_zeros) + { + hypre_error_w_msg(num_zeros, "structural zero in hypre_CSRMatrixReplaceDiagDevice"); + } #endif - hypre_SyncCudaComputeStream(hypre_handle()); + hypre_SyncComputeStream(); - return ierr; + return hypre_error_flag; } +#if defined(HYPRE_USING_SYCL) +typedef std::tuple Int2; +struct Int2Unequal +{ + bool operator()(const Int2& t) const + { + return (std::get<0>(t) != std::get<1>(t)); + } +}; +#else typedef thrust::tuple Int2; +#if (defined(THRUST_VERSION) && THRUST_VERSION < 101000) struct Int2Unequal : public thrust::unary_function +#else +struct Int2Unequal +#endif { __host__ __device__ bool operator()(const Int2& t) const @@ -909,6 +1880,11 @@ struct Int2Unequal : public thrust::unary_function return (thrust::get<0>(t) != thrust::get<1>(t)); } }; +#endif + +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixRemoveDiagonalDevice + *--------------------------------------------------------------------------*/ HYPRE_Int hypre_CSRMatrixRemoveDiagonalDevice(hypre_CSRMatrix *A) @@ -924,10 +1900,18 @@ hypre_CSRMatrixRemoveDiagonalDevice(hypre_CSRMatrix *A) HYPRE_Int *new_j; HYPRE_Complex *new_data; +#if defined(HYPRE_USING_SYCL) + auto zip_ij = oneapi::dpl::make_zip_iterator(A_ii, A_j); + new_nnz = HYPRE_ONEDPL_CALL( std::count_if, + zip_ij, + zip_ij + nnz, + Int2Unequal() ); +#else new_nnz = HYPRE_THRUST_CALL( count_if, thrust::make_zip_iterator(thrust::make_tuple(A_ii, A_j)), thrust::make_zip_iterator(thrust::make_tuple(A_ii, A_j)) + nnz, Int2Unequal() ); +#endif if (new_nnz == nnz) { @@ -943,31 +1927,51 @@ hypre_CSRMatrixRemoveDiagonalDevice(hypre_CSRMatrix *A) { new_data = hypre_TAlloc(HYPRE_Complex, new_nnz, HYPRE_MEMORY_DEVICE); - thrust::zip_iterator< thrust::tuple > new_end; - - new_end = HYPRE_THRUST_CALL( copy_if, - thrust::make_zip_iterator(thrust::make_tuple(A_ii, A_j, A_data)), - thrust::make_zip_iterator(thrust::make_tuple(A_ii, A_j, A_data)) + nnz, - thrust::make_zip_iterator(thrust::make_tuple(A_ii, A_j)), - thrust::make_zip_iterator(thrust::make_tuple(new_ii, new_j, new_data)), - Int2Unequal() ); +#if defined(HYPRE_USING_SYCL) + auto zip_ija = oneapi::dpl::make_zip_iterator(A_ii, A_j, A_data); + auto zip_new_ija = oneapi::dpl::make_zip_iterator(new_ii, new_j, new_data); + auto new_end = hypreSycl_copy_if( + zip_ija, + zip_ija + nnz, + zip_ij, + zip_new_ija, + Int2Unequal() ); + + hypre_assert( std::get<0>(new_end.base()) == new_ii + new_nnz ); +#else + auto new_end = HYPRE_THRUST_CALL( copy_if, + thrust::make_zip_iterator(thrust::make_tuple(A_ii, A_j, A_data)), + thrust::make_zip_iterator(thrust::make_tuple(A_ii, A_j, A_data)) + nnz, + thrust::make_zip_iterator(thrust::make_tuple(A_ii, A_j)), + thrust::make_zip_iterator(thrust::make_tuple(new_ii, new_j, new_data)), + Int2Unequal() ); hypre_assert( thrust::get<0>(new_end.get_iterator_tuple()) == new_ii + new_nnz ); +#endif } else { new_data = NULL; - thrust::zip_iterator< thrust::tuple > new_end; +#if defined(HYPRE_USING_SYCL) + auto zip_new_ij = oneapi::dpl::make_zip_iterator(new_ii, new_j); + auto new_end = hypreSycl_copy_if( zip_ij, + zip_ij + nnz, + zip_ij, + zip_new_ij, + Int2Unequal() ); - new_end = HYPRE_THRUST_CALL( copy_if, - thrust::make_zip_iterator(thrust::make_tuple(A_ii, A_j)), - thrust::make_zip_iterator(thrust::make_tuple(A_ii, A_j)) + nnz, - thrust::make_zip_iterator(thrust::make_tuple(A_ii, A_j)), - thrust::make_zip_iterator(thrust::make_tuple(new_ii, new_j)), - Int2Unequal() ); + hypre_assert( std::get<0>(new_end.base()) == new_ii + new_nnz ); +#else + auto new_end = HYPRE_THRUST_CALL( copy_if, + thrust::make_zip_iterator(thrust::make_tuple(A_ii, A_j)), + thrust::make_zip_iterator(thrust::make_tuple(A_ii, A_j)) + nnz, + thrust::make_zip_iterator(thrust::make_tuple(A_ii, A_j)), + thrust::make_zip_iterator(thrust::make_tuple(new_ii, new_j)), + Int2Unequal() ); hypre_assert( thrust::get<0>(new_end.get_iterator_tuple()) == new_ii + new_nnz ); +#endif } hypre_TFree(A_ii, HYPRE_MEMORY_DEVICE); @@ -984,281 +1988,117 @@ hypre_CSRMatrixRemoveDiagonalDevice(hypre_CSRMatrix *A) return hypre_error_flag; } -/* type == 0, sum, - * 1, abs sum (l-1) - * 2, square sum (l-2) - */ -template +/*-------------------------------------------------------------------------- + * hypreGPUKernel_CSRDiagScale + *--------------------------------------------------------------------------*/ + __global__ void -hypreCUDAKernel_CSRRowSum( HYPRE_Int nrows, - HYPRE_Int *ia, - HYPRE_Int *ja, - HYPRE_Complex *aa, - HYPRE_Int *CF_i, - HYPRE_Int *CF_j, - HYPRE_Complex *row_sum, - HYPRE_Complex scal, - HYPRE_Int set) +hypreGPUKernel_CSRDiagScale( hypre_DeviceItem &item, + HYPRE_Int nrows, + HYPRE_Int *ia, + HYPRE_Int *ja, + HYPRE_Complex *aa, + HYPRE_Complex *ld, + HYPRE_Complex *rd) { - HYPRE_Int row_i = hypre_cuda_get_grid_warp_id<1,1>(); + HYPRE_Int row = hypre_gpu_get_grid_warp_id<1, 1>(item); - if (row_i >= nrows) + if (row >= nrows) { return; } - HYPRE_Int lane = hypre_cuda_get_lane_id<1>(); + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); HYPRE_Int p = 0, q = 0; if (lane < 2) { - p = read_only_load(ia + row_i + lane); + p = read_only_load(ia + row + lane); } - q = __shfl_sync(HYPRE_WARP_FULL_MASK, p, 1); - p = __shfl_sync(HYPRE_WARP_FULL_MASK, p, 0); + q = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 1); + p = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 0); - HYPRE_Complex row_sum_i = 0.0; + HYPRE_Complex sl = 1.0; - for (HYPRE_Int j = p + lane; __any_sync(HYPRE_WARP_FULL_MASK, j < q); j += HYPRE_WARP_SIZE) + if (ld) { - if ( j >= q || (CF_i && CF_j && read_only_load(&CF_i[row_i]) != read_only_load(&CF_j[ja[j]])) ) - { - continue; - } - - HYPRE_Complex aii = aa[j]; - - if (type == 0) - { - row_sum_i += aii; - } - else if (type == 1) - { - row_sum_i += fabs(aii); - } - else if (type == 2) + if (!lane) { - row_sum_i += aii * aii; + sl = read_only_load(ld + row); } + sl = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, sl, 0); } - row_sum_i = warp_reduce_sum(row_sum_i); - - if (lane == 0) + if (rd) { - if (set) + for (HYPRE_Int i = p + lane; i < q; i += HYPRE_WARP_SIZE) { - row_sum[row_i] = scal * row_sum_i; - } - else - { - row_sum[row_i] += scal * row_sum_i; + const HYPRE_Int col = read_only_load(ja + i); + const HYPRE_Complex sr = read_only_load(rd + col); + aa[i] = sl * aa[i] * sr; } } -} - -void -hypre_CSRMatrixComputeRowSumDevice( hypre_CSRMatrix *A, - HYPRE_Int *CF_i, - HYPRE_Int *CF_j, - HYPRE_Complex *row_sum, - HYPRE_Int type, - HYPRE_Complex scal, - const char *set_or_add) -{ - HYPRE_Int nrows = hypre_CSRMatrixNumRows(A); - HYPRE_Complex *A_data = hypre_CSRMatrixData(A); - HYPRE_Int *A_i = hypre_CSRMatrixI(A); - HYPRE_Int *A_j = hypre_CSRMatrixJ(A); - dim3 bDim, gDim; - - bDim = hypre_GetDefaultCUDABlockDimension(); - gDim = hypre_GetDefaultCUDAGridDimension(nrows, "warp", bDim); - - if (type == 0) - { - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_CSRRowSum<0>, gDim, bDim, nrows, A_i, A_j, A_data, CF_i, CF_j, - row_sum, scal, set_or_add[0] == 's' ); - } - else if (type == 1) - { - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_CSRRowSum<1>, gDim, bDim, nrows, A_i, A_j, A_data, CF_i, CF_j, - row_sum, scal, set_or_add[0] == 's' ); - } - else if (type == 2) - { - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_CSRRowSum<2>, gDim, bDim, nrows, A_i, A_j, A_data, CF_i, CF_j, - row_sum, scal, set_or_add[0] == 's' ); - } - - hypre_SyncCudaComputeStream(hypre_handle()); -} - -/* type 0: diag - * 1: abs diag - * 2: diag inverse - * 3: diag inverse sqrt - * 4: abs diag inverse sqrt - */ -__global__ void -hypreCUDAKernel_CSRExtractDiag( HYPRE_Int nrows, - HYPRE_Int *ia, - HYPRE_Int *ja, - HYPRE_Complex *aa, - HYPRE_Complex *d, - HYPRE_Int type) -{ - HYPRE_Int row = hypre_cuda_get_grid_warp_id<1,1>(); - - if (row >= nrows) - { - return; - } - - HYPRE_Int lane = hypre_cuda_get_lane_id<1>(); - HYPRE_Int p = 0, q = 0; - - if (lane < 2) - { - p = read_only_load(ia + row + lane); - } - q = __shfl_sync(HYPRE_WARP_FULL_MASK, p, 1); - p = __shfl_sync(HYPRE_WARP_FULL_MASK, p, 0); - - HYPRE_Int has_diag = 0; - - for (HYPRE_Int j = p + lane; __any_sync(HYPRE_WARP_FULL_MASK, j < q); j += HYPRE_WARP_SIZE) + else if (sl != 1.0) { - hypre_int find_diag = j < q && ja[j] == row; - - if (find_diag) - { - if (type == 0) - { - d[row] = aa[j]; - } - else if (type == 1) - { - d[row] = fabs(aa[j]); - } - else if (type == 2) - { - d[row] = 1.0 / aa[j]; - } - else if (type == 3) - { - d[row] = 1.0 / sqrt(aa[j]); - } - else if (type == 4) - { - d[row] = 1.0 / sqrt(fabs(aa[j])); - } - } - - if ( __any_sync(HYPRE_WARP_FULL_MASK, find_diag) ) + for (HYPRE_Int i = p + lane; i < q; i += HYPRE_WARP_SIZE) { - has_diag = 1; - break; + aa[i] = sl * aa[i]; } } - - if (!has_diag && lane == 0) - { - d[row] = 0.0; - } } -void -hypre_CSRMatrixExtractDiagonalDevice( hypre_CSRMatrix *A, - HYPRE_Complex *d, - HYPRE_Int type) +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixDiagScaleDevice + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixDiagScaleDevice( hypre_CSRMatrix *A, + hypre_Vector *ld, + hypre_Vector *rd) { HYPRE_Int nrows = hypre_CSRMatrixNumRows(A); HYPRE_Complex *A_data = hypre_CSRMatrixData(A); HYPRE_Int *A_i = hypre_CSRMatrixI(A); HYPRE_Int *A_j = hypre_CSRMatrixJ(A); - dim3 bDim, gDim; - - bDim = hypre_GetDefaultCUDABlockDimension(); - gDim = hypre_GetDefaultCUDAGridDimension(nrows, "warp", bDim); - - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_CSRExtractDiag, gDim, bDim, nrows, A_i, A_j, A_data, d, type ); - - hypre_SyncCudaComputeStream(hypre_handle()); -} - -/* return C = [A; B] */ -hypre_CSRMatrix* -hypre_CSRMatrixStack2Device(hypre_CSRMatrix *A, hypre_CSRMatrix *B) -{ - hypre_assert( hypre_CSRMatrixNumCols(A) == hypre_CSRMatrixNumCols(B) ); - - hypre_CSRMatrix *C = hypre_CSRMatrixCreate( hypre_CSRMatrixNumRows(A) + hypre_CSRMatrixNumRows(B), - hypre_CSRMatrixNumCols(A), - hypre_CSRMatrixNumNonzeros(A) + hypre_CSRMatrixNumNonzeros(B) ); - - HYPRE_Int *C_i = hypre_TAlloc(HYPRE_Int, hypre_CSRMatrixNumRows(C) + 1, HYPRE_MEMORY_DEVICE); - HYPRE_Int *C_j = hypre_TAlloc(HYPRE_Int, hypre_CSRMatrixNumNonzeros(C), HYPRE_MEMORY_DEVICE); - HYPRE_Complex *C_a = hypre_TAlloc(HYPRE_Complex, hypre_CSRMatrixNumNonzeros(C), HYPRE_MEMORY_DEVICE); - - hypre_TMemcpy(C_i, hypre_CSRMatrixI(A), HYPRE_Int, hypre_CSRMatrixNumRows(A) + 1, - HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); - hypre_TMemcpy(C_i + hypre_CSRMatrixNumRows(A) + 1, hypre_CSRMatrixI(B) + 1, HYPRE_Int, hypre_CSRMatrixNumRows(B), - HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); - HYPRE_THRUST_CALL( transform, - C_i + hypre_CSRMatrixNumRows(A) + 1, - C_i + hypre_CSRMatrixNumRows(C) + 1, - thrust::make_constant_iterator(hypre_CSRMatrixNumNonzeros(A)), - C_i + hypre_CSRMatrixNumRows(A) + 1, - thrust::plus() ); - - hypre_TMemcpy(C_j, hypre_CSRMatrixJ(A), HYPRE_Int, hypre_CSRMatrixNumNonzeros(A), - HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); - hypre_TMemcpy(C_j + hypre_CSRMatrixNumNonzeros(A), hypre_CSRMatrixJ(B), HYPRE_Int, hypre_CSRMatrixNumNonzeros(B), - HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); - - hypre_TMemcpy(C_a, hypre_CSRMatrixData(A), HYPRE_Complex, hypre_CSRMatrixNumNonzeros(A), - HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); - hypre_TMemcpy(C_a + hypre_CSRMatrixNumNonzeros(A), hypre_CSRMatrixData(B), HYPRE_Complex, hypre_CSRMatrixNumNonzeros(B), - HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); - - hypre_CSRMatrixI(C) = C_i; - hypre_CSRMatrixJ(C) = C_j; - hypre_CSRMatrixData(C) = C_a; - hypre_CSRMatrixMemoryLocation(C) = HYPRE_MEMORY_DEVICE; - - return C; -} - -/* A = alp * I */ -hypre_CSRMatrix * -hypre_CSRMatrixIdentityDevice(HYPRE_Int n, HYPRE_Complex alp) -{ - hypre_CSRMatrix *A = hypre_CSRMatrixCreate(n, n, n); - - hypre_CSRMatrixInitialize_v2(A, 0, HYPRE_MEMORY_DEVICE); - - HYPRE_THRUST_CALL( sequence, - hypre_CSRMatrixI(A), - hypre_CSRMatrixI(A) + n + 1, - 0 ); - - HYPRE_THRUST_CALL( sequence, - hypre_CSRMatrixJ(A), - hypre_CSRMatrixJ(A) + n, - 0 ); + HYPRE_Complex *ldata = ld ? hypre_VectorData(ld) : NULL; + HYPRE_Complex *rdata = rd ? hypre_VectorData(rd) : NULL; - HYPRE_THRUST_CALL( fill, - hypre_CSRMatrixData(A), - hypre_CSRMatrixData(A) + n, - alp ); + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(nrows, "warp", bDim); - return A; + HYPRE_GPU_LAUNCH(hypreGPUKernel_CSRDiagScale, gDim, bDim, + nrows, A_i, A_j, A_data, ldata, rdata); + + hypre_SyncComputeStream(); + + return hypre_error_flag; } -/* this predicate compares first and second element in a tuple in absolute value */ -/* first is assumed to be complex, second to be real > 0 */ -struct cabsfirst_greaterthan_second_pred : public thrust::unary_function,bool> +/*-------------------------------------------------------------------------- + * cabsfirst_greaterthan_second_pred + * + * This predicate compares first and second element in a tuple in absolute + * value first is assumed to be complex, second to be real > 0 + *--------------------------------------------------------------------------*/ + +#if defined(HYPRE_USING_SYCL) +struct cabsfirst_greaterthan_second_pred +{ + bool operator()(const std::tuple& t) const + { + const HYPRE_Complex i = std::get<0>(t); + const HYPRE_Real j = std::get<1>(t); + + return hypre_cabs(i) > j; + } +}; +#else +#if (defined(THRUST_VERSION) && THRUST_VERSION < 101000) +struct cabsfirst_greaterthan_second_pred : public + thrust::unary_function, bool> +#else +struct cabsfirst_greaterthan_second_pred +#endif { __host__ __device__ bool operator()(const thrust::tuple& t) const @@ -1269,10 +2109,16 @@ struct cabsfirst_greaterthan_second_pred : public thrust::unary_function j; } }; +#endif -/* drop the entries that are smaller than: +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixDropSmallEntriesDevice + * + * drop the entries that are smaller than: * tol if elmt_tols == null, - * elmt_tols[j] otherwise where j = 0...NumNonzeros(A) */ + * elmt_tols[j] otherwise where j = 0...NumNonzeros(A) + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_CSRMatrixDropSmallEntriesDevice( hypre_CSRMatrix *A, HYPRE_Real tol, @@ -1289,12 +2135,28 @@ hypre_CSRMatrixDropSmallEntriesDevice( hypre_CSRMatrix *A, HYPRE_Int *new_j; HYPRE_Complex *new_data; +#if defined(HYPRE_USING_SYCL) + if (elmt_tols == NULL) + { + new_nnz = HYPRE_ONEDPL_CALL( std::count_if, + A_data, + A_data + nnz, + [tol] (const auto & x) {return !(x < tol);} ); + } + else + { + new_nnz = HYPRE_ONEDPL_CALL( std::count_if, + oneapi::dpl::make_zip_iterator(A_data, elmt_tols), + oneapi::dpl::make_zip_iterator(A_data, elmt_tols) + nnz, + cabsfirst_greaterthan_second_pred() ); + } +#else if (elmt_tols == NULL) { new_nnz = HYPRE_THRUST_CALL( count_if, A_data, A_data + nnz, - thrust::not1(less_than(tol)) ); + HYPRE_THRUST_NOT(less_than(tol)) ); } else { @@ -1303,6 +2165,7 @@ hypre_CSRMatrixDropSmallEntriesDevice( hypre_CSRMatrix *A, thrust::make_zip_iterator(thrust::make_tuple(A_data, elmt_tols)) + nnz, cabsfirst_greaterthan_second_pred() ); } +#endif if (new_nnz == nnz) { @@ -1318,28 +2181,52 @@ hypre_CSRMatrixDropSmallEntriesDevice( hypre_CSRMatrix *A, new_j = hypre_TAlloc(HYPRE_Int, new_nnz, HYPRE_MEMORY_DEVICE); new_data = hypre_TAlloc(HYPRE_Complex, new_nnz, HYPRE_MEMORY_DEVICE); - thrust::zip_iterator< thrust::tuple > new_end; +#if defined(HYPRE_USING_SYCL) + if (elmt_tols == NULL) + { + auto new_end = hypreSycl_copy_if( oneapi::dpl::make_zip_iterator(A_ii, A_j, A_data), + oneapi::dpl::make_zip_iterator(A_ii, A_j, A_data) + nnz, + A_data, + oneapi::dpl::make_zip_iterator(new_ii, new_j, new_data), + [tol] (const auto & x) {return !(x < tol);} ); + + hypre_assert( std::get<0>(new_end.base()) == new_ii + new_nnz ); + } + else + { + auto new_end = hypreSycl_copy_if( oneapi::dpl::make_zip_iterator(A_ii, A_j, A_data), + oneapi::dpl::make_zip_iterator(A_ii, A_j, A_data) + nnz, + oneapi::dpl::make_zip_iterator(A_data, elmt_tols), + oneapi::dpl::make_zip_iterator(new_ii, new_j, new_data), + cabsfirst_greaterthan_second_pred() ); + hypre_assert( std::get<0>(new_end.base()) == new_ii + new_nnz ); + } +#else if (elmt_tols == NULL) { - new_end = HYPRE_THRUST_CALL( copy_if, - thrust::make_zip_iterator(thrust::make_tuple(A_ii, A_j, A_data)), - thrust::make_zip_iterator(thrust::make_tuple(A_ii, A_j, A_data)) + nnz, - A_data, - thrust::make_zip_iterator(thrust::make_tuple(new_ii, new_j, new_data)), - thrust::not1(less_than(tol)) ); + auto new_end = HYPRE_THRUST_CALL( copy_if, + thrust::make_zip_iterator(thrust::make_tuple(A_ii, A_j, A_data)), + thrust::make_zip_iterator(thrust::make_tuple(A_ii, A_j, A_data)) + nnz, + A_data, + thrust::make_zip_iterator(thrust::make_tuple(new_ii, new_j, new_data)), + HYPRE_THRUST_NOT(less_than(tol)) ); + + hypre_assert( thrust::get<0>(new_end.get_iterator_tuple()) == new_ii + new_nnz ); } else { - new_end = HYPRE_THRUST_CALL( copy_if, - thrust::make_zip_iterator(thrust::make_tuple(A_ii, A_j, A_data)), - thrust::make_zip_iterator(thrust::make_tuple(A_ii, A_j, A_data)) + nnz, - thrust::make_zip_iterator(thrust::make_tuple(A_data, elmt_tols)), - thrust::make_zip_iterator(thrust::make_tuple(new_ii, new_j, new_data)), - cabsfirst_greaterthan_second_pred() ); + auto new_end = HYPRE_THRUST_CALL( copy_if, + thrust::make_zip_iterator(thrust::make_tuple(A_ii, A_j, A_data)), + thrust::make_zip_iterator(thrust::make_tuple(A_ii, A_j, A_data)) + nnz, + thrust::make_zip_iterator(thrust::make_tuple(A_data, elmt_tols)), + thrust::make_zip_iterator(thrust::make_tuple(new_ii, new_j, new_data)), + cabsfirst_greaterthan_second_pred() ); + + hypre_assert( thrust::get<0>(new_end.get_iterator_tuple()) == new_ii + new_nnz ); } +#endif - hypre_assert( thrust::get<0>(new_end.get_iterator_tuple()) == new_ii + new_nnz ); hypre_TFree(A_ii, HYPRE_MEMORY_DEVICE); hypre_TFree(A_i, HYPRE_MEMORY_DEVICE); @@ -1355,116 +2242,241 @@ hypre_CSRMatrixDropSmallEntriesDevice( hypre_CSRMatrix *A, return hypre_error_flag; } -/* mark is of size nA - * diag_option: 1: special treatment for diag entries, mark as -2 - */ -__global__ void -hypreCUDAKernel_CSRMatrixIntersectPattern(HYPRE_Int n, - HYPRE_Int nA, - HYPRE_Int *rowid, - HYPRE_Int *colid, - HYPRE_Int *idx, - HYPRE_Int *mark, - HYPRE_Int diag_option) +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixIdentityDevice + * + * A = alp * I + *--------------------------------------------------------------------------*/ + +hypre_CSRMatrix * +hypre_CSRMatrixIdentityDevice(HYPRE_Int n, HYPRE_Complex alp) { - HYPRE_Int i = hypre_cuda_get_grid_thread_id<1,1>(); + hypre_CSRMatrix *A = hypre_CSRMatrixCreate(n, n, n); - if (i >= n) - { - return; - } + hypre_CSRMatrixInitialize_v2(A, 0, HYPRE_MEMORY_DEVICE); - HYPRE_Int r1 = read_only_load(&rowid[i]); - HYPRE_Int c1 = read_only_load(&colid[i]); - HYPRE_Int j = read_only_load(&idx[i]); +#if defined(HYPRE_USING_SYCL) + hypreSycl_sequence( hypre_CSRMatrixI(A), + hypre_CSRMatrixI(A) + n + 1, + 0 ); - if (0 == diag_option) + hypreSycl_sequence( hypre_CSRMatrixJ(A), + hypre_CSRMatrixJ(A) + n, + 0 ); + + HYPRE_ONEDPL_CALL( std::fill, + hypre_CSRMatrixData(A), + hypre_CSRMatrixData(A) + n, + alp ); +#else + HYPRE_THRUST_CALL( sequence, + hypre_CSRMatrixI(A), + hypre_CSRMatrixI(A) + n + 1, + 0 ); + + HYPRE_THRUST_CALL( sequence, + hypre_CSRMatrixJ(A), + hypre_CSRMatrixJ(A) + n, + 0 ); + + HYPRE_THRUST_CALL( fill, + hypre_CSRMatrixData(A), + hypre_CSRMatrixData(A) + n, + alp ); +#endif + + return A; +} + +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixDiagMatrixFromVectorDevice + * + * A = diag(v) + *--------------------------------------------------------------------------*/ + +hypre_CSRMatrix * +hypre_CSRMatrixDiagMatrixFromVectorDevice(HYPRE_Int n, HYPRE_Complex *v) +{ + hypre_CSRMatrix *A = hypre_CSRMatrixCreate(n, n, n); + + hypre_CSRMatrixInitialize_v2(A, 0, HYPRE_MEMORY_DEVICE); + +#if defined(HYPRE_USING_SYCL) + hypreSycl_sequence( hypre_CSRMatrixI(A), + hypre_CSRMatrixI(A) + n + 1, + 0 ); + + hypreSycl_sequence( hypre_CSRMatrixJ(A), + hypre_CSRMatrixJ(A) + n, + 0 ); + + HYPRE_ONEDPL_CALL( std::copy, + v, + v + n, + hypre_CSRMatrixData(A) ); +#else + HYPRE_THRUST_CALL( sequence, + hypre_CSRMatrixI(A), + hypre_CSRMatrixI(A) + n + 1, + 0 ); + + HYPRE_THRUST_CALL( sequence, + hypre_CSRMatrixJ(A), + hypre_CSRMatrixJ(A) + n, + 0 ); + + HYPRE_THRUST_CALL( copy, + v, + v + n, + hypre_CSRMatrixData(A) ); +#endif + + return A; +} + +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixDiagMatrixFromMatrixDevice + * + * B = diagm(A) + *--------------------------------------------------------------------------*/ + +hypre_CSRMatrix * +hypre_CSRMatrixDiagMatrixFromMatrixDevice(hypre_CSRMatrix *A, HYPRE_Int type) +{ + HYPRE_Int nrows = hypre_CSRMatrixNumRows(A); + HYPRE_Complex *diag = hypre_CTAlloc(HYPRE_Complex, nrows, HYPRE_MEMORY_DEVICE); + hypre_CSRMatrixExtractDiagonalDevice(A, diag, type); + + hypre_CSRMatrix *diag_mat = hypre_CSRMatrixDiagMatrixFromVectorDevice(nrows, diag); + + hypre_TFree(diag, HYPRE_MEMORY_DEVICE); + return diag_mat; +} + +/*-------------------------------------------------------------------------- + * adj_functor (Used in hypre_CSRMatrixPermuteDevice) + *--------------------------------------------------------------------------*/ + +#if (defined(THRUST_VERSION) && THRUST_VERSION < 101000) +struct adj_functor : public thrust::unary_function +#else +struct adj_functor +#endif +{ + HYPRE_Int *ia_; + + adj_functor(HYPRE_Int *ia) { - if (j < nA) - { - HYPRE_Int r2 = i < n - 1 ? read_only_load(&rowid[i + 1]) : -1; - HYPRE_Int c2 = i < n - 1 ? read_only_load(&colid[i + 1]) : -1; - if (r1 == r2 && c1 == c2) - { - mark[j] = c1; - } - else - { - mark[j] = -1; - } - } + ia_ = ia; } - else if (1 == diag_option) + + __host__ __device__ HYPRE_Int operator()(HYPRE_Int i) const { - if (j < nA) - { - if (r1 == c1) - { - mark[j] = -2; - } - else - { - HYPRE_Int r2 = i < n - 1 ? read_only_load(&rowid[i + 1]) : -1; - HYPRE_Int c2 = i < n - 1 ? read_only_load(&colid[i + 1]) : -1; - if (r1 == r2 && c1 == c2) - { - mark[j] = c1; - } - else - { - mark[j] = -1; - } - } - } + return ia_[i + 1] - ia_[i]; } -} - -/* markA: array of size nnz(A), for pattern of (A and B), markA is the column indices as in A_J - * Otherwise, mark pattern not in A-B as -1 in markA - * Note the special treatment for diagonal entries of A (marked as -2) */ -HYPRE_Int -hypre_CSRMatrixIntersectPattern(hypre_CSRMatrix *A, - hypre_CSRMatrix *B, - HYPRE_Int *markA, - HYPRE_Int diag_opt) -{ - HYPRE_Int nrows = hypre_CSRMatrixNumRows(A); - HYPRE_Int nnzA = hypre_CSRMatrixNumNonzeros(A); - HYPRE_Int nnzB = hypre_CSRMatrixNumNonzeros(B); +}; - HYPRE_Int *Cii = hypre_TAlloc(HYPRE_Int, nnzA + nnzB, HYPRE_MEMORY_DEVICE); - HYPRE_Int *Cjj = hypre_TAlloc(HYPRE_Int, nnzA + nnzB, HYPRE_MEMORY_DEVICE); - HYPRE_Int *idx = hypre_TAlloc(HYPRE_Int, nnzA + nnzB, HYPRE_MEMORY_DEVICE); +/*-------------------------------------------------------------------------- + * bii_functor (Used in hypre_CSRMatrixPermuteDevice) + *--------------------------------------------------------------------------*/ - hypreDevice_CsrRowPtrsToIndices_v2(nrows, nnzA, hypre_CSRMatrixI(A), Cii); - hypreDevice_CsrRowPtrsToIndices_v2(nrows, nnzB, hypre_CSRMatrixI(B), Cii + nnzA); - hypre_TMemcpy(Cjj, hypre_CSRMatrixJ(A), HYPRE_Int, nnzA, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); - hypre_TMemcpy(Cjj + nnzA, hypre_CSRMatrixJ(B), HYPRE_Int, nnzB, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); - HYPRE_THRUST_CALL( sequence, idx, idx + nnzA + nnzB ); +struct bii_functor +{ + HYPRE_Int *p_, *ia_, *ib_, *rb_; - HYPRE_THRUST_CALL( stable_sort_by_key, - thrust::make_zip_iterator(thrust::make_tuple(Cii, Cjj)), - thrust::make_zip_iterator(thrust::make_tuple(Cii, Cjj)) + nnzA + nnzB, - idx ); + bii_functor(HYPRE_Int *p, HYPRE_Int *ia, HYPRE_Int *ib, HYPRE_Int *rb) + { + p_ = p; + ia_ = ia; + ib_ = ib; + rb_ = rb; + } - hypre_TMemcpy(markA, hypre_CSRMatrixJ(A), HYPRE_Int, nnzA, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + __host__ __device__ void operator()(HYPRE_Int i) const + { + const HYPRE_Int r = rb_[i]; + rb_[i] = ia_[p_[r]] + i - ib_[r]; + } +}; - dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(nnzA + nnzB, "thread", bDim); +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixPermuteDevice + * + * See hypre_CSRMatrixPermute. + *--------------------------------------------------------------------------*/ - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_CSRMatrixIntersectPattern, gDim, bDim, - nnzA + nnzB, nnzA, Cii, Cjj, idx, markA, diag_opt ); +HYPRE_Int +hypre_CSRMatrixPermuteDevice( hypre_CSRMatrix *A, + HYPRE_Int *perm, + HYPRE_Int *rqperm, + hypre_CSRMatrix *B ) +{ + /* Input matrix */ + HYPRE_Int num_rows = hypre_CSRMatrixNumRows(A); + HYPRE_Int num_nonzeros = hypre_CSRMatrixNumNonzeros(A); + HYPRE_Int *A_i = hypre_CSRMatrixI(A); + HYPRE_Int *A_j = hypre_CSRMatrixJ(A); + HYPRE_Complex *A_a = hypre_CSRMatrixData(A); + HYPRE_Int *B_i = hypre_CSRMatrixI(B); + HYPRE_Int *B_j = hypre_CSRMatrixJ(B); + HYPRE_Complex *B_a = hypre_CSRMatrixData(B); + + HYPRE_Int *B_ii; + + /* Build B_i */ +#if defined(HYPRE_USING_SYCL) + oneapi::dpl::counting_iterator count(0); + hypreSycl_gather(perm, + perm + num_rows, + oneapi::dpl::make_transform_iterator(count, adj_functor(A_i)), + B_i); +#else + HYPRE_THRUST_CALL(gather, + perm, + perm + num_rows, + thrust::make_transform_iterator(thrust::make_counting_iterator(0), adj_functor(A_i)), + B_i); +#endif + hypreDevice_IntegerExclusiveScan(num_rows + 1, B_i); + + /* Build B_ii (row indices array) */ + B_ii = hypre_TAlloc(HYPRE_Int, num_nonzeros, HYPRE_MEMORY_DEVICE); + hypreDevice_CsrRowPtrsToIndices_v2(num_rows, num_nonzeros, B_i, B_ii); +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL(std::for_each, + count, + count + num_nonzeros, + bii_functor(perm, A_i, B_i, B_ii)); + + /* Build B_j and B_a */ + hypreSycl_gather( B_ii, + B_ii + num_nonzeros, + oneapi::dpl::make_zip_iterator(oneapi::dpl::make_permutation_iterator(rqperm, A_j), A_a), + oneapi::dpl::make_zip_iterator(B_j, B_a)); +#else + HYPRE_THRUST_CALL(for_each, + thrust::make_counting_iterator(0), + thrust::make_counting_iterator(num_nonzeros), + bii_functor(perm, A_i, B_i, B_ii)); + + /* Build B_j and B_a */ + HYPRE_THRUST_CALL(gather, + B_ii, + B_ii + num_nonzeros, + thrust::make_zip_iterator(thrust::make_tuple( + thrust::make_permutation_iterator(rqperm, A_j), A_a)), + thrust::make_zip_iterator(thrust::make_tuple(B_j, B_a))); +#endif - hypre_TFree(Cii, HYPRE_MEMORY_DEVICE); - hypre_TFree(Cjj, HYPRE_MEMORY_DEVICE); - hypre_TFree(idx, HYPRE_MEMORY_DEVICE); + /* Free memory */ + hypre_TFree(B_ii, HYPRE_MEMORY_DEVICE); return hypre_error_flag; } -#endif /* HYPRE_USING_CUDA || defined(HYPRE_USING_HIP) */ - -#if defined(HYPRE_USING_GPU) +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixTransposeDevice + *--------------------------------------------------------------------------*/ HYPRE_Int hypre_CSRMatrixTransposeDevice(hypre_CSRMatrix *A, @@ -1482,6 +2494,8 @@ hypre_CSRMatrixTransposeDevice(hypre_CSRMatrix *A, HYPRE_Int *C_j; hypre_CSRMatrix *C; + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("CSRMatrixTranspose"); /* trivial case */ if (nnz_A == 0) @@ -1492,13 +2506,24 @@ hypre_CSRMatrixTransposeDevice(hypre_CSRMatrix *A, } else { + if ( !hypre_HandleSpTransUseVendor(hypre_handle()) ) + { +#if defined(HYPRE_USING_GPU) + hypreDevice_CSRSpTrans(nrows_A, ncols_A, nnz_A, A_i, A_j, A_data, &C_i, &C_j, &C_data, data); +#endif + } + else + { #if defined(HYPRE_USING_CUSPARSE) - hypreDevice_CSRSpTransCusparse(nrows_A, ncols_A, nnz_A, A_i, A_j, A_data, &C_i, &C_j, &C_data, data); + hypreDevice_CSRSpTransCusparse(nrows_A, ncols_A, nnz_A, A_i, A_j, A_data, &C_i, &C_j, &C_data, + data); #elif defined(HYPRE_USING_ROCSPARSE) - hypreDevice_CSRSpTransRocsparse(nrows_A, ncols_A, nnz_A, A_i, A_j, A_data, &C_i, &C_j, &C_data, data); -#else - hypreDevice_CSRSpTrans(nrows_A, ncols_A, nnz_A, A_i, A_j, A_data, &C_i, &C_j, &C_data, data); + hypreDevice_CSRSpTransRocsparse(nrows_A, ncols_A, nnz_A, A_i, A_j, A_data, &C_i, &C_j, &C_data, + data); +#elif defined(HYPRE_USING_GPU) + hypreDevice_CSRSpTrans(nrows_A, ncols_A, nnz_A, A_i, A_j, A_data, &C_i, &C_j, &C_data, data); #endif + } } C = hypre_CSRMatrixCreate(ncols_A, nrows_A, nnz_A); @@ -1509,500 +2534,1026 @@ hypre_CSRMatrixTransposeDevice(hypre_CSRMatrix *A, *AT_ptr = C; - hypre_SyncCudaComputeStream(hypre_handle()); + hypre_SyncComputeStream(); + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; return hypre_error_flag; } -#endif /* #if defined(HYPRE_USING_GPU) */ +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixSortRow + *--------------------------------------------------------------------------*/ HYPRE_Int hypre_CSRMatrixSortRow(hypre_CSRMatrix *A) { + hypre_GpuProfilingPushRange("CSRMatrixSort"); + #if defined(HYPRE_USING_CUSPARSE) - hypre_SortCSRCusparse(hypre_CSRMatrixNumRows(A), hypre_CSRMatrixNumCols(A), hypre_CSRMatrixNumNonzeros(A), hypre_CSRMatrixGPUMatDescr(A), + hypre_SortCSRCusparse(hypre_CSRMatrixNumRows(A), hypre_CSRMatrixNumCols(A), + hypre_CSRMatrixNumNonzeros(A), hypre_CSRMatrixGPUMatDescr(A), hypre_CSRMatrixI(A), hypre_CSRMatrixJ(A), hypre_CSRMatrixData(A)); + #elif defined(HYPRE_USING_ROCSPARSE) - hypre_SortCSRRocsparse(hypre_CSRMatrixNumRows(A), hypre_CSRMatrixNumCols(A), hypre_CSRMatrixNumNonzeros(A), hypre_CSRMatrixGPUMatDescr(A), + hypre_SortCSRRocsparse(hypre_CSRMatrixNumRows(A), hypre_CSRMatrixNumCols(A), + hypre_CSRMatrixNumNonzeros(A), hypre_CSRMatrixGPUMatDescr(A), hypre_CSRMatrixI(A), hypre_CSRMatrixJ(A), hypre_CSRMatrixData(A)); +#elif defined(HYPRE_USING_ONEMKLSPARSE) + HYPRE_ONEMKL_CALL( oneapi::mkl::sparse::sort_matrix(*hypre_HandleComputeStream(hypre_handle()), + hypre_CSRMatrixGPUMatHandle(A), {}).wait() ); #else - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"hypre_CSRMatrixSortRow only implemented for cuSPARSE/rocSPARSE!\n"); + HYPRE_UNUSED_VAR(A); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "hypre_CSRMatrixSortRow only implemented for cuSPARSE/rocSPARSE/oneMKLSparse!\n"); #endif + hypre_GpuProfilingPopRange(); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixSortRowOutOfPlace + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixSortRowOutOfPlace(hypre_CSRMatrix *A) +{ + HYPRE_Int *A_j = hypre_CSRMatrixJ(A); + HYPRE_Complex *A_a = hypre_CSRMatrixData(A); + HYPRE_Int nnzA = hypre_CSRMatrixNumNonzeros(A); + + /* if both exist, we assume A has been sorted */ + if (hypre_CSRMatrixSortedJ(A) && hypre_CSRMatrixSortedData(A)) + { + return hypre_error_flag; + } + + hypre_TFree(hypre_CSRMatrixSortedJ(A), HYPRE_MEMORY_DEVICE); + hypre_TFree(hypre_CSRMatrixSortedData(A), HYPRE_MEMORY_DEVICE); + + hypre_CSRMatrixSortedJ(A) = hypre_TAlloc(HYPRE_Int, nnzA, HYPRE_MEMORY_DEVICE); + hypre_CSRMatrixSortedData(A) = hypre_TAlloc(HYPRE_Complex, nnzA, HYPRE_MEMORY_DEVICE); + + hypre_TMemcpy(hypre_CSRMatrixSortedJ(A), A_j, HYPRE_Int, nnzA, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(hypre_CSRMatrixSortedData(A), A_a, HYPRE_Complex, nnzA, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + + hypre_CSRMatrixJ(A) = hypre_CSRMatrixSortedJ(A); + hypre_CSRMatrixData(A) = hypre_CSRMatrixSortedData(A); + + hypre_CSRMatrixSortRow(A); + + hypre_CSRMatrixJ(A) = A_j; + hypre_CSRMatrixData(A) = A_a; + return hypre_error_flag; } #if defined(HYPRE_USING_CUSPARSE) -/* @brief This functions sorts values and column indices in each row in ascending order INPLACE - * @param[in] n Number of rows - * @param[in] m Number of columns - * @param[in] nnzA Number of nonzeroes - * @param[in] *d_ia (Unsorted) Row indices - * @param[in,out] *d_ja_sorted On Start: Unsorted column indices. On return: Sorted column indices - * @param[in,out] *d_a_sorted On Start: Unsorted values. On Return: Sorted values corresponding with column indices - */ -void -hypre_SortCSRCusparse( HYPRE_Int n, - HYPRE_Int m, - HYPRE_Int nnzA, - cusparseMatDescr_t descrA, + +/*-------------------------------------------------------------------------- + * hypre_SortCSRCusparse + * + * Sorts values and column indices in each row in ascending order INPLACE + * + * Parameters: + * n: Number of rows [in] + * m: Number of columns [in] + * nnzA: Number of nonzeros [in] + * d_ia: row pointers [in/out] + * d_ja_sorted: column indices [in/out] + * d_a_sorted: coefficients [in/out] + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SortCSRCusparse( HYPRE_Int n, + HYPRE_Int m, + HYPRE_Int nnzA, + cusparseMatDescr_t descrA, const HYPRE_Int *d_ia, - HYPRE_Int *d_ja_sorted, - HYPRE_Complex *d_a_sorted ) + HYPRE_Int *d_ja_sorted, + HYPRE_Complex *d_a_sorted ) { - cusparseHandle_t cusparsehandle = hypre_HandleCusparseHandle(hypre_handle()); + cusparseHandle_t cusparsehandle = hypre_HandleCusparseHandle(hypre_handle()); + size_t pBufferSizeInBytes = 0; + void *pBuffer = NULL; + csru2csrInfo_t sortInfoA; - size_t pBufferSizeInBytes = 0; - void *pBuffer = NULL; + hypre_GpuProfilingPushRange("SortCSRCusparse"); - csru2csrInfo_t sortInfoA; HYPRE_CUSPARSE_CALL( cusparseCreateCsru2csrInfo(&sortInfoA) ); + HYPRE_CUSPARSE_CALL( hypre_cusparse_csru2csr_bufferSizeExt(cusparsehandle, + n, m, nnzA, + d_a_sorted, d_ia, d_ja_sorted, + sortInfoA, &pBufferSizeInBytes) ); - HYPRE_Int isDoublePrecision = sizeof(HYPRE_Complex) == sizeof(hypre_double); - HYPRE_Int isSinglePrecision = sizeof(HYPRE_Complex) == sizeof(hypre_double) / 2; - - if (isDoublePrecision) - { - HYPRE_CUSPARSE_CALL( cusparseDcsru2csr_bufferSizeExt(cusparsehandle, - n, m, nnzA, d_a_sorted, d_ia, d_ja_sorted, - sortInfoA, &pBufferSizeInBytes) ); - - pBuffer = hypre_TAlloc(char, pBufferSizeInBytes, HYPRE_MEMORY_DEVICE); - - HYPRE_CUSPARSE_CALL( cusparseDcsru2csr(cusparsehandle, - n, m, nnzA, descrA, d_a_sorted, d_ia, d_ja_sorted, - sortInfoA, pBuffer) ); - } - else if (isSinglePrecision) - { - HYPRE_CUSPARSE_CALL( cusparseScsru2csr_bufferSizeExt(cusparsehandle, - n, m, nnzA, (float *) d_a_sorted, d_ia, d_ja_sorted, - sortInfoA, &pBufferSizeInBytes)); - - pBuffer = hypre_TAlloc(char, pBufferSizeInBytes, HYPRE_MEMORY_DEVICE); - - HYPRE_CUSPARSE_CALL( cusparseScsru2csr(cusparsehandle, - n, m, nnzA, descrA, (float *)d_a_sorted, d_ia, d_ja_sorted, - sortInfoA, pBuffer) ); - } + pBuffer = hypre_TAlloc(char, pBufferSizeInBytes, HYPRE_MEMORY_DEVICE); + HYPRE_CUSPARSE_CALL( hypre_cusparse_csru2csr(cusparsehandle, + n, m, nnzA, descrA, + d_a_sorted, d_ia, d_ja_sorted, + sortInfoA, pBuffer) ); hypre_TFree(pBuffer, HYPRE_MEMORY_DEVICE); HYPRE_CUSPARSE_CALL(cusparseDestroyCsru2csrInfo(sortInfoA)); + + hypre_GpuProfilingPopRange(); + + return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixTriLowerUpperSolveCusparse + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_CSRMatrixTriLowerUpperSolveCusparse(char uplo, + HYPRE_Int unit_diag, hypre_CSRMatrix *A, HYPRE_Real *l1_norms, - hypre_Vector *f, - hypre_Vector *u ) + HYPRE_Complex *f_data, + HYPRE_Complex *u_data ) { - HYPRE_Int nrow = hypre_CSRMatrixNumRows(A); - HYPRE_Int ncol = hypre_CSRMatrixNumCols(A); - HYPRE_Int nnzA = hypre_CSRMatrixNumNonzeros(A); - HYPRE_Int *A_i = hypre_CSRMatrixI(A); - HYPRE_Int *A_j = hypre_CSRMatrixJ(A); - HYPRE_Complex *A_a = hypre_CSRMatrixData(A); - HYPRE_Int *A_sj = hypre_CSRMatrixSortedJ(A); - HYPRE_Complex *A_sa = hypre_CSRMatrixSortedData(A); - HYPRE_Complex *f_data = hypre_VectorData(f); - HYPRE_Complex *u_data = hypre_VectorData(u); - HYPRE_Complex alpha = 1.0; - hypre_int buffer_size; - hypre_int structural_zero; - - if (nrow != ncol) - { - hypre_assert(0); - hypre_error_in_arg(1); - return hypre_error_flag; - } + HYPRE_Int num_rows = hypre_CSRMatrixNumRows(A); + HYPRE_Int num_nonzeros = hypre_CSRMatrixNumNonzeros(A); + HYPRE_Int *A_i = hypre_CSRMatrixI(A); + HYPRE_Int *A_j = hypre_CSRMatrixJ(A); + HYPRE_Complex *A_a = hypre_CSRMatrixData(A); + hypre_CsrsvData *csrsv_data = hypre_CSRMatrixCsrsvData(A); + HYPRE_Complex *A_ma; + + cusparseHandle_t handle = hypre_HandleCusparseHandle(hypre_handle()); + cusparseDiagType_t diag_type = unit_diag ? CUSPARSE_DIAG_TYPE_UNIT : + CUSPARSE_DIAG_TYPE_NON_UNIT; + cusparseFillMode_t fill_mode_L = CUSPARSE_FILL_MODE_LOWER; + cusparseFillMode_t fill_mode_U = CUSPARSE_FILL_MODE_UPPER; + cusparseOperation_t operation = CUSPARSE_OPERATION_NON_TRANSPOSE; + + HYPRE_Complex alpha = 1.0; + +#if CUSPARSE_VERSION >= CUSPARSE_SPSV_VERSION + HYPRE_Int num_cols = hypre_CSRMatrixNumCols(A); + cusparseSpMatDescr_t matA; + cusparseDnVecDescr_t vecF; + cusparseDnVecDescr_t vecU; + + cudaDataType data_type = hypre_HYPREComplexToCudaDataType(); + size_t buffer_size; + char* buffer_L; + char* buffer_U; +#else + cusparseSolvePolicy_t policy = CUSPARSE_SOLVE_POLICY_USE_LEVEL; + cusparseMatDescr_t descr; + cusparseStatus_t status; + HYPRE_Int *A_sj; + hypre_int buffer_size; + char* buffer; + hypre_int structural_zero; + char msg[256]; + + /* cuSPARSE's legacy API requires sorted rows. Sort and save in CSR's (sj, sa) */ + hypre_CSRMatrixSortRowOutOfPlace(A); +#endif - if (nrow <= 0) + /* setup csrsvdata in CSR: modify the diagonal (once) */ + if (!csrsv_data) { - return hypre_error_flag; - } + hypre_CSRMatrixCsrsvData(A) = hypre_CsrsvDataCreate(); + csrsv_data = hypre_CSRMatrixCsrsvData(A); - if (nnzA <= 0) - { - hypre_assert(0); - hypre_error_in_arg(1); - return hypre_error_flag; - } + hypre_CsrsvDataMatData(csrsv_data) = hypre_TAlloc(HYPRE_Complex, num_nonzeros, + HYPRE_MEMORY_DEVICE); + hypre_CSRMatrixData(A) = hypre_CsrsvDataMatData(csrsv_data); - cusparseHandle_t handle = hypre_HandleCusparseHandle(hypre_handle()); - cusparseMatDescr_t descr = hypre_CSRMatrixGPUMatDescr(A); +#if CUSPARSE_VERSION >= CUSPARSE_SPSV_VERSION + hypre_TMemcpy(hypre_CsrsvDataMatData(csrsv_data), A_a, HYPRE_Complex, num_nonzeros, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); +#else + hypre_TMemcpy(hypre_CsrsvDataMatData(csrsv_data), hypre_CSRMatrixSortedData(A), + HYPRE_Complex, num_nonzeros, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + hypre_CSRMatrixJ(A) = hypre_CSRMatrixSortedJ(A); +#endif - if ( !A_sj && !A_sa ) - { - hypre_CSRMatrixSortedJ(A) = A_sj = hypre_TAlloc(HYPRE_Int, nnzA, HYPRE_MEMORY_DEVICE); - hypre_CSRMatrixSortedData(A) = A_sa = hypre_TAlloc(HYPRE_Complex, nnzA, HYPRE_MEMORY_DEVICE); - hypre_TMemcpy(A_sj, A_j, HYPRE_Int, nnzA, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); - hypre_TMemcpy(A_sa, A_a, HYPRE_Complex, nnzA, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + /* if (l1_norms), replace A's diag with l1_norm, and + * replace zero diag with inf. so as to skip relaxation for this unknown */ + hypre_CSRMatrixReplaceDiagDevice(A, l1_norms, INFINITY, 0.0); -#if defined(HYPRE_USING_CUDA) - hypre_CSRMatrixData(A) = A_sa; - HYPRE_Int err = 0; - if (l1_norms) - { - err = hypre_CSRMatrixReplaceDiagDevice(A, l1_norms, INFINITY, 0.0); - } - else - { - err = hypre_CSRMatrixFixZeroDiagDevice(A, INFINITY, 0.0); - } hypre_CSRMatrixData(A) = A_a; - if (err) - { - hypre_error_w_msg(1, "structural zero in hypre_CSRMatrixTriLowerUpperSolveCusparse"); - //hypre_assert(0); - } +#if CUSPARSE_VERSION < CUSPARSE_SPSV_VERSION + hypre_CSRMatrixJ(A) = A_j; #endif - - hypre_SortCSRCusparse(nrow, ncol, nnzA, descr, A_i, A_sj, A_sa); } - HYPRE_CUSPARSE_CALL( cusparseSetMatDiagType(descr, CUSPARSE_DIAG_TYPE_NON_UNIT) ); + /* Analysis and Solve */ + A_ma = hypre_CsrsvDataMatData(csrsv_data); - if (!hypre_CSRMatrixCsrsvData(A)) - { - hypre_CSRMatrixCsrsvData(A) = hypre_CsrsvDataCreate(); - } - hypre_CsrsvData *csrsv_data = hypre_CSRMatrixCsrsvData(A); +#if CUSPARSE_VERSION >= CUSPARSE_SPSV_VERSION + matA = hypre_CSRMatrixToCusparseSpMat_core(num_rows, num_cols, 0, + num_nonzeros, A_i, A_j, A_ma); + vecF = hypre_VectorToCusparseDnVec_core(f_data, num_rows); + vecU = hypre_VectorToCusparseDnVec_core(u_data, num_cols); + + HYPRE_CUSPARSE_CALL( cusparseSpMatSetAttribute(matA, CUSPARSE_SPMAT_DIAG_TYPE, + &diag_type, sizeof(cusparseDiagType_t)) ); +#else + A_sj = hypre_CSRMatrixSortedJ(A); + descr = hypre_CSRMatrixGPUMatDescr(A); + HYPRE_CUSPARSE_CALL( cusparseSetMatDiagType(descr, diag_type) ); +#endif if (uplo == 'L') { - HYPRE_CUSPARSE_CALL( cusparseSetMatFillMode(descr, CUSPARSE_FILL_MODE_LOWER) ); +#if CUSPARSE_VERSION >= CUSPARSE_SPSV_VERSION + HYPRE_CUSPARSE_CALL( cusparseSpMatSetAttribute(matA, + CUSPARSE_SPMAT_FILL_MODE, + &fill_mode_L, + sizeof(cusparseFillMode_t)) ); +#else + HYPRE_CUSPARSE_CALL( cusparseSetMatFillMode(descr, fill_mode_L) ); +#endif - if (!hypre_CsrsvDataInfoL(csrsv_data)) + /* TODO (VPM): move the following block to hypre_CSRMatrixTriSetupCusparse */ + if (!hypre_CsrsvDataAnalyzedL(csrsv_data)) { - HYPRE_CUSPARSE_CALL( cusparseCreateCsrsv2Info(&hypre_CsrsvDataInfoL(csrsv_data)) ); - - HYPRE_CUSPARSE_CALL( cusparseDcsrsv2_bufferSize(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - nrow, nnzA, descr, A_sa, A_i, A_sj, hypre_CsrsvDataInfoL(csrsv_data), &buffer_size) ); +#if CUSPARSE_VERSION >= CUSPARSE_SPSV_VERSION + HYPRE_CUSPARSE_CALL( cusparseSpSV_bufferSize(handle, operation, + &alpha, matA, vecF, vecU, data_type, + CUSPARSE_SPSV_ALG_DEFAULT, + hypre_CsrsvDataInfoL(csrsv_data), + &buffer_size) ); +#else + HYPRE_CUSPARSE_CALL( hypre_cusparse_csrsv2_bufferSize(handle, + operation, + num_rows, num_nonzeros, descr, + A_ma, A_i, A_sj, + hypre_CsrsvDataInfoL(csrsv_data), + &buffer_size) ); +#endif +#if CUSPARSE_VERSION >= CUSPARSE_SPSV_VERSION + if (hypre_CsrsvDataBufferSizeL(csrsv_data) < buffer_size) + { + buffer_L = hypre_TReAlloc_v2(hypre_CsrsvDataBufferL(csrsv_data), + char, + hypre_CsrsvDataBufferSizeL(csrsv_data), + char, + buffer_size, + HYPRE_MEMORY_DEVICE); + + hypre_CsrsvDataBufferL(csrsv_data) = buffer_L; + hypre_CsrsvDataBufferSizeL(csrsv_data) = buffer_size; + } +#else if (hypre_CsrsvDataBufferSize(csrsv_data) < buffer_size) { - hypre_CsrsvDataBuffer(csrsv_data) = hypre_TReAlloc_v2(hypre_CsrsvDataBuffer(csrsv_data), - char, hypre_CsrsvDataBufferSize(csrsv_data), - char, buffer_size, - HYPRE_MEMORY_DEVICE); + buffer = hypre_TReAlloc_v2(hypre_CsrsvDataBuffer(csrsv_data), + char, + hypre_CsrsvDataBufferSize(csrsv_data), + char, + buffer_size, + HYPRE_MEMORY_DEVICE); + + hypre_CsrsvDataBuffer(csrsv_data) = buffer; hypre_CsrsvDataBufferSize(csrsv_data) = buffer_size; } +#endif - HYPRE_CUSPARSE_CALL( cusparseDcsrsv2_analysis(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - nrow, nnzA, descr, A_sa, A_i, A_sj, - hypre_CsrsvDataInfoL(csrsv_data), CUSPARSE_SOLVE_POLICY_USE_LEVEL, - hypre_CsrsvDataBuffer(csrsv_data)) ); - - cusparseStatus_t status = cusparseXcsrsv2_zeroPivot(handle, hypre_CsrsvDataInfoL(csrsv_data), &structural_zero); +#if CUSPARSE_VERSION >= CUSPARSE_SPSV_VERSION + HYPRE_CUSPARSE_CALL( cusparseSpSV_analysis(handle, operation, + &alpha, matA, vecF, vecU, data_type, + CUSPARSE_SPSV_ALG_DEFAULT, + hypre_CsrsvDataInfoL(csrsv_data), + hypre_CsrsvDataBufferL(csrsv_data)) ); +#else + HYPRE_CUSPARSE_CALL( hypre_cusparse_csrsv2_analysis(handle, + operation, + num_rows, num_nonzeros, descr, + A_ma, A_i, A_sj, + hypre_CsrsvDataInfoL(csrsv_data), + policy, + hypre_CsrsvDataBuffer(csrsv_data)) ); + + status = cusparseXcsrsv2_zeroPivot(handle, + hypre_CsrsvDataInfoL(csrsv_data), + &structural_zero); if (CUSPARSE_STATUS_ZERO_PIVOT == status) { - char msg[256]; - hypre_sprintf(msg, "hypre_CSRMatrixTriLowerUpperSolveCusparse A(%d,%d) is missing\n", + hypre_sprintf(msg, "A(%d,%d) is missing\n", structural_zero, structural_zero); hypre_error_w_msg(1, msg); - //hypre_assert(0); } +#endif + hypre_CsrsvDataAnalyzedL(csrsv_data) = 1; } - HYPRE_CUSPARSE_CALL( cusparseDcsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - nrow, nnzA, &alpha, descr, A_sa, A_i, A_sj, - hypre_CsrsvDataInfoL(csrsv_data), f_data, u_data, - CUSPARSE_SOLVE_POLICY_USE_LEVEL, - hypre_CsrsvDataBuffer(csrsv_data)) ); +#if CUSPARSE_VERSION >= CUSPARSE_SPSV_VERSION + HYPRE_CUSPARSE_CALL( cusparseSpSV_solve(handle, operation, + &alpha, matA, vecF, vecU, data_type, + CUSPARSE_SPSV_ALG_DEFAULT, + hypre_CsrsvDataInfoL(csrsv_data)) ); +#else + HYPRE_CUSPARSE_CALL( hypre_cusparse_csrsv2_solve(handle, operation, + num_rows, num_nonzeros, &alpha, descr, + A_ma, A_i, A_sj, + hypre_CsrsvDataInfoL(csrsv_data), + f_data, u_data, policy, + hypre_CsrsvDataBuffer(csrsv_data)) ); +#endif } else { - HYPRE_CUSPARSE_CALL( cusparseSetMatFillMode(descr, CUSPARSE_FILL_MODE_UPPER) ); +#if CUSPARSE_VERSION >= CUSPARSE_SPSV_VERSION + HYPRE_CUSPARSE_CALL( cusparseSpMatSetAttribute(matA, + CUSPARSE_SPMAT_FILL_MODE, + &fill_mode_U, + sizeof(cusparseFillMode_t)) ); +#else + HYPRE_CUSPARSE_CALL( cusparseSetMatFillMode(descr, fill_mode_U) ); +#endif - if (!hypre_CsrsvDataInfoU(csrsv_data)) + /* TODO (VPM): move the following block to hypre_CSRMatrixTriSetupCusparse */ + if (!hypre_CsrsvDataAnalyzedU(csrsv_data)) { - HYPRE_CUSPARSE_CALL( cusparseCreateCsrsv2Info(&hypre_CsrsvDataInfoU(csrsv_data)) ); - - HYPRE_CUSPARSE_CALL( cusparseDcsrsv2_bufferSize(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - nrow, nnzA, descr, A_sa, A_i, A_sj, hypre_CsrsvDataInfoU(csrsv_data), &buffer_size) ); +#if CUSPARSE_VERSION >= CUSPARSE_SPSV_VERSION + HYPRE_CUSPARSE_CALL( cusparseSpSV_bufferSize(handle, operation, + &alpha, matA, vecF, vecU, data_type, + CUSPARSE_SPSV_ALG_DEFAULT, + hypre_CsrsvDataInfoU(csrsv_data), + &buffer_size) ); +#else + HYPRE_CUSPARSE_CALL( hypre_cusparse_csrsv2_bufferSize(handle, + operation, + num_rows, num_nonzeros, descr, + A_ma, A_i, A_sj, + hypre_CsrsvDataInfoU(csrsv_data), + &buffer_size) ); +#endif +#if CUSPARSE_VERSION >= CUSPARSE_SPSV_VERSION + if (hypre_CsrsvDataBufferSizeU(csrsv_data) < buffer_size) + { + buffer_U = hypre_TReAlloc_v2(hypre_CsrsvDataBufferU(csrsv_data), + char, + hypre_CsrsvDataBufferSizeU(csrsv_data), + char, + buffer_size, + HYPRE_MEMORY_DEVICE); + + hypre_CsrsvDataBufferU(csrsv_data) = buffer_U; + hypre_CsrsvDataBufferSizeU(csrsv_data) = buffer_size; + } +#else if (hypre_CsrsvDataBufferSize(csrsv_data) < buffer_size) { - hypre_CsrsvDataBuffer(csrsv_data) = hypre_TReAlloc_v2(hypre_CsrsvDataBuffer(csrsv_data), - char, hypre_CsrsvDataBufferSize(csrsv_data), - char, buffer_size, - HYPRE_MEMORY_DEVICE); + buffer = hypre_TReAlloc_v2(hypre_CsrsvDataBuffer(csrsv_data), + char, + hypre_CsrsvDataBufferSize(csrsv_data), + char, + buffer_size, + HYPRE_MEMORY_DEVICE); + + hypre_CsrsvDataBuffer(csrsv_data) = buffer; hypre_CsrsvDataBufferSize(csrsv_data) = buffer_size; } +#endif - HYPRE_CUSPARSE_CALL( cusparseDcsrsv2_analysis(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - nrow, nnzA, descr, A_sa, A_i, A_sj, - hypre_CsrsvDataInfoU(csrsv_data), CUSPARSE_SOLVE_POLICY_USE_LEVEL, - hypre_CsrsvDataBuffer(csrsv_data)) ); - - cusparseStatus_t status = cusparseXcsrsv2_zeroPivot(handle, hypre_CsrsvDataInfoU(csrsv_data), &structural_zero); +#if CUSPARSE_VERSION >= CUSPARSE_SPSV_VERSION + HYPRE_CUSPARSE_CALL( cusparseSpSV_analysis(handle, operation, + &alpha, matA, vecF, vecU, data_type, + CUSPARSE_SPSV_ALG_DEFAULT, + hypre_CsrsvDataInfoU(csrsv_data), + hypre_CsrsvDataBufferU(csrsv_data)) ); +#else + HYPRE_CUSPARSE_CALL( hypre_cusparse_csrsv2_analysis(handle, + operation, + num_rows, num_nonzeros, descr, + A_ma, A_i, A_sj, + hypre_CsrsvDataInfoU(csrsv_data), + policy, + hypre_CsrsvDataBuffer(csrsv_data)) ); + + status = cusparseXcsrsv2_zeroPivot(handle, + hypre_CsrsvDataInfoU(csrsv_data), + &structural_zero); if (CUSPARSE_STATUS_ZERO_PIVOT == status) { - char msg[256]; - hypre_sprintf(msg, "hypre_CSRMatrixTriLowerUpperSolveCusparse A(%d,%d) is missing\n", + hypre_sprintf(msg, "A(%d,%d) is missing\n", structural_zero, structural_zero); hypre_error_w_msg(1, msg); - //hypre_assert(0); } +#endif + hypre_CsrsvDataAnalyzedU(csrsv_data) = 1; } - HYPRE_CUSPARSE_CALL( cusparseDcsrsv2_solve(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, - nrow, nnzA, &alpha, descr, A_sa, A_i, A_sj, - hypre_CsrsvDataInfoU(csrsv_data), f_data, u_data, - CUSPARSE_SOLVE_POLICY_USE_LEVEL, - hypre_CsrsvDataBuffer(csrsv_data)) ); +#if CUSPARSE_VERSION >= CUSPARSE_SPSV_VERSION + HYPRE_CUSPARSE_CALL( cusparseSpSV_solve(handle, operation, + &alpha, matA, vecF, vecU, data_type, + CUSPARSE_SPSV_ALG_DEFAULT, + hypre_CsrsvDataInfoU(csrsv_data)) ); +#else + HYPRE_CUSPARSE_CALL( hypre_cusparse_csrsv2_solve(handle, + operation, + num_rows, num_nonzeros, &alpha, + descr, A_ma, A_i, A_sj, + hypre_CsrsvDataInfoU(csrsv_data), + f_data, u_data, policy, + hypre_CsrsvDataBuffer(csrsv_data)) ); +#endif } + /* Free memory */ +#if CUSPARSE_VERSION >= CUSPARSE_SPSV_VERSION + HYPRE_CUSPARSE_CALL( cusparseDestroySpMat(matA) ); + HYPRE_CUSPARSE_CALL( cusparseDestroyDnVec(vecF) ); + HYPRE_CUSPARSE_CALL( cusparseDestroyDnVec(vecU) ); +#endif + return hypre_error_flag; } -#endif /* #if defined(HYPRE_USING_CUSPARSE) */ +#elif defined(HYPRE_USING_ROCSPARSE) +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixTriLowerUpperSolveRocsparse + *--------------------------------------------------------------------------*/ -#if defined(HYPRE_USING_ROCSPARSE) HYPRE_Int hypre_CSRMatrixTriLowerUpperSolveRocsparse(char uplo, - hypre_CSRMatrix * A, - HYPRE_Real * l1_norms, - hypre_Vector * f, - hypre_Vector * u ) + HYPRE_Int unit_diag, + hypre_CSRMatrix *A, + HYPRE_Real *l1_norms, + HYPRE_Complex *f_data, + HYPRE_Complex *u_data ) { - HYPRE_Int nrow = hypre_CSRMatrixNumRows(A); - HYPRE_Int ncol = hypre_CSRMatrixNumCols(A); - HYPRE_Int nnzA = hypre_CSRMatrixNumNonzeros(A); - HYPRE_Int *A_i = hypre_CSRMatrixI(A); - HYPRE_Int *A_j = hypre_CSRMatrixJ(A); - HYPRE_Complex *A_a = hypre_CSRMatrixData(A); - HYPRE_Int *A_sj = hypre_CSRMatrixSortedJ(A); - HYPRE_Complex *A_sa = hypre_CSRMatrixSortedData(A); - HYPRE_Complex *f_data = hypre_VectorData(f); - HYPRE_Complex *u_data = hypre_VectorData(u); - HYPRE_Complex alpha = 1.0; - size_t buffer_size; - hypre_int structural_zero; - - if (nrow != ncol) - { - hypre_assert(0); - hypre_error_in_arg(1); - return hypre_error_flag; - } - - if (nrow <= 0) + HYPRE_Int num_rows = hypre_CSRMatrixNumRows(A); + HYPRE_Int num_nonzeros = hypre_CSRMatrixNumNonzeros(A); + HYPRE_Int *A_i = hypre_CSRMatrixI(A); + HYPRE_Int *A_j = hypre_CSRMatrixJ(A); + HYPRE_Complex *A_a = hypre_CSRMatrixData(A); + hypre_CsrsvData *csrsv_data = hypre_CSRMatrixCsrsvData(A); + + rocsparse_handle handle = hypre_HandleCusparseHandle(hypre_handle()); + rocsparse_mat_descr descr = hypre_CSRMatrixGPUMatDescr(A); + HYPRE_Int *A_sj; + HYPRE_Complex *A_ma; + + rocsparse_status status; + rocsparse_diag_type diag_type = unit_diag ? rocsparse_diag_type_unit : + rocsparse_diag_type_non_unit; + HYPRE_Complex alpha = 1.0; + hypre_int structural_zero; + size_t buffer_size; + char *buffer; + char msg[256]; + + /* rocSPARSE requires sorted rows. Sort and save in CSR's (sj, sa) */ + hypre_CSRMatrixSortRowOutOfPlace(A); + + /* Setup csrsvdata in CSR: modify the diagonal (once) */ + if (!csrsv_data) { - return hypre_error_flag; - } + hypre_CSRMatrixCsrsvData(A) = hypre_CsrsvDataCreate(); + csrsv_data = hypre_CSRMatrixCsrsvData(A); - if (nnzA <= 0) - { - hypre_assert(0); - hypre_error_in_arg(1); - return hypre_error_flag; - } + hypre_CsrsvDataMatData(csrsv_data) = hypre_TAlloc(HYPRE_Complex, + num_nonzeros, + HYPRE_MEMORY_DEVICE); - rocsparse_handle handle = hypre_HandleCusparseHandle(hypre_handle()); - rocsparse_mat_descr descr = hypre_CSRMatrixGPUMatDescr(A); + hypre_CSRMatrixData(A) = hypre_CsrsvDataMatData(csrsv_data); + hypre_TMemcpy(hypre_CsrsvDataMatData(csrsv_data), hypre_CSRMatrixSortedData(A), + HYPRE_Complex, num_nonzeros, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + hypre_CSRMatrixJ(A) = hypre_CSRMatrixSortedJ(A); - if ( !A_sj && !A_sa ) - { - hypre_CSRMatrixSortedJ(A) = A_sj = hypre_TAlloc(HYPRE_Int, nnzA, HYPRE_MEMORY_DEVICE); - hypre_CSRMatrixSortedData(A) = A_sa = hypre_TAlloc(HYPRE_Complex, nnzA, HYPRE_MEMORY_DEVICE); - hypre_TMemcpy(A_sj, A_j, HYPRE_Int, nnzA, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); - hypre_TMemcpy(A_sa, A_a, HYPRE_Complex, nnzA, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + /* if (l1_norms), replace A's diag with l1_norm, and + * replace zero diag with inf. so as to skip relaxation for this unknown */ + hypre_CSRMatrixReplaceDiagDevice(A, l1_norms, INFINITY, 0.0); -#if defined(HYPRE_USING_HIP) - hypre_CSRMatrixData(A) = A_sa; - HYPRE_Int err = 0; - if (l1_norms) - { - err = hypre_CSRMatrixReplaceDiagDevice(A, l1_norms, INFINITY, 0.0); - } - else - { - err = hypre_CSRMatrixFixZeroDiagDevice(A, INFINITY, 0.0); - } hypre_CSRMatrixData(A) = A_a; - if (err) - { - hypre_error_w_msg(1, "structural zero in hypre_CSRMatrixTriLowerUpperSolveRocsparse"); - //hypre_assert(0); - } -#endif - - hypre_SortCSRRocsparse(nrow, ncol, nnzA, descr, A_i, A_sj, A_sa); + hypre_CSRMatrixJ(A) = A_j; } - HYPRE_ROCSPARSE_CALL( rocsparse_set_mat_diag_type(descr, rocsparse_diag_type_non_unit) ); + /* Analysis and Solve */ + buffer = hypre_CsrsvDataBuffer(csrsv_data); + A_ma = hypre_CsrsvDataMatData(csrsv_data); + A_sj = hypre_CSRMatrixSortedJ(A); - if (!hypre_CSRMatrixCsrsvData(A)) - { - hypre_CSRMatrixCsrsvData(A) = hypre_CsrsvDataCreate(); - } - hypre_CsrsvData *csrsv_data = hypre_CSRMatrixCsrsvData(A); + /* Set matrix diagonal type */ + HYPRE_ROCSPARSE_CALL( rocsparse_set_mat_diag_type(descr, diag_type) ); if (uplo == 'L') { HYPRE_ROCSPARSE_CALL( rocsparse_set_mat_fill_mode(descr, rocsparse_fill_mode_lower) ); - if (!hypre_CsrsvDataInfoL(csrsv_data)) + /* TODO (VPM): move the following block to hypre_CSRMatrixTriSetupRocsparse */ + if (!hypre_CsrsvDataAnalyzedL(csrsv_data)) { - HYPRE_ROCSPARSE_CALL( rocsparse_create_mat_info(&hypre_CsrsvDataInfoL(csrsv_data)) ); - - HYPRE_ROCSPARSE_CALL( rocsparse_dcsrsv_buffer_size(handle, rocsparse_operation_none, - nrow, nnzA, descr, A_sa, A_i, A_sj, hypre_CsrsvDataInfoL(csrsv_data), &buffer_size) ); + HYPRE_ROCSPARSE_CALL( hypre_rocsparse_csrsv_buffer_size(handle, + rocsparse_operation_none, + num_rows, num_nonzeros, descr, + A_ma, A_i, A_sj, + hypre_CsrsvDataInfoL(csrsv_data), + &buffer_size) ); if (hypre_CsrsvDataBufferSize(csrsv_data) < buffer_size) { - hypre_CsrsvDataBuffer(csrsv_data) = hypre_TReAlloc_v2(hypre_CsrsvDataBuffer(csrsv_data), - char, hypre_CsrsvDataBufferSize(csrsv_data), - char, buffer_size, - HYPRE_MEMORY_DEVICE); + buffer = hypre_TReAlloc_v2(hypre_CsrsvDataBuffer(csrsv_data), + char, hypre_CsrsvDataBufferSize(csrsv_data), + char, buffer_size, + HYPRE_MEMORY_DEVICE); + + hypre_CsrsvDataBuffer(csrsv_data) = buffer; hypre_CsrsvDataBufferSize(csrsv_data) = buffer_size; } - HYPRE_ROCSPARSE_CALL( rocsparse_dcsrsv_analysis(handle, rocsparse_operation_none, - nrow, nnzA, descr, A_sa, A_i, A_sj, - hypre_CsrsvDataInfoL(csrsv_data), rocsparse_analysis_policy_reuse, - rocsparse_solve_policy_auto, hypre_CsrsvDataBuffer(csrsv_data)) ); - - rocsparse_status status = rocsparse_csrsv_zero_pivot(handle, descr, hypre_CsrsvDataInfoL(csrsv_data), &structural_zero); + HYPRE_ROCSPARSE_CALL( hypre_rocsparse_csrsv_analysis(handle, rocsparse_operation_none, + num_rows, num_nonzeros, descr, + A_ma, A_i, A_sj, + hypre_CsrsvDataInfoL(csrsv_data), + rocsparse_analysis_policy_reuse, + rocsparse_solve_policy_auto, + buffer) ); + + status = rocsparse_csrsv_zero_pivot(handle, descr, + hypre_CsrsvDataInfoL(csrsv_data), + &structural_zero); if (rocsparse_status_zero_pivot == status) { - char msg[256]; - hypre_sprintf(msg, "hypre_CSRMatrixTriLowerUpperSolveRocsparse A(%d,%d) is missing\n", + hypre_sprintf(msg, + "hypre_CSRMatrixTriLowerUpperSolveRocsparse A(%d,%d) is missing\n", structural_zero, structural_zero); hypre_error_w_msg(1, msg); - //hypre_assert(0); } + hypre_CsrsvDataAnalyzedL(csrsv_data) = 1; } - HYPRE_ROCSPARSE_CALL( rocsparse_dcsrsv_solve(handle, rocsparse_operation_none, - nrow, nnzA, &alpha, descr, A_sa, A_i, A_sj, - hypre_CsrsvDataInfoL(csrsv_data), f_data, u_data, - rocsparse_solve_policy_auto, - hypre_CsrsvDataBuffer(csrsv_data)) ); + HYPRE_ROCSPARSE_CALL( hypre_rocsparse_csrsv_solve(handle, rocsparse_operation_none, + num_rows, num_nonzeros, &alpha, + descr, A_ma, A_i, A_sj, + hypre_CsrsvDataInfoL(csrsv_data), + f_data, u_data, + rocsparse_solve_policy_auto, + buffer) ); } else { HYPRE_ROCSPARSE_CALL( rocsparse_set_mat_fill_mode(descr, rocsparse_fill_mode_upper) ); - if (!hypre_CsrsvDataInfoU(csrsv_data)) + /* TODO (VPM): move the following block to hypre_CSRMatrixTriSetupRocsparse */ + if (!hypre_CsrsvDataAnalyzedU(csrsv_data)) { - HYPRE_ROCSPARSE_CALL( rocsparse_create_mat_info(&hypre_CsrsvDataInfoU(csrsv_data)) ); - - HYPRE_ROCSPARSE_CALL( rocsparse_dcsrsv_buffer_size(handle, rocsparse_operation_none, - nrow, nnzA, descr, A_sa, A_i, A_sj, hypre_CsrsvDataInfoU(csrsv_data), &buffer_size) ); + HYPRE_ROCSPARSE_CALL( hypre_rocsparse_csrsv_buffer_size(handle, + rocsparse_operation_none, + num_rows, num_nonzeros, descr, + A_ma, A_i, A_sj, + hypre_CsrsvDataInfoU(csrsv_data), + &buffer_size) ); if (hypre_CsrsvDataBufferSize(csrsv_data) < buffer_size) { - hypre_CsrsvDataBuffer(csrsv_data) = hypre_TReAlloc_v2(hypre_CsrsvDataBuffer(csrsv_data), - char, hypre_CsrsvDataBufferSize(csrsv_data), - char, buffer_size, - HYPRE_MEMORY_DEVICE); + buffer = hypre_TReAlloc_v2(hypre_CsrsvDataBuffer(csrsv_data), + char, hypre_CsrsvDataBufferSize(csrsv_data), + char, buffer_size, + HYPRE_MEMORY_DEVICE); + + hypre_CsrsvDataBuffer(csrsv_data) = buffer; hypre_CsrsvDataBufferSize(csrsv_data) = buffer_size; } - HYPRE_ROCSPARSE_CALL( rocsparse_dcsrsv_analysis(handle, rocsparse_operation_none, - nrow, nnzA, descr, A_sa, A_i, A_sj, - hypre_CsrsvDataInfoU(csrsv_data), rocsparse_analysis_policy_reuse, - rocsparse_solve_policy_auto, hypre_CsrsvDataBuffer(csrsv_data)) ); - - rocsparse_status status = rocsparse_csrsv_zero_pivot(handle, descr, hypre_CsrsvDataInfoU(csrsv_data), &structural_zero); + HYPRE_ROCSPARSE_CALL( hypre_rocsparse_csrsv_analysis(handle, rocsparse_operation_none, + num_rows, num_nonzeros, descr, + A_ma, A_i, A_sj, + hypre_CsrsvDataInfoU(csrsv_data), + rocsparse_analysis_policy_reuse, + rocsparse_solve_policy_auto, + buffer) ); + + status = rocsparse_csrsv_zero_pivot(handle, descr, + hypre_CsrsvDataInfoU(csrsv_data), + &structural_zero); if (rocsparse_status_zero_pivot == status) { - char msg[256]; - hypre_sprintf(msg, "hypre_CSRMatrixTriLowerUpperSolveRocsparse A(%d,%d) is missing\n", + hypre_sprintf(msg, + "hypre_CSRMatrixTriLowerUpperSolveRocsparse A(%d,%d) is missing\n", structural_zero, structural_zero); hypre_error_w_msg(1, msg); - //hypre_assert(0); } + hypre_CsrsvDataAnalyzedU(csrsv_data) = 1; } - HYPRE_ROCSPARSE_CALL( rocsparse_dcsrsv_solve(handle, rocsparse_operation_none, - nrow, nnzA, &alpha, descr, A_sa, A_i, A_sj, - hypre_CsrsvDataInfoU(csrsv_data), f_data, u_data, - rocsparse_solve_policy_auto, - hypre_CsrsvDataBuffer(csrsv_data)) ); + HYPRE_ROCSPARSE_CALL( hypre_rocsparse_csrsv_solve(handle, rocsparse_operation_none, + num_rows, num_nonzeros, &alpha, descr, + A_ma, A_i, A_sj, + hypre_CsrsvDataInfoU(csrsv_data), + f_data, u_data, + rocsparse_solve_policy_auto, + buffer) ); } return hypre_error_flag; } -/* @brief This functions sorts values and column indices in each row in ascending order OUT-OF-PLACE +/*-------------------------------------------------------------------------- + * hypre_SortCSRRocsparse + * + * @brief This functions sorts values and column indices in each row in + * ascending order OUT-OF-PLACE + * * @param[in] n Number of rows * @param[in] m Number of columns * @param[in] nnzA Number of nonzeroes * @param[in] *d_ia (Unsorted) Row indices - * @param[in,out] *d_ja_sorted On Start: Unsorted column indices. On return: Sorted column indices - * @param[in,out] *d_a_sorted On Start: Unsorted values. On Return: Sorted values corresponding with column indices - */ -void -hypre_SortCSRRocsparse( HYPRE_Int n, - HYPRE_Int m, - HYPRE_Int nnzA, - rocsparse_mat_descr descrA, + * @param[in,out] *d_ja_sorted On Start: Unsorted column indices. + * On return: Sorted column indices + * @param[in,out] *d_a_sorted On Start: Unsorted values. + * On Return: Sorted values corresponding with + * column indices + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SortCSRRocsparse( HYPRE_Int n, + HYPRE_Int m, + HYPRE_Int num_nonzeros, + rocsparse_mat_descr descrA, const HYPRE_Int *d_ia, - HYPRE_Int *d_ja_sorted, - HYPRE_Complex *d_a_sorted ) + HYPRE_Int *d_ja_sorted, + HYPRE_Complex *d_a_sorted ) { - rocsparse_handle handle = hypre_HandleCusparseHandle(hypre_handle()); - - size_t pBufferSizeInBytes = 0; - void *pBuffer = NULL; - HYPRE_Int *P = NULL; - - HYPRE_Int isDoublePrecision = sizeof(HYPRE_Complex) == sizeof(hypre_double); - HYPRE_Int isSinglePrecision = sizeof(HYPRE_Complex) == sizeof(hypre_double) / 2; + rocsparse_handle handle = hypre_HandleCusparseHandle(hypre_handle()); + size_t pBufferSizeInBytes = 0; + void *pBuffer = NULL; + HYPRE_Int *P = NULL; + HYPRE_Complex *d_a_tmp; // FIXME: There is not in-place version of csr sort in rocSPARSE currently, so we make // a temporary copy of the data for gthr, sort that, and then copy the sorted values // back to the array being returned. Where there is an in-place version available, // we should use it. - HYPRE_Complex *d_a_tmp; - d_a_tmp = hypre_TAlloc(HYPRE_Complex, nnzA, HYPRE_MEMORY_DEVICE); + d_a_tmp = hypre_TAlloc(HYPRE_Complex, num_nonzeros, HYPRE_MEMORY_DEVICE); - HYPRE_ROCSPARSE_CALL( rocsparse_csrsort_buffer_size(handle, n, m, nnzA, d_ia, d_ja_sorted, &pBufferSizeInBytes) ); + HYPRE_ROCSPARSE_CALL( rocsparse_csrsort_buffer_size(handle, n, m, num_nonzeros, + d_ia, d_ja_sorted, + &pBufferSizeInBytes) ); pBuffer = hypre_TAlloc(char, pBufferSizeInBytes, HYPRE_MEMORY_DEVICE); - P = hypre_TAlloc(HYPRE_Int, nnzA, HYPRE_MEMORY_DEVICE); + P = hypre_TAlloc(HYPRE_Int, num_nonzeros, HYPRE_MEMORY_DEVICE); + + HYPRE_ROCSPARSE_CALL( rocsparse_create_identity_permutation(handle, num_nonzeros, P) ); + HYPRE_ROCSPARSE_CALL( rocsparse_csrsort(handle, n, m, num_nonzeros, descrA, d_ia, + d_ja_sorted, P, pBuffer) ); + HYPRE_ROCSPARSE_CALL( hypre_rocsparse_gthr(handle, num_nonzeros, d_a_sorted, d_a_tmp, P, + rocsparse_index_base_zero) ); + + hypre_TFree(pBuffer, HYPRE_MEMORY_DEVICE); + hypre_TFree(P, HYPRE_MEMORY_DEVICE); + + hypre_TMemcpy(d_a_sorted, d_a_tmp, HYPRE_Complex, num_nonzeros, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + + hypre_TFree(d_a_tmp, HYPRE_MEMORY_DEVICE); + + return hypre_error_flag; +} + +#elif defined(HYPRE_USING_ONEMKLSPARSE) + +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixTriLowerUpperSolveOnemklsparse + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixTriLowerUpperSolveOnemklsparse(char uplo, + HYPRE_Int unit_diag, + hypre_CSRMatrix *A, + HYPRE_Real *l1_norms, + HYPRE_Complex *f_data, + HYPRE_Complex *u_data ) +{ + HYPRE_Int *A_j = hypre_CSRMatrixJ(A); + HYPRE_Complex *A_a = hypre_CSRMatrixData(A); + oneapi::mkl::sparse::matrix_handle_t handle_A = hypre_CSRMatrixGPUMatHandle(A); + hypre_CsrsvData *csrsv_data = hypre_CSRMatrixCsrsvData(A); + + /* Generate sorted matrix */ + hypre_CSRMatrixSortRowOutOfPlace(A); + + /* Generate csrsv data if necessary */ + if (!csrsv_data) + { + hypre_CSRMatrixCsrsvData(A) = hypre_CsrsvDataCreate(); + csrsv_data = hypre_CSRMatrixCsrsvData(A); + + hypre_CsrsvDataMatData(csrsv_data) = hypre_TAlloc(HYPRE_Complex, + hypre_CSRMatrixNumNonzeros(A), + HYPRE_MEMORY_DEVICE); + + /* Copy the sorted data to csrsv mat data */ + hypre_TMemcpy(hypre_CsrsvDataMatData(csrsv_data), hypre_CSRMatrixSortedData(A), + HYPRE_Complex, hypre_CSRMatrixNumNonzeros(A), + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + + /* if (l1_norms), replace A's diag with l1_norm, and + * replace zero diag with inf. so as to skip relaxation for this unknown */ + hypre_CSRMatrixData(A) = hypre_CsrsvDataMatData(csrsv_data); + hypre_CSRMatrixJ(A) = hypre_CSRMatrixSortedJ(A); + hypre_CSRMatrixReplaceDiagDevice(A, l1_norms, INFINITY, 0.0); + } + + /* Use sorted column indices and sorted matrix data with modified diagonal */ + hypre_CSRMatrixJ(A) = hypre_CSRMatrixSortedJ(A); + hypre_CSRMatrixData(A) = hypre_CsrsvDataMatData(csrsv_data); + hypre_GPUMatDataSetCSRData(A); + + /* Do optimization the first time */ + if ( (!hypre_CsrsvDataAnalyzedL(csrsv_data) && uplo == 'L') || + (!hypre_CsrsvDataAnalyzedU(csrsv_data) && uplo == 'U') ) + { + HYPRE_ONEMKL_CALL( oneapi::mkl::sparse::optimize_trsv( *hypre_HandleComputeStream(hypre_handle()), + (uplo == 'L') ? oneapi::mkl::uplo::L : oneapi::mkl::uplo::U, + oneapi::mkl::transpose::N, + unit_diag ? oneapi::mkl::diag::U : oneapi::mkl::diag::N, + handle_A, + {} ).wait() ); + } + + /* Do the triangular solve */ + HYPRE_ONEMKL_CALL( oneapi::mkl::sparse::trsv( *hypre_HandleComputeStream(hypre_handle()), + (uplo == 'L') ? oneapi::mkl::uplo::L : oneapi::mkl::uplo::U, + oneapi::mkl::transpose::N, + unit_diag ? oneapi::mkl::diag::U : oneapi::mkl::diag::N, + 1.0, + handle_A, + f_data, + u_data, + {} ).wait() ); + + /* Restore the original matrix data */ + hypre_CSRMatrixJ(A) = A_j; + hypre_CSRMatrixData(A) = A_a; + hypre_GPUMatDataSetCSRData(A); + + return hypre_error_flag; +} +#endif // #if defined(HYPRE_USING_CUSPARSE) #elif defined(HYPRE_USING_ROCSPARSE) + +#if defined(HYPRE_USING_CUSPARSE) || defined(HYPRE_USING_ROCSPARSE) + +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixILU0 + * + * TODO (VPM): Change this function's name to hypre_ILU0SetupDevice? + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixILU0(hypre_CSRMatrix *A) +{ + /* Input matrix data */ + HYPRE_Int num_rows = hypre_CSRMatrixNumRows(A); + HYPRE_Int num_cols = hypre_CSRMatrixNumCols(A); + HYPRE_Int num_nonzeros = hypre_CSRMatrixNumNonzeros(A); + HYPRE_Int *A_i = hypre_CSRMatrixI(A); + HYPRE_Int *A_j = hypre_CSRMatrixJ(A); + HYPRE_Complex *A_data = hypre_CSRMatrixData(A); + + /* Vendor math sparse libraries data */ +#if defined(HYPRE_USING_CUSPARSE) + csrilu02Info_t matA_info = NULL; + cusparseHandle_t handle = hypre_HandleCusparseHandle(hypre_handle()); + cusparseMatDescr_t descr = hypre_CSRMatrixGPUMatDescr(A); + cusparseSolvePolicy_t analysis_policy = CUSPARSE_SOLVE_POLICY_USE_LEVEL; + cusparseSolvePolicy_t solve_policy = CUSPARSE_SOLVE_POLICY_USE_LEVEL; + cusparseStatus_t status; + HYPRE_Int buffer_size; + +#elif defined(HYPRE_USING_ROCSPARSE) + rocsparse_mat_info matA_info = NULL; + rocsparse_handle handle = hypre_HandleCusparseHandle(hypre_handle()); + rocsparse_mat_descr descr = hypre_CSRMatrixGPUMatDescr(A); + rocsparse_analysis_policy analysis_policy = rocsparse_analysis_policy_reuse; + rocsparse_solve_policy solve_policy = rocsparse_solve_policy_auto; + rocsparse_status status; + size_t buffer_size; +#endif + + void *buffer = NULL; + HYPRE_Int zero_pivot; + char errmsg[1024]; + + /* Sanity check */ + if (num_rows != num_cols) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Not a square matrix!"); + return hypre_error_flag; + } + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("CSRMatrixILU0"); + + /*------------------------------------------------------------------------------------- + * 1. Sort columns inside each row first, we can't assume that's sorted + *-------------------------------------------------------------------------------------*/ + + hypre_CSRMatrixSortRow(A); + + /*------------------------------------------------------------------------------------- + * 2. Create info for ilu setup and solve + *-------------------------------------------------------------------------------------*/ + +#if defined(HYPRE_USING_CUSPARSE) + HYPRE_CUSPARSE_CALL(cusparseCreateCsrilu02Info(&matA_info)); + +#elif defined(HYPRE_USING_ROCSPARSE) + HYPRE_ROCSPARSE_CALL(rocsparse_create_mat_info(&matA_info)); + +#endif + + /*------------------------------------------------------------------------------------- + * 3. Get work array size + *-------------------------------------------------------------------------------------*/ + +#if defined(HYPRE_USING_CUSPARSE) + HYPRE_CUSPARSE_CALL(hypre_cusparse_csrilu02_bufferSize(handle, num_rows, num_nonzeros, + descr, A_data, A_i, A_j, + matA_info, &buffer_size)); +#elif defined(HYPRE_USING_ROCSPARSE) + HYPRE_ROCSPARSE_CALL(hypre_rocsparse_csrilu0_buffer_size(handle, num_rows, num_nonzeros, + descr, A_data, A_i, A_j, + matA_info, &buffer_size)); +#endif - HYPRE_ROCSPARSE_CALL( rocsparse_create_identity_permutation(handle, nnzA, P) ); - HYPRE_ROCSPARSE_CALL( rocsparse_csrsort(handle, n, m, nnzA, descrA, d_ia, d_ja_sorted, P, pBuffer) ); + /*------------------------------------------------------------------------------------- + * 4. Create work array on the device + *-------------------------------------------------------------------------------------*/ - if (isDoublePrecision) + buffer = hypre_TAlloc(char, buffer_size, HYPRE_MEMORY_DEVICE); + + /*------------------------------------------------------------------------------------- + * 5.1 Perform the analysis + *-------------------------------------------------------------------------------------*/ + + hypre_GpuProfilingPushRange("Analysis"); +#if defined(HYPRE_USING_CUSPARSE) + HYPRE_CUSPARSE_CALL(hypre_cusparse_csrilu02_analysis(handle, num_rows, num_nonzeros, + descr, A_data, A_i, A_j, + matA_info, analysis_policy, buffer)); + +#elif defined(HYPRE_USING_ROCSPARSE) + HYPRE_ROCSPARSE_CALL(hypre_rocsparse_csrilu0_analysis(handle, num_rows, num_nonzeros, + descr, A_data, A_i, A_j, + matA_info, analysis_policy, + solve_policy, buffer)); +#endif + hypre_GpuProfilingPopRange(); + + /*------------------------------------------------------------------------------------- + * 5.2. Check for zero pivots + *-------------------------------------------------------------------------------------*/ + +#if defined(HYPRE_USING_CUSPARSE) + status = cusparseXcsrilu02_zeroPivot(handle, matA_info, &zero_pivot); + if (status == CUSPARSE_STATUS_ZERO_PIVOT) { - HYPRE_ROCSPARSE_CALL( rocsparse_dgthr(handle, nnzA, d_a_sorted, d_a_tmp, P, rocsparse_index_base_zero) ); + hypre_sprintf(errmsg, "hypre_ILU: found zero pivot at A(%d, %d) after analysis\n", + zero_pivot, zero_pivot); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, errmsg); + return hypre_error_flag; } - else if (isSinglePrecision) + else if (status != CUSPARSE_STATUS_SUCCESS) { - HYPRE_ROCSPARSE_CALL( rocsparse_sgthr(handle, nnzA, (float *) d_a_sorted, (float *) d_a_tmp, P, rocsparse_index_base_zero) ); + hypre_sprintf(errmsg, "cuSPARSE ERROR (code = %d, %s) at %s:%d\n", + status, cusparseGetErrorString(status), __FILE__, __LINE__); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, errmsg); + return hypre_error_flag; } - hypre_TFree(pBuffer, HYPRE_MEMORY_DEVICE); - hypre_TFree(P, HYPRE_MEMORY_DEVICE); +#elif defined(HYPRE_USING_ROCSPARSE) + status = rocsparse_csrsv_zero_pivot(handle, descr, matA_info, &zero_pivot); + if (status == rocsparse_status_zero_pivot) + { + hypre_sprintf(errmsg, "hypre_ILU: found zero pivot at A(%d, %d) after analysis\n", + zero_pivot, zero_pivot); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, errmsg); + return hypre_error_flag; + } + else if (status != rocsparse_status_success) + { + hypre_sprintf(errmsg, "rocSPARSE ERROR (code = %d) at %s:%d\n", + status, __FILE__, __LINE__); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, errmsg); + return hypre_error_flag; + } +#endif - hypre_TMemcpy(d_a_sorted, d_a_tmp, HYPRE_Complex, nnzA, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + /*------------------------------------------------------------------------------------- + * 6.1 Compute the numerical factorization + *-------------------------------------------------------------------------------------*/ - hypre_TFree(d_a_tmp, HYPRE_MEMORY_DEVICE); + hypre_GpuProfilingPushRange("Factorization"); +#if defined(HYPRE_USING_CUSPARSE) + HYPRE_CUSPARSE_CALL(hypre_cusparse_csrilu02(handle, num_rows, num_nonzeros, + descr, A_data, A_i, A_j, + matA_info, solve_policy, buffer)); +#elif defined(HYPRE_USING_ROCSPARSE) + HYPRE_ROCSPARSE_CALL(hypre_rocsparse_csrilu0(handle, num_rows, num_nonzeros, + descr, A_data, A_i, A_j, + matA_info, solve_policy, buffer)); +#endif + hypre_GpuProfilingPopRange(); + + /*------------------------------------------------------------------------------------- + * 6.2 Check for zero pivots + *-------------------------------------------------------------------------------------*/ + +#if defined(HYPRE_USING_CUSPARSE) + status = cusparseXcsrilu02_zeroPivot(handle, matA_info, &zero_pivot); + if (status == CUSPARSE_STATUS_ZERO_PIVOT) + { + hypre_sprintf(errmsg, "hypre_ILU: found zero pivot at A(%d, %d) after factorization\n", + zero_pivot, zero_pivot); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, errmsg); + return hypre_error_flag; + } + else if (status != CUSPARSE_STATUS_SUCCESS) + { + hypre_sprintf(errmsg, "cuSPARSE ERROR (code = %d, %s) at %s:%d\n", + status, cusparseGetErrorString(status), __FILE__, __LINE__); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, errmsg); + return hypre_error_flag; + } + +#elif defined(HYPRE_USING_ROCSPARSE) + status = rocsparse_csrsv_zero_pivot(handle, descr, matA_info, &zero_pivot); + if (status == rocsparse_status_zero_pivot) + { + hypre_sprintf(errmsg, "hypre_ILU: found zero pivot at A(%d, %d) after factorization\n", + zero_pivot, zero_pivot); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, errmsg); + return hypre_error_flag; + } + else if (status != rocsparse_status_success) + { + hypre_sprintf(errmsg, "rocSPARSE ERROR (code = %d) at %s:%d\n", + status, __FILE__, __LINE__); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, errmsg); + return hypre_error_flag; + } +#endif + + /*------------------------------------------------------------------------------------- + * 7. Free memory + *-------------------------------------------------------------------------------------*/ + +#if defined(HYPRE_USING_CUSPARSE) + HYPRE_CUSPARSE_CALL(cusparseDestroyCsrilu02Info(matA_info)); + +#elif defined(HYPRE_USING_ROCSPARSE) + HYPRE_ROCSPARSE_CALL(rocsparse_destroy_mat_info(matA_info)); +#endif + + /* Free buffer */ + hypre_TFree(buffer, HYPRE_MEMORY_DEVICE); + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; } -#endif // #if defined(HYPRE_USING_ROCSPARSE) -void hypre_CSRMatrixGpuSpMVAnalysis(hypre_CSRMatrix *matrix) +#endif /* #if defined(HYPRE_USING_CUSPARSE) || defined(HYPRE_USING_ROCSPARSE) */ + +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixSpMVAnalysisDevice + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixSpMVAnalysisDevice(hypre_CSRMatrix *matrix) { #if defined(HYPRE_USING_ROCSPARSE) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_CSRMatrixMemoryLocation(matrix) ); + rocsparse_handle handle = hypre_HandleCusparseHandle(hypre_handle()); + + if (exec == HYPRE_EXEC_DEVICE) + { + HYPRE_ROCSPARSE_CALL( hypre_rocsparse_csrmv_analysis(handle, + rocsparse_operation_none, + hypre_CSRMatrixNumRows(matrix), + hypre_CSRMatrixNumCols(matrix), + hypre_CSRMatrixNumNonzeros(matrix), + hypre_CSRMatrixGPUMatDescr(matrix), + hypre_CSRMatrixData(matrix), + hypre_CSRMatrixI(matrix), + hypre_CSRMatrixJ(matrix), + hypre_CSRMatrixGPUMatInfo(matrix)) ); + } +#else + HYPRE_UNUSED_VAR(matrix); +#endif /* #if defined(HYPRE_USING_ROCSPARSE) */ - HYPRE_ROCSPARSE_CALL( rocsparse_dcsrmv_analysis(hypre_HandleCusparseHandle(hypre_handle()), - rocsparse_operation_none, - hypre_CSRMatrixNumRows(matrix), - hypre_CSRMatrixNumCols(matrix), - hypre_CSRMatrixNumNonzeros(matrix), - hypre_CSRMatrixGPUMatDescr(matrix), - hypre_CSRMatrixData(matrix), - hypre_CSRMatrixI(matrix), - hypre_CSRMatrixJ(matrix), - hypre_CSRMatrixGPUMatInfo(matrix)) ); - -#endif // #if defined(HYPRE_USING_ROCSPARSE) + return hypre_error_flag; } + +#endif /* #if defined(HYPRE_USING_GPU) */ diff --git a/external/hypre/src/seq_mv/csr_matrix.c b/external/hypre/src/seq_mv/csr_matrix.c index f387de02..706657b4 100644 --- a/external/hypre/src/seq_mv/csr_matrix.c +++ b/external/hypre/src/seq_mv/csr_matrix.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -44,7 +44,7 @@ hypre_CSRMatrixCreate( HYPRE_Int num_rows, /* set defaults */ hypre_CSRMatrixOwnsData(matrix) = 1; -#if defined(HYPRE_USING_CUSPARSE) || defined(HYPRE_USING_ROCSPARSE) +#if defined(HYPRE_USING_CUSPARSE) || defined(HYPRE_USING_ROCSPARSE) || defined(HYPRE_USING_ONEMKLSPARSE) hypre_CSRMatrixSortedJ(matrix) = NULL; hypre_CSRMatrixSortedData(matrix) = NULL; hypre_CSRMatrixCsrsvData(matrix) = NULL; @@ -60,14 +60,12 @@ hypre_CSRMatrixCreate( HYPRE_Int num_rows, HYPRE_Int hypre_CSRMatrixDestroy( hypre_CSRMatrix *matrix ) { - HYPRE_Int ierr = 0; - if (matrix) { HYPRE_MemoryLocation memory_location = hypre_CSRMatrixMemoryLocation(matrix); hypre_TFree(hypre_CSRMatrixI(matrix), memory_location); - hypre_TFree(hypre_CSRMatrixRownnz(matrix), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_CSRMatrixRownnz(matrix), memory_location); if ( hypre_CSRMatrixOwnsData(matrix) ) { @@ -78,7 +76,7 @@ hypre_CSRMatrixDestroy( hypre_CSRMatrix *matrix ) hypre_TFree(hypre_CSRMatrixBigJ(matrix), memory_location); } -#if defined(HYPRE_USING_CUSPARSE) || defined(HYPRE_USING_ROCSPARSE) +#if defined(HYPRE_USING_CUSPARSE) || defined(HYPRE_USING_ROCSPARSE) || defined(HYPRE_USING_ONEMKLSPARSE) hypre_TFree(hypre_CSRMatrixSortedData(matrix), memory_location); hypre_TFree(hypre_CSRMatrixSortedJ(matrix), memory_location); hypre_CsrsvDataDestroy(hypre_CSRMatrixCsrsvData(matrix)); @@ -88,7 +86,7 @@ hypre_CSRMatrixDestroy( hypre_CSRMatrix *matrix ) hypre_TFree(matrix, HYPRE_MEMORY_HOST); } - return ierr; + return hypre_error_flag; } /*-------------------------------------------------------------------------- @@ -96,14 +94,14 @@ hypre_CSRMatrixDestroy( hypre_CSRMatrix *matrix ) *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_CSRMatrixInitialize_v2( hypre_CSRMatrix *matrix, HYPRE_Int bigInit, HYPRE_MemoryLocation memory_location ) +hypre_CSRMatrixInitialize_v2( hypre_CSRMatrix *matrix, + HYPRE_Int bigInit, + HYPRE_MemoryLocation memory_location ) { HYPRE_Int num_rows = hypre_CSRMatrixNumRows(matrix); HYPRE_Int num_nonzeros = hypre_CSRMatrixNumNonzeros(matrix); /* HYPRE_Int num_rownnz = hypre_CSRMatrixNumRownnz(matrix); */ - HYPRE_Int ierr = 0; - hypre_CSRMatrixMemoryLocation(matrix) = memory_location; /* Caveat: for pre-existing i, j, data, their memory location must be guaranteed to be consistent with `memory_location' @@ -147,17 +145,17 @@ hypre_CSRMatrixInitialize_v2( hypre_CSRMatrix *matrix, HYPRE_Int bigInit, HYPRE_ } } - return ierr; + return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixInitialize + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_CSRMatrixInitialize( hypre_CSRMatrix *matrix ) { - HYPRE_Int ierr; - - ierr = hypre_CSRMatrixInitialize_v2( matrix, 0, hypre_CSRMatrixMemoryLocation(matrix) ); - - return ierr; + return hypre_CSRMatrixInitialize_v2( matrix, 0, hypre_CSRMatrixMemoryLocation(matrix) ); } /*-------------------------------------------------------------------------- @@ -165,16 +163,20 @@ hypre_CSRMatrixInitialize( hypre_CSRMatrix *matrix ) *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_CSRMatrixResize( hypre_CSRMatrix *matrix, HYPRE_Int new_num_rows, HYPRE_Int new_num_cols, HYPRE_Int new_num_nonzeros ) +hypre_CSRMatrixResize( hypre_CSRMatrix *matrix, + HYPRE_Int new_num_rows, + HYPRE_Int new_num_cols, + HYPRE_Int new_num_nonzeros ) { - HYPRE_MemoryLocation memory_location = hypre_CSRMatrixMemoryLocation(matrix); - HYPRE_Int old_num_nonzeros = hypre_CSRMatrixNumNonzeros(matrix); - HYPRE_Int old_num_rows = hypre_CSRMatrixNumRows(matrix); + HYPRE_MemoryLocation memory_location = hypre_CSRMatrixMemoryLocation(matrix); + HYPRE_Int old_num_nonzeros = hypre_CSRMatrixNumNonzeros(matrix); + HYPRE_Int old_num_rows = hypre_CSRMatrixNumRows(matrix); if (!hypre_CSRMatrixOwnsData(matrix)) { - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Error: called hypre_CSRMatrixResize on a matrix that doesn't own the data\n"); - return 1; + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "Error: called hypre_CSRMatrixResize on a matrix that doesn't own the data\n"); + return hypre_error_flag; } hypre_CSRMatrixNumCols(matrix) = new_num_cols; @@ -189,16 +191,32 @@ hypre_CSRMatrixResize( hypre_CSRMatrix *matrix, HYPRE_Int new_num_rows, HYPRE_In } else { - hypre_CSRMatrixData(matrix) = hypre_TReAlloc_v2(hypre_CSRMatrixData(matrix), HYPRE_Complex, old_num_nonzeros, HYPRE_Complex, new_num_nonzeros, memory_location); + hypre_CSRMatrixData(matrix) = hypre_TReAlloc_v2(hypre_CSRMatrixData(matrix), + HYPRE_Complex, old_num_nonzeros, + HYPRE_Complex, new_num_nonzeros, + memory_location); } - if (!hypre_CSRMatrixJ(matrix)) + if (hypre_CSRMatrixBigJ(matrix)) { - hypre_CSRMatrixJ(matrix) = hypre_CTAlloc(HYPRE_Int, new_num_nonzeros, memory_location); + hypre_CSRMatrixBigJ(matrix) = hypre_TReAlloc_v2(hypre_CSRMatrixBigJ(matrix), + HYPRE_BigInt, old_num_nonzeros, + HYPRE_BigInt, new_num_nonzeros, + memory_location); } else { - hypre_CSRMatrixJ(matrix) = hypre_TReAlloc_v2(hypre_CSRMatrixJ(matrix), HYPRE_Int, old_num_nonzeros, HYPRE_Int, new_num_nonzeros, memory_location); + if (!hypre_CSRMatrixJ(matrix)) + { + hypre_CSRMatrixJ(matrix) = hypre_CTAlloc(HYPRE_Int, new_num_nonzeros, memory_location); + } + else + { + hypre_CSRMatrixJ(matrix) = hypre_TReAlloc_v2(hypre_CSRMatrixJ(matrix), + HYPRE_Int, old_num_nonzeros, + HYPRE_Int, new_num_nonzeros, + memory_location); + } } } @@ -212,7 +230,10 @@ hypre_CSRMatrixResize( hypre_CSRMatrix *matrix, HYPRE_Int new_num_rows, HYPRE_In } else { - hypre_CSRMatrixI(matrix) = hypre_TReAlloc_v2(hypre_CSRMatrixI(matrix), HYPRE_Int, old_num_rows + 1, HYPRE_Int, new_num_rows + 1, memory_location); + hypre_CSRMatrixI(matrix) = hypre_TReAlloc_v2(hypre_CSRMatrixI(matrix), + HYPRE_Int, old_num_rows + 1, + HYPRE_Int, new_num_rows + 1, + memory_location); } } @@ -226,11 +247,7 @@ hypre_CSRMatrixResize( hypre_CSRMatrix *matrix, HYPRE_Int new_num_rows, HYPRE_In HYPRE_Int hypre_CSRMatrixBigInitialize( hypre_CSRMatrix *matrix ) { - HYPRE_Int ierr; - - ierr = hypre_CSRMatrixInitialize_v2( matrix, 1, hypre_CSRMatrixMemoryLocation(matrix) ); - - return ierr; + return hypre_CSRMatrixInitialize_v2( matrix, 1, hypre_CSRMatrixMemoryLocation(matrix) ); } /*-------------------------------------------------------------------------- @@ -307,37 +324,41 @@ HYPRE_Int hypre_CSRMatrixSetDataOwner( hypre_CSRMatrix *matrix, HYPRE_Int owns_data ) { - HYPRE_Int ierr = 0; - hypre_CSRMatrixOwnsData(matrix) = owns_data; - return ierr; + return hypre_error_flag; } /*-------------------------------------------------------------------------- - * hypre_CSRMatrixSetRownnz - * - * function to set the substructure rownnz and num_rowsnnz inside the CSRMatrix - * it needs the A_i substructure of CSRMatrix to find the nonzero rows. - * It runs after the create CSR and when A_i is known..It does not check for - * the existence of A_i or of the CSR matrix. + * hypre_CSRMatrixSetPatternOnly + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixSetPatternOnly( hypre_CSRMatrix *matrix, + HYPRE_Int pattern_only ) +{ + hypre_CSRMatrixPatternOnly(matrix) = pattern_only; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixSetRownnzHost *--------------------------------------------------------------------------*/ HYPRE_Int hypre_CSRMatrixSetRownnzHost( hypre_CSRMatrix *matrix ) { - HYPRE_Int ierr = 0; - HYPRE_Int num_rows = hypre_CSRMatrixNumRows(matrix); - HYPRE_Int *A_i = hypre_CSRMatrixI(matrix); - HYPRE_Int *Arownnz; + HYPRE_MemoryLocation memory_location = hypre_CSRMatrixMemoryLocation(matrix); + HYPRE_Int num_rows = hypre_CSRMatrixNumRows(matrix); + HYPRE_Int *A_i = hypre_CSRMatrixI(matrix); + HYPRE_Int *Arownnz = hypre_CSRMatrixRownnz(matrix); - HYPRE_Int i, adiag; - HYPRE_Int irownnz = 0; + HYPRE_Int i, irownnz = 0; for (i = 0; i < num_rows; i++) { - adiag = A_i[i+1] - A_i[i]; - if (adiag > 0) + if ((A_i[i + 1] - A_i[i]) > 0) { irownnz++; } @@ -345,18 +366,21 @@ hypre_CSRMatrixSetRownnzHost( hypre_CSRMatrix *matrix ) hypre_CSRMatrixNumRownnz(matrix) = irownnz; + /* Free old rownnz pointer */ + hypre_TFree(Arownnz, memory_location); + + /* Set new rownnz pointer */ if (irownnz == 0 || irownnz == num_rows) { hypre_CSRMatrixRownnz(matrix) = NULL; } else { - Arownnz = hypre_CTAlloc(HYPRE_Int, irownnz, HYPRE_MEMORY_HOST); + Arownnz = hypre_CTAlloc(HYPRE_Int, irownnz, memory_location); irownnz = 0; for (i = 0; i < num_rows; i++) { - adiag = A_i[i+1] - A_i[i]; - if (adiag > 0) + if ((A_i[i + 1] - A_i[i]) > 0) { Arownnz[irownnz++] = i; } @@ -364,14 +388,21 @@ hypre_CSRMatrixSetRownnzHost( hypre_CSRMatrix *matrix ) hypre_CSRMatrixRownnz(matrix) = Arownnz; } - return ierr; + return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixSetRownnz + * + * function to set the substructure rownnz and num_rowsnnz inside the CSRMatrix + * it needs the A_i substructure of CSRMatrix to find the nonzero rows. + * It runs after the create CSR and when A_i is known..It does not check for + * the existence of A_i or of the CSR matrix. + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_CSRMatrixSetRownnz( hypre_CSRMatrix *matrix ) { - HYPRE_Int ierr = 0; - #if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_CSRMatrixMemoryLocation(matrix) ); @@ -382,13 +413,18 @@ hypre_CSRMatrixSetRownnz( hypre_CSRMatrix *matrix ) else #endif { - ierr = hypre_CSRMatrixSetRownnzHost(matrix); + hypre_CSRMatrixSetRownnzHost(matrix); } - return ierr; + return hypre_error_flag; } -/* check if numnonzeros was properly set to be ia[nrow] */ +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixCheckSetNumNonzeros + * + * check if numnonzeros was properly set to be ia[nrow] + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_CSRMatrixCheckSetNumNonzeros( hypre_CSRMatrix *matrix ) { @@ -405,7 +441,8 @@ hypre_CSRMatrixCheckSetNumNonzeros( hypre_CSRMatrix *matrix ) if (hypre_CSRMatrixNumNonzeros(matrix) != nnz) { ierr = 1; - hypre_printf("warning: CSR matrix nnz was not set properly (!= ia[nrow], %d %d)\n", hypre_CSRMatrixNumNonzeros(matrix), nnz ); + hypre_printf("warning: CSR matrix nnz was not set properly (!= ia[nrow], %d %d)\n", + hypre_CSRMatrixNumNonzeros(matrix), nnz ); hypre_assert(0); hypre_CSRMatrixNumNonzeros(matrix) = nnz; } @@ -443,7 +480,7 @@ hypre_CSRMatrixRead( char *file_name ) hypre_fscanf(fp, "%d", &num_rows); matrix_i = hypre_CTAlloc(HYPRE_Int, num_rows + 1, HYPRE_MEMORY_HOST); - for (j = 0; j < num_rows+1; j++) + for (j = 0; j < num_rows + 1; j++) { hypre_fscanf(fp, "%d", &matrix_i[j]); matrix_i[j] -= file_base; @@ -477,6 +514,7 @@ hypre_CSRMatrixRead( char *file_name ) hypre_CSRMatrixNumNonzeros(matrix) = num_nonzeros; hypre_CSRMatrixNumCols(matrix) = ++max_col; + hypre_CSRMatrixSetRownnz(matrix); return matrix; } @@ -494,6 +532,7 @@ hypre_CSRMatrixPrint( hypre_CSRMatrix *matrix, HYPRE_Complex *matrix_data; HYPRE_Int *matrix_i; HYPRE_Int *matrix_j; + HYPRE_BigInt *matrix_bigj; HYPRE_Int num_rows; HYPRE_Int file_base = 1; @@ -509,6 +548,7 @@ hypre_CSRMatrixPrint( hypre_CSRMatrix *matrix, matrix_data = hypre_CSRMatrixData(matrix); matrix_i = hypre_CSRMatrixI(matrix); matrix_j = hypre_CSRMatrixJ(matrix); + matrix_bigj = hypre_CSRMatrixBigJ(matrix); num_rows = hypre_CSRMatrixNumRows(matrix); fp = fopen(file_name, "w"); @@ -520,9 +560,20 @@ hypre_CSRMatrixPrint( hypre_CSRMatrix *matrix, hypre_fprintf(fp, "%d\n", matrix_i[j] + file_base); } - for (j = 0; j < matrix_i[num_rows]; j++) + if (matrix_j) { - hypre_fprintf(fp, "%d\n", matrix_j[j] + file_base); + for (j = 0; j < matrix_i[num_rows]; j++) + { + hypre_fprintf(fp, "%d\n", matrix_j[j] + file_base); + } + } + + if (matrix_bigj) + { + for (j = 0; j < matrix_i[num_rows]; j++) + { + hypre_fprintf(fp, "%d\n", matrix_bigj[j] + file_base); + } } if (matrix_data) @@ -547,69 +598,154 @@ hypre_CSRMatrixPrint( hypre_CSRMatrix *matrix, return ierr; } +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixPrintIJ + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_CSRMatrixPrintMM( hypre_CSRMatrix *matrix, - HYPRE_Int basei, - HYPRE_Int basej, - HYPRE_Int trans, - const char *file_name ) +hypre_CSRMatrixPrintIJ( hypre_CSRMatrix *matrix, + HYPRE_Int base_i, + HYPRE_Int base_j, + char *filename ) { - FILE *fp; + HYPRE_MemoryLocation memory_location = hypre_CSRMatrixMemoryLocation(matrix); + hypre_CSRMatrix *h_matrix; - HYPRE_Complex *matrix_data; - HYPRE_Int *matrix_i; - HYPRE_Int *matrix_j; - HYPRE_Int num_rows, num_cols; + HYPRE_Int patt_only; + HYPRE_Int num_rows; + HYPRE_Int num_cols; + HYPRE_Int *matrix_i; + HYPRE_Int *matrix_j; + HYPRE_BigInt *matrix_bj; + HYPRE_Complex *matrix_a; - /* HYPRE_Int file_base = 1; */ + HYPRE_Int i, j, ii, jj; + HYPRE_Int ilower, iupper, jlower, jupper; + FILE *file; - HYPRE_Int j,k; + if (!matrix) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } - HYPRE_Int ierr = 0; + /* Create temporary matrix on host memory if needed */ + h_matrix = (hypre_GetActualMemLocation(memory_location) == hypre_MEMORY_DEVICE) ? + hypre_CSRMatrixClone_v2(matrix, 1, HYPRE_MEMORY_HOST) : matrix; - /*---------------------------------------------------------- - * Print the matrix data - *----------------------------------------------------------*/ + /* Set matrix info */ + patt_only = hypre_CSRMatrixPatternOnly(h_matrix); + num_rows = hypre_CSRMatrixNumRows(h_matrix); + num_cols = hypre_CSRMatrixNumCols(h_matrix); + matrix_i = hypre_CSRMatrixI(h_matrix); + matrix_j = hypre_CSRMatrixJ(h_matrix); + matrix_bj = hypre_CSRMatrixBigJ(h_matrix); + matrix_a = hypre_CSRMatrixData(h_matrix); - matrix_data = hypre_CSRMatrixData(matrix); - matrix_i = hypre_CSRMatrixI(matrix); - matrix_j = hypre_CSRMatrixJ(matrix); - num_rows = hypre_CSRMatrixNumRows(matrix); - num_cols = hypre_CSRMatrixNumCols(matrix); + if ((file = fopen(filename, "w")) == NULL) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Error: can't open output file %s\n"); + return hypre_error_flag; + } - if (file_name) + /* Print matrix bounds */ + ilower = base_i; + iupper = num_rows + base_i - 1; + jlower = base_j; + jupper = num_cols + base_j - 1; + hypre_fprintf(file, "%b %b %b %b\n", ilower, iupper, jlower, jupper); + + for (i = 0; i < num_rows; i++) { - fp = fopen(file_name, "w"); + ii = i + base_i; + + /* print diag columns */ + for (j = matrix_i[i]; j < matrix_i[i + 1]; j++) + { + jj = (matrix_bj) ? (matrix_bj[j] + base_j) : (matrix_j[j] + base_j); + + if (!patt_only) + { +#ifdef HYPRE_COMPLEX + hypre_fprintf(file, "%b %b %.14e , %.14e\n", ii, jj, + hypre_creal(matrix_a[j]), hypre_cimag(matrix_a[j])); +#else + hypre_fprintf(file, "%b %b %.14e\n", ii, jj, matrix_a[j]); +#endif + } + else + { + hypre_fprintf(file, "%b %b\n", ii, jj); + } + } } - else + + fclose(file); + + /* Free temporary matrix */ + if (h_matrix != matrix) + { + hypre_CSRMatrixDestroy(h_matrix); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixPrintMM + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixPrintMM( hypre_CSRMatrix *matrix, + HYPRE_Int basei, + HYPRE_Int basej, + HYPRE_Int trans, + const char *file_name ) +{ + FILE *fp = file_name ? fopen(file_name, "w") : stdout; + + if (!fp) { - fp = stdout; + hypre_error_w_msg(1, "Cannot open output file"); + return hypre_error_flag; } - hypre_fprintf(fp, "%%%%MatrixMarket matrix coordinate real general\n"); + const HYPRE_Complex *matrix_data = hypre_CSRMatrixData(matrix); + const HYPRE_Int *matrix_i = hypre_CSRMatrixI(matrix); + const HYPRE_Int *matrix_j = hypre_CSRMatrixJ(matrix); - hypre_assert(matrix_i[num_rows] == hypre_CSRMatrixNumNonzeros(matrix)); + hypre_assert(hypre_CSRMatrixI(matrix)[hypre_CSRMatrixNumRows(matrix)] == + hypre_CSRMatrixNumNonzeros(matrix)); - if (!trans) + if (matrix_data) { - hypre_fprintf(fp, "%d %d %d\n", num_rows, num_cols, hypre_CSRMatrixNumNonzeros(matrix)); + hypre_fprintf(fp, "%%%%MatrixMarket matrix coordinate real general\n"); } else { - hypre_fprintf(fp, "%d %d %d\n", num_cols, num_rows, hypre_CSRMatrixNumNonzeros(matrix)); + hypre_fprintf(fp, "%%%%MatrixMarket matrix coordinate pattern general\n"); } - for (j = 0; j < num_rows; j++) + hypre_fprintf(fp, "%d %d %d\n", + trans ? hypre_CSRMatrixNumCols(matrix) : hypre_CSRMatrixNumRows(matrix), + trans ? hypre_CSRMatrixNumRows(matrix) : hypre_CSRMatrixNumCols(matrix), + hypre_CSRMatrixNumNonzeros(matrix)); + + HYPRE_Int i, j; + + for (i = 0; i < hypre_CSRMatrixNumRows(matrix); i++) { - for (k = matrix_i[j]; k < matrix_i[j+1]; k++) + for (j = matrix_i[i]; j < matrix_i[i + 1]; j++) { - if (!trans) + const HYPRE_Int row = (trans ? matrix_j[j] : i) + basei; + const HYPRE_Int col = (trans ? i : matrix_j[j]) + basej; + if (matrix_data) { - hypre_fprintf(fp, "%d %d %.15e\n", j + basei, matrix_j[k] + basej, matrix_data[k]); + hypre_fprintf(fp, "%d %d %.15e\n", row, col, matrix_data[j]); } else { - hypre_fprintf(fp, "%d %d %.15e\n", matrix_j[k] + basej, j + basei, matrix_data[k]); + hypre_fprintf(fp, "%d %d\n", row, col); } } } @@ -619,18 +755,13 @@ hypre_CSRMatrixPrintMM( hypre_CSRMatrix *matrix, fclose(fp); } - return ierr; -} - -HYPRE_Int -hypre_CSRMatrixPrint2( hypre_CSRMatrix *matrix, - const char *file_name ) -{ - return hypre_CSRMatrixPrintMM(matrix, 0, 0, 0, file_name); + return hypre_error_flag; } /*-------------------------------------------------------------------------- - * hypre_CSRMatrixPrintHB: print a CSRMatrix in Harwell-Boeing format + * hypre_CSRMatrixPrintHB: + * + * Print a CSRMatrix in Harwell-Boeing format *--------------------------------------------------------------------------*/ HYPRE_Int @@ -645,7 +776,6 @@ hypre_CSRMatrixPrintHB( hypre_CSRMatrix *matrix_input, HYPRE_Int num_rows; HYPRE_Int file_base = 1; HYPRE_Int j, totcrd, ptrcrd, indcrd, valcrd, rhscrd; - HYPRE_Int ierr = 0; /*---------------------------------------------------------- * Print the matrix data @@ -704,11 +834,12 @@ hypre_CSRMatrixPrintHB( hypre_CSRMatrix *matrix_input, hypre_CSRMatrixDestroy(matrix); - return ierr; + return hypre_error_flag; } /*-------------------------------------------------------------------------- * hypre_CSRMatrixCopy: copy A to B, + * * if copy_data = 0 only the structure of A is copied to B. * the routine does not check if the dimensions/sparsity of A and B match !!! *--------------------------------------------------------------------------*/ @@ -716,18 +847,19 @@ hypre_CSRMatrixPrintHB( hypre_CSRMatrix *matrix_input, HYPRE_Int hypre_CSRMatrixCopy( hypre_CSRMatrix *A, hypre_CSRMatrix *B, HYPRE_Int copy_data ) { - HYPRE_Int ierr = 0; HYPRE_Int num_rows = hypre_CSRMatrixNumRows(A); HYPRE_Int num_nonzeros = hypre_CSRMatrixNumNonzeros(A); - HYPRE_Int *A_i = hypre_CSRMatrixI(A); - HYPRE_Int *A_j = hypre_CSRMatrixJ(A); - HYPRE_BigInt *A_bigj = hypre_CSRMatrixBigJ(A); + HYPRE_Int *A_i = hypre_CSRMatrixI(A); + HYPRE_Int *A_j = hypre_CSRMatrixJ(A); + HYPRE_BigInt *A_bigj = hypre_CSRMatrixBigJ(A); + HYPRE_Int *A_rownnz = hypre_CSRMatrixRownnz(A); HYPRE_Complex *A_data; - HYPRE_Int *B_i = hypre_CSRMatrixI(B); - HYPRE_Int *B_j = hypre_CSRMatrixJ(B); - HYPRE_BigInt *B_bigj = hypre_CSRMatrixBigJ(B); + HYPRE_Int *B_i = hypre_CSRMatrixI(B); + HYPRE_Int *B_j = hypre_CSRMatrixJ(B); + HYPRE_BigInt *B_bigj = hypre_CSRMatrixBigJ(B); + HYPRE_Int *B_rownnz = hypre_CSRMatrixRownnz(B); HYPRE_Complex *B_data; HYPRE_MemoryLocation memory_location_A = hypre_CSRMatrixMemoryLocation(A); @@ -735,6 +867,21 @@ hypre_CSRMatrixCopy( hypre_CSRMatrix *A, hypre_CSRMatrix *B, HYPRE_Int copy_data hypre_TMemcpy(B_i, A_i, HYPRE_Int, num_rows + 1, memory_location_B, memory_location_A); + if (A_rownnz) + { + if (!B_rownnz) + { + B_rownnz = hypre_TAlloc(HYPRE_Int, + hypre_CSRMatrixNumRownnz(A), + memory_location_B); + hypre_CSRMatrixRownnz(B) = B_rownnz; + } + hypre_TMemcpy(B_rownnz, A_rownnz, + HYPRE_Int, hypre_CSRMatrixNumRownnz(A), + memory_location_B, memory_location_A); + } + hypre_CSRMatrixNumRownnz(B) = hypre_CSRMatrixNumRownnz(A); + if (A_j && B_j) { hypre_TMemcpy(B_j, A_j, HYPRE_Int, num_nonzeros, memory_location_B, memory_location_A); @@ -742,34 +889,133 @@ hypre_CSRMatrixCopy( hypre_CSRMatrix *A, hypre_CSRMatrix *B, HYPRE_Int copy_data if (A_bigj && B_bigj) { - hypre_TMemcpy(B_bigj, A_bigj, HYPRE_BigInt, num_nonzeros, memory_location_B, memory_location_A); + hypre_TMemcpy(B_bigj, A_bigj, HYPRE_BigInt, num_nonzeros, + memory_location_B, memory_location_A); } if (copy_data) { A_data = hypre_CSRMatrixData(A); B_data = hypre_CSRMatrixData(B); - hypre_TMemcpy(B_data, A_data, HYPRE_Complex, num_nonzeros, memory_location_B, memory_location_A); + hypre_TMemcpy(B_data, A_data, HYPRE_Complex, num_nonzeros, + memory_location_B, memory_location_A); } - return ierr; + return hypre_error_flag; } /*-------------------------------------------------------------------------- - * hypre_CSRMatrixClone - * Creates and returns a new copy of the argument, A. - * Copying is a deep copy in that no pointers are copied; new arrays are - * created where necessary. + * hypre_CSRMatrixMigrate + * + * Migrates matrix row pointer, column indices and data to memory_location + * if it is different to the current one. + * + * Note: Does not move rownnz array. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixMigrate( hypre_CSRMatrix *A, + HYPRE_MemoryLocation memory_location ) +{ + /* Input matrix info */ + HYPRE_Int num_rows = hypre_CSRMatrixNumRows(A); + HYPRE_Int num_nonzeros = hypre_CSRMatrixNumNonzeros(A); + HYPRE_Int num_rownnz = hypre_CSRMatrixNumRownnz(A); + HYPRE_Int *A_ri = hypre_CSRMatrixRownnz(A); + HYPRE_Int *A_i = hypre_CSRMatrixI(A); + HYPRE_Int *A_j = hypre_CSRMatrixJ(A); + HYPRE_BigInt *A_big_j = hypre_CSRMatrixBigJ(A); + HYPRE_Complex *A_data = hypre_CSRMatrixData(A); + + HYPRE_MemoryLocation old_memory_location = hypre_CSRMatrixMemoryLocation(A); + + /* Output matrix info */ + HYPRE_Int *B_i; + HYPRE_Int *B_j; + HYPRE_BigInt *B_big_j; + HYPRE_Complex *B_data; + HYPRE_Int *B_ri; + + /* Check pointer locations in debug mode */ +#if defined(HYPRE_DEBUG) + hypre_CheckMemoryLocation((void*) A_ri, hypre_GetActualMemLocation(old_memory_location)); + hypre_CheckMemoryLocation((void*) A_i, hypre_GetActualMemLocation(old_memory_location)); + hypre_CheckMemoryLocation((void*) A_j, hypre_GetActualMemLocation(old_memory_location)); + hypre_CheckMemoryLocation((void*) A_big_j, hypre_GetActualMemLocation(old_memory_location)); + hypre_CheckMemoryLocation((void*) A_data, hypre_GetActualMemLocation(old_memory_location)); +#endif + + /* Update A's memory location */ + hypre_CSRMatrixMemoryLocation(A) = memory_location; + + if ( hypre_GetActualMemLocation(memory_location) != + hypre_GetActualMemLocation(old_memory_location) ) + { + if (A_ri) + { + B_ri = hypre_TAlloc(HYPRE_Int, num_rownnz, memory_location); + hypre_TMemcpy(B_ri, A_ri, HYPRE_Int, num_rownnz, + memory_location, old_memory_location); + hypre_TFree(A_ri, old_memory_location); + hypre_CSRMatrixRownnz(A) = B_ri; + } + + if (A_i) + { + B_i = hypre_TAlloc(HYPRE_Int, num_rows + 1, memory_location); + hypre_TMemcpy(B_i, A_i, HYPRE_Int, num_rows + 1, + memory_location, old_memory_location); + hypre_TFree(A_i, old_memory_location); + hypre_CSRMatrixI(A) = B_i; + } + + if (A_j) + { + B_j = hypre_TAlloc(HYPRE_Int, num_nonzeros, memory_location); + hypre_TMemcpy(B_j, A_j, HYPRE_Int, num_nonzeros, + memory_location, old_memory_location); + hypre_TFree(A_j, old_memory_location); + hypre_CSRMatrixJ(A) = B_j; + } + + if (A_big_j) + { + B_big_j = hypre_TAlloc(HYPRE_BigInt, num_nonzeros, memory_location); + hypre_TMemcpy(B_big_j, A_big_j, HYPRE_BigInt, num_nonzeros, + memory_location, old_memory_location); + hypre_TFree(A_big_j, old_memory_location); + hypre_CSRMatrixBigJ(A) = B_big_j; + } + + if (A_data) + { + B_data = hypre_TAlloc(HYPRE_Complex, num_nonzeros, memory_location); + hypre_TMemcpy(B_data, A_data, HYPRE_Complex, num_nonzeros, + memory_location, old_memory_location); + hypre_TFree(A_data, old_memory_location); + hypre_CSRMatrixData(A) = B_data; + } + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixClone_v2 + * + * This function does the same job as hypre_CSRMatrixClone; however, here + * the user can specify the memory location of the resulting matrix. *--------------------------------------------------------------------------*/ hypre_CSRMatrix* -hypre_CSRMatrixClone_v2( hypre_CSRMatrix *A, HYPRE_Int copy_data, HYPRE_MemoryLocation memory_location ) +hypre_CSRMatrixClone_v2( hypre_CSRMatrix *A, HYPRE_Int copy_data, + HYPRE_MemoryLocation memory_location ) { HYPRE_Int num_rows = hypre_CSRMatrixNumRows(A); HYPRE_Int num_cols = hypre_CSRMatrixNumCols(A); - HYPRE_Int num_nonzeros = hypre_CSRMatrixNumNonzeros( A ); + HYPRE_Int num_nonzeros = hypre_CSRMatrixNumNonzeros(A); - hypre_CSRMatrix *B = hypre_CSRMatrixCreate( num_rows, num_cols, num_nonzeros ); + hypre_CSRMatrix *B = hypre_CSRMatrixCreate(num_rows, num_cols, num_nonzeros); HYPRE_Int bigInit = hypre_CSRMatrixBigJ(A) != NULL; @@ -780,12 +1026,122 @@ hypre_CSRMatrixClone_v2( hypre_CSRMatrix *A, HYPRE_Int copy_data, HYPRE_MemoryLo return B; } +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixClone + * + * Creates and returns a new copy of the argument, A. + * Performs a deep copy of information (no pointers are copied); + * New arrays are created where necessary. + *--------------------------------------------------------------------------*/ + hypre_CSRMatrix* hypre_CSRMatrixClone( hypre_CSRMatrix *A, HYPRE_Int copy_data ) { return hypre_CSRMatrixClone_v2(A, copy_data, hypre_CSRMatrixMemoryLocation(A)); } +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixPermuteHost + * + * See hypre_CSRMatrixPermute. TODO (VPM): OpenMP implementation + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixPermuteHost( hypre_CSRMatrix *A, + HYPRE_Int *perm, + HYPRE_Int *rqperm, + hypre_CSRMatrix *B ) +{ + /* Input variables */ + HYPRE_Int num_rows = hypre_CSRMatrixNumRows(A); + HYPRE_Int num_nonzeros = hypre_CSRMatrixNumNonzeros(A); + HYPRE_Int *A_i = hypre_CSRMatrixI(A); + HYPRE_Int *A_j = hypre_CSRMatrixJ(A); + HYPRE_Complex *A_a = hypre_CSRMatrixData(A); + HYPRE_Int *B_i = hypre_CSRMatrixI(B); + HYPRE_Int *B_j = hypre_CSRMatrixJ(B); + HYPRE_Complex *B_a = hypre_CSRMatrixData(B); + + /* Local variables */ + HYPRE_Int i, j, k; + + /* Build B = A(perm, qperm) */ + k = 0; + for (i = 0; i < num_rows; i++) + { + B_i[i] = k; + for (j = A_i[perm[i]]; j < A_i[perm[i] + 1]; j++) + { + B_j[k] = rqperm[A_j[j]]; + B_a[k++] = A_a[j]; + } + } + B_i[num_rows] = k; + hypre_assert(k == num_nonzeros); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixPermute + * + * Reorder a CSRMatrix according to a row-permutation array (perm) and + * reverse column-permutation array (rqperm). + * + * Notes: + * 1) This function does not move the diagonal to the first entry of a row + * 2) When perm == rqperm == NULL, B is a deep copy of A. + * + * TODO (VPM): add check for permutation arrays under HYPRE_DEBUG + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixPermute( hypre_CSRMatrix *A, + HYPRE_Int *perm, + HYPRE_Int *rqperm, + hypre_CSRMatrix **B_ptr ) +{ + HYPRE_Int num_rows = hypre_CSRMatrixNumRows(A); + HYPRE_Int num_cols = hypre_CSRMatrixNumCols(A); + HYPRE_Int num_nonzeros = hypre_CSRMatrixNumNonzeros(A); + hypre_CSRMatrix *B; + + hypre_GpuProfilingPushRange("CSRMatrixPermute"); + + /* Special case: one of the permutation vectors are not provided, then B = A */ + if (!perm || !rqperm) + { + *B_ptr = hypre_CSRMatrixClone(A, 1); + hypre_GpuProfilingPopRange(); + + return hypre_error_flag; + } + + /* Create output matrix B */ + B = hypre_CSRMatrixCreate(num_rows, num_cols, num_nonzeros); + hypre_CSRMatrixInitialize_v2(B, 0, hypre_CSRMatrixMemoryLocation(A)); + +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_CSRMatrixMemoryLocation(A) ); + + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_CSRMatrixPermuteDevice(A, perm, rqperm, B); + } + else +#endif + { + hypre_CSRMatrixPermuteHost(A, perm, rqperm, B); + } + + hypre_GpuProfilingPopRange(); + + /* Set output pointer */ + *B_ptr = B; + + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- * hypre_CSRMatrixUnion * Creates and returns a matrix whose elements are the union of those of A and B. @@ -822,7 +1178,7 @@ hypre_CSRMatrixUnion( hypre_CSRMatrix *A, HYPRE_Int *C_i; HYPRE_Int *C_j; HYPRE_Int *jC = NULL; - HYPRE_BigInt jBg, big_jA, big_jB; + HYPRE_BigInt jBg, big_jA = -1, big_jB = -1; HYPRE_Int i, jA, jB; HYPRE_Int ma, mb, mc, ma_min, ma_max, match; hypre_CSRMatrix* C; @@ -842,28 +1198,30 @@ hypre_CSRMatrixUnion( hypre_CSRMatrix *A, } /* ==== First, go through the columns of A and B to count the columns of C. */ - if ( col_map_offd_A==0 ) - { /* The matrices are diagonal blocks. + if ( col_map_offd_A == 0 ) + { + /* The matrices are diagonal blocks. Normally num_cols_A==num_cols_B, col_starts is the same, etc. */ num_cols = hypre_max( num_cols_A, num_cols_B ); } else - { /* The matrices are offdiagonal blocks. */ + { + /* The matrices are offdiagonal blocks. */ jC = hypre_CTAlloc(HYPRE_Int, num_cols_B, HYPRE_MEMORY_HOST); num_cols = num_cols_A; /* initialization; we'll compute the actual value */ - for ( jB=0; jB rownnz) #define hypre_CSRMatrixNumRownnz(matrix) ((matrix) -> num_rownnz) #define hypre_CSRMatrixOwnsData(matrix) ((matrix) -> owns_data) +#define hypre_CSRMatrixPatternOnly(matrix) ((matrix) -> pattern_only) #define hypre_CSRMatrixMemoryLocation(matrix) ((matrix) -> memory_location) -#if defined(HYPRE_USING_CUSPARSE) || defined(HYPRE_USING_ROCSPARSE) +#if defined(HYPRE_USING_CUSPARSE) ||\ + defined(HYPRE_USING_ROCSPARSE) ||\ + defined(HYPRE_USING_ONEMKLSPARSE) #define hypre_CSRMatrixSortedJ(matrix) ((matrix) -> sorted_j) #define hypre_CSRMatrixSortedData(matrix) ((matrix) -> sorted_data) #define hypre_CSRMatrixCsrsvData(matrix) ((matrix) -> csrsv_data) @@ -108,4 +115,3 @@ typedef struct #define hypre_CSRBooleanMatrix_Get_OwnsData(matrix) ((matrix)->owns_data) #endif - diff --git a/external/hypre/src/seq_mv/csr_matrix_cuda_utils.c b/external/hypre/src/seq_mv/csr_matrix_cuda_utils.c index 88e81a40..0a78be56 100644 --- a/external/hypre/src/seq_mv/csr_matrix_cuda_utils.c +++ b/external/hypre/src/seq_mv/csr_matrix_cuda_utils.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -68,7 +68,7 @@ hypre_CSRMatrixToCusparseSpMat_core( HYPRE_Int n, */ cusparseSpMatDescr_t hypre_CSRMatrixToCusparseSpMat(const hypre_CSRMatrix *A, - HYPRE_Int offset) + HYPRE_Int offset) { return hypre_CSRMatrixToCusparseSpMat_core( hypre_CSRMatrixNumRows(A), hypre_CSRMatrixNumCols(A), @@ -87,21 +87,63 @@ hypre_CSRMatrixToCusparseSpMat(const hypre_CSRMatrix *A, * @warning Assumes CSRMatrix uses doubles for values */ cusparseDnVecDescr_t -hypre_VectorToCusparseDnVec(const hypre_Vector *x, - HYPRE_Int offset, - HYPRE_Int size_override) +hypre_VectorToCusparseDnVec_core(HYPRE_Complex *x_data, + HYPRE_Int n) { const cudaDataType data_type = hypre_HYPREComplexToCudaDataType(); cusparseDnVecDescr_t vecX; HYPRE_CUSPARSE_CALL( cusparseCreateDnVec(&vecX, - size_override >= 0 ? size_override : hypre_VectorSize(x) - offset, - hypre_VectorData(x) + offset, + n, + x_data, data_type) ); return vecX; } +cusparseDnVecDescr_t +hypre_VectorToCusparseDnVec(const hypre_Vector *x, + HYPRE_Int offset, + HYPRE_Int size_override) +{ + return hypre_VectorToCusparseDnVec_core(hypre_VectorData(x) + offset, + size_override >= 0 ? size_override : hypre_VectorSize(x) - offset); +} + +/* + * @brief Creates a cuSPARSE dense matrix descriptor from a hypre_Vector + * @param[in] *x Pointer to a hypre_Vector + * @return cuSPARSE dense matrix descriptor + * @warning Assumes CSRMatrix uses doubles for values + */ +cusparseDnMatDescr_t +hypre_VectorToCusparseDnMat_core(HYPRE_Complex *x_data, + HYPRE_Int nrow, + HYPRE_Int ncol, + HYPRE_Int order) +{ + + cudaDataType data_type = hypre_HYPREComplexToCudaDataType(); + cusparseDnMatDescr_t matX; + + HYPRE_CUSPARSE_CALL( cusparseCreateDnMat(&matX, + nrow, + ncol, + (order == 0) ? nrow : ncol, + x_data, + data_type, + (order == 0) ? CUSPARSE_ORDER_COL : CUSPARSE_ORDER_ROW) ); + return matX; +} + +cusparseDnMatDescr_t +hypre_VectorToCusparseDnMat(const hypre_Vector *x) +{ + return hypre_VectorToCusparseDnMat_core(hypre_VectorData(x), + hypre_VectorSize(x), + hypre_VectorNumVectors(x), + hypre_VectorMultiVecStorageMethod(x)); +} + #endif // #if CUSPARSE_VERSION >= CUSPARSE_NEWAPI_VERSION #endif // #if defined(HYPRE_USING_CUSPARSE) - diff --git a/external/hypre/src/seq_mv/csr_matvec.c b/external/hypre/src/seq_mv/csr_matvec.c index 38d2f1d2..543009a3 100644 --- a/external/hypre/src/seq_mv/csr_matvec.c +++ b/external/hypre/src/seq_mv/csr_matvec.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -32,7 +32,6 @@ hypre_CSRMatrixMatvecOutOfPlaceHost( HYPRE_Complex alpha, HYPRE_Int *A_j = hypre_CSRMatrixJ(A); HYPRE_Int num_rows = hypre_CSRMatrixNumRows(A) - offset; HYPRE_Int num_cols = hypre_CSRMatrixNumCols(A); - /*HYPRE_Int num_nnz = hypre_CSRMatrixNumNonzeros(A);*/ HYPRE_Int *A_rownnz = hypre_CSRMatrixRownnz(A); HYPRE_Int num_rownnz = hypre_CSRMatrixNumRownnz(A); @@ -46,13 +45,13 @@ hypre_CSRMatrixMatvecOutOfPlaceHost( HYPRE_Complex alpha, HYPRE_Int num_vectors = hypre_VectorNumVectors(x); HYPRE_Int idxstride_y = hypre_VectorIndexStride(y); HYPRE_Int vecstride_y = hypre_VectorVectorStride(y); - /*HYPRE_Int idxstride_b = hypre_VectorIndexStride(b); - HYPRE_Int vecstride_b = hypre_VectorVectorStride(b);*/ + HYPRE_Int idxstride_b = hypre_VectorIndexStride(b); + HYPRE_Int vecstride_b = hypre_VectorVectorStride(b); HYPRE_Int idxstride_x = hypre_VectorIndexStride(x); HYPRE_Int vecstride_x = hypre_VectorVectorStride(x); HYPRE_Complex temp, tempx; - HYPRE_Int i, j, jj, m, ierr=0; - HYPRE_Real xpar=0.7; + HYPRE_Int i, j, jj, m, ierr = 0; + HYPRE_Real xpar = 0.7; hypre_Vector *x_tmp = NULL; /*--------------------------------------------------------------------- @@ -68,6 +67,8 @@ hypre_CSRMatrixMatvecOutOfPlaceHost( HYPRE_Complex alpha, hypre_assert(num_vectors == hypre_VectorNumVectors(y)); hypre_assert(num_vectors == hypre_VectorNumVectors(b)); + hypre_assert(idxstride_b == idxstride_y); + hypre_assert(vecstride_b == vecstride_y); if (num_cols != x_size) { @@ -91,11 +92,11 @@ hypre_CSRMatrixMatvecOutOfPlaceHost( HYPRE_Complex alpha, if (alpha == 0.0) { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i = 0; i < num_rows*num_vectors; i++) + for (i = 0; i < num_rows * num_vectors; i++) { - y_data[i] = beta*b_data[i]; + y_data[i] = beta * b_data[i]; } #ifdef HYPRE_PROFILE @@ -122,9 +123,9 @@ hypre_CSRMatrixMatvecOutOfPlaceHost( HYPRE_Complex alpha, if (temp == 0.0) { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i = 0; i < num_rows*num_vectors; i++) + for (i = 0; i < num_rows * num_vectors; i++) { y_data[i] = 0.0; } @@ -132,9 +133,9 @@ hypre_CSRMatrixMatvecOutOfPlaceHost( HYPRE_Complex alpha, else if (temp == 1.0) { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i = 0; i < num_rows*num_vectors; i++) + for (i = 0; i < num_rows * num_vectors; i++) { y_data[i] = b_data[i]; } @@ -142,9 +143,9 @@ hypre_CSRMatrixMatvecOutOfPlaceHost( HYPRE_Complex alpha, else if (temp == -1.0) { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i = 0; i < num_rows*num_vectors; i++) + for (i = 0; i < num_rows * num_vectors; i++) { y_data[i] = -b_data[i]; } @@ -152,11 +153,11 @@ hypre_CSRMatrixMatvecOutOfPlaceHost( HYPRE_Complex alpha, else { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i = 0; i < num_rows*num_vectors; i++) + for (i = 0; i < num_rows * num_vectors; i++) { - y_data[i] = temp*b_data[i]; + y_data[i] = temp * b_data[i]; } } @@ -164,43 +165,203 @@ hypre_CSRMatrixMatvecOutOfPlaceHost( HYPRE_Complex alpha, * y += A*x *-----------------------------------------------------------------*/ - if (num_rownnz < xpar*num_rows) + if (num_rownnz < xpar * num_rows) { + switch (num_vectors) + { + case 2: #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,j,jj,m,tempx) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,j,jj,m) HYPRE_SMP_SCHEDULE #endif - for (i = 0; i < num_rownnz; i++) - { - m = A_rownnz[i]; - for (j = 0; j < num_vectors; j++) - { - tempx = 0.0; - for (jj = A_i[m]; jj < A_i[m+1]; jj++) + for (i = 0; i < num_rownnz; i++) { - tempx += A_data[jj] * x_data[j*vecstride_x + A_j[jj]*idxstride_x]; + m = A_rownnz[i]; + + HYPRE_Complex tmp[2] = {0.0, 0.0}; + for (jj = A_i[m]; jj < A_i[m + 1]; jj++) + { + HYPRE_Int xidx = A_j[jj] * idxstride_x; + HYPRE_Complex coef = A_data[jj]; + + tmp[0] += coef * x_data[xidx]; + tmp[1] += coef * x_data[xidx + vecstride_x]; + } + HYPRE_Int yidx = m * idxstride_y; + + y_data[yidx] += tmp[0]; + y_data[yidx + vecstride_y] += tmp[1]; } - y_data[j*vecstride_y + m*idxstride_y] += tempx; - } - } + break; + + case 3: +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i,j,jj,m) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < num_rownnz; i++) + { + m = A_rownnz[i]; + + HYPRE_Complex tmp[3] = {0.0, 0.0, 0.0}; + for (jj = A_i[m]; jj < A_i[m + 1]; jj++) + { + HYPRE_Int xidx = A_j[jj] * idxstride_x; + HYPRE_Complex coef = A_data[jj]; + + tmp[0] += coef * x_data[xidx]; + tmp[1] += coef * x_data[xidx + vecstride_x]; + tmp[2] += coef * x_data[xidx + 2 * vecstride_x]; + } + HYPRE_Int yidx = m * idxstride_y; + + y_data[yidx] += tmp[0]; + y_data[yidx + vecstride_y] += tmp[1]; + y_data[yidx + 2 * vecstride_y] += tmp[2]; + } + break; + + case 4: +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i,j,jj,m) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < num_rownnz; i++) + { + m = A_rownnz[i]; + + HYPRE_Complex tmp[4] = {0.0, 0.0, 0.0, 0.0}; + for (jj = A_i[m]; jj < A_i[m + 1]; jj++) + { + HYPRE_Int xidx = A_j[jj] * idxstride_x; + HYPRE_Complex coef = A_data[jj]; + + tmp[0] += coef * x_data[xidx]; + tmp[1] += coef * x_data[xidx + vecstride_x]; + tmp[2] += coef * x_data[xidx + 2 * vecstride_x]; + tmp[3] += coef * x_data[xidx + 3 * vecstride_x]; + } + HYPRE_Int yidx = m * idxstride_y; + + y_data[yidx] += tmp[0]; + y_data[yidx + vecstride_y] += tmp[1]; + y_data[yidx + 2 * vecstride_y] += tmp[2]; + y_data[yidx + 3 * vecstride_y] += tmp[3]; + } + break; + + default: +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i,j,jj,m,tempx) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < num_rownnz; i++) + { + m = A_rownnz[i]; + for (j = 0; j < num_vectors; j++) + { + tempx = 0.0; + for (jj = A_i[m]; jj < A_i[m + 1]; jj++) + { + tempx += A_data[jj] * x_data[j * vecstride_x + A_j[jj] * idxstride_x]; + } + y_data[j * vecstride_y + m * idxstride_y] += tempx; + } + } + break; + } /* switch (num_vectors) */ } else { + switch (num_vectors) + { + case 2: #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,j,jj,tempx) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,j,jj) HYPRE_SMP_SCHEDULE #endif - for (i = 0; i < num_rows; i++) - { - for (j = 0; j < num_vectors; ++j) - { - tempx = 0.0; - for (jj = A_i[i]; jj < A_i[i+1]; jj++) + for (i = 0; i < num_rows; i++) { - tempx += A_data[jj] * x_data[j*vecstride_x + A_j[jj]*idxstride_x]; + HYPRE_Complex tmp[2] = {0.0, 0.0}; + for (jj = A_i[i]; jj < A_i[i + 1]; jj++) + { + HYPRE_Int xidx = A_j[jj] * idxstride_x; + HYPRE_Complex coef = A_data[jj]; + + tmp[0] += coef * x_data[xidx]; + tmp[1] += coef * x_data[xidx + vecstride_x]; + } + HYPRE_Int yidx = i * idxstride_y; + + y_data[yidx] += tmp[0]; + y_data[yidx + vecstride_y] += tmp[1]; } - y_data[j*vecstride_y + i*idxstride_y] += tempx; - } - } - } + break; + + case 3: +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i,j,jj) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < num_rows; i++) + { + HYPRE_Complex tmp[3] = {0.0, 0.0, 0.0}; + for (jj = A_i[i]; jj < A_i[i + 1]; jj++) + { + HYPRE_Int xidx = A_j[jj] * idxstride_x; + HYPRE_Complex coef = A_data[jj]; + + tmp[0] += coef * x_data[xidx]; + tmp[1] += coef * x_data[xidx + vecstride_x]; + tmp[2] += coef * x_data[xidx + 2 * vecstride_x]; + } + HYPRE_Int yidx = i * idxstride_y; + + y_data[yidx] += tmp[0]; + y_data[yidx + vecstride_y] += tmp[1]; + y_data[yidx + 2 * vecstride_y] += tmp[2]; + } + break; + + case 4: +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i,j,jj) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < num_rows; i++) + { + HYPRE_Complex tmp[4] = {0.0, 0.0, 0.0, 0.0}; + for (jj = A_i[i]; jj < A_i[i + 1]; jj++) + { + HYPRE_Int xidx = A_j[jj] * idxstride_x; + HYPRE_Complex coef = A_data[jj]; + + tmp[0] += coef * x_data[xidx]; + tmp[1] += coef * x_data[xidx + vecstride_x]; + tmp[2] += coef * x_data[xidx + 2 * vecstride_x]; + tmp[3] += coef * x_data[xidx + 3 * vecstride_x]; + } + HYPRE_Int yidx = i * idxstride_y; + + y_data[yidx] += tmp[0]; + y_data[yidx + vecstride_y] += tmp[1]; + y_data[yidx + 2 * vecstride_y] += tmp[2]; + y_data[yidx + 3 * vecstride_y] += tmp[3]; + } + break; + + default: +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i,j,jj,tempx) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < num_rows; i++) + { + for (j = 0; j < num_vectors; ++j) + { + tempx = 0.0; + for (jj = A_i[i]; jj < A_i[i + 1]; jj++) + { + tempx += A_data[jj] * x_data[j * vecstride_x + A_j[jj] * idxstride_x]; + } + y_data[j * vecstride_y + i * idxstride_y] += tempx; + } + } + break; + } /* switch (num_vectors) */ + } /* if (num_rownnz < xpar * num_rows) */ /*----------------------------------------------------------------- * y = alpha*y @@ -209,15 +370,15 @@ hypre_CSRMatrixMatvecOutOfPlaceHost( HYPRE_Complex alpha, if (alpha != 1.0) { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i = 0; i < num_rows*num_vectors; i++) + for (i = 0; i < num_rows * num_vectors; i++) { y_data[i] *= alpha; } } } - else if (num_rownnz < xpar*num_rows) + else if (num_rownnz < xpar * num_rows) { /* use rownnz pointer to do the A*x multiplication when num_rownnz is smaller than xpar*num_rows */ @@ -225,7 +386,7 @@ hypre_CSRMatrixMatvecOutOfPlaceHost( HYPRE_Complex alpha, if (temp == 0.0) { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < num_rows; i++) { @@ -235,13 +396,13 @@ hypre_CSRMatrixMatvecOutOfPlaceHost( HYPRE_Complex alpha, if (alpha == 1.0) { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,j,m,tempx) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,j,m,tempx) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < num_rownnz; i++) { m = A_rownnz[i]; tempx = 0.0; - for (j = A_i[m]; j < A_i[m+1]; j++) + for (j = A_i[m]; j < A_i[m + 1]; j++) { tempx += A_data[j] * x_data[A_j[j]]; } @@ -251,13 +412,13 @@ hypre_CSRMatrixMatvecOutOfPlaceHost( HYPRE_Complex alpha, else if (alpha == -1.0) { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,j,m,tempx) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,j,m,tempx) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < num_rownnz; i++) { m = A_rownnz[i]; tempx = 0.0; - for (j = A_i[m]; j < A_i[m+1]; j++) + for (j = A_i[m]; j < A_i[m + 1]; j++) { tempx -= A_data[j] * x_data[A_j[j]]; } @@ -267,17 +428,17 @@ hypre_CSRMatrixMatvecOutOfPlaceHost( HYPRE_Complex alpha, else { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,j,m,tempx) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,j,m,tempx) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < num_rownnz; i++) { m = A_rownnz[i]; tempx = 0.0; - for (j = A_i[m]; j < A_i[m+1]; j++) + for (j = A_i[m]; j < A_i[m + 1]; j++) { tempx += A_data[j] * x_data[A_j[j]]; } - y_data[m] = alpha*tempx; + y_data[m] = alpha * tempx; } } // y = alpha*A*x } // temp == 0 @@ -286,7 +447,7 @@ hypre_CSRMatrixMatvecOutOfPlaceHost( HYPRE_Complex alpha, if (alpha == 1.0) { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < num_rows; i++) { @@ -294,13 +455,13 @@ hypre_CSRMatrixMatvecOutOfPlaceHost( HYPRE_Complex alpha, } #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,j,m,tempx) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,j,m,tempx) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < num_rownnz; i++) { m = A_rownnz[i]; tempx = 0.0; - for (j = A_i[m]; j < A_i[m+1]; j++) + for (j = A_i[m]; j < A_i[m + 1]; j++) { tempx += A_data[j] * x_data[A_j[j]]; } @@ -310,7 +471,7 @@ hypre_CSRMatrixMatvecOutOfPlaceHost( HYPRE_Complex alpha, else if (alpha == -1.0) { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < num_rows; i++) { @@ -318,13 +479,13 @@ hypre_CSRMatrixMatvecOutOfPlaceHost( HYPRE_Complex alpha, } #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,j,m,tempx) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,j,m,tempx) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < num_rownnz; i++) { m = A_rownnz[i]; tempx = 0.0; - for (j = A_i[m]; j < A_i[m+1]; j++) + for (j = A_i[m]; j < A_i[m + 1]; j++) { tempx += A_data[j] * x_data[A_j[j]]; } @@ -334,25 +495,25 @@ hypre_CSRMatrixMatvecOutOfPlaceHost( HYPRE_Complex alpha, else { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < num_rows; i++) { - y_data[i] = -alpha*b_data[i]; + y_data[i] = -alpha * b_data[i]; } #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,j,m,tempx) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,j,m,tempx) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < num_rownnz; i++) { m = A_rownnz[i]; tempx = 0.0; - for (j = A_i[m]; j < A_i[m+1]; j++) + for (j = A_i[m]; j < A_i[m + 1]; j++) { tempx += A_data[j] * x_data[A_j[j]]; } - y_data[m] += alpha*tempx; + y_data[m] += alpha * tempx; } } // y = alpha*(A*x - b) } // temp == -1 @@ -361,7 +522,7 @@ hypre_CSRMatrixMatvecOutOfPlaceHost( HYPRE_Complex alpha, if (alpha == 1.0) { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < num_rows; i++) { @@ -369,13 +530,13 @@ hypre_CSRMatrixMatvecOutOfPlaceHost( HYPRE_Complex alpha, } #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,j,m,tempx) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,j,m,tempx) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < num_rownnz; i++) { m = A_rownnz[i]; tempx = 0.0; - for (j = A_i[m]; j < A_i[m+1]; j++) + for (j = A_i[m]; j < A_i[m + 1]; j++) { tempx += A_data[j] * x_data[A_j[j]]; } @@ -385,7 +546,7 @@ hypre_CSRMatrixMatvecOutOfPlaceHost( HYPRE_Complex alpha, else if (alpha == -1.0) { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < num_rows; i++) { @@ -393,13 +554,13 @@ hypre_CSRMatrixMatvecOutOfPlaceHost( HYPRE_Complex alpha, } #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,j,m,tempx) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,j,m,tempx) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < num_rownnz; i++) { m = A_rownnz[i]; tempx = 0.0; - for (j = A_i[m]; j < A_i[m+1]; j++) + for (j = A_i[m]; j < A_i[m + 1]; j++) { tempx -= A_data[j] * x_data[A_j[j]]; } @@ -409,25 +570,25 @@ hypre_CSRMatrixMatvecOutOfPlaceHost( HYPRE_Complex alpha, else { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < num_rows; i++) { - y_data[i] = alpha*b_data[i]; + y_data[i] = alpha * b_data[i]; } #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,j,m,tempx) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,j,m,tempx) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < num_rownnz; i++) { m = A_rownnz[i]; tempx = 0.0; - for (j = A_i[m]; j < A_i[m+1]; j++) + for (j = A_i[m]; j < A_i[m + 1]; j++) { tempx += A_data[j] * x_data[A_j[j]]; } - y_data[m] += alpha*tempx; + y_data[m] += alpha * tempx; } } // y = alpha*(A*x + b) } @@ -436,21 +597,21 @@ hypre_CSRMatrixMatvecOutOfPlaceHost( HYPRE_Complex alpha, if (alpha == 1.0) { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < num_rows; i++) { - y_data[i] = beta*b_data[i]; + y_data[i] = beta * b_data[i]; } #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,j,m,tempx) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,j,m,tempx) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < num_rownnz; i++) { m = A_rownnz[i]; tempx = 0.0; - for (j = A_i[m]; j < A_i[m+1]; j++) + for (j = A_i[m]; j < A_i[m + 1]; j++) { tempx += A_data[j] * x_data[A_j[j]]; } @@ -460,21 +621,21 @@ hypre_CSRMatrixMatvecOutOfPlaceHost( HYPRE_Complex alpha, else if (-1 == alpha) { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < num_rows; i++) { - y_data[i] = -temp*b_data[i]; + y_data[i] = -temp * b_data[i]; } #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,j,m,tempx) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,j,m,tempx) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < num_rownnz; i++) { m = A_rownnz[i]; tempx = 0.0; - for (j = A_i[m]; j < A_i[m+1]; j++) + for (j = A_i[m]; j < A_i[m + 1]; j++) { tempx -= A_data[j] * x_data[A_j[j]]; } @@ -484,25 +645,25 @@ hypre_CSRMatrixMatvecOutOfPlaceHost( HYPRE_Complex alpha, else { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < num_rows; i++) { - y_data[i] = beta*b_data[i]; + y_data[i] = beta * b_data[i]; } #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i,j,m,tempx) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i,j,m,tempx) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < num_rownnz; i++) { m = A_rownnz[i]; tempx = 0.0; - for (j = A_i[m]; j < A_i[m+1]; j++) + for (j = A_i[m]; j < A_i[m + 1]; j++) { tempx += A_data[j] * x_data[A_j[j]]; } - y_data[m] += alpha*tempx; + y_data[m] += alpha * tempx; } } // y = alpha*(A*x + temp*b) } // temp != 0 && temp != -1 && temp != 1 @@ -510,7 +671,7 @@ hypre_CSRMatrixMatvecOutOfPlaceHost( HYPRE_Complex alpha, else { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel private(i,jj,tempx) + #pragma omp parallel private(i,jj,tempx) #endif { HYPRE_Int iBegin = hypre_CSRMatrixGetLoadBalancedPartitionBegin(A); @@ -526,7 +687,7 @@ hypre_CSRMatrixMatvecOutOfPlaceHost( HYPRE_Complex alpha, for (i = iBegin; i < iEnd; i++) { tempx = 0.0; - for (jj = A_i[i]; jj < A_i[i+1]; jj++) + for (jj = A_i[i]; jj < A_i[i + 1]; jj++) { tempx += A_data[jj] * x_data[A_j[jj]]; } @@ -538,7 +699,7 @@ hypre_CSRMatrixMatvecOutOfPlaceHost( HYPRE_Complex alpha, for (i = iBegin; i < iEnd; i++) { tempx = 0.0; - for (jj = A_i[i]; jj < A_i[i+1]; jj++) + for (jj = A_i[i]; jj < A_i[i + 1]; jj++) { tempx -= A_data[jj] * x_data[A_j[jj]]; } @@ -550,11 +711,11 @@ hypre_CSRMatrixMatvecOutOfPlaceHost( HYPRE_Complex alpha, for (i = iBegin; i < iEnd; i++) { tempx = 0.0; - for (jj = A_i[i]; jj < A_i[i+1]; jj++) + for (jj = A_i[i]; jj < A_i[i + 1]; jj++) { tempx += A_data[jj] * x_data[A_j[jj]]; } - y_data[i] = alpha*tempx; + y_data[i] = alpha * tempx; } } // y = alpha*A*x } // temp == 0 @@ -566,7 +727,7 @@ hypre_CSRMatrixMatvecOutOfPlaceHost( HYPRE_Complex alpha, { y_data[i] = -b_data[i]; tempx = 0.0; - for (jj = A_i[i]; jj < A_i[i+1]; jj++) + for (jj = A_i[i]; jj < A_i[i + 1]; jj++) { tempx += A_data[jj] * x_data[A_j[jj]]; } @@ -579,7 +740,7 @@ hypre_CSRMatrixMatvecOutOfPlaceHost( HYPRE_Complex alpha, { y_data[i] = b_data[i]; tempx = 0.0; - for (jj = A_i[i]; jj < A_i[i+1]; jj++) + for (jj = A_i[i]; jj < A_i[i + 1]; jj++) { tempx -= A_data[jj] * x_data[A_j[jj]]; } @@ -590,13 +751,13 @@ hypre_CSRMatrixMatvecOutOfPlaceHost( HYPRE_Complex alpha, { for (i = iBegin; i < iEnd; i++) { - y_data[i] = -alpha*b_data[i]; + y_data[i] = -alpha * b_data[i]; tempx = 0.0; - for (jj = A_i[i]; jj < A_i[i+1]; jj++) + for (jj = A_i[i]; jj < A_i[i + 1]; jj++) { tempx += A_data[jj] * x_data[A_j[jj]]; } - y_data[i] += alpha*tempx; + y_data[i] += alpha * tempx; } } // y = alpha*(A*x - y) } // temp == -1 @@ -608,7 +769,7 @@ hypre_CSRMatrixMatvecOutOfPlaceHost( HYPRE_Complex alpha, { y_data[i] = b_data[i]; tempx = 0.0; - for (jj = A_i[i]; jj < A_i[i+1]; jj++) + for (jj = A_i[i]; jj < A_i[i + 1]; jj++) { tempx += A_data[jj] * x_data[A_j[jj]]; } @@ -621,7 +782,7 @@ hypre_CSRMatrixMatvecOutOfPlaceHost( HYPRE_Complex alpha, { y_data[i] = -b_data[i]; tempx = 0.0; - for (jj = A_i[i]; jj < A_i[i+1]; jj++) + for (jj = A_i[i]; jj < A_i[i + 1]; jj++) { tempx -= A_data[jj] * x_data[A_j[jj]]; } @@ -634,11 +795,11 @@ hypre_CSRMatrixMatvecOutOfPlaceHost( HYPRE_Complex alpha, { y_data[i] = alpha * b_data[i]; tempx = 0.0; - for (jj = A_i[i]; jj < A_i[i+1]; jj++) + for (jj = A_i[i]; jj < A_i[i + 1]; jj++) { tempx += A_data[jj] * x_data[A_j[jj]]; } - y_data[i] += alpha*tempx; + y_data[i] += alpha * tempx; } } // y = alpha*(A*x + y) } @@ -648,9 +809,9 @@ hypre_CSRMatrixMatvecOutOfPlaceHost( HYPRE_Complex alpha, { for (i = iBegin; i < iEnd; i++) { - y_data[i] = b_data[i]*temp; + y_data[i] = b_data[i] * temp; tempx = 0.0; - for (jj = A_i[i]; jj < A_i[i+1]; jj++) + for (jj = A_i[i]; jj < A_i[i + 1]; jj++) { tempx += A_data[jj] * x_data[A_j[jj]]; } @@ -661,9 +822,9 @@ hypre_CSRMatrixMatvecOutOfPlaceHost( HYPRE_Complex alpha, { for (i = iBegin; i < iEnd; i++) { - y_data[i] = -b_data[i]*temp; + y_data[i] = -b_data[i] * temp; tempx = 0.0; - for (jj = A_i[i]; jj < A_i[i+1]; jj++) + for (jj = A_i[i]; jj < A_i[i + 1]; jj++) { tempx -= A_data[jj] * x_data[A_j[jj]]; } @@ -674,13 +835,13 @@ hypre_CSRMatrixMatvecOutOfPlaceHost( HYPRE_Complex alpha, { for (i = iBegin; i < iEnd; i++) { - y_data[i] = b_data[i]*beta; + y_data[i] = b_data[i] * beta; tempx = 0.0; - for (jj = A_i[i]; jj < A_i[i+1]; jj++) + for (jj = A_i[i]; jj < A_i[i + 1]; jj++) { tempx += A_data[jj] * x_data[A_j[jj]]; } - y_data[i] += alpha*tempx; + y_data[i] += alpha * tempx; } } // y = alpha*(A*x + temp*y) } // temp != 0 && temp != -1 && temp != 1 @@ -710,10 +871,8 @@ hypre_CSRMatrixMatvecOutOfPlace( HYPRE_Complex alpha, HYPRE_Int ierr = 0; -#if defined(HYPRE_USING_GPU) - //HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_ParCSRMatrixMemoryLocation(A) ); - //RL: TODO back to hypre_GetExecPolicy1 later - HYPRE_ExecutionPolicy exec = HYPRE_EXEC_DEVICE; +#if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_CSRMatrixMemoryLocation(A) ); if (exec == HYPRE_EXEC_DEVICE) { ierr = hypre_CSRMatrixMatvecDevice(0, alpha, A, x, beta, b, y, offset); @@ -800,13 +959,19 @@ hypre_CSRMatrixMatvecTHost( HYPRE_Complex alpha, hypre_assert( num_vectors == hypre_VectorNumVectors(y) ); if (num_rows != x_size) + { ierr = 1; + } if (num_cols != y_size) + { ierr = 2; + } if (num_rows != x_size && num_cols != y_size) + { ierr = 3; + } /*----------------------------------------------------------------------- * Do (alpha == 0.0) computation - RDF: USE MACHINE EPS *-----------------------------------------------------------------------*/ @@ -814,10 +979,12 @@ hypre_CSRMatrixMatvecTHost( HYPRE_Complex alpha, if (alpha == 0.0) { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i = 0; i < num_cols*num_vectors; i++) + for (i = 0; i < num_cols * num_vectors; i++) + { y_data[i] *= beta; + } return ierr; } @@ -839,18 +1006,22 @@ hypre_CSRMatrixMatvecTHost( HYPRE_Complex alpha, if (temp == 0.0) { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i = 0; i < num_cols*num_vectors; i++) + for (i = 0; i < num_cols * num_vectors; i++) + { y_data[i] = 0.0; + } } else { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i = 0; i < num_cols*num_vectors; i++) + for (i = 0; i < num_cols * num_vectors; i++) + { y_data[i] *= temp; + } } } @@ -860,23 +1031,23 @@ hypre_CSRMatrixMatvecTHost( HYPRE_Complex alpha, num_threads = hypre_NumThreads(); if (num_threads > 1) { - y_data_expand = hypre_CTAlloc(HYPRE_Complex, num_threads*y_size, HYPRE_MEMORY_HOST); + y_data_expand = hypre_CTAlloc(HYPRE_Complex, num_threads * y_size, HYPRE_MEMORY_HOST); - if ( num_vectors==1 ) + if ( num_vectors == 1 ) { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel private(i,jj,j,my_thread_num,offset) + #pragma omp parallel private(i,jj,j,my_thread_num,offset) #endif { my_thread_num = hypre_GetThreadNum(); - offset = y_size*my_thread_num; + offset = y_size * my_thread_num; #ifdef HYPRE_USING_OPENMP -#pragma omp for HYPRE_SMP_SCHEDULE + #pragma omp for HYPRE_SMP_SCHEDULE #endif for (i = 0; i < num_rows; i++) { - for (jj = A_i[i]; jj < A_i[i+1]; jj++) + for (jj = A_i[i]; jj < A_i[i + 1]; jj++) { j = A_j[jj]; y_data_expand[offset + j] += A_data[jj] * x_data[i]; @@ -885,13 +1056,13 @@ hypre_CSRMatrixMatvecTHost( HYPRE_Complex alpha, /* implied barrier (for threads)*/ #ifdef HYPRE_USING_OPENMP -#pragma omp for HYPRE_SMP_SCHEDULE + #pragma omp for HYPRE_SMP_SCHEDULE #endif for (i = 0; i < y_size; i++) { for (j = 0; j < num_threads; j++) { - y_data[i] += y_data_expand[j*y_size + i]; + y_data[i] += y_data_expand[j * y_size + i]; } } @@ -903,13 +1074,13 @@ hypre_CSRMatrixMatvecTHost( HYPRE_Complex alpha, /* multiple vector case is not threaded */ for (i = 0; i < num_rows; i++) { - for ( jv=0; jv= CUSPARSE_NEWSPMM_VERSION +#define HYPRE_CUSPARSE_SPMV_ALG CUSPARSE_SPMV_CSR_ALG2 +#define HYPRE_CUSPARSE_SPMM_ALG CUSPARSE_SPMM_CSR_ALG3 + +#elif CUSPARSE_VERSION >= CUSPARSE_NEWAPI_VERSION +#define HYPRE_CUSPARSE_SPMV_ALG CUSPARSE_CSRMV_ALG2 +#define HYPRE_CUSPARSE_SPMM_ALG CUSPARSE_SPMM_CSR_ALG1 + +#else +#define HYPRE_CUSPARSE_SPMV_ALG CUSPARSE_CSRMV_ALG2 +#define HYPRE_CUSPARSE_SPMM_ALG CUSPARSE_CSRMM_ALG1 +#endif /* y = alpha * A * x + beta * y * This function is supposed to be only used inside the other functions in this file @@ -29,30 +42,64 @@ hypre_CSRMatrixMatvecDevice2( HYPRE_Int trans, hypre_Vector *y, HYPRE_Int offset ) { + /* Sanity check */ if (hypre_VectorData(x) == hypre_VectorData(y)) { - hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ERROR::x and y are the same pointer in hypre_CSRMatrixMatvecDevice2"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "ERROR::x and y are the same pointer in hypre_CSRMatrixMatvecDevice2"); } -#ifdef HYPRE_USING_CUSPARSE -#if CUSPARSE_VERSION >= CUSPARSE_NEWAPI_VERSION - /* Luke E: The generic API is techinically supported on 10.1,10.2 as a preview, - * with Dscrmv being deprecated. However, there are limitations. - * While in Cuda < 11, there are specific mentions of using csr2csc involving - * transposed matrix products with dcsrm*, - * they are not present in SpMV interface. - */ - hypre_CSRMatrixMatvecCusparseNewAPI(trans, alpha, A, x, beta, y, offset); +#if defined(HYPRE_USING_CUSPARSE) || \ + defined(HYPRE_USING_ROCSPARSE) || \ + defined(HYPRE_USING_ONEMKLSPARSE) + + /* Input variables */ + HYPRE_Int num_vectors_x = hypre_VectorNumVectors(x); + HYPRE_Int num_vectors_y = hypre_VectorNumVectors(y); + + /* Local variables */ + HYPRE_Int use_vendor = hypre_HandleSpMVUseVendor(hypre_handle()); + +#if defined(HYPRE_USING_CUSPARSE) && CUSPARSE_VERSION >= CUSPARSE_NEWAPI_VERSION + HYPRE_Int multivec_storage_x = hypre_VectorMultiVecStorageMethod(x); + HYPRE_Int multivec_storage_y = hypre_VectorMultiVecStorageMethod(y); + + /* Force use of hypre's SpMV for row-wise multivectors */ + if ((num_vectors_x > 1 && multivec_storage_x == 1) || + (num_vectors_y > 1 && multivec_storage_y == 1)) + { + use_vendor = 0; + } #else - hypre_CSRMatrixMatvecCusparseOldAPI(trans, alpha, A, x, beta, y, offset); + /* TODO - enable cuda 10, rocsparse, and onemkle sparse support for multi-vectors */ + if (num_vectors_x > 1 || num_vectors_y > 1) + { + use_vendor = 0; + } #endif -#elif defined(HYPRE_USING_DEVICE_OPENMP) - hypre_CSRMatrixMatvecOMPOffload(trans, alpha, A, x, beta, y, offset); + + if (use_vendor) + { +#if defined(HYPRE_USING_CUSPARSE) + hypre_CSRMatrixMatvecCusparse(trans, alpha, A, x, beta, y, offset); + #elif defined(HYPRE_USING_ROCSPARSE) - hypre_CSRMatrixMatvecRocsparse(trans, alpha, A, x, beta, y, offset); -#else // #ifdef HYPRE_USING_CUSPARSE -#error HYPRE SPMV TODO + hypre_CSRMatrixMatvecRocsparse(trans, alpha, A, x, beta, y, offset); + +#elif defined(HYPRE_USING_ONEMKLSPARSE) + hypre_CSRMatrixMatvecOnemklsparse(trans, alpha, A, x, beta, y, offset); +#endif + } + else +#endif // defined(HYPRE_USING_CUSPARSE) || defined(HYPRE_USING_ROCSPARSE) ... + { +#if defined(HYPRE_USING_GPU) + hypre_CSRMatrixSpMVDevice(trans, alpha, A, x, beta, y, 0); + +#elif defined(HYPRE_USING_DEVICE_OPENMP) + hypre_CSRMatrixMatvecOMPOffload(trans, alpha, A, x, beta, y, offset); #endif + } return hypre_error_flag; } @@ -68,13 +115,16 @@ hypre_CSRMatrixMatvecDevice( HYPRE_Int trans, hypre_Vector *y, HYPRE_Int offset ) { -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - hypre_GpuProfilingPushRange("CSRMatrixMatvec"); -#endif + //hypre_GpuProfilingPushRange("CSRMatrixMatvec"); + HYPRE_Int num_vectors = hypre_VectorNumVectors(x); // TODO: RL: do we need offset > 0 at all? hypre_assert(offset == 0); + // VPM: offset > 0 does not work with multivectors. Remove offset? See comment above + hypre_assert(!(offset != 0 && num_vectors > 1)); + hypre_assert(num_vectors > 0); + HYPRE_Int nx = trans ? hypre_CSRMatrixNumRows(A) : hypre_CSRMatrixNumCols(A); HYPRE_Int ny = trans ? hypre_CSRMatrixNumCols(A) : hypre_CSRMatrixNumRows(A); @@ -97,7 +147,7 @@ hypre_CSRMatrixMatvecDevice( HYPRE_Int trans, hypre_TMemcpy( hypre_VectorData(y) + offset, hypre_VectorData(b) + offset, HYPRE_Complex, - ny - offset, + (ny - offset) * num_vectors, hypre_VectorMemoryLocation(y), hypre_VectorMemoryLocation(b) ); @@ -112,18 +162,26 @@ hypre_CSRMatrixMatvecDevice( HYPRE_Int trans, hypre_CSRMatrixMatvecDevice2(trans, alpha, A, x, beta, y, offset); } - hypre_SyncCudaComputeStream(hypre_handle()); - -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - hypre_GpuProfilingPopRange(); +#if defined(HYPRE_USING_GPU) + hypre_SyncComputeStream(); #endif + //hypre_GpuProfilingPopRange(); + return hypre_error_flag; } #if defined(HYPRE_USING_CUSPARSE) #if CUSPARSE_VERSION >= CUSPARSE_NEWAPI_VERSION +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixMatvecCusparseNewAPI + * + * Sparse Matrix/(Multi)Vector interface to cusparse's API 11 + * + * Note: The descriptor variables are not saved to allow for generic input + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_CSRMatrixMatvecCusparseNewAPI( HYPRE_Int trans, HYPRE_Complex alpha, @@ -133,67 +191,149 @@ hypre_CSRMatrixMatvecCusparseNewAPI( HYPRE_Int trans, hypre_Vector *y, HYPRE_Int offset ) { + /* Input variables */ + HYPRE_Int num_vectors = hypre_VectorNumVectors(x); + HYPRE_Int num_cols = trans ? hypre_CSRMatrixNumRows(A) : hypre_CSRMatrixNumCols(A); + HYPRE_Int num_rows = trans ? hypre_CSRMatrixNumCols(A) : hypre_CSRMatrixNumRows(A); + hypre_CSRMatrix *AT; + hypre_CSRMatrix *B; + + /* SpMV data */ + size_t bufferSize = 0; + char *dBuffer = hypre_CSRMatrixGPUMatSpMVBuffer(A); + cusparseHandle_t handle = hypre_HandleCusparseHandle(hypre_handle()); const cudaDataType data_type = hypre_HYPREComplexToCudaDataType(); const cusparseIndexType_t index_type = hypre_HYPREIntToCusparseIndexType(); + + /* Local cusparse descriptor variables */ cusparseSpMatDescr_t matA; - cusparseHandle_t handle = hypre_HandleCusparseHandle(hypre_handle()); - hypre_CSRMatrix *AT; + cusparseDnVecDescr_t vecX, vecY; + cusparseDnMatDescr_t matX, matY; + /* We handle the transpose explicitly to ensure the same output each run + * and for potential performance improvement memory for AT */ if (trans) { - /* We handle the transpose explicitly to ensure the same output each run - * and for potential performance improvement memory for AT */ hypre_CSRMatrixTransposeDevice(A, &AT, 1); - matA = hypre_CSRMatrixToCusparseSpMat(AT, offset); + B = AT; } else { - matA = hypre_CSRMatrixToCusparseSpMat(A, offset); + B = A; } - /* SpMV */ - size_t bufferSize = 0; - char *dBuffer = NULL; - HYPRE_Int x_size_override = trans ? hypre_CSRMatrixNumRows(A) : hypre_CSRMatrixNumCols(A); - HYPRE_Int y_size_override = trans ? hypre_CSRMatrixNumCols(A) : hypre_CSRMatrixNumRows(A); - cusparseDnVecDescr_t vecX = hypre_VectorToCusparseDnVec(x, 0, x_size_override); - cusparseDnVecDescr_t vecY = hypre_VectorToCusparseDnVec(y, offset, y_size_override - offset); - - HYPRE_CUSPARSE_CALL( cusparseSpMV_bufferSize(handle, - CUSPARSE_OPERATION_NON_TRANSPOSE, - &alpha, - matA, - vecX, - &beta, - vecY, - data_type, - CUSPARSE_CSRMV_ALG2, - &bufferSize) ); - - dBuffer = hypre_TAlloc(char, bufferSize, HYPRE_MEMORY_DEVICE); - - HYPRE_CUSPARSE_CALL( cusparseSpMV(handle, - CUSPARSE_OPERATION_NON_TRANSPOSE, - &alpha, - matA, - vecX, - &beta, - vecY, - data_type, - CUSPARSE_CSRMV_ALG2, - dBuffer) ); - - hypre_SyncCudaComputeStream(hypre_handle()); + /* Create cuSPARSE vector data structures */ + matA = hypre_CSRMatrixToCusparseSpMat(B, offset); + if (num_vectors == 1) + { + vecX = hypre_VectorToCusparseDnVec(x, 0, num_cols); + vecY = hypre_VectorToCusparseDnVec(y, offset, num_rows - offset); + } + else + { + matX = hypre_VectorToCusparseDnMat(x); + matY = hypre_VectorToCusparseDnMat(y); + } + if (!dBuffer) + { + if (num_vectors == 1) + { + HYPRE_CUSPARSE_CALL( cusparseSpMV_bufferSize(handle, + CUSPARSE_OPERATION_NON_TRANSPOSE, + &alpha, + matA, + vecX, + &beta, + vecY, + data_type, + HYPRE_CUSPARSE_SPMV_ALG, + &bufferSize) ); + } + else + { + HYPRE_CUSPARSE_CALL( cusparseSpMM_bufferSize(handle, + CUSPARSE_OPERATION_NON_TRANSPOSE, + CUSPARSE_OPERATION_NON_TRANSPOSE, + &alpha, + matA, + matX, + &beta, + matY, + data_type, + HYPRE_CUSPARSE_SPMM_ALG, + &bufferSize) ); + } + + dBuffer = hypre_TAlloc(char, bufferSize, HYPRE_MEMORY_DEVICE); + hypre_CSRMatrixGPUMatSpMVBuffer(A) = dBuffer; + +#if CUSPARSE_VERSION >= CUSPARSE_NEWSPMM_VERSION + if (num_vectors > 1) + { + HYPRE_CUSPARSE_CALL( cusparseSpMM_preprocess(handle, + CUSPARSE_OPERATION_NON_TRANSPOSE, + CUSPARSE_OPERATION_NON_TRANSPOSE, + &alpha, + matA, + matX, + &beta, + matY, + data_type, + HYPRE_CUSPARSE_SPMM_ALG, + dBuffer) ); + } +#endif + } + + if (num_vectors == 1) + { + HYPRE_CUSPARSE_CALL( cusparseSpMV(handle, + CUSPARSE_OPERATION_NON_TRANSPOSE, + &alpha, + matA, + vecX, + &beta, + vecY, + data_type, + HYPRE_CUSPARSE_SPMV_ALG, + dBuffer) ); + } + else + { + HYPRE_CUSPARSE_CALL( cusparseSpMM(handle, + CUSPARSE_OPERATION_NON_TRANSPOSE, + CUSPARSE_OPERATION_NON_TRANSPOSE, + &alpha, + matA, + matX, + &beta, + matY, + data_type, + HYPRE_CUSPARSE_SPMM_ALG, + dBuffer) ); + } + +#if defined(HYPRE_USING_GPU) + hypre_SyncComputeStream(); +#endif + + /* Free memory */ + HYPRE_CUSPARSE_CALL( cusparseDestroySpMat(matA) ); + if (num_vectors == 1) + { + HYPRE_CUSPARSE_CALL( cusparseDestroyDnVec(vecX) ); + HYPRE_CUSPARSE_CALL( cusparseDestroyDnVec(vecY) ); + } + else + { + HYPRE_CUSPARSE_CALL( cusparseDestroyDnMat(matX) ); + HYPRE_CUSPARSE_CALL( cusparseDestroyDnMat(matY) ); + } if (trans) { hypre_CSRMatrixDestroy(AT); } - hypre_TFree(dBuffer, HYPRE_MEMORY_DEVICE); - /* This function releases the host memory allocated for the sparse matrix descriptor */ - HYPRE_CUSPARSE_CALL(cusparseDestroySpMat(matA)); - HYPRE_CUSPARSE_CALL(cusparseDestroyDnVec(vecX)); - HYPRE_CUSPARSE_CALL(cusparseDestroyDnVec(vecY)); return hypre_error_flag; } @@ -225,20 +365,19 @@ hypre_CSRMatrixMatvecCusparseOldAPI( HYPRE_Int trans, B = A; } - HYPRE_CUSPARSE_CALL( cusparseDcsrmv(handle, - CUSPARSE_OPERATION_NON_TRANSPOSE, - hypre_CSRMatrixNumRows(B) - offset, - hypre_CSRMatrixNumCols(B), - hypre_CSRMatrixNumNonzeros(B), - &alpha, - descr, - hypre_CSRMatrixData(B), - hypre_CSRMatrixI(B) + offset, - hypre_CSRMatrixJ(B), - hypre_VectorData(x), - &beta, - hypre_VectorData(y) + offset) ); - + HYPRE_CUSPARSE_CALL( hypre_cusparse_csrmv(handle, + CUSPARSE_OPERATION_NON_TRANSPOSE, + hypre_CSRMatrixNumRows(B) - offset, + hypre_CSRMatrixNumCols(B), + hypre_CSRMatrixNumNonzeros(B), + &alpha, + descr, + hypre_CSRMatrixData(B), + hypre_CSRMatrixI(B) + offset, + hypre_CSRMatrixJ(B), + hypre_VectorData(x), + &beta, + hypre_VectorData(y) + offset) ); if (trans) { @@ -249,6 +388,32 @@ hypre_CSRMatrixMatvecCusparseOldAPI( HYPRE_Int trans, } #endif // #if CUSPARSE_VERSION >= CUSPARSE_NEWAPI_VERSION + +HYPRE_Int +hypre_CSRMatrixMatvecCusparse( HYPRE_Int trans, + HYPRE_Complex alpha, + hypre_CSRMatrix *A, + hypre_Vector *x, + HYPRE_Complex beta, + hypre_Vector *y, + HYPRE_Int offset ) +{ +#if CUSPARSE_VERSION >= CUSPARSE_NEWAPI_VERSION + /* Luke E: The generic API is techinically supported on 10.1,10.2 as a preview, + * with Dscrmv being deprecated. However, there are limitations. + * While in Cuda < 11, there are specific mentions of using csr2csc involving + * transposed matrix products with dcsrm*, + * they are not present in SpMV interface. + */ + hypre_CSRMatrixMatvecCusparseNewAPI(trans, alpha, A, x, beta, y, offset); + +#else + hypre_CSRMatrixMatvecCusparseOldAPI(trans, alpha, A, x, beta, y, offset); +#endif + + return hypre_error_flag; +} + #endif // #if defined(HYPRE_USING_CUSPARSE) #if defined(HYPRE_USING_ROCSPARSE) @@ -276,20 +441,20 @@ hypre_CSRMatrixMatvecRocsparse( HYPRE_Int trans, B = A; } - HYPRE_ROCSPARSE_CALL( rocsparse_dcsrmv(handle, - rocsparse_operation_none, - hypre_CSRMatrixNumRows(B) - offset, - hypre_CSRMatrixNumCols(B), - hypre_CSRMatrixNumNonzeros(B), - &alpha, - descr, - hypre_CSRMatrixData(B), - hypre_CSRMatrixI(B) + offset, - hypre_CSRMatrixJ(B), - info, - hypre_VectorData(x), - &beta, - hypre_VectorData(y) + offset) ); + HYPRE_ROCSPARSE_CALL( hypre_rocsparse_csrmv(handle, + rocsparse_operation_none, + hypre_CSRMatrixNumRows(B) - offset, + hypre_CSRMatrixNumCols(B), + hypre_CSRMatrixNumNonzeros(B), + &alpha, + descr, + hypre_CSRMatrixData(B), + hypre_CSRMatrixI(B) + offset, + hypre_CSRMatrixJ(B), + info, + hypre_VectorData(x), + &beta, + hypre_VectorData(y) + offset) ); if (trans) { @@ -300,5 +465,43 @@ hypre_CSRMatrixMatvecRocsparse( HYPRE_Int trans, } #endif // #if defined(HYPRE_USING_ROCSPARSE) -#endif // #if defined(HYPRE_USING_GPU) +#if defined(HYPRE_USING_ONEMKLSPARSE) +HYPRE_Int +hypre_CSRMatrixMatvecOnemklsparse( HYPRE_Int trans, + HYPRE_Complex alpha, + hypre_CSRMatrix *A, + hypre_Vector *x, + HYPRE_Complex beta, + hypre_Vector *y, + HYPRE_Int offset ) +{ + sycl::queue *compute_queue = hypre_HandleComputeStream(hypre_handle()); + hypre_CSRMatrix *AT; + oneapi::mkl::sparse::matrix_handle_t matA_handle = hypre_CSRMatrixGPUMatHandle(A); + hypre_GPUMatDataSetCSRData(A); + + if (trans) + { + hypre_CSRMatrixTransposeDevice(A, &AT, 1); + hypre_GPUMatDataSetCSRData(AT); + matA_handle = hypre_CSRMatrixGPUMatHandle(AT); + } + + HYPRE_ONEMKL_CALL( oneapi::mkl::sparse::gemv(*compute_queue, + oneapi::mkl::transpose::nontrans, + alpha, + matA_handle, + hypre_VectorData(x), + beta, + hypre_VectorData(y) + offset).wait() ); + + if (trans) + { + hypre_CSRMatrixDestroy(AT); + } + + return hypre_error_flag; +} +#endif // #if defined(HYPRE_USING_ROCSPARSE) +#endif // #if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) diff --git a/external/hypre/src/seq_mv/csr_matvec_oomp.c b/external/hypre/src/seq_mv/csr_matvec_oomp.c index 46d6770f..75aec4d2 100644 --- a/external/hypre/src/seq_mv/csr_matvec_oomp.c +++ b/external/hypre/src/seq_mv/csr_matvec_oomp.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -34,9 +34,9 @@ hypre_CSRMatrixMatvecOMPOffload( HYPRE_Int trans, if (trans) { - hypre_CSRMatrixTransposeDevice(A, &B, 1); + hypre_CSRMatrixTranspose(A, &B, 1); - HYPRE_CUDA_CALL(cudaDeviceSynchronize()); + /* HYPRE_CUDA_CALL(cudaDeviceSynchronize()); */ } else { @@ -51,16 +51,16 @@ hypre_CSRMatrixMatvecOMPOffload( HYPRE_Int trans, HYPRE_Complex *y_data = hypre_VectorData(y); HYPRE_Int i; -#pragma omp target teams distribute parallel for private(i) is_device_ptr(A_data, A_i, A_j, y_data, x_data) + #pragma omp target teams distribute parallel for private(i) is_device_ptr(A_data, A_i, A_j, y_data, x_data) for (i = offset; i < A_nrows; i++) { HYPRE_Complex tempx = 0.0; HYPRE_Int j; - for (j = A_i[i]; j < A_i[i+1]; j++) + for (j = A_i[i]; j < A_i[i + 1]; j++) { tempx += A_data[j] * x_data[A_j[j]]; } - y_data[i] = alpha*tempx + beta*y_data[i]; + y_data[i] = alpha * tempx + beta * y_data[i]; } /* HYPRE_CUDA_CALL(cudaDeviceSynchronize()); */ diff --git a/external/hypre/src/seq_mv/csr_spadd_device.c b/external/hypre/src/seq_mv/csr_spadd_device.c index 79b9d2bb..e080a14b 100644 --- a/external/hypre/src/seq_mv/csr_spadd_device.c +++ b/external/hypre/src/seq_mv/csr_spadd_device.c @@ -1,20 +1,21 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ +#include "_hypre_onedpl.hpp" #include "seq_mv.h" #include "_hypre_utilities.hpp" -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) /* This function effectively does (in Matlab notation) * C := alpha * A(:, a_colmap) * C(num_b, :) += beta * B(:, b_colmap) * - * if num_b != NULL: A is ma x n and B is mb x n. len(num_b) == mb. + * if num_b != NULL: A is ma x n and B is mb x n. len(num_b) == mb. * All numbers in num_b must be in [0,...,ma-1] * * if num_b == NULL: C = alpha * A + beta * B. ma == mb @@ -24,7 +25,6 @@ HYPRE_Int hypreDevice_CSRSpAdd( HYPRE_Int ma, /* num of rows of A */ HYPRE_Int mb, /* num of rows of B */ - HYPRE_Int n, /* not used actually */ HYPRE_Int nnzA, HYPRE_Int nnzB, HYPRE_Int *d_ia, @@ -66,7 +66,8 @@ hypreDevice_CSRSpAdd( HYPRE_Int ma, /* num of rows of A */ /* some trick here for memory alignment. maybe not worth it at all */ HYPRE_Int align = 32; HYPRE_Int nnzT2 = (nnzT + align - 1) / align * align; - char *work_mem = hypre_TAlloc(char, (4*sizeof(HYPRE_Int)+2*sizeof(HYPRE_Complex))*nnzT2, HYPRE_MEMORY_DEVICE); + char *work_mem = hypre_TAlloc(char, (4 * sizeof(HYPRE_Int) + 2 * sizeof(HYPRE_Complex)) * nnzT2, + HYPRE_MEMORY_DEVICE); char *work_mem_saved = work_mem; //d_it = hypre_TAlloc(HYPRE_Int, nnzT, HYPRE_MEMORY_DEVICE); @@ -82,7 +83,11 @@ hypreDevice_CSRSpAdd( HYPRE_Int ma, /* num of rows of A */ /* expansion: j */ if (d_ja_map) { +#if defined(HYPRE_USING_SYCL) + hypreSycl_gather(d_ja, d_ja + nnzA, d_ja_map, d_jt); +#else HYPRE_THRUST_CALL(gather, d_ja, d_ja + nnzA, d_ja_map, d_jt); +#endif } else { @@ -90,7 +95,11 @@ hypreDevice_CSRSpAdd( HYPRE_Int ma, /* num of rows of A */ } if (d_jb_map) { +#if defined(HYPRE_USING_SYCL) + hypreSycl_gather(d_jb, d_jb + nnzB, d_jb_map, d_jt + nnzA); +#else HYPRE_THRUST_CALL(gather, d_jb, d_jb + nnzB, d_jb_map, d_jt + nnzA); +#endif } else { @@ -104,7 +113,7 @@ hypreDevice_CSRSpAdd( HYPRE_Int ma, /* num of rows of A */ } else { - HYPRE_THRUST_CALL( transform, d_aa, d_aa + nnzA, d_at, alpha * _1 ); + hypreDevice_ComplexScalen( d_aa, nnzA, d_at, alpha ); } if (beta == 1.0) @@ -113,7 +122,7 @@ hypreDevice_CSRSpAdd( HYPRE_Int ma, /* num of rows of A */ } else { - HYPRE_THRUST_CALL( transform, d_ab, d_ab + nnzB, d_at + nnzA, beta * _1 ); + hypreDevice_ComplexScalen( d_ab, nnzB, d_at + nnzA, beta ); } /* expansion: i */ @@ -139,7 +148,8 @@ hypreDevice_CSRSpAdd( HYPRE_Int ma, /* num of rows of A */ d_at_cp = (HYPRE_Complex *) work_mem; work_mem += sizeof(HYPRE_Complex) * nnzT2; - hypre_assert( (size_t) (work_mem - work_mem_saved) == (4*sizeof(HYPRE_Int)+2*sizeof(HYPRE_Complex))*((size_t)nnzT2) ); + hypre_assert( (size_t) (work_mem - work_mem_saved) == (4 * sizeof(HYPRE_Int) + 2 * sizeof( + HYPRE_Complex)) * ((size_t)nnzT2) ); /* sort: lexicographical order (row, col): hypreDevice_StableSortByTupleKey */ hypreDevice_StableSortByTupleKey(nnzT, d_it, d_jt, d_at, 0); @@ -180,11 +190,10 @@ hypreDevice_CSRSpAdd( HYPRE_Int ma, /* num of rows of A */ *d_ac_out = d_ac; #ifdef HYPRE_PROFILE - cudaThreadSynchronize(); hypre_profile_times[HYPRE_TIMER_ID_SPADD] += hypre_MPI_Wtime(); #endif return hypre_error_flag; } -#endif // defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#endif // defined(HYPRE_USING_GPU) diff --git a/external/hypre/src/seq_mv/csr_spgemm_device.c b/external/hypre/src/seq_mv/csr_spgemm_device.c index a64da36e..877be714 100644 --- a/external/hypre/src/seq_mv/csr_spgemm_device.c +++ b/external/hypre/src/seq_mv/csr_spgemm_device.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -9,9 +9,7 @@ #include "csr_spgemm_device.h" #include "seq_mv.hpp" -//#define HYPRE_SPGEMM_TIMING - -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) HYPRE_Int hypreDevice_CSRSpGemm(hypre_CSRMatrix *A, @@ -34,10 +32,6 @@ hypreDevice_CSRSpGemm(hypre_CSRMatrix *A, HYPRE_Int *d_jc; HYPRE_Int nnzC; hypre_CSRMatrix *C; -#ifdef HYPRE_SPGEMM_TIMING - HYPRE_Real t1, t2; - HYPRE_Real ta, tb; -#endif *C_ptr = C = hypre_CSRMatrixCreate(m, n, 0); hypre_CSRMatrixMemoryLocation(C) = HYPRE_MEMORY_DEVICE; @@ -51,15 +45,16 @@ hypreDevice_CSRSpGemm(hypre_CSRMatrix *A, } #ifdef HYPRE_PROFILE - hypre_profile_times[HYPRE_TIMER_ID_SPMM] -= hypre_MPI_Wtime(); + hypre_profile_times[HYPRE_TIMER_ID_SPGEMM] -= hypre_MPI_Wtime(); #endif #ifdef HYPRE_SPGEMM_TIMING - ta = hypre_MPI_Wtime(); + hypre_ForceSyncComputeStream(); + HYPRE_Real ta = hypre_MPI_Wtime(); #endif /* use CUSPARSE or rocSPARSE*/ - if (hypre_HandleSpgemmUseCusparse(hypre_handle())) + if (hypre_HandleSpgemmUseVendor(hypre_handle())) { #if defined(HYPRE_USING_CUSPARSE) hypreDevice_CSRSpGemmCusparse(m, k, n, @@ -71,112 +66,59 @@ hypreDevice_CSRSpGemm(hypre_CSRMatrix *A, hypre_CSRMatrixGPUMatDescr(A), nnza, d_ia, d_ja, d_a, hypre_CSRMatrixGPUMatDescr(B), nnzb, d_ib, d_jb, d_b, hypre_CSRMatrixGPUMatDescr(C), hypre_CSRMatrixGPUMatInfo(C), &nnzC, &d_ic, &d_jc, &d_c); +#elif defined(HYPRE_USING_ONEMKLSPARSE) + hypreDevice_CSRSpGemmOnemklsparse( m, k, n, + hypre_CSRMatrixGPUMatHandle(A), nnza, d_ia, d_ja, d_a, + hypre_CSRMatrixGPUMatHandle(B), nnzb, d_ib, d_jb, d_b, + hypre_CSRMatrixGPUMatHandle(C), &nnzC, &d_ic, &d_jc, &d_c); #else - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"Attempting to use device sparse matrix library for SpGEMM without having compiled support for it!\n"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "Attempting to use device sparse matrix library for SpGEMM without having compiled support for it!\n"); #endif } else { - HYPRE_Int *d_rc = NULL; - - if (hypre_HandleSpgemmAlgorithm(hypre_handle()) == 1) - { - d_rc = hypre_TAlloc(HYPRE_Int, 2*m, HYPRE_MEMORY_DEVICE); + d_a = hypre_CSRMatrixPatternOnly(A) ? NULL : d_a; + d_b = hypre_CSRMatrixPatternOnly(B) ? NULL : d_b; -#ifdef HYPRE_SPGEMM_TIMING - t1 = hypre_MPI_Wtime(); -#endif - hypreDevice_CSRSpGemmRownnz(m, k, n, d_ia, d_ja, d_ib, d_jb, 0 /* without input rc */, d_rc); -#ifdef HYPRE_SPGEMM_TIMING - hypre_SyncCudaComputeStream(hypre_handle()); - t2 = hypre_MPI_Wtime() - t1; - hypre_printf("Rownnz time %f\n", t2); -#endif + HYPRE_Int *d_rc = hypre_TAlloc(HYPRE_Int, m, HYPRE_MEMORY_DEVICE); + const HYPRE_Int alg = hypre_HandleSpgemmAlgorithm(hypre_handle()); -#ifdef HYPRE_SPGEMM_TIMING - t1 = hypre_MPI_Wtime(); -#endif - hypreDevice_CSRSpGemmNumerWithRownnzUpperbound(m, k, n, d_ia, d_ja, d_a, d_ib, d_jb, d_b, d_rc, 1 /* exact row nnz */, - &d_ic, &d_jc, &d_c, &nnzC); -#ifdef HYPRE_SPGEMM_TIMING - hypre_SyncCudaComputeStream(hypre_handle()); - t2 = hypre_MPI_Wtime() - t1; - hypre_printf("SpGemmNumerical time %f\n", t2); -#endif - } - else if (hypre_HandleSpgemmAlgorithm(hypre_handle()) == 2) + if (hypre_HandleSpgemmNumBin(hypre_handle()) == 0) { - d_rc = hypre_TAlloc(HYPRE_Int, 2*m, HYPRE_MEMORY_DEVICE); + hypreDevice_CSRSpGemmBinnedGetBlockNumDim(); + } -#ifdef HYPRE_SPGEMM_TIMING - t1 = hypre_MPI_Wtime(); -#endif - hypreDevice_CSRSpGemmRownnzEstimate(m, k, n, d_ia, d_ja, d_ib, d_jb, d_rc); -#ifdef HYPRE_SPGEMM_TIMING - hypre_SyncCudaComputeStream(hypre_handle()); - t2 = hypre_MPI_Wtime() - t1; - hypre_printf("RownnzEst time %f\n", t2); -#endif + if (alg == 1) + { + hypreDevice_CSRSpGemmRownnz + (m, k, n, nnza, d_ia, d_ja, d_ib, d_jb, 0 /* without input rc */, d_rc); -#ifdef HYPRE_SPGEMM_TIMING - t1 = hypre_MPI_Wtime(); -#endif - hypreDevice_CSRSpGemmNumerWithRownnzEstimate(m, k, n, d_ia, d_ja, d_a, d_ib, d_jb, d_b, d_rc, - &d_ic, &d_jc, &d_c, &nnzC); -#ifdef HYPRE_SPGEMM_TIMING - hypre_SyncCudaComputeStream(hypre_handle()); - t2 = hypre_MPI_Wtime() - t1; - hypre_printf("SpGemmNumerical time %f\n", t2); -#endif + hypreDevice_CSRSpGemmNumerWithRownnzUpperbound + (m, k, n, d_ia, d_ja, d_a, d_ib, d_jb, d_b, d_rc, 1, &d_ic, &d_jc, &d_c, &nnzC); } - else + else /* if (alg == 3) */ { - d_rc = hypre_TAlloc(HYPRE_Int, 2*m, HYPRE_MEMORY_DEVICE); + const HYPRE_Int row_est_mtd = hypre_HandleSpgemmRownnzEstimateMethod(hypre_handle()); -#ifdef HYPRE_SPGEMM_TIMING - t1 = hypre_MPI_Wtime(); -#endif - hypreDevice_CSRSpGemmRownnzEstimate(m, k, n, d_ia, d_ja, d_ib, d_jb, d_rc); -#ifdef HYPRE_SPGEMM_TIMING - hypre_SyncCudaComputeStream(hypre_handle()); - t2 = hypre_MPI_Wtime() - t1; - hypre_printf("RownnzEst time %f\n", t2); -#endif + hypreDevice_CSRSpGemmRownnzEstimate(m, k, n, d_ia, d_ja, d_ib, d_jb, d_rc, row_est_mtd); -#ifdef HYPRE_SPGEMM_TIMING - t1 = hypre_MPI_Wtime(); -#endif - hypreDevice_CSRSpGemmRownnzUpperbound(m, k, n, d_ia, d_ja, d_ib, d_jb, 1 /* with input rc */, d_rc, d_rc + m); + HYPRE_Int rownnz_exact; - /* row nnz is exact if no row failed */ - HYPRE_Int rownnz_exact = !HYPRE_THRUST_CALL( any_of, - d_rc + m, - d_rc + 2*m, - thrust::identity() ); -#ifdef HYPRE_SPGEMM_TIMING - hypre_SyncCudaComputeStream(hypre_handle()); - t2 = hypre_MPI_Wtime() - t1; - hypre_printf("RownnzBound time %f\n", t2); -#endif + hypreDevice_CSRSpGemmRownnzUpperbound + (m, k, n, d_ia, d_ja, d_ib, d_jb, 1 /* with input rc */, d_rc, &rownnz_exact); -#ifdef HYPRE_SPGEMM_TIMING - t1 = hypre_MPI_Wtime(); -#endif - hypreDevice_CSRSpGemmNumerWithRownnzUpperbound(m, k, n, d_ia, d_ja, d_a, d_ib, d_jb, d_b, d_rc, rownnz_exact, - &d_ic, &d_jc, &d_c, &nnzC); -#ifdef HYPRE_SPGEMM_TIMING - hypre_SyncCudaComputeStream(hypre_handle()); - t2 = hypre_MPI_Wtime() - t1; - hypre_printf("SpGemmNumerical time %f\n", t2); -#endif + hypreDevice_CSRSpGemmNumerWithRownnzUpperbound + (m, k, n, d_ia, d_ja, d_a, d_ib, d_jb, d_b, d_rc, rownnz_exact, &d_ic, &d_jc, &d_c, &nnzC); } hypre_TFree(d_rc, HYPRE_MEMORY_DEVICE); } #ifdef HYPRE_SPGEMM_TIMING - tb = hypre_MPI_Wtime() - ta; - hypre_printf("SpGemm time %f\n", tb); + hypre_ForceSyncComputeStream(); + HYPRE_Real tb = hypre_MPI_Wtime() - ta; + HYPRE_SPGEMM_PRINT("SpGemm time %f\n", tb); #endif hypre_CSRMatrixNumNonzeros(C) = nnzC; @@ -185,12 +127,11 @@ hypreDevice_CSRSpGemm(hypre_CSRMatrix *A, hypre_CSRMatrixData(C) = d_c; #ifdef HYPRE_PROFILE - cudaThreadSynchronize(); - hypre_profile_times[HYPRE_TIMER_ID_SPMM] += hypre_MPI_Wtime(); + hypre_profile_times[HYPRE_TIMER_ID_SPGEMM] += hypre_MPI_Wtime(); #endif return hypre_error_flag; } -#endif /* HYPRE_USING_CUDA || defined(HYPRE_USING_HIP) */ +#endif /* defined(HYPRE_USING_GPU) */ diff --git a/external/hypre/src/seq_mv/csr_spgemm_device.h b/external/hypre/src/seq_mv/csr_spgemm_device.h index aedfa20b..97312fd3 100644 --- a/external/hypre/src/seq_mv/csr_spgemm_device.h +++ b/external/hypre/src/seq_mv/csr_spgemm_device.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -10,41 +10,289 @@ #include "_hypre_utilities.hpp" -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) #define COHEN_USE_SHMEM 0 -/* these are under the assumptions made in spgemm on block sizes: only use in spmm routines - * where we assume CUDA block is 3D and blockDim.x * blockDim.y = WARP_SIZE +static const char HYPRE_SPGEMM_HASH_TYPE = 'D'; + +/* bin settings 0 1 2 3 4 5 6 7 8 9 10 */ +constexpr HYPRE_Int SYMBL_HASH_SIZE[11] = { 0, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384 }; +#if defined(HYPRE_USING_CUDA) +constexpr HYPRE_Int NUMER_HASH_SIZE[11] = { 0, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192 }; +#elif defined(HYPRE_USING_HIP) +constexpr HYPRE_Int NUMER_HASH_SIZE[11] = { 0, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096 }; +#elif defined(HYPRE_USING_SYCL) +constexpr HYPRE_Int NUMER_HASH_SIZE[11] = { 0, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096 }; +#endif +constexpr HYPRE_Int T_GROUP_SIZE[11] = { 0, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024 }; + +#if defined(HYPRE_USING_CUDA) +#define HYPRE_SPGEMM_DEFAULT_BIN 5 +#elif defined(HYPRE_USING_HIP) +#define HYPRE_SPGEMM_DEFAULT_BIN 6 +#elif defined(HYPRE_USING_SYCL) +#define HYPRE_SPGEMM_DEFAULT_BIN 6 +#endif + +/* unroll factor in the kernels */ +#if defined(HYPRE_USING_CUDA) +#define HYPRE_SPGEMM_NUMER_UNROLL 256 +#define HYPRE_SPGEMM_SYMBL_UNROLL 512 +#elif defined(HYPRE_USING_HIP) +#define HYPRE_SPGEMM_NUMER_UNROLL 256 +#define HYPRE_SPGEMM_SYMBL_UNROLL 512 +#elif defined(HYPRE_USING_SYCL) +#define HYPRE_SPGEMM_NUMER_UNROLL 256 +#define HYPRE_SPGEMM_SYMBL_UNROLL 512 +#endif + +//#define HYPRE_SPGEMM_TIMING +//#define HYPRE_SPGEMM_PRINTF +//#define HYPRE_SPGEMM_NVTX + +/* ----------------------------------------------------------------------------------------------- * + * these are under the assumptions made in spgemm on block sizes: only use in csr_spgemm routines + * where we assume CUDA block is 3D and blockDim.x * blockDim.y = GROUP_SIZE + * Note - sycl linearizes indices differently from cuda, i.e. a cuda block with dimensions + * (x, y, z) is equivalent to a sycl nd_range (z, y, x) + *------------------------------------------------------------------------------------------------ */ + +/* the number of groups in block */ +static __device__ __forceinline__ +hypre_int get_num_groups(hypre_DeviceItem &item) +{ +#if defined(HYPRE_USING_SYCL) + return item.get_local_range(0); +#else + return blockDim.z; +#endif +} + +/* the group id in the block */ +static __device__ __forceinline__ +hypre_int get_group_id(hypre_DeviceItem &item) +{ +#if defined(HYPRE_USING_SYCL) + return item.get_local_id(0); +#else + return threadIdx.z; +#endif +} + +/* the thread id (lane) in the group */ +static __device__ __forceinline__ +hypre_int get_group_lane_id(hypre_DeviceItem &item) +{ +#if defined(HYPRE_USING_SYCL) + return item.get_local_id(1) * item.get_local_range(2) + item.get_local_id(2); +#else + return hypre_gpu_get_thread_id<2>(item); +#endif +} + +/* the warp id in the group */ +template +static __device__ __forceinline__ +hypre_int get_warp_in_group_id(hypre_DeviceItem &item) +{ + if (GROUP_SIZE <= HYPRE_WARP_SIZE) + { + return 0; + } + else + { +#if defined(HYPRE_USING_SYCL) + return get_group_lane_id(item) >> HYPRE_WARP_BITSHIFT; +#else + return hypre_gpu_get_warp_id<2>(item); +#endif + } +} + +/* group reads 2 values from ptr to v1 and v2 + * GROUP_SIZE must be >= 2 */ +template static __device__ __forceinline__ -hypre_int get_block_size() +void group_read(hypre_DeviceItem &item, const HYPRE_Int *ptr, bool valid_ptr, HYPRE_Int &v1, + HYPRE_Int &v2) { - //return (blockDim.x * blockDim.y * blockDim.z); // in general cases - return (HYPRE_WARP_SIZE * blockDim.z); // if blockDim.x * blockDim.y = WARP_SIZE + if (GROUP_SIZE >= HYPRE_WARP_SIZE) + { + /* lane = warp_lane + * Note: use "2" since assume HYPRE_WARP_SIZE divides (blockDim.x * blockDim.y) */ +#if defined(HYPRE_USING_SYCL) + const HYPRE_Int lane = get_group_lane_id(item) & (HYPRE_WARP_SIZE - 1); +#else + const HYPRE_Int lane = hypre_gpu_get_lane_id<2>(item); +#endif + + if (lane < 2) + { + v1 = read_only_load(ptr + lane); + } + v2 = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, v1, 1); + v1 = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, v1, 0); + } + else + { + /* lane = group_lane */ + const HYPRE_Int lane = get_group_lane_id(item); + + if (valid_ptr && lane < 2) + { + v1 = read_only_load(ptr + lane); + } + v2 = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, v1, 1, GROUP_SIZE); + v1 = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, v1, 0, GROUP_SIZE); + } +} + +/* group reads a value from ptr to v1 + * GROUP_SIZE must be >= 2 + */ +template +static __device__ __forceinline__ +void group_read(hypre_DeviceItem &item, const HYPRE_Int *ptr, bool valid_ptr, HYPRE_Int &v1) +{ + if (GROUP_SIZE >= HYPRE_WARP_SIZE) + { + /* lane = warp_lane + * Note: use "2" since assume HYPRE_WARP_SIZE divides (blockDim.x * blockDim.y) */ +#if defined(HYPRE_USING_SYCL) + const HYPRE_Int lane = get_group_lane_id(item) & (HYPRE_WARP_SIZE - 1); +#else + const HYPRE_Int lane = hypre_gpu_get_lane_id<2>(item); +#endif + + if (!lane) + { + v1 = read_only_load(ptr); + } + v1 = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, v1, 0); + } + else + { + /* lane = group_lane */ + const HYPRE_Int lane = get_group_lane_id(item); + + if (valid_ptr && !lane) + { + v1 = read_only_load(ptr); + } + v1 = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, v1, 0, GROUP_SIZE); + } } +template static __device__ __forceinline__ -hypre_int get_thread_id() +T group_reduce_sum(hypre_DeviceItem &item, T in) { - //return (threadIdx.z * blockDim.x * blockDim.y + threadIdx.y * blockDim.x + threadIdx.x); // in general cases - return (threadIdx.z * HYPRE_WARP_SIZE + threadIdx.y * blockDim.x + threadIdx.x); // if blockDim.x * blockDim.y = WARP_SIZE +#if defined(HYPRE_DEBUG) + hypre_device_assert(GROUP_SIZE <= HYPRE_WARP_SIZE); +#endif + +#pragma unroll + for (hypre_int d = GROUP_SIZE / 2; d > 0; d >>= 1) + { + in += warp_shuffle_down_sync(item, HYPRE_WARP_FULL_MASK, in, d); + } + + return in; } +/* s_WarpData[NUM_GROUPS_PER_BLOCK * GROUP_SIZE / HYPRE_WARP_SIZE] */ +template static __device__ __forceinline__ -hypre_int get_warp_id() +T group_reduce_sum(hypre_DeviceItem &item, T in, volatile T *s_WarpData) { - // return get_thread_id() >> HYPRE_WARP_BITSHIFT; // in general cases - return threadIdx.z; // if blockDim.x * blockDim.y = WARP_SIZE +#if defined(HYPRE_DEBUG) + hypre_device_assert(GROUP_SIZE > HYPRE_WARP_SIZE); +#endif + + T out = warp_reduce_sum(item, in); + +#if defined(HYPRE_USING_SYCL) + const HYPRE_Int warp_lane_id = get_group_lane_id(item) & (HYPRE_WARP_SIZE - 1); +#else + const HYPRE_Int warp_lane_id = hypre_gpu_get_lane_id<2>(item); +#endif + const HYPRE_Int warp_id = hypre_gpu_get_warp_id<3>(item); + + if (warp_lane_id == 0) + { + s_WarpData[warp_id] = out; + } + + block_sync(item); + + if (get_warp_in_group_id(item) == 0) + { + const T a = warp_lane_id < GROUP_SIZE / HYPRE_WARP_SIZE ? s_WarpData[warp_id + warp_lane_id] : 0.0; + out = warp_reduce_sum(item, a); + } + + block_sync(item); + + return out; } +/* GROUP_SIZE must <= HYPRE_WARP_SIZE */ +template static __device__ __forceinline__ -hypre_int get_lane_id() +T group_prefix_sum(hypre_DeviceItem &item, hypre_int lane_id, T in, T &all_sum) { - // return get_thread_id() & (WARP_SIZE-1); // in general cases - return threadIdx.y * blockDim.x + threadIdx.x; // if blockDim.x * blockDim.y = WARP_SIZE +#pragma unroll + for (hypre_int d = 2; d <= GROUP_SIZE; d <<= 1) + { + T t = warp_shuffle_up_sync(item, HYPRE_WARP_FULL_MASK, in, d >> 1, GROUP_SIZE); + if ( (lane_id & (d - 1)) == (d - 1) ) + { + in += t; + } + } + + all_sum = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, in, GROUP_SIZE - 1, GROUP_SIZE); + + if (lane_id == GROUP_SIZE - 1) + { + in = 0; + } + +#pragma unroll + for (hypre_int d = GROUP_SIZE >> 1; d > 0; d >>= 1) + { + T t = warp_shuffle_xor_sync(item, HYPRE_WARP_FULL_MASK, in, d, GROUP_SIZE); + + if ( (lane_id & (d - 1)) == (d - 1)) + { + if ( (lane_id & ((d << 1) - 1)) == ((d << 1) - 1) ) + { + in += t; + } + else + { + in = t; + } + } + } + return in; } +template +static __device__ __forceinline__ +void group_sync(hypre_DeviceItem &item) +{ + if (GROUP_SIZE <= HYPRE_WARP_SIZE) + { + warp_sync(item); + } + else + { + block_sync(item); + } +} /* Hash functions */ static __device__ __forceinline__ @@ -55,24 +303,24 @@ HYPRE_Int Hash2Func(HYPRE_Int key) return ( (key >> 6) | 1 ); } -template +template static __device__ __forceinline__ HYPRE_Int HashFunc(HYPRE_Int m, HYPRE_Int key, HYPRE_Int i, HYPRE_Int prev) { HYPRE_Int hashval = 0; /* assume m is power of 2 */ - if (type == 'L') + if (HASHTYPE == 'L') { //hashval = (key + i) % m; hashval = ( prev + 1 ) & (m - 1); } - else if (type == 'Q') + else if (HASHTYPE == 'Q') { //hashval = (key + (i + i*i)/2) & (m-1); hashval = ( prev + i ) & (m - 1); } - else if (type == 'D') + else if (HASHTYPE == 'D') { //hashval = (key + i*Hash2Func(key) ) & (m - 1); hashval = ( prev + Hash2Func(key) ) & (m - 1); @@ -81,9 +329,143 @@ HYPRE_Int HashFunc(HYPRE_Int m, HYPRE_Int key, HYPRE_Int i, HYPRE_Int prev) return hashval; } -void hypre_create_ija( HYPRE_Int m, HYPRE_Int *d_c, HYPRE_Int *d_i, HYPRE_Int **d_j, HYPRE_Complex **d_a, HYPRE_Int *nnz ); +template +static __device__ __forceinline__ +HYPRE_Int HashFunc(HYPRE_Int key, HYPRE_Int i, HYPRE_Int prev) +{ + HYPRE_Int hashval = 0; -HYPRE_Int hypre_SpGemmCreateGlobalHashTable( HYPRE_Int num_rows, HYPRE_Int *row_id, HYPRE_Int num_ghash, HYPRE_Int *row_sizes, HYPRE_Int SHMEM_HASH_SIZE, HYPRE_Int **ghash_i_ptr, HYPRE_Int **ghash_j_ptr, HYPRE_Complex **ghash_a_ptr, HYPRE_Int *ghash_size_ptr, HYPRE_Int type); + /* assume m is power of 2 */ + if (HASHTYPE == 'L') + { + //hashval = (key + i) % SHMEM_HASH_SIZE; + hashval = ( prev + 1 ) & (SHMEM_HASH_SIZE - 1); + } + else if (HASHTYPE == 'Q') + { + //hashval = (key + (i + i*i)/2) & (SHMEM_HASH_SIZE-1); + hashval = ( prev + i ) & (SHMEM_HASH_SIZE - 1); + } + else if (HASHTYPE == 'D') + { + //hashval = (key + i*Hash2Func(key) ) & (SHMEM_HASH_SIZE - 1); + hashval = ( prev + Hash2Func(key) ) & (SHMEM_HASH_SIZE - 1); + } -#endif /* HYPRE_USING_CUDA || defined(HYPRE_USING_HIP) */ + return hashval; +} + +template +#if (defined(THRUST_VERSION) && THRUST_VERSION < 101000) +struct spgemm_bin_op : public thrust::unary_function +#else +struct spgemm_bin_op +#endif +{ + char s, t, u; /* s: base size of bins; t: lowest bin; u: highest bin */ + + spgemm_bin_op(char s_, char t_, char u_) { s = s_; t = t_; u = u_; } + + __device__ char operator()(const T &x) const + { + if (x <= 0) + { + return 0; + } + + const T y = (x + s - 1) / s; + + if ( y <= (1 << (t - 1)) ) + { + return t; + } + + for (char i = t; i < u - 1; i++) + { + if (y <= (1 << i)) + { + return i + 1; + } + } + + return u; + } +}; + +void hypre_create_ija(HYPRE_Int m, HYPRE_Int *row_id, HYPRE_Int *d_c, HYPRE_Int *d_i, + HYPRE_Int **d_j, HYPRE_Complex **d_a, HYPRE_Int *nnz_ptr ); + +void hypre_create_ija(HYPRE_Int SHMEM_HASH_SIZE, HYPRE_Int m, HYPRE_Int *row_id, HYPRE_Int *d_c, + HYPRE_Int *d_i, HYPRE_Int **d_j, HYPRE_Complex **d_a, HYPRE_Int *nnz_ptr ); + +HYPRE_Int hypre_SpGemmCreateGlobalHashTable( HYPRE_Int num_rows, HYPRE_Int *row_id, + HYPRE_Int num_ghash, HYPRE_Int *row_sizes, HYPRE_Int SHMEM_HASH_SIZE, HYPRE_Int **ghash_i_ptr, + HYPRE_Int **ghash_j_ptr, HYPRE_Complex **ghash_a_ptr, HYPRE_Int *ghash_size_ptr); + +HYPRE_Int hypreDevice_CSRSpGemmRownnzEstimate(HYPRE_Int m, HYPRE_Int k, HYPRE_Int n, + HYPRE_Int *d_ia, HYPRE_Int *d_ja, HYPRE_Int *d_ib, HYPRE_Int *d_jb, HYPRE_Int *d_rc, + HYPRE_Int row_est_mtd); + +HYPRE_Int hypreDevice_CSRSpGemmRownnzUpperbound(HYPRE_Int m, HYPRE_Int k, HYPRE_Int n, + HYPRE_Int *d_ia, HYPRE_Int *d_ja, HYPRE_Int *d_ib, HYPRE_Int *d_jb, HYPRE_Int in_rc, + HYPRE_Int *d_rc, HYPRE_Int *rownnz_exact_ptr); + +HYPRE_Int hypreDevice_CSRSpGemmRownnz(HYPRE_Int m, HYPRE_Int k, HYPRE_Int n, HYPRE_Int nnzA, + HYPRE_Int *d_ia, + HYPRE_Int *d_ja, HYPRE_Int *d_ib, HYPRE_Int *d_jb, HYPRE_Int in_rc, HYPRE_Int *d_rc); + +HYPRE_Int hypreDevice_CSRSpGemmNumerWithRownnzUpperbound(HYPRE_Int m, HYPRE_Int k, HYPRE_Int n, + HYPRE_Int *d_ia, HYPRE_Int *d_ja, HYPRE_Complex *d_a, HYPRE_Int *d_ib, HYPRE_Int *d_jb, + HYPRE_Complex *d_b, HYPRE_Int *d_rc, HYPRE_Int exact_rownnz, HYPRE_Int **d_ic_out, + HYPRE_Int **d_jc_out, HYPRE_Complex **d_c_out, HYPRE_Int *nnzC); + +HYPRE_Int hypre_SpGemmCreateBins( HYPRE_Int m, char s, char t, char u, HYPRE_Int *d_rc, + bool d_rc_indice_in, HYPRE_Int *d_rc_indice, HYPRE_Int *h_bin_ptr ); + +template +HYPRE_Int hypre_spgemm_symbolic_rownnz( HYPRE_Int m, HYPRE_Int *row_ind, HYPRE_Int k, HYPRE_Int n, + bool need_ghash, HYPRE_Int *d_ia, HYPRE_Int *d_ja, HYPRE_Int *d_ib, HYPRE_Int *d_jb, + HYPRE_Int *d_rc, bool can_fail, char *d_rf ); + +template +HYPRE_Int hypre_spgemm_numerical_with_rownnz( HYPRE_Int m, HYPRE_Int *row_ind, HYPRE_Int k, + HYPRE_Int n, bool need_ghash, + HYPRE_Int exact_rownnz, HYPRE_Int *d_ia, HYPRE_Int *d_ja, HYPRE_Complex *d_a, + HYPRE_Int *d_ib, HYPRE_Int *d_jb, HYPRE_Complex *d_b, HYPRE_Int *d_rc, HYPRE_Int *d_ic, + HYPRE_Int *d_jc, HYPRE_Complex *d_c ); + +template +HYPRE_Int hypre_spgemm_symbolic_max_num_blocks( HYPRE_Int multiProcessorCount, + HYPRE_Int *num_blocks_ptr, HYPRE_Int *block_size_ptr ); + +template +HYPRE_Int hypre_spgemm_numerical_max_num_blocks( HYPRE_Int multiProcessorCount, + HYPRE_Int *num_blocks_ptr, HYPRE_Int *block_size_ptr ); + +HYPRE_Int hypreDevice_CSRSpGemmBinnedGetBlockNumDim(); + +template +HYPRE_Int hypreDevice_CSRSpGemmNumerPostCopy( HYPRE_Int m, HYPRE_Int *d_rc, HYPRE_Int *nnzC, + HYPRE_Int **d_ic, HYPRE_Int **d_jc, HYPRE_Complex **d_c); + +template +static constexpr HYPRE_Int +hypre_spgemm_get_num_groups_per_block() +{ +#if defined(HYPRE_USING_CUDA) + return hypre_min(hypre_max(512 / GROUP_SIZE, 1), 64); +#elif defined(HYPRE_USING_HIP) + return hypre_max(512 / GROUP_SIZE, 1); +#elif defined(HYPRE_USING_SYCL) + return hypre_max(512 / GROUP_SIZE, 1); #endif +} + +#if defined(HYPRE_SPGEMM_PRINTF) || defined(HYPRE_SPGEMM_TIMING) +#define HYPRE_SPGEMM_PRINT(...) hypre_ParPrintf(hypre_MPI_COMM_WORLD, __VA_ARGS__) +#else +#define HYPRE_SPGEMM_PRINT(...) +#endif + +#endif /* defined(HYPRE_USING_GPU) */ +#endif /* #ifndef CSR_SPGEMM_DEVICE_H */ diff --git a/external/hypre/src/seq_mv/csr_spgemm_device_attempt.c b/external/hypre/src/seq_mv/csr_spgemm_device_attempt.c deleted file mode 100644 index d6b23a99..00000000 --- a/external/hypre/src/seq_mv/csr_spgemm_device_attempt.c +++ /dev/null @@ -1,632 +0,0 @@ -/****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other - * HYPRE Project Developers. See the top-level COPYRIGHT file for details. - * - * SPDX-License-Identifier: (Apache-2.0 OR MIT) - ******************************************************************************/ - -/*- - - - - - - - - - - - - - - - - - - - - - - - - - * - Perform SpMM with Row Nnz Estimation - *- - - - - - - - - - - - - - - - - - - - - - - - - - */ -#include "seq_mv.h" -#include "csr_spgemm_device.h" - -#define HYPRE_SPGEMM_NUMER_HASH_SIZE 128 - -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - -template -static __device__ __forceinline__ -HYPRE_Int -hypre_spgemm_hash_insert_attempt( HYPRE_Int HashSize, /* capacity of the hash table */ - volatile HYPRE_Int *HashKeys, /* assumed to be initialized as all -1's */ - volatile HYPRE_Complex *HashVals, /* assumed to be initialized as all 0's */ - HYPRE_Int key, /* assumed to be nonnegative */ - HYPRE_Complex val, - HYPRE_Int &count, /* increase by 1 if is a new entry */ - hypre_int warp_failed ) -{ - HYPRE_Int j = 0; - -#pragma unroll - for (HYPRE_Int i = 0; i < HashSize; i++) - { - /* compute the hash value of key */ - if (i == 0) - { - j = key & (HashSize - 1); - } - else - { - j = HashFunc(HashSize, key, i, j); - } - - /* try to insert key+1 into slot j */ - HYPRE_Int old = atomicCAS((HYPRE_Int*)(HashKeys+j), -1, key); - - if (old == -1 || old == key) - { - /* new insertion, increase counter */ - if (old == -1) - { - count++; - } - - /* this slot was open or contained 'key', update value */ - if (!warp_failed) - { - atomicAdd((HYPRE_Complex*)(HashVals+j), val); - } - - return j; - } - } - - return -1; -} - -template -static __device__ __forceinline__ -HYPRE_Int -hypre_spgemm_compute_row_attempt( HYPRE_Int rowi, - volatile HYPRE_Int lane_id, - HYPRE_Int *ia, - HYPRE_Int *ja, - HYPRE_Complex *aa, - HYPRE_Int *ib, - HYPRE_Int *jb, - HYPRE_Complex *ab, - HYPRE_Int s_HashSize, - volatile HYPRE_Int *s_HashKeys, - volatile HYPRE_Complex *s_HashVals, - HYPRE_Int g_HashSize, - HYPRE_Int *g_HashKeys, - HYPRE_Complex *g_HashVals, - hypre_int &failed ) -{ - /* load the start and end position of row i of A */ - HYPRE_Int j = 0; - - if (lane_id < 2) - { - j = read_only_load(ia + rowi + lane_id); - } - const HYPRE_Int istart = __shfl_sync(HYPRE_WARP_FULL_MASK, j, 0); - const HYPRE_Int iend = __shfl_sync(HYPRE_WARP_FULL_MASK, j, 1); - - HYPRE_Int num_new_insert = 0; - hypre_int warp_failed = 0; - - /* load column idx and values of row i of A */ - for (HYPRE_Int i = istart; i < iend; i += blockDim.y) - { - HYPRE_Int colA = -1; - HYPRE_Complex valA = 0.0; - - if (threadIdx.x == 0 && i + threadIdx.y < iend) - { - colA = read_only_load(ja + i + threadIdx.y); - valA = read_only_load(aa + i + threadIdx.y); - } - -#if 0 - //const HYPRE_Int ymask = get_mask<4>(lane_id); - // TODO: need to confirm the behavior of __ballot_sync, leave it here for now - //const HYPRE_Int num_valid_rows = __popc(__ballot_sync(ymask, valid_i)); - //for (HYPRE_Int j = 0; j < num_valid_rows; j++) -#endif - - /* threads in the same ygroup work on one row together */ - const HYPRE_Int rowB = __shfl_sync(HYPRE_WARP_FULL_MASK, colA, 0, blockDim.x); - const HYPRE_Complex mult = __shfl_sync(HYPRE_WARP_FULL_MASK, valA, 0, blockDim.x); - /* open this row of B, collectively */ - HYPRE_Int tmp = 0; - if (rowB != -1 && threadIdx.x < 2) - { - tmp = read_only_load(ib+rowB+threadIdx.x); - } - const HYPRE_Int rowB_start = __shfl_sync(HYPRE_WARP_FULL_MASK, tmp, 0, blockDim.x); - const HYPRE_Int rowB_end = __shfl_sync(HYPRE_WARP_FULL_MASK, tmp, 1, blockDim.x); - - for (HYPRE_Int k = rowB_start + threadIdx.x; __any_sync(HYPRE_WARP_FULL_MASK, k < rowB_end); k += blockDim.x) - { - if (k < rowB_end) - { - const HYPRE_Int k_idx = read_only_load(jb + k); - const HYPRE_Complex k_val = read_only_load(ab + k) * mult; - /* first try to insert into shared memory hash table */ - HYPRE_Int pos = hypre_spgemm_hash_insert_attempt - (s_HashSize, s_HashKeys, s_HashVals, k_idx, k_val, num_new_insert, warp_failed); - - if (-1 == pos) - { - pos = hypre_spgemm_hash_insert_attempt - (g_HashSize, g_HashKeys, g_HashVals, k_idx, k_val, num_new_insert, warp_failed); - } - /* if failed again, both hash tables must have been full - (hash table size estimation was too small). - Increase the counter anyhow (will lead to over-counting) - */ - if (pos == -1) - { - num_new_insert ++; - failed = 1; - } - } - - if (ATTEMPT == 1) - { - if (!warp_failed) - { - warp_failed = warp_allreduce_sum(failed); - } - } - } - } - - return num_new_insert; -} - -template -__global__ void -hypre_spgemm_attempt( HYPRE_Int M, /* HYPRE_Int K, HYPRE_Int N, */ - HYPRE_Int *rind, - HYPRE_Int *ia, - HYPRE_Int *ja, - HYPRE_Complex *aa, - HYPRE_Int *ib, - HYPRE_Int *jb, - HYPRE_Complex *ab, - HYPRE_Int *js, - HYPRE_Complex *as, - HYPRE_Int *ig, - HYPRE_Int *jg, - HYPRE_Complex *ag, - HYPRE_Int *rc, - HYPRE_Int *rf ) -{ - volatile const HYPRE_Int num_warps = NUM_WARPS_PER_BLOCK * gridDim.x; - /* warp id inside the block */ - volatile const HYPRE_Int warp_id = get_warp_id(); - /* warp id in the grid */ - volatile const HYPRE_Int grid_warp_id = blockIdx.x * NUM_WARPS_PER_BLOCK + warp_id; - /* lane id inside the warp */ - volatile HYPRE_Int lane_id = get_lane_id(); - /* shared memory hash table */ -#if 1 - __shared__ volatile HYPRE_Int s_HashKeys[NUM_WARPS_PER_BLOCK * SHMEM_HASH_SIZE]; - __shared__ volatile HYPRE_Complex s_HashVals[NUM_WARPS_PER_BLOCK * SHMEM_HASH_SIZE]; -#else - extern __shared__ volatile HYPRE_Int shared_mem[]; - volatile HYPRE_Int *s_HashKeys = shared_mem; - volatile HYPRE_Complex *s_HashVals = (volatile HYPRE_Complex *) &s_HashKeys[NUM_WARPS_PER_BLOCK * SHMEM_HASH_SIZE]; -#endif - /* shared memory hash table for this warp */ - volatile HYPRE_Int *warp_s_HashKeys = s_HashKeys + warp_id * SHMEM_HASH_SIZE; - volatile HYPRE_Complex *warp_s_HashVals = s_HashVals + warp_id * SHMEM_HASH_SIZE; - - hypre_device_assert(blockDim.z == NUM_WARPS_PER_BLOCK); - hypre_device_assert(blockDim.x * blockDim.y == HYPRE_WARP_SIZE); - hypre_device_assert(NUM_WARPS_PER_BLOCK <= HYPRE_WARP_SIZE); - - /* a warp working on the ith row */ - for (HYPRE_Int i = grid_warp_id; i < M; i += num_warps) - { - /* start/end position of global memory hash table */ - HYPRE_Int j = 0, ii; - hypre_int failed = 0; - - if (ATTEMPT == 2) - { - if (lane_id == 0) - { - j = rind[i]; - } - ii = __shfl_sync(HYPRE_WARP_FULL_MASK, j, 0); - } - else - { - ii = i; - } - - /* start/end position of global memory hash table */ - HYPRE_Int istart_g = 0, iend_g = 0, ghash_size = 0; - - if (ig) - { - if (lane_id < 2) - { - j = read_only_load(ig + ii + lane_id); - } - istart_g = __shfl_sync(HYPRE_WARP_FULL_MASK, j, 0); - iend_g = __shfl_sync(HYPRE_WARP_FULL_MASK, j, 1); - - /* size of global hash table allocated for this row - (must be power of 2 and >= the actual size of the row of C - shmem hash size) */ - ghash_size = iend_g - istart_g; - - /* initialize warp's global memory hash table */ -#pragma unroll - for (HYPRE_Int k = lane_id; k < ghash_size; k += HYPRE_WARP_SIZE) - { - jg[istart_g+k] = -1; - ag[istart_g+k] = 0.0; - } - } - - /* initialize warp's shared memory hash table */ -#pragma unroll - for (HYPRE_Int k = lane_id; k < SHMEM_HASH_SIZE; k += HYPRE_WARP_SIZE) - { - warp_s_HashKeys[k] = -1; - warp_s_HashVals[k] = 0.0; - } - - __syncwarp(); - - /* work with two hash tables */ - j = hypre_spgemm_compute_row_attempt(ii, lane_id, ia, ja, aa, ib, jb, ab, - SHMEM_HASH_SIZE, warp_s_HashKeys, warp_s_HashVals, - ghash_size, jg + istart_g, ag + istart_g, failed); - -#if defined(HYPRE_DEBUG) - if (ATTEMPT == 2) - { - hypre_device_assert(failed == 0); - } -#endif - - /* num of inserts in this row (an upper bound) */ - j = warp_reduce_sum(j); - - /* if this row failed */ - if (ATTEMPT == 1) - { - failed = warp_allreduce_sum(failed); - } - - if (lane_id == 0) - { - rc[ii] = j; - - if (ATTEMPT == 1) - { - rf[ii] = failed > 0; - } - } - - if (!failed) - { -#pragma unroll - for (HYPRE_Int k = lane_id; k < SHMEM_HASH_SIZE; k += HYPRE_WARP_SIZE) - { - js[ii * SHMEM_HASH_SIZE + k] = warp_s_HashKeys[k]; - as[ii * SHMEM_HASH_SIZE + k] = warp_s_HashVals[k]; - } - } - } // for (i=...) -} - -template -static __device__ __forceinline__ -HYPRE_Int -hypre_spgemm_copy_from_hash_into_C_row( HYPRE_Int lane_id, - volatile HYPRE_Int *s_HashKeys, - volatile HYPRE_Complex *s_HashVals, - HYPRE_Int ghash_size, - HYPRE_Int *jg_start, - HYPRE_Complex *ag_start, - HYPRE_Int *jc_start, - HYPRE_Complex *ac_start ) -{ - HYPRE_Int j = 0; - - /* copy shared memory hash table into C */ -#pragma unroll - for (HYPRE_Int k = lane_id; k < SHMEM_HASH_SIZE; k += HYPRE_WARP_SIZE) - { - HYPRE_Int key, sum, pos; - key = s_HashKeys[k]; - HYPRE_Int in = key != -1; - pos = warp_prefix_sum(lane_id, in, sum); - if (key != -1) - { - jc_start[j + pos] = key; - ac_start[j + pos] = s_HashVals[k]; - } - j += sum; - } - - /* copy global memory hash table into C */ -#pragma unroll - for (HYPRE_Int k = 0; k < ghash_size; k += HYPRE_WARP_SIZE) - { - HYPRE_Int key = -1, sum, pos; - if (k + lane_id < ghash_size) - { - key = jg_start[k + lane_id]; - } - HYPRE_Int in = key != -1; - pos = warp_prefix_sum(lane_id, in, sum); - if (key != -1) - { - jc_start[j + pos] = key; - ac_start[j + pos] = ag_start[k + lane_id]; - } - j += sum; - } - - return j; -} - -template -__global__ void -hypre_spgemm_copy_from_hash_into_C( HYPRE_Int M, - HYPRE_Int *rf, - HYPRE_Int *js, - HYPRE_Complex *as, - HYPRE_Int *ig1, - HYPRE_Int *jg1, - HYPRE_Complex *ag1, - HYPRE_Int *ig2, - HYPRE_Int *jg2, - HYPRE_Complex *ag2, - HYPRE_Int *ic, - HYPRE_Int *jc, - HYPRE_Complex *ac) -{ - const HYPRE_Int num_warps = NUM_WARPS_PER_BLOCK * gridDim.x; - /* warp id inside the block */ - const HYPRE_Int warp_id = get_warp_id(); - /* warp id in the grid */ - volatile const HYPRE_Int grid_warp_id = blockIdx.x * NUM_WARPS_PER_BLOCK + warp_id; - /* lane id inside the warp */ - volatile const HYPRE_Int lane_id = get_lane_id(); - - hypre_device_assert(blockDim.x * blockDim.y == HYPRE_WARP_SIZE); - - for (HYPRE_Int i = grid_warp_id; i < M; i += num_warps) - { - HYPRE_Int j = 0, irf = 0; - HYPRE_Int istart_c = 0, istart_g = 0, iend_g = 0, *ig = NULL, *jg = NULL; - HYPRE_Complex *ag = NULL; - - if (lane_id == 0) - { - istart_c = read_only_load(ic + i); - irf = read_only_load(rf + i); - } - istart_c = __shfl_sync(HYPRE_WARP_FULL_MASK, istart_c, 0); - irf = __shfl_sync(HYPRE_WARP_FULL_MASK, irf, 0); - - if (irf) - { - ig = ig2; jg = jg2; ag = ag2; - } - else - { - ig = ig1; jg = jg1; ag = ag1; - } - - if (ig) - { - if (lane_id < 2) - { - j = read_only_load(ig + i + lane_id); - } - istart_g = __shfl_sync(HYPRE_WARP_FULL_MASK, j, 0); - iend_g = __shfl_sync(HYPRE_WARP_FULL_MASK, j, 1); - } - -#ifdef HYPRE_DEBUG - j = -#endif - hypre_spgemm_copy_from_hash_into_C_row - (lane_id, js + i * SHMEM_HASH_SIZE, as + i * SHMEM_HASH_SIZE, iend_g - istart_g, - jg + istart_g, ag + istart_g, jc + istart_c, ac + istart_c); - -#ifdef HYPRE_DEBUG - hypre_device_assert(istart_c + j == ic[i+1]); -#endif - } -} - -/* SpGeMM with Rownnz Estimates */ -template -HYPRE_Int -hypre_spgemm_numerical_with_rowest( HYPRE_Int m, - HYPRE_Int k, - HYPRE_Int n, - HYPRE_Int *d_ia, - HYPRE_Int *d_ja, - HYPRE_Complex *d_a, - HYPRE_Int *d_ib, - HYPRE_Int *d_jb, - HYPRE_Complex *d_b, - HYPRE_Int *d_rc, - HYPRE_Int *d_rf, - HYPRE_Int **d_ic_out, - HYPRE_Int **d_jc_out, - HYPRE_Complex **d_c_out, - HYPRE_Int *nnzC_out ) -{ -#if defined(HYPRE_USING_CUDA) - const HYPRE_Int num_warps_per_block = 16; -#elif defined(HYPRE_USING_HIP) - const HYPRE_Int num_warps_per_block = 16; -#endif - const HYPRE_Int BDIMX = 2; - const HYPRE_Int BDIMY = HYPRE_WARP_SIZE / BDIMX; - const size_t shash_size = shmem_hash_size * (size_t) m; - -#if 0 - const size_t shmem_size = num_warps_per_block * shmem_hash_size * (sizeof(HYPRE_Complex) + sizeof(HYPRE_Int)); - const HYPRE_Int shmem_maxbytes = 65536; - hypre_assert(shmem_size <= shmem_maxbytes); - /* CUDA V100 */ - if (shmem_maxbytes > 49152) - { - HYPRE_CUDA_CALL( cudaFuncSetAttribute(hypre_spgemm_attempt, - cudaFuncAttributeMaxDynamicSharedMemorySize, shmem_maxbytes) ); - - HYPRE_CUDA_CALL( cudaFuncSetAttribute(hypre_spgemm_attempt, - cudaFuncAttributeMaxDynamicSharedMemorySize, shmem_maxbytes) ); - } -#endif - - /* CUDA kernel configurations */ - dim3 bDim(BDIMX, BDIMY, num_warps_per_block); - hypre_assert(bDim.x * bDim.y == HYPRE_WARP_SIZE); - - /* --------------------------------------------------------------------------- - * global memory hash table - * ---------------------------------------------------------------------------*/ - HYPRE_Int *d_ghash1_i = NULL; - HYPRE_Int *d_ghash1_j = NULL; - HYPRE_Complex *d_ghash1_a = NULL; - HYPRE_Int *d_ghash2_i = NULL; - HYPRE_Int *d_ghash2_j = NULL; - HYPRE_Complex *d_ghash2_a = NULL; - HYPRE_Int *d_js = hypre_TAlloc(HYPRE_Int, shash_size, HYPRE_MEMORY_DEVICE); - HYPRE_Complex *d_as = hypre_TAlloc(HYPRE_Complex, shash_size, HYPRE_MEMORY_DEVICE); - HYPRE_Int *rf_ind = NULL; - - /* --------------------------------------------------------------------------- - * 1st multiplication attempt: - * ---------------------------------------------------------------------------*/ - { - hypre_SpGemmCreateGlobalHashTable(m, NULL, m, d_rc, shmem_hash_size, &d_ghash1_i, - &d_ghash1_j, &d_ghash1_a, NULL, 2); - - // for cases where one WARP works on a row - dim3 gDim( (m + bDim.z - 1) / bDim.z ); - - HYPRE_CUDA_LAUNCH ( (hypre_spgemm_attempt), - gDim, bDim, /* shmem_size, */ - m, NULL, d_ia, d_ja, d_a, d_ib, d_jb, d_b, d_js, d_as, d_ghash1_i, d_ghash1_j, d_ghash1_a, - d_rc, d_rf ); - } - - HYPRE_Int num_failed_rows = hypreDevice_IntegerReduceSum(m, d_rf); - - /* --------------------------------------------------------------------------- - * 2nd multiplication attempt: - * ---------------------------------------------------------------------------*/ - if (num_failed_rows) - { - //hypre_printf("[%s, %d]: num of failed rows %d (%.2f)\n", __FILE__, __LINE__, num_failed_rows, num_failed_rows / (m + 0.0) ); - - rf_ind = hypre_TAlloc(HYPRE_Int, num_failed_rows, HYPRE_MEMORY_DEVICE); - - HYPRE_Int *new_end = - HYPRE_THRUST_CALL( copy_if, - thrust::make_counting_iterator(0), - thrust::make_counting_iterator(m), - d_rf, - rf_ind, - thrust::identity() ); - - hypre_assert(new_end - rf_ind == num_failed_rows); - - /* --------------------------------------------------------------------------- - * build a second hash table for long rows - * ---------------------------------------------------------------------------*/ - hypre_SpGemmCreateGlobalHashTable(num_failed_rows, rf_ind, m, d_rc, shmem_hash_size, - &d_ghash2_i, &d_ghash2_j, &d_ghash2_a, NULL, 2); - - // for cases where one WARP works on a row - dim3 gDim( (num_failed_rows + bDim.z - 1) / bDim.z ); - - HYPRE_CUDA_LAUNCH ( (hypre_spgemm_attempt), - gDim, bDim, /* shmem_size, */ - num_failed_rows, rf_ind, d_ia, d_ja, d_a, d_ib, d_jb, d_b, d_js, d_as, d_ghash2_i, d_ghash2_j, d_ghash2_a, - d_rc, NULL ); - } - - HYPRE_Int *d_ic = hypre_TAlloc(HYPRE_Int, m + 1, HYPRE_MEMORY_DEVICE); - HYPRE_Int *d_jc; - HYPRE_Complex *d_c; - HYPRE_Int nnzC; - - hypre_create_ija(m, d_rc, d_ic, &d_jc, &d_c, &nnzC); - - /* --------------------------------------------------------------------------- - * copy from hash tables to C - * ---------------------------------------------------------------------------*/ - { - // for cases where one WARP works on a row - dim3 gDim( (m + bDim.z - 1) / bDim.z ); - - HYPRE_CUDA_LAUNCH( (hypre_spgemm_copy_from_hash_into_C), gDim, bDim, - m, d_rf, - d_js, d_as, - d_ghash1_i, d_ghash1_j, d_ghash1_a, - d_ghash2_i, d_ghash2_j, d_ghash2_a, - d_ic, d_jc, d_c ); - } - - hypre_TFree(d_ghash1_i, HYPRE_MEMORY_DEVICE); - hypre_TFree(d_ghash1_j, HYPRE_MEMORY_DEVICE); - hypre_TFree(d_ghash1_a, HYPRE_MEMORY_DEVICE); - hypre_TFree(d_ghash2_i, HYPRE_MEMORY_DEVICE); - hypre_TFree(d_ghash2_j, HYPRE_MEMORY_DEVICE); - hypre_TFree(d_ghash2_a, HYPRE_MEMORY_DEVICE); - hypre_TFree(d_js, HYPRE_MEMORY_DEVICE); - hypre_TFree(d_as, HYPRE_MEMORY_DEVICE); - hypre_TFree(rf_ind, HYPRE_MEMORY_DEVICE); - - *d_ic_out = d_ic; - *d_jc_out = d_jc; - *d_c_out = d_c; - *nnzC_out = nnzC; - - return hypre_error_flag; -} - -HYPRE_Int -hypreDevice_CSRSpGemmNumerWithRownnzEstimate( HYPRE_Int m, - HYPRE_Int k, - HYPRE_Int n, - HYPRE_Int *d_ia, - HYPRE_Int *d_ja, - HYPRE_Complex *d_a, - HYPRE_Int *d_ib, - HYPRE_Int *d_jb, - HYPRE_Complex *d_b, - HYPRE_Int *d_rc, - HYPRE_Int **d_ic_out, - HYPRE_Int **d_jc_out, - HYPRE_Complex **d_c_out, - HYPRE_Int *nnzC ) -{ - const HYPRE_Int shmem_hash_size = HYPRE_SPGEMM_NUMER_HASH_SIZE; - const char hash_type = hypre_HandleSpgemmHashType(hypre_handle()); - - /* a binary array to indicate if row nnz counting is failed for a row */ - HYPRE_Int *d_rf = d_rc + m; - - if (hash_type == 'L') - { - hypre_spgemm_numerical_with_rowest - (m, k, n, d_ia, d_ja, d_a, d_ib, d_jb, d_b, d_rc, d_rf, d_ic_out, d_jc_out, d_c_out, nnzC); - } - else if (hash_type == 'Q') - { - hypre_spgemm_numerical_with_rowest - (m, k, n, d_ia, d_ja, d_a, d_ib, d_jb, d_b, d_rc, d_rf, d_ic_out, d_jc_out, d_c_out, nnzC); - } - else if (hash_type == 'D') - { - hypre_spgemm_numerical_with_rowest - (m, k, n, d_ia, d_ja, d_a, d_ib, d_jb, d_b, d_rc, d_rf, d_ic_out, d_jc_out, d_c_out, nnzC); - } - else - { - hypre_printf("Unrecognized hash type ... [L(inear), Q(uadratic), D(ouble)]\n"); - exit(0); - } - - return hypre_error_flag; -} - -#endif /* HYPRE_USING_CUDA || defined(HYPRE_USING_HIP) */ diff --git a/external/hypre/src/seq_mv/csr_spgemm_device_confident.c b/external/hypre/src/seq_mv/csr_spgemm_device_confident.c deleted file mode 100644 index 86633323..00000000 --- a/external/hypre/src/seq_mv/csr_spgemm_device_confident.c +++ /dev/null @@ -1,589 +0,0 @@ -/****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other - * HYPRE Project Developers. See the top-level COPYRIGHT file for details. - * - * SPDX-License-Identifier: (Apache-2.0 OR MIT) - ******************************************************************************/ - -/*- - - - - - - - - - - - - - - - - - - - - - - - - - * - Perform SpMM with Row Nnz Upper Bound - *- - - - - - - - - - - - - - - - - - - - - - - - - - */ -#include "seq_mv.h" -#include "csr_spgemm_device.h" - -/*- - - - - - - - - - - - - - - - - - - - - - - - - - * - Numerical Multiplication - *- - - - - - - - - - - - - - - - - - - - - - - - - - */ -#if defined(HYPRE_USING_CUDA) -#define HYPRE_SPGEMM_NUMER_HASH_SIZE 256 -#elif defined(HYPRE_USING_HIP) -#define HYPRE_SPGEMM_NUMER_HASH_SIZE 256 -#endif - - -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - -template -static __device__ __forceinline__ -HYPRE_Int -hypre_spgemm_hash_insert_numer( HYPRE_Int HashSize, /* capacity of the hash table */ - volatile HYPRE_Int *HashKeys, /* assumed to be initialized as all -1's */ - volatile HYPRE_Complex *HashVals, /* assumed to be initialized as all 0's */ - HYPRE_Int key, /* assumed to be nonnegative */ - HYPRE_Complex val, - HYPRE_Int &count ) -{ - HYPRE_Int j = 0; - -#pragma unroll - for (HYPRE_Int i = 0; i < HashSize; i++) - { - /* compute the hash value of key */ - if (i == 0) - { - j = key & (HashSize - 1); - } - else - { - j = HashFunc(HashSize, key, i, j); - } - - /* try to insert key+1 into slot j */ - HYPRE_Int old = atomicCAS((HYPRE_Int *)(HashKeys+j), -1, key); - - if (old == -1 || old == key) - { - if (FAILED_SYMBL) - { - if (old == -1) - { - count++; - } - } - /* this slot was open or contained 'key', update value */ - atomicAdd((HYPRE_Complex*)(HashVals+j), val); - return j; - } - } - - return -1; -} - -template -static __device__ __forceinline__ -HYPRE_Int -hypre_spgemm_compute_row_numer( HYPRE_Int rowi, - HYPRE_Int lane_id, - HYPRE_Int *ia, - HYPRE_Int *ja, - HYPRE_Complex *aa, - HYPRE_Int *ib, - HYPRE_Int *jb, - HYPRE_Complex *ab, - HYPRE_Int s_HashSize, - volatile HYPRE_Int *s_HashKeys, - volatile HYPRE_Complex *s_HashVals, - HYPRE_Int g_HashSize, - HYPRE_Int *g_HashKeys, - HYPRE_Complex *g_HashVals) -{ - /* load the start and end position of row i of A */ - HYPRE_Int i = 0; - - if (lane_id < 2) - { - i = read_only_load(ia + rowi + lane_id); - } - const HYPRE_Int istart = __shfl_sync(HYPRE_WARP_FULL_MASK, i, 0); - const HYPRE_Int iend = __shfl_sync(HYPRE_WARP_FULL_MASK, i, 1); - - HYPRE_Int num_new_insert = 0; - - /* load column idx and values of row i of A */ - for (i = istart; i < iend; i += blockDim.y) - { - HYPRE_Int colA = -1; - HYPRE_Complex valA = 0.0; - - if (threadIdx.x == 0 && i + threadIdx.y < iend) - { - colA = read_only_load(ja + i + threadIdx.y); - valA = read_only_load(aa + i + threadIdx.y); - } - -#if 0 - //const HYPRE_Int ymask = get_mask<4>(lane_id); - // TODO: need to confirm the behavior of __ballot_sync, leave it here for now - //const HYPRE_Int num_valid_rows = __popc(__ballot_sync(ymask, valid_i)); - //for (HYPRE_Int j = 0; j < num_valid_rows; j++) -#endif - - /* threads in the same ygroup work on one row together */ - const HYPRE_Int rowB = __shfl_sync(HYPRE_WARP_FULL_MASK, colA, 0, blockDim.x); - const HYPRE_Complex mult = __shfl_sync(HYPRE_WARP_FULL_MASK, valA, 0, blockDim.x); - /* open this row of B, collectively */ - HYPRE_Int tmp = 0; - if (rowB != -1 && threadIdx.x < 2) - { - tmp = read_only_load(ib+rowB+threadIdx.x); - } - const HYPRE_Int rowB_start = __shfl_sync(HYPRE_WARP_FULL_MASK, tmp, 0, blockDim.x); - const HYPRE_Int rowB_end = __shfl_sync(HYPRE_WARP_FULL_MASK, tmp, 1, blockDim.x); - - for (HYPRE_Int k = rowB_start + threadIdx.x; __any_sync(HYPRE_WARP_FULL_MASK, k < rowB_end); k += blockDim.x) - { - if (k < rowB_end) - { - const HYPRE_Int k_idx = read_only_load(jb + k); - const HYPRE_Complex k_val = read_only_load(ab + k) * mult; - /* first try to insert into shared memory hash table */ - HYPRE_Int pos = hypre_spgemm_hash_insert_numer - (s_HashSize, s_HashKeys, s_HashVals, k_idx, k_val, num_new_insert); - - if (-1 == pos) - { - pos = hypre_spgemm_hash_insert_numer - (g_HashSize, g_HashKeys, g_HashVals, k_idx, k_val, num_new_insert); - } - - hypre_device_assert(pos != -1); - } - } - } - - return num_new_insert; -} - -template -static __device__ __forceinline__ -HYPRE_Int -hypre_spgemm_copy_from_hash_into_C_row( HYPRE_Int lane_id, - volatile HYPRE_Int *s_HashKeys, - volatile HYPRE_Complex *s_HashVals, - HYPRE_Int ghash_size, - HYPRE_Int *jg_start, - HYPRE_Complex *ag_start, - HYPRE_Int *jc_start, - HYPRE_Complex *ac_start) -{ - HYPRE_Int j = 0; - - /* copy shared memory hash table into C */ -#pragma unroll - for (HYPRE_Int k = lane_id; k < SHMEM_HASH_SIZE; k += HYPRE_WARP_SIZE) - { - HYPRE_Int key, sum, pos; - key = s_HashKeys[k]; - HYPRE_Int in = key != -1; - pos = warp_prefix_sum(lane_id, in, sum); - if (key != -1) - { - jc_start[j + pos] = key; - ac_start[j + pos] = s_HashVals[k]; - } - j += sum; - } - - /* copy global memory hash table into C */ -#pragma unroll - for (HYPRE_Int k = 0; k < ghash_size; k += HYPRE_WARP_SIZE) - { - HYPRE_Int key = -1, sum, pos; - if (k + lane_id < ghash_size) - { - key = jg_start[k + lane_id]; - } - HYPRE_Int in = key != -1; - pos = warp_prefix_sum(lane_id, in, sum); - if (key != -1) - { - jc_start[j + pos] = key; - ac_start[j + pos] = ag_start[k + lane_id]; - } - j += sum; - } - - return j; -} - -template -__global__ void -hypre_spgemm_numeric( HYPRE_Int M, /* HYPRE_Int K, HYPRE_Int N, */ - HYPRE_Int *ia, - HYPRE_Int *ja, - HYPRE_Complex *aa, - HYPRE_Int *ib, - HYPRE_Int *jb, - HYPRE_Complex *ab, - HYPRE_Int *ic, - HYPRE_Int *jc, - HYPRE_Complex *ac, - HYPRE_Int *rc, - HYPRE_Int *ig, - HYPRE_Int *jg, - HYPRE_Complex *ag) -{ - volatile const HYPRE_Int num_warps = NUM_WARPS_PER_BLOCK * gridDim.x; - /* warp id inside the block */ - volatile const HYPRE_Int warp_id = get_warp_id(); - /* warp id in the grid */ - volatile const HYPRE_Int grid_warp_id = blockIdx.x * NUM_WARPS_PER_BLOCK + warp_id; - /* lane id inside the warp */ - volatile HYPRE_Int lane_id = get_lane_id(); - /* shared memory hash table */ -#if 1 - __shared__ volatile HYPRE_Int s_HashKeys[NUM_WARPS_PER_BLOCK * SHMEM_HASH_SIZE]; - __shared__ volatile HYPRE_Complex s_HashVals[NUM_WARPS_PER_BLOCK * SHMEM_HASH_SIZE]; -#else - extern __shared__ volatile HYPRE_Int shared_mem[]; - volatile HYPRE_Int *s_HashKeys = shared_mem; - volatile HYPRE_Complex *s_HashVals = (volatile HYPRE_Complex *) &s_HashKeys[NUM_WARPS_PER_BLOCK * SHMEM_HASH_SIZE]; -#endif - /* shared memory hash table for this warp */ - volatile HYPRE_Int *warp_s_HashKeys = s_HashKeys + warp_id * SHMEM_HASH_SIZE; - volatile HYPRE_Complex *warp_s_HashVals = s_HashVals + warp_id * SHMEM_HASH_SIZE; - - hypre_device_assert(blockDim.z == NUM_WARPS_PER_BLOCK); - hypre_device_assert(blockDim.x * blockDim.y == HYPRE_WARP_SIZE); - - /* a warp working on the ith row */ - for (HYPRE_Int i = grid_warp_id; i < M; i += num_warps) - { - /* start/end position of global memory hash table */ - HYPRE_Int j = -1, istart_g = 0, iend_g = 0, ghash_size = 0, jsum; - - if (ig) - { - if (lane_id < 2) - { - j = read_only_load(ig + grid_warp_id + lane_id); - } - istart_g = __shfl_sync(HYPRE_WARP_FULL_MASK, j, 0); - iend_g = __shfl_sync(HYPRE_WARP_FULL_MASK, j, 1); - - /* size of global hash table allocated for this row - (must be power of 2 and >= the actual size of the row of C) */ - ghash_size = iend_g - istart_g; - - /* initialize warp's global memory hash table */ -#pragma unroll - for (HYPRE_Int k = lane_id; k < ghash_size; k += HYPRE_WARP_SIZE) - { - jg[istart_g+k] = -1; - ag[istart_g+k] = 0.0; - } - } - - /* initialize warp's shared memory hash table */ -#pragma unroll - for (HYPRE_Int k = lane_id; k < SHMEM_HASH_SIZE; k += HYPRE_WARP_SIZE) - { - warp_s_HashKeys[k] = -1; - warp_s_HashVals[k] = 0.0; - } - - __syncwarp(); - - /* work with two hash tables. jsum is the (exact) nnz for row i */ - jsum = hypre_spgemm_compute_row_numer(i, lane_id, ia, ja, aa, ib, jb, ab, - SHMEM_HASH_SIZE, warp_s_HashKeys, - warp_s_HashVals, - ghash_size, jg + istart_g, ag + istart_g); - - if (FAILED_SYMBL) - { - /* in the case when symb mult was failed, save row nnz into rc */ - /* num of nonzeros of this row of C (exact) */ - jsum = warp_reduce_sum(jsum); - if (lane_id == 0) - { - rc[i] = jsum; - } - } - - /* copy results into the final C */ - /* start/end position in C */ -#ifdef HYPRE_DEBUG - if (lane_id < 2) - { - j = read_only_load(ic + i + lane_id); - } - HYPRE_Int istart_c = __shfl_sync(HYPRE_WARP_FULL_MASK, j, 0); - HYPRE_Int iend_c = __shfl_sync(HYPRE_WARP_FULL_MASK, j, 1); -#else - if (lane_id < 1) - { - j = read_only_load(ic + i); - } - HYPRE_Int istart_c = __shfl_sync(HYPRE_WARP_FULL_MASK, j, 0); -#endif - - j = hypre_spgemm_copy_from_hash_into_C_row - (lane_id, warp_s_HashKeys, warp_s_HashVals, ghash_size, jg + istart_g, - ag + istart_g, jc + istart_c, ac + istart_c); - -#if defined(HYPRE_DEBUG) - if (FAILED_SYMBL) - { - hypre_device_assert(istart_c + j <= iend_c); - } - else - { - hypre_device_assert(istart_c + j == iend_c); - } -#endif - } -} - -template -__global__ void -hypre_spgemm_copy_from_Cext_into_C( HYPRE_Int M, - HYPRE_Int *ix, - HYPRE_Int *jx, - HYPRE_Complex *ax, - HYPRE_Int *ic, - HYPRE_Int *jc, - HYPRE_Complex *ac ) -{ - const HYPRE_Int num_warps = NUM_WARPS_PER_BLOCK * gridDim.x; - /* warp id inside the block */ - const HYPRE_Int warp_id = get_warp_id(); - /* lane id inside the warp */ - volatile const HYPRE_Int lane_id = get_lane_id(); - - hypre_device_assert(blockDim.x * blockDim.y == HYPRE_WARP_SIZE); - - for (HYPRE_Int i = blockIdx.x * NUM_WARPS_PER_BLOCK + warp_id; - i < M; - i += num_warps) - { - HYPRE_Int kc = 0, kx = 0; - - /* start/end position in C and X*/ - if (lane_id < 2) - { - kc = read_only_load(ic + i + lane_id); - kx = read_only_load(ix + i + lane_id); - } - HYPRE_Int istart_c = __shfl_sync(HYPRE_WARP_FULL_MASK, kc, 0); - HYPRE_Int iend_c = __shfl_sync(HYPRE_WARP_FULL_MASK, kc, 1); - HYPRE_Int istart_x = __shfl_sync(HYPRE_WARP_FULL_MASK, kx, 0); -#if defined(HYPRE_DEBUG) - HYPRE_Int iend_x = __shfl_sync(HYPRE_WARP_FULL_MASK, kx, 1); - hypre_device_assert(iend_c - istart_c <= iend_x - istart_x); -#endif - - HYPRE_Int p = istart_x - istart_c; - for (HYPRE_Int k = istart_c + lane_id; k < iend_c; k += HYPRE_WARP_SIZE) - { - jc[k] = jx[k+p]; - ac[k] = ax[k+p]; - } - } -} - -/* SpGeMM with Rownnz/Upper bound */ -template -HYPRE_Int -hypre_spgemm_numerical_with_rownnz( HYPRE_Int m, - HYPRE_Int k, - HYPRE_Int n, - HYPRE_Int *d_ia, - HYPRE_Int *d_ja, - HYPRE_Complex *d_a, - HYPRE_Int *d_ib, - HYPRE_Int *d_jb, - HYPRE_Complex *d_b, - HYPRE_Int *d_rc, - HYPRE_Int **d_ic_out, - HYPRE_Int **d_jc_out, - HYPRE_Complex **d_c_out, - HYPRE_Int *nnzC) -{ -#ifdef HYPRE_PROFILE - hypre_profile_times[HYPRE_TIMER_ID_SPMM_NUMERIC] -= hypre_MPI_Wtime(); -#endif - -#if defined(HYPRE_USING_CUDA) - const HYPRE_Int num_warps_per_block = 16; - const HYPRE_Int BDIMX = 2; -#elif defined(HYPRE_USING_HIP) - const HYPRE_Int num_warps_per_block = 16; - const HYPRE_Int BDIMX = 4; -#endif - const HYPRE_Int BDIMY = HYPRE_WARP_SIZE / BDIMX; - -#if 0 - const size_t shmem_size = num_warps_per_block * shmem_hash_size * (sizeof(HYPRE_Complex) + sizeof(HYPRE_Int)); - const HYPRE_Int shmem_maxbytes = 65536; - hypre_assert(shmem_size <= shmem_maxbytes); - /* CUDA V100 */ - hypre_int v1, v2; - cudaDeviceGetAttribute(&v1, cudaDevAttrMaxSharedMemoryPerBlock, hypre_HandleCudaDevice(hypre_handle())); - cudaDeviceGetAttribute(&v2, cudaDevAttrMaxSharedMemoryPerBlockOptin, hypre_HandleCudaDevice(hypre_handle())); - - if (shmem_maxbytes > 49152) - { - HYPRE_CUDA_CALL( cudaFuncSetAttribute(hypre_spgemm_numeric, - cudaFuncAttributeMaxDynamicSharedMemorySize, shmem_maxbytes) ); - } -#endif - - /* CUDA kernel configurations */ - dim3 bDim(BDIMX, BDIMY, num_warps_per_block); - hypre_assert(bDim.x * bDim.y == HYPRE_WARP_SIZE); - // for cases where one WARP works on a row - HYPRE_Int num_warps = hypre_min(m, HYPRE_MAX_NUM_WARPS); - dim3 gDim( (num_warps + bDim.z - 1) / bDim.z ); - // number of active warps - HYPRE_Int num_act_warps = hypre_min(bDim.z * gDim.x, m); - - /* --------------------------------------------------------------------------- - * build hash table - * ---------------------------------------------------------------------------*/ - HYPRE_Int *d_ghash_i = NULL; - HYPRE_Int *d_ghash_j = NULL; - HYPRE_Complex *d_ghash_a = NULL; - - /* RL Note: even with exact_rownnz, still may need global hash, since shared hash has different size from symbol. */ - hypre_SpGemmCreateGlobalHashTable(m, NULL, num_act_warps, d_rc, shmem_hash_size, - &d_ghash_i, &d_ghash_j, &d_ghash_a, NULL, 1); - - /* --------------------------------------------------------------------------- - * numerical multiplication: - * ---------------------------------------------------------------------------*/ - /* if rc contains exact_rownnz: can allocate the final C=(ic,jc,c) directly; - if rc contains upper bound : it is a temporary space that is more than enough to store C */ - HYPRE_Int *d_ic = hypre_TAlloc(HYPRE_Int, m + 1, HYPRE_MEMORY_DEVICE); - HYPRE_Int *d_jc; - HYPRE_Complex *d_c; - HYPRE_Int nnzC_nume; - - hypre_create_ija(m, d_rc, d_ic, &d_jc, &d_c, &nnzC_nume); - - HYPRE_CUDA_LAUNCH ( (hypre_spgemm_numeric), - gDim, bDim, /* shmem_size, */ - m, /* k, n, */ d_ia, d_ja, d_a, d_ib, d_jb, d_b, d_ic, d_jc, d_c, d_rc, - d_ghash_i, d_ghash_j, d_ghash_a ); - - /* post-processing */ - if (!exact_rownnz) - { - HYPRE_Int nnzC_nume_new = hypreDevice_IntegerReduceSum(m, d_rc); - - hypre_assert(nnzC_nume_new <= nnzC_nume); - - if (nnzC_nume_new < nnzC_nume) - { - HYPRE_Int *d_ic_new = hypre_TAlloc(HYPRE_Int, m + 1, HYPRE_MEMORY_DEVICE); - HYPRE_Int *d_jc_new; - HYPRE_Complex *d_c_new; - HYPRE_Int tmp; - - /* alloc final C */ - hypre_create_ija(m, d_rc, d_ic_new, &d_jc_new, &d_c_new, &tmp); - hypre_assert(tmp == nnzC_nume_new); - - /* copy to the final C */ - dim3 gDim( (m + bDim.z - 1) / bDim.z ); - HYPRE_CUDA_LAUNCH( (hypre_spgemm_copy_from_Cext_into_C), gDim, bDim, - m, d_ic, d_jc, d_c, d_ic_new, d_jc_new, d_c_new ); - - hypre_TFree(d_ic, HYPRE_MEMORY_DEVICE); - hypre_TFree(d_jc, HYPRE_MEMORY_DEVICE); - hypre_TFree(d_c, HYPRE_MEMORY_DEVICE); - - d_ic = d_ic_new; - d_jc = d_jc_new; - d_c = d_c_new; - nnzC_nume = nnzC_nume_new; - } - } - - hypre_TFree(d_ghash_i, HYPRE_MEMORY_DEVICE); - hypre_TFree(d_ghash_j, HYPRE_MEMORY_DEVICE); - hypre_TFree(d_ghash_a, HYPRE_MEMORY_DEVICE); - - *d_ic_out = d_ic; - *d_jc_out = d_jc; - *d_c_out = d_c; - *nnzC = nnzC_nume; - -#ifdef HYPRE_PROFILE - cudaThreadSynchronize(); - hypre_profile_times[HYPRE_TIMER_ID_SPMM_NUMERIC] += hypre_MPI_Wtime(); -#endif - - return hypre_error_flag; -} - -HYPRE_Int -hypreDevice_CSRSpGemmNumerWithRownnzUpperbound( HYPRE_Int m, - HYPRE_Int k, - HYPRE_Int n, - HYPRE_Int *d_ia, - HYPRE_Int *d_ja, - HYPRE_Complex *d_a, - HYPRE_Int *d_ib, - HYPRE_Int *d_jb, - HYPRE_Complex *d_b, - HYPRE_Int *d_rc, /* input: nnz (upper bound) of each row */ - HYPRE_Int exact_rownnz, /* if d_rc is exact */ - HYPRE_Int **d_ic_out, - HYPRE_Int **d_jc_out, - HYPRE_Complex **d_c_out, - HYPRE_Int *nnzC ) -{ - const HYPRE_Int shmem_hash_size = HYPRE_SPGEMM_NUMER_HASH_SIZE; - const char hash_type = hypre_HandleSpgemmHashType(hypre_handle()); - - if (hash_type != 'L' && hash_type != 'Q' && hash_type != 'D') - { - hypre_printf("Unrecognized hash type ... [L(inear), Q(uadratic), D(ouble)]\n"); - exit(0); - } - - //HYPRE_Int max_rc = HYPRE_THRUST_CALL(reduce, d_rc, d_rc + m, 0, thrust::maximum()); - //hypre_printf("max_rc numerical %d\n", max_rc); - - if (exact_rownnz) - { - if (hash_type == 'L') - { - hypre_spgemm_numerical_with_rownnz - (m, k, n, d_ia, d_ja, d_a, d_ib, d_jb, d_b, d_rc, d_ic_out, d_jc_out, d_c_out, nnzC); - } - else if (hash_type == 'Q') - { - hypre_spgemm_numerical_with_rownnz - (m, k, n, d_ia, d_ja, d_a, d_ib, d_jb, d_b, d_rc, d_ic_out, d_jc_out, d_c_out, nnzC); - } - else if (hash_type == 'D') - { - hypre_spgemm_numerical_with_rownnz - (m, k, n, d_ia, d_ja, d_a, d_ib, d_jb, d_b, d_rc, d_ic_out, d_jc_out, d_c_out, nnzC); - } - } - else - { - if (hash_type == 'L') - { - hypre_spgemm_numerical_with_rownnz - (m, k, n, d_ia, d_ja, d_a, d_ib, d_jb, d_b, d_rc, d_ic_out, d_jc_out, d_c_out, nnzC); - } - else if (hash_type == 'Q') - { - hypre_spgemm_numerical_with_rownnz - (m, k, n, d_ia, d_ja, d_a, d_ib, d_jb, d_b, d_rc, d_ic_out, d_jc_out, d_c_out, nnzC); - } - else if (hash_type == 'D') - { - hypre_spgemm_numerical_with_rownnz - (m, k, n, d_ia, d_ja, d_a, d_ib, d_jb, d_b, d_rc, d_ic_out, d_jc_out, d_c_out, nnzC); - } - } - - return hypre_error_flag; -} -#endif /* HYPRE_USING_CUDA || defined(HYPRE_USING_HIP) */ - diff --git a/external/hypre/src/seq_mv/csr_spgemm_device_cusparse.c b/external/hypre/src/seq_mv/csr_spgemm_device_cusparse.c index c8ade7b1..fa275553 100644 --- a/external/hypre/src/seq_mv/csr_spgemm_device_cusparse.c +++ b/external/hypre/src/seq_mv/csr_spgemm_device_cusparse.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -8,6 +8,7 @@ #include "seq_mv.h" #include "_hypre_utilities.hpp" #include "seq_mv.hpp" +#include "csr_spgemm_device.h" #if defined(HYPRE_USING_CUDA) && defined(HYPRE_USING_CUSPARSE) @@ -36,6 +37,9 @@ hypreDevice_CSRSpGemmCusparse(HYPRE_Int m, nnzA, d_ia, d_ja, d_a, nnzB, d_ib, d_jb, d_b, nnzC_out, d_ic_out, d_jc_out, d_c_out); + HYPRE_UNUSED_VAR(descr_A); + HYPRE_UNUSED_VAR(descr_B); + HYPRE_UNUSED_VAR(descr_C); #else hypreDevice_CSRSpGemmCusparseOldAPI(m, k, n, descr_A, nnzA, d_ia, d_ja, d_a, @@ -87,9 +91,10 @@ hypreDevice_CSRSpGemmCusparseGenericAPI(HYPRE_Int m, cusparseHandle_t cusparsehandle = hypre_HandleCusparseHandle(hypre_handle()); //Initialize the descriptors for the mats + HYPRE_Int *d_ic = hypre_TAlloc(HYPRE_Int, m + 1, HYPRE_MEMORY_DEVICE); cusparseSpMatDescr_t matA = hypre_CSRMatrixToCusparseSpMat_core(m, k, 0, nnzA, d_ia, d_ja, d_a); cusparseSpMatDescr_t matB = hypre_CSRMatrixToCusparseSpMat_core(k, n, 0, nnzB, d_ib, d_jb, d_b); - cusparseSpMatDescr_t matC = hypre_CSRMatrixToCusparseSpMat_core(m, n, 0, 0, NULL, NULL, NULL); + cusparseSpMatDescr_t matC = hypre_CSRMatrixToCusparseSpMat_core(m, n, 0, 0, d_ic, NULL, NULL); cusparseOperation_t opA = CUSPARSE_OPERATION_NON_TRANSPOSE; cusparseOperation_t opB = CUSPARSE_OPERATION_NON_TRANSPOSE; @@ -105,6 +110,15 @@ hypreDevice_CSRSpGemmCusparseGenericAPI(HYPRE_Int m, void *dBuffer1 = NULL; void *dBuffer2 = NULL; +#ifdef HYPRE_SPGEMM_TIMING + HYPRE_Real t1, t2; +#endif + +#ifdef HYPRE_SPGEMM_TIMING + hypre_ForceSyncComputeStream(); + t1 = hypre_MPI_Wtime(); +#endif + /* Do work estimation */ HYPRE_CUSPARSE_CALL( cusparseSpGEMM_workEstimation(cusparsehandle, opA, opB, &alpha, matA, matB, &beta, matC, @@ -117,6 +131,16 @@ hypreDevice_CSRSpGemmCusparseGenericAPI(HYPRE_Int m, computeType, CUSPARSE_SPGEMM_DEFAULT, spgemmDesc, &bufferSize1, dBuffer1) ); +#ifdef HYPRE_SPGEMM_TIMING + hypre_ForceSyncComputeStream(); + t2 = hypre_MPI_Wtime() - t1; + hypre_printf("WorkEst %f\n", t2); +#endif + +#ifdef HYPRE_SPGEMM_TIMING + t1 = hypre_MPI_Wtime(); +#endif + /* Do computation */ HYPRE_CUSPARSE_CALL( cusparseSpGEMM_compute(cusparsehandle, opA, opB, &alpha, matA, matB, &beta, matC, @@ -130,9 +154,19 @@ hypreDevice_CSRSpGemmCusparseGenericAPI(HYPRE_Int m, computeType, CUSPARSE_SPGEMM_DEFAULT, spgemmDesc, &bufferSize2, dBuffer2) ); +#ifdef HYPRE_SPGEMM_TIMING + hypre_ForceSyncComputeStream(); + t2 = hypre_MPI_Wtime() - t1; + hypre_printf("Compute %f\n", t2); +#endif + +#ifdef HYPRE_SPGEMM_TIMING + t1 = hypre_MPI_Wtime(); +#endif + /* Required by cusparse api (as of 11) to be int64_t */ int64_t C_num_rows, C_num_cols, nnzC; - HYPRE_Int *d_ic, *d_jc; + HYPRE_Int *d_jc; HYPRE_Complex *d_c; /* Get required information for C */ @@ -141,19 +175,24 @@ hypreDevice_CSRSpGemmCusparseGenericAPI(HYPRE_Int m, hypre_assert(C_num_rows == m); hypre_assert(C_num_cols == n); - d_ic = hypre_TAlloc(HYPRE_Int, C_num_rows+1, HYPRE_MEMORY_DEVICE); - d_jc = hypre_TAlloc(HYPRE_Int, nnzC, HYPRE_MEMORY_DEVICE); - d_c = hypre_TAlloc(HYPRE_Complex, nnzC, HYPRE_MEMORY_DEVICE); + d_jc = hypre_TAlloc(HYPRE_Int, nnzC, HYPRE_MEMORY_DEVICE); + d_c = hypre_TAlloc(HYPRE_Complex, nnzC, HYPRE_MEMORY_DEVICE); /* Setup the required descriptor for C */ HYPRE_CUSPARSE_CALL(cusparseCsrSetPointers(matC, d_ic, d_jc, d_c)); /* Copy the data into C */ - HYPRE_CUSPARSE_CALL(cusparseSpGEMM_copy( cusparsehandle, opA, opB, - &alpha, matA, matB, &beta, matC, + HYPRE_CUSPARSE_CALL(cusparseSpGEMM_copy( cusparsehandle, opA, opB, + &alpha, matA, matB, &beta, matC, computeType, CUSPARSE_SPGEMM_DEFAULT, spgemmDesc) ); +#ifdef HYPRE_SPGEMM_TIMING + hypre_ForceSyncComputeStream(); + t2 = hypre_MPI_Wtime() - t1; + hypre_printf("Copy %f\n", t2); +#endif + /* Cleanup the data */ HYPRE_CUSPARSE_CALL( cusparseSpGEMM_destroyDescr(spgemmDesc) ); HYPRE_CUSPARSE_CALL( cusparseDestroySpMat(matA) ); @@ -198,6 +237,14 @@ hypreDevice_CSRSpGemmCusparseOldAPI(HYPRE_Int m, HYPRE_Int *d_ja_sorted, *d_jb_sorted; HYPRE_Complex *d_c, *d_a_sorted, *d_b_sorted; +#ifdef HYPRE_SPGEMM_TIMING + HYPRE_Real t1, t2; +#endif + +#ifdef HYPRE_SPGEMM_TIMING + t1 = hypre_MPI_Wtime(); +#endif + /* Allocate space for sorted arrays */ d_a_sorted = hypre_TAlloc(HYPRE_Complex, nnzA, HYPRE_MEMORY_DEVICE); d_b_sorted = hypre_TAlloc(HYPRE_Complex, nnzB, HYPRE_MEMORY_DEVICE); @@ -208,11 +255,6 @@ hypreDevice_CSRSpGemmCusparseOldAPI(HYPRE_Int m, cusparseOperation_t transA = CUSPARSE_OPERATION_NON_TRANSPOSE; cusparseOperation_t transB = CUSPARSE_OPERATION_NON_TRANSPOSE; - HYPRE_Int isDoublePrecision = sizeof(HYPRE_Complex) == sizeof(hypre_double); - HYPRE_Int isSinglePrecision = sizeof(HYPRE_Complex) == sizeof(hypre_double) / 2; - - hypre_assert(isDoublePrecision || isSinglePrecision); - /* Copy the unsorted over as the initial "sorted" */ hypre_TMemcpy(d_ja_sorted, d_ja, HYPRE_Int, nnzA, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); hypre_TMemcpy(d_a_sorted, d_a, HYPRE_Complex, nnzA, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); @@ -223,11 +265,21 @@ hypreDevice_CSRSpGemmCusparseOldAPI(HYPRE_Int m, hypre_SortCSRCusparse(m, k, nnzA, descr_A, d_ia, d_ja_sorted, d_a_sorted); hypre_SortCSRCusparse(k, n, nnzB, descr_B, d_ib, d_jb_sorted, d_b_sorted); +#ifdef HYPRE_SPGEMM_TIMING + hypre_ForceSyncComputeStream(); + t2 = hypre_MPI_Wtime() - t1; + hypre_printf("sort %f\n", t2); +#endif + +#ifdef HYPRE_SPGEMM_TIMING + t1 = hypre_MPI_Wtime(); +#endif + // nnzTotalDevHostPtr points to host memory HYPRE_Int *nnzTotalDevHostPtr = &nnzC; HYPRE_CUSPARSE_CALL( cusparseSetPointerMode(cusparsehandle, CUSPARSE_POINTER_MODE_HOST) ); - d_ic = hypre_TAlloc(HYPRE_Int, m+1, HYPRE_MEMORY_DEVICE); + d_ic = hypre_TAlloc(HYPRE_Int, m + 1, HYPRE_MEMORY_DEVICE); HYPRE_CUSPARSE_CALL( cusparseXcsrgemmNnz(cusparsehandle, transA, transB, m, n, k, @@ -247,23 +299,29 @@ hypreDevice_CSRSpGemmCusparseOldAPI(HYPRE_Int m, nnzC -= baseC; } +#ifdef HYPRE_SPGEMM_TIMING + hypre_ForceSyncComputeStream(); + t2 = hypre_MPI_Wtime() - t1; + hypre_printf("csrgemmNnz %f\n", t2); +#endif + +#ifdef HYPRE_SPGEMM_TIMING + t1 = hypre_MPI_Wtime(); +#endif + d_jc = hypre_TAlloc(HYPRE_Int, nnzC, HYPRE_MEMORY_DEVICE); d_c = hypre_TAlloc(HYPRE_Complex, nnzC, HYPRE_MEMORY_DEVICE); - if (isDoublePrecision) - { - HYPRE_CUSPARSE_CALL( cusparseDcsrgemm(cusparsehandle, transA, transB, m, n, k, - descr_A, nnzA, d_a_sorted, d_ia, d_ja_sorted, - descr_B, nnzB, d_b_sorted, d_ib, d_jb_sorted, - descr_C, d_c, d_ic, d_jc) ); - } - else if (isSinglePrecision) - { - HYPRE_CUSPARSE_CALL( cusparseScsrgemm(cusparsehandle, transA, transB, m, n, k, - descr_A, nnzA, (float *) d_a_sorted, d_ia, d_ja_sorted, - descr_B, nnzB, (float *) d_b_sorted, d_ib, d_jb_sorted, - descr_C, (float *) d_c, d_ic, d_jc) ); - } + HYPRE_CUSPARSE_CALL( hypre_cusparse_csrgemm(cusparsehandle, transA, transB, m, n, k, + descr_A, nnzA, d_a_sorted, d_ia, d_ja_sorted, + descr_B, nnzB, d_b_sorted, d_ib, d_jb_sorted, + descr_C, d_c, d_ic, d_jc) ); + +#ifdef HYPRE_SPGEMM_TIMING + hypre_ForceSyncComputeStream(); + t2 = hypre_MPI_Wtime() - t1; + hypre_printf("csrgemm %f\n", t2); +#endif *d_ic_out = d_ic; *d_jc_out = d_jc; @@ -280,4 +338,3 @@ hypreDevice_CSRSpGemmCusparseOldAPI(HYPRE_Int m, #endif /* #if CUSPARSE_VERSION >= CUSPARSE_NEWAPI_VERSION */ #endif /* #if defined(HYPRE_USING_CUDA) && defined(HYPRE_USING_CUSPARSE) */ - diff --git a/external/hypre/src/seq_mv/csr_spgemm_device_numblocks.c b/external/hypre/src/seq_mv/csr_spgemm_device_numblocks.c new file mode 100644 index 00000000..cec1e56f --- /dev/null +++ b/external/hypre/src/seq_mv/csr_spgemm_device_numblocks.c @@ -0,0 +1,149 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#include "seq_mv.h" + +#if defined(HYPRE_USING_GPU) + +#include "csr_spgemm_device.h" + +HYPRE_Int hypreDevice_CSRSpGemmBinnedGetBlockNumDim() +{ + hypre_int multiProcessorCount = 0; + /* bins 1, 2, ..., num_bins, are effective; 0 is reserved for empty rows */ + const HYPRE_Int num_bins = 10; + + hypre_HandleSpgemmNumBin(hypre_handle()) = num_bins; + +#if defined(HYPRE_USING_CUDA) + HYPRE_CUDA_CALL(cudaDeviceGetAttribute( + &multiProcessorCount, + cudaDevAttrMultiProcessorCount, + hypre_HandleDevice(hypre_handle()))); + +#elif defined(HYPRE_USING_HIP) + HYPRE_HIP_CALL(hipDeviceGetAttribute( + &multiProcessorCount, + hipDeviceAttributeMultiprocessorCount, + hypre_HandleDevice(hypre_handle()))); + +#elif defined(HYPRE_USING_SYCL) + multiProcessorCount = + hypre_HandleDevice(hypre_handle())->get_info(); +#endif + + typedef HYPRE_Int arrType[4][HYPRE_SPGEMM_MAX_NBIN + 1]; + arrType &max_nblocks = hypre_HandleSpgemmBlockNumDim(hypre_handle()); + + for (HYPRE_Int i = 0; i < num_bins + 1; i++) + { + max_nblocks[0][i] = max_nblocks[1][i] = max_nblocks[2][i] = max_nblocks[3][i] = 0; + } + + /* symbolic */ + hypre_spgemm_symbolic_max_num_blocks< SYMBL_HASH_SIZE[1], T_GROUP_SIZE[1] > + (multiProcessorCount, &max_nblocks[0][1], &max_nblocks[2][1]); + + hypre_spgemm_symbolic_max_num_blocks< SYMBL_HASH_SIZE[2], T_GROUP_SIZE[2] > + (multiProcessorCount, &max_nblocks[0][2], &max_nblocks[2][2]); + + hypre_spgemm_symbolic_max_num_blocks< SYMBL_HASH_SIZE[3], T_GROUP_SIZE[3] > + (multiProcessorCount, &max_nblocks[0][3], &max_nblocks[2][3]); + + hypre_spgemm_symbolic_max_num_blocks< SYMBL_HASH_SIZE[4], T_GROUP_SIZE[4] > + (multiProcessorCount, &max_nblocks[0][4], &max_nblocks[2][4]); + + hypre_spgemm_symbolic_max_num_blocks< SYMBL_HASH_SIZE[5], T_GROUP_SIZE[5] > + (multiProcessorCount, &max_nblocks[0][5], &max_nblocks[2][5]); + + hypre_spgemm_symbolic_max_num_blocks< SYMBL_HASH_SIZE[6], T_GROUP_SIZE[6] > + (multiProcessorCount, &max_nblocks[0][6], &max_nblocks[2][6]); + + hypre_spgemm_symbolic_max_num_blocks< SYMBL_HASH_SIZE[7], T_GROUP_SIZE[7] > + (multiProcessorCount, &max_nblocks[0][7], &max_nblocks[2][7]); + + hypre_spgemm_symbolic_max_num_blocks< SYMBL_HASH_SIZE[8], T_GROUP_SIZE[8] > + (multiProcessorCount, &max_nblocks[0][8], &max_nblocks[2][8]); + + hypre_spgemm_symbolic_max_num_blocks< SYMBL_HASH_SIZE[9], T_GROUP_SIZE[9] > + (multiProcessorCount, &max_nblocks[0][9], &max_nblocks[2][9]); + + hypre_spgemm_symbolic_max_num_blocks< SYMBL_HASH_SIZE[10], T_GROUP_SIZE[10] > + (multiProcessorCount, &max_nblocks[0][10], &max_nblocks[2][10]); + + /* numeric */ + hypre_spgemm_numerical_max_num_blocks< NUMER_HASH_SIZE[1], T_GROUP_SIZE[1] > + (multiProcessorCount, &max_nblocks[1][1], &max_nblocks[3][1]); + + hypre_spgemm_numerical_max_num_blocks< NUMER_HASH_SIZE[2], T_GROUP_SIZE[2] > + (multiProcessorCount, &max_nblocks[1][2], &max_nblocks[3][2]); + + hypre_spgemm_numerical_max_num_blocks< NUMER_HASH_SIZE[3], T_GROUP_SIZE[3] > + (multiProcessorCount, &max_nblocks[1][3], &max_nblocks[3][3]); + + hypre_spgemm_numerical_max_num_blocks< NUMER_HASH_SIZE[4], T_GROUP_SIZE[4] > + (multiProcessorCount, &max_nblocks[1][4], &max_nblocks[3][4]); + + hypre_spgemm_numerical_max_num_blocks< NUMER_HASH_SIZE[5], T_GROUP_SIZE[5] > + (multiProcessorCount, &max_nblocks[1][5], &max_nblocks[3][5]); + + hypre_spgemm_numerical_max_num_blocks< NUMER_HASH_SIZE[6], T_GROUP_SIZE[6] > + (multiProcessorCount, &max_nblocks[1][6], &max_nblocks[3][6]); + + hypre_spgemm_numerical_max_num_blocks< NUMER_HASH_SIZE[7], T_GROUP_SIZE[7] > + (multiProcessorCount, &max_nblocks[1][7], &max_nblocks[3][7]); + + hypre_spgemm_numerical_max_num_blocks< NUMER_HASH_SIZE[8], T_GROUP_SIZE[8] > + (multiProcessorCount, &max_nblocks[1][8], &max_nblocks[3][8]); + + hypre_spgemm_numerical_max_num_blocks< NUMER_HASH_SIZE[9], T_GROUP_SIZE[9] > + (multiProcessorCount, &max_nblocks[1][9], &max_nblocks[3][9]); + + hypre_spgemm_numerical_max_num_blocks< NUMER_HASH_SIZE[10], T_GROUP_SIZE[10] > + (multiProcessorCount, &max_nblocks[1][10], &max_nblocks[3][10]); + + /* highest bin with nonzero num blocks */ + typedef HYPRE_Int arr2Type[2]; + arr2Type &high_bin = hypre_HandleSpgemmHighestBin(hypre_handle()); + + for (HYPRE_Int i = num_bins; i >= 0; i--) { if (max_nblocks[0][i] > 0) { high_bin[0] = i; break; } } + for (HYPRE_Int i = num_bins; i >= 0; i--) { if (max_nblocks[1][i] > 0) { high_bin[1] = i; break; } } + + /* this is just a heuristic; having more blocks (than max active) seems improving performance */ +#if defined(HYPRE_USING_CUDA) + for (HYPRE_Int i = 0; i < num_bins + 1; i++) { max_nblocks[0][i] *= 5; max_nblocks[1][i] *= 5; } +#endif + +#if defined(HYPRE_SPGEMM_PRINTF) + HYPRE_SPGEMM_PRINT("===========================================================================\n"); + HYPRE_SPGEMM_PRINT("SM count %d\n", multiProcessorCount); + HYPRE_SPGEMM_PRINT("Highest Bin Symbl %d, Numer %d\n", + hypre_HandleSpgemmHighestBin(hypre_handle())[0], + hypre_HandleSpgemmHighestBin(hypre_handle())[1]); + HYPRE_SPGEMM_PRINT("---------------------------------------------------------------------------\n"); + HYPRE_SPGEMM_PRINT("Bin: "); + for (HYPRE_Int i = 0; i < num_bins + 1; i++) { HYPRE_SPGEMM_PRINT("%5d ", i); } HYPRE_SPGEMM_PRINT("\n"); + HYPRE_SPGEMM_PRINT("---------------------------------------------------------------------------\n"); + HYPRE_SPGEMM_PRINT("Sym-Bdim: "); + for (HYPRE_Int i = 0; i < num_bins + 1; i++) { HYPRE_SPGEMM_PRINT("%5d ", hypre_HandleSpgemmBlockNumDim(hypre_handle())[2][i]); } + HYPRE_SPGEMM_PRINT("\n"); + HYPRE_SPGEMM_PRINT("Sym-Gdim: "); + for (HYPRE_Int i = 0; i < num_bins + 1; i++) { HYPRE_SPGEMM_PRINT("%5d ", hypre_HandleSpgemmBlockNumDim(hypre_handle())[0][i]); } + HYPRE_SPGEMM_PRINT("\n"); + HYPRE_SPGEMM_PRINT("Num-Bdim: "); + for (HYPRE_Int i = 0; i < num_bins + 1; i++) { HYPRE_SPGEMM_PRINT("%5d ", hypre_HandleSpgemmBlockNumDim(hypre_handle())[3][i]); } + HYPRE_SPGEMM_PRINT("\n"); + HYPRE_SPGEMM_PRINT("Num-Gdim: "); + for (HYPRE_Int i = 0; i < num_bins + 1; i++) { HYPRE_SPGEMM_PRINT("%5d ", hypre_HandleSpgemmBlockNumDim(hypre_handle())[1][i]); } + HYPRE_SPGEMM_PRINT("\n"); + HYPRE_SPGEMM_PRINT("===========================================================================\n"); +#endif + + return hypre_error_flag; +} + +#endif /* defined(HYPRE_USING_GPU) */ diff --git a/external/hypre/src/seq_mv/csr_spgemm_device_numer.c b/external/hypre/src/seq_mv/csr_spgemm_device_numer.c new file mode 100644 index 00000000..7d93d2b3 --- /dev/null +++ b/external/hypre/src/seq_mv/csr_spgemm_device_numer.c @@ -0,0 +1,238 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#include "_hypre_onedpl.hpp" +#include "seq_mv.h" +#include "csr_spgemm_device.h" + +#if defined(HYPRE_USING_GPU) + +/* + * d_rc: input: nnz (upper bound) of each row + * exact_rownnz: if d_rc is exact + */ +HYPRE_Int +hypreDevice_CSRSpGemmNumerWithRownnzUpperboundNoBin( HYPRE_Int m, + HYPRE_Int k, + HYPRE_Int n, + HYPRE_Int *d_ia, + HYPRE_Int *d_ja, + HYPRE_Complex *d_a, + HYPRE_Int *d_ib, + HYPRE_Int *d_jb, + HYPRE_Complex *d_b, + HYPRE_Int *d_rc, + HYPRE_Int exact_rownnz, + HYPRE_Int **d_ic_out, + HYPRE_Int **d_jc_out, + HYPRE_Complex **d_c_out, + HYPRE_Int *nnzC_out ) +{ + static constexpr HYPRE_Int SHMEM_HASH_SIZE = NUMER_HASH_SIZE[HYPRE_SPGEMM_DEFAULT_BIN]; + static constexpr HYPRE_Int GROUP_SIZE = T_GROUP_SIZE[HYPRE_SPGEMM_DEFAULT_BIN]; + static constexpr HYPRE_Int BIN = HYPRE_SPGEMM_DEFAULT_BIN; + +#ifdef HYPRE_SPGEMM_PRINTF +#if defined(HYPRE_USING_SYCL) + HYPRE_Int max_rc = HYPRE_ONEDPL_CALL(std::reduce, d_rc, d_rc + m, 0, + sycl::maximum()); + HYPRE_Int min_rc = HYPRE_ONEDPL_CALL(std::reduce, d_rc, d_rc + m, max_rc, + sycl::minimum()); +#else + HYPRE_Int max_rc = HYPRE_THRUST_CALL(reduce, d_rc, d_rc + m, 0, thrust::maximum()); + HYPRE_Int min_rc = HYPRE_THRUST_CALL(reduce, d_rc, d_rc + m, max_rc, thrust::minimum()); +#endif + HYPRE_SPGEMM_PRINT("%s[%d]: max RC %d, min RC %d\n", __FILE__, __LINE__, max_rc, min_rc); +#endif + + /* if rc contains exact rownnz: can allocate the final C=(ic,jc,c) directly; + if rc contains upper bound : it is a temporary space that is more than enough to store C */ + HYPRE_Int *d_ic = hypre_TAlloc(HYPRE_Int, m + 1, HYPRE_MEMORY_DEVICE); + HYPRE_Int *d_jc; + HYPRE_Complex *d_c; + HYPRE_Int nnzC = -1; + + hypre_create_ija(m, NULL, d_rc, d_ic, &d_jc, &d_c, &nnzC); + +#ifdef HYPRE_SPGEMM_PRINTF + HYPRE_SPGEMM_PRINT("%s[%d]: nnzC %d\n", __FILE__, __LINE__, nnzC); +#endif + + + /* even with exact rownnz, still may need global hash, since shared hash is smaller than symbol */ + hypre_spgemm_numerical_with_rownnz + (m, NULL, k, n, true, exact_rownnz, d_ia, d_ja, d_a, d_ib, d_jb, d_b, d_rc, d_ic, d_jc, d_c); + + if (!exact_rownnz) + { + hypreDevice_CSRSpGemmNumerPostCopy(m, d_rc, &nnzC, &d_ic, &d_jc, &d_c); + } + + *d_ic_out = d_ic; + *d_jc_out = d_jc; + *d_c_out = d_c; + *nnzC_out = nnzC; + + return hypre_error_flag; +} + +#define HYPRE_SPGEMM_NUMERICAL_WITH_ROWNNZ_BINNED2(BIN, BIN2, SHMEM_HASH_SIZE, GROUP_SIZE, EXACT_ROWNNZ, GHASH) \ +{ \ + const HYPRE_Int p = h_bin_ptr[BIN - 1]; \ + const HYPRE_Int q = h_bin_ptr[BIN]; \ + const HYPRE_Int bs = q - p; \ + if (bs) \ + { \ + HYPRE_SPGEMM_PRINT("bin[%d]: %d rows, p %d, q %d\n", BIN, bs, p, q); \ + hypre_spgemm_numerical_with_rownnz \ + (bs, d_rind + p, k, n, GHASH, EXACT_ROWNNZ, d_ia, d_ja, d_a, d_ib, d_jb, d_b, d_rc, d_ic, d_jc, d_c); \ + } \ +} + +#define HYPRE_SPGEMM_NUMERICAL_WITH_ROWNNZ_BINNED(BIN, SHMEM_HASH_SIZE, GROUP_SIZE, EXACT_ROWNNZ, GHASH) \ + HYPRE_SPGEMM_NUMERICAL_WITH_ROWNNZ_BINNED2(BIN, BIN, SHMEM_HASH_SIZE, GROUP_SIZE, EXACT_ROWNNZ, GHASH) + +HYPRE_Int +hypreDevice_CSRSpGemmNumerWithRownnzUpperboundBinned( HYPRE_Int m, + HYPRE_Int k, + HYPRE_Int n, + HYPRE_Int *d_ia, + HYPRE_Int *d_ja, + HYPRE_Complex *d_a, + HYPRE_Int *d_ib, + HYPRE_Int *d_jb, + HYPRE_Complex *d_b, + HYPRE_Int *d_rc, + HYPRE_Int exact_rownnz, + HYPRE_Int **d_ic_out, + HYPRE_Int **d_jc_out, + HYPRE_Complex **d_c_out, + HYPRE_Int *nnzC_out ) +{ + /* if rc contains exact rownnz: can allocate the final C=(ic,jc,c) directly; + if rc contains upper bound : it is a temporary space that is more than enough to store C */ + HYPRE_Int *d_ic = hypre_TAlloc(HYPRE_Int, m + 1, HYPRE_MEMORY_DEVICE); + HYPRE_Int *d_jc; + HYPRE_Complex *d_c; + HYPRE_Int nnzC = -1; + + hypre_create_ija(m, NULL, d_rc, d_ic, &d_jc, &d_c, &nnzC); + +#ifdef HYPRE_SPGEMM_PRINTF + HYPRE_SPGEMM_PRINT("%s[%d]: nnzC %d\n", __FILE__, __LINE__, nnzC); +#endif + + HYPRE_Int *d_rind = hypre_TAlloc(HYPRE_Int, m, HYPRE_MEMORY_DEVICE); + HYPRE_Int h_bin_ptr[HYPRE_SPGEMM_MAX_NBIN + 1]; + //HYPRE_Int num_bins = hypre_HandleSpgemmNumBin(hypre_handle()); + HYPRE_Int high_bin = hypre_HandleSpgemmHighestBin(hypre_handle())[1]; + const bool hbin9 = 9 == high_bin; + const char s = NUMER_HASH_SIZE[1] / 2, t = 2, u = high_bin; + + hypre_SpGemmCreateBins(m, s, t, u, d_rc, false, d_rind, h_bin_ptr); + +#if 0 + HYPRE_SPGEMM_NUMERICAL_WITH_ROWNNZ_BINNED( 1, NUMER_HASH_SIZE[ 1], T_GROUP_SIZE[ 1], exact_rownnz, + false); +#endif + HYPRE_SPGEMM_NUMERICAL_WITH_ROWNNZ_BINNED( 2, NUMER_HASH_SIZE[ 2], T_GROUP_SIZE[ 2], exact_rownnz, + false); + HYPRE_SPGEMM_NUMERICAL_WITH_ROWNNZ_BINNED( 3, NUMER_HASH_SIZE[ 3], T_GROUP_SIZE[ 3], exact_rownnz, + false); + HYPRE_SPGEMM_NUMERICAL_WITH_ROWNNZ_BINNED( 4, NUMER_HASH_SIZE[ 4], T_GROUP_SIZE[ 4], exact_rownnz, + false); + HYPRE_SPGEMM_NUMERICAL_WITH_ROWNNZ_BINNED( 5, NUMER_HASH_SIZE[ 5], T_GROUP_SIZE[ 5], exact_rownnz, + false); + HYPRE_SPGEMM_NUMERICAL_WITH_ROWNNZ_BINNED( 6, NUMER_HASH_SIZE[ 6], T_GROUP_SIZE[ 6], exact_rownnz, + false); + HYPRE_SPGEMM_NUMERICAL_WITH_ROWNNZ_BINNED( 7, NUMER_HASH_SIZE[ 7], T_GROUP_SIZE[ 7], exact_rownnz, + false); + HYPRE_SPGEMM_NUMERICAL_WITH_ROWNNZ_BINNED( 8, NUMER_HASH_SIZE[ 8], T_GROUP_SIZE[ 8], exact_rownnz, + false); + HYPRE_SPGEMM_NUMERICAL_WITH_ROWNNZ_BINNED( 9, NUMER_HASH_SIZE[ 9], T_GROUP_SIZE[ 9], exact_rownnz, + hbin9); + HYPRE_SPGEMM_NUMERICAL_WITH_ROWNNZ_BINNED( 10, NUMER_HASH_SIZE[10], T_GROUP_SIZE[10], exact_rownnz, + true); + + if (!exact_rownnz) + { + hypreDevice_CSRSpGemmNumerPostCopy(m, d_rc, &nnzC, &d_ic, &d_jc, &d_c); + } + + *d_ic_out = d_ic; + *d_jc_out = d_jc; + *d_c_out = d_c; + *nnzC_out = nnzC; + + hypre_TFree(d_rind, HYPRE_MEMORY_DEVICE); + + return hypre_error_flag; +} + +HYPRE_Int +hypreDevice_CSRSpGemmNumerWithRownnzUpperbound( HYPRE_Int m, + HYPRE_Int k, + HYPRE_Int n, + HYPRE_Int *d_ia, + HYPRE_Int *d_ja, + HYPRE_Complex *d_a, + HYPRE_Int *d_ib, + HYPRE_Int *d_jb, + HYPRE_Complex *d_b, + HYPRE_Int *d_rc, + HYPRE_Int exact_rownnz, + HYPRE_Int **d_ic_out, + HYPRE_Int **d_jc_out, + HYPRE_Complex **d_c_out, + HYPRE_Int *nnzC_out ) + +{ + HYPRE_UNUSED_VAR(exact_rownnz); + +#ifdef HYPRE_PROFILE + hypre_profile_times[HYPRE_TIMER_ID_SPGEMM_NUMERIC] -= hypre_MPI_Wtime(); +#endif + +#ifdef HYPRE_SPGEMM_NVTX + hypre_GpuProfilingPushRange("CSRSpGemmNumer"); +#endif + +#ifdef HYPRE_SPGEMM_TIMING + HYPRE_Real t1 = hypre_MPI_Wtime(); +#endif + + const HYPRE_Int binned = hypre_HandleSpgemmBinned(hypre_handle()); + + if (binned) + { + hypreDevice_CSRSpGemmNumerWithRownnzUpperboundBinned + (m, k, n, d_ia, d_ja, d_a, d_ib, d_jb, d_b, d_rc, 1, d_ic_out, d_jc_out, d_c_out, nnzC_out); + } + else + { + hypreDevice_CSRSpGemmNumerWithRownnzUpperboundNoBin + (m, k, n, d_ia, d_ja, d_a, d_ib, d_jb, d_b, d_rc, 1, d_ic_out, d_jc_out, d_c_out, nnzC_out); + } + +#ifdef HYPRE_SPGEMM_TIMING + hypre_ForceSyncComputeStream(); + HYPRE_Real t2 = hypre_MPI_Wtime() - t1; + HYPRE_SPGEMM_PRINT("SpGemmNumerical time %f\n", t2); +#endif + +#ifdef HYPRE_SPGEMM_NVTX + hypre_GpuProfilingPopRange(); +#endif + +#ifdef HYPRE_PROFILE + hypre_profile_times[HYPRE_TIMER_ID_SPGEMM_NUMERIC] += hypre_MPI_Wtime(); +#endif + + return hypre_error_flag; +} + +#endif /* defined(HYPRE_USING_GPU) */ diff --git a/external/hypre/src/seq_mv/csr_spgemm_device_numer.h b/external/hypre/src/seq_mv/csr_spgemm_device_numer.h new file mode 100644 index 00000000..5da27470 --- /dev/null +++ b/external/hypre/src/seq_mv/csr_spgemm_device_numer.h @@ -0,0 +1,889 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +/*- - - - - - - - - - - - - - - - - - - - - - - - - - * + Perform SpGEMM with Row Nnz Upper Bound + *- - - - - - - - - - - - - - - - - - - - - - - - - - */ +#include "seq_mv.h" +#include "csr_spgemm_device.h" + +/*- - - - - - - - - - - - - - - - - - - - - - - - - - * + Numerical Multiplication + *- - - - - - - - - - - - - - - - - - - - - - - - - - */ + +#if defined(HYPRE_USING_GPU) + +/* HashKeys: assumed to be initialized as all -1's + * HashVals: assumed to be initialized as all 0's + * Key: assumed to be nonnegative + */ +template +static __device__ __forceinline__ +HYPRE_Int +hypre_spgemm_hash_insert_numer( +#if defined(HYPRE_USING_SYCL) + HYPRE_Int *HashKeys, + HYPRE_Complex *HashVals, +#else + volatile HYPRE_Int *HashKeys, + volatile HYPRE_Complex *HashVals, +#endif + HYPRE_Int key, + HYPRE_Complex val ) +{ + HYPRE_Int j = 0; + HYPRE_Int old = -1; + +#if defined(HYPRE_USING_HIP) && (HIP_VERSION == 50422804) + /* VPM: see https://github.com/hypre-space/hypre/issues/875 */ +#pragma unroll 8 +#else +#pragma unroll UNROLL_FACTOR +#endif + for (HYPRE_Int i = 0; i < SHMEM_HASH_SIZE; i++) + { + /* compute the hash value of key */ + if (i == 0) + { + j = key & (SHMEM_HASH_SIZE - 1); + } + else + { + j = HashFunc(key, i, j); + } + + /* try to insert key+1 into slot j */ +#if defined(HYPRE_USING_SYCL) + auto atomic_key = sycl::atomic_ref < + HYPRE_Int, sycl::memory_order::relaxed, + sycl::memory_scope::device, + sycl::access::address_space::local_space > (HashKeys[j]); + old = -1; + atomic_key.compare_exchange_strong(old, key); +#else + old = atomicCAS((HYPRE_Int *)(HashKeys + j), -1, key); +#endif + + if (old == -1 || old == key) + { + /* this slot was open or contained 'key', update value */ +#if defined(HYPRE_USING_SYCL) + auto atomic_val = sycl::atomic_ref < + HYPRE_Complex, sycl::memory_order::relaxed, + sycl::memory_scope::device, + sycl::access::address_space::local_space > (HashVals[j]); + /* WM: replacing fetch_add(), which has slow performance due to poor compiler interpretation */ + /* atomic_val.fetch_add(val); */ + auto curr = atomic_val.load(sycl::memory_order::relaxed); + while (!atomic_val.compare_exchange_strong(curr, curr + val, sycl::memory_order::relaxed)) {} +#else + atomicAdd((HYPRE_Complex*)(HashVals + j), val); +#endif + return j; + } + } + + return -1; +} + +template +static __device__ __forceinline__ +HYPRE_Int +hypre_spgemm_hash_insert_numer( HYPRE_Int HashSize, +#if defined(HYPRE_USING_SYCL) + HYPRE_Int *HashKeys, + HYPRE_Complex *HashVals, +#else + volatile HYPRE_Int *HashKeys, + volatile HYPRE_Complex *HashVals, +#endif + HYPRE_Int key, + HYPRE_Complex val ) +{ + HYPRE_Int j = 0; + HYPRE_Int old = -1; + + for (HYPRE_Int i = 0; i < HashSize; i++) + { + /* compute the hash value of key */ + if (i == 0) + { + j = key & (HashSize - 1); + } + else + { + j = HashFunc(HashSize, key, i, j); + } + + /* try to insert key+1 into slot j */ +#if defined(HYPRE_USING_SYCL) + auto atomic_key = sycl::atomic_ref < + HYPRE_Int, sycl::memory_order::relaxed, + sycl::memory_scope::device, + sycl::access::address_space::local_space > (HashKeys[j]); + old = -1; + atomic_key.compare_exchange_strong(old, key); +#else + old = atomicCAS((HYPRE_Int *)(HashKeys + j), -1, key); +#endif + + if (old == -1 || old == key) + { + /* this slot was open or contained 'key', update value */ +#if defined(HYPRE_USING_SYCL) + auto atomic_val = sycl::atomic_ref < + HYPRE_Complex, sycl::memory_order::relaxed, + sycl::memory_scope::device, + sycl::access::address_space::local_space > (HashVals[j]); + /* WM: replacing fetch_add(), which has slow performance due to poor compiler interpretation */ + /* atomic_val.fetch_add(val); */ + auto curr = atomic_val.load(sycl::memory_order::relaxed); + while (!atomic_val.compare_exchange_strong(curr, curr + val, sycl::memory_order::relaxed)) {} +#else + atomicAdd((HYPRE_Complex*)(HashVals + j), val); +#endif + return j; + } + } + + return -1; +} + +template +static __device__ __forceinline__ +void +hypre_spgemm_compute_row_numer( hypre_DeviceItem &item, + HYPRE_Int istart_a, + HYPRE_Int iend_a, + HYPRE_Int istart_c, +#if defined(HYPRE_DEBUG) + HYPRE_Int iend_c, +#endif + const HYPRE_Int *ja, + const HYPRE_Complex *aa, + const HYPRE_Int *ib, + const HYPRE_Int *jb, + const HYPRE_Complex *ab, + HYPRE_Int *jc, + HYPRE_Complex *ac, +#if defined(HYPRE_USING_SYCL) + HYPRE_Int *s_HashKeys, + HYPRE_Complex *s_HashVals, +#else + volatile HYPRE_Int *s_HashKeys, + volatile HYPRE_Complex *s_HashVals, +#endif + HYPRE_Int g_HashSize, + HYPRE_Int *g_HashKeys, + HYPRE_Complex *g_HashVals ) +{ +#if defined(HYPRE_USING_SYCL) + HYPRE_Int threadIdx_x = item.get_local_id(2); + HYPRE_Int threadIdx_y = item.get_local_id(1); + HYPRE_Int blockDim_x = item.get_local_range(2); + HYPRE_Int blockDim_y = item.get_local_range(1); +#else + HYPRE_Int threadIdx_x = threadIdx.x; + HYPRE_Int threadIdx_y = threadIdx.y; + HYPRE_Int blockDim_x = blockDim.x; + HYPRE_Int blockDim_y = blockDim.y; +#endif + /* load column idx and values of row of A */ + for (HYPRE_Int i = istart_a + threadIdx_y; warp_any_sync(item, HYPRE_WARP_FULL_MASK, i < iend_a); + i += blockDim_y) + { + HYPRE_Int rowB = -1; + HYPRE_Complex mult = 0.0; + + if (threadIdx_x == 0 && i < iend_a) + { + rowB = read_only_load(ja + i); + mult = aa ? read_only_load(aa + i) : 1.0; + } + +#if 0 + //const HYPRE_Int ymask = get_mask<4>(...); + // TODO: need to confirm the behavior of __ballot_sync, leave it here for now + //const HYPRE_Int num_valid_rows = __popc(__ballot_sync(ymask, valid_i)); + //for (HYPRE_Int j = 0; j < num_valid_rows; j++) +#endif + + /* threads in the same ygroup work on one row together */ + rowB = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, rowB, 0, blockDim_x); + mult = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, mult, 0, blockDim_x); + /* open this row of B, collectively */ + HYPRE_Int tmp = 0; + if (rowB != -1 && threadIdx_x < 2) + { + tmp = read_only_load(ib + rowB + threadIdx_x); + } + const HYPRE_Int rowB_start = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, tmp, 0, blockDim_x); + const HYPRE_Int rowB_end = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, tmp, 1, blockDim_x); + +#if defined(HYPRE_DEBUG) + if (IA1) { hypre_device_assert(rowB == -1 || rowB_end - rowB_start == iend_c - istart_c); } +#endif + + for (HYPRE_Int k = rowB_start + threadIdx_x; + warp_any_sync(item, HYPRE_WARP_FULL_MASK, k < rowB_end); + k += blockDim_x) + { + /* WM: todo - have a warp_any_sync(k < rowB_end) to enter the loop directly followed by if (k < rowB_end)... do we need the any_sync above? */ + /* I seem to be getting a hang here in sycl... does the use of atomics below require all threads in the group/subgroup to hit this or something? */ + if (k < rowB_end) + { + const HYPRE_Int k_idx = read_only_load(jb + k); + const HYPRE_Complex k_val = (ab ? read_only_load(ab + k) : 1.0) * mult; + + if (IA1) + { + jc[istart_c + k - rowB_start] = k_idx; + ac[istart_c + k - rowB_start] = k_val; + } + else + { + /* first try to insert into shared memory hash table */ + HYPRE_Int pos = hypre_spgemm_hash_insert_numer + (s_HashKeys, s_HashVals, k_idx, k_val); + + if (HAS_GHASH && -1 == pos) + { + pos = hypre_spgemm_hash_insert_numer + (g_HashSize, g_HashKeys, g_HashVals, k_idx, k_val); + } + + hypre_device_assert(pos != -1); + } + } + } + } +} + +template +static __device__ __forceinline__ +HYPRE_Int +hypre_spgemm_copy_from_hash_into_C_row( hypre_DeviceItem &item, + HYPRE_Int lane_id, + HYPRE_Int do_shared_copy, +#if defined(HYPRE_USING_SYCL) + HYPRE_Int *s_HashKeys, + HYPRE_Complex *s_HashVals, +#else + volatile HYPRE_Int *s_HashKeys, + volatile HYPRE_Complex *s_HashVals, +#endif + HYPRE_Int ghash_size, + HYPRE_Int *jg_start, + HYPRE_Complex *ag_start, + HYPRE_Int *jc_start, + HYPRE_Complex *ac_start ) +{ + HYPRE_Int j = 0; + const HYPRE_Int STEP_SIZE = hypre_min(GROUP_SIZE, HYPRE_WARP_SIZE); + + /* copy shared memory hash table into C */ + //#pragma unroll UNROLL_FACTOR + + if (warp_any_sync(item, HYPRE_WARP_FULL_MASK, do_shared_copy)) + { + for (HYPRE_Int k = lane_id; k < SHMEM_HASH_SIZE; k += STEP_SIZE) + { + HYPRE_Int sum; + HYPRE_Int key = do_shared_copy ? s_HashKeys[k] : -1; + HYPRE_Int pos = group_prefix_sum(item, lane_id, (HYPRE_Int) (key != -1), sum); + + if (key != -1) + { + jc_start[j + pos] = key; + ac_start[j + pos] = s_HashVals[k]; + } + j += sum; + } + } + + if (HAS_GHASH) + { + /* copy global memory hash table into C */ + for (HYPRE_Int k = lane_id; warp_any_sync(item, HYPRE_WARP_FULL_MASK, k < ghash_size); + k += STEP_SIZE) + { + HYPRE_Int sum; + HYPRE_Int key = k < ghash_size ? jg_start[k] : -1; + HYPRE_Int pos = group_prefix_sum(item, lane_id, (HYPRE_Int) (key != -1), sum); + + if (key != -1) + { + jc_start[j + pos] = key; + ac_start[j + pos] = ag_start[k]; + } + j += sum; + } + } + + return j; +} + +template +__global__ void +hypre_spgemm_numeric( hypre_DeviceItem &item, +#if defined(HYPRE_USING_SYCL) + char *shmem_ptr, +#endif + const HYPRE_Int M, + const HYPRE_Int* __restrict__ rind, + const HYPRE_Int* __restrict__ ia, + const HYPRE_Int* __restrict__ ja, + const HYPRE_Complex* __restrict__ aa, + const HYPRE_Int* __restrict__ ib, + const HYPRE_Int* __restrict__ jb, + const HYPRE_Complex* __restrict__ ab, + const HYPRE_Int* __restrict__ ic, + HYPRE_Int* __restrict__ jc, + HYPRE_Complex* __restrict__ ac, + HYPRE_Int* __restrict__ rc, + const HYPRE_Int* __restrict__ ig, + HYPRE_Int* __restrict__ jg, + HYPRE_Complex* __restrict__ ag ) +{ + /* number of groups in the grid */ +#if defined(HYPRE_USING_SYCL) + volatile const HYPRE_Int grid_num_groups = get_num_groups(item) * item.get_group_range(2); +#else + volatile const HYPRE_Int grid_num_groups = get_num_groups(item) * gridDim.x; +#endif + /* group id inside the block */ + volatile const HYPRE_Int group_id = get_group_id(item); + /* group id in the grid */ +#if defined(HYPRE_USING_SYCL) + volatile const HYPRE_Int grid_group_id = item.get_group(2) * get_num_groups(item) + group_id; +#else + volatile const HYPRE_Int grid_group_id = blockIdx.x * get_num_groups(item) + group_id; +#endif + /* lane id inside the group */ + volatile const HYPRE_Int lane_id = get_group_lane_id(item); +#if defined(HYPRE_USING_SYCL) + /* shared memory hash table */ + HYPRE_Int *s_HashKeys = (HYPRE_Int*) & (shmem_ptr[0]); + HYPRE_Complex *s_HashVals = (HYPRE_Complex*) & (s_HashKeys[NUM_GROUPS_PER_BLOCK * SHMEM_HASH_SIZE]); + /* shared memory hash table for this group */ + HYPRE_Int *group_s_HashKeys = s_HashKeys + group_id * SHMEM_HASH_SIZE; + HYPRE_Complex *group_s_HashVals = s_HashVals + group_id * SHMEM_HASH_SIZE; +#else + /* shared memory hash table */ +#if defined(HYPRE_SPGEMM_DEVICE_USE_DSHMEM) + extern __shared__ volatile HYPRE_Int shared_mem[]; + volatile HYPRE_Int *s_HashKeys = shared_mem; + volatile HYPRE_Complex *s_HashVals = (volatile HYPRE_Complex *) + &s_HashKeys[NUM_GROUPS_PER_BLOCK * SHMEM_HASH_SIZE]; +#else + __shared__ volatile HYPRE_Int s_HashKeys[NUM_GROUPS_PER_BLOCK * SHMEM_HASH_SIZE]; + __shared__ volatile HYPRE_Complex s_HashVals[NUM_GROUPS_PER_BLOCK * SHMEM_HASH_SIZE]; +#endif + /* shared memory hash table for this group */ + volatile HYPRE_Int *group_s_HashKeys = s_HashKeys + group_id * SHMEM_HASH_SIZE; + volatile HYPRE_Complex *group_s_HashVals = s_HashVals + group_id * SHMEM_HASH_SIZE; +#endif + + const HYPRE_Int UNROLL_FACTOR = hypre_min(HYPRE_SPGEMM_NUMER_UNROLL, SHMEM_HASH_SIZE); + HYPRE_Int do_shared_copy; + HYPRE_Int valid_ptr; + +#if defined(HYPRE_USING_SYCL) + hypre_device_assert(item.get_local_range(2) * item.get_local_range(1) == GROUP_SIZE); +#else + hypre_device_assert(blockDim.x * blockDim.y == GROUP_SIZE); +#endif + + /* Note - in cuda/hip, exited threads are not required to reach collective calls like + * syncthreads(), but this is not true for sycl (all threads must call the collective). + * Thus, all threads in the block must enter the loop (which is not ensured for cuda). */ +#if defined(HYPRE_USING_SYCL) + for (HYPRE_Int i = grid_group_id; sycl::any_of_group(item.get_group(), i < M); + i += grid_num_groups) +#else + for (HYPRE_Int i = grid_group_id; warp_any_sync(item, HYPRE_WARP_FULL_MASK, i < M); + i += grid_num_groups) +#endif + { +#if defined(HYPRE_USING_SYCL) + valid_ptr = warp_any_sync(item, HYPRE_WARP_FULL_MASK, i < M) && + (GROUP_SIZE >= HYPRE_WARP_SIZE || i < M); +#else + valid_ptr = GROUP_SIZE >= HYPRE_WARP_SIZE || i < M; +#endif + + HYPRE_Int ii = -1; + + if (HAS_RIND) + { + group_read(item, rind + i, valid_ptr, ii); + } + else + { + ii = i; + } + + /* start/end position of global memory hash table */ + HYPRE_Int istart_g = 0, iend_g = 0, ghash_size = 0; + + if (HAS_GHASH) + { + group_read(item, ig + grid_group_id, valid_ptr, + istart_g, iend_g); + + /* size of global hash table allocated for this row + (must be power of 2 and >= the actual size of the row of C) */ + ghash_size = iend_g - istart_g; + + /* initialize group's global memory hash table */ + for (HYPRE_Int k = lane_id; k < ghash_size; k += GROUP_SIZE) + { + jg[istart_g + k] = -1; + ag[istart_g + k] = 0.0; + } + } + + /* initialize group's shared memory hash table */ + if (valid_ptr) + { +#pragma unroll UNROLL_FACTOR + for (HYPRE_Int k = lane_id; k < SHMEM_HASH_SIZE; k += GROUP_SIZE) + { + group_s_HashKeys[k] = -1; + group_s_HashVals[k] = 0.0; + } + } + + group_sync(item); + + /* start/end position of row of A */ + HYPRE_Int istart_a = 0, iend_a = 0; + + /* load the start and end position of row ii of A */ + group_read(item, ia + ii, valid_ptr, istart_a, iend_a); + + /* start/end position of row of C */ + HYPRE_Int istart_c = 0; +#if defined(HYPRE_DEBUG) + HYPRE_Int iend_c = 0; + group_read(item, ic + ii, valid_ptr, istart_c, iend_c); +#else + group_read(item, ic + ii, valid_ptr, istart_c); +#endif + + /* work with two hash tables */ + if (iend_a == istart_a + 1) + { + hypre_spgemm_compute_row_numer + (item, istart_a, iend_a, istart_c, +#if defined(HYPRE_DEBUG) + iend_c, +#endif + ja, aa, ib, jb, ab, jc, ac, group_s_HashKeys, group_s_HashVals, ghash_size, + jg + istart_g, ag + istart_g); + } + else + { + hypre_spgemm_compute_row_numer + (item, istart_a, iend_a, istart_c, +#if defined(HYPRE_DEBUG) + iend_c, +#endif + ja, aa, ib, jb, ab, jc, ac, group_s_HashKeys, group_s_HashVals, ghash_size, + jg + istart_g, ag + istart_g); + } + + if (GROUP_SIZE > HYPRE_WARP_SIZE) + { + group_sync(item); + } + + HYPRE_Int jsum = 0; + + /* the first warp of the group copies results into the final C + * if GROUP_SIZE < WARP_SIZE, the whole group copies */ + if (get_warp_in_group_id(item) == 0) + { + do_shared_copy = (iend_a > istart_a + 1) && (valid_ptr); + jsum = hypre_spgemm_copy_from_hash_into_C_row + (item, + lane_id, + do_shared_copy, + group_s_HashKeys, + group_s_HashVals, + ghash_size, + jg + istart_g, ag + istart_g, + jc + istart_c, ac + istart_c); + +#if defined(HYPRE_DEBUG) + if (iend_a != istart_a + 1) + { + if (FAILED_SYMBL) + { + hypre_device_assert(istart_c + jsum <= iend_c); + } + else + { + hypre_device_assert(istart_c + jsum == iend_c); + } + } +#endif + } + + if (GROUP_SIZE > HYPRE_WARP_SIZE) + { + group_sync(item); + } + + if (FAILED_SYMBL) + { + /* when symb mult was failed, save (exact) row nnz */ + if ((valid_ptr) && lane_id == 0) + { + rc[ii] = jsum; + } + } + } +} + +/* SpGeMM with Rownnz/Upper bound */ +template +HYPRE_Int +hypre_spgemm_numerical_with_rownnz( HYPRE_Int m, + HYPRE_Int *row_ind, + HYPRE_Int k, + HYPRE_Int n, + bool need_ghash, + HYPRE_Int exact_rownnz, + HYPRE_Int *d_ia, + HYPRE_Int *d_ja, + HYPRE_Complex *d_a, + HYPRE_Int *d_ib, + HYPRE_Int *d_jb, + HYPRE_Complex *d_b, + HYPRE_Int *d_rc, + HYPRE_Int *d_ic, + HYPRE_Int *d_jc, + HYPRE_Complex *d_c ) +{ + const HYPRE_Int num_groups_per_block = hypre_spgemm_get_num_groups_per_block(); +#if defined(HYPRE_USING_CUDA) + const HYPRE_Int BDIMX = hypre_min(4, GROUP_SIZE); +#elif defined(HYPRE_USING_HIP) + const HYPRE_Int BDIMX = hypre_min(4, GROUP_SIZE); +#elif defined(HYPRE_USING_SYCL) + const HYPRE_Int BDIMX = hypre_min(4, GROUP_SIZE); +#endif + const HYPRE_Int BDIMY = GROUP_SIZE / BDIMX; + +#if defined(HYPRE_USING_SYCL) + /* CUDA kernel configurations: bDim.z is the number of groups in block */ + dim3 bDim(num_groups_per_block, BDIMY, BDIMX); + hypre_assert(bDim.get(2) * bDim.get(1) == GROUP_SIZE); + // grid dimension (number of blocks) + const HYPRE_Int num_blocks = hypre_min( hypre_HandleSpgemmBlockNumDim(hypre_handle())[1][BIN], + (m + bDim.get(0) - 1) / bDim.get(0) ); + dim3 gDim(1, 1, num_blocks); + // number of active groups + HYPRE_Int num_act_groups = hypre_min(bDim.get(0) * gDim.get(2), m); +#else + /* CUDA kernel configurations: bDim.z is the number of groups in block */ + dim3 bDim(BDIMX, BDIMY, num_groups_per_block); + hypre_assert(bDim.x * bDim.y == GROUP_SIZE); + // grid dimension (number of blocks) + const HYPRE_Int num_blocks = hypre_min( hypre_HandleSpgemmBlockNumDim(hypre_handle())[1][BIN], + (HYPRE_Int) ((m + bDim.z - 1) / bDim.z) ); + dim3 gDim( num_blocks ); + // number of active groups + HYPRE_Int num_act_groups = hypre_min((HYPRE_Int) (bDim.z * gDim.x), m); +#endif + + const char HASH_TYPE = HYPRE_SPGEMM_HASH_TYPE; + + if (HASH_TYPE != 'L' && HASH_TYPE != 'Q' && HASH_TYPE != 'D') + { + hypre_error_w_msg(1, "Unrecognized hash type ... [L(inear), Q(uadratic), D(ouble)]\n"); + } + + /* --------------------------------------------------------------------------- + * build hash table + * ---------------------------------------------------------------------------*/ + HYPRE_Int *d_ghash_i = NULL; + HYPRE_Int *d_ghash_j = NULL; + HYPRE_Complex *d_ghash_a = NULL; + HYPRE_Int ghash_size = 0; + + if (need_ghash) + { + hypre_SpGemmCreateGlobalHashTable(m, row_ind, num_act_groups, d_rc, SHMEM_HASH_SIZE, + &d_ghash_i, &d_ghash_j, &d_ghash_a, &ghash_size); + } + +#ifdef HYPRE_SPGEMM_PRINTF + HYPRE_SPGEMM_PRINT("%s[%d], BIN[%d]: m %d k %d n %d, HASH %c, SHMEM_HASH_SIZE %d, GROUP_SIZE %d, " + "exact_rownnz %d, need_ghash %d, ghash %p size %d\n", + __FILE__, __LINE__, BIN, m, k, n, + HASH_TYPE, SHMEM_HASH_SIZE, GROUP_SIZE, exact_rownnz, need_ghash, d_ghash_i, ghash_size); +#if defined(HYPRE_USING_SYCL) + HYPRE_SPGEMM_PRINT("kernel spec [%d %d %d] x [%d %d %d]\n", gDim.get(2), gDim.get(1), gDim.get(0), + bDim.get(2), bDim.get(1), + bDim.get(0)); +#else + HYPRE_SPGEMM_PRINT("kernel spec [%d %d %d] x [%d %d %d]\n", gDim.x, gDim.y, gDim.z, bDim.x, bDim.y, + bDim.z); +#endif +#else + HYPRE_UNUSED_VAR(k); + HYPRE_UNUSED_VAR(n); +#endif + +#if defined(HYPRE_SPGEMM_DEVICE_USE_DSHMEM) || defined(HYPRE_USING_SYCL) + const size_t shmem_bytes = num_groups_per_block * SHMEM_HASH_SIZE * (sizeof(HYPRE_Int) + sizeof( + HYPRE_Complex)); +#else + const size_t shmem_bytes = 0; +#endif + + /* --------------------------------------------------------------------------- + * numerical multiplication: + * ---------------------------------------------------------------------------*/ + hypre_assert(HAS_RIND == (row_ind != NULL) ); + + /* */ + + if (exact_rownnz) + { + if (ghash_size) + { + HYPRE_GPU_LAUNCH2 ( + (hypre_spgemm_numeric), + gDim, bDim, shmem_bytes, + m, row_ind, d_ia, d_ja, d_a, d_ib, d_jb, d_b, d_ic, d_jc, d_c, NULL, d_ghash_i, d_ghash_j, + d_ghash_a ); + } + else + { + HYPRE_GPU_LAUNCH2 ( + (hypre_spgemm_numeric), + gDim, bDim, shmem_bytes, + m, row_ind, d_ia, d_ja, d_a, d_ib, d_jb, d_b, d_ic, d_jc, d_c, NULL, d_ghash_i, d_ghash_j, + d_ghash_a ); + } + } + else + { + if (ghash_size) + { + HYPRE_GPU_LAUNCH2 ( + (hypre_spgemm_numeric), + gDim, bDim, shmem_bytes, + m, row_ind, d_ia, d_ja, d_a, d_ib, d_jb, d_b, d_ic, d_jc, d_c, d_rc, d_ghash_i, d_ghash_j, + d_ghash_a ); + } + else + { + HYPRE_GPU_LAUNCH2 ( + (hypre_spgemm_numeric), + gDim, bDim, shmem_bytes, + m, row_ind, d_ia, d_ja, d_a, d_ib, d_jb, d_b, d_ic, d_jc, d_c, d_rc, d_ghash_i, d_ghash_j, + d_ghash_a ); + } + } + + hypre_TFree(d_ghash_i, HYPRE_MEMORY_DEVICE); + hypre_TFree(d_ghash_j, HYPRE_MEMORY_DEVICE); + hypre_TFree(d_ghash_a, HYPRE_MEMORY_DEVICE); + + return hypre_error_flag; +} + +template +__global__ void +hypre_spgemm_copy_from_Cext_into_C( hypre_DeviceItem &item, + HYPRE_Int M, + HYPRE_Int *ix, + HYPRE_Int *jx, + HYPRE_Complex *ax, + HYPRE_Int *ic, + HYPRE_Int *jc, + HYPRE_Complex *ac ) +{ + /* number of groups in the grid */ +#if defined(HYPRE_USING_SYCL) + const HYPRE_Int grid_num_groups = get_num_groups(item) * item.get_group_range(2); +#else + const HYPRE_Int grid_num_groups = get_num_groups(item) * gridDim.x; +#endif + /* group id inside the block */ + const HYPRE_Int group_id = get_group_id(item); + /* group id in the grid */ +#if defined(HYPRE_USING_SYCL) + const HYPRE_Int grid_group_id = item.get_group_range(2) * get_num_groups(item) + group_id; +#else + const HYPRE_Int grid_group_id = blockIdx.x * get_num_groups(item) + group_id; +#endif + /* lane id inside the group */ + const HYPRE_Int lane_id = get_group_lane_id(item); + +#if defined(HYPRE_USING_SYCL) + hypre_device_assert(item.get_local_range(2) * item.get_local_range(1) == GROUP_SIZE); +#else + hypre_device_assert(blockDim.x * blockDim.y == GROUP_SIZE); +#endif + + for (HYPRE_Int i = grid_group_id; warp_any_sync(item, HYPRE_WARP_FULL_MASK, i < M); + i += grid_num_groups) + { + HYPRE_Int istart_c = 0, iend_c = 0, istart_x = 0; + + /* start/end position in C and X */ + group_read(item, ic + i, GROUP_SIZE >= HYPRE_WARP_SIZE || i < M, istart_c, iend_c); +#if defined(HYPRE_DEBUG) + HYPRE_Int iend_x = 0; + group_read(item, ix + i, GROUP_SIZE >= HYPRE_WARP_SIZE || i < M, istart_x, iend_x); + hypre_device_assert(iend_c - istart_c <= iend_x - istart_x); +#else + group_read(item, ix + i, GROUP_SIZE >= HYPRE_WARP_SIZE || i < M, istart_x); +#endif + const HYPRE_Int p = istart_x - istart_c; + for (HYPRE_Int k = istart_c + lane_id; k < iend_c; k += GROUP_SIZE) + { + jc[k] = jx[k + p]; + ac[k] = ax[k + p]; + } + } +} + +template +HYPRE_Int +hypreDevice_CSRSpGemmNumerPostCopy( HYPRE_Int m, + HYPRE_Int *d_rc, + HYPRE_Int *nnzC, + HYPRE_Int **d_ic, + HYPRE_Int **d_jc, + HYPRE_Complex **d_c) +{ + HYPRE_Int nnzC_new = hypreDevice_IntegerReduceSum(m, d_rc); + + hypre_assert(nnzC_new <= *nnzC && nnzC_new >= 0); + + if (nnzC_new < *nnzC) + { + HYPRE_Int *d_ic_new = hypre_TAlloc(HYPRE_Int, m + 1, HYPRE_MEMORY_DEVICE); + HYPRE_Int *d_jc_new; + HYPRE_Complex *d_c_new; + + /* alloc final C */ + hypre_create_ija(m, NULL, d_rc, d_ic_new, &d_jc_new, &d_c_new, &nnzC_new); + +#ifdef HYPRE_SPGEMM_PRINTF + HYPRE_SPGEMM_PRINT("%s[%d]: Post Copy: new nnzC %d\n", __FILE__, __LINE__, nnzC_new); +#endif + + /* copy to the final C */ + const HYPRE_Int num_groups_per_block = hypre_spgemm_get_num_groups_per_block(); + dim3 bDim(GROUP_SIZE, 1, num_groups_per_block); +#if defined(HYPRE_USING_SYCL) + dim3 gDim(1, 1, (m + bDim.get(2) - 1) / bDim.get(2) ); +#else + dim3 gDim( (m + bDim.z - 1) / bDim.z ); +#endif + + HYPRE_GPU_LAUNCH( (hypre_spgemm_copy_from_Cext_into_C), gDim, bDim, + m, *d_ic, *d_jc, *d_c, d_ic_new, d_jc_new, d_c_new ); + + hypre_TFree(*d_ic, HYPRE_MEMORY_DEVICE); + hypre_TFree(*d_jc, HYPRE_MEMORY_DEVICE); + hypre_TFree(*d_c, HYPRE_MEMORY_DEVICE); + + *d_ic = d_ic_new; + *d_jc = d_jc_new; + *d_c = d_c_new; + *nnzC = nnzC_new; + } + + return hypre_error_flag; +} + +template +HYPRE_Int hypre_spgemm_numerical_max_num_blocks( HYPRE_Int multiProcessorCount, + HYPRE_Int *num_blocks_ptr, + HYPRE_Int *block_size_ptr ) +{ + const char HASH_TYPE = HYPRE_SPGEMM_HASH_TYPE; + const HYPRE_Int num_groups_per_block = hypre_spgemm_get_num_groups_per_block(); + const HYPRE_Int block_size = num_groups_per_block * GROUP_SIZE; + hypre_int numBlocksPerSm = 0; + /* Note - sycl shmem is alwasy dynamic */ +#if defined(HYPRE_SPGEMM_DEVICE_USE_DSHMEM) || defined(HYPRE_USING_SYCL) + const hypre_int shmem_bytes = num_groups_per_block * SHMEM_HASH_SIZE * + (sizeof(HYPRE_Int) + sizeof(HYPRE_Complex)); + hypre_int dynamic_shmem_size = shmem_bytes; +#else + hypre_int dynamic_shmem_size = 0; +#endif + +#if defined(HYPRE_SPGEMM_DEVICE_USE_DSHMEM) +#if defined(HYPRE_USING_CUDA) + /* with CUDA, to use > 48K shared memory, must use dynamic and must opt-in. BIN = 10 requires 96K */ + hypre_int max_shmem_optin; + hypre_GetDeviceMaxShmemSize(-1, NULL, &max_shmem_optin); + + if (dynamic_shmem_size <= max_shmem_optin) + { + HYPRE_CUDA_CALL( cudaFuncSetAttribute( + hypre_spgemm_numeric, + cudaFuncAttributeMaxDynamicSharedMemorySize, dynamic_shmem_size) ); + + HYPRE_CUDA_CALL( cudaFuncSetAttribute( + hypre_spgemm_numeric, + cudaFuncAttributeMaxDynamicSharedMemorySize, dynamic_shmem_size) ); + + HYPRE_CUDA_CALL( cudaFuncSetAttribute( + hypre_spgemm_numeric, + cudaFuncAttributeMaxDynamicSharedMemorySize, dynamic_shmem_size) ); + + HYPRE_CUDA_CALL( cudaFuncSetAttribute( + hypre_spgemm_numeric, + cudaFuncAttributeMaxDynamicSharedMemorySize, dynamic_shmem_size) ); + + /* + HYPRE_CUDA_CALL( cudaFuncSetAttribute( + hypre_spgemm_numeric, + cudaFuncAttributeMaxDynamicSharedMemorySize, dynamic_shmem_size) ); + */ + } +#endif +#endif + +#if defined(HYPRE_USING_CUDA) + HYPRE_CUDA_CALL(cudaOccupancyMaxActiveBlocksPerMultiprocessor( + &numBlocksPerSm, + hypre_spgemm_numeric, + block_size, dynamic_shmem_size)); +#endif + +#if defined(HYPRE_USING_HIP) + HYPRE_HIP_CALL(hipOccupancyMaxActiveBlocksPerMultiprocessor( + &numBlocksPerSm, + hypre_spgemm_numeric, + block_size, dynamic_shmem_size)); +#endif + +#if defined(HYPRE_USING_SYCL) + /* WM: todo */ + numBlocksPerSm = 1; +#endif + + *num_blocks_ptr = multiProcessorCount * numBlocksPerSm; + *block_size_ptr = block_size; + + return hypre_error_flag; +} + +#endif /* defined(HYPRE_USING_GPU) */ diff --git a/external/hypre/src/seq_mv/csr_spgemm_device_numer.in b/external/hypre/src/seq_mv/csr_spgemm_device_numer.in new file mode 100644 index 00000000..92463d68 --- /dev/null +++ b/external/hypre/src/seq_mv/csr_spgemm_device_numer.in @@ -0,0 +1,50 @@ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#include "seq_mv.h" + +#if defined(HYPRE_USING_GPU) + +#if HYPRE_SPGEMM_BIN >= 10 +#define HYPRE_SPGEMM_DEVICE_USE_DSHMEM +#endif + +#include + +template HYPRE_Int +hypre_spgemm_numerical_with_rownnz +< HYPRE_SPGEMM_BIN, NUMER_HASH_SIZE[HYPRE_SPGEMM_BIN], T_GROUP_SIZE[HYPRE_SPGEMM_BIN], true > +( HYPRE_Int m, HYPRE_Int *row_ind, HYPRE_Int k, HYPRE_Int n, bool need_ghash, + HYPRE_Int exact_rownnz, + HYPRE_Int *d_ia, HYPRE_Int *d_ja, HYPRE_Complex *d_a, HYPRE_Int *d_ib, HYPRE_Int *d_jb, + HYPRE_Complex *d_b, + HYPRE_Int *d_rc, HYPRE_Int *d_ic, HYPRE_Int *d_jc, HYPRE_Complex *d_c ); + +#if HYPRE_SPGEMM_BIN == HYPRE_SPGEMM_DEFAULT_BIN +template HYPRE_Int +hypre_spgemm_numerical_with_rownnz +< HYPRE_SPGEMM_BIN, NUMER_HASH_SIZE[HYPRE_SPGEMM_BIN], T_GROUP_SIZE[HYPRE_SPGEMM_BIN], false > +( HYPRE_Int m, HYPRE_Int *row_ind, HYPRE_Int k, HYPRE_Int n, bool need_ghash, + HYPRE_Int exact_rownnz, + HYPRE_Int *d_ia, HYPRE_Int *d_ja, HYPRE_Complex *d_a, HYPRE_Int *d_ib, HYPRE_Int *d_jb, + HYPRE_Complex *d_b, + HYPRE_Int *d_rc, HYPRE_Int *d_ic, HYPRE_Int *d_jc, HYPRE_Complex *d_c ); +#endif + +template HYPRE_Int +hypre_spgemm_numerical_max_num_blocks +< NUMER_HASH_SIZE[HYPRE_SPGEMM_BIN], T_GROUP_SIZE[HYPRE_SPGEMM_BIN] > +( HYPRE_Int multiProcessorCount, HYPRE_Int *num_blocks_ptr, HYPRE_Int *block_size_ptr ); + +#if HYPRE_SPGEMM_BIN == 5 +template HYPRE_Int +hypreDevice_CSRSpGemmNumerPostCopy +( HYPRE_Int m, HYPRE_Int *d_rc, HYPRE_Int *nnzC, HYPRE_Int **d_ic, HYPRE_Int **d_jc, HYPRE_Complex **d_c ); +#endif + +#endif /* defined(HYPRE_USING_GPU) */ diff --git a/external/hypre/src/seq_mv/csr_spgemm_device_onemklsparse.c b/external/hypre/src/seq_mv/csr_spgemm_device_onemklsparse.c new file mode 100644 index 00000000..dc449fae --- /dev/null +++ b/external/hypre/src/seq_mv/csr_spgemm_device_onemklsparse.c @@ -0,0 +1,257 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#include "seq_mv.h" +#include "_hypre_utilities.hpp" +#include "seq_mv.hpp" + +#if defined(HYPRE_USING_SYCL) && defined(HYPRE_USING_ONEMKLSPARSE) + +HYPRE_Int +hypreDevice_CSRSpGemmOnemklsparse(HYPRE_Int m, + HYPRE_Int k, + HYPRE_Int n, + oneapi::mkl::sparse::matrix_handle_t handle_A, + HYPRE_Int nnzA, + HYPRE_Int *_d_ia, + HYPRE_Int *_d_ja, + HYPRE_Complex *d_a, + oneapi::mkl::sparse::matrix_handle_t handle_B, + HYPRE_Int nnzB, + HYPRE_Int *_d_ib, + HYPRE_Int *_d_jb, + HYPRE_Complex *d_b, + oneapi::mkl::sparse::matrix_handle_t handle_C, + HYPRE_Int *nnzC_out, + HYPRE_Int **d_ic_out, + HYPRE_Int **d_jc_out, + HYPRE_Complex **d_c_out) +{ + /* Need these conversions in the case of the bigint build */ +#if defined(HYPRE_BIGINT) + std::int64_t *d_ia = reinterpret_cast(_d_ia); + std::int64_t *d_ja = reinterpret_cast(_d_ja); + std::int64_t *d_ib = reinterpret_cast(_d_ib); + std::int64_t *d_jb = reinterpret_cast(_d_jb); + + std::int64_t *d_ic, *d_jc = NULL; + std::int64_t *d_ja_sorted, *d_jb_sorted; + + /* Allocate space for sorted arrays */ + d_ja_sorted = hypre_TAlloc(std::int64_t, nnzA, HYPRE_MEMORY_DEVICE); + d_jb_sorted = hypre_TAlloc(std::int64_t, nnzB, HYPRE_MEMORY_DEVICE); + + /* Copy the unsorted over as the initial "sorted" */ + hypre_TMemcpy(d_ja_sorted, d_ja, std::int64_t, nnzA, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(d_jb_sorted, d_jb, std::int64_t, nnzB, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); +#else + HYPRE_Int *d_ia = _d_ia; + HYPRE_Int *d_ja = _d_ja; + HYPRE_Int *d_ib = _d_ib; + HYPRE_Int *d_jb = _d_jb; + + HYPRE_Int *d_ic, *d_jc = NULL; + HYPRE_Int *d_ja_sorted, *d_jb_sorted; + + /* Allocate space for sorted arrays */ + d_ja_sorted = hypre_TAlloc(HYPRE_Int, nnzA, HYPRE_MEMORY_DEVICE); + d_jb_sorted = hypre_TAlloc(HYPRE_Int, nnzB, HYPRE_MEMORY_DEVICE); + + /* Copy the unsorted over as the initial "sorted" */ + hypre_TMemcpy(d_ja_sorted, d_ja, HYPRE_Int, nnzA, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(d_jb_sorted, d_jb, HYPRE_Int, nnzB, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); +#endif + + std::int64_t *tmp_size1_h = NULL, *tmp_size1_d = NULL; + std::int64_t *tmp_size2_h = NULL, *tmp_size2_d = NULL; + std::int64_t *nnzC_h = NULL, *nnzC_d; + void *tmp_buffer1 = NULL; + void *tmp_buffer2 = NULL; + HYPRE_Complex *d_c = NULL; + HYPRE_Complex *d_a_sorted, *d_b_sorted; + + /* Allocate space for sorted arrays */ + d_a_sorted = hypre_TAlloc(HYPRE_Complex, nnzA, HYPRE_MEMORY_DEVICE); + d_b_sorted = hypre_TAlloc(HYPRE_Complex, nnzB, HYPRE_MEMORY_DEVICE); + + /* Copy the unsorted over as the initial "sorted" */ + hypre_TMemcpy(d_a_sorted, d_a, HYPRE_Complex, nnzA, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(d_b_sorted, d_b, HYPRE_Complex, nnzB, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + + /* sort copies of col indices and data for A and B */ + HYPRE_ONEMKL_CALL( oneapi::mkl::sparse::set_csr_data(*hypre_HandleComputeStream(hypre_handle()), + handle_A, m, k, oneapi::mkl::index_base::zero, + d_ia, d_ja_sorted, d_a_sorted).wait() ); + HYPRE_ONEMKL_CALL( oneapi::mkl::sparse::set_csr_data(*hypre_HandleComputeStream(hypre_handle()), + handle_B, k, n, oneapi::mkl::index_base::zero, + d_ib, d_jb_sorted, d_b_sorted).wait() ); + HYPRE_ONEMKL_CALL( oneapi::mkl::sparse::sort_matrix(*hypre_HandleComputeStream(hypre_handle()), + handle_A, {}).wait() ); + HYPRE_ONEMKL_CALL( oneapi::mkl::sparse::sort_matrix(*hypre_HandleComputeStream(hypre_handle()), + handle_B, {}).wait() ); + + oneapi::mkl::sparse::matmat_descr_t descr = NULL; + oneapi::mkl::sparse::matmat_request req; + +#if defined(HYPRE_BIGINT) + d_ic = hypre_TAlloc(std::int64_t, m + 1, HYPRE_MEMORY_DEVICE); +#else + d_ic = hypre_TAlloc(HYPRE_Int, m + 1, HYPRE_MEMORY_DEVICE); +#endif + HYPRE_ONEMKL_CALL( oneapi::mkl::sparse::set_csr_data(*hypre_HandleComputeStream(hypre_handle()), + handle_C, m, n, oneapi::mkl::index_base::zero, + d_ic, d_jc, d_c).wait() ); + + HYPRE_ONEMKL_CALL( oneapi::mkl::sparse::init_matmat_descr(&descr) ); + HYPRE_ONEMKL_CALL( oneapi::mkl::sparse::set_matmat_data(descr, + oneapi::mkl::sparse::matrix_view_descr::general, + oneapi::mkl::transpose::nontrans, + oneapi::mkl::sparse::matrix_view_descr::general, + oneapi::mkl::transpose::nontrans, + oneapi::mkl::sparse::matrix_view_descr::general) ); + + /* get tmp_buffer1 size for work estimation */ + req = oneapi::mkl::sparse::matmat_request::get_work_estimation_buf_size; + tmp_size1_d = hypre_TAlloc(std::int64_t, 1, HYPRE_MEMORY_DEVICE); + HYPRE_ONEMKL_CALL( oneapi::mkl::sparse::matmat(*hypre_HandleComputeStream(hypre_handle()), + handle_A, + handle_B, + handle_C, + req, + descr, + tmp_size1_d, + NULL, + {}).wait() ); + + /* allocate tmp_buffer1 for work estimation */ + tmp_size1_h = hypre_TAlloc(std::int64_t, 1, HYPRE_MEMORY_HOST); + hypre_TMemcpy(tmp_size1_h, tmp_size1_d, std::int64_t, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); + tmp_buffer1 = (void*) hypre_TAlloc(std::uint8_t, *tmp_size1_h, HYPRE_MEMORY_DEVICE); + + /* do work_estimation */ + req = oneapi::mkl::sparse::matmat_request::work_estimation; + HYPRE_ONEMKL_CALL( oneapi::mkl::sparse::matmat(*hypre_HandleComputeStream(hypre_handle()), + handle_A, + handle_B, + handle_C, + req, + descr, + tmp_size1_d, + tmp_buffer1, + {}).wait() ); + + /* get tmp_buffer2 size for computation */ + req = oneapi::mkl::sparse::matmat_request::get_compute_buf_size; + tmp_size2_d = hypre_TAlloc(std::int64_t, 1, HYPRE_MEMORY_DEVICE); + HYPRE_ONEMKL_CALL( oneapi::mkl::sparse::matmat(*hypre_HandleComputeStream(hypre_handle()), + handle_A, + handle_B, + handle_C, + req, + descr, + tmp_size2_d, + NULL, + {}).wait() ); + + /* allocate tmp_buffer2 for computation */ + tmp_size2_h = hypre_TAlloc(std::int64_t, 1, HYPRE_MEMORY_HOST); + hypre_TMemcpy(tmp_size2_h, tmp_size2_d, std::int64_t, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); + tmp_buffer2 = (void*) hypre_TAlloc(std::uint8_t, *tmp_size2_h, HYPRE_MEMORY_DEVICE); + + /* do the computation */ + req = oneapi::mkl::sparse::matmat_request::compute; + HYPRE_ONEMKL_CALL( oneapi::mkl::sparse::matmat(*hypre_HandleComputeStream(hypre_handle()), + handle_A, + handle_B, + handle_C, + req, + descr, + tmp_size2_d, + tmp_buffer2, + {}).wait() ); + + /* get nnzC */ + req = oneapi::mkl::sparse::matmat_request::get_nnz; + nnzC_d = hypre_TAlloc(std::int64_t, 1, HYPRE_MEMORY_DEVICE); + HYPRE_ONEMKL_CALL( oneapi::mkl::sparse::matmat(*hypre_HandleComputeStream(hypre_handle()), + handle_A, + handle_B, + handle_C, + req, + descr, + nnzC_d, + NULL, + {}).wait() ); + + /* allocate col index and data arrays */ + nnzC_h = hypre_TAlloc(std::int64_t, 1, HYPRE_MEMORY_HOST); + hypre_TMemcpy(nnzC_h, nnzC_d, std::int64_t, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); + + if (*nnzC_h > 0) + { +#if defined(HYPRE_BIGINT) + d_jc = hypre_TAlloc(std::int64_t, *nnzC_h, HYPRE_MEMORY_DEVICE); +#else + d_jc = hypre_TAlloc(HYPRE_Int, *nnzC_h, HYPRE_MEMORY_DEVICE); +#endif + d_c = hypre_TAlloc(HYPRE_Complex, *nnzC_h, HYPRE_MEMORY_DEVICE); + HYPRE_ONEMKL_CALL( oneapi::mkl::sparse::set_csr_data(*hypre_HandleComputeStream(hypre_handle()), + handle_C, m, n, oneapi::mkl::index_base::zero, + d_ic, d_jc, d_c).wait() ); + + /* finalize C */ + req = oneapi::mkl::sparse::matmat_request::finalize; + HYPRE_ONEMKL_CALL( oneapi::mkl::sparse::matmat(*hypre_HandleComputeStream(hypre_handle()), + handle_A, + handle_B, + handle_C, + req, + descr, + NULL, + NULL, + {}).wait() ); + } + + /* release the matmat descr */ + HYPRE_ONEMKL_CALL( oneapi::mkl::sparse::release_matmat_descr(&descr) ); + + /* assign the output */ + *nnzC_out = *nnzC_h; +#if defined(HYPRE_BIGINT) + *d_ic_out = reinterpret_cast(d_ic); + *d_jc_out = reinterpret_cast(d_jc); +#else + *d_ic_out = d_ic; + *d_jc_out = d_jc; +#endif + *d_c_out = d_c; + + /* restore the original (unsorted) col indices and data to A and B and free sorted arrays */ + HYPRE_ONEMKL_CALL( oneapi::mkl::sparse::set_csr_data(*hypre_HandleComputeStream(hypre_handle()), + handle_A, m, k, oneapi::mkl::index_base::zero, + d_ia, d_ja, d_a).wait() ); + HYPRE_ONEMKL_CALL( oneapi::mkl::sparse::set_csr_data(*hypre_HandleComputeStream(hypre_handle()), + handle_B, k, n, oneapi::mkl::index_base::zero, + d_ib, d_jb, d_b).wait() ); + hypre_TFree(d_a_sorted, HYPRE_MEMORY_DEVICE); + hypre_TFree(d_b_sorted, HYPRE_MEMORY_DEVICE); + hypre_TFree(d_ja_sorted, HYPRE_MEMORY_DEVICE); + hypre_TFree(d_jb_sorted, HYPRE_MEMORY_DEVICE); + + /* free temporary arrays */ + hypre_TFree(tmp_size1_h, HYPRE_MEMORY_HOST); + hypre_TFree(tmp_size1_d, HYPRE_MEMORY_DEVICE); + hypre_TFree(tmp_size2_h, HYPRE_MEMORY_HOST); + hypre_TFree(tmp_size2_d, HYPRE_MEMORY_DEVICE); + hypre_TFree(nnzC_h, HYPRE_MEMORY_HOST); + hypre_TFree(nnzC_d, HYPRE_MEMORY_DEVICE); + hypre_TFree(tmp_buffer1, HYPRE_MEMORY_DEVICE); + hypre_TFree(tmp_buffer2, HYPRE_MEMORY_DEVICE); + + return hypre_error_flag; +} +#endif diff --git a/external/hypre/src/seq_mv/csr_spgemm_device_rocsparse.c b/external/hypre/src/seq_mv/csr_spgemm_device_rocsparse.c index 81c8b21b..faf37814 100644 --- a/external/hypre/src/seq_mv/csr_spgemm_device_rocsparse.c +++ b/external/hypre/src/seq_mv/csr_spgemm_device_rocsparse.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -46,27 +46,25 @@ hypreDevice_CSRSpGemmRocsparse(HYPRE_Int m, rocsparse_operation transA = rocsparse_operation_none; rocsparse_operation transB = rocsparse_operation_none; - HYPRE_Int isDoublePrecision = sizeof(HYPRE_Complex) == sizeof(hypre_double); - HYPRE_Int isSinglePrecision = sizeof(HYPRE_Complex) == sizeof(hypre_double) / 2; - - hypre_assert(isDoublePrecision || isSinglePrecision); - /* Copy the unsorted over as the initial "sorted" */ hypre_TMemcpy(d_ja_sorted, d_ja, HYPRE_Int, nnzA, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); hypre_TMemcpy(d_a_sorted, d_a, HYPRE_Complex, nnzA, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); hypre_TMemcpy(d_jb_sorted, d_jb, HYPRE_Int, nnzB, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); hypre_TMemcpy(d_b_sorted, d_b, HYPRE_Complex, nnzB, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); - /* For rocSPARSE, the CSR SpGEMM implementation does not require the columns - to be sorted! - hypre_SortCSRRocsparse(m, k, nnzA, descrA, d_ia, d_ja_sorted, d_a_sorted); - hypre_SortCSRRocsparse(k, n, nnzB, descrB, d_ib, d_jb_sorted, d_b_sorted); */ + /* For rocSPARSE, the CSR SpGEMM implementation does not require the columns to be sorted! */ + /* RL: for matrices with long rows, it seemed that the sorting is still needed */ + /* VPM: Adding sorting back since it is necessary for correctness in a few cases */ +#if 1 + hypre_SortCSRRocsparse(m, k, nnzA, descrA, d_ia, d_ja_sorted, d_a_sorted); + hypre_SortCSRRocsparse(k, n, nnzB, descrB, d_ib, d_jb_sorted, d_b_sorted); +#endif // nnzTotalDevHostPtr points to host memory HYPRE_Int *nnzTotalDevHostPtr = &nnzC; HYPRE_ROCSPARSE_CALL( rocsparse_set_pointer_mode(handle, rocsparse_pointer_mode_host) ); - d_ic = hypre_TAlloc(HYPRE_Int, m+1, HYPRE_MEMORY_DEVICE); + d_ic = hypre_TAlloc(HYPRE_Int, m + 1, HYPRE_MEMORY_DEVICE); // For rocsparse, we need an extra buffer for computing the // csrgemmnnz and the csrgemm @@ -82,29 +80,15 @@ hypreDevice_CSRSpGemmRocsparse(HYPRE_Int m, size_t rs_buffer_size = 0; void *rs_buffer; - if (isDoublePrecision) - { - HYPRE_ROCSPARSE_CALL( rocsparse_dcsrgemm_buffer_size(handle, - transA, transB, - m, n, k, - &alpha, // \alpha = 1 - descrA, nnzA, d_ia, d_ja_sorted, - descrB, nnzB, d_ib, d_jb_sorted, - NULL, // \beta = 0 - NULL, 0, NULL, NULL, // D is nothing - infoC, &rs_buffer_size) ); - } - else if (isSinglePrecision) - { - HYPRE_ROCSPARSE_CALL( rocsparse_scsrgemm_buffer_size(handle, transA, transB, - m, n, k, - (float *) &alpha, // \alpha = 1 - descrA, nnzA, d_ia, d_ja_sorted, - descrB, nnzB, d_ib, d_jb_sorted, - NULL, // \beta = 0 - NULL, 0, NULL, NULL, - infoC, &rs_buffer_size) ); - } + HYPRE_ROCSPARSE_CALL( hypre_rocsparse_csrgemm_buffer_size(handle, + transA, transB, + m, n, k, + &alpha, // \alpha = 1 + descrA, nnzA, d_ia, d_ja_sorted, + descrB, nnzB, d_ib, d_jb_sorted, + NULL, // \beta = 0 + NULL, 0, NULL, NULL, // D is nothing + infoC, &rs_buffer_size) ); rs_buffer = hypre_TAlloc(char, rs_buffer_size, HYPRE_MEMORY_DEVICE); @@ -133,30 +117,15 @@ hypreDevice_CSRSpGemmRocsparse(HYPRE_Int m, d_jc = hypre_TAlloc(HYPRE_Int, nnzC, HYPRE_MEMORY_DEVICE); d_c = hypre_TAlloc(HYPRE_Complex, nnzC, HYPRE_MEMORY_DEVICE); - if (isDoublePrecision) - { - HYPRE_ROCSPARSE_CALL( rocsparse_dcsrgemm(handle, transA, transB, - m, n, k, - &alpha, // alpha = 1 - descrA, nnzA, d_a_sorted, d_ia, d_ja_sorted, - descrB, nnzB, d_b_sorted, d_ib, d_jb_sorted, - NULL, // beta = 0 - NULL, 0, NULL, NULL, NULL, // D is nothing - descrC, d_c, d_ic, d_jc, - infoC, rs_buffer) ); - } - else if (isSinglePrecision) - { - HYPRE_ROCSPARSE_CALL( rocsparse_scsrgemm(handle, transA, transB, - m, n, k, - (float *) &alpha, // alpha = 1 - descrA, nnzA, (float *) d_a_sorted, d_ia, d_ja_sorted, - descrB, nnzB, (float *) d_b_sorted, d_ib, d_jb_sorted, - NULL, // beta = 0 - NULL, 0, NULL, NULL, NULL, // D is nothing - descrC, (float *) d_c, d_ic, d_jc, - infoC, rs_buffer) ); - } + HYPRE_ROCSPARSE_CALL( hypre_rocsparse_csrgemm(handle, transA, transB, + m, n, k, + &alpha, // alpha = 1 + descrA, nnzA, d_a_sorted, d_ia, d_ja_sorted, + descrB, nnzB, d_b_sorted, d_ib, d_jb_sorted, + NULL, // beta = 0 + NULL, 0, NULL, NULL, NULL, // D is nothing + descrC, d_c, d_ic, d_jc, + infoC, rs_buffer) ); // Free up the memory needed by rocsparse hypre_TFree(rs_buffer, HYPRE_MEMORY_DEVICE); diff --git a/external/hypre/src/seq_mv/csr_spgemm_device_rowbound.c b/external/hypre/src/seq_mv/csr_spgemm_device_rowbound.c deleted file mode 100644 index d3dce3e6..00000000 --- a/external/hypre/src/seq_mv/csr_spgemm_device_rowbound.c +++ /dev/null @@ -1,407 +0,0 @@ -/****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other - * HYPRE Project Developers. See the top-level COPYRIGHT file for details. - * - * SPDX-License-Identifier: (Apache-2.0 OR MIT) - ******************************************************************************/ - -#include "seq_mv.h" -#include "csr_spgemm_device.h" - -/*- - - - - - - - - - - - - - - - - - - - - - - - - - * - Symbolic Multiplication - *- - - - - - - - - - - - - - - - - - - - - - - - - - */ - -#if defined(HYPRE_USING_CUDA) -#define HYPRE_SPGEMM_SYMBL_HASH_SIZE 512 -#elif defined(HYPRE_USING_HIP) -#define HYPRE_SPGEMM_SYMBL_HASH_SIZE 512 -#endif - -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - -template -static __device__ __forceinline__ -HYPRE_Int -hypre_spgemm_hash_insert_symbl( HYPRE_Int HashSize, /* capacity of the hash table */ - volatile HYPRE_Int *HashKeys, /* assumed to be initialized as all -1's */ - HYPRE_Int key, /* assumed to be nonnegative */ - HYPRE_Int &count /* increase by 1 if is a new entry */) -{ - HYPRE_Int j = 0; - -#pragma unroll - for (HYPRE_Int i = 0; i < HashSize; i++) - { - /* compute the hash value of key */ - if (i == 0) - { - j = key & (HashSize - 1); - } - else - { - j = HashFunc(HashSize, key, i, j); - } - - /* try to insert key+1 into slot j */ - HYPRE_Int old = atomicCAS((HYPRE_Int*)(HashKeys+j), -1, key); - - if (old == -1) - { - count++; - return j; - } - if (old == key) - { - return j; - } - } - return -1; -} - -template -static __device__ __forceinline__ -HYPRE_Int -hypre_spgemm_compute_row_symbl( HYPRE_Int rowi, - HYPRE_Int lane_id, - HYPRE_Int *ia, - HYPRE_Int *ja, - HYPRE_Int *ib, - HYPRE_Int *jb, - HYPRE_Int s_HashSize, - volatile HYPRE_Int *s_HashKeys, - HYPRE_Int g_HashSize, - HYPRE_Int *g_HashKeys, - hypre_int &failed ) -{ - /* load the start and end position of row i of A */ - HYPRE_Int j = 0; - - if (lane_id < 2) - { - j = read_only_load(ia + rowi + lane_id); - } - const HYPRE_Int istart = __shfl_sync(HYPRE_WARP_FULL_MASK, j, 0); - const HYPRE_Int iend = __shfl_sync(HYPRE_WARP_FULL_MASK, j, 1); - - HYPRE_Int num_new_insert = 0; - - /* load column idx and values of row i of A */ - for (HYPRE_Int i = istart; i < iend; i += blockDim.y) - { - HYPRE_Int colA = -1; - - if (threadIdx.x == 0 && i + threadIdx.y < iend) - { - colA = read_only_load(ja + i + threadIdx.y); - } - -#if 0 - //const HYPRE_Int ymask = get_mask<4>(lane_id); - // TODO: need to confirm the behavior of __ballot_sync, leave it here for now - //const HYPRE_Int num_valid_rows = __popc(__ballot_sync(ymask, valid_i)); - //for (HYPRE_Int j = 0; j < num_valid_rows; j++) -#endif - - /* threads in the same ygroup work on one row together */ - const HYPRE_Int rowB = __shfl_sync(HYPRE_WARP_FULL_MASK, colA, 0, blockDim.x); - /* open this row of B, collectively */ - HYPRE_Int tmp = 0; - if (rowB != -1 && threadIdx.x < 2) - { - tmp = read_only_load(ib+rowB+threadIdx.x); - } - const HYPRE_Int rowB_start = __shfl_sync(HYPRE_WARP_FULL_MASK, tmp, 0, blockDim.x); - const HYPRE_Int rowB_end = __shfl_sync(HYPRE_WARP_FULL_MASK, tmp, 1, blockDim.x); - - for (HYPRE_Int k = rowB_start + threadIdx.x; __any_sync(HYPRE_WARP_FULL_MASK, k < rowB_end); k += blockDim.x) - { - if (k < rowB_end) - { - const HYPRE_Int k_idx = read_only_load(jb + k); - /* first try to insert into shared memory hash table */ - HYPRE_Int pos = hypre_spgemm_hash_insert_symbl(s_HashSize, s_HashKeys, k_idx, num_new_insert); - - if (-1 == pos) - { - pos = hypre_spgemm_hash_insert_symbl(g_HashSize, g_HashKeys, k_idx, num_new_insert); - } - /* if failed again, both hash tables must have been full - (hash table size estimation was too small). - Increase the counter anyhow (will lead to over-counting) - */ - if (pos == -1) - { - num_new_insert ++; - failed = 1; - } - } - } - } - - return num_new_insert; -} - -template -__global__ void -hypre_spgemm_symbolic( HYPRE_Int M, /* HYPRE_Int K, HYPRE_Int N, */ - HYPRE_Int *rind, - HYPRE_Int *ia, - HYPRE_Int *ja, - HYPRE_Int *ib, - HYPRE_Int *jb, - HYPRE_Int *ig, - HYPRE_Int *jg, - HYPRE_Int *rc, - HYPRE_Int *rf) -{ - volatile const HYPRE_Int num_warps = NUM_WARPS_PER_BLOCK * gridDim.x; - /* warp id inside the block */ - volatile const HYPRE_Int warp_id = get_warp_id(); - /* warp id in the grid */ - volatile const HYPRE_Int grid_warp_id = blockIdx.x * NUM_WARPS_PER_BLOCK + warp_id; - /* lane id inside the warp */ - volatile HYPRE_Int lane_id = get_lane_id(); - /* shared memory hash table */ - __shared__ volatile HYPRE_Int s_HashKeys[NUM_WARPS_PER_BLOCK * SHMEM_HASH_SIZE]; - /* shared memory hash table for this warp */ - volatile HYPRE_Int *warp_s_HashKeys = s_HashKeys + warp_id * SHMEM_HASH_SIZE; - - hypre_device_assert(blockDim.z == NUM_WARPS_PER_BLOCK); - hypre_device_assert(blockDim.x * blockDim.y == HYPRE_WARP_SIZE); - hypre_device_assert(NUM_WARPS_PER_BLOCK <= HYPRE_WARP_SIZE); - - for (HYPRE_Int i = grid_warp_id; i < M; i += num_warps) - { - HYPRE_Int j = 0, ii; - hypre_int failed = 0; - - if (ATTEMPT == 2) - { - if (lane_id == 0) - { - j = read_only_load(&rind[i]); - } - ii = __shfl_sync(HYPRE_WARP_FULL_MASK, j, 0); - } - else - { - ii = i; - } - - /* start/end position of global memory hash table */ - HYPRE_Int istart_g = 0, iend_g = 0, ghash_size = 0; - - if (ig) - { - if (lane_id < 2) - { - j = read_only_load(ig + grid_warp_id + lane_id); - } - istart_g = __shfl_sync(HYPRE_WARP_FULL_MASK, j, 0); - iend_g = __shfl_sync(HYPRE_WARP_FULL_MASK, j, 1); - - /* size of global hash table allocated for this row - (must be power of 2 and >= the actual size of the row of C - shmem hash size) */ - ghash_size = iend_g - istart_g; - - /* initialize warp's global memory hash table */ -#pragma unroll - for (HYPRE_Int k = lane_id; k < ghash_size; k += HYPRE_WARP_SIZE) - { - jg[istart_g + k] = -1; - } - } - - /* initialize warp's shared memory hash table */ -#pragma unroll - for (HYPRE_Int k = lane_id; k < SHMEM_HASH_SIZE; k += HYPRE_WARP_SIZE) - { - warp_s_HashKeys[k] = -1; - } - - __syncwarp(); - - /* work with two hash tables */ - j = hypre_spgemm_compute_row_symbl(ii, lane_id, ia, ja, ib, jb, - SHMEM_HASH_SIZE, warp_s_HashKeys, - ghash_size, jg + istart_g, failed); - -#if defined(HYPRE_DEBUG) - if (ATTEMPT == 2) - { - hypre_device_assert(failed == 0); - } -#endif - - /* num of nonzeros of this row (an upper bound) */ - j = warp_reduce_sum(j); - - /* if this row failed */ - if (ATTEMPT == 1) - { - failed = warp_reduce_sum(failed); - } - - if (lane_id == 0) - { - rc[ii] = j; - - if (ATTEMPT == 1) - { - rf[ii] = failed > 0; - } - } - } -} - -template -void -hypre_spgemm_rownnz_attempt(HYPRE_Int m, - HYPRE_Int *rf_ind, /* ATTEMPT = 2, input: row indices (length of m) */ - HYPRE_Int k, - HYPRE_Int n, - HYPRE_Int *d_ia, - HYPRE_Int *d_ja, - HYPRE_Int *d_ib, - HYPRE_Int *d_jb, - HYPRE_Int in_rc, - HYPRE_Int *d_rc, /* ATTEMPT = 1, input: rownnz est (if in_rc), output: rownnz bound; - ATTEMPT = 2, input: rownnz bound, output: rownnz (exact) */ - HYPRE_Int *d_rf /* ATTEMPT = 1, output: if symbolic mult. failed */ ) -{ -#ifdef HYPRE_PROFILE - hypre_profile_times[HYPRE_TIMER_ID_SPMM_SYMBOLIC] -= hypre_MPI_Wtime(); -#endif - -#if defined(HYPRE_USING_CUDA) - const HYPRE_Int num_warps_per_block = 16; - const HYPRE_Int BDIMX = 2; -#elif defined(HYPRE_USING_HIP) - const HYPRE_Int num_warps_per_block = 16; - const HYPRE_Int BDIMX = 4; -#endif - const HYPRE_Int BDIMY = HYPRE_WARP_SIZE / BDIMX; - - /* CUDA kernel configurations */ - dim3 bDim(BDIMX, BDIMY, num_warps_per_block); - hypre_assert(bDim.x * bDim.y == HYPRE_WARP_SIZE); - // for cases where one WARP works on a row - HYPRE_Int num_warps = hypre_min(m, HYPRE_MAX_NUM_WARPS); - dim3 gDim( (num_warps + bDim.z - 1) / bDim.z ); - // number of active warps - HYPRE_Int num_act_warps = hypre_min(bDim.z * gDim.x, m); - - const char hash_type = hypre_HandleSpgemmHashType(hypre_handle()); - - /* --------------------------------------------------------------------------- - * build hash table (no values) - * ---------------------------------------------------------------------------*/ - HYPRE_Int *d_ghash_i = NULL, *d_ghash_j = NULL; - - if (in_rc) - { - hypre_SpGemmCreateGlobalHashTable(m, rf_ind, num_act_warps, d_rc, shmem_hash_size, - &d_ghash_i, &d_ghash_j, NULL, NULL, 1); - } - - /* --------------------------------------------------------------------------- - * symbolic multiplication: - * On output, it provides an upper bound of nnz in rows of C - * ---------------------------------------------------------------------------*/ - if (hash_type == 'L') - { - HYPRE_CUDA_LAUNCH( (hypre_spgemm_symbolic), gDim, bDim, - m, rf_ind, /*k, n,*/ d_ia, d_ja, d_ib, d_jb, d_ghash_i, d_ghash_j, d_rc, d_rf ); - } - else if (hash_type == 'Q') - { - HYPRE_CUDA_LAUNCH( (hypre_spgemm_symbolic), gDim, bDim, - m, rf_ind, /*k, n,*/ d_ia, d_ja, d_ib, d_jb, d_ghash_i, d_ghash_j, d_rc, d_rf ); - } - else if (hash_type == 'D') - { - HYPRE_CUDA_LAUNCH( (hypre_spgemm_symbolic), gDim, bDim, - m, rf_ind, /*k, n,*/ d_ia, d_ja, d_ib, d_jb, d_ghash_i, d_ghash_j, d_rc, d_rf ); - } - else - { - hypre_printf("Unrecognized hash type ... [L(inear), Q(uadratic), D(ouble)]\n"); - exit(0); - } - - hypre_TFree(d_ghash_i, HYPRE_MEMORY_DEVICE); - hypre_TFree(d_ghash_j, HYPRE_MEMORY_DEVICE); - -#ifdef HYPRE_PROFILE - cudaThreadSynchronize(); - hypre_profile_times[HYPRE_TIMER_ID_SPMM_SYMBOLIC] += hypre_MPI_Wtime(); -#endif -} - -HYPRE_Int -hypreDevice_CSRSpGemmRownnzUpperbound( HYPRE_Int m, - HYPRE_Int k, - HYPRE_Int n, - HYPRE_Int *d_ia, - HYPRE_Int *d_ja, - HYPRE_Int *d_ib, - HYPRE_Int *d_jb, - HYPRE_Int in_rc, - HYPRE_Int *d_rc, - HYPRE_Int *d_rf) -{ - const HYPRE_Int shmem_hash_size = HYPRE_SPGEMM_SYMBL_HASH_SIZE; - - hypre_spgemm_rownnz_attempt (m, NULL, k, n, d_ia, d_ja, d_ib, d_jb, in_rc, d_rc, d_rf); - - return hypre_error_flag; -} - -HYPRE_Int -hypreDevice_CSRSpGemmRownnz( HYPRE_Int m, - HYPRE_Int k, - HYPRE_Int n, - HYPRE_Int *d_ia, - HYPRE_Int *d_ja, - HYPRE_Int *d_ib, - HYPRE_Int *d_jb, - HYPRE_Int in_rc, - HYPRE_Int *d_rc ) -{ - const HYPRE_Int shmem_hash_size = HYPRE_SPGEMM_SYMBL_HASH_SIZE; - - /* a binary array to indicate if row nnz counting is failed for a row */ - HYPRE_Int *d_rf = d_rc + m; - - hypre_spgemm_rownnz_attempt (m, NULL, k, n, d_ia, d_ja, d_ib, d_jb, in_rc, d_rc, d_rf); - - /* row nnz is exact if no row failed */ - HYPRE_Int num_failed_rows = hypreDevice_IntegerReduceSum(m, d_rf); - - if (num_failed_rows) - { - //hypre_printf("[%s, %d]: num of failed rows %d (%.2f)\n", __FILE__, __LINE__, num_failed_rows, num_failed_rows / (m + 0.0) ); - - HYPRE_Int *rf_ind = hypre_TAlloc(HYPRE_Int, num_failed_rows, HYPRE_MEMORY_DEVICE); - - HYPRE_Int *new_end = - HYPRE_THRUST_CALL( copy_if, - thrust::make_counting_iterator(0), - thrust::make_counting_iterator(m), - d_rf, - rf_ind, - thrust::identity() ); - - hypre_assert(new_end - rf_ind == num_failed_rows); - - hypre_spgemm_rownnz_attempt (num_failed_rows, rf_ind, k, n, d_ia, d_ja, d_ib, d_jb, 1, d_rc, NULL); - - hypre_TFree(rf_ind, HYPRE_MEMORY_DEVICE); - } - - return hypre_error_flag; -} - -#endif /* HYPRE_USING_CUDA || defined(HYPRE_USING_HIP) */ - diff --git a/external/hypre/src/seq_mv/csr_spgemm_device_rowest.c b/external/hypre/src/seq_mv/csr_spgemm_device_rowest.c index f058d1d7..cd6ebb3d 100644 --- a/external/hypre/src/seq_mv/csr_spgemm_device_rowest.c +++ b/external/hypre/src/seq_mv/csr_spgemm_device_rowest.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -12,15 +12,21 @@ #include "seq_mv.h" #include "csr_spgemm_device.h" -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) /*- - - - - - - - - - - - - - - - - - - - - - - - - - * NAIVE *- - - - - - - - - - - - - - - - - - - - - - - - - - */ template static __device__ __forceinline__ -void rownnz_naive_rowi(HYPRE_Int rowi, HYPRE_Int lane_id, HYPRE_Int *ia, HYPRE_Int *ja, HYPRE_Int *ib, - HYPRE_Int &row_nnz_sum, HYPRE_Int &row_nnz_max) +void hypre_rownnz_naive_rowi( hypre_DeviceItem &item, + HYPRE_Int rowi, + HYPRE_Int lane_id, + HYPRE_Int *ia, + HYPRE_Int *ja, + HYPRE_Int *ib, + HYPRE_Int &row_nnz_sum, + HYPRE_Int &row_nnz_max ) { /* load the start and end position of row i of A */ HYPRE_Int j = -1; @@ -28,8 +34,8 @@ void rownnz_naive_rowi(HYPRE_Int rowi, HYPRE_Int lane_id, HYPRE_Int *ia, HYPRE_I { j = read_only_load(ia + rowi + lane_id); } - const HYPRE_Int istart = __shfl_sync(HYPRE_WARP_FULL_MASK, j, 0); - const HYPRE_Int iend = __shfl_sync(HYPRE_WARP_FULL_MASK, j, 1); + const HYPRE_Int istart = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, j, 0); + const HYPRE_Int iend = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, j, 1); row_nnz_sum = 0; row_nnz_max = 0; @@ -40,15 +46,19 @@ void rownnz_naive_rowi(HYPRE_Int rowi, HYPRE_Int lane_id, HYPRE_Int *ia, HYPRE_I if (i + lane_id < iend) { HYPRE_Int colA = read_only_load(ja + i + lane_id); - HYPRE_Int rowB_start = read_only_load(ib+colA); - HYPRE_Int rowB_end = read_only_load(ib+colA+1); + HYPRE_Int rowB_start = read_only_load(ib + colA); + HYPRE_Int rowB_end = read_only_load(ib + colA + 1); if (type == 'U' || type == 'B') { row_nnz_sum += rowB_end - rowB_start; } if (type == 'L' || type == 'B') { +#if defined(HYPRE_USING_SYCL) + row_nnz_max = std::max(row_nnz_max, rowB_end - rowB_start); +#else row_nnz_max = max(row_nnz_max, rowB_end - rowB_start); +#endif } } } @@ -56,34 +66,55 @@ void rownnz_naive_rowi(HYPRE_Int rowi, HYPRE_Int lane_id, HYPRE_Int *ia, HYPRE_I template __global__ -void csr_spmm_rownnz_naive(HYPRE_Int M, /*HYPRE_Int K,*/ HYPRE_Int N, HYPRE_Int *ia, HYPRE_Int *ja, - HYPRE_Int *ib, HYPRE_Int *jb, HYPRE_Int *rcL, HYPRE_Int *rcU) +void hypre_spgemm_rownnz_naive( hypre_DeviceItem &item, + HYPRE_Int M, + HYPRE_Int N, + HYPRE_Int *ia, + HYPRE_Int *ja, + HYPRE_Int *ib, + HYPRE_Int *jb, + HYPRE_Int *rcL, + HYPRE_Int *rcU ) { +#if defined(HYPRE_USING_SYCL) + const HYPRE_Int num_warps = NUM_WARPS_PER_BLOCK * item.get_global_range(2); + HYPRE_Int blockIdx_x = item.get_group(2); +#else const HYPRE_Int num_warps = NUM_WARPS_PER_BLOCK * gridDim.x; + HYPRE_Int blockIdx_x = blockIdx.x; +#endif /* warp id inside the block */ - const HYPRE_Int warp_id = get_warp_id(); + const HYPRE_Int warp_id = get_group_id(item); /* lane id inside the warp */ - volatile const HYPRE_Int lane_id = get_lane_id(); + volatile const HYPRE_Int lane_id = get_group_lane_id(item); +#if defined(HYPRE_USING_SYCL) + hypre_device_assert(item.get_local_range(2) * item.get_local_range(1) == HYPRE_WARP_SIZE); +#else hypre_device_assert(blockDim.x * blockDim.y == HYPRE_WARP_SIZE); +#endif - for (HYPRE_Int i = blockIdx.x * NUM_WARPS_PER_BLOCK + warp_id; - i < M; - i += num_warps) + for (HYPRE_Int i = blockIdx_x * NUM_WARPS_PER_BLOCK + warp_id; + i < M; + i += num_warps) { HYPRE_Int jU, jL; - rownnz_naive_rowi(i, lane_id, ia, ja, ib, jU, jL); + hypre_rownnz_naive_rowi(item, i, lane_id, ia, ja, ib, jU, jL); if (type == 'U' || type == 'B') { - jU = warp_reduce_sum(jU); + jU = warp_reduce_sum(item, jU); +#if defined(HYPRE_USING_SYCL) + jU = sycl::min(jU, N); +#else jU = min(jU, N); +#endif } if (type == 'L' || type == 'B') { - jL = warp_reduce_max(jL); + jL = warp_reduce_max(item, jL); } if (lane_id == 0) @@ -105,12 +136,18 @@ void csr_spmm_rownnz_naive(HYPRE_Int M, /*HYPRE_Int K,*/ HYPRE_Int N, HYPRE_Int COHEN *- - - - - - - - - - - - - - - - - - - - - - - - - - */ __global__ -void expdistfromuniform(HYPRE_Int n, float *x) +void hypre_expdistfromuniform( hypre_DeviceItem &item, + HYPRE_Int n, + float *x ) { - const HYPRE_Int global_thread_id = blockIdx.x * get_block_size() + get_thread_id(); - const HYPRE_Int total_num_threads = gridDim.x * get_block_size(); + const HYPRE_Int global_thread_id = hypre_gpu_get_grid_thread_id<3, 1>(item); + const HYPRE_Int total_num_threads = hypre_gpu_get_grid_num_threads<3, 1>(item); +#if defined(HYPRE_USING_SYCL) + hypre_device_assert(item.get_local_range(2) * item.get_local_range(1) == HYPRE_WARP_SIZE); +#else hypre_device_assert(blockDim.x * blockDim.y == HYPRE_WARP_SIZE); +#endif for (HYPRE_Int i = global_thread_id; i < n; i += total_num_threads) { @@ -121,26 +158,46 @@ void expdistfromuniform(HYPRE_Int n, float *x) /* T = float: single precision should be enough */ template __global__ -void cohen_rowest_kernel(HYPRE_Int nrow, HYPRE_Int *rowptr, HYPRE_Int *colidx, T *V_in, T *V_out, - HYPRE_Int *rc, HYPRE_Int nsamples, HYPRE_Int *low, HYPRE_Int *upp, T mult) +void hypre_cohen_rowest_kernel( hypre_DeviceItem &item, + HYPRE_Int nrow, + HYPRE_Int *rowptr, + HYPRE_Int *colidx, + T *V_in, + T *V_out, + HYPRE_Int *rc, + HYPRE_Int nsamples, + HYPRE_Int *low, + HYPRE_Int *upp, + T mult ) { +#if defined(HYPRE_USING_SYCL) + const HYPRE_Int num_warps = NUM_WARPS_PER_BLOCK * item.get_global_range(2); + HYPRE_Int blockIdx_x = item.get_group(2); +#else const HYPRE_Int num_warps = NUM_WARPS_PER_BLOCK * gridDim.x; + HYPRE_Int blockIdx_x = blockIdx.x; +#endif /* warp id inside the block */ - const HYPRE_Int warp_id = get_warp_id(); + const HYPRE_Int warp_id = get_group_id(item); /* lane id inside the warp */ - volatile HYPRE_Int lane_id = get_lane_id(); + volatile HYPRE_Int lane_id = get_group_lane_id(item); #if COHEN_USE_SHMEM __shared__ volatile HYPRE_Int s_col[NUM_WARPS_PER_BLOCK * SHMEM_SIZE_PER_WARP]; volatile HYPRE_Int *warp_s_col = s_col + warp_id * SHMEM_SIZE_PER_WARP; #endif +#if defined(HYPRE_USING_SYCL) + hypre_device_assert(item.get_local_range(1) == NUM_WARPS_PER_BLOCK); + hypre_device_assert(item.get_local_range(2) * item.get_local_range(1) == HYPRE_WARP_SIZE); +#else hypre_device_assert(blockDim.z == NUM_WARPS_PER_BLOCK); hypre_device_assert(blockDim.x * blockDim.y == HYPRE_WARP_SIZE); +#endif hypre_device_assert(sizeof(T) == sizeof(float)); - for (HYPRE_Int i = blockIdx.x * NUM_WARPS_PER_BLOCK + warp_id; - i < nrow; - i += num_warps) + for (HYPRE_Int i = blockIdx_x * NUM_WARPS_PER_BLOCK + warp_id; + i < nrow; + i += num_warps) { /* load the start and end position of row i */ HYPRE_Int tmp = -1; @@ -148,8 +205,8 @@ void cohen_rowest_kernel(HYPRE_Int nrow, HYPRE_Int *rowptr, HYPRE_Int *colidx, T { tmp = read_only_load(rowptr + i + lane_id); } - const HYPRE_Int istart = __shfl_sync(HYPRE_WARP_FULL_MASK, tmp, 0); - const HYPRE_Int iend = __shfl_sync(HYPRE_WARP_FULL_MASK, tmp, 1); + const HYPRE_Int istart = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, tmp, 0); + const HYPRE_Int iend = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, tmp, 1); /* works on WARP_SIZE samples at a time */ for (HYPRE_Int r = 0; r < nsamples; r += HYPRE_WARP_SIZE) @@ -196,7 +253,7 @@ void cohen_rowest_kernel(HYPRE_Int nrow, HYPRE_Int *rowptr, HYPRE_Int *colidx, T for (HYPRE_Int k = 0; k < HYPRE_WARP_SIZE; k++) { - HYPRE_Int colk = __shfl_sync(HYPRE_WARP_FULL_MASK, col, k); + HYPRE_Int colk = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, col, k); if (colk == -1) { hypre_device_assert(j + HYPRE_WARP_SIZE >= iend); @@ -206,7 +263,11 @@ void cohen_rowest_kernel(HYPRE_Int nrow, HYPRE_Int *rowptr, HYPRE_Int *colidx, T if (r + lane_id < nsamples) { T val = read_only_load(V_in + r + lane_id + colk * nsamples); +#if defined(HYPRE_USING_SYCL) + vmin = sycl::min(vmin, val); +#else vmin = min(vmin, val); +#endif } } } @@ -226,7 +287,7 @@ void cohen_rowest_kernel(HYPRE_Int nrow, HYPRE_Int *rowptr, HYPRE_Int *colidx, T } /* partial sum along r */ - vmin = warp_reduce_sum(vmin); + vmin = warp_reduce_sum(item, vmin); if (lane_id == 0) { @@ -251,11 +312,19 @@ void cohen_rowest_kernel(HYPRE_Int nrow, HYPRE_Int *rowptr, HYPRE_Int *colidx, T if (low) { +#if defined(HYPRE_USING_SYCL) + len = std::max(low[i], len); +#else len = max(low[i], len); +#endif } if (upp) { +#if defined(HYPRE_USING_SYCL) + len = std::min(upp[i], len); +#else len = min(upp[i], len); +#endif } if (rc) { @@ -267,38 +336,81 @@ void cohen_rowest_kernel(HYPRE_Int nrow, HYPRE_Int *rowptr, HYPRE_Int *colidx, T } template -void csr_spmm_rownnz_cohen(HYPRE_Int M, HYPRE_Int K, HYPRE_Int N, HYPRE_Int *d_ia, HYPRE_Int *d_ja, HYPRE_Int *d_ib, HYPRE_Int *d_jb, HYPRE_Int *d_low, HYPRE_Int *d_upp, HYPRE_Int *d_rc, HYPRE_Int nsamples, T mult_factor, T *work) +void hypre_spgemm_rownnz_cohen( HYPRE_Int M, + HYPRE_Int K, + HYPRE_Int N, + HYPRE_Int *d_ia, + HYPRE_Int *d_ja, + HYPRE_Int *d_ib, + HYPRE_Int *d_jb, + HYPRE_Int *d_low, + HYPRE_Int *d_upp, + HYPRE_Int *d_rc, + HYPRE_Int nsamples, + T mult_factor, + T *work ) { +#if defined(HYPRE_USING_SYCL) + dim3 bDim(NUM_WARPS_PER_BLOCK, BDIMY, BDIMX); + hypre_assert(bDim.get(2) * bDim.get(1) == HYPRE_WARP_SIZE); +#else dim3 bDim(BDIMX, BDIMY, NUM_WARPS_PER_BLOCK); hypre_assert(bDim.x * bDim.y == HYPRE_WARP_SIZE); +#endif T *d_V1, *d_V2, *d_V3; d_V1 = work; - d_V2 = d_V1 + nsamples*N; + d_V2 = d_V1 + nsamples * N; //d_V1 = hypre_TAlloc(T, nsamples*N, HYPRE_MEMORY_DEVICE); //d_V2 = hypre_TAlloc(T, nsamples*K, HYPRE_MEMORY_DEVICE); +#ifdef HYPRE_SPGEMM_TIMING + HYPRE_Real t1, t2; + t1 = hypre_MPI_Wtime(); +#endif + /* random V1: uniform --> exp */ hypre_CurandUniformSingle(nsamples * N, d_V1, 0, 0, 0, 0); - dim3 gDim( (nsamples * N + bDim.z * HYPRE_WARP_SIZE - 1) / (bDim.z * HYPRE_WARP_SIZE) ); +#ifdef HYPRE_SPGEMM_TIMING + hypre_ForceSyncComputeStream(); + t2 = hypre_MPI_Wtime() - t1; + HYPRE_SPGEMM_PRINT("Curand time %f\n", t2); +#endif + +#if defined(HYPRE_USING_SYCL) + dim3 gDim( 1, 1, (nsamples * N + bDim.get(0) * HYPRE_WARP_SIZE - 1) / (bDim.get( + 0) * HYPRE_WARP_SIZE) ); +#else + dim3 gDim( (nsamples * N + bDim.z * HYPRE_WARP_SIZE - 1) / (bDim.z * HYPRE_WARP_SIZE), 1, 1 ); +#endif - HYPRE_CUDA_LAUNCH( expdistfromuniform, gDim, bDim, nsamples * N, d_V1 ); + HYPRE_GPU_LAUNCH( hypre_expdistfromuniform, gDim, bDim, nsamples * N, d_V1 ); /* step-1: layer 3-2 */ +#if defined(HYPRE_USING_SYCL) + gDim[2] = (K + bDim.get(0) - 1) / bDim.get(0); +#else gDim.x = (K + bDim.z - 1) / bDim.z; - HYPRE_CUDA_LAUNCH( (cohen_rowest_kernel), gDim, bDim, - K, d_ib, d_jb, d_V1, d_V2, NULL, nsamples, NULL, NULL, -1.0); +#endif + HYPRE_GPU_LAUNCH( (hypre_cohen_rowest_kernel), + gDim, bDim, + K, d_ib, d_jb, d_V1, d_V2, NULL, nsamples, NULL, NULL, -1.0); //hypre_TFree(d_V1, HYPRE_MEMORY_DEVICE); /* step-2: layer 2-1 */ d_V3 = (T*) d_rc; +#if defined(HYPRE_USING_SYCL) + gDim[2] = (M + bDim.get(0) - 1) / bDim.get(0); +#else gDim.x = (M + bDim.z - 1) / bDim.z; - HYPRE_CUDA_LAUNCH( (cohen_rowest_kernel), gDim, bDim, - M, d_ia, d_ja, d_V2, d_V3, d_rc, nsamples, d_low, d_upp, mult_factor); +#endif + HYPRE_GPU_LAUNCH( (hypre_cohen_rowest_kernel), + gDim, bDim, + M, d_ia, d_ja, d_V2, d_V3, d_rc, nsamples, d_low, d_upp, mult_factor); /* done */ //hypre_TFree(d_V2, HYPRE_MEMORY_DEVICE); @@ -306,60 +418,87 @@ void csr_spmm_rownnz_cohen(HYPRE_Int M, HYPRE_Int K, HYPRE_Int N, HYPRE_Int *d_i HYPRE_Int -hypreDevice_CSRSpGemmRownnzEstimate(HYPRE_Int m, HYPRE_Int k, HYPRE_Int n, - HYPRE_Int *d_ia, HYPRE_Int *d_ja, HYPRE_Int *d_ib, HYPRE_Int *d_jb, HYPRE_Int *d_rc) +hypreDevice_CSRSpGemmRownnzEstimate( HYPRE_Int m, + HYPRE_Int k, + HYPRE_Int n, + HYPRE_Int *d_ia, + HYPRE_Int *d_ja, + HYPRE_Int *d_ib, + HYPRE_Int *d_jb, + HYPRE_Int *d_rc, + HYPRE_Int row_est_mtd ) { +#ifdef HYPRE_SPGEMM_NVTX + hypre_GpuProfilingPushRange("CSRSpGemmRowEstimate"); +#endif + #ifdef HYPRE_PROFILE - hypre_profile_times[HYPRE_TIMER_ID_SPMM_ROWNNZ] -= hypre_MPI_Wtime(); + hypre_profile_times[HYPRE_TIMER_ID_SPGEMM_ROWNNZ] -= hypre_MPI_Wtime(); #endif +#ifdef HYPRE_SPGEMM_TIMING + HYPRE_Real t1 = hypre_MPI_Wtime(); +#endif + + static constexpr HYPRE_Int shmem_size_per_warp = 128; const HYPRE_Int num_warps_per_block = 16; - const HYPRE_Int shmem_size_per_warp = 128; const HYPRE_Int BDIMX = 2; const HYPRE_Int BDIMY = HYPRE_WARP_SIZE / BDIMX; +#if defined(HYPRE_USING_SYCL) + /* CUDA kernel configurations */ + dim3 bDim(num_warps_per_block, BDIMY, BDIMX); + hypre_assert(bDim.get(2) * bDim.get(1) == HYPRE_WARP_SIZE); + // for cases where one WARP works on a row + dim3 gDim(1, 1, (m + bDim.get(0) - 1) / bDim.get(0)); +#else /* CUDA kernel configurations */ dim3 bDim(BDIMX, BDIMY, num_warps_per_block); hypre_assert(bDim.x * bDim.y == HYPRE_WARP_SIZE); // for cases where one WARP works on a row dim3 gDim( (m + bDim.z - 1) / bDim.z ); +#endif - HYPRE_Int row_est_mtd = hypre_HandleSpgemmRownnzEstimateMethod(hypre_handle()); - HYPRE_Int cohen_nsamples = hypre_HandleSpgemmRownnzEstimateNsamples(hypre_handle()); - float cohen_mult = hypre_HandleSpgemmRownnzEstimateMultFactor(hypre_handle()); + size_t cohen_nsamples = hypre_HandleSpgemmRownnzEstimateNsamples(hypre_handle()); + float cohen_mult = hypre_HandleSpgemmRownnzEstimateMultFactor(hypre_handle()); + + //hypre_printf("Cohen Nsamples %d, mult %f\n", cohen_nsamples, cohen_mult); if (row_est_mtd == 1) { /* naive overestimate */ - HYPRE_CUDA_LAUNCH( (csr_spmm_rownnz_naive<'U', num_warps_per_block>), gDim, bDim, - m, /*k,*/ n, d_ia, d_ja, d_ib, d_jb, NULL, d_rc ); + HYPRE_GPU_LAUNCH( (hypre_spgemm_rownnz_naive<'U', num_warps_per_block>), gDim, bDim, + m, /*k,*/ n, d_ia, d_ja, d_ib, d_jb, NULL, d_rc ); } else if (row_est_mtd == 2) { /* naive underestimate */ - HYPRE_CUDA_LAUNCH( (csr_spmm_rownnz_naive<'L', num_warps_per_block>), gDim, bDim, - m, /*k,*/ n, d_ia, d_ja, d_ib, d_jb, d_rc, NULL ); + HYPRE_GPU_LAUNCH( (hypre_spgemm_rownnz_naive<'L', num_warps_per_block>), gDim, bDim, + m, /*k,*/ n, d_ia, d_ja, d_ib, d_jb, d_rc, NULL ); } else if (row_est_mtd == 3) { /* [optional] first run naive estimate for naive lower and upper bounds, which will be given to Cohen's alg as corrections */ - char *work_mem = hypre_TAlloc(char, cohen_nsamples*(n+k)*sizeof(float)+2*m*sizeof(HYPRE_Int), HYPRE_MEMORY_DEVICE); + char *work_mem = hypre_TAlloc(char, + cohen_nsamples * (n + k) * sizeof(float) + 2 * m * sizeof(HYPRE_Int), + HYPRE_MEMORY_DEVICE); char *work_mem_saved = work_mem; //HYPRE_Int *d_low_upp = hypre_TAlloc(HYPRE_Int, 2 * m, HYPRE_MEMORY_DEVICE); HYPRE_Int *d_low_upp = (HYPRE_Int *) work_mem; - work_mem += 2*m*sizeof(HYPRE_Int); + work_mem += 2 * m * sizeof(HYPRE_Int); HYPRE_Int *d_low = d_low_upp; HYPRE_Int *d_upp = d_low_upp + m; - HYPRE_CUDA_LAUNCH( (csr_spmm_rownnz_naive<'B', num_warps_per_block>), gDim, bDim, - m, /*k,*/ n, d_ia, d_ja, d_ib, d_jb, d_low, d_upp ); + HYPRE_GPU_LAUNCH( (hypre_spgemm_rownnz_naive<'B', num_warps_per_block>), gDim, bDim, + m, /*k,*/ n, d_ia, d_ja, d_ib, d_jb, d_low, d_upp ); /* Cohen's algorithm, stochastic approach */ - csr_spmm_rownnz_cohen - (m, k, n, d_ia, d_ja, d_ib, d_jb, d_low, d_upp, d_rc, cohen_nsamples, cohen_mult, (float *)work_mem); + hypre_spgemm_rownnz_cohen + (m, k, n, d_ia, d_ja, d_ib, d_jb, d_low, d_upp, d_rc, cohen_nsamples, cohen_mult, + (float *)work_mem); //hypre_TFree(d_low_upp, HYPRE_MEMORY_DEVICE); hypre_TFree(work_mem_saved, HYPRE_MEMORY_DEVICE); @@ -371,12 +510,21 @@ hypreDevice_CSRSpGemmRownnzEstimate(HYPRE_Int m, HYPRE_Int k, HYPRE_Int n, hypre_error_w_msg(HYPRE_ERROR_GENERIC, msg); } +#ifdef HYPRE_SPGEMM_TIMING + hypre_ForceSyncComputeStream(); + HYPRE_Real t2 = hypre_MPI_Wtime() - t1; + HYPRE_SPGEMM_PRINT("RownnzEst time %f\n", t2); +#endif + #ifdef HYPRE_PROFILE - cudaThreadSynchronize(); - hypre_profile_times[HYPRE_TIMER_ID_SPMM_ROWNNZ] += hypre_MPI_Wtime(); + hypre_profile_times[HYPRE_TIMER_ID_SPGEMM_ROWNNZ] += hypre_MPI_Wtime(); +#endif + +#ifdef HYPRE_SPGEMM_NVTX + hypre_GpuProfilingPopRange(); #endif return hypre_error_flag; } -#endif /* HYPRE_USING_CUDA || defined(HYPRE_USING_HIP) */ +#endif /* defined(HYPRE_USING_GPU) */ diff --git a/external/hypre/src/seq_mv/csr_spgemm_device_symbl.c b/external/hypre/src/seq_mv/csr_spgemm_device_symbl.c new file mode 100644 index 00000000..f4074019 --- /dev/null +++ b/external/hypre/src/seq_mv/csr_spgemm_device_symbl.c @@ -0,0 +1,426 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#include "_hypre_onedpl.hpp" +#include "seq_mv.h" +#include "csr_spgemm_device.h" + +#if defined(HYPRE_USING_GPU) + +#define HYPRE_SPGEMM_ROWNNZ_BINNED(BIN, SHMEM_HASH_SIZE, GROUP_SIZE, GHASH, CAN_FAIL, RF) \ +{ \ + const HYPRE_Int p = h_bin_ptr[BIN - 1]; \ + const HYPRE_Int q = h_bin_ptr[BIN]; \ + const HYPRE_Int bs = q - p; \ + if (bs) \ + { \ + HYPRE_SPGEMM_PRINT("bin[%d]: %d rows, p %d, q %d\n", BIN, bs, p, q); \ + hypre_spgemm_symbolic_rownnz \ + ( bs, d_rind + p, k, n, GHASH, d_ia, d_ja, d_ib, d_jb, d_rc, CAN_FAIL, RF ); \ + } \ +} + +HYPRE_Int +hypreDevice_CSRSpGemmRownnzUpperboundNoBin( HYPRE_Int m, + HYPRE_Int k, + HYPRE_Int n, + HYPRE_Int *d_ia, + HYPRE_Int *d_ja, + HYPRE_Int *d_ib, + HYPRE_Int *d_jb, + HYPRE_Int in_rc, + HYPRE_Int *d_rc, + char *d_rf ) +{ + static constexpr HYPRE_Int SHMEM_HASH_SIZE = SYMBL_HASH_SIZE[5]; + static constexpr HYPRE_Int GROUP_SIZE = T_GROUP_SIZE[5]; + static constexpr HYPRE_Int BIN = 5; + + const bool need_ghash = in_rc > 0; + const bool can_fail = in_rc < 2; + + hypre_spgemm_symbolic_rownnz + (m, NULL, k, n, need_ghash, d_ia, d_ja, d_ib, d_jb, d_rc, can_fail, d_rf); + + return hypre_error_flag; +} + +HYPRE_Int +hypreDevice_CSRSpGemmRownnzUpperboundBinned( HYPRE_Int m, + HYPRE_Int k, + HYPRE_Int n, + HYPRE_Int *d_ia, + HYPRE_Int *d_ja, + HYPRE_Int *d_ib, + HYPRE_Int *d_jb, + HYPRE_Int in_rc, + HYPRE_Int *d_rc, + char *d_rf ) +{ + HYPRE_UNUSED_VAR(in_rc); + + const bool CAN_FAIL = true; + + /* Binning (bins 3-10) with d_rc */ + HYPRE_Int h_bin_ptr[HYPRE_SPGEMM_MAX_NBIN + 1]; + //HYPRE_Int num_bins = hypre_HandleSpgemmNumBin(hypre_handle()); + HYPRE_Int high_bin = hypre_HandleSpgemmHighestBin(hypre_handle())[0]; + const bool hbin9 = 9 == high_bin; + const char s = 32, t = 3, u = high_bin; + + HYPRE_Int *d_rind = hypre_TAlloc(HYPRE_Int, m, HYPRE_MEMORY_DEVICE); + + hypre_SpGemmCreateBins(m, s, t, u, d_rc, false, d_rind, h_bin_ptr); + + HYPRE_SPGEMM_ROWNNZ_BINNED( 3, SYMBL_HASH_SIZE[ 3], T_GROUP_SIZE[ 3], false, CAN_FAIL, d_rf); + HYPRE_SPGEMM_ROWNNZ_BINNED( 4, SYMBL_HASH_SIZE[ 4], T_GROUP_SIZE[ 4], false, CAN_FAIL, d_rf); + HYPRE_SPGEMM_ROWNNZ_BINNED( 5, SYMBL_HASH_SIZE[ 5], T_GROUP_SIZE[ 5], false, CAN_FAIL, d_rf); + HYPRE_SPGEMM_ROWNNZ_BINNED( 6, SYMBL_HASH_SIZE[ 6], T_GROUP_SIZE[ 6], false, CAN_FAIL, d_rf); + HYPRE_SPGEMM_ROWNNZ_BINNED( 7, SYMBL_HASH_SIZE[ 7], T_GROUP_SIZE[ 7], false, CAN_FAIL, d_rf); + HYPRE_SPGEMM_ROWNNZ_BINNED( 8, SYMBL_HASH_SIZE[ 8], T_GROUP_SIZE[ 8], false, CAN_FAIL, d_rf); + HYPRE_SPGEMM_ROWNNZ_BINNED( 9, SYMBL_HASH_SIZE[ 9], T_GROUP_SIZE[ 9], hbin9, CAN_FAIL, d_rf); + HYPRE_SPGEMM_ROWNNZ_BINNED( 10, SYMBL_HASH_SIZE[10], T_GROUP_SIZE[10], true, CAN_FAIL, d_rf); + + hypre_TFree(d_rind, HYPRE_MEMORY_DEVICE); + + return hypre_error_flag; +} + +/* in_rc: 0: no input row count + * 1: input row count est (CURRENTLY ONLY 1) +*/ +HYPRE_Int +hypreDevice_CSRSpGemmRownnzUpperbound( HYPRE_Int m, + HYPRE_Int k, + HYPRE_Int n, + HYPRE_Int *d_ia, + HYPRE_Int *d_ja, + HYPRE_Int *d_ib, + HYPRE_Int *d_jb, + HYPRE_Int in_rc, + HYPRE_Int *d_rc, + HYPRE_Int *rownnz_exact_ptr) +{ + HYPRE_UNUSED_VAR(in_rc); + +#ifdef HYPRE_PROFILE + hypre_profile_times[HYPRE_TIMER_ID_SPGEMM_SYMBOLIC] -= hypre_MPI_Wtime(); +#endif + +#ifdef HYPRE_SPGEMM_NVTX + hypre_GpuProfilingPushRange("CSRSpGemmRownnzUpperbound"); +#endif + +#ifdef HYPRE_SPGEMM_TIMING + HYPRE_Real t1 = hypre_MPI_Wtime(); +#endif + + char *d_rf = hypre_TAlloc(char, m, HYPRE_MEMORY_DEVICE); + + const HYPRE_Int binned = hypre_HandleSpgemmBinned(hypre_handle()); + + if (binned) + { + hypreDevice_CSRSpGemmRownnzUpperboundBinned + (m, k, n, d_ia, d_ja, d_ib, d_jb, 1 /* with input rc */, d_rc, d_rf); + } + else + { + hypreDevice_CSRSpGemmRownnzUpperboundNoBin + (m, k, n, d_ia, d_ja, d_ib, d_jb, 1 /* with input rc */, d_rc, d_rf); + } + + /* row nnz is exact if no row failed */ +#if defined(HYPRE_USING_SYCL) + *rownnz_exact_ptr = !HYPRE_ONEDPL_CALL( std::any_of, + d_rf, + d_rf + m, + [] (const auto & x) {return x;} ); +#else + *rownnz_exact_ptr = !HYPRE_THRUST_CALL( any_of, + d_rf, + d_rf + m, + thrust::identity() ); +#endif + + hypre_TFree(d_rf, HYPRE_MEMORY_DEVICE); + +#ifdef HYPRE_SPGEMM_TIMING + hypre_ForceSyncComputeStream(); + HYPRE_Real t2 = hypre_MPI_Wtime() - t1; + HYPRE_SPGEMM_PRINT("RownnzBound time %f\n", t2); +#endif + +#ifdef HYPRE_SPGEMM_NVTX + hypre_GpuProfilingPopRange(); +#endif + +#ifdef HYPRE_PROFILE + hypre_profile_times[HYPRE_TIMER_ID_SPGEMM_SYMBOLIC] += hypre_MPI_Wtime(); +#endif + + return hypre_error_flag; +} + +/* in_rc: 0: no input row count (CURRENTLY ONLY 0) + * 1: input row count est + * 2: input row bound +*/ +HYPRE_Int +hypreDevice_CSRSpGemmRownnzNoBin( HYPRE_Int m, + HYPRE_Int k, + HYPRE_Int n, + HYPRE_Int *d_ia, + HYPRE_Int *d_ja, + HYPRE_Int *d_ib, + HYPRE_Int *d_jb, + HYPRE_Int in_rc, + HYPRE_Int *d_rc ) +{ + static constexpr HYPRE_Int SHMEM_HASH_SIZE = SYMBL_HASH_SIZE[5]; + static constexpr HYPRE_Int GROUP_SIZE = T_GROUP_SIZE[5]; + static constexpr HYPRE_Int BIN = 5; + + const bool need_ghash = in_rc > 0; + const bool can_fail = in_rc < 2; + + char *d_rf = can_fail ? hypre_TAlloc(char, m, HYPRE_MEMORY_DEVICE) : NULL; + + hypre_spgemm_symbolic_rownnz + (m, NULL, k, n, need_ghash, d_ia, d_ja, d_ib, d_jb, d_rc, can_fail, d_rf); + + if (can_fail) + { + /* row nnz is exact if no row failed */ +#if defined(HYPRE_USING_SYCL) + HYPRE_Int num_failed_rows = + HYPRE_ONEDPL_CALL( std::reduce, + oneapi::dpl::make_transform_iterator(d_rf, type_cast()), + oneapi::dpl::make_transform_iterator(d_rf + m, type_cast()) ); +#else + HYPRE_Int num_failed_rows = + HYPRE_THRUST_CALL( reduce, + thrust::make_transform_iterator(d_rf, type_cast()), + thrust::make_transform_iterator(d_rf + m, type_cast()) ); +#endif + + if (num_failed_rows) + { +#ifdef HYPRE_SPGEMM_PRINTF + HYPRE_SPGEMM_PRINT("[%s, %d]: num of failed rows %d (%.2f)\n", __FILE__, __LINE__, + num_failed_rows, num_failed_rows / (m + 0.0) ); +#endif + HYPRE_Int *d_rind = hypre_TAlloc(HYPRE_Int, num_failed_rows, HYPRE_MEMORY_DEVICE); + +#if defined(HYPRE_USING_SYCL) + oneapi::dpl::counting_iterator count(0); + HYPRE_Int *new_end = hypreSycl_copy_if( + count, + count + m, + d_rf, + d_rind, + [] (const auto & x) {return x;} ); +#else + HYPRE_Int *new_end = + HYPRE_THRUST_CALL( copy_if, + thrust::make_counting_iterator(0), + thrust::make_counting_iterator(m), + d_rf, + d_rind, + thrust::identity() ); +#endif + + hypre_assert(new_end - d_rind == num_failed_rows); + + hypre_spgemm_symbolic_rownnz < BIN + 1, 2 * SHMEM_HASH_SIZE, 2 * GROUP_SIZE, true > + (num_failed_rows, d_rind, k, n, true, d_ia, d_ja, d_ib, d_jb, d_rc, false, NULL); + + hypre_TFree(d_rind, HYPRE_MEMORY_DEVICE); + } + } + + hypre_TFree(d_rf, HYPRE_MEMORY_DEVICE); + + return hypre_error_flag; +} + +/* in_rc: 0: no input row count (CURRENTLY ONLY 0) + * 1: input row count est + * 2: input row bound +*/ +HYPRE_Int +hypreDevice_CSRSpGemmRownnzBinned( HYPRE_Int m, + HYPRE_Int k, + HYPRE_Int n, + HYPRE_Int nnzA, + HYPRE_Int *d_ia, + HYPRE_Int *d_ja, + HYPRE_Int *d_ib, + HYPRE_Int *d_jb, + HYPRE_Int in_rc, + HYPRE_Int *d_rc ) +{ + HYPRE_UNUSED_VAR(in_rc); + + const char s = 32, t = 1, u = 5; + HYPRE_Int h_bin_ptr[HYPRE_SPGEMM_MAX_NBIN + 1]; +#if 0 + HYPRE_Int *d_rind = hypre_TAlloc(HYPRE_Int, m, HYPRE_MEMORY_DEVICE); + + hypreDevice_CSRSpGemmRownnzEstimate(m, k, n, d_ia, d_ja, d_ib, d_jb, d_rc, 1); +#else + HYPRE_Int *d_rind = hypre_TAlloc(HYPRE_Int, hypre_max(m, k + 1), HYPRE_MEMORY_DEVICE); + +#ifdef HYPRE_SPGEMM_TIMING + HYPRE_Real t1 = hypre_MPI_Wtime(); +#endif + + /* naive upper bound */ +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::adjacent_difference, d_ib, d_ib + k + 1, d_rind ); +#else + HYPRE_THRUST_CALL( adjacent_difference, d_ib, d_ib + k + 1, d_rind ); +#endif + hypre_CSRMatrixIntSpMVDevice(m, nnzA, 1, d_ia, d_ja, NULL, d_rind + 1, 0, d_rc); + +#ifdef HYPRE_SPGEMM_TIMING + hypre_ForceSyncComputeStream(); + HYPRE_Real t2 = hypre_MPI_Wtime() - t1; + HYPRE_SPGEMM_PRINT("RownnzEst time %f\n", t2); +#endif +#endif + + hypre_SpGemmCreateBins(m, s, t, u, d_rc, false, d_rind, h_bin_ptr); + + HYPRE_SPGEMM_ROWNNZ_BINNED( 1, SYMBL_HASH_SIZE[1], T_GROUP_SIZE[1], false, false, NULL); + HYPRE_SPGEMM_ROWNNZ_BINNED( 2, SYMBL_HASH_SIZE[2], T_GROUP_SIZE[2], false, false, NULL); + HYPRE_SPGEMM_ROWNNZ_BINNED( 3, SYMBL_HASH_SIZE[3], T_GROUP_SIZE[3], false, false, NULL); + HYPRE_SPGEMM_ROWNNZ_BINNED( 4, SYMBL_HASH_SIZE[4], T_GROUP_SIZE[4], false, false, NULL); + + if (h_bin_ptr[5] > h_bin_ptr[4]) + { + char *d_rf = hypre_CTAlloc(char, m, HYPRE_MEMORY_DEVICE); + + HYPRE_SPGEMM_ROWNNZ_BINNED( 5, SYMBL_HASH_SIZE[5], T_GROUP_SIZE[5], false, true, d_rf); + +#if defined(HYPRE_USING_SYCL) + HYPRE_Int num_failed_rows = + HYPRE_ONEDPL_CALL( std::reduce, + oneapi::dpl::make_transform_iterator(d_rf, type_cast()), + oneapi::dpl::make_transform_iterator(d_rf + m, type_cast()) ); +#else + HYPRE_Int num_failed_rows = + HYPRE_THRUST_CALL( reduce, + thrust::make_transform_iterator(d_rf, type_cast()), + thrust::make_transform_iterator(d_rf + m, type_cast()) ); +#endif + + if (num_failed_rows) + { +#ifdef HYPRE_SPGEMM_PRINTF + HYPRE_SPGEMM_PRINT("[%s, %d]: num of failed rows %d (%.2f)\n", __FILE__, __LINE__, + num_failed_rows, num_failed_rows / (m + 0.0) ); +#endif +#if defined(HYPRE_USING_SYCL) + oneapi::dpl::counting_iterator count(0); + HYPRE_Int *new_end = + hypreSycl_copy_if( count, + count + m, + d_rf, + d_rind, + [] (const auto & x) {return x;} ); +#else + HYPRE_Int *new_end = + HYPRE_THRUST_CALL( copy_if, + thrust::make_counting_iterator(0), + thrust::make_counting_iterator(m), + d_rf, + d_rind, + thrust::identity() ); +#endif + + hypre_assert(new_end - d_rind == num_failed_rows); + + /* Binning (bins 6-10) with d_rc which is a **rownnz-bound** now */ + HYPRE_Int high_bin = hypre_HandleSpgemmHighestBin(hypre_handle())[0]; + const char t = 6, u = high_bin; + const bool hbin9 = 9 == high_bin; + + hypre_SpGemmCreateBins(num_failed_rows, s, t, u, d_rc, true, d_rind, h_bin_ptr); + + HYPRE_SPGEMM_ROWNNZ_BINNED( 6, SYMBL_HASH_SIZE[ 6], T_GROUP_SIZE[ 6], false, false, NULL); + HYPRE_SPGEMM_ROWNNZ_BINNED( 7, SYMBL_HASH_SIZE[ 7], T_GROUP_SIZE[ 7], false, false, NULL); + HYPRE_SPGEMM_ROWNNZ_BINNED( 8, SYMBL_HASH_SIZE[ 8], T_GROUP_SIZE[ 8], false, false, NULL); + HYPRE_SPGEMM_ROWNNZ_BINNED( 9, SYMBL_HASH_SIZE[ 9], T_GROUP_SIZE[ 9], hbin9, false, NULL); + HYPRE_SPGEMM_ROWNNZ_BINNED( 10, SYMBL_HASH_SIZE[10], T_GROUP_SIZE[10], true, false, NULL); + } + + hypre_TFree(d_rf, HYPRE_MEMORY_DEVICE); + } + + hypre_TFree(d_rind, HYPRE_MEMORY_DEVICE); + + return hypre_error_flag; +} + +HYPRE_Int +hypreDevice_CSRSpGemmRownnz( HYPRE_Int m, + HYPRE_Int k, + HYPRE_Int n, + HYPRE_Int nnzA, + HYPRE_Int *d_ia, + HYPRE_Int *d_ja, + HYPRE_Int *d_ib, + HYPRE_Int *d_jb, + HYPRE_Int in_rc, + HYPRE_Int *d_rc ) +{ + HYPRE_UNUSED_VAR(in_rc); + +#ifdef HYPRE_PROFILE + hypre_profile_times[HYPRE_TIMER_ID_SPGEMM_SYMBOLIC] -= hypre_MPI_Wtime(); +#endif + +#ifdef HYPRE_SPGEMM_NVTX + hypre_GpuProfilingPushRange("CSRSpGemmRownnz"); +#endif + +#ifdef HYPRE_SPGEMM_TIMING + HYPRE_Real t1 = hypre_MPI_Wtime(); +#endif + + const HYPRE_Int binned = hypre_HandleSpgemmBinned(hypre_handle()); + + if (binned) + { + hypreDevice_CSRSpGemmRownnzBinned + (m, k, n, nnzA, d_ia, d_ja, d_ib, d_jb, 0 /* without input rc */, d_rc); + } + else + { + hypreDevice_CSRSpGemmRownnzNoBin + (m, k, n, d_ia, d_ja, d_ib, d_jb, 0 /* without input rc */, d_rc); + } + +#ifdef HYPRE_SPGEMM_TIMING + hypre_ForceSyncComputeStream(); + HYPRE_Real t2 = hypre_MPI_Wtime() - t1; + HYPRE_SPGEMM_PRINT("Rownnz time %f\n", t2); +#endif + +#ifdef HYPRE_SPGEMM_NVTX + hypre_GpuProfilingPopRange(); +#endif + +#ifdef HYPRE_PROFILE + hypre_profile_times[HYPRE_TIMER_ID_SPGEMM_SYMBOLIC] += hypre_MPI_Wtime(); +#endif + + return hypre_error_flag; +} + +#endif /* defined(HYPRE_USING_GPU) */ diff --git a/external/hypre/src/seq_mv/csr_spgemm_device_symbl.h b/external/hypre/src/seq_mv/csr_spgemm_device_symbl.h new file mode 100644 index 00000000..bf64351f --- /dev/null +++ b/external/hypre/src/seq_mv/csr_spgemm_device_symbl.h @@ -0,0 +1,629 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#include "seq_mv.h" +#include "csr_spgemm_device.h" + +/*- - - - - - - - - - - - - - - - - - - - - - - - - - * + Symbolic Multiplication + *- - - - - - - - - - - - - - - - - - - - - - - - - - */ + +#if defined(HYPRE_USING_GPU) + +/* HashKeys: assumed to be initialized as all -1's + * Key: assumed to be nonnegative + * increase by 1 if is a new entry + */ +template +static __device__ __forceinline__ +HYPRE_Int +hypre_spgemm_hash_insert_symbl( +#if defined(HYPRE_USING_SYCL) + HYPRE_Int *HashKeys, +#else + volatile HYPRE_Int *HashKeys, +#endif + HYPRE_Int key, + HYPRE_Int &count ) +{ + HYPRE_Int j = 0; + HYPRE_Int old = -1; + +#if defined(HYPRE_USING_HIP) && (HIP_VERSION == 50422804) + /* VPM: see https://github.com/hypre-space/hypre/issues/875 */ +#pragma unroll 8 +#else +#pragma unroll UNROLL_FACTOR +#endif + for (HYPRE_Int i = 0; i < SHMEM_HASH_SIZE; i++) + { + /* compute the hash value of key */ + if (i == 0) + { + j = key & (SHMEM_HASH_SIZE - 1); + } + else + { + j = HashFunc(key, i, j); + } + + /* try to insert key+1 into slot j */ +#if defined(HYPRE_USING_SYCL) + auto atomic_key = sycl::atomic_ref < + HYPRE_Int, sycl::memory_order::relaxed, + sycl::memory_scope::device, + sycl::access::address_space::local_space > (HashKeys[j]); + old = -1; + atomic_key.compare_exchange_strong(old, key); +#else + old = atomicCAS((HYPRE_Int*)(HashKeys + j), -1, key); +#endif + if (old == -1) + { + count++; + return j; + } + if (old == key) + { + return j; + } + } + return -1; +} + +template +static __device__ __forceinline__ +HYPRE_Int +hypre_spgemm_hash_insert_symbl( HYPRE_Int HashSize, +#if defined(HYPRE_USING_SYCL) + HYPRE_Int *HashKeys, +#else + volatile HYPRE_Int *HashKeys, +#endif + HYPRE_Int key, + HYPRE_Int &count ) +{ + HYPRE_Int j = 0; + HYPRE_Int old = -1; + + for (HYPRE_Int i = 0; i < HashSize; i++) + { + /* compute the hash value of key */ + if (i == 0) + { + j = key & (HashSize - 1); + } + else + { + j = HashFunc(HashSize, key, i, j); + } + + /* try to insert key+1 into slot j */ +#if defined(HYPRE_USING_SYCL) + auto atomic_key = sycl::atomic_ref < + HYPRE_Int, sycl::memory_order::relaxed, + sycl::memory_scope::device, + sycl::access::address_space::local_space > (HashKeys[j]); + old = -1; + atomic_key.compare_exchange_strong(old, key); +#else + old = atomicCAS((HYPRE_Int*)(HashKeys + j), -1, key); +#endif + + if (old == -1) + { + count++; + return j; + } + if (old == key) + { + return j; + } + } + return -1; +} + +template +static __device__ __forceinline__ +HYPRE_Int +hypre_spgemm_compute_row_symbl( hypre_DeviceItem &item, + HYPRE_Int istart_a, + HYPRE_Int iend_a, + const HYPRE_Int *ja, + const HYPRE_Int *ib, + const HYPRE_Int *jb, +#if defined(HYPRE_USING_SYCL) + HYPRE_Int *s_HashKeys, +#else + volatile HYPRE_Int *s_HashKeys, +#endif + HYPRE_Int g_HashSize, + HYPRE_Int *g_HashKeys, + char &failed ) +{ +#if defined(HYPRE_USING_SYCL) + HYPRE_Int threadIdx_x = item.get_local_id(2); + HYPRE_Int threadIdx_y = item.get_local_id(1); + HYPRE_Int blockDim_x = item.get_local_range(2); + HYPRE_Int blockDim_y = item.get_local_range(1); +#else + HYPRE_Int threadIdx_x = threadIdx.x; + HYPRE_Int threadIdx_y = threadIdx.y; + HYPRE_Int blockDim_x = blockDim.x; + HYPRE_Int blockDim_y = blockDim.y; +#endif + HYPRE_Int num_new_insert = 0; + + /* load column idx and values of row i of A */ + for (HYPRE_Int i = istart_a + threadIdx_y; warp_any_sync(item, HYPRE_WARP_FULL_MASK, i < iend_a); + i += blockDim_y) + { + HYPRE_Int rowB = -1; + + if (threadIdx_x == 0 && i < iend_a) + { + rowB = read_only_load(ja + i); + } + +#if 0 + //const HYPRE_Int ymask = get_mask<4>(...); + // TODO: need to confirm the behavior of __ballot_sync, leave it here for now + //const HYPRE_Int num_valid_rows = __popc(__ballot_sync(ymask, valid_i)); + //for (HYPRE_Int j = 0; j < num_valid_rows; j++) +#endif + + /* threads in the same ygroup work on one row together */ + rowB = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, rowB, 0, blockDim_x); + /* open this row of B, collectively */ + HYPRE_Int tmp = 0; + if (rowB != -1 && threadIdx_x < 2) + { + tmp = read_only_load(ib + rowB + threadIdx_x); + } + const HYPRE_Int rowB_start = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, tmp, 0, blockDim_x); + const HYPRE_Int rowB_end = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, tmp, 1, blockDim_x); + + for (HYPRE_Int k = rowB_start + threadIdx_x; + warp_any_sync(item, HYPRE_WARP_FULL_MASK, k < rowB_end); + k += blockDim_x) + { + if (k < rowB_end) + { + if (IA1) + { + num_new_insert ++; + } + else + { + const HYPRE_Int k_idx = read_only_load(jb + k); + /* first try to insert into shared memory hash table */ + HYPRE_Int pos = hypre_spgemm_hash_insert_symbl + (s_HashKeys, k_idx, num_new_insert); + + if (HAS_GHASH && -1 == pos) + { + pos = hypre_spgemm_hash_insert_symbl + (g_HashSize, g_HashKeys, k_idx, num_new_insert); + } + /* if failed again, both hash tables must have been full + (hash table size estimation was too small). + Increase the counter anyhow (will lead to over-counting) */ + if (pos == -1) + { + num_new_insert ++; + failed = 1; + } + } + } + } + } + + return num_new_insert; +} + +template +__global__ void +hypre_spgemm_symbolic( hypre_DeviceItem &item, +#if defined(HYPRE_USING_SYCL) + char *shmem_ptr, +#endif + const HYPRE_Int M, + const HYPRE_Int* __restrict__ rind, + const HYPRE_Int* __restrict__ ia, + const HYPRE_Int* __restrict__ ja, + const HYPRE_Int* __restrict__ ib, + const HYPRE_Int* __restrict__ jb, + const HYPRE_Int* __restrict__ ig, + HYPRE_Int* __restrict__ jg, + HYPRE_Int* __restrict__ rc, + char* __restrict__ rf ) +{ + /* number of groups in the grid */ +#if defined(HYPRE_USING_SYCL) + volatile const HYPRE_Int grid_num_groups = get_num_groups(item) * item.get_group_range(2); +#else + volatile const HYPRE_Int grid_num_groups = get_num_groups(item) * gridDim.x; +#endif + /* group id inside the block */ + volatile const HYPRE_Int group_id = get_group_id(item); + /* group id in the grid */ +#if defined(HYPRE_USING_SYCL) + volatile const HYPRE_Int grid_group_id = item.get_group(2) * get_num_groups(item) + group_id; +#else + volatile const HYPRE_Int grid_group_id = blockIdx.x * get_num_groups(item) + group_id; +#endif + /* lane id inside the group */ + volatile const HYPRE_Int lane_id = get_group_lane_id(item); +#if defined(HYPRE_USING_SYCL) + /* shared memory hash table */ + HYPRE_Int *s_HashKeys = (HYPRE_Int*) shmem_ptr; + /* shared memory hash table for this group */ + HYPRE_Int *group_s_HashKeys = s_HashKeys + group_id * SHMEM_HASH_SIZE; +#else + /* shared memory hash table */ +#if defined(HYPRE_SPGEMM_DEVICE_USE_DSHMEM) + extern __shared__ volatile HYPRE_Int shared_mem[]; + volatile HYPRE_Int *s_HashKeys = shared_mem; +#else + __shared__ volatile HYPRE_Int s_HashKeys[NUM_GROUPS_PER_BLOCK * SHMEM_HASH_SIZE]; +#endif + /* shared memory hash table for this group */ + volatile HYPRE_Int *group_s_HashKeys = s_HashKeys + group_id * SHMEM_HASH_SIZE; +#endif + + const HYPRE_Int UNROLL_FACTOR = hypre_min(HYPRE_SPGEMM_SYMBL_UNROLL, SHMEM_HASH_SIZE); + HYPRE_Int valid_ptr; + +#if defined(HYPRE_USING_SYCL) + hypre_device_assert(item.get_local_range(2) * item.get_local_range(1) == GROUP_SIZE); +#else + hypre_device_assert(blockDim.x * blockDim.y == GROUP_SIZE); +#endif + + /* WM: note - in cuda/hip, exited threads are not required to reach collective calls like + * syncthreads(), but this is not true for sycl (all threads must call the collective). + * Thus, all threads in the block must enter the loop (which is not ensured for cuda). */ +#if defined(HYPRE_USING_SYCL) + for (HYPRE_Int i = grid_group_id; sycl::any_of_group(item.get_group(), i < M); + i += grid_num_groups) +#else + for (HYPRE_Int i = grid_group_id; warp_any_sync(item, HYPRE_WARP_FULL_MASK, i < M); + i += grid_num_groups) +#endif + { +#if defined(HYPRE_USING_SYCL) + valid_ptr = warp_any_sync(item, HYPRE_WARP_FULL_MASK, i < M) && + (GROUP_SIZE >= HYPRE_WARP_SIZE || i < M); +#else + valid_ptr = GROUP_SIZE >= HYPRE_WARP_SIZE || i < M; +#endif + + HYPRE_Int ii = -1; + char failed = 0; + + if (HAS_RIND) + { + group_read(item, rind + i, valid_ptr, ii); + } + else + { + ii = i; + } + + /* start/end position of global memory hash table */ + HYPRE_Int istart_g = 0, iend_g = 0, ghash_size = 0; + + if (HAS_GHASH) + { + group_read(item, ig + grid_group_id, valid_ptr, + istart_g, iend_g); + + /* size of global hash table allocated for this row + (must be power of 2 and >= the actual size of the row of C - shmem hash size) */ + ghash_size = iend_g - istart_g; + + /* initialize group's global memory hash table */ + for (HYPRE_Int k = lane_id; k < ghash_size; k += GROUP_SIZE) + { + jg[istart_g + k] = -1; + } + } + + /* initialize group's shared memory hash table */ + if (valid_ptr) + { +#pragma unroll UNROLL_FACTOR + for (HYPRE_Int k = lane_id; k < SHMEM_HASH_SIZE; k += GROUP_SIZE) + { + group_s_HashKeys[k] = -1; + } + } + + group_sync(item); + + /* start/end position of row of A */ + HYPRE_Int istart_a = 0, iend_a = 0; + + /* load the start and end position of row ii of A */ + group_read(item, ia + ii, valid_ptr, istart_a, iend_a); + + /* work with two hash tables */ + HYPRE_Int jsum; + + if (iend_a == istart_a + 1) + { + jsum = hypre_spgemm_compute_row_symbl + (item, istart_a, iend_a, ja, ib, jb, group_s_HashKeys, ghash_size, jg + istart_g, failed); + } + else + { + jsum = hypre_spgemm_compute_row_symbl + (item, istart_a, iend_a, ja, ib, jb, group_s_HashKeys, ghash_size, jg + istart_g, failed); + } + +#if defined(HYPRE_DEBUG) + hypre_device_assert(CAN_FAIL || failed == 0); +#endif + + /* num of nonzeros of this row (an upper bound) + * use s_HashKeys as shared memory workspace */ + if (GROUP_SIZE <= HYPRE_WARP_SIZE) + { + jsum = group_reduce_sum(item, jsum); + } + else + { + group_sync(item); + + jsum = group_reduce_sum(item, jsum, s_HashKeys); + } + + /* if this row failed */ + if (CAN_FAIL) + { + if (GROUP_SIZE <= HYPRE_WARP_SIZE) + { + failed = (char) group_reduce_sum(item, + (hypre_int) failed); + } + else + { + failed = (char) group_reduce_sum(item, + (HYPRE_Int) failed, + s_HashKeys); + } + } + + if ((valid_ptr) && lane_id == 0) + { +#if defined(HYPRE_DEBUG) + hypre_device_assert(ii >= 0); +#endif + rc[ii] = jsum; + + if (CAN_FAIL) + { + rf[ii] = failed > 0; + } + } + } +} + +template +HYPRE_Int +hypre_spgemm_symbolic_rownnz( HYPRE_Int m, + HYPRE_Int *row_ind, /* input: row indices (length of m) */ + HYPRE_Int k, + HYPRE_Int n, + bool need_ghash, + HYPRE_Int *d_ia, + HYPRE_Int *d_ja, + HYPRE_Int *d_ib, + HYPRE_Int *d_jb, + HYPRE_Int *d_rc, + bool can_fail, + char *d_rf /* output: if symbolic mult. failed for each row */ ) +{ + const HYPRE_Int num_groups_per_block = hypre_spgemm_get_num_groups_per_block(); +#if defined(HYPRE_USING_CUDA) + const HYPRE_Int BDIMX = hypre_min(4, GROUP_SIZE); +#elif defined(HYPRE_USING_HIP) + const HYPRE_Int BDIMX = hypre_min(2, GROUP_SIZE); +#elif defined(HYPRE_USING_SYCL) + const HYPRE_Int BDIMX = hypre_min(2, GROUP_SIZE); +#endif + const HYPRE_Int BDIMY = GROUP_SIZE / BDIMX; + +#if defined(HYPRE_USING_SYCL) + /* CUDA kernel configurations: bDim.z is the number of groups in block */ + dim3 bDim(num_groups_per_block, BDIMY, BDIMX); + hypre_assert(bDim.get(2) * bDim.get(1) == GROUP_SIZE); + // grid dimension (number of blocks) + const HYPRE_Int num_blocks = hypre_min( hypre_HandleSpgemmBlockNumDim(hypre_handle())[0][BIN], + (m + bDim.get(0) - 1) / bDim.get(0) ); + dim3 gDim(1, 1, num_blocks); + // number of active groups + HYPRE_Int num_act_groups = hypre_min(bDim.get(0) * gDim.get(2), m); +#else + /* CUDA kernel configurations: bDim.z is the number of groups in block */ + dim3 bDim(BDIMX, BDIMY, num_groups_per_block); + hypre_assert(bDim.x * bDim.y == GROUP_SIZE); + // grid dimension (number of blocks) + const HYPRE_Int num_blocks = hypre_min( hypre_HandleSpgemmBlockNumDim(hypre_handle())[0][BIN], + (HYPRE_Int) ((m + bDim.z - 1) / bDim.z) ); + dim3 gDim( num_blocks ); + // number of active groups + HYPRE_Int num_act_groups = hypre_min((HYPRE_Int) (bDim.z * gDim.x), m); +#endif + + const char HASH_TYPE = HYPRE_SPGEMM_HASH_TYPE; + if (HASH_TYPE != 'L' && HASH_TYPE != 'Q' && HASH_TYPE != 'D') + { + hypre_printf("Unrecognized hash type ... [L(inear), Q(uadratic), D(ouble)]\n"); + } + + /* --------------------------------------------------------------------------- + * build hash table (no values) + * ---------------------------------------------------------------------------*/ + HYPRE_Int *d_ghash_i = NULL; + HYPRE_Int *d_ghash_j = NULL; + HYPRE_Int ghash_size = 0; + + if (need_ghash) + { + hypre_SpGemmCreateGlobalHashTable(m, row_ind, num_act_groups, d_rc, SHMEM_HASH_SIZE, + &d_ghash_i, &d_ghash_j, NULL, &ghash_size); + } + +#ifdef HYPRE_SPGEMM_PRINTF + HYPRE_SPGEMM_PRINT("%s[%d], BIN[%d]: m %d k %d n %d, HASH %c, SHMEM_HASH_SIZE %d, GROUP_SIZE %d, " + "can_fail %d, need_ghash %d, ghash %p size %d\n", + __FILE__, __LINE__, BIN, m, k, n, + HASH_TYPE, SHMEM_HASH_SIZE, GROUP_SIZE, can_fail, need_ghash, d_ghash_i, ghash_size); +#if defined(HYPRE_USING_SYCL) + HYPRE_SPGEMM_PRINT("kernel spec [%d %d %d] x [%d %d %d]\n", gDim.get(2), gDim.get(1), gDim.get(0), + bDim.get(2), bDim.get(1), bDim.get(0)); +#else + HYPRE_SPGEMM_PRINT("kernel spec [%d %d %d] x [%d %d %d]\n", gDim.x, gDim.y, gDim.z, bDim.x, bDim.y, + bDim.z); +#endif +#else + HYPRE_UNUSED_VAR(k); + HYPRE_UNUSED_VAR(n); +#endif + +#if defined(HYPRE_SPGEMM_DEVICE_USE_DSHMEM) || defined(HYPRE_USING_SYCL) + const size_t shmem_bytes = num_groups_per_block * SHMEM_HASH_SIZE * sizeof(HYPRE_Int); +#else + const size_t shmem_bytes = 0; +#endif + + /* --------------------------------------------------------------------------- + * symbolic multiplication: + * On output, it provides an upper bound of nnz in rows of C + * ---------------------------------------------------------------------------*/ + hypre_assert(HAS_RIND == (row_ind != NULL) ); + + /* */ + + if (can_fail) + { + if (ghash_size) + { + HYPRE_GPU_LAUNCH2( + (hypre_spgemm_symbolic), + gDim, bDim, shmem_bytes, + m, row_ind, d_ia, d_ja, d_ib, d_jb, d_ghash_i, d_ghash_j, d_rc, d_rf ); + } + else + { + HYPRE_GPU_LAUNCH2( + (hypre_spgemm_symbolic), + gDim, bDim, shmem_bytes, + m, row_ind, d_ia, d_ja, d_ib, d_jb, d_ghash_i, d_ghash_j, d_rc, d_rf ); + } + } + else + { + if (ghash_size) + { + HYPRE_GPU_LAUNCH2( + (hypre_spgemm_symbolic), + gDim, bDim, shmem_bytes, + m, row_ind, d_ia, d_ja, d_ib, d_jb, d_ghash_i, d_ghash_j, d_rc, d_rf ); + } + else + { + HYPRE_GPU_LAUNCH2( + (hypre_spgemm_symbolic), + gDim, bDim, shmem_bytes, + m, row_ind, d_ia, d_ja, d_ib, d_jb, d_ghash_i, d_ghash_j, d_rc, d_rf ); + } + } + + hypre_TFree(d_ghash_i, HYPRE_MEMORY_DEVICE); + hypre_TFree(d_ghash_j, HYPRE_MEMORY_DEVICE); + + return hypre_error_flag; +} + +template +HYPRE_Int hypre_spgemm_symbolic_max_num_blocks( HYPRE_Int multiProcessorCount, + HYPRE_Int *num_blocks_ptr, + HYPRE_Int *block_size_ptr ) +{ + const char HASH_TYPE = HYPRE_SPGEMM_HASH_TYPE; + const HYPRE_Int num_groups_per_block = hypre_spgemm_get_num_groups_per_block(); + const HYPRE_Int block_size = num_groups_per_block * GROUP_SIZE; + hypre_int numBlocksPerSm = 0; +#if defined(HYPRE_SPGEMM_DEVICE_USE_DSHMEM) + const hypre_int shmem_bytes = num_groups_per_block * SHMEM_HASH_SIZE * sizeof(HYPRE_Int); + hypre_int dynamic_shmem_size = shmem_bytes; +#else + hypre_int dynamic_shmem_size = 0; +#endif + +#if defined(HYPRE_SPGEMM_DEVICE_USE_DSHMEM) +#if defined(HYPRE_USING_CUDA) + /* with CUDA, to use > 48K shared memory, must use dynamic and must opt-in. BIN = 10 requires 64K */ + hypre_int max_shmem_optin; + hypre_GetDeviceMaxShmemSize(-1, NULL, &max_shmem_optin); + + if (dynamic_shmem_size <= max_shmem_optin) + { + HYPRE_CUDA_CALL( cudaFuncSetAttribute( + hypre_spgemm_symbolic, + cudaFuncAttributeMaxDynamicSharedMemorySize, dynamic_shmem_size) ); + + HYPRE_CUDA_CALL( cudaFuncSetAttribute( + hypre_spgemm_symbolic, + cudaFuncAttributeMaxDynamicSharedMemorySize, dynamic_shmem_size) ); + + HYPRE_CUDA_CALL( cudaFuncSetAttribute( + hypre_spgemm_symbolic, + cudaFuncAttributeMaxDynamicSharedMemorySize, dynamic_shmem_size) ); + + HYPRE_CUDA_CALL( cudaFuncSetAttribute( + hypre_spgemm_symbolic, + cudaFuncAttributeMaxDynamicSharedMemorySize, dynamic_shmem_size) ); + + /* + HYPRE_CUDA_CALL( cudaFuncSetAttribute( + hypre_spgemm_symbolic, + cudaFuncAttributeMaxDynamicSharedMemorySize, dynamic_shmem_size) ); + */ + } +#endif +#endif + +#if defined(HYPRE_USING_CUDA) + HYPRE_CUDA_CALL(cudaOccupancyMaxActiveBlocksPerMultiprocessor( + &numBlocksPerSm, + hypre_spgemm_symbolic, + block_size, dynamic_shmem_size)); +#endif + +#if defined(HYPRE_USING_HIP) + HYPRE_HIP_CALL(hipOccupancyMaxActiveBlocksPerMultiprocessor( + &numBlocksPerSm, + hypre_spgemm_symbolic, + block_size, dynamic_shmem_size)); +#endif + +#if defined(HYPRE_USING_SYCL) + /* WM: todo - sycl version of the above? */ + numBlocksPerSm = 1; +#endif + + *num_blocks_ptr = multiProcessorCount * numBlocksPerSm; + *block_size_ptr = block_size; + + return hypre_error_flag; +} + +#endif /* defined(HYPRE_USING_GPU) */ diff --git a/external/hypre/src/seq_mv/csr_spgemm_device_symbl.in b/external/hypre/src/seq_mv/csr_spgemm_device_symbl.in new file mode 100644 index 00000000..dc51ffad --- /dev/null +++ b/external/hypre/src/seq_mv/csr_spgemm_device_symbl.in @@ -0,0 +1,40 @@ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#include "seq_mv.h" + +#if defined(HYPRE_USING_GPU) + +#if defined(HYPRE_USING_CUDA) && HYPRE_SPGEMM_BIN >= 10 +#define HYPRE_SPGEMM_DEVICE_USE_DSHMEM +#endif + +#include + +template HYPRE_Int +hypre_spgemm_symbolic_rownnz +< HYPRE_SPGEMM_BIN, SYMBL_HASH_SIZE[HYPRE_SPGEMM_BIN], T_GROUP_SIZE[HYPRE_SPGEMM_BIN], true > +( HYPRE_Int m, HYPRE_Int *row_ind, HYPRE_Int k, HYPRE_Int n, bool need_ghash, HYPRE_Int *d_ia, + HYPRE_Int *d_ja, + HYPRE_Int *d_ib, HYPRE_Int *d_jb, HYPRE_Int *d_rc, bool can_fail, char *d_rf ); + +#if HYPRE_SPGEMM_BIN == 5 +template HYPRE_Int +hypre_spgemm_symbolic_rownnz +< HYPRE_SPGEMM_BIN, SYMBL_HASH_SIZE[HYPRE_SPGEMM_BIN], T_GROUP_SIZE[HYPRE_SPGEMM_BIN], false > +( HYPRE_Int m, HYPRE_Int *row_ind, HYPRE_Int k, HYPRE_Int n, bool need_ghash, HYPRE_Int *d_ia, + HYPRE_Int *d_ja, + HYPRE_Int *d_ib, HYPRE_Int *d_jb, HYPRE_Int *d_rc, bool can_fail, char *d_rf ); +#endif + +template HYPRE_Int +hypre_spgemm_symbolic_max_num_blocks +< SYMBL_HASH_SIZE[HYPRE_SPGEMM_BIN], T_GROUP_SIZE[HYPRE_SPGEMM_BIN] > +( HYPRE_Int multiProcessorCount, HYPRE_Int *num_blocks_ptr, HYPRE_Int *block_size_ptr ); + +#endif /* defined(HYPRE_USING_GPU) */ diff --git a/external/hypre/src/seq_mv/csr_spgemm_device_util.c b/external/hypre/src/seq_mv/csr_spgemm_device_util.c index 63270e43..fcbd795e 100644 --- a/external/hypre/src/seq_mv/csr_spgemm_device_util.c +++ b/external/hypre/src/seq_mv/csr_spgemm_device_util.c @@ -1,50 +1,189 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ +#include "_hypre_onedpl.hpp" #include "seq_mv.h" #include "csr_spgemm_device.h" -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_GPU) -/* assume d_c is of length m and contains the "sizes" */ +#if (defined(THRUST_VERSION) && THRUST_VERSION < 101000) +struct row_size : public thrust::unary_function +#else +struct row_size +#endif +{ + HYPRE_Int SHMEM_HASH_SIZE; + + row_size(HYPRE_Int SHMEM_HASH_SIZE_ = HYPRE_Int()) { SHMEM_HASH_SIZE = SHMEM_HASH_SIZE_; } + + __device__ HYPRE_Int operator()(const HYPRE_Int &x) const + { + // RL: ??? + return next_power_of_2(x - SHMEM_HASH_SIZE) + x; + } +}; + +/* Assume d_c is of length m and contains the size of each row + * d_i has size (m+1) on entry + * generate (i,j,a) with d_c */ void hypre_create_ija( HYPRE_Int m, - HYPRE_Int *d_c, + HYPRE_Int *row_id, /* length of m, row indices; if null, it is [0,1,2,3,...] */ + HYPRE_Int *d_c, /* d_c[row_id[i]] is the size of ith row */ HYPRE_Int *d_i, HYPRE_Int **d_j, HYPRE_Complex **d_a, - HYPRE_Int *nnz ) + HYPRE_Int + *nnz_ptr /* in/out: if input >= 0, it must be the sum of d_c, remain unchanged in output + if input < 0, it is computed as the sum of d_c and output */) { + HYPRE_Int nnz = 0; + hypre_Memset(d_i, 0, sizeof(HYPRE_Int), HYPRE_MEMORY_DEVICE); - HYPRE_THRUST_CALL(inclusive_scan, d_c, d_c + m, d_i + 1); +#if defined(HYPRE_USING_SYCL) + if (row_id) + { + HYPRE_ONEDPL_CALL(std::inclusive_scan, + oneapi::dpl::make_permutation_iterator(d_c, row_id), + oneapi::dpl::make_permutation_iterator(d_c, row_id) + m, + d_i + 1); + } + else + { + HYPRE_ONEDPL_CALL(std::inclusive_scan, + d_c, + d_c + m, + d_i + 1); + } +#else + if (row_id) + { + HYPRE_THRUST_CALL(inclusive_scan, + thrust::make_permutation_iterator(d_c, row_id), + thrust::make_permutation_iterator(d_c, row_id) + m, + d_i + 1); + } + else + { + HYPRE_THRUST_CALL(inclusive_scan, + d_c, + d_c + m, + d_i + 1); + } +#endif - hypre_TMemcpy(nnz, d_i + m, HYPRE_Int, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); + if (*nnz_ptr >= 0) + { +#if defined(HYPRE_DEBUG) + hypre_TMemcpy(&nnz, d_i + m, HYPRE_Int, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); + hypre_assert(nnz == *nnz_ptr); +#endif + nnz = *nnz_ptr; + } + else + { + hypre_TMemcpy(&nnz, d_i + m, HYPRE_Int, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); + *nnz_ptr = nnz; + } if (d_j) { - *d_j = hypre_TAlloc(HYPRE_Int, *nnz, HYPRE_MEMORY_DEVICE); + *d_j = hypre_TAlloc(HYPRE_Int, nnz, HYPRE_MEMORY_DEVICE); } if (d_a) { - *d_a = hypre_TAlloc(HYPRE_Complex, *nnz, HYPRE_MEMORY_DEVICE); + *d_a = hypre_TAlloc(HYPRE_Complex, nnz, HYPRE_MEMORY_DEVICE); + } +} + +/* Assume d_c is of length m and contains the size of each row + * d_i has size (m+1) on entry + * generate (i,j,a) with row_size(d_c) see above (over allocation) */ +void +hypre_create_ija( HYPRE_Int SHMEM_HASH_SIZE, + HYPRE_Int m, + HYPRE_Int *row_id, /* length of m, row indices; if null, it is [0,1,2,3,...] */ + HYPRE_Int *d_c, /* d_c[row_id[i]] is the size of ith row */ + HYPRE_Int *d_i, + HYPRE_Int **d_j, + HYPRE_Complex **d_a, + HYPRE_Int *nnz_ptr ) +{ + HYPRE_Int nnz = 0; + + hypre_Memset(d_i, 0, sizeof(HYPRE_Int), HYPRE_MEMORY_DEVICE); + +#if defined(HYPRE_USING_SYCL) + if (row_id) + { + HYPRE_ONEDPL_CALL( std::inclusive_scan, + oneapi::dpl::make_transform_iterator(oneapi::dpl::make_permutation_iterator(d_c, row_id), + row_size(SHMEM_HASH_SIZE)), + oneapi::dpl::make_transform_iterator(oneapi::dpl::make_permutation_iterator(d_c, row_id), + row_size(SHMEM_HASH_SIZE)) + m, + d_i + 1 ); + } + else + { + HYPRE_ONEDPL_CALL( std::inclusive_scan, + oneapi::dpl::make_transform_iterator(d_c, row_size(SHMEM_HASH_SIZE)), + oneapi::dpl::make_transform_iterator(d_c, row_size(SHMEM_HASH_SIZE)) + m, + d_i + 1 ); + } +#else + if (row_id) + { + HYPRE_THRUST_CALL( inclusive_scan, + thrust::make_transform_iterator(thrust::make_permutation_iterator(d_c, row_id), + row_size(SHMEM_HASH_SIZE)), + thrust::make_transform_iterator(thrust::make_permutation_iterator(d_c, row_id), + row_size(SHMEM_HASH_SIZE)) + m, + d_i + 1 ); + } + else + { + HYPRE_THRUST_CALL( inclusive_scan, + thrust::make_transform_iterator(d_c, row_size(SHMEM_HASH_SIZE)), + thrust::make_transform_iterator(d_c, row_size(SHMEM_HASH_SIZE)) + m, + d_i + 1 ); + } +#endif + + hypre_TMemcpy(&nnz, d_i + m, HYPRE_Int, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); + + if (nnz_ptr) + { + *nnz_ptr = nnz; + } + + if (d_j) + { + *d_j = hypre_TAlloc(HYPRE_Int, nnz, HYPRE_MEMORY_DEVICE); + } + + if (d_a) + { + *d_a = hypre_TAlloc(HYPRE_Complex, nnz, HYPRE_MEMORY_DEVICE); } } __global__ void -hypre_SpGemmGhashSize1( HYPRE_Int num_rows, - HYPRE_Int *row_id, - HYPRE_Int num_ghash, - HYPRE_Int *row_sizes, - HYPRE_Int *ghash_sizes, - HYPRE_Int SHMEM_HASH_SIZE ) +hypre_SpGemmGhashSize( hypre_DeviceItem &item, + HYPRE_Int num_rows, + HYPRE_Int *row_id, + HYPRE_Int num_ghash, + HYPRE_Int *row_sizes, + HYPRE_Int *ghash_sizes, + HYPRE_Int SHMEM_HASH_SIZE ) { - const HYPRE_Int global_thread_id = hypre_cuda_get_grid_thread_id<1,1>(); + const HYPRE_Int global_thread_id = hypre_gpu_get_grid_thread_id<1, 1>(item); if (global_thread_id >= num_ghash) { @@ -64,24 +203,6 @@ hypre_SpGemmGhashSize1( HYPRE_Int num_rows, ghash_sizes[global_thread_id] = j; } -__global__ void -hypre_SpGemmGhashSize2( HYPRE_Int num_rows, - HYPRE_Int *row_id, - HYPRE_Int num_ghash, - HYPRE_Int *row_sizes, - HYPRE_Int *ghash_sizes, - HYPRE_Int SHMEM_HASH_SIZE ) -{ - const HYPRE_Int i = hypre_cuda_get_grid_thread_id<1,1>(); - - if (i < num_rows) - { - const HYPRE_Int rid = row_id ? read_only_load(&row_id[i]) : i; - const HYPRE_Int rnz = read_only_load(&row_sizes[rid]); - ghash_sizes[rid] = next_power_of_2(rnz - SHMEM_HASH_SIZE); - } -} - HYPRE_Int hypre_SpGemmCreateGlobalHashTable( HYPRE_Int num_rows, /* number of rows */ HYPRE_Int *row_id, /* row_id[i] is index of ith row; i if row_id == NULL */ @@ -91,32 +212,23 @@ hypre_SpGemmCreateGlobalHashTable( HYPRE_Int num_rows, /* number of HYPRE_Int **ghash_i_ptr, /* of length num_ghash + 1 */ HYPRE_Int **ghash_j_ptr, HYPRE_Complex **ghash_a_ptr, - HYPRE_Int *ghash_size_ptr, - HYPRE_Int type ) + HYPRE_Int *ghash_size_ptr ) { - hypre_assert(type == 2 || num_ghash <= num_rows); + hypre_assert(num_ghash <= num_rows); HYPRE_Int *ghash_i, ghash_size; - dim3 bDim = hypre_GetDefaultCUDABlockDimension(); + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); - if (type == 1) - { - ghash_i = hypre_TAlloc(HYPRE_Int, num_ghash + 1, HYPRE_MEMORY_DEVICE); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(num_ghash, "thread", bDim); - HYPRE_CUDA_LAUNCH( hypre_SpGemmGhashSize1, gDim, bDim, - num_rows, row_id, num_ghash, row_sizes, ghash_i, SHMEM_HASH_SIZE ); - } - else if (type == 2) - { - ghash_i = hypre_CTAlloc(HYPRE_Int, num_ghash + 1, HYPRE_MEMORY_DEVICE); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(num_rows, "thread", bDim); - HYPRE_CUDA_LAUNCH( hypre_SpGemmGhashSize2, gDim, bDim, - num_rows, row_id, num_ghash, row_sizes, ghash_i, SHMEM_HASH_SIZE ); - } + ghash_i = hypre_TAlloc(HYPRE_Int, num_ghash + 1, HYPRE_MEMORY_DEVICE); + hypre_Memset(ghash_i + num_ghash, 0, sizeof(HYPRE_Int), HYPRE_MEMORY_DEVICE); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(num_ghash, "thread", bDim); + HYPRE_GPU_LAUNCH( hypre_SpGemmGhashSize, gDim, bDim, + num_rows, row_id, num_ghash, row_sizes, ghash_i, SHMEM_HASH_SIZE ); hypreDevice_IntegerExclusiveScan(num_ghash + 1, ghash_i); - hypre_TMemcpy(&ghash_size, ghash_i + num_ghash, HYPRE_Int, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(&ghash_size, ghash_i + num_ghash, HYPRE_Int, 1, HYPRE_MEMORY_HOST, + HYPRE_MEMORY_DEVICE); if (!ghash_size) { @@ -146,5 +258,83 @@ hypre_SpGemmCreateGlobalHashTable( HYPRE_Int num_rows, /* number of return hypre_error_flag; } +HYPRE_Int hypre_SpGemmCreateBins( HYPRE_Int m, + char s, + char t, + char u, + HYPRE_Int *d_rc, + bool d_rc_indice_in, + HYPRE_Int *d_rc_indice, + HYPRE_Int *h_bin_ptr ) +{ +#ifdef HYPRE_SPGEMM_TIMING + hypre_ForceSyncComputeStream(); + HYPRE_Real t1 = hypre_MPI_Wtime(); +#endif + + HYPRE_Int num_bins = hypre_HandleSpgemmNumBin(hypre_handle()); + HYPRE_Int *d_bin_ptr = hypre_TAlloc(HYPRE_Int, num_bins + 1, HYPRE_MEMORY_DEVICE); + + /* assume there are no more than 127 = 2^7-1 bins, which should be enough */ + char *d_bin_key = hypre_TAlloc(char, m, HYPRE_MEMORY_DEVICE); + +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::transform, + d_rc, + d_rc + m, + d_bin_key, + spgemm_bin_op(s, t, u) ); + + if (!d_rc_indice_in) + { + hypreSycl_sequence(d_rc_indice, d_rc_indice + m, 0); + } + + hypreSycl_stable_sort_by_key(d_bin_key, d_bin_key + m, d_rc_indice); + + HYPRE_ONEDPL_CALL( oneapi::dpl::lower_bound, + d_bin_key, + d_bin_key + m, + oneapi::dpl::counting_iterator(1), + oneapi::dpl::counting_iterator(num_bins + 2), + d_bin_ptr ); +#else + HYPRE_THRUST_CALL( transform, + d_rc, + d_rc + m, + d_bin_key, + spgemm_bin_op(s, t, u) ); + + if (!d_rc_indice_in) + { + HYPRE_THRUST_CALL( sequence, d_rc_indice, d_rc_indice + m); + } + + HYPRE_THRUST_CALL( stable_sort_by_key, d_bin_key, d_bin_key + m, d_rc_indice ); + + HYPRE_THRUST_CALL( lower_bound, + d_bin_key, + d_bin_key + m, + thrust::make_counting_iterator(1), + thrust::make_counting_iterator(num_bins + 2), + d_bin_ptr ); #endif + hypre_TMemcpy(h_bin_ptr, d_bin_ptr, HYPRE_Int, num_bins + 1, HYPRE_MEMORY_HOST, + HYPRE_MEMORY_DEVICE); + + hypre_assert(h_bin_ptr[num_bins] == m); + + hypre_TFree(d_bin_key, HYPRE_MEMORY_DEVICE); + hypre_TFree(d_bin_ptr, HYPRE_MEMORY_DEVICE); + +#ifdef HYPRE_SPGEMM_TIMING + hypre_ForceSyncComputeStream(); + HYPRE_Real t2 = hypre_MPI_Wtime() - t1; + HYPRE_SPGEMM_PRINT("%s[%d]: Binning time %f\n", __FILE__, __LINE__, t2); +#endif + + return hypre_error_flag; +} + +#endif // #if defined(HYPRE_USING_GPU) diff --git a/external/hypre/src/seq_mv/csr_spmv_device.c b/external/hypre/src/seq_mv/csr_spmv_device.c index ba0a1857..38cefc77 100644 --- a/external/hypre/src/seq_mv/csr_spmv_device.c +++ b/external/hypre/src/seq_mv/csr_spmv_device.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -14,248 +14,591 @@ #include "seq_mv.h" #include "_hypre_utilities.hpp" -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - -#define SPMV_BLOCKDIM 512 -#define VERSION 1 - -#define SPMV_ADD_SUM(p) \ -{ \ - const HYPRE_Int col = read_only_load(&d_ja[p]); \ - if (F == 0) \ - { \ - sum += read_only_load(&d_a[p]) * read_only_load(&d_x[col]); \ - } \ - else if (F == -1) \ - { \ - if (col <= grid_group_id) \ - { \ - sum += read_only_load(&d_a[p]) * read_only_load(&d_x[col]); \ - } \ - } \ - else if (F == 1) \ - { \ - if (col >= grid_group_id) \ - { \ - sum += read_only_load(&d_a[p]) * read_only_load(&d_x[col]); \ - } \ - } \ - else if (F == -2) \ - { \ - if (col < grid_group_id) \ - { \ - sum += read_only_load(&d_a[p]) * read_only_load(&d_x[col]); \ - } \ - } \ - else if (F == 2) \ - { \ - if (col > grid_group_id) \ - { \ - sum += read_only_load(&d_a[p]) * read_only_load(&d_x[col]); \ - } \ - } \ -} +#if defined(HYPRE_USING_GPU) + +#include "csr_spmv_device.h" + +/*-------------------------------------------------------------------------- + * hypreGPUKernel_CSRMatvecShuffleGT8 + * + * Templated SpMV device kernel based of warp-shuffle reduction. + * Uses groups of K threads per row. + * Specialized function for num_vectors > 8 + * + * Template parameters: + * 1) K: number of threads working on a single row. K = 2, 4, 8, 16, 32 + * 2) F: fill-mode. See hypreDevice_CSRMatrixMatvec for supported values + * 3) NV: number of vectors (> 1 for multi-component vectors) + * 4) T: data type of matrix/vector coefficients + *--------------------------------------------------------------------------*/ -/* K is the number of threads working on a single row. K = 2, 4, 8, 16, 32 */ -template +template __global__ void -hypre_csr_v_k_shuffle(HYPRE_Int n, - T alpha, - HYPRE_Int *d_ia, - HYPRE_Int *d_ja, - T *d_a, - T *d_x, - T beta, - T *d_y) +hypreGPUKernel_CSRMatvecShuffleGT8(hypre_DeviceItem &item, + HYPRE_Int num_rows, + HYPRE_Int num_vectors, + HYPRE_Int *row_id, + HYPRE_Int idxstride_x, + HYPRE_Int idxstride_y, + HYPRE_Int vecstride_x, + HYPRE_Int vecstride_y, + T alpha, + HYPRE_Int *d_ia, + HYPRE_Int *d_ja, + T *d_a, + T *d_x, + T beta, + T *d_y ) { - /*------------------------------------------------------------* - * CSR spmv-vector kernel - * warp-shuffle reduction - * (Group of K threads) per row - *------------------------------------------------------------*/ - const HYPRE_Int grid_ngroups = gridDim.x * (SPMV_BLOCKDIM / K); - HYPRE_Int grid_group_id = (blockIdx.x * SPMV_BLOCKDIM + threadIdx.x) / K; - const HYPRE_Int group_lane = threadIdx.x & (K - 1); - const HYPRE_Int warp_lane = threadIdx.x & (HYPRE_WARP_SIZE - 1); - const HYPRE_Int warp_group_id = warp_lane / K; - const HYPRE_Int warp_ngroups = HYPRE_WARP_SIZE / K; - - for (; __any_sync(HYPRE_WARP_FULL_MASK, grid_group_id < n); grid_group_id += grid_ngroups) +#if defined (HYPRE_USING_SYCL) + const HYPRE_Int grid_ngroups = item.get_group_range(2) * (HYPRE_SPMV_BLOCKDIM / K); + HYPRE_Int grid_group_id = (item.get_group(2) * HYPRE_SPMV_BLOCKDIM + item.get_local_id( + 2)) / K; + const HYPRE_Int group_lane = item.get_local_id(2) & (K - 1); +#else + const HYPRE_Int grid_ngroups = gridDim.x * (HYPRE_SPMV_BLOCKDIM / K); + HYPRE_Int grid_group_id = (blockIdx.x * HYPRE_SPMV_BLOCKDIM + threadIdx.x) / K; + const HYPRE_Int group_lane = threadIdx.x & (K - 1); +#endif + T sum[64]; + + for (; warp_any_sync(item, HYPRE_WARP_FULL_MASK, grid_group_id < num_rows); + grid_group_id += grid_ngroups) { -#if 0 - HYPRE_Int p = 0, q = 0; - if (grid_group_id < n && group_lane < 2) + HYPRE_Int grid_row_id = -1, p = 0, q = 0; + + if (row_id) { - p = read_only_load(&d_ia[grid_group_id+group_lane]); + if (grid_group_id < num_rows && group_lane == 0) + { + grid_row_id = read_only_load(&row_id[grid_group_id]); + } + grid_row_id = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, grid_row_id, 0, K); } - q = __shfl_sync(HYPRE_WARP_FULL_MASK, p, 1, K); - p = __shfl_sync(HYPRE_WARP_FULL_MASK, p, 0, K); -#else - const HYPRE_Int s = grid_group_id - warp_group_id + warp_lane; - HYPRE_Int p = 0, q = 0; - if (s <= n && warp_lane <= warp_ngroups) + else { - p = read_only_load(&d_ia[s]); + grid_row_id = grid_group_id; } - q = __shfl_sync(HYPRE_WARP_FULL_MASK, p, warp_group_id+1); - p = __shfl_sync(HYPRE_WARP_FULL_MASK, p, warp_group_id); -#endif - T sum = 0.0; -#if VERSION == 1 + + if (grid_group_id < num_rows && group_lane < 2) + { + p = read_only_load(&d_ia[grid_row_id + group_lane]); + } + q = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 1, K); + p = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 0, K); + + for (HYPRE_Int i = 0; i < num_vectors; i++) + { + sum[i] = T(0.0); + } + #pragma unroll 1 - for (p += group_lane; __any_sync(HYPRE_WARP_FULL_MASK, p < q); p += K * 2) + for (p += group_lane; p < q; p += K * 2) { - if (p < q) + HYPRE_SPMV_ADD_SUM(p, num_vectors) + if (p + K < q) + { + HYPRE_SPMV_ADD_SUM((p + K), num_vectors) + } + } + + // parallel reduction + for (HYPRE_Int i = 0; i < num_vectors; i++) + { + for (HYPRE_Int d = K / 2; d > 0; d >>= 1) + { + sum[i] += warp_shuffle_down_sync(item, HYPRE_WARP_FULL_MASK, sum[i], d); + } + } + + if (grid_group_id < num_rows && group_lane == 0) + { + if (beta) + { + for (HYPRE_Int i = 0; i < num_vectors; i++) + { + d_y[grid_row_id * idxstride_y + i * vecstride_y] = + alpha * sum[i] + + beta * d_y[grid_row_id * idxstride_y + i * vecstride_y]; + } + } + else { - SPMV_ADD_SUM(p) - if (p + K < q) + for (HYPRE_Int i = 0; i < num_vectors; i++) { - SPMV_ADD_SUM((p + K)) + d_y[grid_row_id * idxstride_y + i * vecstride_y] = alpha * sum[i]; } } } -#elif VERSION == 2 + } +} + +/*-------------------------------------------------------------------------- + * hypreGPUKernel_CSRMatvecShuffle + * + * Templated SpMV device kernel based of warp-shuffle reduction. + * Uses groups of K threads per row + * + * Template parameters: + * 1) K: number of threads working on a single row. K = 2, 4, 8, 16, 32 + * 2) F: fill-mode. See hypreDevice_CSRMatrixMatvec for supported values + * 3) NV: number of vectors (> 1 for multi-component vectors) + * 4) T: data type of matrix/vector coefficients + *--------------------------------------------------------------------------*/ + +template +__global__ void +//__launch_bounds__(512, 1) +hypreGPUKernel_CSRMatvecShuffle(hypre_DeviceItem &item, + HYPRE_Int num_rows, + HYPRE_Int num_vectors, + HYPRE_Int *row_id, + HYPRE_Int idxstride_x, + HYPRE_Int idxstride_y, + HYPRE_Int vecstride_x, + HYPRE_Int vecstride_y, + T alpha, + HYPRE_Int *d_ia, + HYPRE_Int *d_ja, + T *d_a, + T *d_x, + T beta, + T *d_y ) +{ +#if defined(HYPRE_USING_SYCL) + HYPRE_Int grid_ngroups = item.get_group_range(2) * (HYPRE_SPMV_BLOCKDIM / K); + HYPRE_Int grid_group_id = (item.get_group(2) * HYPRE_SPMV_BLOCKDIM + item.get_local_id(2)) / K; + HYPRE_Int group_lane = item.get_local_id(2) & (K - 1); +#else + const HYPRE_Int grid_ngroups = gridDim.x * (HYPRE_SPMV_BLOCKDIM / K); + HYPRE_Int grid_group_id = (blockIdx.x * HYPRE_SPMV_BLOCKDIM + threadIdx.x) / K; + const HYPRE_Int group_lane = threadIdx.x & (K - 1); +#endif + + for (; warp_any_sync(item, HYPRE_WARP_FULL_MASK, grid_group_id < num_rows); + grid_group_id += grid_ngroups) + { + HYPRE_Int grid_row_id = -1, p = 0, q = 0; + + if (row_id) + { + if (grid_group_id < num_rows && group_lane == 0) + { + grid_row_id = read_only_load(&row_id[grid_group_id]); + } + grid_row_id = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, grid_row_id, 0, K); + } + else + { + grid_row_id = grid_group_id; + } + + if (grid_group_id < num_rows && group_lane < 2) + { + p = read_only_load(&d_ia[grid_row_id + group_lane]); + } + q = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 1, K); + p = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, p, 0, K); + + T sum[NV] = {T(0)}; +#if HYPRE_SPMV_VERSION == 1 #pragma unroll 1 - for (p += group_lane; __any_sync(HYPRE_WARP_FULL_MASK, p < q); p += K) + for (p += group_lane; p < q; p += K * 2) + { + HYPRE_SPMV_ADD_SUM(p, NV) + if (p + K < q) + { + HYPRE_SPMV_ADD_SUM((p + K), NV) + } + } +#elif HYPRE_SPMV_VERSION == 2 +#pragma unroll 1 + for (p += group_lane; warp_any_sync(item, HYPRE_WARP_FULL_MASK, p < q); p += K) { if (p < q) { - SPMV_ADD_SUM(p) + HYPRE_SPMV_ADD_SUM(p, NV) } } #else #pragma unroll 1 for (p += group_lane; p < q; p += K) { - SPMV_ADD_SUM(p) + HYPRE_SPMV_ADD_SUM(p, NV) } #endif + // parallel reduction -#pragma unroll - for (HYPRE_Int d = K/2; d > 0; d >>= 1) + for (HYPRE_Int i = 0; i < NV; i++) { - sum += __shfl_down_sync(HYPRE_WARP_FULL_MASK, sum, d); + for (HYPRE_Int d = K / 2; d > 0; d >>= 1) + { + sum[i] += warp_shuffle_down_sync(item, HYPRE_WARP_FULL_MASK, sum[i], d); + } } - if (grid_group_id < n && group_lane == 0) + + if (grid_group_id < num_rows && group_lane == 0) { - d_y[grid_group_id] = alpha * sum + beta * d_y[grid_group_id]; + if (beta) + { + for (HYPRE_Int i = 0; i < NV; i++) + { + d_y[grid_row_id * idxstride_y + i * vecstride_y] = + alpha * sum[i] + + beta * d_y[grid_row_id * idxstride_y + i * vecstride_y]; + } + } + else + { + for (HYPRE_Int i = 0; i < NV; i++) + { + d_y[grid_row_id * idxstride_y + i * vecstride_y] = alpha * sum[i]; + } + } } } } -/* F is fill-mode +/*-------------------------------------------------------------------------- + * hypreDevice_CSRMatrixMatvec + * + * Templated host function for launching the device kernels for SpMV. + * + * The template parameter F is the fill-mode. Supported values: * 0: whole matrix * -1: lower * 1: upper * -2: strict lower * 2: strict upper - */ -template + * The template parameter T is the matrix/vector coefficient data type + *--------------------------------------------------------------------------*/ + +template HYPRE_Int -hypreDevice_CSRMatrixMatvec( HYPRE_Int nrows, - HYPRE_Int nnz, - HYPRE_Complex alpha, - HYPRE_Int *d_ia, - HYPRE_Int *d_ja, - HYPRE_Complex *d_a, - HYPRE_Complex *d_x, - HYPRE_Complex beta, - HYPRE_Complex *d_y ) +hypreDevice_CSRMatrixMatvec( HYPRE_Int num_vectors, + HYPRE_Int num_rows, + HYPRE_Int *rowid, + HYPRE_Int num_nonzeros, + HYPRE_Int idxstride_x, + HYPRE_Int idxstride_y, + HYPRE_Int vecstride_x, + HYPRE_Int vecstride_y, + T alpha, + HYPRE_Int *d_ia, + HYPRE_Int *d_ja, + T *d_a, + T *d_x, + T beta, + T *d_y ) { - const HYPRE_Int rownnz = (nnz + nrows - 1) / nrows; - const dim3 bDim(SPMV_BLOCKDIM); - - if (rownnz >= 64) - { - const HYPRE_Int group_size = 32; - const HYPRE_Int num_groups_per_block = SPMV_BLOCKDIM / group_size; - const dim3 gDim((nrows + num_groups_per_block - 1) / num_groups_per_block); - HYPRE_CUDA_LAUNCH( (hypre_csr_v_k_shuffle), gDim, bDim, - nrows, alpha, d_ia, d_ja, d_a, d_x, beta, d_y ); - } - else if (rownnz >= 32) - { - const HYPRE_Int group_size = 16; - const HYPRE_Int num_groups_per_block = SPMV_BLOCKDIM / group_size; - const dim3 gDim((nrows + num_groups_per_block - 1) / num_groups_per_block); - HYPRE_CUDA_LAUNCH( (hypre_csr_v_k_shuffle), gDim, bDim, - nrows, alpha, d_ia, d_ja, d_a, d_x, beta, d_y ); - } - else if (rownnz >= 16) + if (num_vectors > 64) { - const HYPRE_Int group_size = 8; - const HYPRE_Int num_groups_per_block = SPMV_BLOCKDIM / group_size; - const dim3 gDim((nrows + num_groups_per_block - 1) / num_groups_per_block); - HYPRE_CUDA_LAUNCH( (hypre_csr_v_k_shuffle), gDim, bDim, - nrows, alpha, d_ia, d_ja, d_a, d_x, beta, d_y ); - } - else if (rownnz >= 8) - { - const HYPRE_Int group_size = 4; - const HYPRE_Int num_groups_per_block = SPMV_BLOCKDIM / group_size; - const dim3 gDim((nrows + num_groups_per_block - 1) / num_groups_per_block); - HYPRE_CUDA_LAUNCH( (hypre_csr_v_k_shuffle), gDim, bDim, - nrows, alpha, d_ia, d_ja, d_a, d_x, beta, d_y ); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "hypre's SpMV: (num_vectors > 64) not implemented"); + return hypre_error_flag; } - else + + const HYPRE_Int avg_rownnz = (num_nonzeros + num_rows - 1) / num_rows; + + static constexpr HYPRE_Int group_sizes[5] = {32, 16, 8, 4, 4}; + + static constexpr HYPRE_Int unroll_depth[9] = {0, 1, 2, 3, 4, 5, 6, 7, 8}; + + static HYPRE_Int avg_rownnz_lower_bounds[5] = {64, 32, 16, 8, 0}; + + static HYPRE_Int num_groups_per_block[5] = { HYPRE_SPMV_BLOCKDIM / group_sizes[0], + HYPRE_SPMV_BLOCKDIM / group_sizes[1], + HYPRE_SPMV_BLOCKDIM / group_sizes[2], + HYPRE_SPMV_BLOCKDIM / group_sizes[3], + HYPRE_SPMV_BLOCKDIM / group_sizes[4] + }; + + const dim3 bDim = hypre_dim3(HYPRE_SPMV_BLOCKDIM); + + /* Select execution path */ + switch (num_vectors) { - const HYPRE_Int group_size = 4; - const HYPRE_Int num_groups_per_block = SPMV_BLOCKDIM / group_size; - const dim3 gDim((nrows + num_groups_per_block - 1) / num_groups_per_block); - HYPRE_CUDA_LAUNCH( (hypre_csr_v_k_shuffle), gDim, bDim, - nrows, alpha, d_ia, d_ja, d_a, d_x, beta, d_y ); + case unroll_depth[1]: + HYPRE_SPMV_GPU_LAUNCH(hypreGPUKernel_CSRMatvecShuffle, unroll_depth[1]); + break; + + case unroll_depth[2]: + HYPRE_SPMV_GPU_LAUNCH(hypreGPUKernel_CSRMatvecShuffle, unroll_depth[2]); + break; + + case unroll_depth[3]: + HYPRE_SPMV_GPU_LAUNCH(hypreGPUKernel_CSRMatvecShuffle, unroll_depth[3]); + break; + + case unroll_depth[4]: + HYPRE_SPMV_GPU_LAUNCH(hypreGPUKernel_CSRMatvecShuffle, unroll_depth[4]); + break; + + case unroll_depth[5]: + HYPRE_SPMV_GPU_LAUNCH(hypreGPUKernel_CSRMatvecShuffle, unroll_depth[5]); + break; + + case unroll_depth[6]: + HYPRE_SPMV_GPU_LAUNCH(hypreGPUKernel_CSRMatvecShuffle, unroll_depth[6]); + break; + + case unroll_depth[7]: + HYPRE_SPMV_GPU_LAUNCH(hypreGPUKernel_CSRMatvecShuffle, unroll_depth[7]); + break; + + case unroll_depth[8]: + HYPRE_SPMV_GPU_LAUNCH(hypreGPUKernel_CSRMatvecShuffle, unroll_depth[8]); + break; + + default: + HYPRE_SPMV_GPU_LAUNCH(hypreGPUKernel_CSRMatvecShuffleGT8, unroll_depth[8]); + break; } return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixSpMVDevice + * + * hypre's internal implementation of sparse matrix/vector multiplication + * (SpMV) on GPUs. + * + * Computes: y = alpha*op(B)*x + beta*y + * + * Supported cases: + * 1) rownnz_B != NULL: y(rownnz_B) = alpha*op(B)*x + beta*y(rownnz_B) + * + * 2) op(B) = B (trans = 0) or B^T (trans = 1) + * op(B) = B^T: not recommended since it computes B^T at every call + * + * 3) multi-component vectors up to 64 components (1 <= num_vectors <= 64) + * + * Notes: + * 1) if B has no numerical values, assume the values are all ones + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_CSRMatrixSpMVDevice( HYPRE_Complex alpha, - hypre_CSRMatrix *A, +hypre_CSRMatrixSpMVDevice( HYPRE_Int trans, + HYPRE_Complex alpha, + hypre_CSRMatrix *B, hypre_Vector *x, HYPRE_Complex beta, hypre_Vector *y, HYPRE_Int fill ) { - HYPRE_Int nrows = hypre_CSRMatrixNumRows(A); - HYPRE_Int nnz = hypre_CSRMatrixNumNonzeros(A); - HYPRE_Int *d_ia = hypre_CSRMatrixI(A); - HYPRE_Int *d_ja = hypre_CSRMatrixJ(A); - HYPRE_Complex *d_a = hypre_CSRMatrixData(A); - HYPRE_Complex *d_x = hypre_VectorData(x); - HYPRE_Complex *d_y = hypre_VectorData(y); - - if (nnz <= 0 || alpha == 0.0) - { - hypre_SeqVectorScale(beta, y); + /* Input data variables */ + HYPRE_Int num_rows = trans ? hypre_CSRMatrixNumCols(B) : hypre_CSRMatrixNumRows(B); + HYPRE_Int num_nonzeros = hypre_CSRMatrixNumNonzeros(B); + HYPRE_Int num_vectors_x = hypre_VectorNumVectors(x); + HYPRE_Int num_vectors_y = hypre_VectorNumVectors(y); + HYPRE_Complex *d_x = hypre_VectorData(x); + HYPRE_Complex *d_y = hypre_VectorData(y); + HYPRE_Int idxstride_x = hypre_VectorIndexStride(x); + HYPRE_Int vecstride_x = hypre_VectorVectorStride(x); + HYPRE_Int idxstride_y = hypre_VectorIndexStride(y); + HYPRE_Int vecstride_y = hypre_VectorVectorStride(y); + /* Matrix A variables */ + hypre_CSRMatrix *A = NULL; + HYPRE_Int *d_ia; + HYPRE_Int *d_ja; + HYPRE_Complex *d_a; + HYPRE_Int *d_rownnz_A = NULL; + + /* Sanity checks */ + if (num_vectors_x != num_vectors_y) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "num_vectors_x != num_vectors_y"); return hypre_error_flag; } + hypre_assert(num_rows > 0); - hypre_assert(nrows > 0); + /* Trivial case when alpha * op(B) * x = 0 */ + if (num_nonzeros <= 0 || alpha == 0.0) + { + hypre_SeqVectorScale(beta, y); + return hypre_error_flag; + } - if (fill == 0) + /* Select op(B) */ + if (trans) { - return hypreDevice_CSRMatrixMatvec<0>(nrows, nnz, alpha, d_ia, d_ja, d_a, d_x, beta, d_y); + hypre_CSRMatrixTransposeDevice(B, &A, hypre_CSRMatrixData(B) != NULL); } - else if (fill == 1) + else { - return hypreDevice_CSRMatrixMatvec<1>(nrows, nnz, alpha, d_ia, d_ja, d_a, d_x, beta, d_y); + A = B; } - else if (fill == -1) + + /* Get matrix A info */ + d_ia = hypre_CSRMatrixI(A); + d_ja = hypre_CSRMatrixJ(A); + d_a = hypre_CSRMatrixData(A); + + if (hypre_CSRMatrixRownnz(A)) { - return hypreDevice_CSRMatrixMatvec<-1>(nrows, nnz, alpha, d_ia, d_ja, d_a, d_x, beta, d_y); + num_rows = hypre_CSRMatrixNumRownnz(A); + d_rownnz_A = hypre_CSRMatrixRownnz(A); + + hypre_SeqVectorScale(beta, y); + beta = beta ? 1.0 : 0.0; } - else if (fill == 2) + + /* Choose matrix fill mode */ + switch (fill) { - return hypreDevice_CSRMatrixMatvec<2>(nrows, nnz, alpha, d_ia, d_ja, d_a, d_x, beta, d_y); + case HYPRE_SPMV_FILL_STRICT_LOWER: + /* Strict lower matrix */ + hypreDevice_CSRMatrixMatvec(num_vectors_x, + num_rows, + d_rownnz_A, + num_nonzeros, + idxstride_x, + idxstride_y, + vecstride_x, + vecstride_y, + alpha, + d_ia, + d_ja, + d_a, + d_x, + beta, + d_y); + break; + + case HYPRE_SPMV_FILL_LOWER: + /* Lower matrix */ + hypreDevice_CSRMatrixMatvec(num_vectors_x, + num_rows, + d_rownnz_A, + num_nonzeros, + idxstride_x, + idxstride_y, + vecstride_x, + vecstride_y, + alpha, + d_ia, + d_ja, + d_a, + d_x, + beta, + d_y); + break; + + case HYPRE_SPMV_FILL_WHOLE: + /* Full matrix */ + hypreDevice_CSRMatrixMatvec(num_vectors_x, + num_rows, + d_rownnz_A, + num_nonzeros, + idxstride_x, + idxstride_y, + vecstride_x, + vecstride_y, + alpha, + d_ia, + d_ja, + d_a, + d_x, + beta, + d_y); + break; + + case HYPRE_SPMV_FILL_UPPER: + /* Upper matrix */ + hypreDevice_CSRMatrixMatvec(num_vectors_x, + num_rows, + d_rownnz_A, + num_nonzeros, + idxstride_x, + idxstride_y, + vecstride_x, + vecstride_y, + alpha, + d_ia, + d_ja, + d_a, + d_x, + beta, + d_y); + break; + + case HYPRE_SPMV_FILL_STRICT_UPPER: + /* Strict upper matrix */ + hypreDevice_CSRMatrixMatvec(num_vectors_x, + num_rows, + d_rownnz_A, + num_nonzeros, + idxstride_x, + idxstride_y, + vecstride_x, + vecstride_y, + alpha, + d_ia, + d_ja, + d_a, + d_x, + beta, + d_y); + break; + + default: + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Fill mode for SpMV unavailable!"); + return hypre_error_flag; } - else if (fill == -2) + + /* Free memory */ + if (trans) { - return hypreDevice_CSRMatrixMatvec<-2>(nrows, nnz, alpha, d_ia, d_ja, d_a, d_x, beta, d_y); + hypre_CSRMatrixDestroy(A); } return hypre_error_flag; } -#endif /*#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) */ +/*-------------------------------------------------------------------------- + * hypre_CSRMatrixIntSpMVDevice + * + * Sparse matrix/vector multiplication with integer data on GPUs + * + * Note: This function does not support multi-component vectors + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixIntSpMVDevice( HYPRE_Int num_rows, + HYPRE_Int num_nonzeros, + HYPRE_Int alpha, + HYPRE_Int *d_ia, + HYPRE_Int *d_ja, + HYPRE_Int *d_a, + HYPRE_Int *d_x, + HYPRE_Int beta, + HYPRE_Int *d_y ) +{ + /* Additional input variables */ + HYPRE_Int num_vectors = 1; + HYPRE_Int idxstride_x = 1; + HYPRE_Int vecstride_x = 1; + HYPRE_Int idxstride_y = 1; + HYPRE_Int vecstride_y = 1; + HYPRE_Int *d_rownnz = NULL; + + hypreDevice_CSRMatrixMatvec(num_vectors, + num_rows, + d_rownnz, + num_nonzeros, + idxstride_x, + idxstride_y, + vecstride_x, + vecstride_y, + alpha, + d_ia, + d_ja, + d_a, + d_x, + beta, + d_y); + + return hypre_error_flag; +} +#endif /* #if defined(HYPRE_USING_GPU) */ diff --git a/external/hypre/src/seq_mv/csr_spmv_device.h b/external/hypre/src/seq_mv/csr_spmv_device.h new file mode 100644 index 00000000..85f7337b --- /dev/null +++ b/external/hypre/src/seq_mv/csr_spmv_device.h @@ -0,0 +1,123 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#ifndef hypre_CSR_SPMV_DEVICE_H +#define hypre_CSR_SPMV_DEVICE_H + +#define HYPRE_SPMV_BLOCKDIM 512 +#define HYPRE_SPMV_VERSION 1 +#define HYPRE_SPMV_FILL_STRICT_LOWER -2 +#define HYPRE_SPMV_FILL_LOWER -1 +#define HYPRE_SPMV_FILL_WHOLE 0 +#define HYPRE_SPMV_FILL_UPPER 1 +#define HYPRE_SPMV_FILL_STRICT_UPPER 2 + +#define HYPRE_SPMV_ADD_SUM(p, nv) \ +{ \ + const HYPRE_Int col = read_only_load(&d_ja[p]); \ + if (F == HYPRE_SPMV_FILL_WHOLE) \ + { \ + const T val = d_a ? read_only_load(&d_a[p]) : T(1); \ + for (HYPRE_Int i = 0; i < nv; i++) \ + { \ + sum[i] += val * read_only_load(&d_x[col * idxstride_x + i * vecstride_x]); \ + } \ + } \ + else if (F == HYPRE_SPMV_FILL_LOWER) \ + { \ + if (col <= grid_group_id) \ + { \ + const T val = d_a ? read_only_load(&d_a[p]) : T(1); \ + for (HYPRE_Int i = 0; i < nv; i++) \ + { \ + sum[i] += val * read_only_load(&d_x[col * idxstride_x + i * vecstride_x]); \ + } \ + } \ + } \ + else if (F == HYPRE_SPMV_FILL_UPPER) \ + { \ + if (col >= grid_group_id) \ + { \ + const T val = d_a ? read_only_load(&d_a[p]) : T(1); \ + for (HYPRE_Int i = 0; i < nv; i++) \ + { \ + sum[i] += val * read_only_load(&d_x[col * idxstride_x + i * vecstride_x]); \ + } \ + } \ + } \ + else if (F == HYPRE_SPMV_FILL_STRICT_LOWER) \ + { \ + if (col < grid_group_id) \ + { \ + const T val = d_a ? read_only_load(&d_a[p]) : T(1); \ + for (HYPRE_Int i = 0; i < nv; i++) \ + { \ + sum[i] += val * read_only_load(&d_x[col * idxstride_x + i * vecstride_x]); \ + } \ + } \ + } \ + else if (F == HYPRE_SPMV_FILL_STRICT_UPPER) \ + { \ + if (col > grid_group_id) \ + { \ + const T val = d_a ? read_only_load(&d_a[p]) : T(1); \ + for (HYPRE_Int i = 0; i < nv; i++) \ + { \ + sum[i] += val * read_only_load(&d_x[col * idxstride_x + i * vecstride_x]); \ + } \ + } \ + } \ +} + +#define HYPRE_SPMV_GPU_LAUNCH(kernel, nv) \ + if (avg_rownnz >= avg_rownnz_lower_bounds[0]) \ + { \ + const dim3 gDim = \ + hypre_dim3((num_rows + num_groups_per_block[0] - 1) / num_groups_per_block[0]); \ + HYPRE_GPU_LAUNCH( (kernel), \ + gDim, bDim, num_rows, num_vectors, rowid, idxstride_x, \ + idxstride_y, vecstride_x, vecstride_y, alpha, \ + d_ia, d_ja, d_a, d_x, beta, d_y ); \ + } \ + else if (avg_rownnz >= avg_rownnz_lower_bounds[1]) \ + { \ + const dim3 gDim = \ + hypre_dim3((num_rows + num_groups_per_block[1] - 1) / num_groups_per_block[1]); \ + HYPRE_GPU_LAUNCH( (kernel), \ + gDim, bDim, num_rows, num_vectors, rowid, idxstride_x, \ + idxstride_y, vecstride_x, vecstride_y, alpha, \ + d_ia, d_ja, d_a, d_x, beta, d_y ); \ + } \ + else if (avg_rownnz >= avg_rownnz_lower_bounds[2]) \ + { \ + const dim3 gDim = \ + hypre_dim3((num_rows + num_groups_per_block[2] - 1) / num_groups_per_block[2]); \ + HYPRE_GPU_LAUNCH( (kernel), \ + gDim, bDim, num_rows, num_vectors, rowid, idxstride_x, \ + idxstride_y, vecstride_x, vecstride_y, alpha, \ + d_ia, d_ja, d_a, d_x, beta, d_y ); \ + } \ + else if (avg_rownnz >= avg_rownnz_lower_bounds[3]) \ + { \ + const dim3 gDim = \ + hypre_dim3((num_rows + num_groups_per_block[3] - 1) / num_groups_per_block[3]); \ + HYPRE_GPU_LAUNCH( (kernel), \ + gDim, bDim, num_rows, num_vectors, rowid, idxstride_x, \ + idxstride_y, vecstride_x, vecstride_y, alpha, \ + d_ia, d_ja, d_a, d_x, beta, d_y ); \ + } \ + else \ + { \ + const dim3 gDim = \ + hypre_dim3((num_rows + num_groups_per_block[4] - 1) / num_groups_per_block[4]); \ + HYPRE_GPU_LAUNCH( (kernel), \ + gDim, bDim, num_rows, num_vectors, rowid, idxstride_x, \ + idxstride_y, vecstride_x, vecstride_y, alpha, \ + d_ia, d_ja, d_a, d_x, beta, d_y ); \ + } + +#endif diff --git a/external/hypre/src/seq_mv/csr_sptrans_device.c b/external/hypre/src/seq_mv/csr_sptrans_device.c index d41d38af..b7285ad4 100644 --- a/external/hypre/src/seq_mv/csr_sptrans_device.c +++ b/external/hypre/src/seq_mv/csr_sptrans_device.c @@ -1,10 +1,11 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ +#include "_hypre_onedpl.hpp" #include "seq_mv.h" #include "_hypre_utilities.hpp" @@ -63,20 +64,19 @@ hypreDevice_CSRSpTransCusparse(HYPRE_Int m, HYPRE_Int n, HYPRE hypre_TFree(dBuffer, HYPRE_MEMORY_DEVICE); #else - HYPRE_CUSPARSE_CALL( cusparseDcsr2csc(handle, - m, n, nnzA, - d_aa, d_ia, d_ja, - csc_a, csc_j, csc_i, - action, - CUSPARSE_INDEX_BASE_ZERO) ); -#endif + HYPRE_CUSPARSE_CALL( hypre_cusparse_csr2csc(handle, + m, n, nnzA, + d_aa, d_ia, d_ja, + csc_a, csc_j, csc_i, + action, + CUSPARSE_INDEX_BASE_ZERO) ); +#endif /* #if CUSPARSE_VERSION >= CUSPARSE_NEWAPI_VERSION */ *d_ic_out = csc_i; *d_jc_out = csc_j; *d_ac_out = csc_a; #ifdef HYPRE_PROFILE - cudaThreadSynchronize(); hypre_profile_times[HYPRE_TIMER_ID_SPTRANS] += hypre_MPI_Wtime(); #endif @@ -123,13 +123,14 @@ hypreDevice_CSRSpTransRocsparse(HYPRE_Int m, HYPRE_Int n, HYPR void * buffer; buffer = hypre_TAlloc(char, buffer_size, HYPRE_MEMORY_DEVICE); - HYPRE_ROCSPARSE_CALL( rocsparse_dcsr2csc(handle, - m, n, nnzA, - d_aa, d_ia, d_ja, - csc_a, csc_j, csc_i, - action, - rocsparse_index_base_zero, - buffer) ); + HYPRE_ROCSPARSE_CALL( hypre_rocsparse_csr2csc(handle, + m, n, nnzA, + d_aa, d_ia, d_ja, + csc_a, csc_j, csc_i, + action, + rocsparse_index_base_zero, + buffer) ); + hypre_TFree(buffer, HYPRE_MEMORY_DEVICE); *d_ic_out = csc_i; @@ -137,7 +138,7 @@ hypreDevice_CSRSpTransRocsparse(HYPRE_Int m, HYPRE_Int n, HYPR *d_ac_out = csc_a; #ifdef HYPRE_PROFILE - hypre_SyncCudaDevice(hypre_handle()) + hypre_SyncDevice(); hypre_profile_times[HYPRE_TIMER_ID_SPTRANS] += hypre_MPI_Wtime(); #endif @@ -146,7 +147,6 @@ hypreDevice_CSRSpTransRocsparse(HYPRE_Int m, HYPRE_Int n, HYPR #endif // #if defined(HYPRE_USING_ROCSPARSE) - #if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) HYPRE_Int @@ -161,7 +161,7 @@ hypreDevice_CSRSpTrans(HYPRE_Int m, HYPRE_Int n, HYPRE_Int HYPRE_Int *d_jt, *d_it, *d_pm, *d_ic, *d_jc; HYPRE_Complex *d_ac = NULL; - HYPRE_Int *mem_work = hypre_TAlloc(HYPRE_Int, 3*nnzA, HYPRE_MEMORY_DEVICE); + HYPRE_Int *mem_work = hypre_TAlloc(HYPRE_Int, 3 * nnzA, HYPRE_MEMORY_DEVICE); /* allocate C */ d_jc = hypre_TAlloc(HYPRE_Int, nnzA, HYPRE_MEMORY_DEVICE); @@ -214,7 +214,6 @@ hypreDevice_CSRSpTrans(HYPRE_Int m, HYPRE_Int n, HYPRE_Int *d_ac_out = d_ac; #ifdef HYPRE_PROFILE - cudaThreadSynchronize(); hypre_profile_times[HYPRE_TIMER_ID_SPTRANS] += hypre_MPI_Wtime(); #endif @@ -222,3 +221,87 @@ hypreDevice_CSRSpTrans(HYPRE_Int m, HYPRE_Int n, HYPRE_Int } #endif /* HYPRE_USING_CUDA || defined(HYPRE_USING_HIP) */ + +#if defined(HYPRE_USING_SYCL) +HYPRE_Int +hypreDevice_CSRSpTrans(HYPRE_Int m, HYPRE_Int n, HYPRE_Int nnzA, + HYPRE_Int *d_ia, HYPRE_Int *d_ja, HYPRE_Complex *d_aa, + HYPRE_Int **d_ic_out, HYPRE_Int **d_jc_out, HYPRE_Complex **d_ac_out, + HYPRE_Int want_data) +{ +#ifdef HYPRE_PROFILE + hypre_profile_times[HYPRE_TIMER_ID_SPTRANS] -= hypre_MPI_Wtime(); +#endif + + HYPRE_Int *d_jt, *d_it, *d_pm, *d_ic, *d_jc; + HYPRE_Complex *d_ac = NULL; + HYPRE_Int *mem_work = hypre_TAlloc(HYPRE_Int, 3 * nnzA, HYPRE_MEMORY_DEVICE); + + /* allocate C */ + d_jc = hypre_TAlloc(HYPRE_Int, nnzA, HYPRE_MEMORY_DEVICE); + if (want_data) + { + d_ac = hypre_TAlloc(HYPRE_Complex, nnzA, HYPRE_MEMORY_DEVICE); + } + + /* permutation vector */ + d_pm = mem_work; + + /* expansion: A's row idx */ + d_it = d_pm + nnzA; + hypreDevice_CsrRowPtrsToIndices_v2(m, nnzA, d_ia, d_it); + + /* a copy of col idx of A */ + d_jt = d_it + nnzA; + hypre_TMemcpy(d_jt, d_ja, HYPRE_Int, nnzA, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + + /* sort: by col */ + oneapi::dpl::counting_iterator count(0); + HYPRE_ONEDPL_CALL( std::copy, + count, + count + nnzA, + d_pm); + + auto zip_jt_pm = oneapi::dpl::make_zip_iterator(d_jt, d_pm); + HYPRE_ONEDPL_CALL( std::stable_sort, + zip_jt_pm, + zip_jt_pm + nnzA, + [](auto lhs, auto rhs) { return std::get<0>(lhs) < std::get<0>(rhs); } ); + + auto permuted_it = oneapi::dpl::make_permutation_iterator(d_it, d_pm); + HYPRE_ONEDPL_CALL( std::copy, + permuted_it, + permuted_it + nnzA, + d_jc ); + + if (want_data) + { + auto permuted_aa = oneapi::dpl::make_permutation_iterator(d_aa, d_pm); + HYPRE_ONEDPL_CALL( std::copy, + permuted_aa, + permuted_aa + nnzA, + d_ac ); + } + + /* convert into ic: row idx --> row ptrs */ + d_ic = hypreDevice_CsrRowIndicesToPtrs(n, nnzA, d_jt); + +#ifdef HYPRE_DEBUG + HYPRE_Int nnzC; + hypre_TMemcpy(&nnzC, &d_ic[n], HYPRE_Int, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); + hypre_assert(nnzC == nnzA); +#endif + + hypre_TFree(mem_work, HYPRE_MEMORY_DEVICE); + + *d_ic_out = d_ic; + *d_jc_out = d_jc; + *d_ac_out = d_ac; + +#ifdef HYPRE_PROFILE + hypre_profile_times[HYPRE_TIMER_ID_SPTRANS] += hypre_MPI_Wtime(); +#endif + + return hypre_error_flag; +} +#endif // #if defined(HYPRE_USING_SYCL) diff --git a/external/hypre/src/seq_mv/genpart.c b/external/hypre/src/seq_mv/genpart.c index aa84c893..ba256be4 100644 --- a/external/hypre/src/seq_mv/genpart.c +++ b/external/hypre/src/seq_mv/genpart.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -22,14 +22,14 @@ hypre_GeneratePartitioning(HYPRE_BigInt length, HYPRE_Int num_procs, HYPRE_BigIn HYPRE_Int size, rest; HYPRE_Int i; - part = hypre_CTAlloc(HYPRE_BigInt, num_procs+1, HYPRE_MEMORY_HOST); + part = hypre_CTAlloc(HYPRE_BigInt, num_procs + 1, HYPRE_MEMORY_HOST); size = (HYPRE_Int)(length / (HYPRE_BigInt)num_procs); - rest = (HYPRE_Int)(length - (HYPRE_BigInt)(size*num_procs)); + rest = (HYPRE_Int)(length - (HYPRE_BigInt)(size * num_procs)); part[0] = 0; - for (i=0; i < num_procs; i++) + for (i = 0; i < num_procs; i++) { - part[i+1] = part[i]+(HYPRE_BigInt)size; - if (i < rest) part[i+1]++; + part[i + 1] = part[i] + (HYPRE_BigInt)size; + if (i < rest) { part[i + 1]++; } } *part_ptr = part; @@ -54,15 +54,15 @@ hypre_GenerateLocalPartitioning(HYPRE_BigInt length, HYPRE_Int size, rest; size = (HYPRE_Int)(length / (HYPRE_BigInt)num_procs); - rest = (HYPRE_Int)(length - (HYPRE_BigInt)(size*num_procs)); + rest = (HYPRE_Int)(length - (HYPRE_BigInt)(size * num_procs)); /* first row I own */ - part[0] = (HYPRE_BigInt)(size*myid); + part[0] = (HYPRE_BigInt)(size * myid); part[0] += (HYPRE_BigInt)(hypre_min(myid, rest)); /* last row I own */ - part[1] = (HYPRE_BigInt)(size*(myid+1)); - part[1] += (HYPRE_BigInt)(hypre_min(myid+1, rest)); + part[1] = (HYPRE_BigInt)(size * (myid + 1)); + part[1] += (HYPRE_BigInt)(hypre_min(myid + 1, rest)); part[1] = part[1] - 1; /* add 1 to last row since this is for "starts" vector */ diff --git a/external/hypre/src/seq_mv/headers b/external/hypre/src/seq_mv/headers old mode 100644 new mode 100755 index 7ed292ff..81f32d15 --- a/external/hypre/src/seq_mv/headers +++ b/external/hypre/src/seq_mv/headers @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/seq_mv/mapped_matrix.c b/external/hypre/src/seq_mv/mapped_matrix.c index a0b9643d..0895371e 100644 --- a/external/hypre/src/seq_mv/mapped_matrix.c +++ b/external/hypre/src/seq_mv/mapped_matrix.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -18,7 +18,7 @@ *--------------------------------------------------------------------------*/ hypre_MappedMatrix * -hypre_MappedMatrixCreate( ) +hypre_MappedMatrixCreate( void ) { hypre_MappedMatrix *matrix; @@ -32,10 +32,10 @@ hypre_MappedMatrixCreate( ) * hypre_MappedMatrixDestroy *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int hypre_MappedMatrixDestroy( hypre_MappedMatrix *matrix ) { - HYPRE_Int ierr=0; + HYPRE_Int ierr = 0; if (matrix) { @@ -53,10 +53,10 @@ hypre_MappedMatrixDestroy( hypre_MappedMatrix *matrix ) * hypre_MappedMatrixLimitedDestroy *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int hypre_MappedMatrixLimitedDestroy( hypre_MappedMatrix *matrix ) { - HYPRE_Int ierr=0; + HYPRE_Int ierr = 0; if (matrix) { @@ -66,42 +66,50 @@ hypre_MappedMatrixLimitedDestroy( hypre_MappedMatrix *matrix ) return ierr; } - /*-------------------------------------------------------------------------- * hypre_MappedMatrixInitialize *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int hypre_MappedMatrixInitialize( hypre_MappedMatrix *matrix ) { - HYPRE_Int ierr=0; + HYPRE_Int ierr = 0; + + HYPRE_UNUSED_VAR(matrix); return ierr; } - /*-------------------------------------------------------------------------- * hypre_MappedMatrixAssemble *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int hypre_MappedMatrixAssemble( hypre_MappedMatrix *matrix ) { - HYPRE_Int ierr=0; + HYPRE_Int ierr = 0; - if( matrix == NULL ) + if ( matrix == NULL ) + { return ( -1 ) ; + } - if( hypre_MappedMatrixMatrix(matrix) == NULL ) + if ( hypre_MappedMatrixMatrix(matrix) == NULL ) + { return ( -1 ) ; + } - if( hypre_MappedMatrixColMap(matrix) == NULL ) + if ( hypre_MappedMatrixColMap(matrix) == NULL ) + { return ( -1 ) ; + } - if( hypre_MappedMatrixMapData(matrix) == NULL ) + if ( hypre_MappedMatrixMapData(matrix) == NULL ) + { return ( -1 ) ; + } - return(ierr); + return (ierr); } @@ -112,6 +120,8 @@ hypre_MappedMatrixAssemble( hypre_MappedMatrix *matrix ) void hypre_MappedMatrixPrint(hypre_MappedMatrix *matrix ) { + HYPRE_UNUSED_VAR(matrix); + hypre_printf("Stub for hypre_MappedMatrix\n"); } @@ -122,7 +132,7 @@ hypre_MappedMatrixPrint(hypre_MappedMatrix *matrix ) HYPRE_Int hypre_MappedMatrixGetColIndex(hypre_MappedMatrix *matrix, HYPRE_Int j ) { - return( hypre_MappedMatrixColIndex(matrix,j) ); + return ( hypre_MappedMatrixColIndex(matrix, j) ); } /*-------------------------------------------------------------------------- @@ -132,7 +142,7 @@ hypre_MappedMatrixGetColIndex(hypre_MappedMatrix *matrix, HYPRE_Int j ) void * hypre_MappedMatrixGetMatrix(hypre_MappedMatrix *matrix ) { - return( hypre_MappedMatrixMatrix(matrix) ); + return ( hypre_MappedMatrixMatrix(matrix) ); } /*-------------------------------------------------------------------------- @@ -142,11 +152,11 @@ hypre_MappedMatrixGetMatrix(hypre_MappedMatrix *matrix ) HYPRE_Int hypre_MappedMatrixSetMatrix(hypre_MappedMatrix *matrix, void *matrix_data ) { - HYPRE_Int ierr=0; + HYPRE_Int ierr = 0; hypre_MappedMatrixMatrix(matrix) = matrix_data; - return(ierr); + return (ierr); } /*-------------------------------------------------------------------------- @@ -154,14 +164,14 @@ hypre_MappedMatrixSetMatrix(hypre_MappedMatrix *matrix, void *matrix_data ) *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_MappedMatrixSetColMap(hypre_MappedMatrix *matrix, - HYPRE_Int (*ColMap)(HYPRE_Int, void *) ) +hypre_MappedMatrixSetColMap(hypre_MappedMatrix *matrix, + HYPRE_Int (*ColMap)(HYPRE_Int, void *) ) { - HYPRE_Int ierr=0; + HYPRE_Int ierr = 0; hypre_MappedMatrixColMap(matrix) = ColMap; - return(ierr); + return (ierr); } /*-------------------------------------------------------------------------- @@ -169,13 +179,12 @@ hypre_MappedMatrixSetColMap(hypre_MappedMatrix *matrix, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_MappedMatrixSetMapData(hypre_MappedMatrix *matrix, - void *map_data ) +hypre_MappedMatrixSetMapData(hypre_MappedMatrix *matrix, + void *map_data ) { - HYPRE_Int ierr=0; + HYPRE_Int ierr = 0; hypre_MappedMatrixMapData(matrix) = map_data; - return(ierr); + return (ierr); } - diff --git a/external/hypre/src/seq_mv/mapped_matrix.h b/external/hypre/src/seq_mv/mapped_matrix.h index 3a055a23..b1564d10 100644 --- a/external/hypre/src/seq_mv/mapped_matrix.h +++ b/external/hypre/src/seq_mv/mapped_matrix.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/seq_mv/multiblock_matrix.c b/external/hypre/src/seq_mv/multiblock_matrix.c index 4818e29b..fce20d17 100644 --- a/external/hypre/src/seq_mv/multiblock_matrix.c +++ b/external/hypre/src/seq_mv/multiblock_matrix.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -18,7 +18,7 @@ *--------------------------------------------------------------------------*/ hypre_MultiblockMatrix * -hypre_MultiblockMatrixCreate( ) +hypre_MultiblockMatrixCreate( void ) { hypre_MultiblockMatrix *matrix; @@ -31,15 +31,17 @@ hypre_MultiblockMatrixCreate( ) * hypre_MultiblockMatrixDestroy *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int hypre_MultiblockMatrixDestroy( hypre_MultiblockMatrix *matrix ) { - HYPRE_Int ierr=0, i; + HYPRE_Int ierr = 0, i; if (matrix) { - for(i=0; i < hypre_MultiblockMatrixNumSubmatrices(matrix); i++) + for (i = 0; i < hypre_MultiblockMatrixNumSubmatrices(matrix); i++) + { hypre_TFree(hypre_MultiblockMatrixSubmatrix(matrix, i), HYPRE_MEMORY_HOST); + } hypre_TFree(hypre_MultiblockMatrixSubmatrices(matrix), HYPRE_MEMORY_HOST); hypre_TFree(hypre_MultiblockMatrixSubmatrixTypes(matrix), HYPRE_MEMORY_HOST); @@ -54,10 +56,10 @@ hypre_MultiblockMatrixDestroy( hypre_MultiblockMatrix *matrix ) * hypre_MultiblockMatrixLimitedDestroy *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int hypre_MultiblockMatrixLimitedDestroy( hypre_MultiblockMatrix *matrix ) { - HYPRE_Int ierr=0; + HYPRE_Int ierr = 0; if (matrix) { @@ -75,36 +77,38 @@ hypre_MultiblockMatrixLimitedDestroy( hypre_MultiblockMatrix *matrix ) * hypre_MultiblockMatrixInitialize *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int hypre_MultiblockMatrixInitialize( hypre_MultiblockMatrix *matrix ) { - HYPRE_Int ierr=0; + HYPRE_Int ierr = 0; - if( hypre_MultiblockMatrixNumSubmatrices(matrix) <= 0 ) - return(-1); + if ( hypre_MultiblockMatrixNumSubmatrices(matrix) <= 0 ) + { + return (-1); + } - hypre_MultiblockMatrixSubmatrixTypes(matrix) = - hypre_CTAlloc( HYPRE_Int, hypre_MultiblockMatrixNumSubmatrices(matrix) , HYPRE_MEMORY_HOST); + hypre_MultiblockMatrixSubmatrixTypes(matrix) = + hypre_CTAlloc( HYPRE_Int, hypre_MultiblockMatrixNumSubmatrices(matrix), HYPRE_MEMORY_HOST); - hypre_MultiblockMatrixSubmatrices(matrix) = - hypre_CTAlloc( void *, hypre_MultiblockMatrixNumSubmatrices(matrix) , HYPRE_MEMORY_HOST); + hypre_MultiblockMatrixSubmatrices(matrix) = + hypre_CTAlloc( void *, hypre_MultiblockMatrixNumSubmatrices(matrix), HYPRE_MEMORY_HOST); return ierr; } - /*-------------------------------------------------------------------------- * hypre_MultiblockMatrixAssemble *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int hypre_MultiblockMatrixAssemble( hypre_MultiblockMatrix *matrix ) { - HYPRE_Int ierr=0; + HYPRE_Int ierr = 0; - return(ierr); -} + HYPRE_UNUSED_VAR(matrix); + return (ierr); +} /*-------------------------------------------------------------------------- * hypre_MultiblockMatrixPrint @@ -113,6 +117,8 @@ hypre_MultiblockMatrixAssemble( hypre_MultiblockMatrix *matrix ) void hypre_MultiblockMatrixPrint(hypre_MultiblockMatrix *matrix ) { + HYPRE_UNUSED_VAR(matrix); + hypre_printf("Stub for hypre_MultiblockMatrix\n"); } @@ -126,7 +132,7 @@ hypre_MultiblockMatrixSetNumSubmatrices(hypre_MultiblockMatrix *matrix, HYPRE_In HYPRE_Int ierr = 0; hypre_MultiblockMatrixNumSubmatrices(matrix) = n; - return( ierr ); + return ( ierr ); } /*-------------------------------------------------------------------------- @@ -134,19 +140,21 @@ hypre_MultiblockMatrixSetNumSubmatrices(hypre_MultiblockMatrix *matrix, HYPRE_In *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_MultiblockMatrixSetSubmatrixType(hypre_MultiblockMatrix *matrix, - HYPRE_Int j, - HYPRE_Int type ) +hypre_MultiblockMatrixSetSubmatrixType(hypre_MultiblockMatrix *matrix, + HYPRE_Int j, + HYPRE_Int type ) { HYPRE_Int ierr = 0; - if ( (j<0) || - (j >= hypre_MultiblockMatrixNumSubmatrices(matrix)) ) - return(-1); + if ( (j < 0) || + (j >= hypre_MultiblockMatrixNumSubmatrices(matrix)) ) + { + return (-1); + } - hypre_MultiblockMatrixSubmatrixType(matrix,j) = type; + hypre_MultiblockMatrixSubmatrixType(matrix, j) = type; - return( ierr ); + return ( ierr ); } /*-------------------------------------------------------------------------- @@ -154,19 +162,19 @@ hypre_MultiblockMatrixSetSubmatrixType(hypre_MultiblockMatrix *matrix, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_MultiblockMatrixSetSubmatrix(hypre_MultiblockMatrix *matrix, - HYPRE_Int j, - void *submatrix ) +hypre_MultiblockMatrixSetSubmatrix(hypre_MultiblockMatrix *matrix, + HYPRE_Int j, + void *submatrix ) { HYPRE_Int ierr = 0; - if ( (j<0) || - (j >= hypre_MultiblockMatrixNumSubmatrices(matrix)) ) - return(-1); + if ( (j < 0) || + (j >= hypre_MultiblockMatrixNumSubmatrices(matrix)) ) + { + return (-1); + } - hypre_MultiblockMatrixSubmatrix(matrix,j) = submatrix; + hypre_MultiblockMatrixSubmatrix(matrix, j) = submatrix; - return( ierr ); + return ( ierr ); } - - diff --git a/external/hypre/src/seq_mv/multiblock_matrix.h b/external/hypre/src/seq_mv/multiblock_matrix.h index 7dd463a4..995413b9 100644 --- a/external/hypre/src/seq_mv/multiblock_matrix.h +++ b/external/hypre/src/seq_mv/multiblock_matrix.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/seq_mv/protos.h b/external/hypre/src/seq_mv/protos.h index 62a97e2b..f645aa0c 100644 --- a/external/hypre/src/seq_mv/protos.h +++ b/external/hypre/src/seq_mv/protos.h @@ -1,106 +1,201 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ +/* csr_filter.c */ +HYPRE_Int hypre_CSRMatrixTruncateDiag(hypre_CSRMatrix *A); + /* csr_matop.c */ -HYPRE_Int hypre_CSRMatrixAddFirstPass ( HYPRE_Int firstrow , HYPRE_Int lastrow , HYPRE_Int *marker , HYPRE_Int *twspace , HYPRE_Int *map_A2C , HYPRE_Int *map_B2C , hypre_CSRMatrix *A , hypre_CSRMatrix *B , HYPRE_Int nnzrows_C , HYPRE_Int nrows_C , HYPRE_Int ncols_C , HYPRE_Int *rownnz_C , HYPRE_MemoryLocation memory_location_C , HYPRE_Int *C_i , hypre_CSRMatrix **C_ptr ); -HYPRE_Int hypre_CSRMatrixAddSecondPass ( HYPRE_Int firstrow , HYPRE_Int lastrow , HYPRE_Int *marker, HYPRE_Int *twspace , HYPRE_Int *map_A2C , HYPRE_Int *map_B2C , HYPRE_Int *rownnz_C , HYPRE_Complex alpha , HYPRE_Complex beta , hypre_CSRMatrix *A , hypre_CSRMatrix *B , hypre_CSRMatrix *C); -hypre_CSRMatrix *hypre_CSRMatrixAddHost ( HYPRE_Complex alpha, hypre_CSRMatrix *A, HYPRE_Complex beta, hypre_CSRMatrix *B ); -hypre_CSRMatrix *hypre_CSRMatrixAdd ( HYPRE_Complex alpha, hypre_CSRMatrix *A, HYPRE_Complex beta, hypre_CSRMatrix *B ); -hypre_CSRMatrix *hypre_CSRMatrixBigAdd ( hypre_CSRMatrix *A , hypre_CSRMatrix *B ); -hypre_CSRMatrix *hypre_CSRMatrixMultiplyHost ( hypre_CSRMatrix *A , hypre_CSRMatrix *B ); -hypre_CSRMatrix *hypre_CSRMatrixMultiply ( hypre_CSRMatrix *A , hypre_CSRMatrix *B ); -hypre_CSRMatrix *hypre_CSRMatrixDeleteZeros ( hypre_CSRMatrix *A , HYPRE_Real tol ); -HYPRE_Int hypre_CSRMatrixTransposeHost ( hypre_CSRMatrix *A , hypre_CSRMatrix **AT , HYPRE_Int data ); -HYPRE_Int hypre_CSRMatrixTranspose ( hypre_CSRMatrix *A , hypre_CSRMatrix **AT , HYPRE_Int data ); +HYPRE_Int hypre_CSRMatrixAddFirstPass ( HYPRE_Int firstrow, HYPRE_Int lastrow, HYPRE_Int *marker, + HYPRE_Int *twspace, HYPRE_Int *map_A2C, HYPRE_Int *map_B2C, + hypre_CSRMatrix *A, hypre_CSRMatrix *B, + HYPRE_Int nnzrows_C, HYPRE_Int nrows_C, HYPRE_Int ncols_C, + HYPRE_Int *rownnz_C, + HYPRE_MemoryLocation memory_location_C, + HYPRE_Int *C_i, hypre_CSRMatrix **C_ptr ); +HYPRE_Int hypre_CSRMatrixAddSecondPass ( HYPRE_Int firstrow, HYPRE_Int lastrow, HYPRE_Int *marker, + HYPRE_Int *map_A2C, HYPRE_Int *map_B2C, + HYPRE_Int *rownnz_C, HYPRE_Complex alpha, + HYPRE_Complex beta, hypre_CSRMatrix *A, + hypre_CSRMatrix *B, hypre_CSRMatrix *C); +hypre_CSRMatrix *hypre_CSRMatrixAddHost ( HYPRE_Complex alpha, hypre_CSRMatrix *A, + HYPRE_Complex beta, hypre_CSRMatrix *B ); +hypre_CSRMatrix *hypre_CSRMatrixAdd ( HYPRE_Complex alpha, hypre_CSRMatrix *A, HYPRE_Complex beta, + hypre_CSRMatrix *B ); +hypre_CSRMatrix *hypre_CSRMatrixBigAdd ( hypre_CSRMatrix *A, hypre_CSRMatrix *B ); +hypre_CSRMatrix *hypre_CSRMatrixMultiplyHost ( hypre_CSRMatrix *A, hypre_CSRMatrix *B ); +hypre_CSRMatrix *hypre_CSRMatrixMultiply ( hypre_CSRMatrix *A, hypre_CSRMatrix *B ); +hypre_CSRMatrix *hypre_CSRMatrixDeleteZeros ( hypre_CSRMatrix *A, HYPRE_Real tol ); +HYPRE_Int hypre_CSRMatrixTransposeHost ( hypre_CSRMatrix *A, hypre_CSRMatrix **AT, HYPRE_Int data ); +HYPRE_Int hypre_CSRMatrixTranspose ( hypre_CSRMatrix *A, hypre_CSRMatrix **AT, HYPRE_Int data ); HYPRE_Int hypre_CSRMatrixReorder ( hypre_CSRMatrix *A ); HYPRE_Complex hypre_CSRMatrixSumElts ( hypre_CSRMatrix *A ); HYPRE_Real hypre_CSRMatrixFnorm( hypre_CSRMatrix *A ); -HYPRE_Int hypre_CSRMatrixSplit(hypre_CSRMatrix *Bs_ext, HYPRE_BigInt first_col_diag_B, HYPRE_BigInt last_col_diag_B, HYPRE_Int num_cols_offd_B, HYPRE_BigInt *col_map_offd_B, HYPRE_Int *num_cols_offd_C_ptr, HYPRE_BigInt **col_map_offd_C_ptr, hypre_CSRMatrix **Bext_diag_ptr, hypre_CSRMatrix **Bext_offd_ptr); -hypre_CSRMatrix * hypre_CSRMatrixAddPartial( hypre_CSRMatrix *A, hypre_CSRMatrix *B, HYPRE_Int *row_nums); -void hypre_CSRMatrixComputeRowSum( hypre_CSRMatrix *A, HYPRE_Int *CF_i, HYPRE_Int *CF_j, HYPRE_Complex *row_sum, HYPRE_Int type, HYPRE_Complex scal, const char *set_or_add); -void hypre_CSRMatrixExtractDiagonal( hypre_CSRMatrix *A, HYPRE_Complex *d, HYPRE_Int type); -void hypre_CSRMatrixExtractDiagonalHost( hypre_CSRMatrix *A, HYPRE_Complex *d, HYPRE_Int type); +HYPRE_Int hypre_CSRMatrixSplit(hypre_CSRMatrix *Bs_ext, HYPRE_BigInt first_col_diag_B, + HYPRE_BigInt last_col_diag_B, HYPRE_Int num_cols_offd_B, HYPRE_BigInt *col_map_offd_B, + HYPRE_Int *num_cols_offd_C_ptr, HYPRE_BigInt **col_map_offd_C_ptr, hypre_CSRMatrix **Bext_diag_ptr, + hypre_CSRMatrix **Bext_offd_ptr); +hypre_CSRMatrix * hypre_CSRMatrixAddPartial( hypre_CSRMatrix *A, hypre_CSRMatrix *B, + HYPRE_Int *row_nums); +void hypre_CSRMatrixComputeRowSumHost( hypre_CSRMatrix *A, HYPRE_Int *CF_i, HYPRE_Int *CF_j, + HYPRE_Complex *row_sum, HYPRE_Int type, HYPRE_Complex scal, const char *set_or_add); +void hypre_CSRMatrixComputeRowSum( hypre_CSRMatrix *A, HYPRE_Int *CF_i, HYPRE_Int *CF_j, + HYPRE_Complex *row_sum, HYPRE_Int type, HYPRE_Complex scal, const char *set_or_add); +HYPRE_Int hypre_CSRMatrixExtractDiagonal( hypre_CSRMatrix *A, HYPRE_Complex *d, HYPRE_Int type); +HYPRE_Int hypre_CSRMatrixExtractDiagonalHost( hypre_CSRMatrix *A, HYPRE_Complex *d, HYPRE_Int type); HYPRE_Int hypre_CSRMatrixScale(hypre_CSRMatrix *A, HYPRE_Complex scalar); HYPRE_Int hypre_CSRMatrixSetConstantValues( hypre_CSRMatrix *A, HYPRE_Complex value); +HYPRE_Int hypre_CSRMatrixDiagScale( hypre_CSRMatrix *A, hypre_Vector *ld, hypre_Vector *rd); /* csr_matop_device.c */ -hypre_CSRMatrix *hypre_CSRMatrixAddDevice ( HYPRE_Complex alpha, hypre_CSRMatrix *A, HYPRE_Complex beta, hypre_CSRMatrix *B ); -hypre_CSRMatrix *hypre_CSRMatrixMultiplyDevice ( hypre_CSRMatrix *A , hypre_CSRMatrix *B ); -hypre_CSRMatrix *hypre_CSRMatrixTripleMultiplyDevice ( hypre_CSRMatrix *A, hypre_CSRMatrix *B, hypre_CSRMatrix *C ); -HYPRE_Int hypre_CSRMatrixSplitDevice_core( HYPRE_Int job, HYPRE_Int num_rows, HYPRE_Int B_ext_nnz, HYPRE_Int *B_ext_ii, HYPRE_BigInt *B_ext_bigj, HYPRE_Complex *B_ext_data, char *B_ext_xata, HYPRE_BigInt first_col_diag_B, HYPRE_BigInt last_col_diag_B, HYPRE_Int num_cols_offd_B, HYPRE_BigInt *col_map_offd_B, HYPRE_Int **map_B_to_C_ptr, HYPRE_Int *num_cols_offd_C_ptr, HYPRE_BigInt **col_map_offd_C_ptr, HYPRE_Int *B_ext_diag_nnz_ptr, HYPRE_Int *B_ext_diag_ii, HYPRE_Int *B_ext_diag_j, HYPRE_Complex *B_ext_diag_data, char *B_ext_diag_xata, HYPRE_Int *B_ext_offd_nnz_ptr, HYPRE_Int *B_ext_offd_ii, HYPRE_Int *B_ext_offd_j, HYPRE_Complex *B_ext_offd_data, char *B_ext_offd_xata ); -HYPRE_Int hypre_CSRMatrixSplitDevice(hypre_CSRMatrix *B_ext, HYPRE_BigInt first_col_diag_B, HYPRE_BigInt last_col_diag_B, HYPRE_Int num_cols_offd_B, HYPRE_BigInt *col_map_offd_B, HYPRE_Int **map_B_to_C_ptr, HYPRE_Int *num_cols_offd_C_ptr, HYPRE_BigInt **col_map_offd_C_ptr, hypre_CSRMatrix **B_ext_diag_ptr, hypre_CSRMatrix **B_ext_offd_ptr); -HYPRE_Int hypre_CSRMatrixTransposeDevice ( hypre_CSRMatrix *A , hypre_CSRMatrix **AT , HYPRE_Int data ); -hypre_CSRMatrix* hypre_CSRMatrixAddPartialDevice( hypre_CSRMatrix *A, hypre_CSRMatrix *B, HYPRE_Int *row_nums); +hypre_CSRMatrix *hypre_CSRMatrixAddDevice ( HYPRE_Complex alpha, hypre_CSRMatrix *A, + HYPRE_Complex beta, hypre_CSRMatrix *B ); +hypre_CSRMatrix *hypre_CSRMatrixMultiplyDevice ( hypre_CSRMatrix *A, hypre_CSRMatrix *B ); +hypre_CSRMatrix *hypre_CSRMatrixTripleMultiplyDevice ( hypre_CSRMatrix *A, hypre_CSRMatrix *B, + hypre_CSRMatrix *C ); +HYPRE_Int hypre_CSRMatrixMergeColMapOffd( HYPRE_Int num_cols_offd_B, HYPRE_BigInt *col_map_offd_B, + HYPRE_Int B_ext_offd_nnz, HYPRE_BigInt *B_ext_offd_bigj, HYPRE_Int *num_cols_offd_C_ptr, + HYPRE_BigInt **col_map_offd_C_ptr, HYPRE_Int **map_B_to_C_ptr ); +HYPRE_Int hypre_CSRMatrixSplitDevice_core( HYPRE_Int job, HYPRE_Int num_rows, HYPRE_Int B_ext_nnz, + HYPRE_Int *B_ext_ii, HYPRE_BigInt *B_ext_bigj, HYPRE_Complex *B_ext_data, char *B_ext_xata, + HYPRE_BigInt first_col_diag_B, HYPRE_BigInt last_col_diag_B, HYPRE_Int num_cols_offd_B, + HYPRE_BigInt *col_map_offd_B, HYPRE_Int **map_B_to_C_ptr, HYPRE_Int *num_cols_offd_C_ptr, + HYPRE_BigInt **col_map_offd_C_ptr, HYPRE_Int *B_ext_diag_nnz_ptr, HYPRE_Int *B_ext_diag_ii, + HYPRE_Int *B_ext_diag_j, HYPRE_Complex *B_ext_diag_data, char *B_ext_diag_xata, + HYPRE_Int *B_ext_offd_nnz_ptr, HYPRE_Int *B_ext_offd_ii, HYPRE_Int *B_ext_offd_j, + HYPRE_Complex *B_ext_offd_data, char *B_ext_offd_xata ); +HYPRE_Int hypre_CSRMatrixSplitDevice(hypre_CSRMatrix *B_ext, HYPRE_BigInt first_col_diag_B, + HYPRE_BigInt last_col_diag_B, HYPRE_Int num_cols_offd_B, HYPRE_BigInt *col_map_offd_B, + HYPRE_Int **map_B_to_C_ptr, HYPRE_Int *num_cols_offd_C_ptr, HYPRE_BigInt **col_map_offd_C_ptr, + hypre_CSRMatrix **B_ext_diag_ptr, hypre_CSRMatrix **B_ext_offd_ptr); +HYPRE_Int hypre_CSRMatrixTransposeDevice ( hypre_CSRMatrix *A, hypre_CSRMatrix **AT, + HYPRE_Int data ); +hypre_CSRMatrix* hypre_CSRMatrixAddPartialDevice( hypre_CSRMatrix *A, hypre_CSRMatrix *B, + HYPRE_Int *row_nums); HYPRE_Int hypre_CSRMatrixColNNzRealDevice( hypre_CSRMatrix *A, HYPRE_Real *colnnz); HYPRE_Int hypre_CSRMatrixMoveDiagFirstDevice( hypre_CSRMatrix *A ); HYPRE_Int hypre_CSRMatrixCheckDiagFirstDevice( hypre_CSRMatrix *A ); -HYPRE_Int hypre_CSRMatrixFixZeroDiagDevice( hypre_CSRMatrix *A, HYPRE_Complex v, HYPRE_Real tol ); -HYPRE_Int hypre_CSRMatrixReplaceDiagDevice( hypre_CSRMatrix *A, HYPRE_Complex *new_diag, HYPRE_Complex v, HYPRE_Real tol ); -void hypre_CSRMatrixComputeRowSumDevice( hypre_CSRMatrix *A, HYPRE_Int *CF_i, HYPRE_Int *CF_j, HYPRE_Complex *row_sum, HYPRE_Int type, HYPRE_Complex scal, const char *set_or_add); -void hypre_CSRMatrixExtractDiagonalDevice( hypre_CSRMatrix *A, HYPRE_Complex *d, HYPRE_Int type); +HYPRE_Int hypre_CSRMatrixCheckForMissingDiagonal( hypre_CSRMatrix *A ); +HYPRE_Int hypre_CSRMatrixReplaceDiagDevice( hypre_CSRMatrix *A, HYPRE_Complex *new_diag, + HYPRE_Complex v, HYPRE_Real tol ); +HYPRE_Int hypre_CSRMatrixComputeRowSumDevice( hypre_CSRMatrix *A, HYPRE_Int *CF_i, HYPRE_Int *CF_j, + HYPRE_Complex *row_sum, HYPRE_Int type, + HYPRE_Complex scal, const char *set_or_add ); +HYPRE_Int hypre_CSRMatrixExtractDiagonalDevice( hypre_CSRMatrix *A, HYPRE_Complex *d, + HYPRE_Int type ); hypre_CSRMatrix* hypre_CSRMatrixStack2Device(hypre_CSRMatrix *A, hypre_CSRMatrix *B); hypre_CSRMatrix* hypre_CSRMatrixIdentityDevice(HYPRE_Int n, HYPRE_Complex alp); +hypre_CSRMatrix* hypre_CSRMatrixDiagMatrixFromVectorDevice(HYPRE_Int n, HYPRE_Complex *v); +hypre_CSRMatrix* hypre_CSRMatrixDiagMatrixFromMatrixDevice(hypre_CSRMatrix *A, HYPRE_Int type); HYPRE_Int hypre_CSRMatrixRemoveDiagonalDevice(hypre_CSRMatrix *A); -HYPRE_Int hypre_CSRMatrixDropSmallEntriesDevice( hypre_CSRMatrix *A, HYPRE_Real tol, HYPRE_Real *elmt_tols); +HYPRE_Int hypre_CSRMatrixDropSmallEntriesDevice( hypre_CSRMatrix *A, HYPRE_Real tol, + HYPRE_Real *elmt_tols); +HYPRE_Int hypre_CSRMatrixPermuteDevice( hypre_CSRMatrix *A, HYPRE_Int *perm, + HYPRE_Int *rqperm, hypre_CSRMatrix *B ); HYPRE_Int hypre_CSRMatrixSortRow(hypre_CSRMatrix *A); -HYPRE_Int hypre_CSRMatrixTriLowerUpperSolveDevice(char uplo, hypre_CSRMatrix *A, HYPRE_Real *l1_norms, hypre_Vector *f, hypre_Vector *u ); -HYPRE_Int hypre_CSRMatrixTriLowerUpperSolveRocsparse(char uplo, hypre_CSRMatrix *A, HYPRE_Real *l1_norms, hypre_Vector *f, hypre_Vector *u ); -HYPRE_Int hypre_CSRMatrixTriLowerUpperSolveCusparse(char uplo, hypre_CSRMatrix *A, HYPRE_Real *l1_norms, hypre_Vector *f, hypre_Vector *u ); -HYPRE_Int hypre_CSRMatrixIntersectPattern(hypre_CSRMatrix *A, hypre_CSRMatrix *B, HYPRE_Int *markA, HYPRE_Int diag_option); +HYPRE_Int hypre_CSRMatrixSortRowOutOfPlace(hypre_CSRMatrix *A); +HYPRE_Int hypre_CSRMatrixTriLowerUpperSolveDevice_core(char uplo, HYPRE_Int unit_diag, + hypre_CSRMatrix *A, HYPRE_Real *l1_norms, hypre_Vector *f, HYPRE_Int offset_f, hypre_Vector *u, + HYPRE_Int offset_u); +HYPRE_Int hypre_CSRMatrixTriLowerUpperSolveDevice(char uplo, HYPRE_Int unit_diag, + hypre_CSRMatrix *A, HYPRE_Real *l1_norms, hypre_Vector *f, hypre_Vector *u ); +HYPRE_Int hypre_CSRMatrixTriLowerUpperSolveRocsparse(char uplo, HYPRE_Int unit_diag, + hypre_CSRMatrix *A, HYPRE_Real *l1_norms, HYPRE_Complex *f, HYPRE_Complex *u ); +HYPRE_Int hypre_CSRMatrixTriLowerUpperSolveCusparse(char uplo, HYPRE_Int unit_diag, + hypre_CSRMatrix *A, HYPRE_Real *l1_norms, HYPRE_Complex *f, HYPRE_Complex *u ); +HYPRE_Int hypre_CSRMatrixTriLowerUpperSolveOnemklsparse(char uplo, HYPRE_Int unit_diag, + hypre_CSRMatrix *A, HYPRE_Real *l1_norms, HYPRE_Complex *f, HYPRE_Complex *u ); +HYPRE_Int hypre_CSRMatrixIntersectPattern(hypre_CSRMatrix *A, hypre_CSRMatrix *B, HYPRE_Int *markA, + HYPRE_Int diag_option); +HYPRE_Int hypre_CSRMatrixDiagScaleDevice( hypre_CSRMatrix *A, hypre_Vector *ld, hypre_Vector *rd); +HYPRE_Int hypre_CSRMatrixCompressColumnsDevice(hypre_CSRMatrix *A, HYPRE_BigInt *col_map, + HYPRE_Int **col_idx_new_ptr, HYPRE_BigInt **col_map_new_ptr); +HYPRE_Int hypre_CSRMatrixILU0(hypre_CSRMatrix *A); /* csr_matrix.c */ -hypre_CSRMatrix *hypre_CSRMatrixCreate ( HYPRE_Int num_rows , HYPRE_Int num_cols , HYPRE_Int num_nonzeros ); +hypre_CSRMatrix *hypre_CSRMatrixCreate ( HYPRE_Int num_rows, HYPRE_Int num_cols, + HYPRE_Int num_nonzeros ); HYPRE_Int hypre_CSRMatrixDestroy ( hypre_CSRMatrix *matrix ); -HYPRE_Int hypre_CSRMatrixInitialize_v2( hypre_CSRMatrix *matrix, HYPRE_Int bigInit, HYPRE_MemoryLocation memory_location ); +HYPRE_Int hypre_CSRMatrixInitialize_v2( hypre_CSRMatrix *matrix, HYPRE_Int bigInit, + HYPRE_MemoryLocation memory_location ); HYPRE_Int hypre_CSRMatrixInitialize ( hypre_CSRMatrix *matrix ); HYPRE_Int hypre_CSRMatrixBigInitialize ( hypre_CSRMatrix *matrix ); HYPRE_Int hypre_CSRMatrixBigJtoJ ( hypre_CSRMatrix *matrix ); HYPRE_Int hypre_CSRMatrixJtoBigJ ( hypre_CSRMatrix *matrix ); -HYPRE_Int hypre_CSRMatrixSetDataOwner ( hypre_CSRMatrix *matrix , HYPRE_Int owns_data ); +HYPRE_Int hypre_CSRMatrixSetDataOwner ( hypre_CSRMatrix *matrix, HYPRE_Int owns_data ); +HYPRE_Int hypre_CSRMatrixSetPatternOnly( hypre_CSRMatrix *matrix, HYPRE_Int pattern_only ); HYPRE_Int hypre_CSRMatrixSetRownnz ( hypre_CSRMatrix *matrix ); hypre_CSRMatrix *hypre_CSRMatrixRead ( char *file_name ); HYPRE_Int hypre_CSRMatrixPrint ( hypre_CSRMatrix *matrix, const char *file_name ); -HYPRE_Int hypre_CSRMatrixPrint2( hypre_CSRMatrix *matrix, const char *file_name ); -HYPRE_Int hypre_CSRMatrixPrintHB ( hypre_CSRMatrix *matrix_input , char *file_name ); -HYPRE_Int hypre_CSRMatrixPrintMM( hypre_CSRMatrix *matrix, HYPRE_Int basei, HYPRE_Int basej, HYPRE_Int trans, const char *file_name ); -HYPRE_Int hypre_CSRMatrixCopy ( hypre_CSRMatrix *A , hypre_CSRMatrix *B , HYPRE_Int copy_data ); +HYPRE_Int hypre_CSRMatrixPrintIJ( hypre_CSRMatrix *matrix, HYPRE_Int base_i, + HYPRE_Int base_j, char *filename ); +HYPRE_Int hypre_CSRMatrixPrintHB ( hypre_CSRMatrix *matrix_input, char *file_name ); +HYPRE_Int hypre_CSRMatrixPrintMM( hypre_CSRMatrix *matrix, HYPRE_Int basei, HYPRE_Int basej, + HYPRE_Int trans, const char *file_name ); +HYPRE_Int hypre_CSRMatrixCopy ( hypre_CSRMatrix *A, hypre_CSRMatrix *B, HYPRE_Int copy_data ); +HYPRE_Int hypre_CSRMatrixMigrate( hypre_CSRMatrix *A, HYPRE_MemoryLocation memory_location ); hypre_CSRMatrix *hypre_CSRMatrixClone ( hypre_CSRMatrix *A, HYPRE_Int copy_data ); -hypre_CSRMatrix *hypre_CSRMatrixClone_v2( hypre_CSRMatrix *A, HYPRE_Int copy_data, HYPRE_MemoryLocation memory_location ); -hypre_CSRMatrix *hypre_CSRMatrixUnion ( hypre_CSRMatrix *A , hypre_CSRMatrix *B , HYPRE_BigInt *col_map_offd_A , HYPRE_BigInt *col_map_offd_B , HYPRE_BigInt **col_map_offd_C ); +hypre_CSRMatrix *hypre_CSRMatrixClone_v2( hypre_CSRMatrix *A, HYPRE_Int copy_data, + HYPRE_MemoryLocation memory_location ); +HYPRE_Int hypre_CSRMatrixPermute( hypre_CSRMatrix *A, HYPRE_Int *perm, + HYPRE_Int *rqperm, hypre_CSRMatrix **B_ptr ); +hypre_CSRMatrix *hypre_CSRMatrixUnion( hypre_CSRMatrix *A, + hypre_CSRMatrix *B, + HYPRE_BigInt *col_map_offd_A, + HYPRE_BigInt *col_map_offd_B, + HYPRE_BigInt **col_map_offd_C ); HYPRE_Int hypre_CSRMatrixPrefetch( hypre_CSRMatrix *A, HYPRE_MemoryLocation memory_location); HYPRE_Int hypre_CSRMatrixCheckSetNumNonzeros( hypre_CSRMatrix *matrix ); -HYPRE_Int hypre_CSRMatrixResize( hypre_CSRMatrix *matrix, HYPRE_Int new_num_rows, HYPRE_Int new_num_cols, HYPRE_Int new_num_nonzeros ); +HYPRE_Int hypre_CSRMatrixResize( hypre_CSRMatrix *matrix, HYPRE_Int new_num_rows, + HYPRE_Int new_num_cols, HYPRE_Int new_num_nonzeros ); /* csr_matvec.c */ // y[offset:end] = alpha*A[offset:end,:]*x + beta*b[offset:end] -HYPRE_Int hypre_CSRMatrixMatvecOutOfPlace ( HYPRE_Complex alpha , hypre_CSRMatrix *A , hypre_Vector *x , HYPRE_Complex beta , hypre_Vector *b, hypre_Vector *y, HYPRE_Int offset ); +HYPRE_Int hypre_CSRMatrixMatvecOutOfPlace ( HYPRE_Complex alpha, hypre_CSRMatrix *A, + hypre_Vector *x, HYPRE_Complex beta, hypre_Vector *b, hypre_Vector *y, HYPRE_Int offset ); // y = alpha*A + beta*y -HYPRE_Int hypre_CSRMatrixMatvec ( HYPRE_Complex alpha , hypre_CSRMatrix *A , hypre_Vector *x , HYPRE_Complex beta , hypre_Vector *y ); -HYPRE_Int hypre_CSRMatrixMatvecT ( HYPRE_Complex alpha , hypre_CSRMatrix *A , hypre_Vector *x , HYPRE_Complex beta , hypre_Vector *y ); -HYPRE_Int hypre_CSRMatrixMatvec_FF ( HYPRE_Complex alpha , hypre_CSRMatrix *A , hypre_Vector *x , HYPRE_Complex beta , hypre_Vector *y , HYPRE_Int *CF_marker_x , HYPRE_Int *CF_marker_y , HYPRE_Int fpt ); +HYPRE_Int hypre_CSRMatrixMatvec ( HYPRE_Complex alpha, hypre_CSRMatrix *A, hypre_Vector *x, + HYPRE_Complex beta, hypre_Vector *y ); +HYPRE_Int hypre_CSRMatrixMatvecT ( HYPRE_Complex alpha, hypre_CSRMatrix *A, hypre_Vector *x, + HYPRE_Complex beta, hypre_Vector *y ); +HYPRE_Int hypre_CSRMatrixMatvec_FF ( HYPRE_Complex alpha, hypre_CSRMatrix *A, hypre_Vector *x, + HYPRE_Complex beta, hypre_Vector *y, HYPRE_Int *CF_marker_x, HYPRE_Int *CF_marker_y, + HYPRE_Int fpt ); /* csr_matvec_device.c */ -HYPRE_Int hypre_CSRMatrixMatvecDevice(HYPRE_Int trans, HYPRE_Complex alpha , hypre_CSRMatrix *A , hypre_Vector *x , HYPRE_Complex beta , hypre_Vector *b, hypre_Vector *y, HYPRE_Int offset ); -HYPRE_Int hypre_CSRMatrixMatvecCusparseNewAPI( HYPRE_Int trans, HYPRE_Complex alpha, hypre_CSRMatrix *A, hypre_Vector *x, HYPRE_Complex beta, hypre_Vector *y, HYPRE_Int offset ); -HYPRE_Int hypre_CSRMatrixMatvecCusparseOldAPI( HYPRE_Int trans, HYPRE_Complex alpha, hypre_CSRMatrix *A, hypre_Vector *x, HYPRE_Complex beta, hypre_Vector *y, HYPRE_Int offset ); -HYPRE_Int hypre_CSRMatrixMatvecOMPOffload (HYPRE_Int trans, HYPRE_Complex alpha , hypre_CSRMatrix *A , hypre_Vector *x , HYPRE_Complex beta , hypre_Vector *y, HYPRE_Int offset ); -HYPRE_Int hypre_CSRMatrixMatvecRocsparse (HYPRE_Int trans, HYPRE_Complex alpha , hypre_CSRMatrix *A , hypre_Vector *x , HYPRE_Complex beta , hypre_Vector *y, HYPRE_Int offset ); +HYPRE_Int hypre_CSRMatrixMatvecDevice(HYPRE_Int trans, HYPRE_Complex alpha, hypre_CSRMatrix *A, + hypre_Vector *x, HYPRE_Complex beta, hypre_Vector *b, hypre_Vector *y, HYPRE_Int offset ); +HYPRE_Int hypre_CSRMatrixMatvecCusparseNewAPI( HYPRE_Int trans, HYPRE_Complex alpha, + hypre_CSRMatrix *A, hypre_Vector *x, HYPRE_Complex beta, hypre_Vector *y, HYPRE_Int offset ); +HYPRE_Int hypre_CSRMatrixMatvecCusparseOldAPI( HYPRE_Int trans, HYPRE_Complex alpha, + hypre_CSRMatrix *A, hypre_Vector *x, HYPRE_Complex beta, hypre_Vector *y, HYPRE_Int offset ); +HYPRE_Int hypre_CSRMatrixMatvecCusparse( HYPRE_Int trans, HYPRE_Complex alpha, + hypre_CSRMatrix *A, hypre_Vector *x, HYPRE_Complex beta, hypre_Vector *y, HYPRE_Int offset ); +HYPRE_Int hypre_CSRMatrixMatvecOMPOffload (HYPRE_Int trans, HYPRE_Complex alpha, hypre_CSRMatrix *A, + hypre_Vector *x, HYPRE_Complex beta, hypre_Vector *y, HYPRE_Int offset ); +HYPRE_Int hypre_CSRMatrixMatvecRocsparse (HYPRE_Int trans, HYPRE_Complex alpha, hypre_CSRMatrix *A, + hypre_Vector *x, HYPRE_Complex beta, hypre_Vector *y, HYPRE_Int offset ); +HYPRE_Int hypre_CSRMatrixMatvecOnemklsparse (HYPRE_Int trans, HYPRE_Complex alpha, + hypre_CSRMatrix *A, + hypre_Vector *x, HYPRE_Complex beta, hypre_Vector *y, HYPRE_Int offset ); /* genpart.c */ -HYPRE_Int hypre_GeneratePartitioning ( HYPRE_BigInt length , HYPRE_Int num_procs , HYPRE_BigInt **part_ptr ); -HYPRE_Int hypre_GenerateLocalPartitioning ( HYPRE_BigInt length , HYPRE_Int num_procs , HYPRE_Int myid , HYPRE_BigInt *part ); +HYPRE_Int hypre_GeneratePartitioning ( HYPRE_BigInt length, HYPRE_Int num_procs, + HYPRE_BigInt **part_ptr ); +HYPRE_Int hypre_GenerateLocalPartitioning ( HYPRE_BigInt length, HYPRE_Int num_procs, + HYPRE_Int myid, HYPRE_BigInt *part ); /* HYPRE_csr_matrix.c */ -HYPRE_CSRMatrix HYPRE_CSRMatrixCreate ( HYPRE_Int num_rows , HYPRE_Int num_cols , HYPRE_Int *row_sizes ); +HYPRE_CSRMatrix HYPRE_CSRMatrixCreate ( HYPRE_Int num_rows, HYPRE_Int num_cols, + HYPRE_Int *row_sizes ); HYPRE_Int HYPRE_CSRMatrixDestroy ( HYPRE_CSRMatrix matrix ); HYPRE_Int HYPRE_CSRMatrixInitialize ( HYPRE_CSRMatrix matrix ); HYPRE_CSRMatrix HYPRE_CSRMatrixRead ( char *file_name ); -void HYPRE_CSRMatrixPrint ( HYPRE_CSRMatrix matrix , char *file_name ); -HYPRE_Int HYPRE_CSRMatrixGetNumRows ( HYPRE_CSRMatrix matrix , HYPRE_Int *num_rows ); +void HYPRE_CSRMatrixPrint ( HYPRE_CSRMatrix matrix, char *file_name ); +HYPRE_Int HYPRE_CSRMatrixGetNumRows ( HYPRE_CSRMatrix matrix, HYPRE_Int *num_rows ); /* HYPRE_mapped_matrix.c */ HYPRE_MappedMatrix HYPRE_MappedMatrixCreate ( void ); @@ -109,11 +204,12 @@ HYPRE_Int HYPRE_MappedMatrixLimitedDestroy ( HYPRE_MappedMatrix matrix ); HYPRE_Int HYPRE_MappedMatrixInitialize ( HYPRE_MappedMatrix matrix ); HYPRE_Int HYPRE_MappedMatrixAssemble ( HYPRE_MappedMatrix matrix ); void HYPRE_MappedMatrixPrint ( HYPRE_MappedMatrix matrix ); -HYPRE_Int HYPRE_MappedMatrixGetColIndex ( HYPRE_MappedMatrix matrix , HYPRE_Int j ); +HYPRE_Int HYPRE_MappedMatrixGetColIndex ( HYPRE_MappedMatrix matrix, HYPRE_Int j ); void *HYPRE_MappedMatrixGetMatrix ( HYPRE_MappedMatrix matrix ); -HYPRE_Int HYPRE_MappedMatrixSetMatrix ( HYPRE_MappedMatrix matrix , void *matrix_data ); -HYPRE_Int HYPRE_MappedMatrixSetColMap ( HYPRE_MappedMatrix matrix , HYPRE_Int (*ColMap )(HYPRE_Int ,void *)); -HYPRE_Int HYPRE_MappedMatrixSetMapData ( HYPRE_MappedMatrix matrix , void *MapData ); +HYPRE_Int HYPRE_MappedMatrixSetMatrix ( HYPRE_MappedMatrix matrix, void *matrix_data ); +HYPRE_Int HYPRE_MappedMatrixSetColMap ( HYPRE_MappedMatrix matrix, HYPRE_Int (*ColMap )(HYPRE_Int, + void *)); +HYPRE_Int HYPRE_MappedMatrixSetMapData ( HYPRE_MappedMatrix matrix, void *MapData ); /* HYPRE_multiblock_matrix.c */ HYPRE_MultiblockMatrix HYPRE_MultiblockMatrixCreate ( void ); @@ -122,14 +218,15 @@ HYPRE_Int HYPRE_MultiblockMatrixLimitedDestroy ( HYPRE_MultiblockMatrix matrix ) HYPRE_Int HYPRE_MultiblockMatrixInitialize ( HYPRE_MultiblockMatrix matrix ); HYPRE_Int HYPRE_MultiblockMatrixAssemble ( HYPRE_MultiblockMatrix matrix ); void HYPRE_MultiblockMatrixPrint ( HYPRE_MultiblockMatrix matrix ); -HYPRE_Int HYPRE_MultiblockMatrixSetNumSubmatrices ( HYPRE_MultiblockMatrix matrix , HYPRE_Int n ); -HYPRE_Int HYPRE_MultiblockMatrixSetSubmatrixType ( HYPRE_MultiblockMatrix matrix , HYPRE_Int j , HYPRE_Int type ); +HYPRE_Int HYPRE_MultiblockMatrixSetNumSubmatrices ( HYPRE_MultiblockMatrix matrix, HYPRE_Int n ); +HYPRE_Int HYPRE_MultiblockMatrixSetSubmatrixType ( HYPRE_MultiblockMatrix matrix, HYPRE_Int j, + HYPRE_Int type ); /* HYPRE_vector.c */ HYPRE_Vector HYPRE_VectorCreate ( HYPRE_Int size ); HYPRE_Int HYPRE_VectorDestroy ( HYPRE_Vector vector ); HYPRE_Int HYPRE_VectorInitialize ( HYPRE_Vector vector ); -HYPRE_Int HYPRE_VectorPrint ( HYPRE_Vector vector , char *file_name ); +HYPRE_Int HYPRE_VectorPrint ( HYPRE_Vector vector, char *file_name ); HYPRE_Vector HYPRE_VectorRead ( char *file_name ); /* mapped_matrix.c */ @@ -139,11 +236,12 @@ HYPRE_Int hypre_MappedMatrixLimitedDestroy ( hypre_MappedMatrix *matrix ); HYPRE_Int hypre_MappedMatrixInitialize ( hypre_MappedMatrix *matrix ); HYPRE_Int hypre_MappedMatrixAssemble ( hypre_MappedMatrix *matrix ); void hypre_MappedMatrixPrint ( hypre_MappedMatrix *matrix ); -HYPRE_Int hypre_MappedMatrixGetColIndex ( hypre_MappedMatrix *matrix , HYPRE_Int j ); +HYPRE_Int hypre_MappedMatrixGetColIndex ( hypre_MappedMatrix *matrix, HYPRE_Int j ); void *hypre_MappedMatrixGetMatrix ( hypre_MappedMatrix *matrix ); -HYPRE_Int hypre_MappedMatrixSetMatrix ( hypre_MappedMatrix *matrix , void *matrix_data ); -HYPRE_Int hypre_MappedMatrixSetColMap ( hypre_MappedMatrix *matrix , HYPRE_Int (*ColMap )(HYPRE_Int ,void *)); -HYPRE_Int hypre_MappedMatrixSetMapData ( hypre_MappedMatrix *matrix , void *map_data ); +HYPRE_Int hypre_MappedMatrixSetMatrix ( hypre_MappedMatrix *matrix, void *matrix_data ); +HYPRE_Int hypre_MappedMatrixSetColMap ( hypre_MappedMatrix *matrix, HYPRE_Int (*ColMap )(HYPRE_Int, + void *)); +HYPRE_Int hypre_MappedMatrixSetMapData ( hypre_MappedMatrix *matrix, void *map_data ); /* multiblock_matrix.c */ hypre_MultiblockMatrix *hypre_MultiblockMatrixCreate ( void ); @@ -152,76 +250,140 @@ HYPRE_Int hypre_MultiblockMatrixLimitedDestroy ( hypre_MultiblockMatrix *matrix HYPRE_Int hypre_MultiblockMatrixInitialize ( hypre_MultiblockMatrix *matrix ); HYPRE_Int hypre_MultiblockMatrixAssemble ( hypre_MultiblockMatrix *matrix ); void hypre_MultiblockMatrixPrint ( hypre_MultiblockMatrix *matrix ); -HYPRE_Int hypre_MultiblockMatrixSetNumSubmatrices ( hypre_MultiblockMatrix *matrix , HYPRE_Int n ); -HYPRE_Int hypre_MultiblockMatrixSetSubmatrixType ( hypre_MultiblockMatrix *matrix , HYPRE_Int j , HYPRE_Int type ); -HYPRE_Int hypre_MultiblockMatrixSetSubmatrix ( hypre_MultiblockMatrix *matrix , HYPRE_Int j , void *submatrix ); +HYPRE_Int hypre_MultiblockMatrixSetNumSubmatrices ( hypre_MultiblockMatrix *matrix, HYPRE_Int n ); +HYPRE_Int hypre_MultiblockMatrixSetSubmatrixType ( hypre_MultiblockMatrix *matrix, HYPRE_Int j, + HYPRE_Int type ); +HYPRE_Int hypre_MultiblockMatrixSetSubmatrix ( hypre_MultiblockMatrix *matrix, HYPRE_Int j, + void *submatrix ); /* vector.c */ hypre_Vector *hypre_SeqVectorCreate ( HYPRE_Int size ); -hypre_Vector *hypre_SeqMultiVectorCreate ( HYPRE_Int size , HYPRE_Int num_vectors ); +hypre_Vector *hypre_SeqMultiVectorCreate ( HYPRE_Int size, HYPRE_Int num_vectors ); HYPRE_Int hypre_SeqVectorDestroy ( hypre_Vector *vector ); -HYPRE_Int hypre_SeqVectorInitialize_v2( hypre_Vector *vector, HYPRE_MemoryLocation memory_location ); +HYPRE_Int hypre_SeqVectorInitializeShell( hypre_Vector *vector ); +HYPRE_Int hypre_SeqVectorSetData( hypre_Vector *vector, HYPRE_Complex *data ); +HYPRE_Int hypre_SeqVectorInitialize_v2( hypre_Vector *vector, + HYPRE_MemoryLocation memory_location ); HYPRE_Int hypre_SeqVectorInitialize ( hypre_Vector *vector ); -HYPRE_Int hypre_SeqVectorSetDataOwner ( hypre_Vector *vector , HYPRE_Int owns_data ); +HYPRE_Int hypre_SeqVectorSetDataOwner ( hypre_Vector *vector, HYPRE_Int owns_data ); +HYPRE_Int hypre_SeqVectorSetSize ( hypre_Vector *vector, HYPRE_Int size ); +HYPRE_Int hypre_SeqVectorResize ( hypre_Vector *vector, HYPRE_Int num_vectors_in ); hypre_Vector *hypre_SeqVectorRead ( char *file_name ); -HYPRE_Int hypre_SeqVectorPrint ( hypre_Vector *vector , char *file_name ); -HYPRE_Int hypre_SeqVectorSetConstantValues ( hypre_Vector *v , HYPRE_Complex value ); -HYPRE_Int hypre_SeqVectorSetRandomValues ( hypre_Vector *v , HYPRE_Int seed ); -HYPRE_Int hypre_SeqVectorCopy ( hypre_Vector *x , hypre_Vector *y ); +HYPRE_Int hypre_SeqVectorPrint ( hypre_Vector *vector, char *file_name ); +HYPRE_Int hypre_SeqVectorSetConstantValues ( hypre_Vector *v, HYPRE_Complex value ); +HYPRE_Int hypre_SeqVectorSetConstantValuesHost ( hypre_Vector *v, HYPRE_Complex value ); +HYPRE_Int hypre_SeqVectorSetRandomValues ( hypre_Vector *v, HYPRE_Int seed ); +HYPRE_Int hypre_SeqVectorCopy ( hypre_Vector *x, hypre_Vector *y ); +HYPRE_Int hypre_SeqVectorStridedCopy( hypre_Vector *x, HYPRE_Int istride, HYPRE_Int ostride, + HYPRE_Int size, HYPRE_Complex *data); hypre_Vector *hypre_SeqVectorCloneDeep ( hypre_Vector *x ); hypre_Vector *hypre_SeqVectorCloneDeep_v2( hypre_Vector *x, HYPRE_MemoryLocation memory_location ); hypre_Vector *hypre_SeqVectorCloneShallow ( hypre_Vector *x ); +HYPRE_Int hypre_SeqVectorMigrate( hypre_Vector *x, HYPRE_MemoryLocation memory_location ); HYPRE_Int hypre_SeqVectorScale( HYPRE_Complex alpha, hypre_Vector *y ); - -HYPRE_Int hypre_SeqVectorAxpy ( HYPRE_Complex alpha , hypre_Vector *x , hypre_Vector *y ); -HYPRE_Real hypre_SeqVectorInnerProd ( hypre_Vector *x , hypre_Vector *y ); -HYPRE_Int hypre_SeqVectorMassInnerProd(hypre_Vector *x, hypre_Vector **y, HYPRE_Int k, HYPRE_Int unroll, HYPRE_Real *result); -HYPRE_Int hypre_SeqVectorMassInnerProd4(hypre_Vector *x, hypre_Vector **y, HYPRE_Int k, HYPRE_Real *result); -HYPRE_Int hypre_SeqVectorMassInnerProd8(hypre_Vector *x, hypre_Vector **y, HYPRE_Int k, HYPRE_Real *result); -HYPRE_Int hypre_SeqVectorMassDotpTwo(hypre_Vector *x, hypre_Vector *y , hypre_Vector **z, HYPRE_Int k, HYPRE_Int unroll, HYPRE_Real *result_x , HYPRE_Real *result_y); -HYPRE_Int hypre_SeqVectorMassDotpTwo4(hypre_Vector *x, hypre_Vector *y , hypre_Vector **z, HYPRE_Int k, HYPRE_Real *result_x , HYPRE_Real *result_y); -HYPRE_Int hypre_SeqVectorMassDotpTwo8(hypre_Vector *x, hypre_Vector *y , hypre_Vector **z, HYPRE_Int k, HYPRE_Real *result_x , HYPRE_Real *result_y); -HYPRE_Int hypre_SeqVectorMassAxpy(HYPRE_Complex *alpha, hypre_Vector **x, hypre_Vector *y, HYPRE_Int k, HYPRE_Int unroll); -HYPRE_Int hypre_SeqVectorMassAxpy4(HYPRE_Complex *alpha, hypre_Vector **x, hypre_Vector *y, HYPRE_Int k); -HYPRE_Int hypre_SeqVectorMassAxpy8(HYPRE_Complex *alpha, hypre_Vector **x, hypre_Vector *y, HYPRE_Int k); +HYPRE_Int hypre_SeqVectorScaleHost( HYPRE_Complex alpha, hypre_Vector *y ); +HYPRE_Int hypre_SeqVectorAxpy ( HYPRE_Complex alpha, hypre_Vector *x, hypre_Vector *y ); +HYPRE_Int hypre_SeqVectorAxpyHost ( HYPRE_Complex alpha, hypre_Vector *x, hypre_Vector *y ); +HYPRE_Int hypre_SeqVectorAxpyz ( HYPRE_Complex alpha, hypre_Vector *x, + HYPRE_Complex beta, hypre_Vector *y, + hypre_Vector *z ); +HYPRE_Real hypre_SeqVectorInnerProd ( hypre_Vector *x, hypre_Vector *y ); +HYPRE_Real hypre_SeqVectorInnerProdHost ( hypre_Vector *x, hypre_Vector *y ); +HYPRE_Int hypre_SeqVectorMassInnerProd(hypre_Vector *x, hypre_Vector **y, HYPRE_Int k, + HYPRE_Int unroll, HYPRE_Real *result); +HYPRE_Int hypre_SeqVectorMassInnerProd4(hypre_Vector *x, hypre_Vector **y, HYPRE_Int k, + HYPRE_Real *result); +HYPRE_Int hypre_SeqVectorMassInnerProd8(hypre_Vector *x, hypre_Vector **y, HYPRE_Int k, + HYPRE_Real *result); +HYPRE_Int hypre_SeqVectorMassDotpTwo(hypre_Vector *x, hypre_Vector *y, hypre_Vector **z, + HYPRE_Int k, HYPRE_Int unroll, HYPRE_Real *result_x, HYPRE_Real *result_y); +HYPRE_Int hypre_SeqVectorMassDotpTwo4(hypre_Vector *x, hypre_Vector *y, hypre_Vector **z, + HYPRE_Int k, HYPRE_Real *result_x, HYPRE_Real *result_y); +HYPRE_Int hypre_SeqVectorMassDotpTwo8(hypre_Vector *x, hypre_Vector *y, hypre_Vector **z, + HYPRE_Int k, HYPRE_Real *result_x, HYPRE_Real *result_y); +HYPRE_Int hypre_SeqVectorMassAxpy(HYPRE_Complex *alpha, hypre_Vector **x, hypre_Vector *y, + HYPRE_Int k, HYPRE_Int unroll); +HYPRE_Int hypre_SeqVectorMassAxpy4(HYPRE_Complex *alpha, hypre_Vector **x, hypre_Vector *y, + HYPRE_Int k); +HYPRE_Int hypre_SeqVectorMassAxpy8(HYPRE_Complex *alpha, hypre_Vector **x, hypre_Vector *y, + HYPRE_Int k); HYPRE_Complex hypre_SeqVectorSumElts ( hypre_Vector *vector ); -HYPRE_Int hypre_SeqVectorPrefetch(hypre_Vector *x, HYPRE_MemoryLocation memory_location); +HYPRE_Complex hypre_SeqVectorSumEltsHost ( hypre_Vector *vector ); //HYPRE_Int hypre_SeqVectorMax( HYPRE_Complex alpha, hypre_Vector *x, HYPRE_Complex beta, hypre_Vector *y ); -HYPRE_Int hypreDevice_CSRSpAdd(HYPRE_Int ma, HYPRE_Int mb, HYPRE_Int n, HYPRE_Int nnzA, HYPRE_Int nnzB, HYPRE_Int *d_ia, HYPRE_Int *d_ja, HYPRE_Complex alpha, HYPRE_Complex *d_aa, HYPRE_Int *d_ja_map, HYPRE_Int *d_ib, HYPRE_Int *d_jb, HYPRE_Complex beta, HYPRE_Complex *d_ab, HYPRE_Int *d_jb_map, HYPRE_Int *d_num_b, HYPRE_Int *nnzC_out, HYPRE_Int **d_ic_out, HYPRE_Int **d_jc_out, HYPRE_Complex **d_ac_out); - -HYPRE_Int hypreDevice_CSRSpTrans(HYPRE_Int m, HYPRE_Int n, HYPRE_Int nnzA, HYPRE_Int *d_ia, HYPRE_Int *d_ja, HYPRE_Complex *d_aa, HYPRE_Int **d_ic_out, HYPRE_Int **d_jc_out, HYPRE_Complex **d_ac_out, HYPRE_Int want_data); +HYPRE_Int hypreDevice_CSRSpAdd(HYPRE_Int ma, HYPRE_Int mb, HYPRE_Int nnzA, + HYPRE_Int nnzB, HYPRE_Int *d_ia, HYPRE_Int *d_ja, HYPRE_Complex alpha, HYPRE_Complex *d_aa, + HYPRE_Int *d_ja_map, HYPRE_Int *d_ib, HYPRE_Int *d_jb, HYPRE_Complex beta, HYPRE_Complex *d_ab, + HYPRE_Int *d_jb_map, HYPRE_Int *d_num_b, HYPRE_Int *nnzC_out, HYPRE_Int **d_ic_out, + HYPRE_Int **d_jc_out, HYPRE_Complex **d_ac_out); -HYPRE_Int hypreDevice_CSRSpTransCusparse(HYPRE_Int m, HYPRE_Int n, HYPRE_Int nnzA, HYPRE_Int *d_ia, HYPRE_Int *d_ja, HYPRE_Complex *d_aa, HYPRE_Int **d_ic_out, HYPRE_Int **d_jc_out, HYPRE_Complex **d_ac_out, HYPRE_Int want_data); - -HYPRE_Int hypreDevice_CSRSpTransRocsparse(HYPRE_Int m, HYPRE_Int n, HYPRE_Int nnzA, HYPRE_Int *d_ia, HYPRE_Int *d_ja, HYPRE_Complex *d_aa, HYPRE_Int **d_ic_out, HYPRE_Int **d_jc_out, HYPRE_Complex **d_ac_out, HYPRE_Int want_data); - -HYPRE_Int hypreDevice_CSRSpGemm(hypre_CSRMatrix *A, hypre_CSRMatrix *B, hypre_CSRMatrix **C_ptr); +HYPRE_Int hypreDevice_CSRSpTrans(HYPRE_Int m, HYPRE_Int n, HYPRE_Int nnzA, HYPRE_Int *d_ia, + HYPRE_Int *d_ja, HYPRE_Complex *d_aa, HYPRE_Int **d_ic_out, HYPRE_Int **d_jc_out, + HYPRE_Complex **d_ac_out, HYPRE_Int want_data); -HYPRE_Int hypreDevice_CSRSpGemmRownnzEstimate(HYPRE_Int m, HYPRE_Int k, HYPRE_Int n, HYPRE_Int *d_ia, HYPRE_Int *d_ja, HYPRE_Int *d_ib, HYPRE_Int *d_jb, HYPRE_Int *d_rc); +HYPRE_Int hypreDevice_CSRSpTransCusparse(HYPRE_Int m, HYPRE_Int n, HYPRE_Int nnzA, HYPRE_Int *d_ia, + HYPRE_Int *d_ja, HYPRE_Complex *d_aa, HYPRE_Int **d_ic_out, HYPRE_Int **d_jc_out, + HYPRE_Complex **d_ac_out, HYPRE_Int want_data); -HYPRE_Int hypreDevice_CSRSpGemmRownnzUpperbound(HYPRE_Int m, HYPRE_Int k, HYPRE_Int n, HYPRE_Int *d_ia, HYPRE_Int *d_ja, HYPRE_Int *d_ib, HYPRE_Int *d_jb, HYPRE_Int in_rc, HYPRE_Int *d_rc, HYPRE_Int *d_rf); +HYPRE_Int hypreDevice_CSRSpTransRocsparse(HYPRE_Int m, HYPRE_Int n, HYPRE_Int nnzA, HYPRE_Int *d_ia, + HYPRE_Int *d_ja, HYPRE_Complex *d_aa, HYPRE_Int **d_ic_out, HYPRE_Int **d_jc_out, + HYPRE_Complex **d_ac_out, HYPRE_Int want_data); -HYPRE_Int hypreDevice_CSRSpGemmRownnz(HYPRE_Int m, HYPRE_Int k, HYPRE_Int n, HYPRE_Int *d_ia, HYPRE_Int *d_ja, HYPRE_Int *d_ib, HYPRE_Int *d_jb, HYPRE_Int in_rc, HYPRE_Int *d_rc); +HYPRE_Int hypreDevice_CSRSpTransOnemklsparse(HYPRE_Int m, HYPRE_Int n, HYPRE_Int nnzA, + HYPRE_Int *d_ia, HYPRE_Int *d_ja, HYPRE_Complex *d_aa, HYPRE_Int **d_ic_out, HYPRE_Int **d_jc_out, + HYPRE_Complex **d_ac_out, HYPRE_Int want_data); -HYPRE_Int hypreDevice_CSRSpGemmNumerWithRownnzUpperbound(HYPRE_Int m, HYPRE_Int k, HYPRE_Int n, HYPRE_Int *d_ia, HYPRE_Int *d_ja, HYPRE_Complex *d_a, HYPRE_Int *d_ib, HYPRE_Int *d_jb, HYPRE_Complex *d_b, HYPRE_Int *d_rc, HYPRE_Int exact_rownnz, HYPRE_Int **d_ic_out, HYPRE_Int **d_jc_out, HYPRE_Complex **d_c_out, HYPRE_Int *nnzC); - -HYPRE_Int hypreDevice_CSRSpGemmNumerWithRownnzEstimate(HYPRE_Int m, HYPRE_Int k, HYPRE_Int n, HYPRE_Int *d_ia, HYPRE_Int *d_ja, HYPRE_Complex *d_a, HYPRE_Int *d_ib, HYPRE_Int *d_jb, HYPRE_Complex *d_b, HYPRE_Int *d_rc, HYPRE_Int **d_ic_out, HYPRE_Int **d_jc_out, HYPRE_Complex **d_c_out, HYPRE_Int *nnzC); +HYPRE_Int hypreDevice_CSRSpGemm(hypre_CSRMatrix *A, hypre_CSRMatrix *B, hypre_CSRMatrix **C_ptr); -HYPRE_Int hypreDevice_CSRSpGemmCusparseGenericAPI(HYPRE_Int m, HYPRE_Int k, HYPRE_Int n, HYPRE_Int nnzA, HYPRE_Int *d_ia, HYPRE_Int *d_ja, HYPRE_Complex *d_a, HYPRE_Int nnzB, HYPRE_Int *d_ib, HYPRE_Int *d_jb, HYPRE_Complex *d_b, HYPRE_Int *nnzC_out, HYPRE_Int **d_ic_out, HYPRE_Int **d_jc_out, HYPRE_Complex **d_c_out); +HYPRE_Int hypreDevice_CSRSpGemmCusparseGenericAPI(HYPRE_Int m, HYPRE_Int k, HYPRE_Int n, + HYPRE_Int nnzA, HYPRE_Int *d_ia, HYPRE_Int *d_ja, HYPRE_Complex *d_a, HYPRE_Int nnzB, + HYPRE_Int *d_ib, HYPRE_Int *d_jb, HYPRE_Complex *d_b, HYPRE_Int *nnzC_out, HYPRE_Int **d_ic_out, + HYPRE_Int **d_jc_out, HYPRE_Complex **d_c_out); HYPRE_Int hypre_SeqVectorElmdivpy( hypre_Vector *x, hypre_Vector *b, hypre_Vector *y ); -HYPRE_Int hypre_SeqVectorElmdivpyMarked( hypre_Vector *x, hypre_Vector *b, hypre_Vector *y, HYPRE_Int *marker, HYPRE_Int marker_val ); +HYPRE_Int hypre_SeqVectorElmdivpyMarked( hypre_Vector *x, hypre_Vector *b, hypre_Vector *y, + HYPRE_Int *marker, HYPRE_Int marker_val ); +HYPRE_Int hypre_SeqVectorElmdivpyHost( hypre_Vector *x, hypre_Vector *b, hypre_Vector *y, + HYPRE_Int *marker, HYPRE_Int marker_val ); +HYPRE_Int hypre_CSRMatrixSpMVDevice( HYPRE_Int trans, HYPRE_Complex alpha, hypre_CSRMatrix *A, + hypre_Vector *x, + HYPRE_Complex beta, hypre_Vector *y, HYPRE_Int fill ); -HYPRE_Int hypre_CSRMatrixSpMVDevice( HYPRE_Complex alpha, hypre_CSRMatrix *A, hypre_Vector *x, HYPRE_Complex beta, hypre_Vector *y, HYPRE_Int fill ); +HYPRE_Int hypre_CSRMatrixIntSpMVDevice( HYPRE_Int num_rows, HYPRE_Int num_nonzeros, + HYPRE_Int alpha, HYPRE_Int *d_ia, HYPRE_Int *d_ja, + HYPRE_Int *d_a, HYPRE_Int *d_x, HYPRE_Int beta, + HYPRE_Int *d_y ); -#if defined(HYPRE_USING_CUSPARSE) || defined(HYPRE_USING_ROCSPARSE) +#if defined(HYPRE_USING_CUSPARSE) ||\ + defined(HYPRE_USING_ROCSPARSE) ||\ + defined(HYPRE_USING_ONEMKLSPARSE) hypre_CsrsvData* hypre_CsrsvDataCreate(); -void hypre_CsrsvDataDestroy(hypre_CsrsvData *data); +HYPRE_Int hypre_CsrsvDataDestroy(hypre_CsrsvData *data); hypre_GpuMatData* hypre_GpuMatDataCreate(); -void hypre_GpuMatDataDestroy(hypre_GpuMatData *data); +HYPRE_Int hypre_GPUMatDataSetCSRData(hypre_CSRMatrix *matrix); +HYPRE_Int hypre_GpuMatDataDestroy(hypre_GpuMatData *data); hypre_GpuMatData* hypre_CSRMatrixGetGPUMatData(hypre_CSRMatrix *matrix); -#define hypre_CSRMatrixGPUMatDescr(matrix) ( hypre_GpuMatDataMatDecsr(hypre_CSRMatrixGetGPUMatData(matrix)) ) -#define hypre_CSRMatrixGPUMatInfo(matrix) ( hypre_GpuMatDataMatInfo (hypre_CSRMatrixGetGPUMatData(matrix)) ) + +#define hypre_CSRMatrixGPUMatDescr(matrix) ( hypre_GpuMatDataMatDescr(hypre_CSRMatrixGetGPUMatData(matrix)) ) +#define hypre_CSRMatrixGPUMatInfo(matrix) ( hypre_GpuMatDataMatInfo (hypre_CSRMatrixGetGPUMatData(matrix)) ) +#define hypre_CSRMatrixGPUMatHandle(matrix) ( hypre_GpuMatDataMatHandle (hypre_CSRMatrixGetGPUMatData(matrix)) ) +#define hypre_CSRMatrixGPUMatSpMVBuffer(matrix) ( hypre_GpuMatDataSpMVBuffer (hypre_CSRMatrixGetGPUMatData(matrix)) ) #endif -void hypre_CSRMatrixGpuSpMVAnalysis(hypre_CSRMatrix *matrix); + +HYPRE_Int hypre_CSRMatrixSpMVAnalysisDevice(hypre_CSRMatrix *matrix); + +/* vector_device.c */ +HYPRE_Int hypre_SeqVectorSetConstantValuesDevice ( hypre_Vector *v, HYPRE_Complex value ); +HYPRE_Int hypre_SeqVectorScaleDevice( HYPRE_Complex alpha, hypre_Vector *y ); +HYPRE_Int hypre_SeqVectorAxpyDevice ( HYPRE_Complex alpha, hypre_Vector *x, hypre_Vector *y ); +HYPRE_Int hypre_SeqVectorAxpyzDevice ( HYPRE_Complex alpha, hypre_Vector *x, + HYPRE_Complex beta, hypre_Vector *y, + hypre_Vector *z ); +HYPRE_Int hypre_SeqVectorElmdivpyDevice( hypre_Vector *x, hypre_Vector *b, hypre_Vector *y, + HYPRE_Int *marker, HYPRE_Int marker_val ); +HYPRE_Real hypre_SeqVectorInnerProdDevice ( hypre_Vector *x, hypre_Vector *y ); +HYPRE_Complex hypre_SeqVectorSumEltsDevice ( hypre_Vector *vector ); +HYPRE_Int hypre_SeqVectorStridedCopyDevice( hypre_Vector *vector, + HYPRE_Int istride, HYPRE_Int ostride, + HYPRE_Int size, HYPRE_Complex *data ); +HYPRE_Int hypre_SeqVectorPrefetch(hypre_Vector *x, HYPRE_MemoryLocation memory_location); diff --git a/external/hypre/src/seq_mv/seq_mv.h b/external/hypre/src/seq_mv/seq_mv.h index e5f9cab9..5c1fe7c7 100644 --- a/external/hypre/src/seq_mv/seq_mv.h +++ b/external/hypre/src/seq_mv/seq_mv.h @@ -19,7 +19,7 @@ extern "C" { #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -36,12 +36,12 @@ extern "C" { #ifndef hypre_CSR_MATRIX_HEADER #define hypre_CSR_MATRIX_HEADER -#if defined(HYPRE_USING_CUSPARSE) || defined(HYPRE_USING_ROCSPARSE) +#if defined(HYPRE_USING_CUSPARSE) ||\ + defined(HYPRE_USING_ROCSPARSE) ||\ + defined(HYPRE_USING_ONEMKLSPARSE) struct hypre_CsrsvData; typedef struct hypre_CsrsvData hypre_CsrsvData; -#endif -#if defined(HYPRE_USING_CUSPARSE) || defined(HYPRE_USING_ROCSPARSE) struct hypre_GpuMatData; typedef struct hypre_GpuMatData hypre_GpuMatData; #endif @@ -61,15 +61,19 @@ typedef struct hypre_int *i_short; hypre_int *j_short; HYPRE_Int owns_data; /* Does the CSRMatrix create/destroy `data', `i', `j'? */ + HYPRE_Int pattern_only; /* 1: data array is ignored, and assumed to be all 1's */ HYPRE_Complex *data; HYPRE_Int *rownnz; /* for compressing rows in matrix multiplication */ HYPRE_Int num_rownnz; HYPRE_MemoryLocation memory_location; /* memory location of arrays i, j, data */ -#if defined(HYPRE_USING_CUSPARSE) || defined(HYPRE_USING_ROCSPARSE) + +#if defined(HYPRE_USING_CUSPARSE) ||\ + defined(HYPRE_USING_ROCSPARSE) ||\ + defined(HYPRE_USING_ONEMKLSPARSE) HYPRE_Int *sorted_j; /* some cusparse routines require sorted CSR */ HYPRE_Complex *sorted_data; hypre_CsrsvData *csrsv_data; - hypre_GpuMatData *mat_data; + hypre_GpuMatData *mat_data; #endif } hypre_CSRMatrix; @@ -87,9 +91,12 @@ typedef struct #define hypre_CSRMatrixRownnz(matrix) ((matrix) -> rownnz) #define hypre_CSRMatrixNumRownnz(matrix) ((matrix) -> num_rownnz) #define hypre_CSRMatrixOwnsData(matrix) ((matrix) -> owns_data) +#define hypre_CSRMatrixPatternOnly(matrix) ((matrix) -> pattern_only) #define hypre_CSRMatrixMemoryLocation(matrix) ((matrix) -> memory_location) -#if defined(HYPRE_USING_CUSPARSE) || defined(HYPRE_USING_ROCSPARSE) +#if defined(HYPRE_USING_CUSPARSE) ||\ + defined(HYPRE_USING_ROCSPARSE) ||\ + defined(HYPRE_USING_ONEMKLSPARSE) #define hypre_CSRMatrixSortedJ(matrix) ((matrix) -> sorted_j) #define hypre_CSRMatrixSortedData(matrix) ((matrix) -> sorted_data) #define hypre_CSRMatrixCsrsvData(matrix) ((matrix) -> csrsv_data) @@ -128,9 +135,8 @@ typedef struct #define hypre_CSRBooleanMatrix_Get_OwnsData(matrix) ((matrix)->owns_data) #endif - /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -171,7 +177,7 @@ typedef struct #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -214,7 +220,7 @@ typedef struct #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -235,14 +241,12 @@ typedef struct typedef struct { - HYPRE_Complex *data; - HYPRE_Int size; - - /* Does the Vector create/destroy `data'? */ - HYPRE_Int owns_data; - - /* memory location of array data */ - HYPRE_MemoryLocation memory_location; + HYPRE_Complex *data; + HYPRE_Int size; /* Number of elements of a single vector component */ + HYPRE_Int component; /* Index of a multivector component + (used for set/get routines )*/ + HYPRE_Int owns_data; /* Does the Vector create/destroy `data'? */ + HYPRE_MemoryLocation memory_location; /* memory location of data array */ /* For multivectors...*/ HYPRE_Int num_vectors; /* the above "size" is size of one vector */ @@ -261,118 +265,216 @@ typedef struct #define hypre_VectorData(vector) ((vector) -> data) #define hypre_VectorSize(vector) ((vector) -> size) +#define hypre_VectorComponent(vector) ((vector) -> component) #define hypre_VectorOwnsData(vector) ((vector) -> owns_data) #define hypre_VectorMemoryLocation(vector) ((vector) -> memory_location) #define hypre_VectorNumVectors(vector) ((vector) -> num_vectors) #define hypre_VectorMultiVecStorageMethod(vector) ((vector) -> multivec_storage_method) -#define hypre_VectorVectorStride(vector) ((vector) -> vecstride ) -#define hypre_VectorIndexStride(vector) ((vector) -> idxstride ) +#define hypre_VectorVectorStride(vector) ((vector) -> vecstride) +#define hypre_VectorIndexStride(vector) ((vector) -> idxstride) +#define hypre_VectorEntryI(vector, i) ((vector) -> data[i]) +#define hypre_VectorEntryIJ(vector, i, j) \ + ((vector) -> data[((vector) -> vecstride) * j + ((vector) -> idxstride) * i]) #endif - /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ +/* csr_filter.c */ +HYPRE_Int hypre_CSRMatrixTruncateDiag(hypre_CSRMatrix *A); + /* csr_matop.c */ -HYPRE_Int hypre_CSRMatrixAddFirstPass ( HYPRE_Int firstrow , HYPRE_Int lastrow , HYPRE_Int *marker , HYPRE_Int *twspace , HYPRE_Int *map_A2C , HYPRE_Int *map_B2C , hypre_CSRMatrix *A , hypre_CSRMatrix *B , HYPRE_Int nnzrows_C , HYPRE_Int nrows_C , HYPRE_Int ncols_C , HYPRE_Int *rownnz_C , HYPRE_MemoryLocation memory_location_C , HYPRE_Int *C_i , hypre_CSRMatrix **C_ptr ); -HYPRE_Int hypre_CSRMatrixAddSecondPass ( HYPRE_Int firstrow , HYPRE_Int lastrow , HYPRE_Int *marker, HYPRE_Int *twspace , HYPRE_Int *map_A2C , HYPRE_Int *map_B2C , HYPRE_Int *rownnz_C , HYPRE_Complex alpha , HYPRE_Complex beta , hypre_CSRMatrix *A , hypre_CSRMatrix *B , hypre_CSRMatrix *C); -hypre_CSRMatrix *hypre_CSRMatrixAddHost ( HYPRE_Complex alpha, hypre_CSRMatrix *A, HYPRE_Complex beta, hypre_CSRMatrix *B ); -hypre_CSRMatrix *hypre_CSRMatrixAdd ( HYPRE_Complex alpha, hypre_CSRMatrix *A, HYPRE_Complex beta, hypre_CSRMatrix *B ); -hypre_CSRMatrix *hypre_CSRMatrixBigAdd ( hypre_CSRMatrix *A , hypre_CSRMatrix *B ); -hypre_CSRMatrix *hypre_CSRMatrixMultiplyHost ( hypre_CSRMatrix *A , hypre_CSRMatrix *B ); -hypre_CSRMatrix *hypre_CSRMatrixMultiply ( hypre_CSRMatrix *A , hypre_CSRMatrix *B ); -hypre_CSRMatrix *hypre_CSRMatrixDeleteZeros ( hypre_CSRMatrix *A , HYPRE_Real tol ); -HYPRE_Int hypre_CSRMatrixTransposeHost ( hypre_CSRMatrix *A , hypre_CSRMatrix **AT , HYPRE_Int data ); -HYPRE_Int hypre_CSRMatrixTranspose ( hypre_CSRMatrix *A , hypre_CSRMatrix **AT , HYPRE_Int data ); +HYPRE_Int hypre_CSRMatrixAddFirstPass ( HYPRE_Int firstrow, HYPRE_Int lastrow, HYPRE_Int *marker, + HYPRE_Int *twspace, HYPRE_Int *map_A2C, HYPRE_Int *map_B2C, + hypre_CSRMatrix *A, hypre_CSRMatrix *B, + HYPRE_Int nnzrows_C, HYPRE_Int nrows_C, HYPRE_Int ncols_C, + HYPRE_Int *rownnz_C, + HYPRE_MemoryLocation memory_location_C, + HYPRE_Int *C_i, hypre_CSRMatrix **C_ptr ); +HYPRE_Int hypre_CSRMatrixAddSecondPass ( HYPRE_Int firstrow, HYPRE_Int lastrow, HYPRE_Int *marker, + HYPRE_Int *map_A2C, HYPRE_Int *map_B2C, + HYPRE_Int *rownnz_C, HYPRE_Complex alpha, + HYPRE_Complex beta, hypre_CSRMatrix *A, + hypre_CSRMatrix *B, hypre_CSRMatrix *C); +hypre_CSRMatrix *hypre_CSRMatrixAddHost ( HYPRE_Complex alpha, hypre_CSRMatrix *A, + HYPRE_Complex beta, hypre_CSRMatrix *B ); +hypre_CSRMatrix *hypre_CSRMatrixAdd ( HYPRE_Complex alpha, hypre_CSRMatrix *A, HYPRE_Complex beta, + hypre_CSRMatrix *B ); +hypre_CSRMatrix *hypre_CSRMatrixBigAdd ( hypre_CSRMatrix *A, hypre_CSRMatrix *B ); +hypre_CSRMatrix *hypre_CSRMatrixMultiplyHost ( hypre_CSRMatrix *A, hypre_CSRMatrix *B ); +hypre_CSRMatrix *hypre_CSRMatrixMultiply ( hypre_CSRMatrix *A, hypre_CSRMatrix *B ); +hypre_CSRMatrix *hypre_CSRMatrixDeleteZeros ( hypre_CSRMatrix *A, HYPRE_Real tol ); +HYPRE_Int hypre_CSRMatrixTransposeHost ( hypre_CSRMatrix *A, hypre_CSRMatrix **AT, HYPRE_Int data ); +HYPRE_Int hypre_CSRMatrixTranspose ( hypre_CSRMatrix *A, hypre_CSRMatrix **AT, HYPRE_Int data ); HYPRE_Int hypre_CSRMatrixReorder ( hypre_CSRMatrix *A ); HYPRE_Complex hypre_CSRMatrixSumElts ( hypre_CSRMatrix *A ); HYPRE_Real hypre_CSRMatrixFnorm( hypre_CSRMatrix *A ); -HYPRE_Int hypre_CSRMatrixSplit(hypre_CSRMatrix *Bs_ext, HYPRE_BigInt first_col_diag_B, HYPRE_BigInt last_col_diag_B, HYPRE_Int num_cols_offd_B, HYPRE_BigInt *col_map_offd_B, HYPRE_Int *num_cols_offd_C_ptr, HYPRE_BigInt **col_map_offd_C_ptr, hypre_CSRMatrix **Bext_diag_ptr, hypre_CSRMatrix **Bext_offd_ptr); -hypre_CSRMatrix * hypre_CSRMatrixAddPartial( hypre_CSRMatrix *A, hypre_CSRMatrix *B, HYPRE_Int *row_nums); -void hypre_CSRMatrixComputeRowSum( hypre_CSRMatrix *A, HYPRE_Int *CF_i, HYPRE_Int *CF_j, HYPRE_Complex *row_sum, HYPRE_Int type, HYPRE_Complex scal, const char *set_or_add); -void hypre_CSRMatrixExtractDiagonal( hypre_CSRMatrix *A, HYPRE_Complex *d, HYPRE_Int type); -void hypre_CSRMatrixExtractDiagonalHost( hypre_CSRMatrix *A, HYPRE_Complex *d, HYPRE_Int type); +HYPRE_Int hypre_CSRMatrixSplit(hypre_CSRMatrix *Bs_ext, HYPRE_BigInt first_col_diag_B, + HYPRE_BigInt last_col_diag_B, HYPRE_Int num_cols_offd_B, HYPRE_BigInt *col_map_offd_B, + HYPRE_Int *num_cols_offd_C_ptr, HYPRE_BigInt **col_map_offd_C_ptr, hypre_CSRMatrix **Bext_diag_ptr, + hypre_CSRMatrix **Bext_offd_ptr); +hypre_CSRMatrix * hypre_CSRMatrixAddPartial( hypre_CSRMatrix *A, hypre_CSRMatrix *B, + HYPRE_Int *row_nums); +void hypre_CSRMatrixComputeRowSumHost( hypre_CSRMatrix *A, HYPRE_Int *CF_i, HYPRE_Int *CF_j, + HYPRE_Complex *row_sum, HYPRE_Int type, HYPRE_Complex scal, const char *set_or_add); +void hypre_CSRMatrixComputeRowSum( hypre_CSRMatrix *A, HYPRE_Int *CF_i, HYPRE_Int *CF_j, + HYPRE_Complex *row_sum, HYPRE_Int type, HYPRE_Complex scal, const char *set_or_add); +HYPRE_Int hypre_CSRMatrixExtractDiagonal( hypre_CSRMatrix *A, HYPRE_Complex *d, HYPRE_Int type); +HYPRE_Int hypre_CSRMatrixExtractDiagonalHost( hypre_CSRMatrix *A, HYPRE_Complex *d, HYPRE_Int type); HYPRE_Int hypre_CSRMatrixScale(hypre_CSRMatrix *A, HYPRE_Complex scalar); HYPRE_Int hypre_CSRMatrixSetConstantValues( hypre_CSRMatrix *A, HYPRE_Complex value); +HYPRE_Int hypre_CSRMatrixDiagScale( hypre_CSRMatrix *A, hypre_Vector *ld, hypre_Vector *rd); /* csr_matop_device.c */ -hypre_CSRMatrix *hypre_CSRMatrixAddDevice ( HYPRE_Complex alpha, hypre_CSRMatrix *A, HYPRE_Complex beta, hypre_CSRMatrix *B ); -hypre_CSRMatrix *hypre_CSRMatrixMultiplyDevice ( hypre_CSRMatrix *A , hypre_CSRMatrix *B ); -hypre_CSRMatrix *hypre_CSRMatrixTripleMultiplyDevice ( hypre_CSRMatrix *A, hypre_CSRMatrix *B, hypre_CSRMatrix *C ); -HYPRE_Int hypre_CSRMatrixSplitDevice_core( HYPRE_Int job, HYPRE_Int num_rows, HYPRE_Int B_ext_nnz, HYPRE_Int *B_ext_ii, HYPRE_BigInt *B_ext_bigj, HYPRE_Complex *B_ext_data, char *B_ext_xata, HYPRE_BigInt first_col_diag_B, HYPRE_BigInt last_col_diag_B, HYPRE_Int num_cols_offd_B, HYPRE_BigInt *col_map_offd_B, HYPRE_Int **map_B_to_C_ptr, HYPRE_Int *num_cols_offd_C_ptr, HYPRE_BigInt **col_map_offd_C_ptr, HYPRE_Int *B_ext_diag_nnz_ptr, HYPRE_Int *B_ext_diag_ii, HYPRE_Int *B_ext_diag_j, HYPRE_Complex *B_ext_diag_data, char *B_ext_diag_xata, HYPRE_Int *B_ext_offd_nnz_ptr, HYPRE_Int *B_ext_offd_ii, HYPRE_Int *B_ext_offd_j, HYPRE_Complex *B_ext_offd_data, char *B_ext_offd_xata ); -HYPRE_Int hypre_CSRMatrixSplitDevice(hypre_CSRMatrix *B_ext, HYPRE_BigInt first_col_diag_B, HYPRE_BigInt last_col_diag_B, HYPRE_Int num_cols_offd_B, HYPRE_BigInt *col_map_offd_B, HYPRE_Int **map_B_to_C_ptr, HYPRE_Int *num_cols_offd_C_ptr, HYPRE_BigInt **col_map_offd_C_ptr, hypre_CSRMatrix **B_ext_diag_ptr, hypre_CSRMatrix **B_ext_offd_ptr); -HYPRE_Int hypre_CSRMatrixTransposeDevice ( hypre_CSRMatrix *A , hypre_CSRMatrix **AT , HYPRE_Int data ); -hypre_CSRMatrix* hypre_CSRMatrixAddPartialDevice( hypre_CSRMatrix *A, hypre_CSRMatrix *B, HYPRE_Int *row_nums); +hypre_CSRMatrix *hypre_CSRMatrixAddDevice ( HYPRE_Complex alpha, hypre_CSRMatrix *A, + HYPRE_Complex beta, hypre_CSRMatrix *B ); +hypre_CSRMatrix *hypre_CSRMatrixMultiplyDevice ( hypre_CSRMatrix *A, hypre_CSRMatrix *B ); +hypre_CSRMatrix *hypre_CSRMatrixTripleMultiplyDevice ( hypre_CSRMatrix *A, hypre_CSRMatrix *B, + hypre_CSRMatrix *C ); +HYPRE_Int hypre_CSRMatrixMergeColMapOffd( HYPRE_Int num_cols_offd_B, HYPRE_BigInt *col_map_offd_B, + HYPRE_Int B_ext_offd_nnz, HYPRE_BigInt *B_ext_offd_bigj, HYPRE_Int *num_cols_offd_C_ptr, + HYPRE_BigInt **col_map_offd_C_ptr, HYPRE_Int **map_B_to_C_ptr ); +HYPRE_Int hypre_CSRMatrixSplitDevice_core( HYPRE_Int job, HYPRE_Int num_rows, HYPRE_Int B_ext_nnz, + HYPRE_Int *B_ext_ii, HYPRE_BigInt *B_ext_bigj, HYPRE_Complex *B_ext_data, char *B_ext_xata, + HYPRE_BigInt first_col_diag_B, HYPRE_BigInt last_col_diag_B, HYPRE_Int num_cols_offd_B, + HYPRE_BigInt *col_map_offd_B, HYPRE_Int **map_B_to_C_ptr, HYPRE_Int *num_cols_offd_C_ptr, + HYPRE_BigInt **col_map_offd_C_ptr, HYPRE_Int *B_ext_diag_nnz_ptr, HYPRE_Int *B_ext_diag_ii, + HYPRE_Int *B_ext_diag_j, HYPRE_Complex *B_ext_diag_data, char *B_ext_diag_xata, + HYPRE_Int *B_ext_offd_nnz_ptr, HYPRE_Int *B_ext_offd_ii, HYPRE_Int *B_ext_offd_j, + HYPRE_Complex *B_ext_offd_data, char *B_ext_offd_xata ); +HYPRE_Int hypre_CSRMatrixSplitDevice(hypre_CSRMatrix *B_ext, HYPRE_BigInt first_col_diag_B, + HYPRE_BigInt last_col_diag_B, HYPRE_Int num_cols_offd_B, HYPRE_BigInt *col_map_offd_B, + HYPRE_Int **map_B_to_C_ptr, HYPRE_Int *num_cols_offd_C_ptr, HYPRE_BigInt **col_map_offd_C_ptr, + hypre_CSRMatrix **B_ext_diag_ptr, hypre_CSRMatrix **B_ext_offd_ptr); +HYPRE_Int hypre_CSRMatrixTransposeDevice ( hypre_CSRMatrix *A, hypre_CSRMatrix **AT, + HYPRE_Int data ); +hypre_CSRMatrix* hypre_CSRMatrixAddPartialDevice( hypre_CSRMatrix *A, hypre_CSRMatrix *B, + HYPRE_Int *row_nums); HYPRE_Int hypre_CSRMatrixColNNzRealDevice( hypre_CSRMatrix *A, HYPRE_Real *colnnz); HYPRE_Int hypre_CSRMatrixMoveDiagFirstDevice( hypre_CSRMatrix *A ); HYPRE_Int hypre_CSRMatrixCheckDiagFirstDevice( hypre_CSRMatrix *A ); -HYPRE_Int hypre_CSRMatrixFixZeroDiagDevice( hypre_CSRMatrix *A, HYPRE_Complex v, HYPRE_Real tol ); -HYPRE_Int hypre_CSRMatrixReplaceDiagDevice( hypre_CSRMatrix *A, HYPRE_Complex *new_diag, HYPRE_Complex v, HYPRE_Real tol ); -void hypre_CSRMatrixComputeRowSumDevice( hypre_CSRMatrix *A, HYPRE_Int *CF_i, HYPRE_Int *CF_j, HYPRE_Complex *row_sum, HYPRE_Int type, HYPRE_Complex scal, const char *set_or_add); -void hypre_CSRMatrixExtractDiagonalDevice( hypre_CSRMatrix *A, HYPRE_Complex *d, HYPRE_Int type); +HYPRE_Int hypre_CSRMatrixCheckForMissingDiagonal( hypre_CSRMatrix *A ); +HYPRE_Int hypre_CSRMatrixReplaceDiagDevice( hypre_CSRMatrix *A, HYPRE_Complex *new_diag, + HYPRE_Complex v, HYPRE_Real tol ); +HYPRE_Int hypre_CSRMatrixComputeRowSumDevice( hypre_CSRMatrix *A, HYPRE_Int *CF_i, HYPRE_Int *CF_j, + HYPRE_Complex *row_sum, HYPRE_Int type, + HYPRE_Complex scal, const char *set_or_add ); +HYPRE_Int hypre_CSRMatrixExtractDiagonalDevice( hypre_CSRMatrix *A, HYPRE_Complex *d, + HYPRE_Int type ); hypre_CSRMatrix* hypre_CSRMatrixStack2Device(hypre_CSRMatrix *A, hypre_CSRMatrix *B); hypre_CSRMatrix* hypre_CSRMatrixIdentityDevice(HYPRE_Int n, HYPRE_Complex alp); +hypre_CSRMatrix* hypre_CSRMatrixDiagMatrixFromVectorDevice(HYPRE_Int n, HYPRE_Complex *v); +hypre_CSRMatrix* hypre_CSRMatrixDiagMatrixFromMatrixDevice(hypre_CSRMatrix *A, HYPRE_Int type); HYPRE_Int hypre_CSRMatrixRemoveDiagonalDevice(hypre_CSRMatrix *A); -HYPRE_Int hypre_CSRMatrixDropSmallEntriesDevice( hypre_CSRMatrix *A, HYPRE_Real tol, HYPRE_Real *elmt_tols); +HYPRE_Int hypre_CSRMatrixDropSmallEntriesDevice( hypre_CSRMatrix *A, HYPRE_Real tol, + HYPRE_Real *elmt_tols); +HYPRE_Int hypre_CSRMatrixPermuteDevice( hypre_CSRMatrix *A, HYPRE_Int *perm, + HYPRE_Int *rqperm, hypre_CSRMatrix *B ); HYPRE_Int hypre_CSRMatrixSortRow(hypre_CSRMatrix *A); -HYPRE_Int hypre_CSRMatrixTriLowerUpperSolveDevice(char uplo, hypre_CSRMatrix *A, HYPRE_Real *l1_norms, hypre_Vector *f, hypre_Vector *u ); -HYPRE_Int hypre_CSRMatrixTriLowerUpperSolveRocsparse(char uplo, hypre_CSRMatrix *A, HYPRE_Real *l1_norms, hypre_Vector *f, hypre_Vector *u ); -HYPRE_Int hypre_CSRMatrixTriLowerUpperSolveCusparse(char uplo, hypre_CSRMatrix *A, HYPRE_Real *l1_norms, hypre_Vector *f, hypre_Vector *u ); -HYPRE_Int hypre_CSRMatrixIntersectPattern(hypre_CSRMatrix *A, hypre_CSRMatrix *B, HYPRE_Int *markA, HYPRE_Int diag_option); +HYPRE_Int hypre_CSRMatrixSortRowOutOfPlace(hypre_CSRMatrix *A); +HYPRE_Int hypre_CSRMatrixTriLowerUpperSolveDevice_core(char uplo, HYPRE_Int unit_diag, + hypre_CSRMatrix *A, HYPRE_Real *l1_norms, hypre_Vector *f, HYPRE_Int offset_f, hypre_Vector *u, + HYPRE_Int offset_u); +HYPRE_Int hypre_CSRMatrixTriLowerUpperSolveDevice(char uplo, HYPRE_Int unit_diag, + hypre_CSRMatrix *A, HYPRE_Real *l1_norms, hypre_Vector *f, hypre_Vector *u ); +HYPRE_Int hypre_CSRMatrixTriLowerUpperSolveRocsparse(char uplo, HYPRE_Int unit_diag, + hypre_CSRMatrix *A, HYPRE_Real *l1_norms, HYPRE_Complex *f, HYPRE_Complex *u ); +HYPRE_Int hypre_CSRMatrixTriLowerUpperSolveCusparse(char uplo, HYPRE_Int unit_diag, + hypre_CSRMatrix *A, HYPRE_Real *l1_norms, HYPRE_Complex *f, HYPRE_Complex *u ); +HYPRE_Int hypre_CSRMatrixTriLowerUpperSolveOnemklsparse(char uplo, HYPRE_Int unit_diag, + hypre_CSRMatrix *A, HYPRE_Real *l1_norms, HYPRE_Complex *f, HYPRE_Complex *u ); +HYPRE_Int hypre_CSRMatrixIntersectPattern(hypre_CSRMatrix *A, hypre_CSRMatrix *B, HYPRE_Int *markA, + HYPRE_Int diag_option); +HYPRE_Int hypre_CSRMatrixDiagScaleDevice( hypre_CSRMatrix *A, hypre_Vector *ld, hypre_Vector *rd); +HYPRE_Int hypre_CSRMatrixCompressColumnsDevice(hypre_CSRMatrix *A, HYPRE_BigInt *col_map, + HYPRE_Int **col_idx_new_ptr, HYPRE_BigInt **col_map_new_ptr); +HYPRE_Int hypre_CSRMatrixILU0(hypre_CSRMatrix *A); /* csr_matrix.c */ -hypre_CSRMatrix *hypre_CSRMatrixCreate ( HYPRE_Int num_rows , HYPRE_Int num_cols , HYPRE_Int num_nonzeros ); +hypre_CSRMatrix *hypre_CSRMatrixCreate ( HYPRE_Int num_rows, HYPRE_Int num_cols, + HYPRE_Int num_nonzeros ); HYPRE_Int hypre_CSRMatrixDestroy ( hypre_CSRMatrix *matrix ); -HYPRE_Int hypre_CSRMatrixInitialize_v2( hypre_CSRMatrix *matrix, HYPRE_Int bigInit, HYPRE_MemoryLocation memory_location ); +HYPRE_Int hypre_CSRMatrixInitialize_v2( hypre_CSRMatrix *matrix, HYPRE_Int bigInit, + HYPRE_MemoryLocation memory_location ); HYPRE_Int hypre_CSRMatrixInitialize ( hypre_CSRMatrix *matrix ); HYPRE_Int hypre_CSRMatrixBigInitialize ( hypre_CSRMatrix *matrix ); HYPRE_Int hypre_CSRMatrixBigJtoJ ( hypre_CSRMatrix *matrix ); HYPRE_Int hypre_CSRMatrixJtoBigJ ( hypre_CSRMatrix *matrix ); -HYPRE_Int hypre_CSRMatrixSetDataOwner ( hypre_CSRMatrix *matrix , HYPRE_Int owns_data ); +HYPRE_Int hypre_CSRMatrixSetDataOwner ( hypre_CSRMatrix *matrix, HYPRE_Int owns_data ); +HYPRE_Int hypre_CSRMatrixSetPatternOnly( hypre_CSRMatrix *matrix, HYPRE_Int pattern_only ); HYPRE_Int hypre_CSRMatrixSetRownnz ( hypre_CSRMatrix *matrix ); hypre_CSRMatrix *hypre_CSRMatrixRead ( char *file_name ); HYPRE_Int hypre_CSRMatrixPrint ( hypre_CSRMatrix *matrix, const char *file_name ); -HYPRE_Int hypre_CSRMatrixPrint2( hypre_CSRMatrix *matrix, const char *file_name ); -HYPRE_Int hypre_CSRMatrixPrintHB ( hypre_CSRMatrix *matrix_input , char *file_name ); -HYPRE_Int hypre_CSRMatrixPrintMM( hypre_CSRMatrix *matrix, HYPRE_Int basei, HYPRE_Int basej, HYPRE_Int trans, const char *file_name ); -HYPRE_Int hypre_CSRMatrixCopy ( hypre_CSRMatrix *A , hypre_CSRMatrix *B , HYPRE_Int copy_data ); +HYPRE_Int hypre_CSRMatrixPrintIJ( hypre_CSRMatrix *matrix, HYPRE_Int base_i, + HYPRE_Int base_j, char *filename ); +HYPRE_Int hypre_CSRMatrixPrintHB ( hypre_CSRMatrix *matrix_input, char *file_name ); +HYPRE_Int hypre_CSRMatrixPrintMM( hypre_CSRMatrix *matrix, HYPRE_Int basei, HYPRE_Int basej, + HYPRE_Int trans, const char *file_name ); +HYPRE_Int hypre_CSRMatrixCopy ( hypre_CSRMatrix *A, hypre_CSRMatrix *B, HYPRE_Int copy_data ); +HYPRE_Int hypre_CSRMatrixMigrate( hypre_CSRMatrix *A, HYPRE_MemoryLocation memory_location ); hypre_CSRMatrix *hypre_CSRMatrixClone ( hypre_CSRMatrix *A, HYPRE_Int copy_data ); -hypre_CSRMatrix *hypre_CSRMatrixClone_v2( hypre_CSRMatrix *A, HYPRE_Int copy_data, HYPRE_MemoryLocation memory_location ); -hypre_CSRMatrix *hypre_CSRMatrixUnion ( hypre_CSRMatrix *A , hypre_CSRMatrix *B , HYPRE_BigInt *col_map_offd_A , HYPRE_BigInt *col_map_offd_B , HYPRE_BigInt **col_map_offd_C ); +hypre_CSRMatrix *hypre_CSRMatrixClone_v2( hypre_CSRMatrix *A, HYPRE_Int copy_data, + HYPRE_MemoryLocation memory_location ); +HYPRE_Int hypre_CSRMatrixPermute( hypre_CSRMatrix *A, HYPRE_Int *perm, + HYPRE_Int *rqperm, hypre_CSRMatrix **B_ptr ); +hypre_CSRMatrix *hypre_CSRMatrixUnion( hypre_CSRMatrix *A, + hypre_CSRMatrix *B, + HYPRE_BigInt *col_map_offd_A, + HYPRE_BigInt *col_map_offd_B, + HYPRE_BigInt **col_map_offd_C ); HYPRE_Int hypre_CSRMatrixPrefetch( hypre_CSRMatrix *A, HYPRE_MemoryLocation memory_location); HYPRE_Int hypre_CSRMatrixCheckSetNumNonzeros( hypre_CSRMatrix *matrix ); -HYPRE_Int hypre_CSRMatrixResize( hypre_CSRMatrix *matrix, HYPRE_Int new_num_rows, HYPRE_Int new_num_cols, HYPRE_Int new_num_nonzeros ); +HYPRE_Int hypre_CSRMatrixResize( hypre_CSRMatrix *matrix, HYPRE_Int new_num_rows, + HYPRE_Int new_num_cols, HYPRE_Int new_num_nonzeros ); /* csr_matvec.c */ // y[offset:end] = alpha*A[offset:end,:]*x + beta*b[offset:end] -HYPRE_Int hypre_CSRMatrixMatvecOutOfPlace ( HYPRE_Complex alpha , hypre_CSRMatrix *A , hypre_Vector *x , HYPRE_Complex beta , hypre_Vector *b, hypre_Vector *y, HYPRE_Int offset ); +HYPRE_Int hypre_CSRMatrixMatvecOutOfPlace ( HYPRE_Complex alpha, hypre_CSRMatrix *A, + hypre_Vector *x, HYPRE_Complex beta, hypre_Vector *b, hypre_Vector *y, HYPRE_Int offset ); // y = alpha*A + beta*y -HYPRE_Int hypre_CSRMatrixMatvec ( HYPRE_Complex alpha , hypre_CSRMatrix *A , hypre_Vector *x , HYPRE_Complex beta , hypre_Vector *y ); -HYPRE_Int hypre_CSRMatrixMatvecT ( HYPRE_Complex alpha , hypre_CSRMatrix *A , hypre_Vector *x , HYPRE_Complex beta , hypre_Vector *y ); -HYPRE_Int hypre_CSRMatrixMatvec_FF ( HYPRE_Complex alpha , hypre_CSRMatrix *A , hypre_Vector *x , HYPRE_Complex beta , hypre_Vector *y , HYPRE_Int *CF_marker_x , HYPRE_Int *CF_marker_y , HYPRE_Int fpt ); +HYPRE_Int hypre_CSRMatrixMatvec ( HYPRE_Complex alpha, hypre_CSRMatrix *A, hypre_Vector *x, + HYPRE_Complex beta, hypre_Vector *y ); +HYPRE_Int hypre_CSRMatrixMatvecT ( HYPRE_Complex alpha, hypre_CSRMatrix *A, hypre_Vector *x, + HYPRE_Complex beta, hypre_Vector *y ); +HYPRE_Int hypre_CSRMatrixMatvec_FF ( HYPRE_Complex alpha, hypre_CSRMatrix *A, hypre_Vector *x, + HYPRE_Complex beta, hypre_Vector *y, HYPRE_Int *CF_marker_x, HYPRE_Int *CF_marker_y, + HYPRE_Int fpt ); /* csr_matvec_device.c */ -HYPRE_Int hypre_CSRMatrixMatvecDevice(HYPRE_Int trans, HYPRE_Complex alpha , hypre_CSRMatrix *A , hypre_Vector *x , HYPRE_Complex beta , hypre_Vector *b, hypre_Vector *y, HYPRE_Int offset ); -HYPRE_Int hypre_CSRMatrixMatvecCusparseNewAPI( HYPRE_Int trans, HYPRE_Complex alpha, hypre_CSRMatrix *A, hypre_Vector *x, HYPRE_Complex beta, hypre_Vector *y, HYPRE_Int offset ); -HYPRE_Int hypre_CSRMatrixMatvecCusparseOldAPI( HYPRE_Int trans, HYPRE_Complex alpha, hypre_CSRMatrix *A, hypre_Vector *x, HYPRE_Complex beta, hypre_Vector *y, HYPRE_Int offset ); -HYPRE_Int hypre_CSRMatrixMatvecOMPOffload (HYPRE_Int trans, HYPRE_Complex alpha , hypre_CSRMatrix *A , hypre_Vector *x , HYPRE_Complex beta , hypre_Vector *y, HYPRE_Int offset ); -HYPRE_Int hypre_CSRMatrixMatvecRocsparse (HYPRE_Int trans, HYPRE_Complex alpha , hypre_CSRMatrix *A , hypre_Vector *x , HYPRE_Complex beta , hypre_Vector *y, HYPRE_Int offset ); +HYPRE_Int hypre_CSRMatrixMatvecDevice(HYPRE_Int trans, HYPRE_Complex alpha, hypre_CSRMatrix *A, + hypre_Vector *x, HYPRE_Complex beta, hypre_Vector *b, hypre_Vector *y, HYPRE_Int offset ); +HYPRE_Int hypre_CSRMatrixMatvecCusparseNewAPI( HYPRE_Int trans, HYPRE_Complex alpha, + hypre_CSRMatrix *A, hypre_Vector *x, HYPRE_Complex beta, hypre_Vector *y, HYPRE_Int offset ); +HYPRE_Int hypre_CSRMatrixMatvecCusparseOldAPI( HYPRE_Int trans, HYPRE_Complex alpha, + hypre_CSRMatrix *A, hypre_Vector *x, HYPRE_Complex beta, hypre_Vector *y, HYPRE_Int offset ); +HYPRE_Int hypre_CSRMatrixMatvecCusparse( HYPRE_Int trans, HYPRE_Complex alpha, + hypre_CSRMatrix *A, hypre_Vector *x, HYPRE_Complex beta, hypre_Vector *y, HYPRE_Int offset ); +HYPRE_Int hypre_CSRMatrixMatvecOMPOffload (HYPRE_Int trans, HYPRE_Complex alpha, hypre_CSRMatrix *A, + hypre_Vector *x, HYPRE_Complex beta, hypre_Vector *y, HYPRE_Int offset ); +HYPRE_Int hypre_CSRMatrixMatvecRocsparse (HYPRE_Int trans, HYPRE_Complex alpha, hypre_CSRMatrix *A, + hypre_Vector *x, HYPRE_Complex beta, hypre_Vector *y, HYPRE_Int offset ); +HYPRE_Int hypre_CSRMatrixMatvecOnemklsparse (HYPRE_Int trans, HYPRE_Complex alpha, + hypre_CSRMatrix *A, + hypre_Vector *x, HYPRE_Complex beta, hypre_Vector *y, HYPRE_Int offset ); /* genpart.c */ -HYPRE_Int hypre_GeneratePartitioning ( HYPRE_BigInt length , HYPRE_Int num_procs , HYPRE_BigInt **part_ptr ); -HYPRE_Int hypre_GenerateLocalPartitioning ( HYPRE_BigInt length , HYPRE_Int num_procs , HYPRE_Int myid , HYPRE_BigInt *part ); +HYPRE_Int hypre_GeneratePartitioning ( HYPRE_BigInt length, HYPRE_Int num_procs, + HYPRE_BigInt **part_ptr ); +HYPRE_Int hypre_GenerateLocalPartitioning ( HYPRE_BigInt length, HYPRE_Int num_procs, + HYPRE_Int myid, HYPRE_BigInt *part ); /* HYPRE_csr_matrix.c */ -HYPRE_CSRMatrix HYPRE_CSRMatrixCreate ( HYPRE_Int num_rows , HYPRE_Int num_cols , HYPRE_Int *row_sizes ); +HYPRE_CSRMatrix HYPRE_CSRMatrixCreate ( HYPRE_Int num_rows, HYPRE_Int num_cols, + HYPRE_Int *row_sizes ); HYPRE_Int HYPRE_CSRMatrixDestroy ( HYPRE_CSRMatrix matrix ); HYPRE_Int HYPRE_CSRMatrixInitialize ( HYPRE_CSRMatrix matrix ); HYPRE_CSRMatrix HYPRE_CSRMatrixRead ( char *file_name ); -void HYPRE_CSRMatrixPrint ( HYPRE_CSRMatrix matrix , char *file_name ); -HYPRE_Int HYPRE_CSRMatrixGetNumRows ( HYPRE_CSRMatrix matrix , HYPRE_Int *num_rows ); +void HYPRE_CSRMatrixPrint ( HYPRE_CSRMatrix matrix, char *file_name ); +HYPRE_Int HYPRE_CSRMatrixGetNumRows ( HYPRE_CSRMatrix matrix, HYPRE_Int *num_rows ); /* HYPRE_mapped_matrix.c */ HYPRE_MappedMatrix HYPRE_MappedMatrixCreate ( void ); @@ -381,11 +483,12 @@ HYPRE_Int HYPRE_MappedMatrixLimitedDestroy ( HYPRE_MappedMatrix matrix ); HYPRE_Int HYPRE_MappedMatrixInitialize ( HYPRE_MappedMatrix matrix ); HYPRE_Int HYPRE_MappedMatrixAssemble ( HYPRE_MappedMatrix matrix ); void HYPRE_MappedMatrixPrint ( HYPRE_MappedMatrix matrix ); -HYPRE_Int HYPRE_MappedMatrixGetColIndex ( HYPRE_MappedMatrix matrix , HYPRE_Int j ); +HYPRE_Int HYPRE_MappedMatrixGetColIndex ( HYPRE_MappedMatrix matrix, HYPRE_Int j ); void *HYPRE_MappedMatrixGetMatrix ( HYPRE_MappedMatrix matrix ); -HYPRE_Int HYPRE_MappedMatrixSetMatrix ( HYPRE_MappedMatrix matrix , void *matrix_data ); -HYPRE_Int HYPRE_MappedMatrixSetColMap ( HYPRE_MappedMatrix matrix , HYPRE_Int (*ColMap )(HYPRE_Int ,void *)); -HYPRE_Int HYPRE_MappedMatrixSetMapData ( HYPRE_MappedMatrix matrix , void *MapData ); +HYPRE_Int HYPRE_MappedMatrixSetMatrix ( HYPRE_MappedMatrix matrix, void *matrix_data ); +HYPRE_Int HYPRE_MappedMatrixSetColMap ( HYPRE_MappedMatrix matrix, HYPRE_Int (*ColMap )(HYPRE_Int, + void *)); +HYPRE_Int HYPRE_MappedMatrixSetMapData ( HYPRE_MappedMatrix matrix, void *MapData ); /* HYPRE_multiblock_matrix.c */ HYPRE_MultiblockMatrix HYPRE_MultiblockMatrixCreate ( void ); @@ -394,14 +497,15 @@ HYPRE_Int HYPRE_MultiblockMatrixLimitedDestroy ( HYPRE_MultiblockMatrix matrix ) HYPRE_Int HYPRE_MultiblockMatrixInitialize ( HYPRE_MultiblockMatrix matrix ); HYPRE_Int HYPRE_MultiblockMatrixAssemble ( HYPRE_MultiblockMatrix matrix ); void HYPRE_MultiblockMatrixPrint ( HYPRE_MultiblockMatrix matrix ); -HYPRE_Int HYPRE_MultiblockMatrixSetNumSubmatrices ( HYPRE_MultiblockMatrix matrix , HYPRE_Int n ); -HYPRE_Int HYPRE_MultiblockMatrixSetSubmatrixType ( HYPRE_MultiblockMatrix matrix , HYPRE_Int j , HYPRE_Int type ); +HYPRE_Int HYPRE_MultiblockMatrixSetNumSubmatrices ( HYPRE_MultiblockMatrix matrix, HYPRE_Int n ); +HYPRE_Int HYPRE_MultiblockMatrixSetSubmatrixType ( HYPRE_MultiblockMatrix matrix, HYPRE_Int j, + HYPRE_Int type ); /* HYPRE_vector.c */ HYPRE_Vector HYPRE_VectorCreate ( HYPRE_Int size ); HYPRE_Int HYPRE_VectorDestroy ( HYPRE_Vector vector ); HYPRE_Int HYPRE_VectorInitialize ( HYPRE_Vector vector ); -HYPRE_Int HYPRE_VectorPrint ( HYPRE_Vector vector , char *file_name ); +HYPRE_Int HYPRE_VectorPrint ( HYPRE_Vector vector, char *file_name ); HYPRE_Vector HYPRE_VectorRead ( char *file_name ); /* mapped_matrix.c */ @@ -411,11 +515,12 @@ HYPRE_Int hypre_MappedMatrixLimitedDestroy ( hypre_MappedMatrix *matrix ); HYPRE_Int hypre_MappedMatrixInitialize ( hypre_MappedMatrix *matrix ); HYPRE_Int hypre_MappedMatrixAssemble ( hypre_MappedMatrix *matrix ); void hypre_MappedMatrixPrint ( hypre_MappedMatrix *matrix ); -HYPRE_Int hypre_MappedMatrixGetColIndex ( hypre_MappedMatrix *matrix , HYPRE_Int j ); +HYPRE_Int hypre_MappedMatrixGetColIndex ( hypre_MappedMatrix *matrix, HYPRE_Int j ); void *hypre_MappedMatrixGetMatrix ( hypre_MappedMatrix *matrix ); -HYPRE_Int hypre_MappedMatrixSetMatrix ( hypre_MappedMatrix *matrix , void *matrix_data ); -HYPRE_Int hypre_MappedMatrixSetColMap ( hypre_MappedMatrix *matrix , HYPRE_Int (*ColMap )(HYPRE_Int ,void *)); -HYPRE_Int hypre_MappedMatrixSetMapData ( hypre_MappedMatrix *matrix , void *map_data ); +HYPRE_Int hypre_MappedMatrixSetMatrix ( hypre_MappedMatrix *matrix, void *matrix_data ); +HYPRE_Int hypre_MappedMatrixSetColMap ( hypre_MappedMatrix *matrix, HYPRE_Int (*ColMap )(HYPRE_Int, + void *)); +HYPRE_Int hypre_MappedMatrixSetMapData ( hypre_MappedMatrix *matrix, void *map_data ); /* multiblock_matrix.c */ hypre_MultiblockMatrix *hypre_MultiblockMatrixCreate ( void ); @@ -424,79 +529,143 @@ HYPRE_Int hypre_MultiblockMatrixLimitedDestroy ( hypre_MultiblockMatrix *matrix HYPRE_Int hypre_MultiblockMatrixInitialize ( hypre_MultiblockMatrix *matrix ); HYPRE_Int hypre_MultiblockMatrixAssemble ( hypre_MultiblockMatrix *matrix ); void hypre_MultiblockMatrixPrint ( hypre_MultiblockMatrix *matrix ); -HYPRE_Int hypre_MultiblockMatrixSetNumSubmatrices ( hypre_MultiblockMatrix *matrix , HYPRE_Int n ); -HYPRE_Int hypre_MultiblockMatrixSetSubmatrixType ( hypre_MultiblockMatrix *matrix , HYPRE_Int j , HYPRE_Int type ); -HYPRE_Int hypre_MultiblockMatrixSetSubmatrix ( hypre_MultiblockMatrix *matrix , HYPRE_Int j , void *submatrix ); +HYPRE_Int hypre_MultiblockMatrixSetNumSubmatrices ( hypre_MultiblockMatrix *matrix, HYPRE_Int n ); +HYPRE_Int hypre_MultiblockMatrixSetSubmatrixType ( hypre_MultiblockMatrix *matrix, HYPRE_Int j, + HYPRE_Int type ); +HYPRE_Int hypre_MultiblockMatrixSetSubmatrix ( hypre_MultiblockMatrix *matrix, HYPRE_Int j, + void *submatrix ); /* vector.c */ hypre_Vector *hypre_SeqVectorCreate ( HYPRE_Int size ); -hypre_Vector *hypre_SeqMultiVectorCreate ( HYPRE_Int size , HYPRE_Int num_vectors ); +hypre_Vector *hypre_SeqMultiVectorCreate ( HYPRE_Int size, HYPRE_Int num_vectors ); HYPRE_Int hypre_SeqVectorDestroy ( hypre_Vector *vector ); -HYPRE_Int hypre_SeqVectorInitialize_v2( hypre_Vector *vector, HYPRE_MemoryLocation memory_location ); +HYPRE_Int hypre_SeqVectorInitializeShell( hypre_Vector *vector ); +HYPRE_Int hypre_SeqVectorSetData( hypre_Vector *vector, HYPRE_Complex *data ); +HYPRE_Int hypre_SeqVectorInitialize_v2( hypre_Vector *vector, + HYPRE_MemoryLocation memory_location ); HYPRE_Int hypre_SeqVectorInitialize ( hypre_Vector *vector ); -HYPRE_Int hypre_SeqVectorSetDataOwner ( hypre_Vector *vector , HYPRE_Int owns_data ); +HYPRE_Int hypre_SeqVectorSetDataOwner ( hypre_Vector *vector, HYPRE_Int owns_data ); +HYPRE_Int hypre_SeqVectorSetSize ( hypre_Vector *vector, HYPRE_Int size ); +HYPRE_Int hypre_SeqVectorResize ( hypre_Vector *vector, HYPRE_Int num_vectors_in ); hypre_Vector *hypre_SeqVectorRead ( char *file_name ); -HYPRE_Int hypre_SeqVectorPrint ( hypre_Vector *vector , char *file_name ); -HYPRE_Int hypre_SeqVectorSetConstantValues ( hypre_Vector *v , HYPRE_Complex value ); -HYPRE_Int hypre_SeqVectorSetRandomValues ( hypre_Vector *v , HYPRE_Int seed ); -HYPRE_Int hypre_SeqVectorCopy ( hypre_Vector *x , hypre_Vector *y ); +HYPRE_Int hypre_SeqVectorPrint ( hypre_Vector *vector, char *file_name ); +HYPRE_Int hypre_SeqVectorSetConstantValues ( hypre_Vector *v, HYPRE_Complex value ); +HYPRE_Int hypre_SeqVectorSetConstantValuesHost ( hypre_Vector *v, HYPRE_Complex value ); +HYPRE_Int hypre_SeqVectorSetRandomValues ( hypre_Vector *v, HYPRE_Int seed ); +HYPRE_Int hypre_SeqVectorCopy ( hypre_Vector *x, hypre_Vector *y ); +HYPRE_Int hypre_SeqVectorStridedCopy( hypre_Vector *x, HYPRE_Int istride, HYPRE_Int ostride, + HYPRE_Int size, HYPRE_Complex *data); hypre_Vector *hypre_SeqVectorCloneDeep ( hypre_Vector *x ); hypre_Vector *hypre_SeqVectorCloneDeep_v2( hypre_Vector *x, HYPRE_MemoryLocation memory_location ); hypre_Vector *hypre_SeqVectorCloneShallow ( hypre_Vector *x ); +HYPRE_Int hypre_SeqVectorMigrate( hypre_Vector *x, HYPRE_MemoryLocation memory_location ); HYPRE_Int hypre_SeqVectorScale( HYPRE_Complex alpha, hypre_Vector *y ); - -HYPRE_Int hypre_SeqVectorAxpy ( HYPRE_Complex alpha , hypre_Vector *x , hypre_Vector *y ); -HYPRE_Real hypre_SeqVectorInnerProd ( hypre_Vector *x , hypre_Vector *y ); -HYPRE_Int hypre_SeqVectorMassInnerProd(hypre_Vector *x, hypre_Vector **y, HYPRE_Int k, HYPRE_Int unroll, HYPRE_Real *result); -HYPRE_Int hypre_SeqVectorMassInnerProd4(hypre_Vector *x, hypre_Vector **y, HYPRE_Int k, HYPRE_Real *result); -HYPRE_Int hypre_SeqVectorMassInnerProd8(hypre_Vector *x, hypre_Vector **y, HYPRE_Int k, HYPRE_Real *result); -HYPRE_Int hypre_SeqVectorMassDotpTwo(hypre_Vector *x, hypre_Vector *y , hypre_Vector **z, HYPRE_Int k, HYPRE_Int unroll, HYPRE_Real *result_x , HYPRE_Real *result_y); -HYPRE_Int hypre_SeqVectorMassDotpTwo4(hypre_Vector *x, hypre_Vector *y , hypre_Vector **z, HYPRE_Int k, HYPRE_Real *result_x , HYPRE_Real *result_y); -HYPRE_Int hypre_SeqVectorMassDotpTwo8(hypre_Vector *x, hypre_Vector *y , hypre_Vector **z, HYPRE_Int k, HYPRE_Real *result_x , HYPRE_Real *result_y); -HYPRE_Int hypre_SeqVectorMassAxpy(HYPRE_Complex *alpha, hypre_Vector **x, hypre_Vector *y, HYPRE_Int k, HYPRE_Int unroll); -HYPRE_Int hypre_SeqVectorMassAxpy4(HYPRE_Complex *alpha, hypre_Vector **x, hypre_Vector *y, HYPRE_Int k); -HYPRE_Int hypre_SeqVectorMassAxpy8(HYPRE_Complex *alpha, hypre_Vector **x, hypre_Vector *y, HYPRE_Int k); +HYPRE_Int hypre_SeqVectorScaleHost( HYPRE_Complex alpha, hypre_Vector *y ); +HYPRE_Int hypre_SeqVectorAxpy ( HYPRE_Complex alpha, hypre_Vector *x, hypre_Vector *y ); +HYPRE_Int hypre_SeqVectorAxpyHost ( HYPRE_Complex alpha, hypre_Vector *x, hypre_Vector *y ); +HYPRE_Int hypre_SeqVectorAxpyz ( HYPRE_Complex alpha, hypre_Vector *x, + HYPRE_Complex beta, hypre_Vector *y, + hypre_Vector *z ); +HYPRE_Real hypre_SeqVectorInnerProd ( hypre_Vector *x, hypre_Vector *y ); +HYPRE_Real hypre_SeqVectorInnerProdHost ( hypre_Vector *x, hypre_Vector *y ); +HYPRE_Int hypre_SeqVectorMassInnerProd(hypre_Vector *x, hypre_Vector **y, HYPRE_Int k, + HYPRE_Int unroll, HYPRE_Real *result); +HYPRE_Int hypre_SeqVectorMassInnerProd4(hypre_Vector *x, hypre_Vector **y, HYPRE_Int k, + HYPRE_Real *result); +HYPRE_Int hypre_SeqVectorMassInnerProd8(hypre_Vector *x, hypre_Vector **y, HYPRE_Int k, + HYPRE_Real *result); +HYPRE_Int hypre_SeqVectorMassDotpTwo(hypre_Vector *x, hypre_Vector *y, hypre_Vector **z, + HYPRE_Int k, HYPRE_Int unroll, HYPRE_Real *result_x, HYPRE_Real *result_y); +HYPRE_Int hypre_SeqVectorMassDotpTwo4(hypre_Vector *x, hypre_Vector *y, hypre_Vector **z, + HYPRE_Int k, HYPRE_Real *result_x, HYPRE_Real *result_y); +HYPRE_Int hypre_SeqVectorMassDotpTwo8(hypre_Vector *x, hypre_Vector *y, hypre_Vector **z, + HYPRE_Int k, HYPRE_Real *result_x, HYPRE_Real *result_y); +HYPRE_Int hypre_SeqVectorMassAxpy(HYPRE_Complex *alpha, hypre_Vector **x, hypre_Vector *y, + HYPRE_Int k, HYPRE_Int unroll); +HYPRE_Int hypre_SeqVectorMassAxpy4(HYPRE_Complex *alpha, hypre_Vector **x, hypre_Vector *y, + HYPRE_Int k); +HYPRE_Int hypre_SeqVectorMassAxpy8(HYPRE_Complex *alpha, hypre_Vector **x, hypre_Vector *y, + HYPRE_Int k); HYPRE_Complex hypre_SeqVectorSumElts ( hypre_Vector *vector ); -HYPRE_Int hypre_SeqVectorPrefetch(hypre_Vector *x, HYPRE_MemoryLocation memory_location); +HYPRE_Complex hypre_SeqVectorSumEltsHost ( hypre_Vector *vector ); //HYPRE_Int hypre_SeqVectorMax( HYPRE_Complex alpha, hypre_Vector *x, HYPRE_Complex beta, hypre_Vector *y ); -HYPRE_Int hypreDevice_CSRSpAdd(HYPRE_Int ma, HYPRE_Int mb, HYPRE_Int n, HYPRE_Int nnzA, HYPRE_Int nnzB, HYPRE_Int *d_ia, HYPRE_Int *d_ja, HYPRE_Complex alpha, HYPRE_Complex *d_aa, HYPRE_Int *d_ja_map, HYPRE_Int *d_ib, HYPRE_Int *d_jb, HYPRE_Complex beta, HYPRE_Complex *d_ab, HYPRE_Int *d_jb_map, HYPRE_Int *d_num_b, HYPRE_Int *nnzC_out, HYPRE_Int **d_ic_out, HYPRE_Int **d_jc_out, HYPRE_Complex **d_ac_out); +HYPRE_Int hypreDevice_CSRSpAdd(HYPRE_Int ma, HYPRE_Int mb, HYPRE_Int nnzA, + HYPRE_Int nnzB, HYPRE_Int *d_ia, HYPRE_Int *d_ja, HYPRE_Complex alpha, HYPRE_Complex *d_aa, + HYPRE_Int *d_ja_map, HYPRE_Int *d_ib, HYPRE_Int *d_jb, HYPRE_Complex beta, HYPRE_Complex *d_ab, + HYPRE_Int *d_jb_map, HYPRE_Int *d_num_b, HYPRE_Int *nnzC_out, HYPRE_Int **d_ic_out, + HYPRE_Int **d_jc_out, HYPRE_Complex **d_ac_out); -HYPRE_Int hypreDevice_CSRSpTrans(HYPRE_Int m, HYPRE_Int n, HYPRE_Int nnzA, HYPRE_Int *d_ia, HYPRE_Int *d_ja, HYPRE_Complex *d_aa, HYPRE_Int **d_ic_out, HYPRE_Int **d_jc_out, HYPRE_Complex **d_ac_out, HYPRE_Int want_data); +HYPRE_Int hypreDevice_CSRSpTrans(HYPRE_Int m, HYPRE_Int n, HYPRE_Int nnzA, HYPRE_Int *d_ia, + HYPRE_Int *d_ja, HYPRE_Complex *d_aa, HYPRE_Int **d_ic_out, HYPRE_Int **d_jc_out, + HYPRE_Complex **d_ac_out, HYPRE_Int want_data); -HYPRE_Int hypreDevice_CSRSpTransCusparse(HYPRE_Int m, HYPRE_Int n, HYPRE_Int nnzA, HYPRE_Int *d_ia, HYPRE_Int *d_ja, HYPRE_Complex *d_aa, HYPRE_Int **d_ic_out, HYPRE_Int **d_jc_out, HYPRE_Complex **d_ac_out, HYPRE_Int want_data); +HYPRE_Int hypreDevice_CSRSpTransCusparse(HYPRE_Int m, HYPRE_Int n, HYPRE_Int nnzA, HYPRE_Int *d_ia, + HYPRE_Int *d_ja, HYPRE_Complex *d_aa, HYPRE_Int **d_ic_out, HYPRE_Int **d_jc_out, + HYPRE_Complex **d_ac_out, HYPRE_Int want_data); -HYPRE_Int hypreDevice_CSRSpTransRocsparse(HYPRE_Int m, HYPRE_Int n, HYPRE_Int nnzA, HYPRE_Int *d_ia, HYPRE_Int *d_ja, HYPRE_Complex *d_aa, HYPRE_Int **d_ic_out, HYPRE_Int **d_jc_out, HYPRE_Complex **d_ac_out, HYPRE_Int want_data); +HYPRE_Int hypreDevice_CSRSpTransRocsparse(HYPRE_Int m, HYPRE_Int n, HYPRE_Int nnzA, HYPRE_Int *d_ia, + HYPRE_Int *d_ja, HYPRE_Complex *d_aa, HYPRE_Int **d_ic_out, HYPRE_Int **d_jc_out, + HYPRE_Complex **d_ac_out, HYPRE_Int want_data); -HYPRE_Int hypreDevice_CSRSpGemm(hypre_CSRMatrix *A, hypre_CSRMatrix *B, hypre_CSRMatrix **C_ptr); +HYPRE_Int hypreDevice_CSRSpTransOnemklsparse(HYPRE_Int m, HYPRE_Int n, HYPRE_Int nnzA, + HYPRE_Int *d_ia, HYPRE_Int *d_ja, HYPRE_Complex *d_aa, HYPRE_Int **d_ic_out, HYPRE_Int **d_jc_out, + HYPRE_Complex **d_ac_out, HYPRE_Int want_data); -HYPRE_Int hypreDevice_CSRSpGemmRownnzEstimate(HYPRE_Int m, HYPRE_Int k, HYPRE_Int n, HYPRE_Int *d_ia, HYPRE_Int *d_ja, HYPRE_Int *d_ib, HYPRE_Int *d_jb, HYPRE_Int *d_rc); - -HYPRE_Int hypreDevice_CSRSpGemmRownnzUpperbound(HYPRE_Int m, HYPRE_Int k, HYPRE_Int n, HYPRE_Int *d_ia, HYPRE_Int *d_ja, HYPRE_Int *d_ib, HYPRE_Int *d_jb, HYPRE_Int in_rc, HYPRE_Int *d_rc, HYPRE_Int *d_rf); - -HYPRE_Int hypreDevice_CSRSpGemmRownnz(HYPRE_Int m, HYPRE_Int k, HYPRE_Int n, HYPRE_Int *d_ia, HYPRE_Int *d_ja, HYPRE_Int *d_ib, HYPRE_Int *d_jb, HYPRE_Int in_rc, HYPRE_Int *d_rc); - -HYPRE_Int hypreDevice_CSRSpGemmNumerWithRownnzUpperbound(HYPRE_Int m, HYPRE_Int k, HYPRE_Int n, HYPRE_Int *d_ia, HYPRE_Int *d_ja, HYPRE_Complex *d_a, HYPRE_Int *d_ib, HYPRE_Int *d_jb, HYPRE_Complex *d_b, HYPRE_Int *d_rc, HYPRE_Int exact_rownnz, HYPRE_Int **d_ic_out, HYPRE_Int **d_jc_out, HYPRE_Complex **d_c_out, HYPRE_Int *nnzC); - -HYPRE_Int hypreDevice_CSRSpGemmNumerWithRownnzEstimate(HYPRE_Int m, HYPRE_Int k, HYPRE_Int n, HYPRE_Int *d_ia, HYPRE_Int *d_ja, HYPRE_Complex *d_a, HYPRE_Int *d_ib, HYPRE_Int *d_jb, HYPRE_Complex *d_b, HYPRE_Int *d_rc, HYPRE_Int **d_ic_out, HYPRE_Int **d_jc_out, HYPRE_Complex **d_c_out, HYPRE_Int *nnzC); +HYPRE_Int hypreDevice_CSRSpGemm(hypre_CSRMatrix *A, hypre_CSRMatrix *B, hypre_CSRMatrix **C_ptr); -HYPRE_Int hypreDevice_CSRSpGemmCusparseGenericAPI(HYPRE_Int m, HYPRE_Int k, HYPRE_Int n, HYPRE_Int nnzA, HYPRE_Int *d_ia, HYPRE_Int *d_ja, HYPRE_Complex *d_a, HYPRE_Int nnzB, HYPRE_Int *d_ib, HYPRE_Int *d_jb, HYPRE_Complex *d_b, HYPRE_Int *nnzC_out, HYPRE_Int **d_ic_out, HYPRE_Int **d_jc_out, HYPRE_Complex **d_c_out); +HYPRE_Int hypreDevice_CSRSpGemmCusparseGenericAPI(HYPRE_Int m, HYPRE_Int k, HYPRE_Int n, + HYPRE_Int nnzA, HYPRE_Int *d_ia, HYPRE_Int *d_ja, HYPRE_Complex *d_a, HYPRE_Int nnzB, + HYPRE_Int *d_ib, HYPRE_Int *d_jb, HYPRE_Complex *d_b, HYPRE_Int *nnzC_out, HYPRE_Int **d_ic_out, + HYPRE_Int **d_jc_out, HYPRE_Complex **d_c_out); HYPRE_Int hypre_SeqVectorElmdivpy( hypre_Vector *x, hypre_Vector *b, hypre_Vector *y ); -HYPRE_Int hypre_SeqVectorElmdivpyMarked( hypre_Vector *x, hypre_Vector *b, hypre_Vector *y, HYPRE_Int *marker, HYPRE_Int marker_val ); - -HYPRE_Int hypre_CSRMatrixSpMVDevice( HYPRE_Complex alpha, hypre_CSRMatrix *A, hypre_Vector *x, HYPRE_Complex beta, hypre_Vector *y, HYPRE_Int fill ); - -#if defined(HYPRE_USING_CUSPARSE) || defined(HYPRE_USING_ROCSPARSE) +HYPRE_Int hypre_SeqVectorElmdivpyMarked( hypre_Vector *x, hypre_Vector *b, hypre_Vector *y, + HYPRE_Int *marker, HYPRE_Int marker_val ); +HYPRE_Int hypre_SeqVectorElmdivpyHost( hypre_Vector *x, hypre_Vector *b, hypre_Vector *y, + HYPRE_Int *marker, HYPRE_Int marker_val ); +HYPRE_Int hypre_CSRMatrixSpMVDevice( HYPRE_Int trans, HYPRE_Complex alpha, hypre_CSRMatrix *A, + hypre_Vector *x, + HYPRE_Complex beta, hypre_Vector *y, HYPRE_Int fill ); + +HYPRE_Int hypre_CSRMatrixIntSpMVDevice( HYPRE_Int num_rows, HYPRE_Int num_nonzeros, + HYPRE_Int alpha, HYPRE_Int *d_ia, HYPRE_Int *d_ja, + HYPRE_Int *d_a, HYPRE_Int *d_x, HYPRE_Int beta, + HYPRE_Int *d_y ); + +#if defined(HYPRE_USING_CUSPARSE) ||\ + defined(HYPRE_USING_ROCSPARSE) ||\ + defined(HYPRE_USING_ONEMKLSPARSE) hypre_CsrsvData* hypre_CsrsvDataCreate(); -void hypre_CsrsvDataDestroy(hypre_CsrsvData *data); +HYPRE_Int hypre_CsrsvDataDestroy(hypre_CsrsvData *data); hypre_GpuMatData* hypre_GpuMatDataCreate(); -void hypre_GpuMatDataDestroy(hypre_GpuMatData *data); +HYPRE_Int hypre_GPUMatDataSetCSRData(hypre_CSRMatrix *matrix); +HYPRE_Int hypre_GpuMatDataDestroy(hypre_GpuMatData *data); hypre_GpuMatData* hypre_CSRMatrixGetGPUMatData(hypre_CSRMatrix *matrix); -#define hypre_CSRMatrixGPUMatDescr(matrix) ( hypre_GpuMatDataMatDecsr(hypre_CSRMatrixGetGPUMatData(matrix)) ) -#define hypre_CSRMatrixGPUMatInfo(matrix) ( hypre_GpuMatDataMatInfo (hypre_CSRMatrixGetGPUMatData(matrix)) ) + +#define hypre_CSRMatrixGPUMatDescr(matrix) ( hypre_GpuMatDataMatDescr(hypre_CSRMatrixGetGPUMatData(matrix)) ) +#define hypre_CSRMatrixGPUMatInfo(matrix) ( hypre_GpuMatDataMatInfo (hypre_CSRMatrixGetGPUMatData(matrix)) ) +#define hypre_CSRMatrixGPUMatHandle(matrix) ( hypre_GpuMatDataMatHandle (hypre_CSRMatrixGetGPUMatData(matrix)) ) +#define hypre_CSRMatrixGPUMatSpMVBuffer(matrix) ( hypre_GpuMatDataSpMVBuffer (hypre_CSRMatrixGetGPUMatData(matrix)) ) #endif -void hypre_CSRMatrixGpuSpMVAnalysis(hypre_CSRMatrix *matrix); + +HYPRE_Int hypre_CSRMatrixSpMVAnalysisDevice(hypre_CSRMatrix *matrix); + +/* vector_device.c */ +HYPRE_Int hypre_SeqVectorSetConstantValuesDevice ( hypre_Vector *v, HYPRE_Complex value ); +HYPRE_Int hypre_SeqVectorScaleDevice( HYPRE_Complex alpha, hypre_Vector *y ); +HYPRE_Int hypre_SeqVectorAxpyDevice ( HYPRE_Complex alpha, hypre_Vector *x, hypre_Vector *y ); +HYPRE_Int hypre_SeqVectorAxpyzDevice ( HYPRE_Complex alpha, hypre_Vector *x, + HYPRE_Complex beta, hypre_Vector *y, + hypre_Vector *z ); +HYPRE_Int hypre_SeqVectorElmdivpyDevice( hypre_Vector *x, hypre_Vector *b, hypre_Vector *y, + HYPRE_Int *marker, HYPRE_Int marker_val ); +HYPRE_Real hypre_SeqVectorInnerProdDevice ( hypre_Vector *x, hypre_Vector *y ); +HYPRE_Complex hypre_SeqVectorSumEltsDevice ( hypre_Vector *vector ); +HYPRE_Int hypre_SeqVectorStridedCopyDevice( hypre_Vector *vector, + HYPRE_Int istride, HYPRE_Int ostride, + HYPRE_Int size, HYPRE_Complex *data ); +HYPRE_Int hypre_SeqVectorPrefetch(hypre_Vector *x, HYPRE_MemoryLocation memory_location); #ifdef __cplusplus } diff --git a/external/hypre/src/seq_mv/seq_mv.hpp b/external/hypre/src/seq_mv/seq_mv.hpp index 00fa5320..273e9650 100644 --- a/external/hypre/src/seq_mv/seq_mv.hpp +++ b/external/hypre/src/seq_mv/seq_mv.hpp @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -12,44 +12,60 @@ extern "C" { #endif #if defined(HYPRE_USING_CUSPARSE) +#if CUSPARSE_VERSION >= CUSPARSE_NEWAPI_VERSION cusparseSpMatDescr_t hypre_CSRMatrixToCusparseSpMat(const hypre_CSRMatrix *A, HYPRE_Int offset); -cusparseSpMatDescr_t hypre_CSRMatrixToCusparseSpMat_core(HYPRE_Int n, HYPRE_Int m, HYPRE_Int offset, - HYPRE_Int nnz, HYPRE_Int *i, HYPRE_Int *j, - HYPRE_Complex *data); +cusparseSpMatDescr_t hypre_CSRMatrixToCusparseSpMat_core( HYPRE_Int n, HYPRE_Int m, + HYPRE_Int offset, HYPRE_Int nnz, HYPRE_Int *i, HYPRE_Int *j, HYPRE_Complex *data); + +cusparseDnVecDescr_t hypre_VectorToCusparseDnVec_core(HYPRE_Complex *x_data, HYPRE_Int n); cusparseDnVecDescr_t hypre_VectorToCusparseDnVec(const hypre_Vector *x, HYPRE_Int offset, HYPRE_Int size_override); +cusparseDnMatDescr_t hypre_VectorToCusparseDnMat_core(HYPRE_Complex *x_data, HYPRE_Int nrow, + HYPRE_Int ncol, HYPRE_Int order); + +cusparseDnMatDescr_t hypre_VectorToCusparseDnMat(const hypre_Vector *x); +#endif + HYPRE_Int hypreDevice_CSRSpGemmCusparseOldAPI(HYPRE_Int m, HYPRE_Int k, HYPRE_Int n, - cusparseMatDescr_t descr_A, HYPRE_Int nnzA, HYPRE_Int *d_ia, - HYPRE_Int *d_ja, HYPRE_Complex *d_a, cusparseMatDescr_t descr_B, - HYPRE_Int nnzB, HYPRE_Int *d_ib, HYPRE_Int *d_jb, - HYPRE_Complex *d_b, cusparseMatDescr_t descr_C, - HYPRE_Int *nnzC_out, HYPRE_Int **d_ic_out, HYPRE_Int **d_jc_out, + cusparseMatDescr_t descr_A, HYPRE_Int nnzA, HYPRE_Int *d_ia, HYPRE_Int *d_ja, HYPRE_Complex *d_a, + cusparseMatDescr_t descr_B, HYPRE_Int nnzB, HYPRE_Int *d_ib, HYPRE_Int *d_jb, HYPRE_Complex *d_b, + cusparseMatDescr_t descr_C, HYPRE_Int *nnzC_out, HYPRE_Int **d_ic_out, HYPRE_Int **d_jc_out, HYPRE_Complex **d_c_out); -HYPRE_Int hypreDevice_CSRSpGemmCusparse(HYPRE_Int m, HYPRE_Int k, HYPRE_Int n, cusparseMatDescr_t descr_A, - HYPRE_Int nnzA, HYPRE_Int *d_ia, HYPRE_Int *d_ja, HYPRE_Complex *d_a, - cusparseMatDescr_t descr_B, HYPRE_Int nnzB, HYPRE_Int *d_ib, - HYPRE_Int *d_jb, HYPRE_Complex *d_b, cusparseMatDescr_t descr_C, - HYPRE_Int *nnzC_out, HYPRE_Int **d_ic_out, HYPRE_Int **d_jc_out, +HYPRE_Int hypreDevice_CSRSpGemmCusparse(HYPRE_Int m, HYPRE_Int k, HYPRE_Int n, + cusparseMatDescr_t descr_A, HYPRE_Int nnzA, HYPRE_Int *d_ia, HYPRE_Int *d_ja, HYPRE_Complex *d_a, + cusparseMatDescr_t descr_B, HYPRE_Int nnzB, HYPRE_Int *d_ib, HYPRE_Int *d_jb, HYPRE_Complex *d_b, + cusparseMatDescr_t descr_C, HYPRE_Int *nnzC_out, HYPRE_Int **d_ic_out, HYPRE_Int **d_jc_out, HYPRE_Complex **d_c_out); -void hypre_SortCSRCusparse(HYPRE_Int n, HYPRE_Int m, HYPRE_Int nnzA, cusparseMatDescr_t descrA, - const HYPRE_Int *d_ia, HYPRE_Int *d_ja_sorted, HYPRE_Complex *d_a_sorted); +HYPRE_Int hypre_SortCSRCusparse( HYPRE_Int n, HYPRE_Int m, HYPRE_Int nnzA, + cusparseMatDescr_t descrA, + const HYPRE_Int *d_ia, HYPRE_Int *d_ja_sorted, HYPRE_Complex *d_a_sorted ); #endif #if defined(HYPRE_USING_ROCSPARSE) -HYPRE_Int hypreDevice_CSRSpGemmRocsparse(HYPRE_Int m, HYPRE_Int k, HYPRE_Int n, rocsparse_mat_descr descrA, - HYPRE_Int nnzA, HYPRE_Int *d_ia, HYPRE_Int *d_ja, HYPRE_Complex *d_a, - rocsparse_mat_descr descrB, HYPRE_Int nnzB, HYPRE_Int *d_ib, - HYPRE_Int *d_jb, HYPRE_Complex *d_b, rocsparse_mat_descr descrC, - rocsparse_mat_info infoC, HYPRE_Int *nnzC_out, HYPRE_Int **d_ic_out, +HYPRE_Int hypreDevice_CSRSpGemmRocsparse(HYPRE_Int m, HYPRE_Int k, HYPRE_Int n, + rocsparse_mat_descr descrA, HYPRE_Int nnzA, HYPRE_Int *d_ia, HYPRE_Int *d_ja, HYPRE_Complex *d_a, + rocsparse_mat_descr descrB, HYPRE_Int nnzB, HYPRE_Int *d_ib, HYPRE_Int *d_jb, HYPRE_Complex *d_b, + rocsparse_mat_descr descrC, rocsparse_mat_info infoC, HYPRE_Int *nnzC_out, HYPRE_Int **d_ic_out, HYPRE_Int **d_jc_out, HYPRE_Complex **d_c_out); -void hypre_SortCSRRocsparse(HYPRE_Int n, HYPRE_Int m, HYPRE_Int nnzA, rocsparse_mat_descr descrA, - const HYPRE_Int *d_ia, HYPRE_Int *d_ja_sorted, HYPRE_Complex *d_a_sorted); +HYPRE_Int hypre_SortCSRRocsparse( HYPRE_Int n, HYPRE_Int m, HYPRE_Int nnzA, + rocsparse_mat_descr descrA, + const HYPRE_Int *d_ia, HYPRE_Int *d_ja_sorted, HYPRE_Complex *d_a_sorted ); +#endif + +#if defined(HYPRE_USING_ONEMKLSPARSE) +HYPRE_Int hypreDevice_CSRSpGemmOnemklsparse(HYPRE_Int m, HYPRE_Int k, HYPRE_Int n, + oneapi::mkl::sparse::matrix_handle_t handle_A, + HYPRE_Int nnzA, HYPRE_Int *d_ia, HYPRE_Int *d_ja, HYPRE_Complex *d_a, + oneapi::mkl::sparse::matrix_handle_t handle_B, + HYPRE_Int nnzB, HYPRE_Int *d_ib, HYPRE_Int *d_jb, HYPRE_Complex *d_b, + oneapi::mkl::sparse::matrix_handle_t handle_C, + HYPRE_Int *nnzC_out, HYPRE_Int **d_ic_out, HYPRE_Int **d_jc_out, HYPRE_Complex **d_c_out); #endif #ifdef __cplusplus diff --git a/external/hypre/src/seq_mv/vector.c b/external/hypre/src/seq_mv/vector.c index d56c9d00..d74b37f2 100644 --- a/external/hypre/src/seq_mv/vector.c +++ b/external/hypre/src/seq_mv/vector.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -12,7 +12,6 @@ *****************************************************************************/ #include "seq_mv.h" -#include "_hypre_utilities.hpp" //RL: TODO vector_device.c, include cuda there /*-------------------------------------------------------------------------- * hypre_SeqVectorCreate @@ -59,13 +58,11 @@ hypre_SeqMultiVectorCreate( HYPRE_Int size, HYPRE_Int num_vectors ) HYPRE_Int hypre_SeqVectorDestroy( hypre_Vector *vector ) { - HYPRE_Int ierr=0; - if (vector) { HYPRE_MemoryLocation memory_location = hypre_VectorMemoryLocation(vector); - if ( hypre_VectorOwnsData(vector) ) + if (hypre_VectorOwnsData(vector)) { hypre_TFree(hypre_VectorData(vector), memory_location); } @@ -73,58 +70,101 @@ hypre_SeqVectorDestroy( hypre_Vector *vector ) hypre_TFree(vector, HYPRE_MEMORY_HOST); } - return ierr; + return hypre_error_flag; } /*-------------------------------------------------------------------------- - * hypre_SeqVectorInitialize + * hypre_SeqVectorInitializeShell *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_SeqVectorInitialize_v2( hypre_Vector *vector, HYPRE_MemoryLocation memory_location ) +hypre_SeqVectorInitializeShell( hypre_Vector *vector ) { HYPRE_Int size = hypre_VectorSize(vector); - HYPRE_Int ierr = 0; HYPRE_Int num_vectors = hypre_VectorNumVectors(vector); HYPRE_Int multivec_storage_method = hypre_VectorMultiVecStorageMethod(vector); - hypre_VectorMemoryLocation(vector) = memory_location; - - /* Caveat: for pre-existing data, the memory location must be guaranteed - * to be consistent with `memory_location' - * Otherwise, mismatches will exist and problems will be encountered - * when being used, and freed */ - if ( !hypre_VectorData(vector) ) - { - hypre_VectorData(vector) = hypre_CTAlloc(HYPRE_Complex, num_vectors*size, memory_location); - } - - if ( multivec_storage_method == 0 ) + if (multivec_storage_method == 0) { hypre_VectorVectorStride(vector) = size; - hypre_VectorIndexStride(vector) = 1; + hypre_VectorIndexStride(vector) = 1; } - else if ( multivec_storage_method == 1 ) + else if (multivec_storage_method == 1) { hypre_VectorVectorStride(vector) = 1; - hypre_VectorIndexStride(vector) = num_vectors; + hypre_VectorIndexStride(vector) = num_vectors; } else { - ++ierr; + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Invalid multivec storage method!\n"); + return hypre_error_flag; } - return ierr; + return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_SeqVectorSetData + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_SeqVectorInitialize( hypre_Vector *vector ) +hypre_SeqVectorSetData( hypre_Vector *vector, + HYPRE_Complex *data ) +{ + /* Free data array if already present */ + if (hypre_VectorData(vector) && hypre_VectorOwnsData(vector)) + { + hypre_TFree(hypre_VectorData(vector), hypre_VectorMemoryLocation(vector)); + } + + /* Set data pointer passed via input */ + hypre_VectorData(vector) = data; + + /* Remove data pointer ownership */ + hypre_VectorOwnsData(vector) = 0; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_SeqVectorInitialize_v2 + * + * Initialize a vector at a given memory location + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorInitialize_v2( hypre_Vector *vector, + HYPRE_MemoryLocation memory_location ) { - HYPRE_Int ierr; + HYPRE_Int size = hypre_VectorSize(vector); + HYPRE_Int num_vectors = hypre_VectorNumVectors(vector); + + /* Set up the basic structure and metadata for the local vector */ + hypre_SeqVectorInitializeShell(vector); + + /* Set memory location */ + hypre_VectorMemoryLocation(vector) = memory_location; - ierr = hypre_SeqVectorInitialize_v2( vector, hypre_VectorMemoryLocation(vector) ); + /* Caveat: for pre-existing data, the memory location must be guaranteed + * to be consistent with `memory_location' + * Otherwise, mismatches will exist and problems will be encountered + * when being used, and freed */ + if (!hypre_VectorData(vector)) + { + hypre_VectorData(vector) = hypre_CTAlloc(HYPRE_Complex, num_vectors * size, memory_location); + } - return ierr; + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_SeqVectorInitialize + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorInitialize( hypre_Vector *vector ) +{ + return hypre_SeqVectorInitialize_v2(vector, hypre_VectorMemoryLocation(vector)); } /*-------------------------------------------------------------------------- @@ -133,17 +173,77 @@ hypre_SeqVectorInitialize( hypre_Vector *vector ) HYPRE_Int hypre_SeqVectorSetDataOwner( hypre_Vector *vector, - HYPRE_Int owns_data ) + HYPRE_Int owns_data ) { - HYPRE_Int ierr=0; - hypre_VectorOwnsData(vector) = owns_data; - return ierr; + return hypre_error_flag; } /*-------------------------------------------------------------------------- - * ReadVector + * hypre_SeqVectorSetSize + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorSetSize( hypre_Vector *vector, + HYPRE_Int size ) +{ + HYPRE_Int multivec_storage_method = hypre_VectorMultiVecStorageMethod(vector); + + hypre_VectorSize(vector) = size; + if (multivec_storage_method == 0) + { + hypre_VectorVectorStride(vector) = size; + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_SeqVectorResize + * + * Resize a sequential vector when changing its number of components. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorResize( hypre_Vector *vector, + HYPRE_Int num_vectors_in ) +{ + HYPRE_Int method = hypre_VectorMultiVecStorageMethod(vector); + HYPRE_Int size = hypre_VectorSize(vector); + HYPRE_Int num_vectors = hypre_VectorNumVectors(vector); + HYPRE_Int total_size = num_vectors * size; + HYPRE_Int total_size_in = num_vectors_in * size; + + /* Reallocate data array */ + if (total_size_in > total_size) + { + hypre_VectorData(vector) = hypre_TReAlloc_v2(hypre_VectorData(vector), + HYPRE_Complex, + total_size, + HYPRE_Complex, + total_size_in, + hypre_VectorMemoryLocation(vector)); + } + + /* Update vector info */ + hypre_VectorNumVectors(vector) = num_vectors_in; + if (method == 0) + { + hypre_VectorVectorStride(vector) = size; + hypre_VectorIndexStride(vector) = 1; + } + else if (method == 1) + { + hypre_VectorVectorStride(vector) = 1; + hypre_VectorIndexStride(vector) = num_vectors; + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_SeqVectorRead *--------------------------------------------------------------------------*/ hypre_Vector * @@ -194,7 +294,7 @@ HYPRE_Int hypre_SeqVectorPrint( hypre_Vector *vector, char *file_name ) { - FILE *fp; + FILE *fp; HYPRE_Complex *data; HYPRE_Int size, num_vectors, vecstride, idxstride; @@ -202,8 +302,6 @@ hypre_SeqVectorPrint( hypre_Vector *vector, HYPRE_Int i, j; HYPRE_Complex value; - HYPRE_Int ierr = 0; - num_vectors = hypre_VectorNumVectors(vector); vecstride = hypre_VectorVectorStride(vector); idxstride = hypre_VectorIndexStride(vector); @@ -226,14 +324,14 @@ hypre_SeqVectorPrint( hypre_Vector *vector, hypre_fprintf(fp, "%d vectors of size %d\n", num_vectors, size ); } - if ( num_vectors>1 ) + if ( num_vectors > 1 ) { - for ( j=0; j 0) + if (exec == HYPRE_EXEC_DEVICE) { - HYPRE_THRUST_CALL( fill_n, vector_data, size, value ); + hypre_SeqVectorSetConstantValuesDevice(v, value); } -#else - HYPRE_Int i; -#if defined(HYPRE_USING_DEVICE_OPENMP) -#pragma omp target teams distribute parallel for private(i) is_device_ptr(vector_data) -#elif defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + else #endif - for (i = 0; i < size; i++) { - vector_data[i] = value; + hypre_SeqVectorSetConstantValuesHost(v, value); } -#endif /* defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) */ - -#if defined(HYPRE_USING_GPU) - hypre_SyncCudaComputeStream(hypre_handle()); -#endif #ifdef HYPRE_PROFILE hypre_profile_times[HYPRE_TIMER_ID_BLAS1] += hypre_MPI_Wtime(); #endif - return ierr; + return hypre_error_flag; } /*-------------------------------------------------------------------------- * hypre_SeqVectorSetRandomValues * - * returns vector of values randomly distributed between -1.0 and +1.0 + * returns vector of values randomly distributed between -1.0 and +1.0 *--------------------------------------------------------------------------*/ HYPRE_Int @@ -323,9 +439,8 @@ hypre_SeqVectorSetRandomValues( hypre_Vector *v, HYPRE_Complex *vector_data = hypre_VectorData(v); HYPRE_Int size = hypre_VectorSize(v); HYPRE_Int i; - HYPRE_Int ierr = 0; - hypre_SeedRand(seed); + hypre_SeedRand(seed); size *= hypre_VectorNumVectors(v); if (hypre_GetActualMemLocation(hypre_VectorMemoryLocation(v)) == hypre_MEMORY_HOST) @@ -343,11 +458,12 @@ hypre_SeqVectorSetRandomValues( hypre_Vector *v, { h_data[i] = 2.0 * hypre_Rand() - 1.0; } - hypre_TMemcpy(vector_data, h_data, HYPRE_Complex, size, hypre_VectorMemoryLocation(v), HYPRE_MEMORY_HOST); + hypre_TMemcpy(vector_data, h_data, HYPRE_Complex, size, hypre_VectorMemoryLocation(v), + HYPRE_MEMORY_HOST); hypre_TFree(h_data, HYPRE_MEMORY_HOST); } - return ierr; + return hypre_error_flag; } /*-------------------------------------------------------------------------- @@ -356,6 +472,7 @@ hypre_SeqVectorSetRandomValues( hypre_Vector *v, * if size of x is larger than y only the first size_y elements of x are * copied to y *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_SeqVectorCopy( hypre_Vector *x, hypre_Vector *y ) @@ -364,9 +481,9 @@ hypre_SeqVectorCopy( hypre_Vector *x, hypre_profile_times[HYPRE_TIMER_ID_BLAS1] -= hypre_MPI_Wtime(); #endif - HYPRE_Int ierr = 0; + hypre_GpuProfilingPushRange("SeqVectorCopy"); - size_t size = hypre_min( hypre_VectorSize(x), hypre_VectorSize(y) ) * hypre_VectorNumVectors(x); + size_t size = hypre_min(hypre_VectorSize(x), hypre_VectorSize(y)) * hypre_VectorNumVectors(x); hypre_TMemcpy( hypre_VectorData(y), hypre_VectorData(x), @@ -378,13 +495,74 @@ hypre_SeqVectorCopy( hypre_Vector *x, #ifdef HYPRE_PROFILE hypre_profile_times[HYPRE_TIMER_ID_BLAS1] += hypre_MPI_Wtime(); #endif + hypre_GpuProfilingPopRange(); - return ierr; + return hypre_error_flag; } /*-------------------------------------------------------------------------- - * hypre_SeqVectorCloneDeep - * Returns a complete copy of x - a deep copy, with its own copy of the data. + * hypre_SeqVectorStridedCopy + * + * Perform strided copy from a data array to x->data. + * + * We assume that the data array lives in the same memory location as x->data + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorStridedCopy( hypre_Vector *x, + HYPRE_Int istride, + HYPRE_Int ostride, + HYPRE_Int size, + HYPRE_Complex *data) +{ + HYPRE_Int x_size = hypre_VectorSize(x); + HYPRE_Complex *x_data = hypre_VectorData(x); + + HYPRE_Int i; + + /* Sanity checks */ + if (istride < 1) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Input stride needs to be greater than zero!"); + return hypre_error_flag; + } + + if (ostride < 1) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Output stride needs to be greater than zero!"); + return hypre_error_flag; + } + + if (x_size < (size / istride) * ostride) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Not enough space in x!"); + return hypre_error_flag; + } + +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1(hypre_VectorMemoryLocation(x)); + + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_SeqVectorStridedCopyDevice(x, istride, ostride, size, data); + } + else +#endif + { +#if defined(HYPRE_USING_OPENMP) + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < size; i += istride) + { + x_data[(i / istride) * ostride] = data[i]; + } + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_SeqVectorCloneDeep_v2 *--------------------------------------------------------------------------*/ hypre_Vector* @@ -405,6 +583,12 @@ hypre_SeqVectorCloneDeep_v2( hypre_Vector *x, HYPRE_MemoryLocation memory_locati return y; } +/*-------------------------------------------------------------------------- + * hypre_SeqVectorCloneDeep + * + * Returns a complete copy of x - a deep copy, with its own copy of the data. + *--------------------------------------------------------------------------*/ + hypre_Vector* hypre_SeqVectorCloneDeep( hypre_Vector *x ) { @@ -413,15 +597,16 @@ hypre_SeqVectorCloneDeep( hypre_Vector *x ) /*-------------------------------------------------------------------------- * hypre_SeqVectorCloneShallow + * * Returns a complete copy of x - a shallow copy, pointing the data of x *--------------------------------------------------------------------------*/ hypre_Vector * hypre_SeqVectorCloneShallow( hypre_Vector *x ) { - HYPRE_Int size = hypre_VectorSize(x); - HYPRE_Int num_vectors = hypre_VectorNumVectors(x); - hypre_Vector * y = hypre_SeqMultiVectorCreate( size, num_vectors ); + HYPRE_Int size = hypre_VectorSize(x); + HYPRE_Int num_vectors = hypre_VectorNumVectors(x); + hypre_Vector *y = hypre_SeqMultiVectorCreate(size, num_vectors); hypre_VectorMultiVecStorageMethod(y) = hypre_VectorMultiVecStorageMethod(x); hypre_VectorVectorStride(y) = hypre_VectorVectorStride(x); @@ -430,23 +615,93 @@ hypre_SeqVectorCloneShallow( hypre_Vector *x ) hypre_VectorMemoryLocation(y) = hypre_VectorMemoryLocation(x); hypre_VectorData(y) = hypre_VectorData(x); - hypre_SeqVectorSetDataOwner( y, 0 ); + hypre_SeqVectorSetDataOwner(y, 0); hypre_SeqVectorInitialize(y); return y; } +/*-------------------------------------------------------------------------- + * hypre_SeqVectorMigrate + * + * Migrates the vector data to memory_location. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorMigrate(hypre_Vector *x, + HYPRE_MemoryLocation memory_location ) +{ + HYPRE_Complex *data = hypre_VectorData(x); + HYPRE_Int size = hypre_VectorSize(x); + HYPRE_Int num_vectors = hypre_VectorNumVectors(x); + HYPRE_MemoryLocation old_memory_location = hypre_VectorMemoryLocation(x); + HYPRE_Int total_size = size * num_vectors; + + /* Update x's memory location */ + hypre_VectorMemoryLocation(x) = memory_location; + + if ( hypre_GetActualMemLocation(memory_location) != + hypre_GetActualMemLocation(old_memory_location) ) + { + if (data) + { + HYPRE_Complex *new_data; + + new_data = hypre_TAlloc(HYPRE_Complex, total_size, memory_location); + hypre_TMemcpy(new_data, data, HYPRE_Complex, total_size, + memory_location, old_memory_location); + hypre_VectorData(x) = new_data; + hypre_VectorOwnsData(x) = 1; + + /* Free old data */ + hypre_TFree(data, old_memory_location); + } + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_SeqVectorScaleHost + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorScaleHost( HYPRE_Complex alpha, + hypre_Vector *y ) +{ + HYPRE_Complex *y_data = hypre_VectorData(y); + HYPRE_Int num_vectors = hypre_VectorNumVectors(y); + HYPRE_Int size = hypre_VectorSize(y); + HYPRE_Int total_size = size * num_vectors; + HYPRE_Int i; + +#if defined(HYPRE_USING_OPENMP) + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < total_size; i++) + { + y_data[i] *= alpha; + } + + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- * hypre_SeqVectorScale *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_SeqVectorScale( HYPRE_Complex alpha, hypre_Vector *y ) { +#ifdef HYPRE_PROFILE + hypre_profile_times[HYPRE_TIMER_ID_BLAS1] -= hypre_MPI_Wtime(); +#endif + /* special cases */ if (alpha == 1.0) { - return 0; + return hypre_error_flag; } if (alpha == 0.0) @@ -454,52 +709,57 @@ hypre_SeqVectorScale( HYPRE_Complex alpha, return hypre_SeqVectorSetConstantValues(y, 0.0); } +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1(hypre_VectorMemoryLocation(y)); + + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_SeqVectorScaleDevice(alpha, y); + } + else +#endif + { + hypre_SeqVectorScaleHost(alpha, y); + } + #ifdef HYPRE_PROFILE - hypre_profile_times[HYPRE_TIMER_ID_BLAS1] -= hypre_MPI_Wtime(); + hypre_profile_times[HYPRE_TIMER_ID_BLAS1] += hypre_MPI_Wtime(); #endif - HYPRE_Complex *y_data = hypre_VectorData(y); - HYPRE_Int size = hypre_VectorSize(y); - HYPRE_Int ierr = 0; + return hypre_error_flag; +} - size *= hypre_VectorNumVectors(y); +/*-------------------------------------------------------------------------- + * hypre_SeqVectorAxpyHost + *--------------------------------------------------------------------------*/ - //hypre_SeqVectorPrefetch(y, HYPRE_MEMORY_DEVICE); +HYPRE_Int +hypre_SeqVectorAxpyHost( HYPRE_Complex alpha, + hypre_Vector *x, + hypre_Vector *y ) +{ + HYPRE_Complex *x_data = hypre_VectorData(x); + HYPRE_Complex *y_data = hypre_VectorData(y); + HYPRE_Int num_vectors = hypre_VectorNumVectors(x); + HYPRE_Int size = hypre_VectorSize(x); + HYPRE_Int total_size = size * num_vectors; + HYPRE_Int i; -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) -#if defined(HYPRE_USING_CUBLAS) - HYPRE_CUBLAS_CALL( cublasDscal(hypre_HandleCublasHandle(hypre_handle()), size, &alpha, y_data, 1) ); -#else - HYPRE_THRUST_CALL( transform, y_data, y_data + size, y_data, alpha * _1 ); +#if defined(HYPRE_USING_OPENMP) + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif -#else - HYPRE_Int i; -#if defined(HYPRE_USING_DEVICE_OPENMP) -#pragma omp target teams distribute parallel for private(i) is_device_ptr(y_data) -#elif defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE -#endif - for (i = 0; i < size; i++) + for (i = 0; i < total_size; i++) { - y_data[i] *= alpha; + y_data[i] += alpha * x_data[i]; } -#endif /* defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) */ - -#if defined(HYPRE_USING_GPU) - hypre_SyncCudaComputeStream(hypre_handle()); -#endif - -#ifdef HYPRE_PROFILE - hypre_profile_times[HYPRE_TIMER_ID_BLAS1] += hypre_MPI_Wtime(); -#endif - - return ierr; + return hypre_error_flag; } /*-------------------------------------------------------------------------- * hypre_SeqVectorAxpy *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_SeqVectorAxpy( HYPRE_Complex alpha, hypre_Vector *x, @@ -509,102 +769,227 @@ hypre_SeqVectorAxpy( HYPRE_Complex alpha, hypre_profile_times[HYPRE_TIMER_ID_BLAS1] -= hypre_MPI_Wtime(); #endif - HYPRE_Complex *x_data = hypre_VectorData(x); - HYPRE_Complex *y_data = hypre_VectorData(y); - HYPRE_Int size = hypre_VectorSize(x); - HYPRE_Int ierr = 0; - - size *= hypre_VectorNumVectors(x); - - //hypre_SeqVectorPrefetch(x, HYPRE_MEMORY_DEVICE); - //hypre_SeqVectorPrefetch(y, HYPRE_MEMORY_DEVICE); - -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) -#if defined(HYPRE_USING_CUBLAS) - HYPRE_CUBLAS_CALL( cublasDaxpy(hypre_HandleCublasHandle(hypre_handle()), size, &alpha, x_data, 1, y_data, 1) ); -#else - HYPRE_THRUST_CALL( transform, x_data, x_data + size, y_data, y_data, alpha * _1 + _2 ); -#endif -#else - HYPRE_Int i; -#if defined(HYPRE_USING_DEVICE_OPENMP) -#pragma omp target teams distribute parallel for private(i) is_device_ptr(y_data, x_data) -#elif defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE -#endif - for (i = 0; i < size; i++) +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy2( hypre_VectorMemoryLocation(x), + hypre_VectorMemoryLocation(y) ); + if (exec == HYPRE_EXEC_DEVICE) { - y_data[i] += alpha * x_data[i]; + hypre_SeqVectorAxpyDevice(alpha, x, y); } - -#endif /* defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) */ - -#if defined(HYPRE_USING_GPU) - hypre_SyncCudaComputeStream(hypre_handle()); + else #endif + { + hypre_SeqVectorAxpyHost(alpha, x, y); + } #ifdef HYPRE_PROFILE hypre_profile_times[HYPRE_TIMER_ID_BLAS1] += hypre_MPI_Wtime(); #endif - return ierr; + return hypre_error_flag; } -/* y = y + x ./ b */ +/*-------------------------------------------------------------------------- + * hypre_SeqVectorAxpyzHost + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_SeqVectorElmdivpy( hypre_Vector *x, - hypre_Vector *b, - hypre_Vector *y ) +hypre_SeqVectorAxpyzHost( HYPRE_Complex alpha, + hypre_Vector *x, + HYPRE_Complex beta, + hypre_Vector *y, + hypre_Vector *z ) { -#ifdef HYPRE_PROFILE - hypre_profile_times[HYPRE_TIMER_ID_BLAS1] -= hypre_MPI_Wtime(); + HYPRE_Complex *x_data = hypre_VectorData(x); + HYPRE_Complex *y_data = hypre_VectorData(y); + HYPRE_Complex *z_data = hypre_VectorData(z); + + HYPRE_Int num_vectors = hypre_VectorNumVectors(x); + HYPRE_Int size = hypre_VectorSize(x); + HYPRE_Int total_size = size * num_vectors; + HYPRE_Int i; + +#if defined(HYPRE_USING_OPENMP) + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif + for (i = 0; i < total_size; i++) + { + z_data[i] = alpha * x_data[i] + beta * y_data[i]; + } - HYPRE_Complex *x_data = hypre_VectorData(x); - HYPRE_Complex *b_data = hypre_VectorData(b); - HYPRE_Complex *y_data = hypre_VectorData(y); - HYPRE_Int size = hypre_VectorSize(b); + return hypre_error_flag; +} -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - //HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy2( hypre_VectorMemoryLocation(x), hypre_VectorMemoryLocation(b) ); - //RL: TODO back to hypre_GetExecPolicy2 later - HYPRE_ExecutionPolicy exec = HYPRE_EXEC_DEVICE; +/*-------------------------------------------------------------------------- + * hypre_SeqVectorAxpyz + * + * Computes z = a*x + b*y + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorAxpyz( HYPRE_Complex alpha, + hypre_Vector *x, + HYPRE_Complex beta, + hypre_Vector *y, + hypre_Vector *z ) +{ +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy2( hypre_VectorMemoryLocation(x), + hypre_VectorMemoryLocation(y)); if (exec == HYPRE_EXEC_DEVICE) { - //TODO - //hypre_SeqVectorElmdivpyDevice(x, b, y); - /* -#if defined(HYPRE_USING_DEVICE_OPENMP) -#pragma omp target teams distribute parallel for private(i) is_device_ptr(u_data,v_data,l1_norms) -#endif - */ - hypreDevice_IVAXPY(size, b_data, x_data, y_data); + hypre_SeqVectorAxpyzDevice(alpha, x, beta, y, z); } else #endif { - HYPRE_Int i; + hypre_SeqVectorAxpyzHost(alpha, x, beta, y, z); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_SeqVectorElmdivpyHost + * + * if marker != NULL: only for marker[i] == marker_val + * + * TODO: + * 1) Change to hypre_SeqVectorElmdivpyMarkedHost? + * 2) Add vecstride/idxstride variables + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorElmdivpyHost( hypre_Vector *x, + hypre_Vector *b, + hypre_Vector *y, + HYPRE_Int *marker, + HYPRE_Int marker_val ) +{ + HYPRE_Complex *x_data = hypre_VectorData(x); + HYPRE_Complex *b_data = hypre_VectorData(b); + HYPRE_Complex *y_data = hypre_VectorData(y); + HYPRE_Int num_vectors_x = hypre_VectorNumVectors(x); + HYPRE_Int num_vectors_y = hypre_VectorNumVectors(y); + HYPRE_Int num_vectors_b = hypre_VectorNumVectors(b); + HYPRE_Int size = hypre_VectorSize(b); + HYPRE_Int i, j; + HYPRE_Complex val; + + if (num_vectors_b == 1) + { + if (num_vectors_x == 1 && + num_vectors_y == 1) + { + if (marker) + { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif - for (i = 0; i < size; i++) + for (i = 0; i < size; i++) + { + if (marker[i] == marker_val) + { + y_data[i] += x_data[i] / b_data[i]; + } + } + } + else + { +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < size; i++) + { + y_data[i] += x_data[i] / b_data[i]; + } + } /* if (marker) */ + } + else if (num_vectors_x == 2 && + num_vectors_y == 2) { - y_data[i] += x_data[i] / b_data[i]; + if (marker) + { +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < size; i++) + { + val = 1.0 / b_data[i]; + if (marker[i] == marker_val) + { + y_data[i] += x_data[i] * val; + y_data[i + size] += x_data[i + size] * val; + } + } + } + else + { +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < size; i++) + { + val = 1.0 / b_data[i]; + + y_data[i] += x_data[i] * val; + y_data[i + size] += x_data[i + size] * val; + } + } /* if (marker) */ } - } - -#if defined(HYPRE_USING_GPU) - hypre_SyncCudaComputeStream(hypre_handle()); + else if (num_vectors_x == num_vectors_y) + { + if (marker) + { +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i, j) HYPRE_SMP_SCHEDULE #endif - -#ifdef HYPRE_PROFILE - hypre_profile_times[HYPRE_TIMER_ID_BLAS1] += hypre_MPI_Wtime(); + for (i = 0; i < size; i++) + { + val = 1.0 / b_data[i]; + if (marker[i] == marker_val) + { + for (j = 0; j < num_vectors_x; j++) + { + y_data[i + size * j] += x_data[i + size * j] * val; + } + } + } + } + else + { +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i, j) HYPRE_SMP_SCHEDULE #endif + for (i = 0; i < size; i++) + { + val = 1.0 / b_data[i]; + for (j = 0; j < num_vectors_x; j++) + { + y_data[i + size * j] += x_data[i + size * j] * val; + } + } + } /* if (marker) */ + } + else + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unsupported combination of num_vectors!\n"); + } + } + else + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "num_vectors_b != 1 not supported!\n"); + } return hypre_error_flag; } -/* y[i] += x[i] / b[i] where marker[i] == marker_val */ +/*-------------------------------------------------------------------------- + * hypre_SeqVectorElmdivpyMarked + * + * Computes: y[i] = y[i] + x[i] / b[i] for marker[i] = marker_val + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_SeqVectorElmdivpyMarked( hypre_Vector *x, hypre_Vector *b, @@ -616,36 +1001,54 @@ hypre_SeqVectorElmdivpyMarked( hypre_Vector *x, hypre_profile_times[HYPRE_TIMER_ID_BLAS1] -= hypre_MPI_Wtime(); #endif - HYPRE_Complex *x_data = hypre_VectorData(x); - HYPRE_Complex *b_data = hypre_VectorData(b); - HYPRE_Complex *y_data = hypre_VectorData(y); - HYPRE_Int size = hypre_VectorSize(b); + /* Sanity checks */ + if (hypre_VectorSize(x) < hypre_VectorSize(b)) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "sizes of x and b do not match!\n"); + return hypre_error_flag; + } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy2( hypre_VectorMemoryLocation(x), hypre_VectorMemoryLocation(b) ); - if (exec == HYPRE_EXEC_DEVICE) + if (!hypre_VectorSize(x)) { - hypreDevice_IVAXPYMarked(size, b_data, x_data, y_data, marker, marker_val); + /* VPM: Do not throw an error message here since this can happen for idle processors */ + return hypre_error_flag; } - else -#endif + + if (!hypre_VectorData(x)) { - HYPRE_Int i; -#ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE -#endif - for (i = 0; i < size; i++) - { - if (marker[i] == marker_val) - { - y_data[i] += x_data[i] / b_data[i]; - } - } + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "x_data is not present!\n"); + return hypre_error_flag; + } + + if (!hypre_VectorData(b)) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "b_data is not present!\n"); + return hypre_error_flag; } + if (!hypre_VectorData(y)) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "y_data is not present!\n"); + return hypre_error_flag; + } + + /* row-wise multivec is not supported */ + hypre_assert(hypre_VectorMultiVecStorageMethod(x) == 0); + hypre_assert(hypre_VectorMultiVecStorageMethod(b) == 0); + hypre_assert(hypre_VectorMultiVecStorageMethod(y) == 0); + #if defined(HYPRE_USING_GPU) - hypre_SyncCudaComputeStream(hypre_handle()); + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy2( hypre_VectorMemoryLocation(x), + hypre_VectorMemoryLocation(b) ); + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_SeqVectorElmdivpyDevice(x, b, y, marker, marker_val); + } + else #endif + { + hypre_SeqVectorElmdivpyHost(x, b, y, marker, marker_val); + } #ifdef HYPRE_PROFILE hypre_profile_times[HYPRE_TIMER_ID_BLAS1] += hypre_MPI_Wtime(); @@ -654,9 +1057,56 @@ hypre_SeqVectorElmdivpyMarked( hypre_Vector *x, return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_SeqVectorElmdivpy + * + * Computes: y = y + x ./ b + * + * Notes: + * 1) x and b must have the same sizes + * 2) x and y can have different sizes + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorElmdivpy( hypre_Vector *x, + hypre_Vector *b, + hypre_Vector *y ) +{ + return hypre_SeqVectorElmdivpyMarked(x, b, y, NULL, -1); +} + +/*-------------------------------------------------------------------------- + * hypre_SeqVectorInnerProdHost + *--------------------------------------------------------------------------*/ + +HYPRE_Real +hypre_SeqVectorInnerProdHost( hypre_Vector *x, + hypre_Vector *y ) +{ + HYPRE_Complex *x_data = hypre_VectorData(x); + HYPRE_Complex *y_data = hypre_VectorData(y); + HYPRE_Int num_vectors = hypre_VectorNumVectors(x); + HYPRE_Int size = hypre_VectorSize(x); + HYPRE_Int total_size = size * num_vectors; + + HYPRE_Real result = 0.0; + HYPRE_Int i; + +#if defined(HYPRE_USING_OPENMP) + #pragma omp parallel for private(i) reduction(+:result) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < total_size; i++) + { + result += hypre_conj(y_data[i]) * x_data[i]; + } + + return result; +} + /*-------------------------------------------------------------------------- * hypre_SeqVectorInnerProd *--------------------------------------------------------------------------*/ + HYPRE_Real hypre_SeqVectorInnerProd( hypre_Vector *x, hypre_Vector *y ) @@ -665,43 +1115,20 @@ hypre_SeqVectorInnerProd( hypre_Vector *x, hypre_profile_times[HYPRE_TIMER_ID_BLAS1] -= hypre_MPI_Wtime(); #endif - HYPRE_Complex *x_data = hypre_VectorData(x); - HYPRE_Complex *y_data = hypre_VectorData(y); - HYPRE_Int size = hypre_VectorSize(x); - HYPRE_Real result = 0.0; - - size *= hypre_VectorNumVectors(x); + HYPRE_Real result; - //hypre_SeqVectorPrefetch(x, HYPRE_MEMORY_DEVICE); - //hypre_SeqVectorPrefetch(y, HYPRE_MEMORY_DEVICE); - -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) -#ifndef HYPRE_COMPLEX -#if defined(HYPRE_USING_CUBLAS) - HYPRE_CUBLAS_CALL( cublasDdot(hypre_HandleCublasHandle(hypre_handle()), size, x_data, 1, y_data, 1, &result) ); -#else - result = HYPRE_THRUST_CALL( inner_product, x_data, x_data + size, y_data, 0.0 ); -#endif -#else - /* TODO */ -#error "Complex inner product" -#endif -#else /* #if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) */ - HYPRE_Int i; -#if defined(HYPRE_USING_DEVICE_OPENMP) -#pragma omp target teams distribute parallel for private(i) reduction(+:result) is_device_ptr(y_data,x_data) map(result) -#elif defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) reduction(+:result) HYPRE_SMP_SCHEDULE -#endif - for (i = 0; i < size; i++) +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy2( hypre_VectorMemoryLocation(x), + hypre_VectorMemoryLocation(y) ); + if (exec == HYPRE_EXEC_DEVICE) { - result += hypre_conj(y_data[i]) * x_data[i]; + result = hypre_SeqVectorInnerProdDevice(x, y); } -#endif /* defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) */ - -#if defined(HYPRE_USING_GPU) - hypre_SyncCudaComputeStream(hypre_handle()); + else #endif + { + result = hypre_SeqVectorInnerProdHost(x, y); + } #ifdef HYPRE_PROFILE hypre_profile_times[HYPRE_TIMER_ID_BLAS1] += hypre_MPI_Wtime(); @@ -710,53 +1137,85 @@ hypre_SeqVectorInnerProd( hypre_Vector *x, return result; } -//TODO - /*-------------------------------------------------------------------------- - * hypre_VectorSumElts: - * Returns the sum of all vector elements. + * hypre_SeqVectorSumEltsHost *--------------------------------------------------------------------------*/ -HYPRE_Complex hypre_SeqVectorSumElts( hypre_Vector *vector ) +HYPRE_Complex +hypre_SeqVectorSumEltsHost( hypre_Vector *vector ) { - HYPRE_Complex sum = 0; - HYPRE_Complex *data = hypre_VectorData( vector ); - HYPRE_Int size = hypre_VectorSize( vector ); - HYPRE_Int i; + HYPRE_Complex *data = hypre_VectorData( vector ); + HYPRE_Int num_vectors = hypre_VectorNumVectors(vector); + HYPRE_Int size = hypre_VectorSize(vector); + HYPRE_Int total_size = size * num_vectors; + + HYPRE_Complex sum = 0; + HYPRE_Int i; #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(i) reduction(+:sum) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) reduction(+:sum) HYPRE_SMP_SCHEDULE #endif - for ( i=0; i data) #define hypre_VectorSize(vector) ((vector) -> size) +#define hypre_VectorComponent(vector) ((vector) -> component) #define hypre_VectorOwnsData(vector) ((vector) -> owns_data) #define hypre_VectorMemoryLocation(vector) ((vector) -> memory_location) #define hypre_VectorNumVectors(vector) ((vector) -> num_vectors) #define hypre_VectorMultiVecStorageMethod(vector) ((vector) -> multivec_storage_method) -#define hypre_VectorVectorStride(vector) ((vector) -> vecstride ) -#define hypre_VectorIndexStride(vector) ((vector) -> idxstride ) +#define hypre_VectorVectorStride(vector) ((vector) -> vecstride) +#define hypre_VectorIndexStride(vector) ((vector) -> idxstride) +#define hypre_VectorEntryI(vector, i) ((vector) -> data[i]) +#define hypre_VectorEntryIJ(vector, i, j) \ + ((vector) -> data[((vector) -> vecstride) * j + ((vector) -> idxstride) * i]) #endif - diff --git a/external/hypre/src/seq_mv/vector_batched.c b/external/hypre/src/seq_mv/vector_batched.c index 626c077a..dd7739e2 100644 --- a/external/hypre/src/seq_mv/vector_batched.c +++ b/external/hypre/src/seq_mv/vector_batched.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -13,8 +13,8 @@ HYPRE_Int hypre_SeqVectorMassAxpy8( HYPRE_Complex *alpha, - hypre_Vector **x, - hypre_Vector *y, HYPRE_Int k) + hypre_Vector **x, + hypre_Vector *y, HYPRE_Int k) { HYPRE_Complex *x_data = hypre_VectorData(x[0]); HYPRE_Complex *y_data = hypre_VectorData(y); @@ -23,107 +23,109 @@ hypre_SeqVectorMassAxpy8( HYPRE_Complex *alpha, HYPRE_Int i, j, jstart, restk; - restk = (k-(k/8*8)); + restk = (k - (k / 8 * 8)); if (k > 7) { - for (j = 0; j < k-7; j += 8) + for (j = 0; j < k - 7; j += 8) { - jstart = j*size; + jstart = j * size; #if defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < size; i++) { - y_data[i] += alpha[j]*x_data[jstart+i] + alpha[j+1]*x_data[jstart+i+size] - + alpha[j+2]*x_data[(j+2)*size+i] + alpha[j+3]*x_data[(j+3)*size+i] - + alpha[j+4]*x_data[(j+4)*size+i] + alpha[j+5]*x_data[(j+5)*size+i] - + alpha[j+6]*x_data[(j+6)*size+i] + alpha[j+7]*x_data[(j+7)*size+i]; + y_data[i] += alpha[j] * x_data[jstart + i] + alpha[j + 1] * x_data[jstart + i + size] + + alpha[j + 2] * x_data[(j + 2) * size + i] + alpha[j + 3] * x_data[(j + 3) * size + i] + + alpha[j + 4] * x_data[(j + 4) * size + i] + alpha[j + 5] * x_data[(j + 5) * size + i] + + alpha[j + 6] * x_data[(j + 6) * size + i] + alpha[j + 7] * x_data[(j + 7) * size + i]; } } } if (restk == 1) { - jstart = (k-1)*size; + jstart = (k - 1) * size; #if defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < size; i++) { - y_data[i] += alpha[k-1] * x_data[jstart+i]; + y_data[i] += alpha[k - 1] * x_data[jstart + i]; } } else if (restk == 2) { - jstart = (k-2)*size; + jstart = (k - 2) * size; #if defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < size; i++) { - y_data[i] += alpha[k-2] * x_data[jstart+i] + alpha[k-1] * x_data[jstart+size+i]; + y_data[i] += alpha[k - 2] * x_data[jstart + i] + alpha[k - 1] * x_data[jstart + size + i]; } } else if (restk == 3) { - jstart = (k-3)*size; + jstart = (k - 3) * size; #if defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < size; i++) { - y_data[i] += alpha[k-3] * x_data[jstart+i] + alpha[k-2] * x_data[jstart+size+i] + alpha[k-1] * x_data[(k-1)*size+i]; + y_data[i] += alpha[k - 3] * x_data[jstart + i] + alpha[k - 2] * x_data[jstart + size + i] + alpha[k + - 1] * + x_data[(k - 1) * size + i]; } } else if (restk == 4) { - jstart = (k-4)*size; + jstart = (k - 4) * size; #if defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < size; i++) { - y_data[i] += alpha[k-4]*x_data[(k-4)*size+i] + alpha[k-3]*x_data[(k-3)*size+i] - + alpha[k-2]*x_data[(k-2)*size+i] + alpha[k-1]*x_data[(k-1)*size+i]; + y_data[i] += alpha[k - 4] * x_data[(k - 4) * size + i] + alpha[k - 3] * x_data[(k - 3) * size + i] + + alpha[k - 2] * x_data[(k - 2) * size + i] + alpha[k - 1] * x_data[(k - 1) * size + i]; } } else if (restk == 5) { #if defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < size; i++) { - y_data[i] += + alpha[k-5]*x_data[(k-5)*size+i] + alpha[k-4]*x_data[(k-4)*size+i] - + alpha[k-3]*x_data[(k-3)*size+i] + alpha[k-2]*x_data[(k-2)*size+i] - + alpha[k-1]*x_data[(k-1)*size+i]; + y_data[i] += + alpha[k - 5] * x_data[(k - 5) * size + i] + alpha[k - 4] * x_data[(k - 4) * size + i] + + alpha[k - 3] * x_data[(k - 3) * size + i] + alpha[k - 2] * x_data[(k - 2) * size + i] + + alpha[k - 1] * x_data[(k - 1) * size + i]; } } else if (restk == 6) { - jstart = (k-6)*size; + jstart = (k - 6) * size; #if defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < size; i++) { - y_data[i] += alpha[k-6]*x_data[jstart+i] + alpha[k-5]*x_data[jstart+i+size] - + alpha[k-4]*x_data[(k-4)*size+i] + alpha[k-3]*x_data[(k-3)*size+i] - + alpha[k-2]*x_data[(k-2)*size+i] + alpha[k-1]*x_data[(k-1)*size+i]; + y_data[i] += alpha[k - 6] * x_data[jstart + i] + alpha[k - 5] * x_data[jstart + i + size] + + alpha[k - 4] * x_data[(k - 4) * size + i] + alpha[k - 3] * x_data[(k - 3) * size + i] + + alpha[k - 2] * x_data[(k - 2) * size + i] + alpha[k - 1] * x_data[(k - 1) * size + i]; } } else if (restk == 7) { - jstart = (k-7)*size; + jstart = (k - 7) * size; #if defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < size; i++) { - y_data[i] += alpha[k-7]*x_data[jstart+i] + alpha[k-6]*x_data[jstart+i+size] - + alpha[k-5]*x_data[(k-5)*size+i] + alpha[k-4]*x_data[(k-4)*size+i] - + alpha[k-3]*x_data[(k-3)*size+i] + alpha[k-2]*x_data[(k-2)*size+i] - + alpha[k-1]*x_data[(k-1)*size+i]; + y_data[i] += alpha[k - 7] * x_data[jstart + i] + alpha[k - 6] * x_data[jstart + i + size] + + alpha[k - 5] * x_data[(k - 5) * size + i] + alpha[k - 4] * x_data[(k - 4) * size + i] + + alpha[k - 3] * x_data[(k - 3) * size + i] + alpha[k - 2] * x_data[(k - 2) * size + i] + + alpha[k - 1] * x_data[(k - 1) * size + i]; } } @@ -136,8 +138,8 @@ hypre_SeqVectorMassAxpy8( HYPRE_Complex *alpha, HYPRE_Int hypre_SeqVectorMassAxpy4( HYPRE_Complex *alpha, - hypre_Vector **x, - hypre_Vector *y, HYPRE_Int k) + hypre_Vector **x, + hypre_Vector *y, HYPRE_Int k) { HYPRE_Complex *x_data = hypre_VectorData(x[0]); HYPRE_Complex *y_data = hypre_VectorData(y); @@ -146,54 +148,56 @@ hypre_SeqVectorMassAxpy4( HYPRE_Complex *alpha, HYPRE_Int i, j, jstart, restk; - restk = (k-(k/4*4)); + restk = (k - (k / 4 * 4)); if (k > 3) { - for (j = 0; j < k-3; j += 4) + for (j = 0; j < k - 3; j += 4) { - jstart = j*size; + jstart = j * size; #if defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < size; i++) { - y_data[i] += alpha[j]*x_data[jstart+i] + alpha[j+1]*x_data[jstart+i+size] - + alpha[j+2]*x_data[(j+2)*size+i] + alpha[j+3]*x_data[(j+3)*size+i]; + y_data[i] += alpha[j] * x_data[jstart + i] + alpha[j + 1] * x_data[jstart + i + size] + + alpha[j + 2] * x_data[(j + 2) * size + i] + alpha[j + 3] * x_data[(j + 3) * size + i]; } } } if (restk == 1) { - jstart = (k-1)*size; + jstart = (k - 1) * size; #if defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < size; i++) { - y_data[i] += alpha[k-1] * x_data[jstart+i]; + y_data[i] += alpha[k - 1] * x_data[jstart + i]; } } else if (restk == 2) { - jstart = (k-2)*size; + jstart = (k - 2) * size; #if defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < size; i++) { - y_data[i] += alpha[k-2] * x_data[jstart+i] + alpha[k-1] * x_data[jstart+size+i]; + y_data[i] += alpha[k - 2] * x_data[jstart + i] + alpha[k - 1] * x_data[jstart + size + i]; } } else if (restk == 3) { - jstart = (k-3)*size; + jstart = (k - 3) * size; #if defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < size; i++) { - y_data[i] += alpha[k-3] * x_data[jstart+i] + alpha[k-2] * x_data[jstart+size+i] + alpha[k-1] * x_data[(k-1)*size+i]; + y_data[i] += alpha[k - 3] * x_data[jstart + i] + alpha[k - 2] * x_data[jstart + size + i] + alpha[k + - 1] * + x_data[(k - 1) * size + i]; } } @@ -206,8 +210,8 @@ hypre_SeqVectorMassAxpy4( HYPRE_Complex *alpha, HYPRE_Int hypre_SeqVectorMassAxpy( HYPRE_Complex *alpha, - hypre_Vector **x, - hypre_Vector *y, HYPRE_Int k, HYPRE_Int unroll) + hypre_Vector **x, + hypre_Vector *y, HYPRE_Int k, HYPRE_Int unroll) { HYPRE_Complex *x_data = hypre_VectorData(x[0]); HYPRE_Complex *y_data = hypre_VectorData(y); @@ -229,13 +233,13 @@ hypre_SeqVectorMassAxpy( HYPRE_Complex *alpha, { for (j = 0; j < k; j++) { - jstart = j*size; + jstart = j * size; #if defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < size; i++) { - y_data[i] += alpha[j]*x_data[jstart+i]; + y_data[i] += alpha[j] * x_data[jstart + i]; } } } @@ -247,7 +251,7 @@ hypre_SeqVectorMassAxpy( HYPRE_Complex *alpha, * hypre_SeqVectorMassInnerProd8 *--------------------------------------------------------------------------*/ HYPRE_Int hypre_SeqVectorMassInnerProd8( hypre_Vector *x, - hypre_Vector **y, HYPRE_Int k, HYPRE_Real *result) + hypre_Vector **y, HYPRE_Int k, HYPRE_Real *result) { HYPRE_Complex *x_data = hypre_VectorData(x); HYPRE_Complex *y_data = hypre_VectorData(y[0]); @@ -271,11 +275,11 @@ HYPRE_Int hypre_SeqVectorMassInnerProd8( hypre_Vector *x, HYPRE_Int jstart6; HYPRE_Int jstart7; - restk = (k-(k/8*8)); + restk = (k - (k / 8 * 8)); if (k > 7) { - for (j = 0; j < k-7; j += 8) + for (j = 0; j < k - 7; j += 8) { res1 = 0; res2 = 0; @@ -285,88 +289,88 @@ HYPRE_Int hypre_SeqVectorMassInnerProd8( hypre_Vector *x, res6 = 0; res7 = 0; res8 = 0; - jstart = j*size; - jstart1 = jstart+size; - jstart2 = jstart1+size; - jstart3 = jstart2+size; - jstart4 = jstart3+size; - jstart5 = jstart4+size; - jstart6 = jstart5+size; - jstart7 = jstart6+size; + jstart = j * size; + jstart1 = jstart + size; + jstart2 = jstart1 + size; + jstart3 = jstart2 + size; + jstart4 = jstart3 + size; + jstart5 = jstart4 + size; + jstart6 = jstart5 + size; + jstart7 = jstart6 + size; #if defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) reduction(+:res1,res2,res3,res4,res5,res6,res7,res8) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) reduction(+:res1,res2,res3,res4,res5,res6,res7,res8) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < size; i++) { - res1 += hypre_conj(y_data[jstart+i]) * x_data[i]; - res2 += hypre_conj(y_data[jstart1+i]) * x_data[i]; - res3 += hypre_conj(y_data[jstart2+i]) * x_data[i]; - res4 += hypre_conj(y_data[jstart3+i]) * x_data[i]; - res5 += hypre_conj(y_data[jstart4+i]) * x_data[i]; - res6 += hypre_conj(y_data[jstart5+i]) * x_data[i]; - res7 += hypre_conj(y_data[jstart6+i]) * x_data[i]; - res8 += hypre_conj(y_data[jstart7+i]) * x_data[i]; + res1 += hypre_conj(y_data[jstart + i]) * x_data[i]; + res2 += hypre_conj(y_data[jstart1 + i]) * x_data[i]; + res3 += hypre_conj(y_data[jstart2 + i]) * x_data[i]; + res4 += hypre_conj(y_data[jstart3 + i]) * x_data[i]; + res5 += hypre_conj(y_data[jstart4 + i]) * x_data[i]; + res6 += hypre_conj(y_data[jstart5 + i]) * x_data[i]; + res7 += hypre_conj(y_data[jstart6 + i]) * x_data[i]; + res8 += hypre_conj(y_data[jstart7 + i]) * x_data[i]; } result[j] = res1; - result[j+1] = res2; - result[j+2] = res3; - result[j+3] = res4; - result[j+4] = res5; - result[j+5] = res6; - result[j+6] = res7; - result[j+7] = res8; + result[j + 1] = res2; + result[j + 2] = res3; + result[j + 3] = res4; + result[j + 4] = res5; + result[j + 5] = res6; + result[j + 6] = res7; + result[j + 7] = res8; } } if (restk == 1) { res1 = 0; - jstart = (k-1)*size; + jstart = (k - 1) * size; #if defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) reduction(+:res1) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) reduction(+:res1) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < size; i++) { - res1 += hypre_conj(y_data[jstart+i]) * x_data[i]; + res1 += hypre_conj(y_data[jstart + i]) * x_data[i]; } - result[k-1] = res1; + result[k - 1] = res1; } else if (restk == 2) { res1 = 0; res2 = 0; - jstart = (k-2)*size; - jstart1 = jstart+size; + jstart = (k - 2) * size; + jstart1 = jstart + size; #if defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) reduction(+:res1,res2) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) reduction(+:res1,res2) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < size; i++) { - res1 += hypre_conj(y_data[jstart+i]) * x_data[i]; - res2 += hypre_conj(y_data[jstart1+i]) * x_data[i]; + res1 += hypre_conj(y_data[jstart + i]) * x_data[i]; + res2 += hypre_conj(y_data[jstart1 + i]) * x_data[i]; } - result[k-2] = res1; - result[k-1] = res2; + result[k - 2] = res1; + result[k - 1] = res2; } else if (restk == 3) { res1 = 0; res2 = 0; res3 = 0; - jstart = (k-3)*size; - jstart1 = jstart+size; - jstart2 = jstart1+size; + jstart = (k - 3) * size; + jstart1 = jstart + size; + jstart2 = jstart1 + size; #if defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) reduction(+:res1,res2,res3) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) reduction(+:res1,res2,res3) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < size; i++) { - res1 += hypre_conj(y_data[jstart+i]) * x_data[i]; - res2 += hypre_conj(y_data[jstart1+i]) * x_data[i]; - res3 += hypre_conj(y_data[jstart2+i]) * x_data[i]; + res1 += hypre_conj(y_data[jstart + i]) * x_data[i]; + res2 += hypre_conj(y_data[jstart1 + i]) * x_data[i]; + res3 += hypre_conj(y_data[jstart2 + i]) * x_data[i]; } - result[k-3] = res1; - result[k-2] = res2; - result[k-1] = res3; + result[k - 3] = res1; + result[k - 2] = res2; + result[k - 1] = res3; } else if (restk == 4) { @@ -374,24 +378,24 @@ HYPRE_Int hypre_SeqVectorMassInnerProd8( hypre_Vector *x, res2 = 0; res3 = 0; res4 = 0; - jstart = (k-4)*size; - jstart1 = jstart+size; - jstart2 = jstart1+size; - jstart3 = jstart2+size; + jstart = (k - 4) * size; + jstart1 = jstart + size; + jstart2 = jstart1 + size; + jstart3 = jstart2 + size; #if defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) reduction(+:res1,res2,res3,res4) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) reduction(+:res1,res2,res3,res4) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < size; i++) { - res1 += hypre_conj(y_data[jstart+i]) * x_data[i]; - res2 += hypre_conj(y_data[jstart1+i]) * x_data[i]; - res3 += hypre_conj(y_data[jstart2+i]) * x_data[i]; - res4 += hypre_conj(y_data[jstart3+i]) * x_data[i]; + res1 += hypre_conj(y_data[jstart + i]) * x_data[i]; + res2 += hypre_conj(y_data[jstart1 + i]) * x_data[i]; + res3 += hypre_conj(y_data[jstart2 + i]) * x_data[i]; + res4 += hypre_conj(y_data[jstart3 + i]) * x_data[i]; } - result[k-4] = res1; - result[k-3] = res2; - result[k-2] = res3; - result[k-1] = res4; + result[k - 4] = res1; + result[k - 3] = res2; + result[k - 2] = res3; + result[k - 1] = res4; } else if (restk == 5) { @@ -400,27 +404,27 @@ HYPRE_Int hypre_SeqVectorMassInnerProd8( hypre_Vector *x, res3 = 0; res4 = 0; res5 = 0; - jstart = (k-5)*size; - jstart1 = jstart+size; - jstart2 = jstart1+size; - jstart3 = jstart2+size; - jstart4 = jstart3+size; + jstart = (k - 5) * size; + jstart1 = jstart + size; + jstart2 = jstart1 + size; + jstart3 = jstart2 + size; + jstart4 = jstart3 + size; #if defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) reduction(+:res1,res2,res3,res4,res5) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) reduction(+:res1,res2,res3,res4,res5) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < size; i++) { - res1 += hypre_conj(y_data[jstart+i]) * x_data[i]; - res2 += hypre_conj(y_data[jstart1+i]) * x_data[i]; - res3 += hypre_conj(y_data[jstart2+i]) * x_data[i]; - res4 += hypre_conj(y_data[jstart3+i]) * x_data[i]; - res5 += hypre_conj(y_data[jstart4+i]) * x_data[i]; + res1 += hypre_conj(y_data[jstart + i]) * x_data[i]; + res2 += hypre_conj(y_data[jstart1 + i]) * x_data[i]; + res3 += hypre_conj(y_data[jstart2 + i]) * x_data[i]; + res4 += hypre_conj(y_data[jstart3 + i]) * x_data[i]; + res5 += hypre_conj(y_data[jstart4 + i]) * x_data[i]; } - result[k-5] = res1; - result[k-4] = res2; - result[k-3] = res3; - result[k-2] = res4; - result[k-1] = res5; + result[k - 5] = res1; + result[k - 4] = res2; + result[k - 3] = res3; + result[k - 2] = res4; + result[k - 1] = res5; } else if (restk == 6) { @@ -430,30 +434,30 @@ HYPRE_Int hypre_SeqVectorMassInnerProd8( hypre_Vector *x, res4 = 0; res5 = 0; res6 = 0; - jstart = (k-6)*size; - jstart1 = jstart+size; - jstart2 = jstart1+size; - jstart3 = jstart2+size; - jstart4 = jstart3+size; - jstart5 = jstart4+size; + jstart = (k - 6) * size; + jstart1 = jstart + size; + jstart2 = jstart1 + size; + jstart3 = jstart2 + size; + jstart4 = jstart3 + size; + jstart5 = jstart4 + size; #if defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) reduction(+:res1,res2,res3,res4,res5,res6) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) reduction(+:res1,res2,res3,res4,res5,res6) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < size; i++) { - res1 += hypre_conj(y_data[jstart+i]) * x_data[i]; - res2 += hypre_conj(y_data[jstart1+i]) * x_data[i]; - res3 += hypre_conj(y_data[jstart2+i]) * x_data[i]; - res4 += hypre_conj(y_data[jstart3+i]) * x_data[i]; - res5 += hypre_conj(y_data[jstart4+i]) * x_data[i]; - res6 += hypre_conj(y_data[jstart5+i]) * x_data[i]; + res1 += hypre_conj(y_data[jstart + i]) * x_data[i]; + res2 += hypre_conj(y_data[jstart1 + i]) * x_data[i]; + res3 += hypre_conj(y_data[jstart2 + i]) * x_data[i]; + res4 += hypre_conj(y_data[jstart3 + i]) * x_data[i]; + res5 += hypre_conj(y_data[jstart4 + i]) * x_data[i]; + res6 += hypre_conj(y_data[jstart5 + i]) * x_data[i]; } - result[k-6] = res1; - result[k-5] = res2; - result[k-4] = res3; - result[k-3] = res4; - result[k-2] = res5; - result[k-1] = res6; + result[k - 6] = res1; + result[k - 5] = res2; + result[k - 4] = res3; + result[k - 3] = res4; + result[k - 2] = res5; + result[k - 1] = res6; } else if (restk == 7) { @@ -464,33 +468,33 @@ HYPRE_Int hypre_SeqVectorMassInnerProd8( hypre_Vector *x, res5 = 0; res6 = 0; res7 = 0; - jstart = (k-7)*size; - jstart1 = jstart+size; - jstart2 = jstart1+size; - jstart3 = jstart2+size; - jstart4 = jstart3+size; - jstart5 = jstart4+size; - jstart6 = jstart5+size; + jstart = (k - 7) * size; + jstart1 = jstart + size; + jstart2 = jstart1 + size; + jstart3 = jstart2 + size; + jstart4 = jstart3 + size; + jstart5 = jstart4 + size; + jstart6 = jstart5 + size; #if defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) reduction(+:res1,res2,res3,res4,res5,res6,res7) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) reduction(+:res1,res2,res3,res4,res5,res6,res7) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < size; i++) { - res1 += hypre_conj(y_data[jstart+i]) * x_data[i]; - res2 += hypre_conj(y_data[jstart1+i]) * x_data[i]; - res3 += hypre_conj(y_data[jstart2+i]) * x_data[i]; - res4 += hypre_conj(y_data[jstart3+i]) * x_data[i]; - res5 += hypre_conj(y_data[jstart4+i]) * x_data[i]; - res6 += hypre_conj(y_data[jstart5+i]) * x_data[i]; - res7 += hypre_conj(y_data[jstart6+i]) * x_data[i]; + res1 += hypre_conj(y_data[jstart + i]) * x_data[i]; + res2 += hypre_conj(y_data[jstart1 + i]) * x_data[i]; + res3 += hypre_conj(y_data[jstart2 + i]) * x_data[i]; + res4 += hypre_conj(y_data[jstart3 + i]) * x_data[i]; + res5 += hypre_conj(y_data[jstart4 + i]) * x_data[i]; + res6 += hypre_conj(y_data[jstart5 + i]) * x_data[i]; + res7 += hypre_conj(y_data[jstart6 + i]) * x_data[i]; } - result[k-7] = res1; - result[k-6] = res2; - result[k-5] = res3; - result[k-4] = res4; - result[k-3] = res5; - result[k-2] = res6; - result[k-1] = res7; + result[k - 7] = res1; + result[k - 6] = res2; + result[k - 5] = res3; + result[k - 4] = res4; + result[k - 3] = res5; + result[k - 2] = res6; + result[k - 1] = res7; } @@ -501,7 +505,7 @@ HYPRE_Int hypre_SeqVectorMassInnerProd8( hypre_Vector *x, * hypre_SeqVectorMassInnerProd4 *--------------------------------------------------------------------------*/ HYPRE_Int hypre_SeqVectorMassInnerProd4( hypre_Vector *x, - hypre_Vector **y, HYPRE_Int k, HYPRE_Real *result) + hypre_Vector **y, HYPRE_Int k, HYPRE_Real *result) { HYPRE_Complex *x_data = hypre_VectorData(x); HYPRE_Complex *y_data = hypre_VectorData(y[0]); @@ -517,86 +521,86 @@ HYPRE_Int hypre_SeqVectorMassInnerProd4( hypre_Vector *x, HYPRE_Int jstart2; HYPRE_Int jstart3; - restk = (k-(k/4*4)); + restk = (k - (k / 4 * 4)); if (k > 3) { - for (j = 0; j < k-3; j += 4) + for (j = 0; j < k - 3; j += 4) { res1 = 0; res2 = 0; res3 = 0; res4 = 0; - jstart = j*size; - jstart1 = jstart+size; - jstart2 = jstart1+size; - jstart3 = jstart2+size; + jstart = j * size; + jstart1 = jstart + size; + jstart2 = jstart1 + size; + jstart3 = jstart2 + size; #if defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) reduction(+:res1,res2,res3,res4) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) reduction(+:res1,res2,res3,res4) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < size; i++) { - res1 += hypre_conj(y_data[jstart+i]) * x_data[i]; - res2 += hypre_conj(y_data[jstart1+i]) * x_data[i]; - res3 += hypre_conj(y_data[jstart2+i]) * x_data[i]; - res4 += hypre_conj(y_data[jstart3+i]) * x_data[i]; + res1 += hypre_conj(y_data[jstart + i]) * x_data[i]; + res2 += hypre_conj(y_data[jstart1 + i]) * x_data[i]; + res3 += hypre_conj(y_data[jstart2 + i]) * x_data[i]; + res4 += hypre_conj(y_data[jstart3 + i]) * x_data[i]; } result[j] = res1; - result[j+1] = res2; - result[j+2] = res3; - result[j+3] = res4; + result[j + 1] = res2; + result[j + 2] = res3; + result[j + 3] = res4; } } if (restk == 1) { res1 = 0; - jstart = (k-1)*size; + jstart = (k - 1) * size; #if defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) reduction(+:res1) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) reduction(+:res1) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < size; i++) { - res1 += hypre_conj(y_data[jstart+i]) * x_data[i]; + res1 += hypre_conj(y_data[jstart + i]) * x_data[i]; } - result[k-1] = res1; + result[k - 1] = res1; } else if (restk == 2) { res1 = 0; res2 = 0; - jstart = (k-2)*size; - jstart1 = jstart+size; + jstart = (k - 2) * size; + jstart1 = jstart + size; #if defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) reduction(+:res1,res2) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) reduction(+:res1,res2) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < size; i++) { - res1 += hypre_conj(y_data[jstart+i]) * x_data[i]; - res2 += hypre_conj(y_data[jstart1+i]) * x_data[i]; + res1 += hypre_conj(y_data[jstart + i]) * x_data[i]; + res2 += hypre_conj(y_data[jstart1 + i]) * x_data[i]; } - result[k-2] = res1; - result[k-1] = res2; + result[k - 2] = res1; + result[k - 1] = res2; } else if (restk == 3) { res1 = 0; res2 = 0; res3 = 0; - jstart = (k-3)*size; - jstart1 = jstart+size; - jstart2 = jstart1+size; + jstart = (k - 3) * size; + jstart1 = jstart + size; + jstart2 = jstart1 + size; #if defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) reduction(+:res1,res2,res3) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) reduction(+:res1,res2,res3) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < size; i++) { - res1 += hypre_conj(y_data[jstart+i]) * x_data[i]; - res2 += hypre_conj(y_data[jstart1+i]) * x_data[i]; - res3 += hypre_conj(y_data[jstart2+i]) * x_data[i]; + res1 += hypre_conj(y_data[jstart + i]) * x_data[i]; + res2 += hypre_conj(y_data[jstart1 + i]) * x_data[i]; + res3 += hypre_conj(y_data[jstart2 + i]) * x_data[i]; } - result[k-3] = res1; - result[k-2] = res2; - result[k-1] = res3; + result[k - 3] = res1; + result[k - 2] = res2; + result[k - 1] = res3; } @@ -607,7 +611,7 @@ HYPRE_Int hypre_SeqVectorMassInnerProd4( hypre_Vector *x, * hypre_SeqVectorMassDotpTwo8 *--------------------------------------------------------------------------*/ HYPRE_Int hypre_SeqVectorMassDotpTwo8( hypre_Vector *x, hypre_Vector *y, - hypre_Vector **z, HYPRE_Int k, HYPRE_Real *result_x, HYPRE_Real *result_y) + hypre_Vector **z, HYPRE_Int k, HYPRE_Real *result_x, HYPRE_Real *result_y) { HYPRE_Complex *x_data = hypre_VectorData(x); HYPRE_Complex *y_data = hypre_VectorData(y); @@ -640,11 +644,11 @@ HYPRE_Int hypre_SeqVectorMassDotpTwo8( hypre_Vector *x, hypre_Vector *y, HYPRE_Int jstart6; HYPRE_Int jstart7; - restk = (k-(k/8*8)); + restk = (k - (k / 8 * 8)); if (k > 7) { - for (j = 0; j < k-7; j += 8) + for (j = 0; j < k - 7; j += 8) { res_x1 = 0; res_x2 = 0; @@ -662,69 +666,69 @@ HYPRE_Int hypre_SeqVectorMassDotpTwo8( hypre_Vector *x, hypre_Vector *y, res_y6 = 0; res_y7 = 0; res_y8 = 0; - jstart = j*size; - jstart1 = jstart+size; - jstart2 = jstart1+size; - jstart3 = jstart2+size; - jstart4 = jstart3+size; - jstart5 = jstart4+size; - jstart6 = jstart5+size; - jstart7 = jstart6+size; + jstart = j * size; + jstart1 = jstart + size; + jstart2 = jstart1 + size; + jstart3 = jstart2 + size; + jstart4 = jstart3 + size; + jstart5 = jstart4 + size; + jstart6 = jstart5 + size; + jstart7 = jstart6 + size; #if defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) reduction(+:res_x1,res_x2,res_x3,res_x4,res_x5,res_x6,res_x7,res_x8,res_y1,res_y2,res_y3,res_y4,res_y5,res_y6,res_y7,res_y8) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) reduction(+:res_x1,res_x2,res_x3,res_x4,res_x5,res_x6,res_x7,res_x8,res_y1,res_y2,res_y3,res_y4,res_y5,res_y6,res_y7,res_y8) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < size; i++) { - res_x1 += hypre_conj(z_data[jstart+i]) * x_data[i]; - res_y1 += hypre_conj(z_data[jstart+i]) * y_data[i]; - res_x2 += hypre_conj(z_data[jstart1+i]) * x_data[i]; - res_y2 += hypre_conj(z_data[jstart1+i]) * y_data[i]; - res_x3 += hypre_conj(z_data[jstart2+i]) * x_data[i]; - res_y3 += hypre_conj(z_data[jstart2+i]) * y_data[i]; - res_x4 += hypre_conj(z_data[jstart3+i]) * x_data[i]; - res_y4 += hypre_conj(z_data[jstart3+i]) * y_data[i]; - res_x5 += hypre_conj(z_data[jstart4+i]) * x_data[i]; - res_y5 += hypre_conj(z_data[jstart4+i]) * y_data[i]; - res_x6 += hypre_conj(z_data[jstart5+i]) * x_data[i]; - res_y6 += hypre_conj(z_data[jstart5+i]) * y_data[i]; - res_x7 += hypre_conj(z_data[jstart6+i]) * x_data[i]; - res_y7 += hypre_conj(z_data[jstart6+i]) * y_data[i]; - res_x8 += hypre_conj(z_data[jstart7+i]) * x_data[i]; - res_y8 += hypre_conj(z_data[jstart7+i]) * y_data[i]; + res_x1 += hypre_conj(z_data[jstart + i]) * x_data[i]; + res_y1 += hypre_conj(z_data[jstart + i]) * y_data[i]; + res_x2 += hypre_conj(z_data[jstart1 + i]) * x_data[i]; + res_y2 += hypre_conj(z_data[jstart1 + i]) * y_data[i]; + res_x3 += hypre_conj(z_data[jstart2 + i]) * x_data[i]; + res_y3 += hypre_conj(z_data[jstart2 + i]) * y_data[i]; + res_x4 += hypre_conj(z_data[jstart3 + i]) * x_data[i]; + res_y4 += hypre_conj(z_data[jstart3 + i]) * y_data[i]; + res_x5 += hypre_conj(z_data[jstart4 + i]) * x_data[i]; + res_y5 += hypre_conj(z_data[jstart4 + i]) * y_data[i]; + res_x6 += hypre_conj(z_data[jstart5 + i]) * x_data[i]; + res_y6 += hypre_conj(z_data[jstart5 + i]) * y_data[i]; + res_x7 += hypre_conj(z_data[jstart6 + i]) * x_data[i]; + res_y7 += hypre_conj(z_data[jstart6 + i]) * y_data[i]; + res_x8 += hypre_conj(z_data[jstart7 + i]) * x_data[i]; + res_y8 += hypre_conj(z_data[jstart7 + i]) * y_data[i]; } result_x[j] = res_x1; - result_x[j+1] = res_x2; - result_x[j+2] = res_x3; - result_x[j+3] = res_x4; - result_x[j+4] = res_x5; - result_x[j+5] = res_x6; - result_x[j+6] = res_x7; - result_x[j+7] = res_x8; + result_x[j + 1] = res_x2; + result_x[j + 2] = res_x3; + result_x[j + 3] = res_x4; + result_x[j + 4] = res_x5; + result_x[j + 5] = res_x6; + result_x[j + 6] = res_x7; + result_x[j + 7] = res_x8; result_y[j] = res_y1; - result_y[j+1] = res_y2; - result_y[j+2] = res_y3; - result_y[j+3] = res_y4; - result_y[j+4] = res_y5; - result_y[j+5] = res_y6; - result_y[j+6] = res_y7; - result_y[j+7] = res_y8; + result_y[j + 1] = res_y2; + result_y[j + 2] = res_y3; + result_y[j + 3] = res_y4; + result_y[j + 4] = res_y5; + result_y[j + 5] = res_y6; + result_y[j + 6] = res_y7; + result_y[j + 7] = res_y8; } } if (restk == 1) { res_x1 = 0; res_y1 = 0; - jstart = (k-1)*size; + jstart = (k - 1) * size; #if defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) reduction(+:res_x1,res_y1) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) reduction(+:res_x1,res_y1) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < size; i++) { - res_x1 += hypre_conj(z_data[jstart+i]) * x_data[i]; - res_y1 += hypre_conj(z_data[jstart+i]) * y_data[i]; + res_x1 += hypre_conj(z_data[jstart + i]) * x_data[i]; + res_y1 += hypre_conj(z_data[jstart + i]) * y_data[i]; } - result_x[k-1] = res_x1; - result_y[k-1] = res_y1; + result_x[k - 1] = res_x1; + result_y[k - 1] = res_y1; } else if (restk == 2) { @@ -732,22 +736,22 @@ HYPRE_Int hypre_SeqVectorMassDotpTwo8( hypre_Vector *x, hypre_Vector *y, res_x2 = 0; res_y1 = 0; res_y2 = 0; - jstart = (k-2)*size; - jstart1 = jstart+size; + jstart = (k - 2) * size; + jstart1 = jstart + size; #if defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) reduction(+:res_x1,res_x2,res_y1,res_y2) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) reduction(+:res_x1,res_x2,res_y1,res_y2) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < size; i++) { - res_x1 += hypre_conj(z_data[jstart+i]) * x_data[i]; - res_y1 += hypre_conj(z_data[jstart+i]) * y_data[i]; - res_x2 += hypre_conj(z_data[jstart1+i]) * x_data[i]; - res_y2 += hypre_conj(z_data[jstart1+i]) * y_data[i]; + res_x1 += hypre_conj(z_data[jstart + i]) * x_data[i]; + res_y1 += hypre_conj(z_data[jstart + i]) * y_data[i]; + res_x2 += hypre_conj(z_data[jstart1 + i]) * x_data[i]; + res_y2 += hypre_conj(z_data[jstart1 + i]) * y_data[i]; } - result_x[k-2] = res_x1; - result_x[k-1] = res_x2; - result_y[k-2] = res_y1; - result_y[k-1] = res_y2; + result_x[k - 2] = res_x1; + result_x[k - 1] = res_x2; + result_y[k - 2] = res_y1; + result_y[k - 1] = res_y2; } else if (restk == 3) { @@ -757,27 +761,27 @@ HYPRE_Int hypre_SeqVectorMassDotpTwo8( hypre_Vector *x, hypre_Vector *y, res_y1 = 0; res_y2 = 0; res_y3 = 0; - jstart = (k-3)*size; - jstart1 = jstart+size; - jstart2 = jstart1+size; + jstart = (k - 3) * size; + jstart1 = jstart + size; + jstart2 = jstart1 + size; #if defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) reduction(+:res_x1,res_x2,res_x3,res_y1,res_y2,res_y3) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) reduction(+:res_x1,res_x2,res_x3,res_y1,res_y2,res_y3) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < size; i++) { - res_x1 += hypre_conj(z_data[jstart+i]) * x_data[i]; - res_y1 += hypre_conj(z_data[jstart+i]) * y_data[i]; - res_x2 += hypre_conj(z_data[jstart1+i]) * x_data[i]; - res_y2 += hypre_conj(z_data[jstart1+i]) * y_data[i]; - res_x3 += hypre_conj(z_data[jstart2+i]) * x_data[i]; - res_y3 += hypre_conj(z_data[jstart2+i]) * y_data[i]; + res_x1 += hypre_conj(z_data[jstart + i]) * x_data[i]; + res_y1 += hypre_conj(z_data[jstart + i]) * y_data[i]; + res_x2 += hypre_conj(z_data[jstart1 + i]) * x_data[i]; + res_y2 += hypre_conj(z_data[jstart1 + i]) * y_data[i]; + res_x3 += hypre_conj(z_data[jstart2 + i]) * x_data[i]; + res_y3 += hypre_conj(z_data[jstart2 + i]) * y_data[i]; } - result_x[k-3] = res_x1; - result_x[k-2] = res_x2; - result_x[k-1] = res_x3; - result_y[k-3] = res_y1; - result_y[k-2] = res_y2; - result_y[k-1] = res_y3; + result_x[k - 3] = res_x1; + result_x[k - 2] = res_x2; + result_x[k - 1] = res_x3; + result_y[k - 3] = res_y1; + result_y[k - 2] = res_y2; + result_y[k - 1] = res_y3; } else if (restk == 4) { @@ -789,32 +793,32 @@ HYPRE_Int hypre_SeqVectorMassDotpTwo8( hypre_Vector *x, hypre_Vector *y, res_y2 = 0; res_y3 = 0; res_y4 = 0; - jstart = (k-4)*size; - jstart1 = jstart+size; - jstart2 = jstart1+size; - jstart3 = jstart2+size; + jstart = (k - 4) * size; + jstart1 = jstart + size; + jstart2 = jstart1 + size; + jstart3 = jstart2 + size; #if defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) reduction(+:res_x1,res_x2,res_x3,res_x4,res_y1,res_y2,res_y3,res_y4) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) reduction(+:res_x1,res_x2,res_x3,res_x4,res_y1,res_y2,res_y3,res_y4) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < size; i++) { - res_x1 += hypre_conj(z_data[jstart+i]) * x_data[i]; - res_y1 += hypre_conj(z_data[jstart+i]) * y_data[i]; - res_x2 += hypre_conj(z_data[jstart1+i]) * x_data[i]; - res_y2 += hypre_conj(z_data[jstart1+i]) * y_data[i]; - res_x3 += hypre_conj(z_data[jstart2+i]) * x_data[i]; - res_y3 += hypre_conj(z_data[jstart2+i]) * y_data[i]; - res_x4 += hypre_conj(z_data[jstart3+i]) * x_data[i]; - res_y4 += hypre_conj(z_data[jstart3+i]) * y_data[i]; + res_x1 += hypre_conj(z_data[jstart + i]) * x_data[i]; + res_y1 += hypre_conj(z_data[jstart + i]) * y_data[i]; + res_x2 += hypre_conj(z_data[jstart1 + i]) * x_data[i]; + res_y2 += hypre_conj(z_data[jstart1 + i]) * y_data[i]; + res_x3 += hypre_conj(z_data[jstart2 + i]) * x_data[i]; + res_y3 += hypre_conj(z_data[jstart2 + i]) * y_data[i]; + res_x4 += hypre_conj(z_data[jstart3 + i]) * x_data[i]; + res_y4 += hypre_conj(z_data[jstart3 + i]) * y_data[i]; } - result_x[k-4] = res_x1; - result_x[k-3] = res_x2; - result_x[k-2] = res_x3; - result_x[k-1] = res_x4; - result_y[k-4] = res_y1; - result_y[k-3] = res_y2; - result_y[k-2] = res_y3; - result_y[k-1] = res_y4; + result_x[k - 4] = res_x1; + result_x[k - 3] = res_x2; + result_x[k - 2] = res_x3; + result_x[k - 1] = res_x4; + result_y[k - 4] = res_y1; + result_y[k - 3] = res_y2; + result_y[k - 2] = res_y3; + result_y[k - 1] = res_y4; } else if (restk == 5) { @@ -828,37 +832,37 @@ HYPRE_Int hypre_SeqVectorMassDotpTwo8( hypre_Vector *x, hypre_Vector *y, res_y3 = 0; res_y4 = 0; res_y5 = 0; - jstart = (k-5)*size; - jstart1 = jstart+size; - jstart2 = jstart1+size; - jstart3 = jstart2+size; - jstart4 = jstart3+size; + jstart = (k - 5) * size; + jstart1 = jstart + size; + jstart2 = jstart1 + size; + jstart3 = jstart2 + size; + jstart4 = jstart3 + size; #if defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) reduction(+:res_x1,res_x2,res_x3,res_x4,res_x5,res_y1,res_y2,res_y3,res_y4,res_y5) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) reduction(+:res_x1,res_x2,res_x3,res_x4,res_x5,res_y1,res_y2,res_y3,res_y4,res_y5) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < size; i++) { - res_x1 += hypre_conj(z_data[jstart+i]) * x_data[i]; - res_y1 += hypre_conj(z_data[jstart+i]) * y_data[i]; - res_x2 += hypre_conj(z_data[jstart1+i]) * x_data[i]; - res_y2 += hypre_conj(z_data[jstart1+i]) * y_data[i]; - res_x3 += hypre_conj(z_data[jstart2+i]) * x_data[i]; - res_y3 += hypre_conj(z_data[jstart2+i]) * y_data[i]; - res_x4 += hypre_conj(z_data[jstart3+i]) * x_data[i]; - res_y4 += hypre_conj(z_data[jstart3+i]) * y_data[i]; - res_x5 += hypre_conj(z_data[jstart4+i]) * x_data[i]; - res_y5 += hypre_conj(z_data[jstart4+i]) * y_data[i]; + res_x1 += hypre_conj(z_data[jstart + i]) * x_data[i]; + res_y1 += hypre_conj(z_data[jstart + i]) * y_data[i]; + res_x2 += hypre_conj(z_data[jstart1 + i]) * x_data[i]; + res_y2 += hypre_conj(z_data[jstart1 + i]) * y_data[i]; + res_x3 += hypre_conj(z_data[jstart2 + i]) * x_data[i]; + res_y3 += hypre_conj(z_data[jstart2 + i]) * y_data[i]; + res_x4 += hypre_conj(z_data[jstart3 + i]) * x_data[i]; + res_y4 += hypre_conj(z_data[jstart3 + i]) * y_data[i]; + res_x5 += hypre_conj(z_data[jstart4 + i]) * x_data[i]; + res_y5 += hypre_conj(z_data[jstart4 + i]) * y_data[i]; } - result_x[k-5] = res_x1; - result_x[k-4] = res_x2; - result_x[k-3] = res_x3; - result_x[k-2] = res_x4; - result_x[k-1] = res_x5; - result_y[k-5] = res_y1; - result_y[k-4] = res_y2; - result_y[k-3] = res_y3; - result_y[k-2] = res_y4; - result_y[k-1] = res_y5; + result_x[k - 5] = res_x1; + result_x[k - 4] = res_x2; + result_x[k - 3] = res_x3; + result_x[k - 2] = res_x4; + result_x[k - 1] = res_x5; + result_y[k - 5] = res_y1; + result_y[k - 4] = res_y2; + result_y[k - 3] = res_y3; + result_y[k - 2] = res_y4; + result_y[k - 1] = res_y5; } else if (restk == 6) { @@ -874,42 +878,42 @@ HYPRE_Int hypre_SeqVectorMassDotpTwo8( hypre_Vector *x, hypre_Vector *y, res_y4 = 0; res_y5 = 0; res_y6 = 0; - jstart = (k-6)*size; - jstart1 = jstart+size; - jstart2 = jstart1+size; - jstart3 = jstart2+size; - jstart4 = jstart3+size; - jstart5 = jstart4+size; + jstart = (k - 6) * size; + jstart1 = jstart + size; + jstart2 = jstart1 + size; + jstart3 = jstart2 + size; + jstart4 = jstart3 + size; + jstart5 = jstart4 + size; #if defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) reduction(+:res_x1,res_x2,res_x3,res_x4,res_x5,res_x6,res_y1,res_y2,res_y3,res_y4,res_y5,res_y6) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) reduction(+:res_x1,res_x2,res_x3,res_x4,res_x5,res_x6,res_y1,res_y2,res_y3,res_y4,res_y5,res_y6) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < size; i++) { - res_x1 += hypre_conj(z_data[jstart+i]) * x_data[i]; - res_y1 += hypre_conj(z_data[jstart+i]) * y_data[i]; - res_x2 += hypre_conj(z_data[jstart1+i]) * x_data[i]; - res_y2 += hypre_conj(z_data[jstart1+i]) * y_data[i]; - res_x3 += hypre_conj(z_data[jstart2+i]) * x_data[i]; - res_y3 += hypre_conj(z_data[jstart2+i]) * y_data[i]; - res_x4 += hypre_conj(z_data[jstart3+i]) * x_data[i]; - res_y4 += hypre_conj(z_data[jstart3+i]) * y_data[i]; - res_x5 += hypre_conj(z_data[jstart4+i]) * x_data[i]; - res_y5 += hypre_conj(z_data[jstart4+i]) * y_data[i]; - res_x6 += hypre_conj(z_data[jstart5+i]) * x_data[i]; - res_y6 += hypre_conj(z_data[jstart5+i]) * y_data[i]; + res_x1 += hypre_conj(z_data[jstart + i]) * x_data[i]; + res_y1 += hypre_conj(z_data[jstart + i]) * y_data[i]; + res_x2 += hypre_conj(z_data[jstart1 + i]) * x_data[i]; + res_y2 += hypre_conj(z_data[jstart1 + i]) * y_data[i]; + res_x3 += hypre_conj(z_data[jstart2 + i]) * x_data[i]; + res_y3 += hypre_conj(z_data[jstart2 + i]) * y_data[i]; + res_x4 += hypre_conj(z_data[jstart3 + i]) * x_data[i]; + res_y4 += hypre_conj(z_data[jstart3 + i]) * y_data[i]; + res_x5 += hypre_conj(z_data[jstart4 + i]) * x_data[i]; + res_y5 += hypre_conj(z_data[jstart4 + i]) * y_data[i]; + res_x6 += hypre_conj(z_data[jstart5 + i]) * x_data[i]; + res_y6 += hypre_conj(z_data[jstart5 + i]) * y_data[i]; } - result_x[k-6] = res_x1; - result_x[k-5] = res_x2; - result_x[k-4] = res_x3; - result_x[k-3] = res_x4; - result_x[k-2] = res_x5; - result_x[k-1] = res_x6; - result_y[k-6] = res_y1; - result_y[k-5] = res_y2; - result_y[k-4] = res_y3; - result_y[k-3] = res_y4; - result_y[k-2] = res_y5; - result_y[k-1] = res_y6; + result_x[k - 6] = res_x1; + result_x[k - 5] = res_x2; + result_x[k - 4] = res_x3; + result_x[k - 3] = res_x4; + result_x[k - 2] = res_x5; + result_x[k - 1] = res_x6; + result_y[k - 6] = res_y1; + result_y[k - 5] = res_y2; + result_y[k - 4] = res_y3; + result_y[k - 3] = res_y4; + result_y[k - 2] = res_y5; + result_y[k - 1] = res_y6; } else if (restk == 7) { @@ -927,47 +931,47 @@ HYPRE_Int hypre_SeqVectorMassDotpTwo8( hypre_Vector *x, hypre_Vector *y, res_y5 = 0; res_y6 = 0; res_y7 = 0; - jstart = (k-7)*size; - jstart1 = jstart+size; - jstart2 = jstart1+size; - jstart3 = jstart2+size; - jstart4 = jstart3+size; - jstart5 = jstart4+size; - jstart6 = jstart5+size; + jstart = (k - 7) * size; + jstart1 = jstart + size; + jstart2 = jstart1 + size; + jstart3 = jstart2 + size; + jstart4 = jstart3 + size; + jstart5 = jstart4 + size; + jstart6 = jstart5 + size; #if defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) reduction(+:res_x1,res_x2,res_x3,res_x4,res_x5,res_x6,res_x7,res_y1,res_y2,res_y3,res_y4,res_y5,res_y6,res_y7) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) reduction(+:res_x1,res_x2,res_x3,res_x4,res_x5,res_x6,res_x7,res_y1,res_y2,res_y3,res_y4,res_y5,res_y6,res_y7) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < size; i++) { - res_x1 += hypre_conj(z_data[jstart+i]) * x_data[i]; - res_y1 += hypre_conj(z_data[jstart+i]) * y_data[i]; - res_x2 += hypre_conj(z_data[jstart1+i]) * x_data[i]; - res_y2 += hypre_conj(z_data[jstart1+i]) * y_data[i]; - res_x3 += hypre_conj(z_data[jstart2+i]) * x_data[i]; - res_y3 += hypre_conj(z_data[jstart2+i]) * y_data[i]; - res_x4 += hypre_conj(z_data[jstart3+i]) * x_data[i]; - res_y4 += hypre_conj(z_data[jstart3+i]) * y_data[i]; - res_x5 += hypre_conj(z_data[jstart4+i]) * x_data[i]; - res_y5 += hypre_conj(z_data[jstart4+i]) * y_data[i]; - res_x6 += hypre_conj(z_data[jstart5+i]) * x_data[i]; - res_y6 += hypre_conj(z_data[jstart5+i]) * y_data[i]; - res_x7 += hypre_conj(z_data[jstart6+i]) * x_data[i]; - res_y7 += hypre_conj(z_data[jstart6+i]) * y_data[i]; + res_x1 += hypre_conj(z_data[jstart + i]) * x_data[i]; + res_y1 += hypre_conj(z_data[jstart + i]) * y_data[i]; + res_x2 += hypre_conj(z_data[jstart1 + i]) * x_data[i]; + res_y2 += hypre_conj(z_data[jstart1 + i]) * y_data[i]; + res_x3 += hypre_conj(z_data[jstart2 + i]) * x_data[i]; + res_y3 += hypre_conj(z_data[jstart2 + i]) * y_data[i]; + res_x4 += hypre_conj(z_data[jstart3 + i]) * x_data[i]; + res_y4 += hypre_conj(z_data[jstart3 + i]) * y_data[i]; + res_x5 += hypre_conj(z_data[jstart4 + i]) * x_data[i]; + res_y5 += hypre_conj(z_data[jstart4 + i]) * y_data[i]; + res_x6 += hypre_conj(z_data[jstart5 + i]) * x_data[i]; + res_y6 += hypre_conj(z_data[jstart5 + i]) * y_data[i]; + res_x7 += hypre_conj(z_data[jstart6 + i]) * x_data[i]; + res_y7 += hypre_conj(z_data[jstart6 + i]) * y_data[i]; } - result_x[k-7] = res_x1; - result_x[k-6] = res_x2; - result_x[k-5] = res_x3; - result_x[k-4] = res_x4; - result_x[k-3] = res_x5; - result_x[k-2] = res_x6; - result_x[k-1] = res_x7; - result_y[k-7] = res_y1; - result_y[k-6] = res_y2; - result_y[k-5] = res_y3; - result_y[k-4] = res_y4; - result_y[k-3] = res_y5; - result_y[k-2] = res_y6; - result_y[k-1] = res_y7; + result_x[k - 7] = res_x1; + result_x[k - 6] = res_x2; + result_x[k - 5] = res_x3; + result_x[k - 4] = res_x4; + result_x[k - 3] = res_x5; + result_x[k - 2] = res_x6; + result_x[k - 1] = res_x7; + result_y[k - 7] = res_y1; + result_y[k - 6] = res_y2; + result_y[k - 5] = res_y3; + result_y[k - 4] = res_y4; + result_y[k - 3] = res_y5; + result_y[k - 2] = res_y6; + result_y[k - 1] = res_y7; } @@ -978,7 +982,7 @@ HYPRE_Int hypre_SeqVectorMassDotpTwo8( hypre_Vector *x, hypre_Vector *y, * hypre_SeqVectorMassDotpTwo4 *--------------------------------------------------------------------------*/ HYPRE_Int hypre_SeqVectorMassDotpTwo4( hypre_Vector *x, hypre_Vector *y, - hypre_Vector **z, HYPRE_Int k, HYPRE_Real *result_x, HYPRE_Real *result_y) + hypre_Vector **z, HYPRE_Int k, HYPRE_Real *result_x, HYPRE_Real *result_y) { HYPRE_Complex *x_data = hypre_VectorData(x); HYPRE_Complex *y_data = hypre_VectorData(y); @@ -999,11 +1003,11 @@ HYPRE_Int hypre_SeqVectorMassDotpTwo4( hypre_Vector *x, hypre_Vector *y, HYPRE_Int jstart2; HYPRE_Int jstart3; - restk = (k-(k/4*4)); + restk = (k - (k / 4 * 4)); if (k > 3) { - for (j = 0; j < k-3; j += 4) + for (j = 0; j < k - 3; j += 4) { res_x1 = 0; res_x2 = 0; @@ -1013,49 +1017,49 @@ HYPRE_Int hypre_SeqVectorMassDotpTwo4( hypre_Vector *x, hypre_Vector *y, res_y2 = 0; res_y3 = 0; res_y4 = 0; - jstart = j*size; - jstart1 = jstart+size; - jstart2 = jstart1+size; - jstart3 = jstart2+size; + jstart = j * size; + jstart1 = jstart + size; + jstart2 = jstart1 + size; + jstart3 = jstart2 + size; #if defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) reduction(+:res_x1,res_x2,res_x3,res_x4,res_y1,res_y2,res_y3,res_y4) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) reduction(+:res_x1,res_x2,res_x3,res_x4,res_y1,res_y2,res_y3,res_y4) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < size; i++) { - res_x1 += hypre_conj(z_data[jstart+i]) * x_data[i]; - res_y1 += hypre_conj(z_data[jstart+i]) * y_data[i]; - res_x2 += hypre_conj(z_data[jstart1+i]) * x_data[i]; - res_y2 += hypre_conj(z_data[jstart1+i]) * y_data[i]; - res_x3 += hypre_conj(z_data[jstart2+i]) * x_data[i]; - res_y3 += hypre_conj(z_data[jstart2+i]) * y_data[i]; - res_x4 += hypre_conj(z_data[jstart3+i]) * x_data[i]; - res_y4 += hypre_conj(z_data[jstart3+i]) * y_data[i]; + res_x1 += hypre_conj(z_data[jstart + i]) * x_data[i]; + res_y1 += hypre_conj(z_data[jstart + i]) * y_data[i]; + res_x2 += hypre_conj(z_data[jstart1 + i]) * x_data[i]; + res_y2 += hypre_conj(z_data[jstart1 + i]) * y_data[i]; + res_x3 += hypre_conj(z_data[jstart2 + i]) * x_data[i]; + res_y3 += hypre_conj(z_data[jstart2 + i]) * y_data[i]; + res_x4 += hypre_conj(z_data[jstart3 + i]) * x_data[i]; + res_y4 += hypre_conj(z_data[jstart3 + i]) * y_data[i]; } result_x[j] = res_x1; - result_x[j+1] = res_x2; - result_x[j+2] = res_x3; - result_x[j+3] = res_x4; + result_x[j + 1] = res_x2; + result_x[j + 2] = res_x3; + result_x[j + 3] = res_x4; result_y[j] = res_y1; - result_y[j+1] = res_y2; - result_y[j+2] = res_y3; - result_y[j+3] = res_y4; + result_y[j + 1] = res_y2; + result_y[j + 2] = res_y3; + result_y[j + 3] = res_y4; } } if (restk == 1) { res_x1 = 0; res_y1 = 0; - jstart = (k-1)*size; + jstart = (k - 1) * size; #if defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) reduction(+:res_x1,res_y1) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) reduction(+:res_x1,res_y1) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < size; i++) { - res_x1 += hypre_conj(z_data[jstart+i]) * x_data[i]; - res_y1 += hypre_conj(z_data[jstart+i]) * y_data[i]; + res_x1 += hypre_conj(z_data[jstart + i]) * x_data[i]; + res_y1 += hypre_conj(z_data[jstart + i]) * y_data[i]; } - result_x[k-1] = res_x1; - result_y[k-1] = res_y1; + result_x[k - 1] = res_x1; + result_y[k - 1] = res_y1; } else if (restk == 2) { @@ -1063,22 +1067,22 @@ HYPRE_Int hypre_SeqVectorMassDotpTwo4( hypre_Vector *x, hypre_Vector *y, res_x2 = 0; res_y1 = 0; res_y2 = 0; - jstart = (k-2)*size; - jstart1 = jstart+size; + jstart = (k - 2) * size; + jstart1 = jstart + size; #if defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) reduction(+:res_x1,res_x2,res_y1,res_y2) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) reduction(+:res_x1,res_x2,res_y1,res_y2) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < size; i++) { - res_x1 += hypre_conj(z_data[jstart+i]) * x_data[i]; - res_y1 += hypre_conj(z_data[jstart+i]) * y_data[i]; - res_x2 += hypre_conj(z_data[jstart1+i]) * x_data[i]; - res_y2 += hypre_conj(z_data[jstart1+i]) * y_data[i]; + res_x1 += hypre_conj(z_data[jstart + i]) * x_data[i]; + res_y1 += hypre_conj(z_data[jstart + i]) * y_data[i]; + res_x2 += hypre_conj(z_data[jstart1 + i]) * x_data[i]; + res_y2 += hypre_conj(z_data[jstart1 + i]) * y_data[i]; } - result_x[k-2] = res_x1; - result_x[k-1] = res_x2; - result_y[k-2] = res_y1; - result_y[k-1] = res_y2; + result_x[k - 2] = res_x1; + result_x[k - 1] = res_x2; + result_y[k - 2] = res_y1; + result_y[k - 1] = res_y2; } else if (restk == 3) { @@ -1088,27 +1092,27 @@ HYPRE_Int hypre_SeqVectorMassDotpTwo4( hypre_Vector *x, hypre_Vector *y, res_y1 = 0; res_y2 = 0; res_y3 = 0; - jstart = (k-3)*size; - jstart1 = jstart+size; - jstart2 = jstart1+size; + jstart = (k - 3) * size; + jstart1 = jstart + size; + jstart2 = jstart1 + size; #if defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) reduction(+:res_x1,res_x2,res_x3,res_y1,res_y2,res_y3) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) reduction(+:res_x1,res_x2,res_x3,res_y1,res_y2,res_y3) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < size; i++) { - res_x1 += hypre_conj(z_data[jstart+i]) * x_data[i]; - res_y1 += hypre_conj(z_data[jstart+i]) * y_data[i]; - res_x2 += hypre_conj(z_data[jstart1+i]) * x_data[i]; - res_y2 += hypre_conj(z_data[jstart1+i]) * y_data[i]; - res_x3 += hypre_conj(z_data[jstart2+i]) * x_data[i]; - res_y3 += hypre_conj(z_data[jstart2+i]) * y_data[i]; + res_x1 += hypre_conj(z_data[jstart + i]) * x_data[i]; + res_y1 += hypre_conj(z_data[jstart + i]) * y_data[i]; + res_x2 += hypre_conj(z_data[jstart1 + i]) * x_data[i]; + res_y2 += hypre_conj(z_data[jstart1 + i]) * y_data[i]; + res_x3 += hypre_conj(z_data[jstart2 + i]) * x_data[i]; + res_y3 += hypre_conj(z_data[jstart2 + i]) * y_data[i]; } - result_x[k-3] = res_x1; - result_x[k-2] = res_x2; - result_x[k-1] = res_x3; - result_y[k-3] = res_y1; - result_y[k-2] = res_y2; - result_y[k-1] = res_y3; + result_x[k - 3] = res_x1; + result_x[k - 2] = res_x2; + result_x[k - 1] = res_x3; + result_y[k - 3] = res_y1; + result_y[k - 2] = res_y2; + result_y[k - 1] = res_y3; } @@ -1116,7 +1120,7 @@ HYPRE_Int hypre_SeqVectorMassDotpTwo4( hypre_Vector *x, hypre_Vector *y, } HYPRE_Int hypre_SeqVectorMassInnerProd( hypre_Vector *x, - hypre_Vector **y, HYPRE_Int k, HYPRE_Int unroll, HYPRE_Real *result) + hypre_Vector **y, HYPRE_Int k, HYPRE_Int unroll, HYPRE_Real *result) { HYPRE_Complex *x_data = hypre_VectorData(x); HYPRE_Complex *y_data = hypre_VectorData(y[0]); @@ -1127,12 +1131,12 @@ HYPRE_Int hypre_SeqVectorMassInnerProd( hypre_Vector *x, if (unroll == 8) { - hypre_SeqVectorMassInnerProd8(x,y,k,result); + hypre_SeqVectorMassInnerProd8(x, y, k, result); return hypre_error_flag; } else if (unroll == 4) { - hypre_SeqVectorMassInnerProd4(x,y,k,result); + hypre_SeqVectorMassInnerProd4(x, y, k, result); return hypre_error_flag; } else @@ -1140,13 +1144,13 @@ HYPRE_Int hypre_SeqVectorMassInnerProd( hypre_Vector *x, for (j = 0; j < k; j++) { res = 0; - jstart = j*size; + jstart = j * size; #if defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) reduction(+:res) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) reduction(+:res) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < size; i++) { - res += hypre_conj(y_data[jstart+i]) * x_data[i]; + res += hypre_conj(y_data[jstart + i]) * x_data[i]; } result[j] = res; } @@ -1160,8 +1164,8 @@ HYPRE_Int hypre_SeqVectorMassInnerProd( hypre_Vector *x, *--------------------------------------------------------------------------*/ HYPRE_Int hypre_SeqVectorMassDotpTwo( hypre_Vector *x, hypre_Vector *y, - hypre_Vector **z, HYPRE_Int k, HYPRE_Int unroll, - HYPRE_Real *result_x, HYPRE_Real *result_y) + hypre_Vector **z, HYPRE_Int k, HYPRE_Int unroll, + HYPRE_Real *result_x, HYPRE_Real *result_y) { HYPRE_Complex *x_data = hypre_VectorData(x); HYPRE_Complex *y_data = hypre_VectorData(y); @@ -1173,12 +1177,12 @@ HYPRE_Int hypre_SeqVectorMassDotpTwo( hypre_Vector *x, hypre_Vector *y, if (unroll == 8) { - hypre_SeqVectorMassDotpTwo8(x,y,z,k,result_x,result_y); + hypre_SeqVectorMassDotpTwo8(x, y, z, k, result_x, result_y); return hypre_error_flag; } else if (unroll == 4) { - hypre_SeqVectorMassDotpTwo4(x,y,z,k,result_x,result_y); + hypre_SeqVectorMassDotpTwo4(x, y, z, k, result_x, result_y); return hypre_error_flag; } else @@ -1187,14 +1191,14 @@ HYPRE_Int hypre_SeqVectorMassDotpTwo( hypre_Vector *x, hypre_Vector *y, { res_x = 0; //result_x[j]; res_y = 0; //result_y[j]; - jstart = j*size; + jstart = j * size; #if defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) reduction(+:res_x,res_y) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) reduction(+:res_x,res_y) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < size; i++) { - res_x += hypre_conj(z_data[jstart+i]) * x_data[i]; - res_y += hypre_conj(z_data[jstart+i]) * y_data[i]; + res_x += hypre_conj(z_data[jstart + i]) * x_data[i]; + res_y += hypre_conj(z_data[jstart + i]) * y_data[i]; } result_x[j] = res_x; result_y[j] = res_y; diff --git a/external/hypre/src/seq_mv/vector_device.c b/external/hypre/src/seq_mv/vector_device.c new file mode 100644 index 00000000..7fb5eb10 --- /dev/null +++ b/external/hypre/src/seq_mv/vector_device.c @@ -0,0 +1,403 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +/****************************************************************************** + * + * Matvec functions for hypre_CSRMatrix class. + * + *****************************************************************************/ + +#include "_hypre_onedpl.hpp" +#include "seq_mv.h" +#include "_hypre_utilities.hpp" +#include "seq_mv.hpp" + +#if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) + +/*-------------------------------------------------------------------------- + * hypre_SeqVectorSetConstantValuesDevice + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorSetConstantValuesDevice( hypre_Vector *v, + HYPRE_Complex value ) +{ + HYPRE_Complex *vector_data = hypre_VectorData(v); + HYPRE_Int num_vectors = hypre_VectorNumVectors(v); + HYPRE_Int size = hypre_VectorSize(v); + HYPRE_Int total_size = size * num_vectors; + + //hypre_SeqVectorPrefetch(v, HYPRE_MEMORY_DEVICE); + +#if defined(HYPRE_USING_GPU) + hypreDevice_ComplexFilln( vector_data, total_size, value ); + + hypre_SyncComputeStream(); + +#elif defined(HYPRE_USING_DEVICE_OPENMP) + HYPRE_Int i; + + #pragma omp target teams distribute parallel for private(i) is_device_ptr(vector_data) + for (i = 0; i < total_size; i++) + { + vector_data[i] = value; + } +#endif + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_SeqVectorScaleDevice + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorScaleDevice( HYPRE_Complex alpha, + hypre_Vector *y ) +{ + HYPRE_Complex *y_data = hypre_VectorData(y); + HYPRE_Int num_vectors = hypre_VectorNumVectors(y); + HYPRE_Int size = hypre_VectorSize(y); + HYPRE_Int total_size = size * num_vectors; + + hypre_GpuProfilingPushRange("SeqVectorScale"); + //hypre_SeqVectorPrefetch(y, HYPRE_MEMORY_DEVICE); + +#if defined(HYPRE_USING_GPU) + +#if ( defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) ) && defined(HYPRE_USING_CUBLAS) + HYPRE_CUBLAS_CALL( hypre_cublas_scal(hypre_HandleCublasHandle(hypre_handle()), + total_size, &alpha, y_data, 1) ); +#elif defined(HYPRE_USING_SYCL) && defined(HYPRE_USING_ONEMKLBLAS) + HYPRE_ONEMKL_CALL( oneapi::mkl::blas::scal(*hypre_HandleComputeStream(hypre_handle()), + total_size, alpha, + y_data, 1).wait() ); +#else + hypreDevice_ComplexScalen( y_data, total_size, y_data, alpha ); +#endif + + hypre_SyncComputeStream(); + +#elif defined(HYPRE_USING_DEVICE_OPENMP) + HYPRE_Int i; + + #pragma omp target teams distribute parallel for private(i) is_device_ptr(y_data) + for (i = 0; i < total_size; i++) + { + y_data[i] *= alpha; + } +#endif + + hypre_GpuProfilingPopRange(); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_SeqVectorAxpyDevice + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorAxpyDevice( HYPRE_Complex alpha, + hypre_Vector *x, + hypre_Vector *y ) +{ + HYPRE_Complex *x_data = hypre_VectorData(x); + HYPRE_Complex *y_data = hypre_VectorData(y); + HYPRE_Int num_vectors = hypre_VectorNumVectors(x); + HYPRE_Int size = hypre_VectorSize(x); + HYPRE_Int total_size = size * num_vectors; + +#if defined(HYPRE_USING_GPU) + +#if ( defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) ) && defined(HYPRE_USING_CUBLAS) + HYPRE_CUBLAS_CALL( hypre_cublas_axpy(hypre_HandleCublasHandle(hypre_handle()), + total_size, &alpha, x_data, 1, + y_data, 1) ); +#elif defined(HYPRE_USING_SYCL) && defined(HYPRE_USING_ONEMKLBLAS) + HYPRE_ONEMKL_CALL( oneapi::mkl::blas::axpy(*hypre_HandleComputeStream(hypre_handle()), + total_size, alpha, + x_data, 1, y_data, 1).wait() ); +#else + hypreDevice_ComplexAxpyn(x_data, total_size, y_data, y_data, alpha); +#endif + + hypre_SyncComputeStream(); + +#elif defined(HYPRE_USING_DEVICE_OPENMP) + HYPRE_Int i; + + #pragma omp target teams distribute parallel for private(i) is_device_ptr(y_data, x_data) + for (i = 0; i < total_size; i++) + { + y_data[i] += alpha * x_data[i]; + } +#endif + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_SeqVectorAxpyzDevice + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorAxpyzDevice( HYPRE_Complex alpha, + hypre_Vector *x, + HYPRE_Complex beta, + hypre_Vector *y, + hypre_Vector *z ) +{ + HYPRE_Complex *x_data = hypre_VectorData(x); + HYPRE_Complex *y_data = hypre_VectorData(y); + HYPRE_Complex *z_data = hypre_VectorData(z); + + HYPRE_Int num_vectors = hypre_VectorNumVectors(x); + HYPRE_Int size = hypre_VectorSize(x); + HYPRE_Int total_size = size * num_vectors; + +#if defined(HYPRE_USING_GPU) + hypreDevice_ComplexAxpyzn(total_size, x_data, y_data, z_data, alpha, beta); + + hypre_SyncComputeStream(); + +#elif defined(HYPRE_USING_DEVICE_OPENMP) + HYPRE_Int i; + + #pragma omp target teams distribute parallel for private(i) is_device_ptr(z_data, y_data, x_data) + for (i = 0; i < total_size; i++) + { + z_data[i] = alpha * x_data[i] + beta * y_data[i]; + } +#endif + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_SeqVectorElmdivpyDevice + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorElmdivpyDevice( hypre_Vector *x, + hypre_Vector *b, + hypre_Vector *y, + HYPRE_Int *marker, + HYPRE_Int marker_val ) +{ +#if defined(HYPRE_USING_GPU) + HYPRE_Complex *x_data = hypre_VectorData(x); + HYPRE_Complex *b_data = hypre_VectorData(b); + HYPRE_Complex *y_data = hypre_VectorData(y); + HYPRE_Int num_vectors_x = hypre_VectorNumVectors(x); + HYPRE_Int num_vectors_y = hypre_VectorNumVectors(y); + HYPRE_Int num_vectors_b = hypre_VectorNumVectors(b); + HYPRE_Int size = hypre_VectorSize(b); + + hypre_GpuProfilingPushRange("SeqVectorElmdivpyDevice"); + if (num_vectors_b == 1) + { + if (num_vectors_x == 1) + { + if (marker) + { + hypreDevice_IVAXPYMarked(size, b_data, x_data, y_data, marker, marker_val); + } + else + { + hypreDevice_IVAXPY(size, b_data, x_data, y_data); + } + } +#if !defined(HYPRE_USING_SYCL) + else if (num_vectors_x == num_vectors_y) + { + if (!marker) + { + hypreDevice_IVAMXPMY(num_vectors_x, size, b_data, x_data, y_data); + } + else + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "marker != NULL not supported!\n"); + } + } + else + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unsupported combination of num_vectors!\n"); + } + +#else + else + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "num_vectors_x != 1 not supported for SYCL!\n"); + } +#endif + } + else + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "num_vectors_b != 1 not supported!\n"); + } + + hypre_SyncComputeStream(); + hypre_GpuProfilingPopRange(); + +#elif defined(HYPRE_USING_OPENMP) + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Not implemented for device OpenMP!\n"); +#endif + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_SeqVectorInnerProdDevice + *--------------------------------------------------------------------------*/ + +HYPRE_Real +hypre_SeqVectorInnerProdDevice( hypre_Vector *x, + hypre_Vector *y ) +{ + HYPRE_Complex *x_data = hypre_VectorData(x); + HYPRE_Complex *y_data = hypre_VectorData(y); + HYPRE_Int num_vectors = hypre_VectorNumVectors(x); + HYPRE_Int size = hypre_VectorSize(x); + HYPRE_Int total_size = size * num_vectors; + + HYPRE_Real result = 0.0; + + //hypre_SeqVectorPrefetch(x, HYPRE_MEMORY_DEVICE); + //hypre_SeqVectorPrefetch(y, HYPRE_MEMORY_DEVICE); + +#if defined(HYPRE_USING_GPU) + +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_CUBLAS) + HYPRE_CUBLAS_CALL( hypre_cublas_dot(hypre_HandleCublasHandle(hypre_handle()), total_size, + x_data, 1, y_data, 1, &result) ); +#else + result = HYPRE_THRUST_CALL( inner_product, x_data, x_data + total_size, y_data, 0.0 ); +#endif + +#elif defined(HYPRE_USING_SYCL) +#if defined(HYPRE_USING_ONEMKLBLAS) + HYPRE_Real *result_dev = hypre_CTAlloc(HYPRE_Real, 1, HYPRE_MEMORY_DEVICE); + HYPRE_ONEMKL_CALL( oneapi::mkl::blas::dot(*hypre_HandleComputeStream(hypre_handle()), + total_size, x_data, 1, + y_data, 1, result_dev).wait() ); + hypre_TMemcpy(&result, result_dev, HYPRE_Real, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); + hypre_TFree(result_dev, HYPRE_MEMORY_DEVICE); +#else + result = HYPRE_ONEDPL_CALL( std::transform_reduce, x_data, x_data + total_size, y_data, 0.0 ); +#endif +#endif + + hypre_SyncComputeStream(); + +#elif defined(HYPRE_USING_DEVICE_OPENMP) + HYPRE_Int i; + + #pragma omp target teams distribute parallel for private(i) reduction(+:result) is_device_ptr(y_data, x_data) map(result) + for (i = 0; i < total_size; i++) + { + result += hypre_conj(y_data[i]) * x_data[i]; + } +#endif + + return result; +} + +/*-------------------------------------------------------------------------- + * hypre_SeqVectorSumEltsDevice + *--------------------------------------------------------------------------*/ + +HYPRE_Complex +hypre_SeqVectorSumEltsDevice( hypre_Vector *vector ) +{ + HYPRE_Complex *data = hypre_VectorData(vector); + HYPRE_Int num_vectors = hypre_VectorNumVectors(vector); + HYPRE_Int size = hypre_VectorSize(vector); + HYPRE_Int total_size = size * num_vectors; + HYPRE_Complex sum = 0.0; + +#if defined(HYPRE_USING_GPU) + sum = hypreDevice_ComplexReduceSum(total_size, data); + + hypre_SyncComputeStream(); + +#elif HYPRE_USING_DEVICE_OPENMP + HYPRE_Int i; + + #pragma omp target teams distribute parallel for private(i) reduction(+:sum) is_device_ptr(data) map(sum) + for (i = 0; i < total_size; i++) + { + sum += data[i]; + } +#endif + + return sum; +} + +/*-------------------------------------------------------------------------- + * hypre_SeqVectorStridedCopyDevice + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorStridedCopyDevice( hypre_Vector *vector, + HYPRE_Int istride, + HYPRE_Int ostride, + HYPRE_Int size, + HYPRE_Complex *data) +{ + HYPRE_Complex *v_data = hypre_VectorData(vector); + +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + auto begin = thrust::make_counting_iterator(0); + auto last = thrust::make_counting_iterator(size / istride); + + HYPRE_THRUST_CALL( transform, begin, last, + thrust::make_permutation_iterator(v_data, + thrust::make_transform_iterator(begin, + hypreFunctor_IndexStrided(ostride))), + hypreFunctor_ArrayStridedAccess(istride, data) ); + +#elif defined(HYPRE_USING_DEVICE_OPENMP) || defined(HYPRE_USING_SYCL) + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Not implemented!"); +#endif + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_SeqVectorPrefetch + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorPrefetch( hypre_Vector *x, + HYPRE_MemoryLocation memory_location ) +{ +#if defined(HYPRE_USING_UNIFIED_MEMORY) + if (hypre_VectorMemoryLocation(x) != HYPRE_MEMORY_DEVICE) + { + /* hypre_error_w_msg(HYPRE_ERROR_GENERIC," Error! CUDA Prefetch with non-unified momory\n"); */ + return hypre_error_flag; + } + + HYPRE_Complex *x_data = hypre_VectorData(x); + HYPRE_Int num_vectors = hypre_VectorNumVectors(x); + HYPRE_Int size = hypre_VectorSize(x); + HYPRE_Int total_size = size * num_vectors; + + if (total_size == 0) + { + return hypre_error_flag; + } + + hypre_MemPrefetch(x_data, sizeof(HYPRE_Complex) * total_size, memory_location); +#endif + + return hypre_error_flag; +} + +#endif diff --git a/external/hypre/src/sstruct_ls/CMakeLists.txt b/external/hypre/src/sstruct_ls/CMakeLists.txt index 344360ce..2d35908a 100644 --- a/external/hypre/src/sstruct_ls/CMakeLists.txt +++ b/external/hypre/src/sstruct_ls/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -79,8 +79,8 @@ target_sources(${PROJECT_NAME} ${HDRS} ) -if (HYPRE_USING_CUDA) - set(CUDA_SRCS +if (HYPRE_USING_GPU) + set(GPU_SRCS fac_amr_fcoarsen.c fac_amr_rap.c fac_restrict2.c @@ -88,8 +88,8 @@ if (HYPRE_USING_CUDA) fac_zero_stencilcoef.c node_relax.c ) - convert_filenames_to_full_paths(CUDA_SRCS) - set(HYPRE_CUDA_SOURCES ${HYPRE_CUDA_SOURCES} ${CUDA_SRCS} PARENT_SCOPE) + convert_filenames_to_full_paths(GPU_SRCS) + set(HYPRE_GPU_SOURCES ${HYPRE_GPU_SOURCES} ${GPU_SRCS} PARENT_SCOPE) endif () convert_filenames_to_full_paths(HDRS) diff --git a/external/hypre/src/sstruct_ls/F90_HYPRE_sstruct_InterFAC.c b/external/hypre/src/sstruct_ls/F90_HYPRE_sstruct_InterFAC.c index cf085816..3a71be3d 100644 --- a/external/hypre/src/sstruct_ls/F90_HYPRE_sstruct_InterFAC.c +++ b/external/hypre/src/sstruct_ls/F90_HYPRE_sstruct_InterFAC.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,21 +17,21 @@ #ifdef __cplusplus extern "C" { #endif - + /*-------------------------------------------------------------------------- * HYPRE_SStructFACCreate *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_sstructfaccreate, HYPRE_SSTRUCTFACCREATE) - (hypre_F90_Comm *comm, - hypre_F90_Obj *solver, - hypre_F90_Int *ierr) +(hypre_F90_Comm *comm, + hypre_F90_Obj *solver, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SStructFACCreate( - hypre_F90_PassComm (comm), - hypre_F90_PassObjRef (HYPRE_SStructSolver, solver) )); + ( HYPRE_SStructFACCreate( + hypre_F90_PassComm (comm), + hypre_F90_PassObjRef (HYPRE_SStructSolver, solver) )); } /*-------------------------------------------------------------------------- @@ -40,12 +40,12 @@ hypre_F90_IFACE(hypre_sstructfaccreate, HYPRE_SSTRUCTFACCREATE) void hypre_F90_IFACE(hypre_sstructfacdestroy2, HYPRE_SSTRUCTFACDESTROY2) - (hypre_F90_Obj *solver, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SStructFACDestroy2( - hypre_F90_PassObj (HYPRE_SStructSolver, solver) )); + ( HYPRE_SStructFACDestroy2( + hypre_F90_PassObj (HYPRE_SStructSolver, solver) )); } /*-------------------------------------------------------------------------- @@ -54,16 +54,16 @@ hypre_F90_IFACE(hypre_sstructfacdestroy2, HYPRE_SSTRUCTFACDESTROY2) void hypre_F90_IFACE(hypre_sstructfacamrrap, HYPRE_SSTRUCTFACAMRRAP) - (hypre_F90_Obj *A, - HYPRE_Int (*rfactors)[HYPRE_MAXDIM], - hypre_F90_Obj *facA, - hypre_F90_Int *ierr) +(hypre_F90_Obj *A, + HYPRE_Int (*rfactors)[HYPRE_MAXDIM], + hypre_F90_Obj *facA, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SStructFACAMR_RAP( - hypre_F90_PassObj (HYPRE_SStructMatrix, A), - rfactors, - hypre_F90_PassObjRef (HYPRE_SStructMatrix, facA) )); + ( HYPRE_SStructFACAMR_RAP( + hypre_F90_PassObj (HYPRE_SStructMatrix, A), + rfactors, + hypre_F90_PassObjRef (HYPRE_SStructMatrix, facA) )); } /*-------------------------------------------------------------------------- @@ -72,18 +72,18 @@ hypre_F90_IFACE(hypre_sstructfacamrrap, HYPRE_SSTRUCTFACAMRRAP) void hypre_F90_IFACE(hypre_sstructfacsetup2, HYPRE_SSTRUCTFACSETUP2) - (hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SStructFACSetup2( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassObj (HYPRE_SStructMatrix, A), - hypre_F90_PassObj (HYPRE_SStructVector, b), - hypre_F90_PassObj (HYPRE_SStructVector, x) )); + ( HYPRE_SStructFACSetup2( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassObj (HYPRE_SStructMatrix, A), + hypre_F90_PassObj (HYPRE_SStructVector, b), + hypre_F90_PassObj (HYPRE_SStructVector, x) )); } /*-------------------------------------------------------------------------- @@ -92,18 +92,18 @@ hypre_F90_IFACE(hypre_sstructfacsetup2, HYPRE_SSTRUCTFACSETUP2) void hypre_F90_IFACE(hypre_sstructfacsolve3, HYPRE_SSTRUCTFACSOLVE3) - (hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SStructFACSolve3( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassObj (HYPRE_SStructMatrix, A), - hypre_F90_PassObj (HYPRE_SStructVector, b), - hypre_F90_PassObj (HYPRE_SStructVector, x))); + ( HYPRE_SStructFACSolve3( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassObj (HYPRE_SStructMatrix, A), + hypre_F90_PassObj (HYPRE_SStructVector, b), + hypre_F90_PassObj (HYPRE_SStructVector, x))); } /*-------------------------------------------------------------------------- @@ -112,14 +112,14 @@ hypre_F90_IFACE(hypre_sstructfacsolve3, HYPRE_SSTRUCTFACSOLVE3) void hypre_F90_IFACE(hypre_sstructfacsettol, HYPRE_SSTRUCTFACSETTOL) - (hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SStructFACSetTol( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassReal (tol) )); + ( HYPRE_SStructFACSetTol( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassReal (tol) )); } /*-------------------------------------------------------------------------- @@ -128,16 +128,16 @@ hypre_F90_IFACE(hypre_sstructfacsettol, HYPRE_SSTRUCTFACSETTOL) void hypre_F90_IFACE(hypre_sstructfacsetplevels, HYPRE_SSTRUCTFACSETPLEVELS) - (hypre_F90_Obj *solver, - hypre_F90_Int *nparts, - hypre_F90_IntArray *plevels, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *nparts, + hypre_F90_IntArray *plevels, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SStructFACSetPLevels( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (nparts), - hypre_F90_PassIntArray (plevels))); + ( HYPRE_SStructFACSetPLevels( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (nparts), + hypre_F90_PassIntArray (plevels))); } /*-------------------------------------------------------------------------- @@ -146,18 +146,18 @@ hypre_F90_IFACE(hypre_sstructfacsetplevels, HYPRE_SSTRUCTFACSETPLEVELS) void hypre_F90_IFACE(hypre_sstructfaczerocfsten, HYPRE_SSTRUCTFACZEROCFSTEN) - (hypre_F90_Obj *A, - hypre_F90_Obj *grid, - hypre_F90_Int *part, - HYPRE_Int (*rfactors)[HYPRE_MAXDIM], - hypre_F90_Int *ierr) +(hypre_F90_Obj *A, + hypre_F90_Obj *grid, + hypre_F90_Int *part, + HYPRE_Int (*rfactors)[HYPRE_MAXDIM], + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SStructFACZeroCFSten( - hypre_F90_PassObj (HYPRE_SStructMatrix, A), - hypre_F90_PassObj (HYPRE_SStructGrid, grid), - hypre_F90_PassInt (part), - rfactors[HYPRE_MAXDIM] )); + ( HYPRE_SStructFACZeroCFSten( + hypre_F90_PassObj (HYPRE_SStructMatrix, A), + hypre_F90_PassObj (HYPRE_SStructGrid, grid), + hypre_F90_PassInt (part), + rfactors[HYPRE_MAXDIM] )); } /*-------------------------------------------------------------------------- @@ -166,16 +166,16 @@ hypre_F90_IFACE(hypre_sstructfaczerocfsten, HYPRE_SSTRUCTFACZEROCFSTEN) void hypre_F90_IFACE(hypre_sstructfaczerofcsten, HYPRE_SSTRUCTFACZEROFCSTEN) - (hypre_F90_Obj *A, - hypre_F90_Obj *grid, - hypre_F90_Int *part, - hypre_F90_Int *ierr) +(hypre_F90_Obj *A, + hypre_F90_Obj *grid, + hypre_F90_Int *part, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SStructFACZeroFCSten( - hypre_F90_PassObj (HYPRE_SStructMatrix, A), - hypre_F90_PassObj (HYPRE_SStructGrid, grid), - hypre_F90_PassInt (part) )); + ( HYPRE_SStructFACZeroFCSten( + hypre_F90_PassObj (HYPRE_SStructMatrix, A), + hypre_F90_PassObj (HYPRE_SStructGrid, grid), + hypre_F90_PassInt (part) )); } /*-------------------------------------------------------------------------- @@ -184,16 +184,16 @@ hypre_F90_IFACE(hypre_sstructfaczerofcsten, HYPRE_SSTRUCTFACZEROFCSTEN) void hypre_F90_IFACE(hypre_sstructfaczeroamrmatrixdata, HYPRE_SSTRUCTFACZEROAMRMATRIXDATA) - (hypre_F90_Obj *A, - hypre_F90_Int *part_crse, - HYPRE_Int (*rfactors)[HYPRE_MAXDIM], - hypre_F90_Int *ierr) +(hypre_F90_Obj *A, + hypre_F90_Int *part_crse, + HYPRE_Int (*rfactors)[HYPRE_MAXDIM], + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SStructFACZeroAMRMatrixData( - hypre_F90_PassObj (HYPRE_SStructMatrix, A), - hypre_F90_PassInt (part_crse), - rfactors[HYPRE_MAXDIM] )); + ( HYPRE_SStructFACZeroAMRMatrixData( + hypre_F90_PassObj (HYPRE_SStructMatrix, A), + hypre_F90_PassInt (part_crse), + rfactors[HYPRE_MAXDIM] )); } /*-------------------------------------------------------------------------- @@ -202,16 +202,16 @@ hypre_F90_IFACE(hypre_sstructfaczeroamrmatrixdata, HYPRE_SSTRUCTFACZEROAMRMATRIX void hypre_F90_IFACE(hypre_sstructfaczeroamrvectordata, HYPRE_SSTRUCTFACZEROAMRVECTORDATA) - (hypre_F90_Obj *b, - hypre_F90_IntArray *plevels, - HYPRE_Int (*rfactors)[HYPRE_MAXDIM], - hypre_F90_Int *ierr) +(hypre_F90_Obj *b, + hypre_F90_IntArray *plevels, + HYPRE_Int (*rfactors)[HYPRE_MAXDIM], + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SStructFACZeroAMRVectorData( - hypre_F90_PassObj (HYPRE_SStructVector, b), - hypre_F90_PassIntArray (plevels), - rfactors )); + ( HYPRE_SStructFACZeroAMRVectorData( + hypre_F90_PassObj (HYPRE_SStructVector, b), + hypre_F90_PassIntArray (plevels), + rfactors )); } @@ -221,16 +221,16 @@ hypre_F90_IFACE(hypre_sstructfaczeroamrvectordata, HYPRE_SSTRUCTFACZEROAMRVECTOR void hypre_F90_IFACE(hypre_sstructfacsetprefinements, HYPRE_SSTRUCTFACSETPREFINEMENTS) - (hypre_F90_Obj *solver, - hypre_F90_Int *nparts, - HYPRE_Int (*rfactors)[HYPRE_MAXDIM], - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *nparts, + HYPRE_Int (*rfactors)[HYPRE_MAXDIM], + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SStructFACSetPRefinements( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (nparts), - rfactors )); + ( HYPRE_SStructFACSetPRefinements( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (nparts), + rfactors )); } /*-------------------------------------------------------------------------- @@ -239,14 +239,14 @@ hypre_F90_IFACE(hypre_sstructfacsetprefinements, HYPRE_SSTRUCTFACSETPREFINEMENTS void hypre_F90_IFACE(hypre_sstructfacsetmaxlevels, HYPRE_SSTRUCTFACSETMAXLEVELS) - (hypre_F90_Obj *solver, - hypre_F90_Int *max_levels, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *max_levels, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SStructFACSetMaxLevels( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (max_levels) )); + ( HYPRE_SStructFACSetMaxLevels( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (max_levels) )); } /*-------------------------------------------------------------------------- @@ -255,14 +255,14 @@ hypre_F90_IFACE(hypre_sstructfacsetmaxlevels, HYPRE_SSTRUCTFACSETMAXLEVELS) void hypre_F90_IFACE(hypre_sstructfacsetmaxiter, HYPRE_SSTRUCTFACSETMAXITER) - (hypre_F90_Obj *solver, - hypre_F90_Int *max_iter, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *max_iter, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SStructFACSetMaxIter( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (max_iter) )); + ( HYPRE_SStructFACSetMaxIter( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (max_iter) )); } /*-------------------------------------------------------------------------- @@ -271,14 +271,14 @@ hypre_F90_IFACE(hypre_sstructfacsetmaxiter, HYPRE_SSTRUCTFACSETMAXITER) void hypre_F90_IFACE(hypre_sstructfacsetrelchange, HYPRE_SSTRUCTFACSETRELCHANGE) - (hypre_F90_Obj *solver, - hypre_F90_Int *rel_change, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *rel_change, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SStructFACSetRelChange( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (rel_change) )); + ( HYPRE_SStructFACSetRelChange( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (rel_change) )); } /*-------------------------------------------------------------------------- @@ -287,12 +287,12 @@ hypre_F90_IFACE(hypre_sstructfacsetrelchange, HYPRE_SSTRUCTFACSETRELCHANGE) void hypre_F90_IFACE(hypre_sstructfacsetzeroguess, HYPRE_SSTRUCTFACSETZEROGUESS) - (hypre_F90_Obj *solver, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SStructFACSetZeroGuess( - hypre_F90_PassObj (HYPRE_SStructSolver, solver) )); + ( HYPRE_SStructFACSetZeroGuess( + hypre_F90_PassObj (HYPRE_SStructSolver, solver) )); } /*-------------------------------------------------------------------------- @@ -301,12 +301,12 @@ hypre_F90_IFACE(hypre_sstructfacsetzeroguess, HYPRE_SSTRUCTFACSETZEROGUESS) void hypre_F90_IFACE(hypre_sstructfacsetnonzeroguess, HYPRE_SSTRUCTFACSETNONZEROGUESS) - (hypre_F90_Obj *solver, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SStructFACSetNonZeroGuess( - hypre_F90_PassObj (HYPRE_SStructSolver, solver) )); + ( HYPRE_SStructFACSetNonZeroGuess( + hypre_F90_PassObj (HYPRE_SStructSolver, solver) )); } /*-------------------------------------------------------------------------- @@ -315,14 +315,14 @@ hypre_F90_IFACE(hypre_sstructfacsetnonzeroguess, HYPRE_SSTRUCTFACSETNONZEROGUESS void hypre_F90_IFACE(hypre_sstructfacsetrelaxtype, HYPRE_SSTRUCTFACSETRELAXTYPE) - (hypre_F90_Obj *solver, - hypre_F90_Int *relax_type, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *relax_type, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SStructFACSetRelaxType( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (relax_type) )); + ( HYPRE_SStructFACSetRelaxType( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (relax_type) )); } /*-------------------------------------------------------------------------- @@ -330,13 +330,13 @@ hypre_F90_IFACE(hypre_sstructfacsetrelaxtype, HYPRE_SSTRUCTFACSETRELAXTYPE) *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_sstructfacsetjacobiweigh, HYPRE_SSTRUCTFACSETJACOBIWEIGH) - (hypre_F90_Obj *solver, - hypre_F90_Real *weight, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Real *weight, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructFACSetJacobiWeight( hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassReal (weight) ) ); + (HYPRE_SStructFACSetJacobiWeight( hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassReal (weight) ) ); } /*-------------------------------------------------------------------------- @@ -345,13 +345,13 @@ hypre_F90_IFACE(hypre_sstructfacsetjacobiweigh, HYPRE_SSTRUCTFACSETJACOBIWEIGH) void hypre_F90_IFACE(hypre_sstructfacsetnumprerelax, HYPRE_SSTRUCTFACSETNUMPRERELAX) - (hypre_F90_Obj *solver, - hypre_F90_Int *num_pre_relax, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *num_pre_relax, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SStructFACSetNumPreRelax( hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (num_pre_relax) )); + ( HYPRE_SStructFACSetNumPreRelax( hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (num_pre_relax) )); } /*-------------------------------------------------------------------------- @@ -360,14 +360,14 @@ hypre_F90_IFACE(hypre_sstructfacsetnumprerelax, HYPRE_SSTRUCTFACSETNUMPRERELAX) void hypre_F90_IFACE(hypre_sstructfacsetnumpostrelax, HYPRE_SSTRUCTFACSETNUMPOSTRELAX) - (hypre_F90_Obj *solver, - hypre_F90_Int *num_post_relax, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *num_post_relax, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructFACSetNumPostRelax( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (num_post_relax) )); + (HYPRE_SStructFACSetNumPostRelax( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (num_post_relax) )); } /*-------------------------------------------------------------------------- @@ -376,14 +376,14 @@ hypre_F90_IFACE(hypre_sstructfacsetnumpostrelax, HYPRE_SSTRUCTFACSETNUMPOSTRELAX void hypre_F90_IFACE(hypre_sstructfacsetcoarsesolver, HYPRE_SSTRUCTFACSETCOARSESOLVER) - (hypre_F90_Obj *solver, - hypre_F90_Int *csolver_type, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *csolver_type, + hypre_F90_Int *ierr) { - *ierr = (hypre_F90_Int) - (HYPRE_SStructFACSetCoarseSolverType( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (csolver_type))); + *ierr = (hypre_F90_Int) + (HYPRE_SStructFACSetCoarseSolverType( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (csolver_type))); } /*-------------------------------------------------------------------------- @@ -392,14 +392,14 @@ hypre_F90_IFACE(hypre_sstructfacsetcoarsesolver, HYPRE_SSTRUCTFACSETCOARSESOLVER void hypre_F90_IFACE(hypre_sstructfacsetlogging, HYPRE_SSTRUCTFACSETLOGGING) - (hypre_F90_Obj *solver, - hypre_F90_Int *logging, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *logging, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructFACSetLogging( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (logging) )); + (HYPRE_SStructFACSetLogging( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (logging) )); } /*-------------------------------------------------------------------------- @@ -408,14 +408,14 @@ hypre_F90_IFACE(hypre_sstructfacsetlogging, HYPRE_SSTRUCTFACSETLOGGING) void hypre_F90_IFACE(hypre_sstructfacgetnumiteration, HYPRE_SSTRUCTFACGETNUMITERATION) - (hypre_F90_Obj *solver, - hypre_F90_Int *num_iterations, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *num_iterations, + hypre_F90_Int *ierr) { - *ierr = (hypre_F90_Int) - ( HYPRE_SStructFACGetNumIterations( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassIntRef (num_iterations))); + *ierr = (hypre_F90_Int) + ( HYPRE_SStructFACGetNumIterations( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassIntRef (num_iterations))); } /*-------------------------------------------------------------------------- @@ -424,14 +424,14 @@ hypre_F90_IFACE(hypre_sstructfacgetnumiteration, HYPRE_SSTRUCTFACGETNUMITERATION void hypre_F90_IFACE(hypre_sstructfacgetfinalrelativ, HYPRE_SSTRUCTFACGETFINALRELATIV) - (hypre_F90_Obj *solver, - hypre_F90_Real *norm, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Real *norm, + hypre_F90_Int *ierr) { - *ierr = (hypre_F90_Int) - ( HYPRE_SStructFACGetFinalRelativeResidualNorm( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassRealRef (norm) )); + *ierr = (hypre_F90_Int) + ( HYPRE_SStructFACGetFinalRelativeResidualNorm( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassRealRef (norm) )); } #ifdef __cplusplus diff --git a/external/hypre/src/sstruct_ls/F90_HYPRE_sstruct_bicgstab.c b/external/hypre/src/sstruct_ls/F90_HYPRE_sstruct_bicgstab.c index 40c316e6..2e002f3b 100644 --- a/external/hypre/src/sstruct_ls/F90_HYPRE_sstruct_bicgstab.c +++ b/external/hypre/src/sstruct_ls/F90_HYPRE_sstruct_bicgstab.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,21 +17,21 @@ #ifdef __cplusplus extern "C" { #endif - + /*-------------------------------------------------------------------------- * HYPRE_SStructBiCGSTABCreate *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_sstructbicgstabcreate, HYPRE_SSTRUCTBICGSTABCREATE) - (hypre_F90_Comm *comm, - hypre_F90_Obj *solver, - hypre_F90_Int *ierr) +(hypre_F90_Comm *comm, + hypre_F90_Obj *solver, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructBiCGSTABCreate( - hypre_F90_PassComm (comm), - hypre_F90_PassObjRef (HYPRE_SStructSolver, solver) )) ; + (HYPRE_SStructBiCGSTABCreate( + hypre_F90_PassComm (comm), + hypre_F90_PassObjRef (HYPRE_SStructSolver, solver) )) ; } /*-------------------------------------------------------------------------- @@ -40,12 +40,12 @@ hypre_F90_IFACE(hypre_sstructbicgstabcreate, HYPRE_SSTRUCTBICGSTABCREATE) void hypre_F90_IFACE(hypre_sstructbicgstabdestroy, HYPRE_SSTRUCTBICGSTABDESTROY) - (hypre_F90_Obj *solver, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructBiCGSTABDestroy( - hypre_F90_PassObj (HYPRE_SStructSolver, solver) )); + (HYPRE_SStructBiCGSTABDestroy( + hypre_F90_PassObj (HYPRE_SStructSolver, solver) )); } /*-------------------------------------------------------------------------- @@ -54,18 +54,18 @@ hypre_F90_IFACE(hypre_sstructbicgstabdestroy, HYPRE_SSTRUCTBICGSTABDESTROY) void hypre_F90_IFACE(hypre_sstructbicgstabsetup, HYPRE_SSTRUCTBICGSTABSETUP) - (hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructBiCGSTABSetup( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassObj (HYPRE_SStructMatrix, A), - hypre_F90_PassObj (HYPRE_SStructVector, b), - hypre_F90_PassObj (HYPRE_SStructVector, x) )); + (HYPRE_SStructBiCGSTABSetup( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassObj (HYPRE_SStructMatrix, A), + hypre_F90_PassObj (HYPRE_SStructVector, b), + hypre_F90_PassObj (HYPRE_SStructVector, x) )); } /*-------------------------------------------------------------------------- @@ -74,18 +74,18 @@ hypre_F90_IFACE(hypre_sstructbicgstabsetup, HYPRE_SSTRUCTBICGSTABSETUP) void hypre_F90_IFACE(hypre_sstructbicgstabsolve, HYPRE_SSTRUCTBICGSTABSOLVE) - (hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructBiCGSTABSolve( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassObj (HYPRE_SStructMatrix, A), - hypre_F90_PassObj (HYPRE_SStructVector, b), - hypre_F90_PassObj (HYPRE_SStructVector, x) )); + (HYPRE_SStructBiCGSTABSolve( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassObj (HYPRE_SStructMatrix, A), + hypre_F90_PassObj (HYPRE_SStructVector, b), + hypre_F90_PassObj (HYPRE_SStructVector, x) )); } /*-------------------------------------------------------------------------- @@ -94,14 +94,14 @@ hypre_F90_IFACE(hypre_sstructbicgstabsolve, HYPRE_SSTRUCTBICGSTABSOLVE) void hypre_F90_IFACE(hypre_sstructbicgstabsettol, HYPRE_SSTRUCTBICGSTABSETTOL) - (hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructBiCGSTABSetTol( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassReal (tol) )); + (HYPRE_SStructBiCGSTABSetTol( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassReal (tol) )); } /*-------------------------------------------------------------------------- * HYPRE_SStructBiCGSTABSetAnsoluteTol @@ -109,14 +109,14 @@ hypre_F90_IFACE(hypre_sstructbicgstabsettol, HYPRE_SSTRUCTBICGSTABSETTOL) void hypre_F90_IFACE(hypre_sstructbicgstabsetabsolutetol, HYPRE_SSTRUCTBICGSTABSETABSOLUTETOL) - (hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructBiCGSTABSetAbsoluteTol( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassReal (tol) )); + (HYPRE_SStructBiCGSTABSetAbsoluteTol( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassReal (tol) )); } /*-------------------------------------------------------------------------- @@ -125,14 +125,14 @@ hypre_F90_IFACE(hypre_sstructbicgstabsetabsolutetol, HYPRE_SSTRUCTBICGSTABSETABS void hypre_F90_IFACE(hypre_sstructbicgstabsetminiter, HYPRE_SSTRUCTBICGSTABSETMINITER) - (hypre_F90_Obj *solver, - hypre_F90_Int *min_iter, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *min_iter, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructBiCGSTABSetMinIter( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (min_iter) )); + (HYPRE_SStructBiCGSTABSetMinIter( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (min_iter) )); } /*-------------------------------------------------------------------------- @@ -141,14 +141,14 @@ hypre_F90_IFACE(hypre_sstructbicgstabsetminiter, HYPRE_SSTRUCTBICGSTABSETMINITER void hypre_F90_IFACE(hypre_sstructbicgstabsetmaxiter, HYPRE_SSTRUCTBICGSTABSETMAXITER) - (hypre_F90_Obj *solver, - hypre_F90_Int *max_iter, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *max_iter, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructBiCGSTABSetMaxIter( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (max_iter) )); + (HYPRE_SStructBiCGSTABSetMaxIter( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (max_iter) )); } /*-------------------------------------------------------------------------- @@ -157,14 +157,14 @@ hypre_F90_IFACE(hypre_sstructbicgstabsetmaxiter, HYPRE_SSTRUCTBICGSTABSETMAXITER void hypre_F90_IFACE(hypre_sstructbicgstabsetstopcri, HYPRE_SSTRUCTBICGSTABSETSTOPCRI) - (hypre_F90_Obj *solver, - hypre_F90_Int *stop_crit, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *stop_crit, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructBiCGSTABSetStopCrit( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (stop_crit) )); + (HYPRE_SStructBiCGSTABSetStopCrit( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (stop_crit) )); } /*-------------------------------------------------------------------------- @@ -173,10 +173,10 @@ hypre_F90_IFACE(hypre_sstructbicgstabsetstopcri, HYPRE_SSTRUCTBICGSTABSETSTOPCRI void hypre_F90_IFACE(hypre_sstructbicgstabsetprecond, HYPRE_SSTRUCTBICGSTABSETPRECOND) - (hypre_F90_Obj *solver, - hypre_F90_Int *precond_id, - hypre_F90_Obj *precond_solver, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *precond_id, + hypre_F90_Obj *precond_solver, + hypre_F90_Int *ierr) /*------------------------------------------ * precond_id flags mean: * 2 - setup a split-solver preconditioner @@ -186,36 +186,36 @@ hypre_F90_IFACE(hypre_sstructbicgstabsetprecond, HYPRE_SSTRUCTBICGSTABSETPRECOND *----------------------------------------*/ { - if(*precond_id == 2) + if (*precond_id == 2) { *ierr = (hypre_F90_Int) - (HYPRE_SStructBiCGSTABSetPrecond( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - HYPRE_SStructSplitSolve, - HYPRE_SStructSplitSetup, - hypre_F90_PassObjRef (HYPRE_SStructSolver, precond_solver))); + (HYPRE_SStructBiCGSTABSetPrecond( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + HYPRE_SStructSplitSolve, + HYPRE_SStructSplitSetup, + hypre_F90_PassObjRef (HYPRE_SStructSolver, precond_solver))); } - else if(*precond_id == 3) + else if (*precond_id == 3) { *ierr = (hypre_F90_Int) - (HYPRE_SStructBiCGSTABSetPrecond( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - HYPRE_SStructSysPFMGSolve, - HYPRE_SStructSysPFMGSetup, - hypre_F90_PassObj (HYPRE_SStructSolver, precond_solver))); + (HYPRE_SStructBiCGSTABSetPrecond( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + HYPRE_SStructSysPFMGSolve, + HYPRE_SStructSysPFMGSetup, + hypre_F90_PassObj (HYPRE_SStructSolver, precond_solver))); } - else if(*precond_id == 8) + else if (*precond_id == 8) { *ierr = (hypre_F90_Int) - (HYPRE_SStructBiCGSTABSetPrecond( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - HYPRE_SStructDiagScale, - HYPRE_SStructDiagScaleSetup, - hypre_F90_PassObj (HYPRE_SStructSolver, precond_solver))); + (HYPRE_SStructBiCGSTABSetPrecond( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + HYPRE_SStructDiagScale, + HYPRE_SStructDiagScaleSetup, + hypre_F90_PassObj (HYPRE_SStructSolver, precond_solver))); } - else if(*precond_id == 9) + else if (*precond_id == 9) { *ierr = 0; } @@ -233,14 +233,14 @@ hypre_F90_IFACE(hypre_sstructbicgstabsetprecond, HYPRE_SSTRUCTBICGSTABSETPRECOND void hypre_F90_IFACE(hypre_sstructbicgstabsetlogging, HYPRE_SSTRUCTBICGSTABSETLOGGING) - (hypre_F90_Obj *solver, - hypre_F90_Int *logging, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *logging, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructBiCGSTABSetLogging( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (logging) )); + (HYPRE_SStructBiCGSTABSetLogging( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (logging) )); } /*-------------------------------------------------------------------------- @@ -249,14 +249,14 @@ hypre_F90_IFACE(hypre_sstructbicgstabsetlogging, HYPRE_SSTRUCTBICGSTABSETLOGGING void hypre_F90_IFACE(hypre_sstructbicgstabsetprintle, HYPRE_SSTRUCTBICGSTABSETPRINTLE) - (hypre_F90_Obj *solver, - hypre_F90_Int *print_level, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *print_level, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructBiCGSTABSetPrintLevel( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (print_level) )); + (HYPRE_SStructBiCGSTABSetPrintLevel( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (print_level) )); } /*-------------------------------------------------------------------------- @@ -265,14 +265,14 @@ hypre_F90_IFACE(hypre_sstructbicgstabsetprintle, HYPRE_SSTRUCTBICGSTABSETPRINTLE void hypre_F90_IFACE(hypre_sstructbicgstabgetnumiter, HYPRE_SSTRUCTBICGSTABGETNUMITER) - (hypre_F90_Obj *solver, - hypre_F90_Int *num_iterations, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *num_iterations, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructBiCGSTABGetNumIterations( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassIntRef (num_iterations) ) ); + (HYPRE_SStructBiCGSTABGetNumIterations( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassIntRef (num_iterations) ) ); } /*-------------------------------------------------------------------------- @@ -281,14 +281,14 @@ hypre_F90_IFACE(hypre_sstructbicgstabgetnumiter, HYPRE_SSTRUCTBICGSTABGETNUMITER void hypre_F90_IFACE(hypre_sstructbicgstabgetfinalre, HYPRE_SSTRUCTBICGSTABGETFINALRE) - (hypre_F90_Obj *solver, - hypre_F90_Real *norm, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Real *norm, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructBiCGSTABGetFinalRelativeResidualNorm( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassRealRef (norm) )); + (HYPRE_SStructBiCGSTABGetFinalRelativeResidualNorm( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassRealRef (norm) )); } /*-------------------------------------------------------------------------- @@ -297,14 +297,14 @@ hypre_F90_IFACE(hypre_sstructbicgstabgetfinalre, HYPRE_SSTRUCTBICGSTABGETFINALRE void hypre_F90_IFACE(hypre_sstructbicgstabgetresidua, HYPRE_SSTRUCTBICGSTABGETRESIDUA) - (hypre_F90_Obj *solver, - hypre_F90_Obj *residual, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Obj *residual, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructBiCGSTABGetResidual( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - (void **) *residual)); + (HYPRE_SStructBiCGSTABGetResidual( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + (void **) *residual)); } #ifdef __cplusplus diff --git a/external/hypre/src/sstruct_ls/F90_HYPRE_sstruct_flexgmres.c b/external/hypre/src/sstruct_ls/F90_HYPRE_sstruct_flexgmres.c index 698f2222..4d464f2d 100644 --- a/external/hypre/src/sstruct_ls/F90_HYPRE_sstruct_flexgmres.c +++ b/external/hypre/src/sstruct_ls/F90_HYPRE_sstruct_flexgmres.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,21 +17,21 @@ #ifdef __cplusplus extern "C" { #endif - + /*-------------------------------------------------------------------------- * HYPRE_SStructFlexGMRESCreate *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_sstructflexgmrescreate, HYPRE_SSTRUCTFLEXGMRESCREATE) - (hypre_F90_Comm *comm, - hypre_F90_Obj *solver, - hypre_F90_Int *ierr) +(hypre_F90_Comm *comm, + hypre_F90_Obj *solver, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructFlexGMRESCreate( - hypre_F90_PassComm (comm), - hypre_F90_PassObjRef (HYPRE_SStructSolver, solver) )); + (HYPRE_SStructFlexGMRESCreate( + hypre_F90_PassComm (comm), + hypre_F90_PassObjRef (HYPRE_SStructSolver, solver) )); } /*-------------------------------------------------------------------------- @@ -40,12 +40,12 @@ hypre_F90_IFACE(hypre_sstructflexgmrescreate, HYPRE_SSTRUCTFLEXGMRESCREATE) void hypre_F90_IFACE(hypre_sstructflexgmresdestroy, HYPRE_SSTRUCTFLEXGMRESDESTROY) - (hypre_F90_Obj *solver, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructFlexGMRESDestroy( - hypre_F90_PassObj (HYPRE_SStructSolver, solver) )); + (HYPRE_SStructFlexGMRESDestroy( + hypre_F90_PassObj (HYPRE_SStructSolver, solver) )); } /*-------------------------------------------------------------------------- @@ -54,18 +54,18 @@ hypre_F90_IFACE(hypre_sstructflexgmresdestroy, HYPRE_SSTRUCTFLEXGMRESDESTROY) void hypre_F90_IFACE(hypre_sstructflexgmressetup, HYPRE_SSTRUCTFLEXGMRESSETUP) - (hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructFlexGMRESSetup( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassObj (HYPRE_SStructMatrix, A), - hypre_F90_PassObj (HYPRE_SStructVector, b), - hypre_F90_PassObj (HYPRE_SStructVector, x) ) ); + (HYPRE_SStructFlexGMRESSetup( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassObj (HYPRE_SStructMatrix, A), + hypre_F90_PassObj (HYPRE_SStructVector, b), + hypre_F90_PassObj (HYPRE_SStructVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -74,18 +74,18 @@ hypre_F90_IFACE(hypre_sstructflexgmressetup, HYPRE_SSTRUCTFLEXGMRESSETUP) void hypre_F90_IFACE(hypre_sstructflexgmressolve, HYPRE_SSTRUCTFLEXGMRESSOLVE) - (hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructFlexGMRESSolve( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassObj (HYPRE_SStructMatrix, A), - hypre_F90_PassObj (HYPRE_SStructVector, b), - hypre_F90_PassObj (HYPRE_SStructVector, x) ) ); + (HYPRE_SStructFlexGMRESSolve( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassObj (HYPRE_SStructMatrix, A), + hypre_F90_PassObj (HYPRE_SStructVector, b), + hypre_F90_PassObj (HYPRE_SStructVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -94,14 +94,14 @@ hypre_F90_IFACE(hypre_sstructflexgmressolve, HYPRE_SSTRUCTFLEXGMRESSOLVE) void hypre_F90_IFACE(hypre_sstructflexgmressetkdim, HYPRE_SSTRUCTFLEXGMRESSETKDIM) - (hypre_F90_Obj *solver, - hypre_F90_Int *k_dim, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *k_dim, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructFlexGMRESSetKDim( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (k_dim) )); + (HYPRE_SStructFlexGMRESSetKDim( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (k_dim) )); } /*-------------------------------------------------------------------------- @@ -110,14 +110,14 @@ hypre_F90_IFACE(hypre_sstructflexgmressetkdim, HYPRE_SSTRUCTFLEXGMRESSETKDIM) void hypre_F90_IFACE(hypre_sstructflexgmressettol, HYPRE_SSTRUCTFLEXGMRESSETTOL) - (hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructFlexGMRESSetTol( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassReal (tol) ) ); + (HYPRE_SStructFlexGMRESSetTol( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassReal (tol) ) ); } /*-------------------------------------------------------------------------- * HYPRE_SStructFlexGMRESSetAbsoluteTol @@ -125,14 +125,14 @@ hypre_F90_IFACE(hypre_sstructflexgmressettol, HYPRE_SSTRUCTFLEXGMRESSETTOL) void hypre_F90_IFACE(hypre_sstructflexgmressetabsolutetol, HYPRE_SSTRUCTFLEXGMRESSETABSOLUTETOL) - (hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructFlexGMRESSetAbsoluteTol( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassReal (tol) ) ); + (HYPRE_SStructFlexGMRESSetAbsoluteTol( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassReal (tol) ) ); } /*-------------------------------------------------------------------------- * HYPRE_SStructFlexGMRESSetMinIter @@ -140,14 +140,14 @@ hypre_F90_IFACE(hypre_sstructflexgmressetabsolutetol, HYPRE_SSTRUCTFLEXGMRESSETA void hypre_F90_IFACE(hypre_sstructflexgmressetminiter, HYPRE_SSTRUCTFLEXGMRESSETMINITER) - (hypre_F90_Obj *solver, - hypre_F90_Int *min_iter, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *min_iter, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructFlexGMRESSetMinIter( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (min_iter) ) ); + (HYPRE_SStructFlexGMRESSetMinIter( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (min_iter) ) ); } /*-------------------------------------------------------------------------- @@ -156,14 +156,14 @@ hypre_F90_IFACE(hypre_sstructflexgmressetminiter, HYPRE_SSTRUCTFLEXGMRESSETMINIT void hypre_F90_IFACE(hypre_sstructflexgmressetmaxiter, HYPRE_SSTRUCTFLEXGMRESSETMAXITER) - (hypre_F90_Obj *solver, - hypre_F90_Int *max_iter, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *max_iter, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructFlexGMRESSetMaxIter( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (max_iter) ) ); + (HYPRE_SStructFlexGMRESSetMaxIter( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (max_iter) ) ); } @@ -174,10 +174,10 @@ hypre_F90_IFACE(hypre_sstructflexgmressetmaxiter, HYPRE_SSTRUCTFLEXGMRESSETMAXIT void hypre_F90_IFACE(hypre_sstructflexgmressetprecond, HYPRE_SSTRUCTFLEXGMRESSETPRECOND) - (hypre_F90_Obj *solver, - hypre_F90_Int *precond_id, - hypre_F90_Obj *precond_solver, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *precond_id, + hypre_F90_Obj *precond_solver, + hypre_F90_Int *ierr) /*------------------------------------------ * precond_id flags mean: * 2 - setup a split-solver preconditioner @@ -187,36 +187,36 @@ hypre_F90_IFACE(hypre_sstructflexgmressetprecond, HYPRE_SSTRUCTFLEXGMRESSETPRECO *----------------------------------------*/ { - if(*precond_id == 2) + if (*precond_id == 2) { *ierr = (hypre_F90_Int) - (HYPRE_SStructFlexGMRESSetPrecond( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - HYPRE_SStructSplitSolve, - HYPRE_SStructSplitSetup, - hypre_F90_PassObjRef (HYPRE_SStructSolver, precond_solver))); + (HYPRE_SStructFlexGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + HYPRE_SStructSplitSolve, + HYPRE_SStructSplitSetup, + hypre_F90_PassObjRef (HYPRE_SStructSolver, precond_solver))); } - else if(*precond_id == 3) + else if (*precond_id == 3) { *ierr = (hypre_F90_Int) - (HYPRE_SStructFlexGMRESSetPrecond( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - HYPRE_SStructSysPFMGSolve, - HYPRE_SStructSysPFMGSetup, - hypre_F90_PassObjRef (HYPRE_SStructSolver, precond_solver))); + (HYPRE_SStructFlexGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + HYPRE_SStructSysPFMGSolve, + HYPRE_SStructSysPFMGSetup, + hypre_F90_PassObjRef (HYPRE_SStructSolver, precond_solver))); } - else if(*precond_id == 8) + else if (*precond_id == 8) { *ierr = (hypre_F90_Int) - (HYPRE_SStructFlexGMRESSetPrecond( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - HYPRE_SStructDiagScale, - HYPRE_SStructDiagScaleSetup, - hypre_F90_PassObjRef (HYPRE_SStructSolver, precond_solver))); + (HYPRE_SStructFlexGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + HYPRE_SStructDiagScale, + HYPRE_SStructDiagScaleSetup, + hypre_F90_PassObjRef (HYPRE_SStructSolver, precond_solver))); } - else if(*precond_id == 9) + else if (*precond_id == 9) { *ierr = 0; } @@ -234,14 +234,14 @@ hypre_F90_IFACE(hypre_sstructflexgmressetprecond, HYPRE_SSTRUCTFLEXGMRESSETPRECO void hypre_F90_IFACE(hypre_sstructflexgmressetlogging, HYPRE_SSTRUCTFLEXGMRESSETLOGGING) - (hypre_F90_Obj *solver, - hypre_F90_Int *logging, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *logging, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructFlexGMRESSetLogging( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (logging) ) ); + (HYPRE_SStructFlexGMRESSetLogging( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (logging) ) ); } /*-------------------------------------------------------------------------- @@ -250,14 +250,14 @@ hypre_F90_IFACE(hypre_sstructflexgmressetlogging, HYPRE_SSTRUCTFLEXGMRESSETLOGGI void hypre_F90_IFACE(hypre_sstructflexgmressetprintlevel, HYPRE_SSTRUCTFLEXGMRESSETPRINTLEVEL) - (hypre_F90_Obj *solver, - hypre_F90_Int *level, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *level, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructFlexGMRESSetPrintLevel( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (level) ) ); + (HYPRE_SStructFlexGMRESSetPrintLevel( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (level) ) ); } /*-------------------------------------------------------------------------- @@ -266,14 +266,14 @@ hypre_F90_IFACE(hypre_sstructflexgmressetprintlevel, HYPRE_SSTRUCTFLEXGMRESSETPR void hypre_F90_IFACE(hypre_sstructflexgmresgetnumiterati, HYPRE_SSTRUCTFLEXGMRESGETNUMITERATI) - (hypre_F90_Obj *solver, - hypre_F90_Int *num_iterations, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *num_iterations, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructFlexGMRESGetNumIterations( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassIntRef (num_iterations) ) ); + (HYPRE_SStructFlexGMRESGetNumIterations( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassIntRef (num_iterations) ) ); } /*-------------------------------------------------------------------------- @@ -282,14 +282,14 @@ hypre_F90_IFACE(hypre_sstructflexgmresgetnumiterati, HYPRE_SSTRUCTFLEXGMRESGETNU void hypre_F90_IFACE(hypre_sstructflexgmresgetfinalrelat, HYPRE_SSTRUCTFLEXGMRESGETFINALRELAT) - (hypre_F90_Obj *solver, - hypre_F90_Real *norm, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Real *norm, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructFlexGMRESGetFinalRelativeResidualNorm( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassRealRef (norm) ) ); + (HYPRE_SStructFlexGMRESGetFinalRelativeResidualNorm( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassRealRef (norm) ) ); } /*-------------------------------------------------------------------------- @@ -298,14 +298,14 @@ hypre_F90_IFACE(hypre_sstructflexgmresgetfinalrelat, HYPRE_SSTRUCTFLEXGMRESGETFI void hypre_F90_IFACE(hypre_sstructflexgmresgetresidual, HYPRE_SSTRUCTFLEXGMRESGETRESIDUAL) - (hypre_F90_Obj *solver, - hypre_F90_Obj *residual, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Obj *residual, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructFlexGMRESGetResidual( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - (void **) *residual ) ); + (HYPRE_SStructFlexGMRESGetResidual( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + (void **) *residual ) ); } #ifdef __cplusplus diff --git a/external/hypre/src/sstruct_ls/F90_HYPRE_sstruct_gmres.c b/external/hypre/src/sstruct_ls/F90_HYPRE_sstruct_gmres.c index 4ed75aca..1f1e30b4 100644 --- a/external/hypre/src/sstruct_ls/F90_HYPRE_sstruct_gmres.c +++ b/external/hypre/src/sstruct_ls/F90_HYPRE_sstruct_gmres.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,20 +17,20 @@ #ifdef __cplusplus extern "C" { #endif - + /*-------------------------------------------------------------------------- * HYPRE_SStructGMRESCreate *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_sstructgmrescreate, HYPRE_SSTRUCTGMRESCREATE) - (hypre_F90_Comm *comm, - hypre_F90_Obj *solver, - hypre_F90_Int *ierr) +(hypre_F90_Comm *comm, + hypre_F90_Obj *solver, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) HYPRE_SStructGMRESCreate( - hypre_F90_PassComm(comm), - hypre_F90_PassObjRef(HYPRE_SStructSolver,solver)); + hypre_F90_PassComm(comm), + hypre_F90_PassObjRef(HYPRE_SStructSolver, solver)); } /*-------------------------------------------------------------------------- @@ -39,12 +39,12 @@ hypre_F90_IFACE(hypre_sstructgmrescreate, HYPRE_SSTRUCTGMRESCREATE) void hypre_F90_IFACE(hypre_sstructgmresdestroy, HYPRE_SSTRUCTGMRESDESTROY) - (hypre_F90_Obj *solver, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructGMRESDestroy( - hypre_F90_PassObj (HYPRE_SStructSolver, solver) )); + (HYPRE_SStructGMRESDestroy( + hypre_F90_PassObj (HYPRE_SStructSolver, solver) )); } /*-------------------------------------------------------------------------- @@ -53,18 +53,18 @@ hypre_F90_IFACE(hypre_sstructgmresdestroy, HYPRE_SSTRUCTGMRESDESTROY) void hypre_F90_IFACE(hypre_sstructgmressetup, HYPRE_SSTRUCTGMRESSETUP) - (hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructGMRESSetup( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassObj (HYPRE_SStructMatrix, A), - hypre_F90_PassObj (HYPRE_SStructVector, b), - hypre_F90_PassObj (HYPRE_SStructVector, x) ) ); + (HYPRE_SStructGMRESSetup( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassObj (HYPRE_SStructMatrix, A), + hypre_F90_PassObj (HYPRE_SStructVector, b), + hypre_F90_PassObj (HYPRE_SStructVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -73,18 +73,18 @@ hypre_F90_IFACE(hypre_sstructgmressetup, HYPRE_SSTRUCTGMRESSETUP) void hypre_F90_IFACE(hypre_sstructgmressolve, HYPRE_SSTRUCTGMRESSOLVE) - (hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructGMRESSolve( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassObj (HYPRE_SStructMatrix, A), - hypre_F90_PassObj (HYPRE_SStructVector, b), - hypre_F90_PassObj (HYPRE_SStructVector, x) ) ); + (HYPRE_SStructGMRESSolve( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassObj (HYPRE_SStructMatrix, A), + hypre_F90_PassObj (HYPRE_SStructVector, b), + hypre_F90_PassObj (HYPRE_SStructVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -93,14 +93,14 @@ hypre_F90_IFACE(hypre_sstructgmressolve, HYPRE_SSTRUCTGMRESSOLVE) void hypre_F90_IFACE(hypre_sstructgmressetkdim, HYPRE_SSTRUCTGMRESSETKDIM) - (hypre_F90_Obj *solver, - hypre_F90_Int *k_dim, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *k_dim, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructGMRESSetKDim( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (k_dim) )); + (HYPRE_SStructGMRESSetKDim( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (k_dim) )); } /*-------------------------------------------------------------------------- @@ -109,14 +109,14 @@ hypre_F90_IFACE(hypre_sstructgmressetkdim, HYPRE_SSTRUCTGMRESSETKDIM) void hypre_F90_IFACE(hypre_sstructgmressettol, HYPRE_SSTRUCTGMRESSETTOL) - (hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructGMRESSetTol( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassReal (tol) ) ); + (HYPRE_SStructGMRESSetTol( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassReal (tol) ) ); } /*-------------------------------------------------------------------------- * HYPRE_SStructGMRESSetAbsoluteTol @@ -124,14 +124,14 @@ hypre_F90_IFACE(hypre_sstructgmressettol, HYPRE_SSTRUCTGMRESSETTOL) void hypre_F90_IFACE(hypre_sstructgmressetabsolutetol, HYPRE_SSTRUCTGMRESSETABSOLUTETOL) - (hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructGMRESSetAbsoluteTol( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassReal (tol) ) ); + (HYPRE_SStructGMRESSetAbsoluteTol( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassReal (tol) ) ); } /*-------------------------------------------------------------------------- * HYPRE_SStructGMRESSetMinIter @@ -139,14 +139,14 @@ hypre_F90_IFACE(hypre_sstructgmressetabsolutetol, HYPRE_SSTRUCTGMRESSETABSOLUTET void hypre_F90_IFACE(hypre_sstructgmressetminiter, HYPRE_SSTRUCTGMRESSETMINITER) - (hypre_F90_Obj *solver, - hypre_F90_Int *min_iter, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *min_iter, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructGMRESSetMinIter( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (min_iter) ) ); + (HYPRE_SStructGMRESSetMinIter( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (min_iter) ) ); } /*-------------------------------------------------------------------------- @@ -155,14 +155,14 @@ hypre_F90_IFACE(hypre_sstructgmressetminiter, HYPRE_SSTRUCTGMRESSETMINITER) void hypre_F90_IFACE(hypre_sstructgmressetmaxiter, HYPRE_SSTRUCTGMRESSETMAXITER) - (hypre_F90_Obj *solver, - hypre_F90_Int *max_iter, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *max_iter, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructGMRESSetMaxIter( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (max_iter) ) ); + (HYPRE_SStructGMRESSetMaxIter( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (max_iter) ) ); } /*-------------------------------------------------------------------------- @@ -171,14 +171,14 @@ hypre_F90_IFACE(hypre_sstructgmressetmaxiter, HYPRE_SSTRUCTGMRESSETMAXITER) void hypre_F90_IFACE(hypre_sstructgmressetstopcrit, HYPRE_SSTRUCTGMRESSETSTOPCRIT) - (hypre_F90_Obj *solver, - hypre_F90_Int *stop_crit, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *stop_crit, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructGMRESSetStopCrit( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (stop_crit) ) ); + (HYPRE_SStructGMRESSetStopCrit( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (stop_crit) ) ); } /*-------------------------------------------------------------------------- @@ -187,10 +187,10 @@ hypre_F90_IFACE(hypre_sstructgmressetstopcrit, HYPRE_SSTRUCTGMRESSETSTOPCRIT) void hypre_F90_IFACE(hypre_sstructgmressetprecond, HYPRE_SSTRUCTGMRESSETPRECOND) - (hypre_F90_Obj *solver, - hypre_F90_Int *precond_id, - hypre_F90_Obj *precond_solver, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *precond_id, + hypre_F90_Obj *precond_solver, + hypre_F90_Int *ierr) /*------------------------------------------ * precond_id flags mean: * 2 - setup a split-solver preconditioner @@ -200,36 +200,36 @@ hypre_F90_IFACE(hypre_sstructgmressetprecond, HYPRE_SSTRUCTGMRESSETPRECOND) *----------------------------------------*/ { - if(*precond_id == 2) + if (*precond_id == 2) { *ierr = (hypre_F90_Int) - (HYPRE_SStructGMRESSetPrecond( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - HYPRE_SStructSplitSolve, - HYPRE_SStructSplitSetup, - hypre_F90_PassObjRef (HYPRE_SStructSolver, precond_solver))); + (HYPRE_SStructGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + HYPRE_SStructSplitSolve, + HYPRE_SStructSplitSetup, + hypre_F90_PassObjRef (HYPRE_SStructSolver, precond_solver))); } - else if(*precond_id == 3) + else if (*precond_id == 3) { *ierr = (hypre_F90_Int) - (HYPRE_SStructGMRESSetPrecond( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - HYPRE_SStructSysPFMGSolve, - HYPRE_SStructSysPFMGSetup, - hypre_F90_PassObjRef (HYPRE_SStructSolver, precond_solver))); + (HYPRE_SStructGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + HYPRE_SStructSysPFMGSolve, + HYPRE_SStructSysPFMGSetup, + hypre_F90_PassObjRef (HYPRE_SStructSolver, precond_solver))); } - else if(*precond_id == 8) + else if (*precond_id == 8) { *ierr = (hypre_F90_Int) - (HYPRE_SStructGMRESSetPrecond( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - HYPRE_SStructDiagScale, - HYPRE_SStructDiagScaleSetup, - hypre_F90_PassObjRef (HYPRE_SStructSolver, precond_solver))); + (HYPRE_SStructGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + HYPRE_SStructDiagScale, + HYPRE_SStructDiagScaleSetup, + hypre_F90_PassObjRef (HYPRE_SStructSolver, precond_solver))); } - else if(*precond_id == 9) + else if (*precond_id == 9) { *ierr = 0; } @@ -247,14 +247,14 @@ hypre_F90_IFACE(hypre_sstructgmressetprecond, HYPRE_SSTRUCTGMRESSETPRECOND) void hypre_F90_IFACE(hypre_sstructgmressetlogging, HYPRE_SSTRUCTGMRESSETLOGGING) - (hypre_F90_Obj *solver, - hypre_F90_Int *logging, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *logging, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructGMRESSetLogging( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (logging) ) ); + (HYPRE_SStructGMRESSetLogging( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (logging) ) ); } /*-------------------------------------------------------------------------- @@ -263,14 +263,14 @@ hypre_F90_IFACE(hypre_sstructgmressetlogging, HYPRE_SSTRUCTGMRESSETLOGGING) void hypre_F90_IFACE(hypre_sstructgmressetprintlevel, HYPRE_SSTRUCTGMRESSETPRINTLEVEL) - (hypre_F90_Obj *solver, - hypre_F90_Int *level, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *level, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructGMRESSetPrintLevel( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (level) ) ); + (HYPRE_SStructGMRESSetPrintLevel( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (level) ) ); } /*-------------------------------------------------------------------------- @@ -279,14 +279,14 @@ hypre_F90_IFACE(hypre_sstructgmressetprintlevel, HYPRE_SSTRUCTGMRESSETPRINTLEVEL void hypre_F90_IFACE(hypre_sstructgmresgetnumiterati, HYPRE_SSTRUCTGMRESGETNUMITERATI) - (hypre_F90_Obj *solver, - hypre_F90_Int *num_iterations, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *num_iterations, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructGMRESGetNumIterations( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassIntRef (num_iterations) ) ); + (HYPRE_SStructGMRESGetNumIterations( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassIntRef (num_iterations) ) ); } /*-------------------------------------------------------------------------- @@ -295,14 +295,14 @@ hypre_F90_IFACE(hypre_sstructgmresgetnumiterati, HYPRE_SSTRUCTGMRESGETNUMITERATI void hypre_F90_IFACE(hypre_sstructgmresgetfinalrelat, HYPRE_SSTRUCTGMRESGETFINALRELAT) - (hypre_F90_Obj *solver, - hypre_F90_Real *norm, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Real *norm, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructGMRESGetFinalRelativeResidualNorm( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassRealRef (norm) ) ); + (HYPRE_SStructGMRESGetFinalRelativeResidualNorm( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassRealRef (norm) ) ); } /*-------------------------------------------------------------------------- @@ -311,14 +311,14 @@ hypre_F90_IFACE(hypre_sstructgmresgetfinalrelat, HYPRE_SSTRUCTGMRESGETFINALRELAT void hypre_F90_IFACE(hypre_sstructgmresgetresidual, HYPRE_SSTRUCTGMRESGETRESIDUAL) - (hypre_F90_Obj *solver, - hypre_F90_Obj *residual, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Obj *residual, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructGMRESGetResidual( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - (void **) *residual ) ); + (HYPRE_SStructGMRESGetResidual( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + (void **) *residual ) ); } #ifdef __cplusplus diff --git a/external/hypre/src/sstruct_ls/F90_HYPRE_sstruct_int.c b/external/hypre/src/sstruct_ls/F90_HYPRE_sstruct_int.c index 4f06cf70..2e1e0deb 100644 --- a/external/hypre/src/sstruct_ls/F90_HYPRE_sstruct_int.c +++ b/external/hypre/src/sstruct_ls/F90_HYPRE_sstruct_int.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -18,21 +18,21 @@ #ifdef __cplusplus extern "C" { #endif - + /*-------------------------------------------------------------------------- * HYPRE_SStructPVectorSetRandomValues *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_sstructpvectorsetrandomva, HYPRE_SSTRUCTPVECTORSETRANDOMVA) - (hypre_F90_Obj *pvector, - hypre_F90_Int *seed, - hypre_F90_Int *ierr) +(hypre_F90_Obj *pvector, + hypre_F90_Int *seed, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( hypre_SStructPVectorSetRandomValues( - (hypre_SStructPVector *) pvector, - hypre_F90_PassInt (seed) )); + ( hypre_SStructPVectorSetRandomValues( + (hypre_SStructPVector *) pvector, + hypre_F90_PassInt (seed) )); } /*-------------------------------------------------------------------------- @@ -41,14 +41,14 @@ hypre_F90_IFACE(hypre_sstructpvectorsetrandomva, HYPRE_SSTRUCTPVECTORSETRANDOMVA void hypre_F90_IFACE(hypre_sstructvectorsetrandomval, HYPRE_SSTRUCTVECTORSETRANDOMVAL) - (hypre_F90_Obj *vector, - hypre_F90_Int *seed, - hypre_F90_Int *ierr) +(hypre_F90_Obj *vector, + hypre_F90_Int *seed, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( hypre_SStructVectorSetRandomValues( - (hypre_SStructVector *) vector, - hypre_F90_PassInt (seed) )); + ( hypre_SStructVectorSetRandomValues( + (hypre_SStructVector *) vector, + hypre_F90_PassInt (seed) )); } /*-------------------------------------------------------------------------- @@ -57,13 +57,13 @@ hypre_F90_IFACE(hypre_sstructvectorsetrandomval, HYPRE_SSTRUCTVECTORSETRANDOMVAL void hypre_F90_IFACE(hypre_sstructsetrandomvalues, HYPRE_SSTRUCTSETRANDOMVALUES) - (hypre_F90_Obj *v, - hypre_F90_Int *seed, - hypre_F90_Int *ierr) +(hypre_F90_Obj *v, + hypre_F90_Int *seed, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( hypre_SStructSetRandomValues( - (void *) v, hypre_F90_PassInt (seed) )); + ( hypre_SStructSetRandomValues( + (void *) v, hypre_F90_PassInt (seed) )); } /*-------------------------------------------------------------------------- @@ -72,12 +72,12 @@ hypre_F90_IFACE(hypre_sstructsetrandomvalues, HYPRE_SSTRUCTSETRANDOMVALUES) void hypre_F90_IFACE(hypre_sstructsetupinterpreter, HYPRE_SSTRUCTSETUPINTERPRETER) - (hypre_F90_Obj *i, - hypre_F90_Int *ierr) +(hypre_F90_Obj *i, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SStructSetupInterpreter( - (mv_InterfaceInterpreter *) i )); + ( HYPRE_SStructSetupInterpreter( + (mv_InterfaceInterpreter *) i )); } /*-------------------------------------------------------------------------- @@ -86,12 +86,12 @@ hypre_F90_IFACE(hypre_sstructsetupinterpreter, HYPRE_SSTRUCTSETUPINTERPRETER) void hypre_F90_IFACE(hypre_sstructsetupmatvec, HYPRE_SSTRUCTSETUPMATVEC) - (hypre_F90_Obj *mv, - hypre_F90_Int *ierr) +(hypre_F90_Obj *mv, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SStructSetupMatvec( - hypre_F90_PassObjRef (HYPRE_MatvecFunctions, mv))); + ( HYPRE_SStructSetupMatvec( + hypre_F90_PassObjRef (HYPRE_MatvecFunctions, mv))); } #ifdef __cplusplus diff --git a/external/hypre/src/sstruct_ls/F90_HYPRE_sstruct_lgmres.c b/external/hypre/src/sstruct_ls/F90_HYPRE_sstruct_lgmres.c index 2ac6bd0b..e11e3d0b 100644 --- a/external/hypre/src/sstruct_ls/F90_HYPRE_sstruct_lgmres.c +++ b/external/hypre/src/sstruct_ls/F90_HYPRE_sstruct_lgmres.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -24,14 +24,14 @@ extern "C" { void hypre_F90_IFACE(hypre_sstructlgmrescreate, HYPRE_SSTRUCTLGMRESCREATE) - (hypre_F90_Comm *comm, - hypre_F90_Obj *solver, - hypre_F90_Int *ierr) +(hypre_F90_Comm *comm, + hypre_F90_Obj *solver, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructLGMRESCreate( - hypre_F90_PassComm (comm), - hypre_F90_PassObjRef (HYPRE_SStructSolver, solver) )); + (HYPRE_SStructLGMRESCreate( + hypre_F90_PassComm (comm), + hypre_F90_PassObjRef (HYPRE_SStructSolver, solver) )); } /*-------------------------------------------------------------------------- @@ -40,12 +40,12 @@ hypre_F90_IFACE(hypre_sstructlgmrescreate, HYPRE_SSTRUCTLGMRESCREATE) void hypre_F90_IFACE(hypre_sstructlgmresdestroy, HYPRE_SSTRUCTLGMRESDESTROY) - (hypre_F90_Obj *solver, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructLGMRESDestroy( - hypre_F90_PassObj (HYPRE_SStructSolver, solver) )); + (HYPRE_SStructLGMRESDestroy( + hypre_F90_PassObj (HYPRE_SStructSolver, solver) )); } /*-------------------------------------------------------------------------- @@ -54,18 +54,18 @@ hypre_F90_IFACE(hypre_sstructlgmresdestroy, HYPRE_SSTRUCTLGMRESDESTROY) void hypre_F90_IFACE(hypre_sstructlgmressetup, HYPRE_SSTRUCTLGMRESSETUP) - (hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructLGMRESSetup( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassObj (HYPRE_SStructMatrix, A), - hypre_F90_PassObj (HYPRE_SStructVector, b), - hypre_F90_PassObj (HYPRE_SStructVector, x) ) ); + (HYPRE_SStructLGMRESSetup( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassObj (HYPRE_SStructMatrix, A), + hypre_F90_PassObj (HYPRE_SStructVector, b), + hypre_F90_PassObj (HYPRE_SStructVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -74,18 +74,18 @@ hypre_F90_IFACE(hypre_sstructlgmressetup, HYPRE_SSTRUCTLGMRESSETUP) void hypre_F90_IFACE(hypre_sstructlgmressolve, HYPRE_SSTRUCTLGMRESSOLVE) - (hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructLGMRESSolve( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassObj (HYPRE_SStructMatrix, A), - hypre_F90_PassObj (HYPRE_SStructVector, b), - hypre_F90_PassObj (HYPRE_SStructVector, x) ) ); + (HYPRE_SStructLGMRESSolve( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassObj (HYPRE_SStructMatrix, A), + hypre_F90_PassObj (HYPRE_SStructVector, b), + hypre_F90_PassObj (HYPRE_SStructVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -94,14 +94,14 @@ hypre_F90_IFACE(hypre_sstructlgmressolve, HYPRE_SSTRUCTLGMRESSOLVE) void hypre_F90_IFACE(hypre_sstructlgmressetkdim, HYPRE_SSTRUCTLGMRESSETKDIM) - (hypre_F90_Obj *solver, - hypre_F90_Int *k_dim, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *k_dim, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructLGMRESSetKDim( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (k_dim) )); + (HYPRE_SStructLGMRESSetKDim( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (k_dim) )); } /*-------------------------------------------------------------------------- * HYPRE_SStructLGMRESSetAugDim @@ -109,14 +109,14 @@ hypre_F90_IFACE(hypre_sstructlgmressetkdim, HYPRE_SSTRUCTLGMRESSETKDIM) void hypre_F90_IFACE(hypre_sstructlgmressetaugdim, HYPRE_SSTRUCTLGMRESSETAUGDIM) - (hypre_F90_Obj *solver, - hypre_F90_Int *aug_dim, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *aug_dim, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructLGMRESSetAugDim( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (aug_dim) )); + (HYPRE_SStructLGMRESSetAugDim( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (aug_dim) )); } /*-------------------------------------------------------------------------- * HYPRE_SStructLGMRESSetTol @@ -124,14 +124,14 @@ hypre_F90_IFACE(hypre_sstructlgmressetaugdim, HYPRE_SSTRUCTLGMRESSETAUGDIM) void hypre_F90_IFACE(hypre_sstructlgmressettol, HYPRE_SSTRUCTLGMRESSETTOL) - (hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructLGMRESSetTol( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassReal (tol) ) ); + (HYPRE_SStructLGMRESSetTol( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassReal (tol) ) ); } /*-------------------------------------------------------------------------- * HYPRE_SStructLGMRESSetAbsoluteTol @@ -139,14 +139,14 @@ hypre_F90_IFACE(hypre_sstructlgmressettol, HYPRE_SSTRUCTLGMRESSETTOL) void hypre_F90_IFACE(hypre_sstructlgmressetabsolutetol, HYPRE_SSTRUCTLGMRESSETABSOLUTETOL) - (hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructLGMRESSetAbsoluteTol( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassReal (tol) ) ); + (HYPRE_SStructLGMRESSetAbsoluteTol( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassReal (tol) ) ); } /*-------------------------------------------------------------------------- * HYPRE_SStructLGMRESSetMinIter @@ -154,14 +154,14 @@ hypre_F90_IFACE(hypre_sstructlgmressetabsolutetol, HYPRE_SSTRUCTLGMRESSETABSOLUT void hypre_F90_IFACE(hypre_sstructlgmressetminiter, HYPRE_SSTRUCTLGMRESSETMINITER) - (hypre_F90_Obj *solver, - hypre_F90_Int *min_iter, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *min_iter, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructLGMRESSetMinIter( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (min_iter) ) ); + (HYPRE_SStructLGMRESSetMinIter( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (min_iter) ) ); } /*-------------------------------------------------------------------------- @@ -170,14 +170,14 @@ hypre_F90_IFACE(hypre_sstructlgmressetminiter, HYPRE_SSTRUCTLGMRESSETMINITER) void hypre_F90_IFACE(hypre_sstructlgmressetmaxiter, HYPRE_SSTRUCTLGMRESSETMAXITER) - (hypre_F90_Obj *solver, - hypre_F90_Int *max_iter, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *max_iter, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructLGMRESSetMaxIter( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (max_iter) ) ); + (HYPRE_SStructLGMRESSetMaxIter( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (max_iter) ) ); } @@ -188,10 +188,10 @@ hypre_F90_IFACE(hypre_sstructlgmressetmaxiter, HYPRE_SSTRUCTLGMRESSETMAXITER) void hypre_F90_IFACE(hypre_sstructlgmressetprecond, HYPRE_SSTRUCTLGMRESSETPRECOND) - (hypre_F90_Obj *solver, - hypre_F90_Int *precond_id, - hypre_F90_Obj *precond_solver, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *precond_id, + hypre_F90_Obj *precond_solver, + hypre_F90_Int *ierr) /*------------------------------------------ * precond_id flags mean: * 2 - setup a split-solver preconditioner @@ -201,36 +201,36 @@ hypre_F90_IFACE(hypre_sstructlgmressetprecond, HYPRE_SSTRUCTLGMRESSETPRECOND) *----------------------------------------*/ { - if(*precond_id == 2) + if (*precond_id == 2) { *ierr = (hypre_F90_Int) - (HYPRE_SStructLGMRESSetPrecond( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - HYPRE_SStructSplitSolve, - HYPRE_SStructSplitSetup, - hypre_F90_PassObjRef (HYPRE_SStructSolver, precond_solver))); + (HYPRE_SStructLGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + HYPRE_SStructSplitSolve, + HYPRE_SStructSplitSetup, + hypre_F90_PassObjRef (HYPRE_SStructSolver, precond_solver))); } - else if(*precond_id == 3) + else if (*precond_id == 3) { *ierr = (hypre_F90_Int) - (HYPRE_SStructLGMRESSetPrecond( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - HYPRE_SStructSysPFMGSolve, - HYPRE_SStructSysPFMGSetup, - hypre_F90_PassObjRef (HYPRE_SStructSolver, precond_solver))); + (HYPRE_SStructLGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + HYPRE_SStructSysPFMGSolve, + HYPRE_SStructSysPFMGSetup, + hypre_F90_PassObjRef (HYPRE_SStructSolver, precond_solver))); } - else if(*precond_id == 8) + else if (*precond_id == 8) { *ierr = (hypre_F90_Int) - (HYPRE_SStructLGMRESSetPrecond( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - HYPRE_SStructDiagScale, - HYPRE_SStructDiagScaleSetup, - hypre_F90_PassObjRef (HYPRE_SStructSolver, precond_solver))); + (HYPRE_SStructLGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + HYPRE_SStructDiagScale, + HYPRE_SStructDiagScaleSetup, + hypre_F90_PassObjRef (HYPRE_SStructSolver, precond_solver))); } - else if(*precond_id == 9) + else if (*precond_id == 9) { *ierr = 0; } @@ -248,14 +248,14 @@ hypre_F90_IFACE(hypre_sstructlgmressetprecond, HYPRE_SSTRUCTLGMRESSETPRECOND) void hypre_F90_IFACE(hypre_sstructlgmressetlogging, HYPRE_SSTRUCTLGMRESSETLOGGING) - (hypre_F90_Obj *solver, - hypre_F90_Int *logging, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *logging, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructLGMRESSetLogging( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (logging) ) ); + (HYPRE_SStructLGMRESSetLogging( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (logging) ) ); } /*-------------------------------------------------------------------------- @@ -264,14 +264,14 @@ hypre_F90_IFACE(hypre_sstructlgmressetlogging, HYPRE_SSTRUCTLGMRESSETLOGGING) void hypre_F90_IFACE(hypre_sstructlgmressetprintlevel, HYPRE_SSTRUCTLGMRESSETPRINTLEVEL) - (hypre_F90_Obj *solver, - hypre_F90_Int *level, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *level, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructLGMRESSetPrintLevel( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (level) ) ); + (HYPRE_SStructLGMRESSetPrintLevel( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (level) ) ); } /*-------------------------------------------------------------------------- @@ -280,14 +280,14 @@ hypre_F90_IFACE(hypre_sstructlgmressetprintlevel, HYPRE_SSTRUCTLGMRESSETPRINTLEV void hypre_F90_IFACE(hypre_sstructlgmresgetnumiterati, HYPRE_SSTRUCTLGMRESGETNUMITERATI) - (hypre_F90_Obj *solver, - hypre_F90_Int *num_iterations, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *num_iterations, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructLGMRESGetNumIterations( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassIntRef (num_iterations) ) ); + (HYPRE_SStructLGMRESGetNumIterations( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassIntRef (num_iterations) ) ); } /*-------------------------------------------------------------------------- @@ -296,14 +296,14 @@ hypre_F90_IFACE(hypre_sstructlgmresgetnumiterati, HYPRE_SSTRUCTLGMRESGETNUMITERA void hypre_F90_IFACE(hypre_sstructlgmresgetfinalrelat, HYPRE_SSTRUCTLGMRESGETFINALRELAT) - (hypre_F90_Obj *solver, - hypre_F90_Real *norm, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Real *norm, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructLGMRESGetFinalRelativeResidualNorm( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassRealRef (norm) ) ); + (HYPRE_SStructLGMRESGetFinalRelativeResidualNorm( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassRealRef (norm) ) ); } /*-------------------------------------------------------------------------- @@ -312,14 +312,14 @@ hypre_F90_IFACE(hypre_sstructlgmresgetfinalrelat, HYPRE_SSTRUCTLGMRESGETFINALREL void hypre_F90_IFACE(hypre_sstructlgmresgetresidual, HYPRE_SSTRUCTLGMRESGETRESIDUAL) - (hypre_F90_Obj *solver, - hypre_F90_Obj *residual, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Obj *residual, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructLGMRESGetResidual( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - (void **) *residual ) ); + (HYPRE_SStructLGMRESGetResidual( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + (void **) *residual ) ); } #ifdef __cplusplus diff --git a/external/hypre/src/sstruct_ls/F90_HYPRE_sstruct_maxwell.c b/external/hypre/src/sstruct_ls/F90_HYPRE_sstruct_maxwell.c index 2e7efd30..4aa2492c 100644 --- a/external/hypre/src/sstruct_ls/F90_HYPRE_sstruct_maxwell.c +++ b/external/hypre/src/sstruct_ls/F90_HYPRE_sstruct_maxwell.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,21 +17,21 @@ #ifdef __cplusplus extern "C" { #endif - + /*-------------------------------------------------------------------------- * HYPRE_SStructMaxwellCreate *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_sstructmaxwellcreate, HYPRE_SSTRUCTMAXWELLCREATE) - (hypre_F90_Comm *comm, - hypre_F90_Obj *solver, - hypre_F90_Int *ierr) +(hypre_F90_Comm *comm, + hypre_F90_Obj *solver, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructMaxwellCreate( - hypre_F90_PassComm (comm), - hypre_F90_PassObjRef (HYPRE_SStructSolver, solver)) ); + (HYPRE_SStructMaxwellCreate( + hypre_F90_PassComm (comm), + hypre_F90_PassObjRef (HYPRE_SStructSolver, solver)) ); } /*-------------------------------------------------------------------------- @@ -40,12 +40,12 @@ hypre_F90_IFACE(hypre_sstructmaxwellcreate, HYPRE_SSTRUCTMAXWELLCREATE) void hypre_F90_IFACE(hypre_sstructmaxwelldestroy, HYPRE_SSTRUCTMAXWELLDESTROY) - (hypre_F90_Obj *solver, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructMaxwellDestroy( - hypre_F90_PassObj (HYPRE_SStructSolver, solver))); + (HYPRE_SStructMaxwellDestroy( + hypre_F90_PassObj (HYPRE_SStructSolver, solver))); } /*-------------------------------------------------------------------------- @@ -54,18 +54,18 @@ hypre_F90_IFACE(hypre_sstructmaxwelldestroy, HYPRE_SSTRUCTMAXWELLDESTROY) void hypre_F90_IFACE(hypre_sstructmaxwellsetup, HYPRE_SSTRUCTMAXWELLSETUP) - (hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SStructMaxwellSetup( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassObj (HYPRE_SStructMatrix, A), - hypre_F90_PassObj (HYPRE_SStructVector, b), - hypre_F90_PassObj (HYPRE_SStructVector, x) )); + ( HYPRE_SStructMaxwellSetup( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassObj (HYPRE_SStructMatrix, A), + hypre_F90_PassObj (HYPRE_SStructVector, b), + hypre_F90_PassObj (HYPRE_SStructVector, x) )); } /*-------------------------------------------------------------------------- @@ -74,18 +74,18 @@ hypre_F90_IFACE(hypre_sstructmaxwellsetup, HYPRE_SSTRUCTMAXWELLSETUP) void hypre_F90_IFACE(hypre_sstructmaxwellsolve, HYPRE_SSTRUCTMAXWELLSOLVE) - (hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructMaxwellSolve( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassObj (HYPRE_SStructMatrix, A), - hypre_F90_PassObj (HYPRE_SStructVector, b), - hypre_F90_PassObj (HYPRE_SStructVector, x) ) ); + (HYPRE_SStructMaxwellSolve( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassObj (HYPRE_SStructMatrix, A), + hypre_F90_PassObj (HYPRE_SStructVector, b), + hypre_F90_PassObj (HYPRE_SStructVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -94,18 +94,18 @@ hypre_F90_IFACE(hypre_sstructmaxwellsolve, HYPRE_SSTRUCTMAXWELLSOLVE) void hypre_F90_IFACE(hypre_sstructmaxwellsolve2, HYPRE_SSTRUCTMAXWELLSOLVE2) - (hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructMaxwellSolve2( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassObj (HYPRE_SStructMatrix, A), - hypre_F90_PassObj (HYPRE_SStructVector, b), - hypre_F90_PassObj (HYPRE_SStructVector, x) ) ); + (HYPRE_SStructMaxwellSolve2( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassObj (HYPRE_SStructMatrix, A), + hypre_F90_PassObj (HYPRE_SStructVector, b), + hypre_F90_PassObj (HYPRE_SStructVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -114,14 +114,14 @@ hypre_F90_IFACE(hypre_sstructmaxwellsolve2, HYPRE_SSTRUCTMAXWELLSOLVE2) void hypre_F90_IFACE(hypre_maxwellgrad, HYPRE_MAXWELLGRAD) - (hypre_F90_Obj *grid, - hypre_F90_Obj *T, - hypre_F90_Int *ierr) +(hypre_F90_Obj *grid, + hypre_F90_Obj *T, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_MaxwellGrad( - hypre_F90_PassObj (HYPRE_SStructGrid, grid), - hypre_F90_PassObjRef (HYPRE_ParCSRMatrix, T) ) ); + ( HYPRE_MaxwellGrad( + hypre_F90_PassObj (HYPRE_SStructGrid, grid), + hypre_F90_PassObjRef (HYPRE_ParCSRMatrix, T) ) ); } /*-------------------------------------------------------------------------- @@ -130,14 +130,14 @@ hypre_F90_IFACE(hypre_maxwellgrad, HYPRE_MAXWELLGRAD) void hypre_F90_IFACE(hypre_sstructmaxwellsetgrad, HYPRE_SSTRUCTMAXWELLSETGRAD) - (hypre_F90_Obj *solver, - hypre_F90_Obj *T, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Obj *T, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SStructMaxwellSetGrad( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassObj (HYPRE_ParCSRMatrix, T) )); + ( HYPRE_SStructMaxwellSetGrad( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassObj (HYPRE_ParCSRMatrix, T) )); } /*-------------------------------------------------------------------------- @@ -146,14 +146,14 @@ hypre_F90_IFACE(hypre_sstructmaxwellsetgrad, HYPRE_SSTRUCTMAXWELLSETGRAD) void hypre_F90_IFACE(hypre_sstructmaxwellsetrfactors, HYPRE_SSTRUCTMAXWELLSETRFACTORS) - (hypre_F90_Obj *solver, - HYPRE_Int (*rfactors)[3], - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + HYPRE_Int (*rfactors)[3], + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SStructMaxwellSetRfactors( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - rfactors[3] )); + ( HYPRE_SStructMaxwellSetRfactors( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + rfactors[3] )); } /*-------------------------------------------------------------------------- @@ -162,14 +162,14 @@ hypre_F90_IFACE(hypre_sstructmaxwellsetrfactors, HYPRE_SSTRUCTMAXWELLSETRFACTORS void hypre_F90_IFACE(hypre_sstructmaxwellsettol, HYPRE_SSTRUCTMAXWELLSETTOL) - (hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SStructMaxwellSetTol( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassReal (tol) )); + ( HYPRE_SStructMaxwellSetTol( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassReal (tol) )); } /*-------------------------------------------------------------------------- @@ -178,14 +178,14 @@ hypre_F90_IFACE(hypre_sstructmaxwellsettol, HYPRE_SSTRUCTMAXWELLSETTOL) void hypre_F90_IFACE(hypre_sstructmaxwellsetconstant, HYPRE_SSTRUCTMAXWELLSETCONSTANT) - (hypre_F90_Obj *solver, - hypre_F90_Int *constant_coef, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *constant_coef, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SStructMaxwellSetConstantCoef( - (HYPRE_SStructSolver ) *solver, - hypre_F90_PassInt (constant_coef)) ); + ( HYPRE_SStructMaxwellSetConstantCoef( + (HYPRE_SStructSolver ) * solver, + hypre_F90_PassInt (constant_coef)) ); } /*-------------------------------------------------------------------------- @@ -194,14 +194,14 @@ hypre_F90_IFACE(hypre_sstructmaxwellsetconstant, HYPRE_SSTRUCTMAXWELLSETCONSTANT void hypre_F90_IFACE(hypre_sstructmaxwellsetmaxiter, HYPRE_SSTRUCTMAXWELLSETMAXITER) - (hypre_F90_Obj *solver, - hypre_F90_Int *max_iter, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *max_iter, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SStructMaxwellSetMaxIter( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (max_iter) )); + ( HYPRE_SStructMaxwellSetMaxIter( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (max_iter) )); } /*-------------------------------------------------------------------------- @@ -210,14 +210,14 @@ hypre_F90_IFACE(hypre_sstructmaxwellsetmaxiter, HYPRE_SSTRUCTMAXWELLSETMAXITER) void hypre_F90_IFACE(hypre_sstructmaxwellsetrelchang, HYPRE_SSTRUCTMAXWELLSETRELCHANG) - (hypre_F90_Obj *solver, - hypre_F90_Int *rel_change, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *rel_change, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SStructMaxwellSetRelChange( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (rel_change) )); + ( HYPRE_SStructMaxwellSetRelChange( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (rel_change) )); } /*-------------------------------------------------------------------------- @@ -226,14 +226,14 @@ hypre_F90_IFACE(hypre_sstructmaxwellsetrelchang, HYPRE_SSTRUCTMAXWELLSETRELCHANG void hypre_F90_IFACE(hypre_sstructmaxwellsetnumprere, HYPRE_SSTRUCTMAXWELLSETNUMPRERE) - (hypre_F90_Obj *solver, - hypre_F90_Int *num_pre_relax, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *num_pre_relax, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SStructMaxwellSetNumPreRelax( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (num_pre_relax) )); + ( HYPRE_SStructMaxwellSetNumPreRelax( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (num_pre_relax) )); } /*-------------------------------------------------------------------------- @@ -242,14 +242,14 @@ hypre_F90_IFACE(hypre_sstructmaxwellsetnumprere, HYPRE_SSTRUCTMAXWELLSETNUMPRERE void hypre_F90_IFACE(hypre_sstructmaxwellsetnumpostr, HYPRE_SSTRUCTMAXWELLSETNUMPOSTR) - (hypre_F90_Obj *solver, - hypre_F90_Int *num_post_relax, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *num_post_relax, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SStructMaxwellSetNumPostRelax( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (num_post_relax) )); + ( HYPRE_SStructMaxwellSetNumPostRelax( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (num_post_relax) )); } @@ -259,14 +259,14 @@ hypre_F90_IFACE(hypre_sstructmaxwellsetnumpostr, HYPRE_SSTRUCTMAXWELLSETNUMPOSTR void hypre_F90_IFACE(hypre_sstructmaxwellsetlogging, HYPRE_SSTRUCTMAXWELLSETLOGGING) - (hypre_F90_Obj *solver, - hypre_F90_Int *logging, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *logging, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SStructMaxwellSetLogging( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (logging))); + ( HYPRE_SStructMaxwellSetLogging( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (logging))); } /*-------------------------------------------------------------------------- @@ -275,14 +275,14 @@ hypre_F90_IFACE(hypre_sstructmaxwellsetlogging, HYPRE_SSTRUCTMAXWELLSETLOGGING) void hypre_F90_IFACE(hypre_sstructmaxwellsetprintlev, HYPRE_SSTRUCTMAXWELLSETPRINTLEV) - (hypre_F90_Obj *solver, - hypre_F90_Int *print_level, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *print_level, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SStructMaxwellSetPrintLevel( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (print_level) )); + ( HYPRE_SStructMaxwellSetPrintLevel( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (print_level) )); } /*-------------------------------------------------------------------------- @@ -291,14 +291,14 @@ hypre_F90_IFACE(hypre_sstructmaxwellsetprintlev, HYPRE_SSTRUCTMAXWELLSETPRINTLEV void hypre_F90_IFACE(hypre_sstructmaxwellprintloggin, HYPRE_SSTRUCTMAXWELLPRINTLOGGIN) - (hypre_F90_Obj *solver, - hypre_F90_Int *myid, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *myid, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SStructMaxwellPrintLogging( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (myid))); + ( HYPRE_SStructMaxwellPrintLogging( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (myid))); } /*-------------------------------------------------------------------------- @@ -306,15 +306,15 @@ hypre_F90_IFACE(hypre_sstructmaxwellprintloggin, HYPRE_SSTRUCTMAXWELLPRINTLOGGIN *--------------------------------------------------------------------------*/ void -hypre_F90_IFACE(hypre_sstructmaxwellgetnumitera, HYPRE_SSTRUCTMAXWELLGETNUMITERA) - (hypre_F90_Obj *solver, - hypre_F90_Int *num_iterations, - hypre_F90_Int *ierr) +hypre_F90_IFACE(hypre_sstructmaxwellgetnumitera, HYPRE_SSTRUCTMAXWELLGETNUMITERA) +(hypre_F90_Obj *solver, + hypre_F90_Int *num_iterations, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SStructMaxwellGetNumIterations( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassIntRef (num_iterations) )); + ( HYPRE_SStructMaxwellGetNumIterations( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassIntRef (num_iterations) )); } /*-------------------------------------------------------------------------- @@ -322,15 +322,15 @@ hypre_F90_IFACE(hypre_sstructmaxwellgetnumitera, HYPRE_SSTRUCTMAXWELLGETNUMITERA *--------------------------------------------------------------------------*/ void -hypre_F90_IFACE(hypre_sstructmaxwellgetfinalrel, HYPRE_SSTRUCTMAXWELLGETFINALREL) - (hypre_F90_Obj *solver, - hypre_F90_Real *norm, - hypre_F90_Int *ierr) +hypre_F90_IFACE(hypre_sstructmaxwellgetfinalrel, HYPRE_SSTRUCTMAXWELLGETFINALREL) +(hypre_F90_Obj *solver, + hypre_F90_Real *norm, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SStructMaxwellGetFinalRelativeResidualNorm( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassRealRef (norm) )); + ( HYPRE_SStructMaxwellGetFinalRelativeResidualNorm( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassRealRef (norm) )); } /*-------------------------------------------------------------------------- @@ -338,21 +338,21 @@ hypre_F90_IFACE(hypre_sstructmaxwellgetfinalrel, HYPRE_SSTRUCTMAXWELLGETFINALREL *--------------------------------------------------------------------------*/ void -hypre_F90_IFACE(hypre_sstructmaxwellphysbdy, HYPRE_SSTRUCTMAXWELLPHYSBDY) - (hypre_F90_Obj *grid_l, - hypre_F90_Int *num_levels, - HYPRE_Int (*rfactors)[3], - HYPRE_Int (***BdryRanks_ptr), - HYPRE_Int (**BdryRanksCnt_ptr), - hypre_F90_Int *ierr) +hypre_F90_IFACE(hypre_sstructmaxwellphysbdy, HYPRE_SSTRUCTMAXWELLPHYSBDY) +(hypre_F90_Obj *grid_l, + hypre_F90_Int *num_levels, + HYPRE_Int (*rfactors)[3], + HYPRE_Int (***BdryRanks_ptr), + HYPRE_Int (**BdryRanksCnt_ptr), + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SStructMaxwellPhysBdy( - hypre_F90_PassObjRef (HYPRE_SStructGrid, grid_l), - hypre_F90_PassInt (num_levels), - rfactors[3], - BdryRanks_ptr, - BdryRanksCnt_ptr )); + ( HYPRE_SStructMaxwellPhysBdy( + hypre_F90_PassObjRef (HYPRE_SStructGrid, grid_l), + hypre_F90_PassInt (num_levels), + rfactors[3], + BdryRanks_ptr, + BdryRanksCnt_ptr )); } /*-------------------------------------------------------------------------- @@ -360,18 +360,18 @@ hypre_F90_IFACE(hypre_sstructmaxwellphysbdy, HYPRE_SSTRUCTMAXWELLPHYSBDY) *--------------------------------------------------------------------------*/ void -hypre_F90_IFACE(hypre_sstructmaxwelleliminatero, HYPRE_SSTRUCTMAXWELLELIMINATERO) - (hypre_F90_Obj *A, - hypre_F90_Int *nrows, - hypre_F90_IntArray *rows, - hypre_F90_Int *ierr) +hypre_F90_IFACE(hypre_sstructmaxwelleliminatero, HYPRE_SSTRUCTMAXWELLELIMINATERO) +(hypre_F90_Obj *A, + hypre_F90_Int *nrows, + hypre_F90_IntArray *rows, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SStructMaxwellEliminateRowsCols( - hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), - hypre_F90_PassInt (nrows), - hypre_F90_PassIntArray (rows) )); -} + ( HYPRE_SStructMaxwellEliminateRowsCols( + hypre_F90_PassObj (HYPRE_ParCSRMatrix, A), + hypre_F90_PassInt (nrows), + hypre_F90_PassIntArray (rows) )); +} /*-------------------------------------------------------------------------- @@ -379,18 +379,18 @@ hypre_F90_IFACE(hypre_sstructmaxwelleliminatero, HYPRE_SSTRUCTMAXWELLELIMINATERO *--------------------------------------------------------------------------*/ void -hypre_F90_IFACE(hypre_sstructmaxwellzerovector, HYPRE_SSTRUCTMAXWELLZEROVECTOR) - (hypre_F90_Obj *b, - hypre_F90_IntArray *rows, - hypre_F90_Int *nrows, - hypre_F90_Int *ierr) +hypre_F90_IFACE(hypre_sstructmaxwellzerovector, HYPRE_SSTRUCTMAXWELLZEROVECTOR) +(hypre_F90_Obj *b, + hypre_F90_IntArray *rows, + hypre_F90_Int *nrows, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_SStructMaxwellZeroVector( - hypre_F90_PassObj (HYPRE_ParVector, b), - hypre_F90_PassIntArray (rows), - hypre_F90_PassInt (nrows) )); -} + ( HYPRE_SStructMaxwellZeroVector( + hypre_F90_PassObj (HYPRE_ParVector, b), + hypre_F90_PassIntArray (rows), + hypre_F90_PassInt (nrows) )); +} #ifdef __cplusplus } diff --git a/external/hypre/src/sstruct_ls/F90_HYPRE_sstruct_pcg.c b/external/hypre/src/sstruct_ls/F90_HYPRE_sstruct_pcg.c index b822096b..4fbc2105 100644 --- a/external/hypre/src/sstruct_ls/F90_HYPRE_sstruct_pcg.c +++ b/external/hypre/src/sstruct_ls/F90_HYPRE_sstruct_pcg.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -24,14 +24,14 @@ extern "C" { void hypre_F90_IFACE(hypre_sstructpcgcreate, HYPRE_SSTRUCTPCGCREATE) - (hypre_F90_Comm *comm, - hypre_F90_Obj *solver, - hypre_F90_Int *ierr) +(hypre_F90_Comm *comm, + hypre_F90_Obj *solver, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructPCGCreate( - hypre_F90_PassComm (comm), - hypre_F90_PassObjRef (HYPRE_SStructSolver, solver) ) ); + (HYPRE_SStructPCGCreate( + hypre_F90_PassComm (comm), + hypre_F90_PassObjRef (HYPRE_SStructSolver, solver) ) ); } /*-------------------------------------------------------------------------- @@ -40,12 +40,12 @@ hypre_F90_IFACE(hypre_sstructpcgcreate, HYPRE_SSTRUCTPCGCREATE) void hypre_F90_IFACE(hypre_sstructpcgdestroy, HYPRE_SSTRUCTPCGDESTROY) - (hypre_F90_Obj *solver, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructPCGDestroy( - hypre_F90_PassObj (HYPRE_SStructSolver, solver) )); + (HYPRE_SStructPCGDestroy( + hypre_F90_PassObj (HYPRE_SStructSolver, solver) )); } /*-------------------------------------------------------------------------- @@ -54,18 +54,18 @@ hypre_F90_IFACE(hypre_sstructpcgdestroy, HYPRE_SSTRUCTPCGDESTROY) void hypre_F90_IFACE(hypre_sstructpcgsetup, HYPRE_SSTRUCTPCGSETUP) - (hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructPCGSetup( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassObj (HYPRE_SStructMatrix, A), - hypre_F90_PassObj (HYPRE_SStructVector, b), - hypre_F90_PassObj (HYPRE_SStructVector, x) ) ); + (HYPRE_SStructPCGSetup( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassObj (HYPRE_SStructMatrix, A), + hypre_F90_PassObj (HYPRE_SStructVector, b), + hypre_F90_PassObj (HYPRE_SStructVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -74,18 +74,18 @@ hypre_F90_IFACE(hypre_sstructpcgsetup, HYPRE_SSTRUCTPCGSETUP) void hypre_F90_IFACE(hypre_sstructpcgsolve, HYPRE_SSTRUCTPCGSOLVE) - (hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructPCGSolve( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassObj (HYPRE_SStructMatrix, A), - hypre_F90_PassObj (HYPRE_SStructVector, b), - hypre_F90_PassObj (HYPRE_SStructVector, x) ) ); + (HYPRE_SStructPCGSolve( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassObj (HYPRE_SStructMatrix, A), + hypre_F90_PassObj (HYPRE_SStructVector, b), + hypre_F90_PassObj (HYPRE_SStructVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -94,14 +94,14 @@ hypre_F90_IFACE(hypre_sstructpcgsolve, HYPRE_SSTRUCTPCGSOLVE) void hypre_F90_IFACE(hypre_sstructpcgsettol, HYPRE_SSTRUCTPCGSETTOL) - (hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructPCGSetTol( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassReal (tol) ) ); + (HYPRE_SStructPCGSetTol( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassReal (tol) ) ); } /*-------------------------------------------------------------------------- * HYPRE_SStructPCGSetAbsoluteTol @@ -109,14 +109,14 @@ hypre_F90_IFACE(hypre_sstructpcgsettol, HYPRE_SSTRUCTPCGSETTOL) void hypre_F90_IFACE(hypre_sstructpcgsetabsolutetol, HYPRE_SSTRUCTPCGSETABSOLUTETOL) - (hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructPCGSetAbsoluteTol( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassReal (tol) ) ); + (HYPRE_SStructPCGSetAbsoluteTol( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassReal (tol) ) ); } /*-------------------------------------------------------------------------- * HYPRE_SStructPCGSetMaxIter @@ -124,14 +124,14 @@ hypre_F90_IFACE(hypre_sstructpcgsetabsolutetol, HYPRE_SSTRUCTPCGSETABSOLUTETOL) void hypre_F90_IFACE(hypre_sstructpcgsetmaxiter, HYPRE_SSTRUCTPCGSETMAXITER) - (hypre_F90_Obj *solver, - hypre_F90_Int *max_iter, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *max_iter, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructPCGSetMaxIter( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (max_iter) ) ); + (HYPRE_SStructPCGSetMaxIter( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (max_iter) ) ); } /*-------------------------------------------------------------------------- @@ -140,14 +140,14 @@ hypre_F90_IFACE(hypre_sstructpcgsetmaxiter, HYPRE_SSTRUCTPCGSETMAXITER) void hypre_F90_IFACE(hypre_sstructpcgsettwonorm, HYPRE_SSTRUCTPCGSETTWONORM) - (hypre_F90_Obj *solver, - hypre_F90_Int *two_norm, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *two_norm, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructPCGSetTwoNorm( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (two_norm) ) ); + (HYPRE_SStructPCGSetTwoNorm( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (two_norm) ) ); } /*-------------------------------------------------------------------------- @@ -156,14 +156,14 @@ hypre_F90_IFACE(hypre_sstructpcgsettwonorm, HYPRE_SSTRUCTPCGSETTWONORM) void hypre_F90_IFACE(hypre_sstructpcgsetrelchange, HYPRE_SSTRUCTPCGSETRELCHANGE) - (hypre_F90_Obj *solver, - hypre_F90_Int *rel_change, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *rel_change, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructPCGSetRelChange( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (rel_change) ) ); + (HYPRE_SStructPCGSetRelChange( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (rel_change) ) ); } /*-------------------------------------------------------------------------- @@ -172,10 +172,10 @@ hypre_F90_IFACE(hypre_sstructpcgsetrelchange, HYPRE_SSTRUCTPCGSETRELCHANGE) void hypre_F90_IFACE(hypre_sstructpcgsetprecond, HYPRE_SSTRUCTPCGSETPRECOND) - (hypre_F90_Obj *solver, - hypre_F90_Int *precond_id, - hypre_F90_Obj *precond_solver, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *precond_id, + hypre_F90_Obj *precond_solver, + hypre_F90_Int *ierr) /*------------------------------------------ * precond_id flags mean: * 2 - setup a split-solver preconditioner @@ -185,36 +185,36 @@ hypre_F90_IFACE(hypre_sstructpcgsetprecond, HYPRE_SSTRUCTPCGSETPRECOND) *----------------------------------------*/ { - if(*precond_id == 2) + if (*precond_id == 2) { *ierr = (hypre_F90_Int) - (HYPRE_SStructPCGSetPrecond( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - HYPRE_SStructSplitSolve, - HYPRE_SStructSplitSetup, - hypre_F90_PassObjRef (HYPRE_SStructSolver, precond_solver))); + (HYPRE_SStructPCGSetPrecond( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + HYPRE_SStructSplitSolve, + HYPRE_SStructSplitSetup, + hypre_F90_PassObjRef (HYPRE_SStructSolver, precond_solver))); } - else if(*precond_id == 3) + else if (*precond_id == 3) { *ierr = (hypre_F90_Int) - (HYPRE_SStructPCGSetPrecond( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - HYPRE_SStructSysPFMGSolve, - HYPRE_SStructSysPFMGSetup, - hypre_F90_PassObjRef (HYPRE_SStructSolver, precond_solver))); + (HYPRE_SStructPCGSetPrecond( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + HYPRE_SStructSysPFMGSolve, + HYPRE_SStructSysPFMGSetup, + hypre_F90_PassObjRef (HYPRE_SStructSolver, precond_solver))); } - else if(*precond_id == 8) + else if (*precond_id == 8) { *ierr = (hypre_F90_Int) - (HYPRE_SStructPCGSetPrecond( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - HYPRE_SStructDiagScale, - HYPRE_SStructDiagScaleSetup, - hypre_F90_PassObjRef (HYPRE_SStructSolver, precond_solver))); + (HYPRE_SStructPCGSetPrecond( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + HYPRE_SStructDiagScale, + HYPRE_SStructDiagScaleSetup, + hypre_F90_PassObjRef (HYPRE_SStructSolver, precond_solver))); } - else if(*precond_id == 9) + else if (*precond_id == 9) { *ierr = 0; } @@ -232,14 +232,14 @@ hypre_F90_IFACE(hypre_sstructpcgsetprecond, HYPRE_SSTRUCTPCGSETPRECOND) void hypre_F90_IFACE(hypre_sstructpcgsetlogging, HYPRE_SSTRUCTPCGSETLOGGING) - (hypre_F90_Obj *solver, - hypre_F90_Int *logging, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *logging, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructPCGSetLogging( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (logging) ) ); + (HYPRE_SStructPCGSetLogging( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (logging) ) ); } /*-------------------------------------------------------------------------- @@ -248,14 +248,14 @@ hypre_F90_IFACE(hypre_sstructpcgsetlogging, HYPRE_SSTRUCTPCGSETLOGGING) void hypre_F90_IFACE(hypre_sstructpcgsetprintlevel, HYPRE_SSTRUCTPCGSETPRINTLEVEL) - (hypre_F90_Obj *solver, - hypre_F90_Int *level, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *level, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructPCGSetPrintLevel( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (level) ) ); + (HYPRE_SStructPCGSetPrintLevel( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (level) ) ); } /*-------------------------------------------------------------------------- @@ -264,14 +264,14 @@ hypre_F90_IFACE(hypre_sstructpcgsetprintlevel, HYPRE_SSTRUCTPCGSETPRINTLEVEL) void hypre_F90_IFACE(hypre_sstructpcggetnumiteration, HYPRE_SSTRUCTPCGGETNUMITERATION) - (hypre_F90_Obj *solver, - hypre_F90_Int *num_iterations, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *num_iterations, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructPCGGetNumIterations( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassIntRef (num_iterations) ) ); + (HYPRE_SStructPCGGetNumIterations( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassIntRef (num_iterations) ) ); } /*-------------------------------------------------------------------------- @@ -280,14 +280,14 @@ hypre_F90_IFACE(hypre_sstructpcggetnumiteration, HYPRE_SSTRUCTPCGGETNUMITERATION void hypre_F90_IFACE(hypre_sstructpcggetfinalrelativ, HYPRE_SSTRUCTPCGGETFINALRELATIV) - (hypre_F90_Obj *solver, - hypre_F90_Real *norm, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Real *norm, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructPCGGetFinalRelativeResidualNorm( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassRealRef (norm) ) ); + (HYPRE_SStructPCGGetFinalRelativeResidualNorm( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassRealRef (norm) ) ); } /*-------------------------------------------------------------------------- @@ -296,14 +296,14 @@ hypre_F90_IFACE(hypre_sstructpcggetfinalrelativ, HYPRE_SSTRUCTPCGGETFINALRELATIV void hypre_F90_IFACE(hypre_sstructpcggetresidual, HYPRE_SSTRUCTPCGGETRESIDUAL) - (hypre_F90_Obj *solver, - hypre_F90_Obj *residual, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Obj *residual, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructPCGGetResidual( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - (void **) *residual ) ); + (HYPRE_SStructPCGGetResidual( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + (void **) *residual ) ); } /*-------------------------------------------------------------------------- @@ -312,18 +312,18 @@ hypre_F90_IFACE(hypre_sstructpcggetresidual, HYPRE_SSTRUCTPCGGETRESIDUAL) void hypre_F90_IFACE(hypre_sstructdiagscalesetup, HYPRE_SSTRUCTDIAGSCALESETUP) - (hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *y, - hypre_F90_Obj *x, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *y, + hypre_F90_Obj *x, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructDiagScaleSetup( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassObj (HYPRE_SStructMatrix, A), - hypre_F90_PassObj (HYPRE_SStructVector, y), - hypre_F90_PassObj (HYPRE_SStructVector, x) ) ); + (HYPRE_SStructDiagScaleSetup( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassObj (HYPRE_SStructMatrix, A), + hypre_F90_PassObj (HYPRE_SStructVector, y), + hypre_F90_PassObj (HYPRE_SStructVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -332,18 +332,18 @@ hypre_F90_IFACE(hypre_sstructdiagscalesetup, HYPRE_SSTRUCTDIAGSCALESETUP) void hypre_F90_IFACE(hypre_sstructdiagscale, HYPRE_SSTRUCTDIAGSCALE) - (hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *y, - hypre_F90_Obj *x, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *y, + hypre_F90_Obj *x, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructDiagScale( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassObj (HYPRE_SStructMatrix, A), - hypre_F90_PassObj (HYPRE_SStructVector, y), - hypre_F90_PassObj (HYPRE_SStructVector, x) ) ); + (HYPRE_SStructDiagScale( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassObj (HYPRE_SStructMatrix, A), + hypre_F90_PassObj (HYPRE_SStructVector, y), + hypre_F90_PassObj (HYPRE_SStructVector, x) ) ); } #ifdef __cplusplus diff --git a/external/hypre/src/sstruct_ls/F90_HYPRE_sstruct_split.c b/external/hypre/src/sstruct_ls/F90_HYPRE_sstruct_split.c index 440c700f..8523964e 100644 --- a/external/hypre/src/sstruct_ls/F90_HYPRE_sstruct_split.c +++ b/external/hypre/src/sstruct_ls/F90_HYPRE_sstruct_split.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -16,21 +16,21 @@ #ifdef __cplusplus extern "C" { #endif - + /*-------------------------------------------------------------------------- * HYPRE_SStructSplitCreate *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_sstructsplitcreate, HYPRE_SSTRUCTSPLITCREATE) - (hypre_F90_Comm *comm, - hypre_F90_Obj *solver_ptr, - hypre_F90_Int *ierr) +(hypre_F90_Comm *comm, + hypre_F90_Obj *solver_ptr, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructSplitCreate( - hypre_F90_PassComm (comm), - hypre_F90_PassObjRef (HYPRE_SStructSolver, solver_ptr) ) ); + (HYPRE_SStructSplitCreate( + hypre_F90_PassComm (comm), + hypre_F90_PassObjRef (HYPRE_SStructSolver, solver_ptr) ) ); } /*-------------------------------------------------------------------------- @@ -39,12 +39,12 @@ hypre_F90_IFACE(hypre_sstructsplitcreate, HYPRE_SSTRUCTSPLITCREATE) void hypre_F90_IFACE(hypre_sstructsplitdestroy, HYPRE_SSTRUCTSPLITDESTROY) - (hypre_F90_Obj *solver, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructSplitDestroy( - hypre_F90_PassObj (HYPRE_SStructSolver, solver) ) ); + (HYPRE_SStructSplitDestroy( + hypre_F90_PassObj (HYPRE_SStructSolver, solver) ) ); } /*-------------------------------------------------------------------------- @@ -53,18 +53,18 @@ hypre_F90_IFACE(hypre_sstructsplitdestroy, HYPRE_SSTRUCTSPLITDESTROY) void hypre_F90_IFACE(hypre_sstructsplitsetup, HYPRE_SSTRUCTSPLITSETUP) - (hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructSplitSetup( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassObj (HYPRE_SStructMatrix, A), - hypre_F90_PassObj (HYPRE_SStructVector, b), - hypre_F90_PassObj (HYPRE_SStructVector, x) ) ); + (HYPRE_SStructSplitSetup( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassObj (HYPRE_SStructMatrix, A), + hypre_F90_PassObj (HYPRE_SStructVector, b), + hypre_F90_PassObj (HYPRE_SStructVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -73,18 +73,18 @@ hypre_F90_IFACE(hypre_sstructsplitsetup, HYPRE_SSTRUCTSPLITSETUP) void hypre_F90_IFACE(hypre_sstructsplitsolve, HYPRE_SSTRUCTSPLITSOLVE) - (hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructSplitSolve( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassObj (HYPRE_SStructMatrix, A), - hypre_F90_PassObj (HYPRE_SStructVector, b), - hypre_F90_PassObj (HYPRE_SStructVector, x) ) ); + (HYPRE_SStructSplitSolve( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassObj (HYPRE_SStructMatrix, A), + hypre_F90_PassObj (HYPRE_SStructVector, b), + hypre_F90_PassObj (HYPRE_SStructVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -93,14 +93,14 @@ hypre_F90_IFACE(hypre_sstructsplitsolve, HYPRE_SSTRUCTSPLITSOLVE) void hypre_F90_IFACE(hypre_sstructsplitsettol, HYPRE_SSTRUCTSPLITSETTOL) - (hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructSplitSetTol( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassReal (tol) ) ); + (HYPRE_SStructSplitSetTol( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassReal (tol) ) ); } /*-------------------------------------------------------------------------- @@ -109,14 +109,14 @@ hypre_F90_IFACE(hypre_sstructsplitsettol, HYPRE_SSTRUCTSPLITSETTOL) void hypre_F90_IFACE(hypre_sstructsplitsetmaxiter, HYPRE_SSTRUCTSPLITSETMAXITER) - (hypre_F90_Obj *solver, - hypre_F90_Int *max_iter, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *max_iter, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructSplitSetMaxIter( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (max_iter) ) ); + (HYPRE_SStructSplitSetMaxIter( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (max_iter) ) ); } /*-------------------------------------------------------------------------- @@ -125,12 +125,12 @@ hypre_F90_IFACE(hypre_sstructsplitsetmaxiter, HYPRE_SSTRUCTSPLITSETMAXITER) void hypre_F90_IFACE(hypre_sstructsplitsetzeroguess, HYPRE_SSTRUCTSPLITSETZEROGUESS) - (hypre_F90_Obj *solver, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructSplitSetZeroGuess( - hypre_F90_PassObj (HYPRE_SStructSolver, solver) ) ); + (HYPRE_SStructSplitSetZeroGuess( + hypre_F90_PassObj (HYPRE_SStructSolver, solver) ) ); } /*-------------------------------------------------------------------------- @@ -139,12 +139,12 @@ hypre_F90_IFACE(hypre_sstructsplitsetzeroguess, HYPRE_SSTRUCTSPLITSETZEROGUESS) void hypre_F90_IFACE(hypre_sstructsplitsetnonzerogue, HYPRE_SSTRUCTSPLITSETNONZEROGUE) - (hypre_F90_Obj *solver, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructSplitSetNonZeroGuess( - hypre_F90_PassObj (HYPRE_SStructSolver, solver) )); + (HYPRE_SStructSplitSetNonZeroGuess( + hypre_F90_PassObj (HYPRE_SStructSolver, solver) )); } /*-------------------------------------------------------------------------- @@ -153,14 +153,14 @@ hypre_F90_IFACE(hypre_sstructsplitsetnonzerogue, HYPRE_SSTRUCTSPLITSETNONZEROGUE void hypre_F90_IFACE(hypre_sstructsplitsetstructsolv, HYPRE_SSTRUCTSPLITSETSTRUCTSOLV) - (hypre_F90_Obj *solver, - hypre_F90_Int *ssolver, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *ssolver, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructSplitSetStructSolver( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (ssolver) ) ); + (HYPRE_SStructSplitSetStructSolver( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (ssolver) ) ); } /*-------------------------------------------------------------------------- @@ -169,14 +169,14 @@ hypre_F90_IFACE(hypre_sstructsplitsetstructsolv, HYPRE_SSTRUCTSPLITSETSTRUCTSOLV void hypre_F90_IFACE(hypre_sstructsplitgetnumiterati, HYPRE_SSTRUCTSPLITGETNUMITERATI) - (hypre_F90_Obj *solver, - hypre_F90_Int *num_iterations, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *num_iterations, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructSplitGetNumIterations( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassIntRef (num_iterations) ) ); + (HYPRE_SStructSplitGetNumIterations( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassIntRef (num_iterations) ) ); } /*-------------------------------------------------------------------------- @@ -185,14 +185,14 @@ hypre_F90_IFACE(hypre_sstructsplitgetnumiterati, HYPRE_SSTRUCTSPLITGETNUMITERATI void hypre_F90_IFACE(hypre_sstructsplitgetfinalrelat, HYPRE_SSTRUCTSPLITGETFINALRELAT) - (hypre_F90_Obj *solver, - hypre_F90_Real *norm, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Real *norm, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructSplitGetFinalRelativeResidualNorm( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassRealRef (norm) ) ); + (HYPRE_SStructSplitGetFinalRelativeResidualNorm( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassRealRef (norm) ) ); } #ifdef __cplusplus diff --git a/external/hypre/src/sstruct_ls/F90_HYPRE_sstruct_sys_pfmg.c b/external/hypre/src/sstruct_ls/F90_HYPRE_sstruct_sys_pfmg.c index 4dd42757..af16fc85 100644 --- a/external/hypre/src/sstruct_ls/F90_HYPRE_sstruct_sys_pfmg.c +++ b/external/hypre/src/sstruct_ls/F90_HYPRE_sstruct_sys_pfmg.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -24,14 +24,14 @@ extern "C" { void hypre_F90_IFACE(hypre_sstructsyspfmgcreate, HYPRE_SSTRUCTSYSPFMGCREATE) - (hypre_F90_Comm *comm, - hypre_F90_Obj *solver, - hypre_F90_Int *ierr) +(hypre_F90_Comm *comm, + hypre_F90_Obj *solver, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructSysPFMGCreate( - hypre_F90_PassComm (comm), - hypre_F90_PassObjRef (HYPRE_SStructSolver, solver) )); + (HYPRE_SStructSysPFMGCreate( + hypre_F90_PassComm (comm), + hypre_F90_PassObjRef (HYPRE_SStructSolver, solver) )); } /*-------------------------------------------------------------------------- @@ -40,12 +40,12 @@ hypre_F90_IFACE(hypre_sstructsyspfmgcreate, HYPRE_SSTRUCTSYSPFMGCREATE) void hypre_F90_IFACE(hypre_sstructsyspfmgdestroy, HYPRE_SSTRUCTSYSPFMGDESTROY) - (hypre_F90_Obj *solver, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructSysPFMGDestroy( - hypre_F90_PassObj (HYPRE_SStructSolver, solver) )); + (HYPRE_SStructSysPFMGDestroy( + hypre_F90_PassObj (HYPRE_SStructSolver, solver) )); } /*-------------------------------------------------------------------------- @@ -54,18 +54,18 @@ hypre_F90_IFACE(hypre_sstructsyspfmgdestroy, HYPRE_SSTRUCTSYSPFMGDESTROY) void hypre_F90_IFACE(hypre_sstructsyspfmgsetup, HYPRE_SSTRUCTSYSPFMGSETUP) - (hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructSysPFMGSetup( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassObj (HYPRE_SStructMatrix, A), - hypre_F90_PassObj (HYPRE_SStructVector, b), - hypre_F90_PassObj (HYPRE_SStructVector, x) ) ); + (HYPRE_SStructSysPFMGSetup( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassObj (HYPRE_SStructMatrix, A), + hypre_F90_PassObj (HYPRE_SStructVector, b), + hypre_F90_PassObj (HYPRE_SStructVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -74,18 +74,18 @@ hypre_F90_IFACE(hypre_sstructsyspfmgsetup, HYPRE_SSTRUCTSYSPFMGSETUP) void hypre_F90_IFACE(hypre_sstructsyspfmgsolve, HYPRE_SSTRUCTSYSPFMGSOLVE) - (hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructSysPFMGSolve( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassObj (HYPRE_SStructMatrix, A), - hypre_F90_PassObj (HYPRE_SStructVector, b), - hypre_F90_PassObj (HYPRE_SStructVector, x) ) ); + (HYPRE_SStructSysPFMGSolve( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassObj (HYPRE_SStructMatrix, A), + hypre_F90_PassObj (HYPRE_SStructVector, b), + hypre_F90_PassObj (HYPRE_SStructVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -94,14 +94,14 @@ hypre_F90_IFACE(hypre_sstructsyspfmgsolve, HYPRE_SSTRUCTSYSPFMGSOLVE) void hypre_F90_IFACE(hypre_sstructsyspfmgsettol, HYPRE_SSTRUCTSYSPFMGSETTOL) - (hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructSysPFMGSetTol( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassReal (tol) ) ); + (HYPRE_SStructSysPFMGSetTol( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassReal (tol) ) ); } /*-------------------------------------------------------------------------- @@ -110,14 +110,14 @@ hypre_F90_IFACE(hypre_sstructsyspfmgsettol, HYPRE_SSTRUCTSYSPFMGSETTOL) void hypre_F90_IFACE(hypre_sstructsyspfmgsetmaxiter, HYPRE_SSTRUCTSYSPFMGSETMAXITER) - (hypre_F90_Obj *solver, - hypre_F90_Int *max_iter, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *max_iter, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructSysPFMGSetMaxIter( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (max_iter) ) ); + (HYPRE_SStructSysPFMGSetMaxIter( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (max_iter) ) ); } /*-------------------------------------------------------------------------- @@ -126,14 +126,14 @@ hypre_F90_IFACE(hypre_sstructsyspfmgsetmaxiter, HYPRE_SSTRUCTSYSPFMGSETMAXITER) void hypre_F90_IFACE(hypre_sstructsyspfmgsetrelchang, HYPRE_SSTRUCTSYSPFMGSETRELCHANG) - (hypre_F90_Obj *solver, - hypre_F90_Int *rel_change, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *rel_change, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructSysPFMGSetRelChange( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (rel_change) )); + (HYPRE_SStructSysPFMGSetRelChange( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (rel_change) )); } /*-------------------------------------------------------------------------- @@ -142,12 +142,12 @@ hypre_F90_IFACE(hypre_sstructsyspfmgsetrelchang, HYPRE_SSTRUCTSYSPFMGSETRELCHANG void hypre_F90_IFACE(hypre_sstructsyspfmgsetzerogues, HYPRE_SSTRUCTSYSPFMGSETZEROGUES) - (hypre_F90_Obj *solver, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructSysPFMGSetZeroGuess( - hypre_F90_PassObj (HYPRE_SStructSolver, solver) )); + (HYPRE_SStructSysPFMGSetZeroGuess( + hypre_F90_PassObj (HYPRE_SStructSolver, solver) )); } /*-------------------------------------------------------------------------- @@ -156,12 +156,12 @@ hypre_F90_IFACE(hypre_sstructsyspfmgsetzerogues, HYPRE_SSTRUCTSYSPFMGSETZEROGUES void hypre_F90_IFACE(hypre_sstructsyspfmgsetnonzerog, HYPRE_SSTRUCTSYSPFMGSETNONZEROG) - (hypre_F90_Obj *solver, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructSysPFMGSetNonZeroGuess( - hypre_F90_PassObj (HYPRE_SStructSolver, solver) )); + (HYPRE_SStructSysPFMGSetNonZeroGuess( + hypre_F90_PassObj (HYPRE_SStructSolver, solver) )); } /*-------------------------------------------------------------------------- @@ -170,30 +170,30 @@ hypre_F90_IFACE(hypre_sstructsyspfmgsetnonzerog, HYPRE_SSTRUCTSYSPFMGSETNONZEROG void hypre_F90_IFACE(hypre_sstructsyspfmgsetrelaxtyp, HYPRE_SSTRUCTSYSPFMGSETRELAXTYP) - (hypre_F90_Obj *solver, - hypre_F90_Int *relax_type, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *relax_type, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructSysPFMGSetRelaxType( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (relax_type) )); + (HYPRE_SStructSysPFMGSetRelaxType( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (relax_type) )); } /*-------------------------------------------------------------------------- * HYPRE_SStructSysPFMGSetJacobiWeight *--------------------------------------------------------------------------*/ - + void hypre_F90_IFACE(hypre_sstructsyspfmgsetjacobiweigh, HYPRE_SSTRUCTSYSPFMGSETJACOBIWEIGH) - (hypre_F90_Obj *solver, - hypre_F90_Real *weight, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Real *weight, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructSysPFMGSetJacobiWeight( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassReal (weight) ) ); + (HYPRE_SStructSysPFMGSetJacobiWeight( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassReal (weight) ) ); } /*-------------------------------------------------------------------------- @@ -202,14 +202,14 @@ hypre_F90_IFACE(hypre_sstructsyspfmgsetjacobiweigh, HYPRE_SSTRUCTSYSPFMGSETJACOB void hypre_F90_IFACE(hypre_sstructsyspfmgsetnumprere, HYPRE_SSTRUCTSYSPFMGSETNUMPRERE) - (hypre_F90_Obj *solver, - hypre_F90_Int *num_pre_relax, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *num_pre_relax, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructSysPFMGSetNumPreRelax( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (num_pre_relax) )); + (HYPRE_SStructSysPFMGSetNumPreRelax( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (num_pre_relax) )); } /*-------------------------------------------------------------------------- @@ -218,14 +218,14 @@ hypre_F90_IFACE(hypre_sstructsyspfmgsetnumprere, HYPRE_SSTRUCTSYSPFMGSETNUMPRERE void hypre_F90_IFACE(hypre_sstructsyspfmgsetnumpostr, HYPRE_SSTRUCTSYSPFMGSETNUMPOSTR) - (hypre_F90_Obj *solver, - hypre_F90_Int *num_post_relax, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *num_post_relax, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructSysPFMGSetNumPostRelax( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (num_post_relax) )); + (HYPRE_SStructSysPFMGSetNumPostRelax( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (num_post_relax) )); } /*-------------------------------------------------------------------------- @@ -234,14 +234,14 @@ hypre_F90_IFACE(hypre_sstructsyspfmgsetnumpostr, HYPRE_SSTRUCTSYSPFMGSETNUMPOSTR void hypre_F90_IFACE(hypre_sstructsyspfmgsetskiprela, HYPRE_SSTRUCTSYSPFMGSETSKIPRELA) - (hypre_F90_Obj *solver, - hypre_F90_Int *skip_relax, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *skip_relax, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructSysPFMGSetSkipRelax( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (skip_relax) )); + (HYPRE_SStructSysPFMGSetSkipRelax( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (skip_relax) )); } /*-------------------------------------------------------------------------- @@ -250,14 +250,14 @@ hypre_F90_IFACE(hypre_sstructsyspfmgsetskiprela, HYPRE_SSTRUCTSYSPFMGSETSKIPRELA void hypre_F90_IFACE(hypre_sstructsyspfmgsetdxyz, HYPRE_SSTRUCTSYSPFMGSETDXYZ) - (hypre_F90_Obj *solver, - hypre_F90_RealArray *dxyz, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_RealArray *dxyz, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructSysPFMGSetDxyz( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassRealArray (dxyz) )); + (HYPRE_SStructSysPFMGSetDxyz( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassRealArray (dxyz) )); } /*-------------------------------------------------------------------------- @@ -266,14 +266,14 @@ hypre_F90_IFACE(hypre_sstructsyspfmgsetdxyz, HYPRE_SSTRUCTSYSPFMGSETDXYZ) void hypre_F90_IFACE(hypre_sstructsyspfmgsetlogging, HYPRE_SSTRUCTSYSPFMGSETLOGGING) - (hypre_F90_Obj *solver, - hypre_F90_Int *logging, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *logging, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructSysPFMGSetLogging( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (logging) )); + (HYPRE_SStructSysPFMGSetLogging( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (logging) )); } /*-------------------------------------------------------------------------- @@ -282,14 +282,14 @@ hypre_F90_IFACE(hypre_sstructsyspfmgsetlogging, HYPRE_SSTRUCTSYSPFMGSETLOGGING) void hypre_F90_IFACE(hypre_sstructsyspfmgsetprintlev, HYPRE_SSTRUCTSYSPFMGSETPRINTLEV) - (hypre_F90_Obj *solver, - hypre_F90_Int *print_level, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *print_level, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructSysPFMGSetPrintLevel( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (print_level) )); + (HYPRE_SStructSysPFMGSetPrintLevel( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (print_level) )); } /*-------------------------------------------------------------------------- @@ -298,14 +298,14 @@ hypre_F90_IFACE(hypre_sstructsyspfmgsetprintlev, HYPRE_SSTRUCTSYSPFMGSETPRINTLEV void hypre_F90_IFACE(hypre_sstructsyspfmggetnumitera, HYPRE_SSTRUCTSYSPFMGGETNUMITERA) - (hypre_F90_Obj *solver, - hypre_F90_Int *num_iterations, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *num_iterations, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructSysPFMGGetNumIterations( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassIntRef (num_iterations) )); + (HYPRE_SStructSysPFMGGetNumIterations( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassIntRef (num_iterations) )); } /*-------------------------------------------------------------------------- @@ -314,14 +314,14 @@ hypre_F90_IFACE(hypre_sstructsyspfmggetnumitera, HYPRE_SSTRUCTSYSPFMGGETNUMITERA void hypre_F90_IFACE(hypre_sstructsyspfmggetfinalrel, HYPRE_SSTRUCTSYSPFMGGETFINALREL) - (hypre_F90_Obj *solver, - hypre_F90_Real *norm, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Real *norm, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructSysPFMGGetFinalRelativeResidualNorm( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassRealRef (norm) )); + (HYPRE_SStructSysPFMGGetFinalRelativeResidualNorm( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassRealRef (norm) )); } #ifdef __cplusplus diff --git a/external/hypre/src/sstruct_ls/HYPRE_sstruct_InterFAC.c b/external/hypre/src/sstruct_ls/HYPRE_sstruct_InterFAC.c index 7e75d473..3fbd3ae9 100644 --- a/external/hypre/src/sstruct_ls/HYPRE_sstruct_InterFAC.c +++ b/external/hypre/src/sstruct_ls/HYPRE_sstruct_InterFAC.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -32,7 +32,7 @@ HYPRE_SStructFACCreate( MPI_Comm comm, HYPRE_SStructSolver *solver ) HYPRE_Int HYPRE_SStructFACDestroy2( HYPRE_SStructSolver solver ) { - return( hypre_FACDestroy2( (void *) solver ) ); + return ( hypre_FACDestroy2( (void *) solver ) ); } /*-------------------------------------------------------------------------- @@ -43,7 +43,7 @@ HYPRE_SStructFACAMR_RAP( HYPRE_SStructMatrix A, HYPRE_Int (*rfactors)[HYPRE_MAXDIM], HYPRE_SStructMatrix *fac_A ) { - return( hypre_AMR_RAP(A, rfactors, fac_A) ); + return ( hypre_AMR_RAP(A, rfactors, fac_A) ); } /*-------------------------------------------------------------------------- @@ -55,10 +55,10 @@ HYPRE_SStructFACSetup2( HYPRE_SStructSolver solver, HYPRE_SStructVector b, HYPRE_SStructVector x ) { - return( hypre_FacSetup2( (void *) solver, - (hypre_SStructMatrix *) A, - (hypre_SStructVector *) b, - (hypre_SStructVector *) x ) ); + return ( hypre_FacSetup2( (void *) solver, + (hypre_SStructMatrix *) A, + (hypre_SStructVector *) b, + (hypre_SStructVector *) x ) ); } /*-------------------------------------------------------------------------- @@ -70,10 +70,10 @@ HYPRE_SStructFACSolve3(HYPRE_SStructSolver solver, HYPRE_SStructVector b, HYPRE_SStructVector x) { - return( hypre_FACSolve3((void *) solver, - (hypre_SStructMatrix *) A, - (hypre_SStructVector *) b, - (hypre_SStructVector *) x ) ); + return ( hypre_FACSolve3((void *) solver, + (hypre_SStructMatrix *) A, + (hypre_SStructVector *) b, + (hypre_SStructVector *) x ) ); } /*-------------------------------------------------------------------------- @@ -84,7 +84,7 @@ HYPRE_Int HYPRE_SStructFACSetTol( HYPRE_SStructSolver solver, HYPRE_Real tol ) { - return( hypre_FACSetTol( (void *) solver, tol ) ); + return ( hypre_FACSetTol( (void *) solver, tol ) ); } /*-------------------------------------------------------------------------- @@ -95,7 +95,7 @@ HYPRE_SStructFACSetPLevels( HYPRE_SStructSolver solver, HYPRE_Int nparts, HYPRE_Int *plevels) { - return( hypre_FACSetPLevels( (void *) solver, nparts, plevels ) ); + return ( hypre_FACSetPLevels( (void *) solver, nparts, plevels ) ); } /*-------------------------------------------------------------------------- @@ -107,10 +107,10 @@ HYPRE_SStructFACZeroCFSten( HYPRE_SStructMatrix A, HYPRE_Int part, HYPRE_Int rfactors[HYPRE_MAXDIM] ) { - hypre_SStructPMatrix *Af= hypre_SStructMatrixPMatrix(A, part); - hypre_SStructPMatrix *Ac= hypre_SStructMatrixPMatrix(A, part-1); + hypre_SStructPMatrix *Af = hypre_SStructMatrixPMatrix(A, part); + hypre_SStructPMatrix *Ac = hypre_SStructMatrixPMatrix(A, part - 1); - return( hypre_FacZeroCFSten(Af, Ac, (hypre_SStructGrid *)grid, + return ( hypre_FacZeroCFSten(Af, Ac, (hypre_SStructGrid *)grid, part, rfactors) ); } @@ -122,9 +122,9 @@ HYPRE_SStructFACZeroFCSten( HYPRE_SStructMatrix A, HYPRE_SStructGrid grid, HYPRE_Int part ) { - hypre_SStructPMatrix *Af= hypre_SStructMatrixPMatrix(A, part); + hypre_SStructPMatrix *Af = hypre_SStructMatrixPMatrix(A, part); - return( hypre_FacZeroFCSten(Af, (hypre_SStructGrid *)grid, + return ( hypre_FacZeroFCSten(Af, (hypre_SStructGrid *)grid, part) ); } @@ -136,9 +136,9 @@ HYPRE_SStructFACZeroAMRMatrixData( HYPRE_SStructMatrix A, HYPRE_Int part_crse, HYPRE_Int rfactors[HYPRE_MAXDIM] ) { - return( hypre_ZeroAMRMatrixData(A, part_crse, rfactors) ); + return ( hypre_ZeroAMRMatrixData(A, part_crse, rfactors) ); } - + /*-------------------------------------------------------------------------- * HYPRE_SStructFACZeroAMRVectorData *--------------------------------------------------------------------------*/ @@ -147,7 +147,7 @@ HYPRE_SStructFACZeroAMRVectorData( HYPRE_SStructVector b, HYPRE_Int *plevels, HYPRE_Int (*rfactors)[HYPRE_MAXDIM] ) { - return( hypre_ZeroAMRVectorData(b, plevels, rfactors) ); + return ( hypre_ZeroAMRVectorData(b, plevels, rfactors) ); } @@ -159,9 +159,9 @@ HYPRE_SStructFACSetPRefinements( HYPRE_SStructSolver solver, HYPRE_Int nparts, HYPRE_Int (*rfactors)[HYPRE_MAXDIM] ) { - return( hypre_FACSetPRefinements( (void *) solver, - nparts, - rfactors ) ); + return ( hypre_FACSetPRefinements( (void *) solver, + nparts, + rfactors ) ); } /*-------------------------------------------------------------------------- * HYPRE_SStructFACSetMaxLevels @@ -171,7 +171,7 @@ HYPRE_Int HYPRE_SStructFACSetMaxLevels( HYPRE_SStructSolver solver, HYPRE_Int max_levels ) { - return( hypre_FACSetMaxLevels( (void *) solver, max_levels ) ); + return ( hypre_FACSetMaxLevels( (void *) solver, max_levels ) ); } /*-------------------------------------------------------------------------- @@ -182,7 +182,7 @@ HYPRE_Int HYPRE_SStructFACSetMaxIter( HYPRE_SStructSolver solver, HYPRE_Int max_iter ) { - return( hypre_FACSetMaxIter( (void *) solver, max_iter ) ); + return ( hypre_FACSetMaxIter( (void *) solver, max_iter ) ); } /*-------------------------------------------------------------------------- @@ -193,7 +193,7 @@ HYPRE_Int HYPRE_SStructFACSetRelChange( HYPRE_SStructSolver solver, HYPRE_Int rel_change ) { - return( hypre_FACSetRelChange( (void *) solver, rel_change ) ); + return ( hypre_FACSetRelChange( (void *) solver, rel_change ) ); } /*-------------------------------------------------------------------------- @@ -203,7 +203,7 @@ HYPRE_SStructFACSetRelChange( HYPRE_SStructSolver solver, HYPRE_Int HYPRE_SStructFACSetZeroGuess( HYPRE_SStructSolver solver ) { - return( hypre_FACSetZeroGuess( (void *) solver, 1 ) ); + return ( hypre_FACSetZeroGuess( (void *) solver, 1 ) ); } /*-------------------------------------------------------------------------- @@ -213,7 +213,7 @@ HYPRE_SStructFACSetZeroGuess( HYPRE_SStructSolver solver ) HYPRE_Int HYPRE_SStructFACSetNonZeroGuess( HYPRE_SStructSolver solver ) { - return( hypre_FACSetZeroGuess( (void *) solver, 0 ) ); + return ( hypre_FACSetZeroGuess( (void *) solver, 0 ) ); } /*-------------------------------------------------------------------------- @@ -224,7 +224,7 @@ HYPRE_Int HYPRE_SStructFACSetRelaxType( HYPRE_SStructSolver solver, HYPRE_Int relax_type ) { - return( hypre_FACSetRelaxType( (void *) solver, relax_type) ); + return ( hypre_FACSetRelaxType( (void *) solver, relax_type) ); } /*-------------------------------------------------------------------------- @@ -235,7 +235,7 @@ HYPRE_Int HYPRE_SStructFACSetJacobiWeight( HYPRE_SStructSolver solver, HYPRE_Real weight) { - return( hypre_FACSetJacobiWeight( (void *) solver, weight) ); + return ( hypre_FACSetJacobiWeight( (void *) solver, weight) ); } /*-------------------------------------------------------------------------- @@ -245,7 +245,7 @@ HYPRE_Int HYPRE_SStructFACSetNumPreRelax( HYPRE_SStructSolver solver, HYPRE_Int num_pre_relax ) { - return( hypre_FACSetNumPreSmooth( (void *) solver, num_pre_relax) ); + return ( hypre_FACSetNumPreSmooth( (void *) solver, num_pre_relax) ); } /*-------------------------------------------------------------------------- @@ -256,7 +256,7 @@ HYPRE_Int HYPRE_SStructFACSetNumPostRelax( HYPRE_SStructSolver solver, HYPRE_Int num_post_relax ) { - return( hypre_FACSetNumPostSmooth( (void *) solver, num_post_relax) ); + return ( hypre_FACSetNumPostSmooth( (void *) solver, num_post_relax) ); } /*-------------------------------------------------------------------------- @@ -267,7 +267,7 @@ HYPRE_Int HYPRE_SStructFACSetCoarseSolverType( HYPRE_SStructSolver solver, HYPRE_Int csolver_type) { - return( hypre_FACSetCoarseSolverType( (void *) solver, csolver_type) ); + return ( hypre_FACSetCoarseSolverType( (void *) solver, csolver_type) ); } @@ -279,7 +279,7 @@ HYPRE_Int HYPRE_SStructFACSetLogging( HYPRE_SStructSolver solver, HYPRE_Int logging ) { - return( hypre_FACSetLogging( (void *) solver, logging) ); + return ( hypre_FACSetLogging( (void *) solver, logging) ); } /*-------------------------------------------------------------------------- @@ -290,7 +290,7 @@ HYPRE_Int HYPRE_SStructFACGetNumIterations( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ) { - return( hypre_FACGetNumIterations( (void *) solver, num_iterations ) ); + return ( hypre_FACGetNumIterations( (void *) solver, num_iterations ) ); } /*-------------------------------------------------------------------------- @@ -301,7 +301,7 @@ HYPRE_Int HYPRE_SStructFACGetFinalRelativeResidualNorm( HYPRE_SStructSolver solver, HYPRE_Real *norm ) { - return( hypre_FACGetFinalRelativeResidualNorm( (void *) solver, norm ) ); + return ( hypre_FACGetFinalRelativeResidualNorm( (void *) solver, norm ) ); } diff --git a/external/hypre/src/sstruct_ls/HYPRE_sstruct_bicgstab.c b/external/hypre/src/sstruct_ls/HYPRE_sstruct_bicgstab.c index c8d8dd8c..29867996 100644 --- a/external/hypre/src/sstruct_ls/HYPRE_sstruct_bicgstab.c +++ b/external/hypre/src/sstruct_ls/HYPRE_sstruct_bicgstab.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -14,15 +14,17 @@ HYPRE_Int HYPRE_SStructBiCGSTABCreate( MPI_Comm comm, HYPRE_SStructSolver *solver ) { + HYPRE_UNUSED_VAR(comm); + hypre_BiCGSTABFunctions * bicgstab_functions = hypre_BiCGSTABFunctionsCreate( hypre_SStructKrylovCreateVector, hypre_SStructKrylovDestroyVector, hypre_SStructKrylovMatvecCreate, hypre_SStructKrylovMatvec, hypre_SStructKrylovMatvecDestroy, hypre_SStructKrylovInnerProd, hypre_SStructKrylovCopyVector, - hypre_SStructKrylovClearVector, + hypre_SStructKrylovClearVector, hypre_SStructKrylovScaleVector, hypre_SStructKrylovAxpy, - hypre_SStructKrylovCommInfo, + hypre_SStructKrylovCommInfo, hypre_SStructKrylovIdentitySetup, hypre_SStructKrylovIdentity ); *solver = ( (HYPRE_SStructSolver) hypre_BiCGSTABCreate( bicgstab_functions ) ); @@ -33,40 +35,40 @@ HYPRE_SStructBiCGSTABCreate( MPI_Comm comm, /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_SStructBiCGSTABDestroy( HYPRE_SStructSolver solver ) { - return( hypre_BiCGSTABDestroy( (void *) solver ) ); + return ( hypre_BiCGSTABDestroy( (void *) solver ) ); } /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_SStructBiCGSTABSetup( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ) { - return( HYPRE_BiCGSTABSetup( (HYPRE_Solver) solver, - (HYPRE_Matrix) A, - (HYPRE_Vector) b, - (HYPRE_Vector) x ) ); + return ( HYPRE_BiCGSTABSetup( (HYPRE_Solver) solver, + (HYPRE_Matrix) A, + (HYPRE_Vector) b, + (HYPRE_Vector) x ) ); } /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_SStructBiCGSTABSolve( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ) { - return( HYPRE_BiCGSTABSolve( (HYPRE_Solver) solver, - (HYPRE_Matrix) A, - (HYPRE_Vector) b, - (HYPRE_Vector) x ) ); + return ( HYPRE_BiCGSTABSolve( (HYPRE_Solver) solver, + (HYPRE_Matrix) A, + (HYPRE_Vector) b, + (HYPRE_Vector) x ) ); } /*-------------------------------------------------------------------------- @@ -76,7 +78,7 @@ HYPRE_Int HYPRE_SStructBiCGSTABSetTol( HYPRE_SStructSolver solver, HYPRE_Real tol ) { - return( HYPRE_BiCGSTABSetTol( (HYPRE_Solver) solver, tol ) ); + return ( HYPRE_BiCGSTABSetTol( (HYPRE_Solver) solver, tol ) ); } /*-------------------------------------------------------------------------- @@ -86,7 +88,7 @@ HYPRE_Int HYPRE_SStructBiCGSTABSetAbsoluteTol( HYPRE_SStructSolver solver, HYPRE_Real tol ) { - return( HYPRE_BiCGSTABSetAbsoluteTol( (HYPRE_Solver) solver, tol ) ); + return ( HYPRE_BiCGSTABSetAbsoluteTol( (HYPRE_Solver) solver, tol ) ); } /*-------------------------------------------------------------------------- @@ -96,7 +98,7 @@ HYPRE_Int HYPRE_SStructBiCGSTABSetMinIter( HYPRE_SStructSolver solver, HYPRE_Int min_iter ) { - return( HYPRE_BiCGSTABSetMinIter( (HYPRE_Solver) solver, min_iter ) ); + return ( HYPRE_BiCGSTABSetMinIter( (HYPRE_Solver) solver, min_iter ) ); } /*-------------------------------------------------------------------------- @@ -106,7 +108,7 @@ HYPRE_Int HYPRE_SStructBiCGSTABSetMaxIter( HYPRE_SStructSolver solver, HYPRE_Int max_iter ) { - return( HYPRE_BiCGSTABSetMaxIter( (HYPRE_Solver) solver, max_iter ) ); + return ( HYPRE_BiCGSTABSetMaxIter( (HYPRE_Solver) solver, max_iter ) ); } /*-------------------------------------------------------------------------- @@ -116,7 +118,7 @@ HYPRE_Int HYPRE_SStructBiCGSTABSetStopCrit( HYPRE_SStructSolver solver, HYPRE_Int stop_crit ) { - return( HYPRE_BiCGSTABSetStopCrit( (HYPRE_Solver) solver, stop_crit ) ); + return ( HYPRE_BiCGSTABSetStopCrit( (HYPRE_Solver) solver, stop_crit ) ); } /*-------------------------------------------------------------------------- @@ -128,10 +130,10 @@ HYPRE_SStructBiCGSTABSetPrecond( HYPRE_SStructSolver solver, HYPRE_PtrToSStructSolverFcn precond_setup, void * precond_data ) { - return( HYPRE_BiCGSTABSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) precond, - (HYPRE_PtrToSolverFcn) precond_setup, - (HYPRE_Solver) precond_data ) ); + return ( HYPRE_BiCGSTABSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) precond, + (HYPRE_PtrToSolverFcn) precond_setup, + (HYPRE_Solver) precond_data ) ); } /*-------------------------------------------------------------------------- @@ -141,7 +143,7 @@ HYPRE_Int HYPRE_SStructBiCGSTABSetLogging( HYPRE_SStructSolver solver, HYPRE_Int logging ) { - return( HYPRE_BiCGSTABSetLogging( (HYPRE_Solver) solver, logging ) ); + return ( HYPRE_BiCGSTABSetLogging( (HYPRE_Solver) solver, logging ) ); } /*-------------------------------------------------------------------------- @@ -151,7 +153,7 @@ HYPRE_Int HYPRE_SStructBiCGSTABSetPrintLevel( HYPRE_SStructSolver solver, HYPRE_Int print_level ) { - return( HYPRE_BiCGSTABSetPrintLevel( (HYPRE_Solver) solver, print_level ) ); + return ( HYPRE_BiCGSTABSetPrintLevel( (HYPRE_Solver) solver, print_level ) ); } /*-------------------------------------------------------------------------- @@ -161,8 +163,8 @@ HYPRE_Int HYPRE_SStructBiCGSTABGetNumIterations( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ) { - return( HYPRE_BiCGSTABGetNumIterations( (HYPRE_Solver) solver, - num_iterations ) ); + return ( HYPRE_BiCGSTABGetNumIterations( (HYPRE_Solver) solver, + num_iterations ) ); } /*-------------------------------------------------------------------------- @@ -172,8 +174,8 @@ HYPRE_Int HYPRE_SStructBiCGSTABGetFinalRelativeResidualNorm( HYPRE_SStructSolver solver, HYPRE_Real *norm ) { - return( HYPRE_BiCGSTABGetFinalRelativeResidualNorm( (HYPRE_Solver) solver, - norm ) ); + return ( HYPRE_BiCGSTABGetFinalRelativeResidualNorm( (HYPRE_Solver) solver, + norm ) ); } /*-------------------------------------------------------------------------- @@ -182,7 +184,7 @@ HYPRE_SStructBiCGSTABGetFinalRelativeResidualNorm( HYPRE_SStructSolver solver, HYPRE_Int HYPRE_SStructBiCGSTABGetResidual( HYPRE_SStructSolver solver, - void **residual) + void **residual) { - return( HYPRE_BiCGSTABGetResidual( (HYPRE_Solver) solver, residual ) ); + return ( HYPRE_BiCGSTABGetResidual( (HYPRE_Solver) solver, residual ) ); } diff --git a/external/hypre/src/sstruct_ls/HYPRE_sstruct_flexgmres.c b/external/hypre/src/sstruct_ls/HYPRE_sstruct_flexgmres.c index 3c6bc098..e5571096 100644 --- a/external/hypre/src/sstruct_ls/HYPRE_sstruct_flexgmres.c +++ b/external/hypre/src/sstruct_ls/HYPRE_sstruct_flexgmres.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -14,6 +14,8 @@ HYPRE_Int HYPRE_SStructFlexGMRESCreate( MPI_Comm comm, HYPRE_SStructSolver *solver ) { + HYPRE_UNUSED_VAR(comm); + hypre_FlexGMRESFunctions * fgmres_functions = hypre_FlexGMRESFunctionsCreate( hypre_SStructKrylovCAlloc, hypre_SStructKrylovFree, hypre_SStructKrylovCommInfo, @@ -34,40 +36,40 @@ HYPRE_SStructFlexGMRESCreate( MPI_Comm comm, /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_SStructFlexGMRESDestroy( HYPRE_SStructSolver solver ) { - return( hypre_FlexGMRESDestroy( (void *) solver ) ); + return ( hypre_FlexGMRESDestroy( (void *) solver ) ); } /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_SStructFlexGMRESSetup( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ) { - return( HYPRE_FlexGMRESSetup( (HYPRE_Solver) solver, - (HYPRE_Matrix) A, - (HYPRE_Vector) b, - (HYPRE_Vector) x ) ); + return ( HYPRE_FlexGMRESSetup( (HYPRE_Solver) solver, + (HYPRE_Matrix) A, + (HYPRE_Vector) b, + (HYPRE_Vector) x ) ); } /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_SStructFlexGMRESSolve( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ) { - return( HYPRE_FlexGMRESSolve( (HYPRE_Solver) solver, - (HYPRE_Matrix) A, - (HYPRE_Vector) b, - (HYPRE_Vector) x ) ); + return ( HYPRE_FlexGMRESSolve( (HYPRE_Solver) solver, + (HYPRE_Matrix) A, + (HYPRE_Vector) b, + (HYPRE_Vector) x ) ); } /*-------------------------------------------------------------------------- @@ -77,7 +79,7 @@ HYPRE_Int HYPRE_SStructFlexGMRESSetKDim( HYPRE_SStructSolver solver, HYPRE_Int k_dim ) { - return( HYPRE_FlexGMRESSetKDim( (HYPRE_Solver) solver, k_dim ) ); + return ( HYPRE_FlexGMRESSetKDim( (HYPRE_Solver) solver, k_dim ) ); } /*-------------------------------------------------------------------------- @@ -87,7 +89,7 @@ HYPRE_Int HYPRE_SStructFlexGMRESSetTol( HYPRE_SStructSolver solver, HYPRE_Real tol ) { - return( HYPRE_FlexGMRESSetTol( (HYPRE_Solver) solver, tol ) ); + return ( HYPRE_FlexGMRESSetTol( (HYPRE_Solver) solver, tol ) ); } /*-------------------------------------------------------------------------- @@ -97,7 +99,7 @@ HYPRE_Int HYPRE_SStructFlexGMRESSetAbsoluteTol( HYPRE_SStructSolver solver, HYPRE_Real tol ) { - return( HYPRE_FlexGMRESSetAbsoluteTol( (HYPRE_Solver) solver, tol ) ); + return ( HYPRE_FlexGMRESSetAbsoluteTol( (HYPRE_Solver) solver, tol ) ); } /*-------------------------------------------------------------------------- @@ -107,7 +109,7 @@ HYPRE_Int HYPRE_SStructFlexGMRESSetMinIter( HYPRE_SStructSolver solver, HYPRE_Int min_iter ) { - return( HYPRE_FlexGMRESSetMinIter( (HYPRE_Solver) solver, min_iter ) ); + return ( HYPRE_FlexGMRESSetMinIter( (HYPRE_Solver) solver, min_iter ) ); } /*-------------------------------------------------------------------------- @@ -117,7 +119,7 @@ HYPRE_Int HYPRE_SStructFlexGMRESSetMaxIter( HYPRE_SStructSolver solver, HYPRE_Int max_iter ) { - return( HYPRE_FlexGMRESSetMaxIter( (HYPRE_Solver) solver, max_iter ) ); + return ( HYPRE_FlexGMRESSetMaxIter( (HYPRE_Solver) solver, max_iter ) ); } /*-------------------------------------------------------------------------- @@ -129,10 +131,10 @@ HYPRE_SStructFlexGMRESSetPrecond( HYPRE_SStructSolver solver, HYPRE_PtrToSStructSolverFcn precond_setup, void * precond_data ) { - return( HYPRE_FlexGMRESSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) precond, - (HYPRE_PtrToSolverFcn) precond_setup, - (HYPRE_Solver) precond_data ) ); + return ( HYPRE_FlexGMRESSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) precond, + (HYPRE_PtrToSolverFcn) precond_setup, + (HYPRE_Solver) precond_data ) ); } /*-------------------------------------------------------------------------- @@ -142,7 +144,7 @@ HYPRE_Int HYPRE_SStructFlexGMRESSetLogging( HYPRE_SStructSolver solver, HYPRE_Int logging ) { - return( HYPRE_FlexGMRESSetLogging( (HYPRE_Solver) solver, logging ) ); + return ( HYPRE_FlexGMRESSetLogging( (HYPRE_Solver) solver, logging ) ); } /*-------------------------------------------------------------------------- @@ -152,7 +154,7 @@ HYPRE_Int HYPRE_SStructFlexGMRESSetPrintLevel( HYPRE_SStructSolver solver, HYPRE_Int level ) { - return( HYPRE_FlexGMRESSetPrintLevel( (HYPRE_Solver) solver, level ) ); + return ( HYPRE_FlexGMRESSetPrintLevel( (HYPRE_Solver) solver, level ) ); } /*-------------------------------------------------------------------------- @@ -162,8 +164,8 @@ HYPRE_Int HYPRE_SStructFlexGMRESGetNumIterations( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ) { - return( HYPRE_FlexGMRESGetNumIterations( (HYPRE_Solver) solver, - num_iterations ) ); + return ( HYPRE_FlexGMRESGetNumIterations( (HYPRE_Solver) solver, + num_iterations ) ); } /*-------------------------------------------------------------------------- @@ -173,8 +175,8 @@ HYPRE_Int HYPRE_SStructFlexGMRESGetFinalRelativeResidualNorm( HYPRE_SStructSolver solver, HYPRE_Real *norm ) { - return( HYPRE_FlexGMRESGetFinalRelativeResidualNorm( (HYPRE_Solver) solver, - norm ) ); + return ( HYPRE_FlexGMRESGetFinalRelativeResidualNorm( (HYPRE_Solver) solver, + norm ) ); } /*-------------------------------------------------------------------------- @@ -184,12 +186,12 @@ HYPRE_Int HYPRE_SStructFlexGMRESGetResidual( HYPRE_SStructSolver solver, void **residual ) { - return( HYPRE_FlexGMRESGetResidual( (HYPRE_Solver) solver, residual ) ); + return ( HYPRE_FlexGMRESGetResidual( (HYPRE_Solver) solver, residual ) ); } /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ - + HYPRE_Int HYPRE_SStructFlexGMRESSetModifyPC( HYPRE_SStructSolver solver, HYPRE_PtrToModifyPCFcn modify_pc) @@ -197,6 +199,5 @@ HYPRE_Int HYPRE_SStructFlexGMRESSetModifyPC( HYPRE_SStructSolver solver, { return ( HYPRE_FlexGMRESSetModifyPC( (HYPRE_Solver) solver, (HYPRE_PtrToModifyPCFcn) modify_pc)); - -} +} diff --git a/external/hypre/src/sstruct_ls/HYPRE_sstruct_gmres.c b/external/hypre/src/sstruct_ls/HYPRE_sstruct_gmres.c index 5b64f253..22783652 100644 --- a/external/hypre/src/sstruct_ls/HYPRE_sstruct_gmres.c +++ b/external/hypre/src/sstruct_ls/HYPRE_sstruct_gmres.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -14,6 +14,8 @@ HYPRE_Int HYPRE_SStructGMRESCreate( MPI_Comm comm, HYPRE_SStructSolver *solver ) { + HYPRE_UNUSED_VAR(comm); + hypre_GMRESFunctions * gmres_functions = hypre_GMRESFunctionsCreate( hypre_SStructKrylovCAlloc, hypre_SStructKrylovFree, hypre_SStructKrylovCommInfo, @@ -34,40 +36,40 @@ HYPRE_SStructGMRESCreate( MPI_Comm comm, /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_SStructGMRESDestroy( HYPRE_SStructSolver solver ) { - return( hypre_GMRESDestroy( (void *) solver ) ); + return ( hypre_GMRESDestroy( (void *) solver ) ); } /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_SStructGMRESSetup( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ) { - return( HYPRE_GMRESSetup( (HYPRE_Solver) solver, - (HYPRE_Matrix) A, - (HYPRE_Vector) b, - (HYPRE_Vector) x ) ); + return ( HYPRE_GMRESSetup( (HYPRE_Solver) solver, + (HYPRE_Matrix) A, + (HYPRE_Vector) b, + (HYPRE_Vector) x ) ); } /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_SStructGMRESSolve( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ) { - return( HYPRE_GMRESSolve( (HYPRE_Solver) solver, - (HYPRE_Matrix) A, - (HYPRE_Vector) b, - (HYPRE_Vector) x ) ); + return ( HYPRE_GMRESSolve( (HYPRE_Solver) solver, + (HYPRE_Matrix) A, + (HYPRE_Vector) b, + (HYPRE_Vector) x ) ); } /*-------------------------------------------------------------------------- @@ -77,7 +79,7 @@ HYPRE_Int HYPRE_SStructGMRESSetKDim( HYPRE_SStructSolver solver, HYPRE_Int k_dim ) { - return( HYPRE_GMRESSetKDim( (HYPRE_Solver) solver, k_dim ) ); + return ( HYPRE_GMRESSetKDim( (HYPRE_Solver) solver, k_dim ) ); } /*-------------------------------------------------------------------------- @@ -87,16 +89,16 @@ HYPRE_Int HYPRE_SStructGMRESSetTol( HYPRE_SStructSolver solver, HYPRE_Real tol ) { - return( HYPRE_GMRESSetTol( (HYPRE_Solver) solver, tol ) ); + return ( HYPRE_GMRESSetTol( (HYPRE_Solver) solver, tol ) ); } /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ HYPRE_Int HYPRE_SStructGMRESSetAbsoluteTol( HYPRE_SStructSolver solver, - HYPRE_Real atol ) + HYPRE_Real atol ) { - return( HYPRE_GMRESSetAbsoluteTol( (HYPRE_Solver) solver, atol ) ); + return ( HYPRE_GMRESSetAbsoluteTol( (HYPRE_Solver) solver, atol ) ); } /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ @@ -105,7 +107,7 @@ HYPRE_Int HYPRE_SStructGMRESSetMinIter( HYPRE_SStructSolver solver, HYPRE_Int min_iter ) { - return( HYPRE_GMRESSetMinIter( (HYPRE_Solver) solver, min_iter ) ); + return ( HYPRE_GMRESSetMinIter( (HYPRE_Solver) solver, min_iter ) ); } /*-------------------------------------------------------------------------- @@ -115,7 +117,7 @@ HYPRE_Int HYPRE_SStructGMRESSetMaxIter( HYPRE_SStructSolver solver, HYPRE_Int max_iter ) { - return( HYPRE_GMRESSetMaxIter( (HYPRE_Solver) solver, max_iter ) ); + return ( HYPRE_GMRESSetMaxIter( (HYPRE_Solver) solver, max_iter ) ); } /*-------------------------------------------------------------------------- @@ -125,7 +127,7 @@ HYPRE_Int HYPRE_SStructGMRESSetStopCrit( HYPRE_SStructSolver solver, HYPRE_Int stop_crit ) { - return( HYPRE_GMRESSetStopCrit( (HYPRE_Solver) solver, stop_crit ) ); + return ( HYPRE_GMRESSetStopCrit( (HYPRE_Solver) solver, stop_crit ) ); } /*-------------------------------------------------------------------------- @@ -137,10 +139,10 @@ HYPRE_SStructGMRESSetPrecond( HYPRE_SStructSolver solver, HYPRE_PtrToSStructSolverFcn precond_setup, void * precond_data ) { - return( HYPRE_GMRESSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) precond, - (HYPRE_PtrToSolverFcn) precond_setup, - (HYPRE_Solver) precond_data ) ); + return ( HYPRE_GMRESSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) precond, + (HYPRE_PtrToSolverFcn) precond_setup, + (HYPRE_Solver) precond_data ) ); } /*-------------------------------------------------------------------------- @@ -150,7 +152,7 @@ HYPRE_Int HYPRE_SStructGMRESSetLogging( HYPRE_SStructSolver solver, HYPRE_Int logging ) { - return( HYPRE_GMRESSetLogging( (HYPRE_Solver) solver, logging ) ); + return ( HYPRE_GMRESSetLogging( (HYPRE_Solver) solver, logging ) ); } /*-------------------------------------------------------------------------- @@ -158,9 +160,9 @@ HYPRE_SStructGMRESSetLogging( HYPRE_SStructSolver solver, HYPRE_Int HYPRE_SStructGMRESSetPrintLevel( HYPRE_SStructSolver solver, - HYPRE_Int level ) + HYPRE_Int level ) { - return( HYPRE_GMRESSetPrintLevel( (HYPRE_Solver) solver, level ) ); + return ( HYPRE_GMRESSetPrintLevel( (HYPRE_Solver) solver, level ) ); } /*-------------------------------------------------------------------------- @@ -170,7 +172,7 @@ HYPRE_Int HYPRE_SStructGMRESGetNumIterations( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ) { - return( HYPRE_GMRESGetNumIterations( (HYPRE_Solver) solver, num_iterations ) ); + return ( HYPRE_GMRESGetNumIterations( (HYPRE_Solver) solver, num_iterations ) ); } /*-------------------------------------------------------------------------- @@ -180,7 +182,7 @@ HYPRE_Int HYPRE_SStructGMRESGetFinalRelativeResidualNorm( HYPRE_SStructSolver solver, HYPRE_Real *norm ) { - return( HYPRE_GMRESGetFinalRelativeResidualNorm( (HYPRE_Solver) solver, norm ) ); + return ( HYPRE_GMRESGetFinalRelativeResidualNorm( (HYPRE_Solver) solver, norm ) ); } /*-------------------------------------------------------------------------- @@ -188,7 +190,7 @@ HYPRE_SStructGMRESGetFinalRelativeResidualNorm( HYPRE_SStructSolver solver, HYPRE_Int HYPRE_SStructGMRESGetResidual( HYPRE_SStructSolver solver, - void **residual ) + void **residual ) { - return( HYPRE_GMRESGetResidual( (HYPRE_Solver) solver, residual ) ); + return ( HYPRE_GMRESGetResidual( (HYPRE_Solver) solver, residual ) ); } diff --git a/external/hypre/src/sstruct_ls/HYPRE_sstruct_int.c b/external/hypre/src/sstruct_ls/HYPRE_sstruct_int.c index b770d73a..a91fdee1 100644 --- a/external/hypre/src/sstruct_ls/HYPRE_sstruct_int.c +++ b/external/hypre/src/sstruct_ls/HYPRE_sstruct_int.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -11,7 +11,7 @@ #include "temp_multivector.h" -HYPRE_Int +HYPRE_Int hypre_SStructPVectorSetRandomValues( hypre_SStructPVector *pvector, HYPRE_Int seed ) { HYPRE_Int ierr = 0; @@ -31,7 +31,7 @@ hypre_SStructPVectorSetRandomValues( hypre_SStructPVector *pvector, HYPRE_Int se return ierr; } -HYPRE_Int +HYPRE_Int hypre_SStructVectorSetRandomValues( hypre_SStructVector *vector, HYPRE_Int seed ) { HYPRE_Int ierr = 0; @@ -52,54 +52,55 @@ hypre_SStructVectorSetRandomValues( hypre_SStructVector *vector, HYPRE_Int seed } HYPRE_Int -hypre_SStructSetRandomValues( void* v, HYPRE_Int seed ) { +hypre_SStructSetRandomValues( void* v, HYPRE_Int seed ) +{ - return hypre_SStructVectorSetRandomValues( (hypre_SStructVector*)v, seed ); + return hypre_SStructVectorSetRandomValues( (hypre_SStructVector*)v, seed ); } HYPRE_Int HYPRE_SStructSetupInterpreter( mv_InterfaceInterpreter *i ) { - i->CreateVector = hypre_SStructKrylovCreateVector; - i->DestroyVector = hypre_SStructKrylovDestroyVector; - i->InnerProd = hypre_SStructKrylovInnerProd; - i->CopyVector = hypre_SStructKrylovCopyVector; - i->ClearVector = hypre_SStructKrylovClearVector; - i->SetRandomValues = hypre_SStructSetRandomValues; - i->ScaleVector = hypre_SStructKrylovScaleVector; - i->Axpy = hypre_SStructKrylovAxpy; - - i->CreateMultiVector = mv_TempMultiVectorCreateFromSampleVector; - i->CopyCreateMultiVector = mv_TempMultiVectorCreateCopy; - i->DestroyMultiVector = mv_TempMultiVectorDestroy; - - i->Width = mv_TempMultiVectorWidth; - i->Height = mv_TempMultiVectorHeight; - i->SetMask = mv_TempMultiVectorSetMask; - i->CopyMultiVector = mv_TempMultiVectorCopy; - i->ClearMultiVector = mv_TempMultiVectorClear; - i->SetRandomVectors = mv_TempMultiVectorSetRandom; - i->MultiInnerProd = mv_TempMultiVectorByMultiVector; - i->MultiInnerProdDiag = mv_TempMultiVectorByMultiVectorDiag; - i->MultiVecMat = mv_TempMultiVectorByMatrix; - i->MultiVecMatDiag = mv_TempMultiVectorByDiagonal; - i->MultiAxpy = mv_TempMultiVectorAxpy; - i->MultiXapy = mv_TempMultiVectorXapy; - i->Eval = mv_TempMultiVectorEval; - - return 0; + i->CreateVector = hypre_SStructKrylovCreateVector; + i->DestroyVector = hypre_SStructKrylovDestroyVector; + i->InnerProd = hypre_SStructKrylovInnerProd; + i->CopyVector = hypre_SStructKrylovCopyVector; + i->ClearVector = hypre_SStructKrylovClearVector; + i->SetRandomValues = hypre_SStructSetRandomValues; + i->ScaleVector = hypre_SStructKrylovScaleVector; + i->Axpy = hypre_SStructKrylovAxpy; + + i->CreateMultiVector = mv_TempMultiVectorCreateFromSampleVector; + i->CopyCreateMultiVector = mv_TempMultiVectorCreateCopy; + i->DestroyMultiVector = mv_TempMultiVectorDestroy; + + i->Width = mv_TempMultiVectorWidth; + i->Height = mv_TempMultiVectorHeight; + i->SetMask = mv_TempMultiVectorSetMask; + i->CopyMultiVector = mv_TempMultiVectorCopy; + i->ClearMultiVector = mv_TempMultiVectorClear; + i->SetRandomVectors = mv_TempMultiVectorSetRandom; + i->MultiInnerProd = mv_TempMultiVectorByMultiVector; + i->MultiInnerProdDiag = mv_TempMultiVectorByMultiVectorDiag; + i->MultiVecMat = mv_TempMultiVectorByMatrix; + i->MultiVecMatDiag = mv_TempMultiVectorByDiagonal; + i->MultiAxpy = mv_TempMultiVectorAxpy; + i->MultiXapy = mv_TempMultiVectorXapy; + i->Eval = mv_TempMultiVectorEval; + + return 0; } HYPRE_Int HYPRE_SStructSetupMatvec(HYPRE_MatvecFunctions * mv) { - mv->MatvecCreate = hypre_SStructKrylovMatvecCreate; - mv->Matvec = hypre_SStructKrylovMatvec; - mv->MatvecDestroy = hypre_SStructKrylovMatvecDestroy; + mv->MatvecCreate = hypre_SStructKrylovMatvecCreate; + mv->Matvec = hypre_SStructKrylovMatvec; + mv->MatvecDestroy = hypre_SStructKrylovMatvecDestroy; - mv->MatMultiVecCreate = NULL; - mv->MatMultiVec = NULL; - mv->MatMultiVecDestroy = NULL; + mv->MatMultiVecCreate = NULL; + mv->MatMultiVec = NULL; + mv->MatMultiVecDestroy = NULL; - return 0; + return 0; } diff --git a/external/hypre/src/sstruct_ls/HYPRE_sstruct_lgmres.c b/external/hypre/src/sstruct_ls/HYPRE_sstruct_lgmres.c index 19f1fbd2..beda3843 100644 --- a/external/hypre/src/sstruct_ls/HYPRE_sstruct_lgmres.c +++ b/external/hypre/src/sstruct_ls/HYPRE_sstruct_lgmres.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -12,8 +12,10 @@ HYPRE_Int HYPRE_SStructLGMRESCreate( MPI_Comm comm, - HYPRE_SStructSolver *solver ) + HYPRE_SStructSolver *solver ) { + HYPRE_UNUSED_VAR(comm); + hypre_LGMRESFunctions * lgmres_functions = hypre_LGMRESFunctionsCreate( hypre_SStructKrylovCAlloc, hypre_SStructKrylovFree, hypre_SStructKrylovCommInfo, @@ -34,40 +36,40 @@ HYPRE_SStructLGMRESCreate( MPI_Comm comm, /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_SStructLGMRESDestroy( HYPRE_SStructSolver solver ) { - return( hypre_LGMRESDestroy( (void *) solver ) ); + return ( hypre_LGMRESDestroy( (void *) solver ) ); } /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_SStructLGMRESSetup( HYPRE_SStructSolver solver, - HYPRE_SStructMatrix A, - HYPRE_SStructVector b, - HYPRE_SStructVector x ) + HYPRE_SStructMatrix A, + HYPRE_SStructVector b, + HYPRE_SStructVector x ) { - return( HYPRE_LGMRESSetup( (HYPRE_Solver) solver, - (HYPRE_Matrix) A, - (HYPRE_Vector) b, - (HYPRE_Vector) x ) ); + return ( HYPRE_LGMRESSetup( (HYPRE_Solver) solver, + (HYPRE_Matrix) A, + (HYPRE_Vector) b, + (HYPRE_Vector) x ) ); } /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_SStructLGMRESSolve( HYPRE_SStructSolver solver, - HYPRE_SStructMatrix A, - HYPRE_SStructVector b, - HYPRE_SStructVector x ) + HYPRE_SStructMatrix A, + HYPRE_SStructVector b, + HYPRE_SStructVector x ) { - return( HYPRE_LGMRESSolve( (HYPRE_Solver) solver, - (HYPRE_Matrix) A, - (HYPRE_Vector) b, - (HYPRE_Vector) x ) ); + return ( HYPRE_LGMRESSolve( (HYPRE_Solver) solver, + (HYPRE_Matrix) A, + (HYPRE_Vector) b, + (HYPRE_Vector) x ) ); } /*-------------------------------------------------------------------------- @@ -75,9 +77,9 @@ HYPRE_SStructLGMRESSolve( HYPRE_SStructSolver solver, HYPRE_Int HYPRE_SStructLGMRESSetKDim( HYPRE_SStructSolver solver, - HYPRE_Int k_dim ) + HYPRE_Int k_dim ) { - return( HYPRE_LGMRESSetKDim( (HYPRE_Solver) solver, k_dim ) ); + return ( HYPRE_LGMRESSetKDim( (HYPRE_Solver) solver, k_dim ) ); } /*-------------------------------------------------------------------------- @@ -85,9 +87,9 @@ HYPRE_SStructLGMRESSetKDim( HYPRE_SStructSolver solver, HYPRE_Int HYPRE_SStructLGMRESSetAugDim( HYPRE_SStructSolver solver, - HYPRE_Int aug_dim ) + HYPRE_Int aug_dim ) { - return( HYPRE_LGMRESSetAugDim( (HYPRE_Solver) solver, aug_dim ) ); + return ( HYPRE_LGMRESSetAugDim( (HYPRE_Solver) solver, aug_dim ) ); } /*-------------------------------------------------------------------------- @@ -95,9 +97,9 @@ HYPRE_SStructLGMRESSetAugDim( HYPRE_SStructSolver solver, HYPRE_Int HYPRE_SStructLGMRESSetTol( HYPRE_SStructSolver solver, - HYPRE_Real tol ) + HYPRE_Real tol ) { - return( HYPRE_LGMRESSetTol( (HYPRE_Solver) solver, tol ) ); + return ( HYPRE_LGMRESSetTol( (HYPRE_Solver) solver, tol ) ); } /*-------------------------------------------------------------------------- @@ -105,9 +107,9 @@ HYPRE_SStructLGMRESSetTol( HYPRE_SStructSolver solver, HYPRE_Int HYPRE_SStructLGMRESSetAbsoluteTol( HYPRE_SStructSolver solver, - HYPRE_Real atol ) + HYPRE_Real atol ) { - return( HYPRE_LGMRESSetAbsoluteTol( (HYPRE_Solver) solver, atol ) ); + return ( HYPRE_LGMRESSetAbsoluteTol( (HYPRE_Solver) solver, atol ) ); } /*-------------------------------------------------------------------------- @@ -115,9 +117,9 @@ HYPRE_SStructLGMRESSetAbsoluteTol( HYPRE_SStructSolver solver, HYPRE_Int HYPRE_SStructLGMRESSetMinIter( HYPRE_SStructSolver solver, - HYPRE_Int min_iter ) + HYPRE_Int min_iter ) { - return( HYPRE_LGMRESSetMinIter( (HYPRE_Solver) solver, min_iter ) ); + return ( HYPRE_LGMRESSetMinIter( (HYPRE_Solver) solver, min_iter ) ); } /*-------------------------------------------------------------------------- @@ -125,9 +127,9 @@ HYPRE_SStructLGMRESSetMinIter( HYPRE_SStructSolver solver, HYPRE_Int HYPRE_SStructLGMRESSetMaxIter( HYPRE_SStructSolver solver, - HYPRE_Int max_iter ) + HYPRE_Int max_iter ) { - return( HYPRE_LGMRESSetMaxIter( (HYPRE_Solver) solver, max_iter ) ); + return ( HYPRE_LGMRESSetMaxIter( (HYPRE_Solver) solver, max_iter ) ); } /*-------------------------------------------------------------------------- @@ -135,14 +137,14 @@ HYPRE_SStructLGMRESSetMaxIter( HYPRE_SStructSolver solver, HYPRE_Int HYPRE_SStructLGMRESSetPrecond( HYPRE_SStructSolver solver, - HYPRE_PtrToSStructSolverFcn precond, - HYPRE_PtrToSStructSolverFcn precond_setup, - void * precond_data ) + HYPRE_PtrToSStructSolverFcn precond, + HYPRE_PtrToSStructSolverFcn precond_setup, + void * precond_data ) { - return( HYPRE_LGMRESSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) precond, - (HYPRE_PtrToSolverFcn) precond_setup, - (HYPRE_Solver) precond_data ) ); + return ( HYPRE_LGMRESSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) precond, + (HYPRE_PtrToSolverFcn) precond_setup, + (HYPRE_Solver) precond_data ) ); } /*-------------------------------------------------------------------------- @@ -150,9 +152,9 @@ HYPRE_SStructLGMRESSetPrecond( HYPRE_SStructSolver solver, HYPRE_Int HYPRE_SStructLGMRESSetLogging( HYPRE_SStructSolver solver, - HYPRE_Int logging ) + HYPRE_Int logging ) { - return( HYPRE_LGMRESSetLogging( (HYPRE_Solver) solver, logging ) ); + return ( HYPRE_LGMRESSetLogging( (HYPRE_Solver) solver, logging ) ); } /*-------------------------------------------------------------------------- @@ -160,9 +162,9 @@ HYPRE_SStructLGMRESSetLogging( HYPRE_SStructSolver solver, HYPRE_Int HYPRE_SStructLGMRESSetPrintLevel( HYPRE_SStructSolver solver, - HYPRE_Int level ) + HYPRE_Int level ) { - return( HYPRE_LGMRESSetPrintLevel( (HYPRE_Solver) solver, level ) ); + return ( HYPRE_LGMRESSetPrintLevel( (HYPRE_Solver) solver, level ) ); } /*-------------------------------------------------------------------------- @@ -170,9 +172,9 @@ HYPRE_SStructLGMRESSetPrintLevel( HYPRE_SStructSolver solver, HYPRE_Int HYPRE_SStructLGMRESGetNumIterations( HYPRE_SStructSolver solver, - HYPRE_Int *num_iterations ) + HYPRE_Int *num_iterations ) { - return( HYPRE_LGMRESGetNumIterations( (HYPRE_Solver) solver, num_iterations ) ); + return ( HYPRE_LGMRESGetNumIterations( (HYPRE_Solver) solver, num_iterations ) ); } /*-------------------------------------------------------------------------- @@ -180,9 +182,9 @@ HYPRE_SStructLGMRESGetNumIterations( HYPRE_SStructSolver solver, HYPRE_Int HYPRE_SStructLGMRESGetFinalRelativeResidualNorm( HYPRE_SStructSolver solver, - HYPRE_Real *norm ) + HYPRE_Real *norm ) { - return( HYPRE_LGMRESGetFinalRelativeResidualNorm( (HYPRE_Solver) solver, norm ) ); + return ( HYPRE_LGMRESGetFinalRelativeResidualNorm( (HYPRE_Solver) solver, norm ) ); } /*-------------------------------------------------------------------------- @@ -192,5 +194,5 @@ HYPRE_Int HYPRE_SStructLGMRESGetResidual( HYPRE_SStructSolver solver, void **residual ) { - return( HYPRE_LGMRESGetResidual( (HYPRE_Solver) solver, residual ) ); + return ( HYPRE_LGMRESGetResidual( (HYPRE_Solver) solver, residual ) ); } diff --git a/external/hypre/src/sstruct_ls/HYPRE_sstruct_ls.h b/external/hypre/src/sstruct_ls/HYPRE_sstruct_ls.h index 27a0e8f6..c4e2356f 100644 --- a/external/hypre/src/sstruct_ls/HYPRE_sstruct_ls.h +++ b/external/hypre/src/sstruct_ls/HYPRE_sstruct_ls.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -26,10 +26,8 @@ extern "C" { /** * @defgroup SStructSolvers SStruct Solvers * - * These solvers use matrix/vector storage schemes that are taylored - * to semi-structured grid problems. - * - * @memo Linear solvers for semi-structured grids + * Linear solvers for semi-structured grids. These solvers use matrix/vector + * storage schemes that are taylored to semi-structured grid problems. * * @{ **/ @@ -58,12 +56,6 @@ typedef HYPRE_Int (*HYPRE_PtrToSStructSolverFcn)(HYPRE_SStructSolver, #define HYPRE_MODIFYPC /* if pc not defined, then may need HYPRE_SOLVER also */ - #ifndef HYPRE_SOLVER_STRUCT - #define HYPRE_SOLVER_STRUCT - struct hypre_Solver_struct; - typedef struct hypre_Solver_struct *HYPRE_Solver; - #endif - typedef HYPRE_Int (*HYPRE_PtrToModifyPCFcn)(HYPRE_Solver, HYPRE_Int, HYPRE_Real); @@ -458,7 +450,7 @@ HYPRE_SStructFACZeroAMRVectorData(HYPRE_SStructVector b, * (Optional) Set maximum number of FAC levels. **/ HYPRE_Int -HYPRE_SStructFACSetMaxLevels( HYPRE_SStructSolver solver , +HYPRE_SStructFACSetMaxLevels( HYPRE_SStructSolver solver, HYPRE_Int max_levels ); /** * (Optional) Set the convergence tolerance. @@ -626,7 +618,7 @@ HYPRE_SStructMaxwellSetGrad(HYPRE_SStructSolver solver, **/ HYPRE_Int HYPRE_SStructMaxwellSetRfactors(HYPRE_SStructSolver solver, - HYPRE_Int rfactors[HYPRE_MAXDIM]); + HYPRE_Int *rfactors); /** * Finds the physical boundary row ranks on all levels. @@ -634,7 +626,7 @@ HYPRE_SStructMaxwellSetRfactors(HYPRE_SStructSolver solver, HYPRE_Int HYPRE_SStructMaxwellPhysBdy(HYPRE_SStructGrid *grid_l, HYPRE_Int num_levels, - HYPRE_Int rfactors[HYPRE_MAXDIM], + HYPRE_Int *rfactors, HYPRE_Int ***BdryRanks_ptr, HYPRE_Int **BdryRanksCnt_ptr ); @@ -735,7 +727,7 @@ HYPRE_SStructMaxwellGetFinalRelativeResidualNorm(HYPRE_SStructSolver solver, /** * @name SStruct PCG Solver - * + * * These routines should be used in conjunction with the generic interface in * \ref KrylovSolvers. * @@ -1074,7 +1066,7 @@ HYPRE_SStructLGMRESSetup(HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x); - + HYPRE_Int HYPRE_SStructLGMRESSolve(HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, diff --git a/external/hypre/src/sstruct_ls/HYPRE_sstruct_maxwell.c b/external/hypre/src/sstruct_ls/HYPRE_sstruct_maxwell.c index 8cb83bd4..02de0441 100644 --- a/external/hypre/src/sstruct_ls/HYPRE_sstruct_maxwell.c +++ b/external/hypre/src/sstruct_ls/HYPRE_sstruct_maxwell.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -32,7 +32,7 @@ HYPRE_SStructMaxwellCreate(MPI_Comm comm, HYPRE_SStructSolver *solver) HYPRE_Int HYPRE_SStructMaxwellDestroy(HYPRE_SStructSolver solver) { - return( hypre_MaxwellTVDestroy( (void *) solver ) ); + return ( hypre_MaxwellTVDestroy( (void *) solver ) ); } /*-------------------------------------------------------------------------- @@ -45,10 +45,10 @@ HYPRE_SStructMaxwellSetup( HYPRE_SStructSolver solver, HYPRE_SStructVector b, HYPRE_SStructVector x ) { - return( hypre_MaxwellTV_Setup( (void *) solver, - (hypre_SStructMatrix *) A, - (hypre_SStructVector *) b, - (hypre_SStructVector *) x )); + return ( hypre_MaxwellTV_Setup( (void *) solver, + (hypre_SStructMatrix *) A, + (hypre_SStructVector *) b, + (hypre_SStructVector *) x )); } /*-------------------------------------------------------------------------- @@ -61,10 +61,10 @@ HYPRE_SStructMaxwellSolve( HYPRE_SStructSolver solver, HYPRE_SStructVector b, HYPRE_SStructVector x ) { - return( hypre_MaxwellSolve( (void *) solver, - (hypre_SStructMatrix *) A, - (hypre_SStructVector *) b, - (hypre_SStructVector *) x ) ); + return ( hypre_MaxwellSolve( (void *) solver, + (hypre_SStructMatrix *) A, + (hypre_SStructVector *) b, + (hypre_SStructVector *) x ) ); } /*-------------------------------------------------------------------------- @@ -77,10 +77,10 @@ HYPRE_SStructMaxwellSolve2( HYPRE_SStructSolver solver, HYPRE_SStructVector b, HYPRE_SStructVector x ) { - return( hypre_MaxwellSolve2( (void *) solver, - (hypre_SStructMatrix *) A, - (hypre_SStructVector *) b, - (hypre_SStructVector *) x ) ); + return ( hypre_MaxwellSolve2( (void *) solver, + (hypre_SStructMatrix *) A, + (hypre_SStructVector *) b, + (hypre_SStructVector *) x ) ); } /*-------------------------------------------------------------------------- @@ -91,8 +91,8 @@ HYPRE_MaxwellGrad( HYPRE_SStructGrid grid, HYPRE_ParCSRMatrix *T ) { - *T= ( (HYPRE_ParCSRMatrix) hypre_Maxwell_Grad( (hypre_SStructGrid *) grid)); - return 0; + *T = ( (HYPRE_ParCSRMatrix) hypre_Maxwell_Grad( (hypre_SStructGrid *) grid)); + return 0; } /*-------------------------------------------------------------------------- @@ -102,8 +102,8 @@ HYPRE_Int HYPRE_SStructMaxwellSetGrad( HYPRE_SStructSolver solver, HYPRE_ParCSRMatrix T ) { - return( hypre_MaxwellSetGrad( (void *) solver, - (hypre_ParCSRMatrix *) T) ); + return ( hypre_MaxwellSetGrad( (void *) solver, + (hypre_ParCSRMatrix *) T) ); } /*-------------------------------------------------------------------------- @@ -111,10 +111,10 @@ HYPRE_SStructMaxwellSetGrad( HYPRE_SStructSolver solver, *--------------------------------------------------------------------------*/ HYPRE_Int HYPRE_SStructMaxwellSetRfactors( HYPRE_SStructSolver solver, - HYPRE_Int rfactors[3] ) + HYPRE_Int *rfactors ) { - return( hypre_MaxwellSetRfactors( (void *) solver, - rfactors ) ); + return ( hypre_MaxwellSetRfactors( (void *) solver, + rfactors ) ); } /*-------------------------------------------------------------------------- @@ -124,7 +124,7 @@ HYPRE_Int HYPRE_SStructMaxwellSetTol( HYPRE_SStructSolver solver, HYPRE_Real tol ) { - return( hypre_MaxwellSetTol( (void *) solver, tol ) ); + return ( hypre_MaxwellSetTol( (void *) solver, tol ) ); } /*-------------------------------------------------------------------------- @@ -134,7 +134,7 @@ HYPRE_Int HYPRE_SStructMaxwellSetConstantCoef( HYPRE_SStructSolver solver, HYPRE_Int constant_coef) { - return( hypre_MaxwellSetConstantCoef( (void *) solver, constant_coef) ); + return ( hypre_MaxwellSetConstantCoef( (void *) solver, constant_coef) ); } /*-------------------------------------------------------------------------- @@ -144,7 +144,7 @@ HYPRE_Int HYPRE_SStructMaxwellSetMaxIter( HYPRE_SStructSolver solver, HYPRE_Int max_iter ) { - return( hypre_MaxwellSetMaxIter( (void *) solver, max_iter ) ); + return ( hypre_MaxwellSetMaxIter( (void *) solver, max_iter ) ); } /*-------------------------------------------------------------------------- @@ -154,7 +154,7 @@ HYPRE_Int HYPRE_SStructMaxwellSetRelChange( HYPRE_SStructSolver solver, HYPRE_Int rel_change ) { - return( hypre_MaxwellSetRelChange( (void *) solver, rel_change ) ); + return ( hypre_MaxwellSetRelChange( (void *) solver, rel_change ) ); } /*-------------------------------------------------------------------------- @@ -164,7 +164,7 @@ HYPRE_Int HYPRE_SStructMaxwellSetNumPreRelax( HYPRE_SStructSolver solver, HYPRE_Int num_pre_relax ) { - return( hypre_MaxwellSetNumPreRelax( (void *) solver, num_pre_relax) ); + return ( hypre_MaxwellSetNumPreRelax( (void *) solver, num_pre_relax) ); } /*-------------------------------------------------------------------------- @@ -174,7 +174,7 @@ HYPRE_Int HYPRE_SStructMaxwellSetNumPostRelax( HYPRE_SStructSolver solver, HYPRE_Int num_post_relax ) { - return( hypre_MaxwellSetNumPostRelax( (void *) solver, num_post_relax) ); + return ( hypre_MaxwellSetNumPostRelax( (void *) solver, num_post_relax) ); } /*-------------------------------------------------------------------------- @@ -184,7 +184,7 @@ HYPRE_Int HYPRE_SStructMaxwellSetLogging( HYPRE_SStructSolver solver, HYPRE_Int logging ) { - return( hypre_MaxwellSetLogging( (void *) solver, logging) ); + return ( hypre_MaxwellSetLogging( (void *) solver, logging) ); } /*-------------------------------------------------------------------------- @@ -194,7 +194,7 @@ HYPRE_Int HYPRE_SStructMaxwellSetPrintLevel( HYPRE_SStructSolver solver, HYPRE_Int print_level ) { - return( hypre_MaxwellSetPrintLevel( (void *) solver, print_level) ); + return ( hypre_MaxwellSetPrintLevel( (void *) solver, print_level) ); } /*-------------------------------------------------------------------------- @@ -204,7 +204,7 @@ HYPRE_Int HYPRE_SStructMaxwellPrintLogging( HYPRE_SStructSolver solver, HYPRE_Int myid) { - return( hypre_MaxwellPrintLogging( (void *) solver, myid) ); + return ( hypre_MaxwellPrintLogging( (void *) solver, myid) ); } /*-------------------------------------------------------------------------- @@ -214,7 +214,7 @@ HYPRE_Int HYPRE_SStructMaxwellGetNumIterations( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ) { - return( hypre_MaxwellGetNumIterations( (void *) solver, num_iterations ) ); + return ( hypre_MaxwellGetNumIterations( (void *) solver, num_iterations ) ); } /*-------------------------------------------------------------------------- @@ -224,7 +224,7 @@ HYPRE_Int HYPRE_SStructMaxwellGetFinalRelativeResidualNorm( HYPRE_SStructSolver solver, HYPRE_Real *norm ) { - return( hypre_MaxwellGetFinalRelativeResidualNorm( (void *) solver, norm ) ); + return ( hypre_MaxwellGetFinalRelativeResidualNorm( (void *) solver, norm ) ); } @@ -234,15 +234,15 @@ HYPRE_SStructMaxwellGetFinalRelativeResidualNorm( HYPRE_SStructSolver solver, HYPRE_Int HYPRE_SStructMaxwellPhysBdy( HYPRE_SStructGrid *grid_l, HYPRE_Int num_levels, - HYPRE_Int rfactors[3], + HYPRE_Int *rfactors, HYPRE_Int ***BdryRanks_ptr, HYPRE_Int **BdryRanksCnt_ptr ) { - return( hypre_Maxwell_PhysBdy( (hypre_SStructGrid **) grid_l, - num_levels, - rfactors, - BdryRanks_ptr, - BdryRanksCnt_ptr ) ); + return ( hypre_Maxwell_PhysBdy( (hypre_SStructGrid **) grid_l, + num_levels, + rfactors, + BdryRanks_ptr, + BdryRanksCnt_ptr ) ); } /*-------------------------------------------------------------------------- @@ -250,24 +250,24 @@ HYPRE_SStructMaxwellPhysBdy( HYPRE_SStructGrid *grid_l, *--------------------------------------------------------------------------*/ HYPRE_Int HYPRE_SStructMaxwellEliminateRowsCols( HYPRE_ParCSRMatrix parA, - HYPRE_Int nrows, - HYPRE_Int *rows ) + HYPRE_Int nrows, + HYPRE_Int *rows ) { - return( hypre_ParCSRMatrixEliminateRowsCols( (hypre_ParCSRMatrix *) parA, - nrows, - rows ) ); + return ( hypre_ParCSRMatrixEliminateRowsCols( (hypre_ParCSRMatrix *) parA, + nrows, + rows ) ); } /*-------------------------------------------------------------------------- * HYPRE_SStructMaxwellZeroVector *--------------------------------------------------------------------------*/ HYPRE_Int HYPRE_SStructMaxwellZeroVector(HYPRE_ParVector v, - HYPRE_Int *rows, - HYPRE_Int nrows) + HYPRE_Int *rows, + HYPRE_Int nrows) { - return( hypre_ParVectorZeroBCValues( (hypre_ParVector *) v, - rows, - nrows ) ); + return ( hypre_ParVectorZeroBCValues( (hypre_ParVector *) v, + rows, + nrows ) ); } diff --git a/external/hypre/src/sstruct_ls/HYPRE_sstruct_pcg.c b/external/hypre/src/sstruct_ls/HYPRE_sstruct_pcg.c index 3dce3919..24174d4a 100644 --- a/external/hypre/src/sstruct_ls/HYPRE_sstruct_pcg.c +++ b/external/hypre/src/sstruct_ls/HYPRE_sstruct_pcg.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -14,6 +14,8 @@ HYPRE_Int HYPRE_SStructPCGCreate( MPI_Comm comm, HYPRE_SStructSolver *solver ) { + HYPRE_UNUSED_VAR(comm); + hypre_PCGFunctions * pcg_functions = hypre_PCGFunctionsCreate( hypre_SStructKrylovCAlloc, hypre_SStructKrylovFree, hypre_SStructKrylovCommInfo, @@ -33,40 +35,40 @@ HYPRE_SStructPCGCreate( MPI_Comm comm, /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_SStructPCGDestroy( HYPRE_SStructSolver solver ) { - return( hypre_PCGDestroy( (void *) solver ) ); + return ( hypre_PCGDestroy( (void *) solver ) ); } /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_SStructPCGSetup( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ) { - return( HYPRE_PCGSetup( (HYPRE_Solver) solver, - (HYPRE_Matrix) A, - (HYPRE_Vector) b, - (HYPRE_Vector) x ) ); + return ( HYPRE_PCGSetup( (HYPRE_Solver) solver, + (HYPRE_Matrix) A, + (HYPRE_Vector) b, + (HYPRE_Vector) x ) ); } /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_SStructPCGSolve( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ) { - return( HYPRE_PCGSolve( (HYPRE_Solver) solver, - (HYPRE_Matrix) A, - (HYPRE_Vector) b, - (HYPRE_Vector) x ) ); + return ( HYPRE_PCGSolve( (HYPRE_Solver) solver, + (HYPRE_Matrix) A, + (HYPRE_Vector) b, + (HYPRE_Vector) x ) ); } /*-------------------------------------------------------------------------- @@ -76,7 +78,7 @@ HYPRE_Int HYPRE_SStructPCGSetTol( HYPRE_SStructSolver solver, HYPRE_Real tol ) { - return( HYPRE_PCGSetTol( (HYPRE_Solver) solver, tol ) ); + return ( HYPRE_PCGSetTol( (HYPRE_Solver) solver, tol ) ); } /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ @@ -85,7 +87,7 @@ HYPRE_Int HYPRE_SStructPCGSetAbsoluteTol( HYPRE_SStructSolver solver, HYPRE_Real tol ) { - return( HYPRE_PCGSetAbsoluteTol( (HYPRE_Solver) solver, tol ) ); + return ( HYPRE_PCGSetAbsoluteTol( (HYPRE_Solver) solver, tol ) ); } /*-------------------------------------------------------------------------- @@ -95,7 +97,7 @@ HYPRE_Int HYPRE_SStructPCGSetMaxIter( HYPRE_SStructSolver solver, HYPRE_Int max_iter ) { - return( HYPRE_PCGSetMaxIter( (HYPRE_Solver) solver, max_iter ) ); + return ( HYPRE_PCGSetMaxIter( (HYPRE_Solver) solver, max_iter ) ); } /*-------------------------------------------------------------------------- @@ -105,7 +107,7 @@ HYPRE_Int HYPRE_SStructPCGSetTwoNorm( HYPRE_SStructSolver solver, HYPRE_Int two_norm ) { - return( HYPRE_PCGSetTwoNorm( (HYPRE_Solver) solver, two_norm ) ); + return ( HYPRE_PCGSetTwoNorm( (HYPRE_Solver) solver, two_norm ) ); } /*-------------------------------------------------------------------------- @@ -115,7 +117,7 @@ HYPRE_Int HYPRE_SStructPCGSetRelChange( HYPRE_SStructSolver solver, HYPRE_Int rel_change ) { - return( HYPRE_PCGSetRelChange( (HYPRE_Solver) solver, rel_change ) ); + return ( HYPRE_PCGSetRelChange( (HYPRE_Solver) solver, rel_change ) ); } /*-------------------------------------------------------------------------- @@ -127,10 +129,10 @@ HYPRE_SStructPCGSetPrecond( HYPRE_SStructSolver solver, HYPRE_PtrToSStructSolverFcn precond_setup, void *precond_data ) { - return( HYPRE_PCGSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) precond, - (HYPRE_PtrToSolverFcn) precond_setup, - (HYPRE_Solver) precond_data ) ); + return ( HYPRE_PCGSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) precond, + (HYPRE_PtrToSolverFcn) precond_setup, + (HYPRE_Solver) precond_data ) ); } /*-------------------------------------------------------------------------- @@ -140,7 +142,7 @@ HYPRE_Int HYPRE_SStructPCGSetLogging( HYPRE_SStructSolver solver, HYPRE_Int logging ) { - return( HYPRE_PCGSetLogging( (HYPRE_Solver) solver, logging ) ); + return ( HYPRE_PCGSetLogging( (HYPRE_Solver) solver, logging ) ); } @@ -149,9 +151,9 @@ HYPRE_SStructPCGSetLogging( HYPRE_SStructSolver solver, HYPRE_Int HYPRE_SStructPCGSetPrintLevel( HYPRE_SStructSolver solver, - HYPRE_Int level ) + HYPRE_Int level ) { - return( HYPRE_PCGSetPrintLevel( (HYPRE_Solver) solver, level ) ); + return ( HYPRE_PCGSetPrintLevel( (HYPRE_Solver) solver, level ) ); } /*-------------------------------------------------------------------------- @@ -161,7 +163,7 @@ HYPRE_Int HYPRE_SStructPCGGetNumIterations( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ) { - return( HYPRE_PCGGetNumIterations( (HYPRE_Solver) solver, num_iterations ) ); + return ( HYPRE_PCGGetNumIterations( (HYPRE_Solver) solver, num_iterations ) ); } /*-------------------------------------------------------------------------- @@ -171,7 +173,7 @@ HYPRE_Int HYPRE_SStructPCGGetFinalRelativeResidualNorm( HYPRE_SStructSolver solver, HYPRE_Real *norm ) { - return( HYPRE_PCGGetFinalRelativeResidualNorm( (HYPRE_Solver) solver, norm ) ); + return ( HYPRE_PCGGetFinalRelativeResidualNorm( (HYPRE_Solver) solver, norm ) ); } /*-------------------------------------------------------------------------- @@ -179,9 +181,9 @@ HYPRE_SStructPCGGetFinalRelativeResidualNorm( HYPRE_SStructSolver solver, HYPRE_Int HYPRE_SStructPCGGetResidual( HYPRE_SStructSolver solver, - void **residual ) + void **residual ) { - return( HYPRE_PCGGetResidual( (HYPRE_Solver) solver, residual ) ); + return ( HYPRE_PCGGetResidual( (HYPRE_Solver) solver, residual ) ); } /*-------------------------------------------------------------------------- @@ -193,11 +195,11 @@ HYPRE_SStructDiagScaleSetup( HYPRE_SStructSolver solver, HYPRE_SStructVector y, HYPRE_SStructVector x ) { - - return( HYPRE_StructDiagScaleSetup( (HYPRE_StructSolver) solver, - (HYPRE_StructMatrix) A, - (HYPRE_StructVector) y, - (HYPRE_StructVector) x ) ); + + return ( HYPRE_StructDiagScaleSetup( (HYPRE_StructSolver) solver, + (HYPRE_StructMatrix) A, + (HYPRE_StructVector) y, + (HYPRE_StructVector) x ) ); } /*-------------------------------------------------------------------------- @@ -209,7 +211,7 @@ HYPRE_SStructDiagScale( HYPRE_SStructSolver solver, HYPRE_SStructVector y, HYPRE_SStructVector x ) { - HYPRE_Int nparts= hypre_SStructMatrixNParts(A); + HYPRE_Int nparts = hypre_SStructMatrixNParts(A); hypre_SStructPMatrix *pA; hypre_SStructPVector *px; @@ -226,13 +228,13 @@ HYPRE_SStructDiagScale( HYPRE_SStructSolver solver, pA = hypre_SStructMatrixPMatrix(A, part); px = hypre_SStructVectorPVector(x, part); py = hypre_SStructVectorPVector(y, part); - nvars= hypre_SStructPMatrixNVars(pA); + nvars = hypre_SStructPMatrixNVars(pA); for (vi = 0; vi < nvars; vi++) { sA = hypre_SStructPMatrixSMatrix(pA, vi, vi); sx = hypre_SStructPVectorSVector(px, vi); sy = hypre_SStructPVectorSVector(py, vi); - + HYPRE_StructDiagScale( (HYPRE_StructSolver) solver, (HYPRE_StructMatrix) sA, (HYPRE_StructVector) sy, @@ -242,6 +244,3 @@ HYPRE_SStructDiagScale( HYPRE_SStructSolver solver, return hypre_error_flag; } - - - diff --git a/external/hypre/src/sstruct_ls/HYPRE_sstruct_split.c b/external/hypre/src/sstruct_ls/HYPRE_sstruct_split.c index ead04af6..f0f7f293 100644 --- a/external/hypre/src/sstruct_ls/HYPRE_sstruct_split.c +++ b/external/hypre/src/sstruct_ls/HYPRE_sstruct_split.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -20,6 +20,9 @@ #include "_hypre_sstruct_ls.h" +typedef HYPRE_Int (*HYPRE_PtrToVoid1Fcn)(void*); +typedef HYPRE_Int (*HYPRE_PtrToVoid4Fcn)(void*, void*, void*, void*); + /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ @@ -32,8 +35,8 @@ typedef struct hypre_SStructSolver_struct void ****smatvec_data; - HYPRE_Int (***ssolver_solve)(); - HYPRE_Int (***ssolver_destroy)(); + HYPRE_PtrToVoid1Fcn **ssolver_destroy; + HYPRE_PtrToVoid4Fcn **ssolver_solve; void ***ssolver_data; HYPRE_Real tol; @@ -54,6 +57,8 @@ HYPRE_Int HYPRE_SStructSplitCreate( MPI_Comm comm, HYPRE_SStructSolver *solver_ptr ) { + HYPRE_UNUSED_VAR(comm); + hypre_SStructSolver *solver; solver = hypre_TAlloc(hypre_SStructSolver, 1, HYPRE_MEMORY_HOST); @@ -81,18 +86,18 @@ HYPRE_SStructSplitCreate( MPI_Comm comm, /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_SStructSplitDestroy( HYPRE_SStructSolver solver ) { hypre_SStructVector *y; HYPRE_Int nparts; HYPRE_Int *nvars; void ****smatvec_data; - HYPRE_Int (***ssolver_solve)(); - HYPRE_Int (***ssolver_destroy)(); + HYPRE_PtrToVoid4Fcn **ssolver_solve; + HYPRE_PtrToVoid1Fcn **ssolver_destroy; void ***ssolver_data; - HYPRE_Int (*sdestroy)(void *); + HYPRE_PtrToVoid1Fcn sdestroy; void *sdata; HYPRE_Int part, vi, vj; @@ -120,7 +125,7 @@ HYPRE_SStructSplitDestroy( HYPRE_SStructSolver solver ) } } hypre_TFree(smatvec_data[part][vi], HYPRE_MEMORY_HOST); - sdestroy = (HYPRE_Int (*)(void *))ssolver_destroy[part][vi]; + sdestroy = ssolver_destroy[part][vi]; sdata = ssolver_data[part][vi]; sdestroy(sdata); } @@ -144,20 +149,20 @@ HYPRE_SStructSplitDestroy( HYPRE_SStructSolver solver ) /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_SStructSplitSetup( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ) { + HYPRE_Int ssolver = (solver -> ssolver); hypre_SStructVector *y; HYPRE_Int nparts; HYPRE_Int *nvars; void ****smatvec_data; - HYPRE_Int (***ssolver_solve)(); - HYPRE_Int (***ssolver_destroy)(); + HYPRE_PtrToVoid4Fcn **ssolver_solve; + HYPRE_PtrToVoid1Fcn **ssolver_destroy; void ***ssolver_data; - HYPRE_Int ssolver = (solver -> ssolver); MPI_Comm comm; hypre_SStructGrid *grid; @@ -170,8 +175,9 @@ HYPRE_SStructSplitSetup( HYPRE_SStructSolver solver, HYPRE_StructMatrix sAH; HYPRE_StructVector sxH; HYPRE_StructVector syH; - HYPRE_Int (*ssolve)(); - HYPRE_Int (*sdestroy)(); + + HYPRE_PtrToVoid4Fcn ssolve; + HYPRE_PtrToVoid1Fcn sdestroy; void *sdata; HYPRE_Int part, vi, vj; @@ -183,11 +189,13 @@ HYPRE_SStructSplitSetup( HYPRE_SStructSolver solver, HYPRE_SStructVectorAssemble(y); nparts = hypre_SStructMatrixNParts(A); - nvars = hypre_TAlloc(HYPRE_Int, nparts, HYPRE_MEMORY_HOST); - smatvec_data = hypre_TAlloc(void ***, nparts, HYPRE_MEMORY_HOST); - ssolver_solve = (HYPRE_Int (***)()) hypre_MAlloc((sizeof(HYPRE_Int (**)()) * nparts), HYPRE_MEMORY_HOST); - ssolver_destroy = (HYPRE_Int (***)()) hypre_MAlloc((sizeof(HYPRE_Int (**)()) * nparts), HYPRE_MEMORY_HOST); - ssolver_data = hypre_TAlloc(void **, nparts, HYPRE_MEMORY_HOST); + nvars = hypre_TAlloc(HYPRE_Int, nparts, HYPRE_MEMORY_HOST); + + smatvec_data = hypre_TAlloc(void***, nparts, HYPRE_MEMORY_HOST); + ssolver_solve = hypre_TAlloc(HYPRE_PtrToVoid4Fcn*, nparts, HYPRE_MEMORY_HOST); + ssolver_destroy = hypre_TAlloc(HYPRE_PtrToVoid1Fcn*, nparts, HYPRE_MEMORY_HOST); + ssolver_data = hypre_TAlloc(void**, nparts, HYPRE_MEMORY_HOST); + for (part = 0; part < nparts; part++) { pA = hypre_SStructMatrixPMatrix(A, part); @@ -195,15 +203,13 @@ HYPRE_SStructSplitSetup( HYPRE_SStructSolver solver, py = hypre_SStructVectorPVector(y, part); nvars[part] = hypre_SStructPMatrixNVars(pA); - smatvec_data[part] = hypre_TAlloc(void **, nvars[part], HYPRE_MEMORY_HOST); - ssolver_solve[part] = - (HYPRE_Int (**)()) hypre_MAlloc((sizeof(HYPRE_Int (*)()) * nvars[part]), HYPRE_MEMORY_HOST); - ssolver_destroy[part] = - (HYPRE_Int (**)()) hypre_MAlloc((sizeof(HYPRE_Int (*)()) * nvars[part]), HYPRE_MEMORY_HOST); - ssolver_data[part] = hypre_TAlloc(void *, nvars[part], HYPRE_MEMORY_HOST); + smatvec_data[part] = hypre_TAlloc(void**, nvars[part], HYPRE_MEMORY_HOST); + ssolver_solve[part] = hypre_TAlloc(HYPRE_PtrToVoid4Fcn, nvars[part], HYPRE_MEMORY_HOST); + ssolver_destroy[part] = hypre_TAlloc(HYPRE_PtrToVoid1Fcn, nvars[part], HYPRE_MEMORY_HOST); + ssolver_data[part] = hypre_TAlloc(void*, nvars[part], HYPRE_MEMORY_HOST); for (vi = 0; vi < nvars[part]; vi++) { - smatvec_data[part][vi] = hypre_TAlloc(void *, nvars[part], HYPRE_MEMORY_HOST); + smatvec_data[part][vi] = hypre_TAlloc(void*, nvars[part], HYPRE_MEMORY_HOST); for (vj = 0; vj < nvars[part]; vj++) { sA = hypre_SStructPMatrixSMatrix(pA, vi, vj); @@ -222,14 +228,16 @@ HYPRE_SStructSplitSetup( HYPRE_SStructSolver solver, sAH = (HYPRE_StructMatrix) sA; sxH = (HYPRE_StructVector) sx; syH = (HYPRE_StructVector) sy; - switch(ssolver) + switch (ssolver) { default: /* If no solver is matched, use Jacobi, but throw and error */ if (ssolver != HYPRE_Jacobi) { hypre_error(HYPRE_ERROR_GENERIC); - } /* don't break */ + } + /* fall through */ + case HYPRE_Jacobi: HYPRE_StructJacobiCreate(comm, (HYPRE_StructSolver *)&sdata); HYPRE_StructJacobiSetMaxIter((HYPRE_StructSolver)sdata, 1); @@ -239,9 +247,10 @@ HYPRE_SStructSplitSetup( HYPRE_SStructSolver solver, HYPRE_StructJacobiSetZeroGuess((HYPRE_StructSolver)sdata); } HYPRE_StructJacobiSetup((HYPRE_StructSolver)sdata, sAH, syH, sxH); - ssolve = (HYPRE_Int (*)())HYPRE_StructJacobiSolve; - sdestroy = (HYPRE_Int (*)())HYPRE_StructJacobiDestroy; + ssolve = (HYPRE_PtrToVoid4Fcn) HYPRE_StructJacobiSolve; + sdestroy = (HYPRE_PtrToVoid1Fcn) HYPRE_StructJacobiDestroy; break; + case HYPRE_SMG: HYPRE_StructSMGCreate(comm, (HYPRE_StructSolver *)&sdata); HYPRE_StructSMGSetMemoryUse((HYPRE_StructSolver)sdata, 0); @@ -256,9 +265,10 @@ HYPRE_SStructSplitSetup( HYPRE_SStructSolver solver, HYPRE_StructSMGSetLogging((HYPRE_StructSolver)sdata, 0); HYPRE_StructSMGSetPrintLevel((HYPRE_StructSolver)sdata, 0); HYPRE_StructSMGSetup((HYPRE_StructSolver)sdata, sAH, syH, sxH); - ssolve = (HYPRE_Int (*)())HYPRE_StructSMGSolve; - sdestroy = (HYPRE_Int (*)())HYPRE_StructSMGDestroy; + ssolve = (HYPRE_PtrToVoid4Fcn) HYPRE_StructSMGSolve; + sdestroy = (HYPRE_PtrToVoid1Fcn) HYPRE_StructSMGDestroy; break; + case HYPRE_PFMG: HYPRE_StructPFMGCreate(comm, (HYPRE_StructSolver *)&sdata); HYPRE_StructPFMGSetMaxIter((HYPRE_StructSolver)sdata, 1); @@ -273,8 +283,8 @@ HYPRE_SStructSplitSetup( HYPRE_SStructSolver solver, HYPRE_StructPFMGSetLogging((HYPRE_StructSolver)sdata, 0); HYPRE_StructPFMGSetPrintLevel((HYPRE_StructSolver)sdata, 0); HYPRE_StructPFMGSetup((HYPRE_StructSolver)sdata, sAH, syH, sxH); - ssolve = (HYPRE_Int (*)())HYPRE_StructPFMGSolve; - sdestroy = (HYPRE_Int (*)())HYPRE_StructPFMGDestroy; + ssolve = (HYPRE_PtrToVoid4Fcn) HYPRE_StructPFMGSolve; + sdestroy = (HYPRE_PtrToVoid1Fcn) HYPRE_StructPFMGDestroy; break; } ssolver_solve[part][vi] = ssolve; @@ -302,22 +312,22 @@ HYPRE_SStructSplitSetup( HYPRE_SStructSolver solver, /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_SStructSplitSolve( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ) { - hypre_SStructVector *y = (solver -> y); - HYPRE_Int nparts = (solver -> nparts); - HYPRE_Int *nvars = (solver -> nvars); - void ****smatvec_data = (solver -> smatvec_data); - HYPRE_Int (***ssolver_solve)() = (solver -> ssolver_solve); - void ***ssolver_data = (solver -> ssolver_data); - HYPRE_Real tol = (solver -> tol); - HYPRE_Int max_iter = (solver -> max_iter); - HYPRE_Int zero_guess = (solver -> zero_guess); - void *matvec_data = (solver -> matvec_data); + hypre_SStructVector *y = (solver -> y); + HYPRE_Int nparts = (solver -> nparts); + HYPRE_Int *nvars = (solver -> nvars); + void ****smatvec_data = (solver -> smatvec_data); + HYPRE_PtrToVoid4Fcn **ssolver_solve = (solver -> ssolver_solve); + void ***ssolver_data = (solver -> ssolver_data); + HYPRE_Real tol = (solver -> tol); + HYPRE_Int max_iter = (solver -> max_iter); + HYPRE_Int zero_guess = (solver -> zero_guess); + void *matvec_data = (solver -> matvec_data); hypre_SStructPMatrix *pA; hypre_SStructPVector *px; @@ -325,7 +335,8 @@ HYPRE_SStructSplitSolve( HYPRE_SStructSolver solver, hypre_StructMatrix *sA; hypre_StructVector *sx; hypre_StructVector *sy; - HYPRE_Int (*ssolve)(void*, hypre_StructMatrix*,hypre_StructVector*,hypre_StructVector*); + + HYPRE_PtrToVoid4Fcn ssolve; void *sdata; hypre_ParCSRMatrix *parcsrA; hypre_ParVector *parx; @@ -334,8 +345,6 @@ HYPRE_SStructSplitSolve( HYPRE_SStructSolver solver, HYPRE_Int iter, part, vi, vj; HYPRE_Real b_dot_b = 0, r_dot_r; - - /* part of convergence check */ if (tol > 0.0) { @@ -361,7 +370,7 @@ HYPRE_SStructSplitSolve( HYPRE_SStructSolver solver, hypre_SStructCopy(b, y); hypre_SStructMatvecCompute(matvec_data, -1.0, A, x, 1.0, y); hypre_SStructInnerProd(y, y, &r_dot_r); - (solver -> rel_norm) = sqrt(r_dot_r/b_dot_b); + (solver -> rel_norm) = hypre_sqrt(r_dot_r / b_dot_b); if ((solver -> rel_norm) < tol) { @@ -411,12 +420,13 @@ HYPRE_SStructSplitSolve( HYPRE_SStructSolver solver, py = hypre_SStructVectorPVector(y, part); for (vi = 0; vi < nvars[part]; vi++) { - ssolve = (HYPRE_Int (*)(void *, hypre_StructMatrix *, hypre_StructVector *, hypre_StructVector *))ssolver_solve[part][vi]; + ssolve = ssolver_solve[part][vi]; sdata = ssolver_data[part][vi]; sA = hypre_SStructPMatrixSMatrix(pA, vi, vi); sx = hypre_SStructPVectorSVector(px, vi); sy = hypre_SStructPVectorSVector(py, vi); - ssolve(sdata, sA, sy, sx); + + ssolve(sdata, (void*) sA, (void*) sy, (void*) sx); } } } diff --git a/external/hypre/src/sstruct_ls/HYPRE_sstruct_sys_pfmg.c b/external/hypre/src/sstruct_ls/HYPRE_sstruct_sys_pfmg.c index 040ddfc0..5fdd8f56 100644 --- a/external/hypre/src/sstruct_ls/HYPRE_sstruct_sys_pfmg.c +++ b/external/hypre/src/sstruct_ls/HYPRE_sstruct_sys_pfmg.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -21,40 +21,40 @@ HYPRE_SStructSysPFMGCreate( MPI_Comm comm, HYPRE_SStructSolver *solver ) /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_SStructSysPFMGDestroy( HYPRE_SStructSolver solver ) { - return( hypre_SysPFMGDestroy( (void *) solver ) ); + return ( hypre_SysPFMGDestroy( (void *) solver ) ); } /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_SStructSysPFMGSetup( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ) { - return( hypre_SysPFMGSetup( (void *) solver, - (hypre_SStructMatrix *) A, - (hypre_SStructVector *) b, - (hypre_SStructVector *) x ) ); + return ( hypre_SysPFMGSetup( (void *) solver, + (hypre_SStructMatrix *) A, + (hypre_SStructVector *) b, + (hypre_SStructVector *) x ) ); } /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_SStructSysPFMGSolve( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ) { - return( hypre_SysPFMGSolve( (void *) solver, - (hypre_SStructMatrix *) A, - (hypre_SStructVector *) b, - (hypre_SStructVector *) x ) ); + return ( hypre_SysPFMGSolve( (void *) solver, + (hypre_SStructMatrix *) A, + (hypre_SStructVector *) b, + (hypre_SStructVector *) x ) ); } /*-------------------------------------------------------------------------- @@ -64,7 +64,7 @@ HYPRE_Int HYPRE_SStructSysPFMGSetTol( HYPRE_SStructSolver solver, HYPRE_Real tol ) { - return( hypre_SysPFMGSetTol( (void *) solver, tol ) ); + return ( hypre_SysPFMGSetTol( (void *) solver, tol ) ); } /*-------------------------------------------------------------------------- @@ -74,7 +74,7 @@ HYPRE_Int HYPRE_SStructSysPFMGSetMaxIter( HYPRE_SStructSolver solver, HYPRE_Int max_iter ) { - return( hypre_SysPFMGSetMaxIter( (void *) solver, max_iter ) ); + return ( hypre_SysPFMGSetMaxIter( (void *) solver, max_iter ) ); } /*-------------------------------------------------------------------------- @@ -84,25 +84,25 @@ HYPRE_Int HYPRE_SStructSysPFMGSetRelChange( HYPRE_SStructSolver solver, HYPRE_Int rel_change ) { - return( hypre_SysPFMGSetRelChange( (void *) solver, rel_change ) ); + return ( hypre_SysPFMGSetRelChange( (void *) solver, rel_change ) ); } /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ - + HYPRE_Int HYPRE_SStructSysPFMGSetZeroGuess( HYPRE_SStructSolver solver ) { - return( hypre_SysPFMGSetZeroGuess( (void *) solver, 1 ) ); + return ( hypre_SysPFMGSetZeroGuess( (void *) solver, 1 ) ); } /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ - + HYPRE_Int HYPRE_SStructSysPFMGSetNonZeroGuess( HYPRE_SStructSolver solver ) { - return( hypre_SysPFMGSetZeroGuess( (void *) solver, 0 ) ); + return ( hypre_SysPFMGSetZeroGuess( (void *) solver, 0 ) ); } /*-------------------------------------------------------------------------- @@ -112,17 +112,17 @@ HYPRE_Int HYPRE_SStructSysPFMGSetRelaxType( HYPRE_SStructSolver solver, HYPRE_Int relax_type ) { - return( hypre_SysPFMGSetRelaxType( (void *) solver, relax_type) ); + return ( hypre_SysPFMGSetRelaxType( (void *) solver, relax_type) ); } /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ - + HYPRE_Int HYPRE_SStructSysPFMGSetJacobiWeight(HYPRE_SStructSolver solver, HYPRE_Real weight) { - return( hypre_SysPFMGSetJacobiWeight( (void *) solver, weight) ); + return ( hypre_SysPFMGSetJacobiWeight( (void *) solver, weight) ); } /*-------------------------------------------------------------------------- @@ -132,7 +132,7 @@ HYPRE_Int HYPRE_SStructSysPFMGSetNumPreRelax( HYPRE_SStructSolver solver, HYPRE_Int num_pre_relax ) { - return( hypre_SysPFMGSetNumPreRelax( (void *) solver, num_pre_relax) ); + return ( hypre_SysPFMGSetNumPreRelax( (void *) solver, num_pre_relax) ); } /*-------------------------------------------------------------------------- @@ -142,7 +142,7 @@ HYPRE_Int HYPRE_SStructSysPFMGSetNumPostRelax( HYPRE_SStructSolver solver, HYPRE_Int num_post_relax ) { - return( hypre_SysPFMGSetNumPostRelax( (void *) solver, num_post_relax) ); + return ( hypre_SysPFMGSetNumPostRelax( (void *) solver, num_post_relax) ); } /*-------------------------------------------------------------------------- @@ -152,7 +152,7 @@ HYPRE_Int HYPRE_SStructSysPFMGSetSkipRelax( HYPRE_SStructSolver solver, HYPRE_Int skip_relax ) { - return( hypre_SysPFMGSetSkipRelax( (void *) solver, skip_relax) ); + return ( hypre_SysPFMGSetSkipRelax( (void *) solver, skip_relax) ); } /*-------------------------------------------------------------------------- @@ -160,9 +160,9 @@ HYPRE_SStructSysPFMGSetSkipRelax( HYPRE_SStructSolver solver, HYPRE_Int HYPRE_SStructSysPFMGSetDxyz( HYPRE_SStructSolver solver, - HYPRE_Real *dxyz ) + HYPRE_Real *dxyz ) { - return( hypre_SysPFMGSetDxyz( (void *) solver, dxyz) ); + return ( hypre_SysPFMGSetDxyz( (void *) solver, dxyz) ); } /*-------------------------------------------------------------------------- @@ -172,7 +172,7 @@ HYPRE_Int HYPRE_SStructSysPFMGSetLogging( HYPRE_SStructSolver solver, HYPRE_Int logging ) { - return( hypre_SysPFMGSetLogging( (void *) solver, logging) ); + return ( hypre_SysPFMGSetLogging( (void *) solver, logging) ); } /*-------------------------------------------------------------------------- @@ -180,9 +180,9 @@ HYPRE_SStructSysPFMGSetLogging( HYPRE_SStructSolver solver, HYPRE_Int HYPRE_SStructSysPFMGSetPrintLevel( HYPRE_SStructSolver solver, - HYPRE_Int print_level ) + HYPRE_Int print_level ) { - return( hypre_SysPFMGSetPrintLevel( (void *) solver, print_level) ); + return ( hypre_SysPFMGSetPrintLevel( (void *) solver, print_level) ); } /*-------------------------------------------------------------------------- @@ -192,7 +192,7 @@ HYPRE_Int HYPRE_SStructSysPFMGGetNumIterations( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ) { - return( hypre_SysPFMGGetNumIterations( (void *) solver, num_iterations ) ); + return ( hypre_SysPFMGGetNumIterations( (void *) solver, num_iterations ) ); } /*-------------------------------------------------------------------------- @@ -202,6 +202,6 @@ HYPRE_Int HYPRE_SStructSysPFMGGetFinalRelativeResidualNorm( HYPRE_SStructSolver solver, HYPRE_Real *norm ) { - return( hypre_SysPFMGGetFinalRelativeResidualNorm( (void *) solver, norm ) ); + return ( hypre_SysPFMGGetFinalRelativeResidualNorm( (void *) solver, norm ) ); } diff --git a/external/hypre/src/sstruct_ls/_hypre_sstruct_ls.h b/external/hypre/src/sstruct_ls/_hypre_sstruct_ls.h index 9466fab4..3aeb553c 100644 --- a/external/hypre/src/sstruct_ls/_hypre_sstruct_ls.h +++ b/external/hypre/src/sstruct_ls/_hypre_sstruct_ls.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -37,7 +37,7 @@ extern "C" { #define hypre_OWNINFODATA_HEADER -typedef struct +typedef struct { HYPRE_Int size; @@ -71,7 +71,7 @@ typedef struct #define hypre_RECVINFODATA_HEADER -typedef struct +typedef struct { HYPRE_Int size; @@ -88,7 +88,7 @@ typedef struct #define hypre_SENDINFODATA_HEADER -typedef struct +typedef struct { HYPRE_Int size; @@ -101,13 +101,13 @@ typedef struct #endif typedef struct { - hypre_IJMatrix *Face_iedge; - hypre_IJMatrix *Element_iedge; - hypre_IJMatrix *Edge_iedge; - - hypre_IJMatrix *Element_Face; - hypre_IJMatrix *Element_Edge; - + hypre_IJMatrix *Face_iedge; + hypre_IJMatrix *Element_iedge; + hypre_IJMatrix *Edge_iedge; + + hypre_IJMatrix *Element_Face; + hypre_IJMatrix *Element_Edge; + } hypre_PTopology; /****************************************************************************** @@ -126,22 +126,22 @@ typedef struct typedef struct { MPI_Comm comm; - + HYPRE_Real tol; HYPRE_Int max_iter; HYPRE_Int rel_change; HYPRE_Int zero_guess; HYPRE_Int ndim; - + HYPRE_Int num_pre_relax; /* number of pre relaxation sweeps */ HYPRE_Int num_post_relax; /* number of post relaxation sweeps */ HYPRE_Int constant_coef; - + hypre_Index *rfactor; hypre_SStructGrid **egrid_l; - + HYPRE_IJMatrix Aen; hypre_ParCSRMatrix **Aen_l; @@ -173,8 +173,8 @@ typedef struct hypre_ParCSRMatrix *T_transpose; /* edge data structure. These will have grids. */ - HYPRE_Int edge_maxlevels; - HYPRE_Int edge_numlevels; + HYPRE_Int edge_maxlevels; + HYPRE_Int edge_numlevels; hypre_ParCSRMatrix **Aee_l; hypre_ParVector **be_l; hypre_ParVector **xe_l; @@ -212,445 +212,583 @@ typedef struct typedef struct { HYPRE_Int row; - + HYPRE_Int ncols; HYPRE_BigInt *cols; HYPRE_Real *data; - + } hypre_MaxwellOffProcRow; /* eliminate_rowscols.c */ -HYPRE_Int hypre_ParCSRMatrixEliminateRowsCols ( hypre_ParCSRMatrix *A , HYPRE_Int nrows_to_eliminate , HYPRE_Int *rows_to_eliminate ); -HYPRE_Int hypre_CSRMatrixEliminateRowsColsDiag ( hypre_ParCSRMatrix *A , HYPRE_Int nrows_to_eliminate , HYPRE_Int *rows_to_eliminate ); -HYPRE_Int hypre_CSRMatrixEliminateRowsOffd ( hypre_ParCSRMatrix *A , HYPRE_Int nrows_to_eliminate , HYPRE_Int *rows_to_eliminate ); -HYPRE_Int hypre_CSRMatrixEliminateColsOffd ( hypre_CSRMatrix *Aoffd , HYPRE_Int ncols_to_eliminate , HYPRE_Int *cols_to_eliminate ); +HYPRE_Int hypre_ParCSRMatrixEliminateRowsCols ( hypre_ParCSRMatrix *A, HYPRE_Int nrows_to_eliminate, + HYPRE_Int *rows_to_eliminate ); +HYPRE_Int hypre_CSRMatrixEliminateRowsColsDiag ( hypre_ParCSRMatrix *A, + HYPRE_Int nrows_to_eliminate, HYPRE_Int *rows_to_eliminate ); +HYPRE_Int hypre_CSRMatrixEliminateRowsOffd ( hypre_ParCSRMatrix *A, HYPRE_Int nrows_to_eliminate, + HYPRE_Int *rows_to_eliminate ); +HYPRE_Int hypre_CSRMatrixEliminateColsOffd ( hypre_CSRMatrix *Aoffd, HYPRE_Int ncols_to_eliminate, + HYPRE_Int *cols_to_eliminate ); /* fac_amr_fcoarsen.c */ -HYPRE_Int hypre_AMR_FCoarsen ( hypre_SStructMatrix *A , hypre_SStructMatrix *fac_A , hypre_SStructPMatrix *A_crse , hypre_Index refine_factors , HYPRE_Int level ); +HYPRE_Int hypre_AMR_FCoarsen ( hypre_SStructMatrix *A, hypre_SStructMatrix *fac_A, + hypre_SStructPMatrix *A_crse, hypre_Index refine_factors, HYPRE_Int level ); /* fac_amr_rap.c */ -HYPRE_Int hypre_AMR_RAP ( hypre_SStructMatrix *A , hypre_Index *rfactors , hypre_SStructMatrix **fac_A_ptr ); +HYPRE_Int hypre_AMR_RAP ( hypre_SStructMatrix *A, hypre_Index *rfactors, + hypre_SStructMatrix **fac_A_ptr ); /* fac_amr_zero_data.c */ -HYPRE_Int hypre_ZeroAMRVectorData ( hypre_SStructVector *b , HYPRE_Int *plevels , hypre_Index *rfactors ); -HYPRE_Int hypre_ZeroAMRMatrixData ( hypre_SStructMatrix *A , HYPRE_Int part_crse , hypre_Index rfactors ); +HYPRE_Int hypre_ZeroAMRVectorData ( hypre_SStructVector *b, HYPRE_Int *plevels, + hypre_Index *rfactors ); +HYPRE_Int hypre_ZeroAMRMatrixData ( hypre_SStructMatrix *A, HYPRE_Int part_crse, + hypre_Index rfactors ); /* fac.c */ void *hypre_FACCreate ( MPI_Comm comm ); HYPRE_Int hypre_FACDestroy2 ( void *fac_vdata ); -HYPRE_Int hypre_FACSetTol ( void *fac_vdata , HYPRE_Real tol ); -HYPRE_Int hypre_FACSetPLevels ( void *fac_vdata , HYPRE_Int nparts , HYPRE_Int *plevels ); -HYPRE_Int hypre_FACSetPRefinements ( void *fac_vdata , HYPRE_Int nparts , hypre_Index *prefinements); -HYPRE_Int hypre_FACSetMaxLevels ( void *fac_vdata , HYPRE_Int nparts ); -HYPRE_Int hypre_FACSetMaxIter ( void *fac_vdata , HYPRE_Int max_iter ); -HYPRE_Int hypre_FACSetRelChange ( void *fac_vdata , HYPRE_Int rel_change ); -HYPRE_Int hypre_FACSetZeroGuess ( void *fac_vdata , HYPRE_Int zero_guess ); -HYPRE_Int hypre_FACSetRelaxType ( void *fac_vdata , HYPRE_Int relax_type ); -HYPRE_Int hypre_FACSetJacobiWeight ( void *fac_vdata , HYPRE_Real weight ); -HYPRE_Int hypre_FACSetNumPreSmooth ( void *fac_vdata , HYPRE_Int num_pre_smooth ); -HYPRE_Int hypre_FACSetNumPostSmooth ( void *fac_vdata , HYPRE_Int num_post_smooth ); -HYPRE_Int hypre_FACSetCoarseSolverType ( void *fac_vdata , HYPRE_Int csolver_type ); -HYPRE_Int hypre_FACSetLogging ( void *fac_vdata , HYPRE_Int logging ); -HYPRE_Int hypre_FACGetNumIterations ( void *fac_vdata , HYPRE_Int *num_iterations ); -HYPRE_Int hypre_FACPrintLogging ( void *fac_vdata , HYPRE_Int myid ); -HYPRE_Int hypre_FACGetFinalRelativeResidualNorm ( void *fac_vdata , HYPRE_Real *relative_residual_norm ); +HYPRE_Int hypre_FACSetTol ( void *fac_vdata, HYPRE_Real tol ); +HYPRE_Int hypre_FACSetPLevels ( void *fac_vdata, HYPRE_Int nparts, HYPRE_Int *plevels ); +HYPRE_Int hypre_FACSetPRefinements ( void *fac_vdata, HYPRE_Int nparts, hypre_Index *prefinements); +HYPRE_Int hypre_FACSetMaxLevels ( void *fac_vdata, HYPRE_Int nparts ); +HYPRE_Int hypre_FACSetMaxIter ( void *fac_vdata, HYPRE_Int max_iter ); +HYPRE_Int hypre_FACSetRelChange ( void *fac_vdata, HYPRE_Int rel_change ); +HYPRE_Int hypre_FACSetZeroGuess ( void *fac_vdata, HYPRE_Int zero_guess ); +HYPRE_Int hypre_FACSetRelaxType ( void *fac_vdata, HYPRE_Int relax_type ); +HYPRE_Int hypre_FACSetJacobiWeight ( void *fac_vdata, HYPRE_Real weight ); +HYPRE_Int hypre_FACSetNumPreSmooth ( void *fac_vdata, HYPRE_Int num_pre_smooth ); +HYPRE_Int hypre_FACSetNumPostSmooth ( void *fac_vdata, HYPRE_Int num_post_smooth ); +HYPRE_Int hypre_FACSetCoarseSolverType ( void *fac_vdata, HYPRE_Int csolver_type ); +HYPRE_Int hypre_FACSetLogging ( void *fac_vdata, HYPRE_Int logging ); +HYPRE_Int hypre_FACGetNumIterations ( void *fac_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int hypre_FACPrintLogging ( void *fac_vdata, HYPRE_Int myid ); +HYPRE_Int hypre_FACGetFinalRelativeResidualNorm ( void *fac_vdata, + HYPRE_Real *relative_residual_norm ); /* fac_cf_coarsen.c */ -HYPRE_Int hypre_AMR_CFCoarsen ( hypre_SStructMatrix *A , hypre_SStructMatrix *fac_A , hypre_Index refine_factors , HYPRE_Int level ); +HYPRE_Int hypre_AMR_CFCoarsen ( hypre_SStructMatrix *A, hypre_SStructMatrix *fac_A, + hypre_Index refine_factors, HYPRE_Int level ); /* fac_CFInterfaceExtents.c */ -hypre_BoxArray *hypre_CFInterfaceExtents ( hypre_Box *fgrid_box , hypre_Box *cgrid_box , hypre_StructStencil *stencils , hypre_Index rfactors ); -HYPRE_Int hypre_CFInterfaceExtents2 ( hypre_Box *fgrid_box , hypre_Box *cgrid_box , hypre_StructStencil *stencils , hypre_Index rfactors , hypre_BoxArray *cf_interface ); +hypre_BoxArray *hypre_CFInterfaceExtents ( hypre_Box *fgrid_box, hypre_Box *cgrid_box, + hypre_StructStencil *stencils, hypre_Index rfactors ); +HYPRE_Int hypre_CFInterfaceExtents2 ( hypre_Box *fgrid_box, hypre_Box *cgrid_box, + hypre_StructStencil *stencils, hypre_Index rfactors, hypre_BoxArray *cf_interface ); /* fac_cfstencil_box.c */ -hypre_Box *hypre_CF_StenBox ( hypre_Box *fgrid_box , hypre_Box *cgrid_box , hypre_Index stencil_shape , hypre_Index rfactors , HYPRE_Int ndim ); +hypre_Box *hypre_CF_StenBox ( hypre_Box *fgrid_box, hypre_Box *cgrid_box, hypre_Index stencil_shape, + hypre_Index rfactors, HYPRE_Int ndim ); /* fac_interp2.c */ HYPRE_Int hypre_FacSemiInterpCreate2 ( void **fac_interp_vdata_ptr ); HYPRE_Int hypre_FacSemiInterpDestroy2 ( void *fac_interp_vdata ); -HYPRE_Int hypre_FacSemiInterpSetup2 ( void *fac_interp_vdata , hypre_SStructVector *e , hypre_SStructPVector *ec , hypre_Index rfactors ); -HYPRE_Int hypre_FAC_IdentityInterp2 ( void *fac_interp_vdata , hypre_SStructPVector *xc , hypre_SStructVector *e ); -HYPRE_Int hypre_FAC_WeightedInterp2 ( void *fac_interp_vdata , hypre_SStructPVector *xc , hypre_SStructVector *e_parts ); +HYPRE_Int hypre_FacSemiInterpSetup2 ( void *fac_interp_vdata, hypre_SStructVector *e, + hypre_SStructPVector *ec, hypre_Index rfactors ); +HYPRE_Int hypre_FAC_IdentityInterp2 ( void *fac_interp_vdata, hypre_SStructPVector *xc, + hypre_SStructVector *e ); +HYPRE_Int hypre_FAC_WeightedInterp2 ( void *fac_interp_vdata, hypre_SStructPVector *xc, + hypre_SStructVector *e_parts ); /* fac_relax.c */ -HYPRE_Int hypre_FacLocalRelax ( void *relax_vdata , hypre_SStructPMatrix *A , hypre_SStructPVector *x , hypre_SStructPVector *b , HYPRE_Int num_relax , HYPRE_Int *zero_guess ); +HYPRE_Int hypre_FacLocalRelax ( void *relax_vdata, hypre_SStructPMatrix *A, hypre_SStructPVector *x, + hypre_SStructPVector *b, HYPRE_Int num_relax, HYPRE_Int *zero_guess ); /* fac_restrict2.c */ HYPRE_Int hypre_FacSemiRestrictCreate2 ( void **fac_restrict_vdata_ptr ); -HYPRE_Int hypre_FacSemiRestrictSetup2 ( void *fac_restrict_vdata , hypre_SStructVector *r , HYPRE_Int part_crse , HYPRE_Int part_fine , hypre_SStructPVector *rc , hypre_Index rfactors ); -HYPRE_Int hypre_FACRestrict2 ( void *fac_restrict_vdata , hypre_SStructVector *xf , hypre_SStructPVector *xc ); +HYPRE_Int hypre_FacSemiRestrictSetup2 ( void *fac_restrict_vdata, hypre_SStructVector *r, + HYPRE_Int part_crse, HYPRE_Int part_fine, hypre_SStructPVector *rc, hypre_Index rfactors ); +HYPRE_Int hypre_FACRestrict2 ( void *fac_restrict_vdata, hypre_SStructVector *xf, + hypre_SStructPVector *xc ); HYPRE_Int hypre_FacSemiRestrictDestroy2 ( void *fac_restrict_vdata ); /* fac_setup2.c */ -HYPRE_Int hypre_FacSetup2 ( void *fac_vdata , hypre_SStructMatrix *A_in , hypre_SStructVector *b , hypre_SStructVector *x ); +HYPRE_Int hypre_FacSetup2 ( void *fac_vdata, hypre_SStructMatrix *A_in, hypre_SStructVector *b, + hypre_SStructVector *x ); /* fac_solve3.c */ -HYPRE_Int hypre_FACSolve3 ( void *fac_vdata , hypre_SStructMatrix *A_user , hypre_SStructVector *b_in , hypre_SStructVector *x_in ); +HYPRE_Int hypre_FACSolve3 ( void *fac_vdata, hypre_SStructMatrix *A_user, hypre_SStructVector *b_in, + hypre_SStructVector *x_in ); /* fac_zero_cdata.c */ -HYPRE_Int hypre_FacZeroCData ( void *fac_vdata , hypre_SStructMatrix *A ); +HYPRE_Int hypre_FacZeroCData ( void *fac_vdata, hypre_SStructMatrix *A ); /* fac_zero_stencilcoef.c */ -HYPRE_Int hypre_FacZeroCFSten ( hypre_SStructPMatrix *Af , hypre_SStructPMatrix *Ac , hypre_SStructGrid *grid , HYPRE_Int fine_part , hypre_Index rfactors ); -HYPRE_Int hypre_FacZeroFCSten ( hypre_SStructPMatrix *A , hypre_SStructGrid *grid , HYPRE_Int fine_part ); +HYPRE_Int hypre_FacZeroCFSten ( hypre_SStructPMatrix *Af, hypre_SStructPMatrix *Ac, + hypre_SStructGrid *grid, HYPRE_Int fine_part, hypre_Index rfactors ); +HYPRE_Int hypre_FacZeroFCSten ( hypre_SStructPMatrix *A, hypre_SStructGrid *grid, + HYPRE_Int fine_part ); /* bsearch.c */ -HYPRE_Int hypre_LowerBinarySearch ( HYPRE_Int *list , HYPRE_Int value , HYPRE_Int list_length ); -HYPRE_Int hypre_UpperBinarySearch ( HYPRE_Int *list , HYPRE_Int value , HYPRE_Int list_length ); +HYPRE_Int hypre_LowerBinarySearch ( HYPRE_Int *list, HYPRE_Int value, HYPRE_Int list_length ); +HYPRE_Int hypre_UpperBinarySearch ( HYPRE_Int *list, HYPRE_Int value, HYPRE_Int list_length ); /* maxwell_solve2.c */ -HYPRE_Int hypre_MaxwellSolve2 ( void *maxwell_vdata , hypre_SStructMatrix *A_in , hypre_SStructVector *f , hypre_SStructVector *u ); +HYPRE_Int hypre_MaxwellSolve2 ( void *maxwell_vdata, hypre_SStructMatrix *A_in, + hypre_SStructVector *f, hypre_SStructVector *u ); /* maxwell_solve.c */ -HYPRE_Int hypre_MaxwellSolve ( void *maxwell_vdata , hypre_SStructMatrix *A_in , hypre_SStructVector *f , hypre_SStructVector *u ); +HYPRE_Int hypre_MaxwellSolve ( void *maxwell_vdata, hypre_SStructMatrix *A_in, + hypre_SStructVector *f, hypre_SStructVector *u ); /* HYPRE_sstruct_bicgstab.c */ -HYPRE_Int HYPRE_SStructBiCGSTABCreate ( MPI_Comm comm , HYPRE_SStructSolver *solver ); +HYPRE_Int HYPRE_SStructBiCGSTABCreate ( MPI_Comm comm, HYPRE_SStructSolver *solver ); HYPRE_Int HYPRE_SStructBiCGSTABDestroy ( HYPRE_SStructSolver solver ); -HYPRE_Int HYPRE_SStructBiCGSTABSetup ( HYPRE_SStructSolver solver , HYPRE_SStructMatrix A , HYPRE_SStructVector b , HYPRE_SStructVector x ); -HYPRE_Int HYPRE_SStructBiCGSTABSolve ( HYPRE_SStructSolver solver , HYPRE_SStructMatrix A , HYPRE_SStructVector b , HYPRE_SStructVector x ); -HYPRE_Int HYPRE_SStructBiCGSTABSetTol ( HYPRE_SStructSolver solver , HYPRE_Real tol ); -HYPRE_Int HYPRE_SStructBiCGSTABSetAbsoluteTol ( HYPRE_SStructSolver solver , HYPRE_Real tol ); -HYPRE_Int HYPRE_SStructBiCGSTABSetMinIter ( HYPRE_SStructSolver solver , HYPRE_Int min_iter ); -HYPRE_Int HYPRE_SStructBiCGSTABSetMaxIter ( HYPRE_SStructSolver solver , HYPRE_Int max_iter ); -HYPRE_Int HYPRE_SStructBiCGSTABSetStopCrit ( HYPRE_SStructSolver solver , HYPRE_Int stop_crit ); -HYPRE_Int HYPRE_SStructBiCGSTABSetPrecond ( HYPRE_SStructSolver solver , HYPRE_PtrToSStructSolverFcn precond , HYPRE_PtrToSStructSolverFcn precond_setup , void *precond_data ); -HYPRE_Int HYPRE_SStructBiCGSTABSetLogging ( HYPRE_SStructSolver solver , HYPRE_Int logging ); -HYPRE_Int HYPRE_SStructBiCGSTABSetPrintLevel ( HYPRE_SStructSolver solver , HYPRE_Int print_level ); -HYPRE_Int HYPRE_SStructBiCGSTABGetNumIterations ( HYPRE_SStructSolver solver , HYPRE_Int *num_iterations ); -HYPRE_Int HYPRE_SStructBiCGSTABGetFinalRelativeResidualNorm ( HYPRE_SStructSolver solver , HYPRE_Real *norm ); -HYPRE_Int HYPRE_SStructBiCGSTABGetResidual ( HYPRE_SStructSolver solver , void **residual ); +HYPRE_Int HYPRE_SStructBiCGSTABSetup ( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, + HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int HYPRE_SStructBiCGSTABSolve ( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, + HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int HYPRE_SStructBiCGSTABSetTol ( HYPRE_SStructSolver solver, HYPRE_Real tol ); +HYPRE_Int HYPRE_SStructBiCGSTABSetAbsoluteTol ( HYPRE_SStructSolver solver, HYPRE_Real tol ); +HYPRE_Int HYPRE_SStructBiCGSTABSetMinIter ( HYPRE_SStructSolver solver, HYPRE_Int min_iter ); +HYPRE_Int HYPRE_SStructBiCGSTABSetMaxIter ( HYPRE_SStructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int HYPRE_SStructBiCGSTABSetStopCrit ( HYPRE_SStructSolver solver, HYPRE_Int stop_crit ); +HYPRE_Int HYPRE_SStructBiCGSTABSetPrecond ( HYPRE_SStructSolver solver, + HYPRE_PtrToSStructSolverFcn precond, HYPRE_PtrToSStructSolverFcn precond_setup, + void *precond_data ); +HYPRE_Int HYPRE_SStructBiCGSTABSetLogging ( HYPRE_SStructSolver solver, HYPRE_Int logging ); +HYPRE_Int HYPRE_SStructBiCGSTABSetPrintLevel ( HYPRE_SStructSolver solver, HYPRE_Int print_level ); +HYPRE_Int HYPRE_SStructBiCGSTABGetNumIterations ( HYPRE_SStructSolver solver, + HYPRE_Int *num_iterations ); +HYPRE_Int HYPRE_SStructBiCGSTABGetFinalRelativeResidualNorm ( HYPRE_SStructSolver solver, + HYPRE_Real *norm ); +HYPRE_Int HYPRE_SStructBiCGSTABGetResidual ( HYPRE_SStructSolver solver, void **residual ); /* HYPRE_sstruct_flexgmres.c */ -HYPRE_Int HYPRE_SStructFlexGMRESCreate ( MPI_Comm comm , HYPRE_SStructSolver *solver ); +HYPRE_Int HYPRE_SStructFlexGMRESCreate ( MPI_Comm comm, HYPRE_SStructSolver *solver ); HYPRE_Int HYPRE_SStructFlexGMRESDestroy ( HYPRE_SStructSolver solver ); -HYPRE_Int HYPRE_SStructFlexGMRESSetup ( HYPRE_SStructSolver solver , HYPRE_SStructMatrix A , HYPRE_SStructVector b , HYPRE_SStructVector x ); -HYPRE_Int HYPRE_SStructFlexGMRESSolve ( HYPRE_SStructSolver solver , HYPRE_SStructMatrix A , HYPRE_SStructVector b , HYPRE_SStructVector x ); -HYPRE_Int HYPRE_SStructFlexGMRESSetKDim ( HYPRE_SStructSolver solver , HYPRE_Int k_dim ); -HYPRE_Int HYPRE_SStructFlexGMRESSetTol ( HYPRE_SStructSolver solver , HYPRE_Real tol ); -HYPRE_Int HYPRE_SStructFlexGMRESSetAbsoluteTol ( HYPRE_SStructSolver solver , HYPRE_Real tol ); -HYPRE_Int HYPRE_SStructFlexGMRESSetMinIter ( HYPRE_SStructSolver solver , HYPRE_Int min_iter ); -HYPRE_Int HYPRE_SStructFlexGMRESSetMaxIter ( HYPRE_SStructSolver solver , HYPRE_Int max_iter ); -HYPRE_Int HYPRE_SStructFlexGMRESSetPrecond ( HYPRE_SStructSolver solver , HYPRE_PtrToSStructSolverFcn precond , HYPRE_PtrToSStructSolverFcn precond_setup , void *precond_data ); -HYPRE_Int HYPRE_SStructFlexGMRESSetLogging ( HYPRE_SStructSolver solver , HYPRE_Int logging ); -HYPRE_Int HYPRE_SStructFlexGMRESSetPrintLevel ( HYPRE_SStructSolver solver , HYPRE_Int level ); -HYPRE_Int HYPRE_SStructFlexGMRESGetNumIterations ( HYPRE_SStructSolver solver , HYPRE_Int *num_iterations ); -HYPRE_Int HYPRE_SStructFlexGMRESGetFinalRelativeResidualNorm ( HYPRE_SStructSolver solver , HYPRE_Real *norm ); -HYPRE_Int HYPRE_SStructFlexGMRESGetResidual ( HYPRE_SStructSolver solver , void **residual ); -HYPRE_Int HYPRE_SStructFlexGMRESSetModifyPC ( HYPRE_SStructSolver solver , HYPRE_PtrToModifyPCFcn modify_pc ); +HYPRE_Int HYPRE_SStructFlexGMRESSetup ( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, + HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int HYPRE_SStructFlexGMRESSolve ( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, + HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int HYPRE_SStructFlexGMRESSetKDim ( HYPRE_SStructSolver solver, HYPRE_Int k_dim ); +HYPRE_Int HYPRE_SStructFlexGMRESSetTol ( HYPRE_SStructSolver solver, HYPRE_Real tol ); +HYPRE_Int HYPRE_SStructFlexGMRESSetAbsoluteTol ( HYPRE_SStructSolver solver, HYPRE_Real tol ); +HYPRE_Int HYPRE_SStructFlexGMRESSetMinIter ( HYPRE_SStructSolver solver, HYPRE_Int min_iter ); +HYPRE_Int HYPRE_SStructFlexGMRESSetMaxIter ( HYPRE_SStructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int HYPRE_SStructFlexGMRESSetPrecond ( HYPRE_SStructSolver solver, + HYPRE_PtrToSStructSolverFcn precond, HYPRE_PtrToSStructSolverFcn precond_setup, + void *precond_data ); +HYPRE_Int HYPRE_SStructFlexGMRESSetLogging ( HYPRE_SStructSolver solver, HYPRE_Int logging ); +HYPRE_Int HYPRE_SStructFlexGMRESSetPrintLevel ( HYPRE_SStructSolver solver, HYPRE_Int level ); +HYPRE_Int HYPRE_SStructFlexGMRESGetNumIterations ( HYPRE_SStructSolver solver, + HYPRE_Int *num_iterations ); +HYPRE_Int HYPRE_SStructFlexGMRESGetFinalRelativeResidualNorm ( HYPRE_SStructSolver solver, + HYPRE_Real *norm ); +HYPRE_Int HYPRE_SStructFlexGMRESGetResidual ( HYPRE_SStructSolver solver, void **residual ); +HYPRE_Int HYPRE_SStructFlexGMRESSetModifyPC ( HYPRE_SStructSolver solver, + HYPRE_PtrToModifyPCFcn modify_pc ); /* HYPRE_sstruct_gmres.c */ -HYPRE_Int HYPRE_SStructGMRESCreate ( MPI_Comm comm , HYPRE_SStructSolver *solver ); +HYPRE_Int HYPRE_SStructGMRESCreate ( MPI_Comm comm, HYPRE_SStructSolver *solver ); HYPRE_Int HYPRE_SStructGMRESDestroy ( HYPRE_SStructSolver solver ); -HYPRE_Int HYPRE_SStructGMRESSetup ( HYPRE_SStructSolver solver , HYPRE_SStructMatrix A , HYPRE_SStructVector b , HYPRE_SStructVector x ); -HYPRE_Int HYPRE_SStructGMRESSolve ( HYPRE_SStructSolver solver , HYPRE_SStructMatrix A , HYPRE_SStructVector b , HYPRE_SStructVector x ); -HYPRE_Int HYPRE_SStructGMRESSetKDim ( HYPRE_SStructSolver solver , HYPRE_Int k_dim ); -HYPRE_Int HYPRE_SStructGMRESSetTol ( HYPRE_SStructSolver solver , HYPRE_Real tol ); -HYPRE_Int HYPRE_SStructGMRESSetAbsoluteTol ( HYPRE_SStructSolver solver , HYPRE_Real atol ); -HYPRE_Int HYPRE_SStructGMRESSetMinIter ( HYPRE_SStructSolver solver , HYPRE_Int min_iter ); -HYPRE_Int HYPRE_SStructGMRESSetMaxIter ( HYPRE_SStructSolver solver , HYPRE_Int max_iter ); -HYPRE_Int HYPRE_SStructGMRESSetStopCrit ( HYPRE_SStructSolver solver , HYPRE_Int stop_crit ); -HYPRE_Int HYPRE_SStructGMRESSetPrecond ( HYPRE_SStructSolver solver , HYPRE_PtrToSStructSolverFcn precond , HYPRE_PtrToSStructSolverFcn precond_setup , void *precond_data ); -HYPRE_Int HYPRE_SStructGMRESSetLogging ( HYPRE_SStructSolver solver , HYPRE_Int logging ); -HYPRE_Int HYPRE_SStructGMRESSetPrintLevel ( HYPRE_SStructSolver solver , HYPRE_Int level ); -HYPRE_Int HYPRE_SStructGMRESGetNumIterations ( HYPRE_SStructSolver solver , HYPRE_Int *num_iterations ); -HYPRE_Int HYPRE_SStructGMRESGetFinalRelativeResidualNorm ( HYPRE_SStructSolver solver , HYPRE_Real *norm ); -HYPRE_Int HYPRE_SStructGMRESGetResidual ( HYPRE_SStructSolver solver , void **residual ); +HYPRE_Int HYPRE_SStructGMRESSetup ( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, + HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int HYPRE_SStructGMRESSolve ( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, + HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int HYPRE_SStructGMRESSetKDim ( HYPRE_SStructSolver solver, HYPRE_Int k_dim ); +HYPRE_Int HYPRE_SStructGMRESSetTol ( HYPRE_SStructSolver solver, HYPRE_Real tol ); +HYPRE_Int HYPRE_SStructGMRESSetAbsoluteTol ( HYPRE_SStructSolver solver, HYPRE_Real atol ); +HYPRE_Int HYPRE_SStructGMRESSetMinIter ( HYPRE_SStructSolver solver, HYPRE_Int min_iter ); +HYPRE_Int HYPRE_SStructGMRESSetMaxIter ( HYPRE_SStructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int HYPRE_SStructGMRESSetStopCrit ( HYPRE_SStructSolver solver, HYPRE_Int stop_crit ); +HYPRE_Int HYPRE_SStructGMRESSetPrecond ( HYPRE_SStructSolver solver, + HYPRE_PtrToSStructSolverFcn precond, HYPRE_PtrToSStructSolverFcn precond_setup, + void *precond_data ); +HYPRE_Int HYPRE_SStructGMRESSetLogging ( HYPRE_SStructSolver solver, HYPRE_Int logging ); +HYPRE_Int HYPRE_SStructGMRESSetPrintLevel ( HYPRE_SStructSolver solver, HYPRE_Int level ); +HYPRE_Int HYPRE_SStructGMRESGetNumIterations ( HYPRE_SStructSolver solver, + HYPRE_Int *num_iterations ); +HYPRE_Int HYPRE_SStructGMRESGetFinalRelativeResidualNorm ( HYPRE_SStructSolver solver, + HYPRE_Real *norm ); +HYPRE_Int HYPRE_SStructGMRESGetResidual ( HYPRE_SStructSolver solver, void **residual ); /* HYPRE_sstruct_int.c */ -HYPRE_Int hypre_SStructPVectorSetRandomValues ( hypre_SStructPVector *pvector , HYPRE_Int seed ); -HYPRE_Int hypre_SStructVectorSetRandomValues ( hypre_SStructVector *vector , HYPRE_Int seed ); -HYPRE_Int hypre_SStructSetRandomValues ( void *v , HYPRE_Int seed ); +HYPRE_Int hypre_SStructPVectorSetRandomValues ( hypre_SStructPVector *pvector, HYPRE_Int seed ); +HYPRE_Int hypre_SStructVectorSetRandomValues ( hypre_SStructVector *vector, HYPRE_Int seed ); +HYPRE_Int hypre_SStructSetRandomValues ( void *v, HYPRE_Int seed ); HYPRE_Int HYPRE_SStructSetupInterpreter ( mv_InterfaceInterpreter *i ); HYPRE_Int HYPRE_SStructSetupMatvec ( HYPRE_MatvecFunctions *mv ); /* HYPRE_sstruct_InterFAC.c */ -HYPRE_Int HYPRE_SStructFACCreate ( MPI_Comm comm , HYPRE_SStructSolver *solver ); +HYPRE_Int HYPRE_SStructFACCreate ( MPI_Comm comm, HYPRE_SStructSolver *solver ); HYPRE_Int HYPRE_SStructFACDestroy2 ( HYPRE_SStructSolver solver ); -HYPRE_Int HYPRE_SStructFACAMR_RAP ( HYPRE_SStructMatrix A , HYPRE_Int (*rfactors )[HYPRE_MAXDIM] , HYPRE_SStructMatrix *fac_A ); -HYPRE_Int HYPRE_SStructFACSetup2 ( HYPRE_SStructSolver solver , HYPRE_SStructMatrix A , HYPRE_SStructVector b , HYPRE_SStructVector x ); -HYPRE_Int HYPRE_SStructFACSolve3 ( HYPRE_SStructSolver solver , HYPRE_SStructMatrix A , HYPRE_SStructVector b , HYPRE_SStructVector x ); -HYPRE_Int HYPRE_SStructFACSetTol ( HYPRE_SStructSolver solver , HYPRE_Real tol ); -HYPRE_Int HYPRE_SStructFACSetPLevels ( HYPRE_SStructSolver solver , HYPRE_Int nparts , HYPRE_Int *plevels ); -HYPRE_Int HYPRE_SStructFACZeroCFSten ( HYPRE_SStructMatrix A , HYPRE_SStructGrid grid , HYPRE_Int part , HYPRE_Int rfactors [HYPRE_MAXDIM]); -HYPRE_Int HYPRE_SStructFACZeroFCSten ( HYPRE_SStructMatrix A , HYPRE_SStructGrid grid , HYPRE_Int part ); -HYPRE_Int HYPRE_SStructFACZeroAMRMatrixData ( HYPRE_SStructMatrix A , HYPRE_Int part_crse , HYPRE_Int rfactors [HYPRE_MAXDIM]); -HYPRE_Int HYPRE_SStructFACZeroAMRVectorData ( HYPRE_SStructVector b , HYPRE_Int *plevels , HYPRE_Int (*rfactors )[HYPRE_MAXDIM]); -HYPRE_Int HYPRE_SStructFACSetPRefinements ( HYPRE_SStructSolver solver , HYPRE_Int nparts , HYPRE_Int (*rfactors )[HYPRE_MAXDIM]); -HYPRE_Int HYPRE_SStructFACSetMaxLevels ( HYPRE_SStructSolver solver , HYPRE_Int max_levels ); -HYPRE_Int HYPRE_SStructFACSetMaxIter ( HYPRE_SStructSolver solver , HYPRE_Int max_iter ); -HYPRE_Int HYPRE_SStructFACSetRelChange ( HYPRE_SStructSolver solver , HYPRE_Int rel_change ); +HYPRE_Int HYPRE_SStructFACAMR_RAP ( HYPRE_SStructMatrix A, HYPRE_Int (*rfactors )[HYPRE_MAXDIM], + HYPRE_SStructMatrix *fac_A ); +HYPRE_Int HYPRE_SStructFACSetup2 ( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, + HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int HYPRE_SStructFACSolve3 ( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, + HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int HYPRE_SStructFACSetTol ( HYPRE_SStructSolver solver, HYPRE_Real tol ); +HYPRE_Int HYPRE_SStructFACSetPLevels ( HYPRE_SStructSolver solver, HYPRE_Int nparts, + HYPRE_Int *plevels ); +HYPRE_Int HYPRE_SStructFACZeroCFSten ( HYPRE_SStructMatrix A, HYPRE_SStructGrid grid, + HYPRE_Int part, HYPRE_Int rfactors [HYPRE_MAXDIM]); +HYPRE_Int HYPRE_SStructFACZeroFCSten ( HYPRE_SStructMatrix A, HYPRE_SStructGrid grid, + HYPRE_Int part ); +HYPRE_Int HYPRE_SStructFACZeroAMRMatrixData ( HYPRE_SStructMatrix A, HYPRE_Int part_crse, + HYPRE_Int rfactors [HYPRE_MAXDIM]); +HYPRE_Int HYPRE_SStructFACZeroAMRVectorData ( HYPRE_SStructVector b, HYPRE_Int *plevels, + HYPRE_Int (*rfactors )[HYPRE_MAXDIM]); +HYPRE_Int HYPRE_SStructFACSetPRefinements ( HYPRE_SStructSolver solver, HYPRE_Int nparts, + HYPRE_Int (*rfactors )[HYPRE_MAXDIM]); +HYPRE_Int HYPRE_SStructFACSetMaxLevels ( HYPRE_SStructSolver solver, HYPRE_Int max_levels ); +HYPRE_Int HYPRE_SStructFACSetMaxIter ( HYPRE_SStructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int HYPRE_SStructFACSetRelChange ( HYPRE_SStructSolver solver, HYPRE_Int rel_change ); HYPRE_Int HYPRE_SStructFACSetZeroGuess ( HYPRE_SStructSolver solver ); HYPRE_Int HYPRE_SStructFACSetNonZeroGuess ( HYPRE_SStructSolver solver ); -HYPRE_Int HYPRE_SStructFACSetRelaxType ( HYPRE_SStructSolver solver , HYPRE_Int relax_type ); -HYPRE_Int HYPRE_SStructFACSetJacobiWeight ( HYPRE_SStructSolver solver , HYPRE_Real weight ); -HYPRE_Int HYPRE_SStructFACSetNumPreRelax ( HYPRE_SStructSolver solver , HYPRE_Int num_pre_relax ); -HYPRE_Int HYPRE_SStructFACSetNumPostRelax ( HYPRE_SStructSolver solver , HYPRE_Int num_post_relax ); -HYPRE_Int HYPRE_SStructFACSetCoarseSolverType ( HYPRE_SStructSolver solver , HYPRE_Int csolver_type ); -HYPRE_Int HYPRE_SStructFACSetLogging ( HYPRE_SStructSolver solver , HYPRE_Int logging ); -HYPRE_Int HYPRE_SStructFACGetNumIterations ( HYPRE_SStructSolver solver , HYPRE_Int *num_iterations ); -HYPRE_Int HYPRE_SStructFACGetFinalRelativeResidualNorm ( HYPRE_SStructSolver solver , HYPRE_Real *norm ); +HYPRE_Int HYPRE_SStructFACSetRelaxType ( HYPRE_SStructSolver solver, HYPRE_Int relax_type ); +HYPRE_Int HYPRE_SStructFACSetJacobiWeight ( HYPRE_SStructSolver solver, HYPRE_Real weight ); +HYPRE_Int HYPRE_SStructFACSetNumPreRelax ( HYPRE_SStructSolver solver, HYPRE_Int num_pre_relax ); +HYPRE_Int HYPRE_SStructFACSetNumPostRelax ( HYPRE_SStructSolver solver, HYPRE_Int num_post_relax ); +HYPRE_Int HYPRE_SStructFACSetCoarseSolverType ( HYPRE_SStructSolver solver, + HYPRE_Int csolver_type ); +HYPRE_Int HYPRE_SStructFACSetLogging ( HYPRE_SStructSolver solver, HYPRE_Int logging ); +HYPRE_Int HYPRE_SStructFACGetNumIterations ( HYPRE_SStructSolver solver, + HYPRE_Int *num_iterations ); +HYPRE_Int HYPRE_SStructFACGetFinalRelativeResidualNorm ( HYPRE_SStructSolver solver, + HYPRE_Real *norm ); /* HYPRE_sstruct_lgmres.c */ -HYPRE_Int HYPRE_SStructLGMRESCreate ( MPI_Comm comm , HYPRE_SStructSolver *solver ); +HYPRE_Int HYPRE_SStructLGMRESCreate ( MPI_Comm comm, HYPRE_SStructSolver *solver ); HYPRE_Int HYPRE_SStructLGMRESDestroy ( HYPRE_SStructSolver solver ); -HYPRE_Int HYPRE_SStructLGMRESSetup ( HYPRE_SStructSolver solver , HYPRE_SStructMatrix A , HYPRE_SStructVector b , HYPRE_SStructVector x ); -HYPRE_Int HYPRE_SStructLGMRESSolve ( HYPRE_SStructSolver solver , HYPRE_SStructMatrix A , HYPRE_SStructVector b , HYPRE_SStructVector x ); -HYPRE_Int HYPRE_SStructLGMRESSetKDim ( HYPRE_SStructSolver solver , HYPRE_Int k_dim ); -HYPRE_Int HYPRE_SStructLGMRESSetAugDim ( HYPRE_SStructSolver solver , HYPRE_Int aug_dim ); -HYPRE_Int HYPRE_SStructLGMRESSetTol ( HYPRE_SStructSolver solver , HYPRE_Real tol ); -HYPRE_Int HYPRE_SStructLGMRESSetAbsoluteTol ( HYPRE_SStructSolver solver , HYPRE_Real atol ); -HYPRE_Int HYPRE_SStructLGMRESSetMinIter ( HYPRE_SStructSolver solver , HYPRE_Int min_iter ); -HYPRE_Int HYPRE_SStructLGMRESSetMaxIter ( HYPRE_SStructSolver solver , HYPRE_Int max_iter ); -HYPRE_Int HYPRE_SStructLGMRESSetPrecond ( HYPRE_SStructSolver solver , HYPRE_PtrToSStructSolverFcn precond , HYPRE_PtrToSStructSolverFcn precond_setup , void *precond_data ); -HYPRE_Int HYPRE_SStructLGMRESSetLogging ( HYPRE_SStructSolver solver , HYPRE_Int logging ); -HYPRE_Int HYPRE_SStructLGMRESSetPrintLevel ( HYPRE_SStructSolver solver , HYPRE_Int level ); -HYPRE_Int HYPRE_SStructLGMRESGetNumIterations ( HYPRE_SStructSolver solver , HYPRE_Int *num_iterations ); -HYPRE_Int HYPRE_SStructLGMRESGetFinalRelativeResidualNorm ( HYPRE_SStructSolver solver , HYPRE_Real *norm ); -HYPRE_Int HYPRE_SStructLGMRESGetResidual ( HYPRE_SStructSolver solver , void **residual ); +HYPRE_Int HYPRE_SStructLGMRESSetup ( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, + HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int HYPRE_SStructLGMRESSolve ( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, + HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int HYPRE_SStructLGMRESSetKDim ( HYPRE_SStructSolver solver, HYPRE_Int k_dim ); +HYPRE_Int HYPRE_SStructLGMRESSetAugDim ( HYPRE_SStructSolver solver, HYPRE_Int aug_dim ); +HYPRE_Int HYPRE_SStructLGMRESSetTol ( HYPRE_SStructSolver solver, HYPRE_Real tol ); +HYPRE_Int HYPRE_SStructLGMRESSetAbsoluteTol ( HYPRE_SStructSolver solver, HYPRE_Real atol ); +HYPRE_Int HYPRE_SStructLGMRESSetMinIter ( HYPRE_SStructSolver solver, HYPRE_Int min_iter ); +HYPRE_Int HYPRE_SStructLGMRESSetMaxIter ( HYPRE_SStructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int HYPRE_SStructLGMRESSetPrecond ( HYPRE_SStructSolver solver, + HYPRE_PtrToSStructSolverFcn precond, HYPRE_PtrToSStructSolverFcn precond_setup, + void *precond_data ); +HYPRE_Int HYPRE_SStructLGMRESSetLogging ( HYPRE_SStructSolver solver, HYPRE_Int logging ); +HYPRE_Int HYPRE_SStructLGMRESSetPrintLevel ( HYPRE_SStructSolver solver, HYPRE_Int level ); +HYPRE_Int HYPRE_SStructLGMRESGetNumIterations ( HYPRE_SStructSolver solver, + HYPRE_Int *num_iterations ); +HYPRE_Int HYPRE_SStructLGMRESGetFinalRelativeResidualNorm ( HYPRE_SStructSolver solver, + HYPRE_Real *norm ); +HYPRE_Int HYPRE_SStructLGMRESGetResidual ( HYPRE_SStructSolver solver, void **residual ); /* HYPRE_sstruct_maxwell.c */ -HYPRE_Int HYPRE_SStructMaxwellCreate ( MPI_Comm comm , HYPRE_SStructSolver *solver ); +HYPRE_Int HYPRE_SStructMaxwellCreate ( MPI_Comm comm, HYPRE_SStructSolver *solver ); HYPRE_Int HYPRE_SStructMaxwellDestroy ( HYPRE_SStructSolver solver ); -HYPRE_Int HYPRE_SStructMaxwellSetup ( HYPRE_SStructSolver solver , HYPRE_SStructMatrix A , HYPRE_SStructVector b , HYPRE_SStructVector x ); -HYPRE_Int HYPRE_SStructMaxwellSolve ( HYPRE_SStructSolver solver , HYPRE_SStructMatrix A , HYPRE_SStructVector b , HYPRE_SStructVector x ); -HYPRE_Int HYPRE_SStructMaxwellSolve2 ( HYPRE_SStructSolver solver , HYPRE_SStructMatrix A , HYPRE_SStructVector b , HYPRE_SStructVector x ); -HYPRE_Int HYPRE_MaxwellGrad ( HYPRE_SStructGrid grid , HYPRE_ParCSRMatrix *T ); -HYPRE_Int HYPRE_SStructMaxwellSetGrad ( HYPRE_SStructSolver solver , HYPRE_ParCSRMatrix T ); -HYPRE_Int HYPRE_SStructMaxwellSetRfactors ( HYPRE_SStructSolver solver , HYPRE_Int rfactors [HYPRE_MAXDIM]); -HYPRE_Int HYPRE_SStructMaxwellSetTol ( HYPRE_SStructSolver solver , HYPRE_Real tol ); -HYPRE_Int HYPRE_SStructMaxwellSetConstantCoef ( HYPRE_SStructSolver solver , HYPRE_Int constant_coef ); -HYPRE_Int HYPRE_SStructMaxwellSetMaxIter ( HYPRE_SStructSolver solver , HYPRE_Int max_iter ); -HYPRE_Int HYPRE_SStructMaxwellSetRelChange ( HYPRE_SStructSolver solver , HYPRE_Int rel_change ); -HYPRE_Int HYPRE_SStructMaxwellSetNumPreRelax ( HYPRE_SStructSolver solver , HYPRE_Int num_pre_relax ); -HYPRE_Int HYPRE_SStructMaxwellSetNumPostRelax ( HYPRE_SStructSolver solver , HYPRE_Int num_post_relax ); -HYPRE_Int HYPRE_SStructMaxwellSetLogging ( HYPRE_SStructSolver solver , HYPRE_Int logging ); -HYPRE_Int HYPRE_SStructMaxwellSetPrintLevel ( HYPRE_SStructSolver solver , HYPRE_Int print_level ); -HYPRE_Int HYPRE_SStructMaxwellPrintLogging ( HYPRE_SStructSolver solver , HYPRE_Int myid ); -HYPRE_Int HYPRE_SStructMaxwellGetNumIterations ( HYPRE_SStructSolver solver , HYPRE_Int *num_iterations ); -HYPRE_Int HYPRE_SStructMaxwellGetFinalRelativeResidualNorm ( HYPRE_SStructSolver solver , HYPRE_Real *norm ); -HYPRE_Int HYPRE_SStructMaxwellPhysBdy ( HYPRE_SStructGrid *grid_l , HYPRE_Int num_levels , HYPRE_Int rfactors [HYPRE_MAXDIM], HYPRE_Int ***BdryRanks_ptr , HYPRE_Int **BdryRanksCnt_ptr ); -HYPRE_Int HYPRE_SStructMaxwellEliminateRowsCols ( HYPRE_ParCSRMatrix parA , HYPRE_Int nrows , HYPRE_Int *rows ); -HYPRE_Int HYPRE_SStructMaxwellZeroVector ( HYPRE_ParVector v , HYPRE_Int *rows , HYPRE_Int nrows ); +HYPRE_Int HYPRE_SStructMaxwellSetup ( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, + HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int HYPRE_SStructMaxwellSolve ( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, + HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int HYPRE_SStructMaxwellSolve2 ( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, + HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int HYPRE_MaxwellGrad ( HYPRE_SStructGrid grid, HYPRE_ParCSRMatrix *T ); +HYPRE_Int HYPRE_SStructMaxwellSetGrad ( HYPRE_SStructSolver solver, HYPRE_ParCSRMatrix T ); +HYPRE_Int HYPRE_SStructMaxwellSetRfactors ( HYPRE_SStructSolver solver, + HYPRE_Int *rfactors); +HYPRE_Int HYPRE_SStructMaxwellSetTol ( HYPRE_SStructSolver solver, HYPRE_Real tol ); +HYPRE_Int HYPRE_SStructMaxwellSetConstantCoef ( HYPRE_SStructSolver solver, + HYPRE_Int constant_coef ); +HYPRE_Int HYPRE_SStructMaxwellSetMaxIter ( HYPRE_SStructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int HYPRE_SStructMaxwellSetRelChange ( HYPRE_SStructSolver solver, HYPRE_Int rel_change ); +HYPRE_Int HYPRE_SStructMaxwellSetNumPreRelax ( HYPRE_SStructSolver solver, + HYPRE_Int num_pre_relax ); +HYPRE_Int HYPRE_SStructMaxwellSetNumPostRelax ( HYPRE_SStructSolver solver, + HYPRE_Int num_post_relax ); +HYPRE_Int HYPRE_SStructMaxwellSetLogging ( HYPRE_SStructSolver solver, HYPRE_Int logging ); +HYPRE_Int HYPRE_SStructMaxwellSetPrintLevel ( HYPRE_SStructSolver solver, HYPRE_Int print_level ); +HYPRE_Int HYPRE_SStructMaxwellPrintLogging ( HYPRE_SStructSolver solver, HYPRE_Int myid ); +HYPRE_Int HYPRE_SStructMaxwellGetNumIterations ( HYPRE_SStructSolver solver, + HYPRE_Int *num_iterations ); +HYPRE_Int HYPRE_SStructMaxwellGetFinalRelativeResidualNorm ( HYPRE_SStructSolver solver, + HYPRE_Real *norm ); +HYPRE_Int HYPRE_SStructMaxwellPhysBdy ( HYPRE_SStructGrid *grid_l, HYPRE_Int num_levels, + HYPRE_Int *rfactors, HYPRE_Int ***BdryRanks_ptr, HYPRE_Int **BdryRanksCnt_ptr ); +HYPRE_Int HYPRE_SStructMaxwellEliminateRowsCols ( HYPRE_ParCSRMatrix parA, HYPRE_Int nrows, + HYPRE_Int *rows ); +HYPRE_Int HYPRE_SStructMaxwellZeroVector ( HYPRE_ParVector v, HYPRE_Int *rows, HYPRE_Int nrows ); /* HYPRE_sstruct_pcg.c */ -HYPRE_Int HYPRE_SStructPCGCreate ( MPI_Comm comm , HYPRE_SStructSolver *solver ); +HYPRE_Int HYPRE_SStructPCGCreate ( MPI_Comm comm, HYPRE_SStructSolver *solver ); HYPRE_Int HYPRE_SStructPCGDestroy ( HYPRE_SStructSolver solver ); -HYPRE_Int HYPRE_SStructPCGSetup ( HYPRE_SStructSolver solver , HYPRE_SStructMatrix A , HYPRE_SStructVector b , HYPRE_SStructVector x ); -HYPRE_Int HYPRE_SStructPCGSolve ( HYPRE_SStructSolver solver , HYPRE_SStructMatrix A , HYPRE_SStructVector b , HYPRE_SStructVector x ); -HYPRE_Int HYPRE_SStructPCGSetTol ( HYPRE_SStructSolver solver , HYPRE_Real tol ); -HYPRE_Int HYPRE_SStructPCGSetAbsoluteTol ( HYPRE_SStructSolver solver , HYPRE_Real tol ); -HYPRE_Int HYPRE_SStructPCGSetMaxIter ( HYPRE_SStructSolver solver , HYPRE_Int max_iter ); -HYPRE_Int HYPRE_SStructPCGSetTwoNorm ( HYPRE_SStructSolver solver , HYPRE_Int two_norm ); -HYPRE_Int HYPRE_SStructPCGSetRelChange ( HYPRE_SStructSolver solver , HYPRE_Int rel_change ); -HYPRE_Int HYPRE_SStructPCGSetPrecond ( HYPRE_SStructSolver solver , HYPRE_PtrToSStructSolverFcn precond , HYPRE_PtrToSStructSolverFcn precond_setup , void *precond_data ); -HYPRE_Int HYPRE_SStructPCGSetLogging ( HYPRE_SStructSolver solver , HYPRE_Int logging ); -HYPRE_Int HYPRE_SStructPCGSetPrintLevel ( HYPRE_SStructSolver solver , HYPRE_Int level ); -HYPRE_Int HYPRE_SStructPCGGetNumIterations ( HYPRE_SStructSolver solver , HYPRE_Int *num_iterations ); -HYPRE_Int HYPRE_SStructPCGGetFinalRelativeResidualNorm ( HYPRE_SStructSolver solver , HYPRE_Real *norm ); -HYPRE_Int HYPRE_SStructPCGGetResidual ( HYPRE_SStructSolver solver , void **residual ); -HYPRE_Int HYPRE_SStructDiagScaleSetup ( HYPRE_SStructSolver solver , HYPRE_SStructMatrix A , HYPRE_SStructVector y , HYPRE_SStructVector x ); -HYPRE_Int HYPRE_SStructDiagScale ( HYPRE_SStructSolver solver , HYPRE_SStructMatrix A , HYPRE_SStructVector y , HYPRE_SStructVector x ); +HYPRE_Int HYPRE_SStructPCGSetup ( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, + HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int HYPRE_SStructPCGSolve ( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, + HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int HYPRE_SStructPCGSetTol ( HYPRE_SStructSolver solver, HYPRE_Real tol ); +HYPRE_Int HYPRE_SStructPCGSetAbsoluteTol ( HYPRE_SStructSolver solver, HYPRE_Real tol ); +HYPRE_Int HYPRE_SStructPCGSetMaxIter ( HYPRE_SStructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int HYPRE_SStructPCGSetTwoNorm ( HYPRE_SStructSolver solver, HYPRE_Int two_norm ); +HYPRE_Int HYPRE_SStructPCGSetRelChange ( HYPRE_SStructSolver solver, HYPRE_Int rel_change ); +HYPRE_Int HYPRE_SStructPCGSetPrecond ( HYPRE_SStructSolver solver, + HYPRE_PtrToSStructSolverFcn precond, HYPRE_PtrToSStructSolverFcn precond_setup, + void *precond_data ); +HYPRE_Int HYPRE_SStructPCGSetLogging ( HYPRE_SStructSolver solver, HYPRE_Int logging ); +HYPRE_Int HYPRE_SStructPCGSetPrintLevel ( HYPRE_SStructSolver solver, HYPRE_Int level ); +HYPRE_Int HYPRE_SStructPCGGetNumIterations ( HYPRE_SStructSolver solver, + HYPRE_Int *num_iterations ); +HYPRE_Int HYPRE_SStructPCGGetFinalRelativeResidualNorm ( HYPRE_SStructSolver solver, + HYPRE_Real *norm ); +HYPRE_Int HYPRE_SStructPCGGetResidual ( HYPRE_SStructSolver solver, void **residual ); +HYPRE_Int HYPRE_SStructDiagScaleSetup ( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, + HYPRE_SStructVector y, HYPRE_SStructVector x ); +HYPRE_Int HYPRE_SStructDiagScale ( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, + HYPRE_SStructVector y, HYPRE_SStructVector x ); /* HYPRE_sstruct_split.c */ -HYPRE_Int HYPRE_SStructSplitCreate ( MPI_Comm comm , HYPRE_SStructSolver *solver_ptr ); +HYPRE_Int HYPRE_SStructSplitCreate ( MPI_Comm comm, HYPRE_SStructSolver *solver_ptr ); HYPRE_Int HYPRE_SStructSplitDestroy ( HYPRE_SStructSolver solver ); -HYPRE_Int HYPRE_SStructSplitSetup ( HYPRE_SStructSolver solver , HYPRE_SStructMatrix A , HYPRE_SStructVector b , HYPRE_SStructVector x ); -HYPRE_Int HYPRE_SStructSplitSolve ( HYPRE_SStructSolver solver , HYPRE_SStructMatrix A , HYPRE_SStructVector b , HYPRE_SStructVector x ); -HYPRE_Int HYPRE_SStructSplitSetTol ( HYPRE_SStructSolver solver , HYPRE_Real tol ); -HYPRE_Int HYPRE_SStructSplitSetMaxIter ( HYPRE_SStructSolver solver , HYPRE_Int max_iter ); +HYPRE_Int HYPRE_SStructSplitSetup ( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, + HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int HYPRE_SStructSplitSolve ( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, + HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int HYPRE_SStructSplitSetTol ( HYPRE_SStructSolver solver, HYPRE_Real tol ); +HYPRE_Int HYPRE_SStructSplitSetMaxIter ( HYPRE_SStructSolver solver, HYPRE_Int max_iter ); HYPRE_Int HYPRE_SStructSplitSetZeroGuess ( HYPRE_SStructSolver solver ); HYPRE_Int HYPRE_SStructSplitSetNonZeroGuess ( HYPRE_SStructSolver solver ); -HYPRE_Int HYPRE_SStructSplitSetStructSolver ( HYPRE_SStructSolver solver , HYPRE_Int ssolver ); -HYPRE_Int HYPRE_SStructSplitGetNumIterations ( HYPRE_SStructSolver solver , HYPRE_Int *num_iterations ); -HYPRE_Int HYPRE_SStructSplitGetFinalRelativeResidualNorm ( HYPRE_SStructSolver solver , HYPRE_Real *norm ); +HYPRE_Int HYPRE_SStructSplitSetStructSolver ( HYPRE_SStructSolver solver, HYPRE_Int ssolver ); +HYPRE_Int HYPRE_SStructSplitGetNumIterations ( HYPRE_SStructSolver solver, + HYPRE_Int *num_iterations ); +HYPRE_Int HYPRE_SStructSplitGetFinalRelativeResidualNorm ( HYPRE_SStructSolver solver, + HYPRE_Real *norm ); /* HYPRE_sstruct_sys_pfmg.c */ -HYPRE_Int HYPRE_SStructSysPFMGCreate ( MPI_Comm comm , HYPRE_SStructSolver *solver ); +HYPRE_Int HYPRE_SStructSysPFMGCreate ( MPI_Comm comm, HYPRE_SStructSolver *solver ); HYPRE_Int HYPRE_SStructSysPFMGDestroy ( HYPRE_SStructSolver solver ); -HYPRE_Int HYPRE_SStructSysPFMGSetup ( HYPRE_SStructSolver solver , HYPRE_SStructMatrix A , HYPRE_SStructVector b , HYPRE_SStructVector x ); -HYPRE_Int HYPRE_SStructSysPFMGSolve ( HYPRE_SStructSolver solver , HYPRE_SStructMatrix A , HYPRE_SStructVector b , HYPRE_SStructVector x ); -HYPRE_Int HYPRE_SStructSysPFMGSetTol ( HYPRE_SStructSolver solver , HYPRE_Real tol ); -HYPRE_Int HYPRE_SStructSysPFMGSetMaxIter ( HYPRE_SStructSolver solver , HYPRE_Int max_iter ); -HYPRE_Int HYPRE_SStructSysPFMGSetRelChange ( HYPRE_SStructSolver solver , HYPRE_Int rel_change ); +HYPRE_Int HYPRE_SStructSysPFMGSetup ( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, + HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int HYPRE_SStructSysPFMGSolve ( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, + HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int HYPRE_SStructSysPFMGSetTol ( HYPRE_SStructSolver solver, HYPRE_Real tol ); +HYPRE_Int HYPRE_SStructSysPFMGSetMaxIter ( HYPRE_SStructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int HYPRE_SStructSysPFMGSetRelChange ( HYPRE_SStructSolver solver, HYPRE_Int rel_change ); HYPRE_Int HYPRE_SStructSysPFMGSetZeroGuess ( HYPRE_SStructSolver solver ); HYPRE_Int HYPRE_SStructSysPFMGSetNonZeroGuess ( HYPRE_SStructSolver solver ); -HYPRE_Int HYPRE_SStructSysPFMGSetRelaxType ( HYPRE_SStructSolver solver , HYPRE_Int relax_type ); -HYPRE_Int HYPRE_SStructSysPFMGSetJacobiWeight ( HYPRE_SStructSolver solver , HYPRE_Real weight ); -HYPRE_Int HYPRE_SStructSysPFMGSetNumPreRelax ( HYPRE_SStructSolver solver , HYPRE_Int num_pre_relax ); -HYPRE_Int HYPRE_SStructSysPFMGSetNumPostRelax ( HYPRE_SStructSolver solver , HYPRE_Int num_post_relax ); -HYPRE_Int HYPRE_SStructSysPFMGSetSkipRelax ( HYPRE_SStructSolver solver , HYPRE_Int skip_relax ); -HYPRE_Int HYPRE_SStructSysPFMGSetDxyz ( HYPRE_SStructSolver solver , HYPRE_Real *dxyz ); -HYPRE_Int HYPRE_SStructSysPFMGSetLogging ( HYPRE_SStructSolver solver , HYPRE_Int logging ); -HYPRE_Int HYPRE_SStructSysPFMGSetPrintLevel ( HYPRE_SStructSolver solver , HYPRE_Int print_level ); -HYPRE_Int HYPRE_SStructSysPFMGGetNumIterations ( HYPRE_SStructSolver solver , HYPRE_Int *num_iterations ); -HYPRE_Int HYPRE_SStructSysPFMGGetFinalRelativeResidualNorm ( HYPRE_SStructSolver solver , HYPRE_Real *norm ); +HYPRE_Int HYPRE_SStructSysPFMGSetRelaxType ( HYPRE_SStructSolver solver, HYPRE_Int relax_type ); +HYPRE_Int HYPRE_SStructSysPFMGSetJacobiWeight ( HYPRE_SStructSolver solver, HYPRE_Real weight ); +HYPRE_Int HYPRE_SStructSysPFMGSetNumPreRelax ( HYPRE_SStructSolver solver, + HYPRE_Int num_pre_relax ); +HYPRE_Int HYPRE_SStructSysPFMGSetNumPostRelax ( HYPRE_SStructSolver solver, + HYPRE_Int num_post_relax ); +HYPRE_Int HYPRE_SStructSysPFMGSetSkipRelax ( HYPRE_SStructSolver solver, HYPRE_Int skip_relax ); +HYPRE_Int HYPRE_SStructSysPFMGSetDxyz ( HYPRE_SStructSolver solver, HYPRE_Real *dxyz ); +HYPRE_Int HYPRE_SStructSysPFMGSetLogging ( HYPRE_SStructSolver solver, HYPRE_Int logging ); +HYPRE_Int HYPRE_SStructSysPFMGSetPrintLevel ( HYPRE_SStructSolver solver, HYPRE_Int print_level ); +HYPRE_Int HYPRE_SStructSysPFMGGetNumIterations ( HYPRE_SStructSolver solver, + HYPRE_Int *num_iterations ); +HYPRE_Int HYPRE_SStructSysPFMGGetFinalRelativeResidualNorm ( HYPRE_SStructSolver solver, + HYPRE_Real *norm ); /* krylov.c */ -HYPRE_Int hypre_SStructKrylovIdentitySetup ( void *vdata , void *A , void *b , void *x ); -HYPRE_Int hypre_SStructKrylovIdentity ( void *vdata , void *A , void *b , void *x ); +HYPRE_Int hypre_SStructKrylovIdentitySetup ( void *vdata, void *A, void *b, void *x ); +HYPRE_Int hypre_SStructKrylovIdentity ( void *vdata, void *A, void *b, void *x ); /* krylov_sstruct.c */ void *hypre_SStructKrylovCAlloc ( size_t count, size_t elt_size, HYPRE_MemoryLocation location ); HYPRE_Int hypre_SStructKrylovFree ( void *ptr ); void *hypre_SStructKrylovCreateVector ( void *vvector ); -void *hypre_SStructKrylovCreateVectorArray ( HYPRE_Int n , void *vvector ); +void *hypre_SStructKrylovCreateVectorArray ( HYPRE_Int n, void *vvector ); HYPRE_Int hypre_SStructKrylovDestroyVector ( void *vvector ); -void *hypre_SStructKrylovMatvecCreate ( void *A , void *x ); -HYPRE_Int hypre_SStructKrylovMatvec ( void *matvec_data , HYPRE_Complex alpha , void *A , void *x , HYPRE_Complex beta , void *y ); +void *hypre_SStructKrylovMatvecCreate ( void *A, void *x ); +HYPRE_Int hypre_SStructKrylovMatvec ( void *matvec_data, HYPRE_Complex alpha, void *A, void *x, + HYPRE_Complex beta, void *y ); HYPRE_Int hypre_SStructKrylovMatvecDestroy ( void *matvec_data ); -HYPRE_Real hypre_SStructKrylovInnerProd ( void *x , void *y ); -HYPRE_Int hypre_SStructKrylovCopyVector ( void *x , void *y ); +HYPRE_Real hypre_SStructKrylovInnerProd ( void *x, void *y ); +HYPRE_Int hypre_SStructKrylovCopyVector ( void *x, void *y ); HYPRE_Int hypre_SStructKrylovClearVector ( void *x ); -HYPRE_Int hypre_SStructKrylovScaleVector ( HYPRE_Complex alpha , void *x ); -HYPRE_Int hypre_SStructKrylovAxpy ( HYPRE_Complex alpha , void *x , void *y ); -HYPRE_Int hypre_SStructKrylovCommInfo ( void *A , HYPRE_Int *my_id , HYPRE_Int *num_procs ); +HYPRE_Int hypre_SStructKrylovScaleVector ( HYPRE_Complex alpha, void *x ); +HYPRE_Int hypre_SStructKrylovAxpy ( HYPRE_Complex alpha, void *x, void *y ); +HYPRE_Int hypre_SStructKrylovCommInfo ( void *A, HYPRE_Int *my_id, HYPRE_Int *num_procs ); /* maxwell_grad.c */ hypre_ParCSRMatrix *hypre_Maxwell_Grad ( hypre_SStructGrid *grid ); /* maxwell_physbdy.c */ -HYPRE_Int hypre_Maxwell_PhysBdy ( hypre_SStructGrid **grid_l , HYPRE_Int num_levels , hypre_Index rfactors , HYPRE_Int ***BdryRanksl_ptr , HYPRE_Int **BdryRanksCntsl_ptr ); -HYPRE_Int hypre_Maxwell_VarBdy ( hypre_SStructPGrid *pgrid , hypre_BoxArrayArray **bdry ); +HYPRE_Int hypre_Maxwell_PhysBdy ( hypre_SStructGrid **grid_l, HYPRE_Int num_levels, + hypre_Index rfactors, HYPRE_Int ***BdryRanksl_ptr, HYPRE_Int **BdryRanksCntsl_ptr ); +HYPRE_Int hypre_Maxwell_VarBdy ( hypre_SStructPGrid *pgrid, hypre_BoxArrayArray **bdry ); /* maxwell_PNedelec_bdy.c */ -HYPRE_Int hypre_Maxwell_PNedelec_Bdy ( hypre_StructGrid *cell_grid , hypre_SStructPGrid *pgrid , hypre_BoxArrayArray ****bdry_ptr ); +HYPRE_Int hypre_Maxwell_PNedelec_Bdy ( hypre_StructGrid *cell_grid, hypre_SStructPGrid *pgrid, + hypre_BoxArrayArray ****bdry_ptr ); /* maxwell_PNedelec.c */ -hypre_IJMatrix *hypre_Maxwell_PNedelec ( hypre_SStructGrid *fgrid_edge , hypre_SStructGrid *cgrid_edge , hypre_Index rfactor ); +hypre_IJMatrix *hypre_Maxwell_PNedelec ( hypre_SStructGrid *fgrid_edge, + hypre_SStructGrid *cgrid_edge, hypre_Index rfactor ); /* maxwell_semi_interp.c */ HYPRE_Int hypre_CreatePTopology ( void **PTopology_vdata_ptr ); HYPRE_Int hypre_DestroyPTopology ( void *PTopology_vdata ); -hypre_IJMatrix *hypre_Maxwell_PTopology ( hypre_SStructGrid *fgrid_edge , hypre_SStructGrid *cgrid_edge , hypre_SStructGrid *fgrid_face , hypre_SStructGrid *cgrid_face , hypre_SStructGrid *fgrid_element , hypre_SStructGrid *cgrid_element , hypre_ParCSRMatrix *Aee , hypre_Index rfactor , void *PTopology_vdata ); -HYPRE_Int hypre_CollapseStencilToStencil ( hypre_ParCSRMatrix *Aee , hypre_SStructGrid *grid , HYPRE_Int part , HYPRE_Int var , hypre_Index pt_location , HYPRE_Int collapse_dir , HYPRE_Int new_stencil_dir , HYPRE_Real **collapsed_vals_ptr ); -HYPRE_Int hypre_TriDiagSolve ( HYPRE_Real *diag , HYPRE_Real *upper , HYPRE_Real *lower , HYPRE_Real *rhs , HYPRE_Int size ); +hypre_IJMatrix *hypre_Maxwell_PTopology ( hypre_SStructGrid *fgrid_edge, + hypre_SStructGrid *cgrid_edge, hypre_SStructGrid *fgrid_face, hypre_SStructGrid *cgrid_face, + hypre_SStructGrid *fgrid_element, hypre_SStructGrid *cgrid_element, hypre_ParCSRMatrix *Aee, + hypre_Index rfactor, void *PTopology_vdata ); +HYPRE_Int hypre_CollapseStencilToStencil ( hypre_ParCSRMatrix *Aee, hypre_SStructGrid *grid, + HYPRE_Int part, HYPRE_Int var, hypre_Index pt_location, HYPRE_Int collapse_dir, + HYPRE_Int new_stencil_dir, HYPRE_Real **collapsed_vals_ptr ); +HYPRE_Int hypre_TriDiagSolve ( HYPRE_Real *diag, HYPRE_Real *upper, HYPRE_Real *lower, + HYPRE_Real *rhs, HYPRE_Int size ); /* maxwell_TV.c */ void *hypre_MaxwellTVCreate ( MPI_Comm comm ); HYPRE_Int hypre_MaxwellTVDestroy ( void *maxwell_vdata ); -HYPRE_Int hypre_MaxwellSetRfactors ( void *maxwell_vdata , HYPRE_Int rfactor [HYPRE_MAXDIM]); -HYPRE_Int hypre_MaxwellSetGrad ( void *maxwell_vdata , hypre_ParCSRMatrix *T ); -HYPRE_Int hypre_MaxwellSetConstantCoef ( void *maxwell_vdata , HYPRE_Int constant_coef ); -HYPRE_Int hypre_MaxwellSetTol ( void *maxwell_vdata , HYPRE_Real tol ); -HYPRE_Int hypre_MaxwellSetMaxIter ( void *maxwell_vdata , HYPRE_Int max_iter ); -HYPRE_Int hypre_MaxwellSetRelChange ( void *maxwell_vdata , HYPRE_Int rel_change ); -HYPRE_Int hypre_MaxwellSetNumPreRelax ( void *maxwell_vdata , HYPRE_Int num_pre_relax ); -HYPRE_Int hypre_MaxwellSetNumPostRelax ( void *maxwell_vdata , HYPRE_Int num_post_relax ); -HYPRE_Int hypre_MaxwellGetNumIterations ( void *maxwell_vdata , HYPRE_Int *num_iterations ); -HYPRE_Int hypre_MaxwellSetPrintLevel ( void *maxwell_vdata , HYPRE_Int print_level ); -HYPRE_Int hypre_MaxwellSetLogging ( void *maxwell_vdata , HYPRE_Int logging ); -HYPRE_Int hypre_MaxwellPrintLogging ( void *maxwell_vdata , HYPRE_Int myid ); -HYPRE_Int hypre_MaxwellGetFinalRelativeResidualNorm ( void *maxwell_vdata , HYPRE_Real *relative_residual_norm ); +HYPRE_Int hypre_MaxwellSetRfactors ( void *maxwell_vdata, HYPRE_Int rfactor [HYPRE_MAXDIM]); +HYPRE_Int hypre_MaxwellSetGrad ( void *maxwell_vdata, hypre_ParCSRMatrix *T ); +HYPRE_Int hypre_MaxwellSetConstantCoef ( void *maxwell_vdata, HYPRE_Int constant_coef ); +HYPRE_Int hypre_MaxwellSetTol ( void *maxwell_vdata, HYPRE_Real tol ); +HYPRE_Int hypre_MaxwellSetMaxIter ( void *maxwell_vdata, HYPRE_Int max_iter ); +HYPRE_Int hypre_MaxwellSetRelChange ( void *maxwell_vdata, HYPRE_Int rel_change ); +HYPRE_Int hypre_MaxwellSetNumPreRelax ( void *maxwell_vdata, HYPRE_Int num_pre_relax ); +HYPRE_Int hypre_MaxwellSetNumPostRelax ( void *maxwell_vdata, HYPRE_Int num_post_relax ); +HYPRE_Int hypre_MaxwellGetNumIterations ( void *maxwell_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int hypre_MaxwellSetPrintLevel ( void *maxwell_vdata, HYPRE_Int print_level ); +HYPRE_Int hypre_MaxwellSetLogging ( void *maxwell_vdata, HYPRE_Int logging ); +HYPRE_Int hypre_MaxwellPrintLogging ( void *maxwell_vdata, HYPRE_Int myid ); +HYPRE_Int hypre_MaxwellGetFinalRelativeResidualNorm ( void *maxwell_vdata, + HYPRE_Real *relative_residual_norm ); /* maxwell_TV_setup.c */ -HYPRE_Int hypre_MaxwellTV_Setup ( void *maxwell_vdata , hypre_SStructMatrix *Aee_in , hypre_SStructVector *b_in , hypre_SStructVector *x_in ); -HYPRE_Int hypre_CoarsenPGrid ( hypre_SStructGrid *fgrid , hypre_Index index , hypre_Index stride , HYPRE_Int part , hypre_SStructGrid *cgrid , HYPRE_Int *nboxes ); -hypre_Box *hypre_BoxContraction ( hypre_Box *box , hypre_StructGrid *sgrid , hypre_Index rfactor ); +HYPRE_Int hypre_MaxwellTV_Setup ( void *maxwell_vdata, hypre_SStructMatrix *Aee_in, + hypre_SStructVector *b_in, hypre_SStructVector *x_in ); +HYPRE_Int hypre_CoarsenPGrid ( hypre_SStructGrid *fgrid, hypre_Index index, hypre_Index stride, + HYPRE_Int part, hypre_SStructGrid *cgrid, HYPRE_Int *nboxes ); +hypre_Box *hypre_BoxContraction ( hypre_Box *box, hypre_StructGrid *sgrid, hypre_Index rfactor ); /* maxwell_zeroBC.c */ -HYPRE_Int hypre_ParVectorZeroBCValues ( hypre_ParVector *v , HYPRE_Int *rows , HYPRE_Int nrows ); -HYPRE_Int hypre_SeqVectorZeroBCValues ( hypre_Vector *v , HYPRE_Int *rows , HYPRE_Int nrows ); +HYPRE_Int hypre_ParVectorZeroBCValues ( hypre_ParVector *v, HYPRE_Int *rows, HYPRE_Int nrows ); +HYPRE_Int hypre_SeqVectorZeroBCValues ( hypre_Vector *v, HYPRE_Int *rows, HYPRE_Int nrows ); /* nd1_amge_interpolation.c */ -HYPRE_Int hypre_ND1AMGeInterpolation ( hypre_ParCSRMatrix *Aee , hypre_ParCSRMatrix *ELEM_idof , hypre_ParCSRMatrix *FACE_idof , hypre_ParCSRMatrix *EDGE_idof , hypre_ParCSRMatrix *ELEM_FACE , hypre_ParCSRMatrix *ELEM_EDGE , HYPRE_Int num_OffProcRows , hypre_MaxwellOffProcRow **OffProcRows , hypre_IJMatrix *IJ_dof_DOF ); -HYPRE_Int hypre_HarmonicExtension ( hypre_CSRMatrix *A , hypre_CSRMatrix *P , HYPRE_Int num_DOF , HYPRE_BigInt *DOF , HYPRE_Int num_idof , HYPRE_BigInt *idof , HYPRE_Int num_bdof , HYPRE_BigInt *bdof ); +HYPRE_Int hypre_ND1AMGeInterpolation ( hypre_ParCSRMatrix *Aee, hypre_ParCSRMatrix *ELEM_idof, + hypre_ParCSRMatrix *FACE_idof, hypre_ParCSRMatrix *EDGE_idof, hypre_ParCSRMatrix *ELEM_FACE, + hypre_ParCSRMatrix *ELEM_EDGE, HYPRE_Int num_OffProcRows, hypre_MaxwellOffProcRow **OffProcRows, + hypre_IJMatrix *IJ_dof_DOF ); +HYPRE_Int hypre_HarmonicExtension ( hypre_CSRMatrix *A, hypre_CSRMatrix *P, HYPRE_Int num_DOF, + HYPRE_BigInt *DOF, HYPRE_Int num_idof, HYPRE_BigInt *idof, HYPRE_Int num_bdof, HYPRE_BigInt *bdof ); /* node_relax.c */ void *hypre_NodeRelaxCreate ( MPI_Comm comm ); HYPRE_Int hypre_NodeRelaxDestroy ( void *relax_vdata ); -HYPRE_Int hypre_NodeRelaxSetup ( void *relax_vdata , hypre_SStructPMatrix *A , hypre_SStructPVector *b , hypre_SStructPVector *x ); -HYPRE_Int hypre_NodeRelax ( void *relax_vdata , hypre_SStructPMatrix *A , hypre_SStructPVector *b , hypre_SStructPVector *x ); -HYPRE_Int hypre_NodeRelaxSetTol ( void *relax_vdata , HYPRE_Real tol ); -HYPRE_Int hypre_NodeRelaxSetMaxIter ( void *relax_vdata , HYPRE_Int max_iter ); -HYPRE_Int hypre_NodeRelaxSetZeroGuess ( void *relax_vdata , HYPRE_Int zero_guess ); -HYPRE_Int hypre_NodeRelaxSetWeight ( void *relax_vdata , HYPRE_Real weight ); -HYPRE_Int hypre_NodeRelaxSetNumNodesets ( void *relax_vdata , HYPRE_Int num_nodesets ); -HYPRE_Int hypre_NodeRelaxSetNodeset ( void *relax_vdata , HYPRE_Int nodeset , HYPRE_Int nodeset_size , hypre_Index nodeset_stride , hypre_Index *nodeset_indices ); -HYPRE_Int hypre_NodeRelaxSetNodesetRank ( void *relax_vdata , HYPRE_Int nodeset , HYPRE_Int nodeset_rank ); -HYPRE_Int hypre_NodeRelaxSetTempVec ( void *relax_vdata , hypre_SStructPVector *t ); +HYPRE_Int hypre_NodeRelaxSetup ( void *relax_vdata, hypre_SStructPMatrix *A, + hypre_SStructPVector *b, hypre_SStructPVector *x ); +HYPRE_Int hypre_NodeRelax ( void *relax_vdata, hypre_SStructPMatrix *A, hypre_SStructPVector *b, + hypre_SStructPVector *x ); +HYPRE_Int hypre_NodeRelaxSetTol ( void *relax_vdata, HYPRE_Real tol ); +HYPRE_Int hypre_NodeRelaxSetMaxIter ( void *relax_vdata, HYPRE_Int max_iter ); +HYPRE_Int hypre_NodeRelaxSetZeroGuess ( void *relax_vdata, HYPRE_Int zero_guess ); +HYPRE_Int hypre_NodeRelaxSetWeight ( void *relax_vdata, HYPRE_Real weight ); +HYPRE_Int hypre_NodeRelaxSetNumNodesets ( void *relax_vdata, HYPRE_Int num_nodesets ); +HYPRE_Int hypre_NodeRelaxSetNodeset ( void *relax_vdata, HYPRE_Int nodeset, HYPRE_Int nodeset_size, + hypre_Index nodeset_stride, hypre_Index *nodeset_indices ); +HYPRE_Int hypre_NodeRelaxSetNodesetRank ( void *relax_vdata, HYPRE_Int nodeset, + HYPRE_Int nodeset_rank ); +HYPRE_Int hypre_NodeRelaxSetTempVec ( void *relax_vdata, hypre_SStructPVector *t ); /* sstruct_amr_intercommunication.c */ -HYPRE_Int hypre_SStructAMRInterCommunication ( hypre_SStructSendInfoData *sendinfo , hypre_SStructRecvInfoData *recvinfo , hypre_BoxArray *send_data_space , hypre_BoxArray *recv_data_space , HYPRE_Int num_values , MPI_Comm comm , hypre_CommPkg **comm_pkg_ptr ); +HYPRE_Int hypre_SStructAMRInterCommunication ( hypre_SStructSendInfoData *sendinfo, + hypre_SStructRecvInfoData *recvinfo, hypre_BoxArray *send_data_space, + hypre_BoxArray *recv_data_space, HYPRE_Int num_values, MPI_Comm comm, + hypre_CommPkg **comm_pkg_ptr ); /* sstruct_owninfo.c */ -HYPRE_Int hypre_SStructIndexScaleF_C ( hypre_Index findex , hypre_Index index , hypre_Index stride , hypre_Index cindex ); -HYPRE_Int hypre_SStructIndexScaleC_F ( hypre_Index cindex , hypre_Index index , hypre_Index stride , hypre_Index findex ); -hypre_SStructOwnInfoData *hypre_SStructOwnInfo ( hypre_StructGrid *fgrid , hypre_StructGrid *cgrid , hypre_BoxManager *cboxman , hypre_BoxManager *fboxman , hypre_Index rfactor ); +HYPRE_Int hypre_SStructIndexScaleF_C ( hypre_Index findex, hypre_Index index, hypre_Index stride, + hypre_Index cindex ); +HYPRE_Int hypre_SStructIndexScaleC_F ( hypre_Index cindex, hypre_Index index, hypre_Index stride, + hypre_Index findex ); +hypre_SStructOwnInfoData *hypre_SStructOwnInfo ( hypre_StructGrid *fgrid, hypre_StructGrid *cgrid, + hypre_BoxManager *cboxman, hypre_BoxManager *fboxman, hypre_Index rfactor ); HYPRE_Int hypre_SStructOwnInfoDataDestroy ( hypre_SStructOwnInfoData *owninfo_data ); /* sstruct_recvinfo.c */ -hypre_SStructRecvInfoData *hypre_SStructRecvInfo ( hypre_StructGrid *cgrid , hypre_BoxManager *fboxman , hypre_Index rfactor ); +hypre_SStructRecvInfoData *hypre_SStructRecvInfo ( hypre_StructGrid *cgrid, + hypre_BoxManager *fboxman, hypre_Index rfactor ); HYPRE_Int hypre_SStructRecvInfoDataDestroy ( hypre_SStructRecvInfoData *recvinfo_data ); /* sstruct_sendinfo.c */ -hypre_SStructSendInfoData *hypre_SStructSendInfo ( hypre_StructGrid *fgrid , hypre_BoxManager *cboxman , hypre_Index rfactor ); +hypre_SStructSendInfoData *hypre_SStructSendInfo ( hypre_StructGrid *fgrid, + hypre_BoxManager *cboxman, hypre_Index rfactor ); HYPRE_Int hypre_SStructSendInfoDataDestroy ( hypre_SStructSendInfoData *sendinfo_data ); /* sstruct_sharedDOFComm.c */ hypre_MaxwellOffProcRow *hypre_MaxwellOffProcRowCreate ( HYPRE_Int ncols ); HYPRE_Int hypre_MaxwellOffProcRowDestroy ( void *OffProcRow_vdata ); -HYPRE_Int hypre_SStructSharedDOF_ParcsrMatRowsComm ( hypre_SStructGrid *grid , hypre_ParCSRMatrix *A , HYPRE_Int *num_offprocrows_ptr , hypre_MaxwellOffProcRow ***OffProcRows_ptr ); +HYPRE_Int hypre_SStructSharedDOF_ParcsrMatRowsComm ( hypre_SStructGrid *grid, hypre_ParCSRMatrix *A, + HYPRE_Int *num_offprocrows_ptr, hypre_MaxwellOffProcRow ***OffProcRows_ptr ); /* sys_pfmg.c */ void *hypre_SysPFMGCreate ( MPI_Comm comm ); HYPRE_Int hypre_SysPFMGDestroy ( void *sys_pfmg_vdata ); -HYPRE_Int hypre_SysPFMGSetTol ( void *sys_pfmg_vdata , HYPRE_Real tol ); -HYPRE_Int hypre_SysPFMGSetMaxIter ( void *sys_pfmg_vdata , HYPRE_Int max_iter ); -HYPRE_Int hypre_SysPFMGSetRelChange ( void *sys_pfmg_vdata , HYPRE_Int rel_change ); -HYPRE_Int hypre_SysPFMGSetZeroGuess ( void *sys_pfmg_vdata , HYPRE_Int zero_guess ); -HYPRE_Int hypre_SysPFMGSetRelaxType ( void *sys_pfmg_vdata , HYPRE_Int relax_type ); -HYPRE_Int hypre_SysPFMGSetJacobiWeight ( void *sys_pfmg_vdata , HYPRE_Real weight ); -HYPRE_Int hypre_SysPFMGSetNumPreRelax ( void *sys_pfmg_vdata , HYPRE_Int num_pre_relax ); -HYPRE_Int hypre_SysPFMGSetNumPostRelax ( void *sys_pfmg_vdata , HYPRE_Int num_post_relax ); -HYPRE_Int hypre_SysPFMGSetSkipRelax ( void *sys_pfmg_vdata , HYPRE_Int skip_relax ); -HYPRE_Int hypre_SysPFMGSetDxyz ( void *sys_pfmg_vdata , HYPRE_Real *dxyz ); -HYPRE_Int hypre_SysPFMGSetLogging ( void *sys_pfmg_vdata , HYPRE_Int logging ); -HYPRE_Int hypre_SysPFMGSetPrintLevel ( void *sys_pfmg_vdata , HYPRE_Int print_level ); -HYPRE_Int hypre_SysPFMGGetNumIterations ( void *sys_pfmg_vdata , HYPRE_Int *num_iterations ); -HYPRE_Int hypre_SysPFMGPrintLogging ( void *sys_pfmg_vdata , HYPRE_Int myid ); -HYPRE_Int hypre_SysPFMGGetFinalRelativeResidualNorm ( void *sys_pfmg_vdata , HYPRE_Real *relative_residual_norm ); +HYPRE_Int hypre_SysPFMGSetTol ( void *sys_pfmg_vdata, HYPRE_Real tol ); +HYPRE_Int hypre_SysPFMGSetMaxIter ( void *sys_pfmg_vdata, HYPRE_Int max_iter ); +HYPRE_Int hypre_SysPFMGSetRelChange ( void *sys_pfmg_vdata, HYPRE_Int rel_change ); +HYPRE_Int hypre_SysPFMGSetZeroGuess ( void *sys_pfmg_vdata, HYPRE_Int zero_guess ); +HYPRE_Int hypre_SysPFMGSetRelaxType ( void *sys_pfmg_vdata, HYPRE_Int relax_type ); +HYPRE_Int hypre_SysPFMGSetJacobiWeight ( void *sys_pfmg_vdata, HYPRE_Real weight ); +HYPRE_Int hypre_SysPFMGSetNumPreRelax ( void *sys_pfmg_vdata, HYPRE_Int num_pre_relax ); +HYPRE_Int hypre_SysPFMGSetNumPostRelax ( void *sys_pfmg_vdata, HYPRE_Int num_post_relax ); +HYPRE_Int hypre_SysPFMGSetSkipRelax ( void *sys_pfmg_vdata, HYPRE_Int skip_relax ); +HYPRE_Int hypre_SysPFMGSetDxyz ( void *sys_pfmg_vdata, HYPRE_Real *dxyz ); +HYPRE_Int hypre_SysPFMGSetLogging ( void *sys_pfmg_vdata, HYPRE_Int logging ); +HYPRE_Int hypre_SysPFMGSetPrintLevel ( void *sys_pfmg_vdata, HYPRE_Int print_level ); +HYPRE_Int hypre_SysPFMGGetNumIterations ( void *sys_pfmg_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int hypre_SysPFMGPrintLogging ( void *sys_pfmg_vdata, HYPRE_Int myid ); +HYPRE_Int hypre_SysPFMGGetFinalRelativeResidualNorm ( void *sys_pfmg_vdata, + HYPRE_Real *relative_residual_norm ); /* sys_pfmg_relax.c */ void *hypre_SysPFMGRelaxCreate ( MPI_Comm comm ); HYPRE_Int hypre_SysPFMGRelaxDestroy ( void *sys_pfmg_relax_vdata ); -HYPRE_Int hypre_SysPFMGRelax ( void *sys_pfmg_relax_vdata , hypre_SStructPMatrix *A , hypre_SStructPVector *b , hypre_SStructPVector *x ); -HYPRE_Int hypre_SysPFMGRelaxSetup ( void *sys_pfmg_relax_vdata , hypre_SStructPMatrix *A , hypre_SStructPVector *b , hypre_SStructPVector *x ); -HYPRE_Int hypre_SysPFMGRelaxSetType ( void *sys_pfmg_relax_vdata , HYPRE_Int relax_type ); -HYPRE_Int hypre_SysPFMGRelaxSetJacobiWeight ( void *sys_pfmg_relax_vdata , HYPRE_Real weight ); +HYPRE_Int hypre_SysPFMGRelax ( void *sys_pfmg_relax_vdata, hypre_SStructPMatrix *A, + hypre_SStructPVector *b, hypre_SStructPVector *x ); +HYPRE_Int hypre_SysPFMGRelaxSetup ( void *sys_pfmg_relax_vdata, hypre_SStructPMatrix *A, + hypre_SStructPVector *b, hypre_SStructPVector *x ); +HYPRE_Int hypre_SysPFMGRelaxSetType ( void *sys_pfmg_relax_vdata, HYPRE_Int relax_type ); +HYPRE_Int hypre_SysPFMGRelaxSetJacobiWeight ( void *sys_pfmg_relax_vdata, HYPRE_Real weight ); HYPRE_Int hypre_SysPFMGRelaxSetPreRelax ( void *sys_pfmg_relax_vdata ); HYPRE_Int hypre_SysPFMGRelaxSetPostRelax ( void *sys_pfmg_relax_vdata ); -HYPRE_Int hypre_SysPFMGRelaxSetTol ( void *sys_pfmg_relax_vdata , HYPRE_Real tol ); -HYPRE_Int hypre_SysPFMGRelaxSetMaxIter ( void *sys_pfmg_relax_vdata , HYPRE_Int max_iter ); -HYPRE_Int hypre_SysPFMGRelaxSetZeroGuess ( void *sys_pfmg_relax_vdata , HYPRE_Int zero_guess ); -HYPRE_Int hypre_SysPFMGRelaxSetTempVec ( void *sys_pfmg_relax_vdata , hypre_SStructPVector *t ); +HYPRE_Int hypre_SysPFMGRelaxSetTol ( void *sys_pfmg_relax_vdata, HYPRE_Real tol ); +HYPRE_Int hypre_SysPFMGRelaxSetMaxIter ( void *sys_pfmg_relax_vdata, HYPRE_Int max_iter ); +HYPRE_Int hypre_SysPFMGRelaxSetZeroGuess ( void *sys_pfmg_relax_vdata, HYPRE_Int zero_guess ); +HYPRE_Int hypre_SysPFMGRelaxSetTempVec ( void *sys_pfmg_relax_vdata, hypre_SStructPVector *t ); /* sys_pfmg_setup.c */ -HYPRE_Int hypre_SysPFMGSetup ( void *sys_pfmg_vdata , hypre_SStructMatrix *A_in , hypre_SStructVector *b_in , hypre_SStructVector *x_in ); -HYPRE_Int hypre_SysStructCoarsen ( hypre_SStructPGrid *fgrid , hypre_Index index , hypre_Index stride , HYPRE_Int prune , hypre_SStructPGrid **cgrid_ptr ); +HYPRE_Int hypre_SysPFMGSetup ( void *sys_pfmg_vdata, hypre_SStructMatrix *A_in, + hypre_SStructVector *b_in, hypre_SStructVector *x_in ); +HYPRE_Int hypre_SysStructCoarsen ( hypre_SStructPGrid *fgrid, hypre_Index index, hypre_Index stride, + HYPRE_Int prune, hypre_SStructPGrid **cgrid_ptr ); /* sys_pfmg_setup_interp.c */ -hypre_SStructPMatrix *hypre_SysPFMGCreateInterpOp ( hypre_SStructPMatrix *A , hypre_SStructPGrid *cgrid , HYPRE_Int cdir ); -HYPRE_Int hypre_SysPFMGSetupInterpOp ( hypre_SStructPMatrix *A , HYPRE_Int cdir , hypre_Index findex , hypre_Index stride , hypre_SStructPMatrix *P ); +hypre_SStructPMatrix *hypre_SysPFMGCreateInterpOp ( hypre_SStructPMatrix *A, + hypre_SStructPGrid *cgrid, HYPRE_Int cdir ); +HYPRE_Int hypre_SysPFMGSetupInterpOp ( hypre_SStructPMatrix *A, HYPRE_Int cdir, hypre_Index findex, + hypre_Index stride, hypre_SStructPMatrix *P ); /* sys_pfmg_setup_rap.c */ -hypre_SStructPMatrix *hypre_SysPFMGCreateRAPOp ( hypre_SStructPMatrix *R , hypre_SStructPMatrix *A , hypre_SStructPMatrix *P , hypre_SStructPGrid *coarse_grid , HYPRE_Int cdir ); -HYPRE_Int hypre_SysPFMGSetupRAPOp ( hypre_SStructPMatrix *R , hypre_SStructPMatrix *A , hypre_SStructPMatrix *P , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_SStructPMatrix *Ac ); +hypre_SStructPMatrix *hypre_SysPFMGCreateRAPOp ( hypre_SStructPMatrix *R, hypre_SStructPMatrix *A, + hypre_SStructPMatrix *P, hypre_SStructPGrid *coarse_grid, HYPRE_Int cdir ); +HYPRE_Int hypre_SysPFMGSetupRAPOp ( hypre_SStructPMatrix *R, hypre_SStructPMatrix *A, + hypre_SStructPMatrix *P, HYPRE_Int cdir, hypre_Index cindex, hypre_Index cstride, + hypre_SStructPMatrix *Ac ); /* sys_pfmg_solve.c */ -HYPRE_Int hypre_SysPFMGSolve ( void *sys_pfmg_vdata , hypre_SStructMatrix *A_in , hypre_SStructVector *b_in , hypre_SStructVector *x_in ); +HYPRE_Int hypre_SysPFMGSolve ( void *sys_pfmg_vdata, hypre_SStructMatrix *A_in, + hypre_SStructVector *b_in, hypre_SStructVector *x_in ); /* sys_semi_interp.c */ HYPRE_Int hypre_SysSemiInterpCreate ( void **sys_interp_vdata_ptr ); -HYPRE_Int hypre_SysSemiInterpSetup ( void *sys_interp_vdata , hypre_SStructPMatrix *P , HYPRE_Int P_stored_as_transpose , hypre_SStructPVector *xc , hypre_SStructPVector *e , hypre_Index cindex , hypre_Index findex , hypre_Index stride ); -HYPRE_Int hypre_SysSemiInterp ( void *sys_interp_vdata , hypre_SStructPMatrix *P , hypre_SStructPVector *xc , hypre_SStructPVector *e ); +HYPRE_Int hypre_SysSemiInterpSetup ( void *sys_interp_vdata, hypre_SStructPMatrix *P, + HYPRE_Int P_stored_as_transpose, hypre_SStructPVector *xc, hypre_SStructPVector *e, + hypre_Index cindex, hypre_Index findex, hypre_Index stride ); +HYPRE_Int hypre_SysSemiInterp ( void *sys_interp_vdata, hypre_SStructPMatrix *P, + hypre_SStructPVector *xc, hypre_SStructPVector *e ); HYPRE_Int hypre_SysSemiInterpDestroy ( void *sys_interp_vdata ); /* sys_semi_restrict.c */ HYPRE_Int hypre_SysSemiRestrictCreate ( void **sys_restrict_vdata_ptr ); -HYPRE_Int hypre_SysSemiRestrictSetup ( void *sys_restrict_vdata , hypre_SStructPMatrix *R , HYPRE_Int R_stored_as_transpose , hypre_SStructPVector *r , hypre_SStructPVector *rc , hypre_Index cindex , hypre_Index findex , hypre_Index stride ); -HYPRE_Int hypre_SysSemiRestrict ( void *sys_restrict_vdata , hypre_SStructPMatrix *R , hypre_SStructPVector *r , hypre_SStructPVector *rc ); +HYPRE_Int hypre_SysSemiRestrictSetup ( void *sys_restrict_vdata, hypre_SStructPMatrix *R, + HYPRE_Int R_stored_as_transpose, hypre_SStructPVector *r, hypre_SStructPVector *rc, + hypre_Index cindex, hypre_Index findex, hypre_Index stride ); +HYPRE_Int hypre_SysSemiRestrict ( void *sys_restrict_vdata, hypre_SStructPMatrix *R, + hypre_SStructPVector *r, hypre_SStructPVector *rc ); HYPRE_Int hypre_SysSemiRestrictDestroy ( void *sys_restrict_vdata ); #ifdef __cplusplus diff --git a/external/hypre/src/sstruct_ls/bsearch.c b/external/hypre/src/sstruct_ls/bsearch.c index 71deed2b..3ed378c3 100644 --- a/external/hypre/src/sstruct_ls/bsearch.c +++ b/external/hypre/src/sstruct_ls/bsearch.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -14,7 +14,7 @@ * list[m-1] < value <= list[m]. * The routine returns location m or -1. *--------------------------------------------------------------------------*/ - + HYPRE_Int hypre_LowerBinarySearch(HYPRE_Int *list, HYPRE_Int value, HYPRE_Int list_length) { HYPRE_Int low, high, m; @@ -33,27 +33,27 @@ HYPRE_Int hypre_LowerBinarySearch(HYPRE_Int *list, HYPRE_Int value, HYPRE_Int li } low = 0; - high= list_length-1; + high = list_length - 1; while (not_found && low <= high) { m = (low + high) / 2; if (m < 1) { - m= 1; + m = 1; } - if (list[m-1] < value && list[m] < value) + if (list[m - 1] < value && list[m] < value) { - low= m + 1; + low = m + 1; } - else if (value <= list[m-1] && value <= list[m]) + else if (value <= list[m - 1] && value <= list[m]) { - high= m - 1; + high = m - 1; } else { - not_found = 0; - return m; + not_found = 0; + return m; } } return -1; @@ -77,28 +77,28 @@ HYPRE_Int hypre_UpperBinarySearch(HYPRE_Int *list, HYPRE_Int value, HYPRE_Int li } /* special case, list[list_length-1] >= value */ - if (list[list_length-1] <= value) + if (list[list_length - 1] <= value) { - return (list_length-1); + return (list_length - 1); } low = 0; - high= list_length-1; + high = list_length - 1; while (not_found && low <= high) { m = (low + high) / 2; - if (list[m] <= value && list[m+1] <= value) + if (list[m] <= value && list[m + 1] <= value) { - low= m + 1; + low = m + 1; } - else if (value < list[m] && value < list[m+1]) + else if (value < list[m] && value < list[m + 1]) { - high= m - 1; + high = m - 1; } else { - not_found = 0; - return m; + not_found = 0; + return m; } } diff --git a/external/hypre/src/sstruct_ls/eliminate_rowscols.c b/external/hypre/src/sstruct_ls/eliminate_rowscols.c index 565a4eeb..f75defd3 100644 --- a/external/hypre/src/sstruct_ls/eliminate_rowscols.c +++ b/external/hypre/src/sstruct_ls/eliminate_rowscols.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -7,10 +7,10 @@ #include "_hypre_parcsr_mv.h" #include "eliminate_rowscols.h" - + HYPRE_Int hypre_ParCSRMatrixEliminateRowsCols (hypre_ParCSRMatrix *A, - HYPRE_Int nrows_to_eliminate, - HYPRE_Int *rows_to_eliminate) + HYPRE_Int nrows_to_eliminate, + HYPRE_Int *rows_to_eliminate) { HYPRE_Int ierr = 0; @@ -28,7 +28,7 @@ HYPRE_Int hypre_ParCSRMatrixEliminateRowsCols (hypre_ParCSRMatrix *A, HYPRE_Int ibeg; hypre_MPI_Comm_rank(comm, &myproc); - ibeg= 0; + ibeg = 0; /* take care of the diagonal part (sequential elimination) */ @@ -60,23 +60,27 @@ HYPRE_Int hypre_ParCSRMatrixEliminateRowsCols (hypre_ParCSRMatrix *A, /* which of the local rows are to be eliminated */ for (i = 0; i < diag_nrows; i++) + { eliminate_row[i] = 0; + } for (i = 0; i < nrows_to_eliminate; i++) - eliminate_row[rows_to_eliminate[i]-ibeg] = 1; + { + eliminate_row[rows_to_eliminate[i] - ibeg] = 1; + } /* use a Matvec communication pattern to find (in eliminate_col) which of the local offd columns are to be eliminated */ num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg); - int_buf_data = hypre_CTAlloc(HYPRE_Int, - hypre_ParCSRCommPkgSendMapStart(comm_pkg, + int_buf_data = hypre_CTAlloc(HYPRE_Int, + hypre_ParCSRCommPkgSendMapStart(comm_pkg, num_sends), HYPRE_MEMORY_HOST); index = 0; for (i = 0; i < num_sends; i++) { start = hypre_ParCSRCommPkgSendMapStart(comm_pkg, i); - for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i+1); j++) + for (j = start; j < hypre_ParCSRCommPkgSendMapStart(comm_pkg, i + 1); j++) { - k = hypre_ParCSRCommPkgSendMapElmt(comm_pkg,j); + k = hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j); int_buf_data[index++] = eliminate_row[k]; } } @@ -88,14 +92,18 @@ HYPRE_Int hypre_ParCSRMatrixEliminateRowsCols (hypre_ParCSRMatrix *A, ncols_to_eliminate = 0; for (i = 0; i < offd_ncols; i++) if (eliminate_col[i]) + { ncols_to_eliminate++; + } cols_to_eliminate = hypre_CTAlloc(HYPRE_Int, ncols_to_eliminate, HYPRE_MEMORY_HOST); ncols_to_eliminate = 0; for (i = 0; i < offd_ncols; i++) if (eliminate_col[i]) + { cols_to_eliminate[ncols_to_eliminate++] = i; + } hypre_TFree(int_buf_data, HYPRE_MEMORY_HOST); hypre_TFree(eliminate_row, HYPRE_MEMORY_HOST); @@ -113,11 +121,11 @@ HYPRE_Int hypre_ParCSRMatrixEliminateRowsCols (hypre_ParCSRMatrix *A, HYPRE_Int hypre_CSRMatrixEliminateRowsColsDiag (hypre_ParCSRMatrix *A, - HYPRE_Int nrows_to_eliminate, - HYPRE_Int *rows_to_eliminate) + HYPRE_Int nrows_to_eliminate, + HYPRE_Int *rows_to_eliminate) { HYPRE_Int ierr = 0; - + MPI_Comm comm = hypre_ParCSRMatrixComm(A); hypre_CSRMatrix *Adiag = hypre_ParCSRMatrixDiag(A); @@ -130,26 +138,28 @@ HYPRE_Int hypre_CSRMatrixEliminateRowsColsDiag (hypre_ParCSRMatrix *A, HYPRE_Real *Adata = hypre_CSRMatrixData(Adiag); HYPRE_Int *local_rows; - + HYPRE_Int myproc; hypre_MPI_Comm_rank(comm, &myproc); - ibeg= 0; + ibeg = 0; /* grab local rows to eliminate */ - local_rows= hypre_TAlloc(HYPRE_Int, nrows_to_eliminate, HYPRE_MEMORY_HOST); - for (i= 0; i< nrows_to_eliminate; i++) + local_rows = hypre_TAlloc(HYPRE_Int, nrows_to_eliminate, HYPRE_MEMORY_HOST); + for (i = 0; i < nrows_to_eliminate; i++) { - local_rows[i]= rows_to_eliminate[i]-ibeg; + local_rows[i] = rows_to_eliminate[i] - ibeg; } - + /* remove the columns */ for (i = 0; i < nnz; i++) { irow = hypre_BinarySearch(local_rows, Aj[i], nrows_to_eliminate); if (irow != -1) + { Adata[i] = 0.0; + } } /* remove the rows and set the diagonal equal to 1 */ @@ -157,12 +167,16 @@ HYPRE_Int hypre_CSRMatrixEliminateRowsColsDiag (hypre_ParCSRMatrix *A, { irow = local_rows[i]; ibeg = Ai[irow]; - iend = Ai[irow+1]; + iend = Ai[irow + 1]; for (j = ibeg; j < iend; j++) if (Aj[j] == irow) + { Adata[j] = 1.0; + } else + { Adata[j] = 0.0; + } } hypre_TFree(local_rows, HYPRE_MEMORY_HOST); @@ -171,8 +185,8 @@ HYPRE_Int hypre_CSRMatrixEliminateRowsColsDiag (hypre_ParCSRMatrix *A, } HYPRE_Int hypre_CSRMatrixEliminateRowsOffd (hypre_ParCSRMatrix *A, - HYPRE_Int nrows_to_eliminate, - HYPRE_Int *rows_to_eliminate) + HYPRE_Int nrows_to_eliminate, + HYPRE_Int *rows_to_eliminate) { HYPRE_Int ierr = 0; @@ -190,21 +204,23 @@ HYPRE_Int hypre_CSRMatrixEliminateRowsOffd (hypre_ParCSRMatrix *A, HYPRE_Int myproc; hypre_MPI_Comm_rank(comm, &myproc); - ibeg= 0; + ibeg = 0; /* grab local rows to eliminate */ - local_rows= hypre_TAlloc(HYPRE_Int, nrows_to_eliminate, HYPRE_MEMORY_HOST); - for (i= 0; i< nrows_to_eliminate; i++) + local_rows = hypre_TAlloc(HYPRE_Int, nrows_to_eliminate, HYPRE_MEMORY_HOST); + for (i = 0; i < nrows_to_eliminate; i++) { - local_rows[i]= rows_to_eliminate[i]-ibeg; + local_rows[i] = rows_to_eliminate[i] - ibeg; } for (i = 0; i < nrows_to_eliminate; i++) { ibeg = Ai[local_rows[i]]; - iend = Ai[local_rows[i]+1]; + iend = Ai[local_rows[i] + 1]; for (j = ibeg; j < iend; j++) + { Adata[j] = 0.0; + } } hypre_TFree(local_rows, HYPRE_MEMORY_HOST); @@ -213,8 +229,8 @@ HYPRE_Int hypre_CSRMatrixEliminateRowsOffd (hypre_ParCSRMatrix *A, } HYPRE_Int hypre_CSRMatrixEliminateColsOffd (hypre_CSRMatrix *Aoffd, - HYPRE_Int ncols_to_eliminate, - HYPRE_Int *cols_to_eliminate) + HYPRE_Int ncols_to_eliminate, + HYPRE_Int *cols_to_eliminate) { HYPRE_Int ierr = 0; @@ -230,7 +246,9 @@ HYPRE_Int hypre_CSRMatrixEliminateColsOffd (hypre_CSRMatrix *Aoffd, icol = hypre_BinarySearch(cols_to_eliminate, Aj[i], ncols_to_eliminate); if (icol != -1) + { Adata[i] = 0.0; + } } return ierr; diff --git a/external/hypre/src/sstruct_ls/eliminate_rowscols.h b/external/hypre/src/sstruct_ls/eliminate_rowscols.h index fb9ff61b..6ca9d907 100644 --- a/external/hypre/src/sstruct_ls/eliminate_rowscols.h +++ b/external/hypre/src/sstruct_ls/eliminate_rowscols.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -11,7 +11,7 @@ #ifdef __cplusplus extern "C" { #endif - + /* Function: hypre_ParCSRMatrixEliminateRowsCols @@ -25,8 +25,8 @@ extern "C" { \ A_bi | A_bb / \ 0 | I / */ HYPRE_Int hypre_ParCSRMatrixEliminateRowsCols (hypre_ParCSRMatrix *A, - HYPRE_Int nrows_to_eliminate, - HYPRE_Int *rows_to_eliminate); + HYPRE_Int nrows_to_eliminate, + HYPRE_Int *rows_to_eliminate); /* @@ -36,8 +36,8 @@ HYPRE_Int hypre_ParCSRMatrixEliminateRowsCols (hypre_ParCSRMatrix *A, given sorted (!) list of rows. Put I on the eliminated diagonal. */ HYPRE_Int hypre_CSRMatrixEliminateRowsColsDiag (hypre_ParCSRMatrix *A, - HYPRE_Int nrows_to_eliminate, - HYPRE_Int *rows_to_eliminate); + HYPRE_Int nrows_to_eliminate, + HYPRE_Int *rows_to_eliminate); /* Function: hypre_CSRMatrixEliminateRowsOffd @@ -45,8 +45,8 @@ HYPRE_Int hypre_CSRMatrixEliminateRowsColsDiag (hypre_ParCSRMatrix *A, Eliminate the given list of rows of Aoffd. */ HYPRE_Int hypre_CSRMatrixEliminateRowsOffd (hypre_ParCSRMatrix *A, - HYPRE_Int nrows_to_eliminate, - HYPRE_Int *rows_to_eliminate); + HYPRE_Int nrows_to_eliminate, + HYPRE_Int *rows_to_eliminate); /* Function: hypre_CSRMatrixEliminateColsOffd @@ -54,8 +54,8 @@ HYPRE_Int hypre_CSRMatrixEliminateRowsOffd (hypre_ParCSRMatrix *A, Eliminate the given sorted (!) list of columns of Aoffd. */ HYPRE_Int hypre_CSRMatrixEliminateColsOffd (hypre_CSRMatrix *Aoffd, - HYPRE_Int ncols_to_eliminate, - HYPRE_Int *cols_to_eliminate); + HYPRE_Int ncols_to_eliminate, + HYPRE_Int *cols_to_eliminate); #ifdef __cplusplus } diff --git a/external/hypre/src/sstruct_ls/fac.c b/external/hypre/src/sstruct_ls/fac.c index 1e7f7185..003974a2 100644 --- a/external/hypre/src/sstruct_ls/fac.c +++ b/external/hypre/src/sstruct_ls/fac.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -14,9 +14,9 @@ void * hypre_FACCreate( MPI_Comm comm ) { - hypre_FACData *fac_data; + hypre_FACData *fac_data; - fac_data = hypre_CTAlloc(hypre_FACData, 1, HYPRE_MEMORY_HOST); + fac_data = hypre_CTAlloc(hypre_FACData, 1, HYPRE_MEMORY_HOST); (fac_data -> comm) = comm; (fac_data -> time_index) = hypre_InitializeTiming("FAC"); @@ -28,7 +28,7 @@ hypre_FACCreate( MPI_Comm comm ) (fac_data -> max_levels) = 0; (fac_data -> relax_type) = 2; /* 1 Jacobi; 2 Gauss-Seidel */ (fac_data -> jacobi_weight) = 0.0; - (fac_data -> usr_jacobi_weight)= 0; + (fac_data -> usr_jacobi_weight) = 0; (fac_data -> num_pre_smooth) = 1; (fac_data -> num_post_smooth) = 1; (fac_data -> csolver_type) = 1; @@ -43,19 +43,19 @@ hypre_FACCreate( MPI_Comm comm ) HYPRE_Int hypre_FACDestroy2(void *fac_vdata) { - hypre_FACData *fac_data = (hypre_FACData *)fac_vdata; + hypre_FACData *fac_data = (hypre_FACData *)fac_vdata; HYPRE_Int level; HYPRE_Int ierr = 0; if (fac_data) { - hypre_TFree((fac_data ->plevels) , HYPRE_MEMORY_HOST); - hypre_TFree((fac_data ->prefinements) , HYPRE_MEMORY_HOST); + hypre_TFree((fac_data ->plevels), HYPRE_MEMORY_HOST); + hypre_TFree((fac_data ->prefinements), HYPRE_MEMORY_HOST); HYPRE_SStructGraphDestroy(hypre_SStructMatrixGraph((fac_data -> A_rap))); HYPRE_SStructMatrixDestroy((fac_data -> A_rap)); - for (level= 0; level<= (fac_data -> max_levels); level++) + for (level = 0; level <= (fac_data -> max_levels); level++) { HYPRE_SStructMatrixDestroy( (fac_data -> A_level[level]) ); HYPRE_SStructVectorDestroy( (fac_data -> x_level[level]) ); @@ -85,19 +85,19 @@ hypre_FACDestroy2(void *fac_vdata) hypre_SStructMatvecDestroy( (fac_data -> matvec_data) ); hypre_TFree(fac_data -> A_level, HYPRE_MEMORY_HOST); - hypre_TFree(fac_data -> x_level, HYPRE_MEMORY_HOST); - hypre_TFree(fac_data -> b_level, HYPRE_MEMORY_HOST); - hypre_TFree(fac_data -> r_level, HYPRE_MEMORY_HOST); - hypre_TFree(fac_data -> e_level, HYPRE_MEMORY_HOST); - hypre_TFree(fac_data -> tx_level, HYPRE_MEMORY_HOST); - hypre_TFree(fac_data -> relax_data_level, HYPRE_MEMORY_HOST); - hypre_TFree(fac_data -> restrict_data_level, HYPRE_MEMORY_HOST); - hypre_TFree(fac_data -> matvec_data_level, HYPRE_MEMORY_HOST); - hypre_TFree(fac_data -> pmatvec_data_level, HYPRE_MEMORY_HOST); - hypre_TFree(fac_data -> interp_data_level, HYPRE_MEMORY_HOST); - - hypre_TFree(fac_data -> grid_level, HYPRE_MEMORY_HOST); - hypre_TFree(fac_data -> graph_level, HYPRE_MEMORY_HOST); + hypre_TFree(fac_data -> x_level, HYPRE_MEMORY_HOST); + hypre_TFree(fac_data -> b_level, HYPRE_MEMORY_HOST); + hypre_TFree(fac_data -> r_level, HYPRE_MEMORY_HOST); + hypre_TFree(fac_data -> e_level, HYPRE_MEMORY_HOST); + hypre_TFree(fac_data -> tx_level, HYPRE_MEMORY_HOST); + hypre_TFree(fac_data -> relax_data_level, HYPRE_MEMORY_HOST); + hypre_TFree(fac_data -> restrict_data_level, HYPRE_MEMORY_HOST); + hypre_TFree(fac_data -> matvec_data_level, HYPRE_MEMORY_HOST); + hypre_TFree(fac_data -> pmatvec_data_level, HYPRE_MEMORY_HOST); + hypre_TFree(fac_data -> interp_data_level, HYPRE_MEMORY_HOST); + + hypre_TFree(fac_data -> grid_level, HYPRE_MEMORY_HOST); + hypre_TFree(fac_data -> graph_level, HYPRE_MEMORY_HOST); HYPRE_SStructVectorDestroy(fac_data -> tx); @@ -107,12 +107,12 @@ hypre_FACDestroy2(void *fac_vdata) if ( (fac_data -> csolver_type) == 1) { - HYPRE_SStructPCGDestroy(fac_data -> csolver); - HYPRE_SStructSysPFMGDestroy(fac_data -> cprecond); + HYPRE_SStructPCGDestroy(fac_data -> csolver); + HYPRE_SStructSysPFMGDestroy(fac_data -> cprecond); } else if ((fac_data -> csolver_type) == 2) { - HYPRE_SStructSysPFMGDestroy(fac_data -> csolver); + HYPRE_SStructSysPFMGDestroy(fac_data -> csolver); } if ((fac_data -> logging) > 0) @@ -126,7 +126,7 @@ hypre_FACDestroy2(void *fac_vdata) hypre_TFree(fac_data, HYPRE_MEMORY_HOST); } - return(ierr); + return (ierr); } HYPRE_Int @@ -155,14 +155,14 @@ hypre_FACSetPLevels( void *fac_vdata, HYPRE_Int ierr = 0; HYPRE_Int i; - fac_plevels= hypre_CTAlloc(HYPRE_Int, nparts, HYPRE_MEMORY_HOST); + fac_plevels = hypre_CTAlloc(HYPRE_Int, nparts, HYPRE_MEMORY_HOST); - for (i= 0; i< nparts; i++) + for (i = 0; i < nparts; i++) { - fac_plevels[i]= plevels[i]; + fac_plevels[i] = plevels[i]; } - (fac_data -> plevels)= fac_plevels; + (fac_data -> plevels) = fac_plevels; return ierr; } @@ -180,14 +180,14 @@ hypre_FACSetPRefinements( void *fac_vdata, HYPRE_Int ierr = 0; HYPRE_Int i; - fac_prefinements= hypre_TAlloc(hypre_Index, nparts, HYPRE_MEMORY_HOST); + fac_prefinements = hypre_TAlloc(hypre_Index, nparts, HYPRE_MEMORY_HOST); - for (i= 0; i< nparts; i++) + for (i = 0; i < nparts; i++) { hypre_CopyIndex( prefinements[i], fac_prefinements[i] ); } - (fac_data -> prefinements)= fac_prefinements; + (fac_data -> prefinements) = fac_prefinements; return ierr; } @@ -202,7 +202,7 @@ hypre_FACSetMaxLevels( void *fac_vdata, hypre_FACData *fac_data = (hypre_FACData *)fac_vdata; HYPRE_Int ierr = 0; - (fac_data -> max_levels) = nparts-1; + (fac_data -> max_levels) = nparts - 1; return ierr; } @@ -279,10 +279,10 @@ hypre_FACSetJacobiWeight( void *fac_vdata, HYPRE_Real weight ) { hypre_FACData *fac_data = (hypre_FACData *)fac_vdata; - + (fac_data -> jacobi_weight) = weight; - (fac_data -> usr_jacobi_weight)= 1; - + (fac_data -> usr_jacobi_weight) = 1; + return hypre_error_flag; } @@ -388,8 +388,8 @@ hypre_FACPrintLogging( void *fac_vdata, { for (i = 0; i < num_iterations; i++) { - hypre_printf("Residual norm[%d] = %e ",i,norms[i]); - hypre_printf("Relative residual norm[%d] = %e\n",i,rel_norms[i]); + hypre_printf("Residual norm[%d] = %e ", i, norms[i]); + hypre_printf("Relative residual norm[%d] = %e\n", i, rel_norms[i]); } } } @@ -423,7 +423,7 @@ hypre_FACGetFinalRelativeResidualNorm( void *fac_vdata, } else if (num_iterations == max_iter) { - *relative_residual_norm = rel_norms[num_iterations-1]; + *relative_residual_norm = rel_norms[num_iterations - 1]; } else { diff --git a/external/hypre/src/sstruct_ls/fac.h b/external/hypre/src/sstruct_ls/fac.h index fa0c3508..39bc6efc 100644 --- a/external/hypre/src/sstruct_ls/fac.h +++ b/external/hypre/src/sstruct_ls/fac.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -20,7 +20,7 @@ typedef struct { MPI_Comm comm; - + HYPRE_Int *plevels; hypre_Index *prefinements; diff --git a/external/hypre/src/sstruct_ls/fac_CFInterfaceExtents.c b/external/hypre/src/sstruct_ls/fac_CFInterfaceExtents.c index 260dd125..43df0ebf 100644 --- a/external/hypre/src/sstruct_ls/fac_CFInterfaceExtents.c +++ b/external/hypre/src/sstruct_ls/fac_CFInterfaceExtents.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -40,57 +40,57 @@ hypre_CFInterfaceExtents( hypre_Box *fgrid_box, HYPRE_Int stencil_size; HYPRE_Int abs_stencil; - HYPRE_Int ndim= hypre_StructStencilNDim(stencils); + HYPRE_Int ndim = hypre_StructStencilNDim(stencils); HYPRE_Int i, j; - + hypre_ClearIndex(zero_index); hypre_ClearIndex(neg_index); - for (i= 0; i< ndim; i++) + for (i = 0; i < ndim; i++) { - neg_index[i]= -1; + neg_index[i] = -1; } hypre_CopyIndex(hypre_BoxIMin(cgrid_box), cstart); stencil_size = hypre_StructStencilSize(stencils); - stencil_box_extents= hypre_BoxArrayCreate(stencil_size, ndim); + stencil_box_extents = hypre_BoxArrayCreate(stencil_size, ndim); union_boxes = hypre_BoxArrayCreate(0, ndim); - for (i= 0; i< stencil_size; i++) + for (i = 0; i < stencil_size; i++) { - hypre_CopyIndex(hypre_StructStencilElement(stencils, i), stencil_shape); - AbsStencilShape(stencil_shape, abs_stencil); + hypre_CopyIndex(hypre_StructStencilElement(stencils, i), stencil_shape); + AbsStencilShape(stencil_shape, abs_stencil); - if (abs_stencil) /* only do if not the centre stencil */ - { - cfine_box= hypre_CF_StenBox(fgrid_box, cgrid_box, stencil_shape, rfactors, + if (abs_stencil) /* only do if not the centre stencil */ + { + cfine_box = hypre_CF_StenBox(fgrid_box, cgrid_box, stencil_shape, rfactors, ndim); - if ( hypre_BoxVolume(cfine_box) ) - { - hypre_AppendBox(cfine_box, union_boxes); - hypre_CopyBox(cfine_box, hypre_BoxArrayBox(stencil_box_extents, i)); - for (j= 0; j< ndim; j++) - { - hypre_BoxIMin(cfine_box)[j]-= cstart[j]; - hypre_BoxIMax(cfine_box)[j]-= cstart[j]; - } - hypre_CopyBox(cfine_box, hypre_BoxArrayBox(stencil_box_extents, i)); - } - - else - { - hypre_BoxSetExtents(hypre_BoxArrayBox(stencil_box_extents, i), - zero_index, neg_index); - } - - hypre_BoxDestroy(cfine_box); - } - - else /* centre */ - { - hypre_BoxSetExtents(hypre_BoxArrayBox(stencil_box_extents, i), - zero_index, neg_index); - } + if ( hypre_BoxVolume(cfine_box) ) + { + hypre_AppendBox(cfine_box, union_boxes); + hypre_CopyBox(cfine_box, hypre_BoxArrayBox(stencil_box_extents, i)); + for (j = 0; j < ndim; j++) + { + hypre_BoxIMin(cfine_box)[j] -= cstart[j]; + hypre_BoxIMax(cfine_box)[j] -= cstart[j]; + } + hypre_CopyBox(cfine_box, hypre_BoxArrayBox(stencil_box_extents, i)); + } + + else + { + hypre_BoxSetExtents(hypre_BoxArrayBox(stencil_box_extents, i), + zero_index, neg_index); + } + + hypre_BoxDestroy(cfine_box); + } + + else /* centre */ + { + hypre_BoxSetExtents(hypre_BoxArrayBox(stencil_box_extents, i), + zero_index, neg_index); + } } /*-------------------------------------------------------------------------- @@ -100,22 +100,22 @@ hypre_CFInterfaceExtents( hypre_Box *fgrid_box, *--------------------------------------------------------------------------*/ if (hypre_BoxArraySize(union_boxes) > 1) { - hypre_UnionBoxes(union_boxes); + hypre_UnionBoxes(union_boxes); } hypre_ForBoxI(i, union_boxes) { - hypre_AppendBox(hypre_BoxArrayBox(union_boxes, i), stencil_box_extents); + hypre_AppendBox(hypre_BoxArrayBox(union_boxes, i), stencil_box_extents); } hypre_BoxArrayDestroy(union_boxes); - - for (i= stencil_size; i< hypre_BoxArraySize(stencil_box_extents); i++) + + for (i = stencil_size; i < hypre_BoxArraySize(stencil_box_extents); i++) { - box= hypre_BoxArrayBox(stencil_box_extents, i); - for (j= 0; j< ndim; j++) + box = hypre_BoxArrayBox(stencil_box_extents, i); + for (j = 0; j < ndim; j++) { - hypre_BoxIMin(box)[j]-= cstart[j]; - hypre_BoxIMax(box)[j]-= cstart[j]; + hypre_BoxIMin(box)[j] -= cstart[j]; + hypre_BoxIMax(box)[j] -= cstart[j]; } } @@ -127,7 +127,7 @@ hypre_CFInterfaceExtents2( hypre_Box *fgrid_box, hypre_Box *cgrid_box, hypre_StructStencil *stencils, hypre_Index rfactors, - hypre_BoxArray *cf_interface ) + hypre_BoxArray *cf_interface ) { hypre_BoxArray *stencil_box_extents; @@ -138,71 +138,71 @@ hypre_CFInterfaceExtents2( hypre_Box *fgrid_box, HYPRE_Int stencil_size; HYPRE_Int abs_stencil; - HYPRE_Int ndim= hypre_StructStencilNDim(stencils); + HYPRE_Int ndim = hypre_StructStencilNDim(stencils); HYPRE_Int i; - HYPRE_Int ierr= 0; - + HYPRE_Int ierr = 0; + hypre_ClearIndex(zero_index); hypre_ClearIndex(neg_index); - for (i= 0; i< ndim; i++) + for (i = 0; i < ndim; i++) { - neg_index[i]= -1; + neg_index[i] = -1; } stencil_size = hypre_StructStencilSize(stencils); - stencil_box_extents= hypre_BoxArrayCreate(stencil_size, ndim); + stencil_box_extents = hypre_BoxArrayCreate(stencil_size, ndim); union_boxes = hypre_BoxArrayCreate(0, ndim); - for (i= 0; i< stencil_size; i++) + for (i = 0; i < stencil_size; i++) { - hypre_CopyIndex(hypre_StructStencilElement(stencils, i), stencil_shape); - AbsStencilShape(stencil_shape, abs_stencil); + hypre_CopyIndex(hypre_StructStencilElement(stencils, i), stencil_shape); + AbsStencilShape(stencil_shape, abs_stencil); - if (abs_stencil) /* only do if not the centre stencil */ - { - cfine_box= hypre_CF_StenBox(fgrid_box, cgrid_box, stencil_shape, + if (abs_stencil) /* only do if not the centre stencil */ + { + cfine_box = hypre_CF_StenBox(fgrid_box, cgrid_box, stencil_shape, rfactors, ndim); - if ( hypre_BoxVolume(cfine_box) ) - { - hypre_AppendBox(cfine_box, union_boxes); - hypre_CopyBox(cfine_box, hypre_BoxArrayBox(stencil_box_extents, i)); - } - - else - { - hypre_BoxSetExtents(hypre_BoxArrayBox(stencil_box_extents, i), - zero_index, neg_index); - } - - hypre_BoxDestroy(cfine_box); - } - - else /* centre */ - { - hypre_BoxSetExtents(hypre_BoxArrayBox(stencil_box_extents, i), - zero_index, neg_index); - } + if ( hypre_BoxVolume(cfine_box) ) + { + hypre_AppendBox(cfine_box, union_boxes); + hypre_CopyBox(cfine_box, hypre_BoxArrayBox(stencil_box_extents, i)); + } + + else + { + hypre_BoxSetExtents(hypre_BoxArrayBox(stencil_box_extents, i), + zero_index, neg_index); + } + + hypre_BoxDestroy(cfine_box); + } + + else /* centre */ + { + hypre_BoxSetExtents(hypre_BoxArrayBox(stencil_box_extents, i), + zero_index, neg_index); + } } /*-------------------------------------------------------------------------- * Union the stencil_box_extents to get the full CF extents and append to - * the end of the stencil_box_extents BoxArray. + * the end of the stencil_box_extents BoxArray. *--------------------------------------------------------------------------*/ if (hypre_BoxArraySize(union_boxes) > 1) { - hypre_UnionBoxes(union_boxes); + hypre_UnionBoxes(union_boxes); } hypre_ForBoxI(i, union_boxes) { - hypre_AppendBox(hypre_BoxArrayBox(union_boxes, i), stencil_box_extents); + hypre_AppendBox(hypre_BoxArrayBox(union_boxes, i), stencil_box_extents); } hypre_AppendBoxArray(stencil_box_extents, cf_interface); hypre_BoxArrayDestroy(union_boxes); hypre_BoxArrayDestroy(stencil_box_extents); - + return ierr; } diff --git a/external/hypre/src/sstruct_ls/fac_amr_fcoarsen.c b/external/hypre/src/sstruct_ls/fac_amr_fcoarsen.c index 0b058275..52cd8cf7 100644 --- a/external/hypre/src/sstruct_ls/fac_amr_fcoarsen.c +++ b/external/hypre/src/sstruct_ls/fac_amr_fcoarsen.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -81,22 +81,22 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, HYPRE_Int graph_type = hypre_SStructGraphObjectType(graph); hypre_SStructGrid *grid = hypre_SStructGraphGrid(graph); HYPRE_IJMatrix ij_A = hypre_SStructMatrixIJMatrix(A); - HYPRE_Int matrix_type= hypre_SStructMatrixObjectType(A); + HYPRE_Int matrix_type = hypre_SStructMatrixObjectType(A); HYPRE_Int ndim = hypre_SStructMatrixNDim(A); hypre_SStructPMatrix *A_pmatrix = hypre_SStructMatrixPMatrix(fac_A, level); hypre_StructMatrix *smatrix_var; hypre_StructStencil *stencils, *stencils_last; - HYPRE_Int stencil_size, stencil_last_size; + HYPRE_Int stencil_size = 0, stencil_last_size; hypre_Index stencil_shape_i, stencil_last_shape_i; hypre_Index loop_size; hypre_Box loop_box; HYPRE_Real **a_ptrs; hypre_Box *A_dbox; - HYPRE_Int part_crse= level-1; - HYPRE_Int part_fine= level; + HYPRE_Int part_crse = level - 1; + HYPRE_Int part_fine = level; hypre_StructMatrix *crse_smatrix; HYPRE_Real *crse_ptr; @@ -131,25 +131,25 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, hypre_BoxArray *data_space; HYPRE_Int ci, fi, arrayi; - HYPRE_Int max_stencil_size= 27; + HYPRE_Int max_stencil_size = 27; HYPRE_Int trueV = 1; - HYPRE_Int falseV= 0; + HYPRE_Int falseV = 0; HYPRE_Int found, sort; HYPRE_Int stencil_marker; - HYPRE_Int *stencil_ranks, *rank_stencils; - HYPRE_Int *stencil_contrib_cnt; - HYPRE_Int **stencil_contrib_i; - HYPRE_Real **weight_contrib_i; - HYPRE_Real weights[4]= {1.0, 0.25, 0.125, 0.0625}; + HYPRE_Int *stencil_ranks = NULL, *rank_stencils = NULL; + HYPRE_Int *stencil_contrib_cnt = NULL; + HYPRE_Int **stencil_contrib_i = NULL; + HYPRE_Real **weight_contrib_i = NULL; + HYPRE_Real weights[4] = {1.0, 0.25, 0.125, 0.0625}; HYPRE_Real sum; HYPRE_Int abs_stencil_shape; - hypre_Box **shift_box; + hypre_Box **shift_box = NULL; hypre_Box coarse_cell_box; HYPRE_Int volume_coarse_cell_box; - HYPRE_Int *volume_shift_box; - HYPRE_Int max_contribut_size, stencil_i; + HYPRE_Int *volume_shift_box = NULL; + HYPRE_Int max_contribut_size = 0, stencil_i; HYPRE_BigInt startrank, rank; - HYPRE_Real *vals, *vals2; + HYPRE_Real *vals = NULL, *vals2 = NULL; HYPRE_Int i, j, k, l, m, n, ll, kk, jj; HYPRE_Int nvars, var1, var2, var2_start; @@ -166,7 +166,7 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, HYPRE_Int *box_connections; HYPRE_Int **coarse_contrib_Uv; HYPRE_Int *fine_interface_ranks; - HYPRE_Int nUventries= hypre_SStructGraphNUVEntries(graph); + HYPRE_Int nUventries = hypre_SStructGraphNUVEntries(graph); HYPRE_Int *iUventries = hypre_SStructGraphIUVEntries(graph); hypre_SStructUVEntry **Uventries = hypre_SStructGraphUVEntries(graph); hypre_SStructUVEntry *Uventry; @@ -205,6 +205,7 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, hypre_BoxInit(&intersect_box, ndim); hypre_BoxInit(&loop_box, ndim); hypre_BoxInit(&coarse_cell_box, ndim); + hypre_SetIndex3(lindex, 0, 0, 0); /*-------------------------------------------------------------------------- * Task: Coarsen the fbox and f/c connections to form the coarse grid @@ -213,33 +214,38 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, if (graph_type == HYPRE_SSTRUCT) { - startrank = hypre_SStructGridGhstartRank(grid); + startrank = hypre_SStructGridGhstartRank(grid); } - if (graph_type == HYPRE_PARCSR) + else if (graph_type == HYPRE_PARCSR) { - startrank = hypre_SStructGridStartRank(grid); + startrank = hypre_SStructGridStartRank(grid); + } + else + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unsupported graph_type!"); + return hypre_error_flag; } /*-------------------------------------------------------------------------- * Fine grid strides by the refinement factors. *--------------------------------------------------------------------------*/ hypre_SetIndex3(stridec, 1, 1, 1); - for (i= 0; i< ndim; i++) + for (i = 0; i < ndim; i++) { - stridef[i]= refine_factors[i]; + stridef[i] = refine_factors[i]; } - for (i= ndim; i< 3; i++) + for (i = ndim; i < 3; i++) { - stridef[i]= 1; + stridef[i] = 1; } /*-------------------------------------------------------------------------- * Scaling for averaging row sum. *--------------------------------------------------------------------------*/ - scaling= 1.0; - for (i= 0; i< ndim-2; i++) + scaling = 1.0; + for (i = 0; i < ndim - 2; i++) { - scaling*= refine_factors[0]; + scaling *= refine_factors[0]; } /*-------------------------------------------------------------------------- @@ -271,24 +277,27 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, cboxi_fboxes = hypre_TAlloc(HYPRE_Int **, nvars, HYPRE_MEMORY_HOST); cboxi_fcnt = hypre_TAlloc(HYPRE_Int *, nvars, HYPRE_MEMORY_HOST); - for (var1= 0; var1< nvars; var1++) + for (var1 = 0; var1 < nvars; var1++) { - cgrid= hypre_SStructPGridSGrid(hypre_SStructPMatrixPGrid(A_crse), var1); - cgrid_boxes= hypre_StructGridBoxes(cgrid); - fgrid_crse_extents[var1]= hypre_TAlloc(hypre_BoxArray *, - hypre_BoxArraySize(cgrid_boxes), HYPRE_MEMORY_HOST); - fbox_interior[var1]= hypre_TAlloc(hypre_BoxArray *, - hypre_BoxArraySize(cgrid_boxes), HYPRE_MEMORY_HOST); + cgrid = hypre_SStructPGridSGrid(hypre_SStructPMatrixPGrid(A_crse), var1); + cgrid_boxes = hypre_StructGridBoxes(cgrid); + fgrid_crse_extents[var1] = hypre_TAlloc(hypre_BoxArray *, + hypre_BoxArraySize(cgrid_boxes), HYPRE_MEMORY_HOST); + fbox_interior[var1] = hypre_TAlloc(hypre_BoxArray *, + hypre_BoxArraySize(cgrid_boxes), HYPRE_MEMORY_HOST); fbox_bdy[var1] = hypre_TAlloc(hypre_BoxArrayArray *, hypre_BoxArraySize(cgrid_boxes), HYPRE_MEMORY_HOST); - interior_fboxi[var1]= hypre_TAlloc(HYPRE_Int *, hypre_BoxArraySize(cgrid_boxes), HYPRE_MEMORY_HOST); - bdy_fboxi[var1] = hypre_TAlloc(HYPRE_Int *, hypre_BoxArraySize(cgrid_boxes), HYPRE_MEMORY_HOST); + interior_fboxi[var1] = hypre_TAlloc(HYPRE_Int *, hypre_BoxArraySize(cgrid_boxes), + HYPRE_MEMORY_HOST); + bdy_fboxi[var1] = hypre_TAlloc(HYPRE_Int *, hypre_BoxArraySize(cgrid_boxes), + HYPRE_MEMORY_HOST); - fgrid= hypre_SStructPGridSGrid(hypre_SStructPMatrixPGrid(A_pmatrix), var1); - fgrid_boxes= hypre_StructGridBoxes(fgrid); + fgrid = hypre_SStructPGridSGrid(hypre_SStructPMatrixPGrid(A_pmatrix), var1); + fgrid_boxes = hypre_StructGridBoxes(fgrid); - cboxi_fboxes[var1]= hypre_CTAlloc(HYPRE_Int *, hypre_BoxArraySize(fgrid_boxes), HYPRE_MEMORY_HOST); - cboxi_fcnt[var1] = hypre_CTAlloc(HYPRE_Int , hypre_BoxArraySize(fgrid_boxes), HYPRE_MEMORY_HOST); + cboxi_fboxes[var1] = hypre_CTAlloc(HYPRE_Int *, hypre_BoxArraySize(fgrid_boxes), + HYPRE_MEMORY_HOST); + cboxi_fcnt[var1] = hypre_CTAlloc(HYPRE_Int, hypre_BoxArraySize(fgrid_boxes), HYPRE_MEMORY_HOST); /*----------------------------------------------------------------------- * Determine the fine grid boxes that are underlying a coarse grid box. @@ -301,23 +310,23 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, *-----------------------------------------------------------------------*/ hypre_ForBoxI(ci, cgrid_boxes) { - cgrid_box= hypre_BoxArrayBox(cgrid_boxes, ci); + cgrid_box = hypre_BoxArrayBox(cgrid_boxes, ci); hypre_CopyIndex(hypre_BoxIMin(cgrid_box), cstart); - cnt1= 0; - temp1= hypre_CTAlloc(HYPRE_Int, hypre_BoxArraySize(fgrid_boxes), HYPRE_MEMORY_HOST); + cnt1 = 0; + temp1 = hypre_CTAlloc(HYPRE_Int, hypre_BoxArraySize(fgrid_boxes), HYPRE_MEMORY_HOST); hypre_ClearIndex(index_temp); hypre_ForBoxI(fi, fgrid_boxes) { - fgrid_box= hypre_BoxArrayBox(fgrid_boxes, fi); + fgrid_box = hypre_BoxArrayBox(fgrid_boxes, fi); hypre_CopyIndex(hypre_BoxIMin(fgrid_box), fstart); - for (i= 0; i< ndim; i++) + for (i = 0; i < ndim; i++) { - j= fstart[i]%refine_factors[i]; + j = fstart[i] % refine_factors[i]; if (j) { - fstart[i]+= refine_factors[i] - j; + fstart[i] += refine_factors[i] - j; } } @@ -329,19 +338,19 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, hypre_IntersectBoxes(&fine_box, cgrid_box, &intersect_box); if (hypre_BoxVolume(&intersect_box) > 0) { - temp1[cnt1++]= fi; + temp1[cnt1++] = fi; } } - fgrid_crse_extents[var1][ci]= hypre_BoxArrayCreate(cnt1, ndim); + fgrid_crse_extents[var1][ci] = hypre_BoxArrayCreate(cnt1, ndim); fbox_interior[var1][ci] = hypre_BoxArrayCreate(cnt1, ndim); fbox_bdy[var1][ci] = hypre_BoxArrayArrayCreate(cnt1, ndim); interior_fboxi[var1][ci] = hypre_CTAlloc(HYPRE_Int, cnt1, HYPRE_MEMORY_HOST); bdy_fboxi[var1][ci] = hypre_CTAlloc(HYPRE_Int, cnt1, HYPRE_MEMORY_HOST); - for (fi= 0; fi< cnt1; fi++) + for (fi = 0; fi < cnt1; fi++) { - fgrid_box= hypre_BoxArrayBox(fgrid_boxes, temp1[fi]); + fgrid_box = hypre_BoxArrayBox(fgrid_boxes, temp1[fi]); hypre_CopyIndex(hypre_BoxIMin(fgrid_box), fstart); hypre_CopyIndex(hypre_BoxIMax(fgrid_box), fend); @@ -353,19 +362,19 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, * correspond to an f/c interface whether it has been adjusted or not. *--------------------------------------------------------------------*/ hypre_SetIndex3(index1, 1, 1, 1); - for (i= 0; i< ndim; i++) + for (i = 0; i < ndim; i++) { - j= fstart[i]%refine_factors[i]; + j = fstart[i] % refine_factors[i]; if (j) { - fstart[i]+= refine_factors[i] - j; + fstart[i] += refine_factors[i] - j; index1[i] = 0; } - j= fend[i]%refine_factors[i]; - if (refine_factors[i]-1 - j) + j = fend[i] % refine_factors[i]; + if (refine_factors[i] - 1 - j) { - fend[i] +=(refine_factors[i]-1) - j; + fend[i] += (refine_factors[i] - 1) - j; } } @@ -387,25 +396,25 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, /* the following index2 shift for ndim<3 is no problem since refine_factors[j]= 1 for j>=ndim. */ - hypre_SetIndex3(index2, refine_factors[0]-1, refine_factors[1]-1, - refine_factors[2]-1); + hypre_SetIndex3(index2, refine_factors[0] - 1, refine_factors[1] - 1, + refine_factors[2] - 1); hypre_StructMapCoarseToFine(hypre_BoxIMax(&intersect_box), index2, refine_factors, hypre_BoxIMax(&fine_box)); hypre_SetIndex3(index2, 1, 1, 1); hypre_CopyBox(&fine_box, &loop_box); - for (i= 0; i< ndim; i++) + for (i = 0; i < ndim; i++) { - hypre_BoxIMin(&loop_box)[i]+= refine_factors[i]*index1[i]; - hypre_BoxIMax(&loop_box)[i]-= refine_factors[i]*index2[i]; + hypre_BoxIMin(&loop_box)[i] += refine_factors[i] * index1[i]; + hypre_BoxIMax(&loop_box)[i] -= refine_factors[i] * index2[i]; } hypre_CopyBox(&loop_box, hypre_BoxArrayBox(fbox_interior[var1][ci], fi)); - interior_fboxi[var1][ci][fi]= temp1[fi]; + interior_fboxi[var1][ci][fi] = temp1[fi]; hypre_SubtractBoxes(&fine_box, &loop_box, hypre_BoxArrayArrayBoxArray(fbox_bdy[var1][ci], fi)); - bdy_fboxi[var1][ci][fi]= temp1[fi]; + bdy_fboxi[var1][ci][fi] = temp1[fi]; } hypre_TFree(temp1, HYPRE_MEMORY_HOST); @@ -416,14 +425,14 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, *--------------------------------------------------------------------*/ hypre_ForBoxI(fi, fgrid_boxes) { - fgrid_box= hypre_BoxArrayBox(fgrid_boxes, fi); + fgrid_box = hypre_BoxArrayBox(fgrid_boxes, fi); hypre_CopyIndex(hypre_BoxIMin(fgrid_box), fstart); - for (i= 0; i< ndim; i++) + for (i = 0; i < ndim; i++) { - j= fstart[i]%refine_factors[i]; + j = fstart[i] % refine_factors[i]; if (j) { - fstart[i]+= refine_factors[i] - j; + fstart[i] += refine_factors[i] - j; } } @@ -432,22 +441,22 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, hypre_StructMapFineToCoarse(hypre_BoxIMax(fgrid_box), index_temp, refine_factors, hypre_BoxIMax(&fine_box)); - temp1= hypre_CTAlloc(HYPRE_Int, hypre_BoxArraySize(cgrid_boxes), HYPRE_MEMORY_HOST); + temp1 = hypre_CTAlloc(HYPRE_Int, hypre_BoxArraySize(cgrid_boxes), HYPRE_MEMORY_HOST); hypre_ForBoxI(i, cgrid_boxes) { - cgrid_box= hypre_BoxArrayBox(cgrid_boxes, i); + cgrid_box = hypre_BoxArrayBox(cgrid_boxes, i); hypre_IntersectBoxes(&fine_box, cgrid_box, &intersect_box); if (hypre_BoxVolume(&intersect_box) > 0) { - temp1[cboxi_fcnt[var1][fi]]= i; + temp1[cboxi_fcnt[var1][fi]] = i; cboxi_fcnt[var1][fi]++; } } - cboxi_fboxes[var1][fi]= hypre_TAlloc(HYPRE_Int, cboxi_fcnt[var1][fi], HYPRE_MEMORY_HOST); - for (i= 0; i< cboxi_fcnt[var1][fi]; i++) + cboxi_fboxes[var1][fi] = hypre_TAlloc(HYPRE_Int, cboxi_fcnt[var1][fi], HYPRE_MEMORY_HOST); + for (i = 0; i < cboxi_fcnt[var1][fi]; i++) { - cboxi_fboxes[var1][fi][i]= temp1[i]; + cboxi_fboxes[var1][fi][i] = temp1[i]; } hypre_TFree(temp1, HYPRE_MEMORY_HOST); } @@ -478,11 +487,11 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, *--------------------------------------------------------------------------*/ hypre_ClearIndex(index_temp); hypre_CopyIndex(index_temp, hypre_BoxIMin(&coarse_cell_box)); - hypre_SetIndex3(index_temp, refine_factors[0]-1, refine_factors[1]-1, - refine_factors[2]-1 ); + hypre_SetIndex3(index_temp, refine_factors[0] - 1, refine_factors[1] - 1, + refine_factors[2] - 1 ); hypre_CopyIndex(index_temp, hypre_BoxIMax(&coarse_cell_box)); - volume_coarse_cell_box= hypre_BoxVolume(&coarse_cell_box); + volume_coarse_cell_box = hypre_BoxVolume(&coarse_cell_box); /*-------------------------------------------------------------------------- @@ -490,9 +499,9 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, * for pointing to correct coarse stencil location. *--------------------------------------------------------------------------*/ OffsetA = hypre_CTAlloc(HYPRE_Int *, 2, HYPRE_MEMORY_HOST); - for (i= 0; i< 2; i++) + for (i = 0; i < 2; i++) { - OffsetA[i]= hypre_CTAlloc(HYPRE_Int, refine_factors[i+1], HYPRE_MEMORY_HOST); + OffsetA[i] = hypre_CTAlloc(HYPRE_Int, refine_factors[i + 1], HYPRE_MEMORY_HOST); } /*-------------------------------------------------------------------------- @@ -503,22 +512,22 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, * Mark the stencil_marker so that the first time the stencil is non-null, * the stencil contribution cnts, weights, etc are computed. *--------------------------------------------------------------------------*/ - stencil_marker= trueV; - for (var1= 0; var1< nvars; var1++) + stencil_marker = trueV; + for (var1 = 0; var1 < nvars; var1++) { - cgrid= hypre_SStructPGridSGrid(hypre_SStructPMatrixPGrid(A_crse), var1); - cgrid_boxes= hypre_StructGridBoxes(cgrid); + cgrid = hypre_SStructPGridSGrid(hypre_SStructPMatrixPGrid(A_crse), var1); + cgrid_boxes = hypre_StructGridBoxes(cgrid); - fgrid= hypre_SStructPGridSGrid(hypre_SStructPMatrixPGrid(A_pmatrix), var1); - fgrid_boxes= hypre_StructGridBoxes(fgrid); + fgrid = hypre_SStructPGridSGrid(hypre_SStructPMatrixPGrid(A_pmatrix), var1); + fgrid_boxes = hypre_StructGridBoxes(fgrid); - for (var2= 0; var2< nvars; var2++) + for (var2 = 0; var2 < nvars; var2++) { - stencils= hypre_SStructPMatrixSStencil(A_crse, var1, var2); + stencils = hypre_SStructPMatrixSStencil(A_crse, var1, var2); if (stencils != NULL) { - stencil_size= hypre_StructStencilSize(stencils); + stencil_size = hypre_StructStencilSize(stencils); /*----------------------------------------------------------------- * When stencil_marker== true, form the stencil contributions cnts, @@ -534,15 +543,15 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, { /* search for the first previous non-null stencil */ found = falseV; - var2_start= var2-1; - for (j= var1; j>= 0; j--) + var2_start = var2 - 1; + for (j = var1; j >= 0; j--) { - for (i= var2_start; i>= 0; i--) + for (i = var2_start; i >= 0; i--) { - stencils_last= hypre_SStructPMatrixSStencil(A_crse, j, i); + stencils_last = hypre_SStructPMatrixSStencil(A_crse, j, i); if (stencils_last != NULL) { - found= trueV; + found = trueV; break; } } @@ -552,42 +561,42 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, } else { - var2_start= nvars-1; + var2_start = nvars - 1; } } /*-------------------------------------------------------------- * Compare the stencil shape. *--------------------------------------------------------------*/ - stencil_last_size= hypre_StructStencilSize(stencils_last); + stencil_last_size = hypre_StructStencilSize(stencils_last); if (stencil_last_size != stencil_size) { - stencil_marker= trueV; + stencil_marker = trueV; break; } else { - found= falseV; - for (i= 0; i< stencil_size; i++) + found = falseV; + for (i = 0; i < stencil_size; i++) { hypre_CopyIndex(hypre_StructStencilElement(stencils, i), stencil_shape_i); - hypre_CopyIndex(hypre_StructStencilElement(stencils_last,i), + hypre_CopyIndex(hypre_StructStencilElement(stencils_last, i), stencil_last_shape_i); hypre_SetIndex3(index_temp, - stencil_shape_i[0]-stencil_last_shape_i[0], - stencil_shape_i[1]-stencil_last_shape_i[1], - stencil_shape_i[2]-stencil_last_shape_i[2]); + stencil_shape_i[0] - stencil_last_shape_i[0], + stencil_shape_i[1] - stencil_last_shape_i[1], + stencil_shape_i[2] - stencil_last_shape_i[2]); AbsStencilShape(index_temp, abs_stencil_shape); if (abs_stencil_shape) { - found= trueV; - stencil_marker= trueV; + found = trueV; + stencil_marker = trueV; hypre_TFree(stencil_contrib_cnt, HYPRE_MEMORY_HOST); hypre_TFree(stencil_ranks, HYPRE_MEMORY_HOST); - for (i= 0; i< stencil_size; i++) + for (i = 0; i < stencil_size; i++) { hypre_BoxDestroy(shift_box[i]); } @@ -595,9 +604,9 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, hypre_TFree(volume_shift_box, HYPRE_MEMORY_HOST); hypre_TFree(vals, HYPRE_MEMORY_HOST); - for (j= 1; j< max_stencil_size; j++) + for (j = 1; j < max_stencil_size; j++) { - stencil_i= rank_stencils[j]; + stencil_i = rank_stencils[j]; if (stencil_i != -1) { hypre_TFree(stencil_contrib_i[stencil_i], HYPRE_MEMORY_HOST); @@ -643,9 +652,9 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, { /* mark stencil_marker for the next stencil */ - stencil_marker= falseV; + stencil_marker = falseV; - stencil_contrib_cnt= hypre_CTAlloc(HYPRE_Int, stencil_size, HYPRE_MEMORY_HOST); + stencil_contrib_cnt = hypre_CTAlloc(HYPRE_Int, stencil_size, HYPRE_MEMORY_HOST); stencil_contrib_i = hypre_TAlloc(HYPRE_Int *, stencil_size, HYPRE_MEMORY_HOST); weight_contrib_i = hypre_TAlloc(HYPRE_Real *, stencil_size, HYPRE_MEMORY_HOST); stencil_ranks = hypre_TAlloc(HYPRE_Int, stencil_size, HYPRE_MEMORY_HOST); @@ -653,12 +662,12 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, shift_box = hypre_TAlloc(hypre_Box *, stencil_size, HYPRE_MEMORY_HOST); volume_shift_box = hypre_TAlloc(HYPRE_Int, stencil_size, HYPRE_MEMORY_HOST); - for (i= 0; i< max_stencil_size; i++) + for (i = 0; i < max_stencil_size; i++) { - rank_stencils[i]= -1; + rank_stencils[i] = -1; if (i < stencil_size) { - stencil_ranks[i]= -1; + stencil_ranks[i] = -1; } } @@ -670,19 +679,19 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, * dimensions. For j>=ndim, * hypre_BoxIMin(shift_box[i])[j]=hypre_BoxIMax(shift_box[i])[j]= 0. *-----------------------------------------------------------------*/ - for (i= 0; i< stencil_size; i++) + for (i = 0; i < stencil_size; i++) { shift_box[i] = hypre_BoxCreate(ndim); hypre_CopyIndex(hypre_StructStencilElement(stencils, i), stencil_shape_i); MapStencilRank(stencil_shape_i, j); - stencil_ranks[i]= j; + stencil_ranks[i] = j; rank_stencils[stencil_ranks[i]] = i; hypre_SetIndex3(hypre_BoxIMin(shift_box[i]), - (refine_factors[0]-1)*stencil_shape_i[0], - (refine_factors[1]-1)*stencil_shape_i[1], - (refine_factors[2]-1)*stencil_shape_i[2]); + (refine_factors[0] - 1)*stencil_shape_i[0], + (refine_factors[1] - 1)*stencil_shape_i[1], + (refine_factors[2] - 1)*stencil_shape_i[2]); hypre_AddIndexes(hypre_BoxIMin(shift_box[i]), hypre_BoxIMax(&coarse_cell_box), 3, @@ -690,7 +699,7 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, hypre_IntersectBoxes(&coarse_cell_box, shift_box[i], shift_box[i]); - volume_shift_box[i]= hypre_BoxVolume(shift_box[i]); + volume_shift_box[i] = hypre_BoxVolume(shift_box[i]); } /*----------------------------------------------------------------- @@ -700,325 +709,341 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, *-----------------------------------------------------------------*/ /* east */ - stencil_i= rank_stencils[1]; + stencil_i = rank_stencils[1]; if (stencil_i != -1) { stencil_contrib_cnt[stencil_i]++; - for (i= 4; i<= 7; i+=3) + for (i = 4; i <= 7; i += 3) { if (rank_stencils[i] != -1) /* ne or se */ + { stencil_contrib_cnt[stencil_i]++; + } } if (ndim > 2) { - for (j= 1; j<= 2; j++) + for (j = 1; j <= 2; j++) { - for (i= 1; i<= 7; i+=3) + for (i = 1; i <= 7; i += 3) { - if (rank_stencils[j*9+i] != -1) /* bottom or top planes */ + if (rank_stencils[j * 9 + i] != -1) /* bottom or top planes */ + { stencil_contrib_cnt[stencil_i]++; + } } } } - max_contribut_size= stencil_contrib_cnt[stencil_i]; + max_contribut_size = stencil_contrib_cnt[stencil_i]; } /* fill up the east contribution stencil indices */ if (stencil_i != -1) { - stencil_contrib_i[stencil_i]= + stencil_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Int, stencil_contrib_cnt[stencil_i], HYPRE_MEMORY_HOST); weight_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Real, stencil_contrib_cnt[stencil_i], HYPRE_MEMORY_HOST); - sum= 0.0; - k= 0; + sum = 0.0; + k = 0; - stencil_contrib_i[stencil_i][k]= stencil_i; - AbsStencilShape( hypre_StructStencilElement(stencils,stencil_i), + stencil_contrib_i[stencil_i][k] = stencil_i; + AbsStencilShape( hypre_StructStencilElement(stencils, stencil_i), abs_stencil_shape ); weight_contrib_i[stencil_i][k++] = weights[abs_stencil_shape]; - sum+= weights[abs_stencil_shape]; + sum += weights[abs_stencil_shape]; - for (i= 4; i<= 7; i+=3) + for (i = 4; i <= 7; i += 3) { if (rank_stencils[i] != -1) { stencil_contrib_i[stencil_i][k] = rank_stencils[i]; - AbsStencilShape(hypre_StructStencilElement(stencils,rank_stencils[i]), + AbsStencilShape(hypre_StructStencilElement(stencils, rank_stencils[i]), abs_stencil_shape ); weight_contrib_i[stencil_i][k++] = weights[abs_stencil_shape]; - sum+= weights[abs_stencil_shape]; + sum += weights[abs_stencil_shape]; } } if (ndim > 2) { - for (j= 1; j<= 2; j++) + for (j = 1; j <= 2; j++) { - for (i= 1; i<= 7; i+=3) + for (i = 1; i <= 7; i += 3) { - if (rank_stencils[j*9+i] != -1) + if (rank_stencils[j * 9 + i] != -1) { - stencil_contrib_i[stencil_i][k] = rank_stencils[j*9+i]; + stencil_contrib_i[stencil_i][k] = rank_stencils[j * 9 + i]; AbsStencilShape( - hypre_StructStencilElement(stencils,rank_stencils[j*9+i]), + hypre_StructStencilElement(stencils, rank_stencils[j * 9 + i]), abs_stencil_shape ); weight_contrib_i[stencil_i][k++] = weights[abs_stencil_shape]; - sum+= weights[abs_stencil_shape]; + sum += weights[abs_stencil_shape]; } } } } - for (i= 0; i< k ; i++) + for (i = 0; i < k ; i++) { - weight_contrib_i[stencil_i][i]/= sum; + weight_contrib_i[stencil_i][i] /= sum; } } /* west */ - stencil_i= rank_stencils[2]; + stencil_i = rank_stencils[2]; if (stencil_i != -1) { stencil_contrib_cnt[stencil_i]++; - for (i= 5; i<= 8; i+=3) + for (i = 5; i <= 8; i += 3) { if (rank_stencils[i] != -1) /* nw or sw */ + { stencil_contrib_cnt[stencil_i]++; + } } if (ndim > 2) { - for (j= 1; j<= 2; j++) + for (j = 1; j <= 2; j++) { - for (i= 2; i<= 8; i+=3) + for (i = 2; i <= 8; i += 3) { - if (rank_stencils[j*9+i] != -1) /* bottom or top planes */ + if (rank_stencils[j * 9 + i] != -1) /* bottom or top planes */ + { stencil_contrib_cnt[stencil_i]++; + } } } } - max_contribut_size= hypre_max( max_contribut_size, - stencil_contrib_cnt[stencil_i] ); + max_contribut_size = hypre_max( max_contribut_size, + stencil_contrib_cnt[stencil_i] ); } if (stencil_i != -1) { - stencil_contrib_i[stencil_i]= + stencil_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Int, stencil_contrib_cnt[stencil_i], HYPRE_MEMORY_HOST); weight_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Real, stencil_contrib_cnt[stencil_i], HYPRE_MEMORY_HOST); - sum= 0.0; - k= 0; + sum = 0.0; + k = 0; - stencil_contrib_i[stencil_i][k]= stencil_i; - AbsStencilShape( hypre_StructStencilElement(stencils,stencil_i), + stencil_contrib_i[stencil_i][k] = stencil_i; + AbsStencilShape( hypre_StructStencilElement(stencils, stencil_i), abs_stencil_shape ); weight_contrib_i[stencil_i][k++] = weights[abs_stencil_shape]; - sum+= weights[abs_stencil_shape]; + sum += weights[abs_stencil_shape]; - for (i= 5; i<= 8; i+=3) + for (i = 5; i <= 8; i += 3) { if (rank_stencils[i] != -1) { stencil_contrib_i[stencil_i][k] = rank_stencils[i]; - AbsStencilShape(hypre_StructStencilElement(stencils,rank_stencils[i]), + AbsStencilShape(hypre_StructStencilElement(stencils, rank_stencils[i]), abs_stencil_shape ); weight_contrib_i[stencil_i][k++] = weights[abs_stencil_shape]; - sum+= weights[abs_stencil_shape]; + sum += weights[abs_stencil_shape]; } } if (ndim > 2) { - for (j= 1; j<= 2; j++) + for (j = 1; j <= 2; j++) { - for (i= 2; i<= 8; i+=3) + for (i = 2; i <= 8; i += 3) { - if (rank_stencils[j*9+i] != -1) + if (rank_stencils[j * 9 + i] != -1) { - stencil_contrib_i[stencil_i][k] = rank_stencils[j*9+i]; + stencil_contrib_i[stencil_i][k] = rank_stencils[j * 9 + i]; AbsStencilShape( - hypre_StructStencilElement(stencils,rank_stencils[j*9+i]), + hypre_StructStencilElement(stencils, rank_stencils[j * 9 + i]), abs_stencil_shape ); weight_contrib_i[stencil_i][k++] = weights[abs_stencil_shape]; - sum+= weights[abs_stencil_shape]; + sum += weights[abs_stencil_shape]; } } } } - for (i= 0; i< k ; i++) + for (i = 0; i < k ; i++) { - weight_contrib_i[stencil_i][i]/= sum; + weight_contrib_i[stencil_i][i] /= sum; } } /* north */ - stencil_i= rank_stencils[3]; + stencil_i = rank_stencils[3]; if (stencil_i != -1) { stencil_contrib_cnt[stencil_i]++; - for (i= 4; i<= 5; i++) + for (i = 4; i <= 5; i++) { if (rank_stencils[i] != -1) /* ne or nw */ + { stencil_contrib_cnt[stencil_i]++; + } } if (ndim > 2) { - for (j= 1; j<= 2; j++) + for (j = 1; j <= 2; j++) { - for (i= 3; i<= 5; i++) + for (i = 3; i <= 5; i++) { - if (rank_stencils[j*9+i] != -1) /* bottom or top planes */ + if (rank_stencils[j * 9 + i] != -1) /* bottom or top planes */ + { stencil_contrib_cnt[stencil_i]++; + } } } } - max_contribut_size= hypre_max( max_contribut_size, - stencil_contrib_cnt[stencil_i] ); + max_contribut_size = hypre_max( max_contribut_size, + stencil_contrib_cnt[stencil_i] ); } if (stencil_i != -1) { - stencil_contrib_i[stencil_i]= + stencil_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Int, stencil_contrib_cnt[stencil_i], HYPRE_MEMORY_HOST); weight_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Real, stencil_contrib_cnt[stencil_i], HYPRE_MEMORY_HOST); - sum= 0.0; - k= 0; + sum = 0.0; + k = 0; - stencil_contrib_i[stencil_i][k]= stencil_i; - AbsStencilShape( hypre_StructStencilElement(stencils,stencil_i), + stencil_contrib_i[stencil_i][k] = stencil_i; + AbsStencilShape( hypre_StructStencilElement(stencils, stencil_i), abs_stencil_shape ); weight_contrib_i[stencil_i][k++] = weights[abs_stencil_shape]; - sum+= weights[abs_stencil_shape]; + sum += weights[abs_stencil_shape]; - for (i= 4; i<= 5; i++) + for (i = 4; i <= 5; i++) { if (rank_stencils[i] != -1) { stencil_contrib_i[stencil_i][k] = rank_stencils[i]; - AbsStencilShape(hypre_StructStencilElement(stencils,rank_stencils[i]), + AbsStencilShape(hypre_StructStencilElement(stencils, rank_stencils[i]), abs_stencil_shape ); weight_contrib_i[stencil_i][k++] = weights[abs_stencil_shape]; - sum+= weights[abs_stencil_shape]; + sum += weights[abs_stencil_shape]; } } if (ndim > 2) { - for (j= 1; j<= 2; j++) + for (j = 1; j <= 2; j++) { - for (i= 3; i<= 5; i++) + for (i = 3; i <= 5; i++) { - if (rank_stencils[j*9+i] != -1) + if (rank_stencils[j * 9 + i] != -1) { - stencil_contrib_i[stencil_i][k] = rank_stencils[j*9+i]; + stencil_contrib_i[stencil_i][k] = rank_stencils[j * 9 + i]; AbsStencilShape( - hypre_StructStencilElement(stencils,rank_stencils[j*9+i]), + hypre_StructStencilElement(stencils, rank_stencils[j * 9 + i]), abs_stencil_shape ); weight_contrib_i[stencil_i][k++] = weights[abs_stencil_shape]; - sum+= weights[abs_stencil_shape]; + sum += weights[abs_stencil_shape]; } } } } - for (i= 0; i< k ; i++) + for (i = 0; i < k ; i++) { - weight_contrib_i[stencil_i][i]/= sum; + weight_contrib_i[stencil_i][i] /= sum; } } /* south */ - stencil_i= rank_stencils[6]; + stencil_i = rank_stencils[6]; if (stencil_i != -1) { stencil_contrib_cnt[stencil_i]++; - for (i= 7; i<= 8; i++) + for (i = 7; i <= 8; i++) { if (rank_stencils[i] != -1) /* ne or nw */ + { stencil_contrib_cnt[stencil_i]++; + } } if (ndim > 2) { - for (j= 1; j<= 2; j++) + for (j = 1; j <= 2; j++) { - for (i= 6; i<= 8; i++) + for (i = 6; i <= 8; i++) { - if (rank_stencils[j*9+i] != -1) /* bottom or top planes */ + if (rank_stencils[j * 9 + i] != -1) /* bottom or top planes */ + { stencil_contrib_cnt[stencil_i]++; + } } } } - max_contribut_size= hypre_max( max_contribut_size, - stencil_contrib_cnt[stencil_i] ); + max_contribut_size = hypre_max( max_contribut_size, + stencil_contrib_cnt[stencil_i] ); } if (stencil_i != -1) { - stencil_contrib_i[stencil_i]= + stencil_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Int, stencil_contrib_cnt[stencil_i], HYPRE_MEMORY_HOST); weight_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Real, stencil_contrib_cnt[stencil_i], HYPRE_MEMORY_HOST); - sum= 0.0; - k= 0; + sum = 0.0; + k = 0; - stencil_contrib_i[stencil_i][k]= stencil_i; - AbsStencilShape( hypre_StructStencilElement(stencils,stencil_i), + stencil_contrib_i[stencil_i][k] = stencil_i; + AbsStencilShape( hypre_StructStencilElement(stencils, stencil_i), abs_stencil_shape ); weight_contrib_i[stencil_i][k++] = weights[abs_stencil_shape]; - sum+= weights[abs_stencil_shape]; + sum += weights[abs_stencil_shape]; - for (i= 7; i<= 8; i++) + for (i = 7; i <= 8; i++) { if (rank_stencils[i] != -1) { stencil_contrib_i[stencil_i][k] = rank_stencils[i]; - AbsStencilShape(hypre_StructStencilElement(stencils,rank_stencils[i]), + AbsStencilShape(hypre_StructStencilElement(stencils, rank_stencils[i]), abs_stencil_shape ); weight_contrib_i[stencil_i][k++] = weights[abs_stencil_shape]; - sum+= weights[abs_stencil_shape]; + sum += weights[abs_stencil_shape]; } } if (ndim > 2) { - for (j= 1; j<= 2; j++) + for (j = 1; j <= 2; j++) { - for (i= 6; i<= 8; i++) + for (i = 6; i <= 8; i++) { - if (rank_stencils[j*9+i] != -1) + if (rank_stencils[j * 9 + i] != -1) { - stencil_contrib_i[stencil_i][k] = rank_stencils[j*9+i]; + stencil_contrib_i[stencil_i][k] = rank_stencils[j * 9 + i]; AbsStencilShape( - hypre_StructStencilElement(stencils,rank_stencils[j*9+i]), + hypre_StructStencilElement(stencils, rank_stencils[j * 9 + i]), abs_stencil_shape ); weight_contrib_i[stencil_i][k++] = weights[abs_stencil_shape]; - sum+= weights[abs_stencil_shape]; + sum += weights[abs_stencil_shape]; } } } } - for (i= 0; i< k ; i++) + for (i = 0; i < k ; i++) { - weight_contrib_i[stencil_i][i]/= sum; + weight_contrib_i[stencil_i][i] /= sum; } } @@ -1028,29 +1053,29 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, if (ndim == 2) { /* corners: ne & nw */ - for (i= 4; i<= 5; i++) + for (i = 4; i <= 5; i++) { - stencil_i= rank_stencils[i]; + stencil_i = rank_stencils[i]; if (stencil_i != -1) { stencil_contrib_cnt[stencil_i]++; - stencil_contrib_i[stencil_i]= hypre_TAlloc(HYPRE_Int, 1, HYPRE_MEMORY_HOST); + stencil_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Int, 1, HYPRE_MEMORY_HOST); weight_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Real, 1, HYPRE_MEMORY_HOST); - stencil_contrib_i[stencil_i][0]= stencil_i; + stencil_contrib_i[stencil_i][0] = stencil_i; weight_contrib_i[stencil_i][0] = weights[0]; } } /* corners: se & sw */ - for (i= 7; i<= 8; i++) + for (i = 7; i <= 8; i++) { - stencil_i= rank_stencils[i]; + stencil_i = rank_stencils[i]; if (stencil_i != -1) { stencil_contrib_cnt[stencil_i]++; - stencil_contrib_i[stencil_i]= hypre_TAlloc(HYPRE_Int, 1, HYPRE_MEMORY_HOST); + stencil_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Int, 1, HYPRE_MEMORY_HOST); weight_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Real, 1, HYPRE_MEMORY_HOST); - stencil_contrib_i[stencil_i][0]= stencil_i; + stencil_contrib_i[stencil_i][0] = stencil_i; weight_contrib_i[stencil_i][0] = weights[0]; } } @@ -1062,701 +1087,729 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, if (ndim > 2) { /* sides: top */ - stencil_i= rank_stencils[9]; + stencil_i = rank_stencils[9]; if (stencil_i != -1) { stencil_contrib_cnt[stencil_i]++; - for (i=1; i<= 8; i++) + for (i = 1; i <= 8; i++) { - if (rank_stencils[9+i] != -1) + if (rank_stencils[9 + i] != -1) + { stencil_contrib_cnt[stencil_i]++; + } } - max_contribut_size= hypre_max( max_contribut_size, - stencil_contrib_cnt[stencil_i] ); + max_contribut_size = hypre_max( max_contribut_size, + stencil_contrib_cnt[stencil_i] ); } if (stencil_i != -1) { - stencil_contrib_i[stencil_i]= + stencil_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Int, stencil_contrib_cnt[stencil_i], HYPRE_MEMORY_HOST); weight_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Real, stencil_contrib_cnt[stencil_i], HYPRE_MEMORY_HOST); - sum= 0.0; - k= 0; + sum = 0.0; + k = 0; - stencil_contrib_i[stencil_i][k]= stencil_i; - AbsStencilShape( hypre_StructStencilElement(stencils,stencil_i), + stencil_contrib_i[stencil_i][k] = stencil_i; + AbsStencilShape( hypre_StructStencilElement(stencils, stencil_i), abs_stencil_shape ); weight_contrib_i[stencil_i][k++] = weights[abs_stencil_shape]; - sum+= weights[abs_stencil_shape]; + sum += weights[abs_stencil_shape]; - for (i=1; i<= 8; i++) + for (i = 1; i <= 8; i++) { - if (rank_stencils[9+i] != -1) + if (rank_stencils[9 + i] != -1) { - stencil_contrib_i[stencil_i][k]= rank_stencils[9+i]; + stencil_contrib_i[stencil_i][k] = rank_stencils[9 + i]; - AbsStencilShape(hypre_StructStencilElement(stencils,rank_stencils[9+i]), + AbsStencilShape(hypre_StructStencilElement(stencils, rank_stencils[9 + i]), abs_stencil_shape ); weight_contrib_i[stencil_i][k++] = weights[abs_stencil_shape]; - sum+= weights[abs_stencil_shape]; + sum += weights[abs_stencil_shape]; } } - for (i= 0; i< k ; i++) + for (i = 0; i < k ; i++) { - weight_contrib_i[stencil_i][i]/= sum; + weight_contrib_i[stencil_i][i] /= sum; } } /* sides: bottom */ - stencil_i= rank_stencils[18]; + stencil_i = rank_stencils[18]; if (stencil_i != -1) { stencil_contrib_cnt[stencil_i]++; - for (i=1; i<= 8; i++) + for (i = 1; i <= 8; i++) { - if (rank_stencils[18+i] != -1) + if (rank_stencils[18 + i] != -1) + { stencil_contrib_cnt[stencil_i]++; + } } - max_contribut_size= hypre_max( max_contribut_size, - stencil_contrib_cnt[stencil_i] ); + max_contribut_size = hypre_max( max_contribut_size, + stencil_contrib_cnt[stencil_i] ); } if (stencil_i != -1) { - stencil_contrib_i[stencil_i]= + stencil_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Int, stencil_contrib_cnt[stencil_i], HYPRE_MEMORY_HOST); weight_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Real, stencil_contrib_cnt[stencil_i], HYPRE_MEMORY_HOST); - sum= 0.0; - k= 0; + sum = 0.0; + k = 0; - stencil_contrib_i[stencil_i][k]= stencil_i; - AbsStencilShape( hypre_StructStencilElement(stencils,stencil_i), + stencil_contrib_i[stencil_i][k] = stencil_i; + AbsStencilShape( hypre_StructStencilElement(stencils, stencil_i), abs_stencil_shape ); weight_contrib_i[stencil_i][k++] = weights[abs_stencil_shape]; - sum+= weights[abs_stencil_shape]; + sum += weights[abs_stencil_shape]; - for (i=1; i<= 8; i++) + for (i = 1; i <= 8; i++) { - if (rank_stencils[18+i] != -1) + if (rank_stencils[18 + i] != -1) { - stencil_contrib_i[stencil_i][k]= rank_stencils[18+i]; + stencil_contrib_i[stencil_i][k] = rank_stencils[18 + i]; - AbsStencilShape(hypre_StructStencilElement(stencils,rank_stencils[18+i]), + AbsStencilShape(hypre_StructStencilElement(stencils, rank_stencils[18 + i]), abs_stencil_shape ); weight_contrib_i[stencil_i][k++] = weights[abs_stencil_shape]; - sum+= weights[abs_stencil_shape]; + sum += weights[abs_stencil_shape]; } } - for (i= 0; i< k ; i++) + for (i = 0; i < k ; i++) { - weight_contrib_i[stencil_i][i]/= sum; + weight_contrib_i[stencil_i][i] /= sum; } } /* edges: cne */ - stencil_i= rank_stencils[4]; + stencil_i = rank_stencils[4]; if (stencil_i != -1) { stencil_contrib_cnt[stencil_i]++; - for (j=1; j<= 2; j++) + for (j = 1; j <= 2; j++) { - if (rank_stencils[j*9+4] != -1) /* bottom or top planes */ + if (rank_stencils[j * 9 + 4] != -1) /* bottom or top planes */ + { stencil_contrib_cnt[stencil_i]++; + } } - max_contribut_size= hypre_max( max_contribut_size, - stencil_contrib_cnt[stencil_i] ); + max_contribut_size = hypre_max( max_contribut_size, + stencil_contrib_cnt[stencil_i] ); } if (stencil_i != -1) { - stencil_contrib_i[stencil_i]= + stencil_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Int, stencil_contrib_cnt[stencil_i], HYPRE_MEMORY_HOST); weight_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Real, stencil_contrib_cnt[stencil_i], HYPRE_MEMORY_HOST); - sum= 0.0; - k= 0; + sum = 0.0; + k = 0; - stencil_contrib_i[stencil_i][k]= stencil_i; - AbsStencilShape( hypre_StructStencilElement(stencils,stencil_i), + stencil_contrib_i[stencil_i][k] = stencil_i; + AbsStencilShape( hypre_StructStencilElement(stencils, stencil_i), abs_stencil_shape ); weight_contrib_i[stencil_i][k++] = weights[abs_stencil_shape]; - sum+= weights[abs_stencil_shape]; + sum += weights[abs_stencil_shape]; - for (j=1; j<= 2; j++) + for (j = 1; j <= 2; j++) { - if (rank_stencils[j*9+4] != -1) + if (rank_stencils[j * 9 + 4] != -1) { - stencil_contrib_i[stencil_i][k]= rank_stencils[j*9+4]; + stencil_contrib_i[stencil_i][k] = rank_stencils[j * 9 + 4]; - AbsStencilShape(hypre_StructStencilElement(stencils,rank_stencils[j*9+4]), + AbsStencilShape(hypre_StructStencilElement(stencils, rank_stencils[j * 9 + 4]), abs_stencil_shape ); weight_contrib_i[stencil_i][k++] = weights[abs_stencil_shape]; - sum+= weights[abs_stencil_shape]; + sum += weights[abs_stencil_shape]; } } - for (i= 0; i< k ; i++) + for (i = 0; i < k ; i++) { - weight_contrib_i[stencil_i][i]/= sum; + weight_contrib_i[stencil_i][i] /= sum; } } /* edges: cse */ - stencil_i= rank_stencils[7]; + stencil_i = rank_stencils[7]; if (stencil_i != -1) { stencil_contrib_cnt[stencil_i]++; - for (j=1; j<= 2; j++) + for (j = 1; j <= 2; j++) { - if (rank_stencils[j*9+7] != -1) /* bottom or top planes */ + if (rank_stencils[j * 9 + 7] != -1) /* bottom or top planes */ + { stencil_contrib_cnt[stencil_i]++; + } } - max_contribut_size= hypre_max( max_contribut_size, - stencil_contrib_cnt[stencil_i] ); + max_contribut_size = hypre_max( max_contribut_size, + stencil_contrib_cnt[stencil_i] ); } if (stencil_i != -1) { - stencil_contrib_i[stencil_i]= + stencil_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Int, stencil_contrib_cnt[stencil_i], HYPRE_MEMORY_HOST); weight_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Real, stencil_contrib_cnt[stencil_i], HYPRE_MEMORY_HOST); - sum= 0.0; - k= 0; + sum = 0.0; + k = 0; - stencil_contrib_i[stencil_i][k]= stencil_i; - AbsStencilShape( hypre_StructStencilElement(stencils,stencil_i), + stencil_contrib_i[stencil_i][k] = stencil_i; + AbsStencilShape( hypre_StructStencilElement(stencils, stencil_i), abs_stencil_shape ); weight_contrib_i[stencil_i][k++] = weights[abs_stencil_shape]; - sum+= weights[abs_stencil_shape]; + sum += weights[abs_stencil_shape]; - for (j=1; j<= 2; j++) + for (j = 1; j <= 2; j++) { - if (rank_stencils[j*9+7] != -1) + if (rank_stencils[j * 9 + 7] != -1) { - stencil_contrib_i[stencil_i][k]= rank_stencils[j*9+7]; + stencil_contrib_i[stencil_i][k] = rank_stencils[j * 9 + 7]; - AbsStencilShape(hypre_StructStencilElement(stencils,rank_stencils[j*9+7]), + AbsStencilShape(hypre_StructStencilElement(stencils, rank_stencils[j * 9 + 7]), abs_stencil_shape ); weight_contrib_i[stencil_i][k++] = weights[abs_stencil_shape]; - sum+= weights[abs_stencil_shape]; + sum += weights[abs_stencil_shape]; } } - for (i= 0; i< k ; i++) + for (i = 0; i < k ; i++) { - weight_contrib_i[stencil_i][i]/= sum; + weight_contrib_i[stencil_i][i] /= sum; } } /* edges: cnw */ - stencil_i= rank_stencils[5]; + stencil_i = rank_stencils[5]; if (stencil_i != -1) { stencil_contrib_cnt[stencil_i]++; - for (j=1; j<= 2; j++) + for (j = 1; j <= 2; j++) { - if (rank_stencils[j*9+5] != -1) /* bottom or top planes */ + if (rank_stencils[j * 9 + 5] != -1) /* bottom or top planes */ + { stencil_contrib_cnt[stencil_i]++; + } } - max_contribut_size= hypre_max( max_contribut_size, - stencil_contrib_cnt[stencil_i] ); + max_contribut_size = hypre_max( max_contribut_size, + stencil_contrib_cnt[stencil_i] ); } if (stencil_i != -1) { - stencil_contrib_i[stencil_i]= + stencil_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Int, stencil_contrib_cnt[stencil_i], HYPRE_MEMORY_HOST); weight_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Real, stencil_contrib_cnt[stencil_i], HYPRE_MEMORY_HOST); - sum= 0.0; - k= 0; + sum = 0.0; + k = 0; - stencil_contrib_i[stencil_i][k]= stencil_i; - AbsStencilShape( hypre_StructStencilElement(stencils,stencil_i), + stencil_contrib_i[stencil_i][k] = stencil_i; + AbsStencilShape( hypre_StructStencilElement(stencils, stencil_i), abs_stencil_shape ); weight_contrib_i[stencil_i][k++] = weights[abs_stencil_shape]; - sum+= weights[abs_stencil_shape]; + sum += weights[abs_stencil_shape]; - for (j=1; j<= 2; j++) + for (j = 1; j <= 2; j++) { - if (rank_stencils[j*9+5] != -1) + if (rank_stencils[j * 9 + 5] != -1) { - stencil_contrib_i[stencil_i][k]= rank_stencils[j*9+5]; + stencil_contrib_i[stencil_i][k] = rank_stencils[j * 9 + 5]; - AbsStencilShape(hypre_StructStencilElement(stencils,rank_stencils[j*9+5]), + AbsStencilShape(hypre_StructStencilElement(stencils, rank_stencils[j * 9 + 5]), abs_stencil_shape ); weight_contrib_i[stencil_i][k++] = weights[abs_stencil_shape]; - sum+= weights[abs_stencil_shape]; + sum += weights[abs_stencil_shape]; } } - for (i= 0; i< k ; i++) + for (i = 0; i < k ; i++) { - weight_contrib_i[stencil_i][i]/= sum; + weight_contrib_i[stencil_i][i] /= sum; } } /* edges: csw */ - stencil_i= rank_stencils[8]; + stencil_i = rank_stencils[8]; if (stencil_i != -1) { stencil_contrib_cnt[stencil_i]++; - for (j=1; j<= 2; j++) + for (j = 1; j <= 2; j++) { - if (rank_stencils[j*9+8] != -1) /* bottom or top planes */ + if (rank_stencils[j * 9 + 8] != -1) /* bottom or top planes */ + { stencil_contrib_cnt[stencil_i]++; + } } - max_contribut_size= hypre_max( max_contribut_size, - stencil_contrib_cnt[stencil_i] ); + max_contribut_size = hypre_max( max_contribut_size, + stencil_contrib_cnt[stencil_i] ); } if (stencil_i != -1) { - stencil_contrib_i[stencil_i]= + stencil_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Int, stencil_contrib_cnt[stencil_i], HYPRE_MEMORY_HOST); weight_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Real, stencil_contrib_cnt[stencil_i], HYPRE_MEMORY_HOST); - sum= 0.0; - k= 0; + sum = 0.0; + k = 0; - stencil_contrib_i[stencil_i][k]= stencil_i; - AbsStencilShape( hypre_StructStencilElement(stencils,stencil_i), + stencil_contrib_i[stencil_i][k] = stencil_i; + AbsStencilShape( hypre_StructStencilElement(stencils, stencil_i), abs_stencil_shape ); weight_contrib_i[stencil_i][k++] = weights[abs_stencil_shape]; - sum+= weights[abs_stencil_shape]; + sum += weights[abs_stencil_shape]; - for (j=1; j<= 2; j++) + for (j = 1; j <= 2; j++) { - if (rank_stencils[j*9+8] != -1) + if (rank_stencils[j * 9 + 8] != -1) { - stencil_contrib_i[stencil_i][k]= rank_stencils[j*9+8]; + stencil_contrib_i[stencil_i][k] = rank_stencils[j * 9 + 8]; - AbsStencilShape(hypre_StructStencilElement(stencils,rank_stencils[j*9+8]), + AbsStencilShape(hypre_StructStencilElement(stencils, rank_stencils[j * 9 + 8]), abs_stencil_shape ); weight_contrib_i[stencil_i][k++] = weights[abs_stencil_shape]; - sum+= weights[abs_stencil_shape]; + sum += weights[abs_stencil_shape]; } } - for (i= 0; i< k ; i++) + for (i = 0; i < k ; i++) { - weight_contrib_i[stencil_i][i]/= sum; + weight_contrib_i[stencil_i][i] /= sum; } } /* edges: top east */ - stencil_i= rank_stencils[10]; + stencil_i = rank_stencils[10]; if (stencil_i != -1) { stencil_contrib_cnt[stencil_i]++; - for (i=3; i<= 6; i+=3) + for (i = 3; i <= 6; i += 3) { - if (rank_stencils[10+i] != -1) + if (rank_stencils[10 + i] != -1) + { stencil_contrib_cnt[stencil_i]++; + } } - max_contribut_size= hypre_max( max_contribut_size, - stencil_contrib_cnt[stencil_i] ); + max_contribut_size = hypre_max( max_contribut_size, + stencil_contrib_cnt[stencil_i] ); } if (stencil_i != -1) { - stencil_contrib_i[stencil_i]= + stencil_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Int, stencil_contrib_cnt[stencil_i], HYPRE_MEMORY_HOST); weight_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Real, stencil_contrib_cnt[stencil_i], HYPRE_MEMORY_HOST); - sum= 0.0; - k= 0; + sum = 0.0; + k = 0; - stencil_contrib_i[stencil_i][k]= stencil_i; - AbsStencilShape( hypre_StructStencilElement(stencils,stencil_i), + stencil_contrib_i[stencil_i][k] = stencil_i; + AbsStencilShape( hypre_StructStencilElement(stencils, stencil_i), abs_stencil_shape ); weight_contrib_i[stencil_i][k++] = weights[abs_stencil_shape]; - sum+= weights[abs_stencil_shape]; + sum += weights[abs_stencil_shape]; - for (i=3; i<= 6; i+=3) + for (i = 3; i <= 6; i += 3) { - if (rank_stencils[10+i] != -1) + if (rank_stencils[10 + i] != -1) { - stencil_contrib_i[stencil_i][k]= rank_stencils[10+i]; + stencil_contrib_i[stencil_i][k] = rank_stencils[10 + i]; - AbsStencilShape(hypre_StructStencilElement(stencils,rank_stencils[10+i]), + AbsStencilShape(hypre_StructStencilElement(stencils, rank_stencils[10 + i]), abs_stencil_shape ); weight_contrib_i[stencil_i][k++] = weights[abs_stencil_shape]; - sum+= weights[abs_stencil_shape]; + sum += weights[abs_stencil_shape]; } } - for (i= 0; i< k ; i++) + for (i = 0; i < k ; i++) { - weight_contrib_i[stencil_i][i]/= sum; + weight_contrib_i[stencil_i][i] /= sum; } } /* edges: top west */ - stencil_i= rank_stencils[11]; + stencil_i = rank_stencils[11]; if (stencil_i != -1) { stencil_contrib_cnt[stencil_i]++; - for (i=3; i<= 6; i+=3) + for (i = 3; i <= 6; i += 3) { - if (rank_stencils[11+i] != -1) + if (rank_stencils[11 + i] != -1) + { stencil_contrib_cnt[stencil_i]++; + } } - max_contribut_size= hypre_max( max_contribut_size, - stencil_contrib_cnt[stencil_i] ); + max_contribut_size = hypre_max( max_contribut_size, + stencil_contrib_cnt[stencil_i] ); } if (stencil_i != -1) { - stencil_contrib_i[stencil_i]= + stencil_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Int, stencil_contrib_cnt[stencil_i], HYPRE_MEMORY_HOST); weight_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Real, stencil_contrib_cnt[stencil_i], HYPRE_MEMORY_HOST); - sum= 0.0; - k= 0; + sum = 0.0; + k = 0; - stencil_contrib_i[stencil_i][k]= stencil_i; - AbsStencilShape( hypre_StructStencilElement(stencils,stencil_i), + stencil_contrib_i[stencil_i][k] = stencil_i; + AbsStencilShape( hypre_StructStencilElement(stencils, stencil_i), abs_stencil_shape ); weight_contrib_i[stencil_i][k++] = weights[abs_stencil_shape]; - sum+= weights[abs_stencil_shape]; + sum += weights[abs_stencil_shape]; - for (i=3; i<= 6; i+=3) + for (i = 3; i <= 6; i += 3) { - if (rank_stencils[11+i] != -1) + if (rank_stencils[11 + i] != -1) { - stencil_contrib_i[stencil_i][k]= rank_stencils[11+i]; + stencil_contrib_i[stencil_i][k] = rank_stencils[11 + i]; - AbsStencilShape(hypre_StructStencilElement(stencils,rank_stencils[11+i]), + AbsStencilShape(hypre_StructStencilElement(stencils, rank_stencils[11 + i]), abs_stencil_shape ); weight_contrib_i[stencil_i][k++] = weights[abs_stencil_shape]; - sum+= weights[abs_stencil_shape]; + sum += weights[abs_stencil_shape]; } } - for (i= 0; i< k ; i++) + for (i = 0; i < k ; i++) { - weight_contrib_i[stencil_i][i]/= sum; + weight_contrib_i[stencil_i][i] /= sum; } } /* edges: top north */ - stencil_i= rank_stencils[12]; + stencil_i = rank_stencils[12]; if (stencil_i != -1) { stencil_contrib_cnt[stencil_i]++; - for (i=13; i<= 14; i++) + for (i = 13; i <= 14; i++) { if (rank_stencils[i] != -1) + { stencil_contrib_cnt[stencil_i]++; + } } - max_contribut_size= hypre_max( max_contribut_size, - stencil_contrib_cnt[stencil_i] ); + max_contribut_size = hypre_max( max_contribut_size, + stencil_contrib_cnt[stencil_i] ); } if (stencil_i != -1) { - stencil_contrib_i[stencil_i]= + stencil_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Int, stencil_contrib_cnt[stencil_i], HYPRE_MEMORY_HOST); weight_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Real, stencil_contrib_cnt[stencil_i], HYPRE_MEMORY_HOST); - sum= 0.0; - k= 0; + sum = 0.0; + k = 0; - stencil_contrib_i[stencil_i][k]= stencil_i; - AbsStencilShape( hypre_StructStencilElement(stencils,stencil_i), + stencil_contrib_i[stencil_i][k] = stencil_i; + AbsStencilShape( hypre_StructStencilElement(stencils, stencil_i), abs_stencil_shape ); weight_contrib_i[stencil_i][k++] = weights[abs_stencil_shape]; - sum+= weights[abs_stencil_shape]; + sum += weights[abs_stencil_shape]; - for (i=13; i<= 14; i++) + for (i = 13; i <= 14; i++) { if (rank_stencils[i] != -1) { - stencil_contrib_i[stencil_i][k]= rank_stencils[i]; + stencil_contrib_i[stencil_i][k] = rank_stencils[i]; - AbsStencilShape(hypre_StructStencilElement(stencils,rank_stencils[i]), + AbsStencilShape(hypre_StructStencilElement(stencils, rank_stencils[i]), abs_stencil_shape ); weight_contrib_i[stencil_i][k++] = weights[abs_stencil_shape]; - sum+= weights[abs_stencil_shape]; + sum += weights[abs_stencil_shape]; } } - for (i= 0; i< k ; i++) + for (i = 0; i < k ; i++) { - weight_contrib_i[stencil_i][i]/= sum; + weight_contrib_i[stencil_i][i] /= sum; } } /* edges: top south*/ - stencil_i= rank_stencils[15]; + stencil_i = rank_stencils[15]; if (stencil_i != -1) { stencil_contrib_cnt[stencil_i]++; - for (i=16; i<= 17; i++) + for (i = 16; i <= 17; i++) { if (rank_stencils[i] != -1) + { stencil_contrib_cnt[stencil_i]++; + } } - max_contribut_size= hypre_max( max_contribut_size, - stencil_contrib_cnt[stencil_i] ); + max_contribut_size = hypre_max( max_contribut_size, + stencil_contrib_cnt[stencil_i] ); } if (stencil_i != -1) { - stencil_contrib_i[stencil_i]= + stencil_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Int, stencil_contrib_cnt[stencil_i], HYPRE_MEMORY_HOST); weight_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Real, stencil_contrib_cnt[stencil_i], HYPRE_MEMORY_HOST); - sum= 0.0; - k= 0; + sum = 0.0; + k = 0; - stencil_contrib_i[stencil_i][k]= stencil_i; - AbsStencilShape( hypre_StructStencilElement(stencils,stencil_i), + stencil_contrib_i[stencil_i][k] = stencil_i; + AbsStencilShape( hypre_StructStencilElement(stencils, stencil_i), abs_stencil_shape ); weight_contrib_i[stencil_i][k++] = weights[abs_stencil_shape]; - sum+= weights[abs_stencil_shape]; + sum += weights[abs_stencil_shape]; - for (i=16; i<= 17; i++) + for (i = 16; i <= 17; i++) { if (rank_stencils[i] != -1) { - stencil_contrib_i[stencil_i][k]= rank_stencils[i]; + stencil_contrib_i[stencil_i][k] = rank_stencils[i]; - AbsStencilShape(hypre_StructStencilElement(stencils,rank_stencils[i]), + AbsStencilShape(hypre_StructStencilElement(stencils, rank_stencils[i]), abs_stencil_shape ); weight_contrib_i[stencil_i][k++] = weights[abs_stencil_shape]; - sum+= weights[abs_stencil_shape]; + sum += weights[abs_stencil_shape]; } } - for (i= 0; i< k ; i++) + for (i = 0; i < k ; i++) { - weight_contrib_i[stencil_i][i]/= sum; + weight_contrib_i[stencil_i][i] /= sum; } } /* edges: bottom east */ - stencil_i= rank_stencils[19]; + stencil_i = rank_stencils[19]; if (stencil_i != -1) { stencil_contrib_cnt[stencil_i]++; - for (i=3; i<= 6; i+=3) + for (i = 3; i <= 6; i += 3) { - if (rank_stencils[19+i] != -1) + if (rank_stencils[19 + i] != -1) + { stencil_contrib_cnt[stencil_i]++; + } } - max_contribut_size= hypre_max( max_contribut_size, - stencil_contrib_cnt[stencil_i] ); + max_contribut_size = hypre_max( max_contribut_size, + stencil_contrib_cnt[stencil_i] ); } if (stencil_i != -1) { - stencil_contrib_i[stencil_i]= + stencil_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Int, stencil_contrib_cnt[stencil_i], HYPRE_MEMORY_HOST); weight_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Real, stencil_contrib_cnt[stencil_i], HYPRE_MEMORY_HOST); - sum= 0.0; - k= 0; + sum = 0.0; + k = 0; - stencil_contrib_i[stencil_i][k]= stencil_i; - AbsStencilShape( hypre_StructStencilElement(stencils,stencil_i), + stencil_contrib_i[stencil_i][k] = stencil_i; + AbsStencilShape( hypre_StructStencilElement(stencils, stencil_i), abs_stencil_shape ); weight_contrib_i[stencil_i][k++] = weights[abs_stencil_shape]; - sum+= weights[abs_stencil_shape]; + sum += weights[abs_stencil_shape]; - for (i=3; i<= 6; i+=3) + for (i = 3; i <= 6; i += 3) { - if (rank_stencils[19+i] != -1) + if (rank_stencils[19 + i] != -1) { - stencil_contrib_i[stencil_i][k]= rank_stencils[19+i]; + stencil_contrib_i[stencil_i][k] = rank_stencils[19 + i]; - AbsStencilShape(hypre_StructStencilElement(stencils,rank_stencils[19+i]), + AbsStencilShape(hypre_StructStencilElement(stencils, rank_stencils[19 + i]), abs_stencil_shape ); weight_contrib_i[stencil_i][k++] = weights[abs_stencil_shape]; - sum+= weights[abs_stencil_shape]; + sum += weights[abs_stencil_shape]; } } - for (i= 0; i< k ; i++) + for (i = 0; i < k ; i++) { - weight_contrib_i[stencil_i][i]/= sum; + weight_contrib_i[stencil_i][i] /= sum; } } /* edges: bottom west */ - stencil_i= rank_stencils[20]; + stencil_i = rank_stencils[20]; if (stencil_i != -1) { stencil_contrib_cnt[stencil_i]++; - for (i=3; i<= 6; i+=3) + for (i = 3; i <= 6; i += 3) { - if (rank_stencils[20+i] != -1) + if (rank_stencils[20 + i] != -1) + { stencil_contrib_cnt[stencil_i]++; + } } - max_contribut_size= hypre_max( max_contribut_size, - stencil_contrib_cnt[stencil_i] ); + max_contribut_size = hypre_max( max_contribut_size, + stencil_contrib_cnt[stencil_i] ); } if (stencil_i != -1) { - stencil_contrib_i[stencil_i]= + stencil_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Int, stencil_contrib_cnt[stencil_i], HYPRE_MEMORY_HOST); weight_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Real, stencil_contrib_cnt[stencil_i], HYPRE_MEMORY_HOST); - sum= 0.0; - k= 0; + sum = 0.0; + k = 0; - stencil_contrib_i[stencil_i][k]= stencil_i; - AbsStencilShape( hypre_StructStencilElement(stencils,stencil_i), + stencil_contrib_i[stencil_i][k] = stencil_i; + AbsStencilShape( hypre_StructStencilElement(stencils, stencil_i), abs_stencil_shape ); weight_contrib_i[stencil_i][k++] = weights[abs_stencil_shape]; - sum+= weights[abs_stencil_shape]; + sum += weights[abs_stencil_shape]; - for (i=3; i<= 6; i+=3) + for (i = 3; i <= 6; i += 3) { - if (rank_stencils[20+i] != -1) + if (rank_stencils[20 + i] != -1) { - stencil_contrib_i[stencil_i][k]= rank_stencils[20+i]; + stencil_contrib_i[stencil_i][k] = rank_stencils[20 + i]; - AbsStencilShape(hypre_StructStencilElement(stencils,rank_stencils[20+i]), + AbsStencilShape(hypre_StructStencilElement(stencils, rank_stencils[20 + i]), abs_stencil_shape ); weight_contrib_i[stencil_i][k++] = weights[abs_stencil_shape]; - sum+= weights[abs_stencil_shape]; + sum += weights[abs_stencil_shape]; } } - for (i= 0; i< k ; i++) + for (i = 0; i < k ; i++) { - weight_contrib_i[stencil_i][i]/= sum; + weight_contrib_i[stencil_i][i] /= sum; } } /* edges: bottom north */ - stencil_i= rank_stencils[21]; + stencil_i = rank_stencils[21]; if (stencil_i != -1) { stencil_contrib_cnt[stencil_i]++; - for (i=22; i<= 23; i++) + for (i = 22; i <= 23; i++) { if (rank_stencils[i] != -1) + { stencil_contrib_cnt[stencil_i]++; + } } - max_contribut_size= hypre_max( max_contribut_size, - stencil_contrib_cnt[stencil_i] ); + max_contribut_size = hypre_max( max_contribut_size, + stencil_contrib_cnt[stencil_i] ); } if (stencil_i != -1) { - stencil_contrib_i[stencil_i]= + stencil_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Int, stencil_contrib_cnt[stencil_i], HYPRE_MEMORY_HOST); weight_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Real, stencil_contrib_cnt[stencil_i], HYPRE_MEMORY_HOST); - sum= 0.0; - k= 0; + sum = 0.0; + k = 0; - stencil_contrib_i[stencil_i][k]= stencil_i; - AbsStencilShape( hypre_StructStencilElement(stencils,stencil_i), + stencil_contrib_i[stencil_i][k] = stencil_i; + AbsStencilShape( hypre_StructStencilElement(stencils, stencil_i), abs_stencil_shape ); weight_contrib_i[stencil_i][k++] = weights[abs_stencil_shape]; - sum+= weights[abs_stencil_shape]; + sum += weights[abs_stencil_shape]; - for (i=22; i<= 23; i++) + for (i = 22; i <= 23; i++) { if (rank_stencils[i] != -1) { - stencil_contrib_i[stencil_i][k]= rank_stencils[i]; + stencil_contrib_i[stencil_i][k] = rank_stencils[i]; - AbsStencilShape(hypre_StructStencilElement(stencils,rank_stencils[i]), + AbsStencilShape(hypre_StructStencilElement(stencils, rank_stencils[i]), abs_stencil_shape ); weight_contrib_i[stencil_i][k++] = weights[abs_stencil_shape]; - sum+= weights[abs_stencil_shape]; + sum += weights[abs_stencil_shape]; } } - for (i= 0; i< k ; i++) + for (i = 0; i < k ; i++) { - weight_contrib_i[stencil_i][i]/= sum; + weight_contrib_i[stencil_i][i] /= sum; } } /* edges: bottom south*/ - stencil_i= rank_stencils[24]; + stencil_i = rank_stencils[24]; if (stencil_i != -1) { stencil_contrib_cnt[stencil_i]++; - for (i=25; i<= 26; i++) + for (i = 25; i <= 26; i++) { if (rank_stencils[i] != -1) + { stencil_contrib_cnt[stencil_i]++; + } } - max_contribut_size= hypre_max( max_contribut_size, - stencil_contrib_cnt[stencil_i] ); + max_contribut_size = hypre_max( max_contribut_size, + stencil_contrib_cnt[stencil_i] ); } if (stencil_i != -1) { - stencil_contrib_i[stencil_i]= + stencil_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Int, stencil_contrib_cnt[stencil_i], HYPRE_MEMORY_HOST); weight_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Real, stencil_contrib_cnt[stencil_i], HYPRE_MEMORY_HOST); - sum= 0.0; - k= 0; + sum = 0.0; + k = 0; - stencil_contrib_i[stencil_i][k]= stencil_i; - AbsStencilShape( hypre_StructStencilElement(stencils,stencil_i), + stencil_contrib_i[stencil_i][k] = stencil_i; + AbsStencilShape( hypre_StructStencilElement(stencils, stencil_i), abs_stencil_shape ); weight_contrib_i[stencil_i][k++] = weights[abs_stencil_shape]; - sum+= weights[abs_stencil_shape]; + sum += weights[abs_stencil_shape]; - for (i=25; i<= 26; i++) + for (i = 25; i <= 26; i++) { if (rank_stencils[i] != -1) { - stencil_contrib_i[stencil_i][k]= rank_stencils[i]; + stencil_contrib_i[stencil_i][k] = rank_stencils[i]; - AbsStencilShape(hypre_StructStencilElement(stencils,rank_stencils[i]), + AbsStencilShape(hypre_StructStencilElement(stencils, rank_stencils[i]), abs_stencil_shape ); weight_contrib_i[stencil_i][k++] = weights[abs_stencil_shape]; - sum+= weights[abs_stencil_shape]; + sum += weights[abs_stencil_shape]; } } - for (i= 0; i< k ; i++) + for (i = 0; i < k ; i++) { - weight_contrib_i[stencil_i][i]/= sum; + weight_contrib_i[stencil_i][i] /= sum; } } /* corners*/ - for (j= 1; j<= 2; j++) + for (j = 1; j <= 2; j++) { - for (i= 4; i<= 5; i++) + for (i = 4; i <= 5; i++) { - stencil_i= rank_stencils[9*j+i]; + stencil_i = rank_stencils[9 * j + i]; if (stencil_i != -1) { stencil_contrib_cnt[stencil_i]++; - stencil_contrib_i[stencil_i]= hypre_TAlloc(HYPRE_Int, 1, HYPRE_MEMORY_HOST); + stencil_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Int, 1, HYPRE_MEMORY_HOST); weight_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Real, 1, HYPRE_MEMORY_HOST); - stencil_contrib_i[stencil_i][0]= stencil_i; + stencil_contrib_i[stencil_i][0] = stencil_i; weight_contrib_i[stencil_i][0] = weights[0]; } } - for (i= 7; i<= 8; i++) + for (i = 7; i <= 8; i++) { - stencil_i= rank_stencils[9*j+i]; + stencil_i = rank_stencils[9 * j + i]; if (stencil_i != -1) { stencil_contrib_cnt[stencil_i]++; - stencil_contrib_i[stencil_i]= hypre_TAlloc(HYPRE_Int, 1, HYPRE_MEMORY_HOST); + stencil_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Int, 1, HYPRE_MEMORY_HOST); weight_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Real, 1, HYPRE_MEMORY_HOST); - stencil_contrib_i[stencil_i][0]= stencil_i; + stencil_contrib_i[stencil_i][0] = stencil_i; weight_contrib_i[stencil_i][0] = weights[0]; } } @@ -1767,7 +1820,7 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, * Allocate for the temporary vector used in computing the * averages. *-----------------------------------------------------------------*/ - vals= hypre_CTAlloc(HYPRE_Real, max_contribut_size, HYPRE_MEMORY_HOST); + vals = hypre_CTAlloc(HYPRE_Real, max_contribut_size, HYPRE_MEMORY_HOST); /*----------------------------------------------------------------- * coarse grid stencil contributor structures have been formed. @@ -1778,52 +1831,52 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, * Loop over gridboxes to average stencils *---------------------------------------------------------------------*/ smatrix_var = hypre_SStructPMatrixSMatrix(A_pmatrix, var1, var2); - crse_smatrix= hypre_SStructPMatrixSMatrix(A_crse, var1, var2); + crse_smatrix = hypre_SStructPMatrixSMatrix(A_crse, var1, var2); /*--------------------------------------------------------------------- * data ptrs to extract and fill in data. *---------------------------------------------------------------------*/ a_ptrs = hypre_TAlloc(HYPRE_Real *, stencil_size, HYPRE_MEMORY_HOST); - crse_ptrs= hypre_TAlloc(HYPRE_Real *, stencil_size, HYPRE_MEMORY_HOST); + crse_ptrs = hypre_TAlloc(HYPRE_Real *, stencil_size, HYPRE_MEMORY_HOST); hypre_ForBoxI(ci, cgrid_boxes) { - cgrid_box= hypre_BoxArrayBox(cgrid_boxes, ci); + cgrid_box = hypre_BoxArrayBox(cgrid_boxes, ci); fbox_interior_ci = fbox_interior[var1][ci]; fbox_bdy_ci = fbox_bdy[var1][ci]; - interior_fboxi_ci= interior_fboxi[var1][ci]; + interior_fboxi_ci = interior_fboxi[var1][ci]; bdy_fboxi_ci = bdy_fboxi[var1][ci]; - crse_dbox= hypre_BoxArrayBox(hypre_StructMatrixDataSpace(crse_smatrix), - ci); + crse_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(crse_smatrix), + ci); /*------------------------------------------------------------------ * grab the correct coarse grid pointers. These are the parent base * grids. *------------------------------------------------------------------*/ - for (i= 0; i< stencil_size; i++) + for (i = 0; i < stencil_size; i++) { hypre_CopyIndex(hypre_StructStencilElement(stencils, i), stencil_shape_i); - crse_ptrs[i]= hypre_StructMatrixExtractPointerByIndex(crse_smatrix, - ci, - stencil_shape_i); + crse_ptrs[i] = hypre_StructMatrixExtractPointerByIndex(crse_smatrix, + ci, + stencil_shape_i); } /*------------------------------------------------------------------ * Loop over the interior of each patch inside cgrid_box. *------------------------------------------------------------------*/ hypre_ForBoxI(fi, fbox_interior_ci) { - fgrid_box= hypre_BoxArrayBox(fbox_interior_ci, fi); + fgrid_box = hypre_BoxArrayBox(fbox_interior_ci, fi); /*-------------------------------------------------------------- * grab the fine grid ptrs & create the offsets for the fine * grid ptrs. *--------------------------------------------------------------*/ - A_dbox= hypre_BoxArrayBox(hypre_StructMatrixDataSpace(smatrix_var), - interior_fboxi_ci[fi]); - for (i= 0; i< stencil_size; i++) + A_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(smatrix_var), + interior_fboxi_ci[fi]); + for (i = 0; i < stencil_size; i++) { hypre_CopyIndex(hypre_StructStencilElement(stencils, i), stencil_shape_i); - a_ptrs[i]= + a_ptrs[i] = hypre_StructMatrixExtractPointerByIndex(smatrix_var, interior_fboxi_ci[fi], stencil_shape_i); @@ -1834,10 +1887,10 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, * Note that for 1-d, OffsetA[j][i]= 0. Therefore, this ptr * will be correct for 1-d. *---------------------------------------------------------------*/ - for (j= 0; j< 2; j++) + for (j = 0; j < 2; j++) { - OffsetA[j][0]= 0; - for (i= 1; i< refine_factors[j+1]; i++) + OffsetA[j][0] = 0; + for (i = 1; i < refine_factors[j + 1]; i++) { if (j == 0) { @@ -1873,9 +1926,9 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, A_dbox, fstart, stridef, iA, crse_dbox, cstart, stridec, iAc); { - for (i= 0; i< stencil_size; i++) + for (i = 0; i < stencil_size; i++) { - rank= stencil_ranks[i]; + rank = stencil_ranks[i]; /*------------------------------------------------------------ * Loop over refinement agglomeration making up a coarse cell @@ -1890,9 +1943,9 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, hypre_CopyIndex(hypre_BoxIMin(shift_box[i]), index1); hypre_CopyIndex(hypre_BoxIMax(shift_box[i]), index2); - for (m= 0; m< stencil_contrib_cnt[i]; m++) + for (m = 0; m < stencil_contrib_cnt[i]; m++) { - vals[m]= 0.0; + vals[m] = 0.0; } /*-------------------------------------------------------- @@ -1900,20 +1953,20 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, * iA_shift_zyx= j, * which is correct. Similarly, 2-d is correct. *--------------------------------------------------------*/ - for (l= index1[2]; l<= index2[2]; l++) + for (l = index1[2]; l <= index2[2]; l++) { - iA_shift_z= iA + OffsetA[1][l]; - for (k= index1[1]; k<= index2[1]; k++) + iA_shift_z = iA + OffsetA[1][l]; + for (k = index1[1]; k <= index2[1]; k++) { - iA_shift_zy= iA_shift_z + OffsetA[0][k]; - for (j= index1[0]; j<= index2[0]; j++) + iA_shift_zy = iA_shift_z + OffsetA[0][k]; + for (j = index1[0]; j <= index2[0]; j++) { - iA_shift_zyx= iA_shift_zy + j; + iA_shift_zyx = iA_shift_zy + j; - for (m= 0; m< stencil_contrib_cnt[i]; m++) + for (m = 0; m < stencil_contrib_cnt[i]; m++) { - stencil_i= stencil_contrib_i[i][m]; - vals[m]+= a_ptrs[stencil_i][iA_shift_zyx]; + stencil_i = stencil_contrib_i[i][m]; + vals[m] += a_ptrs[stencil_i][iA_shift_zyx]; } } } @@ -1922,12 +1975,12 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, * average & weight the contributions and place into coarse * stencil entry. *----------------------------------------------------------*/ - crse_ptrs[i][iAc]= 0.0; - for (m= 0; m< stencil_contrib_cnt[i]; m++) + crse_ptrs[i][iAc] = 0.0; + for (m = 0; m < stencil_contrib_cnt[i]; m++) { - crse_ptrs[i][iAc]+= vals[m]*weight_contrib_i[i][m]; + crse_ptrs[i][iAc] += vals[m] * weight_contrib_i[i][m]; } - crse_ptrs[i][iAc]/= volume_shift_box[i]; + crse_ptrs[i][iAc] /= volume_shift_box[i]; } /* if (rank) */ } /* for i */ @@ -1943,19 +1996,19 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, hypre_CopyIndex(hypre_BoxIMin(&coarse_cell_box), index1); hypre_CopyIndex(hypre_BoxIMax(&coarse_cell_box), index2); - sum= 0.0; - for (l= index1[2]; l<= index2[2]; l++) + sum = 0.0; + for (l = index1[2]; l <= index2[2]; l++) { - iA_shift_z= iA + OffsetA[1][l]; - for (k= index1[1]; k<= index2[1]; k++) + iA_shift_z = iA + OffsetA[1][l]; + for (k = index1[1]; k <= index2[1]; k++) { - iA_shift_zy= iA_shift_z + OffsetA[0][k]; - for (j= index1[0]; j<= index2[0]; j++) + iA_shift_zy = iA_shift_z + OffsetA[0][k]; + for (j = index1[0]; j <= index2[0]; j++) { - iA_shift_zyx= iA_shift_zy + j; - for (m= 0; m< stencil_size; m++) + iA_shift_zyx = iA_shift_zy + j; + for (m = 0; m < stencil_size; m++) { - sum+= a_ptrs[m][iA_shift_zyx]; + sum += a_ptrs[m][iA_shift_zyx]; } } } @@ -1967,15 +2020,15 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, * off-diagonal components. *---------------------------------------------------------------*/ sum /= scaling; - for (m= 0; m< stencil_size; m++) + for (m = 0; m < stencil_size; m++) { - rank= stencil_ranks[m]; + rank = stencil_ranks[m]; if (rank) { - sum-= crse_ptrs[m][iAc]; + sum -= crse_ptrs[m][iAc]; } } - crse_ptrs[ rank_stencils[0] ][iAc]= sum; + crse_ptrs[ rank_stencils[0] ][iAc] = sum; } hypre_SerialBoxLoop2End(iA, iAc); } /* end hypre_ForBoxI(fi, fbox_interior_ci) */ @@ -1985,22 +2038,22 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, *------------------------------------------------------------------*/ hypre_ForBoxArrayI(arrayi, fbox_bdy_ci) { - fbox_bdy_ci_fi= hypre_BoxArrayArrayBoxArray(fbox_bdy_ci, arrayi); + fbox_bdy_ci_fi = hypre_BoxArrayArrayBoxArray(fbox_bdy_ci, arrayi); hypre_ForBoxI(fi, fbox_bdy_ci_fi) { - fgrid_box= hypre_BoxArrayBox(fbox_bdy_ci_fi, fi); + fgrid_box = hypre_BoxArrayBox(fbox_bdy_ci_fi, fi); /*----------------------------------------------------------- * grab the fine grid ptrs & create the offsets for the fine * grid ptrs. *-----------------------------------------------------------*/ - A_dbox= hypre_BoxArrayBox(hypre_StructMatrixDataSpace(smatrix_var), - bdy_fboxi_ci[arrayi]); - for (i= 0; i< stencil_size; i++) + A_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(smatrix_var), + bdy_fboxi_ci[arrayi]); + for (i = 0; i < stencil_size; i++) { hypre_CopyIndex(hypre_StructStencilElement(stencils, i), stencil_shape_i); - a_ptrs[i]= + a_ptrs[i] = hypre_StructMatrixExtractPointerByIndex(smatrix_var, bdy_fboxi_ci[arrayi], stencil_shape_i); @@ -2009,10 +2062,10 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, /*-------------------------------------------------------------- * Compute the offsets for pointing to the correct data. *--------------------------------------------------------------*/ - for (j= 0; j< 2; j++) + for (j = 0; j < 2; j++) { - OffsetA[j][0]= 0; - for (i= 1; i< refine_factors[j+1]; i++) + OffsetA[j][0] = 0; + for (i = 1; i < refine_factors[j + 1]; i++) { if (j == 0) { @@ -2049,9 +2102,9 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, crse_dbox, cstart, stridec, iAc); { zypre_BoxLoopGetIndex(lindex); - for (i= 0; i< stencil_size; i++) + for (i = 0; i < stencil_size; i++) { - rank= stencil_ranks[i]; + rank = stencil_ranks[i]; /*-------------------------------------------------------- * Loop over refinement agglomeration making up a coarse @@ -2066,25 +2119,25 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, hypre_CopyIndex(hypre_BoxIMin(shift_box[i]), index1); hypre_CopyIndex(hypre_BoxIMax(shift_box[i]), index2); - for (m= 0; m< stencil_contrib_cnt[i]; m++) + for (m = 0; m < stencil_contrib_cnt[i]; m++) { - vals[m]= 0.0; + vals[m] = 0.0; } - for (l= index1[2]; l<= index2[2]; l++) + for (l = index1[2]; l <= index2[2]; l++) { - iA_shift_z= iA + OffsetA[1][l]; - for (k= index1[1]; k<= index2[1]; k++) + iA_shift_z = iA + OffsetA[1][l]; + for (k = index1[1]; k <= index2[1]; k++) { - iA_shift_zy= iA_shift_z + OffsetA[0][k]; - for (j= index1[0]; j<= index2[0]; j++) + iA_shift_zy = iA_shift_z + OffsetA[0][k]; + for (j = index1[0]; j <= index2[0]; j++) { - iA_shift_zyx= iA_shift_zy + j; + iA_shift_zyx = iA_shift_zy + j; - for (m= 0; m< stencil_contrib_cnt[i]; m++) + for (m = 0; m < stencil_contrib_cnt[i]; m++) { - stencil_i= stencil_contrib_i[i][m]; - vals[m]+= a_ptrs[stencil_i][iA_shift_zyx]; + stencil_i = stencil_contrib_i[i][m]; + vals[m] += a_ptrs[stencil_i][iA_shift_zyx]; } } } @@ -2093,12 +2146,12 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, * average & weight the contributions and place into coarse * stencil entry. *---------------------------------------------------------*/ - crse_ptrs[i][iAc]= 0.0; - for (m= 0; m< stencil_contrib_cnt[i]; m++) + crse_ptrs[i][iAc] = 0.0; + for (m = 0; m < stencil_contrib_cnt[i]; m++) { - crse_ptrs[i][iAc]+= vals[m]*weight_contrib_i[i][m]; + crse_ptrs[i][iAc] += vals[m] * weight_contrib_i[i][m]; } - crse_ptrs[i][iAc]/= volume_shift_box[i]; + crse_ptrs[i][iAc] /= volume_shift_box[i]; } /* if (rank) */ } /* for i */ @@ -2115,27 +2168,27 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, hypre_CopyIndex(hypre_BoxIMin(&coarse_cell_box), index1); hypre_CopyIndex(hypre_BoxIMax(&coarse_cell_box), index2); - temp3= hypre_CTAlloc(HYPRE_Real, volume_coarse_cell_box, HYPRE_MEMORY_HOST); + temp3 = hypre_CTAlloc(HYPRE_Real, volume_coarse_cell_box, HYPRE_MEMORY_HOST); /*--------------------------------------------------------------- * iA_shift_zyx is computed correctly for 1 & 2-d. Also, * ll= 0 for 2-d, and ll= kk= 0 for 1-d. Correct ptrs. *---------------------------------------------------------------*/ - for (l= index1[2]; l<= index2[2]; l++) + for (l = index1[2]; l <= index2[2]; l++) { - iA_shift_z= iA + OffsetA[1][l]; - ll = l*refine_factors[1]*refine_factors[0]; - for (k= index1[1]; k<= index2[1]; k++) + iA_shift_z = iA + OffsetA[1][l]; + ll = l * refine_factors[1] * refine_factors[0]; + for (k = index1[1]; k <= index2[1]; k++) { - iA_shift_zy= iA_shift_z + OffsetA[0][k]; - kk = ll + k*refine_factors[0]; - for (j= index1[0]; j<= index2[0]; j++) + iA_shift_zy = iA_shift_z + OffsetA[0][k]; + kk = ll + k * refine_factors[0]; + for (j = index1[0]; j <= index2[0]; j++) { - iA_shift_zyx= iA_shift_zy + j; + iA_shift_zyx = iA_shift_zy + j; jj = kk + j; - for (m= 0; m< stencil_size; m++) + for (m = 0; m < stencil_size; m++) { - temp3[jj]+= a_ptrs[m][iA_shift_zyx]; + temp3[jj] += a_ptrs[m][iA_shift_zyx]; } } } @@ -2147,22 +2200,22 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, *------------------------------------------------------------*/ if (nUventries > 0) { - temp2= hypre_CTAlloc(HYPRE_Int, volume_coarse_cell_box, HYPRE_MEMORY_HOST); - cnt1= 0; - for (l= index1[2]; l<= index2[2]; l++) + temp2 = hypre_CTAlloc(HYPRE_Int, volume_coarse_cell_box, HYPRE_MEMORY_HOST); + cnt1 = 0; + for (l = index1[2]; l <= index2[2]; l++) { - ll= l*refine_factors[1]*refine_factors[0]; - for (k= index1[1]; k<= index2[1]; k++) + ll = l * refine_factors[1] * refine_factors[0]; + for (k = index1[1]; k <= index2[1]; k++) { - kk= ll + k*refine_factors[0]; - for (j= index1[0]; j<= index2[0]; j++) + kk = ll + k * refine_factors[0]; + for (j = index1[0]; j <= index2[0]; j++) { - jj= kk+ j; + jj = kk + j; hypre_SetIndex3(index_temp, - j+lindex[0]*stridef[0], - k+lindex[1]*stridef[1], - l+lindex[2]*stridef[2]); + j + lindex[0]*stridef[0], + k + lindex[1]*stridef[1], + l + lindex[2]*stridef[2]); hypre_AddIndexes(fstart, index_temp, 3, index_temp); hypre_SStructGridFindBoxManEntry(grid, part_fine, index_temp, @@ -2170,32 +2223,32 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, hypre_SStructBoxManEntryGetGlobalRank(boxman_entry, index_temp, &rank, matrix_type); - found= falseV; - i= hypre_SStructGraphIUVEntry(graph, 0); - m= hypre_SStructGraphIUVEntry(graph, nUventries-1); - if ((rank-startrank) >= i && (rank-startrank) <= m) + found = falseV; + i = hypre_SStructGraphIUVEntry(graph, 0); + m = hypre_SStructGraphIUVEntry(graph, nUventries - 1); + if ((rank - startrank) >= i && (rank - startrank) <= m) { - found= trueV; + found = trueV; } if (found) { - Uventry= hypre_SStructGraphUVEntry(graph, rank-startrank); + Uventry = hypre_SStructGraphUVEntry(graph, rank - startrank); if (Uventry != NULL) { - nUentries= hypre_SStructUVEntryNUEntries(Uventry); + nUentries = hypre_SStructUVEntryNUEntries(Uventry); - m= 0; - for (i= 0; i< nUentries; i++) + m = 0; + for (i = 0; i < nUentries; i++) { - if (hypre_SStructUVEntryToPart(Uventry, i)==part_crse) + if (hypre_SStructUVEntryToPart(Uventry, i) == part_crse) { m++; } } /* for (i= 0; i< nUentries; i++) */ - temp2[jj]= m; + temp2[jj] = m; cnt1 += m; } /* if (Uventry != NULL) */ @@ -2205,31 +2258,31 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, } /* for (k= index1[1]; k<= index2[1]; k++) */ } /* for (l= index1[2]; l<= index2[2]; l++) */ - ncols= hypre_TAlloc(HYPRE_Int, cnt1, HYPRE_MEMORY_HOST); - for (l= 0; l< cnt1; l++) + ncols = hypre_TAlloc(HYPRE_Int, cnt1, HYPRE_MEMORY_HOST); + for (l = 0; l < cnt1; l++) { - ncols[l]= 1; + ncols[l] = 1; } rows = hypre_TAlloc(HYPRE_BigInt, cnt1, HYPRE_MEMORY_HOST); cols = hypre_TAlloc(HYPRE_BigInt, cnt1, HYPRE_MEMORY_HOST); - vals2= hypre_CTAlloc(HYPRE_Real, cnt1, HYPRE_MEMORY_HOST); + vals2 = hypre_CTAlloc(HYPRE_Real, cnt1, HYPRE_MEMORY_HOST); - cnt1= 0; - for (l= index1[2]; l<= index2[2]; l++) + cnt1 = 0; + for (l = index1[2]; l <= index2[2]; l++) { - ll= l*refine_factors[1]*refine_factors[0]; - for (k= index1[1]; k<= index2[1]; k++) + ll = l * refine_factors[1] * refine_factors[0]; + for (k = index1[1]; k <= index2[1]; k++) { - kk= ll + k*refine_factors[0]; - for (j= index1[0]; j<= index2[0]; j++) + kk = ll + k * refine_factors[0]; + for (j = index1[0]; j <= index2[0]; j++) { - jj= kk+ j; + jj = kk + j; hypre_SetIndex3(index_temp, - j+lindex[0]*stridef[0], - k+lindex[1]*stridef[1], - l+lindex[2]*stridef[2]); + j + lindex[0]*stridef[0], + k + lindex[1]*stridef[1], + l + lindex[2]*stridef[2]); hypre_AddIndexes(fstart, index_temp, 3, index_temp); hypre_SStructGridFindBoxManEntry(grid, part_fine, index_temp, @@ -2237,30 +2290,30 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, hypre_SStructBoxManEntryGetGlobalRank(boxman_entry, index_temp, &rank, matrix_type); - found= falseV; + found = falseV; if (nUventries > 0) { - i= hypre_SStructGraphIUVEntry(graph, 0); - m= hypre_SStructGraphIUVEntry(graph, nUventries-1); - if ((HYPRE_Int)(rank-startrank) >= i && (HYPRE_Int)(rank-startrank) <= m) + i = hypre_SStructGraphIUVEntry(graph, 0); + m = hypre_SStructGraphIUVEntry(graph, nUventries - 1); + if ((HYPRE_Int)(rank - startrank) >= i && (HYPRE_Int)(rank - startrank) <= m) { - found= trueV; + found = trueV; } } if (found) { - Uventry= hypre_SStructGraphUVEntry(graph, (HYPRE_Int)(rank-startrank)); + Uventry = hypre_SStructGraphUVEntry(graph, (HYPRE_Int)(rank - startrank)); if (Uventry != NULL) { - nUentries= hypre_SStructUVEntryNUEntries(Uventry); - for (i= 0; i< nUentries; i++) + nUentries = hypre_SStructUVEntryNUEntries(Uventry); + for (i = 0; i < nUentries; i++) { - if (hypre_SStructUVEntryToPart(Uventry, i)==part_crse) + if (hypre_SStructUVEntryToPart(Uventry, i) == part_crse) { - rows[cnt1]= rank; - cols[cnt1++]= hypre_SStructUVEntryToRank(Uventry, i); + rows[cnt1] = rank; + cols[cnt1++] = hypre_SStructUVEntryToRank(Uventry, i); } } /* for (i= 0; i< nUentries; i++) */ @@ -2273,22 +2326,22 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, HYPRE_IJMatrixGetValues(ij_A, cnt1, ncols, rows, cols, vals2); - cnt1= 0; - for (l= index1[2]; l<= index2[2]; l++) + cnt1 = 0; + for (l = index1[2]; l <= index2[2]; l++) { - ll= l*refine_factors[1]*refine_factors[0]; - for (k= index1[1]; k<= index2[1]; k++) + ll = l * refine_factors[1] * refine_factors[0]; + for (k = index1[1]; k <= index2[1]; k++) { - kk= ll + k*refine_factors[0]; - for (j= index1[0]; j<= index2[0]; j++) + kk = ll + k * refine_factors[0]; + for (j = index1[0]; j <= index2[0]; j++) { - jj= kk+ j; - for (m= 0; m< temp2[jj]; m++) + jj = kk + j; + for (m = 0; m < temp2[jj]; m++) { - temp3[jj]+= vals2[cnt1]; + temp3[jj] += vals2[cnt1]; cnt1++; } - temp2[jj]= 0; /* zero off for next time */ + temp2[jj] = 0; /* zero off for next time */ } /* for (j= index1[0]; j<= index2[0]; j++) */ } /* for (k= index1[1]; k<= index2[1]; k++) */ } /* for (l= index1[2]; l<= index2[2]; l++) */ @@ -2301,23 +2354,23 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, } /* if Uventries > 0 */ - sum= 0.0; - for (l= index1[2]; l<= index2[2]; l++) + sum = 0.0; + for (l = index1[2]; l <= index2[2]; l++) { - ll= l*refine_factors[1]*refine_factors[0]; - for (k= index1[1]; k<= index2[1]; k++) + ll = l * refine_factors[1] * refine_factors[0]; + for (k = index1[1]; k <= index2[1]; k++) { - kk= ll + k*refine_factors[0]; - for (j= index1[0]; j<= index2[0]; j++) + kk = ll + k * refine_factors[0]; + for (j = index1[0]; j <= index2[0]; j++) { - jj= kk + j; - sum+= temp3[jj]; + jj = kk + j; + sum += temp3[jj]; } } } sum /= scaling; - crse_ptrs[ rank_stencils[0] ][iAc]= sum; + crse_ptrs[ rank_stencils[0] ][iAc] = sum; hypre_TFree(temp3, HYPRE_MEMORY_HOST); @@ -2336,33 +2389,45 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, } /* end var1 */ if (stencil_contrib_cnt) + { hypre_TFree(stencil_contrib_cnt, HYPRE_MEMORY_HOST); + } if (stencil_ranks) + { hypre_TFree(stencil_ranks, HYPRE_MEMORY_HOST); + } if (volume_shift_box) + { hypre_TFree(volume_shift_box, HYPRE_MEMORY_HOST); + } if (vals) + { hypre_TFree(vals, HYPRE_MEMORY_HOST); + } if (shift_box) { - for (j= 0; j< stencil_size; j++) + for (j = 0; j < stencil_size; j++) { if (shift_box[j]) + { hypre_BoxDestroy(shift_box[j]); + } } hypre_TFree(shift_box, HYPRE_MEMORY_HOST); } if (stencil_contrib_i) { - for (j= 1; j< max_stencil_size; j++) + for (j = 1; j < max_stencil_size; j++) { - stencil_i= rank_stencils[j]; + stencil_i = rank_stencils[j]; if (stencil_i != -1) { if (stencil_contrib_i[stencil_i]) + { hypre_TFree(stencil_contrib_i[stencil_i], HYPRE_MEMORY_HOST); + } } } hypre_TFree(stencil_contrib_i, HYPRE_MEMORY_HOST); @@ -2370,27 +2435,33 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, if (weight_contrib_i) { - for (j= 1; j< max_stencil_size; j++) + for (j = 1; j < max_stencil_size; j++) { - stencil_i= rank_stencils[j]; + stencil_i = rank_stencils[j]; if (stencil_i != -1) { if (weight_contrib_i[stencil_i]) + { hypre_TFree(weight_contrib_i[stencil_i], HYPRE_MEMORY_HOST); + } } } hypre_TFree(weight_contrib_i, HYPRE_MEMORY_HOST); } if (rank_stencils) + { hypre_TFree(rank_stencils, HYPRE_MEMORY_HOST); + } if (OffsetA) { - for (j= 0; j< 2; j++) + for (j = 0; j < 2; j++) { if (OffsetA[j]) + { hypre_TFree(OffsetA[j], HYPRE_MEMORY_HOST); + } } hypre_TFree(OffsetA, HYPRE_MEMORY_HOST); } @@ -2449,18 +2520,18 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, { nvars = hypre_SStructPMatrixNVars(A_pmatrix); - for (var1= 0; var1< nvars; var1++) + for (var1 = 0; var1 < nvars; var1++) { /*----------------------------------------------------------------- * Yank out the structured stencils for this variable (only like * variables considered) and find their ranks. *-----------------------------------------------------------------*/ stencils = hypre_SStructPMatrixSStencil(A_crse, var1, var1); - stencil_size= hypre_StructStencilSize(stencils); + stencil_size = hypre_StructStencilSize(stencils); - stencil_ranks= hypre_TAlloc(HYPRE_Int, stencil_size, HYPRE_MEMORY_HOST); - rank_stencils= hypre_TAlloc(HYPRE_Int, max_stencil_size, HYPRE_MEMORY_HOST); - for (i= 0; i< stencil_size; i++) + stencil_ranks = hypre_TAlloc(HYPRE_Int, stencil_size, HYPRE_MEMORY_HOST); + rank_stencils = hypre_TAlloc(HYPRE_Int, max_stencil_size, HYPRE_MEMORY_HOST); + for (i = 0; i < stencil_size; i++) { hypre_CopyIndex(hypre_StructStencilElement(stencils, i), stencil_shape_i); @@ -2470,16 +2541,16 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, /*----------------------------------------------------------------- * qsort the ranks into ascending order *-----------------------------------------------------------------*/ - hypre_qsort0(stencil_ranks, 0, stencil_size-1); + hypre_qsort0(stencil_ranks, 0, stencil_size - 1); - crse_smatrix= hypre_SStructPMatrixSMatrix(A_crse, var1, var1); - cgrid= hypre_SStructPGridSGrid(hypre_SStructPMatrixPGrid(A_crse), var1); - cgrid_boxes= hypre_StructGridBoxes(cgrid); + crse_smatrix = hypre_SStructPMatrixSMatrix(A_crse, var1, var1); + cgrid = hypre_SStructPGridSGrid(hypre_SStructPMatrixPGrid(A_crse), var1); + cgrid_boxes = hypre_StructGridBoxes(cgrid); - fgrid= hypre_SStructPGridSGrid(hypre_SStructPMatrixPGrid(A_pmatrix), var1); - fgrid_boxes= hypre_StructGridBoxes(fgrid); + fgrid = hypre_SStructPGridSGrid(hypre_SStructPMatrixPGrid(A_pmatrix), var1); + fgrid_boxes = hypre_StructGridBoxes(fgrid); - box_starts= hypre_CTAlloc(HYPRE_Int, hypre_BoxArraySize(fgrid_boxes), HYPRE_MEMORY_HOST); + box_starts = hypre_CTAlloc(HYPRE_Int, hypre_BoxArraySize(fgrid_boxes), HYPRE_MEMORY_HOST); box_ends = hypre_CTAlloc(HYPRE_Int, hypre_BoxArraySize(fgrid_boxes), HYPRE_MEMORY_HOST); hypre_SStructGraphFindSGridEndpts(graph, part_fine, var1, myid, 0, box_starts); @@ -2499,16 +2570,16 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, *-----------------------------------------------------------------*/ box_array_size = hypre_BoxArraySize(fgrid_boxes); cbox_array_size = hypre_BoxArraySize(cgrid_boxes); - box_graph_indices= hypre_CTAlloc(HYPRE_Int *, box_array_size, HYPRE_MEMORY_HOST); - box_graph_cnts = hypre_CTAlloc(HYPRE_Int , box_array_size, HYPRE_MEMORY_HOST); + box_graph_indices = hypre_CTAlloc(HYPRE_Int *, box_array_size, HYPRE_MEMORY_HOST); + box_graph_cnts = hypre_CTAlloc(HYPRE_Int, box_array_size, HYPRE_MEMORY_HOST); data_space = hypre_StructMatrixDataSpace(crse_smatrix); - cdata_space_ranks= hypre_CTAlloc(HYPRE_Int, cbox_array_size, HYPRE_MEMORY_HOST); - cdata_space_ranks[0]= 0; - for (i= 1; i< cbox_array_size; i++) + cdata_space_ranks = hypre_CTAlloc(HYPRE_Int, cbox_array_size, HYPRE_MEMORY_HOST); + cdata_space_ranks[0] = 0; + for (i = 1; i < cbox_array_size; i++) { - cdata_space_ranks[i]= cdata_space_ranks[i-1]+ - hypre_BoxVolume(hypre_BoxArrayBox(data_space, i-1)); + cdata_space_ranks[i] = cdata_space_ranks[i - 1] + + hypre_BoxVolume(hypre_BoxArrayBox(data_space, i - 1)); } /*----------------------------------------------------------------- @@ -2518,24 +2589,24 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, * bounds found. Note that if start has positive index, then end * must have a positive index also. *-----------------------------------------------------------------*/ - for (fi= 0; fi< box_array_size; fi++) + for (fi = 0; fi < box_array_size; fi++) { - i= hypre_LowerBinarySearch(iUventries, box_starts[fi], nUventries); + i = hypre_LowerBinarySearch(iUventries, box_starts[fi], nUventries); if (i >= 0) { - j= hypre_UpperBinarySearch(iUventries, box_ends[fi], nUventries); - box_graph_indices[fi]= hypre_TAlloc(HYPRE_Int, j-i+1, HYPRE_MEMORY_HOST); + j = hypre_UpperBinarySearch(iUventries, box_ends[fi], nUventries); + box_graph_indices[fi] = hypre_TAlloc(HYPRE_Int, j - i + 1, HYPRE_MEMORY_HOST); - for (k= 0; k< (j-i+1); k++) + for (k = 0; k < (j - i + 1); k++) { - Uventry= hypre_SStructGraphUVEntry(graph, - iUventries[i+k]); + Uventry = hypre_SStructGraphUVEntry(graph, + iUventries[i + k]); - for (m= 0; m< hypre_SStructUVEntryNUEntries(Uventry); m++) + for (m = 0; m < hypre_SStructUVEntryNUEntries(Uventry); m++) { if (hypre_SStructUVEntryToPart(Uventry, m) == part_crse) { - box_graph_indices[fi][box_graph_cnts[fi]]= iUventries[i+k]; + box_graph_indices[fi][box_graph_cnts[fi]] = iUventries[i + k]; box_graph_cnts[fi]++; break; } @@ -2566,7 +2637,7 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, * contain fine-to-coarse connections of * coarse node l. *-----------------------------------------------------------------*/ - for (fi= 0; fi< box_array_size; fi++) + for (fi = 0; fi < box_array_size; fi++) { /*------------------------------------------------------------- * Determine the coarse data ptrs corresponding to fine box fi. @@ -2583,7 +2654,7 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, box_ranks = hypre_TAlloc(HYPRE_Int, box_graph_cnts[fi], HYPRE_MEMORY_HOST); box_connections = hypre_TAlloc(HYPRE_Int, box_graph_cnts[fi], HYPRE_MEMORY_HOST); parents = hypre_TAlloc(HYPRE_Int, box_graph_cnts[fi], HYPRE_MEMORY_HOST); - temp1 = hypre_CTAlloc(HYPRE_Int, box_graph_cnts[fi]+1, HYPRE_MEMORY_HOST); + temp1 = hypre_CTAlloc(HYPRE_Int, box_graph_cnts[fi] + 1, HYPRE_MEMORY_HOST); temp2 = hypre_CTAlloc(HYPRE_Int, box_graph_cnts[fi], HYPRE_MEMORY_HOST); Uv_cindex = hypre_TAlloc(hypre_Index, box_graph_cnts[fi], HYPRE_MEMORY_HOST); @@ -2591,7 +2662,7 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, * determine the parent box of this fgrid_box. *-------------------------------------------------------------*/ hypre_ClearIndex(index_temp); - for (i= 0; i < box_graph_cnts[fi]; i++) + for (i = 0; i < box_graph_cnts[fi]; i++) { Uventry = Uventries[box_graph_indices[fi][i]]; @@ -2605,10 +2676,11 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, hypre_StructMapFineToCoarse(index, index_temp, stridef, Uv_cindex[i]); hypre_BoxSetExtents(&fine_box, Uv_cindex[i], Uv_cindex[i]); - for (j= 0; j< cboxi_fcnt[var1][fi]; j++) + ci = 0; + for (j = 0; j < cboxi_fcnt[var1][fi]; j++) { - ci= cboxi_fboxes[var1][fi][j]; - cgrid_box= hypre_BoxArrayBox(cgrid_boxes, ci); + ci = cboxi_fboxes[var1][fi][j]; + cgrid_box = hypre_BoxArrayBox(cgrid_boxes, ci); hypre_IntersectBoxes(&fine_box, cgrid_box, &intersect_box); if (hypre_BoxVolume(&intersect_box) > 0) { @@ -2617,38 +2689,38 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, } parents[i] = ci; - box_ranks[i]= cdata_space_ranks[ci] + - hypre_BoxIndexRank(hypre_BoxArrayBox(data_space, ci), - Uv_cindex[i]); + box_ranks[i] = cdata_space_ranks[ci] + + hypre_BoxIndexRank(hypre_BoxArrayBox(data_space, ci), + Uv_cindex[i]); } /*--------------------------------------------------------------- * Determine and "group" the Uventries using the box_ranks. * temp2 stores the Uventries indices for a coarsen node. *---------------------------------------------------------------*/ - cnt1= 0; + cnt1 = 0; j = 0; - temp1[cnt1]= j; + temp1[cnt1] = j; - for (i= 0; i< box_graph_cnts[fi]; i++) + for (i = 0; i < box_graph_cnts[fi]; i++) { if (box_ranks[i] != -1) { k = box_ranks[i]; - box_connections[i]= cnt1; + box_connections[i] = cnt1; temp2[j++] = box_graph_indices[fi][i]; - for (l= i+1; l< box_graph_cnts[fi]; l++) + for (l = i + 1; l < box_graph_cnts[fi]; l++) { if (box_ranks[l] == k) { - box_connections[l]= cnt1; + box_connections[l] = cnt1; temp2[j++] = box_graph_indices[fi][l]; - box_ranks[l] =-1; + box_ranks[l] = -1; } } cnt1++; - temp1[cnt1]= j; + temp1[cnt1] = j; } } @@ -2657,45 +2729,57 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, * grid node. *-----------------------------------------------------------------*/ parents_cnodes = hypre_TAlloc(HYPRE_Int, cnt1, HYPRE_MEMORY_HOST); - fine_interface_ranks= hypre_TAlloc(HYPRE_Int, cnt1, HYPRE_MEMORY_HOST); + fine_interface_ranks = hypre_TAlloc(HYPRE_Int, cnt1, HYPRE_MEMORY_HOST); box_ranks_cnt = hypre_CTAlloc(HYPRE_Int, cnt1, HYPRE_MEMORY_HOST); coarse_contrib_Uv = hypre_TAlloc(HYPRE_Int *, cnt1, HYPRE_MEMORY_HOST); cindex = hypre_TAlloc(hypre_Index, cnt1, HYPRE_MEMORY_HOST); - for (i= 0; i< box_graph_cnts[fi]; i++) + for (i = 0; i < box_graph_cnts[fi]; i++) { if (box_ranks[i] != -1) { j = box_connections[i]; parents_cnodes[j] = parents[i]; - fine_interface_ranks[j]= + fine_interface_ranks[j] = hypre_BoxIndexRank(hypre_BoxArrayBox(data_space, parents[i]), Uv_cindex[i]); hypre_CopyIndex(Uv_cindex[i], cindex[j]); - box_ranks_cnt[j] = temp1[j+1] - temp1[j]; + box_ranks_cnt[j] = temp1[j + 1] - temp1[j]; coarse_contrib_Uv[j] = hypre_TAlloc(HYPRE_Int, box_ranks_cnt[j], HYPRE_MEMORY_HOST); l = temp1[j]; - for (k= 0; k< box_ranks_cnt[j]; k++) + for (k = 0; k < box_ranks_cnt[j]; k++) { - coarse_contrib_Uv[j][k]= temp2[l+k]; + coarse_contrib_Uv[j][k] = temp2[l + k]; } } } if (box_ranks) + { hypre_TFree(box_ranks, HYPRE_MEMORY_HOST); + } if (box_connections) + { hypre_TFree(box_connections, HYPRE_MEMORY_HOST); + } if (parents) + { hypre_TFree(parents, HYPRE_MEMORY_HOST); + } if (temp1) + { hypre_TFree(temp1, HYPRE_MEMORY_HOST); + } if (temp2) + { hypre_TFree(temp2, HYPRE_MEMORY_HOST); + } if (Uv_cindex) + { hypre_TFree(Uv_cindex, HYPRE_MEMORY_HOST); + } /*------------------------------------------------------------------------ * Step 3: @@ -2723,14 +2807,14 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, *-----------------------------------------------------------------*/ hypre_ClearIndex(index_temp); - nrows= 0; - box_to_ranks_cnt= hypre_CTAlloc(HYPRE_Int, cnt1, HYPRE_MEMORY_HOST); - for (i= 0; i< cnt1; i++) + nrows = 0; + box_to_ranks_cnt = hypre_CTAlloc(HYPRE_Int, cnt1, HYPRE_MEMORY_HOST); + for (i = 0; i < cnt1; i++) { - for (j= 0; j< box_ranks_cnt[i]; j++) + for (j = 0; j < box_ranks_cnt[i]; j++) { Uventry = Uventries[ coarse_contrib_Uv[i][j] ]; - for (k= 0; k< hypre_SStructUVEntryNUEntries(Uventry); k++) + for (k = 0; k < hypre_SStructUVEntryNUEntries(Uventry); k++) { if (hypre_SStructUVEntryToPart(Uventry, k) == part_crse) { @@ -2738,33 +2822,33 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, } } } - nrows+= box_to_ranks_cnt[i]; + nrows += box_to_ranks_cnt[i]; } - ncols= hypre_TAlloc(HYPRE_Int, nrows, HYPRE_MEMORY_HOST); - for (i= 0; i< nrows; i++) + ncols = hypre_TAlloc(HYPRE_Int, nrows, HYPRE_MEMORY_HOST); + for (i = 0; i < nrows; i++) { - ncols[i]= 1; + ncols[i] = 1; } - rows= hypre_TAlloc(HYPRE_BigInt, nrows, HYPRE_MEMORY_HOST); - cols= hypre_TAlloc(HYPRE_BigInt, nrows, HYPRE_MEMORY_HOST); - vals= hypre_CTAlloc(HYPRE_Real, nrows, HYPRE_MEMORY_HOST); + rows = hypre_TAlloc(HYPRE_BigInt, nrows, HYPRE_MEMORY_HOST); + cols = hypre_TAlloc(HYPRE_BigInt, nrows, HYPRE_MEMORY_HOST); + vals = hypre_CTAlloc(HYPRE_Real, nrows, HYPRE_MEMORY_HOST); - interface_max_stencil_ranks= hypre_TAlloc(HYPRE_Int *, cnt1, HYPRE_MEMORY_HOST); + interface_max_stencil_ranks = hypre_TAlloc(HYPRE_Int *, cnt1, HYPRE_MEMORY_HOST); interface_max_stencil_cnt = hypre_TAlloc(HYPRE_Int *, cnt1, HYPRE_MEMORY_HOST); interface_rank_stencils = hypre_TAlloc(HYPRE_Int *, cnt1, HYPRE_MEMORY_HOST); interface_stencil_ranks = hypre_TAlloc(HYPRE_Int *, cnt1, HYPRE_MEMORY_HOST); - coarse_stencil_cnt = hypre_CTAlloc(HYPRE_Int , cnt1, HYPRE_MEMORY_HOST); + coarse_stencil_cnt = hypre_CTAlloc(HYPRE_Int, cnt1, HYPRE_MEMORY_HOST); - k= 0; - for (i= 0; i< cnt1; i++) + k = 0; + for (i = 0; i < cnt1; i++) { /*----------------------------------------------------------------- * for each coarse interface node, we get a stencil. We compute only * the ranks assuming a maximum size stencil of 27. *-----------------------------------------------------------------*/ - interface_max_stencil_ranks[i]= hypre_TAlloc(HYPRE_Int, box_to_ranks_cnt[i], HYPRE_MEMORY_HOST); + interface_max_stencil_ranks[i] = hypre_TAlloc(HYPRE_Int, box_to_ranks_cnt[i], HYPRE_MEMORY_HOST); interface_max_stencil_cnt[i] = hypre_CTAlloc(HYPRE_Int, max_stencil_size, HYPRE_MEMORY_HOST); /*----------------------------------------------------------------- @@ -2774,8 +2858,8 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, hypre_CopyIndex(cindex[i], index1); hypre_SetIndex3(index1, -index1[0], -index1[1], -index1[2]); - n= 0; - for (j= 0; j< box_ranks_cnt[i]; j++) + n = 0; + for (j = 0; j < box_ranks_cnt[i]; j++) { /*-------------------------------------------------------------- * extract the row rank for a given Uventry. Note that these @@ -2790,26 +2874,26 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, hypre_SStructGridFindBoxManEntry(grid, part_fine, index, var1, &boxman_entry); hypre_SStructBoxManEntryGetGlobalRank(boxman_entry, index, &rank, matrix_type); - Uventry= hypre_SStructGraphUVEntry(graph, rank-startrank); - nUentries= hypre_SStructUVEntryNUEntries(Uventry); + Uventry = hypre_SStructGraphUVEntry(graph, rank - startrank); + nUentries = hypre_SStructUVEntryNUEntries(Uventry); - for (l= 0; l< nUentries; l++) + for (l = 0; l < nUentries; l++) { if (hypre_SStructUVEntryToPart(Uventry, l) == part_crse) { to_rank = hypre_SStructUVEntryToRank(Uventry, l); rows[k] = rank; - cols[k++]= to_rank; + cols[k++] = to_rank; /*--------------------------------------------------------- * compute stencil shape for this Uentry. *---------------------------------------------------------*/ - hypre_CopyIndex( hypre_SStructUVEntryToIndex(Uventry,l), + hypre_CopyIndex( hypre_SStructUVEntryToIndex(Uventry, l), index ); hypre_AddIndexes(index, index1, 3, index2); MapStencilRank(index2, m); - interface_max_stencil_ranks[i][n++]= m; + interface_max_stencil_ranks[i][n++] = m; interface_max_stencil_cnt[i][m]++; } } @@ -2819,8 +2903,8 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, /*----------------------------------------------------------------- * Determine only the distinct stencil ranks for coarse node i. *-----------------------------------------------------------------*/ - l= 0; - for (j= 0; j< max_stencil_size; j++) + l = 0; + for (j = 0; j < max_stencil_size; j++) { if (interface_max_stencil_cnt[i][j]) { @@ -2828,20 +2912,20 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, } } - coarse_stencil_cnt[i]= l; - interface_stencil_ranks[i]= hypre_TAlloc(HYPRE_Int, l, HYPRE_MEMORY_HOST); - interface_rank_stencils[i]= hypre_TAlloc(HYPRE_Int, max_stencil_size, HYPRE_MEMORY_HOST); + coarse_stencil_cnt[i] = l; + interface_stencil_ranks[i] = hypre_TAlloc(HYPRE_Int, l, HYPRE_MEMORY_HOST); + interface_rank_stencils[i] = hypre_TAlloc(HYPRE_Int, max_stencil_size, HYPRE_MEMORY_HOST); /*----------------------------------------------------------------- * For each stencil rank, assign one of the stencil_shape_i index. *-----------------------------------------------------------------*/ - l= 0; - for (j= 0; j< max_stencil_size; j++) + l = 0; + for (j = 0; j < max_stencil_size; j++) { if (interface_max_stencil_cnt[i][j]) { - interface_rank_stencils[i][j]= l; - interface_stencil_ranks[i][l]= j; + interface_rank_stencils[i][j] = l; + interface_stencil_ranks[i][l] = j; l++; } } @@ -2877,19 +2961,19 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, * corresponding to the common * stencil_shape. *-----------------------------------------------------------------*/ - k= 0; - for (i= 0; i< cnt1; i++) + k = 0; + for (i = 0; i < cnt1; i++) { - stencil_vals= hypre_CTAlloc(HYPRE_Real, coarse_stencil_cnt[i], HYPRE_MEMORY_HOST); + stencil_vals = hypre_CTAlloc(HYPRE_Real, coarse_stencil_cnt[i], HYPRE_MEMORY_HOST); /*----------------------------------------------------------------- * Compute the arithmetic stencil averages for coarse node i. *-----------------------------------------------------------------*/ - for (j= 0; j< box_to_ranks_cnt[i]; j++) + for (j = 0; j < box_to_ranks_cnt[i]; j++) { - m= interface_max_stencil_ranks[i][j]; - l= interface_rank_stencils[i][m]; - stencil_vals[l]+= vals[k]/interface_max_stencil_cnt[i][m]; + m = interface_max_stencil_ranks[i][j]; + l = interface_rank_stencils[i][m]; + stencil_vals[l] += vals[k] / interface_max_stencil_cnt[i][m]; k++; } hypre_TFree(interface_max_stencil_ranks[i], HYPRE_MEMORY_HOST); @@ -2905,39 +2989,39 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, * accordingly. *-----------------------------------------------------------------*/ - sort= falseV; - for (j= 0; j< (coarse_stencil_cnt[i]-1); j++) + sort = falseV; + for (j = 0; j < (coarse_stencil_cnt[i] - 1); j++) { - if (interface_stencil_ranks[i][j] > interface_stencil_ranks[i][j+1]) + if (interface_stencil_ranks[i][j] > interface_stencil_ranks[i][j + 1]) { - sort= trueV; + sort = trueV; break; } } - if ( (coarse_stencil_cnt[i]>1) && (sort==trueV) ) + if ( (coarse_stencil_cnt[i] > 1) && (sort == trueV) ) { - temp1= hypre_TAlloc(HYPRE_Int, coarse_stencil_cnt[i], HYPRE_MEMORY_HOST); - for (j= 0; j< coarse_stencil_cnt[i]; j++) + temp1 = hypre_TAlloc(HYPRE_Int, coarse_stencil_cnt[i], HYPRE_MEMORY_HOST); + for (j = 0; j < coarse_stencil_cnt[i]; j++) { - temp1[j]= j; + temp1[j] = j; } hypre_qsort1(interface_stencil_ranks[i], (HYPRE_Real *) temp1, 0, - coarse_stencil_cnt[i]-1); + coarse_stencil_cnt[i] - 1); /*--------------------------------------------------------------- * swap the stencil_vals to agree with the rank swapping. *---------------------------------------------------------------*/ temp3 = hypre_TAlloc(HYPRE_Real, coarse_stencil_cnt[i], HYPRE_MEMORY_HOST); - for (j=0; j< coarse_stencil_cnt[i]; j++) + for (j = 0; j < coarse_stencil_cnt[i]; j++) { m = temp1[j]; temp3[j] = stencil_vals[m]; } - for (j=0; j< coarse_stencil_cnt[i]; j++) + for (j = 0; j < coarse_stencil_cnt[i]; j++) { - stencil_vals[j]= temp3[j]; + stencil_vals[j] = temp3[j]; } hypre_TFree(temp1, HYPRE_MEMORY_HOST); @@ -2949,12 +3033,12 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, * We need to convert the ranks back to stencil_shapes and then * find the abs of the stencil shape. *-----------------------------------------------------------------*/ - temp3= hypre_TAlloc(HYPRE_Real, coarse_stencil_cnt[i], HYPRE_MEMORY_HOST); - for (j=0; j< coarse_stencil_cnt[i]; j++) + temp3 = hypre_TAlloc(HYPRE_Real, coarse_stencil_cnt[i], HYPRE_MEMORY_HOST); + for (j = 0; j < coarse_stencil_cnt[i]; j++) { InverseMapStencilRank(interface_stencil_ranks[i][j], index_temp); AbsStencilShape(index_temp, abs_stencil_shape); - temp3[j]= weights[abs_stencil_shape]; + temp3[j] = weights[abs_stencil_shape]; } /*----------------------------------------------------------------- @@ -2963,16 +3047,16 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, * WE ARE ASSUMING THAT THE COARSE INTERFACE STENCIL HAS SOME * COMMON STENCIL SHAPE WITH THE COARSE STENCIL. *-----------------------------------------------------------------*/ - common_rank_stencils= hypre_TAlloc(HYPRE_Int, stencil_size, HYPRE_MEMORY_HOST); - common_stencil_ranks= hypre_TAlloc(HYPRE_Int, stencil_size, HYPRE_MEMORY_HOST); + common_rank_stencils = hypre_TAlloc(HYPRE_Int, stencil_size, HYPRE_MEMORY_HOST); + common_stencil_ranks = hypre_TAlloc(HYPRE_Int, stencil_size, HYPRE_MEMORY_HOST); common_stencil_i = hypre_TAlloc(HYPRE_Int, stencil_size, HYPRE_MEMORY_HOST); - l= 0; - m= 0; - for (j= 0; j< stencil_size; j++) + l = 0; + m = 0; + for (j = 0; j < stencil_size; j++) { - while( (l < coarse_stencil_cnt[i]) - && (stencil_ranks[j] > interface_stencil_ranks[i][l]) ) + while ( (l < coarse_stencil_cnt[i]) + && (stencil_ranks[j] > interface_stencil_ranks[i][l]) ) { l++; } @@ -2987,8 +3071,8 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, if ( (stencil_ranks[j] == interface_stencil_ranks[i][l]) && (l < coarse_stencil_cnt[i]) ) { - common_rank_stencils[m]= rank_stencils[ stencil_ranks[j] ]; - common_stencil_ranks[m]= stencil_ranks[j]; + common_rank_stencils[m] = rank_stencils[ stencil_ranks[j] ]; + common_stencil_ranks[m] = stencil_ranks[j]; common_stencil_i[m++] = l; l++; } @@ -2996,16 +3080,16 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, /*----------------------------------------------------------------- * Find the contribution and weights for the averaged stencils. *-----------------------------------------------------------------*/ - for (j= 0; j< m; j++) + for (j = 0; j < m; j++) { hypre_CopyIndex(hypre_StructStencilElement( stencils, common_rank_stencils[j]), stencil_shape_i); AbsStencilShape(stencil_shape_i, abs_stencil_shape); - crse_ptr= hypre_StructMatrixExtractPointerByIndex(crse_smatrix, - parents_cnodes[i], - stencil_shape_i); + crse_ptr = hypre_StructMatrixExtractPointerByIndex(crse_smatrix, + parents_cnodes[i], + stencil_shape_i); /*----------------------------------------------------------------- * For a compact stencil (e.g., -1 <= hypre_Index[i] <= 1, i= 0-2), @@ -3022,22 +3106,22 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, * 0 c in 1-d, 2-d, or 3-d. *-----------------------------------------------------------------*/ - switch(abs_stencil_shape) + switch (abs_stencil_shape) { case 3: /* corners of 3-d stencil */ - l= common_stencil_i[j]; - crse_ptr[fine_interface_ranks[i]]= stencil_vals[l]; + l = common_stencil_i[j]; + crse_ptr[fine_interface_ranks[i]] = stencil_vals[l]; break; case 2: /* corners in 2-d or edges in 3-d */ - if (ndim ==2) + if (ndim == 2) { - l= common_stencil_i[j]; - crse_ptr[fine_interface_ranks[i]]= stencil_vals[l]; + l = common_stencil_i[j]; + crse_ptr[fine_interface_ranks[i]] = stencil_vals[l]; } else if (ndim == 3) @@ -3052,80 +3136,80 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, * 17 15 16 8 6 7 26 24 25 *----------------------------------------------------------*/ l = common_stencil_ranks[j]; - temp1= hypre_TAlloc(HYPRE_Int, 2, HYPRE_MEMORY_HOST); + temp1 = hypre_TAlloc(HYPRE_Int, 2, HYPRE_MEMORY_HOST); - switch(l) + switch (l) { case 4: /* centre plane ne */ - temp1[0]= 13; - temp1[1]= 22; + temp1[0] = 13; + temp1[1] = 22; break; case 5: /* centre plane nw */ - temp1[0]= 14; - temp1[1]= 23; + temp1[0] = 14; + temp1[1] = 23; break; case 7: /* centre plane se */ - temp1[0]= 16; - temp1[1]= 25; + temp1[0] = 16; + temp1[1] = 25; break; case 8: /* centre plane sw */ - temp1[0]= 17; - temp1[1]= 26; + temp1[0] = 17; + temp1[1] = 26; break; case 10: /* top plane e */ - temp1[0]= 13; - temp1[1]= 16; + temp1[0] = 13; + temp1[1] = 16; break; case 11: /* top plane w */ - temp1[0]= 14; - temp1[1]= 17; + temp1[0] = 14; + temp1[1] = 17; break; case 12: /* top plane n */ - temp1[0]= 13; - temp1[1]= 14; + temp1[0] = 13; + temp1[1] = 14; break; case 15: /* top plane s */ - temp1[0]= 16; - temp1[1]= 17; + temp1[0] = 16; + temp1[1] = 17; break; case 19: /* bottom plane e */ - temp1[0]= 22; - temp1[1]= 25; + temp1[0] = 22; + temp1[1] = 25; break; case 20: /* bottom plane w */ - temp1[0]= 23; - temp1[1]= 26; + temp1[0] = 23; + temp1[1] = 26; break; case 21: /* bottom plane n */ - temp1[0]= 22; - temp1[1]= 23; + temp1[0] = 22; + temp1[1] = 23; break; case 24: /* bottom plane s */ - temp1[0]= 25; - temp1[1]= 26; + temp1[0] = 25; + temp1[1] = 26; break; } @@ -3136,15 +3220,15 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, * interface_stencil_ranks. The weights must be averaged. *-------------------------------------------------------*/ - l= common_stencil_i[j]; - sum= temp3[l]; - sum_contrib= sum*stencil_vals[l]; + l = common_stencil_i[j]; + sum = temp3[l]; + sum_contrib = sum * stencil_vals[l]; - n= 1; - for (l= 0; l< 2; l++) + n = 1; + for (l = 0; l < 2; l++) { while ( (n < coarse_stencil_cnt[i]) - &&(interface_stencil_ranks[i][n] < temp1[l]) ) + && (interface_stencil_ranks[i][n] < temp1[l]) ) { n++; } @@ -3156,15 +3240,15 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, if (interface_stencil_ranks[i][n] == temp1[l]) { - sum+= temp3[n]; - sum_contrib+= temp3[n]*stencil_vals[n]; + sum += temp3[n]; + sum_contrib += temp3[n] * stencil_vals[n]; n++; } } - sum_contrib/= sum; /* average out the weights */ - l= common_stencil_i[j]; - crse_ptr[fine_interface_ranks[i]]= sum_contrib; + sum_contrib /= sum; /* average out the weights */ + l = common_stencil_i[j]; + crse_ptr[fine_interface_ranks[i]] = sum_contrib; hypre_TFree(temp1, HYPRE_MEMORY_HOST); @@ -3176,39 +3260,39 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, if (ndim == 1) { - l= common_stencil_i[j]; - crse_ptr[fine_interface_ranks[i]]= stencil_vals[l]; + l = common_stencil_i[j]; + crse_ptr[fine_interface_ranks[i]] = stencil_vals[l]; } else if (ndim == 2) { l = common_stencil_ranks[j]; - temp1= hypre_TAlloc(HYPRE_Int, 2, HYPRE_MEMORY_HOST); + temp1 = hypre_TAlloc(HYPRE_Int, 2, HYPRE_MEMORY_HOST); - switch(l) + switch (l) { case 1: /* e */ - temp1[0]= 4; - temp1[1]= 7; + temp1[0] = 4; + temp1[1] = 7; break; case 2: /* w */ - temp1[0]= 5; - temp1[1]= 8; + temp1[0] = 5; + temp1[1] = 8; break; case 3: /* n */ - temp1[0]= 4; - temp1[1]= 5; + temp1[0] = 4; + temp1[1] = 5; break; case 6: /* s */ - temp1[0]= 7; - temp1[1]= 8; + temp1[0] = 7; + temp1[1] = 8; break; } @@ -3217,15 +3301,15 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, * stencils. *-------------------------------------------------------*/ - l= common_stencil_i[j]; - sum= temp3[l]; - sum_contrib= sum*stencil_vals[l]; + l = common_stencil_i[j]; + sum = temp3[l]; + sum_contrib = sum * stencil_vals[l]; - n= 1; - for (l= 0; l< 2; l++) + n = 1; + for (l = 0; l < 2; l++) { while ( (n < coarse_stencil_cnt[i]) - &&(interface_stencil_ranks[i][n] < temp1[l]) ) + && (interface_stencil_ranks[i][n] < temp1[l]) ) { n++; } @@ -3237,15 +3321,15 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, if (interface_stencil_ranks[i][n] == temp1[l]) { - sum+= temp3[n]; - sum_contrib+= temp3[n]*stencil_vals[n]; + sum += temp3[n]; + sum_contrib += temp3[n] * stencil_vals[n]; n++; } } - sum_contrib/= sum; /* average out the weights */ - l= common_stencil_i[j]; - crse_ptr[fine_interface_ranks[i]]= sum_contrib; + sum_contrib /= sum; /* average out the weights */ + l = common_stencil_i[j]; + crse_ptr[fine_interface_ranks[i]] = sum_contrib; hypre_TFree(temp1, HYPRE_MEMORY_HOST); @@ -3254,71 +3338,71 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, else /* 3-d */ { l = common_stencil_ranks[j]; - temp1= hypre_TAlloc(HYPRE_Int, 8, HYPRE_MEMORY_HOST); + temp1 = hypre_TAlloc(HYPRE_Int, 8, HYPRE_MEMORY_HOST); - switch(l) + switch (l) { case 1: /* centre plane e */ - temp1[0]= 4; - temp1[1]= 7; - temp1[2]= 10; - temp1[3]= 13; - temp1[4]= 16; - temp1[5]= 19; - temp1[6]= 22; - temp1[7]= 25; + temp1[0] = 4; + temp1[1] = 7; + temp1[2] = 10; + temp1[3] = 13; + temp1[4] = 16; + temp1[5] = 19; + temp1[6] = 22; + temp1[7] = 25; break; case 2: /* centre plane w */ - temp1[0]= 5; - temp1[1]= 8; - temp1[2]= 11; - temp1[3]= 14; - temp1[4]= 17; - temp1[5]= 20; - temp1[6]= 23; - temp1[7]= 26; + temp1[0] = 5; + temp1[1] = 8; + temp1[2] = 11; + temp1[3] = 14; + temp1[4] = 17; + temp1[5] = 20; + temp1[6] = 23; + temp1[7] = 26; break; case 3: /* centre plane n */ - temp1[0]= 4; - temp1[1]= 5; - temp1[2]= 12; - temp1[3]= 13; - temp1[4]= 14; - temp1[5]= 21; - temp1[6]= 22; - temp1[7]= 23; + temp1[0] = 4; + temp1[1] = 5; + temp1[2] = 12; + temp1[3] = 13; + temp1[4] = 14; + temp1[5] = 21; + temp1[6] = 22; + temp1[7] = 23; break; case 6: /* centre plane s */ - temp1[0]= 7; - temp1[1]= 8; - temp1[2]= 15; - temp1[3]= 16; - temp1[4]= 17; - temp1[5]= 24; - temp1[6]= 25; - temp1[7]= 26; + temp1[0] = 7; + temp1[1] = 8; + temp1[2] = 15; + temp1[3] = 16; + temp1[4] = 17; + temp1[5] = 24; + temp1[6] = 25; + temp1[7] = 26; break; case 9: /* top plane c */ - for (n= 0; n< 8; n++) + for (n = 0; n < 8; n++) { - temp1[n]= 10+n; + temp1[n] = 10 + n; } break; case 18: /* bottom plane c */ - for (n= 0; n< 8; n++) + for (n = 0; n < 8; n++) { - temp1[n]= 19+n; + temp1[n] = 19 + n; } break; @@ -3329,12 +3413,12 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, * stencils. *-------------------------------------------------------*/ - l= common_stencil_i[j]; - sum= temp3[l]; - sum_contrib= sum*stencil_vals[l]; + l = common_stencil_i[j]; + sum = temp3[l]; + sum_contrib = sum * stencil_vals[l]; - n= 1; - for (l= 0; l< 8; l++) + n = 1; + for (l = 0; l < 8; l++) { while ( (n < coarse_stencil_cnt[i]) && (interface_stencil_ranks[i][n] < temp1[l]) ) @@ -3349,15 +3433,15 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, if (interface_stencil_ranks[i][n] == temp1[l]) { - sum+= temp3[n]; - sum_contrib+= temp3[n]*stencil_vals[n]; + sum += temp3[n]; + sum_contrib += temp3[n] * stencil_vals[n]; n++; } } - sum_contrib/= sum; /* average out the weights */ - l= common_stencil_i[j]; - crse_ptr[fine_interface_ranks[i]]= sum_contrib; + sum_contrib /= sum; /* average out the weights */ + l = common_stencil_i[j]; + crse_ptr[fine_interface_ranks[i]] = sum_contrib; hypre_TFree(temp1, HYPRE_MEMORY_HOST); @@ -3398,10 +3482,12 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, hypre_TFree(rank_stencils, HYPRE_MEMORY_HOST); hypre_TFree(cdata_space_ranks, HYPRE_MEMORY_HOST); hypre_TFree(box_graph_cnts, HYPRE_MEMORY_HOST); - for (i= 0; i< box_array_size; i++) + for (i = 0; i < box_array_size; i++) { if (box_graph_indices[i]) + { hypre_TFree(box_graph_indices[i], HYPRE_MEMORY_HOST); + } } hypre_TFree(box_graph_indices, HYPRE_MEMORY_HOST); @@ -3418,7 +3504,7 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, * the coarsened fbox_bdy's and set the centre stencils. *--------------------------------------------------------------------------*/ hypre_ClearIndex(index_temp); - for (var1= 0; var1< nvars; var1++) + for (var1 = 0; var1 < nvars; var1++) { /* only like variables couple. */ smatrix_var = hypre_SStructPMatrixSMatrix(A_crse, var1, var1); @@ -3426,31 +3512,31 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, stencil_size = hypre_StructStencilSize(stencils); a_ptrs = hypre_TAlloc(HYPRE_Real *, stencil_size, HYPRE_MEMORY_HOST); - rank_stencils= hypre_TAlloc(HYPRE_Int, max_stencil_size, HYPRE_MEMORY_HOST); - for (i= 0; i< stencil_size; i++) + rank_stencils = hypre_TAlloc(HYPRE_Int, max_stencil_size, HYPRE_MEMORY_HOST); + for (i = 0; i < stencil_size; i++) { hypre_CopyIndex(hypre_StructStencilElement(stencils, i), stencil_shape_i); MapStencilRank(stencil_shape_i, rank); - rank_stencils[rank]= i; + rank_stencils[rank] = i; } - centre= rank_stencils[0]; + centre = rank_stencils[0]; - cgrid= hypre_SStructPGridSGrid(hypre_SStructPMatrixPGrid(A_crse), var1); - cgrid_boxes= hypre_StructGridBoxes(cgrid); + cgrid = hypre_SStructPGridSGrid(hypre_SStructPMatrixPGrid(A_crse), var1); + cgrid_boxes = hypre_StructGridBoxes(cgrid); hypre_ForBoxI(ci, cgrid_boxes) { A_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(smatrix_var), ci); - fbox_bdy_ci= fbox_bdy[var1][ci]; + fbox_bdy_ci = fbox_bdy[var1][ci]; - for (i= 0; i< stencil_size; i++) + for (i = 0; i < stencil_size; i++) { hypre_CopyIndex(hypre_StructStencilElement(stencils, i), stencil_shape_i); - a_ptrs[i]= hypre_StructMatrixExtractPointerByIndex(smatrix_var, - ci, - stencil_shape_i); + a_ptrs[i] = hypre_StructMatrixExtractPointerByIndex(smatrix_var, + ci, + stencil_shape_i); } /*------------------------------------------------------------------ @@ -3459,10 +3545,10 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, *------------------------------------------------------------------*/ hypre_ForBoxArrayI(arrayi, fbox_bdy_ci) { - fbox_bdy_ci_fi= hypre_BoxArrayArrayBoxArray(fbox_bdy_ci, arrayi); + fbox_bdy_ci_fi = hypre_BoxArrayArrayBoxArray(fbox_bdy_ci, arrayi); hypre_ForBoxI(fi, fbox_bdy_ci_fi) { - fgrid_box= hypre_BoxArrayBox(fbox_bdy_ci_fi, fi); + fgrid_box = hypre_BoxArrayBox(fbox_bdy_ci_fi, fi); hypre_StructMapFineToCoarse(hypre_BoxIMin(fgrid_box), index_temp, stridef, hypre_BoxIMin(&fine_box)); hypre_StructMapFineToCoarse(hypre_BoxIMax(fgrid_box), index_temp, @@ -3476,11 +3562,11 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, A_dbox, cstart, stridec, iA); { HYPRE_Int i; - for (i= 0; i< stencil_size; i++) + for (i = 0; i < stencil_size; i++) { if (i != centre) { - a_ptrs[centre][iA]-= a_ptrs[i][iA]; + a_ptrs[centre][iA] -= a_ptrs[i][iA]; } } } @@ -3496,13 +3582,13 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, } /* for (var1= 0; var1< nvars; var1++) */ - for (var1= 0; var1< nvars; var1++) + for (var1 = 0; var1 < nvars; var1++) { - cgrid= hypre_SStructPGridSGrid(hypre_SStructPMatrixPGrid(A_crse), var1); - cgrid_boxes= hypre_StructGridBoxes(cgrid); + cgrid = hypre_SStructPGridSGrid(hypre_SStructPMatrixPGrid(A_crse), var1); + cgrid_boxes = hypre_StructGridBoxes(cgrid); - fgrid= hypre_SStructPGridSGrid(hypre_SStructPMatrixPGrid(A_pmatrix), var1); - fgrid_boxes= hypre_StructGridBoxes(fgrid); + fgrid = hypre_SStructPGridSGrid(hypre_SStructPMatrixPGrid(A_pmatrix), var1); + fgrid_boxes = hypre_StructGridBoxes(fgrid); hypre_ForBoxI(ci, cgrid_boxes) { @@ -3535,4 +3621,3 @@ hypre_AMR_FCoarsen( hypre_SStructMatrix * A, return 0; } - diff --git a/external/hypre/src/sstruct_ls/fac_amr_rap.c b/external/hypre/src/sstruct_ls/fac_amr_rap.c index ca87b623..e4e273fd 100644 --- a/external/hypre/src/sstruct_ls/fac_amr_rap.c +++ b/external/hypre/src/sstruct_ls/fac_amr_rap.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -85,7 +85,7 @@ hypre_AMR_RAP( hypre_SStructMatrix *A, HYPRE_Int i, j, k, size; HYPRE_Int myid; - HYPRE_Int ierr= 0; + HYPRE_Int ierr = 0; hypre_MPI_Comm_rank(comm, &myid); hypre_ClearIndex(zero_index); @@ -93,7 +93,7 @@ hypre_AMR_RAP( hypre_SStructMatrix *A, hypre_BoxInit(&scaled_box, ndim); hypre_SStructGraphRef(graph, &fac_graph); - fac_grid= hypre_SStructGraphGrid(fac_graph); + fac_grid = hypre_SStructGraphGrid(fac_graph); HYPRE_SStructMatrixCreate(comm, fac_graph, &fac_A); HYPRE_SStructMatrixInitialize(fac_A); @@ -103,37 +103,37 @@ hypre_AMR_RAP( hypre_SStructMatrix *A, * are also the same. Thus, the rows, cols, etc. for the IJ_matrix are * the same. *--------------------------------------------------------------------------*/ - ncols= hypre_CTAlloc(HYPRE_Int, nUventries, HYPRE_MEMORY_HOST); + ncols = hypre_CTAlloc(HYPRE_Int, nUventries, HYPRE_MEMORY_HOST); rows = hypre_CTAlloc(HYPRE_BigInt, nUventries, HYPRE_MEMORY_HOST); - tot_cols= 0; - for (i= 0; i< nUventries; i++) + tot_cols = 0; + for (i = 0; i < nUventries; i++) { - Uventry= Uventries[iUventries[i]]; - tot_cols+= hypre_SStructUVEntryNUEntries(Uventry); + Uventry = Uventries[iUventries[i]]; + tot_cols += hypre_SStructUVEntryNUEntries(Uventry); } cols = hypre_CTAlloc(HYPRE_BigInt, tot_cols, HYPRE_MEMORY_HOST); k = 0; - for (i= 0; i< nUventries; i++) + for (i = 0; i < nUventries; i++) { - Uventry= Uventries[iUventries[i]]; + Uventry = Uventries[iUventries[i]]; part = hypre_SStructUVEntryPart(Uventry); hypre_CopyIndex(hypre_SStructUVEntryIndex(Uventry), index); var1 = hypre_SStructUVEntryVar(Uventry); - nUentries= hypre_SStructUVEntryNUEntries(Uventry); + nUentries = hypre_SStructUVEntryNUEntries(Uventry); - ncols[i]= nUentries; + ncols[i] = nUentries; hypre_SStructGridFindBoxManEntry(grid, part, index, var1, &boxman_entry); hypre_SStructBoxManEntryGetGlobalRank(boxman_entry, index, &rows[i], matrix_type); - for (j= 0; j< nUentries; j++) + for (j = 0; j < nUentries; j++) { - cols[k++]= hypre_SStructUVEntryToRank(Uventry, j); + cols[k++] = hypre_SStructUVEntryToRank(Uventry, j); } } - values= hypre_CTAlloc(HYPRE_Real, tot_cols, HYPRE_MEMORY_HOST); + values = hypre_CTAlloc(HYPRE_Real, tot_cols, HYPRE_MEMORY_HOST); HYPRE_IJMatrixGetValues(ij_A, nUventries, ncols, rows, cols, values); HYPRE_IJMatrixSetValues(hypre_SStructMatrixIJMatrix(fac_A), nUventries, @@ -145,79 +145,79 @@ hypre_AMR_RAP( hypre_SStructMatrix *A, hypre_TFree(values, HYPRE_MEMORY_HOST); owninfo = hypre_CTAlloc(hypre_SStructOwnInfoData **, nparts, HYPRE_MEMORY_HOST); - for (part= (nparts-1); part> 0; part--) + for (part = (nparts - 1); part > 0; part--) { - f_pgrid= hypre_SStructGridPGrid(fac_grid, part); - c_pgrid= hypre_SStructGridPGrid(fac_grid, part-1); + f_pgrid = hypre_SStructGridPGrid(fac_grid, part); + c_pgrid = hypre_SStructGridPGrid(fac_grid, part - 1); nvars = hypre_SStructPGridNVars(f_pgrid); owninfo[part] = hypre_CTAlloc(hypre_SStructOwnInfoData *, nvars, HYPRE_MEMORY_HOST); - for (var1= 0; var1< nvars; var1++) + for (var1 = 0; var1 < nvars; var1++) { - fboxman= hypre_SStructGridBoxManager(fac_grid, part, var1); - cboxman= hypre_SStructGridBoxManager(fac_grid, part-1, var1); + fboxman = hypre_SStructGridBoxManager(fac_grid, part, var1); + cboxman = hypre_SStructGridBoxManager(fac_grid, part - 1, var1); - fgrid= hypre_SStructPGridSGrid(f_pgrid, var1); - cgrid= hypre_SStructPGridSGrid(c_pgrid, var1); + fgrid = hypre_SStructPGridSGrid(f_pgrid, var1); + cgrid = hypre_SStructPGridSGrid(c_pgrid, var1); - owninfo[part][var1]= hypre_SStructOwnInfo(fgrid, cgrid, cboxman, fboxman, - rfactors[part]); + owninfo[part][var1] = hypre_SStructOwnInfo(fgrid, cgrid, cboxman, fboxman, + rfactors[part]); } } hypre_SetIndex3(stride, 1, 1, 1); - for (part= (nparts-1); part> 0; part--) + for (part = (nparts - 1); part > 0; part--) { - f_pgrid= hypre_SStructGridPGrid(fac_grid, part); - c_pgrid= hypre_SStructGridPGrid(fac_grid, part-1); + f_pgrid = hypre_SStructGridPGrid(fac_grid, part); + c_pgrid = hypre_SStructGridPGrid(fac_grid, part - 1); nvars = hypre_SStructPGridNVars(f_pgrid); - for (var1= 0; var1< nvars; var1++) + for (var1 = 0; var1 < nvars; var1++) { fgrid = hypre_SStructPGridSGrid(f_pgrid, var1); cgrid = hypre_SStructPGridSGrid(c_pgrid, var1); - grid_boxes= hypre_StructGridBoxes(fgrid); + grid_boxes = hypre_StructGridBoxes(fgrid); - stencils= hypre_SStructGraphStencil(graph, part, var1); - stencil_size= hypre_SStructStencilSize(stencils); - stencil_vars= hypre_SStructStencilVars(stencils); + stencils = hypre_SStructGraphStencil(graph, part, var1); + stencil_size = hypre_SStructStencilSize(stencils); + stencil_vars = hypre_SStructStencilVars(stencils); - if (part == (nparts-1)) /* copy all fine data */ + if (part == (nparts - 1)) /* copy all fine data */ { pmatrix = hypre_SStructMatrixPMatrix(A, part); - fac_pmatrix= hypre_SStructMatrixPMatrix(fac_A, part); + fac_pmatrix = hypre_SStructMatrixPMatrix(fac_A, part); hypre_ForBoxI(i, grid_boxes) { - grid_box= hypre_BoxArrayBox(grid_boxes, i); + grid_box = hypre_BoxArrayBox(grid_boxes, i); hypre_BoxGetSize(grid_box, loop_size); hypre_CopyIndex(hypre_BoxIMin(grid_box), ilower); - for (j = 0; j< stencil_size; j++) + for (j = 0; j < stencil_size; j++) { var2 = stencil_vars[j]; smatrix = hypre_SStructPMatrixSMatrix(pmatrix, var1, var2); - fac_smatrix= hypre_SStructPMatrixSMatrix(fac_pmatrix, var1, var2); + fac_smatrix = hypre_SStructPMatrixSMatrix(fac_pmatrix, var1, var2); - smatrix_dbox= hypre_BoxArrayBox(hypre_StructMatrixDataSpace(smatrix), - i); - fac_smatrix_dbox= + smatrix_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(smatrix), + i); + fac_smatrix_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(fac_smatrix), i); hypre_CopyIndex(hypre_SStructStencilEntry(stencils, j), stencil_shape); - smatrix_vals= hypre_StructMatrixExtractPointerByIndex(smatrix, - i, - stencil_shape); - fac_smatrix_vals= hypre_StructMatrixExtractPointerByIndex(fac_smatrix, - i, - stencil_shape); + smatrix_vals = hypre_StructMatrixExtractPointerByIndex(smatrix, + i, + stencil_shape); + fac_smatrix_vals = hypre_StructMatrixExtractPointerByIndex(fac_smatrix, + i, + stencil_shape); #define DEVICE_VAR is_device_ptr(fac_smatrix_vals,smatrix_vals) hypre_BoxLoop2Begin(ndim, loop_size, smatrix_dbox, ilower, stride, iA, fac_smatrix_dbox, ilower, stride, iAc); { - fac_smatrix_vals[iAc]= smatrix_vals[iA]; + fac_smatrix_vals[iAc] = smatrix_vals[iA]; } hypre_BoxLoop2End(iA, iAc); #undef DEVICE_VAR @@ -230,49 +230,49 @@ hypre_AMR_RAP( hypre_SStructMatrix *A, * Copy all coarse data not underlying a fbox and on this processor- * i.e., the own_composite_cbox data. *----------------------------------------------------------------------*/ - pmatrix = hypre_SStructMatrixPMatrix(A, part-1); - fac_pmatrix= hypre_SStructMatrixPMatrix(fac_A, part-1); + pmatrix = hypre_SStructMatrixPMatrix(A, part - 1); + fac_pmatrix = hypre_SStructMatrixPMatrix(fac_A, part - 1); - own_composite_cboxes= hypre_SStructOwnInfoDataCompositeCBoxes(owninfo[part][var1]); + own_composite_cboxes = hypre_SStructOwnInfoDataCompositeCBoxes(owninfo[part][var1]); - stencils= hypre_SStructGraphStencil(graph, part-1, var1); - stencil_size= hypre_SStructStencilSize(stencils); - stencil_vars= hypre_SStructStencilVars(stencils); + stencils = hypre_SStructGraphStencil(graph, part - 1, var1); + stencil_size = hypre_SStructStencilSize(stencils); + stencil_vars = hypre_SStructStencilVars(stencils); hypre_ForBoxArrayI(i, own_composite_cboxes) { - own_composite_cbox= hypre_BoxArrayArrayBoxArray(own_composite_cboxes, i); + own_composite_cbox = hypre_BoxArrayArrayBoxArray(own_composite_cboxes, i); hypre_ForBoxI(j, own_composite_cbox) { - grid_box= hypre_BoxArrayBox(own_composite_cbox, j); + grid_box = hypre_BoxArrayBox(own_composite_cbox, j); hypre_BoxGetSize(grid_box, loop_size); hypre_CopyIndex(hypre_BoxIMin(grid_box), ilower); - for (k = 0; k< stencil_size; k++) + for (k = 0; k < stencil_size; k++) { var2 = stencil_vars[k]; smatrix = hypre_SStructPMatrixSMatrix(pmatrix, var1, var2); - fac_smatrix= hypre_SStructPMatrixSMatrix(fac_pmatrix, var1, var2); + fac_smatrix = hypre_SStructPMatrixSMatrix(fac_pmatrix, var1, var2); - smatrix_dbox= hypre_BoxArrayBox(hypre_StructMatrixDataSpace(smatrix), - i); - fac_smatrix_dbox= + smatrix_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(smatrix), + i); + fac_smatrix_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(fac_smatrix), i); hypre_CopyIndex(hypre_SStructStencilEntry(stencils, k), stencil_shape); - smatrix_vals= hypre_StructMatrixExtractPointerByIndex(smatrix, - i, - stencil_shape); - fac_smatrix_vals= hypre_StructMatrixExtractPointerByIndex(fac_smatrix, - i, - stencil_shape); + smatrix_vals = hypre_StructMatrixExtractPointerByIndex(smatrix, + i, + stencil_shape); + fac_smatrix_vals = hypre_StructMatrixExtractPointerByIndex(fac_smatrix, + i, + stencil_shape); #define DEVICE_VAR is_device_ptr(fac_smatrix_vals,smatrix_vals) hypre_BoxLoop2Begin(ndim, loop_size, smatrix_dbox, ilower, stride, iA, fac_smatrix_dbox, ilower, stride, iAc); { - fac_smatrix_vals[iAc]= smatrix_vals[iA]; + fac_smatrix_vals[iAc] = smatrix_vals[iA]; } hypre_BoxLoop2End(iA, iAc); #undef DEVICE_VAR @@ -300,7 +300,7 @@ hypre_AMR_RAP( hypre_SStructMatrix *A, * communicate any that belongs to another processor. * } *--------------------------------------------------------------------------*/ - for (part= (nparts-1); part>= 1; part--) + for (part = (nparts - 1); part >= 1; part--) { hypre_AMR_CFCoarsen(A, fac_A, rfactors[part], part); @@ -308,17 +308,17 @@ hypre_AMR_RAP( hypre_SStructMatrix *A, * Create the temp SStruct_PMatrix for coarsening away the level= part * boxes. *-----------------------------------------------------------------------*/ - f_pgrid= hypre_SStructGridPGrid(fac_grid, part); - c_pgrid= hypre_SStructGridPGrid(fac_grid, part-1); - grid_boxes= hypre_SStructPGridCellIBoxArray(f_pgrid); + f_pgrid = hypre_SStructGridPGrid(fac_grid, part); + c_pgrid = hypre_SStructGridPGrid(fac_grid, part - 1); + grid_boxes = hypre_SStructPGridCellIBoxArray(f_pgrid); hypre_SStructPGridCreate(hypre_SStructGridComm(f_pgrid), ndim, &temp_pgrid); /*coarsen the fboxes.*/ - for (i= 0; i< hypre_BoxArraySize(grid_boxes); i++) + for (i = 0; i < hypre_BoxArraySize(grid_boxes); i++) { - grid_box= hypre_BoxArrayBox(grid_boxes, i); + grid_box = hypre_BoxArrayBox(grid_boxes, i); hypre_StructMapFineToCoarse(hypre_BoxIMin(grid_box), zero_index, rfactors[part], hypre_BoxIMin(&scaled_box)); hypre_StructMapFineToCoarse(hypre_BoxIMax(grid_box), zero_index, @@ -335,9 +335,9 @@ hypre_AMR_RAP( hypre_SStructMatrix *A, hypre_SStructPGridAssemble(temp_pgrid); /* reference the sstruct_stencil of fac_pmatrix- to be used in temp_pmatrix */ - temp_sstencils= hypre_CTAlloc(hypre_SStructStencil *, nvars, HYPRE_MEMORY_HOST); - fac_pmatrix= hypre_SStructMatrixPMatrix(fac_A, part-1); - for (i=0; i< nvars; i++) + temp_sstencils = hypre_CTAlloc(hypre_SStructStencil *, nvars, HYPRE_MEMORY_HOST); + fac_pmatrix = hypre_SStructMatrixPMatrix(fac_A, part - 1); + for (i = 0; i < nvars; i++) { hypre_SStructStencilRef(hypre_SStructPMatrixStencil(fac_pmatrix, i), &temp_sstencils[i]); @@ -354,51 +354,51 @@ hypre_AMR_RAP( hypre_SStructMatrix *A, /*----------------------------------------------------------------------- * Extract the own_box data (boxes of coarsen data of this processor). *-----------------------------------------------------------------------*/ - fac_pmatrix= hypre_SStructMatrixPMatrix(fac_A, part-1); - for (var1= 0; var1< nvars; var1++) + fac_pmatrix = hypre_SStructMatrixPMatrix(fac_A, part - 1); + for (var1 = 0; var1 < nvars; var1++) { - stencils= hypre_SStructGraphStencil(graph, part-1, var1); - stencil_size= hypre_SStructStencilSize(stencils); - stencil_vars= hypre_SStructStencilVars(stencils); + stencils = hypre_SStructGraphStencil(graph, part - 1, var1); + stencil_size = hypre_SStructStencilSize(stencils); + stencil_vars = hypre_SStructStencilVars(stencils); - own_boxes= hypre_SStructOwnInfoDataOwnBoxes(owninfo[part][var1]); - own_cboxnums= hypre_SStructOwnInfoDataOwnBoxNums(owninfo[part][var1]); - size= hypre_SStructOwnInfoDataSize(owninfo[part][var1]); + own_boxes = hypre_SStructOwnInfoDataOwnBoxes(owninfo[part][var1]); + own_cboxnums = hypre_SStructOwnInfoDataOwnBoxNums(owninfo[part][var1]); + size = hypre_SStructOwnInfoDataSize(owninfo[part][var1]); /* loop over all the cbox chunks */ - for (i= 0; i< size; i++) + for (i = 0; i < size; i++) { - cgrid_boxes= hypre_BoxArrayArrayBoxArray(own_boxes, i); + cgrid_boxes = hypre_BoxArrayArrayBoxArray(own_boxes, i); hypre_ForBoxI(j, cgrid_boxes) { - grid_box= hypre_BoxArrayBox(cgrid_boxes, j); + grid_box = hypre_BoxArrayBox(cgrid_boxes, j); hypre_BoxGetSize(grid_box, loop_size); hypre_CopyIndex(hypre_BoxIMin(grid_box), ilower); - cbox= own_cboxnums[i][j]; + cbox = own_cboxnums[i][j]; - for (k= 0; k< stencil_size; k++) + for (k = 0; k < stencil_size; k++) { - var2= stencil_vars[k]; - smatrix= hypre_SStructPMatrixSMatrix(temp_pmatrix, var1, var2); - fac_smatrix= hypre_SStructPMatrixSMatrix(fac_pmatrix, var1, var2); + var2 = stencil_vars[k]; + smatrix = hypre_SStructPMatrixSMatrix(temp_pmatrix, var1, var2); + fac_smatrix = hypre_SStructPMatrixSMatrix(fac_pmatrix, var1, var2); /*--------------------------------------------------------------- * note: the cbox number of the temp_grid is the same as the * fbox number, whereas the cbox numbers of the fac_grid is in * own_cboxnums- i.e., numbers i & cbox, respectively. *---------------------------------------------------------------*/ - smatrix_dbox= hypre_BoxArrayBox(hypre_StructMatrixDataSpace(smatrix), - i); - fac_smatrix_dbox= + smatrix_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(smatrix), + i); + fac_smatrix_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(fac_smatrix), cbox); hypre_CopyIndex(hypre_SStructStencilEntry(stencils, k), stencil_shape); - smatrix_vals= + smatrix_vals = hypre_StructMatrixExtractPointerByIndex(smatrix, i, stencil_shape); - fac_smatrix_vals= + fac_smatrix_vals = hypre_StructMatrixExtractPointerByIndex(fac_smatrix, cbox, stencil_shape); @@ -408,7 +408,7 @@ hypre_AMR_RAP( hypre_SStructMatrix *A, smatrix_dbox, ilower, stride, iA, fac_smatrix_dbox, ilower, stride, iAc); { - fac_smatrix_vals[iAc]= smatrix_vals[iA]; + fac_smatrix_vals[iAc] = smatrix_vals[iA]; } hypre_BoxLoop2End(iA, iAc); #undef DEVICE_VAR @@ -427,24 +427,24 @@ hypre_AMR_RAP( hypre_SStructMatrix *A, * needed. Thus, compute the communication info- sendboxes, recvboxes, * etc. *-----------------------------------------------------------------------*/ - for (var1= 0; var1< nvars; var1++) + for (var1 = 0; var1 < nvars; var1++) { - fboxman= hypre_SStructGridBoxManager(fac_grid, part, var1); - cboxman= hypre_SStructGridBoxManager(fac_grid, part-1, var1); + fboxman = hypre_SStructGridBoxManager(fac_grid, part, var1); + cboxman = hypre_SStructGridBoxManager(fac_grid, part - 1, var1); - fgrid= hypre_SStructPGridSGrid(f_pgrid, var1); - cgrid= hypre_SStructPGridSGrid(c_pgrid, var1); + fgrid = hypre_SStructPGridSGrid(f_pgrid, var1); + cgrid = hypre_SStructPGridSGrid(c_pgrid, var1); - sendinfo= hypre_SStructSendInfo(fgrid, cboxman, rfactors[part]); - recvinfo= hypre_SStructRecvInfo(cgrid, fboxman, rfactors[part]); + sendinfo = hypre_SStructSendInfo(fgrid, cboxman, rfactors[part]); + recvinfo = hypre_SStructRecvInfo(cgrid, fboxman, rfactors[part]); /*------------------------------------------------------------------- * need to check this for more than one variable- are the comm. info * for this sgrid okay for cross-variable matrices? *-------------------------------------------------------------------*/ - for (var2= 0; var2< nvars; var2++) + for (var2 = 0; var2 < nvars; var2++) { - fac_smatrix= hypre_SStructPMatrixSMatrix(fac_pmatrix, var1, var2); + fac_smatrix = hypre_SStructPMatrixSMatrix(fac_pmatrix, var1, var2); smatrix = hypre_SStructPMatrixSMatrix(temp_pmatrix, var1, var2); hypre_SStructAMRInterCommunication(sendinfo, diff --git a/external/hypre/src/sstruct_ls/fac_amr_zero_data.c b/external/hypre/src/sstruct_ls/fac_amr_zero_data.c index 216ab909..acf4f928 100644 --- a/external/hypre/src/sstruct_ls/fac_amr_zero_data.c +++ b/external/hypre/src/sstruct_ls/fac_amr_zero_data.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -9,7 +9,7 @@ #include "fac.h" /*-------------------------------------------------------------------------- - * hypre_ZeroAMRVectorData: Zeroes the data over the underlying coarse + * hypre_ZeroAMRVectorData: Zeroes the data over the underlying coarse * indices of the refinement patches. *--------------------------------------------------------------------------*/ @@ -18,7 +18,7 @@ hypre_ZeroAMRVectorData(hypre_SStructVector *b, HYPRE_Int *plevels, hypre_Index *rfactors ) { - hypre_SStructGrid *grid = hypre_SStructVectorGrid(b); + hypre_SStructGrid *grid = hypre_SStructVectorGrid(b); hypre_SStructPGrid *p_cgrid; hypre_StructGrid *cgrid; @@ -32,115 +32,115 @@ hypre_ZeroAMRVectorData(hypre_SStructVector *b, hypre_Box scaled_box; hypre_Box intersect_box; - HYPRE_Int npart= hypre_SStructVectorNParts(b); + HYPRE_Int npart = hypre_SStructVectorNParts(b); HYPRE_Int ndim = hypre_SStructVectorNDim(b); HYPRE_Int *levels; hypre_Index *refine_factors; hypre_Index temp_index, ilower, iupper; - + HYPRE_Int level; HYPRE_Int nvars, var; HYPRE_Int part, ci, rem, i, j, intersect_size; HYPRE_Real *values1; - + HYPRE_Int ierr = 0; hypre_BoxInit(&scaled_box, ndim); hypre_BoxInit(&intersect_box, ndim); levels = hypre_CTAlloc(HYPRE_Int, npart, HYPRE_MEMORY_HOST); - refine_factors= hypre_CTAlloc(hypre_Index, npart, HYPRE_MEMORY_HOST); - for (part= 0; part< npart; part++) + refine_factors = hypre_CTAlloc(hypre_Index, npart, HYPRE_MEMORY_HOST); + for (part = 0; part < npart; part++) { - levels[plevels[part]]= part; - for (i= 0; i< ndim; i++) - { - refine_factors[plevels[part]][i]= rfactors[part][i]; - } - for (i= ndim; i< 3; i++) - { - refine_factors[plevels[part]][i]= 1; - } + levels[plevels[part]] = part; + for (i = 0; i < ndim; i++) + { + refine_factors[plevels[part]][i] = rfactors[part][i]; + } + for (i = ndim; i < 3; i++) + { + refine_factors[plevels[part]][i] = 1; + } } hypre_ClearIndex(temp_index); - for (level= npart-1; level> 0; level--) + for (level = npart - 1; level > 0; level--) { - p_cgrid= hypre_SStructGridPGrid(grid, levels[level-1]); + p_cgrid = hypre_SStructGridPGrid(grid, levels[level - 1]); nvars = hypre_SStructPGridNVars(p_cgrid); - for (var= 0; var< nvars; var++) + for (var = 0; var < nvars; var++) { /*--------------------------------------------------------------------- * For each variable, find the underlying boxes for each fine box. *---------------------------------------------------------------------*/ cgrid = hypre_SStructPGridSGrid(p_cgrid, var); - cgrid_boxes= hypre_StructGridBoxes(cgrid); + cgrid_boxes = hypre_StructGridBoxes(cgrid); fboxman = hypre_SStructGridBoxManager(grid, levels[level], var); hypre_ForBoxI(ci, cgrid_boxes) { - cgrid_box= hypre_BoxArrayBox(cgrid_boxes, ci); - - hypre_ClearIndex(temp_index); - hypre_StructMapCoarseToFine(hypre_BoxIMin(cgrid_box), temp_index, - refine_factors[level], hypre_BoxIMin(&scaled_box)); - for (i= 0; i< ndim; i++) - { - temp_index[i]= refine_factors[level][i]-1; - } - hypre_StructMapCoarseToFine(hypre_BoxIMax(cgrid_box), temp_index, - refine_factors[level], hypre_BoxIMax(&scaled_box)); - hypre_ClearIndex(temp_index); - - hypre_BoxManIntersect(fboxman, hypre_BoxIMin(&scaled_box), - hypre_BoxIMax(&scaled_box), &boxman_entries, - &nboxman_entries); - - for (i= 0; i< nboxman_entries; i++) - { - hypre_BoxManEntryGetExtents(boxman_entries[i], ilower, iupper); - hypre_BoxSetExtents(&intersect_box, ilower, iupper); - hypre_IntersectBoxes(&intersect_box, &scaled_box, &intersect_box); + cgrid_box = hypre_BoxArrayBox(cgrid_boxes, ci); + + hypre_ClearIndex(temp_index); + hypre_StructMapCoarseToFine(hypre_BoxIMin(cgrid_box), temp_index, + refine_factors[level], hypre_BoxIMin(&scaled_box)); + for (i = 0; i < ndim; i++) + { + temp_index[i] = refine_factors[level][i] - 1; + } + hypre_StructMapCoarseToFine(hypre_BoxIMax(cgrid_box), temp_index, + refine_factors[level], hypre_BoxIMax(&scaled_box)); + hypre_ClearIndex(temp_index); + + hypre_BoxManIntersect(fboxman, hypre_BoxIMin(&scaled_box), + hypre_BoxIMax(&scaled_box), &boxman_entries, + &nboxman_entries); + + for (i = 0; i < nboxman_entries; i++) + { + hypre_BoxManEntryGetExtents(boxman_entries[i], ilower, iupper); + hypre_BoxSetExtents(&intersect_box, ilower, iupper); + hypre_IntersectBoxes(&intersect_box, &scaled_box, &intersect_box); /* adjust the box so that it is divisible by refine_factors */ - for (j= 0; j< ndim; j++) - { - rem= hypre_BoxIMin(&intersect_box)[j]%refine_factors[level][j]; - if (rem) - { - hypre_BoxIMin(&intersect_box)[j]+=refine_factors[level][j] - rem; - } - } - - hypre_StructMapFineToCoarse(hypre_BoxIMin(&intersect_box), temp_index, - refine_factors[level], hypre_BoxIMin(&intersect_box)); - hypre_StructMapFineToCoarse(hypre_BoxIMax(&intersect_box), temp_index, - refine_factors[level], hypre_BoxIMax(&intersect_box)); - - intersect_size= hypre_BoxVolume(&intersect_box); - if (intersect_size > 0) - { + for (j = 0; j < ndim; j++) + { + rem = hypre_BoxIMin(&intersect_box)[j] % refine_factors[level][j]; + if (rem) + { + hypre_BoxIMin(&intersect_box)[j] += refine_factors[level][j] - rem; + } + } + + hypre_StructMapFineToCoarse(hypre_BoxIMin(&intersect_box), temp_index, + refine_factors[level], hypre_BoxIMin(&intersect_box)); + hypre_StructMapFineToCoarse(hypre_BoxIMax(&intersect_box), temp_index, + refine_factors[level], hypre_BoxIMax(&intersect_box)); + + intersect_size = hypre_BoxVolume(&intersect_box); + if (intersect_size > 0) + { /*------------------------------------------------------------ * Coarse underlying box found. Now zero off. *------------------------------------------------------------*/ - values1= hypre_CTAlloc(HYPRE_Real, intersect_size, HYPRE_MEMORY_HOST); + values1 = hypre_CTAlloc(HYPRE_Real, intersect_size, HYPRE_MEMORY_HOST); + + HYPRE_SStructVectorSetBoxValues(b, levels[level - 1], + hypre_BoxIMin(&intersect_box), + hypre_BoxIMax(&intersect_box), + var, values1); + hypre_TFree(values1, HYPRE_MEMORY_HOST); - HYPRE_SStructVectorSetBoxValues(b, levels[level-1], - hypre_BoxIMin(&intersect_box), - hypre_BoxIMax(&intersect_box), - var, values1); - hypre_TFree(values1, HYPRE_MEMORY_HOST); + } /* if (intersect_size > 0) */ + } /* for (i= 0; i< nboxman_entries; i++) */ - } /* if (intersect_size > 0) */ - } /* for (i= 0; i< nboxman_entries; i++) */ - - hypre_TFree(boxman_entries, HYPRE_MEMORY_HOST); + hypre_TFree(boxman_entries, HYPRE_MEMORY_HOST); } /* hypre_ForBoxI(ci, cgrid_boxes) */ } /* for (var= 0; var< nvars; var++) */ @@ -154,7 +154,7 @@ hypre_ZeroAMRVectorData(hypre_SStructVector *b, /*-------------------------------------------------------------------------- - * hypre_ZeroAMRMatrixData: Zeroes the data over the underlying coarse + * hypre_ZeroAMRMatrixData: Zeroes the data over the underlying coarse * indices of the refinement patches between two levels. *--------------------------------------------------------------------------*/ @@ -163,8 +163,8 @@ hypre_ZeroAMRMatrixData(hypre_SStructMatrix *A, HYPRE_Int part_crse, hypre_Index rfactors ) { - hypre_SStructGraph *graph= hypre_SStructMatrixGraph(A); - hypre_SStructGrid *grid = hypre_SStructGraphGrid(graph); + hypre_SStructGraph *graph = hypre_SStructMatrixGraph(A); + hypre_SStructGrid *grid = hypre_SStructGraphGrid(graph); HYPRE_Int ndim = hypre_SStructMatrixNDim(A); hypre_SStructPGrid *p_cgrid; @@ -185,117 +185,117 @@ hypre_ZeroAMRMatrixData(hypre_SStructMatrix *A, hypre_Index *stencil_shape; hypre_Index temp_index, ilower, iupper; - + HYPRE_Int nvars, var; HYPRE_Int ci, i, j, rem, intersect_size, rank; HYPRE_Real *values1, *values2; - + HYPRE_Int ierr = 0; hypre_BoxInit(&scaled_box, ndim); hypre_BoxInit(&intersect_box, ndim); - p_cgrid= hypre_SStructGridPGrid(grid, part_crse); + p_cgrid = hypre_SStructGridPGrid(grid, part_crse); nvars = hypre_SStructPGridNVars(p_cgrid); - for (var= 0; var< nvars; var++) + for (var = 0; var < nvars; var++) { stencils = hypre_SStructGraphStencil(graph, part_crse, var); stencil_size = hypre_SStructStencilSize(stencils); - stencil_shape= hypre_SStructStencilShape(stencils); + stencil_shape = hypre_SStructStencilShape(stencils); /*--------------------------------------------------------------------- * For each variable, find the underlying boxes for each fine box. *---------------------------------------------------------------------*/ cgrid = hypre_SStructPGridSGrid(p_cgrid, var); cgrid_boxes = hypre_StructGridBoxes(cgrid); - fboxman = hypre_SStructGridBoxManager(grid, part_crse+1, var); + fboxman = hypre_SStructGridBoxManager(grid, part_crse + 1, var); hypre_ForBoxI(ci, cgrid_boxes) { - cgrid_box= hypre_BoxArrayBox(cgrid_boxes, ci); - - hypre_ClearIndex(temp_index); - hypre_StructMapCoarseToFine(hypre_BoxIMin(cgrid_box), temp_index, - rfactors, hypre_BoxIMin(&scaled_box)); - for (i= 0; i< ndim; i++) - { - temp_index[i]= rfactors[i]-1; - } - hypre_StructMapCoarseToFine(hypre_BoxIMax(cgrid_box), temp_index, - rfactors, hypre_BoxIMax(&scaled_box)); - hypre_ClearIndex(temp_index); - - hypre_BoxManIntersect(fboxman, hypre_BoxIMin(&scaled_box), - hypre_BoxIMax(&scaled_box), &boxman_entries, - &nboxman_entries); - - for (i= 0; i< nboxman_entries; i++) - { - hypre_BoxManEntryGetExtents(boxman_entries[i], ilower, iupper); - hypre_BoxSetExtents(&intersect_box, ilower, iupper); - hypre_IntersectBoxes(&intersect_box, &scaled_box, &intersect_box); + cgrid_box = hypre_BoxArrayBox(cgrid_boxes, ci); + + hypre_ClearIndex(temp_index); + hypre_StructMapCoarseToFine(hypre_BoxIMin(cgrid_box), temp_index, + rfactors, hypre_BoxIMin(&scaled_box)); + for (i = 0; i < ndim; i++) + { + temp_index[i] = rfactors[i] - 1; + } + hypre_StructMapCoarseToFine(hypre_BoxIMax(cgrid_box), temp_index, + rfactors, hypre_BoxIMax(&scaled_box)); + hypre_ClearIndex(temp_index); + + hypre_BoxManIntersect(fboxman, hypre_BoxIMin(&scaled_box), + hypre_BoxIMax(&scaled_box), &boxman_entries, + &nboxman_entries); + + for (i = 0; i < nboxman_entries; i++) + { + hypre_BoxManEntryGetExtents(boxman_entries[i], ilower, iupper); + hypre_BoxSetExtents(&intersect_box, ilower, iupper); + hypre_IntersectBoxes(&intersect_box, &scaled_box, &intersect_box); /* adjust the box so that it is divisible by refine_factors */ - for (j= 0; j< ndim; j++) - { - rem= hypre_BoxIMin(&intersect_box)[j]%rfactors[j]; - if (rem) - { - hypre_BoxIMin(&intersect_box)[j]+= rfactors[j] - rem; - } - } - - hypre_StructMapFineToCoarse(hypre_BoxIMin(&intersect_box), temp_index, - rfactors, hypre_BoxIMin(&intersect_box)); - hypre_StructMapFineToCoarse(hypre_BoxIMax(&intersect_box), temp_index, - rfactors, hypre_BoxIMax(&intersect_box)); - - intersect_size= hypre_BoxVolume(&intersect_box); - if (intersect_size > 0) - { - /*------------------------------------------------------------ - * Coarse underlying box found. Now zero off. - *------------------------------------------------------------*/ - values1= hypre_CTAlloc(HYPRE_Real, intersect_size, HYPRE_MEMORY_HOST); - values2= hypre_TAlloc(HYPRE_Real, intersect_size, HYPRE_MEMORY_HOST); - for (j= 0; j< intersect_size; j++) - { - values2[j]= 1.0; - } - - for (j= 0; j< stencil_size; j++) - { - rank= hypre_abs(hypre_IndexX(stencil_shape[j]))+ - hypre_abs(hypre_IndexY(stencil_shape[j]))+ - hypre_abs(hypre_IndexZ(stencil_shape[j])); - - if (rank) - { - HYPRE_SStructMatrixSetBoxValues(A, - part_crse, - hypre_BoxIMin(&intersect_box), - hypre_BoxIMax(&intersect_box), - var, 1, &j, values1); - } - else - { - HYPRE_SStructMatrixSetBoxValues(A, - part_crse, - hypre_BoxIMin(&intersect_box), - hypre_BoxIMax(&intersect_box), - var, 1, &j, values2); - } - } - hypre_TFree(values1, HYPRE_MEMORY_HOST); - hypre_TFree(values2, HYPRE_MEMORY_HOST); - - } /* if (intersect_size > 0) */ - } /* for (i= 0; i< nmap_entries; i++) */ - - hypre_TFree(boxman_entries, HYPRE_MEMORY_HOST); + for (j = 0; j < ndim; j++) + { + rem = hypre_BoxIMin(&intersect_box)[j] % rfactors[j]; + if (rem) + { + hypre_BoxIMin(&intersect_box)[j] += rfactors[j] - rem; + } + } + + hypre_StructMapFineToCoarse(hypre_BoxIMin(&intersect_box), temp_index, + rfactors, hypre_BoxIMin(&intersect_box)); + hypre_StructMapFineToCoarse(hypre_BoxIMax(&intersect_box), temp_index, + rfactors, hypre_BoxIMax(&intersect_box)); + + intersect_size = hypre_BoxVolume(&intersect_box); + if (intersect_size > 0) + { + /*------------------------------------------------------------ + * Coarse underlying box found. Now zero off. + *------------------------------------------------------------*/ + values1 = hypre_CTAlloc(HYPRE_Real, intersect_size, HYPRE_MEMORY_HOST); + values2 = hypre_TAlloc(HYPRE_Real, intersect_size, HYPRE_MEMORY_HOST); + for (j = 0; j < intersect_size; j++) + { + values2[j] = 1.0; + } + + for (j = 0; j < stencil_size; j++) + { + rank = hypre_abs(hypre_IndexX(stencil_shape[j])) + + hypre_abs(hypre_IndexY(stencil_shape[j])) + + hypre_abs(hypre_IndexZ(stencil_shape[j])); + + if (rank) + { + HYPRE_SStructMatrixSetBoxValues(A, + part_crse, + hypre_BoxIMin(&intersect_box), + hypre_BoxIMax(&intersect_box), + var, 1, &j, values1); + } + else + { + HYPRE_SStructMatrixSetBoxValues(A, + part_crse, + hypre_BoxIMin(&intersect_box), + hypre_BoxIMax(&intersect_box), + var, 1, &j, values2); + } + } + hypre_TFree(values1, HYPRE_MEMORY_HOST); + hypre_TFree(values2, HYPRE_MEMORY_HOST); + + } /* if (intersect_size > 0) */ + } /* for (i= 0; i< nmap_entries; i++) */ + + hypre_TFree(boxman_entries, HYPRE_MEMORY_HOST); } /* hypre_ForBoxI(ci, cgrid_boxes) */ } /* for (var= 0; var< nvars; var++) */ diff --git a/external/hypre/src/sstruct_ls/fac_cf_coarsen.c b/external/hypre/src/sstruct_ls/fac_cf_coarsen.c index f9306273..d212826b 100644 --- a/external/hypre/src/sstruct_ls/fac_cf_coarsen.c +++ b/external/hypre/src/sstruct_ls/fac_cf_coarsen.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -12,7 +12,7 @@ * ******************************************************************************/ -#include "_hypre_sstruct_ls.h" +#include "_hypre_sstruct_ls.h" #include "fac.h" #define MapStencilRank(stencil, rank) \ @@ -57,10 +57,10 @@ } /*-------------------------------------------------------------------------- - * hypre_AMR_CFCoarsen: Coarsens the CF interface to get the stencils + * hypre_AMR_CFCoarsen: Coarsens the CF interface to get the stencils * reaching into a coarsened fbox. Also sets the centre coefficient of CF - * interface nodes to have "preserved" row sum. - * + * interface nodes to have "preserved" row sum. + * * On entry, fac_A already has all the coefficient values of the cgrid * chunks that are not underlying a fbox. Note that A & fac_A have the * same grid & graph. Therefore, we will use A's grid & graph. @@ -72,7 +72,7 @@ HYPRE_Int hypre_AMR_CFCoarsen( hypre_SStructMatrix * A, hypre_SStructMatrix * fac_A, hypre_Index refine_factors, - HYPRE_Int level ) + HYPRE_Int level ) { MPI_Comm comm = hypre_SStructMatrixComm(A); @@ -81,7 +81,7 @@ hypre_AMR_CFCoarsen( hypre_SStructMatrix * A, hypre_SStructGrid *grid = hypre_SStructGraphGrid(graph); HYPRE_Int nUventries = hypre_SStructGraphNUVEntries(graph); HYPRE_IJMatrix ij_A = hypre_SStructMatrixIJMatrix(A); - HYPRE_Int matrix_type= hypre_SStructMatrixObjectType(A); + HYPRE_Int matrix_type = hypre_SStructMatrixObjectType(A); HYPRE_Int ndim = hypre_SStructMatrixNDim(A); hypre_SStructPMatrix *A_pmatrix; @@ -94,9 +94,9 @@ hypre_AMR_CFCoarsen( hypre_SStructMatrix * A, HYPRE_Real **a_ptrs; hypre_Box *A_dbox; - HYPRE_Int part_crse= level-1; - HYPRE_Int part_fine= level; - + HYPRE_Int part_crse = level - 1; + HYPRE_Int part_fine = level; + hypre_BoxManager *fboxman; hypre_BoxManEntry **boxman_entries, *boxman_entry; HYPRE_Int nboxman_entries; @@ -117,8 +117,8 @@ hypre_AMR_CFCoarsen( hypre_SStructMatrix * A, HYPRE_Int centre; HYPRE_Int ci, fi, boxi; - HYPRE_Int max_stencil_size= 27; - HYPRE_Int falseV= 0; + HYPRE_Int max_stencil_size = 27; + HYPRE_Int falseV = 0; HYPRE_Int trueV = 1; HYPRE_Int found; HYPRE_Int *stencil_ranks, *rank_stencils; @@ -126,7 +126,7 @@ hypre_AMR_CFCoarsen( hypre_SStructMatrix * A, HYPRE_Real *vals; HYPRE_Int i, j; - HYPRE_Int nvars, var1; + HYPRE_Int nvars, var1; hypre_Index lindex, zero_index; hypre_Index index1, index2; @@ -138,48 +138,53 @@ hypre_AMR_CFCoarsen( hypre_SStructMatrix * A, HYPRE_Int *ncols; HYPRE_BigInt *rows, *cols; - + HYPRE_Int *temp1, *temp2; HYPRE_Int myid; hypre_MPI_Comm_rank(comm, &myid); hypre_SetIndex3(zero_index, 0, 0, 0); + hypre_SetIndex3(lindex, 0, 0, 0); hypre_BoxInit(&refined_box, ndim); hypre_BoxInit(&boxman_entry_box, ndim); - + /*-------------------------------------------------------------------------- - * Task: Coarsen the CF interface connections of A into fac_A so that + * Task: Coarsen the CF interface connections of A into fac_A so that * fac_A will have the stencil coefficients extending into a coarsened * fbox. The centre coefficient is constructed to preserve the row sum. *--------------------------------------------------------------------------*/ if (graph_type == HYPRE_SSTRUCT) { - startrank = hypre_SStructGridGhstartRank(grid); + startrank = hypre_SStructGridGhstartRank(grid); } - if (graph_type == HYPRE_PARCSR) + else if (graph_type == HYPRE_PARCSR) { - startrank = hypre_SStructGridStartRank(grid); + startrank = hypre_SStructGridStartRank(grid); + } + else + { + startrank = 0; } /*-------------------------------------------------------------------------- * Fine grid strides by the refinement factors. *--------------------------------------------------------------------------*/ hypre_SetIndex3(stridec, 1, 1, 1); - for (i= 0; i< ndim; i++) + for (i = 0; i < ndim; i++) { - stridef[i]= refine_factors[i]; + stridef[i] = refine_factors[i]; } - for (i= ndim; i< 3; i++) + for (i = ndim; i < 3; i++) { - stridef[i]= 1; + stridef[i] = 1; } /*-------------------------------------------------------------------------- * Determine the c/f interface index boxes: fgrid_cinterface_extents. - * These are between fpart= level and cpart= (level-1). The + * These are between fpart= level and cpart= (level-1). The * fgrid_cinterface_extents are indexed by cboxes, but fboxes that * abutt a given cbox must be considered. Moreover, for each fbox, * we can have a c/f interface from a number of different stencil @@ -194,28 +199,28 @@ hypre_AMR_CFCoarsen( hypre_SStructMatrix * A, * * fgrid_cinterface_extents[var1][ci] *--------------------------------------------------------------------------*/ - A_pmatrix= hypre_SStructMatrixPMatrix(fac_A, part_crse); + A_pmatrix = hypre_SStructMatrixPMatrix(fac_A, part_crse); nvars = hypre_SStructPMatrixNVars(A_pmatrix); - fgrid_cinterface_extents= hypre_TAlloc(hypre_BoxArrayArray **, nvars, HYPRE_MEMORY_HOST); - for (var1= 0; var1< nvars; var1++) + fgrid_cinterface_extents = hypre_TAlloc(hypre_BoxArrayArray **, nvars, HYPRE_MEMORY_HOST); + for (var1 = 0; var1 < nvars; var1++) { - fboxman= hypre_SStructGridBoxManager(grid, part_fine, var1); - stencils= hypre_SStructPMatrixSStencil(A_pmatrix, var1, var1); + fboxman = hypre_SStructGridBoxManager(grid, part_fine, var1); + stencils = hypre_SStructPMatrixSStencil(A_pmatrix, var1, var1); - cgrid= hypre_SStructPGridSGrid(hypre_SStructPMatrixPGrid(A_pmatrix), var1); - cgrid_boxes= hypre_StructGridBoxes(cgrid); - fgrid_cinterface_extents[var1]= hypre_TAlloc(hypre_BoxArrayArray *, - hypre_BoxArraySize(cgrid_boxes), HYPRE_MEMORY_HOST); + cgrid = hypre_SStructPGridSGrid(hypre_SStructPMatrixPGrid(A_pmatrix), var1); + cgrid_boxes = hypre_StructGridBoxes(cgrid); + fgrid_cinterface_extents[var1] = hypre_TAlloc(hypre_BoxArrayArray *, + hypre_BoxArraySize(cgrid_boxes), HYPRE_MEMORY_HOST); hypre_ForBoxI(ci, cgrid_boxes) { - cgrid_box= hypre_BoxArrayBox(cgrid_boxes, ci); + cgrid_box = hypre_BoxArrayBox(cgrid_boxes, ci); hypre_StructMapCoarseToFine(hypre_BoxIMin(cgrid_box), zero_index, refine_factors, hypre_BoxIMin(&refined_box)); - hypre_SetIndex3(index1, refine_factors[0]-1, refine_factors[1]-1, - refine_factors[2]-1); + hypre_SetIndex3(index1, refine_factors[0] - 1, refine_factors[1] - 1, + refine_factors[2] - 1); hypre_StructMapCoarseToFine(hypre_BoxIMax(cgrid_box), index1, refine_factors, hypre_BoxIMax(&refined_box)); @@ -223,17 +228,17 @@ hypre_AMR_CFCoarsen( hypre_SStructMatrix * A, * Stretch the refined_box so that a BoxManIntersect will get abutting * fboxes. *------------------------------------------------------------------------*/ - for (i= 0; i< ndim; i++) + for (i = 0; i < ndim; i++) { - hypre_BoxIMin(&refined_box)[i]-= 1; - hypre_BoxIMax(&refined_box)[i]+= 1; + hypre_BoxIMin(&refined_box)[i] -= 1; + hypre_BoxIMax(&refined_box)[i] += 1; } hypre_BoxManIntersect(fboxman, hypre_BoxIMin(&refined_box), hypre_BoxIMax(&refined_box), &boxman_entries, &nboxman_entries); - fgrid_cinterface_extents[var1][ci]= hypre_BoxArrayArrayCreate(nboxman_entries, ndim); + fgrid_cinterface_extents[var1][ci] = hypre_BoxArrayArrayCreate(nboxman_entries, ndim); /*------------------------------------------------------------------------ * Get the fgrid_cinterface_extents using var1-var1 stencil (only like- @@ -241,7 +246,7 @@ hypre_AMR_CFCoarsen( hypre_SStructMatrix * A, *------------------------------------------------------------------------*/ if (stencils != NULL) { - for (i= 0; i< nboxman_entries; i++) + for (i = 0; i < nboxman_entries; i++) { hypre_BoxManEntryGetExtents(boxman_entries[i], hypre_BoxIMin(&boxman_entry_box), @@ -258,21 +263,21 @@ hypre_AMR_CFCoarsen( hypre_SStructMatrix * A, /*-------------------------------------------------------------------------- * STEP 1: * ADJUST THE ENTRIES ALONG THE C/F BOXES SO THAT THE COARSENED - * C/F CONNECTION HAS THE APPROPRIATE ROW SUM. + * C/F CONNECTION HAS THE APPROPRIATE ROW SUM. * WE ARE ASSUMING ONLY LIKE VARIABLES COUPLE. *--------------------------------------------------------------------------*/ - for (var1= 0; var1< nvars; var1++) + for (var1 = 0; var1 < nvars; var1++) { - cgrid= hypre_SStructPGridSGrid(hypre_SStructPMatrixPGrid(A_pmatrix), var1); - cgrid_boxes= hypre_StructGridBoxes(cgrid); - stencils= hypre_SStructPMatrixSStencil(A_pmatrix, var1, var1); + cgrid = hypre_SStructPGridSGrid(hypre_SStructPMatrixPGrid(A_pmatrix), var1); + cgrid_boxes = hypre_StructGridBoxes(cgrid); + stencils = hypre_SStructPMatrixSStencil(A_pmatrix, var1, var1); /*---------------------------------------------------------------------- * Extract only where variables couple. *----------------------------------------------------------------------*/ if (stencils != NULL) { - stencil_size= hypre_StructStencilSize(stencils); + stencil_size = hypre_StructStencilSize(stencils); /*------------------------------------------------------------------ * stencil_ranks[i] = rank of stencil entry i. @@ -281,45 +286,45 @@ hypre_AMR_CFCoarsen( hypre_SStructMatrix * A, * These are needed in collapsing the unstructured connections to * a stencil connection. *------------------------------------------------------------------*/ - stencil_ranks= hypre_TAlloc(HYPRE_Int, stencil_size, HYPRE_MEMORY_HOST); - rank_stencils= hypre_TAlloc(HYPRE_Int, max_stencil_size, HYPRE_MEMORY_HOST); - for (i= 0; i< max_stencil_size; i++) + stencil_ranks = hypre_TAlloc(HYPRE_Int, stencil_size, HYPRE_MEMORY_HOST); + rank_stencils = hypre_TAlloc(HYPRE_Int, max_stencil_size, HYPRE_MEMORY_HOST); + for (i = 0; i < max_stencil_size; i++) { - rank_stencils[i]= -1; + rank_stencils[i] = -1; if (i < stencil_size) { - stencil_ranks[i]= -1; + stencil_ranks[i] = -1; } } - for (i= 0; i< stencil_size; i++) + for (i = 0; i < stencil_size; i++) { hypre_CopyIndex(hypre_StructStencilElement(stencils, i), stencil_shape_i); MapStencilRank(stencil_shape_i, j); - stencil_ranks[i]= j; - rank_stencils[stencil_ranks[i]] = i; + stencil_ranks[i] = j; + rank_stencils[stencil_ranks[i]] = i; } - centre= rank_stencils[0]; + centre = rank_stencils[0]; smatrix_var = hypre_SStructPMatrixSMatrix(A_pmatrix, var1, var1); a_ptrs = hypre_TAlloc(HYPRE_Real *, stencil_size, HYPRE_MEMORY_HOST); hypre_ForBoxI(ci, cgrid_boxes) { - cgrid_box= hypre_BoxArrayBox(cgrid_boxes, ci); + cgrid_box = hypre_BoxArrayBox(cgrid_boxes, ci); - cinterface_arrays= fgrid_cinterface_extents[var1][ci]; - A_dbox= hypre_BoxArrayBox(hypre_StructMatrixDataSpace(smatrix_var), ci); + cinterface_arrays = fgrid_cinterface_extents[var1][ci]; + A_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(smatrix_var), ci); /*----------------------------------------------------------------- * Ptrs to the correct data location. *-----------------------------------------------------------------*/ - for (i= 0; i< stencil_size; i++) + for (i = 0; i < stencil_size; i++) { hypre_CopyIndex(hypre_StructStencilElement(stencils, i), stencil_shape_i); - a_ptrs[i]= hypre_StructMatrixExtractPointerByIndex(smatrix_var, - ci, - stencil_shape_i); + a_ptrs[i] = hypre_StructMatrixExtractPointerByIndex(smatrix_var, + ci, + stencil_shape_i); } /*------------------------------------------------------------------- @@ -329,11 +334,11 @@ hypre_AMR_CFCoarsen( hypre_SStructMatrix * A, *-------------------------------------------------------------------*/ hypre_ForBoxArrayI(fi, cinterface_arrays) { - cinterface_array= hypre_BoxArrayArrayBoxArray(cinterface_arrays, fi); + cinterface_array = hypre_BoxArrayArrayBoxArray(cinterface_arrays, fi); box_array_size = hypre_BoxArraySize(cinterface_array); - for (boxi= stencil_size; boxi< box_array_size; boxi++) + for (boxi = stencil_size; boxi < box_array_size; boxi++) { - fgrid_cinterface= hypre_BoxArrayBox(cinterface_array, boxi); + fgrid_cinterface = hypre_BoxArrayBox(cinterface_array, boxi); hypre_CopyIndex(hypre_BoxIMin(fgrid_cinterface), node_extents); hypre_BoxGetSize(fgrid_cinterface, loop_size); @@ -341,11 +346,11 @@ hypre_AMR_CFCoarsen( hypre_SStructMatrix * A, A_dbox, node_extents, stridec, iA); { zypre_BoxLoopGetIndex(lindex); - for (i= 0; i< stencil_size; i++) + for (i = 0; i < stencil_size; i++) { if (i != centre) { - a_ptrs[centre][iA]+= a_ptrs[i][iA]; + a_ptrs[centre][iA] += a_ptrs[i][iA]; } } @@ -353,11 +358,11 @@ hypre_AMR_CFCoarsen( hypre_SStructMatrix * A, * Search for unstructured connections for this coarse node. Need * to compute the index of the node. We will "collapse" the * unstructured connections to the appropriate stencil entry. Thus - * we need to serch for the stencil entry. + * we need to serch for the stencil entry. *-----------------------------------------------------------------*/ - index_temp[0]= node_extents[0] + lindex[0]; - index_temp[1]= node_extents[1] + lindex[1]; - index_temp[2]= node_extents[2] + lindex[2]; + index_temp[0] = node_extents[0] + lindex[0]; + index_temp[1] = node_extents[1] + lindex[1]; + index_temp[2] = node_extents[2] + lindex[2]; hypre_SStructGridFindBoxManEntry(grid, part_crse, index_temp, var1, &boxman_entry); @@ -365,11 +370,11 @@ hypre_AMR_CFCoarsen( hypre_SStructMatrix * A, matrix_type); if (nUventries > 0) { - found= falseV; - if ((rank-startrank) >= hypre_SStructGraphIUVEntry(graph, 0) && - (rank-startrank) <= hypre_SStructGraphIUVEntry(graph, nUventries-1)) + found = falseV; + if ((rank - startrank) >= hypre_SStructGraphIUVEntry(graph, 0) && + (rank - startrank) <= hypre_SStructGraphIUVEntry(graph, nUventries - 1)) { - found= trueV; + found = trueV; } } @@ -379,39 +384,39 @@ hypre_AMR_CFCoarsen( hypre_SStructMatrix * A, *-----------------------------------------------------------------*/ if (nUventries > 0 && found == trueV) { - Uventry= hypre_SStructGraphUVEntry(graph, rank-startrank); + Uventry = hypre_SStructGraphUVEntry(graph, rank - startrank); if (Uventry != NULL) { - nUentries= hypre_SStructUVEntryNUEntries(Uventry); - + nUentries = hypre_SStructUVEntryNUEntries(Uventry); + /*----------------------------------------------------------- * extract only the connections to level part_fine and the * correct variable. *-----------------------------------------------------------*/ - temp1= hypre_CTAlloc(HYPRE_Int, nUentries, HYPRE_MEMORY_HOST); - cnt1= 0; - for (i=0; i< nUentries; i++) + temp1 = hypre_CTAlloc(HYPRE_Int, nUentries, HYPRE_MEMORY_HOST); + cnt1 = 0; + for (i = 0; i < nUentries; i++) { - if (hypre_SStructUVEntryToPart(Uventry, i) == part_fine + if (hypre_SStructUVEntryToPart(Uventry, i) == part_fine && hypre_SStructUVEntryToVar(Uventry, i) == var1) { - temp1[cnt1++]= i; + temp1[cnt1++] = i; } } - ncols= hypre_TAlloc(HYPRE_Int, cnt1, HYPRE_MEMORY_HOST); + ncols = hypre_TAlloc(HYPRE_Int, cnt1, HYPRE_MEMORY_HOST); rows = hypre_TAlloc(HYPRE_BigInt, cnt1, HYPRE_MEMORY_HOST); cols = hypre_TAlloc(HYPRE_BigInt, cnt1, HYPRE_MEMORY_HOST); - temp2= hypre_TAlloc(HYPRE_Int, cnt1, HYPRE_MEMORY_HOST); + temp2 = hypre_TAlloc(HYPRE_Int, cnt1, HYPRE_MEMORY_HOST); vals = hypre_CTAlloc(HYPRE_Real, cnt1, HYPRE_MEMORY_HOST); - for (i= 0; i< cnt1; i++) + for (i = 0; i < cnt1; i++) { - ncols[i]= 1; + ncols[i] = 1; rows[i] = rank; cols[i] = hypre_SStructUVEntryToRank(Uventry, temp1[i]); - + /* determine the stencil connection pattern */ hypre_StructMapFineToCoarse( hypre_SStructUVEntryToIndex(Uventry, temp1[i]), @@ -423,10 +428,10 @@ hypre_AMR_CFCoarsen( hypre_SStructMatrix * A, /* zero off this stencil connection into the fbox */ if (temp2[i] < max_stencil_size) { - j= rank_stencils[temp2[i]]; + j = rank_stencils[temp2[i]]; if (j >= 0) { - a_ptrs[j][iA]= 0.0; + a_ptrs[j][iA] = 0.0; } } } /* for (i= 0; i< cnt1; i++) */ @@ -434,9 +439,9 @@ hypre_AMR_CFCoarsen( hypre_SStructMatrix * A, hypre_TFree(temp1, HYPRE_MEMORY_HOST); HYPRE_IJMatrixGetValues(ij_A, cnt1, ncols, rows, cols, vals); - for (i= 0; i< cnt1; i++) + for (i = 0; i < cnt1; i++) { - a_ptrs[centre][iA]+= vals[i]; + a_ptrs[centre][iA] += vals[i]; } hypre_TFree(ncols, HYPRE_MEMORY_HOST); @@ -444,14 +449,14 @@ hypre_AMR_CFCoarsen( hypre_SStructMatrix * A, hypre_TFree(cols, HYPRE_MEMORY_HOST); /* compute the connection to the coarsened fine box */ - for (i= 0; i< cnt1; i++) + for (i = 0; i < cnt1; i++) { if (temp2[i] < max_stencil_size) { - j= rank_stencils[temp2[i]]; + j = rank_stencils[temp2[i]]; if (j >= 0) { - a_ptrs[j][iA]+= vals[i]; + a_ptrs[j][iA] += vals[i]; } } } @@ -459,11 +464,11 @@ hypre_AMR_CFCoarsen( hypre_SStructMatrix * A, hypre_TFree(temp2, HYPRE_MEMORY_HOST); /* centre connection which preserves the row sum */ - for (i= 0; i< stencil_size; i++) + for (i = 0; i < stencil_size; i++) { if (i != centre) { - a_ptrs[centre][iA]-= a_ptrs[i][iA]; + a_ptrs[centre][iA] -= a_ptrs[i][iA]; } } @@ -482,10 +487,10 @@ hypre_AMR_CFCoarsen( hypre_SStructMatrix * A, } /* end var1 */ - for (var1= 0; var1< nvars; var1++) + for (var1 = 0; var1 < nvars; var1++) { - cgrid= hypre_SStructPGridSGrid(hypre_SStructPMatrixPGrid(A_pmatrix), var1); - cgrid_boxes= hypre_StructGridBoxes(cgrid); + cgrid = hypre_SStructPGridSGrid(hypre_SStructPMatrixPGrid(A_pmatrix), var1); + cgrid_boxes = hypre_StructGridBoxes(cgrid); hypre_ForBoxI(ci, cgrid_boxes) { @@ -497,4 +502,3 @@ hypre_AMR_CFCoarsen( hypre_SStructMatrix * A, return 0; } - diff --git a/external/hypre/src/sstruct_ls/fac_cfstencil_box.c b/external/hypre/src/sstruct_ls/fac_cfstencil_box.c index a2a17c75..a48e6bce 100644 --- a/external/hypre/src/sstruct_ls/fac_cfstencil_box.c +++ b/external/hypre/src/sstruct_ls/fac_cfstencil_box.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -48,29 +48,29 @@ hypre_CF_StenBox( hypre_Box *fgrid_box, hypre_BoxInit(&coarsen_box, ndim); hypre_BoxInit(&contracted_box, ndim); - hypre_BoxInit(&extended_box, ndim); + hypre_BoxInit(&extended_box, ndim); hypre_BoxInit(&intersect_box, ndim); hypre_BoxInit(&shift_cbox, ndim); hypre_BoxInit(&shift_ibox, ndim); - /*-------------------------------------------------------------------------- - * Coarsen the fine box, extend it, and shift it to determine if there - * is a reach between fgrid_box and cgrid_box in the stencil_shape direction. - * Note: the fine_box may not align as the index rule assumes: - * [a_0,a_1,a_2]x[b_0,b_1,b_2], a_i= c_i*rfactors[i] - * b_i= f_i*rfactors[i]+g_i, g_i= rfactors[i]-1. - * When fine_box does not, then there must be a sibling box. fine_box - * should be adjusted so that the flooring of the MapFineToCoarse does not - * introduce extra coarse nodes in the coarsened box. Only the lower bound - * needs to be adjusted. - *--------------------------------------------------------------------------*/ + /*-------------------------------------------------------------------------- + * Coarsen the fine box, extend it, and shift it to determine if there + * is a reach between fgrid_box and cgrid_box in the stencil_shape direction. + * Note: the fine_box may not align as the index rule assumes: + * [a_0,a_1,a_2]x[b_0,b_1,b_2], a_i= c_i*rfactors[i] + * b_i= f_i*rfactors[i]+g_i, g_i= rfactors[i]-1. + * When fine_box does not, then there must be a sibling box. fine_box + * should be adjusted so that the flooring of the MapFineToCoarse does not + * introduce extra coarse nodes in the coarsened box. Only the lower bound + * needs to be adjusted. + *--------------------------------------------------------------------------*/ hypre_CopyBox(fgrid_box, &contracted_box); - for (i= 0; i< ndim; i++) + for (i = 0; i < ndim; i++) { - remainder= hypre_BoxIMin(&contracted_box)[i] % rfactors[i]; + remainder = hypre_BoxIMin(&contracted_box)[i] % rfactors[i]; if (remainder) { - hypre_BoxIMin(&contracted_box)[i]+= rfactors[i] - remainder; + hypre_BoxIMin(&contracted_box)[i] += rfactors[i] - remainder; } } @@ -80,66 +80,66 @@ hypre_CF_StenBox( hypre_Box *fgrid_box, rfactors, hypre_BoxIMax(&coarsen_box)); hypre_ClearIndex(size_cbox); - for (i= 0; i< ndim; i++) + for (i = 0; i < ndim; i++) { size_cbox[i] = hypre_BoxSizeD(&coarsen_box, i) - 1; } - /*--------------------------------------------------------------------- - * Extend the coarsened fgrid_box by one layer in each direction so - * that actual cf interface is reached. If only coarsen_box were - * extended, the actual cf interface may not be reached. - *---------------------------------------------------------------------*/ + /*--------------------------------------------------------------------- + * Extend the coarsened fgrid_box by one layer in each direction so + * that actual cf interface is reached. If only coarsen_box were + * extended, the actual cf interface may not be reached. + *---------------------------------------------------------------------*/ hypre_CopyBox(&coarsen_box, &extended_box); /*hypre_StructMapFineToCoarse(hypre_BoxIMin(fgrid_box), temp_index, rfactors, hypre_BoxIMin(&extended_box)); hypre_StructMapFineToCoarse(hypre_BoxIMax(fgrid_box), temp_index, rfactors, hypre_BoxIMax(&extended_box));*/ - for (i= 0; i< ndim; i++) + for (i = 0; i < ndim; i++) { - hypre_BoxIMin(&extended_box)[i]-=1; - hypre_BoxIMax(&extended_box)[i]+=1; + hypre_BoxIMin(&extended_box)[i] -= 1; + hypre_BoxIMax(&extended_box)[i] += 1; } hypre_IntersectBoxes(&extended_box, cgrid_box, &intersect_box); - intersect_size= hypre_BoxVolume(&intersect_box); + intersect_size = hypre_BoxVolume(&intersect_box); if (intersect_size == 0) { - hypre_CopyBox(&intersect_box, stenbox); - return stenbox; + hypre_CopyBox(&intersect_box, stenbox); + return stenbox; } hypre_ClearIndex(size_ibox); - for (i= 0; i< ndim; i++) + for (i = 0; i < ndim; i++) { size_ibox[i] = hypre_BoxSizeD(&intersect_box, i) - 1; } - /*--------------------------------------------------------------------- - * To find the box extents that must be loop over, we need to take the - * "opposite" stencil_shape and shift the coarsen and extended boxes. - *---------------------------------------------------------------------*/ + /*--------------------------------------------------------------------- + * To find the box extents that must be loop over, we need to take the + * "opposite" stencil_shape and shift the coarsen and extended boxes. + *---------------------------------------------------------------------*/ hypre_SetIndex3(shift_index, - -size_ibox[0]*stencil_shape[0], - -size_ibox[1]*stencil_shape[1], - -size_ibox[2]*stencil_shape[2]); + -size_ibox[0]*stencil_shape[0], + -size_ibox[1]*stencil_shape[1], + -size_ibox[2]*stencil_shape[2]); hypre_AddIndexes(shift_index, hypre_BoxIMin(&intersect_box), 3, hypre_BoxIMin(&shift_ibox)); hypre_AddIndexes(shift_index, hypre_BoxIMax(&intersect_box), 3, hypre_BoxIMax(&shift_ibox)); hypre_IntersectBoxes(&shift_ibox, &intersect_box, &shift_ibox); hypre_SetIndex3(shift_index, - -size_cbox[0]*stencil_shape[0], - -size_cbox[1]*stencil_shape[1], - -size_cbox[2]*stencil_shape[2]); + -size_cbox[0]*stencil_shape[0], + -size_cbox[1]*stencil_shape[1], + -size_cbox[2]*stencil_shape[2]); hypre_AddIndexes(shift_index, hypre_BoxIMin(&coarsen_box), 3, hypre_BoxIMin(&shift_cbox)); hypre_AddIndexes(shift_index, hypre_BoxIMax(&coarsen_box), 3, hypre_BoxIMax(&shift_cbox)); hypre_IntersectBoxes(&shift_cbox, &coarsen_box, &shift_cbox); - /*--------------------------------------------------------------------- - * shift_ibox & shift_cbox will contain the loop extents. Shifting - * shift_cbox by -stencil_shape and then intersecting with shift_ibox - * gives the exact extents. - *---------------------------------------------------------------------*/ + /*--------------------------------------------------------------------- + * shift_ibox & shift_cbox will contain the loop extents. Shifting + * shift_cbox by -stencil_shape and then intersecting with shift_ibox + * gives the exact extents. + *---------------------------------------------------------------------*/ hypre_SetIndex3(shift_index, -stencil_shape[0], -stencil_shape[1], -stencil_shape[2]); hypre_AddIndexes(shift_index, hypre_BoxIMin(&shift_cbox), 3, hypre_BoxIMin(&shift_cbox)); hypre_AddIndexes(shift_index, hypre_BoxIMax(&shift_cbox), 3, hypre_BoxIMax(&shift_cbox)); diff --git a/external/hypre/src/sstruct_ls/fac_interp2.c b/external/hypre/src/sstruct_ls/fac_interp2.c index 02dcd953..d6031d33 100644 --- a/external/hypre/src/sstruct_ls/fac_interp2.c +++ b/external/hypre/src/sstruct_ls/fac_interp2.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -50,11 +50,11 @@ typedef struct HYPRE_Int hypre_FacSemiInterpCreate2( void **fac_interp_vdata_ptr ) { - HYPRE_Int ierr= 0; + HYPRE_Int ierr = 0; hypre_FacSemiInterpData2 *fac_interp_data; fac_interp_data = hypre_CTAlloc(hypre_FacSemiInterpData2, 1, HYPRE_MEMORY_HOST); - *fac_interp_vdata_ptr= (void *) fac_interp_data; + *fac_interp_vdata_ptr = (void *) fac_interp_data; return ierr; } @@ -74,14 +74,14 @@ hypre_FacSemiInterpDestroy2( void *fac_interp_vdata) { hypre_SStructPVectorDestroy(fac_interp_data-> recv_cvectors); - for (i= 0; i< (fac_interp_data-> nvars); i++) + for (i = 0; i < (fac_interp_data-> nvars); i++) { hypre_TFree(fac_interp_data -> recv_boxnum_map[i], HYPRE_MEMORY_HOST); hypre_BoxArrayArrayDestroy(fac_interp_data -> identity_arrayboxes[i]); - size= hypre_BoxArrayArraySize(fac_interp_data -> ownboxes[i]); + size = hypre_BoxArrayArraySize(fac_interp_data -> ownboxes[i]); hypre_BoxArrayArrayDestroy(fac_interp_data -> ownboxes[i]); - for (j= 0; j< size; j++) + for (j = 0; j < size; j++) { hypre_TFree(fac_interp_data -> own_cboxnums[i][j], HYPRE_MEMORY_HOST); } @@ -99,7 +99,7 @@ hypre_FacSemiInterpDestroy2( void *fac_interp_vdata) hypre_TFree(fac_interp_data -> gnodes_comm_pkg, HYPRE_MEMORY_HOST); hypre_TFree(fac_interp_data -> interlevel_comm, HYPRE_MEMORY_HOST); - for (i= 0; i< (fac_interp_data -> ndim); i++) + for (i = 0; i < (fac_interp_data -> ndim); i++) { hypre_TFree(fac_interp_data -> weights[i], HYPRE_MEMORY_HOST); } @@ -125,8 +125,8 @@ hypre_FacSemiInterpSetup2( void *fac_interp_vdata, HYPRE_Int ierr = 0; hypre_FacSemiInterpData2 *fac_interp_data = (hypre_FacSemiInterpData2 *)fac_interp_vdata; - HYPRE_Int part_fine= 1; - HYPRE_Int part_crse= 0; + HYPRE_Int part_fine = 1; + HYPRE_Int part_crse = 0; hypre_CommPkg **gnodes_comm_pkg; hypre_CommPkg **interlevel_comm; @@ -139,7 +139,7 @@ hypre_FacSemiInterpSetup2( void *fac_interp_vdata, hypre_SStructPGrid *pgrid; - hypre_SStructPVector *ef= hypre_SStructVectorPVector(e, part_fine); + hypre_SStructPVector *ef = hypre_SStructVectorPVector(e, part_fine); hypre_StructVector *e_var, *s_rc, *s_cvector; hypre_BoxArrayArray **identity_arrayboxes; @@ -162,7 +162,7 @@ hypre_FacSemiInterpSetup2( void *fac_interp_vdata, hypre_BoxManEntry **boxman_entries; HYPRE_Int nboxman_entries; - HYPRE_Int nvars= hypre_SStructPVectorNVars(ef); + HYPRE_Int nvars = hypre_SStructPVectorNVars(ef); HYPRE_Int vars; hypre_Index zero_index, index; @@ -181,7 +181,7 @@ hypre_FacSemiInterpSetup2( void *fac_interp_vdata, hypre_MPI_Comm_rank(hypre_MPI_COMM_WORLD, &myproc); hypre_MPI_Comm_size(hypre_MPI_COMM_WORLD, &tot_procs); - ndim= hypre_SStructPGridNDim(hypre_SStructPVectorPGrid(ef)); + ndim = hypre_SStructPGridNDim(hypre_SStructPVectorPGrid(ef)); hypre_SetIndex3(zero_index, 0, 0, 0); hypre_BoxInit(&box, ndim); @@ -194,11 +194,11 @@ hypre_FacSemiInterpSetup2( void *fac_interp_vdata, * stencil pattern for each StructVector, i.e., linear interpolation for * each variable. *------------------------------------------------------------------------*/ - gnodes_comm_pkg= hypre_CTAlloc(hypre_CommPkg *, nvars, HYPRE_MEMORY_HOST); - for (vars= 0; vars< nvars; vars++) + gnodes_comm_pkg = hypre_CTAlloc(hypre_CommPkg *, nvars, HYPRE_MEMORY_HOST); + for (vars = 0; vars < nvars; vars++) { - e_var= hypre_SStructPVectorSVector(ec, vars); - num_ghost= hypre_StructVectorNumGhost(e_var); + e_var = hypre_SStructPVectorSVector(ec, vars); + num_ghost = hypre_StructVectorNumGhost(e_var); hypre_CreateCommInfoFromNumGhost(hypre_StructVectorGrid(e_var), num_ghost, &comm_info); @@ -212,7 +212,7 @@ hypre_FacSemiInterpSetup2( void *fac_interp_vdata, (fac_interp_data -> ndim) = ndim; (fac_interp_data -> nvars) = nvars; - (fac_interp_data -> gnodes_comm_pkg)= gnodes_comm_pkg; + (fac_interp_data -> gnodes_comm_pkg) = gnodes_comm_pkg; hypre_CopyIndex(rfactors, (fac_interp_data -> stride)); /*------------------------------------------------------------------------ @@ -235,26 +235,26 @@ hypre_FacSemiInterpSetup2( void *fac_interp_vdata, * is also communicated. However, the recv_grid will consists of the * unstretched boxes so that overlapping does not occur. *--------------------------------------------------------------------------*/ - identity_arrayboxes= hypre_CTAlloc(hypre_BoxArrayArray *, nvars, HYPRE_MEMORY_HOST); + identity_arrayboxes = hypre_CTAlloc(hypre_BoxArrayArray *, nvars, HYPRE_MEMORY_HOST); - pgrid= hypre_SStructPVectorPGrid(ec); + pgrid = hypre_SStructPVectorPGrid(ec); hypre_ClearIndex(index); - for (i= 0; i< ndim; i++) + for (i = 0; i < ndim; i++) { - index[i]= rfactors[i]-1; + index[i] = rfactors[i] - 1; } tmp_boxarray = hypre_BoxArrayCreate(0, ndim); - for (vars= 0; vars< nvars; vars++) + for (vars = 0; vars < nvars; vars++) { - boxman1= hypre_SStructGridBoxManager(hypre_SStructVectorGrid(e), - part_fine, vars); - boxarray= hypre_StructGridBoxes(hypre_SStructPGridSGrid(pgrid, vars)); - identity_arrayboxes[vars]= hypre_BoxArrayArrayCreate(hypre_BoxArraySize(boxarray), ndim); + boxman1 = hypre_SStructGridBoxManager(hypre_SStructVectorGrid(e), + part_fine, vars); + boxarray = hypre_StructGridBoxes(hypre_SStructPGridSGrid(pgrid, vars)); + identity_arrayboxes[vars] = hypre_BoxArrayArrayCreate(hypre_BoxArraySize(boxarray), ndim); hypre_ForBoxI(ci, boxarray) { - box= *hypre_BoxArrayBox(boxarray, ci); + box = *hypre_BoxArrayBox(boxarray, ci); hypre_AppendBox(&box, hypre_BoxArrayArrayBoxArray(identity_arrayboxes[vars], ci)); @@ -267,8 +267,8 @@ hypre_FacSemiInterpSetup2( void *fac_interp_vdata, hypre_BoxIMax(&scaled_box), &boxman_entries, &nboxman_entries); - intersect_boxes= hypre_BoxArrayCreate(0, ndim); - for (i= 0; i< nboxman_entries; i++) + intersect_boxes = hypre_BoxArrayCreate(0, ndim); + for (i = 0; i < nboxman_entries; i++) { hypre_BoxManEntryGetExtents(boxman_entries[i], ilower, iupper); hypre_BoxSetExtents(&box, ilower, iupper); @@ -276,12 +276,12 @@ hypre_FacSemiInterpSetup2( void *fac_interp_vdata, /* contract this refined box so that only the coarse nodes on this processor will be subtracted. */ - for (j= 0; j< ndim; j++) + for (j = 0; j < ndim; j++) { - k= hypre_BoxIMin(&box)[j] % rfactors[j]; + k = hypre_BoxIMin(&box)[j] % rfactors[j]; if (k) { - hypre_BoxIMin(&box)[j]+= rfactors[j] - k; + hypre_BoxIMin(&box)[j] += rfactors[j] - k; } } @@ -301,53 +301,54 @@ hypre_FacSemiInterpSetup2( void *fac_interp_vdata, } } hypre_BoxArrayDestroy(tmp_boxarray); - fac_interp_data -> identity_arrayboxes= identity_arrayboxes; + fac_interp_data -> identity_arrayboxes = identity_arrayboxes; /*-------------------------------------------------------------------------- * fboxes are coarsened. For each coarsened fbox, we need a boxarray of * recvboxes or ownboxes. *--------------------------------------------------------------------------*/ - ownboxes= hypre_CTAlloc(hypre_BoxArrayArray *, nvars, HYPRE_MEMORY_HOST); - own_cboxnums= hypre_CTAlloc(HYPRE_Int **, nvars, HYPRE_MEMORY_HOST); + ownboxes = hypre_CTAlloc(hypre_BoxArrayArray *, nvars, HYPRE_MEMORY_HOST); + own_cboxnums = hypre_CTAlloc(HYPRE_Int **, nvars, HYPRE_MEMORY_HOST); - recv_boxes= hypre_CTAlloc(hypre_BoxArrayArray *, nvars, HYPRE_MEMORY_HOST); - recv_processes= hypre_CTAlloc(HYPRE_Int **, nvars, HYPRE_MEMORY_HOST); + recv_boxes = hypre_CTAlloc(hypre_BoxArrayArray *, nvars, HYPRE_MEMORY_HOST); + recv_processes = hypre_CTAlloc(HYPRE_Int **, nvars, HYPRE_MEMORY_HOST); /* dummy pointer for CommInfoCreate */ - recv_remote_boxnums= hypre_CTAlloc(HYPRE_Int **, nvars, HYPRE_MEMORY_HOST); + recv_remote_boxnums = hypre_CTAlloc(HYPRE_Int **, nvars, HYPRE_MEMORY_HOST); hypre_ClearIndex(index); - for (i= 0; i< ndim; i++) + for (i = 0; i < ndim; i++) { - index[i]= 1; + index[i] = 1; } - for (vars= 0; vars< nvars; vars++) + for (vars = 0; vars < nvars; vars++) { - boxman1= hypre_SStructGridBoxManager(hypre_SStructVectorGrid(e), - part_crse, vars); - pgrid= hypre_SStructPVectorPGrid(ef); - boxarray= hypre_StructGridBoxes(hypre_SStructPGridSGrid(pgrid, vars)); + boxman1 = hypre_SStructGridBoxManager(hypre_SStructVectorGrid(e), + part_crse, vars); + pgrid = hypre_SStructPVectorPGrid(ef); + boxarray = hypre_StructGridBoxes(hypre_SStructPGridSGrid(pgrid, vars)); ownboxes[vars] = hypre_BoxArrayArrayCreate(hypre_BoxArraySize(boxarray), ndim); - own_cboxnums[vars]= hypre_CTAlloc(HYPRE_Int *, hypre_BoxArraySize(boxarray), HYPRE_MEMORY_HOST); + own_cboxnums[vars] = hypre_CTAlloc(HYPRE_Int *, hypre_BoxArraySize(boxarray), HYPRE_MEMORY_HOST); recv_boxes[vars] = hypre_BoxArrayArrayCreate(hypre_BoxArraySize(boxarray), ndim); - recv_processes[vars]= hypre_CTAlloc(HYPRE_Int *, hypre_BoxArraySize(boxarray), HYPRE_MEMORY_HOST); - recv_remote_boxnums[vars]= hypre_CTAlloc(HYPRE_Int *, hypre_BoxArraySize(boxarray), HYPRE_MEMORY_HOST); + recv_processes[vars] = hypre_CTAlloc(HYPRE_Int *, hypre_BoxArraySize(boxarray), HYPRE_MEMORY_HOST); + recv_remote_boxnums[vars] = hypre_CTAlloc(HYPRE_Int *, hypre_BoxArraySize(boxarray), + HYPRE_MEMORY_HOST); hypre_ForBoxI(fi, boxarray) { - box= *hypre_BoxArrayBox(boxarray, fi); + box = *hypre_BoxArrayBox(boxarray, fi); /*-------------------------------------------------------------------- * Adjust this box so that only the coarse nodes inside the fine box * are extracted. *--------------------------------------------------------------------*/ - for (j= 0; j< ndim; j++) + for (j = 0; j < ndim; j++) { - k= hypre_BoxIMin(&box)[j] % rfactors[j]; + k = hypre_BoxIMin(&box)[j] % rfactors[j]; if (k) { - hypre_BoxIMin(&box)[j]+= rfactors[j] - k; + hypre_BoxIMin(&box)[j] += rfactors[j] - k; } } @@ -359,8 +360,8 @@ hypre_FacSemiInterpSetup2( void *fac_interp_vdata, hypre_BoxManIntersect(boxman1, hypre_BoxIMin(&scaled_box), hypre_BoxIMax(&scaled_box), &boxman_entries, &nboxman_entries); - cnt1= 0; cnt2= 0; - for (i= 0; i< nboxman_entries; i++) + cnt1 = 0; cnt2 = 0; + for (i = 0; i < nboxman_entries; i++) { hypre_SStructBoxManEntryGetProcess(boxman_entries[i], &proc); if (proc == myproc) @@ -374,11 +375,11 @@ hypre_FacSemiInterpSetup2( void *fac_interp_vdata, } own_cboxnums[vars][fi] = hypre_CTAlloc(HYPRE_Int, cnt1, HYPRE_MEMORY_HOST); - recv_processes[vars][fi]= hypre_CTAlloc(HYPRE_Int, cnt2, HYPRE_MEMORY_HOST); - recv_remote_boxnums[vars][fi]= hypre_CTAlloc(HYPRE_Int , cnt2, HYPRE_MEMORY_HOST); + recv_processes[vars][fi] = hypre_CTAlloc(HYPRE_Int, cnt2, HYPRE_MEMORY_HOST); + recv_remote_boxnums[vars][fi] = hypre_CTAlloc(HYPRE_Int, cnt2, HYPRE_MEMORY_HOST); - cnt1= 0; cnt2= 0; - for (i= 0; i< nboxman_entries; i++) + cnt1 = 0; cnt2 = 0; + for (i = 0; i < nboxman_entries; i++) { hypre_BoxManEntryGetExtents(boxman_entries[i], ilower, iupper); hypre_BoxSetExtents(&box, ilower, iupper); @@ -402,7 +403,7 @@ hypre_FacSemiInterpSetup2( void *fac_interp_vdata, hypre_AppendBox(&box, hypre_BoxArrayArrayBoxArray(recv_boxes[vars], fi)); - recv_processes[vars][fi][cnt2]= proc; + recv_processes[vars][fi][cnt2] = proc; cnt2++; } } @@ -410,8 +411,8 @@ hypre_FacSemiInterpSetup2( void *fac_interp_vdata, } /* hypre_ForBoxI(fi, boxarray) */ } /* for (vars= 0; vars< nvars; vars++) */ - (fac_interp_data -> ownboxes)= ownboxes; - (fac_interp_data -> own_cboxnums)= own_cboxnums; + (fac_interp_data -> ownboxes) = ownboxes; + (fac_interp_data -> own_cboxnums) = own_cboxnums; /*-------------------------------------------------------------------------- * With the recv'ed boxes form a SStructPGrid and a SStructGrid. The @@ -423,31 +424,31 @@ hypre_FacSemiInterpSetup2( void *fac_interp_vdata, HYPRE_SStructGridCreate(hypre_SStructPVectorComm(ec), ndim, 1, &temp_grid); hypre_SStructPGridCreate(hypre_SStructPVectorComm(ec), ndim, &recv_cgrid); - recv_boxnum_map= hypre_CTAlloc(HYPRE_Int *, nvars, HYPRE_MEMORY_HOST); + recv_boxnum_map = hypre_CTAlloc(HYPRE_Int *, nvars, HYPRE_MEMORY_HOST); - cnt2= 0; + cnt2 = 0; hypre_ClearIndex(index); - for (i= 0; i< ndim; i++) + for (i = 0; i < ndim; i++) { - index[i]= 1; + index[i] = 1; } - for (vars= 0; vars< nvars; vars++) + for (vars = 0; vars < nvars; vars++) { - cnt1= 0; + cnt1 = 0; hypre_ForBoxArrayI(i, recv_boxes[vars]) { - boxarray= hypre_BoxArrayArrayBoxArray(recv_boxes[vars], i); - cnt1+= hypre_BoxArraySize(boxarray); + boxarray = hypre_BoxArrayArrayBoxArray(recv_boxes[vars], i); + cnt1 += hypre_BoxArraySize(boxarray); } - recv_boxnum_map[vars]= hypre_CTAlloc(HYPRE_Int, cnt1, HYPRE_MEMORY_HOST); + recv_boxnum_map[vars] = hypre_CTAlloc(HYPRE_Int, cnt1, HYPRE_MEMORY_HOST); - cnt1= 0; + cnt1 = 0; hypre_ForBoxArrayI(i, recv_boxes[vars]) { - boxarray= hypre_BoxArrayArrayBoxArray(recv_boxes[vars], i); + boxarray = hypre_BoxArrayArrayBoxArray(recv_boxes[vars], i); hypre_ForBoxI(j, boxarray) { - box= *hypre_BoxArrayBox(boxarray, j); + box = *hypre_BoxArrayBox(boxarray, j); /* contract the box its actual size. */ hypre_AddIndexes(hypre_BoxIMin(&box), index, 3, hypre_BoxIMin(&box)); @@ -462,7 +463,7 @@ hypre_FacSemiInterpSetup2( void *fac_interp_vdata, hypre_BoxIMin(&box), hypre_BoxIMax(&box)); - recv_boxnum_map[vars][cnt1]= i; /* record the fbox num. i */ + recv_boxnum_map[vars][cnt1] = i; /* record the fbox num. i */ cnt1++; cnt2++; } @@ -501,7 +502,7 @@ hypre_FacSemiInterpSetup2( void *fac_interp_vdata, hypre_SStructPVectorAssemble(recv_cvectors); fac_interp_data -> recv_cvectors = recv_cvectors; - fac_interp_data -> recv_boxnum_map= recv_boxnum_map; + fac_interp_data -> recv_boxnum_map = recv_boxnum_map; /* pgrid recv_cgrid no longer needed. */ hypre_SStructPGridDestroy(recv_cgrid); @@ -516,40 +517,41 @@ hypre_FacSemiInterpSetup2( void *fac_interp_vdata, * will be on the processor. Also, note that the remote_boxnums are * with respect to the recv_cgrid box numbering. *--------------------------------------------------------------------------*/ - send_boxes= hypre_CTAlloc(hypre_BoxArrayArray *, nvars, HYPRE_MEMORY_HOST); - send_processes= hypre_CTAlloc(HYPRE_Int **, nvars, HYPRE_MEMORY_HOST); - send_remote_boxnums= hypre_CTAlloc(HYPRE_Int **, nvars, HYPRE_MEMORY_HOST); + send_boxes = hypre_CTAlloc(hypre_BoxArrayArray *, nvars, HYPRE_MEMORY_HOST); + send_processes = hypre_CTAlloc(HYPRE_Int **, nvars, HYPRE_MEMORY_HOST); + send_remote_boxnums = hypre_CTAlloc(HYPRE_Int **, nvars, HYPRE_MEMORY_HOST); hypre_ClearIndex(index); - for (i= 0; i< ndim; i++) + for (i = 0; i < ndim; i++) { - index[i]= 1; + index[i] = 1; } - for (vars= 0; vars< nvars; vars++) + for (vars = 0; vars < nvars; vars++) { /*------------------------------------------------------------------- * send boxes: intersect with temp_grid that has all the recv boxes- * These local box_nums may not be the same as the local box_nums of * the coarse grid. *-------------------------------------------------------------------*/ - boxman1= hypre_SStructGridBoxManager(temp_grid, 0, vars); - pgrid= hypre_SStructPVectorPGrid(ec); - boxarray= hypre_StructGridBoxes(hypre_SStructPGridSGrid(pgrid, vars)); + boxman1 = hypre_SStructGridBoxManager(temp_grid, 0, vars); + pgrid = hypre_SStructPVectorPGrid(ec); + boxarray = hypre_StructGridBoxes(hypre_SStructPGridSGrid(pgrid, vars)); - send_boxes[vars]= hypre_BoxArrayArrayCreate(hypre_BoxArraySize(boxarray), ndim); - send_processes[vars]= hypre_CTAlloc(HYPRE_Int *, hypre_BoxArraySize(boxarray), HYPRE_MEMORY_HOST); - send_remote_boxnums[vars]= hypre_CTAlloc(HYPRE_Int *, hypre_BoxArraySize(boxarray), HYPRE_MEMORY_HOST); + send_boxes[vars] = hypre_BoxArrayArrayCreate(hypre_BoxArraySize(boxarray), ndim); + send_processes[vars] = hypre_CTAlloc(HYPRE_Int *, hypre_BoxArraySize(boxarray), HYPRE_MEMORY_HOST); + send_remote_boxnums[vars] = hypre_CTAlloc(HYPRE_Int *, hypre_BoxArraySize(boxarray), + HYPRE_MEMORY_HOST); hypre_ForBoxI(ci, boxarray) { - box= *hypre_BoxArrayBox(boxarray, ci); + box = *hypre_BoxArrayBox(boxarray, ci); hypre_BoxSetExtents(&scaled_box, hypre_BoxIMin(&box), hypre_BoxIMax(&box)); hypre_BoxManIntersect(boxman1, hypre_BoxIMin(&scaled_box), hypre_BoxIMax(&scaled_box), &boxman_entries, &nboxman_entries); - cnt1= 0; - for (i= 0; i< nboxman_entries; i++) + cnt1 = 0; + for (i = 0; i < nboxman_entries; i++) { hypre_SStructBoxManEntryGetProcess(boxman_entries[i], &proc); if (proc != myproc) @@ -558,10 +560,10 @@ hypre_FacSemiInterpSetup2( void *fac_interp_vdata, } } send_processes[vars][ci] = hypre_CTAlloc(HYPRE_Int, cnt1, HYPRE_MEMORY_HOST); - send_remote_boxnums[vars][ci]= hypre_CTAlloc(HYPRE_Int, cnt1, HYPRE_MEMORY_HOST); + send_remote_boxnums[vars][ci] = hypre_CTAlloc(HYPRE_Int, cnt1, HYPRE_MEMORY_HOST); - cnt1= 0; - for (i= 0; i< nboxman_entries; i++) + cnt1 = 0; + for (i = 0; i < nboxman_entries; i++) { hypre_BoxManEntryGetExtents(boxman_entries[i], ilower, iupper); hypre_BoxSetExtents(&box, ilower, iupper); @@ -578,7 +580,7 @@ hypre_FacSemiInterpSetup2( void *fac_interp_vdata, hypre_AppendBox(&box, hypre_BoxArrayArrayBoxArray(send_boxes[vars], ci)); - send_processes[vars][ci][cnt1]= proc; + send_processes[vars][ci][cnt1] = proc; hypre_SStructBoxManEntryGetBoxnum( boxman_entries[i], &send_remote_boxnums[vars][ci][cnt1]); cnt1++; @@ -597,16 +599,16 @@ hypre_FacSemiInterpSetup2( void *fac_interp_vdata, /*-------------------------------------------------------------------------- * Can create the interlevel_comm. *--------------------------------------------------------------------------*/ - interlevel_comm= hypre_CTAlloc(hypre_CommPkg *, nvars, HYPRE_MEMORY_HOST); + interlevel_comm = hypre_CTAlloc(hypre_CommPkg *, nvars, HYPRE_MEMORY_HOST); - num_values= 1; - for (vars= 0; vars< nvars; vars++) + num_values = 1; + for (vars = 0; vars < nvars; vars++) { - s_rc= hypre_SStructPVectorSVector(ec, vars); + s_rc = hypre_SStructPVectorSVector(ec, vars); - s_cvector= hypre_SStructPVectorSVector(recv_cvectors, vars); - send_rboxes= hypre_BoxArrayArrayDuplicate(send_boxes[vars]); - recv_rboxes= hypre_BoxArrayArrayDuplicate(recv_boxes[vars]); + s_cvector = hypre_SStructPVectorSVector(recv_cvectors, vars); + send_rboxes = hypre_BoxArrayArrayDuplicate(send_boxes[vars]); + recv_rboxes = hypre_BoxArrayArrayDuplicate(recv_boxes[vars]); hypre_CommInfoCreate(send_boxes[vars], recv_boxes[vars], send_processes[vars], recv_processes[vars], @@ -628,36 +630,36 @@ hypre_FacSemiInterpSetup2( void *fac_interp_vdata, hypre_TFree(send_remote_boxnums, HYPRE_MEMORY_HOST); hypre_TFree(recv_remote_boxnums, HYPRE_MEMORY_HOST); - (fac_interp_data -> interlevel_comm)= interlevel_comm; + (fac_interp_data -> interlevel_comm) = interlevel_comm; /* interpolation weights */ - weights= hypre_TAlloc(HYPRE_Real *, ndim, HYPRE_MEMORY_HOST); - for (i= 0; i< ndim; i++) + weights = hypre_TAlloc(HYPRE_Real *, ndim, HYPRE_MEMORY_HOST); + for (i = 0; i < ndim; i++) { - weights[i]= hypre_CTAlloc(HYPRE_Real, rfactors[i]+1, HYPRE_MEMORY_HOST); + weights[i] = hypre_CTAlloc(HYPRE_Real, rfactors[i] + 1, HYPRE_MEMORY_HOST); } hypre_ClearIndex(refine_factors_half); -/* hypre_ClearIndex(refine_factors_2recp);*/ - for (i= 0; i< ndim; i++) + /* hypre_ClearIndex(refine_factors_2recp);*/ + for (i = 0; i < ndim; i++) { - refine_factors_half[i] = rfactors[i]/2; - refine_factors_2recp[i]= 1.0/(2.0*rfactors[i]); + refine_factors_half[i] = rfactors[i] / 2; + refine_factors_2recp[i] = 1.0 / (2.0 * rfactors[i]); } - for (i= 0; i< ndim; i++) + for (i = 0; i < ndim; i++) { - for (j= 0; j<= refine_factors_half[i]; j++) + for (j = 0; j <= refine_factors_half[i]; j++) { - weights[i][j]= refine_factors_2recp[i]*(rfactors[i] + 2*j - 1.0); + weights[i][j] = refine_factors_2recp[i] * (rfactors[i] + 2 * j - 1.0); } - for (j= (refine_factors_half[i]+1); j<= rfactors[i]; j++) + for (j = (refine_factors_half[i] + 1); j <= rfactors[i]; j++) { - weights[i][j]= refine_factors_2recp[i]*(2*j - rfactors[i] - 1.0); + weights[i][j] = refine_factors_2recp[i] * (2 * j - rfactors[i] - 1.0); } } - (fac_interp_data -> weights)= weights; + (fac_interp_data -> weights) = weights; return ierr; @@ -668,10 +670,10 @@ hypre_FAC_IdentityInterp2(void * fac_interp_vdata, hypre_SStructPVector * xc, hypre_SStructVector * e) { - hypre_FacSemiInterpData2 *interp_data= (hypre_FacSemiInterpData2 *)fac_interp_vdata; - hypre_BoxArrayArray **identity_boxes= interp_data-> identity_arrayboxes; + hypre_FacSemiInterpData2 *interp_data = (hypre_FacSemiInterpData2 *)fac_interp_vdata; + hypre_BoxArrayArray **identity_boxes = interp_data-> identity_arrayboxes; - HYPRE_Int part_crse= 0; + HYPRE_Int part_crse = 0; HYPRE_Int ierr = 0; @@ -701,9 +703,9 @@ hypre_FAC_WeightedInterp2(void *fac_interp_vdata, hypre_FacSemiInterpData2 *interp_data = (hypre_FacSemiInterpData2 *)fac_interp_vdata; hypre_CommPkg **comm_pkg = interp_data-> gnodes_comm_pkg; - hypre_CommPkg **interlevel_comm= interp_data-> interlevel_comm; + hypre_CommPkg **interlevel_comm = interp_data-> interlevel_comm; hypre_SStructPVector *recv_cvectors = interp_data-> recv_cvectors; - HYPRE_Int **recv_boxnum_map= interp_data-> recv_boxnum_map; + HYPRE_Int **recv_boxnum_map = interp_data-> recv_boxnum_map; hypre_BoxArrayArray **ownboxes = interp_data-> ownboxes; HYPRE_Int ***own_cboxnums = interp_data-> own_cboxnums; HYPRE_Real **weights = interp_data-> weights; @@ -750,16 +752,16 @@ hypre_FAC_WeightedInterp2(void *fac_interp_vdata, HYPRE_Int nvars, var; HYPRE_Int i, j, k, offset_ip1, offset_jp1, offset_kp1; - HYPRE_Int ishift, jshift, kshift; + HYPRE_Int ishift, jshift = 0, kshift = 0; HYPRE_Int ptr_ishift, ptr_jshift, ptr_kshift; HYPRE_Int imax, jmax, kmax; HYPRE_Int jsize, ksize; - HYPRE_Int part_fine= 1; + HYPRE_Int part_fine = 1; HYPRE_Real xweight1, xweight2; - HYPRE_Real yweight1, yweight2; - HYPRE_Real zweight1, zweight2; + HYPRE_Real yweight1 = 0.0, yweight2 = 0.0; + HYPRE_Real zweight1 = 0.0, zweight2 = 0.0; /*----------------------------------------------------------------------- * Initialize some things @@ -768,18 +770,19 @@ hypre_FAC_WeightedInterp2(void *fac_interp_vdata, hypre_BoxInit(&refined_box, ndim); hypre_BoxInit(&intersect_box, ndim); - stride = (interp_data -> stride); + stride = (interp_data -> stride); hypre_SetIndex3(zero_index, 0, 0, 0); + hypre_SetIndex3(lindex, 0, 0, 0); hypre_CopyIndex(stride, refine_factors); - for (i= ndim; i< 3; i++) + for (i = ndim; i < 3; i++) { - refine_factors[i]= 1; + refine_factors[i] = 1; } hypre_SetIndex3(stridec, 1, 1, 1); - for (i= 0; i< ndim; i++) + for (i = 0; i < ndim; i++) { - refine_factors_half[i]= refine_factors[i]/2; + refine_factors_half[i] = refine_factors[i] / 2; } /*----------------------------------------------------------------------- @@ -787,10 +790,10 @@ hypre_FAC_WeightedInterp2(void *fac_interp_vdata, * data. Will need a ghostlayer communication on the given level and an * interlevel communication between levels. *-----------------------------------------------------------------------*/ - nvars= hypre_SStructPVectorNVars(xc); - for (var= 0; var< nvars; var++) + nvars = hypre_SStructPVectorNVars(xc); + for (var = 0; var < nvars; var++) { - xc_var= hypre_SStructPVectorSVector(xc, var); + xc_var = hypre_SStructPVectorSVector(xc, var); hypre_InitializeCommunication(comm_pkg[var], hypre_StructVectorData(xc_var), hypre_StructVectorData(xc_var), 0, 0, @@ -799,7 +802,7 @@ hypre_FAC_WeightedInterp2(void *fac_interp_vdata, if (recv_cvectors != NULL) { - recv_var= hypre_SStructPVectorSVector(recv_cvectors, var); + recv_var = hypre_SStructPVectorSVector(recv_cvectors, var); hypre_InitializeCommunication(interlevel_comm[var], hypre_StructVectorData(xc_var), hypre_StructVectorData(recv_var), 0, 0, @@ -808,7 +811,7 @@ hypre_FAC_WeightedInterp2(void *fac_interp_vdata, } } - e= hypre_SStructVectorPVector(e_parts, part_fine); + e = hypre_SStructVectorPVector(e_parts, part_fine); /*----------------------------------------------------------------------- * Allocate memory for the data pointers. Assuming linear interpolation. @@ -822,74 +825,74 @@ hypre_FAC_WeightedInterp2(void *fac_interp_vdata, * ndim= 2 kplane= 0 & jplane= 0,1,2 **ptr size [1][3] * ndim= 1 kplane= 0 & jplane= 0 **ptr size [1][1] *-----------------------------------------------------------------------*/ - ksize= 3; - jsize= 3; + ksize = 3; + jsize = 3; if (ndim < 3) { - ksize= 1; + ksize = 1; } if (ndim < 2) { - jsize= 1; + jsize = 1; } xcp = hypre_TAlloc(HYPRE_Real **, ksize, HYPRE_MEMORY_HOST); ep = hypre_TAlloc(HYPRE_Real **, refine_factors[2], HYPRE_MEMORY_HOST); - for (k= 0; k< refine_factors[2]; k++) + for (k = 0; k < refine_factors[2]; k++) { - ep[k]= hypre_TAlloc(HYPRE_Real *, refine_factors[1], HYPRE_MEMORY_HOST); + ep[k] = hypre_TAlloc(HYPRE_Real *, refine_factors[1], HYPRE_MEMORY_HOST); } - for (k= 0; k< ksize; k++) + for (k = 0; k < ksize; k++) { - xcp[k]= hypre_TAlloc(HYPRE_Real *, jsize, HYPRE_MEMORY_HOST); + xcp[k] = hypre_TAlloc(HYPRE_Real *, jsize, HYPRE_MEMORY_HOST); } - for (var= 0; var< nvars; var++) + for (var = 0; var < nvars; var++) { - xc_var= hypre_SStructPVectorSVector(xc, var); + xc_var = hypre_SStructPVectorSVector(xc, var); e_var = hypre_SStructPVectorSVector(e, var); fgrid = hypre_StructVectorGrid(e_var); - fgrid_boxes= hypre_StructGridBoxes(fgrid); + fgrid_boxes = hypre_StructGridBoxes(fgrid); own_cboxes = ownboxes[var]; - var_boxnums= own_cboxnums[var]; + var_boxnums = own_cboxnums[var]; /*-------------------------------------------------------------------- * Interpolate the own_box coarse grid values. *--------------------------------------------------------------------*/ hypre_ForBoxI(fi, fgrid_boxes) { - fbox= hypre_BoxArrayBox(fgrid_boxes, fi); + fbox = hypre_BoxArrayBox(fgrid_boxes, fi); - e_dbox= hypre_BoxArrayBox(hypre_StructVectorDataSpace(e_var), fi); - own_abox= hypre_BoxArrayArrayBoxArray(own_cboxes, fi); - cboxnums= var_boxnums[fi]; + e_dbox = hypre_BoxArrayBox(hypre_StructVectorDataSpace(e_var), fi); + own_abox = hypre_BoxArrayArrayBoxArray(own_cboxes, fi); + cboxnums = var_boxnums[fi]; /*-------------------------------------------------------------------- * Get the ptrs for the fine struct_vectors. *--------------------------------------------------------------------*/ - for (k= 0; k< refine_factors[2]; k++) + for (k = 0; k < refine_factors[2]; k++) { - for (j=0; j< refine_factors[1]; j++) + for (j = 0; j < refine_factors[1]; j++) { hypre_SetIndex3(temp_index1, 0, j, k); - ep[k][j]= hypre_StructVectorBoxData(e_var, fi) + - hypre_BoxOffsetDistance(e_dbox, temp_index1); + ep[k][j] = hypre_StructVectorBoxData(e_var, fi) + + hypre_BoxOffsetDistance(e_dbox, temp_index1); } } hypre_ForBoxI(bi, own_abox) { - ownbox= hypre_BoxArrayBox(own_abox, bi); + ownbox = hypre_BoxArrayBox(own_abox, bi); hypre_StructMapCoarseToFine(hypre_BoxIMin(ownbox), zero_index, refine_factors, hypre_BoxIMin(&refined_box)); hypre_ClearIndex(temp_index1); - for (j= 0; j< ndim; j++) + for (j = 0; j < ndim; j++) { - temp_index1[j]= refine_factors[j]-1; + temp_index1[j] = refine_factors[j] - 1; } hypre_StructMapCoarseToFine(hypre_BoxIMax(ownbox), temp_index1, refine_factors, hypre_BoxIMax(&refined_box)); @@ -908,9 +911,9 @@ hypre_FAC_WeightedInterp2(void *fac_interp_vdata, *-----------------------------------------------------------------*/ hypre_CopyIndex(hypre_BoxIMin(&intersect_box), start); hypre_CopyIndex(hypre_BoxIMax(&intersect_box), intersect_size); - for (i= 0; i< 3; i++) + for (i = 0; i < 3; i++) { - intersect_size[i]-= (start[i]-1); + intersect_size[i] -= (start[i] - 1); } /*------------------------------------------------------------------ @@ -923,36 +926,36 @@ hypre_FAC_WeightedInterp2(void *fac_interp_vdata, * by refine_factors. We do the calculation anyways for future changes. *------------------------------------------------------------------*/ hypre_ClearIndex(start_offset); - for (i= 0; i< ndim; i++) + for (i = 0; i < ndim; i++) { - start_offset[i]= start[i] % refine_factors[i]; + start_offset[i] = start[i] % refine_factors[i]; } - ptr_kshift= 0; - if ( (start[2]%refine_factors[2] < refine_factors_half[2]) && ndim == 3 ) + ptr_kshift = 0; + if ( (start[2] % refine_factors[2] < refine_factors_half[2]) && ndim == 3 ) { - ptr_kshift= -1; + ptr_kshift = -1; } - ptr_jshift= 0; - if ( start[1]%refine_factors[1] < refine_factors_half[1] && ndim >= 2 ) + ptr_jshift = 0; + if ( start[1] % refine_factors[1] < refine_factors_half[1] && ndim >= 2 ) { - ptr_jshift= -1; + ptr_jshift = -1; } - ptr_ishift= 0; - if ( start[0]%refine_factors[0] < refine_factors_half[0] ) + ptr_ishift = 0; + if ( start[0] % refine_factors[0] < refine_factors_half[0] ) { - ptr_ishift= -1; + ptr_ishift = -1; } - for (k= 0; k< ksize; k++) + for (k = 0; k < ksize; k++) { - for (j=0; j< jsize; j++) + for (j = 0; j < jsize; j++) { - hypre_SetIndex3(temp_index2, ptr_ishift, j+ptr_jshift, k+ptr_kshift); - xcp[k][j]= hypre_StructVectorBoxData(xc_var, cboxnums[bi]) + - hypre_BoxOffsetDistance(xc_dbox, temp_index2); + hypre_SetIndex3(temp_index2, ptr_ishift, j + ptr_jshift, k + ptr_kshift); + xcp[k][j] = hypre_StructVectorBoxData(xc_var, cboxnums[bi]) + + hypre_BoxOffsetDistance(xc_dbox, temp_index2); } } @@ -971,95 +974,94 @@ hypre_FAC_WeightedInterp2(void *fac_interp_vdata, * extents are needed. *--------------------------------------------------------*/ zypre_BoxLoopGetIndex(lindex); - imax= hypre_min( (intersect_size[0]-lindex[0]*stride[0]), - refine_factors[0] ); - jmax= hypre_min( (intersect_size[1]-lindex[1]*stride[1]), - refine_factors[1]); - kmax= hypre_min( (intersect_size[2]-lindex[2]*stride[2]), - refine_factors[2]); - - for (k= 0; k< kmax; k++) + imax = hypre_min( (intersect_size[0] - lindex[0] * stride[0]), + refine_factors[0] ); + jmax = hypre_min( (intersect_size[1] - lindex[1] * stride[1]), + refine_factors[1]); + kmax = hypre_min( (intersect_size[2] - lindex[2] * stride[2]), + refine_factors[2]); + + for (k = 0; k < kmax; k++) { if (ndim == 3) { - offset_kp1= start_offset[2]+k+1; + offset_kp1 = start_offset[2] + k + 1; if (ptr_kshift == -1) { if (offset_kp1 <= refine_factors_half[2]) { - zweight2= weights[2][offset_kp1]; - kshift= 0; + zweight2 = weights[2][offset_kp1]; + kshift = 0; } else { - kshift= 1; + kshift = 1; if (offset_kp1 > refine_factors_half[2] && offset_kp1 <= refine_factors[2]) { - zweight2= weights[2][offset_kp1]; + zweight2 = weights[2][offset_kp1]; } else { - zweight2= weights[2][offset_kp1-refine_factors[2]]; + zweight2 = weights[2][offset_kp1 - refine_factors[2]]; } } - zweight1= 1.0 - zweight2; + zweight1 = 1.0 - zweight2; } - else { if (offset_kp1 > refine_factors_half[2] && offset_kp1 <= refine_factors[2]) { - zweight2= weights[2][offset_kp1]; - kshift= 0; + zweight2 = weights[2][offset_kp1]; + kshift = 0; } else { - kshift= 0; - offset_kp1-= refine_factors[2]; + kshift = 0; + offset_kp1 -= refine_factors[2]; if (offset_kp1 > 0 && offset_kp1 <= refine_factors_half[2]) { - zweight2= weights[2][offset_kp1]; + zweight2 = weights[2][offset_kp1]; } else { - zweight2= weights[2][offset_kp1]; + zweight2 = weights[2][offset_kp1]; kshift = 1; } } - zweight1= 1.0 - zweight2; + zweight1 = 1.0 - zweight2; } } /* if (ndim == 3) */ - for (j= 0; j< jmax; j++) + for (j = 0; j < jmax; j++) { if (ndim >= 2) { - offset_jp1= start_offset[1]+j+1; + offset_jp1 = start_offset[1] + j + 1; if (ptr_jshift == -1) { if (offset_jp1 <= refine_factors_half[1]) { - yweight2= weights[1][offset_jp1]; - jshift= 0; + yweight2 = weights[1][offset_jp1]; + jshift = 0; } else { - jshift= 1; + jshift = 1; if (offset_jp1 > refine_factors_half[1] && offset_jp1 <= refine_factors[1]) { - yweight2= weights[1][offset_jp1]; + yweight2 = weights[1][offset_jp1]; } else { - yweight2= weights[1][offset_jp1-refine_factors[1]]; + yweight2 = weights[1][offset_jp1 - refine_factors[1]]; } } - yweight1= 1.0 - yweight2; + yweight1 = 1.0 - yweight2; } else @@ -1067,52 +1069,52 @@ hypre_FAC_WeightedInterp2(void *fac_interp_vdata, if (offset_jp1 > refine_factors_half[1] && offset_jp1 <= refine_factors[1]) { - yweight2= weights[1][offset_jp1]; - jshift= 0; + yweight2 = weights[1][offset_jp1]; + jshift = 0; } else { - jshift= 0; - offset_jp1-= refine_factors[1]; + jshift = 0; + offset_jp1 -= refine_factors[1]; if (offset_jp1 > 0 && offset_jp1 <= refine_factors_half[1]) { - yweight2= weights[1][offset_jp1]; + yweight2 = weights[1][offset_jp1]; } else { - yweight2= weights[1][offset_jp1]; + yweight2 = weights[1][offset_jp1]; jshift = 1; } } - yweight1= 1.0 - yweight2; + yweight1 = 1.0 - yweight2; } } /* if (ndim >= 2) */ - for (i= 0; i< imax; i++) + for (i = 0; i < imax; i++) { - offset_ip1= start_offset[0]+i+1; + offset_ip1 = start_offset[0] + i + 1; if (ptr_ishift == -1) { if (offset_ip1 <= refine_factors_half[0]) { - xweight2= weights[0][offset_ip1]; - ishift= 0; + xweight2 = weights[0][offset_ip1]; + ishift = 0; } else { - ishift= 1; + ishift = 1; if (offset_ip1 > refine_factors_half[0] && offset_ip1 <= refine_factors[0]) { - xweight2= weights[0][offset_ip1]; + xweight2 = weights[0][offset_ip1]; } else { - xweight2= weights[0][offset_ip1-refine_factors[0]]; + xweight2 = weights[0][offset_ip1 - refine_factors[0]]; } } - xweight1= 1.0 - xweight2; + xweight1 = 1.0 - xweight2; } else @@ -1120,56 +1122,56 @@ hypre_FAC_WeightedInterp2(void *fac_interp_vdata, if (offset_ip1 > refine_factors_half[0] && offset_ip1 <= refine_factors[0]) { - xweight2= weights[0][offset_ip1]; - ishift= 0; + xweight2 = weights[0][offset_ip1]; + ishift = 0; } else { - ishift= 0; - offset_ip1-= refine_factors[0]; + ishift = 0; + offset_ip1 -= refine_factors[0]; if (offset_ip1 > 0 && offset_ip1 <= refine_factors_half[0]) { - xweight2= weights[0][offset_ip1]; + xweight2 = weights[0][offset_ip1]; } else { - xweight2= weights[0][offset_ip1]; + xweight2 = weights[0][offset_ip1]; ishift = 1; } } - xweight1= 1.0 - xweight2; + xweight1 = 1.0 - xweight2; } if (ndim == 3) { - ep[k][j][ei+i]= zweight1*( - yweight1*( - xweight1*xcp[kshift][jshift][ishift+xci]+ - xweight2*xcp[kshift][jshift][ishift+xci+1]) - +yweight2*( - xweight1*xcp[kshift][jshift+1][ishift+xci]+ - xweight2*xcp[kshift][jshift+1][ishift+xci+1]) ) - + zweight2*( - yweight1*( - xweight1*xcp[kshift+1][jshift][ishift+xci]+ - xweight2*xcp[kshift+1][jshift][ishift+xci+1]) - +yweight2*( - xweight1*xcp[kshift+1][jshift+1][ishift+xci]+ - xweight2*xcp[kshift+1][jshift+1][ishift+xci+1]) ); + ep[k][j][ei + i] = zweight1 * ( + yweight1 * ( + xweight1 * xcp[kshift][jshift][ishift + xci] + + xweight2 * xcp[kshift][jshift][ishift + xci + 1]) + + yweight2 * ( + xweight1 * xcp[kshift][jshift + 1][ishift + xci] + + xweight2 * xcp[kshift][jshift + 1][ishift + xci + 1]) ) + + zweight2 * ( + yweight1 * ( + xweight1 * xcp[kshift + 1][jshift][ishift + xci] + + xweight2 * xcp[kshift + 1][jshift][ishift + xci + 1]) + + yweight2 * ( + xweight1 * xcp[kshift + 1][jshift + 1][ishift + xci] + + xweight2 * xcp[kshift + 1][jshift + 1][ishift + xci + 1]) ); } else if (ndim == 2) { - ep[0][j][ei+i] = yweight1*( - xweight1*xcp[0][jshift][ishift+xci]+ - xweight2*xcp[0][jshift][ishift+xci+1]); - ep[0][j][ei+i]+= yweight2*( - xweight1*xcp[0][jshift+1][ishift+xci]+ - xweight2*xcp[0][jshift+1][ishift+xci+1]); + ep[0][j][ei + i] = yweight1 * ( + xweight1 * xcp[0][jshift][ishift + xci] + + xweight2 * xcp[0][jshift][ishift + xci + 1]); + ep[0][j][ei + i] += yweight2 * ( + xweight1 * xcp[0][jshift + 1][ishift + xci] + + xweight2 * xcp[0][jshift + 1][ishift + xci + 1]); } else { - ep[0][0][ei+i] = xweight1*xcp[0][0][ishift+xci]+ - xweight2*xcp[0][0][ishift+xci+1]; + ep[0][0][ei + i] = xweight1 * xcp[0][0][ishift + xci] + + xweight2 * xcp[0][0][ishift + xci + 1]; } } /* for (i= 0; i< imax; i++) */ } /* for (j= 0; j< jmax; j++) */ @@ -1192,37 +1194,37 @@ hypre_FAC_WeightedInterp2(void *fac_interp_vdata, hypre_ForBoxI(bi, own_abox) { - ownbox= hypre_BoxArrayBox(own_abox, bi); + ownbox = hypre_BoxArrayBox(own_abox, bi); /*check for boxes of volume zero- i.e., recv_cvectors is really null.*/ if (hypre_BoxVolume(ownbox)) { - xc_dbox= hypre_BoxArrayBox( - hypre_StructVectorDataSpace(recv_var), bi); + xc_dbox = hypre_BoxArrayBox( + hypre_StructVectorDataSpace(recv_var), bi); - fi= cboxnums[bi]; + fi = cboxnums[bi]; fbox = hypre_BoxArrayBox(fgrid_boxes, fi); - e_dbox= hypre_BoxArrayBox(hypre_StructVectorDataSpace(e_var), fi); + e_dbox = hypre_BoxArrayBox(hypre_StructVectorDataSpace(e_var), fi); /*------------------------------------------------------------------ * Get the ptrs for the fine struct_vectors. *------------------------------------------------------------------*/ - for (k= 0; k< refine_factors[2]; k++) + for (k = 0; k < refine_factors[2]; k++) { - for (j=0; j< refine_factors[1]; j++) + for (j = 0; j < refine_factors[1]; j++) { hypre_SetIndex3(temp_index1, 0, j, k); - ep[k][j]= hypre_StructVectorBoxData(e_var, fi) + - hypre_BoxOffsetDistance(e_dbox, temp_index1); + ep[k][j] = hypre_StructVectorBoxData(e_var, fi) + + hypre_BoxOffsetDistance(e_dbox, temp_index1); } } hypre_StructMapCoarseToFine(hypre_BoxIMin(ownbox), zero_index, refine_factors, hypre_BoxIMin(&refined_box)); hypre_ClearIndex(temp_index1); - for (j= 0; j< ndim; j++) + for (j = 0; j < ndim; j++) { - temp_index1[j]= refine_factors[j]-1; + temp_index1[j] = refine_factors[j] - 1; } hypre_StructMapCoarseToFine(hypre_BoxIMax(ownbox), temp_index1, refine_factors, hypre_BoxIMax(&refined_box)); @@ -1238,9 +1240,9 @@ hypre_FAC_WeightedInterp2(void *fac_interp_vdata, *-----------------------------------------------------------------*/ hypre_CopyIndex(hypre_BoxIMin(&intersect_box), start); hypre_CopyIndex(hypre_BoxIMax(&intersect_box), intersect_size); - for (i= 0; i< 3; i++) + for (i = 0; i < 3; i++) { - intersect_size[i]-= (start[i]-1); + intersect_size[i] -= (start[i] - 1); } /*------------------------------------------------------------------ @@ -1253,37 +1255,37 @@ hypre_FAC_WeightedInterp2(void *fac_interp_vdata, * by refine_factors. We do the calculation anyways for future changes. *------------------------------------------------------------------*/ hypre_ClearIndex(start_offset); - for (i= 0; i< ndim; i++) + for (i = 0; i < ndim; i++) { - start_offset[i]= start[i] % refine_factors[i]; + start_offset[i] = start[i] % refine_factors[i]; } - ptr_kshift= 0; - if ((start[2]%refine_factors[2]=2) + ptr_jshift = 0; + if ((start[1] % refine_factors[1] < refine_factors_half[1]) && ndim >= 2) { - ptr_jshift= -1; + ptr_jshift = -1; } - ptr_ishift= 0; - if ( start[0]%refine_factors[0] < refine_factors_half[0] ) + ptr_ishift = 0; + if ( start[0] % refine_factors[0] < refine_factors_half[0] ) { - ptr_ishift= -1; + ptr_ishift = -1; } - for (k= 0; k< ksize; k++) + for (k = 0; k < ksize; k++) { - for (j=0; j< jsize; j++) + for (j = 0; j < jsize; j++) { hypre_SetIndex3(temp_index2, - ptr_ishift, j+ptr_jshift, k+ptr_kshift); - xcp[k][j]= hypre_StructVectorBoxData(recv_var, bi) + - hypre_BoxOffsetDistance(xc_dbox, temp_index2); + ptr_ishift, j + ptr_jshift, k + ptr_kshift); + xcp[k][j] = hypre_StructVectorBoxData(recv_var, bi) + + hypre_BoxOffsetDistance(xc_dbox, temp_index2); } } @@ -1302,40 +1304,40 @@ hypre_FAC_WeightedInterp2(void *fac_interp_vdata, * extents are needed. *--------------------------------------------------------*/ zypre_BoxLoopGetIndex(lindex); - imax= hypre_min( (intersect_size[0]-lindex[0]*stride[0]), - refine_factors[0] ); - jmax= hypre_min( (intersect_size[1]-lindex[1]*stride[1]), - refine_factors[1]); - kmax= hypre_min( (intersect_size[2]-lindex[2]*stride[2]), - refine_factors[2]); - - for (k= 0; k< kmax; k++) + imax = hypre_min( (intersect_size[0] - lindex[0] * stride[0]), + refine_factors[0] ); + jmax = hypre_min( (intersect_size[1] - lindex[1] * stride[1]), + refine_factors[1]); + kmax = hypre_min( (intersect_size[2] - lindex[2] * stride[2]), + refine_factors[2]); + + for (k = 0; k < kmax; k++) { if (ndim == 3) { - offset_kp1= start_offset[2]+k+1; + offset_kp1 = start_offset[2] + k + 1; if (ptr_kshift == -1) { if (offset_kp1 <= refine_factors_half[2]) { - zweight2= weights[2][offset_kp1]; - kshift= 0; + zweight2 = weights[2][offset_kp1]; + kshift = 0; } else { - kshift= 1; + kshift = 1; if (offset_kp1 > refine_factors_half[2] && offset_kp1 <= refine_factors[2]) { - zweight2= weights[2][offset_kp1]; + zweight2 = weights[2][offset_kp1]; } else { - zweight2= weights[2][offset_kp1-refine_factors[2]]; + zweight2 = weights[2][offset_kp1 - refine_factors[2]]; } } - zweight1= 1.0 - zweight2; + zweight1 = 1.0 - zweight2; } else @@ -1343,54 +1345,54 @@ hypre_FAC_WeightedInterp2(void *fac_interp_vdata, if (offset_kp1 > refine_factors_half[2] && offset_kp1 <= refine_factors[2]) { - zweight2= weights[2][offset_kp1]; - kshift= 0; + zweight2 = weights[2][offset_kp1]; + kshift = 0; } else { - kshift= 0; - offset_kp1-= refine_factors[2]; + kshift = 0; + offset_kp1 -= refine_factors[2]; if (offset_kp1 > 0 && offset_kp1 <= refine_factors_half[2]) { - zweight2= weights[2][offset_kp1]; + zweight2 = weights[2][offset_kp1]; } else { - zweight2= weights[2][offset_kp1]; + zweight2 = weights[2][offset_kp1]; kshift = 1; } } - zweight1= 1.0 - zweight2; + zweight1 = 1.0 - zweight2; } } /* if (ndim == 3) */ - for (j= 0; j< jmax; j++) + for (j = 0; j < jmax; j++) { if (ndim >= 2) { - offset_jp1= start_offset[1]+j+1; + offset_jp1 = start_offset[1] + j + 1; if (ptr_jshift == -1) { if (offset_jp1 <= refine_factors_half[1]) { - yweight2= weights[1][offset_jp1]; - jshift= 0; + yweight2 = weights[1][offset_jp1]; + jshift = 0; } else { - jshift= 1; + jshift = 1; if (offset_jp1 > refine_factors_half[1] && offset_jp1 <= refine_factors[1]) { - yweight2= weights[1][offset_jp1]; + yweight2 = weights[1][offset_jp1]; } else { - yweight2= weights[1][offset_jp1-refine_factors[1]]; + yweight2 = weights[1][offset_jp1 - refine_factors[1]]; } } - yweight1= 1.0 - yweight2; + yweight1 = 1.0 - yweight2; } else @@ -1398,52 +1400,52 @@ hypre_FAC_WeightedInterp2(void *fac_interp_vdata, if (offset_jp1 > refine_factors_half[1] && offset_jp1 <= refine_factors[1]) { - yweight2= weights[1][offset_jp1]; - jshift= 0; + yweight2 = weights[1][offset_jp1]; + jshift = 0; } else { - jshift= 0; - offset_jp1-= refine_factors[1]; + jshift = 0; + offset_jp1 -= refine_factors[1]; if (offset_jp1 > 0 && offset_jp1 <= refine_factors_half[1]) { - yweight2= weights[1][offset_jp1]; + yweight2 = weights[1][offset_jp1]; } else { - yweight2= weights[1][offset_jp1]; + yweight2 = weights[1][offset_jp1]; jshift = 1; } } - yweight1= 1.0 - yweight2; + yweight1 = 1.0 - yweight2; } } /* if (ndim >= 2) */ - for (i= 0; i< imax; i++) + for (i = 0; i < imax; i++) { - offset_ip1= start_offset[0]+i+1; + offset_ip1 = start_offset[0] + i + 1; if (ptr_ishift == -1) { if (offset_ip1 <= refine_factors_half[0]) { - xweight2= weights[0][offset_ip1]; - ishift= 0; + xweight2 = weights[0][offset_ip1]; + ishift = 0; } else { - ishift= 1; + ishift = 1; if (offset_ip1 > refine_factors_half[0] && offset_ip1 <= refine_factors[0]) { - xweight2= weights[0][offset_ip1]; + xweight2 = weights[0][offset_ip1]; } else { - xweight2= weights[0][offset_ip1-refine_factors[0]]; + xweight2 = weights[0][offset_ip1 - refine_factors[0]]; } } - xweight1= 1.0 - xweight2; + xweight1 = 1.0 - xweight2; } else @@ -1451,58 +1453,58 @@ hypre_FAC_WeightedInterp2(void *fac_interp_vdata, if (offset_ip1 > refine_factors_half[0] && offset_ip1 <= refine_factors[0]) { - xweight2= weights[0][offset_ip1]; - ishift= 0; + xweight2 = weights[0][offset_ip1]; + ishift = 0; } else { - ishift= 0; - offset_ip1-= refine_factors[0]; + ishift = 0; + offset_ip1 -= refine_factors[0]; if (offset_ip1 > 0 && offset_ip1 <= refine_factors_half[0]) { - xweight2= weights[0][offset_ip1]; + xweight2 = weights[0][offset_ip1]; } else { - xweight2= weights[0][offset_ip1]; + xweight2 = weights[0][offset_ip1]; ishift = 1; } } - xweight1= 1.0 - xweight2; + xweight1 = 1.0 - xweight2; } if (ndim == 3) { - ep[k][j][ei+i]= zweight1*( - yweight1*( - xweight1*xcp[kshift][jshift][ishift+xci]+ - xweight2*xcp[kshift][jshift][ishift+xci+1]) - +yweight2*( - xweight1*xcp[kshift][jshift+1][ishift+xci]+ - xweight2*xcp[kshift][jshift+1][ishift+xci+1]) ) - + zweight2*( - yweight1*( - xweight1*xcp[kshift+1][jshift][ishift+xci]+ - xweight2*xcp[kshift+1][jshift][ishift+xci+1]) - +yweight2*( - xweight1*xcp[kshift+1][jshift+1][ishift+xci]+ - xweight2*xcp[kshift+1][jshift+1][ishift+xci+1]) ); + ep[k][j][ei + i] = zweight1 * ( + yweight1 * ( + xweight1 * xcp[kshift][jshift][ishift + xci] + + xweight2 * xcp[kshift][jshift][ishift + xci + 1]) + + yweight2 * ( + xweight1 * xcp[kshift][jshift + 1][ishift + xci] + + xweight2 * xcp[kshift][jshift + 1][ishift + xci + 1]) ) + + zweight2 * ( + yweight1 * ( + xweight1 * xcp[kshift + 1][jshift][ishift + xci] + + xweight2 * xcp[kshift + 1][jshift][ishift + xci + 1]) + + yweight2 * ( + xweight1 * xcp[kshift + 1][jshift + 1][ishift + xci] + + xweight2 * xcp[kshift + 1][jshift + 1][ishift + xci + 1]) ); } else if (ndim == 2) { - ep[0][j][ei+i] = yweight1*( - xweight1*xcp[0][jshift][ishift+xci]+ - xweight2*xcp[0][jshift][ishift+xci+1]); - ep[0][j][ei+i]+= yweight2*( - xweight1*xcp[0][jshift+1][ishift+xci]+ - xweight2*xcp[0][jshift+1][ishift+xci+1]); + ep[0][j][ei + i] = yweight1 * ( + xweight1 * xcp[0][jshift][ishift + xci] + + xweight2 * xcp[0][jshift][ishift + xci + 1]); + ep[0][j][ei + i] += yweight2 * ( + xweight1 * xcp[0][jshift + 1][ishift + xci] + + xweight2 * xcp[0][jshift + 1][ishift + xci + 1]); } else { - ep[0][0][ei+i] = xweight1*xcp[0][0][ishift+xci]+ - xweight2*xcp[0][0][ishift+xci+1]; + ep[0][0][ei + i] = xweight1 * xcp[0][0][ishift + xci] + + xweight2 * xcp[0][0][ishift + xci + 1]; } } /* for (i= 0; i< imax; i++) */ @@ -1515,13 +1517,13 @@ hypre_FAC_WeightedInterp2(void *fac_interp_vdata, } /* hypre_ForBoxI(bi, own_abox) */ } /* for (var= 0; var< nvars; var++)*/ - for (k= 0; k< ksize; k++) + for (k = 0; k < ksize; k++) { hypre_TFree(xcp[k], HYPRE_MEMORY_HOST); } hypre_TFree(xcp, HYPRE_MEMORY_HOST); - for (k= 0; k< refine_factors[2]; k++) + for (k = 0; k < refine_factors[2]; k++) { hypre_TFree(ep[k], HYPRE_MEMORY_HOST); } diff --git a/external/hypre/src/sstruct_ls/fac_relax.c b/external/hypre/src/sstruct_ls/fac_relax.c index 9f228d7d..b111ebe1 100644 --- a/external/hypre/src/sstruct_ls/fac_relax.c +++ b/external/hypre/src/sstruct_ls/fac_relax.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/sstruct_ls/fac_restrict2.c b/external/hypre/src/sstruct_ls/fac_restrict2.c index 935b6514..36b7bf45 100644 --- a/external/hypre/src/sstruct_ls/fac_restrict2.c +++ b/external/hypre/src/sstruct_ls/fac_restrict2.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -55,9 +55,9 @@ typedef struct HYPRE_Int ***own_cboxnums; /* local crs boxnums of ownboxes */ hypre_CommPkg **interlevel_comm; -/* hypre_CommPkg **intralevel_comm;*/ /* may need to build an intra comm so - that each processor only fullwts its - own fine data- may need to add contrib */ + /* hypre_CommPkg **intralevel_comm;*/ /* may need to build an intra comm so + that each processor only fullwts its + own fine data- may need to add contrib */ } hypre_FacSemiRestrictData2; @@ -106,11 +106,11 @@ hypre_FacSemiRestrictSetup2( void *fac_restrict_vdata, HYPRE_Int ierr = 0; hypre_FacSemiRestrictData2 *fac_restrict_data = (hypre_FacSemiRestrictData2 *)fac_restrict_vdata; - MPI_Comm comm= hypre_SStructPVectorComm(rc); + MPI_Comm comm = hypre_SStructPVectorComm(rc); hypre_CommInfo *comm_info; hypre_CommPkg **interlevel_comm; - hypre_SStructPVector *rf= hypre_SStructVectorPVector(r, part_fine); + hypre_SStructPVector *rf = hypre_SStructVectorPVector(r, part_fine); hypre_StructVector *s_rc, *s_cvector; hypre_SStructPGrid *pgrid; @@ -138,7 +138,7 @@ hypre_FacSemiRestrictSetup2( void *fac_restrict_vdata, hypre_Box box, scaled_box; hypre_Index zero_index, index, ilower, iupper; - HYPRE_Int ndim= hypre_SStructVectorNDim(r); + HYPRE_Int ndim = hypre_SStructVectorNDim(r); HYPRE_Int myproc, proc; HYPRE_Int nvars, vars; HYPRE_Int num_values; @@ -152,20 +152,20 @@ hypre_FacSemiRestrictSetup2( void *fac_restrict_vdata, hypre_MPI_Comm_rank(comm, &myproc); hypre_ClearIndex(zero_index); - nvars= hypre_SStructPVectorNVars(rc); - (fac_restrict_data -> nvars)= nvars; + nvars = hypre_SStructPVectorNVars(rc); + (fac_restrict_data -> nvars) = nvars; hypre_CopyIndex(rfactors, (fac_restrict_data -> stride)); - for (i= ndim; i< 3; i++) + for (i = ndim; i < 3; i++) { - rfactors[i]= 1; + rfactors[i] = 1; } /* work vector for storing the fullweighted fgrid boxes */ hypre_SStructPGridCreate(hypre_SStructPVectorComm(rf), ndim, &fgrid_coarsen); - pgrid= hypre_SStructPVectorPGrid(rf); - for (vars= 0; vars< nvars; vars++) + pgrid = hypre_SStructPVectorPGrid(rf); + for (vars = 0; vars < nvars; vars++) { - boxarray= hypre_StructGridBoxes(hypre_SStructPGridSGrid(pgrid, vars)); + boxarray = hypre_StructGridBoxes(hypre_SStructPGridSGrid(pgrid, vars)); hypre_ForBoxI(fi, boxarray) { hypre_CopyBox(hypre_BoxArrayBox(boxarray, fi), &box); @@ -190,7 +190,7 @@ hypre_FacSemiRestrictSetup2( void *fac_restrict_vdata, /* pgrid fgrid_coarsen no longer needed */ hypre_SStructPGridDestroy(fgrid_coarsen); - fac_restrict_data -> fgrid_cvectors= fgrid_cvectors; + fac_restrict_data -> fgrid_cvectors = fgrid_cvectors; /*-------------------------------------------------------------------------- * boxes that are not underlying a fine box: @@ -206,23 +206,23 @@ hypre_FacSemiRestrictSetup2( void *fac_restrict_vdata, * will be subtracted from the cbox. Contraction can erroneously lead * to bigger identity boxes. *--------------------------------------------------------------------------*/ - identity_arrayboxes= hypre_CTAlloc(hypre_BoxArrayArray *, nvars, HYPRE_MEMORY_HOST); - pgrid= hypre_SStructPVectorPGrid(rc); + identity_arrayboxes = hypre_CTAlloc(hypre_BoxArrayArray *, nvars, HYPRE_MEMORY_HOST); + pgrid = hypre_SStructPVectorPGrid(rc); hypre_ClearIndex(index); - for (i= 0; i< ndim; i++) + for (i = 0; i < ndim; i++) { - index[i]= rfactors[i]-1; + index[i] = rfactors[i] - 1; } tmp_boxarray = hypre_BoxArrayCreate(0, ndim); - for (vars= 0; vars< nvars; vars++) + for (vars = 0; vars < nvars; vars++) { - boxman= hypre_SStructGridBoxManager(hypre_SStructVectorGrid(r), - part_fine, vars); - boxarray= hypre_StructGridBoxes(hypre_SStructPGridSGrid(pgrid, vars)); + boxman = hypre_SStructGridBoxManager(hypre_SStructVectorGrid(r), + part_fine, vars); + boxarray = hypre_StructGridBoxes(hypre_SStructPGridSGrid(pgrid, vars)); - identity_arrayboxes[vars]= hypre_BoxArrayArrayCreate(hypre_BoxArraySize(boxarray), ndim); + identity_arrayboxes[vars] = hypre_BoxArrayArrayCreate(hypre_BoxArraySize(boxarray), ndim); hypre_ForBoxI(ci, boxarray) { @@ -240,8 +240,8 @@ hypre_FacSemiRestrictSetup2( void *fac_restrict_vdata, &nboxman_entries); /* all send and coarsened fboxes on this processor are collected */ - intersect_boxes= hypre_BoxArrayCreate(0, ndim); - for (i= 0; i< nboxman_entries; i++) + intersect_boxes = hypre_BoxArrayCreate(0, ndim); + for (i = 0; i < nboxman_entries; i++) { hypre_BoxManEntryGetExtents(boxman_entries[i], ilower, iupper); hypre_BoxSetExtents(&box, ilower, iupper); @@ -263,7 +263,7 @@ hypre_FacSemiRestrictSetup2( void *fac_restrict_vdata, } } hypre_BoxArrayDestroy(tmp_boxarray); - fac_restrict_data -> identity_arrayboxes= identity_arrayboxes; + fac_restrict_data -> identity_arrayboxes = identity_arrayboxes; /*-------------------------------------------------------------------------- * fboxes that are coarsened. Some will be sent. We create the communication @@ -276,28 +276,31 @@ hypre_FacSemiRestrictSetup2( void *fac_restrict_vdata, * Note that no contraction is needed. Contraction can lead to erroneous * send_boxes. *--------------------------------------------------------------------------*/ - interlevel_comm= hypre_CTAlloc(hypre_CommPkg *, nvars, HYPRE_MEMORY_HOST); - fullwgt_sendboxes= hypre_CTAlloc(hypre_BoxArrayArray *, nvars, HYPRE_MEMORY_HOST); - fullwgt_ownboxes= hypre_CTAlloc(hypre_BoxArrayArray *, nvars, HYPRE_MEMORY_HOST); - own_cboxnums= hypre_CTAlloc(HYPRE_Int **, nvars, HYPRE_MEMORY_HOST); + interlevel_comm = hypre_CTAlloc(hypre_CommPkg *, nvars, HYPRE_MEMORY_HOST); + fullwgt_sendboxes = hypre_CTAlloc(hypre_BoxArrayArray *, nvars, HYPRE_MEMORY_HOST); + fullwgt_ownboxes = hypre_CTAlloc(hypre_BoxArrayArray *, nvars, HYPRE_MEMORY_HOST); + own_cboxnums = hypre_CTAlloc(HYPRE_Int **, nvars, HYPRE_MEMORY_HOST); - send_boxes= hypre_CTAlloc(hypre_BoxArrayArray *, nvars, HYPRE_MEMORY_HOST); - send_processes= hypre_CTAlloc(HYPRE_Int **, nvars, HYPRE_MEMORY_HOST); - send_remote_boxnums= hypre_CTAlloc(HYPRE_Int **, nvars, HYPRE_MEMORY_HOST); + send_boxes = hypre_CTAlloc(hypre_BoxArrayArray *, nvars, HYPRE_MEMORY_HOST); + send_processes = hypre_CTAlloc(HYPRE_Int **, nvars, HYPRE_MEMORY_HOST); + send_remote_boxnums = hypre_CTAlloc(HYPRE_Int **, nvars, HYPRE_MEMORY_HOST); - pgrid= hypre_SStructPVectorPGrid(rf); - for (vars= 0; vars< nvars; vars++) + pgrid = hypre_SStructPVectorPGrid(rf); + for (vars = 0; vars < nvars; vars++) { - boxman= hypre_SStructGridBoxManager(hypre_SStructVectorGrid(r), - part_crse, vars); - boxarray= hypre_StructGridBoxes(hypre_SStructPGridSGrid(pgrid, vars)); - fullwgt_sendboxes[vars]= hypre_BoxArrayArrayCreate(hypre_BoxArraySize(boxarray), ndim); + boxman = hypre_SStructGridBoxManager(hypre_SStructVectorGrid(r), + part_crse, vars); + boxarray = hypre_StructGridBoxes(hypre_SStructPGridSGrid(pgrid, vars)); + fullwgt_sendboxes[vars] = hypre_BoxArrayArrayCreate(hypre_BoxArraySize(boxarray), ndim); fullwgt_ownboxes[vars] = hypre_BoxArrayArrayCreate(hypre_BoxArraySize(boxarray), ndim); - own_cboxnums[vars] = hypre_CTAlloc(HYPRE_Int *, hypre_BoxArraySize(boxarray), HYPRE_MEMORY_HOST); + own_cboxnums[vars] = hypre_CTAlloc(HYPRE_Int *, hypre_BoxArraySize(boxarray), + HYPRE_MEMORY_HOST); send_boxes[vars] = hypre_BoxArrayArrayCreate(hypre_BoxArraySize(boxarray), ndim); - send_processes[vars] = hypre_CTAlloc(HYPRE_Int *, hypre_BoxArraySize(boxarray), HYPRE_MEMORY_HOST); - send_remote_boxnums[vars]= hypre_CTAlloc(HYPRE_Int *, hypre_BoxArraySize(boxarray), HYPRE_MEMORY_HOST); + send_processes[vars] = hypre_CTAlloc(HYPRE_Int *, hypre_BoxArraySize(boxarray), + HYPRE_MEMORY_HOST); + send_remote_boxnums[vars] = hypre_CTAlloc(HYPRE_Int *, hypre_BoxArraySize(boxarray), + HYPRE_MEMORY_HOST); hypre_ForBoxI(fi, boxarray) { @@ -310,8 +313,8 @@ hypre_FacSemiRestrictSetup2( void *fac_restrict_vdata, hypre_BoxManIntersect(boxman, hypre_BoxIMin(&scaled_box), hypre_BoxIMax(&scaled_box), &boxman_entries, &nboxman_entries); - cnt1= 0; cnt2= 0; - for (i= 0; i< nboxman_entries; i++) + cnt1 = 0; cnt2 = 0; + for (i = 0; i < nboxman_entries; i++) { hypre_SStructBoxManEntryGetProcess(boxman_entries[i], &proc); if (proc != myproc) @@ -324,11 +327,11 @@ hypre_FacSemiRestrictSetup2( void *fac_restrict_vdata, } } send_processes[vars][fi] = hypre_CTAlloc(HYPRE_Int, cnt1, HYPRE_MEMORY_HOST); - send_remote_boxnums[vars][fi]= hypre_CTAlloc(HYPRE_Int, cnt1, HYPRE_MEMORY_HOST); + send_remote_boxnums[vars][fi] = hypre_CTAlloc(HYPRE_Int, cnt1, HYPRE_MEMORY_HOST); own_cboxnums[vars][fi] = hypre_CTAlloc(HYPRE_Int, cnt2, HYPRE_MEMORY_HOST); - cnt1= 0; cnt2= 0; - for (i= 0; i< nboxman_entries; i++) + cnt1 = 0; cnt2 = 0; + for (i = 0; i < nboxman_entries; i++) { hypre_BoxManEntryGetExtents(boxman_entries[i], ilower, iupper); hypre_BoxSetExtents(&box, ilower, iupper); @@ -342,7 +345,7 @@ hypre_FacSemiRestrictSetup2( void *fac_restrict_vdata, hypre_AppendBox(&box, hypre_BoxArrayArrayBoxArray(send_boxes[vars], fi)); - send_processes[vars][fi][cnt1]= proc; + send_processes[vars][fi][cnt1] = proc; hypre_SStructBoxManEntryGetBoxnum(boxman_entries[i], &send_remote_boxnums[vars][fi][cnt1]); cnt1++; @@ -362,9 +365,9 @@ hypre_FacSemiRestrictSetup2( void *fac_restrict_vdata, } /* hypre_ForBoxI(fi, boxarray) */ } /* for (vars= 0; vars< nvars; vars++) */ - (fac_restrict_data -> fullwgt_sendboxes)= fullwgt_sendboxes; - (fac_restrict_data -> fullwgt_ownboxes)= fullwgt_ownboxes; - (fac_restrict_data -> own_cboxnums)= own_cboxnums; + (fac_restrict_data -> fullwgt_sendboxes) = fullwgt_sendboxes; + (fac_restrict_data -> fullwgt_ownboxes) = fullwgt_ownboxes; + (fac_restrict_data -> own_cboxnums) = own_cboxnums; /*-------------------------------------------------------------------------- * coarsened fboxes this processor will receive. @@ -373,22 +376,23 @@ hypre_FacSemiRestrictSetup2( void *fac_restrict_vdata, * processors the refinement belongs in. The processors owning a chunk * are the recv_processors. *--------------------------------------------------------------------------*/ - recv_boxes= hypre_CTAlloc(hypre_BoxArrayArray *, nvars, HYPRE_MEMORY_HOST); - recv_processes= hypre_CTAlloc(HYPRE_Int **, nvars, HYPRE_MEMORY_HOST); + recv_boxes = hypre_CTAlloc(hypre_BoxArrayArray *, nvars, HYPRE_MEMORY_HOST); + recv_processes = hypre_CTAlloc(HYPRE_Int **, nvars, HYPRE_MEMORY_HOST); /* dummy pointer for CommInfoCreate */ - recv_remote_boxnums= hypre_CTAlloc(HYPRE_Int **, nvars, HYPRE_MEMORY_HOST); + recv_remote_boxnums = hypre_CTAlloc(HYPRE_Int **, nvars, HYPRE_MEMORY_HOST); - pgrid= hypre_SStructPVectorPGrid(rc); - for (vars= 0; vars< nvars; vars++) + pgrid = hypre_SStructPVectorPGrid(rc); + for (vars = 0; vars < nvars; vars++) { - boxman= hypre_SStructGridBoxManager(hypre_SStructVectorGrid(r), - part_fine, vars); - boxarray= hypre_StructGridBoxes(hypre_SStructPGridSGrid(pgrid, vars)); + boxman = hypre_SStructGridBoxManager(hypre_SStructVectorGrid(r), + part_fine, vars); + boxarray = hypre_StructGridBoxes(hypre_SStructPGridSGrid(pgrid, vars)); recv_boxes[vars] = hypre_BoxArrayArrayCreate(hypre_BoxArraySize(boxarray), ndim); - recv_processes[vars]= hypre_CTAlloc(HYPRE_Int *, hypre_BoxArraySize(boxarray), HYPRE_MEMORY_HOST); - recv_remote_boxnums[vars]= hypre_CTAlloc(HYPRE_Int *, hypre_BoxArraySize(boxarray), HYPRE_MEMORY_HOST); + recv_processes[vars] = hypre_CTAlloc(HYPRE_Int *, hypre_BoxArraySize(boxarray), HYPRE_MEMORY_HOST); + recv_remote_boxnums[vars] = hypre_CTAlloc(HYPRE_Int *, hypre_BoxArraySize(boxarray), + HYPRE_MEMORY_HOST); hypre_ForBoxI(ci, boxarray) { @@ -401,8 +405,8 @@ hypre_FacSemiRestrictSetup2( void *fac_restrict_vdata, hypre_BoxManIntersect(boxman, hypre_BoxIMin(&scaled_box), hypre_BoxIMax(&scaled_box), &boxman_entries, &nboxman_entries); - cnt1= 0; - for (i= 0; i< nboxman_entries; i++) + cnt1 = 0; + for (i = 0; i < nboxman_entries; i++) { hypre_SStructBoxManEntryGetProcess(boxman_entries[i], &proc); if (proc != myproc) @@ -410,11 +414,11 @@ hypre_FacSemiRestrictSetup2( void *fac_restrict_vdata, cnt1++; } } - recv_processes[vars][ci]= hypre_CTAlloc(HYPRE_Int, cnt1, HYPRE_MEMORY_HOST); - recv_remote_boxnums[vars][ci]= hypre_CTAlloc(HYPRE_Int , cnt1, HYPRE_MEMORY_HOST); + recv_processes[vars][ci] = hypre_CTAlloc(HYPRE_Int, cnt1, HYPRE_MEMORY_HOST); + recv_remote_boxnums[vars][ci] = hypre_CTAlloc(HYPRE_Int, cnt1, HYPRE_MEMORY_HOST); - cnt1= 0; - for (i= 0; i< nboxman_entries; i++) + cnt1 = 0; + for (i = 0; i < nboxman_entries; i++) { hypre_SStructBoxManEntryGetProcess(boxman_entries[i], &proc); if (proc != myproc) @@ -431,7 +435,7 @@ hypre_FacSemiRestrictSetup2( void *fac_restrict_vdata, hypre_AppendBox(&box, hypre_BoxArrayArrayBoxArray(recv_boxes[vars], ci)); - recv_processes[vars][ci][cnt1]= proc; + recv_processes[vars][ci][cnt1] = proc; cnt1++; } /* if (proc != myproc) */ @@ -442,13 +446,13 @@ hypre_FacSemiRestrictSetup2( void *fac_restrict_vdata, } /* hypre_ForBoxI(ci, boxarray) */ } /* for (vars= 0; vars< nvars; vars++) */ - num_values= 1; - for (vars= 0; vars< nvars; vars++) + num_values = 1; + for (vars = 0; vars < nvars; vars++) { s_rc = hypre_SStructPVectorSVector(rc, vars); - s_cvector= hypre_SStructPVectorSVector(fgrid_cvectors, vars); - send_rboxes= hypre_BoxArrayArrayDuplicate(send_boxes[vars]); - recv_rboxes= hypre_BoxArrayArrayDuplicate(recv_boxes[vars]); + s_cvector = hypre_SStructPVectorSVector(fgrid_cvectors, vars); + send_rboxes = hypre_BoxArrayArrayDuplicate(send_boxes[vars]); + recv_rboxes = hypre_BoxArrayArrayDuplicate(recv_boxes[vars]); hypre_CommInfoCreate(send_boxes[vars], recv_boxes[vars], send_processes[vars], recv_processes[vars], @@ -470,7 +474,7 @@ hypre_FacSemiRestrictSetup2( void *fac_restrict_vdata, hypre_TFree(send_remote_boxnums, HYPRE_MEMORY_HOST); hypre_TFree(recv_remote_boxnums, HYPRE_MEMORY_HOST); - (fac_restrict_data -> interlevel_comm)= interlevel_comm; + (fac_restrict_data -> interlevel_comm) = interlevel_comm; return ierr; @@ -486,10 +490,10 @@ hypre_FACRestrict2( void * fac_restrict_vdata, hypre_FacSemiRestrictData2 *restrict_data = (hypre_FacSemiRestrictData2 *)fac_restrict_vdata; hypre_SStructPVector *fgrid_cvectors = restrict_data->fgrid_cvectors; - hypre_BoxArrayArray **identity_arrayboxes= restrict_data->identity_arrayboxes; + hypre_BoxArrayArray **identity_arrayboxes = restrict_data->identity_arrayboxes; hypre_BoxArrayArray **fullwgt_ownboxes = restrict_data->fullwgt_ownboxes; HYPRE_Int ***own_cboxnums = restrict_data->own_cboxnums; - hypre_CommPkg **interlevel_comm= restrict_data-> interlevel_comm; + hypre_CommPkg **interlevel_comm = restrict_data-> interlevel_comm; hypre_CommHandle *comm_handle; HYPRE_Int ndim = hypre_SStructVectorNDim(xf); @@ -527,7 +531,7 @@ hypre_FACRestrict2( void * fac_restrict_vdata, HYPRE_Int fi, ci; HYPRE_Int nvars, var; - HYPRE_Int volume_crse_cell; + /* HYPRE_Int volume_crse_cell; */ HYPRE_Int i, j, k; HYPRE_Int imax, jmax, kmax; @@ -536,57 +540,53 @@ hypre_FACRestrict2( void * fac_restrict_vdata, HYPRE_Real *sum; HYPRE_Real scaling; - HYPRE_Int part_crse= 0; - HYPRE_Int part_fine= 1; + HYPRE_Int part_crse = 0; + HYPRE_Int part_fine = 1; HYPRE_Int num_coarse_cells; /*----------------------------------------------------------------------- * Initialize some things *-----------------------------------------------------------------------*/ - stride= (restrict_data -> stride); - - hypre_ClearIndex(stridec); - for (i= 0; i< ndim; i++) - { - stridec[i]= 1; - } + stride = (restrict_data -> stride); + hypre_SetIndex(lindex, 0); + hypre_SetIndex(stridec, 1); hypre_CopyIndex(stride, rfactors); - for (i= ndim; i< 3; i++) + for (i = ndim; i < HYPRE_MAXDIM; i++) { - rfactors[i]= 1; + rfactors[i] = 1; } - volume_crse_cell= 1; - for (i= 0; i< ndim; i++) - { - volume_crse_cell*= rfactors[i]; - } + /* volume_crse_cell = 1; */ + /* for (i = 0; i < ndim; i++) */ + /* { */ + /* volume_crse_cell *= rfactors[i]; */ + /* } */ /*----------------------------------------------------------------------- * We are assuming the refinement and coarsening have same variable * types. *-----------------------------------------------------------------------*/ - nvars= hypre_SStructPVectorNVars(xc); + nvars = hypre_SStructPVectorNVars(xc); /*----------------------------------------------------------------------- * For each coordinate direction, a fine node can contribute only to the * left or right cell=> only 2 coarse cells per direction. *-----------------------------------------------------------------------*/ - num_coarse_cells= 1; - for (i= 0; i< ndim; i++) + num_coarse_cells = 1; + for (i = 0; i < ndim; i++) { - num_coarse_cells*= 2; + num_coarse_cells *= 2; } - sum= hypre_CTAlloc(HYPRE_Real, num_coarse_cells, HYPRE_MEMORY_HOST); + sum = hypre_CTAlloc(HYPRE_Real, num_coarse_cells, HYPRE_MEMORY_HOST); /*-------------------------------------------------------------------------- * Scaling for averaging restriction. *--------------------------------------------------------------------------*/ - scaling= 1.0; - for (i= 0; i< ndim-2; i++) + scaling = 1.0; + for (i = 0; i < ndim - 2; i++) { - scaling*= rfactors[0]; + scaling *= rfactors[0]; } /*----------------------------------------------------------------------- @@ -616,11 +616,11 @@ hypre_FACRestrict2( void * fac_restrict_vdata, *-----------------------------------------------------------------------*/ if (ndim > 1) { - xcp_temp= hypre_TAlloc(HYPRE_Real **, (ndim-1), HYPRE_MEMORY_HOST); - xcp = hypre_TAlloc(HYPRE_Real **, (ndim-1), HYPRE_MEMORY_HOST); - for (k= 0; k< (ndim-1); k++) + xcp_temp = hypre_TAlloc(HYPRE_Real **, (ndim - 1), HYPRE_MEMORY_HOST); + xcp = hypre_TAlloc(HYPRE_Real **, (ndim - 1), HYPRE_MEMORY_HOST); + for (k = 0; k < (ndim - 1); k++) { - xcp_temp[k]= hypre_TAlloc(HYPRE_Real *, 2, HYPRE_MEMORY_HOST); + xcp_temp[k] = hypre_TAlloc(HYPRE_Real *, 2, HYPRE_MEMORY_HOST); xcp[k] = hypre_TAlloc(HYPRE_Real *, 2, HYPRE_MEMORY_HOST); } } @@ -628,22 +628,22 @@ hypre_FACRestrict2( void * fac_restrict_vdata, { xcp_temp = hypre_TAlloc(HYPRE_Real **, 1, HYPRE_MEMORY_HOST); xcp = hypre_TAlloc(HYPRE_Real **, 1, HYPRE_MEMORY_HOST); - xcp_temp[0]= hypre_TAlloc(HYPRE_Real *, 1, HYPRE_MEMORY_HOST); + xcp_temp[0] = hypre_TAlloc(HYPRE_Real *, 1, HYPRE_MEMORY_HOST); xcp[0] = hypre_TAlloc(HYPRE_Real *, 1, HYPRE_MEMORY_HOST); } /* memory allocation of xfp is okay for all dimensions */ - xfp= hypre_TAlloc(HYPRE_Real **, rfactors[2], HYPRE_MEMORY_HOST); - for (k= 0; k< rfactors[2]; k++) + xfp = hypre_TAlloc(HYPRE_Real **, rfactors[2], HYPRE_MEMORY_HOST); + for (k = 0; k < rfactors[2]; k++) { - xfp[k]= hypre_TAlloc(HYPRE_Real *, rfactors[1], HYPRE_MEMORY_HOST); + xfp[k] = hypre_TAlloc(HYPRE_Real *, rfactors[1], HYPRE_MEMORY_HOST); } - for (var= 0; var< nvars; var++) + for (var = 0; var < nvars; var++) { - xc_temp= hypre_SStructPVectorSVector(fgrid_cvectors, var); - xf_var= hypre_SStructPVectorSVector(hypre_SStructVectorPVector(xf,part_fine), - var); + xc_temp = hypre_SStructPVectorSVector(fgrid_cvectors, var); + xf_var = hypre_SStructPVectorSVector(hypre_SStructVectorPVector(xf, part_fine), + var); fgrid = hypre_StructVectorGrid(xf_var); fgrid_boxes = hypre_StructGridBoxes(fgrid); @@ -652,19 +652,19 @@ hypre_FACRestrict2( void * fac_restrict_vdata, hypre_ForBoxI(fi, fgrid_boxes) { - fgrid_box= hypre_BoxArrayBox(fgrid_boxes, fi); + fgrid_box = hypre_BoxArrayBox(fgrid_boxes, fi); /*-------------------------------------------------------------------- * Get the ptrs for the fine struct_vectors. *--------------------------------------------------------------------*/ xf_dbox = hypre_BoxArrayBox(hypre_StructVectorDataSpace(xf_var), fi); - for (k= 0; k< rfactors[2]; k++) + for (k = 0; k < rfactors[2]; k++) { - for (j=0; j< rfactors[1]; j++) + for (j = 0; j < rfactors[1]; j++) { hypre_SetIndex3(temp_index1, 0, j, k); - xfp[k][j]= hypre_StructVectorBoxData(xf_var, fi) + - hypre_BoxOffsetDistance(xf_dbox, temp_index1); + xfp[k][j] = hypre_StructVectorBoxData(xf_var, fi) + + hypre_BoxOffsetDistance(xf_dbox, temp_index1); } } @@ -674,24 +674,24 @@ hypre_FACRestrict2( void * fac_restrict_vdata, * Work vectors were created this way. * Dimensionally dependent. *--------------------------------------------------------------------*/ - xc_temp_dbox= hypre_BoxArrayBox(hypre_StructVectorDataSpace(xc_temp), fi); + xc_temp_dbox = hypre_BoxArrayBox(hypre_StructVectorDataSpace(xc_temp), fi); if (ndim > 1) { - for (k= 0; k< (ndim-1); k++) + for (k = 0; k < (ndim - 1); k++) { - for (j=0; j< 2; j++) + for (j = 0; j < 2; j++) { hypre_SetIndex3(temp_index1, 0, j, k); - xcp_temp[k][j]= hypre_StructVectorBoxData(xc_temp, fi) + - hypre_BoxOffsetDistance(xc_temp_dbox, temp_index1); + xcp_temp[k][j] = hypre_StructVectorBoxData(xc_temp, fi) + + hypre_BoxOffsetDistance(xc_temp_dbox, temp_index1); } } } else /* 1d case */ { hypre_ClearIndex(temp_index1); - xcp_temp[0][0]= hypre_StructVectorBoxData(xc_temp, fi) + - hypre_BoxOffsetDistance(xc_temp_dbox, temp_index1); + xcp_temp[0][0] = hypre_StructVectorBoxData(xc_temp, fi) + + hypre_BoxOffsetDistance(xc_temp_dbox, temp_index1); } hypre_CopyIndex(hypre_BoxIMin(fgrid_box), start); hypre_CopyIndex(hypre_BoxIMax(fgrid_box), fbox_size); @@ -701,9 +701,9 @@ hypre_FACRestrict2( void * fac_restrict_vdata, * ndim < 3. * fbox_size= hypre_BoxIMax(fgrid_box)-hypre_BoxIMin(fgrid_box)+1. *--------------------------------------------------------------------*/ - for (i= 0; i< 3; i++) + for (i = 0; i < 3; i++) { - fbox_size[i]-= (start[i]-1); + fbox_size[i] -= (start[i] - 1); } /*-------------------------------------------------------------------- @@ -712,9 +712,9 @@ hypre_FACRestrict2( void * fac_restrict_vdata, * coarse node gets the restricted values. *--------------------------------------------------------------------*/ hypre_ClearIndex(node_offset); - for (i= 0; i< ndim; i++) + for (i = 0; i < ndim; i++) { - node_offset[i]= rfactors[i]-(start[i]%rfactors[i])-1; + node_offset[i] = rfactors[i] - (start[i] % rfactors[i]) - 1; } hypre_SetIndex3(temp_index2, 0, 0, 0); @@ -733,41 +733,41 @@ hypre_FACRestrict2( void * fac_restrict_vdata, * piecewise constant restriction. *-----------------------------------------------------------------*/ zypre_BoxLoopGetIndex(lindex); - imax= hypre_min( (fbox_size[0]-lindex[0]*stride[0]), rfactors[0] ); - jmax= hypre_min( (fbox_size[1]-lindex[1]*stride[1]), rfactors[1] ); - kmax= hypre_min( (fbox_size[2]-lindex[2]*stride[2]), rfactors[2] ); + imax = hypre_min( (fbox_size[0] - lindex[0] * stride[0]), rfactors[0] ); + jmax = hypre_min( (fbox_size[1] - lindex[1] * stride[1]), rfactors[1] ); + kmax = hypre_min( (fbox_size[2] - lindex[2] * stride[2]), rfactors[2] ); - for (i= 0; i< num_coarse_cells; i++) + for (i = 0; i < num_coarse_cells; i++) { - sum[i]= 0.0; + sum[i] = 0.0; } - for (k= 0; k< kmax; k++) + for (k = 0; k < kmax; k++) { - kcell= 1; + kcell = 1; if (k <= node_offset[2]) { - kcell= 0; + kcell = 0; } - for (j= 0; j< jmax; j++) + for (j = 0; j < jmax; j++) { - jcell= 1; + jcell = 1; if (j <= node_offset[1]) { - jcell= 0; + jcell = 0; } - for (i= 0; i< imax; i++) + for (i = 0; i < imax; i++) { - icell= 1; + icell = 1; if (i <= node_offset[0]) { - icell= 0; + icell = 0; } - MapCellRank(icell, jcell , kcell, ijkcell); - sum[ijkcell]+= xfp[k][j][xfi+i]; + MapCellRank(icell, jcell, kcell, ijkcell); + sum[ijkcell] += xfp[k][j][xfi + i]; } } } @@ -775,16 +775,16 @@ hypre_FACRestrict2( void * fac_restrict_vdata, /*----------------------------------------------------------------- * Add the compute averages to the correct coarse cell. *-----------------------------------------------------------------*/ - for (ijkcell= 0; ijkcell< num_coarse_cells; ijkcell++) + for (ijkcell = 0; ijkcell < num_coarse_cells; ijkcell++) { if (sum[ijkcell] != 0.0) { - sum[ijkcell]/= scaling; + sum[ijkcell] /= scaling; InverseMapCellRank(ijkcell, temp_index2); - i= temp_index2[0]; - j= temp_index2[1]; - k= temp_index2[2]; - xcp_temp[k][j][xci+i]+= sum[ijkcell]; + i = temp_index2[0]; + j = temp_index2[1]; + k = temp_index2[2]; + xcp_temp[k][j][xci + i] += sum[ijkcell]; } } @@ -799,10 +799,10 @@ hypre_FACRestrict2( void * fac_restrict_vdata, * patch. Only actual communicated values will be put in the * coarse vector. *------------------------------------------------------------------*/ - for (var= 0; var< nvars; var++) + for (var = 0; var < nvars; var++) { - xc_temp= hypre_SStructPVectorSVector(fgrid_cvectors, var); - xc_var= hypre_SStructPVectorSVector(xc, var); + xc_temp = hypre_SStructPVectorSVector(fgrid_cvectors, var); + xc_var = hypre_SStructPVectorSVector(xc, var); hypre_InitializeCommunication(interlevel_comm[var], hypre_StructVectorData(xc_temp), hypre_StructVectorData(xc_var), 0, 0, @@ -815,31 +815,31 @@ hypre_FACRestrict2( void * fac_restrict_vdata, * Need to add the coarsened patches that belong on this processor * to the coarse vector. *------------------------------------------------------------------*/ - for (var= 0; var< nvars; var++) + for (var = 0; var < nvars; var++) { - xc_temp= hypre_SStructPVectorSVector(fgrid_cvectors, var); - xc_var= hypre_SStructPVectorSVector(xc, var); + xc_temp = hypre_SStructPVectorSVector(fgrid_cvectors, var); + xc_var = hypre_SStructPVectorSVector(xc, var); cgrid = hypre_StructVectorGrid(xc_temp); cgrid_boxes = hypre_StructGridBoxes(cgrid); - arrayarray_ownboxes= fullwgt_ownboxes[var]; + arrayarray_ownboxes = fullwgt_ownboxes[var]; hypre_ForBoxI(ci, cgrid_boxes) { - xc_temp_dbox= hypre_BoxArrayBox(hypre_StructVectorDataSpace(xc_temp), ci); - xcp_temp[0][0]= hypre_StructVectorBoxData(xc_temp, ci); + xc_temp_dbox = hypre_BoxArrayBox(hypre_StructVectorDataSpace(xc_temp), ci); + xcp_temp[0][0] = hypre_StructVectorBoxData(xc_temp, ci); /*-------------------------------------------------------------- * Each ci box of cgrid_box has a boxarray of subboxes. Copy * each of these subboxes to the coarse vector. *--------------------------------------------------------------*/ - own_boxes= hypre_BoxArrayArrayBoxArray(arrayarray_ownboxes, ci); + own_boxes = hypre_BoxArrayArrayBoxArray(arrayarray_ownboxes, ci); boxnums = own_cboxnums[var][ci]; hypre_ForBoxI(i, own_boxes) { - own_box= hypre_BoxArrayBox(own_boxes, i); - xf_dbox= hypre_BoxArrayBox(hypre_StructVectorDataSpace(xc_var), boxnums[i]); - xcp[0][0]= hypre_StructVectorBoxData(xc_var, boxnums[i]); + own_box = hypre_BoxArrayBox(own_boxes, i); + xf_dbox = hypre_BoxArrayBox(hypre_StructVectorDataSpace(xc_var), boxnums[i]); + xcp[0][0] = hypre_StructVectorBoxData(xc_var, boxnums[i]); hypre_BoxGetSize(own_box, loop_size); @@ -848,7 +848,7 @@ hypre_FACRestrict2( void * fac_restrict_vdata, xc_temp_dbox, hypre_BoxIMin(own_box), stridec, xfi, xf_dbox, hypre_BoxIMin(own_box), stridec, xci); { - xcp[0][0][xci]+= xcp_temp[0][0][xfi]; + xcp[0][0][xci] += xcp_temp[0][0][xfi]; } hypre_BoxLoop2End(xfi, xci); #undef DEVICE_VAR @@ -858,7 +858,7 @@ hypre_FACRestrict2( void * fac_restrict_vdata, } /* for (var= 0; var< nvars; var++) */ hypre_TFree(sum, HYPRE_MEMORY_HOST); - for (k= 0; k< rfactors[2]; k++) + for (k = 0; k < rfactors[2]; k++) { hypre_TFree(xfp[k], HYPRE_MEMORY_HOST); } @@ -866,7 +866,7 @@ hypre_FACRestrict2( void * fac_restrict_vdata, if (ndim > 1) { - for (k= 0; k< (ndim-1); k++) + for (k = 0; k < (ndim - 1); k++) { hypre_TFree(xcp_temp[k], HYPRE_MEMORY_HOST); hypre_TFree(xcp[k], HYPRE_MEMORY_HOST); @@ -899,14 +899,14 @@ hypre_FacSemiRestrictDestroy2( void *fac_restrict_vdata ) if (fac_restrict_data) { - nvars= (fac_restrict_data-> nvars); + nvars = (fac_restrict_data-> nvars); hypre_SStructPVectorDestroy(fac_restrict_data-> fgrid_cvectors); - for (i= 0; i< nvars; i++) + for (i = 0; i < nvars; i++) { hypre_BoxArrayArrayDestroy((fac_restrict_data -> identity_arrayboxes)[i]); hypre_BoxArrayArrayDestroy((fac_restrict_data -> fullwgt_sendboxes)[i]); - for (j= 0; j< hypre_BoxArrayArraySize(fac_restrict_data->fullwgt_ownboxes[i]); j++) + for (j = 0; j < hypre_BoxArrayArraySize(fac_restrict_data->fullwgt_ownboxes[i]); j++) { hypre_TFree((fac_restrict_data -> own_cboxnums)[i][j], HYPRE_MEMORY_HOST); } diff --git a/external/hypre/src/sstruct_ls/fac_setup2.c b/external/hypre/src/sstruct_ls/fac_setup2.c index b1baef22..79537ec8 100644 --- a/external/hypre/src/sstruct_ls/fac_setup2.c +++ b/external/hypre/src/sstruct_ls/fac_setup2.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -21,6 +21,8 @@ hypre_FacSetup2( void *fac_vdata, hypre_SStructVector *b, hypre_SStructVector *x ) { + HYPRE_UNUSED_VAR(b); + hypre_FACData *fac_data = (hypre_FACData*)fac_vdata; HYPRE_Int *plevels = (fac_data-> plevels); @@ -43,8 +45,8 @@ hypre_FacSetup2( void *fac_vdata, hypre_SStructGraph *graph; hypre_SStructGrid *grid; - hypre_SStructPGrid *pgrid; - hypre_StructGrid *sgrid; + hypre_SStructPGrid *pgrid; + hypre_StructGrid *sgrid; hypre_BoxArray *sgrid_boxes; hypre_Box *sgrid_box; hypre_SStructStencil *stencils; @@ -57,7 +59,7 @@ hypre_FacSetup2( void *fac_vdata, hypre_SStructUVEntry **Uventries; HYPRE_Int nUventries; HYPRE_Int *iUventries; - hypre_SStructUVEntry *Uventry; + hypre_SStructUVEntry *Uventry; hypre_SStructUEntry *Uentry; hypre_Index index, to_index, stride; HYPRE_Int var, to_var, to_part, level_part, level_topart; @@ -84,13 +86,13 @@ hypre_FacSetup2( void *fac_vdata, /* coarsest grid solver */ - HYPRE_Int csolver_type =(fac_data-> csolver_type); - HYPRE_SStructSolver crse_solver=NULL; - HYPRE_SStructSolver crse_precond=NULL; - + HYPRE_Int csolver_type = (fac_data-> csolver_type); + HYPRE_SStructSolver crse_solver = NULL; + HYPRE_SStructSolver crse_precond = NULL; + HYPRE_Int max_level = hypre_FACDataMaxLevels(fac_data); HYPRE_Int relax_type = fac_data -> relax_type; - HYPRE_Int usr_jacobi_weight= fac_data -> usr_jacobi_weight; + HYPRE_Int usr_jacobi_weight = fac_data -> usr_jacobi_weight; HYPRE_Real jacobi_weight = fac_data -> jacobi_weight; HYPRE_Int *levels; HYPRE_Int *part_to_level; @@ -102,14 +104,14 @@ hypre_FacSetup2( void *fac_vdata, HYPRE_Int *stencil_vars; HYPRE_Real *values; HYPRE_Real *A_smatrix_value; - + HYPRE_Int *nrows; HYPRE_Int **ncols; HYPRE_BigInt **rows; HYPRE_BigInt **cols; HYPRE_Int *cnt; HYPRE_Real *vals; - + HYPRE_BigInt *level_rows; HYPRE_BigInt *level_cols; HYPRE_Int level_cnt; @@ -120,22 +122,22 @@ hypre_FacSetup2( void *fac_vdata, HYPRE_Int max_cycles; HYPRE_Int ierr = 0; -/*hypre_SStructMatrix *nested_A; + /*hypre_SStructMatrix *nested_A; - nested_A= hypre_TAlloc(hypre_SStructMatrix , 1, HYPRE_MEMORY_HOST); - nested_A= hypre_CoarsenAMROp(fac_vdata, A);*/ + nested_A= hypre_TAlloc(hypre_SStructMatrix , 1, HYPRE_MEMORY_HOST); + nested_A= hypre_CoarsenAMROp(fac_vdata, A);*/ /* generate the composite operator with the computed coarse-grid operators */ hypre_AMR_RAP(A_in, rfactors, &A_rap); - (fac_data -> A_rap)= A_rap; + (fac_data -> A_rap) = A_rap; comm = hypre_SStructMatrixComm(A_rap); ndim = hypre_SStructMatrixNDim(A_rap); - npart= hypre_SStructMatrixNParts(A_rap); - graph= hypre_SStructMatrixGraph(A_rap); + npart = hypre_SStructMatrixNParts(A_rap); + graph = hypre_SStructMatrixGraph(A_rap); grid = hypre_SStructGraphGrid(graph); ij_A = hypre_SStructMatrixIJMatrix(A_rap); - matrix_type= hypre_SStructMatrixObjectType(A_rap); + matrix_type = hypre_SStructMatrixObjectType(A_rap); /*-------------------------------------------------------------------------- * logging arrays. @@ -144,7 +146,7 @@ hypre_FacSetup2( void *fac_vdata, { max_cycles = (fac_data -> max_cycles); (fac_data -> norms) = hypre_TAlloc(HYPRE_Real, max_cycles, HYPRE_MEMORY_HOST); - (fac_data -> rel_norms)= hypre_TAlloc(HYPRE_Real, max_cycles, HYPRE_MEMORY_HOST); + (fac_data -> rel_norms) = hypre_TAlloc(HYPRE_Real, max_cycles, HYPRE_MEMORY_HOST); } /*-------------------------------------------------------------------------- @@ -152,52 +154,52 @@ hypre_FacSetup2( void *fac_vdata, *--------------------------------------------------------------------------*/ levels = hypre_CTAlloc(HYPRE_Int, npart, HYPRE_MEMORY_HOST); part_to_level = hypre_CTAlloc(HYPRE_Int, npart, HYPRE_MEMORY_HOST); - refine_factors= hypre_CTAlloc(hypre_Index, npart, HYPRE_MEMORY_HOST); - for (part= 0; part< npart; part++) + refine_factors = hypre_CTAlloc(hypre_Index, npart, HYPRE_MEMORY_HOST); + for (part = 0; part < npart; part++) { part_to_level[part] = plevels[part]; - levels[plevels[part]]= part; - for (i= 0; i< ndim; i++) + levels[plevels[part]] = part; + for (i = 0; i < ndim; i++) { - refine_factors[plevels[part]][i]= rfactors[part][i]; + refine_factors[plevels[part]][i] = rfactors[part][i]; } - for (i= ndim; i< 3; i++) + for (i = ndim; i < 3; i++) { - refine_factors[plevels[part]][i]= 1; + refine_factors[plevels[part]][i] = 1; } } (fac_data -> level_to_part) = levels; (fac_data -> part_to_level) = part_to_level; - (fac_data -> refine_factors)= refine_factors; - + (fac_data -> refine_factors) = refine_factors; + /*-------------------------------------------------------------------------- - * Create the level SStructGrids using the original composite grid. + * Create the level SStructGrids using the original composite grid. *--------------------------------------------------------------------------*/ - grid_level= hypre_TAlloc(hypre_SStructGrid *, max_level+1, HYPRE_MEMORY_HOST); - for (level= max_level; level >= 0; level--) + grid_level = hypre_TAlloc(hypre_SStructGrid *, max_level + 1, HYPRE_MEMORY_HOST); + for (level = max_level; level >= 0; level--) { HYPRE_SStructGridCreate(comm, ndim, nparts_level, &grid_level[level]); } - for (level= max_level; level >= 0; level--) + for (level = max_level; level >= 0; level--) { /*-------------------------------------------------------------------------- - * Create the fine part of the finest level SStructGrids using the original + * Create the fine part of the finest level SStructGrids using the original * composite grid. *--------------------------------------------------------------------------*/ if (level == max_level) { pgrid = hypre_SStructGridPGrid(grid, levels[level]); - iboxarray= hypre_SStructPGridCellIBoxArray(pgrid); + iboxarray = hypre_SStructPGridCellIBoxArray(pgrid); for (box = 0; box < hypre_BoxArraySize(iboxarray); box++) { HYPRE_SStructGridSetExtents(grid_level[level], part_fine, - hypre_BoxIMin( hypre_BoxArrayBox(iboxarray,box) ), - hypre_BoxIMax( hypre_BoxArrayBox(iboxarray,box) )); + hypre_BoxIMin( hypre_BoxArrayBox(iboxarray, box) ), + hypre_BoxIMax( hypre_BoxArrayBox(iboxarray, box) )); } - HYPRE_SStructGridSetVariables( grid_level[level], part_fine, - hypre_SStructPGridNVars(pgrid), + HYPRE_SStructGridSetVariables( grid_level[level], part_fine, + hypre_SStructPGridNVars(pgrid), hypre_SStructPGridVarTypes(pgrid) ); /*----------------------------------------------------------------------- @@ -208,8 +210,8 @@ hypre_FacSetup2( void *fac_vdata, for (box = 0; box < hypre_BoxArraySize(iboxarray); box++) { HYPRE_SStructGridSetExtents(grid_level[level], part_crse, - hypre_BoxIMin( hypre_BoxArrayBox(iboxarray,box) ), - hypre_BoxIMax( hypre_BoxArrayBox(iboxarray,box) )); + hypre_BoxIMin( hypre_BoxArrayBox(iboxarray, box) ), + hypre_BoxIMax( hypre_BoxArrayBox(iboxarray, box) )); } HYPRE_SStructGridSetVariables( grid_level[level], part_crse, @@ -219,45 +221,45 @@ hypre_FacSetup2( void *fac_vdata, } /*-------------------------------------------------------------------------- - * Create the coarse part of level SStructGrids using the original composite + * Create the coarse part of level SStructGrids using the original composite * grid, the coarsest part SStructGrid, and the fine part if level < max_level. *--------------------------------------------------------------------------*/ if (level > 0) { - pgrid = hypre_SStructGridPGrid(grid, levels[level-1]); - iboxarray= hypre_SStructPGridCellIBoxArray(pgrid); + pgrid = hypre_SStructGridPGrid(grid, levels[level - 1]); + iboxarray = hypre_SStructPGridCellIBoxArray(pgrid); for (box = 0; box < hypre_BoxArraySize(iboxarray); box++) { HYPRE_SStructGridSetExtents(grid_level[level], part_crse, - hypre_BoxIMin( hypre_BoxArrayBox(iboxarray,box) ), - hypre_BoxIMax( hypre_BoxArrayBox(iboxarray,box) )); + hypre_BoxIMin( hypre_BoxArrayBox(iboxarray, box) ), + hypre_BoxIMax( hypre_BoxArrayBox(iboxarray, box) )); + + HYPRE_SStructGridSetExtents(grid_level[level - 1], part_fine, + hypre_BoxIMin( hypre_BoxArrayBox(iboxarray, box) ), + hypre_BoxIMax( hypre_BoxArrayBox(iboxarray, box) )); - HYPRE_SStructGridSetExtents(grid_level[level-1], part_fine, - hypre_BoxIMin( hypre_BoxArrayBox(iboxarray,box) ), - hypre_BoxIMax( hypre_BoxArrayBox(iboxarray,box) )); - if (level == 1) { - HYPRE_SStructGridSetExtents(grid_level[level-1], part_crse, - hypre_BoxIMin( hypre_BoxArrayBox(iboxarray,box) ), - hypre_BoxIMax( hypre_BoxArrayBox(iboxarray,box) )); + HYPRE_SStructGridSetExtents(grid_level[level - 1], part_crse, + hypre_BoxIMin( hypre_BoxArrayBox(iboxarray, box) ), + hypre_BoxIMax( hypre_BoxArrayBox(iboxarray, box) )); } } - HYPRE_SStructGridSetVariables( grid_level[level], part_crse, - hypre_SStructPGridNVars(pgrid), + HYPRE_SStructGridSetVariables( grid_level[level], part_crse, + hypre_SStructPGridNVars(pgrid), hypre_SStructPGridVarTypes(pgrid) ); - HYPRE_SStructGridSetVariables( grid_level[level-1], part_fine, - hypre_SStructPGridNVars(pgrid), + HYPRE_SStructGridSetVariables( grid_level[level - 1], part_fine, + hypre_SStructPGridNVars(pgrid), hypre_SStructPGridVarTypes(pgrid) ); /* coarsest SStructGrid */ if (level == 1) { - HYPRE_SStructGridSetVariables( grid_level[level-1], part_crse, - hypre_SStructPGridNVars(pgrid), + HYPRE_SStructGridSetVariables( grid_level[level - 1], part_crse, + hypre_SStructPGridNVars(pgrid), hypre_SStructPGridVarTypes(pgrid) ); } } @@ -265,19 +267,19 @@ hypre_FacSetup2( void *fac_vdata, HYPRE_SStructGridAssemble(grid_level[level]); } - (fac_data -> grid_level)= grid_level; + (fac_data -> grid_level) = grid_level; /*----------------------------------------------------------- * Set up the graph. Create only the structured components * first. *-----------------------------------------------------------*/ - graph_level= hypre_TAlloc(hypre_SStructGraph *, max_level+1, HYPRE_MEMORY_HOST); - for (level= max_level; level >= 0; level--) + graph_level = hypre_TAlloc(hypre_SStructGraph *, max_level + 1, HYPRE_MEMORY_HOST); + for (level = max_level; level >= 0; level--) { HYPRE_SStructGraphCreate(comm, grid_level[level], &graph_level[level]); } - for (level= max_level; level >= 0; level--) + for (level = max_level; level >= 0; level--) { /*----------------------------------------------------------------------- * Create the fine part of the finest level structured graph connection. @@ -288,7 +290,7 @@ hypre_FacSetup2( void *fac_vdata, nvars = hypre_SStructPGridNVars(pgrid); for (var1 = 0; var1 < nvars; var1++) { - stencils= hypre_SStructGraphStencil(graph, levels[level], var1); + stencils = hypre_SStructGraphStencil(graph, levels[level], var1); HYPRE_SStructGraphSetStencil(graph_level[level], part_fine, var1, stencils); if (level == 0) @@ -304,18 +306,18 @@ hypre_FacSetup2( void *fac_vdata, *--------------------------------------------------------------------------*/ if (level > 0) { - pgrid = hypre_SStructGridPGrid(grid, levels[level-1]); + pgrid = hypre_SStructGridPGrid(grid, levels[level - 1]); nvars = hypre_SStructPGridNVars(pgrid); for (var1 = 0; var1 < nvars; var1++) { - stencils= hypre_SStructGraphStencil(graph, levels[level-1], var1); + stencils = hypre_SStructGraphStencil(graph, levels[level - 1], var1); HYPRE_SStructGraphSetStencil(graph_level[level], part_crse, var1, stencils ); - HYPRE_SStructGraphSetStencil(graph_level[level-1], part_fine, var1, stencils ); + HYPRE_SStructGraphSetStencil(graph_level[level - 1], part_fine, var1, stencils ); if (level == 1) { - HYPRE_SStructGraphSetStencil(graph_level[level-1], part_crse, var1, stencils ); + HYPRE_SStructGraphSetStencil(graph_level[level - 1], part_crse, var1, stencils ); } } @@ -331,23 +333,23 @@ hypre_FacSetup2( void *fac_vdata, * CONNECTIONS. *-----------------------------------------------------------*/ Uventries = hypre_SStructGraphUVEntries(graph); - nUventries= hypre_SStructGraphNUVEntries(graph); - iUventries= hypre_SStructGraphIUVEntries(graph); + nUventries = hypre_SStructGraphNUVEntries(graph); + iUventries = hypre_SStructGraphIUVEntries(graph); - nrows = hypre_CTAlloc(HYPRE_Int, max_level+1, HYPRE_MEMORY_HOST); - for (i= 0; i< nUventries; i++) + nrows = hypre_CTAlloc(HYPRE_Int, max_level + 1, HYPRE_MEMORY_HOST); + for (i = 0; i < nUventries; i++) { - Uventry= Uventries[iUventries[i]]; + Uventry = Uventries[iUventries[i]]; part = hypre_SStructUVEntryPart(Uventry); hypre_CopyIndex(hypre_SStructUVEntryIndex(Uventry), index); var = hypre_SStructUVEntryVar(Uventry); - nUentries= hypre_SStructUVEntryNUEntries(Uventry); + nUentries = hypre_SStructUVEntryNUEntries(Uventry); - for (k= 0; k< nUentries; k++) + for (k = 0; k < nUentries; k++) { Uentry = hypre_SStructUVEntryUEntry(Uventry, k); - + to_part = hypre_SStructUEntryToPart(Uentry); hypre_CopyIndex(hypre_SStructUEntryToIndex(Uentry), to_index); to_var = hypre_SStructUEntryToVar(Uentry); @@ -371,25 +373,25 @@ hypre_FacSetup2( void *fac_vdata, } } - for (level= 0; level <= max_level; level++) + for (level = 0; level <= max_level; level++) { HYPRE_SStructGraphAssemble(graph_level[level]); } - (fac_data -> graph_level)= graph_level; + (fac_data -> graph_level) = graph_level; /*--------------------------------------------------------------- * Create the level SStruct_Vectors, and temporary global - * sstuct_vector. + * sstuct_vector. *---------------------------------------------------------------*/ - b_level= hypre_TAlloc(hypre_SStructVector *, max_level+1, HYPRE_MEMORY_HOST); - x_level= hypre_TAlloc(hypre_SStructVector *, max_level+1, HYPRE_MEMORY_HOST); - r_level= hypre_TAlloc(hypre_SStructVector *, max_level+1, HYPRE_MEMORY_HOST); - e_level= hypre_TAlloc(hypre_SStructVector *, max_level+1, HYPRE_MEMORY_HOST); + b_level = hypre_TAlloc(hypre_SStructVector *, max_level + 1, HYPRE_MEMORY_HOST); + x_level = hypre_TAlloc(hypre_SStructVector *, max_level + 1, HYPRE_MEMORY_HOST); + r_level = hypre_TAlloc(hypre_SStructVector *, max_level + 1, HYPRE_MEMORY_HOST); + e_level = hypre_TAlloc(hypre_SStructVector *, max_level + 1, HYPRE_MEMORY_HOST); - tx_level= hypre_TAlloc(hypre_SStructPVector *, max_level+1, HYPRE_MEMORY_HOST); + tx_level = hypre_TAlloc(hypre_SStructPVector *, max_level + 1, HYPRE_MEMORY_HOST); - for (level= 0; level<= max_level; level++) + for (level = 0; level <= max_level; level++) { HYPRE_SStructVectorCreate(comm, grid_level[level], &b_level[level]); HYPRE_SStructVectorInitialize(b_level[level]); @@ -425,67 +427,67 @@ hypre_FacSetup2( void *fac_vdata, (fac_data -> x_level) = x_level; (fac_data -> r_level) = r_level; (fac_data -> e_level) = e_level; - (fac_data -> tx_level)= tx_level; + (fac_data -> tx_level) = tx_level; (fac_data -> tx) = tx; /*----------------------------------------------------------- - * Set up the level composite sstruct_matrices. + * Set up the level composite sstruct_matrices. *-----------------------------------------------------------*/ - A_level= hypre_TAlloc(hypre_SStructMatrix *, max_level+1, HYPRE_MEMORY_HOST); + A_level = hypre_TAlloc(hypre_SStructMatrix *, max_level + 1, HYPRE_MEMORY_HOST); hypre_SetIndex3(stride, 1, 1, 1); - for (level= 0; level <= max_level; level++) + for (level = 0; level <= max_level; level++) { HYPRE_SStructMatrixCreate(comm, graph_level[level], &A_level[level]); HYPRE_SStructMatrixInitialize(A_level[level]); - max_box_volume= 0; + max_box_volume = 0; pgrid = hypre_SStructGridPGrid(grid, levels[level]); nvars = hypre_SStructPGridNVars(pgrid); for (var1 = 0; var1 < nvars; var1++) { - sgrid= hypre_SStructPGridSGrid(pgrid, var1); - sgrid_boxes= hypre_StructGridBoxes(sgrid); + sgrid = hypre_SStructPGridSGrid(pgrid, var1); + sgrid_boxes = hypre_StructGridBoxes(sgrid); hypre_ForBoxI(i, sgrid_boxes) { sgrid_box = hypre_BoxArrayBox(sgrid_boxes, i); - box_volume= hypre_BoxVolume(sgrid_box); + box_volume = hypre_BoxVolume(sgrid_box); - max_box_volume= hypre_max(max_box_volume, box_volume); + max_box_volume = hypre_max(max_box_volume, box_volume); } } values = hypre_TAlloc(HYPRE_Real, max_box_volume, HYPRE_MEMORY_HOST); - A_pmatrix= hypre_SStructMatrixPMatrix(A_rap, levels[level]); + A_pmatrix = hypre_SStructMatrixPMatrix(A_rap, levels[level]); /*----------------------------------------------------------- * extract stencil values for all fine levels. *-----------------------------------------------------------*/ for (var1 = 0; var1 < nvars; var1++) { - sgrid= hypre_SStructPGridSGrid(pgrid, var1); - sgrid_boxes= hypre_StructGridBoxes(sgrid); + sgrid = hypre_SStructPGridSGrid(pgrid, var1); + sgrid_boxes = hypre_StructGridBoxes(sgrid); - stencils= hypre_SStructGraphStencil(graph, levels[level], var1); - stencil_size= hypre_SStructStencilSize(stencils); - stencil_vars= hypre_SStructStencilVars(stencils); + stencils = hypre_SStructGraphStencil(graph, levels[level], var1); + stencil_size = hypre_SStructStencilSize(stencils); + stencil_vars = hypre_SStructStencilVars(stencils); for (i = 0; i < stencil_size; i++) { - var2= stencil_vars[i]; - A_smatrix= hypre_SStructPMatrixSMatrix(A_pmatrix, var1, var2); + var2 = stencil_vars[i]; + A_smatrix = hypre_SStructPMatrixSMatrix(A_pmatrix, var1, var2); hypre_CopyIndex(hypre_SStructStencilEntry(stencils, i), stencil_shape_i); hypre_ForBoxI(j, sgrid_boxes) { - sgrid_box= hypre_BoxArrayBox(sgrid_boxes, j); - box_start= hypre_BoxIMin(sgrid_box); + sgrid_box = hypre_BoxArrayBox(sgrid_boxes, j); + box_start = hypre_BoxIMin(sgrid_box); box_end = hypre_BoxIMax(sgrid_box); - A_smatrix_dbox= hypre_BoxArrayBox(hypre_StructMatrixDataSpace(A_smatrix), j); - A_smatrix_value= + A_smatrix_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(A_smatrix), j); + A_smatrix_value = hypre_StructMatrixExtractPointerByIndex(A_smatrix, j, stencil_shape_i); hypre_BoxGetSize(sgrid_box, loop_size); @@ -495,70 +497,70 @@ hypre_FacSetup2( void *fac_vdata, sgrid_box, box_start, stride, k, A_smatrix_dbox, box_start, stride, iA); { - values[k]= A_smatrix_value[iA]; + values[k] = A_smatrix_value[iA]; } hypre_BoxLoop2End(k, iA); #undef DEVICE_VAR HYPRE_SStructMatrixSetBoxValues(A_level[level], part_fine, box_start, box_end, var1, 1, &i, values); - } /* hypre_ForBoxI */ + } /* hypre_ForBoxI */ } /* for i */ } /* for var1 */ hypre_TFree(values, HYPRE_MEMORY_HOST); /*----------------------------------------------------------- - * Extract the coarse part + * Extract the coarse part *-----------------------------------------------------------*/ if (level > 0) { - max_box_volume= 0; - pgrid = hypre_SStructGridPGrid(grid, levels[level-1]); + max_box_volume = 0; + pgrid = hypre_SStructGridPGrid(grid, levels[level - 1]); nvars = hypre_SStructPGridNVars(pgrid); for (var1 = 0; var1 < nvars; var1++) { sgrid = hypre_SStructPGridSGrid( pgrid, var1 ); - sgrid_boxes= hypre_StructGridBoxes(sgrid); + sgrid_boxes = hypre_StructGridBoxes(sgrid); hypre_ForBoxI( i, sgrid_boxes ) { sgrid_box = hypre_BoxArrayBox(sgrid_boxes, i); - box_volume= hypre_BoxVolume(sgrid_box); + box_volume = hypre_BoxVolume(sgrid_box); - max_box_volume= hypre_max(max_box_volume, box_volume ); + max_box_volume = hypre_max(max_box_volume, box_volume ); } } values = hypre_TAlloc(HYPRE_Real, max_box_volume, HYPRE_MEMORY_HOST); - A_pmatrix= hypre_SStructMatrixPMatrix(A_rap, levels[level-1]); + A_pmatrix = hypre_SStructMatrixPMatrix(A_rap, levels[level - 1]); /*----------------------------------------------------------- - * extract stencil values + * extract stencil values *-----------------------------------------------------------*/ for (var1 = 0; var1 < nvars; var1++) { sgrid = hypre_SStructPGridSGrid(pgrid, var1); - sgrid_boxes= hypre_StructGridBoxes(sgrid); + sgrid_boxes = hypre_StructGridBoxes(sgrid); - stencils= hypre_SStructGraphStencil(graph, levels[level-1], var1); - stencil_size= hypre_SStructStencilSize(stencils); - stencil_vars= hypre_SStructStencilVars(stencils); + stencils = hypre_SStructGraphStencil(graph, levels[level - 1], var1); + stencil_size = hypre_SStructStencilSize(stencils); + stencil_vars = hypre_SStructStencilVars(stencils); for (i = 0; i < stencil_size; i++) { - var2= stencil_vars[i]; - A_smatrix= hypre_SStructPMatrixSMatrix(A_pmatrix, var1, var2); + var2 = stencil_vars[i]; + A_smatrix = hypre_SStructPMatrixSMatrix(A_pmatrix, var1, var2); hypre_CopyIndex(hypre_SStructStencilEntry(stencils, i), stencil_shape_i); hypre_ForBoxI( j, sgrid_boxes ) { - sgrid_box= hypre_BoxArrayBox(sgrid_boxes, j); - box_start= hypre_BoxIMin(sgrid_box); + sgrid_box = hypre_BoxArrayBox(sgrid_boxes, j); + box_start = hypre_BoxIMin(sgrid_box); box_end = hypre_BoxIMax(sgrid_box); - A_smatrix_dbox= hypre_BoxArrayBox(hypre_StructMatrixDataSpace(A_smatrix), j); - A_smatrix_value= + A_smatrix_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(A_smatrix), j); + A_smatrix_value = hypre_StructMatrixExtractPointerByIndex(A_smatrix, j, stencil_shape_i); hypre_BoxGetSize(sgrid_box, loop_size); @@ -568,14 +570,14 @@ hypre_FacSetup2( void *fac_vdata, sgrid_box, box_start, stride, k, A_smatrix_dbox, box_start, stride, iA); { - values[k]= A_smatrix_value[iA]; + values[k] = A_smatrix_value[iA]; } hypre_BoxLoop2End(k, iA); #undef DEVICE_VAR HYPRE_SStructMatrixSetBoxValues(A_level[level], part_crse, box_start, box_end, var1, 1, &i, values); - } /* hypre_ForBoxI */ + } /* hypre_ForBoxI */ } /* for i */ } /* for var1 */ hypre_TFree(values, HYPRE_MEMORY_HOST); @@ -589,32 +591,32 @@ hypre_FacSetup2( void *fac_vdata, *-----------------------------------------------------------*/ Uventries = hypre_SStructGraphUVEntries(graph); - nUventries= hypre_SStructGraphNUVEntries(graph); - iUventries= hypre_SStructGraphIUVEntries(graph); + nUventries = hypre_SStructGraphNUVEntries(graph); + iUventries = hypre_SStructGraphIUVEntries(graph); /*----------------------------------------------------------- * Allocate memory for arguments of HYPRE_IJMatrixGetValues. *-----------------------------------------------------------*/ - ncols = hypre_TAlloc(HYPRE_Int *, max_level+1, HYPRE_MEMORY_HOST); - rows = hypre_TAlloc(HYPRE_BigInt *, max_level+1, HYPRE_MEMORY_HOST); - cols = hypre_TAlloc(HYPRE_BigInt *, max_level+1, HYPRE_MEMORY_HOST); - cnt = hypre_CTAlloc(HYPRE_Int, max_level+1, HYPRE_MEMORY_HOST); + ncols = hypre_TAlloc(HYPRE_Int *, max_level + 1, HYPRE_MEMORY_HOST); + rows = hypre_TAlloc(HYPRE_BigInt *, max_level + 1, HYPRE_MEMORY_HOST); + cols = hypre_TAlloc(HYPRE_BigInt *, max_level + 1, HYPRE_MEMORY_HOST); + cnt = hypre_CTAlloc(HYPRE_Int, max_level + 1, HYPRE_MEMORY_HOST); - ncols[0]= NULL; + ncols[0] = NULL; rows[0] = NULL; cols[0] = NULL; - for (level= 1; level<= max_level; level++) + for (level = 1; level <= max_level; level++) { - ncols[level]= hypre_TAlloc(HYPRE_Int, nrows[level], HYPRE_MEMORY_HOST); - for (i=0; i< nrows[level]; i++) + ncols[level] = hypre_TAlloc(HYPRE_Int, nrows[level], HYPRE_MEMORY_HOST); + for (i = 0; i < nrows[level]; i++) { - ncols[level][i]= 1; + ncols[level][i] = 1; } rows[level] = hypre_TAlloc(HYPRE_BigInt, nrows[level], HYPRE_MEMORY_HOST); cols[level] = hypre_TAlloc(HYPRE_BigInt, nrows[level], HYPRE_MEMORY_HOST); } - - for (i= 0; i< nUventries; i++) + + for (i = 0; i < nUventries; i++) { Uventry = Uventries[iUventries[i]]; @@ -626,30 +628,30 @@ hypre_FacSetup2( void *fac_vdata, hypre_SStructBoxManEntryGetGlobalRank(boxman_entry, index, &row_coord, matrix_type); - nUentries= hypre_SStructUVEntryNUEntries(Uventry); - for (k= 0; k< nUentries; k++) + nUentries = hypre_SStructUVEntryNUEntries(Uventry); + for (k = 0; k < nUentries; k++) { to_part = hypre_SStructUVEntryToPart(Uventry, k); to_rank = hypre_SStructUVEntryToRank(Uventry, k); - + /*----------------------------------------------------------- * store the row & col indices in the correct level. *-----------------------------------------------------------*/ level = hypre_max( part_to_level[part], part_to_level[to_part] ); - rows[level][ cnt[level] ]= row_coord; - cols[level][ cnt[level]++ ]= to_rank; + rows[level][ cnt[level] ] = row_coord; + cols[level][ cnt[level]++ ] = to_rank; } } hypre_TFree(cnt, HYPRE_MEMORY_HOST); - for (level= 1; level<= max_level; level++) + for (level = 1; level <= max_level; level++) { - + vals = hypre_CTAlloc(HYPRE_Real, nrows[level], HYPRE_MEMORY_HOST); - level_rows= hypre_TAlloc(HYPRE_BigInt, nrows[level], HYPRE_MEMORY_HOST); - level_cols= hypre_TAlloc(HYPRE_BigInt, nrows[level], HYPRE_MEMORY_HOST); + level_rows = hypre_TAlloc(HYPRE_BigInt, nrows[level], HYPRE_MEMORY_HOST); + level_cols = hypre_TAlloc(HYPRE_BigInt, nrows[level], HYPRE_MEMORY_HOST); - HYPRE_IJMatrixGetValues(ij_A, nrows[level], ncols[level], rows[level], + HYPRE_IJMatrixGetValues(ij_A, nrows[level], ncols[level], rows[level], cols[level], vals); Uventries = hypre_SStructGraphUVEntries(graph_level[level]); @@ -657,42 +659,42 @@ hypre_FacSetup2( void *fac_vdata, * Find the rows & cols of the level ij_matrices where the * extracted data must be placed. Note that because the * order in which the HYPRE_SStructGraphAddEntries in the - * graph_level's is the same order in which rows[level] & + * graph_level's is the same order in which rows[level] & * cols[level] were formed, the coefficients in val are * in the correct order. *-----------------------------------------------------------*/ - level_cnt= 0; - for (i= 0; i< hypre_SStructGraphNUVEntries(graph_level[level]); i++) + level_cnt = 0; + for (i = 0; i < hypre_SStructGraphNUVEntries(graph_level[level]); i++) { j = hypre_SStructGraphIUVEntry(graph_level[level], i); - Uventry= Uventries[j]; + Uventry = Uventries[j]; part = hypre_SStructUVEntryPart(Uventry); hypre_CopyIndex(hypre_SStructUVEntryIndex(Uventry), index); var = hypre_SStructUVEntryVar(Uventry); - + hypre_SStructGridFindBoxManEntry(grid_level[level], part, index, var, &boxman_entry); hypre_SStructBoxManEntryGetGlobalRank(boxman_entry, index, &row_coord, matrix_type); - nUentries= hypre_SStructUVEntryNUEntries(Uventry); - for (k= 0; k< nUentries; k++) + nUentries = hypre_SStructUVEntryNUEntries(Uventry); + for (k = 0; k < nUentries; k++) { to_rank = hypre_SStructUVEntryToRank(Uventry, k); - + level_rows[level_cnt] = row_coord; - level_cols[level_cnt++]= to_rank; + level_cols[level_cnt++] = to_rank; } } - + /*----------------------------------------------------------- * Place the extracted ij coefficients into the level ij * matrices. *-----------------------------------------------------------*/ HYPRE_IJMatrixSetValues( hypre_SStructMatrixIJMatrix(A_level[level]), - nrows[level], ncols[level], (const HYPRE_BigInt *) level_rows, + nrows[level], ncols[level], (const HYPRE_BigInt *) level_rows, (const HYPRE_BigInt *) level_cols, (const HYPRE_Real *) vals ); - + hypre_TFree(ncols[level], HYPRE_MEMORY_HOST); hypre_TFree(rows[level], HYPRE_MEMORY_HOST); hypre_TFree(cols[level], HYPRE_MEMORY_HOST); @@ -706,30 +708,30 @@ hypre_FacSetup2( void *fac_vdata, hypre_TFree(rows, HYPRE_MEMORY_HOST); hypre_TFree(cols, HYPRE_MEMORY_HOST); hypre_TFree(nrows, HYPRE_MEMORY_HOST); - + /*--------------------------------------------------------------- * Construct the fine grid (part 1) SStruct_PMatrix for all * levels except for max_level. This involves coarsening the - * finer level SStruct_Matrix. Coarsening involves interpolation, + * finer level SStruct_Matrix. Coarsening involves interpolation, * matvec, and restriction (to obtain the "row-sum"). *---------------------------------------------------------------*/ - matvec_data_level = hypre_TAlloc(void *, max_level+1, HYPRE_MEMORY_HOST); - pmatvec_data_level = hypre_TAlloc(void *, max_level+1, HYPRE_MEMORY_HOST); - interp_data_level = hypre_TAlloc(void *, max_level+1, HYPRE_MEMORY_HOST); - restrict_data_level= hypre_TAlloc(void *, max_level+1, HYPRE_MEMORY_HOST); - for (level= 0; level<= max_level; level++) + matvec_data_level = hypre_TAlloc(void *, max_level + 1, HYPRE_MEMORY_HOST); + pmatvec_data_level = hypre_TAlloc(void *, max_level + 1, HYPRE_MEMORY_HOST); + interp_data_level = hypre_TAlloc(void *, max_level + 1, HYPRE_MEMORY_HOST); + restrict_data_level = hypre_TAlloc(void *, max_level + 1, HYPRE_MEMORY_HOST); + for (level = 0; level <= max_level; level++) { if (level < max_level) { hypre_FacSemiInterpCreate2(&interp_data_level[level]); hypre_FacSemiInterpSetup2(interp_data_level[level], - x_level[level+1], + x_level[level + 1], hypre_SStructVectorPVector(x_level[level], part_fine), - refine_factors[level+1]); + refine_factors[level + 1]); } else { - interp_data_level[level]= NULL; + interp_data_level[level] = NULL; } if (level > 0) @@ -738,18 +740,18 @@ hypre_FacSetup2( void *fac_vdata, hypre_FacSemiRestrictSetup2(restrict_data_level[level], x_level[level], part_crse, part_fine, - hypre_SStructVectorPVector(x_level[level-1], part_fine), + hypre_SStructVectorPVector(x_level[level - 1], part_fine), refine_factors[level]); } else { - restrict_data_level[level]= NULL; + restrict_data_level[level] = NULL; } } - for (level= max_level; level> 0; level--) + for (level = max_level; level > 0; level--) { - + /* hypre_FacZeroCFSten(hypre_SStructMatrixPMatrix(A_level[level], part_fine), hypre_SStructMatrixPMatrix(A_level[level], part_crse), grid_level[level], @@ -765,7 +767,7 @@ hypre_FacSetup2( void *fac_vdata, HYPRE_SStructMatrixAssemble(A_level[level]); /*------------------------------------------------------------ - * create data structures that are needed for coarsening + * create data structures that are needed for coarsening -------------------------------------------------------------*/ hypre_SStructMatvecCreate(&matvec_data_level[level]); hypre_SStructMatvecSetup(matvec_data_level[level], @@ -774,50 +776,50 @@ hypre_FacSetup2( void *fac_vdata, hypre_SStructPMatvecCreate(&pmatvec_data_level[level]); hypre_SStructPMatvecSetup(pmatvec_data_level[level], - hypre_SStructMatrixPMatrix(A_level[level],part_fine), - hypre_SStructVectorPVector(x_level[level],part_fine)); - } + hypre_SStructMatrixPMatrix(A_level[level], part_fine), + hypre_SStructVectorPVector(x_level[level], part_fine)); + } /*--------------------------------------------------------------- * To avoid memory leaks, we cannot reference the coarsest level * SStructPMatrix. We need only copy the stuctured coefs. *---------------------------------------------------------------*/ - pgrid= hypre_SStructGridPGrid(grid_level[0], part_fine); - nvars= hypre_SStructPGridNVars(pgrid); - A_pmatrix= hypre_SStructMatrixPMatrix(A_level[0], part_fine); + pgrid = hypre_SStructGridPGrid(grid_level[0], part_fine); + nvars = hypre_SStructPGridNVars(pgrid); + A_pmatrix = hypre_SStructMatrixPMatrix(A_level[0], part_fine); for (var1 = 0; var1 < nvars; var1++) { - sgrid= hypre_SStructPGridSGrid(pgrid, var1); - sgrid_boxes= hypre_StructGridBoxes(sgrid); + sgrid = hypre_SStructPGridSGrid(pgrid, var1); + sgrid_boxes = hypre_StructGridBoxes(sgrid); - max_box_volume= 0; + max_box_volume = 0; hypre_ForBoxI(i, sgrid_boxes) { sgrid_box = hypre_BoxArrayBox(sgrid_boxes, i); - box_volume= hypre_BoxVolume(sgrid_box); + box_volume = hypre_BoxVolume(sgrid_box); - max_box_volume= hypre_max(max_box_volume, box_volume); + max_box_volume = hypre_max(max_box_volume, box_volume); } values = hypre_TAlloc(HYPRE_Real, max_box_volume, HYPRE_MEMORY_HOST); - - stencils= hypre_SStructGraphStencil(graph_level[0], part_fine, var1); - stencil_size= hypre_SStructStencilSize(stencils); - stencil_vars= hypre_SStructStencilVars(stencils); + + stencils = hypre_SStructGraphStencil(graph_level[0], part_fine, var1); + stencil_size = hypre_SStructStencilSize(stencils); + stencil_vars = hypre_SStructStencilVars(stencils); for (i = 0; i < stencil_size; i++) { - var2= stencil_vars[i]; - A_smatrix= hypre_SStructPMatrixSMatrix(A_pmatrix, var1, var2); + var2 = stencil_vars[i]; + A_smatrix = hypre_SStructPMatrixSMatrix(A_pmatrix, var1, var2); hypre_CopyIndex(hypre_SStructStencilEntry(stencils, i), stencil_shape_i); hypre_ForBoxI(j, sgrid_boxes) { - sgrid_box= hypre_BoxArrayBox(sgrid_boxes, j); - box_start= hypre_BoxIMin(sgrid_box); + sgrid_box = hypre_BoxArrayBox(sgrid_boxes, j); + box_start = hypre_BoxIMin(sgrid_box); box_end = hypre_BoxIMax(sgrid_box); - A_smatrix_dbox= hypre_BoxArrayBox(hypre_StructMatrixDataSpace(A_smatrix), j); - A_smatrix_value= + A_smatrix_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(A_smatrix), j); + A_smatrix_value = hypre_StructMatrixExtractPointerByIndex(A_smatrix, j, stencil_shape_i); hypre_BoxGetSize(sgrid_box, loop_size); @@ -827,7 +829,7 @@ hypre_FacSetup2( void *fac_vdata, sgrid_box, box_start, stride, k, A_smatrix_dbox, box_start, stride, iA); { - values[k]= A_smatrix_value[iA]; + values[k] = A_smatrix_value[iA]; } hypre_BoxLoop2End(k, iA); #undef DEVICE_VAR @@ -836,7 +838,7 @@ hypre_FacSetup2( void *fac_vdata, var1, 1, &i, values); } /* hypre_ForBoxI */ } /* for i */ - + hypre_TFree(values, HYPRE_MEMORY_HOST); } /* for var1 */ @@ -849,9 +851,9 @@ hypre_FacSetup2( void *fac_vdata, hypre_SStructPMatvecCreate(&pmatvec_data_level[0]); hypre_SStructPMatvecSetup(pmatvec_data_level[0], - hypre_SStructMatrixPMatrix(A_level[0],part_fine), - hypre_SStructVectorPVector(x_level[0],part_fine)); - + hypre_SStructMatrixPMatrix(A_level[0], part_fine), + hypre_SStructVectorPVector(x_level[0], part_fine)); + hypre_SStructMatvecCreate(&matvec_data); hypre_SStructMatvecSetup(matvec_data, A_rap, x); @@ -867,11 +869,11 @@ hypre_FacSetup2( void *fac_vdata, /*--------------------------------------------------------------- * Create the fine patch relax_data structure. *---------------------------------------------------------------*/ - relax_data_level = hypre_TAlloc(void *, max_level+1, HYPRE_MEMORY_HOST); - - for (level= 0; level<= max_level; level++) + relax_data_level = hypre_TAlloc(void *, max_level + 1, HYPRE_MEMORY_HOST); + + for (level = 0; level <= max_level; level++) { - relax_data_level[level]= hypre_SysPFMGRelaxCreate(comm); + relax_data_level[level] = hypre_SysPFMGRelaxCreate(comm); hypre_SysPFMGRelaxSetTol(relax_data_level[level], 0.0); hypre_SysPFMGRelaxSetType(relax_data_level[level], relax_type); if (usr_jacobi_weight) @@ -879,14 +881,14 @@ hypre_FacSetup2( void *fac_vdata, hypre_SysPFMGRelaxSetJacobiWeight(relax_data_level[level], jacobi_weight); } hypre_SysPFMGRelaxSetTempVec(relax_data_level[level], tx_level[level]); - hypre_SysPFMGRelaxSetup(relax_data_level[level], + hypre_SysPFMGRelaxSetup(relax_data_level[level], hypre_SStructMatrixPMatrix(A_level[level], part_fine), hypre_SStructVectorPVector(b_level[level], part_fine), hypre_SStructVectorPVector(x_level[level], part_fine)); } (fac_data -> relax_data_level) = relax_data_level; - - + + /*--------------------------------------------------------------- * Create the coarsest composite level preconditioned solver. * csolver_type= 1 multigrid-pcg @@ -898,7 +900,7 @@ hypre_FacSetup2( void *fac_vdata, HYPRE_PCGSetMaxIter((HYPRE_Solver) crse_solver, 1); HYPRE_PCGSetTol((HYPRE_Solver) crse_solver, 1.0e-6); HYPRE_PCGSetTwoNorm((HYPRE_Solver) crse_solver, 1); - + /* use SysPFMG solver as preconditioner */ HYPRE_SStructSysPFMGCreate(comm, &crse_precond); HYPRE_SStructSysPFMGSetMaxIter(crse_precond, 1); @@ -917,7 +919,7 @@ hypre_FacSetup2( void *fac_vdata, (HYPRE_PtrToSolverFcn) HYPRE_SStructSysPFMGSetup, (HYPRE_Solver) crse_precond); - HYPRE_PCGSetup((HYPRE_Solver) crse_solver, + HYPRE_PCGSetup((HYPRE_Solver) crse_solver, (HYPRE_Matrix) A_level[0], (HYPRE_Vector) b_level[0], (HYPRE_Vector) x_level[0]); @@ -925,7 +927,7 @@ hypre_FacSetup2( void *fac_vdata, else if (csolver_type == 2) { - crse_precond= NULL; + crse_precond = NULL; HYPRE_SStructSysPFMGCreate(comm, &crse_solver); HYPRE_SStructSysPFMGSetMaxIter(crse_solver, 1); @@ -949,4 +951,3 @@ hypre_FacSetup2( void *fac_vdata, return ierr; } - diff --git a/external/hypre/src/sstruct_ls/fac_solve3.c b/external/hypre/src/sstruct_ls/fac_solve3.c index 821fefde..f1cb60b9 100644 --- a/external/hypre/src/sstruct_ls/fac_solve3.c +++ b/external/hypre/src/sstruct_ls/fac_solve3.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,42 +17,44 @@ HYPRE_Int hypre_FACSolve3( void *fac_vdata, - hypre_SStructMatrix *A_user, - hypre_SStructVector *b_in, - hypre_SStructVector *x_in ) + hypre_SStructMatrix *A_user, + hypre_SStructVector *b_in, + hypre_SStructVector *x_in ) { - hypre_FACData *fac_data = (hypre_FACData*)fac_vdata; - - hypre_SStructMatrix *A_in =(fac_data-> A_rap); - hypre_SStructMatrix **A_level =(fac_data-> A_level); - hypre_SStructVector **b_level =(fac_data-> b_level); - hypre_SStructVector **x_level =(fac_data-> x_level); - hypre_SStructVector **e_level =(fac_data-> e_level); - hypre_SStructPVector **tx_level =(fac_data-> tx_level); - hypre_SStructVector *tx =(fac_data-> tx); - void **relax_data_level =(fac_data-> relax_data_level); - void **matvec_data_level =(fac_data-> matvec_data_level); - void **pmatvec_data_level =(fac_data-> pmatvec_data_level); - void **restrict_data_level=(fac_data-> restrict_data_level); - void **interp_data_level =(fac_data-> interp_data_level); - void *matvec_data =(fac_data-> matvec_data); - HYPRE_SStructSolver csolver =(fac_data-> csolver); - - HYPRE_Int max_level =(fac_data-> max_levels); - HYPRE_Int *levels =(fac_data-> level_to_part); - HYPRE_Int max_cycles =(fac_data-> max_cycles); - HYPRE_Int rel_change =(fac_data-> rel_change); - HYPRE_Int zero_guess =(fac_data-> zero_guess); - HYPRE_Int num_pre_smooth =(fac_data-> num_pre_smooth); - HYPRE_Int num_post_smooth =(fac_data-> num_post_smooth); - HYPRE_Int csolver_type =(fac_data-> csolver_type); - HYPRE_Int logging =(fac_data-> logging); - HYPRE_Real *norms =(fac_data-> norms); - HYPRE_Real *rel_norms =(fac_data-> rel_norms); - HYPRE_Real tol =(fac_data-> tol); - - HYPRE_Int part_crse= 0; - HYPRE_Int part_fine= 1; + HYPRE_UNUSED_VAR(A_user); + + hypre_FACData *fac_data = (hypre_FACData*)fac_vdata; + + hypre_SStructMatrix *A_in = (fac_data-> A_rap); + hypre_SStructMatrix **A_level = (fac_data-> A_level); + hypre_SStructVector **b_level = (fac_data-> b_level); + hypre_SStructVector **x_level = (fac_data-> x_level); + hypre_SStructVector **e_level = (fac_data-> e_level); + hypre_SStructPVector **tx_level = (fac_data-> tx_level); + hypre_SStructVector *tx = (fac_data-> tx); + void **relax_data_level = (fac_data-> relax_data_level); + void **matvec_data_level = (fac_data-> matvec_data_level); + void **pmatvec_data_level = (fac_data-> pmatvec_data_level); + void **restrict_data_level = (fac_data-> restrict_data_level); + void **interp_data_level = (fac_data-> interp_data_level); + void *matvec_data = (fac_data-> matvec_data); + HYPRE_SStructSolver csolver = (fac_data-> csolver); + + HYPRE_Int max_level = (fac_data-> max_levels); + HYPRE_Int *levels = (fac_data-> level_to_part); + HYPRE_Int max_cycles = (fac_data-> max_cycles); + HYPRE_Int rel_change = (fac_data-> rel_change); + HYPRE_Int zero_guess = (fac_data-> zero_guess); + HYPRE_Int num_pre_smooth = (fac_data-> num_pre_smooth); + HYPRE_Int num_post_smooth = (fac_data-> num_post_smooth); + HYPRE_Int csolver_type = (fac_data-> csolver_type); + HYPRE_Int logging = (fac_data-> logging); + HYPRE_Real *norms = (fac_data-> norms); + HYPRE_Real *rel_norms = (fac_data-> rel_norms); + HYPRE_Real tol = (fac_data-> tol); + + HYPRE_Int part_crse = 0; + HYPRE_Int part_fine = 1; hypre_SStructPMatrix *pA; hypre_SStructPVector *px; @@ -63,10 +65,10 @@ hypre_FACSolve3( void *fac_vdata, HYPRE_Real b_dot_b = 0, r_dot_r, eps = 0; HYPRE_Real e_dot_e = 0, e_dot_e_l, x_dot_x = 1; - + HYPRE_Int level, i; HYPRE_Int ierr = 0; - + /*-------------------------------------------------------------- * Special cases *--------------------------------------------------------------*/ @@ -89,7 +91,7 @@ hypre_FACSolve3( void *fac_vdata, } /*-------------------------------------------------------------- - * Convergence check- we need to compute the norm of the + * Convergence check- we need to compute the norm of the * composite rhs. *--------------------------------------------------------------*/ @@ -100,10 +102,10 @@ hypre_FACSolve3( void *fac_vdata, hypre_SStructInnerProd(b_in, b_in, &b_dot_b); if (b_dot_b < 0.000000001) { - hypre_SStructInnerProd(x_in, x_in, &b_dot_b); + hypre_SStructInnerProd(x_in, x_in, &b_dot_b); } - eps = tol*tol; + eps = tol * tol; /* if rhs is zero, return a zero solution */ @@ -117,7 +119,7 @@ hypre_FACSolve3( void *fac_vdata, } hypre_EndTiming(fac_data -> time_index); - return ierr; + return ierr; } } @@ -130,7 +132,7 @@ hypre_FACSolve3( void *fac_vdata, hypre_SStructMatvecCompute(matvec_data, -1.0, A_in, x_in, 1.0, tx); /*----------------------------------------------------------- - * convergence check + * convergence check *-----------------------------------------------------------*/ if (tol > 0.0) { @@ -141,20 +143,26 @@ hypre_FACSolve3( void *fac_vdata, if (logging > 0) { - norms[i] = sqrt(r_dot_r); + norms[i] = hypre_sqrt(r_dot_r); if (b_dot_b > 0) - rel_norms[i] = sqrt(r_dot_r/b_dot_b); + { + rel_norms[i] = hypre_sqrt(r_dot_r / b_dot_b); + } else + { rel_norms[i] = 0.0; + } } /* always do at least 1 FAC V-cycle */ - if ((r_dot_r/b_dot_b < eps) && (i > 0)) + if ((r_dot_r / b_dot_b < eps) && (i > 0)) { if (rel_change) { - if ((e_dot_e/x_dot_x) < eps) + if ((e_dot_e / x_dot_x) < eps) + { break; + } } else { @@ -171,9 +179,9 @@ hypre_FACSolve3( void *fac_vdata, hypre_SStructPCopy(hypre_SStructVectorPVector(tx, levels[max_level]), hypre_SStructVectorPVector(b_level[max_level], part_fine)); - for (level= 1; level<= max_level; level++) + for (level = 1; level <= max_level; level++) { - hypre_SStructPCopy(hypre_SStructVectorPVector(tx, levels[level-1]), + hypre_SStructPCopy(hypre_SStructVectorPVector(tx, levels[level - 1]), hypre_SStructVectorPVector(b_level[level], part_crse)); } @@ -181,67 +189,67 @@ hypre_FACSolve3( void *fac_vdata, * Down cycle: *--------------------------------------------------------------*/ hypre_SStructVectorSetConstantValues(x_level[max_level], 0.0); - for (level= max_level; level> 0; level--) + for (level = max_level; level > 0; level--) { /*----------------------------------------------------------- - * local fine solve: the rhs has already been updated with + * local fine solve: the rhs has already been updated with * the "unstructured" interface coupling. That is, since the * composite corrections are initialized to zero, the patch * fine-to-coarse boundary couplings (conditions) do not * contribute to the rhs of the patch equations. *-----------------------------------------------------------*/ - pA = hypre_SStructMatrixPMatrix(A_level[level], part_fine); - px = hypre_SStructVectorPVector(x_level[level], part_fine); - py = hypre_SStructVectorPVector(b_level[level], part_fine); - - hypre_FacLocalRelax(relax_data_level[level], pA, px, py, - num_pre_smooth, &zero_guess); - + pA = hypre_SStructMatrixPMatrix(A_level[level], part_fine); + px = hypre_SStructVectorPVector(x_level[level], part_fine); + py = hypre_SStructVectorPVector(b_level[level], part_fine); + + hypre_FacLocalRelax(relax_data_level[level], pA, px, py, + num_pre_smooth, &zero_guess); + /*----------------------------------------------------------- * set up the coarse part problem: update two-level composite * residual, restrict, and zero coarse approximation. * * The residual is updated using the patch solution. This - * involves coarse-to-fine matvec contributions. Since - * part_crse of x_level is zero, only zero fine-to-coarse + * involves coarse-to-fine matvec contributions. Since + * part_crse of x_level is zero, only zero fine-to-coarse * contributions are involved. *-----------------------------------------------------------*/ /* structured contribution */ - hypre_SStructPMatvecCompute(pmatvec_data_level[level], + hypre_SStructPMatvecCompute(pmatvec_data_level[level], -1.0, pA, px, 1.0, py); - + /* unstructured contribution */ - parcsrA = hypre_SStructMatrixParCSRMatrix(A_level[level]); - hypre_SStructVectorConvert(x_level[level], &parx); - hypre_SStructVectorConvert(b_level[level], &pary); - hypre_ParCSRMatrixMatvec(-1.0, parcsrA, parx, 1.0, pary); - hypre_SStructVectorRestore(x_level[level], parx); - hypre_SStructVectorRestore(b_level[level], pary); + parcsrA = hypre_SStructMatrixParCSRMatrix(A_level[level]); + hypre_SStructVectorConvert(x_level[level], &parx); + hypre_SStructVectorConvert(b_level[level], &pary); + hypre_ParCSRMatrixMatvec(-1.0, parcsrA, parx, 1.0, pary); + hypre_SStructVectorRestore(x_level[level], parx); + hypre_SStructVectorRestore(b_level[level], pary); /*----------------------------------------------------------- - * restrict the two-level composite residual. - * - * This involves restricting the two-level composite residual + * restrict the two-level composite residual. + * + * This involves restricting the two-level composite residual * of the current level to the part_fine rhs of the next - * descending level, or part_crse if the next descending + * descending level, or part_crse if the next descending * level is the coarsest. Part_fine of the two-level composite * residual is resricted, part_crse is injected. *-----------------------------------------------------------*/ - if (level > 1) - { - hypre_FACRestrict2(restrict_data_level[level], - b_level[level], - hypre_SStructVectorPVector(b_level[level-1],part_fine)); - } - else - { - hypre_FACRestrict2(restrict_data_level[level], - b_level[level], - hypre_SStructVectorPVector(b_level[level-1],part_crse)); - } - - hypre_SStructVectorSetConstantValues(x_level[level-1], 0.0); + if (level > 1) + { + hypre_FACRestrict2(restrict_data_level[level], + b_level[level], + hypre_SStructVectorPVector(b_level[level - 1], part_fine)); + } + else + { + hypre_FACRestrict2(restrict_data_level[level], + b_level[level], + hypre_SStructVectorPVector(b_level[level - 1], part_crse)); + } + + hypre_SStructVectorSetConstantValues(x_level[level - 1], 0.0); } /*----------------------------------------------------------- @@ -250,20 +258,20 @@ hypre_FACSolve3( void *fac_vdata, * A_level[0], b_level[0], x_level[0]. Therefore, copy the * solution to the part_fine. *-----------------------------------------------------------*/ - level= 0; - if (csolver_type==1) - { - HYPRE_PCGSolve((HYPRE_Solver) csolver, - (HYPRE_Matrix) A_level[0], - (HYPRE_Vector) b_level[0], - (HYPRE_Vector) x_level[0]); - } - else if (csolver_type==2) - { - HYPRE_SStructSysPFMGSolve(csolver, A_level[0], b_level[0], x_level[0]); - } - hypre_SStructPCopy(hypre_SStructVectorPVector(x_level[0], part_crse), - hypre_SStructVectorPVector(x_level[0], part_fine)); + level = 0; + if (csolver_type == 1) + { + HYPRE_PCGSolve((HYPRE_Solver) csolver, + (HYPRE_Matrix) A_level[0], + (HYPRE_Vector) b_level[0], + (HYPRE_Vector) x_level[0]); + } + else if (csolver_type == 2) + { + HYPRE_SStructSysPFMGSolve(csolver, A_level[0], b_level[0], x_level[0]); + } + hypre_SStructPCopy(hypre_SStructVectorPVector(x_level[0], part_crse), + hypre_SStructVectorPVector(x_level[0], part_fine)); #if DEBUG #endif @@ -271,11 +279,11 @@ hypre_FACSolve3( void *fac_vdata, /*----------------------------------------------------------- * Up cycle *-----------------------------------------------------------*/ - for (level= 1; level<= max_level; level++) - { + for (level = 1; level <= max_level; level++) + { /*----------------------------------------------------------- - * Interpolate error, update the residual, and correct + * Interpolate error, update the residual, and correct * (x = x + Pe_c). Interpolation is done in several stages: * 1)interpolate only the coarse unknowns away from the * refinement patch: identity interpolation, interpolated @@ -283,108 +291,108 @@ hypre_FACSolve3( void *fac_vdata, * 2) interpolate the coarse unknowns under the fine grid * patch *-----------------------------------------------------------*/ - hypre_SStructVectorSetConstantValues(e_level[level], 0.0); -/* -hypre_SStructVectorSetConstantValues(x_level[max_level-1], 1.0); -*/ + hypre_SStructVectorSetConstantValues(e_level[level], 0.0); + /* + hypre_SStructVectorSetConstantValues(x_level[max_level-1], 1.0); + */ /*----------------------------------------------------------- - * interpolation of unknowns away from the underlying + * interpolation of unknowns away from the underlying * fine grid patch. Identity interpolation. *-----------------------------------------------------------*/ - hypre_FAC_IdentityInterp2(interp_data_level[level-1], - hypre_SStructVectorPVector(x_level[level-1], part_fine), - e_level[level]); + hypre_FAC_IdentityInterp2(interp_data_level[level - 1], + hypre_SStructVectorPVector(x_level[level - 1], part_fine), + e_level[level]); /*----------------------------------------------------------- * complete the interpolation- unknowns under the fine * patch. Weighted interpolation. *-----------------------------------------------------------*/ - hypre_FAC_WeightedInterp2(interp_data_level[level-1], - hypre_SStructVectorPVector(x_level[level-1], part_fine), - e_level[level]); + hypre_FAC_WeightedInterp2(interp_data_level[level - 1], + hypre_SStructVectorPVector(x_level[level - 1], part_fine), + e_level[level]); /*----------------------------------------------------------- * add the correction to x_level *-----------------------------------------------------------*/ - hypre_SStructAxpy(1.0, e_level[level], x_level[level]); + hypre_SStructAxpy(1.0, e_level[level], x_level[level]); /*----------------------------------------------------------- * update residual due to the interpolated correction *-----------------------------------------------------------*/ - if (num_post_smooth) - { - hypre_SStructMatvecCompute(matvec_data_level[level], -1.0, - A_level[level], e_level[level], - 1.0, b_level[level]); - } + if (num_post_smooth) + { + hypre_SStructMatvecCompute(matvec_data_level[level], -1.0, + A_level[level], e_level[level], + 1.0, b_level[level]); + } /*----------------------------------------------------------- * post-smooth on the refinement patch *-----------------------------------------------------------*/ - if (num_post_smooth) - { - hypre_SStructPVectorSetConstantValues(tx_level[level], 0.0); - pA = hypre_SStructMatrixPMatrix(A_level[level], part_fine); - py = hypre_SStructVectorPVector(b_level[level], part_fine); - - hypre_FacLocalRelax(relax_data_level[level], pA, tx_level[level], py, - num_post_smooth, &zero_guess); - - /*----------------------------------------------------------- - * add the post-smooth solution to x_level and to the error - * vector e_level if level= max_level. The e_levels should - * contain only the correction to x_in. - *-----------------------------------------------------------*/ - hypre_SStructPAxpy(1.0, tx_level[level], - hypre_SStructVectorPVector(x_level[level], part_fine)); - - if (level == max_level) - { - hypre_SStructPAxpy(1.0, tx_level[level], - hypre_SStructVectorPVector(e_level[level], part_fine)); - } - } + if (num_post_smooth) + { + hypre_SStructPVectorSetConstantValues(tx_level[level], 0.0); + pA = hypre_SStructMatrixPMatrix(A_level[level], part_fine); + py = hypre_SStructVectorPVector(b_level[level], part_fine); + + hypre_FacLocalRelax(relax_data_level[level], pA, tx_level[level], py, + num_post_smooth, &zero_guess); + + /*----------------------------------------------------------- + * add the post-smooth solution to x_level and to the error + * vector e_level if level= max_level. The e_levels should + * contain only the correction to x_in. + *-----------------------------------------------------------*/ + hypre_SStructPAxpy(1.0, tx_level[level], + hypre_SStructVectorPVector(x_level[level], part_fine)); + + if (level == max_level) + { + hypre_SStructPAxpy(1.0, tx_level[level], + hypre_SStructVectorPVector(e_level[level], part_fine)); + } + } } /*-------------------------------------------------------------- * Add two-level corrections x_level to the composite solution - * x_in. + * x_in. * - * Notice that except for the finest two-level sstruct_vector, + * Notice that except for the finest two-level sstruct_vector, * only the part_crse of each two-level sstruct_vector has * a correction to x_in. For max_level, both part_crse and * part_fine has a correction to x_in. *--------------------------------------------------------------*/ - - hypre_SStructPAxpy(1.0, + + hypre_SStructPAxpy(1.0, hypre_SStructVectorPVector(x_level[max_level], part_fine), hypre_SStructVectorPVector(x_in, levels[max_level])); - for (level= 1; level<= max_level; level++) + for (level = 1; level <= max_level; level++) { - hypre_SStructPAxpy(1.0, - hypre_SStructVectorPVector(x_level[level], part_crse), - hypre_SStructVectorPVector(x_in, levels[level-1]) ); + hypre_SStructPAxpy(1.0, + hypre_SStructVectorPVector(x_level[level], part_crse), + hypre_SStructVectorPVector(x_in, levels[level - 1]) ); } /*----------------------------------------------- - * convergence check + * convergence check *-----------------------------------------------*/ if ((tol > 0.0) && (rel_change)) { - hypre_SStructInnerProd(x_in, x_in, &x_dot_x); - - hypre_SStructInnerProd(e_level[max_level], e_level[max_level], &e_dot_e); - for (level= 1; level< max_level; level++) - { - hypre_SStructPInnerProd( - hypre_SStructVectorPVector(e_level[level], part_crse), - hypre_SStructVectorPVector(e_level[level], part_crse), - &e_dot_e_l); - e_dot_e += e_dot_e_l; - } + hypre_SStructInnerProd(x_in, x_in, &x_dot_x); + + hypre_SStructInnerProd(e_level[max_level], e_level[max_level], &e_dot_e); + for (level = 1; level < max_level; level++) + { + hypre_SStructPInnerProd( + hypre_SStructVectorPVector(e_level[level], part_crse), + hypre_SStructVectorPVector(e_level[level], part_crse), + &e_dot_e_l); + e_dot_e += e_dot_e_l; + } } (fac_data -> num_iterations) = (i + 1); @@ -397,4 +405,3 @@ hypre_SStructVectorSetConstantValues(x_level[max_level-1], 1.0); return ierr; } - diff --git a/external/hypre/src/sstruct_ls/fac_zero_cdata.c b/external/hypre/src/sstruct_ls/fac_zero_cdata.c index ce56bb08..9be784f0 100644 --- a/external/hypre/src/sstruct_ls/fac_zero_cdata.c +++ b/external/hypre/src/sstruct_ls/fac_zero_cdata.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -15,7 +15,7 @@ * { * 1) refine cbox and boxman_intersect with fboxman * 2) loop over intersection boxes - * 3) coarsen and contract (only the coarse nodes on this + * 3) coarsen and contract (only the coarse nodes on this * processor) and zero data. * } * @@ -25,7 +25,7 @@ HYPRE_Int hypre_FacZeroCData( void *fac_vdata, hypre_SStructMatrix *A ) { - hypre_FACData *fac_data = (hypre_FACData*)fac_vdata; + hypre_FACData *fac_data = (hypre_FACData*)fac_vdata; hypre_SStructGrid *grid; hypre_SStructPGrid *p_cgrid; @@ -48,7 +48,7 @@ hypre_FacZeroCData( void *fac_vdata, hypre_Index *refine_factors; hypre_Index temp_index; hypre_Index ilower, iupper; - + HYPRE_Int max_level = fac_data -> max_levels; HYPRE_Int *level_to_part = fac_data -> level_to_part; @@ -61,26 +61,26 @@ hypre_FacZeroCData( void *fac_vdata, HYPRE_Int ci, i, j, rem, intersect_size; HYPRE_Real *values; - + HYPRE_Int ierr = 0; hypre_BoxInit(&scaled_box, ndim); hypre_BoxInit(&intersect_box, ndim); - for (level= max_level; level> 0; level--) + for (level = max_level; level > 0; level--) { level_pmatrix = hypre_SStructMatrixPMatrix(fac_data -> A_level[level], part_crse); grid = (fac_data -> grid_level[level]); - refine_factors= &(fac_data -> refine_factors[level]); - - p_cgrid= hypre_SStructGridPGrid(grid, part_crse); + refine_factors = &(fac_data -> refine_factors[level]); + + p_cgrid = hypre_SStructGridPGrid(grid, part_crse); nvars = hypre_SStructPGridNVars(p_cgrid); - for (var= 0; var< nvars; var++) + for (var = 0; var < nvars; var++) { stencils = hypre_SStructPMatrixSStencil(level_pmatrix, var, var); - stencil_size= hypre_StructStencilSize(stencils); + stencil_size = hypre_StructStencilSize(stencils); /*--------------------------------------------------------------------- * For each variable, find the underlying boxes for each coarse box. @@ -91,73 +91,73 @@ hypre_FacZeroCData( void *fac_vdata, hypre_ForBoxI(ci, cgrid_boxes) { - cgrid_box= hypre_BoxArrayBox(cgrid_boxes, ci); + cgrid_box = hypre_BoxArrayBox(cgrid_boxes, ci); - hypre_ClearIndex(temp_index); - hypre_StructMapCoarseToFine(hypre_BoxIMin(cgrid_box), temp_index, + hypre_ClearIndex(temp_index); + hypre_StructMapCoarseToFine(hypre_BoxIMin(cgrid_box), temp_index, *refine_factors, hypre_BoxIMin(&scaled_box)); - for (i= 0; i< ndim; i++) - { - temp_index[i]= (*refine_factors)[i]-1; - } - hypre_StructMapCoarseToFine(hypre_BoxIMax(cgrid_box), temp_index, + for (i = 0; i < ndim; i++) + { + temp_index[i] = (*refine_factors)[i] - 1; + } + hypre_StructMapCoarseToFine(hypre_BoxIMax(cgrid_box), temp_index, *refine_factors, hypre_BoxIMax(&scaled_box)); - hypre_BoxManIntersect(fboxman, hypre_BoxIMin(&scaled_box), - hypre_BoxIMax(&scaled_box), &boxman_entries, + hypre_BoxManIntersect(fboxman, hypre_BoxIMin(&scaled_box), + hypre_BoxIMax(&scaled_box), &boxman_entries, &nboxman_entries); - for (i= 0; i< nboxman_entries; i++) - { - hypre_BoxManEntryGetExtents(boxman_entries[i], ilower, iupper); - hypre_BoxSetExtents(&intersect_box, ilower, iupper); - hypre_IntersectBoxes(&intersect_box, &scaled_box, &intersect_box); + for (i = 0; i < nboxman_entries; i++) + { + hypre_BoxManEntryGetExtents(boxman_entries[i], ilower, iupper); + hypre_BoxSetExtents(&intersect_box, ilower, iupper); + hypre_IntersectBoxes(&intersect_box, &scaled_box, &intersect_box); /* adjust the box so that it is divisible by refine_factors */ - for (j= 0; j< ndim; j++) - { - rem= hypre_BoxIMin(&intersect_box)[j]%(*refine_factors)[j]; - if (rem) - { - hypre_BoxIMin(&intersect_box)[j]+=(*refine_factors)[j] - rem; - } - } - - hypre_ClearIndex(temp_index); - hypre_StructMapFineToCoarse(hypre_BoxIMin(&intersect_box), temp_index, + for (j = 0; j < ndim; j++) + { + rem = hypre_BoxIMin(&intersect_box)[j] % (*refine_factors)[j]; + if (rem) + { + hypre_BoxIMin(&intersect_box)[j] += (*refine_factors)[j] - rem; + } + } + + hypre_ClearIndex(temp_index); + hypre_StructMapFineToCoarse(hypre_BoxIMin(&intersect_box), temp_index, *refine_factors, hypre_BoxIMin(&intersect_box)); - hypre_StructMapFineToCoarse(hypre_BoxIMax(&intersect_box), temp_index, + hypre_StructMapFineToCoarse(hypre_BoxIMax(&intersect_box), temp_index, *refine_factors, hypre_BoxIMax(&intersect_box)); - intersect_size= hypre_BoxVolume(&intersect_box); - if (intersect_size > 0) - { + intersect_size = hypre_BoxVolume(&intersect_box); + if (intersect_size > 0) + { /*------------------------------------------------------------ * Coarse underlying box found. Now zero off. *------------------------------------------------------------*/ - values= hypre_CTAlloc(HYPRE_Real, intersect_size, HYPRE_MEMORY_HOST); + values = hypre_CTAlloc(HYPRE_Real, intersect_size, HYPRE_MEMORY_HOST); - for (j= 0; j< stencil_size; j++) - { - HYPRE_SStructMatrixSetBoxValues(fac_data -> A_level[level], - part_crse, - hypre_BoxIMin(&intersect_box), - hypre_BoxIMax(&intersect_box), - var, 1, &j, values); + for (j = 0; j < stencil_size; j++) + { + HYPRE_SStructMatrixSetBoxValues(fac_data -> A_level[level], + part_crse, + hypre_BoxIMin(&intersect_box), + hypre_BoxIMax(&intersect_box), + var, 1, &j, values); - HYPRE_SStructMatrixSetBoxValues(A, - level_to_part[level-1], - hypre_BoxIMin(&intersect_box), - hypre_BoxIMax(&intersect_box), - var, 1, &j, values); - } + HYPRE_SStructMatrixSetBoxValues(A, + level_to_part[level - 1], + hypre_BoxIMin(&intersect_box), + hypre_BoxIMax(&intersect_box), + var, 1, &j, values); + } - hypre_TFree(values, HYPRE_MEMORY_HOST); + hypre_TFree(values, HYPRE_MEMORY_HOST); - } /* if (intersect_size > 0) */ - } /* for (i= 0; i< nboxman_entries; i++) */ + } /* if (intersect_size > 0) */ + } /* for (i= 0; i< nboxman_entries; i++) */ - hypre_TFree(boxman_entries, HYPRE_MEMORY_HOST); + hypre_TFree(boxman_entries, HYPRE_MEMORY_HOST); } /* hypre_ForBoxI(ci, cgrid_boxes) */ } /* for (var= 0; var< nvars; var++) */ diff --git a/external/hypre/src/sstruct_ls/fac_zero_stencilcoef.c b/external/hypre/src/sstruct_ls/fac_zero_stencilcoef.c index 31c0ec24..6b02443b 100644 --- a/external/hypre/src/sstruct_ls/fac_zero_stencilcoef.c +++ b/external/hypre/src/sstruct_ls/fac_zero_stencilcoef.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -36,6 +36,8 @@ hypre_FacZeroCFSten( hypre_SStructPMatrix *Af, HYPRE_Int fine_part, hypre_Index rfactors ) { + HYPRE_UNUSED_VAR(Af); + hypre_BoxManager *fboxman; hypre_BoxManEntry **boxman_entries; HYPRE_Int nboxman_entries; @@ -83,27 +85,27 @@ hypre_FacZeroCFSten( hypre_SStructPMatrix *Af, hypre_ClearIndex(zero_index); hypre_ClearIndex(stride); hypre_ClearIndex(upper_shift); - for (i= 0; i< ndim; i++) + for (i = 0; i < ndim; i++) { - stride[i]= 1; - upper_shift[i]= rfactors[i]-1; + stride[i] = 1; + upper_shift[i] = rfactors[i] - 1; } hypre_CopyIndex(rfactors, refine_factors); if (ndim < 3) { - for (i= ndim; i< 3; i++) + for (i = ndim; i < 3; i++) { - refine_factors[i]= 1; + refine_factors[i] = 1; } } - for (var1= 0; var1< nvars; var1++) + for (var1 = 0; var1 < nvars; var1++) { - cgrid= hypre_SStructPGridSGrid(hypre_SStructPMatrixPGrid(Ac), var1); - cgrid_boxes= hypre_StructGridBoxes(cgrid); + cgrid = hypre_SStructPGridSGrid(hypre_SStructPMatrixPGrid(Ac), var1); + cgrid_boxes = hypre_StructGridBoxes(cgrid); - fboxman= hypre_SStructGridBoxManager(grid, fine_part, var1); + fboxman = hypre_SStructGridBoxManager(grid, fine_part, var1); /*------------------------------------------------------------------ * For each parent coarse box find all fboxes that may be connected @@ -112,7 +114,7 @@ hypre_FacZeroCFSten( hypre_SStructPMatrix *Af, *------------------------------------------------------------------*/ hypre_ForBoxI(ci, cgrid_boxes) { - cgrid_box= hypre_BoxArrayBox(cgrid_boxes, ci); + cgrid_box = hypre_BoxArrayBox(cgrid_boxes, ci); hypre_StructMapCoarseToFine(hypre_BoxIMin(cgrid_box), zero_index, refine_factors, hypre_BoxIMin(&scaled_box)); @@ -128,13 +130,13 @@ hypre_FacZeroCFSten( hypre_SStructPMatrix *Af, hypre_BoxIMax(&scaled_box), &boxman_entries, &nboxman_entries); - for (var2= 0; var2< nvars; var2++) + for (var2 = 0; var2 < nvars; var2++) { - stencils= hypre_SStructPMatrixSStencil(Ac, var1, var2); + stencils = hypre_SStructPMatrixSStencil(Ac, var1, var2); if (stencils != NULL) { - stencil_size= hypre_StructStencilSize(stencils); + stencil_size = hypre_StructStencilSize(stencils); smatrix = hypre_SStructPMatrixSMatrix(Ac, var1, var2); ac_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(smatrix), ci); @@ -143,7 +145,7 @@ hypre_FacZeroCFSten( hypre_SStructPMatrix *Af, * Find the stencil coefficients that must be zeroed off. * Loop over all possible boxes. *---------------------------------------------------------*/ - for (i= 0; i< stencil_size; i++) + for (i = 0; i < stencil_size; i++) { hypre_CopyIndex(hypre_StructStencilElement(stencils, i), stencil_shape); @@ -152,19 +154,19 @@ hypre_FacZeroCFSten( hypre_SStructPMatrix *Af, if (abs_shape) /* non-centre stencils are zeroed */ { /* look for connecting fboxes that must be zeroed. */ - for (j= 0; j< nboxman_entries; j++) + for (j = 0; j < nboxman_entries; j++) { hypre_BoxManEntryGetExtents(boxman_entries[j], ilower, iupper); hypre_BoxSetExtents(&fgrid_box, ilower, iupper); - shift_ibox= hypre_CF_StenBox(&fgrid_box, cgrid_box, stencil_shape, - refine_factors, ndim); + shift_ibox = hypre_CF_StenBox(&fgrid_box, cgrid_box, stencil_shape, + refine_factors, ndim); if ( hypre_BoxVolume(shift_ibox) ) { - ac_ptr= hypre_StructMatrixExtractPointerByIndex(smatrix, - ci, - stencil_shape); + ac_ptr = hypre_StructMatrixExtractPointerByIndex(smatrix, + ci, + stencil_shape); hypre_BoxGetSize(shift_ibox, loop_size); #define DEVICE_VAR is_device_ptr(ac_ptr) @@ -218,7 +220,7 @@ hypre_FacZeroFCSten( hypre_SStructPMatrix *A, hypre_SStructGrid *grid, HYPRE_Int fine_part) { - MPI_Comm comm= hypre_SStructGridComm(grid); + MPI_Comm comm = hypre_SStructGridComm(grid); hypre_BoxManager *fboxman; hypre_BoxManEntry **boxman_entries; HYPRE_Int nboxman_entries; @@ -267,24 +269,24 @@ hypre_FacZeroFCSten( hypre_SStructPMatrix *A, hypre_BoxInit(&intersect_box, ndim); hypre_ClearIndex(stride); - for (i= 0; i< ndim; i++) + for (i = 0; i < ndim; i++) { - stride[i]= 1; + stride[i] = 1; } - tmp_box_array1= hypre_BoxArrayCreate(1, ndim); + tmp_box_array1 = hypre_BoxArrayCreate(1, ndim); - for (var1= 0; var1< nvars; var1++) + for (var1 = 0; var1 < nvars; var1++) { fgrid = hypre_SStructPGridSGrid(hypre_SStructPMatrixPGrid(A), var1); - fgrid_boxes= hypre_StructGridBoxes(fgrid); + fgrid_boxes = hypre_StructGridBoxes(fgrid); fboxman = hypre_SStructGridBoxManager(grid, fine_part, var1); hypre_ForBoxI(fi, fgrid_boxes) { - fgrid_box= hypre_BoxArrayBox(fgrid_boxes, fi); + fgrid_box = hypre_BoxArrayBox(fgrid_boxes, fi); hypre_ClearIndex(size_ibox); - for (i= 0; i< ndim; i++) + for (i = 0; i < ndim; i++) { size_ibox[i] = hypre_BoxSizeD(fgrid_box, i) - 1; } @@ -299,18 +301,18 @@ hypre_FacZeroFCSten( hypre_SStructPMatrix *A, hypre_BoxIMax(&scaled_box), &boxman_entries, &nboxman_entries); - for (var2= 0; var2< nvars; var2++) + for (var2 = 0; var2 < nvars; var2++) { - stencils= hypre_SStructPMatrixSStencil(A, var1, var2); + stencils = hypre_SStructPMatrixSStencil(A, var1, var2); if (stencils != NULL) { - stencil_size= hypre_StructStencilSize(stencils); + stencil_size = hypre_StructStencilSize(stencils); smatrix = hypre_SStructPMatrixSMatrix(A, var1, var2); a_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(smatrix), fi); - for (i= 0; i< stencil_size; i++) + for (i = 0; i < stencil_size; i++) { hypre_CopyIndex(hypre_StructStencilElement(stencils, i), stencil_shape); @@ -341,10 +343,10 @@ hypre_FacZeroFCSten( hypre_SStructPMatrix *A, hypre_AddIndexes(stencil_shape, hypre_BoxIMax(&shift_ibox), 3, hypre_BoxIMax(&shift_ibox)); - intersect_boxes= hypre_BoxArrayCreate(1, ndim); - hypre_CopyBox(&shift_ibox, hypre_BoxArrayBox(intersect_boxes,0)); + intersect_boxes = hypre_BoxArrayCreate(1, ndim); + hypre_CopyBox(&shift_ibox, hypre_BoxArrayBox(intersect_boxes, 0)); - for (j= 0; j< nboxman_entries; j++) + for (j = 0; j < nboxman_entries; j++) { hypre_SStructBoxManEntryGetProcess(boxman_entries[j], &proc); hypre_SStructBoxManEntryGetBoxnum(boxman_entries[j], &fj); @@ -361,7 +363,7 @@ hypre_FacZeroFCSten( hypre_SStructPMatrix *A, hypre_CopyBox(&intersect_box, hypre_BoxArrayBox(tmp_box_array1, 0)); - tmp_box_array2= hypre_BoxArrayCreate(0, ndim); + tmp_box_array2 = hypre_BoxArrayCreate(0, ndim); hypre_SubtractBoxArrays(intersect_boxes, tmp_box_array1, @@ -376,9 +378,9 @@ hypre_FacZeroFCSten( hypre_SStructPMatrix *A, * intersect_boxes now has the shifted extents for the * coefficients to be zeroed. *-----------------------------------------------------------*/ - a_ptr= hypre_StructMatrixExtractPointerByIndex(smatrix, - fi, - stencil_shape); + a_ptr = hypre_StructMatrixExtractPointerByIndex(smatrix, + fi, + stencil_shape); hypre_ForBoxI(fj, intersect_boxes) { hypre_CopyBox(hypre_BoxArrayBox(intersect_boxes, fj), &intersect_box); @@ -417,4 +419,3 @@ hypre_FacZeroFCSten( hypre_SStructPMatrix *A, return ierr; } - diff --git a/external/hypre/src/sstruct_ls/headers b/external/hypre/src/sstruct_ls/headers deleted file mode 100644 index d42e7044..00000000 --- a/external/hypre/src/sstruct_ls/headers +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other -# HYPRE Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -INTERNAL_HEADER=_hypre_sstruct_ls.h - -#=========================================================================== -# Include guards and other includes -#=========================================================================== - -cat > $INTERNAL_HEADER <<@ - -#include - -#include "HYPRE_sstruct_ls.h" - -#ifndef hypre_SSTRUCT_LS_HEADER -#define hypre_SSTRUCT_LS_HEADER - -#include "_hypre_utilities.h" -#include "krylov.h" -#include "_hypre_struct_ls.h" -#include "_hypre_sstruct_mv.h" -#include "_hypre_parcsr_ls.h" -#include "multivector.h" - -#ifdef __cplusplus -extern "C" { -#endif - -@ - -#=========================================================================== -# Structures and prototypes -#=========================================================================== -cat sstruct_owninfo.h >> $INTERNAL_HEADER -cat sstruct_recvinfo.h >> $INTERNAL_HEADER -cat sstruct_sendinfo.h >> $INTERNAL_HEADER -cat maxwell_PTopology.h >> $INTERNAL_HEADER -cat maxwell_TV.h >> $INTERNAL_HEADER -cat sstruct_sharedDOFComm.h >> $INTERNAL_HEADER - -../utilities/protos [!F]*.c >> $INTERNAL_HEADER - -#=========================================================================== -# Include guards -#=========================================================================== - -cat >> $INTERNAL_HEADER <<@ - -#ifdef __cplusplus -} -#endif - -#endif - -@ - diff --git a/external/hypre/src/sstruct_ls/krylov.c b/external/hypre/src/sstruct_ls/krylov.c index b01b7fbe..1cf35494 100644 --- a/external/hypre/src/sstruct_ls/krylov.c +++ b/external/hypre/src/sstruct_ls/krylov.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -8,7 +8,7 @@ #include "_hypre_utilities.h" #include "_hypre_sstruct_ls.h" - + HYPRE_Int hypre_SStructKrylovCopyVector( void *x, void *y ); /*-------------------------------------------------------------------------- @@ -16,11 +16,16 @@ HYPRE_Int hypre_SStructKrylovCopyVector( void *x, void *y ); HYPRE_Int hypre_SStructKrylovIdentitySetup( void *vdata, - void *A, - void *b, - void *x ) + void *A, + void *b, + void *x ) { + HYPRE_UNUSED_VAR(vdata); + HYPRE_UNUSED_VAR(A); + HYPRE_UNUSED_VAR(b); + HYPRE_UNUSED_VAR(x); + return hypre_error_flag; } @@ -29,11 +34,13 @@ hypre_SStructKrylovIdentitySetup( void *vdata, HYPRE_Int hypre_SStructKrylovIdentity( void *vdata, - void *A, - void *b, - void *x ) + void *A, + void *b, + void *x ) { - return( hypre_SStructKrylovCopyVector(b, x) ); -} + HYPRE_UNUSED_VAR(vdata); + HYPRE_UNUSED_VAR(A); + return ( hypre_SStructKrylovCopyVector(b, x) ); +} diff --git a/external/hypre/src/sstruct_ls/krylov_sstruct.c b/external/hypre/src/sstruct_ls/krylov_sstruct.c index 6060711a..14d3e691 100644 --- a/external/hypre/src/sstruct_ls/krylov_sstruct.c +++ b/external/hypre/src/sstruct_ls/krylov_sstruct.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -21,7 +21,7 @@ hypre_SStructKrylovCAlloc( size_t count, size_t elt_size, HYPRE_MemoryLocation location ) { - return( (void*) hypre_CTAlloc(char, count * elt_size, location) ); + return ( (void*) hypre_CTAlloc(char, count * elt_size, location) ); } /*-------------------------------------------------------------------------- @@ -30,7 +30,7 @@ hypre_SStructKrylovCAlloc( size_t count, HYPRE_Int hypre_SStructKrylovFree( void *ptr ) { - hypre_TFree( ptr , HYPRE_MEMORY_HOST); + hypre_TFree( ptr, HYPRE_MEMORY_HOST); return hypre_error_flag; } @@ -45,7 +45,7 @@ hypre_SStructKrylovCreateVector( void *vvector ) hypre_SStructVector *new_vector; HYPRE_Int object_type; - HYPRE_Int nparts= hypre_SStructVectorNParts(vector); + HYPRE_Int nparts = hypre_SStructVectorNParts(vector); hypre_SStructPVector *pvector; hypre_StructVector *svector; hypre_SStructPVector *new_pvector; @@ -55,7 +55,7 @@ hypre_SStructKrylovCreateVector( void *vvector ) HYPRE_Int part; HYPRE_Int nvars, var; - object_type= hypre_SStructVectorObjectType(vector); + object_type = hypre_SStructVectorObjectType(vector); HYPRE_SStructVectorCreate(hypre_SStructVectorComm(vector), hypre_SStructVectorGrid(vector), @@ -64,18 +64,18 @@ hypre_SStructKrylovCreateVector( void *vvector ) if (object_type == HYPRE_SSTRUCT || object_type == HYPRE_STRUCT) { - for (part= 0; part< nparts; part++) + for (part = 0; part < nparts; part++) { pvector = hypre_SStructVectorPVector(vector, part); - new_pvector= hypre_SStructVectorPVector(new_vector, part); + new_pvector = hypre_SStructVectorPVector(new_vector, part); nvars = hypre_SStructPVectorNVars(pvector); - for (var= 0; var< nvars; var++) + for (var = 0; var < nvars; var++) { - svector= hypre_SStructPVectorSVector(pvector, var); - num_ghost= hypre_StructVectorNumGhost(svector); + svector = hypre_SStructPVectorSVector(pvector, var); + num_ghost = hypre_StructVectorNumGhost(svector); - new_svector= hypre_SStructPVectorSVector(new_pvector, var); + new_svector = hypre_SStructPVectorSVector(new_pvector, var); hypre_StructVectorSetNumGhost(new_svector, num_ghost); } } @@ -93,11 +93,11 @@ hypre_SStructKrylovCreateVector( void *vvector ) void * hypre_SStructKrylovCreateVectorArray(HYPRE_Int n, void *vvector ) { - hypre_SStructVector *vector = (hypre_SStructVector *)vvector; + hypre_SStructVector *vector = (hypre_SStructVector *)vvector; hypre_SStructVector **new_vector; HYPRE_Int object_type; - HYPRE_Int nparts= hypre_SStructVectorNParts(vector); + HYPRE_Int nparts = hypre_SStructVectorNParts(vector); hypre_SStructPVector *pvector; hypre_StructVector *svector; hypre_SStructPVector *new_pvector; @@ -109,10 +109,10 @@ hypre_SStructKrylovCreateVectorArray(HYPRE_Int n, void *vvector ) HYPRE_Int i; - object_type= hypre_SStructVectorObjectType(vector); + object_type = hypre_SStructVectorObjectType(vector); new_vector = hypre_CTAlloc(hypre_SStructVector*, n, HYPRE_MEMORY_HOST); - for (i=0; i < n; i++) + for (i = 0; i < n; i++) { HYPRE_SStructVectorCreate(hypre_SStructVectorComm(vector), hypre_SStructVectorGrid(vector), @@ -121,18 +121,18 @@ hypre_SStructKrylovCreateVectorArray(HYPRE_Int n, void *vvector ) if (object_type == HYPRE_SSTRUCT || object_type == HYPRE_STRUCT) { - for (part= 0; part< nparts; part++) + for (part = 0; part < nparts; part++) { pvector = hypre_SStructVectorPVector(vector, part); - new_pvector= hypre_SStructVectorPVector(new_vector[i], part); + new_pvector = hypre_SStructVectorPVector(new_vector[i], part); nvars = hypre_SStructPVectorNVars(pvector); - for (var= 0; var< nvars; var++) + for (var = 0; var < nvars; var++) { - svector= hypre_SStructPVectorSVector(pvector, var); - num_ghost= hypre_StructVectorNumGhost(svector); + svector = hypre_SStructPVectorSVector(pvector, var); + num_ghost = hypre_StructVectorNumGhost(svector); - new_svector= hypre_SStructPVectorSVector(new_pvector, var); + new_svector = hypre_SStructPVectorSVector(new_pvector, var); hypre_StructVectorSetNumGhost(new_svector, num_ghost); } } @@ -151,9 +151,9 @@ hypre_SStructKrylovCreateVectorArray(HYPRE_Int n, void *vvector ) HYPRE_Int hypre_SStructKrylovDestroyVector( void *vvector ) { - hypre_SStructVector *vector = (hypre_SStructVector *)vvector; + hypre_SStructVector *vector = (hypre_SStructVector *)vvector; - return( HYPRE_SStructVectorDestroy( vector ) ); + return ( HYPRE_SStructVectorDestroy( vector ) ); } /*-------------------------------------------------------------------------- @@ -184,6 +184,8 @@ hypre_SStructKrylovMatvec( void *matvec_data, HYPRE_Complex beta, void *y ) { + HYPRE_UNUSED_VAR(matvec_data); + return ( hypre_SStructMatvec( alpha, (hypre_SStructMatrix *) A, (hypre_SStructVector *) x, @@ -268,8 +270,7 @@ hypre_SStructKrylovCommInfo( void *A, HYPRE_Int *num_procs ) { MPI_Comm comm = hypre_SStructMatrixComm((hypre_SStructMatrix *) A); - hypre_MPI_Comm_size(comm,num_procs); - hypre_MPI_Comm_rank(comm,my_id); + hypre_MPI_Comm_size(comm, num_procs); + hypre_MPI_Comm_rank(comm, my_id); return hypre_error_flag; } - diff --git a/external/hypre/src/sstruct_ls/maxwell_PNedelec.c b/external/hypre/src/sstruct_ls/maxwell_PNedelec.c index c0d31568..551fb4ba 100644 --- a/external/hypre/src/sstruct_ls/maxwell_PNedelec.c +++ b/external/hypre/src/sstruct_ls/maxwell_PNedelec.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -20,7 +20,7 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, hypre_SStructGrid *cgrid_edge, hypre_Index rfactor ) { - MPI_Comm comm= (fgrid_edge-> comm); + MPI_Comm comm = (fgrid_edge-> comm); HYPRE_IJMatrix edge_Edge; @@ -53,16 +53,16 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, hypre_Index ishift, jshift, kshift, zero_index, one_index; HYPRE_Int n_boxoffsets; - HYPRE_Int nparts= hypre_SStructGridNParts(fgrid_edge); + HYPRE_Int nparts = hypre_SStructGridNParts(fgrid_edge); HYPRE_Int ndim = hypre_SStructGridNDim(fgrid_edge); HYPRE_SStructVariable *vartypes, *Edge_vartypes; hypre_Index *varoffsets; HYPRE_Int *vartype_map; - HYPRE_Int matrix_type= HYPRE_PARCSR; + HYPRE_Int matrix_type = HYPRE_PARCSR; HYPRE_Int nvars, Edge_nvars, part, var; - HYPRE_Int tot_vars= 8; + HYPRE_Int tot_vars = 8; HYPRE_Int t, i, j, k, m, n, size; HYPRE_BigInt l, p; @@ -75,7 +75,7 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, HYPRE_Int *num_vboxes, **vboxnums; HYPRE_Int trueV = 1; - HYPRE_Int falseV= 0; + HYPRE_Int falseV = 0; HYPRE_Int row_in; HYPRE_Int myproc; @@ -86,17 +86,14 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, hypre_SetIndex3(ishift, 1, 0, 0); hypre_SetIndex3(jshift, 0, 1, 0); hypre_SetIndex3(kshift, 0, 0, 1); - hypre_SetIndex3(zero_index, 0, 0, 0); - hypre_SetIndex3(one_index, 0, 0, 0); - for (i= 0; i< ndim; i++) - { - one_index[i]= 1; - } + hypre_SetIndex(zero_index, 0); + hypre_SetIndex(one_index, 1); + hypre_SetIndex(lindex, 0); /* set rfactor[2]= 1 if ndim=2. */ if (ndim == 2) { - rfactor[2]= 1; + rfactor[2] = 1; } /*------------------------------------------------------------------- @@ -110,51 +107,51 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, * We will continue to call them edges, but use the face variable * enumeration. *-------------------------------------------------------------------*/ - varoffsets= hypre_CTAlloc(hypre_Index, tot_vars, HYPRE_MEMORY_HOST); + varoffsets = hypre_CTAlloc(hypre_Index, tot_vars, HYPRE_MEMORY_HOST); /* total of 8 variable types. Create a mapping between user enumeration to hypre enumeration. Only need for edge grids. */ - vartype_map= hypre_CTAlloc(HYPRE_Int, tot_vars, HYPRE_MEMORY_HOST); + vartype_map = hypre_CTAlloc(HYPRE_Int, tot_vars, HYPRE_MEMORY_HOST); - part= 0; + part = 0; p_cgrid = hypre_SStructGridPGrid(cgrid_edge, part); nvars = hypre_SStructPGridNVars(p_cgrid); - vartypes= hypre_SStructPGridVarTypes(p_cgrid); + vartypes = hypre_SStructPGridVarTypes(p_cgrid); - for (i= 0; i< nvars; i++) + for (i = 0; i < nvars; i++) { - t= vartypes[i]; + t = vartypes[i]; hypre_SStructVariableGetOffset((hypre_SStructVariable) t, ndim, varoffsets[t]); - switch(t) + switch (t) { case 2: { - vartype_map[2]= i; + vartype_map[2] = i; break; } case 3: { - vartype_map[3]= i; + vartype_map[3] = i; break; } case 5: { - vartype_map[5]= i; + vartype_map[5] = i; break; } case 6: { - vartype_map[6]= i; + vartype_map[6] = i; break; } case 7: { - vartype_map[7]= i; + vartype_map[7] = i; break; } } @@ -162,15 +159,15 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, /* local sizes */ nedges = 0; - for (part= 0; part< nparts; part++) + for (part = 0; part < nparts; part++) { /* same for 2-d & 3-d, assuming that fgrid_edge= fgrid_face in input */ p_fgrid = hypre_SStructGridPGrid(fgrid_edge, part); /* edge fgrid */ nvars = hypre_SStructPGridNVars(p_fgrid); - for (var= 0; var< nvars; var++) + for (var = 0; var < nvars; var++) { - var_fgrid= hypre_SStructPGridSGrid(p_fgrid, var); + var_fgrid = hypre_SStructPGridSGrid(p_fgrid, var); nedges += hypre_StructGridLocalSize(var_fgrid); } } @@ -181,28 +178,28 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, * the extraction, a cbox can land in more than 1 fboxes (e.g., cbox * boundary extending into other fboxes). *--------------------------------------------------------------------------*/ - cfbox_mapping= hypre_TAlloc(HYPRE_Int *, nparts, HYPRE_MEMORY_HOST); - fcbox_mapping= hypre_TAlloc(HYPRE_Int *, nparts, HYPRE_MEMORY_HOST); - for (i= 0; i< nparts; i++) + cfbox_mapping = hypre_TAlloc(HYPRE_Int *, nparts, HYPRE_MEMORY_HOST); + fcbox_mapping = hypre_TAlloc(HYPRE_Int *, nparts, HYPRE_MEMORY_HOST); + for (i = 0; i < nparts; i++) { p_fgrid = hypre_SStructGridPGrid(fgrid_edge, i); - var_fgrid= hypre_SStructPGridCellSGrid(p_fgrid); + var_fgrid = hypre_SStructPGridCellSGrid(p_fgrid); fboxes = hypre_StructGridBoxes(var_fgrid); j = hypre_BoxArraySize(fboxes); - fcbox_mapping[i]= hypre_CTAlloc(HYPRE_Int, j, HYPRE_MEMORY_HOST); + fcbox_mapping[i] = hypre_CTAlloc(HYPRE_Int, j, HYPRE_MEMORY_HOST); p_cgrid = hypre_SStructGridPGrid(cgrid_edge, i); - var_cgrid= hypre_SStructPGridCellSGrid(p_cgrid); + var_cgrid = hypre_SStructPGridCellSGrid(p_cgrid); cboxes = hypre_StructGridBoxes(var_cgrid); j = hypre_BoxArraySize(fboxes); - cfbox_mapping[i]= hypre_CTAlloc(HYPRE_Int, j, HYPRE_MEMORY_HOST); + cfbox_mapping[i] = hypre_CTAlloc(HYPRE_Int, j, HYPRE_MEMORY_HOST); /* assuming if i1 > i2 and (box j1) is coarsened from (box i1) and (box j2) from (box i2), then j1 > j2. */ - k= 0; + k = 0; hypre_ForBoxI(j, fboxes) { - fbox= hypre_BoxArrayBox(fboxes, j); + fbox = hypre_BoxArrayBox(fboxes, j); hypre_CopyBox(fbox, ©_box); hypre_ProjectBox(©_box, zero_index, rfactor); hypre_StructMapFineToCoarse(hypre_BoxIMin(©_box), zero_index, @@ -214,12 +211,12 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, ordering, we only have to check if the first cbox in the list intersects with copy_box. If not, this fbox vanished in the coarsening. Note that this gives you the correct interior cbox. */ - cbox= hypre_BoxArrayBox(cboxes, k); + cbox = hypre_BoxArrayBox(cboxes, k); hypre_IntersectBoxes(©_box, cbox, ©_box); if (hypre_BoxVolume(©_box)) { - cfbox_mapping[i][k]= j; - fcbox_mapping[i][j]= k; + cfbox_mapping[i][k] = j; + fcbox_mapping[i][j] = k; k++; } /* if (hypre_BoxVolume(©_box)) */ } /* hypre_ForBoxI(j, fboxes) */ @@ -228,26 +225,26 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, /* variable rank bounds for this processor */ n_CtoVbox = hypre_TAlloc(HYPRE_Int **, nparts, HYPRE_MEMORY_HOST); CtoVboxnums = hypre_TAlloc(HYPRE_Int ***, nparts, HYPRE_MEMORY_HOST); - for (part= 0; part< nparts; part++) + for (part = 0; part < nparts; part++) { hypre_SStructCellGridBoxNumMap(fgrid_edge, part, &n_CtoVbox[part], &CtoVboxnums[part]); } /* variable rank bounds for this processor */ - lower_ranks= hypre_TAlloc(HYPRE_BigInt *, nparts, HYPRE_MEMORY_HOST); - upper_ranks= hypre_TAlloc(HYPRE_BigInt *, nparts, HYPRE_MEMORY_HOST); - for (part= 0; part< nparts; part++) + lower_ranks = hypre_TAlloc(HYPRE_BigInt *, nparts, HYPRE_MEMORY_HOST); + upper_ranks = hypre_TAlloc(HYPRE_BigInt *, nparts, HYPRE_MEMORY_HOST); + for (part = 0; part < nparts; part++) { p_fgrid = hypre_SStructGridPGrid(fgrid_edge, part); - Edge_nvars= hypre_SStructPGridNVars(p_fgrid); + Edge_nvars = hypre_SStructPGridNVars(p_fgrid); - lower_ranks[part]= hypre_CTAlloc(HYPRE_BigInt, Edge_nvars, HYPRE_MEMORY_HOST); - upper_ranks[part]= hypre_CTAlloc(HYPRE_BigInt, Edge_nvars, HYPRE_MEMORY_HOST); - for (t= 0; t< Edge_nvars; t++) + lower_ranks[part] = hypre_CTAlloc(HYPRE_BigInt, Edge_nvars, HYPRE_MEMORY_HOST); + upper_ranks[part] = hypre_CTAlloc(HYPRE_BigInt, Edge_nvars, HYPRE_MEMORY_HOST); + for (t = 0; t < Edge_nvars; t++) { - var_fgrid= hypre_SStructPGridSGrid(p_fgrid, t); - box_array= hypre_StructGridBoxes(var_fgrid); + var_fgrid = hypre_SStructPGridSGrid(p_fgrid, t); + box_array = hypre_StructGridBoxes(var_fgrid); fbox = hypre_BoxArrayBox(box_array, 0); hypre_CopyIndex(hypre_BoxIMin(fbox), findex); @@ -256,7 +253,7 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, hypre_SStructBoxManEntryGetGlobalRank(entry, findex, &lower_ranks[part][t], matrix_type); - fbox= hypre_BoxArrayBox(box_array, hypre_BoxArraySize(box_array)-1); + fbox = hypre_BoxArrayBox(box_array, hypre_BoxArraySize(box_array) - 1); hypre_CopyIndex(hypre_BoxIMax(fbox), findex); hypre_SStructGridFindBoxManEntry(fgrid_edge, part, findex, t, &entry); @@ -272,31 +269,31 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, /* edge_Edge. Same for 2-d and 3-d. */ /* lower rank */ - start_rank1= hypre_SStructGridStartRank(fgrid_edge); - start_rank2= hypre_SStructGridStartRank(cgrid_edge); + start_rank1 = hypre_SStructGridStartRank(fgrid_edge); + start_rank2 = hypre_SStructGridStartRank(cgrid_edge); ilower = start_rank1; jlower = start_rank2; /* upper rank */ - part= nparts-1; + part = nparts - 1; p_fgrid = hypre_SStructGridPGrid(fgrid_edge, part); nvars = hypre_SStructPGridNVars(p_fgrid); - var_fgrid= hypre_SStructPGridSGrid(p_fgrid, nvars-1); + var_fgrid = hypre_SStructPGridSGrid(p_fgrid, nvars - 1); fboxes = hypre_StructGridBoxes(var_fgrid); - fbox = hypre_BoxArrayBox(fboxes, hypre_BoxArraySize(fboxes)-1); + fbox = hypre_BoxArrayBox(fboxes, hypre_BoxArraySize(fboxes) - 1); - hypre_SStructGridBoxProcFindBoxManEntry(fgrid_edge, part, nvars-1, - hypre_BoxArraySize(fboxes)-1, myproc, &entry); + hypre_SStructGridBoxProcFindBoxManEntry(fgrid_edge, part, nvars - 1, + hypre_BoxArraySize(fboxes) - 1, myproc, &entry); hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMax(fbox), &iupper); p_cgrid = hypre_SStructGridPGrid(cgrid_edge, part); nvars = hypre_SStructPGridNVars(p_cgrid); - var_cgrid= hypre_SStructPGridSGrid(p_cgrid, nvars-1); + var_cgrid = hypre_SStructPGridSGrid(p_cgrid, nvars - 1); cboxes = hypre_StructGridBoxes(var_cgrid); - cbox = hypre_BoxArrayBox(cboxes, hypre_BoxArraySize(cboxes)-1); + cbox = hypre_BoxArrayBox(cboxes, hypre_BoxArraySize(cboxes) - 1); - hypre_SStructGridBoxProcFindBoxManEntry(cgrid_edge, part, nvars-1, - hypre_BoxArraySize(cboxes)-1, myproc, &entry); + hypre_SStructGridBoxProcFindBoxManEntry(cgrid_edge, part, nvars - 1, + hypre_BoxArraySize(cboxes) - 1, myproc, &entry); hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMax(cbox), &jupper); HYPRE_IJMatrixCreate(comm, ilower, iupper, jlower, jupper, &edge_Edge); @@ -323,51 +320,51 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, /* count the row/col connections */ iedgeEdge = hypre_CTAlloc(HYPRE_BigInt, nedges, HYPRE_MEMORY_HOST); - ncols_edgeEdge= hypre_CTAlloc(HYPRE_Int, nedges, HYPRE_MEMORY_HOST); + ncols_edgeEdge = hypre_CTAlloc(HYPRE_Int, nedges, HYPRE_MEMORY_HOST); /* get the contracted boxes */ - contract_fedgeBoxes= hypre_TAlloc(hypre_BoxArray *, nparts, HYPRE_MEMORY_HOST); - Edge_cstarts= hypre_TAlloc(hypre_Index *, nparts, HYPRE_MEMORY_HOST); - upper_shifts= hypre_TAlloc(hypre_Index *, nparts, HYPRE_MEMORY_HOST); - lower_shifts= hypre_TAlloc(hypre_Index *, nparts, HYPRE_MEMORY_HOST); + contract_fedgeBoxes = hypre_TAlloc(hypre_BoxArray *, nparts, HYPRE_MEMORY_HOST); + Edge_cstarts = hypre_TAlloc(hypre_Index *, nparts, HYPRE_MEMORY_HOST); + upper_shifts = hypre_TAlloc(hypre_Index *, nparts, HYPRE_MEMORY_HOST); + lower_shifts = hypre_TAlloc(hypre_Index *, nparts, HYPRE_MEMORY_HOST); - for (part= 0; part< nparts; part++) + for (part = 0; part < nparts; part++) { p_fgrid = hypre_SStructGridPGrid(fgrid_edge, part); - var_fgrid= hypre_SStructPGridCellSGrid(p_fgrid); + var_fgrid = hypre_SStructPGridCellSGrid(p_fgrid); fboxes = hypre_StructGridBoxes(var_fgrid); /* fill up the contracted box_array */ - contract_fedgeBoxes[part]= hypre_BoxArrayCreate(0, ndim); - Edge_cstarts[part]= hypre_TAlloc(hypre_Index, hypre_BoxArraySize(fboxes), HYPRE_MEMORY_HOST); - upper_shifts[part]= hypre_TAlloc(hypre_Index, hypre_BoxArraySize(fboxes), HYPRE_MEMORY_HOST); - lower_shifts[part]= hypre_TAlloc(hypre_Index, hypre_BoxArraySize(fboxes), HYPRE_MEMORY_HOST); + contract_fedgeBoxes[part] = hypre_BoxArrayCreate(0, ndim); + Edge_cstarts[part] = hypre_TAlloc(hypre_Index, hypre_BoxArraySize(fboxes), HYPRE_MEMORY_HOST); + upper_shifts[part] = hypre_TAlloc(hypre_Index, hypre_BoxArraySize(fboxes), HYPRE_MEMORY_HOST); + lower_shifts[part] = hypre_TAlloc(hypre_Index, hypre_BoxArraySize(fboxes), HYPRE_MEMORY_HOST); hypre_ForBoxI(i, fboxes) { - fbox= hypre_BoxArrayBox(fboxes, i); + fbox = hypre_BoxArrayBox(fboxes, i); /* contract the fbox to correspond to the correct cbox */ - cbox= hypre_BoxContraction(fbox, var_fgrid, rfactor); + cbox = hypre_BoxContraction(fbox, var_fgrid, rfactor); hypre_AppendBox(cbox, contract_fedgeBoxes[part]); /* record the offset mapping between the coarse cell index and the fine cell index */ hypre_ClearIndex(upper_shifts[part][i]); hypre_ClearIndex(lower_shifts[part][i]); - for (k= 0; k< ndim; k++) + for (k = 0; k < ndim; k++) { - m= hypre_BoxIMin(cbox)[k]; - p= m%rfactor[k]; + m = hypre_BoxIMin(cbox)[k]; + p = m % rfactor[k]; if (p > 0 && m > 0) { - upper_shifts[part][i][k]= p-1; - lower_shifts[part][i][k]= p-rfactor[k]; + upper_shifts[part][i][k] = p - 1; + lower_shifts[part][i][k] = p - rfactor[k]; } else { - upper_shifts[part][i][k]= rfactor[k]-p-1; - lower_shifts[part][i][k]=-p; + upper_shifts[part][i][k] = rfactor[k] - p - 1; + lower_shifts[part][i][k] = -p; } } @@ -386,27 +383,27 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, * loop first over the fedges aligning with the agglomerate coarse edges. * Will loop over the face & interior edges separately also. *-----------------------------------------------------------------------*/ - j= 0; - for (part= 0; part< nparts; part++) + j = 0; + for (part = 0; part < nparts; part++) { - p_fgrid= hypre_SStructGridPGrid(fgrid_edge, part); /* edge grid */ - Edge_nvars= hypre_SStructPGridNVars(p_fgrid); - Edge_vartypes= hypre_SStructPGridVarTypes(p_fgrid); + p_fgrid = hypre_SStructGridPGrid(fgrid_edge, part); /* edge grid */ + Edge_nvars = hypre_SStructPGridNVars(p_fgrid); + Edge_vartypes = hypre_SStructPGridVarTypes(p_fgrid); /* note that fboxes are the contracted CELL boxes. Will get the correct variable grid extents. */ - fboxes= contract_fedgeBoxes[part]; + fboxes = contract_fedgeBoxes[part]; - for (t= 0; t< Edge_nvars; t++) + for (t = 0; t < Edge_nvars; t++) { var = Edge_vartypes[t]; var_fgrid = hypre_SStructPGridVTSGrid(p_fgrid, var); box_array = hypre_StructGridBoxes(var_fgrid); - n_boxoffsets= ndim-1; + n_boxoffsets = ndim - 1; boxoffset = hypre_CTAlloc(hypre_Index, n_boxoffsets, HYPRE_MEMORY_HOST); suboffset = hypre_CTAlloc(hypre_Index, n_boxoffsets, HYPRE_MEMORY_HOST); - switch(var) + switch (var) { case 2: /* 2-d: x_face (vertical edges), stride=[rfactor[0],1,1] */ { @@ -414,7 +411,7 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, hypre_CopyIndex(varoffsets[2], var_index); /* boxoffset shrink in the i direction */ - hypre_SetIndex3(boxoffset[0], rfactor[0]-1, 0, 0); + hypre_SetIndex3(boxoffset[0], rfactor[0] - 1, 0, 0); hypre_SetIndex3(suboffset[0], 1, 0, 0); /* extend loop_size by one in the stride direction */ @@ -428,7 +425,7 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, hypre_CopyIndex(varoffsets[3], var_index); /* boxoffset shrink in the j direction */ - hypre_SetIndex3(boxoffset[0], 0, rfactor[1]-1, 0); + hypre_SetIndex3(boxoffset[0], 0, rfactor[1] - 1, 0); hypre_SetIndex3(suboffset[0], 0, 1, 0); /* extend loop_size by one in the stride direction */ @@ -442,8 +439,8 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, hypre_CopyIndex(varoffsets[5], var_index); /* boxoffset shrink in the j & k directions */ - hypre_SetIndex3(boxoffset[0], 0, rfactor[1]-1, 0); - hypre_SetIndex3(boxoffset[1], 0, 0, rfactor[2]-1); + hypre_SetIndex3(boxoffset[0], 0, rfactor[1] - 1, 0); + hypre_SetIndex3(boxoffset[1], 0, 0, rfactor[2] - 1); hypre_SetIndex3(suboffset[0], 0, 1, 0); hypre_SetIndex3(suboffset[1], 0, 0, 1); @@ -458,8 +455,8 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, hypre_CopyIndex(varoffsets[6], var_index); /* boxoffset shrink in the i & k directions */ - hypre_SetIndex3(boxoffset[0], rfactor[0]-1, 0, 0); - hypre_SetIndex3(boxoffset[1], 0, 0, rfactor[2]-1); + hypre_SetIndex3(boxoffset[0], rfactor[0] - 1, 0, 0); + hypre_SetIndex3(boxoffset[1], 0, 0, rfactor[2] - 1); hypre_SetIndex3(suboffset[0], 1, 0, 0); hypre_SetIndex3(suboffset[1], 0, 0, 1); @@ -474,8 +471,8 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, hypre_CopyIndex(varoffsets[7], var_index); /* boxoffset shrink in the i & j directions */ - hypre_SetIndex3(boxoffset[0], rfactor[0]-1, 0, 0); - hypre_SetIndex3(boxoffset[1], 0, rfactor[1]-1, 0); + hypre_SetIndex3(boxoffset[0], rfactor[0] - 1, 0, 0); + hypre_SetIndex3(boxoffset[1], 0, rfactor[1] - 1, 0); hypre_SetIndex3(suboffset[0], 1, 0, 0); hypre_SetIndex3(suboffset[1], 0, 1, 0); @@ -487,10 +484,10 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, hypre_ForBoxI(i, fboxes) { - cellbox= hypre_BoxArrayBox(fboxes, i); + cellbox = hypre_BoxArrayBox(fboxes, i); /* vboxes inside the i'th cellbox */ - num_vboxes= n_CtoVbox[part][i]; + num_vboxes = n_CtoVbox[part][i]; vboxnums = CtoVboxnums[part][i]; /* adjust the project cellbox to the variable box */ @@ -502,19 +499,19 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, has to be decreased, then we decrease it by (rfactor[j]-1) in the appropriate direction. Check the location of the shifted lower box index. */ - for (k= 0; k< n_boxoffsets; k++) + for (k = 0; k < n_boxoffsets; k++) { hypre_SubtractIndexes(hypre_BoxIMin(©_box), suboffset[k], 3, findex); - row_in= falseV; - for (p= 0; p< num_vboxes[t]; p++) + row_in = falseV; + for (p = 0; p < num_vboxes[t]; p++) { - vbox= hypre_BoxArrayBox(box_array, vboxnums[t][p]); + vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); if (hypre_IndexInBox(findex, vbox)) { hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in= trueV; + row_in = trueV; break; } } @@ -539,9 +536,9 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, { zypre_BoxLoopGetIndex(lindex); hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - for (k= 0; k< 3; k++) + for (k = 0; k < 3; k++) { - findex[k]*= stride[k]; + findex[k] *= stride[k]; } hypre_AddIndexes(findex, start, 3, findex); @@ -551,8 +548,8 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, /* still row p may be outside the processor- check to make sure in */ if ( (p <= upper_ranks[part][t]) && (p >= lower_ranks[part][t]) ) { - iedgeEdge[j]= p; - ncols_edgeEdge[j]= 1; + iedgeEdge[j] = p; + ncols_edgeEdge[j] = 1; j++; } } @@ -571,42 +568,42 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, *-----------------------------------------------------------------------*/ if (ndim == 3) { - for (part= 0; part< nparts; part++) + for (part = 0; part < nparts; part++) { - p_fgrid= hypre_SStructGridPGrid(fgrid_edge, part); /* edge grid */ - Edge_nvars= hypre_SStructPGridNVars(p_fgrid); - Edge_vartypes= hypre_SStructPGridVarTypes(p_fgrid); + p_fgrid = hypre_SStructGridPGrid(fgrid_edge, part); /* edge grid */ + Edge_nvars = hypre_SStructPGridNVars(p_fgrid); + Edge_vartypes = hypre_SStructPGridVarTypes(p_fgrid); /* note that fboxes are the contracted CELL boxes. Will get the correct variable grid extents. */ - fboxes= contract_fedgeBoxes[part]; + fboxes = contract_fedgeBoxes[part]; /* may need to shrink a given box in some boxoffset directions */ - boxoffset= hypre_TAlloc(hypre_Index, ndim, HYPRE_MEMORY_HOST); - for (t= 0; t< ndim; t++) + boxoffset = hypre_TAlloc(hypre_Index, ndim, HYPRE_MEMORY_HOST); + for (t = 0; t < ndim; t++) { hypre_ClearIndex(boxoffset[t]); - hypre_IndexD(boxoffset[t], t)= rfactor[t]-1; + hypre_IndexD(boxoffset[t], t) = rfactor[t] - 1; } - for (t= 0; t< Edge_nvars; t++) + for (t = 0; t < Edge_nvars; t++) { var = Edge_vartypes[t]; - var_fgrid= hypre_SStructPGridVTSGrid(p_fgrid, var); - box_array= hypre_StructGridBoxes(var_fgrid); + var_fgrid = hypre_SStructPGridVTSGrid(p_fgrid, var); + box_array = hypre_StructGridBoxes(var_fgrid); /* to reduce comparison, take the switch outside of the loop */ - switch(var) + switch (var) { case 5: { /* 3-d x_edge, can be Y or Z_Face */ hypre_ForBoxI(i, fboxes) { - cellbox= hypre_BoxArrayBox(fboxes, i); + cellbox = hypre_BoxArrayBox(fboxes, i); /* vboxes inside the i'th cellbox */ - num_vboxes= n_CtoVbox[part][i]; + num_vboxes = n_CtoVbox[part][i]; vboxnums = CtoVboxnums[part][i]; /* adjust the contracted cellbox to the variable box */ @@ -624,14 +621,14 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, findex); /* loop over all the vboxes to see if findex is inside */ - row_in= falseV; - for (p= 0; p< num_vboxes[t]; p++) + row_in = falseV; + for (p = 0; p < num_vboxes[t]; p++) { - vbox= hypre_BoxArrayBox(box_array, vboxnums[t][p]); + vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); if (hypre_IndexInBox(findex, vbox)) { hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in= trueV; + row_in = trueV; break; } } @@ -656,20 +653,20 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, { zypre_BoxLoopGetIndex(lindex); hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - for (k= 0; k< 3; k++) + for (k = 0; k < 3; k++) { - findex[k]*= rfactor[k]; + findex[k] *= rfactor[k]; } hypre_AddIndexes(findex, start, 3, findex); /************************************************************ * Loop over the Z_Face x_edges. ************************************************************/ - for (p= 0; p< rfactor[0]; p++) + for (p = 0; p < rfactor[0]; p++) { hypre_CopyIndex(findex, var_index); - var_index[0]+= p; - for (n= 1; n< rfactor[1]; n++) + var_index[0] += p; + for (n = 1; n < rfactor[1]; n++) { var_index[1]++; hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, @@ -681,10 +678,10 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, if ((l <= upper_ranks[part][t]) && (l >= lower_ranks[part][t])) { - iedgeEdge[j]= l; + iedgeEdge[j] = l; /* Z_Face. Two coarse Edge connections. */ - ncols_edgeEdge[j]= 2; + ncols_edgeEdge[j] = 2; j++; } @@ -699,14 +696,14 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, findex); /* loop over all the vboxes to see if findex is inside */ - row_in= falseV; - for (p= 0; p< num_vboxes[t]; p++) + row_in = falseV; + for (p = 0; p < num_vboxes[t]; p++) { - vbox= hypre_BoxArrayBox(box_array, vboxnums[t][p]); + vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); if (hypre_IndexInBox(findex, vbox)) { hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in= trueV; + row_in = trueV; break; } } @@ -730,18 +727,18 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, { zypre_BoxLoopGetIndex(lindex); hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - for (k= 0; k< 3; k++) + for (k = 0; k < 3; k++) { - findex[k]*= rfactor[k]; + findex[k] *= rfactor[k]; } hypre_AddIndexes(findex, start, 3, findex); /* Y_Face */ - for (p= 0; p< rfactor[0]; p++) + for (p = 0; p < rfactor[0]; p++) { hypre_CopyIndex(findex, var_index); - var_index[0]+= p; - for (n= 1; n< rfactor[2]; n++) + var_index[0] += p; + for (n = 1; n < rfactor[2]; n++) { var_index[2]++; hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, @@ -751,10 +748,10 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, if ((l <= upper_ranks[part][t]) && (l >= lower_ranks[part][t])) { - iedgeEdge[j]= l; + iedgeEdge[j] = l; /* Y_Face. Two coarse Edge connections. */ - ncols_edgeEdge[j]= 2; + ncols_edgeEdge[j] = 2; j++; } @@ -772,10 +769,10 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, /* 3-d y_edge, can be X or Z_Face */ hypre_ForBoxI(i, fboxes) { - cellbox= hypre_BoxArrayBox(fboxes, i); + cellbox = hypre_BoxArrayBox(fboxes, i); /* vboxes inside the i'th cellbox */ - num_vboxes= n_CtoVbox[part][i]; + num_vboxes = n_CtoVbox[part][i]; vboxnums = CtoVboxnums[part][i]; /* adjust the project cellbox to the variable box */ @@ -792,14 +789,14 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, hypre_SubtractIndexes(hypre_BoxIMin(©_box), kshift, 3, findex); /* loop over all the vboxes to see if findex is inside */ - row_in= falseV; - for (p= 0; p< num_vboxes[t]; p++) + row_in = falseV; + for (p = 0; p < num_vboxes[t]; p++) { - vbox= hypre_BoxArrayBox(box_array, vboxnums[t][p]); + vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); if (hypre_IndexInBox(findex, vbox)) { hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in= trueV; + row_in = trueV; break; } } @@ -827,19 +824,19 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, zypre_BoxLoopGetIndex(lindex); hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - for (k= 0; k< 3; k++) + for (k = 0; k < 3; k++) { - findex[k]*= rfactor[k]; + findex[k] *= rfactor[k]; } hypre_AddIndexes(findex, start, 3, findex); /* Z_Face */ - for (p= 0; p< rfactor[1]; p++) + for (p = 0; p < rfactor[1]; p++) { hypre_CopyIndex(findex, var_index); - var_index[1]+= p; - for (n= 1; n< rfactor[0]; n++) + var_index[1] += p; + for (n = 1; n < rfactor[0]; n++) { var_index[0]++; hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, @@ -849,10 +846,10 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, if ((l <= upper_ranks[part][t]) && (l >= lower_ranks[part][t])) { - iedgeEdge[j]= l; + iedgeEdge[j] = l; /* Z_Face. Two coarse Edge connections. */ - ncols_edgeEdge[j]= 2; + ncols_edgeEdge[j] = 2; j++; } @@ -867,14 +864,14 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, hypre_SubtractIndexes(hypre_BoxIMin(©_box), ishift, 3, findex); /* loop over all the vboxes to see if findex is inside */ - row_in= falseV; - for (p= 0; p< num_vboxes[t]; p++) + row_in = falseV; + for (p = 0; p < num_vboxes[t]; p++) { - vbox= hypre_BoxArrayBox(box_array, vboxnums[t][p]); + vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); if (hypre_IndexInBox(findex, vbox)) { hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in= trueV; + row_in = trueV; break; } } @@ -900,19 +897,19 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, zypre_BoxLoopGetIndex(lindex); hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - for (k= 0; k< 3; k++) + for (k = 0; k < 3; k++) { - findex[k]*= rfactor[k]; + findex[k] *= rfactor[k]; } hypre_AddIndexes(findex, start, 3, findex); /* X_Face */ - for (p= 0; p< rfactor[1]; p++) + for (p = 0; p < rfactor[1]; p++) { hypre_CopyIndex(findex, var_index); - var_index[1]+= p; - for (n= 1; n< rfactor[2]; n++) + var_index[1] += p; + for (n = 1; n < rfactor[2]; n++) { var_index[2]++; hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, @@ -922,10 +919,10 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, if ((l <= upper_ranks[part][t]) && (l >= lower_ranks[part][t])) { - iedgeEdge[j]= l; + iedgeEdge[j] = l; /* X_Face. Two coarse Edge connections. */ - ncols_edgeEdge[j]= 2; + ncols_edgeEdge[j] = 2; j++; } @@ -943,10 +940,10 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, /* 3-d z_edge, can be interior, X or Y_Face, or Z_Edge */ hypre_ForBoxI(i, fboxes) { - cellbox= hypre_BoxArrayBox(fboxes, i); + cellbox = hypre_BoxArrayBox(fboxes, i); /* vboxes inside the i'th cellbox */ - num_vboxes= n_CtoVbox[part][i]; + num_vboxes = n_CtoVbox[part][i]; vboxnums = CtoVboxnums[part][i]; /* adjust the project cellbox to the variable box */ @@ -963,14 +960,14 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, hypre_SubtractIndexes(hypre_BoxIMin(©_box), ishift, 3, findex); /* loop over all the vboxes to see if findex is inside */ - row_in= falseV; - for (p= 0; p< num_vboxes[t]; p++) + row_in = falseV; + for (p = 0; p < num_vboxes[t]; p++) { - vbox= hypre_BoxArrayBox(box_array, vboxnums[t][p]); + vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); if (hypre_IndexInBox(findex, vbox)) { hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in= trueV; + row_in = trueV; break; } } @@ -997,19 +994,19 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, zypre_BoxLoopGetIndex(lindex); hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - for (k= 0; k< 3; k++) + for (k = 0; k < 3; k++) { - findex[k]*= rfactor[k]; + findex[k] *= rfactor[k]; } hypre_AddIndexes(findex, start, 3, findex); /* X_Face */ - for (p= 0; p< rfactor[2]; p++) + for (p = 0; p < rfactor[2]; p++) { hypre_CopyIndex(findex, var_index); - var_index[2]+= p; - for (n= 1; n< rfactor[1]; n++) + var_index[2] += p; + for (n = 1; n < rfactor[1]; n++) { var_index[1]++; hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, @@ -1019,10 +1016,10 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, if ((l <= upper_ranks[part][t]) && (l >= lower_ranks[part][t])) { - iedgeEdge[j]= l; + iedgeEdge[j] = l; /* X_Face. Two coarse Edge connections. */ - ncols_edgeEdge[j]= 2; + ncols_edgeEdge[j] = 2; j++; } } /* for (n= 1; n< rfactor[1]; n++) */ @@ -1035,14 +1032,14 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, hypre_SubtractIndexes(hypre_BoxIMin(©_box), jshift, 3, findex); /* loop over all the vboxes to see if findex is inside */ - row_in= falseV; - for (p= 0; p< num_vboxes[t]; p++) + row_in = falseV; + for (p = 0; p < num_vboxes[t]; p++) { - vbox= hypre_BoxArrayBox(box_array, vboxnums[t][p]); + vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); if (hypre_IndexInBox(findex, vbox)) { hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in= trueV; + row_in = trueV; break; } } @@ -1068,19 +1065,19 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, zypre_BoxLoopGetIndex(lindex); hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - for (k= 0; k< 3; k++) + for (k = 0; k < 3; k++) { - findex[k]*= rfactor[k]; + findex[k] *= rfactor[k]; } hypre_AddIndexes(findex, start, 3, findex); /* Y_Face */ - for (p= 0; p< rfactor[2]; p++) + for (p = 0; p < rfactor[2]; p++) { hypre_CopyIndex(findex, var_index); - var_index[2]+= p; - for (n= 1; n< rfactor[0]; n++) + var_index[2] += p; + for (n = 1; n < rfactor[0]; n++) { var_index[0]++; hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, @@ -1090,10 +1087,10 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, if ((l <= upper_ranks[part][t]) && (l >= lower_ranks[part][t])) { - iedgeEdge[j]= l; + iedgeEdge[j] = l; /* Y_Face. Two coarse Edge connections. */ - ncols_edgeEdge[j]= 2; + ncols_edgeEdge[j] = 2; j++; } } /* for (n= 1; n< rfactor[0]; n++) */ @@ -1112,31 +1109,31 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, } /* for (part= 0; part< nparts; part++) */ } /* if (ndim == 3) */ - for (part= 0; part< nparts; part++) + for (part = 0; part < nparts; part++) { - p_fgrid= hypre_SStructGridPGrid(fgrid_edge, part); /* edge grid */ - Edge_nvars= hypre_SStructPGridNVars(p_fgrid); - Edge_vartypes= hypre_SStructPGridVarTypes(p_fgrid); + p_fgrid = hypre_SStructGridPGrid(fgrid_edge, part); /* edge grid */ + Edge_nvars = hypre_SStructPGridNVars(p_fgrid); + Edge_vartypes = hypre_SStructPGridVarTypes(p_fgrid); /* note that fboxes are the contracted CELL boxes. Will get the correct variable grid extents. */ - fboxes= contract_fedgeBoxes[part]; + fboxes = contract_fedgeBoxes[part]; - for (t= 0; t< Edge_nvars; t++) + for (t = 0; t < Edge_nvars; t++) { var = Edge_vartypes[t]; - var_fgrid= hypre_SStructPGridVTSGrid(p_fgrid, var); - box_array= hypre_StructGridBoxes(var_fgrid); + var_fgrid = hypre_SStructPGridVTSGrid(p_fgrid, var); + box_array = hypre_StructGridBoxes(var_fgrid); /* to reduce comparison, take the switch outside of the loop */ - switch(var) + switch (var) { case 2: { /* 2-d x_face = x_edge, can be interior */ hypre_ForBoxI(i, fboxes) { - cellbox= hypre_BoxArrayBox(fboxes, i); + cellbox = hypre_BoxArrayBox(fboxes, i); /* adjust the contract cellbox to the variable box */ hypre_CopyBox(cellbox, ©_box); @@ -1154,27 +1151,27 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, { zypre_BoxLoopGetIndex(lindex); hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - for (k= 0; k< 3; k++) + for (k = 0; k < 3; k++) { - findex[k]*= rfactor[k]; + findex[k] *= rfactor[k]; } hypre_AddIndexes(findex, start, 3, findex); /* get interior edges */ - for (p= 1; p< rfactor[0]; p++) + for (p = 1; p < rfactor[0]; p++) { hypre_CopyIndex(findex, var_index); - var_index[0]+= p; - for (n= 0; n< rfactor[1]; n++) + var_index[0] += p; + for (n = 0; n < rfactor[1]; n++) { hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &l, matrix_type); - iedgeEdge[j]= l; + iedgeEdge[j] = l; /* lies interior of Face. Two coarse Edge connection. */ - ncols_edgeEdge[j]= 2; + ncols_edgeEdge[j] = 2; j++; var_index[1]++; @@ -1192,7 +1189,7 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, /* 2-d y_face = y_edge, can be interior */ hypre_ForBoxI(i, fboxes) { - cellbox= hypre_BoxArrayBox(fboxes, i); + cellbox = hypre_BoxArrayBox(fboxes, i); /* adjust the project cellbox to the variable box */ hypre_CopyBox(cellbox, ©_box); @@ -1211,28 +1208,28 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, zypre_BoxLoopGetIndex(lindex); hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - for (k= 0; k< 3; k++) + for (k = 0; k < 3; k++) { - findex[k]*= rfactor[k]; + findex[k] *= rfactor[k]; } hypre_AddIndexes(findex, start, 3, findex); /* get interior edges */ - for (p= 1; p< rfactor[1]; p++) + for (p = 1; p < rfactor[1]; p++) { hypre_CopyIndex(findex, var_index); - var_index[1]+= p; - for (n= 0; n< rfactor[0]; n++) + var_index[1] += p; + for (n = 0; n < rfactor[0]; n++) { hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &l, matrix_type); - iedgeEdge[j]= l; + iedgeEdge[j] = l; /* lies interior of Face. Two coarse Edge connection. */ - ncols_edgeEdge[j]= 2; + ncols_edgeEdge[j] = 2; j++; var_index[0]++; @@ -1250,7 +1247,7 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, /* 3-d x_edge, can be only interior */ hypre_ForBoxI(i, fboxes) { - cellbox= hypre_BoxArrayBox(fboxes, i); + cellbox = hypre_BoxArrayBox(fboxes, i); /* adjust the project cellbox to the variable box */ hypre_CopyBox(cellbox, ©_box); @@ -1268,42 +1265,42 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, { zypre_BoxLoopGetIndex(lindex); hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - for (k= 0; k< 3; k++) + for (k = 0; k < 3; k++) { - findex[k]*= rfactor[k]; + findex[k] *= rfactor[k]; } hypre_AddIndexes(findex, start, 3, findex); /* get interior edges */ - for (p= 1; p< rfactor[2]; p++) + for (p = 1; p < rfactor[2]; p++) { hypre_CopyIndex(findex, var_index); - var_index[2]+= p; - for (n= 1; n< rfactor[1]; n++) + var_index[2] += p; + for (n = 1; n < rfactor[1]; n++) { var_index[1]++; - for (k= 0; k< rfactor[0]; k++) + for (k = 0; k < rfactor[0]; k++) { hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &l, matrix_type); - iedgeEdge[j]= l; + iedgeEdge[j] = l; /* Interior. Four coarse Edge connections. */ - ncols_edgeEdge[j]= 4; + ncols_edgeEdge[j] = 4; j++; var_index[0]++; } /* for (k= 0; k< rfactor[0]; k++) */ /* reset var_index[0] to the initial index for next k loop */ - var_index[0]-= rfactor[0]; + var_index[0] -= rfactor[0]; } /* for (n= 1; n< rfactor[1]; n++) */ /* reset var_index[1] to the initial index for next n loop */ - var_index[1]-= (rfactor[1]-1); + var_index[1] -= (rfactor[1] - 1); } /* for (p= 1; p< rfactor[2]; p++) */ } @@ -1317,7 +1314,7 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, /* 3-d y_edge, can be only interior */ hypre_ForBoxI(i, fboxes) { - cellbox= hypre_BoxArrayBox(fboxes, i); + cellbox = hypre_BoxArrayBox(fboxes, i); /* adjust the project cellbox to the variable box */ hypre_CopyBox(cellbox, ©_box); @@ -1335,42 +1332,42 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, { zypre_BoxLoopGetIndex(lindex); hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - for (k= 0; k< 3; k++) + for (k = 0; k < 3; k++) { - findex[k]*= rfactor[k]; + findex[k] *= rfactor[k]; } hypre_AddIndexes(findex, start, 3, findex); /* get interior edges */ - for (p= 1; p< rfactor[2]; p++) + for (p = 1; p < rfactor[2]; p++) { hypre_CopyIndex(findex, var_index); - var_index[2]+= p; - for (n= 1; n< rfactor[0]; n++) + var_index[2] += p; + for (n = 1; n < rfactor[0]; n++) { var_index[0]++; - for (k= 0; k< rfactor[1]; k++) + for (k = 0; k < rfactor[1]; k++) { hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &l, matrix_type); - iedgeEdge[j]= l; + iedgeEdge[j] = l; /* Interior. Four coarse Edge connections. */ - ncols_edgeEdge[j]= 4; + ncols_edgeEdge[j] = 4; j++; var_index[1]++; } /* for (k= 0; k< rfactor[1]; k++) */ /* reset var_index[1] to the initial index for next k loop */ - var_index[1]-= rfactor[1]; + var_index[1] -= rfactor[1]; } /* for (n= 1; n< rfactor[0]; n++) */ /* reset var_index[0] to the initial index for next n loop */ - var_index[0]-= (rfactor[0]-1); + var_index[0] -= (rfactor[0] - 1); } /* for (p= 1; p< rfactor[2]; p++) */ } @@ -1385,7 +1382,7 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, /* 3-d z_edge, can be only interior */ hypre_ForBoxI(i, fboxes) { - cellbox= hypre_BoxArrayBox(fboxes, i); + cellbox = hypre_BoxArrayBox(fboxes, i); /* adjust the project cellbox to the variable box */ hypre_CopyBox(cellbox, ©_box); @@ -1403,42 +1400,42 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, { zypre_BoxLoopGetIndex(lindex); hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - for (k= 0; k< 3; k++) + for (k = 0; k < 3; k++) { - findex[k]*= rfactor[k]; + findex[k] *= rfactor[k]; } hypre_AddIndexes(findex, start, 3, findex); /* get interior edges */ - for (p= 1; p< rfactor[1]; p++) + for (p = 1; p < rfactor[1]; p++) { hypre_CopyIndex(findex, var_index); - var_index[1]+= p; - for (n= 1; n< rfactor[0]; n++) + var_index[1] += p; + for (n = 1; n < rfactor[0]; n++) { var_index[0]++; - for (k= 0; k< rfactor[2]; k++) + for (k = 0; k < rfactor[2]; k++) { hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &l, matrix_type); - iedgeEdge[j]= l; + iedgeEdge[j] = l; /* Interior. Four coarse Edge connections. */ - ncols_edgeEdge[j]= 4; + ncols_edgeEdge[j] = 4; j++; var_index[2]++; } /* for (k= 0; k< rfactor[2]; k++) */ /* reset var_index[2] to the initial index for next k loop */ - var_index[2]-= rfactor[2]; + var_index[2] -= rfactor[2]; } /* for (n= 1; n< rfactor[0]; n++) */ /* reset var_index[0] to the initial index for next n loop */ - var_index[0]-= (rfactor[0]-1); + var_index[0] -= (rfactor[0] - 1); } /* for (p= 1; p< rfactor[1]; p++) */ } hypre_SerialBoxLoop1End(m); @@ -1450,13 +1447,13 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, } /* for (t= 0; t< Edge_nvars; t++) */ } /* for (part= 0; part< nparts; part++) */ - k= 0; - j= 0; - for (i= 0; i< nedges; i++) + k = 0; + j = 0; + for (i = 0; i < nedges; i++) { if (ncols_edgeEdge[i]) { - k+= ncols_edgeEdge[i]; + k += ncols_edgeEdge[i]; j++; } } @@ -1464,7 +1461,7 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, jedge_Edge = hypre_CTAlloc(HYPRE_BigInt, k, HYPRE_MEMORY_HOST); /* update nedges so that the true number of rows is set */ - size= j; + size = j; /********************************************************************* * Fill up the edge_Edge interpolation matrix. Interpolation weights @@ -1472,37 +1469,37 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, *********************************************************************/ /* loop over fedges aligning with the agglomerate coarse edges first. */ - k= 0; - for (part= 0; part< nparts; part++) + k = 0; + for (part = 0; part < nparts; part++) { - p_fgrid= hypre_SStructGridPGrid(fgrid_edge, part); /* edge grid */ - Edge_nvars= hypre_SStructPGridNVars(p_fgrid); - Edge_vartypes= hypre_SStructPGridVarTypes(p_fgrid); - p_cgrid= hypre_SStructGridPGrid(cgrid_edge, part); /* Edge grid */ + p_fgrid = hypre_SStructGridPGrid(fgrid_edge, part); /* edge grid */ + Edge_nvars = hypre_SStructPGridNVars(p_fgrid); + Edge_vartypes = hypre_SStructPGridVarTypes(p_fgrid); + p_cgrid = hypre_SStructGridPGrid(cgrid_edge, part); /* Edge grid */ /* note that fboxes are the contracted CELL boxes. Will get the correct variable grid extents. */ - fboxes= contract_fedgeBoxes[part]; + fboxes = contract_fedgeBoxes[part]; - for (t= 0; t< Edge_nvars; t++) + for (t = 0; t < Edge_nvars; t++) { var = Edge_vartypes[t]; - var_fgrid= hypre_SStructPGridVTSGrid(p_fgrid, var); - box_array= hypre_StructGridBoxes(var_fgrid); + var_fgrid = hypre_SStructPGridVTSGrid(p_fgrid, var); + box_array = hypre_StructGridBoxes(var_fgrid); - n_boxoffsets= ndim-1; + n_boxoffsets = ndim - 1; boxoffset = hypre_CTAlloc(hypre_Index, n_boxoffsets, HYPRE_MEMORY_HOST); suboffset = hypre_CTAlloc(hypre_Index, n_boxoffsets, HYPRE_MEMORY_HOST); - switch(var) + switch (var) { case 2: /* 2-d: x_face (vertical edges), stride=[rfactor[0],1,1] fCedge_ratio= 1.0/rfactor[1] */ { hypre_SetIndex3(stride, rfactor[0], 1, 1); - fCedge_ratio= 1.0/rfactor[1]; + fCedge_ratio = 1.0 / rfactor[1]; /* boxoffset shrink in the i direction */ - hypre_SetIndex3(boxoffset[0], rfactor[0]-1, 0, 0); + hypre_SetIndex3(boxoffset[0], rfactor[0] - 1, 0, 0); hypre_SetIndex3(suboffset[0], 1, 0, 0); /* extend loop_size by one in the stride direction */ @@ -1514,10 +1511,10 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, fCedge_ratio= 1.0/rfactor[0] */ { hypre_SetIndex3(stride, 1, rfactor[1], 1); - fCedge_ratio= 1.0/rfactor[0]; + fCedge_ratio = 1.0 / rfactor[0]; /* boxoffset shrink in the j direction */ - hypre_SetIndex3(boxoffset[0], 0, rfactor[1]-1, 0); + hypre_SetIndex3(boxoffset[0], 0, rfactor[1] - 1, 0); hypre_SetIndex3(suboffset[0], 0, 1, 0); /* extend loop_size by one in the stride direction */ @@ -1529,11 +1526,11 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, fCedge_ratio= 1.0/rfactor[0] */ { hypre_SetIndex3(stride, 1, rfactor[1], rfactor[2]); - fCedge_ratio= 1.0/rfactor[0]; + fCedge_ratio = 1.0 / rfactor[0]; /* boxoffset shrink in the j & k directions */ - hypre_SetIndex3(boxoffset[0], 0, rfactor[1]-1, 0); - hypre_SetIndex3(boxoffset[1], 0, 0, rfactor[2]-1); + hypre_SetIndex3(boxoffset[0], 0, rfactor[1] - 1, 0); + hypre_SetIndex3(boxoffset[1], 0, 0, rfactor[2] - 1); hypre_SetIndex3(suboffset[0], 0, 1, 0); hypre_SetIndex3(suboffset[1], 0, 0, 1); @@ -1546,11 +1543,11 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, fCedge_ratio= 1.0/rfactor[1] */ { hypre_SetIndex3(stride, rfactor[0], 1, rfactor[2]); - fCedge_ratio= 1.0/rfactor[1]; + fCedge_ratio = 1.0 / rfactor[1]; /* boxoffset shrink in the i & k directions */ - hypre_SetIndex3(boxoffset[0], rfactor[0]-1, 0, 0); - hypre_SetIndex3(boxoffset[1], 0, 0, rfactor[2]-1); + hypre_SetIndex3(boxoffset[0], rfactor[0] - 1, 0, 0); + hypre_SetIndex3(boxoffset[1], 0, 0, rfactor[2] - 1); hypre_SetIndex3(suboffset[0], 1, 0, 0); hypre_SetIndex3(suboffset[1], 0, 0, 1); @@ -1562,11 +1559,11 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, fCedge_ratio= 1.0/rfactor[2] */ { hypre_SetIndex3(stride, rfactor[0], rfactor[1], 1); - fCedge_ratio= 1.0/rfactor[2]; + fCedge_ratio = 1.0 / rfactor[2]; /* boxoffset shrink in the i & j directions */ - hypre_SetIndex3(boxoffset[0], rfactor[0]-1, 0, 0); - hypre_SetIndex3(boxoffset[1], 0, rfactor[1]-1, 0); + hypre_SetIndex3(boxoffset[0], rfactor[0] - 1, 0, 0); + hypre_SetIndex3(boxoffset[1], 0, rfactor[1] - 1, 0); hypre_SetIndex3(suboffset[0], 1, 0, 0); hypre_SetIndex3(suboffset[1], 0, 1, 0); @@ -1574,14 +1571,18 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, hypre_SetIndex3(hi_index, 1, 1, 0); break; } + default: + { + fCedge_ratio = 1.0; + } } hypre_ForBoxI(i, fboxes) { - cellbox= hypre_BoxArrayBox(fboxes, i); + cellbox = hypre_BoxArrayBox(fboxes, i); /* vboxes inside the i'th cellbox */ - num_vboxes= n_CtoVbox[part][i]; + num_vboxes = n_CtoVbox[part][i]; vboxnums = CtoVboxnums[part][i]; hypre_CopyIndex(Edge_cstarts[part][i], cstart); @@ -1591,19 +1592,19 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, vanish. */ hypre_CopyBox(cellbox, ©_box); - for (j= 0; j< n_boxoffsets; j++) + for (j = 0; j < n_boxoffsets; j++) { hypre_SubtractIndexes(hypre_BoxIMin(©_box), suboffset[j], 3, findex); - row_in= falseV; - for (p= 0; p< num_vboxes[t]; p++) + row_in = falseV; + for (p = 0; p < num_vboxes[t]; p++) { - vbox= hypre_BoxArrayBox(box_array, vboxnums[t][p]); + vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); if (hypre_IndexInBox(findex, vbox)) { hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in= trueV; + row_in = trueV; break; } } @@ -1637,9 +1638,9 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, { zypre_BoxLoopGetIndex(lindex); hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - for (j= 0; j< 3; j++) + for (j = 0; j < 3; j++) { - findex[j]*= stride[j]; + findex[j] *= stride[j]; } /* make sure that we do have the fine row corresponding to findex */ @@ -1665,8 +1666,8 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &l, matrix_type); - jedge_Edge[k]= l; - vals_edgeEdge[k]= fCedge_ratio; + jedge_Edge[k] = l; + vals_edgeEdge[k] = fCedge_ratio; k++; } /* if ((p <= upper_ranks[part][t]) && (p >= lower_ranks[part][t])) */ @@ -1682,42 +1683,42 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, /* generate the face interpolation weights/info. Only for 3-d */ if (ndim == 3) { - for (part= 0; part< nparts; part++) + for (part = 0; part < nparts; part++) { - p_fgrid= hypre_SStructGridPGrid(fgrid_edge, part); /* edge grid */ - Edge_nvars= hypre_SStructPGridNVars(p_fgrid); - Edge_vartypes= hypre_SStructPGridVarTypes(p_fgrid); - p_cgrid= hypre_SStructGridPGrid(cgrid_edge, part); /* Edge grid */ + p_fgrid = hypre_SStructGridPGrid(fgrid_edge, part); /* edge grid */ + Edge_nvars = hypre_SStructPGridNVars(p_fgrid); + Edge_vartypes = hypre_SStructPGridVarTypes(p_fgrid); + p_cgrid = hypre_SStructGridPGrid(cgrid_edge, part); /* Edge grid */ /* note that fboxes are the contracted CELL boxes. Will get the correct variable grid extents. */ - fboxes= contract_fedgeBoxes[part]; + fboxes = contract_fedgeBoxes[part]; /* may need to shrink a given box in some boxoffset directions */ - boxoffset= hypre_TAlloc(hypre_Index, ndim, HYPRE_MEMORY_HOST); - for (t= 0; t< ndim; t++) + boxoffset = hypre_TAlloc(hypre_Index, ndim, HYPRE_MEMORY_HOST); + for (t = 0; t < ndim; t++) { hypre_ClearIndex(boxoffset[t]); - hypre_IndexD(boxoffset[t], t)= rfactor[t]-1; + hypre_IndexD(boxoffset[t], t) = rfactor[t] - 1; } - for (t= 0; t< Edge_nvars; t++) + for (t = 0; t < Edge_nvars; t++) { var = Edge_vartypes[t]; - var_fgrid= hypre_SStructPGridVTSGrid(p_fgrid, var); - box_array= hypre_StructGridBoxes(var_fgrid); + var_fgrid = hypre_SStructPGridVTSGrid(p_fgrid, var); + box_array = hypre_StructGridBoxes(var_fgrid); - switch(var) + switch (var) { case 5: { /* 3-d x_edge, can be Y or Z_Face */ hypre_ForBoxI(i, fboxes) { - cellbox= hypre_BoxArrayBox(fboxes, i); + cellbox = hypre_BoxArrayBox(fboxes, i); /* vboxes inside the i'th cellbox */ - num_vboxes= n_CtoVbox[part][i]; + num_vboxes = n_CtoVbox[part][i]; vboxnums = CtoVboxnums[part][i]; hypre_CopyIndex(Edge_cstarts[part][i], cstart); @@ -1737,14 +1738,14 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, findex); /* loop over all the vboxes to see if findex is inside */ - row_in= falseV; - for (p= 0; p< num_vboxes[t]; p++) + row_in = falseV; + for (p = 0; p < num_vboxes[t]; p++) { - vbox= hypre_BoxArrayBox(box_array, vboxnums[t][p]); + vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); if (hypre_IndexInBox(findex, vbox)) { hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in= trueV; + row_in = trueV; break; } } @@ -1780,9 +1781,9 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, hypre_AddIndexes(cindex, cstart, 3, cindex); /* Will need the actual fine indices. */ - for (l= 0; l< ndim; l++) + for (l = 0; l < ndim; l++) { - findex[l]*= rfactor[l]; + findex[l] *= rfactor[l]; } hypre_AddIndexes(findex, start, 3, findex); @@ -1805,11 +1806,11 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, matrix_type); /* loop over the strips of x_edges making up the Z_Face */ - for (p= 0; p< rfactor[0]; p++) + for (p = 0; p < rfactor[0]; p++) { hypre_CopyIndex(findex, var_index); - var_index[0]+= p; - for (n= 1; n< rfactor[1]; n++) + var_index[0] += p; + for (n = 1; n < rfactor[1]; n++) { var_index[1]++; hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, @@ -1821,12 +1822,12 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, if ((l <= upper_ranks[part][t]) && (l >= lower_ranks[part][t])) { - jedge_Edge[k]= rank; - vals_edgeEdge[k]= (HYPRE_Real) n/(rfactor[1]*rfactor[0]); + jedge_Edge[k] = rank; + vals_edgeEdge[k] = (HYPRE_Real) n / (rfactor[1] * rfactor[0]); k++; - jedge_Edge[k]= rank2; - vals_edgeEdge[k]= 1.0/rfactor[0]*(1.0-(HYPRE_Real) n/rfactor[1]); + jedge_Edge[k] = rank2; + vals_edgeEdge[k] = 1.0 / rfactor[0] * (1.0 - (HYPRE_Real) n / rfactor[1]); k++; } } /* for (n= 1; n< rfactor[1]; n++) */ @@ -1840,14 +1841,14 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, hypre_SubtractIndexes(hypre_BoxIMin(©_box), jshift, 3, findex); /* loop over all the vboxes to see if findex is inside */ - row_in= falseV; - for (p= 0; p< num_vboxes[t]; p++) + row_in = falseV; + for (p = 0; p < num_vboxes[t]; p++) { - vbox= hypre_BoxArrayBox(box_array, vboxnums[t][p]); + vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); if (hypre_IndexInBox(findex, vbox)) { hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in= trueV; + row_in = trueV; break; } } @@ -1882,9 +1883,9 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, hypre_AddIndexes(cindex, cstart, 3, cindex); /* Will need the actual fine indices. */ - for (l= 0; l< ndim; l++) + for (l = 0; l < ndim; l++) { - findex[l]*= rfactor[l]; + findex[l] *= rfactor[l]; } hypre_AddIndexes(findex, start, 3, findex); @@ -1905,11 +1906,11 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, matrix_type); /* loop over the strips of x_edges making up the Y_Face */ - for (p= 0; p< rfactor[0]; p++) + for (p = 0; p < rfactor[0]; p++) { hypre_CopyIndex(findex, var_index); - var_index[0]+= p; - for (n= 1; n< rfactor[2]; n++) + var_index[0] += p; + for (n = 1; n < rfactor[2]; n++) { var_index[2]++; hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, @@ -1919,12 +1920,12 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, if ((l <= upper_ranks[part][t]) && (l >= lower_ranks[part][t])) { - jedge_Edge[k]= rank; - vals_edgeEdge[k]= (HYPRE_Real) n/(rfactor[0]*rfactor[2]); + jedge_Edge[k] = rank; + vals_edgeEdge[k] = (HYPRE_Real) n / (rfactor[0] * rfactor[2]); k++; - jedge_Edge[k]= rank2; - vals_edgeEdge[k]= 1.0/rfactor[0]*(1.0 - (HYPRE_Real) n/rfactor[2]); + jedge_Edge[k] = rank2; + vals_edgeEdge[k] = 1.0 / rfactor[0] * (1.0 - (HYPRE_Real) n / rfactor[2]); k++; } } /* for (n= 1; n< rfactor[2]; n++) */ @@ -1940,10 +1941,10 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, /* 3-d y_edge, can be X or Z_Face */ hypre_ForBoxI(i, fboxes) { - cellbox= hypre_BoxArrayBox(fboxes, i); + cellbox = hypre_BoxArrayBox(fboxes, i); /* vboxes inside the i'th cellbox */ - num_vboxes= n_CtoVbox[part][i]; + num_vboxes = n_CtoVbox[part][i]; vboxnums = CtoVboxnums[part][i]; hypre_CopyIndex(Edge_cstarts[part][i], cstart); @@ -1965,14 +1966,14 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, findex); /* loop over all the vboxes to see if findex is inside */ - row_in= falseV; - for (p= 0; p< num_vboxes[t]; p++) + row_in = falseV; + for (p = 0; p < num_vboxes[t]; p++) { - vbox= hypre_BoxArrayBox(box_array, vboxnums[t][p]); + vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); if (hypre_IndexInBox(findex, vbox)) { hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in= trueV; + row_in = trueV; break; } } @@ -2008,9 +2009,9 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, hypre_AddIndexes(cindex, cstart, 3, cindex); /* Will need the actual fine indices. */ - for (l= 0; l< ndim; l++) + for (l = 0; l < ndim; l++) { - findex[l]*= rfactor[l]; + findex[l] *= rfactor[l]; } hypre_AddIndexes(findex, start, 3, findex); @@ -2033,11 +2034,11 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, matrix_type); /* loop over the strips of y_edges making up the Z_Face */ - for (p= 0; p< rfactor[1]; p++) + for (p = 0; p < rfactor[1]; p++) { hypre_CopyIndex(findex, var_index); - var_index[1]+= p; - for (n= 1; n< rfactor[0]; n++) + var_index[1] += p; + for (n = 1; n < rfactor[0]; n++) { var_index[0]++; hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, @@ -2047,12 +2048,12 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, if ((l <= upper_ranks[part][t]) && (l >= lower_ranks[part][t])) { - jedge_Edge[k]= rank; - vals_edgeEdge[k]= (HYPRE_Real) n/(rfactor[0]*rfactor[1]); + jedge_Edge[k] = rank; + vals_edgeEdge[k] = (HYPRE_Real) n / (rfactor[0] * rfactor[1]); k++; - jedge_Edge[k]= rank2; - vals_edgeEdge[k]= 1.0/rfactor[1]*(1.0 - (HYPRE_Real) n/rfactor[0]); + jedge_Edge[k] = rank2; + vals_edgeEdge[k] = 1.0 / rfactor[1] * (1.0 - (HYPRE_Real) n / rfactor[0]); k++; } } /* for (n= 1; n< rfactor[0]; n++) */ @@ -2068,14 +2069,14 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, findex); /* loop over all the vboxes to see if findex is inside */ - row_in= falseV; - for (p= 0; p< num_vboxes[t]; p++) + row_in = falseV; + for (p = 0; p < num_vboxes[t]; p++) { - vbox= hypre_BoxArrayBox(box_array, vboxnums[t][p]); + vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); if (hypre_IndexInBox(findex, vbox)) { hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in= trueV; + row_in = trueV; break; } } @@ -2109,9 +2110,9 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, hypre_AddIndexes(cindex, cstart, 3, cindex); /* Will need the actual fine indices. */ - for (l= 0; l< ndim; l++) + for (l = 0; l < ndim; l++) { - findex[l]*= rfactor[l]; + findex[l] *= rfactor[l]; } hypre_AddIndexes(findex, start, 3, findex); /****************************************************** @@ -2131,11 +2132,11 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, matrix_type); /* loop over the strips of y_edges making up the X_Face */ - for (p= 0; p< rfactor[1]; p++) + for (p = 0; p < rfactor[1]; p++) { hypre_CopyIndex(findex, var_index); - var_index[1]+= p; - for (n= 1; n< rfactor[2]; n++) + var_index[1] += p; + for (n = 1; n < rfactor[2]; n++) { var_index[2]++; hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, @@ -2145,12 +2146,12 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, if ((l <= upper_ranks[part][t]) && (l >= lower_ranks[part][t])) { - jedge_Edge[k]= rank; - vals_edgeEdge[k]= (HYPRE_Real) n/(rfactor[1]*rfactor[2]); + jedge_Edge[k] = rank; + vals_edgeEdge[k] = (HYPRE_Real) n / (rfactor[1] * rfactor[2]); k++; - jedge_Edge[k]= rank2; - vals_edgeEdge[k]= 1.0/rfactor[1]*(1.0 - (HYPRE_Real) n/rfactor[2]); + jedge_Edge[k] = rank2; + vals_edgeEdge[k] = 1.0 / rfactor[1] * (1.0 - (HYPRE_Real) n / rfactor[2]); k++; } } /* for (n= 1; n< rfactor[2]; n++) */ @@ -2167,10 +2168,10 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, /* 3-d z_edge, can be X or Y_Face */ hypre_ForBoxI(i, fboxes) { - cellbox= hypre_BoxArrayBox(fboxes, i); + cellbox = hypre_BoxArrayBox(fboxes, i); /* vboxes inside the i'th cellbox */ - num_vboxes= n_CtoVbox[part][i]; + num_vboxes = n_CtoVbox[part][i]; vboxnums = CtoVboxnums[part][i]; hypre_CopyIndex(Edge_cstarts[part][i], cstart); @@ -2189,14 +2190,14 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, hypre_SubtractIndexes(hypre_BoxIMin(©_box), ishift, 3, findex); /* loop over all the vboxes to see if findex is inside */ - row_in= falseV; - for (p= 0; p< num_vboxes[t]; p++) + row_in = falseV; + for (p = 0; p < num_vboxes[t]; p++) { - vbox= hypre_BoxArrayBox(box_array, vboxnums[t][p]); + vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); if (hypre_IndexInBox(findex, vbox)) { hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in= trueV; + row_in = trueV; break; } } @@ -2231,9 +2232,9 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, hypre_AddIndexes(cindex, cstart, 3, cindex); /* Will need the actual fine indices. */ - for (l= 0; l< ndim; l++) + for (l = 0; l < ndim; l++) { - findex[l]*= rfactor[l]; + findex[l] *= rfactor[l]; } hypre_AddIndexes(findex, start, 3, findex); @@ -2256,11 +2257,11 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, matrix_type); /* loop over the strips of z_edges making up the X_Face */ - for (p= 0; p< rfactor[2]; p++) + for (p = 0; p < rfactor[2]; p++) { hypre_CopyIndex(findex, var_index); - var_index[2]+= p; - for (n= 1; n< rfactor[1]; n++) + var_index[2] += p; + for (n = 1; n < rfactor[1]; n++) { var_index[1]++; hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, @@ -2270,12 +2271,12 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, if ((l <= upper_ranks[part][t]) && (l >= lower_ranks[part][t])) { - jedge_Edge[k]= rank; - vals_edgeEdge[k]= (HYPRE_Real) n/(rfactor[0]*rfactor[2]); + jedge_Edge[k] = rank; + vals_edgeEdge[k] = (HYPRE_Real) n / (rfactor[0] * rfactor[2]); k++; - jedge_Edge[k]= rank2; - vals_edgeEdge[k]= 1.0/rfactor[2]*(1.0-(HYPRE_Real) n/rfactor[0]); + jedge_Edge[k] = rank2; + vals_edgeEdge[k] = 1.0 / rfactor[2] * (1.0 - (HYPRE_Real) n / rfactor[0]); k++; } } /* for (n= 1; n< rfactor[1]; n++) */ @@ -2290,14 +2291,14 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, hypre_SubtractIndexes(hypre_BoxIMin(©_box), jshift, 3, findex); /* loop over all the vboxes to see if findex is inside */ - row_in= falseV; - for (p= 0; p< num_vboxes[t]; p++) + row_in = falseV; + for (p = 0; p < num_vboxes[t]; p++) { - vbox= hypre_BoxArrayBox(box_array, vboxnums[t][p]); + vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); if (hypre_IndexInBox(findex, vbox)) { hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in= trueV; + row_in = trueV; break; } } @@ -2331,9 +2332,9 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, hypre_AddIndexes(cindex, cstart, 3, cindex); /* Will need the actual fine indices. */ - for (l= 0; l< ndim; l++) + for (l = 0; l < ndim; l++) { - findex[l]*= rfactor[l]; + findex[l] *= rfactor[l]; } hypre_AddIndexes(findex, start, 3, findex); /********************************************************** @@ -2353,11 +2354,11 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, matrix_type); /* loop over the strips of y_edges making up the Y_Face */ - for (p= 0; p< rfactor[2]; p++) + for (p = 0; p < rfactor[2]; p++) { hypre_CopyIndex(findex, var_index); - var_index[2]+= p; - for (n= 1; n< rfactor[0]; n++) + var_index[2] += p; + for (n = 1; n < rfactor[0]; n++) { var_index[0]++; hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, @@ -2367,12 +2368,12 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, if ((l <= upper_ranks[part][t]) && (l >= lower_ranks[part][t])) { - jedge_Edge[k]= rank; - vals_edgeEdge[k]= (HYPRE_Real) n/(rfactor[0]*rfactor[2]); + jedge_Edge[k] = rank; + vals_edgeEdge[k] = (HYPRE_Real) n / (rfactor[0] * rfactor[2]); k++; - jedge_Edge[k]= rank2; - vals_edgeEdge[k]= 1.0/rfactor[2]*(1.0-(HYPRE_Real) n/rfactor[0]); + jedge_Edge[k] = rank2; + vals_edgeEdge[k] = 1.0 / rfactor[2] * (1.0 - (HYPRE_Real) n / rfactor[0]); k++; } } /* for (n= 1; n< rfactor[0]; n++) */ @@ -2391,31 +2392,31 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, } /* if (ndim == 3) */ /* generate the interior interpolation weights/info */ - for (part= 0; part< nparts; part++) + for (part = 0; part < nparts; part++) { - p_fgrid= hypre_SStructGridPGrid(fgrid_edge, part); /* edge grid */ - Edge_nvars= hypre_SStructPGridNVars(p_fgrid); - Edge_vartypes= hypre_SStructPGridVarTypes(p_fgrid); - p_cgrid= hypre_SStructGridPGrid(cgrid_edge, part); /* Edge grid */ + p_fgrid = hypre_SStructGridPGrid(fgrid_edge, part); /* edge grid */ + Edge_nvars = hypre_SStructPGridNVars(p_fgrid); + Edge_vartypes = hypre_SStructPGridVarTypes(p_fgrid); + p_cgrid = hypre_SStructGridPGrid(cgrid_edge, part); /* Edge grid */ /* note that fboxes are the contracted CELL boxes. Will get the correct variable grid extents. */ - fboxes= contract_fedgeBoxes[part]; + fboxes = contract_fedgeBoxes[part]; - for (t= 0; t< Edge_nvars; t++) + for (t = 0; t < Edge_nvars; t++) { var = Edge_vartypes[t]; - var_fgrid= hypre_SStructPGridVTSGrid(p_fgrid, var); - box_array= hypre_StructGridBoxes(var_fgrid); + var_fgrid = hypre_SStructPGridVTSGrid(p_fgrid, var); + box_array = hypre_StructGridBoxes(var_fgrid); - switch(var) + switch (var) { case 2: { /* 2-d x_face = x_edge, can be interior or on X_Edge */ hypre_ForBoxI(i, fboxes) { - cellbox= hypre_BoxArrayBox(fboxes, i); + cellbox = hypre_BoxArrayBox(fboxes, i); vbox = hypre_BoxArrayBox(box_array, i); hypre_CopyIndex(Edge_cstarts[part][i], cstart); @@ -2444,9 +2445,9 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, * * Loop over the interior fine edges in an agglomerate. *****************************************************/ - for (p= 1; p< rfactor[0]; p++) + for (p = 1; p < rfactor[0]; p++) { - for (n= 0; n< rfactor[1]; n++) + for (n = 0; n < rfactor[1]; n++) { hypre_CopyIndex(findex, cindex); hypre_AddIndexes(cindex, cstart, 3, cindex); @@ -2457,8 +2458,8 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, matrix_type); - jedge_Edge[k]= rank; - vals_edgeEdge[k]= (HYPRE_Real) p/(rfactor[0]*rfactor[1]); + jedge_Edge[k] = rank; + vals_edgeEdge[k] = (HYPRE_Real) p / (rfactor[0] * rfactor[1]); k++; hypre_SubtractIndexes(cindex, ishift, 3, var_index); @@ -2466,8 +2467,8 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jedge_Edge[k]= rank; - vals_edgeEdge[k]= (HYPRE_Real) (rfactor[0]-p)/(rfactor[0]*rfactor[1]); + jedge_Edge[k] = rank; + vals_edgeEdge[k] = (HYPRE_Real) (rfactor[0] - p) / (rfactor[0] * rfactor[1]); k++; } /* for (n= 0; n< rfactor[1]; n++) */ } /* for (p= 1; p< rfactor[0]; p++) */ @@ -2483,7 +2484,7 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, /* 2-d y_face = y_edge, can be interior or on Y_Edge */ hypre_ForBoxI(i, fboxes) { - cellbox= hypre_BoxArrayBox(fboxes, i); + cellbox = hypre_BoxArrayBox(fboxes, i); vbox = hypre_BoxArrayBox(box_array, i); hypre_CopyIndex(Edge_cstarts[part][i], cstart); @@ -2512,9 +2513,9 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, * * Loop over the interior fine edges in an agglomerate. *****************************************************/ - for (p= 1; p< rfactor[1]; p++) + for (p = 1; p < rfactor[1]; p++) { - for (n= 0; n< rfactor[0]; n++) + for (n = 0; n < rfactor[0]; n++) { hypre_CopyIndex(findex, cindex); hypre_AddIndexes(cindex, cstart, 3, cindex); @@ -2525,8 +2526,8 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, matrix_type); - jedge_Edge[k]= rank; - vals_edgeEdge[k]= (HYPRE_Real) p/(rfactor[0]*rfactor[1]); + jedge_Edge[k] = rank; + vals_edgeEdge[k] = (HYPRE_Real) p / (rfactor[0] * rfactor[1]); k++; hypre_SubtractIndexes(cindex, jshift, 3, var_index); @@ -2534,8 +2535,8 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jedge_Edge[k]= rank; - vals_edgeEdge[k]= (HYPRE_Real) (rfactor[1]-p)/(rfactor[0]*rfactor[1]); + jedge_Edge[k] = rank; + vals_edgeEdge[k] = (HYPRE_Real) (rfactor[1] - p) / (rfactor[0] * rfactor[1]); k++; } /* for (n= 0; n< rfactor[0]; n++) */ } /* for (p= 1; p< rfactor[1]; p++) */ @@ -2551,7 +2552,7 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, /* 3-d x_edge, must be interior */ hypre_ForBoxI(i, fboxes) { - cellbox= hypre_BoxArrayBox(fboxes, i); + cellbox = hypre_BoxArrayBox(fboxes, i); vbox = hypre_BoxArrayBox(box_array, i); hypre_CopyIndex(Edge_cstarts[part][i], cstart); @@ -2580,11 +2581,11 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, * * Loop over the interior fine edges in an agglomerate. *****************************************************/ - for (p= 1; p< rfactor[2]; p++) + for (p = 1; p < rfactor[2]; p++) { - for (n= 1; n< rfactor[1]; n++) + for (n = 1; n < rfactor[1]; n++) { - for (m= 0; m< rfactor[0]; m++) + for (m = 0; m < rfactor[0]; m++) { hypre_CopyIndex(findex, cindex); hypre_AddIndexes(cindex, cstart, 3, cindex); @@ -2597,9 +2598,9 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, matrix_type); - jedge_Edge[k]= rank; - vals_edgeEdge[k]= (HYPRE_Real) p*n/ - (rfactor[0]*rfactor[1]*rfactor[2]); + jedge_Edge[k] = rank; + vals_edgeEdge[k] = (HYPRE_Real) p * n / + (rfactor[0] * rfactor[1] * rfactor[2]); k++; @@ -2608,9 +2609,9 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jedge_Edge[k]= rank; - vals_edgeEdge[k]= (HYPRE_Real) p*(rfactor[1]-n)/ - (rfactor[0]*rfactor[1]*rfactor[2]); + jedge_Edge[k] = rank; + vals_edgeEdge[k] = (HYPRE_Real) p * (rfactor[1] - n) / + (rfactor[0] * rfactor[1] * rfactor[2]); k++; hypre_SubtractIndexes(var_index, kshift, 3, var_index); @@ -2618,9 +2619,9 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jedge_Edge[k]= rank; - vals_edgeEdge[k]= (HYPRE_Real) (rfactor[1]-n)*(rfactor[2]-p)/ - (rfactor[0]*rfactor[1]*rfactor[2]); + jedge_Edge[k] = rank; + vals_edgeEdge[k] = (HYPRE_Real) (rfactor[1] - n) * (rfactor[2] - p) / + (rfactor[0] * rfactor[1] * rfactor[2]); k++; hypre_AddIndexes(var_index, jshift, 3, var_index); @@ -2628,9 +2629,9 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jedge_Edge[k]= rank; - vals_edgeEdge[k]= (HYPRE_Real) n*(rfactor[2]-p)/ - (rfactor[0]*rfactor[1]*rfactor[2]); + jedge_Edge[k] = rank; + vals_edgeEdge[k] = (HYPRE_Real) n * (rfactor[2] - p) / + (rfactor[0] * rfactor[1] * rfactor[2]); k++; } /* for (m= 0; m< rfactor[0]; m++) */ } /* for (n= 1; n< rfactor[1]; n++) */ @@ -2646,7 +2647,7 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, /* 3-d y_edge, must be interior */ hypre_ForBoxI(i, fboxes) { - cellbox= hypre_BoxArrayBox(fboxes, i); + cellbox = hypre_BoxArrayBox(fboxes, i); vbox = hypre_BoxArrayBox(box_array, i); hypre_CopyIndex(Edge_cstarts[part][i], cstart); @@ -2675,11 +2676,11 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, * * Loop over the interior fine edges in an agglomerate. *****************************************************/ - for (p= 1; p< rfactor[2]; p++) + for (p = 1; p < rfactor[2]; p++) { - for (n= 1; n< rfactor[0]; n++) + for (n = 1; n < rfactor[0]; n++) { - for (m= 0; m< rfactor[1]; m++) + for (m = 0; m < rfactor[1]; m++) { hypre_CopyIndex(findex, cindex); hypre_AddIndexes(cindex, cstart, 3, cindex); @@ -2692,9 +2693,9 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, matrix_type); - jedge_Edge[k]= rank; - vals_edgeEdge[k]= (HYPRE_Real) p*n/ - (rfactor[0]*rfactor[1]*rfactor[2]); + jedge_Edge[k] = rank; + vals_edgeEdge[k] = (HYPRE_Real) p * n / + (rfactor[0] * rfactor[1] * rfactor[2]); k++; hypre_SubtractIndexes(cindex, ishift, 3, var_index); @@ -2702,9 +2703,9 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jedge_Edge[k]= rank; - vals_edgeEdge[k]= (HYPRE_Real) p*(rfactor[0]-n)/ - (rfactor[0]*rfactor[1]*rfactor[2]); + jedge_Edge[k] = rank; + vals_edgeEdge[k] = (HYPRE_Real) p * (rfactor[0] - n) / + (rfactor[0] * rfactor[1] * rfactor[2]); k++; hypre_SubtractIndexes(var_index, kshift, 3, var_index); @@ -2712,9 +2713,9 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jedge_Edge[k]= rank; - vals_edgeEdge[k]= (HYPRE_Real) (rfactor[0]-n)*(rfactor[2]-p)/ - (rfactor[0]*rfactor[1]*rfactor[2]); + jedge_Edge[k] = rank; + vals_edgeEdge[k] = (HYPRE_Real) (rfactor[0] - n) * (rfactor[2] - p) / + (rfactor[0] * rfactor[1] * rfactor[2]); k++; hypre_AddIndexes(var_index, ishift, 3, var_index); @@ -2722,9 +2723,9 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jedge_Edge[k]= rank; - vals_edgeEdge[k]= (HYPRE_Real) n*(rfactor[2]-p)/ - (rfactor[0]*rfactor[1]*rfactor[2]); + jedge_Edge[k] = rank; + vals_edgeEdge[k] = (HYPRE_Real) n * (rfactor[2] - p) / + (rfactor[0] * rfactor[1] * rfactor[2]); k++; } /* for (m= 0; m< rfactor[1]; m++) */ } /* for (n= 1; n< rfactor[0]; n++) */ @@ -2741,7 +2742,7 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, /* 3-d z_edge, only the interior */ hypre_ForBoxI(i, fboxes) { - cellbox= hypre_BoxArrayBox(fboxes, i); + cellbox = hypre_BoxArrayBox(fboxes, i); vbox = hypre_BoxArrayBox(box_array, i); hypre_CopyIndex(Edge_cstarts[part][i], cstart); @@ -2770,11 +2771,11 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, * * Loop over the interior fine edges in an agglomerate. *****************************************************/ - for (p= 1; p< rfactor[1]; p++) + for (p = 1; p < rfactor[1]; p++) { - for (n= 1; n< rfactor[0]; n++) + for (n = 1; n < rfactor[0]; n++) { - for (m= 0; m< rfactor[2]; m++) + for (m = 0; m < rfactor[2]; m++) { hypre_CopyIndex(findex, cindex); hypre_AddIndexes(cindex, cstart, 3, cindex); @@ -2787,9 +2788,9 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, matrix_type); - jedge_Edge[k]= rank; - vals_edgeEdge[k]= (HYPRE_Real) n*p/ - (rfactor[0]*rfactor[1]*rfactor[2]); + jedge_Edge[k] = rank; + vals_edgeEdge[k] = (HYPRE_Real) n * p / + (rfactor[0] * rfactor[1] * rfactor[2]); k++; hypre_SubtractIndexes(cindex, ishift, 3, var_index); @@ -2797,9 +2798,9 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jedge_Edge[k]= rank; - vals_edgeEdge[k]= (HYPRE_Real) p*(rfactor[0]-n)/ - (rfactor[0]*rfactor[1]*rfactor[2]); + jedge_Edge[k] = rank; + vals_edgeEdge[k] = (HYPRE_Real) p * (rfactor[0] - n) / + (rfactor[0] * rfactor[1] * rfactor[2]); k++; hypre_SubtractIndexes(var_index, jshift, 3, var_index); @@ -2807,9 +2808,9 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jedge_Edge[k]= rank; - vals_edgeEdge[k]= (HYPRE_Real) (rfactor[1]-p)*(rfactor[0]-n)/ - (rfactor[0]*rfactor[1]*rfactor[2]); + jedge_Edge[k] = rank; + vals_edgeEdge[k] = (HYPRE_Real) (rfactor[1] - p) * (rfactor[0] - n) / + (rfactor[0] * rfactor[1] * rfactor[2]); k++; hypre_AddIndexes(var_index, ishift, 3, var_index); @@ -2817,9 +2818,9 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jedge_Edge[k]= rank; - vals_edgeEdge[k]= (HYPRE_Real) n*(rfactor[1]-p)/ - (rfactor[0]*rfactor[1]*rfactor[2]); + jedge_Edge[k] = rank; + vals_edgeEdge[k] = (HYPRE_Real) n * (rfactor[1] - p) / + (rfactor[0] * rfactor[1] * rfactor[2]); k++; } /* for (m= 0; m< rfactor[2]; m++) */ } /* for (n= 1; n< rfactor[0]; n++) */ @@ -2847,16 +2848,16 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, hypre_TFree(vartype_map, HYPRE_MEMORY_HOST); /* n_CtoVbox[part][cellboxi][var] & CtoVboxnums[part][cellboxi][var][nvboxes] */ - for (part= 0; part< nparts; part++) + for (part = 0; part < nparts; part++) { - p_fgrid= hypre_SStructGridPGrid(fgrid_edge, part); - Edge_nvars= hypre_SStructPGridNVars(p_fgrid); + p_fgrid = hypre_SStructGridPGrid(fgrid_edge, part); + Edge_nvars = hypre_SStructPGridNVars(p_fgrid); - var_fgrid= hypre_SStructPGridCellSGrid(p_fgrid); + var_fgrid = hypre_SStructPGridCellSGrid(p_fgrid); fboxes = hypre_StructGridBoxes(var_fgrid); hypre_ForBoxI(j, fboxes) { - for (t= 0; t< Edge_nvars; t++) + for (t = 0; t < Edge_nvars; t++) { hypre_TFree(CtoVboxnums[part][j][t], HYPRE_MEMORY_HOST); } @@ -2869,7 +2870,7 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, hypre_TFree(n_CtoVbox, HYPRE_MEMORY_HOST); hypre_TFree(CtoVboxnums, HYPRE_MEMORY_HOST); - for (part= 0; part< nparts; part++) + for (part = 0; part < nparts; part++) { hypre_BoxArrayDestroy(contract_fedgeBoxes[part]); hypre_TFree(Edge_cstarts[part], HYPRE_MEMORY_HOST); @@ -2891,4 +2892,3 @@ hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, return (hypre_IJMatrix *) edge_Edge; } - diff --git a/external/hypre/src/sstruct_ls/maxwell_PNedelec_bdy.c b/external/hypre/src/sstruct_ls/maxwell_PNedelec_bdy.c index aa39f0eb..f041a69e 100644 --- a/external/hypre/src/sstruct_ls/maxwell_PNedelec_bdy.c +++ b/external/hypre/src/sstruct_ls/maxwell_PNedelec_bdy.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -47,77 +47,77 @@ hypre_Maxwell_PNedelec_Bdy( hypre_StructGrid *cell_grid, hypre_SetIndex3(jshift, 0, 1, 0); hypre_SetIndex3(kshift, 0, 0, 1); - cell_boxes= hypre_StructGridBoxes(cell_grid); + cell_boxes = hypre_StructGridBoxes(cell_grid); nboxes = hypre_BoxArraySize(cell_boxes); - bdry= hypre_TAlloc(hypre_BoxArrayArray **, nboxes, HYPRE_MEMORY_HOST); - shifted_box= hypre_BoxCreate(ndim); + bdry = hypre_TAlloc(hypre_BoxArrayArray **, nboxes, HYPRE_MEMORY_HOST); + shifted_box = hypre_BoxCreate(ndim); hypre_ForBoxI(j, cell_boxes) { - box= hypre_BoxArrayBox(cell_boxes, j); + box = hypre_BoxArrayBox(cell_boxes, j); - /* find the cellgrid boundaries of box if there are any. */ - cellgrid_bdry= hypre_BoxArrayArrayCreate(2*ndim, ndim); - flag= hypre_CTAlloc(HYPRE_Int, 2*ndim, HYPRE_MEMORY_HOST); + /* find the cellgrid boundaries of box if there are any. */ + cellgrid_bdry = hypre_BoxArrayArrayCreate(2 * ndim, ndim); + flag = hypre_CTAlloc(HYPRE_Int, 2 * ndim, HYPRE_MEMORY_HOST); bdy = 0; - for (i= 0; i< ndim; i++) + for (i = 0; i < ndim; i++) { - hypre_BoxBoundaryDG(box, cell_grid, - hypre_BoxArrayArrayBoxArray(cellgrid_bdry, 2*i), - hypre_BoxArrayArrayBoxArray(cellgrid_bdry, 2*i+1), + hypre_BoxBoundaryDG(box, cell_grid, + hypre_BoxArrayArrayBoxArray(cellgrid_bdry, 2 * i), + hypre_BoxArrayArrayBoxArray(cellgrid_bdry, 2 * i + 1), i); - if (hypre_BoxArraySize(hypre_BoxArrayArrayBoxArray(cellgrid_bdry, 2*i))) + if (hypre_BoxArraySize(hypre_BoxArrayArrayBoxArray(cellgrid_bdry, 2 * i))) { - flag[2*i]= 1; + flag[2 * i] = 1; bdy++; } - if (hypre_BoxArraySize(hypre_BoxArrayArrayBoxArray(cellgrid_bdry, 2*i+1))) + if (hypre_BoxArraySize(hypre_BoxArrayArrayBoxArray(cellgrid_bdry, 2 * i + 1))) { - flag[2*i+1]= 1; + flag[2 * i + 1] = 1; bdy++; } } - /* There are boundary boxes. Every variable of pgrid will have some */ + /* There are boundary boxes. Every variable of pgrid will have some */ if (bdy) { - bdry[j]= hypre_TAlloc(hypre_BoxArrayArray *, nvars+1, HYPRE_MEMORY_HOST); - - /* keep the cell-centred boxarrayarray of boundaries */ - bdry[j][0]= hypre_BoxArrayArrayDuplicate(cellgrid_bdry); + bdry[j] = hypre_TAlloc(hypre_BoxArrayArray *, nvars + 1, HYPRE_MEMORY_HOST); - k= 2*(ndim-1); /* 3-d requires 4 boundary faces to be checked */ - for (i= 0; i< nvars; i++) + /* keep the cell-centred boxarrayarray of boundaries */ + bdry[j][0] = hypre_BoxArrayArrayDuplicate(cellgrid_bdry); + + k = 2 * (ndim - 1); /* 3-d requires 4 boundary faces to be checked */ + for (i = 0; i < nvars; i++) { - bdry[j][i+1]= hypre_BoxArrayArrayCreate(k, ndim); /* one for +/- directions */ + bdry[j][i + 1] = hypre_BoxArrayArrayCreate(k, ndim); /* one for +/- directions */ } - - for (i= 0; i< nvars; i++) + + for (i = 0; i < nvars; i++) { - t= vartypes[i]; + t = vartypes[i]; hypre_SStructVariableGetOffset(vartypes[i], ndim, varoffset); - switch(t) + switch (t) { case 2: /* xface, boundary i= lower, upper */ { if (flag[0]) /* boundary i= lower */ { box_array = hypre_BoxArrayArrayBoxArray(cellgrid_bdry, 0); - box_array2= hypre_BoxArrayArrayBoxArray(bdry[j][i+1], 0); + box_array2 = hypre_BoxArrayArrayBoxArray(bdry[j][i + 1], 0); hypre_ForBoxI(k, box_array) { - bdy_box= hypre_BoxArrayBox(box_array, k); - - /* bdry boxes */ + bdy_box = hypre_BoxArrayBox(box_array, k); + + /* bdry boxes */ hypre_CopyIndex(hypre_BoxIMin(bdy_box), lower); hypre_CopyIndex(hypre_BoxIMax(bdy_box), upper); hypre_SubtractIndexes(lower, varoffset, ndim, lower); hypre_SubtractIndexes(upper, varoffset, ndim, upper); - + hypre_BoxSetExtents(shifted_box, lower, upper); hypre_AppendBox(shifted_box, box_array2); } @@ -125,16 +125,16 @@ hypre_Maxwell_PNedelec_Bdy( hypre_StructGrid *cell_grid, if (flag[1]) /* boundary i= upper */ { - box_array= hypre_BoxArrayArrayBoxArray(cellgrid_bdry, 1); - box_array2= hypre_BoxArrayArrayBoxArray(bdry[j][i+1], 1); + box_array = hypre_BoxArrayArrayBoxArray(cellgrid_bdry, 1); + box_array2 = hypre_BoxArrayArrayBoxArray(bdry[j][i + 1], 1); hypre_ForBoxI(k, box_array) { - bdy_box= hypre_BoxArrayBox(box_array, k); + bdy_box = hypre_BoxArrayBox(box_array, k); - /* bdry boxes */ + /* bdry boxes */ hypre_CopyIndex(hypre_BoxIMin(bdy_box), lower); hypre_CopyIndex(hypre_BoxIMax(bdy_box), upper); - + hypre_BoxSetExtents(shifted_box, lower, upper); hypre_AppendBox(shifted_box, box_array2); } @@ -148,17 +148,17 @@ hypre_Maxwell_PNedelec_Bdy( hypre_StructGrid *cell_grid, if (flag[2]) /* boundary j= lower */ { box_array = hypre_BoxArrayArrayBoxArray(cellgrid_bdry, 2); - box_array2= hypre_BoxArrayArrayBoxArray(bdry[j][i+1], 0); + box_array2 = hypre_BoxArrayArrayBoxArray(bdry[j][i + 1], 0); hypre_ForBoxI(k, box_array) { - bdy_box= hypre_BoxArrayBox(box_array, k); - - /* bdry boxes */ + bdy_box = hypre_BoxArrayBox(box_array, k); + + /* bdry boxes */ hypre_CopyIndex(hypre_BoxIMin(bdy_box), lower); hypre_CopyIndex(hypre_BoxIMax(bdy_box), upper); hypre_SubtractIndexes(lower, varoffset, ndim, lower); hypre_SubtractIndexes(upper, varoffset, ndim, upper); - + hypre_BoxSetExtents(shifted_box, lower, upper); hypre_AppendBox(shifted_box, box_array2); } @@ -166,13 +166,13 @@ hypre_Maxwell_PNedelec_Bdy( hypre_StructGrid *cell_grid, if (flag[3]) /* boundary j= upper */ { - box_array= hypre_BoxArrayArrayBoxArray(cellgrid_bdry, 3); - box_array2= hypre_BoxArrayArrayBoxArray(bdry[j][i+1], 1); + box_array = hypre_BoxArrayArrayBoxArray(cellgrid_bdry, 3); + box_array2 = hypre_BoxArrayArrayBoxArray(bdry[j][i + 1], 1); hypre_ForBoxI(k, box_array) { - bdy_box= hypre_BoxArrayBox(box_array, k); - - /* bdry boxes */ + bdy_box = hypre_BoxArrayBox(box_array, k); + + /* bdry boxes */ hypre_CopyIndex(hypre_BoxIMin(bdy_box), lower); hypre_CopyIndex(hypre_BoxIMax(bdy_box), upper); @@ -189,17 +189,17 @@ hypre_Maxwell_PNedelec_Bdy( hypre_StructGrid *cell_grid, if (flag[4]) /* boundary k= lower zface*/ { box_array = hypre_BoxArrayArrayBoxArray(cellgrid_bdry, 4); - box_array2= hypre_BoxArrayArrayBoxArray(bdry[j][i+1], 0); + box_array2 = hypre_BoxArrayArrayBoxArray(bdry[j][i + 1], 0); hypre_ForBoxI(k, box_array) { - bdy_box= hypre_BoxArrayBox(box_array, k); - - /* bdry boxes */ + bdy_box = hypre_BoxArrayBox(box_array, k); + + /* bdry boxes */ hypre_CopyIndex(hypre_BoxIMin(bdy_box), lower); hypre_CopyIndex(hypre_BoxIMax(bdy_box), upper); hypre_SubtractIndexes(lower, varoffset, ndim, lower); hypre_SubtractIndexes(upper, kshift, ndim, upper); - + hypre_BoxSetExtents(shifted_box, lower, upper); hypre_AppendBox(shifted_box, box_array2); } @@ -208,16 +208,16 @@ hypre_Maxwell_PNedelec_Bdy( hypre_StructGrid *cell_grid, if (flag[5]) /* boundary k= upper zface*/ { box_array = hypre_BoxArrayArrayBoxArray(cellgrid_bdry, 5); - box_array2= hypre_BoxArrayArrayBoxArray(bdry[j][i+1], 1); + box_array2 = hypre_BoxArrayArrayBoxArray(bdry[j][i + 1], 1); hypre_ForBoxI(k, box_array) { - bdy_box= hypre_BoxArrayBox(box_array, k); - - /* bdry boxes */ + bdy_box = hypre_BoxArrayBox(box_array, k); + + /* bdry boxes */ hypre_CopyIndex(hypre_BoxIMin(bdy_box), lower); hypre_CopyIndex(hypre_BoxIMax(bdy_box), upper); hypre_SubtractIndexes(lower, jshift, ndim, lower); - + hypre_BoxSetExtents(shifted_box, lower, upper); hypre_AppendBox(shifted_box, box_array2); } @@ -226,35 +226,35 @@ hypre_Maxwell_PNedelec_Bdy( hypre_StructGrid *cell_grid, if (flag[2]) /* boundary j= lower yface*/ { box_array = hypre_BoxArrayArrayBoxArray(cellgrid_bdry, 2); - box_array2= hypre_BoxArrayArrayBoxArray(bdry[j][i+1], 2); + box_array2 = hypre_BoxArrayArrayBoxArray(bdry[j][i + 1], 2); hypre_ForBoxI(k, box_array) { - bdy_box= hypre_BoxArrayBox(box_array, k); - - /* bdry boxes */ + bdy_box = hypre_BoxArrayBox(box_array, k); + + /* bdry boxes */ hypre_CopyIndex(hypre_BoxIMin(bdy_box), lower); hypre_CopyIndex(hypre_BoxIMax(bdy_box), upper); hypre_SubtractIndexes(lower, varoffset, ndim, lower); hypre_SubtractIndexes(upper, jshift, ndim, upper); - + hypre_BoxSetExtents(shifted_box, lower, upper); hypre_AppendBox(shifted_box, box_array2); } } - + if (flag[3]) /* boundary j= upper yface*/ { box_array = hypre_BoxArrayArrayBoxArray(cellgrid_bdry, 3); - box_array2= hypre_BoxArrayArrayBoxArray(bdry[j][i+1], 3); + box_array2 = hypre_BoxArrayArrayBoxArray(bdry[j][i + 1], 3); hypre_ForBoxI(k, box_array) { - bdy_box= hypre_BoxArrayBox(box_array, k); + bdy_box = hypre_BoxArrayBox(box_array, k); - /* bdry boxes */ + /* bdry boxes */ hypre_CopyIndex(hypre_BoxIMin(bdy_box), lower); hypre_CopyIndex(hypre_BoxIMax(bdy_box), upper); hypre_SubtractIndexes(lower, kshift, ndim, lower); - + hypre_BoxSetExtents(shifted_box, lower, upper); hypre_AppendBox(shifted_box, box_array2); } @@ -267,68 +267,68 @@ hypre_Maxwell_PNedelec_Bdy( hypre_StructGrid *cell_grid, if (flag[4]) /* boundary k= lower zface*/ { box_array = hypre_BoxArrayArrayBoxArray(cellgrid_bdry, 4); - box_array2= hypre_BoxArrayArrayBoxArray(bdry[j][i+1], 0); + box_array2 = hypre_BoxArrayArrayBoxArray(bdry[j][i + 1], 0); hypre_ForBoxI(k, box_array) { - bdy_box= hypre_BoxArrayBox(box_array, k); + bdy_box = hypre_BoxArrayBox(box_array, k); - /* bdry boxes */ + /* bdry boxes */ hypre_CopyIndex(hypre_BoxIMin(bdy_box), lower); hypre_CopyIndex(hypre_BoxIMax(bdy_box), upper); hypre_SubtractIndexes(lower, varoffset, ndim, lower); hypre_SubtractIndexes(upper, kshift, ndim, upper); - + hypre_BoxSetExtents(shifted_box, lower, upper); hypre_AppendBox(shifted_box, box_array2); } } - + if (flag[5]) /* boundary k= upper zface*/ { box_array = hypre_BoxArrayArrayBoxArray(cellgrid_bdry, 5); - box_array2= hypre_BoxArrayArrayBoxArray(bdry[j][i+1], 1); + box_array2 = hypre_BoxArrayArrayBoxArray(bdry[j][i + 1], 1); hypre_ForBoxI(k, box_array) { - bdy_box= hypre_BoxArrayBox(box_array, k); + bdy_box = hypre_BoxArrayBox(box_array, k); - /* bdry boxes */ + /* bdry boxes */ hypre_CopyIndex(hypre_BoxIMin(bdy_box), lower); hypre_CopyIndex(hypre_BoxIMax(bdy_box), upper); hypre_SubtractIndexes(lower, ishift, ndim, lower); - + hypre_BoxSetExtents(shifted_box, lower, upper); hypre_AppendBox(shifted_box, box_array2); } } - + if (flag[0]) /* boundary i= lower xface*/ { box_array = hypre_BoxArrayArrayBoxArray(cellgrid_bdry, 0); - box_array2= hypre_BoxArrayArrayBoxArray(bdry[j][i+1], 2); + box_array2 = hypre_BoxArrayArrayBoxArray(bdry[j][i + 1], 2); hypre_ForBoxI(k, box_array) { - bdy_box= hypre_BoxArrayBox(box_array, k); + bdy_box = hypre_BoxArrayBox(box_array, k); - /* bdry boxes */ + /* bdry boxes */ hypre_CopyIndex(hypre_BoxIMin(bdy_box), lower); hypre_CopyIndex(hypre_BoxIMax(bdy_box), upper); hypre_SubtractIndexes(lower, varoffset, ndim, lower); hypre_SubtractIndexes(upper, ishift, ndim, upper); - + hypre_BoxSetExtents(shifted_box, lower, upper); hypre_AppendBox(shifted_box, box_array2); } } - + if (flag[1]) /* boundary i= upper xface*/ { box_array = hypre_BoxArrayArrayBoxArray(cellgrid_bdry, 1); - box_array2= hypre_BoxArrayArrayBoxArray(bdry[j][i+1], 3); + box_array2 = hypre_BoxArrayArrayBoxArray(bdry[j][i + 1], 3); hypre_ForBoxI(k, box_array) { - bdy_box= hypre_BoxArrayBox(box_array, k); - - /* bdry boxes */ + bdy_box = hypre_BoxArrayBox(box_array, k); + + /* bdry boxes */ hypre_CopyIndex(hypre_BoxIMin(bdy_box), lower); hypre_CopyIndex(hypre_BoxIMax(bdy_box), upper); hypre_SubtractIndexes(lower, kshift, ndim, lower); @@ -345,78 +345,78 @@ hypre_Maxwell_PNedelec_Bdy( hypre_StructGrid *cell_grid, { if (flag[2]) /* boundary j= lower yface*/ { - box_array = hypre_BoxArrayArrayBoxArray(cellgrid_bdry, 2); - box_array2= hypre_BoxArrayArrayBoxArray(bdry[j][i+1], 0); - hypre_ForBoxI(k, box_array) - { - bdy_box= hypre_BoxArrayBox(box_array, k); - + box_array = hypre_BoxArrayArrayBoxArray(cellgrid_bdry, 2); + box_array2 = hypre_BoxArrayArrayBoxArray(bdry[j][i + 1], 0); + hypre_ForBoxI(k, box_array) + { + bdy_box = hypre_BoxArrayBox(box_array, k); + /* bdry boxes */ - hypre_CopyIndex(hypre_BoxIMin(bdy_box), lower); - hypre_CopyIndex(hypre_BoxIMax(bdy_box), upper); - hypre_SubtractIndexes(lower, varoffset, ndim, lower); - hypre_SubtractIndexes(upper, jshift, ndim, upper); - - hypre_BoxSetExtents(shifted_box, lower, upper); - hypre_AppendBox(shifted_box, box_array2); - } - } - - if (flag[3]) /* boundary j= upper yface*/ - { - box_array = hypre_BoxArrayArrayBoxArray(cellgrid_bdry, 3); - box_array2= hypre_BoxArrayArrayBoxArray(bdry[j][i+1], 1); - hypre_ForBoxI(k, box_array) - { - bdy_box= hypre_BoxArrayBox(box_array, k); + hypre_CopyIndex(hypre_BoxIMin(bdy_box), lower); + hypre_CopyIndex(hypre_BoxIMax(bdy_box), upper); + hypre_SubtractIndexes(lower, varoffset, ndim, lower); + hypre_SubtractIndexes(upper, jshift, ndim, upper); + + hypre_BoxSetExtents(shifted_box, lower, upper); + hypre_AppendBox(shifted_box, box_array2); + } + } + + if (flag[3]) /* boundary j= upper yface*/ + { + box_array = hypre_BoxArrayArrayBoxArray(cellgrid_bdry, 3); + box_array2 = hypre_BoxArrayArrayBoxArray(bdry[j][i + 1], 1); + hypre_ForBoxI(k, box_array) + { + bdy_box = hypre_BoxArrayBox(box_array, k); /* bdry boxes */ - hypre_CopyIndex(hypre_BoxIMin(bdy_box), lower); - hypre_CopyIndex(hypre_BoxIMax(bdy_box), upper); - hypre_SubtractIndexes(lower, ishift, ndim, lower); - - hypre_BoxSetExtents(shifted_box, lower, upper); - hypre_AppendBox(shifted_box, box_array2); - } - } - - if (flag[0]) /* boundary i= lower xface*/ - { - box_array = hypre_BoxArrayArrayBoxArray(cellgrid_bdry, 0); - box_array2= hypre_BoxArrayArrayBoxArray(bdry[j][i+1], 2); - hypre_ForBoxI(k, box_array) - { - bdy_box= hypre_BoxArrayBox(box_array, k); + hypre_CopyIndex(hypre_BoxIMin(bdy_box), lower); + hypre_CopyIndex(hypre_BoxIMax(bdy_box), upper); + hypre_SubtractIndexes(lower, ishift, ndim, lower); + + hypre_BoxSetExtents(shifted_box, lower, upper); + hypre_AppendBox(shifted_box, box_array2); + } + } + + if (flag[0]) /* boundary i= lower xface*/ + { + box_array = hypre_BoxArrayArrayBoxArray(cellgrid_bdry, 0); + box_array2 = hypre_BoxArrayArrayBoxArray(bdry[j][i + 1], 2); + hypre_ForBoxI(k, box_array) + { + bdy_box = hypre_BoxArrayBox(box_array, k); /* bdry boxes */ - hypre_CopyIndex(hypre_BoxIMin(bdy_box), lower); - hypre_CopyIndex(hypre_BoxIMax(bdy_box), upper); - hypre_SubtractIndexes(lower, varoffset, ndim, lower); - hypre_SubtractIndexes(upper, ishift, ndim, upper); - - hypre_BoxSetExtents(shifted_box, lower, upper); - hypre_AppendBox(shifted_box, box_array2); - } - } - - if (flag[1]) /* boundary i= upper xface*/ - { - box_array = hypre_BoxArrayArrayBoxArray(cellgrid_bdry, 1); - box_array2= hypre_BoxArrayArrayBoxArray(bdry[j][i+1], 3); - hypre_ForBoxI(k, box_array) - { - bdy_box= hypre_BoxArrayBox(box_array, k); + hypre_CopyIndex(hypre_BoxIMin(bdy_box), lower); + hypre_CopyIndex(hypre_BoxIMax(bdy_box), upper); + hypre_SubtractIndexes(lower, varoffset, ndim, lower); + hypre_SubtractIndexes(upper, ishift, ndim, upper); + + hypre_BoxSetExtents(shifted_box, lower, upper); + hypre_AppendBox(shifted_box, box_array2); + } + } + + if (flag[1]) /* boundary i= upper xface*/ + { + box_array = hypre_BoxArrayArrayBoxArray(cellgrid_bdry, 1); + box_array2 = hypre_BoxArrayArrayBoxArray(bdry[j][i + 1], 3); + hypre_ForBoxI(k, box_array) + { + bdy_box = hypre_BoxArrayBox(box_array, k); /* bdry boxes */ - hypre_CopyIndex(hypre_BoxIMin(bdy_box), lower); - hypre_CopyIndex(hypre_BoxIMax(bdy_box), upper); - hypre_SubtractIndexes(lower, jshift, ndim, lower); - - hypre_BoxSetExtents(shifted_box, lower, upper); - hypre_AppendBox(shifted_box, box_array2); - } - } - break; + hypre_CopyIndex(hypre_BoxIMin(bdy_box), lower); + hypre_CopyIndex(hypre_BoxIMax(bdy_box), upper); + hypre_SubtractIndexes(lower, jshift, ndim, lower); + + hypre_BoxSetExtents(shifted_box, lower, upper); + hypre_AppendBox(shifted_box, box_array2); + } + } + break; } } /* switch(t) */ @@ -425,22 +425,22 @@ hypre_Maxwell_PNedelec_Bdy( hypre_StructGrid *cell_grid, else { - /* make an empty ptr of boxarrayarrays to avoid memory leaks when - destroying bdry later. */ - bdry[j]= hypre_TAlloc(hypre_BoxArrayArray *, nvars+1, HYPRE_MEMORY_HOST); - for (i= 0; i< nvars+1; i++) + /* make an empty ptr of boxarrayarrays to avoid memory leaks when + destroying bdry later. */ + bdry[j] = hypre_TAlloc(hypre_BoxArrayArray *, nvars + 1, HYPRE_MEMORY_HOST); + for (i = 0; i < nvars + 1; i++) { - bdry[j][i]= hypre_BoxArrayArrayCreate(0, ndim); + bdry[j][i] = hypre_BoxArrayArrayCreate(0, ndim); } } - hypre_BoxArrayArrayDestroy(cellgrid_bdry); + hypre_BoxArrayArrayDestroy(cellgrid_bdry); hypre_TFree(flag, HYPRE_MEMORY_HOST); } /* hypre_ForBoxI(j, cell_boxes) */ hypre_BoxDestroy(shifted_box); - *bdry_ptr = bdry; + *bdry_ptr = bdry; return ierr; } diff --git a/external/hypre/src/sstruct_ls/maxwell_PTopology.h b/external/hypre/src/sstruct_ls/maxwell_PTopology.h index 35eeb355..33e2d4ca 100644 --- a/external/hypre/src/sstruct_ls/maxwell_PTopology.h +++ b/external/hypre/src/sstruct_ls/maxwell_PTopology.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -7,12 +7,12 @@ typedef struct { - hypre_IJMatrix *Face_iedge; - hypre_IJMatrix *Element_iedge; - hypre_IJMatrix *Edge_iedge; - - hypre_IJMatrix *Element_Face; - hypre_IJMatrix *Element_Edge; - + hypre_IJMatrix *Face_iedge; + hypre_IJMatrix *Element_iedge; + hypre_IJMatrix *Edge_iedge; + + hypre_IJMatrix *Element_Face; + hypre_IJMatrix *Element_Edge; + } hypre_PTopology; diff --git a/external/hypre/src/sstruct_ls/maxwell_TV.c b/external/hypre/src/sstruct_ls/maxwell_TV.c index 92e2d8fd..19044c04 100644 --- a/external/hypre/src/sstruct_ls/maxwell_TV.c +++ b/external/hypre/src/sstruct_ls/maxwell_TV.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -34,10 +34,10 @@ hypre_MaxwellTVCreate( MPI_Comm comm ) (maxwell_data -> print_level) = 0; (maxwell_data -> logging) = 0; - maxwell_rfactor= hypre_TAlloc(hypre_Index, 1, HYPRE_MEMORY_HOST); + maxwell_rfactor = hypre_TAlloc(hypre_Index, 1, HYPRE_MEMORY_HOST); hypre_SetIndex3(maxwell_rfactor[0], 2, 2, 2); - (maxwell_data -> rfactor)= maxwell_rfactor; - + (maxwell_data -> rfactor) = maxwell_rfactor; + return (void *) maxwell_data; } @@ -49,7 +49,7 @@ hypre_MaxwellTVCreate( MPI_Comm comm ) HYPRE_Int hypre_MaxwellTVDestroy( void *maxwell_vdata ) { - hypre_MaxwellData *maxwell_data= (hypre_MaxwellData *)maxwell_vdata; + hypre_MaxwellData *maxwell_data = (hypre_MaxwellData *)maxwell_vdata; HYPRE_Int l; HYPRE_Int ierr = 0; @@ -68,29 +68,29 @@ hypre_MaxwellTVDestroy( void *maxwell_vdata ) { for (l = 0; l < (maxwell_data-> edge_numlevels); l++) { - HYPRE_SStructGridDestroy(maxwell_data-> egrid_l[l]); - hypre_ParVectorDestroy(maxwell_data-> rese_l[l]); - hypre_ParVectorDestroy(maxwell_data-> ee_l[l]); - hypre_ParVectorDestroy(maxwell_data-> eVtemp_l[l]); - hypre_ParVectorDestroy(maxwell_data-> eVtemp2_l[l]); - hypre_TFree(maxwell_data -> eCF_marker_l[l], HYPRE_MEMORY_HOST); + HYPRE_SStructGridDestroy(maxwell_data-> egrid_l[l]); + hypre_ParVectorDestroy(maxwell_data-> rese_l[l]); + hypre_ParVectorDestroy(maxwell_data-> ee_l[l]); + hypre_ParVectorDestroy(maxwell_data-> eVtemp_l[l]); + hypre_ParVectorDestroy(maxwell_data-> eVtemp2_l[l]); + hypre_TFree(maxwell_data -> eCF_marker_l[l], HYPRE_MEMORY_HOST); /* Cannot destroy Aee_l[0] since it points to the user Aee_in. */ - if (l) - { - hypre_ParCSRMatrixDestroy(maxwell_data-> Aee_l[l]); - hypre_ParVectorDestroy(maxwell_data-> be_l[l]); - hypre_ParVectorDestroy(maxwell_data-> xe_l[l]); - } - - if (l < (maxwell_data-> edge_numlevels)-1) - { - HYPRE_IJMatrixDestroy( - (HYPRE_IJMatrix) (maxwell_data-> Pe_l[l])); - } - - hypre_TFree(maxwell_data-> BdryRanks_l[l], HYPRE_MEMORY_HOST); + if (l) + { + hypre_ParCSRMatrixDestroy(maxwell_data-> Aee_l[l]); + hypre_ParVectorDestroy(maxwell_data-> be_l[l]); + hypre_ParVectorDestroy(maxwell_data-> xe_l[l]); + } + + if (l < (maxwell_data-> edge_numlevels) - 1) + { + HYPRE_IJMatrixDestroy( + (HYPRE_IJMatrix) (maxwell_data-> Pe_l[l])); + } + + hypre_TFree(maxwell_data-> BdryRanks_l[l], HYPRE_MEMORY_HOST); } hypre_TFree(maxwell_data-> egrid_l, HYPRE_MEMORY_HOST); hypre_TFree(maxwell_data-> Aee_l, HYPRE_MEMORY_HOST); @@ -105,7 +105,7 @@ hypre_MaxwellTVDestroy( void *maxwell_vdata ) hypre_TFree(maxwell_data-> eCF_marker_l, HYPRE_MEMORY_HOST); hypre_TFree(maxwell_data-> erelax_weight, HYPRE_MEMORY_HOST); hypre_TFree(maxwell_data-> eomega, HYPRE_MEMORY_HOST); - + hypre_TFree(maxwell_data-> BdryRanks_l, HYPRE_MEMORY_HOST); hypre_TFree(maxwell_data-> BdryRanksCnts_l, HYPRE_MEMORY_HOST); } @@ -114,10 +114,10 @@ hypre_MaxwellTVDestroy( void *maxwell_vdata ) { for (l = 0; l < (maxwell_data-> node_numlevels); l++) { - hypre_ParVectorDestroy(maxwell_data-> resn_l[l]); - hypre_ParVectorDestroy(maxwell_data-> en_l[l]); - hypre_ParVectorDestroy(maxwell_data-> nVtemp_l[l]); - hypre_ParVectorDestroy(maxwell_data-> nVtemp2_l[l]); + hypre_ParVectorDestroy(maxwell_data-> resn_l[l]); + hypre_ParVectorDestroy(maxwell_data-> en_l[l]); + hypre_ParVectorDestroy(maxwell_data-> nVtemp_l[l]); + hypre_ParVectorDestroy(maxwell_data-> nVtemp2_l[l]); } hypre_BoomerAMGDestroy(maxwell_data-> amg_vdata); @@ -140,19 +140,19 @@ hypre_MaxwellTVDestroy( void *maxwell_vdata ) if ((maxwell_data -> en_numlevels) > 0) { - for (l= 1; l< (maxwell_data-> en_numlevels); l++) + for (l = 1; l < (maxwell_data-> en_numlevels); l++) { - hypre_ParCSRMatrixDestroy(maxwell_data-> Aen_l[l]); + hypre_ParCSRMatrixDestroy(maxwell_data-> Aen_l[l]); } } hypre_TFree(maxwell_data-> Aen_l, HYPRE_MEMORY_HOST); HYPRE_SStructVectorDestroy( - (HYPRE_SStructVector) maxwell_data-> bn); + (HYPRE_SStructVector) maxwell_data-> bn); HYPRE_SStructVectorDestroy( - (HYPRE_SStructVector) maxwell_data-> xn); + (HYPRE_SStructVector) maxwell_data-> xn); HYPRE_SStructMatrixDestroy( - (HYPRE_SStructMatrix) maxwell_data-> Ann); + (HYPRE_SStructMatrix) maxwell_data-> Ann); HYPRE_IJMatrixDestroy(maxwell_data-> Aen); hypre_ParCSRMatrixDestroy(maxwell_data-> T_transpose); @@ -161,7 +161,7 @@ hypre_MaxwellTVDestroy( void *maxwell_vdata ) hypre_TFree(maxwell_data, HYPRE_MEMORY_HOST); } - return(ierr); + return (ierr); } /*-------------------------------------------------------------------------- @@ -169,14 +169,14 @@ hypre_MaxwellTVDestroy( void *maxwell_vdata ) *--------------------------------------------------------------------------*/ HYPRE_Int hypre_MaxwellSetRfactors(void *maxwell_vdata, - HYPRE_Int rfactor[3] ) + HYPRE_Int rfactor[HYPRE_MAXDIM] ) { hypre_MaxwellData *maxwell_data = (hypre_MaxwellData *)maxwell_vdata; - hypre_Index *maxwell_rfactor=(maxwell_data -> rfactor); + hypre_Index *maxwell_rfactor = (maxwell_data -> rfactor); HYPRE_Int ierr = 0; - + hypre_CopyIndex(rfactor, maxwell_rfactor[0]); - + return ierr; } @@ -187,14 +187,14 @@ HYPRE_Int hypre_MaxwellSetGrad(void *maxwell_vdata, hypre_ParCSRMatrix *T ) { - hypre_MaxwellData *maxwell_data= (hypre_MaxwellData *)maxwell_vdata; + hypre_MaxwellData *maxwell_data = (hypre_MaxwellData *)maxwell_vdata; HYPRE_Int ierr = 0; - - (maxwell_data -> Tgrad)= T; - + + (maxwell_data -> Tgrad) = T; + return ierr; } - + /*-------------------------------------------------------------------------- * hypre_MaxwellSetConstantCoef *--------------------------------------------------------------------------*/ @@ -202,10 +202,10 @@ HYPRE_Int hypre_MaxwellSetConstantCoef( void *maxwell_vdata, HYPRE_Int constant_coef) { - hypre_MaxwellData *maxwell_data= (hypre_MaxwellData *)maxwell_vdata; + hypre_MaxwellData *maxwell_data = (hypre_MaxwellData *)maxwell_vdata; HYPRE_Int ierr = 0; - - (maxwell_data -> constant_coef) = constant_coef; + + (maxwell_data -> constant_coef) = constant_coef; return ierr; } @@ -217,10 +217,10 @@ HYPRE_Int hypre_MaxwellSetTol( void *maxwell_vdata, HYPRE_Real tol ) { - hypre_MaxwellData *maxwell_data= (hypre_MaxwellData *)maxwell_vdata; + hypre_MaxwellData *maxwell_data = (hypre_MaxwellData *)maxwell_vdata; HYPRE_Int ierr = 0; - - (maxwell_data -> tol) = tol; + + (maxwell_data -> tol) = tol; return ierr; } @@ -235,11 +235,11 @@ hypre_MaxwellSetMaxIter( void *maxwell_vdata, hypre_MaxwellData *maxwell_data = (hypre_MaxwellData *)maxwell_vdata; HYPRE_Int ierr = 0; - (maxwell_data -> max_iter) = max_iter; + (maxwell_data -> max_iter) = max_iter; return ierr; } - + /*-------------------------------------------------------------------------- * hypre_MaxwellSetRelChange *--------------------------------------------------------------------------*/ @@ -249,28 +249,28 @@ hypre_MaxwellSetRelChange( void *maxwell_vdata, { hypre_MaxwellData *maxwell_data = (hypre_MaxwellData *)maxwell_vdata; HYPRE_Int ierr = 0; - - (maxwell_data -> rel_change) = rel_change; + + (maxwell_data -> rel_change) = rel_change; return ierr; } - + /*-------------------------------------------------------------------------- * hypre_MaxwellNumPreRelax *--------------------------------------------------------------------------*/ - + HYPRE_Int hypre_MaxwellSetNumPreRelax( void *maxwell_vdata, HYPRE_Int num_pre_relax ) { - hypre_MaxwellData *maxwell_data= (hypre_MaxwellData *)maxwell_vdata; + hypre_MaxwellData *maxwell_data = (hypre_MaxwellData *)maxwell_vdata; HYPRE_Int ierr = 0; - (maxwell_data -> num_pre_relax) = num_pre_relax; + (maxwell_data -> num_pre_relax) = num_pre_relax; return ierr; } - + /*-------------------------------------------------------------------------- * hypre_MaxwellSetNumPostRelax *--------------------------------------------------------------------------*/ @@ -278,10 +278,10 @@ HYPRE_Int hypre_MaxwellSetNumPostRelax( void *maxwell_vdata, HYPRE_Int num_post_relax ) { - hypre_MaxwellData *maxwell_data= (hypre_MaxwellData *)maxwell_vdata; + hypre_MaxwellData *maxwell_data = (hypre_MaxwellData *)maxwell_vdata; HYPRE_Int ierr = 0; - - (maxwell_data -> num_post_relax)= num_post_relax; + + (maxwell_data -> num_post_relax) = num_post_relax; return ierr; } @@ -293,10 +293,10 @@ HYPRE_Int hypre_MaxwellGetNumIterations( void *maxwell_vdata, HYPRE_Int *num_iterations ) { - hypre_MaxwellData *maxwell_data= (hypre_MaxwellData *)maxwell_vdata; + hypre_MaxwellData *maxwell_data = (hypre_MaxwellData *)maxwell_vdata; HYPRE_Int ierr = 0; - - *num_iterations = (maxwell_data -> num_iterations); + + *num_iterations = (maxwell_data -> num_iterations); return ierr; } @@ -310,12 +310,12 @@ hypre_MaxwellSetPrintLevel( void *maxwell_vdata, { hypre_MaxwellData *maxwell_data = (hypre_MaxwellData *)maxwell_vdata; HYPRE_Int ierr = 0; - + (maxwell_data -> print_level) = print_level; - + return ierr; } - + /*-------------------------------------------------------------------------- * hypre_MaxwellSetLogging *--------------------------------------------------------------------------*/ @@ -325,12 +325,12 @@ hypre_MaxwellSetLogging( void *maxwell_vdata, { hypre_MaxwellData *maxwell_data = (hypre_MaxwellData *)maxwell_vdata; HYPRE_Int ierr = 0; - + (maxwell_data -> logging) = logging; - + return ierr; } - + /*-------------------------------------------------------------------------- * hypre_MaxwellPrintLogging *--------------------------------------------------------------------------*/ @@ -341,25 +341,25 @@ hypre_MaxwellPrintLogging( void *maxwell_vdata, hypre_MaxwellData *maxwell_data = (hypre_MaxwellData *)maxwell_vdata; HYPRE_Int ierr = 0; HYPRE_Int i; - HYPRE_Int num_iterations= (maxwell_data -> num_iterations); + HYPRE_Int num_iterations = (maxwell_data -> num_iterations); HYPRE_Int logging = (maxwell_data -> logging); HYPRE_Int print_level = (maxwell_data -> print_level); HYPRE_Real *norms = (maxwell_data -> norms); HYPRE_Real *rel_norms = (maxwell_data -> rel_norms); - + if (myid == 0) { - if (print_level > 0 ) - { + if (print_level > 0 ) + { if (logging > 0) { for (i = 0; i < num_iterations; i++) { - hypre_printf("Residual norm[%d] = %e ",i,norms[i]); - hypre_printf("Relative residual norm[%d] = %e\n",i,rel_norms[i]); + hypre_printf("Residual norm[%d] = %e ", i, norms[i]); + hypre_printf("Relative residual norm[%d] = %e\n", i, rel_norms[i]); } } - } + } } return ierr; @@ -370,7 +370,7 @@ hypre_MaxwellGetFinalRelativeResidualNorm( void *maxwell_vdata, HYPRE_Real *relative_residual_norm ) { hypre_MaxwellData *maxwell_data = (hypre_MaxwellData *)maxwell_vdata; - + HYPRE_Int max_iter = (maxwell_data -> max_iter); HYPRE_Int num_iterations = (maxwell_data -> num_iterations); HYPRE_Int logging = (maxwell_data -> logging); @@ -386,7 +386,7 @@ hypre_MaxwellGetFinalRelativeResidualNorm( void *maxwell_vdata, } else if (num_iterations == max_iter) { - *relative_residual_norm = rel_norms[num_iterations-1]; + *relative_residual_norm = rel_norms[num_iterations - 1]; } else { diff --git a/external/hypre/src/sstruct_ls/maxwell_TV.h b/external/hypre/src/sstruct_ls/maxwell_TV.h index b7250506..72ea06bc 100644 --- a/external/hypre/src/sstruct_ls/maxwell_TV.h +++ b/external/hypre/src/sstruct_ls/maxwell_TV.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -21,22 +21,22 @@ typedef struct { MPI_Comm comm; - + HYPRE_Real tol; HYPRE_Int max_iter; HYPRE_Int rel_change; HYPRE_Int zero_guess; HYPRE_Int ndim; - + HYPRE_Int num_pre_relax; /* number of pre relaxation sweeps */ HYPRE_Int num_post_relax; /* number of post relaxation sweeps */ HYPRE_Int constant_coef; - + hypre_Index *rfactor; hypre_SStructGrid **egrid_l; - + HYPRE_IJMatrix Aen; hypre_ParCSRMatrix **Aen_l; @@ -68,8 +68,8 @@ typedef struct hypre_ParCSRMatrix *T_transpose; /* edge data structure. These will have grids. */ - HYPRE_Int edge_maxlevels; - HYPRE_Int edge_numlevels; + HYPRE_Int edge_maxlevels; + HYPRE_Int edge_numlevels; hypre_ParCSRMatrix **Aee_l; hypre_ParVector **be_l; hypre_ParVector **xe_l; diff --git a/external/hypre/src/sstruct_ls/maxwell_TV_setup.c b/external/hypre/src/sstruct_ls/maxwell_TV_setup.c index 98524324..42e5e91c 100644 --- a/external/hypre/src/sstruct_ls/maxwell_TV_setup.c +++ b/external/hypre/src/sstruct_ls/maxwell_TV_setup.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -31,9 +31,9 @@ hypre_MaxwellTV_Setup(void *maxwell_vdata, MPI_Comm comm = hypre_SStructMatrixComm(Aee_in); - hypre_SStructGraph *graph= hypre_SStructMatrixGraph(Aee_in); + hypre_SStructGraph *graph = hypre_SStructMatrixGraph(Aee_in); hypre_SStructGrid *grid = hypre_SStructGraphGrid(graph); - hypre_Index *rfactor_in= (maxwell_TV_data-> rfactor); + hypre_Index *rfactor_in = (maxwell_TV_data-> rfactor); hypre_ParCSRMatrix *T = (maxwell_TV_data-> Tgrad); hypre_SStructMatrix *Ann; @@ -91,7 +91,7 @@ hypre_MaxwellTV_Setup(void *maxwell_vdata, HYPRE_Int *relax_types; void *e_amg_vdata; hypre_ParAMGData *e_amgData; - HYPRE_Int numCGSweeps= 10; + HYPRE_Int numCGSweeps = 10; HYPRE_Int **amg_CF_marker; hypre_ParCSRMatrix **A_array; #endif @@ -102,7 +102,7 @@ hypre_MaxwellTV_Setup(void *maxwell_vdata, HYPRE_Int *coarsen; hypre_SStructGrid **egrid_l; hypre_SStructGrid *edge_grid, *face_grid, *cell_grid; - hypre_SStructGrid **topological_edge, **topological_face, **topological_cell; + hypre_SStructGrid **topological_edge, **topological_face = NULL, **topological_cell; HYPRE_Int **BdryRanks_l; HYPRE_Int *BdryRanksCnts_l; @@ -114,7 +114,7 @@ hypre_MaxwellTV_Setup(void *maxwell_vdata, hypre_Box *box, *box_piece, *contract_box; hypre_BoxArray *cboxes; - HYPRE_SStructVariable *vartypes, *vartype_edges, *vartype_faces, *vartype_cell; + HYPRE_SStructVariable *vartypes, *vartype_edges, *vartype_faces = NULL, *vartype_cell; hypre_SStructStencil **Ann_stencils; hypre_MaxwellOffProcRow **OffProcRows; @@ -123,7 +123,7 @@ hypre_MaxwellTV_Setup(void *maxwell_vdata, hypre_Index rfactor; hypre_Index index, cindex, shape, loop_size, start, lindex; HYPRE_Int stencil_size; - HYPRE_Int matrix_type= HYPRE_PARCSR; + HYPRE_Int matrix_type = HYPRE_PARCSR; HYPRE_Int ndim = hypre_SStructMatrixNDim(Aee_in); HYPRE_Int nparts, part, vars, nboxes, lev_nboxes; @@ -139,7 +139,7 @@ hypre_MaxwellTV_Setup(void *maxwell_vdata, hypre_BoxManager *node_boxman; hypre_BoxManEntry *entry; - HYPRE_Int kstart=0, kend=0; + HYPRE_Int kstart = 0, kend = 0; HYPRE_BigInt ilower, iupper; HYPRE_BigInt jlower, jupper; HYPRE_Int myproc; @@ -149,25 +149,28 @@ hypre_MaxwellTV_Setup(void *maxwell_vdata, HYPRE_Int edge_maxlevels, edge_numlevels, en_numlevels; - HYPRE_Int constant_coef= maxwell_TV_data -> constant_coef; + HYPRE_Int constant_coef = maxwell_TV_data -> constant_coef; HYPRE_Int trueV = 1; - HYPRE_Int falseV= 0; + HYPRE_Int falseV = 0; HYPRE_Int ierr = 0; #if DEBUG /*char filename[255];*/ #endif + HYPRE_MemoryLocation memory_location = hypre_ParCSRMatrixMemoryLocation(Aee); + hypre_MPI_Comm_rank(comm, &myproc); - (maxwell_TV_data -> ndim)= ndim; + (maxwell_TV_data -> ndim) = ndim; /* Adjust rfactor so that the correct dimension is used */ - for (i= ndim; i< 3; i++) + for (i = ndim; i < 3; i++) { - rfactor_in[0][i]= 1; + rfactor_in[0][i] = 1; } hypre_CopyIndex(rfactor_in[0], rfactor); + hypre_SetIndex(lindex, 0); /*--------------------------------------------------------------------- * Set up matrices Ann, Aen. @@ -178,22 +181,22 @@ hypre_MaxwellTV_Setup(void *maxwell_vdata, * * Need to form the grid, graph, etc. for these matrices. *---------------------------------------------------------------------*/ - nparts= hypre_SStructMatrixNParts(Aee_in); + nparts = hypre_SStructMatrixNParts(Aee_in); HYPRE_SStructGridCreate(comm, ndim, nparts, &node_grid); /* grids can be constructed from the cell-centre grid of Aee_in */ - vartypes= hypre_CTAlloc(HYPRE_SStructVariable, 1, HYPRE_MEMORY_HOST); - vartypes[0]= HYPRE_SSTRUCT_VARIABLE_NODE; + vartypes = hypre_CTAlloc(HYPRE_SStructVariable, 1, HYPRE_MEMORY_HOST); + vartypes[0] = HYPRE_SSTRUCT_VARIABLE_NODE; - for (i= 0; i< nparts; i++) + for (i = 0; i < nparts; i++) { - pgrid= hypre_SStructPMatrixPGrid(hypre_SStructMatrixPMatrix(Aee_in, i)); - sgrid= hypre_SStructPGridCellSGrid(pgrid); + pgrid = hypre_SStructPMatrixPGrid(hypre_SStructMatrixPMatrix(Aee_in, i)); + sgrid = hypre_SStructPGridCellSGrid(pgrid); - boxes= hypre_StructGridBoxes(sgrid); + boxes = hypre_StructGridBoxes(sgrid); hypre_ForBoxI(j, boxes) { - box= hypre_BoxArrayBox(boxes, j); + box = hypre_BoxArrayBox(boxes, j); HYPRE_SStructGridSetExtents(node_grid, i, hypre_BoxIMin(box), hypre_BoxIMax(box)); } @@ -203,33 +206,33 @@ hypre_MaxwellTV_Setup(void *maxwell_vdata, HYPRE_SStructGridAssemble(node_grid); /* Ann stencils & graph */ - stencil_size= 1; - for (i= 0; i< ndim; i++) + stencil_size = 1; + for (i = 0; i < ndim; i++) { - stencil_size*= 3; + stencil_size *= 3; } - Ann_stencils= hypre_CTAlloc(hypre_SStructStencil *, 1, HYPRE_MEMORY_HOST); + Ann_stencils = hypre_CTAlloc(hypre_SStructStencil *, 1, HYPRE_MEMORY_HOST); HYPRE_SStructStencilCreate(ndim, stencil_size, &Ann_stencils[0]); - vars= 0; /* scalar equation, node-to-node */ + vars = 0; /* scalar equation, node-to-node */ if (ndim > 2) { - kstart= -1; + kstart = -1; kend = 2; } else if (ndim == 2) { - kstart= 0; + kstart = 0; kend = 1; } - m= 0; - for (k= kstart; k< kend; k++) + m = 0; + for (k = kstart; k < kend; k++) { - for (j= -1; j< 2; j++) + for (j = -1; j < 2; j++) { - for (i= -1; i< 2; i++) + for (i = -1; i < 2; i++) { hypre_SetIndex3(shape, i, j, k); HYPRE_SStructStencilSetEntry(Ann_stencils[0], m, shape, vars); @@ -239,7 +242,7 @@ hypre_MaxwellTV_Setup(void *maxwell_vdata, } HYPRE_SStructGraphCreate(comm, node_grid, &node_graph); - for (part= 0; part< nparts; part++) + for (part = 0; part < nparts; part++) { HYPRE_SStructGraphSetStencil(node_graph, part, 0, Ann_stencils[0]); } @@ -251,52 +254,52 @@ hypre_MaxwellTV_Setup(void *maxwell_vdata, /* Aen is constructed as an IJ matrix. Constructing it as a sstruct_matrix * would make it a square matrix. */ - part= 0; + part = 0; i = 0; hypre_SStructGridBoxProcFindBoxManEntry(node_grid, part, 0, i, myproc, &entry); - pgrid= hypre_SStructGridPGrid(node_grid, part); - vartypes[0]= HYPRE_SSTRUCT_VARIABLE_NODE; - j= vartypes[0]; - sgrid= hypre_SStructPGridVTSGrid(pgrid, j); - boxes= hypre_StructGridBoxes(sgrid); + pgrid = hypre_SStructGridPGrid(node_grid, part); + vartypes[0] = HYPRE_SSTRUCT_VARIABLE_NODE; + j = vartypes[0]; + sgrid = hypre_SStructPGridVTSGrid(pgrid, j); + boxes = hypre_StructGridBoxes(sgrid); box = hypre_BoxArrayBox(boxes, 0); hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMin(box), &jlower); hypre_SStructGridBoxProcFindBoxManEntry(grid, part, 0, i, myproc, &entry); - pgrid= hypre_SStructGridPGrid(grid, part); + pgrid = hypre_SStructGridPGrid(grid, part); /* grab the first edge variable type */ - vartypes[0]= hypre_SStructPGridVarType(pgrid, 0); - j= vartypes[0]; - sgrid= hypre_SStructPGridVTSGrid(pgrid, j); - boxes= hypre_StructGridBoxes(sgrid); + vartypes[0] = hypre_SStructPGridVarType(pgrid, 0); + j = vartypes[0]; + sgrid = hypre_SStructPGridVTSGrid(pgrid, j); + boxes = hypre_StructGridBoxes(sgrid); box = hypre_BoxArrayBox(boxes, 0); hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMin(box), &ilower); - part = nparts-1; - pgrid= hypre_SStructGridPGrid(node_grid, part); - vartypes[0]= HYPRE_SSTRUCT_VARIABLE_NODE; - j= vartypes[0]; - sgrid= hypre_SStructPGridVTSGrid(pgrid, j); - boxes= hypre_StructGridBoxes(sgrid); - box = hypre_BoxArrayBox(boxes, hypre_BoxArraySize(boxes)-1); + part = nparts - 1; + pgrid = hypre_SStructGridPGrid(node_grid, part); + vartypes[0] = HYPRE_SSTRUCT_VARIABLE_NODE; + j = vartypes[0]; + sgrid = hypre_SStructPGridVTSGrid(pgrid, j); + boxes = hypre_StructGridBoxes(sgrid); + box = hypre_BoxArrayBox(boxes, hypre_BoxArraySize(boxes) - 1); hypre_SStructGridBoxProcFindBoxManEntry(node_grid, part, 0, - hypre_BoxArraySize(boxes)-1, + hypre_BoxArraySize(boxes) - 1, myproc, &entry); hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMax(box), &jupper); - pgrid= hypre_SStructGridPGrid(grid, part); + pgrid = hypre_SStructGridPGrid(grid, part); vars = hypre_SStructPGridNVars(pgrid); - vartypes[0]= hypre_SStructPGridVarType(pgrid, vars-1); - j= vartypes[0]; - sgrid= hypre_SStructPGridVTSGrid(pgrid, j); - boxes= hypre_StructGridBoxes(sgrid); - box = hypre_BoxArrayBox(boxes, hypre_BoxArraySize(boxes)-1); + vartypes[0] = hypre_SStructPGridVarType(pgrid, vars - 1); + j = vartypes[0]; + sgrid = hypre_SStructPGridVTSGrid(pgrid, j); + boxes = hypre_StructGridBoxes(sgrid); + box = hypre_BoxArrayBox(boxes, hypre_BoxArraySize(boxes) - 1); hypre_TFree(vartypes, HYPRE_MEMORY_HOST); - hypre_SStructGridBoxProcFindBoxManEntry(grid, part, vars-1, - hypre_BoxArraySize(boxes)-1, + hypre_SStructGridBoxProcFindBoxManEntry(grid, part, vars - 1, + hypre_BoxArraySize(boxes) - 1, myproc, &entry); hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMax(box), &iupper); @@ -306,15 +309,15 @@ hypre_MaxwellTV_Setup(void *maxwell_vdata, /* setup the Aen & Ann using matrix-matrix products * Aen's parscr matrix has not been formed yet-> fill up ij_matrix */ - parcsr_mat= hypre_ParMatmul(Aee, T); + parcsr_mat = hypre_ParMatmul(Aee, T); HYPRE_ParCSRMatrixGetLocalRange((HYPRE_ParCSRMatrix) parcsr_mat, &first_local_row, &last_local_row, &first_local_col, &last_local_col); - size_ptr = hypre_TAlloc(HYPRE_Int, 1, HYPRE_MEMORY_DEVICE); - big_i_ptr = hypre_TAlloc(HYPRE_BigInt, 1, HYPRE_MEMORY_DEVICE); + size_ptr = hypre_TAlloc(HYPRE_Int, 1, memory_location); + big_i_ptr = hypre_TAlloc(HYPRE_BigInt, 1, memory_location); - for (big_i= first_local_row; big_i<= last_local_row; big_i++) + for (big_i = first_local_row; big_i <= last_local_row; big_i++) { HYPRE_ParCSRMatrixGetRow((HYPRE_ParCSRMatrix) parcsr_mat, big_i, &size, &col_inds, &values); @@ -334,13 +337,13 @@ hypre_MaxwellTV_Setup(void *maxwell_vdata, /* Ann's parscr matrix has not been formed yet-> fill up ij_matrix */ hypre_ParCSRMatrixTranspose(T, &T_transpose, 1); - parcsr_mat= hypre_ParMatmul(T_transpose, - (hypre_ParCSRMatrix *) hypre_IJMatrixObject(Aen)); + parcsr_mat = hypre_ParMatmul(T_transpose, + (hypre_ParCSRMatrix *) hypre_IJMatrixObject(Aen)); HYPRE_ParCSRMatrixGetLocalRange((HYPRE_ParCSRMatrix) parcsr_mat, &first_local_row, &last_local_row, &first_local_col, &last_local_col); - for (big_i= first_local_row; big_i<= last_local_row; big_i++) + for (big_i = first_local_row; big_i <= last_local_row; big_i++) { HYPRE_ParCSRMatrixGetRow((HYPRE_ParCSRMatrix) parcsr_mat, big_i, &size, &col_inds, &values); @@ -358,29 +361,29 @@ hypre_MaxwellTV_Setup(void *maxwell_vdata, } hypre_ParCSRMatrixDestroy(parcsr_mat); - hypre_TFree(size_ptr, HYPRE_MEMORY_DEVICE); - hypre_TFree(big_i_ptr, HYPRE_MEMORY_DEVICE); + hypre_TFree(size_ptr, memory_location); + hypre_TFree(big_i_ptr, memory_location); /* set the physical boundary points to identity */ - nrows= 0; - for (part= 0; part< nparts; part++) + nrows = 0; + for (part = 0; part < nparts; part++) { pgrid = hypre_SStructGridPGrid(node_grid, part); sgrid = hypre_SStructPGridSGrid(pgrid, 0); - nrows+= hypre_StructGridLocalSize(sgrid); + nrows += hypre_StructGridLocalSize(sgrid); } flag = hypre_CTAlloc(HYPRE_Int, nrows, HYPRE_MEMORY_HOST); - flag2= hypre_CTAlloc(HYPRE_BigInt, nrows, HYPRE_MEMORY_HOST); - for (i= 0; i< nrows; i++) + flag2 = hypre_CTAlloc(HYPRE_BigInt, nrows, HYPRE_MEMORY_HOST); + for (i = 0; i < nrows; i++) { - flag[i]= 1; + flag[i] = 1; } /* Determine physical boundary points. Get the rank and set flag[rank]= rank. This will boundary point, i.e., ncols[rank]> 0 will flag a boundary point. */ - start_rank= hypre_SStructGridStartRank(node_grid); - for (part= 0; part< nparts; part++) + start_rank = hypre_SStructGridStartRank(node_grid); + for (part = 0; part < nparts; part++) { pgrid = hypre_SStructGridPGrid(node_grid, part); sgrid = hypre_SStructPGridSGrid(pgrid, 0); @@ -389,16 +392,16 @@ hypre_MaxwellTV_Setup(void *maxwell_vdata, hypre_ForBoxI(j, boxes) { - box= hypre_BoxArrayBox(boxes, j); + box = hypre_BoxArrayBox(boxes, j); hypre_BoxManGetEntry(node_boxman, myproc, j, &entry); - i= hypre_BoxVolume(box); + i = hypre_BoxVolume(box); - tmp_box_array= hypre_BoxArrayCreate(0, ndim); + tmp_box_array = hypre_BoxArrayCreate(0, ndim); ierr += hypre_BoxBoundaryG(box, sgrid, tmp_box_array); - for (m= 0; m< hypre_BoxArraySize(tmp_box_array); m++) + for (m = 0; m < hypre_BoxArraySize(tmp_box_array); m++) { - box_piece= hypre_BoxArrayBox(tmp_box_array, m); + box_piece = hypre_BoxArrayBox(tmp_box_array, m); if (hypre_BoxVolume(box_piece) < i) { hypre_BoxGetSize(box_piece, loop_size); @@ -412,8 +415,8 @@ hypre_MaxwellTV_Setup(void *maxwell_vdata, hypre_SStructBoxManEntryGetGlobalRank(entry, index, &rank, matrix_type); - flag[(HYPRE_Int)(rank-start_rank)] = 0; - flag2[(HYPRE_Int)(rank-start_rank)]= rank; + flag[(HYPRE_Int)(rank - start_rank)] = 0; + flag2[(HYPRE_Int)(rank - start_rank)] = rank; } hypre_SerialBoxLoop0End(); } /* if (hypre_BoxVolume(box_piece) < i) */ @@ -423,8 +426,8 @@ hypre_MaxwellTV_Setup(void *maxwell_vdata, } /* for (part= 0; part< nparts; part++) */ /* set up boundary identity */ - j= 0; - for (i= 0; i< nrows; i++) + j = 0; + for (i = 0; i < nrows; i++) { if (!flag[i]) { @@ -432,19 +435,19 @@ hypre_MaxwellTV_Setup(void *maxwell_vdata, } } - inode= hypre_CTAlloc(HYPRE_BigInt, j, HYPRE_MEMORY_DEVICE); - ncols= hypre_CTAlloc(HYPRE_Int, j, HYPRE_MEMORY_DEVICE); - jnode= hypre_CTAlloc(HYPRE_BigInt, j, HYPRE_MEMORY_DEVICE); - vals = hypre_TAlloc(HYPRE_Real, j, HYPRE_MEMORY_DEVICE); + inode = hypre_CTAlloc(HYPRE_BigInt, j, memory_location); + ncols = hypre_CTAlloc(HYPRE_Int, j, memory_location); + jnode = hypre_CTAlloc(HYPRE_BigInt, j, memory_location); + vals = hypre_TAlloc(HYPRE_Real, j, memory_location); - j= 0; - for (i= 0; i< nrows; i++) + j = 0; + for (i = 0; i < nrows; i++) { if (!flag[i]) { - ncols[j]= 1; - inode[j]= flag2[i]; - jnode[j]= flag2[i]; + ncols[j] = 1; + inode[j] = flag2[i]; + jnode[j] = flag2[i]; vals[j] = 1.0; j++; } @@ -455,10 +458,10 @@ hypre_MaxwellTV_Setup(void *maxwell_vdata, HYPRE_IJMatrixSetValues(hypre_SStructMatrixIJMatrix(Ann), j, ncols, (const HYPRE_BigInt*) inode, (const HYPRE_BigInt*) jnode, (const HYPRE_Real*) vals); - hypre_TFree(ncols, HYPRE_MEMORY_DEVICE); - hypre_TFree(inode, HYPRE_MEMORY_DEVICE); - hypre_TFree(jnode, HYPRE_MEMORY_DEVICE); - hypre_TFree(vals, HYPRE_MEMORY_DEVICE); + hypre_TFree(ncols, memory_location); + hypre_TFree(inode, memory_location); + hypre_TFree(jnode, memory_location); + hypre_TFree(vals, memory_location); HYPRE_SStructMatrixAssemble(Ann); #if DEBUG @@ -494,7 +497,7 @@ hypre_MaxwellTV_Setup(void *maxwell_vdata, /* create the multigrid components for the nodal matrix using amg. We need to extract the nodal mg components to form the system mg components. */ - amg_vdata= (void *) hypre_BoomerAMGCreate(); + amg_vdata = (void *) hypre_BoomerAMGCreate(); hypre_BoomerAMGSetStrongThreshold(amg_vdata, 0.25); hypre_BoomerAMGSetup(amg_vdata, hypre_SStructMatrixParCSRMatrix(Ann), @@ -503,7 +506,7 @@ hypre_MaxwellTV_Setup(void *maxwell_vdata, { amg_data = (hypre_ParAMGData*) amg_vdata; - node_numlevels= hypre_ParAMGDataNumLevels(amg_data); + node_numlevels = hypre_ParAMGDataNumLevels(amg_data); Ann_l = hypre_CTAlloc(hypre_ParCSRMatrix *, node_numlevels, HYPRE_MEMORY_HOST); Pn_l = hypre_CTAlloc(hypre_ParCSRMatrix *, node_numlevels, HYPRE_MEMORY_HOST); @@ -512,43 +515,43 @@ hypre_MaxwellTV_Setup(void *maxwell_vdata, xn_l = hypre_CTAlloc(hypre_ParVector*, node_numlevels, HYPRE_MEMORY_HOST); resn_l = hypre_CTAlloc(hypre_ParVector*, node_numlevels, HYPRE_MEMORY_HOST); en_l = hypre_CTAlloc(hypre_ParVector*, node_numlevels, HYPRE_MEMORY_HOST); - nVtemp_l= hypre_CTAlloc(hypre_ParVector*, node_numlevels, HYPRE_MEMORY_HOST); - nVtemp2_l= hypre_CTAlloc(hypre_ParVector*, node_numlevels, HYPRE_MEMORY_HOST); + nVtemp_l = hypre_CTAlloc(hypre_ParVector*, node_numlevels, HYPRE_MEMORY_HOST); + nVtemp2_l = hypre_CTAlloc(hypre_ParVector*, node_numlevels, HYPRE_MEMORY_HOST); /* relaxation parameters */ nCF_marker_l = hypre_CTAlloc(HYPRE_Int *, node_numlevels, HYPRE_MEMORY_HOST); - nrelax_weight= hypre_CTAlloc(HYPRE_Real , node_numlevels, HYPRE_MEMORY_HOST); - nomega = hypre_CTAlloc(HYPRE_Real , node_numlevels, HYPRE_MEMORY_HOST); + nrelax_weight = hypre_CTAlloc(HYPRE_Real, node_numlevels, HYPRE_MEMORY_HOST); + nomega = hypre_CTAlloc(HYPRE_Real, node_numlevels, HYPRE_MEMORY_HOST); nrelax_type = 6; /* fast parallel hybrid */ - for (i= 0; i< node_numlevels; i++) + for (i = 0; i < node_numlevels; i++) { - Ann_l[i]= (hypre_ParAMGDataAArray(amg_data))[i]; + Ann_l[i] = (hypre_ParAMGDataAArray(amg_data))[i]; Pn_l[i] = hypre_ParAMGDataPArray(amg_data)[i]; - RnT_l[i]= hypre_ParAMGDataRArray(amg_data)[i]; + RnT_l[i] = hypre_ParAMGDataRArray(amg_data)[i]; bn_l[i] = hypre_ParAMGDataFArray(amg_data)[i]; xn_l[i] = hypre_ParAMGDataUArray(amg_data)[i]; /* create temporary vectors */ - resn_l[i]= hypre_ParVectorCreate(hypre_ParCSRMatrixComm(Ann_l[i]), - hypre_ParCSRMatrixGlobalNumRows(Ann_l[i]), - hypre_ParCSRMatrixRowStarts(Ann_l[i])); + resn_l[i] = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(Ann_l[i]), + hypre_ParCSRMatrixGlobalNumRows(Ann_l[i]), + hypre_ParCSRMatrixRowStarts(Ann_l[i])); hypre_ParVectorInitialize(resn_l[i]); - en_l[i]= hypre_ParVectorCreate(hypre_ParCSRMatrixComm(Ann_l[i]), - hypre_ParCSRMatrixGlobalNumRows(Ann_l[i]), - hypre_ParCSRMatrixRowStarts(Ann_l[i])); + en_l[i] = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(Ann_l[i]), + hypre_ParCSRMatrixGlobalNumRows(Ann_l[i]), + hypre_ParCSRMatrixRowStarts(Ann_l[i])); hypre_ParVectorInitialize(en_l[i]); - nVtemp_l[i]= hypre_ParVectorCreate(hypre_ParCSRMatrixComm(Ann_l[i]), - hypre_ParCSRMatrixGlobalNumRows(Ann_l[i]), - hypre_ParCSRMatrixRowStarts(Ann_l[i])); - hypre_ParVectorInitialize(nVtemp_l[i]); - - nVtemp2_l[i]= hypre_ParVectorCreate(hypre_ParCSRMatrixComm(Ann_l[i]), + nVtemp_l[i] = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(Ann_l[i]), hypre_ParCSRMatrixGlobalNumRows(Ann_l[i]), hypre_ParCSRMatrixRowStarts(Ann_l[i])); + hypre_ParVectorInitialize(nVtemp_l[i]); + + nVtemp2_l[i] = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(Ann_l[i]), + hypre_ParCSRMatrixGlobalNumRows(Ann_l[i]), + hypre_ParCSRMatrixRowStarts(Ann_l[i])); hypre_ParVectorInitialize(nVtemp2_l[i]); if (hypre_ParAMGDataCFMarkerArray(amg_data)[i]) @@ -559,7 +562,7 @@ hypre_MaxwellTV_Setup(void *maxwell_vdata, { nCF_marker_l[i] = NULL; } - nrelax_weight[i]= hypre_ParAMGDataRelaxWeight(amg_data)[i]; + nrelax_weight[i] = hypre_ParAMGDataRelaxWeight(amg_data)[i]; nomega[i] = hypre_ParAMGDataOmega(amg_data)[i]; } } @@ -590,35 +593,35 @@ hypre_MaxwellTV_Setup(void *maxwell_vdata, * scheme to semi-coarsen. That is, coarsen wrt to rfactor, with * rfactor[i] > 1 for i < ndim. * Determine the number of levels for the edge problem */ - cboxes= hypre_BoxArrayCreate(0, ndim); - coarsen= hypre_CTAlloc(HYPRE_Int, nparts, HYPRE_MEMORY_HOST); - edge_maxlevels= 0; - for (part= 0; part< nparts; part++) + cboxes = hypre_BoxArrayCreate(0, ndim); + coarsen = hypre_CTAlloc(HYPRE_Int, nparts, HYPRE_MEMORY_HOST); + edge_maxlevels = 0; + for (part = 0; part < nparts; part++) { - pgrid= hypre_SStructGridPGrid(grid, part); - sgrid= hypre_SStructPGridCellSGrid(pgrid); + pgrid = hypre_SStructGridPGrid(grid, part); + sgrid = hypre_SStructPGridCellSGrid(pgrid); - box= hypre_BoxDuplicate(hypre_StructGridBoundingBox(sgrid)); + box = hypre_BoxDuplicate(hypre_StructGridBoundingBox(sgrid)); hypre_AppendBox(box, cboxes); /* since rfactor[i]>1, the following i will be an upper bound of the number of levels. */ i = hypre_Log2(hypre_BoxSizeD(box, 0)) + 2 + - hypre_Log2(hypre_BoxSizeD(box, 1)) + 2 + - hypre_Log2(hypre_BoxSizeD(box, 2)) + 2; + hypre_Log2(hypre_BoxSizeD(box, 1)) + 2 + + hypre_Log2(hypre_BoxSizeD(box, 2)) + 2; hypre_BoxDestroy(box); /* the following allows some of the parts to have volume zero grids */ - edge_maxlevels= hypre_max(edge_maxlevels, i); + edge_maxlevels = hypre_max(edge_maxlevels, i); coarsen[part] = trueV; } if ((maxwell_TV_data-> edge_maxlevels) > 0) { - edge_maxlevels= hypre_min(edge_maxlevels, - (maxwell_TV_data -> edge_maxlevels)); + edge_maxlevels = hypre_min(edge_maxlevels, + (maxwell_TV_data -> edge_maxlevels)); } - (maxwell_TV_data -> edge_maxlevels)= edge_maxlevels; + (maxwell_TV_data -> edge_maxlevels) = edge_maxlevels; /* form the edge grids: coarsen the cell grid on each part and then set the boxes of these grids to be the boxes of the sstruct_grid. */ @@ -628,37 +631,37 @@ hypre_MaxwellTV_Setup(void *maxwell_vdata, /* form the topological grids for the topological matrices. */ /* Assuming same variable ordering on all parts */ - pgrid= hypre_SStructGridPGrid(grid, 0); + pgrid = hypre_SStructGridPGrid(grid, 0); HYPRE_SStructGridCreate(comm, ndim, nparts, &edge_grid); - vartype_edges= hypre_CTAlloc(HYPRE_SStructVariable, ndim, HYPRE_MEMORY_HOST); + vartype_edges = hypre_CTAlloc(HYPRE_SStructVariable, ndim, HYPRE_MEMORY_HOST); if (ndim > 2) { HYPRE_SStructGridCreate(comm, ndim, nparts, &face_grid); - vartype_faces= hypre_CTAlloc(HYPRE_SStructVariable, ndim, HYPRE_MEMORY_HOST); - for (i= 0; i< 3; i++) + vartype_faces = hypre_CTAlloc(HYPRE_SStructVariable, ndim, HYPRE_MEMORY_HOST); + for (i = 0; i < 3; i++) { - vartype_edges[2]= hypre_SStructPGridVarType(pgrid, i); - j= vartype_edges[2]; + vartype_edges[2] = hypre_SStructPGridVarType(pgrid, i); + j = vartype_edges[2]; - switch(j) + switch (j) { case 5: { - vartype_edges[i]= HYPRE_SSTRUCT_VARIABLE_XEDGE; - vartype_faces[i]= HYPRE_SSTRUCT_VARIABLE_XFACE; + vartype_edges[i] = HYPRE_SSTRUCT_VARIABLE_XEDGE; + vartype_faces[i] = HYPRE_SSTRUCT_VARIABLE_XFACE; break; } case 6: { - vartype_edges[i]= HYPRE_SSTRUCT_VARIABLE_YEDGE; - vartype_faces[i]= HYPRE_SSTRUCT_VARIABLE_YFACE; + vartype_edges[i] = HYPRE_SSTRUCT_VARIABLE_YEDGE; + vartype_faces[i] = HYPRE_SSTRUCT_VARIABLE_YFACE; break; } case 7: { - vartype_edges[i]= HYPRE_SSTRUCT_VARIABLE_ZEDGE; - vartype_faces[i]= HYPRE_SSTRUCT_VARIABLE_ZFACE; + vartype_edges[i] = HYPRE_SSTRUCT_VARIABLE_ZEDGE; + vartype_faces[i] = HYPRE_SSTRUCT_VARIABLE_ZFACE; break; } @@ -667,21 +670,21 @@ hypre_MaxwellTV_Setup(void *maxwell_vdata, } else { - for (i= 0; i< 2; i++) + for (i = 0; i < 2; i++) { - vartype_edges[1]= hypre_SStructPGridVarType(pgrid, i); - j= vartype_edges[1]; + vartype_edges[1] = hypre_SStructPGridVarType(pgrid, i); + j = vartype_edges[1]; - switch(j) + switch (j) { case 2: { - vartype_edges[i]= HYPRE_SSTRUCT_VARIABLE_XFACE; + vartype_edges[i] = HYPRE_SSTRUCT_VARIABLE_XFACE; break; } case 3: { - vartype_edges[i]= HYPRE_SSTRUCT_VARIABLE_YFACE; + vartype_edges[i] = HYPRE_SSTRUCT_VARIABLE_YFACE; break; } } /* switch(j) */ @@ -689,18 +692,18 @@ hypre_MaxwellTV_Setup(void *maxwell_vdata, } HYPRE_SStructGridCreate(comm, ndim, nparts, &cell_grid); - vartype_cell= hypre_CTAlloc(HYPRE_SStructVariable, 1, HYPRE_MEMORY_HOST); - vartype_cell[0]= HYPRE_SSTRUCT_VARIABLE_CELL; + vartype_cell = hypre_CTAlloc(HYPRE_SStructVariable, 1, HYPRE_MEMORY_HOST); + vartype_cell[0] = HYPRE_SSTRUCT_VARIABLE_CELL; - for (i= 0; i< nparts; i++) + for (i = 0; i < nparts; i++) { - pgrid= hypre_SStructPMatrixPGrid(hypre_SStructMatrixPMatrix(Aee_in, i)); - sgrid= hypre_SStructPGridCellSGrid(pgrid); + pgrid = hypre_SStructPMatrixPGrid(hypre_SStructMatrixPMatrix(Aee_in, i)); + sgrid = hypre_SStructPGridCellSGrid(pgrid); - boxes= hypre_StructGridBoxes(sgrid); + boxes = hypre_StructGridBoxes(sgrid); hypre_ForBoxI(j, boxes) { - box= hypre_BoxArrayBox(boxes, j); + box = hypre_BoxArrayBox(boxes, j); HYPRE_SStructGridSetExtents(edge_grid, i, hypre_BoxIMin(box), hypre_BoxIMax(box)); HYPRE_SStructGridSetExtents(cell_grid, i, @@ -722,17 +725,17 @@ hypre_MaxwellTV_Setup(void *maxwell_vdata, HYPRE_SStructGridAssemble(edge_grid); topological_edge = hypre_TAlloc(hypre_SStructGrid *, edge_maxlevels, HYPRE_MEMORY_HOST); - topological_edge[0]= edge_grid; + topological_edge[0] = edge_grid; HYPRE_SStructGridAssemble(cell_grid); topological_cell = hypre_TAlloc(hypre_SStructGrid *, edge_maxlevels, HYPRE_MEMORY_HOST); - topological_cell[0]= cell_grid; + topological_cell[0] = cell_grid; if (ndim > 2) { HYPRE_SStructGridAssemble(face_grid); - topological_face= hypre_TAlloc(hypre_SStructGrid *, edge_maxlevels, HYPRE_MEMORY_HOST); - topological_face[0]= face_grid; + topological_face = hypre_TAlloc(hypre_SStructGrid *, edge_maxlevels, HYPRE_MEMORY_HOST); + topological_face[0] = face_grid; } /*-------------------------------------------------------------------------- @@ -741,44 +744,44 @@ hypre_MaxwellTV_Setup(void *maxwell_vdata, * replaced by the generated coarse egrid cell bounding boxes. *--------------------------------------------------------------------------*/ hypre_SetIndex3(cindex, 0, 0, 0); - j= 0; /* j tracks the number of parts that have been coarsened away */ - edge_numlevels= 1; + j = 0; /* j tracks the number of parts that have been coarsened away */ + edge_numlevels = 1; - for (l= 0; ; l++) + for (l = 0; ; l++) { - HYPRE_SStructGridCreate(comm, ndim, nparts, &egrid_l[l+1]); - HYPRE_SStructGridCreate(comm, ndim, nparts, &topological_edge[l+1]); - HYPRE_SStructGridCreate(comm, ndim, nparts, &topological_cell[l+1]); + HYPRE_SStructGridCreate(comm, ndim, nparts, &egrid_l[l + 1]); + HYPRE_SStructGridCreate(comm, ndim, nparts, &topological_edge[l + 1]); + HYPRE_SStructGridCreate(comm, ndim, nparts, &topological_cell[l + 1]); if (ndim > 2) { - HYPRE_SStructGridCreate(comm, ndim, nparts, &topological_face[l+1]); + HYPRE_SStructGridCreate(comm, ndim, nparts, &topological_face[l + 1]); } /* coarsen the non-zero bounding boxes only if we have some. */ - nboxes= 0; + nboxes = 0; if (j < nparts) { - for (part= 0; part< nparts; part++) + for (part = 0; part < nparts; part++) { - pgrid= hypre_SStructGridPGrid(egrid_l[l], part); - sgrid= hypre_SStructPGridCellSGrid(pgrid); + pgrid = hypre_SStructGridPGrid(egrid_l[l], part); + sgrid = hypre_SStructPGridCellSGrid(pgrid); if (coarsen[part]) { - box= hypre_BoxArrayBox(cboxes, part); - m= trueV; - for (i= 0; i< ndim; i++) + box = hypre_BoxArrayBox(cboxes, part); + m = trueV; + for (i = 0; i < ndim; i++) { if ( hypre_BoxIMaxD(box, i) < hypre_BoxIMinD(box, i) ) { - m= falseV; + m = falseV; break; } } if (m) { -/* MAY NEED TO CHECK THE FOLLOWING MORE CAREFULLY: */ + /* MAY NEED TO CHECK THE FOLLOWING MORE CAREFULLY: */ /* should we decrease this bounding box so that we get the correct coarse bounding box? Recall that we will decrease each box of the cell_grid so that exact rfactor divisibility @@ -788,7 +791,7 @@ hypre_MaxwellTV_Setup(void *maxwell_vdata, ending indices that are divisible by rfactor. Then an extra coarse grid layer is given by project. */ - contract_box= hypre_BoxContraction(box, sgrid, rfactor); + contract_box = hypre_BoxContraction(box, sgrid, rfactor); hypre_CopyBox(contract_box, box); hypre_BoxDestroy(contract_box); @@ -801,39 +804,39 @@ hypre_MaxwellTV_Setup(void *maxwell_vdata, /* build the coarse edge grids. Only fill up box extents. The boxes of the grid may be contracted. Note that the box projection may not perform the contraction. */ - k= 0; + k = 0; hypre_CoarsenPGrid(egrid_l[l], cindex, rfactor, part, - egrid_l[l+1], &k); + egrid_l[l + 1], &k); /* build the topological grids */ hypre_CoarsenPGrid(topological_edge[l], cindex, rfactor, part, - topological_edge[l+1], &i); + topological_edge[l + 1], &i); hypre_CoarsenPGrid(topological_cell[l], cindex, rfactor, part, - topological_cell[l+1], &i); + topological_cell[l + 1], &i); if (ndim > 2) { hypre_CoarsenPGrid(topological_face[l], cindex, rfactor, - part, topological_face[l+1], &i); + part, topological_face[l + 1], &i); } - nboxes+= k; + nboxes += k; } else { /* record empty, coarsened-away part */ - coarsen[part]= falseV; + coarsen[part] = falseV; /* set up a dummy box so this grid can be destroyed */ - HYPRE_SStructGridSetExtents(egrid_l[l+1], part, + HYPRE_SStructGridSetExtents(egrid_l[l + 1], part, hypre_BoxIMin(box), hypre_BoxIMin(box)); - HYPRE_SStructGridSetExtents(topological_edge[l+1], part, + HYPRE_SStructGridSetExtents(topological_edge[l + 1], part, hypre_BoxIMin(box), hypre_BoxIMin(box)); - HYPRE_SStructGridSetExtents(topological_cell[l+1], part, + HYPRE_SStructGridSetExtents(topological_cell[l + 1], part, hypre_BoxIMin(box), hypre_BoxIMin(box)); if (ndim > 2) { - HYPRE_SStructGridSetExtents(topological_face[l+1], part, + HYPRE_SStructGridSetExtents(topological_face[l + 1], part, hypre_BoxIMin(box), hypre_BoxIMin(box)); } j++; @@ -841,34 +844,34 @@ hypre_MaxwellTV_Setup(void *maxwell_vdata, } /* if (coarsen[part]) */ - vartypes= hypre_SStructPGridVarTypes( - hypre_SStructGridPGrid(egrid_l[l], part)); - HYPRE_SStructGridSetVariables(egrid_l[l+1], part, ndim, + vartypes = hypre_SStructPGridVarTypes( + hypre_SStructGridPGrid(egrid_l[l], part)); + HYPRE_SStructGridSetVariables(egrid_l[l + 1], part, ndim, vartypes); - HYPRE_SStructGridSetVariables(topological_edge[l+1], part, ndim, + HYPRE_SStructGridSetVariables(topological_edge[l + 1], part, ndim, vartype_edges); - HYPRE_SStructGridSetVariables(topological_cell[l+1], part, 1, + HYPRE_SStructGridSetVariables(topological_cell[l + 1], part, 1, vartype_cell); if (ndim > 2) { - HYPRE_SStructGridSetVariables(topological_face[l+1], part, ndim, + HYPRE_SStructGridSetVariables(topological_face[l + 1], part, ndim, vartype_faces); } } /* for (part= 0; part< nparts; part++) */ } /* if (j < nparts) */ - HYPRE_SStructGridAssemble(egrid_l[l+1]); - HYPRE_SStructGridAssemble(topological_edge[l+1]); - HYPRE_SStructGridAssemble(topological_cell[l+1]); + HYPRE_SStructGridAssemble(egrid_l[l + 1]); + HYPRE_SStructGridAssemble(topological_edge[l + 1]); + HYPRE_SStructGridAssemble(topological_cell[l + 1]); if (ndim > 2) { - HYPRE_SStructGridAssemble(topological_face[l+1]); + HYPRE_SStructGridAssemble(topological_face[l + 1]); } - lev_nboxes= 0; + lev_nboxes = 0; hypre_MPI_Allreduce(&nboxes, &lev_nboxes, 1, HYPRE_MPI_INT, hypre_MPI_SUM, - hypre_SStructGridComm(egrid_l[l+1])); + hypre_SStructGridComm(egrid_l[l + 1])); if (lev_nboxes) /* there were coarsen boxes */ { @@ -879,21 +882,21 @@ hypre_MaxwellTV_Setup(void *maxwell_vdata, { /* no coarse boxes. Trigger coarsening completed and destroy the cgrids corresponding to this level. */ - j= nparts; + j = nparts; } /* extract the cell bounding boxes */ if (j < nparts) { - for (part= 0; part< nparts; part++) + for (part = 0; part < nparts; part++) { if (coarsen[part]) { - pgrid= hypre_SStructGridPGrid(egrid_l[l+1], part); - sgrid= hypre_SStructPGridCellSGrid(pgrid); + pgrid = hypre_SStructGridPGrid(egrid_l[l + 1], part); + sgrid = hypre_SStructPGridCellSGrid(pgrid); - box= hypre_BoxDuplicate(hypre_StructGridBoundingBox(sgrid)); - hypre_CopyBox(box, hypre_BoxArrayBox(cboxes,part)); + box = hypre_BoxDuplicate(hypre_StructGridBoundingBox(sgrid)); + hypre_CopyBox(box, hypre_BoxArrayBox(cboxes, part)); hypre_BoxDestroy(box); } } @@ -901,23 +904,23 @@ hypre_MaxwellTV_Setup(void *maxwell_vdata, else { - HYPRE_SStructGridDestroy(egrid_l[l+1]); - HYPRE_SStructGridDestroy(topological_edge[l+1]); - HYPRE_SStructGridDestroy(topological_cell[l+1]); + HYPRE_SStructGridDestroy(egrid_l[l + 1]); + HYPRE_SStructGridDestroy(topological_edge[l + 1]); + HYPRE_SStructGridDestroy(topological_cell[l + 1]); if (ndim > 2) { - HYPRE_SStructGridDestroy(topological_face[l+1]); + HYPRE_SStructGridDestroy(topological_face[l + 1]); } break; } } - (maxwell_TV_data -> egrid_l)= egrid_l; + (maxwell_TV_data -> egrid_l) = egrid_l; hypre_Maxwell_PhysBdy(egrid_l, edge_numlevels, rfactor, &BdryRanks_l, &BdryRanksCnts_l); (maxwell_TV_data -> BdryRanks_l) = BdryRanks_l; - (maxwell_TV_data -> BdryRanksCnts_l)= BdryRanksCnts_l; + (maxwell_TV_data -> BdryRanksCnts_l) = BdryRanksCnts_l; hypre_BoxArrayDestroy(cboxes); hypre_TFree(coarsen, HYPRE_MEMORY_HOST); @@ -931,50 +934,50 @@ hypre_MaxwellTV_Setup(void *maxwell_vdata, /* Aen matrices are defined for min(edge_numlevels, node_numlevels). */ - en_numlevels= hypre_min(edge_numlevels, node_numlevels); + en_numlevels = hypre_min(edge_numlevels, node_numlevels); (maxwell_TV_data -> en_numlevels) = en_numlevels; - (maxwell_TV_data -> edge_numlevels)= edge_numlevels; + (maxwell_TV_data -> edge_numlevels) = edge_numlevels; - Aee_l= hypre_TAlloc(hypre_ParCSRMatrix *, edge_numlevels, HYPRE_MEMORY_HOST); - Aen_l= hypre_TAlloc(hypre_ParCSRMatrix *, en_numlevels, HYPRE_MEMORY_HOST); + Aee_l = hypre_TAlloc(hypre_ParCSRMatrix *, edge_numlevels, HYPRE_MEMORY_HOST); + Aen_l = hypre_TAlloc(hypre_ParCSRMatrix *, en_numlevels, HYPRE_MEMORY_HOST); /* Pe_l are defined to be IJ matrices rather than directly parcsr. This was done so that in the topological formation, some of the ij matrix routines can be used. */ - Pe_l = hypre_TAlloc(hypre_IJMatrix *, edge_numlevels-1, HYPRE_MEMORY_HOST); - ReT_l = hypre_TAlloc(hypre_IJMatrix *, edge_numlevels-1, HYPRE_MEMORY_HOST); + Pe_l = hypre_TAlloc(hypre_IJMatrix *, edge_numlevels - 1, HYPRE_MEMORY_HOST); + ReT_l = hypre_TAlloc(hypre_IJMatrix *, edge_numlevels - 1, HYPRE_MEMORY_HOST); be_l = hypre_TAlloc(hypre_ParVector *, edge_numlevels, HYPRE_MEMORY_HOST); xe_l = hypre_TAlloc(hypre_ParVector *, edge_numlevels, HYPRE_MEMORY_HOST); rese_l = hypre_TAlloc(hypre_ParVector *, edge_numlevels, HYPRE_MEMORY_HOST); ee_l = hypre_TAlloc(hypre_ParVector *, edge_numlevels, HYPRE_MEMORY_HOST); - eVtemp_l= hypre_TAlloc(hypre_ParVector *, edge_numlevels, HYPRE_MEMORY_HOST); - eVtemp2_l= hypre_TAlloc(hypre_ParVector *, edge_numlevels, HYPRE_MEMORY_HOST); + eVtemp_l = hypre_TAlloc(hypre_ParVector *, edge_numlevels, HYPRE_MEMORY_HOST); + eVtemp2_l = hypre_TAlloc(hypre_ParVector *, edge_numlevels, HYPRE_MEMORY_HOST); - Aee_l[0]= hypre_SStructMatrixParCSRMatrix(Aee_in); - Aen_l[0]=(hypre_ParCSRMatrix *) hypre_IJMatrixObject(Aen), - be_l[0] = hypre_SStructVectorParVector(b_in); + Aee_l[0] = hypre_SStructMatrixParCSRMatrix(Aee_in); + Aen_l[0] = (hypre_ParCSRMatrix *) hypre_IJMatrixObject(Aen), + be_l[0] = hypre_SStructVectorParVector(b_in); xe_l[0] = hypre_SStructVectorParVector(x_in); - rese_l[0]= + rese_l[0] = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(Aee_l[0]), hypre_ParCSRMatrixGlobalNumRows(Aee_l[0]), hypre_ParCSRMatrixRowStarts(Aee_l[0])); hypre_ParVectorInitialize(rese_l[0]); - ee_l[0]= + ee_l[0] = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(Aee_l[0]), hypre_ParCSRMatrixGlobalNumRows(Aee_l[0]), hypre_ParCSRMatrixRowStarts(Aee_l[0])); hypre_ParVectorInitialize(ee_l[0]); - eVtemp_l[0]= + eVtemp_l[0] = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(Aee_l[0]), hypre_ParCSRMatrixGlobalNumRows(Aee_l[0]), hypre_ParCSRMatrixRowStarts(Aee_l[0])); hypre_ParVectorInitialize(eVtemp_l[0]); - eVtemp2_l[0]= + eVtemp2_l[0] = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(Aee_l[0]), hypre_ParCSRMatrixGlobalNumRows(Aee_l[0]), hypre_ParCSRMatrixRowStarts(Aee_l[0])); @@ -992,31 +995,31 @@ hypre_MaxwellTV_Setup(void *maxwell_vdata, hypre_CreatePTopology(&PTopology_vdata); if (ndim > 2) { - Pe_l[l]= hypre_Maxwell_PTopology(topological_edge[l], - topological_edge[l+1], - topological_face[l], - topological_face[l+1], - topological_cell[l], - topological_cell[l+1], - Aee_l[l], - rfactor, - PTopology_vdata); + Pe_l[l] = hypre_Maxwell_PTopology(topological_edge[l], + topological_edge[l + 1], + topological_face[l], + topological_face[l + 1], + topological_cell[l], + topological_cell[l + 1], + Aee_l[l], + rfactor, + PTopology_vdata); } else { /* two-dim case: edges= faces but stored in edge grid */ - Pe_l[l]= hypre_Maxwell_PTopology(topological_edge[l], - topological_edge[l+1], - topological_edge[l], - topological_edge[l+1], - topological_cell[l], - topological_cell[l+1], - Aee_l[l], - rfactor, - PTopology_vdata); + Pe_l[l] = hypre_Maxwell_PTopology(topological_edge[l], + topological_edge[l + 1], + topological_edge[l], + topological_edge[l + 1], + topological_cell[l], + topological_cell[l + 1], + Aee_l[l], + rfactor, + PTopology_vdata); } - PTopology= (hypre_PTopology*)PTopology_vdata; + PTopology = (hypre_PTopology*)PTopology_vdata; /* extract off-processors rows of Pe_l[l]. Needed for amge.*/ hypre_SStructSharedDOF_ParcsrMatRowsComm(egrid_l[l], @@ -1051,7 +1054,7 @@ hypre_MaxwellTV_Setup(void *maxwell_vdata, hypre_DestroyPTopology(PTopology_vdata); - for (i= 0; i< num_OffProcRows; i++) + for (i = 0; i < num_OffProcRows; i++) { hypre_MaxwellOffProcRowDestroy((void *) OffProcRows[i]); } @@ -1060,75 +1063,75 @@ hypre_MaxwellTV_Setup(void *maxwell_vdata, else { - Pe_l[l]= hypre_Maxwell_PNedelec(topological_edge[l], - topological_edge[l+1], - rfactor); + Pe_l[l] = hypre_Maxwell_PNedelec(topological_edge[l], + topological_edge[l + 1], + rfactor); } #if DEBUG #endif - ReT_l[l]= Pe_l[l]; + ReT_l[l] = Pe_l[l]; hypre_BoomerAMGBuildCoarseOperator( (hypre_ParCSRMatrix *) hypre_IJMatrixObject(Pe_l[l]), Aee_l[l], (hypre_ParCSRMatrix *) hypre_IJMatrixObject(Pe_l[l]), - &Aee_l[l+1]); + &Aee_l[l + 1]); /* zero off boundary points */ - hypre_ParCSRMatrixEliminateRowsCols(Aee_l[l+1], - BdryRanksCnts_l[l+1], - BdryRanks_l[l+1]); + hypre_ParCSRMatrixEliminateRowsCols(Aee_l[l + 1], + BdryRanksCnts_l[l + 1], + BdryRanks_l[l + 1]); hypre_ParCSRMatrixTranspose( (hypre_ParCSRMatrix *) hypre_IJMatrixObject(Pe_l[l]), &transpose, 1); - parcsr_mat= hypre_ParMatmul(transpose, Aen_l[l]); - Aen_l[l+1]= hypre_ParMatmul(parcsr_mat, Pn_l[l]); + parcsr_mat = hypre_ParMatmul(transpose, Aen_l[l]); + Aen_l[l + 1] = hypre_ParMatmul(parcsr_mat, Pn_l[l]); hypre_ParCSRMatrixDestroy(parcsr_mat); hypre_ParCSRMatrixDestroy(transpose); - xe_l[l+1] = - hypre_ParVectorCreate(hypre_ParCSRMatrixComm(Aee_l[l+1]), - hypre_ParCSRMatrixGlobalNumRows(Aee_l[l+1]), - hypre_ParCSRMatrixRowStarts(Aee_l[l+1])); - hypre_ParVectorInitialize(xe_l[l+1]); - - be_l[l+1] = - hypre_ParVectorCreate(hypre_ParCSRMatrixComm(Aee_l[l+1]), - hypre_ParCSRMatrixGlobalNumRows(Aee_l[l+1]), - hypre_ParCSRMatrixRowStarts(Aee_l[l+1])); - hypre_ParVectorInitialize(be_l[l+1]); - - rese_l[l+1] = - hypre_ParVectorCreate(hypre_ParCSRMatrixComm(Aee_l[l+1]), - hypre_ParCSRMatrixGlobalNumRows(Aee_l[l+1]), - hypre_ParCSRMatrixRowStarts(Aee_l[l+1])); - hypre_ParVectorInitialize(rese_l[l+1]); - - ee_l[l+1] = - hypre_ParVectorCreate(hypre_ParCSRMatrixComm(Aee_l[l+1]), - hypre_ParCSRMatrixGlobalNumRows(Aee_l[l+1]), - hypre_ParCSRMatrixRowStarts(Aee_l[l+1])); - hypre_ParVectorInitialize(ee_l[l+1]); - - eVtemp_l[l+1] = - hypre_ParVectorCreate(hypre_ParCSRMatrixComm(Aee_l[l+1]), - hypre_ParCSRMatrixGlobalNumRows(Aee_l[l+1]), - hypre_ParCSRMatrixRowStarts(Aee_l[l+1])); - hypre_ParVectorInitialize(eVtemp_l[l+1]); - - eVtemp2_l[l+1] = - hypre_ParVectorCreate(hypre_ParCSRMatrixComm(Aee_l[l+1]), - hypre_ParCSRMatrixGlobalNumRows(Aee_l[l+1]), - hypre_ParCSRMatrixRowStarts(Aee_l[l+1])); - hypre_ParVectorInitialize(eVtemp2_l[l+1]); + xe_l[l + 1] = + hypre_ParVectorCreate(hypre_ParCSRMatrixComm(Aee_l[l + 1]), + hypre_ParCSRMatrixGlobalNumRows(Aee_l[l + 1]), + hypre_ParCSRMatrixRowStarts(Aee_l[l + 1])); + hypre_ParVectorInitialize(xe_l[l + 1]); + + be_l[l + 1] = + hypre_ParVectorCreate(hypre_ParCSRMatrixComm(Aee_l[l + 1]), + hypre_ParCSRMatrixGlobalNumRows(Aee_l[l + 1]), + hypre_ParCSRMatrixRowStarts(Aee_l[l + 1])); + hypre_ParVectorInitialize(be_l[l + 1]); + + rese_l[l + 1] = + hypre_ParVectorCreate(hypre_ParCSRMatrixComm(Aee_l[l + 1]), + hypre_ParCSRMatrixGlobalNumRows(Aee_l[l + 1]), + hypre_ParCSRMatrixRowStarts(Aee_l[l + 1])); + hypre_ParVectorInitialize(rese_l[l + 1]); + + ee_l[l + 1] = + hypre_ParVectorCreate(hypre_ParCSRMatrixComm(Aee_l[l + 1]), + hypre_ParCSRMatrixGlobalNumRows(Aee_l[l + 1]), + hypre_ParCSRMatrixRowStarts(Aee_l[l + 1])); + hypre_ParVectorInitialize(ee_l[l + 1]); + + eVtemp_l[l + 1] = + hypre_ParVectorCreate(hypre_ParCSRMatrixComm(Aee_l[l + 1]), + hypre_ParCSRMatrixGlobalNumRows(Aee_l[l + 1]), + hypre_ParCSRMatrixRowStarts(Aee_l[l + 1])); + hypre_ParVectorInitialize(eVtemp_l[l + 1]); + + eVtemp2_l[l + 1] = + hypre_ParVectorCreate(hypre_ParCSRMatrixComm(Aee_l[l + 1]), + hypre_ParCSRMatrixGlobalNumRows(Aee_l[l + 1]), + hypre_ParCSRMatrixRowStarts(Aee_l[l + 1])); + hypre_ParVectorInitialize(eVtemp2_l[l + 1]); } /* if (l < edge_numlevels) */ } /* for (l = 0; l < (en_numlevels - 1); l++) */ /* possible to have more edge levels */ - for (l = (en_numlevels-1); l < (edge_numlevels - 1); l++) + for (l = (en_numlevels - 1); l < (edge_numlevels - 1); l++) { if (!constant_coef) { @@ -1138,30 +1141,30 @@ hypre_MaxwellTV_Setup(void *maxwell_vdata, hypre_CreatePTopology(&PTopology_vdata); if (ndim > 2) { - Pe_l[l]= hypre_Maxwell_PTopology(topological_edge[l], - topological_edge[l+1], - topological_face[l], - topological_face[l+1], - topological_cell[l], - topological_cell[l+1], - Aee_l[l], - rfactor, - PTopology_vdata); + Pe_l[l] = hypre_Maxwell_PTopology(topological_edge[l], + topological_edge[l + 1], + topological_face[l], + topological_face[l + 1], + topological_cell[l], + topological_cell[l + 1], + Aee_l[l], + rfactor, + PTopology_vdata); } else { - Pe_l[l]= hypre_Maxwell_PTopology(topological_edge[l], - topological_edge[l+1], - topological_edge[l], - topological_edge[l+1], - topological_cell[l], - topological_cell[l+1], - Aee_l[l], - rfactor, - PTopology_vdata); + Pe_l[l] = hypre_Maxwell_PTopology(topological_edge[l], + topological_edge[l + 1], + topological_edge[l], + topological_edge[l + 1], + topological_cell[l], + topological_cell[l + 1], + Aee_l[l], + rfactor, + PTopology_vdata); } - PTopology= (hypre_PTopology*)PTopology_vdata; + PTopology = (hypre_PTopology*)PTopology_vdata; /* extract off-processors rows of Pe_l[l]. Needed for amge.*/ hypre_SStructSharedDOF_ParcsrMatRowsComm(egrid_l[l], @@ -1194,7 +1197,7 @@ hypre_MaxwellTV_Setup(void *maxwell_vdata, } hypre_DestroyPTopology(PTopology_vdata); - for (i= 0; i< num_OffProcRows; i++) + for (i = 0; i < num_OffProcRows; i++) { hypre_MaxwellOffProcRowDestroy((void *) OffProcRows[i]); } @@ -1203,58 +1206,58 @@ hypre_MaxwellTV_Setup(void *maxwell_vdata, else { - Pe_l[l]= hypre_Maxwell_PNedelec(topological_edge[l], - topological_edge[l+1], - rfactor); + Pe_l[l] = hypre_Maxwell_PNedelec(topological_edge[l], + topological_edge[l + 1], + rfactor); } - ReT_l[l]= Pe_l[l]; + ReT_l[l] = Pe_l[l]; hypre_BoomerAMGBuildCoarseOperator( (hypre_ParCSRMatrix *) hypre_IJMatrixObject(Pe_l[l]), Aee_l[l], (hypre_ParCSRMatrix *) hypre_IJMatrixObject(Pe_l[l]), - &Aee_l[l+1]); + &Aee_l[l + 1]); /* zero off boundary points */ - hypre_ParCSRMatrixEliminateRowsCols(Aee_l[l+1], - BdryRanksCnts_l[l+1], - BdryRanks_l[l+1]); - - xe_l[l+1] = - hypre_ParVectorCreate(hypre_ParCSRMatrixComm(Aee_l[l+1]), - hypre_ParCSRMatrixGlobalNumRows(Aee_l[l+1]), - hypre_ParCSRMatrixRowStarts(Aee_l[l+1])); - hypre_ParVectorInitialize(xe_l[l+1]); - - be_l[l+1] = - hypre_ParVectorCreate(hypre_ParCSRMatrixComm(Aee_l[l+1]), - hypre_ParCSRMatrixGlobalNumRows(Aee_l[l+1]), - hypre_ParCSRMatrixRowStarts(Aee_l[l+1])); - hypre_ParVectorInitialize(be_l[l+1]); - - ee_l[l+1] = - hypre_ParVectorCreate(hypre_ParCSRMatrixComm(Aee_l[l+1]), - hypre_ParCSRMatrixGlobalNumRows(Aee_l[l+1]), - hypre_ParCSRMatrixRowStarts(Aee_l[l+1])); - hypre_ParVectorInitialize(ee_l[l+1]); - - rese_l[l+1] = - hypre_ParVectorCreate(hypre_ParCSRMatrixComm(Aee_l[l+1]), - hypre_ParCSRMatrixGlobalNumRows(Aee_l[l+1]), - hypre_ParCSRMatrixRowStarts(Aee_l[l+1])); - hypre_ParVectorInitialize(rese_l[l+1]); - - eVtemp_l[l+1] = - hypre_ParVectorCreate(hypre_ParCSRMatrixComm(Aee_l[l+1]), - hypre_ParCSRMatrixGlobalNumRows(Aee_l[l+1]), - hypre_ParCSRMatrixRowStarts(Aee_l[l+1])); - hypre_ParVectorInitialize(eVtemp_l[l+1]); - - eVtemp2_l[l+1] = - hypre_ParVectorCreate(hypre_ParCSRMatrixComm(Aee_l[l+1]), - hypre_ParCSRMatrixGlobalNumRows(Aee_l[l+1]), - hypre_ParCSRMatrixRowStarts(Aee_l[l+1])); - hypre_ParVectorInitialize(eVtemp2_l[l+1]); + hypre_ParCSRMatrixEliminateRowsCols(Aee_l[l + 1], + BdryRanksCnts_l[l + 1], + BdryRanks_l[l + 1]); + + xe_l[l + 1] = + hypre_ParVectorCreate(hypre_ParCSRMatrixComm(Aee_l[l + 1]), + hypre_ParCSRMatrixGlobalNumRows(Aee_l[l + 1]), + hypre_ParCSRMatrixRowStarts(Aee_l[l + 1])); + hypre_ParVectorInitialize(xe_l[l + 1]); + + be_l[l + 1] = + hypre_ParVectorCreate(hypre_ParCSRMatrixComm(Aee_l[l + 1]), + hypre_ParCSRMatrixGlobalNumRows(Aee_l[l + 1]), + hypre_ParCSRMatrixRowStarts(Aee_l[l + 1])); + hypre_ParVectorInitialize(be_l[l + 1]); + + ee_l[l + 1] = + hypre_ParVectorCreate(hypre_ParCSRMatrixComm(Aee_l[l + 1]), + hypre_ParCSRMatrixGlobalNumRows(Aee_l[l + 1]), + hypre_ParCSRMatrixRowStarts(Aee_l[l + 1])); + hypre_ParVectorInitialize(ee_l[l + 1]); + + rese_l[l + 1] = + hypre_ParVectorCreate(hypre_ParCSRMatrixComm(Aee_l[l + 1]), + hypre_ParCSRMatrixGlobalNumRows(Aee_l[l + 1]), + hypre_ParCSRMatrixRowStarts(Aee_l[l + 1])); + hypre_ParVectorInitialize(rese_l[l + 1]); + + eVtemp_l[l + 1] = + hypre_ParVectorCreate(hypre_ParCSRMatrixComm(Aee_l[l + 1]), + hypre_ParCSRMatrixGlobalNumRows(Aee_l[l + 1]), + hypre_ParCSRMatrixRowStarts(Aee_l[l + 1])); + hypre_ParVectorInitialize(eVtemp_l[l + 1]); + + eVtemp2_l[l + 1] = + hypre_ParVectorCreate(hypre_ParCSRMatrixComm(Aee_l[l + 1]), + hypre_ParCSRMatrixGlobalNumRows(Aee_l[l + 1]), + hypre_ParCSRMatrixRowStarts(Aee_l[l + 1])); + hypre_ParVectorInitialize(eVtemp2_l[l + 1]); } /* Can delete all topological grids. Not even referenced in IJMatrices. */ @@ -1286,34 +1289,34 @@ hypre_MaxwellTV_Setup(void *maxwell_vdata, (maxwell_TV_data -> ee_l) = ee_l; (maxwell_TV_data -> rese_l) = rese_l; (maxwell_TV_data -> eVtemp_l) = eVtemp_l; - (maxwell_TV_data -> eVtemp2_l)= eVtemp2_l; + (maxwell_TV_data -> eVtemp2_l) = eVtemp2_l; /*----------------------------------------------------- * Determine relaxation parameters for edge problems. * Needed for quick parallel over/under-relaxation. *-----------------------------------------------------*/ erelax_type = 2; - erelax_weight= hypre_TAlloc(HYPRE_Real, edge_numlevels, HYPRE_MEMORY_HOST); + erelax_weight = hypre_TAlloc(HYPRE_Real, edge_numlevels, HYPRE_MEMORY_HOST); eomega = hypre_TAlloc(HYPRE_Real, edge_numlevels, HYPRE_MEMORY_HOST); eCF_marker_l = hypre_TAlloc(HYPRE_Int *, edge_numlevels, HYPRE_MEMORY_HOST); #if 0 - relax_type= 6; /* SSOR */ - for (l= 0; l< 1; l++) + relax_type = 6; /* SSOR */ + for (l = 0; l < 1; l++) { - erelax_weight[l]= 1.0; - eCF_marker_l[l]= NULL; + erelax_weight[l] = 1.0; + eCF_marker_l[l] = NULL; - e_amg_vdata= (void *) hypre_BoomerAMGCreate(); - e_amgData= e_amg_vdata; + e_amg_vdata = (void *) hypre_BoomerAMGCreate(); + e_amgData = e_amg_vdata; - relax_types= hypre_CTAlloc(HYPRE_Int, 2, HYPRE_MEMORY_HOST); - relax_types[1]= relax_type; + relax_types = hypre_CTAlloc(HYPRE_Int, 2, HYPRE_MEMORY_HOST); + relax_types[1] = relax_type; - amg_CF_marker= hypre_TAlloc(HYPRE_Int *, 1, HYPRE_MEMORY_HOST); + amg_CF_marker = hypre_TAlloc(HYPRE_Int *, 1, HYPRE_MEMORY_HOST); A_array = hypre_TAlloc(hypre_ParCSRMatrix *, 1, HYPRE_MEMORY_HOST); - amg_CF_marker[0]= NULL; + amg_CF_marker[0] = NULL; A_array[0] = Aee_l[l]; (e_amgData -> CF_marker_array) = amg_CF_marker; @@ -1327,23 +1330,23 @@ hypre_MaxwellTV_Setup(void *maxwell_vdata, hypre_TFree((e_amgData -> A_array), HYPRE_MEMORY_HOST); hypre_TFree((e_amgData -> CF_marker_array), HYPRE_MEMORY_HOST); hypre_TFree((e_amgData -> grid_relax_type), HYPRE_MEMORY_HOST); - (e_amgData -> A_array)= NULL; + (e_amgData -> A_array) = NULL; (e_amgData -> Vtemp ) = NULL; - (e_amgData -> CF_marker_array)= NULL; - (e_amgData -> grid_relax_type)= NULL; + (e_amgData -> CF_marker_array) = NULL; + (e_amgData -> grid_relax_type) = NULL; hypre_TFree(e_amg_vdata, HYPRE_MEMORY_HOST); - eomega[l]= 1.0; + eomega[l] = 1.0; } #endif - for (l= 0; l< edge_numlevels; l++) + for (l = 0; l < edge_numlevels; l++) { - erelax_weight[l]= 1.0; - eomega[l]= 1.0; - eCF_marker_l[l]= NULL; + erelax_weight[l] = 1.0; + eomega[l] = 1.0; + eCF_marker_l[l] = NULL; } (maxwell_TV_data -> erelax_type) = erelax_type; - (maxwell_TV_data -> erelax_weight)= erelax_weight; + (maxwell_TV_data -> erelax_weight) = erelax_weight; (maxwell_TV_data -> eomega) = eomega; (maxwell_TV_data -> eCF_marker_l) = eCF_marker_l; @@ -1354,7 +1357,7 @@ hypre_MaxwellTV_Setup(void *maxwell_vdata, if ((maxwell_TV_data -> logging) > 0) { - i= (maxwell_TV_data -> max_iter); + i = (maxwell_TV_data -> max_iter); (maxwell_TV_data -> norms) = hypre_TAlloc(HYPRE_Real, i, HYPRE_MEMORY_HOST); (maxwell_TV_data -> rel_norms) = hypre_TAlloc(HYPRE_Real, i, HYPRE_MEMORY_HOST); } @@ -1372,8 +1375,8 @@ hypre_CoarsenPGrid( hypre_SStructGrid *fgrid, { HYPRE_Int ierr = 0; - hypre_SStructPGrid *pgrid= hypre_SStructGridPGrid(fgrid, part); - hypre_StructGrid *sgrid= hypre_SStructPGridCellSGrid(pgrid); + hypre_SStructPGrid *pgrid = hypre_SStructGridPGrid(fgrid, part); + hypre_StructGrid *sgrid = hypre_SStructPGridCellSGrid(pgrid); hypre_BoxArray *boxes; hypre_Box *box, *contract_box; @@ -1388,7 +1391,7 @@ hypre_CoarsenPGrid( hypre_SStructGrid *fgrid, box = hypre_BoxArrayBox(boxes, i); /* contract box so that divisible by stride */ - contract_box= hypre_BoxContraction(box, sgrid, stride); + contract_box = hypre_BoxContraction(box, sgrid, stride); hypre_ProjectBox(contract_box, index, stride); hypre_StructMapFineToCoarse(hypre_BoxIMin(contract_box), index, stride, @@ -1403,7 +1406,7 @@ hypre_CoarsenPGrid( hypre_SStructGrid *fgrid, if ( hypre_BoxVolume(contract_box) ) { - *nboxes= *nboxes+1; + *nboxes = *nboxes + 1; } hypre_BoxDestroy(contract_box); } @@ -1430,13 +1433,13 @@ hypre_BoxContraction( hypre_Box *box, hypre_BoxManager *boxman = hypre_StructGridBoxMan(sgrid); - hypre_BoxArray *neighbor_boxes= NULL; + hypre_BoxArray *neighbor_boxes = NULL; hypre_Box *nbox; hypre_Box *contracted_box; hypre_Box *shifted_box; hypre_Box intersect_box; - HYPRE_Int ndim= hypre_StructGridNDim(sgrid); + HYPRE_Int ndim = hypre_StructGridNDim(sgrid); hypre_Index remainder, box_width; HYPRE_Int i, j, k, p; @@ -1449,19 +1452,19 @@ hypre_BoxContraction( hypre_Box *box, hypre_BoxInit(&intersect_box, ndim); - contracted_box= hypre_BoxCreate(ndim); + contracted_box = hypre_BoxCreate(ndim); hypre_ClearIndex(remainder); - p= 0; - for (i= 0; i< ndim; i++) + p = 0; + for (i = 0; i < ndim; i++) { - j= hypre_BoxIMax(box)[i] - hypre_BoxIMin(box)[i] + 1; - box_width[i]= j; - k= j%rfactor[i]; + j = hypre_BoxIMax(box)[i] - hypre_BoxIMin(box)[i] + 1; + box_width[i] = j; + k = j % rfactor[i]; if (k) { - remainder[i]= k; + remainder[i] = k; p++; } } @@ -1469,21 +1472,21 @@ hypre_BoxContraction( hypre_Box *box, hypre_CopyBox(box, contracted_box); if (p) { - shifted_box= hypre_BoxCreate(ndim); - for (i= 0; i< ndim; i++) + shifted_box = hypre_BoxCreate(ndim); + for (i = 0; i < ndim; i++) { if (remainder[i]) /* non-divisible in the i'th direction */ { /* shift box in + & - directions to determine which side to contract. */ hypre_CopyBox(box, shifted_box); - hypre_BoxIMax(shifted_box)[i]+= box_width[i]; - hypre_BoxIMin(shifted_box)[i]+= box_width[i]; + hypre_BoxIMax(shifted_box)[i] += box_width[i]; + hypre_BoxIMin(shifted_box)[i] += box_width[i]; - npos= 0; + npos = 0; hypre_ForBoxI(k, neighbor_boxes) { - nbox= hypre_BoxArrayBox(neighbor_boxes, k); + nbox = hypre_BoxArrayBox(neighbor_boxes, k); hypre_IntersectBoxes(shifted_box, nbox, &intersect_box); if (hypre_BoxVolume(&intersect_box)) { @@ -1492,13 +1495,13 @@ hypre_BoxContraction( hypre_Box *box, } hypre_CopyBox(box, shifted_box); - hypre_BoxIMax(shifted_box)[i]-= box_width[i]; - hypre_BoxIMin(shifted_box)[i]-= box_width[i]; + hypre_BoxIMax(shifted_box)[i] -= box_width[i]; + hypre_BoxIMin(shifted_box)[i] -= box_width[i]; - nneg= 0; + nneg = 0; hypre_ForBoxI(k, neighbor_boxes) { - nbox= hypre_BoxArrayBox(neighbor_boxes, k); + nbox = hypre_BoxArrayBox(neighbor_boxes, k); hypre_IntersectBoxes(shifted_box, nbox, &intersect_box); if (hypre_BoxVolume(&intersect_box)) { @@ -1509,14 +1512,14 @@ hypre_BoxContraction( hypre_Box *box, if ( (npos) || ( (!npos) && (!nneg) ) ) { /* contract - direction */ - hypre_BoxIMin(contracted_box)[i]+= remainder[i]; + hypre_BoxIMin(contracted_box)[i] += remainder[i]; } else { if (nneg) { /* contract + direction */ - hypre_BoxIMax(contracted_box)[i]-= remainder[i]; + hypre_BoxIMax(contracted_box)[i] -= remainder[i]; } } diff --git a/external/hypre/src/sstruct_ls/maxwell_grad.c b/external/hypre/src/sstruct_ls/maxwell_grad.c index 3eb66d1b..da651a65 100644 --- a/external/hypre/src/sstruct_ls/maxwell_grad.c +++ b/external/hypre/src/sstruct_ls/maxwell_grad.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -46,13 +46,13 @@ * *--------------------------------------------------------------------------*/ hypre_ParCSRMatrix * -hypre_Maxwell_Grad(hypre_SStructGrid *grid) +hypre_Maxwell_Grad(hypre_SStructGrid *grid) { MPI_Comm comm = (grid -> comm); HYPRE_IJMatrix T_grad; hypre_ParCSRMatrix *parcsr_grad; - HYPRE_Int matrix_type= HYPRE_PARCSR; + HYPRE_Int matrix_type = HYPRE_PARCSR; hypre_SStructGrid *node_grid, *edge_grid; @@ -76,7 +76,7 @@ hypre_Maxwell_Grad(hypre_SStructGrid *grid) hypre_Index shift, shift2; hypre_Index *offsets, *varoffsets; - HYPRE_Int nparts= hypre_SStructGridNParts(grid); + HYPRE_Int nparts = hypre_SStructGridNParts(grid); HYPRE_Int ndim = hypre_SStructGridNDim(grid); HYPRE_SStructVariable vartype_node, *vartype_edges; @@ -92,9 +92,9 @@ hypre_Maxwell_Grad(hypre_SStructGrid *grid) HYPRE_BigInt jlower, jupper; HYPRE_BigInt start_rank1, start_rank2, rank; - HYPRE_Int myproc; - HYPRE_Int ierr=0; + + HYPRE_MemoryLocation memory_location; hypre_BoxInit(&layer, ndim); hypre_BoxInit(&interior_box, ndim); @@ -102,10 +102,8 @@ hypre_Maxwell_Grad(hypre_SStructGrid *grid) hypre_MPI_Comm_rank(comm, &myproc); hypre_ClearIndex(shift); - for (i= 0; i< ndim; i++) - { - hypre_IndexD(shift, i)= -1; - } + hypre_SetIndex(shift, -1); + hypre_SetIndex(lindex, 0); /* To get the correct ranks, separate node & edge grids must be formed. Note that the edge vars must be ordered the same way as is in grid.*/ @@ -113,50 +111,50 @@ hypre_Maxwell_Grad(hypre_SStructGrid *grid) HYPRE_SStructGridCreate(comm, ndim, nparts, &edge_grid); vartype_node = HYPRE_SSTRUCT_VARIABLE_NODE; - vartype_edges= hypre_TAlloc(HYPRE_SStructVariable, ndim, HYPRE_MEMORY_HOST); + vartype_edges = hypre_TAlloc(HYPRE_SStructVariable, ndim, HYPRE_MEMORY_HOST); /* Assuming the same edge variable types on all parts */ pgrid = hypre_SStructGridPGrid(grid, 0); - vartypes= hypre_SStructPGridVarTypes(pgrid); + vartypes = hypre_SStructPGridVarTypes(pgrid); nvars = hypre_SStructPGridNVars(pgrid); - k= 0; - for (i= 0; i< nvars; i++) + k = 0; + for (i = 0; i < nvars; i++) { - j= vartypes[i]; - switch(j) + j = vartypes[i]; + switch (j) { case 2: { - vartype_edges[k]= HYPRE_SSTRUCT_VARIABLE_XFACE; + vartype_edges[k] = HYPRE_SSTRUCT_VARIABLE_XFACE; k++; break; } case 3: { - vartype_edges[k]= HYPRE_SSTRUCT_VARIABLE_YFACE; + vartype_edges[k] = HYPRE_SSTRUCT_VARIABLE_YFACE; k++; break; } case 5: { - vartype_edges[k]= HYPRE_SSTRUCT_VARIABLE_XEDGE; + vartype_edges[k] = HYPRE_SSTRUCT_VARIABLE_XEDGE; k++; break; } case 6: { - vartype_edges[k]= HYPRE_SSTRUCT_VARIABLE_YEDGE; + vartype_edges[k] = HYPRE_SSTRUCT_VARIABLE_YEDGE; k++; break; } case 7: { - vartype_edges[k]= HYPRE_SSTRUCT_VARIABLE_ZEDGE; + vartype_edges[k] = HYPRE_SSTRUCT_VARIABLE_ZEDGE; k++; break; } @@ -164,15 +162,15 @@ hypre_Maxwell_Grad(hypre_SStructGrid *grid) } /* switch(j) */ } /* for (i= 0; i< nvars; i++) */ - for (part= 0; part< nparts; part++) + for (part = 0; part < nparts; part++) { - pgrid= hypre_SStructGridPGrid(grid, part); - var_grid= hypre_SStructPGridCellSGrid(pgrid) ; + pgrid = hypre_SStructGridPGrid(grid, part); + var_grid = hypre_SStructPGridCellSGrid(pgrid) ; - boxes= hypre_StructGridBoxes(var_grid); + boxes = hypre_StructGridBoxes(var_grid); hypre_ForBoxI(j, boxes) { - box= hypre_BoxArrayBox(boxes, j); + box = hypre_BoxArrayBox(boxes, j); HYPRE_SStructGridSetExtents(node_grid, part, hypre_BoxIMin(box), hypre_BoxIMax(box)); HYPRE_SStructGridSetExtents(edge_grid, part, @@ -191,45 +189,45 @@ hypre_Maxwell_Grad(hypre_SStructGrid *grid) /* Grad: node(col) -> edge(row). Same for 2-d and 3-d */ /* lower rank */ - part= 0; + part = 0; i = 0; hypre_SStructGridBoxProcFindBoxManEntry(edge_grid, part, 0, i, myproc, &entry); pgrid = hypre_SStructGridPGrid(edge_grid, part); - var_grid= hypre_SStructPGridSGrid(pgrid, 0); + var_grid = hypre_SStructPGridSGrid(pgrid, 0); boxes = hypre_StructGridBoxes(var_grid); box = hypre_BoxArrayBox(boxes, 0); hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMin(box), &ilower); hypre_SStructGridBoxProcFindBoxManEntry(node_grid, part, 0, i, myproc, &entry); pgrid = hypre_SStructGridPGrid(node_grid, part); - var_grid= hypre_SStructPGridSGrid(pgrid, 0); + var_grid = hypre_SStructPGridSGrid(pgrid, 0); boxes = hypre_StructGridBoxes(var_grid); box = hypre_BoxArrayBox(boxes, 0); hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMin(box), &jlower); /* upper rank */ - part= nparts-1; + part = nparts - 1; pgrid = hypre_SStructGridPGrid(edge_grid, part); nvars = hypre_SStructPGridNVars(pgrid); - var_grid= hypre_SStructPGridSGrid(pgrid, nvars-1); + var_grid = hypre_SStructPGridSGrid(pgrid, nvars - 1); boxes = hypre_StructGridBoxes(var_grid); - box = hypre_BoxArrayBox(boxes, hypre_BoxArraySize(boxes)-1); + box = hypre_BoxArrayBox(boxes, hypre_BoxArraySize(boxes) - 1); - hypre_SStructGridBoxProcFindBoxManEntry(edge_grid, part, nvars-1, - hypre_BoxArraySize(boxes)-1, myproc, + hypre_SStructGridBoxProcFindBoxManEntry(edge_grid, part, nvars - 1, + hypre_BoxArraySize(boxes) - 1, myproc, &entry); hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMax(box), &iupper); pgrid = hypre_SStructGridPGrid(node_grid, part); nvars = hypre_SStructPGridNVars(pgrid); - var_grid= hypre_SStructPGridSGrid(pgrid, nvars-1); + var_grid = hypre_SStructPGridSGrid(pgrid, nvars - 1); boxes = hypre_StructGridBoxes(var_grid); - box = hypre_BoxArrayBox(boxes, hypre_BoxArraySize(boxes)-1); + box = hypre_BoxArrayBox(boxes, hypre_BoxArraySize(boxes) - 1); - hypre_SStructGridBoxProcFindBoxManEntry(node_grid, part, nvars-1, - hypre_BoxArraySize(boxes)-1, myproc, + hypre_SStructGridBoxProcFindBoxManEntry(node_grid, part, nvars - 1, + hypre_BoxArraySize(boxes) - 1, myproc, &entry); hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMax(box), &jupper); @@ -237,43 +235,45 @@ hypre_Maxwell_Grad(hypre_SStructGrid *grid) HYPRE_IJMatrixSetObjectType(T_grad, HYPRE_PARCSR); HYPRE_IJMatrixInitialize(T_grad); + memory_location = hypre_IJMatrixMemoryLocation(T_grad); + /*------------------------------------------------------------------------------ * fill up the parcsr matrix. *------------------------------------------------------------------------------*/ /* count the no. of rows. Make sure repeated nodes along the boundaries are counted.*/ nrows = 0; - nnodes= 0; - for (part= 0; part< nparts; part++) + nnodes = 0; + for (part = 0; part < nparts; part++) { - pgrid= hypre_SStructGridPGrid(edge_grid, part); - nvars= hypre_SStructPGridNVars(pgrid); - for (m= 0; m< nvars; m++) + pgrid = hypre_SStructGridPGrid(edge_grid, part); + nvars = hypre_SStructPGridNVars(pgrid); + for (m = 0; m < nvars; m++) { - var_grid= hypre_SStructPGridSGrid(pgrid, m); + var_grid = hypre_SStructPGridSGrid(pgrid, m); boxes = hypre_StructGridBoxes(var_grid); hypre_ForBoxI(j, boxes) { - box= hypre_BoxArrayBox(boxes, j); + box = hypre_BoxArrayBox(boxes, j); /* make slightly bigger to handle any shared nodes */ hypre_CopyBox(box, &layer); hypre_AddIndexes(hypre_BoxIMin(&layer), shift, 3, hypre_BoxIMin(&layer)); hypre_SubtractIndexes(hypre_BoxIMax(&layer), shift, 3, hypre_BoxIMax(&layer)); - nrows+= hypre_BoxVolume(&layer); + nrows += hypre_BoxVolume(&layer); } } - pgrid= hypre_SStructGridPGrid(node_grid, part); - var_grid= hypre_SStructPGridSGrid(pgrid, 0); /* only one variable grid */ + pgrid = hypre_SStructGridPGrid(node_grid, part); + var_grid = hypre_SStructPGridSGrid(pgrid, 0); /* only one variable grid */ boxes = hypre_StructGridBoxes(var_grid); hypre_ForBoxI(j, boxes) { - box= hypre_BoxArrayBox(boxes, j); + box = hypre_BoxArrayBox(boxes, j); /* make slightly bigger to handle any shared nodes */ hypre_CopyBox(box, &layer); hypre_AddIndexes(hypre_BoxIMin(&layer), shift, 3, hypre_BoxIMin(&layer)); hypre_SubtractIndexes(hypre_BoxIMax(&layer), shift, 3, hypre_BoxIMax(&layer)); - nnodes+= hypre_BoxVolume(&layer); + nnodes += hypre_BoxVolume(&layer); } } @@ -282,41 +282,41 @@ hypre_Maxwell_Grad(hypre_SStructGrid *grid) /* Set eflag to have the number of nodes connected to an edge (2) and nflag to have the number of edges connect to a node. */ - for (i= 0; i< nrows; i++) + for (i = 0; i < nrows; i++) { - eflag[i]= 2; + eflag[i] = 2; } - j= 2*ndim; - for (i= 0; i< nnodes; i++) + j = 2 * ndim; + for (i = 0; i < nnodes; i++) { - nflag[i]= j; + nflag[i] = j; } /* Determine physical boundary points. Get the rank and set flag[rank]= 0. This will boundary dof, i.e., flag[rank]= 0 will flag a boundary dof. */ - start_rank1= hypre_SStructGridStartRank(node_grid); - start_rank2= hypre_SStructGridStartRank(edge_grid); - for (part= 0; part< nparts; part++) + start_rank1 = hypre_SStructGridStartRank(node_grid); + start_rank2 = hypre_SStructGridStartRank(edge_grid); + for (part = 0; part < nparts; part++) { /* node flag */ pgrid = hypre_SStructGridPGrid(node_grid, part); - var_grid= hypre_SStructPGridSGrid(pgrid, 0); + var_grid = hypre_SStructPGridSGrid(pgrid, 0); boxes = hypre_StructGridBoxes(var_grid); boxman = hypre_SStructGridBoxManager(node_grid, part, 0); hypre_ForBoxI(j, boxes) { - box= hypre_BoxArrayBox(boxes, j); + box = hypre_BoxArrayBox(boxes, j); hypre_BoxManGetEntry(boxman, myproc, j, &entry); - i= hypre_BoxVolume(box); + i = hypre_BoxVolume(box); - tmp_box_array1= hypre_BoxArrayCreate(0, ndim); - ierr += hypre_BoxBoundaryG(box, var_grid, tmp_box_array1); + tmp_box_array1 = hypre_BoxArrayCreate(0, ndim); + hypre_BoxBoundaryG(box, var_grid, tmp_box_array1); - for (m= 0; m< hypre_BoxArraySize(tmp_box_array1); m++) + for (m = 0; m < hypre_BoxArraySize(tmp_box_array1); m++) { - box_piece= hypre_BoxArrayBox(tmp_box_array1, m); + box_piece = hypre_BoxArrayBox(tmp_box_array1, m); if (hypre_BoxVolume(box_piece) < i) { hypre_BoxGetSize(box_piece, loop_size); @@ -330,7 +330,7 @@ hypre_Maxwell_Grad(hypre_SStructGrid *grid) hypre_SStructBoxManEntryGetGlobalRank(entry, index, &rank, matrix_type); - nflag[rank-start_rank1]= 0; + nflag[rank - start_rank1] = 0; } hypre_SerialBoxLoop0End(); } /* if (hypre_BoxVolume(box_piece) < i) */ @@ -353,71 +353,76 @@ hypre_Maxwell_Grad(hypre_SStructGrid *grid) *-----------------------------------------------------------------*/ pgrid = hypre_SStructGridPGrid(edge_grid, part); nvars = hypre_SStructPGridNVars(pgrid); - direction= hypre_TAlloc(HYPRE_Int, 2, HYPRE_MEMORY_HOST); /* only two directions at most */ - for (m= 0; m< nvars; m++) + direction = hypre_TAlloc(HYPRE_Int, 2, HYPRE_MEMORY_HOST); /* only two directions at most */ + for (m = 0; m < nvars; m++) { - var_grid= hypre_SStructPGridSGrid(pgrid, m); + var_grid = hypre_SStructPGridSGrid(pgrid, m); boxes = hypre_StructGridBoxes(var_grid); boxman = hypre_SStructGridBoxManager(edge_grid, part, m); - j= vartype_edges[m]; - switch(j) + j = vartype_edges[m]; + switch (j) { case 2: /* x faces, 2d */ { ndirection = 1; - direction[0]= 0; + direction[0] = 0; break; } case 3: /* y faces, 2d */ { ndirection = 1; - direction[0]= 1; + direction[0] = 1; break; } case 5: /* x edges, 3d */ { ndirection = 2; - direction[0]= 1; - direction[1]= 2; + direction[0] = 1; + direction[1] = 2; break; } case 6: /* y edges, 3d */ { ndirection = 2; - direction[0]= 0; - direction[1]= 2; + direction[0] = 0; + direction[1] = 2; break; } case 7: /* z edges, 3d */ { ndirection = 2; - direction[0]= 0; - direction[1]= 1; + direction[0] = 0; + direction[1] = 1; break; } + + default: + { + ndirection = 0; + } } /* switch(j) */ hypre_ForBoxI(j, boxes) { - box= hypre_BoxArrayBox(boxes, j); + box = hypre_BoxArrayBox(boxes, j); hypre_BoxManGetEntry(boxman, myproc, j, &entry); - i= hypre_BoxVolume(box); + i = hypre_BoxVolume(box); - for (d= 0; d< ndirection; d++) + for (d = 0; d < ndirection; d++) { - tmp_box_array1= hypre_BoxArrayCreate(0, ndim); - tmp_box_array2= hypre_BoxArrayCreate(0, ndim); - ierr+= hypre_BoxBoundaryDG(box, var_grid, tmp_box_array1, - tmp_box_array2, direction[d]); + tmp_box_array1 = hypre_BoxArrayCreate(0, ndim); + tmp_box_array2 = hypre_BoxArrayCreate(0, ndim); + hypre_BoxBoundaryDG(box, var_grid, tmp_box_array1, + tmp_box_array2, direction[d]); - for (k= 0; k< hypre_BoxArraySize(tmp_box_array1); k++) + for (k = 0; k < hypre_BoxArraySize(tmp_box_array1); k++) { - box_piece= hypre_BoxArrayBox(tmp_box_array1, k); + box_piece = hypre_BoxArrayBox(tmp_box_array1, k); if (hypre_BoxVolume(box_piece) < i) { hypre_BoxGetSize(box_piece, loop_size); @@ -431,7 +436,7 @@ hypre_Maxwell_Grad(hypre_SStructGrid *grid) hypre_SStructBoxManEntryGetGlobalRank(entry, index, &rank, matrix_type); - eflag[rank-start_rank2]= 0; + eflag[rank - start_rank2] = 0; } hypre_SerialBoxLoop0End(); } /* if (hypre_BoxVolume(box_piece) < i) */ @@ -439,9 +444,9 @@ hypre_Maxwell_Grad(hypre_SStructGrid *grid) hypre_BoxArrayDestroy(tmp_box_array1); - for (k= 0; k< hypre_BoxArraySize(tmp_box_array2); k++) + for (k = 0; k < hypre_BoxArraySize(tmp_box_array2); k++) { - box_piece= hypre_BoxArrayBox(tmp_box_array2, k); + box_piece = hypre_BoxArrayBox(tmp_box_array2, k); if (hypre_BoxVolume(box_piece) < i) { hypre_BoxGetSize(box_piece, loop_size); @@ -455,7 +460,7 @@ hypre_Maxwell_Grad(hypre_SStructGrid *grid) hypre_SStructBoxManEntryGetGlobalRank(entry, index, &rank, matrix_type); - eflag[rank-start_rank2]= 0; + eflag[rank - start_rank2] = 0; } hypre_SerialBoxLoop0End(); } /* if (hypre_BoxVolume(box_piece) < i) */ @@ -471,28 +476,28 @@ hypre_Maxwell_Grad(hypre_SStructGrid *grid) /* set vals. Will have more memory than is needed- extra allotted for repeated nodes. */ - inode= hypre_CTAlloc(HYPRE_BigInt, nrows, HYPRE_MEMORY_DEVICE); - ncols= hypre_CTAlloc(HYPRE_Int, nrows, HYPRE_MEMORY_DEVICE); + inode = hypre_CTAlloc(HYPRE_BigInt, nrows, memory_location); + ncols = hypre_CTAlloc(HYPRE_Int, nrows, memory_location); /* each row can have at most two columns */ - k= 2*nrows; - jedge= hypre_CTAlloc(HYPRE_BigInt, k, HYPRE_MEMORY_DEVICE); - vals = hypre_TAlloc(HYPRE_Real, k, HYPRE_MEMORY_DEVICE); - for (i= 0; i< k; i++) + k = 2 * nrows; + jedge = hypre_CTAlloc(HYPRE_BigInt, k, memory_location); + vals = hypre_TAlloc(HYPRE_Real, k, memory_location); + for (i = 0; i < k; i++) { - vals[i]=-1.0; + vals[i] = -1.0; } /* to get the correct col connection to each node, we need to offset index ijk. Determine these. Assuming the same var ordering for each part. Note that these are not the variable offsets. */ offsets = hypre_TAlloc(hypre_Index, ndim, HYPRE_MEMORY_HOST); - varoffsets= hypre_TAlloc(hypre_Index, ndim, HYPRE_MEMORY_HOST); - for (i= 0; i< ndim; i++) + varoffsets = hypre_TAlloc(hypre_Index, ndim, HYPRE_MEMORY_HOST); + for (i = 0; i < ndim; i++) { - j= vartype_edges[i]; + j = vartype_edges[i]; hypre_SStructVariableGetOffset(vartype_edges[i], ndim, varoffsets[i]); - switch(j) + switch (j) { case 2: { @@ -526,8 +531,8 @@ hypre_Maxwell_Grad(hypre_SStructGrid *grid) } /* switch(j) */ } /* for (i= 0; i< ndim; i++) */ - nrows= 0; i= 0; - for (part= 0; part< nparts; part++) + nrows = 0; i = 0; + for (part = 0; part < nparts; part++) { /* grab boxarray for node rank extracting later */ pgrid = hypre_SStructGridPGrid(node_grid, part); @@ -540,19 +545,19 @@ hypre_Maxwell_Grad(hypre_SStructGrid *grid) interior edge box. For parallel distribution of the edge grid, simple contraction of the edge box does not get the correct interior edge box. Need to contract the cell box. */ - var_grid= hypre_SStructPGridCellSGrid(pgrid); - cell_boxes= hypre_StructGridBoxes(var_grid); + var_grid = hypre_SStructPGridCellSGrid(pgrid); + cell_boxes = hypre_StructGridBoxes(var_grid); nvars = hypre_SStructPGridNVars(pgrid); - for (n= 0; n< nvars; n++) + for (n = 0; n < nvars; n++) { var_grid = hypre_SStructPGridSGrid(pgrid, n); - edge_boxes= hypre_StructGridBoxes(var_grid); + edge_boxes = hypre_StructGridBoxes(var_grid); hypre_ForBoxI(j, edge_boxes) { - box= hypre_BoxArrayBox(edge_boxes, j); - cell_box= hypre_BoxArrayBox(cell_boxes, j); + box = hypre_BoxArrayBox(edge_boxes, j); + cell_box = hypre_BoxArrayBox(cell_boxes, j); hypre_CopyBox(cell_box, &interior_box); @@ -586,12 +591,12 @@ hypre_Maxwell_Grad(hypre_SStructGrid *grid) hypre_SStructGridFindBoxManEntry(edge_grid, part, index, n, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, index, &m, matrix_type); - inode[nrows]= m; + inode[nrows] = m; hypre_SStructGridFindBoxManEntry(node_grid, part, index, 0, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, index, &m, matrix_type); - jedge[i]= m; + jedge[i] = m; vals[i] = 1.0; /* change only this connection */ i++; @@ -599,10 +604,10 @@ hypre_Maxwell_Grad(hypre_SStructGrid *grid) hypre_SStructGridFindBoxManEntry(node_grid, part, index, 0, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, index, &m, matrix_type); - jedge[i]= m; + jedge[i] = m; i++; - ncols[nrows]= 2; + ncols[nrows] = 2; nrows++; } hypre_SerialBoxLoop0End(); @@ -610,16 +615,16 @@ hypre_Maxwell_Grad(hypre_SStructGrid *grid) /* now the boundary layers. To cases to consider: is the edge totally on the boundary or is the edge connected to the boundary. Need to check eflag & nflag. */ - for (d= 0; d< ndim; d++) + for (d = 0; d < ndim; d++) { /*shift the layer box in the correct direction and distance. distance= hypre_BoxIMax(box)[d]-hypre_BoxIMin(box)[d]+1-1 = hypre_BoxIMax(box)[d]-hypre_BoxIMin(box)[d] */ hypre_ClearIndex(shift2); - shift2[d]= hypre_BoxIMax(box)[d]-hypre_BoxIMin(box)[d]; + shift2[d] = hypre_BoxIMax(box)[d] - hypre_BoxIMin(box)[d]; /* ndirection= 0 negative; ndirection= 1 positive */ - for (ndirection= 0; ndirection< 2; ndirection++) + for (ndirection = 0; ndirection < 2; ndirection++) { hypre_CopyBox(box, &layer); @@ -650,9 +655,9 @@ hypre_Maxwell_Grad(hypre_SStructGrid *grid) /* check if the edge lies on the boundary & if not check if the connecting node is on the boundary. */ - if (eflag[m-start_rank2]) + if (eflag[m - start_rank2]) { - inode[nrows]= m; + inode[nrows] = m; /* edge not completely on the boundary. One connecting node must be in the interior. */ hypre_SStructGridFindBoxManEntry(node_grid, part, index, 0, @@ -665,9 +670,9 @@ hypre_Maxwell_Grad(hypre_SStructGrid *grid) if (m >= start_rank1 && m <= jupper) { /* node on proc. Now check if on the boundary. */ - if (nflag[m-start_rank1]) /* interior node */ + if (nflag[m - start_rank1]) /* interior node */ { - jedge[i]= m; + jedge[i] = m; vals[i] = 1.0; i++; @@ -676,7 +681,7 @@ hypre_Maxwell_Grad(hypre_SStructGrid *grid) } else /* node off-proc */ { - jedge[i]= m; + jedge[i] = m; vals[i] = 1.0; i++; @@ -693,16 +698,16 @@ hypre_Maxwell_Grad(hypre_SStructGrid *grid) if (m >= start_rank1 && m <= jupper) { /* node on proc. Now check if on the boundary. */ - if (nflag[m-start_rank1]) /* interior node */ + if (nflag[m - start_rank1]) /* interior node */ { - jedge[i]= m; + jedge[i] = m; i++; ncols[nrows]++; } } else /* node off-proc */ { - jedge[i]= m; + jedge[i] = m; i++; ncols[nrows]++; } @@ -732,12 +737,12 @@ hypre_Maxwell_Grad(hypre_SStructGrid *grid) hypre_TFree(eflag, HYPRE_MEMORY_HOST); hypre_TFree(nflag, HYPRE_MEMORY_HOST); - hypre_TFree(ncols, HYPRE_MEMORY_DEVICE); - hypre_TFree(inode, HYPRE_MEMORY_DEVICE); - hypre_TFree(jedge, HYPRE_MEMORY_DEVICE); - hypre_TFree(vals, HYPRE_MEMORY_DEVICE); + hypre_TFree(ncols, memory_location); + hypre_TFree(inode, memory_location); + hypre_TFree(jedge, memory_location); + hypre_TFree(vals, memory_location); - parcsr_grad= (hypre_ParCSRMatrix *) hypre_IJMatrixObject(T_grad); + parcsr_grad = (hypre_ParCSRMatrix *) hypre_IJMatrixObject(T_grad); HYPRE_IJMatrixSetObjectType(T_grad, -1); HYPRE_IJMatrixDestroy(T_grad); diff --git a/external/hypre/src/sstruct_ls/maxwell_physbdy.c b/external/hypre/src/sstruct_ls/maxwell_physbdy.c index ff7abd13..3b6a0f40 100644 --- a/external/hypre/src/sstruct_ls/maxwell_physbdy.c +++ b/external/hypre/src/sstruct_ls/maxwell_physbdy.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -44,7 +44,7 @@ hypre_Maxwell_PhysBdy( hypre_SStructGrid **grid_l, HYPRE_Int **BdryRanksCntsl_ptr ) { - MPI_Comm comm= (grid_l[0]-> comm); + MPI_Comm comm = (grid_l[0]-> comm); HYPRE_Int **BdryRanks_l; HYPRE_Int *BdryRanksCnts_l; @@ -68,7 +68,7 @@ hypre_Maxwell_PhysBdy( hypre_SStructGrid **grid_l, hypre_Box *box, *contract_fbox, rbox; hypre_Box intersect; - HYPRE_Int **cbox_mapping, **fbox_mapping; + HYPRE_Int **cbox_mapping = NULL, **fbox_mapping = NULL; HYPRE_Int **boxes_with_bdry; HYPRE_Int ndim, nvars; @@ -82,44 +82,45 @@ hypre_Maxwell_PhysBdy( hypre_SStructGrid **grid_l, HYPRE_Int d; HYPRE_Int cnt; - HYPRE_Int part= 0; /* NOTE, ASSUMING ONE PART */ - HYPRE_Int matrix_type= HYPRE_PARCSR; + HYPRE_Int part = 0; /* NOTE, ASSUMING ONE PART */ + HYPRE_Int matrix_type = HYPRE_PARCSR; HYPRE_Int myproc; - HYPRE_Int ierr= 0; + HYPRE_Int ierr = 0; hypre_MPI_Comm_rank(comm, &myproc); - ndim= hypre_SStructGridNDim(grid_l[0]); - hypre_SetIndex3(zero_shift, 0, 0, 0); + ndim = hypre_SStructGridNDim(grid_l[0]); + hypre_SetIndex(zero_shift, 0); + hypre_SetIndex(lindex, 0); hypre_BoxInit(&intersect, ndim); /* bounding global ranks of this processor & allocate boundary box markers. */ - upper_rank= hypre_CTAlloc(HYPRE_BigInt, num_levels, HYPRE_MEMORY_HOST); - lower_rank= hypre_CTAlloc(HYPRE_BigInt, num_levels, HYPRE_MEMORY_HOST); + upper_rank = hypre_CTAlloc(HYPRE_BigInt, num_levels, HYPRE_MEMORY_HOST); + lower_rank = hypre_CTAlloc(HYPRE_BigInt, num_levels, HYPRE_MEMORY_HOST); - boxes_with_bdry= hypre_TAlloc(HYPRE_Int *, num_levels, HYPRE_MEMORY_HOST); - for (i= 0; i< num_levels; i++) + boxes_with_bdry = hypre_TAlloc(HYPRE_Int *, num_levels, HYPRE_MEMORY_HOST); + for (i = 0; i < num_levels; i++) { grid = grid_l[i]; - lower_rank[i]= hypre_SStructGridStartRank(grid); + lower_rank[i] = hypre_SStructGridStartRank(grid); /* note we are assuming only one part */ - pgrid= hypre_SStructGridPGrid(grid, part); - nvars= hypre_SStructPGridNVars(pgrid); - sgrid= hypre_SStructPGridSGrid(pgrid, nvars-1); - box_array= hypre_StructGridBoxes(sgrid); - box = hypre_BoxArrayBox(box_array, hypre_BoxArraySize(box_array)-1); - - hypre_SStructGridBoxProcFindBoxManEntry(grid, part, nvars-1, - hypre_BoxArraySize(box_array)-1, myproc, &boxman_entry); + pgrid = hypre_SStructGridPGrid(grid, part); + nvars = hypre_SStructPGridNVars(pgrid); + sgrid = hypre_SStructPGridSGrid(pgrid, nvars - 1); + box_array = hypre_StructGridBoxes(sgrid); + box = hypre_BoxArrayBox(box_array, hypre_BoxArraySize(box_array) - 1); + + hypre_SStructGridBoxProcFindBoxManEntry(grid, part, nvars - 1, + hypre_BoxArraySize(box_array) - 1, myproc, &boxman_entry); hypre_SStructBoxManEntryGetGlobalCSRank(boxman_entry, hypre_BoxIMax(box), &upper_rank[i]); - sgrid= hypre_SStructPGridCellSGrid(pgrid); - box_array= hypre_StructGridBoxes(sgrid); - boxes_with_bdry[i]= hypre_CTAlloc(HYPRE_Int, hypre_BoxArraySize(box_array), HYPRE_MEMORY_HOST); + sgrid = hypre_SStructPGridCellSGrid(pgrid); + box_array = hypre_StructGridBoxes(sgrid); + boxes_with_bdry[i] = hypre_CTAlloc(HYPRE_Int, hypre_BoxArraySize(box_array), HYPRE_MEMORY_HOST); } /*----------------------------------------------------------------------------- @@ -134,32 +135,32 @@ hypre_Maxwell_PhysBdy( hypre_SStructGrid **grid_l, *-----------------------------------------------------------------------------*/ if (num_levels > 1) { - cbox_mapping= hypre_CTAlloc(HYPRE_Int *, num_levels, HYPRE_MEMORY_HOST); - fbox_mapping= hypre_CTAlloc(HYPRE_Int *, num_levels, HYPRE_MEMORY_HOST); + cbox_mapping = hypre_CTAlloc(HYPRE_Int *, num_levels, HYPRE_MEMORY_HOST); + fbox_mapping = hypre_CTAlloc(HYPRE_Int *, num_levels, HYPRE_MEMORY_HOST); } - for (i= 0; i< (num_levels-1); i++) + for (i = 0; i < (num_levels - 1); i++) { grid = grid_l[i]; - pgrid= hypre_SStructGridPGrid(grid, 0); /* assuming one part */ - cell_fgrid= hypre_SStructPGridCellSGrid(pgrid); - fboxes= hypre_StructGridBoxes(cell_fgrid); - nfboxes= hypre_BoxArraySize(hypre_StructGridBoxes(cell_fgrid)); - fbox_mapping[i]= hypre_CTAlloc(HYPRE_Int, nfboxes, HYPRE_MEMORY_HOST); + pgrid = hypre_SStructGridPGrid(grid, 0); /* assuming one part */ + cell_fgrid = hypre_SStructPGridCellSGrid(pgrid); + fboxes = hypre_StructGridBoxes(cell_fgrid); + nfboxes = hypre_BoxArraySize(hypre_StructGridBoxes(cell_fgrid)); + fbox_mapping[i] = hypre_CTAlloc(HYPRE_Int, nfboxes, HYPRE_MEMORY_HOST); - grid = grid_l[i+1]; - pgrid= hypre_SStructGridPGrid(grid, 0); /* assuming one part */ - cell_cgrid= hypre_SStructPGridCellSGrid(pgrid); - cboxes= hypre_StructGridBoxes(cell_cgrid); - nboxes= hypre_BoxArraySize(hypre_StructGridBoxes(cell_cgrid)); + grid = grid_l[i + 1]; + pgrid = hypre_SStructGridPGrid(grid, 0); /* assuming one part */ + cell_cgrid = hypre_SStructPGridCellSGrid(pgrid); + cboxes = hypre_StructGridBoxes(cell_cgrid); + nboxes = hypre_BoxArraySize(hypre_StructGridBoxes(cell_cgrid)); - cbox_mapping[i+1]= hypre_CTAlloc(HYPRE_Int, nboxes, HYPRE_MEMORY_HOST); + cbox_mapping[i + 1] = hypre_CTAlloc(HYPRE_Int, nboxes, HYPRE_MEMORY_HOST); /* assuming if i1 > i2 and (box j1) is coarsened from (box i1) and (box j2) from (box i2), then j1 > j2. */ - k= 0; + k = 0; hypre_ForBoxI(j, fboxes) { - fbox= hypre_BoxArrayBox(fboxes, j); + fbox = hypre_BoxArrayBox(fboxes, j); hypre_CopyBox(fbox, &rbox); hypre_ProjectBox(&rbox, zero_shift, rfactors); hypre_StructMapFineToCoarse(hypre_BoxIMin(&rbox), zero_shift, @@ -171,114 +172,114 @@ hypre_Maxwell_PhysBdy( hypre_SStructGrid **grid_l, ordering, we only have to check if the first cbox in the list intersects with rbox. If not, this fbox vanished in the coarsening. */ - cbox= hypre_BoxArrayBox(cboxes, k); + cbox = hypre_BoxArrayBox(cboxes, k); hypre_IntersectBoxes(&rbox, cbox, &rbox); if (hypre_BoxVolume(&rbox)) { - cbox_mapping[i+1][k]= j; - fbox_mapping[i][j]= k; + cbox_mapping[i + 1][k] = j; + fbox_mapping[i][j] = k; k++; } /* if (hypre_BoxVolume(&rbox)) */ } /* hypre_ForBoxI(j, fboxes) */ } /* for (i= 0; i< (num_levels-1); i++) */ - bdry= hypre_TAlloc(hypre_BoxArrayArray ***, num_levels, HYPRE_MEMORY_HOST); - npts= hypre_CTAlloc(HYPRE_Int, num_levels, HYPRE_MEMORY_HOST); + bdry = hypre_TAlloc(hypre_BoxArrayArray ***, num_levels, HYPRE_MEMORY_HOST); + npts = hypre_CTAlloc(HYPRE_Int, num_levels, HYPRE_MEMORY_HOST); /* finest level boundary determination */ grid = grid_l[0]; - pgrid= hypre_SStructGridPGrid(grid, 0); /* assuming one part */ - nvars= hypre_SStructPGridNVars(pgrid); - cell_fgrid= hypre_SStructPGridCellSGrid(pgrid); - nboxes= hypre_BoxArraySize(hypre_StructGridBoxes(cell_fgrid)); + pgrid = hypre_SStructGridPGrid(grid, 0); /* assuming one part */ + nvars = hypre_SStructPGridNVars(pgrid); + cell_fgrid = hypre_SStructPGridCellSGrid(pgrid); + nboxes = hypre_BoxArraySize(hypre_StructGridBoxes(cell_fgrid)); hypre_Maxwell_PNedelec_Bdy(cell_fgrid, pgrid, &bdry[0]); - for (i= 0; i< nboxes; i++) + for (i = 0; i < nboxes; i++) { if (bdry[0][i]) /* boundary layers on box[i] */ { - for (j= 0; j< nvars; j++) + for (j = 0; j < nvars; j++) { - fbdry= bdry[0][i][j+1]; /*(j+1) since j= 0 stores cell-centred boxes*/ + fbdry = bdry[0][i][j + 1]; /*(j+1) since j= 0 stores cell-centred boxes*/ hypre_ForBoxArrayI(k, fbdry) { - box_array= hypre_BoxArrayArrayBoxArray(fbdry, k); + box_array = hypre_BoxArrayArrayBoxArray(fbdry, k); hypre_ForBoxI(p, box_array) { - box= hypre_BoxArrayBox(box_array, p); - npts[0]+= hypre_BoxVolume(box); + box = hypre_BoxArrayBox(box_array, p); + npts[0] += hypre_BoxVolume(box); } } } /* for (j= 0; j< nvars; j++) */ - boxes_with_bdry[0][i]= 1; /* mark this box as containing boundary layers */ + boxes_with_bdry[0][i] = 1; /* mark this box as containing boundary layers */ } /* if (bdry[0][i]) */ } - nfboxes= nboxes; + nfboxes = nboxes; /* coarser levels */ - for (i= 1; i< num_levels; i++) + for (i = 1; i < num_levels; i++) { - grid = grid_l[i-1]; - pgrid= hypre_SStructGridPGrid(grid, 0); /* assuming one part */ - cell_fgrid= hypre_SStructPGridCellSGrid(pgrid); - fboxes= hypre_StructGridBoxes(cell_fgrid); + grid = grid_l[i - 1]; + pgrid = hypre_SStructGridPGrid(grid, 0); /* assuming one part */ + cell_fgrid = hypre_SStructPGridCellSGrid(pgrid); + fboxes = hypre_StructGridBoxes(cell_fgrid); grid = grid_l[i]; - pgrid= hypre_SStructGridPGrid(grid, 0); /* assuming one part */ - cell_cgrid= hypre_SStructPGridCellSGrid(pgrid); - nvars= hypre_SStructPGridNVars(pgrid); - cboxes= hypre_StructGridBoxes(cell_cgrid); - nboxes= hypre_BoxArraySize(hypre_StructGridBoxes(cell_cgrid)); - - bdry[i]= hypre_TAlloc(hypre_BoxArrayArray **, nboxes, HYPRE_MEMORY_HOST); - p= 2*(ndim-1); - for (j= 0; j< nboxes; j++) + pgrid = hypre_SStructGridPGrid(grid, 0); /* assuming one part */ + cell_cgrid = hypre_SStructPGridCellSGrid(pgrid); + nvars = hypre_SStructPGridNVars(pgrid); + cboxes = hypre_StructGridBoxes(cell_cgrid); + nboxes = hypre_BoxArraySize(hypre_StructGridBoxes(cell_cgrid)); + + bdry[i] = hypre_TAlloc(hypre_BoxArrayArray **, nboxes, HYPRE_MEMORY_HOST); + p = 2 * (ndim - 1); + for (j = 0; j < nboxes; j++) { - bdry[i][j]= hypre_TAlloc(hypre_BoxArrayArray *, nvars+1, HYPRE_MEMORY_HOST); + bdry[i][j] = hypre_TAlloc(hypre_BoxArrayArray *, nvars + 1, HYPRE_MEMORY_HOST); /* cell grid boxarrayarray */ - bdry[i][j][0]= hypre_BoxArrayArrayCreate(2*ndim, ndim); + bdry[i][j][0] = hypre_BoxArrayArrayCreate(2 * ndim, ndim); /* var grid boxarrayarrays */ - for (k= 0; k< nvars; k++) + for (k = 0; k < nvars; k++) { - bdry[i][j][k+1]= hypre_BoxArrayArrayCreate(p, ndim); + bdry[i][j][k + 1] = hypre_BoxArrayArrayCreate(p, ndim); } } /* check if there are boundary points from the previous level */ - for (j= 0; j< nfboxes; j++) + for (j = 0; j < nfboxes; j++) { /* see if the j box of level (i-1) has any boundary layers */ - if (boxes_with_bdry[i-1][j]) + if (boxes_with_bdry[i - 1][j]) { - boxi= fbox_mapping[i-1][j]; - cbox= hypre_BoxArrayBox(cboxes, boxi); - fbox= hypre_BoxArrayBox(fboxes, j); + boxi = fbox_mapping[i - 1][j]; + cbox = hypre_BoxArrayBox(cboxes, boxi); + fbox = hypre_BoxArrayBox(fboxes, j); /* contract the fbox so that divisible in rfactor */ - contract_fbox= hypre_BoxContraction(fbox, cell_fgrid, rfactors); + contract_fbox = hypre_BoxContraction(fbox, cell_fgrid, rfactors); /* refine the cbox. Expand the refined cbox so that the complete chunk of the fine box that coarsened to it is included. This requires some offsets */ hypre_ClearIndex(upper_shift); hypre_ClearIndex(lower_shift); - for (k= 0; k< ndim; k++) + for (k = 0; k < ndim; k++) { - m= hypre_BoxIMin(contract_fbox)[k]; - p= m%rfactors[k]; + m = hypre_BoxIMin(contract_fbox)[k]; + p = m % rfactors[k]; if (p > 0 && m > 0) { - upper_shift[k]= p-1; - lower_shift[k]= p-rfactors[k]; + upper_shift[k] = p - 1; + lower_shift[k] = p - rfactors[k]; } else { - upper_shift[k]= rfactors[k]-p-1; - lower_shift[k]=-p; + upper_shift[k] = rfactors[k] - p - 1; + lower_shift[k] = -p; } } hypre_BoxDestroy(contract_fbox); @@ -298,59 +299,59 @@ hypre_Maxwell_PhysBdy( hypre_SStructGrid **grid_l, boundaries of the coarser levels may not be physical, we cannot use hypre_BoxBoundaryDG. But accomplished through intersecting with the finer level boundary boxes. */ - fbdry= bdry[i-1][j][0]; /* cell-centred boundary layers of level (i-1) */ - cbdry= bdry[i][boxi][0]; /* cell-centred boundary layers of level i */ + fbdry = bdry[i - 1][j][0]; /* cell-centred boundary layers of level (i-1) */ + cbdry = bdry[i][boxi][0]; /* cell-centred boundary layers of level i */ /* fbdry is the cell-centred box_arrayarray. Contains an array of (2*ndim) boxarrays, one for each direction. */ - cnt= 0; + cnt = 0; hypre_ForBoxArrayI(l, fbdry) { /* determine which boundary side we are doing. Depending on the boundary, when we coarsen the refined boundary layer, the extents may need to be changed, e.g., index[lower,j,k]= index[upper,j,k]. */ - switch(l) + switch (l) { case 0: /* lower x direction, x_upper= x_lower */ { - n= 1; /* n flags whether upper or lower to be replaced */ - d= 0; /* x component */ + n = 1; /* n flags whether upper or lower to be replaced */ + d = 0; /* x component */ break; } case 1: /* upper x direction, x_lower= x_upper */ { - n= 0; /* n flags whether upper or lower to be replaced */ - d= 0; /* x component */ + n = 0; /* n flags whether upper or lower to be replaced */ + d = 0; /* x component */ break; } case 2: /* lower y direction, y_upper= y_lower */ { - n= 1; /* n flags whether upper or lower to be replaced */ - d= 1; /* y component */ + n = 1; /* n flags whether upper or lower to be replaced */ + d = 1; /* y component */ break; } case 3: /* upper y direction, y_lower= y_upper */ { - n= 0; /* n flags whether upper or lower to be replaced */ - d= 1; /* y component */ + n = 0; /* n flags whether upper or lower to be replaced */ + d = 1; /* y component */ break; } case 4: /* lower z direction, z_lower= z_upper */ { - n= 1; /* n flags whether upper or lower to be replaced */ - d= 2; /* z component */ + n = 1; /* n flags whether upper or lower to be replaced */ + d = 2; /* z component */ break; } case 5: /* upper z direction, z_upper= z_lower */ { - n= 0; /* n flags whether upper or lower to be replaced */ - d= 2; /* z component */ + n = 0; /* n flags whether upper or lower to be replaced */ + d = 2; /* z component */ break; } } - box_array= hypre_BoxArrayArrayBoxArray(fbdry, l); + box_array = hypre_BoxArrayArrayBoxArray(fbdry, l); hypre_ForBoxI(p, box_array) { hypre_IntersectBoxes(hypre_BoxArrayBox(box_array, p), &rbox, @@ -369,11 +370,11 @@ hypre_Maxwell_PhysBdy( hypre_SStructGrid **grid_l, of the box projecting formulas. */ if (n) /* replace upper by lower */ { - hypre_BoxIMax(&intersect)[d]= hypre_BoxIMin(&intersect)[d]; + hypre_BoxIMax(&intersect)[d] = hypre_BoxIMin(&intersect)[d]; } else /* replace lower by upper */ { - hypre_BoxIMin(&intersect)[d]= hypre_BoxIMax(&intersect)[d]; + hypre_BoxIMin(&intersect)[d] = hypre_BoxIMax(&intersect)[d]; } hypre_AppendBox(&intersect, @@ -390,46 +391,46 @@ hypre_Maxwell_PhysBdy( hypre_SStructGrid **grid_l, { hypre_Maxwell_VarBdy(pgrid, bdry[i][boxi]); - for (p= 0; p< nvars; p++) + for (p = 0; p < nvars; p++) { - cbdry= bdry[i][boxi][p+1]; + cbdry = bdry[i][boxi][p + 1]; hypre_ForBoxArrayI(l, cbdry) { - box_array= hypre_BoxArrayArrayBoxArray(cbdry, l); + box_array = hypre_BoxArrayArrayBoxArray(cbdry, l); hypre_ForBoxI(m, box_array) { - cbox= hypre_BoxArrayBox(box_array, m); - npts[i]+= hypre_BoxVolume(cbox); + cbox = hypre_BoxArrayBox(box_array, m); + npts[i] += hypre_BoxVolume(cbox); } } } - boxes_with_bdry[i][boxi]= 1; /* mark as containing boundary */ + boxes_with_bdry[i][boxi] = 1; /* mark as containing boundary */ } } /* if (boxes_with_bdry[i-1][j]) */ } /* for (j= 0; j< nfboxes; j++) */ - nfboxes= nboxes; + nfboxes = nboxes; } /* for (i= 1; i< num_levels; i++) */ /* de-allocate objects that are not needed anymore */ - for (i= 0; i< (num_levels-1); i++) + for (i = 0; i < (num_levels - 1); i++) { if (fbox_mapping[i]) { hypre_TFree(fbox_mapping[i], HYPRE_MEMORY_HOST); } - if (cbox_mapping[i+1]) + if (cbox_mapping[i + 1]) { - hypre_TFree(cbox_mapping[i+1], HYPRE_MEMORY_HOST); + hypre_TFree(cbox_mapping[i + 1], HYPRE_MEMORY_HOST); } - grid = grid_l[i+1]; - pgrid= hypre_SStructGridPGrid(grid, 0); /* assuming one part */ - cell_cgrid= hypre_SStructPGridCellSGrid(pgrid); - cboxes= hypre_StructGridBoxes(cell_cgrid); - nboxes= hypre_BoxArraySize(hypre_StructGridBoxes(cell_cgrid)); + grid = grid_l[i + 1]; + pgrid = hypre_SStructGridPGrid(grid, 0); /* assuming one part */ + cell_cgrid = hypre_SStructPGridCellSGrid(pgrid); + cboxes = hypre_StructGridBoxes(cell_cgrid); + nboxes = hypre_BoxArraySize(hypre_StructGridBoxes(cell_cgrid)); } if (num_levels > 1) { @@ -439,35 +440,35 @@ hypre_Maxwell_PhysBdy( hypre_SStructGrid **grid_l, /* find the ranks for the boundary points */ BdryRanks_l = hypre_TAlloc(HYPRE_Int *, num_levels, HYPRE_MEMORY_HOST); - BdryRanksCnts_l= hypre_TAlloc(HYPRE_Int , num_levels, HYPRE_MEMORY_HOST); + BdryRanksCnts_l = hypre_TAlloc(HYPRE_Int, num_levels, HYPRE_MEMORY_HOST); /* loop over levels and extract boundary ranks. Only extract unique ranks */ - for (i= 0; i< num_levels; i++) + for (i = 0; i < num_levels; i++) { - grid= grid_l[i]; - pgrid= hypre_SStructGridPGrid(grid, 0); /* assuming one part */ - cell_cgrid= hypre_SStructPGridCellSGrid(pgrid); - nvars= hypre_SStructPGridNVars(pgrid); - cboxes= hypre_StructGridBoxes(cell_cgrid); - nboxes= hypre_BoxArraySize(hypre_StructGridBoxes(cell_cgrid)); - - ranks= hypre_TAlloc(HYPRE_BigInt, npts[i], HYPRE_MEMORY_HOST); - cnt= 0; - for (j= 0; j< nboxes; j++) + grid = grid_l[i]; + pgrid = hypre_SStructGridPGrid(grid, 0); /* assuming one part */ + cell_cgrid = hypre_SStructPGridCellSGrid(pgrid); + nvars = hypre_SStructPGridNVars(pgrid); + cboxes = hypre_StructGridBoxes(cell_cgrid); + nboxes = hypre_BoxArraySize(hypre_StructGridBoxes(cell_cgrid)); + + ranks = hypre_TAlloc(HYPRE_BigInt, npts[i], HYPRE_MEMORY_HOST); + cnt = 0; + for (j = 0; j < nboxes; j++) { if (boxes_with_bdry[i][j]) { - for (k= 0; k< nvars; k++) + for (k = 0; k < nvars; k++) { - fbdry= bdry[i][j][k+1]; + fbdry = bdry[i][j][k + 1]; hypre_ForBoxArrayI(m, fbdry) { - box_array= hypre_BoxArrayArrayBoxArray(fbdry, m); + box_array = hypre_BoxArrayArrayBoxArray(fbdry, m); hypre_ForBoxI(p, box_array) { - box= hypre_BoxArrayBox(box_array, p); + box = hypre_BoxArrayBox(box_array, p); hypre_BoxGetSize(box, loop_size); hypre_CopyIndex(hypre_BoxIMin(box), start); @@ -491,9 +492,9 @@ hypre_Maxwell_PhysBdy( hypre_SStructGrid **grid_l, } /* for (k= 0; k< nvars; k++) */ } /* if (boxes_with_bdry[i][j]) */ - for (k= 0; k< nvars; k++) + for (k = 0; k < nvars; k++) { - hypre_BoxArrayArrayDestroy(bdry[i][j][k+1]); + hypre_BoxArrayArrayDestroy(bdry[i][j][k + 1]); } hypre_BoxArrayArrayDestroy(bdry[i][j][0]); hypre_TFree(bdry[i][j], HYPRE_MEMORY_HOST); @@ -502,59 +503,59 @@ hypre_Maxwell_PhysBdy( hypre_SStructGrid **grid_l, hypre_TFree(bdry[i], HYPRE_MEMORY_HOST); /* mark all ranks that are outside this processor to -1 */ - for (j= 0; j< cnt; j++) + for (j = 0; j < cnt; j++) { if ( (ranks[j] < lower_rank[i]) || (ranks[j] > upper_rank[i]) ) { - ranks[j]= -1; + ranks[j] = -1; } } /* sort the ranks & extract the unique ones */ if (cnt) /* recall that some may not have bdry pts */ { - hypre_BigQsort0(ranks, 0, cnt-1); + hypre_BigQsort0(ranks, 0, cnt - 1); - k= 0; + k = 0; if (ranks[0] < 0) /* remove the off-processor markers */ { - for (j= 1; j< cnt; j++) + for (j = 1; j < cnt; j++) { if (ranks[j] > -1) { - k= j; + k = j; break; } } } - l= 1; - for (j= k+1; j< cnt; j++) + l = 1; + for (j = k + 1; j < cnt; j++) { - if (ranks[j] != ranks[j-1]) + if (ranks[j] != ranks[j - 1]) { l++; } } - BdryRanks_l[i]= hypre_TAlloc(HYPRE_Int, l, HYPRE_MEMORY_HOST); - BdryRanksCnts_l[i]= l; + BdryRanks_l[i] = hypre_TAlloc(HYPRE_Int, l, HYPRE_MEMORY_HOST); + BdryRanksCnts_l[i] = l; - l= 0; - BdryRanks_l[i][l]= ranks[k]-lower_rank[i]; - for (j= k+1; j< cnt; j++) + l = 0; + BdryRanks_l[i][l] = ranks[k] - lower_rank[i]; + for (j = k + 1; j < cnt; j++) { - if (ranks[j] != ranks[j-1]) + if (ranks[j] != ranks[j - 1]) { l++; - BdryRanks_l[i][l]= ranks[j]-lower_rank[i]; /* store local ranks */ + BdryRanks_l[i][l] = ranks[j] - lower_rank[i]; /* store local ranks */ } } } else /* set BdryRanks_l[i] to be null */ { - BdryRanks_l[i]= NULL; - BdryRanksCnts_l[i]= 0; + BdryRanks_l[i] = NULL; + BdryRanksCnts_l[i] = 0; } hypre_TFree(ranks, HYPRE_MEMORY_HOST); @@ -570,7 +571,7 @@ hypre_Maxwell_PhysBdy( hypre_SStructGrid **grid_l, hypre_TFree(npts, HYPRE_MEMORY_HOST); *BdryRanksl_ptr = BdryRanks_l; - *BdryRanksCntsl_ptr= BdryRanksCnts_l; + *BdryRanksCntsl_ptr = BdryRanksCnts_l; return ierr; } @@ -586,9 +587,9 @@ hypre_Maxwell_VarBdy( hypre_SStructPGrid *pgrid, hypre_BoxArrayArray **bdry ) { HYPRE_Int ierr = 0; - HYPRE_Int nvars= hypre_SStructPGridNVars(pgrid); + HYPRE_Int nvars = hypre_SStructPGridNVars(pgrid); - hypre_BoxArrayArray *cell_bdry= bdry[0]; + hypre_BoxArrayArray *cell_bdry = bdry[0]; hypre_BoxArray *box_array, *box_array2; hypre_Box *bdy_box, *shifted_box; @@ -603,23 +604,23 @@ hypre_Maxwell_VarBdy( hypre_SStructPGrid *pgrid, hypre_SetIndex3(jshift, 0, 1, 0); hypre_SetIndex3(kshift, 0, 0, 1); - shifted_box= hypre_BoxCreate(ndim); - for (i= 0; i< nvars; i++) + shifted_box = hypre_BoxCreate(ndim); + for (i = 0; i < nvars; i++) { - t= vartypes[i]; + t = vartypes[i]; hypre_SStructVariableGetOffset(vartypes[i], ndim, varoffset); - switch(t) + switch (t) { case 2: /* xface, boundary i= lower, upper */ { /* boundary i= lower */ - box_array= hypre_BoxArrayArrayBoxArray(cell_bdry, 0); + box_array = hypre_BoxArrayArrayBoxArray(cell_bdry, 0); if (hypre_BoxArraySize(box_array)) { - box_array2= hypre_BoxArrayArrayBoxArray(bdry[i+1], 0); + box_array2 = hypre_BoxArrayArrayBoxArray(bdry[i + 1], 0); hypre_ForBoxI(k, box_array) { - bdy_box= hypre_BoxArrayBox(box_array, k); + bdy_box = hypre_BoxArrayBox(box_array, k); /* bdry boxes */ hypre_CopyIndex(hypre_BoxIMin(bdy_box), lower); @@ -633,13 +634,13 @@ hypre_Maxwell_VarBdy( hypre_SStructPGrid *pgrid, } /* boundary i= upper */ - box_array= hypre_BoxArrayArrayBoxArray(cell_bdry, 1); + box_array = hypre_BoxArrayArrayBoxArray(cell_bdry, 1); if (hypre_BoxArraySize(box_array)) { - box_array2= hypre_BoxArrayArrayBoxArray(bdry[i+1], 1); + box_array2 = hypre_BoxArrayArrayBoxArray(bdry[i + 1], 1); hypre_ForBoxI(k, box_array) { - bdy_box= hypre_BoxArrayBox(box_array, k); + bdy_box = hypre_BoxArrayBox(box_array, k); /* bdry boxes */ hypre_CopyIndex(hypre_BoxIMin(bdy_box), lower); @@ -654,13 +655,13 @@ hypre_Maxwell_VarBdy( hypre_SStructPGrid *pgrid, case 3: /* yface, boundary j= lower, upper */ { - box_array= hypre_BoxArrayArrayBoxArray(cell_bdry, 2); + box_array = hypre_BoxArrayArrayBoxArray(cell_bdry, 2); if (hypre_BoxArraySize(box_array)) { - box_array2= hypre_BoxArrayArrayBoxArray(bdry[i+1], 0); + box_array2 = hypre_BoxArrayArrayBoxArray(bdry[i + 1], 0); hypre_ForBoxI(k, box_array) { - bdy_box= hypre_BoxArrayBox(box_array, k); + bdy_box = hypre_BoxArrayBox(box_array, k); /* bdry boxes */ hypre_CopyIndex(hypre_BoxIMin(bdy_box), lower); @@ -673,13 +674,13 @@ hypre_Maxwell_VarBdy( hypre_SStructPGrid *pgrid, } } - box_array= hypre_BoxArrayArrayBoxArray(cell_bdry, 3); + box_array = hypre_BoxArrayArrayBoxArray(cell_bdry, 3); if (hypre_BoxArraySize(box_array)) { - box_array2= hypre_BoxArrayArrayBoxArray(bdry[i+1], 1); + box_array2 = hypre_BoxArrayArrayBoxArray(bdry[i + 1], 1); hypre_ForBoxI(k, box_array) { - bdy_box= hypre_BoxArrayBox(box_array, k); + bdy_box = hypre_BoxArrayBox(box_array, k); /* bdry boxes */ hypre_CopyIndex(hypre_BoxIMin(bdy_box), lower); @@ -695,13 +696,13 @@ hypre_Maxwell_VarBdy( hypre_SStructPGrid *pgrid, case 5: /* xedge, boundary z_faces & y_faces */ { /* boundary k= lower zface*/ - box_array= hypre_BoxArrayArrayBoxArray(cell_bdry, 4); + box_array = hypre_BoxArrayArrayBoxArray(cell_bdry, 4); if (hypre_BoxArraySize(box_array)) { - box_array2= hypre_BoxArrayArrayBoxArray(bdry[i+1], 0); + box_array2 = hypre_BoxArrayArrayBoxArray(bdry[i + 1], 0); hypre_ForBoxI(k, box_array) { - bdy_box= hypre_BoxArrayBox(box_array, k); + bdy_box = hypre_BoxArrayBox(box_array, k); /* bdry boxes */ hypre_CopyIndex(hypre_BoxIMin(bdy_box), lower); @@ -715,13 +716,13 @@ hypre_Maxwell_VarBdy( hypre_SStructPGrid *pgrid, } /* boundary k= upper zface*/ - box_array= hypre_BoxArrayArrayBoxArray(cell_bdry, 5); + box_array = hypre_BoxArrayArrayBoxArray(cell_bdry, 5); if (hypre_BoxArraySize(box_array)) { - box_array2= hypre_BoxArrayArrayBoxArray(bdry[i+1], 1); + box_array2 = hypre_BoxArrayArrayBoxArray(bdry[i + 1], 1); hypre_ForBoxI(k, box_array) { - bdy_box= hypre_BoxArrayBox(box_array, k); + bdy_box = hypre_BoxArrayBox(box_array, k); /* bdry boxes */ hypre_CopyIndex(hypre_BoxIMin(bdy_box), lower); @@ -734,13 +735,13 @@ hypre_Maxwell_VarBdy( hypre_SStructPGrid *pgrid, } /* boundary j= lower yface*/ - box_array= hypre_BoxArrayArrayBoxArray(cell_bdry, 2); + box_array = hypre_BoxArrayArrayBoxArray(cell_bdry, 2); if (hypre_BoxArraySize(box_array)) { - box_array2= hypre_BoxArrayArrayBoxArray(bdry[i+1], 2); + box_array2 = hypre_BoxArrayArrayBoxArray(bdry[i + 1], 2); hypre_ForBoxI(k, box_array) { - bdy_box= hypre_BoxArrayBox(box_array, k); + bdy_box = hypre_BoxArrayBox(box_array, k); /* bdry boxes */ hypre_CopyIndex(hypre_BoxIMin(bdy_box), lower); @@ -754,13 +755,13 @@ hypre_Maxwell_VarBdy( hypre_SStructPGrid *pgrid, } /* boundary j= upper yface*/ - box_array= hypre_BoxArrayArrayBoxArray(cell_bdry, 3); + box_array = hypre_BoxArrayArrayBoxArray(cell_bdry, 3); if (hypre_BoxArraySize(box_array)) { - box_array2= hypre_BoxArrayArrayBoxArray(bdry[i+1], 3); + box_array2 = hypre_BoxArrayArrayBoxArray(bdry[i + 1], 3); hypre_ForBoxI(k, box_array) { - bdy_box= hypre_BoxArrayBox(box_array, k); + bdy_box = hypre_BoxArrayBox(box_array, k); /* bdry boxes */ hypre_CopyIndex(hypre_BoxIMin(bdy_box), lower); @@ -777,13 +778,13 @@ hypre_Maxwell_VarBdy( hypre_SStructPGrid *pgrid, case 6: /* yedge, boundary z_faces & x_faces */ { /* boundary k= lower zface*/ - box_array= hypre_BoxArrayArrayBoxArray(cell_bdry, 4); + box_array = hypre_BoxArrayArrayBoxArray(cell_bdry, 4); if (hypre_BoxArraySize(box_array)) { - box_array2= hypre_BoxArrayArrayBoxArray(bdry[i+1], 0); + box_array2 = hypre_BoxArrayArrayBoxArray(bdry[i + 1], 0); hypre_ForBoxI(k, box_array) { - bdy_box= hypre_BoxArrayBox(box_array, k); + bdy_box = hypre_BoxArrayBox(box_array, k); /* bdry boxes */ hypre_CopyIndex(hypre_BoxIMin(bdy_box), lower); @@ -797,13 +798,13 @@ hypre_Maxwell_VarBdy( hypre_SStructPGrid *pgrid, } /* boundary k= upper zface*/ - box_array= hypre_BoxArrayArrayBoxArray(cell_bdry, 5); + box_array = hypre_BoxArrayArrayBoxArray(cell_bdry, 5); if (hypre_BoxArraySize(box_array)) { - box_array2= hypre_BoxArrayArrayBoxArray(bdry[i+1], 1); + box_array2 = hypre_BoxArrayArrayBoxArray(bdry[i + 1], 1); hypre_ForBoxI(k, box_array) { - bdy_box= hypre_BoxArrayBox(box_array, k); + bdy_box = hypre_BoxArrayBox(box_array, k); /* bdry boxes */ hypre_CopyIndex(hypre_BoxIMin(bdy_box), lower); @@ -816,13 +817,13 @@ hypre_Maxwell_VarBdy( hypre_SStructPGrid *pgrid, } /* boundary i= lower xface*/ - box_array= hypre_BoxArrayArrayBoxArray(cell_bdry, 0); + box_array = hypre_BoxArrayArrayBoxArray(cell_bdry, 0); if (hypre_BoxArraySize(box_array)) { - box_array2= hypre_BoxArrayArrayBoxArray(bdry[i+1], 2); + box_array2 = hypre_BoxArrayArrayBoxArray(bdry[i + 1], 2); hypre_ForBoxI(k, box_array) { - bdy_box= hypre_BoxArrayBox(box_array, k); + bdy_box = hypre_BoxArrayBox(box_array, k); /* bdry boxes */ hypre_CopyIndex(hypre_BoxIMin(bdy_box), lower); @@ -836,13 +837,13 @@ hypre_Maxwell_VarBdy( hypre_SStructPGrid *pgrid, } /* boundary i= upper xface*/ - box_array= hypre_BoxArrayArrayBoxArray(cell_bdry, 1); + box_array = hypre_BoxArrayArrayBoxArray(cell_bdry, 1); if (hypre_BoxArraySize(box_array)) { - box_array2= hypre_BoxArrayArrayBoxArray(bdry[i+1], 3); + box_array2 = hypre_BoxArrayArrayBoxArray(bdry[i + 1], 3); hypre_ForBoxI(k, box_array) { - bdy_box= hypre_BoxArrayBox(box_array, k); + bdy_box = hypre_BoxArrayBox(box_array, k); /* bdry boxes */ hypre_CopyIndex(hypre_BoxIMin(bdy_box), lower); @@ -859,13 +860,13 @@ hypre_Maxwell_VarBdy( hypre_SStructPGrid *pgrid, case 7: /* zedge, boundary y_faces & x_faces */ { /* boundary j= lower yface*/ - box_array= hypre_BoxArrayArrayBoxArray(cell_bdry, 2); + box_array = hypre_BoxArrayArrayBoxArray(cell_bdry, 2); if (hypre_BoxArraySize(box_array)) { - box_array2= hypre_BoxArrayArrayBoxArray(bdry[i+1], 0); + box_array2 = hypre_BoxArrayArrayBoxArray(bdry[i + 1], 0); hypre_ForBoxI(k, box_array) { - bdy_box= hypre_BoxArrayBox(box_array, k); + bdy_box = hypre_BoxArrayBox(box_array, k); /* bdry boxes */ hypre_CopyIndex(hypre_BoxIMin(bdy_box), lower); @@ -879,13 +880,13 @@ hypre_Maxwell_VarBdy( hypre_SStructPGrid *pgrid, } /* boundary j= upper yface*/ - box_array= hypre_BoxArrayArrayBoxArray(cell_bdry, 3); + box_array = hypre_BoxArrayArrayBoxArray(cell_bdry, 3); if (hypre_BoxArraySize(box_array)) { - box_array2= hypre_BoxArrayArrayBoxArray(bdry[i+1], 1); + box_array2 = hypre_BoxArrayArrayBoxArray(bdry[i + 1], 1); hypre_ForBoxI(k, box_array) { - bdy_box= hypre_BoxArrayBox(box_array, k); + bdy_box = hypre_BoxArrayBox(box_array, k); /* bdry boxes */ hypre_CopyIndex(hypre_BoxIMin(bdy_box), lower); @@ -898,13 +899,13 @@ hypre_Maxwell_VarBdy( hypre_SStructPGrid *pgrid, } /* boundary i= lower xface*/ - box_array= hypre_BoxArrayArrayBoxArray(cell_bdry, 0); + box_array = hypre_BoxArrayArrayBoxArray(cell_bdry, 0); if (hypre_BoxArraySize(box_array)) { - box_array2= hypre_BoxArrayArrayBoxArray(bdry[i+1], 2); + box_array2 = hypre_BoxArrayArrayBoxArray(bdry[i + 1], 2); hypre_ForBoxI(k, box_array) { - bdy_box= hypre_BoxArrayBox(box_array, k); + bdy_box = hypre_BoxArrayBox(box_array, k); /* bdry boxes */ hypre_CopyIndex(hypre_BoxIMin(bdy_box), lower); @@ -918,13 +919,13 @@ hypre_Maxwell_VarBdy( hypre_SStructPGrid *pgrid, } /* boundary i= upper xface*/ - box_array= hypre_BoxArrayArrayBoxArray(cell_bdry, 1); + box_array = hypre_BoxArrayArrayBoxArray(cell_bdry, 1); if (hypre_BoxArraySize(box_array)) { - box_array2= hypre_BoxArrayArrayBoxArray(bdry[i+1], 3); + box_array2 = hypre_BoxArrayArrayBoxArray(bdry[i + 1], 3); hypre_ForBoxI(k, box_array) { - bdy_box= hypre_BoxArrayBox(box_array, k); + bdy_box = hypre_BoxArrayBox(box_array, k); /* bdry boxes */ hypre_CopyIndex(hypre_BoxIMin(bdy_box), lower); @@ -945,4 +946,3 @@ hypre_Maxwell_VarBdy( hypre_SStructPGrid *pgrid, return ierr; } - diff --git a/external/hypre/src/sstruct_ls/maxwell_semi_interp.c b/external/hypre/src/sstruct_ls/maxwell_semi_interp.c index 7cfd48f6..b761983e 100644 --- a/external/hypre/src/sstruct_ls/maxwell_semi_interp.c +++ b/external/hypre/src/sstruct_ls/maxwell_semi_interp.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -24,18 +24,18 @@ HYPRE_Int hypre_CreatePTopology(void **PTopology_vdata_ptr) { hypre_PTopology *PTopology; - HYPRE_Int ierr= 0; + HYPRE_Int ierr = 0; - PTopology= hypre_CTAlloc(hypre_PTopology, 1, HYPRE_MEMORY_HOST); + PTopology = hypre_CTAlloc(hypre_PTopology, 1, HYPRE_MEMORY_HOST); (PTopology -> Face_iedge) = NULL; - (PTopology -> Element_iedge)= NULL; + (PTopology -> Element_iedge) = NULL; (PTopology -> Edge_iedge) = NULL; (PTopology -> Element_Face) = NULL; (PTopology -> Element_Edge) = NULL; - *PTopology_vdata_ptr= (void *) PTopology; + *PTopology_vdata_ptr = (void *) PTopology; return ierr; } @@ -43,7 +43,7 @@ hypre_CreatePTopology(void **PTopology_vdata_ptr) HYPRE_Int hypre_DestroyPTopology(void *PTopology_vdata) { - hypre_PTopology *PTopology= (hypre_PTopology *)PTopology_vdata; + hypre_PTopology *PTopology = (hypre_PTopology *)PTopology_vdata; HYPRE_Int ierr = 0; if (PTopology) @@ -79,7 +79,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, { MPI_Comm comm = (fgrid_element -> comm); - hypre_PTopology *PTopology= (hypre_PTopology *)PTopology_vdata; + hypre_PTopology *PTopology = (hypre_PTopology *) PTopology_vdata; hypre_IJMatrix *Face_iedge; hypre_IJMatrix *Element_iedge; @@ -104,23 +104,26 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, HYPRE_BigInt start_rank1; HYPRE_Int nFaces, nEdges, nElements, nedges; - HYPRE_Int nxFaces, nyFaces, nzFaces, nxEdges, nyEdges, nzEdges; + HYPRE_Int nxFaces, nyFaces, nzFaces; + /* HYPRE_Int nxEdges, nyEdges, nzEdges; */ HYPRE_Int n_xFace_iedges, n_yFace_iedges, n_zFace_iedges; HYPRE_Int n_Cell_iedges; HYPRE_Int nElements_iedges, nFaces_iedges, nEdges_iedges; HYPRE_Int nElements_Faces, nElements_Edges; - HYPRE_BigInt *iFace, *iEdge; + HYPRE_BigInt *iFace = NULL, *iEdge; HYPRE_BigInt *jFace_edge; HYPRE_BigInt *jEdge_iedge; - HYPRE_BigInt *jElement_Face, *jedge_Edge; + HYPRE_BigInt *jElement_Face = NULL, *jedge_Edge; HYPRE_BigInt *iElement, *jElement_Edge, *iedgeEdge, *jElement_edge; - HYPRE_Real *vals_ElementEdge, *vals_ElementFace, *vals_edgeEdge, *vals_Faceedge; + HYPRE_Real *vals_ElementEdge, *vals_ElementFace = NULL; + HYPRE_Real *vals_edgeEdge, *vals_Faceedge; HYPRE_Real *vals_Elementedge, *vals_Edgeiedge; - HYPRE_Int *ncols_Elementedge, *ncols_Edgeiedge, *ncols_edgeEdge, *ncols_Faceedge; - HYPRE_Int *ncols_ElementFace, *ncols_ElementEdge; + HYPRE_Int *ncols_Elementedge, *ncols_Edgeiedge; + HYPRE_Int *ncols_edgeEdge, *ncols_Faceedge; + HYPRE_Int *ncols_ElementFace = NULL, *ncols_ElementEdge; HYPRE_Int *bdryedge_location; HYPRE_Real fCedge_ratio; HYPRE_Real *stencil_vals, *upper, *lower, *diag, *face_w1, *face_w2; @@ -134,16 +137,17 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, hypre_Index lindex; HYPRE_Int n_boxoffsets; - HYPRE_Int nparts= hypre_SStructGridNParts(fgrid_element); + HYPRE_Int nparts = hypre_SStructGridNParts(fgrid_element); HYPRE_Int ndim = hypre_SStructGridNDim(fgrid_element); - HYPRE_SStructVariable *vartypes, *Edge_vartypes, *Face_vartypes; + HYPRE_SStructVariable *vartypes, *Face_vartypes, *Edge_vartypes = NULL; hypre_Index *varoffsets; HYPRE_Int *vartype_map; - HYPRE_Int matrix_type= HYPRE_PARCSR; + HYPRE_Int matrix_type = HYPRE_PARCSR; - HYPRE_Int nvars, Face_nvars, Edge_nvars, part, var, box, fboxi; - HYPRE_Int tot_vars= 8; + HYPRE_Int nvars, Face_nvars, part, var, box, fboxi; + HYPRE_Int Edge_nvars = 0; + HYPRE_Int tot_vars = 8; HYPRE_Int t, i, j, k, l, m, n, p; @@ -156,11 +160,13 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, HYPRE_Int size1; HYPRE_Int trueV = 1; - HYPRE_Int falseV= 0; + HYPRE_Int falseV = 0; HYPRE_Int row_in; HYPRE_Int myproc; + HYPRE_MemoryLocation memory_location = hypre_ParCSRMatrixMemoryLocation(Aee); + hypre_BoxInit(©_box, ndim); hypre_MPI_Comm_rank(comm, &myproc); @@ -169,15 +175,13 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, hypre_SetIndex3(kshift, 0, 0, 1); hypre_ClearIndex(zero_index); hypre_ClearIndex(one_index); - for (i= 0; i< ndim; i++) - { - one_index[i]= 1; - } + hypre_SetIndex(one_index, 1); + hypre_SetIndex(lindex, 1); /* set rfactor[2]= 1 if ndim=2. */ if (ndim == 2) { - rfactor[2]= 1; + rfactor[2] = 1; } /*------------------------------------------------------------------- @@ -199,31 +203,31 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, to hypre enumeration. Only need for face and edge grids. */ vartype_map = hypre_CTAlloc(HYPRE_Int, 8, HYPRE_MEMORY_HOST); - part= 0; + part = 0; p_cgrid = hypre_SStructGridPGrid(cgrid_face, part); /* face cgrid */ nvars = hypre_SStructPGridNVars(p_cgrid); - vartypes= hypre_SStructPGridVarTypes(p_cgrid); + vartypes = hypre_SStructPGridVarTypes(p_cgrid); - for (i= 0; i< nvars; i++) + for (i = 0; i < nvars; i++) { - t= vartypes[i]; - switch(t) + t = vartypes[i]; + switch (t) { case 2: { - vartype_map[2]= i; + vartype_map[2] = i; break; } case 3: { - vartype_map[3]= i; + vartype_map[3] = i; break; } case 4: { - vartype_map[4]= i; + vartype_map[4] = i; break; } } @@ -233,28 +237,28 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, { p_cgrid = hypre_SStructGridPGrid(cgrid_edge, part); /* edge cgrid */ nvars = hypre_SStructPGridNVars(p_cgrid); - vartypes= hypre_SStructPGridVarTypes(p_cgrid); + vartypes = hypre_SStructPGridVarTypes(p_cgrid); - for (i= 0; i< nvars; i++) + for (i = 0; i < nvars; i++) { - t= vartypes[i]; - switch(t) + t = vartypes[i]; + switch (t) { case 5: { - vartype_map[5]= i; + vartype_map[5] = i; break; } case 6: { - vartype_map[6]= i; + vartype_map[6] = i; break; } case 7: { - vartype_map[7]= i; + vartype_map[7] = i; break; } } @@ -264,46 +268,46 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, /* local sizes */ nFaces = 0; nEdges = 0; - nElements= 0; + nElements = 0; nedges = 0; nxFaces = 0; nyFaces = 0; nzFaces = 0; - nxEdges = 0; - nyEdges = 0; - nzEdges = 0; + /* nxEdges = 0; */ + /* nyEdges = 0; */ + /* nzEdges = 0; */ - for (part= 0; part< nparts; part++) + for (part = 0; part < nparts; part++) { p_cgrid = hypre_SStructGridPGrid(cgrid_element, part); /* cell cgrid */ var_cgrid = hypre_SStructPGridCellSGrid(p_cgrid) ; - nElements+= hypre_StructGridLocalSize(var_cgrid); + nElements += hypre_StructGridLocalSize(var_cgrid); - t= 0; + t = 0; hypre_SStructVariableGetOffset((hypre_SStructVariable) t, ndim, varoffsets[0]); p_cgrid = hypre_SStructGridPGrid(cgrid_face, part); /* face cgrid */ nvars = hypre_SStructPGridNVars(p_cgrid); - vartypes= hypre_SStructPGridVarTypes(p_cgrid); + vartypes = hypre_SStructPGridVarTypes(p_cgrid); - for (var= 0; var< nvars; var++) + for (var = 0; var < nvars; var++) { - var_cgrid= hypre_SStructPGridSGrid(p_cgrid, var); - t= vartypes[var]; - nFaces+= hypre_StructGridLocalSize(var_cgrid); + var_cgrid = hypre_SStructPGridSGrid(p_cgrid, var); + t = vartypes[var]; + nFaces += hypre_StructGridLocalSize(var_cgrid); - switch(t) + switch (t) { case 2: - nxFaces+= hypre_StructGridLocalSize(var_cgrid); + nxFaces += hypre_StructGridLocalSize(var_cgrid); break; case 3: - nyFaces+= hypre_StructGridLocalSize(var_cgrid); + nyFaces += hypre_StructGridLocalSize(var_cgrid); break; case 4: - nzFaces+= hypre_StructGridLocalSize(var_cgrid); + nzFaces += hypre_StructGridLocalSize(var_cgrid); break; } @@ -315,35 +319,35 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, if (ndim < 3) { nEdges = nFaces; - nxEdges= nxFaces; - nyEdges= nyFaces; - nzEdges= 0; + /* nxEdges = nxFaces; */ + /* nyEdges = nyFaces; */ + /* nzEdges = 0; */ } else { p_cgrid = hypre_SStructGridPGrid(cgrid_edge, part); /* edge cgrid */ nvars = hypre_SStructPGridNVars(p_cgrid); - vartypes= hypre_SStructPGridVarTypes(p_cgrid); + vartypes = hypre_SStructPGridVarTypes(p_cgrid); - for (var= 0; var< nvars; var++) + for (var = 0; var < nvars; var++) { - var_cgrid= hypre_SStructPGridSGrid(p_cgrid, var); - t= vartypes[var]; - nEdges+= hypre_StructGridLocalSize(var_cgrid); - - switch(t) - { - case 5: - nxEdges+= hypre_StructGridLocalSize(var_cgrid); - break; - case 6: - nyEdges+= hypre_StructGridLocalSize(var_cgrid); - break; - case 7: - nzEdges+= hypre_StructGridLocalSize(var_cgrid); - break; - } + var_cgrid = hypre_SStructPGridSGrid(p_cgrid, var); + t = vartypes[var]; + nEdges += hypre_StructGridLocalSize(var_cgrid); + + /* switch (t) */ + /* { */ + /* case 5: */ + /* nxEdges += hypre_StructGridLocalSize(var_cgrid); */ + /* break; */ + /* case 6: */ + /* nyEdges += hypre_StructGridLocalSize(var_cgrid); */ + /* break; */ + /* case 7: */ + /* nzEdges += hypre_StructGridLocalSize(var_cgrid); */ + /* break; */ + /* } */ hypre_SStructVariableGetOffset((hypre_SStructVariable) t, ndim, varoffsets[t]); @@ -353,11 +357,11 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, /* same for 2-d & 3-d, assuming that fgrid_edge= fgrid_face in input */ p_fgrid = hypre_SStructGridPGrid(fgrid_edge, part); /* edge fgrid */ nvars = hypre_SStructPGridNVars(p_fgrid); - vartypes= hypre_SStructPGridVarTypes(p_fgrid); + vartypes = hypre_SStructPGridVarTypes(p_fgrid); - for (var= 0; var< nvars; var++) + for (var = 0; var < nvars; var++) { - var_fgrid= hypre_SStructPGridSGrid(p_fgrid, var); + var_fgrid = hypre_SStructPGridSGrid(p_fgrid, var); nedges += hypre_StructGridLocalSize(var_fgrid); } } @@ -374,33 +378,33 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, * * Also determine contracted cell-centred fboxes. *--------------------------------------------------------------------------*/ - cfbox_mapping= hypre_TAlloc(HYPRE_Int *, nparts, HYPRE_MEMORY_HOST); - fcbox_mapping= hypre_TAlloc(HYPRE_Int *, nparts, HYPRE_MEMORY_HOST); - contract_fedgeBoxes= hypre_TAlloc(hypre_BoxArray *, nparts, HYPRE_MEMORY_HOST); - Edge_cstarts= hypre_TAlloc(hypre_Index *, nparts, HYPRE_MEMORY_HOST); - upper_shifts= hypre_TAlloc(hypre_Index *, nparts, HYPRE_MEMORY_HOST); - lower_shifts= hypre_TAlloc(hypre_Index *, nparts, HYPRE_MEMORY_HOST); - - for (i= 0; i< nparts; i++) + cfbox_mapping = hypre_TAlloc(HYPRE_Int *, nparts, HYPRE_MEMORY_HOST); + fcbox_mapping = hypre_TAlloc(HYPRE_Int *, nparts, HYPRE_MEMORY_HOST); + contract_fedgeBoxes = hypre_TAlloc(hypre_BoxArray *, nparts, HYPRE_MEMORY_HOST); + Edge_cstarts = hypre_TAlloc(hypre_Index *, nparts, HYPRE_MEMORY_HOST); + upper_shifts = hypre_TAlloc(hypre_Index *, nparts, HYPRE_MEMORY_HOST); + lower_shifts = hypre_TAlloc(hypre_Index *, nparts, HYPRE_MEMORY_HOST); + + for (i = 0; i < nparts; i++) { p_fgrid = hypre_SStructGridPGrid(fgrid_element, i); - var_fgrid= hypre_SStructPGridCellSGrid(p_fgrid); + var_fgrid = hypre_SStructPGridCellSGrid(p_fgrid); fboxes = hypre_StructGridBoxes(var_fgrid); j = hypre_BoxArraySize(fboxes); - fcbox_mapping[i]= hypre_CTAlloc(HYPRE_Int, j, HYPRE_MEMORY_HOST); + fcbox_mapping[i] = hypre_CTAlloc(HYPRE_Int, j, HYPRE_MEMORY_HOST); p_cgrid = hypre_SStructGridPGrid(cgrid_element, i); - var_cgrid= hypre_SStructPGridCellSGrid(p_cgrid); + var_cgrid = hypre_SStructPGridCellSGrid(p_cgrid); cboxes = hypre_StructGridBoxes(var_cgrid); j = hypre_BoxArraySize(fboxes); - cfbox_mapping[i]= hypre_CTAlloc(HYPRE_Int, j, HYPRE_MEMORY_HOST); + cfbox_mapping[i] = hypre_CTAlloc(HYPRE_Int, j, HYPRE_MEMORY_HOST); /* assuming if i1 > i2 and (box j1) is coarsened from (box i1) and (box j2) from (box i2), then j1 > j2. */ - k= 0; + k = 0; hypre_ForBoxI(j, fboxes) { - fbox= hypre_BoxArrayBox(fboxes, j); + fbox = hypre_BoxArrayBox(fboxes, j); hypre_CopyBox(fbox, ©_box); hypre_ProjectBox(©_box, zero_index, rfactor); hypre_StructMapFineToCoarse(hypre_BoxIMin(©_box), zero_index, @@ -412,46 +416,46 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, ordering, we only have to check if the first cbox in the list intersects with copy_box. If not, this fbox vanished in the coarsening. Note that this gives you the correct interior cbox. */ - cbox= hypre_BoxArrayBox(cboxes, k); + cbox = hypre_BoxArrayBox(cboxes, k); hypre_IntersectBoxes(©_box, cbox, ©_box); if (hypre_BoxVolume(©_box)) { - cfbox_mapping[i][k]= j; - fcbox_mapping[i][j]= k; + cfbox_mapping[i][k] = j; + fcbox_mapping[i][j] = k; k++; } /* if (hypre_BoxVolume(©_box)) */ } /* hypre_ForBoxI(j, fboxes) */ /* fill up the contracted box_array */ - contract_fedgeBoxes[i]= hypre_BoxArrayCreate(0, ndim); - Edge_cstarts[i]= hypre_TAlloc(hypre_Index, hypre_BoxArraySize(fboxes), HYPRE_MEMORY_HOST); - upper_shifts[i]= hypre_TAlloc(hypre_Index, hypre_BoxArraySize(fboxes), HYPRE_MEMORY_HOST); - lower_shifts[i]= hypre_TAlloc(hypre_Index, hypre_BoxArraySize(fboxes), HYPRE_MEMORY_HOST); + contract_fedgeBoxes[i] = hypre_BoxArrayCreate(0, ndim); + Edge_cstarts[i] = hypre_TAlloc(hypre_Index, hypre_BoxArraySize(fboxes), HYPRE_MEMORY_HOST); + upper_shifts[i] = hypre_TAlloc(hypre_Index, hypre_BoxArraySize(fboxes), HYPRE_MEMORY_HOST); + lower_shifts[i] = hypre_TAlloc(hypre_Index, hypre_BoxArraySize(fboxes), HYPRE_MEMORY_HOST); hypre_ForBoxI(j, fboxes) { - fbox= hypre_BoxArrayBox(fboxes, j); + fbox = hypre_BoxArrayBox(fboxes, j); /* contract the fbox to correspond to the correct cbox */ - cbox= hypre_BoxContraction(fbox, var_fgrid, rfactor); + cbox = hypre_BoxContraction(fbox, var_fgrid, rfactor); hypre_AppendBox(cbox, contract_fedgeBoxes[i]); /* record the offset mapping between the coarse cell index and the fine cell index */ hypre_ClearIndex(upper_shifts[i][j]); hypre_ClearIndex(lower_shifts[i][j]); - for (l= 0; l< ndim; l++) + for (l = 0; l < ndim; l++) { - m= hypre_BoxIMin(cbox)[l]; - p= m%rfactor[l]; + m = hypre_BoxIMin(cbox)[l]; + p = m % rfactor[l]; if (p > 0 && m > 0) { - upper_shifts[i][j][l]= p-1; - lower_shifts[i][j][l]= p-rfactor[l]; + upper_shifts[i][j][l] = p - 1; + lower_shifts[i][j][l] = p - rfactor[l]; } else { - upper_shifts[i][j][l]= rfactor[l]-p-1; - lower_shifts[i][j][l]=-p; + upper_shifts[i][j][l] = rfactor[l] - p - 1; + lower_shifts[i][j][l] = -p; } } @@ -468,27 +472,27 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, /* variable rank bounds for this processor */ n_CtoVbox = hypre_TAlloc(HYPRE_Int **, nparts, HYPRE_MEMORY_HOST); CtoVboxnums = hypre_TAlloc(HYPRE_Int ***, nparts, HYPRE_MEMORY_HOST); - for (part= 0; part< nparts; part++) + for (part = 0; part < nparts; part++) { hypre_SStructCellGridBoxNumMap(fgrid_edge, part, &n_CtoVbox[part], &CtoVboxnums[part]); } /* variable rank bounds for this processor */ - flower_ranks= hypre_TAlloc(HYPRE_BigInt *, nparts, HYPRE_MEMORY_HOST); - fupper_ranks= hypre_TAlloc(HYPRE_BigInt *, nparts, HYPRE_MEMORY_HOST); + flower_ranks = hypre_TAlloc(HYPRE_BigInt *, nparts, HYPRE_MEMORY_HOST); + fupper_ranks = hypre_TAlloc(HYPRE_BigInt *, nparts, HYPRE_MEMORY_HOST); - clower_ranks= hypre_TAlloc(HYPRE_BigInt *, nparts, HYPRE_MEMORY_HOST); - cupper_ranks= hypre_TAlloc(HYPRE_BigInt *, nparts, HYPRE_MEMORY_HOST); - for (part= 0; part< nparts; part++) + clower_ranks = hypre_TAlloc(HYPRE_BigInt *, nparts, HYPRE_MEMORY_HOST); + cupper_ranks = hypre_TAlloc(HYPRE_BigInt *, nparts, HYPRE_MEMORY_HOST); + for (part = 0; part < nparts; part++) { - flower_ranks[part]= hypre_CTAlloc(HYPRE_BigInt, tot_vars, HYPRE_MEMORY_HOST); - fupper_ranks[part]= hypre_CTAlloc(HYPRE_BigInt, tot_vars, HYPRE_MEMORY_HOST); + flower_ranks[part] = hypre_CTAlloc(HYPRE_BigInt, tot_vars, HYPRE_MEMORY_HOST); + fupper_ranks[part] = hypre_CTAlloc(HYPRE_BigInt, tot_vars, HYPRE_MEMORY_HOST); /* cell grid ranks */ - p_fgrid= hypre_SStructGridPGrid(fgrid_element, part); - var_fgrid= hypre_SStructPGridSGrid(p_fgrid, 0); - box_array= hypre_StructGridBoxes(var_fgrid); + p_fgrid = hypre_SStructGridPGrid(fgrid_element, part); + var_fgrid = hypre_SStructPGridSGrid(p_fgrid, 0); + box_array = hypre_StructGridBoxes(var_fgrid); fbox = hypre_BoxArrayBox(box_array, 0); hypre_CopyIndex(hypre_BoxIMin(fbox), findex); @@ -497,19 +501,19 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, hypre_SStructBoxManEntryGetGlobalRank(entry, findex, &flower_ranks[part][0], matrix_type); - fbox= hypre_BoxArrayBox(box_array, hypre_BoxArraySize(box_array)-1); + fbox = hypre_BoxArrayBox(box_array, hypre_BoxArraySize(box_array) - 1); hypre_CopyIndex(hypre_BoxIMax(fbox), findex); hypre_SStructGridFindBoxManEntry(fgrid_edge, part, findex, 0, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, findex, &fupper_ranks[part][0], matrix_type); - clower_ranks[part]= hypre_CTAlloc(HYPRE_BigInt, tot_vars, HYPRE_MEMORY_HOST); - cupper_ranks[part]= hypre_CTAlloc(HYPRE_BigInt, tot_vars, HYPRE_MEMORY_HOST); + clower_ranks[part] = hypre_CTAlloc(HYPRE_BigInt, tot_vars, HYPRE_MEMORY_HOST); + cupper_ranks[part] = hypre_CTAlloc(HYPRE_BigInt, tot_vars, HYPRE_MEMORY_HOST); - p_cgrid= hypre_SStructGridPGrid(cgrid_element, part); - var_cgrid= hypre_SStructPGridSGrid(p_cgrid, 0); - box_array= hypre_StructGridBoxes(var_cgrid); + p_cgrid = hypre_SStructGridPGrid(cgrid_element, part); + var_cgrid = hypre_SStructPGridSGrid(p_cgrid, 0); + box_array = hypre_StructGridBoxes(var_cgrid); cbox = hypre_BoxArrayBox(box_array, 0); hypre_CopyIndex(hypre_BoxIMin(cbox), cindex); @@ -518,7 +522,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &clower_ranks[part][0], matrix_type); - cbox= hypre_BoxArrayBox(box_array, hypre_BoxArraySize(box_array)-1); + cbox = hypre_BoxArrayBox(box_array, hypre_BoxArraySize(box_array) - 1); hypre_CopyIndex(hypre_BoxIMax(cbox), cindex); hypre_SStructGridFindBoxManEntry(cgrid_edge, part, cindex, 0, &entry); @@ -526,16 +530,16 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, matrix_type); /* face grid ranks */ - p_fgrid= hypre_SStructGridPGrid(fgrid_face, part); - p_cgrid= hypre_SStructGridPGrid(cgrid_face, part); + p_fgrid = hypre_SStructGridPGrid(fgrid_face, part); + p_cgrid = hypre_SStructGridPGrid(cgrid_face, part); nvars = hypre_SStructPGridNVars(p_fgrid); - vartypes= hypre_SStructPGridVarTypes(p_cgrid); + vartypes = hypre_SStructPGridVarTypes(p_cgrid); - for (i= 0; i< nvars; i++) + for (i = 0; i < nvars; i++) { - t= vartypes[i]; - var_fgrid= hypre_SStructPGridSGrid(p_fgrid, i); - box_array= hypre_StructGridBoxes(var_fgrid); + t = vartypes[i]; + var_fgrid = hypre_SStructPGridSGrid(p_fgrid, i); + box_array = hypre_StructGridBoxes(var_fgrid); fbox = hypre_BoxArrayBox(box_array, 0); hypre_CopyIndex(hypre_BoxIMin(fbox), findex); @@ -544,15 +548,15 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, hypre_SStructBoxManEntryGetGlobalRank(entry, findex, &flower_ranks[part][t], matrix_type); - fbox= hypre_BoxArrayBox(box_array, hypre_BoxArraySize(box_array)-1); + fbox = hypre_BoxArrayBox(box_array, hypre_BoxArraySize(box_array) - 1); hypre_CopyIndex(hypre_BoxIMax(fbox), findex); hypre_SStructGridFindBoxManEntry(fgrid_face, part, findex, i, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, findex, &fupper_ranks[part][t], matrix_type); - var_cgrid= hypre_SStructPGridSGrid(p_cgrid, i); - box_array= hypre_StructGridBoxes(var_cgrid); + var_cgrid = hypre_SStructPGridSGrid(p_cgrid, i); + box_array = hypre_StructGridBoxes(var_cgrid); cbox = hypre_BoxArrayBox(box_array, 0); hypre_CopyIndex(hypre_BoxIMin(cbox), cindex); hypre_SStructGridFindBoxManEntry(cgrid_face, part, cindex, i, @@ -560,7 +564,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &clower_ranks[part][t], matrix_type); - cbox= hypre_BoxArrayBox(box_array, hypre_BoxArraySize(box_array)-1); + cbox = hypre_BoxArrayBox(box_array, hypre_BoxArraySize(box_array) - 1); hypre_CopyIndex(hypre_BoxIMax(cbox), cindex); hypre_SStructGridFindBoxManEntry(cgrid_face, part, cindex, i, &entry); @@ -568,16 +572,16 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, matrix_type); } /* edge grid ranks */ - p_fgrid= hypre_SStructGridPGrid(fgrid_edge, part); - p_cgrid= hypre_SStructGridPGrid(cgrid_edge, part); + p_fgrid = hypre_SStructGridPGrid(fgrid_edge, part); + p_cgrid = hypre_SStructGridPGrid(cgrid_edge, part); nvars = hypre_SStructPGridNVars(p_fgrid); - vartypes= hypre_SStructPGridVarTypes(p_cgrid); + vartypes = hypre_SStructPGridVarTypes(p_cgrid); - for (i= 0; i< nvars; i++) + for (i = 0; i < nvars; i++) { - t= vartypes[i]; - var_fgrid= hypre_SStructPGridSGrid(p_fgrid, i); - box_array= hypre_StructGridBoxes(var_fgrid); + t = vartypes[i]; + var_fgrid = hypre_SStructPGridSGrid(p_fgrid, i); + box_array = hypre_StructGridBoxes(var_fgrid); fbox = hypre_BoxArrayBox(box_array, 0); hypre_CopyIndex(hypre_BoxIMin(fbox), findex); @@ -586,15 +590,15 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, hypre_SStructBoxManEntryGetGlobalRank(entry, findex, &flower_ranks[part][t], matrix_type); - fbox= hypre_BoxArrayBox(box_array, hypre_BoxArraySize(box_array)-1); + fbox = hypre_BoxArrayBox(box_array, hypre_BoxArraySize(box_array) - 1); hypre_CopyIndex(hypre_BoxIMax(fbox), findex); hypre_SStructGridFindBoxManEntry(fgrid_edge, part, findex, i, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, findex, &fupper_ranks[part][t], matrix_type); - var_cgrid= hypre_SStructPGridSGrid(p_cgrid, i); - box_array= hypre_StructGridBoxes(var_cgrid); + var_cgrid = hypre_SStructPGridSGrid(p_cgrid, i); + box_array = hypre_StructGridBoxes(var_cgrid); cbox = hypre_BoxArrayBox(box_array, 0); hypre_CopyIndex(hypre_BoxIMin(cbox), cindex); hypre_SStructGridFindBoxManEntry(cgrid_edge, part, cindex, i, @@ -602,7 +606,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &clower_ranks[part][t], matrix_type); - cbox= hypre_BoxArrayBox(box_array, hypre_BoxArraySize(box_array)-1); + cbox = hypre_BoxArrayBox(box_array, hypre_BoxArraySize(box_array) - 1); hypre_CopyIndex(hypre_BoxIMax(cbox), cindex); hypre_SStructGridFindBoxManEntry(cgrid_edge, part, cindex, i, &entry); @@ -618,12 +622,12 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, /* Element_iedge- same for 2-d and 3-d */ /* lower rank */ - part= 0; + part = 0; box = 0; hypre_SStructGridBoxProcFindBoxManEntry(cgrid_element, part, 0, box, myproc, &entry); p_cgrid = hypre_SStructGridPGrid(cgrid_element, part); - var_cgrid= hypre_SStructPGridCellSGrid(p_cgrid) ; + var_cgrid = hypre_SStructPGridCellSGrid(p_cgrid) ; cboxes = hypre_StructGridBoxes(var_cgrid); cbox = hypre_BoxArrayBox(cboxes, 0); hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMin(cbox), &ilower); @@ -631,30 +635,30 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, p_fgrid = hypre_SStructGridPGrid(fgrid_edge, part); hypre_SStructGridBoxProcFindBoxManEntry(fgrid_edge, part, 0, box, myproc, &entry); - var_fgrid= hypre_SStructPGridSGrid(p_fgrid, 0); + var_fgrid = hypre_SStructPGridSGrid(p_fgrid, 0); fboxes = hypre_StructGridBoxes(var_fgrid); fbox = hypre_BoxArrayBox(fboxes, 0); hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMin(fbox), &jlower); /* upper rank */ - part= nparts-1; + part = nparts - 1; p_cgrid = hypre_SStructGridPGrid(cgrid_element, part); - var_cgrid= hypre_SStructPGridCellSGrid(p_cgrid) ; + var_cgrid = hypre_SStructPGridCellSGrid(p_cgrid) ; cboxes = hypre_StructGridBoxes(var_cgrid); - cbox = hypre_BoxArrayBox(cboxes, hypre_BoxArraySize(cboxes)-1); + cbox = hypre_BoxArrayBox(cboxes, hypre_BoxArraySize(cboxes) - 1); - hypre_SStructGridBoxProcFindBoxManEntry(cgrid_element, part, 0, hypre_BoxArraySize(cboxes)-1, + hypre_SStructGridBoxProcFindBoxManEntry(cgrid_element, part, 0, hypre_BoxArraySize(cboxes) - 1, myproc, &entry); hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMax(cbox), &iupper); p_fgrid = hypre_SStructGridPGrid(fgrid_edge, part); nvars = hypre_SStructPGridNVars(p_fgrid); - var_fgrid= hypre_SStructPGridSGrid(p_fgrid, nvars-1); + var_fgrid = hypre_SStructPGridSGrid(p_fgrid, nvars - 1); fboxes = hypre_StructGridBoxes(var_fgrid); - fbox = hypre_BoxArrayBox(fboxes, hypre_BoxArraySize(fboxes)-1); + fbox = hypre_BoxArrayBox(fboxes, hypre_BoxArraySize(fboxes) - 1); - hypre_SStructGridBoxProcFindBoxManEntry(fgrid_edge, part, nvars-1, hypre_BoxArraySize(fboxes)-1, + hypre_SStructGridBoxProcFindBoxManEntry(fgrid_edge, part, nvars - 1, hypre_BoxArraySize(fboxes) - 1, myproc, &entry); hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMax(fbox), &jupper); @@ -666,40 +670,40 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, * truncated edges are not), we use the ranks determined by the Edge/edge grids. * Same for 2-d and 3-d. */ /* lower rank */ - part= 0; + part = 0; box = 0; hypre_SStructGridBoxProcFindBoxManEntry(cgrid_edge, part, 0, box, myproc, &entry); p_cgrid = hypre_SStructGridPGrid(cgrid_edge, part); - var_cgrid= hypre_SStructPGridSGrid(p_cgrid, 0); + var_cgrid = hypre_SStructPGridSGrid(p_cgrid, 0); cboxes = hypre_StructGridBoxes(var_cgrid); cbox = hypre_BoxArrayBox(cboxes, 0); hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMin(cbox), &ilower); hypre_SStructGridBoxProcFindBoxManEntry(fgrid_edge, part, 0, box, myproc, &entry); p_fgrid = hypre_SStructGridPGrid(fgrid_edge, part); - var_fgrid= hypre_SStructPGridSGrid(p_fgrid, 0); + var_fgrid = hypre_SStructPGridSGrid(p_fgrid, 0); fboxes = hypre_StructGridBoxes(var_fgrid); fbox = hypre_BoxArrayBox(fboxes, 0); hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMin(fbox), &jlower); /* upper rank */ - part= nparts-1; + part = nparts - 1; p_cgrid = hypre_SStructGridPGrid(cgrid_edge, part); nvars = hypre_SStructPGridNVars(p_cgrid); - var_cgrid= hypre_SStructPGridSGrid(p_cgrid, nvars-1); + var_cgrid = hypre_SStructPGridSGrid(p_cgrid, nvars - 1); cboxes = hypre_StructGridBoxes(var_cgrid); - cbox = hypre_BoxArrayBox(cboxes, hypre_BoxArraySize(cboxes)-1); - hypre_SStructGridBoxProcFindBoxManEntry(cgrid_edge, part, nvars-1, - hypre_BoxArraySize(cboxes)-1, myproc, &entry); + cbox = hypre_BoxArrayBox(cboxes, hypre_BoxArraySize(cboxes) - 1); + hypre_SStructGridBoxProcFindBoxManEntry(cgrid_edge, part, nvars - 1, + hypre_BoxArraySize(cboxes) - 1, myproc, &entry); hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMax(cbox), &iupper); p_fgrid = hypre_SStructGridPGrid(fgrid_edge, part); nvars = hypre_SStructPGridNVars(p_fgrid); - var_fgrid= hypre_SStructPGridSGrid(p_fgrid, nvars-1); + var_fgrid = hypre_SStructPGridSGrid(p_fgrid, nvars - 1); fboxes = hypre_StructGridBoxes(var_fgrid); - fbox = hypre_BoxArrayBox(fboxes, hypre_BoxArraySize(fboxes)-1); - hypre_SStructGridBoxProcFindBoxManEntry(fgrid_edge, part, nvars-1, - hypre_BoxArraySize(fboxes)-1, myproc, &entry); + fbox = hypre_BoxArrayBox(fboxes, hypre_BoxArraySize(fboxes) - 1); + hypre_SStructGridBoxProcFindBoxManEntry(fgrid_edge, part, nvars - 1, + hypre_BoxArraySize(fboxes) - 1, myproc, &entry); hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMax(fbox), &jupper); HYPRE_IJMatrixCreate(comm, ilower, iupper, jlower, jupper, &Edge_iedge); @@ -708,90 +712,90 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, /* edge_Edge. Same for 2-d and 3-d. */ /* lower rank */ - part= 0; + part = 0; box = 0; hypre_SStructGridBoxProcFindBoxManEntry(fgrid_edge, part, 0, box, myproc, &entry); p_fgrid = hypre_SStructGridPGrid(fgrid_edge, part); - var_fgrid= hypre_SStructPGridSGrid(p_fgrid, 0); + var_fgrid = hypre_SStructPGridSGrid(p_fgrid, 0); fboxes = hypre_StructGridBoxes(var_fgrid); fbox = hypre_BoxArrayBox(fboxes, 0); hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMin(fbox), &ilower); hypre_SStructGridBoxProcFindBoxManEntry(cgrid_edge, part, 0, box, myproc, &entry); p_cgrid = hypre_SStructGridPGrid(cgrid_edge, part); - var_cgrid= hypre_SStructPGridSGrid(p_cgrid, 0); + var_cgrid = hypre_SStructPGridSGrid(p_cgrid, 0); cboxes = hypre_StructGridBoxes(var_cgrid); cbox = hypre_BoxArrayBox(cboxes, 0); hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMin(cbox), &jlower); /* upper rank */ - part= nparts-1; + part = nparts - 1; p_fgrid = hypre_SStructGridPGrid(fgrid_edge, part); nvars = hypre_SStructPGridNVars(p_fgrid); - var_fgrid= hypre_SStructPGridSGrid(p_fgrid, nvars-1); + var_fgrid = hypre_SStructPGridSGrid(p_fgrid, nvars - 1); fboxes = hypre_StructGridBoxes(var_fgrid); - fbox = hypre_BoxArrayBox(fboxes, hypre_BoxArraySize(fboxes)-1); + fbox = hypre_BoxArrayBox(fboxes, hypre_BoxArraySize(fboxes) - 1); - hypre_SStructGridBoxProcFindBoxManEntry(fgrid_edge, part, nvars-1, - hypre_BoxArraySize(fboxes)-1, myproc, &entry); + hypre_SStructGridBoxProcFindBoxManEntry(fgrid_edge, part, nvars - 1, + hypre_BoxArraySize(fboxes) - 1, myproc, &entry); hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMax(fbox), &iupper); p_cgrid = hypre_SStructGridPGrid(cgrid_edge, part); nvars = hypre_SStructPGridNVars(p_cgrid); - var_cgrid= hypre_SStructPGridSGrid(p_cgrid, nvars-1); + var_cgrid = hypre_SStructPGridSGrid(p_cgrid, nvars - 1); cboxes = hypre_StructGridBoxes(var_cgrid); - cbox = hypre_BoxArrayBox(cboxes, hypre_BoxArraySize(cboxes)-1); + cbox = hypre_BoxArrayBox(cboxes, hypre_BoxArraySize(cboxes) - 1); - hypre_SStructGridBoxProcFindBoxManEntry(cgrid_edge, part, nvars-1, - hypre_BoxArraySize(cboxes)-1, myproc, &entry); + hypre_SStructGridBoxProcFindBoxManEntry(cgrid_edge, part, nvars - 1, + hypre_BoxArraySize(cboxes) - 1, myproc, &entry); hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMax(cbox), &jupper); HYPRE_IJMatrixCreate(comm, ilower, iupper, jlower, jupper, &edge_Edge); - HYPRE_IJMatrixSetObjectType(edge_Edge , HYPRE_PARCSR); + HYPRE_IJMatrixSetObjectType(edge_Edge, HYPRE_PARCSR); HYPRE_IJMatrixInitialize(edge_Edge); /* Face_iedge. Only needed in 3-d. */ if (ndim == 3) { /* lower rank */ - part= 0; + part = 0; box = 0; hypre_SStructGridBoxProcFindBoxManEntry(cgrid_face, part, 0, box, myproc, &entry); p_cgrid = hypre_SStructGridPGrid(cgrid_face, part); - var_cgrid= hypre_SStructPGridSGrid(p_cgrid, 0); + var_cgrid = hypre_SStructPGridSGrid(p_cgrid, 0); cboxes = hypre_StructGridBoxes(var_cgrid); cbox = hypre_BoxArrayBox(cboxes, 0); hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMin(cbox), &ilower); hypre_SStructGridBoxProcFindBoxManEntry(fgrid_edge, part, 0, box, myproc, &entry); p_fgrid = hypre_SStructGridPGrid(fgrid_edge, part); - var_fgrid= hypre_SStructPGridSGrid(p_fgrid, 0); + var_fgrid = hypre_SStructPGridSGrid(p_fgrid, 0); fboxes = hypre_StructGridBoxes(var_fgrid); fbox = hypre_BoxArrayBox(fboxes, 0); hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMin(fbox), &jlower); /* upper rank */ - part= nparts-1; + part = nparts - 1; p_cgrid = hypre_SStructGridPGrid(cgrid_face, part); nvars = hypre_SStructPGridNVars(p_cgrid); - var_cgrid= hypre_SStructPGridSGrid(p_cgrid, nvars-1); + var_cgrid = hypre_SStructPGridSGrid(p_cgrid, nvars - 1); cboxes = hypre_StructGridBoxes(var_cgrid); - cbox = hypre_BoxArrayBox(cboxes, hypre_BoxArraySize(cboxes)-1); + cbox = hypre_BoxArrayBox(cboxes, hypre_BoxArraySize(cboxes) - 1); - hypre_SStructGridBoxProcFindBoxManEntry(cgrid_face, part, nvars-1, - hypre_BoxArraySize(cboxes)-1, myproc, &entry); + hypre_SStructGridBoxProcFindBoxManEntry(cgrid_face, part, nvars - 1, + hypre_BoxArraySize(cboxes) - 1, myproc, &entry); hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMax(cbox), &iupper); p_fgrid = hypre_SStructGridPGrid(fgrid_edge, part); nvars = hypre_SStructPGridNVars(p_fgrid); - var_fgrid= hypre_SStructPGridSGrid(p_fgrid, nvars-1); + var_fgrid = hypre_SStructPGridSGrid(p_fgrid, nvars - 1); fboxes = hypre_StructGridBoxes(var_fgrid); - fbox = hypre_BoxArrayBox(fboxes, hypre_BoxArraySize(fboxes)-1); + fbox = hypre_BoxArrayBox(fboxes, hypre_BoxArraySize(fboxes) - 1); - hypre_SStructGridBoxProcFindBoxManEntry(fgrid_edge, part, nvars-1, - hypre_BoxArraySize(fboxes)-1, myproc, &entry); + hypre_SStructGridBoxProcFindBoxManEntry(fgrid_edge, part, nvars - 1, + hypre_BoxArraySize(fboxes) - 1, myproc, &entry); hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMax(fbox), &jupper); HYPRE_IJMatrixCreate(comm, ilower, iupper, jlower, jupper, &Face_iedge); @@ -803,13 +807,13 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, /* lower rank */ if (ndim == 3) { - part= 0; + part = 0; box = 0; hypre_SStructGridBoxProcFindBoxManEntry(cgrid_element, part, 0, box, myproc, &entry); p_cgrid = hypre_SStructGridPGrid(cgrid_element, part); - var_cgrid= hypre_SStructPGridSGrid(p_cgrid, 0); + var_cgrid = hypre_SStructPGridSGrid(p_cgrid, 0); cboxes = hypre_StructGridBoxes(var_cgrid); cbox = hypre_BoxArrayBox(cboxes, 0); hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMin(cbox), &ilower); @@ -817,31 +821,31 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, hypre_SStructGridBoxProcFindBoxManEntry(cgrid_face, part, 0, box, myproc, &entry); p_cgrid = hypre_SStructGridPGrid(cgrid_face, part); - var_cgrid= hypre_SStructPGridSGrid(p_cgrid, 0); + var_cgrid = hypre_SStructPGridSGrid(p_cgrid, 0); cboxes = hypre_StructGridBoxes(var_cgrid); cbox = hypre_BoxArrayBox(cboxes, 0); hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMin(cbox), &jlower); /* upper rank */ - part= nparts-1; + part = nparts - 1; p_cgrid = hypre_SStructGridPGrid(cgrid_element, part); nvars = hypre_SStructPGridNVars(p_cgrid); - var_cgrid= hypre_SStructPGridSGrid(p_cgrid, nvars-1); + var_cgrid = hypre_SStructPGridSGrid(p_cgrid, nvars - 1); cboxes = hypre_StructGridBoxes(var_cgrid); - cbox = hypre_BoxArrayBox(cboxes, hypre_BoxArraySize(cboxes)-1); + cbox = hypre_BoxArrayBox(cboxes, hypre_BoxArraySize(cboxes) - 1); - hypre_SStructGridBoxProcFindBoxManEntry(cgrid_element, part, nvars-1, - hypre_BoxArraySize(cboxes)-1, myproc, &entry); + hypre_SStructGridBoxProcFindBoxManEntry(cgrid_element, part, nvars - 1, + hypre_BoxArraySize(cboxes) - 1, myproc, &entry); hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMax(cbox), &iupper); p_cgrid = hypre_SStructGridPGrid(cgrid_face, part); nvars = hypre_SStructPGridNVars(p_cgrid); - var_cgrid= hypre_SStructPGridSGrid(p_cgrid, nvars-1); + var_cgrid = hypre_SStructPGridSGrid(p_cgrid, nvars - 1); cboxes = hypre_StructGridBoxes(var_cgrid); - cbox = hypre_BoxArrayBox(cboxes, hypre_BoxArraySize(cboxes)-1); + cbox = hypre_BoxArrayBox(cboxes, hypre_BoxArraySize(cboxes) - 1); - hypre_SStructGridBoxProcFindBoxManEntry(cgrid_face, part, nvars-1, - hypre_BoxArraySize(cboxes)-1, myproc, &entry); + hypre_SStructGridBoxProcFindBoxManEntry(cgrid_face, part, nvars - 1, + hypre_BoxArraySize(cboxes) - 1, myproc, &entry); hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMax(cbox), &jupper); HYPRE_IJMatrixCreate(comm, ilower, iupper, jlower, jupper, &Element_Face); @@ -851,43 +855,43 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, /* Element_Edge. Same for 2-d and 3-d. */ /* lower rank */ - part= 0; + part = 0; box = 0; hypre_SStructGridBoxProcFindBoxManEntry(cgrid_element, part, 0, box, myproc, &entry); p_cgrid = hypre_SStructGridPGrid(cgrid_element, part); - var_cgrid= hypre_SStructPGridSGrid(p_cgrid, 0); + var_cgrid = hypre_SStructPGridSGrid(p_cgrid, 0); cboxes = hypre_StructGridBoxes(var_cgrid); cbox = hypre_BoxArrayBox(cboxes, 0); hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMin(cbox), &ilower); hypre_SStructGridBoxProcFindBoxManEntry(cgrid_edge, part, 0, box, myproc, &entry); p_cgrid = hypre_SStructGridPGrid(cgrid_edge, part); - var_cgrid= hypre_SStructPGridSGrid(p_cgrid, 0); + var_cgrid = hypre_SStructPGridSGrid(p_cgrid, 0); cboxes = hypre_StructGridBoxes(var_cgrid); cbox = hypre_BoxArrayBox(cboxes, 0); hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMin(cbox), &jlower); /* upper rank */ - part= nparts-1; + part = nparts - 1; p_cgrid = hypre_SStructGridPGrid(cgrid_element, part); nvars = hypre_SStructPGridNVars(p_cgrid); - var_cgrid= hypre_SStructPGridSGrid(p_cgrid, nvars-1); + var_cgrid = hypre_SStructPGridSGrid(p_cgrid, nvars - 1); cboxes = hypre_StructGridBoxes(var_cgrid); - cbox = hypre_BoxArrayBox(cboxes, hypre_BoxArraySize(cboxes)-1); + cbox = hypre_BoxArrayBox(cboxes, hypre_BoxArraySize(cboxes) - 1); - hypre_SStructGridBoxProcFindBoxManEntry(cgrid_element, part, nvars-1, - hypre_BoxArraySize(cboxes)-1, myproc, &entry); + hypre_SStructGridBoxProcFindBoxManEntry(cgrid_element, part, nvars - 1, + hypre_BoxArraySize(cboxes) - 1, myproc, &entry); hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMax(cbox), &iupper); p_cgrid = hypre_SStructGridPGrid(cgrid_edge, part); nvars = hypre_SStructPGridNVars(p_cgrid); - var_cgrid= hypre_SStructPGridSGrid(p_cgrid, nvars-1); + var_cgrid = hypre_SStructPGridSGrid(p_cgrid, nvars - 1); cboxes = hypre_StructGridBoxes(var_cgrid); - cbox = hypre_BoxArrayBox(cboxes, hypre_BoxArraySize(cboxes)-1); + cbox = hypre_BoxArrayBox(cboxes, hypre_BoxArraySize(cboxes) - 1); - hypre_SStructGridBoxProcFindBoxManEntry(cgrid_edge, part, nvars-1, - hypre_BoxArraySize(cboxes)-1, myproc, &entry); + hypre_SStructGridBoxProcFindBoxManEntry(cgrid_edge, part, nvars - 1, + hypre_BoxArraySize(cboxes) - 1, myproc, &entry); hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMax(cbox), &jupper); HYPRE_IJMatrixCreate(comm, ilower, iupper, jlower, jupper, &Element_Edge); @@ -902,39 +906,39 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, * Need to distinguish between 2 and 3-d. */ if (ndim == 3) { - n_xFace_iedges= (rfactor[1]-1)*rfactor[2] + (rfactor[2]-1)*rfactor[1]; - n_yFace_iedges= (rfactor[0]-1)*rfactor[2] + (rfactor[2]-1)*rfactor[0]; - n_zFace_iedges= (rfactor[1]-1)*rfactor[0] + (rfactor[0]-1)*rfactor[1]; - n_Cell_iedges = (rfactor[2]-1)*n_zFace_iedges + - rfactor[2]*(rfactor[0]-1)*(rfactor[1]-1); - - nFaces_iedges = nxFaces*n_xFace_iedges + nyFaces*n_yFace_iedges + - nzFaces*n_zFace_iedges; - nElements_iedges= nElements * n_Cell_iedges; + n_xFace_iedges = (rfactor[1] - 1) * rfactor[2] + (rfactor[2] - 1) * rfactor[1]; + n_yFace_iedges = (rfactor[0] - 1) * rfactor[2] + (rfactor[2] - 1) * rfactor[0]; + n_zFace_iedges = (rfactor[1] - 1) * rfactor[0] + (rfactor[0] - 1) * rfactor[1]; + n_Cell_iedges = (rfactor[2] - 1) * n_zFace_iedges + + rfactor[2] * (rfactor[0] - 1) * (rfactor[1] - 1); + + nFaces_iedges = nxFaces * n_xFace_iedges + nyFaces * n_yFace_iedges + + nzFaces * n_zFace_iedges; + nElements_iedges = nElements * n_Cell_iedges; } else { - n_Cell_iedges = (rfactor[0]-1)*rfactor[1] + (rfactor[1]-1)*rfactor[0]; - nElements_iedges= nElements * n_Cell_iedges; + n_Cell_iedges = (rfactor[0] - 1) * rfactor[1] + (rfactor[1] - 1) * rfactor[0]; + nElements_iedges = nElements * n_Cell_iedges; } if (ndim == 3) { - iFace = hypre_CTAlloc(HYPRE_BigInt, nFaces, HYPRE_MEMORY_DEVICE); + iFace = hypre_CTAlloc(HYPRE_BigInt, nFaces, memory_location); } - iEdge = hypre_CTAlloc(HYPRE_BigInt, nEdges, HYPRE_MEMORY_DEVICE); - iElement = hypre_CTAlloc(HYPRE_BigInt, nElements, HYPRE_MEMORY_DEVICE); + iEdge = hypre_CTAlloc(HYPRE_BigInt, nEdges, memory_location); + iElement = hypre_CTAlloc(HYPRE_BigInt, nElements, memory_location); /* array structures needed for forming ij_matrices */ /* Element_edge. Same for 2-d and 3-d. */ - ncols_Elementedge= hypre_CTAlloc(HYPRE_Int, nElements, HYPRE_MEMORY_DEVICE); - for (i= 0; i< nElements; i++) + ncols_Elementedge = hypre_CTAlloc(HYPRE_Int, nElements, memory_location); + for (i = 0; i < nElements; i++) { - ncols_Elementedge[i]= n_Cell_iedges; + ncols_Elementedge[i] = n_Cell_iedges; } - jElement_edge = hypre_CTAlloc(HYPRE_BigInt, nElements_iedges, HYPRE_MEMORY_DEVICE); - vals_Elementedge = hypre_CTAlloc(HYPRE_Real, nElements_iedges, HYPRE_MEMORY_DEVICE); + jElement_edge = hypre_CTAlloc(HYPRE_BigInt, nElements_iedges, memory_location); + vals_Elementedge = hypre_CTAlloc(HYPRE_Real, nElements_iedges, memory_location); /*--------------------------------------------------------------------------- * Fill up the row/column ranks of Element_edge. Will need to distinguish @@ -949,21 +953,21 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, * corresponding to the coarse box. * b) loop map these fine cells and find the ranks of the fine edges. *---------------------------------------------------------------------------*/ - nElements= 0; - nElements_iedges= 0; - for (part= 0; part< nparts; part++) + nElements = 0; + nElements_iedges = 0; + for (part = 0; part < nparts; part++) { if (ndim == 3) { - p_cgrid = hypre_SStructGridPGrid(cgrid_edge, part); /* Edge grid */ - Edge_nvars = hypre_SStructPGridNVars(p_cgrid); - Edge_vartypes= hypre_SStructPGridVarTypes(p_cgrid); + p_cgrid = hypre_SStructGridPGrid(cgrid_edge, part); /* Edge grid */ + Edge_nvars = hypre_SStructPGridNVars(p_cgrid); + Edge_vartypes = hypre_SStructPGridVarTypes(p_cgrid); } else if (ndim == 2) /* edge is a face in 2-d*/ { - p_cgrid = hypre_SStructGridPGrid(cgrid_face, part); /* Face grid */ - Face_nvars = hypre_SStructPGridNVars(p_cgrid); - Face_vartypes= hypre_SStructPGridVarTypes(p_cgrid); + p_cgrid = hypre_SStructGridPGrid(cgrid_face, part); /* Face grid */ + Face_nvars = hypre_SStructPGridNVars(p_cgrid); + Face_vartypes = hypre_SStructPGridVarTypes(p_cgrid); } p_cgrid = hypre_SStructGridPGrid(cgrid_element, part); /* ccell grid */ @@ -976,13 +980,13 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, hypre_ForBoxI(i, cboxes) { - cbox= hypre_BoxArrayBox(cboxes, i); + cbox = hypre_BoxArrayBox(cboxes, i); hypre_BoxGetSize(cbox, loop_size); hypre_CopyIndex(hypre_BoxIMin(cbox), cstart); /* determine which fine box cbox has coarsened from. Obtained from cfbox_mapping. */ - fboxi= cfbox_mapping[part][i]; + fboxi = cfbox_mapping[part][i]; fbox = hypre_BoxArrayBox(fboxes, fboxi); /********************************************************************** @@ -1010,20 +1014,20 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, /* Element(i,j,k) rank */ hypre_SStructGridFindBoxManEntry(cgrid_element, part, cindex, 0, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, matrix_type); - iElement[nElements]= rank; + iElement[nElements] = rank; nElements++; /* Element_iedge columns: 3-d, x_edges, y_edges, and z_edges. */ if (ndim == 3) { - hypre_SetIndex3(low_index, findex[0]-rfactor[0]+1, - findex[1]-rfactor[1]+1, - findex[2]-rfactor[2]+1); + hypre_SetIndex3(low_index, findex[0] - rfactor[0] + 1, + findex[1] - rfactor[1] + 1, + findex[2] - rfactor[2] + 1); - for (t= 0; t< Edge_nvars; t++) + for (t = 0; t < Edge_nvars; t++) { hypre_CopyIndex(findex, hi_index); - var= Edge_vartypes[t]; /* c & f edges enumerated the same */ + var = Edge_vartypes[t]; /* c & f edges enumerated the same */ /* determine looping extents over the refined cells that will have fine edges. */ @@ -1031,37 +1035,37 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, { case 5: /* x_edges */ { - hi_index[1]-= 1; - hi_index[2]-= 1; + hi_index[1] -= 1; + hi_index[2] -= 1; break; } case 6: /* y_edges */ { - hi_index[0]-= 1; - hi_index[2]-= 1; + hi_index[0] -= 1; + hi_index[2] -= 1; break; } case 7: /* z_edges */ { - hi_index[0]-= 1; - hi_index[1]-= 1; + hi_index[0] -= 1; + hi_index[1] -= 1; break; } } /* switch (var) */ /* column ranks. */ - for (m= low_index[2]; m<= hi_index[2]; m++) + for (m = low_index[2]; m <= hi_index[2]; m++) { - for (k= low_index[1]; k<= hi_index[1]; k++) + for (k = low_index[1]; k <= hi_index[1]; k++) { - for (j= low_index[0]; j<= hi_index[0]; j++) + for (j = low_index[0]; j <= hi_index[0]; j++) { hypre_SetIndex3(var_index, j, k, m); hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jElement_edge[nElements_iedges]= rank; + jElement_edge[nElements_iedges] = rank; nElements_iedges++; } /* for (j= findex[0]; j<= hi_index[0]; j++) */ } /* for (k= findex[1]; k<= hi_index[1]; k++) */ @@ -1071,40 +1075,40 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, else if (ndim == 2) /* only x & y faces */ { - hypre_SetIndex3(low_index, findex[0]-rfactor[0]+1, - findex[1]-rfactor[1]+1, + hypre_SetIndex3(low_index, findex[0] - rfactor[0] + 1, + findex[1] - rfactor[1] + 1, findex[2]); - for (t= 0; t< Face_nvars; t++) + for (t = 0; t < Face_nvars; t++) { hypre_CopyIndex(findex, hi_index); - var= Face_vartypes[t]; /* c & f faces enumerated the same */ + var = Face_vartypes[t]; /* c & f faces enumerated the same */ switch (var) /* note: hi_index computed differently in 2-d */ { case 2: /* x_faces */ { - hi_index[0]-= 1; + hi_index[0] -= 1; break; } case 3: /* y_edges */ { - hi_index[1]-= 1; + hi_index[1] -= 1; break; } } /* switch (var) */ /* column ranks. */ - for (k= low_index[1]; k<= hi_index[1]; k++) + for (k = low_index[1]; k <= hi_index[1]; k++) { - for (j= low_index[0]; j<= hi_index[0]; j++) + for (j = low_index[0]; j <= hi_index[0]; j++) { hypre_SetIndex3(var_index, j, k, findex[2]); hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jElement_edge[nElements_iedges]= rank; + jElement_edge[nElements_iedges] = rank; nElements_iedges++; } /* for (j= findex[0]; j<= hi_index[0]; j++) */ } /* for (k= findex[1]; k<= hi_index[1]; k++) */ @@ -1120,9 +1124,9 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, (const HYPRE_Real*) vals_Elementedge); HYPRE_IJMatrixAssemble((HYPRE_IJMatrix) Element_iedge); - hypre_TFree(ncols_Elementedge, HYPRE_MEMORY_DEVICE); - hypre_TFree(jElement_edge, HYPRE_MEMORY_DEVICE); - hypre_TFree(vals_Elementedge, HYPRE_MEMORY_DEVICE); + hypre_TFree(ncols_Elementedge, memory_location); + hypre_TFree(jElement_edge, memory_location); + hypre_TFree(vals_Elementedge, memory_location); /* Face_edge */ /*------------------------------------------------------------------------------ @@ -1135,84 +1139,84 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, *------------------------------------------------------------------------------*/ if (ndim == 3) { - ncols_Faceedge = hypre_CTAlloc(HYPRE_Int, nFaces, HYPRE_MEMORY_DEVICE); - nFaces= 0; - j= 0; - for (part= 0; part< nparts; part++) + ncols_Faceedge = hypre_CTAlloc(HYPRE_Int, nFaces, memory_location); + nFaces = 0; + j = 0; + for (part = 0; part < nparts; part++) { p_cgrid = hypre_SStructGridPGrid(cgrid_face, part); /* Face grid */ Face_nvars = hypre_SStructPGridNVars(p_cgrid); - Face_vartypes= hypre_SStructPGridVarTypes(p_cgrid); + Face_vartypes = hypre_SStructPGridVarTypes(p_cgrid); p_fgrid = hypre_SStructGridPGrid(fgrid_edge, part); var_fgrid = hypre_SStructPGridCellSGrid(p_fgrid); fboxes = hypre_StructGridBoxes(var_fgrid); - for (t= 0; t< Face_nvars; t++) + for (t = 0; t < Face_nvars; t++) { - var= Face_vartypes[t]; - var_cgrid= hypre_SStructPGridSGrid(p_cgrid, t); - k= hypre_StructGridLocalSize(var_cgrid); + var = Face_vartypes[t]; + var_cgrid = hypre_SStructPGridSGrid(p_cgrid, t); + k = hypre_StructGridLocalSize(var_cgrid); - switch(var) + switch (var) { case 2: /* x_Faces (i,j,k) then (i-1,j,k), contain y,z edges */ { - for (i= 0; i< k; i++) + for (i = 0; i < k; i++) { /* y_iedge connections to x_Face */ - ncols_Faceedge[nFaces]= (rfactor[2]-1)*rfactor[1]; + ncols_Faceedge[nFaces] = (rfactor[2] - 1) * rfactor[1]; /* z_iedge connections to x_Face */ - ncols_Faceedge[nFaces]+= rfactor[2]*(rfactor[1]-1); + ncols_Faceedge[nFaces] += rfactor[2] * (rfactor[1] - 1); - j+= ncols_Faceedge[nFaces]; + j += ncols_Faceedge[nFaces]; nFaces++; } break; - } /* case 2 */ + } /* case 2 */ case 3: /* y_Faces (i,j,k) then (i,j-1,k), contain x,z edges */ { - for (i= 0; i< k; i++) + for (i = 0; i < k; i++) { /* x_iedge connections to y_Face */ - ncols_Faceedge[nFaces]= (rfactor[2]-1)*rfactor[0]; + ncols_Faceedge[nFaces] = (rfactor[2] - 1) * rfactor[0]; /* z_iedge connections to y_Face */ - ncols_Faceedge[nFaces]+= rfactor[2]*(rfactor[0]-1); + ncols_Faceedge[nFaces] += rfactor[2] * (rfactor[0] - 1); - j+= ncols_Faceedge[nFaces]; + j += ncols_Faceedge[nFaces]; nFaces++; } break; - } /* case 3 */ + } /* case 3 */ case 4: /* z_Faces (i,j,k) then (i,j,k-1), contain x,y edges */ { - for (i= 0; i< k; i++) + for (i = 0; i < k; i++) { /* x_iedge connections to z_Face */ - ncols_Faceedge[nFaces]= (rfactor[1]-1)*rfactor[0]; + ncols_Faceedge[nFaces] = (rfactor[1] - 1) * rfactor[0]; /* y_iedge connections to z_Face */ - ncols_Faceedge[nFaces]+= rfactor[1]*(rfactor[0]-1); + ncols_Faceedge[nFaces] += rfactor[1] * (rfactor[0] - 1); - j+= ncols_Faceedge[nFaces]; + j += ncols_Faceedge[nFaces]; nFaces++; } break; - } /* case 4 */ + } /* case 4 */ } /* switch(var) */ } /* for (t= 0; t< Face_nvars; t++) */ } /* for (part= 0; part< nparts; part++) */ - jFace_edge = hypre_CTAlloc(HYPRE_BigInt, j, HYPRE_MEMORY_DEVICE); - vals_Faceedge = hypre_CTAlloc(HYPRE_Real, j, HYPRE_MEMORY_DEVICE); - for (i= 0; i< j; i++) + jFace_edge = hypre_CTAlloc(HYPRE_BigInt, j, memory_location); + vals_Faceedge = hypre_CTAlloc(HYPRE_Real, j, memory_location); + for (i = 0; i < j; i++) { - vals_Faceedge[i]= 1.0; + vals_Faceedge[i] = 1.0; } /*--------------------------------------------------------------------------- @@ -1227,27 +1231,27 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, * d) map these fine cells to the fine edges. *---------------------------------------------------------------------------*/ nFaces = 0; - nFaces_iedges= 0; - for (part= 0; part< nparts; part++) + nFaces_iedges = 0; + for (part = 0; part < nparts; part++) { p_cgrid = hypre_SStructGridPGrid(cgrid_face, part); /* Face grid */ Face_nvars = hypre_SStructPGridNVars(p_cgrid); - Face_vartypes= hypre_SStructPGridVarTypes(p_cgrid); + Face_vartypes = hypre_SStructPGridVarTypes(p_cgrid); - for (t= 0; t< Face_nvars; t++) + for (t = 0; t < Face_nvars; t++) { - var= Face_vartypes[t]; + var = Face_vartypes[t]; var_cgrid = hypre_SStructPGridCellSGrid(p_cgrid); cboxes = hypre_StructGridBoxes(var_cgrid); /* to eliminate comparisons, take the switch outside of the loop. */ - switch(var) + switch (var) { case 2: /* x_Faces-> y_iedges, z_iedges */ { hypre_ForBoxI(i, cboxes) { - cbox= hypre_BoxArrayBox(cboxes, i); + cbox = hypre_BoxArrayBox(cboxes, i); hypre_CopyBox(cbox, ©_box); hypre_SubtractIndexes(hypre_BoxIMin(©_box), varoffsets[var], 3, hypre_BoxIMin(©_box)); @@ -1256,7 +1260,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, hypre_CopyIndex(hypre_BoxIMin(©_box), start); /* determine which fine box cbox has coarsened from */ - fboxi= cfbox_mapping[part][i]; + fboxi = cfbox_mapping[part][i]; fbox = hypre_BoxArrayBox(fboxes, fboxi); /********************************************************** @@ -1279,7 +1283,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, if ((rank <= cupper_ranks[part][var]) && (rank >= clower_ranks[part][var])) { - iFace[nFaces]= rank; + iFace[nFaces] = rank; nFaces++; /* transform face index to cell index */ @@ -1296,55 +1300,55 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, /* cell_index was refined to the upper fine index. Shift back to the lower end, subtract (rfactor-1). */ - for (j= 0; j< ndim; j++) + for (j = 0; j < ndim; j++) { - findex[j]-= rfactor[j]-1; + findex[j] -= rfactor[j] - 1; } /* y_iedges */ - ilower= findex[0]-1; - for (k= 0; k< rfactor[2]-1; k++) + ilower = findex[0] - 1; + for (k = 0; k < rfactor[2] - 1; k++) { - for (j= 0; j< rfactor[1]; j++) + for (j = 0; j < rfactor[1]; j++) { - hypre_SetIndex3(var_index, ilower, j+findex[1], k+findex[2]); + hypre_SetIndex3(var_index, ilower, j + findex[1], k + findex[2]); hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, vartype_map[6], &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jFace_edge[nFaces_iedges]= rank; + jFace_edge[nFaces_iedges] = rank; nFaces_iedges++; } } /* z_iedges */ - for (k= 0; k< rfactor[2]; k++) + for (k = 0; k < rfactor[2]; k++) { - for (j= 0; j< rfactor[1]-1; j++) + for (j = 0; j < rfactor[1] - 1; j++) { - hypre_SetIndex3(var_index, ilower, j+findex[1], k+findex[2]); + hypre_SetIndex3(var_index, ilower, j + findex[1], k + findex[2]); hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, vartype_map[7], &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jFace_edge[nFaces_iedges]= rank; + jFace_edge[nFaces_iedges] = rank; nFaces_iedges++; } } } /* if ((rank <= cupper_ranks[part][var]) && - (rank >= clower_ranks[part][var])) */ +(rank >= clower_ranks[part][var])) */ } hypre_SerialBoxLoop0End(); } /* hypre_ForBoxI(i, cboxes) */ break; - } /* case 2: x_Faces-> y_iedges, z_iedges */ + } /* case 2: x_Faces-> y_iedges, z_iedges */ case 3: /* y_Faces-> x_iedges, z_iedges */ { hypre_ForBoxI(i, cboxes) { - cbox= hypre_BoxArrayBox(cboxes, i); + cbox = hypre_BoxArrayBox(cboxes, i); hypre_CopyBox(cbox, ©_box); hypre_SubtractIndexes(hypre_BoxIMin(©_box), varoffsets[var], 3, hypre_BoxIMin(©_box)); @@ -1353,7 +1357,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, hypre_CopyIndex(hypre_BoxIMin(©_box), start); /* determine which fine box cbox has coarsened from */ - fboxi= cfbox_mapping[part][i]; + fboxi = cfbox_mapping[part][i]; fbox = hypre_BoxArrayBox(fboxes, fboxi); /********************************************************** @@ -1375,7 +1379,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, if ((rank <= cupper_ranks[part][var]) && (rank >= clower_ranks[part][var])) { - iFace[nFaces]= rank; + iFace[nFaces] = rank; nFaces++; /* transform face index to cell index */ @@ -1392,55 +1396,55 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, /* cell_index is refined to the upper fine index. Shift back to the lower end, subtract (rfactor-1). */ - for (j= 0; j< ndim; j++) + for (j = 0; j < ndim; j++) { - findex[j]-= rfactor[j]-1; + findex[j] -= rfactor[j] - 1; } /* x_iedges */ - ilower= findex[1]-1; - for (k= 0; k< rfactor[2]-1; k++) + ilower = findex[1] - 1; + for (k = 0; k < rfactor[2] - 1; k++) { - for (j= 0; j< rfactor[0]; j++) + for (j = 0; j < rfactor[0]; j++) { - hypre_SetIndex3(var_index, j+findex[0], ilower, k+findex[2]); + hypre_SetIndex3(var_index, j + findex[0], ilower, k + findex[2]); hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, vartype_map[5], &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jFace_edge[nFaces_iedges]= rank; + jFace_edge[nFaces_iedges] = rank; nFaces_iedges++; } } /* z_iedges */ - for (k= 0; k< rfactor[2]; k++) + for (k = 0; k < rfactor[2]; k++) { - for (j= 0; j< rfactor[0]-1; j++) + for (j = 0; j < rfactor[0] - 1; j++) { - hypre_SetIndex3(var_index, j+findex[0], ilower, k+findex[2]); + hypre_SetIndex3(var_index, j + findex[0], ilower, k + findex[2]); hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, vartype_map[7], &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jFace_edge[nFaces_iedges]= rank; + jFace_edge[nFaces_iedges] = rank; nFaces_iedges++; } } } /* if ((rank <= cupper_ranks[part][var]) && - (rank >= clower_ranks[part][var])) */ +(rank >= clower_ranks[part][var])) */ } hypre_SerialBoxLoop0End(); } /* hypre_ForBoxI(i, cboxes) */ break; - } /* case 3: y_Faces-> x_iedges, z_iedges */ + } /* case 3: y_Faces-> x_iedges, z_iedges */ case 4: /* z_Faces-> x_iedges, y_iedges */ { hypre_ForBoxI(i, cboxes) { - cbox= hypre_BoxArrayBox(cboxes, i); + cbox = hypre_BoxArrayBox(cboxes, i); hypre_CopyBox(cbox, ©_box); hypre_SubtractIndexes(hypre_BoxIMin(©_box), varoffsets[var], 3, hypre_BoxIMin(©_box)); @@ -1449,7 +1453,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, hypre_CopyIndex(hypre_BoxIMin(©_box), start); /* determine which fine box cbox has coarsened from */ - fboxi= cfbox_mapping[part][i]; + fboxi = cfbox_mapping[part][i]; fbox = hypre_BoxArrayBox(fboxes, fboxi); /********************************************************** @@ -1472,7 +1476,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, if ((rank <= cupper_ranks[part][var]) && (rank >= clower_ranks[part][var])) { - iFace[nFaces]= rank; + iFace[nFaces] = rank; nFaces++; /* transform face index to cell index */ @@ -1489,48 +1493,48 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, /* cell_index is refined to the upper fine index. Shift back to the lower end, subtract (rfactor-1). */ - for (j= 0; j< ndim; j++) + for (j = 0; j < ndim; j++) { - findex[j]-= rfactor[j]-1; + findex[j] -= rfactor[j] - 1; } /* x_iedges */ - ilower= findex[2]-1; - for (k= 0; k< rfactor[1]-1; k++) + ilower = findex[2] - 1; + for (k = 0; k < rfactor[1] - 1; k++) { - for (j= 0; j< rfactor[0]; j++) + for (j = 0; j < rfactor[0]; j++) { - hypre_SetIndex3(var_index, j+findex[0], k+findex[1], ilower); + hypre_SetIndex3(var_index, j + findex[0], k + findex[1], ilower); hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, vartype_map[5], &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jFace_edge[nFaces_iedges]= rank; + jFace_edge[nFaces_iedges] = rank; nFaces_iedges++; } } /* y_iedges */ - for (k= 0; k< rfactor[1]; k++) + for (k = 0; k < rfactor[1]; k++) { - for (j= 0; j< rfactor[0]-1; j++) + for (j = 0; j < rfactor[0] - 1; j++) { - hypre_SetIndex3(var_index, j+findex[0], k+findex[1], ilower); + hypre_SetIndex3(var_index, j + findex[0], k + findex[1], ilower); hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, vartype_map[6], &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jFace_edge[nFaces_iedges]= rank; + jFace_edge[nFaces_iedges] = rank; nFaces_iedges++; } } } /* if ((rank <= cupper_ranks[part][var]) && - (rank >= clower_ranks[part][var])) */ +(rank >= clower_ranks[part][var])) */ } hypre_SerialBoxLoop0End(); } /* hypre_ForBoxI(i, cboxes) */ break; - } /* case 4: z_Faces-> x_iedges, y_iedges */ + } /* case 4: z_Faces-> x_iedges, y_iedges */ } /* switch(var) */ } /* for (t= 0; t< Face_nvars; t++) */ @@ -1541,10 +1545,10 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, (const HYPRE_Real*) vals_Faceedge); HYPRE_IJMatrixAssemble((HYPRE_IJMatrix) Face_iedge); - hypre_TFree(ncols_Faceedge, HYPRE_MEMORY_DEVICE); - hypre_TFree(iFace, HYPRE_MEMORY_DEVICE); - hypre_TFree(jFace_edge, HYPRE_MEMORY_DEVICE); - hypre_TFree(vals_Faceedge, HYPRE_MEMORY_DEVICE); + hypre_TFree(ncols_Faceedge, memory_location); + hypre_TFree(iFace, memory_location); + hypre_TFree(jFace_edge, memory_location); + hypre_TFree(vals_Faceedge, memory_location); } /* if (ndim == 3) */ /* Edge_edge */ @@ -1552,72 +1556,77 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, * Count the Edge_edge connections. Will need to distinguish 2-d and 3-d. *------------------------------------------------------------------------------*/ /* nEdges should be correct for 2-d & 3-d */ - ncols_Edgeiedge= hypre_CTAlloc(HYPRE_Int, nEdges, HYPRE_MEMORY_DEVICE); + ncols_Edgeiedge = hypre_CTAlloc(HYPRE_Int, nEdges, memory_location); - nEdges= 0; - k= 0; - for (part= 0; part< nparts; part++) + nEdges = 0; + k = 0; + for (part = 0; part < nparts; part++) { /* Edge grid. In 2-d this will be the face grid, which is assumed to be in cgrid_edge. */ p_cgrid = hypre_SStructGridPGrid(cgrid_edge, part); - Edge_vartypes= hypre_SStructPGridVarTypes(p_cgrid); + Edge_vartypes = hypre_SStructPGridVarTypes(p_cgrid); Edge_nvars = hypre_SStructPGridNVars(p_cgrid); - for (t= 0; t< Edge_nvars; t++) + for (t = 0; t < Edge_nvars; t++) { - var= Edge_vartypes[t]; - var_cgrid= hypre_SStructPGridSGrid(p_cgrid, t); - j= hypre_StructGridLocalSize(var_cgrid); + var = Edge_vartypes[t]; + var_cgrid = hypre_SStructPGridSGrid(p_cgrid, t); + j = hypre_StructGridLocalSize(var_cgrid); - switch(var) + switch (var) { case 2: /* 2-d, x_Face */ { - m= rfactor[1]; + m = rfactor[1]; break; } case 3: /* 2-d, y_Face */ { - m= rfactor[0]; + m = rfactor[0]; break; } case 5: /* 3-d, x_Edge */ { - m= rfactor[0]; + m = rfactor[0]; break; } case 6: /* 3-d, y_Edge */ { - m= rfactor[1]; + m = rfactor[1]; break; } case 7: /* 3-d, z_Edge */ { - m= rfactor[2]; + m = rfactor[2]; break; } + + default: + { + m = 0; + } } - for (i= nEdges; i< nEdges+j; i++) /*fill in the column size for Edge */ + for (i = nEdges; i < nEdges + j; i++) /*fill in the column size for Edge */ { - ncols_Edgeiedge[i]= m; - k+= m; + ncols_Edgeiedge[i] = m; + k += m; } - nEdges+= j; + nEdges += j; } /* for (t= 0; t< Edge_nvars; t++) */ } /* for (part= 0; part< nparts; part++) */ - jEdge_iedge = hypre_CTAlloc(HYPRE_BigInt, k, HYPRE_MEMORY_DEVICE); - vals_Edgeiedge = hypre_CTAlloc(HYPRE_Real, k, HYPRE_MEMORY_DEVICE); - for (i= 0; i< k; i++) + jEdge_iedge = hypre_CTAlloc(HYPRE_BigInt, k, memory_location); + vals_Edgeiedge = hypre_CTAlloc(HYPRE_Real, k, memory_location); + for (i = 0; i < k; i++) { - vals_Edgeiedge[i]= 1.0; + vals_Edgeiedge[i] = 1.0; } /*--------------------------------------------------------------------------- @@ -1635,26 +1644,26 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, *---------------------------------------------------------------------------*/ nEdges = 0; - nEdges_iedges= 0; - for (part= 0; part< nparts; part++) + nEdges_iedges = 0; + for (part = 0; part < nparts; part++) { p_cgrid = hypre_SStructGridPGrid(cgrid_edge, part); - Edge_vartypes= hypre_SStructPGridVarTypes(p_cgrid); + Edge_vartypes = hypre_SStructPGridVarTypes(p_cgrid); Edge_nvars = hypre_SStructPGridNVars(p_cgrid); p_fgrid = hypre_SStructGridPGrid(fgrid_edge, part); var_fgrid = hypre_SStructPGridCellSGrid(p_fgrid); fboxes = hypre_StructGridBoxes(var_fgrid); - for (t= 0; t< Edge_nvars; t++) + for (t = 0; t < Edge_nvars; t++) { - var= Edge_vartypes[t]; - var_cgrid= hypre_SStructPGridCellSGrid(p_cgrid); + var = Edge_vartypes[t]; + var_cgrid = hypre_SStructPGridCellSGrid(p_cgrid); cboxes = hypre_StructGridBoxes(var_cgrid); hypre_ForBoxI(i, cboxes) { - cbox= hypre_BoxArrayBox(cboxes, i); + cbox = hypre_BoxArrayBox(cboxes, i); /*------------------------------------------------------------------- * extract the variable box by offsetting with var_offset. Note that @@ -1668,7 +1677,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, hypre_CopyIndex(hypre_BoxIMin(©_box), start); /* determine which fine box cbox has coarsened from */ - fboxi= cfbox_mapping[part][i]; + fboxi = cfbox_mapping[part][i]; fbox = hypre_BoxArrayBox(fboxes, fboxi); /********************************************************** @@ -1694,7 +1703,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, if ((rank <= cupper_ranks[part][var]) && (rank >= clower_ranks[part][var])) { - iEdge[nEdges]= rank; + iEdge[nEdges] = rank; nEdges++; hypre_AddIndexes(cindex, varoffsets[var], 3, cell_index); @@ -1706,24 +1715,24 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, /* cell_index is refined to the upper fine index. Shift back to the lower end, subtract (rfactor-1). */ - for (j= 0; j< ndim; j++) + for (j = 0; j < ndim; j++) { - findex[j]-= rfactor[j]-1; + findex[j] -= rfactor[j] - 1; } hypre_SubtractIndexes(findex, varoffsets[var], 3, var_index); - switch(var) + switch (var) { case 2: /* 2-d, x_face */ { - for (m= 0; m< rfactor[1]; m++) + for (m = 0; m < rfactor[1]; m++) { hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jEdge_iedge[nEdges_iedges]= rank; + jEdge_iedge[nEdges_iedges] = rank; nEdges_iedges++; /* increment the x component to get the next one in the @@ -1735,13 +1744,13 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, case 3: /* 2-d, y_face */ { - for (m= 0; m< rfactor[0]; m++) + for (m = 0; m < rfactor[0]; m++) { hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jEdge_iedge[nEdges_iedges]= rank; + jEdge_iedge[nEdges_iedges] = rank; nEdges_iedges++; /* increment the y component to get the next one in the @@ -1753,13 +1762,13 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, case 5: /* 3-d, x_edge */ { - for (m= 0; m< rfactor[0]; m++) + for (m = 0; m < rfactor[0]; m++) { hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jEdge_iedge[nEdges_iedges]= rank; + jEdge_iedge[nEdges_iedges] = rank; nEdges_iedges++; /* increment the x component to get the next one in the @@ -1771,13 +1780,13 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, case 6: /* 3-d, y_edge */ { - for (m= 0; m< rfactor[1]; m++) + for (m = 0; m < rfactor[1]; m++) { hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jEdge_iedge[nEdges_iedges]= rank; + jEdge_iedge[nEdges_iedges] = rank; nEdges_iedges++; /* increment the y component to get the next one in the @@ -1789,13 +1798,13 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, case 7: /* 3-d, z_edge */ { - for (m= 0; m< rfactor[2]; m++) + for (m = 0; m < rfactor[2]; m++) { hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jEdge_iedge[nEdges_iedges]= rank; + jEdge_iedge[nEdges_iedges] = rank; nEdges_iedges++; /* increment the z component to get the next one in the @@ -1820,42 +1829,42 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, (const HYPRE_Real*) vals_Edgeiedge); HYPRE_IJMatrixAssemble((HYPRE_IJMatrix) Edge_iedge); - hypre_TFree(ncols_Edgeiedge, HYPRE_MEMORY_DEVICE); - hypre_TFree(iEdge, HYPRE_MEMORY_DEVICE); - hypre_TFree(jEdge_iedge, HYPRE_MEMORY_DEVICE); - hypre_TFree(vals_Edgeiedge, HYPRE_MEMORY_DEVICE); + hypre_TFree(ncols_Edgeiedge, memory_location); + hypre_TFree(iEdge, memory_location); + hypre_TFree(jEdge_iedge, memory_location); + hypre_TFree(vals_Edgeiedge, memory_location); /* Element_Face & Element_Edge. Element_Face only for 3-d. */ if (ndim == 3) { - ncols_ElementFace = hypre_CTAlloc(HYPRE_Int, nElements, HYPRE_MEMORY_DEVICE); - j= 2*ndim; - for (i= 0; i< nElements; i++) + ncols_ElementFace = hypre_CTAlloc(HYPRE_Int, nElements, memory_location); + j = 2 * ndim; + for (i = 0; i < nElements; i++) { ncols_ElementFace[i] = j; /* 3-dim -> 6 */ } - j*= nElements; - jElement_Face = hypre_CTAlloc(HYPRE_BigInt, j, HYPRE_MEMORY_DEVICE); - vals_ElementFace = hypre_CTAlloc(HYPRE_Real, j, HYPRE_MEMORY_DEVICE); - for (i= 0; i< j; i++) + j *= nElements; + jElement_Face = hypre_CTAlloc(HYPRE_BigInt, j, memory_location); + vals_ElementFace = hypre_CTAlloc(HYPRE_Real, j, memory_location); + for (i = 0; i < j; i++) { vals_ElementFace[i] = 1.0; } } - ncols_ElementEdge = hypre_CTAlloc(HYPRE_Int, nElements, HYPRE_MEMORY_DEVICE); - j= 2*ndim; - k= (ndim-1)*j; - for (i= 0; i< nElements; i++) + ncols_ElementEdge = hypre_CTAlloc(HYPRE_Int, nElements, memory_location); + j = 2 * ndim; + k = (ndim - 1) * j; + for (i = 0; i < nElements; i++) { ncols_ElementEdge[i] = k; /* 2-dim -> 4; 3-dim -> 12 */ } - k*= nElements; - jElement_Edge = hypre_CTAlloc(HYPRE_BigInt, k, HYPRE_MEMORY_DEVICE); - vals_ElementEdge= hypre_CTAlloc(HYPRE_Real, k, HYPRE_MEMORY_DEVICE); - for (i= 0; i< k; i++) + k *= nElements; + jElement_Edge = hypre_CTAlloc(HYPRE_BigInt, k, memory_location); + vals_ElementEdge = hypre_CTAlloc(HYPRE_Real, k, memory_location); + for (i = 0; i < k; i++) { vals_ElementEdge[i] = 1.0; } @@ -1864,21 +1873,21 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, * Fill up the column ranks of ELement_Face and Element_Edge. Note that the * iElement has alrady been formed when filling Element_edge. *---------------------------------------------------------------------------*/ - nElements_Faces= 0; - nElements_Edges= 0; - for (part= 0; part< nparts; part++) + nElements_Faces = 0; + nElements_Edges = 0; + for (part = 0; part < nparts; part++) { /* grab the nvars & vartypes for the face and edge variables */ if (ndim == 3) { p_cgrid = hypre_SStructGridPGrid(cgrid_face, part); Face_nvars = hypre_SStructPGridNVars(p_cgrid); - Face_vartypes= hypre_SStructPGridVarTypes(p_cgrid); + Face_vartypes = hypre_SStructPGridVarTypes(p_cgrid); } p_cgrid = hypre_SStructGridPGrid(cgrid_edge, part); /* Edge grid */ Edge_nvars = hypre_SStructPGridNVars(p_cgrid); - Edge_vartypes= hypre_SStructPGridVarTypes(p_cgrid); + Edge_vartypes = hypre_SStructPGridVarTypes(p_cgrid); p_cgrid = hypre_SStructGridPGrid(cgrid_element, part); /* cell grid */ var_cgrid = hypre_SStructPGridCellSGrid(p_cgrid); @@ -1888,7 +1897,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, { hypre_ForBoxI(i, cboxes) { - cbox= hypre_BoxArrayBox(cboxes, i); + cbox = hypre_BoxArrayBox(cboxes, i); hypre_BoxGetSize(cbox, loop_size); hypre_CopyIndex(hypre_BoxIMin(cbox), start); @@ -1901,15 +1910,15 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, /*------------------------------------------------------------- * jElement_Face: (i,j,k) then (i-1,j,k), (i,j-1,k), (i,j,k-1). *-------------------------------------------------------------*/ - for (t= 0; t< Face_nvars; t++) + for (t = 0; t < Face_nvars; t++) { - var= Face_vartypes[t]; + var = Face_vartypes[t]; hypre_SStructGridFindBoxManEntry(cgrid_face, part, cindex, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, matrix_type); - jElement_Face[nElements_Faces]= rank; + jElement_Face[nElements_Faces] = rank; nElements_Faces++; hypre_SubtractIndexes(cindex, varoffsets[var], 3, var_index); @@ -1917,7 +1926,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jElement_Face[nElements_Faces]= rank; + jElement_Face[nElements_Faces] = rank; nElements_Faces++; } @@ -1939,7 +1948,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, *-------------------------------------------------------------------*/ hypre_ForBoxI(i, cboxes) { - cbox= hypre_BoxArrayBox(cboxes, i); + cbox = hypre_BoxArrayBox(cboxes, i); hypre_BoxGetSize(cbox, loop_size); hypre_CopyIndex(hypre_BoxIMin(cbox), start); @@ -1949,10 +1958,10 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, hypre_SetIndex3(cindex, lindex[0], lindex[1], lindex[2]); hypre_AddIndexes(cindex, start, 3, cindex); - for (t= 0; t< Edge_nvars; t++) + for (t = 0; t < Edge_nvars; t++) { /* Edge (i,j,k) */ - var= Edge_vartypes[t]; + var = Edge_vartypes[t]; switch (var) { @@ -1962,7 +1971,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, matrix_type); - jElement_Edge[nElements_Edges]= rank; + jElement_Edge[nElements_Edges] = rank; nElements_Edges++; hypre_SubtractIndexes(cindex, ishift, 3, var_index); @@ -1970,7 +1979,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jElement_Edge[nElements_Edges]= rank; + jElement_Edge[nElements_Edges] = rank; nElements_Edges++; break; } @@ -1981,7 +1990,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, matrix_type); - jElement_Edge[nElements_Edges]= rank; + jElement_Edge[nElements_Edges] = rank; nElements_Edges++; hypre_SubtractIndexes(cindex, jshift, 3, var_index); @@ -1989,7 +1998,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jElement_Edge[nElements_Edges]= rank; + jElement_Edge[nElements_Edges] = rank; nElements_Edges++; break; } @@ -2000,7 +2009,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, matrix_type); - jElement_Edge[nElements_Edges]= rank; + jElement_Edge[nElements_Edges] = rank; nElements_Edges++; hypre_SubtractIndexes(cindex, jshift, 3, var_index); @@ -2008,7 +2017,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jElement_Edge[nElements_Edges]= rank; + jElement_Edge[nElements_Edges] = rank; nElements_Edges++; hypre_SubtractIndexes(var_index, kshift, 3, var_index); @@ -2016,7 +2025,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jElement_Edge[nElements_Edges]= rank; + jElement_Edge[nElements_Edges] = rank; nElements_Edges++; hypre_AddIndexes(var_index, jshift, 3, var_index); @@ -2024,7 +2033,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jElement_Edge[nElements_Edges]= rank; + jElement_Edge[nElements_Edges] = rank; nElements_Edges++; break; } @@ -2035,7 +2044,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, matrix_type); - jElement_Edge[nElements_Edges]= rank; + jElement_Edge[nElements_Edges] = rank; nElements_Edges++; hypre_SubtractIndexes(cindex, ishift, 3, var_index); @@ -2043,7 +2052,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jElement_Edge[nElements_Edges]= rank; + jElement_Edge[nElements_Edges] = rank; nElements_Edges++; hypre_SubtractIndexes(var_index, kshift, 3, var_index); @@ -2051,7 +2060,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jElement_Edge[nElements_Edges]= rank; + jElement_Edge[nElements_Edges] = rank; nElements_Edges++; hypre_AddIndexes(var_index, ishift, 3, var_index); @@ -2059,7 +2068,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jElement_Edge[nElements_Edges]= rank; + jElement_Edge[nElements_Edges] = rank; nElements_Edges++; break; } @@ -2070,7 +2079,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, matrix_type); - jElement_Edge[nElements_Edges]= rank; + jElement_Edge[nElements_Edges] = rank; nElements_Edges++; hypre_SubtractIndexes(cindex, jshift, 3, var_index); @@ -2078,7 +2087,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jElement_Edge[nElements_Edges]= rank; + jElement_Edge[nElements_Edges] = rank; nElements_Edges++; hypre_SubtractIndexes(var_index, ishift, 3, var_index); @@ -2086,7 +2095,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jElement_Edge[nElements_Edges]= rank; + jElement_Edge[nElements_Edges] = rank; nElements_Edges++; hypre_AddIndexes(var_index, jshift, 3, var_index); @@ -2094,7 +2103,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jElement_Edge[nElements_Edges]= rank; + jElement_Edge[nElements_Edges] = rank; nElements_Edges++; break; } @@ -2113,9 +2122,9 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, (const HYPRE_Real*) vals_ElementFace); HYPRE_IJMatrixAssemble((HYPRE_IJMatrix) Element_Face); - hypre_TFree(ncols_ElementFace, HYPRE_MEMORY_DEVICE); - hypre_TFree(jElement_Face, HYPRE_MEMORY_DEVICE); - hypre_TFree(vals_ElementFace, HYPRE_MEMORY_DEVICE); + hypre_TFree(ncols_ElementFace, memory_location); + hypre_TFree(jElement_Face, memory_location); + hypre_TFree(vals_ElementFace, memory_location); } /* if (ndim == 3) */ HYPRE_IJMatrixSetValues(Element_Edge, nElements, ncols_ElementEdge, @@ -2123,10 +2132,10 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, (const HYPRE_Real*) vals_ElementEdge); HYPRE_IJMatrixAssemble((HYPRE_IJMatrix) Element_Edge); - hypre_TFree(ncols_ElementEdge, HYPRE_MEMORY_DEVICE); - hypre_TFree(iElement, HYPRE_MEMORY_DEVICE); - hypre_TFree(jElement_Edge, HYPRE_MEMORY_DEVICE); - hypre_TFree(vals_ElementEdge, HYPRE_MEMORY_DEVICE); + hypre_TFree(ncols_ElementEdge, memory_location); + hypre_TFree(iElement, memory_location); + hypre_TFree(jElement_Edge, memory_location); + hypre_TFree(vals_ElementEdge, memory_location); /*----------------------------------------------------------------------- * edge_Edge, the actual interpolation matrix. @@ -2147,8 +2156,8 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, *-----------------------------------------------------------------------*/ /* count the row/col connections */ - iedgeEdge = hypre_CTAlloc(HYPRE_BigInt, nedges, HYPRE_MEMORY_DEVICE); - ncols_edgeEdge = hypre_CTAlloc(HYPRE_Int, nedges, HYPRE_MEMORY_DEVICE); + iedgeEdge = hypre_CTAlloc(HYPRE_BigInt, nedges, memory_location); + ncols_edgeEdge = hypre_CTAlloc(HYPRE_Int, nedges, memory_location); /*----------------------------------------------------------------------- * loop first over the fedges aligning with the agglomerate coarse edges. @@ -2159,29 +2168,29 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, * that points to the location of the weight: * pointer[rank of edge]= index location where weight resides. *-----------------------------------------------------------------------*/ - j= 0; - start_rank1= hypre_SStructGridStartRank(fgrid_edge); - bdryedge_location= hypre_CTAlloc(HYPRE_Int, nedges, HYPRE_MEMORY_HOST); - for (part= 0; part< nparts; part++) + j = 0; + start_rank1 = hypre_SStructGridStartRank(fgrid_edge); + bdryedge_location = hypre_CTAlloc(HYPRE_Int, nedges, HYPRE_MEMORY_HOST); + for (part = 0; part < nparts; part++) { - p_fgrid= hypre_SStructGridPGrid(fgrid_edge, part); /* edge grid */ - Edge_nvars= hypre_SStructPGridNVars(p_fgrid); - Edge_vartypes= hypre_SStructPGridVarTypes(p_fgrid); + p_fgrid = hypre_SStructGridPGrid(fgrid_edge, part); /* edge grid */ + Edge_nvars = hypre_SStructPGridNVars(p_fgrid); + Edge_vartypes = hypre_SStructPGridVarTypes(p_fgrid); /* note that fboxes are the contracted CELL boxes. Will get the correct variable grid extents. */ - fboxes= contract_fedgeBoxes[part]; + fboxes = contract_fedgeBoxes[part]; - for (t= 0; t< Edge_nvars; t++) + for (t = 0; t < Edge_nvars; t++) { var = Edge_vartypes[t]; var_fgrid = hypre_SStructPGridVTSGrid(p_fgrid, var); box_array = hypre_StructGridBoxes(var_fgrid); - n_boxoffsets= ndim-1; + n_boxoffsets = ndim - 1; boxoffset = hypre_CTAlloc(hypre_Index, n_boxoffsets, HYPRE_MEMORY_HOST); suboffset = hypre_CTAlloc(hypre_Index, n_boxoffsets, HYPRE_MEMORY_HOST); - switch(var) + switch (var) { case 2: /* 2-d: x_face (vertical edges), stride=[rfactor[0],1,1] */ { @@ -2189,7 +2198,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, hypre_CopyIndex(varoffsets[2], var_index); /* boxoffset shrink in the i direction */ - hypre_SetIndex3(boxoffset[0], rfactor[0]-1, 0, 0); + hypre_SetIndex3(boxoffset[0], rfactor[0] - 1, 0, 0); hypre_SetIndex3(suboffset[0], 1, 0, 0); /* extend loop_size by one in the stride direction */ @@ -2203,7 +2212,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, hypre_CopyIndex(varoffsets[3], var_index); /* boxoffset shrink in the j direction */ - hypre_SetIndex3(boxoffset[0], 0, rfactor[1]-1, 0); + hypre_SetIndex3(boxoffset[0], 0, rfactor[1] - 1, 0); hypre_SetIndex3(suboffset[0], 0, 1, 0); /* extend loop_size by one in the stride direction */ @@ -2217,8 +2226,8 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, hypre_CopyIndex(varoffsets[5], var_index); /* boxoffset shrink in the j & k directions */ - hypre_SetIndex3(boxoffset[0], 0, rfactor[1]-1, 0); - hypre_SetIndex3(boxoffset[1], 0, 0, rfactor[2]-1); + hypre_SetIndex3(boxoffset[0], 0, rfactor[1] - 1, 0); + hypre_SetIndex3(boxoffset[1], 0, 0, rfactor[2] - 1); hypre_SetIndex3(suboffset[0], 0, 1, 0); hypre_SetIndex3(suboffset[1], 0, 0, 1); @@ -2233,8 +2242,8 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, hypre_CopyIndex(varoffsets[6], var_index); /* boxoffset shrink in the i & k directions */ - hypre_SetIndex3(boxoffset[0], rfactor[0]-1, 0, 0); - hypre_SetIndex3(boxoffset[1], 0, 0, rfactor[2]-1); + hypre_SetIndex3(boxoffset[0], rfactor[0] - 1, 0, 0); + hypre_SetIndex3(boxoffset[1], 0, 0, rfactor[2] - 1); hypre_SetIndex3(suboffset[0], 1, 0, 0); hypre_SetIndex3(suboffset[1], 0, 0, 1); @@ -2249,8 +2258,8 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, hypre_CopyIndex(varoffsets[7], var_index); /* boxoffset shrink in the i & j directions */ - hypre_SetIndex3(boxoffset[0], rfactor[0]-1, 0, 0); - hypre_SetIndex3(boxoffset[1], 0, rfactor[1]-1, 0); + hypre_SetIndex3(boxoffset[0], rfactor[0] - 1, 0, 0); + hypre_SetIndex3(boxoffset[1], 0, rfactor[1] - 1, 0); hypre_SetIndex3(suboffset[0], 1, 0, 0); hypre_SetIndex3(suboffset[1], 0, 1, 0); @@ -2262,10 +2271,10 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, hypre_ForBoxI(i, fboxes) { - cellbox= hypre_BoxArrayBox(fboxes, i); + cellbox = hypre_BoxArrayBox(fboxes, i); /* vboxes inside the i'th cellbox */ - num_vboxes= n_CtoVbox[part][i]; + num_vboxes = n_CtoVbox[part][i]; vboxnums = CtoVboxnums[part][i]; /* adjust the project cellbox to the variable box */ @@ -2277,19 +2286,19 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, has to be decreased, then we decrease it by (rfactor[j]-1) in the appropriate direction. Check the location of the shifted lower box index. */ - for (k= 0; k< n_boxoffsets; k++) + for (k = 0; k < n_boxoffsets; k++) { hypre_SubtractIndexes(hypre_BoxIMin(©_box), suboffset[k], 3, findex); - row_in= falseV; - for (p= 0; p< num_vboxes[t]; p++) + row_in = falseV; + for (p = 0; p < num_vboxes[t]; p++) { - vbox= hypre_BoxArrayBox(box_array, vboxnums[t][p]); + vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); if (hypre_IndexInBox(findex, vbox)) { hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in= trueV; + row_in = trueV; break; } } @@ -2315,9 +2324,9 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, { zypre_BoxLoopGetIndex(lindex); hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - for (k= 0; k< 3; k++) + for (k = 0; k < 3; k++) { - findex[k]*= stride[k]; + findex[k] *= stride[k]; } hypre_AddIndexes(findex, start, 3, findex); @@ -2326,9 +2335,9 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, /* still row p may be outside the processor- check to make sure in */ if ((rank <= fupper_ranks[part][var]) && (rank >= flower_ranks[part][var])) { - iedgeEdge[j]= rank; - ncols_edgeEdge[j]= 1; - bdryedge_location[rank-start_rank1]= j; + iedgeEdge[j] = rank; + ncols_edgeEdge[j] = 1; + bdryedge_location[rank - start_rank1] = j; j++; } } @@ -2352,43 +2361,43 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, *-----------------------------------------------------------------------*/ if (ndim == 3) { - l= j; - for (part= 0; part< nparts; part++) + l = j; + for (part = 0; part < nparts; part++) { - p_fgrid= hypre_SStructGridPGrid(fgrid_edge, part); /* edge grid */ - Edge_nvars= hypre_SStructPGridNVars(p_fgrid); - Edge_vartypes= hypre_SStructPGridVarTypes(p_fgrid); + p_fgrid = hypre_SStructGridPGrid(fgrid_edge, part); /* edge grid */ + Edge_nvars = hypre_SStructPGridNVars(p_fgrid); + Edge_vartypes = hypre_SStructPGridVarTypes(p_fgrid); /* note that fboxes are the contracted CELL boxes. Will get the correct variable grid extents. */ - fboxes= contract_fedgeBoxes[part]; + fboxes = contract_fedgeBoxes[part]; /* may need to shrink a given box in some boxoffset directions */ - boxoffset= hypre_TAlloc(hypre_Index, ndim, HYPRE_MEMORY_HOST); - for (t= 0; t< ndim; t++) + boxoffset = hypre_TAlloc(hypre_Index, ndim, HYPRE_MEMORY_HOST); + for (t = 0; t < ndim; t++) { hypre_ClearIndex(boxoffset[t]); - hypre_IndexD(boxoffset[t], t)= rfactor[t]-1; + hypre_IndexD(boxoffset[t], t) = rfactor[t] - 1; } - for (t= 0; t< Edge_nvars; t++) + for (t = 0; t < Edge_nvars; t++) { var = Edge_vartypes[t]; - var_fgrid= hypre_SStructPGridVTSGrid(p_fgrid, var); - box_array= hypre_StructGridBoxes(var_fgrid); + var_fgrid = hypre_SStructPGridVTSGrid(p_fgrid, var); + box_array = hypre_StructGridBoxes(var_fgrid); /* to reduce comparison, take the switch outside of the loop */ - switch(var) + switch (var) { case 5: { /* 3-d x_edge, can be Y or Z_Face */ hypre_ForBoxI(i, fboxes) { - cellbox= hypre_BoxArrayBox(fboxes, i); + cellbox = hypre_BoxArrayBox(fboxes, i); /* vboxes inside the i'th cellbox */ - num_vboxes= n_CtoVbox[part][i]; + num_vboxes = n_CtoVbox[part][i]; vboxnums = CtoVboxnums[part][i]; /* adjust the contracted cellbox to the variable box */ @@ -2405,14 +2414,14 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, hypre_SubtractIndexes(hypre_BoxIMin(©_box), kshift, 3, findex); /* loop over all the vboxes to see if findex is inside */ - row_in= falseV; - for (p= 0; p< num_vboxes[t]; p++) + row_in = falseV; + for (p = 0; p < num_vboxes[t]; p++) { - vbox= hypre_BoxArrayBox(box_array, vboxnums[t][p]); + vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); if (hypre_IndexInBox(findex, vbox)) { hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in= trueV; + row_in = trueV; break; } } @@ -2438,20 +2447,20 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, { zypre_BoxLoopGetIndex(lindex); hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - for (k= 0; k< 3; k++) + for (k = 0; k < 3; k++) { - findex[k]*= rfactor[k]; + findex[k] *= rfactor[k]; } hypre_AddIndexes(findex, start, 3, findex); /************************************************************ * Loop over the Z_Face x_edges. ************************************************************/ - for (p= 0; p< rfactor[0]; p++) + for (p = 0; p < rfactor[0]; p++) { hypre_CopyIndex(findex, var_index); - var_index[0]+= p; - for (n= 1; n< rfactor[1]; n++) + var_index[0] += p; + for (n = 1; n < rfactor[1]; n++) { var_index[1]++; hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, @@ -2462,15 +2471,15 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, if ((rank <= fupper_ranks[part][var]) && (rank >= flower_ranks[part][var])) { - iedgeEdge[j]= rank; + iedgeEdge[j] = rank; /* Z_Face. Two coarse Edge connections. */ - ncols_edgeEdge[j]= 2; + ncols_edgeEdge[j] = 2; j++; /* record index location */ - bdryedge_location[rank-start_rank1]= l; - l+= 2; /* two weight values */ + bdryedge_location[rank - start_rank1] = l; + l += 2; /* two weight values */ } } /* for (n= 1; n< rfactor[1]; n++) */ } /* for (p= 0; p< rfactor[0]; p++) */ @@ -2482,14 +2491,14 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, hypre_SubtractIndexes(hypre_BoxIMin(©_box), jshift, 3, findex); /* loop over all the vboxes to see if findex is inside */ - row_in= falseV; - for (p= 0; p< num_vboxes[t]; p++) + row_in = falseV; + for (p = 0; p < num_vboxes[t]; p++) { - vbox= hypre_BoxArrayBox(box_array, vboxnums[t][p]); + vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); if (hypre_IndexInBox(findex, vbox)) { hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in= trueV; + row_in = trueV; break; } } @@ -2514,20 +2523,20 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, { zypre_BoxLoopGetIndex(lindex); hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - for (k= 0; k< 3; k++) + for (k = 0; k < 3; k++) { - findex[k]*= rfactor[k]; + findex[k] *= rfactor[k]; } hypre_AddIndexes(findex, start, 3, findex); /************************************************************ * Loop over the Y_Face x_edges. ************************************************************/ - for (p= 0; p< rfactor[0]; p++) + for (p = 0; p < rfactor[0]; p++) { hypre_CopyIndex(findex, var_index); - var_index[0]+= p; - for (n= 1; n< rfactor[2]; n++) + var_index[0] += p; + for (n = 1; n < rfactor[2]; n++) { var_index[2]++; hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, @@ -2537,15 +2546,15 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, if ((rank <= fupper_ranks[part][var]) && (rank >= flower_ranks[part][var])) { - iedgeEdge[j]= rank; + iedgeEdge[j] = rank; /* Y_Face. Two coarse Edge connections. */ - ncols_edgeEdge[j]= 2; + ncols_edgeEdge[j] = 2; j++; /* record index location */ - bdryedge_location[rank-start_rank1]= l; - l+= 2; + bdryedge_location[rank - start_rank1] = l; + l += 2; } } /* for (n= 1; n< rfactor[2]; n++) */ } /* for (p= 0; p< rfactor[0]; p++) */ @@ -2561,10 +2570,10 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, /* 3-d y_edge, can be X or Z_Face */ hypre_ForBoxI(i, fboxes) { - cellbox= hypre_BoxArrayBox(fboxes, i); + cellbox = hypre_BoxArrayBox(fboxes, i); /* vboxes inside the i'th cellbox */ - num_vboxes= n_CtoVbox[part][i]; + num_vboxes = n_CtoVbox[part][i]; vboxnums = CtoVboxnums[part][i]; /* adjust the project cellbox to the variable box */ @@ -2581,14 +2590,14 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, hypre_SubtractIndexes(hypre_BoxIMin(©_box), kshift, 3, findex); /* loop over all the vboxes to see if findex is inside */ - row_in= falseV; - for (p= 0; p< num_vboxes[t]; p++) + row_in = falseV; + for (p = 0; p < num_vboxes[t]; p++) { - vbox= hypre_BoxArrayBox(box_array, vboxnums[t][p]); + vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); if (hypre_IndexInBox(findex, vbox)) { hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in= trueV; + row_in = trueV; break; } } @@ -2616,18 +2625,18 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, zypre_BoxLoopGetIndex(lindex); hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - for (k= 0; k< 3; k++) + for (k = 0; k < 3; k++) { - findex[k]*= rfactor[k]; + findex[k] *= rfactor[k]; } hypre_AddIndexes(findex, start, 3, findex); /* Z_Face */ - for (p= 0; p< rfactor[1]; p++) + for (p = 0; p < rfactor[1]; p++) { hypre_CopyIndex(findex, var_index); - var_index[1]+= p; - for (n= 1; n< rfactor[0]; n++) + var_index[1] += p; + for (n = 1; n < rfactor[0]; n++) { var_index[0]++; hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, @@ -2637,15 +2646,15 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, if ((rank <= fupper_ranks[part][var]) && (rank >= flower_ranks[part][var])) { - iedgeEdge[j]= rank; + iedgeEdge[j] = rank; /* Z_Face. Two coarse Edge connections. */ - ncols_edgeEdge[j]= 2; + ncols_edgeEdge[j] = 2; j++; /* record index location */ - bdryedge_location[rank-start_rank1]= l; - l+= 2; + bdryedge_location[rank - start_rank1] = l; + l += 2; } } /* for (n= 1; n< rfactor[0]; n++) */ } /* for (p= 0; p< rfactor[1]; p++) */ @@ -2657,14 +2666,14 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, hypre_SubtractIndexes(hypre_BoxIMin(©_box), ishift, 3, findex); /* loop over all the vboxes to see if findex is inside */ - row_in= falseV; - for (p= 0; p< num_vboxes[t]; p++) + row_in = falseV; + for (p = 0; p < num_vboxes[t]; p++) { - vbox= hypre_BoxArrayBox(box_array, vboxnums[t][p]); + vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); if (hypre_IndexInBox(findex, vbox)) { hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in= trueV; + row_in = trueV; break; } } @@ -2690,20 +2699,20 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, { zypre_BoxLoopGetIndex(lindex); hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - for (k= 0; k< 3; k++) + for (k = 0; k < 3; k++) { - findex[k]*= rfactor[k]; + findex[k] *= rfactor[k]; } hypre_AddIndexes(findex, start, 3, findex); /***************************************************** * Loop over the X_Face y_edges. *****************************************************/ - for (p= 0; p< rfactor[1]; p++) + for (p = 0; p < rfactor[1]; p++) { hypre_CopyIndex(findex, var_index); - var_index[1]+= p; - for (n= 1; n< rfactor[2]; n++) + var_index[1] += p; + for (n = 1; n < rfactor[2]; n++) { var_index[2]++; hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, @@ -2713,14 +2722,14 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, if ((rank <= fupper_ranks[part][var]) && (rank >= flower_ranks[part][var])) { - iedgeEdge[j]= rank; + iedgeEdge[j] = rank; /* X_Face. Two coarse Edge connections. */ - ncols_edgeEdge[j]= 2; + ncols_edgeEdge[j] = 2; j++; /* record index location */ - bdryedge_location[rank-start_rank1]= l; - l+= 2; + bdryedge_location[rank - start_rank1] = l; + l += 2; } } /* for (n= 1; n< rfactor[2]; n++) */ } /* for (p= 0; p< rfactor[1]; p++) */ @@ -2736,10 +2745,10 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, /* 3-d z_edge, can be interior, X or Y_Face, or Z_Edge */ hypre_ForBoxI(i, fboxes) { - cellbox= hypre_BoxArrayBox(fboxes, i); + cellbox = hypre_BoxArrayBox(fboxes, i); /* vboxes inside the i'th cellbox */ - num_vboxes= n_CtoVbox[part][i]; + num_vboxes = n_CtoVbox[part][i]; vboxnums = CtoVboxnums[part][i]; /* adjust the project cellbox to the variable box */ @@ -2756,14 +2765,14 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, hypre_SubtractIndexes(hypre_BoxIMin(©_box), ishift, 3, findex); /* loop over all the vboxes to see if findex is inside */ - row_in= falseV; - for (p= 0; p< num_vboxes[t]; p++) + row_in = falseV; + for (p = 0; p < num_vboxes[t]; p++) { - vbox= hypre_BoxArrayBox(box_array, vboxnums[t][p]); + vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); if (hypre_IndexInBox(findex, vbox)) { hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in= trueV; + row_in = trueV; break; } } @@ -2791,9 +2800,9 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, zypre_BoxLoopGetIndex(lindex); hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - for (k= 0; k< 3; k++) + for (k = 0; k < 3; k++) { - findex[k]*= rfactor[k]; + findex[k] *= rfactor[k]; } hypre_AddIndexes(findex, start, 3, findex); @@ -2801,11 +2810,11 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, /****************************************************** * Loop over the X_Face z_edges. ******************************************************/ - for (p= 0; p< rfactor[2]; p++) + for (p = 0; p < rfactor[2]; p++) { hypre_CopyIndex(findex, var_index); - var_index[2]+= p; - for (n= 1; n< rfactor[1]; n++) + var_index[2] += p; + for (n = 1; n < rfactor[1]; n++) { var_index[1]++; hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, @@ -2815,15 +2824,15 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, if ((rank <= fupper_ranks[part][var]) && (rank >= flower_ranks[part][var])) { - iedgeEdge[j]= rank; + iedgeEdge[j] = rank; /* X_Face. Two coarse Edge connections. */ - ncols_edgeEdge[j]= 2; + ncols_edgeEdge[j] = 2; j++; /* record index location */ - bdryedge_location[rank-start_rank1]= l; - l+= 2; + bdryedge_location[rank - start_rank1] = l; + l += 2; } } /* for (n= 1; n< rfactor[1]; n++) */ } /* for (p= 0; p< rfactor[2]; p++) */ @@ -2836,14 +2845,14 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, hypre_SubtractIndexes(hypre_BoxIMin(©_box), jshift, 3, findex); /* loop over all the vboxes to see if findex is inside */ - row_in= falseV; - for (p= 0; p< num_vboxes[t]; p++) + row_in = falseV; + for (p = 0; p < num_vboxes[t]; p++) { - vbox= hypre_BoxArrayBox(box_array, vboxnums[t][p]); + vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); if (hypre_IndexInBox(findex, vbox)) { hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in= trueV; + row_in = trueV; break; } } @@ -2869,20 +2878,20 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, zypre_BoxLoopGetIndex(lindex); hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - for (k= 0; k< 3; k++) + for (k = 0; k < 3; k++) { - findex[k]*= rfactor[k]; + findex[k] *= rfactor[k]; } hypre_AddIndexes(findex, start, 3, findex); /**************************************************** * Loop over the Y_Face z_edges. ****************************************************/ - for (p= 0; p< rfactor[2]; p++) + for (p = 0; p < rfactor[2]; p++) { hypre_CopyIndex(findex, var_index); - var_index[2]+= p; - for (n= 1; n< rfactor[0]; n++) + var_index[2] += p; + for (n = 1; n < rfactor[0]; n++) { var_index[0]++; hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, @@ -2892,15 +2901,15 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, if ((rank <= fupper_ranks[part][var]) && (rank >= flower_ranks[part][var])) { - iedgeEdge[j]= rank; + iedgeEdge[j] = rank; /* Y_Face. Two coarse Edge connections. */ - ncols_edgeEdge[j]= 2; + ncols_edgeEdge[j] = 2; j++; /* record index location */ - bdryedge_location[rank-start_rank1]= l; - l+= 2; + bdryedge_location[rank - start_rank1] = l; + l += 2; } } /* for (n= 1; n< rfactor[0]; n++) */ } /* for (p= 0; p< rfactor[2]; p++) */ @@ -2918,31 +2927,31 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, } /* for (part= 0; part< nparts; part++) */ } /* if (ndim == 3) */ - for (part= 0; part< nparts; part++) + for (part = 0; part < nparts; part++) { - p_fgrid= hypre_SStructGridPGrid(fgrid_edge, part); /* edge grid */ - Edge_nvars= hypre_SStructPGridNVars(p_fgrid); - Edge_vartypes= hypre_SStructPGridVarTypes(p_fgrid); + p_fgrid = hypre_SStructGridPGrid(fgrid_edge, part); /* edge grid */ + Edge_nvars = hypre_SStructPGridNVars(p_fgrid); + Edge_vartypes = hypre_SStructPGridVarTypes(p_fgrid); /* note that fboxes are the contracted CELL boxes. Will get the correct variable grid extents. */ - fboxes= contract_fedgeBoxes[part]; + fboxes = contract_fedgeBoxes[part]; - for (t= 0; t< Edge_nvars; t++) + for (t = 0; t < Edge_nvars; t++) { var = Edge_vartypes[t]; - var_fgrid= hypre_SStructPGridVTSGrid(p_fgrid, var); - box_array= hypre_StructGridBoxes(var_fgrid); + var_fgrid = hypre_SStructPGridVTSGrid(p_fgrid, var); + box_array = hypre_StructGridBoxes(var_fgrid); /* to reduce comparison, take the switch outside of the loop */ - switch(var) + switch (var) { case 2: { /* 2-d x_face = x_edge, can be interior */ hypre_ForBoxI(i, fboxes) { - cellbox= hypre_BoxArrayBox(fboxes, i); + cellbox = hypre_BoxArrayBox(fboxes, i); vbox = hypre_BoxArrayBox(box_array, i); /* adjust the contracted cellbox to the variable box */ @@ -2960,27 +2969,27 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, { zypre_BoxLoopGetIndex(lindex); hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - for (k= 0; k< 3; k++) + for (k = 0; k < 3; k++) { - findex[k]*= rfactor[k]; + findex[k] *= rfactor[k]; } hypre_AddIndexes(findex, start, 3, findex); /* get interior edges */ - for (p= 1; p< rfactor[0]; p++) + for (p = 1; p < rfactor[0]; p++) { hypre_CopyIndex(findex, var_index); - var_index[0]+= p; - for (n= 0; n< rfactor[1]; n++) + var_index[0] += p; + for (n = 0; n < rfactor[1]; n++) { hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - iedgeEdge[j]= rank; + iedgeEdge[j] = rank; /* lies interior of Face. Four coarse Edge connection. */ - ncols_edgeEdge[j]= 4; + ncols_edgeEdge[j] = 4; j++; var_index[1]++; @@ -2998,7 +3007,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, /* 2-d y_face = y_edge, can be interior */ hypre_ForBoxI(i, fboxes) { - cellbox= hypre_BoxArrayBox(fboxes, i); + cellbox = hypre_BoxArrayBox(fboxes, i); vbox = hypre_BoxArrayBox(box_array, i); /* adjust the project cellbox to the variable box */ @@ -3017,28 +3026,28 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, zypre_BoxLoopGetIndex(lindex); hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - for (k= 0; k< 3; k++) + for (k = 0; k < 3; k++) { - findex[k]*= rfactor[k]; + findex[k] *= rfactor[k]; } hypre_AddIndexes(findex, start, 3, findex); /* get interior edges */ - for (p= 1; p< rfactor[1]; p++) + for (p = 1; p < rfactor[1]; p++) { hypre_CopyIndex(findex, var_index); - var_index[1]+= p; - for (n= 0; n< rfactor[0]; n++) + var_index[1] += p; + for (n = 0; n < rfactor[0]; n++) { hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - iedgeEdge[j]= rank; + iedgeEdge[j] = rank; /* lies interior of Face. Four coarse Edge connection. */ - ncols_edgeEdge[j]= 4; + ncols_edgeEdge[j] = 4; j++; var_index[0]++; @@ -3055,7 +3064,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, /* 3-d x_edge, can be only interior */ hypre_ForBoxI(i, fboxes) { - cellbox= hypre_BoxArrayBox(fboxes, i); + cellbox = hypre_BoxArrayBox(fboxes, i); vbox = hypre_BoxArrayBox(box_array, i); /* adjust the project cellbox to the variable box */ @@ -3073,42 +3082,42 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, { zypre_BoxLoopGetIndex(lindex); hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - for (k= 0; k< 3; k++) + for (k = 0; k < 3; k++) { - findex[k]*= rfactor[k]; + findex[k] *= rfactor[k]; } hypre_AddIndexes(findex, start, 3, findex); /* get interior edges */ - for (p= 1; p< rfactor[2]; p++) + for (p = 1; p < rfactor[2]; p++) { hypre_CopyIndex(findex, var_index); - var_index[2]+= p; - for (n= 1; n< rfactor[1]; n++) + var_index[2] += p; + for (n = 1; n < rfactor[1]; n++) { var_index[1]++; - for (k= 0; k< rfactor[0]; k++) + for (k = 0; k < rfactor[0]; k++) { hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - iedgeEdge[j]= rank; + iedgeEdge[j] = rank; /* Interior. Twelve coarse Edge connections. */ - ncols_edgeEdge[j]= 12; + ncols_edgeEdge[j] = 12; j++; var_index[0]++; } /* for (k= 0; k< rfactor[0]; k++) */ /* reset var_index[0] to the initial index for next k loop */ - var_index[0]-= rfactor[0]; + var_index[0] -= rfactor[0]; } /* for (n= 1; n< rfactor[1]; n++) */ /* reset var_index[1] to the initial index for next n loop */ - var_index[1]-= (rfactor[1]-1); + var_index[1] -= (rfactor[1] - 1); } /* for (p= 1; p< rfactor[2]; p++) */ } @@ -3122,7 +3131,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, /* 3-d y_edge, can be only interior */ hypre_ForBoxI(i, fboxes) { - cellbox= hypre_BoxArrayBox(fboxes, i); + cellbox = hypre_BoxArrayBox(fboxes, i); vbox = hypre_BoxArrayBox(box_array, i); /* adjust the contract cellbox to the variable box */ @@ -3140,42 +3149,42 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, { zypre_BoxLoopGetIndex(lindex); hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - for (k= 0; k< 3; k++) + for (k = 0; k < 3; k++) { - findex[k]*= rfactor[k]; + findex[k] *= rfactor[k]; } hypre_AddIndexes(findex, start, 3, findex); /* get interior edges */ - for (p= 1; p< rfactor[2]; p++) + for (p = 1; p < rfactor[2]; p++) { hypre_CopyIndex(findex, var_index); - var_index[2]+= p; - for (n= 1; n< rfactor[0]; n++) + var_index[2] += p; + for (n = 1; n < rfactor[0]; n++) { var_index[0]++; - for (k= 0; k< rfactor[1]; k++) + for (k = 0; k < rfactor[1]; k++) { hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - iedgeEdge[j]= rank; + iedgeEdge[j] = rank; /* Interior. Twelve coarse Edge connections. */ - ncols_edgeEdge[j]= 12; + ncols_edgeEdge[j] = 12; j++; var_index[1]++; } /* for (k= 0; k< rfactor[1]; k++) */ /* reset var_index[1] to the initial index for next k loop */ - var_index[1]-= rfactor[1]; + var_index[1] -= rfactor[1]; } /* for (n= 1; n< rfactor[0]; n++) */ /* reset var_index[0] to the initial index for next n loop */ - var_index[0]-= (rfactor[0]-1); + var_index[0] -= (rfactor[0] - 1); } /* for (p= 1; p< rfactor[2]; p++) */ } @@ -3190,7 +3199,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, /* 3-d z_edge, can be only interior */ hypre_ForBoxI(i, fboxes) { - cellbox= hypre_BoxArrayBox(fboxes, i); + cellbox = hypre_BoxArrayBox(fboxes, i); vbox = hypre_BoxArrayBox(box_array, i); /* adjust the contracted cellbox to the variable box */ @@ -3208,42 +3217,42 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, { zypre_BoxLoopGetIndex(lindex); hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - for (k= 0; k< 3; k++) + for (k = 0; k < 3; k++) { - findex[k]*= rfactor[k]; + findex[k] *= rfactor[k]; } hypre_AddIndexes(findex, start, 3, findex); /* get interior edges */ - for (p= 1; p< rfactor[1]; p++) + for (p = 1; p < rfactor[1]; p++) { hypre_CopyIndex(findex, var_index); - var_index[1]+= p; - for (n= 1; n< rfactor[0]; n++) + var_index[1] += p; + for (n = 1; n < rfactor[0]; n++) { var_index[0]++; - for (k= 0; k< rfactor[2]; k++) + for (k = 0; k < rfactor[2]; k++) { hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - iedgeEdge[j]= rank; + iedgeEdge[j] = rank; /* Interior. Twelve coarse Edge connections. */ - ncols_edgeEdge[j]= 12; + ncols_edgeEdge[j] = 12; j++; var_index[2]++; } /* for (k= 0; k< rfactor[2]; k++) */ /* reset var_index[2] to the initial index for next k loop */ - var_index[2]-= rfactor[2]; + var_index[2] -= rfactor[2]; } /* for (n= 1; n< rfactor[0]; n++) */ /* reset var_index[0] to the initial index for next n loop */ - var_index[0]-= (rfactor[0]-1); + var_index[0] -= (rfactor[0] - 1); } /* for (p= 1; p< rfactor[1]; p++) */ } @@ -3256,18 +3265,18 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, } /* for (t= 0; t< Edge_nvars; t++) */ } /* for (part= 0; part< nparts; part++) */ - k= 0; - j= 0; - for (i= 0; i< nedges; i++) + k = 0; + j = 0; + for (i = 0; i < nedges; i++) { if (ncols_edgeEdge[i]) { - k+= ncols_edgeEdge[i]; + k += ncols_edgeEdge[i]; j++; } } - vals_edgeEdge = hypre_CTAlloc(HYPRE_Real, k, HYPRE_MEMORY_DEVICE); - jedge_Edge = hypre_CTAlloc(HYPRE_BigInt, k, HYPRE_MEMORY_DEVICE); + vals_edgeEdge = hypre_CTAlloc(HYPRE_Real, k, memory_location); + jedge_Edge = hypre_CTAlloc(HYPRE_BigInt, k, memory_location); size1 = j; /********************************************************************* @@ -3285,37 +3294,37 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, *********************************************************************/ /* loop over fedges aligning with the agglomerate coarse edges first. */ - k= 0; - for (part= 0; part< nparts; part++) + k = 0; + for (part = 0; part < nparts; part++) { - p_fgrid= hypre_SStructGridPGrid(fgrid_edge, part); /* edge grid */ - Edge_nvars= hypre_SStructPGridNVars(p_fgrid); - Edge_vartypes= hypre_SStructPGridVarTypes(p_fgrid); - p_cgrid= hypre_SStructGridPGrid(cgrid_edge, part); /* Edge grid */ + p_fgrid = hypre_SStructGridPGrid(fgrid_edge, part); /* edge grid */ + Edge_nvars = hypre_SStructPGridNVars(p_fgrid); + Edge_vartypes = hypre_SStructPGridVarTypes(p_fgrid); + p_cgrid = hypre_SStructGridPGrid(cgrid_edge, part); /* Edge grid */ /* note that fboxes are the contracted CELL boxes. Will get the correct variable grid extents. */ - fboxes= contract_fedgeBoxes[part]; + fboxes = contract_fedgeBoxes[part]; - for (t= 0; t< Edge_nvars; t++) + for (t = 0; t < Edge_nvars; t++) { var = Edge_vartypes[t]; - var_fgrid= hypre_SStructPGridVTSGrid(p_fgrid, var); - box_array= hypre_StructGridBoxes(var_fgrid); + var_fgrid = hypre_SStructPGridVTSGrid(p_fgrid, var); + box_array = hypre_StructGridBoxes(var_fgrid); - n_boxoffsets= ndim-1; + n_boxoffsets = ndim - 1; boxoffset = hypre_CTAlloc(hypre_Index, n_boxoffsets, HYPRE_MEMORY_HOST); suboffset = hypre_CTAlloc(hypre_Index, n_boxoffsets, HYPRE_MEMORY_HOST); - switch(var) + switch (var) { case 2: /* 2-d: x_face (vertical edges), stride=[rfactor[0],1,1] fCedge_ratio= 1.0/rfactor[1] */ { hypre_SetIndex3(stride, rfactor[0], 1, 1); - fCedge_ratio= 1.0/rfactor[1]; + fCedge_ratio = 1.0 / rfactor[1]; /* boxoffset shrink in the i direction */ - hypre_SetIndex3(boxoffset[0], rfactor[0]-1, 0, 0); + hypre_SetIndex3(boxoffset[0], rfactor[0] - 1, 0, 0); hypre_SetIndex3(suboffset[0], 1, 0, 0); /* extend loop_size by one in the stride direction */ @@ -3327,10 +3336,10 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, fCedge_ratio= 1.0/rfactor[0] */ { hypre_SetIndex3(stride, 1, rfactor[1], 1); - fCedge_ratio= 1.0/rfactor[0]; + fCedge_ratio = 1.0 / rfactor[0]; /* boxoffset shrink in the j direction */ - hypre_SetIndex3(boxoffset[0], 0, rfactor[1]-1, 0); + hypre_SetIndex3(boxoffset[0], 0, rfactor[1] - 1, 0); hypre_SetIndex3(suboffset[0], 0, 1, 0); /* extend loop_size by one in the stride direction */ @@ -3342,11 +3351,11 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, fCedge_ratio= 1.0/rfactor[0] */ { hypre_SetIndex3(stride, 1, rfactor[1], rfactor[2]); - fCedge_ratio= 1.0/rfactor[0]; + fCedge_ratio = 1.0 / rfactor[0]; /* boxoffset shrink in the j & k directions */ - hypre_SetIndex3(boxoffset[0], 0, rfactor[1]-1, 0); - hypre_SetIndex3(boxoffset[1], 0, 0, rfactor[2]-1); + hypre_SetIndex3(boxoffset[0], 0, rfactor[1] - 1, 0); + hypre_SetIndex3(boxoffset[1], 0, 0, rfactor[2] - 1); hypre_SetIndex3(suboffset[0], 0, 1, 0); hypre_SetIndex3(suboffset[1], 0, 0, 1); @@ -3359,11 +3368,11 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, fCedge_ratio= 1.0/rfactor[1] */ { hypre_SetIndex3(stride, rfactor[0], 1, rfactor[2]); - fCedge_ratio= 1.0/rfactor[1]; + fCedge_ratio = 1.0 / rfactor[1]; /* boxoffset shrink in the i & k directions */ - hypre_SetIndex3(boxoffset[0], rfactor[0]-1, 0, 0); - hypre_SetIndex3(boxoffset[1], 0, 0, rfactor[2]-1); + hypre_SetIndex3(boxoffset[0], rfactor[0] - 1, 0, 0); + hypre_SetIndex3(boxoffset[1], 0, 0, rfactor[2] - 1); hypre_SetIndex3(suboffset[0], 1, 0, 0); hypre_SetIndex3(suboffset[1], 0, 0, 1); @@ -3376,11 +3385,11 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, fCedge_ratio= 1.0/rfactor[2] */ { hypre_SetIndex3(stride, rfactor[0], rfactor[1], 1); - fCedge_ratio= 1.0/rfactor[2]; + fCedge_ratio = 1.0 / rfactor[2]; /* boxoffset shrink in the i & j directions */ - hypre_SetIndex3(boxoffset[0], rfactor[0]-1, 0, 0); - hypre_SetIndex3(boxoffset[1], 0, rfactor[1]-1, 0); + hypre_SetIndex3(boxoffset[0], rfactor[0] - 1, 0, 0); + hypre_SetIndex3(boxoffset[1], 0, rfactor[1] - 1, 0); hypre_SetIndex3(suboffset[0], 1, 0, 0); hypre_SetIndex3(suboffset[1], 0, 1, 0); @@ -3388,14 +3397,18 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, hypre_SetIndex3(hi_index, 1, 1, 0); break; } + default: + { + fCedge_ratio = 1.0; + } } hypre_ForBoxI(i, fboxes) { - cellbox= hypre_BoxArrayBox(fboxes, i); + cellbox = hypre_BoxArrayBox(fboxes, i); /* vboxes inside the i'th cellbox */ - num_vboxes= n_CtoVbox[part][i]; + num_vboxes = n_CtoVbox[part][i]; vboxnums = CtoVboxnums[part][i]; hypre_CopyIndex(Edge_cstarts[part][i], cstart); @@ -3405,19 +3418,19 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, vanish. */ hypre_CopyBox(cellbox, ©_box); - for (j= 0; j< n_boxoffsets; j++) + for (j = 0; j < n_boxoffsets; j++) { hypre_SubtractIndexes(hypre_BoxIMin(©_box), suboffset[j], 3, findex); - row_in= falseV; - for (p= 0; p< num_vboxes[t]; p++) + row_in = falseV; + for (p = 0; p < num_vboxes[t]; p++) { - vbox= hypre_BoxArrayBox(box_array, vboxnums[t][p]); + vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); if (hypre_IndexInBox(findex, vbox)) { hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in= trueV; + row_in = trueV; break; } } @@ -3453,9 +3466,9 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, HYPRE_BigInt big_j; zypre_BoxLoopGetIndex(lindex); hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - for (j= 0; j< 3; j++) + for (j = 0; j < 3; j++) { - findex[j]*= stride[j]; + findex[j] *= stride[j]; } hypre_AddIndexes(findex, start, 3, findex); @@ -3481,8 +3494,8 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jedge_Edge[k]= rank; - vals_edgeEdge[k]= fCedge_ratio; + jedge_Edge[k] = rank; + vals_edgeEdge[k] = fCedge_ratio; k++; } @@ -3499,57 +3512,57 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, { /* Allocate memory to arrays for the tridiagonal system & solutions. Take the maximum size needed. */ - i= rfactor[0]-1; - for (j= 1; j< ndim; j++) + i = rfactor[0] - 1; + for (j = 1; j < ndim; j++) { - if (i < (rfactor[j]-1)) + if (i < (rfactor[j] - 1)) { - i= rfactor[j]-1; + i = rfactor[j] - 1; } } - upper= hypre_CTAlloc(HYPRE_Real, i, HYPRE_MEMORY_HOST); - lower= hypre_CTAlloc(HYPRE_Real, i, HYPRE_MEMORY_HOST); + upper = hypre_CTAlloc(HYPRE_Real, i, HYPRE_MEMORY_HOST); + lower = hypre_CTAlloc(HYPRE_Real, i, HYPRE_MEMORY_HOST); diag = hypre_CTAlloc(HYPRE_Real, i, HYPRE_MEMORY_HOST); - face_w1= hypre_CTAlloc(HYPRE_Real, i, HYPRE_MEMORY_HOST); - face_w2= hypre_CTAlloc(HYPRE_Real, i, HYPRE_MEMORY_HOST); - off_proc_flag= hypre_CTAlloc(HYPRE_Int, i+1, HYPRE_MEMORY_HOST); + face_w1 = hypre_CTAlloc(HYPRE_Real, i, HYPRE_MEMORY_HOST); + face_w2 = hypre_CTAlloc(HYPRE_Real, i, HYPRE_MEMORY_HOST); + off_proc_flag = hypre_CTAlloc(HYPRE_Int, i + 1, HYPRE_MEMORY_HOST); - for (part= 0; part< nparts; part++) + for (part = 0; part < nparts; part++) { - p_fgrid= hypre_SStructGridPGrid(fgrid_edge, part); /* edge grid */ - Edge_nvars= hypre_SStructPGridNVars(p_fgrid); - Edge_vartypes= hypre_SStructPGridVarTypes(p_fgrid); - p_cgrid= hypre_SStructGridPGrid(cgrid_edge, part); /* Edge grid */ + p_fgrid = hypre_SStructGridPGrid(fgrid_edge, part); /* edge grid */ + Edge_nvars = hypre_SStructPGridNVars(p_fgrid); + Edge_vartypes = hypre_SStructPGridVarTypes(p_fgrid); + p_cgrid = hypre_SStructGridPGrid(cgrid_edge, part); /* Edge grid */ /* note that fboxes are the contracted CELL boxes. Will get the correct variable grid extents. */ - fboxes= contract_fedgeBoxes[part]; + fboxes = contract_fedgeBoxes[part]; /* may need to shrink a given box in some boxoffset directions */ - boxoffset= hypre_TAlloc(hypre_Index, ndim, HYPRE_MEMORY_HOST); - for (t= 0; t< ndim; t++) + boxoffset = hypre_TAlloc(hypre_Index, ndim, HYPRE_MEMORY_HOST); + for (t = 0; t < ndim; t++) { hypre_ClearIndex(boxoffset[t]); - hypre_IndexD(boxoffset[t], t)= rfactor[t]-1; + hypre_IndexD(boxoffset[t], t) = rfactor[t] - 1; } - for (t= 0; t< Edge_nvars; t++) + for (t = 0; t < Edge_nvars; t++) { var = Edge_vartypes[t]; - var_fgrid= hypre_SStructPGridVTSGrid(p_fgrid, var); - box_array= hypre_StructGridBoxes(var_fgrid); - switch(var) + var_fgrid = hypre_SStructPGridVTSGrid(p_fgrid, var); + box_array = hypre_StructGridBoxes(var_fgrid); + switch (var) { case 5: { /* 3-d x_edge, can be Y or Z_Face */ - fCedge_ratio= 1.0/rfactor[0]; + fCedge_ratio = 1.0 / rfactor[0]; hypre_ForBoxI(i, fboxes) { - cellbox= hypre_BoxArrayBox(fboxes, i); + cellbox = hypre_BoxArrayBox(fboxes, i); /* vboxes inside the i'th cellbox */ - num_vboxes= n_CtoVbox[part][i]; + num_vboxes = n_CtoVbox[part][i]; vboxnums = CtoVboxnums[part][i]; hypre_CopyIndex(Edge_cstarts[part][i], cstart); @@ -3568,14 +3581,14 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, hypre_SubtractIndexes(hypre_BoxIMin(©_box), kshift, 3, findex); /* loop over all the vboxes to see if findex is inside */ - row_in= falseV; - for (p= 0; p< num_vboxes[t]; p++) + row_in = falseV; + for (p = 0; p < num_vboxes[t]; p++) { - vbox= hypre_BoxArrayBox(box_array, vboxnums[t][p]); + vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); if (hypre_IndexInBox(findex, vbox)) { hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in= trueV; + row_in = trueV; break; } } @@ -3611,9 +3624,9 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, hypre_AddIndexes(cindex, cstart, 3, cindex); /* Will need the actual fine indices. */ - for (l= 0; l< ndim; l++) + for (l = 0; l < ndim; l++) { - findex[l]*= rfactor[l]; + findex[l] *= rfactor[l]; } hypre_AddIndexes(findex, start, 3, findex); @@ -3631,14 +3644,14 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, /* loop over the strips of x_edges making up the Z_Face and create the tridiagonal systems by collapsing the stencils. */ - for (p= 0; p< rfactor[0]; p++) + for (p = 0; p < rfactor[0]; p++) { /* create the rhs's for the tridiagonal system. Require find the ranks at the endpt's of the strip. */ - for (n= 0; n< rfactor[1]-1; n++) + for (n = 0; n < rfactor[1] - 1; n++) { - face_w1[n]= 0.0; - face_w2[n]= 0.0; + face_w1[n] = 0.0; + face_w2[n] = 0.0; } /****************************************************** @@ -3648,19 +3661,19 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, ******************************************************/ /* lower-end and upper-end edge weights */ - face_w1[0]= fCedge_ratio; - face_w2[rfactor[1]-2]= fCedge_ratio; + face_w1[0] = fCedge_ratio; + face_w2[rfactor[1] - 2] = fCedge_ratio; /****************************************************** * create tridiagonal matrix. * x_edge for Z_Face: collapse_dir= 2, stencil_dir= 1 ******************************************************/ hypre_CopyIndex(findex, var_index); - var_index[0]+= p; - for (n= 1; n< rfactor[1]; n++) + var_index[0] += p; + for (n = 1; n < rfactor[1]; n++) { var_index[1]++; - off_proc_flag[n]= + off_proc_flag[n] = hypre_CollapseStencilToStencil(Aee, fgrid_edge, part, @@ -3670,30 +3683,30 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, 1, &stencil_vals); /* put extracted stencil_vals into tridiagonal matrix */ - lower[n-1]= stencil_vals[0]; - diag[n-1] = stencil_vals[1]; - upper[n-1]= stencil_vals[2]; + lower[n - 1] = stencil_vals[0]; + diag[n - 1] = stencil_vals[1]; + upper[n - 1] = stencil_vals[2]; hypre_TFree(stencil_vals, HYPRE_MEMORY_HOST); } /* solve systems to get weights. Must adjust face_w's so that the stencil entry contributes. */ - face_w1[0]*= -lower[0]; - face_w2[rfactor[1]-2]*= -upper[rfactor[1]-2]; - hypre_TriDiagSolve(diag, upper, lower, face_w1, rfactor[1]-1); - hypre_TriDiagSolve(diag, upper, lower, face_w2, rfactor[1]-1); + face_w1[0] *= -lower[0]; + face_w2[rfactor[1] - 2] *= -upper[rfactor[1] - 2]; + hypre_TriDiagSolve(diag, upper, lower, face_w1, rfactor[1] - 1); + hypre_TriDiagSolve(diag, upper, lower, face_w2, rfactor[1] - 1); /* place weights into vals_edgeEdge */ - for (n= 1; n< rfactor[1]; n++) + for (n = 1; n < rfactor[1]; n++) { if (!off_proc_flag[n]) /* off_proc_flag= 1 if offproc */ { - jedge_Edge[k]= rank; - vals_edgeEdge[k]= face_w1[n-1]; /* lower end connection */ + jedge_Edge[k] = rank; + vals_edgeEdge[k] = face_w1[n - 1]; /* lower end connection */ k++; - jedge_Edge[k]= rank2; - vals_edgeEdge[k]= face_w2[n-1]; /* upper end connection */ + jedge_Edge[k] = rank2; + vals_edgeEdge[k] = face_w2[n - 1]; /* upper end connection */ k++; } } @@ -3707,14 +3720,14 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, hypre_SubtractIndexes(hypre_BoxIMin(©_box), jshift, 3, findex); /* loop over all the vboxes to see if findex is inside */ - row_in= falseV; - for (p= 0; p< num_vboxes[t]; p++) + row_in = falseV; + for (p = 0; p < num_vboxes[t]; p++) { - vbox= hypre_BoxArrayBox(box_array, vboxnums[t][p]); + vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); if (hypre_IndexInBox(findex, vbox)) { hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in= trueV; + row_in = trueV; break; } } @@ -3749,9 +3762,9 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, hypre_AddIndexes(cindex, cstart, 3, cindex); /* Will need the actual fine indices. */ - for (l= 0; l< ndim; l++) + for (l = 0; l < ndim; l++) { - findex[l]*= rfactor[l]; + findex[l] *= rfactor[l]; } hypre_AddIndexes(findex, start, 3, findex); @@ -3773,30 +3786,30 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, /* loop over the strips of x_edges making up the Y_Face and create the tridiagonal systems by collapsing the stencils. */ - for (p= 0; p< rfactor[0]; p++) + for (p = 0; p < rfactor[0]; p++) { /* create the rhs's for the tridiagonal system. Require find the ranks at the endpt's of the strip. */ - for (n= 0; n< rfactor[2]-1; n++) + for (n = 0; n < rfactor[2] - 1; n++) { - face_w1[n]= 0.0; - face_w2[n]= 0.0; + face_w1[n] = 0.0; + face_w2[n] = 0.0; } /* lower-end and upper-end edge weights */ - face_w1[0]= fCedge_ratio; - face_w2[rfactor[2]-2]= fCedge_ratio; + face_w1[0] = fCedge_ratio; + face_w2[rfactor[2] - 2] = fCedge_ratio; /****************************************************** * create tridiagonal matrix. * x_edge for Y_Face: collapse_dir= 1, stencil_dir= 2 ******************************************************/ hypre_CopyIndex(findex, var_index); - var_index[0]+= p; - for (n= 1; n< rfactor[2]; n++) + var_index[0] += p; + for (n = 1; n < rfactor[2]; n++) { var_index[2]++; - off_proc_flag[n]= + off_proc_flag[n] = hypre_CollapseStencilToStencil(Aee, fgrid_edge, part, @@ -3806,30 +3819,30 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, 2, &stencil_vals); /* put extracted stencil_vals into tridiagonal matrix */ - lower[n-1]= stencil_vals[0]; - diag[n-1] = stencil_vals[1]; - upper[n-1]= stencil_vals[2]; + lower[n - 1] = stencil_vals[0]; + diag[n - 1] = stencil_vals[1]; + upper[n - 1] = stencil_vals[2]; hypre_TFree(stencil_vals, HYPRE_MEMORY_HOST); } /* solve systems to get weights. Must adjust face_w's so that the stencil entry contributes. */ - face_w1[0]*= -lower[0]; - face_w2[rfactor[2]-2]*= -upper[rfactor[2]-2]; - hypre_TriDiagSolve(diag, upper, lower, face_w1, rfactor[2]-1); - hypre_TriDiagSolve(diag, upper, lower, face_w2, rfactor[2]-1); + face_w1[0] *= -lower[0]; + face_w2[rfactor[2] - 2] *= -upper[rfactor[2] - 2]; + hypre_TriDiagSolve(diag, upper, lower, face_w1, rfactor[2] - 1); + hypre_TriDiagSolve(diag, upper, lower, face_w2, rfactor[2] - 1); /* place weights into vals_edgeEdge */ - for (n= 1; n< rfactor[2]; n++) + for (n = 1; n < rfactor[2]; n++) { if (!off_proc_flag[n]) /* off_proc_flag= 1 if offproc */ { - jedge_Edge[k]= rank; - vals_edgeEdge[k]= face_w1[n-1]; /* lower end connection */ + jedge_Edge[k] = rank; + vals_edgeEdge[k] = face_w1[n - 1]; /* lower end connection */ k++; - jedge_Edge[k]= rank2; - vals_edgeEdge[k]= face_w2[n-1]; /* upper end connection */ + jedge_Edge[k] = rank2; + vals_edgeEdge[k] = face_w2[n - 1]; /* upper end connection */ k++; } } @@ -3844,13 +3857,13 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, case 6: { /* 3-d y_edge, can be X or Z_Face */ - fCedge_ratio= 1.0/rfactor[1]; + fCedge_ratio = 1.0 / rfactor[1]; hypre_ForBoxI(i, fboxes) { - cellbox= hypre_BoxArrayBox(fboxes, i); + cellbox = hypre_BoxArrayBox(fboxes, i); /* vboxes inside the i'th cellbox */ - num_vboxes= n_CtoVbox[part][i]; + num_vboxes = n_CtoVbox[part][i]; vboxnums = CtoVboxnums[part][i]; hypre_CopyIndex(Edge_cstarts[part][i], cstart); @@ -3870,14 +3883,14 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, hypre_SubtractIndexes(hypre_BoxIMin(©_box), kshift, 3, findex); /* loop over all the vboxes to see if findex is inside */ - row_in= falseV; - for (p= 0; p< num_vboxes[t]; p++) + row_in = falseV; + for (p = 0; p < num_vboxes[t]; p++) { - vbox= hypre_BoxArrayBox(box_array, vboxnums[t][p]); + vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); if (hypre_IndexInBox(findex, vbox)) { hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in= trueV; + row_in = trueV; break; } } @@ -3913,9 +3926,9 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, hypre_AddIndexes(cindex, cstart, 3, cindex); /* Will need the actual fine indices. */ - for (l= 0; l< ndim; l++) + for (l = 0; l < ndim; l++) { - findex[l]*= rfactor[l]; + findex[l] *= rfactor[l]; } hypre_AddIndexes(findex, start, 3, findex); @@ -3933,30 +3946,30 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, /* loop over the strips of y_edges making up the Z_Face and create the tridiagonal systems by collapsing the stencils. */ - for (p= 0; p< rfactor[1]; p++) + for (p = 0; p < rfactor[1]; p++) { /* create the rhs's for the tridiagonal system. Require find the ranks at the endpt's of the strip. */ - for (n= 0; n< rfactor[0]-1; n++) + for (n = 0; n < rfactor[0] - 1; n++) { - face_w1[n]= 0.0; - face_w2[n]= 0.0; + face_w1[n] = 0.0; + face_w2[n] = 0.0; } /* lower-end and upper-end edge weights */ - face_w1[0]= fCedge_ratio; - face_w2[rfactor[0]-2]= fCedge_ratio; + face_w1[0] = fCedge_ratio; + face_w2[rfactor[0] - 2] = fCedge_ratio; /****************************************************** * create tridiagonal matrix. * y_edge for Z_Face: collapse_dir= 2, stencil_dir= 0 ******************************************************/ hypre_CopyIndex(findex, var_index); - var_index[1]+= p; - for (n= 1; n< rfactor[0]; n++) + var_index[1] += p; + for (n = 1; n < rfactor[0]; n++) { var_index[0]++; - off_proc_flag[n]= + off_proc_flag[n] = hypre_CollapseStencilToStencil(Aee, fgrid_edge, part, @@ -3966,30 +3979,30 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, 0, &stencil_vals); /* put extracted stencil_vals into tridiagonal matrix */ - lower[n-1]= stencil_vals[0]; - diag[n-1] = stencil_vals[1]; - upper[n-1]= stencil_vals[2]; + lower[n - 1] = stencil_vals[0]; + diag[n - 1] = stencil_vals[1]; + upper[n - 1] = stencil_vals[2]; hypre_TFree(stencil_vals, HYPRE_MEMORY_HOST); } /* solve systems to get weights. Must adjust face_w's so that the stencil entry contributes. */ - face_w1[0]*= -lower[0]; - face_w2[rfactor[0]-2]*= -upper[rfactor[0]-2]; - hypre_TriDiagSolve(diag, upper, lower, face_w1, rfactor[0]-1); - hypre_TriDiagSolve(diag, upper, lower, face_w2, rfactor[0]-1); + face_w1[0] *= -lower[0]; + face_w2[rfactor[0] - 2] *= -upper[rfactor[0] - 2]; + hypre_TriDiagSolve(diag, upper, lower, face_w1, rfactor[0] - 1); + hypre_TriDiagSolve(diag, upper, lower, face_w2, rfactor[0] - 1); /* place weights into vals_edgeEdge */ - for (n= 1; n< rfactor[0]; n++) + for (n = 1; n < rfactor[0]; n++) { if (!off_proc_flag[n]) /* off_proc_flag= 1 if offproc */ { - jedge_Edge[k]= rank; - vals_edgeEdge[k]= face_w1[n-1]; /* lower end connection */ + jedge_Edge[k] = rank; + vals_edgeEdge[k] = face_w1[n - 1]; /* lower end connection */ k++; - jedge_Edge[k]= rank2; - vals_edgeEdge[k]= face_w2[n-1]; /* upper end connection */ + jedge_Edge[k] = rank2; + vals_edgeEdge[k] = face_w2[n - 1]; /* upper end connection */ k++; } } @@ -4004,14 +4017,14 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, hypre_SubtractIndexes(hypre_BoxIMin(©_box), ishift, 3, findex); /* loop over all the vboxes to see if findex is inside */ - row_in= falseV; - for (p= 0; p< num_vboxes[t]; p++) + row_in = falseV; + for (p = 0; p < num_vboxes[t]; p++) { - vbox= hypre_BoxArrayBox(box_array, vboxnums[t][p]); + vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); if (hypre_IndexInBox(findex, vbox)) { hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in= trueV; + row_in = trueV; break; } } @@ -4046,9 +4059,9 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, hypre_AddIndexes(cindex, cstart, 3, cindex); /* Will need the actual fine indices. */ - for (l= 0; l< ndim; l++) + for (l = 0; l < ndim; l++) { - findex[l]*= rfactor[l]; + findex[l] *= rfactor[l]; } hypre_AddIndexes(findex, start, 3, findex); @@ -4070,30 +4083,30 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, /* loop over the strips of y_edges making up the X_Face and create the tridiagonal systems by collapsing the stencils. */ - for (p= 0; p< rfactor[1]; p++) + for (p = 0; p < rfactor[1]; p++) { /* create the rhs's for the tridiagonal system. Require find the ranks at the endpt's of the strip. */ - for (n= 0; n< rfactor[2]-1; n++) + for (n = 0; n < rfactor[2] - 1; n++) { - face_w1[n]= 0.0; - face_w2[n]= 0.0; + face_w1[n] = 0.0; + face_w2[n] = 0.0; } /* lower-end and upper-end edge weights */ - face_w1[0]= fCedge_ratio; - face_w2[rfactor[0]-2]= fCedge_ratio; + face_w1[0] = fCedge_ratio; + face_w2[rfactor[0] - 2] = fCedge_ratio; /****************************************************** * create tridiagonal matrix. * y_edge for X_Face: collapse_dir= 0, stencil_dir= 2 ******************************************************/ hypre_CopyIndex(findex, var_index); - var_index[1]+= p; - for (n= 1; n< rfactor[2]; n++) + var_index[1] += p; + for (n = 1; n < rfactor[2]; n++) { var_index[2]++; - off_proc_flag[n]= + off_proc_flag[n] = hypre_CollapseStencilToStencil(Aee, fgrid_edge, part, @@ -4103,30 +4116,30 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, 2, &stencil_vals); /* put extracted stencil_vals into tridiagonal matrix */ - lower[n-1]= stencil_vals[0]; - diag[n-1] = stencil_vals[1]; - upper[n-1]= stencil_vals[2]; + lower[n - 1] = stencil_vals[0]; + diag[n - 1] = stencil_vals[1]; + upper[n - 1] = stencil_vals[2]; hypre_TFree(stencil_vals, HYPRE_MEMORY_HOST); } /* solve systems to get weights. Must adjust face_w's so that the stencil entry contributes. */ - face_w1[0]*= -lower[0]; - face_w2[rfactor[2]-2]*= -upper[rfactor[2]-2]; - hypre_TriDiagSolve(diag, upper, lower, face_w1, rfactor[2]-1); - hypre_TriDiagSolve(diag, upper, lower, face_w2, rfactor[2]-1); + face_w1[0] *= -lower[0]; + face_w2[rfactor[2] - 2] *= -upper[rfactor[2] - 2]; + hypre_TriDiagSolve(diag, upper, lower, face_w1, rfactor[2] - 1); + hypre_TriDiagSolve(diag, upper, lower, face_w2, rfactor[2] - 1); /* place weights into vals_edgeEdge */ - for (n= 1; n< rfactor[2]; n++) + for (n = 1; n < rfactor[2]; n++) { if (!off_proc_flag[n]) /* off_proc_flag= 1 if offproc */ { - jedge_Edge[k]= rank; - vals_edgeEdge[k]= face_w1[n-1]; /* lower end connection */ + jedge_Edge[k] = rank; + vals_edgeEdge[k] = face_w1[n - 1]; /* lower end connection */ k++; - jedge_Edge[k]= rank2; - vals_edgeEdge[k]= face_w2[n-1]; /* upper end connection */ + jedge_Edge[k] = rank2; + vals_edgeEdge[k] = face_w2[n - 1]; /* upper end connection */ k++; } } @@ -4141,13 +4154,13 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, case 7: { /* 3-d z_edge, can be X or Y_Face */ - fCedge_ratio= 1.0/rfactor[2]; + fCedge_ratio = 1.0 / rfactor[2]; hypre_ForBoxI(i, fboxes) { - cellbox= hypre_BoxArrayBox(fboxes, i); + cellbox = hypre_BoxArrayBox(fboxes, i); /* vboxes inside the i'th cellbox */ - num_vboxes= n_CtoVbox[part][i]; + num_vboxes = n_CtoVbox[part][i]; vboxnums = CtoVboxnums[part][i]; hypre_CopyIndex(Edge_cstarts[part][i], cstart); @@ -4166,14 +4179,14 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, hypre_SubtractIndexes(hypre_BoxIMin(©_box), ishift, 3, findex); /* loop over all the vboxes to see if findex is inside */ - row_in= falseV; - for (p= 0; p< num_vboxes[t]; p++) + row_in = falseV; + for (p = 0; p < num_vboxes[t]; p++) { - vbox= hypre_BoxArrayBox(box_array, vboxnums[t][p]); + vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); if (hypre_IndexInBox(findex, vbox)) { hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in= trueV; + row_in = trueV; break; } } @@ -4210,9 +4223,9 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, hypre_AddIndexes(cindex, cstart, 3, cindex); /* Will need the actual fine indices. */ - for (l= 0; l< ndim; l++) + for (l = 0; l < ndim; l++) { - findex[l]*= rfactor[l]; + findex[l] *= rfactor[l]; } hypre_AddIndexes(findex, start, 3, findex); @@ -4230,30 +4243,30 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, /* loop over the strips of z_edges making up the X_Face and create the tridiagonal systems by collapsing the stencils. */ - for (p= 0; p< rfactor[2]; p++) + for (p = 0; p < rfactor[2]; p++) { /* create the rhs's for the tridiagonal system. Require find the ranks at the endpt's of the strip. */ - for (n= 0; n< rfactor[1]-1; n++) + for (n = 0; n < rfactor[1] - 1; n++) { - face_w1[n]= 0.0; - face_w2[n]= 0.0; + face_w1[n] = 0.0; + face_w2[n] = 0.0; } /* lower-end and upper-end edge weights */ - face_w1[0]= fCedge_ratio; - face_w2[rfactor[1]-2]= fCedge_ratio; + face_w1[0] = fCedge_ratio; + face_w2[rfactor[1] - 2] = fCedge_ratio; /****************************************************** * create tridiagonal matrix. * z_edge for X_Face: collapse_dir= 0, stencil_dir= 1 ******************************************************/ hypre_CopyIndex(findex, var_index); - var_index[2]+= p; - for (n= 1; n< rfactor[1]; n++) + var_index[2] += p; + for (n = 1; n < rfactor[1]; n++) { var_index[1]++; - off_proc_flag[n]= + off_proc_flag[n] = hypre_CollapseStencilToStencil(Aee, fgrid_edge, part, @@ -4263,30 +4276,30 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, 1, &stencil_vals); /* put extracted stencil_vals into tridiagonal matrix */ - lower[n-1]= stencil_vals[0]; - diag[n-1] = stencil_vals[1]; - upper[n-1]= stencil_vals[2]; + lower[n - 1] = stencil_vals[0]; + diag[n - 1] = stencil_vals[1]; + upper[n - 1] = stencil_vals[2]; hypre_TFree(stencil_vals, HYPRE_MEMORY_HOST); } /* solve systems to get weights. Must adjust face_w's so that the stencil entry contributes. */ - face_w1[0]*= -lower[0]; - face_w2[rfactor[1]-2]*= -upper[rfactor[1]-2]; - hypre_TriDiagSolve(diag, upper, lower, face_w1, rfactor[1]-1); - hypre_TriDiagSolve(diag, upper, lower, face_w2, rfactor[1]-1); + face_w1[0] *= -lower[0]; + face_w2[rfactor[1] - 2] *= -upper[rfactor[1] - 2]; + hypre_TriDiagSolve(diag, upper, lower, face_w1, rfactor[1] - 1); + hypre_TriDiagSolve(diag, upper, lower, face_w2, rfactor[1] - 1); /* place weights into vals_edgeEdge */ - for (n= 1; n< rfactor[1]; n++) + for (n = 1; n < rfactor[1]; n++) { if (!off_proc_flag[n]) /* off_proc_flag= 1 if offproc */ { - jedge_Edge[k]= rank; - vals_edgeEdge[k]= face_w1[n-1]; /* lower end connection */ + jedge_Edge[k] = rank; + vals_edgeEdge[k] = face_w1[n - 1]; /* lower end connection */ k++; - jedge_Edge[k]= rank2; - vals_edgeEdge[k]= face_w2[n-1]; /* upper end connection */ + jedge_Edge[k] = rank2; + vals_edgeEdge[k] = face_w2[n - 1]; /* upper end connection */ k++; } } @@ -4301,14 +4314,14 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, hypre_SubtractIndexes(hypre_BoxIMin(©_box), jshift, 3, findex); /* loop over all the vboxes to see if findex is inside */ - row_in= falseV; - for (p= 0; p< num_vboxes[t]; p++) + row_in = falseV; + for (p = 0; p < num_vboxes[t]; p++) { - vbox= hypre_BoxArrayBox(box_array, vboxnums[t][p]); + vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); if (hypre_IndexInBox(findex, vbox)) { hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in= trueV; + row_in = trueV; break; } } @@ -4342,9 +4355,9 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, hypre_AddIndexes(cindex, cstart, 3, cindex); /* Will need the actual fine indices. */ - for (l= 0; l< ndim; l++) + for (l = 0; l < ndim; l++) { - findex[l]*= rfactor[l]; + findex[l] *= rfactor[l]; } hypre_AddIndexes(findex, start, 3, findex); @@ -4366,30 +4379,30 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, /* loop over the strips of y_edges making up the Y_Face and create the tridiagonal systems by collapsing the stencils. */ - for (p= 0; p< rfactor[2]; p++) + for (p = 0; p < rfactor[2]; p++) { /* create the rhs's for the tridiagonal system. Require find the ranks at the endpt's of the strip. */ - for (n= 0; n< rfactor[0]-1; n++) + for (n = 0; n < rfactor[0] - 1; n++) { - face_w1[n]= 0.0; - face_w2[n]= 0.0; + face_w1[n] = 0.0; + face_w2[n] = 0.0; } /* lower-end and upper-end edge weights */ - face_w1[0]= fCedge_ratio; - face_w2[rfactor[0]-2]= fCedge_ratio; + face_w1[0] = fCedge_ratio; + face_w2[rfactor[0] - 2] = fCedge_ratio; /****************************************************** * create tridiagonal matrix. * z_edge for Y_Face: collapse_dir= 1, stencil_dir= 0 ******************************************************/ hypre_CopyIndex(findex, var_index); - var_index[2]+= p; - for (n= 1; n< rfactor[0]; n++) + var_index[2] += p; + for (n = 1; n < rfactor[0]; n++) { var_index[0]++; - off_proc_flag[n]= + off_proc_flag[n] = hypre_CollapseStencilToStencil(Aee, fgrid_edge, part, @@ -4399,30 +4412,30 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, 0, &stencil_vals); /* put extracted stencil_vals into tridiagonal matrix */ - lower[n-1]= stencil_vals[0]; - diag[n-1] = stencil_vals[1]; - upper[n-1]= stencil_vals[2]; + lower[n - 1] = stencil_vals[0]; + diag[n - 1] = stencil_vals[1]; + upper[n - 1] = stencil_vals[2]; hypre_TFree(stencil_vals, HYPRE_MEMORY_HOST); } /* solve systems to get weights. Must adjust face_w's so that the stencil entry contributes. */ - face_w1[0]*= -lower[0]; - face_w2[rfactor[0]-2]*= -upper[rfactor[0]-2]; - hypre_TriDiagSolve(diag, upper, lower, face_w1, rfactor[0]-1); - hypre_TriDiagSolve(diag, upper, lower, face_w2, rfactor[0]-1); + face_w1[0] *= -lower[0]; + face_w2[rfactor[0] - 2] *= -upper[rfactor[0] - 2]; + hypre_TriDiagSolve(diag, upper, lower, face_w1, rfactor[0] - 1); + hypre_TriDiagSolve(diag, upper, lower, face_w2, rfactor[0] - 1); /* place weights into vals_edgeEdge */ - for (n= 1; n< rfactor[0]; n++) + for (n = 1; n < rfactor[0]; n++) { if (!off_proc_flag[n]) /* off_proc_flag= 1 if offproc */ { - jedge_Edge[k]= rank; - vals_edgeEdge[k]= face_w1[n-1]; /* lower end connection */ + jedge_Edge[k] = rank; + vals_edgeEdge[k] = face_w1[n - 1]; /* lower end connection */ k++; - jedge_Edge[k]= rank2; - vals_edgeEdge[k]= face_w2[n-1]; /* upper end connection */ + jedge_Edge[k] = rank2; + vals_edgeEdge[k] = face_w2[n - 1]; /* upper end connection */ k++; } } @@ -4433,7 +4446,10 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, } /* hypre_ForBoxI(i, fboxes) */ break; } - + default: + { + fCedge_ratio = 1.0; + } } /* switch */ } /* for (t= 0; t< Edge_nvars; t++) */ @@ -4449,31 +4465,31 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, } /* if (ndim == 3) */ /* generate the interior interpolation weights/info */ - for (part= 0; part< nparts; part++) + for (part = 0; part < nparts; part++) { - p_fgrid= hypre_SStructGridPGrid(fgrid_edge, part); /* edge grid */ - Edge_nvars= hypre_SStructPGridNVars(p_fgrid); - Edge_vartypes= hypre_SStructPGridVarTypes(p_fgrid); - p_cgrid= hypre_SStructGridPGrid(cgrid_edge, part); /* Edge grid */ + p_fgrid = hypre_SStructGridPGrid(fgrid_edge, part); /* edge grid */ + Edge_nvars = hypre_SStructPGridNVars(p_fgrid); + Edge_vartypes = hypre_SStructPGridVarTypes(p_fgrid); + p_cgrid = hypre_SStructGridPGrid(cgrid_edge, part); /* Edge grid */ /* note that fboxes are the contracted CELL boxes. Will get the correct variable grid extents. */ - fboxes= contract_fedgeBoxes[part]; + fboxes = contract_fedgeBoxes[part]; - for (t= 0; t< Edge_nvars; t++) + for (t = 0; t < Edge_nvars; t++) { var = Edge_vartypes[t]; - var_fgrid= hypre_SStructPGridVTSGrid(p_fgrid, var); - box_array= hypre_StructGridBoxes(var_fgrid); + var_fgrid = hypre_SStructPGridVTSGrid(p_fgrid, var); + box_array = hypre_StructGridBoxes(var_fgrid); - switch(var) + switch (var) { case 2: { /* 2-d x_face = x_edge, can be interior or on X_Edge */ hypre_ForBoxI(i, fboxes) { - cellbox= hypre_BoxArrayBox(fboxes, i); + cellbox = hypre_BoxArrayBox(fboxes, i); vbox = hypre_BoxArrayBox(box_array, i); hypre_CopyIndex(Edge_cstarts[part][i], cstart); @@ -4501,9 +4517,9 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, * * Loop over the interior fine edges in an agglomerate. *****************************************************/ - for (p= 1; p< rfactor[0]; p++) + for (p = 1; p < rfactor[0]; p++) { - for (n= 0; n< rfactor[1]; n++) + for (n = 0; n < rfactor[1]; n++) { hypre_CopyIndex(findex, cindex); hypre_AddIndexes(cindex, cstart, 3, cindex); @@ -4515,7 +4531,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, matrix_type); - jedge_Edge[k]= rank; + jedge_Edge[k] = rank; k++; hypre_SubtractIndexes(cindex, ishift, 3, var_index); @@ -4523,7 +4539,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jedge_Edge[k]= rank; + jedge_Edge[k] = rank; k++; /* y_Edges */ @@ -4531,7 +4547,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, vartype_map[3], &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, matrix_type); - jedge_Edge[k]= rank; + jedge_Edge[k] = rank; k++; hypre_SubtractIndexes(cindex, jshift, 3, var_index); @@ -4539,7 +4555,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, vartype_map[3], &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jedge_Edge[k]= rank; + jedge_Edge[k] = rank; k++; } /* for (n= 0; n< rfactor[1]; n++) */ } /* for (p= 1; p< rfactor[0]; p++) */ @@ -4556,7 +4572,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, /* 2-d y_face = y_edge, can be interior or on Y_Edge */ hypre_ForBoxI(i, fboxes) { - cellbox= hypre_BoxArrayBox(fboxes, i); + cellbox = hypre_BoxArrayBox(fboxes, i); vbox = hypre_BoxArrayBox(box_array, i); hypre_CopyIndex(Edge_cstarts[part][i], cstart); @@ -4584,9 +4600,9 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, * * Loop over the interior fine edges in an agglomerate. *****************************************************/ - for (p= 1; p< rfactor[1]; p++) + for (p = 1; p < rfactor[1]; p++) { - for (n= 0; n< rfactor[0]; n++) + for (n = 0; n < rfactor[0]; n++) { hypre_CopyIndex(findex, cindex); hypre_AddIndexes(cindex, cstart, 3, cindex); @@ -4598,7 +4614,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, matrix_type); - jedge_Edge[k]= rank; + jedge_Edge[k] = rank; k++; hypre_SubtractIndexes(cindex, jshift, 3, var_index); @@ -4606,7 +4622,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jedge_Edge[k]= rank; + jedge_Edge[k] = rank; k++; /* x_Edges */ @@ -4614,7 +4630,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, vartype_map[2], &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, matrix_type); - jedge_Edge[k]= rank; + jedge_Edge[k] = rank; k++; hypre_SubtractIndexes(cindex, ishift, 3, var_index); @@ -4622,7 +4638,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, vartype_map[2], &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jedge_Edge[k]= rank; + jedge_Edge[k] = rank; k++; } /* for (n= 0; n< rfactor[0]; n++) */ } /* for (p= 1; p< rfactor[1]; p++) */ @@ -4639,7 +4655,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, /* 3-d x_edge, must be interior */ hypre_ForBoxI(i, fboxes) { - cellbox= hypre_BoxArrayBox(fboxes, i); + cellbox = hypre_BoxArrayBox(fboxes, i); vbox = hypre_BoxArrayBox(box_array, i); hypre_CopyIndex(Edge_cstarts[part][i], cstart); @@ -4667,11 +4683,11 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, * * Loop over the interior fine edges in an agglomerate. *****************************************************/ - for (p= 1; p< rfactor[2]; p++) + for (p = 1; p < rfactor[2]; p++) { - for (n= 1; n< rfactor[1]; n++) + for (n = 1; n < rfactor[1]; n++) { - for (m= 0; m< rfactor[0]; m++) + for (m = 0; m < rfactor[0]; m++) { hypre_CopyIndex(findex, cindex); hypre_AddIndexes(cindex, cstart, 3, cindex); @@ -4688,7 +4704,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, matrix_type); - jedge_Edge[k]= rank; + jedge_Edge[k] = rank; k++; hypre_SubtractIndexes(cindex, jshift, 3, var_index); @@ -4696,7 +4712,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jedge_Edge[k]= rank; + jedge_Edge[k] = rank; k++; hypre_SubtractIndexes(var_index, kshift, 3, var_index); @@ -4704,7 +4720,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jedge_Edge[k]= rank; + jedge_Edge[k] = rank; k++; hypre_AddIndexes(var_index, jshift, 3, var_index); @@ -4712,7 +4728,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jedge_Edge[k]= rank; + jedge_Edge[k] = rank; k++; /* y_Edge */ @@ -4720,7 +4736,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, vartype_map[6], &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, matrix_type); - jedge_Edge[k]= rank; + jedge_Edge[k] = rank; k++; hypre_SubtractIndexes(cindex, ishift, 3, var_index); @@ -4728,7 +4744,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, vartype_map[6], &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jedge_Edge[k]= rank; + jedge_Edge[k] = rank; k++; hypre_SubtractIndexes(var_index, kshift, 3, var_index); @@ -4736,7 +4752,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, vartype_map[6], &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jedge_Edge[k]= rank; + jedge_Edge[k] = rank; k++; hypre_AddIndexes(var_index, ishift, 3, var_index); @@ -4744,7 +4760,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, vartype_map[6], &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jedge_Edge[k]= rank; + jedge_Edge[k] = rank; k++; /* z_Edge */ @@ -4752,7 +4768,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, vartype_map[7], &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, matrix_type); - jedge_Edge[k]= rank; + jedge_Edge[k] = rank; k++; hypre_SubtractIndexes(cindex, ishift, 3, var_index); @@ -4760,7 +4776,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, vartype_map[7], &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jedge_Edge[k]= rank; + jedge_Edge[k] = rank; k++; hypre_SubtractIndexes(var_index, jshift, 3, var_index); @@ -4768,7 +4784,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, vartype_map[7], &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jedge_Edge[k]= rank; + jedge_Edge[k] = rank; k++; hypre_AddIndexes(var_index, ishift, 3, var_index); @@ -4776,7 +4792,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, vartype_map[7], &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jedge_Edge[k]= rank; + jedge_Edge[k] = rank; k++; } /* for (m= 0; m< rfactor[0]; m++) */ } /* for (n= 1; n< rfactor[1]; n++) */ @@ -4793,7 +4809,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, /* 3-d y_edge, must be interior */ hypre_ForBoxI(i, fboxes) { - cellbox= hypre_BoxArrayBox(fboxes, i); + cellbox = hypre_BoxArrayBox(fboxes, i); vbox = hypre_BoxArrayBox(box_array, i); hypre_CopyIndex(Edge_cstarts[part][i], cstart); @@ -4821,11 +4837,11 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, * * Loop over the interior fine edges in an agglomerate. *****************************************************/ - for (p= 1; p< rfactor[2]; p++) + for (p = 1; p < rfactor[2]; p++) { - for (n= 1; n< rfactor[0]; n++) + for (n = 1; n < rfactor[0]; n++) { - for (m= 0; m< rfactor[1]; m++) + for (m = 0; m < rfactor[1]; m++) { hypre_CopyIndex(findex, cindex); hypre_AddIndexes(cindex, cstart, 3, cindex); @@ -4842,7 +4858,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, matrix_type); - jedge_Edge[k]= rank; + jedge_Edge[k] = rank; k++; hypre_SubtractIndexes(cindex, ishift, 3, var_index); @@ -4850,7 +4866,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jedge_Edge[k]= rank; + jedge_Edge[k] = rank; k++; hypre_SubtractIndexes(var_index, kshift, 3, var_index); @@ -4858,7 +4874,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jedge_Edge[k]= rank; + jedge_Edge[k] = rank; k++; hypre_AddIndexes(var_index, ishift, 3, var_index); @@ -4866,7 +4882,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jedge_Edge[k]= rank; + jedge_Edge[k] = rank; k++; /* z_Edge */ @@ -4874,7 +4890,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, vartype_map[7], &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, matrix_type); - jedge_Edge[k]= rank; + jedge_Edge[k] = rank; k++; hypre_SubtractIndexes(cindex, ishift, 3, var_index); @@ -4882,7 +4898,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, vartype_map[7], &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jedge_Edge[k]= rank; + jedge_Edge[k] = rank; k++; hypre_SubtractIndexes(var_index, jshift, 3, var_index); @@ -4890,7 +4906,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, vartype_map[7], &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jedge_Edge[k]= rank; + jedge_Edge[k] = rank; k++; hypre_AddIndexes(var_index, ishift, 3, var_index); @@ -4898,7 +4914,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, vartype_map[7], &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jedge_Edge[k]= rank; + jedge_Edge[k] = rank; k++; /* x_Edge */ @@ -4906,7 +4922,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, vartype_map[5], &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, matrix_type); - jedge_Edge[k]= rank; + jedge_Edge[k] = rank; k++; hypre_SubtractIndexes(cindex, jshift, 3, var_index); @@ -4914,7 +4930,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, vartype_map[5], &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jedge_Edge[k]= rank; + jedge_Edge[k] = rank; k++; hypre_SubtractIndexes(var_index, kshift, 3, var_index); @@ -4922,7 +4938,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, vartype_map[5], &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jedge_Edge[k]= rank; + jedge_Edge[k] = rank; k++; hypre_AddIndexes(var_index, jshift, 3, var_index); @@ -4930,7 +4946,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, vartype_map[5], &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jedge_Edge[k]= rank; + jedge_Edge[k] = rank; k++; } /* for (m= 0; m< rfactor[1]; m++) */ } /* for (n= 1; n< rfactor[0]; n++) */ @@ -4948,7 +4964,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, /* 3-d z_edge, only the interior */ hypre_ForBoxI(i, fboxes) { - cellbox= hypre_BoxArrayBox(fboxes, i); + cellbox = hypre_BoxArrayBox(fboxes, i); vbox = hypre_BoxArrayBox(box_array, i); hypre_CopyIndex(Edge_cstarts[part][i], cstart); @@ -4976,11 +4992,11 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, * * Loop over the interior fine edges in an agglomerate. *****************************************************/ - for (p= 1; p< rfactor[1]; p++) + for (p = 1; p < rfactor[1]; p++) { - for (n= 1; n< rfactor[0]; n++) + for (n = 1; n < rfactor[0]; n++) { - for (m= 0; m< rfactor[2]; m++) + for (m = 0; m < rfactor[2]; m++) { hypre_CopyIndex(findex, cindex); hypre_AddIndexes(cindex, cstart, 3, cindex); @@ -4997,7 +5013,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, matrix_type); - jedge_Edge[k]= rank; + jedge_Edge[k] = rank; k++; hypre_SubtractIndexes(cindex, ishift, 3, var_index); @@ -5005,7 +5021,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jedge_Edge[k]= rank; + jedge_Edge[k] = rank; k++; hypre_SubtractIndexes(var_index, jshift, 3, var_index); @@ -5013,7 +5029,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jedge_Edge[k]= rank; + jedge_Edge[k] = rank; k++; hypre_AddIndexes(var_index, ishift, 3, var_index); @@ -5021,7 +5037,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, t, &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jedge_Edge[k]= rank; + jedge_Edge[k] = rank; k++; /* x_Edge */ @@ -5029,7 +5045,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, vartype_map[5], &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, matrix_type); - jedge_Edge[k]= rank; + jedge_Edge[k] = rank; k++; hypre_SubtractIndexes(cindex, jshift, 3, var_index); @@ -5037,7 +5053,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, vartype_map[5], &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jedge_Edge[k]= rank; + jedge_Edge[k] = rank; k++; hypre_SubtractIndexes(var_index, kshift, 3, var_index); @@ -5045,7 +5061,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, vartype_map[5], &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jedge_Edge[k]= rank; + jedge_Edge[k] = rank; k++; hypre_AddIndexes(var_index, jshift, 3, var_index); @@ -5053,7 +5069,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, vartype_map[5], &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jedge_Edge[k]= rank; + jedge_Edge[k] = rank; k++; /* y_Edge */ @@ -5061,7 +5077,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, vartype_map[6], &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, matrix_type); - jedge_Edge[k]= rank; + jedge_Edge[k] = rank; k++; hypre_SubtractIndexes(cindex, ishift, 3, var_index); @@ -5069,7 +5085,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, vartype_map[6], &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jedge_Edge[k]= rank; + jedge_Edge[k] = rank; k++; hypre_SubtractIndexes(var_index, kshift, 3, var_index); @@ -5077,7 +5093,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, vartype_map[6], &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jedge_Edge[k]= rank; + jedge_Edge[k] = rank; k++; hypre_AddIndexes(var_index, ishift, 3, var_index); @@ -5085,7 +5101,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, vartype_map[6], &entry); hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, matrix_type); - jedge_Edge[k]= rank; + jedge_Edge[k] = rank; k++; } /* for (m= 0; m< rfactor[2]; m++) */ } /* for (n= 1; n< rfactor[0]; n++) */ @@ -5108,22 +5124,22 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, (const HYPRE_Real*) vals_edgeEdge); HYPRE_IJMatrixAssemble((HYPRE_IJMatrix) edge_Edge); - hypre_TFree(ncols_edgeEdge, HYPRE_MEMORY_DEVICE); - hypre_TFree(iedgeEdge, HYPRE_MEMORY_DEVICE); - hypre_TFree(jedge_Edge, HYPRE_MEMORY_DEVICE); - hypre_TFree(vals_edgeEdge, HYPRE_MEMORY_DEVICE); + hypre_TFree(ncols_edgeEdge, memory_location); + hypre_TFree(iedgeEdge, memory_location); + hypre_TFree(jedge_Edge, memory_location); + hypre_TFree(vals_edgeEdge, memory_location); /* n_CtoVbox[part][cellboxi][var] & CtoVboxnums[part][cellboxi][var][nvboxes] */ - for (part= 0; part< nparts; part++) + for (part = 0; part < nparts; part++) { - p_fgrid= hypre_SStructGridPGrid(fgrid_edge, part); - Edge_nvars= hypre_SStructPGridNVars(p_fgrid); + p_fgrid = hypre_SStructGridPGrid(fgrid_edge, part); + Edge_nvars = hypre_SStructPGridNVars(p_fgrid); - var_fgrid= hypre_SStructPGridCellSGrid(p_fgrid); + var_fgrid = hypre_SStructPGridCellSGrid(p_fgrid); fboxes = hypre_StructGridBoxes(var_fgrid); hypre_ForBoxI(j, fboxes) { - for (t= 0; t< Edge_nvars; t++) + for (t = 0; t < Edge_nvars; t++) { hypre_TFree(CtoVboxnums[part][j][t], HYPRE_MEMORY_HOST); } @@ -5136,10 +5152,10 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, hypre_TFree(n_CtoVbox, HYPRE_MEMORY_HOST); hypre_TFree(CtoVboxnums, HYPRE_MEMORY_HOST); - for (part= 0; part< nparts; part++) + for (part = 0; part < nparts; part++) { - p_fgrid= hypre_SStructGridPGrid(fgrid_edge, part); - var_fgrid= hypre_SStructPGridCellSGrid(p_fgrid); + p_fgrid = hypre_SStructGridPGrid(fgrid_edge, part); + var_fgrid = hypre_SStructPGridCellSGrid(p_fgrid); fboxes = hypre_StructGridBoxes(var_fgrid); hypre_BoxArrayDestroy(contract_fedgeBoxes[part]); @@ -5173,7 +5189,7 @@ hypre_Maxwell_PTopology( hypre_SStructGrid *fgrid_edge, (PTopology -> Face_iedge) = Face_iedge; (PTopology -> Element_Face) = Element_Face; } - (PTopology -> Element_iedge)= Element_iedge; + (PTopology -> Element_iedge) = Element_iedge; (PTopology -> Edge_iedge) = Edge_iedge; (PTopology -> Element_Edge) = Element_Edge; @@ -5205,9 +5221,9 @@ hypre_CollapseStencilToStencil(hypre_ParCSRMatrix *Aee, HYPRE_Int new_stencil_dir, HYPRE_Real **collapsed_vals_ptr) { - HYPRE_Int ierr= 0; + HYPRE_Int ierr = 0; - HYPRE_Int matrix_type= HYPRE_PARCSR; + HYPRE_Int matrix_type = HYPRE_PARCSR; HYPRE_BigInt start_rank = hypre_ParCSRMatrixFirstRowIndex(Aee); HYPRE_BigInt end_rank = hypre_ParCSRMatrixLastRowIndex(Aee); @@ -5215,7 +5231,7 @@ hypre_CollapseStencilToStencil(hypre_ParCSRMatrix *Aee, HYPRE_BigInt *ranks; HYPRE_Int *marker; /* marker to record the rank groups */ - HYPRE_Int max_ranksize= 9; + HYPRE_Int max_ranksize = 9; HYPRE_Real *collapsed_vals; @@ -5232,7 +5248,7 @@ hypre_CollapseStencilToStencil(hypre_ParCSRMatrix *Aee, HYPRE_Int cnt; /* create the collapsed stencil coefficients. Three components. */ - collapsed_vals= hypre_CTAlloc(HYPRE_Real, 3, HYPRE_MEMORY_HOST); + collapsed_vals = hypre_CTAlloc(HYPRE_Real, 3, HYPRE_MEMORY_HOST); /* check if the row corresponding to pt_location is on this proc. If not, return an identity row. THIS SHOULD BE CORRECTED IN THE FUTURE @@ -5242,8 +5258,8 @@ hypre_CollapseStencilToStencil(hypre_ParCSRMatrix *Aee, if (rank < start_rank || rank > end_rank) { collapsed_vals[1] = 1.0; - *collapsed_vals_ptr= collapsed_vals; - ierr= 1; + *collapsed_vals_ptr = collapsed_vals; + ierr = 1; return ierr; } @@ -5251,31 +5267,31 @@ hypre_CollapseStencilToStencil(hypre_ParCSRMatrix *Aee, collapsing, we assume that max stencil size is 9. This agrees with the assumed pattern surrounding pt_location. Concatenating done. */ ranks = hypre_TAlloc(HYPRE_BigInt, max_ranksize, HYPRE_MEMORY_HOST); - marker= hypre_TAlloc(HYPRE_Int, max_ranksize, HYPRE_MEMORY_HOST); + marker = hypre_TAlloc(HYPRE_Int, max_ranksize, HYPRE_MEMORY_HOST); - cnt= 0; - centre= 0; - for (j= -1; j<= 1; j++) + cnt = 0; + centre = 0; + for (j = -1; j <= 1; j++) { hypre_CopyIndex(pt_location, index1); - index1[new_stencil_dir]+= j; + index1[new_stencil_dir] += j; - for (i= -1; i<= 1; i++) + for (i = -1; i <= 1; i++) { hypre_CopyIndex(index1, index2); - index2[collapse_dir]+= i; + index2[collapse_dir] += i; hypre_SStructGridFindBoxManEntry(grid, part, index2, var, &entry); if (entry) { hypre_SStructBoxManEntryGetGlobalRank(entry, index2, &rank, matrix_type); ranks[cnt] = rank; - marker[cnt]= j+1; + marker[cnt] = j + 1; /* mark centre component- entry!=NULL always */ if ( (!i) && (!j) ) { - centre= cnt; + centre = cnt; } cnt++; } @@ -5285,29 +5301,31 @@ hypre_CollapseStencilToStencil(hypre_ParCSRMatrix *Aee, /* Grab the row corresponding to index pt_location. rank located in location centre of ranks, i.e., rank for index2= pt_location. Mark location of values, which will record the original location of values after the sorting. */ - row_rank= ranks[centre]; - getrow_ierr= HYPRE_ParCSRMatrixGetRow((HYPRE_ParCSRMatrix) Aee, row_rank, - &size, &col_inds, &values); + row_rank = ranks[centre]; + getrow_ierr = HYPRE_ParCSRMatrixGetRow((HYPRE_ParCSRMatrix) Aee, row_rank, + &size, &col_inds, &values); if (getrow_ierr < 0) + { hypre_printf("offproc collapsing problem"); + } - swap_inds= hypre_TAlloc(HYPRE_Int, size, HYPRE_MEMORY_HOST); - col_inds2= hypre_TAlloc(HYPRE_BigInt, size, HYPRE_MEMORY_HOST); - for (i= 0; i< size; i++) + swap_inds = hypre_TAlloc(HYPRE_Int, size, HYPRE_MEMORY_HOST); + col_inds2 = hypre_TAlloc(HYPRE_BigInt, size, HYPRE_MEMORY_HOST); + for (i = 0; i < size; i++) { - swap_inds[i]= i; - col_inds2[i]= col_inds[i]; + swap_inds[i] = i; + col_inds2[i] = col_inds[i]; } /* qsort ranks & col_inds */ - hypre_BigQsortbi(ranks, marker, 0, cnt-1); - hypre_BigQsortbi(col_inds2, swap_inds, 0, size-1); + hypre_BigQsortbi(ranks, marker, 0, cnt - 1); + hypre_BigQsortbi(col_inds2, swap_inds, 0, size - 1); /* search for values to collapse */ - m= 0; - for (i= 0; i< cnt; i++) + m = 0; + for (i = 0; i < cnt; i++) { - found= 0; + found = 0; while (!found) { if (ranks[i] != col_inds2[m]) @@ -5316,7 +5334,7 @@ hypre_CollapseStencilToStencil(hypre_ParCSRMatrix *Aee, } else { - collapsed_vals[marker[i]]+= values[swap_inds[m]]; + collapsed_vals[marker[i]] += values[swap_inds[m]]; m++; break; /* break out of while loop */ } @@ -5331,7 +5349,7 @@ hypre_CollapseStencilToStencil(hypre_ParCSRMatrix *Aee, hypre_TFree(marker, HYPRE_MEMORY_HOST); hypre_TFree(swap_inds, HYPRE_MEMORY_HOST); - *collapsed_vals_ptr= collapsed_vals; + *collapsed_vals_ptr = collapsed_vals; return ierr; } @@ -5346,34 +5364,34 @@ hypre_TriDiagSolve(HYPRE_Real *diag, HYPRE_Real *rhs, HYPRE_Int size) { - HYPRE_Int ierr= 0; + HYPRE_Int ierr = 0; HYPRE_Int i, size1; HYPRE_Real *copy_diag; HYPRE_Real multiplier; - size1= size-1; + size1 = size - 1; /* copy diag so that the matrix is not modified */ - copy_diag= hypre_TAlloc(HYPRE_Real, size, HYPRE_MEMORY_HOST); - for (i= 0; i< size; i++) + copy_diag = hypre_TAlloc(HYPRE_Real, size, HYPRE_MEMORY_HOST); + for (i = 0; i < size; i++) { - copy_diag[i]= diag[i]; + copy_diag[i] = diag[i]; } /* forward substitution */ - for (i= 1; i< size; i++) + for (i = 1; i < size; i++) { - multiplier= -lower[i]/copy_diag[i-1]; - copy_diag[i]+= multiplier*upper[i-1]; - rhs[i] += multiplier*rhs[i-1]; + multiplier = -lower[i] / copy_diag[i - 1]; + copy_diag[i] += multiplier * upper[i - 1]; + rhs[i] += multiplier * rhs[i - 1]; } /* backward substitution */ - rhs[size1]/= copy_diag[size1]; - for (i= size1-1; i>= 0; i--) + rhs[size1] /= copy_diag[size1]; + for (i = size1 - 1; i >= 0; i--) { - rhs[i]= (rhs[i] - upper[i]*rhs[i+1])/copy_diag[i]; + rhs[i] = (rhs[i] - upper[i] * rhs[i + 1]) / copy_diag[i]; } hypre_TFree(copy_diag, HYPRE_MEMORY_HOST); diff --git a/external/hypre/src/sstruct_ls/maxwell_solve.c b/external/hypre/src/sstruct_ls/maxwell_solve.c index 78e25edb..d732359a 100644 --- a/external/hypre/src/sstruct_ls/maxwell_solve.c +++ b/external/hypre/src/sstruct_ls/maxwell_solve.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -20,6 +20,8 @@ hypre_MaxwellSolve( void *maxwell_vdata, hypre_SStructVector *f, hypre_SStructVector *u ) { + HYPRE_UNUSED_VAR(A_in); + hypre_MaxwellData *maxwell_data = (hypre_MaxwellData *) maxwell_vdata; hypre_ParVector *f_edge; @@ -42,7 +44,7 @@ hypre_MaxwellSolve( void *maxwell_vdata, hypre_ParVector **nVtemp_l = maxwell_data-> nVtemp_l; hypre_ParVector **nVtemp2_l = maxwell_data-> nVtemp2_l; HYPRE_Int **nCF_marker_l = maxwell_data-> nCF_marker_l; - HYPRE_Real *nrelax_weight= maxwell_data-> nrelax_weight; + HYPRE_Real *nrelax_weight = maxwell_data-> nrelax_weight; HYPRE_Real *nomega = maxwell_data-> nomega; HYPRE_Int nrelax_type = maxwell_data-> nrelax_type; HYPRE_Int node_numlevs = maxwell_data-> node_numlevels; @@ -63,13 +65,13 @@ hypre_MaxwellSolve( void *maxwell_vdata, hypre_ParVector **eVtemp_l = maxwell_data-> eVtemp_l; hypre_ParVector **eVtemp2_l = maxwell_data-> eVtemp2_l; HYPRE_Int **eCF_marker_l = maxwell_data-> eCF_marker_l; - HYPRE_Real *erelax_weight= maxwell_data-> erelax_weight; + HYPRE_Real *erelax_weight = maxwell_data-> erelax_weight; HYPRE_Real *eomega = maxwell_data-> eomega; HYPRE_Int erelax_type = maxwell_data-> erelax_type; HYPRE_Int edge_numlevs = maxwell_data-> edge_numlevels; HYPRE_Int **BdryRanks_l = maxwell_data-> BdryRanks_l; - HYPRE_Int *BdryRanksCnts_l= maxwell_data-> BdryRanksCnts_l; + HYPRE_Int *BdryRanksCnts_l = maxwell_data-> BdryRanksCnts_l; HYPRE_Int logging = maxwell_data-> logging; HYPRE_Real *norms = maxwell_data-> norms; @@ -86,7 +88,7 @@ hypre_MaxwellSolve( void *maxwell_vdata, /* added for the relaxation routines */ hypre_ParVector *ze = NULL; -#if !defined(HYPRE_USING_CUDA) && !defined(HYPRE_USING_HIP) +#if !defined(HYPRE_USING_CUDA) && !defined(HYPRE_USING_HIP) &&!defined(HYPRE_USING_SYCL) /* GPU impl. needs ze */ if (hypre_NumThreads() > 1) #endif @@ -105,15 +107,15 @@ hypre_MaxwellSolve( void *maxwell_vdata, hypre_SStructVectorConvert(u, &u_edge); hypre_ParVectorZeroBCValues(f_edge, BdryRanks_l[0], BdryRanksCnts_l[0]); hypre_ParVectorZeroBCValues(u_edge, BdryRanks_l[0], BdryRanksCnts_l[0]); - be_l[0]= f_edge; - xe_l[0]= u_edge; + be_l[0] = f_edge; + xe_l[0] = u_edge; /* the nodal fine vectors: bn= T'*be, xn= 0. */ hypre_ParCSRMatrixMatvec(1.0, T_transpose, f_edge, 0.0, bn_l[0]); hypre_ParVectorSetConstantValues(xn_l[0], 0.0); - relax_local= 0; - cycle_param= 0; + relax_local = 0; + cycle_param = 0; (maxwell_data-> num_iterations) = 0; /* if max_iter is zero, return */ @@ -134,8 +136,8 @@ hypre_MaxwellSolve( void *maxwell_vdata, if (tol > 0.0) { /* eps = (tol^2) */ - b_dot_b= hypre_ParVectorInnerProd(be_l[0], be_l[0]); - eps = tol*tol; + b_dot_b = hypre_ParVectorInnerProd(be_l[0], be_l[0]); + eps = tol * tol; /* if rhs is zero, return a zero solution */ if (b_dot_b == 0.0) @@ -177,7 +179,7 @@ hypre_MaxwellSolve( void *maxwell_vdata, { hypre_ParVectorCopy(bn_l[0], nVtemp_l[0]); hypre_ParCSRMatrixMatvecT(-1.0, Aen_l[0], xe_l[0], - 1.0, nVtemp_l[0]); + 1.0, nVtemp_l[0]); hypre_BoomerAMGRelaxIF(Ann_l[0], nVtemp_l[0], @@ -195,7 +197,7 @@ hypre_MaxwellSolve( void *maxwell_vdata, /* update edge right-hand fe_l= fe_l-Aen_l*xn_l[0] */ hypre_ParVectorCopy(be_l[0], eVtemp_l[0]); hypre_ParCSRMatrixMatvec(-1.0, Aen_l[0], xn_l[0], - 1.0, eVtemp_l[0]); + 1.0, eVtemp_l[0]); hypre_ParVectorZeroBCValues(eVtemp_l[0], BdryRanks_l[0], BdryRanksCnts_l[0]); @@ -228,14 +230,14 @@ hypre_MaxwellSolve( void *maxwell_vdata, /* convergence check */ if (tol > 0.0) { - r_dot_r= hypre_ParVectorInnerProd(rese_l[0], rese_l[0]); + r_dot_r = hypre_ParVectorInnerProd(rese_l[0], rese_l[0]); if (logging > 0) { - norms[i] = sqrt(r_dot_r); + norms[i] = hypre_sqrt(r_dot_r); if (b_dot_b > 0) { - rel_norms[i] = sqrt(r_dot_r/b_dot_b); + rel_norms[i] = hypre_sqrt(r_dot_r / b_dot_b); } else { @@ -244,11 +246,11 @@ hypre_MaxwellSolve( void *maxwell_vdata, } /* always do at least 1 V-cycle */ - if ((r_dot_r/b_dot_b < eps) && (i > 0)) + if ((r_dot_r / b_dot_b < eps) && (i > 0)) { if (rel_change) { - if ((e_dot_e/x_dot_x) < eps) + if ((e_dot_e / x_dot_x) < eps) { break; } @@ -266,7 +268,7 @@ hypre_MaxwellSolve( void *maxwell_vdata, bn_l[1]); hypre_ParCSRMatrixMatvecT(1.0, - (hypre_ParCSRMatrix *) hypre_IJMatrixObject(ReT_l[0]), + (hypre_ParCSRMatrix *) hypre_IJMatrixObject(ReT_l[0]), rese_l[0], 0.0, be_l[1]); hypre_ParVectorZeroBCValues(be_l[1], BdryRanks_l[1], @@ -278,7 +280,7 @@ hypre_MaxwellSolve( void *maxwell_vdata, } /* if (en_numlevs > 1) */ - for (level = 1; level<= en_numlevs-2; level++) + for (level = 1; level <= en_numlevs - 2; level++) { /*----------------------------------------------- * Down cycle @@ -289,7 +291,7 @@ hypre_MaxwellSolve( void *maxwell_vdata, if (j) { hypre_ParCSRMatrixMatvecT(-1.0, Aen_l[level], - xe_l[level], 1.0, nVtemp_l[level]); + xe_l[level], 1.0, nVtemp_l[level]); } hypre_BoomerAMGRelaxIF(Ann_l[level], nVtemp_l[level], @@ -328,33 +330,33 @@ hypre_MaxwellSolve( void *maxwell_vdata, /* compute residuals */ hypre_ParVectorCopy(bn_l[level], resn_l[level]); hypre_ParCSRMatrixMatvec(-1.0, Ann_l[level], xn_l[level], - 1.0, resn_l[level]); + 1.0, resn_l[level]); hypre_ParCSRMatrixMatvecT(-1.0, Aen_l[level], xe_l[level], - 1.0, resn_l[level]); + 1.0, resn_l[level]); hypre_ParVectorCopy(be_l[level], rese_l[level]); hypre_ParCSRMatrixMatvec(-1.0, Aee_l[level], xe_l[level], - 1.0, rese_l[level]); + 1.0, rese_l[level]); hypre_ParCSRMatrixMatvec(-1.0, Aen_l[level], xn_l[level], - 1.0, rese_l[level]); + 1.0, rese_l[level]); hypre_ParVectorZeroBCValues(rese_l[level], BdryRanks_l[level], BdryRanksCnts_l[level]); /* restrict residuals */ hypre_ParCSRMatrixMatvecT(1.0, RnT_l[level], resn_l[level], - 0.0, bn_l[level+1]); + 0.0, bn_l[level + 1]); hypre_ParCSRMatrixMatvecT(1.0, - (hypre_ParCSRMatrix *) hypre_IJMatrixObject(ReT_l[level]), - rese_l[level], 0.0, be_l[level+1]); + (hypre_ParCSRMatrix *) hypre_IJMatrixObject(ReT_l[level]), + rese_l[level], 0.0, be_l[level + 1]); - hypre_ParVectorZeroBCValues(be_l[level+1], BdryRanks_l[level+1], - BdryRanksCnts_l[level+1]); + hypre_ParVectorZeroBCValues(be_l[level + 1], BdryRanks_l[level + 1], + BdryRanksCnts_l[level + 1]); /* zero off initial guess for the next level */ - hypre_ParVectorSetConstantValues(xn_l[level+1], 0.0); - hypre_ParVectorSetConstantValues(xe_l[level+1], 0.0); + hypre_ParVectorSetConstantValues(xn_l[level + 1], 0.0); + hypre_ParVectorSetConstantValues(xe_l[level + 1], 0.0); } /* for (level = 0; level<= en_numlevels-2; level++) */ @@ -363,11 +365,11 @@ hypre_MaxwellSolve( void *maxwell_vdata, * cycling down if there are more than en_numlevels levels for * one of the node or edge dofs. *----------------------------------------------------------------*/ - level = en_numlevs-1; + level = en_numlevs - 1; /* npre_relax if not the coarsest level. Otherwise, relax once.*/ if ( (en_numlevs != edge_numlevs) - || (en_numlevs != node_numlevs) ) + || (en_numlevs != node_numlevs) ) { for (j = 0; j < npre_relax; j++) { @@ -430,7 +432,7 @@ hypre_MaxwellSolve( void *maxwell_vdata, hypre_ParVectorCopy(be_l[level], eVtemp_l[level]); hypre_ParCSRMatrixMatvec(-1.0, Aen_l[level], xn_l[level], - 1.0, eVtemp_l[level]); + 1.0, eVtemp_l[level]); hypre_ParVectorZeroBCValues(eVtemp_l[level], BdryRanks_l[level], BdryRanksCnts_l[level]); @@ -456,14 +458,14 @@ hypre_MaxwellSolve( void *maxwell_vdata, hypre_ParCSRMatrixMatvec(-1.0, Aee_l[level], xe_l[level], 1.0, rese_l[level]); hypre_ParCSRMatrixMatvecT(1.0, - (hypre_ParCSRMatrix *) hypre_IJMatrixObject(ReT_l[level]), - rese_l[level], 0.0, be_l[level+1]); - hypre_ParVectorZeroBCValues(be_l[level+1], BdryRanks_l[level+1], - BdryRanksCnts_l[level+1]); + (hypre_ParCSRMatrix *) hypre_IJMatrixObject(ReT_l[level]), + rese_l[level], 0.0, be_l[level + 1]); + hypre_ParVectorZeroBCValues(be_l[level + 1], BdryRanks_l[level + 1], + BdryRanksCnts_l[level + 1]); - hypre_ParVectorSetConstantValues(xe_l[level+1], 0.0); + hypre_ParVectorSetConstantValues(xe_l[level + 1], 0.0); - for (level = en_numlevs; level<= edge_numlevs-2; level++) + for (level = en_numlevs; level <= edge_numlevs - 2; level++) { for (j = 0; j < npre_relax; j++) { @@ -484,18 +486,18 @@ hypre_MaxwellSolve( void *maxwell_vdata, /* compute residuals and restrict */ hypre_ParVectorCopy(be_l[level], rese_l[level]); hypre_ParCSRMatrixMatvec(-1.0, Aee_l[level], xe_l[level], - 1.0, rese_l[level]); + 1.0, rese_l[level]); hypre_ParCSRMatrixMatvecT(1.0, - (hypre_ParCSRMatrix *) hypre_IJMatrixObject(ReT_l[level]), - rese_l[level], 0.0, be_l[level+1]); - hypre_ParVectorZeroBCValues(be_l[level+1], BdryRanks_l[level+1], - BdryRanksCnts_l[level+1]); + (hypre_ParCSRMatrix *) hypre_IJMatrixObject(ReT_l[level]), + rese_l[level], 0.0, be_l[level + 1]); + hypre_ParVectorZeroBCValues(be_l[level + 1], BdryRanks_l[level + 1], + BdryRanksCnts_l[level + 1]); - hypre_ParVectorSetConstantValues(xe_l[level+1], 0.0); + hypre_ParVectorSetConstantValues(xe_l[level + 1], 0.0); } /* for (level = en_numlevs; level< edge_numlevs-2; level++) */ /* coarsest relaxation */ - level = edge_numlevs-1; + level = edge_numlevs - 1; hypre_BoomerAMGRelaxIF(Aee_l[level], be_l[level], eCF_marker_l[level], @@ -520,12 +522,12 @@ hypre_MaxwellSolve( void *maxwell_vdata, hypre_ParCSRMatrixMatvec(-1.0, Ann_l[level], xn_l[level], 1.0, resn_l[level]); hypre_ParCSRMatrixMatvecT(1.0, - (hypre_ParCSRMatrix *) RnT_l[level], - resn_l[level], 0.0, bn_l[level+1]); + (hypre_ParCSRMatrix *) RnT_l[level], + resn_l[level], 0.0, bn_l[level + 1]); - hypre_ParVectorSetConstantValues(xn_l[level+1], 0.0); + hypre_ParVectorSetConstantValues(xn_l[level + 1], 0.0); - for (level = en_numlevs; level<= node_numlevs-2; level++) + for (level = en_numlevs; level <= node_numlevs - 2; level++) { for (j = 0; j < npre_relax; j++) { @@ -546,15 +548,15 @@ hypre_MaxwellSolve( void *maxwell_vdata, /* compute residuals and restrict */ hypre_ParVectorCopy(bn_l[level], resn_l[level]); hypre_ParCSRMatrixMatvec(-1.0, Ann_l[level], xn_l[level], - 1.0, resn_l[level]); + 1.0, resn_l[level]); hypre_ParCSRMatrixMatvecT(1.0, RnT_l[level], resn_l[level], - 0.0, bn_l[level+1]); + 0.0, bn_l[level + 1]); - hypre_ParVectorSetConstantValues(xn_l[level+1], 0.0); + hypre_ParVectorSetConstantValues(xn_l[level + 1], 0.0); } /* for (level = en_numlevs; level<= node_numlevs-2; level++) */ /* coarsest relaxation */ - level = node_numlevs-1; + level = node_numlevs - 1; hypre_BoomerAMGRelaxIF(Ann_l[level], bn_l[level], nCF_marker_l[level], @@ -575,11 +577,11 @@ hypre_MaxwellSolve( void *maxwell_vdata, *---------------------------------------------------------------------*/ if (edge_numlevs > en_numlevs) { - for (level = (edge_numlevs - 2); level>= en_numlevs-1; level--) + for (level = (edge_numlevs - 2); level >= en_numlevs - 1; level--) { hypre_ParCSRMatrixMatvec(1.0, - (hypre_ParCSRMatrix *) hypre_IJMatrixObject(Pe_l[level]), - xe_l[level+1], 0.0, ee_l[level]); + (hypre_ParCSRMatrix *) hypre_IJMatrixObject(Pe_l[level]), + xe_l[level + 1], 0.0, ee_l[level]); hypre_ParVectorZeroBCValues(ee_l[level], BdryRanks_l[level], BdryRanksCnts_l[level]); hypre_ParVectorAxpy(1.0, ee_l[level], xe_l[level]); @@ -606,9 +608,9 @@ hypre_MaxwellSolve( void *maxwell_vdata, else if (node_numlevs > en_numlevs) { - for (level = (node_numlevs - 2); level>= en_numlevs-1; level--) + for (level = (node_numlevs - 2); level >= en_numlevs - 1; level--) { - hypre_ParCSRMatrixMatvec(1.0, Pn_l[level], xn_l[level+1], 0.0, + hypre_ParCSRMatrixMatvec(1.0, Pn_l[level], xn_l[level + 1], 0.0, en_l[level]); hypre_ParVectorAxpy(1.0, en_l[level], xn_l[level]); @@ -635,15 +637,15 @@ hypre_MaxwellSolve( void *maxwell_vdata, /*--------------------------------------------------------------------- * Cycle up the common levels. *---------------------------------------------------------------------*/ - for (level = (en_numlevs - 2); level>= 1; level--) + for (level = (en_numlevs - 2); level >= 1; level--) { - hypre_ParCSRMatrixMatvec(1.0, Pn_l[level], xn_l[level+1], 0.0, + hypre_ParCSRMatrixMatvec(1.0, Pn_l[level], xn_l[level + 1], 0.0, en_l[level]); hypre_ParVectorAxpy(1.0, en_l[level], xn_l[level]); hypre_ParCSRMatrixMatvec(1.0, - (hypre_ParCSRMatrix *) hypre_IJMatrixObject(Pe_l[level]), - xe_l[level+1], 0.0, ee_l[level]); + (hypre_ParCSRMatrix *) hypre_IJMatrixObject(Pe_l[level]), + xe_l[level + 1], 0.0, ee_l[level]); hypre_ParVectorZeroBCValues(ee_l[level], BdryRanks_l[level], BdryRanksCnts_l[level]); hypre_ParVectorAxpy(1.0, ee_l[level], xe_l[level]); @@ -653,7 +655,7 @@ hypre_MaxwellSolve( void *maxwell_vdata, { hypre_ParVectorCopy(bn_l[level], nVtemp_l[level]); hypre_ParCSRMatrixMatvecT(-1.0, Aen_l[level], xe_l[level], - 1.0, nVtemp_l[level]); + 1.0, nVtemp_l[level]); hypre_BoomerAMGRelaxIF(Ann_l[level], nVtemp_l[level], nCF_marker_l[level], @@ -669,7 +671,7 @@ hypre_MaxwellSolve( void *maxwell_vdata, hypre_ParVectorCopy(be_l[level], eVtemp_l[level]); hypre_ParCSRMatrixMatvec(-1.0, Aen_l[level], xn_l[level], - 1.0, eVtemp_l[level]); + 1.0, eVtemp_l[level]); hypre_ParVectorZeroBCValues(eVtemp_l[level], BdryRanks_l[level], BdryRanksCnts_l[level]); @@ -694,7 +696,7 @@ hypre_MaxwellSolve( void *maxwell_vdata, hypre_ParVectorAxpy(1.0, en_l[0], xn_l[0]); hypre_ParCSRMatrixMatvec(1.0, - (hypre_ParCSRMatrix *) hypre_IJMatrixObject(Pe_l[0]), + (hypre_ParCSRMatrix *) hypre_IJMatrixObject(Pe_l[0]), xe_l[1], 0.0, ee_l[0]); hypre_ParVectorZeroBCValues(ee_l[0], BdryRanks_l[0], BdryRanksCnts_l[0]); @@ -711,14 +713,14 @@ hypre_MaxwellSolve( void *maxwell_vdata, ee_l[0]); hypre_ParVectorZeroBCValues(ee_l[0], BdryRanks_l[0], BdryRanksCnts_l[0]); - e_dot_e= hypre_ParVectorInnerProd(ee_l[0], ee_l[0]); + e_dot_e = hypre_ParVectorInnerProd(ee_l[0], ee_l[0]); hypre_ParVectorCopy(xe_l[0], eVtemp_l[0]); hypre_ParCSRMatrixMatvec(1.0, Tgrad, xn_l[0], 1.0, eVtemp_l[0]); hypre_ParVectorZeroBCValues(eVtemp_l[0], BdryRanks_l[0], BdryRanksCnts_l[0]); - x_dot_x= hypre_ParVectorInnerProd(eVtemp_l[0], eVtemp_l[0]); + x_dot_x = hypre_ParVectorInnerProd(eVtemp_l[0], eVtemp_l[0]); } else { @@ -733,7 +735,7 @@ hypre_MaxwellSolve( void *maxwell_vdata, { hypre_ParVectorCopy(bn_l[0], nVtemp_l[0]); hypre_ParCSRMatrixMatvecT(-1.0, Aen_l[0], xe_l[0], - 1.0, nVtemp_l[0]); + 1.0, nVtemp_l[0]); hypre_BoomerAMGRelaxIF(Ann_l[0], nVtemp_l[0], nCF_marker_l[0], diff --git a/external/hypre/src/sstruct_ls/maxwell_solve2.c b/external/hypre/src/sstruct_ls/maxwell_solve2.c index 950ffbda..a478e790 100644 --- a/external/hypre/src/sstruct_ls/maxwell_solve2.c +++ b/external/hypre/src/sstruct_ls/maxwell_solve2.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -20,6 +20,8 @@ hypre_MaxwellSolve2( void *maxwell_vdata, hypre_SStructVector *f, hypre_SStructVector *u ) { + HYPRE_UNUSED_VAR(A_in); + hypre_MaxwellData *maxwell_data = (hypre_MaxwellData *)maxwell_vdata; hypre_ParVector *f_edge; @@ -41,7 +43,7 @@ hypre_MaxwellSolve2( void *maxwell_vdata, hypre_ParVector **en_l = maxwell_data-> en_l; hypre_ParVector **nVtemp2_l = maxwell_data-> nVtemp2_l; HYPRE_Int **nCF_marker_l = maxwell_data-> nCF_marker_l; - HYPRE_Real *nrelax_weight= maxwell_data-> nrelax_weight; + HYPRE_Real *nrelax_weight = maxwell_data-> nrelax_weight; HYPRE_Real *nomega = maxwell_data-> nomega; HYPRE_Int nrelax_type = maxwell_data-> nrelax_type; HYPRE_Int node_numlevs = maxwell_data-> node_numlevels; @@ -58,13 +60,13 @@ hypre_MaxwellSolve2( void *maxwell_vdata, hypre_ParVector **ee_l = maxwell_data-> ee_l; hypre_ParVector **eVtemp2_l = maxwell_data-> eVtemp2_l; HYPRE_Int **eCF_marker_l = maxwell_data-> eCF_marker_l; - HYPRE_Real *erelax_weight= maxwell_data-> erelax_weight; + HYPRE_Real *erelax_weight = maxwell_data-> erelax_weight; HYPRE_Real *eomega = maxwell_data-> eomega; HYPRE_Int erelax_type = maxwell_data-> erelax_type; HYPRE_Int edge_numlevs = maxwell_data-> edge_numlevels; HYPRE_Int **BdryRanks_l = maxwell_data-> BdryRanks_l; - HYPRE_Int *BdryRanksCnts_l= maxwell_data-> BdryRanksCnts_l; + HYPRE_Int *BdryRanksCnts_l = maxwell_data-> BdryRanksCnts_l; HYPRE_Int logging = maxwell_data-> logging; HYPRE_Real *norms = maxwell_data-> norms; @@ -73,7 +75,7 @@ hypre_MaxwellSolve2( void *maxwell_vdata, HYPRE_Int relax_local, cycle_param; HYPRE_Real b_dot_b = 0, r_dot_r, eps = 0; - HYPRE_Real e_dot_e, x_dot_x; + HYPRE_Real e_dot_e = 1.0, x_dot_x = 1.0; HYPRE_Int i, j; HYPRE_Int level; @@ -86,8 +88,8 @@ hypre_MaxwellSolve2( void *maxwell_vdata, /* Aee is always bigger than Ann */ ze = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(Aee_l[0]), - hypre_ParCSRMatrixGlobalNumRows(Aee_l[0]), - hypre_ParCSRMatrixRowStarts(Aee_l[0])); + hypre_ParCSRMatrixGlobalNumRows(Aee_l[0]), + hypre_ParCSRMatrixRowStarts(Aee_l[0])); hypre_ParVectorInitialize(ze); } @@ -97,14 +99,14 @@ hypre_MaxwellSolve2( void *maxwell_vdata, hypre_SStructVectorConvert(u, &u_edge); hypre_ParVectorZeroBCValues(f_edge, BdryRanks_l[0], BdryRanksCnts_l[0]); hypre_ParVectorZeroBCValues(u_edge, BdryRanks_l[0], BdryRanksCnts_l[0]); - be_l[0]= f_edge; - xe_l[0]= u_edge; + be_l[0] = f_edge; + xe_l[0] = u_edge; /* the nodal fine vectors: xn= 0. bn= T'*(be- Aee*xe) is updated in the cycle. */ hypre_ParVectorSetConstantValues(xn_l[0], 0.0); - relax_local= 0; - cycle_param= 0; + relax_local = 0; + cycle_param = 0; (maxwell_data-> num_iterations) = 0; /* if max_iter is zero, return */ @@ -125,8 +127,8 @@ hypre_MaxwellSolve2( void *maxwell_vdata, if (tol > 0.0) { /* eps = (tol^2) */ - b_dot_b= hypre_ParVectorInnerProd(be_l[0], be_l[0]); - eps = tol*tol; + b_dot_b = hypre_ParVectorInnerProd(be_l[0], be_l[0]); + eps = tol * tol; /* if rhs is zero, return a zero solution */ if (b_dot_b == 0.0) @@ -153,7 +155,7 @@ hypre_MaxwellSolve2( void *maxwell_vdata, *-----------------------------------------------------*/ for (i = 0; i < max_iter; i++) { - /* compute fine grid residual & nodal rhs. */ + /* compute fine grid residual & nodal rhs. */ hypre_ParVectorCopy(be_l[0], rese_l[0]); hypre_ParCSRMatrixMatvec(-1.0, Aee_l[0], xe_l[0], 1.0, rese_l[0]); hypre_ParVectorZeroBCValues(rese_l[0], BdryRanks_l[0], BdryRanksCnts_l[0]); @@ -162,24 +164,30 @@ hypre_MaxwellSolve2( void *maxwell_vdata, /* convergence check */ if (tol > 0.0) { - r_dot_r= hypre_ParVectorInnerProd(rese_l[0], rese_l[0]); + r_dot_r = hypre_ParVectorInnerProd(rese_l[0], rese_l[0]); if (logging > 0) { - norms[i] = sqrt(r_dot_r); + norms[i] = hypre_sqrt(r_dot_r); if (b_dot_b > 0) - rel_norms[i] = sqrt(r_dot_r/b_dot_b); + { + rel_norms[i] = hypre_sqrt(r_dot_r / b_dot_b); + } else + { rel_norms[i] = 0.0; + } } /* always do at least 1 V-cycle */ - if ((r_dot_r/b_dot_b < eps) && (i > 0)) + if ((r_dot_r / b_dot_b < eps) && (i > 0)) { if (rel_change) { - if ((e_dot_e/x_dot_x) < eps) + if ((e_dot_e / x_dot_x) < eps) + { break; + } } else { @@ -190,45 +198,45 @@ hypre_MaxwellSolve2( void *maxwell_vdata, hypre_ParVectorCopy(bn_l[0], resn_l[0]); hypre_ParCSRMatrixMatvec(-1.0, Ann_l[0], xn_l[0], 1.0, resn_l[0]); - r_dot_r= hypre_ParVectorInnerProd(resn_l[0], resn_l[0]); + r_dot_r = hypre_ParVectorInnerProd(resn_l[0], resn_l[0]); - for (level = 0; level<= node_numlevs-2; level++) + for (level = 0; level <= node_numlevs - 2; level++) { /*----------------------------------------------- * Down cycle *-----------------------------------------------*/ - for (j = 0; j < npre_relax; j++) - { - hypre_BoomerAMGRelaxIF(Ann_l[level], - bn_l[level], - nCF_marker_l[level], - nrelax_type, - relax_local, - cycle_param, - nrelax_weight[level], - nomega[level], - NULL, - xn_l[level], - nVtemp2_l[level], - ze); - } /*for (j = 0; j < npre_relax; j++) */ - - /* compute residuals */ - hypre_ParVectorCopy(bn_l[level], resn_l[level]); - hypre_ParCSRMatrixMatvec(-1.0, Ann_l[level], xn_l[level], - 1.0, resn_l[level]); - - /* restrict residuals */ - hypre_ParCSRMatrixMatvecT(1.0, RnT_l[level], resn_l[level], - 0.0, bn_l[level+1]); - - /* zero off initial guess for the next level */ - hypre_ParVectorSetConstantValues(xn_l[level+1], 0.0); + for (j = 0; j < npre_relax; j++) + { + hypre_BoomerAMGRelaxIF(Ann_l[level], + bn_l[level], + nCF_marker_l[level], + nrelax_type, + relax_local, + cycle_param, + nrelax_weight[level], + nomega[level], + NULL, + xn_l[level], + nVtemp2_l[level], + ze); + } /*for (j = 0; j < npre_relax; j++) */ + + /* compute residuals */ + hypre_ParVectorCopy(bn_l[level], resn_l[level]); + hypre_ParCSRMatrixMatvec(-1.0, Ann_l[level], xn_l[level], + 1.0, resn_l[level]); + + /* restrict residuals */ + hypre_ParCSRMatrixMatvecT(1.0, RnT_l[level], resn_l[level], + 0.0, bn_l[level + 1]); + + /* zero off initial guess for the next level */ + hypre_ParVectorSetConstantValues(xn_l[level + 1], 0.0); } /* for (level = 0; level<= node_numlevs-2; level++) */ /* coarsest node solve */ - level = node_numlevs-1; + level = node_numlevs - 1; hypre_BoomerAMGRelaxIF(Ann_l[level], bn_l[level], nCF_marker_l[level], @@ -242,31 +250,31 @@ hypre_MaxwellSolve2( void *maxwell_vdata, nVtemp2_l[level], ze); - /*--------------------------------------------------------------------- - * Cycle up the levels. - *---------------------------------------------------------------------*/ - for (level = (node_numlevs - 2); level>= 1; level--) + /*--------------------------------------------------------------------- + * Cycle up the levels. + *---------------------------------------------------------------------*/ + for (level = (node_numlevs - 2); level >= 1; level--) { - hypre_ParCSRMatrixMatvec(1.0, Pn_l[level], xn_l[level+1], 0.0, - en_l[level]); - hypre_ParVectorAxpy(1.0, en_l[level], xn_l[level]); - - /* post smooth */ - for (j = 0; j < npost_relax; j++) - { - hypre_BoomerAMGRelaxIF(Ann_l[level], - bn_l[level], - nCF_marker_l[level], - nrelax_type, - relax_local, - cycle_param, - nrelax_weight[level], - nomega[level], - NULL, - xn_l[level], - nVtemp2_l[level], - ze); - } + hypre_ParCSRMatrixMatvec(1.0, Pn_l[level], xn_l[level + 1], 0.0, + en_l[level]); + hypre_ParVectorAxpy(1.0, en_l[level], xn_l[level]); + + /* post smooth */ + for (j = 0; j < npost_relax; j++) + { + hypre_BoomerAMGRelaxIF(Ann_l[level], + bn_l[level], + nCF_marker_l[level], + nrelax_type, + relax_local, + cycle_param, + nrelax_weight[level], + nomega[level], + NULL, + xn_l[level], + nVtemp2_l[level], + ze); + } } /* for (level = (en_numlevs - 2); level>= 1; level--) */ /* interpolate error and correct on finest grids */ @@ -296,48 +304,48 @@ hypre_MaxwellSolve2( void *maxwell_vdata, hypre_ParVectorCopy(be_l[0], rese_l[0]); hypre_ParCSRMatrixMatvec(-1.0, Aee_l[0], xe_l[0], 1.0, rese_l[0]); - r_dot_r= hypre_ParVectorInnerProd(rese_l[0], rese_l[0]); + r_dot_r = hypre_ParVectorInnerProd(rese_l[0], rese_l[0]); - for (level = 0; level<= edge_numlevs-2; level++) + for (level = 0; level <= edge_numlevs - 2; level++) { /*----------------------------------------------- * Down cycle *-----------------------------------------------*/ - for (j = 0; j < npre_relax; j++) - { - hypre_BoomerAMGRelaxIF(Aee_l[level], - be_l[level], - eCF_marker_l[level], - erelax_type, - relax_local, - cycle_param, - erelax_weight[level], - eomega[level], - NULL, - xe_l[level], - eVtemp2_l[level], - ze); - } /*for (j = 0; j < npre_relax; j++) */ - - /* compute residuals */ - hypre_ParVectorCopy(be_l[level], rese_l[level]); - hypre_ParCSRMatrixMatvec(-1.0, Aee_l[level], xe_l[level], - 1.0, rese_l[level]); - - /* restrict residuals */ - hypre_ParCSRMatrixMatvecT(1.0, - (hypre_ParCSRMatrix *) hypre_IJMatrixObject(ReT_l[level]), - rese_l[level], 0.0, be_l[level+1]); - hypre_ParVectorZeroBCValues(be_l[level+1], BdryRanks_l[level+1], - BdryRanksCnts_l[level+1]); - - /* zero off initial guess for the next level */ - hypre_ParVectorSetConstantValues(xe_l[level+1], 0.0); + for (j = 0; j < npre_relax; j++) + { + hypre_BoomerAMGRelaxIF(Aee_l[level], + be_l[level], + eCF_marker_l[level], + erelax_type, + relax_local, + cycle_param, + erelax_weight[level], + eomega[level], + NULL, + xe_l[level], + eVtemp2_l[level], + ze); + } /*for (j = 0; j < npre_relax; j++) */ + + /* compute residuals */ + hypre_ParVectorCopy(be_l[level], rese_l[level]); + hypre_ParCSRMatrixMatvec(-1.0, Aee_l[level], xe_l[level], + 1.0, rese_l[level]); + + /* restrict residuals */ + hypre_ParCSRMatrixMatvecT(1.0, + (hypre_ParCSRMatrix *) hypre_IJMatrixObject(ReT_l[level]), + rese_l[level], 0.0, be_l[level + 1]); + hypre_ParVectorZeroBCValues(be_l[level + 1], BdryRanks_l[level + 1], + BdryRanksCnts_l[level + 1]); + + /* zero off initial guess for the next level */ + hypre_ParVectorSetConstantValues(xe_l[level + 1], 0.0); } /* for (level = 1; level<= edge_numlevels-2; level++) */ /* coarsest edge solve */ - level = edge_numlevs-1; + level = edge_numlevs - 1; for (j = 0; j < npre_relax; j++) { hypre_BoomerAMGRelaxIF(Aee_l[level], @@ -354,14 +362,14 @@ hypre_MaxwellSolve2( void *maxwell_vdata, ze); } - /*--------------------------------------------------------------------- - * Up cycle. - *---------------------------------------------------------------------*/ - for (level = (edge_numlevs - 2); level>= 1; level--) + /*--------------------------------------------------------------------- + * Up cycle. + *---------------------------------------------------------------------*/ + for (level = (edge_numlevs - 2); level >= 1; level--) { hypre_ParCSRMatrixMatvec(1.0, - (hypre_ParCSRMatrix *) hypre_IJMatrixObject(Pe_l[level]), - xe_l[level+1], 0.0, ee_l[level]); + (hypre_ParCSRMatrix *) hypre_IJMatrixObject(Pe_l[level]), + xe_l[level + 1], 0.0, ee_l[level]); hypre_ParVectorZeroBCValues(ee_l[level], BdryRanks_l[level], BdryRanksCnts_l[level]); hypre_ParVectorAxpy(1.0, ee_l[level], xe_l[level]); @@ -386,7 +394,7 @@ hypre_MaxwellSolve2( void *maxwell_vdata, /* interpolate error and correct on finest grids */ hypre_ParCSRMatrixMatvec(1.0, - (hypre_ParCSRMatrix *) hypre_IJMatrixObject(Pe_l[0]), + (hypre_ParCSRMatrix *) hypre_IJMatrixObject(Pe_l[0]), xe_l[1], 0.0, ee_l[0]); hypre_ParVectorZeroBCValues(ee_l[0], BdryRanks_l[0], BdryRanksCnts_l[0]); diff --git a/external/hypre/src/sstruct_ls/maxwell_zeroBC.c b/external/hypre/src/sstruct_ls/maxwell_zeroBC.c index 09fb4d26..865ba87e 100644 --- a/external/hypre/src/sstruct_ls/maxwell_zeroBC.c +++ b/external/hypre/src/sstruct_ls/maxwell_zeroBC.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -12,7 +12,7 @@ hypre_ParVectorZeroBCValues(hypre_ParVector *v, HYPRE_Int *rows, HYPRE_Int nrows) { - HYPRE_Int ierr= 0; + HYPRE_Int ierr = 0; hypre_Vector *v_local = hypre_ParVectorLocalVector(v); @@ -31,10 +31,12 @@ hypre_SeqVectorZeroBCValues(hypre_Vector *v, HYPRE_Int ierr = 0; #if defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < nrows; i++) - vector_data[rows[i]]= 0.0; + { + vector_data[rows[i]] = 0.0; + } return ierr; } diff --git a/external/hypre/src/sstruct_ls/nd1_amge_interpolation.c b/external/hypre/src/sstruct_ls/nd1_amge_interpolation.c index f27be534..8af35e78 100644 --- a/external/hypre/src/sstruct_ls/nd1_amge_interpolation.c +++ b/external/hypre/src/sstruct_ls/nd1_amge_interpolation.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -32,21 +32,21 @@ from one group to the next. */ HYPRE_Int hypre_ND1AMGeInterpolation (hypre_ParCSRMatrix * Aee, - hypre_ParCSRMatrix * ELEM_idof, - hypre_ParCSRMatrix * FACE_idof, - hypre_ParCSRMatrix * EDGE_idof, - hypre_ParCSRMatrix * ELEM_FACE, - hypre_ParCSRMatrix * ELEM_EDGE, - HYPRE_Int num_OffProcRows, - hypre_MaxwellOffProcRow ** OffProcRows, - hypre_IJMatrix * IJ_dof_DOF) + hypre_ParCSRMatrix * ELEM_idof, + hypre_ParCSRMatrix * FACE_idof, + hypre_ParCSRMatrix * EDGE_idof, + hypre_ParCSRMatrix * ELEM_FACE, + hypre_ParCSRMatrix * ELEM_EDGE, + HYPRE_Int num_OffProcRows, + hypre_MaxwellOffProcRow ** OffProcRows, + hypre_IJMatrix * IJ_dof_DOF) { HYPRE_Int ierr = 0; HYPRE_Int i, j; HYPRE_BigInt big_k; HYPRE_BigInt *offproc_rnums; - HYPRE_Int *swap; + HYPRE_Int *swap = NULL; hypre_ParCSRMatrix * dof_DOF = (hypre_ParCSRMatrix *)hypre_IJMatrixObject(IJ_dof_DOF); hypre_ParCSRMatrix * ELEM_DOF = ELEM_EDGE; @@ -58,7 +58,7 @@ HYPRE_Int hypre_ND1AMGeInterpolation (hypre_ParCSRMatrix * Aee, HYPRE_Int getrow_ierr; HYPRE_Int three_dimensional_problem; - MPI_Comm comm= hypre_ParCSRMatrixComm(Aee); + MPI_Comm comm = hypre_ParCSRMatrixComm(Aee); HYPRE_Int myproc; hypre_MPI_Comm_rank(comm, &myproc); @@ -75,31 +75,37 @@ HYPRE_Int hypre_ND1AMGeInterpolation (hypre_ParCSRMatrix * Aee, hypre_IJMatrixAssembleFlag(ij_dof_DOF) = 1; #endif - /* sort the offproc rows to get quicker comparison for later */ + /* sort the offproc rows to get quicker comparison for later */ if (num_OffProcRows) { - offproc_rnums= hypre_TAlloc(HYPRE_BigInt, num_OffProcRows, HYPRE_MEMORY_HOST); - swap = hypre_TAlloc(HYPRE_Int, num_OffProcRows, HYPRE_MEMORY_HOST); - for (i= 0; i< num_OffProcRows; i++) + offproc_rnums = hypre_TAlloc(HYPRE_BigInt, num_OffProcRows, HYPRE_MEMORY_HOST); + swap = hypre_TAlloc(HYPRE_Int, num_OffProcRows, HYPRE_MEMORY_HOST); + for (i = 0; i < num_OffProcRows; i++) { - offproc_rnums[i]=(OffProcRows[i] -> row); - swap[i] = i; + offproc_rnums[i] = (OffProcRows[i] -> row); + swap[i] = i; } } if (num_OffProcRows > 1) { - hypre_BigQsortbi(offproc_rnums, swap, 0, num_OffProcRows-1); + hypre_BigQsortbi(offproc_rnums, swap, 0, num_OffProcRows - 1); } if (FACE_idof == EDGE_idof) + { three_dimensional_problem = 0; + } else + { three_dimensional_problem = 1; + } /* ELEM_FACEidof = ELEM_FACE x FACE_idof */ if (three_dimensional_problem) + { ELEM_FACEidof = hypre_ParMatmul(ELEM_FACE, FACE_idof); + } /* ELEM_EDGEidof = ELEM_EDGE x EDGE_idof */ ELEM_EDGEidof = hypre_ParMatmul(ELEM_EDGE, EDGE_idof); @@ -121,57 +127,62 @@ HYPRE_Int hypre_ND1AMGeInterpolation (hypre_ParCSRMatrix * Aee, /* Determine the coarse DOFs */ hypre_ParCSRMatrixGetRow (ELEM_DOF, big_k, &num_DOF, &DOF0, &boolean_data); - DOF= hypre_TAlloc(HYPRE_BigInt, num_DOF, HYPRE_MEMORY_HOST); - for (j= 0; j< num_DOF; j++) + DOF = hypre_TAlloc(HYPRE_BigInt, num_DOF, HYPRE_MEMORY_HOST); + for (j = 0; j < num_DOF; j++) { - DOF[j]= DOF0[j]; + DOF[j] = DOF0[j]; } hypre_ParCSRMatrixRestoreRow (ELEM_DOF, big_k, &num_DOF, &DOF0, &boolean_data); - hypre_BigQsort0(DOF,0,num_DOF-1); + hypre_BigQsort0(DOF, 0, num_DOF - 1); /* Find the fine dofs interior for the current coarse element */ hypre_ParCSRMatrixGetRow (ELEM_idof, big_k, &num_idof, &idof0, &boolean_data); - idof= hypre_TAlloc(HYPRE_BigInt, num_idof, HYPRE_MEMORY_HOST); - for (j= 0; j< num_idof; j++) + idof = hypre_TAlloc(HYPRE_BigInt, num_idof, HYPRE_MEMORY_HOST); + for (j = 0; j < num_idof; j++) { - idof[j]= idof0[j]; + idof[j] = idof0[j]; } hypre_ParCSRMatrixRestoreRow (ELEM_idof, big_k, &num_idof, &idof0, &boolean_data); /* Sort the interior dofs according to their global number */ - hypre_BigQsort0(idof,0,num_idof-1); + hypre_BigQsort0(idof, 0, num_idof - 1); /* Find the fine dofs on the boundary of the current coarse element */ if (three_dimensional_problem) { hypre_ParCSRMatrixGetRow (ELEM_FACEidof, big_k, &size1, &col_ind0, &boolean_data); - col_ind1= hypre_TAlloc(HYPRE_BigInt, size1, HYPRE_MEMORY_HOST); - for (j= 0; j< size1; j++) + col_ind1 = hypre_TAlloc(HYPRE_BigInt, size1, HYPRE_MEMORY_HOST); + for (j = 0; j < size1; j++) { - col_ind1[j]= col_ind0[j]; + col_ind1[j] = col_ind0[j]; } hypre_ParCSRMatrixRestoreRow (ELEM_FACEidof, big_k, &size1, &col_ind0, &boolean_data); } else + { + col_ind1 = NULL; size1 = 0; + } hypre_ParCSRMatrixGetRow (ELEM_EDGEidof, big_k, &size2, &col_ind0, &boolean_data); - col_ind2= hypre_TAlloc(HYPRE_BigInt, size2, HYPRE_MEMORY_HOST); - for (j= 0; j< size2; j++) + col_ind2 = hypre_TAlloc(HYPRE_BigInt, size2, HYPRE_MEMORY_HOST); + for (j = 0; j < size2; j++) { - col_ind2[j]= col_ind0[j]; + col_ind2[j] = col_ind0[j]; } hypre_ParCSRMatrixRestoreRow (ELEM_EDGEidof, big_k, &size2, &col_ind0, &boolean_data); /* Merge and sort the boundary dofs according to their global number */ num_bdof = size1 + size2; - bdof = hypre_CTAlloc(HYPRE_BigInt, num_bdof, HYPRE_MEMORY_HOST); + bdof = hypre_CTAlloc(HYPRE_BigInt, num_bdof, HYPRE_MEMORY_HOST); if (three_dimensional_problem) - hypre_TMemcpy(bdof, col_ind1, HYPRE_BigInt, size1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); - hypre_TMemcpy(bdof+size1, col_ind2, HYPRE_BigInt, size2, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + { + hypre_TMemcpy(bdof, col_ind1, HYPRE_BigInt, size1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + } + hypre_TMemcpy(bdof + size1, col_ind2, HYPRE_BigInt, size2, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); - hypre_BigQsort0(bdof,0,num_bdof-1); + hypre_BigQsort0(bdof, 0, num_bdof - 1); /* A = extract_rows(Aee, idof) */ A = hypre_CSRMatrixCreate (num_idof, num_idof + num_bdof, @@ -181,22 +192,26 @@ HYPRE_Int hypre_ND1AMGeInterpolation (hypre_ParCSRMatrix * Aee, HYPRE_Int *I = hypre_CSRMatrixI(A); HYPRE_BigInt *J = hypre_CSRMatrixBigJ(A); HYPRE_Real *data = hypre_CSRMatrixData(A); - HYPRE_BigInt *tmp_J; HYPRE_Real *tmp_data; + HYPRE_MemoryLocation memory_location_A = hypre_CSRMatrixMemoryLocation(A); + HYPRE_MemoryLocation memory_location_Aee = hypre_ParCSRMatrixMemoryLocation(Aee); + I[0] = 0; for (j = 0; j < num_idof; j++) { - getrow_ierr= hypre_ParCSRMatrixGetRow (Aee, idof[j], &I[j+1], &tmp_J, &tmp_data); - if (getrow_ierr <0) - hypre_printf("getrow Aee off proc[%d] = \n",myproc); - hypre_TMemcpy(J, tmp_J, HYPRE_BigInt, I[j+1], HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); - hypre_TMemcpy(data, tmp_data, HYPRE_Real, I[j+1], HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); - J+= I[j+1]; - data+= I[j+1]; - hypre_ParCSRMatrixRestoreRow (Aee, idof[j], &I[j+1], &tmp_J, &tmp_data); - I[j+1] += I[j]; + getrow_ierr = hypre_ParCSRMatrixGetRow (Aee, idof[j], &size1, &tmp_J, &tmp_data); + if (getrow_ierr < 0) + { + hypre_printf("getrow Aee off proc[%d] = \n", myproc); + } + hypre_TMemcpy(J, tmp_J, HYPRE_BigInt, size1, memory_location_A, memory_location_Aee); + hypre_TMemcpy(data, tmp_data, HYPRE_Real, size1, memory_location_A, memory_location_Aee); + J += size1; + data += size1; + hypre_ParCSRMatrixRestoreRow (Aee, idof[j], &size1, &tmp_J, &tmp_data); + I[j + 1] = size1 + I[j]; } } @@ -204,6 +219,7 @@ HYPRE_Int hypre_ND1AMGeInterpolation (hypre_ParCSRMatrix * Aee, P = hypre_CSRMatrixCreate (num_idof + num_bdof, num_DOF, (num_idof + num_bdof) * num_DOF); hypre_CSRMatrixBigInitialize(P); + { HYPRE_Int *I = hypre_CSRMatrixI(P); HYPRE_BigInt *J = hypre_CSRMatrixBigJ(P); @@ -212,29 +228,32 @@ HYPRE_Int hypre_ND1AMGeInterpolation (hypre_ParCSRMatrix * Aee, HYPRE_BigInt *tmp_J; HYPRE_Real *tmp_data; - + + HYPRE_MemoryLocation memory_location_P = hypre_CSRMatrixMemoryLocation(P); + HYPRE_MemoryLocation memory_location_d = hypre_ParCSRMatrixMemoryLocation(dof_DOF); + I[0] = 0; for (j = 0; j < num_idof; j++) { - getrow_ierr= hypre_ParCSRMatrixGetRow (dof_DOF, idof[j], &I[j+1], &tmp_J, &tmp_data); + getrow_ierr = hypre_ParCSRMatrixGetRow (dof_DOF, idof[j], &size1, &tmp_J, &tmp_data); if (getrow_ierr >= 0) { - hypre_TMemcpy(J, tmp_J, HYPRE_BigInt, I[j+1], HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); - hypre_TMemcpy(data, tmp_data, HYPRE_Real, I[j+1], HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); - J+= I[j+1]; - data+= I[j+1]; - hypre_ParCSRMatrixRestoreRow (dof_DOF, idof[j], &I[j+1], &tmp_J, &tmp_data); - I[j+1] += I[j]; + hypre_TMemcpy(J, tmp_J, HYPRE_BigInt, size1, memory_location_P, memory_location_d); + hypre_TMemcpy(data, tmp_data, HYPRE_Real, size1, memory_location_P, memory_location_d); + J += size1; + data += size1; + hypre_ParCSRMatrixRestoreRow (dof_DOF, idof[j], &size1, &tmp_J, &tmp_data); + I[j + 1] = size1 + I[j]; } else /* row offproc */ { - hypre_ParCSRMatrixRestoreRow (dof_DOF, idof[j], &I[j+1], &tmp_J, &tmp_data); - /* search for OffProcRows */ - m= 0; + hypre_ParCSRMatrixRestoreRow (dof_DOF, idof[j], &size1, &tmp_J, &tmp_data); + /* search for OffProcRows */ + m = 0; while (m < num_OffProcRows) { if (offproc_rnums[m] == idof[j]) - { + { break; } else @@ -242,37 +261,37 @@ HYPRE_Int hypre_ND1AMGeInterpolation (hypre_ParCSRMatrix * Aee, m++; } } - I[j+1]= (OffProcRows[swap[m]] -> ncols); + size1 = (OffProcRows[swap[m]] -> ncols); tmp_J = (OffProcRows[swap[m]] -> cols); - tmp_data= (OffProcRows[swap[m]] -> data); - hypre_TMemcpy(J, tmp_J, HYPRE_BigInt, I[j+1], HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); - hypre_TMemcpy(data, tmp_data, HYPRE_Real, I[j+1], HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); - J+= I[j+1]; - data+= I[j+1]; - I[j+1] += I[j]; + tmp_data = (OffProcRows[swap[m]] -> data); + hypre_TMemcpy(J, tmp_J, HYPRE_BigInt, size1, memory_location_P, HYPRE_MEMORY_HOST); + hypre_TMemcpy(data, tmp_data, HYPRE_Real, size1, memory_location_P, HYPRE_MEMORY_HOST); + J += size1; + data += size1; + I[j + 1] = size1 + I[j]; } - } + for ( ; j < num_idof + num_bdof; j++) { - getrow_ierr= hypre_ParCSRMatrixGetRow (dof_DOF, bdof[j-num_idof], &I[j+1], &tmp_J, &tmp_data); + getrow_ierr = hypre_ParCSRMatrixGetRow (dof_DOF, bdof[j - num_idof], &size1, &tmp_J, &tmp_data); if (getrow_ierr >= 0) { - hypre_TMemcpy(J, tmp_J, HYPRE_BigInt, I[j+1], HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); - hypre_TMemcpy(data, tmp_data, HYPRE_Real, I[j+1], HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); - J+= I[j+1]; - data+= I[j+1]; - hypre_ParCSRMatrixRestoreRow (dof_DOF, bdof[j-num_idof], &I[j+1], &tmp_J, &tmp_data); - I[j+1] += I[j]; + hypre_TMemcpy(J, tmp_J, HYPRE_BigInt, size1, memory_location_P, memory_location_d); + hypre_TMemcpy(data, tmp_data, HYPRE_Real, size1, memory_location_P, memory_location_d); + J += size1; + data += size1; + hypre_ParCSRMatrixRestoreRow (dof_DOF, bdof[j - num_idof], &size1, &tmp_J, &tmp_data); + I[j + 1] = size1 + I[j]; } else /* row offproc */ { - hypre_ParCSRMatrixRestoreRow (dof_DOF, bdof[j-num_idof], &I[j+1], &tmp_J, &tmp_data); - /* search for OffProcRows */ - m= 0; + hypre_ParCSRMatrixRestoreRow (dof_DOF, bdof[j - num_idof], &size1, &tmp_J, &tmp_data); + /* search for OffProcRows */ + m = 0; while (m < num_OffProcRows) { - if (offproc_rnums[m] == bdof[j-num_idof]) + if (offproc_rnums[m] == bdof[j - num_idof]) { break; } @@ -281,15 +300,15 @@ HYPRE_Int hypre_ND1AMGeInterpolation (hypre_ParCSRMatrix * Aee, m++; } } - if (m>= num_OffProcRows)hypre_printf("here the mistake\n"); - I[j+1]= (OffProcRows[swap[m]] -> ncols); + if (m >= num_OffProcRows) { hypre_printf("here the mistake\n"); } + size1 = (OffProcRows[swap[m]] -> ncols); tmp_J = (OffProcRows[swap[m]] -> cols); - tmp_data= (OffProcRows[swap[m]] -> data); - hypre_TMemcpy(J, tmp_J, HYPRE_BigInt, I[j+1], HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); - hypre_TMemcpy(data, tmp_data, HYPRE_Real, I[j+1], HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); - J+= I[j+1]; - data+= I[j+1]; - I[j+1] += I[j]; + tmp_data = (OffProcRows[swap[m]] -> data); + hypre_TMemcpy(J, tmp_J, HYPRE_BigInt, size1, memory_location_P, HYPRE_MEMORY_HOST); + hypre_TMemcpy(data, tmp_data, HYPRE_Real, size1, memory_location_P, HYPRE_MEMORY_HOST); + J += size1; + data += size1; + I[j + 1] = size1 + I[j]; } } } @@ -306,7 +325,7 @@ HYPRE_Int hypre_ND1AMGeInterpolation (hypre_ParCSRMatrix * Aee, for (j = 0; j < num_idof; j++) { ncols[j] = num_DOF; - idof_indexes[j] = j*num_DOF; + idof_indexes[j] = j * num_DOF; } hypre_IJMatrixAddToValuesParCSR (IJ_dof_DOF, @@ -336,7 +355,9 @@ HYPRE_Int hypre_ND1AMGeInterpolation (hypre_ParCSRMatrix * Aee, #endif if (three_dimensional_problem) + { hypre_ParCSRMatrixDestroy(ELEM_FACEidof); + } hypre_ParCSRMatrixDestroy(ELEM_EDGEidof); if (num_OffProcRows) @@ -352,10 +373,10 @@ HYPRE_Int hypre_ND1AMGeInterpolation (hypre_ParCSRMatrix * Aee, HYPRE_Int hypre_HarmonicExtension (hypre_CSRMatrix *A, - hypre_CSRMatrix *P, - HYPRE_Int num_DOF, HYPRE_BigInt *DOF, - HYPRE_Int num_idof, HYPRE_BigInt *idof, - HYPRE_Int num_bdof, HYPRE_BigInt *bdof) + hypre_CSRMatrix *P, + HYPRE_Int num_DOF, HYPRE_BigInt *DOF, + HYPRE_Int num_idof, HYPRE_BigInt *idof, + HYPRE_Int num_bdof, HYPRE_BigInt *bdof) { HYPRE_Int ierr = 0; @@ -370,28 +391,28 @@ HYPRE_Int hypre_HarmonicExtension (hypre_CSRMatrix *A, HYPRE_BigInt *JP = hypre_CSRMatrixBigJ(P); HYPRE_Real *dataP = hypre_CSRMatrixData(P); - HYPRE_Real * Aii = hypre_CTAlloc(HYPRE_Real, num_idof*num_idof, HYPRE_MEMORY_HOST); - HYPRE_Real * Pi = hypre_CTAlloc(HYPRE_Real, num_idof*num_DOF, HYPRE_MEMORY_HOST); + HYPRE_Real * Aii = hypre_CTAlloc(HYPRE_Real, num_idof * num_idof, HYPRE_MEMORY_HOST); + HYPRE_Real * Pi = hypre_CTAlloc(HYPRE_Real, num_idof * num_DOF, HYPRE_MEMORY_HOST); /* Loop over the rows of A */ for (i = 0; i < num_idof; i++) - for (j = IA[i]; j < IA[i+1]; j++) + for (j = IA[i]; j < IA[i + 1]; j++) { /* Global to local*/ - k = hypre_BigBinarySearch(idof,JA[j], num_idof); + k = hypre_BigBinarySearch(idof, JA[j], num_idof); /* If a column is a bdof, compute its participation in Pi = Aib x Pb */ if (k == -1) { - k = hypre_BigBinarySearch(bdof,JA[j], num_bdof); + k = hypre_BigBinarySearch(bdof, JA[j], num_bdof); if (k > -1) { - for (l = IP[k+num_idof]; l < IP[k+num_idof+1]; l++) + for (l = IP[k + num_idof]; l < IP[k + num_idof + 1]; l++) { - m = hypre_BigBinarySearch(DOF,JP[l], num_DOF); + m = hypre_BigBinarySearch(DOF, JP[l], num_DOF); if (m > -1) { - m+=i*num_DOF; - /* Pi[i*num_DOF+m] += dataA[j] * dataP[l];*/ + m += i * num_DOF; + /* Pi[i*num_DOF+m] += dataA[j] * dataP[l];*/ Pi[m] += dataA[j] * dataP[l]; } } @@ -399,32 +420,42 @@ HYPRE_Int hypre_HarmonicExtension (hypre_CSRMatrix *A, } /* If a column is an idof, put it in Aii */ else - Aii[i*num_idof+k] = dataA[j]; + { + Aii[i * num_idof + k] = dataA[j]; + } } /* Perform Gaussian elimination in [Aii, Pi] */ - for (j = 0; j < num_idof-1; j++) - if (Aii[j*num_idof+j] != 0.0) - for (i = j+1; i < num_idof; i++) - if (Aii[i*num_idof+j] != 0.0) + for (j = 0; j < num_idof - 1; j++) + if (Aii[j * num_idof + j] != 0.0) + for (i = j + 1; i < num_idof; i++) + if (Aii[i * num_idof + j] != 0.0) { - factor = Aii[i*num_idof+j]/Aii[j*num_idof+j]; - for (m = j+1; m < num_idof; m++) - Aii[i*num_idof+m] -= factor * Aii[j*num_idof+m]; + factor = Aii[i * num_idof + j] / Aii[j * num_idof + j]; + for (m = j + 1; m < num_idof; m++) + { + Aii[i * num_idof + m] -= factor * Aii[j * num_idof + m]; + } for (m = 0; m < num_DOF; m++) - Pi[i*num_DOF+m] -= factor * Pi[j*num_DOF+m]; + { + Pi[i * num_DOF + m] -= factor * Pi[j * num_DOF + m]; + } } /* Back Substitution */ - for (i = num_idof-1; i >= 0; i--) + for (i = num_idof - 1; i >= 0; i--) { - for (j = i+1; j < num_idof; j++) - if (Aii[i*num_idof+j] != 0.0) + for (j = i + 1; j < num_idof; j++) + if (Aii[i * num_idof + j] != 0.0) for (m = 0; m < num_DOF; m++) - Pi[i*num_DOF+m] -= Aii[i*num_idof+j] * Pi[j*num_DOF+m]; + { + Pi[i * num_DOF + m] -= Aii[i * num_idof + j] * Pi[j * num_DOF + m]; + } for (m = 0; m < num_DOF; m++) - Pi[i*num_DOF+m] /= Aii[i*num_idof+i]; + { + Pi[i * num_DOF + m] /= Aii[i * num_idof + i]; + } } /* Put -Pi back in P. We assume that each idof depends on _all_ DOFs */ @@ -432,7 +463,7 @@ HYPRE_Int hypre_HarmonicExtension (hypre_CSRMatrix *A, for (j = 0; j < num_DOF; j++) { JP[j] = DOF[j]; - dataP[j] = -Pi[i*num_DOF+j]; + dataP[j] = -Pi[i * num_DOF + j]; } hypre_TFree(Aii, HYPRE_MEMORY_HOST); diff --git a/external/hypre/src/sstruct_ls/nd1_amge_interpolation.h b/external/hypre/src/sstruct_ls/nd1_amge_interpolation.h index bfc27000..049b33a8 100644 --- a/external/hypre/src/sstruct_ls/nd1_amge_interpolation.h +++ b/external/hypre/src/sstruct_ls/nd1_amge_interpolation.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -32,14 +32,14 @@ Note: If FACE_iedge == EDGE_iedge the input should describe a 2D problem. */ HYPRE_Int hypre_ND1AMGeInterpolation (hypre_ParCSRMatrix * Aee, - hypre_ParCSRMatrix * ELEM_iedge, - hypre_ParCSRMatrix * FACE_iedge, - hypre_ParCSRMatrix * EDGE_iedge, - hypre_ParCSRMatrix * ELEM_FACE, - hypre_ParCSRMatrix * ELEM_EDGE, - HYPRE_Int num_OffProcRows, - hypre_MaxwellOffProcRow ** OffProcRows, - hypre_IJMatrix * edge_EDGE); + hypre_ParCSRMatrix * ELEM_iedge, + hypre_ParCSRMatrix * FACE_iedge, + hypre_ParCSRMatrix * EDGE_iedge, + hypre_ParCSRMatrix * ELEM_FACE, + hypre_ParCSRMatrix * ELEM_EDGE, + HYPRE_Int num_OffProcRows, + hypre_MaxwellOffProcRow ** OffProcRows, + hypre_IJMatrix * edge_EDGE); /* Function: hypre_HarmonicExtension @@ -54,9 +54,9 @@ HYPRE_Int hypre_ND1AMGeInterpolation (hypre_ParCSRMatrix * Aee, according to the arrays idof and bdof. The only output parameter is Pi. */ HYPRE_Int hypre_HarmonicExtension (hypre_CSRMatrix *A, - hypre_CSRMatrix *P, - HYPRE_Int num_DOF, HYPRE_BigInt *DOF, - HYPRE_Int num_idof, HYPRE_BigInt *idof, - HYPRE_Int num_bdof, HYPRE_BigInt *bdof); + hypre_CSRMatrix *P, + HYPRE_Int num_DOF, HYPRE_BigInt *DOF, + HYPRE_Int num_idof, HYPRE_BigInt *idof, + HYPRE_Int num_bdof, HYPRE_BigInt *bdof); #endif diff --git a/external/hypre/src/sstruct_ls/node_relax.c b/external/hypre/src/sstruct_ls/node_relax.c index 358b35ca..1f9c1bfe 100644 --- a/external/hypre/src/sstruct_ls/node_relax.c +++ b/external/hypre/src/sstruct_ls/node_relax.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -43,7 +43,7 @@ typedef struct /* defines sends and recieves for each struct_vector */ hypre_ComputePkg ***svec_compute_pkgs; - hypre_CommHandle **comm_handle; + hypre_CommHandle **comm_handle; /* defines independent and dependent boxes for computations */ hypre_ComputePkg **compute_pkgs; @@ -55,11 +55,11 @@ typedef struct */ /* pointers for vector and matrix data */ - HYPRE_Real **Ap; - HYPRE_Real **bp; - HYPRE_Real **xp; - HYPRE_Real **tp; - + HYPRE_MemoryLocation memory_location; + HYPRE_Real **Ap; + HYPRE_Real **bp; + HYPRE_Real **xp; + HYPRE_Real **tp; /* log info (always logged) */ HYPRE_Int num_iterations; @@ -76,8 +76,8 @@ hypre_NodeRelaxCreate( MPI_Comm comm ) { hypre_NodeRelaxData *relax_data; - hypre_Index stride; - hypre_Index indices[1]; + hypre_Index stride; + hypre_Index indices[1]; relax_data = hypre_CTAlloc(hypre_NodeRelaxData, 1, HYPRE_MEMORY_HOST); @@ -106,7 +106,7 @@ hypre_NodeRelaxCreate( MPI_Comm comm ) (relax_data -> xp) = NULL; (relax_data -> tp) = NULL; (relax_data -> comm_handle) = NULL; - (relax_data -> svec_compute_pkgs)= NULL; + (relax_data -> svec_compute_pkgs) = NULL; (relax_data -> compute_pkgs) = NULL; hypre_SetIndex3(stride, 1, 1, 1); @@ -124,12 +124,15 @@ HYPRE_Int hypre_NodeRelaxDestroy( void *relax_vdata ) { hypre_NodeRelaxData *relax_data = (hypre_NodeRelaxData *)relax_vdata; - HYPRE_Int i,vi; + HYPRE_Int i, vi; HYPRE_Int nvars; if (relax_data) { + HYPRE_MemoryLocation memory_location = relax_data -> memory_location; + nvars = hypre_SStructPMatrixNVars(relax_data -> A); + for (i = 0; i < (relax_data -> num_nodesets); i++) { hypre_TFree(relax_data -> nodeset_indices[i], HYPRE_MEMORY_HOST); @@ -152,13 +155,13 @@ hypre_NodeRelaxDestroy( void *relax_vdata ) hypre_TFree(relax_data -> compute_pkgs, HYPRE_MEMORY_HOST); hypre_SStructPVectorDestroy(relax_data -> t); /* - hypre_TFree(relax_data -> x_loc, HYPRE_MEMORY_DEVICE); - hypre_TFree(relax_data -> A_loc, HYPRE_MEMORY_DEVICE); + hypre_TFree(relax_data -> x_loc, memory_location); + hypre_TFree(relax_data -> A_loc, memory_location); */ - hypre_TFree(relax_data -> bp, HYPRE_MEMORY_DEVICE); - hypre_TFree(relax_data -> xp, HYPRE_MEMORY_DEVICE); - hypre_TFree(relax_data -> tp, HYPRE_MEMORY_DEVICE); - hypre_TFree(relax_data -> Ap, HYPRE_MEMORY_DEVICE); + hypre_TFree(relax_data -> bp, memory_location); + hypre_TFree(relax_data -> xp, memory_location); + hypre_TFree(relax_data -> tp, memory_location); + hypre_TFree(relax_data -> Ap, memory_location); for (vi = 0; vi < nvars; vi++) { hypre_TFree((relax_data -> diag_rank)[vi], HYPRE_MEMORY_HOST); @@ -239,6 +242,8 @@ hypre_NodeRelaxSetup( void *relax_vdata, HYPRE_Int nvars; HYPRE_Int dim; + HYPRE_MemoryLocation memory_location; + /*---------------------------------------------------------- * Set up the temp vector *----------------------------------------------------------*/ @@ -261,7 +266,7 @@ hypre_NodeRelaxSetup( void *relax_vdata, hypre_assert(nvars <= HYPRE_MAXVARS); - diag_rank = hypre_CTAlloc(HYPRE_Int *, nvars, HYPRE_MEMORY_HOST); + diag_rank = hypre_CTAlloc(HYPRE_Int *, nvars, HYPRE_MEMORY_HOST); for (vi = 0; vi < nvars; vi++) { diag_rank[vi] = hypre_CTAlloc(HYPRE_Int, nvars, HYPRE_MEMORY_HOST); @@ -280,20 +285,22 @@ hypre_NodeRelaxSetup( void *relax_vdata, } } + memory_location = hypre_StructMatrixMemoryLocation(hypre_SStructPMatrixSMatrix(A, 0, 0)); + /*---------------------------------------------------------- * Allocate storage used to invert local diagonal blocks *----------------------------------------------------------*/ /* i = hypre_NumThreads(); - x_loc = hypre_TAlloc(HYPRE_Real , i*nvars, HYPRE_MEMORY_DEVICE); - A_loc = hypre_TAlloc(HYPRE_Real , i*nvars*nvars, HYPRE_MEMORY_DEVICE); + x_loc = hypre_TAlloc(HYPRE_Real , i*nvars, memory_location); + A_loc = hypre_TAlloc(HYPRE_Real , i*nvars*nvars, memory_location); */ /* Allocate pointers for vector and matrix */ - bp = hypre_TAlloc(HYPRE_Real *, nvars, HYPRE_MEMORY_DEVICE); - xp = hypre_TAlloc(HYPRE_Real *, nvars, HYPRE_MEMORY_DEVICE); - tp = hypre_TAlloc(HYPRE_Real *, nvars, HYPRE_MEMORY_DEVICE); - Ap = hypre_TAlloc(HYPRE_Real *, nvars*nvars, HYPRE_MEMORY_DEVICE); + bp = hypre_TAlloc(HYPRE_Real *, nvars, memory_location); + xp = hypre_TAlloc(HYPRE_Real *, nvars, memory_location); + tp = hypre_TAlloc(HYPRE_Real *, nvars, memory_location); + Ap = hypre_TAlloc(HYPRE_Real *, nvars * nvars, memory_location); /*---------------------------------------------------------- * Set up the compute packages for each nodeset @@ -341,7 +348,7 @@ hypre_NodeRelaxSetup( void *relax_vdata, { for (vj = 0; vj < nvars; vj++) { - if (hypre_SStructPMatrixSMatrix(A,vj,i) != NULL) + if (hypre_SStructPMatrixSMatrix(A, vj, i) != NULL) { sstencil = hypre_SStructPMatrixSStencil(A, vj, i); sstencil_union_count += hypre_StructStencilSize(sstencil); @@ -353,7 +360,7 @@ hypre_NodeRelaxSetup( void *relax_vdata, { for (vj = 0; vj < nvars; vj++) { - if (hypre_SStructPMatrixSMatrix(A,vj,vi) != NULL) + if (hypre_SStructPMatrixSMatrix(A, vj, vi) != NULL) { sstencil = hypre_SStructPMatrixSStencil(A, vj, vi); sstencil_union_count += hypre_StructStencilSize(sstencil); @@ -369,7 +376,7 @@ hypre_NodeRelaxSetup( void *relax_vdata, { for (vj = 0; vj < nvars; vj++) { - if (hypre_SStructPMatrixSMatrix(A,vj,i) != NULL) + if (hypre_SStructPMatrixSMatrix(A, vj, i) != NULL) { sstencil = hypre_SStructPMatrixSStencil(A, vj, i); sstencil_size = hypre_StructStencilSize(sstencil); @@ -388,7 +395,7 @@ hypre_NodeRelaxSetup( void *relax_vdata, { for (vj = 0; vj < nvars; vj++) { - if (hypre_SStructPMatrixSMatrix(A,vj,vi) != NULL) + if (hypre_SStructPMatrixSMatrix(A, vj, vi) != NULL) { sstencil = hypre_SStructPMatrixSStencil(A, vj, vi); sstencil_size = hypre_StructStencilSize(sstencil); @@ -415,7 +422,7 @@ hypre_NodeRelaxSetup( void *relax_vdata, for (compute_i = 0; compute_i < 2; compute_i++) { - switch(compute_i) + switch (compute_i) { case 0: box_aa = orig_indt_boxes; @@ -454,7 +461,7 @@ hypre_NodeRelaxSetup( void *relax_vdata, } } - switch(compute_i) + switch (compute_i) { case 0: hypre_ComputeInfoIndtBoxes(compute_info) = new_box_aa; @@ -472,14 +479,14 @@ hypre_NodeRelaxSetup( void *relax_vdata, { hypre_ComputePkgCreate(compute_info, hypre_StructVectorDataSpace( - hypre_SStructPVectorSVector(x, 0)), + hypre_SStructPVectorSVector(x, 0)), 1, sgrid, &compute_pkgs[p]); } else { hypre_ComputePkgCreate(compute_info, hypre_StructVectorDataSpace( - hypre_SStructPVectorSVector(x, vi)), + hypre_SStructPVectorSVector(x, vi)), 1, sgrid, &svec_compute_pkgs[p][vi]); } @@ -507,6 +514,7 @@ hypre_NodeRelaxSetup( void *relax_vdata, (relax_data -> bp) = bp; (relax_data -> tp) = tp; (relax_data -> xp) = xp; + (relax_data -> memory_location) = memory_location; (relax_data -> compute_pkgs) = compute_pkgs; (relax_data -> svec_compute_pkgs) = svec_compute_pkgs; (relax_data -> comm_handle) = comm_handle; @@ -525,9 +533,9 @@ hypre_NodeRelaxSetup( void *relax_vdata, scale += (nodeset_sizes[p] / frac); } /* REALLY Rough Estimate = num_nodes * nvar^3 */ - (relax_data -> flops) = scale * nvars * nvars * nvars * - hypre_StructVectorGlobalSize( - hypre_SStructPVectorSVector(x,0) ); + (relax_data -> flops) = (HYPRE_Int)(scale * nvars * nvars * nvars * + hypre_StructVectorGlobalSize( + hypre_SStructPVectorSVector(x, 0) ) ); return hypre_error_flag; } @@ -541,55 +549,52 @@ hypre_NodeRelax( void *relax_vdata, hypre_SStructPVector *b, hypre_SStructPVector *x ) { - hypre_NodeRelaxData *relax_data = (hypre_NodeRelaxData *)relax_vdata; - - HYPRE_Int max_iter = (relax_data -> max_iter); - HYPRE_Int zero_guess = (relax_data -> zero_guess); - HYPRE_Real weight = (relax_data -> weight); - HYPRE_Int num_nodesets = (relax_data -> num_nodesets); - HYPRE_Int *nodeset_ranks = (relax_data -> nodeset_ranks); - hypre_Index *nodeset_strides = (relax_data -> nodeset_strides); - hypre_SStructPVector *t = (relax_data -> t); - HYPRE_Int **diag_rank = (relax_data -> diag_rank); - hypre_ComputePkg **compute_pkgs = (relax_data -> compute_pkgs); - hypre_ComputePkg ***svec_compute_pkgs= (relax_data -> - svec_compute_pkgs); - hypre_CommHandle **comm_handle = (relax_data -> comm_handle); - - hypre_ComputePkg *compute_pkg; - hypre_ComputePkg *svec_compute_pkg; - - hypre_BoxArrayArray *compute_box_aa; - hypre_BoxArray *compute_box_a; - hypre_Box *compute_box; - - hypre_Box *A_data_box; - hypre_Box *b_data_box; - hypre_Box *x_data_box; - hypre_Box *t_data_box; + hypre_NodeRelaxData *relax_data = (hypre_NodeRelaxData *)relax_vdata; + + HYPRE_Int max_iter = (relax_data -> max_iter); + HYPRE_Int zero_guess = (relax_data -> zero_guess); + HYPRE_Real weight = (relax_data -> weight); + HYPRE_Int num_nodesets = (relax_data -> num_nodesets); + HYPRE_Int *nodeset_ranks = (relax_data -> nodeset_ranks); + hypre_Index *nodeset_strides = (relax_data -> nodeset_strides); + hypre_SStructPVector *t = (relax_data -> t); + HYPRE_Int **diag_rank = (relax_data -> diag_rank); + hypre_ComputePkg **compute_pkgs = (relax_data -> compute_pkgs); + hypre_ComputePkg ***svec_compute_pkgs = (relax_data ->svec_compute_pkgs); + hypre_CommHandle **comm_handle = (relax_data -> comm_handle); + + hypre_ComputePkg *compute_pkg; + hypre_ComputePkg *svec_compute_pkg; + + hypre_BoxArrayArray *compute_box_aa; + hypre_BoxArray *compute_box_a; + hypre_Box *compute_box; + hypre_Box *A_data_box; + hypre_Box *b_data_box; + hypre_Box *x_data_box; + hypre_Box *t_data_box; /* - HYPRE_Real *tA_loc = (relax_data -> A_loc); - HYPRE_Real *tx_loc = (relax_data -> x_loc); + HYPRE_Real *tA_loc = (relax_data -> A_loc); + HYPRE_Real *tx_loc = (relax_data -> x_loc); */ - - HYPRE_Real **Ap = (relax_data -> Ap); - HYPRE_Real **bp = (relax_data -> bp); - HYPRE_Real **xp = (relax_data -> xp); - HYPRE_Real **tp = (relax_data -> tp); - - HYPRE_Real *_h_Ap[HYPRE_MAXVARS * HYPRE_MAXVARS]; - HYPRE_Real *_h_bp[HYPRE_MAXVARS]; - HYPRE_Real *_h_xp[HYPRE_MAXVARS]; - HYPRE_Real *_h_tp[HYPRE_MAXVARS]; - - HYPRE_Real **h_Ap; - HYPRE_Real **h_bp; - HYPRE_Real **h_xp; - HYPRE_Real **h_tp; + HYPRE_Real **Ap = (relax_data -> Ap); + HYPRE_Real **bp = (relax_data -> bp); + HYPRE_Real **xp = (relax_data -> xp); + HYPRE_Real **tp = (relax_data -> tp); + HYPRE_Real *_h_Ap[HYPRE_MAXVARS * HYPRE_MAXVARS]; + HYPRE_Real *_h_bp[HYPRE_MAXVARS]; + HYPRE_Real *_h_xp[HYPRE_MAXVARS]; + HYPRE_Real *_h_tp[HYPRE_MAXVARS]; + HYPRE_Real **h_Ap; + HYPRE_Real **h_bp; + HYPRE_Real **h_xp; + HYPRE_Real **h_tp; + + HYPRE_MemoryLocation memory_location = relax_data -> memory_location; /* Ap, bp, xp, tp are device pointers */ - if (hypre_GetActualMemLocation(HYPRE_MEMORY_DEVICE) != hypre_MEMORY_HOST) + if (hypre_GetExecPolicy1(memory_location) == HYPRE_EXEC_DEVICE) { h_Ap = _h_Ap; h_bp = _h_bp; @@ -671,7 +676,7 @@ hypre_NodeRelax( void *relax_vdata, for (compute_i = 0; compute_i < 2; compute_i++) { - switch(compute_i) + switch (compute_i) { case 0: { @@ -691,42 +696,42 @@ hypre_NodeRelax( void *relax_vdata, compute_box_a = hypre_BoxArrayArrayBoxArray(compute_box_aa, i); A_data_box = hypre_BoxArrayBox(hypre_StructMatrixDataSpace( - hypre_SStructPMatrixSMatrix(A,0,0)), i); + hypre_SStructPMatrixSMatrix(A, 0, 0)), i); b_data_box = hypre_BoxArrayBox(hypre_StructVectorDataSpace( - hypre_SStructPVectorSVector(b,0)), i); + hypre_SStructPVectorSVector(b, 0)), i); x_data_box = hypre_BoxArrayBox(hypre_StructVectorDataSpace( - hypre_SStructPVectorSVector(x,0)), i); + hypre_SStructPVectorSVector(x, 0)), i); for (vi = 0; vi < nvars; vi++) { for (vj = 0; vj < nvars; vj++) { - if (hypre_SStructPMatrixSMatrix(A,vi,vj) != NULL) + if (hypre_SStructPMatrixSMatrix(A, vi, vj) != NULL) { - h_Ap[vi*nvars+vj] = hypre_StructMatrixBoxData( hypre_SStructPMatrixSMatrix(A,vi,vj), - i, diag_rank[vi][vj] ); + h_Ap[vi * nvars + vj] = hypre_StructMatrixBoxData( hypre_SStructPMatrixSMatrix(A, vi, vj), + i, diag_rank[vi][vj] ); } else { - h_Ap[vi*nvars+vj] = NULL; + h_Ap[vi * nvars + vj] = NULL; } } - h_bp[vi] = hypre_StructVectorBoxData( hypre_SStructPVectorSVector(b,vi), i ); - h_xp[vi] = hypre_StructVectorBoxData( hypre_SStructPVectorSVector(x,vi), i ); + h_bp[vi] = hypre_StructVectorBoxData( hypre_SStructPVectorSVector(b, vi), i ); + h_xp[vi] = hypre_StructVectorBoxData( hypre_SStructPVectorSVector(x, vi), i ); } - if (hypre_GetActualMemLocation(HYPRE_MEMORY_DEVICE) != hypre_MEMORY_HOST) + if (hypre_GetExecPolicy1(memory_location) == HYPRE_EXEC_DEVICE) { - hypre_Memcpy(Ap, h_Ap, nvars*nvars*sizeof(HYPRE_Real*), HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - hypre_Memcpy(bp, h_bp, nvars*sizeof(HYPRE_Real*), HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - hypre_Memcpy(xp, h_xp, nvars*sizeof(HYPRE_Real*), HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); + hypre_TMemcpy(Ap, h_Ap, HYPRE_Real *, nvars * nvars, memory_location, HYPRE_MEMORY_HOST); + hypre_TMemcpy(bp, h_bp, HYPRE_Real *, nvars, memory_location, HYPRE_MEMORY_HOST); + hypre_TMemcpy(xp, h_xp, HYPRE_Real *, nvars, memory_location, HYPRE_MEMORY_HOST); } hypre_ForBoxI(j, compute_box_a) { compute_box = hypre_BoxArrayBox(compute_box_a, j); - start = hypre_BoxIMin(compute_box); + start = hypre_BoxIMin(compute_box); hypre_BoxGetStrideSize(compute_box, stride, loop_size); #define DEVICE_VAR is_device_ptr(bp,Ap,xp) @@ -738,8 +743,8 @@ hypre_NodeRelax( void *relax_vdata, HYPRE_Int vi, vj, err; //HYPRE_Real *A_loc = tA_loc + hypre_BoxLoopBlock() * nvars * nvars; //HYPRE_Real *x_loc = tx_loc + hypre_BoxLoopBlock() * nvars; - HYPRE_Real A_loc[HYPRE_MAXVARS * HYPRE_MAXVARS]; - HYPRE_Real x_loc[HYPRE_MAXVARS]; + HYPRE_Real A_loc[HYPRE_MAXVARS * HYPRE_MAXVARS] = {0}; + HYPRE_Real x_loc[HYPRE_MAXVARS] = {0}; /*------------------------------------------------ * Copy rhs and matrix for diagonal coupling * (intra-nodal) into local storage. @@ -750,8 +755,8 @@ hypre_NodeRelax( void *relax_vdata, x_loc[vi] = bpi[bi]; for (vj = 0; vj < nvars; vj++) { - HYPRE_Real *Apij = Ap[vi*nvars+vj]; - A_loc[vi*nvars+vj] = Apij ? Apij[Ai] : 0.0; + HYPRE_Real *Apij = Ap[vi * nvars + vj]; + A_loc[vi * nvars + vj] = Apij ? Apij[Ai] : 0.0; } } @@ -759,6 +764,9 @@ hypre_NodeRelax( void *relax_vdata, * Invert intra-nodal coupling *----------------------------------------------*/ hypre_gselim(A_loc, x_loc, nvars, err); + (void) err; + /* TODO (VPM): need a way to check error codes on device */ + /*------------------------------------------------ * Copy solution from local storage. *----------------------------------------------*/ @@ -797,13 +805,13 @@ hypre_NodeRelax( void *relax_vdata, for (compute_i = 0; compute_i < 2; compute_i++) { - switch(compute_i) + switch (compute_i) { case 0: { for (vi = 0; vi < nvars; vi++) { - x_block = hypre_SStructPVectorSVector(x,vi); + x_block = hypre_SStructPVectorSVector(x, vi); h_xp[vi] = hypre_StructVectorData(x_block); svec_compute_pkg = svec_compute_pkgs[nodeset][vi]; hypre_InitializeIndtComputations(svec_compute_pkg, @@ -829,24 +837,24 @@ hypre_NodeRelax( void *relax_vdata, compute_box_a = hypre_BoxArrayArrayBoxArray(compute_box_aa, i); A_data_box = hypre_BoxArrayBox( hypre_StructMatrixDataSpace( - hypre_SStructPMatrixSMatrix(A,0,0)), i ); + hypre_SStructPMatrixSMatrix(A, 0, 0)), i ); b_data_box = hypre_BoxArrayBox( hypre_StructVectorDataSpace( - hypre_SStructPVectorSVector(b,0)), i ); + hypre_SStructPVectorSVector(b, 0)), i ); x_data_box = hypre_BoxArrayBox( hypre_StructVectorDataSpace( - hypre_SStructPVectorSVector(x,0)), i ); + hypre_SStructPVectorSVector(x, 0)), i ); t_data_box = hypre_BoxArrayBox( hypre_StructVectorDataSpace( - hypre_SStructPVectorSVector(t,0)), i ); + hypre_SStructPVectorSVector(t, 0)), i ); for (vi = 0; vi < nvars; vi++) { - h_bp[vi] = hypre_StructVectorBoxData( hypre_SStructPVectorSVector(b,vi), i ); - h_tp[vi] = hypre_StructVectorBoxData( hypre_SStructPVectorSVector(t,vi), i ); + h_bp[vi] = hypre_StructVectorBoxData( hypre_SStructPVectorSVector(b, vi), i ); + h_tp[vi] = hypre_StructVectorBoxData( hypre_SStructPVectorSVector(t, vi), i ); } - if (hypre_GetActualMemLocation(HYPRE_MEMORY_DEVICE) != hypre_MEMORY_HOST) + if (hypre_GetExecPolicy1(memory_location) == HYPRE_EXEC_DEVICE) { - hypre_Memcpy(bp, h_bp, nvars*sizeof(HYPRE_Real*), HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - hypre_Memcpy(tp, h_tp, nvars*sizeof(HYPRE_Real*), HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); + hypre_TMemcpy(bp, h_bp, HYPRE_Real *, nvars, memory_location, HYPRE_MEMORY_HOST); + hypre_TMemcpy(tp, h_tp, HYPRE_Real *, nvars, memory_location, HYPRE_MEMORY_HOST); } hypre_ForBoxI(j, compute_box_a) @@ -877,10 +885,10 @@ hypre_NodeRelax( void *relax_vdata, { for (vj = 0; vj < nvars; vj++) { - if (hypre_SStructPMatrixSMatrix(A,vi,vj) != NULL) + if (hypre_SStructPMatrixSMatrix(A, vi, vj) != NULL) { - A_block = hypre_SStructPMatrixSMatrix(A,vi,vj); - x_block = hypre_SStructPVectorSVector(x,vj); + A_block = hypre_SStructPMatrixSMatrix(A, vi, vj); + x_block = hypre_SStructPVectorSVector(x, vj); stencil = hypre_StructMatrixStencil(A_block); stencil_shape = hypre_StructStencilShape(stencil); stencil_size = hypre_StructStencilSize(stencil); @@ -913,21 +921,21 @@ hypre_NodeRelax( void *relax_vdata, { for (vj = 0; vj < nvars; vj++) { - if (hypre_SStructPMatrixSMatrix(A,vi,vj) != NULL) + if (hypre_SStructPMatrixSMatrix(A, vi, vj) != NULL) { - h_Ap[vi*nvars+vj] = hypre_StructMatrixBoxData( hypre_SStructPMatrixSMatrix(A,vi,vj), - i, diag_rank[vi][vj]); + h_Ap[vi * nvars + vj] = hypre_StructMatrixBoxData( hypre_SStructPMatrixSMatrix(A, vi, vj), + i, diag_rank[vi][vj]); } else { - h_Ap[vi*nvars+vj] = NULL; + h_Ap[vi * nvars + vj] = NULL; } } } - if (hypre_GetActualMemLocation(HYPRE_MEMORY_DEVICE) != hypre_MEMORY_HOST) + if (hypre_GetExecPolicy1(memory_location) == HYPRE_EXEC_DEVICE) { - hypre_Memcpy(Ap, h_Ap, nvars*nvars*sizeof(HYPRE_Real*), HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); + hypre_TMemcpy(Ap, h_Ap, HYPRE_Real *, nvars * nvars, memory_location, HYPRE_MEMORY_HOST); } #define DEVICE_VAR is_device_ptr(tp,Ap) @@ -940,8 +948,8 @@ hypre_NodeRelax( void *relax_vdata, HYPRE_Real *A_loc = tA_loc + hypre_BoxLoopBlock() * nvars * nvars; HYPRE_Real *x_loc = tx_loc + hypre_BoxLoopBlock() * nvars; */ - HYPRE_Real A_loc[HYPRE_MAXVARS * HYPRE_MAXVARS]; - HYPRE_Real x_loc[HYPRE_MAXVARS]; + HYPRE_Real A_loc[HYPRE_MAXVARS * HYPRE_MAXVARS] = {0}; + HYPRE_Real x_loc[HYPRE_MAXVARS] = {0}; /*------------------------------------------------ * Copy rhs and matrix for diagonal coupling @@ -953,8 +961,8 @@ hypre_NodeRelax( void *relax_vdata, x_loc[vi] = tpi[ti]; for (vj = 0; vj < nvars; vj++) { - HYPRE_Real *Apij = Ap[vi*nvars+vj]; - A_loc[vi*nvars+vj] = Apij ? Apij[Ai] : 0.0; + HYPRE_Real *Apij = Ap[vi * nvars + vj]; + A_loc[vi * nvars + vj] = Apij ? Apij[Ai] : 0.0; } } @@ -962,6 +970,8 @@ hypre_NodeRelax( void *relax_vdata, * Invert intra-nodal coupling *----------------------------------------------*/ hypre_gselim(A_loc, x_loc, nvars, err); + (void) err; + /*------------------------------------------------ * Copy solution from local storage. *----------------------------------------------*/ @@ -1157,4 +1167,3 @@ hypre_NodeRelaxSetTempVec( void *relax_vdata, return hypre_error_flag; } - diff --git a/external/hypre/src/sstruct_ls/sstruct_amr_intercommunication.c b/external/hypre/src/sstruct_ls/sstruct_amr_intercommunication.c index 14a130ab..5cb5ce1a 100644 --- a/external/hypre/src/sstruct_ls/sstruct_amr_intercommunication.c +++ b/external/hypre/src/sstruct_ls/sstruct_amr_intercommunication.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -44,21 +44,22 @@ hypre_SStructAMRInterCommunication( hypre_SStructSendInfoData *sendinfo, * The communication info is copied from sendinfo & recvinfo. *------------------------------------------------------------------------*/ sendboxes = hypre_BoxArrayArrayDuplicate(sendinfo -> send_boxes); - send_rboxes= hypre_BoxArrayArrayDuplicate(sendinfo -> send_boxes); + send_rboxes = hypre_BoxArrayArrayDuplicate(sendinfo -> send_boxes); sprocesses = hypre_CTAlloc(HYPRE_Int *, hypre_BoxArrayArraySize(send_rboxes), HYPRE_MEMORY_HOST); - send_rboxnums= hypre_CTAlloc(HYPRE_Int *, hypre_BoxArrayArraySize(send_rboxes), HYPRE_MEMORY_HOST); + send_rboxnums = hypre_CTAlloc(HYPRE_Int *, hypre_BoxArrayArraySize(send_rboxes), + HYPRE_MEMORY_HOST); hypre_ForBoxArrayI(i, sendboxes) { - boxarray= hypre_BoxArrayArrayBoxArray(sendboxes, i); + boxarray = hypre_BoxArrayArrayBoxArray(sendboxes, i); sprocesses[i] = hypre_CTAlloc(HYPRE_Int, hypre_BoxArraySize(boxarray), HYPRE_MEMORY_HOST); - send_rboxnums[i]= hypre_CTAlloc(HYPRE_Int, hypre_BoxArraySize(boxarray), HYPRE_MEMORY_HOST); + send_rboxnums[i] = hypre_CTAlloc(HYPRE_Int, hypre_BoxArraySize(boxarray), HYPRE_MEMORY_HOST); hypre_ForBoxI(j, boxarray) { sprocesses[i][j] = (sendinfo -> send_procs)[i][j]; - send_rboxnums[i][j]= (sendinfo -> send_remote_boxnums)[i][j]; + send_rboxnums[i][j] = (sendinfo -> send_remote_boxnums)[i][j]; } } @@ -71,9 +72,9 @@ hypre_SStructAMRInterCommunication( hypre_SStructSendInfoData *sendinfo, hypre_ForBoxArrayI(i, recvboxes) { - boxarray= hypre_BoxArrayArrayBoxArray(recvboxes, i); - rprocesses[i]= hypre_CTAlloc(HYPRE_Int, hypre_BoxArraySize(boxarray), HYPRE_MEMORY_HOST); - recv_rboxnums[i]= hypre_CTAlloc(HYPRE_Int, hypre_BoxArraySize(boxarray), HYPRE_MEMORY_HOST); + boxarray = hypre_BoxArrayArrayBoxArray(recvboxes, i); + rprocesses[i] = hypre_CTAlloc(HYPRE_Int, hypre_BoxArraySize(boxarray), HYPRE_MEMORY_HOST); + recv_rboxnums[i] = hypre_CTAlloc(HYPRE_Int, hypre_BoxArraySize(boxarray), HYPRE_MEMORY_HOST); hypre_ForBoxI(j, boxarray) { @@ -93,7 +94,7 @@ hypre_SStructAMRInterCommunication( hypre_SStructSendInfoData *sendinfo, &comm_pkg); hypre_CommInfoDestroy(comm_info); - *comm_pkg_ptr = comm_pkg; + *comm_pkg_ptr = comm_pkg; return ierr; } diff --git a/external/hypre/src/sstruct_ls/sstruct_owninfo.c b/external/hypre/src/sstruct_ls/sstruct_owninfo.c index c56240fb..c3df9fd7 100644 --- a/external/hypre/src/sstruct_ls/sstruct_owninfo.c +++ b/external/hypre/src/sstruct_ls/sstruct_owninfo.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -53,8 +53,8 @@ hypre_SStructOwnInfo( hypre_StructGrid *fgrid, { hypre_SStructOwnInfoData *owninfo_data; - MPI_Comm comm= hypre_SStructVectorComm(fgrid); - HYPRE_Int ndim= hypre_StructGridNDim(fgrid); + MPI_Comm comm = hypre_SStructVectorComm(fgrid); + HYPRE_Int ndim = hypre_StructGridNDim(fgrid); hypre_BoxArray *grid_boxes; hypre_BoxArray *intersect_boxes; @@ -81,13 +81,13 @@ hypre_SStructOwnInfo( hypre_StructGrid *fgrid, hypre_BoxInit(&scaled_box, ndim); hypre_BoxInit(&boxman_entry_box, ndim); - hypre_ClearIndex(index); + hypre_ClearIndex(index); hypre_MPI_Comm_rank(comm, &myproc); - owninfo_data= hypre_CTAlloc(hypre_SStructOwnInfoData, 1, HYPRE_MEMORY_HOST); + owninfo_data = hypre_CTAlloc(hypre_SStructOwnInfoData, 1, HYPRE_MEMORY_HOST); /*------------------------------------------------------------------------ - * Create the structured ownbox patterns. + * Create the structured ownbox patterns. * * own_boxes are obtained by intersecting this proc's fgrid boxes * with cgrid's box_man. Intersecting BoxManEntries on this proc @@ -96,127 +96,127 @@ hypre_SStructOwnInfo( hypre_StructGrid *fgrid, grid_boxes = hypre_StructGridBoxes(fgrid); own_boxes = hypre_BoxArrayArrayCreate(hypre_BoxArraySize(grid_boxes), ndim); - own_cboxnums= hypre_CTAlloc(HYPRE_Int *, hypre_BoxArraySize(grid_boxes), HYPRE_MEMORY_HOST); + own_cboxnums = hypre_CTAlloc(HYPRE_Int *, hypre_BoxArraySize(grid_boxes), HYPRE_MEMORY_HOST); hypre_ForBoxI(i, grid_boxes) { - grid_box= hypre_BoxArrayBox(grid_boxes, i); - - /*--------------------------------------------------------------------- - * Find the boxarray that is owned. BoxManIntersect returns - * the full extents of the boxes that intersect with the given box. - * We further need to intersect each box in the list with the given - * box to determine the actual box that is owned. - *---------------------------------------------------------------------*/ - hypre_SStructIndexScaleF_C(hypre_BoxIMin(grid_box), index, - rfactor, hypre_BoxIMin(&scaled_box)); - hypre_SStructIndexScaleF_C(hypre_BoxIMax(grid_box), index, - rfactor, hypre_BoxIMax(&scaled_box)); - - hypre_BoxManIntersect(cboxman, hypre_BoxIMin(&scaled_box), - hypre_BoxIMax(&scaled_box), &boxman_entries, - &nboxman_entries); - - cnt= 0; - for (j= 0; j< nboxman_entries; j++) - { - hypre_SStructBoxManEntryGetProcess(boxman_entries[j], &proc); - if (proc == myproc) - { - cnt++; - } - } - own_cboxnums[i]= hypre_CTAlloc(HYPRE_Int, cnt, HYPRE_MEMORY_HOST); - - cnt= 0; - for (j= 0; j< nboxman_entries; j++) - { - hypre_SStructBoxManEntryGetProcess(boxman_entries[j], &proc); - - /* determine the chunk of the boxman_entries[j] box that is needed */ - hypre_BoxManEntryGetExtents(boxman_entries[j], ilower, iupper); - hypre_BoxSetExtents(&boxman_entry_box, ilower, iupper); - hypre_IntersectBoxes(&boxman_entry_box, &scaled_box, &boxman_entry_box); - - if (proc == myproc) - { - hypre_SStructBoxManEntryGetBoxnum(boxman_entries[j], &own_cboxnums[i][cnt]); - hypre_AppendBox(&boxman_entry_box, - hypre_BoxArrayArrayBoxArray(own_boxes, i)); - cnt++; - } - } + grid_box = hypre_BoxArrayBox(grid_boxes, i); + + /*--------------------------------------------------------------------- + * Find the boxarray that is owned. BoxManIntersect returns + * the full extents of the boxes that intersect with the given box. + * We further need to intersect each box in the list with the given + * box to determine the actual box that is owned. + *---------------------------------------------------------------------*/ + hypre_SStructIndexScaleF_C(hypre_BoxIMin(grid_box), index, + rfactor, hypre_BoxIMin(&scaled_box)); + hypre_SStructIndexScaleF_C(hypre_BoxIMax(grid_box), index, + rfactor, hypre_BoxIMax(&scaled_box)); + + hypre_BoxManIntersect(cboxman, hypre_BoxIMin(&scaled_box), + hypre_BoxIMax(&scaled_box), &boxman_entries, + &nboxman_entries); + + cnt = 0; + for (j = 0; j < nboxman_entries; j++) + { + hypre_SStructBoxManEntryGetProcess(boxman_entries[j], &proc); + if (proc == myproc) + { + cnt++; + } + } + own_cboxnums[i] = hypre_CTAlloc(HYPRE_Int, cnt, HYPRE_MEMORY_HOST); + + cnt = 0; + for (j = 0; j < nboxman_entries; j++) + { + hypre_SStructBoxManEntryGetProcess(boxman_entries[j], &proc); + + /* determine the chunk of the boxman_entries[j] box that is needed */ + hypre_BoxManEntryGetExtents(boxman_entries[j], ilower, iupper); + hypre_BoxSetExtents(&boxman_entry_box, ilower, iupper); + hypre_IntersectBoxes(&boxman_entry_box, &scaled_box, &boxman_entry_box); + + if (proc == myproc) + { + hypre_SStructBoxManEntryGetBoxnum(boxman_entries[j], &own_cboxnums[i][cnt]); + hypre_AppendBox(&boxman_entry_box, + hypre_BoxArrayArrayBoxArray(own_boxes, i)); + cnt++; + } + } hypre_TFree(boxman_entries, HYPRE_MEMORY_HOST); - } /* hypre_ForBoxI(i, grid_boxes) */ + } /* hypre_ForBoxI(i, grid_boxes) */ (owninfo_data -> size) = hypre_BoxArraySize(grid_boxes); - (owninfo_data -> own_boxes)= own_boxes; - (owninfo_data -> own_cboxnums)= own_cboxnums; + (owninfo_data -> own_boxes) = own_boxes; + (owninfo_data -> own_cboxnums) = own_cboxnums; /*------------------------------------------------------------------------ - * own_composite_cboxes are obtained by intersecting this proc's cgrid - * boxes with fgrid's box_man. For each cbox, subtracting all the - * intersecting boxes from all processors will give the + * own_composite_cboxes are obtained by intersecting this proc's cgrid + * boxes with fgrid's box_man. For each cbox, subtracting all the + * intersecting boxes from all processors will give the * own_composite_cboxes. *------------------------------------------------------------------------*/ - grid_boxes= hypre_StructGridBoxes(cgrid); - own_composite_cboxes= hypre_BoxArrayArrayCreate(hypre_BoxArraySize(grid_boxes), ndim); - (owninfo_data -> own_composite_size)= hypre_BoxArraySize(grid_boxes); + grid_boxes = hypre_StructGridBoxes(cgrid); + own_composite_cboxes = hypre_BoxArrayArrayCreate(hypre_BoxArraySize(grid_boxes), ndim); + (owninfo_data -> own_composite_size) = hypre_BoxArraySize(grid_boxes); tmp_boxarray = hypre_BoxArrayCreate(0, ndim); hypre_ForBoxI(i, grid_boxes) { - grid_box= hypre_BoxArrayBox(grid_boxes, i); - hypre_AppendBox(grid_box, - hypre_BoxArrayArrayBoxArray(own_composite_cboxes, i)); - - hypre_ClearIndex(index); - hypre_SStructIndexScaleC_F(hypre_BoxIMin(grid_box), index, - rfactor, hypre_BoxIMin(&scaled_box)); - hypre_SetIndex3(index, rfactor[0]-1, rfactor[1]-1, rfactor[2]-1); - hypre_SStructIndexScaleC_F(hypre_BoxIMax(grid_box), index, - rfactor, hypre_BoxIMax(&scaled_box)); - - hypre_BoxManIntersect(fboxman, hypre_BoxIMin(&scaled_box), - hypre_BoxIMax(&scaled_box), &boxman_entries, + grid_box = hypre_BoxArrayBox(grid_boxes, i); + hypre_AppendBox(grid_box, + hypre_BoxArrayArrayBoxArray(own_composite_cboxes, i)); + + hypre_ClearIndex(index); + hypre_SStructIndexScaleC_F(hypre_BoxIMin(grid_box), index, + rfactor, hypre_BoxIMin(&scaled_box)); + hypre_SetIndex3(index, rfactor[0] - 1, rfactor[1] - 1, rfactor[2] - 1); + hypre_SStructIndexScaleC_F(hypre_BoxIMax(grid_box), index, + rfactor, hypre_BoxIMax(&scaled_box)); + + hypre_BoxManIntersect(fboxman, hypre_BoxIMin(&scaled_box), + hypre_BoxIMax(&scaled_box), &boxman_entries, &nboxman_entries); - - hypre_ClearIndex(index); - intersect_boxes= hypre_BoxArrayCreate(0, ndim); - for (j= 0; j< nboxman_entries; j++) - { - hypre_BoxManEntryGetExtents(boxman_entries[j], ilower, iupper); - hypre_BoxSetExtents(&boxman_entry_box, ilower, iupper); - hypre_IntersectBoxes(&boxman_entry_box, &scaled_box, &boxman_entry_box); - - /* contract the intersection box so that only the cnodes in the + + hypre_ClearIndex(index); + intersect_boxes = hypre_BoxArrayCreate(0, ndim); + for (j = 0; j < nboxman_entries; j++) + { + hypre_BoxManEntryGetExtents(boxman_entries[j], ilower, iupper); + hypre_BoxSetExtents(&boxman_entry_box, ilower, iupper); + hypre_IntersectBoxes(&boxman_entry_box, &scaled_box, &boxman_entry_box); + + /* contract the intersection box so that only the cnodes in the intersection box are included. */ - for (k= 0; k< ndim; k++) - { - mod= hypre_BoxIMin(&boxman_entry_box)[k] % rfactor[k]; - if (mod) - { - hypre_BoxIMin(&boxman_entry_box)[k]+= rfactor[k] - mod; - } - } - - hypre_SStructIndexScaleF_C(hypre_BoxIMin(&boxman_entry_box), index, - rfactor, hypre_BoxIMin(&boxman_entry_box)); - hypre_SStructIndexScaleF_C(hypre_BoxIMax(&boxman_entry_box), index, - rfactor, hypre_BoxIMax(&boxman_entry_box)); - hypre_AppendBox(&boxman_entry_box, intersect_boxes); - } - - hypre_SubtractBoxArrays(hypre_BoxArrayArrayBoxArray(own_composite_cboxes, i), - intersect_boxes, tmp_boxarray); - hypre_MinUnionBoxes(hypre_BoxArrayArrayBoxArray(own_composite_cboxes, i)); - - hypre_TFree(boxman_entries, HYPRE_MEMORY_HOST); - hypre_BoxArrayDestroy(intersect_boxes); + for (k = 0; k < ndim; k++) + { + mod = hypre_BoxIMin(&boxman_entry_box)[k] % rfactor[k]; + if (mod) + { + hypre_BoxIMin(&boxman_entry_box)[k] += rfactor[k] - mod; + } + } + + hypre_SStructIndexScaleF_C(hypre_BoxIMin(&boxman_entry_box), index, + rfactor, hypre_BoxIMin(&boxman_entry_box)); + hypre_SStructIndexScaleF_C(hypre_BoxIMax(&boxman_entry_box), index, + rfactor, hypre_BoxIMax(&boxman_entry_box)); + hypre_AppendBox(&boxman_entry_box, intersect_boxes); + } + + hypre_SubtractBoxArrays(hypre_BoxArrayArrayBoxArray(own_composite_cboxes, i), + intersect_boxes, tmp_boxarray); + hypre_MinUnionBoxes(hypre_BoxArrayArrayBoxArray(own_composite_cboxes, i)); + + hypre_TFree(boxman_entries, HYPRE_MEMORY_HOST); + hypre_BoxArrayDestroy(intersect_boxes); } hypre_BoxArrayDestroy(tmp_boxarray); - - (owninfo_data -> own_composite_cboxes)= own_composite_cboxes; + + (owninfo_data -> own_composite_cboxes) = own_composite_cboxes; return owninfo_data; } @@ -237,11 +237,11 @@ hypre_SStructOwnInfoDataDestroy(hypre_SStructOwnInfoData *owninfo_data) hypre_BoxArrayArrayDestroy( (owninfo_data -> own_boxes) ); } - for (i= 0; i< (owninfo_data -> size); i++) + for (i = 0; i < (owninfo_data -> size); i++) { if (owninfo_data -> own_cboxnums[i]) { - hypre_TFree(owninfo_data -> own_cboxnums[i], HYPRE_MEMORY_HOST); + hypre_TFree(owninfo_data -> own_cboxnums[i], HYPRE_MEMORY_HOST); } } hypre_TFree(owninfo_data -> own_cboxnums, HYPRE_MEMORY_HOST); diff --git a/external/hypre/src/sstruct_ls/sstruct_owninfo.h b/external/hypre/src/sstruct_ls/sstruct_owninfo.h index cc6df2cd..34ccad87 100644 --- a/external/hypre/src/sstruct_ls/sstruct_owninfo.h +++ b/external/hypre/src/sstruct_ls/sstruct_owninfo.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -15,7 +15,7 @@ #define hypre_OWNINFODATA_HEADER -typedef struct +typedef struct { HYPRE_Int size; diff --git a/external/hypre/src/sstruct_ls/sstruct_recvinfo.c b/external/hypre/src/sstruct_ls/sstruct_recvinfo.c index 072baaf0..accb99cc 100644 --- a/external/hypre/src/sstruct_ls/sstruct_recvinfo.c +++ b/external/hypre/src/sstruct_ls/sstruct_recvinfo.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -43,15 +43,15 @@ hypre_SStructRecvInfo( hypre_StructGrid *cgrid, hypre_BoxInit(&fbox, ndim); hypre_BoxInit(&boxman_entry_box, ndim); - hypre_ClearIndex(index1); - hypre_SetIndex3(index2, rfactor[0]-1, rfactor[1]-1, rfactor[2]-1); + hypre_ClearIndex(index1); + hypre_SetIndex3(index2, rfactor[0] - 1, rfactor[1] - 1, rfactor[2] - 1); hypre_MPI_Comm_rank(comm, &myproc); - recvinfo_data= hypre_CTAlloc(hypre_SStructRecvInfoData, 1, HYPRE_MEMORY_HOST); + recvinfo_data = hypre_CTAlloc(hypre_SStructRecvInfoData, 1, HYPRE_MEMORY_HOST); /*------------------------------------------------------------------------ - * Create the structured recvbox patterns. + * Create the structured recvbox patterns. * recv_boxes are obtained by intersecting this proc's cgrid boxes * with the fine fboxman. Intersecting BoxManEntries not on this proc * will give the boxes that we will be receiving some data from. To @@ -62,62 +62,62 @@ hypre_SStructRecvInfo( hypre_StructGrid *cgrid, intersect_box = hypre_BoxCreate(ndim); grid_boxes = hypre_StructGridBoxes(cgrid); - recv_boxes= hypre_BoxArrayArrayCreate(hypre_BoxArraySize(grid_boxes), ndim); - recv_processes= hypre_CTAlloc(HYPRE_Int *, hypre_BoxArraySize(grid_boxes), HYPRE_MEMORY_HOST); + recv_boxes = hypre_BoxArrayArrayCreate(hypre_BoxArraySize(grid_boxes), ndim); + recv_processes = hypre_CTAlloc(HYPRE_Int *, hypre_BoxArraySize(grid_boxes), HYPRE_MEMORY_HOST); hypre_ForBoxI(i, grid_boxes) { - grid_box= hypre_BoxArrayBox(grid_boxes, i); + grid_box = hypre_BoxArrayBox(grid_boxes, i); - hypre_SStructIndexScaleC_F(hypre_BoxIMin(grid_box), index1, - rfactor, hypre_BoxIMin(&fbox)); - hypre_SStructIndexScaleC_F(hypre_BoxIMax(grid_box), index2, - rfactor, hypre_BoxIMax(&fbox)); + hypre_SStructIndexScaleC_F(hypre_BoxIMin(grid_box), index1, + rfactor, hypre_BoxIMin(&fbox)); + hypre_SStructIndexScaleC_F(hypre_BoxIMax(grid_box), index2, + rfactor, hypre_BoxIMax(&fbox)); - hypre_BoxManIntersect(fboxman, hypre_BoxIMin(&fbox), hypre_BoxIMax(&fbox), + hypre_BoxManIntersect(fboxman, hypre_BoxIMin(&fbox), hypre_BoxIMax(&fbox), &boxman_entries, &nboxman_entries); - cnt= 0; - for (j= 0; j< nboxman_entries; j++) - { - hypre_SStructBoxManEntryGetProcess(boxman_entries[j], &proc); - if (proc != myproc) - { - cnt++; - } - } - recv_processes[i] = hypre_CTAlloc(HYPRE_Int, cnt, HYPRE_MEMORY_HOST); - - cnt= 0; - for (j= 0; j< nboxman_entries; j++) - { - hypre_SStructBoxManEntryGetProcess(boxman_entries[j], &proc); - - /* determine the chunk of the boxman_entries[j] box that is needed */ - hypre_BoxManEntryGetExtents(boxman_entries[j], ilower, iupper); - hypre_BoxSetExtents(&boxman_entry_box, ilower, iupper); - hypre_IntersectBoxes(&boxman_entry_box, &fbox, &boxman_entry_box); - - if (proc != myproc) - { - recv_processes[i][cnt]= proc; - hypre_SStructIndexScaleF_C(hypre_BoxIMin(&boxman_entry_box), index1, - rfactor, hypre_BoxIMin(&boxman_entry_box)); - hypre_SStructIndexScaleF_C(hypre_BoxIMax(&boxman_entry_box), index1, - rfactor, hypre_BoxIMax(&boxman_entry_box)); - hypre_AppendBox(&boxman_entry_box, - hypre_BoxArrayArrayBoxArray(recv_boxes, i)); - cnt++; - } - } + cnt = 0; + for (j = 0; j < nboxman_entries; j++) + { + hypre_SStructBoxManEntryGetProcess(boxman_entries[j], &proc); + if (proc != myproc) + { + cnt++; + } + } + recv_processes[i] = hypre_CTAlloc(HYPRE_Int, cnt, HYPRE_MEMORY_HOST); + + cnt = 0; + for (j = 0; j < nboxman_entries; j++) + { + hypre_SStructBoxManEntryGetProcess(boxman_entries[j], &proc); + + /* determine the chunk of the boxman_entries[j] box that is needed */ + hypre_BoxManEntryGetExtents(boxman_entries[j], ilower, iupper); + hypre_BoxSetExtents(&boxman_entry_box, ilower, iupper); + hypre_IntersectBoxes(&boxman_entry_box, &fbox, &boxman_entry_box); + + if (proc != myproc) + { + recv_processes[i][cnt] = proc; + hypre_SStructIndexScaleF_C(hypre_BoxIMin(&boxman_entry_box), index1, + rfactor, hypre_BoxIMin(&boxman_entry_box)); + hypre_SStructIndexScaleF_C(hypre_BoxIMax(&boxman_entry_box), index1, + rfactor, hypre_BoxIMax(&boxman_entry_box)); + hypre_AppendBox(&boxman_entry_box, + hypre_BoxArrayArrayBoxArray(recv_boxes, i)); + cnt++; + } + } hypre_TFree(boxman_entries, HYPRE_MEMORY_HOST); - } /* hypre_ForBoxI(i, grid_boxes) */ + } /* hypre_ForBoxI(i, grid_boxes) */ hypre_BoxDestroy(intersect_box); (recvinfo_data -> size) = hypre_BoxArraySize(grid_boxes); - (recvinfo_data -> recv_boxes)= recv_boxes; - (recvinfo_data -> recv_procs)= recv_processes; + (recvinfo_data -> recv_boxes) = recv_boxes; + (recvinfo_data -> recv_procs) = recv_processes; return recvinfo_data; } @@ -138,11 +138,11 @@ hypre_SStructRecvInfoDataDestroy(hypre_SStructRecvInfoData *recvinfo_data) hypre_BoxArrayArrayDestroy( (recvinfo_data -> recv_boxes) ); } - for (i= 0; i< (recvinfo_data -> size); i++) + for (i = 0; i < (recvinfo_data -> size); i++) { if (recvinfo_data -> recv_procs[i]) { - hypre_TFree(recvinfo_data -> recv_procs[i], HYPRE_MEMORY_HOST); + hypre_TFree(recvinfo_data -> recv_procs[i], HYPRE_MEMORY_HOST); } } diff --git a/external/hypre/src/sstruct_ls/sstruct_recvinfo.h b/external/hypre/src/sstruct_ls/sstruct_recvinfo.h index d44b1253..e28f96bf 100644 --- a/external/hypre/src/sstruct_ls/sstruct_recvinfo.h +++ b/external/hypre/src/sstruct_ls/sstruct_recvinfo.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -12,7 +12,7 @@ #define hypre_RECVINFODATA_HEADER -typedef struct +typedef struct { HYPRE_Int size; diff --git a/external/hypre/src/sstruct_ls/sstruct_sendinfo.c b/external/hypre/src/sstruct_ls/sstruct_sendinfo.c index 1a7f29a0..32fee366 100644 --- a/external/hypre/src/sstruct_ls/sstruct_sendinfo.c +++ b/external/hypre/src/sstruct_ls/sstruct_sendinfo.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -9,7 +9,7 @@ /*-------------------------------------------------------------------------- * hypre_SStructSendInfo: Given a fgrid, coarsen each fbox and find the - * coarsened boxes that must be sent, the procs that they must be sent to, + * coarsened boxes that must be sent, the procs that they must be sent to, * and the remote boxnums of these sendboxes. *--------------------------------------------------------------------------*/ @@ -44,13 +44,13 @@ hypre_SStructSendInfo( hypre_StructGrid *fgrid, hypre_BoxInit(&cbox, ndim); hypre_BoxInit(&boxman_entry_box, ndim); - hypre_ClearIndex(index); + hypre_ClearIndex(index); hypre_MPI_Comm_rank(comm, &myproc); - sendinfo_data= hypre_CTAlloc(hypre_SStructSendInfoData, 1, HYPRE_MEMORY_HOST); + sendinfo_data = hypre_CTAlloc(hypre_SStructSendInfoData, 1, HYPRE_MEMORY_HOST); /*------------------------------------------------------------------------ - * Create the structured sendbox patterns. + * Create the structured sendbox patterns. * * send_boxes are obtained by intersecting this proc's fgrid boxes * with cgrid's box_man. Intersecting BoxManEntries not on this proc @@ -61,69 +61,70 @@ hypre_SStructSendInfo( hypre_StructGrid *fgrid, intersect_box = hypre_BoxCreate(ndim); grid_boxes = hypre_StructGridBoxes(fgrid); - send_boxes= hypre_BoxArrayArrayCreate(hypre_BoxArraySize(grid_boxes), ndim); - send_processes= hypre_CTAlloc(HYPRE_Int *, hypre_BoxArraySize(grid_boxes), HYPRE_MEMORY_HOST); - send_remote_boxnums= hypre_CTAlloc(HYPRE_Int *, hypre_BoxArraySize(grid_boxes), HYPRE_MEMORY_HOST); + send_boxes = hypre_BoxArrayArrayCreate(hypre_BoxArraySize(grid_boxes), ndim); + send_processes = hypre_CTAlloc(HYPRE_Int *, hypre_BoxArraySize(grid_boxes), HYPRE_MEMORY_HOST); + send_remote_boxnums = hypre_CTAlloc(HYPRE_Int *, hypre_BoxArraySize(grid_boxes), + HYPRE_MEMORY_HOST); hypre_ForBoxI(i, grid_boxes) { - grid_box= hypre_BoxArrayBox(grid_boxes, i); - - /*--------------------------------------------------------------------- - * Find the boxarray that must be sent. BoxManIntersect returns - * the full extents of the boxes that intersect with the given box. - * We further need to intersect each box in the list with the given - * box to determine the actual box that needs to be sent. - *---------------------------------------------------------------------*/ - hypre_SStructIndexScaleF_C(hypre_BoxIMin(grid_box), index, - rfactor, hypre_BoxIMin(&cbox)); - hypre_SStructIndexScaleF_C(hypre_BoxIMax(grid_box), index, - rfactor, hypre_BoxIMax(&cbox)); - - hypre_BoxManIntersect(cboxman, hypre_BoxIMin(&cbox), hypre_BoxIMax(&cbox), + grid_box = hypre_BoxArrayBox(grid_boxes, i); + + /*--------------------------------------------------------------------- + * Find the boxarray that must be sent. BoxManIntersect returns + * the full extents of the boxes that intersect with the given box. + * We further need to intersect each box in the list with the given + * box to determine the actual box that needs to be sent. + *---------------------------------------------------------------------*/ + hypre_SStructIndexScaleF_C(hypre_BoxIMin(grid_box), index, + rfactor, hypre_BoxIMin(&cbox)); + hypre_SStructIndexScaleF_C(hypre_BoxIMax(grid_box), index, + rfactor, hypre_BoxIMax(&cbox)); + + hypre_BoxManIntersect(cboxman, hypre_BoxIMin(&cbox), hypre_BoxIMax(&cbox), &boxman_entries, &nboxman_entries); - cnt= 0; - for (j= 0; j< nboxman_entries; j++) - { - hypre_SStructBoxManEntryGetProcess(boxman_entries[j], &proc); - if (proc != myproc) - { - cnt++; - } - } - send_processes[i] = hypre_CTAlloc(HYPRE_Int, cnt, HYPRE_MEMORY_HOST); - send_remote_boxnums[i]= hypre_CTAlloc(HYPRE_Int, cnt, HYPRE_MEMORY_HOST); - - cnt= 0; - for (j= 0; j< nboxman_entries; j++) - { - hypre_SStructBoxManEntryGetProcess(boxman_entries[j], &proc); - - /* determine the chunk of the boxman_entries[j] box that is needed */ - hypre_BoxManEntryGetExtents(boxman_entries[j], ilower, iupper); - hypre_BoxSetExtents(&boxman_entry_box, ilower, iupper); - hypre_IntersectBoxes(&boxman_entry_box, &cbox, &boxman_entry_box); - - if (proc != myproc) - { - send_processes[i][cnt] = proc; - hypre_SStructBoxManEntryGetBoxnum(boxman_entries[j], - &send_remote_boxnums[i][cnt]); - hypre_AppendBox(&boxman_entry_box, - hypre_BoxArrayArrayBoxArray(send_boxes, i)); - cnt++; - } - } + cnt = 0; + for (j = 0; j < nboxman_entries; j++) + { + hypre_SStructBoxManEntryGetProcess(boxman_entries[j], &proc); + if (proc != myproc) + { + cnt++; + } + } + send_processes[i] = hypre_CTAlloc(HYPRE_Int, cnt, HYPRE_MEMORY_HOST); + send_remote_boxnums[i] = hypre_CTAlloc(HYPRE_Int, cnt, HYPRE_MEMORY_HOST); + + cnt = 0; + for (j = 0; j < nboxman_entries; j++) + { + hypre_SStructBoxManEntryGetProcess(boxman_entries[j], &proc); + + /* determine the chunk of the boxman_entries[j] box that is needed */ + hypre_BoxManEntryGetExtents(boxman_entries[j], ilower, iupper); + hypre_BoxSetExtents(&boxman_entry_box, ilower, iupper); + hypre_IntersectBoxes(&boxman_entry_box, &cbox, &boxman_entry_box); + + if (proc != myproc) + { + send_processes[i][cnt] = proc; + hypre_SStructBoxManEntryGetBoxnum(boxman_entries[j], + &send_remote_boxnums[i][cnt]); + hypre_AppendBox(&boxman_entry_box, + hypre_BoxArrayArrayBoxArray(send_boxes, i)); + cnt++; + } + } hypre_TFree(boxman_entries, HYPRE_MEMORY_HOST); - } /* hypre_ForBoxI(i, grid_boxes) */ + } /* hypre_ForBoxI(i, grid_boxes) */ hypre_BoxDestroy(intersect_box); (sendinfo_data -> size) = hypre_BoxArraySize(grid_boxes); (sendinfo_data -> send_boxes) = send_boxes; (sendinfo_data -> send_procs) = send_processes; - (sendinfo_data -> send_remote_boxnums)= send_remote_boxnums; + (sendinfo_data -> send_remote_boxnums) = send_remote_boxnums; return sendinfo_data; } @@ -144,16 +145,16 @@ hypre_SStructSendInfoDataDestroy(hypre_SStructSendInfoData *sendinfo_data) hypre_BoxArrayArrayDestroy( (sendinfo_data -> send_boxes) ); } - for (i= 0; i< (sendinfo_data -> size); i++) + for (i = 0; i < (sendinfo_data -> size); i++) { if (sendinfo_data -> send_procs[i]) { - hypre_TFree(sendinfo_data -> send_procs[i], HYPRE_MEMORY_HOST); + hypre_TFree(sendinfo_data -> send_procs[i], HYPRE_MEMORY_HOST); } if (sendinfo_data -> send_remote_boxnums[i]) { - hypre_TFree(sendinfo_data -> send_remote_boxnums[i], HYPRE_MEMORY_HOST); + hypre_TFree(sendinfo_data -> send_remote_boxnums[i], HYPRE_MEMORY_HOST); } } hypre_TFree(sendinfo_data -> send_procs, HYPRE_MEMORY_HOST); diff --git a/external/hypre/src/sstruct_ls/sstruct_sendinfo.h b/external/hypre/src/sstruct_ls/sstruct_sendinfo.h index f380596c..40289585 100644 --- a/external/hypre/src/sstruct_ls/sstruct_sendinfo.h +++ b/external/hypre/src/sstruct_ls/sstruct_sendinfo.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -12,7 +12,7 @@ #define hypre_SENDINFODATA_HEADER -typedef struct +typedef struct { HYPRE_Int size; diff --git a/external/hypre/src/sstruct_ls/sstruct_sharedDOFComm.c b/external/hypre/src/sstruct_ls/sstruct_sharedDOFComm.c index 51a066f5..35b2978c 100644 --- a/external/hypre/src/sstruct_ls/sstruct_sharedDOFComm.c +++ b/external/hypre/src/sstruct_ls/sstruct_sharedDOFComm.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -25,14 +25,14 @@ hypre_MaxwellOffProcRowCreate(HYPRE_Int ncols) HYPRE_BigInt *cols; HYPRE_Real *data; - OffProcRow= hypre_CTAlloc(hypre_MaxwellOffProcRow, 1, HYPRE_MEMORY_HOST); - (OffProcRow -> ncols)= ncols; + OffProcRow = hypre_CTAlloc(hypre_MaxwellOffProcRow, 1, HYPRE_MEMORY_HOST); + (OffProcRow -> ncols) = ncols; - cols= hypre_TAlloc(HYPRE_BigInt, ncols, HYPRE_MEMORY_HOST); - data= hypre_TAlloc(HYPRE_Real, ncols, HYPRE_MEMORY_HOST); + cols = hypre_TAlloc(HYPRE_BigInt, ncols, HYPRE_MEMORY_HOST); + data = hypre_TAlloc(HYPRE_Real, ncols, HYPRE_MEMORY_HOST); - (OffProcRow -> cols)= cols; - (OffProcRow -> data)= data; + (OffProcRow -> cols) = cols; + (OffProcRow -> data) = data; return OffProcRow; } @@ -43,8 +43,8 @@ hypre_MaxwellOffProcRowCreate(HYPRE_Int ncols) HYPRE_Int hypre_MaxwellOffProcRowDestroy(void *OffProcRow_vdata) { - hypre_MaxwellOffProcRow *OffProcRow= (hypre_MaxwellOffProcRow *)OffProcRow_vdata; - HYPRE_Int ierr= 0; + hypre_MaxwellOffProcRow *OffProcRow = (hypre_MaxwellOffProcRow *)OffProcRow_vdata; + HYPRE_Int ierr = 0; if (OffProcRow) { @@ -60,7 +60,7 @@ hypre_MaxwellOffProcRowDestroy(void *OffProcRow_vdata) * hypre_SStructSharedDOF_ParcsrMatRowsComm * Given a sstruct_grid & parcsr matrix with rows corresponding to the * sstruct_grid, determine and extract the rows that must be communicated. - * These rows are for shared dof that geometrically lie on processor + * These rows are for shared dof that geometrically lie on processor * boundaries but internally are stored on one processor. * Algo: * for each cellbox @@ -74,7 +74,7 @@ hypre_MaxwellOffProcRowDestroy(void *OffProcRow_vdata) * a) if belong on another proc, these are the recvs: * count and prepare the communication buffers and * values. - * + * * SENDs: * i) form layer of cells that is one layer off cellbox * (stretches in the appropriate direction) @@ -86,7 +86,7 @@ hypre_MaxwellOffProcRowDestroy(void *OffProcRow_vdata) * values. * * Note: For the recv data, the dof can come from only one processor. - * For the send data, the dof can go to more than one processor + * For the send data, the dof can go to more than one processor * (the same dof is on the boundary of several cells). *--------------------------------------------------------------------------*/ HYPRE_Int @@ -95,12 +95,12 @@ hypre_SStructSharedDOF_ParcsrMatRowsComm( hypre_SStructGrid *grid, HYPRE_Int *num_offprocrows_ptr, hypre_MaxwellOffProcRow ***OffProcRows_ptr) { - MPI_Comm A_comm= hypre_ParCSRMatrixComm(A); - MPI_Comm grid_comm= hypre_SStructGridComm(grid); + MPI_Comm A_comm = hypre_ParCSRMatrixComm(A); + MPI_Comm grid_comm = hypre_SStructGridComm(grid); - HYPRE_Int matrix_type= HYPRE_PARCSR; + HYPRE_Int matrix_type = HYPRE_PARCSR; - HYPRE_Int nparts= hypre_SStructGridNParts(grid); + HYPRE_Int nparts = hypre_SStructGridNParts(grid); HYPRE_Int ndim = hypre_SStructGridNDim(grid); hypre_SStructGrid *cell_ssgrid; @@ -111,13 +111,13 @@ hypre_SStructSharedDOF_ParcsrMatRowsComm( hypre_SStructGrid *grid, hypre_Box *box, *cellbox, vbox, boxman_entry_box; hypre_Index loop_size, start, lindex; - HYPRE_BigInt start_rank, end_rank, rank; + HYPRE_BigInt start_rank, end_rank, rank; HYPRE_Int i, j, k, m, n, t, part, var, nvars; HYPRE_SStructVariable *vartypes; - HYPRE_Int nbdry_slabs; - hypre_BoxArray *recv_slabs, *send_slabs; + HYPRE_Int nbdry_slabs = 0; + hypre_BoxArray *recv_slabs = NULL, *send_slabs = NULL; hypre_Index varoffset; hypre_BoxManager **boxmans, *cell_boxman; @@ -129,7 +129,7 @@ hypre_SStructSharedDOF_ParcsrMatRowsComm( hypre_SStructGrid *grid, HYPRE_Int proc, nprocs, myproc; HYPRE_Int *SendToProcs, *RecvFromProcs; HYPRE_Int **send_RowsNcols; /* buffer for rows & ncols */ - HYPRE_Int *send_RowsNcols_alloc; + HYPRE_Int *send_RowsNcols_alloc; HYPRE_Int *send_ColsData_alloc; HYPRE_Int *tot_nsendRowsNcols, *tot_sendColsData; HYPRE_Real **vals; /* buffer for cols & data */ @@ -146,33 +146,34 @@ hypre_SStructSharedDOF_ParcsrMatRowsComm( hypre_SStructGrid *grid, hypre_MaxwellOffProcRow **OffProcRows; HYPRE_Int *starts; - HYPRE_Int ierr= 0; + HYPRE_Int ierr = 0; hypre_BoxInit(&vbox, ndim); hypre_BoxInit(&boxman_entry_box, ndim); + hypre_SetIndex(lindex, 0); hypre_MPI_Comm_rank(A_comm, &myproc); hypre_MPI_Comm_size(grid_comm, &nprocs); - start_rank= hypre_ParCSRMatrixFirstRowIndex(A); + start_rank = hypre_ParCSRMatrixFirstRowIndex(A); end_rank = hypre_ParCSRMatrixLastRowIndex(A); /* need a cellgrid boxman to determine the send boxes -> only the cell dofs are unique so a boxman intersect can be used to get the edges that must be sent. */ HYPRE_SStructGridCreate(grid_comm, ndim, nparts, &cell_ssgrid); - vartypes= hypre_CTAlloc(HYPRE_SStructVariable, 1, HYPRE_MEMORY_HOST); - vartypes[0]= HYPRE_SSTRUCT_VARIABLE_CELL; + vartypes = hypre_CTAlloc(HYPRE_SStructVariable, 1, HYPRE_MEMORY_HOST); + vartypes[0] = HYPRE_SSTRUCT_VARIABLE_CELL; - for (i= 0; i< nparts; i++) + for (i = 0; i < nparts; i++) { - pgrid= hypre_SStructGridPGrid(grid, i); - cellgrid= hypre_SStructPGridCellSGrid(pgrid); + pgrid = hypre_SStructGridPGrid(grid, i); + cellgrid = hypre_SStructPGridCellSGrid(pgrid); - cellboxes= hypre_StructGridBoxes(cellgrid); + cellboxes = hypre_StructGridBoxes(cellgrid); hypre_ForBoxI(j, cellboxes) { - box= hypre_BoxArrayBox(cellboxes, j); + box = hypre_BoxArrayBox(cellboxes, j); HYPRE_SStructGridSetExtents(cell_ssgrid, i, hypre_BoxIMin(box), hypre_BoxIMax(box)); } @@ -180,50 +181,50 @@ hypre_SStructSharedDOF_ParcsrMatRowsComm( hypre_SStructGrid *grid, } HYPRE_SStructGridAssemble(cell_ssgrid); hypre_TFree(vartypes, HYPRE_MEMORY_HOST); - + /* box algebra to determine communication */ SendToProcs = hypre_CTAlloc(HYPRE_Int, nprocs, HYPRE_MEMORY_HOST); RecvFromProcs = hypre_CTAlloc(HYPRE_Int, nprocs, HYPRE_MEMORY_HOST); send_RowsNcols = hypre_TAlloc(HYPRE_Int *, nprocs, HYPRE_MEMORY_HOST); - send_RowsNcols_alloc= hypre_TAlloc(HYPRE_Int , nprocs, HYPRE_MEMORY_HOST); - send_ColsData_alloc = hypre_TAlloc(HYPRE_Int , nprocs, HYPRE_MEMORY_HOST); + send_RowsNcols_alloc = hypre_TAlloc(HYPRE_Int, nprocs, HYPRE_MEMORY_HOST); + send_ColsData_alloc = hypre_TAlloc(HYPRE_Int, nprocs, HYPRE_MEMORY_HOST); vals = hypre_TAlloc(HYPRE_Real *, nprocs, HYPRE_MEMORY_HOST); tot_nsendRowsNcols = hypre_CTAlloc(HYPRE_Int, nprocs, HYPRE_MEMORY_HOST); tot_sendColsData = hypre_CTAlloc(HYPRE_Int, nprocs, HYPRE_MEMORY_HOST); - for (i= 0; i< nprocs; i++) + for (i = 0; i < nprocs; i++) { - send_RowsNcols[i]= hypre_TAlloc(HYPRE_Int, 1000, HYPRE_MEMORY_HOST); /* initial allocation */ - send_RowsNcols_alloc[i]= 1000; + send_RowsNcols[i] = hypre_TAlloc(HYPRE_Int, 1000, HYPRE_MEMORY_HOST); /* initial allocation */ + send_RowsNcols_alloc[i] = 1000; - vals[i]= hypre_TAlloc(HYPRE_Real, 2000, HYPRE_MEMORY_HOST); /* initial allocation */ - send_ColsData_alloc[i]= 2000; + vals[i] = hypre_TAlloc(HYPRE_Real, 2000, HYPRE_MEMORY_HOST); /* initial allocation */ + send_ColsData_alloc[i] = 2000; } - - for (part= 0; part< nparts; part++) + + for (part = 0; part < nparts; part++) { - pgrid= hypre_SStructGridPGrid(grid, part); - nvars= hypre_SStructPGridNVars(pgrid); - vartypes= hypre_SStructPGridVarTypes(pgrid); + pgrid = hypre_SStructGridPGrid(grid, part); + nvars = hypre_SStructPGridNVars(pgrid); + vartypes = hypre_SStructPGridVarTypes(pgrid); cellgrid = hypre_SStructPGridCellSGrid(pgrid); - cellboxes= hypre_StructGridBoxes(cellgrid); + cellboxes = hypre_StructGridBoxes(cellgrid); - boxmans= hypre_TAlloc(hypre_BoxManager *, nvars, HYPRE_MEMORY_HOST); - for (t= 0; t< nvars; t++) + boxmans = hypre_TAlloc(hypre_BoxManager *, nvars, HYPRE_MEMORY_HOST); + for (t = 0; t < nvars; t++) { - boxmans[t]= hypre_SStructGridBoxManager(grid, part, t); + boxmans[t] = hypre_SStructGridBoxManager(grid, part, t); } - cell_boxman= hypre_SStructGridBoxManager(cell_ssgrid, part, 0); + cell_boxman = hypre_SStructGridBoxManager(cell_ssgrid, part, 0); hypre_ForBoxI(j, cellboxes) { - cellbox= hypre_BoxArrayBox(cellboxes, j); + cellbox = hypre_BoxArrayBox(cellboxes, j); - for (t= 0; t< nvars; t++) + for (t = 0; t < nvars; t++) { - var= vartypes[t]; + var = vartypes[t]; hypre_SStructVariableGetOffset((hypre_SStructVariable) var, ndim, varoffset); @@ -233,52 +234,52 @@ hypre_SStructSharedDOF_ParcsrMatRowsComm( hypre_SStructGrid *grid, hypre_BoxIMin(&vbox)); /* boundary layer box depends on variable type */ - switch(var) + switch (var) { case 1: /* node based */ { - nbdry_slabs= 6; + nbdry_slabs = 6; recv_slabs = hypre_BoxArrayCreate(nbdry_slabs, ndim); /* slab in the +/- i,j,k directions */ - box= hypre_BoxArrayBox(recv_slabs, 0); + box = hypre_BoxArrayBox(recv_slabs, 0); hypre_CopyBox(&vbox, box); - hypre_BoxIMin(box)[0]= hypre_BoxIMax(box)[0]; + hypre_BoxIMin(box)[0] = hypre_BoxIMax(box)[0]; - box= hypre_BoxArrayBox(recv_slabs, 1); + box = hypre_BoxArrayBox(recv_slabs, 1); hypre_CopyBox(&vbox, box); - hypre_BoxIMax(box)[0]= hypre_BoxIMin(box)[0]; + hypre_BoxIMax(box)[0] = hypre_BoxIMin(box)[0]; /* need to contract the slab in the i direction to avoid repeated counting of some nodes. */ - box= hypre_BoxArrayBox(recv_slabs, 2); + box = hypre_BoxArrayBox(recv_slabs, 2); hypre_CopyBox(&vbox, box); - hypre_BoxIMin(box)[1]= hypre_BoxIMax(box)[1]; + hypre_BoxIMin(box)[1] = hypre_BoxIMax(box)[1]; hypre_BoxIMin(box)[0]++; /* contract */ hypre_BoxIMax(box)[0]--; /* contract */ - box= hypre_BoxArrayBox(recv_slabs, 3); + box = hypre_BoxArrayBox(recv_slabs, 3); hypre_CopyBox(&vbox, box); - hypre_BoxIMax(box)[1]= hypre_BoxIMin(box)[1]; + hypre_BoxIMax(box)[1] = hypre_BoxIMin(box)[1]; hypre_BoxIMin(box)[0]++; /* contract */ hypre_BoxIMax(box)[0]--; /* contract */ /* need to contract the slab in the i & j directions to avoid repeated counting of some nodes. */ - box= hypre_BoxArrayBox(recv_slabs, 4); + box = hypre_BoxArrayBox(recv_slabs, 4); hypre_CopyBox(&vbox, box); - hypre_BoxIMin(box)[2]= hypre_BoxIMax(box)[2]; + hypre_BoxIMin(box)[2] = hypre_BoxIMax(box)[2]; hypre_BoxIMin(box)[0]++; /* contract */ hypre_BoxIMax(box)[0]--; /* contract */ hypre_BoxIMin(box)[1]++; /* contract */ hypre_BoxIMax(box)[1]--; /* contract */ - box= hypre_BoxArrayBox(recv_slabs, 5); + box = hypre_BoxArrayBox(recv_slabs, 5); hypre_CopyBox(&vbox, box); - hypre_BoxIMax(box)[2]= hypre_BoxIMin(box)[2]; + hypre_BoxIMax(box)[2] = hypre_BoxIMin(box)[2]; hypre_BoxIMin(box)[0]++; /* contract */ hypre_BoxIMax(box)[0]--; /* contract */ @@ -286,342 +287,342 @@ hypre_SStructSharedDOF_ParcsrMatRowsComm( hypre_SStructGrid *grid, hypre_BoxIMax(box)[1]--; /* contract */ /* send boxes are cell-based stretching out of cellbox - i.e., cells - that have these edges as boundary */ - send_slabs= hypre_BoxArrayCreate(nbdry_slabs, ndim); - - box= hypre_BoxArrayBox(send_slabs, 0); + that have these edges as boundary */ + send_slabs = hypre_BoxArrayCreate(nbdry_slabs, ndim); + + box = hypre_BoxArrayBox(send_slabs, 0); hypre_CopyBox(cellbox, box); hypre_BoxIMax(box)[0]++; - hypre_BoxIMin(box)[0]= hypre_BoxIMax(box)[0]; + hypre_BoxIMin(box)[0] = hypre_BoxIMax(box)[0]; hypre_BoxIMax(box)[2]++; /* stretch one layer +/- k*/ - hypre_BoxIMin(box)[2]--; + hypre_BoxIMin(box)[2]--; hypre_BoxIMax(box)[1]++; /* stretch one layer +/- j*/ - hypre_BoxIMin(box)[1]--; + hypre_BoxIMin(box)[1]--; - box= hypre_BoxArrayBox(send_slabs, 1); + box = hypre_BoxArrayBox(send_slabs, 1); hypre_CopyBox(cellbox, box); hypre_BoxIMin(box)[0]--; - hypre_BoxIMax(box)[0]= hypre_BoxIMin(box)[0]; + hypre_BoxIMax(box)[0] = hypre_BoxIMin(box)[0]; hypre_BoxIMax(box)[2]++; /* stretch one layer +/- k*/ - hypre_BoxIMin(box)[2]--; + hypre_BoxIMin(box)[2]--; hypre_BoxIMax(box)[1]++; /* stretch one layer +/- j*/ - hypre_BoxIMin(box)[1]--; + hypre_BoxIMin(box)[1]--; - box= hypre_BoxArrayBox(send_slabs, 2); + box = hypre_BoxArrayBox(send_slabs, 2); hypre_CopyBox(cellbox, box); hypre_BoxIMax(box)[1]++; - hypre_BoxIMin(box)[1]= hypre_BoxIMax(box)[1]; + hypre_BoxIMin(box)[1] = hypre_BoxIMax(box)[1]; hypre_BoxIMax(box)[2]++; /* stretch one layer +/- k*/ hypre_BoxIMin(box)[2]--; - box= hypre_BoxArrayBox(send_slabs, 3); + box = hypre_BoxArrayBox(send_slabs, 3); hypre_CopyBox(cellbox, box); hypre_BoxIMin(box)[1]--; - hypre_BoxIMax(box)[1]= hypre_BoxIMin(box)[1]; + hypre_BoxIMax(box)[1] = hypre_BoxIMin(box)[1]; hypre_BoxIMax(box)[2]++; /* stretch one layer +/- k*/ hypre_BoxIMin(box)[2]--; - box= hypre_BoxArrayBox(send_slabs, 4); + box = hypre_BoxArrayBox(send_slabs, 4); hypre_CopyBox(cellbox, box); hypre_BoxIMax(box)[2]++; - hypre_BoxIMin(box)[2]= hypre_BoxIMax(box)[2]; + hypre_BoxIMin(box)[2] = hypre_BoxIMax(box)[2]; - box= hypre_BoxArrayBox(send_slabs, 5); + box = hypre_BoxArrayBox(send_slabs, 5); hypre_CopyBox(cellbox, box); hypre_BoxIMin(box)[2]--; - hypre_BoxIMax(box)[2]= hypre_BoxIMin(box)[2]; + hypre_BoxIMax(box)[2] = hypre_BoxIMin(box)[2]; break; } case 2: /* x-face based */ { - nbdry_slabs= 2; - recv_slabs= hypre_BoxArrayCreate(nbdry_slabs, ndim); + nbdry_slabs = 2; + recv_slabs = hypre_BoxArrayCreate(nbdry_slabs, ndim); /* slab in the +/- i direction */ - box= hypre_BoxArrayBox(recv_slabs, 0); + box = hypre_BoxArrayBox(recv_slabs, 0); hypre_CopyBox(&vbox, box); - hypre_BoxIMin(box)[0]= hypre_BoxIMax(box)[0]; + hypre_BoxIMin(box)[0] = hypre_BoxIMax(box)[0]; - box= hypre_BoxArrayBox(recv_slabs, 1); + box = hypre_BoxArrayBox(recv_slabs, 1); hypre_CopyBox(&vbox, box); - hypre_BoxIMax(box)[0]= hypre_BoxIMin(box)[0]; + hypre_BoxIMax(box)[0] = hypre_BoxIMin(box)[0]; /* send boxes are cell-based stretching out of cellbox - i.e., cells - that have these edges as boundary */ - send_slabs= hypre_BoxArrayCreate(nbdry_slabs, ndim); - - box= hypre_BoxArrayBox(send_slabs, 0); + that have these edges as boundary */ + send_slabs = hypre_BoxArrayCreate(nbdry_slabs, ndim); + + box = hypre_BoxArrayBox(send_slabs, 0); hypre_CopyBox(cellbox, box); hypre_BoxIMax(box)[0]++; - hypre_BoxIMin(box)[0]= hypre_BoxIMax(box)[0]; + hypre_BoxIMin(box)[0] = hypre_BoxIMax(box)[0]; - box= hypre_BoxArrayBox(send_slabs, 1); + box = hypre_BoxArrayBox(send_slabs, 1); hypre_CopyBox(cellbox, box); hypre_BoxIMin(box)[0]--; - hypre_BoxIMax(box)[0]= hypre_BoxIMin(box)[0]; + hypre_BoxIMax(box)[0] = hypre_BoxIMin(box)[0]; break; } case 3: /* y-face based */ { - nbdry_slabs= 2; - recv_slabs= hypre_BoxArrayCreate(nbdry_slabs, ndim); + nbdry_slabs = 2; + recv_slabs = hypre_BoxArrayCreate(nbdry_slabs, ndim); /* slab in the +/- j direction */ - box= hypre_BoxArrayBox(recv_slabs, 0); + box = hypre_BoxArrayBox(recv_slabs, 0); hypre_CopyBox(&vbox, box); - hypre_BoxIMin(box)[1]= hypre_BoxIMax(box)[1]; + hypre_BoxIMin(box)[1] = hypre_BoxIMax(box)[1]; - box= hypre_BoxArrayBox(recv_slabs, 1); + box = hypre_BoxArrayBox(recv_slabs, 1); hypre_CopyBox(&vbox, box); - hypre_BoxIMax(box)[1]= hypre_BoxIMin(box)[1]; + hypre_BoxIMax(box)[1] = hypre_BoxIMin(box)[1]; /* send boxes are cell-based stretching out of cellbox - i.e., cells that have these edges as boundary */ - send_slabs= hypre_BoxArrayCreate(nbdry_slabs, ndim); + send_slabs = hypre_BoxArrayCreate(nbdry_slabs, ndim); - box= hypre_BoxArrayBox(send_slabs, 0); + box = hypre_BoxArrayBox(send_slabs, 0); hypre_CopyBox(cellbox, box); hypre_BoxIMax(box)[1]++; - hypre_BoxIMin(box)[1]= hypre_BoxIMax(box)[1]; + hypre_BoxIMin(box)[1] = hypre_BoxIMax(box)[1]; - box= hypre_BoxArrayBox(send_slabs, 1); + box = hypre_BoxArrayBox(send_slabs, 1); hypre_CopyBox(cellbox, box); hypre_BoxIMin(box)[1]--; - hypre_BoxIMax(box)[1]= hypre_BoxIMin(box)[1]; + hypre_BoxIMax(box)[1] = hypre_BoxIMin(box)[1]; break; } case 4: /* z-face based */ { - nbdry_slabs= 2; - recv_slabs= hypre_BoxArrayCreate(nbdry_slabs, ndim); + nbdry_slabs = 2; + recv_slabs = hypre_BoxArrayCreate(nbdry_slabs, ndim); /* slab in the +/- k direction */ - box= hypre_BoxArrayBox(recv_slabs, 0); + box = hypre_BoxArrayBox(recv_slabs, 0); hypre_CopyBox(&vbox, box); - hypre_BoxIMin(box)[2]= hypre_BoxIMax(box)[2]; + hypre_BoxIMin(box)[2] = hypre_BoxIMax(box)[2]; - box= hypre_BoxArrayBox(recv_slabs, 1); + box = hypre_BoxArrayBox(recv_slabs, 1); hypre_CopyBox(&vbox, box); - hypre_BoxIMax(box)[2]= hypre_BoxIMin(box)[2]; + hypre_BoxIMax(box)[2] = hypre_BoxIMin(box)[2]; /* send boxes are cell-based stretching out of cellbox - i.e., cells that have these edges as boundary */ - send_slabs= hypre_BoxArrayCreate(nbdry_slabs, ndim); + send_slabs = hypre_BoxArrayCreate(nbdry_slabs, ndim); - box= hypre_BoxArrayBox(send_slabs, 0); + box = hypre_BoxArrayBox(send_slabs, 0); hypre_CopyBox(cellbox, box); hypre_BoxIMax(box)[2]++; - hypre_BoxIMin(box)[2]= hypre_BoxIMax(box)[2]; + hypre_BoxIMin(box)[2] = hypre_BoxIMax(box)[2]; - box= hypre_BoxArrayBox(send_slabs, 1); + box = hypre_BoxArrayBox(send_slabs, 1); hypre_CopyBox(cellbox, box); hypre_BoxIMin(box)[2]--; - hypre_BoxIMax(box)[2]= hypre_BoxIMin(box)[2]; + hypre_BoxIMax(box)[2] = hypre_BoxIMin(box)[2]; break; } case 5: /* x-edge based */ { - nbdry_slabs= 4; - recv_slabs= hypre_BoxArrayCreate(nbdry_slabs, ndim); + nbdry_slabs = 4; + recv_slabs = hypre_BoxArrayCreate(nbdry_slabs, ndim); /* slab in the +/- j & k direction */ - box= hypre_BoxArrayBox(recv_slabs, 0); + box = hypre_BoxArrayBox(recv_slabs, 0); hypre_CopyBox(&vbox, box); - hypre_BoxIMin(box)[1]= hypre_BoxIMax(box)[1]; + hypre_BoxIMin(box)[1] = hypre_BoxIMax(box)[1]; - box= hypre_BoxArrayBox(recv_slabs, 1); + box = hypre_BoxArrayBox(recv_slabs, 1); hypre_CopyBox(&vbox, box); - hypre_BoxIMax(box)[1]= hypre_BoxIMin(box)[1]; + hypre_BoxIMax(box)[1] = hypre_BoxIMin(box)[1]; /* need to contract the slab in the j direction to avoid repeated counting of some x-edges. */ - box= hypre_BoxArrayBox(recv_slabs, 2); + box = hypre_BoxArrayBox(recv_slabs, 2); hypre_CopyBox(&vbox, box); - hypre_BoxIMin(box)[2]= hypre_BoxIMax(box)[2]; + hypre_BoxIMin(box)[2] = hypre_BoxIMax(box)[2]; hypre_BoxIMin(box)[1]++; /* contract */ hypre_BoxIMax(box)[1]--; /* contract */ - box= hypre_BoxArrayBox(recv_slabs, 3); + box = hypre_BoxArrayBox(recv_slabs, 3); hypre_CopyBox(&vbox, box); - hypre_BoxIMax(box)[2]= hypre_BoxIMin(box)[2]; + hypre_BoxIMax(box)[2] = hypre_BoxIMin(box)[2]; hypre_BoxIMin(box)[1]++; /* contract */ hypre_BoxIMax(box)[1]--; /* contract */ /* send boxes are cell-based stretching out of cellbox - i.e., cells that have these edges as boundary */ - send_slabs= hypre_BoxArrayCreate(nbdry_slabs, ndim); + send_slabs = hypre_BoxArrayCreate(nbdry_slabs, ndim); - box= hypre_BoxArrayBox(send_slabs, 0); + box = hypre_BoxArrayBox(send_slabs, 0); hypre_CopyBox(cellbox, box); hypre_BoxIMax(box)[1]++; - hypre_BoxIMin(box)[1]= hypre_BoxIMax(box)[1]; + hypre_BoxIMin(box)[1] = hypre_BoxIMax(box)[1]; hypre_BoxIMax(box)[2]++; /* stretch one layer +/- k*/ - hypre_BoxIMin(box)[2]--; + hypre_BoxIMin(box)[2]--; - box= hypre_BoxArrayBox(send_slabs, 1); + box = hypre_BoxArrayBox(send_slabs, 1); hypre_CopyBox(cellbox, box); hypre_BoxIMin(box)[1]--; - hypre_BoxIMax(box)[1]= hypre_BoxIMin(box)[1]; + hypre_BoxIMax(box)[1] = hypre_BoxIMin(box)[1]; hypre_BoxIMax(box)[2]++; /* stretch one layer +/- k*/ hypre_BoxIMin(box)[2]--; - box= hypre_BoxArrayBox(send_slabs, 2); + box = hypre_BoxArrayBox(send_slabs, 2); hypre_CopyBox(cellbox, box); - hypre_BoxIMax(box)[2]++; - hypre_BoxIMin(box)[2]= hypre_BoxIMax(box)[2]; + hypre_BoxIMax(box)[2]++; + hypre_BoxIMin(box)[2] = hypre_BoxIMax(box)[2]; - box= hypre_BoxArrayBox(send_slabs, 3); + box = hypre_BoxArrayBox(send_slabs, 3); hypre_CopyBox(cellbox, box); - hypre_BoxIMin(box)[2]--; - hypre_BoxIMax(box)[2]= hypre_BoxIMin(box)[2]; + hypre_BoxIMin(box)[2]--; + hypre_BoxIMax(box)[2] = hypre_BoxIMin(box)[2]; break; - } + } case 6: /* y-edge based */ { - nbdry_slabs= 4; - recv_slabs= hypre_BoxArrayCreate(nbdry_slabs, ndim); + nbdry_slabs = 4; + recv_slabs = hypre_BoxArrayCreate(nbdry_slabs, ndim); /* slab in the +/- i & k direction */ - box= hypre_BoxArrayBox(recv_slabs, 0); + box = hypre_BoxArrayBox(recv_slabs, 0); hypre_CopyBox(&vbox, box); - hypre_BoxIMin(box)[0]= hypre_BoxIMax(box)[0]; + hypre_BoxIMin(box)[0] = hypre_BoxIMax(box)[0]; - box= hypre_BoxArrayBox(recv_slabs, 1); + box = hypre_BoxArrayBox(recv_slabs, 1); hypre_CopyBox(&vbox, box); - hypre_BoxIMax(box)[0]= hypre_BoxIMin(box)[0]; + hypre_BoxIMax(box)[0] = hypre_BoxIMin(box)[0]; /* need to contract the slab in the i direction to avoid repeated counting of some y-edges. */ - box= hypre_BoxArrayBox(recv_slabs, 2); + box = hypre_BoxArrayBox(recv_slabs, 2); hypre_CopyBox(&vbox, box); - hypre_BoxIMin(box)[2]= hypre_BoxIMax(box)[2]; + hypre_BoxIMin(box)[2] = hypre_BoxIMax(box)[2]; hypre_BoxIMin(box)[0]++; /* contract */ hypre_BoxIMax(box)[0]--; /* contract */ - box= hypre_BoxArrayBox(recv_slabs, 3); + box = hypre_BoxArrayBox(recv_slabs, 3); hypre_CopyBox(&vbox, box); - hypre_BoxIMax(box)[2]= hypre_BoxIMin(box)[2]; + hypre_BoxIMax(box)[2] = hypre_BoxIMin(box)[2]; hypre_BoxIMin(box)[0]++; /* contract */ hypre_BoxIMax(box)[0]--; /* contract */ /* send boxes are cell-based stretching out of cellbox - i.e., cells that have these edges as boundary */ - send_slabs= hypre_BoxArrayCreate(nbdry_slabs, ndim); + send_slabs = hypre_BoxArrayCreate(nbdry_slabs, ndim); - box= hypre_BoxArrayBox(send_slabs, 0); + box = hypre_BoxArrayBox(send_slabs, 0); hypre_CopyBox(cellbox, box); hypre_BoxIMax(box)[0]++; - hypre_BoxIMin(box)[0]= hypre_BoxIMax(box)[0]; + hypre_BoxIMin(box)[0] = hypre_BoxIMax(box)[0]; hypre_BoxIMax(box)[2]++; /* stretch one layer +/- k*/ - hypre_BoxIMin(box)[2]--; + hypre_BoxIMin(box)[2]--; - box= hypre_BoxArrayBox(send_slabs, 1); + box = hypre_BoxArrayBox(send_slabs, 1); hypre_CopyBox(cellbox, box); hypre_BoxIMin(box)[0]--; - hypre_BoxIMax(box)[0]= hypre_BoxIMin(box)[0]; + hypre_BoxIMax(box)[0] = hypre_BoxIMin(box)[0]; hypre_BoxIMax(box)[2]++; /* stretch one layer +/- k*/ hypre_BoxIMin(box)[2]--; - box= hypre_BoxArrayBox(send_slabs, 2); + box = hypre_BoxArrayBox(send_slabs, 2); hypre_CopyBox(cellbox, box); - hypre_BoxIMax(box)[2]++; - hypre_BoxIMin(box)[2]= hypre_BoxIMax(box)[2]; + hypre_BoxIMax(box)[2]++; + hypre_BoxIMin(box)[2] = hypre_BoxIMax(box)[2]; - box= hypre_BoxArrayBox(send_slabs, 3); + box = hypre_BoxArrayBox(send_slabs, 3); hypre_CopyBox(cellbox, box); - hypre_BoxIMin(box)[2]--; - hypre_BoxIMax(box)[2]= hypre_BoxIMin(box)[2]; + hypre_BoxIMin(box)[2]--; + hypre_BoxIMax(box)[2] = hypre_BoxIMin(box)[2]; break; } case 7: /* z-edge based */ { - nbdry_slabs= 4; - recv_slabs= hypre_BoxArrayCreate(nbdry_slabs, ndim); + nbdry_slabs = 4; + recv_slabs = hypre_BoxArrayCreate(nbdry_slabs, ndim); /* slab in the +/- i & j direction */ - box= hypre_BoxArrayBox(recv_slabs, 0); + box = hypre_BoxArrayBox(recv_slabs, 0); hypre_CopyBox(&vbox, box); - hypre_BoxIMin(box)[0]= hypre_BoxIMax(box)[0]; + hypre_BoxIMin(box)[0] = hypre_BoxIMax(box)[0]; - box= hypre_BoxArrayBox(recv_slabs, 1); + box = hypre_BoxArrayBox(recv_slabs, 1); hypre_CopyBox(&vbox, box); - hypre_BoxIMax(box)[0]= hypre_BoxIMin(box)[0]; + hypre_BoxIMax(box)[0] = hypre_BoxIMin(box)[0]; /* need to contract the slab in the i direction to avoid repeated counting of some z-edges. */ - box= hypre_BoxArrayBox(recv_slabs, 2); + box = hypre_BoxArrayBox(recv_slabs, 2); hypre_CopyBox(&vbox, box); - hypre_BoxIMin(box)[1]= hypre_BoxIMax(box)[1]; + hypre_BoxIMin(box)[1] = hypre_BoxIMax(box)[1]; hypre_BoxIMin(box)[0]++; /* contract */ hypre_BoxIMax(box)[0]--; /* contract */ - box= hypre_BoxArrayBox(recv_slabs, 3); + box = hypre_BoxArrayBox(recv_slabs, 3); hypre_CopyBox(&vbox, box); - hypre_BoxIMax(box)[1]= hypre_BoxIMin(box)[1]; + hypre_BoxIMax(box)[1] = hypre_BoxIMin(box)[1]; hypre_BoxIMin(box)[0]++; /* contract */ hypre_BoxIMax(box)[0]--; /* contract */ /* send boxes are cell-based stretching out of cellbox - i.e., cells that have these edges as boundary */ - send_slabs= hypre_BoxArrayCreate(nbdry_slabs, ndim); + send_slabs = hypre_BoxArrayCreate(nbdry_slabs, ndim); - box= hypre_BoxArrayBox(send_slabs, 0); + box = hypre_BoxArrayBox(send_slabs, 0); hypre_CopyBox(cellbox, box); hypre_BoxIMax(box)[1]++; - hypre_BoxIMin(box)[1]= hypre_BoxIMax(box)[1]; + hypre_BoxIMin(box)[1] = hypre_BoxIMax(box)[1]; hypre_BoxIMax(box)[0]++; /* stretch one layer +/- i*/ - hypre_BoxIMin(box)[0]--; + hypre_BoxIMin(box)[0]--; - box= hypre_BoxArrayBox(send_slabs, 1); + box = hypre_BoxArrayBox(send_slabs, 1); hypre_CopyBox(cellbox, box); hypre_BoxIMin(box)[1]--; - hypre_BoxIMax(box)[1]= hypre_BoxIMin(box)[1]; + hypre_BoxIMax(box)[1] = hypre_BoxIMin(box)[1]; hypre_BoxIMax(box)[0]++; /* stretch one layer +/- i*/ hypre_BoxIMin(box)[0]--; - box= hypre_BoxArrayBox(send_slabs, 2); + box = hypre_BoxArrayBox(send_slabs, 2); hypre_CopyBox(cellbox, box); - hypre_BoxIMax(box)[0]++; - hypre_BoxIMin(box)[0]= hypre_BoxIMax(box)[0]; + hypre_BoxIMax(box)[0]++; + hypre_BoxIMin(box)[0] = hypre_BoxIMax(box)[0]; - box= hypre_BoxArrayBox(send_slabs, 3); + box = hypre_BoxArrayBox(send_slabs, 3); hypre_CopyBox(cellbox, box); - hypre_BoxIMin(box)[0]--; - hypre_BoxIMax(box)[0]= hypre_BoxIMin(box)[0]; + hypre_BoxIMin(box)[0]--; + hypre_BoxIMax(box)[0] = hypre_BoxIMin(box)[0]; break; } @@ -629,13 +630,13 @@ hypre_SStructSharedDOF_ParcsrMatRowsComm( hypre_SStructGrid *grid, } /* switch(var) */ /* determine no. of recv rows */ - for (i= 0; i< nbdry_slabs; i++) + for (i = 0; i < nbdry_slabs; i++) { - box= hypre_BoxArrayBox(recv_slabs, i); + box = hypre_BoxArrayBox(recv_slabs, i); hypre_BoxManIntersect(boxmans[t], hypre_BoxIMin(box), hypre_BoxIMax(box), &boxman_entries, &nboxman_entries); - for (m= 0; m< nboxman_entries; m++) + for (m = 0; m < nboxman_entries; m++) { hypre_SStructBoxManEntryGetProcess(boxman_entries[m], &proc); if (proc != myproc) @@ -644,17 +645,17 @@ hypre_SStructSharedDOF_ParcsrMatRowsComm( hypre_SStructGrid *grid, hypre_BoxSetExtents(&boxman_entry_box, ilower, iupper); hypre_IntersectBoxes(&boxman_entry_box, box, &boxman_entry_box); - RecvFromProcs[proc]+= hypre_BoxVolume(&boxman_entry_box); + RecvFromProcs[proc] += hypre_BoxVolume(&boxman_entry_box); } } hypre_TFree(boxman_entries, HYPRE_MEMORY_HOST); - + /* determine send rows. Note the cell_boxman */ - box= hypre_BoxArrayBox(send_slabs, i); + box = hypre_BoxArrayBox(send_slabs, i); hypre_BoxManIntersect(cell_boxman, hypre_BoxIMin(box), hypre_BoxIMax(box), &boxman_entries, &nboxman_entries); - for (m= 0; m< nboxman_entries; m++) + for (m = 0; m < nboxman_entries; m++) { hypre_SStructBoxManEntryGetProcess(boxman_entries[m], &proc); if (proc != myproc) @@ -663,7 +664,7 @@ hypre_SStructSharedDOF_ParcsrMatRowsComm( hypre_SStructGrid *grid, hypre_BoxSetExtents(&boxman_entry_box, ilower, iupper); hypre_IntersectBoxes(&boxman_entry_box, box, &boxman_entry_box); - /* not correct box piece right now. Need to determine + /* not correct box piece right now. Need to determine the correct var box - extend to var_box and then intersect with vbox */ hypre_SubtractIndexes(hypre_BoxIMin(&boxman_entry_box), @@ -671,13 +672,13 @@ hypre_SStructSharedDOF_ParcsrMatRowsComm( hypre_SStructGrid *grid, hypre_BoxIMin(&boxman_entry_box)); hypre_IntersectBoxes(&boxman_entry_box, &vbox, &boxman_entry_box); - SendToProcs[proc]+= 2*hypre_BoxVolume(&boxman_entry_box); + SendToProcs[proc] += 2 * hypre_BoxVolume(&boxman_entry_box); /* check to see if sufficient memory allocation for send_rows */ if (SendToProcs[proc] > send_RowsNcols_alloc[proc]) { - send_RowsNcols_alloc[proc]= SendToProcs[proc]; - send_RowsNcols[proc]= - hypre_TReAlloc(send_RowsNcols[proc], HYPRE_Int, + send_RowsNcols_alloc[proc] = SendToProcs[proc]; + send_RowsNcols[proc] = + hypre_TReAlloc(send_RowsNcols[proc], HYPRE_Int, send_RowsNcols_alloc[proc], HYPRE_MEMORY_HOST); } @@ -702,26 +703,26 @@ hypre_SStructSharedDOF_ParcsrMatRowsComm( hypre_SStructGrid *grid, checking (difficult) the whole expanded box is on myproc */ if (rank <= end_rank && rank >= start_rank) { - send_RowsNcols[proc][tot_nsendRowsNcols[proc]]= rank; + send_RowsNcols[proc][tot_nsendRowsNcols[proc]] = rank; tot_nsendRowsNcols[proc]++; - HYPRE_ParCSRMatrixGetRow((HYPRE_ParCSRMatrix) A, rank, &n, + HYPRE_ParCSRMatrixGetRow((HYPRE_ParCSRMatrix) A, rank, &n, &col_inds, &values); - send_RowsNcols[proc][tot_nsendRowsNcols[proc]]= n; + send_RowsNcols[proc][tot_nsendRowsNcols[proc]] = n; tot_nsendRowsNcols[proc]++; /* check if sufficient memory allocation in the data arrays */ - if ( (tot_sendColsData[proc]+2*n) > send_ColsData_alloc[proc] ) + if ( (tot_sendColsData[proc] + 2 * n) > send_ColsData_alloc[proc] ) { - send_ColsData_alloc[proc]+= 2000; - vals[proc]= hypre_TReAlloc(vals[proc], HYPRE_Real, - send_ColsData_alloc[proc], HYPRE_MEMORY_HOST); + send_ColsData_alloc[proc] += 2000; + vals[proc] = hypre_TReAlloc(vals[proc], HYPRE_Real, + send_ColsData_alloc[proc], HYPRE_MEMORY_HOST); } - for (k= 0; k< n; k++) + for (k = 0; k < n; k++) { - vals[proc][tot_sendColsData[proc]]= (HYPRE_Real) col_inds[k]; + vals[proc][tot_sendColsData[proc]] = (HYPRE_Real) col_inds[k]; tot_sendColsData[proc]++; - vals[proc][tot_sendColsData[proc]]= values[k]; + vals[proc][tot_sendColsData[proc]] = values[k]; tot_sendColsData[proc]++; } HYPRE_ParCSRMatrixRestoreRow((HYPRE_ParCSRMatrix) A, rank, &n, @@ -746,17 +747,17 @@ hypre_SStructSharedDOF_ParcsrMatRowsComm( hypre_SStructGrid *grid, HYPRE_SStructGridDestroy(cell_ssgrid); - num_sends= 0; - num_recvs= 0; - k= 0; - starts= hypre_CTAlloc(HYPRE_Int, nprocs+1, HYPRE_MEMORY_HOST); - for (i= 0; i< nprocs; i++) + num_sends = 0; + num_recvs = 0; + k = 0; + starts = hypre_CTAlloc(HYPRE_Int, nprocs + 1, HYPRE_MEMORY_HOST); + for (i = 0; i < nprocs; i++) { - starts[i+1]= starts[i]+RecvFromProcs[i]; + starts[i + 1] = starts[i] + RecvFromProcs[i]; if (RecvFromProcs[i]) { num_recvs++; - k+= RecvFromProcs[i]; + k += RecvFromProcs[i]; } if (tot_sendColsData[i]) @@ -764,29 +765,29 @@ hypre_SStructSharedDOF_ParcsrMatRowsComm( hypre_SStructGrid *grid, num_sends++; } } - OffProcRows= hypre_TAlloc(hypre_MaxwellOffProcRow *, k, HYPRE_MEMORY_HOST); - *num_offprocrows_ptr= k; + OffProcRows = hypre_TAlloc(hypre_MaxwellOffProcRow *, k, HYPRE_MEMORY_HOST); + *num_offprocrows_ptr = k; - requests= hypre_CTAlloc(hypre_MPI_Request, num_sends+num_recvs, HYPRE_MEMORY_HOST); - status = hypre_CTAlloc(hypre_MPI_Status, num_sends+num_recvs, HYPRE_MEMORY_HOST); + requests = hypre_CTAlloc(hypre_MPI_Request, num_sends + num_recvs, HYPRE_MEMORY_HOST); + status = hypre_CTAlloc(hypre_MPI_Status, num_sends + num_recvs, HYPRE_MEMORY_HOST); /* send row size data */ - j= 0; - rbuffer_RowsNcols= hypre_TAlloc(HYPRE_Int *, nprocs, HYPRE_MEMORY_HOST); + j = 0; + rbuffer_RowsNcols = hypre_TAlloc(HYPRE_Int *, nprocs, HYPRE_MEMORY_HOST); rbuffer_ColsData = hypre_TAlloc(HYPRE_Real *, nprocs, HYPRE_MEMORY_HOST); - for (proc= 0; proc< nprocs; proc++) + for (proc = 0; proc < nprocs; proc++) { if (RecvFromProcs[proc]) { - rbuffer_RowsNcols[proc]= hypre_TAlloc(HYPRE_Int, 2*RecvFromProcs[proc], HYPRE_MEMORY_HOST); - hypre_MPI_Irecv(rbuffer_RowsNcols[proc], 2*RecvFromProcs[proc], HYPRE_MPI_INT, + rbuffer_RowsNcols[proc] = hypre_TAlloc(HYPRE_Int, 2 * RecvFromProcs[proc], HYPRE_MEMORY_HOST); + hypre_MPI_Irecv(rbuffer_RowsNcols[proc], 2 * RecvFromProcs[proc], HYPRE_MPI_INT, proc, 0, grid_comm, &requests[j++]); } /* if (RecvFromProcs[proc]) */ } /* for (proc= 0; proc< nprocs; proc++) */ - - for (proc= 0; proc< nprocs; proc++) + + for (proc = 0; proc < nprocs; proc++) { if (tot_nsendRowsNcols[proc]) { @@ -798,24 +799,25 @@ hypre_SStructSharedDOF_ParcsrMatRowsComm( hypre_SStructGrid *grid, hypre_MPI_Waitall(j, requests, status); /* unpack data */ - for (proc= 0; proc< nprocs; proc++) + for (proc = 0; proc < nprocs; proc++) { - send_RowsNcols_alloc[proc]= 0; + send_RowsNcols_alloc[proc] = 0; if (RecvFromProcs[proc]) { - m= 0; ; - for (i= 0; i< RecvFromProcs[proc]; i++) + m = 0; ; + for (i = 0; i < RecvFromProcs[proc]; i++) { /* rbuffer_RowsNcols[m] has the row & rbuffer_RowsNcols[m+1] the col size */ - OffProcRows[starts[proc]+i]= hypre_MaxwellOffProcRowCreate(rbuffer_RowsNcols[proc][m+1]); - (OffProcRows[starts[proc]+i] -> row) = rbuffer_RowsNcols[proc][m]; - (OffProcRows[starts[proc]+i] -> ncols)= rbuffer_RowsNcols[proc][m+1]; + OffProcRows[starts[proc] + i] = hypre_MaxwellOffProcRowCreate(rbuffer_RowsNcols[proc][m + 1]); + (OffProcRows[starts[proc] + i] -> row) = rbuffer_RowsNcols[proc][m]; + (OffProcRows[starts[proc] + i] -> ncols) = rbuffer_RowsNcols[proc][m + 1]; - send_RowsNcols_alloc[proc]+= rbuffer_RowsNcols[proc][m+1]; - m+= 2; + send_RowsNcols_alloc[proc] += rbuffer_RowsNcols[proc][m + 1]; + m += 2; } - rbuffer_ColsData[proc]= hypre_TAlloc(HYPRE_Real, 2*send_RowsNcols_alloc[proc], HYPRE_MEMORY_HOST); + rbuffer_ColsData[proc] = hypre_TAlloc(HYPRE_Real, 2 * send_RowsNcols_alloc[proc], + HYPRE_MEMORY_HOST); hypre_TFree(rbuffer_RowsNcols[proc], HYPRE_MEMORY_HOST); } } @@ -824,21 +826,21 @@ hypre_SStructSharedDOF_ParcsrMatRowsComm( hypre_SStructGrid *grid, hypre_TFree(requests, HYPRE_MEMORY_HOST); hypre_TFree(status, HYPRE_MEMORY_HOST); - requests= hypre_CTAlloc(hypre_MPI_Request, num_sends+num_recvs, HYPRE_MEMORY_HOST); - status = hypre_CTAlloc(hypre_MPI_Status, num_sends+num_recvs, HYPRE_MEMORY_HOST); + requests = hypre_CTAlloc(hypre_MPI_Request, num_sends + num_recvs, HYPRE_MEMORY_HOST); + status = hypre_CTAlloc(hypre_MPI_Status, num_sends + num_recvs, HYPRE_MEMORY_HOST); /* send row data */ - j= 0; - for (proc= 0; proc< nprocs; proc++) + j = 0; + for (proc = 0; proc < nprocs; proc++) { if (RecvFromProcs[proc]) { - hypre_MPI_Irecv(rbuffer_ColsData[proc], 2*send_RowsNcols_alloc[proc], HYPRE_MPI_REAL, + hypre_MPI_Irecv(rbuffer_ColsData[proc], 2 * send_RowsNcols_alloc[proc], HYPRE_MPI_REAL, proc, 1, grid_comm, &requests[j++]); } /* if (RecvFromProcs[proc]) */ } /* for (proc= 0; proc< nprocs; proc++) */ - - for (proc= 0; proc< nprocs; proc++) + + for (proc = 0; proc < nprocs; proc++) { if (tot_sendColsData[proc]) { @@ -846,24 +848,24 @@ hypre_SStructSharedDOF_ParcsrMatRowsComm( hypre_SStructGrid *grid, 1, grid_comm, &requests[j++]); } } - + hypre_MPI_Waitall(j, requests, status); /* unpack data */ - for (proc= 0; proc< nprocs; proc++) + for (proc = 0; proc < nprocs; proc++) { if (RecvFromProcs[proc]) { - k= 0; - for (i= 0; i< RecvFromProcs[proc]; i++) + k = 0; + for (i = 0; i < RecvFromProcs[proc]; i++) { - col_inds= (OffProcRows[starts[proc]+i] -> cols); - values = (OffProcRows[starts[proc]+i] -> data); - m = (OffProcRows[starts[proc]+i] -> ncols); + col_inds = (OffProcRows[starts[proc] + i] -> cols); + values = (OffProcRows[starts[proc] + i] -> data); + m = (OffProcRows[starts[proc] + i] -> ncols); - for (t= 0; t< m; t++) + for (t = 0; t < m; t++) { - col_inds[t]= (HYPRE_Int) rbuffer_ColsData[proc][k++]; + col_inds[t] = (HYPRE_Int) rbuffer_ColsData[proc][k++]; values[t] = rbuffer_ColsData[proc][k++]; } } @@ -875,7 +877,7 @@ hypre_SStructSharedDOF_ParcsrMatRowsComm( hypre_SStructGrid *grid, hypre_TFree(requests, HYPRE_MEMORY_HOST); hypre_TFree(status, HYPRE_MEMORY_HOST); - for (proc= 0; proc< nprocs; proc++) + for (proc = 0; proc < nprocs; proc++) { hypre_TFree(send_RowsNcols[proc], HYPRE_MEMORY_HOST); hypre_TFree(vals[proc], HYPRE_MEMORY_HOST); @@ -890,7 +892,7 @@ hypre_SStructSharedDOF_ParcsrMatRowsComm( hypre_SStructGrid *grid, hypre_TFree(RecvFromProcs, HYPRE_MEMORY_HOST); hypre_TFree(starts, HYPRE_MEMORY_HOST); - *OffProcRows_ptr= OffProcRows; - + *OffProcRows_ptr = OffProcRows; + return ierr; } diff --git a/external/hypre/src/sstruct_ls/sstruct_sharedDOFComm.h b/external/hypre/src/sstruct_ls/sstruct_sharedDOFComm.h index 9f28526d..38631070 100644 --- a/external/hypre/src/sstruct_ls/sstruct_sharedDOFComm.h +++ b/external/hypre/src/sstruct_ls/sstruct_sharedDOFComm.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -8,10 +8,10 @@ typedef struct { HYPRE_BigInt row; - + HYPRE_Int ncols; HYPRE_BigInt *cols; HYPRE_Real *data; - + } hypre_MaxwellOffProcRow; diff --git a/external/hypre/src/sstruct_ls/sys_pfmg.c b/external/hypre/src/sstruct_ls/sys_pfmg.c index 8f3070db..262ae493 100644 --- a/external/hypre/src/sstruct_ls/sys_pfmg.c +++ b/external/hypre/src/sstruct_ls/sys_pfmg.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -32,7 +32,7 @@ hypre_SysPFMGCreate( MPI_Comm comm ) (sys_pfmg_data -> dxyz)[2] = 0.0; (sys_pfmg_data -> relax_type) = 1; /* weighted Jacobi */ (sys_pfmg_data -> jacobi_weight) = 0.0; - (sys_pfmg_data -> usr_jacobi_weight)= 0; + (sys_pfmg_data -> usr_jacobi_weight) = 0; (sys_pfmg_data -> num_pre_relax) = 1; (sys_pfmg_data -> num_post_relax) = 1; (sys_pfmg_data -> skip_relax) = 1; @@ -79,7 +79,7 @@ hypre_SysPFMGDestroy( void *sys_pfmg_vdata ) hypre_TFree(sys_pfmg_data -> matvec_data_l, HYPRE_MEMORY_HOST); hypre_TFree(sys_pfmg_data -> restrict_data_l, HYPRE_MEMORY_HOST); hypre_TFree(sys_pfmg_data -> interp_data_l, HYPRE_MEMORY_HOST); - + hypre_SStructPVectorDestroy(sys_pfmg_data -> tx_l[0]); /*hypre_SStructPGridDestroy(sys_pfmg_data -> grid_l[0]);*/ hypre_SStructPMatrixDestroy(sys_pfmg_data -> A_l[0]); @@ -87,15 +87,15 @@ hypre_SysPFMGDestroy( void *sys_pfmg_vdata ) hypre_SStructPVectorDestroy(sys_pfmg_data -> x_l[0]); for (l = 0; l < ((sys_pfmg_data -> num_levels) - 1); l++) { - hypre_SStructPGridDestroy(sys_pfmg_data -> grid_l[l+1]); - hypre_SStructPGridDestroy(sys_pfmg_data -> P_grid_l[l+1]); - hypre_SStructPMatrixDestroy(sys_pfmg_data -> A_l[l+1]); + hypre_SStructPGridDestroy(sys_pfmg_data -> grid_l[l + 1]); + hypre_SStructPGridDestroy(sys_pfmg_data -> P_grid_l[l + 1]); + hypre_SStructPMatrixDestroy(sys_pfmg_data -> A_l[l + 1]); hypre_SStructPMatrixDestroy(sys_pfmg_data -> P_l[l]); - hypre_SStructPVectorDestroy(sys_pfmg_data -> b_l[l+1]); - hypre_SStructPVectorDestroy(sys_pfmg_data -> x_l[l+1]); - hypre_SStructPVectorDestroy(sys_pfmg_data -> tx_l[l+1]); + hypre_SStructPVectorDestroy(sys_pfmg_data -> b_l[l + 1]); + hypre_SStructPVectorDestroy(sys_pfmg_data -> x_l[l + 1]); + hypre_SStructPVectorDestroy(sys_pfmg_data -> tx_l[l + 1]); } - hypre_TFree(sys_pfmg_data -> data, HYPRE_MEMORY_HOST); + hypre_TFree(sys_pfmg_data -> data, HYPRE_MEMORY_HOST); hypre_TFree(sys_pfmg_data -> cdir_l, HYPRE_MEMORY_HOST); hypre_TFree(sys_pfmg_data -> active_l, HYPRE_MEMORY_HOST); hypre_TFree(sys_pfmg_data -> grid_l, HYPRE_MEMORY_HOST); @@ -107,7 +107,7 @@ hypre_SysPFMGDestroy( void *sys_pfmg_vdata ) hypre_TFree(sys_pfmg_data -> x_l, HYPRE_MEMORY_HOST); hypre_TFree(sys_pfmg_data -> tx_l, HYPRE_MEMORY_HOST); } - + hypre_FinalizeTiming(sys_pfmg_data -> time_index); hypre_TFree(sys_pfmg_data, HYPRE_MEMORY_HOST); } @@ -123,9 +123,9 @@ hypre_SysPFMGSetTol( void *sys_pfmg_vdata, HYPRE_Real tol ) { hypre_SysPFMGData *sys_pfmg_data = (hypre_SysPFMGData *)sys_pfmg_vdata; - + (sys_pfmg_data -> tol) = tol; - + return hypre_error_flag; } @@ -137,9 +137,9 @@ hypre_SysPFMGSetMaxIter( void *sys_pfmg_vdata, HYPRE_Int max_iter ) { hypre_SysPFMGData *sys_pfmg_data = (hypre_SysPFMGData *)sys_pfmg_vdata; - + (sys_pfmg_data -> max_iter) = max_iter; - + return hypre_error_flag; } @@ -151,23 +151,23 @@ hypre_SysPFMGSetRelChange( void *sys_pfmg_vdata, HYPRE_Int rel_change ) { hypre_SysPFMGData *sys_pfmg_data = (hypre_SysPFMGData *)sys_pfmg_vdata; - + (sys_pfmg_data -> rel_change) = rel_change; - + return hypre_error_flag; } /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ - + HYPRE_Int hypre_SysPFMGSetZeroGuess( void *sys_pfmg_vdata, HYPRE_Int zero_guess ) { hypre_SysPFMGData *sys_pfmg_data = (hypre_SysPFMGData *)sys_pfmg_vdata; - + (sys_pfmg_data -> zero_guess) = zero_guess; - + return hypre_error_flag; } @@ -179,9 +179,9 @@ hypre_SysPFMGSetRelaxType( void *sys_pfmg_vdata, HYPRE_Int relax_type ) { hypre_SysPFMGData *sys_pfmg_data = (hypre_SysPFMGData *)sys_pfmg_vdata; - + (sys_pfmg_data -> relax_type) = relax_type; - + return hypre_error_flag; } @@ -192,9 +192,9 @@ hypre_SysPFMGSetJacobiWeight( void *sys_pfmg_vdata, HYPRE_Real weight ) { hypre_SysPFMGData *sys_pfmg_data = (hypre_SysPFMGData *)sys_pfmg_vdata; - + (sys_pfmg_data -> jacobi_weight) = weight; - (sys_pfmg_data -> usr_jacobi_weight)= 1; + (sys_pfmg_data -> usr_jacobi_weight) = 1; return hypre_error_flag; } @@ -207,9 +207,9 @@ hypre_SysPFMGSetNumPreRelax( void *sys_pfmg_vdata, HYPRE_Int num_pre_relax ) { hypre_SysPFMGData *sys_pfmg_data = (hypre_SysPFMGData *)sys_pfmg_vdata; - + (sys_pfmg_data -> num_pre_relax) = num_pre_relax; - + return hypre_error_flag; } @@ -221,9 +221,9 @@ hypre_SysPFMGSetNumPostRelax( void *sys_pfmg_vdata, HYPRE_Int num_post_relax ) { hypre_SysPFMGData *sys_pfmg_data = (hypre_SysPFMGData *)sys_pfmg_vdata; - + (sys_pfmg_data -> num_post_relax) = num_post_relax; - + return hypre_error_flag; } @@ -235,9 +235,9 @@ hypre_SysPFMGSetSkipRelax( void *sys_pfmg_vdata, HYPRE_Int skip_relax ) { hypre_SysPFMGData *sys_pfmg_data = (hypre_SysPFMGData *)sys_pfmg_vdata; - + (sys_pfmg_data -> skip_relax) = skip_relax; - + return hypre_error_flag; } @@ -253,7 +253,7 @@ hypre_SysPFMGSetDxyz( void *sys_pfmg_vdata, (sys_pfmg_data -> dxyz[0]) = dxyz[0]; (sys_pfmg_data -> dxyz[1]) = dxyz[1]; (sys_pfmg_data -> dxyz[2]) = dxyz[2]; - + return hypre_error_flag; } @@ -265,9 +265,9 @@ hypre_SysPFMGSetLogging( void *sys_pfmg_vdata, HYPRE_Int logging) { hypre_SysPFMGData *sys_pfmg_data = (hypre_SysPFMGData *)sys_pfmg_vdata; - + (sys_pfmg_data -> logging) = logging; - + return hypre_error_flag; } @@ -279,9 +279,9 @@ hypre_SysPFMGSetPrintLevel( void *sys_pfmg_vdata, HYPRE_Int print_level) { hypre_SysPFMGData *sys_pfmg_data = (hypre_SysPFMGData *)sys_pfmg_vdata; - + (sys_pfmg_data -> print_level) = print_level; - + return hypre_error_flag; } @@ -322,13 +322,13 @@ hypre_SysPFMGPrintLogging( void *sys_pfmg_vdata, { for (i = 0; i < num_iterations; i++) { - hypre_printf("Residual norm[%d] = %e ",i,norms[i]); - hypre_printf("Relative residual norm[%d] = %e\n",i,rel_norms[i]); + hypre_printf("Residual norm[%d] = %e ", i, norms[i]); + hypre_printf("Relative residual norm[%d] = %e\n", i, rel_norms[i]); } } } } - + return hypre_error_flag; } @@ -345,7 +345,7 @@ hypre_SysPFMGGetFinalRelativeResidualNorm( void *sys_pfmg_vdata, HYPRE_Int num_iterations = (sys_pfmg_data -> num_iterations); HYPRE_Int logging = (sys_pfmg_data -> logging); HYPRE_Real *rel_norms = (sys_pfmg_data -> rel_norms); - + if (logging > 0) { if (max_iter == 0) @@ -354,14 +354,14 @@ hypre_SysPFMGGetFinalRelativeResidualNorm( void *sys_pfmg_vdata, } else if (num_iterations == max_iter) { - *relative_residual_norm = rel_norms[num_iterations-1]; + *relative_residual_norm = rel_norms[num_iterations - 1]; } else { *relative_residual_norm = rel_norms[num_iterations]; } } - + return hypre_error_flag; } diff --git a/external/hypre/src/sstruct_ls/sys_pfmg.h b/external/hypre/src/sstruct_ls/sys_pfmg.h index 06f7280b..e19f6569 100644 --- a/external/hypre/src/sstruct_ls/sys_pfmg.h +++ b/external/hypre/src/sstruct_ls/sys_pfmg.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -21,30 +21,30 @@ typedef struct { MPI_Comm comm; - + HYPRE_Real tol; HYPRE_Int max_iter; HYPRE_Int rel_change; HYPRE_Int zero_guess; HYPRE_Int max_levels; /* max_level <= 0 means no limit */ - + HYPRE_Int relax_type; /* type of relaxation to use */ HYPRE_Real jacobi_weight; /* weighted jacobi weight */ HYPRE_Int usr_jacobi_weight; /* indicator flag for user weight */ - + HYPRE_Int num_pre_relax; /* number of pre relaxation sweeps */ HYPRE_Int num_post_relax; /* number of post relaxation sweeps */ HYPRE_Int skip_relax; /* flag to allow skipping relaxation */ HYPRE_Real dxyz[3]; /* parameters used to determine cdir */ HYPRE_Int num_levels; - + HYPRE_Int *cdir_l; /* coarsening directions */ HYPRE_Int *active_l; /* flags to relax on level l*/ hypre_SStructPGrid **grid_l; hypre_SStructPGrid **P_grid_l; - + HYPRE_Real *data; hypre_SStructPMatrix **A_l; hypre_SStructPMatrix **P_l; diff --git a/external/hypre/src/sstruct_ls/sys_pfmg_relax.c b/external/hypre/src/sstruct_ls/sys_pfmg_relax.c index aece5232..c6cea897 100644 --- a/external/hypre/src/sstruct_ls/sys_pfmg_relax.c +++ b/external/hypre/src/sstruct_ls/sys_pfmg_relax.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -39,7 +39,7 @@ hypre_SysPFMGRelaxCreate( MPI_Comm comm ) HYPRE_Int hypre_SysPFMGRelaxDestroy( void *sys_pfmg_relax_vdata ) { - hypre_SysPFMGRelaxData *sys_pfmg_relax_data = (hypre_SysPFMGRelaxData *)sys_pfmg_relax_vdata; + hypre_SysPFMGRelaxData *sys_pfmg_relax_data = (hypre_SysPFMGRelaxData *)sys_pfmg_relax_vdata; if (sys_pfmg_relax_data) { @@ -102,7 +102,7 @@ hypre_SysPFMGRelaxSetType( void *sys_pfmg_relax_vdata, (sys_pfmg_relax_data -> relax_type) = relax_type; - switch(relax_type) + switch (relax_type) { case 0: /* Jacobi */ { @@ -155,7 +155,7 @@ hypre_SysPFMGRelaxSetJacobiWeight(void *sys_pfmg_relax_vdata, HYPRE_Real weight) { hypre_SysPFMGRelaxData *sys_pfmg_relax_data = (hypre_SysPFMGRelaxData *)sys_pfmg_relax_vdata; - + (sys_pfmg_relax_data -> jacobi_weight) = weight; return hypre_error_flag; @@ -171,7 +171,7 @@ hypre_SysPFMGRelaxSetPreRelax( void *sys_pfmg_relax_vdata ) void *relax_data = (sys_pfmg_relax_data -> relax_data); HYPRE_Int relax_type = (sys_pfmg_relax_data -> relax_type); - switch(relax_type) + switch (relax_type) { case 1: /* Weighted Jacobi */ case 0: /* Jacobi */ @@ -198,7 +198,7 @@ hypre_SysPFMGRelaxSetPostRelax( void *sys_pfmg_relax_vdata ) void *relax_data = (sys_pfmg_relax_data -> relax_data); HYPRE_Int relax_type = (sys_pfmg_relax_data -> relax_type); - switch(relax_type) + switch (relax_type) { case 1: /* Weighted Jacobi */ case 0: /* Jacobi */ diff --git a/external/hypre/src/sstruct_ls/sys_pfmg_setup.c b/external/hypre/src/sstruct_ls/sys_pfmg_setup.c index bd55384e..b005475d 100644 --- a/external/hypre/src/sstruct_ls/sys_pfmg_setup.c +++ b/external/hypre/src/sstruct_ls/sys_pfmg_setup.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -40,22 +40,22 @@ hypre_SysPFMGSetup( void *sys_pfmg_vdata, hypre_SysPFMGData *sys_pfmg_data = (hypre_SysPFMGData *)sys_pfmg_vdata; MPI_Comm comm = (sys_pfmg_data -> comm); - + hypre_SStructPMatrix *A; hypre_SStructPVector *b; hypre_SStructPVector *x; HYPRE_Int relax_type = (sys_pfmg_data -> relax_type); - HYPRE_Int usr_jacobi_weight= (sys_pfmg_data -> usr_jacobi_weight); + HYPRE_Int usr_jacobi_weight = (sys_pfmg_data -> usr_jacobi_weight); HYPRE_Real jacobi_weight = (sys_pfmg_data -> jacobi_weight); HYPRE_Int skip_relax = (sys_pfmg_data -> skip_relax); HYPRE_Real *dxyz = (sys_pfmg_data -> dxyz); - + HYPRE_Int max_iter; HYPRE_Int max_levels; - + HYPRE_Int num_levels; - + hypre_Index cindex; hypre_Index findex; hypre_Index stride; @@ -66,7 +66,7 @@ hypre_SysPFMGSetup( void *sys_pfmg_vdata, HYPRE_Int *active_l; hypre_SStructPGrid **grid_l; hypre_SStructPGrid **P_grid_l; - + hypre_SStructPMatrix **A_l; hypre_SStructPMatrix **P_l; hypre_SStructPMatrix **RT_l; @@ -101,7 +101,7 @@ hypre_SysPFMGSetup( void *sys_pfmg_vdata, HYPRE_Int i; HYPRE_Real** sys_dxyz; - + HYPRE_Int nvars; #if DEBUG @@ -125,7 +125,7 @@ hypre_SysPFMGSetup( void *sys_pfmg_vdata, { sys_dxyz[i] = hypre_TAlloc(HYPRE_Real, 3, HYPRE_MEMORY_HOST); } - + /*----------------------------------------------------- * Set up coarse grids *-----------------------------------------------------*/ @@ -147,7 +147,7 @@ hypre_SysPFMGSetup( void *sys_pfmg_vdata, (sys_pfmg_data -> max_levels) = max_levels; /* compute dxyz */ - dxyz_flag= 0; + dxyz_flag = 0; if ((dxyz[0] == 0) || (dxyz[1] == 0) || (dxyz[2] == 0)) { mean = hypre_CTAlloc(HYPRE_Real, 3, HYPRE_MEMORY_HOST); @@ -156,7 +156,7 @@ hypre_SysPFMGSetup( void *sys_pfmg_vdata, dxyz_flag = 0; for (i = 0; i < nvars; i++) { - hypre_PFMGComputeDxyz(hypre_SStructPMatrixSMatrix(A,i,i), sys_dxyz[i], + hypre_PFMGComputeDxyz(hypre_SStructPMatrixSMatrix(A, i, i), sys_dxyz[i], mean, deviation); /* signal flag if any of the flag has a large (square) coeff. of @@ -165,9 +165,9 @@ hypre_SysPFMGSetup( void *sys_pfmg_vdata, { for (d = 0; d < dim; d++) { - deviation[d] -= mean[d]*mean[d]; + deviation[d] -= mean[d] * mean[d]; /* square of coeff. of variation */ - if (deviation[d]/(mean[d]*mean[d]) > .1) + if (deviation[d] / (mean[d]*mean[d]) > .1) { dxyz_flag = 1; break; @@ -178,9 +178,9 @@ hypre_SysPFMGSetup( void *sys_pfmg_vdata, for (d = 0; d < 3; d++) { dxyz[d] += sys_dxyz[i][d]; - } + } } - hypre_TFree(mean , HYPRE_MEMORY_HOST); + hypre_TFree(mean, HYPRE_MEMORY_HOST); hypre_TFree(deviation, HYPRE_MEMORY_HOST); } @@ -206,9 +206,9 @@ hypre_SysPFMGSetup( void *sys_pfmg_vdata, min_dxyz = dxyz[d]; cdir = d; } - alpha += 1.0/(dxyz[d]*dxyz[d]); + alpha += 1.0 / (dxyz[d] * dxyz[d]); } - relax_weights[l] = 2.0/3.0; + relax_weights[l] = 2.0 / 3.0; /* If it's possible to coarsen, change relax_weights */ beta = 0.0; @@ -216,7 +216,7 @@ hypre_SysPFMGSetup( void *sys_pfmg_vdata, { if (dxyz_flag) { - relax_weights[l] = 2.0/3.0; + relax_weights[l] = 2.0 / 3.0; } else @@ -225,7 +225,7 @@ hypre_SysPFMGSetup( void *sys_pfmg_vdata, { if (d != cdir) { - beta += 1.0/(dxyz[d]*dxyz[d]); + beta += 1.0 / (dxyz[d] * dxyz[d]); } } if (beta == alpha) @@ -234,17 +234,17 @@ hypre_SysPFMGSetup( void *sys_pfmg_vdata, } else { - alpha = beta/alpha; + alpha = beta / alpha; } /* determine level Jacobi weights */ if (dim > 1) { - relax_weights[l] = 2.0/(3.0 - alpha); + relax_weights[l] = 2.0 / (3.0 - alpha); } else { - relax_weights[l] = 2.0/3.0; /* always 2/3 for 1-d */ + relax_weights[l] = 2.0 / 3.0; /* always 2/3 for 1-d */ } } } @@ -307,10 +307,10 @@ hypre_SysPFMGSetup( void *sys_pfmg_vdata, hypre_BoxIMax(cbox)); /* build the interpolation grid */ - hypre_SysStructCoarsen(grid_l[l], findex, stride, 0, &P_grid_l[l+1]); + hypre_SysStructCoarsen(grid_l[l], findex, stride, 0, &P_grid_l[l + 1]); /* build the coarse grid */ - hypre_SysStructCoarsen(grid_l[l], cindex, stride, 1, &grid_l[l+1]); + hypre_SysStructCoarsen(grid_l[l], cindex, stride, 1, &grid_l[l + 1]); } num_levels = l + 1; @@ -325,12 +325,12 @@ hypre_SysPFMGSetup( void *sys_pfmg_vdata, full_periodic = 1; for (d = 0; d < dim; d++) { - full_periodic *= hypre_IndexD(hypre_SStructPGridPeriodic(grid),d); + full_periodic *= hypre_IndexD(hypre_SStructPGridPeriodic(grid), d); } - if( full_periodic != 0) + if ( full_periodic != 0) { - hypre_SStructPGridDestroy(grid_l[num_levels-1]); - hypre_SStructPGridDestroy(P_grid_l[num_levels-1]); + hypre_SStructPGridDestroy(grid_l[num_levels - 1]); + hypre_SStructPGridDestroy(P_grid_l[num_levels - 1]); num_levels -= 1; } @@ -341,7 +341,7 @@ hypre_SysPFMGSetup( void *sys_pfmg_vdata, hypre_TFree(sys_dxyz[i], HYPRE_MEMORY_HOST); } hypre_TFree(sys_dxyz, HYPRE_MEMORY_HOST); - + /* set all levels active if skip_relax = 0 */ if (!skip_relax) @@ -362,12 +362,12 @@ hypre_SysPFMGSetup( void *sys_pfmg_vdata, * Set up matrix and vector structures *-----------------------------------------------------*/ - A_l = hypre_TAlloc(hypre_SStructPMatrix *, num_levels , HYPRE_MEMORY_HOST); + A_l = hypre_TAlloc(hypre_SStructPMatrix *, num_levels, HYPRE_MEMORY_HOST); P_l = hypre_TAlloc(hypre_SStructPMatrix *, num_levels - 1, HYPRE_MEMORY_HOST); RT_l = hypre_TAlloc(hypre_SStructPMatrix *, num_levels - 1, HYPRE_MEMORY_HOST); - b_l = hypre_TAlloc(hypre_SStructPVector *, num_levels , HYPRE_MEMORY_HOST); - x_l = hypre_TAlloc(hypre_SStructPVector *, num_levels , HYPRE_MEMORY_HOST); - tx_l = hypre_TAlloc(hypre_SStructPVector *, num_levels , HYPRE_MEMORY_HOST); + b_l = hypre_TAlloc(hypre_SStructPVector *, num_levels, HYPRE_MEMORY_HOST); + x_l = hypre_TAlloc(hypre_SStructPVector *, num_levels, HYPRE_MEMORY_HOST); + tx_l = hypre_TAlloc(hypre_SStructPVector *, num_levels, HYPRE_MEMORY_HOST); r_l = tx_l; e_l = tx_l; @@ -382,31 +382,31 @@ hypre_SysPFMGSetup( void *sys_pfmg_vdata, { cdir = cdir_l[l]; - P_l[l] = hypre_SysPFMGCreateInterpOp(A_l[l], P_grid_l[l+1], cdir); + P_l[l] = hypre_SysPFMGCreateInterpOp(A_l[l], P_grid_l[l + 1], cdir); hypre_SStructPMatrixInitialize(P_l[l]); RT_l[l] = P_l[l]; - A_l[l+1] = hypre_SysPFMGCreateRAPOp(RT_l[l], A_l[l], P_l[l], - grid_l[l+1], cdir); - hypre_SStructPMatrixInitialize(A_l[l+1]); + A_l[l + 1] = hypre_SysPFMGCreateRAPOp(RT_l[l], A_l[l], P_l[l], + grid_l[l + 1], cdir); + hypre_SStructPMatrixInitialize(A_l[l + 1]); - hypre_SStructPVectorCreate(comm, grid_l[l+1], &b_l[l+1]); - hypre_SStructPVectorInitialize(b_l[l+1]); + hypre_SStructPVectorCreate(comm, grid_l[l + 1], &b_l[l + 1]); + hypre_SStructPVectorInitialize(b_l[l + 1]); - hypre_SStructPVectorCreate(comm, grid_l[l+1], &x_l[l+1]); - hypre_SStructPVectorInitialize(x_l[l+1]); + hypre_SStructPVectorCreate(comm, grid_l[l + 1], &x_l[l + 1]); + hypre_SStructPVectorInitialize(x_l[l + 1]); - hypre_SStructPVectorCreate(comm, grid_l[l+1], &tx_l[l+1]); - hypre_SStructPVectorInitialize(tx_l[l+1]); + hypre_SStructPVectorCreate(comm, grid_l[l + 1], &tx_l[l + 1]); + hypre_SStructPVectorInitialize(tx_l[l + 1]); } hypre_SStructPVectorAssemble(tx_l[0]); for (l = 0; l < (num_levels - 1); l++) { - hypre_SStructPVectorAssemble(b_l[l+1]); - hypre_SStructPVectorAssemble(x_l[l+1]); - hypre_SStructPVectorAssemble(tx_l[l+1]); + hypre_SStructPVectorAssemble(b_l[l + 1]); + hypre_SStructPVectorAssemble(x_l[l + 1]); + hypre_SStructPVectorAssemble(tx_l[l + 1]); } (sys_pfmg_data -> A_l) = A_l; @@ -440,16 +440,16 @@ hypre_SysPFMGSetup( void *sys_pfmg_vdata, /* set up the coarse grid operator */ hypre_SysPFMGSetupRAPOp(RT_l[l], A_l[l], P_l[l], - cdir, cindex, stride, A_l[l+1]); + cdir, cindex, stride, A_l[l + 1]); /* set up the interpolation routine */ hypre_SysSemiInterpCreate(&interp_data_l[l]); - hypre_SysSemiInterpSetup(interp_data_l[l], P_l[l], 0, x_l[l+1], e_l[l], + hypre_SysSemiInterpSetup(interp_data_l[l], P_l[l], 0, x_l[l + 1], e_l[l], cindex, findex, stride); /* set up the restriction routine */ hypre_SysSemiRestrictCreate(&restrict_data_l[l]); - hypre_SysSemiRestrictSetup(restrict_data_l[l], RT_l[l], 1, r_l[l], b_l[l+1], + hypre_SysSemiRestrictSetup(restrict_data_l[l], RT_l[l], 1, r_l[l], b_l[l + 1], cindex, findex, stride); } @@ -493,7 +493,7 @@ hypre_SysPFMGSetup( void *sys_pfmg_vdata, hypre_SysPFMGRelaxSetType(relax_data_l[l], 0); /* do no more work on the coarsest grid than the cost of a V-cycle * (estimating roughly 4 communications per V-cycle level) */ - maxwork = 4*num_levels; + maxwork = 4 * num_levels; /* do sweeps proportional to the coarsest grid size */ maxiter = hypre_min(maxwork, cmaxsize); #if 0 @@ -561,7 +561,7 @@ hypre_SysPFMGSetup( void *sys_pfmg_vdata, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_SysStructCoarsen( hypre_SStructPGrid *fgrid, +hypre_SysStructCoarsen( hypre_SStructPGrid *fgrid, hypre_Index index, hypre_Index stride, HYPRE_Int prune, @@ -612,7 +612,7 @@ hypre_SysStructCoarsen( hypre_SStructPGrid *fgrid, *-----------------------------------------*/ sfgrid = hypre_SStructPGridCellSGrid(fgrid); - hypre_StructCoarsen(sfgrid, index, stride, prune, &scgrid); + hypre_StructCoarsen(sfgrid, index, stride, prune, &scgrid); hypre_CopyIndex(hypre_StructGridPeriodic(scgrid), hypre_SStructPGridPeriodic(cgrid)); @@ -624,7 +624,7 @@ hypre_SysStructCoarsen( hypre_SStructPGrid *fgrid, hypre_SStructPGridLocalSize(cgrid) = 0; hypre_SStructPGridGlobalSize(cgrid) = 0; - hypre_SStructPGridGhlocalSize(cgrid)= 0; + hypre_SStructPGridGhlocalSize(cgrid) = 0; hypre_SStructPGridAssemble(cgrid); diff --git a/external/hypre/src/sstruct_ls/sys_pfmg_setup_interp.c b/external/hypre/src/sstruct_ls/sys_pfmg_setup_interp.c index d129f696..f5735a12 100644 --- a/external/hypre/src/sstruct_ls/sys_pfmg_setup_interp.c +++ b/external/hypre/src/sstruct_ls/sys_pfmg_setup_interp.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -19,13 +19,13 @@ hypre_SysPFMGCreateInterpOp( hypre_SStructPMatrix *A, hypre_Index *stencil_shape; HYPRE_Int stencil_size; - + HYPRE_Int ndim; HYPRE_Int nvars; hypre_SStructStencil **P_stencils; - HYPRE_Int i,s; + HYPRE_Int i, s; /* set up stencil_shape */ stencil_size = 2; diff --git a/external/hypre/src/sstruct_ls/sys_pfmg_setup_rap.c b/external/hypre/src/sstruct_ls/sys_pfmg_setup_rap.c index 7cc05833..cd6f5027 100644 --- a/external/hypre/src/sstruct_ls/sys_pfmg_setup_rap.c +++ b/external/hypre/src/sstruct_ls/sys_pfmg_setup_rap.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -9,7 +9,7 @@ /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ - + hypre_SStructPMatrix * hypre_SysPFMGCreateRAPOp( hypre_SStructPMatrix *R, hypre_SStructPMatrix *A, @@ -40,7 +40,7 @@ hypre_SysPFMGCreateRAPOp( hypre_SStructPMatrix *R, hypre_StructGrid *cgrid; - HYPRE_Int vi,vj; + HYPRE_Int vi, vj; HYPRE_Int sten_cntr; @@ -72,7 +72,7 @@ hypre_SysPFMGCreateRAPOp( hypre_SStructPMatrix *R, P_s = hypre_SStructPMatrixSMatrix(P, vj, vj); sstencil_sizes[vj] = 0; if (A_s != NULL) - { + { RAP_s = hypre_SemiCreateRAPOp(R_s, A_s, P_s, cgrid, cdir, P_stored_as_transpose); @@ -82,11 +82,11 @@ hypre_SysPFMGCreateRAPOp( hypre_SStructPMatrix *R, shape = hypre_StructStencilShape(sstencil); sstencil_sizes[vj] = hypre_StructStencilSize(sstencil); stencil_size += sstencil_sizes[vj]; - RAP_shapes[vj] = hypre_CTAlloc(hypre_Index, + RAP_shapes[vj] = hypre_CTAlloc(hypre_Index, sstencil_sizes[vj], HYPRE_MEMORY_HOST); for (s = 0; s < sstencil_sizes[vj]; s++) { - hypre_CopyIndex(shape[s],RAP_shapes[vj][s]); + hypre_CopyIndex(shape[s], RAP_shapes[vj][s]); } hypre_StructMatrixDestroy(RAP_s); } @@ -110,7 +110,7 @@ hypre_SysPFMGCreateRAPOp( hypre_SStructPMatrix *R, } /* create RAP Pmatrix */ - hypre_SStructPMatrixCreate(hypre_SStructPMatrixComm(A), + hypre_SStructPMatrixCreate(hypre_SStructPMatrixComm(A), coarse_grid, RAP_stencils, &RAP); hypre_TFree(RAP_shapes, HYPRE_MEMORY_HOST); @@ -121,7 +121,7 @@ hypre_SysPFMGCreateRAPOp( hypre_SStructPMatrix *R, /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ - + HYPRE_Int hypre_SysPFMGSetupRAPOp( hypre_SStructPMatrix *R, hypre_SStructPMatrix *A, @@ -132,7 +132,7 @@ hypre_SysPFMGSetupRAPOp( hypre_SStructPMatrix *R, hypre_SStructPMatrix *Ac ) { HYPRE_Int nvars; - HYPRE_Int vi,vj; + HYPRE_Int vi, vj; hypre_StructMatrix *R_s; hypre_StructMatrix *A_s; diff --git a/external/hypre/src/sstruct_ls/sys_pfmg_solve.c b/external/hypre/src/sstruct_ls/sys_pfmg_solve.c index 054b59ca..533b9f62 100644 --- a/external/hypre/src/sstruct_ls/sys_pfmg_solve.c +++ b/external/hypre/src/sstruct_ls/sys_pfmg_solve.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -103,7 +103,7 @@ hypre_SysPFMGSolve( void *sys_pfmg_vdata, { /* eps = (tol^2) */ hypre_SStructPInnerProd(b_l[0], b_l[0], &b_dot_b); - eps = tol*tol; + eps = tol * tol; /* if rhs is zero, return a zero solution */ if (b_dot_b == 0.0) @@ -153,10 +153,10 @@ hypre_SysPFMGSolve( void *sys_pfmg_vdata, if (logging > 0) { - norms[i] = sqrt(r_dot_r); + norms[i] = hypre_sqrt(r_dot_r); if (b_dot_b > 0) { - rel_norms[i] = sqrt(r_dot_r/b_dot_b); + rel_norms[i] = hypre_sqrt(r_dot_r / b_dot_b); } else { @@ -165,9 +165,9 @@ hypre_SysPFMGSolve( void *sys_pfmg_vdata, } /* always do at least 1 V-cycle */ - if ((r_dot_r/b_dot_b < eps) && (i > 0)) + if ((r_dot_r / b_dot_b < eps) && (i > 0)) { - if ( ((rel_change) && (e_dot_e/x_dot_x) < eps) || (!rel_change) ) + if ( ((rel_change) && (e_dot_e / x_dot_x) < eps) || (!rel_change) ) { HYPRE_ANNOTATE_MGLEVEL_END(0); break; @@ -215,16 +215,16 @@ hypre_SysPFMGSolve( void *sys_pfmg_vdata, /* restrict residual */ hypre_SysSemiRestrict(restrict_data_l[l], - RT_l[l], r_l[l], b_l[l+1]); + RT_l[l], r_l[l], b_l[l + 1]); #if DEBUG hypre_sprintf(filename, "zout_xdown.%02d", l); hypre_SStructPVectorPrint(filename, x_l[l], 0); hypre_sprintf(filename, "zout_rdown.%02d", l); hypre_SStructPVectorPrint(filename, r_l[l], 0); - hypre_sprintf(filename, "zout_RT.%02d", l); - hypre_SStructPMatrixPrint(filename, RT_l[l], 0); - hypre_sprintf(filename, "zout_b.%02d", l+1); - hypre_SStructPVectorPrint(filename, b_l[l+1], 0); + hypre_sprintf(filename, "zout_RT.%02d", l); + hypre_SStructPMatrixPrint(filename, RT_l[l], 0); + hypre_sprintf(filename, "zout_b.%02d", l + 1); + hypre_SStructPVectorPrint(filename, b_l[l + 1], 0); #endif HYPRE_ANNOTATE_MGLEVEL_END(l); } @@ -248,7 +248,7 @@ hypre_SysPFMGSolve( void *sys_pfmg_vdata, for (l = (num_levels - 2); l >= 1; l--) { /* interpolate error and correct (x = x + Pe_c) */ - hypre_SysSemiInterp(interp_data_l[l], P_l[l], x_l[l+1], e_l[l]); + hypre_SysSemiInterp(interp_data_l[l], P_l[l], x_l[l + 1], e_l[l]); hypre_SStructPAxpy(1.0, e_l[l], x_l[l]); HYPRE_ANNOTATE_MGLEVEL_END(l + 1); #if DEBUG diff --git a/external/hypre/src/sstruct_ls/sys_semi_interp.c b/external/hypre/src/sstruct_ls/sys_semi_interp.c index 2cfb783c..3ff55bca 100644 --- a/external/hypre/src/sstruct_ls/sys_semi_interp.c +++ b/external/hypre/src/sstruct_ls/sys_semi_interp.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -44,7 +44,7 @@ hypre_SysSemiInterpSetup( void *sys_interp_vdata, hypre_Index findex, hypre_Index stride ) { - hypre_SysSemiInterpData *sys_interp_data = (hypre_SysSemiInterpData *)sys_interp_vdata; + hypre_SysSemiInterpData *sys_interp_data = (hypre_SysSemiInterpData *)sys_interp_vdata; void **sinterp_data; HYPRE_Int nvars; diff --git a/external/hypre/src/sstruct_ls/sys_semi_restrict.c b/external/hypre/src/sstruct_ls/sys_semi_restrict.c index 518dc516..43cc4b66 100644 --- a/external/hypre/src/sstruct_ls/sys_semi_restrict.c +++ b/external/hypre/src/sstruct_ls/sys_semi_restrict.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -20,7 +20,7 @@ typedef struct *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_SysSemiRestrictCreate( void **sys_restrict_vdata_ptr) +hypre_SysSemiRestrictCreate( void **sys_restrict_vdata_ptr) { hypre_SysSemiRestrictData *sys_restrict_data; @@ -64,7 +64,7 @@ hypre_SysSemiRestrictSetup( void *sys_restrict_vdata, r_s = hypre_SStructPVectorSVector(r, vi); srestrict_data[vi] = hypre_SemiRestrictCreate( ); hypre_SemiRestrictSetup( srestrict_data[vi], R_s, R_stored_as_transpose, - r_s, rc_s, cindex, findex, stride); + r_s, rc_s, cindex, findex, stride); } (sys_restrict_data -> nvars) = nvars; diff --git a/external/hypre/src/sstruct_mv/CMakeLists.txt b/external/hypre/src/sstruct_mv/CMakeLists.txt index 8aeda925..3b674ab9 100644 --- a/external/hypre/src/sstruct_mv/CMakeLists.txt +++ b/external/hypre/src/sstruct_mv/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -36,13 +36,13 @@ target_sources(${PROJECT_NAME} ${HDRS} ) -if (HYPRE_USING_CUDA) - set(CUDA_SRCS +if (HYPRE_USING_GPU) + set(GPU_SRCS sstruct_matrix.c sstruct_vector.c ) - convert_filenames_to_full_paths(CUDA_SRCS) - set(HYPRE_CUDA_SOURCES ${HYPRE_CUDA_SOURCES} ${CUDA_SRCS} PARENT_SCOPE) + convert_filenames_to_full_paths(GPU_SRCS) + set(HYPRE_GPU_SOURCES ${HYPRE_GPU_SOURCES} ${GPU_SRCS} PARENT_SCOPE) endif () convert_filenames_to_full_paths(HDRS) diff --git a/external/hypre/src/sstruct_mv/F90_HYPRE_sstruct_graph.c b/external/hypre/src/sstruct_mv/F90_HYPRE_sstruct_graph.c index af90d1d5..ac229ddb 100644 --- a/external/hypre/src/sstruct_mv/F90_HYPRE_sstruct_graph.c +++ b/external/hypre/src/sstruct_mv/F90_HYPRE_sstruct_graph.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,23 +17,23 @@ #ifdef __cplusplus extern "C" { #endif - + /*-------------------------------------------------------------------------- * HYPRE_SStructGraphCreate *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_sstructgraphcreate, HYPRE_SSTRUCTGRAPHCREATE) - (hypre_F90_Comm *comm, - hypre_F90_Obj *grid, - hypre_F90_Obj *graph_ptr, - hypre_F90_Int *ierr) +(hypre_F90_Comm *comm, + hypre_F90_Obj *grid, + hypre_F90_Obj *graph_ptr, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructGraphCreate( - hypre_F90_PassComm (comm), - hypre_F90_PassObj (HYPRE_SStructGrid, grid), - hypre_F90_PassObjRef (HYPRE_SStructGraph, graph_ptr) ) ); + (HYPRE_SStructGraphCreate( + hypre_F90_PassComm (comm), + hypre_F90_PassObj (HYPRE_SStructGrid, grid), + hypre_F90_PassObjRef (HYPRE_SStructGraph, graph_ptr) ) ); } /*-------------------------------------------------------------------------- @@ -42,12 +42,12 @@ hypre_F90_IFACE(hypre_sstructgraphcreate, HYPRE_SSTRUCTGRAPHCREATE) void hypre_F90_IFACE(hypre_sstructgraphdestroy, HYPRE_SSTRUCTGRAPHDESTROY) - (hypre_F90_Obj *graph, - hypre_F90_Int *ierr) +(hypre_F90_Obj *graph, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructGraphDestroy( - hypre_F90_PassObj (HYPRE_SStructGraph, graph) ) ); + (HYPRE_SStructGraphDestroy( + hypre_F90_PassObj (HYPRE_SStructGraph, graph) ) ); } /*-------------------------------------------------------------------------- @@ -56,14 +56,14 @@ hypre_F90_IFACE(hypre_sstructgraphdestroy, HYPRE_SSTRUCTGRAPHDESTROY) void hypre_F90_IFACE(hypre_sstructgraphsetdomaingrid, HYPRE_SSTRUCTGRAPHSETDOMAINGRID) - (hypre_F90_Obj *graph, - hypre_F90_Obj *domain_grid, - hypre_F90_Int *ierr) +(hypre_F90_Obj *graph, + hypre_F90_Obj *domain_grid, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructGraphSetDomainGrid( - hypre_F90_PassObj (HYPRE_SStructGraph, graph), - hypre_F90_PassObj (HYPRE_SStructGrid, domain_grid) ) ); + (HYPRE_SStructGraphSetDomainGrid( + hypre_F90_PassObj (HYPRE_SStructGraph, graph), + hypre_F90_PassObj (HYPRE_SStructGrid, domain_grid) ) ); } /*-------------------------------------------------------------------------- @@ -72,18 +72,18 @@ hypre_F90_IFACE(hypre_sstructgraphsetdomaingrid, HYPRE_SSTRUCTGRAPHSETDOMAINGRID void hypre_F90_IFACE(hypre_sstructgraphsetstencil, HYPRE_SSTRUCTGRAPHSETSTENCIL) - (hypre_F90_Obj *graph, - hypre_F90_Int *part, - hypre_F90_Int *var, - hypre_F90_Obj *stencil, - hypre_F90_Int *ierr) +(hypre_F90_Obj *graph, + hypre_F90_Int *part, + hypre_F90_Int *var, + hypre_F90_Obj *stencil, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructGraphSetStencil( - hypre_F90_PassObj (HYPRE_SStructGraph, graph), - hypre_F90_PassInt (part), - hypre_F90_PassInt (var), - hypre_F90_PassObj (HYPRE_SStructStencil, stencil) ) ); + (HYPRE_SStructGraphSetStencil( + hypre_F90_PassObj (HYPRE_SStructGraph, graph), + hypre_F90_PassInt (part), + hypre_F90_PassInt (var), + hypre_F90_PassObj (HYPRE_SStructStencil, stencil) ) ); } /*-------------------------------------------------------------------------- @@ -92,14 +92,14 @@ hypre_F90_IFACE(hypre_sstructgraphsetstencil, HYPRE_SSTRUCTGRAPHSETSTENCIL) void hypre_F90_IFACE(hypre_sstructgraphsetfem, HYPRE_SSTRUCTGRAPHSETFEM) - (hypre_F90_Obj *graph, - hypre_F90_Int *part, - hypre_F90_Int *ierr) +(hypre_F90_Obj *graph, + hypre_F90_Int *part, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructGraphSetFEM( - hypre_F90_PassObj (HYPRE_SStructGraph, graph), - hypre_F90_PassInt (part) ) ); + (HYPRE_SStructGraphSetFEM( + hypre_F90_PassObj (HYPRE_SStructGraph, graph), + hypre_F90_PassInt (part) ) ); } /*-------------------------------------------------------------------------- @@ -108,18 +108,18 @@ hypre_F90_IFACE(hypre_sstructgraphsetfem, HYPRE_SSTRUCTGRAPHSETFEM) void hypre_F90_IFACE(hypre_sstructgraphsetfemsparsity, HYPRE_SSTRUCTGRAPHSETFEMSPARSITY) - (hypre_F90_Obj *graph, - hypre_F90_Int *part, - hypre_F90_Int *nsparse, - hypre_F90_IntArray *sparsity, - hypre_F90_Int *ierr) +(hypre_F90_Obj *graph, + hypre_F90_Int *part, + hypre_F90_Int *nsparse, + hypre_F90_IntArray *sparsity, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructGraphSetFEMSparsity( - hypre_F90_PassObj (HYPRE_SStructGraph, graph), - hypre_F90_PassInt (part), - hypre_F90_PassInt (nsparse), - hypre_F90_PassIntArray (sparsity) ) ); + (HYPRE_SStructGraphSetFEMSparsity( + hypre_F90_PassObj (HYPRE_SStructGraph, graph), + hypre_F90_PassInt (part), + hypre_F90_PassInt (nsparse), + hypre_F90_PassIntArray (sparsity) ) ); } /*-------------------------------------------------------------------------- @@ -129,24 +129,24 @@ hypre_F90_IFACE(hypre_sstructgraphsetfemsparsity, HYPRE_SSTRUCTGRAPHSETFEMSPARSI void hypre_F90_IFACE(hypre_sstructgraphaddentries, HYPRE_SSTRUCTGRAPHADDENTRIES) - (hypre_F90_Obj *graph, - hypre_F90_Int *part, - hypre_F90_IntArray *index, - hypre_F90_Int *var, - hypre_F90_Int *to_part, - hypre_F90_IntArray *to_index, - hypre_F90_Int *to_var, - hypre_F90_Int *ierr) +(hypre_F90_Obj *graph, + hypre_F90_Int *part, + hypre_F90_IntArray *index, + hypre_F90_Int *var, + hypre_F90_Int *to_part, + hypre_F90_IntArray *to_index, + hypre_F90_Int *to_var, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructGraphAddEntries( - hypre_F90_PassObj (HYPRE_SStructGraph, graph), - hypre_F90_PassInt (part), - hypre_F90_PassIntArray (index), - hypre_F90_PassInt (var), - hypre_F90_PassInt (to_part), - hypre_F90_PassIntArray (to_index), - hypre_F90_PassInt (to_var) ) ); + (HYPRE_SStructGraphAddEntries( + hypre_F90_PassObj (HYPRE_SStructGraph, graph), + hypre_F90_PassInt (part), + hypre_F90_PassIntArray (index), + hypre_F90_PassInt (var), + hypre_F90_PassInt (to_part), + hypre_F90_PassIntArray (to_index), + hypre_F90_PassInt (to_var) ) ); } /*-------------------------------------------------------------------------- @@ -155,12 +155,12 @@ hypre_F90_IFACE(hypre_sstructgraphaddentries, HYPRE_SSTRUCTGRAPHADDENTRIES) void hypre_F90_IFACE(hypre_sstructgraphassemble, HYPRE_SSTRUCTGRAPHASSEMBLE) - (hypre_F90_Obj *graph, - hypre_F90_Int *ierr) +(hypre_F90_Obj *graph, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructGraphAssemble( - hypre_F90_PassObj (HYPRE_SStructGraph, graph) ) ); + (HYPRE_SStructGraphAssemble( + hypre_F90_PassObj (HYPRE_SStructGraph, graph) ) ); } /*-------------------------------------------------------------------------- @@ -169,14 +169,14 @@ hypre_F90_IFACE(hypre_sstructgraphassemble, HYPRE_SSTRUCTGRAPHASSEMBLE) void hypre_F90_IFACE(hypre_sstructgraphsetobjecttype, HYPRE_SSTRUCTGRAPHSETOBJECTTYPE) - (hypre_F90_Obj *graph, - hypre_F90_Int *type, - hypre_F90_Int *ierr) +(hypre_F90_Obj *graph, + hypre_F90_Int *type, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructGraphSetObjectType( - hypre_F90_PassObj (HYPRE_SStructGraph, graph), - hypre_F90_PassInt (type) ) ); + (HYPRE_SStructGraphSetObjectType( + hypre_F90_PassObj (HYPRE_SStructGraph, graph), + hypre_F90_PassInt (type) ) ); } #ifdef __cplusplus diff --git a/external/hypre/src/sstruct_mv/F90_HYPRE_sstruct_grid.c b/external/hypre/src/sstruct_mv/F90_HYPRE_sstruct_grid.c index 99a19748..c1e19be9 100644 --- a/external/hypre/src/sstruct_mv/F90_HYPRE_sstruct_grid.c +++ b/external/hypre/src/sstruct_mv/F90_HYPRE_sstruct_grid.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,24 +17,24 @@ #ifdef __cplusplus extern "C" { #endif - + /*-------------------------------------------------------------------------- * HYPRE_SStructGridCreate *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_sstructgridcreate, HYPRE_SSTRUCTGRIDCREATE) - (hypre_F90_Comm *comm, - hypre_F90_Int *ndim, - hypre_F90_Int *nparts, - hypre_F90_ObjRef *grid_ptr, - hypre_F90_Int *ierr) +(hypre_F90_Comm *comm, + hypre_F90_Int *ndim, + hypre_F90_Int *nparts, + hypre_F90_ObjRef *grid_ptr, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) HYPRE_SStructGridCreate( - hypre_F90_PassComm (comm), - hypre_F90_PassInt (ndim), - hypre_F90_PassInt (nparts), - hypre_F90_PassObjRef (HYPRE_SStructGrid, grid_ptr) ); + hypre_F90_PassComm (comm), + hypre_F90_PassInt (ndim), + hypre_F90_PassInt (nparts), + hypre_F90_PassObjRef (HYPRE_SStructGrid, grid_ptr) ); } /*-------------------------------------------------------------------------- @@ -43,11 +43,11 @@ hypre_F90_IFACE(hypre_sstructgridcreate, HYPRE_SSTRUCTGRIDCREATE) void hypre_F90_IFACE(hypre_sstructgriddestroy, HYPRE_SSTRUCTGRIDDESTROY) - (hypre_F90_Obj *grid, - hypre_F90_Int *ierr) +(hypre_F90_Obj *grid, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) HYPRE_SStructGridDestroy( - hypre_F90_PassObj (HYPRE_SStructGrid, grid) ); + hypre_F90_PassObj (HYPRE_SStructGrid, grid) ); } /*-------------------------------------------------------------------------- @@ -56,17 +56,17 @@ hypre_F90_IFACE(hypre_sstructgriddestroy, HYPRE_SSTRUCTGRIDDESTROY) void hypre_F90_IFACE(hypre_sstructgridsetextents, HYPRE_SSTRUCTGRIDSETEXTENTS) - (hypre_F90_Obj *grid, - hypre_F90_Int *part, - hypre_F90_IntArray *ilower, - hypre_F90_IntArray *iupper, - hypre_F90_Int *ierr) +(hypre_F90_Obj *grid, + hypre_F90_Int *part, + hypre_F90_IntArray *ilower, + hypre_F90_IntArray *iupper, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) HYPRE_SStructGridSetExtents( - hypre_F90_PassObj (HYPRE_SStructGrid, grid), - hypre_F90_PassInt (part), - hypre_F90_PassIntArray (ilower), - hypre_F90_PassIntArray (iupper) ); + hypre_F90_PassObj (HYPRE_SStructGrid, grid), + hypre_F90_PassInt (part), + hypre_F90_PassIntArray (ilower), + hypre_F90_PassIntArray (iupper) ); } /*-------------------------------------------------------------------------- @@ -75,17 +75,17 @@ hypre_F90_IFACE(hypre_sstructgridsetextents, HYPRE_SSTRUCTGRIDSETEXTENTS) void hypre_F90_IFACE(hypre_sstructgridsetvariables, HYPRE_SSTRUCTGRIDSETVARIABLES) - (hypre_F90_Obj *grid, - hypre_F90_Int *part, - hypre_F90_Int *nvars, - hypre_F90_IntArray *vartypes, - hypre_F90_Int *ierr) +(hypre_F90_Obj *grid, + hypre_F90_Int *part, + hypre_F90_Int *nvars, + hypre_F90_IntArray *vartypes, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) HYPRE_SStructGridSetVariables( - hypre_F90_PassObj (HYPRE_SStructGrid, grid), - hypre_F90_PassInt (part), - hypre_F90_PassInt (nvars), - hypre_F90_PassIntArray (vartypes) ); + hypre_F90_PassObj (HYPRE_SStructGrid, grid), + hypre_F90_PassInt (part), + hypre_F90_PassInt (nvars), + hypre_F90_PassIntArray (vartypes) ); } /*-------------------------------------------------------------------------- @@ -94,19 +94,19 @@ hypre_F90_IFACE(hypre_sstructgridsetvariables, HYPRE_SSTRUCTGRIDSETVARIABLES) void hypre_F90_IFACE(hypre_sstructgridaddvariables, HYPRE_SSTRUCTGRIDADDVARIABLES) - (hypre_F90_Obj *grid, - hypre_F90_Int *part, - hypre_F90_IntArray *index, - hypre_F90_Int *nvars, - hypre_F90_IntArray *vartypes, - hypre_F90_Int *ierr) +(hypre_F90_Obj *grid, + hypre_F90_Int *part, + hypre_F90_IntArray *index, + hypre_F90_Int *nvars, + hypre_F90_IntArray *vartypes, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) HYPRE_SStructGridAddVariables( - hypre_F90_PassObj(HYPRE_SStructGrid, grid), - hypre_F90_PassInt(part), - hypre_F90_PassIntArray(index), - hypre_F90_PassInt(nvars), - hypre_F90_PassIntArray(vartypes)); + hypre_F90_PassObj(HYPRE_SStructGrid, grid), + hypre_F90_PassInt(part), + hypre_F90_PassIntArray(index), + hypre_F90_PassInt(nvars), + hypre_F90_PassIntArray(vartypes)); } /*-------------------------------------------------------------------------- @@ -115,15 +115,15 @@ hypre_F90_IFACE(hypre_sstructgridaddvariables, HYPRE_SSTRUCTGRIDADDVARIABLES) void hypre_F90_IFACE(hypre_sstructgridsetfemordering, HYPRE_SSTRUCTGRIDSETFEMORDERING) - (hypre_F90_Obj *grid, - hypre_F90_Int *part, - hypre_F90_IntArray *ordering, - hypre_F90_Int *ierr) +(hypre_F90_Obj *grid, + hypre_F90_Int *part, + hypre_F90_IntArray *ordering, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) HYPRE_SStructGridSetFEMOrdering( - hypre_F90_PassObj (HYPRE_SStructGrid, grid), - hypre_F90_PassInt (part), - hypre_F90_PassIntArray (ordering) ); + hypre_F90_PassObj (HYPRE_SStructGrid, grid), + hypre_F90_PassInt (part), + hypre_F90_PassIntArray (ordering) ); } /*-------------------------------------------------------------------------- @@ -132,27 +132,27 @@ hypre_F90_IFACE(hypre_sstructgridsetfemordering, HYPRE_SSTRUCTGRIDSETFEMORDERING void hypre_F90_IFACE(hypre_sstructgridsetneighborpart, HYPRE_SSTRUCTGRIDSETNEIGHBORPART) - (hypre_F90_Obj *grid, - hypre_F90_Int *part, - hypre_F90_IntArray *ilower, - hypre_F90_IntArray *iupper, - hypre_F90_Int *nbor_part, - hypre_F90_IntArray *nbor_ilower, - hypre_F90_IntArray *nbor_iupper, - hypre_F90_IntArray *index_map, - hypre_F90_IntArray *index_dir, - hypre_F90_Int *ierr) +(hypre_F90_Obj *grid, + hypre_F90_Int *part, + hypre_F90_IntArray *ilower, + hypre_F90_IntArray *iupper, + hypre_F90_Int *nbor_part, + hypre_F90_IntArray *nbor_ilower, + hypre_F90_IntArray *nbor_iupper, + hypre_F90_IntArray *index_map, + hypre_F90_IntArray *index_dir, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) HYPRE_SStructGridSetNeighborPart( - hypre_F90_PassObj (HYPRE_SStructGrid, grid), - hypre_F90_PassInt (part), - hypre_F90_PassIntArray (ilower), - hypre_F90_PassIntArray (iupper), - hypre_F90_PassInt (nbor_part), - hypre_F90_PassIntArray (nbor_ilower), - hypre_F90_PassIntArray (nbor_iupper), - hypre_F90_PassIntArray (index_map), - hypre_F90_PassIntArray (index_dir) ); + hypre_F90_PassObj (HYPRE_SStructGrid, grid), + hypre_F90_PassInt (part), + hypre_F90_PassIntArray (ilower), + hypre_F90_PassIntArray (iupper), + hypre_F90_PassInt (nbor_part), + hypre_F90_PassIntArray (nbor_ilower), + hypre_F90_PassIntArray (nbor_iupper), + hypre_F90_PassIntArray (index_map), + hypre_F90_PassIntArray (index_dir) ); } /*-------------------------------------------------------------------------- @@ -161,31 +161,31 @@ hypre_F90_IFACE(hypre_sstructgridsetneighborpart, HYPRE_SSTRUCTGRIDSETNEIGHBORPA void hypre_F90_IFACE(hypre_sstructgridsetsharedpart, HYPRE_SSTRUCTGRIDSETSHAREDPART) - (hypre_F90_Obj *grid, - hypre_F90_Int *part, - hypre_F90_IntArray *ilower, - hypre_F90_IntArray *iupper, - hypre_F90_IntArray *offset, - hypre_F90_Int *shared_part, - hypre_F90_IntArray *shared_ilower, - hypre_F90_IntArray *shared_iupper, - hypre_F90_IntArray *shared_offset, - hypre_F90_IntArray *index_map, - hypre_F90_IntArray *index_dir, - hypre_F90_Int *ierr) +(hypre_F90_Obj *grid, + hypre_F90_Int *part, + hypre_F90_IntArray *ilower, + hypre_F90_IntArray *iupper, + hypre_F90_IntArray *offset, + hypre_F90_Int *shared_part, + hypre_F90_IntArray *shared_ilower, + hypre_F90_IntArray *shared_iupper, + hypre_F90_IntArray *shared_offset, + hypre_F90_IntArray *index_map, + hypre_F90_IntArray *index_dir, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) HYPRE_SStructGridSetSharedPart( - hypre_F90_PassObj (HYPRE_SStructGrid, grid), - hypre_F90_PassInt (part), - hypre_F90_PassIntArray (ilower), - hypre_F90_PassIntArray (iupper), - hypre_F90_PassIntArray (offset), - hypre_F90_PassInt (shared_part), - hypre_F90_PassIntArray (shared_ilower), - hypre_F90_PassIntArray (shared_iupper), - hypre_F90_PassIntArray (shared_offset), - hypre_F90_PassIntArray (index_map), - hypre_F90_PassIntArray (index_dir) ); + hypre_F90_PassObj (HYPRE_SStructGrid, grid), + hypre_F90_PassInt (part), + hypre_F90_PassIntArray (ilower), + hypre_F90_PassIntArray (iupper), + hypre_F90_PassIntArray (offset), + hypre_F90_PassInt (shared_part), + hypre_F90_PassIntArray (shared_ilower), + hypre_F90_PassIntArray (shared_iupper), + hypre_F90_PassIntArray (shared_offset), + hypre_F90_PassIntArray (index_map), + hypre_F90_PassIntArray (index_dir) ); } /*-------------------------------------------------------------------------- @@ -197,15 +197,15 @@ hypre_F90_IFACE(hypre_sstructgridsetsharedpart, HYPRE_SSTRUCTGRIDSETSHAREDPART) void hypre_F90_IFACE(hypre_sstructgridaddunstructure, HYPRE_SSTRUCTGRIDADDUNSTRUCTURE) - (hypre_F90_Obj *grid, - hypre_F90_Int *ilower, - hypre_F90_Int *iupper, - hypre_F90_Int *ierr) +(hypre_F90_Obj *grid, + hypre_F90_Int *ilower, + hypre_F90_Int *iupper, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) HYPRE_SStructGridAddUnstructuredPart( - hypre_F90_PassObj (HYPRE_SStructGrid, grid), - hypre_F90_PassInt (ilower), - hypre_F90_PassInt (iupper) ); + hypre_F90_PassObj (HYPRE_SStructGrid, grid), + hypre_F90_PassInt (ilower), + hypre_F90_PassInt (iupper) ); } #endif @@ -215,11 +215,11 @@ hypre_F90_IFACE(hypre_sstructgridaddunstructure, HYPRE_SSTRUCTGRIDADDUNSTRUCTURE void hypre_F90_IFACE(hypre_sstructgridassemble, HYPRE_SSTRUCTGRIDASSEMBLE) - (hypre_F90_Obj *grid, - hypre_F90_Int *ierr) +(hypre_F90_Obj *grid, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) HYPRE_SStructGridAssemble( - hypre_F90_PassObj (HYPRE_SStructGrid, grid) ); + hypre_F90_PassObj (HYPRE_SStructGrid, grid) ); } /*-------------------------------------------------------------------------- @@ -228,15 +228,15 @@ hypre_F90_IFACE(hypre_sstructgridassemble, HYPRE_SSTRUCTGRIDASSEMBLE) void hypre_F90_IFACE(hypre_sstructgridsetperiodic, HYPRE_SSTRUCTGRIDSETPERIODIC) - (hypre_F90_Obj *grid, - hypre_F90_Int *part, - hypre_F90_IntArray *periodic, - hypre_F90_Int *ierr) +(hypre_F90_Obj *grid, + hypre_F90_Int *part, + hypre_F90_IntArray *periodic, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) HYPRE_SStructGridSetPeriodic( - hypre_F90_PassObj (HYPRE_SStructGrid, grid), - hypre_F90_PassInt (part), - hypre_F90_PassIntArray (periodic) ); + hypre_F90_PassObj (HYPRE_SStructGrid, grid), + hypre_F90_PassInt (part), + hypre_F90_PassIntArray (periodic) ); } /*-------------------------------------------------------------------------- @@ -245,13 +245,13 @@ hypre_F90_IFACE(hypre_sstructgridsetperiodic, HYPRE_SSTRUCTGRIDSETPERIODIC) void hypre_F90_IFACE(hypre_sstructgridsetnumghost, HYPRE_SSTRUCTGRIDSETNUMGHOST) - (hypre_F90_Obj *grid, - hypre_F90_IntArray *num_ghost, - hypre_F90_Int *ierr) +(hypre_F90_Obj *grid, + hypre_F90_IntArray *num_ghost, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) HYPRE_SStructGridSetNumGhost( - hypre_F90_PassObj (HYPRE_SStructGrid, grid), - hypre_F90_PassIntArray (num_ghost) ); + hypre_F90_PassObj (HYPRE_SStructGrid, grid), + hypre_F90_PassIntArray (num_ghost) ); } #ifdef __cplusplus diff --git a/external/hypre/src/sstruct_mv/F90_HYPRE_sstruct_matrix.c b/external/hypre/src/sstruct_mv/F90_HYPRE_sstruct_matrix.c index 539370c2..a2fc9f8c 100644 --- a/external/hypre/src/sstruct_mv/F90_HYPRE_sstruct_matrix.c +++ b/external/hypre/src/sstruct_mv/F90_HYPRE_sstruct_matrix.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,23 +17,23 @@ #ifdef __cplusplus extern "C" { #endif - + /*-------------------------------------------------------------------------- * HYPRE_SStructMatrixCreate *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_sstructmatrixcreate, HYPRE_SSTRUCTMATRIXCREATE) - (hypre_F90_Comm *comm, - hypre_F90_Obj *graph, - hypre_F90_Obj *matrix_ptr, - hypre_F90_Int *ierr) +(hypre_F90_Comm *comm, + hypre_F90_Obj *graph, + hypre_F90_Obj *matrix_ptr, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructMatrixCreate( - hypre_F90_PassComm (comm), - hypre_F90_PassObj (HYPRE_SStructGraph, graph), - hypre_F90_PassObjRef (HYPRE_SStructMatrix, matrix_ptr) ) ); + (HYPRE_SStructMatrixCreate( + hypre_F90_PassComm (comm), + hypre_F90_PassObj (HYPRE_SStructGraph, graph), + hypre_F90_PassObjRef (HYPRE_SStructMatrix, matrix_ptr) ) ); } /*-------------------------------------------------------------------------- @@ -42,12 +42,12 @@ hypre_F90_IFACE(hypre_sstructmatrixcreate, HYPRE_SSTRUCTMATRIXCREATE) void hypre_F90_IFACE(hypre_sstructmatrixdestroy, HYPRE_SSTRUCTMATRIXDESTROY) - (hypre_F90_Obj *matrix, - hypre_F90_Int *ierr) +(hypre_F90_Obj *matrix, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructMatrixDestroy( - hypre_F90_PassObj (HYPRE_SStructMatrix, matrix) )); + (HYPRE_SStructMatrixDestroy( + hypre_F90_PassObj (HYPRE_SStructMatrix, matrix) )); } /*-------------------------------------------------------------------------- @@ -56,12 +56,12 @@ hypre_F90_IFACE(hypre_sstructmatrixdestroy, HYPRE_SSTRUCTMATRIXDESTROY) void hypre_F90_IFACE(hypre_sstructmatrixinitialize, HYPRE_SSTRUCTMATRIXINITIALIZE) - (hypre_F90_Obj *matrix, - hypre_F90_Int *ierr) +(hypre_F90_Obj *matrix, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructMatrixInitialize( - hypre_F90_PassObj (HYPRE_SStructMatrix, matrix) )); + (HYPRE_SStructMatrixInitialize( + hypre_F90_PassObj (HYPRE_SStructMatrix, matrix) )); } /*-------------------------------------------------------------------------- @@ -70,24 +70,24 @@ hypre_F90_IFACE(hypre_sstructmatrixinitialize, HYPRE_SSTRUCTMATRIXINITIALIZE) void hypre_F90_IFACE(hypre_sstructmatrixsetvalues, HYPRE_SSTRUCTMATRIXSETVALUES) - (hypre_F90_Obj *matrix, - hypre_F90_Int *part, - hypre_F90_IntArray *index, - hypre_F90_Int *var, - hypre_F90_Int *nentries, - hypre_F90_IntArray *entries, - hypre_F90_ComplexArray *values, - hypre_F90_Int *ierr) +(hypre_F90_Obj *matrix, + hypre_F90_Int *part, + hypre_F90_IntArray *index, + hypre_F90_Int *var, + hypre_F90_Int *nentries, + hypre_F90_IntArray *entries, + hypre_F90_ComplexArray *values, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructMatrixSetValues( - hypre_F90_PassObj (HYPRE_SStructMatrix, matrix), - hypre_F90_PassInt (part), - hypre_F90_PassIntArray (index), - hypre_F90_PassInt (var), - hypre_F90_PassInt (nentries), - hypre_F90_PassIntArray (entries), - hypre_F90_PassComplexArray (values) )); + (HYPRE_SStructMatrixSetValues( + hypre_F90_PassObj (HYPRE_SStructMatrix, matrix), + hypre_F90_PassInt (part), + hypre_F90_PassIntArray (index), + hypre_F90_PassInt (var), + hypre_F90_PassInt (nentries), + hypre_F90_PassIntArray (entries), + hypre_F90_PassComplexArray (values) )); } /*-------------------------------------------------------------------------- @@ -96,24 +96,24 @@ hypre_F90_IFACE(hypre_sstructmatrixsetvalues, HYPRE_SSTRUCTMATRIXSETVALUES) void hypre_F90_IFACE(hypre_sstructmatrixaddtovalues, HYPRE_SSTRUCTMATRIXADDTOVALUES) - (hypre_F90_Obj *matrix, - hypre_F90_Int *part, - hypre_F90_IntArray *index, - hypre_F90_Int *var, - hypre_F90_Int *nentries, - hypre_F90_IntArray *entries, - hypre_F90_ComplexArray *values, - hypre_F90_Int *ierr) +(hypre_F90_Obj *matrix, + hypre_F90_Int *part, + hypre_F90_IntArray *index, + hypre_F90_Int *var, + hypre_F90_Int *nentries, + hypre_F90_IntArray *entries, + hypre_F90_ComplexArray *values, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructMatrixAddToValues( - hypre_F90_PassObj (HYPRE_SStructMatrix, matrix), - hypre_F90_PassInt (part), - hypre_F90_PassIntArray (index), - hypre_F90_PassInt (var), - hypre_F90_PassInt (nentries), - hypre_F90_PassIntArray (entries), - hypre_F90_PassComplexArray (values)) ); + (HYPRE_SStructMatrixAddToValues( + hypre_F90_PassObj (HYPRE_SStructMatrix, matrix), + hypre_F90_PassInt (part), + hypre_F90_PassIntArray (index), + hypre_F90_PassInt (var), + hypre_F90_PassInt (nentries), + hypre_F90_PassIntArray (entries), + hypre_F90_PassComplexArray (values)) ); } /*-------------------------------------------------------------------------- @@ -122,18 +122,18 @@ hypre_F90_IFACE(hypre_sstructmatrixaddtovalues, HYPRE_SSTRUCTMATRIXADDTOVALUES) void hypre_F90_IFACE(hypre_sstructmatrixaddfemvalues, HYPRE_SSTRUCTMATRIXADDFEMVALUES) - (hypre_F90_Obj *matrix, - hypre_F90_Int *part, - hypre_F90_IntArray *index, - hypre_F90_ComplexArray *values, - hypre_F90_Int *ierr) +(hypre_F90_Obj *matrix, + hypre_F90_Int *part, + hypre_F90_IntArray *index, + hypre_F90_ComplexArray *values, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructMatrixAddFEMValues( - hypre_F90_PassObj (HYPRE_SStructMatrix, matrix), - hypre_F90_PassInt (part), - hypre_F90_PassIntArray (index), - hypre_F90_PassComplexArray (values)) ); + (HYPRE_SStructMatrixAddFEMValues( + hypre_F90_PassObj (HYPRE_SStructMatrix, matrix), + hypre_F90_PassInt (part), + hypre_F90_PassIntArray (index), + hypre_F90_PassComplexArray (values)) ); } /*-------------------------------------------------------------------------- @@ -142,24 +142,24 @@ hypre_F90_IFACE(hypre_sstructmatrixaddfemvalues, HYPRE_SSTRUCTMATRIXADDFEMVALUES void hypre_F90_IFACE(hypre_sstructmatrixgetvalues, HYPRE_SSTRUCTMATRIXGETVALUES) - (hypre_F90_Obj *matrix, - hypre_F90_Int *part, - hypre_F90_IntArray *index, - hypre_F90_Int *var, - hypre_F90_Int *nentries, - hypre_F90_IntArray *entries, - hypre_F90_ComplexArray *values, - hypre_F90_Int *ierr) +(hypre_F90_Obj *matrix, + hypre_F90_Int *part, + hypre_F90_IntArray *index, + hypre_F90_Int *var, + hypre_F90_Int *nentries, + hypre_F90_IntArray *entries, + hypre_F90_ComplexArray *values, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructMatrixGetValues( - hypre_F90_PassObj (HYPRE_SStructMatrix, matrix), - hypre_F90_PassInt (part), - hypre_F90_PassIntArray (index), - hypre_F90_PassInt (var), - hypre_F90_PassInt (nentries), - hypre_F90_PassIntArray (entries), - hypre_F90_PassComplexArray (values)) ); + (HYPRE_SStructMatrixGetValues( + hypre_F90_PassObj (HYPRE_SStructMatrix, matrix), + hypre_F90_PassInt (part), + hypre_F90_PassIntArray (index), + hypre_F90_PassInt (var), + hypre_F90_PassInt (nentries), + hypre_F90_PassIntArray (entries), + hypre_F90_PassComplexArray (values)) ); } /*-------------------------------------------------------------------------- @@ -168,26 +168,26 @@ hypre_F90_IFACE(hypre_sstructmatrixgetvalues, HYPRE_SSTRUCTMATRIXGETVALUES) void hypre_F90_IFACE(hypre_sstructmatrixsetboxvalues, HYPRE_SSTRUCTMATRIXSETBOXVALUES) - (hypre_F90_Obj *matrix, - hypre_F90_Int *part, - hypre_F90_IntArray *ilower, - hypre_F90_IntArray *iupper, - hypre_F90_Int *var, - hypre_F90_Int *nentries, - hypre_F90_IntArray *entries, - hypre_F90_ComplexArray *values, - hypre_F90_Int *ierr) +(hypre_F90_Obj *matrix, + hypre_F90_Int *part, + hypre_F90_IntArray *ilower, + hypre_F90_IntArray *iupper, + hypre_F90_Int *var, + hypre_F90_Int *nentries, + hypre_F90_IntArray *entries, + hypre_F90_ComplexArray *values, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructMatrixSetBoxValues( - hypre_F90_PassObj (HYPRE_SStructMatrix, matrix), - hypre_F90_PassInt (part), - hypre_F90_PassIntArray (ilower), - hypre_F90_PassIntArray (iupper), - hypre_F90_PassInt (var), - hypre_F90_PassInt (nentries), - hypre_F90_PassIntArray (entries), - hypre_F90_PassComplexArray (values))); + (HYPRE_SStructMatrixSetBoxValues( + hypre_F90_PassObj (HYPRE_SStructMatrix, matrix), + hypre_F90_PassInt (part), + hypre_F90_PassIntArray (ilower), + hypre_F90_PassIntArray (iupper), + hypre_F90_PassInt (var), + hypre_F90_PassInt (nentries), + hypre_F90_PassIntArray (entries), + hypre_F90_PassComplexArray (values))); } /*-------------------------------------------------------------------------- @@ -196,26 +196,26 @@ hypre_F90_IFACE(hypre_sstructmatrixsetboxvalues, HYPRE_SSTRUCTMATRIXSETBOXVALUES void hypre_F90_IFACE(hypre_sstructmatrixaddtoboxvalu, HYPRE_SSTRUCTMATRIXADDTOBOXVALU) - (hypre_F90_Obj *matrix, - hypre_F90_Int *part, - hypre_F90_IntArray *ilower, - hypre_F90_IntArray *iupper, - hypre_F90_Int *var, - hypre_F90_Int *nentries, - hypre_F90_IntArray *entries, - hypre_F90_ComplexArray *values, - hypre_F90_Int *ierr) +(hypre_F90_Obj *matrix, + hypre_F90_Int *part, + hypre_F90_IntArray *ilower, + hypre_F90_IntArray *iupper, + hypre_F90_Int *var, + hypre_F90_Int *nentries, + hypre_F90_IntArray *entries, + hypre_F90_ComplexArray *values, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructMatrixAddToBoxValues( - hypre_F90_PassObj (HYPRE_SStructMatrix, matrix), - hypre_F90_PassInt (part), - hypre_F90_PassIntArray (ilower), - hypre_F90_PassIntArray (iupper), - hypre_F90_PassInt (var), - hypre_F90_PassInt (nentries), - hypre_F90_PassIntArray (entries), - hypre_F90_PassComplexArray (values) ) ); + (HYPRE_SStructMatrixAddToBoxValues( + hypre_F90_PassObj (HYPRE_SStructMatrix, matrix), + hypre_F90_PassInt (part), + hypre_F90_PassIntArray (ilower), + hypre_F90_PassIntArray (iupper), + hypre_F90_PassInt (var), + hypre_F90_PassInt (nentries), + hypre_F90_PassIntArray (entries), + hypre_F90_PassComplexArray (values) ) ); } /*-------------------------------------------------------------------------- @@ -224,26 +224,26 @@ hypre_F90_IFACE(hypre_sstructmatrixaddtoboxvalu, HYPRE_SSTRUCTMATRIXADDTOBOXVALU void hypre_F90_IFACE(hypre_sstructmatrixgetboxvalues, HYPRE_SSTRUCTMATRIXGETBOXVALUES) - (hypre_F90_Obj *matrix, - hypre_F90_Int *part, - hypre_F90_IntArray *ilower, - hypre_F90_IntArray *iupper, - hypre_F90_Int *var, - hypre_F90_Int *nentries, - hypre_F90_IntArray *entries, - hypre_F90_ComplexArray *values, - hypre_F90_Int *ierr) +(hypre_F90_Obj *matrix, + hypre_F90_Int *part, + hypre_F90_IntArray *ilower, + hypre_F90_IntArray *iupper, + hypre_F90_Int *var, + hypre_F90_Int *nentries, + hypre_F90_IntArray *entries, + hypre_F90_ComplexArray *values, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructMatrixGetBoxValues( - hypre_F90_PassObj (HYPRE_SStructMatrix, matrix), - hypre_F90_PassInt (part), - hypre_F90_PassIntArray (ilower), - hypre_F90_PassIntArray (iupper), - hypre_F90_PassInt (var), - hypre_F90_PassInt (nentries), - hypre_F90_PassIntArray (entries), - hypre_F90_PassComplexArray (values))); + (HYPRE_SStructMatrixGetBoxValues( + hypre_F90_PassObj (HYPRE_SStructMatrix, matrix), + hypre_F90_PassInt (part), + hypre_F90_PassIntArray (ilower), + hypre_F90_PassIntArray (iupper), + hypre_F90_PassInt (var), + hypre_F90_PassInt (nentries), + hypre_F90_PassIntArray (entries), + hypre_F90_PassComplexArray (values))); } /*-------------------------------------------------------------------------- @@ -252,12 +252,12 @@ hypre_F90_IFACE(hypre_sstructmatrixgetboxvalues, HYPRE_SSTRUCTMATRIXGETBOXVALUES void hypre_F90_IFACE(hypre_sstructmatrixassemble, HYPRE_SSTRUCTMATRIXASSEMBLE) - (hypre_F90_Obj *matrix, - hypre_F90_Int *ierr) +(hypre_F90_Obj *matrix, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructMatrixAssemble( - hypre_F90_PassObj (HYPRE_SStructMatrix, matrix) )); + (HYPRE_SStructMatrixAssemble( + hypre_F90_PassObj (HYPRE_SStructMatrix, matrix) )); } /*-------------------------------------------------------------------------- @@ -266,20 +266,20 @@ hypre_F90_IFACE(hypre_sstructmatrixassemble, HYPRE_SSTRUCTMATRIXASSEMBLE) void hypre_F90_IFACE(hypre_sstructmatrixsetsymmetric, HYPRE_SSTRUCTMATRIXSETSYMMETRIC) - (hypre_F90_Obj *matrix, - hypre_F90_Int *part, - hypre_F90_Int *var, - hypre_F90_Int *to_var, - hypre_F90_Int *symmetric, - hypre_F90_Int *ierr) +(hypre_F90_Obj *matrix, + hypre_F90_Int *part, + hypre_F90_Int *var, + hypre_F90_Int *to_var, + hypre_F90_Int *symmetric, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructMatrixSetSymmetric( - hypre_F90_PassObj (HYPRE_SStructMatrix, matrix), - hypre_F90_PassInt (part), - hypre_F90_PassInt (var), - hypre_F90_PassInt (to_var), - hypre_F90_PassInt (symmetric) )); + (HYPRE_SStructMatrixSetSymmetric( + hypre_F90_PassObj (HYPRE_SStructMatrix, matrix), + hypre_F90_PassInt (part), + hypre_F90_PassInt (var), + hypre_F90_PassInt (to_var), + hypre_F90_PassInt (symmetric) )); } /*-------------------------------------------------------------------------- @@ -288,14 +288,14 @@ hypre_F90_IFACE(hypre_sstructmatrixsetsymmetric, HYPRE_SSTRUCTMATRIXSETSYMMETRIC void hypre_F90_IFACE(hypre_sstructmatrixsetnssymmetr, HYPRE_SSTRUCTMATRIXSETNSSYMMETR) - (hypre_F90_Obj *matrix, - hypre_F90_Int *symmetric, - hypre_F90_Int *ierr) +(hypre_F90_Obj *matrix, + hypre_F90_Int *symmetric, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructMatrixSetNSSymmetric( - hypre_F90_PassObj (HYPRE_SStructMatrix, matrix), - hypre_F90_PassInt (symmetric) )); + (HYPRE_SStructMatrixSetNSSymmetric( + hypre_F90_PassObj (HYPRE_SStructMatrix, matrix), + hypre_F90_PassInt (symmetric) )); } /*-------------------------------------------------------------------------- @@ -304,14 +304,14 @@ hypre_F90_IFACE(hypre_sstructmatrixsetnssymmetr, HYPRE_SSTRUCTMATRIXSETNSSYMMETR void hypre_F90_IFACE(hypre_sstructmatrixsetobjecttyp, HYPRE_SSTRUCTMATRIXSETOBJECTTYP) - (hypre_F90_Obj *matrix, - hypre_F90_Int *type, - hypre_F90_Int *ierr) +(hypre_F90_Obj *matrix, + hypre_F90_Int *type, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructMatrixSetObjectType( - hypre_F90_PassObj (HYPRE_SStructMatrix, matrix), - hypre_F90_PassInt (type) )); + (HYPRE_SStructMatrixSetObjectType( + hypre_F90_PassObj (HYPRE_SStructMatrix, matrix), + hypre_F90_PassInt (type) )); } /*-------------------------------------------------------------------------- @@ -320,14 +320,14 @@ hypre_F90_IFACE(hypre_sstructmatrixsetobjecttyp, HYPRE_SSTRUCTMATRIXSETOBJECTTYP void hypre_F90_IFACE(hypre_sstructmatrixgetobject, HYPRE_SSTRUCTMATRIXGETOBJECT) - (hypre_F90_Obj *matrix, - hypre_F90_Obj *object, - hypre_F90_Int *ierr) +(hypre_F90_Obj *matrix, + hypre_F90_Obj *object, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructMatrixGetObject( - hypre_F90_PassObj (HYPRE_SStructMatrix, matrix), - (void **) object )) ; + (HYPRE_SStructMatrixGetObject( + hypre_F90_PassObj (HYPRE_SStructMatrix, matrix), + (void **) object )) ; } /*-------------------------------------------------------------------------- @@ -336,16 +336,16 @@ hypre_F90_IFACE(hypre_sstructmatrixgetobject, HYPRE_SSTRUCTMATRIXGETOBJECT) void hypre_F90_IFACE(hypre_sstructmatrixprint, HYPRE_SSTRUCTMATRIXPRINT) - (char *filename, - hypre_F90_Obj *matrix, - hypre_F90_Int *all, - hypre_F90_Int *ierr) +(char *filename, + hypre_F90_Obj *matrix, + hypre_F90_Int *all, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructMatrixPrint( - (char *) filename, - hypre_F90_PassObj (HYPRE_SStructMatrix, matrix), - hypre_F90_PassInt (all) ) ); + (HYPRE_SStructMatrixPrint( + (char *) filename, + hypre_F90_PassObj (HYPRE_SStructMatrix, matrix), + hypre_F90_PassInt (all) ) ); } /*-------------------------------------------------------------------------- @@ -354,22 +354,22 @@ hypre_F90_IFACE(hypre_sstructmatrixprint, HYPRE_SSTRUCTMATRIXPRINT) void hypre_F90_IFACE(hypre_sstructmatrixmatvec, HYPRE_SSTRUCTMATRIXMATVEC) - (hypre_F90_Complex *alpha, - hypre_F90_Obj *A, - hypre_F90_Obj *x, - hypre_F90_Complex *beta, - hypre_F90_Obj *y, - hypre_F90_Int *ierr) +(hypre_F90_Complex *alpha, + hypre_F90_Obj *A, + hypre_F90_Obj *x, + hypre_F90_Complex *beta, + hypre_F90_Obj *y, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructMatrixMatvec( - hypre_F90_PassComplex (alpha), - hypre_F90_PassObj (HYPRE_SStructMatrix, A), - hypre_F90_PassObj (HYPRE_SStructVector, x), - hypre_F90_PassComplex (beta), - hypre_F90_PassObj (HYPRE_SStructVector, y) )) ; + (HYPRE_SStructMatrixMatvec( + hypre_F90_PassComplex (alpha), + hypre_F90_PassObj (HYPRE_SStructMatrix, A), + hypre_F90_PassObj (HYPRE_SStructVector, x), + hypre_F90_PassComplex (beta), + hypre_F90_PassObj (HYPRE_SStructVector, y) )) ; } - + #ifdef __cplusplus } #endif diff --git a/external/hypre/src/sstruct_mv/F90_HYPRE_sstruct_stencil.c b/external/hypre/src/sstruct_mv/F90_HYPRE_sstruct_stencil.c index c01bcc81..51f30b07 100644 --- a/external/hypre/src/sstruct_mv/F90_HYPRE_sstruct_stencil.c +++ b/external/hypre/src/sstruct_mv/F90_HYPRE_sstruct_stencil.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,23 +17,23 @@ #ifdef __cplusplus extern "C" { #endif - + /*-------------------------------------------------------------------------- * HYPRE_SStructStencilCreate *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_sstructstencilcreate, HYPRE_SSTRUCTSTENCILCREATE) - (hypre_F90_Int *ndim, - hypre_F90_Int *size, - hypre_F90_Obj *stencil_ptr, - hypre_F90_Int *ierr) +(hypre_F90_Int *ndim, + hypre_F90_Int *size, + hypre_F90_Obj *stencil_ptr, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructStencilCreate( - hypre_F90_PassInt (ndim), - hypre_F90_PassInt (size), - hypre_F90_PassObjRef (HYPRE_SStructStencil, stencil_ptr) ) ); + (HYPRE_SStructStencilCreate( + hypre_F90_PassInt (ndim), + hypre_F90_PassInt (size), + hypre_F90_PassObjRef (HYPRE_SStructStencil, stencil_ptr) ) ); } /*-------------------------------------------------------------------------- @@ -42,12 +42,12 @@ hypre_F90_IFACE(hypre_sstructstencilcreate, HYPRE_SSTRUCTSTENCILCREATE) void hypre_F90_IFACE(hypre_sstructstencildestroy, HYPRE_SSTRUCTSTENCILDESTROY) - (hypre_F90_Obj *stencil, - hypre_F90_Int *ierr) +(hypre_F90_Obj *stencil, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructStencilDestroy( - hypre_F90_PassObj (HYPRE_SStructStencil, stencil) ) ); + (HYPRE_SStructStencilDestroy( + hypre_F90_PassObj (HYPRE_SStructStencil, stencil) ) ); } /*-------------------------------------------------------------------------- @@ -56,18 +56,18 @@ hypre_F90_IFACE(hypre_sstructstencildestroy, HYPRE_SSTRUCTSTENCILDESTROY) void hypre_F90_IFACE(hypre_sstructstencilsetentry, HYPRE_SSTRUCTSTENCILSETENTRY) - (hypre_F90_Obj *stencil, - hypre_F90_Int *entry, - hypre_F90_IntArray *offset, - hypre_F90_Int *var, - hypre_F90_Int *ierr) +(hypre_F90_Obj *stencil, + hypre_F90_Int *entry, + hypre_F90_IntArray *offset, + hypre_F90_Int *var, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructStencilSetEntry( - hypre_F90_PassObj (HYPRE_SStructStencil, stencil), - hypre_F90_PassInt (entry), - hypre_F90_PassIntArray (offset), - hypre_F90_PassInt (var) ) ); + (HYPRE_SStructStencilSetEntry( + hypre_F90_PassObj (HYPRE_SStructStencil, stencil), + hypre_F90_PassInt (entry), + hypre_F90_PassIntArray (offset), + hypre_F90_PassInt (var) ) ); } #ifdef __cplusplus diff --git a/external/hypre/src/sstruct_mv/F90_HYPRE_sstruct_vector.c b/external/hypre/src/sstruct_mv/F90_HYPRE_sstruct_vector.c index d2596069..f50bb2cf 100644 --- a/external/hypre/src/sstruct_mv/F90_HYPRE_sstruct_vector.c +++ b/external/hypre/src/sstruct_mv/F90_HYPRE_sstruct_vector.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,23 +17,23 @@ #ifdef __cplusplus extern "C" { #endif - + /*-------------------------------------------------------------------------- * HYPRE_SStructVectorCreate *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_sstructvectorcreate, HYPRE_SSTRUCTVECTORCREATE) - (hypre_F90_Comm *comm, - hypre_F90_Obj *grid, - hypre_F90_Obj *vector_ptr, - hypre_F90_Int *ierr) +(hypre_F90_Comm *comm, + hypre_F90_Obj *grid, + hypre_F90_Obj *vector_ptr, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructVectorCreate( - hypre_F90_PassComm (comm), - hypre_F90_PassObj (HYPRE_SStructGrid, grid), - hypre_F90_PassObjRef (HYPRE_SStructVector, vector_ptr) ) ); + (HYPRE_SStructVectorCreate( + hypre_F90_PassComm (comm), + hypre_F90_PassObj (HYPRE_SStructGrid, grid), + hypre_F90_PassObjRef (HYPRE_SStructVector, vector_ptr) ) ); } /*-------------------------------------------------------------------------- @@ -42,12 +42,12 @@ hypre_F90_IFACE(hypre_sstructvectorcreate, HYPRE_SSTRUCTVECTORCREATE) void hypre_F90_IFACE(hypre_sstructvectordestroy, HYPRE_SSTRUCTVECTORDESTROY) - (hypre_F90_Obj *vector, - hypre_F90_Int *ierr) +(hypre_F90_Obj *vector, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructVectorDestroy( - hypre_F90_PassObj (HYPRE_SStructVector, vector) ) ); + (HYPRE_SStructVectorDestroy( + hypre_F90_PassObj (HYPRE_SStructVector, vector) ) ); } /*--------------------------------------------------------- @@ -56,12 +56,12 @@ hypre_F90_IFACE(hypre_sstructvectordestroy, HYPRE_SSTRUCTVECTORDESTROY) void hypre_F90_IFACE(hypre_sstructvectorinitialize, HYPRE_SSTRUCTVECTORINITIALIZE) - (hypre_F90_Obj *vector, - hypre_F90_Int *ierr) +(hypre_F90_Obj *vector, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructVectorInitialize( - hypre_F90_PassObj (HYPRE_SStructVector, vector) )); + (HYPRE_SStructVectorInitialize( + hypre_F90_PassObj (HYPRE_SStructVector, vector) )); } /*-------------------------------------------------------------------------- @@ -70,20 +70,20 @@ hypre_F90_IFACE(hypre_sstructvectorinitialize, HYPRE_SSTRUCTVECTORINITIALIZE) void hypre_F90_IFACE(hypre_sstructvectorsetvalues, HYPRE_SSTRUCTVECTORSETVALUES) - (hypre_F90_Obj *vector, - hypre_F90_Int *part, - hypre_F90_IntArray *index, - hypre_F90_Int *var, - hypre_F90_Complex *value, - hypre_F90_Int *ierr) +(hypre_F90_Obj *vector, + hypre_F90_Int *part, + hypre_F90_IntArray *index, + hypre_F90_Int *var, + hypre_F90_Complex *value, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructVectorSetValues( - hypre_F90_PassObj (HYPRE_SStructVector, vector), - hypre_F90_PassInt (part), - hypre_F90_PassIntArray (index), - hypre_F90_PassInt (var), - hypre_F90_PassComplexRef (value) ) ); + (HYPRE_SStructVectorSetValues( + hypre_F90_PassObj (HYPRE_SStructVector, vector), + hypre_F90_PassInt (part), + hypre_F90_PassIntArray (index), + hypre_F90_PassInt (var), + hypre_F90_PassComplexRef (value) ) ); } /*-------------------------------------------------------------------------- @@ -92,20 +92,20 @@ hypre_F90_IFACE(hypre_sstructvectorsetvalues, HYPRE_SSTRUCTVECTORSETVALUES) void hypre_F90_IFACE(hypre_sstructvectoraddtovalues, HYPRE_SSTRUCTVECTORADDTOVALUES) - (hypre_F90_Obj *vector, - hypre_F90_Int *part, - hypre_F90_IntArray *index, - hypre_F90_Int *var, - hypre_F90_Complex *value, - hypre_F90_Int *ierr) +(hypre_F90_Obj *vector, + hypre_F90_Int *part, + hypre_F90_IntArray *index, + hypre_F90_Int *var, + hypre_F90_Complex *value, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructVectorAddToValues( - hypre_F90_PassObj (HYPRE_SStructVector, vector), - hypre_F90_PassInt (part), - hypre_F90_PassIntArray (index), - hypre_F90_PassInt (var), - hypre_F90_PassComplexRef (value) ) ); + (HYPRE_SStructVectorAddToValues( + hypre_F90_PassObj (HYPRE_SStructVector, vector), + hypre_F90_PassInt (part), + hypre_F90_PassIntArray (index), + hypre_F90_PassInt (var), + hypre_F90_PassComplexRef (value) ) ); } /*-------------------------------------------------------------------------- @@ -114,20 +114,20 @@ hypre_F90_IFACE(hypre_sstructvectoraddtovalues, HYPRE_SSTRUCTVECTORADDTOVALUES) void hypre_F90_IFACE(hypre_sstructvectorgetvalues, HYPRE_SSTRUCTVECTORGETVALUES) - (hypre_F90_Obj *vector, - hypre_F90_Int *part, - hypre_F90_IntArray *index, - hypre_F90_Int *var, - hypre_F90_Complex *value, - hypre_F90_Int *ierr) +(hypre_F90_Obj *vector, + hypre_F90_Int *part, + hypre_F90_IntArray *index, + hypre_F90_Int *var, + hypre_F90_Complex *value, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructVectorGetValues( - hypre_F90_PassObj (HYPRE_SStructVector, vector), - hypre_F90_PassInt (part), - hypre_F90_PassIntArray (index), - hypre_F90_PassInt (var), - hypre_F90_PassComplexRef (value) )); + (HYPRE_SStructVectorGetValues( + hypre_F90_PassObj (HYPRE_SStructVector, vector), + hypre_F90_PassInt (part), + hypre_F90_PassIntArray (index), + hypre_F90_PassInt (var), + hypre_F90_PassComplexRef (value) )); } /*-------------------------------------------------------------------------- @@ -136,22 +136,22 @@ hypre_F90_IFACE(hypre_sstructvectorgetvalues, HYPRE_SSTRUCTVECTORGETVALUES) void hypre_F90_IFACE(hypre_sstructvectorsetboxvalues, HYPRE_SSTRUCTVECTORSETBOXVALUES) - (hypre_F90_Obj *vector, - hypre_F90_Int *part, - hypre_F90_IntArray *ilower, - hypre_F90_IntArray *iupper, - hypre_F90_Int *var, - hypre_F90_ComplexArray *values, - hypre_F90_Int *ierr) +(hypre_F90_Obj *vector, + hypre_F90_Int *part, + hypre_F90_IntArray *ilower, + hypre_F90_IntArray *iupper, + hypre_F90_Int *var, + hypre_F90_ComplexArray *values, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructVectorSetBoxValues( - hypre_F90_PassObj (HYPRE_SStructVector, vector), - hypre_F90_PassInt (part), - hypre_F90_PassIntArray (ilower), - hypre_F90_PassIntArray (iupper), - hypre_F90_PassInt (var), - hypre_F90_PassComplexArray (values) ) ); + (HYPRE_SStructVectorSetBoxValues( + hypre_F90_PassObj (HYPRE_SStructVector, vector), + hypre_F90_PassInt (part), + hypre_F90_PassIntArray (ilower), + hypre_F90_PassIntArray (iupper), + hypre_F90_PassInt (var), + hypre_F90_PassComplexArray (values) ) ); } /*-------------------------------------------------------------------------- @@ -160,22 +160,22 @@ hypre_F90_IFACE(hypre_sstructvectorsetboxvalues, HYPRE_SSTRUCTVECTORSETBOXVALUES void hypre_F90_IFACE(hypre_sstructvectoraddtoboxvalu, HYPRE_SSTRUCTVECTORADDTOBOXVALU) - (hypre_F90_Obj *vector, - hypre_F90_Int *part, - hypre_F90_IntArray *ilower, - hypre_F90_IntArray *iupper, - hypre_F90_Int *var, - hypre_F90_ComplexArray *values, - hypre_F90_Int *ierr) +(hypre_F90_Obj *vector, + hypre_F90_Int *part, + hypre_F90_IntArray *ilower, + hypre_F90_IntArray *iupper, + hypre_F90_Int *var, + hypre_F90_ComplexArray *values, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructVectorAddToBoxValues( - hypre_F90_PassObj (HYPRE_SStructVector, vector), - hypre_F90_PassInt (part), - hypre_F90_PassIntArray (ilower), - hypre_F90_PassIntArray (iupper), - hypre_F90_PassInt (var), - hypre_F90_PassComplexArray (values) ) ); + (HYPRE_SStructVectorAddToBoxValues( + hypre_F90_PassObj (HYPRE_SStructVector, vector), + hypre_F90_PassInt (part), + hypre_F90_PassIntArray (ilower), + hypre_F90_PassIntArray (iupper), + hypre_F90_PassInt (var), + hypre_F90_PassComplexArray (values) ) ); } /*-------------------------------------------------------------------------- @@ -184,22 +184,22 @@ hypre_F90_IFACE(hypre_sstructvectoraddtoboxvalu, HYPRE_SSTRUCTVECTORADDTOBOXVALU void hypre_F90_IFACE(hypre_sstructvectorgetboxvalues, HYPRE_SSTRUCTVECTORGETBOXVALUES) - (hypre_F90_Obj *vector, - hypre_F90_Int *part, - hypre_F90_IntArray *ilower, - hypre_F90_IntArray *iupper, - hypre_F90_Int *var, - hypre_F90_ComplexArray *values, - hypre_F90_Int *ierr) +(hypre_F90_Obj *vector, + hypre_F90_Int *part, + hypre_F90_IntArray *ilower, + hypre_F90_IntArray *iupper, + hypre_F90_Int *var, + hypre_F90_ComplexArray *values, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructVectorGetBoxValues( - (HYPRE_SStructVector ) *vector, - hypre_F90_PassInt (part), - hypre_F90_PassIntArray (ilower), - hypre_F90_PassIntArray (iupper), - hypre_F90_PassInt (var), - hypre_F90_PassComplexArray (values) ) ); + (HYPRE_SStructVectorGetBoxValues( + (HYPRE_SStructVector ) * vector, + hypre_F90_PassInt (part), + hypre_F90_PassIntArray (ilower), + hypre_F90_PassIntArray (iupper), + hypre_F90_PassInt (var), + hypre_F90_PassComplexArray (values) ) ); } /*-------------------------------------------------------------------------- @@ -208,12 +208,12 @@ hypre_F90_IFACE(hypre_sstructvectorgetboxvalues, HYPRE_SSTRUCTVECTORGETBOXVALUES void hypre_F90_IFACE(hypre_sstructvectorassemble, HYPRE_SSTRUCTVECTORASSEMBLE) - (hypre_F90_Obj *vector, - hypre_F90_Int *ierr) +(hypre_F90_Obj *vector, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructVectorAssemble( - hypre_F90_PassObj (HYPRE_SStructVector, vector) )); + (HYPRE_SStructVectorAssemble( + hypre_F90_PassObj (HYPRE_SStructVector, vector) )); } /*-------------------------------------------------------------------------- @@ -222,12 +222,12 @@ hypre_F90_IFACE(hypre_sstructvectorassemble, HYPRE_SSTRUCTVECTORASSEMBLE) void hypre_F90_IFACE(hypre_sstructvectorgather, HYPRE_SSTRUCTVECTORGATHER) - (hypre_F90_Obj *vector, - hypre_F90_Int *ierr) +(hypre_F90_Obj *vector, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructVectorGather( - hypre_F90_PassObj (HYPRE_SStructVector, vector) )); + (HYPRE_SStructVectorGather( + hypre_F90_PassObj (HYPRE_SStructVector, vector) )); } /*-------------------------------------------------------------------------- @@ -236,14 +236,14 @@ hypre_F90_IFACE(hypre_sstructvectorgather, HYPRE_SSTRUCTVECTORGATHER) void hypre_F90_IFACE(hypre_sstructvectorsetconstantv, HYPRE_SSTRUCTVECTORSETCONSTANTV) - (hypre_F90_Obj *vector, - hypre_F90_Complex *value, - hypre_F90_Int *ierr) +(hypre_F90_Obj *vector, + hypre_F90_Complex *value, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructVectorSetConstantValues( - hypre_F90_PassObj (HYPRE_SStructVector, vector), - hypre_F90_PassComplex (value))); + (HYPRE_SStructVectorSetConstantValues( + hypre_F90_PassObj (HYPRE_SStructVector, vector), + hypre_F90_PassComplex (value))); } /*-------------------------------------------------------------------------- @@ -252,14 +252,14 @@ hypre_F90_IFACE(hypre_sstructvectorsetconstantv, HYPRE_SSTRUCTVECTORSETCONSTANTV void hypre_F90_IFACE(hypre_sstructvectorsetobjecttyp, HYPRE_SSTRUCTVECTORSETOBJECTTYP) - (hypre_F90_Obj *vector, - hypre_F90_Int *type, - hypre_F90_Int *ierr) +(hypre_F90_Obj *vector, + hypre_F90_Int *type, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructVectorSetObjectType( - hypre_F90_PassObj (HYPRE_SStructVector, vector), - hypre_F90_PassInt (type) )); + (HYPRE_SStructVectorSetObjectType( + hypre_F90_PassObj (HYPRE_SStructVector, vector), + hypre_F90_PassInt (type) )); } /*-------------------------------------------------------------------------- @@ -268,14 +268,14 @@ hypre_F90_IFACE(hypre_sstructvectorsetobjecttyp, HYPRE_SSTRUCTVECTORSETOBJECTTYP void hypre_F90_IFACE(hypre_sstructvectorgetobject, HYPRE_SSTRUCTVECTORGETOBJECT) - (hypre_F90_Obj *vector, - hypre_F90_Obj *object, - hypre_F90_Int *ierr) +(hypre_F90_Obj *vector, + hypre_F90_Obj *object, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructVectorGetObject( - hypre_F90_PassObj (HYPRE_SStructVector, vector), - (void **) object )); + (HYPRE_SStructVectorGetObject( + hypre_F90_PassObj (HYPRE_SStructVector, vector), + (void **) object )); } /*-------------------------------------------------------------------------- @@ -284,16 +284,16 @@ hypre_F90_IFACE(hypre_sstructvectorgetobject, HYPRE_SSTRUCTVECTORGETOBJECT) void hypre_F90_IFACE(hypre_sstructvectorprint, HYPRE_SSTRUCTVECTORPRINT) - (char *filename, - hypre_F90_Obj *vector, - hypre_F90_Int *all, - hypre_F90_Int *ierr) +(char *filename, + hypre_F90_Obj *vector, + hypre_F90_Int *all, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructVectorPrint( - (char * ) filename, - hypre_F90_PassObj (HYPRE_SStructVector, vector), - hypre_F90_PassInt (all) ) ); + (HYPRE_SStructVectorPrint( + (char * ) filename, + hypre_F90_PassObj (HYPRE_SStructVector, vector), + hypre_F90_PassInt (all) ) ); } /*-------------------------------------------------------------------------- @@ -302,14 +302,14 @@ hypre_F90_IFACE(hypre_sstructvectorprint, HYPRE_SSTRUCTVECTORPRINT) void hypre_F90_IFACE(hypre_sstructvectorcopy, HYPRE_SSTRUCTVECTORCOPY) - (hypre_F90_Obj *x, - hypre_F90_Obj *y, - hypre_F90_Int *ierr) +(hypre_F90_Obj *x, + hypre_F90_Obj *y, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructVectorCopy( - hypre_F90_PassObj (HYPRE_SStructVector, x), - hypre_F90_PassObj (HYPRE_SStructVector, y) ) ); + (HYPRE_SStructVectorCopy( + hypre_F90_PassObj (HYPRE_SStructVector, x), + hypre_F90_PassObj (HYPRE_SStructVector, y) ) ); } /*-------------------------------------------------------------------------- @@ -318,14 +318,14 @@ hypre_F90_IFACE(hypre_sstructvectorcopy, HYPRE_SSTRUCTVECTORCOPY) void hypre_F90_IFACE(hypre_sstructvectorscale, HYPRE_SSTRUCTVECTORSCALE) - (hypre_F90_Complex *alpha, - hypre_F90_Obj *y, - hypre_F90_Int *ierr) +(hypre_F90_Complex *alpha, + hypre_F90_Obj *y, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructVectorScale( - hypre_F90_PassComplex (alpha), - hypre_F90_PassObj (HYPRE_SStructVector, y) ) ); + (HYPRE_SStructVectorScale( + hypre_F90_PassComplex (alpha), + hypre_F90_PassObj (HYPRE_SStructVector, y) ) ); } /*-------------------------------------------------------------------------- @@ -334,16 +334,16 @@ hypre_F90_IFACE(hypre_sstructvectorscale, HYPRE_SSTRUCTVECTORSCALE) void hypre_F90_IFACE(hypre_sstructinnerprod, HYPRE_SSTRUCTINNERPROD) - (hypre_F90_Obj *x, - hypre_F90_Obj *y, - hypre_F90_Complex *result, - hypre_F90_Int *ierr) +(hypre_F90_Obj *x, + hypre_F90_Obj *y, + hypre_F90_Complex *result, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructInnerProd( - hypre_F90_PassObj (HYPRE_SStructVector, x), - hypre_F90_PassObj (HYPRE_SStructVector, y), - hypre_F90_PassComplexRef (result) ) ); + (HYPRE_SStructInnerProd( + hypre_F90_PassObj (HYPRE_SStructVector, x), + hypre_F90_PassObj (HYPRE_SStructVector, y), + hypre_F90_PassComplexRef (result) ) ); } /*-------------------------------------------------------------------------- @@ -352,16 +352,16 @@ hypre_F90_IFACE(hypre_sstructinnerprod, HYPRE_SSTRUCTINNERPROD) void hypre_F90_IFACE(hypre_sstructaxpy, HYPRE_SSTRUCTAXPY) - (hypre_F90_Complex *alpha, - hypre_F90_Obj *x, - hypre_F90_Obj *y, - hypre_F90_Int *ierr) +(hypre_F90_Complex *alpha, + hypre_F90_Obj *x, + hypre_F90_Obj *y, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_SStructAxpy( - hypre_F90_PassComplex (alpha), - hypre_F90_PassObj (HYPRE_SStructVector, x), - hypre_F90_PassObj (HYPRE_SStructVector, y) ) ); + (HYPRE_SStructAxpy( + hypre_F90_PassComplex (alpha), + hypre_F90_PassObj (HYPRE_SStructVector, x), + hypre_F90_PassObj (HYPRE_SStructVector, y) ) ); } #ifdef __cplusplus diff --git a/external/hypre/src/sstruct_mv/HYPRE_sstruct_graph.c b/external/hypre/src/sstruct_mv/HYPRE_sstruct_graph.c index 5694666f..5691325e 100644 --- a/external/hypre/src/sstruct_mv/HYPRE_sstruct_graph.c +++ b/external/hypre/src/sstruct_mv/HYPRE_sstruct_graph.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -78,7 +78,7 @@ HYPRE_SStructGraphCreate( MPI_Comm comm, hypre_SStructGraphEntries(graph) = NULL; hypre_SStructNGraphEntries(graph) = 0; hypre_SStructAGraphEntries(graph) = 0; - + *graph_ptr = graph; return hypre_error_flag; @@ -90,20 +90,21 @@ HYPRE_SStructGraphCreate( MPI_Comm comm, HYPRE_Int HYPRE_SStructGraphDestroy( HYPRE_SStructGraph graph ) { - HYPRE_Int nparts; - hypre_SStructPGrid **pgrids; - hypre_SStructStencil ***stencils; - HYPRE_Int *fem_nsparse; - HYPRE_Int **fem_sparse_i; - HYPRE_Int **fem_sparse_j; - HYPRE_Int **fem_entries; - HYPRE_Int nUventries; - HYPRE_Int *iUventries; - hypre_SStructUVEntry **Uventries; - hypre_SStructUVEntry *Uventry; - HYPRE_BigInt **Uveoffsets; - HYPRE_Int nvars; - HYPRE_Int part, var, i; + HYPRE_Int nparts; + hypre_SStructPGrid **pgrids; + hypre_SStructStencil ***stencils; + HYPRE_Int *fem_nsparse; + HYPRE_Int **fem_sparse_i; + HYPRE_Int **fem_sparse_j; + HYPRE_Int **fem_entries; + HYPRE_Int nUventries; + HYPRE_Int *iUventries; + hypre_SStructUVEntry **Uventries; + hypre_SStructUVEntry *Uventry; + HYPRE_BigInt **Uveoffsets; + hypre_SStructGraphEntry **graph_entries; + HYPRE_Int nvars; + HYPRE_Int part, var, i; if (graph) { @@ -155,6 +156,12 @@ HYPRE_SStructGraphDestroy( HYPRE_SStructGraph graph ) hypre_TFree(iUventries, HYPRE_MEMORY_HOST); hypre_TFree(Uventries, HYPRE_MEMORY_HOST); hypre_TFree(Uveoffsets, HYPRE_MEMORY_HOST); + graph_entries = hypre_SStructGraphEntries(graph); + for (i = 0; i < hypre_SStructNGraphEntries(graph); i++) + { + hypre_TFree(graph_entries[i], HYPRE_MEMORY_HOST); + } + hypre_TFree(graph_entries, HYPRE_MEMORY_HOST); hypre_TFree(graph, HYPRE_MEMORY_HOST); } } @@ -223,8 +230,8 @@ HYPRE_SStructGraphSetFEMSparsity( HYPRE_SStructGraph graph, fem_sparse_j = hypre_TAlloc(HYPRE_Int, nsparse, HYPRE_MEMORY_HOST); for (s = 0; s < nsparse; s++) { - fem_sparse_i[s] = sparsity[2*s]; - fem_sparse_j[s] = sparsity[2*s+1]; + fem_sparse_i[s] = sparsity[2 * s]; + fem_sparse_j[s] = sparsity[2 * s + 1]; } hypre_SStructGraphFEMPSparseI(graph, part) = fem_sparse_i; hypre_SStructGraphFEMPSparseJ(graph, part) = fem_sparse_j; @@ -253,15 +260,15 @@ HYPRE_SStructGraphAddEntries( HYPRE_SStructGraph graph, hypre_SStructGraphEntry **entries = hypre_SStructGraphEntries(graph); hypre_SStructGraphEntry *new_entry; - + HYPRE_Int n_entries = hypre_SStructNGraphEntries(graph); HYPRE_Int a_entries = hypre_SStructAGraphEntries(graph); - + /* check storage */ if (!a_entries) { a_entries = 1000; - entries = hypre_CTAlloc(hypre_SStructGraphEntry *, a_entries, HYPRE_MEMORY_HOST); + entries = hypre_TAlloc(hypre_SStructGraphEntry *, a_entries, HYPRE_MEMORY_HOST); hypre_SStructAGraphEntries(graph) = a_entries; hypre_SStructGraphEntries(graph) = entries; @@ -270,11 +277,11 @@ HYPRE_SStructGraphAddEntries( HYPRE_SStructGraph graph, { a_entries += 1000; entries = hypre_TReAlloc(entries, hypre_SStructGraphEntry *, a_entries, HYPRE_MEMORY_HOST); - + hypre_SStructAGraphEntries(graph) = a_entries; hypre_SStructGraphEntries(graph) = entries; } - + /*save parameters to a new entry */ new_entry = hypre_TAlloc(hypre_SStructGraphEntry, 1, HYPRE_MEMORY_HOST); @@ -288,7 +295,7 @@ HYPRE_SStructGraphAddEntries( HYPRE_SStructGraph graph, hypre_CopyToCleanIndex(index, ndim, hypre_SStructGraphEntryIndex(new_entry)); hypre_CopyToCleanIndex( to_index, ndim, hypre_SStructGraphEntryToIndex(new_entry)); - + entries[n_entries] = new_entry; /* update count */ @@ -340,7 +347,7 @@ HYPRE_SStructGraphAssemble( HYPRE_SStructGraph graph ) HYPRE_Int to_proc; HYPRE_BigInt Uverank, rank; hypre_BoxManEntry *boxman_entry; - + HYPRE_Int nprocs, myproc; HYPRE_Int part, var; hypre_IndexRef index; @@ -351,10 +358,10 @@ HYPRE_SStructGraphAssemble( HYPRE_SStructGraph graph ) hypre_BoxManager ***new_managers = NULL; hypre_BoxManager *orig_boxman; hypre_BoxManager *new_boxman; - + HYPRE_Int global_n_add_entries; HYPRE_Int is_gather, k; - + hypre_BoxManEntry *all_entries, *entry; HYPRE_Int num_entries; void *info; @@ -381,12 +388,12 @@ HYPRE_SStructGraphAssemble( HYPRE_SStructGraph graph ) *---------------------------------------------------------*/ new_box = hypre_BoxCreate(ndim); - + /* if any processor has added entries, then all need to participate */ hypre_MPI_Allreduce(&n_add_entries, &global_n_add_entries, 1, HYPRE_MPI_INT, hypre_MPI_SUM, comm); - + if (global_n_add_entries > 0 ) { /* create new managers */ @@ -397,19 +404,19 @@ HYPRE_SStructGraphAssemble( HYPRE_SStructGraph graph ) { pgrid = hypre_SStructGridPGrid(grid, part); nvars = hypre_SStructPGridNVars(pgrid); - + new_managers[part] = hypre_TAlloc(hypre_BoxManager *, nvars, HYPRE_MEMORY_HOST); new_gboxes[part] = hypre_TAlloc(hypre_Box *, nvars, HYPRE_MEMORY_HOST); - + for (var = 0; var < nvars; var++) { sgrid = hypre_SStructPGridSGrid(pgrid, var); - + orig_boxman = managers[part][var]; bbox = hypre_BoxManBoundingBox(orig_boxman); - - hypre_BoxManCreate(hypre_BoxManNEntries(orig_boxman), - hypre_BoxManEntryInfoSize(orig_boxman), + + hypre_BoxManCreate(hypre_BoxManNEntries(orig_boxman), + hypre_BoxManEntryInfoSize(orig_boxman), hypre_StructGridNDim(sgrid), bbox, hypre_StructGridComm(sgrid), &new_managers[part][var]); @@ -433,7 +440,7 @@ HYPRE_SStructGraphAssemble( HYPRE_SStructGraph graph ) /* check part, var, index, to_part, to_var, to_index */ for (k = 0; k < 2; k++) { - switch(k) + switch (k) { case 0: part = hypre_SStructGraphEntryPart(new_entry); @@ -450,11 +457,11 @@ HYPRE_SStructGraphAssemble( HYPRE_SStructGraph graph ) /* if the index is not within the bounds of the struct grid bounding box (which has been set in the box manager) then there should not be a coupling here (doesn't make sense) */ - + new_boxman = new_managers[part][var]; new_gbox = new_gboxes[part][var]; bbox = hypre_BoxManBoundingBox(new_boxman); - + if (hypre_IndexInBox(index, bbox) != 0) { /* compute new gather box extents based on index */ @@ -468,7 +475,7 @@ HYPRE_SStructGraphAssemble( HYPRE_SStructGraph graph ) } } } - + /* Now go through the managers and if gather has been called (on any processor) then populate the new manager with the entries from the old manager and then assemble and delete the old manager. */ @@ -476,7 +483,7 @@ HYPRE_SStructGraphAssemble( HYPRE_SStructGraph graph ) { pgrid = hypre_SStructGridPGrid(grid, part); nvars = hypre_SStructPGridNVars(pgrid); - + for (var = 0; var < nvars; var++) { new_boxman = new_managers[part][var]; @@ -494,17 +501,17 @@ HYPRE_SStructGraphAssemble( HYPRE_SStructGraph graph ) if (is_gather) { /* copy orig boxman information to the new boxman*/ - + orig_boxman = managers[part][var]; hypre_BoxManGetAllEntries(orig_boxman, &num_entries, &all_entries); - - for (j=0; j< num_entries; j++) + + for (j = 0; j < num_entries; j++) { entry = &all_entries[j]; - + hypre_BoxManEntryGetInfo(entry, &info); - + hypre_BoxManAddEntry(new_boxman, hypre_BoxManEntryIMin(entry), hypre_BoxManEntryIMax(entry), @@ -512,7 +519,7 @@ HYPRE_SStructGraphAssemble( HYPRE_SStructGraph graph ) hypre_BoxManEntryId(entry), info); } - + /* call assemble for new boxmanager*/ hypre_BoxManAssemble(new_boxman); @@ -522,7 +529,7 @@ HYPRE_SStructGraphAssemble( HYPRE_SStructGraph graph ) hypre_MPI_Comm_rank(comm, &myproc); hypre_printf("myid = %d, new_entries = %d, old entries = %d\n", myproc, hypre_BoxManNEntries(new_boxman), num_entries); } */ - + /* destroy old manager */ hypre_BoxManDestroy (managers[part][var]); } @@ -530,11 +537,11 @@ HYPRE_SStructGraphAssemble( HYPRE_SStructGraph graph ) { /*leave the old manager (so destroy the new one) */ hypre_BoxManDestroy(new_boxman); - + /*copy the old to the new */ new_managers[part][var] = managers[part][var]; } - + hypre_BoxDestroy(new_gboxes[part][var]); } /* end of var loop */ hypre_TFree(managers[part], HYPRE_MEMORY_HOST); @@ -542,7 +549,7 @@ HYPRE_SStructGraphAssemble( HYPRE_SStructGraph graph ) } /* end of part loop */ hypre_TFree(managers, HYPRE_MEMORY_HOST); hypre_TFree(new_gboxes, HYPRE_MEMORY_HOST); - + /* assign the new ones */ hypre_SStructGridBoxManagers(grid) = new_managers; } @@ -601,14 +608,14 @@ HYPRE_SStructGraphAssemble( HYPRE_SStructGraph graph ) for (j = 0; j < n_add_entries; j++) { new_entry = add_entries[j]; - + part = hypre_SStructGraphEntryPart(new_entry); var = hypre_SStructGraphEntryVar(new_entry); index = hypre_SStructGraphEntryIndex(new_entry); to_part = hypre_SStructGraphEntryToPart(new_entry) ; to_var = hypre_SStructGraphEntryToVar(new_entry); to_index = hypre_SStructGraphEntryToIndex(new_entry); - + /* compute location (rank) for Uventry */ hypre_SStructGraphGetUVEntryRank(graph, part, var, index, &Uverank); @@ -644,33 +651,26 @@ HYPRE_SStructGraphAssemble( HYPRE_SStructGraph graph ) hypre_SStructUVEntryToPart(Uventry, i) = to_part; hypre_CopyIndex(to_index, hypre_SStructUVEntryToIndex(Uventry, i)); hypre_SStructUVEntryToVar(Uventry, i) = to_var; - + hypre_SStructGridFindBoxManEntry( dom_grid, to_part, to_index, to_var, &boxman_entry); hypre_SStructBoxManEntryGetBoxnum(boxman_entry, &to_boxnum); hypre_SStructUVEntryToBoxnum(Uventry, i) = to_boxnum; hypre_SStructBoxManEntryGetProcess(boxman_entry, &to_proc); - hypre_SStructUVEntryToProc(Uventry, i)= to_proc; + hypre_SStructUVEntryToProc(Uventry, i) = to_proc; hypre_SStructBoxManEntryGetGlobalRank( - boxman_entry, to_index, &rank, type); + boxman_entry, to_index, &rank, type); hypre_SStructUVEntryToRank(Uventry, i) = rank; - + Uventries[Uverank] = Uventry; - + nUventries++; hypre_SStructGraphNUVEntries(graph) = nUventries; hypre_SStructGraphUVEntries(graph) = Uventries; } + } /* end of loop through add entries */ - /*free each add entry after copying */ - hypre_TFree(new_entry, HYPRE_MEMORY_HOST); - - }/* end of loop through add entries */ - - /* free the storage for the add entires */ - hypre_TFree(add_entries, HYPRE_MEMORY_HOST); - /*--------------------------------------------------------- * Set up the FEM stencil information *---------------------------------------------------------*/ @@ -724,8 +724,8 @@ HYPRE_SStructGraphAssemble( HYPRE_SStructGraph graph ) stencil_vars = hypre_CTAlloc(HYPRE_Int *, nvars, HYPRE_MEMORY_HOST); for (iv = 0; iv < nvars; iv++) { - stencil_offsets[iv] = hypre_CTAlloc(hypre_Index, fem_nvars*fem_nvars, HYPRE_MEMORY_HOST); - stencil_vars[iv] = hypre_CTAlloc(HYPRE_Int, fem_nvars*fem_nvars, HYPRE_MEMORY_HOST); + stencil_offsets[iv] = hypre_CTAlloc(hypre_Index, fem_nvars * fem_nvars, HYPRE_MEMORY_HOST); + stencil_vars[iv] = hypre_CTAlloc(HYPRE_Int, fem_nvars * fem_nvars, HYPRE_MEMORY_HOST); } for (s = 0; s < fem_nsparse; s++) @@ -761,7 +761,7 @@ HYPRE_SStructGraphAssemble( HYPRE_SStructGraph graph ) stencil_vars[iv][entry] = jv; stencil_sizes[iv]++; } - + fem_entries[s] = entry; } @@ -802,7 +802,7 @@ HYPRE_SStructGraphAssemble( HYPRE_SStructGraph graph ) j = 1; for (i = 1; i < nUventries; i++) { - if (iUventries[i] > iUventries[i-1]) + if (iUventries[i] > iUventries[i - 1]) { iUventries[j] = iUventries[i]; j++; @@ -826,3 +826,113 @@ HYPRE_SStructGraphSetObjectType( HYPRE_SStructGraph graph, return hypre_error_flag; } + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGraphPrint( FILE *file, HYPRE_SStructGraph graph ) +{ + HYPRE_Int type = hypre_SStructGraphObjectType(graph); + HYPRE_Int ndim = hypre_SStructGraphNDim(graph); + HYPRE_Int nentries = hypre_SStructNGraphEntries(graph); + hypre_SStructGraphEntry **entries = hypre_SStructGraphEntries(graph); + HYPRE_Int part, to_part; + HYPRE_Int var, to_var; + hypre_IndexRef index, to_index; + + HYPRE_Int i; + + /* Print auxiliary info */ + hypre_fprintf(file, "GraphSetObjectType: %d\n", type); + + /* Print SStructGraphEntry info */ + hypre_fprintf(file, "GraphNumEntries: %d", nentries); + for (i = 0; i < nentries; i++) + { + part = hypre_SStructGraphEntryPart(entries[i]); + var = hypre_SStructGraphEntryVar(entries[i]); + index = hypre_SStructGraphEntryIndex(entries[i]); + to_part = hypre_SStructGraphEntryToPart(entries[i]); + to_var = hypre_SStructGraphEntryToVar(entries[i]); + to_index = hypre_SStructGraphEntryToIndex(entries[i]); + + hypre_fprintf(file, "\nGraphAddEntries: %d %d ", part, var); + hypre_IndexPrint(file, ndim, index); + hypre_fprintf(file, " %d %d ", to_part, to_var); + hypre_IndexPrint(file, ndim, to_index); + } + hypre_fprintf(file, "\n"); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGraphRead( FILE *file, + HYPRE_SStructGrid grid, + HYPRE_SStructStencil **stencils, + HYPRE_SStructGraph *graph_ptr ) +{ + MPI_Comm comm = hypre_SStructGridComm(grid); + HYPRE_Int nparts = hypre_SStructGridNParts(grid); + HYPRE_Int ndim = hypre_SStructGridNDim(grid); + + HYPRE_SStructGraph graph; + hypre_SStructGraphEntry **entries; + hypre_SStructPGrid *pgrid; + HYPRE_Int nentries; + HYPRE_Int a_entries; + HYPRE_Int part, to_part; + HYPRE_Int var, to_var; + hypre_Index index, to_index; + + HYPRE_Int type; + HYPRE_Int nvars; + HYPRE_Int i; + + /* Create graph */ + HYPRE_SStructGraphCreate(comm, grid, &graph); + + /* Read auxiliary info */ + hypre_fscanf(file, "GraphSetObjectType: %d\n", &type); + HYPRE_SStructGraphSetObjectType(graph, type); + + /* Set stencils */ + for (part = 0; part < nparts; part++) + { + pgrid = hypre_SStructGridPGrid(grid, part); + nvars = hypre_SStructPGridNVars(pgrid); + + for (var = 0; var < nvars; var++) + { + HYPRE_SStructGraphSetStencil(graph, part, var, stencils[part][var]); + } + } + + /* TODO: HYPRE_SStructGraphSetFEM */ + /* TODO: HYPRE_SStructGraphSetFEMSparsity */ + + /* Read SStructGraphEntry info */ + hypre_fscanf(file, "GraphNumEntries: %d", &nentries); + a_entries = nentries + 1; + hypre_SStructAGraphEntries(graph) = a_entries; + entries = hypre_CTAlloc(hypre_SStructGraphEntry *, a_entries, HYPRE_MEMORY_HOST); + hypre_SStructGraphEntries(graph) = entries; + for (i = 0; i < nentries; i++) + { + hypre_fscanf(file, "\nGraphAddEntries: %d %d ", &part, &var); + hypre_IndexRead(file, ndim, index); + hypre_fscanf(file, " %d %d ", &to_part, &to_var); + hypre_IndexRead(file, ndim, to_index); + + HYPRE_SStructGraphAddEntries(graph, part, index, var, to_part, to_index, to_var); + } + hypre_fscanf(file, "\n"); + + *graph_ptr = graph; + + return hypre_error_flag; +} diff --git a/external/hypre/src/sstruct_mv/HYPRE_sstruct_grid.c b/external/hypre/src/sstruct_mv/HYPRE_sstruct_grid.c index c96e84b1..4a8bb826 100644 --- a/external/hypre/src/sstruct_mv/HYPRE_sstruct_grid.c +++ b/external/hypre/src/sstruct_mv/HYPRE_sstruct_grid.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -33,7 +33,7 @@ HYPRE_SStructGridCreate( MPI_Comm comm, HYPRE_Int *fem_nvars; HYPRE_Int **fem_vars; hypre_Index **fem_offsets; - HYPRE_Int num_ghost[2*HYPRE_MAXDIM]; + HYPRE_Int num_ghost[2 * HYPRE_MAXDIM]; HYPRE_Int i; grid = hypre_TAlloc(hypre_SStructGrid, 1, HYPRE_MEMORY_HOST); @@ -81,7 +81,7 @@ HYPRE_SStructGridCreate( MPI_Comm comm, hypre_SStructGridGhlocalSize(grid) = 0; /* Initialize num ghost */ - for (i = 0; i < 2*ndim; i++) + for (i = 0; i < 2 * ndim; i++) { num_ghost[i] = 1; } @@ -205,10 +205,11 @@ HYPRE_SStructGridSetExtents( HYPRE_SStructGrid grid, /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -HYPRE_Int HYPRE_SStructGridSetVariables( HYPRE_SStructGrid grid, - HYPRE_Int part, - HYPRE_Int nvars, - HYPRE_SStructVariable *vartypes ) +HYPRE_Int +HYPRE_SStructGridSetVariables( HYPRE_SStructGrid grid, + HYPRE_Int part, + HYPRE_Int nvars, + HYPRE_SStructVariable *vartypes ) { hypre_SStructPGrid *pgrid = hypre_SStructGridPGrid(grid, part); @@ -238,7 +239,7 @@ HYPRE_SStructGridAddVariables( HYPRE_SStructGrid grid, /* allocate more space if necessary */ if ((nucvars % memchunk) == 0) { - ucvars = hypre_TReAlloc(ucvars, hypre_SStructUCVar *, + ucvars = hypre_TReAlloc(ucvars, hypre_SStructUCVar *, (nucvars + memchunk), HYPRE_MEMORY_HOST); } @@ -305,7 +306,7 @@ HYPRE_SStructGridSetFEMOrdering( HYPRE_SStructGrid grid, if (ordering == NULL) { clean = 1; - ordering = hypre_TAlloc(HYPRE_Int, (1+ndim)*fem_nvars, HYPRE_MEMORY_HOST); + ordering = hypre_TAlloc(HYPRE_Int, (1 + ndim) * fem_nvars, HYPRE_MEMORY_HOST); j = 0; for (i = 0; i < nvars; i++) { @@ -318,17 +319,17 @@ HYPRE_SStructGridSetFEMOrdering( HYPRE_SStructGrid grid, loop[d] = 1; } } - for (off[2] = -loop[2]; off[2] <= loop[2]; off[2]+=2) + for (off[2] = -loop[2]; off[2] <= loop[2]; off[2] += 2) { - for (off[1] = -loop[1]; off[1] <= loop[1]; off[1]+=2) + for (off[1] = -loop[1]; off[1] <= loop[1]; off[1] += 2) { - for (off[0] = -loop[0]; off[0] <= loop[0]; off[0]+=2) + for (off[0] = -loop[0]; off[0] <= loop[0]; off[0] += 2) { - block = &ordering[(1+ndim)*j]; + block = &ordering[(1 + ndim) * j]; block[0] = i; for (d = 0; d < ndim; d++) { - block[1+d] = off[d]; + block[1 + d] = off[d]; } j++; } @@ -337,17 +338,20 @@ HYPRE_SStructGridSetFEMOrdering( HYPRE_SStructGrid grid, } } - fem_vars = hypre_TAlloc(HYPRE_Int, fem_nvars, HYPRE_MEMORY_HOST); - fem_offsets = hypre_TAlloc(hypre_Index, fem_nvars, HYPRE_MEMORY_HOST); + fem_vars = hypre_TReAlloc(hypre_SStructGridFEMPVars(grid, part), HYPRE_Int, fem_nvars, + HYPRE_MEMORY_HOST); + fem_offsets = hypre_TReAlloc(hypre_SStructGridFEMPOffsets(grid, part), hypre_Index, fem_nvars, + HYPRE_MEMORY_HOST); + for (i = 0; i < fem_nvars; i++) { - block = &ordering[(1+ndim)*i]; + block = &ordering[(1 + ndim) * i]; fem_vars[i] = block[0]; hypre_SetIndex(fem_offsets[i], 0); for (d = 0; d < ndim; d++) { /* modify the user offsets to contain only 0's and -1's */ - if (block[1+d] < 0) + if (block[1 + d] < 0) { hypre_IndexD(fem_offsets[i], d) = -1; } @@ -397,9 +401,9 @@ HYPRE_SStructGridSetNeighborPart( HYPRE_SStructGrid grid, /* allocate more memory if needed */ if ((nneighbors[part] % memchunk) == 0) { - neighbors[part] = hypre_TReAlloc(neighbors[part], hypre_SStructNeighbor, + neighbors[part] = hypre_TReAlloc(neighbors[part], hypre_SStructNeighbor, (nneighbors[part] + memchunk), HYPRE_MEMORY_HOST); - nbor_offsets[part] = hypre_TReAlloc(nbor_offsets[part], hypre_Index, + nbor_offsets[part] = hypre_TReAlloc(nbor_offsets[part], hypre_Index, (nneighbors[part] + memchunk), HYPRE_MEMORY_HOST); } @@ -490,9 +494,9 @@ HYPRE_SStructGridSetSharedPart( HYPRE_SStructGrid grid, /* allocate more memory if needed */ if ((nneighbors[part] % memchunk) == 0) { - neighbors[part] = hypre_TReAlloc(neighbors[part], hypre_SStructNeighbor, + neighbors[part] = hypre_TReAlloc(neighbors[part], hypre_SStructNeighbor, (nneighbors[part] + memchunk), HYPRE_MEMORY_HOST); - nbor_offsets[part] = hypre_TReAlloc(nbor_offsets[part], hypre_Index, + nbor_offsets[part] = hypre_TReAlloc(nbor_offsets[part], hypre_Index, (nneighbors[part] + memchunk), HYPRE_MEMORY_HOST); } @@ -539,7 +543,7 @@ HYPRE_SStructGridSetSharedPart( HYPRE_SStructGrid grid, /* Map the offset to the neighbor part and adjust ilower_mapped so that * NeighborILower is a direct mapping of NeighborBoxIMin. This allows us * to eliminate shared_offset. */ - offset_mapped[dd] = offset[d]*dir[d]; + offset_mapped[dd] = offset[d] * dir[d]; if (offset_mapped[dd] != shared_offset[dd]) { hypre_IndexD(ilower_mapped, dd) -= offset_mapped[dd]; @@ -630,7 +634,7 @@ HYPRE_SStructGridAssemble( HYPRE_SStructGrid grid ) * actually live anywhere on the global grid. * * This is not an issue for cell-centered variables. - */ + */ for (part = 0; part < nparts; part++) { @@ -657,7 +661,7 @@ HYPRE_SStructGridAssemble( HYPRE_SStructGrid grid ) { hypre_SStructPGridAssemble(pgrids[part]); } - + /*------------------------------------------------------------- * re-organize u-variables to reference via local cell rank *-------------------------------------------------------------*/ @@ -787,7 +791,8 @@ HYPRE_SStructGridAssemble( HYPRE_SStructGrid grid ) } /* Set up vneighbors for this (part, var) */ - vneighbors[part][var] = hypre_TAlloc(hypre_SStructNeighbor, nvneighbors[part][var], HYPRE_MEMORY_HOST); + vneighbors[part][var] = hypre_TAlloc(hypre_SStructNeighbor, nvneighbors[part][var], + HYPRE_MEMORY_HOST); vb = 0; for (b = 0; b < nneighbors[part]; b++) { @@ -875,10 +880,9 @@ HYPRE_SStructGridSetPeriodic( HYPRE_SStructGrid grid, HYPRE_Int HYPRE_SStructGridSetNumGhost( HYPRE_SStructGrid grid, - HYPRE_Int *num_ghost) + HYPRE_Int *num_ghost) { hypre_SStructGridSetNumGhost(grid, num_ghost); return hypre_error_flag; } - diff --git a/external/hypre/src/sstruct_mv/HYPRE_sstruct_matrix.c b/external/hypre/src/sstruct_mv/HYPRE_sstruct_matrix.c index 374bbc58..95333674 100644 --- a/external/hypre/src/sstruct_mv/HYPRE_sstruct_matrix.c +++ b/external/hypre/src/sstruct_mv/HYPRE_sstruct_matrix.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -161,9 +161,12 @@ HYPRE_SStructMatrixDestroy( HYPRE_SStructMatrix matrix ) hypre_SStructPGrid *pgrid; HYPRE_Int nvars; HYPRE_Int part, var; + HYPRE_MemoryLocation memory_location; if (matrix) { + memory_location = hypre_SStructMatrixMemoryLocation(matrix); + hypre_SStructMatrixRefCount(matrix) --; if (hypre_SStructMatrixRefCount(matrix) == 0) { @@ -194,10 +197,10 @@ HYPRE_SStructMatrixDestroy( HYPRE_SStructMatrix matrix ) hypre_TFree(hypre_SStructMatrixUEntries(matrix), HYPRE_MEMORY_HOST); hypre_TFree(hypre_SStructMatrixTmpRowCoords(matrix), HYPRE_MEMORY_HOST); hypre_TFree(hypre_SStructMatrixTmpColCoords(matrix), HYPRE_MEMORY_HOST); - hypre_TFree(hypre_SStructMatrixTmpCoeffs(matrix), HYPRE_MEMORY_HOST); - hypre_TFree(hypre_SStructMatrixTmpRowCoordsDevice(matrix), HYPRE_MEMORY_DEVICE); - hypre_TFree(hypre_SStructMatrixTmpColCoordsDevice(matrix), HYPRE_MEMORY_DEVICE); - hypre_TFree(hypre_SStructMatrixTmpCoeffsDevice(matrix), HYPRE_MEMORY_DEVICE); + hypre_TFree(hypre_SStructMatrixTmpCoeffs(matrix), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_SStructMatrixTmpRowCoordsDevice(matrix), memory_location); + hypre_TFree(hypre_SStructMatrixTmpColCoordsDevice(matrix), memory_location); + hypre_TFree(hypre_SStructMatrixTmpCoeffsDevice(matrix), memory_location); hypre_TFree(matrix, HYPRE_MEMORY_HOST); } } @@ -234,7 +237,7 @@ HYPRE_SStructMatrixInitialize( HYPRE_SStructMatrix matrix ) /* GEC0902 addition of variables for ilower and iupper */ MPI_Comm comm; hypre_SStructGrid *grid, *domain_grid; - HYPRE_Int ilower, iupper, jlower, jupper; + HYPRE_BigInt ilower, iupper, jlower, jupper; HYPRE_Int matrix_type = hypre_SStructMatrixObjectType(matrix); /* S-matrix */ @@ -292,20 +295,24 @@ HYPRE_SStructMatrixInitialize( HYPRE_SStructMatrix matrix ) domain_grid = hypre_SStructGraphDomainGrid(graph); comm = hypre_SStructMatrixComm(matrix); - if(matrix_type == HYPRE_PARCSR) + if (matrix_type == HYPRE_PARCSR) { - ilower = hypre_SStructGridStartRank(grid); - iupper = ilower + hypre_SStructGridLocalSize(grid) - 1; - jlower = hypre_SStructGridStartRank(domain_grid); - jupper = jlower + hypre_SStructGridLocalSize(domain_grid) - 1; + ilower = hypre_SStructGridStartRank(grid); + iupper = ilower + hypre_SStructGridLocalSize(grid) - 1; + jlower = hypre_SStructGridStartRank(domain_grid); + jupper = jlower + hypre_SStructGridLocalSize(domain_grid) - 1; } - - if(matrix_type == HYPRE_SSTRUCT || matrix_type == HYPRE_STRUCT) + else if (matrix_type == HYPRE_SSTRUCT || matrix_type == HYPRE_STRUCT) + { + ilower = hypre_SStructGridGhstartRank(grid); + iupper = ilower + hypre_SStructGridGhlocalSize(grid) - 1; + jlower = hypre_SStructGridGhstartRank(domain_grid); + jupper = jlower + hypre_SStructGridGhlocalSize(domain_grid) - 1; + } + else { - ilower = hypre_SStructGridGhstartRank(grid); - iupper = ilower + hypre_SStructGridGhlocalSize(grid) - 1; - jlower = hypre_SStructGridGhstartRank(domain_grid); - jupper = jlower + hypre_SStructGridGhlocalSize(domain_grid) - 1; + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Invalid matrix type!\n"); + return hypre_error_flag; } HYPRE_IJMatrixCreate(comm, ilower, iupper, jlower, jupper, @@ -316,6 +323,20 @@ HYPRE_SStructMatrixInitialize( HYPRE_SStructMatrix matrix ) return hypre_error_flag; } +HYPRE_Int +HYPRE_SStructMatrixSetEarlyAssemble( HYPRE_SStructMatrix matrix, + HYPRE_Int early_assemble ) +{ + HYPRE_IJMatrix ijmatrix = hypre_SStructMatrixIJMatrix(matrix); + + if (ijmatrix) + { + HYPRE_IJMatrixSetEarlyAssemble(ijmatrix, early_assemble); + } + + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ @@ -355,7 +376,7 @@ HYPRE_SStructMatrixAddToValues( HYPRE_SStructMatrix matrix, /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -/* ONLY3D */ +/* ONLY3D - RDF: Why? */ HYPRE_Int HYPRE_SStructMatrixAddFEMValues( HYPRE_SStructMatrix matrix, @@ -371,8 +392,9 @@ HYPRE_SStructMatrixAddFEMValues( HYPRE_SStructMatrix matrix, HYPRE_Int *fem_entries = hypre_SStructGraphFEMPEntries(graph, part); HYPRE_Int *fem_vars = hypre_SStructGridFEMPVars(grid, part); hypre_Index *fem_offsets = hypre_SStructGridFEMPOffsets(grid, part); - HYPRE_Int s, i, d, vindex[3]; + HYPRE_Int s, i, d, vindex[HYPRE_MAXDIM]; + /* Set one coefficient at a time */ for (s = 0; s < fem_nsparse; s++) { i = fem_sparse_i[s]; @@ -409,7 +431,7 @@ HYPRE_SStructMatrixGetValues( HYPRE_SStructMatrix matrix, /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -/* ONLY3D */ +/* ONLY3D - RDF: Why? */ HYPRE_Int HYPRE_SStructMatrixGetFEMValues( HYPRE_SStructMatrix matrix, @@ -425,7 +447,7 @@ HYPRE_SStructMatrixGetFEMValues( HYPRE_SStructMatrix matrix, HYPRE_Int *fem_entries = hypre_SStructGraphFEMPEntries(graph, part); HYPRE_Int *fem_vars = hypre_SStructGridFEMPVars(grid, part); hypre_Index *fem_offsets = hypre_SStructGridFEMPOffsets(grid, part); - HYPRE_Int s, i, d, vindex[3]; + HYPRE_Int s, i, d, vindex[HYPRE_MAXDIM]; for (s = 0; s < fem_nsparse; s++) { @@ -616,6 +638,75 @@ HYPRE_SStructMatrixGetBoxValues2( HYPRE_SStructMatrix matrix, return hypre_error_flag; } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixAddFEMBoxValues(HYPRE_SStructMatrix matrix, + HYPRE_Int part, + HYPRE_Int *ilower, + HYPRE_Int *iupper, + HYPRE_Complex *values) +{ + HYPRE_Int ndim = hypre_SStructMatrixNDim(matrix); + hypre_SStructGraph *graph = hypre_SStructMatrixGraph(matrix); + hypre_SStructGrid *grid = hypre_SStructGraphGrid(graph); + HYPRE_MemoryLocation memory_location = hypre_SStructMatrixMemoryLocation(matrix); + + HYPRE_Int fem_nsparse = hypre_SStructGraphFEMPNSparse(graph, part); + HYPRE_Int *fem_sparse_i = hypre_SStructGraphFEMPSparseI(graph, part); + HYPRE_Int *fem_entries = hypre_SStructGraphFEMPEntries(graph, part); + HYPRE_Int *fem_vars = hypre_SStructGridFEMPVars(grid, part); + hypre_Index *fem_offsets = hypre_SStructGridFEMPOffsets(grid, part); + + HYPRE_Complex *tvalues; + hypre_Box *box; + + HYPRE_Int s, i, d, vilower[HYPRE_MAXDIM], viupper[HYPRE_MAXDIM]; + HYPRE_Int ei, vi, nelts; + + /* Set one coefficient at a time */ + box = hypre_BoxCreate(ndim); + hypre_BoxSetExtents(box, ilower, iupper); + nelts = hypre_BoxVolume(box); + tvalues = hypre_TAlloc(HYPRE_Complex, nelts, memory_location); + + for (s = 0; s < fem_nsparse; s++) + { + i = fem_sparse_i[s]; + for (d = 0; d < ndim; d++) + { + /* note: these offsets are different from what the user passes in */ + vilower[d] = ilower[d] + hypre_IndexD(fem_offsets[i], d); + viupper[d] = iupper[d] + hypre_IndexD(fem_offsets[i], d); + } + +#if defined(HYPRE_USING_GPU) + if (hypre_GetExecPolicy1(memory_location) == HYPRE_EXEC_DEVICE) + { + hypreDevice_ComplexStridedCopy(nelts, fem_nsparse, values + s, tvalues); + } + else +#endif + { + for (ei = 0, vi = s; ei < nelts; ei ++, vi += fem_nsparse) + { + tvalues[ei] = values[vi]; + } + } + + HYPRE_SStructMatrixAddToBoxValues(matrix, part, vilower, viupper, + fem_vars[i], 1, &fem_entries[s], + tvalues); + } + + /* Free memory */ + hypre_TFree(tvalues, memory_location); + hypre_BoxDestroy(box); + + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ @@ -667,9 +758,9 @@ HYPRE_SStructMatrixAssemble( HYPRE_SStructMatrix matrix ) recv_var = hypre_SStructCommInfoRecvVar(vnbor_comm_info[ci]); send_matrix = hypre_SStructPMatrixSMatrix( - hypre_SStructMatrixPMatrix(matrix, send_part), send_var, send_var); + hypre_SStructMatrixPMatrix(matrix, send_part), send_var, send_var); recv_matrix = hypre_SStructPMatrixSMatrix( - hypre_SStructMatrixPMatrix(matrix, recv_part), recv_var, recv_var); + hypre_SStructMatrixPMatrix(matrix, recv_part), recv_var, recv_var); if ((send_matrix != NULL) && (recv_matrix != NULL)) { @@ -913,13 +1004,21 @@ HYPRE_SStructMatrixGetObject( HYPRE_SStructMatrix matrix, var = 0; pmatrix = hypre_SStructMatrixPMatrix(matrix, part); smatrix = hypre_SStructPMatrixSMatrix(pmatrix, var, var); - *object = smatrix; + *object = smatrix; } return hypre_error_flag; } /*-------------------------------------------------------------------------- + * HYPRE_SStructMatrixPrint + * + * This function prints a SStructMatrix to file. Assumptions: + * + * 1) All StructMatrices have the same number of ghost layers. + * 2) Range and domain num_ghosts are equal. + * + * TODO: Add GPU support *--------------------------------------------------------------------------*/ HYPRE_Int @@ -927,25 +1026,305 @@ HYPRE_SStructMatrixPrint( const char *filename, HYPRE_SStructMatrix matrix, HYPRE_Int all ) { - HYPRE_Int nparts = hypre_SStructMatrixNParts(matrix); - HYPRE_Int part; - char new_filename[255]; + /* Matrix variables */ + MPI_Comm comm = hypre_SStructMatrixComm(matrix); + HYPRE_Int nparts = hypre_SStructMatrixNParts(matrix); + hypre_SStructGraph *graph = hypre_SStructMatrixGraph(matrix); + hypre_SStructGrid *grid = hypre_SStructGraphGrid(graph); + hypre_SStructStencil ***stencils = hypre_SStructGraphStencils(graph); + hypre_SStructPMatrix *pmatrix; + hypre_StructMatrix *smatrix; + HYPRE_Int data_size; + + /* Local variables */ + FILE *file; + HYPRE_Int myid; + HYPRE_Int part; + HYPRE_Int var, vi, vj, nvars; + HYPRE_Int num_symm_calls; + char new_filename[255]; + + /* Sanity check */ + hypre_assert(nparts > 0); + + /* Print auxiliary info */ + hypre_MPI_Comm_rank(comm, &myid); + hypre_sprintf(new_filename, "%s.SMatrix.%05d", filename, myid); + if ((file = fopen(new_filename, "w")) == NULL) + { + hypre_printf("Error: can't open output file %s\n", new_filename); + hypre_error_in_arg(1); + return hypre_error_flag; + } + + /* Print grid info */ + hypre_fprintf(file, "SStructMatrix\n"); + hypre_SStructGridPrint(file, grid); + + /* Print stencil info */ for (part = 0; part < nparts; part++) { - hypre_sprintf(new_filename, "%s.%02d", filename, part); - hypre_SStructPMatrixPrint(new_filename, - hypre_SStructMatrixPMatrix(matrix, part), - all); + pmatrix = hypre_SStructMatrixPMatrix(matrix, part); + nvars = hypre_SStructPMatrixNVars(pmatrix); + + for (var = 0; var < nvars; var++) + { + hypre_fprintf(file, "\nStencil - (Part %d, Var %d):\n", part, var); + HYPRE_SStructStencilPrint(file, stencils[part][var]); + } } + hypre_fprintf(file, "\n"); - /* U-matrix */ + /* Print graph info */ + HYPRE_SStructGraphPrint(file, graph); + + /* Print symmetric info */ + num_symm_calls = 0; + for (part = 0; part < nparts; part++) + { + pmatrix = hypre_SStructMatrixPMatrix(matrix, part); + nvars = hypre_SStructPMatrixNVars(pmatrix); + + for (vi = 0; vi < nvars; vi++) + { + for (vj = 0; vj < nvars; vj++) + { + smatrix = hypre_SStructPMatrixSMatrix(pmatrix, vi, vj); + if (smatrix) + { + num_symm_calls++; + } + } + } + } + hypre_fprintf(file, "\nMatrixNumSetSymmetric: %d", num_symm_calls); + for (part = 0; part < nparts; part++) + { + pmatrix = hypre_SStructMatrixPMatrix(matrix, part); + nvars = hypre_SStructPMatrixNVars(pmatrix); + + for (vi = 0; vi < nvars; vi++) + { + for (vj = 0; vj < nvars; vj++) + { + smatrix = hypre_SStructPMatrixSMatrix(pmatrix, vi, vj); + if (smatrix) + { + hypre_fprintf(file, "\nMatrixSetSymmetric: %d %d %d %d", + part, vi, vj, hypre_StructMatrixSymmetric(smatrix)); + } + } + } + } + hypre_fprintf(file, "\n"); + + /* Print data */ + for (part = 0; part < nparts; part++) + { + pmatrix = hypre_SStructMatrixPMatrix(matrix, part); + nvars = hypre_SStructPMatrixNVars(pmatrix); + + for (vi = 0; vi < nvars; vi++) + { + for (vj = 0; vj < nvars; vj++) + { + smatrix = hypre_SStructPMatrixSMatrix(pmatrix, vi, vj); + data_size = (smatrix) ? hypre_StructMatrixDataSize(smatrix) : 0; + + hypre_fprintf(file, "\nData - (Part %d, Vi %d, Vj %d): %d\n", + part, vi, vj, data_size); + if (smatrix) + { + hypre_StructMatrixPrintData(file, smatrix, all); + } + } + } + } + fclose(file); + + /* Print unstructured matrix (U-Matrix) */ hypre_sprintf(new_filename, "%s.UMatrix", filename); HYPRE_IJMatrixPrint(hypre_SStructMatrixIJMatrix(matrix), new_filename); return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * HYPRE_SStructMatrixRead + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixRead( MPI_Comm comm, + const char *filename, + HYPRE_SStructMatrix *matrix_ptr ) +{ + /* Matrix variables */ + HYPRE_SStructMatrix matrix; + hypre_SStructPMatrix *pmatrix; + hypre_StructMatrix *smatrix; + HYPRE_SStructGrid grid; + hypre_SStructPGrid *pgrid; + HYPRE_SStructGraph graph; + HYPRE_SStructStencil **stencils; + HYPRE_Int nparts; + HYPRE_Int nvars; + HYPRE_Int data_size; + HYPRE_IJMatrix umatrix; + HYPRE_IJMatrix h_umatrix; + hypre_ParCSRMatrix *h_parmatrix; + hypre_ParCSRMatrix *parmatrix = NULL; + + /* Local variables */ + FILE *file; + HYPRE_Int myid; + HYPRE_Int part, var; + HYPRE_Int p, v, i, j, vi, vj; + HYPRE_Int symmetric; + HYPRE_Int num_symm_calls; + char new_filename[255]; + + HYPRE_MemoryLocation memory_location = hypre_HandleMemoryLocation(hypre_handle()); + + hypre_MPI_Comm_rank(comm, &myid); + + /*----------------------------------------------------------- + * Read S-Matrix + *-----------------------------------------------------------*/ + + hypre_sprintf(new_filename, "%s.SMatrix.%05d", filename, myid); + if ((file = fopen(new_filename, "r")) == NULL) + { + hypre_printf("Error: can't open input file %s\n", new_filename); + hypre_error_in_arg(2); + + return hypre_error_flag; + } + + /* Read grid info */ + hypre_fscanf(file, "SStructMatrix\n"); + hypre_SStructGridRead(comm, file, &grid); + nparts = hypre_SStructGridNParts(grid); + + /* Read stencil info */ + stencils = hypre_TAlloc(HYPRE_SStructStencil *, nparts, HYPRE_MEMORY_HOST); + for (p = 0; p < nparts; p++) + { + pgrid = hypre_SStructGridPGrid(grid, p); + nvars = hypre_SStructPGridNVars(pgrid); + + stencils[p] = hypre_TAlloc(HYPRE_SStructStencil, nvars, HYPRE_MEMORY_HOST); + for (v = 0; v < nvars; v++) + { + hypre_fscanf(file, "\nStencil - (Part %d, Var %d):\n", &part, &var); + HYPRE_SStructStencilRead(file, &stencils[part][var]); + } + } + hypre_fscanf(file, "\n"); + + /* Read graph info */ + HYPRE_SStructGraphRead(file, grid, stencils, &graph); + + /* Free memory */ + for (part = 0; part < nparts; part++) + { + pgrid = hypre_SStructGridPGrid(grid, part); + nvars = hypre_SStructPGridNVars(pgrid); + + for (var = 0; var < nvars; var++) + { + HYPRE_SStructStencilDestroy(stencils[part][var]); + } + hypre_TFree(stencils[part], HYPRE_MEMORY_HOST); + } + hypre_TFree(stencils, HYPRE_MEMORY_HOST); + + /* Assemble graph */ + HYPRE_SStructGraphAssemble(graph); + + /* Create matrix */ + HYPRE_SStructMatrixCreate(comm, graph, &matrix); + + /* Read symmetric info */ + hypre_fscanf(file, "\nMatrixNumSetSymmetric: %d", &num_symm_calls); + for (i = 0; i < num_symm_calls; i++) + { + hypre_fscanf(file, "\nMatrixSetSymmetric: %d %d %d %d", + &part, &vi, &vj, &symmetric); + HYPRE_SStructMatrixSetSymmetric(matrix, part, vi, vj, symmetric); + } + hypre_fscanf(file, "\n"); + + /* Initialize matrix */ + HYPRE_SStructMatrixInitialize(matrix); + + /* Read data */ + for (p = 0; p < nparts; p++) + { + pmatrix = hypre_SStructMatrixPMatrix(matrix, p); + nvars = hypre_SStructPMatrixNVars(pmatrix); + + for (i = 0; i < nvars; i++) + { + for (j = 0; j < nvars; j++) + { + hypre_fscanf(file, "\nData - (Part %d, Vi %d, Vj %d): %d\n", + &part, &vi, &vj, &data_size); + + pmatrix = hypre_SStructMatrixPMatrix(matrix, part); + smatrix = hypre_SStructPMatrixSMatrix(pmatrix, vi, vj); + if (data_size > 0) + { + hypre_StructMatrixReadData(file, smatrix); + } + } + } + } + fclose(file); + + /*----------------------------------------------------------- + * Read U-Matrix + *-----------------------------------------------------------*/ + + /* Read unstructured matrix from file using host memory */ + hypre_sprintf(new_filename, "%s.UMatrix", filename); + HYPRE_IJMatrixRead(new_filename, comm, HYPRE_PARCSR, &h_umatrix); + h_parmatrix = (hypre_ParCSRMatrix*) hypre_IJMatrixObject(h_umatrix); + + /* Move ParCSRMatrix to device memory if necessary */ + if (hypre_GetActualMemLocation(memory_location) != hypre_MEMORY_HOST) + { + parmatrix = hypre_ParCSRMatrixClone_v2(h_parmatrix, 1, memory_location); + } + else + { + parmatrix = h_parmatrix; + hypre_IJMatrixObject(h_umatrix) = NULL; + } + + /* Free memory */ + HYPRE_IJMatrixDestroy(h_umatrix); + + /* Update the umatrix with contents read from file, + which now live on the correct memory location */ + umatrix = hypre_SStructMatrixIJMatrix(matrix); + hypre_IJMatrixDestroyParCSR(umatrix); + hypre_IJMatrixObject(umatrix) = (void*) parmatrix; + hypre_SStructMatrixParCSRMatrix(matrix) = (hypre_ParCSRMatrix*) parmatrix; + hypre_IJMatrixAssembleFlag(umatrix) = 1; + + /* Assemble SStructMatrix */ + HYPRE_SStructMatrixAssemble(matrix); + + /* Decrease ref counters */ + HYPRE_SStructGraphDestroy(graph); + HYPRE_SStructGridDestroy(grid); + + *matrix_ptr = matrix; + + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ @@ -960,4 +1339,3 @@ HYPRE_SStructMatrixMatvec( HYPRE_Complex alpha, return hypre_error_flag; } - diff --git a/external/hypre/src/sstruct_mv/HYPRE_sstruct_mv.h b/external/hypre/src/sstruct_mv/HYPRE_sstruct_mv.h index a4ae419a..79222f81 100644 --- a/external/hypre/src/sstruct_mv/HYPRE_sstruct_mv.h +++ b/external/hypre/src/sstruct_mv/HYPRE_sstruct_mv.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -23,10 +23,8 @@ extern "C" { /** * @defgroup SStructSystemInterface SStruct System Interface * - * This interface represents a semi-structured-grid conceptual view of a linear - * system. - * - * @memo A semi-structured-grid conceptual interface + * A semi-structured-grid conceptual interface. This interface represents a + * semi-structured-grid conceptual view of a linear system. * * @{ **/ @@ -187,7 +185,7 @@ HYPRE_SStructGridSetFEMOrdering(HYPRE_SStructGrid grid, * Indexes should increase from \e ilower to \e iupper. It is not * necessary that indexes increase from \e nbor_ilower to \e * nbor_iupper. - * + * * The \e index_map describes the mapping of indexes 0, 1, and 2 on part * \e part to the corresponding indexes on part \e nbor_part. For * example, triple (1, 2, 0) means that indexes 0, 1, and 2 on part \e part @@ -249,7 +247,7 @@ HYPRE_SStructGridSetNeighborPart(HYPRE_SStructGrid grid, * The \e shared_offset is used in the same way as \e offset, but with * respect to the box extents \e shared_ilower and \e shared_iupper on * part \e shared_part. - * + * * The \e index_map describes the mapping of indexes 0, 1, and 2 on part * \e part to the corresponding indexes on part \e shared_part. For * example, triple (1, 2, 0) means that indexes 0, 1, and 2 on part \e part @@ -467,7 +465,7 @@ HYPRE_SStructGraphAssemble(HYPRE_SStructGraph graph); /** * Set the storage type of the associated matrix object. It is used before * AddEntries and Assemble to compute the right ranks in the graph. - * + * * NOTE: This routine is only necessary for implementation reasons, and will * eventually be removed. * @@ -513,6 +511,17 @@ HYPRE_SStructMatrixDestroy(HYPRE_SStructMatrix matrix); HYPRE_Int HYPRE_SStructMatrixInitialize(HYPRE_SStructMatrix matrix); +/** + * (Optional, GPU only) Sets if the matrix assemble routine does reductions + * of the IJ part before calling HYPRE_SStructMatrixAssemble. + * See also the comments of HYPRE_IJMatrixSetEarlyAssemble. + * This early assemble feature may save the peak memory usage but requires + * extra work. + **/ +HYPRE_Int +HYPRE_SStructMatrixSetEarlyAssemble( HYPRE_SStructMatrix matrix, + HYPRE_Int early_assemble ); + /** * Set matrix coefficients index by index. The \e values array is of length * \e nentries. @@ -562,9 +571,11 @@ HYPRE_SStructMatrixAddToValues(HYPRE_SStructMatrix matrix, /** * Add finite element stiffness matrix coefficients index by index. The layout - * of the data in \e values is determined by the routines - * \ref HYPRE_SStructGridSetFEMOrdering and - * \ref HYPRE_SStructGraphSetFEMSparsity. + * of the data in \e values is determined by the routines \ref + * HYPRE_SStructGridSetFEMOrdering and \ref HYPRE_SStructGraphSetFEMSparsity. + * + * NOTE: For better efficiency, use \ref HYPRE_SStructMatrixAddFEMBoxValues to + * set coefficients a box at a time. **/ HYPRE_Int HYPRE_SStructMatrixAddFEMValues(HYPRE_SStructMatrix matrix, @@ -696,6 +707,20 @@ HYPRE_SStructMatrixAddToBoxValues2(HYPRE_SStructMatrix matrix, HYPRE_Int *viupper, HYPRE_Complex *values); +/** + * Add finite element stiffness matrix coefficients a box at a time. The data + * in \e values is organized as an array of element matrices ordered as in \ref + * HYPRE_SStructMatrixSetBoxValues. The layout of the data entries of each + * element matrix is determined by the routines \ref + * HYPRE_SStructGridSetFEMOrdering and \ref HYPRE_SStructGraphSetFEMSparsity. + **/ +HYPRE_Int +HYPRE_SStructMatrixAddFEMBoxValues(HYPRE_SStructMatrix matrix, + HYPRE_Int part, + HYPRE_Int *ilower, + HYPRE_Int *iupper, + HYPRE_Complex *values); + /** * Finalize the construction of the matrix before using. **/ @@ -737,6 +762,16 @@ HYPRE_SStructMatrixGetBoxValues2(HYPRE_SStructMatrix matrix, HYPRE_Int *viupper, HYPRE_Complex *values); +/** + * Does this even make sense to implement? + */ +HYPRE_Int +HYPRE_SStructMatrixGetFEMBoxValues(HYPRE_SStructMatrix matrix, + HYPRE_Int part, + HYPRE_Int *ilower, + HYPRE_Int *iupper, + HYPRE_Complex *values); + /** * Define symmetry properties for the stencil entries in the matrix. The * boolean argument \e symmetric is applied to stencil entries on part \e @@ -745,7 +780,7 @@ HYPRE_SStructMatrixGetBoxValues2(HYPRE_SStructMatrix matrix, * "all". For example, if \e part and \e to_var are set to -1, then * the boolean is applied to stencil entries on all parts that couple variable * \e var to all other variables. - * + * * By default, matrices are assumed to be nonsymmetric. Significant * storage savings can be made if the matrix is symmetric. **/ @@ -791,6 +826,14 @@ HYPRE_SStructMatrixPrint(const char *filename, HYPRE_SStructMatrix matrix, HYPRE_Int all); +/** + * Read the matrix from file. This is mainly for debugging purposes. + **/ +HYPRE_Int +HYPRE_SStructMatrixRead( MPI_Comm comm, + const char *filename, + HYPRE_SStructMatrix *matrix_ptr ); + /**@}*/ /*-------------------------------------------------------------------------- @@ -864,6 +907,9 @@ HYPRE_SStructVectorAddToValues(HYPRE_SStructVector vector, * Add finite element vector coefficients index by index. The layout of the * data in \e values is determined by the routine * \ref HYPRE_SStructGridSetFEMOrdering. + * + * NOTE: For better efficiency, use \ref HYPRE_SStructVectorAddFEMBoxValues to + * set coefficients a box at a time. **/ HYPRE_Int HYPRE_SStructVectorAddFEMValues(HYPRE_SStructVector vector, @@ -974,6 +1020,20 @@ HYPRE_SStructVectorAddToBoxValues2(HYPRE_SStructVector vector, HYPRE_Int *viupper, HYPRE_Complex *values); +/** + * Add finite element vector coefficients a box at a time. The data in \e + * values is organized as an array of element vectors ordered as in \ref + * HYPRE_SStructVectorSetBoxValues. The layout of the data entries of each + * element vector is determined by the routine \ref + * HYPRE_SStructGridSetFEMOrdering. + **/ +HYPRE_Int +HYPRE_SStructVectorAddFEMBoxValues(HYPRE_SStructVector vector, + HYPRE_Int part, + HYPRE_Int *ilower, + HYPRE_Int *iupper, + HYPRE_Complex *values); + /** * Finalize the construction of the vector before using. **/ @@ -1011,6 +1071,16 @@ HYPRE_SStructVectorGetBoxValues2(HYPRE_SStructVector vector, HYPRE_Int *viupper, HYPRE_Complex *values); +/** + * Does this even make sense to implement? + */ +HYPRE_Int +HYPRE_SStructVectorGetFEMBoxValues(HYPRE_SStructVector vector, + HYPRE_Int part, + HYPRE_Int *ilower, + HYPRE_Int *iupper, + HYPRE_Complex *values); + /** * Gather vector data so that efficient \c GetValues can be done. This * routine must be called prior to calling \c GetValues to ensure that @@ -1048,6 +1118,14 @@ HYPRE_SStructVectorPrint(const char *filename, HYPRE_SStructVector vector, HYPRE_Int all); +/** + * Read the vector from file. This is mainly for debugging purposes. + **/ +HYPRE_Int +HYPRE_SStructVectorRead( MPI_Comm comm, + const char *filename, + HYPRE_SStructVector *vector_ptr ); + /**@}*/ /**@}*/ @@ -1059,4 +1137,3 @@ HYPRE_SStructVectorPrint(const char *filename, #endif #endif - diff --git a/external/hypre/src/sstruct_mv/HYPRE_sstruct_stencil.c b/external/hypre/src/sstruct_mv/HYPRE_sstruct_stencil.c index ea7c0c27..54155865 100644 --- a/external/hypre/src/sstruct_mv/HYPRE_sstruct_stencil.c +++ b/external/hypre/src/sstruct_mv/HYPRE_sstruct_stencil.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -75,4 +75,56 @@ HYPRE_SStructStencilSetEntry( HYPRE_SStructStencil stencil, return hypre_error_flag; } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructStencilPrint( FILE *file, HYPRE_SStructStencil stencil ) +{ + HYPRE_Int ndim = hypre_SStructStencilNDim(stencil); + HYPRE_Int *vars = hypre_SStructStencilVars(stencil); + hypre_Index *shape = hypre_SStructStencilShape(stencil); + HYPRE_Int size = hypre_SStructStencilSize(stencil); + + HYPRE_Int i; + + hypre_fprintf(file, "StencilCreate: %d %d", ndim, size); + for (i = 0; i < size; i++) + { + hypre_fprintf(file, "\nStencilSetEntry: %d %d ", i, vars[i]); + hypre_IndexPrint(file, ndim, shape[i]); + } + hypre_fprintf(file, "\n"); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructStencilRead( FILE *file, HYPRE_SStructStencil *stencil_ptr ) +{ + HYPRE_SStructStencil stencil; + + HYPRE_Int var; + hypre_Index shape; + HYPRE_Int i, ndim; + HYPRE_Int entry, size; + + hypre_fscanf(file, "StencilCreate: %d %d", &ndim, &size); + HYPRE_SStructStencilCreate(ndim, size, &stencil); + + for (i = 0; i < size; i++) + { + hypre_fscanf(file, "\nStencilSetEntry: %d %d ", &entry, &var); + hypre_IndexRead(file, ndim, shape); + + HYPRE_SStructStencilSetEntry(stencil, entry, shape, var); + } + hypre_fscanf(file, "\n"); + *stencil_ptr = stencil; + + return hypre_error_flag; +} diff --git a/external/hypre/src/sstruct_mv/HYPRE_sstruct_vector.c b/external/hypre/src/sstruct_mv/HYPRE_sstruct_vector.c index 46c27eb9..50026a39 100644 --- a/external/hypre/src/sstruct_mv/HYPRE_sstruct_vector.c +++ b/external/hypre/src/sstruct_mv/HYPRE_sstruct_vector.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -28,7 +28,7 @@ HYPRE_SStructVectorCreate( MPI_Comm comm, hypre_SStructPGrid *pgrid; HYPRE_Int part; - vector = hypre_TAlloc(hypre_SStructVector, 1, HYPRE_MEMORY_HOST); + vector = hypre_TAlloc(hypre_SStructVector, 1, HYPRE_MEMORY_HOST); hypre_SStructVectorComm(vector) = comm; hypre_SStructVectorNDim(vector) = hypre_SStructGridNDim(grid); @@ -36,7 +36,7 @@ HYPRE_SStructVectorCreate( MPI_Comm comm, hypre_SStructVectorObjectType(vector) = HYPRE_SSTRUCT; nparts = hypre_SStructGridNParts(grid); hypre_SStructVectorNParts(vector) = nparts; - pvectors = hypre_TAlloc(hypre_SStructPVector *, nparts, HYPRE_MEMORY_HOST); + pvectors = hypre_TAlloc(hypre_SStructPVector *, nparts, HYPRE_MEMORY_HOST); for (part = 0; part < nparts; part++) { pgrid = hypre_SStructGridPGrid(grid, part); @@ -79,11 +79,13 @@ HYPRE_SStructVectorDestroy( HYPRE_SStructVector vector ) hypre_SStructPVector **pvectors; HYPRE_Int part; HYPRE_Int vector_type; + HYPRE_MemoryLocation memory_location; /* GEC1002 destroying data indices and data in vector */ - if (vector) { + memory_location = hypre_SStructVectorMemoryLocation(vector); + vector_type = hypre_SStructVectorObjectType(vector); hypre_SStructVectorRefCount(vector) --; if (hypre_SStructVectorRefCount(vector) == 0) @@ -99,16 +101,16 @@ HYPRE_SStructVectorDestroy( HYPRE_SStructVector vector ) HYPRE_IJVectorDestroy(hypre_SStructVectorIJVector(vector)); /* GEC1002 the ijdestroy takes care of the data when the - * vector is type HYPRE_SSTRUCT. This is a result that the + * vector is type HYPRE_SSTRUCT. This is a result that the * ijvector does not use the owndata flag in the data structure - * unlike the structvector */ + * unlike the struct vector */ /* GEC if data has been allocated then free the pointer */ hypre_TFree(hypre_SStructVectorDataIndices(vector), HYPRE_MEMORY_HOST); if (hypre_SStructVectorData(vector) && (vector_type == HYPRE_PARCSR)) { - hypre_TFree(hypre_SStructVectorData(vector), HYPRE_MEMORY_DEVICE); + hypre_TFree(hypre_SStructVectorData(vector), memory_location); } hypre_TFree(vector, HYPRE_MEMORY_HOST); @@ -131,7 +133,7 @@ HYPRE_SStructVectorInitialize( HYPRE_SStructVector vector ) HYPRE_Int datasize; HYPRE_Int nvars ; HYPRE_Int nparts = hypre_SStructVectorNParts(vector) ; - HYPRE_Int var,part ; + HYPRE_Int var, part ; HYPRE_Complex *data ; HYPRE_Complex *pdata ; HYPRE_Complex *sdata ; @@ -145,9 +147,10 @@ HYPRE_SStructVectorInitialize( HYPRE_SStructVector vector ) HYPRE_IJVector ijvector; hypre_SStructPGrid *pgrid; HYPRE_SStructVariable *vartypes; + HYPRE_MemoryLocation memory_location = hypre_HandleMemoryLocation(hypre_handle()); /* GEC0902 addition of variables for ilower and iupper */ - HYPRE_Int ilower, iupper; + HYPRE_BigInt ilower, iupper; hypre_ParVector *par_vector; hypre_Vector *parlocal_vector; @@ -158,15 +161,15 @@ HYPRE_SStructVectorInitialize( HYPRE_SStructVector vector ) datasize = hypre_SStructVectorDataSize(vector); - data = hypre_CTAlloc(HYPRE_Complex, datasize, HYPRE_MEMORY_DEVICE); + data = hypre_CTAlloc(HYPRE_Complex, datasize, memory_location); dataindices = hypre_SStructVectorDataIndices(vector); - hypre_SStructVectorData(vector) = data; + hypre_SStructVectorData(vector) = data; for (part = 0; part < nparts; part++) { - pvector = hypre_SStructVectorPVector(vector,part); + pvector = hypre_SStructVectorPVector(vector, part); pdataindices = hypre_SStructPVectorDataIndices(pvector); /* shift-num = dataindices[part]; */ pdata = data + dataindices[part]; @@ -196,17 +199,21 @@ HYPRE_SStructVectorInitialize( HYPRE_SStructVector vector ) /* GEC1002 this is now the creation of the ijmatrix and the initialization * by checking the type of the vector */ - if(vector_type == HYPRE_PARCSR ) + if (vector_type == HYPRE_PARCSR ) { ilower = hypre_SStructGridStartRank(grid); iupper = ilower + hypre_SStructGridLocalSize(grid) - 1; } - - if(vector_type == HYPRE_SSTRUCT || vector_type == HYPRE_STRUCT) + else if (vector_type == HYPRE_SSTRUCT || vector_type == HYPRE_STRUCT) { ilower = hypre_SStructGridGhstartRank(grid); iupper = ilower + hypre_SStructGridGhlocalSize(grid) - 1; } + else + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Invalid vector type!\n"); + return hypre_error_flag; + } HYPRE_IJVectorCreate(comm, ilower, iupper, &hypre_SStructVectorIJVector(vector)); @@ -220,9 +227,8 @@ HYPRE_SStructVectorInitialize( HYPRE_SStructVector vector ) ijvector = hypre_SStructVectorIJVector(vector); HYPRE_IJVectorSetObjectType(ijvector, HYPRE_PARCSR); - HYPRE_IJVectorInitialize(ijvector); - + HYPRE_IJVectorGetObject(ijvector, (void **) &hypre_SStructVectorParVector(vector)); /* GEC1002 for HYPRE_SSTRUCT type of vector, we do not need data allocated * inside the parvector piece of the structure. We make that pointer within @@ -235,9 +241,9 @@ HYPRE_SStructVectorInitialize( HYPRE_SStructVector vector ) if (vector_type == HYPRE_SSTRUCT || vector_type == HYPRE_STRUCT) { - par_vector = (hypre_ParVector *)hypre_IJVectorObject(ijvector); + par_vector = (hypre_ParVector *) hypre_IJVectorObject(ijvector); parlocal_vector = hypre_ParVectorLocalVector(par_vector); - hypre_TFree(hypre_VectorData(parlocal_vector), HYPRE_MEMORY_DEVICE); + hypre_TFree(hypre_VectorData(parlocal_vector), hypre_VectorMemoryLocation(parlocal_vector)); hypre_VectorData(parlocal_vector) = data ; } @@ -303,7 +309,7 @@ HYPRE_SStructVectorAddToValues( HYPRE_SStructVector vector, /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -/* ONLY3D */ +/* ONLY3D - RDF: Why? */ HYPRE_Int HYPRE_SStructVectorAddFEMValues( HYPRE_SStructVector vector, @@ -316,8 +322,9 @@ HYPRE_SStructVectorAddFEMValues( HYPRE_SStructVector vector, HYPRE_Int fem_nvars = hypre_SStructGridFEMPNVars(grid, part); HYPRE_Int *fem_vars = hypre_SStructGridFEMPVars(grid, part); hypre_Index *fem_offsets = hypre_SStructGridFEMPOffsets(grid, part); - HYPRE_Int i, d, vindex[3]; + HYPRE_Int i, d, vindex[HYPRE_MAXDIM]; + /* Set one variable at a time */ for (i = 0; i < fem_nvars; i++) { for (d = 0; d < ndim; d++) @@ -363,7 +370,7 @@ HYPRE_SStructVectorGetValues( HYPRE_SStructVector vector, /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -/* ONLY3D */ +/* ONLY3D - RDF: Why? */ HYPRE_Int HYPRE_SStructVectorGetFEMValues( HYPRE_SStructVector vector, @@ -377,7 +384,7 @@ HYPRE_SStructVectorGetFEMValues( HYPRE_SStructVector vector, HYPRE_Int fem_nvars = hypre_SStructGridFEMPNVars(grid, part); HYPRE_Int *fem_vars = hypre_SStructGridFEMPVars(grid, part); hypre_Index *fem_offsets = hypre_SStructGridFEMPOffsets(grid, part); - HYPRE_Int i, d, vindex[3]; + HYPRE_Int i, d, vindex[HYPRE_MAXDIM]; hypre_SetIndex(vindex, 0); for (i = 0; i < fem_nvars; i++) @@ -555,6 +562,70 @@ HYPRE_SStructVectorGetBoxValues2(HYPRE_SStructVector vector, return hypre_error_flag; } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorAddFEMBoxValues(HYPRE_SStructVector vector, + HYPRE_Int part, + HYPRE_Int *ilower, + HYPRE_Int *iupper, + HYPRE_Complex *values) +{ + HYPRE_Int ndim = hypre_SStructVectorNDim(vector); + hypre_SStructGrid *grid = hypre_SStructVectorGrid(vector); + HYPRE_MemoryLocation memory_location = hypre_SStructVectorMemoryLocation(vector); + + HYPRE_Int fem_nvars = hypre_SStructGridFEMPNVars(grid, part); + HYPRE_Int *fem_vars = hypre_SStructGridFEMPVars(grid, part); + hypre_Index *fem_offsets = hypre_SStructGridFEMPOffsets(grid, part); + + HYPRE_Complex *tvalues; + hypre_Box *box; + + HYPRE_Int i, d, vilower[HYPRE_MAXDIM], viupper[HYPRE_MAXDIM]; + HYPRE_Int ei, vi, nelts; + + /* Set one variable at a time */ + box = hypre_BoxCreate(ndim); + hypre_BoxSetExtents(box, ilower, iupper); + nelts = hypre_BoxVolume(box); + tvalues = hypre_TAlloc(HYPRE_Complex, nelts, memory_location); + + for (i = 0; i < fem_nvars; i++) + { + for (d = 0; d < ndim; d++) + { + /* note: these offsets are different from what the user passes in */ + vilower[d] = ilower[d] + hypre_IndexD(fem_offsets[i], d); + viupper[d] = iupper[d] + hypre_IndexD(fem_offsets[i], d); + } + +#if defined(HYPRE_USING_GPU) + if (hypre_GetExecPolicy1(memory_location) == HYPRE_EXEC_DEVICE) + { + hypreDevice_ComplexStridedCopy(nelts, fem_nvars, values + i, tvalues); + } + else +#endif + { + for (ei = 0, vi = i; ei < nelts; ei ++, vi += fem_nvars) + { + tvalues[ei] = values[vi]; + } + } + + HYPRE_SStructVectorAddToBoxValues(vector, part, vilower, viupper, + fem_vars[i], tvalues); + } + + /* Free memory */ + hypre_TFree(tvalues, memory_location); + hypre_BoxDestroy(box); + + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ @@ -598,9 +669,9 @@ HYPRE_SStructVectorAssemble( HYPRE_SStructVector vector ) recv_var = hypre_SStructCommInfoRecvVar(vnbor_comm_info[ci]); send_vector = hypre_SStructPVectorSVector( - hypre_SStructVectorPVector(vector, send_part), send_var); + hypre_SStructVectorPVector(vector, send_part), send_var); recv_vector = hypre_SStructPVectorSVector( - hypre_SStructVectorPVector(vector, recv_part), recv_var); + hypre_SStructVectorPVector(vector, recv_part), recv_var); /* want to communicate and add ghost data to real data */ hypre_CommPkgCreate(comm_info, @@ -629,9 +700,6 @@ HYPRE_SStructVectorAssemble( HYPRE_SStructVector vector ) /* u-vector */ HYPRE_IJVectorAssemble(ijvector); - HYPRE_IJVectorGetObject(ijvector, - (void **) &hypre_SStructVectorParVector(vector)); - /*------------------------------------------------------ *------------------------------------------------------*/ @@ -693,9 +761,9 @@ HYPRE_SStructVectorGather( HYPRE_SStructVector vector ) recv_var = hypre_SStructCommInfoRecvVar(vnbor_comm_info[ci]); send_vector = hypre_SStructPVectorSVector( - hypre_SStructVectorPVector(vector, send_part), send_var); + hypre_SStructVectorPVector(vector, send_part), send_var); recv_vector = hypre_SStructPVectorSVector( - hypre_SStructVectorPVector(vector, recv_part), recv_var); + hypre_SStructVectorPVector(vector, recv_part), recv_var); /* want to communicate real data to ghost data */ hypre_CommPkgCreate(comm_info, @@ -784,6 +852,10 @@ HYPRE_SStructVectorGetObject( HYPRE_SStructVector vector, } /*-------------------------------------------------------------------------- + * HYPRE_SStructVectorPrint + * + * This function prints a SStructVector to file. For the assumptions used + * here, see HYPRE_SStructMatrixPrint. *--------------------------------------------------------------------------*/ HYPRE_Int @@ -791,18 +863,121 @@ HYPRE_SStructVectorPrint( const char *filename, HYPRE_SStructVector vector, HYPRE_Int all ) { - HYPRE_Int nparts = hypre_SStructVectorNParts(vector); - HYPRE_Int part; - char new_filename[255]; + /* Vector variables */ + MPI_Comm comm = hypre_SStructVectorComm(vector); + HYPRE_Int nparts = hypre_SStructVectorNParts(vector); + hypre_SStructGrid *grid = hypre_SStructVectorGrid(vector); + + /* Local variables */ + hypre_SStructPVector *pvector; + hypre_StructVector *svector; + + FILE *file; + HYPRE_Int myid; + HYPRE_Int part, var, nvars; + char new_filename[255]; + + /* Print auxiliary data */ + hypre_MPI_Comm_rank(comm, &myid); + hypre_sprintf(new_filename, "%s.%05d", filename, myid); + if ((file = fopen(new_filename, "w")) == NULL) + { + hypre_printf("Error: can't open output file %s\n", new_filename); + hypre_error_in_arg(1); + + return hypre_error_flag; + } + + hypre_fprintf(file, "SStructVector\n"); + hypre_SStructGridPrint(file, grid); + /* Print (part, var) vectors */ for (part = 0; part < nparts; part++) { - hypre_sprintf(new_filename, "%s.%02d", filename, part); - hypre_SStructPVectorPrint(new_filename, - hypre_SStructVectorPVector(vector, part), - all); + pvector = hypre_SStructVectorPVector(vector, part); + nvars = hypre_SStructPVectorNVars(pvector); + for (var = 0; var < nvars; var++) + { + svector = hypre_SStructPVectorSVector(pvector, var); + + hypre_fprintf(file, "\nData - (Part %d, Var %d):\n", part, var); + hypre_StructVectorPrintData(file, svector, all); + } } + fclose(file); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * HYPRE_SStructVectorRead + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorRead( MPI_Comm comm, + const char *filename, + HYPRE_SStructVector *vector_ptr ) +{ + /* Vector variables */ + HYPRE_SStructVector vector; + hypre_SStructPVector *pvector; + hypre_StructVector *svector; + hypre_SStructGrid *grid; + HYPRE_Int nparts; + HYPRE_Int nvars; + + /* Local variables */ + FILE *file; + char new_filename[255]; + HYPRE_Int p, v, part, var; + HYPRE_Int myid; + + /* Read auxiliary data */ + hypre_MPI_Comm_rank(comm, &myid); + hypre_sprintf(new_filename, "%s.%05d", filename, myid); + if ((file = fopen(new_filename, "r")) == NULL) + { + hypre_printf("Error: can't open input file %s\n", new_filename); + hypre_error_in_arg(2); + + return hypre_error_flag; + } + + hypre_fscanf(file, "SStructVector\n"); + hypre_SStructGridRead(comm, file, &grid); + + /* Create and initialize vector */ + HYPRE_SStructVectorCreate(comm, grid, &vector); + HYPRE_SStructVectorInitialize(vector); + + /* Read values from file */ + nparts = hypre_SStructVectorNParts(vector); + for (p = 0; p < nparts; p++) + { + pvector = hypre_SStructVectorPVector(vector, p); + nvars = hypre_SStructPVectorNVars(pvector); + + for (v = 0; v < nvars; v++) + { + hypre_fscanf(file, "\nData - (Part %d, Var %d):\n", &part, &var); + + pvector = hypre_SStructVectorPVector(vector, part); + svector = hypre_SStructPVectorSVector(pvector, var); + + hypre_StructVectorReadData(file, svector); + } + } + fclose(file); + + /* Assemble vector */ + HYPRE_SStructVectorAssemble(vector); + + /* Decrease ref counters */ + HYPRE_SStructGridDestroy(grid); + + *vector_ptr = vector; + return hypre_error_flag; } diff --git a/external/hypre/src/sstruct_mv/_hypre_sstruct_mv.h b/external/hypre/src/sstruct_mv/_hypre_sstruct_mv.h index 1eaa62b3..fbe5dc8e 100644 --- a/external/hypre/src/sstruct_mv/_hypre_sstruct_mv.h +++ b/external/hypre/src/sstruct_mv/_hypre_sstruct_mv.h @@ -19,7 +19,7 @@ extern "C" { #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -78,7 +78,7 @@ typedef struct hypre_Index periodic; /* Indicates if pgrid is periodic */ - /* GEC0902 additions for ghost expansion of boxes */ + /* GEC0902 additions for ghost expansion of boxes */ HYPRE_Int ghlocal_size; /* Number of vars including ghosts */ @@ -175,11 +175,11 @@ typedef struct hypre_SStructGrid_struct HYPRE_Int ref_count; - /* GEC0902 additions for ghost expansion of boxes */ + /* GEC0902 additions for ghost expansion of boxes */ HYPRE_Int ghlocal_size; /* GEC0902 Number of vars including ghosts */ HYPRE_BigInt ghstart_rank; /* GEC0902 start rank including ghosts */ - HYPRE_Int num_ghost[2*HYPRE_MAXDIM]; /* ghost layer size */ + HYPRE_Int num_ghost[2 * HYPRE_MAXDIM]; /* ghost layer size */ } hypre_SStructGrid; @@ -314,7 +314,7 @@ typedef struct hypre_SStructGrid_struct #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -362,7 +362,7 @@ hypre_StructStencilElement( hypre_SStructStencilSStencil(stencil), i ) #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -533,7 +533,7 @@ typedef struct hypre_SStructGraph_struct #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -610,7 +610,7 @@ typedef struct hypre_SStructMatrix_struct HYPRE_Int ref_count; - /* GEC0902 adding an object type to the matrix */ + /* GEC0902 adding an object type to the matrix */ HYPRE_Int object_type; } hypre_SStructMatrix; @@ -672,7 +672,7 @@ hypre_SStructPGridNDim(hypre_SStructPMatrixPGrid(pmat)) #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -729,15 +729,13 @@ typedef struct hypre_SStructVector_struct /* inter-part communication info */ HYPRE_Int nbor_ncomms; /* num comm_pkgs with neighbor parts */ - /* GEC10020902 pointer to big chunk of memory and auxiliary information */ - - HYPRE_Complex *data; /* GEC1002 pointer to chunk data */ - HYPRE_Int *dataindices; /* GEC1002 dataindices[partx] is the starting index - of vector data for the part=partx */ - HYPRE_Int datasize ; /* GEC1002 size of all data = ghlocalsize */ + /* GEC10020902 pointer to big chunk of memory and auxiliary information */ + HYPRE_Complex *data; /* GEC1002 pointer to chunk data */ + HYPRE_Int *dataindices; /* GEC1002 dataindices[partx] is the starting index + of vector data for the part=partx */ + HYPRE_Int datasize; /* GEC1002 size of all data = ghlocalsize */ HYPRE_Int global_size; /* Total number coefficients */ - HYPRE_Int ref_count; } hypre_SStructVector; @@ -781,203 +779,330 @@ typedef struct hypre_SStructVector_struct #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ /* HYPRE_sstruct_graph.c */ -HYPRE_Int HYPRE_SStructGraphCreate ( MPI_Comm comm , HYPRE_SStructGrid grid , HYPRE_SStructGraph *graph_ptr ); +HYPRE_Int HYPRE_SStructGraphCreate ( MPI_Comm comm, HYPRE_SStructGrid grid, + HYPRE_SStructGraph *graph_ptr ); HYPRE_Int HYPRE_SStructGraphDestroy ( HYPRE_SStructGraph graph ); -HYPRE_Int HYPRE_SStructGraphSetDomainGrid ( HYPRE_SStructGraph graph , HYPRE_SStructGrid domain_grid ); -HYPRE_Int HYPRE_SStructGraphSetStencil ( HYPRE_SStructGraph graph , HYPRE_Int part , HYPRE_Int var , HYPRE_SStructStencil stencil ); -HYPRE_Int HYPRE_SStructGraphSetFEM ( HYPRE_SStructGraph graph , HYPRE_Int part ); -HYPRE_Int HYPRE_SStructGraphSetFEMSparsity ( HYPRE_SStructGraph graph , HYPRE_Int part , HYPRE_Int nsparse , HYPRE_Int *sparsity ); -HYPRE_Int HYPRE_SStructGraphAddEntries ( HYPRE_SStructGraph graph , HYPRE_Int part , HYPRE_Int *index , HYPRE_Int var , HYPRE_Int to_part , HYPRE_Int *to_index , HYPRE_Int to_var ); +HYPRE_Int HYPRE_SStructGraphSetDomainGrid ( HYPRE_SStructGraph graph, + HYPRE_SStructGrid domain_grid ); +HYPRE_Int HYPRE_SStructGraphSetStencil ( HYPRE_SStructGraph graph, HYPRE_Int part, HYPRE_Int var, + HYPRE_SStructStencil stencil ); +HYPRE_Int HYPRE_SStructGraphSetFEM ( HYPRE_SStructGraph graph, HYPRE_Int part ); +HYPRE_Int HYPRE_SStructGraphSetFEMSparsity ( HYPRE_SStructGraph graph, HYPRE_Int part, + HYPRE_Int nsparse, HYPRE_Int *sparsity ); +HYPRE_Int HYPRE_SStructGraphAddEntries ( HYPRE_SStructGraph graph, HYPRE_Int part, HYPRE_Int *index, + HYPRE_Int var, HYPRE_Int to_part, HYPRE_Int *to_index, HYPRE_Int to_var ); HYPRE_Int HYPRE_SStructGraphAssemble ( HYPRE_SStructGraph graph ); -HYPRE_Int HYPRE_SStructGraphSetObjectType ( HYPRE_SStructGraph graph , HYPRE_Int type ); +HYPRE_Int HYPRE_SStructGraphSetObjectType ( HYPRE_SStructGraph graph, HYPRE_Int type ); +HYPRE_Int HYPRE_SStructGraphPrint ( FILE *file, HYPRE_SStructGraph graph ); +HYPRE_Int HYPRE_SStructGraphRead ( FILE *file, HYPRE_SStructGrid grid, + HYPRE_SStructStencil **stencils, HYPRE_SStructGraph *graph_ptr ); /* HYPRE_sstruct_grid.c */ -HYPRE_Int HYPRE_SStructGridCreate ( MPI_Comm comm , HYPRE_Int ndim , HYPRE_Int nparts , HYPRE_SStructGrid *grid_ptr ); +HYPRE_Int HYPRE_SStructGridCreate ( MPI_Comm comm, HYPRE_Int ndim, HYPRE_Int nparts, + HYPRE_SStructGrid *grid_ptr ); HYPRE_Int HYPRE_SStructGridDestroy ( HYPRE_SStructGrid grid ); -HYPRE_Int HYPRE_SStructGridSetExtents ( HYPRE_SStructGrid grid , HYPRE_Int part , HYPRE_Int *ilower , HYPRE_Int *iupper ); -HYPRE_Int HYPRE_SStructGridSetVariables ( HYPRE_SStructGrid grid , HYPRE_Int part , HYPRE_Int nvars , HYPRE_SStructVariable *vartypes ); -HYPRE_Int HYPRE_SStructGridAddVariables ( HYPRE_SStructGrid grid , HYPRE_Int part , HYPRE_Int *index , HYPRE_Int nvars , HYPRE_SStructVariable *vartypes ); -HYPRE_Int HYPRE_SStructGridSetFEMOrdering ( HYPRE_SStructGrid grid , HYPRE_Int part , HYPRE_Int *ordering ); -HYPRE_Int HYPRE_SStructGridSetNeighborPart ( HYPRE_SStructGrid grid , HYPRE_Int part , HYPRE_Int *ilower , HYPRE_Int *iupper , HYPRE_Int nbor_part , HYPRE_Int *nbor_ilower , HYPRE_Int *nbor_iupper , HYPRE_Int *index_map , HYPRE_Int *index_dir ); -HYPRE_Int HYPRE_SStructGridSetSharedPart ( HYPRE_SStructGrid grid , HYPRE_Int part , HYPRE_Int *ilower , HYPRE_Int *iupper , HYPRE_Int *offset , HYPRE_Int shared_part , HYPRE_Int *shared_ilower , HYPRE_Int *shared_iupper , HYPRE_Int *shared_offset , HYPRE_Int *index_map , HYPRE_Int *index_dir ); -HYPRE_Int HYPRE_SStructGridAddUnstructuredPart ( HYPRE_SStructGrid grid , HYPRE_Int ilower , HYPRE_Int iupper ); +HYPRE_Int HYPRE_SStructGridSetExtents ( HYPRE_SStructGrid grid, HYPRE_Int part, HYPRE_Int *ilower, + HYPRE_Int *iupper ); +HYPRE_Int HYPRE_SStructGridSetVariables ( HYPRE_SStructGrid grid, HYPRE_Int part, HYPRE_Int nvars, + HYPRE_SStructVariable *vartypes ); +HYPRE_Int HYPRE_SStructGridAddVariables ( HYPRE_SStructGrid grid, HYPRE_Int part, HYPRE_Int *index, + HYPRE_Int nvars, HYPRE_SStructVariable *vartypes ); +HYPRE_Int HYPRE_SStructGridSetFEMOrdering ( HYPRE_SStructGrid grid, HYPRE_Int part, + HYPRE_Int *ordering ); +HYPRE_Int HYPRE_SStructGridSetNeighborPart ( HYPRE_SStructGrid grid, HYPRE_Int part, + HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int nbor_part, HYPRE_Int *nbor_ilower, + HYPRE_Int *nbor_iupper, HYPRE_Int *index_map, HYPRE_Int *index_dir ); +HYPRE_Int HYPRE_SStructGridSetSharedPart ( HYPRE_SStructGrid grid, HYPRE_Int part, + HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int *offset, HYPRE_Int shared_part, + HYPRE_Int *shared_ilower, HYPRE_Int *shared_iupper, HYPRE_Int *shared_offset, HYPRE_Int *index_map, + HYPRE_Int *index_dir ); +HYPRE_Int HYPRE_SStructGridAddUnstructuredPart ( HYPRE_SStructGrid grid, HYPRE_Int ilower, + HYPRE_Int iupper ); HYPRE_Int HYPRE_SStructGridAssemble ( HYPRE_SStructGrid grid ); -HYPRE_Int HYPRE_SStructGridSetPeriodic ( HYPRE_SStructGrid grid , HYPRE_Int part , HYPRE_Int *periodic ); -HYPRE_Int HYPRE_SStructGridSetNumGhost ( HYPRE_SStructGrid grid , HYPRE_Int *num_ghost ); +HYPRE_Int HYPRE_SStructGridSetPeriodic ( HYPRE_SStructGrid grid, HYPRE_Int part, + HYPRE_Int *periodic ); +HYPRE_Int HYPRE_SStructGridSetNumGhost ( HYPRE_SStructGrid grid, HYPRE_Int *num_ghost ); /* HYPRE_sstruct_matrix.c */ -HYPRE_Int HYPRE_SStructMatrixCreate ( MPI_Comm comm , HYPRE_SStructGraph graph , HYPRE_SStructMatrix *matrix_ptr ); +HYPRE_Int HYPRE_SStructMatrixCreate ( MPI_Comm comm, HYPRE_SStructGraph graph, + HYPRE_SStructMatrix *matrix_ptr ); HYPRE_Int HYPRE_SStructMatrixDestroy ( HYPRE_SStructMatrix matrix ); HYPRE_Int HYPRE_SStructMatrixInitialize ( HYPRE_SStructMatrix matrix ); -HYPRE_Int HYPRE_SStructMatrixSetValues ( HYPRE_SStructMatrix matrix , HYPRE_Int part , HYPRE_Int *index , HYPRE_Int var , HYPRE_Int nentries , HYPRE_Int *entries , HYPRE_Complex *values ); -HYPRE_Int HYPRE_SStructMatrixAddToValues ( HYPRE_SStructMatrix matrix , HYPRE_Int part , HYPRE_Int *index , HYPRE_Int var , HYPRE_Int nentries , HYPRE_Int *entries , HYPRE_Complex *values ); -HYPRE_Int HYPRE_SStructMatrixAddFEMValues ( HYPRE_SStructMatrix matrix , HYPRE_Int part , HYPRE_Int *index , HYPRE_Complex *values ); -HYPRE_Int HYPRE_SStructMatrixGetValues ( HYPRE_SStructMatrix matrix , HYPRE_Int part , HYPRE_Int *index , HYPRE_Int var , HYPRE_Int nentries , HYPRE_Int *entries , HYPRE_Complex *values ); -HYPRE_Int HYPRE_SStructMatrixGetFEMValues ( HYPRE_SStructMatrix matrix , HYPRE_Int part , HYPRE_Int *index , HYPRE_Complex *values ); -HYPRE_Int HYPRE_SStructMatrixSetBoxValues ( HYPRE_SStructMatrix matrix , HYPRE_Int part , HYPRE_Int *ilower , HYPRE_Int *iupper , HYPRE_Int var , HYPRE_Int nentries , HYPRE_Int *entries , HYPRE_Complex *values ); -HYPRE_Int HYPRE_SStructMatrixAddToBoxValues ( HYPRE_SStructMatrix matrix , HYPRE_Int part , HYPRE_Int *ilower , HYPRE_Int *iupper , HYPRE_Int var , HYPRE_Int nentries , HYPRE_Int *entries , HYPRE_Complex *values ); -HYPRE_Int HYPRE_SStructMatrixGetBoxValues ( HYPRE_SStructMatrix matrix , HYPRE_Int part , HYPRE_Int *ilower , HYPRE_Int *iupper , HYPRE_Int var , HYPRE_Int nentries , HYPRE_Int *entries , HYPRE_Complex *values ); +HYPRE_Int HYPRE_SStructMatrixSetValues ( HYPRE_SStructMatrix matrix, HYPRE_Int part, + HYPRE_Int *index, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Complex *values ); +HYPRE_Int HYPRE_SStructMatrixAddToValues ( HYPRE_SStructMatrix matrix, HYPRE_Int part, + HYPRE_Int *index, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Complex *values ); +HYPRE_Int HYPRE_SStructMatrixAddFEMValues ( HYPRE_SStructMatrix matrix, HYPRE_Int part, + HYPRE_Int *index, HYPRE_Complex *values ); +HYPRE_Int HYPRE_SStructMatrixGetValues ( HYPRE_SStructMatrix matrix, HYPRE_Int part, + HYPRE_Int *index, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Complex *values ); +HYPRE_Int HYPRE_SStructMatrixGetFEMValues ( HYPRE_SStructMatrix matrix, HYPRE_Int part, + HYPRE_Int *index, HYPRE_Complex *values ); +HYPRE_Int HYPRE_SStructMatrixSetBoxValues ( HYPRE_SStructMatrix matrix, HYPRE_Int part, + HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, + HYPRE_Complex *values ); +HYPRE_Int HYPRE_SStructMatrixAddToBoxValues ( HYPRE_SStructMatrix matrix, HYPRE_Int part, + HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, + HYPRE_Complex *values ); +HYPRE_Int HYPRE_SStructMatrixGetBoxValues ( HYPRE_SStructMatrix matrix, HYPRE_Int part, + HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, + HYPRE_Complex *values ); HYPRE_Int HYPRE_SStructMatrixAssemble ( HYPRE_SStructMatrix matrix ); -HYPRE_Int HYPRE_SStructMatrixSetSymmetric ( HYPRE_SStructMatrix matrix , HYPRE_Int part , HYPRE_Int var , HYPRE_Int to_var , HYPRE_Int symmetric ); -HYPRE_Int HYPRE_SStructMatrixSetNSSymmetric ( HYPRE_SStructMatrix matrix , HYPRE_Int symmetric ); -HYPRE_Int HYPRE_SStructMatrixSetObjectType ( HYPRE_SStructMatrix matrix , HYPRE_Int type ); -HYPRE_Int HYPRE_SStructMatrixGetObject ( HYPRE_SStructMatrix matrix , void **object ); -HYPRE_Int HYPRE_SStructMatrixPrint ( const char *filename , HYPRE_SStructMatrix matrix , HYPRE_Int all ); -HYPRE_Int HYPRE_SStructMatrixMatvec ( HYPRE_Complex alpha , HYPRE_SStructMatrix A , HYPRE_SStructVector x , HYPRE_Complex beta , HYPRE_SStructVector y ); +HYPRE_Int HYPRE_SStructMatrixSetSymmetric ( HYPRE_SStructMatrix matrix, HYPRE_Int part, + HYPRE_Int var, HYPRE_Int to_var, HYPRE_Int symmetric ); +HYPRE_Int HYPRE_SStructMatrixSetNSSymmetric ( HYPRE_SStructMatrix matrix, HYPRE_Int symmetric ); +HYPRE_Int HYPRE_SStructMatrixSetObjectType ( HYPRE_SStructMatrix matrix, HYPRE_Int type ); +HYPRE_Int HYPRE_SStructMatrixGetObject ( HYPRE_SStructMatrix matrix, void **object ); +HYPRE_Int HYPRE_SStructMatrixPrint ( const char *filename, HYPRE_SStructMatrix matrix, + HYPRE_Int all ); +HYPRE_Int HYPRE_SStructMatrixRead ( MPI_Comm comm, const char *filename, + HYPRE_SStructMatrix *matrix_ptr ); +HYPRE_Int HYPRE_SStructMatrixMatvec ( HYPRE_Complex alpha, HYPRE_SStructMatrix A, + HYPRE_SStructVector x, HYPRE_Complex beta, HYPRE_SStructVector y ); /* HYPRE_sstruct_stencil.c */ -HYPRE_Int HYPRE_SStructStencilCreate ( HYPRE_Int ndim , HYPRE_Int size , HYPRE_SStructStencil *stencil_ptr ); +HYPRE_Int HYPRE_SStructStencilCreate ( HYPRE_Int ndim, HYPRE_Int size, + HYPRE_SStructStencil *stencil_ptr ); HYPRE_Int HYPRE_SStructStencilDestroy ( HYPRE_SStructStencil stencil ); -HYPRE_Int HYPRE_SStructStencilSetEntry ( HYPRE_SStructStencil stencil , HYPRE_Int entry , HYPRE_Int *offset , HYPRE_Int var ); +HYPRE_Int HYPRE_SStructStencilSetEntry ( HYPRE_SStructStencil stencil, HYPRE_Int entry, + HYPRE_Int *offset, HYPRE_Int var ); +HYPRE_Int HYPRE_SStructStencilPrint ( FILE *file, HYPRE_SStructStencil stencil ); +HYPRE_Int HYPRE_SStructStencilRead ( FILE *file, HYPRE_SStructStencil *stencil_ptr ); + /* HYPRE_sstruct_vector.c */ -HYPRE_Int HYPRE_SStructVectorCreate ( MPI_Comm comm , HYPRE_SStructGrid grid , HYPRE_SStructVector *vector_ptr ); +HYPRE_Int HYPRE_SStructVectorCreate ( MPI_Comm comm, HYPRE_SStructGrid grid, + HYPRE_SStructVector *vector_ptr ); HYPRE_Int HYPRE_SStructVectorDestroy ( HYPRE_SStructVector vector ); HYPRE_Int HYPRE_SStructVectorInitialize ( HYPRE_SStructVector vector ); -HYPRE_Int HYPRE_SStructVectorSetValues ( HYPRE_SStructVector vector , HYPRE_Int part , HYPRE_Int *index , HYPRE_Int var , HYPRE_Complex *value ); -HYPRE_Int HYPRE_SStructVectorAddToValues ( HYPRE_SStructVector vector , HYPRE_Int part , HYPRE_Int *index , HYPRE_Int var , HYPRE_Complex *value ); -HYPRE_Int HYPRE_SStructVectorAddFEMValues ( HYPRE_SStructVector vector , HYPRE_Int part , HYPRE_Int *index , HYPRE_Complex *values ); -HYPRE_Int HYPRE_SStructVectorGetValues ( HYPRE_SStructVector vector , HYPRE_Int part , HYPRE_Int *index , HYPRE_Int var , HYPRE_Complex *value ); -HYPRE_Int HYPRE_SStructVectorGetFEMValues ( HYPRE_SStructVector vector , HYPRE_Int part , HYPRE_Int *index , HYPRE_Complex *values ); -HYPRE_Int HYPRE_SStructVectorSetBoxValues ( HYPRE_SStructVector vector , HYPRE_Int part , HYPRE_Int *ilower , HYPRE_Int *iupper , HYPRE_Int var , HYPRE_Complex *values ); -HYPRE_Int HYPRE_SStructVectorAddToBoxValues ( HYPRE_SStructVector vector , HYPRE_Int part , HYPRE_Int *ilower , HYPRE_Int *iupper , HYPRE_Int var , HYPRE_Complex *values ); -HYPRE_Int HYPRE_SStructVectorGetBoxValues ( HYPRE_SStructVector vector , HYPRE_Int part , HYPRE_Int *ilower , HYPRE_Int *iupper , HYPRE_Int var , HYPRE_Complex *values ); +HYPRE_Int HYPRE_SStructVectorSetValues ( HYPRE_SStructVector vector, HYPRE_Int part, + HYPRE_Int *index, HYPRE_Int var, HYPRE_Complex *value ); +HYPRE_Int HYPRE_SStructVectorAddToValues ( HYPRE_SStructVector vector, HYPRE_Int part, + HYPRE_Int *index, HYPRE_Int var, HYPRE_Complex *value ); +HYPRE_Int HYPRE_SStructVectorAddFEMValues ( HYPRE_SStructVector vector, HYPRE_Int part, + HYPRE_Int *index, HYPRE_Complex *values ); +HYPRE_Int HYPRE_SStructVectorGetValues ( HYPRE_SStructVector vector, HYPRE_Int part, + HYPRE_Int *index, HYPRE_Int var, HYPRE_Complex *value ); +HYPRE_Int HYPRE_SStructVectorGetFEMValues ( HYPRE_SStructVector vector, HYPRE_Int part, + HYPRE_Int *index, HYPRE_Complex *values ); +HYPRE_Int HYPRE_SStructVectorSetBoxValues ( HYPRE_SStructVector vector, HYPRE_Int part, + HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Complex *values ); +HYPRE_Int HYPRE_SStructVectorAddToBoxValues ( HYPRE_SStructVector vector, HYPRE_Int part, + HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Complex *values ); +HYPRE_Int HYPRE_SStructVectorGetBoxValues ( HYPRE_SStructVector vector, HYPRE_Int part, + HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Complex *values ); HYPRE_Int HYPRE_SStructVectorAssemble ( HYPRE_SStructVector vector ); HYPRE_Int HYPRE_SStructVectorGather ( HYPRE_SStructVector vector ); -HYPRE_Int HYPRE_SStructVectorSetConstantValues ( HYPRE_SStructVector vector , HYPRE_Complex value ); -HYPRE_Int HYPRE_SStructVectorSetObjectType ( HYPRE_SStructVector vector , HYPRE_Int type ); -HYPRE_Int HYPRE_SStructVectorGetObject ( HYPRE_SStructVector vector , void **object ); -HYPRE_Int HYPRE_SStructVectorPrint ( const char *filename , HYPRE_SStructVector vector , HYPRE_Int all ); -HYPRE_Int HYPRE_SStructVectorCopy ( HYPRE_SStructVector x , HYPRE_SStructVector y ); -HYPRE_Int HYPRE_SStructVectorScale ( HYPRE_Complex alpha , HYPRE_SStructVector y ); -HYPRE_Int HYPRE_SStructInnerProd ( HYPRE_SStructVector x , HYPRE_SStructVector y , HYPRE_Real *result ); -HYPRE_Int HYPRE_SStructAxpy ( HYPRE_Complex alpha , HYPRE_SStructVector x , HYPRE_SStructVector y ); +HYPRE_Int HYPRE_SStructVectorSetConstantValues ( HYPRE_SStructVector vector, HYPRE_Complex value ); +HYPRE_Int HYPRE_SStructVectorSetObjectType ( HYPRE_SStructVector vector, HYPRE_Int type ); +HYPRE_Int HYPRE_SStructVectorGetObject ( HYPRE_SStructVector vector, void **object ); +HYPRE_Int HYPRE_SStructVectorPrint ( const char *filename, HYPRE_SStructVector vector, + HYPRE_Int all ); +HYPRE_Int HYPRE_SStructVectorRead ( MPI_Comm comm, const char *filename, + HYPRE_SStructVector *vector ); +HYPRE_Int HYPRE_SStructVectorCopy ( HYPRE_SStructVector x, HYPRE_SStructVector y ); +HYPRE_Int HYPRE_SStructVectorScale ( HYPRE_Complex alpha, HYPRE_SStructVector y ); +HYPRE_Int HYPRE_SStructInnerProd ( HYPRE_SStructVector x, HYPRE_SStructVector y, + HYPRE_Real *result ); +HYPRE_Int HYPRE_SStructAxpy ( HYPRE_Complex alpha, HYPRE_SStructVector x, HYPRE_SStructVector y ); /* sstruct_axpy.c */ -HYPRE_Int hypre_SStructPAxpy ( HYPRE_Complex alpha , hypre_SStructPVector *px , hypre_SStructPVector *py ); -HYPRE_Int hypre_SStructAxpy ( HYPRE_Complex alpha , hypre_SStructVector *x , hypre_SStructVector *y ); +HYPRE_Int hypre_SStructPAxpy ( HYPRE_Complex alpha, hypre_SStructPVector *px, + hypre_SStructPVector *py ); +HYPRE_Int hypre_SStructAxpy ( HYPRE_Complex alpha, hypre_SStructVector *x, hypre_SStructVector *y ); /* sstruct_copy.c */ -HYPRE_Int hypre_SStructPCopy ( hypre_SStructPVector *px , hypre_SStructPVector *py ); -HYPRE_Int hypre_SStructPartialPCopy ( hypre_SStructPVector *px , hypre_SStructPVector *py , hypre_BoxArrayArray **array_boxes ); -HYPRE_Int hypre_SStructCopy ( hypre_SStructVector *x , hypre_SStructVector *y ); +HYPRE_Int hypre_SStructPCopy ( hypre_SStructPVector *px, hypre_SStructPVector *py ); +HYPRE_Int hypre_SStructPartialPCopy ( hypre_SStructPVector *px, hypre_SStructPVector *py, + hypre_BoxArrayArray **array_boxes ); +HYPRE_Int hypre_SStructCopy ( hypre_SStructVector *x, hypre_SStructVector *y ); /* sstruct_graph.c */ -HYPRE_Int hypre_SStructGraphRef ( hypre_SStructGraph *graph , hypre_SStructGraph **graph_ref ); -HYPRE_Int hypre_SStructGraphGetUVEntryRank( hypre_SStructGraph *graph , HYPRE_Int part , HYPRE_Int var , hypre_Index index, HYPRE_BigInt *rank ); -HYPRE_Int hypre_SStructGraphFindBoxEndpt ( hypre_SStructGraph *graph , HYPRE_Int part , HYPRE_Int var , HYPRE_Int proc , HYPRE_Int endpt , HYPRE_Int boxi ); -HYPRE_Int hypre_SStructGraphFindSGridEndpts ( hypre_SStructGraph *graph , HYPRE_Int part , HYPRE_Int var , HYPRE_Int proc , HYPRE_Int endpt , HYPRE_Int *endpts ); +HYPRE_Int hypre_SStructGraphRef ( hypre_SStructGraph *graph, hypre_SStructGraph **graph_ref ); +HYPRE_Int hypre_SStructGraphGetUVEntryRank( hypre_SStructGraph *graph, HYPRE_Int part, + HYPRE_Int var, hypre_Index index, HYPRE_BigInt *rank ); +HYPRE_Int hypre_SStructGraphFindBoxEndpt ( hypre_SStructGraph *graph, HYPRE_Int part, HYPRE_Int var, + HYPRE_Int proc, HYPRE_Int endpt, HYPRE_Int boxi ); +HYPRE_Int hypre_SStructGraphFindSGridEndpts ( hypre_SStructGraph *graph, HYPRE_Int part, + HYPRE_Int var, HYPRE_Int proc, HYPRE_Int endpt, HYPRE_Int *endpts ); /* sstruct_grid.c */ -HYPRE_Int hypre_SStructVariableGetOffset ( HYPRE_SStructVariable vartype , HYPRE_Int ndim , hypre_Index varoffset ); -HYPRE_Int hypre_SStructPGridCreate ( MPI_Comm comm , HYPRE_Int ndim , hypre_SStructPGrid **pgrid_ptr ); +HYPRE_Int hypre_SStructVariableGetOffset ( HYPRE_SStructVariable vartype, HYPRE_Int ndim, + hypre_Index varoffset ); +HYPRE_Int hypre_SStructPGridCreate ( MPI_Comm comm, HYPRE_Int ndim, + hypre_SStructPGrid **pgrid_ptr ); HYPRE_Int hypre_SStructPGridDestroy ( hypre_SStructPGrid *pgrid ); -HYPRE_Int hypre_SStructPGridSetExtents ( hypre_SStructPGrid *pgrid , hypre_Index ilower , hypre_Index iupper ); -HYPRE_Int hypre_SStructPGridSetCellSGrid ( hypre_SStructPGrid *pgrid , hypre_StructGrid *cell_sgrid ); -HYPRE_Int hypre_SStructPGridSetVariables ( hypre_SStructPGrid *pgrid , HYPRE_Int nvars , HYPRE_SStructVariable *vartypes ); -HYPRE_Int hypre_SStructPGridSetPNeighbor ( hypre_SStructPGrid *pgrid , hypre_Box *pneighbor_box , hypre_Index pnbor_offset ); +HYPRE_Int hypre_SStructPGridSetExtents ( hypre_SStructPGrid *pgrid, hypre_Index ilower, + hypre_Index iupper ); +HYPRE_Int hypre_SStructPGridSetCellSGrid ( hypre_SStructPGrid *pgrid, + hypre_StructGrid *cell_sgrid ); +HYPRE_Int hypre_SStructPGridSetVariables ( hypre_SStructPGrid *pgrid, HYPRE_Int nvars, + HYPRE_SStructVariable *vartypes ); +HYPRE_Int hypre_SStructPGridSetPNeighbor ( hypre_SStructPGrid *pgrid, hypre_Box *pneighbor_box, + hypre_Index pnbor_offset ); HYPRE_Int hypre_SStructPGridAssemble ( hypre_SStructPGrid *pgrid ); -HYPRE_Int hypre_SStructGridRef ( hypre_SStructGrid *grid , hypre_SStructGrid **grid_ref ); +HYPRE_Int hypre_SStructPGridGetMaxBoxSize ( hypre_SStructPGrid *pgrid ); +HYPRE_Int hypre_SStructGridRef ( hypre_SStructGrid *grid, hypre_SStructGrid **grid_ref ); HYPRE_Int hypre_SStructGridAssembleBoxManagers ( hypre_SStructGrid *grid ); HYPRE_Int hypre_SStructGridAssembleNborBoxManagers ( hypre_SStructGrid *grid ); HYPRE_Int hypre_SStructGridCreateCommInfo ( hypre_SStructGrid *grid ); -HYPRE_Int hypre_SStructGridFindBoxManEntry ( hypre_SStructGrid *grid , HYPRE_Int part , hypre_Index index , HYPRE_Int var , hypre_BoxManEntry **entry_ptr ); -HYPRE_Int hypre_SStructGridFindNborBoxManEntry ( hypre_SStructGrid *grid , HYPRE_Int part , hypre_Index index , HYPRE_Int var , hypre_BoxManEntry **entry_ptr ); -HYPRE_Int hypre_SStructGridBoxProcFindBoxManEntry ( hypre_SStructGrid *grid , HYPRE_Int part , HYPRE_Int var , HYPRE_Int box , HYPRE_Int proc , hypre_BoxManEntry **entry_ptr ); -HYPRE_Int hypre_SStructBoxManEntryGetCSRstrides ( hypre_BoxManEntry *entry , hypre_Index strides ); -HYPRE_Int hypre_SStructBoxManEntryGetGhstrides ( hypre_BoxManEntry *entry , hypre_Index strides ); -HYPRE_Int hypre_SStructBoxManEntryGetGlobalCSRank ( hypre_BoxManEntry *entry , hypre_Index index , HYPRE_BigInt *rank_ptr ); -HYPRE_Int hypre_SStructBoxManEntryGetGlobalGhrank ( hypre_BoxManEntry *entry , hypre_Index index , HYPRE_BigInt *rank_ptr ); -HYPRE_Int hypre_SStructBoxManEntryGetProcess ( hypre_BoxManEntry *entry , HYPRE_Int *proc_ptr ); -HYPRE_Int hypre_SStructBoxManEntryGetBoxnum ( hypre_BoxManEntry *entry , HYPRE_Int *id_ptr ); -HYPRE_Int hypre_SStructBoxManEntryGetPart ( hypre_BoxManEntry *entry , HYPRE_Int part , HYPRE_Int *part_ptr ); -HYPRE_Int hypre_SStructIndexToNborIndex( hypre_Index index , hypre_Index root , hypre_Index nbor_root , hypre_Index coord , hypre_Index dir , HYPRE_Int ndim , hypre_Index nbor_index ); -HYPRE_Int hypre_SStructBoxToNborBox ( hypre_Box *box , hypre_Index root , hypre_Index nbor_root , hypre_Index coord , hypre_Index dir ); -HYPRE_Int hypre_SStructNborIndexToIndex( hypre_Index nbor_index , hypre_Index root , hypre_Index nbor_root , hypre_Index coord , hypre_Index dir , HYPRE_Int ndim , hypre_Index index ); -HYPRE_Int hypre_SStructNborBoxToBox ( hypre_Box *nbor_box , hypre_Index root , hypre_Index nbor_root , hypre_Index coord , hypre_Index dir ); -HYPRE_Int hypre_SStructVarToNborVar ( hypre_SStructGrid *grid , HYPRE_Int part , HYPRE_Int var , HYPRE_Int *coord , HYPRE_Int *nbor_var_ptr ); -HYPRE_Int hypre_SStructGridSetNumGhost ( hypre_SStructGrid *grid , HYPRE_Int *num_ghost ); -HYPRE_Int hypre_SStructBoxManEntryGetGlobalRank ( hypre_BoxManEntry *entry , hypre_Index index , HYPRE_BigInt *rank_ptr , HYPRE_Int type ); -HYPRE_Int hypre_SStructBoxManEntryGetStrides ( hypre_BoxManEntry *entry , hypre_Index strides , HYPRE_Int type ); -HYPRE_Int hypre_SStructBoxNumMap ( hypre_SStructGrid *grid , HYPRE_Int part , HYPRE_Int boxnum , HYPRE_Int **num_varboxes_ptr , HYPRE_Int ***map_ptr ); -HYPRE_Int hypre_SStructCellGridBoxNumMap ( hypre_SStructGrid *grid , HYPRE_Int part , HYPRE_Int ***num_varboxes_ptr , HYPRE_Int ****map_ptr ); -HYPRE_Int hypre_SStructCellBoxToVarBox ( hypre_Box *box , hypre_Index offset , hypre_Index varoffset , HYPRE_Int *valid ); -HYPRE_Int hypre_SStructGridIntersect ( hypre_SStructGrid *grid , HYPRE_Int part , HYPRE_Int var , hypre_Box *box , HYPRE_Int action , hypre_BoxManEntry ***entries_ptr , HYPRE_Int *nentries_ptr ); +HYPRE_Int hypre_SStructGridFindBoxManEntry ( hypre_SStructGrid *grid, HYPRE_Int part, + hypre_Index index, HYPRE_Int var, hypre_BoxManEntry **entry_ptr ); +HYPRE_Int hypre_SStructGridFindNborBoxManEntry ( hypre_SStructGrid *grid, HYPRE_Int part, + hypre_Index index, HYPRE_Int var, hypre_BoxManEntry **entry_ptr ); +HYPRE_Int hypre_SStructGridBoxProcFindBoxManEntry ( hypre_SStructGrid *grid, HYPRE_Int part, + HYPRE_Int var, HYPRE_Int box, HYPRE_Int proc, hypre_BoxManEntry **entry_ptr ); +HYPRE_Int hypre_SStructBoxManEntryGetCSRstrides ( hypre_BoxManEntry *entry, hypre_Index strides ); +HYPRE_Int hypre_SStructBoxManEntryGetGhstrides ( hypre_BoxManEntry *entry, hypre_Index strides ); +HYPRE_Int hypre_SStructBoxManEntryGetGlobalCSRank ( hypre_BoxManEntry *entry, hypre_Index index, + HYPRE_BigInt *rank_ptr ); +HYPRE_Int hypre_SStructBoxManEntryGetGlobalGhrank ( hypre_BoxManEntry *entry, hypre_Index index, + HYPRE_BigInt *rank_ptr ); +HYPRE_Int hypre_SStructBoxManEntryGetProcess ( hypre_BoxManEntry *entry, HYPRE_Int *proc_ptr ); +HYPRE_Int hypre_SStructBoxManEntryGetBoxnum ( hypre_BoxManEntry *entry, HYPRE_Int *id_ptr ); +HYPRE_Int hypre_SStructBoxManEntryGetPart ( hypre_BoxManEntry *entry, HYPRE_Int part, + HYPRE_Int *part_ptr ); +HYPRE_Int hypre_SStructIndexToNborIndex( hypre_Index index, hypre_Index root, hypre_Index nbor_root, + hypre_Index coord, hypre_Index dir, HYPRE_Int ndim, hypre_Index nbor_index ); +HYPRE_Int hypre_SStructBoxToNborBox ( hypre_Box *box, hypre_Index root, hypre_Index nbor_root, + hypre_Index coord, hypre_Index dir ); +HYPRE_Int hypre_SStructNborIndexToIndex( hypre_Index nbor_index, hypre_Index root, + hypre_Index nbor_root, hypre_Index coord, hypre_Index dir, HYPRE_Int ndim, hypre_Index index ); +HYPRE_Int hypre_SStructNborBoxToBox ( hypre_Box *nbor_box, hypre_Index root, hypre_Index nbor_root, + hypre_Index coord, hypre_Index dir ); +HYPRE_Int hypre_SStructVarToNborVar ( hypre_SStructGrid *grid, HYPRE_Int part, HYPRE_Int var, + HYPRE_Int *coord, HYPRE_Int *nbor_var_ptr ); +HYPRE_Int hypre_SStructGridSetNumGhost ( hypre_SStructGrid *grid, HYPRE_Int *num_ghost ); +HYPRE_Int hypre_SStructBoxManEntryGetGlobalRank ( hypre_BoxManEntry *entry, hypre_Index index, + HYPRE_BigInt *rank_ptr, HYPRE_Int type ); +HYPRE_Int hypre_SStructBoxManEntryGetStrides ( hypre_BoxManEntry *entry, hypre_Index strides, + HYPRE_Int type ); +HYPRE_Int hypre_SStructBoxNumMap ( hypre_SStructGrid *grid, HYPRE_Int part, HYPRE_Int boxnum, + HYPRE_Int **num_varboxes_ptr, HYPRE_Int ***map_ptr ); +HYPRE_Int hypre_SStructCellGridBoxNumMap ( hypre_SStructGrid *grid, HYPRE_Int part, + HYPRE_Int ***num_varboxes_ptr, HYPRE_Int ****map_ptr ); +HYPRE_Int hypre_SStructCellBoxToVarBox ( hypre_Box *box, hypre_Index offset, hypre_Index varoffset, + HYPRE_Int *valid ); +HYPRE_Int hypre_SStructGridIntersect ( hypre_SStructGrid *grid, HYPRE_Int part, HYPRE_Int var, + hypre_Box *box, HYPRE_Int action, hypre_BoxManEntry ***entries_ptr, HYPRE_Int *nentries_ptr ); +HYPRE_Int hypre_SStructGridGetMaxBoxSize ( hypre_SStructGrid *grid ); +HYPRE_Int hypre_SStructGridPrint ( FILE *file, hypre_SStructGrid *grid ); +HYPRE_Int hypre_SStructGridRead ( MPI_Comm comm, FILE *file, hypre_SStructGrid **grid_ptr ); /* sstruct_innerprod.c */ -HYPRE_Int hypre_SStructPInnerProd ( hypre_SStructPVector *px , hypre_SStructPVector *py , HYPRE_Real *presult_ptr ); -HYPRE_Int hypre_SStructInnerProd ( hypre_SStructVector *x , hypre_SStructVector *y , HYPRE_Real *result_ptr ); +HYPRE_Int hypre_SStructPInnerProd ( hypre_SStructPVector *px, hypre_SStructPVector *py, + HYPRE_Real *presult_ptr ); +HYPRE_Int hypre_SStructInnerProd ( hypre_SStructVector *x, hypre_SStructVector *y, + HYPRE_Real *result_ptr ); /* sstruct_matrix.c */ -HYPRE_Int hypre_SStructPMatrixRef ( hypre_SStructPMatrix *matrix , hypre_SStructPMatrix **matrix_ref ); -HYPRE_Int hypre_SStructPMatrixCreate ( MPI_Comm comm , hypre_SStructPGrid *pgrid , hypre_SStructStencil **stencils , hypre_SStructPMatrix **pmatrix_ptr ); +HYPRE_Int hypre_SStructPMatrixRef ( hypre_SStructPMatrix *matrix, + hypre_SStructPMatrix **matrix_ref ); +HYPRE_Int hypre_SStructPMatrixCreate ( MPI_Comm comm, hypre_SStructPGrid *pgrid, + hypre_SStructStencil **stencils, hypre_SStructPMatrix **pmatrix_ptr ); HYPRE_Int hypre_SStructPMatrixDestroy ( hypre_SStructPMatrix *pmatrix ); HYPRE_Int hypre_SStructPMatrixInitialize ( hypre_SStructPMatrix *pmatrix ); -HYPRE_Int hypre_SStructPMatrixSetValues ( hypre_SStructPMatrix *pmatrix , hypre_Index index , HYPRE_Int var , HYPRE_Int nentries , HYPRE_Int *entries , HYPRE_Complex *values , HYPRE_Int action ); -HYPRE_Int hypre_SStructPMatrixSetBoxValues( hypre_SStructPMatrix *pmatrix , hypre_Box *set_box , HYPRE_Int var , HYPRE_Int nentries , HYPRE_Int *entries , hypre_Box *value_box , HYPRE_Complex *values , HYPRE_Int action ); +HYPRE_Int hypre_SStructPMatrixSetValues ( hypre_SStructPMatrix *pmatrix, hypre_Index index, + HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Complex *values, HYPRE_Int action ); +HYPRE_Int hypre_SStructPMatrixSetBoxValues( hypre_SStructPMatrix *pmatrix, hypre_Box *set_box, + HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_Box *value_box, HYPRE_Complex *values, + HYPRE_Int action ); HYPRE_Int hypre_SStructPMatrixAccumulate ( hypre_SStructPMatrix *pmatrix ); HYPRE_Int hypre_SStructPMatrixAssemble ( hypre_SStructPMatrix *pmatrix ); -HYPRE_Int hypre_SStructPMatrixSetSymmetric ( hypre_SStructPMatrix *pmatrix , HYPRE_Int var , HYPRE_Int to_var , HYPRE_Int symmetric ); -HYPRE_Int hypre_SStructPMatrixPrint ( const char *filename , hypre_SStructPMatrix *pmatrix , HYPRE_Int all ); +HYPRE_Int hypre_SStructPMatrixSetSymmetric ( hypre_SStructPMatrix *pmatrix, HYPRE_Int var, + HYPRE_Int to_var, HYPRE_Int symmetric ); +HYPRE_Int hypre_SStructPMatrixPrint ( const char *filename, hypre_SStructPMatrix *pmatrix, + HYPRE_Int all ); HYPRE_Int hypre_SStructUMatrixInitialize ( hypre_SStructMatrix *matrix ); -HYPRE_Int hypre_SStructUMatrixSetValues ( hypre_SStructMatrix *matrix , HYPRE_Int part , hypre_Index index , HYPRE_Int var , HYPRE_Int nentries , HYPRE_Int *entries , HYPRE_Complex *values , HYPRE_Int action ); -HYPRE_Int hypre_SStructUMatrixSetBoxValues( hypre_SStructMatrix *matrix , HYPRE_Int part , hypre_Box *set_box , HYPRE_Int var , HYPRE_Int nentries , HYPRE_Int *entries , hypre_Box *value_box , HYPRE_Complex *values , HYPRE_Int action ); +HYPRE_Int hypre_SStructUMatrixSetValues ( hypre_SStructMatrix *matrix, HYPRE_Int part, + hypre_Index index, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Complex *values, + HYPRE_Int action ); +HYPRE_Int hypre_SStructUMatrixSetBoxValues( hypre_SStructMatrix *matrix, HYPRE_Int part, + hypre_Box *set_box, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_Box *value_box, + HYPRE_Complex *values, HYPRE_Int action ); HYPRE_Int hypre_SStructUMatrixAssemble ( hypre_SStructMatrix *matrix ); -HYPRE_Int hypre_SStructMatrixRef ( hypre_SStructMatrix *matrix , hypre_SStructMatrix **matrix_ref ); -HYPRE_Int hypre_SStructMatrixSplitEntries ( hypre_SStructMatrix *matrix , HYPRE_Int part , HYPRE_Int var , HYPRE_Int nentries , HYPRE_Int *entries , HYPRE_Int *nSentries_ptr , HYPRE_Int **Sentries_ptr , HYPRE_Int *nUentries_ptr , HYPRE_Int **Uentries_ptr ); -HYPRE_Int hypre_SStructMatrixSetValues ( HYPRE_SStructMatrix matrix , HYPRE_Int part , HYPRE_Int *index , HYPRE_Int var , HYPRE_Int nentries , HYPRE_Int *entries , HYPRE_Complex *values , HYPRE_Int action ); -HYPRE_Int hypre_SStructMatrixSetBoxValues( HYPRE_SStructMatrix matrix , HYPRE_Int part , hypre_Box *set_box , HYPRE_Int var , HYPRE_Int nentries , HYPRE_Int *entries , hypre_Box *value_box , HYPRE_Complex *values , HYPRE_Int action ); -HYPRE_Int hypre_SStructMatrixSetInterPartValues( HYPRE_SStructMatrix matrix , HYPRE_Int part , hypre_Box *set_box , HYPRE_Int var , HYPRE_Int nentries , HYPRE_Int *entries , hypre_Box *value_box , HYPRE_Complex *values , HYPRE_Int action ); +HYPRE_Int hypre_SStructMatrixRef ( hypre_SStructMatrix *matrix, hypre_SStructMatrix **matrix_ref ); +HYPRE_Int hypre_SStructMatrixSplitEntries ( hypre_SStructMatrix *matrix, HYPRE_Int part, + HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Int *nSentries_ptr, + HYPRE_Int **Sentries_ptr, HYPRE_Int *nUentries_ptr, HYPRE_Int **Uentries_ptr ); +HYPRE_Int hypre_SStructMatrixSetValues ( HYPRE_SStructMatrix matrix, HYPRE_Int part, + HYPRE_Int *index, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Complex *values, + HYPRE_Int action ); +HYPRE_Int hypre_SStructMatrixSetBoxValues( HYPRE_SStructMatrix matrix, HYPRE_Int part, + hypre_Box *set_box, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_Box *value_box, + HYPRE_Complex *values, HYPRE_Int action ); +HYPRE_Int hypre_SStructMatrixSetInterPartValues( HYPRE_SStructMatrix matrix, HYPRE_Int part, + hypre_Box *set_box, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_Box *value_box, + HYPRE_Complex *values, HYPRE_Int action ); +HYPRE_MemoryLocation hypre_SStructMatrixMemoryLocation(hypre_SStructMatrix *matrix); /* sstruct_matvec.c */ HYPRE_Int hypre_SStructPMatvecCreate ( void **pmatvec_vdata_ptr ); -HYPRE_Int hypre_SStructPMatvecSetup ( void *pmatvec_vdata , hypre_SStructPMatrix *pA , hypre_SStructPVector *px ); -HYPRE_Int hypre_SStructPMatvecCompute ( void *pmatvec_vdata , HYPRE_Complex alpha , hypre_SStructPMatrix *pA , hypre_SStructPVector *px , HYPRE_Complex beta , hypre_SStructPVector *py ); +HYPRE_Int hypre_SStructPMatvecSetup ( void *pmatvec_vdata, hypre_SStructPMatrix *pA, + hypre_SStructPVector *px ); +HYPRE_Int hypre_SStructPMatvecCompute ( void *pmatvec_vdata, HYPRE_Complex alpha, + hypre_SStructPMatrix *pA, hypre_SStructPVector *px, HYPRE_Complex beta, hypre_SStructPVector *py ); HYPRE_Int hypre_SStructPMatvecDestroy ( void *pmatvec_vdata ); -HYPRE_Int hypre_SStructPMatvec ( HYPRE_Complex alpha , hypre_SStructPMatrix *pA , hypre_SStructPVector *px , HYPRE_Complex beta , hypre_SStructPVector *py ); +HYPRE_Int hypre_SStructPMatvec ( HYPRE_Complex alpha, hypre_SStructPMatrix *pA, + hypre_SStructPVector *px, HYPRE_Complex beta, hypre_SStructPVector *py ); HYPRE_Int hypre_SStructMatvecCreate ( void **matvec_vdata_ptr ); -HYPRE_Int hypre_SStructMatvecSetup ( void *matvec_vdata , hypre_SStructMatrix *A , hypre_SStructVector *x ); -HYPRE_Int hypre_SStructMatvecCompute ( void *matvec_vdata , HYPRE_Complex alpha , hypre_SStructMatrix *A , hypre_SStructVector *x , HYPRE_Complex beta , hypre_SStructVector *y ); +HYPRE_Int hypre_SStructMatvecSetup ( void *matvec_vdata, hypre_SStructMatrix *A, + hypre_SStructVector *x ); +HYPRE_Int hypre_SStructMatvecCompute ( void *matvec_vdata, HYPRE_Complex alpha, + hypre_SStructMatrix *A, hypre_SStructVector *x, HYPRE_Complex beta, hypre_SStructVector *y ); HYPRE_Int hypre_SStructMatvecDestroy ( void *matvec_vdata ); -HYPRE_Int hypre_SStructMatvec ( HYPRE_Complex alpha , hypre_SStructMatrix *A , hypre_SStructVector *x , HYPRE_Complex beta , hypre_SStructVector *y ); +HYPRE_Int hypre_SStructMatvec ( HYPRE_Complex alpha, hypre_SStructMatrix *A, hypre_SStructVector *x, + HYPRE_Complex beta, hypre_SStructVector *y ); /* sstruct_scale.c */ -HYPRE_Int hypre_SStructPScale ( HYPRE_Complex alpha , hypre_SStructPVector *py ); -HYPRE_Int hypre_SStructScale ( HYPRE_Complex alpha , hypre_SStructVector *y ); +HYPRE_Int hypre_SStructPScale ( HYPRE_Complex alpha, hypre_SStructPVector *py ); +HYPRE_Int hypre_SStructScale ( HYPRE_Complex alpha, hypre_SStructVector *y ); /* sstruct_stencil.c */ -HYPRE_Int hypre_SStructStencilRef ( hypre_SStructStencil *stencil , hypre_SStructStencil **stencil_ref ); +HYPRE_Int hypre_SStructStencilRef ( hypre_SStructStencil *stencil, + hypre_SStructStencil **stencil_ref ); /* sstruct_vector.c */ -HYPRE_Int hypre_SStructPVectorRef ( hypre_SStructPVector *vector , hypre_SStructPVector **vector_ref ); -HYPRE_Int hypre_SStructPVectorCreate ( MPI_Comm comm , hypre_SStructPGrid *pgrid , hypre_SStructPVector **pvector_ptr ); +HYPRE_Int hypre_SStructPVectorRef ( hypre_SStructPVector *vector, + hypre_SStructPVector **vector_ref ); +HYPRE_Int hypre_SStructPVectorCreate ( MPI_Comm comm, hypre_SStructPGrid *pgrid, + hypre_SStructPVector **pvector_ptr ); HYPRE_Int hypre_SStructPVectorDestroy ( hypre_SStructPVector *pvector ); HYPRE_Int hypre_SStructPVectorInitialize ( hypre_SStructPVector *pvector ); -HYPRE_Int hypre_SStructPVectorSetValues ( hypre_SStructPVector *pvector , hypre_Index index , HYPRE_Int var , HYPRE_Complex *value , HYPRE_Int action ); -HYPRE_Int hypre_SStructPVectorSetBoxValues( hypre_SStructPVector *pvector , hypre_Box *set_box , HYPRE_Int var , hypre_Box *value_box , HYPRE_Complex *values , HYPRE_Int action ); +HYPRE_Int hypre_SStructPVectorSetValues ( hypre_SStructPVector *pvector, hypre_Index index, + HYPRE_Int var, HYPRE_Complex *value, HYPRE_Int action ); +HYPRE_Int hypre_SStructPVectorSetBoxValues( hypre_SStructPVector *pvector, hypre_Box *set_box, + HYPRE_Int var, hypre_Box *value_box, HYPRE_Complex *values, HYPRE_Int action ); HYPRE_Int hypre_SStructPVectorAccumulate ( hypre_SStructPVector *pvector ); HYPRE_Int hypre_SStructPVectorAssemble ( hypre_SStructPVector *pvector ); HYPRE_Int hypre_SStructPVectorGather ( hypre_SStructPVector *pvector ); -HYPRE_Int hypre_SStructPVectorGetValues ( hypre_SStructPVector *pvector , hypre_Index index , HYPRE_Int var , HYPRE_Complex *value ); -HYPRE_Int hypre_SStructPVectorGetBoxValues( hypre_SStructPVector *pvector , hypre_Box *set_box , HYPRE_Int var , hypre_Box *value_box , HYPRE_Complex *values ); -HYPRE_Int hypre_SStructPVectorSetConstantValues ( hypre_SStructPVector *pvector , HYPRE_Complex value ); -HYPRE_Int hypre_SStructPVectorPrint ( const char *filename , hypre_SStructPVector *pvector , HYPRE_Int all ); -HYPRE_Int hypre_SStructVectorRef ( hypre_SStructVector *vector , hypre_SStructVector **vector_ref ); -HYPRE_Int hypre_SStructVectorSetConstantValues ( hypre_SStructVector *vector , HYPRE_Complex value ); -HYPRE_Int hypre_SStructVectorConvert ( hypre_SStructVector *vector , hypre_ParVector **parvector_ptr ); -HYPRE_Int hypre_SStructVectorParConvert ( hypre_SStructVector *vector , hypre_ParVector **parvector_ptr ); -HYPRE_Int hypre_SStructVectorRestore ( hypre_SStructVector *vector , hypre_ParVector *parvector ); -HYPRE_Int hypre_SStructVectorParRestore ( hypre_SStructVector *vector , hypre_ParVector *parvector ); +HYPRE_Int hypre_SStructPVectorGetValues ( hypre_SStructPVector *pvector, hypre_Index index, + HYPRE_Int var, HYPRE_Complex *value ); +HYPRE_Int hypre_SStructPVectorGetBoxValues( hypre_SStructPVector *pvector, hypre_Box *set_box, + HYPRE_Int var, hypre_Box *value_box, HYPRE_Complex *values ); +HYPRE_Int hypre_SStructPVectorSetConstantValues ( hypre_SStructPVector *pvector, + HYPRE_Complex value ); +HYPRE_Int hypre_SStructPVectorPrint ( const char *filename, hypre_SStructPVector *pvector, + HYPRE_Int all ); +HYPRE_Int hypre_SStructVectorRef ( hypre_SStructVector *vector, hypre_SStructVector **vector_ref ); +HYPRE_Int hypre_SStructVectorSetConstantValues ( hypre_SStructVector *vector, HYPRE_Complex value ); +HYPRE_Int hypre_SStructVectorConvert ( hypre_SStructVector *vector, + hypre_ParVector **parvector_ptr ); +HYPRE_Int hypre_SStructVectorParConvert ( hypre_SStructVector *vector, + hypre_ParVector **parvector_ptr ); +HYPRE_Int hypre_SStructVectorRestore ( hypre_SStructVector *vector, hypre_ParVector *parvector ); +HYPRE_Int hypre_SStructVectorParRestore ( hypre_SStructVector *vector, hypre_ParVector *parvector ); HYPRE_Int hypre_SStructPVectorInitializeShell ( hypre_SStructPVector *pvector ); HYPRE_Int hypre_SStructVectorInitializeShell ( hypre_SStructVector *vector ); HYPRE_Int hypre_SStructVectorClearGhostValues ( hypre_SStructVector *vector ); +HYPRE_MemoryLocation hypre_SStructVectorMemoryLocation(hypre_SStructVector *vector); #ifdef __cplusplus diff --git a/external/hypre/src/sstruct_mv/headers b/external/hypre/src/sstruct_mv/headers old mode 100644 new mode 100755 index f33c02d7..9e07536f --- a/external/hypre/src/sstruct_mv/headers +++ b/external/hypre/src/sstruct_mv/headers @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/sstruct_mv/protos.h b/external/hypre/src/sstruct_mv/protos.h index 40c78aa9..a86329ee 100644 --- a/external/hypre/src/sstruct_mv/protos.h +++ b/external/hypre/src/sstruct_mv/protos.h @@ -1,199 +1,326 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ /* HYPRE_sstruct_graph.c */ -HYPRE_Int HYPRE_SStructGraphCreate ( MPI_Comm comm , HYPRE_SStructGrid grid , HYPRE_SStructGraph *graph_ptr ); +HYPRE_Int HYPRE_SStructGraphCreate ( MPI_Comm comm, HYPRE_SStructGrid grid, + HYPRE_SStructGraph *graph_ptr ); HYPRE_Int HYPRE_SStructGraphDestroy ( HYPRE_SStructGraph graph ); -HYPRE_Int HYPRE_SStructGraphSetDomainGrid ( HYPRE_SStructGraph graph , HYPRE_SStructGrid domain_grid ); -HYPRE_Int HYPRE_SStructGraphSetStencil ( HYPRE_SStructGraph graph , HYPRE_Int part , HYPRE_Int var , HYPRE_SStructStencil stencil ); -HYPRE_Int HYPRE_SStructGraphSetFEM ( HYPRE_SStructGraph graph , HYPRE_Int part ); -HYPRE_Int HYPRE_SStructGraphSetFEMSparsity ( HYPRE_SStructGraph graph , HYPRE_Int part , HYPRE_Int nsparse , HYPRE_Int *sparsity ); -HYPRE_Int HYPRE_SStructGraphAddEntries ( HYPRE_SStructGraph graph , HYPRE_Int part , HYPRE_Int *index , HYPRE_Int var , HYPRE_Int to_part , HYPRE_Int *to_index , HYPRE_Int to_var ); +HYPRE_Int HYPRE_SStructGraphSetDomainGrid ( HYPRE_SStructGraph graph, + HYPRE_SStructGrid domain_grid ); +HYPRE_Int HYPRE_SStructGraphSetStencil ( HYPRE_SStructGraph graph, HYPRE_Int part, HYPRE_Int var, + HYPRE_SStructStencil stencil ); +HYPRE_Int HYPRE_SStructGraphSetFEM ( HYPRE_SStructGraph graph, HYPRE_Int part ); +HYPRE_Int HYPRE_SStructGraphSetFEMSparsity ( HYPRE_SStructGraph graph, HYPRE_Int part, + HYPRE_Int nsparse, HYPRE_Int *sparsity ); +HYPRE_Int HYPRE_SStructGraphAddEntries ( HYPRE_SStructGraph graph, HYPRE_Int part, HYPRE_Int *index, + HYPRE_Int var, HYPRE_Int to_part, HYPRE_Int *to_index, HYPRE_Int to_var ); HYPRE_Int HYPRE_SStructGraphAssemble ( HYPRE_SStructGraph graph ); -HYPRE_Int HYPRE_SStructGraphSetObjectType ( HYPRE_SStructGraph graph , HYPRE_Int type ); +HYPRE_Int HYPRE_SStructGraphSetObjectType ( HYPRE_SStructGraph graph, HYPRE_Int type ); +HYPRE_Int HYPRE_SStructGraphPrint ( FILE *file, HYPRE_SStructGraph graph ); +HYPRE_Int HYPRE_SStructGraphRead ( FILE *file, HYPRE_SStructGrid grid, + HYPRE_SStructStencil **stencils, HYPRE_SStructGraph *graph_ptr ); /* HYPRE_sstruct_grid.c */ -HYPRE_Int HYPRE_SStructGridCreate ( MPI_Comm comm , HYPRE_Int ndim , HYPRE_Int nparts , HYPRE_SStructGrid *grid_ptr ); +HYPRE_Int HYPRE_SStructGridCreate ( MPI_Comm comm, HYPRE_Int ndim, HYPRE_Int nparts, + HYPRE_SStructGrid *grid_ptr ); HYPRE_Int HYPRE_SStructGridDestroy ( HYPRE_SStructGrid grid ); -HYPRE_Int HYPRE_SStructGridSetExtents ( HYPRE_SStructGrid grid , HYPRE_Int part , HYPRE_Int *ilower , HYPRE_Int *iupper ); -HYPRE_Int HYPRE_SStructGridSetVariables ( HYPRE_SStructGrid grid , HYPRE_Int part , HYPRE_Int nvars , HYPRE_SStructVariable *vartypes ); -HYPRE_Int HYPRE_SStructGridAddVariables ( HYPRE_SStructGrid grid , HYPRE_Int part , HYPRE_Int *index , HYPRE_Int nvars , HYPRE_SStructVariable *vartypes ); -HYPRE_Int HYPRE_SStructGridSetFEMOrdering ( HYPRE_SStructGrid grid , HYPRE_Int part , HYPRE_Int *ordering ); -HYPRE_Int HYPRE_SStructGridSetNeighborPart ( HYPRE_SStructGrid grid , HYPRE_Int part , HYPRE_Int *ilower , HYPRE_Int *iupper , HYPRE_Int nbor_part , HYPRE_Int *nbor_ilower , HYPRE_Int *nbor_iupper , HYPRE_Int *index_map , HYPRE_Int *index_dir ); -HYPRE_Int HYPRE_SStructGridSetSharedPart ( HYPRE_SStructGrid grid , HYPRE_Int part , HYPRE_Int *ilower , HYPRE_Int *iupper , HYPRE_Int *offset , HYPRE_Int shared_part , HYPRE_Int *shared_ilower , HYPRE_Int *shared_iupper , HYPRE_Int *shared_offset , HYPRE_Int *index_map , HYPRE_Int *index_dir ); -HYPRE_Int HYPRE_SStructGridAddUnstructuredPart ( HYPRE_SStructGrid grid , HYPRE_Int ilower , HYPRE_Int iupper ); +HYPRE_Int HYPRE_SStructGridSetExtents ( HYPRE_SStructGrid grid, HYPRE_Int part, HYPRE_Int *ilower, + HYPRE_Int *iupper ); +HYPRE_Int HYPRE_SStructGridSetVariables ( HYPRE_SStructGrid grid, HYPRE_Int part, HYPRE_Int nvars, + HYPRE_SStructVariable *vartypes ); +HYPRE_Int HYPRE_SStructGridAddVariables ( HYPRE_SStructGrid grid, HYPRE_Int part, HYPRE_Int *index, + HYPRE_Int nvars, HYPRE_SStructVariable *vartypes ); +HYPRE_Int HYPRE_SStructGridSetFEMOrdering ( HYPRE_SStructGrid grid, HYPRE_Int part, + HYPRE_Int *ordering ); +HYPRE_Int HYPRE_SStructGridSetNeighborPart ( HYPRE_SStructGrid grid, HYPRE_Int part, + HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int nbor_part, HYPRE_Int *nbor_ilower, + HYPRE_Int *nbor_iupper, HYPRE_Int *index_map, HYPRE_Int *index_dir ); +HYPRE_Int HYPRE_SStructGridSetSharedPart ( HYPRE_SStructGrid grid, HYPRE_Int part, + HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int *offset, HYPRE_Int shared_part, + HYPRE_Int *shared_ilower, HYPRE_Int *shared_iupper, HYPRE_Int *shared_offset, HYPRE_Int *index_map, + HYPRE_Int *index_dir ); +HYPRE_Int HYPRE_SStructGridAddUnstructuredPart ( HYPRE_SStructGrid grid, HYPRE_Int ilower, + HYPRE_Int iupper ); HYPRE_Int HYPRE_SStructGridAssemble ( HYPRE_SStructGrid grid ); -HYPRE_Int HYPRE_SStructGridSetPeriodic ( HYPRE_SStructGrid grid , HYPRE_Int part , HYPRE_Int *periodic ); -HYPRE_Int HYPRE_SStructGridSetNumGhost ( HYPRE_SStructGrid grid , HYPRE_Int *num_ghost ); +HYPRE_Int HYPRE_SStructGridSetPeriodic ( HYPRE_SStructGrid grid, HYPRE_Int part, + HYPRE_Int *periodic ); +HYPRE_Int HYPRE_SStructGridSetNumGhost ( HYPRE_SStructGrid grid, HYPRE_Int *num_ghost ); /* HYPRE_sstruct_matrix.c */ -HYPRE_Int HYPRE_SStructMatrixCreate ( MPI_Comm comm , HYPRE_SStructGraph graph , HYPRE_SStructMatrix *matrix_ptr ); +HYPRE_Int HYPRE_SStructMatrixCreate ( MPI_Comm comm, HYPRE_SStructGraph graph, + HYPRE_SStructMatrix *matrix_ptr ); HYPRE_Int HYPRE_SStructMatrixDestroy ( HYPRE_SStructMatrix matrix ); HYPRE_Int HYPRE_SStructMatrixInitialize ( HYPRE_SStructMatrix matrix ); -HYPRE_Int HYPRE_SStructMatrixSetValues ( HYPRE_SStructMatrix matrix , HYPRE_Int part , HYPRE_Int *index , HYPRE_Int var , HYPRE_Int nentries , HYPRE_Int *entries , HYPRE_Complex *values ); -HYPRE_Int HYPRE_SStructMatrixAddToValues ( HYPRE_SStructMatrix matrix , HYPRE_Int part , HYPRE_Int *index , HYPRE_Int var , HYPRE_Int nentries , HYPRE_Int *entries , HYPRE_Complex *values ); -HYPRE_Int HYPRE_SStructMatrixAddFEMValues ( HYPRE_SStructMatrix matrix , HYPRE_Int part , HYPRE_Int *index , HYPRE_Complex *values ); -HYPRE_Int HYPRE_SStructMatrixGetValues ( HYPRE_SStructMatrix matrix , HYPRE_Int part , HYPRE_Int *index , HYPRE_Int var , HYPRE_Int nentries , HYPRE_Int *entries , HYPRE_Complex *values ); -HYPRE_Int HYPRE_SStructMatrixGetFEMValues ( HYPRE_SStructMatrix matrix , HYPRE_Int part , HYPRE_Int *index , HYPRE_Complex *values ); -HYPRE_Int HYPRE_SStructMatrixSetBoxValues ( HYPRE_SStructMatrix matrix , HYPRE_Int part , HYPRE_Int *ilower , HYPRE_Int *iupper , HYPRE_Int var , HYPRE_Int nentries , HYPRE_Int *entries , HYPRE_Complex *values ); -HYPRE_Int HYPRE_SStructMatrixAddToBoxValues ( HYPRE_SStructMatrix matrix , HYPRE_Int part , HYPRE_Int *ilower , HYPRE_Int *iupper , HYPRE_Int var , HYPRE_Int nentries , HYPRE_Int *entries , HYPRE_Complex *values ); -HYPRE_Int HYPRE_SStructMatrixGetBoxValues ( HYPRE_SStructMatrix matrix , HYPRE_Int part , HYPRE_Int *ilower , HYPRE_Int *iupper , HYPRE_Int var , HYPRE_Int nentries , HYPRE_Int *entries , HYPRE_Complex *values ); +HYPRE_Int HYPRE_SStructMatrixSetValues ( HYPRE_SStructMatrix matrix, HYPRE_Int part, + HYPRE_Int *index, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Complex *values ); +HYPRE_Int HYPRE_SStructMatrixAddToValues ( HYPRE_SStructMatrix matrix, HYPRE_Int part, + HYPRE_Int *index, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Complex *values ); +HYPRE_Int HYPRE_SStructMatrixAddFEMValues ( HYPRE_SStructMatrix matrix, HYPRE_Int part, + HYPRE_Int *index, HYPRE_Complex *values ); +HYPRE_Int HYPRE_SStructMatrixGetValues ( HYPRE_SStructMatrix matrix, HYPRE_Int part, + HYPRE_Int *index, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Complex *values ); +HYPRE_Int HYPRE_SStructMatrixGetFEMValues ( HYPRE_SStructMatrix matrix, HYPRE_Int part, + HYPRE_Int *index, HYPRE_Complex *values ); +HYPRE_Int HYPRE_SStructMatrixSetBoxValues ( HYPRE_SStructMatrix matrix, HYPRE_Int part, + HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, + HYPRE_Complex *values ); +HYPRE_Int HYPRE_SStructMatrixAddToBoxValues ( HYPRE_SStructMatrix matrix, HYPRE_Int part, + HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, + HYPRE_Complex *values ); +HYPRE_Int HYPRE_SStructMatrixGetBoxValues ( HYPRE_SStructMatrix matrix, HYPRE_Int part, + HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, + HYPRE_Complex *values ); HYPRE_Int HYPRE_SStructMatrixAssemble ( HYPRE_SStructMatrix matrix ); -HYPRE_Int HYPRE_SStructMatrixSetSymmetric ( HYPRE_SStructMatrix matrix , HYPRE_Int part , HYPRE_Int var , HYPRE_Int to_var , HYPRE_Int symmetric ); -HYPRE_Int HYPRE_SStructMatrixSetNSSymmetric ( HYPRE_SStructMatrix matrix , HYPRE_Int symmetric ); -HYPRE_Int HYPRE_SStructMatrixSetObjectType ( HYPRE_SStructMatrix matrix , HYPRE_Int type ); -HYPRE_Int HYPRE_SStructMatrixGetObject ( HYPRE_SStructMatrix matrix , void **object ); -HYPRE_Int HYPRE_SStructMatrixPrint ( const char *filename , HYPRE_SStructMatrix matrix , HYPRE_Int all ); -HYPRE_Int HYPRE_SStructMatrixMatvec ( HYPRE_Complex alpha , HYPRE_SStructMatrix A , HYPRE_SStructVector x , HYPRE_Complex beta , HYPRE_SStructVector y ); +HYPRE_Int HYPRE_SStructMatrixSetSymmetric ( HYPRE_SStructMatrix matrix, HYPRE_Int part, + HYPRE_Int var, HYPRE_Int to_var, HYPRE_Int symmetric ); +HYPRE_Int HYPRE_SStructMatrixSetNSSymmetric ( HYPRE_SStructMatrix matrix, HYPRE_Int symmetric ); +HYPRE_Int HYPRE_SStructMatrixSetObjectType ( HYPRE_SStructMatrix matrix, HYPRE_Int type ); +HYPRE_Int HYPRE_SStructMatrixGetObject ( HYPRE_SStructMatrix matrix, void **object ); +HYPRE_Int HYPRE_SStructMatrixPrint ( const char *filename, HYPRE_SStructMatrix matrix, + HYPRE_Int all ); +HYPRE_Int HYPRE_SStructMatrixRead ( MPI_Comm comm, const char *filename, + HYPRE_SStructMatrix *matrix_ptr ); +HYPRE_Int HYPRE_SStructMatrixMatvec ( HYPRE_Complex alpha, HYPRE_SStructMatrix A, + HYPRE_SStructVector x, HYPRE_Complex beta, HYPRE_SStructVector y ); /* HYPRE_sstruct_stencil.c */ -HYPRE_Int HYPRE_SStructStencilCreate ( HYPRE_Int ndim , HYPRE_Int size , HYPRE_SStructStencil *stencil_ptr ); +HYPRE_Int HYPRE_SStructStencilCreate ( HYPRE_Int ndim, HYPRE_Int size, + HYPRE_SStructStencil *stencil_ptr ); HYPRE_Int HYPRE_SStructStencilDestroy ( HYPRE_SStructStencil stencil ); -HYPRE_Int HYPRE_SStructStencilSetEntry ( HYPRE_SStructStencil stencil , HYPRE_Int entry , HYPRE_Int *offset , HYPRE_Int var ); +HYPRE_Int HYPRE_SStructStencilSetEntry ( HYPRE_SStructStencil stencil, HYPRE_Int entry, + HYPRE_Int *offset, HYPRE_Int var ); +HYPRE_Int HYPRE_SStructStencilPrint ( FILE *file, HYPRE_SStructStencil stencil ); +HYPRE_Int HYPRE_SStructStencilRead ( FILE *file, HYPRE_SStructStencil *stencil_ptr ); + /* HYPRE_sstruct_vector.c */ -HYPRE_Int HYPRE_SStructVectorCreate ( MPI_Comm comm , HYPRE_SStructGrid grid , HYPRE_SStructVector *vector_ptr ); +HYPRE_Int HYPRE_SStructVectorCreate ( MPI_Comm comm, HYPRE_SStructGrid grid, + HYPRE_SStructVector *vector_ptr ); HYPRE_Int HYPRE_SStructVectorDestroy ( HYPRE_SStructVector vector ); HYPRE_Int HYPRE_SStructVectorInitialize ( HYPRE_SStructVector vector ); -HYPRE_Int HYPRE_SStructVectorSetValues ( HYPRE_SStructVector vector , HYPRE_Int part , HYPRE_Int *index , HYPRE_Int var , HYPRE_Complex *value ); -HYPRE_Int HYPRE_SStructVectorAddToValues ( HYPRE_SStructVector vector , HYPRE_Int part , HYPRE_Int *index , HYPRE_Int var , HYPRE_Complex *value ); -HYPRE_Int HYPRE_SStructVectorAddFEMValues ( HYPRE_SStructVector vector , HYPRE_Int part , HYPRE_Int *index , HYPRE_Complex *values ); -HYPRE_Int HYPRE_SStructVectorGetValues ( HYPRE_SStructVector vector , HYPRE_Int part , HYPRE_Int *index , HYPRE_Int var , HYPRE_Complex *value ); -HYPRE_Int HYPRE_SStructVectorGetFEMValues ( HYPRE_SStructVector vector , HYPRE_Int part , HYPRE_Int *index , HYPRE_Complex *values ); -HYPRE_Int HYPRE_SStructVectorSetBoxValues ( HYPRE_SStructVector vector , HYPRE_Int part , HYPRE_Int *ilower , HYPRE_Int *iupper , HYPRE_Int var , HYPRE_Complex *values ); -HYPRE_Int HYPRE_SStructVectorAddToBoxValues ( HYPRE_SStructVector vector , HYPRE_Int part , HYPRE_Int *ilower , HYPRE_Int *iupper , HYPRE_Int var , HYPRE_Complex *values ); -HYPRE_Int HYPRE_SStructVectorGetBoxValues ( HYPRE_SStructVector vector , HYPRE_Int part , HYPRE_Int *ilower , HYPRE_Int *iupper , HYPRE_Int var , HYPRE_Complex *values ); +HYPRE_Int HYPRE_SStructVectorSetValues ( HYPRE_SStructVector vector, HYPRE_Int part, + HYPRE_Int *index, HYPRE_Int var, HYPRE_Complex *value ); +HYPRE_Int HYPRE_SStructVectorAddToValues ( HYPRE_SStructVector vector, HYPRE_Int part, + HYPRE_Int *index, HYPRE_Int var, HYPRE_Complex *value ); +HYPRE_Int HYPRE_SStructVectorAddFEMValues ( HYPRE_SStructVector vector, HYPRE_Int part, + HYPRE_Int *index, HYPRE_Complex *values ); +HYPRE_Int HYPRE_SStructVectorGetValues ( HYPRE_SStructVector vector, HYPRE_Int part, + HYPRE_Int *index, HYPRE_Int var, HYPRE_Complex *value ); +HYPRE_Int HYPRE_SStructVectorGetFEMValues ( HYPRE_SStructVector vector, HYPRE_Int part, + HYPRE_Int *index, HYPRE_Complex *values ); +HYPRE_Int HYPRE_SStructVectorSetBoxValues ( HYPRE_SStructVector vector, HYPRE_Int part, + HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Complex *values ); +HYPRE_Int HYPRE_SStructVectorAddToBoxValues ( HYPRE_SStructVector vector, HYPRE_Int part, + HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Complex *values ); +HYPRE_Int HYPRE_SStructVectorGetBoxValues ( HYPRE_SStructVector vector, HYPRE_Int part, + HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Complex *values ); HYPRE_Int HYPRE_SStructVectorAssemble ( HYPRE_SStructVector vector ); HYPRE_Int HYPRE_SStructVectorGather ( HYPRE_SStructVector vector ); -HYPRE_Int HYPRE_SStructVectorSetConstantValues ( HYPRE_SStructVector vector , HYPRE_Complex value ); -HYPRE_Int HYPRE_SStructVectorSetObjectType ( HYPRE_SStructVector vector , HYPRE_Int type ); -HYPRE_Int HYPRE_SStructVectorGetObject ( HYPRE_SStructVector vector , void **object ); -HYPRE_Int HYPRE_SStructVectorPrint ( const char *filename , HYPRE_SStructVector vector , HYPRE_Int all ); -HYPRE_Int HYPRE_SStructVectorCopy ( HYPRE_SStructVector x , HYPRE_SStructVector y ); -HYPRE_Int HYPRE_SStructVectorScale ( HYPRE_Complex alpha , HYPRE_SStructVector y ); -HYPRE_Int HYPRE_SStructInnerProd ( HYPRE_SStructVector x , HYPRE_SStructVector y , HYPRE_Real *result ); -HYPRE_Int HYPRE_SStructAxpy ( HYPRE_Complex alpha , HYPRE_SStructVector x , HYPRE_SStructVector y ); +HYPRE_Int HYPRE_SStructVectorSetConstantValues ( HYPRE_SStructVector vector, HYPRE_Complex value ); +HYPRE_Int HYPRE_SStructVectorSetObjectType ( HYPRE_SStructVector vector, HYPRE_Int type ); +HYPRE_Int HYPRE_SStructVectorGetObject ( HYPRE_SStructVector vector, void **object ); +HYPRE_Int HYPRE_SStructVectorPrint ( const char *filename, HYPRE_SStructVector vector, + HYPRE_Int all ); +HYPRE_Int HYPRE_SStructVectorRead ( MPI_Comm comm, const char *filename, + HYPRE_SStructVector *vector ); +HYPRE_Int HYPRE_SStructVectorCopy ( HYPRE_SStructVector x, HYPRE_SStructVector y ); +HYPRE_Int HYPRE_SStructVectorScale ( HYPRE_Complex alpha, HYPRE_SStructVector y ); +HYPRE_Int HYPRE_SStructInnerProd ( HYPRE_SStructVector x, HYPRE_SStructVector y, + HYPRE_Real *result ); +HYPRE_Int HYPRE_SStructAxpy ( HYPRE_Complex alpha, HYPRE_SStructVector x, HYPRE_SStructVector y ); /* sstruct_axpy.c */ -HYPRE_Int hypre_SStructPAxpy ( HYPRE_Complex alpha , hypre_SStructPVector *px , hypre_SStructPVector *py ); -HYPRE_Int hypre_SStructAxpy ( HYPRE_Complex alpha , hypre_SStructVector *x , hypre_SStructVector *y ); +HYPRE_Int hypre_SStructPAxpy ( HYPRE_Complex alpha, hypre_SStructPVector *px, + hypre_SStructPVector *py ); +HYPRE_Int hypre_SStructAxpy ( HYPRE_Complex alpha, hypre_SStructVector *x, hypre_SStructVector *y ); /* sstruct_copy.c */ -HYPRE_Int hypre_SStructPCopy ( hypre_SStructPVector *px , hypre_SStructPVector *py ); -HYPRE_Int hypre_SStructPartialPCopy ( hypre_SStructPVector *px , hypre_SStructPVector *py , hypre_BoxArrayArray **array_boxes ); -HYPRE_Int hypre_SStructCopy ( hypre_SStructVector *x , hypre_SStructVector *y ); +HYPRE_Int hypre_SStructPCopy ( hypre_SStructPVector *px, hypre_SStructPVector *py ); +HYPRE_Int hypre_SStructPartialPCopy ( hypre_SStructPVector *px, hypre_SStructPVector *py, + hypre_BoxArrayArray **array_boxes ); +HYPRE_Int hypre_SStructCopy ( hypre_SStructVector *x, hypre_SStructVector *y ); /* sstruct_graph.c */ -HYPRE_Int hypre_SStructGraphRef ( hypre_SStructGraph *graph , hypre_SStructGraph **graph_ref ); -HYPRE_Int hypre_SStructGraphGetUVEntryRank( hypre_SStructGraph *graph , HYPRE_Int part , HYPRE_Int var , hypre_Index index, HYPRE_BigInt *rank ); -HYPRE_Int hypre_SStructGraphFindBoxEndpt ( hypre_SStructGraph *graph , HYPRE_Int part , HYPRE_Int var , HYPRE_Int proc , HYPRE_Int endpt , HYPRE_Int boxi ); -HYPRE_Int hypre_SStructGraphFindSGridEndpts ( hypre_SStructGraph *graph , HYPRE_Int part , HYPRE_Int var , HYPRE_Int proc , HYPRE_Int endpt , HYPRE_Int *endpts ); +HYPRE_Int hypre_SStructGraphRef ( hypre_SStructGraph *graph, hypre_SStructGraph **graph_ref ); +HYPRE_Int hypre_SStructGraphGetUVEntryRank( hypre_SStructGraph *graph, HYPRE_Int part, + HYPRE_Int var, hypre_Index index, HYPRE_BigInt *rank ); +HYPRE_Int hypre_SStructGraphFindBoxEndpt ( hypre_SStructGraph *graph, HYPRE_Int part, HYPRE_Int var, + HYPRE_Int proc, HYPRE_Int endpt, HYPRE_Int boxi ); +HYPRE_Int hypre_SStructGraphFindSGridEndpts ( hypre_SStructGraph *graph, HYPRE_Int part, + HYPRE_Int var, HYPRE_Int proc, HYPRE_Int endpt, HYPRE_Int *endpts ); /* sstruct_grid.c */ -HYPRE_Int hypre_SStructVariableGetOffset ( HYPRE_SStructVariable vartype , HYPRE_Int ndim , hypre_Index varoffset ); -HYPRE_Int hypre_SStructPGridCreate ( MPI_Comm comm , HYPRE_Int ndim , hypre_SStructPGrid **pgrid_ptr ); +HYPRE_Int hypre_SStructVariableGetOffset ( HYPRE_SStructVariable vartype, HYPRE_Int ndim, + hypre_Index varoffset ); +HYPRE_Int hypre_SStructPGridCreate ( MPI_Comm comm, HYPRE_Int ndim, + hypre_SStructPGrid **pgrid_ptr ); HYPRE_Int hypre_SStructPGridDestroy ( hypre_SStructPGrid *pgrid ); -HYPRE_Int hypre_SStructPGridSetExtents ( hypre_SStructPGrid *pgrid , hypre_Index ilower , hypre_Index iupper ); -HYPRE_Int hypre_SStructPGridSetCellSGrid ( hypre_SStructPGrid *pgrid , hypre_StructGrid *cell_sgrid ); -HYPRE_Int hypre_SStructPGridSetVariables ( hypre_SStructPGrid *pgrid , HYPRE_Int nvars , HYPRE_SStructVariable *vartypes ); -HYPRE_Int hypre_SStructPGridSetPNeighbor ( hypre_SStructPGrid *pgrid , hypre_Box *pneighbor_box , hypre_Index pnbor_offset ); +HYPRE_Int hypre_SStructPGridSetExtents ( hypre_SStructPGrid *pgrid, hypre_Index ilower, + hypre_Index iupper ); +HYPRE_Int hypre_SStructPGridSetCellSGrid ( hypre_SStructPGrid *pgrid, + hypre_StructGrid *cell_sgrid ); +HYPRE_Int hypre_SStructPGridSetVariables ( hypre_SStructPGrid *pgrid, HYPRE_Int nvars, + HYPRE_SStructVariable *vartypes ); +HYPRE_Int hypre_SStructPGridSetPNeighbor ( hypre_SStructPGrid *pgrid, hypre_Box *pneighbor_box, + hypre_Index pnbor_offset ); HYPRE_Int hypre_SStructPGridAssemble ( hypre_SStructPGrid *pgrid ); -HYPRE_Int hypre_SStructGridRef ( hypre_SStructGrid *grid , hypre_SStructGrid **grid_ref ); +HYPRE_Int hypre_SStructPGridGetMaxBoxSize ( hypre_SStructPGrid *pgrid ); +HYPRE_Int hypre_SStructGridRef ( hypre_SStructGrid *grid, hypre_SStructGrid **grid_ref ); HYPRE_Int hypre_SStructGridAssembleBoxManagers ( hypre_SStructGrid *grid ); HYPRE_Int hypre_SStructGridAssembleNborBoxManagers ( hypre_SStructGrid *grid ); HYPRE_Int hypre_SStructGridCreateCommInfo ( hypre_SStructGrid *grid ); -HYPRE_Int hypre_SStructGridFindBoxManEntry ( hypre_SStructGrid *grid , HYPRE_Int part , hypre_Index index , HYPRE_Int var , hypre_BoxManEntry **entry_ptr ); -HYPRE_Int hypre_SStructGridFindNborBoxManEntry ( hypre_SStructGrid *grid , HYPRE_Int part , hypre_Index index , HYPRE_Int var , hypre_BoxManEntry **entry_ptr ); -HYPRE_Int hypre_SStructGridBoxProcFindBoxManEntry ( hypre_SStructGrid *grid , HYPRE_Int part , HYPRE_Int var , HYPRE_Int box , HYPRE_Int proc , hypre_BoxManEntry **entry_ptr ); -HYPRE_Int hypre_SStructBoxManEntryGetCSRstrides ( hypre_BoxManEntry *entry , hypre_Index strides ); -HYPRE_Int hypre_SStructBoxManEntryGetGhstrides ( hypre_BoxManEntry *entry , hypre_Index strides ); -HYPRE_Int hypre_SStructBoxManEntryGetGlobalCSRank ( hypre_BoxManEntry *entry , hypre_Index index , HYPRE_BigInt *rank_ptr ); -HYPRE_Int hypre_SStructBoxManEntryGetGlobalGhrank ( hypre_BoxManEntry *entry , hypre_Index index , HYPRE_BigInt *rank_ptr ); -HYPRE_Int hypre_SStructBoxManEntryGetProcess ( hypre_BoxManEntry *entry , HYPRE_Int *proc_ptr ); -HYPRE_Int hypre_SStructBoxManEntryGetBoxnum ( hypre_BoxManEntry *entry , HYPRE_Int *id_ptr ); -HYPRE_Int hypre_SStructBoxManEntryGetPart ( hypre_BoxManEntry *entry , HYPRE_Int part , HYPRE_Int *part_ptr ); -HYPRE_Int hypre_SStructIndexToNborIndex( hypre_Index index , hypre_Index root , hypre_Index nbor_root , hypre_Index coord , hypre_Index dir , HYPRE_Int ndim , hypre_Index nbor_index ); -HYPRE_Int hypre_SStructBoxToNborBox ( hypre_Box *box , hypre_Index root , hypre_Index nbor_root , hypre_Index coord , hypre_Index dir ); -HYPRE_Int hypre_SStructNborIndexToIndex( hypre_Index nbor_index , hypre_Index root , hypre_Index nbor_root , hypre_Index coord , hypre_Index dir , HYPRE_Int ndim , hypre_Index index ); -HYPRE_Int hypre_SStructNborBoxToBox ( hypre_Box *nbor_box , hypre_Index root , hypre_Index nbor_root , hypre_Index coord , hypre_Index dir ); -HYPRE_Int hypre_SStructVarToNborVar ( hypre_SStructGrid *grid , HYPRE_Int part , HYPRE_Int var , HYPRE_Int *coord , HYPRE_Int *nbor_var_ptr ); -HYPRE_Int hypre_SStructGridSetNumGhost ( hypre_SStructGrid *grid , HYPRE_Int *num_ghost ); -HYPRE_Int hypre_SStructBoxManEntryGetGlobalRank ( hypre_BoxManEntry *entry , hypre_Index index , HYPRE_BigInt *rank_ptr , HYPRE_Int type ); -HYPRE_Int hypre_SStructBoxManEntryGetStrides ( hypre_BoxManEntry *entry , hypre_Index strides , HYPRE_Int type ); -HYPRE_Int hypre_SStructBoxNumMap ( hypre_SStructGrid *grid , HYPRE_Int part , HYPRE_Int boxnum , HYPRE_Int **num_varboxes_ptr , HYPRE_Int ***map_ptr ); -HYPRE_Int hypre_SStructCellGridBoxNumMap ( hypre_SStructGrid *grid , HYPRE_Int part , HYPRE_Int ***num_varboxes_ptr , HYPRE_Int ****map_ptr ); -HYPRE_Int hypre_SStructCellBoxToVarBox ( hypre_Box *box , hypre_Index offset , hypre_Index varoffset , HYPRE_Int *valid ); -HYPRE_Int hypre_SStructGridIntersect ( hypre_SStructGrid *grid , HYPRE_Int part , HYPRE_Int var , hypre_Box *box , HYPRE_Int action , hypre_BoxManEntry ***entries_ptr , HYPRE_Int *nentries_ptr ); +HYPRE_Int hypre_SStructGridFindBoxManEntry ( hypre_SStructGrid *grid, HYPRE_Int part, + hypre_Index index, HYPRE_Int var, hypre_BoxManEntry **entry_ptr ); +HYPRE_Int hypre_SStructGridFindNborBoxManEntry ( hypre_SStructGrid *grid, HYPRE_Int part, + hypre_Index index, HYPRE_Int var, hypre_BoxManEntry **entry_ptr ); +HYPRE_Int hypre_SStructGridBoxProcFindBoxManEntry ( hypre_SStructGrid *grid, HYPRE_Int part, + HYPRE_Int var, HYPRE_Int box, HYPRE_Int proc, hypre_BoxManEntry **entry_ptr ); +HYPRE_Int hypre_SStructBoxManEntryGetCSRstrides ( hypre_BoxManEntry *entry, hypre_Index strides ); +HYPRE_Int hypre_SStructBoxManEntryGetGhstrides ( hypre_BoxManEntry *entry, hypre_Index strides ); +HYPRE_Int hypre_SStructBoxManEntryGetGlobalCSRank ( hypre_BoxManEntry *entry, hypre_Index index, + HYPRE_BigInt *rank_ptr ); +HYPRE_Int hypre_SStructBoxManEntryGetGlobalGhrank ( hypre_BoxManEntry *entry, hypre_Index index, + HYPRE_BigInt *rank_ptr ); +HYPRE_Int hypre_SStructBoxManEntryGetProcess ( hypre_BoxManEntry *entry, HYPRE_Int *proc_ptr ); +HYPRE_Int hypre_SStructBoxManEntryGetBoxnum ( hypre_BoxManEntry *entry, HYPRE_Int *id_ptr ); +HYPRE_Int hypre_SStructBoxManEntryGetPart ( hypre_BoxManEntry *entry, HYPRE_Int part, + HYPRE_Int *part_ptr ); +HYPRE_Int hypre_SStructIndexToNborIndex( hypre_Index index, hypre_Index root, hypre_Index nbor_root, + hypre_Index coord, hypre_Index dir, HYPRE_Int ndim, hypre_Index nbor_index ); +HYPRE_Int hypre_SStructBoxToNborBox ( hypre_Box *box, hypre_Index root, hypre_Index nbor_root, + hypre_Index coord, hypre_Index dir ); +HYPRE_Int hypre_SStructNborIndexToIndex( hypre_Index nbor_index, hypre_Index root, + hypre_Index nbor_root, hypre_Index coord, hypre_Index dir, HYPRE_Int ndim, hypre_Index index ); +HYPRE_Int hypre_SStructNborBoxToBox ( hypre_Box *nbor_box, hypre_Index root, hypre_Index nbor_root, + hypre_Index coord, hypre_Index dir ); +HYPRE_Int hypre_SStructVarToNborVar ( hypre_SStructGrid *grid, HYPRE_Int part, HYPRE_Int var, + HYPRE_Int *coord, HYPRE_Int *nbor_var_ptr ); +HYPRE_Int hypre_SStructGridSetNumGhost ( hypre_SStructGrid *grid, HYPRE_Int *num_ghost ); +HYPRE_Int hypre_SStructBoxManEntryGetGlobalRank ( hypre_BoxManEntry *entry, hypre_Index index, + HYPRE_BigInt *rank_ptr, HYPRE_Int type ); +HYPRE_Int hypre_SStructBoxManEntryGetStrides ( hypre_BoxManEntry *entry, hypre_Index strides, + HYPRE_Int type ); +HYPRE_Int hypre_SStructBoxNumMap ( hypre_SStructGrid *grid, HYPRE_Int part, HYPRE_Int boxnum, + HYPRE_Int **num_varboxes_ptr, HYPRE_Int ***map_ptr ); +HYPRE_Int hypre_SStructCellGridBoxNumMap ( hypre_SStructGrid *grid, HYPRE_Int part, + HYPRE_Int ***num_varboxes_ptr, HYPRE_Int ****map_ptr ); +HYPRE_Int hypre_SStructCellBoxToVarBox ( hypre_Box *box, hypre_Index offset, hypre_Index varoffset, + HYPRE_Int *valid ); +HYPRE_Int hypre_SStructGridIntersect ( hypre_SStructGrid *grid, HYPRE_Int part, HYPRE_Int var, + hypre_Box *box, HYPRE_Int action, hypre_BoxManEntry ***entries_ptr, HYPRE_Int *nentries_ptr ); +HYPRE_Int hypre_SStructGridGetMaxBoxSize ( hypre_SStructGrid *grid ); +HYPRE_Int hypre_SStructGridPrint ( FILE *file, hypre_SStructGrid *grid ); +HYPRE_Int hypre_SStructGridRead ( MPI_Comm comm, FILE *file, hypre_SStructGrid **grid_ptr ); /* sstruct_innerprod.c */ -HYPRE_Int hypre_SStructPInnerProd ( hypre_SStructPVector *px , hypre_SStructPVector *py , HYPRE_Real *presult_ptr ); -HYPRE_Int hypre_SStructInnerProd ( hypre_SStructVector *x , hypre_SStructVector *y , HYPRE_Real *result_ptr ); +HYPRE_Int hypre_SStructPInnerProd ( hypre_SStructPVector *px, hypre_SStructPVector *py, + HYPRE_Real *presult_ptr ); +HYPRE_Int hypre_SStructInnerProd ( hypre_SStructVector *x, hypre_SStructVector *y, + HYPRE_Real *result_ptr ); /* sstruct_matrix.c */ -HYPRE_Int hypre_SStructPMatrixRef ( hypre_SStructPMatrix *matrix , hypre_SStructPMatrix **matrix_ref ); -HYPRE_Int hypre_SStructPMatrixCreate ( MPI_Comm comm , hypre_SStructPGrid *pgrid , hypre_SStructStencil **stencils , hypre_SStructPMatrix **pmatrix_ptr ); +HYPRE_Int hypre_SStructPMatrixRef ( hypre_SStructPMatrix *matrix, + hypre_SStructPMatrix **matrix_ref ); +HYPRE_Int hypre_SStructPMatrixCreate ( MPI_Comm comm, hypre_SStructPGrid *pgrid, + hypre_SStructStencil **stencils, hypre_SStructPMatrix **pmatrix_ptr ); HYPRE_Int hypre_SStructPMatrixDestroy ( hypre_SStructPMatrix *pmatrix ); HYPRE_Int hypre_SStructPMatrixInitialize ( hypre_SStructPMatrix *pmatrix ); -HYPRE_Int hypre_SStructPMatrixSetValues ( hypre_SStructPMatrix *pmatrix , hypre_Index index , HYPRE_Int var , HYPRE_Int nentries , HYPRE_Int *entries , HYPRE_Complex *values , HYPRE_Int action ); -HYPRE_Int hypre_SStructPMatrixSetBoxValues( hypre_SStructPMatrix *pmatrix , hypre_Box *set_box , HYPRE_Int var , HYPRE_Int nentries , HYPRE_Int *entries , hypre_Box *value_box , HYPRE_Complex *values , HYPRE_Int action ); +HYPRE_Int hypre_SStructPMatrixSetValues ( hypre_SStructPMatrix *pmatrix, hypre_Index index, + HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Complex *values, HYPRE_Int action ); +HYPRE_Int hypre_SStructPMatrixSetBoxValues( hypre_SStructPMatrix *pmatrix, hypre_Box *set_box, + HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_Box *value_box, HYPRE_Complex *values, + HYPRE_Int action ); HYPRE_Int hypre_SStructPMatrixAccumulate ( hypre_SStructPMatrix *pmatrix ); HYPRE_Int hypre_SStructPMatrixAssemble ( hypre_SStructPMatrix *pmatrix ); -HYPRE_Int hypre_SStructPMatrixSetSymmetric ( hypre_SStructPMatrix *pmatrix , HYPRE_Int var , HYPRE_Int to_var , HYPRE_Int symmetric ); -HYPRE_Int hypre_SStructPMatrixPrint ( const char *filename , hypre_SStructPMatrix *pmatrix , HYPRE_Int all ); +HYPRE_Int hypre_SStructPMatrixSetSymmetric ( hypre_SStructPMatrix *pmatrix, HYPRE_Int var, + HYPRE_Int to_var, HYPRE_Int symmetric ); +HYPRE_Int hypre_SStructPMatrixPrint ( const char *filename, hypre_SStructPMatrix *pmatrix, + HYPRE_Int all ); HYPRE_Int hypre_SStructUMatrixInitialize ( hypre_SStructMatrix *matrix ); -HYPRE_Int hypre_SStructUMatrixSetValues ( hypre_SStructMatrix *matrix , HYPRE_Int part , hypre_Index index , HYPRE_Int var , HYPRE_Int nentries , HYPRE_Int *entries , HYPRE_Complex *values , HYPRE_Int action ); -HYPRE_Int hypre_SStructUMatrixSetBoxValues( hypre_SStructMatrix *matrix , HYPRE_Int part , hypre_Box *set_box , HYPRE_Int var , HYPRE_Int nentries , HYPRE_Int *entries , hypre_Box *value_box , HYPRE_Complex *values , HYPRE_Int action ); +HYPRE_Int hypre_SStructUMatrixSetValues ( hypre_SStructMatrix *matrix, HYPRE_Int part, + hypre_Index index, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Complex *values, + HYPRE_Int action ); +HYPRE_Int hypre_SStructUMatrixSetBoxValues( hypre_SStructMatrix *matrix, HYPRE_Int part, + hypre_Box *set_box, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_Box *value_box, + HYPRE_Complex *values, HYPRE_Int action ); HYPRE_Int hypre_SStructUMatrixAssemble ( hypre_SStructMatrix *matrix ); -HYPRE_Int hypre_SStructMatrixRef ( hypre_SStructMatrix *matrix , hypre_SStructMatrix **matrix_ref ); -HYPRE_Int hypre_SStructMatrixSplitEntries ( hypre_SStructMatrix *matrix , HYPRE_Int part , HYPRE_Int var , HYPRE_Int nentries , HYPRE_Int *entries , HYPRE_Int *nSentries_ptr , HYPRE_Int **Sentries_ptr , HYPRE_Int *nUentries_ptr , HYPRE_Int **Uentries_ptr ); -HYPRE_Int hypre_SStructMatrixSetValues ( HYPRE_SStructMatrix matrix , HYPRE_Int part , HYPRE_Int *index , HYPRE_Int var , HYPRE_Int nentries , HYPRE_Int *entries , HYPRE_Complex *values , HYPRE_Int action ); -HYPRE_Int hypre_SStructMatrixSetBoxValues( HYPRE_SStructMatrix matrix , HYPRE_Int part , hypre_Box *set_box , HYPRE_Int var , HYPRE_Int nentries , HYPRE_Int *entries , hypre_Box *value_box , HYPRE_Complex *values , HYPRE_Int action ); -HYPRE_Int hypre_SStructMatrixSetInterPartValues( HYPRE_SStructMatrix matrix , HYPRE_Int part , hypre_Box *set_box , HYPRE_Int var , HYPRE_Int nentries , HYPRE_Int *entries , hypre_Box *value_box , HYPRE_Complex *values , HYPRE_Int action ); +HYPRE_Int hypre_SStructMatrixRef ( hypre_SStructMatrix *matrix, hypre_SStructMatrix **matrix_ref ); +HYPRE_Int hypre_SStructMatrixSplitEntries ( hypre_SStructMatrix *matrix, HYPRE_Int part, + HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Int *nSentries_ptr, + HYPRE_Int **Sentries_ptr, HYPRE_Int *nUentries_ptr, HYPRE_Int **Uentries_ptr ); +HYPRE_Int hypre_SStructMatrixSetValues ( HYPRE_SStructMatrix matrix, HYPRE_Int part, + HYPRE_Int *index, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Complex *values, + HYPRE_Int action ); +HYPRE_Int hypre_SStructMatrixSetBoxValues( HYPRE_SStructMatrix matrix, HYPRE_Int part, + hypre_Box *set_box, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_Box *value_box, + HYPRE_Complex *values, HYPRE_Int action ); +HYPRE_Int hypre_SStructMatrixSetInterPartValues( HYPRE_SStructMatrix matrix, HYPRE_Int part, + hypre_Box *set_box, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_Box *value_box, + HYPRE_Complex *values, HYPRE_Int action ); +HYPRE_MemoryLocation hypre_SStructMatrixMemoryLocation(hypre_SStructMatrix *matrix); /* sstruct_matvec.c */ HYPRE_Int hypre_SStructPMatvecCreate ( void **pmatvec_vdata_ptr ); -HYPRE_Int hypre_SStructPMatvecSetup ( void *pmatvec_vdata , hypre_SStructPMatrix *pA , hypre_SStructPVector *px ); -HYPRE_Int hypre_SStructPMatvecCompute ( void *pmatvec_vdata , HYPRE_Complex alpha , hypre_SStructPMatrix *pA , hypre_SStructPVector *px , HYPRE_Complex beta , hypre_SStructPVector *py ); +HYPRE_Int hypre_SStructPMatvecSetup ( void *pmatvec_vdata, hypre_SStructPMatrix *pA, + hypre_SStructPVector *px ); +HYPRE_Int hypre_SStructPMatvecCompute ( void *pmatvec_vdata, HYPRE_Complex alpha, + hypre_SStructPMatrix *pA, hypre_SStructPVector *px, HYPRE_Complex beta, hypre_SStructPVector *py ); HYPRE_Int hypre_SStructPMatvecDestroy ( void *pmatvec_vdata ); -HYPRE_Int hypre_SStructPMatvec ( HYPRE_Complex alpha , hypre_SStructPMatrix *pA , hypre_SStructPVector *px , HYPRE_Complex beta , hypre_SStructPVector *py ); +HYPRE_Int hypre_SStructPMatvec ( HYPRE_Complex alpha, hypre_SStructPMatrix *pA, + hypre_SStructPVector *px, HYPRE_Complex beta, hypre_SStructPVector *py ); HYPRE_Int hypre_SStructMatvecCreate ( void **matvec_vdata_ptr ); -HYPRE_Int hypre_SStructMatvecSetup ( void *matvec_vdata , hypre_SStructMatrix *A , hypre_SStructVector *x ); -HYPRE_Int hypre_SStructMatvecCompute ( void *matvec_vdata , HYPRE_Complex alpha , hypre_SStructMatrix *A , hypre_SStructVector *x , HYPRE_Complex beta , hypre_SStructVector *y ); +HYPRE_Int hypre_SStructMatvecSetup ( void *matvec_vdata, hypre_SStructMatrix *A, + hypre_SStructVector *x ); +HYPRE_Int hypre_SStructMatvecCompute ( void *matvec_vdata, HYPRE_Complex alpha, + hypre_SStructMatrix *A, hypre_SStructVector *x, HYPRE_Complex beta, hypre_SStructVector *y ); HYPRE_Int hypre_SStructMatvecDestroy ( void *matvec_vdata ); -HYPRE_Int hypre_SStructMatvec ( HYPRE_Complex alpha , hypre_SStructMatrix *A , hypre_SStructVector *x , HYPRE_Complex beta , hypre_SStructVector *y ); +HYPRE_Int hypre_SStructMatvec ( HYPRE_Complex alpha, hypre_SStructMatrix *A, hypre_SStructVector *x, + HYPRE_Complex beta, hypre_SStructVector *y ); /* sstruct_scale.c */ -HYPRE_Int hypre_SStructPScale ( HYPRE_Complex alpha , hypre_SStructPVector *py ); -HYPRE_Int hypre_SStructScale ( HYPRE_Complex alpha , hypre_SStructVector *y ); +HYPRE_Int hypre_SStructPScale ( HYPRE_Complex alpha, hypre_SStructPVector *py ); +HYPRE_Int hypre_SStructScale ( HYPRE_Complex alpha, hypre_SStructVector *y ); /* sstruct_stencil.c */ -HYPRE_Int hypre_SStructStencilRef ( hypre_SStructStencil *stencil , hypre_SStructStencil **stencil_ref ); +HYPRE_Int hypre_SStructStencilRef ( hypre_SStructStencil *stencil, + hypre_SStructStencil **stencil_ref ); /* sstruct_vector.c */ -HYPRE_Int hypre_SStructPVectorRef ( hypre_SStructPVector *vector , hypre_SStructPVector **vector_ref ); -HYPRE_Int hypre_SStructPVectorCreate ( MPI_Comm comm , hypre_SStructPGrid *pgrid , hypre_SStructPVector **pvector_ptr ); +HYPRE_Int hypre_SStructPVectorRef ( hypre_SStructPVector *vector, + hypre_SStructPVector **vector_ref ); +HYPRE_Int hypre_SStructPVectorCreate ( MPI_Comm comm, hypre_SStructPGrid *pgrid, + hypre_SStructPVector **pvector_ptr ); HYPRE_Int hypre_SStructPVectorDestroy ( hypre_SStructPVector *pvector ); HYPRE_Int hypre_SStructPVectorInitialize ( hypre_SStructPVector *pvector ); -HYPRE_Int hypre_SStructPVectorSetValues ( hypre_SStructPVector *pvector , hypre_Index index , HYPRE_Int var , HYPRE_Complex *value , HYPRE_Int action ); -HYPRE_Int hypre_SStructPVectorSetBoxValues( hypre_SStructPVector *pvector , hypre_Box *set_box , HYPRE_Int var , hypre_Box *value_box , HYPRE_Complex *values , HYPRE_Int action ); +HYPRE_Int hypre_SStructPVectorSetValues ( hypre_SStructPVector *pvector, hypre_Index index, + HYPRE_Int var, HYPRE_Complex *value, HYPRE_Int action ); +HYPRE_Int hypre_SStructPVectorSetBoxValues( hypre_SStructPVector *pvector, hypre_Box *set_box, + HYPRE_Int var, hypre_Box *value_box, HYPRE_Complex *values, HYPRE_Int action ); HYPRE_Int hypre_SStructPVectorAccumulate ( hypre_SStructPVector *pvector ); HYPRE_Int hypre_SStructPVectorAssemble ( hypre_SStructPVector *pvector ); HYPRE_Int hypre_SStructPVectorGather ( hypre_SStructPVector *pvector ); -HYPRE_Int hypre_SStructPVectorGetValues ( hypre_SStructPVector *pvector , hypre_Index index , HYPRE_Int var , HYPRE_Complex *value ); -HYPRE_Int hypre_SStructPVectorGetBoxValues( hypre_SStructPVector *pvector , hypre_Box *set_box , HYPRE_Int var , hypre_Box *value_box , HYPRE_Complex *values ); -HYPRE_Int hypre_SStructPVectorSetConstantValues ( hypre_SStructPVector *pvector , HYPRE_Complex value ); -HYPRE_Int hypre_SStructPVectorPrint ( const char *filename , hypre_SStructPVector *pvector , HYPRE_Int all ); -HYPRE_Int hypre_SStructVectorRef ( hypre_SStructVector *vector , hypre_SStructVector **vector_ref ); -HYPRE_Int hypre_SStructVectorSetConstantValues ( hypre_SStructVector *vector , HYPRE_Complex value ); -HYPRE_Int hypre_SStructVectorConvert ( hypre_SStructVector *vector , hypre_ParVector **parvector_ptr ); -HYPRE_Int hypre_SStructVectorParConvert ( hypre_SStructVector *vector , hypre_ParVector **parvector_ptr ); -HYPRE_Int hypre_SStructVectorRestore ( hypre_SStructVector *vector , hypre_ParVector *parvector ); -HYPRE_Int hypre_SStructVectorParRestore ( hypre_SStructVector *vector , hypre_ParVector *parvector ); +HYPRE_Int hypre_SStructPVectorGetValues ( hypre_SStructPVector *pvector, hypre_Index index, + HYPRE_Int var, HYPRE_Complex *value ); +HYPRE_Int hypre_SStructPVectorGetBoxValues( hypre_SStructPVector *pvector, hypre_Box *set_box, + HYPRE_Int var, hypre_Box *value_box, HYPRE_Complex *values ); +HYPRE_Int hypre_SStructPVectorSetConstantValues ( hypre_SStructPVector *pvector, + HYPRE_Complex value ); +HYPRE_Int hypre_SStructPVectorPrint ( const char *filename, hypre_SStructPVector *pvector, + HYPRE_Int all ); +HYPRE_Int hypre_SStructVectorRef ( hypre_SStructVector *vector, hypre_SStructVector **vector_ref ); +HYPRE_Int hypre_SStructVectorSetConstantValues ( hypre_SStructVector *vector, HYPRE_Complex value ); +HYPRE_Int hypre_SStructVectorConvert ( hypre_SStructVector *vector, + hypre_ParVector **parvector_ptr ); +HYPRE_Int hypre_SStructVectorParConvert ( hypre_SStructVector *vector, + hypre_ParVector **parvector_ptr ); +HYPRE_Int hypre_SStructVectorRestore ( hypre_SStructVector *vector, hypre_ParVector *parvector ); +HYPRE_Int hypre_SStructVectorParRestore ( hypre_SStructVector *vector, hypre_ParVector *parvector ); HYPRE_Int hypre_SStructPVectorInitializeShell ( hypre_SStructPVector *pvector ); HYPRE_Int hypre_SStructVectorInitializeShell ( hypre_SStructVector *vector ); HYPRE_Int hypre_SStructVectorClearGhostValues ( hypre_SStructVector *vector ); +HYPRE_MemoryLocation hypre_SStructVectorMemoryLocation(hypre_SStructVector *vector); diff --git a/external/hypre/src/sstruct_mv/sstruct_axpy.c b/external/hypre/src/sstruct_mv/sstruct_axpy.c index c08bc6c1..3991ab83 100644 --- a/external/hypre/src/sstruct_mv/sstruct_axpy.c +++ b/external/hypre/src/sstruct_mv/sstruct_axpy.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -47,9 +47,9 @@ hypre_SStructAxpy( HYPRE_Complex alpha, HYPRE_Int nparts = hypre_SStructVectorNParts(x); HYPRE_Int part; - HYPRE_Int x_object_type= hypre_SStructVectorObjectType(x); - HYPRE_Int y_object_type= hypre_SStructVectorObjectType(y); - + HYPRE_Int x_object_type = hypre_SStructVectorObjectType(x); + HYPRE_Int y_object_type = hypre_SStructVectorObjectType(y); + if (x_object_type != y_object_type) { hypre_error_in_arg(2); diff --git a/external/hypre/src/sstruct_mv/sstruct_copy.c b/external/hypre/src/sstruct_mv/sstruct_copy.c index d3dcefa8..eab9d41d 100644 --- a/external/hypre/src/sstruct_mv/sstruct_copy.c +++ b/external/hypre/src/sstruct_mv/sstruct_copy.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -49,7 +49,7 @@ hypre_SStructPartialPCopy( hypre_SStructPVector *px, for (var = 0; var < nvars; var++) { - boxes= array_boxes[var]; + boxes = array_boxes[var]; hypre_StructPartialCopy(hypre_SStructPVectorSVector(px, var), hypre_SStructPVectorSVector(py, var), boxes); @@ -69,8 +69,8 @@ hypre_SStructCopy( hypre_SStructVector *x, HYPRE_Int nparts = hypre_SStructVectorNParts(x); HYPRE_Int part; - HYPRE_Int x_object_type= hypre_SStructVectorObjectType(x); - HYPRE_Int y_object_type= hypre_SStructVectorObjectType(y); + HYPRE_Int x_object_type = hypre_SStructVectorObjectType(x); + HYPRE_Int y_object_type = hypre_SStructVectorObjectType(y); if (x_object_type != y_object_type) { diff --git a/external/hypre/src/sstruct_mv/sstruct_graph.c b/external/hypre/src/sstruct_mv/sstruct_graph.c index 9930a56e..aee1823f 100644 --- a/external/hypre/src/sstruct_mv/sstruct_graph.c +++ b/external/hypre/src/sstruct_mv/sstruct_graph.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -57,8 +57,8 @@ hypre_SStructGraphGetUVEntryRank( hypre_SStructGraph *graph, found = 1; for (d = 0; d < ndim; d++) { - if ( (hypre_IndexD(index, d) < (hypre_BoxIMinD(box, d)-1)) || - (hypre_IndexD(index, d) > (hypre_BoxIMaxD(box, d)+1)) ) + if ( (hypre_IndexD(index, d) < (hypre_BoxIMinD(box, d) - 1)) || + (hypre_IndexD(index, d) > (hypre_BoxIMaxD(box, d) + 1)) ) { /* not in this box */ found = 0; @@ -68,10 +68,10 @@ hypre_SStructGraphGetUVEntryRank( hypre_SStructGraph *graph, if (found) { vol = 0; - for (d = (ndim-1); d > -1; d--) + for (d = (ndim - 1); d > -1; d--) { - vol = vol*(hypre_BoxSizeD(box, d) + 2) + - (hypre_IndexD(index, d) - hypre_BoxIMinD(box, d) + 1); + vol = vol * (hypre_BoxSizeD(box, d) + 2) + + (hypre_IndexD(index, d) - hypre_BoxIMinD(box, d) + 1); } *rank += (HYPRE_BigInt)vol; return hypre_error_flag; @@ -120,32 +120,32 @@ hypre_SStructGraphFindBoxEndpt(hypre_SStructGraph *graph, /* Should we be checking the neighbor box manager also ?*/ - boxman= hypre_SStructGridBoxManager(grid, part, var); + boxman = hypre_SStructGridBoxManager(grid, part, var); hypre_BoxManGetEntry(boxman, proc, boxi, &boxman_entry); - sgrid= hypre_SStructPGridSGrid(hypre_SStructGridPGrid(grid, part), var); + sgrid = hypre_SStructPGridSGrid(hypre_SStructGridPGrid(grid, part), var); box = hypre_StructGridBox(sgrid, boxi); /* get the global rank of the endpt corner of box boxi */ if (endpt < 1) { - hypre_SStructBoxManEntryGetGlobalRank( - boxman_entry, hypre_BoxIMin(box), &rank, type); + hypre_SStructBoxManEntryGetGlobalRank( + boxman_entry, hypre_BoxIMin(box), &rank, type); } else { - hypre_SStructBoxManEntryGetGlobalRank( - boxman_entry, hypre_BoxIMax(box), &rank, type); + hypre_SStructBoxManEntryGetGlobalRank( + boxman_entry, hypre_BoxIMax(box), &rank, type); } if (type == HYPRE_SSTRUCT || type == HYPRE_STRUCT) { - rank -= hypre_SStructGridGhstartRank(grid); + rank -= hypre_SStructGridGhstartRank(grid); } if (type == HYPRE_PARCSR) { - rank -= hypre_SStructGridStartRank(grid); + rank -= hypre_SStructGridStartRank(grid); } return rank; @@ -171,13 +171,13 @@ hypre_SStructGraphFindSGridEndpts(hypre_SStructGraph *graph, hypre_BoxArray *boxes; HYPRE_Int i; - sgrid= hypre_SStructPGridSGrid(hypre_SStructGridPGrid(grid, part), var); - boxes= hypre_StructGridBoxes(sgrid); + sgrid = hypre_SStructPGridSGrid(hypre_SStructGridPGrid(grid, part), var); + boxes = hypre_StructGridBoxes(sgrid); /* get the endpts using hypre_SStructGraphFindBoxEndpt */ - for (i= 0; i< hypre_BoxArraySize(boxes); i++) + for (i = 0; i < hypre_BoxArraySize(boxes); i++) { - endpts[i]= hypre_SStructGraphFindBoxEndpt(graph, part, var, proc, endpt, i); + endpts[i] = hypre_SStructGraphFindBoxEndpt(graph, part, var, proc, endpt, i); } return hypre_error_flag; diff --git a/external/hypre/src/sstruct_mv/sstruct_graph.h b/external/hypre/src/sstruct_mv/sstruct_graph.h index 8cf70e91..51af06e9 100644 --- a/external/hypre/src/sstruct_mv/sstruct_graph.h +++ b/external/hypre/src/sstruct_mv/sstruct_graph.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -23,7 +23,7 @@ typedef struct HYPRE_Int part; hypre_Index index; HYPRE_Int var; - HYPRE_Int to_part; + HYPRE_Int to_part; hypre_Index to_index; HYPRE_Int to_var; diff --git a/external/hypre/src/sstruct_mv/sstruct_grid.c b/external/hypre/src/sstruct_mv/sstruct_grid.c index 2dcf34bc..cfee9309 100644 --- a/external/hypre/src/sstruct_mv/sstruct_grid.c +++ b/external/hypre/src/sstruct_mv/sstruct_grid.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -29,7 +29,7 @@ hypre_SStructVariableGetOffset( HYPRE_SStructVariable vartype, { HYPRE_Int d; - switch(vartype) + switch (vartype) { case HYPRE_SSTRUCT_VARIABLE_CELL: hypre_SetIndex(varoffset, 0); @@ -89,7 +89,7 @@ hypre_SStructPGridCreate( MPI_Comm comm, hypre_SStructPGridNVars(pgrid) = 0; hypre_SStructPGridCellSGridDone(pgrid) = 0; hypre_SStructPGridVarTypes(pgrid) = NULL; - + for (t = 0; t < 8; t++) { hypre_SStructPGridVTSGrid(pgrid, t) = NULL; @@ -97,7 +97,7 @@ hypre_SStructPGridCreate( MPI_Comm comm, } HYPRE_StructGridCreate(comm, ndim, &sgrid); hypre_SStructPGridCellSGrid(pgrid) = sgrid; - + hypre_SStructPGridPNeighbors(pgrid) = hypre_BoxArrayCreate(0, ndim); hypre_SStructPGridPNborOffsets(pgrid) = NULL; @@ -106,7 +106,7 @@ hypre_SStructPGridCreate( MPI_Comm comm, /* GEC0902 ghost addition to the grid */ hypre_SStructPGridGhlocalSize(pgrid) = 0; - + hypre_SetIndex(hypre_SStructPGridPeriodic(pgrid), 0); *pgrid_ptr = pgrid; @@ -173,9 +173,10 @@ hypre_SStructPGridSetCellSGrid( hypre_SStructPGrid *pgrid, /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -HYPRE_Int hypre_SStructPGridSetVariables( hypre_SStructPGrid *pgrid, - HYPRE_Int nvars, - HYPRE_SStructVariable *vartypes ) +HYPRE_Int +hypre_SStructPGridSetVariables( hypre_SStructPGrid *pgrid, + HYPRE_Int nvars, + HYPRE_SStructVariable *vartypes ) { hypre_SStructVariable *new_vartypes; HYPRE_Int i; @@ -260,7 +261,9 @@ hypre_SStructPGridAssemble( hypre_SStructPGrid *pgrid ) cell_sgrid = hypre_SStructPGridCellSGrid(pgrid); HYPRE_StructGridSetPeriodic(cell_sgrid, periodic); if (!hypre_SStructPGridCellSGridDone(pgrid)) + { HYPRE_StructGridAssemble(cell_sgrid); + } /* this is used to truncate boxes when periodicity is on */ cell_imax = hypre_BoxIMax(hypre_StructGridBoundingBox(cell_sgrid)); @@ -276,7 +279,7 @@ hypre_SStructPGridAssemble( hypre_SStructPGrid *pgrid ) /* Add one since hood_first_local can be -1 */ nbor_boxes = hypre_BoxArrayCreate( - pneighbors_size + hood_first_local + hood_num_local + 1, ndim); + pneighbors_size + hood_first_local + hood_num_local + 1, ndim); diff_boxes = hypre_BoxArrayCreate(0, ndim); tmp_boxes = hypre_BoxArrayCreate(0, ndim); @@ -347,11 +350,11 @@ hypre_SStructPGridAssemble( hypre_SStructPGrid *pgrid ) HYPRE_StructGridAssemble(sgrid); sgrids[t] = sgrid; - } + } } hypre_BoxArrayDestroy(hood_boxes); - + hypre_BoxArrayDestroy(nbor_boxes); hypre_BoxArrayDestroy(diff_boxes); hypre_BoxArrayDestroy(tmp_boxes); @@ -396,6 +399,26 @@ hypre_SStructPGridAssemble( hypre_SStructPGrid *pgrid ) return hypre_error_flag; } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPGridGetMaxBoxSize( hypre_SStructPGrid *pgrid ) +{ + HYPRE_Int nvars = hypre_SStructPGridNVars(pgrid); + HYPRE_Int var; + hypre_StructGrid *sgrid; + HYPRE_Int max_box_size = 0; + + for (var = 0; var < nvars; var++) + { + sgrid = hypre_SStructPGridSGrid(pgrid, var); + max_box_size = hypre_max(max_box_size, hypre_StructGridGetMaxBoxSize(sgrid)); + } + + return max_box_size; +} + /*========================================================================== * SStructGrid routines *==========================================================================*/ @@ -423,7 +446,7 @@ hypre_SStructGridAssembleBoxManagers( hypre_SStructGrid *grid ) MPI_Comm comm = hypre_SStructGridComm(grid); HYPRE_Int ndim = hypre_SStructGridNDim(grid); HYPRE_Int nparts = hypre_SStructGridNParts(grid); - HYPRE_Int local_size = hypre_SStructGridLocalSize(grid); + HYPRE_BigInt local_size = (HYPRE_BigInt) hypre_SStructGridLocalSize(grid); hypre_BoxManager ***managers; hypre_SStructBoxManInfo info_obj; hypre_SStructPGrid *pgrid; @@ -431,7 +454,7 @@ hypre_SStructGridAssembleBoxManagers( hypre_SStructGrid *grid ) hypre_StructGrid *sgrid; hypre_Box *bounding_box; - HYPRE_Int offsets[2]; + HYPRE_BigInt offsets[2]; hypre_SStructBoxManInfo *entry_info; @@ -445,11 +468,11 @@ hypre_SStructGridAssembleBoxManagers( hypre_SStructGrid *grid ) hypre_Box *ghostbox, *box; HYPRE_Int * num_ghost; - HYPRE_Int ghoffsets[2]; - HYPRE_Int ghlocal_size = hypre_SStructGridGhlocalSize(grid); + HYPRE_BigInt ghoffsets[2]; + HYPRE_BigInt ghlocal_size = (HYPRE_BigInt) hypre_SStructGridGhlocalSize(grid); HYPRE_Int info_size; - HYPRE_Int box_offset, ghbox_offset; + HYPRE_BigInt box_offset, ghbox_offset; /*------------------------------------------------------ * Build box manager info for grid boxes @@ -460,13 +483,13 @@ hypre_SStructGridAssembleBoxManagers( hypre_SStructGrid *grid ) /*find offset and ghost offsets */ { - HYPRE_Int scan_recv; - + HYPRE_BigInt scan_recv; + /* offsets */ hypre_MPI_Scan( - &local_size, &scan_recv, 1, HYPRE_MPI_INT, hypre_MPI_SUM, comm); - /* first point in my range */ + &local_size, &scan_recv, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); + /* first point in my range */ offsets[0] = scan_recv - local_size; /* first point in next proc's range */ offsets[1] = scan_recv; @@ -475,8 +498,8 @@ hypre_SStructGridAssembleBoxManagers( hypre_SStructGrid *grid ) /* ghost offsets */ hypre_MPI_Scan( - &ghlocal_size, &scan_recv, 1, HYPRE_MPI_INT, hypre_MPI_SUM, comm); - /* first point in my range */ + &ghlocal_size, &scan_recv, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); + /* first point in my range */ ghoffsets[0] = scan_recv - ghlocal_size; /* first point in next proc's range */ ghoffsets[1] = scan_recv; @@ -485,7 +508,7 @@ hypre_SStructGridAssembleBoxManagers( hypre_SStructGrid *grid ) } /* allocate a box manager for each part and variable - - copy the local box info from the underlying sgrid boxmanager*/ + copy the local box info from the underlying sgrid boxmanager*/ managers = hypre_TAlloc(hypre_BoxManager **, nparts, HYPRE_MEMORY_HOST); @@ -494,7 +517,7 @@ hypre_SStructGridAssembleBoxManagers( hypre_SStructGrid *grid ) ghbox_offset = ghoffsets[0]; info_size = sizeof(hypre_SStructBoxManInfo); - + /* storage for the entry info is allocated and kept in the box manager - so here we just write over the info_obj and then it is copied in AddEntry */ @@ -502,7 +525,7 @@ hypre_SStructGridAssembleBoxManagers( hypre_SStructGrid *grid ) /* this is the same for all the info objects */ hypre_SStructBoxManInfoType(entry_info) = hypre_SSTRUCT_BOXMAN_INFO_DEFAULT; - + box = hypre_BoxCreate(ndim); ghostbox = hypre_BoxCreate(ndim); @@ -521,20 +544,20 @@ hypre_SStructGridAssembleBoxManagers( hypre_SStructGrid *grid ) * calculate the info and add to the box manager - the rest we will * gather (because we cannot calculate the info for them) */ - hypre_BoxManGetAllEntries(hypre_StructGridBoxMan(sgrid), + hypre_BoxManGetAllEntries(hypre_StructGridBoxMan(sgrid), &num_entries, &all_entries); - bounding_box = hypre_StructGridBoundingBox(sgrid); + bounding_box = hypre_StructGridBoundingBox(sgrid); /* need to create a box manager and then later give it the bounding box for gather entries call */ - + hypre_BoxManCreate( - hypre_BoxManNumMyEntries(hypre_StructGridBoxMan(sgrid)), - info_size, hypre_StructGridNDim(sgrid), bounding_box, + hypre_BoxManNumMyEntries(hypre_StructGridBoxMan(sgrid)), + info_size, hypre_StructGridNDim(sgrid), bounding_box, hypre_StructGridComm(sgrid), &managers[part][var]); - /* each sgrid has num_ghost */ + /* each sgrid has num_ghost */ num_ghost = hypre_StructGridNumGhost(sgrid); hypre_BoxManSetNumGhost(managers[part][var], num_ghost); @@ -542,7 +565,7 @@ hypre_SStructGridAssembleBoxManagers( hypre_SStructGrid *grid ) /* loop through the all of the entries - for the local boxes * populate the info object and add to Box Manager- recall * that all of the boxes array belong to the calling proc */ - + local_ct = 0; for (b = 0; b < num_entries; b++) { @@ -567,20 +590,20 @@ hypre_SStructGridAssembleBoxManagers( hypre_SStructGrid *grid ) /* grow box to compute volume with ghost */ hypre_CopyBox(box, ghostbox); - hypre_BoxGrowByArray(ghostbox, num_ghost); - + hypre_BoxGrowByArray(ghostbox, num_ghost); + /* update offset */ - ghbox_offset += hypre_BoxVolume(ghostbox); + ghbox_offset += hypre_BoxVolume(ghostbox); local_ct++; } else /* not a local box */ { - hypre_BoxManGatherEntries(managers[part][var], + hypre_BoxManGatherEntries(managers[part][var], entry_imin, entry_imax); } } - + /* call the assemble later */ } /* end of variable loop */ @@ -589,11 +612,11 @@ hypre_SStructGridAssembleBoxManagers( hypre_SStructGrid *grid ) { /* need to do a gather entries on neighbor information so that we have what we need for the NborBoxManagers function */ - + /* these neighbor boxes are much larger than the data that we care about, so first we need to intersect them with the grid and just pass the intersected box into the Box Manager */ - + hypre_SStructNeighbor *vneighbor; HYPRE_Int b, i; hypre_Box *vbox; @@ -608,7 +631,7 @@ hypre_SStructGridAssembleBoxManagers( hypre_SStructGrid *grid ) hypre_Box *nbor_box; hypre_BoxManager *box_man; hypre_BoxArray *local_boxes; - + grow_box = hypre_BoxCreate(ndim); int_box = hypre_BoxCreate(ndim); nbor_box = hypre_BoxCreate(ndim); @@ -624,18 +647,18 @@ hypre_SStructGridAssembleBoxManagers( hypre_SStructGrid *grid ) { sgrid = hypre_SStructPGridSGrid(pgrid, var); max_distance = hypre_StructGridMaxDistance(sgrid); - + /* now loop through my boxes, grow them, and intersect with all of * the neighbors */ - + box_man = hypre_StructGridBoxMan(sgrid); hypre_BoxManGetLocalEntriesBoxes(box_man, local_boxes); - + hypre_ForBoxI(i, local_boxes) { - hypre_CopyBox(hypre_BoxArrayBox(local_boxes, i), grow_box); + hypre_CopyBox(hypre_BoxArrayBox(local_boxes, i), grow_box); hypre_BoxGrowByIndex(grow_box, max_distance); - + /* loop through neighbors */ for (b = 0; b < nvneighbors[part][var]; b++) { @@ -647,12 +670,12 @@ hypre_SStructGridAssembleBoxManagers( hypre_SStructGrid *grid ) hypre_BoxGrowByValue(nbor_box, 1); nbor_part = hypre_SStructNeighborPart(vneighbor); - + coord = hypre_SStructNeighborCoord(vneighbor); dir = hypre_SStructNeighborDir(vneighbor); - + /* find intersection of neighbor and my local box */ - hypre_IntersectBoxes(grow_box, nbor_box, int_box); + hypre_IntersectBoxes(grow_box, nbor_box, int_box); if (hypre_BoxVolume(int_box) > 0) { hypre_CopyIndex(hypre_BoxIMin(vbox), imin0); @@ -661,9 +684,9 @@ hypre_SStructGridAssembleBoxManagers( hypre_SStructGrid *grid ) /* map int_box to neighbor part index space */ hypre_SStructBoxToNborBox(int_box, imin0, imin1, coord, dir); hypre_SStructVarToNborVar(grid, part, var, coord, &nbor_var); - + hypre_BoxManGatherEntries( - managers[nbor_part][nbor_var], + managers[nbor_part][nbor_var], hypre_BoxIMin(int_box), hypre_BoxIMax(int_box)); } } /* end neighbor loop */ @@ -732,7 +755,7 @@ hypre_SStructGridAssembleNborBoxManagers( hypre_SStructGrid *grid ) hypre_Box *bounding_box; /*------------------------------------------------------ - * Create a box manager for the neighbor boxes + * Create a box manager for the neighbor boxes *------------------------------------------------------*/ bounding_box = hypre_BoxCreate(ndim); @@ -759,7 +782,7 @@ hypre_SStructGridAssembleNborBoxManagers( hypre_SStructGrid *grid ) for (var = 0; var < nvars; var++) { sgrid = hypre_SStructPGridSGrid(pgrid, var); - hypre_CopyBox( hypre_StructGridBoundingBox(sgrid), bounding_box); + hypre_CopyBox( hypre_StructGridBoundingBox(sgrid), bounding_box); /* The bounding_box is only needed if BoxManGatherEntries() is called, * but we don't gather anything currently for the neighbor boxman, so * the next bit of code is not needed right now. */ @@ -769,7 +792,7 @@ hypre_SStructGridAssembleNborBoxManagers( hypre_SStructGrid *grid ) hypre_Box *vbox; hypre_Index min_index, max_index; HYPRE_Int d; - HYPRE_Int sendbuf6[2*HYPRE_MAXDIM], recvbuf6[2*HYPRE_MAXDIM]; + HYPRE_Int sendbuf6[2 * HYPRE_MAXDIM], recvbuf6[2 * HYPRE_MAXDIM]; hypre_CopyToCleanIndex( hypre_BoxIMin(bounding_box), ndim, min_index); hypre_CopyToCleanIndex( hypre_BoxIMax(bounding_box), ndim, max_index); @@ -777,40 +800,40 @@ hypre_SStructGridAssembleNborBoxManagers( hypre_SStructGrid *grid ) { vneighbor = &vneighbors[part][var][b]; vbox = hypre_SStructNeighborBox(vneighbor); - /* find min and max box extents */ + /* find min and max box extents */ for (d = 0; d < ndim; d++) { hypre_IndexD(min_index, d) = hypre_min(hypre_IndexD(min_index, d), hypre_BoxIMinD(vbox, d)); hypre_IndexD(max_index, d) = hypre_max(hypre_IndexD(max_index, d), hypre_BoxIMaxD(vbox, d)); - } + } } /* this is based on local info - all procs need to have * the same bounding box! */ hypre_BoxSetExtents( bounding_box, min_index, max_index); - + /* communication needed for the bounding box */ /* pack buffer */ - for (d = 0; d < ndim; d++) + for (d = 0; d < ndim; d++) { sendbuf6[d] = hypre_BoxIMinD(bounding_box, d); - sendbuf6[d+ndim] = -hypre_BoxIMaxD(bounding_box, d); + sendbuf6[d + ndim] = -hypre_BoxIMaxD(bounding_box, d); } hypre_MPI_Allreduce( - sendbuf6, recvbuf6, 2*ndim, HYPRE_MPI_INT, hypre_MPI_MIN, comm); + sendbuf6, recvbuf6, 2 * ndim, HYPRE_MPI_INT, hypre_MPI_MIN, comm); /* unpack buffer */ for (d = 0; d < ndim; d++) { hypre_BoxIMinD(bounding_box, d) = recvbuf6[d]; - hypre_BoxIMaxD(bounding_box, d) = -recvbuf6[d+ndim]; + hypre_BoxIMaxD(bounding_box, d) = -recvbuf6[d + ndim]; } } #endif /* Here we want to create a new manager for the neighbor information * (instead of adding to the current and reassembling). This uses a * lower bound for the actual box manager size. */ - + hypre_BoxManCreate(nvneighbors[part][var], info_size, ndim, hypre_StructGridBoundingBox(sgrid), hypre_StructGridComm(sgrid), @@ -879,8 +902,8 @@ hypre_SStructGridAssembleNborBoxManagers( hypre_SStructGrid *grid ) ghstride[c[0]] = 1; for (d = 1; d < ndim; d++) { - stride[c[d]] = hypre_BoxSizeD(box, d-1) * stride[c[d-1]]; - ghstride[c[d]] = hypre_BoxSizeD(ghbox, d-1) * ghstride[c[d-1]]; + stride[c[d]] = hypre_BoxSizeD(box, d - 1) * stride[c[d - 1]]; + ghstride[c[d]] = hypre_BoxSizeD(ghbox, d - 1) * ghstride[c[d - 1]]; } for (d = 0; d < ndim; d++) { @@ -934,13 +957,13 @@ hypre_SStructGridAssembleNborBoxManagers( hypre_SStructGrid *grid ) hypre_BoxManGetAllEntries(hypre_SStructGridBoxManager(grid, part, var), &nentries, &all_entries); - + for (b = 0; b < nentries; b++) { entry = &all_entries[b]; - + proc = hypre_BoxManEntryProc(entry); - + hypre_BoxManEntryGetInfo(entry, (void **) &entry_info); hypre_SStructBoxManInfoType(peri_info) = hypre_SStructBoxManInfoType(entry_info); @@ -948,14 +971,14 @@ hypre_SStructGridAssembleNborBoxManagers( hypre_SStructGrid *grid ) hypre_SStructBoxManInfoOffset(entry_info); hypre_SStructBoxManInfoGhoffset(peri_info) = hypre_SStructBoxManInfoGhoffset(entry_info); - + for (k = 1; k < num_periods; k++) /* k = 0 is original box */ { pshift = hypre_StructGridPShift(sgrid, k); hypre_BoxSetExtents(box, hypre_BoxManEntryIMin(entry), hypre_BoxManEntryIMax(entry)); hypre_BoxShiftPos(box, pshift); - + hypre_IntersectBoxes(box, bounding_box, int_box); if (hypre_BoxVolume(int_box) > 0) { @@ -972,7 +995,7 @@ hypre_SStructGridAssembleNborBoxManagers( hypre_SStructGrid *grid ) } /* end of variables loop */ } /* end of part loop */ - + hypre_SStructGridNborBoxManagers(grid) = nbor_managers; hypre_TFree(nbor_info, HYPRE_MEMORY_HOST); @@ -1087,7 +1110,7 @@ hypre_SStructGridCreateCommInfo( hypre_SStructGrid *grid ) maxvars = nvars; } } - cinfo_a = hypre_CTAlloc(CInfo *, nparts*nparts*maxvars*maxvars, HYPRE_MEMORY_HOST); + cinfo_a = hypre_CTAlloc(CInfo *, nparts * nparts * maxvars * maxvars, HYPRE_MEMORY_HOST); /* loop over local boxes and compute send/recv CommInfo */ @@ -1169,16 +1192,16 @@ hypre_SStructGridCreateCommInfo( hypre_SStructGrid *grid ) /* if there is an intersection, compute communication info */ if (hypre_BoxVolume(int_box)) { - cinfoi = (((pi)*maxvars + vi)*nparts + pj)*maxvars + vj; - cinfoj = (((pj)*maxvars + vj)*nparts + pi)*maxvars + vi; + cinfoi = (((pi) * maxvars + vi) * nparts + pj) * maxvars + vj; + cinfoj = (((pj) * maxvars + vj) * nparts + pi) * maxvars + vi; /* allocate CommInfo arguments if needed */ if (cinfo_a[cinfoi] == NULL) { HYPRE_Int i_num_boxes = hypre_StructGridNumBoxes( - hypre_SStructPGridSGrid(pgrids[pi], vi)); + hypre_SStructPGridSGrid(pgrids[pi], vi)); HYPRE_Int j_num_boxes = hypre_StructGridNumBoxes( - hypre_SStructPGridSGrid(pgrids[pj], vj)); + hypre_SStructPGridSGrid(pgrids[pj], vj)); cnum_transforms = hypre_CTAlloc(HYPRE_Int, 1, HYPRE_MEMORY_HOST); ccoords = hypre_CTAlloc(hypre_Index, nvneighbors[pi][vi], HYPRE_MEMORY_HOST); @@ -1241,14 +1264,14 @@ hypre_SStructGridCreateCommInfo( hypre_SStructGrid *grid ) size = hypre_BoxArraySize(cbox_a); /* Allocate in chunks of 10 ('size' grows by 1) */ - if (size%10 == 0) + if (size % 10 == 0) { (cinfo->procs[bi]) = - hypre_TReAlloc((cinfo->procs[bi]), HYPRE_Int, size+10, HYPRE_MEMORY_HOST); + hypre_TReAlloc((cinfo->procs[bi]), HYPRE_Int, size + 10, HYPRE_MEMORY_HOST); (cinfo->rboxnums[bi]) = - hypre_TReAlloc((cinfo->rboxnums[bi]), HYPRE_Int, size+10, HYPRE_MEMORY_HOST); + hypre_TReAlloc((cinfo->rboxnums[bi]), HYPRE_Int, size + 10, HYPRE_MEMORY_HOST); (cinfo->transforms[bi]) = - hypre_TReAlloc((cinfo->transforms[bi]), HYPRE_Int, size+10, HYPRE_MEMORY_HOST); + hypre_TReAlloc((cinfo->transforms[bi]), HYPRE_Int, size + 10, HYPRE_MEMORY_HOST); } cproc_a = (cinfo->procs[bi]); crboxnum_a = (cinfo->rboxnums[bi]); @@ -1260,7 +1283,7 @@ hypre_SStructGridCreateCommInfo( hypre_SStructGrid *grid ) /* map intersection box to part pj index space */ hypre_CopyBox(int_box, int_rbox); hypre_SStructBoxToNborBox(int_rbox, imin0, imin1, coord, dir); - + hypre_AppendBox(int_box, cbox_a); hypre_AppendBox(int_rbox, crbox_a); hypre_SStructBoxManEntryGetProcess(pj_entry, &cproc_a[size]); @@ -1299,20 +1322,20 @@ hypre_SStructGridCreateCommInfo( hypre_SStructGrid *grid ) { for (vi = 0; vi < maxvars; vi++) { - for (pj = (pi+1); pj < nparts; pj++) + for (pj = (pi + 1); pj < nparts; pj++) { for (vj = 0; vj < maxvars; vj++) { - cinfoi = (((pi)*maxvars + vi)*nparts + pj)*maxvars + vj; + cinfoi = (((pi) * maxvars + vi) * nparts + pj) * maxvars + vj; if (cinfo_a[cinfoi] != NULL) { comm_info = hypre_TAlloc(hypre_SStructCommInfo, 1, HYPRE_MEMORY_HOST); - - cinfoj = (((pj)*maxvars + vj)*nparts + pi)*maxvars + vi; + + cinfoj = (((pj) * maxvars + vj) * nparts + pi) * maxvars + vi; send_cinfo = cinfo_a[cinfoi]; recv_cinfo = cinfo_a[cinfoj]; - + /* send/recv boxes may not match (2nd to last argument) */ hypre_CommInfoCreate( (send_cinfo->boxes), (recv_cinfo->boxes), @@ -1326,12 +1349,12 @@ hypre_SStructGridCreateCommInfo( hypre_SStructGrid *grid ) (send_cinfo->coords), (send_cinfo->dirs), (send_cinfo->transforms), (recv_cinfo->transforms)); hypre_TFree(send_cinfo->num_transforms, HYPRE_MEMORY_HOST); - + hypre_SStructCommInfoSendPart(comm_info) = pi; hypre_SStructCommInfoRecvPart(comm_info) = pj; hypre_SStructCommInfoSendVar(comm_info) = vi; hypre_SStructCommInfoRecvVar(comm_info) = vj; - + vnbor_comm_info[vnbor_ncomms] = comm_info; #if 0 { @@ -1403,7 +1426,7 @@ hypre_SStructGridCreateCommInfo( hypre_SStructGrid *grid ) hypre_SStructGridVNborCommInfo(grid) = vnbor_comm_info; hypre_SStructGridVNborNComms(grid) = vnbor_ncomms; - size = nparts*nparts*maxvars*maxvars; + size = nparts * nparts * maxvars * maxvars; for (cinfoi = 0; cinfoi < size; cinfoi++) { hypre_TFree(cinfo_a[cinfoi], HYPRE_MEMORY_HOST); @@ -1432,7 +1455,7 @@ hypre_SStructGridFindBoxManEntry( hypre_SStructGrid *grid, HYPRE_Int nentries; hypre_BoxManEntry **entries; - + hypre_BoxManIntersect ( hypre_SStructGridBoxManager(grid, part, var), index, index, &entries, &nentries); @@ -1452,8 +1475,8 @@ hypre_SStructGridFindBoxManEntry( hypre_SStructGrid *grid, } /* remove the entries array (NULL or allocated in the intersect routine) */ - hypre_TFree(entries, HYPRE_MEMORY_HOST); - + hypre_TFree(entries, HYPRE_MEMORY_HOST); + return hypre_error_flag; } @@ -1490,8 +1513,8 @@ hypre_SStructGridFindNborBoxManEntry( hypre_SStructGrid *grid, } /* remove the entries array (NULL or allocated in the intersect routine) */ - hypre_TFree(entries, HYPRE_MEMORY_HOST); - + hypre_TFree(entries, HYPRE_MEMORY_HOST); + return hypre_error_flag; } @@ -1534,8 +1557,8 @@ hypre_SStructBoxManEntryGetCSRstrides( hypre_BoxManEntry *entry, strides[0] = 1; for (d = 1; d < ndim; d++) { - strides[d] = hypre_IndexD(imax, d-1) - hypre_IndexD(imin, d-1) + 1; - strides[d] *= strides[d-1]; + strides[d] = hypre_IndexD(imax, d - 1) - hypre_IndexD(imin, d - 1) + 1; + strides[d] *= strides[d - 1]; } } else @@ -1578,18 +1601,18 @@ hypre_SStructBoxManEntryGetGhstrides( hypre_BoxManEntry *entry, numghost = hypre_BoxManEntryNumGhost(entry); for (d = 0; d < ndim; d++) - { - imax[d] += numghost[2*d+1]; - imin[d] -= numghost[2*d]; - } + { + imax[d] += numghost[2 * d + 1]; + imin[d] -= numghost[2 * d]; + } /* imin, imax modified now and calculation identical. */ strides[0] = 1; for (d = 1; d < ndim; d++) { - strides[d] = hypre_IndexD(imax, d-1) - hypre_IndexD(imin, d-1) + 1; - strides[d] *= strides[d-1]; + strides[d] = hypre_IndexD(imax, d - 1) - hypre_IndexD(imin, d - 1) + 1; + strides[d] *= strides[d - 1]; } } else @@ -1654,7 +1677,7 @@ hypre_SStructBoxManEntryGetGlobalGhrank( hypre_BoxManEntry *entry, HYPRE_Int *numghost = hypre_BoxManEntryNumGhost(entry); HYPRE_Int d; HYPRE_Int info_type; - + hypre_BoxManEntryGetInfo(entry, (void **) &entry_info); hypre_BoxManEntryGetExtents(entry, imin, imax); ghoffset = hypre_SStructBoxManInfoGhoffset(entry_info); @@ -1671,10 +1694,10 @@ hypre_SStructBoxManEntryGetGlobalGhrank( hypre_BoxManEntry *entry, { for (d = 0; d < ndim; d++) { - imin[d] -= numghost[2*d]; + imin[d] -= numghost[2 * d]; } } - + *rank_ptr = ghoffset; for (d = 0; d < ndim; d++) { @@ -1708,7 +1731,7 @@ hypre_SStructBoxManEntryGetBoxnum( hypre_BoxManEntry *entry, hypre_SStructBoxManNborInfo *info; hypre_BoxManEntryGetInfo(entry, (void **) &info); - + if (hypre_SStructBoxManInfoType(info) == hypre_SSTRUCT_BOXMAN_INFO_NEIGHBOR) /* get from the info object */ @@ -1734,7 +1757,7 @@ hypre_SStructBoxManEntryGetPart( hypre_BoxManEntry *entry, hypre_SStructBoxManNborInfo *info; hypre_BoxManEntryGetInfo(entry, (void **) &info); - + if (hypre_SStructBoxManInfoType(info) == hypre_SSTRUCT_BOXMAN_INFO_NEIGHBOR) { *part_ptr = hypre_SStructBoxManNborInfoPart(info); @@ -1780,6 +1803,9 @@ hypre_SStructIndexToNborIndex( hypre_Index index, return hypre_error_flag; } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_SStructBoxToNborBox( hypre_Box *box, hypre_Index root, @@ -1809,7 +1835,6 @@ hypre_SStructBoxToNborBox( hypre_Box *box, * See "Mapping Notes" in comment for `hypre_SStructBoxToNborBox'. *--------------------------------------------------------------------------*/ - HYPRE_Int hypre_SStructNborIndexToIndex( hypre_Index nbor_index, hypre_Index root, @@ -1830,6 +1855,9 @@ hypre_SStructNborIndexToIndex( hypre_Index nbor_index, return hypre_error_flag; } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_SStructNborBoxToBox( hypre_Box *nbor_box, hypre_Index root, @@ -1880,7 +1908,7 @@ hypre_SStructVarToNborVar( hypre_SStructGrid *grid, hypre_SStructPGrid *pgrid = hypre_SStructGridPGrid(grid, part); HYPRE_SStructVariable vartype = hypre_SStructPGridVarType(pgrid, var); - switch(vartype) + switch (vartype) { case HYPRE_SSTRUCT_VARIABLE_XFACE: case HYPRE_SSTRUCT_VARIABLE_XEDGE: @@ -1888,11 +1916,11 @@ hypre_SStructVarToNborVar( hypre_SStructGrid *grid, break; case HYPRE_SSTRUCT_VARIABLE_YFACE: case HYPRE_SSTRUCT_VARIABLE_YEDGE: - *nbor_var_ptr = var + (coord[1]-1); + *nbor_var_ptr = var + (coord[1] - 1); break; case HYPRE_SSTRUCT_VARIABLE_ZFACE: case HYPRE_SSTRUCT_VARIABLE_ZEDGE: - *nbor_var_ptr = var + (coord[2]-2); + *nbor_var_ptr = var + (coord[2] - 2); break; default: *nbor_var_ptr = var; @@ -1915,7 +1943,7 @@ hypre_SStructGridSetNumGhost( hypre_SStructGrid *grid, HYPRE_Int *num_ghost ) hypre_SStructPGrid *pgrid; hypre_StructGrid *sgrid; - for (i = 0; i < 2*ndim; i++) + for (i = 0; i < 2 * ndim; i++) { hypre_SStructGridNumGhost(grid)[i] = num_ghost[i]; } @@ -1923,7 +1951,7 @@ hypre_SStructGridSetNumGhost( hypre_SStructGrid *grid, HYPRE_Int *num_ghost ) for (part = 0; part < nparts; part++) { pgrid = hypre_SStructGridPGrid(grid, part); - + for (t = 0; t < 8; t++) { sgrid = hypre_SStructPGridVTSGrid(pgrid, t); @@ -1950,7 +1978,7 @@ hypre_SStructBoxManEntryGetGlobalRank( hypre_BoxManEntry *entry, { if (type == HYPRE_PARCSR) { - hypre_SStructBoxManEntryGetGlobalCSRank(entry,index, rank_ptr); + hypre_SStructBoxManEntryGetGlobalCSRank(entry, index, rank_ptr); } if (type == HYPRE_SSTRUCT || type == HYPRE_STRUCT) { @@ -1958,7 +1986,7 @@ hypre_SStructBoxManEntryGetGlobalRank( hypre_BoxManEntry *entry, } return hypre_error_flag; -} +} /*-------------------------------------------------------------------------- * GEC1002 a function that will select the right way to calculate the strides @@ -1980,7 +2008,7 @@ hypre_SStructBoxManEntryGetStrides(hypre_BoxManEntry *entry, } return hypre_error_flag; -} +} /*-------------------------------------------------------------------------- * A function to determine the local variable box numbers that underlie @@ -1996,11 +2024,11 @@ hypre_SStructBoxNumMap(hypre_SStructGrid *grid, HYPRE_Int ***map_ptr) { hypre_SStructPGrid *pgrid = hypre_SStructGridPGrid(grid, part); - hypre_StructGrid *cellgrid= hypre_SStructPGridCellSGrid(pgrid); + hypre_StructGrid *cellgrid = hypre_SStructPGridCellSGrid(pgrid); hypre_StructGrid *vargrid; hypre_BoxArray *boxes; hypre_Box *cellbox, vbox, *box, intersect_box; - HYPRE_SStructVariable *vartypes= hypre_SStructPGridVarTypes(pgrid); + HYPRE_SStructVariable *vartypes = hypre_SStructPGridVarTypes(pgrid); HYPRE_Int ndim = hypre_SStructGridNDim(grid); HYPRE_Int nvars = hypre_SStructPGridNVars(pgrid); @@ -2014,23 +2042,23 @@ hypre_SStructBoxNumMap(hypre_SStructGrid *grid, hypre_BoxInit(&vbox, ndim); hypre_BoxInit(&intersect_box, ndim); - cellbox= hypre_StructGridBox(cellgrid, boxnum); + cellbox = hypre_StructGridBox(cellgrid, boxnum); /* ptrs to store var_box map info */ num_boxes = hypre_CTAlloc(HYPRE_Int, nvars, HYPRE_MEMORY_HOST); - var_boxnums= hypre_TAlloc(HYPRE_Int *, nvars, HYPRE_MEMORY_HOST); + var_boxnums = hypre_TAlloc(HYPRE_Int *, nvars, HYPRE_MEMORY_HOST); /* intersect the cellbox with the var_boxes */ - for (var= 0; var< nvars; var++) + for (var = 0; var < nvars; var++) { - vargrid= hypre_SStructPGridSGrid(pgrid, var); + vargrid = hypre_SStructPGridSGrid(pgrid, var); boxes = hypre_StructGridBoxes(vargrid); temp = hypre_CTAlloc(HYPRE_Int, hypre_BoxArraySize(boxes), HYPRE_MEMORY_HOST); /* map cellbox to a variable box */ hypre_CopyBox(cellbox, &vbox); - i= vartypes[var]; + i = vartypes[var]; hypre_SStructVariableGetOffset((hypre_SStructVariable) i, ndim, varoffset); hypre_SubtractIndexes(hypre_BoxIMin(&vbox), varoffset, ndim, @@ -2039,7 +2067,7 @@ hypre_SStructBoxNumMap(hypre_SStructGrid *grid, /* loop over boxes to see if they intersect with vbox */ hypre_ForBoxI(i, boxes) { - box= hypre_BoxArrayBox(boxes, i); + box = hypre_BoxArrayBox(boxes, i); hypre_IntersectBoxes(&vbox, box, &intersect_box); if (hypre_BoxVolume(&intersect_box)) { @@ -2051,20 +2079,20 @@ hypre_SStructBoxNumMap(hypre_SStructGrid *grid, /* record local var box numbers */ if (num_boxes[var]) { - var_boxnums[var]= hypre_TAlloc(HYPRE_Int, num_boxes[var], HYPRE_MEMORY_HOST); + var_boxnums[var] = hypre_TAlloc(HYPRE_Int, num_boxes[var], HYPRE_MEMORY_HOST); } else { - var_boxnums[var]= NULL; + var_boxnums[var] = NULL; } - j= 0; - k= hypre_BoxArraySize(boxes); - for (i= 0; i< k; i++) + j = 0; + k = hypre_BoxArraySize(boxes); + for (i = 0; i < k; i++) { if (temp[i]) { - var_boxnums[var][j]= i; + var_boxnums[var][j] = i; j++; } } @@ -2072,8 +2100,8 @@ hypre_SStructBoxNumMap(hypre_SStructGrid *grid, } /* for (var= 0; var< nvars; var++) */ - *num_varboxes_ptr= num_boxes; - *map_ptr= var_boxnums; + *num_varboxes_ptr = num_boxes; + *map_ptr = var_boxnums; return hypre_error_flag; } @@ -2091,8 +2119,8 @@ hypre_SStructCellGridBoxNumMap(hypre_SStructGrid *grid, { hypre_SStructPGrid *pgrid = hypre_SStructGridPGrid(grid, part); hypre_StructGrid *cellgrid = hypre_SStructPGridCellSGrid(pgrid); - hypre_BoxArray *cellboxes= hypre_StructGridBoxes(cellgrid); - + hypre_BoxArray *cellboxes = hypre_StructGridBoxes(cellgrid); + HYPRE_Int **num_boxes; HYPRE_Int ***var_boxnums; @@ -2101,7 +2129,7 @@ hypre_SStructCellGridBoxNumMap(hypre_SStructGrid *grid, ncellboxes = hypre_BoxArraySize(cellboxes); num_boxes = hypre_TAlloc(HYPRE_Int *, ncellboxes, HYPRE_MEMORY_HOST); - var_boxnums= hypre_TAlloc(HYPRE_Int **, ncellboxes, HYPRE_MEMORY_HOST); + var_boxnums = hypre_TAlloc(HYPRE_Int **, ncellboxes, HYPRE_MEMORY_HOST); hypre_ForBoxI(i, cellboxes) { @@ -2112,8 +2140,8 @@ hypre_SStructCellGridBoxNumMap(hypre_SStructGrid *grid, &var_boxnums[i]); } - *num_varboxes_ptr= num_boxes; - *map_ptr= var_boxnums; + *num_varboxes_ptr = num_boxes; + *map_ptr = var_boxnums; return hypre_error_flag; } @@ -2171,7 +2199,7 @@ hypre_SStructGridIntersect( hypre_SStructGrid *grid, HYPRE_Int var, hypre_Box *box, HYPRE_Int action, - hypre_BoxManEntry ***entries_ptr, + hypre_BoxManEntry ***entries_ptr, HYPRE_Int *nentries_ptr ) { hypre_BoxManEntry **entries, **tentries; @@ -2186,7 +2214,7 @@ hypre_SStructGridIntersect( hypre_SStructGrid *grid, boxman = hypre_SStructGridNborBoxManager(grid, part, var); hypre_BoxManIntersect(boxman, hypre_BoxIMin(box), hypre_BoxIMax(box), &tentries, &ntentries); - entries = hypre_TReAlloc(entries, hypre_BoxManEntry *, + entries = hypre_TReAlloc(entries, hypre_BoxManEntry *, (nentries + ntentries), HYPRE_MEMORY_HOST); for (i = 0; i < ntentries; i++) { @@ -2215,3 +2243,299 @@ hypre_SStructGridIntersect( hypre_SStructGrid *grid, return hypre_error_flag; } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructGridGetMaxBoxSize( hypre_SStructGrid *grid ) +{ + HYPRE_Int nparts = hypre_SStructGridNParts(grid); + HYPRE_Int part; + hypre_SStructPGrid *pgrid; + HYPRE_Int max_box_size = 0; + + for (part = 0; part < nparts; part++) + { + pgrid = hypre_SStructGridPGrid(grid, part); + max_box_size = hypre_max(max_box_size, hypre_SStructPGridGetMaxBoxSize(pgrid)); + } + + return max_box_size; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructGridPrint( FILE *file, + hypre_SStructGrid *grid ) +{ + /* Grid variables */ + HYPRE_Int ndim = hypre_SStructGridNDim(grid); + HYPRE_Int nparts = hypre_SStructGridNParts(grid); + HYPRE_Int *nneighbors = hypre_SStructGridNNeighbors(grid); + hypre_SStructNeighbor **neighbors = hypre_SStructGridNeighbors(grid); + hypre_Index **nbor_offsets = hypre_SStructGridNborOffsets(grid); + hypre_IndexRef nbor_offset; + hypre_IndexRef coord, dir, ilomap; + HYPRE_Int npart; + hypre_SStructNeighbor *neighbor; + hypre_SStructPGrid *pgrid; + hypre_StructGrid *sgrid; + hypre_BoxArray *boxes; + hypre_Box *box; + HYPRE_SStructVariable *vartypes; + HYPRE_Int *num_ghost; + hypre_IndexRef periodic; + + /* Local variables */ + HYPRE_Int i; + HYPRE_Int part, var; + HYPRE_Int nvars; + HYPRE_Int nboxes; + + /* Print basic info */ + hypre_fprintf(file, "\nGridCreate: %d %d\n\n", ndim, nparts); + + /* Print number of boxes per part */ + for (part = 0; part < nparts; part++) + { + pgrid = hypre_SStructGridPGrid(grid, part); + sgrid = hypre_SStructPGridCellSGrid(pgrid); + boxes = hypre_StructGridBoxes(sgrid); + nboxes = hypre_BoxArraySize(boxes); + + hypre_fprintf(file, "GridNumBoxes: %d %d\n", part, nboxes); + } + + /* Print boxes per part */ + for (part = 0; part < nparts; part++) + { + pgrid = hypre_SStructGridPGrid(grid, part); + sgrid = hypre_SStructPGridCellSGrid(pgrid); + boxes = hypre_StructGridBoxes(sgrid); + + hypre_ForBoxI(i, boxes) + { + box = hypre_BoxArrayBox(boxes, i); + + hypre_fprintf(file, "\nGridSetExtents: (%d, %d): ", part, i); + hypre_BoxPrint(file, box); + } + } + hypre_fprintf(file, "\n\n"); + + /* Print variable info per part */ + for (part = 0; part < nparts; part++) + { + pgrid = hypre_SStructGridPGrid(grid, part); + nvars = hypre_SStructPGridNVars(pgrid); + vartypes = hypre_SStructPGridVarTypes(pgrid); + + hypre_fprintf(file, "GridSetVariables: %d %d ", part, nvars); + hypre_fprintf(file, "[%d", vartypes[0]); + for (var = 1; var < nvars; var++) + { + hypre_fprintf(file, " %d", vartypes[var]); + } + hypre_fprintf(file, "]\n"); + } + hypre_fprintf(file, "\n"); + + /* Print ghost info */ + num_ghost = hypre_SStructGridNumGhost(grid); + hypre_fprintf(file, "GridSetNumGhost:"); + for (i = 0; i < 2 * ndim; i++) + { + hypre_fprintf(file, " %d", num_ghost[i]); + } + hypre_fprintf(file, "\n"); + + /* Print periodic data per part */ + for (part = 0; part < nparts; part++) + { + pgrid = hypre_SStructGridPGrid(grid, part); + periodic = hypre_SStructPGridPeriodic(pgrid); + + hypre_fprintf(file, "\nGridSetPeriodic: %d ", part); + hypre_IndexPrint(file, ndim, periodic); + } + hypre_fprintf(file, "\n\n"); + + /* GridSetFEMOrdering */ + + /* GridSetSharedPart and GridSetNeighborPart data */ + for (part = 0; part < nparts; part++) + { + hypre_fprintf(file, "GridNumNeighbors: %d %d\n", part, nneighbors[part]); + for (i = 0; i < nneighbors[part]; i++) + { + neighbor = &neighbors[part][i]; + nbor_offset = nbor_offsets[part][i]; + box = hypre_SStructNeighborBox(neighbor); + npart = hypre_SStructNeighborPart(neighbor); + coord = hypre_SStructNeighborCoord(neighbor); + dir = hypre_SStructNeighborDir(neighbor); + ilomap = hypre_SStructNeighborILower(neighbor); + + /* Print SStructNeighbor info */ + hypre_fprintf(file, "GridNeighborInfo: "); + hypre_BoxPrint(file, box); + hypre_fprintf(file, " "); + hypre_IndexPrint(file, ndim, nbor_offset); + hypre_fprintf(file, " %d ", npart); + hypre_IndexPrint(file, ndim, coord); + hypre_fprintf(file, " "); + hypre_IndexPrint(file, ndim, dir); + hypre_fprintf(file, " "); + hypre_IndexPrint(file, ndim, ilomap); + hypre_fprintf(file, "\n"); + } + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_SStructGridRead + * + * This function reads a semi-structured grid from file. This is used mainly + * for debugging purposes. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructGridRead( MPI_Comm comm, + FILE *file, + hypre_SStructGrid **grid_ptr ) +{ + /* Grid variables */ + HYPRE_SStructGrid grid; + HYPRE_SStructVariable *vartypes; + HYPRE_Int num_ghost[2 * HYPRE_MAXDIM]; + hypre_Index **nbor_offsets; + HYPRE_Int *nneighbors; + hypre_SStructNeighbor **neighbors; + hypre_SStructNeighbor *neighbor; + hypre_Index periodic; + + /* Local variables */ + HYPRE_Int ndim; + HYPRE_Int b, d, i, j; + HYPRE_Int part; + HYPRE_Int nparts, nvars; + HYPRE_Int nboxes; + HYPRE_Int *nboxes_array; + hypre_Box *box; + + hypre_fscanf(file, "\nGridCreate: %d %d\n\n", &ndim, &nparts); + HYPRE_SStructGridCreate(comm, ndim, nparts, &grid); + + /* Allocate memory */ + nboxes_array = hypre_CTAlloc(HYPRE_Int, nparts, HYPRE_MEMORY_HOST); + box = hypre_BoxCreate(ndim); + + /* Read number of boxes per part */ + for (i = 0; i < nparts; i++) + { + hypre_fscanf(file, "GridNumBoxes: %d %d\n", &part, &nboxes); + nboxes_array[part] = nboxes; + } + hypre_fscanf(file, "\n"); + + /* Read boxes per part */ + for (i = 0; i < nparts; i++) + { + for (j = 0; j < nboxes_array[i]; j++) + { + hypre_fscanf(file, "\nGridSetExtents: (%d, %d): ", &part, &b); + hypre_BoxRead(file, ndim, &box); + + HYPRE_SStructGridSetExtents(grid, part, hypre_BoxIMin(box), hypre_BoxIMax(box)); + } + } + hypre_fscanf(file, "\n\n"); + + /* Read variable info per part */ + for (i = 0; i < nparts; i++) + { + hypre_fscanf(file, "GridSetVariables: %d %d ", &part, &nvars); + vartypes = hypre_CTAlloc(hypre_SStructVariable, nvars, HYPRE_MEMORY_HOST); + + hypre_fscanf(file, "[%d", &vartypes[0]); + for (j = 1; j < nvars; j++) + { + hypre_fscanf(file, " %d", &vartypes[j]); + } + hypre_fscanf(file, "]\n"); + HYPRE_SStructGridSetVariables(grid, part, nvars, vartypes); + hypre_TFree(vartypes, HYPRE_MEMORY_HOST); + } + hypre_fscanf(file, "\n"); + + /* Read ghost info */ + hypre_fscanf(file, "GridSetNumGhost:"); + for (i = 0; i < 2 * ndim; i++) + { + hypre_fscanf(file, " %d", &num_ghost[i]); + } + hypre_fscanf(file, "\n"); + + /* Read periodic data per part */ + for (i = 0; i < nparts; i++) + { + hypre_fscanf(file, "\nGridSetPeriodic: %d ", &part); + hypre_IndexRead(file, ndim, periodic); + + HYPRE_SStructGridSetPeriodic(grid, part, periodic); + } + hypre_fscanf(file, "\n\n"); + + /* GridSetFEMOrdering */ + + /* GridSetSharedPart and GridSetNeighborPart data */ + nneighbors = hypre_SStructGridNNeighbors(grid); + neighbors = hypre_SStructGridNeighbors(grid); + nbor_offsets = hypre_SStructGridNborOffsets(grid); + for (part = 0; part < nparts; part++) + { + hypre_fscanf(file, "GridNumNeighbors: %d %d\n", &part, &nneighbors[part]); + neighbors[part] = hypre_TAlloc(hypre_SStructNeighbor, nneighbors[part], HYPRE_MEMORY_HOST); + nbor_offsets[part] = hypre_TAlloc(hypre_Index, nneighbors[part], HYPRE_MEMORY_HOST); + + for (i = 0; i < nneighbors[part]; i++) + { + neighbor = &neighbors[part][i]; + + /* Read SStructNeighbor info */ + hypre_fscanf(file, "GridNeighborInfo: "); + hypre_BoxRead(file, ndim, &box); + hypre_CopyBox(box, hypre_SStructNeighborBox(neighbor)); + hypre_fscanf(file, " "); + hypre_IndexRead(file, ndim, nbor_offsets[part][i]); + hypre_fscanf(file, " %d ", &hypre_SStructNeighborPart(neighbor)); + hypre_IndexRead(file, ndim, hypre_SStructNeighborCoord(neighbor)); + hypre_fscanf(file, " "); + hypre_IndexRead(file, ndim, hypre_SStructNeighborDir(neighbor)); + hypre_fscanf(file, " "); + hypre_IndexRead(file, ndim, hypre_SStructNeighborILower(neighbor)); + hypre_fscanf(file, "\n"); + + for (d = ndim; d < HYPRE_MAXDIM; d++) + { + hypre_IndexD(hypre_SStructNeighborCoord(neighbor), d) = d; + hypre_IndexD(hypre_SStructNeighborDir(neighbor), d) = 1; + } + } + } + + /* Assemble grid */ + HYPRE_SStructGridAssemble(grid); + + /* Free memory */ + hypre_TFree(nboxes_array, HYPRE_MEMORY_HOST); + hypre_BoxDestroy(box); + + *grid_ptr = grid; + + return hypre_error_flag; +} diff --git a/external/hypre/src/sstruct_mv/sstruct_grid.h b/external/hypre/src/sstruct_mv/sstruct_grid.h index 597e8632..e1a9f6d0 100644 --- a/external/hypre/src/sstruct_mv/sstruct_grid.h +++ b/external/hypre/src/sstruct_mv/sstruct_grid.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -49,7 +49,7 @@ typedef struct HYPRE_SStructVariable *vartypes; /* types of variables */ hypre_StructGrid *sgrids[8]; /* struct grids for each vartype */ hypre_BoxArray *iboxarrays[8]; /* interface boxes */ - + hypre_BoxArray *pneighbors; hypre_Index *pnbor_offsets; @@ -58,10 +58,10 @@ typedef struct hypre_Index periodic; /* Indicates if pgrid is periodic */ - /* GEC0902 additions for ghost expansion of boxes */ + /* GEC0902 additions for ghost expansion of boxes */ HYPRE_Int ghlocal_size; /* Number of vars including ghosts */ - + HYPRE_Int cell_sgrid_done; /* =1 implies cell grid already assembled */ } hypre_SStructPGrid; @@ -85,7 +85,7 @@ typedef struct { HYPRE_Int type; HYPRE_BigInt offset; - HYPRE_BigInt ghoffset; + HYPRE_BigInt ghoffset; } hypre_SStructBoxManInfo; @@ -96,13 +96,13 @@ typedef struct HYPRE_BigInt ghoffset; /* minimum offset ghost for this box */ HYPRE_Int proc; /* redundant with the proc in the entry, but makes some coding easier */ - HYPRE_Int boxnum; /* this is different from the entry id */ + HYPRE_Int boxnum; /* this is different from the entry id */ HYPRE_Int part; /* part the box lives on */ hypre_Index ilower; /* box ilower, but on the neighbor index-space */ hypre_Index coord; /* lives on local index-space */ hypre_Index dir; /* lives on local index-space */ hypre_Index stride; /* lives on local index-space */ - hypre_Index ghstride; /* the ghost equivalent of strides */ + hypre_Index ghstride; /* the ghost equivalent of strides */ } hypre_SStructBoxManNborInfo; @@ -113,7 +113,7 @@ typedef struct HYPRE_Int recv_part; HYPRE_Int send_var; HYPRE_Int recv_var; - + } hypre_SStructCommInfo; typedef struct hypre_SStructGrid_struct @@ -121,11 +121,11 @@ typedef struct hypre_SStructGrid_struct MPI_Comm comm; HYPRE_Int ndim; HYPRE_Int nparts; - - /* s-variable info */ + + /* s-variable info */ hypre_SStructPGrid **pgrids; - - /* neighbor info */ + + /* neighbor info */ HYPRE_Int *nneighbors; hypre_SStructNeighbor **neighbors; hypre_Index **nbor_offsets; @@ -152,14 +152,14 @@ typedef struct hypre_SStructGrid_struct HYPRE_Int local_size; /* Number of variables locally */ HYPRE_BigInt global_size; /* Total number of variables */ - + HYPRE_Int ref_count; - /* GEC0902 additions for ghost expansion of boxes */ + /* GEC0902 additions for ghost expansion of boxes */ HYPRE_Int ghlocal_size; /* GEC0902 Number of vars including ghosts */ HYPRE_BigInt ghstart_rank; /* GEC0902 start rank including ghosts */ - HYPRE_Int num_ghost[2*HYPRE_MAXDIM]; /* ghost layer size */ + HYPRE_Int num_ghost[2 * HYPRE_MAXDIM]; /* ghost layer size */ } hypre_SStructGrid; diff --git a/external/hypre/src/sstruct_mv/sstruct_innerprod.c b/external/hypre/src/sstruct_mv/sstruct_innerprod.c index 38ea8b62..56b3040a 100644 --- a/external/hypre/src/sstruct_mv/sstruct_innerprod.c +++ b/external/hypre/src/sstruct_mv/sstruct_innerprod.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -54,9 +54,9 @@ hypre_SStructInnerProd( hypre_SStructVector *x, HYPRE_Real presult; HYPRE_Int part; - HYPRE_Int x_object_type= hypre_SStructVectorObjectType(x); - HYPRE_Int y_object_type= hypre_SStructVectorObjectType(y); - + HYPRE_Int x_object_type = hypre_SStructVectorObjectType(x); + HYPRE_Int y_object_type = hypre_SStructVectorObjectType(y); + if (x_object_type != y_object_type) { hypre_error_in_arg(2); @@ -84,9 +84,9 @@ hypre_SStructInnerProd( hypre_SStructVector *x, hypre_SStructVectorConvert(x, &x_par); hypre_SStructVectorConvert(y, &y_par); - result= hypre_ParVectorInnerProd(x_par, y_par); + result = hypre_ParVectorInnerProd(x_par, y_par); } - + *result_ptr = result; return hypre_error_flag; diff --git a/external/hypre/src/sstruct_mv/sstruct_matrix.c b/external/hypre/src/sstruct_mv/sstruct_matrix.c index 38dace26..72e92aaa 100644 --- a/external/hypre/src/sstruct_mv/sstruct_matrix.c +++ b/external/hypre/src/sstruct_mv/sstruct_matrix.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -235,7 +235,7 @@ hypre_SStructPMatrixInitialize( hypre_SStructPMatrix *pmatrix ) * one to set shared coefficients correctly, but not exactly one? */ for (d = 0; d < ndim; d++) { - num_ghost[2*d] = num_ghost[2*d+1] = 1; + num_ghost[2 * d] = num_ghost[2 * d + 1] = 1; } #endif for (vi = 0; vi < nvars; vi++) @@ -392,7 +392,7 @@ hypre_SStructPMatrixSetBoxValues( hypre_SStructPMatrix *pmatrix, values, action, -1, 0); /* TODO: Why need DeviceSync? */ #if defined(HYPRE_USING_GPU) - hypre_SyncCudaDevice(hypre_handle()); + hypre_SyncDevice(); #endif /* set (AddTo/Get) or clear (Set) values outside the grid in ghost zones */ if (action != 0) @@ -482,7 +482,7 @@ hypre_SStructPMatrixAccumulate( hypre_SStructPMatrix *pmatrix ) hypre_StructMatrix *smatrix; hypre_Index varoffset; - HYPRE_Int num_ghost[2*HYPRE_MAXDIM]; + HYPRE_Int num_ghost[2 * HYPRE_MAXDIM]; hypre_StructGrid *sgrid; HYPRE_Int vi, vj, d; @@ -508,7 +508,7 @@ hypre_SStructPMatrixAccumulate( hypre_SStructPMatrix *pmatrix ) hypre_SStructVariableGetOffset(vartypes[vi], ndim, varoffset); for (d = 0; d < ndim; d++) { - num_ghost[2*d] = num_ghost[2*d+1] = hypre_IndexD(varoffset, d); + num_ghost[2 * d] = num_ghost[2 * d + 1] = hypre_IndexD(varoffset, d); } /* accumulate values from AddTo */ @@ -658,7 +658,8 @@ hypre_SStructUMatrixInitialize( hypre_SStructMatrix *matrix ) hypre_SStructStencil *stencil; HYPRE_Int *split; HYPRE_Int nvars; - HYPRE_Int nrows, rowstart, nnzs ; + HYPRE_Int nrows, nnzs ; + HYPRE_BigInt rowstart; HYPRE_Int part, var, entry, b, m, mi; HYPRE_Int *row_sizes; HYPRE_Int max_row_size; @@ -690,7 +691,7 @@ hypre_SStructUMatrixInitialize( hypre_SStructMatrix *matrix ) m = 0; max_row_size = 0; ghost_box = hypre_BoxCreate(ndim); - row_sizes = hypre_CTAlloc(HYPRE_Int, nrows, HYPRE_MEMORY_HOST); + row_sizes = hypre_CTAlloc(HYPRE_Int, nrows, HYPRE_MEMORY_HOST); hypre_SetIndex(stride, 1); for (part = 0; part < nparts; part++) { @@ -713,7 +714,7 @@ hypre_SStructUMatrixInitialize( hypre_SStructMatrix *matrix ) /* TODO: For now, assume stencil is full/complete */ if (hypre_SStructMatrixSymmetric(matrix)) { - nnzs = 2*nnzs - 1; + nnzs = 2 * nnzs - 1; } #endif boxes = hypre_StructGridBoxes(sgrid); @@ -729,12 +730,8 @@ hypre_SStructUMatrixInitialize( hypre_SStructMatrix *matrix ) hypre_BoxGetSize(box, loop_size); zypre_BoxLoop1Begin(hypre_SStructMatrixNDim(matrix), loop_size, ghost_box, start, stride, mi); -#ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(HYPRE_BOX_PRIVATE,mi) HYPRE_SMP_SCHEDULE -#endif - zypre_BoxLoop1For(mi) { - row_sizes[m+mi] = nnzs; + row_sizes[m + mi] = nnzs; } zypre_BoxLoop1End(mi); @@ -771,15 +768,17 @@ hypre_SStructUMatrixInitialize( hypre_SStructMatrix *matrix ) hypre_TFree(row_sizes, HYPRE_MEMORY_HOST); - hypre_SStructMatrixTmpSize(matrix) = max_row_size; - hypre_SStructMatrixTmpRowCoords(matrix) = hypre_CTAlloc(HYPRE_BigInt, max_row_size, HYPRE_MEMORY_HOST); - hypre_SStructMatrixTmpColCoords(matrix) = hypre_CTAlloc(HYPRE_BigInt, max_row_size, HYPRE_MEMORY_HOST); - hypre_SStructMatrixTmpCoeffs(matrix) = hypre_CTAlloc(HYPRE_Complex, max_row_size, HYPRE_MEMORY_HOST); - hypre_SStructMatrixTmpRowCoordsDevice(matrix) = hypre_CTAlloc(HYPRE_BigInt, max_row_size, HYPRE_MEMORY_DEVICE); - hypre_SStructMatrixTmpColCoordsDevice(matrix) = hypre_CTAlloc(HYPRE_BigInt, max_row_size, HYPRE_MEMORY_DEVICE); - hypre_SStructMatrixTmpCoeffsDevice(matrix) = hypre_CTAlloc(HYPRE_Complex, max_row_size, HYPRE_MEMORY_DEVICE); + hypre_SStructMatrixTmpSize(matrix) = max_row_size; + hypre_SStructMatrixTmpRowCoords(matrix) = hypre_CTAlloc(HYPRE_BigInt, max_row_size, + HYPRE_MEMORY_HOST); + hypre_SStructMatrixTmpColCoords(matrix) = hypre_CTAlloc(HYPRE_BigInt, max_row_size, + HYPRE_MEMORY_HOST); + hypre_SStructMatrixTmpCoeffs(matrix) = hypre_CTAlloc(HYPRE_Complex, max_row_size, + HYPRE_MEMORY_HOST); HYPRE_IJMatrixInitialize(ijmatrix); + HYPRE_IJMatrixGetObject(ijmatrix, + (void **) &hypre_SStructMatrixParCSRMatrix(matrix)); return hypre_error_flag; } @@ -825,12 +824,15 @@ hypre_SStructUMatrixSetValues( hypre_SStructMatrix *matrix, HYPRE_BigInt Uverank; HYPRE_Int matrix_type = hypre_SStructMatrixObjectType(matrix); HYPRE_Complex *h_values; + HYPRE_MemoryLocation memory_location = hypre_IJMatrixMemoryLocation(ijmatrix); hypre_SStructGridFindBoxManEntry(grid, part, index, var, &boxman_entry); /* if not local, check neighbors */ if (boxman_entry == NULL) + { hypre_SStructGridFindNborBoxManEntry(grid, part, index, var, &boxman_entry); + } if (boxman_entry == NULL) { @@ -848,13 +850,12 @@ hypre_SStructUMatrixSetValues( hypre_SStructMatrix *matrix, &row_coord, matrix_type); col_coords = hypre_SStructMatrixTmpColCoords(matrix); - coeffs = hypre_SStructMatrixTmpCoeffs(matrix); + coeffs = hypre_SStructMatrixTmpCoeffs(matrix); - /* RL: copy values to host since the following for-loop is on CPU */ - if ( hypre_GetActualMemLocation(HYPRE_MEMORY_DEVICE) != hypre_MEMORY_HOST ) + if ( hypre_GetExecPolicy1(memory_location) == HYPRE_EXEC_DEVICE ) { h_values = hypre_TAlloc(HYPRE_Complex, nentries, HYPRE_MEMORY_HOST); - hypre_TMemcpy(h_values, values, HYPRE_Complex, nentries, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(h_values, values, HYPRE_Complex, nentries, HYPRE_MEMORY_HOST, memory_location); } else { @@ -886,7 +887,7 @@ hypre_SStructUMatrixSetValues( hypre_SStructMatrix *matrix, if (boxman_entry != NULL) { hypre_SStructBoxManEntryGetGlobalRank(boxman_entry, to_index, - &col_coords[ncoeffs],matrix_type); + &col_coords[ncoeffs], matrix_type); coeffs[ncoeffs] = h_values[i]; ncoeffs++; @@ -908,34 +909,51 @@ hypre_SStructUMatrixSetValues( hypre_SStructMatrix *matrix, } } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - HYPRE_BigInt *d_row_coords = hypre_SStructMatrixTmpRowCoordsDevice(matrix); - HYPRE_BigInt *d_col_coords = hypre_SStructMatrixTmpColCoordsDevice(matrix); - HYPRE_Complex *d_coeffs = hypre_SStructMatrixTmpCoeffsDevice(matrix); - - if ( hypre_GetExecPolicy1(hypre_IJMatrixMemoryLocation(ijmatrix)) == HYPRE_EXEC_DEVICE ) +#if defined(HYPRE_USING_GPU) + if ( hypre_GetExecPolicy1(memory_location) == HYPRE_EXEC_DEVICE ) { - hypreDevice_BigIntFilln(d_row_coords, ncoeffs, row_coord); - hypre_TMemcpy(d_col_coords, col_coords, HYPRE_BigInt, ncoeffs, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - hypre_TMemcpy(d_coeffs, coeffs, HYPRE_Complex, ncoeffs, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); + if (!hypre_SStructMatrixTmpRowCoordsDevice(matrix)) + { + hypre_SStructMatrixTmpRowCoordsDevice(matrix) = + hypre_CTAlloc(HYPRE_BigInt, hypre_SStructMatrixTmpSize(matrix), memory_location); + } + + if (!hypre_SStructMatrixTmpColCoordsDevice(matrix)) + { + hypre_SStructMatrixTmpColCoordsDevice(matrix) = + hypre_CTAlloc(HYPRE_BigInt, hypre_SStructMatrixTmpSize(matrix), memory_location); + } + + if (!hypre_SStructMatrixTmpCoeffsDevice(matrix)) + { + hypre_SStructMatrixTmpCoeffsDevice(matrix) = + hypre_CTAlloc(HYPRE_Complex, hypre_SStructMatrixTmpSize(matrix), memory_location); + } + + hypreDevice_BigIntFilln(hypre_SStructMatrixTmpRowCoordsDevice(matrix), ncoeffs, row_coord); + + hypre_TMemcpy(hypre_SStructMatrixTmpColCoordsDevice(matrix), col_coords, HYPRE_BigInt, ncoeffs, + memory_location, HYPRE_MEMORY_HOST); + + hypre_TMemcpy(hypre_SStructMatrixTmpCoeffsDevice(matrix), coeffs, HYPRE_Complex, ncoeffs, + memory_location, HYPRE_MEMORY_HOST); if (action > 0) { - HYPRE_IJMatrixAddToValues(ijmatrix, ncoeffs, NULL, d_row_coords, - (const HYPRE_BigInt *) d_col_coords, - (const HYPRE_Complex *) d_coeffs); + HYPRE_IJMatrixAddToValues(ijmatrix, ncoeffs, NULL, hypre_SStructMatrixTmpRowCoordsDevice(matrix), + (const HYPRE_BigInt *) hypre_SStructMatrixTmpColCoordsDevice(matrix), + (const HYPRE_Complex *) hypre_SStructMatrixTmpCoeffsDevice(matrix)); } else if (action > -1) { - HYPRE_IJMatrixSetValues(ijmatrix, ncoeffs, NULL, d_row_coords, - (const HYPRE_BigInt *) d_col_coords, - (const HYPRE_Complex *) d_coeffs); + HYPRE_IJMatrixSetValues(ijmatrix, ncoeffs, NULL, hypre_SStructMatrixTmpRowCoordsDevice(matrix), + (const HYPRE_BigInt *) hypre_SStructMatrixTmpColCoordsDevice(matrix), + (const HYPRE_Complex *) hypre_SStructMatrixTmpCoeffsDevice(matrix)); } else { // RL:TODO - HYPRE_IJMatrixGetValues(ijmatrix, 1, &ncoeffs, &row_coord, - col_coords, values); + HYPRE_IJMatrixGetValues(ijmatrix, 1, &ncoeffs, &row_coord, col_coords, values); } } else @@ -1020,7 +1038,7 @@ hypre_SStructUMatrixSetBoxValues( hypre_SStructMatrix *matrix, HYPRE_Int *ncols, *row_indexes;; HYPRE_BigInt *rows, *cols; HYPRE_Complex *ijvalues; - hypre_Box *box; + hypre_Box *box = hypre_BoxCreate(ndim); hypre_Box *to_box; hypre_Box *map_box; hypre_Box *int_box; @@ -1030,8 +1048,7 @@ hypre_SStructUMatrixSetBoxValues( hypre_SStructMatrix *matrix, HYPRE_BigInt row_base, col_base; HYPRE_Int ei, entry, ii, jj; HYPRE_Int matrix_type = hypre_SStructMatrixObjectType(matrix); - - box = hypre_BoxCreate(ndim); + HYPRE_MemoryLocation memory_location = hypre_IJMatrixMemoryLocation(ijmatrix); /*------------------------------------------ * all stencil entries @@ -1044,11 +1061,11 @@ hypre_SStructUMatrixSetBoxValues( hypre_SStructMatrix *matrix, int_box = hypre_BoxCreate(ndim); nrows = hypre_BoxVolume(set_box); - ncols = hypre_CTAlloc(HYPRE_Int, nrows, HYPRE_MEMORY_DEVICE); - rows = hypre_CTAlloc(HYPRE_BigInt, nrows, HYPRE_MEMORY_DEVICE); - row_indexes = hypre_CTAlloc(HYPRE_Int, nrows, HYPRE_MEMORY_DEVICE); - cols = hypre_CTAlloc(HYPRE_BigInt, nrows*nentries, HYPRE_MEMORY_DEVICE); - ijvalues = hypre_CTAlloc(HYPRE_Complex, nrows*nentries, HYPRE_MEMORY_DEVICE); + ncols = hypre_CTAlloc(HYPRE_Int, nrows, memory_location); + rows = hypre_CTAlloc(HYPRE_BigInt, nrows, memory_location); + row_indexes = hypre_CTAlloc(HYPRE_Int, nrows, memory_location); + cols = hypre_CTAlloc(HYPRE_BigInt, nrows * nentries, memory_location); + ijvalues = hypre_CTAlloc(HYPRE_Complex, nrows * nentries, memory_location); hypre_SetIndex(stride, 1); @@ -1076,7 +1093,7 @@ hypre_SStructUMatrixSetBoxValues( hypre_SStructMatrix *matrix, hypre_LoopBegin(nrows, i) { ncols[i] = 0; - row_indexes[i] = i*nentries; + row_indexes[i] = i * nentries; } hypre_LoopEnd() #undef DEVICE_VAR @@ -1116,78 +1133,98 @@ hypre_SStructUMatrixSetBoxValues( hypre_SStructMatrix *matrix, hypre_BoxGetSize(int_box, loop_size); #if defined(HYPRE_USING_GPU) - hypre_assert(ndim <= 3); - - HYPRE_Int rs_0, rs_1, rs_2; - HYPRE_Int cs_0, cs_1, cs_2; - - if (ndim > 0) - { - rs_0 = rs[0]; - cs_0 = cs[0]; - } - - if (ndim > 1) - { - rs_1 = rs[1]; - cs_1 = cs[1]; - } - - if (ndim > 2) - { - rs_2 = rs[2]; - cs_2 = cs[2]; - } -#endif - -#undef DEVICE_VAR -#define DEVICE_VAR is_device_ptr(ncols,rows,cols,ijvalues,values) - hypre_BoxLoop2Begin(ndim, loop_size, - box, start, stride, mi, - value_box, start, stride, vi); { - hypre_Index index; - HYPRE_Int ci; + hypre_assert(ndim <= 3); - hypre_BoxLoopGetIndex(index); + HYPRE_Int rs_0, rs_1, rs_2; + HYPRE_Int cs_0, cs_1, cs_2; - ci = mi*nentries + ncols[mi]; - rows[mi] = row_base; - cols[ci] = col_base; - -#if defined(HYPRE_USING_GPU) if (ndim > 0) { - rows[mi] += index[0] * rs_0; - cols[ci] += index[0] * cs_0; + rs_0 = rs[0]; + cs_0 = cs[0]; } if (ndim > 1) { - rows[mi] += index[1] * rs_1; - cols[ci] += index[1] * cs_1; + rs_1 = rs[1]; + cs_1 = cs[1]; } if (ndim > 2) { - rows[mi] += index[2] * rs_2; - cols[ci] += index[2] * cs_2; + rs_2 = rs[2]; + cs_2 = cs[2]; } -#else - HYPRE_Int d; - for (d = 0; d < ndim; d++) + +#undef DEVICE_VAR +#define DEVICE_VAR is_device_ptr(ncols,rows,cols,ijvalues,values) + hypre_BoxLoop2Begin(ndim, loop_size, + box, start, stride, mi, + value_box, start, stride, vi); { - rows[mi] += index[d]*rs[d]; - cols[ci] += index[d]*cs[d]; - } -#endif + hypre_Index index; + HYPRE_Int ci; - ijvalues[ci] = values[ei + vi*nentries]; - ncols[mi]++; - } - hypre_BoxLoop2End(mi, vi); + hypre_BoxLoopGetIndex(index); + + ci = mi * nentries + ncols[mi]; + rows[mi] = row_base; + cols[ci] = col_base; + + if (ndim > 0) + { + rows[mi] += index[0] * rs_0; + cols[ci] += index[0] * cs_0; + } + + if (ndim > 1) + { + rows[mi] += index[1] * rs_1; + cols[ci] += index[1] * cs_1; + } + + if (ndim > 2) + { + rows[mi] += index[2] * rs_2; + cols[ci] += index[2] * cs_2; + } + + ijvalues[ci] = values[ei + vi * nentries]; + ncols[mi]++; + } + hypre_BoxLoop2End(mi, vi); #undef DEVICE_VAR #define DEVICE_VAR + } +#else + { + hypre_BoxLoop2Begin(ndim, loop_size, + box, start, stride, mi, + value_box, start, stride, vi); + { + hypre_Index index; + HYPRE_Int ci; + + hypre_BoxLoopGetIndex(index); + + ci = mi * nentries + ncols[mi]; + rows[mi] = row_base; + cols[ci] = col_base; + + HYPRE_Int d; + for (d = 0; d < ndim; d++) + { + rows[mi] += index[d] * rs[d]; + cols[ci] += index[d] * cs[d]; + } + + ijvalues[ci] = values[ei + vi * nentries]; + ncols[mi]++; + } + hypre_BoxLoop2End(mi, vi); + } +#endif } /* end loop through boxman to entries */ hypre_TFree(boxman_to_entries, HYPRE_MEMORY_HOST); @@ -1219,11 +1256,11 @@ hypre_SStructUMatrixSetBoxValues( hypre_SStructMatrix *matrix, hypre_TFree(boxman_entries, HYPRE_MEMORY_HOST); - hypre_TFree(ncols, HYPRE_MEMORY_DEVICE); - hypre_TFree(rows, HYPRE_MEMORY_DEVICE); - hypre_TFree(row_indexes, HYPRE_MEMORY_DEVICE); - hypre_TFree(cols, HYPRE_MEMORY_DEVICE); - hypre_TFree(ijvalues, HYPRE_MEMORY_DEVICE); + hypre_TFree(ncols, memory_location); + hypre_TFree(rows, memory_location); + hypre_TFree(row_indexes, memory_location); + hypre_TFree(cols, memory_location); + hypre_TFree(ijvalues, memory_location); hypre_BoxDestroy(to_box); hypre_BoxDestroy(map_box); @@ -1263,8 +1300,6 @@ hypre_SStructUMatrixAssemble( hypre_SStructMatrix *matrix ) HYPRE_IJMatrix ijmatrix = hypre_SStructMatrixIJMatrix(matrix); HYPRE_IJMatrixAssemble(ijmatrix); - HYPRE_IJMatrixGetObject( - ijmatrix, (void **) &hypre_SStructMatrixParCSRMatrix(matrix)); return hypre_error_flag; } @@ -1507,6 +1542,8 @@ hypre_SStructMatrixSetInterPartValues( HYPRE_SStructMatrix matrix, HYPRE_Int tvalues_size = 0; HYPRE_Int nfrentries, ntoentries, frpart, topart; HYPRE_Int entry, sentry, ei, fri, toi; + HYPRE_MemoryLocation memory_location = hypre_IJMatrixMemoryLocation(hypre_SStructMatrixIJMatrix( + matrix)); pmatrix = hypre_SStructMatrixPMatrix(matrix, part); @@ -1589,7 +1626,8 @@ hypre_SStructMatrixSetInterPartValues( HYPRE_SStructMatrix matrix, if (hypre_BoxVolume(ibox1)) { HYPRE_Int tvalues_new_size = hypre_BoxVolume(ibox1); - tvalues = hypre_TReAlloc_v2(tvalues, HYPRE_Complex, tvalues_size, HYPRE_Complex, tvalues_new_size, HYPRE_MEMORY_DEVICE); + tvalues = hypre_TReAlloc_v2(tvalues, HYPRE_Complex, tvalues_size, HYPRE_Complex, tvalues_new_size, + memory_location); tvalues_size = tvalues_new_size; if (action >= 0) @@ -1605,7 +1643,7 @@ hypre_SStructMatrixSetInterPartValues( HYPRE_SStructMatrix matrix, ibox1, start, stride, mi, value_box, start, stride, vi); { - tvalues[mi] = values[ei + vi*nentries]; + tvalues[mi] = values[ei + vi * nentries]; } hypre_BoxLoop2End(mi, vi); #undef DEVICE_VAR @@ -1634,7 +1672,7 @@ hypre_SStructMatrixSetInterPartValues( HYPRE_SStructMatrix matrix, ibox1, start, stride, mi, value_box, start, stride, vi); { - values[ei + vi*nentries] = tvalues[mi]; + values[ei + vi * nentries] = tvalues[mi]; } hypre_BoxLoop2End(mi, vi); #undef DEVICE_VAR @@ -1653,7 +1691,33 @@ hypre_SStructMatrixSetInterPartValues( HYPRE_SStructMatrix matrix, hypre_BoxDestroy(ibox1); hypre_BoxDestroy(tobox); hypre_BoxDestroy(frbox); - hypre_TFree(tvalues, HYPRE_MEMORY_DEVICE); + hypre_TFree(tvalues, memory_location); return hypre_error_flag; } + +HYPRE_MemoryLocation +hypre_SStructMatrixMemoryLocation(hypre_SStructMatrix *matrix) +{ + HYPRE_Int type = hypre_SStructMatrixObjectType(matrix); + + if (type == HYPRE_SSTRUCT) + { + return hypre_ParCSRMatrixMemoryLocation(hypre_SStructMatrixParCSRMatrix(matrix)); + } + + void *object; + HYPRE_SStructMatrixGetObject(matrix, &object); + + if (type == HYPRE_PARCSR) + { + return hypre_ParCSRMatrixMemoryLocation((hypre_ParCSRMatrix *) object); + } + + if (type == HYPRE_STRUCT) + { + return hypre_StructMatrixMemoryLocation((hypre_StructMatrix *) object); + } + + return HYPRE_MEMORY_UNDEFINED; +} diff --git a/external/hypre/src/sstruct_mv/sstruct_matrix.h b/external/hypre/src/sstruct_mv/sstruct_matrix.h index c14ede0b..84c17430 100644 --- a/external/hypre/src/sstruct_mv/sstruct_matrix.h +++ b/external/hypre/src/sstruct_mv/sstruct_matrix.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -76,7 +76,7 @@ typedef struct hypre_SStructMatrix_struct HYPRE_Int ref_count; - /* GEC0902 adding an object type to the matrix */ + /* GEC0902 adding an object type to the matrix */ HYPRE_Int object_type; } hypre_SStructMatrix; diff --git a/external/hypre/src/sstruct_mv/sstruct_matvec.c b/external/hypre/src/sstruct_mv/sstruct_matvec.c index a8886f1e..5f0ef3e3 100644 --- a/external/hypre/src/sstruct_mv/sstruct_matvec.c +++ b/external/hypre/src/sstruct_mv/sstruct_matvec.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -280,8 +280,8 @@ hypre_SStructMatvecCompute( void *matvec_vdata, hypre_ParVector *pary; HYPRE_Int part; - HYPRE_Int x_object_type= hypre_SStructVectorObjectType(x); - HYPRE_Int A_object_type= hypre_SStructMatrixObjectType(A); + HYPRE_Int x_object_type = hypre_SStructVectorObjectType(x); + HYPRE_Int A_object_type = hypre_SStructMatrixObjectType(A); if (x_object_type != A_object_type) { @@ -292,7 +292,7 @@ hypre_SStructMatvecCompute( void *matvec_vdata, if ( (x_object_type == HYPRE_SSTRUCT) || (x_object_type == HYPRE_STRUCT) ) { - /* do S-matrix computations */ + /* do S-matrix computations */ for (part = 0; part < nparts; part++) { pdata = pmatvec_data[part]; @@ -307,38 +307,38 @@ hypre_SStructMatvecCompute( void *matvec_vdata, /* do U-matrix computations */ - /* GEC1002 the data chunk pointed by the local-parvectors + /* GEC1002 the data chunk pointed by the local-parvectors * inside the semistruct vectors x and y is now identical to the * data chunk of the structure vectors x and y. The role of the function * convert is to pass the addresses of the data chunk - * to the parx and pary. */ + * to the parx and pary. */ hypre_SStructVectorConvert(x, &parx); - hypre_SStructVectorConvert(y, &pary); + hypre_SStructVectorConvert(y, &pary); hypre_ParCSRMatrixMatvec(alpha, parcsrA, parx, 1.0, pary); /* dummy functions since there is nothing to restore */ hypre_SStructVectorRestore(x, NULL); - hypre_SStructVectorRestore(y, pary); + hypre_SStructVectorRestore(y, pary); - parx = NULL; + parx = NULL; } - } + } - else if (x_object_type == HYPRE_PARCSR) - { + else if (x_object_type == HYPRE_PARCSR) + { hypre_SStructVectorConvert(x, &parx); hypre_SStructVectorConvert(y, &pary); hypre_ParCSRMatrixMatvec(alpha, parcsrA, parx, beta, pary); hypre_SStructVectorRestore(x, NULL); - hypre_SStructVectorRestore(y, pary); + hypre_SStructVectorRestore(y, pary); - parx = NULL; + parx = NULL; } return hypre_error_flag; diff --git a/external/hypre/src/sstruct_mv/sstruct_scale.c b/external/hypre/src/sstruct_mv/sstruct_scale.c index 189a928e..f7a1ebbc 100644 --- a/external/hypre/src/sstruct_mv/sstruct_scale.c +++ b/external/hypre/src/sstruct_mv/sstruct_scale.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -40,7 +40,7 @@ hypre_SStructScale( HYPRE_Complex alpha, { HYPRE_Int nparts = hypre_SStructVectorNParts(y); HYPRE_Int part; - HYPRE_Int y_object_type= hypre_SStructVectorObjectType(y); + HYPRE_Int y_object_type = hypre_SStructVectorObjectType(y); if (y_object_type == HYPRE_SSTRUCT) { @@ -53,7 +53,7 @@ hypre_SStructScale( HYPRE_Complex alpha, else if (y_object_type == HYPRE_PARCSR) { hypre_ParVector *y_par; - + hypre_SStructVectorConvert(y, &y_par); hypre_ParVectorScale(alpha, y_par); } diff --git a/external/hypre/src/sstruct_mv/sstruct_stencil.c b/external/hypre/src/sstruct_mv/sstruct_stencil.c index 074e10b5..1406cdc9 100644 --- a/external/hypre/src/sstruct_mv/sstruct_stencil.c +++ b/external/hypre/src/sstruct_mv/sstruct_stencil.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -20,4 +20,3 @@ hypre_SStructStencilRef( hypre_SStructStencil *stencil, return hypre_error_flag; } - diff --git a/external/hypre/src/sstruct_mv/sstruct_stencil.h b/external/hypre/src/sstruct_mv/sstruct_stencil.h index d5aeaaab..994218a0 100644 --- a/external/hypre/src/sstruct_mv/sstruct_stencil.h +++ b/external/hypre/src/sstruct_mv/sstruct_stencil.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/sstruct_mv/sstruct_vector.c b/external/hypre/src/sstruct_mv/sstruct_vector.c index 930485b0..1eaf4d8c 100644 --- a/external/hypre/src/sstruct_mv/sstruct_vector.c +++ b/external/hypre/src/sstruct_mv/sstruct_vector.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -247,7 +247,7 @@ hypre_SStructPVectorSetBoxValues( hypre_SStructPVector *pvector, /* TODO: Why need DeviceSync? */ #if defined(HYPRE_USING_GPU) - hypre_SyncCudaDevice(hypre_handle()); + hypre_SyncDevice(); #endif /* set (AddTo/Get) or clear (Set) values outside the grid in ghost zones */ if (action != 0) @@ -341,7 +341,7 @@ hypre_SStructPVectorAccumulate( hypre_SStructPVector *pvector ) HYPRE_SStructVariable *vartypes = hypre_SStructPGridVarTypes(pgrid); hypre_Index varoffset; - HYPRE_Int num_ghost[2*HYPRE_MAXDIM]; + HYPRE_Int num_ghost[2 * HYPRE_MAXDIM]; hypre_StructGrid *sgrid; HYPRE_Int var, d; @@ -359,7 +359,7 @@ hypre_SStructPVectorAccumulate( hypre_SStructPVector *pvector ) hypre_SStructVariableGetOffset(vartypes[var], ndim, varoffset); for (d = 0; d < ndim; d++) { - num_ghost[2*d] = num_ghost[2*d+1] = hypre_IndexD(varoffset, d); + num_ghost[2 * d] = num_ghost[2 * d + 1] = hypre_IndexD(varoffset, d); } hypre_CreateCommInfoFromNumGhost(sgrid, num_ghost, &comm_info); @@ -642,7 +642,7 @@ hypre_SStructVectorParConvert( hypre_SStructVector *vector, y_data_box, start, stride, yi, box, start, stride, bi); { - pardata[pari+bi] = yp[yi]; + pardata[pari + bi] = yp[yi]; } hypre_BoxLoop2End(yi, bi); #undef DEVICE_VAR @@ -667,6 +667,9 @@ HYPRE_Int hypre_SStructVectorRestore( hypre_SStructVector *vector, hypre_ParVector *parvector ) { + HYPRE_UNUSED_VAR(vector); + HYPRE_UNUSED_VAR(parvector); + return hypre_error_flag; } @@ -728,7 +731,7 @@ hypre_SStructVectorParRestore( hypre_SStructVector *vector, y_data_box, start, stride, yi, box, start, stride, bi); { - yp[yi] = pardata[pari+bi]; + yp[yi] = pardata[pari + bi]; } hypre_BoxLoop2End(yi, bi); #undef DEVICE_VAR @@ -764,7 +767,7 @@ hypre_SStructPVectorInitializeShell( hypre_SStructPVector *pvector) pdatasize = 0; pdataindices = hypre_CTAlloc(HYPRE_Int, nvars, HYPRE_MEMORY_HOST); - for (var =0; var < nvars; var++) + for (var = 0; var < nvars; var++) { svector = hypre_SStructPVectorSVector(pvector, var); hypre_StructVectorInitializeShell(svector); @@ -778,7 +781,7 @@ hypre_SStructPVectorInitializeShell( hypre_SStructPVector *pvector) * for this part */ hypre_SStructPVectorDataIndices(pvector) = pdataindices; - hypre_SStructPVectorDataSize(pvector) = pdatasize+nucvars ; + hypre_SStructPVectorDataSize(pvector) = pdatasize + nucvars ; hypre_SStructPVectorAccumulated(pvector) = 0; @@ -822,24 +825,52 @@ hypre_SStructVectorInitializeShell( hypre_SStructVector *vector) HYPRE_Int hypre_SStructVectorClearGhostValues(hypre_SStructVector *vector) { - HYPRE_Int nparts= hypre_SStructVectorNParts(vector); + HYPRE_Int nparts = hypre_SStructVectorNParts(vector); hypre_SStructPVector *pvector; hypre_StructVector *svector; HYPRE_Int part; HYPRE_Int nvars, var; - for (part= 0; part< nparts; part++) + for (part = 0; part < nparts; part++) { - pvector= hypre_SStructVectorPVector(vector, part); + pvector = hypre_SStructVectorPVector(vector, part); nvars = hypre_SStructPVectorNVars(pvector); - for (var= 0; var< nvars; var++) + for (var = 0; var < nvars; var++) { - svector= hypre_SStructPVectorSVector(pvector, var); + svector = hypre_SStructPVectorSVector(pvector, var); hypre_StructVectorClearGhostValues(svector); } } return hypre_error_flag; } + +HYPRE_MemoryLocation +hypre_SStructVectorMemoryLocation(hypre_SStructVector *vector) +{ + HYPRE_Int type = hypre_SStructVectorObjectType(vector); + + if (type == HYPRE_SSTRUCT) + { + hypre_ParVector *parvector; + hypre_SStructVectorConvert(vector, &parvector); + return hypre_ParVectorMemoryLocation(parvector); + } + + void *object; + HYPRE_SStructVectorGetObject(vector, &object); + + if (type == HYPRE_PARCSR) + { + return hypre_ParVectorMemoryLocation((hypre_ParVector *) object); + } + + if (type == HYPRE_STRUCT) + { + return hypre_StructVectorMemoryLocation((hypre_StructVector *) object); + } + + return HYPRE_MEMORY_UNDEFINED; +} diff --git a/external/hypre/src/sstruct_mv/sstruct_vector.h b/external/hypre/src/sstruct_mv/sstruct_vector.h index 47bc9726..58701084 100644 --- a/external/hypre/src/sstruct_mv/sstruct_vector.h +++ b/external/hypre/src/sstruct_mv/sstruct_vector.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -31,7 +31,7 @@ typedef struct HYPRE_Int ref_count; - HYPRE_Int *dataindices; /* GEC1002 array for starting index of the + HYPRE_Int *dataindices; /* GEC1002 array for starting index of the svector. pdataindices[varx] */ HYPRE_Int datasize; /* Size of the pvector = sums size of svectors */ @@ -56,15 +56,13 @@ typedef struct hypre_SStructVector_struct /* inter-part communication info */ HYPRE_Int nbor_ncomms; /* num comm_pkgs with neighbor parts */ - /* GEC10020902 pointer to big chunk of memory and auxiliary information */ - - HYPRE_Complex *data; /* GEC1002 pointer to chunk data */ - HYPRE_Int *dataindices; /* GEC1002 dataindices[partx] is the starting index - of vector data for the part=partx */ - HYPRE_Int datasize ; /* GEC1002 size of all data = ghlocalsize */ + /* GEC10020902 pointer to big chunk of memory and auxiliary information */ + HYPRE_Complex *data; /* GEC1002 pointer to chunk data */ + HYPRE_Int *dataindices; /* GEC1002 dataindices[partx] is the starting index + of vector data for the part=partx */ + HYPRE_Int datasize; /* GEC1002 size of all data = ghlocalsize */ HYPRE_Int global_size; /* Total number coefficients */ - HYPRE_Int ref_count; } hypre_SStructVector; diff --git a/external/hypre/src/struct_ls/CMakeLists.txt b/external/hypre/src/struct_ls/CMakeLists.txt index 11d51c9e..95239832 100644 --- a/external/hypre/src/struct_ls/CMakeLists.txt +++ b/external/hypre/src/struct_ls/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -73,14 +73,16 @@ set(SRCS sparse_msg_setup.c sparse_msg_setup_rap.c sparse_msg_solve.c + F90_HYPRE_struct_flexgmres.c + F90_HYPRE_struct_lgmres.c ) target_sources(${PROJECT_NAME} PRIVATE ${SRCS} ${HDRS} ) -if (HYPRE_USING_CUDA) - set(CUDA_SRCS +if (HYPRE_USING_GPU) + set(GPU_SRCS cyclic_reduction.c HYPRE_struct_int.c HYPRE_struct_pcg.c @@ -108,8 +110,8 @@ if (HYPRE_USING_CUDA) sparse_msg_interp.c sparse_msg_restrict.c ) - convert_filenames_to_full_paths(CUDA_SRCS) - set(HYPRE_CUDA_SOURCES ${HYPRE_CUDA_SOURCES} ${CUDA_SRCS} PARENT_SCOPE) + convert_filenames_to_full_paths(GPU_SRCS) + set(HYPRE_GPU_SOURCES ${HYPRE_GPU_SOURCES} ${GPU_SRCS} PARENT_SCOPE) endif () convert_filenames_to_full_paths(HDRS) diff --git a/external/hypre/src/struct_ls/F90_HYPRE_struct_bicgstab.c b/external/hypre/src/struct_ls/F90_HYPRE_struct_bicgstab.c index 16970e41..c55c1c73 100644 --- a/external/hypre/src/struct_ls/F90_HYPRE_struct_bicgstab.c +++ b/external/hypre/src/struct_ls/F90_HYPRE_struct_bicgstab.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,14 +17,14 @@ extern "C" { void hypre_F90_IFACE(hypre_structbicgstabcreate, HYPRE_STRUCTBICGSTABCREATE) - ( hypre_F90_Comm *comm, - hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Comm *comm, + hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructBiCGSTABCreate( - hypre_F90_PassComm (comm), - hypre_F90_PassObjRef (HYPRE_StructSolver, solver) ) ); + ( HYPRE_StructBiCGSTABCreate( + hypre_F90_PassComm (comm), + hypre_F90_PassObjRef (HYPRE_StructSolver, solver) ) ); } /*-------------------------------------------------------------------------- @@ -32,12 +32,12 @@ hypre_F90_IFACE(hypre_structbicgstabcreate, HYPRE_STRUCTBICGSTABCREATE) void hypre_F90_IFACE(hypre_structbicgstabdestroy, HYPRE_STRUCTBICGSTABDESTROY) - ( hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructBiCGSTABDestroy( - hypre_F90_PassObj (HYPRE_StructSolver, solver) ) ); + ( HYPRE_StructBiCGSTABDestroy( + hypre_F90_PassObj (HYPRE_StructSolver, solver) ) ); } /*-------------------------------------------------------------------------- @@ -45,18 +45,18 @@ hypre_F90_IFACE(hypre_structbicgstabdestroy, HYPRE_STRUCTBICGSTABDESTROY) void hypre_F90_IFACE(hypre_structbicgstabsetup, HYPRE_STRUCTBICGSTABSETUP) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructBiCGSTABSetup( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassObj (HYPRE_StructMatrix, A), - hypre_F90_PassObj (HYPRE_StructVector, b), - hypre_F90_PassObj (HYPRE_StructVector, x) ) ); + ( HYPRE_StructBiCGSTABSetup( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassObj (HYPRE_StructMatrix, A), + hypre_F90_PassObj (HYPRE_StructVector, b), + hypre_F90_PassObj (HYPRE_StructVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -64,18 +64,18 @@ hypre_F90_IFACE(hypre_structbicgstabsetup, HYPRE_STRUCTBICGSTABSETUP) void hypre_F90_IFACE(hypre_structbicgstabsolve, HYPRE_STRUCTBICGSTABSOLVE) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructBiCGSTABSolve( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassObj (HYPRE_StructMatrix, A), - hypre_F90_PassObj (HYPRE_StructVector, b), - hypre_F90_PassObj (HYPRE_StructVector, x) ) ); + ( HYPRE_StructBiCGSTABSolve( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassObj (HYPRE_StructMatrix, A), + hypre_F90_PassObj (HYPRE_StructVector, b), + hypre_F90_PassObj (HYPRE_StructVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -83,14 +83,14 @@ hypre_F90_IFACE(hypre_structbicgstabsolve, HYPRE_STRUCTBICGSTABSOLVE) void hypre_F90_IFACE(hypre_structbicgstabsettol, HYPRE_STRUCTBICGSTABSETTOL) - ( hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructBiCGSTABSetTol( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassReal (tol) ) ); + ( HYPRE_StructBiCGSTABSetTol( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassReal (tol) ) ); } /*-------------------------------------------------------------------------- @@ -98,14 +98,14 @@ hypre_F90_IFACE(hypre_structbicgstabsettol, HYPRE_STRUCTBICGSTABSETTOL) void hypre_F90_IFACE(hypre_structbicgstabsetabstol, HYPRE_STRUCTBICGSTABSETABSTOL) - ( hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructBiCGSTABSetAbsoluteTol( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassReal (tol) ) ); + ( HYPRE_StructBiCGSTABSetAbsoluteTol( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassReal (tol) ) ); } /*-------------------------------------------------------------------------- @@ -113,14 +113,14 @@ hypre_F90_IFACE(hypre_structbicgstabsetabstol, HYPRE_STRUCTBICGSTABSETABSTOL) void hypre_F90_IFACE(hypre_structbicgstabsetmaxiter, HYPRE_STRUCTBICGSTABSETMAXITER) - ( hypre_F90_Obj *solver, - hypre_F90_Int *max_iter, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *max_iter, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructBiCGSTABSetMaxIter( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (max_iter) ) ); + ( HYPRE_StructBiCGSTABSetMaxIter( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (max_iter) ) ); } /*-------------------------------------------------------------------------- @@ -128,10 +128,10 @@ hypre_F90_IFACE(hypre_structbicgstabsetmaxiter, HYPRE_STRUCTBICGSTABSETMAXITER) void hypre_F90_IFACE(hypre_structbicgstabsetprecond, HYPRE_STRUCTBICGSTABSETPRECOND) - ( hypre_F90_Obj *solver, - hypre_F90_Int *precond_id, - hypre_F90_Obj *precond_solver, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *precond_id, + hypre_F90_Obj *precond_solver, + hypre_F90_Int *ierr ) { /*------------------------------------------------------------ @@ -146,38 +146,38 @@ hypre_F90_IFACE(hypre_structbicgstabsetprecond, HYPRE_STRUCTBICGSTABSETPRECOND) if (*precond_id == 0) { *ierr = (hypre_F90_Int) - ( HYPRE_StructBiCGSTABSetPrecond( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - HYPRE_StructSMGSolve, - HYPRE_StructSMGSetup, - hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); + ( HYPRE_StructBiCGSTABSetPrecond( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + HYPRE_StructSMGSolve, + HYPRE_StructSMGSetup, + hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); } else if (*precond_id == 1) { *ierr = (hypre_F90_Int) - ( HYPRE_StructBiCGSTABSetPrecond( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - HYPRE_StructPFMGSolve, - HYPRE_StructPFMGSetup, - hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); + ( HYPRE_StructBiCGSTABSetPrecond( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + HYPRE_StructPFMGSolve, + HYPRE_StructPFMGSetup, + hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); } else if (*precond_id == 7) { *ierr = (hypre_F90_Int) - ( HYPRE_StructBiCGSTABSetPrecond( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - HYPRE_StructJacobiSolve, - HYPRE_StructJacobiSetup, - hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); + ( HYPRE_StructBiCGSTABSetPrecond( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + HYPRE_StructJacobiSolve, + HYPRE_StructJacobiSetup, + hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); } else if (*precond_id == 8) { *ierr = (hypre_F90_Int) - ( HYPRE_StructBiCGSTABSetPrecond( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - HYPRE_StructDiagScale, - HYPRE_StructDiagScaleSetup, - hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); + ( HYPRE_StructBiCGSTABSetPrecond( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + HYPRE_StructDiagScale, + HYPRE_StructDiagScaleSetup, + hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); } else if (*precond_id == 9) { @@ -194,14 +194,14 @@ hypre_F90_IFACE(hypre_structbicgstabsetprecond, HYPRE_STRUCTBICGSTABSETPRECOND) void hypre_F90_IFACE(hypre_structbicgstabsetlogging, HYPRE_STRUCTBICGSTABSETLOGGING) - ( hypre_F90_Obj *solver, - hypre_F90_Int *logging, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *logging, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructBiCGSTABSetLogging( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (logging) ) ); + ( HYPRE_StructBiCGSTABSetLogging( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (logging) ) ); } /*-------------------------------------------------------------------------- @@ -209,14 +209,14 @@ hypre_F90_IFACE(hypre_structbicgstabsetlogging, HYPRE_STRUCTBICGSTABSETLOGGING) void hypre_F90_IFACE(hypre_structbicgstabsetprintlev, HYPRE_STRUCTBICGSTABSETPRINTLEV) - ( hypre_F90_Obj *solver, - hypre_F90_Int *print_level, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *print_level, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructBiCGSTABSetPrintLevel( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (print_level) ) ); + ( HYPRE_StructBiCGSTABSetPrintLevel( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (print_level) ) ); } /*-------------------------------------------------------------------------- @@ -224,14 +224,14 @@ hypre_F90_IFACE(hypre_structbicgstabsetprintlev, HYPRE_STRUCTBICGSTABSETPRINTLEV void hypre_F90_IFACE(hypre_structbicgstabgetnumitera, HYPRE_STRUCTBICGSTABGETNUMITERA) - ( hypre_F90_Obj *solver, - hypre_F90_Int *num_iterations, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *num_iterations, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructBiCGSTABGetNumIterations( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassIntRef (num_iterations) ) ); + ( HYPRE_StructBiCGSTABGetNumIterations( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassIntRef (num_iterations) ) ); } /*-------------------------------------------------------------------------- @@ -239,14 +239,14 @@ hypre_F90_IFACE(hypre_structbicgstabgetnumitera, HYPRE_STRUCTBICGSTABGETNUMITERA void hypre_F90_IFACE(hypre_structbicgstabgetresidual, HYPRE_STRUCTBICGSTABGETRESIDUAL) - ( hypre_F90_Obj *solver, - void *residual, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + void *residual, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructBiCGSTABGetResidual( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - (void **) residual ) ); + ( HYPRE_StructBiCGSTABGetResidual( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + (void **) residual ) ); } /*-------------------------------------------------------------------------- @@ -254,14 +254,14 @@ hypre_F90_IFACE(hypre_structbicgstabgetresidual, HYPRE_STRUCTBICGSTABGETRESIDUAL void hypre_F90_IFACE(hypre_structbicgstabgetfinalrel, HYPRE_STRUCTBICGSTABGETFINALREL) - ( hypre_F90_Obj *solver, - hypre_F90_Real *norm, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *norm, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructBiCGSTABGetFinalRelativeResidualNorm( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassRealRef (norm) ) ); + ( HYPRE_StructBiCGSTABGetFinalRelativeResidualNorm( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassRealRef (norm) ) ); } #ifdef __cplusplus diff --git a/external/hypre/src/struct_ls/F90_HYPRE_struct_cycred.c b/external/hypre/src/struct_ls/F90_HYPRE_struct_cycred.c index 8f229417..0b858fe9 100644 --- a/external/hypre/src/struct_ls/F90_HYPRE_struct_cycred.c +++ b/external/hypre/src/struct_ls/F90_HYPRE_struct_cycred.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -11,71 +11,71 @@ #ifdef __cplusplus extern "C" { #endif - + /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_structcycredcreate, HYPRE_STRUCTCYCREDCREATE) - ( hypre_F90_Comm *comm, - hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Comm *comm, + hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructCycRedCreate( - hypre_F90_PassComm (comm), - hypre_F90_PassObjRef (HYPRE_StructSolver, solver) ) ); + ( HYPRE_StructCycRedCreate( + hypre_F90_PassComm (comm), + hypre_F90_PassObjRef (HYPRE_StructSolver, solver) ) ); } /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_structcycreddestroy, HYPRE_STRUCTCYCREDDESTROY) - ( hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructCycRedDestroy( - hypre_F90_PassObj (HYPRE_StructSolver, solver) ) ); + ( HYPRE_StructCycRedDestroy( + hypre_F90_PassObj (HYPRE_StructSolver, solver) ) ); } /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_structcycredsetup, HYPRE_STRUCTCYCREDSETUP) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructCycRedSetup( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassObj (HYPRE_StructMatrix, A), - hypre_F90_PassObj (HYPRE_StructVector, b), - hypre_F90_PassObj (HYPRE_StructVector, x) ) ); + ( HYPRE_StructCycRedSetup( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassObj (HYPRE_StructMatrix, A), + hypre_F90_PassObj (HYPRE_StructVector, b), + hypre_F90_PassObj (HYPRE_StructVector, x) ) ); } /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_structcycredsolve, HYPRE_STRUCTCYCREDSOLVE) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructCycRedSolve( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassObj (HYPRE_StructMatrix, A), - hypre_F90_PassObj (HYPRE_StructVector, b), - hypre_F90_PassObj (HYPRE_StructVector, x) ) ); + ( HYPRE_StructCycRedSolve( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassObj (HYPRE_StructMatrix, A), + hypre_F90_PassObj (HYPRE_StructVector, b), + hypre_F90_PassObj (HYPRE_StructVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -83,14 +83,14 @@ hypre_F90_IFACE(hypre_structcycredsolve, HYPRE_STRUCTCYCREDSOLVE) void hypre_F90_IFACE(hypre_structcycredsettdim, HYPRE_STRUCTCYCREDSETTDIM) - ( hypre_F90_Obj *solver, - hypre_F90_Int *tdim, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *tdim, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructCycRedSetTDim( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (tdim) ) ); + ( HYPRE_StructCycRedSetTDim( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (tdim) ) ); } /*-------------------------------------------------------------------------- @@ -98,20 +98,20 @@ hypre_F90_IFACE(hypre_structcycredsettdim, HYPRE_STRUCTCYCREDSETTDIM) void hypre_F90_IFACE(hypre_structcycredsetbase, HYPRE_STRUCTCYCREDSETBASE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *ndim, - hypre_F90_IntArray *base_index, - hypre_F90_IntArray *base_stride, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *ndim, + hypre_F90_IntArray *base_index, + hypre_F90_IntArray *base_stride, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructCycRedSetBase( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (ndim), - hypre_F90_PassIntArray (base_index), - hypre_F90_PassIntArray (base_stride) ) ); + ( HYPRE_StructCycRedSetBase( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (ndim), + hypre_F90_PassIntArray (base_index), + hypre_F90_PassIntArray (base_stride) ) ); } - + #ifdef __cplusplus } #endif diff --git a/external/hypre/src/struct_ls/F90_HYPRE_struct_flexgmres.c b/external/hypre/src/struct_ls/F90_HYPRE_struct_flexgmres.c index 22eadd72..c00cba27 100644 --- a/external/hypre/src/struct_ls/F90_HYPRE_struct_flexgmres.c +++ b/external/hypre/src/struct_ls/F90_HYPRE_struct_flexgmres.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,14 +17,14 @@ extern "C" { void hypre_F90_IFACE(hypre_structfgmrescreate, HYPRE_STRUCTFGMRESCREATE) - ( hypre_F90_Comm *comm, - hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Comm *comm, + hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructFlexGMRESCreate( - hypre_F90_PassComm (comm), - hypre_F90_PassObjRef (HYPRE_StructSolver, solver) ) ); + ( HYPRE_StructFlexGMRESCreate( + hypre_F90_PassComm (comm), + hypre_F90_PassObjRef (HYPRE_StructSolver, solver) ) ); } /*-------------------------------------------------------------------------- @@ -32,12 +32,12 @@ hypre_F90_IFACE(hypre_structfgmrescreate, HYPRE_STRUCTFGMRESCREATE) void hypre_F90_IFACE(hypre_structfgmresdestroy, HYPRE_STRUCTFGMRESDESTROY) - ( hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructFlexGMRESDestroy( - hypre_F90_PassObj (HYPRE_StructSolver, solver) ) ); + ( HYPRE_StructFlexGMRESDestroy( + hypre_F90_PassObj (HYPRE_StructSolver, solver) ) ); } /*-------------------------------------------------------------------------- @@ -45,18 +45,18 @@ hypre_F90_IFACE(hypre_structfgmresdestroy, HYPRE_STRUCTFGMRESDESTROY) void hypre_F90_IFACE(hypre_structfgmressetup, HYPRE_STRUCTFGMRESSETUP) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructFlexGMRESSetup( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassObj (HYPRE_StructMatrix, A), - hypre_F90_PassObj (HYPRE_StructVector, b), - hypre_F90_PassObj (HYPRE_StructVector, x) ) ); + ( HYPRE_StructFlexGMRESSetup( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassObj (HYPRE_StructMatrix, A), + hypre_F90_PassObj (HYPRE_StructVector, b), + hypre_F90_PassObj (HYPRE_StructVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -64,18 +64,18 @@ hypre_F90_IFACE(hypre_structfgmressetup, HYPRE_STRUCTFGMRESSETUP) void hypre_F90_IFACE(hypre_structfgmressolve, HYPRE_STRUCTFGMRESSOLVE) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructFlexGMRESSolve( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassObj (HYPRE_StructMatrix, A), - hypre_F90_PassObj (HYPRE_StructVector, b), - hypre_F90_PassObj (HYPRE_StructVector, x) ) ); + ( HYPRE_StructFlexGMRESSolve( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassObj (HYPRE_StructMatrix, A), + hypre_F90_PassObj (HYPRE_StructVector, b), + hypre_F90_PassObj (HYPRE_StructVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -83,14 +83,14 @@ hypre_F90_IFACE(hypre_structfgmressolve, HYPRE_STRUCTFGMRESSOLVE) void hypre_F90_IFACE(hypre_structfgmressettol, HYPRE_STRUCTFGMRESSETTOL) - ( hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructFlexGMRESSetTol( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassReal (tol) ) ); + ( HYPRE_StructFlexGMRESSetTol( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassReal (tol) ) ); } /*-------------------------------------------------------------------------- @@ -98,14 +98,14 @@ hypre_F90_IFACE(hypre_structfgmressettol, HYPRE_STRUCTFGMRESSETTOL) void hypre_F90_IFACE(hypre_structfgmressetabstol, HYPRE_STRUCTFGMRESSETABSTOL) - ( hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructFlexGMRESSetAbsoluteTol( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassReal (tol) ) ); + ( HYPRE_StructFlexGMRESSetAbsoluteTol( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassReal (tol) ) ); } /*-------------------------------------------------------------------------- @@ -113,14 +113,14 @@ hypre_F90_IFACE(hypre_structfgmressetabstol, HYPRE_STRUCTFGMRESSETABSTOL) void hypre_F90_IFACE(hypre_structfgmressetmaxiter, HYPRE_STRUCTFGMRESSETMAXITER) - ( hypre_F90_Obj *solver, - hypre_F90_Int *max_iter, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *max_iter, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructFlexGMRESSetMaxIter( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (max_iter) ) ); + ( HYPRE_StructFlexGMRESSetMaxIter( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (max_iter) ) ); } /*-------------------------------------------------------------------------- @@ -128,14 +128,14 @@ hypre_F90_IFACE(hypre_structfgmressetmaxiter, HYPRE_STRUCTFGMRESSETMAXITER) void hypre_F90_IFACE(hypre_structfgmressetkdim, HYPRE_STRUCTFGMRESSETKDIM) - (hypre_F90_Obj *solver, - hypre_F90_Int *k_dim, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *k_dim, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_StructFlexGMRESSetKDim( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (k_dim) )); + (HYPRE_StructFlexGMRESSetKDim( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (k_dim) )); } /*-------------------------------------------------------------------------- @@ -143,10 +143,10 @@ hypre_F90_IFACE(hypre_structfgmressetkdim, HYPRE_STRUCTFGMRESSETKDIM) void hypre_F90_IFACE(hypre_structfgmressetprecond, HYPRE_STRUCTFGMRESSETPRECOND) - ( hypre_F90_Obj *solver, - hypre_F90_Int *precond_id, - hypre_F90_Obj *precond_solver, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *precond_id, + hypre_F90_Obj *precond_solver, + hypre_F90_Int *ierr ) { /*------------------------------------------------------------ @@ -161,38 +161,38 @@ hypre_F90_IFACE(hypre_structfgmressetprecond, HYPRE_STRUCTFGMRESSETPRECOND) if (*precond_id == 0) { *ierr = (hypre_F90_Int) - ( HYPRE_StructFlexGMRESSetPrecond( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - HYPRE_StructSMGSolve, - HYPRE_StructSMGSetup, - hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); + ( HYPRE_StructFlexGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + HYPRE_StructSMGSolve, + HYPRE_StructSMGSetup, + hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); } else if (*precond_id == 1) { *ierr = (hypre_F90_Int) - ( HYPRE_StructFlexGMRESSetPrecond( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - HYPRE_StructPFMGSolve, - HYPRE_StructPFMGSetup, - hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); + ( HYPRE_StructFlexGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + HYPRE_StructPFMGSolve, + HYPRE_StructPFMGSetup, + hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); } else if (*precond_id == 6) { *ierr = (hypre_F90_Int) - ( HYPRE_StructFlexGMRESSetPrecond( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - HYPRE_StructJacobiSolve, - HYPRE_StructJacobiSetup, - hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); + ( HYPRE_StructFlexGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + HYPRE_StructJacobiSolve, + HYPRE_StructJacobiSetup, + hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); } else if (*precond_id == 8) { *ierr = (hypre_F90_Int) - ( HYPRE_StructFlexGMRESSetPrecond( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - HYPRE_StructDiagScale, - HYPRE_StructDiagScaleSetup, - hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); + ( HYPRE_StructFlexGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + HYPRE_StructDiagScale, + HYPRE_StructDiagScaleSetup, + hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); } else if (*precond_id == 9) { @@ -209,14 +209,14 @@ hypre_F90_IFACE(hypre_structfgmressetprecond, HYPRE_STRUCTFGMRESSETPRECOND) void hypre_F90_IFACE(hypre_structfgmressetlogging, HYPRE_STRUCTFGMRESSETLOGGING) - ( hypre_F90_Obj *solver, - hypre_F90_Int *logging, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *logging, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructFlexGMRESSetLogging( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (logging) ) ); + ( HYPRE_StructFlexGMRESSetLogging( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (logging) ) ); } /*-------------------------------------------------------------------------- @@ -224,14 +224,14 @@ hypre_F90_IFACE(hypre_structfgmressetlogging, HYPRE_STRUCTFGMRESSETLOGGING) void hypre_F90_IFACE(hypre_structfgmressetprintlevel, HYPRE_STRUCTFGMRESSETPRINTLEVEL) - ( hypre_F90_Obj *solver, - hypre_F90_Int *print_level, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *print_level, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructFlexGMRESSetPrintLevel( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (print_level) ) ); + ( HYPRE_StructFlexGMRESSetPrintLevel( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (print_level) ) ); } /*-------------------------------------------------------------------------- @@ -239,14 +239,14 @@ hypre_F90_IFACE(hypre_structfgmressetprintlevel, HYPRE_STRUCTFGMRESSETPRINTLEVEL void hypre_F90_IFACE(hypre_structfgmresgetnumiter, HYPRE_STRUCTFGMRESGETNUMITER) - ( hypre_F90_Obj *solver, - hypre_F90_Int *num_iterations, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *num_iterations, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructFlexGMRESGetNumIterations( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassIntRef (num_iterations) ) ); + ( HYPRE_StructFlexGMRESGetNumIterations( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassIntRef (num_iterations) ) ); } /*-------------------------------------------------------------------------- @@ -254,14 +254,14 @@ hypre_F90_IFACE(hypre_structfgmresgetnumiter, HYPRE_STRUCTFGMRESGETNUMITER) void hypre_F90_IFACE(hypre_structfgmresgetfinalrel, HYPRE_STRUCTFGMRESGETFINALREL) - ( hypre_F90_Obj *solver, - hypre_F90_Real *norm, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *norm, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructFlexGMRESGetFinalRelativeResidualNorm( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassRealRef (norm) ) ); + ( HYPRE_StructFlexGMRESGetFinalRelativeResidualNorm( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassRealRef (norm) ) ); } #ifdef __cplusplus diff --git a/external/hypre/src/struct_ls/F90_HYPRE_struct_gmres.c b/external/hypre/src/struct_ls/F90_HYPRE_struct_gmres.c index 3126afec..794aa247 100644 --- a/external/hypre/src/struct_ls/F90_HYPRE_struct_gmres.c +++ b/external/hypre/src/struct_ls/F90_HYPRE_struct_gmres.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,14 +17,14 @@ extern "C" { void hypre_F90_IFACE(hypre_structgmrescreate, HYPRE_STRUCTGMRESCREATE) - ( hypre_F90_Comm *comm, - hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Comm *comm, + hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructGMRESCreate( - hypre_F90_PassComm (comm), - hypre_F90_PassObjRef (HYPRE_StructSolver, solver) ) ); + ( HYPRE_StructGMRESCreate( + hypre_F90_PassComm (comm), + hypre_F90_PassObjRef (HYPRE_StructSolver, solver) ) ); } /*-------------------------------------------------------------------------- @@ -32,12 +32,12 @@ hypre_F90_IFACE(hypre_structgmrescreate, HYPRE_STRUCTGMRESCREATE) void hypre_F90_IFACE(hypre_structgmresdestroy, HYPRE_STRUCTGMRESDESTROY) - ( hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructGMRESDestroy( - hypre_F90_PassObj (HYPRE_StructSolver, solver) ) ); + ( HYPRE_StructGMRESDestroy( + hypre_F90_PassObj (HYPRE_StructSolver, solver) ) ); } /*-------------------------------------------------------------------------- @@ -45,18 +45,18 @@ hypre_F90_IFACE(hypre_structgmresdestroy, HYPRE_STRUCTGMRESDESTROY) void hypre_F90_IFACE(hypre_structgmressetup, HYPRE_STRUCTGMRESSETUP) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructGMRESSetup( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassObj (HYPRE_StructMatrix, A), - hypre_F90_PassObj (HYPRE_StructVector, b), - hypre_F90_PassObj (HYPRE_StructVector, x) ) ); + ( HYPRE_StructGMRESSetup( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassObj (HYPRE_StructMatrix, A), + hypre_F90_PassObj (HYPRE_StructVector, b), + hypre_F90_PassObj (HYPRE_StructVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -64,18 +64,18 @@ hypre_F90_IFACE(hypre_structgmressetup, HYPRE_STRUCTGMRESSETUP) void hypre_F90_IFACE(hypre_structgmressolve, HYPRE_STRUCTGMRESSOLVE) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructGMRESSolve( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassObj (HYPRE_StructMatrix, A), - hypre_F90_PassObj (HYPRE_StructVector, b), - hypre_F90_PassObj (HYPRE_StructVector, x) ) ); + ( HYPRE_StructGMRESSolve( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassObj (HYPRE_StructMatrix, A), + hypre_F90_PassObj (HYPRE_StructVector, b), + hypre_F90_PassObj (HYPRE_StructVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -83,14 +83,14 @@ hypre_F90_IFACE(hypre_structgmressolve, HYPRE_STRUCTGMRESSOLVE) void hypre_F90_IFACE(hypre_structgmressettol, HYPRE_STRUCTGMRESSETTOL) - ( hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructGMRESSetTol( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassReal (tol) ) ); + ( HYPRE_StructGMRESSetTol( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassReal (tol) ) ); } /*-------------------------------------------------------------------------- @@ -98,14 +98,14 @@ hypre_F90_IFACE(hypre_structgmressettol, HYPRE_STRUCTGMRESSETTOL) void hypre_F90_IFACE(hypre_structgmressetabstol, HYPRE_STRUCTGMRESSETABSTOL) - ( hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructGMRESSetAbsoluteTol( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassReal (tol) ) ); + ( HYPRE_StructGMRESSetAbsoluteTol( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassReal (tol) ) ); } /*-------------------------------------------------------------------------- @@ -113,14 +113,14 @@ hypre_F90_IFACE(hypre_structgmressetabstol, HYPRE_STRUCTGMRESSETABSTOL) void hypre_F90_IFACE(hypre_structgmressetmaxiter, HYPRE_STRUCTGMRESSETMAXITER) - ( hypre_F90_Obj *solver, - hypre_F90_Int *max_iter, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *max_iter, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructGMRESSetMaxIter( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (max_iter) ) ); + ( HYPRE_StructGMRESSetMaxIter( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (max_iter) ) ); } /*-------------------------------------------------------------------------- @@ -128,14 +128,14 @@ hypre_F90_IFACE(hypre_structgmressetmaxiter, HYPRE_STRUCTGMRESSETMAXITER) void hypre_F90_IFACE(hypre_structgmressetkdim, HYPRE_STRUCTGMRESSETKDIM) - (hypre_F90_Obj *solver, - hypre_F90_Int *k_dim, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *k_dim, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_StructGMRESSetKDim( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (k_dim) )); + (HYPRE_StructGMRESSetKDim( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (k_dim) )); } /*-------------------------------------------------------------------------- @@ -143,10 +143,10 @@ hypre_F90_IFACE(hypre_structgmressetkdim, HYPRE_STRUCTGMRESSETKDIM) void hypre_F90_IFACE(hypre_structgmressetprecond, HYPRE_STRUCTGMRESSETPRECOND) - ( hypre_F90_Obj *solver, - hypre_F90_Int *precond_id, - hypre_F90_Obj *precond_solver, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *precond_id, + hypre_F90_Obj *precond_solver, + hypre_F90_Int *ierr ) { /*------------------------------------------------------------ @@ -161,38 +161,38 @@ hypre_F90_IFACE(hypre_structgmressetprecond, HYPRE_STRUCTGMRESSETPRECOND) if (*precond_id == 0) { *ierr = (hypre_F90_Int) - ( HYPRE_StructGMRESSetPrecond( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - HYPRE_StructSMGSolve, - HYPRE_StructSMGSetup, - hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); + ( HYPRE_StructGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + HYPRE_StructSMGSolve, + HYPRE_StructSMGSetup, + hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); } else if (*precond_id == 1) { *ierr = (hypre_F90_Int) - ( HYPRE_StructGMRESSetPrecond( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - HYPRE_StructPFMGSolve, - HYPRE_StructPFMGSetup, - hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); + ( HYPRE_StructGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + HYPRE_StructPFMGSolve, + HYPRE_StructPFMGSetup, + hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); } else if (*precond_id == 6) { *ierr = (hypre_F90_Int) - ( HYPRE_StructGMRESSetPrecond( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - HYPRE_StructJacobiSolve, - HYPRE_StructJacobiSetup, - hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); + ( HYPRE_StructGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + HYPRE_StructJacobiSolve, + HYPRE_StructJacobiSetup, + hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); } else if (*precond_id == 8) { *ierr = (hypre_F90_Int) - ( HYPRE_StructGMRESSetPrecond( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - HYPRE_StructDiagScale, - HYPRE_StructDiagScaleSetup, - hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); + ( HYPRE_StructGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + HYPRE_StructDiagScale, + HYPRE_StructDiagScaleSetup, + hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); } else if (*precond_id == 9) { @@ -209,14 +209,14 @@ hypre_F90_IFACE(hypre_structgmressetprecond, HYPRE_STRUCTGMRESSETPRECOND) void hypre_F90_IFACE(hypre_structgmressetlogging, HYPRE_STRUCTGMRESSETLOGGING) - ( hypre_F90_Obj *solver, - hypre_F90_Int *logging, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *logging, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructGMRESSetLogging( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (logging) ) ); + ( HYPRE_StructGMRESSetLogging( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (logging) ) ); } /*-------------------------------------------------------------------------- @@ -224,14 +224,14 @@ hypre_F90_IFACE(hypre_structgmressetlogging, HYPRE_STRUCTGMRESSETLOGGING) void hypre_F90_IFACE(hypre_structgmressetprintlevel, HYPRE_STRUCTGMRESSETPRINTLEVEL) - ( hypre_F90_Obj *solver, - hypre_F90_Int *print_level, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *print_level, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructGMRESSetPrintLevel( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (print_level) ) ); + ( HYPRE_StructGMRESSetPrintLevel( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (print_level) ) ); } /*-------------------------------------------------------------------------- @@ -239,14 +239,14 @@ hypre_F90_IFACE(hypre_structgmressetprintlevel, HYPRE_STRUCTGMRESSETPRINTLEVEL) void hypre_F90_IFACE(hypre_structgmresgetnumiteratio, HYPRE_STRUCTGMRESGETNUMITERATIO) - ( hypre_F90_Obj *solver, - hypre_F90_Int *num_iterations, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *num_iterations, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructGMRESGetNumIterations( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassIntRef (num_iterations) ) ); + ( HYPRE_StructGMRESGetNumIterations( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassIntRef (num_iterations) ) ); } /*-------------------------------------------------------------------------- @@ -254,14 +254,14 @@ hypre_F90_IFACE(hypre_structgmresgetnumiteratio, HYPRE_STRUCTGMRESGETNUMITERATIO void hypre_F90_IFACE(hypre_structgmresgetfinalrelati, HYPRE_STRUCTGMRESGETFINALRELATI) - ( hypre_F90_Obj *solver, - hypre_F90_Real *norm, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *norm, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructGMRESGetFinalRelativeResidualNorm( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassRealRef (norm) ) ); + ( HYPRE_StructGMRESGetFinalRelativeResidualNorm( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassRealRef (norm) ) ); } #ifdef __cplusplus diff --git a/external/hypre/src/struct_ls/F90_HYPRE_struct_hybrid.c b/external/hypre/src/struct_ls/F90_HYPRE_struct_hybrid.c index fccb8172..802adf1e 100644 --- a/external/hypre/src/struct_ls/F90_HYPRE_struct_hybrid.c +++ b/external/hypre/src/struct_ls/F90_HYPRE_struct_hybrid.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -18,14 +18,14 @@ extern "C" { void hypre_F90_IFACE(hypre_structhybridcreate, HYPRE_STRUCTHYBRIDCREATE) - ( hypre_F90_Comm *comm, - hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Comm *comm, + hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructHybridCreate( - hypre_F90_PassComm (comm), - hypre_F90_PassObjRef (HYPRE_StructSolver, solver) ) ); + ( HYPRE_StructHybridCreate( + hypre_F90_PassComm (comm), + hypre_F90_PassObjRef (HYPRE_StructSolver, solver) ) ); } /*-------------------------------------------------------------------------- @@ -34,12 +34,12 @@ hypre_F90_IFACE(hypre_structhybridcreate, HYPRE_STRUCTHYBRIDCREATE) void hypre_F90_IFACE(hypre_structhybriddestroy, HYPRE_STRUCTHYBRIDDESTROY) - ( hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructHybridDestroy( - hypre_F90_PassObj (HYPRE_StructSolver, solver) ) ); + ( HYPRE_StructHybridDestroy( + hypre_F90_PassObj (HYPRE_StructSolver, solver) ) ); } /*-------------------------------------------------------------------------- @@ -48,18 +48,18 @@ hypre_F90_IFACE(hypre_structhybriddestroy, HYPRE_STRUCTHYBRIDDESTROY) void hypre_F90_IFACE(hypre_structhybridsetup, HYPRE_STRUCTHYBRIDSETUP) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructHybridSetup( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassObj (HYPRE_StructMatrix, A), - hypre_F90_PassObj (HYPRE_StructVector, b), - hypre_F90_PassObj (HYPRE_StructVector, x) ) ); + ( HYPRE_StructHybridSetup( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassObj (HYPRE_StructMatrix, A), + hypre_F90_PassObj (HYPRE_StructVector, b), + hypre_F90_PassObj (HYPRE_StructVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -68,18 +68,18 @@ hypre_F90_IFACE(hypre_structhybridsetup, HYPRE_STRUCTHYBRIDSETUP) void hypre_F90_IFACE(hypre_structhybridsolve, HYPRE_STRUCTHYBRIDSOLVE) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructHybridSolve( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassObj (HYPRE_StructMatrix, A), - hypre_F90_PassObj (HYPRE_StructVector, b), - hypre_F90_PassObj (HYPRE_StructVector, x) ) ); + ( HYPRE_StructHybridSolve( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassObj (HYPRE_StructMatrix, A), + hypre_F90_PassObj (HYPRE_StructVector, b), + hypre_F90_PassObj (HYPRE_StructVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -88,14 +88,14 @@ hypre_F90_IFACE(hypre_structhybridsolve, HYPRE_STRUCTHYBRIDSOLVE) void hypre_F90_IFACE(hypre_structhybridsettol, HYPRE_STRUCTHYBRIDSETTOL) - ( hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructHybridSetTol( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassReal (tol) ) ); + ( HYPRE_StructHybridSetTol( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassReal (tol) ) ); } /*-------------------------------------------------------------------------- @@ -104,14 +104,14 @@ hypre_F90_IFACE(hypre_structhybridsettol, HYPRE_STRUCTHYBRIDSETTOL) void hypre_F90_IFACE(hypre_structhybridsetconvergenc, HYPRE_STRUCTHYBRIDSETCONVERGENC) - ( hypre_F90_Obj *solver, - hypre_F90_Real *cf_tol, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *cf_tol, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructHybridSetConvergenceTol( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassReal (cf_tol) ) ); + ( HYPRE_StructHybridSetConvergenceTol( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassReal (cf_tol) ) ); } /*-------------------------------------------------------------------------- @@ -120,14 +120,14 @@ hypre_F90_IFACE(hypre_structhybridsetconvergenc, HYPRE_STRUCTHYBRIDSETCONVERGENC void hypre_F90_IFACE(hypre_structhybridsetdscgmaxite, HYPRE_STRUCTHYBRIDSETDSCGMAXITE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *dscg_max_its, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *dscg_max_its, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructHybridSetDSCGMaxIter( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (dscg_max_its) ) ); + ( HYPRE_StructHybridSetDSCGMaxIter( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (dscg_max_its) ) ); } /*-------------------------------------------------------------------------- @@ -136,14 +136,14 @@ hypre_F90_IFACE(hypre_structhybridsetdscgmaxite, HYPRE_STRUCTHYBRIDSETDSCGMAXITE void hypre_F90_IFACE(hypre_structhybridsetpcgmaxiter, HYPRE_STRUCTHYBRIDSETPCGMAXITER) - ( hypre_F90_Obj *solver, - hypre_F90_Int *pcg_max_its, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *pcg_max_its, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructHybridSetPCGMaxIter( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (pcg_max_its) ) ); + ( HYPRE_StructHybridSetPCGMaxIter( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (pcg_max_its) ) ); } @@ -153,14 +153,14 @@ hypre_F90_IFACE(hypre_structhybridsetpcgmaxiter, HYPRE_STRUCTHYBRIDSETPCGMAXITER void hypre_F90_IFACE(hypre_structhybridsetpcgabsolut, HYPRE_STRUCTHYBRIDSETPCGABSOLUT) - ( hypre_F90_Obj *solver, - hypre_F90_Real *pcg_atolf, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *pcg_atolf, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructHybridSetPCGAbsoluteTolFactor( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassReal (pcg_atolf) ) ); + ( HYPRE_StructHybridSetPCGAbsoluteTolFactor( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassReal (pcg_atolf) ) ); } /*-------------------------------------------------------------------------- @@ -169,14 +169,14 @@ hypre_F90_IFACE(hypre_structhybridsetpcgabsolut, HYPRE_STRUCTHYBRIDSETPCGABSOLUT void hypre_F90_IFACE(hypre_structhybridsettwonorm, HYPRE_STRUCTHYBRIDSETTWONORM) - ( hypre_F90_Obj *solver, - hypre_F90_Int *two_norm, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *two_norm, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructHybridSetTwoNorm( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (two_norm) ) ); + ( HYPRE_StructHybridSetTwoNorm( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (two_norm) ) ); } /*-------------------------------------------------------------------------- @@ -185,14 +185,14 @@ hypre_F90_IFACE(hypre_structhybridsettwonorm, HYPRE_STRUCTHYBRIDSETTWONORM) void hypre_F90_IFACE(hypre_structhybridsetstopcrit, HYPRE_STRUCTHYBRIDSETSTOPCRIT) - ( hypre_F90_Obj *solver, - hypre_F90_Int *stop_crit, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *stop_crit, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructHybridSetStopCrit( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (stop_crit) ) ); + ( HYPRE_StructHybridSetStopCrit( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (stop_crit) ) ); } /*-------------------------------------------------------------------------- @@ -201,14 +201,14 @@ hypre_F90_IFACE(hypre_structhybridsetstopcrit, HYPRE_STRUCTHYBRIDSETSTOPCRIT) void hypre_F90_IFACE(hypre_structhybridsetrelchange, HYPRE_STRUCTHYBRIDSETRELCHANGE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *rel_change, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *rel_change, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructHybridSetRelChange( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (rel_change) ) ); + ( HYPRE_StructHybridSetRelChange( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (rel_change) ) ); } /*-------------------------------------------------------------------------- @@ -217,14 +217,14 @@ hypre_F90_IFACE(hypre_structhybridsetrelchange, HYPRE_STRUCTHYBRIDSETRELCHANGE) void hypre_F90_IFACE(hypre_structhybridsetsolvertype, HYPRE_STRUCTHYBRIDSETSOLVERTYPE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *solver_type, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *solver_type, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructHybridSetSolverType( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (solver_type) ) ); + ( HYPRE_StructHybridSetSolverType( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (solver_type) ) ); } /*-------------------------------------------------------------------------- @@ -233,14 +233,14 @@ hypre_F90_IFACE(hypre_structhybridsetsolvertype, HYPRE_STRUCTHYBRIDSETSOLVERTYPE void hypre_F90_IFACE(hypre_structhybridsetkdim, HYPRE_STRUCTHYBRIDSETKDIM) - ( hypre_F90_Obj *solver, - hypre_F90_Int *k_dim, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *k_dim, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - (HYPRE_StructHybridSetKDim( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (k_dim) ) ); + (HYPRE_StructHybridSetKDim( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (k_dim) ) ); } /*-------------------------------------------------------------------------- @@ -249,10 +249,10 @@ hypre_F90_IFACE(hypre_structhybridsetkdim, HYPRE_STRUCTHYBRIDSETKDIM) void hypre_F90_IFACE(hypre_structhybridsetprecond, HYPRE_STRUCTHYBRIDSETPRECOND) - ( hypre_F90_Obj *solver, - hypre_F90_Int *precond_id, - hypre_F90_Obj *precond_solver, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *precond_id, + hypre_F90_Obj *precond_solver, + hypre_F90_Int *ierr ) { /*------------------------------------------------------------ @@ -266,38 +266,38 @@ hypre_F90_IFACE(hypre_structhybridsetprecond, HYPRE_STRUCTHYBRIDSETPRECOND) if (*precond_id == 0) { *ierr = (hypre_F90_Int) - ( HYPRE_StructHybridSetPrecond( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - HYPRE_StructSMGSolve, - HYPRE_StructSMGSetup, - hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); + ( HYPRE_StructHybridSetPrecond( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + HYPRE_StructSMGSolve, + HYPRE_StructSMGSetup, + hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); } else if (*precond_id == 1) { *ierr = (hypre_F90_Int) - ( HYPRE_StructHybridSetPrecond( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - HYPRE_StructPFMGSolve, - HYPRE_StructPFMGSetup, - hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); + ( HYPRE_StructHybridSetPrecond( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + HYPRE_StructPFMGSolve, + HYPRE_StructPFMGSetup, + hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); } else if (*precond_id == 7) { *ierr = (hypre_F90_Int) - ( HYPRE_StructHybridSetPrecond( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - HYPRE_StructJacobiSolve, - HYPRE_StructJacobiSetup, - hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); + ( HYPRE_StructHybridSetPrecond( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + HYPRE_StructJacobiSolve, + HYPRE_StructJacobiSetup, + hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); } else if (*precond_id == 8) { *ierr = (hypre_F90_Int) - ( HYPRE_StructHybridSetPrecond( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - HYPRE_StructDiagScale, - HYPRE_StructDiagScaleSetup, - hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); + ( HYPRE_StructHybridSetPrecond( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + HYPRE_StructDiagScale, + HYPRE_StructDiagScaleSetup, + hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); } else { @@ -311,14 +311,14 @@ hypre_F90_IFACE(hypre_structhybridsetprecond, HYPRE_STRUCTHYBRIDSETPRECOND) void hypre_F90_IFACE(hypre_structhybridsetlogging, HYPRE_STRUCTHYBRIDSETLOGGING) - ( hypre_F90_Obj *solver, - hypre_F90_Int *logging, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *logging, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructHybridSetLogging( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (logging) ) ); + ( HYPRE_StructHybridSetLogging( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (logging) ) ); } /*-------------------------------------------------------------------------- @@ -327,14 +327,14 @@ hypre_F90_IFACE(hypre_structhybridsetlogging, HYPRE_STRUCTHYBRIDSETLOGGING) void hypre_F90_IFACE(hypre_structhybridsetprintlevel, HYPRE_STRUCTHYBRIDSETPRINTLEVEL) - ( hypre_F90_Obj *solver, - hypre_F90_Int *print_level, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *print_level, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructHybridSetPrintLevel( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (print_level) ) ); + ( HYPRE_StructHybridSetPrintLevel( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (print_level) ) ); } /*-------------------------------------------------------------------------- * HYPRE_StructHybridGetNumIterations @@ -342,14 +342,14 @@ hypre_F90_IFACE(hypre_structhybridsetprintlevel, HYPRE_STRUCTHYBRIDSETPRINTLEVEL void hypre_F90_IFACE(hypre_structhybridgetnumiterati, HYPRE_STRUCTHYBRIDGETNUMITERATI) - ( hypre_F90_Obj *solver, - hypre_F90_Int *num_its, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *num_its, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructHybridGetNumIterations( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassIntRef (num_its) ) ); + ( HYPRE_StructHybridGetNumIterations( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassIntRef (num_its) ) ); } /*-------------------------------------------------------------------------- @@ -358,14 +358,14 @@ hypre_F90_IFACE(hypre_structhybridgetnumiterati, HYPRE_STRUCTHYBRIDGETNUMITERATI void hypre_F90_IFACE(hypre_structhybridgetdscgnumite, HYPRE_STRUCTHYBRIDGETDSCGNUMITE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *dscg_num_its, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *dscg_num_its, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructHybridGetDSCGNumIterations( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassIntRef (dscg_num_its) ) ); + ( HYPRE_StructHybridGetDSCGNumIterations( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassIntRef (dscg_num_its) ) ); } /*-------------------------------------------------------------------------- @@ -374,14 +374,14 @@ hypre_F90_IFACE(hypre_structhybridgetdscgnumite, HYPRE_STRUCTHYBRIDGETDSCGNUMITE void hypre_F90_IFACE(hypre_structhybridgetpcgnumiter, HYPRE_STRUCTHYBRIDGETPCGNUMITER) - ( hypre_F90_Obj *solver, - hypre_F90_Int *pcg_num_its, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *pcg_num_its, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructHybridGetPCGNumIterations( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassIntRef (pcg_num_its) ) ); + ( HYPRE_StructHybridGetPCGNumIterations( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassIntRef (pcg_num_its) ) ); } /*-------------------------------------------------------------------------- @@ -390,14 +390,14 @@ hypre_F90_IFACE(hypre_structhybridgetpcgnumiter, HYPRE_STRUCTHYBRIDGETPCGNUMITER void hypre_F90_IFACE(hypre_structhybridgetfinalrelat, HYPRE_STRUCTHYBRIDGETFINALRELAT) - ( hypre_F90_Obj *solver, - hypre_F90_Real *norm, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *norm, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructHybridGetFinalRelativeResidualNorm( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassRealRef (norm) ) ); + ( HYPRE_StructHybridGetFinalRelativeResidualNorm( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassRealRef (norm) ) ); } #ifdef __cplusplus diff --git a/external/hypre/src/struct_ls/F90_HYPRE_struct_int.c b/external/hypre/src/struct_ls/F90_HYPRE_struct_int.c index 0362815a..bafb38e7 100644 --- a/external/hypre/src/struct_ls/F90_HYPRE_struct_int.c +++ b/external/hypre/src/struct_ls/F90_HYPRE_struct_int.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -11,21 +11,21 @@ #ifdef __cplusplus extern "C" { #endif - + /*-------------------------------------------------------------------------- * HYPRE_StructVectorSetRandomValues *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_structvectorsetrandomvalu, HYPRE_STRUCTVECTORSETRANDOMVALU) - (hypre_F90_Obj *vector, - hypre_F90_Int *seed, - hypre_F90_Int *ierr) +(hypre_F90_Obj *vector, + hypre_F90_Int *seed, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( hypre_StructVectorSetRandomValues( - (hypre_StructVector *) vector, - hypre_F90_PassInt (seed) )); + ( hypre_StructVectorSetRandomValues( + (hypre_StructVector *) vector, + hypre_F90_PassInt (seed) )); } @@ -35,14 +35,14 @@ hypre_F90_IFACE(hypre_structvectorsetrandomvalu, HYPRE_STRUCTVECTORSETRANDOMVALU void hypre_F90_IFACE(hypre_structsetrandomvalues, HYPRE_STRUCTSETRANDOMVALUES) - (hypre_F90_Obj *vector, - hypre_F90_Int *seed, - hypre_F90_Int *ierr) +(hypre_F90_Obj *vector, + hypre_F90_Int *seed, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( hypre_StructSetRandomValues( - (hypre_StructVector *) vector, - hypre_F90_PassInt (seed) )); + ( hypre_StructSetRandomValues( + (hypre_StructVector *) vector, + hypre_F90_PassInt (seed) )); } /*-------------------------------------------------------------------------- @@ -51,12 +51,12 @@ hypre_F90_IFACE(hypre_structsetrandomvalues, HYPRE_STRUCTSETRANDOMVALUES) void hypre_F90_IFACE(hypre_structsetupinterpreter, HYPRE_STRUCTSETUPINTERPRETER) - (hypre_F90_Obj *i, - hypre_F90_Int *ierr) +(hypre_F90_Obj *i, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_StructSetupInterpreter( - (mv_InterfaceInterpreter *) i )); + ( HYPRE_StructSetupInterpreter( + (mv_InterfaceInterpreter *) i )); } /*-------------------------------------------------------------------------- @@ -65,14 +65,14 @@ hypre_F90_IFACE(hypre_structsetupinterpreter, HYPRE_STRUCTSETUPINTERPRETER) void hypre_F90_IFACE(hypre_structsetupmatvec, HYPRE_STRUCTSETUPMATVEC) - (hypre_F90_Obj *mv, - hypre_F90_Int *ierr) +(hypre_F90_Obj *mv, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_StructSetupMatvec( - hypre_F90_PassObjRef (HYPRE_MatvecFunctions, mv))); + ( HYPRE_StructSetupMatvec( + hypre_F90_PassObjRef (HYPRE_MatvecFunctions, mv))); } - + #ifdef __cplusplus } #endif diff --git a/external/hypre/src/struct_ls/F90_HYPRE_struct_jacobi.c b/external/hypre/src/struct_ls/F90_HYPRE_struct_jacobi.c index af12b0c5..3a487397 100644 --- a/external/hypre/src/struct_ls/F90_HYPRE_struct_jacobi.c +++ b/external/hypre/src/struct_ls/F90_HYPRE_struct_jacobi.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -11,75 +11,75 @@ #ifdef __cplusplus extern "C" { #endif - + /*-------------------------------------------------------------------------- * HYPRE_StructJacobiCreate *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_structjacobicreate, HYPRE_STRUCTJACOBICREATE) - ( hypre_F90_Comm *comm, - hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Comm *comm, + hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructJacobiCreate( - hypre_F90_PassComm (comm), - hypre_F90_PassObjRef (HYPRE_StructSolver, solver) ) ); + ( HYPRE_StructJacobiCreate( + hypre_F90_PassComm (comm), + hypre_F90_PassObjRef (HYPRE_StructSolver, solver) ) ); } /*-------------------------------------------------------------------------- * HYPRE_StructJacobiDestroy *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_structjacobidestroy, HYPRE_STRUCTJACOBIDESTROY) - ( hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructJacobiDestroy( - hypre_F90_PassObj (HYPRE_StructSolver, solver) ) ); + ( HYPRE_StructJacobiDestroy( + hypre_F90_PassObj (HYPRE_StructSolver, solver) ) ); } /*-------------------------------------------------------------------------- * HYPRE_StructJacobiSetup *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_structjacobisetup, HYPRE_STRUCTJACOBISETUP) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructJacobiSetup( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassObj (HYPRE_StructMatrix, A), - hypre_F90_PassObj (HYPRE_StructVector, b), - hypre_F90_PassObj (HYPRE_StructVector, x) ) ); + ( HYPRE_StructJacobiSetup( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassObj (HYPRE_StructMatrix, A), + hypre_F90_PassObj (HYPRE_StructVector, b), + hypre_F90_PassObj (HYPRE_StructVector, x) ) ); } /*-------------------------------------------------------------------------- * HYPRE_StructJacobiSolve *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_structjacobisolve, HYPRE_STRUCTJACOBISOLVE) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructJacobiSolve( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassObj (HYPRE_StructMatrix, A), - hypre_F90_PassObj (HYPRE_StructVector, b), - hypre_F90_PassObj (HYPRE_StructVector, x) ) ); + ( HYPRE_StructJacobiSolve( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassObj (HYPRE_StructMatrix, A), + hypre_F90_PassObj (HYPRE_StructVector, b), + hypre_F90_PassObj (HYPRE_StructVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -88,14 +88,14 @@ hypre_F90_IFACE(hypre_structjacobisolve, HYPRE_STRUCTJACOBISOLVE) void hypre_F90_IFACE(hypre_structjacobisettol, HYPRE_STRUCTJACOBISETTOL) - ( hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructJacobiSetTol( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassReal (tol) ) ); + ( HYPRE_StructJacobiSetTol( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassReal (tol) ) ); } /*-------------------------------------------------------------------------- @@ -104,14 +104,14 @@ hypre_F90_IFACE(hypre_structjacobisettol, HYPRE_STRUCTJACOBISETTOL) void hypre_F90_IFACE(hypre_structjacobigettol, HYPRE_STRUCTJACOBIGETTOL) - ( hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructJacobiGetTol( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassRealRef (tol) ) ); + ( HYPRE_StructJacobiGetTol( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassRealRef (tol) ) ); } /*-------------------------------------------------------------------------- @@ -120,14 +120,14 @@ hypre_F90_IFACE(hypre_structjacobigettol, HYPRE_STRUCTJACOBIGETTOL) void hypre_F90_IFACE(hypre_structjacobisetmaxiter, HYPRE_STRUCTJACOBISETMAXITER) - ( hypre_F90_Obj *solver, - hypre_F90_Int *max_iter, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *max_iter, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructJacobiSetMaxIter( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (max_iter) ) ); + ( HYPRE_StructJacobiSetMaxIter( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (max_iter) ) ); } /*-------------------------------------------------------------------------- @@ -136,14 +136,14 @@ hypre_F90_IFACE(hypre_structjacobisetmaxiter, HYPRE_STRUCTJACOBISETMAXITER) void hypre_F90_IFACE(hypre_structjacobigetmaxiter, HYPRE_STRUCTJACOBIGETMAXITER) - ( hypre_F90_Obj *solver, - hypre_F90_Int *max_iter, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *max_iter, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructJacobiGetMaxIter( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassIntRef (max_iter) ) ); + ( HYPRE_StructJacobiGetMaxIter( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassIntRef (max_iter) ) ); } /*-------------------------------------------------------------------------- @@ -152,12 +152,12 @@ hypre_F90_IFACE(hypre_structjacobigetmaxiter, HYPRE_STRUCTJACOBIGETMAXITER) void hypre_F90_IFACE(hypre_structjacobisetzeroguess, HYPRE_STRUCTJACOBISETZEROGUESS) - ( hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructJacobiSetZeroGuess( - hypre_F90_PassObj (HYPRE_StructSolver, solver) ) ); + ( HYPRE_StructJacobiSetZeroGuess( + hypre_F90_PassObj (HYPRE_StructSolver, solver) ) ); } /*-------------------------------------------------------------------------- @@ -166,14 +166,14 @@ hypre_F90_IFACE(hypre_structjacobisetzeroguess, HYPRE_STRUCTJACOBISETZEROGUESS) void hypre_F90_IFACE(hypre_structjacobigetzeroguess, HYPRE_STRUCTJACOBIGETZEROGUESS) - ( hypre_F90_Obj *solver, - hypre_F90_Int *zeroguess, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *zeroguess, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructJacobiGetZeroGuess( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassIntRef (zeroguess) ) ); + ( HYPRE_StructJacobiGetZeroGuess( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassIntRef (zeroguess) ) ); } /*-------------------------------------------------------------------------- @@ -182,12 +182,12 @@ hypre_F90_IFACE(hypre_structjacobigetzeroguess, HYPRE_STRUCTJACOBIGETZEROGUESS) void hypre_F90_IFACE(hypre_structjacobisetnonzerogue, HYPRE_STRUCTJACOBISETNONZEROGUE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructJacobiSetNonZeroGuess( - hypre_F90_PassObj (HYPRE_StructSolver, solver) ) ); + ( HYPRE_StructJacobiSetNonZeroGuess( + hypre_F90_PassObj (HYPRE_StructSolver, solver) ) ); } /*-------------------------------------------------------------------------- @@ -196,14 +196,14 @@ hypre_F90_IFACE(hypre_structjacobisetnonzerogue, HYPRE_STRUCTJACOBISETNONZEROGUE void hypre_F90_IFACE(hypre_structjacobigetnumiterati, HYPRE_STRUCTJACOBIGETNUMITERATI) - ( hypre_F90_Obj *solver, - hypre_F90_Int *num_iterations, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *num_iterations, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructJacobiGetNumIterations( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassIntRef (num_iterations) ) ); + ( HYPRE_StructJacobiGetNumIterations( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassIntRef (num_iterations) ) ); } /*-------------------------------------------------------------------------- @@ -212,16 +212,16 @@ hypre_F90_IFACE(hypre_structjacobigetnumiterati, HYPRE_STRUCTJACOBIGETNUMITERATI void hypre_F90_IFACE(hypre_structjacobigetfinalrelat, HYPRE_STRUCTJACOBIGETFINALRELAT) - ( hypre_F90_Obj *solver, - hypre_F90_Real *norm, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *norm, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructJacobiGetFinalRelativeResidualNorm( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassRealRef (norm) ) ); + ( HYPRE_StructJacobiGetFinalRelativeResidualNorm( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassRealRef (norm) ) ); } - + #ifdef __cplusplus } #endif diff --git a/external/hypre/src/struct_ls/F90_HYPRE_struct_lgmres.c b/external/hypre/src/struct_ls/F90_HYPRE_struct_lgmres.c index f8d566a0..a4ff2113 100644 --- a/external/hypre/src/struct_ls/F90_HYPRE_struct_lgmres.c +++ b/external/hypre/src/struct_ls/F90_HYPRE_struct_lgmres.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,14 +17,14 @@ extern "C" { void hypre_F90_IFACE(hypre_structlgmrescreate, HYPRE_STRUCTLGMRESCREATE) - ( hypre_F90_Comm *comm, - hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Comm *comm, + hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructLGMRESCreate( - hypre_F90_PassComm (comm), - hypre_F90_PassObjRef (HYPRE_StructSolver, solver) ) ); + ( HYPRE_StructLGMRESCreate( + hypre_F90_PassComm (comm), + hypre_F90_PassObjRef (HYPRE_StructSolver, solver) ) ); } /*-------------------------------------------------------------------------- @@ -32,12 +32,12 @@ hypre_F90_IFACE(hypre_structlgmrescreate, HYPRE_STRUCTLGMRESCREATE) void hypre_F90_IFACE(hypre_structlgmresdestroy, HYPRE_STRUCTLGMRESDESTROY) - ( hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructLGMRESDestroy( - hypre_F90_PassObj (HYPRE_StructSolver, solver) ) ); + ( HYPRE_StructLGMRESDestroy( + hypre_F90_PassObj (HYPRE_StructSolver, solver) ) ); } /*-------------------------------------------------------------------------- @@ -45,18 +45,18 @@ hypre_F90_IFACE(hypre_structlgmresdestroy, HYPRE_STRUCTLGMRESDESTROY) void hypre_F90_IFACE(hypre_structlgmressetup, HYPRE_STRUCTLGMRESSETUP) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructLGMRESSetup( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassObj (HYPRE_StructMatrix, A), - hypre_F90_PassObj (HYPRE_StructVector, b), - hypre_F90_PassObj (HYPRE_StructVector, x) ) ); + ( HYPRE_StructLGMRESSetup( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassObj (HYPRE_StructMatrix, A), + hypre_F90_PassObj (HYPRE_StructVector, b), + hypre_F90_PassObj (HYPRE_StructVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -64,18 +64,18 @@ hypre_F90_IFACE(hypre_structlgmressetup, HYPRE_STRUCTLGMRESSETUP) void hypre_F90_IFACE(hypre_structlgmressolve, HYPRE_STRUCTLGMRESSOLVE) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructLGMRESSolve( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassObj (HYPRE_StructMatrix, A), - hypre_F90_PassObj (HYPRE_StructVector, b), - hypre_F90_PassObj (HYPRE_StructVector, x) ) ); + ( HYPRE_StructLGMRESSolve( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassObj (HYPRE_StructMatrix, A), + hypre_F90_PassObj (HYPRE_StructVector, b), + hypre_F90_PassObj (HYPRE_StructVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -83,14 +83,14 @@ hypre_F90_IFACE(hypre_structlgmressolve, HYPRE_STRUCTLGMRESSOLVE) void hypre_F90_IFACE(hypre_structlgmressettol, HYPRE_STRUCTLGMRESSETTOL) - ( hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructLGMRESSetTol( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassReal (tol) ) ); + ( HYPRE_StructLGMRESSetTol( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassReal (tol) ) ); } /*-------------------------------------------------------------------------- @@ -98,14 +98,14 @@ hypre_F90_IFACE(hypre_structlgmressettol, HYPRE_STRUCTLGMRESSETTOL) void hypre_F90_IFACE(hypre_structlgmressetabstol, HYPRE_STRUCTLGMRESSETABSTOL) - ( hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructLGMRESSetAbsoluteTol( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassReal (tol) ) ); + ( HYPRE_StructLGMRESSetAbsoluteTol( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassReal (tol) ) ); } /*-------------------------------------------------------------------------- @@ -113,14 +113,14 @@ hypre_F90_IFACE(hypre_structlgmressetabstol, HYPRE_STRUCTLGMRESSETABSTOL) void hypre_F90_IFACE(hypre_structlgmressetmaxiter, HYPRE_STRUCTLGMRESSETMAXITER) - ( hypre_F90_Obj *solver, - hypre_F90_Int *max_iter, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *max_iter, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructLGMRESSetMaxIter( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (max_iter) ) ); + ( HYPRE_StructLGMRESSetMaxIter( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (max_iter) ) ); } /*-------------------------------------------------------------------------- @@ -128,14 +128,14 @@ hypre_F90_IFACE(hypre_structlgmressetmaxiter, HYPRE_STRUCTLGMRESSETMAXITER) void hypre_F90_IFACE(hypre_structlgmressetkdim, HYPRE_STRUCTLGMRESSETKDIM) - (hypre_F90_Obj *solver, - hypre_F90_Int *k_dim, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *k_dim, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_StructLGMRESSetKDim( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (k_dim) )); + (HYPRE_StructLGMRESSetKDim( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (k_dim) )); } /*-------------------------------------------------------------------------- @@ -143,14 +143,14 @@ hypre_F90_IFACE(hypre_structlgmressetkdim, HYPRE_STRUCTLGMRESSETKDIM) void hypre_F90_IFACE(hypre_structlgmressetaugdim, HYPRE_STRUCTLGMRESSETAUGDIM) - (hypre_F90_Obj *solver, - hypre_F90_Int *aug_dim, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Int *aug_dim, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_StructLGMRESSetAugDim( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (aug_dim) )); + (HYPRE_StructLGMRESSetAugDim( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (aug_dim) )); } /*-------------------------------------------------------------------------- @@ -158,10 +158,10 @@ hypre_F90_IFACE(hypre_structlgmressetaugdim, HYPRE_STRUCTLGMRESSETAUGDIM) void hypre_F90_IFACE(hypre_structlgmressetprecond, HYPRE_STRUCTLGMRESSETPRECOND) - ( hypre_F90_Obj *solver, - hypre_F90_Int *precond_id, - hypre_F90_Obj *precond_solver, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *precond_id, + hypre_F90_Obj *precond_solver, + hypre_F90_Int *ierr ) { /*------------------------------------------------------------ @@ -176,38 +176,38 @@ hypre_F90_IFACE(hypre_structlgmressetprecond, HYPRE_STRUCTLGMRESSETPRECOND) if (*precond_id == 0) { *ierr = (hypre_F90_Int) - ( HYPRE_StructLGMRESSetPrecond( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - HYPRE_StructSMGSolve, - HYPRE_StructSMGSetup, - hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); + ( HYPRE_StructLGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + HYPRE_StructSMGSolve, + HYPRE_StructSMGSetup, + hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); } else if (*precond_id == 1) { *ierr = (hypre_F90_Int) - ( HYPRE_StructLGMRESSetPrecond( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - HYPRE_StructPFMGSolve, - HYPRE_StructPFMGSetup, - hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); + ( HYPRE_StructLGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + HYPRE_StructPFMGSolve, + HYPRE_StructPFMGSetup, + hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); } else if (*precond_id == 6) { *ierr = (hypre_F90_Int) - ( HYPRE_StructLGMRESSetPrecond( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - HYPRE_StructJacobiSolve, - HYPRE_StructJacobiSetup, - hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); + ( HYPRE_StructLGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + HYPRE_StructJacobiSolve, + HYPRE_StructJacobiSetup, + hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); } else if (*precond_id == 8) { *ierr = (hypre_F90_Int) - ( HYPRE_StructLGMRESSetPrecond( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - HYPRE_StructDiagScale, - HYPRE_StructDiagScaleSetup, - hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); + ( HYPRE_StructLGMRESSetPrecond( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + HYPRE_StructDiagScale, + HYPRE_StructDiagScaleSetup, + hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); } else if (*precond_id == 9) { @@ -224,14 +224,14 @@ hypre_F90_IFACE(hypre_structlgmressetprecond, HYPRE_STRUCTLGMRESSETPRECOND) void hypre_F90_IFACE(hypre_structlgmressetlogging, HYPRE_STRUCTLGMRESSETLOGGING) - ( hypre_F90_Obj *solver, - hypre_F90_Int *logging, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *logging, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructLGMRESSetLogging( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (logging) ) ); + ( HYPRE_StructLGMRESSetLogging( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (logging) ) ); } /*-------------------------------------------------------------------------- @@ -239,14 +239,14 @@ hypre_F90_IFACE(hypre_structlgmressetlogging, HYPRE_STRUCTLGMRESSETLOGGING) void hypre_F90_IFACE(hypre_structlgmressetprintlevel, HYPRE_STRUCTLGMRESSETPRINTLEVEL) - ( hypre_F90_Obj *solver, - hypre_F90_Int *print_level, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *print_level, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructLGMRESSetPrintLevel( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (print_level) ) ); + ( HYPRE_StructLGMRESSetPrintLevel( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (print_level) ) ); } /*-------------------------------------------------------------------------- @@ -254,14 +254,14 @@ hypre_F90_IFACE(hypre_structlgmressetprintlevel, HYPRE_STRUCTLGMRESSETPRINTLEVEL void hypre_F90_IFACE(hypre_structlgmresgetnumiter, HYPRE_STRUCTLGMRESGETNUMITER) - ( hypre_F90_Obj *solver, - hypre_F90_Int *num_iterations, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *num_iterations, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructLGMRESGetNumIterations( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassIntRef (num_iterations) ) ); + ( HYPRE_StructLGMRESGetNumIterations( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassIntRef (num_iterations) ) ); } /*-------------------------------------------------------------------------- @@ -269,14 +269,14 @@ hypre_F90_IFACE(hypre_structlgmresgetnumiter, HYPRE_STRUCTLGMRESGETNUMITER) void hypre_F90_IFACE(hypre_structlgmresgetfinalrel, HYPRE_STRUCTLGMRESGETFINALREL) - ( hypre_F90_Obj *solver, - hypre_F90_Real *norm, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *norm, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructLGMRESGetFinalRelativeResidualNorm( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassRealRef (norm) ) ); + ( HYPRE_StructLGMRESGetFinalRelativeResidualNorm( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassRealRef (norm) ) ); } #ifdef __cplusplus diff --git a/external/hypre/src/struct_ls/F90_HYPRE_struct_pcg.c b/external/hypre/src/struct_ls/F90_HYPRE_struct_pcg.c index 03850031..33af5a63 100644 --- a/external/hypre/src/struct_ls/F90_HYPRE_struct_pcg.c +++ b/external/hypre/src/struct_ls/F90_HYPRE_struct_pcg.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,14 +17,14 @@ extern "C" { void hypre_F90_IFACE(hypre_structpcgcreate, HYPRE_STRUCTPCGCREATE) - ( hypre_F90_Comm *comm, - hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Comm *comm, + hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPCGCreate( - hypre_F90_PassComm (comm), - hypre_F90_PassObjRef (HYPRE_StructSolver, solver) ) ); + ( HYPRE_StructPCGCreate( + hypre_F90_PassComm (comm), + hypre_F90_PassObjRef (HYPRE_StructSolver, solver) ) ); } /*-------------------------------------------------------------------------- @@ -32,12 +32,12 @@ hypre_F90_IFACE(hypre_structpcgcreate, HYPRE_STRUCTPCGCREATE) void hypre_F90_IFACE(hypre_structpcgdestroy, HYPRE_STRUCTPCGDESTROY) - ( hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPCGDestroy( - hypre_F90_PassObj (HYPRE_StructSolver, solver) ) ); + ( HYPRE_StructPCGDestroy( + hypre_F90_PassObj (HYPRE_StructSolver, solver) ) ); } /*-------------------------------------------------------------------------- @@ -45,18 +45,18 @@ hypre_F90_IFACE(hypre_structpcgdestroy, HYPRE_STRUCTPCGDESTROY) void hypre_F90_IFACE(hypre_structpcgsetup, HYPRE_STRUCTPCGSETUP) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPCGSetup( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassObj (HYPRE_StructMatrix, A), - hypre_F90_PassObj (HYPRE_StructVector, b), - hypre_F90_PassObj (HYPRE_StructVector, x) ) ); + ( HYPRE_StructPCGSetup( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassObj (HYPRE_StructMatrix, A), + hypre_F90_PassObj (HYPRE_StructVector, b), + hypre_F90_PassObj (HYPRE_StructVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -64,18 +64,18 @@ hypre_F90_IFACE(hypre_structpcgsetup, HYPRE_STRUCTPCGSETUP) void hypre_F90_IFACE(hypre_structpcgsolve, HYPRE_STRUCTPCGSOLVE) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPCGSolve( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassObj (HYPRE_StructMatrix, A), - hypre_F90_PassObj (HYPRE_StructVector, b), - hypre_F90_PassObj (HYPRE_StructVector, x) ) ); + ( HYPRE_StructPCGSolve( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassObj (HYPRE_StructMatrix, A), + hypre_F90_PassObj (HYPRE_StructVector, b), + hypre_F90_PassObj (HYPRE_StructVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -83,14 +83,14 @@ hypre_F90_IFACE(hypre_structpcgsolve, HYPRE_STRUCTPCGSOLVE) void hypre_F90_IFACE(hypre_structpcgsettol, HYPRE_STRUCTPCGSETTOL) - ( hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPCGSetTol( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassReal (tol) ) ); + ( HYPRE_StructPCGSetTol( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassReal (tol) ) ); } /*-------------------------------------------------------------------------- @@ -98,14 +98,14 @@ hypre_F90_IFACE(hypre_structpcgsettol, HYPRE_STRUCTPCGSETTOL) void hypre_F90_IFACE(hypre_structpcgsetabstol, HYPRE_STRUCTPCGSETABSTOL) - ( hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPCGSetAbsoluteTol( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassReal (tol) ) ); + ( HYPRE_StructPCGSetAbsoluteTol( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassReal (tol) ) ); } /*-------------------------------------------------------------------------- @@ -113,14 +113,14 @@ hypre_F90_IFACE(hypre_structpcgsetabstol, HYPRE_STRUCTPCGSETABSTOL) void hypre_F90_IFACE(hypre_structpcgsetmaxiter, HYPRE_STRUCTPCGSETMAXITER) - ( hypre_F90_Obj *solver, - hypre_F90_Int *max_iter, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *max_iter, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPCGSetMaxIter( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (max_iter) ) ); + ( HYPRE_StructPCGSetMaxIter( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (max_iter) ) ); } /*-------------------------------------------------------------------------- @@ -128,14 +128,14 @@ hypre_F90_IFACE(hypre_structpcgsetmaxiter, HYPRE_STRUCTPCGSETMAXITER) void hypre_F90_IFACE(hypre_structpcgsettwonorm, HYPRE_STRUCTPCGSETTWONORM) - ( hypre_F90_Obj *solver, - hypre_F90_Int *two_norm, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *two_norm, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPCGSetTwoNorm( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (two_norm) ) ); + ( HYPRE_StructPCGSetTwoNorm( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (two_norm) ) ); } /*-------------------------------------------------------------------------- @@ -143,14 +143,14 @@ hypre_F90_IFACE(hypre_structpcgsettwonorm, HYPRE_STRUCTPCGSETTWONORM) void hypre_F90_IFACE(hypre_structpcgsetrelchange, HYPRE_STRUCTPCGSETRELCHANGE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *rel_change, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *rel_change, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPCGSetRelChange( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (rel_change) ) ); + ( HYPRE_StructPCGSetRelChange( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (rel_change) ) ); } /*-------------------------------------------------------------------------- @@ -158,10 +158,10 @@ hypre_F90_IFACE(hypre_structpcgsetrelchange, HYPRE_STRUCTPCGSETRELCHANGE) void hypre_F90_IFACE(hypre_structpcgsetprecond, HYPRE_STRUCTPCGSETPRECOND) - ( hypre_F90_Obj *solver, - hypre_F90_Int *precond_id, - hypre_F90_Obj *precond_solver, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *precond_id, + hypre_F90_Obj *precond_solver, + hypre_F90_Int *ierr ) { /*------------------------------------------------------------ @@ -176,38 +176,38 @@ hypre_F90_IFACE(hypre_structpcgsetprecond, HYPRE_STRUCTPCGSETPRECOND) if (*precond_id == 0) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPCGSetPrecond( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - HYPRE_StructSMGSolve, - HYPRE_StructSMGSetup, - hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); + ( HYPRE_StructPCGSetPrecond( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + HYPRE_StructSMGSolve, + HYPRE_StructSMGSetup, + hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); } else if (*precond_id == 1) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPCGSetPrecond( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - HYPRE_StructPFMGSolve, - HYPRE_StructPFMGSetup, - hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); + ( HYPRE_StructPCGSetPrecond( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + HYPRE_StructPFMGSolve, + HYPRE_StructPFMGSetup, + hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); } else if (*precond_id == 7) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPCGSetPrecond( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - HYPRE_StructJacobiSolve, - HYPRE_StructJacobiSetup, - hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); + ( HYPRE_StructPCGSetPrecond( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + HYPRE_StructJacobiSolve, + HYPRE_StructJacobiSetup, + hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); } else if (*precond_id == 8) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPCGSetPrecond( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - HYPRE_StructDiagScale, - HYPRE_StructDiagScaleSetup, - hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); + ( HYPRE_StructPCGSetPrecond( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + HYPRE_StructDiagScale, + HYPRE_StructDiagScaleSetup, + hypre_F90_PassObj (HYPRE_StructSolver, precond_solver)) ); } else if (*precond_id == 9) { @@ -224,14 +224,14 @@ hypre_F90_IFACE(hypre_structpcgsetprecond, HYPRE_STRUCTPCGSETPRECOND) void hypre_F90_IFACE(hypre_structpcgsetlogging, HYPRE_STRUCTPCGSETLOGGING) - ( hypre_F90_Obj *solver, - hypre_F90_Int *logging, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *logging, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPCGSetLogging( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (logging) ) ); + ( HYPRE_StructPCGSetLogging( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (logging) ) ); } /*-------------------------------------------------------------------------- @@ -239,14 +239,14 @@ hypre_F90_IFACE(hypre_structpcgsetlogging, HYPRE_STRUCTPCGSETLOGGING) void hypre_F90_IFACE(hypre_structpcgsetprintlevel, HYPRE_STRUCTPCGSETPRINTLEVEL) - ( hypre_F90_Obj *solver, - hypre_F90_Int *print_level, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *print_level, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPCGSetPrintLevel( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (print_level) ) ); + ( HYPRE_StructPCGSetPrintLevel( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (print_level) ) ); } /*-------------------------------------------------------------------------- @@ -254,14 +254,14 @@ hypre_F90_IFACE(hypre_structpcgsetprintlevel, HYPRE_STRUCTPCGSETPRINTLEVEL) void hypre_F90_IFACE(hypre_structpcggetnumiterations, HYPRE_STRUCTPCGGETNUMITERATIONS) - ( hypre_F90_Obj *solver, - hypre_F90_Int *num_iterations, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *num_iterations, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPCGGetNumIterations( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassIntRef (num_iterations) ) ); + ( HYPRE_StructPCGGetNumIterations( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassIntRef (num_iterations) ) ); } /*-------------------------------------------------------------------------- @@ -269,14 +269,14 @@ hypre_F90_IFACE(hypre_structpcggetnumiterations, HYPRE_STRUCTPCGGETNUMITERATIONS void hypre_F90_IFACE(hypre_structpcggetfinalrelative, HYPRE_STRUCTPCGGETFINALRELATIVE) - ( hypre_F90_Obj *solver, - hypre_F90_Real *norm, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *norm, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPCGGetFinalRelativeResidualNorm( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassRealRef (norm) ) ); + ( HYPRE_StructPCGGetFinalRelativeResidualNorm( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassRealRef (norm) ) ); } /*-------------------------------------------------------------------------- @@ -284,18 +284,18 @@ hypre_F90_IFACE(hypre_structpcggetfinalrelative, HYPRE_STRUCTPCGGETFINALRELATIVE void hypre_F90_IFACE(hypre_structdiagscalesetup, HYPRE_STRUCTDIAGSCALESETUP) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *y, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *y, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructDiagScaleSetup( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassObj (HYPRE_StructMatrix, A), - hypre_F90_PassObj (HYPRE_StructVector, y), - hypre_F90_PassObj (HYPRE_StructVector, x) ) ); + ( HYPRE_StructDiagScaleSetup( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassObj (HYPRE_StructMatrix, A), + hypre_F90_PassObj (HYPRE_StructVector, y), + hypre_F90_PassObj (HYPRE_StructVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -303,18 +303,18 @@ hypre_F90_IFACE(hypre_structdiagscalesetup, HYPRE_STRUCTDIAGSCALESETUP) void hypre_F90_IFACE(hypre_structdiagscale, HYPRE_STRUCTDIAGSCALE) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *HA, - hypre_F90_Obj *Hy, - hypre_F90_Obj *Hx, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *HA, + hypre_F90_Obj *Hy, + hypre_F90_Obj *Hx, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructDiagScale( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassObj (HYPRE_StructMatrix, HA), - hypre_F90_PassObj (HYPRE_StructVector, Hy), - hypre_F90_PassObj (HYPRE_StructVector, Hx) ) ); + ( HYPRE_StructDiagScale( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassObj (HYPRE_StructMatrix, HA), + hypre_F90_PassObj (HYPRE_StructVector, Hy), + hypre_F90_PassObj (HYPRE_StructVector, Hx) ) ); } #ifdef __cplusplus diff --git a/external/hypre/src/struct_ls/F90_HYPRE_struct_pfmg.c b/external/hypre/src/struct_ls/F90_HYPRE_struct_pfmg.c index 26f4feec..3e52142e 100644 --- a/external/hypre/src/struct_ls/F90_HYPRE_struct_pfmg.c +++ b/external/hypre/src/struct_ls/F90_HYPRE_struct_pfmg.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -11,75 +11,75 @@ #ifdef __cplusplus extern "C" { #endif - + /*-------------------------------------------------------------------------- * HYPRE_StructPFMGCreate *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_structpfmgcreate, HYPRE_STRUCTPFMGCREATE) - ( hypre_F90_Comm *comm, - hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Comm *comm, + hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPFMGCreate( - hypre_F90_PassComm (comm), - hypre_F90_PassObjRef (HYPRE_StructSolver, solver) ) ); + ( HYPRE_StructPFMGCreate( + hypre_F90_PassComm (comm), + hypre_F90_PassObjRef (HYPRE_StructSolver, solver) ) ); } /*-------------------------------------------------------------------------- * HYPRE_StructPFMGDestroy *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_structpfmgdestroy, HYPRE_STRUCTPFMGDESTROY) - ( hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPFMGDestroy( - hypre_F90_PassObj (HYPRE_StructSolver, solver) ) ); + ( HYPRE_StructPFMGDestroy( + hypre_F90_PassObj (HYPRE_StructSolver, solver) ) ); } /*-------------------------------------------------------------------------- * HYPRE_StructPFMGSetup *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_structpfmgsetup, HYPRE_STRUCTPFMGSETUP) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPFMGSetup( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassObj (HYPRE_StructMatrix, A), - hypre_F90_PassObj (HYPRE_StructVector, b), - hypre_F90_PassObj (HYPRE_StructVector, x) ) ); + ( HYPRE_StructPFMGSetup( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassObj (HYPRE_StructMatrix, A), + hypre_F90_PassObj (HYPRE_StructVector, b), + hypre_F90_PassObj (HYPRE_StructVector, x) ) ); } /*-------------------------------------------------------------------------- * HYPRE_StructPFMGSolve *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_structpfmgsolve, HYPRE_STRUCTPFMGSOLVE) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPFMGSolve( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassObj (HYPRE_StructMatrix, A), - hypre_F90_PassObj (HYPRE_StructVector, b), - hypre_F90_PassObj (HYPRE_StructVector, x) ) ); + ( HYPRE_StructPFMGSolve( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassObj (HYPRE_StructMatrix, A), + hypre_F90_PassObj (HYPRE_StructVector, b), + hypre_F90_PassObj (HYPRE_StructVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -88,26 +88,26 @@ hypre_F90_IFACE(hypre_structpfmgsolve, HYPRE_STRUCTPFMGSOLVE) void hypre_F90_IFACE(hypre_structpfmgsettol, HYPRE_STRUCTPFMGSETTOL) - ( hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPFMGSetTol( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassReal (tol) ) ); + ( HYPRE_StructPFMGSetTol( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassReal (tol) ) ); } void hypre_F90_IFACE(hypre_structpfmggettol, HYPRE_STRUCTPFMGGETTOL) - ( hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPFMGGetTol( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassRealRef (tol) ) ); + ( HYPRE_StructPFMGGetTol( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassRealRef (tol) ) ); } /*-------------------------------------------------------------------------- @@ -116,26 +116,26 @@ hypre_F90_IFACE(hypre_structpfmggettol, HYPRE_STRUCTPFMGGETTOL) void hypre_F90_IFACE(hypre_structpfmgsetmaxiter, HYPRE_STRUCTPFMGSETMAXITER) - ( hypre_F90_Obj *solver, - hypre_F90_Int *max_iter, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *max_iter, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPFMGSetMaxIter( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (max_iter) ) ); + ( HYPRE_StructPFMGSetMaxIter( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (max_iter) ) ); } void hypre_F90_IFACE(hypre_structpfmggetmaxiter, HYPRE_STRUCTPFMGGETMAXITER) - ( hypre_F90_Obj *solver, - hypre_F90_Int *max_iter, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *max_iter, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPFMGGetMaxIter( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassIntRef (max_iter) ) ); + ( HYPRE_StructPFMGGetMaxIter( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassIntRef (max_iter) ) ); } /*-------------------------------------------------------------------------- @@ -144,26 +144,26 @@ hypre_F90_IFACE(hypre_structpfmggetmaxiter, HYPRE_STRUCTPFMGGETMAXITER) void hypre_F90_IFACE(hypre_structpfmgsetmaxlevels, HYPRE_STRUCTPFMGSETMAXLEVELS) - ( hypre_F90_Obj *solver, - hypre_F90_Int *max_levels, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *max_levels, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPFMGSetMaxLevels( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (max_levels) ) ); + ( HYPRE_StructPFMGSetMaxLevels( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (max_levels) ) ); } void hypre_F90_IFACE(hypre_structpfmggetmaxlevels, HYPRE_STRUCTPFMGGETMAXLEVELS) - ( hypre_F90_Obj *solver, - hypre_F90_Int *max_levels, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *max_levels, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPFMGGetMaxLevels( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassIntRef (max_levels) ) ); + ( HYPRE_StructPFMGGetMaxLevels( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassIntRef (max_levels) ) ); } /*-------------------------------------------------------------------------- @@ -172,66 +172,66 @@ hypre_F90_IFACE(hypre_structpfmggetmaxlevels, HYPRE_STRUCTPFMGGETMAXLEVELS) void hypre_F90_IFACE(hypre_structpfmgsetrelchange, HYPRE_STRUCTPFMGSETRELCHANGE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *rel_change, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *rel_change, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPFMGSetRelChange( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (rel_change) ) ); + ( HYPRE_StructPFMGSetRelChange( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (rel_change) ) ); } void hypre_F90_IFACE(hypre_structpfmggetrelchange, HYPRE_STRUCTPFMGGETRELCHANGE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *rel_change, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *rel_change, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPFMGGetRelChange( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassIntRef (rel_change) ) ); + ( HYPRE_StructPFMGGetRelChange( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassIntRef (rel_change) ) ); } /*-------------------------------------------------------------------------- * HYPRE_StructPFMGSetZeroGuess, HYPRE_StructPFMGGetZeroGuess *--------------------------------------------------------------------------*/ - + void hypre_F90_IFACE(hypre_structpfmgsetzeroguess, HYPRE_STRUCTPFMGSETZEROGUESS) - ( hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPFMGSetZeroGuess( - hypre_F90_PassObj (HYPRE_StructSolver, solver) ) ); + ( HYPRE_StructPFMGSetZeroGuess( + hypre_F90_PassObj (HYPRE_StructSolver, solver) ) ); } - + void hypre_F90_IFACE(hypre_structpfmggetzeroguess, HYPRE_STRUCTPFMGGETZEROGUESS) - ( hypre_F90_Obj *solver, - hypre_F90_Int *zeroguess, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *zeroguess, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPFMGGetZeroGuess( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassIntRef (zeroguess) ) ); + ( HYPRE_StructPFMGGetZeroGuess( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassIntRef (zeroguess) ) ); } /*-------------------------------------------------------------------------- * HYPRE_StructPFMGSetNonZeroGuess *--------------------------------------------------------------------------*/ - + void hypre_F90_IFACE(hypre_structpfmgsetnonzeroguess, HYPRE_STRUCTPFMGSETNONZEROGUESS) - ( hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPFMGSetNonZeroGuess( - hypre_F90_PassObj (HYPRE_StructSolver, solver) ) ); + ( HYPRE_StructPFMGSetNonZeroGuess( + hypre_F90_PassObj (HYPRE_StructSolver, solver) ) ); } /*-------------------------------------------------------------------------- @@ -240,26 +240,26 @@ hypre_F90_IFACE(hypre_structpfmgsetnonzeroguess, HYPRE_STRUCTPFMGSETNONZEROGUESS void hypre_F90_IFACE(hypre_structpfmgsetrelaxtype, HYPRE_STRUCTPFMGSETRELAXTYPE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *relax_type, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *relax_type, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPFMGSetRelaxType( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (relax_type) ) ); + ( HYPRE_StructPFMGSetRelaxType( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (relax_type) ) ); } void hypre_F90_IFACE(hypre_structpfmggetrelaxtype, HYPRE_STRUCTPFMGGETRELAXTYPE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *relax_type, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *relax_type, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPFMGGetRelaxType( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassIntRef (relax_type) ) ); + ( HYPRE_StructPFMGGetRelaxType( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassIntRef (relax_type) ) ); } /*-------------------------------------------------------------------------- @@ -267,14 +267,14 @@ hypre_F90_IFACE(hypre_structpfmggetrelaxtype, HYPRE_STRUCTPFMGGETRELAXTYPE) *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_structpfmgsetjacobiweigh, HYPRE_STRUCTPFMGSETJACOBIWEIGH) - (hypre_F90_Obj *solver, - hypre_F90_Real *weight, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Real *weight, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_StructPFMGSetJacobiWeight( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassReal (weight) ) ); + (HYPRE_StructPFMGSetJacobiWeight( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassReal (weight) ) ); } /*-------------------------------------------------------------------------- @@ -283,26 +283,26 @@ hypre_F90_IFACE(hypre_structpfmgsetjacobiweigh, HYPRE_STRUCTPFMGSETJACOBIWEIGH) void hypre_F90_IFACE(hypre_structpfmgsetraptype, HYPRE_STRUCTPFMGSETRAPTYPE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *rap_type, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *rap_type, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPFMGSetRAPType( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (rap_type) ) ); + ( HYPRE_StructPFMGSetRAPType( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (rap_type) ) ); } void hypre_F90_IFACE(hypre_structpfmggetraptype, HYPRE_STRUCTPFMGGETRAPTYPE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *rap_type, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *rap_type, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPFMGGetRAPType( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassIntRef (rap_type) ) ); + ( HYPRE_StructPFMGGetRAPType( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassIntRef (rap_type) ) ); } /*-------------------------------------------------------------------------- @@ -311,26 +311,26 @@ hypre_F90_IFACE(hypre_structpfmggetraptype, HYPRE_STRUCTPFMGGETRAPTYPE) void hypre_F90_IFACE(hypre_structpfmgsetnumprerelax, HYPRE_STRUCTPFMGSETNUMPRERELAX) - ( hypre_F90_Obj *solver, - hypre_F90_Int *num_pre_relax, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *num_pre_relax, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPFMGSetNumPreRelax( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (num_pre_relax) ) ); + ( HYPRE_StructPFMGSetNumPreRelax( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (num_pre_relax) ) ); } void hypre_F90_IFACE(hypre_structpfmggetnumprerelax, HYPRE_STRUCTPFMGGETNUMPRERELAX) - ( hypre_F90_Obj *solver, - hypre_F90_Int *num_pre_relax, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *num_pre_relax, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPFMGGetNumPreRelax( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassIntRef (num_pre_relax) ) ); + ( HYPRE_StructPFMGGetNumPreRelax( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassIntRef (num_pre_relax) ) ); } /*-------------------------------------------------------------------------- @@ -339,26 +339,26 @@ hypre_F90_IFACE(hypre_structpfmggetnumprerelax, HYPRE_STRUCTPFMGGETNUMPRERELAX) void hypre_F90_IFACE(hypre_structpfmgsetnumpostrelax, HYPRE_STRUCTPFMGSETNUMPOSTRELAX) - ( hypre_F90_Obj *solver, - hypre_F90_Int *num_post_relax, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *num_post_relax, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPFMGSetNumPostRelax( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (num_post_relax) ) ); + ( HYPRE_StructPFMGSetNumPostRelax( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (num_post_relax) ) ); } void hypre_F90_IFACE(hypre_structpfmggetnumpostrelax, HYPRE_STRUCTPFMGGETNUMPOSTRELAX) - ( hypre_F90_Obj *solver, - hypre_F90_Int *num_post_relax, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *num_post_relax, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPFMGGetNumPostRelax( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassIntRef (num_post_relax) ) ); + ( HYPRE_StructPFMGGetNumPostRelax( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassIntRef (num_post_relax) ) ); } /*-------------------------------------------------------------------------- @@ -367,26 +367,26 @@ hypre_F90_IFACE(hypre_structpfmggetnumpostrelax, HYPRE_STRUCTPFMGGETNUMPOSTRELAX void hypre_F90_IFACE(hypre_structpfmgsetskiprelax, HYPRE_STRUCTPFMGSETSKIPRELAX) - ( hypre_F90_Obj *solver, - hypre_F90_Int *skip_relax, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *skip_relax, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPFMGSetSkipRelax( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (skip_relax) ) ); + ( HYPRE_StructPFMGSetSkipRelax( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (skip_relax) ) ); } void hypre_F90_IFACE(hypre_structpfmggetskiprelax, HYPRE_STRUCTPFMGGETSKIPRELAX) - ( hypre_F90_Obj *solver, - hypre_F90_Int *skip_relax, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *skip_relax, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPFMGGetSkipRelax( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassIntRef (skip_relax) ) ); + ( HYPRE_StructPFMGGetSkipRelax( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassIntRef (skip_relax) ) ); } /*-------------------------------------------------------------------------- @@ -395,14 +395,14 @@ hypre_F90_IFACE(hypre_structpfmggetskiprelax, HYPRE_STRUCTPFMGGETSKIPRELAX) void hypre_F90_IFACE(hypre_structpfmgsetdxyz, HYPRE_STRUCTPFMGSETDXYZ) - ( hypre_F90_Obj *solver, - hypre_F90_RealArray *dxyz, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_RealArray *dxyz, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPFMGSetDxyz( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassRealArray (dxyz) ) ); + ( HYPRE_StructPFMGSetDxyz( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassRealArray (dxyz) ) ); } /*-------------------------------------------------------------------------- @@ -411,26 +411,26 @@ hypre_F90_IFACE(hypre_structpfmgsetdxyz, HYPRE_STRUCTPFMGSETDXYZ) void hypre_F90_IFACE(hypre_structpfmgsetlogging, HYPRE_STRUCTPFMGSETLOGGING) - ( hypre_F90_Obj *solver, - hypre_F90_Int *logging, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *logging, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPFMGSetLogging( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (logging) ) ); + ( HYPRE_StructPFMGSetLogging( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (logging) ) ); } void hypre_F90_IFACE(hypre_structpfmggetlogging, HYPRE_STRUCTPFMGGETLOGGING) - ( hypre_F90_Obj *solver, - hypre_F90_Int *logging, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *logging, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPFMGGetLogging( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassIntRef (logging) ) ); + ( HYPRE_StructPFMGGetLogging( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassIntRef (logging) ) ); } /*-------------------------------------------------------------------------- @@ -439,26 +439,26 @@ hypre_F90_IFACE(hypre_structpfmggetlogging, HYPRE_STRUCTPFMGGETLOGGING) void hypre_F90_IFACE(hypre_structpfmgsetprintlevel, HYPRE_STRUCTPFMGSETPRINTLEVEL) - ( hypre_F90_Obj *solver, - hypre_F90_Int *print_level, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *print_level, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPFMGSetPrintLevel( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (print_level) ) ); + ( HYPRE_StructPFMGSetPrintLevel( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (print_level) ) ); } void hypre_F90_IFACE(hypre_structpfmggetprintlevel, HYPRE_STRUCTPFMGGETPRINTLEVEL) - ( hypre_F90_Obj *solver, - hypre_F90_Int *print_level, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *print_level, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPFMGGetPrintLevel( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassIntRef (print_level) ) ); + ( HYPRE_StructPFMGGetPrintLevel( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassIntRef (print_level) ) ); } /*-------------------------------------------------------------------------- @@ -467,14 +467,14 @@ hypre_F90_IFACE(hypre_structpfmggetprintlevel, HYPRE_STRUCTPFMGGETPRINTLEVEL) void hypre_F90_IFACE(hypre_structpfmggetnumiteration, HYPRE_STRUCTPFMGGETNUMITERATION) - ( hypre_F90_Obj *solver, - hypre_F90_Int *num_iterations, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *num_iterations, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPFMGGetNumIterations( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassIntRef (num_iterations) ) ); + ( HYPRE_StructPFMGGetNumIterations( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassIntRef (num_iterations) ) ); } /*-------------------------------------------------------------------------- @@ -483,16 +483,16 @@ hypre_F90_IFACE(hypre_structpfmggetnumiteration, HYPRE_STRUCTPFMGGETNUMITERATION void hypre_F90_IFACE(hypre_structpfmggetfinalrelativ, HYPRE_STRUCTPFMGGETFINALRELATIV) - ( hypre_F90_Obj *solver, - hypre_F90_Real *norm, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *norm, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructPFMGGetFinalRelativeResidualNorm( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassRealRef (norm) ) ); + ( HYPRE_StructPFMGGetFinalRelativeResidualNorm( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassRealRef (norm) ) ); } - + #ifdef __cplusplus } #endif diff --git a/external/hypre/src/struct_ls/F90_HYPRE_struct_smg.c b/external/hypre/src/struct_ls/F90_HYPRE_struct_smg.c index 46b1b687..dc298d20 100644 --- a/external/hypre/src/struct_ls/F90_HYPRE_struct_smg.c +++ b/external/hypre/src/struct_ls/F90_HYPRE_struct_smg.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,21 +17,21 @@ #ifdef __cplusplus extern "C" { #endif - + /*-------------------------------------------------------------------------- * HYPRE_StructSMGCreate *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_structsmgcreate, HYPRE_STRUCTSMGCREATE) - ( hypre_F90_Comm *comm, - hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Comm *comm, + hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructSMGCreate( - hypre_F90_PassComm (comm), - hypre_F90_PassObjRef (HYPRE_StructSolver, solver) ) ); + ( HYPRE_StructSMGCreate( + hypre_F90_PassComm (comm), + hypre_F90_PassObjRef (HYPRE_StructSolver, solver) ) ); } /*-------------------------------------------------------------------------- @@ -40,52 +40,52 @@ hypre_F90_IFACE(hypre_structsmgcreate, HYPRE_STRUCTSMGCREATE) void hypre_F90_IFACE(hypre_structsmgdestroy, HYPRE_STRUCTSMGDESTROY) - ( hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructSMGDestroy( - hypre_F90_PassObj (HYPRE_StructSolver, solver) ) ); + ( HYPRE_StructSMGDestroy( + hypre_F90_PassObj (HYPRE_StructSolver, solver) ) ); } /*-------------------------------------------------------------------------- * HYPRE_StructSMGSetup *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_structsmgsetup, HYPRE_STRUCTSMGSETUP) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructSMGSetup( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassObj (HYPRE_StructMatrix, A), - hypre_F90_PassObj (HYPRE_StructVector, b), - hypre_F90_PassObj (HYPRE_StructVector, x) ) ); + ( HYPRE_StructSMGSetup( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassObj (HYPRE_StructMatrix, A), + hypre_F90_PassObj (HYPRE_StructVector, b), + hypre_F90_PassObj (HYPRE_StructVector, x) ) ); } /*-------------------------------------------------------------------------- * HYPRE_StructSMGSolve *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_structsmgsolve, HYPRE_STRUCTSMGSOLVE) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructSMGSolve( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassObj (HYPRE_StructMatrix, A), - hypre_F90_PassObj (HYPRE_StructVector, b), - hypre_F90_PassObj (HYPRE_StructVector, x) ) ); + ( HYPRE_StructSMGSolve( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassObj (HYPRE_StructMatrix, A), + hypre_F90_PassObj (HYPRE_StructVector, b), + hypre_F90_PassObj (HYPRE_StructVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -94,26 +94,26 @@ hypre_F90_IFACE(hypre_structsmgsolve, HYPRE_STRUCTSMGSOLVE) void hypre_F90_IFACE(hypre_structsmgsetmemoryuse, HYPRE_STRUCTSMGSETMEMORYUSE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *memory_use, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *memory_use, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructSMGSetMemoryUse( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (memory_use) ) ); + ( HYPRE_StructSMGSetMemoryUse( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (memory_use) ) ); } void hypre_F90_IFACE(hypre_structsmggetmemoryuse, HYPRE_STRUCTSMGGETMEMORYUSE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *memory_use, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *memory_use, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructSMGGetMemoryUse( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassIntRef (memory_use) ) ); + ( HYPRE_StructSMGGetMemoryUse( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassIntRef (memory_use) ) ); } /*-------------------------------------------------------------------------- @@ -122,26 +122,26 @@ hypre_F90_IFACE(hypre_structsmggetmemoryuse, HYPRE_STRUCTSMGGETMEMORYUSE) void hypre_F90_IFACE(hypre_structsmgsettol, HYPRE_STRUCTSMGSETTOL) - ( hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructSMGSetTol( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassReal (tol) ) ); + ( HYPRE_StructSMGSetTol( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassReal (tol) ) ); } void hypre_F90_IFACE(hypre_structsmggettol, HYPRE_STRUCTSMGGETTOL) - ( hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructSMGGetTol( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassRealRef (tol) ) ); + ( HYPRE_StructSMGGetTol( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassRealRef (tol) ) ); } /*-------------------------------------------------------------------------- @@ -150,26 +150,26 @@ hypre_F90_IFACE(hypre_structsmggettol, HYPRE_STRUCTSMGGETTOL) void hypre_F90_IFACE(hypre_structsmgsetmaxiter, HYPRE_STRUCTSMGSETMAXITER) - ( hypre_F90_Obj *solver, - hypre_F90_Int *max_iter, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *max_iter, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructSMGSetMaxIter( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (max_iter) ) ); + ( HYPRE_StructSMGSetMaxIter( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (max_iter) ) ); } void hypre_F90_IFACE(hypre_structsmggetmaxiter, HYPRE_STRUCTSMGGETMAXITER) - ( hypre_F90_Obj *solver, - hypre_F90_Int *max_iter, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *max_iter, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructSMGGetMaxIter( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassIntRef (max_iter) ) ); + ( HYPRE_StructSMGGetMaxIter( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassIntRef (max_iter) ) ); } /*-------------------------------------------------------------------------- @@ -178,97 +178,97 @@ hypre_F90_IFACE(hypre_structsmggetmaxiter, HYPRE_STRUCTSMGGETMAXITER) void hypre_F90_IFACE(hypre_structsmgsetrelchange, HYPRE_STRUCTSMGSETRELCHANGE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *rel_change, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *rel_change, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructSMGSetRelChange( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (rel_change) ) ); + ( HYPRE_StructSMGSetRelChange( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (rel_change) ) ); } void hypre_F90_IFACE(hypre_structsmggetrelchange, HYPRE_STRUCTSMGGETRELCHANGE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *rel_change, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *rel_change, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructSMGGetRelChange( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassIntRef (rel_change) ) ); + ( HYPRE_StructSMGGetRelChange( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassIntRef (rel_change) ) ); } /*-------------------------------------------------------------------------- * HYPRE_StructSMGSetZeroGuess, HYPRE_StructSMGGetZeroGuess *--------------------------------------------------------------------------*/ - + void hypre_F90_IFACE(hypre_structsmgsetzeroguess, HYPRE_STRUCTSMGSETZEROGUESS) - ( hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructSMGSetZeroGuess( - hypre_F90_PassObj (HYPRE_StructSolver, solver) ) ); + ( HYPRE_StructSMGSetZeroGuess( + hypre_F90_PassObj (HYPRE_StructSolver, solver) ) ); } - + void hypre_F90_IFACE(hypre_structsmggetzeroguess, HYPRE_STRUCTSMGGETZEROGUESS) - ( hypre_F90_Obj *solver, - hypre_F90_Int *zeroguess, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *zeroguess, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructSMGGetZeroGuess( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassIntRef (zeroguess) ) ); + ( HYPRE_StructSMGGetZeroGuess( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassIntRef (zeroguess) ) ); } /*-------------------------------------------------------------------------- * HYPRE_StructSMGSetNonZeroGuess *--------------------------------------------------------------------------*/ - + void hypre_F90_IFACE(hypre_structsmgsetnonzeroguess, HYPRE_STRUCTSMGSETNONZEROGUESS) - ( hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructSMGSetNonZeroGuess( - hypre_F90_PassObj (HYPRE_StructSolver, solver) ) ); + ( HYPRE_StructSMGSetNonZeroGuess( + hypre_F90_PassObj (HYPRE_StructSolver, solver) ) ); } /*-------------------------------------------------------------------------- * HYPRE_StructSMGSetNumPreRelax, HYPRE_StructSMGGetNumPreRelax * - * Note that we require at least 1 pre-relax sweep. + * Note that we require at least 1 pre-relax sweep. *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_structsmgsetnumprerelax, HYPRE_STRUCTSMGSETNUMPRERELAX) - ( hypre_F90_Obj *solver, - hypre_F90_Int *num_pre_relax, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *num_pre_relax, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructSMGSetNumPreRelax( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (num_pre_relax)) ); + ( HYPRE_StructSMGSetNumPreRelax( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (num_pre_relax)) ); } void hypre_F90_IFACE(hypre_structsmggetnumprerelax, HYPRE_STRUCTSMGGETNUMPRERELAX) - ( hypre_F90_Obj *solver, - hypre_F90_Int *num_pre_relax, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *num_pre_relax, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructSMGGetNumPreRelax( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassIntRef (num_pre_relax)) ); + ( HYPRE_StructSMGGetNumPreRelax( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassIntRef (num_pre_relax)) ); } /*-------------------------------------------------------------------------- @@ -277,26 +277,26 @@ hypre_F90_IFACE(hypre_structsmggetnumprerelax, HYPRE_STRUCTSMGGETNUMPRERELAX) void hypre_F90_IFACE(hypre_structsmgsetnumpostrelax, HYPRE_STRUCTSMGSETNUMPOSTRELAX) - ( hypre_F90_Obj *solver, - hypre_F90_Int *num_post_relax, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *num_post_relax, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructSMGSetNumPostRelax( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (num_post_relax)) ); + ( HYPRE_StructSMGSetNumPostRelax( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (num_post_relax)) ); } void hypre_F90_IFACE(hypre_structsmggetnumpostrelax, HYPRE_STRUCTSMGGETNUMPOSTRELAX) - ( hypre_F90_Obj *solver, - hypre_F90_Int *num_post_relax, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *num_post_relax, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructSMGGetNumPostRelax( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassIntRef (num_post_relax)) ); + ( HYPRE_StructSMGGetNumPostRelax( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassIntRef (num_post_relax)) ); } /*-------------------------------------------------------------------------- @@ -305,26 +305,26 @@ hypre_F90_IFACE(hypre_structsmggetnumpostrelax, HYPRE_STRUCTSMGGETNUMPOSTRELAX) void hypre_F90_IFACE(hypre_structsmgsetlogging, HYPRE_STRUCTSMGSETLOGGING) - ( hypre_F90_Obj *solver, - hypre_F90_Int *logging, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *logging, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructSMGSetLogging( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (logging)) ); + ( HYPRE_StructSMGSetLogging( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (logging)) ); } void hypre_F90_IFACE(hypre_structsmggetlogging, HYPRE_STRUCTSMGGETLOGGING) - ( hypre_F90_Obj *solver, - hypre_F90_Int *logging, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *logging, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructSMGGetLogging( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassIntRef (logging)) ); + ( HYPRE_StructSMGGetLogging( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassIntRef (logging)) ); } /*-------------------------------------------------------------------------- @@ -333,26 +333,26 @@ hypre_F90_IFACE(hypre_structsmggetlogging, HYPRE_STRUCTSMGGETLOGGING) void hypre_F90_IFACE(hypre_structsmgsetprintlevel, HYPRE_STRUCTSMGSETPRINTLEVEL) - ( hypre_F90_Obj *solver, - hypre_F90_Int *print_level, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *print_level, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructSMGSetPrintLevel( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (print_level)) ); + ( HYPRE_StructSMGSetPrintLevel( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (print_level)) ); } void hypre_F90_IFACE(hypre_structsmggetprintlevel, HYPRE_STRUCTSMGGETPRINTLEVEL) - ( hypre_F90_Obj *solver, - hypre_F90_Int *print_level, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *print_level, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructSMGGetPrintLevel( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassIntRef (print_level)) ); + ( HYPRE_StructSMGGetPrintLevel( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassIntRef (print_level)) ); } /*-------------------------------------------------------------------------- @@ -361,14 +361,14 @@ hypre_F90_IFACE(hypre_structsmggetprintlevel, HYPRE_STRUCTSMGGETPRINTLEVEL) void hypre_F90_IFACE(hypre_structsmggetnumiterations, HYPRE_STRUCTSMGGETNUMITERATIONS) - ( hypre_F90_Obj *solver, - hypre_F90_Int *num_iterations, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *num_iterations, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructSMGGetNumIterations( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassIntRef (num_iterations) ) ); + ( HYPRE_StructSMGGetNumIterations( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassIntRef (num_iterations) ) ); } /*-------------------------------------------------------------------------- @@ -377,14 +377,14 @@ hypre_F90_IFACE(hypre_structsmggetnumiterations, HYPRE_STRUCTSMGGETNUMITERATIONS void hypre_F90_IFACE(hypre_structsmggetfinalrelative, HYPRE_STRUCTSMGGETFINALRELATIVE) - ( hypre_F90_Obj *solver, - hypre_F90_Real *norm, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *norm, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructSMGGetFinalRelativeResidualNorm( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassRealRef (norm) ) ); + ( HYPRE_StructSMGGetFinalRelativeResidualNorm( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassRealRef (norm) ) ); } #ifdef __cplusplus } diff --git a/external/hypre/src/struct_ls/F90_HYPRE_struct_sparse_msg.c b/external/hypre/src/struct_ls/F90_HYPRE_struct_sparse_msg.c index 3503335f..77542a99 100644 --- a/external/hypre/src/struct_ls/F90_HYPRE_struct_sparse_msg.c +++ b/external/hypre/src/struct_ls/F90_HYPRE_struct_sparse_msg.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -11,75 +11,75 @@ #ifdef __cplusplus extern "C" { #endif - + /*-------------------------------------------------------------------------- * HYPRE_StructSparseMSGCreate *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_structsparsemsgcreate, HYPRE_STRUCTSPARSEMSGCREATE) - ( hypre_F90_Comm *comm, - hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Comm *comm, + hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructSparseMSGCreate( - hypre_F90_PassComm (comm), - hypre_F90_PassObjRef (HYPRE_StructSolver, solver) ) ); + ( HYPRE_StructSparseMSGCreate( + hypre_F90_PassComm (comm), + hypre_F90_PassObjRef (HYPRE_StructSolver, solver) ) ); } /*-------------------------------------------------------------------------- * HYPRE_StructSparseMSGDestroy *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_structsparsemsgdestroy, HYPRE_STRUCTSPARSEMSGDESTROY) - ( hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructSparseMSGDestroy( - hypre_F90_PassObj (HYPRE_StructSolver, solver) ) ); + ( HYPRE_StructSparseMSGDestroy( + hypre_F90_PassObj (HYPRE_StructSolver, solver) ) ); } /*-------------------------------------------------------------------------- * HYPRE_StructSparseMSGSetup *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_structsparsemsgsetup, HYPRE_STRUCTSPARSEMSGSETUP) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructSparseMSGSetup( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassObj (HYPRE_StructMatrix, A), - hypre_F90_PassObj (HYPRE_StructVector, b), - hypre_F90_PassObj (HYPRE_StructVector, x) ) ); + ( HYPRE_StructSparseMSGSetup( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassObj (HYPRE_StructMatrix, A), + hypre_F90_PassObj (HYPRE_StructVector, b), + hypre_F90_PassObj (HYPRE_StructVector, x) ) ); } /*-------------------------------------------------------------------------- * HYPRE_StructSparseMSGSolve *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_structsparsemsgsolve, HYPRE_STRUCTSPARSEMSGSOLVE) - ( hypre_F90_Obj *solver, - hypre_F90_Obj *A, - hypre_F90_Obj *b, - hypre_F90_Obj *x, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Obj *A, + hypre_F90_Obj *b, + hypre_F90_Obj *x, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructSparseMSGSolve( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassObj (HYPRE_StructMatrix, A), - hypre_F90_PassObj (HYPRE_StructVector, b), - hypre_F90_PassObj (HYPRE_StructVector, x) ) ); + ( HYPRE_StructSparseMSGSolve( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassObj (HYPRE_StructMatrix, A), + hypre_F90_PassObj (HYPRE_StructVector, b), + hypre_F90_PassObj (HYPRE_StructVector, x) ) ); } /*-------------------------------------------------------------------------- @@ -88,14 +88,14 @@ hypre_F90_IFACE(hypre_structsparsemsgsolve, HYPRE_STRUCTSPARSEMSGSOLVE) void hypre_F90_IFACE(hypre_structsparsemsgsettol, HYPRE_STRUCTSPARSEMSGSETTOL) - ( hypre_F90_Obj *solver, - hypre_F90_Real *tol, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructSparseMSGSetTol( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassReal (tol) ) ); + ( HYPRE_StructSparseMSGSetTol( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassReal (tol) ) ); } /*-------------------------------------------------------------------------- @@ -104,14 +104,14 @@ hypre_F90_IFACE(hypre_structsparsemsgsettol, HYPRE_STRUCTSPARSEMSGSETTOL) void hypre_F90_IFACE(hypre_structsparsemsgsetmaxiter, HYPRE_STRUCTSPARSEMSGSETMAXITER) - ( hypre_F90_Obj *solver, - hypre_F90_Int *max_iter, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *max_iter, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructSparseMSGSetMaxIter( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (max_iter) ) ); + ( HYPRE_StructSparseMSGSetMaxIter( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (max_iter) ) ); } /*-------------------------------------------------------------------------- @@ -120,14 +120,14 @@ hypre_F90_IFACE(hypre_structsparsemsgsetmaxiter, HYPRE_STRUCTSPARSEMSGSETMAXITER void hypre_F90_IFACE(hypre_structsparsemsgsetjump, HYPRE_STRUCTSPARSEMSGSETJUMP) - ( hypre_F90_Obj *solver, - hypre_F90_Int *jump, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *jump, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructSparseMSGSetJump( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (jump) ) ); + ( HYPRE_StructSparseMSGSetJump( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (jump) ) ); } /*-------------------------------------------------------------------------- @@ -136,14 +136,14 @@ hypre_F90_IFACE(hypre_structsparsemsgsetjump, HYPRE_STRUCTSPARSEMSGSETJUMP) void hypre_F90_IFACE(hypre_structsparsemsgsetrelchan, HYPRE_STRUCTSPARSEMSGSETRELCHAN) - ( hypre_F90_Obj *solver, - hypre_F90_Int *rel_change, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *rel_change, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructSparseMSGSetRelChange( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (rel_change) ) ); + ( HYPRE_StructSparseMSGSetRelChange( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (rel_change) ) ); } /*-------------------------------------------------------------------------- @@ -152,12 +152,12 @@ hypre_F90_IFACE(hypre_structsparsemsgsetrelchan, HYPRE_STRUCTSPARSEMSGSETRELCHAN void hypre_F90_IFACE(hypre_structsparsemsgsetzerogue, HYPRE_STRUCTSPARSEMSGSETZEROGUE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructSparseMSGSetZeroGuess( - hypre_F90_PassObj (HYPRE_StructSolver, solver) ) ); + ( HYPRE_StructSparseMSGSetZeroGuess( + hypre_F90_PassObj (HYPRE_StructSolver, solver) ) ); } /*-------------------------------------------------------------------------- @@ -166,12 +166,12 @@ hypre_F90_IFACE(hypre_structsparsemsgsetzerogue, HYPRE_STRUCTSPARSEMSGSETZEROGUE void hypre_F90_IFACE(hypre_structsparsemsgsetnonzero, HYPRE_STRUCTSPARSEMSGSETNONZERO) - ( hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructSparseMSGSetNonZeroGuess( - hypre_F90_PassObj (HYPRE_StructSolver, solver) ) ); + ( HYPRE_StructSparseMSGSetNonZeroGuess( + hypre_F90_PassObj (HYPRE_StructSolver, solver) ) ); } /*-------------------------------------------------------------------------- @@ -180,14 +180,14 @@ hypre_F90_IFACE(hypre_structsparsemsgsetnonzero, HYPRE_STRUCTSPARSEMSGSETNONZERO void hypre_F90_IFACE(hypre_structsparsemsgsetrelaxty, HYPRE_STRUCTSPARSEMSGSETRELAXTY) - ( hypre_F90_Obj *solver, - hypre_F90_Int *relax_type, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *relax_type, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructSparseMSGSetRelaxType( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (relax_type) ) ); + ( HYPRE_StructSparseMSGSetRelaxType( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (relax_type) ) ); } /*-------------------------------------------------------------------------- @@ -195,14 +195,14 @@ hypre_F90_IFACE(hypre_structsparsemsgsetrelaxty, HYPRE_STRUCTSPARSEMSGSETRELAXTY *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_structsparsemsgsetjacobiweigh, HYPRE_STRUCTSPARSEMSGSETJACOBIWEIGH) - (hypre_F90_Obj *solver, - hypre_F90_Real *weight, - hypre_F90_Int *ierr) +(hypre_F90_Obj *solver, + hypre_F90_Real *weight, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - (HYPRE_StructSparseMSGSetJacobiWeight( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassReal (weight) ) ); + (HYPRE_StructSparseMSGSetJacobiWeight( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassReal (weight) ) ); } /*-------------------------------------------------------------------------- @@ -211,14 +211,14 @@ hypre_F90_IFACE(hypre_structsparsemsgsetjacobiweigh, HYPRE_STRUCTSPARSEMSGSETJAC void hypre_F90_IFACE(hypre_structsparsemsgsetnumprer, HYPRE_STRUCTSPARSEMSGSETNUMPRER) - ( hypre_F90_Obj *solver, - hypre_F90_Int *num_pre_relax, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *num_pre_relax, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructSparseMSGSetNumPreRelax( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (num_pre_relax) ) ); + ( HYPRE_StructSparseMSGSetNumPreRelax( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (num_pre_relax) ) ); } /*-------------------------------------------------------------------------- @@ -227,14 +227,14 @@ hypre_F90_IFACE(hypre_structsparsemsgsetnumprer, HYPRE_STRUCTSPARSEMSGSETNUMPRER void hypre_F90_IFACE(hypre_structsparsemsgsetnumpost, HYPRE_STRUCTSPARSEMSGSETNUMPOST) - ( hypre_F90_Obj *solver, - hypre_F90_Int *num_post_relax, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *num_post_relax, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructSparseMSGSetNumPostRelax( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (num_post_relax) ) ); + ( HYPRE_StructSparseMSGSetNumPostRelax( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (num_post_relax) ) ); } /*-------------------------------------------------------------------------- @@ -243,14 +243,14 @@ hypre_F90_IFACE(hypre_structsparsemsgsetnumpost, HYPRE_STRUCTSPARSEMSGSETNUMPOST void hypre_F90_IFACE(hypre_structsparsemsgsetnumfine, HYPRE_STRUCTSPARSEMSGSETNUMFINE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *num_fine_relax, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *num_fine_relax, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructSparseMSGSetNumFineRelax( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (num_fine_relax) ) ); + ( HYPRE_StructSparseMSGSetNumFineRelax( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (num_fine_relax) ) ); } /*-------------------------------------------------------------------------- @@ -259,14 +259,14 @@ hypre_F90_IFACE(hypre_structsparsemsgsetnumfine, HYPRE_STRUCTSPARSEMSGSETNUMFINE void hypre_F90_IFACE(hypre_structsparsemsgsetlogging, HYPRE_STRUCTSPARSEMSGSETLOGGING) - ( hypre_F90_Obj *solver, - hypre_F90_Int *logging, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *logging, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructSparseMSGSetLogging( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (logging) ) ); + ( HYPRE_StructSparseMSGSetLogging( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (logging) ) ); } /*-------------------------------------------------------------------------- @@ -275,14 +275,14 @@ hypre_F90_IFACE(hypre_structsparsemsgsetlogging, HYPRE_STRUCTSPARSEMSGSETLOGGING void hypre_F90_IFACE(hypre_structsparsemsgsetprintle, HYPRE_STRUCTSPARSEMSGSETPRINTLE) - ( hypre_F90_Obj *solver, - hypre_F90_Int *print_level, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *print_level, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructSparseMSGSetPrintLevel( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassInt (print_level) ) ); + ( HYPRE_StructSparseMSGSetPrintLevel( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassInt (print_level) ) ); } /*-------------------------------------------------------------------------- @@ -291,14 +291,14 @@ hypre_F90_IFACE(hypre_structsparsemsgsetprintle, HYPRE_STRUCTSPARSEMSGSETPRINTLE void hypre_F90_IFACE(hypre_structsparsemsggetnumiter, HYPRE_STRUCTSPARSEMSGGETNUMITER) - ( hypre_F90_Obj *solver, - hypre_F90_Int *num_iterations, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Int *num_iterations, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructSparseMSGGetNumIterations( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassIntRef (num_iterations) ) ); + ( HYPRE_StructSparseMSGGetNumIterations( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassIntRef (num_iterations) ) ); } /*-------------------------------------------------------------------------- @@ -307,16 +307,16 @@ hypre_F90_IFACE(hypre_structsparsemsggetnumiter, HYPRE_STRUCTSPARSEMSGGETNUMITER void hypre_F90_IFACE(hypre_structsparsemsggetfinalre, HYPRE_STRUCTSPARSEMSGGETFINALRE) - ( hypre_F90_Obj *solver, - hypre_F90_Real *norm, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *solver, + hypre_F90_Real *norm, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructSparseMSGGetFinalRelativeResidualNorm( - hypre_F90_PassObj (HYPRE_StructSolver, solver), - hypre_F90_PassRealRef (norm) ) ); + ( HYPRE_StructSparseMSGGetFinalRelativeResidualNorm( + hypre_F90_PassObj (HYPRE_StructSolver, solver), + hypre_F90_PassRealRef (norm) ) ); } - + #ifdef __cplusplus } #endif diff --git a/external/hypre/src/struct_ls/HYPRE_struct_bicgstab.c b/external/hypre/src/struct_ls/HYPRE_struct_bicgstab.c index 6b9c5996..6d3ef940 100644 --- a/external/hypre/src/struct_ls/HYPRE_struct_bicgstab.c +++ b/external/hypre/src/struct_ls/HYPRE_struct_bicgstab.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -12,6 +12,8 @@ HYPRE_Int HYPRE_StructBiCGSTABCreate( MPI_Comm comm, HYPRE_StructSolver *solver ) { + HYPRE_UNUSED_VAR(comm); + hypre_BiCGSTABFunctions * bicgstab_functions = hypre_BiCGSTABFunctionsCreate( hypre_StructKrylovCreateVector, @@ -30,38 +32,38 @@ HYPRE_StructBiCGSTABCreate( MPI_Comm comm, HYPRE_StructSolver *solver ) /*==========================================================================*/ -HYPRE_Int +HYPRE_Int HYPRE_StructBiCGSTABDestroy( HYPRE_StructSolver solver ) { - return( hypre_BiCGSTABDestroy( (void *) solver ) ); + return ( hypre_BiCGSTABDestroy( (void *) solver ) ); } /*==========================================================================*/ -HYPRE_Int +HYPRE_Int HYPRE_StructBiCGSTABSetup( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) { - return( HYPRE_BiCGSTABSetup( (HYPRE_Solver) solver, - (HYPRE_Matrix) A, - (HYPRE_Vector) b, - (HYPRE_Vector) x ) ); + return ( HYPRE_BiCGSTABSetup( (HYPRE_Solver) solver, + (HYPRE_Matrix) A, + (HYPRE_Vector) b, + (HYPRE_Vector) x ) ); } /*==========================================================================*/ -HYPRE_Int +HYPRE_Int HYPRE_StructBiCGSTABSolve( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) { - return( HYPRE_BiCGSTABSolve( (HYPRE_Solver) solver, - (HYPRE_Matrix) A, - (HYPRE_Vector) b, - (HYPRE_Vector) x ) ); + return ( HYPRE_BiCGSTABSolve( (HYPRE_Solver) solver, + (HYPRE_Matrix) A, + (HYPRE_Vector) b, + (HYPRE_Vector) x ) ); } /*==========================================================================*/ @@ -70,7 +72,7 @@ HYPRE_Int HYPRE_StructBiCGSTABSetTol( HYPRE_StructSolver solver, HYPRE_Real tol ) { - return( HYPRE_BiCGSTABSetTol( (HYPRE_Solver) solver, tol ) ); + return ( HYPRE_BiCGSTABSetTol( (HYPRE_Solver) solver, tol ) ); } /*==========================================================================*/ @@ -79,7 +81,7 @@ HYPRE_Int HYPRE_StructBiCGSTABSetAbsoluteTol( HYPRE_StructSolver solver, HYPRE_Real tol ) { - return( HYPRE_BiCGSTABSetAbsoluteTol( (HYPRE_Solver) solver, tol ) ); + return ( HYPRE_BiCGSTABSetAbsoluteTol( (HYPRE_Solver) solver, tol ) ); } /*==========================================================================*/ @@ -88,7 +90,7 @@ HYPRE_Int HYPRE_StructBiCGSTABSetMaxIter( HYPRE_StructSolver solver, HYPRE_Int max_iter ) { - return( HYPRE_BiCGSTABSetMaxIter( (HYPRE_Solver) solver, max_iter ) ); + return ( HYPRE_BiCGSTABSetMaxIter( (HYPRE_Solver) solver, max_iter ) ); } @@ -100,10 +102,10 @@ HYPRE_StructBiCGSTABSetPrecond( HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ) { - return( HYPRE_BiCGSTABSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) precond, - (HYPRE_PtrToSolverFcn) precond_setup, - (HYPRE_Solver) precond_solver ) ); + return ( HYPRE_BiCGSTABSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) precond, + (HYPRE_PtrToSolverFcn) precond_setup, + (HYPRE_Solver) precond_solver ) ); } /*==========================================================================*/ @@ -112,7 +114,7 @@ HYPRE_Int HYPRE_StructBiCGSTABSetLogging( HYPRE_StructSolver solver, HYPRE_Int logging ) { - return( HYPRE_BiCGSTABSetLogging( (HYPRE_Solver) solver, logging ) ); + return ( HYPRE_BiCGSTABSetLogging( (HYPRE_Solver) solver, logging ) ); } /*==========================================================================*/ @@ -121,7 +123,7 @@ HYPRE_Int HYPRE_StructBiCGSTABSetPrintLevel( HYPRE_StructSolver solver, HYPRE_Int level) { - return( HYPRE_BiCGSTABSetPrintLevel( (HYPRE_Solver) solver, level ) ); + return ( HYPRE_BiCGSTABSetPrintLevel( (HYPRE_Solver) solver, level ) ); } /*==========================================================================*/ @@ -130,8 +132,8 @@ HYPRE_Int HYPRE_StructBiCGSTABGetNumIterations( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ) { - return( HYPRE_BiCGSTABGetNumIterations( (HYPRE_Solver) solver, - num_iterations ) ); + return ( HYPRE_BiCGSTABGetNumIterations( (HYPRE_Solver) solver, + num_iterations ) ); } /*==========================================================================*/ @@ -140,8 +142,8 @@ HYPRE_Int HYPRE_StructBiCGSTABGetFinalRelativeResidualNorm( HYPRE_StructSolver solver, HYPRE_Real *norm ) { - return( HYPRE_BiCGSTABGetFinalRelativeResidualNorm( (HYPRE_Solver) solver, - norm ) ); + return ( HYPRE_BiCGSTABGetFinalRelativeResidualNorm( (HYPRE_Solver) solver, + norm ) ); } /*==========================================================================*/ @@ -150,6 +152,5 @@ HYPRE_Int HYPRE_StructBiCGSTABGetResidual( HYPRE_StructSolver solver, void **residual) { - return( HYPRE_BiCGSTABGetResidual( (HYPRE_Solver) solver, residual ) ); + return ( HYPRE_BiCGSTABGetResidual( (HYPRE_Solver) solver, residual ) ); } - diff --git a/external/hypre/src/struct_ls/HYPRE_struct_cycred.c b/external/hypre/src/struct_ls/HYPRE_struct_cycred.c index ee4f76a7..ac0f46b0 100644 --- a/external/hypre/src/struct_ls/HYPRE_struct_cycred.c +++ b/external/hypre/src/struct_ls/HYPRE_struct_cycred.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -21,50 +21,50 @@ HYPRE_StructCycRedCreate( MPI_Comm comm, HYPRE_StructSolver *solver ) /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_StructCycRedDestroy( HYPRE_StructSolver solver ) { - return( hypre_CyclicReductionDestroy( (void *) solver ) ); + return ( hypre_CyclicReductionDestroy( (void *) solver ) ); } /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_StructCycRedSetup( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) { - return( hypre_CyclicReductionSetup( (void *) solver, - (hypre_StructMatrix *) A, - (hypre_StructVector *) b, - (hypre_StructVector *) x ) ); + return ( hypre_CyclicReductionSetup( (void *) solver, + (hypre_StructMatrix *) A, + (hypre_StructVector *) b, + (hypre_StructVector *) x ) ); } /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_StructCycRedSolve( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) { - return( hypre_CyclicReduction( (void *) solver, - (hypre_StructMatrix *) A, - (hypre_StructVector *) b, - (hypre_StructVector *) x ) ); + return ( hypre_CyclicReduction( (void *) solver, + (hypre_StructMatrix *) A, + (hypre_StructVector *) b, + (hypre_StructVector *) x ) ); } /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_StructCycRedSetTDim( HYPRE_StructSolver solver, HYPRE_Int tdim ) { - return( hypre_CyclicReductionSetCDir( (void *) solver, tdim ) ); + return ( hypre_CyclicReductionSetCDir( (void *) solver, tdim ) ); } /*-------------------------------------------------------------------------- @@ -89,7 +89,7 @@ HYPRE_StructCycRedSetBase( HYPRE_StructSolver solver, hypre_IndexD(new_base_stride, d) = base_stride[d]; } - return( hypre_CyclicReductionSetBase( (void *) solver, - new_base_index, new_base_stride ) ); + return ( hypre_CyclicReductionSetBase( (void *) solver, + new_base_index, new_base_stride ) ); } diff --git a/external/hypre/src/struct_ls/HYPRE_struct_flexgmres.c b/external/hypre/src/struct_ls/HYPRE_struct_flexgmres.c index 3ec663b2..455ff17d 100644 --- a/external/hypre/src/struct_ls/HYPRE_struct_flexgmres.c +++ b/external/hypre/src/struct_ls/HYPRE_struct_flexgmres.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -12,6 +12,8 @@ HYPRE_Int HYPRE_StructFlexGMRESCreate( MPI_Comm comm, HYPRE_StructSolver *solver ) { + HYPRE_UNUSED_VAR(comm); + hypre_FlexGMRESFunctions * fgmres_functions = hypre_FlexGMRESFunctionsCreate( hypre_StructKrylovCAlloc, hypre_StructKrylovFree, @@ -32,38 +34,38 @@ HYPRE_StructFlexGMRESCreate( MPI_Comm comm, HYPRE_StructSolver *solver ) /*==========================================================================*/ -HYPRE_Int +HYPRE_Int HYPRE_StructFlexGMRESDestroy( HYPRE_StructSolver solver ) { - return( hypre_FlexGMRESDestroy( (void *) solver ) ); + return ( hypre_FlexGMRESDestroy( (void *) solver ) ); } /*==========================================================================*/ -HYPRE_Int +HYPRE_Int HYPRE_StructFlexGMRESSetup( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) { - return( HYPRE_FlexGMRESSetup( (HYPRE_Solver) solver, - (HYPRE_Matrix) A, - (HYPRE_Vector) b, - (HYPRE_Vector) x ) ); + return ( HYPRE_FlexGMRESSetup( (HYPRE_Solver) solver, + (HYPRE_Matrix) A, + (HYPRE_Vector) b, + (HYPRE_Vector) x ) ); } /*==========================================================================*/ -HYPRE_Int +HYPRE_Int HYPRE_StructFlexGMRESSolve( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) { - return( HYPRE_FlexGMRESSolve( (HYPRE_Solver) solver, - (HYPRE_Matrix) A, - (HYPRE_Vector) b, - (HYPRE_Vector) x ) ); + return ( HYPRE_FlexGMRESSolve( (HYPRE_Solver) solver, + (HYPRE_Matrix) A, + (HYPRE_Vector) b, + (HYPRE_Vector) x ) ); } /*==========================================================================*/ @@ -72,7 +74,7 @@ HYPRE_Int HYPRE_StructFlexGMRESSetTol( HYPRE_StructSolver solver, HYPRE_Real tol ) { - return( HYPRE_FlexGMRESSetTol( (HYPRE_Solver) solver, tol ) ); + return ( HYPRE_FlexGMRESSetTol( (HYPRE_Solver) solver, tol ) ); } /*==========================================================================*/ @@ -81,7 +83,7 @@ HYPRE_Int HYPRE_StructFlexGMRESSetAbsoluteTol( HYPRE_StructSolver solver, HYPRE_Real atol ) { - return( HYPRE_FlexGMRESSetAbsoluteTol( (HYPRE_Solver) solver, atol ) ); + return ( HYPRE_FlexGMRESSetAbsoluteTol( (HYPRE_Solver) solver, atol ) ); } /*==========================================================================*/ @@ -90,7 +92,7 @@ HYPRE_Int HYPRE_StructFlexGMRESSetMaxIter( HYPRE_StructSolver solver, HYPRE_Int max_iter ) { - return( HYPRE_FlexGMRESSetMaxIter( (HYPRE_Solver) solver, max_iter ) ); + return ( HYPRE_FlexGMRESSetMaxIter( (HYPRE_Solver) solver, max_iter ) ); } /*==========================================================================*/ @@ -99,7 +101,7 @@ HYPRE_Int HYPRE_StructFlexGMRESSetKDim( HYPRE_StructSolver solver, HYPRE_Int k_dim ) { - return( HYPRE_FlexGMRESSetKDim( (HYPRE_Solver) solver, k_dim ) ); + return ( HYPRE_FlexGMRESSetKDim( (HYPRE_Solver) solver, k_dim ) ); } /*==========================================================================*/ @@ -110,10 +112,10 @@ HYPRE_StructFlexGMRESSetPrecond( HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ) { - return( HYPRE_FlexGMRESSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) precond, - (HYPRE_PtrToSolverFcn) precond_setup, - (HYPRE_Solver) precond_solver ) ); + return ( HYPRE_FlexGMRESSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) precond, + (HYPRE_PtrToSolverFcn) precond_setup, + (HYPRE_Solver) precond_solver ) ); } /*==========================================================================*/ @@ -122,7 +124,7 @@ HYPRE_Int HYPRE_StructFlexGMRESSetLogging( HYPRE_StructSolver solver, HYPRE_Int logging ) { - return( HYPRE_FlexGMRESSetLogging( (HYPRE_Solver) solver, logging ) ); + return ( HYPRE_FlexGMRESSetLogging( (HYPRE_Solver) solver, logging ) ); } /*==========================================================================*/ @@ -131,7 +133,7 @@ HYPRE_Int HYPRE_StructFlexGMRESSetPrintLevel( HYPRE_StructSolver solver, HYPRE_Int print_level ) { - return( HYPRE_FlexGMRESSetPrintLevel( (HYPRE_Solver) solver, print_level ) ); + return ( HYPRE_FlexGMRESSetPrintLevel( (HYPRE_Solver) solver, print_level ) ); } /*==========================================================================*/ @@ -140,8 +142,8 @@ HYPRE_Int HYPRE_StructFlexGMRESGetNumIterations( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ) { - return( HYPRE_FlexGMRESGetNumIterations( (HYPRE_Solver) solver, - num_iterations ) ); + return ( HYPRE_FlexGMRESGetNumIterations( (HYPRE_Solver) solver, + num_iterations ) ); } /*==========================================================================*/ @@ -150,8 +152,8 @@ HYPRE_Int HYPRE_StructFlexGMRESGetFinalRelativeResidualNorm( HYPRE_StructSolver solver, HYPRE_Real *norm ) { - return( HYPRE_FlexGMRESGetFinalRelativeResidualNorm( (HYPRE_Solver) solver, - norm ) ); + return ( HYPRE_FlexGMRESGetFinalRelativeResidualNorm( (HYPRE_Solver) solver, + norm ) ); } /*==========================================================================*/ @@ -162,4 +164,3 @@ HYPRE_Int HYPRE_StructFlexGMRESSetModifyPC( HYPRE_StructSolver solver, return ( HYPRE_FlexGMRESSetModifyPC( (HYPRE_Solver) solver, (HYPRE_PtrToModifyPCFcn) modify_pc)); } - diff --git a/external/hypre/src/struct_ls/HYPRE_struct_gmres.c b/external/hypre/src/struct_ls/HYPRE_struct_gmres.c index 34092f2d..62c78e98 100644 --- a/external/hypre/src/struct_ls/HYPRE_struct_gmres.c +++ b/external/hypre/src/struct_ls/HYPRE_struct_gmres.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -12,6 +12,8 @@ HYPRE_Int HYPRE_StructGMRESCreate( MPI_Comm comm, HYPRE_StructSolver *solver ) { + HYPRE_UNUSED_VAR(comm); + hypre_GMRESFunctions * gmres_functions = hypre_GMRESFunctionsCreate( hypre_StructKrylovCAlloc, hypre_StructKrylovFree, @@ -32,38 +34,38 @@ HYPRE_StructGMRESCreate( MPI_Comm comm, HYPRE_StructSolver *solver ) /*==========================================================================*/ -HYPRE_Int +HYPRE_Int HYPRE_StructGMRESDestroy( HYPRE_StructSolver solver ) { - return( hypre_GMRESDestroy( (void *) solver ) ); + return ( hypre_GMRESDestroy( (void *) solver ) ); } /*==========================================================================*/ -HYPRE_Int +HYPRE_Int HYPRE_StructGMRESSetup( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) { - return( HYPRE_GMRESSetup( (HYPRE_Solver) solver, - (HYPRE_Matrix) A, - (HYPRE_Vector) b, - (HYPRE_Vector) x ) ); + return ( HYPRE_GMRESSetup( (HYPRE_Solver) solver, + (HYPRE_Matrix) A, + (HYPRE_Vector) b, + (HYPRE_Vector) x ) ); } /*==========================================================================*/ -HYPRE_Int +HYPRE_Int HYPRE_StructGMRESSolve( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) { - return( HYPRE_GMRESSolve( (HYPRE_Solver) solver, - (HYPRE_Matrix) A, - (HYPRE_Vector) b, - (HYPRE_Vector) x ) ); + return ( HYPRE_GMRESSolve( (HYPRE_Solver) solver, + (HYPRE_Matrix) A, + (HYPRE_Vector) b, + (HYPRE_Vector) x ) ); } /*==========================================================================*/ @@ -72,7 +74,7 @@ HYPRE_Int HYPRE_StructGMRESSetTol( HYPRE_StructSolver solver, HYPRE_Real tol ) { - return( HYPRE_GMRESSetTol( (HYPRE_Solver) solver, tol ) ); + return ( HYPRE_GMRESSetTol( (HYPRE_Solver) solver, tol ) ); } /*==========================================================================*/ @@ -81,7 +83,7 @@ HYPRE_Int HYPRE_StructGMRESSetAbsoluteTol( HYPRE_StructSolver solver, HYPRE_Real atol ) { - return( HYPRE_GMRESSetAbsoluteTol( (HYPRE_Solver) solver, atol ) ); + return ( HYPRE_GMRESSetAbsoluteTol( (HYPRE_Solver) solver, atol ) ); } /*==========================================================================*/ @@ -90,7 +92,7 @@ HYPRE_Int HYPRE_StructGMRESSetMaxIter( HYPRE_StructSolver solver, HYPRE_Int max_iter ) { - return( HYPRE_GMRESSetMaxIter( (HYPRE_Solver) solver, max_iter ) ); + return ( HYPRE_GMRESSetMaxIter( (HYPRE_Solver) solver, max_iter ) ); } /*==========================================================================*/ @@ -99,7 +101,7 @@ HYPRE_Int HYPRE_StructGMRESSetKDim( HYPRE_StructSolver solver, HYPRE_Int k_dim ) { - return( HYPRE_GMRESSetKDim( (HYPRE_Solver) solver, k_dim ) ); + return ( HYPRE_GMRESSetKDim( (HYPRE_Solver) solver, k_dim ) ); } /*==========================================================================*/ @@ -110,10 +112,10 @@ HYPRE_StructGMRESSetPrecond( HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ) { - return( HYPRE_GMRESSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) precond, - (HYPRE_PtrToSolverFcn) precond_setup, - (HYPRE_Solver) precond_solver ) ); + return ( HYPRE_GMRESSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) precond, + (HYPRE_PtrToSolverFcn) precond_setup, + (HYPRE_Solver) precond_solver ) ); } /*==========================================================================*/ @@ -122,7 +124,7 @@ HYPRE_Int HYPRE_StructGMRESSetLogging( HYPRE_StructSolver solver, HYPRE_Int logging ) { - return( HYPRE_GMRESSetLogging( (HYPRE_Solver) solver, logging ) ); + return ( HYPRE_GMRESSetLogging( (HYPRE_Solver) solver, logging ) ); } /*==========================================================================*/ @@ -131,7 +133,7 @@ HYPRE_Int HYPRE_StructGMRESSetPrintLevel( HYPRE_StructSolver solver, HYPRE_Int print_level ) { - return( HYPRE_GMRESSetPrintLevel( (HYPRE_Solver) solver, print_level ) ); + return ( HYPRE_GMRESSetPrintLevel( (HYPRE_Solver) solver, print_level ) ); } /*==========================================================================*/ @@ -140,7 +142,7 @@ HYPRE_Int HYPRE_StructGMRESGetNumIterations( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ) { - return( HYPRE_GMRESGetNumIterations( (HYPRE_Solver) solver, num_iterations ) ); + return ( HYPRE_GMRESGetNumIterations( (HYPRE_Solver) solver, num_iterations ) ); } /*==========================================================================*/ @@ -149,7 +151,5 @@ HYPRE_Int HYPRE_StructGMRESGetFinalRelativeResidualNorm( HYPRE_StructSolver solver, HYPRE_Real *norm ) { - return( HYPRE_GMRESGetFinalRelativeResidualNorm( (HYPRE_Solver) solver, norm ) ); + return ( HYPRE_GMRESGetFinalRelativeResidualNorm( (HYPRE_Solver) solver, norm ) ); } - - diff --git a/external/hypre/src/struct_ls/HYPRE_struct_hybrid.c b/external/hypre/src/struct_ls/HYPRE_struct_hybrid.c index da4bb583..487678a6 100644 --- a/external/hypre/src/struct_ls/HYPRE_struct_hybrid.c +++ b/external/hypre/src/struct_ls/HYPRE_struct_hybrid.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -21,40 +21,40 @@ HYPRE_StructHybridCreate( MPI_Comm comm, HYPRE_StructSolver *solver ) /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_StructHybridDestroy( HYPRE_StructSolver solver ) { - return( hypre_HybridDestroy( (void *) solver ) ); + return ( hypre_HybridDestroy( (void *) solver ) ); } /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_StructHybridSetup( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) { - return( hypre_HybridSetup( (void *) solver, - (hypre_StructMatrix *) A, - (hypre_StructVector *) b, - (hypre_StructVector *) x ) ); + return ( hypre_HybridSetup( (void *) solver, + (hypre_StructMatrix *) A, + (hypre_StructVector *) b, + (hypre_StructVector *) x ) ); } /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_StructHybridSolve( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) { - return( hypre_HybridSolve( (void *) solver, - (hypre_StructMatrix *) A, - (hypre_StructVector *) b, - (hypre_StructVector *) x ) ); + return ( hypre_HybridSolve( (void *) solver, + (hypre_StructMatrix *) A, + (hypre_StructVector *) b, + (hypre_StructVector *) x ) ); } /*-------------------------------------------------------------------------- @@ -64,7 +64,7 @@ HYPRE_Int HYPRE_StructHybridSetTol( HYPRE_StructSolver solver, HYPRE_Real tol ) { - return( hypre_HybridSetTol( (void *) solver, tol ) ); + return ( hypre_HybridSetTol( (void *) solver, tol ) ); } /*-------------------------------------------------------------------------- @@ -74,7 +74,7 @@ HYPRE_Int HYPRE_StructHybridSetConvergenceTol( HYPRE_StructSolver solver, HYPRE_Real cf_tol ) { - return( hypre_HybridSetConvergenceTol( (void *) solver, cf_tol ) ); + return ( hypre_HybridSetConvergenceTol( (void *) solver, cf_tol ) ); } /*-------------------------------------------------------------------------- @@ -84,7 +84,7 @@ HYPRE_Int HYPRE_StructHybridSetDSCGMaxIter( HYPRE_StructSolver solver, HYPRE_Int dscg_max_its ) { - return( hypre_HybridSetDSCGMaxIter( (void *) solver, dscg_max_its ) ); + return ( hypre_HybridSetDSCGMaxIter( (void *) solver, dscg_max_its ) ); } /*-------------------------------------------------------------------------- @@ -94,7 +94,7 @@ HYPRE_Int HYPRE_StructHybridSetPCGMaxIter( HYPRE_StructSolver solver, HYPRE_Int pcg_max_its ) { - return( hypre_HybridSetPCGMaxIter( (void *) solver, pcg_max_its ) ); + return ( hypre_HybridSetPCGMaxIter( (void *) solver, pcg_max_its ) ); } /*-------------------------------------------------------------------------- @@ -104,7 +104,7 @@ HYPRE_Int HYPRE_StructHybridSetPCGAbsoluteTolFactor( HYPRE_StructSolver solver, HYPRE_Real pcg_atolf ) { - return( hypre_HybridSetPCGAbsoluteTolFactor( (void *) solver, pcg_atolf ) ); + return ( hypre_HybridSetPCGAbsoluteTolFactor( (void *) solver, pcg_atolf ) ); } /*-------------------------------------------------------------------------- @@ -114,7 +114,7 @@ HYPRE_Int HYPRE_StructHybridSetTwoNorm( HYPRE_StructSolver solver, HYPRE_Int two_norm ) { - return( hypre_HybridSetTwoNorm( (void *) solver, two_norm ) ); + return ( hypre_HybridSetTwoNorm( (void *) solver, two_norm ) ); } /*-------------------------------------------------------------------------- @@ -124,7 +124,7 @@ HYPRE_Int HYPRE_StructHybridSetStopCrit( HYPRE_StructSolver solver, HYPRE_Int stop_crit ) { - return( hypre_HybridSetStopCrit( (void *) solver, stop_crit ) ); + return ( hypre_HybridSetStopCrit( (void *) solver, stop_crit ) ); } /*-------------------------------------------------------------------------- @@ -134,7 +134,7 @@ HYPRE_Int HYPRE_StructHybridSetRelChange( HYPRE_StructSolver solver, HYPRE_Int rel_change ) { - return( hypre_HybridSetRelChange( (void *) solver, rel_change ) ); + return ( hypre_HybridSetRelChange( (void *) solver, rel_change ) ); } /*-------------------------------------------------------------------------- @@ -144,7 +144,7 @@ HYPRE_Int HYPRE_StructHybridSetSolverType( HYPRE_StructSolver solver, HYPRE_Int solver_type ) { - return( hypre_HybridSetSolverType( (void *) solver, solver_type ) ); + return ( hypre_HybridSetSolverType( (void *) solver, solver_type ) ); } /*-------------------------------------------------------------------------- @@ -154,14 +154,14 @@ HYPRE_Int HYPRE_StructHybridSetRecomputeResidual( HYPRE_StructSolver solver, HYPRE_Int recompute_residual ) { - return( hypre_HybridSetRecomputeResidual( (void *) solver, recompute_residual ) ); + return ( hypre_HybridSetRecomputeResidual( (void *) solver, recompute_residual ) ); } HYPRE_Int HYPRE_StructHybridGetRecomputeResidual( HYPRE_StructSolver solver, HYPRE_Int *recompute_residual ) { - return( hypre_HybridGetRecomputeResidual( (void *) solver, recompute_residual ) ); + return ( hypre_HybridGetRecomputeResidual( (void *) solver, recompute_residual ) ); } /*-------------------------------------------------------------------------- @@ -171,14 +171,14 @@ HYPRE_Int HYPRE_StructHybridSetRecomputeResidualP( HYPRE_StructSolver solver, HYPRE_Int recompute_residual_p ) { - return( hypre_HybridSetRecomputeResidualP( (void *) solver, recompute_residual_p ) ); + return ( hypre_HybridSetRecomputeResidualP( (void *) solver, recompute_residual_p ) ); } HYPRE_Int HYPRE_StructHybridGetRecomputeResidualP( HYPRE_StructSolver solver, HYPRE_Int *recompute_residual_p ) { - return( hypre_HybridGetRecomputeResidualP( (void *) solver, recompute_residual_p ) ); + return ( hypre_HybridGetRecomputeResidualP( (void *) solver, recompute_residual_p ) ); } /*-------------------------------------------------------------------------- @@ -188,7 +188,7 @@ HYPRE_Int HYPRE_StructHybridSetKDim( HYPRE_StructSolver solver, HYPRE_Int k_dim ) { - return( hypre_HybridSetKDim( (void *) solver, k_dim ) ); + return ( hypre_HybridSetKDim( (void *) solver, k_dim ) ); } /*-------------------------------------------------------------------------- @@ -200,10 +200,10 @@ HYPRE_StructHybridSetPrecond( HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ) { - return( hypre_HybridSetPrecond( (void *) solver, - (HYPRE_Int (*)(void*, void*, void*, void*)) precond, - (HYPRE_Int (*)(void*, void*, void*, void*)) precond_setup, - (void *) precond_solver ) ); + return ( hypre_HybridSetPrecond( (void *) solver, + (HYPRE_Int (*)(void*, void*, void*, void*)) precond, + (HYPRE_Int (*)(void*, void*, void*, void*)) precond_setup, + (void *) precond_solver ) ); } /*-------------------------------------------------------------------------- @@ -213,7 +213,7 @@ HYPRE_Int HYPRE_StructHybridSetLogging( HYPRE_StructSolver solver, HYPRE_Int logging ) { - return( hypre_HybridSetLogging( (void *) solver, logging ) ); + return ( hypre_HybridSetLogging( (void *) solver, logging ) ); } /*-------------------------------------------------------------------------- @@ -223,7 +223,7 @@ HYPRE_Int HYPRE_StructHybridSetPrintLevel( HYPRE_StructSolver solver, HYPRE_Int print_level ) { - return( hypre_HybridSetPrintLevel( (void *) solver, print_level ) ); + return ( hypre_HybridSetPrintLevel( (void *) solver, print_level ) ); } /*-------------------------------------------------------------------------- @@ -233,7 +233,7 @@ HYPRE_Int HYPRE_StructHybridGetNumIterations( HYPRE_StructSolver solver, HYPRE_Int *num_its ) { - return( hypre_HybridGetNumIterations( (void *) solver, num_its ) ); + return ( hypre_HybridGetNumIterations( (void *) solver, num_its ) ); } /*-------------------------------------------------------------------------- @@ -243,7 +243,7 @@ HYPRE_Int HYPRE_StructHybridGetDSCGNumIterations( HYPRE_StructSolver solver, HYPRE_Int *dscg_num_its ) { - return( hypre_HybridGetDSCGNumIterations( (void *) solver, dscg_num_its ) ); + return ( hypre_HybridGetDSCGNumIterations( (void *) solver, dscg_num_its ) ); } /*-------------------------------------------------------------------------- @@ -253,7 +253,7 @@ HYPRE_Int HYPRE_StructHybridGetPCGNumIterations( HYPRE_StructSolver solver, HYPRE_Int *pcg_num_its ) { - return( hypre_HybridGetPCGNumIterations( (void *) solver, pcg_num_its ) ); + return ( hypre_HybridGetPCGNumIterations( (void *) solver, pcg_num_its ) ); } /*-------------------------------------------------------------------------- @@ -263,6 +263,6 @@ HYPRE_Int HYPRE_StructHybridGetFinalRelativeResidualNorm( HYPRE_StructSolver solver, HYPRE_Real *norm ) { - return( hypre_HybridGetFinalRelativeResidualNorm( (void *) solver, norm ) ); + return ( hypre_HybridGetFinalRelativeResidualNorm( (void *) solver, norm ) ); } diff --git a/external/hypre/src/struct_ls/HYPRE_struct_int.c b/external/hypre/src/struct_ls/HYPRE_struct_int.c index e9048acb..ab9f9449 100644 --- a/external/hypre/src/struct_ls/HYPRE_struct_int.c +++ b/external/hypre/src/struct_ls/HYPRE_struct_int.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -11,86 +11,69 @@ HYPRE_Int hypre_StructVectorSetRandomValues( hypre_StructVector *vector, - HYPRE_Int seed ) + HYPRE_Int seed ) { - hypre_Box *v_data_box; - - HYPRE_Real *vp; - - hypre_BoxArray *boxes; - hypre_Box *box; - hypre_Index loop_size; - hypre_IndexRef start; - hypre_Index unit_stride; - - HYPRE_Int i; + hypre_Box *v_data_box; + HYPRE_Real *vp; + hypre_BoxArray *boxes; + hypre_Box *box; + hypre_Index loop_size; + hypre_IndexRef start; + hypre_Index unit_stride; + HYPRE_Int i; + HYPRE_Complex *data = hypre_StructVectorData(vector); + HYPRE_Complex *data_host = NULL; + HYPRE_Int data_size = hypre_StructVectorDataSize(vector); + HYPRE_MemoryLocation memory_location = hypre_StructVectorMemoryLocation(vector); /*----------------------------------------------------------------------- * Set the vector coefficients *-----------------------------------------------------------------------*/ -// srand( seed ); + // srand( seed ); hypre_SeedRand(seed); hypre_SetIndex3(unit_stride, 1, 1, 1); boxes = hypre_StructGridBoxes(hypre_StructVectorGrid(vector)); + + if (hypre_GetExecPolicy1(memory_location) == HYPRE_EXEC_DEVICE) + { + data_host = hypre_CTAlloc(HYPRE_Complex, data_size, HYPRE_MEMORY_HOST); + hypre_StructVectorData(vector) = data_host; + } + hypre_ForBoxI(i, boxes) { - box = hypre_BoxArrayBox(boxes, i); + box = hypre_BoxArrayBox(boxes, i); start = hypre_BoxIMin(box); - v_data_box = - hypre_BoxArrayBox(hypre_StructVectorDataSpace(vector), i); + v_data_box = hypre_BoxArrayBox(hypre_StructVectorDataSpace(vector), i); vp = hypre_StructVectorBoxData(vector, i); hypre_BoxGetSize(box, loop_size); - /* RL TODO: generate on host and copy to device. FIX? */ -#if defined(HYPRE_USING_GPU) - HYPRE_Int loop_n = 1, ii; - for (ii = 0; ii < hypre_StructVectorNDim(vector); ii++) - { - loop_n *= loop_size[ii]; - } - - HYPRE_Real *rand_host = hypre_TAlloc(HYPRE_Real, loop_n, HYPRE_MEMORY_HOST); - HYPRE_Real *rand_device = hypre_TAlloc(HYPRE_Real, loop_n, HYPRE_MEMORY_DEVICE); - - ii = 0; - hypre_SerialBoxLoop0Begin(hypre_StructVectorNDim(vector),loop_size) - { - rand_host[ii++] = 2.0*hypre_Rand() - 1.0; - } - hypre_SerialBoxLoop0End() - hypre_TMemcpy(rand_device, rand_host, HYPRE_Real, loop_n, - HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); -#endif - -#define DEVICE_VAR is_device_ptr(vp, rand_device) - hypre_BoxLoop1Begin(hypre_StructVectorNDim(vector), loop_size, - v_data_box, start, unit_stride, vi); + hypre_SerialBoxLoop1Begin(hypre_StructVectorNDim(vector), loop_size, + v_data_box, start, unit_stride, vi); { -#if defined(HYPRE_USING_GPU) - vp[vi] = rand_device[idx]; -#else - vp[vi] = 2.0*hypre_Rand() - 1.0; -#endif + vp[vi] = 2.0 * hypre_Rand() - 1.0; } - hypre_BoxLoop1End(vi); -#undef DEVICE_VAR + hypre_SerialBoxLoop1End(vi); + } -#if defined(HYPRE_USING_GPU) - hypre_TFree(rand_device, HYPRE_MEMORY_DEVICE); - hypre_TFree(rand_host, HYPRE_MEMORY_HOST); -#endif + if (data_host) + { + hypre_TMemcpy(data, data_host, HYPRE_Complex, data_size, memory_location, HYPRE_MEMORY_HOST); + hypre_StructVectorData(vector) = data; + hypre_TFree(data_host, HYPRE_MEMORY_HOST); } return hypre_error_flag; } HYPRE_Int -hypre_StructSetRandomValues( void* v, HYPRE_Int seed ) { +hypre_StructSetRandomValues( void* v, HYPRE_Int seed ) +{ return hypre_StructVectorSetRandomValues( (hypre_StructVector*)v, seed ); } diff --git a/external/hypre/src/struct_ls/HYPRE_struct_jacobi.c b/external/hypre/src/struct_ls/HYPRE_struct_jacobi.c index 6c0fab5c..7b7d0dac 100644 --- a/external/hypre/src/struct_ls/HYPRE_struct_jacobi.c +++ b/external/hypre/src/struct_ls/HYPRE_struct_jacobi.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -22,40 +22,40 @@ HYPRE_StructJacobiCreate( MPI_Comm comm, /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_StructJacobiDestroy( HYPRE_StructSolver solver ) { - return( hypre_JacobiDestroy( (void *) solver ) ); + return ( hypre_JacobiDestroy( (void *) solver ) ); } /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_StructJacobiSetup( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) { - return( hypre_JacobiSetup( (void *) solver, - (hypre_StructMatrix *) A, - (hypre_StructVector *) b, - (hypre_StructVector *) x ) ); + return ( hypre_JacobiSetup( (void *) solver, + (hypre_StructMatrix *) A, + (hypre_StructVector *) b, + (hypre_StructVector *) x ) ); } /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_StructJacobiSolve( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) { - return( hypre_JacobiSolve( (void *) solver, - (hypre_StructMatrix *) A, - (hypre_StructVector *) b, - (hypre_StructVector *) x ) ); + return ( hypre_JacobiSolve( (void *) solver, + (hypre_StructMatrix *) A, + (hypre_StructVector *) b, + (hypre_StructVector *) x ) ); } /*-------------------------------------------------------------------------- @@ -65,7 +65,7 @@ HYPRE_Int HYPRE_StructJacobiSetTol( HYPRE_StructSolver solver, HYPRE_Real tol ) { - return( hypre_JacobiSetTol( (void *) solver, tol ) ); + return ( hypre_JacobiSetTol( (void *) solver, tol ) ); } /*-------------------------------------------------------------------------- @@ -75,7 +75,7 @@ HYPRE_Int HYPRE_StructJacobiGetTol( HYPRE_StructSolver solver, HYPRE_Real * tol ) { - return( hypre_JacobiGetTol( (void *) solver, tol ) ); + return ( hypre_JacobiGetTol( (void *) solver, tol ) ); } /*-------------------------------------------------------------------------- @@ -85,7 +85,7 @@ HYPRE_Int HYPRE_StructJacobiSetMaxIter( HYPRE_StructSolver solver, HYPRE_Int max_iter ) { - return( hypre_JacobiSetMaxIter( (void *) solver, max_iter ) ); + return ( hypre_JacobiSetMaxIter( (void *) solver, max_iter ) ); } /*-------------------------------------------------------------------------- @@ -95,35 +95,35 @@ HYPRE_Int HYPRE_StructJacobiGetMaxIter( HYPRE_StructSolver solver, HYPRE_Int * max_iter ) { - return( hypre_JacobiGetMaxIter( (void *) solver, max_iter ) ); + return ( hypre_JacobiGetMaxIter( (void *) solver, max_iter ) ); } /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ - + HYPRE_Int HYPRE_StructJacobiSetZeroGuess( HYPRE_StructSolver solver ) { - return( hypre_JacobiSetZeroGuess( (void *) solver, 1 ) ); + return ( hypre_JacobiSetZeroGuess( (void *) solver, 1 ) ); } /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ - + HYPRE_Int HYPRE_StructJacobiGetZeroGuess( HYPRE_StructSolver solver, HYPRE_Int * zeroguess ) { - return( hypre_JacobiGetZeroGuess( (void *) solver, zeroguess ) ); + return ( hypre_JacobiGetZeroGuess( (void *) solver, zeroguess ) ); } /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ - + HYPRE_Int HYPRE_StructJacobiSetNonZeroGuess( HYPRE_StructSolver solver ) { - return( hypre_JacobiSetZeroGuess( (void *) solver, 0 ) ); + return ( hypre_JacobiSetZeroGuess( (void *) solver, 0 ) ); } @@ -136,7 +136,7 @@ HYPRE_Int HYPRE_StructJacobiGetNumIterations( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ) { - return( hypre_JacobiGetNumIterations( (void *) solver, num_iterations ) ); + return ( hypre_JacobiGetNumIterations( (void *) solver, num_iterations ) ); } /*-------------------------------------------------------------------------- @@ -146,5 +146,5 @@ HYPRE_Int HYPRE_StructJacobiGetFinalRelativeResidualNorm( HYPRE_StructSolver solver, HYPRE_Real *norm ) { - return( hypre_JacobiGetFinalRelativeResidualNorm( (void *) solver, norm ) ); + return ( hypre_JacobiGetFinalRelativeResidualNorm( (void *) solver, norm ) ); } diff --git a/external/hypre/src/struct_ls/HYPRE_struct_lgmres.c b/external/hypre/src/struct_ls/HYPRE_struct_lgmres.c index 8f8f46a0..806e3412 100644 --- a/external/hypre/src/struct_ls/HYPRE_struct_lgmres.c +++ b/external/hypre/src/struct_ls/HYPRE_struct_lgmres.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -12,6 +12,8 @@ HYPRE_Int HYPRE_StructLGMRESCreate( MPI_Comm comm, HYPRE_StructSolver *solver ) { + HYPRE_UNUSED_VAR(comm); + hypre_LGMRESFunctions * lgmres_functions = hypre_LGMRESFunctionsCreate( hypre_StructKrylovCAlloc, hypre_StructKrylovFree, @@ -32,38 +34,38 @@ HYPRE_StructLGMRESCreate( MPI_Comm comm, HYPRE_StructSolver *solver ) /*==========================================================================*/ -HYPRE_Int +HYPRE_Int HYPRE_StructLGMRESDestroy( HYPRE_StructSolver solver ) { - return( hypre_LGMRESDestroy( (void *) solver ) ); + return ( hypre_LGMRESDestroy( (void *) solver ) ); } /*==========================================================================*/ -HYPRE_Int +HYPRE_Int HYPRE_StructLGMRESSetup( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) { - return( HYPRE_LGMRESSetup( (HYPRE_Solver) solver, - (HYPRE_Matrix) A, - (HYPRE_Vector) b, - (HYPRE_Vector) x ) ); + return ( HYPRE_LGMRESSetup( (HYPRE_Solver) solver, + (HYPRE_Matrix) A, + (HYPRE_Vector) b, + (HYPRE_Vector) x ) ); } /*==========================================================================*/ -HYPRE_Int +HYPRE_Int HYPRE_StructLGMRESSolve( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) { - return( HYPRE_LGMRESSolve( (HYPRE_Solver) solver, - (HYPRE_Matrix) A, - (HYPRE_Vector) b, - (HYPRE_Vector) x ) ); + return ( HYPRE_LGMRESSolve( (HYPRE_Solver) solver, + (HYPRE_Matrix) A, + (HYPRE_Vector) b, + (HYPRE_Vector) x ) ); } /*==========================================================================*/ @@ -72,7 +74,7 @@ HYPRE_Int HYPRE_StructLGMRESSetTol( HYPRE_StructSolver solver, HYPRE_Real tol ) { - return( HYPRE_LGMRESSetTol( (HYPRE_Solver) solver, tol ) ); + return ( HYPRE_LGMRESSetTol( (HYPRE_Solver) solver, tol ) ); } /*==========================================================================*/ @@ -80,7 +82,7 @@ HYPRE_Int HYPRE_StructLGMRESSetAbsoluteTol( HYPRE_StructSolver solver, HYPRE_Real tol ) { - return( HYPRE_LGMRESSetAbsoluteTol( (HYPRE_Solver) solver, tol ) ); + return ( HYPRE_LGMRESSetAbsoluteTol( (HYPRE_Solver) solver, tol ) ); } /*==========================================================================*/ @@ -88,7 +90,7 @@ HYPRE_Int HYPRE_StructLGMRESSetMaxIter( HYPRE_StructSolver solver, HYPRE_Int max_iter ) { - return( HYPRE_LGMRESSetMaxIter( (HYPRE_Solver) solver, max_iter ) ); + return ( HYPRE_LGMRESSetMaxIter( (HYPRE_Solver) solver, max_iter ) ); } /*==========================================================================*/ @@ -97,7 +99,7 @@ HYPRE_Int HYPRE_StructLGMRESSetKDim( HYPRE_StructSolver solver, HYPRE_Int k_dim ) { - return( HYPRE_LGMRESSetKDim( (HYPRE_Solver) solver, k_dim ) ); + return ( HYPRE_LGMRESSetKDim( (HYPRE_Solver) solver, k_dim ) ); } @@ -108,7 +110,7 @@ HYPRE_Int HYPRE_StructLGMRESSetAugDim( HYPRE_StructSolver solver, HYPRE_Int aug_dim ) { - return( HYPRE_LGMRESSetAugDim( (HYPRE_Solver) solver, aug_dim ) ); + return ( HYPRE_LGMRESSetAugDim( (HYPRE_Solver) solver, aug_dim ) ); } @@ -120,10 +122,10 @@ HYPRE_StructLGMRESSetPrecond( HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ) { - return( HYPRE_LGMRESSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) precond, - (HYPRE_PtrToSolverFcn) precond_setup, - (HYPRE_Solver) precond_solver ) ); + return ( HYPRE_LGMRESSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) precond, + (HYPRE_PtrToSolverFcn) precond_setup, + (HYPRE_Solver) precond_solver ) ); } /*==========================================================================*/ @@ -132,7 +134,7 @@ HYPRE_Int HYPRE_StructLGMRESSetLogging( HYPRE_StructSolver solver, HYPRE_Int logging ) { - return( HYPRE_LGMRESSetLogging( (HYPRE_Solver) solver, logging ) ); + return ( HYPRE_LGMRESSetLogging( (HYPRE_Solver) solver, logging ) ); } /*==========================================================================*/ @@ -141,7 +143,7 @@ HYPRE_Int HYPRE_StructLGMRESSetPrintLevel( HYPRE_StructSolver solver, HYPRE_Int print_level ) { - return( HYPRE_LGMRESSetPrintLevel( (HYPRE_Solver) solver, print_level ) ); + return ( HYPRE_LGMRESSetPrintLevel( (HYPRE_Solver) solver, print_level ) ); } /*==========================================================================*/ @@ -150,7 +152,7 @@ HYPRE_Int HYPRE_StructLGMRESGetNumIterations( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ) { - return( HYPRE_LGMRESGetNumIterations( (HYPRE_Solver) solver, num_iterations ) ); + return ( HYPRE_LGMRESGetNumIterations( (HYPRE_Solver) solver, num_iterations ) ); } /*==========================================================================*/ @@ -159,8 +161,6 @@ HYPRE_Int HYPRE_StructLGMRESGetFinalRelativeResidualNorm( HYPRE_StructSolver solver, HYPRE_Real *norm ) { - return( HYPRE_LGMRESGetFinalRelativeResidualNorm( (HYPRE_Solver) solver, - norm ) ); + return ( HYPRE_LGMRESGetFinalRelativeResidualNorm( (HYPRE_Solver) solver, + norm ) ); } - - diff --git a/external/hypre/src/struct_ls/HYPRE_struct_ls.h b/external/hypre/src/struct_ls/HYPRE_struct_ls.h index efe7a349..21adef37 100644 --- a/external/hypre/src/struct_ls/HYPRE_struct_ls.h +++ b/external/hypre/src/struct_ls/HYPRE_struct_ls.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -22,10 +22,8 @@ extern "C" { /** * @defgroup StructSolvers Struct Solvers * - * These solvers use matrix/vector storage schemes that are tailored - * to structured grid problems. - * - * @memo Linear solvers for structured grids + * Linear solvers for structured grids. These solvers use matrix/vector storage + * schemes that are tailored to structured grid problems. * * @{ **/ @@ -46,23 +44,17 @@ struct hypre_StructSolver_struct; typedef struct hypre_StructSolver_struct *HYPRE_StructSolver; typedef HYPRE_Int (*HYPRE_PtrToStructSolverFcn)(HYPRE_StructSolver, - HYPRE_StructMatrix, - HYPRE_StructVector, - HYPRE_StructVector); + HYPRE_StructMatrix, + HYPRE_StructVector, + HYPRE_StructVector); #ifndef HYPRE_MODIFYPC #define HYPRE_MODIFYPC /* if pc not defined, then may need HYPRE_SOLVER also */ - #ifndef HYPRE_SOLVER_STRUCT - #define HYPRE_SOLVER_STRUCT - struct hypre_Solver_struct; - typedef struct hypre_Solver_struct *HYPRE_Solver; - #endif - typedef HYPRE_Int (*HYPRE_PtrToModifyPCFcn)(HYPRE_Solver, - HYPRE_Int, - HYPRE_Real); + HYPRE_Int, + HYPRE_Real); #endif /**@}*/ @@ -80,7 +72,7 @@ typedef HYPRE_Int (*HYPRE_PtrToModifyPCFcn)(HYPRE_Solver, * Create a solver object. **/ HYPRE_Int HYPRE_StructJacobiCreate(MPI_Comm comm, - HYPRE_StructSolver *solver); + HYPRE_StructSolver *solver); /** * Destroy a solver object. An object should be explicitly destroyed @@ -98,23 +90,23 @@ HYPRE_Int HYPRE_StructJacobiDestroy(HYPRE_StructSolver solver); * ignored here, but information about the layout of the data may be used. **/ HYPRE_Int HYPRE_StructJacobiSetup(HYPRE_StructSolver solver, - HYPRE_StructMatrix A, - HYPRE_StructVector b, - HYPRE_StructVector x); + HYPRE_StructMatrix A, + HYPRE_StructVector b, + HYPRE_StructVector x); /** * Solve the system. **/ HYPRE_Int HYPRE_StructJacobiSolve(HYPRE_StructSolver solver, - HYPRE_StructMatrix A, - HYPRE_StructVector b, - HYPRE_StructVector x); + HYPRE_StructMatrix A, + HYPRE_StructVector b, + HYPRE_StructVector x); /** * (Optional) Set the convergence tolerance. **/ HYPRE_Int HYPRE_StructJacobiSetTol(HYPRE_StructSolver solver, - HYPRE_Real tol); + HYPRE_Real tol); HYPRE_Int HYPRE_StructJacobiGetTol(HYPRE_StructSolver solver, @@ -124,7 +116,7 @@ HYPRE_Int HYPRE_StructJacobiGetTol(HYPRE_StructSolver solver, * (Optional) Set maximum number of iterations. **/ HYPRE_Int HYPRE_StructJacobiSetMaxIter(HYPRE_StructSolver solver, - HYPRE_Int max_iter); + HYPRE_Int max_iter); HYPRE_Int HYPRE_StructJacobiGetMaxIter(HYPRE_StructSolver solver, HYPRE_Int *max_iter ); @@ -149,13 +141,13 @@ HYPRE_Int HYPRE_StructJacobiSetNonZeroGuess(HYPRE_StructSolver solver); * Return the number of iterations taken. **/ HYPRE_Int HYPRE_StructJacobiGetNumIterations(HYPRE_StructSolver solver, - HYPRE_Int *num_iterations); + HYPRE_Int *num_iterations); /** * Return the norm of the final relative residual. **/ HYPRE_Int HYPRE_StructJacobiGetFinalRelativeResidualNorm(HYPRE_StructSolver solver, - HYPRE_Real *norm); + HYPRE_Real *norm); /**@}*/ @@ -179,7 +171,7 @@ HYPRE_Int HYPRE_StructJacobiGetFinalRelativeResidualNorm(HYPRE_StructSolver sol * Create a solver object. **/ HYPRE_Int HYPRE_StructPFMGCreate(MPI_Comm comm, - HYPRE_StructSolver *solver); + HYPRE_StructSolver *solver); /** * Destroy a solver object. @@ -191,23 +183,23 @@ HYPRE_Int HYPRE_StructPFMGDestroy(HYPRE_StructSolver solver); * ignored here, but information about the layout of the data may be used. **/ HYPRE_Int HYPRE_StructPFMGSetup(HYPRE_StructSolver solver, - HYPRE_StructMatrix A, - HYPRE_StructVector b, - HYPRE_StructVector x); + HYPRE_StructMatrix A, + HYPRE_StructVector b, + HYPRE_StructVector x); /** * Solve the system. **/ HYPRE_Int HYPRE_StructPFMGSolve(HYPRE_StructSolver solver, - HYPRE_StructMatrix A, - HYPRE_StructVector b, - HYPRE_StructVector x); + HYPRE_StructMatrix A, + HYPRE_StructVector b, + HYPRE_StructVector x); /** * (Optional) Set the convergence tolerance. **/ HYPRE_Int HYPRE_StructPFMGSetTol(HYPRE_StructSolver solver, - HYPRE_Real tol); + HYPRE_Real tol); HYPRE_Int HYPRE_StructPFMGGetTol (HYPRE_StructSolver solver, HYPRE_Real *tol); @@ -216,7 +208,7 @@ HYPRE_Int HYPRE_StructPFMGGetTol (HYPRE_StructSolver solver, * (Optional) Set maximum number of iterations. **/ HYPRE_Int HYPRE_StructPFMGSetMaxIter(HYPRE_StructSolver solver, - HYPRE_Int max_iter); + HYPRE_Int max_iter); HYPRE_Int HYPRE_StructPFMGGetMaxIter(HYPRE_StructSolver solver, HYPRE_Int *max_iter); @@ -225,7 +217,7 @@ HYPRE_Int HYPRE_StructPFMGGetMaxIter(HYPRE_StructSolver solver, * (Optional) Set maximum number of multigrid grid levels. **/ HYPRE_Int HYPRE_StructPFMGSetMaxLevels(HYPRE_StructSolver solver, - HYPRE_Int max_levels); + HYPRE_Int max_levels); HYPRE_Int HYPRE_StructPFMGGetMaxLevels (HYPRE_StructSolver solver, HYPRE_Int *max_levels ); @@ -235,7 +227,7 @@ HYPRE_Int HYPRE_StructPFMGGetMaxLevels (HYPRE_StructSolver solver, * successive iterates be small. **/ HYPRE_Int HYPRE_StructPFMGSetRelChange(HYPRE_StructSolver solver, - HYPRE_Int rel_change); + HYPRE_Int rel_change); HYPRE_Int HYPRE_StructPFMGGetRelChange (HYPRE_StructSolver solver, HYPRE_Int *rel_change); @@ -267,7 +259,7 @@ HYPRE_Int HYPRE_StructPFMGSetNonZeroGuess(HYPRE_StructSolver solver); * - 3 : Red/Black Gauss-Seidel (nonsymmetric: RB pre- and post-relaxation) **/ HYPRE_Int HYPRE_StructPFMGSetRelaxType(HYPRE_StructSolver solver, - HYPRE_Int relax_type); + HYPRE_Int relax_type); HYPRE_Int HYPRE_StructPFMGGetRelaxType(HYPRE_StructSolver solver, HYPRE_Int *relax_type); @@ -276,9 +268,9 @@ HYPRE_Int HYPRE_StructPFMGGetRelaxType(HYPRE_StructSolver solver, * (Optional) Set Jacobi weight (this is purposely not documented) */ HYPRE_Int HYPRE_StructPFMGSetJacobiWeight(HYPRE_StructSolver solver, - HYPRE_Real weight); + HYPRE_Real weight); HYPRE_Int HYPRE_StructPFMGGetJacobiWeight(HYPRE_StructSolver solver, - HYPRE_Real *weight); + HYPRE_Real *weight); /** @@ -294,7 +286,7 @@ HYPRE_Int HYPRE_StructPFMGGetJacobiWeight(HYPRE_StructSolver solver, * The stencil coefficients are computed by averaging techniques. **/ HYPRE_Int HYPRE_StructPFMGSetRAPType(HYPRE_StructSolver solver, - HYPRE_Int rap_type); + HYPRE_Int rap_type); HYPRE_Int HYPRE_StructPFMGGetRAPType(HYPRE_StructSolver solver, HYPRE_Int *rap_type ); @@ -303,7 +295,7 @@ HYPRE_Int HYPRE_StructPFMGGetRAPType(HYPRE_StructSolver solver, * (Optional) Set number of relaxation sweeps before coarse-grid correction. **/ HYPRE_Int HYPRE_StructPFMGSetNumPreRelax(HYPRE_StructSolver solver, - HYPRE_Int num_pre_relax); + HYPRE_Int num_pre_relax); HYPRE_Int HYPRE_StructPFMGGetNumPreRelax(HYPRE_StructSolver solver, HYPRE_Int *num_pre_relax); @@ -312,7 +304,7 @@ HYPRE_Int HYPRE_StructPFMGGetNumPreRelax(HYPRE_StructSolver solver, * (Optional) Set number of relaxation sweeps after coarse-grid correction. **/ HYPRE_Int HYPRE_StructPFMGSetNumPostRelax(HYPRE_StructSolver solver, - HYPRE_Int num_post_relax); + HYPRE_Int num_post_relax); HYPRE_Int HYPRE_StructPFMGGetNumPostRelax(HYPRE_StructSolver solver, HYPRE_Int *num_post_relax); @@ -323,7 +315,7 @@ HYPRE_Int HYPRE_StructPFMGGetNumPostRelax(HYPRE_StructSolver solver, * underlying problem is isotropic. **/ HYPRE_Int HYPRE_StructPFMGSetSkipRelax(HYPRE_StructSolver solver, - HYPRE_Int skip_relax); + HYPRE_Int skip_relax); HYPRE_Int HYPRE_StructPFMGGetSkipRelax(HYPRE_StructSolver solver, HYPRE_Int *skip_relax); @@ -332,13 +324,13 @@ HYPRE_Int HYPRE_StructPFMGGetSkipRelax(HYPRE_StructSolver solver, * RE-VISIT **/ HYPRE_Int HYPRE_StructPFMGSetDxyz(HYPRE_StructSolver solver, - HYPRE_Real *dxyz); + HYPRE_Real *dxyz); /** * (Optional) Set the amount of logging to do. **/ HYPRE_Int HYPRE_StructPFMGSetLogging(HYPRE_StructSolver solver, - HYPRE_Int logging); + HYPRE_Int logging); HYPRE_Int HYPRE_StructPFMGGetLogging(HYPRE_StructSolver solver, HYPRE_Int *logging); @@ -347,7 +339,7 @@ HYPRE_Int HYPRE_StructPFMGGetLogging(HYPRE_StructSolver solver, * (Optional) Set the amount of printing to do to the screen. **/ HYPRE_Int HYPRE_StructPFMGSetPrintLevel(HYPRE_StructSolver solver, - HYPRE_Int print_level); + HYPRE_Int print_level); HYPRE_Int HYPRE_StructPFMGGetPrintLevel(HYPRE_StructSolver solver, HYPRE_Int *print_level); @@ -356,13 +348,13 @@ HYPRE_Int HYPRE_StructPFMGGetPrintLevel(HYPRE_StructSolver solver, * Return the number of iterations taken. **/ HYPRE_Int HYPRE_StructPFMGGetNumIterations(HYPRE_StructSolver solver, - HYPRE_Int *num_iterations); + HYPRE_Int *num_iterations); /** * Return the norm of the final relative residual. **/ HYPRE_Int HYPRE_StructPFMGGetFinalRelativeResidualNorm(HYPRE_StructSolver solver, - HYPRE_Real *norm); + HYPRE_Real *norm); #if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) HYPRE_Int @@ -389,7 +381,7 @@ HYPRE_StructPFMGSetDeviceLevel( HYPRE_StructSolver solver, * Create a solver object. **/ HYPRE_Int HYPRE_StructSMGCreate(MPI_Comm comm, - HYPRE_StructSolver *solver); + HYPRE_StructSolver *solver); /** * Destroy a solver object. @@ -401,23 +393,23 @@ HYPRE_Int HYPRE_StructSMGDestroy(HYPRE_StructSolver solver); * ignored here, but information about the layout of the data may be used. **/ HYPRE_Int HYPRE_StructSMGSetup(HYPRE_StructSolver solver, - HYPRE_StructMatrix A, - HYPRE_StructVector b, - HYPRE_StructVector x); + HYPRE_StructMatrix A, + HYPRE_StructVector b, + HYPRE_StructVector x); /** * Solve the system. **/ HYPRE_Int HYPRE_StructSMGSolve(HYPRE_StructSolver solver, - HYPRE_StructMatrix A, - HYPRE_StructVector b, - HYPRE_StructVector x); + HYPRE_StructMatrix A, + HYPRE_StructVector b, + HYPRE_StructVector x); /* * RE-VISIT **/ HYPRE_Int HYPRE_StructSMGSetMemoryUse(HYPRE_StructSolver solver, - HYPRE_Int memory_use); + HYPRE_Int memory_use); HYPRE_Int HYPRE_StructSMGGetMemoryUse(HYPRE_StructSolver solver, HYPRE_Int *memory_use); @@ -426,7 +418,7 @@ HYPRE_Int HYPRE_StructSMGGetMemoryUse(HYPRE_StructSolver solver, * (Optional) Set the convergence tolerance. **/ HYPRE_Int HYPRE_StructSMGSetTol(HYPRE_StructSolver solver, - HYPRE_Real tol); + HYPRE_Real tol); HYPRE_Int HYPRE_StructSMGGetTol(HYPRE_StructSolver solver, HYPRE_Real *tol); @@ -435,7 +427,7 @@ HYPRE_Int HYPRE_StructSMGGetTol(HYPRE_StructSolver solver, * (Optional) Set maximum number of iterations. **/ HYPRE_Int HYPRE_StructSMGSetMaxIter(HYPRE_StructSolver solver, - HYPRE_Int max_iter); + HYPRE_Int max_iter); HYPRE_Int HYPRE_StructSMGGetMaxIter(HYPRE_StructSolver solver, HYPRE_Int *max_iter); @@ -445,7 +437,7 @@ HYPRE_Int HYPRE_StructSMGGetMaxIter(HYPRE_StructSolver solver, * successive iterates be small. **/ HYPRE_Int HYPRE_StructSMGSetRelChange(HYPRE_StructSolver solver, - HYPRE_Int rel_change); + HYPRE_Int rel_change); HYPRE_Int HYPRE_StructSMGGetRelChange(HYPRE_StructSolver solver, HYPRE_Int *rel_change); @@ -470,7 +462,7 @@ HYPRE_Int HYPRE_StructSMGSetNonZeroGuess(HYPRE_StructSolver solver); * (Optional) Set number of relaxation sweeps before coarse-grid correction. **/ HYPRE_Int HYPRE_StructSMGSetNumPreRelax(HYPRE_StructSolver solver, - HYPRE_Int num_pre_relax); + HYPRE_Int num_pre_relax); HYPRE_Int HYPRE_StructSMGGetNumPreRelax(HYPRE_StructSolver solver, HYPRE_Int *num_pre_relax); @@ -479,7 +471,7 @@ HYPRE_Int HYPRE_StructSMGGetNumPreRelax(HYPRE_StructSolver solver, * (Optional) Set number of relaxation sweeps after coarse-grid correction. **/ HYPRE_Int HYPRE_StructSMGSetNumPostRelax(HYPRE_StructSolver solver, - HYPRE_Int num_post_relax); + HYPRE_Int num_post_relax); HYPRE_Int HYPRE_StructSMGGetNumPostRelax(HYPRE_StructSolver solver, HYPRE_Int *num_post_relax); @@ -488,7 +480,7 @@ HYPRE_Int HYPRE_StructSMGGetNumPostRelax(HYPRE_StructSolver solver, * (Optional) Set the amount of logging to do. **/ HYPRE_Int HYPRE_StructSMGSetLogging(HYPRE_StructSolver solver, - HYPRE_Int logging); + HYPRE_Int logging); HYPRE_Int HYPRE_StructSMGGetLogging(HYPRE_StructSolver solver, HYPRE_Int *logging); @@ -497,7 +489,7 @@ HYPRE_Int HYPRE_StructSMGGetLogging(HYPRE_StructSolver solver, * (Optional) Set the amount of printing to do to the screen. **/ HYPRE_Int HYPRE_StructSMGSetPrintLevel(HYPRE_StructSolver solver, - HYPRE_Int print_level); + HYPRE_Int print_level); HYPRE_Int HYPRE_StructSMGGetPrintLevel(HYPRE_StructSolver solver, HYPRE_Int *print_level); @@ -506,13 +498,13 @@ HYPRE_Int HYPRE_StructSMGGetPrintLevel(HYPRE_StructSolver solver, * Return the number of iterations taken. **/ HYPRE_Int HYPRE_StructSMGGetNumIterations(HYPRE_StructSolver solver, - HYPRE_Int *num_iterations); + HYPRE_Int *num_iterations); /** * Return the norm of the final relative residual. **/ HYPRE_Int HYPRE_StructSMGGetFinalRelativeResidualNorm(HYPRE_StructSolver solver, - HYPRE_Real *norm); + HYPRE_Real *norm); #if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) HYPRE_Int @@ -598,7 +590,7 @@ HYPRE_Int HYPRE_StructCycRedSetBase(HYPRE_StructSolver solver, * Create a solver object. **/ HYPRE_Int HYPRE_StructPCGCreate(MPI_Comm comm, - HYPRE_StructSolver *solver); + HYPRE_StructSolver *solver); /** * Destroy a solver object. @@ -606,65 +598,65 @@ HYPRE_Int HYPRE_StructPCGCreate(MPI_Comm comm, HYPRE_Int HYPRE_StructPCGDestroy(HYPRE_StructSolver solver); HYPRE_Int HYPRE_StructPCGSetup(HYPRE_StructSolver solver, - HYPRE_StructMatrix A, - HYPRE_StructVector b, - HYPRE_StructVector x); + HYPRE_StructMatrix A, + HYPRE_StructVector b, + HYPRE_StructVector x); HYPRE_Int HYPRE_StructPCGSolve(HYPRE_StructSolver solver, - HYPRE_StructMatrix A, - HYPRE_StructVector b, - HYPRE_StructVector x); + HYPRE_StructMatrix A, + HYPRE_StructVector b, + HYPRE_StructVector x); HYPRE_Int HYPRE_StructPCGSetTol(HYPRE_StructSolver solver, - HYPRE_Real tol); + HYPRE_Real tol); HYPRE_Int HYPRE_StructPCGSetAbsoluteTol(HYPRE_StructSolver solver, - HYPRE_Real tol); + HYPRE_Real tol); HYPRE_Int HYPRE_StructPCGSetMaxIter(HYPRE_StructSolver solver, - HYPRE_Int max_iter); + HYPRE_Int max_iter); HYPRE_Int HYPRE_StructPCGSetTwoNorm(HYPRE_StructSolver solver, - HYPRE_Int two_norm); + HYPRE_Int two_norm); HYPRE_Int HYPRE_StructPCGSetRelChange(HYPRE_StructSolver solver, - HYPRE_Int rel_change); + HYPRE_Int rel_change); HYPRE_Int HYPRE_StructPCGSetPrecond(HYPRE_StructSolver solver, - HYPRE_PtrToStructSolverFcn precond, - HYPRE_PtrToStructSolverFcn precond_setup, - HYPRE_StructSolver precond_solver); + HYPRE_PtrToStructSolverFcn precond, + HYPRE_PtrToStructSolverFcn precond_setup, + HYPRE_StructSolver precond_solver); HYPRE_Int HYPRE_StructPCGSetLogging(HYPRE_StructSolver solver, - HYPRE_Int logging); + HYPRE_Int logging); HYPRE_Int HYPRE_StructPCGSetPrintLevel(HYPRE_StructSolver solver, - HYPRE_Int level); + HYPRE_Int level); HYPRE_Int HYPRE_StructPCGGetNumIterations(HYPRE_StructSolver solver, - HYPRE_Int *num_iterations); + HYPRE_Int *num_iterations); HYPRE_Int HYPRE_StructPCGGetFinalRelativeResidualNorm(HYPRE_StructSolver solver, - HYPRE_Real *norm); + HYPRE_Real *norm); HYPRE_Int HYPRE_StructPCGGetResidual(HYPRE_StructSolver solver, - void **residual); + void **residual); /** * Setup routine for diagonal preconditioning. **/ HYPRE_Int HYPRE_StructDiagScaleSetup(HYPRE_StructSolver solver, - HYPRE_StructMatrix A, - HYPRE_StructVector y, - HYPRE_StructVector x); + HYPRE_StructMatrix A, + HYPRE_StructVector y, + HYPRE_StructVector x); /** * Solve routine for diagonal preconditioning. **/ HYPRE_Int HYPRE_StructDiagScale(HYPRE_StructSolver solver, - HYPRE_StructMatrix HA, - HYPRE_StructVector Hy, - HYPRE_StructVector Hx); + HYPRE_StructMatrix HA, + HYPRE_StructVector Hy, + HYPRE_StructVector Hx); /**@}*/ @@ -684,7 +676,7 @@ HYPRE_Int HYPRE_StructDiagScale(HYPRE_StructSolver solver, * Create a solver object. **/ HYPRE_Int HYPRE_StructGMRESCreate(MPI_Comm comm, - HYPRE_StructSolver *solver); + HYPRE_StructSolver *solver); /** @@ -693,46 +685,46 @@ HYPRE_Int HYPRE_StructGMRESCreate(MPI_Comm comm, HYPRE_Int HYPRE_StructGMRESDestroy(HYPRE_StructSolver solver); HYPRE_Int HYPRE_StructGMRESSetup(HYPRE_StructSolver solver, - HYPRE_StructMatrix A, - HYPRE_StructVector b, - HYPRE_StructVector x); + HYPRE_StructMatrix A, + HYPRE_StructVector b, + HYPRE_StructVector x); HYPRE_Int HYPRE_StructGMRESSolve(HYPRE_StructSolver solver, - HYPRE_StructMatrix A, - HYPRE_StructVector b, - HYPRE_StructVector x); + HYPRE_StructMatrix A, + HYPRE_StructVector b, + HYPRE_StructVector x); HYPRE_Int HYPRE_StructGMRESSetTol(HYPRE_StructSolver solver, - HYPRE_Real tol); + HYPRE_Real tol); HYPRE_Int HYPRE_StructGMRESSetAbsoluteTol(HYPRE_StructSolver solver, - HYPRE_Real tol); + HYPRE_Real tol); HYPRE_Int HYPRE_StructGMRESSetMaxIter(HYPRE_StructSolver solver, - HYPRE_Int max_iter); + HYPRE_Int max_iter); HYPRE_Int HYPRE_StructGMRESSetKDim(HYPRE_StructSolver solver, - HYPRE_Int k_dim); + HYPRE_Int k_dim); HYPRE_Int HYPRE_StructGMRESSetPrecond(HYPRE_StructSolver solver, - HYPRE_PtrToStructSolverFcn precond, - HYPRE_PtrToStructSolverFcn precond_setup, - HYPRE_StructSolver precond_solver); + HYPRE_PtrToStructSolverFcn precond, + HYPRE_PtrToStructSolverFcn precond_setup, + HYPRE_StructSolver precond_solver); HYPRE_Int HYPRE_StructGMRESSetLogging(HYPRE_StructSolver solver, - HYPRE_Int logging); + HYPRE_Int logging); HYPRE_Int HYPRE_StructGMRESSetPrintLevel(HYPRE_StructSolver solver, - HYPRE_Int level); + HYPRE_Int level); HYPRE_Int HYPRE_StructGMRESGetNumIterations(HYPRE_StructSolver solver, - HYPRE_Int *num_iterations); + HYPRE_Int *num_iterations); HYPRE_Int HYPRE_StructGMRESGetFinalRelativeResidualNorm(HYPRE_StructSolver solver, - HYPRE_Real *norm); + HYPRE_Real *norm); HYPRE_Int HYPRE_StructGMRESGetResidual(HYPRE_StructSolver solver, - void **residual); + void **residual); /**@}*/ /*-------------------------------------------------------------------------- @@ -751,7 +743,7 @@ HYPRE_Int HYPRE_StructGMRESGetResidual(HYPRE_StructSolver solver, * Create a solver object. **/ HYPRE_Int HYPRE_StructFlexGMRESCreate(MPI_Comm comm, - HYPRE_StructSolver *solver); + HYPRE_StructSolver *solver); /** * Destroy a solver object. @@ -759,49 +751,49 @@ HYPRE_Int HYPRE_StructFlexGMRESCreate(MPI_Comm comm, HYPRE_Int HYPRE_StructFlexGMRESDestroy(HYPRE_StructSolver solver); HYPRE_Int HYPRE_StructFlexGMRESSetup(HYPRE_StructSolver solver, - HYPRE_StructMatrix A, - HYPRE_StructVector b, - HYPRE_StructVector x); + HYPRE_StructMatrix A, + HYPRE_StructVector b, + HYPRE_StructVector x); HYPRE_Int HYPRE_StructFlexGMRESSolve(HYPRE_StructSolver solver, - HYPRE_StructMatrix A, - HYPRE_StructVector b, - HYPRE_StructVector x); + HYPRE_StructMatrix A, + HYPRE_StructVector b, + HYPRE_StructVector x); HYPRE_Int HYPRE_StructFlexGMRESSetTol(HYPRE_StructSolver solver, - HYPRE_Real tol); + HYPRE_Real tol); HYPRE_Int HYPRE_StructFlexGMRESSetAbsoluteTol(HYPRE_StructSolver solver, - HYPRE_Real tol); + HYPRE_Real tol); HYPRE_Int HYPRE_StructFlexGMRESSetMaxIter(HYPRE_StructSolver solver, - HYPRE_Int max_iter); + HYPRE_Int max_iter); HYPRE_Int HYPRE_StructFlexGMRESSetKDim(HYPRE_StructSolver solver, - HYPRE_Int k_dim); + HYPRE_Int k_dim); HYPRE_Int HYPRE_StructFlexGMRESSetPrecond(HYPRE_StructSolver solver, - HYPRE_PtrToStructSolverFcn precond, - HYPRE_PtrToStructSolverFcn precond_setup, - HYPRE_StructSolver precond_solver); + HYPRE_PtrToStructSolverFcn precond, + HYPRE_PtrToStructSolverFcn precond_setup, + HYPRE_StructSolver precond_solver); HYPRE_Int HYPRE_StructFlexGMRESSetLogging(HYPRE_StructSolver solver, - HYPRE_Int logging); + HYPRE_Int logging); HYPRE_Int HYPRE_StructFlexGMRESSetPrintLevel(HYPRE_StructSolver solver, - HYPRE_Int level); + HYPRE_Int level); HYPRE_Int HYPRE_StructFlexGMRESGetNumIterations(HYPRE_StructSolver solver, - HYPRE_Int *num_iterations); + HYPRE_Int *num_iterations); HYPRE_Int HYPRE_StructFlexGMRESGetFinalRelativeResidualNorm(HYPRE_StructSolver solver, - HYPRE_Real *norm); + HYPRE_Real *norm); HYPRE_Int HYPRE_StructFlexGMRESGetResidual(HYPRE_StructSolver solver, - void **residual); + void **residual); HYPRE_Int HYPRE_StructFlexGMRESSetModifyPC(HYPRE_StructSolver solver, - HYPRE_PtrToModifyPCFcn modify_pc); + HYPRE_PtrToModifyPCFcn modify_pc); /**@}*/ @@ -821,7 +813,7 @@ HYPRE_Int HYPRE_StructFlexGMRESSetModifyPC(HYPRE_StructSolver solver, * Create a solver object. **/ HYPRE_Int HYPRE_StructLGMRESCreate(MPI_Comm comm, - HYPRE_StructSolver *solver); + HYPRE_StructSolver *solver); /** * Destroy a solver object. @@ -829,49 +821,49 @@ HYPRE_Int HYPRE_StructLGMRESCreate(MPI_Comm comm, HYPRE_Int HYPRE_StructLGMRESDestroy(HYPRE_StructSolver solver); HYPRE_Int HYPRE_StructLGMRESSetup(HYPRE_StructSolver solver, - HYPRE_StructMatrix A, - HYPRE_StructVector b, - HYPRE_StructVector x); + HYPRE_StructMatrix A, + HYPRE_StructVector b, + HYPRE_StructVector x); HYPRE_Int HYPRE_StructLGMRESSolve(HYPRE_StructSolver solver, - HYPRE_StructMatrix A, - HYPRE_StructVector b, - HYPRE_StructVector x); + HYPRE_StructMatrix A, + HYPRE_StructVector b, + HYPRE_StructVector x); HYPRE_Int HYPRE_StructLGMRESSetTol(HYPRE_StructSolver solver, - HYPRE_Real tol); + HYPRE_Real tol); HYPRE_Int HYPRE_StructLGMRESSetAbsoluteTol(HYPRE_StructSolver solver, - HYPRE_Real tol); + HYPRE_Real tol); HYPRE_Int HYPRE_StructLGMRESSetMaxIter(HYPRE_StructSolver solver, - HYPRE_Int max_iter); + HYPRE_Int max_iter); HYPRE_Int HYPRE_StructLGMRESSetKDim(HYPRE_StructSolver solver, - HYPRE_Int k_dim); + HYPRE_Int k_dim); HYPRE_Int HYPRE_StructLGMRESSetAugDim(HYPRE_StructSolver solver, - HYPRE_Int aug_dim); + HYPRE_Int aug_dim); HYPRE_Int HYPRE_StructLGMRESSetPrecond(HYPRE_StructSolver solver, - HYPRE_PtrToStructSolverFcn precond, - HYPRE_PtrToStructSolverFcn precond_setup, - HYPRE_StructSolver precond_solver); + HYPRE_PtrToStructSolverFcn precond, + HYPRE_PtrToStructSolverFcn precond_setup, + HYPRE_StructSolver precond_solver); HYPRE_Int HYPRE_StructLGMRESSetLogging(HYPRE_StructSolver solver, - HYPRE_Int logging); + HYPRE_Int logging); HYPRE_Int HYPRE_StructLGMRESSetPrintLevel(HYPRE_StructSolver solver, - HYPRE_Int level); + HYPRE_Int level); HYPRE_Int HYPRE_StructLGMRESGetNumIterations(HYPRE_StructSolver solver, - HYPRE_Int *num_iterations); + HYPRE_Int *num_iterations); HYPRE_Int HYPRE_StructLGMRESGetFinalRelativeResidualNorm(HYPRE_StructSolver solver, - HYPRE_Real *norm); + HYPRE_Real *norm); HYPRE_Int HYPRE_StructLGMRESGetResidual(HYPRE_StructSolver solver, - void **residual); + void **residual); /**@}*/ /*-------------------------------------------------------------------------- @@ -890,7 +882,7 @@ HYPRE_Int HYPRE_StructLGMRESGetResidual(HYPRE_StructSolver solver, * Create a solver object. **/ HYPRE_Int HYPRE_StructBiCGSTABCreate(MPI_Comm comm, - HYPRE_StructSolver *solver); + HYPRE_StructSolver *solver); /** * Destroy a solver object. @@ -898,43 +890,43 @@ HYPRE_Int HYPRE_StructBiCGSTABCreate(MPI_Comm comm, HYPRE_Int HYPRE_StructBiCGSTABDestroy(HYPRE_StructSolver solver); HYPRE_Int HYPRE_StructBiCGSTABSetup(HYPRE_StructSolver solver, - HYPRE_StructMatrix A, - HYPRE_StructVector b, - HYPRE_StructVector x); + HYPRE_StructMatrix A, + HYPRE_StructVector b, + HYPRE_StructVector x); HYPRE_Int HYPRE_StructBiCGSTABSolve(HYPRE_StructSolver solver, - HYPRE_StructMatrix A, - HYPRE_StructVector b, - HYPRE_StructVector x); + HYPRE_StructMatrix A, + HYPRE_StructVector b, + HYPRE_StructVector x); HYPRE_Int HYPRE_StructBiCGSTABSetTol(HYPRE_StructSolver solver, - HYPRE_Real tol); + HYPRE_Real tol); HYPRE_Int HYPRE_StructBiCGSTABSetAbsoluteTol(HYPRE_StructSolver solver, - HYPRE_Real tol); + HYPRE_Real tol); HYPRE_Int HYPRE_StructBiCGSTABSetMaxIter(HYPRE_StructSolver solver, - HYPRE_Int max_iter); + HYPRE_Int max_iter); HYPRE_Int HYPRE_StructBiCGSTABSetPrecond(HYPRE_StructSolver solver, - HYPRE_PtrToStructSolverFcn precond, - HYPRE_PtrToStructSolverFcn precond_setup, - HYPRE_StructSolver precond_solver); + HYPRE_PtrToStructSolverFcn precond, + HYPRE_PtrToStructSolverFcn precond_setup, + HYPRE_StructSolver precond_solver); HYPRE_Int HYPRE_StructBiCGSTABSetLogging(HYPRE_StructSolver solver, - HYPRE_Int logging); + HYPRE_Int logging); HYPRE_Int HYPRE_StructBiCGSTABSetPrintLevel(HYPRE_StructSolver solver, - HYPRE_Int level); + HYPRE_Int level); HYPRE_Int HYPRE_StructBiCGSTABGetNumIterations(HYPRE_StructSolver solver, - HYPRE_Int *num_iterations); + HYPRE_Int *num_iterations); HYPRE_Int HYPRE_StructBiCGSTABGetFinalRelativeResidualNorm(HYPRE_StructSolver solver, - HYPRE_Real *norm); + HYPRE_Real *norm); HYPRE_Int HYPRE_StructBiCGSTABGetResidual( HYPRE_StructSolver solver, - void **residual); + void **residual); /**@}*/ /*-------------------------------------------------------------------------- @@ -950,7 +942,7 @@ HYPRE_Int HYPRE_StructBiCGSTABGetResidual( HYPRE_StructSolver solver, * Create a solver object. **/ HYPRE_Int HYPRE_StructHybridCreate(MPI_Comm comm, - HYPRE_StructSolver *solver); + HYPRE_StructSolver *solver); /** * Destroy a solver object. @@ -962,23 +954,23 @@ HYPRE_Int HYPRE_StructHybridDestroy(HYPRE_StructSolver solver); * ignored here, but information about the layout of the data may be used. **/ HYPRE_Int HYPRE_StructHybridSetup(HYPRE_StructSolver solver, - HYPRE_StructMatrix A, - HYPRE_StructVector b, - HYPRE_StructVector x); + HYPRE_StructMatrix A, + HYPRE_StructVector b, + HYPRE_StructVector x); /** * Solve the system. **/ HYPRE_Int HYPRE_StructHybridSolve(HYPRE_StructSolver solver, - HYPRE_StructMatrix A, - HYPRE_StructVector b, - HYPRE_StructVector x); + HYPRE_StructMatrix A, + HYPRE_StructVector b, + HYPRE_StructVector x); /** * (Optional) Set the convergence tolerance. **/ HYPRE_Int HYPRE_StructHybridSetTol(HYPRE_StructSolver solver, - HYPRE_Real tol); + HYPRE_Real tol); /** * (Optional) Set an accepted convergence tolerance for diagonal scaling (DS). @@ -986,37 +978,37 @@ HYPRE_Int HYPRE_StructHybridSetTol(HYPRE_StructSolver solver, * than \e cf_tol. **/ HYPRE_Int HYPRE_StructHybridSetConvergenceTol(HYPRE_StructSolver solver, - HYPRE_Real cf_tol); + HYPRE_Real cf_tol); /** * (Optional) Set maximum number of iterations for diagonal scaling (DS). The * solver will switch preconditioners if DS reaches \e ds_max_its. **/ HYPRE_Int HYPRE_StructHybridSetDSCGMaxIter(HYPRE_StructSolver solver, - HYPRE_Int ds_max_its); + HYPRE_Int ds_max_its); /** * (Optional) Set maximum number of iterations for general preconditioner (PRE). * The solver will stop if PRE reaches \e pre_max_its. **/ HYPRE_Int HYPRE_StructHybridSetPCGMaxIter(HYPRE_StructSolver solver, - HYPRE_Int pre_max_its); + HYPRE_Int pre_max_its); /** * (Optional) Use the two-norm in stopping criteria. **/ HYPRE_Int HYPRE_StructHybridSetTwoNorm(HYPRE_StructSolver solver, - HYPRE_Int two_norm); + HYPRE_Int two_norm); HYPRE_Int HYPRE_StructHybridSetStopCrit(HYPRE_StructSolver solver, - HYPRE_Int stop_crit); + HYPRE_Int stop_crit); /** * (Optional) Additionally require that the relative difference in * successive iterates be small. **/ HYPRE_Int HYPRE_StructHybridSetRelChange(HYPRE_StructSolver solver, - HYPRE_Int rel_change); + HYPRE_Int rel_change); /** * (Optional) Set the type of Krylov solver to use. @@ -1064,51 +1056,51 @@ HYPRE_StructHybridGetRecomputeResidualP( HYPRE_StructSolver solver, * (Optional) Set the maximum size of the Krylov space when using GMRES. **/ HYPRE_Int HYPRE_StructHybridSetKDim(HYPRE_StructSolver solver, - HYPRE_Int k_dim); + HYPRE_Int k_dim); /** * (Optional) Set the preconditioner to use. **/ HYPRE_Int HYPRE_StructHybridSetPrecond(HYPRE_StructSolver solver, - HYPRE_PtrToStructSolverFcn precond, - HYPRE_PtrToStructSolverFcn precond_setup, - HYPRE_StructSolver precond_solver); + HYPRE_PtrToStructSolverFcn precond, + HYPRE_PtrToStructSolverFcn precond_setup, + HYPRE_StructSolver precond_solver); /** * (Optional) Set the amount of logging to do. **/ HYPRE_Int HYPRE_StructHybridSetLogging(HYPRE_StructSolver solver, - HYPRE_Int logging); + HYPRE_Int logging); /** * (Optional) Set the amount of printing to do to the screen. **/ HYPRE_Int HYPRE_StructHybridSetPrintLevel(HYPRE_StructSolver solver, - HYPRE_Int print_level); + HYPRE_Int print_level); /** * Return the number of iterations taken. **/ HYPRE_Int HYPRE_StructHybridGetNumIterations(HYPRE_StructSolver solver, - HYPRE_Int *num_its); + HYPRE_Int *num_its); /** * Return the number of diagonal scaling iterations taken. **/ HYPRE_Int HYPRE_StructHybridGetDSCGNumIterations(HYPRE_StructSolver solver, - HYPRE_Int *ds_num_its); + HYPRE_Int *ds_num_its); /** * Return the number of general preconditioning iterations taken. **/ HYPRE_Int HYPRE_StructHybridGetPCGNumIterations(HYPRE_StructSolver solver, - HYPRE_Int *pre_num_its); + HYPRE_Int *pre_num_its); /** * Return the norm of the final relative residual. **/ HYPRE_Int HYPRE_StructHybridGetFinalRelativeResidualNorm(HYPRE_StructSolver solver, - HYPRE_Real *norm); + HYPRE_Real *norm); HYPRE_Int HYPRE_StructHybridSetPCGAbsoluteTolFactor(HYPRE_StructSolver solver, HYPRE_Real pcg_atolf ); @@ -1123,63 +1115,63 @@ HYPRE_Int HYPRE_StructHybridSetPCGAbsoluteTolFactor(HYPRE_StructSolver solver, **/ HYPRE_Int HYPRE_StructSparseMSGCreate(MPI_Comm comm, - HYPRE_StructSolver *solver); + HYPRE_StructSolver *solver); HYPRE_Int HYPRE_StructSparseMSGDestroy(HYPRE_StructSolver solver); HYPRE_Int HYPRE_StructSparseMSGSetup(HYPRE_StructSolver solver, - HYPRE_StructMatrix A, - HYPRE_StructVector b, - HYPRE_StructVector x); + HYPRE_StructMatrix A, + HYPRE_StructVector b, + HYPRE_StructVector x); HYPRE_Int HYPRE_StructSparseMSGSolve(HYPRE_StructSolver solver, - HYPRE_StructMatrix A, - HYPRE_StructVector b, - HYPRE_StructVector x); + HYPRE_StructMatrix A, + HYPRE_StructVector b, + HYPRE_StructVector x); HYPRE_Int HYPRE_StructSparseMSGSetTol(HYPRE_StructSolver solver, - HYPRE_Real tol); + HYPRE_Real tol); HYPRE_Int HYPRE_StructSparseMSGSetMaxIter(HYPRE_StructSolver solver, - HYPRE_Int max_iter); + HYPRE_Int max_iter); HYPRE_Int HYPRE_StructSparseMSGSetJump(HYPRE_StructSolver solver, - HYPRE_Int jump); + HYPRE_Int jump); HYPRE_Int HYPRE_StructSparseMSGSetRelChange(HYPRE_StructSolver solver, - HYPRE_Int rel_change); + HYPRE_Int rel_change); HYPRE_Int HYPRE_StructSparseMSGSetZeroGuess(HYPRE_StructSolver solver); HYPRE_Int HYPRE_StructSparseMSGSetNonZeroGuess(HYPRE_StructSolver solver); HYPRE_Int HYPRE_StructSparseMSGSetRelaxType(HYPRE_StructSolver solver, - HYPRE_Int relax_type); + HYPRE_Int relax_type); HYPRE_Int HYPRE_StructSparseMSGSetJacobiWeight(HYPRE_StructSolver solver, - HYPRE_Real weight); + HYPRE_Real weight); HYPRE_Int HYPRE_StructSparseMSGSetNumPreRelax(HYPRE_StructSolver solver, - HYPRE_Int num_pre_relax); + HYPRE_Int num_pre_relax); HYPRE_Int HYPRE_StructSparseMSGSetNumPostRelax(HYPRE_StructSolver solver, - HYPRE_Int num_post_relax); + HYPRE_Int num_post_relax); HYPRE_Int HYPRE_StructSparseMSGSetNumFineRelax(HYPRE_StructSolver solver, - HYPRE_Int num_fine_relax); + HYPRE_Int num_fine_relax); HYPRE_Int HYPRE_StructSparseMSGSetLogging(HYPRE_StructSolver solver, - HYPRE_Int logging); + HYPRE_Int logging); HYPRE_Int HYPRE_StructSparseMSGSetPrintLevel(HYPRE_StructSolver solver, - HYPRE_Int print_level); + HYPRE_Int print_level); HYPRE_Int HYPRE_StructSparseMSGGetNumIterations(HYPRE_StructSolver solver, - HYPRE_Int *num_iterations); + HYPRE_Int *num_iterations); HYPRE_Int HYPRE_StructSparseMSGGetFinalRelativeResidualNorm(HYPRE_StructSolver solver, - HYPRE_Real *norm); + HYPRE_Real *norm); /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ diff --git a/external/hypre/src/struct_ls/HYPRE_struct_pcg.c b/external/hypre/src/struct_ls/HYPRE_struct_pcg.c index 2ebb8b85..9bd14558 100644 --- a/external/hypre/src/struct_ls/HYPRE_struct_pcg.c +++ b/external/hypre/src/struct_ls/HYPRE_struct_pcg.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -13,6 +13,8 @@ HYPRE_Int HYPRE_StructPCGCreate( MPI_Comm comm, HYPRE_StructSolver *solver ) { + HYPRE_UNUSED_VAR(comm); + /* The function names with a PCG in them are in struct_ls/pcg_struct.c . These functions do rather little - e.g., cast to the correct type - before calling something else. @@ -40,7 +42,7 @@ HYPRE_StructPCGCreate( MPI_Comm comm, HYPRE_StructSolver *solver ) HYPRE_Int HYPRE_StructPCGDestroy( HYPRE_StructSolver solver ) { - return( hypre_PCGDestroy( (void *) solver ) ); + return ( hypre_PCGDestroy( (void *) solver ) ); } /*==========================================================================*/ @@ -51,10 +53,10 @@ HYPRE_StructPCGSetup( HYPRE_StructSolver solver, HYPRE_StructVector b, HYPRE_StructVector x ) { - return( HYPRE_PCGSetup( (HYPRE_Solver) solver, - (HYPRE_Matrix) A, - (HYPRE_Vector) b, - (HYPRE_Vector) x ) ); + return ( HYPRE_PCGSetup( (HYPRE_Solver) solver, + (HYPRE_Matrix) A, + (HYPRE_Vector) b, + (HYPRE_Vector) x ) ); } /*==========================================================================*/ @@ -65,10 +67,10 @@ HYPRE_StructPCGSolve( HYPRE_StructSolver solver, HYPRE_StructVector b, HYPRE_StructVector x ) { - return( HYPRE_PCGSolve( (HYPRE_Solver) solver, - (HYPRE_Matrix) A, - (HYPRE_Vector) b, - (HYPRE_Vector) x ) ); + return ( HYPRE_PCGSolve( (HYPRE_Solver) solver, + (HYPRE_Matrix) A, + (HYPRE_Vector) b, + (HYPRE_Vector) x ) ); } /*==========================================================================*/ @@ -77,7 +79,7 @@ HYPRE_Int HYPRE_StructPCGSetTol( HYPRE_StructSolver solver, HYPRE_Real tol ) { - return( HYPRE_PCGSetTol( (HYPRE_Solver) solver, tol ) ); + return ( HYPRE_PCGSetTol( (HYPRE_Solver) solver, tol ) ); } /*==========================================================================*/ @@ -86,7 +88,7 @@ HYPRE_Int HYPRE_StructPCGSetAbsoluteTol( HYPRE_StructSolver solver, HYPRE_Real tol ) { - return( HYPRE_PCGSetAbsoluteTol( (HYPRE_Solver) solver, tol ) ); + return ( HYPRE_PCGSetAbsoluteTol( (HYPRE_Solver) solver, tol ) ); } /*==========================================================================*/ @@ -95,7 +97,7 @@ HYPRE_Int HYPRE_StructPCGSetMaxIter( HYPRE_StructSolver solver, HYPRE_Int max_iter ) { - return( HYPRE_PCGSetMaxIter( (HYPRE_Solver) solver, max_iter ) ); + return ( HYPRE_PCGSetMaxIter( (HYPRE_Solver) solver, max_iter ) ); } /*==========================================================================*/ @@ -104,7 +106,7 @@ HYPRE_Int HYPRE_StructPCGSetTwoNorm( HYPRE_StructSolver solver, HYPRE_Int two_norm ) { - return( HYPRE_PCGSetTwoNorm( (HYPRE_Solver) solver, two_norm ) ); + return ( HYPRE_PCGSetTwoNorm( (HYPRE_Solver) solver, two_norm ) ); } /*==========================================================================*/ @@ -113,7 +115,7 @@ HYPRE_Int HYPRE_StructPCGSetRelChange( HYPRE_StructSolver solver, HYPRE_Int rel_change ) { - return( HYPRE_PCGSetRelChange( (HYPRE_Solver) solver, rel_change ) ); + return ( HYPRE_PCGSetRelChange( (HYPRE_Solver) solver, rel_change ) ); } /*==========================================================================*/ @@ -124,10 +126,10 @@ HYPRE_StructPCGSetPrecond( HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ) { - return( HYPRE_PCGSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) precond, - (HYPRE_PtrToSolverFcn) precond_setup, - (HYPRE_Solver) precond_solver ) ); + return ( HYPRE_PCGSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) precond, + (HYPRE_PtrToSolverFcn) precond_setup, + (HYPRE_Solver) precond_solver ) ); } /*==========================================================================*/ @@ -136,7 +138,7 @@ HYPRE_Int HYPRE_StructPCGSetLogging( HYPRE_StructSolver solver, HYPRE_Int logging ) { - return( HYPRE_PCGSetLogging( (HYPRE_Solver) solver, logging ) ); + return ( HYPRE_PCGSetLogging( (HYPRE_Solver) solver, logging ) ); } /*==========================================================================*/ @@ -145,7 +147,7 @@ HYPRE_Int HYPRE_StructPCGSetPrintLevel( HYPRE_StructSolver solver, HYPRE_Int print_level ) { - return( HYPRE_PCGSetPrintLevel( (HYPRE_Solver) solver, print_level ) ); + return ( HYPRE_PCGSetPrintLevel( (HYPRE_Solver) solver, print_level ) ); } /*==========================================================================*/ @@ -154,7 +156,7 @@ HYPRE_Int HYPRE_StructPCGGetNumIterations( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ) { - return( HYPRE_PCGGetNumIterations( (HYPRE_Solver) solver, num_iterations ) ); + return ( HYPRE_PCGGetNumIterations( (HYPRE_Solver) solver, num_iterations ) ); } /*==========================================================================*/ @@ -163,7 +165,7 @@ HYPRE_Int HYPRE_StructPCGGetFinalRelativeResidualNorm( HYPRE_StructSolver solver, HYPRE_Real *norm ) { - return( HYPRE_PCGGetFinalRelativeResidualNorm( (HYPRE_Solver) solver, norm ) ); + return ( HYPRE_PCGGetFinalRelativeResidualNorm( (HYPRE_Solver) solver, norm ) ); } /*==========================================================================*/ @@ -174,6 +176,11 @@ HYPRE_StructDiagScaleSetup( HYPRE_StructSolver solver, HYPRE_StructVector y, HYPRE_StructVector x ) { + HYPRE_UNUSED_VAR(solver); + HYPRE_UNUSED_VAR(A); + HYPRE_UNUSED_VAR(y); + HYPRE_UNUSED_VAR(x); + return hypre_error_flag; } @@ -185,6 +192,8 @@ HYPRE_StructDiagScale( HYPRE_StructSolver solver, HYPRE_StructVector Hy, HYPRE_StructVector Hx ) { + HYPRE_UNUSED_VAR(solver); + hypre_StructMatrix *A = (hypre_StructMatrix *) HA; hypre_StructVector *y = (hypre_StructVector *) Hy; hypre_StructVector *x = (hypre_StructVector *) Hx; @@ -241,4 +250,3 @@ HYPRE_StructDiagScale( HYPRE_StructSolver solver, return hypre_error_flag; } - diff --git a/external/hypre/src/struct_ls/HYPRE_struct_pfmg.c b/external/hypre/src/struct_ls/HYPRE_struct_pfmg.c index 74659553..3a2899d9 100644 --- a/external/hypre/src/struct_ls/HYPRE_struct_pfmg.c +++ b/external/hypre/src/struct_ls/HYPRE_struct_pfmg.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -24,7 +24,7 @@ HYPRE_StructPFMGCreate( MPI_Comm comm, HYPRE_StructSolver *solver ) HYPRE_Int HYPRE_StructPFMGDestroy( HYPRE_StructSolver solver ) { - return( hypre_PFMGDestroy( (void *) solver ) ); + return ( hypre_PFMGDestroy( (void *) solver ) ); } /*-------------------------------------------------------------------------- @@ -36,10 +36,10 @@ HYPRE_StructPFMGSetup( HYPRE_StructSolver solver, HYPRE_StructVector b, HYPRE_StructVector x ) { - return( hypre_PFMGSetup( (void *) solver, - (hypre_StructMatrix *) A, - (hypre_StructVector *) b, - (hypre_StructVector *) x ) ); + return ( hypre_PFMGSetup( (void *) solver, + (hypre_StructMatrix *) A, + (hypre_StructVector *) b, + (hypre_StructVector *) x ) ); } /*-------------------------------------------------------------------------- @@ -51,10 +51,10 @@ HYPRE_StructPFMGSolve( HYPRE_StructSolver solver, HYPRE_StructVector b, HYPRE_StructVector x ) { - return( hypre_PFMGSolve( (void *) solver, - (hypre_StructMatrix *) A, - (hypre_StructVector *) b, - (hypre_StructVector *) x ) ); + return ( hypre_PFMGSolve( (void *) solver, + (hypre_StructMatrix *) A, + (hypre_StructVector *) b, + (hypre_StructVector *) x ) ); } /*-------------------------------------------------------------------------- @@ -64,14 +64,14 @@ HYPRE_Int HYPRE_StructPFMGSetTol( HYPRE_StructSolver solver, HYPRE_Real tol ) { - return( hypre_PFMGSetTol( (void *) solver, tol ) ); + return ( hypre_PFMGSetTol( (void *) solver, tol ) ); } HYPRE_Int HYPRE_StructPFMGGetTol( HYPRE_StructSolver solver, HYPRE_Real * tol ) { - return( hypre_PFMGGetTol( (void *) solver, tol ) ); + return ( hypre_PFMGGetTol( (void *) solver, tol ) ); } /*-------------------------------------------------------------------------- @@ -81,14 +81,14 @@ HYPRE_Int HYPRE_StructPFMGSetMaxIter( HYPRE_StructSolver solver, HYPRE_Int max_iter ) { - return( hypre_PFMGSetMaxIter( (void *) solver, max_iter ) ); + return ( hypre_PFMGSetMaxIter( (void *) solver, max_iter ) ); } HYPRE_Int HYPRE_StructPFMGGetMaxIter( HYPRE_StructSolver solver, HYPRE_Int * max_iter ) { - return( hypre_PFMGGetMaxIter( (void *) solver, max_iter ) ); + return ( hypre_PFMGGetMaxIter( (void *) solver, max_iter ) ); } /*-------------------------------------------------------------------------- @@ -98,14 +98,14 @@ HYPRE_Int HYPRE_StructPFMGSetMaxLevels( HYPRE_StructSolver solver, HYPRE_Int max_levels ) { - return( hypre_PFMGSetMaxLevels( (void *) solver, max_levels ) ); + return ( hypre_PFMGSetMaxLevels( (void *) solver, max_levels ) ); } HYPRE_Int HYPRE_StructPFMGGetMaxLevels( HYPRE_StructSolver solver, HYPRE_Int * max_levels ) { - return( hypre_PFMGGetMaxLevels( (void *) solver, max_levels ) ); + return ( hypre_PFMGGetMaxLevels( (void *) solver, max_levels ) ); } /*-------------------------------------------------------------------------- @@ -115,14 +115,14 @@ HYPRE_Int HYPRE_StructPFMGSetRelChange( HYPRE_StructSolver solver, HYPRE_Int rel_change ) { - return( hypre_PFMGSetRelChange( (void *) solver, rel_change ) ); + return ( hypre_PFMGSetRelChange( (void *) solver, rel_change ) ); } HYPRE_Int HYPRE_StructPFMGGetRelChange( HYPRE_StructSolver solver, HYPRE_Int * rel_change ) { - return( hypre_PFMGGetRelChange( (void *) solver, rel_change ) ); + return ( hypre_PFMGGetRelChange( (void *) solver, rel_change ) ); } /*-------------------------------------------------------------------------- @@ -131,14 +131,14 @@ HYPRE_StructPFMGGetRelChange( HYPRE_StructSolver solver, HYPRE_Int HYPRE_StructPFMGSetZeroGuess( HYPRE_StructSolver solver ) { - return( hypre_PFMGSetZeroGuess( (void *) solver, 1 ) ); + return ( hypre_PFMGSetZeroGuess( (void *) solver, 1 ) ); } HYPRE_Int HYPRE_StructPFMGGetZeroGuess( HYPRE_StructSolver solver, HYPRE_Int * zeroguess ) { - return( hypre_PFMGGetZeroGuess( (void *) solver, zeroguess ) ); + return ( hypre_PFMGGetZeroGuess( (void *) solver, zeroguess ) ); } /*-------------------------------------------------------------------------- @@ -147,7 +147,7 @@ HYPRE_StructPFMGGetZeroGuess( HYPRE_StructSolver solver, HYPRE_Int HYPRE_StructPFMGSetNonZeroGuess( HYPRE_StructSolver solver ) { - return( hypre_PFMGSetZeroGuess( (void *) solver, 0 ) ); + return ( hypre_PFMGSetZeroGuess( (void *) solver, 0 ) ); } /*-------------------------------------------------------------------------- @@ -159,27 +159,27 @@ HYPRE_Int HYPRE_StructPFMGSetRelaxType( HYPRE_StructSolver solver, HYPRE_Int relax_type ) { - return( hypre_PFMGSetRelaxType( (void *) solver, relax_type) ); + return ( hypre_PFMGSetRelaxType( (void *) solver, relax_type) ); } HYPRE_Int HYPRE_StructPFMGGetRelaxType( HYPRE_StructSolver solver, HYPRE_Int * relax_type ) { - return( hypre_PFMGGetRelaxType( (void *) solver, relax_type) ); + return ( hypre_PFMGGetRelaxType( (void *) solver, relax_type) ); } HYPRE_Int HYPRE_StructPFMGSetJacobiWeight(HYPRE_StructSolver solver, HYPRE_Real weight) { - return( hypre_PFMGSetJacobiWeight( (void *) solver, weight) ); + return ( hypre_PFMGSetJacobiWeight( (void *) solver, weight) ); } HYPRE_Int HYPRE_StructPFMGGetJacobiWeight(HYPRE_StructSolver solver, HYPRE_Real *weight) { - return( hypre_PFMGGetJacobiWeight( (void *) solver, weight) ); + return ( hypre_PFMGGetJacobiWeight( (void *) solver, weight) ); } /*-------------------------------------------------------------------------- @@ -189,14 +189,14 @@ HYPRE_Int HYPRE_StructPFMGSetRAPType( HYPRE_StructSolver solver, HYPRE_Int rap_type ) { - return( hypre_PFMGSetRAPType( (void *) solver, rap_type) ); + return ( hypre_PFMGSetRAPType( (void *) solver, rap_type) ); } HYPRE_Int HYPRE_StructPFMGGetRAPType( HYPRE_StructSolver solver, HYPRE_Int * rap_type ) { - return( hypre_PFMGGetRAPType( (void *) solver, rap_type) ); + return ( hypre_PFMGGetRAPType( (void *) solver, rap_type) ); } /*-------------------------------------------------------------------------- @@ -206,14 +206,14 @@ HYPRE_Int HYPRE_StructPFMGSetNumPreRelax( HYPRE_StructSolver solver, HYPRE_Int num_pre_relax ) { - return( hypre_PFMGSetNumPreRelax( (void *) solver, num_pre_relax) ); + return ( hypre_PFMGSetNumPreRelax( (void *) solver, num_pre_relax) ); } HYPRE_Int HYPRE_StructPFMGGetNumPreRelax( HYPRE_StructSolver solver, HYPRE_Int * num_pre_relax ) { - return( hypre_PFMGGetNumPreRelax( (void *) solver, num_pre_relax) ); + return ( hypre_PFMGGetNumPreRelax( (void *) solver, num_pre_relax) ); } /*-------------------------------------------------------------------------- @@ -223,14 +223,14 @@ HYPRE_Int HYPRE_StructPFMGSetNumPostRelax( HYPRE_StructSolver solver, HYPRE_Int num_post_relax ) { - return( hypre_PFMGSetNumPostRelax( (void *) solver, num_post_relax) ); + return ( hypre_PFMGSetNumPostRelax( (void *) solver, num_post_relax) ); } HYPRE_Int HYPRE_StructPFMGGetNumPostRelax( HYPRE_StructSolver solver, HYPRE_Int * num_post_relax ) { - return( hypre_PFMGGetNumPostRelax( (void *) solver, num_post_relax) ); + return ( hypre_PFMGGetNumPostRelax( (void *) solver, num_post_relax) ); } /*-------------------------------------------------------------------------- @@ -240,14 +240,14 @@ HYPRE_Int HYPRE_StructPFMGSetSkipRelax( HYPRE_StructSolver solver, HYPRE_Int skip_relax ) { - return( hypre_PFMGSetSkipRelax( (void *) solver, skip_relax) ); + return ( hypre_PFMGSetSkipRelax( (void *) solver, skip_relax) ); } HYPRE_Int HYPRE_StructPFMGGetSkipRelax( HYPRE_StructSolver solver, HYPRE_Int * skip_relax ) { - return( hypre_PFMGGetSkipRelax( (void *) solver, skip_relax) ); + return ( hypre_PFMGGetSkipRelax( (void *) solver, skip_relax) ); } /*-------------------------------------------------------------------------- @@ -257,7 +257,7 @@ HYPRE_Int HYPRE_StructPFMGSetDxyz( HYPRE_StructSolver solver, HYPRE_Real *dxyz ) { - return( hypre_PFMGSetDxyz( (void *) solver, dxyz) ); + return ( hypre_PFMGSetDxyz( (void *) solver, dxyz) ); } /*-------------------------------------------------------------------------- @@ -267,14 +267,14 @@ HYPRE_Int HYPRE_StructPFMGSetLogging( HYPRE_StructSolver solver, HYPRE_Int logging ) { - return( hypre_PFMGSetLogging( (void *) solver, logging) ); + return ( hypre_PFMGSetLogging( (void *) solver, logging) ); } HYPRE_Int HYPRE_StructPFMGGetLogging( HYPRE_StructSolver solver, HYPRE_Int * logging ) { - return( hypre_PFMGGetLogging( (void *) solver, logging) ); + return ( hypre_PFMGGetLogging( (void *) solver, logging) ); } /*-------------------------------------------------------------------------- @@ -284,14 +284,14 @@ HYPRE_Int HYPRE_StructPFMGSetPrintLevel( HYPRE_StructSolver solver, HYPRE_Int print_level ) { - return( hypre_PFMGSetPrintLevel( (void *) solver, print_level) ); + return ( hypre_PFMGSetPrintLevel( (void *) solver, print_level) ); } HYPRE_Int HYPRE_StructPFMGGetPrintLevel( HYPRE_StructSolver solver, HYPRE_Int * print_level ) { - return( hypre_PFMGGetPrintLevel( (void *) solver, print_level) ); + return ( hypre_PFMGGetPrintLevel( (void *) solver, print_level) ); } /*-------------------------------------------------------------------------- @@ -301,7 +301,7 @@ HYPRE_Int HYPRE_StructPFMGGetNumIterations( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ) { - return( hypre_PFMGGetNumIterations( (void *) solver, num_iterations ) ); + return ( hypre_PFMGGetNumIterations( (void *) solver, num_iterations ) ); } /*-------------------------------------------------------------------------- @@ -311,14 +311,14 @@ HYPRE_Int HYPRE_StructPFMGGetFinalRelativeResidualNorm( HYPRE_StructSolver solver, HYPRE_Real *norm ) { - return( hypre_PFMGGetFinalRelativeResidualNorm( (void *) solver, norm ) ); + return ( hypre_PFMGGetFinalRelativeResidualNorm( (void *) solver, norm ) ); } -#if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#if 0 //defined(HYPRE_USING_GPU) HYPRE_Int HYPRE_StructPFMGSetDeviceLevel( HYPRE_StructSolver solver, HYPRE_Int device_level ) { - return( hypre_PFMGSetDeviceLevel( (void *) solver, device_level ) ); + return ( hypre_PFMGSetDeviceLevel( (void *) solver, device_level ) ); } #endif diff --git a/external/hypre/src/struct_ls/HYPRE_struct_smg.c b/external/hypre/src/struct_ls/HYPRE_struct_smg.c index 87e6c36d..e95962bb 100644 --- a/external/hypre/src/struct_ls/HYPRE_struct_smg.c +++ b/external/hypre/src/struct_ls/HYPRE_struct_smg.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -24,7 +24,7 @@ HYPRE_StructSMGCreate( MPI_Comm comm, HYPRE_StructSolver *solver ) HYPRE_Int HYPRE_StructSMGDestroy( HYPRE_StructSolver solver ) { - return( hypre_SMGDestroy( (void *) solver ) ); + return ( hypre_SMGDestroy( (void *) solver ) ); } /*-------------------------------------------------------------------------- @@ -36,10 +36,10 @@ HYPRE_StructSMGSetup( HYPRE_StructSolver solver, HYPRE_StructVector b, HYPRE_StructVector x ) { - return( hypre_SMGSetup( (void *) solver, - (hypre_StructMatrix *) A, - (hypre_StructVector *) b, - (hypre_StructVector *) x ) ); + return ( hypre_SMGSetup( (void *) solver, + (hypre_StructMatrix *) A, + (hypre_StructVector *) b, + (hypre_StructVector *) x ) ); } /*-------------------------------------------------------------------------- @@ -51,10 +51,10 @@ HYPRE_StructSMGSolve( HYPRE_StructSolver solver, HYPRE_StructVector b, HYPRE_StructVector x ) { - return( hypre_SMGSolve( (void *) solver, - (hypre_StructMatrix *) A, - (hypre_StructVector *) b, - (hypre_StructVector *) x ) ); + return ( hypre_SMGSolve( (void *) solver, + (hypre_StructMatrix *) A, + (hypre_StructVector *) b, + (hypre_StructVector *) x ) ); } /*-------------------------------------------------------------------------- @@ -64,14 +64,14 @@ HYPRE_Int HYPRE_StructSMGSetMemoryUse( HYPRE_StructSolver solver, HYPRE_Int memory_use ) { - return( hypre_SMGSetMemoryUse( (void *) solver, memory_use ) ); + return ( hypre_SMGSetMemoryUse( (void *) solver, memory_use ) ); } HYPRE_Int HYPRE_StructSMGGetMemoryUse( HYPRE_StructSolver solver, HYPRE_Int * memory_use ) { - return( hypre_SMGGetMemoryUse( (void *) solver, memory_use ) ); + return ( hypre_SMGGetMemoryUse( (void *) solver, memory_use ) ); } /*-------------------------------------------------------------------------- @@ -81,14 +81,14 @@ HYPRE_Int HYPRE_StructSMGSetTol( HYPRE_StructSolver solver, HYPRE_Real tol ) { - return( hypre_SMGSetTol( (void *) solver, tol ) ); + return ( hypre_SMGSetTol( (void *) solver, tol ) ); } HYPRE_Int HYPRE_StructSMGGetTol( HYPRE_StructSolver solver, HYPRE_Real * tol ) { - return( hypre_SMGGetTol( (void *) solver, tol ) ); + return ( hypre_SMGGetTol( (void *) solver, tol ) ); } /*-------------------------------------------------------------------------- @@ -98,14 +98,14 @@ HYPRE_Int HYPRE_StructSMGSetMaxIter( HYPRE_StructSolver solver, HYPRE_Int max_iter ) { - return( hypre_SMGSetMaxIter( (void *) solver, max_iter ) ); + return ( hypre_SMGSetMaxIter( (void *) solver, max_iter ) ); } HYPRE_Int HYPRE_StructSMGGetMaxIter( HYPRE_StructSolver solver, HYPRE_Int * max_iter ) { - return( hypre_SMGGetMaxIter( (void *) solver, max_iter ) ); + return ( hypre_SMGGetMaxIter( (void *) solver, max_iter ) ); } /*-------------------------------------------------------------------------- @@ -115,14 +115,14 @@ HYPRE_Int HYPRE_StructSMGSetRelChange( HYPRE_StructSolver solver, HYPRE_Int rel_change ) { - return( hypre_SMGSetRelChange( (void *) solver, rel_change ) ); + return ( hypre_SMGSetRelChange( (void *) solver, rel_change ) ); } HYPRE_Int HYPRE_StructSMGGetRelChange( HYPRE_StructSolver solver, HYPRE_Int * rel_change ) { - return( hypre_SMGGetRelChange( (void *) solver, rel_change ) ); + return ( hypre_SMGGetRelChange( (void *) solver, rel_change ) ); } /*-------------------------------------------------------------------------- @@ -131,14 +131,14 @@ HYPRE_StructSMGGetRelChange( HYPRE_StructSolver solver, HYPRE_Int HYPRE_StructSMGSetZeroGuess( HYPRE_StructSolver solver ) { - return( hypre_SMGSetZeroGuess( (void *) solver, 1 ) ); + return ( hypre_SMGSetZeroGuess( (void *) solver, 1 ) ); } HYPRE_Int HYPRE_StructSMGGetZeroGuess( HYPRE_StructSolver solver, HYPRE_Int * zeroguess ) { - return( hypre_SMGGetZeroGuess( (void *) solver, zeroguess ) ); + return ( hypre_SMGGetZeroGuess( (void *) solver, zeroguess ) ); } /*-------------------------------------------------------------------------- @@ -147,7 +147,7 @@ HYPRE_StructSMGGetZeroGuess( HYPRE_StructSolver solver, HYPRE_Int HYPRE_StructSMGSetNonZeroGuess( HYPRE_StructSolver solver ) { - return( hypre_SMGSetZeroGuess( (void *) solver, 0 ) ); + return ( hypre_SMGSetZeroGuess( (void *) solver, 0 ) ); } /*-------------------------------------------------------------------------- @@ -158,14 +158,14 @@ HYPRE_Int HYPRE_StructSMGSetNumPreRelax( HYPRE_StructSolver solver, HYPRE_Int num_pre_relax ) { - return( hypre_SMGSetNumPreRelax( (void *) solver, num_pre_relax) ); + return ( hypre_SMGSetNumPreRelax( (void *) solver, num_pre_relax) ); } HYPRE_Int HYPRE_StructSMGGetNumPreRelax( HYPRE_StructSolver solver, HYPRE_Int * num_pre_relax ) { - return( hypre_SMGGetNumPreRelax( (void *) solver, num_pre_relax) ); + return ( hypre_SMGGetNumPreRelax( (void *) solver, num_pre_relax) ); } /*-------------------------------------------------------------------------- @@ -175,14 +175,14 @@ HYPRE_Int HYPRE_StructSMGSetNumPostRelax( HYPRE_StructSolver solver, HYPRE_Int num_post_relax ) { - return( hypre_SMGSetNumPostRelax( (void *) solver, num_post_relax) ); + return ( hypre_SMGSetNumPostRelax( (void *) solver, num_post_relax) ); } HYPRE_Int HYPRE_StructSMGGetNumPostRelax( HYPRE_StructSolver solver, HYPRE_Int * num_post_relax ) { - return( hypre_SMGGetNumPostRelax( (void *) solver, num_post_relax) ); + return ( hypre_SMGGetNumPostRelax( (void *) solver, num_post_relax) ); } /*-------------------------------------------------------------------------- @@ -192,14 +192,14 @@ HYPRE_Int HYPRE_StructSMGSetLogging( HYPRE_StructSolver solver, HYPRE_Int logging ) { - return( hypre_SMGSetLogging( (void *) solver, logging) ); + return ( hypre_SMGSetLogging( (void *) solver, logging) ); } HYPRE_Int HYPRE_StructSMGGetLogging( HYPRE_StructSolver solver, HYPRE_Int * logging ) { - return( hypre_SMGGetLogging( (void *) solver, logging) ); + return ( hypre_SMGGetLogging( (void *) solver, logging) ); } /*-------------------------------------------------------------------------- @@ -209,14 +209,14 @@ HYPRE_Int HYPRE_StructSMGSetPrintLevel( HYPRE_StructSolver solver, HYPRE_Int print_level ) { - return( hypre_SMGSetPrintLevel( (void *) solver, print_level) ); + return ( hypre_SMGSetPrintLevel( (void *) solver, print_level) ); } HYPRE_Int HYPRE_StructSMGGetPrintLevel( HYPRE_StructSolver solver, HYPRE_Int * print_level ) { - return( hypre_SMGGetPrintLevel( (void *) solver, print_level) ); + return ( hypre_SMGGetPrintLevel( (void *) solver, print_level) ); } /*-------------------------------------------------------------------------- @@ -226,7 +226,7 @@ HYPRE_Int HYPRE_StructSMGGetNumIterations( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ) { - return( hypre_SMGGetNumIterations( (void *) solver, num_iterations ) ); + return ( hypre_SMGGetNumIterations( (void *) solver, num_iterations ) ); } /*-------------------------------------------------------------------------- @@ -236,7 +236,7 @@ HYPRE_Int HYPRE_StructSMGGetFinalRelativeResidualNorm( HYPRE_StructSolver solver, HYPRE_Real *norm ) { - return( hypre_SMGGetFinalRelativeResidualNorm( (void *) solver, norm ) ); + return ( hypre_SMGGetFinalRelativeResidualNorm( (void *) solver, norm ) ); } #if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) diff --git a/external/hypre/src/struct_ls/HYPRE_struct_sparse_msg.c b/external/hypre/src/struct_ls/HYPRE_struct_sparse_msg.c index b18b007f..5f9f8feb 100644 --- a/external/hypre/src/struct_ls/HYPRE_struct_sparse_msg.c +++ b/external/hypre/src/struct_ls/HYPRE_struct_sparse_msg.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -29,42 +29,42 @@ HYPRE_StructSparseMSGCreate( MPI_Comm comm, HYPRE_StructSolver *solver ) * HYPRE_StructSparseMSGDestroy *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_StructSparseMSGDestroy( HYPRE_StructSolver solver ) { - return( hypre_SparseMSGDestroy( (void *) solver ) ); + return ( hypre_SparseMSGDestroy( (void *) solver ) ); } /*-------------------------------------------------------------------------- * HYPRE_StructSparseMSGSetup *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_StructSparseMSGSetup( HYPRE_StructSolver solver, - HYPRE_StructMatrix A, - HYPRE_StructVector b, - HYPRE_StructVector x ) + HYPRE_StructMatrix A, + HYPRE_StructVector b, + HYPRE_StructVector x ) { - return( hypre_SparseMSGSetup( (void *) solver, - (hypre_StructMatrix *) A, - (hypre_StructVector *) b, - (hypre_StructVector *) x ) ); + return ( hypre_SparseMSGSetup( (void *) solver, + (hypre_StructMatrix *) A, + (hypre_StructVector *) b, + (hypre_StructVector *) x ) ); } /*-------------------------------------------------------------------------- * HYPRE_StructSparseMSGSolve *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int HYPRE_StructSparseMSGSolve( HYPRE_StructSolver solver, - HYPRE_StructMatrix A, - HYPRE_StructVector b, - HYPRE_StructVector x ) + HYPRE_StructMatrix A, + HYPRE_StructVector b, + HYPRE_StructVector x ) { - return( hypre_SparseMSGSolve( (void *) solver, - (hypre_StructMatrix *) A, - (hypre_StructVector *) b, - (hypre_StructVector *) x ) ); + return ( hypre_SparseMSGSolve( (void *) solver, + (hypre_StructMatrix *) A, + (hypre_StructVector *) b, + (hypre_StructVector *) x ) ); } /*-------------------------------------------------------------------------- @@ -73,9 +73,9 @@ HYPRE_StructSparseMSGSolve( HYPRE_StructSolver solver, HYPRE_Int HYPRE_StructSparseMSGSetTol( HYPRE_StructSolver solver, - HYPRE_Real tol ) + HYPRE_Real tol ) { - return( hypre_SparseMSGSetTol( (void *) solver, tol ) ); + return ( hypre_SparseMSGSetTol( (void *) solver, tol ) ); } /*-------------------------------------------------------------------------- @@ -86,7 +86,7 @@ HYPRE_Int HYPRE_StructSparseMSGSetMaxIter( HYPRE_StructSolver solver, HYPRE_Int max_iter ) { - return( hypre_SparseMSGSetMaxIter( (void *) solver, max_iter ) ); + return ( hypre_SparseMSGSetMaxIter( (void *) solver, max_iter ) ); } /*-------------------------------------------------------------------------- @@ -97,7 +97,7 @@ HYPRE_Int HYPRE_StructSparseMSGSetJump( HYPRE_StructSolver solver, HYPRE_Int jump ) { - return( hypre_SparseMSGSetJump( (void *) solver, jump ) ); + return ( hypre_SparseMSGSetJump( (void *) solver, jump ) ); } /*-------------------------------------------------------------------------- @@ -108,27 +108,27 @@ HYPRE_Int HYPRE_StructSparseMSGSetRelChange( HYPRE_StructSolver solver, HYPRE_Int rel_change ) { - return( hypre_SparseMSGSetRelChange( (void *) solver, rel_change ) ); + return ( hypre_SparseMSGSetRelChange( (void *) solver, rel_change ) ); } /*-------------------------------------------------------------------------- * HYPRE_StructSparseMSGSetZeroGuess *--------------------------------------------------------------------------*/ - + HYPRE_Int HYPRE_StructSparseMSGSetZeroGuess( HYPRE_StructSolver solver ) { - return( hypre_SparseMSGSetZeroGuess( (void *) solver, 1 ) ); + return ( hypre_SparseMSGSetZeroGuess( (void *) solver, 1 ) ); } /*-------------------------------------------------------------------------- * HYPRE_StructSparseMSGSetNonZeroGuess *--------------------------------------------------------------------------*/ - + HYPRE_Int HYPRE_StructSparseMSGSetNonZeroGuess( HYPRE_StructSolver solver ) { - return( hypre_SparseMSGSetZeroGuess( (void *) solver, 0 ) ); + return ( hypre_SparseMSGSetZeroGuess( (void *) solver, 0 ) ); } /*-------------------------------------------------------------------------- @@ -137,9 +137,9 @@ HYPRE_StructSparseMSGSetNonZeroGuess( HYPRE_StructSolver solver ) HYPRE_Int HYPRE_StructSparseMSGSetRelaxType( HYPRE_StructSolver solver, - HYPRE_Int relax_type ) + HYPRE_Int relax_type ) { - return( hypre_SparseMSGSetRelaxType( (void *) solver, relax_type) ); + return ( hypre_SparseMSGSetRelaxType( (void *) solver, relax_type) ); } /*-------------------------------------------------------------------------- @@ -149,7 +149,7 @@ HYPRE_Int HYPRE_StructSparseMSGSetJacobiWeight(HYPRE_StructSolver solver, HYPRE_Real weight) { - return( hypre_SparseMSGSetJacobiWeight( (void *) solver, weight) ); + return ( hypre_SparseMSGSetJacobiWeight( (void *) solver, weight) ); } @@ -161,7 +161,7 @@ HYPRE_Int HYPRE_StructSparseMSGSetNumPreRelax( HYPRE_StructSolver solver, HYPRE_Int num_pre_relax ) { - return( hypre_SparseMSGSetNumPreRelax( (void *) solver, num_pre_relax) ); + return ( hypre_SparseMSGSetNumPreRelax( (void *) solver, num_pre_relax) ); } /*-------------------------------------------------------------------------- @@ -170,9 +170,9 @@ HYPRE_StructSparseMSGSetNumPreRelax( HYPRE_StructSolver solver, HYPRE_Int HYPRE_StructSparseMSGSetNumPostRelax( HYPRE_StructSolver solver, - HYPRE_Int num_post_relax ) + HYPRE_Int num_post_relax ) { - return( hypre_SparseMSGSetNumPostRelax( (void *) solver, num_post_relax) ); + return ( hypre_SparseMSGSetNumPostRelax( (void *) solver, num_post_relax) ); } /*-------------------------------------------------------------------------- @@ -181,9 +181,9 @@ HYPRE_StructSparseMSGSetNumPostRelax( HYPRE_StructSolver solver, HYPRE_Int HYPRE_StructSparseMSGSetNumFineRelax( HYPRE_StructSolver solver, - HYPRE_Int num_fine_relax ) + HYPRE_Int num_fine_relax ) { - return( hypre_SparseMSGSetNumFineRelax( (void *) solver, num_fine_relax) ); + return ( hypre_SparseMSGSetNumFineRelax( (void *) solver, num_fine_relax) ); } /*-------------------------------------------------------------------------- @@ -194,7 +194,7 @@ HYPRE_Int HYPRE_StructSparseMSGSetLogging( HYPRE_StructSolver solver, HYPRE_Int logging ) { - return( hypre_SparseMSGSetLogging( (void *) solver, logging) ); + return ( hypre_SparseMSGSetLogging( (void *) solver, logging) ); } /*-------------------------------------------------------------------------- @@ -205,7 +205,7 @@ HYPRE_Int HYPRE_StructSparseMSGSetPrintLevel( HYPRE_StructSolver solver, HYPRE_Int print_level ) { - return( hypre_SparseMSGSetPrintLevel( (void *) solver, print_level) ); + return ( hypre_SparseMSGSetPrintLevel( (void *) solver, print_level) ); } /*-------------------------------------------------------------------------- @@ -214,9 +214,9 @@ HYPRE_StructSparseMSGSetPrintLevel( HYPRE_StructSolver solver, HYPRE_Int HYPRE_StructSparseMSGGetNumIterations( HYPRE_StructSolver solver, - HYPRE_Int *num_iterations ) + HYPRE_Int *num_iterations ) { - return( hypre_SparseMSGGetNumIterations( (void *) solver, num_iterations ) ); + return ( hypre_SparseMSGGetNumIterations( (void *) solver, num_iterations ) ); } /*-------------------------------------------------------------------------- @@ -227,6 +227,6 @@ HYPRE_Int HYPRE_StructSparseMSGGetFinalRelativeResidualNorm( HYPRE_StructSolver solver, HYPRE_Real *norm ) { - return( hypre_SparseMSGGetFinalRelativeResidualNorm( (void *) solver, norm ) ); + return ( hypre_SparseMSGGetFinalRelativeResidualNorm( (void *) solver, norm ) ); } diff --git a/external/hypre/src/struct_ls/_hypre_struct_ls.h b/external/hypre/src/struct_ls/_hypre_struct_ls.h index f8a753e6..867a641e 100644 --- a/external/hypre/src/struct_ls/_hypre_struct_ls.h +++ b/external/hypre/src/struct_ls/_hypre_struct_ls.h @@ -19,25 +19,33 @@ extern "C" { #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ /* coarsen.c */ -HYPRE_Int hypre_StructMapFineToCoarse ( hypre_Index findex , hypre_Index index , hypre_Index stride , hypre_Index cindex ); -HYPRE_Int hypre_StructMapCoarseToFine ( hypre_Index cindex , hypre_Index index , hypre_Index stride , hypre_Index findex ); -HYPRE_Int hypre_StructCoarsen ( hypre_StructGrid *fgrid , hypre_Index index , hypre_Index stride , HYPRE_Int prune , hypre_StructGrid **cgrid_ptr ); +HYPRE_Int hypre_StructMapFineToCoarse ( hypre_Index findex, hypre_Index index, hypre_Index stride, + hypre_Index cindex ); +HYPRE_Int hypre_StructMapCoarseToFine ( hypre_Index cindex, hypre_Index index, hypre_Index stride, + hypre_Index findex ); +HYPRE_Int hypre_StructCoarsen ( hypre_StructGrid *fgrid, hypre_Index index, hypre_Index stride, + HYPRE_Int prune, hypre_StructGrid **cgrid_ptr ); /* cyclic_reduction.c */ void *hypre_CyclicReductionCreate ( MPI_Comm comm ); -hypre_StructMatrix *hypre_CycRedCreateCoarseOp ( hypre_StructMatrix *A , hypre_StructGrid *coarse_grid , HYPRE_Int cdir ); -HYPRE_Int hypre_CycRedSetupCoarseOp ( hypre_StructMatrix *A , hypre_StructMatrix *Ac , hypre_Index cindex , hypre_Index cstride, HYPRE_Int cdir ); -HYPRE_Int hypre_CyclicReductionSetup ( void *cyc_red_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); -HYPRE_Int hypre_CyclicReduction ( void *cyc_red_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); -HYPRE_Int hypre_CyclicReductionSetCDir ( void *cyc_red_vdata , HYPRE_Int cdir ); -HYPRE_Int hypre_CyclicReductionSetBase ( void *cyc_red_vdata , hypre_Index base_index , hypre_Index base_stride ); +hypre_StructMatrix *hypre_CycRedCreateCoarseOp ( hypre_StructMatrix *A, + hypre_StructGrid *coarse_grid, HYPRE_Int cdir ); +HYPRE_Int hypre_CycRedSetupCoarseOp ( hypre_StructMatrix *A, hypre_StructMatrix *Ac, + hypre_Index cindex, hypre_Index cstride, HYPRE_Int cdir ); +HYPRE_Int hypre_CyclicReductionSetup ( void *cyc_red_vdata, hypre_StructMatrix *A, + hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int hypre_CyclicReduction ( void *cyc_red_vdata, hypre_StructMatrix *A, hypre_StructVector *b, + hypre_StructVector *x ); +HYPRE_Int hypre_CyclicReductionSetCDir ( void *cyc_red_vdata, HYPRE_Int cdir ); +HYPRE_Int hypre_CyclicReductionSetBase ( void *cyc_red_vdata, hypre_Index base_index, + hypre_Index base_stride ); HYPRE_Int hypre_CyclicReductionDestroy ( void *cyc_red_vdata ); HYPRE_Int hypre_CyclicReductionSetMaxLevel( void *cyc_red_vdata, HYPRE_Int max_level ); @@ -47,33 +55,37 @@ HYPRE_Int hypre_Log2 ( HYPRE_Int p ); /* hybrid.c */ void *hypre_HybridCreate ( MPI_Comm comm ); HYPRE_Int hypre_HybridDestroy ( void *hybrid_vdata ); -HYPRE_Int hypre_HybridSetTol ( void *hybrid_vdata , HYPRE_Real tol ); -HYPRE_Int hypre_HybridSetConvergenceTol ( void *hybrid_vdata , HYPRE_Real cf_tol ); -HYPRE_Int hypre_HybridSetDSCGMaxIter ( void *hybrid_vdata , HYPRE_Int dscg_max_its ); -HYPRE_Int hypre_HybridSetPCGMaxIter ( void *hybrid_vdata , HYPRE_Int pcg_max_its ); -HYPRE_Int hypre_HybridSetPCGAbsoluteTolFactor ( void *hybrid_vdata , HYPRE_Real pcg_atolf ); -HYPRE_Int hypre_HybridSetTwoNorm ( void *hybrid_vdata , HYPRE_Int two_norm ); -HYPRE_Int hypre_HybridSetStopCrit ( void *hybrid_vdata , HYPRE_Int stop_crit ); -HYPRE_Int hypre_HybridSetRelChange ( void *hybrid_vdata , HYPRE_Int rel_change ); -HYPRE_Int hypre_HybridSetSolverType ( void *hybrid_vdata , HYPRE_Int solver_type ); -HYPRE_Int hypre_HybridSetRecomputeResidual( void *hybrid_vdata , HYPRE_Int recompute_residual ); -HYPRE_Int hypre_HybridGetRecomputeResidual( void *hybrid_vdata , HYPRE_Int *recompute_residual ); -HYPRE_Int hypre_HybridSetRecomputeResidualP( void *hybrid_vdata , HYPRE_Int recompute_residual_p ); -HYPRE_Int hypre_HybridGetRecomputeResidualP( void *hybrid_vdata , HYPRE_Int *recompute_residual_p ); -HYPRE_Int hypre_HybridSetKDim ( void *hybrid_vdata , HYPRE_Int k_dim ); -HYPRE_Int hypre_HybridSetPrecond ( void *pcg_vdata , HYPRE_Int (*pcg_precond_solve )(void*, void*, void*, void*), HYPRE_Int (*pcg_precond_setup )(void*, void*, void*, void*), void *pcg_precond ); -HYPRE_Int hypre_HybridSetLogging ( void *hybrid_vdata , HYPRE_Int logging ); -HYPRE_Int hypre_HybridSetPrintLevel ( void *hybrid_vdata , HYPRE_Int print_level ); -HYPRE_Int hypre_HybridGetNumIterations ( void *hybrid_vdata , HYPRE_Int *num_its ); -HYPRE_Int hypre_HybridGetDSCGNumIterations ( void *hybrid_vdata , HYPRE_Int *dscg_num_its ); -HYPRE_Int hypre_HybridGetPCGNumIterations ( void *hybrid_vdata , HYPRE_Int *pcg_num_its ); -HYPRE_Int hypre_HybridGetFinalRelativeResidualNorm ( void *hybrid_vdata , HYPRE_Real *final_rel_res_norm ); -HYPRE_Int hypre_HybridSetup ( void *hybrid_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); -HYPRE_Int hypre_HybridSolve ( void *hybrid_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); +HYPRE_Int hypre_HybridSetTol ( void *hybrid_vdata, HYPRE_Real tol ); +HYPRE_Int hypre_HybridSetConvergenceTol ( void *hybrid_vdata, HYPRE_Real cf_tol ); +HYPRE_Int hypre_HybridSetDSCGMaxIter ( void *hybrid_vdata, HYPRE_Int dscg_max_its ); +HYPRE_Int hypre_HybridSetPCGMaxIter ( void *hybrid_vdata, HYPRE_Int pcg_max_its ); +HYPRE_Int hypre_HybridSetPCGAbsoluteTolFactor ( void *hybrid_vdata, HYPRE_Real pcg_atolf ); +HYPRE_Int hypre_HybridSetTwoNorm ( void *hybrid_vdata, HYPRE_Int two_norm ); +HYPRE_Int hypre_HybridSetStopCrit ( void *hybrid_vdata, HYPRE_Int stop_crit ); +HYPRE_Int hypre_HybridSetRelChange ( void *hybrid_vdata, HYPRE_Int rel_change ); +HYPRE_Int hypre_HybridSetSolverType ( void *hybrid_vdata, HYPRE_Int solver_type ); +HYPRE_Int hypre_HybridSetRecomputeResidual( void *hybrid_vdata, HYPRE_Int recompute_residual ); +HYPRE_Int hypre_HybridGetRecomputeResidual( void *hybrid_vdata, HYPRE_Int *recompute_residual ); +HYPRE_Int hypre_HybridSetRecomputeResidualP( void *hybrid_vdata, HYPRE_Int recompute_residual_p ); +HYPRE_Int hypre_HybridGetRecomputeResidualP( void *hybrid_vdata, HYPRE_Int *recompute_residual_p ); +HYPRE_Int hypre_HybridSetKDim ( void *hybrid_vdata, HYPRE_Int k_dim ); +HYPRE_Int hypre_HybridSetPrecond ( void *pcg_vdata, HYPRE_Int (*pcg_precond_solve )(void*, void*, + void*, void*), HYPRE_Int (*pcg_precond_setup )(void*, void*, void*, void*), void *pcg_precond ); +HYPRE_Int hypre_HybridSetLogging ( void *hybrid_vdata, HYPRE_Int logging ); +HYPRE_Int hypre_HybridSetPrintLevel ( void *hybrid_vdata, HYPRE_Int print_level ); +HYPRE_Int hypre_HybridGetNumIterations ( void *hybrid_vdata, HYPRE_Int *num_its ); +HYPRE_Int hypre_HybridGetDSCGNumIterations ( void *hybrid_vdata, HYPRE_Int *dscg_num_its ); +HYPRE_Int hypre_HybridGetPCGNumIterations ( void *hybrid_vdata, HYPRE_Int *pcg_num_its ); +HYPRE_Int hypre_HybridGetFinalRelativeResidualNorm ( void *hybrid_vdata, + HYPRE_Real *final_rel_res_norm ); +HYPRE_Int hypre_HybridSetup ( void *hybrid_vdata, hypre_StructMatrix *A, hypre_StructVector *b, + hypre_StructVector *x ); +HYPRE_Int hypre_HybridSolve ( void *hybrid_vdata, hypre_StructMatrix *A, hypre_StructVector *b, + hypre_StructVector *x ); /* HYPRE_struct_int.c */ -HYPRE_Int hypre_StructVectorSetRandomValues ( hypre_StructVector *vector , HYPRE_Int seed ); -HYPRE_Int hypre_StructSetRandomValues ( void *v , HYPRE_Int seed ); +HYPRE_Int hypre_StructVectorSetRandomValues ( hypre_StructVector *vector, HYPRE_Int seed ); +HYPRE_Int hypre_StructSetRandomValues ( void *v, HYPRE_Int seed ); /* HYPRE_struct_pfmg.c */ HYPRE_Int hypre_PFMGSetDeviceLevel( void *pfmg_vdata, HYPRE_Int device_level ); @@ -81,257 +93,405 @@ HYPRE_Int hypre_PFMGSetDeviceLevel( void *pfmg_vdata, HYPRE_Int device_level /* jacobi.c */ void *hypre_JacobiCreate ( MPI_Comm comm ); HYPRE_Int hypre_JacobiDestroy ( void *jacobi_vdata ); -HYPRE_Int hypre_JacobiSetup ( void *jacobi_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); -HYPRE_Int hypre_JacobiSolve ( void *jacobi_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); -HYPRE_Int hypre_JacobiSetTol ( void *jacobi_vdata , HYPRE_Real tol ); -HYPRE_Int hypre_JacobiGetTol ( void *jacobi_vdata , HYPRE_Real *tol ); -HYPRE_Int hypre_JacobiSetMaxIter ( void *jacobi_vdata , HYPRE_Int max_iter ); -HYPRE_Int hypre_JacobiGetMaxIter ( void *jacobi_vdata , HYPRE_Int *max_iter ); -HYPRE_Int hypre_JacobiSetZeroGuess ( void *jacobi_vdata , HYPRE_Int zero_guess ); -HYPRE_Int hypre_JacobiGetZeroGuess ( void *jacobi_vdata , HYPRE_Int *zero_guess ); -HYPRE_Int hypre_JacobiGetNumIterations ( void *jacobi_vdata , HYPRE_Int *num_iterations ); -HYPRE_Int hypre_JacobiSetTempVec ( void *jacobi_vdata , hypre_StructVector *t ); -HYPRE_Int hypre_JacobiGetFinalRelativeResidualNorm ( void *jacobi_vdata , HYPRE_Real *norm ); +HYPRE_Int hypre_JacobiSetup ( void *jacobi_vdata, hypre_StructMatrix *A, hypre_StructVector *b, + hypre_StructVector *x ); +HYPRE_Int hypre_JacobiSolve ( void *jacobi_vdata, hypre_StructMatrix *A, hypre_StructVector *b, + hypre_StructVector *x ); +HYPRE_Int hypre_JacobiSetTol ( void *jacobi_vdata, HYPRE_Real tol ); +HYPRE_Int hypre_JacobiGetTol ( void *jacobi_vdata, HYPRE_Real *tol ); +HYPRE_Int hypre_JacobiSetMaxIter ( void *jacobi_vdata, HYPRE_Int max_iter ); +HYPRE_Int hypre_JacobiGetMaxIter ( void *jacobi_vdata, HYPRE_Int *max_iter ); +HYPRE_Int hypre_JacobiSetZeroGuess ( void *jacobi_vdata, HYPRE_Int zero_guess ); +HYPRE_Int hypre_JacobiGetZeroGuess ( void *jacobi_vdata, HYPRE_Int *zero_guess ); +HYPRE_Int hypre_JacobiGetNumIterations ( void *jacobi_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int hypre_JacobiSetTempVec ( void *jacobi_vdata, hypre_StructVector *t ); +HYPRE_Int hypre_JacobiGetFinalRelativeResidualNorm ( void *jacobi_vdata, HYPRE_Real *norm ); /* pcg_struct.c */ void *hypre_StructKrylovCAlloc ( size_t count, size_t elt_size, HYPRE_MemoryLocation location ); HYPRE_Int hypre_StructKrylovFree ( void *ptr ); void *hypre_StructKrylovCreateVector ( void *vvector ); -void *hypre_StructKrylovCreateVectorArray ( HYPRE_Int n , void *vvector ); +void *hypre_StructKrylovCreateVectorArray ( HYPRE_Int n, void *vvector ); HYPRE_Int hypre_StructKrylovDestroyVector ( void *vvector ); -void *hypre_StructKrylovMatvecCreate ( void *A , void *x ); -HYPRE_Int hypre_StructKrylovMatvec ( void *matvec_data , HYPRE_Complex alpha , void *A , void *x , HYPRE_Complex beta , void *y ); +void *hypre_StructKrylovMatvecCreate ( void *A, void *x ); +HYPRE_Int hypre_StructKrylovMatvec ( void *matvec_data, HYPRE_Complex alpha, void *A, void *x, + HYPRE_Complex beta, void *y ); HYPRE_Int hypre_StructKrylovMatvecDestroy ( void *matvec_data ); -HYPRE_Real hypre_StructKrylovInnerProd ( void *x , void *y ); -HYPRE_Int hypre_StructKrylovCopyVector ( void *x , void *y ); +HYPRE_Real hypre_StructKrylovInnerProd ( void *x, void *y ); +HYPRE_Int hypre_StructKrylovCopyVector ( void *x, void *y ); HYPRE_Int hypre_StructKrylovClearVector ( void *x ); -HYPRE_Int hypre_StructKrylovScaleVector ( HYPRE_Complex alpha , void *x ); -HYPRE_Int hypre_StructKrylovAxpy ( HYPRE_Complex alpha , void *x , void *y ); -HYPRE_Int hypre_StructKrylovIdentitySetup ( void *vdata , void *A , void *b , void *x ); -HYPRE_Int hypre_StructKrylovIdentity ( void *vdata , void *A , void *b , void *x ); -HYPRE_Int hypre_StructKrylovCommInfo ( void *A , HYPRE_Int *my_id , HYPRE_Int *num_procs ); +HYPRE_Int hypre_StructKrylovScaleVector ( HYPRE_Complex alpha, void *x ); +HYPRE_Int hypre_StructKrylovAxpy ( HYPRE_Complex alpha, void *x, void *y ); +HYPRE_Int hypre_StructKrylovIdentitySetup ( void *vdata, void *A, void *b, void *x ); +HYPRE_Int hypre_StructKrylovIdentity ( void *vdata, void *A, void *b, void *x ); +HYPRE_Int hypre_StructKrylovCommInfo ( void *A, HYPRE_Int *my_id, HYPRE_Int *num_procs ); /* pfmg2_setup_rap.c */ -hypre_StructMatrix *hypre_PFMG2CreateRAPOp ( hypre_StructMatrix *R , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructGrid *coarse_grid , HYPRE_Int cdir ); -HYPRE_Int hypre_PFMG2BuildRAPSym ( hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMG2BuildRAPSym_onebox_FSS5_CC0 ( HYPRE_Int ci , HYPRE_Int fi , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMG2BuildRAPSym_onebox_FSS5_CC1 ( HYPRE_Int ci , HYPRE_Int fi , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMG2BuildRAPSym_onebox_FSS9_CC0 ( HYPRE_Int ci , HYPRE_Int fi , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMG2BuildRAPSym_onebox_FSS9_CC1 ( HYPRE_Int ci , HYPRE_Int fi , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMG2BuildRAPNoSym ( hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMG2BuildRAPNoSym_onebox_FSS5_CC0 ( HYPRE_Int ci , HYPRE_Int fi , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMG2BuildRAPNoSym_onebox_FSS5_CC1 ( HYPRE_Int ci , HYPRE_Int fi , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMG2BuildRAPNoSym_onebox_FSS9_CC0 ( HYPRE_Int ci , HYPRE_Int fi , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMG2BuildRAPNoSym_onebox_FSS9_CC1 ( HYPRE_Int ci , HYPRE_Int fi , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); +hypre_StructMatrix *hypre_PFMG2CreateRAPOp ( hypre_StructMatrix *R, hypre_StructMatrix *A, + hypre_StructMatrix *P, hypre_StructGrid *coarse_grid, HYPRE_Int cdir ); +HYPRE_Int hypre_PFMG2BuildRAPSym ( hypre_StructMatrix *A, hypre_StructMatrix *P, + hypre_StructMatrix *R, HYPRE_Int cdir, hypre_Index cindex, hypre_Index cstride, + hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMG2BuildRAPSym_onebox_FSS5_CC0 ( HYPRE_Int ci, HYPRE_Int fi, + hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, + hypre_Index cindex, hypre_Index cstride, hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMG2BuildRAPSym_onebox_FSS5_CC1 ( HYPRE_Int ci, HYPRE_Int fi, + hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, + hypre_Index cindex, hypre_Index cstride, hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMG2BuildRAPSym_onebox_FSS9_CC0 ( HYPRE_Int ci, HYPRE_Int fi, + hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, + hypre_Index cindex, hypre_Index cstride, hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMG2BuildRAPSym_onebox_FSS9_CC1 ( HYPRE_Int ci, HYPRE_Int fi, + hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, + hypre_Index cindex, hypre_Index cstride, hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMG2BuildRAPNoSym ( hypre_StructMatrix *A, hypre_StructMatrix *P, + hypre_StructMatrix *R, HYPRE_Int cdir, hypre_Index cindex, hypre_Index cstride, + hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMG2BuildRAPNoSym_onebox_FSS5_CC0 ( HYPRE_Int ci, HYPRE_Int fi, + hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, + hypre_Index cindex, hypre_Index cstride, hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMG2BuildRAPNoSym_onebox_FSS5_CC1 ( HYPRE_Int ci, HYPRE_Int fi, + hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, + hypre_Index cindex, hypre_Index cstride, hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMG2BuildRAPNoSym_onebox_FSS9_CC0 ( HYPRE_Int ci, HYPRE_Int fi, + hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, + hypre_Index cindex, hypre_Index cstride, hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMG2BuildRAPNoSym_onebox_FSS9_CC1 ( HYPRE_Int ci, HYPRE_Int fi, + hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, + hypre_Index cindex, hypre_Index cstride, hypre_StructMatrix *RAP ); /* pfmg3_setup_rap.c */ -hypre_StructMatrix *hypre_PFMG3CreateRAPOp ( hypre_StructMatrix *R , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructGrid *coarse_grid , HYPRE_Int cdir ); -HYPRE_Int hypre_PFMG3BuildRAPSym ( hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMG3BuildRAPSym_onebox_FSS07_CC0 ( HYPRE_Int ci , HYPRE_Int fi , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMG3BuildRAPSym_onebox_FSS07_CC1 ( HYPRE_Int ci , HYPRE_Int fi , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMG3BuildRAPSym_onebox_FSS19_CC0 ( HYPRE_Int ci , HYPRE_Int fi , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMG3BuildRAPSym_onebox_FSS19_CC1 ( HYPRE_Int ci , HYPRE_Int fi , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMG3BuildRAPSym_onebox_FSS27_CC0 ( HYPRE_Int ci , HYPRE_Int fi , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMG3BuildRAPSym_onebox_FSS27_CC1 ( HYPRE_Int ci , HYPRE_Int fi , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMG3BuildRAPNoSym ( hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMG3BuildRAPNoSym_onebox_FSS07_CC0 ( HYPRE_Int ci , HYPRE_Int fi , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMG3BuildRAPNoSym_onebox_FSS07_CC1 ( HYPRE_Int ci , HYPRE_Int fi , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMG3BuildRAPNoSym_onebox_FSS19_CC0 ( HYPRE_Int ci , HYPRE_Int fi , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMG3BuildRAPNoSym_onebox_FSS19_CC1 ( HYPRE_Int ci , HYPRE_Int fi , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMG3BuildRAPNoSym_onebox_FSS27_CC0 ( HYPRE_Int ci , HYPRE_Int fi , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMG3BuildRAPNoSym_onebox_FSS27_CC1 ( HYPRE_Int ci , HYPRE_Int fi , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); +hypre_StructMatrix *hypre_PFMG3CreateRAPOp ( hypre_StructMatrix *R, hypre_StructMatrix *A, + hypre_StructMatrix *P, hypre_StructGrid *coarse_grid, HYPRE_Int cdir ); +HYPRE_Int hypre_PFMG3BuildRAPSym ( hypre_StructMatrix *A, hypre_StructMatrix *P, + hypre_StructMatrix *R, HYPRE_Int cdir, hypre_Index cindex, hypre_Index cstride, + hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMG3BuildRAPSym_onebox_FSS07_CC0 ( HYPRE_Int ci, HYPRE_Int fi, + hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, + hypre_Index cindex, hypre_Index cstride, hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMG3BuildRAPSym_onebox_FSS07_CC1 ( HYPRE_Int ci, HYPRE_Int fi, + hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, + hypre_Index cindex, hypre_Index cstride, hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMG3BuildRAPSym_onebox_FSS19_CC0 ( HYPRE_Int ci, HYPRE_Int fi, + hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, + hypre_Index cindex, hypre_Index cstride, hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMG3BuildRAPSym_onebox_FSS19_CC1 ( HYPRE_Int ci, HYPRE_Int fi, + hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, + hypre_Index cindex, hypre_Index cstride, hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMG3BuildRAPSym_onebox_FSS27_CC0 ( HYPRE_Int ci, HYPRE_Int fi, + hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, + hypre_Index cindex, hypre_Index cstride, hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMG3BuildRAPSym_onebox_FSS27_CC1 ( HYPRE_Int ci, HYPRE_Int fi, + hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, + hypre_Index cindex, hypre_Index cstride, hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMG3BuildRAPNoSym ( hypre_StructMatrix *A, hypre_StructMatrix *P, + hypre_StructMatrix *R, HYPRE_Int cdir, hypre_Index cindex, hypre_Index cstride, + hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMG3BuildRAPNoSym_onebox_FSS07_CC0 ( HYPRE_Int ci, HYPRE_Int fi, + hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, + hypre_Index cindex, hypre_Index cstride, hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMG3BuildRAPNoSym_onebox_FSS07_CC1 ( HYPRE_Int ci, HYPRE_Int fi, + hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, + hypre_Index cindex, hypre_Index cstride, hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMG3BuildRAPNoSym_onebox_FSS19_CC0 ( HYPRE_Int ci, HYPRE_Int fi, + hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, + hypre_Index cindex, hypre_Index cstride, hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMG3BuildRAPNoSym_onebox_FSS19_CC1 ( HYPRE_Int ci, HYPRE_Int fi, + hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, + hypre_Index cindex, hypre_Index cstride, hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMG3BuildRAPNoSym_onebox_FSS27_CC0 ( HYPRE_Int ci, HYPRE_Int fi, + hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, + hypre_Index cindex, hypre_Index cstride, hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMG3BuildRAPNoSym_onebox_FSS27_CC1 ( HYPRE_Int ci, HYPRE_Int fi, + hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, + hypre_Index cindex, hypre_Index cstride, hypre_StructMatrix *RAP ); /* pfmg.c */ void *hypre_PFMGCreate ( MPI_Comm comm ); HYPRE_Int hypre_PFMGDestroy ( void *pfmg_vdata ); -HYPRE_Int hypre_PFMGSetTol ( void *pfmg_vdata , HYPRE_Real tol ); -HYPRE_Int hypre_PFMGGetTol ( void *pfmg_vdata , HYPRE_Real *tol ); -HYPRE_Int hypre_PFMGSetMaxIter ( void *pfmg_vdata , HYPRE_Int max_iter ); -HYPRE_Int hypre_PFMGGetMaxIter ( void *pfmg_vdata , HYPRE_Int *max_iter ); -HYPRE_Int hypre_PFMGSetMaxLevels ( void *pfmg_vdata , HYPRE_Int max_levels ); -HYPRE_Int hypre_PFMGGetMaxLevels ( void *pfmg_vdata , HYPRE_Int *max_levels ); -HYPRE_Int hypre_PFMGSetRelChange ( void *pfmg_vdata , HYPRE_Int rel_change ); -HYPRE_Int hypre_PFMGGetRelChange ( void *pfmg_vdata , HYPRE_Int *rel_change ); -HYPRE_Int hypre_PFMGSetZeroGuess ( void *pfmg_vdata , HYPRE_Int zero_guess ); -HYPRE_Int hypre_PFMGGetZeroGuess ( void *pfmg_vdata , HYPRE_Int *zero_guess ); -HYPRE_Int hypre_PFMGSetRelaxType ( void *pfmg_vdata , HYPRE_Int relax_type ); -HYPRE_Int hypre_PFMGGetRelaxType ( void *pfmg_vdata , HYPRE_Int *relax_type ); -HYPRE_Int hypre_PFMGSetJacobiWeight ( void *pfmg_vdata , HYPRE_Real weight ); -HYPRE_Int hypre_PFMGGetJacobiWeight ( void *pfmg_vdata , HYPRE_Real *weight ); -HYPRE_Int hypre_PFMGSetRAPType ( void *pfmg_vdata , HYPRE_Int rap_type ); -HYPRE_Int hypre_PFMGGetRAPType ( void *pfmg_vdata , HYPRE_Int *rap_type ); -HYPRE_Int hypre_PFMGSetNumPreRelax ( void *pfmg_vdata , HYPRE_Int num_pre_relax ); -HYPRE_Int hypre_PFMGGetNumPreRelax ( void *pfmg_vdata , HYPRE_Int *num_pre_relax ); -HYPRE_Int hypre_PFMGSetNumPostRelax ( void *pfmg_vdata , HYPRE_Int num_post_relax ); -HYPRE_Int hypre_PFMGGetNumPostRelax ( void *pfmg_vdata , HYPRE_Int *num_post_relax ); -HYPRE_Int hypre_PFMGSetSkipRelax ( void *pfmg_vdata , HYPRE_Int skip_relax ); -HYPRE_Int hypre_PFMGGetSkipRelax ( void *pfmg_vdata , HYPRE_Int *skip_relax ); -HYPRE_Int hypre_PFMGSetDxyz ( void *pfmg_vdata , HYPRE_Real *dxyz ); -HYPRE_Int hypre_PFMGSetLogging ( void *pfmg_vdata , HYPRE_Int logging ); -HYPRE_Int hypre_PFMGGetLogging ( void *pfmg_vdata , HYPRE_Int *logging ); -HYPRE_Int hypre_PFMGSetPrintLevel ( void *pfmg_vdata , HYPRE_Int print_level ); -HYPRE_Int hypre_PFMGGetPrintLevel ( void *pfmg_vdata , HYPRE_Int *print_level ); -HYPRE_Int hypre_PFMGGetNumIterations ( void *pfmg_vdata , HYPRE_Int *num_iterations ); -HYPRE_Int hypre_PFMGPrintLogging ( void *pfmg_vdata , HYPRE_Int myid ); -HYPRE_Int hypre_PFMGGetFinalRelativeResidualNorm ( void *pfmg_vdata , HYPRE_Real *relative_residual_norm ); +HYPRE_Int hypre_PFMGSetTol ( void *pfmg_vdata, HYPRE_Real tol ); +HYPRE_Int hypre_PFMGGetTol ( void *pfmg_vdata, HYPRE_Real *tol ); +HYPRE_Int hypre_PFMGSetMaxIter ( void *pfmg_vdata, HYPRE_Int max_iter ); +HYPRE_Int hypre_PFMGGetMaxIter ( void *pfmg_vdata, HYPRE_Int *max_iter ); +HYPRE_Int hypre_PFMGSetMaxLevels ( void *pfmg_vdata, HYPRE_Int max_levels ); +HYPRE_Int hypre_PFMGGetMaxLevels ( void *pfmg_vdata, HYPRE_Int *max_levels ); +HYPRE_Int hypre_PFMGSetRelChange ( void *pfmg_vdata, HYPRE_Int rel_change ); +HYPRE_Int hypre_PFMGGetRelChange ( void *pfmg_vdata, HYPRE_Int *rel_change ); +HYPRE_Int hypre_PFMGSetZeroGuess ( void *pfmg_vdata, HYPRE_Int zero_guess ); +HYPRE_Int hypre_PFMGGetZeroGuess ( void *pfmg_vdata, HYPRE_Int *zero_guess ); +HYPRE_Int hypre_PFMGSetRelaxType ( void *pfmg_vdata, HYPRE_Int relax_type ); +HYPRE_Int hypre_PFMGGetRelaxType ( void *pfmg_vdata, HYPRE_Int *relax_type ); +HYPRE_Int hypre_PFMGSetJacobiWeight ( void *pfmg_vdata, HYPRE_Real weight ); +HYPRE_Int hypre_PFMGGetJacobiWeight ( void *pfmg_vdata, HYPRE_Real *weight ); +HYPRE_Int hypre_PFMGSetRAPType ( void *pfmg_vdata, HYPRE_Int rap_type ); +HYPRE_Int hypre_PFMGGetRAPType ( void *pfmg_vdata, HYPRE_Int *rap_type ); +HYPRE_Int hypre_PFMGSetNumPreRelax ( void *pfmg_vdata, HYPRE_Int num_pre_relax ); +HYPRE_Int hypre_PFMGGetNumPreRelax ( void *pfmg_vdata, HYPRE_Int *num_pre_relax ); +HYPRE_Int hypre_PFMGSetNumPostRelax ( void *pfmg_vdata, HYPRE_Int num_post_relax ); +HYPRE_Int hypre_PFMGGetNumPostRelax ( void *pfmg_vdata, HYPRE_Int *num_post_relax ); +HYPRE_Int hypre_PFMGSetSkipRelax ( void *pfmg_vdata, HYPRE_Int skip_relax ); +HYPRE_Int hypre_PFMGGetSkipRelax ( void *pfmg_vdata, HYPRE_Int *skip_relax ); +HYPRE_Int hypre_PFMGSetDxyz ( void *pfmg_vdata, HYPRE_Real *dxyz ); +HYPRE_Int hypre_PFMGSetLogging ( void *pfmg_vdata, HYPRE_Int logging ); +HYPRE_Int hypre_PFMGGetLogging ( void *pfmg_vdata, HYPRE_Int *logging ); +HYPRE_Int hypre_PFMGSetPrintLevel ( void *pfmg_vdata, HYPRE_Int print_level ); +HYPRE_Int hypre_PFMGGetPrintLevel ( void *pfmg_vdata, HYPRE_Int *print_level ); +HYPRE_Int hypre_PFMGGetNumIterations ( void *pfmg_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int hypre_PFMGPrintLogging ( void *pfmg_vdata, HYPRE_Int myid ); +HYPRE_Int hypre_PFMGGetFinalRelativeResidualNorm ( void *pfmg_vdata, + HYPRE_Real *relative_residual_norm ); /* pfmg_relax.c */ void *hypre_PFMGRelaxCreate ( MPI_Comm comm ); HYPRE_Int hypre_PFMGRelaxDestroy ( void *pfmg_relax_vdata ); -HYPRE_Int hypre_PFMGRelax ( void *pfmg_relax_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); -HYPRE_Int hypre_PFMGRelaxSetup ( void *pfmg_relax_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); -HYPRE_Int hypre_PFMGRelaxSetType ( void *pfmg_relax_vdata , HYPRE_Int relax_type ); -HYPRE_Int hypre_PFMGRelaxSetJacobiWeight ( void *pfmg_relax_vdata , HYPRE_Real weight ); +HYPRE_Int hypre_PFMGRelax ( void *pfmg_relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, + hypre_StructVector *x ); +HYPRE_Int hypre_PFMGRelaxSetup ( void *pfmg_relax_vdata, hypre_StructMatrix *A, + hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int hypre_PFMGRelaxSetType ( void *pfmg_relax_vdata, HYPRE_Int relax_type ); +HYPRE_Int hypre_PFMGRelaxSetJacobiWeight ( void *pfmg_relax_vdata, HYPRE_Real weight ); HYPRE_Int hypre_PFMGRelaxSetPreRelax ( void *pfmg_relax_vdata ); HYPRE_Int hypre_PFMGRelaxSetPostRelax ( void *pfmg_relax_vdata ); -HYPRE_Int hypre_PFMGRelaxSetTol ( void *pfmg_relax_vdata , HYPRE_Real tol ); -HYPRE_Int hypre_PFMGRelaxSetMaxIter ( void *pfmg_relax_vdata , HYPRE_Int max_iter ); -HYPRE_Int hypre_PFMGRelaxSetZeroGuess ( void *pfmg_relax_vdata , HYPRE_Int zero_guess ); -HYPRE_Int hypre_PFMGRelaxSetTempVec ( void *pfmg_relax_vdata , hypre_StructVector *t ); +HYPRE_Int hypre_PFMGRelaxSetTol ( void *pfmg_relax_vdata, HYPRE_Real tol ); +HYPRE_Int hypre_PFMGRelaxSetMaxIter ( void *pfmg_relax_vdata, HYPRE_Int max_iter ); +HYPRE_Int hypre_PFMGRelaxSetZeroGuess ( void *pfmg_relax_vdata, HYPRE_Int zero_guess ); +HYPRE_Int hypre_PFMGRelaxSetTempVec ( void *pfmg_relax_vdata, hypre_StructVector *t ); /* pfmg_setup.c */ -HYPRE_Int hypre_PFMGSetup ( void *pfmg_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); -HYPRE_Int hypre_PFMGComputeDxyz ( hypre_StructMatrix *A , HYPRE_Real *dxyz , HYPRE_Real *mean, HYPRE_Real *deviation); -HYPRE_Int hypre_PFMGComputeDxyz_CS ( HYPRE_Int bi, hypre_StructMatrix *A, HYPRE_Real *cxyz, HYPRE_Real *sqcxyz); -HYPRE_Int hypre_PFMGComputeDxyz_SS5 ( HYPRE_Int bi, hypre_StructMatrix *A, HYPRE_Real *cxyz, HYPRE_Real *sqcxyz); -HYPRE_Int hypre_PFMGComputeDxyz_SS9 ( HYPRE_Int bi, hypre_StructMatrix *A, HYPRE_Real *cxyz, HYPRE_Real *sqcxyz); -HYPRE_Int hypre_PFMGComputeDxyz_SS7 ( HYPRE_Int bi, hypre_StructMatrix *A, HYPRE_Real *cxyz, HYPRE_Real *sqcxyz); -HYPRE_Int hypre_PFMGComputeDxyz_SS19( HYPRE_Int bi, hypre_StructMatrix *A, HYPRE_Real *cxyz, HYPRE_Real *sqcxyz); -HYPRE_Int hypre_PFMGComputeDxyz_SS27( HYPRE_Int bi, hypre_StructMatrix *A, HYPRE_Real *cxyz, HYPRE_Real *sqcxyz); +HYPRE_Int hypre_PFMGSetup ( void *pfmg_vdata, hypre_StructMatrix *A, hypre_StructVector *b, + hypre_StructVector *x ); +HYPRE_Int hypre_PFMGComputeDxyz ( hypre_StructMatrix *A, HYPRE_Real *dxyz, HYPRE_Real *mean, + HYPRE_Real *deviation); +HYPRE_Int hypre_PFMGComputeDxyz_CS ( HYPRE_Int bi, hypre_StructMatrix *A, HYPRE_Real *cxyz, + HYPRE_Real *sqcxyz); +HYPRE_Int hypre_PFMGComputeDxyz_SS5 ( HYPRE_Int bi, hypre_StructMatrix *A, HYPRE_Real *cxyz, + HYPRE_Real *sqcxyz); +HYPRE_Int hypre_PFMGComputeDxyz_SS9 ( HYPRE_Int bi, hypre_StructMatrix *A, HYPRE_Real *cxyz, + HYPRE_Real *sqcxyz); +HYPRE_Int hypre_PFMGComputeDxyz_SS7 ( HYPRE_Int bi, hypre_StructMatrix *A, HYPRE_Real *cxyz, + HYPRE_Real *sqcxyz); +HYPRE_Int hypre_PFMGComputeDxyz_SS19( HYPRE_Int bi, hypre_StructMatrix *A, HYPRE_Real *cxyz, + HYPRE_Real *sqcxyz); +HYPRE_Int hypre_PFMGComputeDxyz_SS27( HYPRE_Int bi, hypre_StructMatrix *A, HYPRE_Real *cxyz, + HYPRE_Real *sqcxyz); HYPRE_Int hypre_ZeroDiagonal ( hypre_StructMatrix *A ); /* pfmg_setup_interp.c */ -hypre_StructMatrix *hypre_PFMGCreateInterpOp ( hypre_StructMatrix *A , hypre_StructGrid *cgrid , HYPRE_Int cdir , HYPRE_Int rap_type ); -HYPRE_Int hypre_PFMGSetupInterpOp ( hypre_StructMatrix *A , HYPRE_Int cdir , hypre_Index findex , hypre_Index stride , hypre_StructMatrix *P , HYPRE_Int rap_type ); -HYPRE_Int hypre_PFMGSetupInterpOp_CC0 ( HYPRE_Int i , hypre_StructMatrix *A , hypre_Box *A_dbox , HYPRE_Int cdir , hypre_Index stride , hypre_Index stridec , hypre_Index start , hypre_IndexRef startc , hypre_Index loop_size , hypre_Box *P_dbox , HYPRE_Int Pstenc0 , HYPRE_Int Pstenc1 , HYPRE_Real *Pp0 , HYPRE_Real *Pp1 , HYPRE_Int rap_type , HYPRE_Int si0 , HYPRE_Int si1 ); -HYPRE_Int hypre_PFMGSetupInterpOp_CC1 ( HYPRE_Int i , hypre_StructMatrix *A , hypre_Box *A_dbox , HYPRE_Int cdir , hypre_Index stride , hypre_Index stridec , hypre_Index start , hypre_IndexRef startc , hypre_Index loop_size , hypre_Box *P_dbox , HYPRE_Int Pstenc0 , HYPRE_Int Pstenc1 , HYPRE_Real *Pp0 , HYPRE_Real *Pp1 , HYPRE_Int rap_type , HYPRE_Int si0 , HYPRE_Int si1 ); -HYPRE_Int hypre_PFMGSetupInterpOp_CC2 ( HYPRE_Int i , hypre_StructMatrix *A , hypre_Box *A_dbox , HYPRE_Int cdir , hypre_Index stride , hypre_Index stridec , hypre_Index start , hypre_IndexRef startc , hypre_Index loop_size , hypre_Box *P_dbox , HYPRE_Int Pstenc0 , HYPRE_Int Pstenc1 , HYPRE_Real *Pp0 , HYPRE_Real *Pp1 , HYPRE_Int rap_type , HYPRE_Int si0 , HYPRE_Int si1 ); -HYPRE_Int hypre_PFMGSetupInterpOp_CC0_SS5 ( HYPRE_Int i , hypre_StructMatrix *A , hypre_Box *A_dbox , HYPRE_Int cdir , hypre_Index stride , hypre_Index stridec , hypre_Index start , hypre_IndexRef startc , hypre_Index loop_size , hypre_Box *P_dbox , HYPRE_Int Pstenc0 , HYPRE_Int Pstenc1 , HYPRE_Real *Pp0 , HYPRE_Real *Pp1 , HYPRE_Int rap_type , hypre_Index *P_stencil_shape ); -HYPRE_Int hypre_PFMGSetupInterpOp_CC0_SS9 ( HYPRE_Int i , hypre_StructMatrix *A , hypre_Box *A_dbox , HYPRE_Int cdir , hypre_Index stride , hypre_Index stridec , hypre_Index start , hypre_IndexRef startc , hypre_Index loop_size , hypre_Box *P_dbox , HYPRE_Int Pstenc0 , HYPRE_Int Pstenc1 , HYPRE_Real *Pp0 , HYPRE_Real *Pp1 , HYPRE_Int rap_type , hypre_Index *P_stencil_shape ); -HYPRE_Int hypre_PFMGSetupInterpOp_CC0_SS7 ( HYPRE_Int i , hypre_StructMatrix *A , hypre_Box *A_dbox , HYPRE_Int cdir , hypre_Index stride , hypre_Index stridec , hypre_Index start , hypre_IndexRef startc , hypre_Index loop_size , hypre_Box *P_dbox , HYPRE_Int Pstenc0 , HYPRE_Int Pstenc1 , HYPRE_Real *Pp0 , HYPRE_Real *Pp1 , HYPRE_Int rap_type , hypre_Index *P_stencil_shape ); - -HYPRE_Int hypre_PFMGSetupInterpOp_CC0_SS15 ( HYPRE_Int i , hypre_StructMatrix *A , hypre_Box *A_dbox , HYPRE_Int cdir , hypre_Index stride , hypre_Index stridec , hypre_Index start , hypre_IndexRef startc , hypre_Index loop_size , hypre_Box *P_dbox , HYPRE_Int Pstenc0 , HYPRE_Int Pstenc1 , HYPRE_Real *Pp0 , HYPRE_Real *Pp1 , HYPRE_Int rap_type , hypre_Index *P_stencil_shape ); - -HYPRE_Int hypre_PFMGSetupInterpOp_CC0_SS19 ( HYPRE_Int i , hypre_StructMatrix *A , hypre_Box *A_dbox , HYPRE_Int cdir , hypre_Index stride , hypre_Index stridec , hypre_Index start , hypre_IndexRef startc , hypre_Index loop_size , hypre_Box *P_dbox , HYPRE_Int Pstenc0 , HYPRE_Int Pstenc1 , HYPRE_Real *Pp0 , HYPRE_Real *Pp1 , HYPRE_Int rap_type , hypre_Index *P_stencil_shape ); - -HYPRE_Int hypre_PFMGSetupInterpOp_CC0_SS27 ( HYPRE_Int i , hypre_StructMatrix *A , hypre_Box *A_dbox , HYPRE_Int cdir , hypre_Index stride , hypre_Index stridec , hypre_Index start , hypre_IndexRef startc , hypre_Index loop_size , hypre_Box *P_dbox , HYPRE_Int Pstenc0 , HYPRE_Int Pstenc1 , HYPRE_Real *Pp0 , HYPRE_Real *Pp1 , HYPRE_Int rap_type , hypre_Index *P_stencil_shape ); +hypre_StructMatrix *hypre_PFMGCreateInterpOp ( hypre_StructMatrix *A, hypre_StructGrid *cgrid, + HYPRE_Int cdir, HYPRE_Int rap_type ); +HYPRE_Int hypre_PFMGSetupInterpOp ( hypre_StructMatrix *A, HYPRE_Int cdir, hypre_Index findex, + hypre_Index stride, hypre_StructMatrix *P, HYPRE_Int rap_type ); +HYPRE_Int hypre_PFMGSetupInterpOp_CC0 ( HYPRE_Int i, hypre_StructMatrix *A, hypre_Box *A_dbox, + HYPRE_Int cdir, hypre_Index stride, hypre_Index stridec, hypre_Index start, hypre_IndexRef startc, + hypre_Index loop_size, hypre_Box *P_dbox, HYPRE_Int Pstenc0, HYPRE_Int Pstenc1, HYPRE_Real *Pp0, + HYPRE_Real *Pp1, HYPRE_Int rap_type, HYPRE_Int si0, HYPRE_Int si1 ); +HYPRE_Int hypre_PFMGSetupInterpOp_CC1 ( HYPRE_Int i, hypre_StructMatrix *A, hypre_Box *A_dbox, + HYPRE_Int cdir, hypre_Index stride, hypre_Index stridec, hypre_Index start, hypre_IndexRef startc, + hypre_Index loop_size, hypre_Box *P_dbox, HYPRE_Int Pstenc0, HYPRE_Int Pstenc1, HYPRE_Real *Pp0, + HYPRE_Real *Pp1, HYPRE_Int rap_type, HYPRE_Int si0, HYPRE_Int si1 ); +HYPRE_Int hypre_PFMGSetupInterpOp_CC2 ( HYPRE_Int i, hypre_StructMatrix *A, hypre_Box *A_dbox, + HYPRE_Int cdir, hypre_Index stride, hypre_Index stridec, hypre_Index start, hypre_IndexRef startc, + hypre_Index loop_size, hypre_Box *P_dbox, HYPRE_Int Pstenc0, HYPRE_Int Pstenc1, HYPRE_Real *Pp0, + HYPRE_Real *Pp1, HYPRE_Int rap_type, HYPRE_Int si0, HYPRE_Int si1 ); +HYPRE_Int hypre_PFMGSetupInterpOp_CC0_SS5 ( HYPRE_Int i, hypre_StructMatrix *A, hypre_Box *A_dbox, + HYPRE_Int cdir, hypre_Index stride, hypre_Index stridec, hypre_Index start, hypre_IndexRef startc, + hypre_Index loop_size, hypre_Box *P_dbox, HYPRE_Int Pstenc0, HYPRE_Int Pstenc1, HYPRE_Real *Pp0, + HYPRE_Real *Pp1, HYPRE_Int rap_type, hypre_Index *P_stencil_shape ); +HYPRE_Int hypre_PFMGSetupInterpOp_CC0_SS9 ( HYPRE_Int i, hypre_StructMatrix *A, hypre_Box *A_dbox, + HYPRE_Int cdir, hypre_Index stride, hypre_Index stridec, hypre_Index start, hypre_IndexRef startc, + hypre_Index loop_size, hypre_Box *P_dbox, HYPRE_Int Pstenc0, HYPRE_Int Pstenc1, HYPRE_Real *Pp0, + HYPRE_Real *Pp1, HYPRE_Int rap_type, hypre_Index *P_stencil_shape ); +HYPRE_Int hypre_PFMGSetupInterpOp_CC0_SS7 ( HYPRE_Int i, hypre_StructMatrix *A, hypre_Box *A_dbox, + HYPRE_Int cdir, hypre_Index stride, hypre_Index stridec, hypre_Index start, hypre_IndexRef startc, + hypre_Index loop_size, hypre_Box *P_dbox, HYPRE_Int Pstenc0, HYPRE_Int Pstenc1, HYPRE_Real *Pp0, + HYPRE_Real *Pp1, HYPRE_Int rap_type, hypre_Index *P_stencil_shape ); + +HYPRE_Int hypre_PFMGSetupInterpOp_CC0_SS15 ( HYPRE_Int i, hypre_StructMatrix *A, hypre_Box *A_dbox, + HYPRE_Int cdir, hypre_Index stride, hypre_Index stridec, hypre_Index start, hypre_IndexRef startc, + hypre_Index loop_size, hypre_Box *P_dbox, HYPRE_Int Pstenc0, HYPRE_Int Pstenc1, HYPRE_Real *Pp0, + HYPRE_Real *Pp1, HYPRE_Int rap_type, hypre_Index *P_stencil_shape ); + +HYPRE_Int hypre_PFMGSetupInterpOp_CC0_SS19 ( HYPRE_Int i, hypre_StructMatrix *A, hypre_Box *A_dbox, + HYPRE_Int cdir, hypre_Index stride, hypre_Index stridec, hypre_Index start, hypre_IndexRef startc, + hypre_Index loop_size, hypre_Box *P_dbox, HYPRE_Int Pstenc0, HYPRE_Int Pstenc1, HYPRE_Real *Pp0, + HYPRE_Real *Pp1, HYPRE_Int rap_type, hypre_Index *P_stencil_shape ); + +HYPRE_Int hypre_PFMGSetupInterpOp_CC0_SS27 ( HYPRE_Int i, hypre_StructMatrix *A, hypre_Box *A_dbox, + HYPRE_Int cdir, hypre_Index stride, hypre_Index stridec, hypre_Index start, hypre_IndexRef startc, + hypre_Index loop_size, hypre_Box *P_dbox, HYPRE_Int Pstenc0, HYPRE_Int Pstenc1, HYPRE_Real *Pp0, + HYPRE_Real *Pp1, HYPRE_Int rap_type, hypre_Index *P_stencil_shape ); /* pfmg_setup_rap5.c */ -hypre_StructMatrix *hypre_PFMGCreateCoarseOp5 ( hypre_StructMatrix *R , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructGrid *coarse_grid , HYPRE_Int cdir ); -HYPRE_Int hypre_PFMGBuildCoarseOp5 ( hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMGBuildCoarseOp5_onebox_CC0 ( HYPRE_Int fi , HYPRE_Int ci , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMGBuildCoarseOp5_onebox_CC1 ( HYPRE_Int fi , HYPRE_Int ci , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMGBuildCoarseOp5_onebox_CC2 ( HYPRE_Int fi , HYPRE_Int ci , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); +hypre_StructMatrix *hypre_PFMGCreateCoarseOp5 ( hypre_StructMatrix *R, hypre_StructMatrix *A, + hypre_StructMatrix *P, hypre_StructGrid *coarse_grid, HYPRE_Int cdir ); +HYPRE_Int hypre_PFMGBuildCoarseOp5 ( hypre_StructMatrix *A, hypre_StructMatrix *P, + hypre_StructMatrix *R, HYPRE_Int cdir, hypre_Index cindex, hypre_Index cstride, + hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMGBuildCoarseOp5_onebox_CC0 ( HYPRE_Int fi, HYPRE_Int ci, hypre_StructMatrix *A, + hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, hypre_Index cindex, + hypre_Index cstride, hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMGBuildCoarseOp5_onebox_CC1 ( HYPRE_Int fi, HYPRE_Int ci, hypre_StructMatrix *A, + hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, hypre_Index cindex, + hypre_Index cstride, hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMGBuildCoarseOp5_onebox_CC2 ( HYPRE_Int fi, HYPRE_Int ci, hypre_StructMatrix *A, + hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, hypre_Index cindex, + hypre_Index cstride, hypre_StructMatrix *RAP ); /* pfmg_setup_rap7.c */ -hypre_StructMatrix *hypre_PFMGCreateCoarseOp7 ( hypre_StructMatrix *R , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructGrid *coarse_grid , HYPRE_Int cdir ); -HYPRE_Int hypre_PFMGBuildCoarseOp7 ( hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); +hypre_StructMatrix *hypre_PFMGCreateCoarseOp7 ( hypre_StructMatrix *R, hypre_StructMatrix *A, + hypre_StructMatrix *P, hypre_StructGrid *coarse_grid, HYPRE_Int cdir ); +HYPRE_Int hypre_PFMGBuildCoarseOp7 ( hypre_StructMatrix *A, hypre_StructMatrix *P, + hypre_StructMatrix *R, HYPRE_Int cdir, hypre_Index cindex, hypre_Index cstride, + hypre_StructMatrix *RAP ); /* pfmg_setup_rap.c */ -hypre_StructMatrix *hypre_PFMGCreateRAPOp ( hypre_StructMatrix *R , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructGrid *coarse_grid , HYPRE_Int cdir , HYPRE_Int rap_type ); -HYPRE_Int hypre_PFMGSetupRAPOp ( hypre_StructMatrix *R , hypre_StructMatrix *A , hypre_StructMatrix *P , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , HYPRE_Int rap_type , hypre_StructMatrix *Ac ); +hypre_StructMatrix *hypre_PFMGCreateRAPOp ( hypre_StructMatrix *R, hypre_StructMatrix *A, + hypre_StructMatrix *P, hypre_StructGrid *coarse_grid, HYPRE_Int cdir, HYPRE_Int rap_type ); +HYPRE_Int hypre_PFMGSetupRAPOp ( hypre_StructMatrix *R, hypre_StructMatrix *A, + hypre_StructMatrix *P, HYPRE_Int cdir, hypre_Index cindex, hypre_Index cstride, HYPRE_Int rap_type, + hypre_StructMatrix *Ac ); /* pfmg_solve.c */ -HYPRE_Int hypre_PFMGSolve ( void *pfmg_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); +HYPRE_Int hypre_PFMGSolve ( void *pfmg_vdata, hypre_StructMatrix *A, hypre_StructVector *b, + hypre_StructVector *x ); /* point_relax.c */ void *hypre_PointRelaxCreate ( MPI_Comm comm ); HYPRE_Int hypre_PointRelaxDestroy ( void *relax_vdata ); -HYPRE_Int hypre_PointRelaxSetup ( void *relax_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); -HYPRE_Int hypre_PointRelax ( void *relax_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); -HYPRE_Int hypre_PointRelax_core0 ( void *relax_vdata , hypre_StructMatrix *A , HYPRE_Int constant_coefficient , hypre_Box *compute_box , HYPRE_Real *bp , HYPRE_Real *xp , HYPRE_Real *tp , HYPRE_Int boxarray_id , hypre_Box *A_data_box , hypre_Box *b_data_box , hypre_Box *x_data_box , hypre_Box *t_data_box , hypre_IndexRef stride ); -HYPRE_Int hypre_PointRelax_core12 ( void *relax_vdata , hypre_StructMatrix *A , HYPRE_Int constant_coefficient , hypre_Box *compute_box , HYPRE_Real *bp , HYPRE_Real *xp , HYPRE_Real *tp , HYPRE_Int boxarray_id , hypre_Box *A_data_box , hypre_Box *b_data_box , hypre_Box *x_data_box , hypre_Box *t_data_box , hypre_IndexRef stride ); -HYPRE_Int hypre_PointRelaxSetTol ( void *relax_vdata , HYPRE_Real tol ); -HYPRE_Int hypre_PointRelaxGetTol ( void *relax_vdata , HYPRE_Real *tol ); -HYPRE_Int hypre_PointRelaxSetMaxIter ( void *relax_vdata , HYPRE_Int max_iter ); -HYPRE_Int hypre_PointRelaxGetMaxIter ( void *relax_vdata , HYPRE_Int *max_iter ); -HYPRE_Int hypre_PointRelaxSetZeroGuess ( void *relax_vdata , HYPRE_Int zero_guess ); -HYPRE_Int hypre_PointRelaxGetZeroGuess ( void *relax_vdata , HYPRE_Int *zero_guess ); -HYPRE_Int hypre_PointRelaxGetNumIterations ( void *relax_vdata , HYPRE_Int *num_iterations ); -HYPRE_Int hypre_PointRelaxSetWeight ( void *relax_vdata , HYPRE_Real weight ); -HYPRE_Int hypre_PointRelaxSetNumPointsets ( void *relax_vdata , HYPRE_Int num_pointsets ); -HYPRE_Int hypre_PointRelaxSetPointset ( void *relax_vdata , HYPRE_Int pointset , HYPRE_Int pointset_size , hypre_Index pointset_stride , hypre_Index *pointset_indices ); -HYPRE_Int hypre_PointRelaxSetPointsetRank ( void *relax_vdata , HYPRE_Int pointset , HYPRE_Int pointset_rank ); -HYPRE_Int hypre_PointRelaxSetTempVec ( void *relax_vdata , hypre_StructVector *t ); -HYPRE_Int hypre_PointRelaxGetFinalRelativeResidualNorm ( void *relax_vdata , HYPRE_Real *norm ); -HYPRE_Int hypre_relax_wtx ( void *relax_vdata , HYPRE_Int pointset , hypre_StructVector *t , hypre_StructVector *x ); -HYPRE_Int hypre_relax_copy ( void *relax_vdata , HYPRE_Int pointset , hypre_StructVector *t , hypre_StructVector *x ); +HYPRE_Int hypre_PointRelaxSetup ( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, + hypre_StructVector *x ); +HYPRE_Int hypre_PointRelax ( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, + hypre_StructVector *x ); +HYPRE_Int hypre_PointRelax_core0 ( void *relax_vdata, hypre_StructMatrix *A, + HYPRE_Int constant_coefficient, hypre_Box *compute_box, HYPRE_Real *bp, HYPRE_Real *xp, + HYPRE_Real *tp, HYPRE_Int boxarray_id, hypre_Box *A_data_box, hypre_Box *b_data_box, + hypre_Box *x_data_box, hypre_Box *t_data_box, hypre_IndexRef stride ); +HYPRE_Int hypre_PointRelax_core12 ( void *relax_vdata, hypre_StructMatrix *A, + HYPRE_Int constant_coefficient, hypre_Box *compute_box, HYPRE_Real *bp, HYPRE_Real *xp, + HYPRE_Real *tp, HYPRE_Int boxarray_id, hypre_Box *A_data_box, hypre_Box *b_data_box, + hypre_Box *x_data_box, hypre_Box *t_data_box, hypre_IndexRef stride ); +HYPRE_Int hypre_PointRelaxSetTol ( void *relax_vdata, HYPRE_Real tol ); +HYPRE_Int hypre_PointRelaxGetTol ( void *relax_vdata, HYPRE_Real *tol ); +HYPRE_Int hypre_PointRelaxSetMaxIter ( void *relax_vdata, HYPRE_Int max_iter ); +HYPRE_Int hypre_PointRelaxGetMaxIter ( void *relax_vdata, HYPRE_Int *max_iter ); +HYPRE_Int hypre_PointRelaxSetZeroGuess ( void *relax_vdata, HYPRE_Int zero_guess ); +HYPRE_Int hypre_PointRelaxGetZeroGuess ( void *relax_vdata, HYPRE_Int *zero_guess ); +HYPRE_Int hypre_PointRelaxGetNumIterations ( void *relax_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int hypre_PointRelaxSetWeight ( void *relax_vdata, HYPRE_Real weight ); +HYPRE_Int hypre_PointRelaxSetNumPointsets ( void *relax_vdata, HYPRE_Int num_pointsets ); +HYPRE_Int hypre_PointRelaxSetPointset ( void *relax_vdata, HYPRE_Int pointset, + HYPRE_Int pointset_size, hypre_Index pointset_stride, hypre_Index *pointset_indices ); +HYPRE_Int hypre_PointRelaxSetPointsetRank ( void *relax_vdata, HYPRE_Int pointset, + HYPRE_Int pointset_rank ); +HYPRE_Int hypre_PointRelaxSetTempVec ( void *relax_vdata, hypre_StructVector *t ); +HYPRE_Int hypre_PointRelaxGetFinalRelativeResidualNorm ( void *relax_vdata, HYPRE_Real *norm ); +HYPRE_Int hypre_relax_wtx ( void *relax_vdata, HYPRE_Int pointset, hypre_StructVector *t, + hypre_StructVector *x ); +HYPRE_Int hypre_relax_copy ( void *relax_vdata, HYPRE_Int pointset, hypre_StructVector *t, + hypre_StructVector *x ); /* red_black_constantcoef_gs.c */ -HYPRE_Int hypre_RedBlackConstantCoefGS ( void *relax_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); +HYPRE_Int hypre_RedBlackConstantCoefGS ( void *relax_vdata, hypre_StructMatrix *A, + hypre_StructVector *b, hypre_StructVector *x ); /* red_black_gs.c */ void *hypre_RedBlackGSCreate ( MPI_Comm comm ); HYPRE_Int hypre_RedBlackGSDestroy ( void *relax_vdata ); -HYPRE_Int hypre_RedBlackGSSetup ( void *relax_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); -HYPRE_Int hypre_RedBlackGS ( void *relax_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); -HYPRE_Int hypre_RedBlackGSSetTol ( void *relax_vdata , HYPRE_Real tol ); -HYPRE_Int hypre_RedBlackGSSetMaxIter ( void *relax_vdata , HYPRE_Int max_iter ); -HYPRE_Int hypre_RedBlackGSSetZeroGuess ( void *relax_vdata , HYPRE_Int zero_guess ); +HYPRE_Int hypre_RedBlackGSSetup ( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, + hypre_StructVector *x ); +HYPRE_Int hypre_RedBlackGS ( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, + hypre_StructVector *x ); +HYPRE_Int hypre_RedBlackGSSetTol ( void *relax_vdata, HYPRE_Real tol ); +HYPRE_Int hypre_RedBlackGSSetMaxIter ( void *relax_vdata, HYPRE_Int max_iter ); +HYPRE_Int hypre_RedBlackGSSetZeroGuess ( void *relax_vdata, HYPRE_Int zero_guess ); HYPRE_Int hypre_RedBlackGSSetStartRed ( void *relax_vdata ); HYPRE_Int hypre_RedBlackGSSetStartBlack ( void *relax_vdata ); /* semi.c */ -HYPRE_Int hypre_StructInterpAssemble ( hypre_StructMatrix *A , hypre_StructMatrix *P , HYPRE_Int P_stored_as_transpose , HYPRE_Int cdir , hypre_Index index , hypre_Index stride ); +HYPRE_Int hypre_StructInterpAssemble ( hypre_StructMatrix *A, hypre_StructMatrix *P, + HYPRE_Int P_stored_as_transpose, HYPRE_Int cdir, hypre_Index index, hypre_Index stride ); /* semi_interp.c */ void *hypre_SemiInterpCreate ( void ); -HYPRE_Int hypre_SemiInterpSetup ( void *interp_vdata , hypre_StructMatrix *P , HYPRE_Int P_stored_as_transpose , hypre_StructVector *xc , hypre_StructVector *e , hypre_Index cindex , hypre_Index findex , hypre_Index stride ); -HYPRE_Int hypre_SemiInterp ( void *interp_vdata , hypre_StructMatrix *P , hypre_StructVector *xc , hypre_StructVector *e ); +HYPRE_Int hypre_SemiInterpSetup ( void *interp_vdata, hypre_StructMatrix *P, + HYPRE_Int P_stored_as_transpose, hypre_StructVector *xc, hypre_StructVector *e, hypre_Index cindex, + hypre_Index findex, hypre_Index stride ); +HYPRE_Int hypre_SemiInterp ( void *interp_vdata, hypre_StructMatrix *P, hypre_StructVector *xc, + hypre_StructVector *e ); HYPRE_Int hypre_SemiInterpDestroy ( void *interp_vdata ); /* semi_restrict.c */ void *hypre_SemiRestrictCreate ( void ); -HYPRE_Int hypre_SemiRestrictSetup ( void *restrict_vdata , hypre_StructMatrix *R , HYPRE_Int R_stored_as_transpose , hypre_StructVector *r , hypre_StructVector *rc , hypre_Index cindex , hypre_Index findex , hypre_Index stride ); -HYPRE_Int hypre_SemiRestrict ( void *restrict_vdata , hypre_StructMatrix *R , hypre_StructVector *r , hypre_StructVector *rc ); +HYPRE_Int hypre_SemiRestrictSetup ( void *restrict_vdata, hypre_StructMatrix *R, + HYPRE_Int R_stored_as_transpose, hypre_StructVector *r, hypre_StructVector *rc, hypre_Index cindex, + hypre_Index findex, hypre_Index stride ); +HYPRE_Int hypre_SemiRestrict ( void *restrict_vdata, hypre_StructMatrix *R, hypre_StructVector *r, + hypre_StructVector *rc ); HYPRE_Int hypre_SemiRestrictDestroy ( void *restrict_vdata ); /* semi_setup_rap.c */ -hypre_StructMatrix *hypre_SemiCreateRAPOp ( hypre_StructMatrix *R , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructGrid *coarse_grid , HYPRE_Int cdir , HYPRE_Int P_stored_as_transpose ); -HYPRE_Int hypre_SemiBuildRAP ( hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , HYPRE_Int P_stored_as_transpose , hypre_StructMatrix *RAP ); +hypre_StructMatrix *hypre_SemiCreateRAPOp ( hypre_StructMatrix *R, hypre_StructMatrix *A, + hypre_StructMatrix *P, hypre_StructGrid *coarse_grid, HYPRE_Int cdir, + HYPRE_Int P_stored_as_transpose ); +HYPRE_Int hypre_SemiBuildRAP ( hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, + HYPRE_Int cdir, hypre_Index cindex, hypre_Index cstride, HYPRE_Int P_stored_as_transpose, + hypre_StructMatrix *RAP ); /* smg2_setup_rap.c */ -hypre_StructMatrix *hypre_SMG2CreateRAPOp ( hypre_StructMatrix *R , hypre_StructMatrix *A , hypre_StructMatrix *PT , hypre_StructGrid *coarse_grid ); -HYPRE_Int hypre_SMG2BuildRAPSym ( hypre_StructMatrix *A , hypre_StructMatrix *PT , hypre_StructMatrix *R , hypre_StructMatrix *RAP , hypre_Index cindex , hypre_Index cstride ); -HYPRE_Int hypre_SMG2BuildRAPNoSym ( hypre_StructMatrix *A , hypre_StructMatrix *PT , hypre_StructMatrix *R , hypre_StructMatrix *RAP , hypre_Index cindex , hypre_Index cstride ); -HYPRE_Int hypre_SMG2RAPPeriodicSym ( hypre_StructMatrix *RAP , hypre_Index cindex , hypre_Index cstride ); -HYPRE_Int hypre_SMG2RAPPeriodicNoSym ( hypre_StructMatrix *RAP , hypre_Index cindex , hypre_Index cstride ); +hypre_StructMatrix *hypre_SMG2CreateRAPOp ( hypre_StructMatrix *R, hypre_StructMatrix *A, + hypre_StructMatrix *PT, hypre_StructGrid *coarse_grid ); +HYPRE_Int hypre_SMG2BuildRAPSym ( hypre_StructMatrix *A, hypre_StructMatrix *PT, + hypre_StructMatrix *R, hypre_StructMatrix *RAP, hypre_Index cindex, hypre_Index cstride ); +HYPRE_Int hypre_SMG2BuildRAPNoSym ( hypre_StructMatrix *A, hypre_StructMatrix *PT, + hypre_StructMatrix *R, hypre_StructMatrix *RAP, hypre_Index cindex, hypre_Index cstride ); +HYPRE_Int hypre_SMG2RAPPeriodicSym ( hypre_StructMatrix *RAP, hypre_Index cindex, + hypre_Index cstride ); +HYPRE_Int hypre_SMG2RAPPeriodicNoSym ( hypre_StructMatrix *RAP, hypre_Index cindex, + hypre_Index cstride ); /* smg3_setup_rap.c */ -hypre_StructMatrix *hypre_SMG3CreateRAPOp ( hypre_StructMatrix *R , hypre_StructMatrix *A , hypre_StructMatrix *PT , hypre_StructGrid *coarse_grid ); -HYPRE_Int hypre_SMG3BuildRAPSym ( hypre_StructMatrix *A , hypre_StructMatrix *PT , hypre_StructMatrix *R , hypre_StructMatrix *RAP , hypre_Index cindex , hypre_Index cstride ); -HYPRE_Int hypre_SMG3BuildRAPNoSym ( hypre_StructMatrix *A , hypre_StructMatrix *PT , hypre_StructMatrix *R , hypre_StructMatrix *RAP , hypre_Index cindex , hypre_Index cstride ); -HYPRE_Int hypre_SMG3RAPPeriodicSym ( hypre_StructMatrix *RAP , hypre_Index cindex , hypre_Index cstride ); -HYPRE_Int hypre_SMG3RAPPeriodicNoSym ( hypre_StructMatrix *RAP , hypre_Index cindex , hypre_Index cstride ); +hypre_StructMatrix *hypre_SMG3CreateRAPOp ( hypre_StructMatrix *R, hypre_StructMatrix *A, + hypre_StructMatrix *PT, hypre_StructGrid *coarse_grid ); +HYPRE_Int hypre_SMG3BuildRAPSym ( hypre_StructMatrix *A, hypre_StructMatrix *PT, + hypre_StructMatrix *R, hypre_StructMatrix *RAP, hypre_Index cindex, hypre_Index cstride ); +HYPRE_Int hypre_SMG3BuildRAPNoSym ( hypre_StructMatrix *A, hypre_StructMatrix *PT, + hypre_StructMatrix *R, hypre_StructMatrix *RAP, hypre_Index cindex, hypre_Index cstride ); +HYPRE_Int hypre_SMG3RAPPeriodicSym ( hypre_StructMatrix *RAP, hypre_Index cindex, + hypre_Index cstride ); +HYPRE_Int hypre_SMG3RAPPeriodicNoSym ( hypre_StructMatrix *RAP, hypre_Index cindex, + hypre_Index cstride ); /* smg_axpy.c */ -HYPRE_Int hypre_SMGAxpy ( HYPRE_Real alpha , hypre_StructVector *x , hypre_StructVector *y , hypre_Index base_index , hypre_Index base_stride ); +HYPRE_Int hypre_SMGAxpy ( HYPRE_Real alpha, hypre_StructVector *x, hypre_StructVector *y, + hypre_Index base_index, hypre_Index base_stride ); /* smg.c */ void *hypre_SMGCreate ( MPI_Comm comm ); HYPRE_Int hypre_SMGDestroy ( void *smg_vdata ); -HYPRE_Int hypre_SMGSetMemoryUse ( void *smg_vdata , HYPRE_Int memory_use ); -HYPRE_Int hypre_SMGGetMemoryUse ( void *smg_vdata , HYPRE_Int *memory_use ); -HYPRE_Int hypre_SMGSetTol ( void *smg_vdata , HYPRE_Real tol ); -HYPRE_Int hypre_SMGGetTol ( void *smg_vdata , HYPRE_Real *tol ); -HYPRE_Int hypre_SMGSetMaxIter ( void *smg_vdata , HYPRE_Int max_iter ); -HYPRE_Int hypre_SMGGetMaxIter ( void *smg_vdata , HYPRE_Int *max_iter ); -HYPRE_Int hypre_SMGSetRelChange ( void *smg_vdata , HYPRE_Int rel_change ); -HYPRE_Int hypre_SMGGetRelChange ( void *smg_vdata , HYPRE_Int *rel_change ); -HYPRE_Int hypre_SMGSetZeroGuess ( void *smg_vdata , HYPRE_Int zero_guess ); -HYPRE_Int hypre_SMGGetZeroGuess ( void *smg_vdata , HYPRE_Int *zero_guess ); -HYPRE_Int hypre_SMGSetNumPreRelax ( void *smg_vdata , HYPRE_Int num_pre_relax ); -HYPRE_Int hypre_SMGGetNumPreRelax ( void *smg_vdata , HYPRE_Int *num_pre_relax ); -HYPRE_Int hypre_SMGSetNumPostRelax ( void *smg_vdata , HYPRE_Int num_post_relax ); -HYPRE_Int hypre_SMGGetNumPostRelax ( void *smg_vdata , HYPRE_Int *num_post_relax ); -HYPRE_Int hypre_SMGSetBase ( void *smg_vdata , hypre_Index base_index , hypre_Index base_stride ); -HYPRE_Int hypre_SMGSetLogging ( void *smg_vdata , HYPRE_Int logging ); -HYPRE_Int hypre_SMGGetLogging ( void *smg_vdata , HYPRE_Int *logging ); -HYPRE_Int hypre_SMGSetPrintLevel ( void *smg_vdata , HYPRE_Int print_level ); -HYPRE_Int hypre_SMGGetPrintLevel ( void *smg_vdata , HYPRE_Int *print_level ); -HYPRE_Int hypre_SMGGetNumIterations ( void *smg_vdata , HYPRE_Int *num_iterations ); -HYPRE_Int hypre_SMGPrintLogging ( void *smg_vdata , HYPRE_Int myid ); -HYPRE_Int hypre_SMGGetFinalRelativeResidualNorm ( void *smg_vdata , HYPRE_Real *relative_residual_norm ); -HYPRE_Int hypre_SMGSetStructVectorConstantValues ( hypre_StructVector *vector , HYPRE_Real values , hypre_BoxArray *box_array , hypre_Index stride ); +HYPRE_Int hypre_SMGSetMemoryUse ( void *smg_vdata, HYPRE_Int memory_use ); +HYPRE_Int hypre_SMGGetMemoryUse ( void *smg_vdata, HYPRE_Int *memory_use ); +HYPRE_Int hypre_SMGSetTol ( void *smg_vdata, HYPRE_Real tol ); +HYPRE_Int hypre_SMGGetTol ( void *smg_vdata, HYPRE_Real *tol ); +HYPRE_Int hypre_SMGSetMaxIter ( void *smg_vdata, HYPRE_Int max_iter ); +HYPRE_Int hypre_SMGGetMaxIter ( void *smg_vdata, HYPRE_Int *max_iter ); +HYPRE_Int hypre_SMGSetRelChange ( void *smg_vdata, HYPRE_Int rel_change ); +HYPRE_Int hypre_SMGGetRelChange ( void *smg_vdata, HYPRE_Int *rel_change ); +HYPRE_Int hypre_SMGSetZeroGuess ( void *smg_vdata, HYPRE_Int zero_guess ); +HYPRE_Int hypre_SMGGetZeroGuess ( void *smg_vdata, HYPRE_Int *zero_guess ); +HYPRE_Int hypre_SMGSetNumPreRelax ( void *smg_vdata, HYPRE_Int num_pre_relax ); +HYPRE_Int hypre_SMGGetNumPreRelax ( void *smg_vdata, HYPRE_Int *num_pre_relax ); +HYPRE_Int hypre_SMGSetNumPostRelax ( void *smg_vdata, HYPRE_Int num_post_relax ); +HYPRE_Int hypre_SMGGetNumPostRelax ( void *smg_vdata, HYPRE_Int *num_post_relax ); +HYPRE_Int hypre_SMGSetBase ( void *smg_vdata, hypre_Index base_index, hypre_Index base_stride ); +HYPRE_Int hypre_SMGSetLogging ( void *smg_vdata, HYPRE_Int logging ); +HYPRE_Int hypre_SMGGetLogging ( void *smg_vdata, HYPRE_Int *logging ); +HYPRE_Int hypre_SMGSetPrintLevel ( void *smg_vdata, HYPRE_Int print_level ); +HYPRE_Int hypre_SMGGetPrintLevel ( void *smg_vdata, HYPRE_Int *print_level ); +HYPRE_Int hypre_SMGGetNumIterations ( void *smg_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int hypre_SMGPrintLogging ( void *smg_vdata, HYPRE_Int myid ); +HYPRE_Int hypre_SMGGetFinalRelativeResidualNorm ( void *smg_vdata, + HYPRE_Real *relative_residual_norm ); +HYPRE_Int hypre_SMGSetStructVectorConstantValues ( hypre_StructVector *vector, HYPRE_Real values, + hypre_BoxArray *box_array, hypre_Index stride ); HYPRE_Int hypre_StructSMGSetMaxLevel( void *smg_vdata, HYPRE_Int max_level ); /* smg_relax.c */ @@ -340,119 +500,170 @@ HYPRE_Int hypre_SMGRelaxDestroyTempVec ( void *relax_vdata ); HYPRE_Int hypre_SMGRelaxDestroyARem ( void *relax_vdata ); HYPRE_Int hypre_SMGRelaxDestroyASol ( void *relax_vdata ); HYPRE_Int hypre_SMGRelaxDestroy ( void *relax_vdata ); -HYPRE_Int hypre_SMGRelax ( void *relax_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); -HYPRE_Int hypre_SMGRelaxSetup ( void *relax_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); -HYPRE_Int hypre_SMGRelaxSetupTempVec ( void *relax_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); -HYPRE_Int hypre_SMGRelaxSetupARem ( void *relax_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); -HYPRE_Int hypre_SMGRelaxSetupASol ( void *relax_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); -HYPRE_Int hypre_SMGRelaxSetTempVec ( void *relax_vdata , hypre_StructVector *temp_vec ); -HYPRE_Int hypre_SMGRelaxSetMemoryUse ( void *relax_vdata , HYPRE_Int memory_use ); -HYPRE_Int hypre_SMGRelaxSetTol ( void *relax_vdata , HYPRE_Real tol ); -HYPRE_Int hypre_SMGRelaxSetMaxIter ( void *relax_vdata , HYPRE_Int max_iter ); -HYPRE_Int hypre_SMGRelaxSetZeroGuess ( void *relax_vdata , HYPRE_Int zero_guess ); -HYPRE_Int hypre_SMGRelaxSetNumSpaces ( void *relax_vdata , HYPRE_Int num_spaces ); -HYPRE_Int hypre_SMGRelaxSetNumPreSpaces ( void *relax_vdata , HYPRE_Int num_pre_spaces ); -HYPRE_Int hypre_SMGRelaxSetNumRegSpaces ( void *relax_vdata , HYPRE_Int num_reg_spaces ); -HYPRE_Int hypre_SMGRelaxSetSpace ( void *relax_vdata , HYPRE_Int i , HYPRE_Int space_index , HYPRE_Int space_stride ); -HYPRE_Int hypre_SMGRelaxSetRegSpaceRank ( void *relax_vdata , HYPRE_Int i , HYPRE_Int reg_space_rank ); -HYPRE_Int hypre_SMGRelaxSetPreSpaceRank ( void *relax_vdata , HYPRE_Int i , HYPRE_Int pre_space_rank ); -HYPRE_Int hypre_SMGRelaxSetBase ( void *relax_vdata , hypre_Index base_index , hypre_Index base_stride ); -HYPRE_Int hypre_SMGRelaxSetNumPreRelax ( void *relax_vdata , HYPRE_Int num_pre_relax ); -HYPRE_Int hypre_SMGRelaxSetNumPostRelax ( void *relax_vdata , HYPRE_Int num_post_relax ); -HYPRE_Int hypre_SMGRelaxSetNewMatrixStencil ( void *relax_vdata , hypre_StructStencil *diff_stencil ); -HYPRE_Int hypre_SMGRelaxSetupBaseBoxArray ( void *relax_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); +HYPRE_Int hypre_SMGRelax ( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, + hypre_StructVector *x ); +HYPRE_Int hypre_SMGRelaxSetup ( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, + hypre_StructVector *x ); +HYPRE_Int hypre_SMGRelaxSetupTempVec ( void *relax_vdata, hypre_StructMatrix *A, + hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int hypre_SMGRelaxSetupARem ( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, + hypre_StructVector *x ); +HYPRE_Int hypre_SMGRelaxSetupASol ( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, + hypre_StructVector *x ); +HYPRE_Int hypre_SMGRelaxSetTempVec ( void *relax_vdata, hypre_StructVector *temp_vec ); +HYPRE_Int hypre_SMGRelaxSetMemoryUse ( void *relax_vdata, HYPRE_Int memory_use ); +HYPRE_Int hypre_SMGRelaxSetTol ( void *relax_vdata, HYPRE_Real tol ); +HYPRE_Int hypre_SMGRelaxSetMaxIter ( void *relax_vdata, HYPRE_Int max_iter ); +HYPRE_Int hypre_SMGRelaxSetZeroGuess ( void *relax_vdata, HYPRE_Int zero_guess ); +HYPRE_Int hypre_SMGRelaxSetNumSpaces ( void *relax_vdata, HYPRE_Int num_spaces ); +HYPRE_Int hypre_SMGRelaxSetNumPreSpaces ( void *relax_vdata, HYPRE_Int num_pre_spaces ); +HYPRE_Int hypre_SMGRelaxSetNumRegSpaces ( void *relax_vdata, HYPRE_Int num_reg_spaces ); +HYPRE_Int hypre_SMGRelaxSetSpace ( void *relax_vdata, HYPRE_Int i, HYPRE_Int space_index, + HYPRE_Int space_stride ); +HYPRE_Int hypre_SMGRelaxSetRegSpaceRank ( void *relax_vdata, HYPRE_Int i, + HYPRE_Int reg_space_rank ); +HYPRE_Int hypre_SMGRelaxSetPreSpaceRank ( void *relax_vdata, HYPRE_Int i, + HYPRE_Int pre_space_rank ); +HYPRE_Int hypre_SMGRelaxSetBase ( void *relax_vdata, hypre_Index base_index, + hypre_Index base_stride ); +HYPRE_Int hypre_SMGRelaxSetNumPreRelax ( void *relax_vdata, HYPRE_Int num_pre_relax ); +HYPRE_Int hypre_SMGRelaxSetNumPostRelax ( void *relax_vdata, HYPRE_Int num_post_relax ); +HYPRE_Int hypre_SMGRelaxSetNewMatrixStencil ( void *relax_vdata, + hypre_StructStencil *diff_stencil ); +HYPRE_Int hypre_SMGRelaxSetupBaseBoxArray ( void *relax_vdata, hypre_StructMatrix *A, + hypre_StructVector *b, hypre_StructVector *x ); HYPRE_Int hypre_SMGRelaxSetMaxLevel( void *relax_vdata, HYPRE_Int num_max_level ); /* smg_residual.c */ void *hypre_SMGResidualCreate ( void ); -HYPRE_Int hypre_SMGResidualSetup ( void *residual_vdata , hypre_StructMatrix *A , hypre_StructVector *x , hypre_StructVector *b , hypre_StructVector *r ); -HYPRE_Int hypre_SMGResidual ( void *residual_vdata , hypre_StructMatrix *A , hypre_StructVector *x , hypre_StructVector *b , hypre_StructVector *r ); -HYPRE_Int hypre_SMGResidualSetBase ( void *residual_vdata , hypre_Index base_index , hypre_Index base_stride ); +HYPRE_Int hypre_SMGResidualSetup ( void *residual_vdata, hypre_StructMatrix *A, + hypre_StructVector *x, hypre_StructVector *b, hypre_StructVector *r ); +HYPRE_Int hypre_SMGResidual ( void *residual_vdata, hypre_StructMatrix *A, hypre_StructVector *x, + hypre_StructVector *b, hypre_StructVector *r ); +HYPRE_Int hypre_SMGResidualSetBase ( void *residual_vdata, hypre_Index base_index, + hypre_Index base_stride ); HYPRE_Int hypre_SMGResidualDestroy ( void *residual_vdata ); /* smg_residual_unrolled.c */ void *hypre_SMGResidualCreate ( void ); -HYPRE_Int hypre_SMGResidualSetup ( void *residual_vdata , hypre_StructMatrix *A , hypre_StructVector *x , hypre_StructVector *b , hypre_StructVector *r ); -HYPRE_Int hypre_SMGResidual ( void *residual_vdata , hypre_StructMatrix *A , hypre_StructVector *x , hypre_StructVector *b , hypre_StructVector *r ); -HYPRE_Int hypre_SMGResidualSetBase ( void *residual_vdata , hypre_Index base_index , hypre_Index base_stride ); +HYPRE_Int hypre_SMGResidualSetup ( void *residual_vdata, hypre_StructMatrix *A, + hypre_StructVector *x, hypre_StructVector *b, hypre_StructVector *r ); +HYPRE_Int hypre_SMGResidual ( void *residual_vdata, hypre_StructMatrix *A, hypre_StructVector *x, + hypre_StructVector *b, hypre_StructVector *r ); +HYPRE_Int hypre_SMGResidualSetBase ( void *residual_vdata, hypre_Index base_index, + hypre_Index base_stride ); HYPRE_Int hypre_SMGResidualDestroy ( void *residual_vdata ); /* smg_setup.c */ -HYPRE_Int hypre_SMGSetup ( void *smg_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); +HYPRE_Int hypre_SMGSetup ( void *smg_vdata, hypre_StructMatrix *A, hypre_StructVector *b, + hypre_StructVector *x ); /* smg_setup_interp.c */ -hypre_StructMatrix *hypre_SMGCreateInterpOp ( hypre_StructMatrix *A , hypre_StructGrid *cgrid , HYPRE_Int cdir ); -HYPRE_Int hypre_SMGSetupInterpOp ( void *relax_data , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x , hypre_StructMatrix *PT , HYPRE_Int cdir , hypre_Index cindex , hypre_Index findex , hypre_Index stride ); +hypre_StructMatrix *hypre_SMGCreateInterpOp ( hypre_StructMatrix *A, hypre_StructGrid *cgrid, + HYPRE_Int cdir ); +HYPRE_Int hypre_SMGSetupInterpOp ( void *relax_data, hypre_StructMatrix *A, hypre_StructVector *b, + hypre_StructVector *x, hypre_StructMatrix *PT, HYPRE_Int cdir, hypre_Index cindex, + hypre_Index findex, hypre_Index stride ); /* smg_setup_rap.c */ -hypre_StructMatrix *hypre_SMGCreateRAPOp ( hypre_StructMatrix *R , hypre_StructMatrix *A , hypre_StructMatrix *PT , hypre_StructGrid *coarse_grid ); -HYPRE_Int hypre_SMGSetupRAPOp ( hypre_StructMatrix *R , hypre_StructMatrix *A , hypre_StructMatrix *PT , hypre_StructMatrix *Ac , hypre_Index cindex , hypre_Index cstride ); +hypre_StructMatrix *hypre_SMGCreateRAPOp ( hypre_StructMatrix *R, hypre_StructMatrix *A, + hypre_StructMatrix *PT, hypre_StructGrid *coarse_grid ); +HYPRE_Int hypre_SMGSetupRAPOp ( hypre_StructMatrix *R, hypre_StructMatrix *A, + hypre_StructMatrix *PT, hypre_StructMatrix *Ac, hypre_Index cindex, hypre_Index cstride ); /* smg_setup_restrict.c */ -hypre_StructMatrix *hypre_SMGCreateRestrictOp ( hypre_StructMatrix *A , hypre_StructGrid *cgrid , HYPRE_Int cdir ); -HYPRE_Int hypre_SMGSetupRestrictOp ( hypre_StructMatrix *A , hypre_StructMatrix *R , hypre_StructVector *temp_vec , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride ); +hypre_StructMatrix *hypre_SMGCreateRestrictOp ( hypre_StructMatrix *A, hypre_StructGrid *cgrid, + HYPRE_Int cdir ); +HYPRE_Int hypre_SMGSetupRestrictOp ( hypre_StructMatrix *A, hypre_StructMatrix *R, + hypre_StructVector *temp_vec, HYPRE_Int cdir, hypre_Index cindex, hypre_Index cstride ); /* smg_solve.c */ -HYPRE_Int hypre_SMGSolve ( void *smg_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); +HYPRE_Int hypre_SMGSolve ( void *smg_vdata, hypre_StructMatrix *A, hypre_StructVector *b, + hypre_StructVector *x ); /* sparse_msg2_setup_rap.c */ -hypre_StructMatrix *hypre_SparseMSG2CreateRAPOp ( hypre_StructMatrix *R , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructGrid *coarse_grid , HYPRE_Int cdir ); -HYPRE_Int hypre_SparseMSG2BuildRAPSym ( hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_Index stridePR , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_SparseMSG2BuildRAPNoSym ( hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_Index stridePR , hypre_StructMatrix *RAP ); +hypre_StructMatrix *hypre_SparseMSG2CreateRAPOp ( hypre_StructMatrix *R, hypre_StructMatrix *A, + hypre_StructMatrix *P, hypre_StructGrid *coarse_grid, HYPRE_Int cdir ); +HYPRE_Int hypre_SparseMSG2BuildRAPSym ( hypre_StructMatrix *A, hypre_StructMatrix *P, + hypre_StructMatrix *R, HYPRE_Int cdir, hypre_Index cindex, hypre_Index cstride, + hypre_Index stridePR, hypre_StructMatrix *RAP ); +HYPRE_Int hypre_SparseMSG2BuildRAPNoSym ( hypre_StructMatrix *A, hypre_StructMatrix *P, + hypre_StructMatrix *R, HYPRE_Int cdir, hypre_Index cindex, hypre_Index cstride, + hypre_Index stridePR, hypre_StructMatrix *RAP ); /* sparse_msg3_setup_rap.c */ -hypre_StructMatrix *hypre_SparseMSG3CreateRAPOp ( hypre_StructMatrix *R , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructGrid *coarse_grid , HYPRE_Int cdir ); -HYPRE_Int hypre_SparseMSG3BuildRAPSym ( hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_Index stridePR , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_SparseMSG3BuildRAPNoSym ( hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_Index stridePR , hypre_StructMatrix *RAP ); +hypre_StructMatrix *hypre_SparseMSG3CreateRAPOp ( hypre_StructMatrix *R, hypre_StructMatrix *A, + hypre_StructMatrix *P, hypre_StructGrid *coarse_grid, HYPRE_Int cdir ); +HYPRE_Int hypre_SparseMSG3BuildRAPSym ( hypre_StructMatrix *A, hypre_StructMatrix *P, + hypre_StructMatrix *R, HYPRE_Int cdir, hypre_Index cindex, hypre_Index cstride, + hypre_Index stridePR, hypre_StructMatrix *RAP ); +HYPRE_Int hypre_SparseMSG3BuildRAPNoSym ( hypre_StructMatrix *A, hypre_StructMatrix *P, + hypre_StructMatrix *R, HYPRE_Int cdir, hypre_Index cindex, hypre_Index cstride, + hypre_Index stridePR, hypre_StructMatrix *RAP ); /* sparse_msg.c */ void *hypre_SparseMSGCreate ( MPI_Comm comm ); HYPRE_Int hypre_SparseMSGDestroy ( void *smsg_vdata ); -HYPRE_Int hypre_SparseMSGSetTol ( void *smsg_vdata , HYPRE_Real tol ); -HYPRE_Int hypre_SparseMSGSetMaxIter ( void *smsg_vdata , HYPRE_Int max_iter ); -HYPRE_Int hypre_SparseMSGSetJump ( void *smsg_vdata , HYPRE_Int jump ); -HYPRE_Int hypre_SparseMSGSetRelChange ( void *smsg_vdata , HYPRE_Int rel_change ); -HYPRE_Int hypre_SparseMSGSetZeroGuess ( void *smsg_vdata , HYPRE_Int zero_guess ); -HYPRE_Int hypre_SparseMSGSetRelaxType ( void *smsg_vdata , HYPRE_Int relax_type ); -HYPRE_Int hypre_SparseMSGSetJacobiWeight ( void *smsg_vdata , HYPRE_Real weight ); -HYPRE_Int hypre_SparseMSGSetNumPreRelax ( void *smsg_vdata , HYPRE_Int num_pre_relax ); -HYPRE_Int hypre_SparseMSGSetNumPostRelax ( void *smsg_vdata , HYPRE_Int num_post_relax ); -HYPRE_Int hypre_SparseMSGSetNumFineRelax ( void *smsg_vdata , HYPRE_Int num_fine_relax ); -HYPRE_Int hypre_SparseMSGSetLogging ( void *smsg_vdata , HYPRE_Int logging ); -HYPRE_Int hypre_SparseMSGSetPrintLevel ( void *smsg_vdata , HYPRE_Int print_level ); -HYPRE_Int hypre_SparseMSGGetNumIterations ( void *smsg_vdata , HYPRE_Int *num_iterations ); -HYPRE_Int hypre_SparseMSGPrintLogging ( void *smsg_vdata , HYPRE_Int myid ); -HYPRE_Int hypre_SparseMSGGetFinalRelativeResidualNorm ( void *smsg_vdata , HYPRE_Real *relative_residual_norm ); +HYPRE_Int hypre_SparseMSGSetTol ( void *smsg_vdata, HYPRE_Real tol ); +HYPRE_Int hypre_SparseMSGSetMaxIter ( void *smsg_vdata, HYPRE_Int max_iter ); +HYPRE_Int hypre_SparseMSGSetJump ( void *smsg_vdata, HYPRE_Int jump ); +HYPRE_Int hypre_SparseMSGSetRelChange ( void *smsg_vdata, HYPRE_Int rel_change ); +HYPRE_Int hypre_SparseMSGSetZeroGuess ( void *smsg_vdata, HYPRE_Int zero_guess ); +HYPRE_Int hypre_SparseMSGSetRelaxType ( void *smsg_vdata, HYPRE_Int relax_type ); +HYPRE_Int hypre_SparseMSGSetJacobiWeight ( void *smsg_vdata, HYPRE_Real weight ); +HYPRE_Int hypre_SparseMSGSetNumPreRelax ( void *smsg_vdata, HYPRE_Int num_pre_relax ); +HYPRE_Int hypre_SparseMSGSetNumPostRelax ( void *smsg_vdata, HYPRE_Int num_post_relax ); +HYPRE_Int hypre_SparseMSGSetNumFineRelax ( void *smsg_vdata, HYPRE_Int num_fine_relax ); +HYPRE_Int hypre_SparseMSGSetLogging ( void *smsg_vdata, HYPRE_Int logging ); +HYPRE_Int hypre_SparseMSGSetPrintLevel ( void *smsg_vdata, HYPRE_Int print_level ); +HYPRE_Int hypre_SparseMSGGetNumIterations ( void *smsg_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int hypre_SparseMSGPrintLogging ( void *smsg_vdata, HYPRE_Int myid ); +HYPRE_Int hypre_SparseMSGGetFinalRelativeResidualNorm ( void *smsg_vdata, + HYPRE_Real *relative_residual_norm ); /* sparse_msg_filter.c */ -HYPRE_Int hypre_SparseMSGFilterSetup ( hypre_StructMatrix *A , HYPRE_Int *num_grids , HYPRE_Int lx , HYPRE_Int ly , HYPRE_Int lz , HYPRE_Int jump , hypre_StructVector *visitx , hypre_StructVector *visity , hypre_StructVector *visitz ); -HYPRE_Int hypre_SparseMSGFilter ( hypre_StructVector *visit , hypre_StructVector *e , HYPRE_Int lx , HYPRE_Int ly , HYPRE_Int lz , HYPRE_Int jump ); +HYPRE_Int hypre_SparseMSGFilterSetup ( hypre_StructMatrix *A, HYPRE_Int *num_grids, HYPRE_Int lx, + HYPRE_Int ly, HYPRE_Int lz, HYPRE_Int jump, hypre_StructVector *visitx, hypre_StructVector *visity, + hypre_StructVector *visitz ); +HYPRE_Int hypre_SparseMSGFilter ( hypre_StructVector *visit, hypre_StructVector *e, HYPRE_Int lx, + HYPRE_Int ly, HYPRE_Int lz, HYPRE_Int jump ); /* sparse_msg_interp.c */ void *hypre_SparseMSGInterpCreate ( void ); -HYPRE_Int hypre_SparseMSGInterpSetup ( void *interp_vdata , hypre_StructMatrix *P , hypre_StructVector *xc , hypre_StructVector *e , hypre_Index cindex , hypre_Index findex , hypre_Index stride , hypre_Index strideP ); -HYPRE_Int hypre_SparseMSGInterp ( void *interp_vdata , hypre_StructMatrix *P , hypre_StructVector *xc , hypre_StructVector *e ); +HYPRE_Int hypre_SparseMSGInterpSetup ( void *interp_vdata, hypre_StructMatrix *P, + hypre_StructVector *xc, hypre_StructVector *e, hypre_Index cindex, hypre_Index findex, + hypre_Index stride, hypre_Index strideP ); +HYPRE_Int hypre_SparseMSGInterp ( void *interp_vdata, hypre_StructMatrix *P, hypre_StructVector *xc, + hypre_StructVector *e ); HYPRE_Int hypre_SparseMSGInterpDestroy ( void *interp_vdata ); /* sparse_msg_restrict.c */ void *hypre_SparseMSGRestrictCreate ( void ); -HYPRE_Int hypre_SparseMSGRestrictSetup ( void *restrict_vdata , hypre_StructMatrix *R , hypre_StructVector *r , hypre_StructVector *rc , hypre_Index cindex , hypre_Index findex , hypre_Index stride , hypre_Index strideR ); -HYPRE_Int hypre_SparseMSGRestrict ( void *restrict_vdata , hypre_StructMatrix *R , hypre_StructVector *r , hypre_StructVector *rc ); +HYPRE_Int hypre_SparseMSGRestrictSetup ( void *restrict_vdata, hypre_StructMatrix *R, + hypre_StructVector *r, hypre_StructVector *rc, hypre_Index cindex, hypre_Index findex, + hypre_Index stride, hypre_Index strideR ); +HYPRE_Int hypre_SparseMSGRestrict ( void *restrict_vdata, hypre_StructMatrix *R, + hypre_StructVector *r, hypre_StructVector *rc ); HYPRE_Int hypre_SparseMSGRestrictDestroy ( void *restrict_vdata ); /* sparse_msg_setup.c */ -HYPRE_Int hypre_SparseMSGSetup ( void *smsg_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); +HYPRE_Int hypre_SparseMSGSetup ( void *smsg_vdata, hypre_StructMatrix *A, hypre_StructVector *b, + hypre_StructVector *x ); /* sparse_msg_setup_rap.c */ -hypre_StructMatrix *hypre_SparseMSGCreateRAPOp ( hypre_StructMatrix *R , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructGrid *coarse_grid , HYPRE_Int cdir ); -HYPRE_Int hypre_SparseMSGSetupRAPOp ( hypre_StructMatrix *R , hypre_StructMatrix *A , hypre_StructMatrix *P , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_Index stridePR , hypre_StructMatrix *Ac ); +hypre_StructMatrix *hypre_SparseMSGCreateRAPOp ( hypre_StructMatrix *R, hypre_StructMatrix *A, + hypre_StructMatrix *P, hypre_StructGrid *coarse_grid, HYPRE_Int cdir ); +HYPRE_Int hypre_SparseMSGSetupRAPOp ( hypre_StructMatrix *R, hypre_StructMatrix *A, + hypre_StructMatrix *P, HYPRE_Int cdir, hypre_Index cindex, hypre_Index cstride, + hypre_Index stridePR, hypre_StructMatrix *Ac ); /* sparse_msg_solve.c */ -HYPRE_Int hypre_SparseMSGSolve ( void *smsg_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); - +HYPRE_Int hypre_SparseMSGSolve ( void *smsg_vdata, hypre_StructMatrix *A, hypre_StructVector *b, + hypre_StructVector *x ); #ifdef __cplusplus } #endif #endif + diff --git a/external/hypre/src/struct_ls/coarsen.c b/external/hypre/src/struct_ls/coarsen.c index dc499056..91e503f9 100644 --- a/external/hypre/src/struct_ls/coarsen.c +++ b/external/hypre/src/struct_ls/coarsen.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -56,7 +56,7 @@ HYPRE_Int hypre_StructMapCoarseToFine( hypre_Index cindex, hypre_Index index, hypre_Index stride, - hypre_Index findex ) + hypre_Index findex ) { hypre_IndexX(findex) = hypre_IndexX(cindex) * hypre_IndexX(stride) + hypre_IndexX(index); @@ -80,7 +80,7 @@ hypre_StructMapCoarseToFine( hypre_Index cindex, * * This routine coarsens the grid, 'fgrid', by the coarsening factor, 'stride', * using the index mapping in 'hypre_StructMapFineToCoarse'. - * + * * 1. A coarse grid is created with boxes that result from coarsening the fine * grid boxes, bounding box, and periodicity information. * @@ -134,13 +134,13 @@ hypre_StructCoarsen( hypre_StructGrid *fgrid, hypre_BoxManEntry *entries; hypre_BoxManEntry *entry; - + void *entry_info = NULL; - -#if TIME_DEBUG + +#if TIME_DEBUG HYPRE_Int tindex; char new_title[80]; - hypre_sprintf(new_title,"Coarsen.%d",s_coarsen_num); + hypre_sprintf(new_title, "Coarsen.%d", s_coarsen_num); tindex = hypre_InitializeTiming(new_title); s_coarsen_num++; @@ -156,7 +156,7 @@ hypre_StructCoarsen( hypre_StructGrid *fgrid, comm = hypre_StructGridComm(fgrid); ndim = hypre_StructGridNDim(fgrid); max_distance = hypre_StructGridMaxDistance(fgrid); - + /* initial */ hypre_MPI_Comm_rank(comm, &myid ); @@ -172,12 +172,12 @@ hypre_StructCoarsen( hypre_StructGrid *fgrid, hypre_StructCoarsenBox(box, index, stride); cids[i] = fids[i]; } - + /* prune? */ - /* zero volume boxes are needed when forming P and P^T */ + /* zero volume boxes are needed when forming P and P^T */ if (prune) { - count = 0; + count = 0; hypre_ForBoxI(i, my_boxes) { box = hypre_BoxArrayBox(my_boxes, i); @@ -194,14 +194,14 @@ hypre_StructCoarsen( hypre_StructGrid *fgrid, /* set coarse grid boxes */ hypre_StructGridSetBoxes(cgrid, my_boxes); - /* set coarse grid ids */ + /* set coarse grid ids */ hypre_StructGridSetIDs(cgrid, cids); /* adjust periodicity and set for the coarse grid */ hypre_CopyIndex(hypre_StructGridPeriodic(fgrid), periodic); for (i = 0; i < ndim; i++) { - hypre_IndexD(periodic,i) /= hypre_IndexD(stride,i); + hypre_IndexD(periodic, i) /= hypre_IndexD(stride, i); } hypre_StructGridSetPeriodic(cgrid, periodic); @@ -215,23 +215,25 @@ hypre_StructCoarsen( hypre_StructGrid *fgrid, for (i = 0; i < ndim; i++) { - coarsen_factor = hypre_IndexD(stride,i); - hypre_IndexD(new_dist, i) = hypre_IndexD(max_distance,i)/coarsen_factor; + coarsen_factor = hypre_IndexD(stride, i); + hypre_IndexD(new_dist, i) = hypre_IndexD(max_distance, i) / coarsen_factor; } for (i = ndim; i < 3; i++) { hypre_IndexD(new_dist, i) = 2; } - + hypre_BoxManGetAllGlobalKnown (fboxman, &known ); /* large enough - don't need to re-gather */ if ( (hypre_IndexMin(new_dist, ndim) > 1) || known ) { - /* update new max distance value */ + /* update new max distance value */ if (!known) /* only need to change if global info is not known */ + { hypre_StructGridSetMaxDistance(cgrid, new_dist); + } } else /* not large enough - set max_distance to 0 - neighbor info will be collected during the assemble */ @@ -243,24 +245,24 @@ hypre_StructCoarsen( hypre_StructGrid *fgrid, /* update the new bounding box */ bounding_box = hypre_BoxDuplicate(hypre_StructGridBoundingBox(fgrid)); hypre_StructCoarsenBox(bounding_box, index, stride); - + hypre_StructGridSetBoundingBox(cgrid, bounding_box); - - /* create a box manager for the coarse grid */ + + /* create a box manager for the coarse grid */ info_size = hypre_BoxManEntryInfoSize(fboxman); max_nentries = hypre_BoxManMaxNEntries(fboxman); - hypre_BoxManCreate(max_nentries, info_size, ndim, bounding_box, + hypre_BoxManCreate(max_nentries, info_size, ndim, bounding_box, comm, &cboxman); - + hypre_BoxDestroy(bounding_box); - + /* update all global known */ hypre_BoxManSetAllGlobalKnown(cboxman, known ); - + /* now get the entries from the fgrid box manager, coarsen, and add to the coarse grid box manager (note: my boxes have already been coarsened) */ - - hypre_BoxManGetAllEntries( fboxman , &num_entries, &entries); + + hypre_BoxManGetAllEntries( fboxman, &num_entries, &entries); new_box = hypre_BoxCreate(ndim); num = 0; @@ -274,8 +276,8 @@ hypre_StructCoarsen( hypre_StructGrid *fgrid, { entry = &entries[i]; proc = hypre_BoxManEntryProc(entry); - - if (proc != myid) /* not my boxes */ + + if (proc != myid) /* not my boxes */ { hypre_BoxManEntryGetExtents(entry, ilower, iupper); hypre_BoxSetExtents(new_box, ilower, iupper); @@ -285,16 +287,16 @@ hypre_StructCoarsen( hypre_StructGrid *fgrid, (we want these ids sequential - no gaps) - and zero boxes are not kept in the box manager */ if (prune) - { - if (proc != last_proc) + { + if (proc != last_proc) { num = 0; last_proc = proc; } if (hypre_BoxVolume(new_box)) { - - hypre_BoxManAddEntry( cboxman, hypre_BoxIMin(new_box) , + + hypre_BoxManAddEntry( cboxman, hypre_BoxIMin(new_box), hypre_BoxIMax(new_box), proc, num, entry_info); num++; @@ -304,15 +306,15 @@ hypre_StructCoarsen( hypre_StructGrid *fgrid, saved in the box manager, so we will have gaps in the box numbers) */ { - hypre_BoxManAddEntry( cboxman, hypre_BoxIMin(new_box) , + hypre_BoxManAddEntry( cboxman, hypre_BoxIMin(new_box), hypre_BoxIMax(new_box), proc, id, entry_info); } - } + } else /* my boxes */ - /* add my coarse grid boxes to the coarse grid box manager (have - already been pruned if necessary) - re-number the entry ids to be - sequential (this is the box number, really) */ + /* add my coarse grid boxes to the coarse grid box manager (have + already been pruned if necessary) - re-number the entry ids to be + sequential (this is the box number, really) */ { if (proc != last_proc) /* just do this once (the first myid) */ { @@ -327,33 +329,33 @@ hypre_StructCoarsen( hypre_StructGrid *fgrid, } } } /* loop through entries */ - + /* these entries are sorted */ hypre_BoxManSetIsEntriesSort(cboxman, 1 ); - + hypre_BoxDestroy(new_box); -#if 0 +#if 0 /* if there is an assumed partition in the fg, then coarsen those boxes as well and add to cg */ hypre_BoxManGetAssumedPartition ( fboxman, &fap); - + if (fap) { - /* coarsen fap to get cap */ + /* coarsen fap to get cap */ - /* set cap */ + /* set cap */ hypre_BoxManSetAssumedPartition (cboxman, cap); } #endif /* assign new box manager */ hypre_StructGridSetBoxManager(cgrid, cboxman); - + /* finally... assemble the new coarse grid */ hypre_StructGridAssemble(cgrid); - /* return the coarse grid */ + /* return the coarse grid */ *cgrid_ptr = cgrid; #if TIME_DEBUG diff --git a/external/hypre/src/struct_ls/cyclic_reduction.c b/external/hypre/src/struct_ls/cyclic_reduction.c index 00e6615d..7f045e5a 100644 --- a/external/hypre/src/struct_ls/cyclic_reduction.c +++ b/external/hypre/src/struct_ls/cyclic_reduction.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -66,6 +66,7 @@ typedef struct hypre_BoxArray *base_points; hypre_BoxArray **fine_points_l; + HYPRE_MemoryLocation memory_location; /* memory location of data */ HYPRE_Real *data; HYPRE_Real *data_const; hypre_StructMatrix **A_l; @@ -100,6 +101,8 @@ hypre_CyclicReductionCreate( MPI_Comm comm ) hypre_SetIndex3((cyc_red_data -> base_index), 0, 0, 0); hypre_SetIndex3((cyc_red_data -> base_stride), 1, 1, 1); + (cyc_red_data -> memory_location) = hypre_HandleMemoryLocation(hypre_handle()); + return (void *) cyc_red_data; } @@ -145,7 +148,7 @@ hypre_CycRedCreateCoarseOp( hypre_StructMatrix *A, for (i = -1; i < 2; i++) { /* Storage for 3 elements (c,w,e) */ - hypre_SetIndex3(Ac_stencil_shape[stencil_rank],0,0,0); + hypre_SetIndex3(Ac_stencil_shape[stencil_rank], 0, 0, 0); hypre_IndexD(Ac_stencil_shape[stencil_rank], cdir) = i; stencil_rank++; } @@ -169,7 +172,7 @@ hypre_CycRedCreateCoarseOp( hypre_StructMatrix *A, { /* Storage for 2 elements in (c,w) */ - hypre_SetIndex3(Ac_stencil_shape[stencil_rank],0,0,0); + hypre_SetIndex3(Ac_stencil_shape[stencil_rank], 0, 0, 0); hypre_IndexD(Ac_stencil_shape[stencil_rank], cdir) = i; stencil_rank++; } @@ -192,10 +195,10 @@ hypre_CycRedCreateCoarseOp( hypre_StructMatrix *A, * Set number of ghost points *-----------------------------------------------*/ - Ac_num_ghost[2*cdir] = 1; + Ac_num_ghost[2 * cdir] = 1; if (!hypre_StructMatrixSymmetric(A)) { - Ac_num_ghost[2*cdir + 1] = 1; + Ac_num_ghost[2 * cdir + 1] = 1; } hypre_StructMatrixSetNumGhost(Ac, Ac_num_ghost); @@ -235,7 +238,7 @@ hypre_CycRedSetupCoarseOp( hypre_StructMatrix *A, hypre_Box *Ac_dbox; HYPRE_Real *a_cc, *a_cw, *a_ce; - HYPRE_Real *ac_cc, *ac_cw, *ac_ce; + HYPRE_Real *ac_cc, *ac_cw, *ac_ce = NULL; HYPRE_Int offsetA; @@ -273,7 +276,7 @@ hypre_CycRedSetupCoarseOp( hypre_StructMatrix *A, * a_ce is pointer for east coefficient *-----------------------------------------------*/ - hypre_SetIndex3(index,0,0,0); + hypre_SetIndex3(index, 0, 0, 0); a_cc = hypre_StructMatrixExtractPointerByIndex(A, fi, index); hypre_IndexD(index, cdir) = -1; @@ -291,13 +294,13 @@ hypre_CycRedSetupCoarseOp( hypre_StructMatrix *A, * ac_cc is pointer for center coefficient (etc.) *-----------------------------------------------*/ - hypre_SetIndex3(index,0,0,0); + hypre_SetIndex3(index, 0, 0, 0); ac_cc = hypre_StructMatrixExtractPointerByIndex(Ac, ci, index); hypre_IndexD(index, cdir) = -1; ac_cw = hypre_StructMatrixExtractPointerByIndex(Ac, ci, index); - if(!hypre_StructMatrixSymmetric(A)) + if (!hypre_StructMatrixSymmetric(A)) { hypre_IndexD(index, cdir) = 1; ac_ce = hypre_StructMatrixExtractPointerByIndex(Ac, ci, index); @@ -313,15 +316,15 @@ hypre_CycRedSetupCoarseOp( hypre_StructMatrix *A, * other points. *-----------------------------------------------*/ - hypre_SetIndex3(index,0,0,0); + hypre_SetIndex3(index, 0, 0, 0); hypre_IndexD(index, cdir) = 1; - offsetA = hypre_BoxOffsetDistance(A_dbox,index); + offsetA = hypre_BoxOffsetDistance(A_dbox, index); /*----------------------------------------------- * non-symmetric case *-----------------------------------------------*/ - if(!hypre_StructMatrixSymmetric(A)) + if (!hypre_StructMatrixSymmetric(A)) { hypre_BoxGetSize(cgrid_box, loop_size); @@ -397,13 +400,13 @@ hypre_CycRedSetupCoarseOp( hypre_StructMatrix *A, * ac_cc is pointer for center coefficient (etc.) *-----------------------------------------------*/ - hypre_SetIndex3(index,0,0,0); + hypre_SetIndex3(index, 0, 0, 0); ac_cc = hypre_StructMatrixExtractPointerByIndex(Ac, ci, index); hypre_IndexD(index, cdir) = -1; ac_cw = hypre_StructMatrixExtractPointerByIndex(Ac, ci, index); - if(!hypre_StructMatrixSymmetric(A)) + if (!hypre_StructMatrixSymmetric(A)) { hypre_IndexD(index, cdir) = 1; ac_ce = hypre_StructMatrixExtractPointerByIndex(Ac, ci, index); @@ -413,7 +416,7 @@ hypre_CycRedSetupCoarseOp( hypre_StructMatrix *A, * non-symmetric case *-----------------------------------------------*/ - if(!hypre_StructMatrixSymmetric(A)) + if (!hypre_StructMatrixSymmetric(A)) { hypre_BoxGetSize(cgrid_box, loop_size); @@ -467,6 +470,8 @@ hypre_CyclicReductionSetup( void *cyc_red_vdata, hypre_StructVector *b, hypre_StructVector *x ) { + HYPRE_UNUSED_VAR(b); + hypre_CyclicReductionData *cyc_red_data = (hypre_CyclicReductionData *) cyc_red_vdata; MPI_Comm comm = (cyc_red_data -> comm); @@ -494,16 +499,12 @@ hypre_CyclicReductionSetup( void *cyc_red_vdata, hypre_Index stride; hypre_StructGrid *grid; - hypre_Box *cbox; - HYPRE_Int l; HYPRE_Int flop_divisor; - HYPRE_Int x_num_ghost[] = {0, 0, 0, 0, 0, 0}; -#if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - HYPRE_MemoryLocation data_location = HYPRE_MEMORY_DEVICE; -#endif + + HYPRE_MemoryLocation memory_location = hypre_StructMatrixMemoryLocation(A); /*----------------------------------------------------- * Set up coarse grids @@ -548,9 +549,9 @@ hypre_CyclicReductionSetup( void *cyc_red_vdata, hypre_BoxIMax(cbox)); /* coarsen the grid */ - hypre_StructCoarsen(grid_l[l], cindex, stride, 1, &grid_l[l+1]); + hypre_StructCoarsen(grid_l[l], cindex, stride, 1, &grid_l[l + 1]); #if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - hypre_StructGridDataLocation(grid_l[l+1]) = data_location; + hypre_StructGridDataLocation(grid_l[l + 1]) = data_location; #endif } num_levels = l + 1; @@ -605,50 +606,52 @@ hypre_CyclicReductionSetup( void *cyc_red_vdata, A_l[0] = hypre_StructMatrixRef(A); x_l[0] = hypre_StructVectorRef(x); - x_num_ghost[2*cdir] = 1; - x_num_ghost[2*cdir + 1] = 1; + x_num_ghost[2 * cdir] = 1; + x_num_ghost[2 * cdir + 1] = 1; for (l = 0; l < (num_levels - 1); l++) { - A_l[l+1] = hypre_CycRedCreateCoarseOp(A_l[l], grid_l[l+1], cdir); + A_l[l + 1] = hypre_CycRedCreateCoarseOp(A_l[l], grid_l[l + 1], cdir); //hypre_StructMatrixInitializeShell(A_l[l+1]); - data_size += hypre_StructMatrixDataSize(A_l[l+1]); - data_size_const += hypre_StructMatrixDataConstSize(A_l[l+1]); + data_size += hypre_StructMatrixDataSize(A_l[l + 1]); + data_size_const += hypre_StructMatrixDataConstSize(A_l[l + 1]); - x_l[l+1] = hypre_StructVectorCreate(comm, grid_l[l+1]); - hypre_StructVectorSetNumGhost(x_l[l+1], x_num_ghost); - hypre_StructVectorInitializeShell(x_l[l+1]); - hypre_StructVectorSetDataSize(x_l[l+1], &data_size, &data_size_const); + x_l[l + 1] = hypre_StructVectorCreate(comm, grid_l[l + 1]); + hypre_StructVectorSetNumGhost(x_l[l + 1], x_num_ghost); + hypre_StructVectorInitializeShell(x_l[l + 1]); + hypre_StructVectorSetDataSize(x_l[l + 1], &data_size, &data_size_const); } - data = hypre_CTAlloc(HYPRE_Real, data_size, HYPRE_MEMORY_DEVICE); - data_const = hypre_CTAlloc(HYPRE_Real,data_size_const,HYPRE_MEMORY_HOST); + data = hypre_CTAlloc(HYPRE_Real, data_size, memory_location); + data_const = hypre_CTAlloc(HYPRE_Real, data_size_const, HYPRE_MEMORY_HOST); + + (cyc_red_data -> memory_location) = memory_location; (cyc_red_data -> data) = data; (cyc_red_data -> data_const) = data_const; for (l = 0; l < (num_levels - 1); l++) { - hypre_StructMatrixInitializeData(A_l[l+1], data, data_const); - data += hypre_StructMatrixDataSize(A_l[l+1]); - data_const += hypre_StructMatrixDataConstSize(A_l[l+1]); + hypre_StructMatrixInitializeData(A_l[l + 1], data, data_const); + data += hypre_StructMatrixDataSize(A_l[l + 1]); + data_const += hypre_StructMatrixDataConstSize(A_l[l + 1]); #if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) if (data_location != HYPRE_MEMORY_HOST) { - hypre_StructVectorInitializeData(x_l[l+1], data); - hypre_StructVectorAssemble(x_l[l+1]); - data += hypre_StructVectorDataSize(x_l[l+1]); + hypre_StructVectorInitializeData(x_l[l + 1], data); + hypre_StructVectorAssemble(x_l[l + 1]); + data += hypre_StructVectorDataSize(x_l[l + 1]); } else { - hypre_StructVectorInitializeData(x_l[l+1], data_const); - hypre_StructVectorAssemble(x_l[l+1]); - data_const += hypre_StructVectorDataSize(x_l[l+1]); + hypre_StructVectorInitializeData(x_l[l + 1], data_const); + hypre_StructVectorAssemble(x_l[l + 1]); + data_const += hypre_StructVectorDataSize(x_l[l + 1]); } #else - hypre_StructVectorInitializeData(x_l[l+1], data); - hypre_StructVectorAssemble(x_l[l+1]); - data += hypre_StructVectorDataSize(x_l[l+1]); + hypre_StructVectorInitializeData(x_l[l + 1], data); + hypre_StructVectorAssemble(x_l[l + 1]); + data += hypre_StructVectorDataSize(x_l[l + 1]); #endif } @@ -664,7 +667,7 @@ hypre_CyclicReductionSetup( void *cyc_red_vdata, hypre_CycRedSetCIndex(base_index, base_stride, l, cdir, cindex); hypre_CycRedSetStride(base_index, base_stride, l, cdir, stride); - hypre_CycRedSetupCoarseOp(A_l[l], A_l[l+1], cindex, stride, cdir); + hypre_CycRedSetupCoarseOp(A_l[l], A_l[l + 1], cindex, stride, cdir); } /*---------------------------------------------------------- @@ -712,19 +715,19 @@ hypre_CyclicReductionSetup( void *cyc_red_vdata, hypre_IndexY(base_stride) * hypre_IndexZ(base_stride) ); (cyc_red_data -> solve_flops) = - hypre_StructVectorGlobalSize(x_l[0])/2/(HYPRE_BigInt)flop_divisor; + hypre_StructVectorGlobalSize(x_l[0]) / 2 / (HYPRE_BigInt)flop_divisor; (cyc_red_data -> solve_flops) += - 5*hypre_StructVectorGlobalSize(x_l[0])/2/(HYPRE_BigInt)flop_divisor; + 5 * hypre_StructVectorGlobalSize(x_l[0]) / 2 / (HYPRE_BigInt)flop_divisor; for (l = 1; l < (num_levels - 1); l++) { (cyc_red_data -> solve_flops) += - 10*hypre_StructVectorGlobalSize(x_l[l])/2; + 10 * hypre_StructVectorGlobalSize(x_l[l]) / 2; } if (num_levels > 1) { (cyc_red_data -> solve_flops) += - hypre_StructVectorGlobalSize(x_l[l])/2; + hypre_StructVectorGlobalSize(x_l[l]) / 2; } @@ -906,13 +909,13 @@ hypre_CyclicReduction( void *cyc_red_vdata, /* Step 2 */ fgrid = hypre_StructVectorGrid(x_l[l]); fgrid_ids = hypre_StructGridIDs(fgrid); - cgrid = hypre_StructVectorGrid(x_l[l+1]); + cgrid = hypre_StructVectorGrid(x_l[l + 1]); cgrid_boxes = hypre_StructGridBoxes(cgrid); cgrid_ids = hypre_StructGridIDs(cgrid); for (compute_i = 0; compute_i < 2; compute_i++) { - switch(compute_i) + switch (compute_i) { case 0: { @@ -943,10 +946,10 @@ hypre_CyclicReduction( void *cyc_red_vdata, A_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(A_l[l]), fi); x_dbox = hypre_BoxArrayBox(hypre_StructVectorDataSpace(x_l[l]), fi); - xc_dbox = hypre_BoxArrayBox(hypre_StructVectorDataSpace(x_l[l+1]), ci); + xc_dbox = hypre_BoxArrayBox(hypre_StructVectorDataSpace(x_l[l + 1]), ci); xp = hypre_StructVectorBoxData(x_l[l], fi); - xcp = hypre_StructVectorBoxData(x_l[l+1], ci); + xcp = hypre_StructVectorBoxData(x_l[l + 1], ci); hypre_SetIndex3(index, 0, 0, 0); hypre_IndexD(index, cdir) = -1; @@ -976,8 +979,8 @@ hypre_CyclicReduction( void *cyc_red_vdata, x_dbox, start, stride, xi, xc_dbox, startc, stridec, xci); { - xcp[xci] = xp[xi] - Awp[Ai] * xwp[xi+xwp_offset] - - Aep[Ai] * xep[xi+xep_offset]; + xcp[xci] = xp[xi] - Awp[Ai] * xwp[xi + xwp_offset] - + Aep[Ai] * xep[xi + xep_offset]; } hypre_BoxLoop3End(Ai, xi, xci); #undef DEVICE_VAR @@ -1048,7 +1051,7 @@ hypre_CyclicReduction( void *cyc_red_vdata, /* Step 1 */ fgrid = hypre_StructVectorGrid(x_l[l]); fgrid_ids = hypre_StructGridIDs(fgrid); - cgrid = hypre_StructVectorGrid(x_l[l+1]); + cgrid = hypre_StructVectorGrid(x_l[l + 1]); cgrid_boxes = hypre_StructGridBoxes(cgrid); cgrid_ids = hypre_StructGridIDs(cgrid); @@ -1066,10 +1069,10 @@ hypre_CyclicReduction( void *cyc_red_vdata, hypre_StructMapCoarseToFine(startc, cindex, stride, start); x_dbox = hypre_BoxArrayBox(hypre_StructVectorDataSpace(x_l[l]), fi); - xc_dbox = hypre_BoxArrayBox(hypre_StructVectorDataSpace(x_l[l+1]), ci); + xc_dbox = hypre_BoxArrayBox(hypre_StructVectorDataSpace(x_l[l + 1]), ci); xp = hypre_StructVectorBoxData(x_l[l], fi); - xcp = hypre_StructVectorBoxData(x_l[l+1], ci); + xcp = hypre_StructVectorBoxData(x_l[l + 1], ci); hypre_BoxGetSize(compute_box, loop_size); @@ -1087,7 +1090,7 @@ hypre_CyclicReduction( void *cyc_red_vdata, /* Step 2 */ for (compute_i = 0; compute_i < 2; compute_i++) { - switch(compute_i) + switch (compute_i) { case 0: { @@ -1142,7 +1145,7 @@ hypre_CyclicReduction( void *cyc_red_vdata, A_dbox, start, stride, Ai, x_dbox, start, stride, xi); { - xp[xi] -= (Awp[Ai]*xp[xi+xwp_offset] + Aep[Ai]*xp[xi+xep_offset]) / Ap[Ai]; + xp[xi] -= (Awp[Ai] * xp[xi + xwp_offset] + Aep[Ai] * xp[xi + xep_offset]) / Ap[Ai]; } hypre_BoxLoop2End(Ai, xi); #undef DEVICE_VAR @@ -1212,21 +1215,23 @@ hypre_CyclicReductionDestroy( void *cyc_red_vdata ) if (cyc_red_data) { + HYPRE_MemoryLocation memory_location = cyc_red_data -> memory_location; + hypre_BoxArrayDestroy(cyc_red_data -> base_points); hypre_StructGridDestroy(cyc_red_data -> grid_l[0]); hypre_StructMatrixDestroy(cyc_red_data -> A_l[0]); hypre_StructVectorDestroy(cyc_red_data -> x_l[0]); for (l = 0; l < ((cyc_red_data -> num_levels) - 1); l++) { - hypre_StructGridDestroy(cyc_red_data -> grid_l[l+1]); + hypre_StructGridDestroy(cyc_red_data -> grid_l[l + 1]); hypre_BoxArrayDestroy(cyc_red_data -> fine_points_l[l]); - hypre_StructMatrixDestroy(cyc_red_data -> A_l[l+1]); - hypre_StructVectorDestroy(cyc_red_data -> x_l[l+1]); + hypre_StructMatrixDestroy(cyc_red_data -> A_l[l + 1]); + hypre_StructVectorDestroy(cyc_red_data -> x_l[l + 1]); hypre_ComputePkgDestroy(cyc_red_data -> down_compute_pkg_l[l]); hypre_ComputePkgDestroy(cyc_red_data -> up_compute_pkg_l[l]); } hypre_BoxArrayDestroy(cyc_red_data -> fine_points_l[l]); - hypre_TFree(cyc_red_data -> data, HYPRE_MEMORY_DEVICE); + hypre_TFree(cyc_red_data -> data, memory_location); hypre_TFree(cyc_red_data -> grid_l, HYPRE_MEMORY_HOST); hypre_TFree(cyc_red_data -> fine_points_l, HYPRE_MEMORY_HOST); hypre_TFree(cyc_red_data -> A_l, HYPRE_MEMORY_HOST); diff --git a/external/hypre/src/struct_ls/headers b/external/hypre/src/struct_ls/headers old mode 100644 new mode 100755 index c8886a8c..795d6943 --- a/external/hypre/src/struct_ls/headers +++ b/external/hypre/src/struct_ls/headers @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/struct_ls/hybrid.c b/external/hypre/src/struct_ls/hybrid.c index fe686a62..e9b40633 100644 --- a/external/hypre/src/struct_ls/hybrid.c +++ b/external/hypre/src/struct_ls/hybrid.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -76,11 +76,11 @@ hypre_HybridCreate( MPI_Comm comm ) (hybrid_data -> krylov_precond) = NULL; /* initialize */ - (hybrid_data -> dscg_num_its) = 0; + (hybrid_data -> dscg_num_its) = 0; (hybrid_data -> krylov_num_its) = 0; (hybrid_data -> logging) = 0; (hybrid_data -> print_level) = 0; - + return (void *) hybrid_data; } @@ -314,12 +314,12 @@ hypre_HybridSetPrecond( void *krylov_vdata, void *krylov_precond ) { hypre_HybridData *krylov_data = (hypre_HybridData *)krylov_vdata; - + (krylov_data -> krylov_default) = 0; (krylov_data -> krylov_precond_solve) = krylov_precond_solve; (krylov_data -> krylov_precond_setup) = krylov_precond_setup; (krylov_data -> krylov_precond) = krylov_precond; - + return hypre_error_flag; } @@ -421,8 +421,13 @@ HYPRE_Int hypre_HybridSetup( void *hybrid_vdata, hypre_StructMatrix *A, hypre_StructVector *b, - hypre_StructVector *x ) + hypre_StructVector *x ) { + HYPRE_UNUSED_VAR(hybrid_vdata); + HYPRE_UNUSED_VAR(A); + HYPRE_UNUSED_VAR(b); + HYPRE_UNUSED_VAR(x); + return hypre_error_flag; } @@ -559,7 +564,7 @@ hypre_HybridSolve( void *hybrid_vdata, HYPRE_Int krylov_max_its = (hybrid_data -> krylov_max_its); HYPRE_Int logging = (hybrid_data -> logging); HYPRE_Int solver_type = (hybrid_data -> solver_type); - + HYPRE_Int krylov_default = (hybrid_data -> krylov_default); HYPRE_Int (*krylov_precond_solve)(void*, void*, void*, void*); HYPRE_Int (*krylov_precond_setup)(void*, void*, void*, void*); @@ -606,7 +611,7 @@ hypre_HybridSolve( void *hybrid_vdata, * Get additional information from PCG if logging on for hybrid solver. * Currently used as debugging flag to print norms. *--------------------------------------------------------------------*/ - if( logging > 1 ) + if ( logging > 1 ) { hypre_MPI_Comm_rank(comm, &myid ); hypre_PCGPrintLogging(krylov_solver, myid); @@ -652,7 +657,7 @@ hypre_HybridSolve( void *hybrid_vdata, hypre_GMRESGetConverged(krylov_solver, &converged); } - else + else { /*-------------------------------------------------------------------- * Setup BiCGSTAB @@ -688,17 +693,23 @@ hypre_HybridSolve( void *hybrid_vdata, } /*----------------------------------------------------------------------- - * if converged, done... + * if converged, done... *-----------------------------------------------------------------------*/ - if( converged ) + if ( converged ) { (hybrid_data -> final_rel_res_norm) = res_norm; if (solver_type == 1) + { hypre_PCGDestroy(krylov_solver); + } else if (solver_type == 2) + { hypre_GMRESDestroy(krylov_solver); + } else + { hypre_BiCGSTABDestroy(krylov_solver); + } } /*----------------------------------------------------------------------- @@ -775,7 +786,7 @@ hypre_HybridSolve( void *hybrid_vdata, * Get additional information from PCG if logging on for hybrid solver. * Currently used as debugging flag to print norms. *-----------------------------------------------------------------*/ - if( logging > 1 ) + if ( logging > 1 ) { hypre_MPI_Comm_rank(comm, &myid ); hypre_PCGPrintLogging(krylov_solver, myid); @@ -829,4 +840,3 @@ hypre_HybridSolve( void *hybrid_vdata, return hypre_error_flag; } - diff --git a/external/hypre/src/struct_ls/jacobi.c b/external/hypre/src/struct_ls/jacobi.c index 56345539..29bf986d 100644 --- a/external/hypre/src/struct_ls/jacobi.c +++ b/external/hypre/src/struct_ls/jacobi.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -30,7 +30,7 @@ hypre_JacobiCreate( MPI_Comm comm ) hypre_SetIndex3(stride, 1, 1, 1); hypre_SetIndex3(indices[0], 0, 0, 0); hypre_PointRelaxSetPointset(relax_data, 0, 1, stride, indices); - hypre_PointRelaxSetTol(relax_data,1.0e-6); + hypre_PointRelaxSetTol(relax_data, 1.0e-6); (jacobi_data -> relax_data) = relax_data; return (void *) jacobi_data; @@ -42,7 +42,7 @@ hypre_JacobiCreate( MPI_Comm comm ) HYPRE_Int hypre_JacobiDestroy( void *jacobi_vdata ) { - hypre_JacobiData *jacobi_data = (hypre_JacobiData *)jacobi_vdata; + hypre_JacobiData *jacobi_data = (hypre_JacobiData *)jacobi_vdata; if (jacobi_data) { diff --git a/external/hypre/src/struct_ls/pcg_struct.c b/external/hypre/src/struct_ls/pcg_struct.c index 60d421f1..f2002f9c 100644 --- a/external/hypre/src/struct_ls/pcg_struct.c +++ b/external/hypre/src/struct_ls/pcg_struct.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -24,7 +24,7 @@ hypre_StructKrylovCAlloc( size_t count, HYPRE_Int hypre_StructKrylovFree( void *ptr ) { - hypre_TFree( ptr , HYPRE_MEMORY_HOST); + hypre_TFree( ptr, HYPRE_MEMORY_HOST); return hypre_error_flag; } @@ -37,7 +37,7 @@ hypre_StructKrylovCreateVector( void *vvector ) { hypre_StructVector *vector = (hypre_StructVector *)vvector; hypre_StructVector *new_vector; - HYPRE_Int *num_ghost= hypre_StructVectorNumGhost(vector); + HYPRE_Int *num_ghost = hypre_StructVectorNumGhost(vector); new_vector = hypre_StructVectorCreate( hypre_StructVectorComm(vector), hypre_StructVectorGrid(vector) ); @@ -56,11 +56,11 @@ hypre_StructKrylovCreateVectorArray(HYPRE_Int n, void *vvector ) { hypre_StructVector *vector = (hypre_StructVector *)vvector; hypre_StructVector **new_vector; - HYPRE_Int *num_ghost= hypre_StructVectorNumGhost(vector); + HYPRE_Int *num_ghost = hypre_StructVectorNumGhost(vector); HYPRE_Int i; new_vector = hypre_CTAlloc(hypre_StructVector*, n, HYPRE_MEMORY_HOST); - for (i=0; i < n; i++) + for (i = 0; i < n; i++) { HYPRE_StructVectorCreate(hypre_StructVectorComm(vector), hypre_StructVectorGrid(vector), @@ -81,7 +81,7 @@ hypre_StructKrylovDestroyVector( void *vvector ) { hypre_StructVector *vector = (hypre_StructVector *)vvector; - return( hypre_StructVectorDestroy( vector ) ); + return ( hypre_StructVectorDestroy( vector ) ); } /*-------------------------------------------------------------------------- @@ -94,7 +94,7 @@ hypre_StructKrylovMatvecCreate( void *A, void *matvec_data; matvec_data = hypre_StructMatvecCreate(); - hypre_StructMatvecSetup(matvec_data, (hypre_StructMatrix *)A,(hypre_StructVector *)x); + hypre_StructMatvecSetup(matvec_data, (hypre_StructMatrix *)A, (hypre_StructVector *)x); return ( matvec_data ); } @@ -131,7 +131,7 @@ hypre_StructKrylovMatvecDestroy( void *matvec_data ) *--------------------------------------------------------------------------*/ HYPRE_Real -hypre_StructKrylovInnerProd( void *x, +hypre_StructKrylovInnerProd( void *x, void *y ) { return ( hypre_StructInnerProd( (hypre_StructVector *) x, @@ -143,7 +143,7 @@ hypre_StructKrylovInnerProd( void *x, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_StructKrylovCopyVector( void *x, +hypre_StructKrylovCopyVector( void *x, void *y ) { return ( hypre_StructCopy( (hypre_StructVector *) x, @@ -192,6 +192,11 @@ hypre_StructKrylovIdentitySetup( void *vdata, void *x ) { + HYPRE_UNUSED_VAR(vdata); + HYPRE_UNUSED_VAR(A); + HYPRE_UNUSED_VAR(b); + HYPRE_UNUSED_VAR(x); + return hypre_error_flag; } @@ -205,7 +210,10 @@ hypre_StructKrylovIdentity( void *vdata, void *x ) { - return( hypre_StructKrylovCopyVector( b, x ) ); + HYPRE_UNUSED_VAR(vdata); + HYPRE_UNUSED_VAR(A); + + return ( hypre_StructKrylovCopyVector( b, x ) ); } /*-------------------------------------------------------------------------- @@ -217,8 +225,7 @@ hypre_StructKrylovCommInfo( void *A, HYPRE_Int *num_procs ) { MPI_Comm comm = hypre_StructMatrixComm((hypre_StructMatrix *) A); - hypre_MPI_Comm_size(comm,num_procs); - hypre_MPI_Comm_rank(comm,my_id); + hypre_MPI_Comm_size(comm, num_procs); + hypre_MPI_Comm_rank(comm, my_id); return hypre_error_flag; } - diff --git a/external/hypre/src/struct_ls/pfmg.c b/external/hypre/src/struct_ls/pfmg.c index 4b670b62..ce91045f 100644 --- a/external/hypre/src/struct_ls/pfmg.c +++ b/external/hypre/src/struct_ls/pfmg.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -22,29 +22,29 @@ hypre_PFMGCreate( MPI_Comm comm ) (pfmg_data -> time_index) = hypre_InitializeTiming("PFMG"); /* set defaults */ - (pfmg_data -> tol) = 1.0e-06; - (pfmg_data -> max_iter) = 200; - (pfmg_data -> rel_change) = 0; - (pfmg_data -> zero_guess) = 0; - (pfmg_data -> max_levels) = 0; - (pfmg_data -> dxyz)[0] = 0.0; - (pfmg_data -> dxyz)[1] = 0.0; - (pfmg_data -> dxyz)[2] = 0.0; - (pfmg_data -> relax_type) = 1; /* weighted Jacobi */ - (pfmg_data -> jacobi_weight) = 0.0; - (pfmg_data -> usr_jacobi_weight)= 0; /* no user Jacobi weight */ - (pfmg_data -> rap_type) = 0; - (pfmg_data -> num_pre_relax) = 1; - (pfmg_data -> num_post_relax) = 1; - (pfmg_data -> skip_relax) = 1; - (pfmg_data -> logging) = 0; - (pfmg_data -> print_level) = 0; + (pfmg_data -> tol) = 1.0e-06; + (pfmg_data -> max_iter) = 200; + (pfmg_data -> rel_change) = 0; + (pfmg_data -> zero_guess) = 0; + (pfmg_data -> max_levels) = 0; + (pfmg_data -> dxyz)[0] = 0.0; + (pfmg_data -> dxyz)[1] = 0.0; + (pfmg_data -> dxyz)[2] = 0.0; + (pfmg_data -> relax_type) = 1; /* weighted Jacobi */ + (pfmg_data -> jacobi_weight) = 0.0; + (pfmg_data -> usr_jacobi_weight) = 0; /* no user Jacobi weight */ + (pfmg_data -> rap_type) = 0; + (pfmg_data -> num_pre_relax) = 1; + (pfmg_data -> num_post_relax) = 1; + (pfmg_data -> skip_relax) = 1; + (pfmg_data -> logging) = 0; + (pfmg_data -> print_level) = 0; + + (pfmg_data -> memory_location) = hypre_HandleMemoryLocation(hypre_handle()); /* initialize */ (pfmg_data -> num_levels) = -1; -#if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - (pfmg_data -> devicelevel) = 200; -#endif + return (void *) pfmg_data; } @@ -68,6 +68,8 @@ hypre_PFMGDestroy( void *pfmg_vdata ) hypre_TFree(pfmg_data -> rel_norms, HYPRE_MEMORY_HOST); } + HYPRE_MemoryLocation memory_location = pfmg_data -> memory_location; + if ((pfmg_data -> num_levels) > -1) { for (l = 0; l < (pfmg_data -> num_levels); l++) @@ -95,19 +97,19 @@ hypre_PFMGDestroy( void *pfmg_vdata ) hypre_StructVectorDestroy(pfmg_data -> x_l[0]); for (l = 0; l < ((pfmg_data -> num_levels) - 1); l++) { - hypre_StructGridDestroy(pfmg_data -> grid_l[l+1]); - hypre_StructGridDestroy(pfmg_data -> P_grid_l[l+1]); - hypre_StructMatrixDestroy(pfmg_data -> A_l[l+1]); + hypre_StructGridDestroy(pfmg_data -> grid_l[l + 1]); + hypre_StructGridDestroy(pfmg_data -> P_grid_l[l + 1]); + hypre_StructMatrixDestroy(pfmg_data -> A_l[l + 1]); hypre_StructMatrixDestroy(pfmg_data -> P_l[l]); - hypre_StructVectorDestroy(pfmg_data -> b_l[l+1]); - hypre_StructVectorDestroy(pfmg_data -> x_l[l+1]); - hypre_StructVectorDestroy(pfmg_data -> tx_l[l+1]); + hypre_StructVectorDestroy(pfmg_data -> b_l[l + 1]); + hypre_StructVectorDestroy(pfmg_data -> x_l[l + 1]); + hypre_StructVectorDestroy(pfmg_data -> tx_l[l + 1]); } - hypre_TFree(pfmg_data -> data, HYPRE_MEMORY_DEVICE); - hypre_TFree(pfmg_data -> data_const, HYPRE_MEMORY_HOST); + hypre_TFree(pfmg_data -> data, memory_location); + hypre_TFree(pfmg_data -> data_const, HYPRE_MEMORY_HOST); - hypre_TFree(pfmg_data -> cdir_l, HYPRE_MEMORY_HOST); + hypre_TFree(pfmg_data -> cdir_l, HYPRE_MEMORY_HOST); hypre_TFree(pfmg_data -> active_l, HYPRE_MEMORY_HOST); hypre_TFree(pfmg_data -> grid_l, HYPRE_MEMORY_HOST); hypre_TFree(pfmg_data -> P_grid_l, HYPRE_MEMORY_HOST); @@ -287,7 +289,7 @@ hypre_PFMGSetJacobiWeight( void *pfmg_vdata, hypre_PFMGData *pfmg_data = (hypre_PFMGData *)pfmg_vdata; (pfmg_data -> jacobi_weight) = weight; - (pfmg_data -> usr_jacobi_weight)= 1; + (pfmg_data -> usr_jacobi_weight) = 1; return hypre_error_flag; } @@ -507,8 +509,8 @@ hypre_PFMGPrintLogging( void *pfmg_vdata, { for (i = 0; i < num_iterations; i++) { - hypre_printf("Residual norm[%d] = %e ",i,norms[i]); - hypre_printf("Relative residual norm[%d] = %e\n",i,rel_norms[i]); + hypre_printf("Residual norm[%d] = %e ", i, norms[i]); + hypre_printf("Relative residual norm[%d] = %e\n", i, rel_norms[i]); } } } @@ -539,7 +541,7 @@ hypre_PFMGGetFinalRelativeResidualNorm( void *pfmg_vdata, } else if (num_iterations == max_iter) { - *relative_residual_norm = rel_norms[num_iterations-1]; + *relative_residual_norm = rel_norms[num_iterations - 1]; } else { diff --git a/external/hypre/src/struct_ls/pfmg.h b/external/hypre/src/struct_ls/pfmg.h index 0b6c7ef3..1291ffd6 100644 --- a/external/hypre/src/struct_ls/pfmg.h +++ b/external/hypre/src/struct_ls/pfmg.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -47,6 +47,7 @@ typedef struct hypre_StructGrid **grid_l; hypre_StructGrid **P_grid_l; + HYPRE_MemoryLocation memory_location; /* memory location of data */ HYPRE_Real *data; HYPRE_Real *data_const; hypre_StructMatrix **A_l; @@ -75,7 +76,7 @@ typedef struct HYPRE_Real *norms; HYPRE_Real *rel_norms; #if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - HYPRE_Int devicelevel; + HYPRE_Int devicelevel; #endif } hypre_PFMGData; diff --git a/external/hypre/src/struct_ls/pfmg2_setup_rap.c b/external/hypre/src/struct_ls/pfmg2_setup_rap.c index fd408cde..011f4f29 100644 --- a/external/hypre/src/struct_ls/pfmg2_setup_rap.c +++ b/external/hypre/src/struct_ls/pfmg2_setup_rap.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -33,6 +33,9 @@ hypre_PFMG2CreateRAPOp( hypre_StructMatrix *R, hypre_StructGrid *coarse_grid, HYPRE_Int cdir ) { + HYPRE_UNUSED_VAR(R); + HYPRE_UNUSED_VAR(P); + hypre_StructMatrix *RAP; hypre_Index *RAP_stencil_shape; @@ -73,7 +76,7 @@ hypre_PFMG2CreateRAPOp( hypre_StructMatrix *R, /*-------------------------------------------------------------- * Storage for 9 elements (c,w,e,n,s,sw,se,nw,se) *--------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,i,j,0); + hypre_SetIndex3(index_temp, i, j, 0); MapIndex(index_temp, cdir, RAP_stencil_shape[stencil_rank]); stencil_rank++; } @@ -103,9 +106,9 @@ hypre_PFMG2CreateRAPOp( hypre_StructMatrix *R, /*-------------------------------------------------------------- * Store 5 elements in (c,w,s,sw,se) *--------------------------------------------------------------*/ - if( i+j <=0 ) + if ( i + j <= 0 ) { - hypre_SetIndex3(index_temp,i,j,0); + hypre_SetIndex3(index_temp, i, j, 0); MapIndex(index_temp, cdir, RAP_stencil_shape[stencil_rank]); stencil_rank++; } @@ -185,16 +188,16 @@ hypre_PFMG2BuildRAPSym( hypre_StructMatrix *A, constant_coefficient = hypre_StructMatrixConstantCoefficient(RAP); constant_coefficient_A = hypre_StructMatrixConstantCoefficient(A); - hypre_assert( constant_coefficient==0 || constant_coefficient==1 ); + hypre_assert( constant_coefficient == 0 || constant_coefficient == 1 ); hypre_assert( hypre_StructMatrixConstantCoefficient(R) == constant_coefficient ); hypre_assert( hypre_StructMatrixConstantCoefficient(P) == constant_coefficient ); - if (constant_coefficient==1 ) + if (constant_coefficient == 1 ) { - hypre_assert( constant_coefficient_A==1 ); + hypre_assert( constant_coefficient_A == 1 ); } else { - hypre_assert( constant_coefficient_A==0 || constant_coefficient_A==2 ); + hypre_assert( constant_coefficient_A == 0 || constant_coefficient_A == 2 ); } fi = 0; @@ -222,7 +225,7 @@ hypre_PFMG2BuildRAPSym( hypre_StructMatrix *A, case 5: - if ( constant_coefficient==1 ) + if ( constant_coefficient == 1 ) { hypre_PFMG2BuildRAPSym_onebox_FSS5_CC1( ci, fi, A, P, R, cdir, cindex, cstride, RAP ); @@ -235,16 +238,16 @@ hypre_PFMG2BuildRAPSym( hypre_StructMatrix *A, break; - /*-------------------------------------------------------------- - * Loop for symmetric 9-point fine grid operator; produces a - * symmetric 9-point coarse grid operator. We calculate only the - * lower triangular stencil entries: (southwest, south, southeast, - * west, and center). - *--------------------------------------------------------------*/ + /*-------------------------------------------------------------- + * Loop for symmetric 9-point fine grid operator; produces a + * symmetric 9-point coarse grid operator. We calculate only the + * lower triangular stencil entries: (southwest, south, southeast, + * west, and center). + *--------------------------------------------------------------*/ default: - if ( constant_coefficient==1 ) + if ( constant_coefficient == 1 ) { hypre_PFMG2BuildRAPSym_onebox_FSS9_CC1( ci, fi, A, P, R, cdir, cindex, cstride, RAP ); @@ -337,11 +340,11 @@ hypre_PFMG2BuildRAPSym_onebox_FSS5_CC0( * pb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); pa = hypre_StructMatrixExtractPointerByIndex(P, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); pb = hypre_StructMatrixExtractPointerByIndex(P, fi, index); @@ -354,11 +357,11 @@ hypre_PFMG2BuildRAPSym_onebox_FSS5_CC0( * rb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); ra = hypre_StructMatrixExtractPointerByIndex(R, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); rb = hypre_StructMatrixExtractPointerByIndex(R, fi, index); @@ -375,23 +378,23 @@ hypre_PFMG2BuildRAPSym_onebox_FSS5_CC0( * a_cn is pointer for north coefficient *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,0); + hypre_SetIndex3(index_temp, 0, 0, 0); MapIndex(index_temp, cdir, index); a_cc = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,0,0); + hypre_SetIndex3(index_temp, -1, 0, 0); MapIndex(index_temp, cdir, index); a_cw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); a_ce = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); a_cs = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); a_cn = hypre_StructMatrixExtractPointerByIndex(A, fi, index); @@ -404,23 +407,23 @@ hypre_PFMG2BuildRAPSym_onebox_FSS5_CC0( * rap_cc is pointer for center coefficient (etc.) *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,0); + hypre_SetIndex3(index_temp, 0, 0, 0); MapIndex(index_temp, cdir, index); rap_cc = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,0,0); + hypre_SetIndex3(index_temp, -1, 0, 0); MapIndex(index_temp, cdir, index); rap_cw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); rap_cs = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,-1,0); + hypre_SetIndex3(index_temp, -1, -1, 0); MapIndex(index_temp, cdir, index); rap_csw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,-1,0); + hypre_SetIndex3(index_temp, 1, -1, 0); MapIndex(index_temp, cdir, index); rap_cse = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); @@ -432,24 +435,24 @@ hypre_PFMG2BuildRAPSym_onebox_FSS5_CC0( * Offsets are used in refering to data associated with other points. *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); - yOffsetP = hypre_BoxOffsetDistance(P_dbox,index); + yOffsetP = hypre_BoxOffsetDistance(P_dbox, index); if ( constant_coefficient_A == 0 ) { - yOffsetA = hypre_BoxOffsetDistance(A_dbox,index); + yOffsetA = hypre_BoxOffsetDistance(A_dbox, index); } else { yOffsetA_offd = 0; - yOffsetA_diag = hypre_BoxOffsetDistance(A_dbox,index); + yOffsetA_diag = hypre_BoxOffsetDistance(A_dbox, index); } - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); - xOffsetP = hypre_BoxOffsetDistance(P_dbox,index); + xOffsetP = hypre_BoxOffsetDistance(P_dbox, index); /*-------------------------------------------------------------- @@ -474,27 +477,27 @@ hypre_PFMG2BuildRAPSym_onebox_FSS5_CC0( HYPRE_Int iAp1 = iA + yOffsetA; HYPRE_Int iP1 = iP - yOffsetP - xOffsetP; - rap_csw[iAc] = rb[iR-rbOffset] * a_cw[iAm1] * pa[iP1]; + rap_csw[iAc] = rb[iR - rbOffset] * a_cw[iAm1] * pa[iP1]; iP1 = iP - yOffsetP; - rap_cs[iAc] = rb[iR-rbOffset] * a_cc[iAm1] * pa[iP1] - + rb[iR-rbOffset] * a_cs[iAm1] - + a_cs[iA] * pa[iP1]; + rap_cs[iAc] = rb[iR - rbOffset] * a_cc[iAm1] * pa[iP1] + + rb[iR - rbOffset] * a_cs[iAm1] + + a_cs[iA] * pa[iP1]; iP1 = iP - yOffsetP + xOffsetP; - rap_cse[iAc] = rb[iR-rbOffset] * a_ce[iAm1] * pa[iP1]; + rap_cse[iAc] = rb[iR - rbOffset] * a_ce[iAm1] * pa[iP1]; iP1 = iP - xOffsetP; rap_cw[iAc] = a_cw[iA] - + rb[iR-rbOffset] * a_cw[iAm1] * pb[iP1-pbOffset] - + ra[iR] * a_cw[iAp1] * pa[iP1]; + + rb[iR - rbOffset] * a_cw[iAm1] * pb[iP1 - pbOffset] + + ra[iR] * a_cw[iAp1] * pa[iP1]; rap_cc[iAc] = a_cc[iA] - + rb[iR-rbOffset] * a_cc[iAm1] * pb[iP-pbOffset] - + ra[iR] * a_cc[iAp1] * pa[iP] - + rb[iR-rbOffset] * a_cn[iAm1] - + ra[iR] * a_cs[iAp1] - + a_cs[iA] * pb[iP-pbOffset] - + a_cn[iA] * pa[iP]; + + rb[iR - rbOffset] * a_cc[iAm1] * pb[iP - pbOffset] + + ra[iR] * a_cc[iAp1] * pa[iP] + + rb[iR - rbOffset] * a_cn[iAm1] + + ra[iR] * a_cs[iAp1] + + a_cs[iA] * pb[iP - pbOffset] + + a_cn[iA] * pa[iP]; } hypre_BoxLoop4End(iP, iR, iA, iAc); #undef DEVICE_VAR @@ -525,34 +528,34 @@ hypre_PFMG2BuildRAPSym_onebox_FSS5_CC0( HYPRE_Int iAp1 = iA + yOffsetA_diag; HYPRE_Int iP1 = iP - yOffsetP - xOffsetP; - rap_csw[iAc] = rb[iR-rbOffset] * a_cw_offdm1 * pa[iP1]; + rap_csw[iAc] = rb[iR - rbOffset] * a_cw_offdm1 * pa[iP1]; iP1 = iP - yOffsetP; - rap_cs[iAc] = rb[iR-rbOffset] * a_cc[iAm1] * pa[iP1] - + rb[iR-rbOffset] * a_cs_offdm1 - + a_cs_offd * pa[iP1]; + rap_cs[iAc] = rb[iR - rbOffset] * a_cc[iAm1] * pa[iP1] + + rb[iR - rbOffset] * a_cs_offdm1 + + a_cs_offd * pa[iP1]; iP1 = iP - yOffsetP + xOffsetP; - rap_cse[iAc] = rb[iR-rbOffset] * a_ce_offdm1 * pa[iP1]; + rap_cse[iAc] = rb[iR - rbOffset] * a_ce_offdm1 * pa[iP1]; iP1 = iP - xOffsetP; rap_cw[iAc] = a_cw_offd - + rb[iR-rbOffset] * a_cw_offdm1 * pb[iP1-pbOffset] - + ra[iR] * a_cw_offdp1 * pa[iP1]; + + rb[iR - rbOffset] * a_cw_offdm1 * pb[iP1 - pbOffset] + + ra[iR] * a_cw_offdp1 * pa[iP1]; rap_cc[iAc] = a_cc[iA] - + rb[iR-rbOffset] * a_cc[iAm1] * pb[iP-pbOffset] - + ra[iR] * a_cc[iAp1] * pa[iP] - + rb[iR-rbOffset] * a_cn_offdm1 - + ra[iR] * a_cs_offdp1 - + a_cs_offd * pb[iP-pbOffset] - + a_cn_offd * pa[iP]; + + rb[iR - rbOffset] * a_cc[iAm1] * pb[iP - pbOffset] + + ra[iR] * a_cc[iAp1] * pa[iP] + + rb[iR - rbOffset] * a_cn_offdm1 + + ra[iR] * a_cs_offdp1 + + a_cs_offd * pb[iP - pbOffset] + + a_cn_offd * pa[iP]; } hypre_BoxLoop4End(iP, iR, iA, iAc); #undef DEVICE_VAR } -/* } *//* end ForBoxI */ + /* } *//* end ForBoxI */ return hypre_error_flag; } @@ -610,11 +613,11 @@ hypre_PFMG2BuildRAPSym_onebox_FSS5_CC1( * pb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); pa = hypre_StructMatrixExtractPointerByIndex(P, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); pb = hypre_StructMatrixExtractPointerByIndex(P, fi, index); @@ -625,11 +628,11 @@ hypre_PFMG2BuildRAPSym_onebox_FSS5_CC1( * rb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); ra = hypre_StructMatrixExtractPointerByIndex(R, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); rb = hypre_StructMatrixExtractPointerByIndex(R, fi, index); @@ -644,23 +647,23 @@ hypre_PFMG2BuildRAPSym_onebox_FSS5_CC1( * a_cn is pointer for north coefficient *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,0); + hypre_SetIndex3(index_temp, 0, 0, 0); MapIndex(index_temp, cdir, index); a_cc = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,0,0); + hypre_SetIndex3(index_temp, -1, 0, 0); MapIndex(index_temp, cdir, index); a_cw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); a_ce = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); a_cs = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); a_cn = hypre_StructMatrixExtractPointerByIndex(A, fi, index); @@ -672,23 +675,23 @@ hypre_PFMG2BuildRAPSym_onebox_FSS5_CC1( * rap_cc is pointer for center coefficient (etc.) *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,0); + hypre_SetIndex3(index_temp, 0, 0, 0); MapIndex(index_temp, cdir, index); rap_cc = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,0,0); + hypre_SetIndex3(index_temp, -1, 0, 0); MapIndex(index_temp, cdir, index); rap_cw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); rap_cs = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,-1,0); + hypre_SetIndex3(index_temp, -1, -1, 0); MapIndex(index_temp, cdir, index); rap_csw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,-1,0); + hypre_SetIndex3(index_temp, 1, -1, 0); MapIndex(index_temp, cdir, index); rap_cse = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); @@ -700,13 +703,13 @@ hypre_PFMG2BuildRAPSym_onebox_FSS5_CC1( * Offsets are used in refering to data associated with other points. *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); yOffsetA = 0; yOffsetP = 0; - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); xOffsetP = 0; @@ -736,26 +739,26 @@ hypre_PFMG2BuildRAPSym_onebox_FSS5_CC1( iP1 = iP - yOffsetP; rap_cs[iAc] = rb[iR] * a_cc[iAm1] * pa[iP1] - + rb[iR] * a_cs[iAm1] - + a_cs[iA] * pa[iP1]; + + rb[iR] * a_cs[iAm1] + + a_cs[iA] * pa[iP1]; iP1 = iP - yOffsetP + xOffsetP; rap_cse[iAc] = rb[iR] * a_ce[iAm1] * pa[iP1]; iP1 = iP - xOffsetP; rap_cw[iAc] = a_cw[iA] - + rb[iR] * a_cw[iAm1] * pb[iP1] - + ra[iR] * a_cw[iAp1] * pa[iP1]; + + rb[iR] * a_cw[iAm1] * pb[iP1] + + ra[iR] * a_cw[iAp1] * pa[iP1]; rap_cc[iAc] = a_cc[iA] - + rb[iR] * a_cc[iAm1] * pb[iP] - + ra[iR] * a_cc[iAp1] * pa[iP] - + rb[iR] * a_cn[iAm1] - + ra[iR] * a_cs[iAp1] - + a_cs[iA] * pb[iP] - + a_cn[iA] * pa[iP]; + + rb[iR] * a_cc[iAm1] * pb[iP] + + ra[iR] * a_cc[iAp1] * pa[iP] + + rb[iR] * a_cn[iAm1] + + ra[iR] * a_cs[iAp1] + + a_cs[iA] * pb[iP] + + a_cn[iA] * pa[iP]; -/* } *//* end ForBoxI */ + /* } *//* end ForBoxI */ return hypre_error_flag; } @@ -836,11 +839,11 @@ hypre_PFMG2BuildRAPSym_onebox_FSS9_CC0( * pb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); pa = hypre_StructMatrixExtractPointerByIndex(P, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); pb = hypre_StructMatrixExtractPointerByIndex(P, fi, index); @@ -853,11 +856,11 @@ hypre_PFMG2BuildRAPSym_onebox_FSS9_CC0( * rb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); ra = hypre_StructMatrixExtractPointerByIndex(R, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); rb = hypre_StructMatrixExtractPointerByIndex(R, fi, index); @@ -873,23 +876,23 @@ hypre_PFMG2BuildRAPSym_onebox_FSS9_CC0( * a_cn is pointer for north coefficient *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,0); + hypre_SetIndex3(index_temp, 0, 0, 0); MapIndex(index_temp, cdir, index); a_cc = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,0,0); + hypre_SetIndex3(index_temp, -1, 0, 0); MapIndex(index_temp, cdir, index); a_cw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); a_ce = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); a_cs = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); a_cn = hypre_StructMatrixExtractPointerByIndex(A, fi, index); @@ -902,15 +905,15 @@ hypre_PFMG2BuildRAPSym_onebox_FSS9_CC0( * a_cne is pointer for northeast coefficient *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,-1,-1,0); + hypre_SetIndex3(index_temp, -1, -1, 0); MapIndex(index_temp, cdir, index); a_csw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,-1,0); + hypre_SetIndex3(index_temp, 1, -1, 0); MapIndex(index_temp, cdir, index); a_cse = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,1,0); + hypre_SetIndex3(index_temp, -1, 1, 0); MapIndex(index_temp, cdir, index); a_cnw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); @@ -922,23 +925,23 @@ hypre_PFMG2BuildRAPSym_onebox_FSS9_CC0( * rap_cc is pointer for center coefficient (etc.) *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,0); + hypre_SetIndex3(index_temp, 0, 0, 0); MapIndex(index_temp, cdir, index); rap_cc = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,0,0); + hypre_SetIndex3(index_temp, -1, 0, 0); MapIndex(index_temp, cdir, index); rap_cw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); rap_cs = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,-1,0); + hypre_SetIndex3(index_temp, -1, -1, 0); MapIndex(index_temp, cdir, index); rap_csw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,-1,0); + hypre_SetIndex3(index_temp, 1, -1, 0); MapIndex(index_temp, cdir, index); rap_cse = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); @@ -950,13 +953,13 @@ hypre_PFMG2BuildRAPSym_onebox_FSS9_CC0( * Offsets are used in refering to data associated with other points. *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); - yOffsetP = hypre_BoxOffsetDistance(P_dbox,index); + yOffsetP = hypre_BoxOffsetDistance(P_dbox, index); if ( constant_coefficient_A == 0 ) { - yOffsetA = hypre_BoxOffsetDistance(A_dbox,index); + yOffsetA = hypre_BoxOffsetDistance(A_dbox, index); } else { @@ -964,10 +967,10 @@ hypre_PFMG2BuildRAPSym_onebox_FSS9_CC0( yOffsetA_diag = 0; } - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); - xOffsetP = hypre_BoxOffsetDistance(P_dbox,index); + xOffsetP = hypre_BoxOffsetDistance(P_dbox, index); /*-------------------------------------------------------------- * Loop for symmetric 9-point fine grid operator; produces a @@ -991,36 +994,36 @@ hypre_PFMG2BuildRAPSym_onebox_FSS9_CC0( HYPRE_Int iAp1 = iA + yOffsetA; HYPRE_Int iP1 = iP - yOffsetP - xOffsetP; - rap_csw[iAc] = rb[iR-rbOffset] * a_cw[iAm1] * pa[iP1] - + rb[iR-rbOffset] * a_csw[iAm1] - + a_csw[iA] * pa[iP1]; + rap_csw[iAc] = rb[iR - rbOffset] * a_cw[iAm1] * pa[iP1] + + rb[iR - rbOffset] * a_csw[iAm1] + + a_csw[iA] * pa[iP1]; iP1 = iP - yOffsetP; - rap_cs[iAc] = rb[iR-rbOffset] * a_cc[iAm1] * pa[iP1] - + rb[iR-rbOffset] * a_cs[iAm1] - + a_cs[iA] * pa[iP1]; + rap_cs[iAc] = rb[iR - rbOffset] * a_cc[iAm1] * pa[iP1] + + rb[iR - rbOffset] * a_cs[iAm1] + + a_cs[iA] * pa[iP1]; iP1 = iP - yOffsetP + xOffsetP; - rap_cse[iAc] = rb[iR-rbOffset] * a_ce[iAm1] * pa[iP1] - + rb[iR-rbOffset] * a_cse[iAm1] - + a_cse[iA] * pa[iP1]; + rap_cse[iAc] = rb[iR - rbOffset] * a_ce[iAm1] * pa[iP1] + + rb[iR - rbOffset] * a_cse[iAm1] + + a_cse[iA] * pa[iP1]; iP1 = iP - xOffsetP; rap_cw[iAc] = a_cw[iA] - + rb[iR-rbOffset] * a_cw[iAm1] * pb[iP1-pbOffset] - + ra[iR] * a_cw[iAp1] * pa[iP1] - + rb[iR-rbOffset] * a_cnw[iAm1] - + ra[iR] * a_csw[iAp1] - + a_csw[iA] * pb[iP1-pbOffset] - + a_cnw[iA] * pa[iP1]; + + rb[iR - rbOffset] * a_cw[iAm1] * pb[iP1 - pbOffset] + + ra[iR] * a_cw[iAp1] * pa[iP1] + + rb[iR - rbOffset] * a_cnw[iAm1] + + ra[iR] * a_csw[iAp1] + + a_csw[iA] * pb[iP1 - pbOffset] + + a_cnw[iA] * pa[iP1]; rap_cc[iAc] = a_cc[iA] - + rb[iR-rbOffset] * a_cc[iAm1] * pb[iP-pbOffset] - + ra[iR] * a_cc[iAp1] * pa[iP] - + rb[iR-rbOffset] * a_cn[iAm1] - + ra[iR] * a_cs[iAp1] - + a_cs[iA] * pb[iP-pbOffset] - + a_cn[iA] * pa[iP]; + + rb[iR - rbOffset] * a_cc[iAm1] * pb[iP - pbOffset] + + ra[iR] * a_cc[iAp1] * pa[iP] + + rb[iR - rbOffset] * a_cn[iAm1] + + ra[iR] * a_cs[iAp1] + + a_cs[iA] * pb[iP - pbOffset] + + a_cn[iA] * pa[iP]; } hypre_BoxLoop4End(iP, iR, iA, iAc); @@ -1059,43 +1062,43 @@ hypre_PFMG2BuildRAPSym_onebox_FSS9_CC0( HYPRE_Int iAp1 = iA + yOffsetA_diag; HYPRE_Int iP1 = iP - yOffsetP - xOffsetP; - rap_csw[iAc] = rb[iR-rbOffset] * a_cw_offdm1 * pa[iP1] - + rb[iR-rbOffset] * a_csw_offdm1 - + a_csw_offd * pa[iP1]; + rap_csw[iAc] = rb[iR - rbOffset] * a_cw_offdm1 * pa[iP1] + + rb[iR - rbOffset] * a_csw_offdm1 + + a_csw_offd * pa[iP1]; iP1 = iP - yOffsetP; - rap_cs[iAc] = rb[iR-rbOffset] * a_cc[iAm1] * pa[iP1] - + rb[iR-rbOffset] * a_cs_offdm1 - + a_cs_offd * pa[iP1]; + rap_cs[iAc] = rb[iR - rbOffset] * a_cc[iAm1] * pa[iP1] + + rb[iR - rbOffset] * a_cs_offdm1 + + a_cs_offd * pa[iP1]; iP1 = iP - yOffsetP + xOffsetP; - rap_cse[iAc] = rb[iR-rbOffset] * a_ce_offdm1 * pa[iP1] - + rb[iR-rbOffset] * a_cse_offdm1 - + a_cse_offd * pa[iP1]; + rap_cse[iAc] = rb[iR - rbOffset] * a_ce_offdm1 * pa[iP1] + + rb[iR - rbOffset] * a_cse_offdm1 + + a_cse_offd * pa[iP1]; iP1 = iP - xOffsetP; rap_cw[iAc] = a_cw_offd - + rb[iR-rbOffset] * a_cw_offdm1 * pb[iP1-pbOffset] - + ra[iR] * a_cw_offdp1 * pa[iP1] - + rb[iR-rbOffset] * a_cnw_offdm1 - + ra[iR] * a_csw_offdp1 - + a_csw_offd * pb[iP1-pbOffset] - + a_cnw_offd * pa[iP1]; + + rb[iR - rbOffset] * a_cw_offdm1 * pb[iP1 - pbOffset] + + ra[iR] * a_cw_offdp1 * pa[iP1] + + rb[iR - rbOffset] * a_cnw_offdm1 + + ra[iR] * a_csw_offdp1 + + a_csw_offd * pb[iP1 - pbOffset] + + a_cnw_offd * pa[iP1]; rap_cc[iAc] = a_cc[iA] - + rb[iR-rbOffset] * a_cc[iAm1] * pb[iP-pbOffset] - + ra[iR] * a_cc[iAp1] * pa[iP] - + rb[iR-rbOffset] * a_cn_offdm1 - + ra[iR] * a_cs_offdp1 - + a_cs_offd * pb[iP-pbOffset] - + a_cn_offd * pa[iP]; + + rb[iR - rbOffset] * a_cc[iAm1] * pb[iP - pbOffset] + + ra[iR] * a_cc[iAp1] * pa[iP] + + rb[iR - rbOffset] * a_cn_offdm1 + + ra[iR] * a_cs_offdp1 + + a_cs_offd * pb[iP - pbOffset] + + a_cn_offd * pa[iP]; } hypre_BoxLoop4End(iP, iR, iA, iAc); #undef DEVICE_VAR } -/* }*/ /* end ForBoxI */ + /* }*/ /* end ForBoxI */ return hypre_error_flag; } @@ -1153,11 +1156,11 @@ hypre_PFMG2BuildRAPSym_onebox_FSS9_CC1( * pb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); pa = hypre_StructMatrixExtractPointerByIndex(P, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); pb = hypre_StructMatrixExtractPointerByIndex(P, fi, index); @@ -1168,11 +1171,11 @@ hypre_PFMG2BuildRAPSym_onebox_FSS9_CC1( * rb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); ra = hypre_StructMatrixExtractPointerByIndex(R, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); rb = hypre_StructMatrixExtractPointerByIndex(R, fi, index); @@ -1187,23 +1190,23 @@ hypre_PFMG2BuildRAPSym_onebox_FSS9_CC1( * a_cn is pointer for north coefficient *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,0); + hypre_SetIndex3(index_temp, 0, 0, 0); MapIndex(index_temp, cdir, index); a_cc = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,0,0); + hypre_SetIndex3(index_temp, -1, 0, 0); MapIndex(index_temp, cdir, index); a_cw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); a_ce = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); a_cs = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); a_cn = hypre_StructMatrixExtractPointerByIndex(A, fi, index); @@ -1216,15 +1219,15 @@ hypre_PFMG2BuildRAPSym_onebox_FSS9_CC1( * a_cne is pointer for northeast coefficient *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,-1,-1,0); + hypre_SetIndex3(index_temp, -1, -1, 0); MapIndex(index_temp, cdir, index); a_csw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,-1,0); + hypre_SetIndex3(index_temp, 1, -1, 0); MapIndex(index_temp, cdir, index); a_cse = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,1,0); + hypre_SetIndex3(index_temp, -1, 1, 0); MapIndex(index_temp, cdir, index); a_cnw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); @@ -1236,23 +1239,23 @@ hypre_PFMG2BuildRAPSym_onebox_FSS9_CC1( * rap_cc is pointer for center coefficient (etc.) *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,0); + hypre_SetIndex3(index_temp, 0, 0, 0); MapIndex(index_temp, cdir, index); rap_cc = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,0,0); + hypre_SetIndex3(index_temp, -1, 0, 0); MapIndex(index_temp, cdir, index); rap_cw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); rap_cs = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,-1,0); + hypre_SetIndex3(index_temp, -1, -1, 0); MapIndex(index_temp, cdir, index); rap_csw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,-1,0); + hypre_SetIndex3(index_temp, 1, -1, 0); MapIndex(index_temp, cdir, index); rap_cse = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); @@ -1264,13 +1267,13 @@ hypre_PFMG2BuildRAPSym_onebox_FSS9_CC1( * Offsets are used in refering to data associated with other points. *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); yOffsetA = 0; yOffsetP = 0; - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); xOffsetP = 0; @@ -1297,39 +1300,39 @@ hypre_PFMG2BuildRAPSym_onebox_FSS9_CC1( iP1 = iP - yOffsetP - xOffsetP; rap_csw[iAc] = rb[iR] * a_cw[iAm1] * pa[iP1] - + rb[iR] * a_csw[iAm1] - + a_csw[iA] * pa[iP1]; + + rb[iR] * a_csw[iAm1] + + a_csw[iA] * pa[iP1]; iP1 = iP - yOffsetP; rap_cs[iAc] = rb[iR] * a_cc[iAm1] * pa[iP1] - + rb[iR] * a_cs[iAm1] - + a_cs[iA] * pa[iP1]; + + rb[iR] * a_cs[iAm1] + + a_cs[iA] * pa[iP1]; iP1 = iP - yOffsetP + xOffsetP; rap_cse[iAc] = rb[iR] * a_ce[iAm1] * pa[iP1] - + rb[iR] * a_cse[iAm1] - + a_cse[iA] * pa[iP1]; + + rb[iR] * a_cse[iAm1] + + a_cse[iA] * pa[iP1]; iP1 = iP - xOffsetP; rap_cw[iAc] = a_cw[iA] - + rb[iR] * a_cw[iAm1] * pb[iP1] - + ra[iR] * a_cw[iAp1] * pa[iP1] - + rb[iR] * a_cnw[iAm1] - + ra[iR] * a_csw[iAp1] - + a_csw[iA] * pb[iP1] - + a_cnw[iA] * pa[iP1]; + + rb[iR] * a_cw[iAm1] * pb[iP1] + + ra[iR] * a_cw[iAp1] * pa[iP1] + + rb[iR] * a_cnw[iAm1] + + ra[iR] * a_csw[iAp1] + + a_csw[iA] * pb[iP1] + + a_cnw[iA] * pa[iP1]; rap_cc[iAc] = a_cc[iA] - + rb[iR] * a_cc[iAm1] * pb[iP] - + ra[iR] * a_cc[iAp1] * pa[iP] - + rb[iR] * a_cn[iAm1] - + ra[iR] * a_cs[iAp1] - + a_cs[iA] * pb[iP] - + a_cn[iA] * pa[iP]; + + rb[iR] * a_cc[iAm1] * pb[iP] + + ra[iR] * a_cc[iAp1] * pa[iP] + + rb[iR] * a_cn[iAm1] + + ra[iR] * a_cs[iAp1] + + a_cs[iA] * pb[iP] + + a_cn[iA] * pa[iP]; -/* }*/ /* end ForBoxI */ + /* }*/ /* end ForBoxI */ return hypre_error_flag; } @@ -1377,10 +1380,10 @@ hypre_PFMG2BuildRAPNoSym( hypre_StructMatrix *A, } else { -/* hypre_assert( hypre_StructMatrixConstantCoefficient(R)==0 ); - hypre_assert( hypre_StructMatrixConstantCoefficient(A)==0 ); - hypre_assert( hypre_StructMatrixConstantCoefficient(P)==0 ); -*/ + /* hypre_assert( hypre_StructMatrixConstantCoefficient(R)==0 ); + hypre_assert( hypre_StructMatrixConstantCoefficient(A)==0 ); + hypre_assert( hypre_StructMatrixConstantCoefficient(P)==0 ); + */ } fi = 0; @@ -1407,7 +1410,7 @@ hypre_PFMG2BuildRAPNoSym( hypre_StructMatrix *A, case 5: - if ( constant_coefficient==1 ) + if ( constant_coefficient == 1 ) { hypre_PFMG2BuildRAPNoSym_onebox_FSS5_CC1( ci, fi, A, P, R, cdir, cindex, cstride, RAP ); @@ -1421,15 +1424,15 @@ hypre_PFMG2BuildRAPNoSym( hypre_StructMatrix *A, break; - /*-------------------------------------------------------------- - * Loop for 9-point fine grid operator; produces upper triangular - * part of 9-point coarse grid operator - excludes diagonal. - * stencil entries: (northeast, north, northwest, and east) - *--------------------------------------------------------------*/ + /*-------------------------------------------------------------- + * Loop for 9-point fine grid operator; produces upper triangular + * part of 9-point coarse grid operator - excludes diagonal. + * stencil entries: (northeast, north, northwest, and east) + *--------------------------------------------------------------*/ default: - if ( constant_coefficient==1 ) + if ( constant_coefficient == 1 ) { hypre_PFMG2BuildRAPNoSym_onebox_FSS9_CC1( ci, fi, A, P, R, cdir, cindex, cstride, RAP ); @@ -1507,14 +1510,14 @@ hypre_PFMG2BuildRAPNoSym_onebox_FSS5_CC0( constant_coefficient_A = hypre_StructMatrixConstantCoefficient(A); -/* fi = 0; - hypre_ForBoxI(ci, cgrid_boxes) - { - while (fgrid_ids[fi] != cgrid_ids[ci]) - { - fi++; - } -*/ + /* fi = 0; + hypre_ForBoxI(ci, cgrid_boxes) + { + while (fgrid_ids[fi] != cgrid_ids[ci]) + { + fi++; + } + */ cgrid_box = hypre_BoxArrayBox(cgrid_boxes, ci); cstart = hypre_BoxIMin(cgrid_box); @@ -1531,11 +1534,11 @@ hypre_PFMG2BuildRAPNoSym_onebox_FSS5_CC0( * pb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); pa = hypre_StructMatrixExtractPointerByIndex(P, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); pb = hypre_StructMatrixExtractPointerByIndex(P, fi, index); @@ -1548,11 +1551,11 @@ hypre_PFMG2BuildRAPNoSym_onebox_FSS5_CC0( * rb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); ra = hypre_StructMatrixExtractPointerByIndex(R, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); rb = hypre_StructMatrixExtractPointerByIndex(R, fi, index); @@ -1569,19 +1572,19 @@ hypre_PFMG2BuildRAPNoSym_onebox_FSS5_CC0( * a_cn is pointer for north coefficient *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,0); + hypre_SetIndex3(index_temp, 0, 0, 0); MapIndex(index_temp, cdir, index); a_cc = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,0,0); + hypre_SetIndex3(index_temp, -1, 0, 0); MapIndex(index_temp, cdir, index); a_cw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); a_ce = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); a_cn = hypre_StructMatrixExtractPointerByIndex(A, fi, index); @@ -1593,19 +1596,19 @@ hypre_PFMG2BuildRAPNoSym_onebox_FSS5_CC0( * rap_ce is pointer for east coefficient (etc.) *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); rap_ce = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); rap_cn = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,1,0); + hypre_SetIndex3(index_temp, 1, 1, 0); MapIndex(index_temp, cdir, index); rap_cne = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,1,0); + hypre_SetIndex3(index_temp, -1, 1, 0); MapIndex(index_temp, cdir, index); rap_cnw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); @@ -1617,25 +1620,25 @@ hypre_PFMG2BuildRAPNoSym_onebox_FSS5_CC0( * Offsets are used in refering to data associated with other points. *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); - yOffsetP = hypre_BoxOffsetDistance(P_dbox,index); + yOffsetP = hypre_BoxOffsetDistance(P_dbox, index); if ( constant_coefficient_A == 0 ) { - yOffsetA = hypre_BoxOffsetDistance(A_dbox,index); + yOffsetA = hypre_BoxOffsetDistance(A_dbox, index); } else { - hypre_assert( constant_coefficient_A==2 ); - yOffsetA_diag = hypre_BoxOffsetDistance(A_dbox,index); + hypre_assert( constant_coefficient_A == 2 ); + yOffsetA_diag = hypre_BoxOffsetDistance(A_dbox, index); yOffsetA_offd = 0; } - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); - xOffsetP = hypre_BoxOffsetDistance(P_dbox,index); + xOffsetP = hypre_BoxOffsetDistance(P_dbox, index); /*-------------------------------------------------------------- @@ -1661,27 +1664,27 @@ hypre_PFMG2BuildRAPNoSym_onebox_FSS5_CC0( HYPRE_Int iAp1 = iA + yOffsetA; HYPRE_Int iP1 = iP + yOffsetP + xOffsetP; - rap_cne[iAc] = ra[iR] * a_ce[iAp1] * pb[iP1-pbOffset]; + rap_cne[iAc] = ra[iR] * a_ce[iAp1] * pb[iP1 - pbOffset]; iP1 = iP + yOffsetP; - rap_cn[iAc] = ra[iR] * a_cc[iAp1] * pb[iP1-pbOffset] - + ra[iR] * a_cn[iAp1] - + a_cn[iA] * pb[iP1-pbOffset]; + rap_cn[iAc] = ra[iR] * a_cc[iAp1] * pb[iP1 - pbOffset] + + ra[iR] * a_cn[iAp1] + + a_cn[iA] * pb[iP1 - pbOffset]; iP1 = iP + yOffsetP - xOffsetP; - rap_cnw[iAc] = ra[iR] * a_cw[iAp1] * pb[iP1-pbOffset]; + rap_cnw[iAc] = ra[iR] * a_cw[iAp1] * pb[iP1 - pbOffset]; iP1 = iP + xOffsetP; rap_ce[iAc] = a_ce[iA] - + rb[iR-rbOffset] * a_ce[iAm1] * pb[iP1-pbOffset] - + ra[iR] * a_ce[iAp1] * pa[iP1]; + + rb[iR - rbOffset] * a_ce[iAm1] * pb[iP1 - pbOffset] + + ra[iR] * a_ce[iAp1] * pa[iP1]; } hypre_BoxLoop4End(iP, iR, iA, iAc); #undef DEVICE_VAR } else { - hypre_assert( constant_coefficient_A==2 ); + hypre_assert( constant_coefficient_A == 2 ); /*hypre_printf("nosym 5.0.2\n"); */ iA_offd = 0; @@ -1704,26 +1707,26 @@ hypre_PFMG2BuildRAPNoSym_onebox_FSS5_CC0( HYPRE_Int iAp1 = iA + yOffsetA_diag; HYPRE_Int iP1 = iP + yOffsetP + xOffsetP; - rap_cne[iAc] = ra[iR] * a_ce_offdp1 * pb[iP1-pbOffset]; + rap_cne[iAc] = ra[iR] * a_ce_offdp1 * pb[iP1 - pbOffset]; iP1 = iP + yOffsetP; - rap_cn[iAc] = ra[iR] * a_cc[iAp1] * pb[iP1-pbOffset] - + ra[iR] * a_cn_offdp1 - + a_cn_offd * pb[iP1-pbOffset]; + rap_cn[iAc] = ra[iR] * a_cc[iAp1] * pb[iP1 - pbOffset] + + ra[iR] * a_cn_offdp1 + + a_cn_offd * pb[iP1 - pbOffset]; iP1 = iP + yOffsetP - xOffsetP; - rap_cnw[iAc] = ra[iR] * a_cw_offdp1 * pb[iP1-pbOffset]; + rap_cnw[iAc] = ra[iR] * a_cw_offdp1 * pb[iP1 - pbOffset]; iP1 = iP + xOffsetP; rap_ce[iAc] = a_ce_offd - + rb[iR-rbOffset] * a_ce_offdm1 * pb[iP1-pbOffset] - + ra[iR] * a_ce_offdp1 * pa[iP1]; + + rb[iR - rbOffset] * a_ce_offdm1 * pb[iP1 - pbOffset] + + ra[iR] * a_ce_offdp1 * pa[iP1]; } hypre_BoxLoop4End(iP, iR, iA, iAc); #undef DEVICE_VAR } -/* }*/ /* end ForBoxI */ + /* }*/ /* end ForBoxI */ return hypre_error_flag; } @@ -1781,11 +1784,11 @@ hypre_PFMG2BuildRAPNoSym_onebox_FSS5_CC1( * pb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); pa = hypre_StructMatrixExtractPointerByIndex(P, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); pb = hypre_StructMatrixExtractPointerByIndex(P, fi, index); @@ -1796,11 +1799,11 @@ hypre_PFMG2BuildRAPNoSym_onebox_FSS5_CC1( * rb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); ra = hypre_StructMatrixExtractPointerByIndex(R, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); rb = hypre_StructMatrixExtractPointerByIndex(R, fi, index); @@ -1815,19 +1818,19 @@ hypre_PFMG2BuildRAPNoSym_onebox_FSS5_CC1( * a_cn is pointer for north coefficient *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,0); + hypre_SetIndex3(index_temp, 0, 0, 0); MapIndex(index_temp, cdir, index); a_cc = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,0,0); + hypre_SetIndex3(index_temp, -1, 0, 0); MapIndex(index_temp, cdir, index); a_cw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); a_ce = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); a_cn = hypre_StructMatrixExtractPointerByIndex(A, fi, index); @@ -1839,19 +1842,19 @@ hypre_PFMG2BuildRAPNoSym_onebox_FSS5_CC1( * rap_ce is pointer for east coefficient (etc.) *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); rap_ce = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); rap_cn = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,1,0); + hypre_SetIndex3(index_temp, 1, 1, 0); MapIndex(index_temp, cdir, index); rap_cne = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,1,0); + hypre_SetIndex3(index_temp, -1, 1, 0); MapIndex(index_temp, cdir, index); rap_cnw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); @@ -1863,13 +1866,13 @@ hypre_PFMG2BuildRAPNoSym_onebox_FSS5_CC1( * Offsets are used in refering to data associated with other points. *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); yOffsetA = 0; yOffsetP = 0; - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); xOffsetP = 0; @@ -1898,19 +1901,19 @@ hypre_PFMG2BuildRAPNoSym_onebox_FSS5_CC1( iP1 = iP + yOffsetP; rap_cn[iAc] = ra[iR] * a_cc[iAp1] * pb[iP1] - + ra[iR] * a_cn[iAp1] - + a_cn[iA] * pb[iP1]; + + ra[iR] * a_cn[iAp1] + + a_cn[iA] * pb[iP1]; iP1 = iP + yOffsetP - xOffsetP; rap_cnw[iAc] = ra[iR] * a_cw[iAp1] * pb[iP1]; iP1 = iP + xOffsetP; rap_ce[iAc] = a_ce[iA] - + rb[iR] * a_ce[iAm1] * pb[iP1] - + ra[iR] * a_ce[iAp1] * pa[iP1]; + + rb[iR] * a_ce[iAm1] * pb[iP1] + + ra[iR] * a_ce[iAp1] * pa[iP1]; -/* }*/ /* end ForBoxI */ + /* }*/ /* end ForBoxI */ return hypre_error_flag; } @@ -1973,14 +1976,14 @@ hypre_PFMG2BuildRAPNoSym_onebox_FSS9_CC0( constant_coefficient_A = hypre_StructMatrixConstantCoefficient(A); -/* fi = 0; - hypre_ForBoxI(ci, cgrid_boxes) - { - while (fgrid_ids[fi] != cgrid_ids[ci]) - { - fi++; - } -*/ + /* fi = 0; + hypre_ForBoxI(ci, cgrid_boxes) + { + while (fgrid_ids[fi] != cgrid_ids[ci]) + { + fi++; + } + */ cgrid_box = hypre_BoxArrayBox(cgrid_boxes, ci); cstart = hypre_BoxIMin(cgrid_box); @@ -1997,11 +2000,11 @@ hypre_PFMG2BuildRAPNoSym_onebox_FSS9_CC0( * pb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); pa = hypre_StructMatrixExtractPointerByIndex(P, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); pb = hypre_StructMatrixExtractPointerByIndex(P, fi, index); @@ -2014,11 +2017,11 @@ hypre_PFMG2BuildRAPNoSym_onebox_FSS9_CC0( * rb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); ra = hypre_StructMatrixExtractPointerByIndex(R, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); rb = hypre_StructMatrixExtractPointerByIndex(R, fi, index); @@ -2035,19 +2038,19 @@ hypre_PFMG2BuildRAPNoSym_onebox_FSS9_CC0( * a_cn is pointer for north coefficient *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,0); + hypre_SetIndex3(index_temp, 0, 0, 0); MapIndex(index_temp, cdir, index); a_cc = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,0,0); + hypre_SetIndex3(index_temp, -1, 0, 0); MapIndex(index_temp, cdir, index); a_cw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); a_ce = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); a_cn = hypre_StructMatrixExtractPointerByIndex(A, fi, index); @@ -2060,15 +2063,15 @@ hypre_PFMG2BuildRAPNoSym_onebox_FSS9_CC0( * a_cne is pointer for northeast coefficient *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,1,-1,0); + hypre_SetIndex3(index_temp, 1, -1, 0); MapIndex(index_temp, cdir, index); a_cse = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,1,0); + hypre_SetIndex3(index_temp, -1, 1, 0); MapIndex(index_temp, cdir, index); a_cnw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,1,0); + hypre_SetIndex3(index_temp, 1, 1, 0); MapIndex(index_temp, cdir, index); a_cne = hypre_StructMatrixExtractPointerByIndex(A, fi, index); @@ -2080,19 +2083,19 @@ hypre_PFMG2BuildRAPNoSym_onebox_FSS9_CC0( * rap_ce is pointer for east coefficient (etc.) *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); rap_ce = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); rap_cn = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,1,0); + hypre_SetIndex3(index_temp, 1, 1, 0); MapIndex(index_temp, cdir, index); rap_cne = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,1,0); + hypre_SetIndex3(index_temp, -1, 1, 0); MapIndex(index_temp, cdir, index); rap_cnw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); @@ -2104,25 +2107,25 @@ hypre_PFMG2BuildRAPNoSym_onebox_FSS9_CC0( * Offsets are used in refering to data associated with other points. *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); - yOffsetP = hypre_BoxOffsetDistance(P_dbox,index); + yOffsetP = hypre_BoxOffsetDistance(P_dbox, index); if ( constant_coefficient_A == 0 ) { - yOffsetA = hypre_BoxOffsetDistance(A_dbox,index); + yOffsetA = hypre_BoxOffsetDistance(A_dbox, index); } else { - hypre_assert( constant_coefficient_A==2 ); - yOffsetA_diag = hypre_BoxOffsetDistance(A_dbox,index); + hypre_assert( constant_coefficient_A == 2 ); + yOffsetA_diag = hypre_BoxOffsetDistance(A_dbox, index); yOffsetA_offd = 0; } - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); - xOffsetP = hypre_BoxOffsetDistance(P_dbox,index); + xOffsetP = hypre_BoxOffsetDistance(P_dbox, index); /*----------------------------------------------------------------- * Switch statement to direct control to appropriate BoxLoop depending @@ -2138,7 +2141,7 @@ hypre_PFMG2BuildRAPNoSym_onebox_FSS9_CC0( hypre_BoxGetSize(cgrid_box, loop_size); - if ( constant_coefficient_A==0 ) + if ( constant_coefficient_A == 0 ) { /*hypre_printf("nosym 9.0.0\n");*/ @@ -2153,28 +2156,28 @@ hypre_PFMG2BuildRAPNoSym_onebox_FSS9_CC0( HYPRE_Int iAp1 = iA + yOffsetA; HYPRE_Int iP1 = iP + yOffsetP + xOffsetP; - rap_cne[iAc] = ra[iR] * a_ce[iAp1] * pb[iP1-pbOffset] - + ra[iR] * a_cne[iAp1] - + a_cne[iA] * pb[iP1-pbOffset]; + rap_cne[iAc] = ra[iR] * a_ce[iAp1] * pb[iP1 - pbOffset] + + ra[iR] * a_cne[iAp1] + + a_cne[iA] * pb[iP1 - pbOffset]; iP1 = iP + yOffsetP; - rap_cn[iAc] = ra[iR] * a_cc[iAp1] * pb[iP1-pbOffset] - + ra[iR] * a_cn[iAp1] - + a_cn[iA] * pb[iP1-pbOffset]; + rap_cn[iAc] = ra[iR] * a_cc[iAp1] * pb[iP1 - pbOffset] + + ra[iR] * a_cn[iAp1] + + a_cn[iA] * pb[iP1 - pbOffset]; iP1 = iP + yOffsetP - xOffsetP; - rap_cnw[iAc] = ra[iR] * a_cw[iAp1] * pb[iP1-pbOffset] - + ra[iR] * a_cnw[iAp1] - + a_cnw[iA] * pb[iP1-pbOffset]; + rap_cnw[iAc] = ra[iR] * a_cw[iAp1] * pb[iP1 - pbOffset] + + ra[iR] * a_cnw[iAp1] + + a_cnw[iA] * pb[iP1 - pbOffset]; iP1 = iP + xOffsetP; rap_ce[iAc] = a_ce[iA] - + rb[iR-rbOffset] * a_ce[iAm1] * pb[iP1-pbOffset] - + ra[iR] * a_ce[iAp1] * pa[iP1] - + rb[iR-rbOffset] * a_cne[iAm1] - + ra[iR] * a_cse[iAp1] - + a_cse[iA] * pb[iP1-pbOffset] - + a_cne[iA] * pa[iP1]; + + rb[iR - rbOffset] * a_ce[iAm1] * pb[iP1 - pbOffset] + + ra[iR] * a_ce[iAp1] * pa[iP1] + + rb[iR - rbOffset] * a_cne[iAm1] + + ra[iR] * a_cse[iAp1] + + a_cse[iA] * pb[iP1 - pbOffset] + + a_cne[iA] * pa[iP1]; } hypre_BoxLoop4End(iP, iR, iA, iAc); @@ -2183,7 +2186,7 @@ hypre_PFMG2BuildRAPNoSym_onebox_FSS9_CC0( else { /*hypre_printf("nosym 9.0.2\n");*/ - hypre_assert( constant_coefficient_A==2 ); + hypre_assert( constant_coefficient_A == 2 ); iA_offd = 0; iA_offdm1 = iA_offd - yOffsetA_offd; iA_offdp1 = iA_offd + yOffsetA_offd; @@ -2211,35 +2214,35 @@ hypre_PFMG2BuildRAPNoSym_onebox_FSS9_CC0( HYPRE_Int iAp1 = iA + yOffsetA_diag; HYPRE_Int iP1 = iP + yOffsetP + xOffsetP; - rap_cne[iAc] = ra[iR] * a_ce_offdp1 * pb[iP1-pbOffset] - + ra[iR] * a_cne_offdp1 - + a_cne_offd * pb[iP1-pbOffset]; + rap_cne[iAc] = ra[iR] * a_ce_offdp1 * pb[iP1 - pbOffset] + + ra[iR] * a_cne_offdp1 + + a_cne_offd * pb[iP1 - pbOffset]; iP1 = iP + yOffsetP; - rap_cn[iAc] = ra[iR] * a_cc[iAp1] * pb[iP1-pbOffset] - + ra[iR] * a_cn_offdp1 - + a_cn_offd * pb[iP1-pbOffset]; + rap_cn[iAc] = ra[iR] * a_cc[iAp1] * pb[iP1 - pbOffset] + + ra[iR] * a_cn_offdp1 + + a_cn_offd * pb[iP1 - pbOffset]; iP1 = iP + yOffsetP - xOffsetP; - rap_cnw[iAc] = ra[iR] * a_cw_offdp1 * pb[iP1-pbOffset] - + ra[iR] * a_cnw_offdp1 - + a_cnw_offd * pb[iP1-pbOffset]; + rap_cnw[iAc] = ra[iR] * a_cw_offdp1 * pb[iP1 - pbOffset] + + ra[iR] * a_cnw_offdp1 + + a_cnw_offd * pb[iP1 - pbOffset]; iP1 = iP + xOffsetP; rap_ce[iAc] = a_ce_offd - + rb[iR-rbOffset] * a_ce_offdm1 * pb[iP1-pbOffset] - + ra[iR] * a_ce_offdp1 * pa[iP1] - + rb[iR-rbOffset] * a_cne_offdm1 - + ra[iR] * a_cse_offdp1 - + a_cse_offd * pb[iP1-pbOffset] - + a_cne_offd * pa[iP1]; + + rb[iR - rbOffset] * a_ce_offdm1 * pb[iP1 - pbOffset] + + ra[iR] * a_ce_offdp1 * pa[iP1] + + rb[iR - rbOffset] * a_cne_offdm1 + + ra[iR] * a_cse_offdp1 + + a_cse_offd * pb[iP1 - pbOffset] + + a_cne_offd * pa[iP1]; } hypre_BoxLoop4End(iP, iR, iA, iAc); #undef DEVICE_VAR } -/* }*/ /* end ForBoxI */ + /* }*/ /* end ForBoxI */ return hypre_error_flag; } @@ -2298,11 +2301,11 @@ hypre_PFMG2BuildRAPNoSym_onebox_FSS9_CC1( * pb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); pa = hypre_StructMatrixExtractPointerByIndex(P, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); pb = hypre_StructMatrixExtractPointerByIndex(P, fi, index); @@ -2313,11 +2316,11 @@ hypre_PFMG2BuildRAPNoSym_onebox_FSS9_CC1( * rb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); ra = hypre_StructMatrixExtractPointerByIndex(R, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); rb = hypre_StructMatrixExtractPointerByIndex(R, fi, index); @@ -2332,19 +2335,19 @@ hypre_PFMG2BuildRAPNoSym_onebox_FSS9_CC1( * a_cn is pointer for north coefficient *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,0); + hypre_SetIndex3(index_temp, 0, 0, 0); MapIndex(index_temp, cdir, index); a_cc = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,0,0); + hypre_SetIndex3(index_temp, -1, 0, 0); MapIndex(index_temp, cdir, index); a_cw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); a_ce = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); a_cn = hypre_StructMatrixExtractPointerByIndex(A, fi, index); @@ -2357,15 +2360,15 @@ hypre_PFMG2BuildRAPNoSym_onebox_FSS9_CC1( * a_cne is pointer for northeast coefficient *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,1,-1,0); + hypre_SetIndex3(index_temp, 1, -1, 0); MapIndex(index_temp, cdir, index); a_cse = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,1,0); + hypre_SetIndex3(index_temp, -1, 1, 0); MapIndex(index_temp, cdir, index); a_cnw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,1,0); + hypre_SetIndex3(index_temp, 1, 1, 0); MapIndex(index_temp, cdir, index); a_cne = hypre_StructMatrixExtractPointerByIndex(A, fi, index); @@ -2377,19 +2380,19 @@ hypre_PFMG2BuildRAPNoSym_onebox_FSS9_CC1( * rap_ce is pointer for east coefficient (etc.) *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); rap_ce = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); rap_cn = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,1,0); + hypre_SetIndex3(index_temp, 1, 1, 0); MapIndex(index_temp, cdir, index); rap_cne = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,1,0); + hypre_SetIndex3(index_temp, -1, 1, 0); MapIndex(index_temp, cdir, index); rap_cnw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); @@ -2401,13 +2404,13 @@ hypre_PFMG2BuildRAPNoSym_onebox_FSS9_CC1( * Offsets are used in refering to data associated with other points. *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); yOffsetA = 0; yOffsetP = 0; - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); xOffsetP = 0; @@ -2434,34 +2437,31 @@ hypre_PFMG2BuildRAPNoSym_onebox_FSS9_CC1( iP1 = iP + yOffsetP + xOffsetP; rap_cne[iAc] = ra[iR] * a_ce[iAp1] * pb[iP1] - + ra[iR] * a_cne[iAp1] - + a_cne[iA] * pb[iP1]; + + ra[iR] * a_cne[iAp1] + + a_cne[iA] * pb[iP1]; iP1 = iP + yOffsetP; rap_cn[iAc] = ra[iR] * a_cc[iAp1] * pb[iP1] - + ra[iR] * a_cn[iAp1] - + a_cn[iA] * pb[iP1]; + + ra[iR] * a_cn[iAp1] + + a_cn[iA] * pb[iP1]; iP1 = iP + yOffsetP - xOffsetP; rap_cnw[iAc] = ra[iR] * a_cw[iAp1] * pb[iP1] - + ra[iR] * a_cnw[iAp1] - + a_cnw[iA] * pb[iP1]; + + ra[iR] * a_cnw[iAp1] + + a_cnw[iA] * pb[iP1]; iP1 = iP + xOffsetP; rap_ce[iAc] = a_ce[iA] - + rb[iR] * a_ce[iAm1] * pb[iP1] - + ra[iR] * a_ce[iAp1] * pa[iP1] - + rb[iR] * a_cne[iAm1] - + ra[iR] * a_cse[iAp1] - + a_cse[iA] * pb[iP1] - + a_cne[iA] * pa[iP1]; + + rb[iR] * a_ce[iAm1] * pb[iP1] + + ra[iR] * a_ce[iAp1] * pa[iP1] + + rb[iR] * a_cne[iAm1] + + ra[iR] * a_cse[iAp1] + + a_cse[iA] * pb[iP1] + + a_cne[iA] * pa[iP1]; -/* }*/ /* end ForBoxI */ + /* }*/ /* end ForBoxI */ return hypre_error_flag; } - - - diff --git a/external/hypre/src/struct_ls/pfmg3_setup_rap.c b/external/hypre/src/struct_ls/pfmg3_setup_rap.c index bc408b7b..f508e11f 100644 --- a/external/hypre/src/struct_ls/pfmg3_setup_rap.c +++ b/external/hypre/src/struct_ls/pfmg3_setup_rap.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -34,6 +34,9 @@ hypre_PFMG3CreateRAPOp( hypre_StructMatrix *R, hypre_StructGrid *coarse_grid, HYPRE_Int cdir ) { + HYPRE_UNUSED_VAR(R); + HYPRE_UNUSED_VAR(P); + hypre_StructMatrix *RAP; hypre_Index *RAP_stencil_shape; @@ -73,7 +76,7 @@ hypre_PFMG3CreateRAPOp( hypre_StructMatrix *R, * lower triangular means the lower triangular part on the matrix * in the standard lexicographic ordering. *-----------------------------------------------------------------------*/ - if( A_stencil_size == 7) + if ( A_stencil_size == 7) { RAP_stencil_size = 19; if (hypre_StructMatrixSymmetric(A)) @@ -87,9 +90,9 @@ hypre_PFMG3CreateRAPOp( hypre_StructMatrix *R, { for (i = -1; i < 2; i++) { - if ((i*j*k == 0) && (stencil_rank < RAP_stencil_size)) + if ((i * j * k == 0) && (stencil_rank < RAP_stencil_size)) { - hypre_SetIndex3(index_temp,i,j,k); + hypre_SetIndex3(index_temp, i, j, k); MapIndex(index_temp, cdir, RAP_stencil_shape[stencil_rank]); stencil_rank++; @@ -124,7 +127,7 @@ hypre_PFMG3CreateRAPOp( hypre_StructMatrix *R, { if (stencil_rank < RAP_stencil_size) { - hypre_SetIndex3(index_temp,i,j,k); + hypre_SetIndex3(index_temp, i, j, k); MapIndex(index_temp, cdir, RAP_stencil_shape[stencil_rank]); stencil_rank++; @@ -202,16 +205,16 @@ hypre_PFMG3BuildRAPSym( hypre_StructMatrix *A, constant_coefficient = hypre_StructMatrixConstantCoefficient(RAP); constant_coefficient_A = hypre_StructMatrixConstantCoefficient(A); - hypre_assert( constant_coefficient==0 || constant_coefficient==1 ); + hypre_assert( constant_coefficient == 0 || constant_coefficient == 1 ); hypre_assert( hypre_StructMatrixConstantCoefficient(R) == constant_coefficient ); hypre_assert( hypre_StructMatrixConstantCoefficient(P) == constant_coefficient ); - if (constant_coefficient==1 ) + if (constant_coefficient == 1 ) { - hypre_assert( constant_coefficient_A==1 ); + hypre_assert( constant_coefficient_A == 1 ); } else { - hypre_assert( constant_coefficient_A==0 || constant_coefficient_A==2 ); + hypre_assert( constant_coefficient_A == 0 || constant_coefficient_A == 2 ); } fi = 0; @@ -240,7 +243,7 @@ hypre_PFMG3BuildRAPSym( hypre_StructMatrix *A, case 7: - if ( constant_coefficient==1 ) + if ( constant_coefficient == 1 ) { hypre_PFMG3BuildRAPSym_onebox_FSS07_CC1( ci, fi, A, P, R, cdir, cindex, cstride, RAP ); @@ -253,18 +256,18 @@ hypre_PFMG3BuildRAPSym( hypre_StructMatrix *A, } break; - /*-------------------------------------------------------------- - * Loop for symmetric 19-point fine grid operator; produces a - * symmetric 27-point coarse grid operator. We calculate only the - * lower triangular stencil entries: (below-southwest, below-south, - * below-southeast, below-west, below-center, below-east, - * below-northwest, below-north, below-northeast, center-southwest, - * center-south, center-southeast, center-west, and center-center). - *--------------------------------------------------------------*/ + /*-------------------------------------------------------------- + * Loop for symmetric 19-point fine grid operator; produces a + * symmetric 27-point coarse grid operator. We calculate only the + * lower triangular stencil entries: (below-southwest, below-south, + * below-southeast, below-west, below-center, below-east, + * below-northwest, below-north, below-northeast, center-southwest, + * center-south, center-southeast, center-west, and center-center). + *--------------------------------------------------------------*/ case 19: - if ( constant_coefficient==1 ) + if ( constant_coefficient == 1 ) { hypre_PFMG3BuildRAPSym_onebox_FSS19_CC1( ci, fi, A, P, R, cdir, cindex, cstride, RAP ); @@ -276,18 +279,18 @@ hypre_PFMG3BuildRAPSym( hypre_StructMatrix *A, } break; - /*-------------------------------------------------------------- - * Loop for symmetric 27-point fine grid operator; produces a - * symmetric 27-point coarse grid operator. We calculate only the - * lower triangular stencil entries: (below-southwest, below-south, - * below-southeast, below-west, below-center, below-east, - * below-northwest, below-north, below-northeast, center-southwest, - * center-south, center-southeast, center-west, and center-center). - *--------------------------------------------------------------*/ + /*-------------------------------------------------------------- + * Loop for symmetric 27-point fine grid operator; produces a + * symmetric 27-point coarse grid operator. We calculate only the + * lower triangular stencil entries: (below-southwest, below-south, + * below-southeast, below-west, below-center, below-east, + * below-northwest, below-north, below-northeast, center-southwest, + * center-south, center-southeast, center-west, and center-center). + *--------------------------------------------------------------*/ default: - if ( constant_coefficient==1 ) + if ( constant_coefficient == 1 ) { hypre_PFMG3BuildRAPSym_onebox_FSS27_CC1( ci, fi, A, P, R, cdir, cindex, cstride, RAP ); @@ -388,11 +391,11 @@ hypre_PFMG3BuildRAPSym_onebox_FSS07_CC0( * pb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,-1); + hypre_SetIndex3(index_temp, 0, 0, -1); MapIndex(index_temp, cdir, index); pa = hypre_StructMatrixExtractPointerByIndex(P, fi, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); pb = hypre_StructMatrixExtractPointerByIndex(P, fi, index); @@ -405,11 +408,11 @@ hypre_PFMG3BuildRAPSym_onebox_FSS07_CC0( * rb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,-1); + hypre_SetIndex3(index_temp, 0, 0, -1); MapIndex(index_temp, cdir, index); ra = hypre_StructMatrixExtractPointerByIndex(R, fi, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); rb = hypre_StructMatrixExtractPointerByIndex(R, fi, index); @@ -428,31 +431,31 @@ hypre_PFMG3BuildRAPSym_onebox_FSS07_CC0( * a_bc is pointer for center coefficient in plane below *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,0); + hypre_SetIndex3(index_temp, 0, 0, 0); MapIndex(index_temp, cdir, index); a_cc = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,0,0); + hypre_SetIndex3(index_temp, -1, 0, 0); MapIndex(index_temp, cdir, index); a_cw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); a_ce = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); a_cs = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); a_cn = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); a_ac = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,0,-1); + hypre_SetIndex3(index_temp, 0, 0, -1); MapIndex(index_temp, cdir, index); a_bc = hypre_StructMatrixExtractPointerByIndex(A, fi, index); @@ -465,43 +468,43 @@ hypre_PFMG3BuildRAPSym_onebox_FSS07_CC0( * rap_cc is pointer for center coefficient (etc.) *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,0); + hypre_SetIndex3(index_temp, 0, 0, 0); MapIndex(index_temp, cdir, index); rap_cc = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,0,0); + hypre_SetIndex3(index_temp, -1, 0, 0); MapIndex(index_temp, cdir, index); rap_cw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); rap_cs = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,0,-1); + hypre_SetIndex3(index_temp, 0, 0, -1); MapIndex(index_temp, cdir, index); rap_bc = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,0,-1); + hypre_SetIndex3(index_temp, -1, 0, -1); MapIndex(index_temp, cdir, index); rap_bw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,0,-1); + hypre_SetIndex3(index_temp, 1, 0, -1); MapIndex(index_temp, cdir, index); rap_be = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,-1,-1); + hypre_SetIndex3(index_temp, 0, -1, -1); MapIndex(index_temp, cdir, index); rap_bs = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,1,-1); + hypre_SetIndex3(index_temp, 0, 1, -1); MapIndex(index_temp, cdir, index); rap_bn = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,-1,0); + hypre_SetIndex3(index_temp, -1, -1, 0); MapIndex(index_temp, cdir, index); rap_csw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,-1,0); + hypre_SetIndex3(index_temp, 1, -1, 0); MapIndex(index_temp, cdir, index); rap_cse = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); @@ -513,29 +516,29 @@ hypre_PFMG3BuildRAPSym_onebox_FSS07_CC0( * Offsets are used in refering to data associated with other points. *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); - zOffsetP = hypre_BoxOffsetDistance(P_dbox,index); + zOffsetP = hypre_BoxOffsetDistance(P_dbox, index); if ( constant_coefficient_A == 0 ) { - zOffsetA = hypre_BoxOffsetDistance(A_dbox,index); + zOffsetA = hypre_BoxOffsetDistance(A_dbox, index); } else { - zOffsetA_diag = hypre_BoxOffsetDistance(A_dbox,index); + zOffsetA_diag = hypre_BoxOffsetDistance(A_dbox, index); zOffsetA_offd = 0; } - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); - yOffsetP = hypre_BoxOffsetDistance(P_dbox,index); + yOffsetP = hypre_BoxOffsetDistance(P_dbox, index); - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); - xOffsetP = hypre_BoxOffsetDistance(P_dbox,index); + xOffsetP = hypre_BoxOffsetDistance(P_dbox, index); /*-------------------------------------------------------------------- * Switch statement to direct control to apropriate BoxLoop depending @@ -565,43 +568,43 @@ hypre_PFMG3BuildRAPSym_onebox_FSS07_CC0( HYPRE_Int iAp1 = iA + zOffsetA; HYPRE_Int iP1 = iP - zOffsetP - yOffsetP; - rap_bs[iAc] = rb[iR-rbOffset] * a_cs[iAm1] * pa[iP1]; + rap_bs[iAc] = rb[iR - rbOffset] * a_cs[iAm1] * pa[iP1]; iP1 = iP - zOffsetP - xOffsetP; - rap_bw[iAc] = rb[iR-rbOffset] * a_cw[iAm1] * pa[iP1]; + rap_bw[iAc] = rb[iR - rbOffset] * a_cw[iAm1] * pa[iP1]; iP1 = iP - zOffsetP; rap_bc[iAc] = a_bc[iA] * pa[iP1] - + rb[iR-rbOffset] * a_cc[iAm1] * pa[iP1] - + rb[iR-rbOffset] * a_bc[iAm1]; + + rb[iR - rbOffset] * a_cc[iAm1] * pa[iP1] + + rb[iR - rbOffset] * a_bc[iAm1]; iP1 = iP - zOffsetP + xOffsetP; - rap_be[iAc] = rb[iR-rbOffset] * a_ce[iAm1] * pa[iP1]; + rap_be[iAc] = rb[iR - rbOffset] * a_ce[iAm1] * pa[iP1]; iP1 = iP - zOffsetP + yOffsetP; - rap_bn[iAc] = rb[iR-rbOffset] * a_cn[iAm1] * pa[iP1]; + rap_bn[iAc] = rb[iR - rbOffset] * a_cn[iAm1] * pa[iP1]; iP1 = iP - yOffsetP; rap_cs[iAc] = a_cs[iA] - + rb[iR-rbOffset] * a_cs[iAm1] * pb[iP1-pbOffset] - + ra[iR] * a_cs[iAp1] * pa[iP1]; + + rb[iR - rbOffset] * a_cs[iAm1] * pb[iP1 - pbOffset] + + ra[iR] * a_cs[iAp1] * pa[iP1]; iP1 = iP - xOffsetP; rap_cw[iAc] = a_cw[iA] - + rb[iR-rbOffset] * a_cw[iAm1] * pb[iP1-pbOffset] - + ra[iR] * a_cw[iAp1] * pa[iP1]; + + rb[iR - rbOffset] * a_cw[iAm1] * pb[iP1 - pbOffset] + + ra[iR] * a_cw[iAp1] * pa[iP1]; rap_csw[iAc] = 0.0; rap_cse[iAc] = 0.0; rap_cc[iAc] = a_cc[iA] - + rb[iR-rbOffset] * a_cc[iAm1] * pb[iP-pbOffset] - + ra[iR] * a_cc[iAp1] * pa[iP] - + rb[iR-rbOffset] * a_ac[iAm1] - + ra[iR] * a_bc[iAp1] - + a_bc[iA] * pb[iP-pbOffset] - + a_ac[iA] * pa[iP]; + + rb[iR - rbOffset] * a_cc[iAm1] * pb[iP - pbOffset] + + ra[iR] * a_cc[iAp1] * pa[iP] + + rb[iR - rbOffset] * a_ac[iAm1] + + ra[iR] * a_bc[iAp1] + + a_bc[iA] * pb[iP - pbOffset] + + a_ac[iA] * pa[iP]; } hypre_BoxLoop4End(iP, iR, iA, iAc); @@ -637,43 +640,43 @@ hypre_PFMG3BuildRAPSym_onebox_FSS07_CC0( HYPRE_Int iAp1 = iA + zOffsetA_diag; HYPRE_Int iP1 = iP - zOffsetP - yOffsetP; - rap_bs[iAc] = rb[iR-rbOffset] * a_cs_offdm1 * pa[iP1]; + rap_bs[iAc] = rb[iR - rbOffset] * a_cs_offdm1 * pa[iP1]; iP1 = iP - zOffsetP - xOffsetP; - rap_bw[iAc] = rb[iR-rbOffset] * a_cw_offdm1 * pa[iP1]; + rap_bw[iAc] = rb[iR - rbOffset] * a_cw_offdm1 * pa[iP1]; iP1 = iP - zOffsetP; rap_bc[iAc] = a_bc_offd * pa[iP1] - + rb[iR-rbOffset] * a_cc[iAm1] * pa[iP1] - + rb[iR-rbOffset] * a_bc_offdm1; + + rb[iR - rbOffset] * a_cc[iAm1] * pa[iP1] + + rb[iR - rbOffset] * a_bc_offdm1; iP1 = iP - zOffsetP + xOffsetP; - rap_be[iAc] = rb[iR-rbOffset] * a_ce_offdm1 * pa[iP1]; + rap_be[iAc] = rb[iR - rbOffset] * a_ce_offdm1 * pa[iP1]; iP1 = iP - zOffsetP + yOffsetP; - rap_bn[iAc] = rb[iR-rbOffset] * a_cn_offdm1 * pa[iP1]; + rap_bn[iAc] = rb[iR - rbOffset] * a_cn_offdm1 * pa[iP1]; iP1 = iP - yOffsetP; rap_cs[iAc] = a_cs_offd - + rb[iR-rbOffset] * a_cs_offdm1 * pb[iP1-pbOffset] - + ra[iR] * a_cs_offdp1 * pa[iP1]; + + rb[iR - rbOffset] * a_cs_offdm1 * pb[iP1 - pbOffset] + + ra[iR] * a_cs_offdp1 * pa[iP1]; iP1 = iP - xOffsetP; rap_cw[iAc] = a_cw_offd - + rb[iR-rbOffset] * a_cw_offdm1 * pb[iP1-pbOffset] - + ra[iR] * a_cw_offdp1 * pa[iP1]; + + rb[iR - rbOffset] * a_cw_offdm1 * pb[iP1 - pbOffset] + + ra[iR] * a_cw_offdp1 * pa[iP1]; rap_csw[iAc] = 0.0; rap_cse[iAc] = 0.0; rap_cc[iAc] = a_cc[iA] - + rb[iR-rbOffset] * a_cc[iAm1] * pb[iP-pbOffset] - + ra[iR] * a_cc[iAp1] * pa[iP] - + rb[iR-rbOffset] * a_ac_offdm1 - + ra[iR] * a_bc_offdp1 - + a_bc_offd * pb[iP-pbOffset] - + a_ac_offd * pa[iP]; + + rb[iR - rbOffset] * a_cc[iAm1] * pb[iP - pbOffset] + + ra[iR] * a_cc[iAp1] * pa[iP] + + rb[iR - rbOffset] * a_ac_offdm1 + + ra[iR] * a_bc_offdp1 + + a_bc_offd * pb[iP - pbOffset] + + a_ac_offd * pa[iP]; } hypre_BoxLoop4End(iP, iR, iA, iAc); @@ -742,11 +745,11 @@ hypre_PFMG3BuildRAPSym_onebox_FSS07_CC1( * pb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,-1); + hypre_SetIndex3(index_temp, 0, 0, -1); MapIndex(index_temp, cdir, index); pa = hypre_StructMatrixExtractPointerByIndex(P, fi, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); pb = hypre_StructMatrixExtractPointerByIndex(P, fi, index); @@ -757,11 +760,11 @@ hypre_PFMG3BuildRAPSym_onebox_FSS07_CC1( * rb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,-1); + hypre_SetIndex3(index_temp, 0, 0, -1); MapIndex(index_temp, cdir, index); ra = hypre_StructMatrixExtractPointerByIndex(R, fi, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); rb = hypre_StructMatrixExtractPointerByIndex(R, fi, index); @@ -778,31 +781,31 @@ hypre_PFMG3BuildRAPSym_onebox_FSS07_CC1( * a_bc is pointer for center coefficient in plane below *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,0); + hypre_SetIndex3(index_temp, 0, 0, 0); MapIndex(index_temp, cdir, index); a_cc = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,0,0); + hypre_SetIndex3(index_temp, -1, 0, 0); MapIndex(index_temp, cdir, index); a_cw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); a_ce = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); a_cs = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); a_cn = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); a_ac = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,0,-1); + hypre_SetIndex3(index_temp, 0, 0, -1); MapIndex(index_temp, cdir, index); a_bc = hypre_StructMatrixExtractPointerByIndex(A, fi, index); @@ -814,43 +817,43 @@ hypre_PFMG3BuildRAPSym_onebox_FSS07_CC1( * rap_cc is pointer for center coefficient (etc.) *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,0); + hypre_SetIndex3(index_temp, 0, 0, 0); MapIndex(index_temp, cdir, index); rap_cc = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,0,0); + hypre_SetIndex3(index_temp, -1, 0, 0); MapIndex(index_temp, cdir, index); rap_cw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); rap_cs = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,0,-1); + hypre_SetIndex3(index_temp, 0, 0, -1); MapIndex(index_temp, cdir, index); rap_bc = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,0,-1); + hypre_SetIndex3(index_temp, -1, 0, -1); MapIndex(index_temp, cdir, index); rap_bw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,0,-1); + hypre_SetIndex3(index_temp, 1, 0, -1); MapIndex(index_temp, cdir, index); rap_be = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,-1,-1); + hypre_SetIndex3(index_temp, 0, -1, -1); MapIndex(index_temp, cdir, index); rap_bs = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,1,-1); + hypre_SetIndex3(index_temp, 0, 1, -1); MapIndex(index_temp, cdir, index); rap_bn = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,-1,0); + hypre_SetIndex3(index_temp, -1, -1, 0); MapIndex(index_temp, cdir, index); rap_csw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,-1,0); + hypre_SetIndex3(index_temp, 1, -1, 0); MapIndex(index_temp, cdir, index); rap_cse = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); @@ -862,18 +865,18 @@ hypre_PFMG3BuildRAPSym_onebox_FSS07_CC1( * Offsets are used in refering to data associated with other points. *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); zOffsetA = 0; zOffsetP = 0; - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); yOffsetP = 0; - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); xOffsetP = 0; @@ -907,8 +910,8 @@ hypre_PFMG3BuildRAPSym_onebox_FSS07_CC1( iP1 = iP - zOffsetP; rap_bc[iAc] = a_bc[iA] * pa[iP1] - + rb[iR] * a_cc[iAm1] * pa[iP1] - + rb[iR] * a_bc[iAm1]; + + rb[iR] * a_cc[iAm1] * pa[iP1] + + rb[iR] * a_bc[iAm1]; iP1 = iP - zOffsetP + xOffsetP; rap_be[iAc] = rb[iR] * a_ce[iAm1] * pa[iP1]; @@ -918,28 +921,28 @@ hypre_PFMG3BuildRAPSym_onebox_FSS07_CC1( iP1 = iP - yOffsetP; rap_cs[iAc] = a_cs[iA] - + rb[iR] * a_cs[iAm1] * pb[iP1] - + ra[iR] * a_cs[iAp1] * pa[iP1]; + + rb[iR] * a_cs[iAm1] * pb[iP1] + + ra[iR] * a_cs[iAp1] * pa[iP1]; iP1 = iP - xOffsetP; rap_cw[iAc] = a_cw[iA] - + rb[iR] * a_cw[iAm1] * pb[iP1] - + ra[iR] * a_cw[iAp1] * pa[iP1]; + + rb[iR] * a_cw[iAm1] * pb[iP1] + + ra[iR] * a_cw[iAp1] * pa[iP1]; rap_csw[iAc] = 0.0; rap_cse[iAc] = 0.0; rap_cc[iAc] = a_cc[iA] - + rb[iR] * a_cc[iAm1] * pb[iP] - + ra[iR] * a_cc[iAp1] * pa[iP] - + rb[iR] * a_ac[iAm1] - + ra[iR] * a_bc[iAp1] - + a_bc[iA] * pb[iP] - + a_ac[iA] * pa[iP]; + + rb[iR] * a_cc[iAm1] * pb[iP] + + ra[iR] * a_cc[iAp1] * pa[iP] + + rb[iR] * a_ac[iAm1] + + ra[iR] * a_bc[iAp1] + + a_bc[iA] * pb[iP] + + a_ac[iA] * pa[iP]; -/* }*/ /* end ForBoxI */ + /* }*/ /* end ForBoxI */ return hypre_error_flag; } @@ -1039,11 +1042,11 @@ hypre_PFMG3BuildRAPSym_onebox_FSS19_CC0( * pb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,-1); + hypre_SetIndex3(index_temp, 0, 0, -1); MapIndex(index_temp, cdir, index); pa = hypre_StructMatrixExtractPointerByIndex(P, fi, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); pb = hypre_StructMatrixExtractPointerByIndex(P, fi, index); @@ -1056,11 +1059,11 @@ hypre_PFMG3BuildRAPSym_onebox_FSS19_CC0( * rb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,-1); + hypre_SetIndex3(index_temp, 0, 0, -1); MapIndex(index_temp, cdir, index); ra = hypre_StructMatrixExtractPointerByIndex(R, fi, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); rb = hypre_StructMatrixExtractPointerByIndex(R, fi, index); @@ -1079,31 +1082,31 @@ hypre_PFMG3BuildRAPSym_onebox_FSS19_CC0( * a_bc is pointer for center coefficient in plane below *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,0); + hypre_SetIndex3(index_temp, 0, 0, 0); MapIndex(index_temp, cdir, index); a_cc = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,0,0); + hypre_SetIndex3(index_temp, -1, 0, 0); MapIndex(index_temp, cdir, index); a_cw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); a_ce = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); a_cs = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); a_cn = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); a_ac = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,0,-1); + hypre_SetIndex3(index_temp, 0, 0, -1); MapIndex(index_temp, cdir, index); a_bc = hypre_StructMatrixExtractPointerByIndex(A, fi, index); @@ -1124,43 +1127,43 @@ hypre_PFMG3BuildRAPSym_onebox_FSS19_CC0( * a_cne is pointer for northeast coefficient in same plane *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,-1,0,1); + hypre_SetIndex3(index_temp, -1, 0, 1); MapIndex(index_temp, cdir, index); a_aw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,-1,1); + hypre_SetIndex3(index_temp, 0, -1, 1); MapIndex(index_temp, cdir, index); a_as = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,0,-1); + hypre_SetIndex3(index_temp, -1, 0, -1); MapIndex(index_temp, cdir, index); a_bw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,0,-1); + hypre_SetIndex3(index_temp, 1, 0, -1); MapIndex(index_temp, cdir, index); a_be = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,-1,-1); + hypre_SetIndex3(index_temp, 0, -1, -1); MapIndex(index_temp, cdir, index); a_bs = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,1,-1); + hypre_SetIndex3(index_temp, 0, 1, -1); MapIndex(index_temp, cdir, index); a_bn = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,-1,0); + hypre_SetIndex3(index_temp, -1, -1, 0); MapIndex(index_temp, cdir, index); a_csw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,-1,0); + hypre_SetIndex3(index_temp, 1, -1, 0); MapIndex(index_temp, cdir, index); a_cse = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,1,0); + hypre_SetIndex3(index_temp, -1, 1, 0); MapIndex(index_temp, cdir, index); a_cnw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,1,0); + hypre_SetIndex3(index_temp, 1, 1, 0); MapIndex(index_temp, cdir, index); a_cne = hypre_StructMatrixExtractPointerByIndex(A, fi, index); @@ -1173,43 +1176,43 @@ hypre_PFMG3BuildRAPSym_onebox_FSS19_CC0( * rap_cc is pointer for center coefficient (etc.) *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,0); + hypre_SetIndex3(index_temp, 0, 0, 0); MapIndex(index_temp, cdir, index); rap_cc = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,0,0); + hypre_SetIndex3(index_temp, -1, 0, 0); MapIndex(index_temp, cdir, index); rap_cw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); rap_cs = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,0,-1); + hypre_SetIndex3(index_temp, 0, 0, -1); MapIndex(index_temp, cdir, index); rap_bc = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,0,-1); + hypre_SetIndex3(index_temp, -1, 0, -1); MapIndex(index_temp, cdir, index); rap_bw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,0,-1); + hypre_SetIndex3(index_temp, 1, 0, -1); MapIndex(index_temp, cdir, index); rap_be = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,-1,-1); + hypre_SetIndex3(index_temp, 0, -1, -1); MapIndex(index_temp, cdir, index); rap_bs = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,1,-1); + hypre_SetIndex3(index_temp, 0, 1, -1); MapIndex(index_temp, cdir, index); rap_bn = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,-1,0); + hypre_SetIndex3(index_temp, -1, -1, 0); MapIndex(index_temp, cdir, index); rap_csw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,-1,0); + hypre_SetIndex3(index_temp, 1, -1, 0); MapIndex(index_temp, cdir, index); rap_cse = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); @@ -1224,19 +1227,19 @@ hypre_PFMG3BuildRAPSym_onebox_FSS19_CC0( * rap_csw is pointer for southwest coefficient in same plane (etc.) *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,-1,-1,-1); + hypre_SetIndex3(index_temp, -1, -1, -1); MapIndex(index_temp, cdir, index); rap_bsw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,-1,-1); + hypre_SetIndex3(index_temp, 1, -1, -1); MapIndex(index_temp, cdir, index); rap_bse = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,1,-1); + hypre_SetIndex3(index_temp, -1, 1, -1); MapIndex(index_temp, cdir, index); rap_bnw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,1,-1); + hypre_SetIndex3(index_temp, 1, 1, -1); MapIndex(index_temp, cdir, index); rap_bne = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); @@ -1248,28 +1251,28 @@ hypre_PFMG3BuildRAPSym_onebox_FSS19_CC0( * Offsets are used in refering to data associated with other points. *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); - zOffsetP = hypre_BoxOffsetDistance(P_dbox,index); + zOffsetP = hypre_BoxOffsetDistance(P_dbox, index); if ( constant_coefficient_A == 0 ) { - zOffsetA = hypre_BoxOffsetDistance(A_dbox,index); + zOffsetA = hypre_BoxOffsetDistance(A_dbox, index); } else { - zOffsetA_diag = hypre_BoxOffsetDistance(A_dbox,index); + zOffsetA_diag = hypre_BoxOffsetDistance(A_dbox, index); zOffsetA_offd = 0; } - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); - yOffsetP = hypre_BoxOffsetDistance(P_dbox,index); + yOffsetP = hypre_BoxOffsetDistance(P_dbox, index); - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); - xOffsetP = hypre_BoxOffsetDistance(P_dbox,index); + xOffsetP = hypre_BoxOffsetDistance(P_dbox, index); /*-------------------------------------------------------------------- * Switch statement to direct control to apropriate BoxLoop depending @@ -1287,7 +1290,7 @@ hypre_PFMG3BuildRAPSym_onebox_FSS19_CC0( hypre_BoxGetSize(cgrid_box, loop_size); - if ( constant_coefficient_A==0 ) + if ( constant_coefficient_A == 0 ) { #define DEVICE_VAR is_device_ptr(rap_bsw,rb,a_csw,pa,rap_bs,a_cs,a_bs,rap_bse,a_cse,rap_bw,a_cw,a_bw,rap_bc,a_bc,a_cc,rap_be,a_ce,a_be,rap_bnw,a_cnw,rap_bn,a_cn,a_bn,rap_bne,a_cne,rap_csw,pb,ra,rap_cs,a_as,rap_cse,rap_cw,a_aw,rap_cc,a_ac) hypre_BoxLoop4Begin(hypre_StructMatrixNDim(A), loop_size, @@ -1300,77 +1303,77 @@ hypre_PFMG3BuildRAPSym_onebox_FSS19_CC0( HYPRE_Int iAp1 = iA + zOffsetA; HYPRE_Int iP1 = iP - zOffsetP - yOffsetP - xOffsetP; - rap_bsw[iAc] = rb[iR-rbOffset] * a_csw[iAm1] * pa[iP1]; + rap_bsw[iAc] = rb[iR - rbOffset] * a_csw[iAm1] * pa[iP1]; iP1 = iP - zOffsetP - yOffsetP; - rap_bs[iAc] = rb[iR-rbOffset] * a_cs[iAm1] * pa[iP1] - + rb[iR-rbOffset] * a_bs[iAm1] - + a_bs[iA] * pa[iP1]; + rap_bs[iAc] = rb[iR - rbOffset] * a_cs[iAm1] * pa[iP1] + + rb[iR - rbOffset] * a_bs[iAm1] + + a_bs[iA] * pa[iP1]; iP1 = iP - zOffsetP - yOffsetP + xOffsetP; - rap_bse[iAc] = rb[iR-rbOffset] * a_cse[iAm1] * pa[iP1]; + rap_bse[iAc] = rb[iR - rbOffset] * a_cse[iAm1] * pa[iP1]; iP1 = iP - zOffsetP - xOffsetP; - rap_bw[iAc] = rb[iR-rbOffset] * a_cw[iAm1] * pa[iP1] - + rb[iR-rbOffset] * a_bw[iAm1] - + a_bw[iA] * pa[iP1]; + rap_bw[iAc] = rb[iR - rbOffset] * a_cw[iAm1] * pa[iP1] + + rb[iR - rbOffset] * a_bw[iAm1] + + a_bw[iA] * pa[iP1]; iP1 = iP - zOffsetP; rap_bc[iAc] = a_bc[iA] * pa[iP1] - + rb[iR-rbOffset] * a_cc[iAm1] * pa[iP1] - + rb[iR-rbOffset] * a_bc[iAm1]; + + rb[iR - rbOffset] * a_cc[iAm1] * pa[iP1] + + rb[iR - rbOffset] * a_bc[iAm1]; iP1 = iP - zOffsetP + xOffsetP; - rap_be[iAc] = rb[iR-rbOffset] * a_ce[iAm1] * pa[iP1] - + rb[iR-rbOffset] * a_be[iAm1] - + a_be[iA] * pa[iP1]; + rap_be[iAc] = rb[iR - rbOffset] * a_ce[iAm1] * pa[iP1] + + rb[iR - rbOffset] * a_be[iAm1] + + a_be[iA] * pa[iP1]; iP1 = iP - zOffsetP + yOffsetP - xOffsetP; - rap_bnw[iAc] = rb[iR-rbOffset] * a_cnw[iAm1] * pa[iP1]; + rap_bnw[iAc] = rb[iR - rbOffset] * a_cnw[iAm1] * pa[iP1]; iP1 = iP - zOffsetP + yOffsetP; - rap_bn[iAc] = rb[iR-rbOffset] * a_cn[iAm1] * pa[iP1] - + rb[iR-rbOffset] * a_bn[iAm1] - + a_bn[iA] * pa[iP1]; + rap_bn[iAc] = rb[iR - rbOffset] * a_cn[iAm1] * pa[iP1] + + rb[iR - rbOffset] * a_bn[iAm1] + + a_bn[iA] * pa[iP1]; iP1 = iP - zOffsetP + yOffsetP + xOffsetP; - rap_bne[iAc] = rb[iR-rbOffset] * a_cne[iAm1] * pa[iP1]; + rap_bne[iAc] = rb[iR - rbOffset] * a_cne[iAm1] * pa[iP1]; iP1 = iP - yOffsetP - xOffsetP; rap_csw[iAc] = a_csw[iA] - + rb[iR-rbOffset] * a_csw[iAm1] * pb[iP1-pbOffset] - + ra[iR] * a_csw[iAp1] * pa[iP1]; + + rb[iR - rbOffset] * a_csw[iAm1] * pb[iP1 - pbOffset] + + ra[iR] * a_csw[iAp1] * pa[iP1]; iP1 = iP - yOffsetP; rap_cs[iAc] = a_cs[iA] - + rb[iR-rbOffset] * a_cs[iAm1] * pb[iP1-pbOffset] - + ra[iR] * a_cs[iAp1] * pa[iP1] - + a_bs[iA] * pb[iP1-pbOffset] - + a_as[iA] * pa[iP1] - + rb[iR-rbOffset] * a_as[iAm1] - + ra[iR] * a_bs[iAp1]; + + rb[iR - rbOffset] * a_cs[iAm1] * pb[iP1 - pbOffset] + + ra[iR] * a_cs[iAp1] * pa[iP1] + + a_bs[iA] * pb[iP1 - pbOffset] + + a_as[iA] * pa[iP1] + + rb[iR - rbOffset] * a_as[iAm1] + + ra[iR] * a_bs[iAp1]; iP1 = iP - yOffsetP + xOffsetP; rap_cse[iAc] = a_cse[iA] - + rb[iR-rbOffset] * a_cse[iAm1] * pb[iP1-pbOffset] - + ra[iR] * a_cse[iAp1] * pa[iP1]; + + rb[iR - rbOffset] * a_cse[iAm1] * pb[iP1 - pbOffset] + + ra[iR] * a_cse[iAp1] * pa[iP1]; iP1 = iP - xOffsetP; rap_cw[iAc] = a_cw[iA] - + rb[iR-rbOffset] * a_cw[iAm1] * pb[iP1-pbOffset] - + ra[iR] * a_cw[iAp1] * pa[iP1] - + a_bw[iA] * pb[iP1-pbOffset] - + a_aw[iA] * pa[iP1] - + rb[iR-rbOffset] * a_aw[iAm1] - + ra[iR] * a_bw[iAp1]; + + rb[iR - rbOffset] * a_cw[iAm1] * pb[iP1 - pbOffset] + + ra[iR] * a_cw[iAp1] * pa[iP1] + + a_bw[iA] * pb[iP1 - pbOffset] + + a_aw[iA] * pa[iP1] + + rb[iR - rbOffset] * a_aw[iAm1] + + ra[iR] * a_bw[iAp1]; rap_cc[iAc] = a_cc[iA] - + rb[iR-rbOffset] * a_cc[iAm1] * pb[iP-pbOffset] - + ra[iR] * a_cc[iAp1] * pa[iP] - + rb[iR-rbOffset] * a_ac[iAm1] - + ra[iR] * a_bc[iAp1] - + a_bc[iA] * pb[iP-pbOffset] - + a_ac[iA] * pa[iP]; + + rb[iR - rbOffset] * a_cc[iAm1] * pb[iP - pbOffset] + + ra[iR] * a_cc[iAp1] * pa[iP] + + rb[iR - rbOffset] * a_ac[iAm1] + + ra[iR] * a_bc[iAp1] + + a_bc[iA] * pb[iP - pbOffset] + + a_ac[iA] * pa[iP]; } hypre_BoxLoop4End(iP, iR, iA, iAc); @@ -1428,84 +1431,84 @@ hypre_PFMG3BuildRAPSym_onebox_FSS19_CC0( HYPRE_Int iAp1 = iA + zOffsetA_diag; HYPRE_Int iP1 = iP - zOffsetP - yOffsetP - xOffsetP; - rap_bsw[iAc] = rb[iR-rbOffset] * a_csw_offdm1 * pa[iP1]; + rap_bsw[iAc] = rb[iR - rbOffset] * a_csw_offdm1 * pa[iP1]; iP1 = iP - zOffsetP - yOffsetP; - rap_bs[iAc] = rb[iR-rbOffset] * a_cs_offdm1 * pa[iP1] - + rb[iR-rbOffset] * a_bs_offdm1 - + a_bs_offd * pa[iP1]; + rap_bs[iAc] = rb[iR - rbOffset] * a_cs_offdm1 * pa[iP1] + + rb[iR - rbOffset] * a_bs_offdm1 + + a_bs_offd * pa[iP1]; iP1 = iP - zOffsetP - yOffsetP + xOffsetP; - rap_bse[iAc] = rb[iR-rbOffset] * a_cse_offdm1 * pa[iP1]; + rap_bse[iAc] = rb[iR - rbOffset] * a_cse_offdm1 * pa[iP1]; iP1 = iP - zOffsetP - xOffsetP; - rap_bw[iAc] = rb[iR-rbOffset] * a_cw_offdm1 * pa[iP1] - + rb[iR-rbOffset] * a_bw_offdm1 - + a_bw_offd * pa[iP1]; + rap_bw[iAc] = rb[iR - rbOffset] * a_cw_offdm1 * pa[iP1] + + rb[iR - rbOffset] * a_bw_offdm1 + + a_bw_offd * pa[iP1]; iP1 = iP - zOffsetP; rap_bc[iAc] = a_bc_offd * pa[iP1] - + rb[iR-rbOffset] * a_cc[iAm1] * pa[iP1] - + rb[iR-rbOffset] * a_bc_offdm1; + + rb[iR - rbOffset] * a_cc[iAm1] * pa[iP1] + + rb[iR - rbOffset] * a_bc_offdm1; iP1 = iP - zOffsetP + xOffsetP; - rap_be[iAc] = rb[iR-rbOffset] * a_ce_offdm1 * pa[iP1] - + rb[iR-rbOffset] * a_be_offdm1 - + a_be_offd * pa[iP1]; + rap_be[iAc] = rb[iR - rbOffset] * a_ce_offdm1 * pa[iP1] + + rb[iR - rbOffset] * a_be_offdm1 + + a_be_offd * pa[iP1]; iP1 = iP - zOffsetP + yOffsetP - xOffsetP; - rap_bnw[iAc] = rb[iR-rbOffset] * a_cnw_offdm1 * pa[iP1]; + rap_bnw[iAc] = rb[iR - rbOffset] * a_cnw_offdm1 * pa[iP1]; iP1 = iP - zOffsetP + yOffsetP; - rap_bn[iAc] = rb[iR-rbOffset] * a_cn_offdm1 * pa[iP1] - + rb[iR-rbOffset] * a_bn_offdm1 - + a_bn_offd * pa[iP1]; + rap_bn[iAc] = rb[iR - rbOffset] * a_cn_offdm1 * pa[iP1] + + rb[iR - rbOffset] * a_bn_offdm1 + + a_bn_offd * pa[iP1]; iP1 = iP - zOffsetP + yOffsetP + xOffsetP; - rap_bne[iAc] = rb[iR-rbOffset] * a_cne_offdm1 * pa[iP1]; + rap_bne[iAc] = rb[iR - rbOffset] * a_cne_offdm1 * pa[iP1]; iP1 = iP - yOffsetP - xOffsetP; rap_csw[iAc] = a_csw_offd - + rb[iR-rbOffset] * a_csw_offdm1 * pb[iP1-pbOffset] - + ra[iR] * a_csw_offdp1 * pa[iP1-pbOffset]; + + rb[iR - rbOffset] * a_csw_offdm1 * pb[iP1 - pbOffset] + + ra[iR] * a_csw_offdp1 * pa[iP1 - pbOffset]; iP1 = iP - yOffsetP; rap_cs[iAc] = a_cs_offd - + rb[iR-rbOffset] * a_cs_offdm1 * pb[iP1-pbOffset] - + ra[iR] * a_cs_offdp1 * pa[iP1] - + a_bs_offd * pb[iP1-pbOffset] - + a_as_offd * pa[iP1] - + rb[iR-rbOffset] * a_as_offdm1 - + ra[iR] * a_bs_offdp1; + + rb[iR - rbOffset] * a_cs_offdm1 * pb[iP1 - pbOffset] + + ra[iR] * a_cs_offdp1 * pa[iP1] + + a_bs_offd * pb[iP1 - pbOffset] + + a_as_offd * pa[iP1] + + rb[iR - rbOffset] * a_as_offdm1 + + ra[iR] * a_bs_offdp1; iP1 = iP - yOffsetP + xOffsetP; rap_cse[iAc] = a_cse_offd - + rb[iR-rbOffset] * a_cse_offdm1 * pb[iP1-pbOffset] - + ra[iR] * a_cse_offdp1 * pa[iP1]; + + rb[iR - rbOffset] * a_cse_offdm1 * pb[iP1 - pbOffset] + + ra[iR] * a_cse_offdp1 * pa[iP1]; iP1 = iP - xOffsetP; rap_cw[iAc] = a_cw_offd - + rb[iR-rbOffset] * a_cw_offdm1 * pb[iP1-pbOffset] - + ra[iR] * a_cw_offdp1 * pa[iP1] - + a_bw_offd * pb[iP1-pbOffset] - + a_aw_offd * pa[iP1] - + rb[iR-rbOffset] * a_aw_offdm1 - + ra[iR] * a_bw_offdp1; + + rb[iR - rbOffset] * a_cw_offdm1 * pb[iP1 - pbOffset] + + ra[iR] * a_cw_offdp1 * pa[iP1] + + a_bw_offd * pb[iP1 - pbOffset] + + a_aw_offd * pa[iP1] + + rb[iR - rbOffset] * a_aw_offdm1 + + ra[iR] * a_bw_offdp1; rap_cc[iAc] = a_cc[iA] - + rb[iR-rbOffset] * a_cc[iAm1] * pb[iP-pbOffset] - + ra[iR] * a_cc[iAp1] * pa[iP] - + rb[iR-rbOffset] * a_ac_offdm1 - + ra[iR] * a_bc_offdp1 - + a_bc_offd * pb[iP-pbOffset] - + a_ac_offd * pa[iP]; + + rb[iR - rbOffset] * a_cc[iAm1] * pb[iP - pbOffset] + + ra[iR] * a_cc[iAp1] * pa[iP] + + rb[iR - rbOffset] * a_ac_offdm1 + + ra[iR] * a_bc_offdp1 + + a_bc_offd * pb[iP - pbOffset] + + a_ac_offd * pa[iP]; } hypre_BoxLoop4End(iP, iR, iA, iAc); #undef DEVICE_VAR } -/* }*/ /* end ForBoxI */ + /* }*/ /* end ForBoxI */ return hypre_error_flag; } @@ -1571,11 +1574,11 @@ hypre_PFMG3BuildRAPSym_onebox_FSS19_CC1( * pb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,-1); + hypre_SetIndex3(index_temp, 0, 0, -1); MapIndex(index_temp, cdir, index); pa = hypre_StructMatrixExtractPointerByIndex(P, fi, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); pb = hypre_StructMatrixExtractPointerByIndex(P, fi, index); @@ -1586,11 +1589,11 @@ hypre_PFMG3BuildRAPSym_onebox_FSS19_CC1( * rb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,-1); + hypre_SetIndex3(index_temp, 0, 0, -1); MapIndex(index_temp, cdir, index); ra = hypre_StructMatrixExtractPointerByIndex(R, fi, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); rb = hypre_StructMatrixExtractPointerByIndex(R, fi, index); @@ -1607,31 +1610,31 @@ hypre_PFMG3BuildRAPSym_onebox_FSS19_CC1( * a_bc is pointer for center coefficient in plane below *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,0); + hypre_SetIndex3(index_temp, 0, 0, 0); MapIndex(index_temp, cdir, index); a_cc = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,0,0); + hypre_SetIndex3(index_temp, -1, 0, 0); MapIndex(index_temp, cdir, index); a_cw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); a_ce = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); a_cs = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); a_cn = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); a_ac = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,0,-1); + hypre_SetIndex3(index_temp, 0, 0, -1); MapIndex(index_temp, cdir, index); a_bc = hypre_StructMatrixExtractPointerByIndex(A, fi, index); @@ -1652,43 +1655,43 @@ hypre_PFMG3BuildRAPSym_onebox_FSS19_CC1( * a_cne is pointer for northeast coefficient in same plane *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,-1,0,1); + hypre_SetIndex3(index_temp, -1, 0, 1); MapIndex(index_temp, cdir, index); a_aw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,-1,1); + hypre_SetIndex3(index_temp, 0, -1, 1); MapIndex(index_temp, cdir, index); a_as = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,0,-1); + hypre_SetIndex3(index_temp, -1, 0, -1); MapIndex(index_temp, cdir, index); a_bw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,0,-1); + hypre_SetIndex3(index_temp, 1, 0, -1); MapIndex(index_temp, cdir, index); a_be = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,-1,-1); + hypre_SetIndex3(index_temp, 0, -1, -1); MapIndex(index_temp, cdir, index); a_bs = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,1,-1); + hypre_SetIndex3(index_temp, 0, 1, -1); MapIndex(index_temp, cdir, index); a_bn = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,-1,0); + hypre_SetIndex3(index_temp, -1, -1, 0); MapIndex(index_temp, cdir, index); a_csw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,-1,0); + hypre_SetIndex3(index_temp, 1, -1, 0); MapIndex(index_temp, cdir, index); a_cse = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,1,0); + hypre_SetIndex3(index_temp, -1, 1, 0); MapIndex(index_temp, cdir, index); a_cnw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,1,0); + hypre_SetIndex3(index_temp, 1, 1, 0); MapIndex(index_temp, cdir, index); a_cne = hypre_StructMatrixExtractPointerByIndex(A, fi, index); @@ -1700,43 +1703,43 @@ hypre_PFMG3BuildRAPSym_onebox_FSS19_CC1( * rap_cc is pointer for center coefficient (etc.) *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,0); + hypre_SetIndex3(index_temp, 0, 0, 0); MapIndex(index_temp, cdir, index); rap_cc = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,0,0); + hypre_SetIndex3(index_temp, -1, 0, 0); MapIndex(index_temp, cdir, index); rap_cw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); rap_cs = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,0,-1); + hypre_SetIndex3(index_temp, 0, 0, -1); MapIndex(index_temp, cdir, index); rap_bc = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,0,-1); + hypre_SetIndex3(index_temp, -1, 0, -1); MapIndex(index_temp, cdir, index); rap_bw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,0,-1); + hypre_SetIndex3(index_temp, 1, 0, -1); MapIndex(index_temp, cdir, index); rap_be = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,-1,-1); + hypre_SetIndex3(index_temp, 0, -1, -1); MapIndex(index_temp, cdir, index); rap_bs = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,1,-1); + hypre_SetIndex3(index_temp, 0, 1, -1); MapIndex(index_temp, cdir, index); rap_bn = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,-1,0); + hypre_SetIndex3(index_temp, -1, -1, 0); MapIndex(index_temp, cdir, index); rap_csw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,-1,0); + hypre_SetIndex3(index_temp, 1, -1, 0); MapIndex(index_temp, cdir, index); rap_cse = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); @@ -1751,19 +1754,19 @@ hypre_PFMG3BuildRAPSym_onebox_FSS19_CC1( * rap_csw is pointer for southwest coefficient in same plane (etc.) *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,-1,-1,-1); + hypre_SetIndex3(index_temp, -1, -1, -1); MapIndex(index_temp, cdir, index); rap_bsw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,-1,-1); + hypre_SetIndex3(index_temp, 1, -1, -1); MapIndex(index_temp, cdir, index); rap_bse = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,1,-1); + hypre_SetIndex3(index_temp, -1, 1, -1); MapIndex(index_temp, cdir, index); rap_bnw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,1,-1); + hypre_SetIndex3(index_temp, 1, 1, -1); MapIndex(index_temp, cdir, index); rap_bne = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); @@ -1775,18 +1778,18 @@ hypre_PFMG3BuildRAPSym_onebox_FSS19_CC1( * Offsets are used in refering to data associated with other points. *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); zOffsetA = 0; zOffsetP = 0; - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); yOffsetP = 0; - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); xOffsetP = 0; @@ -1818,75 +1821,75 @@ hypre_PFMG3BuildRAPSym_onebox_FSS19_CC1( iP1 = iP - zOffsetP - yOffsetP; rap_bs[iAc] = rb[iR] * a_cs[iAm1] * pa[iP1] - + rb[iR] * a_bs[iAm1] - + a_bs[iA] * pa[iP1]; + + rb[iR] * a_bs[iAm1] + + a_bs[iA] * pa[iP1]; iP1 = iP - zOffsetP - yOffsetP + xOffsetP; rap_bse[iAc] = rb[iR] * a_cse[iAm1] * pa[iP1]; iP1 = iP - zOffsetP - xOffsetP; rap_bw[iAc] = rb[iR] * a_cw[iAm1] * pa[iP1] - + rb[iR] * a_bw[iAm1] - + a_bw[iA] * pa[iP1]; + + rb[iR] * a_bw[iAm1] + + a_bw[iA] * pa[iP1]; iP1 = iP - zOffsetP; rap_bc[iAc] = a_bc[iA] * pa[iP1] - + rb[iR] * a_cc[iAm1] * pa[iP1] - + rb[iR] * a_bc[iAm1]; + + rb[iR] * a_cc[iAm1] * pa[iP1] + + rb[iR] * a_bc[iAm1]; iP1 = iP - zOffsetP + xOffsetP; rap_be[iAc] = rb[iR] * a_ce[iAm1] * pa[iP1] - + rb[iR] * a_be[iAm1] - + a_be[iA] * pa[iP1]; + + rb[iR] * a_be[iAm1] + + a_be[iA] * pa[iP1]; iP1 = iP - zOffsetP + yOffsetP - xOffsetP; rap_bnw[iAc] = rb[iR] * a_cnw[iAm1] * pa[iP1]; iP1 = iP - zOffsetP + yOffsetP; rap_bn[iAc] = rb[iR] * a_cn[iAm1] * pa[iP1] - + rb[iR] * a_bn[iAm1] - + a_bn[iA] * pa[iP1]; + + rb[iR] * a_bn[iAm1] + + a_bn[iA] * pa[iP1]; iP1 = iP - zOffsetP + yOffsetP + xOffsetP; rap_bne[iAc] = rb[iR] * a_cne[iAm1] * pa[iP1]; iP1 = iP - yOffsetP - xOffsetP; rap_csw[iAc] = a_csw[iA] - + rb[iR] * a_csw[iAm1] * pb[iP1] - + ra[iR] * a_csw[iAp1] * pa[iP1]; + + rb[iR] * a_csw[iAm1] * pb[iP1] + + ra[iR] * a_csw[iAp1] * pa[iP1]; iP1 = iP - yOffsetP; rap_cs[iAc] = a_cs[iA] - + rb[iR] * a_cs[iAm1] * pb[iP1] - + ra[iR] * a_cs[iAp1] * pa[iP1] - + a_bs[iA] * pb[iP1] - + a_as[iA] * pa[iP1] - + rb[iR] * a_as[iAm1] - + ra[iR] * a_bs[iAp1]; + + rb[iR] * a_cs[iAm1] * pb[iP1] + + ra[iR] * a_cs[iAp1] * pa[iP1] + + a_bs[iA] * pb[iP1] + + a_as[iA] * pa[iP1] + + rb[iR] * a_as[iAm1] + + ra[iR] * a_bs[iAp1]; iP1 = iP - yOffsetP + xOffsetP; rap_cse[iAc] = a_cse[iA] - + rb[iR] * a_cse[iAm1] * pb[iP1] - + ra[iR] * a_cse[iAp1] * pa[iP1]; + + rb[iR] * a_cse[iAm1] * pb[iP1] + + ra[iR] * a_cse[iAp1] * pa[iP1]; iP1 = iP - xOffsetP; rap_cw[iAc] = a_cw[iA] - + rb[iR] * a_cw[iAm1] * pb[iP1] - + ra[iR] * a_cw[iAp1] * pa[iP1] - + a_bw[iA] * pb[iP1] - + a_aw[iA] * pa[iP1] - + rb[iR] * a_aw[iAm1] - + ra[iR] * a_bw[iAp1]; + + rb[iR] * a_cw[iAm1] * pb[iP1] + + ra[iR] * a_cw[iAp1] * pa[iP1] + + a_bw[iA] * pb[iP1] + + a_aw[iA] * pa[iP1] + + rb[iR] * a_aw[iAm1] + + ra[iR] * a_bw[iAp1]; rap_cc[iAc] = a_cc[iA] - + rb[iR] * a_cc[iAm1] * pb[iP] - + ra[iR] * a_cc[iAp1] * pa[iP] - + rb[iR] * a_ac[iAm1] - + ra[iR] * a_bc[iAp1] - + a_bc[iA] * pb[iP] - + a_ac[iA] * pa[iP]; + + rb[iR] * a_cc[iAm1] * pb[iP] + + ra[iR] * a_cc[iAp1] * pa[iP] + + rb[iR] * a_ac[iAm1] + + ra[iR] * a_bc[iAp1] + + a_bc[iA] * pb[iP] + + a_ac[iA] * pa[iP]; -/* }*/ /* end ForBoxI */ + /* }*/ /* end ForBoxI */ return hypre_error_flag; } @@ -1995,11 +1998,11 @@ hypre_PFMG3BuildRAPSym_onebox_FSS27_CC0( * pb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,-1); + hypre_SetIndex3(index_temp, 0, 0, -1); MapIndex(index_temp, cdir, index); pa = hypre_StructMatrixExtractPointerByIndex(P, fi, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); pb = hypre_StructMatrixExtractPointerByIndex(P, fi, index); @@ -2012,11 +2015,11 @@ hypre_PFMG3BuildRAPSym_onebox_FSS27_CC0( * rb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,-1); + hypre_SetIndex3(index_temp, 0, 0, -1); MapIndex(index_temp, cdir, index); ra = hypre_StructMatrixExtractPointerByIndex(R, fi, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); rb = hypre_StructMatrixExtractPointerByIndex(R, fi, index); @@ -2035,31 +2038,31 @@ hypre_PFMG3BuildRAPSym_onebox_FSS27_CC0( * a_bc is pointer for center coefficient in plane below *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,0); + hypre_SetIndex3(index_temp, 0, 0, 0); MapIndex(index_temp, cdir, index); a_cc = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,0,0); + hypre_SetIndex3(index_temp, -1, 0, 0); MapIndex(index_temp, cdir, index); a_cw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); a_ce = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); a_cs = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); a_cn = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); a_ac = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,0,-1); + hypre_SetIndex3(index_temp, 0, 0, -1); MapIndex(index_temp, cdir, index); a_bc = hypre_StructMatrixExtractPointerByIndex(A, fi, index); @@ -2080,43 +2083,43 @@ hypre_PFMG3BuildRAPSym_onebox_FSS27_CC0( * a_cne is pointer for northeast coefficient in same plane *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,-1,0,1); + hypre_SetIndex3(index_temp, -1, 0, 1); MapIndex(index_temp, cdir, index); a_aw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,-1,1); + hypre_SetIndex3(index_temp, 0, -1, 1); MapIndex(index_temp, cdir, index); a_as = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,0,-1); + hypre_SetIndex3(index_temp, -1, 0, -1); MapIndex(index_temp, cdir, index); a_bw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,0,-1); + hypre_SetIndex3(index_temp, 1, 0, -1); MapIndex(index_temp, cdir, index); a_be = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,-1,-1); + hypre_SetIndex3(index_temp, 0, -1, -1); MapIndex(index_temp, cdir, index); a_bs = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,1,-1); + hypre_SetIndex3(index_temp, 0, 1, -1); MapIndex(index_temp, cdir, index); a_bn = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,-1,0); + hypre_SetIndex3(index_temp, -1, -1, 0); MapIndex(index_temp, cdir, index); a_csw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,-1,0); + hypre_SetIndex3(index_temp, 1, -1, 0); MapIndex(index_temp, cdir, index); a_cse = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,1,0); + hypre_SetIndex3(index_temp, -1, 1, 0); MapIndex(index_temp, cdir, index); a_cnw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,1,0); + hypre_SetIndex3(index_temp, 1, 1, 0); MapIndex(index_temp, cdir, index); a_cne = hypre_StructMatrixExtractPointerByIndex(A, fi, index); @@ -2133,27 +2136,27 @@ hypre_PFMG3BuildRAPSym_onebox_FSS27_CC0( * a_bne is pointer for northeast coefficient in plane below *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,-1,-1,1); + hypre_SetIndex3(index_temp, -1, -1, 1); MapIndex(index_temp, cdir, index); a_asw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,-1,1); + hypre_SetIndex3(index_temp, 1, -1, 1); MapIndex(index_temp, cdir, index); a_ase = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,-1,-1); + hypre_SetIndex3(index_temp, -1, -1, -1); MapIndex(index_temp, cdir, index); a_bsw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,-1,-1); + hypre_SetIndex3(index_temp, 1, -1, -1); MapIndex(index_temp, cdir, index); a_bse = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,1,-1); + hypre_SetIndex3(index_temp, -1, 1, -1); MapIndex(index_temp, cdir, index); a_bnw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,1,-1); + hypre_SetIndex3(index_temp, 1, 1, -1); MapIndex(index_temp, cdir, index); a_bne = hypre_StructMatrixExtractPointerByIndex(A, fi, index); @@ -2165,43 +2168,43 @@ hypre_PFMG3BuildRAPSym_onebox_FSS27_CC0( * rap_cc is pointer for center coefficient (etc.) *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,0); + hypre_SetIndex3(index_temp, 0, 0, 0); MapIndex(index_temp, cdir, index); rap_cc = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,0,0); + hypre_SetIndex3(index_temp, -1, 0, 0); MapIndex(index_temp, cdir, index); rap_cw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); rap_cs = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,0,-1); + hypre_SetIndex3(index_temp, 0, 0, -1); MapIndex(index_temp, cdir, index); rap_bc = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,0,-1); + hypre_SetIndex3(index_temp, -1, 0, -1); MapIndex(index_temp, cdir, index); rap_bw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,0,-1); + hypre_SetIndex3(index_temp, 1, 0, -1); MapIndex(index_temp, cdir, index); rap_be = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,-1,-1); + hypre_SetIndex3(index_temp, 0, -1, -1); MapIndex(index_temp, cdir, index); rap_bs = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,1,-1); + hypre_SetIndex3(index_temp, 0, 1, -1); MapIndex(index_temp, cdir, index); rap_bn = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,-1,0); + hypre_SetIndex3(index_temp, -1, -1, 0); MapIndex(index_temp, cdir, index); rap_csw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,-1,0); + hypre_SetIndex3(index_temp, 1, -1, 0); MapIndex(index_temp, cdir, index); rap_cse = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); @@ -2216,19 +2219,19 @@ hypre_PFMG3BuildRAPSym_onebox_FSS27_CC0( * rap_csw is pointer for southwest coefficient in same plane (etc.) *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,-1,-1,-1); + hypre_SetIndex3(index_temp, -1, -1, -1); MapIndex(index_temp, cdir, index); rap_bsw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,-1,-1); + hypre_SetIndex3(index_temp, 1, -1, -1); MapIndex(index_temp, cdir, index); rap_bse = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,1,-1); + hypre_SetIndex3(index_temp, -1, 1, -1); MapIndex(index_temp, cdir, index); rap_bnw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,1,-1); + hypre_SetIndex3(index_temp, 1, 1, -1); MapIndex(index_temp, cdir, index); rap_bne = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); @@ -2240,29 +2243,29 @@ hypre_PFMG3BuildRAPSym_onebox_FSS27_CC0( * Offsets are used in refering to data associated with other points. *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); - zOffsetP = hypre_BoxOffsetDistance(P_dbox,index); + zOffsetP = hypre_BoxOffsetDistance(P_dbox, index); if ( constant_coefficient_A == 0 ) { - zOffsetA = hypre_BoxOffsetDistance(A_dbox,index); + zOffsetA = hypre_BoxOffsetDistance(A_dbox, index); } else { - zOffsetA_diag = hypre_BoxOffsetDistance(A_dbox,index); + zOffsetA_diag = hypre_BoxOffsetDistance(A_dbox, index); zOffsetA_offd = 0; } - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); - yOffsetP = hypre_BoxOffsetDistance(P_dbox,index); + yOffsetP = hypre_BoxOffsetDistance(P_dbox, index); - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); - xOffsetP = hypre_BoxOffsetDistance(P_dbox,index); + xOffsetP = hypre_BoxOffsetDistance(P_dbox, index); /*-------------------------------------------------------------------- * Switch statement to direct control to apropriate BoxLoop depending @@ -2293,93 +2296,93 @@ hypre_PFMG3BuildRAPSym_onebox_FSS27_CC0( HYPRE_Int iAp1 = iA + zOffsetA; HYPRE_Int iP1 = iP - zOffsetP - yOffsetP - xOffsetP; - rap_bsw[iAc] = rb[iR-rbOffset] * a_csw[iAm1] * pa[iP1] - + rb[iR-rbOffset] * a_bsw[iAm1] - + a_bsw[iA] * pa[iP1]; + rap_bsw[iAc] = rb[iR - rbOffset] * a_csw[iAm1] * pa[iP1] + + rb[iR - rbOffset] * a_bsw[iAm1] + + a_bsw[iA] * pa[iP1]; iP1 = iP - zOffsetP - yOffsetP; - rap_bs[iAc] = rb[iR-rbOffset] * a_cs[iAm1] * pa[iP1] - + rb[iR-rbOffset] * a_bs[iAm1] - + a_bs[iA] * pa[iP1]; + rap_bs[iAc] = rb[iR - rbOffset] * a_cs[iAm1] * pa[iP1] + + rb[iR - rbOffset] * a_bs[iAm1] + + a_bs[iA] * pa[iP1]; iP1 = iP - zOffsetP - yOffsetP + xOffsetP; - rap_bse[iAc] = rb[iR-rbOffset] * a_cse[iAm1] * pa[iP1] - + rb[iR-rbOffset] * a_bse[iAm1] - + a_bse[iA] * pa[iP1]; + rap_bse[iAc] = rb[iR - rbOffset] * a_cse[iAm1] * pa[iP1] + + rb[iR - rbOffset] * a_bse[iAm1] + + a_bse[iA] * pa[iP1]; iP1 = iP - zOffsetP - xOffsetP; - rap_bw[iAc] = rb[iR-rbOffset] * a_cw[iAm1] * pa[iP1] - + rb[iR-rbOffset] * a_bw[iAm1] - + a_bw[iA] * pa[iP1]; + rap_bw[iAc] = rb[iR - rbOffset] * a_cw[iAm1] * pa[iP1] + + rb[iR - rbOffset] * a_bw[iAm1] + + a_bw[iA] * pa[iP1]; iP1 = iP - zOffsetP; rap_bc[iAc] = a_bc[iA] * pa[iP1] - + rb[iR-rbOffset] * a_cc[iAm1] * pa[iP1] - + rb[iR-rbOffset] * a_bc[iAm1]; + + rb[iR - rbOffset] * a_cc[iAm1] * pa[iP1] + + rb[iR - rbOffset] * a_bc[iAm1]; iP1 = iP - zOffsetP + xOffsetP; - rap_be[iAc] = rb[iR-rbOffset] * a_ce[iAm1] * pa[iP1] - + rb[iR-rbOffset] * a_be[iAm1] - + a_be[iA] * pa[iP1]; + rap_be[iAc] = rb[iR - rbOffset] * a_ce[iAm1] * pa[iP1] + + rb[iR - rbOffset] * a_be[iAm1] + + a_be[iA] * pa[iP1]; iP1 = iP - zOffsetP + yOffsetP - xOffsetP; - rap_bnw[iAc] = rb[iR-rbOffset] * a_cnw[iAm1] * pa[iP1] - + rb[iR-rbOffset] * a_bnw[iAm1] - + a_bnw[iA] * pa[iP1]; + rap_bnw[iAc] = rb[iR - rbOffset] * a_cnw[iAm1] * pa[iP1] + + rb[iR - rbOffset] * a_bnw[iAm1] + + a_bnw[iA] * pa[iP1]; iP1 = iP - zOffsetP + yOffsetP; - rap_bn[iAc] = rb[iR-rbOffset] * a_cn[iAm1] * pa[iP1] - + rb[iR-rbOffset] * a_bn[iAm1] - + a_bn[iA] * pa[iP1]; + rap_bn[iAc] = rb[iR - rbOffset] * a_cn[iAm1] * pa[iP1] + + rb[iR - rbOffset] * a_bn[iAm1] + + a_bn[iA] * pa[iP1]; iP1 = iP - zOffsetP + yOffsetP + xOffsetP; - rap_bne[iAc] = rb[iR-rbOffset] * a_cne[iAm1] * pa[iP1] - + rb[iR-rbOffset] * a_bne[iAm1] - + a_bne[iA] * pa[iP1]; + rap_bne[iAc] = rb[iR - rbOffset] * a_cne[iAm1] * pa[iP1] + + rb[iR - rbOffset] * a_bne[iAm1] + + a_bne[iA] * pa[iP1]; iP1 = iP - yOffsetP - xOffsetP; rap_csw[iAc] = a_csw[iA] - + rb[iR-rbOffset] * a_csw[iAm1] * pb[iP1-pbOffset] - + ra[iR] * a_csw[iAp1] * pa[iP1] - + a_bsw[iA] * pb[iP1-pbOffset] - + a_asw[iA] * pa[iP1] - + rb[iR-rbOffset] * a_asw[iAm1] - + ra[iR] * a_bsw[iAp1]; + + rb[iR - rbOffset] * a_csw[iAm1] * pb[iP1 - pbOffset] + + ra[iR] * a_csw[iAp1] * pa[iP1] + + a_bsw[iA] * pb[iP1 - pbOffset] + + a_asw[iA] * pa[iP1] + + rb[iR - rbOffset] * a_asw[iAm1] + + ra[iR] * a_bsw[iAp1]; iP1 = iP - yOffsetP; rap_cs[iAc] = a_cs[iA] - + rb[iR-rbOffset] * a_cs[iAm1] * pb[iP1-pbOffset] - + ra[iR] * a_cs[iAp1] * pa[iP1] - + a_bs[iA] * pb[iP1-pbOffset] - + a_as[iA] * pa[iP1] - + rb[iR-rbOffset] * a_as[iAm1] - + ra[iR] * a_bs[iAp1]; + + rb[iR - rbOffset] * a_cs[iAm1] * pb[iP1 - pbOffset] + + ra[iR] * a_cs[iAp1] * pa[iP1] + + a_bs[iA] * pb[iP1 - pbOffset] + + a_as[iA] * pa[iP1] + + rb[iR - rbOffset] * a_as[iAm1] + + ra[iR] * a_bs[iAp1]; iP1 = iP - yOffsetP + xOffsetP; rap_cse[iAc] = a_cse[iA] - + rb[iR-rbOffset] * a_cse[iAm1] * pb[iP1-pbOffset] - + ra[iR] * a_cse[iAp1] * pa[iP1] - + a_bse[iA] * pb[iP1-pbOffset] - + a_ase[iA] * pa[iP1] - + rb[iR-rbOffset] * a_ase[iAm1] - + ra[iR] * a_bse[iAp1]; + + rb[iR - rbOffset] * a_cse[iAm1] * pb[iP1 - pbOffset] + + ra[iR] * a_cse[iAp1] * pa[iP1] + + a_bse[iA] * pb[iP1 - pbOffset] + + a_ase[iA] * pa[iP1] + + rb[iR - rbOffset] * a_ase[iAm1] + + ra[iR] * a_bse[iAp1]; iP1 = iP - xOffsetP; rap_cw[iAc] = a_cw[iA] - + rb[iR-rbOffset] * a_cw[iAm1] * pb[iP1-pbOffset] - + ra[iR] * a_cw[iAp1] * pa[iP1] - + a_bw[iA] * pb[iP1-pbOffset] - + a_aw[iA] * pa[iP1] - + rb[iR-rbOffset] * a_aw[iAm1] - + ra[iR] * a_bw[iAp1]; + + rb[iR - rbOffset] * a_cw[iAm1] * pb[iP1 - pbOffset] + + ra[iR] * a_cw[iAp1] * pa[iP1] + + a_bw[iA] * pb[iP1 - pbOffset] + + a_aw[iA] * pa[iP1] + + rb[iR - rbOffset] * a_aw[iAm1] + + ra[iR] * a_bw[iAp1]; rap_cc[iAc] = a_cc[iA] - + rb[iR-rbOffset] * a_cc[iAm1] * pb[iP-pbOffset] - + ra[iR] * a_cc[iAp1] * pa[iP] - + rb[iR-rbOffset] * a_ac[iAm1] - + ra[iR] * a_bc[iAp1] - + a_bc[iA] * pb[iP-pbOffset] - + a_ac[iA] * pa[iP]; + + rb[iR - rbOffset] * a_cc[iAm1] * pb[iP - pbOffset] + + ra[iR] * a_cc[iAp1] * pa[iP] + + rb[iR - rbOffset] * a_ac[iAm1] + + ra[iR] * a_bc[iAp1] + + a_bc[iA] * pb[iP - pbOffset] + + a_ac[iA] * pa[iP]; } hypre_BoxLoop4End(iP, iR, iA, iAc); #undef DEVICE_VAR @@ -2450,99 +2453,99 @@ hypre_PFMG3BuildRAPSym_onebox_FSS27_CC0( HYPRE_Int iAp1 = iA + zOffsetA_diag; HYPRE_Int iP1 = iP - zOffsetP - yOffsetP - xOffsetP; - rap_bsw[iAc] = rb[iR-rbOffset] * a_csw_offdm1 * pa[iP1] - + rb[iR-rbOffset] * a_bsw_offdm1 - + a_bsw_offd * pa[iP1]; + rap_bsw[iAc] = rb[iR - rbOffset] * a_csw_offdm1 * pa[iP1] + + rb[iR - rbOffset] * a_bsw_offdm1 + + a_bsw_offd * pa[iP1]; iP1 = iP - zOffsetP - yOffsetP; - rap_bs[iAc] = rb[iR-rbOffset] * a_cs_offdm1 * pa[iP1] - + rb[iR-rbOffset] * a_bs_offdm1 - + a_bs_offd * pa[iP1]; + rap_bs[iAc] = rb[iR - rbOffset] * a_cs_offdm1 * pa[iP1] + + rb[iR - rbOffset] * a_bs_offdm1 + + a_bs_offd * pa[iP1]; iP1 = iP - zOffsetP - yOffsetP + xOffsetP; - rap_bse[iAc] = rb[iR-rbOffset] * a_cse_offdm1 * pa[iP1] - + rb[iR-rbOffset] * a_bse_offdm1 - + a_bse_offd * pa[iP1]; + rap_bse[iAc] = rb[iR - rbOffset] * a_cse_offdm1 * pa[iP1] + + rb[iR - rbOffset] * a_bse_offdm1 + + a_bse_offd * pa[iP1]; iP1 = iP - zOffsetP - xOffsetP; - rap_bw[iAc] = rb[iR-rbOffset] * a_cw_offdm1 * pa[iP1] - + rb[iR-rbOffset] * a_bw_offdm1 - + a_bw_offd * pa[iP1]; + rap_bw[iAc] = rb[iR - rbOffset] * a_cw_offdm1 * pa[iP1] + + rb[iR - rbOffset] * a_bw_offdm1 + + a_bw_offd * pa[iP1]; iP1 = iP - zOffsetP; rap_bc[iAc] = a_bc_offd * pa[iP1] - + rb[iR-rbOffset] * a_cc[iAm1] * pa[iP1] - + rb[iR-rbOffset] * a_bc_offdm1; + + rb[iR - rbOffset] * a_cc[iAm1] * pa[iP1] + + rb[iR - rbOffset] * a_bc_offdm1; iP1 = iP - zOffsetP + xOffsetP; - rap_be[iAc] = rb[iR-rbOffset] * a_ce_offdm1 * pa[iP1] - + rb[iR-rbOffset] * a_be_offdm1 - + a_be_offd * pa[iP1]; + rap_be[iAc] = rb[iR - rbOffset] * a_ce_offdm1 * pa[iP1] + + rb[iR - rbOffset] * a_be_offdm1 + + a_be_offd * pa[iP1]; iP1 = iP - zOffsetP + yOffsetP - xOffsetP; - rap_bnw[iAc] = rb[iR-rbOffset] * a_cnw_offdm1 * pa[iP1] - + rb[iR-rbOffset] * a_bnw_offdm1 - + a_bnw_offd * pa[iP1]; + rap_bnw[iAc] = rb[iR - rbOffset] * a_cnw_offdm1 * pa[iP1] + + rb[iR - rbOffset] * a_bnw_offdm1 + + a_bnw_offd * pa[iP1]; iP1 = iP - zOffsetP + yOffsetP; - rap_bn[iAc] = rb[iR-rbOffset] * a_cn_offdm1 * pa[iP1] - + rb[iR-rbOffset] * a_bn_offdm1 - + a_bn_offd * pa[iP1]; + rap_bn[iAc] = rb[iR - rbOffset] * a_cn_offdm1 * pa[iP1] + + rb[iR - rbOffset] * a_bn_offdm1 + + a_bn_offd * pa[iP1]; iP1 = iP - zOffsetP + yOffsetP + xOffsetP; - rap_bne[iAc] = rb[iR-rbOffset] * a_cne_offdm1 * pa[iP1] - + rb[iR-rbOffset] * a_bne_offdm1 - + a_bne_offd * pa[iP1]; + rap_bne[iAc] = rb[iR - rbOffset] * a_cne_offdm1 * pa[iP1] + + rb[iR - rbOffset] * a_bne_offdm1 + + a_bne_offd * pa[iP1]; iP1 = iP - yOffsetP - xOffsetP; rap_csw[iAc] = a_csw_offd - + rb[iR-rbOffset] * a_csw_offdm1 * pb[iP1-pbOffset] - + ra[iR] * a_csw_offdp1 * pa[iP1] - + a_bsw_offd * pb[iP1-pbOffset] - + a_asw_offd * pa[iP1] - + rb[iR-rbOffset] * a_asw_offdm1 - + ra[iR] * a_bsw_offdp1; + + rb[iR - rbOffset] * a_csw_offdm1 * pb[iP1 - pbOffset] + + ra[iR] * a_csw_offdp1 * pa[iP1] + + a_bsw_offd * pb[iP1 - pbOffset] + + a_asw_offd * pa[iP1] + + rb[iR - rbOffset] * a_asw_offdm1 + + ra[iR] * a_bsw_offdp1; iP1 = iP - yOffsetP; rap_cs[iAc] = a_cs_offd - + rb[iR-rbOffset] * a_cs_offdm1 * pb[iP1-pbOffset] - + ra[iR] * a_cs_offdp1 * pa[iP1] - + a_bs_offd * pb[iP1-pbOffset] - + a_as_offd * pa[iP1] - + rb[iR-rbOffset] * a_as_offdm1 - + ra[iR] * a_bs_offdp1; + + rb[iR - rbOffset] * a_cs_offdm1 * pb[iP1 - pbOffset] + + ra[iR] * a_cs_offdp1 * pa[iP1] + + a_bs_offd * pb[iP1 - pbOffset] + + a_as_offd * pa[iP1] + + rb[iR - rbOffset] * a_as_offdm1 + + ra[iR] * a_bs_offdp1; iP1 = iP - yOffsetP + xOffsetP; rap_cse[iAc] = a_cse_offd - + rb[iR-rbOffset] * a_cse_offdm1 * pb[iP1-pbOffset] - + ra[iR] * a_cse_offdp1 * pa[iP1] - + a_bse_offd * pb[iP1-pbOffset] - + a_ase_offd * pa[iP1] - + rb[iR-rbOffset] * a_ase_offdm1 - + ra[iR] * a_bse_offdp1; + + rb[iR - rbOffset] * a_cse_offdm1 * pb[iP1 - pbOffset] + + ra[iR] * a_cse_offdp1 * pa[iP1] + + a_bse_offd * pb[iP1 - pbOffset] + + a_ase_offd * pa[iP1] + + rb[iR - rbOffset] * a_ase_offdm1 + + ra[iR] * a_bse_offdp1; iP1 = iP - xOffsetP; rap_cw[iAc] = a_cw_offd - + rb[iR-rbOffset] * a_cw_offdm1 * pb[iP1-pbOffset] - + ra[iR] * a_cw_offdp1 * pa[iP1] - + a_bw_offd * pb[iP1-pbOffset] - + a_aw_offd * pa[iP1] - + rb[iR-rbOffset] * a_aw_offdm1 - + ra[iR] * a_bw_offdp1; + + rb[iR - rbOffset] * a_cw_offdm1 * pb[iP1 - pbOffset] + + ra[iR] * a_cw_offdp1 * pa[iP1] + + a_bw_offd * pb[iP1 - pbOffset] + + a_aw_offd * pa[iP1] + + rb[iR - rbOffset] * a_aw_offdm1 + + ra[iR] * a_bw_offdp1; rap_cc[iAc] = a_cc[iA] - + rb[iR-rbOffset] * a_cc[iAm1] * pb[iP-pbOffset] - + ra[iR] * a_cc[iAp1] * pa[iP] - + rb[iR-rbOffset] * a_ac_offdm1 - + ra[iR] * a_bc_offdp1 - + a_bc_offd * pb[iP-pbOffset] - + a_ac_offd * pa[iP]; + + rb[iR - rbOffset] * a_cc[iAm1] * pb[iP - pbOffset] + + ra[iR] * a_cc[iAp1] * pa[iP] + + rb[iR - rbOffset] * a_ac_offdm1 + + ra[iR] * a_bc_offdp1 + + a_bc_offd * pb[iP - pbOffset] + + a_ac_offd * pa[iP]; } hypre_BoxLoop4End(iP, iR, iA, iAc); #undef DEVICE_VAR } -/* }*/ /* end ForBoxI */ + /* }*/ /* end ForBoxI */ return hypre_error_flag; } @@ -2608,11 +2611,11 @@ hypre_PFMG3BuildRAPSym_onebox_FSS27_CC1( * pb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,-1); + hypre_SetIndex3(index_temp, 0, 0, -1); MapIndex(index_temp, cdir, index); pa = hypre_StructMatrixExtractPointerByIndex(P, fi, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); pb = hypre_StructMatrixExtractPointerByIndex(P, fi, index); @@ -2623,11 +2626,11 @@ hypre_PFMG3BuildRAPSym_onebox_FSS27_CC1( * rb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,-1); + hypre_SetIndex3(index_temp, 0, 0, -1); MapIndex(index_temp, cdir, index); ra = hypre_StructMatrixExtractPointerByIndex(R, fi, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); rb = hypre_StructMatrixExtractPointerByIndex(R, fi, index); @@ -2644,31 +2647,31 @@ hypre_PFMG3BuildRAPSym_onebox_FSS27_CC1( * a_bc is pointer for center coefficient in plane below *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,0); + hypre_SetIndex3(index_temp, 0, 0, 0); MapIndex(index_temp, cdir, index); a_cc = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,0,0); + hypre_SetIndex3(index_temp, -1, 0, 0); MapIndex(index_temp, cdir, index); a_cw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); a_ce = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); a_cs = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); a_cn = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); a_ac = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,0,-1); + hypre_SetIndex3(index_temp, 0, 0, -1); MapIndex(index_temp, cdir, index); a_bc = hypre_StructMatrixExtractPointerByIndex(A, fi, index); @@ -2689,43 +2692,43 @@ hypre_PFMG3BuildRAPSym_onebox_FSS27_CC1( * a_cne is pointer for northeast coefficient in same plane *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,-1,0,1); + hypre_SetIndex3(index_temp, -1, 0, 1); MapIndex(index_temp, cdir, index); a_aw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,-1,1); + hypre_SetIndex3(index_temp, 0, -1, 1); MapIndex(index_temp, cdir, index); a_as = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,0,-1); + hypre_SetIndex3(index_temp, -1, 0, -1); MapIndex(index_temp, cdir, index); a_bw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,0,-1); + hypre_SetIndex3(index_temp, 1, 0, -1); MapIndex(index_temp, cdir, index); a_be = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,-1,-1); + hypre_SetIndex3(index_temp, 0, -1, -1); MapIndex(index_temp, cdir, index); a_bs = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,1,-1); + hypre_SetIndex3(index_temp, 0, 1, -1); MapIndex(index_temp, cdir, index); a_bn = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,-1,0); + hypre_SetIndex3(index_temp, -1, -1, 0); MapIndex(index_temp, cdir, index); a_csw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,-1,0); + hypre_SetIndex3(index_temp, 1, -1, 0); MapIndex(index_temp, cdir, index); a_cse = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,1,0); + hypre_SetIndex3(index_temp, -1, 1, 0); MapIndex(index_temp, cdir, index); a_cnw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,1,0); + hypre_SetIndex3(index_temp, 1, 1, 0); MapIndex(index_temp, cdir, index); a_cne = hypre_StructMatrixExtractPointerByIndex(A, fi, index); @@ -2742,27 +2745,27 @@ hypre_PFMG3BuildRAPSym_onebox_FSS27_CC1( * a_bne is pointer for northeast coefficient in plane below *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,-1,-1,1); + hypre_SetIndex3(index_temp, -1, -1, 1); MapIndex(index_temp, cdir, index); a_asw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,-1,1); + hypre_SetIndex3(index_temp, 1, -1, 1); MapIndex(index_temp, cdir, index); a_ase = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,-1,-1); + hypre_SetIndex3(index_temp, -1, -1, -1); MapIndex(index_temp, cdir, index); a_bsw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,-1,-1); + hypre_SetIndex3(index_temp, 1, -1, -1); MapIndex(index_temp, cdir, index); a_bse = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,1,-1); + hypre_SetIndex3(index_temp, -1, 1, -1); MapIndex(index_temp, cdir, index); a_bnw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,1,-1); + hypre_SetIndex3(index_temp, 1, 1, -1); MapIndex(index_temp, cdir, index); a_bne = hypre_StructMatrixExtractPointerByIndex(A, fi, index); @@ -2774,43 +2777,43 @@ hypre_PFMG3BuildRAPSym_onebox_FSS27_CC1( * rap_cc is pointer for center coefficient (etc.) *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,0); + hypre_SetIndex3(index_temp, 0, 0, 0); MapIndex(index_temp, cdir, index); rap_cc = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,0,0); + hypre_SetIndex3(index_temp, -1, 0, 0); MapIndex(index_temp, cdir, index); rap_cw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); rap_cs = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,0,-1); + hypre_SetIndex3(index_temp, 0, 0, -1); MapIndex(index_temp, cdir, index); rap_bc = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,0,-1); + hypre_SetIndex3(index_temp, -1, 0, -1); MapIndex(index_temp, cdir, index); rap_bw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,0,-1); + hypre_SetIndex3(index_temp, 1, 0, -1); MapIndex(index_temp, cdir, index); rap_be = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,-1,-1); + hypre_SetIndex3(index_temp, 0, -1, -1); MapIndex(index_temp, cdir, index); rap_bs = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,1,-1); + hypre_SetIndex3(index_temp, 0, 1, -1); MapIndex(index_temp, cdir, index); rap_bn = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,-1,0); + hypre_SetIndex3(index_temp, -1, -1, 0); MapIndex(index_temp, cdir, index); rap_csw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,-1,0); + hypre_SetIndex3(index_temp, 1, -1, 0); MapIndex(index_temp, cdir, index); rap_cse = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); @@ -2825,19 +2828,19 @@ hypre_PFMG3BuildRAPSym_onebox_FSS27_CC1( * rap_csw is pointer for southwest coefficient in same plane (etc.) *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,-1,-1,-1); + hypre_SetIndex3(index_temp, -1, -1, -1); MapIndex(index_temp, cdir, index); rap_bsw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,-1,-1); + hypre_SetIndex3(index_temp, 1, -1, -1); MapIndex(index_temp, cdir, index); rap_bse = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,1,-1); + hypre_SetIndex3(index_temp, -1, 1, -1); MapIndex(index_temp, cdir, index); rap_bnw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,1,-1); + hypre_SetIndex3(index_temp, 1, 1, -1); MapIndex(index_temp, cdir, index); rap_bne = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); @@ -2849,18 +2852,18 @@ hypre_PFMG3BuildRAPSym_onebox_FSS27_CC1( * Offsets are used in refering to data associated with other points. *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); zOffsetA = 0; zOffsetP = 0; - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); yOffsetP = 0; - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); xOffsetP = 0; @@ -2889,94 +2892,94 @@ hypre_PFMG3BuildRAPSym_onebox_FSS27_CC1( iP1 = iP - zOffsetP - yOffsetP - xOffsetP; rap_bsw[iAc] = rb[iR] * a_csw[iAm1] * pa[iP1] - + rb[iR] * a_bsw[iAm1] - + a_bsw[iA] * pa[iP1]; + + rb[iR] * a_bsw[iAm1] + + a_bsw[iA] * pa[iP1]; iP1 = iP - zOffsetP - yOffsetP; rap_bs[iAc] = rb[iR] * a_cs[iAm1] * pa[iP1] - + rb[iR] * a_bs[iAm1] - + a_bs[iA] * pa[iP1]; + + rb[iR] * a_bs[iAm1] + + a_bs[iA] * pa[iP1]; iP1 = iP - zOffsetP - yOffsetP + xOffsetP; rap_bse[iAc] = rb[iR] * a_cse[iAm1] * pa[iP1] - + rb[iR] * a_bse[iAm1] - + a_bse[iA] * pa[iP1]; + + rb[iR] * a_bse[iAm1] + + a_bse[iA] * pa[iP1]; iP1 = iP - zOffsetP - xOffsetP; rap_bw[iAc] = rb[iR] * a_cw[iAm1] * pa[iP1] - + rb[iR] * a_bw[iAm1] - + a_bw[iA] * pa[iP1]; + + rb[iR] * a_bw[iAm1] + + a_bw[iA] * pa[iP1]; iP1 = iP - zOffsetP; rap_bc[iAc] = a_bc[iA] * pa[iP1] - + rb[iR] * a_cc[iAm1] * pa[iP1] - + rb[iR] * a_bc[iAm1]; + + rb[iR] * a_cc[iAm1] * pa[iP1] + + rb[iR] * a_bc[iAm1]; iP1 = iP - zOffsetP + xOffsetP; rap_be[iAc] = rb[iR] * a_ce[iAm1] * pa[iP1] - + rb[iR] * a_be[iAm1] - + a_be[iA] * pa[iP1]; + + rb[iR] * a_be[iAm1] + + a_be[iA] * pa[iP1]; iP1 = iP - zOffsetP + yOffsetP - xOffsetP; rap_bnw[iAc] = rb[iR] * a_cnw[iAm1] * pa[iP1] - + rb[iR] * a_bnw[iAm1] - + a_bnw[iA] * pa[iP1]; + + rb[iR] * a_bnw[iAm1] + + a_bnw[iA] * pa[iP1]; iP1 = iP - zOffsetP + yOffsetP; rap_bn[iAc] = rb[iR] * a_cn[iAm1] * pa[iP1] - + rb[iR] * a_bn[iAm1] - + a_bn[iA] * pa[iP1]; + + rb[iR] * a_bn[iAm1] + + a_bn[iA] * pa[iP1]; iP1 = iP - zOffsetP + yOffsetP + xOffsetP; rap_bne[iAc] = rb[iR] * a_cne[iAm1] * pa[iP1] - + rb[iR] * a_bne[iAm1] - + a_bne[iA] * pa[iP1]; + + rb[iR] * a_bne[iAm1] + + a_bne[iA] * pa[iP1]; iP1 = iP - yOffsetP - xOffsetP; rap_csw[iAc] = a_csw[iA] - + rb[iR] * a_csw[iAm1] * pb[iP1] - + ra[iR] * a_csw[iAp1] * pa[iP1] - + a_bsw[iA] * pb[iP1] - + a_asw[iA] * pa[iP1] - + rb[iR] * a_asw[iAm1] - + ra[iR] * a_bsw[iAp1]; + + rb[iR] * a_csw[iAm1] * pb[iP1] + + ra[iR] * a_csw[iAp1] * pa[iP1] + + a_bsw[iA] * pb[iP1] + + a_asw[iA] * pa[iP1] + + rb[iR] * a_asw[iAm1] + + ra[iR] * a_bsw[iAp1]; iP1 = iP - yOffsetP; rap_cs[iAc] = a_cs[iA] - + rb[iR] * a_cs[iAm1] * pb[iP1] - + ra[iR] * a_cs[iAp1] * pa[iP1] - + a_bs[iA] * pb[iP1] - + a_as[iA] * pa[iP1] - + rb[iR] * a_as[iAm1] - + ra[iR] * a_bs[iAp1]; + + rb[iR] * a_cs[iAm1] * pb[iP1] + + ra[iR] * a_cs[iAp1] * pa[iP1] + + a_bs[iA] * pb[iP1] + + a_as[iA] * pa[iP1] + + rb[iR] * a_as[iAm1] + + ra[iR] * a_bs[iAp1]; iP1 = iP - yOffsetP + xOffsetP; rap_cse[iAc] = a_cse[iA] - + rb[iR] * a_cse[iAm1] * pb[iP1] - + ra[iR] * a_cse[iAp1] * pa[iP1] - + a_bse[iA] * pb[iP1] - + a_ase[iA] * pa[iP1] - + rb[iR] * a_ase[iAm1] - + ra[iR] * a_bse[iAp1]; + + rb[iR] * a_cse[iAm1] * pb[iP1] + + ra[iR] * a_cse[iAp1] * pa[iP1] + + a_bse[iA] * pb[iP1] + + a_ase[iA] * pa[iP1] + + rb[iR] * a_ase[iAm1] + + ra[iR] * a_bse[iAp1]; iP1 = iP - xOffsetP; rap_cw[iAc] = a_cw[iA] - + rb[iR] * a_cw[iAm1] * pb[iP1] - + ra[iR] * a_cw[iAp1] * pa[iP1] - + a_bw[iA] * pb[iP1] - + a_aw[iA] * pa[iP1] - + rb[iR] * a_aw[iAm1] - + ra[iR] * a_bw[iAp1]; + + rb[iR] * a_cw[iAm1] * pb[iP1] + + ra[iR] * a_cw[iAp1] * pa[iP1] + + a_bw[iA] * pb[iP1] + + a_aw[iA] * pa[iP1] + + rb[iR] * a_aw[iAm1] + + ra[iR] * a_bw[iAp1]; rap_cc[iAc] = a_cc[iA] - + rb[iR] * a_cc[iAm1] * pb[iP] - + ra[iR] * a_cc[iAp1] * pa[iP] - + rb[iR] * a_ac[iAm1] - + ra[iR] * a_bc[iAp1] - + a_bc[iA] * pb[iP] - + a_ac[iA] * pa[iP]; + + rb[iR] * a_cc[iAm1] * pb[iP] + + ra[iR] * a_cc[iAp1] * pa[iP] + + rb[iR] * a_ac[iAm1] + + ra[iR] * a_bc[iAp1] + + a_bc[iA] * pb[iP] + + a_ac[iA] * pa[iP]; -/* }*/ /* end ForBoxI */ + /* }*/ /* end ForBoxI */ return hypre_error_flag; } @@ -3017,16 +3020,16 @@ hypre_PFMG3BuildRAPNoSym( hypre_StructMatrix *A, constant_coefficient = hypre_StructMatrixConstantCoefficient(RAP); constant_coefficient_A = hypre_StructMatrixConstantCoefficient(A); - hypre_assert( constant_coefficient==0 || constant_coefficient==1 ); + hypre_assert( constant_coefficient == 0 || constant_coefficient == 1 ); hypre_assert( hypre_StructMatrixConstantCoefficient(R) == constant_coefficient ); hypre_assert( hypre_StructMatrixConstantCoefficient(P) == constant_coefficient ); - if (constant_coefficient==1 ) + if (constant_coefficient == 1 ) { - hypre_assert( constant_coefficient_A==1 ); + hypre_assert( constant_coefficient_A == 1 ); } else { - hypre_assert( constant_coefficient_A==0 || constant_coefficient_A==2 ); + hypre_assert( constant_coefficient_A == 0 || constant_coefficient_A == 2 ); } fi = 0; @@ -3062,14 +3065,14 @@ hypre_PFMG3BuildRAPNoSym( hypre_StructMatrix *A, break; - /*-------------------------------------------------------------- - * Loop for 19-point fine grid operator; produces upper triangular - * part of 27-point coarse grid operator. stencil entries: - * (above-northeast, above-north, above-northwest, above-east, - * above-center, above-west, above-southeast, above-south, - * above-southwest, center-northeast, center-north, - * center-northwest, and center-east). - *--------------------------------------------------------------*/ + /*-------------------------------------------------------------- + * Loop for 19-point fine grid operator; produces upper triangular + * part of 27-point coarse grid operator. stencil entries: + * (above-northeast, above-north, above-northwest, above-east, + * above-center, above-west, above-southeast, above-south, + * above-southwest, center-northeast, center-north, + * center-northwest, and center-east). + *--------------------------------------------------------------*/ case 19: @@ -3086,14 +3089,14 @@ hypre_PFMG3BuildRAPNoSym( hypre_StructMatrix *A, break; - /*-------------------------------------------------------------- - * Loop for 27-point fine grid operator; produces upper triangular - * part of 27-point coarse grid operator. stencil entries: - * (above-northeast, above-north, above-northwest, above-east, - * above-center, above-west, above-southeast, above-south, - * above-southwest, center-northeast, center-north, - * center-northwest, and center-east). - *--------------------------------------------------------------*/ + /*-------------------------------------------------------------- + * Loop for 27-point fine grid operator; produces upper triangular + * part of 27-point coarse grid operator. stencil entries: + * (above-northeast, above-north, above-northwest, above-east, + * above-center, above-west, above-southeast, above-south, + * above-southwest, center-northeast, center-north, + * center-northwest, and center-east). + *--------------------------------------------------------------*/ default: @@ -3202,11 +3205,11 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS07_CC0( * pb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,-1); + hypre_SetIndex3(index_temp, 0, 0, -1); MapIndex(index_temp, cdir, index); pa = hypre_StructMatrixExtractPointerByIndex(P, fi, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); pb = hypre_StructMatrixExtractPointerByIndex(P, fi, index); @@ -3219,11 +3222,11 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS07_CC0( * rb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,-1); + hypre_SetIndex3(index_temp, 0, 0, -1); MapIndex(index_temp, cdir, index); ra = hypre_StructMatrixExtractPointerByIndex(R, fi, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); rb = hypre_StructMatrixExtractPointerByIndex(R, fi, index); @@ -3242,27 +3245,27 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS07_CC0( * a_bc is pointer for center coefficient in plane below *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,0); + hypre_SetIndex3(index_temp, 0, 0, 0); MapIndex(index_temp, cdir, index); a_cc = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,0,0); + hypre_SetIndex3(index_temp, -1, 0, 0); MapIndex(index_temp, cdir, index); a_cw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); a_ce = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); a_cs = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); a_cn = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); a_ac = hypre_StructMatrixExtractPointerByIndex(A, fi, index); @@ -3274,39 +3277,39 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS07_CC0( * rap_ce is pointer for east coefficient in same plane (etc.) *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); rap_ce = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); rap_cn = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); rap_ac = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,0,1); + hypre_SetIndex3(index_temp, -1, 0, 1); MapIndex(index_temp, cdir, index); rap_aw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,0,1); + hypre_SetIndex3(index_temp, 1, 0, 1); MapIndex(index_temp, cdir, index); rap_ae = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,-1,1); + hypre_SetIndex3(index_temp, 0, -1, 1); MapIndex(index_temp, cdir, index); rap_as = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,1,1); + hypre_SetIndex3(index_temp, 0, 1, 1); MapIndex(index_temp, cdir, index); rap_an = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,1,0); + hypre_SetIndex3(index_temp, -1, 1, 0); MapIndex(index_temp, cdir, index); rap_cnw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,1,0); + hypre_SetIndex3(index_temp, 1, 1, 0); MapIndex(index_temp, cdir, index); rap_cne = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); @@ -3318,29 +3321,29 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS07_CC0( * Offsets are used in refering to data associated with other points. *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); - zOffsetP = hypre_BoxOffsetDistance(P_dbox,index); + zOffsetP = hypre_BoxOffsetDistance(P_dbox, index); if ( constant_coefficient_A == 0 ) { - zOffsetA = hypre_BoxOffsetDistance(A_dbox,index); + zOffsetA = hypre_BoxOffsetDistance(A_dbox, index); } else { - zOffsetA_diag = hypre_BoxOffsetDistance(A_dbox,index); + zOffsetA_diag = hypre_BoxOffsetDistance(A_dbox, index); zOffsetA_offd = 0; } - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); - yOffsetP = hypre_BoxOffsetDistance(P_dbox,index); + yOffsetP = hypre_BoxOffsetDistance(P_dbox, index); - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); - xOffsetP = hypre_BoxOffsetDistance(P_dbox,index); + xOffsetP = hypre_BoxOffsetDistance(P_dbox, index); /*----------------------------------------------------------------- * Switch statement to direct control to apropriate BoxLoop depending @@ -3369,31 +3372,31 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS07_CC0( HYPRE_Int iAp1 = iA + zOffsetA; HYPRE_Int iP1 = iP + zOffsetP + yOffsetP; - rap_an[iAc] = ra[iR] * a_cn[iAp1] * pb[iP1-pbOffset]; + rap_an[iAc] = ra[iR] * a_cn[iAp1] * pb[iP1 - pbOffset]; iP1 = iP + zOffsetP + xOffsetP; - rap_ae[iAc] = ra[iR] * a_ce[iAp1] * pb[iP1-pbOffset]; + rap_ae[iAc] = ra[iR] * a_ce[iAp1] * pb[iP1 - pbOffset]; iP1 = iP + zOffsetP; - rap_ac[iAc] = a_ac[iA] * pb[iP1-pbOffset] - + ra[iR] * a_cc[iAp1] * pb[iP1-pbOffset] - + ra[iR] * a_ac[iAp1]; + rap_ac[iAc] = a_ac[iA] * pb[iP1 - pbOffset] + + ra[iR] * a_cc[iAp1] * pb[iP1 - pbOffset] + + ra[iR] * a_ac[iAp1]; iP1 = iP + zOffsetP - xOffsetP; - rap_aw[iAc] = ra[iR] * a_cw[iAp1] * pb[iP1-pbOffset]; + rap_aw[iAc] = ra[iR] * a_cw[iAp1] * pb[iP1 - pbOffset]; iP1 = iP + zOffsetP - yOffsetP; - rap_as[iAc] = ra[iR] * a_cs[iAp1] * pb[iP1-pbOffset]; + rap_as[iAc] = ra[iR] * a_cs[iAp1] * pb[iP1 - pbOffset]; iP1 = iP + yOffsetP; rap_cn[iAc] = a_cn[iA] - + rb[iR-rbOffset] * a_cn[iAm1] * pb[iP1-pbOffset] - + ra[iR] * a_cn[iAp1] * pa[iP1]; + + rb[iR - rbOffset] * a_cn[iAm1] * pb[iP1 - pbOffset] + + ra[iR] * a_cn[iAp1] * pa[iP1]; iP1 = iP + xOffsetP; rap_ce[iAc] = a_ce[iA] - + rb[iR-rbOffset] * a_ce[iAm1] * pb[iP1-pbOffset] - + ra[iR] * a_ce[iAp1] * pa[iP1]; + + rb[iR - rbOffset] * a_ce[iAm1] * pb[iP1 - pbOffset] + + ra[iR] * a_ce[iAp1] * pa[iP1]; rap_cnw[iAc] = 0.0; @@ -3429,31 +3432,31 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS07_CC0( HYPRE_Int iAp1 = iA + zOffsetA_diag; HYPRE_Int iP1 = iP + zOffsetP + yOffsetP; - rap_an[iAc] = ra[iR] * a_cn_offdp1 * pb[iP1-pbOffset]; + rap_an[iAc] = ra[iR] * a_cn_offdp1 * pb[iP1 - pbOffset]; iP1 = iP + zOffsetP + xOffsetP; - rap_ae[iAc] = ra[iR] * a_ce_offdp1 * pb[iP1-pbOffset]; + rap_ae[iAc] = ra[iR] * a_ce_offdp1 * pb[iP1 - pbOffset]; iP1 = iP + zOffsetP; - rap_ac[iAc] = a_ac_offd * pb[iP1-pbOffset] - + ra[iR] * a_cc[iAp1] * pb[iP1-pbOffset] - + ra[iR] * a_ac_offdp1; + rap_ac[iAc] = a_ac_offd * pb[iP1 - pbOffset] + + ra[iR] * a_cc[iAp1] * pb[iP1 - pbOffset] + + ra[iR] * a_ac_offdp1; iP1 = iP + zOffsetP - xOffsetP; - rap_aw[iAc] = ra[iR] * a_cw_offdp1 * pb[iP1-pbOffset]; + rap_aw[iAc] = ra[iR] * a_cw_offdp1 * pb[iP1 - pbOffset]; iP1 = iP + zOffsetP - yOffsetP; - rap_as[iAc] = ra[iR] * a_cs_offdp1 * pb[iP1-pbOffset]; + rap_as[iAc] = ra[iR] * a_cs_offdp1 * pb[iP1 - pbOffset]; iP1 = iP + yOffsetP; rap_cn[iAc] = a_cn_offd - + rb[iR-rbOffset] * a_cn_offdm1 * pb[iP1-pbOffset] - + ra[iR] * a_cn_offdp1 * pa[iP1]; + + rb[iR - rbOffset] * a_cn_offdm1 * pb[iP1 - pbOffset] + + ra[iR] * a_cn_offdp1 * pa[iP1]; iP1 = iP + xOffsetP; rap_ce[iAc] = a_ce_offd - + rb[iR-rbOffset] * a_ce_offdm1 * pb[iP1-pbOffset] - + ra[iR] * a_ce_offdp1 * pa[iP1]; + + rb[iR - rbOffset] * a_ce_offdm1 * pb[iP1 - pbOffset] + + ra[iR] * a_ce_offdp1 * pa[iP1]; rap_cnw[iAc] = 0.0; @@ -3463,7 +3466,7 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS07_CC0( #undef DEVICE_VAR } -/* }*/ /* end ForBoxI */ + /* }*/ /* end ForBoxI */ return hypre_error_flag; } @@ -3523,11 +3526,11 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS07_CC1( * pb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,-1); + hypre_SetIndex3(index_temp, 0, 0, -1); MapIndex(index_temp, cdir, index); pa = hypre_StructMatrixExtractPointerByIndex(P, fi, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); pb = hypre_StructMatrixExtractPointerByIndex(P, fi, index); @@ -3538,11 +3541,11 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS07_CC1( * rb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,-1); + hypre_SetIndex3(index_temp, 0, 0, -1); MapIndex(index_temp, cdir, index); ra = hypre_StructMatrixExtractPointerByIndex(R, fi, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); rb = hypre_StructMatrixExtractPointerByIndex(R, fi, index); @@ -3559,27 +3562,27 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS07_CC1( * a_bc is pointer for center coefficient in plane below *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,0); + hypre_SetIndex3(index_temp, 0, 0, 0); MapIndex(index_temp, cdir, index); a_cc = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,0,0); + hypre_SetIndex3(index_temp, -1, 0, 0); MapIndex(index_temp, cdir, index); a_cw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); a_ce = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); a_cs = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); a_cn = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); a_ac = hypre_StructMatrixExtractPointerByIndex(A, fi, index); @@ -3591,39 +3594,39 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS07_CC1( * rap_ce is pointer for east coefficient in same plane (etc.) *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); rap_ce = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); rap_cn = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); rap_ac = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,0,1); + hypre_SetIndex3(index_temp, -1, 0, 1); MapIndex(index_temp, cdir, index); rap_aw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,0,1); + hypre_SetIndex3(index_temp, 1, 0, 1); MapIndex(index_temp, cdir, index); rap_ae = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,-1,1); + hypre_SetIndex3(index_temp, 0, -1, 1); MapIndex(index_temp, cdir, index); rap_as = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,1,1); + hypre_SetIndex3(index_temp, 0, 1, 1); MapIndex(index_temp, cdir, index); rap_an = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,1,0); + hypre_SetIndex3(index_temp, -1, 1, 0); MapIndex(index_temp, cdir, index); rap_cnw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,1,0); + hypre_SetIndex3(index_temp, 1, 1, 0); MapIndex(index_temp, cdir, index); rap_cne = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); @@ -3635,18 +3638,18 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS07_CC1( * Offsets are used in refering to data associated with other points. *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); zOffsetA = 0; zOffsetP = 0; - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); yOffsetP = 0; - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); xOffsetP = 0; @@ -3679,8 +3682,8 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS07_CC1( iP1 = iP + zOffsetP; rap_ac[iAc] = a_ac[iA] * pb[iP1] - + ra[iR] * a_cc[iAp1] * pb[iP1] - + ra[iR] * a_ac[iAp1]; + + ra[iR] * a_cc[iAp1] * pb[iP1] + + ra[iR] * a_ac[iAp1]; iP1 = iP + zOffsetP - xOffsetP; rap_aw[iAc] = ra[iR] * a_cw[iAp1] * pb[iP1]; @@ -3690,19 +3693,19 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS07_CC1( iP1 = iP + yOffsetP; rap_cn[iAc] = a_cn[iA] - + rb[iR] * a_cn[iAm1] * pb[iP1] - + ra[iR] * a_cn[iAp1] * pa[iP1]; + + rb[iR] * a_cn[iAm1] * pb[iP1] + + ra[iR] * a_cn[iAp1] * pa[iP1]; iP1 = iP + xOffsetP; rap_ce[iAc] = a_ce[iA] - + rb[iR] * a_ce[iAm1] * pb[iP1] - + ra[iR] * a_ce[iAp1] * pa[iP1]; + + rb[iR] * a_ce[iAm1] * pb[iP1] + + ra[iR] * a_ce[iAp1] * pa[iP1]; rap_cnw[iAc] = 0.0; rap_cne[iAc] = 0.0; -/* }*/ /* end ForBoxI */ + /* }*/ /* end ForBoxI */ return hypre_error_flag; } @@ -3803,11 +3806,11 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS19_CC0( * pb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,-1); + hypre_SetIndex3(index_temp, 0, 0, -1); MapIndex(index_temp, cdir, index); pa = hypre_StructMatrixExtractPointerByIndex(P, fi, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); pb = hypre_StructMatrixExtractPointerByIndex(P, fi, index); @@ -3820,11 +3823,11 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS19_CC0( * rb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,-1); + hypre_SetIndex3(index_temp, 0, 0, -1); MapIndex(index_temp, cdir, index); ra = hypre_StructMatrixExtractPointerByIndex(R, fi, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); rb = hypre_StructMatrixExtractPointerByIndex(R, fi, index); @@ -3843,27 +3846,27 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS19_CC0( * a_bc is pointer for center coefficient in plane below *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,0); + hypre_SetIndex3(index_temp, 0, 0, 0); MapIndex(index_temp, cdir, index); a_cc = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,0,0); + hypre_SetIndex3(index_temp, -1, 0, 0); MapIndex(index_temp, cdir, index); a_cw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); a_ce = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); a_cs = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); a_cn = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); a_ac = hypre_StructMatrixExtractPointerByIndex(A, fi, index); @@ -3884,43 +3887,43 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS19_CC0( * a_cne is pointer for northeast coefficient in same plane *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,-1,0,1); + hypre_SetIndex3(index_temp, -1, 0, 1); MapIndex(index_temp, cdir, index); a_aw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,0,1); + hypre_SetIndex3(index_temp, 1, 0, 1); MapIndex(index_temp, cdir, index); a_ae = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,-1,1); + hypre_SetIndex3(index_temp, 0, -1, 1); MapIndex(index_temp, cdir, index); a_as = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,1,1); + hypre_SetIndex3(index_temp, 0, 1, 1); MapIndex(index_temp, cdir, index); a_an = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,0,-1); + hypre_SetIndex3(index_temp, 1, 0, -1); MapIndex(index_temp, cdir, index); a_be = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,1,-1); + hypre_SetIndex3(index_temp, 0, 1, -1); MapIndex(index_temp, cdir, index); a_bn = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,-1,0); + hypre_SetIndex3(index_temp, -1, -1, 0); MapIndex(index_temp, cdir, index); a_csw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,-1,0); + hypre_SetIndex3(index_temp, 1, -1, 0); MapIndex(index_temp, cdir, index); a_cse = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,1,0); + hypre_SetIndex3(index_temp, -1, 1, 0); MapIndex(index_temp, cdir, index); a_cnw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,1,0); + hypre_SetIndex3(index_temp, 1, 1, 0); MapIndex(index_temp, cdir, index); a_cne = hypre_StructMatrixExtractPointerByIndex(A, fi, index); @@ -3932,39 +3935,39 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS19_CC0( * rap_ce is pointer for east coefficient in same plane (etc.) *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); rap_ce = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); rap_cn = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); rap_ac = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,0,1); + hypre_SetIndex3(index_temp, -1, 0, 1); MapIndex(index_temp, cdir, index); rap_aw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,0,1); + hypre_SetIndex3(index_temp, 1, 0, 1); MapIndex(index_temp, cdir, index); rap_ae = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,-1,1); + hypre_SetIndex3(index_temp, 0, -1, 1); MapIndex(index_temp, cdir, index); rap_as = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,1,1); + hypre_SetIndex3(index_temp, 0, 1, 1); MapIndex(index_temp, cdir, index); rap_an = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,1,0); + hypre_SetIndex3(index_temp, -1, 1, 0); MapIndex(index_temp, cdir, index); rap_cnw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,1,0); + hypre_SetIndex3(index_temp, 1, 1, 0); MapIndex(index_temp, cdir, index); rap_cne = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); @@ -3979,19 +3982,19 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS19_CC0( * rap_cnw is pointer for northwest coefficient in same plane (etc.) *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,-1,-1,1); + hypre_SetIndex3(index_temp, -1, -1, 1); MapIndex(index_temp, cdir, index); rap_asw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,-1,1); + hypre_SetIndex3(index_temp, 1, -1, 1); MapIndex(index_temp, cdir, index); rap_ase = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,1,1); + hypre_SetIndex3(index_temp, -1, 1, 1); MapIndex(index_temp, cdir, index); rap_anw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,1,1); + hypre_SetIndex3(index_temp, 1, 1, 1); MapIndex(index_temp, cdir, index); rap_ane = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); @@ -4003,29 +4006,29 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS19_CC0( * Offsets are used in refering to data associated with other points. *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); - zOffsetP = hypre_BoxOffsetDistance(P_dbox,index); + zOffsetP = hypre_BoxOffsetDistance(P_dbox, index); if ( constant_coefficient_A == 0 ) { - zOffsetA = hypre_BoxOffsetDistance(A_dbox,index); + zOffsetA = hypre_BoxOffsetDistance(A_dbox, index); } else { - zOffsetA_diag = hypre_BoxOffsetDistance(A_dbox,index); + zOffsetA_diag = hypre_BoxOffsetDistance(A_dbox, index); zOffsetA_offd = 0; } - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); - yOffsetP = hypre_BoxOffsetDistance(P_dbox,index); + yOffsetP = hypre_BoxOffsetDistance(P_dbox, index); - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); - xOffsetP = hypre_BoxOffsetDistance(P_dbox,index); + xOffsetP = hypre_BoxOffsetDistance(P_dbox, index); /*----------------------------------------------------------------- * Switch statement to direct control to apropriate BoxLoop depending @@ -4056,69 +4059,69 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS19_CC0( HYPRE_Int iAp1 = iA + zOffsetA; HYPRE_Int iP1 = iP + zOffsetP + yOffsetP + xOffsetP; - rap_ane[iAc] = ra[iR] * a_cne[iAp1] * pb[iP1-pbOffset]; + rap_ane[iAc] = ra[iR] * a_cne[iAp1] * pb[iP1 - pbOffset]; iP1 = iP + zOffsetP + yOffsetP; - rap_an[iAc] = ra[iR] * a_cn[iAp1] * pb[iP1-pbOffset] - + ra[iR] * a_an[iAp1] - + a_an[iA] * pb[iP1-pbOffset]; + rap_an[iAc] = ra[iR] * a_cn[iAp1] * pb[iP1 - pbOffset] + + ra[iR] * a_an[iAp1] + + a_an[iA] * pb[iP1 - pbOffset]; iP1 = iP + zOffsetP + yOffsetP - xOffsetP; - rap_anw[iAc] = ra[iR] * a_cnw[iAp1] * pb[iP1-pbOffset]; + rap_anw[iAc] = ra[iR] * a_cnw[iAp1] * pb[iP1 - pbOffset]; iP1 = iP + zOffsetP + xOffsetP; - rap_ae[iAc] = ra[iR] * a_ce[iAp1] * pb[iP1-pbOffset] - + ra[iR] * a_ae[iAp1] - + a_ae[iA] * pb[iP1-pbOffset]; + rap_ae[iAc] = ra[iR] * a_ce[iAp1] * pb[iP1 - pbOffset] + + ra[iR] * a_ae[iAp1] + + a_ae[iA] * pb[iP1 - pbOffset]; iP1 = iP + zOffsetP; - rap_ac[iAc] = a_ac[iA] * pb[iP1-pbOffset] - + ra[iR] * a_cc[iAp1] * pb[iP1-pbOffset] - + ra[iR] * a_ac[iAp1]; + rap_ac[iAc] = a_ac[iA] * pb[iP1 - pbOffset] + + ra[iR] * a_cc[iAp1] * pb[iP1 - pbOffset] + + ra[iR] * a_ac[iAp1]; iP1 = iP + zOffsetP - xOffsetP; - rap_aw[iAc] = ra[iR] * a_cw[iAp1] * pb[iP1-pbOffset] - + ra[iR] * a_aw[iAp1] - + a_aw[iA] * pb[iP1-pbOffset]; + rap_aw[iAc] = ra[iR] * a_cw[iAp1] * pb[iP1 - pbOffset] + + ra[iR] * a_aw[iAp1] + + a_aw[iA] * pb[iP1 - pbOffset]; iP1 = iP + zOffsetP - yOffsetP + xOffsetP; - rap_ase[iAc] = ra[iR] * a_cse[iAp1] * pb[iP1-pbOffset]; + rap_ase[iAc] = ra[iR] * a_cse[iAp1] * pb[iP1 - pbOffset]; iP1 = iP + zOffsetP - yOffsetP; - rap_as[iAc] = ra[iR] * a_cs[iAp1] * pb[iP1-pbOffset] - + ra[iR] * a_as[iAp1] - + a_as[iA] * pb[iP1-pbOffset]; + rap_as[iAc] = ra[iR] * a_cs[iAp1] * pb[iP1 - pbOffset] + + ra[iR] * a_as[iAp1] + + a_as[iA] * pb[iP1 - pbOffset]; iP1 = iP + zOffsetP - yOffsetP - xOffsetP; - rap_asw[iAc] = ra[iR] * a_csw[iAp1] * pb[iP1-pbOffset]; + rap_asw[iAc] = ra[iR] * a_csw[iAp1] * pb[iP1 - pbOffset]; iP1 = iP + yOffsetP + xOffsetP; rap_cne[iAc] = a_cne[iA] - + rb[iR-rbOffset] * a_cne[iAm1] * pb[iP1-pbOffset] - + ra[iR] * a_cne[iAp1] * pa[iP1]; + + rb[iR - rbOffset] * a_cne[iAm1] * pb[iP1 - pbOffset] + + ra[iR] * a_cne[iAp1] * pa[iP1]; iP1 = iP + yOffsetP; rap_cn[iAc] = a_cn[iA] - + rb[iR-rbOffset] * a_cn[iAm1] * pb[iP1-pbOffset] - + ra[iR] * a_cn[iAp1] * pa[iP1] - + a_bn[iA] * pb[iP1-pbOffset] - + a_an[iA] * pa[iP1] - + rb[iR-rbOffset] * a_an[iAm1] - + ra[iR] * a_bn[iAp1]; + + rb[iR - rbOffset] * a_cn[iAm1] * pb[iP1 - pbOffset] + + ra[iR] * a_cn[iAp1] * pa[iP1] + + a_bn[iA] * pb[iP1 - pbOffset] + + a_an[iA] * pa[iP1] + + rb[iR - rbOffset] * a_an[iAm1] + + ra[iR] * a_bn[iAp1]; iP1 = iP + yOffsetP - xOffsetP; rap_cnw[iAc] = a_cnw[iA] - + rb[iR-rbOffset] * a_cnw[iAm1] * pb[iP1-pbOffset] - + ra[iR] * a_cnw[iAp1] * pa[iP1]; + + rb[iR - rbOffset] * a_cnw[iAm1] * pb[iP1 - pbOffset] + + ra[iR] * a_cnw[iAp1] * pa[iP1]; iP1 = iP + xOffsetP; rap_ce[iAc] = a_ce[iA] - + rb[iR-rbOffset] * a_ce[iAm1] * pb[iP1-pbOffset] - + ra[iR] * a_ce[iAp1] * pa[iP1] - + a_be[iA] * pb[iP1-pbOffset] - + a_ae[iA] * pa[iP1] - + rb[iR-rbOffset] * a_ae[iAm1] - + ra[iR] * a_be[iAp1]; + + rb[iR - rbOffset] * a_ce[iAm1] * pb[iP1 - pbOffset] + + ra[iR] * a_ce[iAp1] * pa[iP1] + + a_be[iA] * pb[iP1 - pbOffset] + + a_ae[iA] * pa[iP1] + + rb[iR - rbOffset] * a_ae[iAm1] + + ra[iR] * a_be[iAp1]; } hypre_BoxLoop4End(iP, iR, iA, iAc); @@ -4172,76 +4175,76 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS19_CC0( HYPRE_Int iAp1 = iA + zOffsetA_diag; HYPRE_Int iP1 = iP + zOffsetP + yOffsetP + xOffsetP; - rap_ane[iAc] = ra[iR] * a_cne_offdp1 * pb[iP1-pbOffset]; + rap_ane[iAc] = ra[iR] * a_cne_offdp1 * pb[iP1 - pbOffset]; iP1 = iP + zOffsetP + yOffsetP; - rap_an[iAc] = ra[iR] * a_cn_offdp1 * pb[iP1-pbOffset] - + ra[iR] * a_an_offdp1 - + a_an_offd * pb[iP1-pbOffset]; + rap_an[iAc] = ra[iR] * a_cn_offdp1 * pb[iP1 - pbOffset] + + ra[iR] * a_an_offdp1 + + a_an_offd * pb[iP1 - pbOffset]; iP1 = iP + zOffsetP + yOffsetP - xOffsetP; - rap_anw[iAc] = ra[iR] * a_cnw_offdp1 * pb[iP1-pbOffset]; + rap_anw[iAc] = ra[iR] * a_cnw_offdp1 * pb[iP1 - pbOffset]; iP1 = iP + zOffsetP + xOffsetP; - rap_ae[iAc] = ra[iR] * a_ce_offdp1 * pb[iP1-pbOffset] - + ra[iR] * a_ae_offdp1 - + a_ae_offd * pb[iP1-pbOffset]; + rap_ae[iAc] = ra[iR] * a_ce_offdp1 * pb[iP1 - pbOffset] + + ra[iR] * a_ae_offdp1 + + a_ae_offd * pb[iP1 - pbOffset]; iP1 = iP + zOffsetP; - rap_ac[iAc] = a_ac_offd * pb[iP1-pbOffset] - + ra[iR] * a_cc[iAp1] * pb[iP1-pbOffset] - + ra[iR] * a_ac_offdp1; + rap_ac[iAc] = a_ac_offd * pb[iP1 - pbOffset] + + ra[iR] * a_cc[iAp1] * pb[iP1 - pbOffset] + + ra[iR] * a_ac_offdp1; iP1 = iP + zOffsetP - xOffsetP; - rap_aw[iAc] = ra[iR] * a_cw_offdp1 * pb[iP1-pbOffset] - + ra[iR] * a_aw_offdp1 - + a_aw_offd * pb[iP1-pbOffset]; + rap_aw[iAc] = ra[iR] * a_cw_offdp1 * pb[iP1 - pbOffset] + + ra[iR] * a_aw_offdp1 + + a_aw_offd * pb[iP1 - pbOffset]; iP1 = iP + zOffsetP - yOffsetP + xOffsetP; - rap_ase[iAc] = ra[iR] * a_cse_offdp1 * pb[iP1-pbOffset]; + rap_ase[iAc] = ra[iR] * a_cse_offdp1 * pb[iP1 - pbOffset]; iP1 = iP + zOffsetP - yOffsetP; - rap_as[iAc] = ra[iR] * a_cs_offdp1 * pb[iP1-pbOffset] - + ra[iR] * a_as_offdp1 - + a_as_offd * pb[iP1-pbOffset]; + rap_as[iAc] = ra[iR] * a_cs_offdp1 * pb[iP1 - pbOffset] + + ra[iR] * a_as_offdp1 + + a_as_offd * pb[iP1 - pbOffset]; iP1 = iP + zOffsetP - yOffsetP - xOffsetP; - rap_asw[iAc] = ra[iR] * a_csw_offdp1 * pb[iP1-pbOffset]; + rap_asw[iAc] = ra[iR] * a_csw_offdp1 * pb[iP1 - pbOffset]; iP1 = iP + yOffsetP + xOffsetP; rap_cne[iAc] = a_cne_offd - + rb[iR-rbOffset] * a_cne_offdm1 * pb[iP1-pbOffset] - + ra[iR] * a_cne_offdp1 * pa[iP1]; + + rb[iR - rbOffset] * a_cne_offdm1 * pb[iP1 - pbOffset] + + ra[iR] * a_cne_offdp1 * pa[iP1]; iP1 = iP + yOffsetP; rap_cn[iAc] = a_cn_offd - + rb[iR-rbOffset] * a_cn_offdm1 * pb[iP1-pbOffset] - + ra[iR] * a_cn_offdp1 * pa[iP1] - + a_bn_offd * pb[iP1-pbOffset] - + a_an_offd * pa[iP1] - + rb[iR-rbOffset] * a_an_offdm1 - + ra[iR] * a_bn_offdp1; + + rb[iR - rbOffset] * a_cn_offdm1 * pb[iP1 - pbOffset] + + ra[iR] * a_cn_offdp1 * pa[iP1] + + a_bn_offd * pb[iP1 - pbOffset] + + a_an_offd * pa[iP1] + + rb[iR - rbOffset] * a_an_offdm1 + + ra[iR] * a_bn_offdp1; iP1 = iP + yOffsetP - xOffsetP; rap_cnw[iAc] = a_cnw_offd - + rb[iR-rbOffset] * a_cnw_offdm1 * pb[iP1-pbOffset] - + ra[iR] * a_cnw_offdp1 * pa[iP1]; + + rb[iR - rbOffset] * a_cnw_offdm1 * pb[iP1 - pbOffset] + + ra[iR] * a_cnw_offdp1 * pa[iP1]; iP1 = iP + xOffsetP; rap_ce[iAc] = a_ce_offd - + rb[iR-rbOffset] * a_ce_offdm1 * pb[iP1-pbOffset] - + ra[iR] * a_ce_offdp1 * pa[iP1] - + a_be_offd * pb[iP1-pbOffset] - + a_ae_offd * pa[iP1] - + rb[iR-rbOffset] * a_ae_offdm1 - + ra[iR] * a_be_offdp1; + + rb[iR - rbOffset] * a_ce_offdm1 * pb[iP1 - pbOffset] + + ra[iR] * a_ce_offdp1 * pa[iP1] + + a_be_offd * pb[iP1 - pbOffset] + + a_ae_offd * pa[iP1] + + rb[iR - rbOffset] * a_ae_offdm1 + + ra[iR] * a_be_offdp1; } hypre_BoxLoop4End(iP, iR, iA, iAc); #undef DEVICE_VAR } -/* }*/ /* end ForBoxI */ + /* }*/ /* end ForBoxI */ return hypre_error_flag; } @@ -4303,11 +4306,11 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS19_CC1( * pb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,-1); + hypre_SetIndex3(index_temp, 0, 0, -1); MapIndex(index_temp, cdir, index); pa = hypre_StructMatrixExtractPointerByIndex(P, fi, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); pb = hypre_StructMatrixExtractPointerByIndex(P, fi, index); @@ -4318,11 +4321,11 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS19_CC1( * rb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,-1); + hypre_SetIndex3(index_temp, 0, 0, -1); MapIndex(index_temp, cdir, index); ra = hypre_StructMatrixExtractPointerByIndex(R, fi, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); rb = hypre_StructMatrixExtractPointerByIndex(R, fi, index); @@ -4339,27 +4342,27 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS19_CC1( * a_bc is pointer for center coefficient in plane below *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,0); + hypre_SetIndex3(index_temp, 0, 0, 0); MapIndex(index_temp, cdir, index); a_cc = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,0,0); + hypre_SetIndex3(index_temp, -1, 0, 0); MapIndex(index_temp, cdir, index); a_cw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); a_ce = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); a_cs = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); a_cn = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); a_ac = hypre_StructMatrixExtractPointerByIndex(A, fi, index); @@ -4380,43 +4383,43 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS19_CC1( * a_cne is pointer for northeast coefficient in same plane *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,-1,0,1); + hypre_SetIndex3(index_temp, -1, 0, 1); MapIndex(index_temp, cdir, index); a_aw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,0,1); + hypre_SetIndex3(index_temp, 1, 0, 1); MapIndex(index_temp, cdir, index); a_ae = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,-1,1); + hypre_SetIndex3(index_temp, 0, -1, 1); MapIndex(index_temp, cdir, index); a_as = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,1,1); + hypre_SetIndex3(index_temp, 0, 1, 1); MapIndex(index_temp, cdir, index); a_an = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,0,-1); + hypre_SetIndex3(index_temp, 1, 0, -1); MapIndex(index_temp, cdir, index); a_be = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,1,-1); + hypre_SetIndex3(index_temp, 0, 1, -1); MapIndex(index_temp, cdir, index); a_bn = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,-1,0); + hypre_SetIndex3(index_temp, -1, -1, 0); MapIndex(index_temp, cdir, index); a_csw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,-1,0); + hypre_SetIndex3(index_temp, 1, -1, 0); MapIndex(index_temp, cdir, index); a_cse = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,1,0); + hypre_SetIndex3(index_temp, -1, 1, 0); MapIndex(index_temp, cdir, index); a_cnw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,1,0); + hypre_SetIndex3(index_temp, 1, 1, 0); MapIndex(index_temp, cdir, index); a_cne = hypre_StructMatrixExtractPointerByIndex(A, fi, index); @@ -4428,39 +4431,39 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS19_CC1( * rap_ce is pointer for east coefficient in same plane (etc.) *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); rap_ce = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); rap_cn = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); rap_ac = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,0,1); + hypre_SetIndex3(index_temp, -1, 0, 1); MapIndex(index_temp, cdir, index); rap_aw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,0,1); + hypre_SetIndex3(index_temp, 1, 0, 1); MapIndex(index_temp, cdir, index); rap_ae = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,-1,1); + hypre_SetIndex3(index_temp, 0, -1, 1); MapIndex(index_temp, cdir, index); rap_as = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,1,1); + hypre_SetIndex3(index_temp, 0, 1, 1); MapIndex(index_temp, cdir, index); rap_an = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,1,0); + hypre_SetIndex3(index_temp, -1, 1, 0); MapIndex(index_temp, cdir, index); rap_cnw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,1,0); + hypre_SetIndex3(index_temp, 1, 1, 0); MapIndex(index_temp, cdir, index); rap_cne = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); @@ -4475,19 +4478,19 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS19_CC1( * rap_cnw is pointer for northwest coefficient in same plane (etc.) *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,-1,-1,1); + hypre_SetIndex3(index_temp, -1, -1, 1); MapIndex(index_temp, cdir, index); rap_asw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,-1,1); + hypre_SetIndex3(index_temp, 1, -1, 1); MapIndex(index_temp, cdir, index); rap_ase = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,1,1); + hypre_SetIndex3(index_temp, -1, 1, 1); MapIndex(index_temp, cdir, index); rap_anw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,1,1); + hypre_SetIndex3(index_temp, 1, 1, 1); MapIndex(index_temp, cdir, index); rap_ane = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); @@ -4499,18 +4502,18 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS19_CC1( * Offsets are used in refering to data associated with other points. *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); zOffsetA = 0; zOffsetP = 0; - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); yOffsetP = 0; - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); xOffsetP = 0; @@ -4542,65 +4545,65 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS19_CC1( iP1 = iP + zOffsetP + yOffsetP; rap_an[iAc] = ra[iR] * a_cn[iAp1] * pb[iP1] - + ra[iR] * a_an[iAp1] - + a_an[iA] * pb[iP1]; + + ra[iR] * a_an[iAp1] + + a_an[iA] * pb[iP1]; iP1 = iP + zOffsetP + yOffsetP - xOffsetP; rap_anw[iAc] = ra[iR] * a_cnw[iAp1] * pb[iP1]; iP1 = iP + zOffsetP + xOffsetP; rap_ae[iAc] = ra[iR] * a_ce[iAp1] * pb[iP1] - + ra[iR] * a_ae[iAp1] - + a_ae[iA] * pb[iP1]; + + ra[iR] * a_ae[iAp1] + + a_ae[iA] * pb[iP1]; iP1 = iP + zOffsetP; rap_ac[iAc] = a_ac[iA] * pb[iP1] - + ra[iR] * a_cc[iAp1] * pb[iP1] - + ra[iR] * a_ac[iAp1]; + + ra[iR] * a_cc[iAp1] * pb[iP1] + + ra[iR] * a_ac[iAp1]; iP1 = iP + zOffsetP - xOffsetP; rap_aw[iAc] = ra[iR] * a_cw[iAp1] * pb[iP1] - + ra[iR] * a_aw[iAp1] - + a_aw[iA] * pb[iP1]; + + ra[iR] * a_aw[iAp1] + + a_aw[iA] * pb[iP1]; iP1 = iP + zOffsetP - yOffsetP + xOffsetP; rap_ase[iAc] = ra[iR] * a_cse[iAp1] * pb[iP1]; iP1 = iP + zOffsetP - yOffsetP; rap_as[iAc] = ra[iR] * a_cs[iAp1] * pb[iP1] - + ra[iR] * a_as[iAp1] - + a_as[iA] * pb[iP1]; + + ra[iR] * a_as[iAp1] + + a_as[iA] * pb[iP1]; iP1 = iP + zOffsetP - yOffsetP - xOffsetP; rap_asw[iAc] = ra[iR] * a_csw[iAp1] * pb[iP1]; iP1 = iP + yOffsetP + xOffsetP; rap_cne[iAc] = a_cne[iA] - + rb[iR] * a_cne[iAm1] * pb[iP1] - + ra[iR] * a_cne[iAp1] * pa[iP1]; + + rb[iR] * a_cne[iAm1] * pb[iP1] + + ra[iR] * a_cne[iAp1] * pa[iP1]; iP1 = iP + yOffsetP; rap_cn[iAc] = a_cn[iA] - + rb[iR] * a_cn[iAm1] * pb[iP1] - + ra[iR] * a_cn[iAp1] * pa[iP1] - + a_bn[iA] * pb[iP1] - + a_an[iA] * pa[iP1] - + rb[iR] * a_an[iAm1] - + ra[iR] * a_bn[iAp1]; + + rb[iR] * a_cn[iAm1] * pb[iP1] + + ra[iR] * a_cn[iAp1] * pa[iP1] + + a_bn[iA] * pb[iP1] + + a_an[iA] * pa[iP1] + + rb[iR] * a_an[iAm1] + + ra[iR] * a_bn[iAp1]; iP1 = iP + yOffsetP - xOffsetP; rap_cnw[iAc] = a_cnw[iA] - + rb[iR] * a_cnw[iAm1] * pb[iP1] - + ra[iR] * a_cnw[iAp1] * pa[iP1]; + + rb[iR] * a_cnw[iAm1] * pb[iP1] + + ra[iR] * a_cnw[iAp1] * pa[iP1]; iP1 = iP + xOffsetP; rap_ce[iAc] = a_ce[iA] - + rb[iR] * a_ce[iAm1] * pb[iP1] - + ra[iR] * a_ce[iAp1] * pa[iP1] - + a_be[iA] * pb[iP1] - + a_ae[iA] * pa[iP1] - + rb[iR] * a_ae[iAm1] - + ra[iR] * a_be[iAp1]; + + rb[iR] * a_ce[iAm1] * pb[iP1] + + ra[iR] * a_ce[iAp1] * pa[iP1] + + a_be[iA] * pb[iP1] + + a_ae[iA] * pa[iP1] + + rb[iR] * a_ae[iAm1] + + ra[iR] * a_be[iAp1]; /* }*/ /* end ForBoxI */ @@ -4713,11 +4716,11 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS27_CC0( * pb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,-1); + hypre_SetIndex3(index_temp, 0, 0, -1); MapIndex(index_temp, cdir, index); pa = hypre_StructMatrixExtractPointerByIndex(P, fi, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); pb = hypre_StructMatrixExtractPointerByIndex(P, fi, index); @@ -4730,11 +4733,11 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS27_CC0( * rb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,-1); + hypre_SetIndex3(index_temp, 0, 0, -1); MapIndex(index_temp, cdir, index); ra = hypre_StructMatrixExtractPointerByIndex(R, fi, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); rb = hypre_StructMatrixExtractPointerByIndex(R, fi, index); @@ -4753,27 +4756,27 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS27_CC0( * a_bc is pointer for center coefficient in plane below *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,0); + hypre_SetIndex3(index_temp, 0, 0, 0); MapIndex(index_temp, cdir, index); a_cc = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,0,0); + hypre_SetIndex3(index_temp, -1, 0, 0); MapIndex(index_temp, cdir, index); a_cw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); a_ce = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); a_cs = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); a_cn = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); a_ac = hypre_StructMatrixExtractPointerByIndex(A, fi, index); @@ -4794,43 +4797,43 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS27_CC0( * a_cne is pointer for northeast coefficient in same plane *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,-1,0,1); + hypre_SetIndex3(index_temp, -1, 0, 1); MapIndex(index_temp, cdir, index); a_aw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,0,1); + hypre_SetIndex3(index_temp, 1, 0, 1); MapIndex(index_temp, cdir, index); a_ae = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,-1,1); + hypre_SetIndex3(index_temp, 0, -1, 1); MapIndex(index_temp, cdir, index); a_as = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,1,1); + hypre_SetIndex3(index_temp, 0, 1, 1); MapIndex(index_temp, cdir, index); a_an = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,0,-1); + hypre_SetIndex3(index_temp, 1, 0, -1); MapIndex(index_temp, cdir, index); a_be = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,1,-1); + hypre_SetIndex3(index_temp, 0, 1, -1); MapIndex(index_temp, cdir, index); a_bn = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,-1,0); + hypre_SetIndex3(index_temp, -1, -1, 0); MapIndex(index_temp, cdir, index); a_csw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,-1,0); + hypre_SetIndex3(index_temp, 1, -1, 0); MapIndex(index_temp, cdir, index); a_cse = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,1,0); + hypre_SetIndex3(index_temp, -1, 1, 0); MapIndex(index_temp, cdir, index); a_cnw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,1,0); + hypre_SetIndex3(index_temp, 1, 1, 0); MapIndex(index_temp, cdir, index); a_cne = hypre_StructMatrixExtractPointerByIndex(A, fi, index); @@ -4847,27 +4850,27 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS27_CC0( * a_bne is pointer for northeast coefficient in plane below *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,-1,-1,1); + hypre_SetIndex3(index_temp, -1, -1, 1); MapIndex(index_temp, cdir, index); a_asw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,-1,1); + hypre_SetIndex3(index_temp, 1, -1, 1); MapIndex(index_temp, cdir, index); a_ase = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,1,1); + hypre_SetIndex3(index_temp, -1, 1, 1); MapIndex(index_temp, cdir, index); a_anw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,1,1); + hypre_SetIndex3(index_temp, 1, 1, 1); MapIndex(index_temp, cdir, index); a_ane = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,1,-1); + hypre_SetIndex3(index_temp, -1, 1, -1); MapIndex(index_temp, cdir, index); a_bnw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,1,-1); + hypre_SetIndex3(index_temp, 1, 1, -1); MapIndex(index_temp, cdir, index); a_bne = hypre_StructMatrixExtractPointerByIndex(A, fi, index); @@ -4879,39 +4882,39 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS27_CC0( * rap_ce is pointer for east coefficient in same plane (etc.) *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); rap_ce = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); rap_cn = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); rap_ac = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,0,1); + hypre_SetIndex3(index_temp, -1, 0, 1); MapIndex(index_temp, cdir, index); rap_aw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,0,1); + hypre_SetIndex3(index_temp, 1, 0, 1); MapIndex(index_temp, cdir, index); rap_ae = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,-1,1); + hypre_SetIndex3(index_temp, 0, -1, 1); MapIndex(index_temp, cdir, index); rap_as = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,1,1); + hypre_SetIndex3(index_temp, 0, 1, 1); MapIndex(index_temp, cdir, index); rap_an = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,1,0); + hypre_SetIndex3(index_temp, -1, 1, 0); MapIndex(index_temp, cdir, index); rap_cnw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,1,0); + hypre_SetIndex3(index_temp, 1, 1, 0); MapIndex(index_temp, cdir, index); rap_cne = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); @@ -4926,19 +4929,19 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS27_CC0( * rap_cnw is pointer for northwest coefficient in same plane (etc.) *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,-1,-1,1); + hypre_SetIndex3(index_temp, -1, -1, 1); MapIndex(index_temp, cdir, index); rap_asw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,-1,1); + hypre_SetIndex3(index_temp, 1, -1, 1); MapIndex(index_temp, cdir, index); rap_ase = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,1,1); + hypre_SetIndex3(index_temp, -1, 1, 1); MapIndex(index_temp, cdir, index); rap_anw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,1,1); + hypre_SetIndex3(index_temp, 1, 1, 1); MapIndex(index_temp, cdir, index); rap_ane = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); @@ -4950,29 +4953,29 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS27_CC0( * Offsets are used in refering to data associated with other points. *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); - zOffsetP = hypre_BoxOffsetDistance(P_dbox,index); + zOffsetP = hypre_BoxOffsetDistance(P_dbox, index); if ( constant_coefficient_A == 0 ) { - zOffsetA = hypre_BoxOffsetDistance(A_dbox,index); + zOffsetA = hypre_BoxOffsetDistance(A_dbox, index); } else { - zOffsetA_diag = hypre_BoxOffsetDistance(A_dbox,index); + zOffsetA_diag = hypre_BoxOffsetDistance(A_dbox, index); zOffsetA_offd = 0; } - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); - yOffsetP = hypre_BoxOffsetDistance(P_dbox,index); + yOffsetP = hypre_BoxOffsetDistance(P_dbox, index); - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); - xOffsetP = hypre_BoxOffsetDistance(P_dbox,index); + xOffsetP = hypre_BoxOffsetDistance(P_dbox, index); /*----------------------------------------------------------------- * Switch statement to direct control to apropriate BoxLoop depending @@ -5003,86 +5006,86 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS27_CC0( HYPRE_Int iAp1 = iA + zOffsetA; HYPRE_Int iP1 = iP + zOffsetP + yOffsetP + xOffsetP; - rap_ane[iAc] = ra[iR] * a_cne[iAp1] * pb[iP1-pbOffset] - + ra[iR] * a_ane[iAp1] - + a_ane[iA] * pb[iP1-pbOffset]; + rap_ane[iAc] = ra[iR] * a_cne[iAp1] * pb[iP1 - pbOffset] + + ra[iR] * a_ane[iAp1] + + a_ane[iA] * pb[iP1 - pbOffset]; iP1 = iP + zOffsetP + yOffsetP; - rap_an[iAc] = ra[iR] * a_cn[iAp1] * pb[iP1-pbOffset] - + ra[iR] * a_an[iAp1] - + a_an[iA] * pb[iP1-pbOffset]; + rap_an[iAc] = ra[iR] * a_cn[iAp1] * pb[iP1 - pbOffset] + + ra[iR] * a_an[iAp1] + + a_an[iA] * pb[iP1 - pbOffset]; iP1 = iP + zOffsetP + yOffsetP - xOffsetP; - rap_anw[iAc] = ra[iR] * a_cnw[iAp1] * pb[iP1-pbOffset] - + ra[iR] * a_anw[iAp1] - + a_anw[iA] * pb[iP1-pbOffset]; + rap_anw[iAc] = ra[iR] * a_cnw[iAp1] * pb[iP1 - pbOffset] + + ra[iR] * a_anw[iAp1] + + a_anw[iA] * pb[iP1 - pbOffset]; iP1 = iP + zOffsetP + xOffsetP; - rap_ae[iAc] = ra[iR] * a_ce[iAp1] * pb[iP1-pbOffset] - + ra[iR] * a_ae[iAp1] - + a_ae[iA] * pb[iP1-pbOffset]; + rap_ae[iAc] = ra[iR] * a_ce[iAp1] * pb[iP1 - pbOffset] + + ra[iR] * a_ae[iAp1] + + a_ae[iA] * pb[iP1 - pbOffset]; iP1 = iP + zOffsetP; - rap_ac[iAc] = a_ac[iA] * pb[iP1-pbOffset] - + ra[iR] * a_cc[iAp1] * pb[iP1-pbOffset] - + ra[iR] * a_ac[iAp1]; + rap_ac[iAc] = a_ac[iA] * pb[iP1 - pbOffset] + + ra[iR] * a_cc[iAp1] * pb[iP1 - pbOffset] + + ra[iR] * a_ac[iAp1]; iP1 = iP + zOffsetP - xOffsetP; - rap_aw[iAc] = ra[iR] * a_cw[iAp1] * pb[iP1-pbOffset] - + ra[iR] * a_aw[iAp1] - + a_aw[iA] * pb[iP1-pbOffset]; + rap_aw[iAc] = ra[iR] * a_cw[iAp1] * pb[iP1 - pbOffset] + + ra[iR] * a_aw[iAp1] + + a_aw[iA] * pb[iP1 - pbOffset]; iP1 = iP + zOffsetP - yOffsetP + xOffsetP; - rap_ase[iAc] = ra[iR] * a_cse[iAp1] * pb[iP1-pbOffset] - + ra[iR] * a_ase[iAp1] - + a_ase[iA] * pb[iP1-pbOffset]; + rap_ase[iAc] = ra[iR] * a_cse[iAp1] * pb[iP1 - pbOffset] + + ra[iR] * a_ase[iAp1] + + a_ase[iA] * pb[iP1 - pbOffset]; iP1 = iP + zOffsetP - yOffsetP; - rap_as[iAc] = ra[iR] * a_cs[iAp1] * pb[iP1-pbOffset] - + ra[iR] * a_as[iAp1] - + a_as[iA] * pb[iP1-pbOffset]; + rap_as[iAc] = ra[iR] * a_cs[iAp1] * pb[iP1 - pbOffset] + + ra[iR] * a_as[iAp1] + + a_as[iA] * pb[iP1 - pbOffset]; iP1 = iP + zOffsetP - yOffsetP - xOffsetP; - rap_asw[iAc] = ra[iR] * a_csw[iAp1] * pb[iP1-pbOffset] - + ra[iR] * a_asw[iAp1] - + a_asw[iA] * pb[iP1-pbOffset]; + rap_asw[iAc] = ra[iR] * a_csw[iAp1] * pb[iP1 - pbOffset] + + ra[iR] * a_asw[iAp1] + + a_asw[iA] * pb[iP1 - pbOffset]; iP1 = iP + yOffsetP + xOffsetP; rap_cne[iAc] = a_cne[iA] - + rb[iR-rbOffset] * a_cne[iAm1] * pb[iP1-pbOffset] - + ra[iR] * a_cne[iAp1] * pa[iP1] - + a_bne[iA] * pb[iP1-pbOffset] - + a_ane[iA] * pa[iP1] - + rb[iR-rbOffset] * a_ane[iAm1] - + ra[iR] * a_bne[iAp1]; + + rb[iR - rbOffset] * a_cne[iAm1] * pb[iP1 - pbOffset] + + ra[iR] * a_cne[iAp1] * pa[iP1] + + a_bne[iA] * pb[iP1 - pbOffset] + + a_ane[iA] * pa[iP1] + + rb[iR - rbOffset] * a_ane[iAm1] + + ra[iR] * a_bne[iAp1]; iP1 = iP + yOffsetP; rap_cn[iAc] = a_cn[iA] - + rb[iR-rbOffset] * a_cn[iAm1] * pb[iP1-pbOffset] - + ra[iR] * a_cn[iAp1] * pa[iP1] - + a_bn[iA] * pb[iP1-pbOffset] - + a_an[iA] * pa[iP1] - + rb[iR-rbOffset] * a_an[iAm1] - + ra[iR] * a_bn[iAp1]; + + rb[iR - rbOffset] * a_cn[iAm1] * pb[iP1 - pbOffset] + + ra[iR] * a_cn[iAp1] * pa[iP1] + + a_bn[iA] * pb[iP1 - pbOffset] + + a_an[iA] * pa[iP1] + + rb[iR - rbOffset] * a_an[iAm1] + + ra[iR] * a_bn[iAp1]; iP1 = iP + yOffsetP - xOffsetP; rap_cnw[iAc] = a_cnw[iA] - + rb[iR-rbOffset] * a_cnw[iAm1] * pb[iP1-pbOffset] - + ra[iR] * a_cnw[iAp1] * pa[iP1] - + a_bnw[iA] * pb[iP1-pbOffset] - + a_anw[iA] * pa[iP1] - + rb[iR-rbOffset] * a_anw[iAm1] - + ra[iR] * a_bnw[iAp1]; + + rb[iR - rbOffset] * a_cnw[iAm1] * pb[iP1 - pbOffset] + + ra[iR] * a_cnw[iAp1] * pa[iP1] + + a_bnw[iA] * pb[iP1 - pbOffset] + + a_anw[iA] * pa[iP1] + + rb[iR - rbOffset] * a_anw[iAm1] + + ra[iR] * a_bnw[iAp1]; iP1 = iP + xOffsetP; rap_ce[iAc] = a_ce[iA] - + rb[iR-rbOffset] * a_ce[iAm1] * pb[iP1-pbOffset] - + ra[iR] * a_ce[iAp1] * pa[iP1] - + a_be[iA] * pb[iP1-pbOffset] - + a_ae[iA] * pa[iP1] - + rb[iR-rbOffset] * a_ae[iAm1] - + ra[iR] * a_be[iAp1]; + + rb[iR - rbOffset] * a_ce[iAm1] * pb[iP1 - pbOffset] + + ra[iR] * a_ce[iAp1] * pa[iP1] + + a_be[iA] * pb[iP1 - pbOffset] + + a_ae[iA] * pa[iP1] + + rb[iR - rbOffset] * a_ae[iAm1] + + ra[iR] * a_be[iAp1]; } hypre_BoxLoop4End(iP, iR, iA, iAc); @@ -5150,85 +5153,85 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS27_CC0( HYPRE_Int iAp1 = iA + zOffsetA_diag; HYPRE_Int iP1 = iP + zOffsetP + yOffsetP + xOffsetP; - rap_ane[iAc] = ra[iR] * a_cne_offdp1 * pb[iP1-pbOffset] - + ra[iR] * a_ane_offdp1 - + a_ane_offd * pb[iP1-pbOffset]; + rap_ane[iAc] = ra[iR] * a_cne_offdp1 * pb[iP1 - pbOffset] + + ra[iR] * a_ane_offdp1 + + a_ane_offd * pb[iP1 - pbOffset]; iP1 = iP + zOffsetP + yOffsetP; - rap_an[iAc] = ra[iR] * a_cn_offdp1 * pb[iP1-pbOffset] - + ra[iR] * a_an_offdp1 - + a_an_offd * pb[iP1-pbOffset]; + rap_an[iAc] = ra[iR] * a_cn_offdp1 * pb[iP1 - pbOffset] + + ra[iR] * a_an_offdp1 + + a_an_offd * pb[iP1 - pbOffset]; iP1 = iP + zOffsetP + yOffsetP - xOffsetP; - rap_anw[iAc] = ra[iR] * a_cnw_offdp1 * pb[iP1-pbOffset] - + ra[iR] * a_anw_offdp1 - + a_anw_offd * pb[iP1-pbOffset]; + rap_anw[iAc] = ra[iR] * a_cnw_offdp1 * pb[iP1 - pbOffset] + + ra[iR] * a_anw_offdp1 + + a_anw_offd * pb[iP1 - pbOffset]; iP1 = iP + zOffsetP + xOffsetP; - rap_ae[iAc] = ra[iR] * a_ce_offdp1 * pb[iP1-pbOffset] - + ra[iR] * a_ae_offdp1 - + a_ae_offd * pb[iP1-pbOffset]; + rap_ae[iAc] = ra[iR] * a_ce_offdp1 * pb[iP1 - pbOffset] + + ra[iR] * a_ae_offdp1 + + a_ae_offd * pb[iP1 - pbOffset]; iP1 = iP + zOffsetP; - rap_ac[iAc] = a_ac_offd * pb[iP1-pbOffset] - + ra[iR] * a_cc[iAp1] * pb[iP1-pbOffset] - + ra[iR] * a_ac_offdp1; + rap_ac[iAc] = a_ac_offd * pb[iP1 - pbOffset] + + ra[iR] * a_cc[iAp1] * pb[iP1 - pbOffset] + + ra[iR] * a_ac_offdp1; iP1 = iP + zOffsetP - xOffsetP; - rap_aw[iAc] = ra[iR] * a_cw_offdp1 * pb[iP1-pbOffset] - + ra[iR] * a_aw_offdp1 - + a_aw_offd * pb[iP1-pbOffset]; + rap_aw[iAc] = ra[iR] * a_cw_offdp1 * pb[iP1 - pbOffset] + + ra[iR] * a_aw_offdp1 + + a_aw_offd * pb[iP1 - pbOffset]; iP1 = iP + zOffsetP - yOffsetP + xOffsetP; - rap_ase[iAc] = ra[iR] * a_cse_offdp1 * pb[iP1-pbOffset] - + ra[iR] * a_ase_offdp1 - + a_ase_offd * pb[iP1-pbOffset]; + rap_ase[iAc] = ra[iR] * a_cse_offdp1 * pb[iP1 - pbOffset] + + ra[iR] * a_ase_offdp1 + + a_ase_offd * pb[iP1 - pbOffset]; iP1 = iP + zOffsetP - yOffsetP; - rap_as[iAc] = ra[iR] * a_cs_offdp1 * pb[iP1-pbOffset] - + ra[iR] * a_as_offdp1 - + a_as_offd * pb[iP1-pbOffset]; + rap_as[iAc] = ra[iR] * a_cs_offdp1 * pb[iP1 - pbOffset] + + ra[iR] * a_as_offdp1 + + a_as_offd * pb[iP1 - pbOffset]; iP1 = iP + zOffsetP - yOffsetP - xOffsetP; - rap_asw[iAc] = ra[iR] * a_csw_offdp1 * pb[iP1-pbOffset] - + ra[iR] * a_asw_offdp1 - + a_asw_offd * pb[iP1-pbOffset]; + rap_asw[iAc] = ra[iR] * a_csw_offdp1 * pb[iP1 - pbOffset] + + ra[iR] * a_asw_offdp1 + + a_asw_offd * pb[iP1 - pbOffset]; iP1 = iP + yOffsetP + xOffsetP; rap_cne[iAc] = a_cne_offd - + rb[iR-rbOffset] * a_cne_offdm1 * pb[iP1-pbOffset] - + ra[iR] * a_cne_offdp1 * pa[iP1] - + a_bne_offd * pb[iP1-pbOffset] - + a_ane_offd * pa[iP1] - + rb[iR-rbOffset] * a_ane_offdm1 - + ra[iR] * a_bne_offdp1; + + rb[iR - rbOffset] * a_cne_offdm1 * pb[iP1 - pbOffset] + + ra[iR] * a_cne_offdp1 * pa[iP1] + + a_bne_offd * pb[iP1 - pbOffset] + + a_ane_offd * pa[iP1] + + rb[iR - rbOffset] * a_ane_offdm1 + + ra[iR] * a_bne_offdp1; iP1 = iP + yOffsetP; rap_cn[iAc] = a_cn_offd - + rb[iR-rbOffset] * a_cn_offdm1 * pb[iP1-pbOffset] - + ra[iR] * a_cn_offdp1 * pa[iP1] - + a_bn_offd * pb[iP1-pbOffset] - + a_an_offd * pa[iP1] - + rb[iR-rbOffset] * a_an_offdm1 - + ra[iR] * a_bn_offdp1; + + rb[iR - rbOffset] * a_cn_offdm1 * pb[iP1 - pbOffset] + + ra[iR] * a_cn_offdp1 * pa[iP1] + + a_bn_offd * pb[iP1 - pbOffset] + + a_an_offd * pa[iP1] + + rb[iR - rbOffset] * a_an_offdm1 + + ra[iR] * a_bn_offdp1; iP1 = iP + yOffsetP - xOffsetP; rap_cnw[iAc] = a_cnw_offd - + rb[iR-rbOffset] * a_cnw_offdm1 * pb[iP1-pbOffset] - + ra[iR] * a_cnw_offdp1 * pa[iP1] - + a_bnw_offd * pb[iP1-pbOffset] - + a_anw_offd * pa[iP1] - + rb[iR-rbOffset] * a_anw_offdm1 - + ra[iR] * a_bnw_offdp1; + + rb[iR - rbOffset] * a_cnw_offdm1 * pb[iP1 - pbOffset] + + ra[iR] * a_cnw_offdp1 * pa[iP1] + + a_bnw_offd * pb[iP1 - pbOffset] + + a_anw_offd * pa[iP1] + + rb[iR - rbOffset] * a_anw_offdm1 + + ra[iR] * a_bnw_offdp1; iP1 = iP + xOffsetP; rap_ce[iAc] = a_ce_offd - + rb[iR-rbOffset] * a_ce_offdm1 * pb[iP1-pbOffset] - + ra[iR] * a_ce_offdp1 * pa[iP1] - + a_be_offd * pb[iP1-pbOffset] - + a_ae_offd * pa[iP1] - + rb[iR-rbOffset] * a_ae_offdm1 - + ra[iR] * a_be_offdp1; + + rb[iR - rbOffset] * a_ce_offdm1 * pb[iP1 - pbOffset] + + ra[iR] * a_ce_offdp1 * pa[iP1] + + a_be_offd * pb[iP1 - pbOffset] + + a_ae_offd * pa[iP1] + + rb[iR - rbOffset] * a_ae_offdm1 + + ra[iR] * a_be_offdp1; } hypre_BoxLoop4End(iP, iR, iA, iAc); @@ -5300,11 +5303,11 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS27_CC1( * pb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,-1); + hypre_SetIndex3(index_temp, 0, 0, -1); MapIndex(index_temp, cdir, index); pa = hypre_StructMatrixExtractPointerByIndex(P, fi, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); pb = hypre_StructMatrixExtractPointerByIndex(P, fi, index); @@ -5315,11 +5318,11 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS27_CC1( * rb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,-1); + hypre_SetIndex3(index_temp, 0, 0, -1); MapIndex(index_temp, cdir, index); ra = hypre_StructMatrixExtractPointerByIndex(R, fi, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); rb = hypre_StructMatrixExtractPointerByIndex(R, fi, index); @@ -5336,27 +5339,27 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS27_CC1( * a_bc is pointer for center coefficient in plane below *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,0); + hypre_SetIndex3(index_temp, 0, 0, 0); MapIndex(index_temp, cdir, index); a_cc = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,0,0); + hypre_SetIndex3(index_temp, -1, 0, 0); MapIndex(index_temp, cdir, index); a_cw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); a_ce = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); a_cs = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); a_cn = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); a_ac = hypre_StructMatrixExtractPointerByIndex(A, fi, index); @@ -5377,43 +5380,43 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS27_CC1( * a_cne is pointer for northeast coefficient in same plane *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,-1,0,1); + hypre_SetIndex3(index_temp, -1, 0, 1); MapIndex(index_temp, cdir, index); a_aw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,0,1); + hypre_SetIndex3(index_temp, 1, 0, 1); MapIndex(index_temp, cdir, index); a_ae = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,-1,1); + hypre_SetIndex3(index_temp, 0, -1, 1); MapIndex(index_temp, cdir, index); a_as = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,1,1); + hypre_SetIndex3(index_temp, 0, 1, 1); MapIndex(index_temp, cdir, index); a_an = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,0,-1); + hypre_SetIndex3(index_temp, 1, 0, -1); MapIndex(index_temp, cdir, index); a_be = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,1,-1); + hypre_SetIndex3(index_temp, 0, 1, -1); MapIndex(index_temp, cdir, index); a_bn = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,-1,0); + hypre_SetIndex3(index_temp, -1, -1, 0); MapIndex(index_temp, cdir, index); a_csw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,-1,0); + hypre_SetIndex3(index_temp, 1, -1, 0); MapIndex(index_temp, cdir, index); a_cse = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,1,0); + hypre_SetIndex3(index_temp, -1, 1, 0); MapIndex(index_temp, cdir, index); a_cnw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,1,0); + hypre_SetIndex3(index_temp, 1, 1, 0); MapIndex(index_temp, cdir, index); a_cne = hypre_StructMatrixExtractPointerByIndex(A, fi, index); @@ -5430,27 +5433,27 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS27_CC1( * a_bne is pointer for northeast coefficient in plane below *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,-1,-1,1); + hypre_SetIndex3(index_temp, -1, -1, 1); MapIndex(index_temp, cdir, index); a_asw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,-1,1); + hypre_SetIndex3(index_temp, 1, -1, 1); MapIndex(index_temp, cdir, index); a_ase = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,1,1); + hypre_SetIndex3(index_temp, -1, 1, 1); MapIndex(index_temp, cdir, index); a_anw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,1,1); + hypre_SetIndex3(index_temp, 1, 1, 1); MapIndex(index_temp, cdir, index); a_ane = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,1,-1); + hypre_SetIndex3(index_temp, -1, 1, -1); MapIndex(index_temp, cdir, index); a_bnw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,1,-1); + hypre_SetIndex3(index_temp, 1, 1, -1); MapIndex(index_temp, cdir, index); a_bne = hypre_StructMatrixExtractPointerByIndex(A, fi, index); @@ -5462,39 +5465,39 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS27_CC1( * rap_ce is pointer for east coefficient in same plane (etc.) *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); rap_ce = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); rap_cn = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); rap_ac = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,0,1); + hypre_SetIndex3(index_temp, -1, 0, 1); MapIndex(index_temp, cdir, index); rap_aw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,0,1); + hypre_SetIndex3(index_temp, 1, 0, 1); MapIndex(index_temp, cdir, index); rap_ae = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,-1,1); + hypre_SetIndex3(index_temp, 0, -1, 1); MapIndex(index_temp, cdir, index); rap_as = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,1,1); + hypre_SetIndex3(index_temp, 0, 1, 1); MapIndex(index_temp, cdir, index); rap_an = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,1,0); + hypre_SetIndex3(index_temp, -1, 1, 0); MapIndex(index_temp, cdir, index); rap_cnw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,1,0); + hypre_SetIndex3(index_temp, 1, 1, 0); MapIndex(index_temp, cdir, index); rap_cne = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); @@ -5509,19 +5512,19 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS27_CC1( * rap_cnw is pointer for northwest coefficient in same plane (etc.) *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,-1,-1,1); + hypre_SetIndex3(index_temp, -1, -1, 1); MapIndex(index_temp, cdir, index); rap_asw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,-1,1); + hypre_SetIndex3(index_temp, 1, -1, 1); MapIndex(index_temp, cdir, index); rap_ase = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,1,1); + hypre_SetIndex3(index_temp, -1, 1, 1); MapIndex(index_temp, cdir, index); rap_anw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,1,1); + hypre_SetIndex3(index_temp, 1, 1, 1); MapIndex(index_temp, cdir, index); rap_ane = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); @@ -5533,18 +5536,18 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS27_CC1( * Offsets are used in refering to data associated with other points. *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); zOffsetA = 0; zOffsetP = 0; - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); yOffsetP = 0; - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); xOffsetP = 0; @@ -5573,88 +5576,88 @@ hypre_PFMG3BuildRAPNoSym_onebox_FSS27_CC1( iP1 = iP + zOffsetP + yOffsetP + xOffsetP; rap_ane[iAc] = ra[iR] * a_cne[iAp1] * pb[iP1] - + ra[iR] * a_ane[iAp1] - + a_ane[iA] * pb[iP1]; + + ra[iR] * a_ane[iAp1] + + a_ane[iA] * pb[iP1]; iP1 = iP + zOffsetP + yOffsetP; rap_an[iAc] = ra[iR] * a_cn[iAp1] * pb[iP1] - + ra[iR] * a_an[iAp1] - + a_an[iA] * pb[iP1]; + + ra[iR] * a_an[iAp1] + + a_an[iA] * pb[iP1]; iP1 = iP + zOffsetP + yOffsetP - xOffsetP; rap_anw[iAc] = ra[iR] * a_cnw[iAp1] * pb[iP1] - + ra[iR] * a_anw[iAp1] - + a_anw[iA] * pb[iP1]; + + ra[iR] * a_anw[iAp1] + + a_anw[iA] * pb[iP1]; iP1 = iP + zOffsetP + xOffsetP; rap_ae[iAc] = ra[iR] * a_ce[iAp1] * pb[iP1] - + ra[iR] * a_ae[iAp1] - + a_ae[iA] * pb[iP1]; + + ra[iR] * a_ae[iAp1] + + a_ae[iA] * pb[iP1]; iP1 = iP + zOffsetP; rap_ac[iAc] = a_ac[iA] * pb[iP1] - + ra[iR] * a_cc[iAp1] * pb[iP1] - + ra[iR] * a_ac[iAp1]; + + ra[iR] * a_cc[iAp1] * pb[iP1] + + ra[iR] * a_ac[iAp1]; iP1 = iP + zOffsetP - xOffsetP; rap_aw[iAc] = ra[iR] * a_cw[iAp1] * pb[iP1] - + ra[iR] * a_aw[iAp1] - + a_aw[iA] * pb[iP1]; + + ra[iR] * a_aw[iAp1] + + a_aw[iA] * pb[iP1]; iP1 = iP + zOffsetP - yOffsetP + xOffsetP; rap_ase[iAc] = ra[iR] * a_cse[iAp1] * pb[iP1] - + ra[iR] * a_ase[iAp1] - + a_ase[iA] * pb[iP1]; + + ra[iR] * a_ase[iAp1] + + a_ase[iA] * pb[iP1]; iP1 = iP + zOffsetP - yOffsetP; rap_as[iAc] = ra[iR] * a_cs[iAp1] * pb[iP1] - + ra[iR] * a_as[iAp1] - + a_as[iA] * pb[iP1]; + + ra[iR] * a_as[iAp1] + + a_as[iA] * pb[iP1]; iP1 = iP + zOffsetP - yOffsetP - xOffsetP; rap_asw[iAc] = ra[iR] * a_csw[iAp1] * pb[iP1] - + ra[iR] * a_asw[iAp1] - + a_asw[iA] * pb[iP1]; + + ra[iR] * a_asw[iAp1] + + a_asw[iA] * pb[iP1]; iP1 = iP + yOffsetP + xOffsetP; rap_cne[iAc] = a_cne[iA] - + rb[iR] * a_cne[iAm1] * pb[iP1] - + ra[iR] * a_cne[iAp1] * pa[iP1] - + a_bne[iA] * pb[iP1] - + a_ane[iA] * pa[iP1] - + rb[iR] * a_ane[iAm1] - + ra[iR] * a_bne[iAp1]; + + rb[iR] * a_cne[iAm1] * pb[iP1] + + ra[iR] * a_cne[iAp1] * pa[iP1] + + a_bne[iA] * pb[iP1] + + a_ane[iA] * pa[iP1] + + rb[iR] * a_ane[iAm1] + + ra[iR] * a_bne[iAp1]; iP1 = iP + yOffsetP; rap_cn[iAc] = a_cn[iA] - + rb[iR] * a_cn[iAm1] * pb[iP1] - + ra[iR] * a_cn[iAp1] * pa[iP1] - + a_bn[iA] * pb[iP1] - + a_an[iA] * pa[iP1] - + rb[iR] * a_an[iAm1] - + ra[iR] * a_bn[iAp1]; + + rb[iR] * a_cn[iAm1] * pb[iP1] + + ra[iR] * a_cn[iAp1] * pa[iP1] + + a_bn[iA] * pb[iP1] + + a_an[iA] * pa[iP1] + + rb[iR] * a_an[iAm1] + + ra[iR] * a_bn[iAp1]; iP1 = iP + yOffsetP - xOffsetP; rap_cnw[iAc] = a_cnw[iA] - + rb[iR] * a_cnw[iAm1] * pb[iP1] - + ra[iR] * a_cnw[iAp1] * pa[iP1] - + a_bnw[iA] * pb[iP1] - + a_anw[iA] * pa[iP1] - + rb[iR] * a_anw[iAm1] - + ra[iR] * a_bnw[iAp1]; + + rb[iR] * a_cnw[iAm1] * pb[iP1] + + ra[iR] * a_cnw[iAp1] * pa[iP1] + + a_bnw[iA] * pb[iP1] + + a_anw[iA] * pa[iP1] + + rb[iR] * a_anw[iAm1] + + ra[iR] * a_bnw[iAp1]; iP1 = iP + xOffsetP; rap_ce[iAc] = a_ce[iA] - + rb[iR] * a_ce[iAm1] * pb[iP1] - + ra[iR] * a_ce[iAp1] * pa[iP1] - + a_be[iA] * pb[iP1] - + a_ae[iA] * pa[iP1] - + rb[iR] * a_ae[iAm1] - + ra[iR] * a_be[iAp1]; + + rb[iR] * a_ce[iAm1] * pb[iP1] + + ra[iR] * a_ce[iAp1] * pa[iP1] + + a_be[iA] * pb[iP1] + + a_ae[iA] * pa[iP1] + + rb[iR] * a_ae[iAm1] + + ra[iR] * a_be[iAp1]; -/* }*/ /* end ForBoxI */ + /* }*/ /* end ForBoxI */ return hypre_error_flag; } diff --git a/external/hypre/src/struct_ls/pfmg_relax.c b/external/hypre/src/struct_ls/pfmg_relax.c index a75f10a8..04394a31 100644 --- a/external/hypre/src/struct_ls/pfmg_relax.c +++ b/external/hypre/src/struct_ls/pfmg_relax.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -42,7 +42,7 @@ hypre_PFMGRelaxCreate( MPI_Comm comm ) HYPRE_Int hypre_PFMGRelaxDestroy( void *pfmg_relax_vdata ) { - hypre_PFMGRelaxData *pfmg_relax_data = (hypre_PFMGRelaxData *)pfmg_relax_vdata; + hypre_PFMGRelaxData *pfmg_relax_data = (hypre_PFMGRelaxData *)pfmg_relax_vdata; if (pfmg_relax_data) { @@ -65,9 +65,9 @@ hypre_PFMGRelax( void *pfmg_relax_vdata, { hypre_PFMGRelaxData *pfmg_relax_data = (hypre_PFMGRelaxData *)pfmg_relax_vdata; HYPRE_Int relax_type = (pfmg_relax_data -> relax_type); - HYPRE_Int constant_coefficient= hypre_StructMatrixConstantCoefficient(A); + HYPRE_Int constant_coefficient = hypre_StructMatrixConstantCoefficient(A); - switch(relax_type) + switch (relax_type) { case 0: case 1: @@ -77,14 +77,14 @@ hypre_PFMGRelax( void *pfmg_relax_vdata, case 3: if (constant_coefficient) { - hypre_RedBlackConstantCoefGS((pfmg_relax_data -> rb_relax_data), + hypre_RedBlackConstantCoefGS((pfmg_relax_data -> rb_relax_data), A, b, x); } else { hypre_RedBlackGS((pfmg_relax_data -> rb_relax_data), A, b, x); } - + break; } @@ -102,9 +102,9 @@ hypre_PFMGRelaxSetup( void *pfmg_relax_vdata, { hypre_PFMGRelaxData *pfmg_relax_data = (hypre_PFMGRelaxData *)pfmg_relax_vdata; HYPRE_Int relax_type = (pfmg_relax_data -> relax_type); - HYPRE_Real jacobi_weight = (pfmg_relax_data -> jacobi_weight); + HYPRE_Real jacobi_weight = (pfmg_relax_data -> jacobi_weight); - switch(relax_type) + switch (relax_type) { case 0: case 1: @@ -116,11 +116,11 @@ hypre_PFMGRelaxSetup( void *pfmg_relax_vdata, break; } - if (relax_type==1) + if (relax_type == 1) { hypre_PointRelaxSetWeight(pfmg_relax_data -> relax_data, jacobi_weight); } - + return hypre_error_flag; } @@ -136,7 +136,7 @@ hypre_PFMGRelaxSetType( void *pfmg_relax_vdata, (pfmg_relax_data -> relax_type) = relax_type; - switch(relax_type) + switch (relax_type) { case 0: /* Jacobi */ { @@ -165,7 +165,7 @@ hypre_PFMGRelaxSetType( void *pfmg_relax_vdata, HYPRE_Int hypre_PFMGRelaxSetJacobiWeight(void *pfmg_relax_vdata, - HYPRE_Real weight) + HYPRE_Real weight) { hypre_PFMGRelaxData *pfmg_relax_data = (hypre_PFMGRelaxData *)pfmg_relax_vdata; @@ -183,7 +183,7 @@ hypre_PFMGRelaxSetPreRelax( void *pfmg_relax_vdata ) hypre_PFMGRelaxData *pfmg_relax_data = (hypre_PFMGRelaxData *)pfmg_relax_vdata; HYPRE_Int relax_type = (pfmg_relax_data -> relax_type); - switch(relax_type) + switch (relax_type) { case 1: /* Weighted Jacobi */ case 0: /* Jacobi */ @@ -210,7 +210,7 @@ hypre_PFMGRelaxSetPostRelax( void *pfmg_relax_vdata ) hypre_PFMGRelaxData *pfmg_relax_data = (hypre_PFMGRelaxData *)pfmg_relax_vdata; HYPRE_Int relax_type = (pfmg_relax_data -> relax_type); - switch(relax_type) + switch (relax_type) { case 1: /* Weighted Jacobi */ case 0: /* Jacobi */ diff --git a/external/hypre/src/struct_ls/pfmg_setup.c b/external/hypre/src/struct_ls/pfmg_setup.c index b3db006d..f6384d98 100644 --- a/external/hypre/src/struct_ls/pfmg_setup.c +++ b/external/hypre/src/struct_ls/pfmg_setup.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -70,7 +70,7 @@ hypre_PFMGSetup( void *pfmg_vdata, MPI_Comm comm = (pfmg_data -> comm); HYPRE_Int relax_type = (pfmg_data -> relax_type); - HYPRE_Int usr_jacobi_weight= (pfmg_data -> usr_jacobi_weight); + HYPRE_Int usr_jacobi_weight = (pfmg_data -> usr_jacobi_weight); HYPRE_Real jacobi_weight = (pfmg_data -> jacobi_weight); HYPRE_Int skip_relax = (pfmg_data -> skip_relax); HYPRE_Real *dxyz = (pfmg_data -> dxyz); @@ -129,19 +129,12 @@ hypre_PFMGSetup( void *pfmg_vdata, HYPRE_Int b_num_ghost[] = {0, 0, 0, 0, 0, 0}; HYPRE_Int x_num_ghost[] = {1, 1, 1, 1, 1, 1}; -#if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - HYPRE_Int num_level_GPU = 0; - HYPRE_MemoryLocation data_location = HYPRE_MEMORY_DEVICE; - HYPRE_Int max_box_size = 0; - HYPRE_Int device_level = (pfmg_data -> devicelevel); - HYPRE_Int myrank; - hypre_MPI_Comm_rank(comm, &myrank ); -#endif - #if DEBUG char filename[255]; #endif + HYPRE_MemoryLocation memory_location = hypre_StructMatrixMemoryLocation(A); + HYPRE_ANNOTATE_FUNC_BEGIN; /*----------------------------------------------------- @@ -184,8 +177,8 @@ hypre_PFMGSetup( void *pfmg_vdata, * the squares of the coefficients stored in 'deviation'. Care is * taken to avoid dividing by zero when the mean is zero. */ - deviation[d] -= mean[d]*mean[d]; - if ( deviation[d] > 0.1*(mean[d]*mean[d]) ) + deviation[d] -= mean[d] * mean[d]; + if ( deviation[d] > 0.1 * (mean[d]*mean[d]) ) { dxyz_flag = 1; break; @@ -232,7 +225,7 @@ hypre_PFMGSetup( void *pfmg_vdata, min_dxyz = dxyz[d]; cdir = d; } - alpha += 1.0/(dxyz[d]*dxyz[d]); + alpha += 1.0 / (dxyz[d] * dxyz[d]); } relax_weights[l] = 1.0; @@ -242,7 +235,7 @@ hypre_PFMGSetup( void *pfmg_vdata, { if (dxyz_flag) { - relax_weights[l] = 2.0/3.0; + relax_weights[l] = 2.0 / 3.0; } else @@ -251,7 +244,7 @@ hypre_PFMGSetup( void *pfmg_vdata, { if (d != cdir) { - beta += 1.0/(dxyz[d]*dxyz[d]); + beta += 1.0 / (dxyz[d] * dxyz[d]); } } if (beta == alpha) @@ -260,17 +253,17 @@ hypre_PFMGSetup( void *pfmg_vdata, } else { - alpha = beta/alpha; + alpha = beta / alpha; } /* determine level Jacobi weights */ if (ndim > 1) { - relax_weights[l] = 2.0/(3.0 - alpha); + relax_weights[l] = 2.0 / (3.0 - alpha); } else { - relax_weights[l] = 2.0/3.0; /* always 2/3 for 1-d */ + relax_weights[l] = 2.0 / 3.0; /* always 2/3 for 1-d */ } } } @@ -333,29 +326,29 @@ hypre_PFMGSetup( void *pfmg_vdata, hypre_BoxIMax(cbox)); /* build the interpolation grid */ - hypre_StructCoarsen(grid_l[l], findex, stride, 0, &P_grid_l[l+1]); + hypre_StructCoarsen(grid_l[l], findex, stride, 0, &P_grid_l[l + 1]); /* build the coarse grid */ - hypre_StructCoarsen(grid_l[l], cindex, stride, 1, &grid_l[l+1]); + hypre_StructCoarsen(grid_l[l], cindex, stride, 1, &grid_l[l + 1]); #if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - hypre_StructGridDataLocation(P_grid_l[l+1]) = data_location; + hypre_StructGridDataLocation(P_grid_l[l + 1]) = data_location; if (device_level == -1 && num_level_GPU > 0) { - max_box_size = hypre_StructGridGetMaxBoxSize(grid_l[l+1]); + max_box_size = hypre_StructGridGetMaxBoxSize(grid_l[l + 1]); if (max_box_size < HYPRE_MIN_GPU_SIZE) { - num_level_GPU = l+1; + num_level_GPU = l + 1; data_location = HYPRE_MEMORY_HOST; device_level = num_level_GPU; //printf("num_level_GPU = %d,device_level = %d / %d\n",num_level_GPU,device_level,num_levels); } } - else if (l+1 == device_level) + else if (l + 1 == device_level) { - num_level_GPU = l+1; + num_level_GPU = l + 1; data_location = HYPRE_MEMORY_HOST; } - hypre_StructGridDataLocation(grid_l[l+1]) = data_location; + hypre_StructGridDataLocation(grid_l[l + 1]) = data_location; #endif } @@ -389,7 +382,7 @@ hypre_PFMGSetup( void *pfmg_vdata, *-----------------------------------------------------*/ if (relax_type == 2 || relax_type == 3) /* red-black gs */ { - (pfmg_data -> rap_type)= 1; + (pfmg_data -> rap_type) = 1; } rap_type = (pfmg_data -> rap_type); @@ -416,7 +409,7 @@ hypre_PFMGSetup( void *pfmg_vdata, { cdir = cdir_l[l]; - P_l[l] = hypre_PFMGCreateInterpOp(A_l[l], P_grid_l[l+1], cdir, rap_type); + P_l[l] = hypre_PFMGCreateInterpOp(A_l[l], P_grid_l[l + 1], cdir, rap_type); hypre_StructMatrixInitializeShell(P_l[l]); data_size += hypre_StructMatrixDataSize(P_l[l]); data_size_const += hypre_StructMatrixDataConstSize(P_l[l]); @@ -431,46 +424,47 @@ hypre_PFMGSetup( void *pfmg_vdata, #if 0 /* Allow RT != P for non symmetric case */ /* NOTE: Need to create a non-pruned grid for this to work */ - RT_l[l] = hypre_PFMGCreateRestrictOp(A_l[l], grid_l[l+1], cdir); + RT_l[l] = hypre_PFMGCreateRestrictOp(A_l[l], grid_l[l + 1], cdir); hypre_StructMatrixInitializeShell(RT_l[l]); data_size += hypre_StructMatrixDataSize(RT_l[l]); data_size_const += hypre_StructMatrixDataConstSize(RT_l[l]); #endif } - A_l[l+1] = hypre_PFMGCreateRAPOp(RT_l[l], A_l[l], P_l[l], - grid_l[l+1], cdir, rap_type); - hypre_StructMatrixInitializeShell(A_l[l+1]); - data_size += hypre_StructMatrixDataSize(A_l[l+1]); - data_size_const += hypre_StructMatrixDataConstSize(A_l[l+1]); - - b_l[l+1] = hypre_StructVectorCreate(comm, grid_l[l+1]); - hypre_StructVectorSetNumGhost(b_l[l+1], b_num_ghost); - hypre_StructVectorInitializeShell(b_l[l+1]); - hypre_StructVectorSetDataSize(b_l[l+1], &data_size, &data_size_const); - - x_l[l+1] = hypre_StructVectorCreate(comm, grid_l[l+1]); - hypre_StructVectorSetNumGhost(x_l[l+1], x_num_ghost); - hypre_StructVectorInitializeShell(x_l[l+1]); - hypre_StructVectorSetDataSize(x_l[l+1], &data_size, &data_size_const); - - tx_l[l+1] = hypre_StructVectorCreate(comm, grid_l[l+1]); - hypre_StructVectorSetNumGhost(tx_l[l+1], x_num_ghost); - hypre_StructVectorInitializeShell(tx_l[l+1]); + A_l[l + 1] = hypre_PFMGCreateRAPOp(RT_l[l], A_l[l], P_l[l], + grid_l[l + 1], cdir, rap_type); + hypre_StructMatrixInitializeShell(A_l[l + 1]); + data_size += hypre_StructMatrixDataSize(A_l[l + 1]); + data_size_const += hypre_StructMatrixDataConstSize(A_l[l + 1]); + + b_l[l + 1] = hypre_StructVectorCreate(comm, grid_l[l + 1]); + hypre_StructVectorSetNumGhost(b_l[l + 1], b_num_ghost); + hypre_StructVectorInitializeShell(b_l[l + 1]); + hypre_StructVectorSetDataSize(b_l[l + 1], &data_size, &data_size_const); + + x_l[l + 1] = hypre_StructVectorCreate(comm, grid_l[l + 1]); + hypre_StructVectorSetNumGhost(x_l[l + 1], x_num_ghost); + hypre_StructVectorInitializeShell(x_l[l + 1]); + hypre_StructVectorSetDataSize(x_l[l + 1], &data_size, &data_size_const); + + tx_l[l + 1] = hypre_StructVectorCreate(comm, grid_l[l + 1]); + hypre_StructVectorSetNumGhost(tx_l[l + 1], x_num_ghost); + hypre_StructVectorInitializeShell(tx_l[l + 1]); #if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - if (l+1 == num_level_GPU) + if (l + 1 == num_level_GPU) { - hypre_StructVectorSetDataSize(tx_l[l+1], &data_size, &data_size_const); + hypre_StructVectorSetDataSize(tx_l[l + 1], &data_size, &data_size_const); } #endif } - data = hypre_CTAlloc(HYPRE_Real, data_size, HYPRE_MEMORY_DEVICE); + data = hypre_CTAlloc(HYPRE_Real, data_size, memory_location); data_const = hypre_CTAlloc(HYPRE_Real, data_size_const, HYPRE_MEMORY_HOST); #if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) //hypre_printf("num_level_GPU = %d,device_level = %d / %d\n",num_level_GPU,device_level,num_levels); #endif + (pfmg_data -> memory_location) = memory_location; (pfmg_data -> data) = data; (pfmg_data -> data_const) = data_const; @@ -511,60 +505,60 @@ hypre_PFMGSetup( void *pfmg_vdata, #endif #if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - if (l+1 == num_level_GPU) + if (l + 1 == num_level_GPU) { data_location = HYPRE_MEMORY_HOST; } #endif - hypre_StructMatrixInitializeData(A_l[l+1], data, data_const); - data += hypre_StructMatrixDataSize(A_l[l+1]); - data_const += hypre_StructMatrixDataConstSize(A_l[l+1]); + hypre_StructMatrixInitializeData(A_l[l + 1], data, data_const); + data += hypre_StructMatrixDataSize(A_l[l + 1]); + data_const += hypre_StructMatrixDataConstSize(A_l[l + 1]); #if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) if (data_location != HYPRE_MEMORY_HOST) { - hypre_StructVectorInitializeData(b_l[l+1], data); - hypre_StructVectorAssemble(b_l[l+1]); - data += hypre_StructVectorDataSize(b_l[l+1]); - - hypre_StructVectorInitializeData(x_l[l+1], data); - hypre_StructVectorAssemble(x_l[l+1]); - data += hypre_StructVectorDataSize(x_l[l+1]); - hypre_StructVectorInitializeData(tx_l[l+1], - hypre_StructVectorData(tx_l[0])); - hypre_StructVectorAssemble(tx_l[l+1]); + hypre_StructVectorInitializeData(b_l[l + 1], data); + hypre_StructVectorAssemble(b_l[l + 1]); + data += hypre_StructVectorDataSize(b_l[l + 1]); + + hypre_StructVectorInitializeData(x_l[l + 1], data); + hypre_StructVectorAssemble(x_l[l + 1]); + data += hypre_StructVectorDataSize(x_l[l + 1]); + hypre_StructVectorInitializeData(tx_l[l + 1], + hypre_StructVectorData(tx_l[0])); + hypre_StructVectorAssemble(tx_l[l + 1]); } else { - hypre_StructVectorInitializeData(b_l[l+1], data_const); - hypre_StructVectorAssemble(b_l[l+1]); - data_const += hypre_StructVectorDataSize(b_l[l+1]); - - hypre_StructVectorInitializeData(x_l[l+1], data_const); - hypre_StructVectorAssemble(x_l[l+1]); - data_const += hypre_StructVectorDataSize(x_l[l+1]); - if (l+1 == num_level_GPU) + hypre_StructVectorInitializeData(b_l[l + 1], data_const); + hypre_StructVectorAssemble(b_l[l + 1]); + data_const += hypre_StructVectorDataSize(b_l[l + 1]); + + hypre_StructVectorInitializeData(x_l[l + 1], data_const); + hypre_StructVectorAssemble(x_l[l + 1]); + data_const += hypre_StructVectorDataSize(x_l[l + 1]); + if (l + 1 == num_level_GPU) { - hypre_StructVectorInitializeData(tx_l[l+1], data_const); - hypre_StructVectorAssemble(tx_l[l+1]); - data_const += hypre_StructVectorDataSize(tx_l[l+1]); + hypre_StructVectorInitializeData(tx_l[l + 1], data_const); + hypre_StructVectorAssemble(tx_l[l + 1]); + data_const += hypre_StructVectorDataSize(tx_l[l + 1]); } - hypre_StructVectorInitializeData(tx_l[l+1], hypre_StructVectorData(tx_l[num_level_GPU])); - hypre_StructVectorAssemble(tx_l[l+1]); + hypre_StructVectorInitializeData(tx_l[l + 1], hypre_StructVectorData(tx_l[num_level_GPU])); + hypre_StructVectorAssemble(tx_l[l + 1]); } #else - hypre_StructVectorInitializeData(b_l[l+1], data); - hypre_StructVectorAssemble(b_l[l+1]); - data += hypre_StructVectorDataSize(b_l[l+1]); + hypre_StructVectorInitializeData(b_l[l + 1], data); + hypre_StructVectorAssemble(b_l[l + 1]); + data += hypre_StructVectorDataSize(b_l[l + 1]); - hypre_StructVectorInitializeData(x_l[l+1], data); - hypre_StructVectorAssemble(x_l[l+1]); - data += hypre_StructVectorDataSize(x_l[l+1]); + hypre_StructVectorInitializeData(x_l[l + 1], data); + hypre_StructVectorAssemble(x_l[l + 1]); + data += hypre_StructVectorDataSize(x_l[l + 1]); - hypre_StructVectorInitializeData(tx_l[l+1], + hypre_StructVectorInitializeData(tx_l[l + 1], hypre_StructVectorData(tx_l[0])); - hypre_StructVectorAssemble(tx_l[l+1]); + hypre_StructVectorAssemble(tx_l[l + 1]); #endif } @@ -588,6 +582,7 @@ hypre_PFMGSetup( void *pfmg_vdata, for (l = 0; l < (num_levels - 1); l++) { + HYPRE_ANNOTATE_MGLEVEL_BEGIN(l); #if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) if (l == num_level_GPU) { @@ -613,17 +608,19 @@ hypre_PFMGSetup( void *pfmg_vdata, /* set up the coarse grid operator */ hypre_PFMGSetupRAPOp(RT_l[l], A_l[l], P_l[l], - cdir, cindex, stride, rap_type, A_l[l+1]); + cdir, cindex, stride, rap_type, A_l[l + 1]); /* set up the interpolation routine */ interp_data_l[l] = hypre_SemiInterpCreate(); - hypre_SemiInterpSetup(interp_data_l[l], P_l[l], 0, x_l[l+1], e_l[l], + hypre_SemiInterpSetup(interp_data_l[l], P_l[l], 0, x_l[l + 1], e_l[l], cindex, findex, stride); /* set up the restriction routine */ restrict_data_l[l] = hypre_SemiRestrictCreate(); - hypre_SemiRestrictSetup(restrict_data_l[l], RT_l[l], 1, r_l[l], b_l[l+1], + hypre_SemiRestrictSetup(restrict_data_l[l], RT_l[l], 1, r_l[l], b_l[l + 1], cindex, findex, stride); + + HYPRE_ANNOTATE_MGLEVEL_END(l); } #if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) @@ -698,7 +695,7 @@ hypre_PFMGSetup( void *pfmg_vdata, hypre_PFMGRelaxSetType(relax_data_l[l], 0); /* do no more work on the coarsest grid than the cost of a V-cycle * (estimating roughly 4 communications per V-cycle level) */ - maxwork = 4*num_levels; + maxwork = 4 * num_levels; /* do sweeps proportional to the coarsest grid size */ maxiter = hypre_min(maxwork, cmaxsize); #if 0 @@ -860,7 +857,7 @@ hypre_PFMGComputeDxyz( hypre_StructMatrix *A, for (d = 0; d < 3; d++) { - mean[d]= cxyz[d] / tot_size; + mean[d] = cxyz[d] / tot_size; deviation[d] = sqcxyz[d] / tot_size; } } @@ -883,15 +880,15 @@ hypre_PFMGComputeDxyz( hypre_StructMatrix *A, /* Set dxyz values that are scaled appropriately for the coarsening routine */ for (d = 0; d < 3; d++) { - HYPRE_Real max_anisotropy = HYPRE_REAL_MAX/1000; - if (cxyz[d] > (cxyz_max/max_anisotropy)) + HYPRE_Real max_anisotropy = HYPRE_REAL_MAX / 1000; + if (cxyz[d] > (cxyz_max / max_anisotropy)) { cxyz[d] /= cxyz_max; - dxyz[d] = sqrt(1.0 / cxyz[d]); + dxyz[d] = hypre_sqrt(1.0 / cxyz[d]); } else { - dxyz[d] = sqrt(max_anisotropy); + dxyz[d] = hypre_sqrt(max_anisotropy); } } @@ -902,7 +899,7 @@ hypre_PFMGComputeDxyz( hypre_StructMatrix *A, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_PFMGComputeDxyz_CS( HYPRE_Int i, +hypre_PFMGComputeDxyz_CS( HYPRE_Int i, hypre_StructMatrix *A, HYPRE_Real *cxyz, HYPRE_Real *sqcxyz) @@ -913,12 +910,11 @@ hypre_PFMGComputeDxyz_CS( HYPRE_Int i, HYPRE_Int Ai; HYPRE_Real *Ap; HYPRE_Int constant_coefficient; - - HYPRE_Real tcx, tcy, tcz; - HYPRE_Real Adiag = 0, diag; - HYPRE_Int Astenc, sdiag = 0; - - HYPRE_Int si; + HYPRE_Real tcx, tcy, tcz; + HYPRE_Real Adiag = 0, diag; + HYPRE_Int Astenc, sdiag = 0; + HYPRE_Int si; + HYPRE_MemoryLocation memory_location = hypre_StructMatrixMemoryLocation(A); stencil = hypre_StructMatrixStencil(A); stencil_shape = hypre_StructStencilShape(stencil); @@ -945,13 +941,13 @@ hypre_PFMGComputeDxyz_CS( HYPRE_Int i, /* get sign of diagonal */ Ap = hypre_StructMatrixBoxData(A, i, sdiag); - if (constant_coefficient==1) + if (constant_coefficient == 1) { Adiag = Ap[Ai]; } - else if (constant_coefficient==2) + else if (constant_coefficient == 2) { - hypre_TMemcpy(&Adiag,&Ap[Ai],HYPRE_Real,1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(&Adiag, &Ap[Ai], HYPRE_Real, 1, HYPRE_MEMORY_HOST, memory_location); } diag = 1.0; @@ -968,21 +964,21 @@ hypre_PFMGComputeDxyz_CS( HYPRE_Int i, Astenc = hypre_IndexD(stencil_shape[si], 0); if (Astenc) { - tcx -= Ap[Ai]*diag; + tcx -= Ap[Ai] * diag; } /* y-direction */ Astenc = hypre_IndexD(stencil_shape[si], 1); if (Astenc) { - tcy -= Ap[Ai]*diag; + tcy -= Ap[Ai] * diag; } /* z-direction */ Astenc = hypre_IndexD(stencil_shape[si], 2); if (Astenc) { - tcz -= Ap[Ai]*diag; + tcz -= Ap[Ai] * diag; } } @@ -1016,7 +1012,7 @@ hypre_PFMGComputeDxyz_SS5( HYPRE_Int bi, HYPRE_Real *a_cc, *a_cw, *a_ce, *a_cs, *a_cn; #if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) HYPRE_Int data_location = hypre_StructGridDataLocation( - hypre_StructMatrixGrid(A) ); + hypre_StructMatrixGrid(A) ); #endif hypre_SetIndex3(stride, 1, 1, 1); @@ -1051,8 +1047,8 @@ hypre_PFMGComputeDxyz_SS5( HYPRE_Int bi, hypre_SetIndex3(index, 0, 1, 0); a_cn = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - // FIXME TODO HOW TO DO KOKKOS IN ONE BOXLOOP ? -#if defined(HYPRE_USING_KOKKOS) + // FIXME TODO HOW TO DO KOKKOS (WM: and SYCL) IN ONE BOXLOOP ? +#if defined(HYPRE_USING_KOKKOS) || defined(HYPRE_USING_SYCL) HYPRE_Real cxb = cxyz[0]; hypre_BoxLoop1ReductionBegin(hypre_StructMatrixNDim(A), loop_size, @@ -1094,10 +1090,11 @@ hypre_PFMGComputeDxyz_SS5( HYPRE_Int bi, } hypre_BoxLoop1ReductionEnd(Ai, sqcyb) -#else /* kokkos */ +#else // #if defined(HYPRE_USING_KOKKOS) || defined(HYPRE_USING_SYCL) #if defined(HYPRE_USING_RAJA) - ReduceSum cxb(cxyz[0]),cyb(cxyz[1]),sqcxb(sqcxyz[0]),sqcyb(sqcxyz[1]); + ReduceSum cxb(cxyz[0]), cyb(cxyz[1]), sqcxb(sqcxyz[0]), + sqcyb(sqcxyz[1]); #elif defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) HYPRE_double4 d4(cxyz[0], cxyz[1], sqcxyz[0], sqcxyz[1]); ReduceSum sum4(d4); @@ -1130,7 +1127,7 @@ hypre_PFMGComputeDxyz_SS5( HYPRE_Int bi, tcy = -diag * (a_cn[Ai] + a_cs[Ai]); #if !defined(HYPRE_USING_RAJA) && (defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP)) - HYPRE_double4 tmp(tcx, tcy, tcx*tcx, tcy*tcy); + HYPRE_double4 tmp(tcx, tcy, tcx * tcx, tcy * tcy); sum4 += tmp; #else cxb += tcx; @@ -1184,7 +1181,7 @@ hypre_PFMGComputeDxyz_SS9( HYPRE_Int bi, HYPRE_Real *a_csw, *a_cse, *a_cne, *a_cnw; #if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) HYPRE_Int data_location = hypre_StructGridDataLocation( - hypre_StructMatrixGrid(A) ); + hypre_StructMatrixGrid(A) ); #endif hypre_SetIndex3(stride, 1, 1, 1); @@ -1204,19 +1201,19 @@ hypre_PFMGComputeDxyz_SS9( HYPRE_Int bi, * a_cn is pointer for north coefficient *-----------------------------------------------------------------*/ - hypre_SetIndex3(index,0,0,0); + hypre_SetIndex3(index, 0, 0, 0); a_cc = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index,-1,0,0); + hypre_SetIndex3(index, -1, 0, 0); a_cw = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index,1,0,0); + hypre_SetIndex3(index, 1, 0, 0); a_ce = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index,0,-1,0); + hypre_SetIndex3(index, 0, -1, 0); a_cs = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index,0,1,0); + hypre_SetIndex3(index, 0, 1, 0); a_cn = hypre_StructMatrixExtractPointerByIndex(A, bi, index); /*----------------------------------------------------------------- @@ -1228,20 +1225,20 @@ hypre_PFMGComputeDxyz_SS9( HYPRE_Int bi, * a_cne is pointer for northeast coefficient *-----------------------------------------------------------------*/ - hypre_SetIndex3(index,-1,-1, 0); + hypre_SetIndex3(index, -1, -1, 0); a_csw = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index, 1,-1, 0); + hypre_SetIndex3(index, 1, -1, 0); a_cse = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index,-1, 1, 0); + hypre_SetIndex3(index, -1, 1, 0); a_cnw = hypre_StructMatrixExtractPointerByIndex(A, bi, index); hypre_SetIndex3(index, 1, 1, 0); a_cne = hypre_StructMatrixExtractPointerByIndex(A, bi, index); // FIXME TODO HOW TO DO KOKKOS IN ONE BOXLOOP ? -#if defined(HYPRE_USING_KOKKOS) +#if defined(HYPRE_USING_KOKKOS) || defined(HYPRE_USING_SYCL) HYPRE_Real cxb = cxyz[0]; hypre_BoxLoop1ReductionBegin(hypre_StructMatrixNDim(A), loop_size, @@ -1269,7 +1266,7 @@ hypre_PFMGComputeDxyz_SS9( HYPRE_Int bi, { HYPRE_Real diag = a_cc[Ai] < 0.0 ? -1.0 : 1.0; HYPRE_Real tcx = -diag * (a_cw[Ai] + a_ce[Ai] + a_csw[Ai] + a_cse[Ai] + a_cnw[Ai] + a_cne[Ai]); - sqcxb += tcx*tcx; + sqcxb += tcx * tcx; } hypre_BoxLoop1ReductionEnd(Ai, sqcxb) @@ -1279,14 +1276,15 @@ hypre_PFMGComputeDxyz_SS9( HYPRE_Int bi, { HYPRE_Real diag = a_cc[Ai] < 0.0 ? -1.0 : 1.0; HYPRE_Real tcy = -diag * (a_cs[Ai] + a_cn[Ai] + a_csw[Ai] + a_cse[Ai] + a_cnw[Ai] + a_cne[Ai]); - sqcyb += tcy*tcy; + sqcyb += tcy * tcy; } hypre_BoxLoop1ReductionEnd(Ai, sqcyb) #else /* kokkos */ #if defined(HYPRE_USING_RAJA) - ReduceSum cxb(cxyz[0]),cyb(cxyz[1]),sqcxb(sqcxyz[0]),sqcyb(sqcxyz[1]); + ReduceSum cxb(cxyz[0]), cyb(cxyz[1]), sqcxb(sqcxyz[0]), + sqcyb(sqcxyz[1]); #elif defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) HYPRE_double4 d4(cxyz[0], cxyz[1], sqcxyz[0], sqcxyz[1]); ReduceSum sum4(d4); @@ -1313,20 +1311,20 @@ hypre_PFMGComputeDxyz_SS9( HYPRE_Int bi, hypre_BoxLoop1ReductionBegin(hypre_StructMatrixNDim(A), loop_size, A_dbox, start, stride, Ai, sum4) { - HYPRE_Real tcx, tcy; - HYPRE_Real diag = a_cc[Ai] < 0.0 ? -1.0 : 1.0; + HYPRE_Real tcx, tcy; + HYPRE_Real diag = a_cc[Ai] < 0.0 ? -1.0 : 1.0; - tcx = -diag * (a_cw[Ai] + a_ce[Ai] + a_csw[Ai] + a_cse[Ai] + a_cnw[Ai] + a_cne[Ai]); - tcy = -diag * (a_cs[Ai] + a_cn[Ai] + a_csw[Ai] + a_cse[Ai] + a_cnw[Ai] + a_cne[Ai]); + tcx = -diag * (a_cw[Ai] + a_ce[Ai] + a_csw[Ai] + a_cse[Ai] + a_cnw[Ai] + a_cne[Ai]); + tcy = -diag * (a_cs[Ai] + a_cn[Ai] + a_csw[Ai] + a_cse[Ai] + a_cnw[Ai] + a_cne[Ai]); #if !defined(HYPRE_USING_RAJA) && (defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP)) - HYPRE_double4 tmp(tcx, tcy, tcx*tcx, tcy*tcy); - sum4 += tmp; + HYPRE_double4 tmp(tcx, tcy, tcx * tcx, tcy * tcy); + sum4 += tmp; #else - cxb += tcx; - cyb += tcy; - sqcxb += tcx * tcx; - sqcyb += tcy * tcy; + cxb += tcx; + cyb += tcy; + sqcxb += tcx * tcx; + sqcyb += tcy * tcy; #endif } hypre_BoxLoop1ReductionEnd(Ai, sum4) @@ -1372,7 +1370,7 @@ hypre_PFMGComputeDxyz_SS7( HYPRE_Int bi, HYPRE_Real *a_cc, *a_cw, *a_ce, *a_cs, *a_cn, *a_ac, *a_bc; #if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) HYPRE_Int data_location = hypre_StructGridDataLocation( - hypre_StructMatrixGrid(A) ); + hypre_StructMatrixGrid(A) ); #endif hypre_SetIndex3(stride, 1, 1, 1); @@ -1394,29 +1392,29 @@ hypre_PFMGComputeDxyz_SS7( HYPRE_Int bi, * a_bc is pointer for center coefficient in plane below *-----------------------------------------------------------------*/ - hypre_SetIndex3(index,0,0,0); + hypre_SetIndex3(index, 0, 0, 0); a_cc = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index,-1,0,0); + hypre_SetIndex3(index, -1, 0, 0); a_cw = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index,1,0,0); + hypre_SetIndex3(index, 1, 0, 0); a_ce = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index,0,-1,0); + hypre_SetIndex3(index, 0, -1, 0); a_cs = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index,0,1,0); + hypre_SetIndex3(index, 0, 1, 0); a_cn = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index,0,0,1); + hypre_SetIndex3(index, 0, 0, 1); a_ac = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index,0,0,-1); + hypre_SetIndex3(index, 0, 0, -1); a_bc = hypre_StructMatrixExtractPointerByIndex(A, bi, index); // FIXME TODO HOW TO DO KOKKOS IN ONE BOXLOOP ? -#if defined(HYPRE_USING_KOKKOS) +#if defined(HYPRE_USING_KOKKOS) || defined(HYPRE_USING_SYCL) HYPRE_Real cxb = cxyz[0]; hypre_BoxLoop1ReductionBegin(hypre_StructMatrixNDim(A), loop_size, @@ -1454,7 +1452,7 @@ hypre_PFMGComputeDxyz_SS7( HYPRE_Int bi, { HYPRE_Real diag = a_cc[Ai] < 0.0 ? -1.0 : 1.0; HYPRE_Real tcx = -diag * (a_cw[Ai] + a_ce[Ai]); - sqcxb += tcx*tcx; + sqcxb += tcx * tcx; } hypre_BoxLoop1ReductionEnd(Ai, sqcxb) @@ -1464,7 +1462,7 @@ hypre_PFMGComputeDxyz_SS7( HYPRE_Int bi, { HYPRE_Real diag = a_cc[Ai] < 0.0 ? -1.0 : 1.0; HYPRE_Real tcy = -diag * (a_cs[Ai] + a_cn[Ai]); - sqcyb += tcy*tcy; + sqcyb += tcy * tcy; } hypre_BoxLoop1ReductionEnd(Ai, sqcyb) @@ -1474,14 +1472,15 @@ hypre_PFMGComputeDxyz_SS7( HYPRE_Int bi, { HYPRE_Real diag = a_cc[Ai] < 0.0 ? -1.0 : 1.0; HYPRE_Real tcz = -diag * (a_ac[Ai] + a_bc[Ai]); - sqczb += tcz*tcz; + sqczb += tcz * tcz; } hypre_BoxLoop1ReductionEnd(Ai, sqczb) #else /* kokkos */ #if defined(HYPRE_USING_RAJA) - ReduceSum cxb(cxyz[0]),cyb(cxyz[1]),czb(cxyz[2]),sqcxb(sqcxyz[0]),sqcyb(sqcxyz[1]), sqczb(sqcxyz[2]); + ReduceSum cxb(cxyz[0]), cyb(cxyz[1]), czb(cxyz[2]), + sqcxb(sqcxyz[0]), sqcyb(sqcxyz[1]), sqczb(sqcxyz[2]); #elif defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) HYPRE_double6 d6(cxyz[0], cxyz[1], cxyz[2], sqcxyz[0], sqcxyz[1], sqcxyz[2]); ReduceSum sum6(d6); @@ -1517,7 +1516,7 @@ hypre_PFMGComputeDxyz_SS7( HYPRE_Int bi, tcy = -diag * (a_cs[Ai] + a_cn[Ai]); tcz = -diag * (a_ac[Ai] + a_bc[Ai]); #if !defined(HYPRE_USING_RAJA) && (defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP)) - HYPRE_double6 tmp(tcx, tcy, tcz, tcx*tcx, tcy*tcy, tcz*tcz); + HYPRE_double6 tmp(tcx, tcy, tcz, tcx * tcx, tcy * tcy, tcz * tcz); sum6 += tmp; #else cxb += tcx; @@ -1574,7 +1573,7 @@ hypre_PFMGComputeDxyz_SS19( HYPRE_Int bi, HYPRE_Real *a_aw, *a_ae, *a_as, *a_an, *a_bw, *a_be, *a_bs, *a_bn; #if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) HYPRE_Int data_location = hypre_StructGridDataLocation( - hypre_StructMatrixGrid(A) ); + hypre_StructMatrixGrid(A) ); #endif hypre_SetIndex3(stride, 1, 1, 1); @@ -1596,25 +1595,25 @@ hypre_PFMGComputeDxyz_SS19( HYPRE_Int bi, * a_bc is pointer for center coefficient in plane below *-----------------------------------------------------------------*/ - hypre_SetIndex3(index,0,0,0); + hypre_SetIndex3(index, 0, 0, 0); a_cc = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index,-1,0,0); + hypre_SetIndex3(index, -1, 0, 0); a_cw = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index,1,0,0); + hypre_SetIndex3(index, 1, 0, 0); a_ce = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index,0,-1,0); + hypre_SetIndex3(index, 0, -1, 0); a_cs = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index,0,1,0); + hypre_SetIndex3(index, 0, 1, 0); a_cn = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index,0,0,1); + hypre_SetIndex3(index, 0, 0, 1); a_ac = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index,0,0,-1); + hypre_SetIndex3(index, 0, 0, -1); a_bc = hypre_StructMatrixExtractPointerByIndex(A, bi, index); /*----------------------------------------------------------------- @@ -1634,52 +1633,53 @@ hypre_PFMGComputeDxyz_SS19( HYPRE_Int bi, * a_cne is pointer for northeast coefficient in same plane *-----------------------------------------------------------------*/ - hypre_SetIndex3(index,-1, 0, 1); + hypre_SetIndex3(index, -1, 0, 1); a_aw = hypre_StructMatrixExtractPointerByIndex(A, bi, index); hypre_SetIndex3(index, 1, 0, 1); a_ae = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index, 0,-1, 1); + hypre_SetIndex3(index, 0, -1, 1); a_as = hypre_StructMatrixExtractPointerByIndex(A, bi, index); hypre_SetIndex3(index, 0, 1, 1); a_an = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index,-1, 0,-1); + hypre_SetIndex3(index, -1, 0, -1); a_bw = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index, 1, 0,-1); + hypre_SetIndex3(index, 1, 0, -1); a_be = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index, 0,-1,-1); + hypre_SetIndex3(index, 0, -1, -1); a_bs = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index, 0, 1,-1); + hypre_SetIndex3(index, 0, 1, -1); a_bn = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index,-1,-1, 0); + hypre_SetIndex3(index, -1, -1, 0); a_csw = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index, 1,-1, 0); + hypre_SetIndex3(index, 1, -1, 0); a_cse = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index,-1, 1, 0); + hypre_SetIndex3(index, -1, 1, 0); a_cnw = hypre_StructMatrixExtractPointerByIndex(A, bi, index); hypre_SetIndex3(index, 1, 1, 0); a_cne = hypre_StructMatrixExtractPointerByIndex(A, bi, index); // FIXME TODO HOW TO DO KOKKOS IN ONE BOXLOOP ? -#if defined(HYPRE_USING_KOKKOS) +#if defined(HYPRE_USING_KOKKOS) || defined(HYPRE_USING_SYCL) HYPRE_Real cxb = cxyz[0]; hypre_BoxLoop1ReductionBegin(hypre_StructMatrixNDim(A), loop_size, A_dbox, start, stride, Ai, cxb) { - HYPRE_Real diag = a_cc[Ai] < 0.0 ? -1.0 : 1.0; - HYPRE_Real tcx = -diag * (a_cw[Ai] + a_ce[Ai] + a_aw[Ai] + a_ae[Ai] + a_bw[Ai] + a_be[Ai] + a_csw[Ai] + a_cse[Ai] + a_cnw[Ai] + a_cne[Ai]); - cxb += tcx; + HYPRE_Real diag = a_cc[Ai] < 0.0 ? -1.0 : 1.0; + HYPRE_Real tcx = -diag * (a_cw[Ai] + a_ce[Ai] + a_aw[Ai] + a_ae[Ai] + a_bw[Ai] + a_be[Ai] + + a_csw[Ai] + a_cse[Ai] + a_cnw[Ai] + a_cne[Ai]); + cxb += tcx; } hypre_BoxLoop1ReductionEnd(Ai, cxb) @@ -1688,7 +1688,8 @@ hypre_PFMGComputeDxyz_SS19( HYPRE_Int bi, A_dbox, start, stride, Ai, cyb) { HYPRE_Real diag = a_cc[Ai] < 0.0 ? -1.0 : 1.0; - HYPRE_Real tcy = -diag * (a_cs[Ai] + a_cn[Ai] + a_an[Ai] + a_as[Ai] + a_bn[Ai] + a_bs[Ai] + a_csw[Ai] + a_cse[Ai] + a_cnw[Ai] + a_cne[Ai]); + HYPRE_Real tcy = -diag * (a_cs[Ai] + a_cn[Ai] + a_an[Ai] + a_as[Ai] + a_bn[Ai] + a_bs[Ai] + + a_csw[Ai] + a_cse[Ai] + a_cnw[Ai] + a_cne[Ai]); cyb += tcy; } hypre_BoxLoop1ReductionEnd(Ai, cyb) @@ -1698,7 +1699,8 @@ hypre_PFMGComputeDxyz_SS19( HYPRE_Int bi, A_dbox, start, stride, Ai, czb) { HYPRE_Real diag = a_cc[Ai] < 0.0 ? -1.0 : 1.0; - HYPRE_Real tcz = -diag * (a_ac[Ai] + a_bc[Ai] + a_aw[Ai] + a_ae[Ai] + a_an[Ai] + a_as[Ai] + a_bw[Ai] + a_be[Ai] + a_bn[Ai] + a_bs[Ai]); + HYPRE_Real tcz = -diag * (a_ac[Ai] + a_bc[Ai] + a_aw[Ai] + a_ae[Ai] + a_an[Ai] + a_as[Ai] + + a_bw[Ai] + a_be[Ai] + a_bn[Ai] + a_bs[Ai]); czb += tcz; } hypre_BoxLoop1ReductionEnd(Ai, czb) @@ -1708,8 +1710,9 @@ hypre_PFMGComputeDxyz_SS19( HYPRE_Int bi, A_dbox, start, stride, Ai, sqcxb) { HYPRE_Real diag = a_cc[Ai] < 0.0 ? -1.0 : 1.0; - HYPRE_Real tcx = -diag * (a_cw[Ai] + a_ce[Ai] + a_aw[Ai] + a_ae[Ai] + a_bw[Ai] + a_be[Ai] + a_csw[Ai] + a_cse[Ai] + a_cnw[Ai] + a_cne[Ai]); - sqcxb += tcx*tcx; + HYPRE_Real tcx = -diag * (a_cw[Ai] + a_ce[Ai] + a_aw[Ai] + a_ae[Ai] + a_bw[Ai] + a_be[Ai] + + a_csw[Ai] + a_cse[Ai] + a_cnw[Ai] + a_cne[Ai]); + sqcxb += tcx * tcx; } hypre_BoxLoop1ReductionEnd(Ai, sqcxb) @@ -1718,8 +1721,9 @@ hypre_PFMGComputeDxyz_SS19( HYPRE_Int bi, A_dbox, start, stride, Ai, sqcyb) { HYPRE_Real diag = a_cc[Ai] < 0.0 ? -1.0 : 1.0; - HYPRE_Real tcy = -diag * (a_cs[Ai] + a_cn[Ai] + a_an[Ai] + a_as[Ai] + a_bn[Ai] + a_bs[Ai] + a_csw[Ai] + a_cse[Ai] + a_cnw[Ai] + a_cne[Ai]); - sqcyb += tcy*tcy; + HYPRE_Real tcy = -diag * (a_cs[Ai] + a_cn[Ai] + a_an[Ai] + a_as[Ai] + a_bn[Ai] + a_bs[Ai] + + a_csw[Ai] + a_cse[Ai] + a_cnw[Ai] + a_cne[Ai]); + sqcyb += tcy * tcy; } hypre_BoxLoop1ReductionEnd(Ai, sqcyb) @@ -1728,15 +1732,17 @@ hypre_PFMGComputeDxyz_SS19( HYPRE_Int bi, A_dbox, start, stride, Ai, sqczb) { HYPRE_Real diag = a_cc[Ai] < 0.0 ? -1.0 : 1.0; - HYPRE_Real tcz = -diag * (a_ac[Ai] + a_bc[Ai] + a_aw[Ai] + a_ae[Ai] + a_an[Ai] + a_as[Ai] + a_bw[Ai] + a_be[Ai] + a_bn[Ai] + a_bs[Ai]); - sqczb += tcz*tcz; + HYPRE_Real tcz = -diag * (a_ac[Ai] + a_bc[Ai] + a_aw[Ai] + a_ae[Ai] + a_an[Ai] + a_as[Ai] + + a_bw[Ai] + a_be[Ai] + a_bn[Ai] + a_bs[Ai]); + sqczb += tcz * tcz; } hypre_BoxLoop1ReductionEnd(Ai, sqczb) #else /* kokkos */ #if defined(HYPRE_USING_RAJA) - ReduceSum cxb(cxyz[0]),cyb(cxyz[1]),czb(cxyz[2]),sqcxb(sqcxyz[0]),sqcyb(sqcxyz[1]), sqczb(sqcxyz[2]); + ReduceSum cxb(cxyz[0]), cyb(cxyz[1]), czb(cxyz[2]), + sqcxb(sqcxyz[0]), sqcyb(sqcxyz[1]), sqczb(sqcxyz[2]); #elif defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) HYPRE_double6 d6(cxyz[0], cxyz[1], cxyz[2], sqcxyz[0], sqcxyz[1], sqcxyz[2]); ReduceSum sum6(d6); @@ -1768,12 +1774,15 @@ hypre_PFMGComputeDxyz_SS19( HYPRE_Int bi, HYPRE_Real tcx, tcy, tcz; HYPRE_Real diag = a_cc[Ai] < 0.0 ? -1.0 : 1.0; - tcx = -diag * (a_cw[Ai] + a_ce[Ai] + a_aw[Ai] + a_ae[Ai] + a_bw[Ai] + a_be[Ai] + a_csw[Ai] + a_cse[Ai] + a_cnw[Ai] + a_cne[Ai]); - tcy = -diag * (a_cs[Ai] + a_cn[Ai] + a_an[Ai] + a_as[Ai] + a_bn[Ai] + a_bs[Ai] + a_csw[Ai] + a_cse[Ai] + a_cnw[Ai] + a_cne[Ai]); - tcz = -diag * (a_ac[Ai] + a_bc[Ai] + a_aw[Ai] + a_ae[Ai] + a_an[Ai] + a_as[Ai] + a_bw[Ai] + a_be[Ai] + a_bn[Ai] + a_bs[Ai]); + tcx = -diag * (a_cw[Ai] + a_ce[Ai] + a_aw[Ai] + a_ae[Ai] + a_bw[Ai] + a_be[Ai] + a_csw[Ai] + + a_cse[Ai] + a_cnw[Ai] + a_cne[Ai]); + tcy = -diag * (a_cs[Ai] + a_cn[Ai] + a_an[Ai] + a_as[Ai] + a_bn[Ai] + a_bs[Ai] + a_csw[Ai] + + a_cse[Ai] + a_cnw[Ai] + a_cne[Ai]); + tcz = -diag * (a_ac[Ai] + a_bc[Ai] + a_aw[Ai] + a_ae[Ai] + a_an[Ai] + a_as[Ai] + a_bw[Ai] + + a_be[Ai] + a_bn[Ai] + a_bs[Ai]); #if !defined(HYPRE_USING_RAJA) && (defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP)) - HYPRE_double6 tmp(tcx, tcy, tcz, tcx*tcx, tcy*tcy, tcz*tcz); + HYPRE_double6 tmp(tcx, tcy, tcz, tcx * tcx, tcy * tcy, tcz * tcz); sum6 += tmp; #else cxb += tcx; @@ -1829,11 +1838,11 @@ hypre_PFMGComputeDxyz_SS27( HYPRE_Int bi, HYPRE_Real *a_cc, *a_cw, *a_ce, *a_cs, *a_cn, *a_ac, *a_bc; HYPRE_Real *a_csw, *a_cse, *a_cne, *a_cnw; HYPRE_Real *a_aw, *a_ae, *a_as, *a_an, *a_bw, *a_be, *a_bs, *a_bn; - HYPRE_Real *a_asw, *a_ase, *a_ane, *a_anw,*a_bsw, *a_bse, *a_bne, *a_bnw; + HYPRE_Real *a_asw, *a_ase, *a_ane, *a_anw, *a_bsw, *a_bse, *a_bne, *a_bnw; #if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) HYPRE_Int data_location = hypre_StructGridDataLocation( - hypre_StructMatrixGrid(A) ); + hypre_StructMatrixGrid(A) ); #endif hypre_SetIndex3(stride, 1, 1, 1); @@ -1855,25 +1864,25 @@ hypre_PFMGComputeDxyz_SS27( HYPRE_Int bi, * a_bc is pointer for center coefficient in plane below *-----------------------------------------------------------------*/ - hypre_SetIndex3(index,0,0,0); + hypre_SetIndex3(index, 0, 0, 0); a_cc = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index,-1,0,0); + hypre_SetIndex3(index, -1, 0, 0); a_cw = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index,1,0,0); + hypre_SetIndex3(index, 1, 0, 0); a_ce = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index,0,-1,0); + hypre_SetIndex3(index, 0, -1, 0); a_cs = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index,0,1,0); + hypre_SetIndex3(index, 0, 1, 0); a_cn = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index,0,0,1); + hypre_SetIndex3(index, 0, 0, 1); a_ac = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index,0,0,-1); + hypre_SetIndex3(index, 0, 0, -1); a_bc = hypre_StructMatrixExtractPointerByIndex(A, bi, index); /*----------------------------------------------------------------- @@ -1893,37 +1902,37 @@ hypre_PFMGComputeDxyz_SS27( HYPRE_Int bi, * a_cne is pointer for northeast coefficient in same plane *-----------------------------------------------------------------*/ - hypre_SetIndex3(index,-1, 0, 1); + hypre_SetIndex3(index, -1, 0, 1); a_aw = hypre_StructMatrixExtractPointerByIndex(A, bi, index); hypre_SetIndex3(index, 1, 0, 1); a_ae = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index, 0,-1, 1); + hypre_SetIndex3(index, 0, -1, 1); a_as = hypre_StructMatrixExtractPointerByIndex(A, bi, index); hypre_SetIndex3(index, 0, 1, 1); a_an = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index,-1, 0,-1); + hypre_SetIndex3(index, -1, 0, -1); a_bw = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index, 1, 0,-1); + hypre_SetIndex3(index, 1, 0, -1); a_be = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index, 0,-1,-1); + hypre_SetIndex3(index, 0, -1, -1); a_bs = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index, 0, 1,-1); + hypre_SetIndex3(index, 0, 1, -1); a_bn = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index,-1,-1, 0); + hypre_SetIndex3(index, -1, -1, 0); a_csw = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index, 1,-1, 0); + hypre_SetIndex3(index, 1, -1, 0); a_cse = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index,-1, 1, 0); + hypre_SetIndex3(index, -1, 1, 0); a_cnw = hypre_StructMatrixExtractPointerByIndex(A, bi, index); hypre_SetIndex3(index, 1, 1, 0); @@ -1942,32 +1951,32 @@ hypre_PFMGComputeDxyz_SS27( HYPRE_Int bi, * a_bne is pointer for northeast coefficient in plane below *-----------------------------------------------------------------*/ - hypre_SetIndex3(index,-1,-1, 1); + hypre_SetIndex3(index, -1, -1, 1); a_asw = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index, 1,-1, 1); + hypre_SetIndex3(index, 1, -1, 1); a_ase = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index,-1, 1, 1); + hypre_SetIndex3(index, -1, 1, 1); a_anw = hypre_StructMatrixExtractPointerByIndex(A, bi, index); hypre_SetIndex3(index, 1, 1, 1); a_ane = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index,-1,-1,-1); + hypre_SetIndex3(index, -1, -1, -1); a_bsw = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index, 1,-1,-1); + hypre_SetIndex3(index, 1, -1, -1); a_bse = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index,-1, 1,-1); + hypre_SetIndex3(index, -1, 1, -1); a_bnw = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - hypre_SetIndex3(index, 1, 1,-1); + hypre_SetIndex3(index, 1, 1, -1); a_bne = hypre_StructMatrixExtractPointerByIndex(A, bi, index); // FIXME TODO HOW TO DO KOKKOS IN ONE BOXLOOP ? -#if defined(HYPRE_USING_KOKKOS) +#if defined(HYPRE_USING_KOKKOS) || defined(HYPRE_USING_SYCL) HYPRE_Real cxb = cxyz[0]; hypre_BoxLoop1ReductionBegin(hypre_StructMatrixNDim(A), loop_size, @@ -1975,8 +1984,10 @@ hypre_PFMGComputeDxyz_SS27( HYPRE_Int bi, { HYPRE_Real tcx = 0.0; HYPRE_Real diag = a_cc[Ai] < 0.0 ? -1.0 : 1.0; - tcx -= diag * (a_cw[Ai] + a_ce[Ai] + a_aw[Ai] + a_ae[Ai] + a_bw[Ai] + a_be[Ai] + a_csw[Ai] + a_cse[Ai] + a_cnw[Ai] + a_cne[Ai]); - tcx -= diag * (a_asw[Ai] + a_ase[Ai] + a_anw[Ai] + a_ane[Ai] + a_bsw[Ai] + a_bse[Ai] + a_bnw[Ai] + a_bne[Ai]); + tcx -= diag * (a_cw[Ai] + a_ce[Ai] + a_aw[Ai] + a_ae[Ai] + a_bw[Ai] + a_be[Ai] + a_csw[Ai] + + a_cse[Ai] + a_cnw[Ai] + a_cne[Ai]); + tcx -= diag * (a_asw[Ai] + a_ase[Ai] + a_anw[Ai] + a_ane[Ai] + a_bsw[Ai] + a_bse[Ai] + a_bnw[Ai] + + a_bne[Ai]); cxb += tcx; } hypre_BoxLoop1ReductionEnd(Ai, cxb) @@ -1987,8 +1998,10 @@ hypre_PFMGComputeDxyz_SS27( HYPRE_Int bi, { HYPRE_Real tcy = 0.0; HYPRE_Real diag = a_cc[Ai] < 0.0 ? -1.0 : 1.0; - tcy -= diag * (a_cs[Ai] + a_cn[Ai] + a_an[Ai] + a_as[Ai] + a_bn[Ai] + a_bs[Ai] + a_csw[Ai] + a_cse[Ai] + a_cnw[Ai] + a_cne[Ai]); - tcy -= diag * (a_asw[Ai] + a_ase[Ai] + a_anw[Ai] + a_ane[Ai] + a_bsw[Ai] + a_bse[Ai] + a_bnw[Ai] + a_bne[Ai]); + tcy -= diag * (a_cs[Ai] + a_cn[Ai] + a_an[Ai] + a_as[Ai] + a_bn[Ai] + a_bs[Ai] + a_csw[Ai] + + a_cse[Ai] + a_cnw[Ai] + a_cne[Ai]); + tcy -= diag * (a_asw[Ai] + a_ase[Ai] + a_anw[Ai] + a_ane[Ai] + a_bsw[Ai] + a_bse[Ai] + a_bnw[Ai] + + a_bne[Ai]); cyb += tcy; } hypre_BoxLoop1ReductionEnd(Ai, cyb) @@ -1999,8 +2012,10 @@ hypre_PFMGComputeDxyz_SS27( HYPRE_Int bi, { HYPRE_Real tcz = 0.0; HYPRE_Real diag = a_cc[Ai] < 0.0 ? -1.0 : 1.0; - tcz -= diag * (a_ac[Ai] + a_bc[Ai] + a_aw[Ai] + a_ae[Ai] + a_an[Ai] + a_as[Ai] + a_bw[Ai] + a_be[Ai] + a_bn[Ai] + a_bs[Ai]); - tcz -= diag * (a_asw[Ai] + a_ase[Ai] + a_anw[Ai] + a_ane[Ai] + a_bsw[Ai] + a_bse[Ai] + a_bnw[Ai] + a_bne[Ai]); + tcz -= diag * (a_ac[Ai] + a_bc[Ai] + a_aw[Ai] + a_ae[Ai] + a_an[Ai] + a_as[Ai] + a_bw[Ai] + + a_be[Ai] + a_bn[Ai] + a_bs[Ai]); + tcz -= diag * (a_asw[Ai] + a_ase[Ai] + a_anw[Ai] + a_ane[Ai] + a_bsw[Ai] + a_bse[Ai] + a_bnw[Ai] + + a_bne[Ai]); czb += tcz; } hypre_BoxLoop1ReductionEnd(Ai, czb) @@ -2011,9 +2026,11 @@ hypre_PFMGComputeDxyz_SS27( HYPRE_Int bi, { HYPRE_Real tcx = 0.0; HYPRE_Real diag = a_cc[Ai] < 0.0 ? -1.0 : 1.0; - tcx -= diag * (a_cw[Ai] + a_ce[Ai] + a_aw[Ai] + a_ae[Ai] + a_bw[Ai] + a_be[Ai] + a_csw[Ai] + a_cse[Ai] + a_cnw[Ai] + a_cne[Ai]); - tcx -= diag * (a_asw[Ai] + a_ase[Ai] + a_anw[Ai] + a_ane[Ai] + a_bsw[Ai] + a_bse[Ai] + a_bnw[Ai] + a_bne[Ai]); - sqcxb += tcx*tcx; + tcx -= diag * (a_cw[Ai] + a_ce[Ai] + a_aw[Ai] + a_ae[Ai] + a_bw[Ai] + a_be[Ai] + a_csw[Ai] + + a_cse[Ai] + a_cnw[Ai] + a_cne[Ai]); + tcx -= diag * (a_asw[Ai] + a_ase[Ai] + a_anw[Ai] + a_ane[Ai] + a_bsw[Ai] + a_bse[Ai] + a_bnw[Ai] + + a_bne[Ai]); + sqcxb += tcx * tcx; } hypre_BoxLoop1ReductionEnd(Ai, sqcxb) @@ -2023,9 +2040,11 @@ hypre_PFMGComputeDxyz_SS27( HYPRE_Int bi, { HYPRE_Real tcy = 0.0; HYPRE_Real diag = a_cc[Ai] < 0.0 ? -1.0 : 1.0; - tcy -= diag * (a_cs[Ai] + a_cn[Ai] + a_an[Ai] + a_as[Ai] + a_bn[Ai] + a_bs[Ai] + a_csw[Ai] + a_cse[Ai] + a_cnw[Ai] + a_cne[Ai]); - tcy -= diag * (a_asw[Ai] + a_ase[Ai] + a_anw[Ai] + a_ane[Ai] + a_bsw[Ai] + a_bse[Ai] + a_bnw[Ai] + a_bne[Ai]); - sqcyb += tcy*tcy; + tcy -= diag * (a_cs[Ai] + a_cn[Ai] + a_an[Ai] + a_as[Ai] + a_bn[Ai] + a_bs[Ai] + a_csw[Ai] + + a_cse[Ai] + a_cnw[Ai] + a_cne[Ai]); + tcy -= diag * (a_asw[Ai] + a_ase[Ai] + a_anw[Ai] + a_ane[Ai] + a_bsw[Ai] + a_bse[Ai] + a_bnw[Ai] + + a_bne[Ai]); + sqcyb += tcy * tcy; } hypre_BoxLoop1ReductionEnd(Ai, sqcyb); @@ -2035,16 +2054,19 @@ hypre_PFMGComputeDxyz_SS27( HYPRE_Int bi, { HYPRE_Real tcz = 0.0; HYPRE_Real diag = a_cc[Ai] < 0.0 ? -1.0 : 1.0; - tcz -= diag * (a_ac[Ai] + a_bc[Ai] + a_aw[Ai] + a_ae[Ai] + a_an[Ai] + a_as[Ai] + a_bw[Ai] + a_be[Ai] + a_bn[Ai] + a_bs[Ai]); - tcz -= diag * (a_asw[Ai] + a_ase[Ai] + a_anw[Ai] + a_ane[Ai] + a_bsw[Ai] + a_bse[Ai] + a_bnw[Ai] + a_bne[Ai]); - sqczb += tcz*tcz; + tcz -= diag * (a_ac[Ai] + a_bc[Ai] + a_aw[Ai] + a_ae[Ai] + a_an[Ai] + a_as[Ai] + a_bw[Ai] + + a_be[Ai] + a_bn[Ai] + a_bs[Ai]); + tcz -= diag * (a_asw[Ai] + a_ase[Ai] + a_anw[Ai] + a_ane[Ai] + a_bsw[Ai] + a_bse[Ai] + a_bnw[Ai] + + a_bne[Ai]); + sqczb += tcz * tcz; } hypre_BoxLoop1ReductionEnd(Ai, sqczb) #else /* kokkos */ #if defined(HYPRE_USING_RAJA) - ReduceSum cxb(cxyz[0]),cyb(cxyz[1]),czb(cxyz[2]),sqcxb(sqcxyz[0]),sqcyb(sqcxyz[1]), sqczb(sqcxyz[2]); + ReduceSum cxb(cxyz[0]), cyb(cxyz[1]), czb(cxyz[2]), + sqcxb(sqcxyz[0]), sqcyb(sqcxyz[1]), sqczb(sqcxyz[2]); #elif defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) HYPRE_double6 d6(cxyz[0], cxyz[1], cxyz[2], sqcxyz[0], sqcxyz[1], sqcxyz[2]); ReduceSum sum6(d6); @@ -2076,16 +2098,22 @@ hypre_PFMGComputeDxyz_SS27( HYPRE_Int bi, HYPRE_Real tcx = 0.0, tcy = 0.0, tcz = 0.0; HYPRE_Real diag = a_cc[Ai] < 0.0 ? -1.0 : 1.0; - tcx -= diag * (a_cw[Ai] + a_ce[Ai] + a_aw[Ai] + a_ae[Ai] + a_bw[Ai] + a_be[Ai] + a_csw[Ai] + a_cse[Ai] + a_cnw[Ai] + a_cne[Ai]); - tcx -= diag * (a_asw[Ai] + a_ase[Ai] + a_anw[Ai] + a_ane[Ai] + a_bsw[Ai] + a_bse[Ai] + a_bnw[Ai] + a_bne[Ai]); + tcx -= diag * (a_cw[Ai] + a_ce[Ai] + a_aw[Ai] + a_ae[Ai] + a_bw[Ai] + a_be[Ai] + a_csw[Ai] + + a_cse[Ai] + a_cnw[Ai] + a_cne[Ai]); + tcx -= diag * (a_asw[Ai] + a_ase[Ai] + a_anw[Ai] + a_ane[Ai] + a_bsw[Ai] + a_bse[Ai] + a_bnw[Ai] + + a_bne[Ai]); - tcy -= diag * (a_cs[Ai] + a_cn[Ai] + a_an[Ai] + a_as[Ai] + a_bn[Ai] + a_bs[Ai] + a_csw[Ai] + a_cse[Ai] + a_cnw[Ai] + a_cne[Ai]); - tcy -= diag * (a_asw[Ai] + a_ase[Ai] + a_anw[Ai] + a_ane[Ai] + a_bsw[Ai] + a_bse[Ai] + a_bnw[Ai] + a_bne[Ai]); + tcy -= diag * (a_cs[Ai] + a_cn[Ai] + a_an[Ai] + a_as[Ai] + a_bn[Ai] + a_bs[Ai] + a_csw[Ai] + + a_cse[Ai] + a_cnw[Ai] + a_cne[Ai]); + tcy -= diag * (a_asw[Ai] + a_ase[Ai] + a_anw[Ai] + a_ane[Ai] + a_bsw[Ai] + a_bse[Ai] + a_bnw[Ai] + + a_bne[Ai]); - tcz -= diag * (a_ac[Ai] + a_bc[Ai] + a_aw[Ai] + a_ae[Ai] + a_an[Ai] + a_as[Ai] + a_bw[Ai] + a_be[Ai] + a_bn[Ai] + a_bs[Ai]); - tcz -= diag * (a_asw[Ai] + a_ase[Ai] + a_anw[Ai] + a_ane[Ai] + a_bsw[Ai] + a_bse[Ai] + a_bnw[Ai] + a_bne[Ai]); + tcz -= diag * (a_ac[Ai] + a_bc[Ai] + a_aw[Ai] + a_ae[Ai] + a_an[Ai] + a_as[Ai] + a_bw[Ai] + + a_be[Ai] + a_bn[Ai] + a_bs[Ai]); + tcz -= diag * (a_asw[Ai] + a_ase[Ai] + a_anw[Ai] + a_ane[Ai] + a_bsw[Ai] + a_bse[Ai] + a_bnw[Ai] + + a_bne[Ai]); #if !defined(HYPRE_USING_RAJA) && (defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP)) - HYPRE_double6 tmp(tcx, tcy, tcz, tcx*tcx, tcy*tcy, tcz*tcz); + HYPRE_double6 tmp(tcx, tcy, tcz, tcx * tcx, tcy * tcy, tcz * tcz); sum6 += tmp; #else cxb += tcx; @@ -2177,7 +2205,7 @@ hypre_ZeroDiagonal( hypre_StructMatrix *A ) } else { -#if defined(HYPRE_USING_KOKKOS) +#if defined(HYPRE_USING_KOKKOS) || defined(HYPRE_USING_SYCL) HYPRE_Real diag_product_local = diag_product; #elif defined(HYPRE_USING_RAJA) ReduceSum diag_product_local(diag_product); diff --git a/external/hypre/src/struct_ls/pfmg_setup_interp.c b/external/hypre/src/struct_ls/pfmg_setup_interp.c index deb3b0c1..5f382e7a 100644 --- a/external/hypre/src/struct_ls/pfmg_setup_interp.c +++ b/external/hypre/src/struct_ls/pfmg_setup_interp.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -56,11 +56,13 @@ hypre_PFMGCreateInterpOp( hypre_StructMatrix *A, hypre_StructMatrixSetNumGhost(P, num_ghost); constant_coefficient = hypre_StructMatrixConstantCoefficient(A); - if ( constant_coefficient==2 ) + if ( constant_coefficient == 2 ) { - if ( rap_type==0 ) + if ( rap_type == 0 ) /* A has variable diagonal, which will force all P coefficients to be variable */ + { hypre_StructMatrixSetConstantCoefficient(P, 0 ); + } else { /* We will force P to be 0.5's everywhere, ignoring A. */ @@ -122,6 +124,8 @@ hypre_PFMGSetupInterpOp( hypre_StructMatrix *A, * Initialize some things *----------------------------------------------------------*/ + HYPRE_ANNOTATE_FUNC_BEGIN; + stencil = hypre_StructMatrixStencil(A); stencil_shape = hypre_StructStencilShape(stencil); stencil_size = hypre_StructStencilSize(stencil); @@ -189,20 +193,20 @@ hypre_PFMGSetupInterpOp( hypre_StructMatrix *A, hypre_BoxGetStrideSize(compute_box, stridec, loop_size); - if ( constant_coefficient==1 ) + if ( constant_coefficient == 1 ) /* all coefficients are constant */ { hypre_PFMGSetupInterpOp_CC1 - ( i, A, A_dbox, cdir, stride, stridec, start, startc, loop_size, - P_dbox, Pstenc0, Pstenc1, Pp0, Pp1, rap_type, si0, si1 ); + ( i, A, A_dbox, cdir, stride, stridec, start, startc, loop_size, + P_dbox, Pstenc0, Pstenc1, Pp0, Pp1, rap_type, si0, si1 ); } - else if ( constant_coefficient==2 ) + else if ( constant_coefficient == 2 ) /* all coefficients are constant except the diagonal is variable */ { hypre_PFMGSetupInterpOp_CC2 - ( i, A, A_dbox, cdir, stride, stridec, start, startc, loop_size, - P_dbox, Pstenc0, Pstenc1, Pp0, Pp1, rap_type, si0, si1 ); + ( i, A, A_dbox, cdir, stride, stridec, start, startc, loop_size, + P_dbox, Pstenc0, Pstenc1, Pp0, Pp1, rap_type, si0, si1 ); } else @@ -210,40 +214,40 @@ hypre_PFMGSetupInterpOp( hypre_StructMatrix *A, { #if CC0_IMPLEMENTATION <= 1 hypre_PFMGSetupInterpOp_CC0 - ( i, A, A_dbox, cdir, stride, stridec, start, startc, loop_size, - P_dbox, Pstenc0, Pstenc1, Pp0, Pp1, rap_type, si0, si1 ); + ( i, A, A_dbox, cdir, stride, stridec, start, startc, loop_size, + P_dbox, Pstenc0, Pstenc1, Pp0, Pp1, rap_type, si0, si1 ); #else switch (stencil_size) { case 5: hypre_PFMGSetupInterpOp_CC0_SS5 - ( i, A, A_dbox, cdir, stride, stridec, start, startc, loop_size, - P_dbox, Pstenc0, Pstenc1, Pp0, Pp1, rap_type, P_stencil_shape ); + ( i, A, A_dbox, cdir, stride, stridec, start, startc, loop_size, + P_dbox, Pstenc0, Pstenc1, Pp0, Pp1, rap_type, P_stencil_shape ); break; case 9: hypre_PFMGSetupInterpOp_CC0_SS9 - ( i, A, A_dbox, cdir, stride, stridec, start, startc, loop_size, - P_dbox, Pstenc0, Pstenc1, Pp0, Pp1, rap_type, P_stencil_shape ); + ( i, A, A_dbox, cdir, stride, stridec, start, startc, loop_size, + P_dbox, Pstenc0, Pstenc1, Pp0, Pp1, rap_type, P_stencil_shape ); break; case 7: hypre_PFMGSetupInterpOp_CC0_SS7 - ( i, A, A_dbox, cdir, stride, stridec, start, startc, loop_size, - P_dbox, Pstenc0, Pstenc1, Pp0, Pp1, rap_type, P_stencil_shape ); + ( i, A, A_dbox, cdir, stride, stridec, start, startc, loop_size, + P_dbox, Pstenc0, Pstenc1, Pp0, Pp1, rap_type, P_stencil_shape ); break; case 15: hypre_PFMGSetupInterpOp_CC0_SS15 - ( i, A, A_dbox, cdir, stride, stridec, start, startc, loop_size, - P_dbox, Pstenc0, Pstenc1, Pp0, Pp1, rap_type, P_stencil_shape ); + ( i, A, A_dbox, cdir, stride, stridec, start, startc, loop_size, + P_dbox, Pstenc0, Pstenc1, Pp0, Pp1, rap_type, P_stencil_shape ); break; case 19: hypre_PFMGSetupInterpOp_CC0_SS19 - ( i, A, A_dbox, cdir, stride, stridec, start, startc, loop_size, - P_dbox, Pstenc0, Pstenc1, Pp0, Pp1, rap_type, P_stencil_shape ); + ( i, A, A_dbox, cdir, stride, stridec, start, startc, loop_size, + P_dbox, Pstenc0, Pstenc1, Pp0, Pp1, rap_type, P_stencil_shape ); break; case 27: hypre_PFMGSetupInterpOp_CC0_SS27 - ( i, A, A_dbox, cdir, stride, stridec, start, startc, loop_size, - P_dbox, Pstenc0, Pstenc1, Pp0, Pp1, rap_type, P_stencil_shape ); + ( i, A, A_dbox, cdir, stride, stridec, start, startc, loop_size, + P_dbox, Pstenc0, Pstenc1, Pp0, Pp1, rap_type, P_stencil_shape ); break; default: /* @@ -265,6 +269,8 @@ hypre_PFMGSetupInterpOp( hypre_StructMatrix *A, hypre_StructInterpAssemble(A, P, 0, cdir, findex, stride); #endif + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; } @@ -290,31 +296,30 @@ hypre_PFMGSetupInterpOp_CC0 HYPRE_Int si0, HYPRE_Int si1 ) { - hypre_StructStencil *stencil = hypre_StructMatrixStencil(A); - hypre_Index *stencil_shape = hypre_StructStencilShape(stencil); - HYPRE_Int stencil_size = hypre_StructStencilSize(stencil); - HYPRE_Int warning_cnt= 0; - -#if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - HYPRE_Int data_location = hypre_StructGridDataLocation(hypre_StructMatrixGrid(A)); -#endif - - HYPRE_Int **data_indices = hypre_StructMatrixDataIndices(A); - HYPRE_Complex *matrixA_data = hypre_StructMatrixData(A); - HYPRE_Int *data_indices_boxi_d; /* On device */ - hypre_Index *stencil_shape_d; - - if (hypre_GetActualMemLocation(HYPRE_MEMORY_DEVICE) != hypre_MEMORY_HOST) + hypre_StructStencil *stencil = hypre_StructMatrixStencil(A); + hypre_Index *stencil_shape = hypre_StructStencilShape(stencil); + HYPRE_Int stencil_size = hypre_StructStencilSize(stencil); + HYPRE_Int warning_cnt = 0; + HYPRE_Int data_location = hypre_StructGridDataLocation(hypre_StructMatrixGrid(A)); + HYPRE_Int **data_indices = hypre_StructMatrixDataIndices(A); + HYPRE_Complex *matrixA_data = hypre_StructMatrixData(A); + HYPRE_Int *data_indices_boxi_d; + hypre_Index *stencil_shape_d; + HYPRE_MemoryLocation memory_location = hypre_StructMatrixMemoryLocation(A); + + if (hypre_GetExecPolicy1(memory_location) == HYPRE_EXEC_DEVICE) { - data_indices_boxi_d = hypre_TAlloc(HYPRE_Int, stencil_size, HYPRE_MEMORY_DEVICE); - stencil_shape_d = hypre_TAlloc(hypre_Index, stencil_size, HYPRE_MEMORY_DEVICE); - hypre_TMemcpy(data_indices_boxi_d, data_indices[i], HYPRE_Int, stencil_size, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - hypre_TMemcpy(stencil_shape_d, stencil_shape, hypre_Index, stencil_size, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); + data_indices_boxi_d = hypre_TAlloc(HYPRE_Int, stencil_size, memory_location); + stencil_shape_d = hypre_TAlloc(hypre_Index, stencil_size, memory_location); + hypre_TMemcpy(data_indices_boxi_d, data_indices[i], HYPRE_Int, stencil_size, memory_location, + HYPRE_MEMORY_HOST); + hypre_TMemcpy(stencil_shape_d, stencil_shape, hypre_Index, stencil_size, memory_location, + HYPRE_MEMORY_HOST); } else { data_indices_boxi_d = data_indices[i]; - stencil_shape_d = stencil_shape; + stencil_shape_d = stencil_shape; } #define DEVICE_VAR is_device_ptr(Pp0,Pp1,matrixA_data,stencil_shape_d,data_indices_boxi_d) @@ -409,10 +414,10 @@ hypre_PFMGSetupInterpOp_CC0 "Warning 0 center in interpolation. Setting interp = 0."); } - if (hypre_GetActualMemLocation(HYPRE_MEMORY_DEVICE) != hypre_MEMORY_HOST) + if (hypre_GetExecPolicy1(memory_location) == HYPRE_EXEC_DEVICE) { - hypre_TFree(data_indices_boxi_d, HYPRE_MEMORY_DEVICE); - hypre_TFree(stencil_shape_d, HYPRE_MEMORY_DEVICE); + hypre_TFree(data_indices_boxi_d, memory_location); + hypre_TFree(stencil_shape_d, memory_location); } return hypre_error_flag; @@ -448,16 +453,13 @@ hypre_PFMGSetupInterpOp_CC0 HYPRE_Int warning_cnt = 0; HYPRE_Int dim, si, loop_length = 1, Astenc; HYPRE_Real *Ap, *center, *Ap0, *Ap1; - -#if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - HYPRE_Int data_location = hypre_StructGridDataLocation(hypre_StructMatrixGrid(A)); -#endif + HYPRE_MemoryLocation memory_location = hypre_StructMatrixMemoryLocation(A); for (dim = 0; dim < hypre_StructMatrixNDim(A); dim++) { loop_length *= loop_size[dim]; } - center = hypre_CTAlloc(HYPRE_Real, loop_length, HYPRE_MEMORY_DEVICE); + center = hypre_CTAlloc(HYPRE_Real, loop_length, memory_location); for (si = 0; si < stencil_size; si++) { @@ -470,7 +472,7 @@ hypre_PFMGSetupInterpOp_CC0 hypre_BoxLoop2Begin(hypre_StructMatrixNDim(A), loop_size, A_dbox, start, stride, Ai, P_dbox, startc, stridec, Pi) - center[idx] += Ap[Ai]; + center[idx] += Ap[Ai]; hypre_BoxLoop2End(Ai, Pi) #undef DEVICE_VAR } @@ -480,7 +482,7 @@ hypre_PFMGSetupInterpOp_CC0 hypre_BoxLoop2Begin(hypre_StructMatrixNDim(A), loop_size, A_dbox, start, stride, Ai, P_dbox, startc, stridec, Pi) - Pp0[Pi] -= Ap[Ai]; + Pp0[Pi] -= Ap[Ai]; hypre_BoxLoop2End(Ai, Pi) #undef DEVICE_VAR } @@ -490,7 +492,7 @@ hypre_PFMGSetupInterpOp_CC0 hypre_BoxLoop2Begin(hypre_StructMatrixNDim(A), loop_size, A_dbox, start, stride, Ai, P_dbox, startc, stridec, Pi) - Pp1[Pi] -= Ap[Ai]; + Pp1[Pi] -= Ap[Ai]; hypre_BoxLoop2End(Ai, Pi) #undef DEVICE_VAR } @@ -502,24 +504,24 @@ hypre_PFMGSetupInterpOp_CC0 hypre_BoxLoop2Begin(hypre_StructMatrixNDim(A), loop_size, A_dbox, start, stride, Ai, P_dbox, startc, stridec, Pi) - HYPRE_Real cval = center[idx]; - if (Ap0[Ai] == 0.0 || cval == 0.0) - { - Pp0[Pi] = 0.0; - } - else - { - Pp0[Pi] /= cval; - } + HYPRE_Real cval = center[idx]; + if (Ap0[Ai] == 0.0 || cval == 0.0) + { + Pp0[Pi] = 0.0; + } + else + { + Pp0[Pi] /= cval; + } - if (Ap1[Ai] == 0.0 || cval == 0.0) - { - Pp1[Pi] = 0.0; - } - else - { - Pp1[Pi] /= cval; - } + if (Ap1[Ai] == 0.0 || cval == 0.0) + { + Pp1[Pi] = 0.0; + } + else + { + Pp1[Pi] /= cval; + } hypre_BoxLoop2End(Ai, Pi) #undef DEVICE_VAR @@ -529,7 +531,7 @@ hypre_PFMGSetupInterpOp_CC0 "Warning 0 center in interpolation. Setting interp = 0."); } - hypre_TFree(center, HYPRE_MEMORY_DEVICE); + hypre_TFree(center, memory_location); return hypre_error_flag; } @@ -557,6 +559,15 @@ hypre_PFMGSetupInterpOp_CC1 HYPRE_Int si0, HYPRE_Int si1 ) { + HYPRE_UNUSED_VAR(A_dbox); + HYPRE_UNUSED_VAR(stride); + HYPRE_UNUSED_VAR(stridec); + HYPRE_UNUSED_VAR(start); + HYPRE_UNUSED_VAR(startc); + HYPRE_UNUSED_VAR(loop_size); + HYPRE_UNUSED_VAR(P_dbox); + HYPRE_UNUSED_VAR(rap_type); + HYPRE_Int si; HYPRE_Int Ai, Pi; HYPRE_Real *Ap; @@ -566,10 +577,10 @@ hypre_PFMGSetupInterpOp_CC1 hypre_StructStencil *stencil = hypre_StructMatrixStencil(A); hypre_Index *stencil_shape = hypre_StructStencilShape(stencil); HYPRE_Int stencil_size = hypre_StructStencilSize(stencil); - HYPRE_Int warning_cnt= 0; + HYPRE_Int warning_cnt = 0; - Ai = hypre_CCBoxIndexRank(A_dbox,start ); - Pi = hypre_CCBoxIndexRank(P_dbox,startc); + Ai = hypre_CCBoxIndexRank(A_dbox, start ); + Pi = hypre_CCBoxIndexRank(P_dbox, startc); center = 0.0; Pp0[Pi] = 0.0; @@ -679,15 +690,15 @@ hypre_PFMGSetupInterpOp_CC2 HYPRE_Int stencil_size = hypre_StructStencilSize(stencil); hypre_Index diag_index; HYPRE_Int diag_rank; - HYPRE_Int warning_cnt= 0; + HYPRE_Int warning_cnt = 0; hypre_SetIndex3(diag_index, 0, 0, 0); diag_rank = hypre_StructStencilElementRank(stencil, diag_index); - if ( rap_type!=0 ) + if ( rap_type != 0 ) { /* simply force P to be constant coefficient, all 0.5's */ - Pi = hypre_CCBoxIndexRank(P_dbox,startc); + Pi = hypre_CCBoxIndexRank(P_dbox, startc); Pp0[Pi] = 0.5; Pp1[Pi] = 0.5; } @@ -698,7 +709,7 @@ hypre_PFMGSetupInterpOp_CC2 variable, and hence "center" below is variable. So we use the constant coefficient calculation to initialize the diagonal's variable coefficient calculation (which is like constant_coefficient=0). */ - Ai = hypre_CCBoxIndexRank(A_dbox,start ); + Ai = hypre_CCBoxIndexRank(A_dbox, start ); center_offd = 0.0; P0 = 0.0; @@ -746,9 +757,9 @@ hypre_PFMGSetupInterpOp_CC2 A_dbox, start, stride, Ai, P_dbox, startc, stridec, Pi); { - HYPRE_Int mrk0,mrk1; + HYPRE_Int mrk0, mrk1; HYPRE_Real center; - HYPRE_Real p0val,p1val; + HYPRE_Real p0val, p1val; p0val = P0; p1val = P1; @@ -831,14 +842,17 @@ hypre_PFMGSetupInterpOp_CC0_SS5 HYPRE_Int rap_type, hypre_Index *P_stencil_shape ) { - //hypre_StructStencil *stencil = hypre_StructMatrixStencil(A); - //hypre_Index *stencil_shape = hypre_StructStencilShape(stencil); - //HYPRE_Int stencil_size = hypre_StructStencilSize(stencil); - //HYPRE_Int warning_cnt= 0; + HYPRE_UNUSED_VAR(rap_type); + HYPRE_UNUSED_VAR(Pstenc1); + + //hypre_StructStencil *stencil = hypre_StructMatrixStencil(A); + //hypre_Index *stencil_shape = hypre_StructStencilShape(stencil); + //HYPRE_Int stencil_size = hypre_StructStencilSize(stencil); + //HYPRE_Int warning_cnt= 0; hypre_Index index; HYPRE_Real *a_cc, *a_cw, *a_ce, *a_cs, *a_cn; - HYPRE_Real *p0,*p1; + HYPRE_Real *p0, *p1; p0 = hypre_StructMatrixExtractPointerByIndex(A, i, P_stencil_shape[0]); p1 = hypre_StructMatrixExtractPointerByIndex(A, i, P_stencil_shape[1]); @@ -853,19 +867,19 @@ hypre_PFMGSetupInterpOp_CC0_SS5 * a_cn is pointer for north coefficient *-----------------------------------------------------------------*/ - hypre_SetIndex3(index,0,0,0); + hypre_SetIndex3(index, 0, 0, 0); a_cc = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index,-1,0,0); + hypre_SetIndex3(index, -1, 0, 0); a_cw = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index,1,0,0); + hypre_SetIndex3(index, 1, 0, 0); a_ce = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index,0,-1,0); + hypre_SetIndex3(index, 0, -1, 0); a_cs = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index,0,1,0); + hypre_SetIndex3(index, 0, 1, 0); a_cn = hypre_StructMatrixExtractPointerByIndex(A, i, index); #define DEVICE_VAR is_device_ptr(a_cc,a_cs,a_cn,a_cw,a_ce,Pp0,Pp1,p0,p1) @@ -873,19 +887,19 @@ hypre_PFMGSetupInterpOp_CC0_SS5 A_dbox, start, stride, Ai, P_dbox, startc, stridec, Pi); { - HYPRE_Real center,left,right; + HYPRE_Real center, left, right; switch (cdir) { case 0: center = a_cc[Ai] + a_cs[Ai] + a_cn[Ai]; - left =-a_cw[Ai]; - right =-a_ce[Ai]; + left = -a_cw[Ai]; + right = -a_ce[Ai]; break; - case 1: + case 1: default: center = a_cc[Ai] + a_cw[Ai] + a_ce[Ai]; - left =-a_cs[Ai]; - right =-a_cn[Ai]; + left = -a_cs[Ai]; + right = -a_cn[Ai]; break; } @@ -900,26 +914,26 @@ hypre_PFMGSetupInterpOp_CC0_SS5 switch (Pstenc0) { case -1: - Pp0[Pi] = left/center; + Pp0[Pi] = left / center; break; case 1: - Pp0[Pi] = right/center; + Pp0[Pi] = right / center; break; } switch (Pstenc1) { case -1: - Pp1[Pi] = left/center; + Pp1[Pi] = left / center; break; case 1: - Pp1[Pi] = right/center; + Pp1[Pi] = right / center; break; } } - if (p0[Ai] == 0.0) Pp0[Pi] = 0.0; - if (p1[Ai] == 0.0) Pp1[Pi] = 0.0; + if (p0[Ai] == 0.0) { Pp0[Pi] = 0.0; } + if (p1[Ai] == 0.0) { Pp1[Pi] = 0.0; } /*---------------------------------------------- * Set interpolation weight to zero, if stencil * entry in same direction is zero. Prevents @@ -956,15 +970,18 @@ hypre_PFMGSetupInterpOp_CC0_SS9 HYPRE_Int rap_type, hypre_Index *P_stencil_shape ) { - //hypre_StructStencil *stencil = hypre_StructMatrixStencil(A); - //hypre_Index *stencil_shape = hypre_StructStencilShape(stencil); - //HYPRE_Int stencil_size = hypre_StructStencilSize(stencil); - //HYPRE_Int warning_cnt= 0; + HYPRE_UNUSED_VAR(rap_type); + HYPRE_UNUSED_VAR(Pstenc1); + + //hypre_StructStencil *stencil = hypre_StructMatrixStencil(A); + //hypre_Index *stencil_shape = hypre_StructStencilShape(stencil); + //HYPRE_Int stencil_size = hypre_StructStencilSize(stencil); + //HYPRE_Int warning_cnt= 0; hypre_Index index; HYPRE_Real *a_cc, *a_cw, *a_ce, *a_cs, *a_cn; HYPRE_Real *a_csw, *a_cse, *a_cne, *a_cnw; - HYPRE_Real *p0,*p1; + HYPRE_Real *p0, *p1; p0 = hypre_StructMatrixExtractPointerByIndex(A, i, P_stencil_shape[0]); p1 = hypre_StructMatrixExtractPointerByIndex(A, i, P_stencil_shape[1]); @@ -978,19 +995,19 @@ hypre_PFMGSetupInterpOp_CC0_SS9 * a_cn is pointer for north coefficient *-----------------------------------------------------------------*/ - hypre_SetIndex3(index,0,0,0); + hypre_SetIndex3(index, 0, 0, 0); a_cc = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index,-1,0,0); + hypre_SetIndex3(index, -1, 0, 0); a_cw = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index,1,0,0); + hypre_SetIndex3(index, 1, 0, 0); a_ce = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index,0,-1,0); + hypre_SetIndex3(index, 0, -1, 0); a_cs = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index,0,1,0); + hypre_SetIndex3(index, 0, 1, 0); a_cn = hypre_StructMatrixExtractPointerByIndex(A, i, index); /*----------------------------------------------------------------- @@ -1002,13 +1019,13 @@ hypre_PFMGSetupInterpOp_CC0_SS9 * a_cne is pointer for northeast coefficient *-----------------------------------------------------------------*/ - hypre_SetIndex3(index,-1,-1, 0); + hypre_SetIndex3(index, -1, -1, 0); a_csw = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index, 1,-1, 0); + hypre_SetIndex3(index, 1, -1, 0); a_cse = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index,-1, 1, 0); + hypre_SetIndex3(index, -1, 1, 0); a_cnw = hypre_StructMatrixExtractPointerByIndex(A, i, index); hypre_SetIndex3(index, 1, 1, 0); @@ -1019,19 +1036,19 @@ hypre_PFMGSetupInterpOp_CC0_SS9 A_dbox, start, stride, Ai, P_dbox, startc, stridec, Pi); { - HYPRE_Real center,left,right; + HYPRE_Real center, left, right; switch (cdir) { case 0: center = a_cc[Ai] + a_cs[Ai] + a_cn[Ai]; - left =-a_cw[Ai] - a_csw[Ai] - a_cnw[Ai]; - right =-a_ce[Ai] - a_cse[Ai] - a_cne[Ai]; + left = -a_cw[Ai] - a_csw[Ai] - a_cnw[Ai]; + right = -a_ce[Ai] - a_cse[Ai] - a_cne[Ai]; break; - case 1: + case 1: default: center = a_cc[Ai] + a_cw[Ai] + a_ce[Ai]; - left =-a_cs[Ai] - a_csw[Ai] - a_cse[Ai]; - right =-a_cn[Ai] - a_cnw[Ai] - a_cne[Ai]; + left = -a_cs[Ai] - a_csw[Ai] - a_cse[Ai]; + right = -a_cn[Ai] - a_cnw[Ai] - a_cne[Ai]; break; }; @@ -1046,12 +1063,12 @@ hypre_PFMGSetupInterpOp_CC0_SS9 switch (Pstenc0) { case -1: - Pp0[Pi] = left/center; - Pp1[Pi] = right/center; + Pp0[Pi] = left / center; + Pp1[Pi] = right / center; break; case 1: - Pp0[Pi] = right/center; - Pp1[Pi] = left/center; + Pp0[Pi] = right / center; + Pp1[Pi] = left / center; break; }; /* @@ -1065,8 +1082,8 @@ hypre_PFMGSetupInterpOp_CC0_SS9 */ } - if (p0[Ai] == 0.0) Pp0[Pi] = 0.0; - if (p1[Ai] == 0.0) Pp1[Pi] = 0.0; + if (p0[Ai] == 0.0) { Pp0[Pi] = 0.0; } + if (p1[Ai] == 0.0) { Pp1[Pi] = 0.0; } } hypre_BoxLoop2End(Ai, Pi); #undef DEVICE_VAR @@ -1093,14 +1110,17 @@ hypre_PFMGSetupInterpOp_CC0_SS7 HYPRE_Int rap_type, hypre_Index *P_stencil_shape ) { - //hypre_StructStencil *stencil = hypre_StructMatrixStencil(A); - //hypre_Index *stencil_shape = hypre_StructStencilShape(stencil); - //HYPRE_Int stencil_size = hypre_StructStencilSize(stencil); - //HYPRE_Int warning_cnt= 0; + HYPRE_UNUSED_VAR(rap_type); + HYPRE_UNUSED_VAR(Pstenc1); + + //hypre_StructStencil *stencil = hypre_StructMatrixStencil(A); + //hypre_Index *stencil_shape = hypre_StructStencilShape(stencil); + //HYPRE_Int stencil_size = hypre_StructStencilSize(stencil); + //HYPRE_Int warning_cnt= 0; hypre_Index index; HYPRE_Real *a_cc, *a_cw, *a_ce, *a_cs, *a_cn, *a_ac, *a_bc; - HYPRE_Real *p0,*p1; + HYPRE_Real *p0, *p1; p0 = hypre_StructMatrixExtractPointerByIndex(A, i, P_stencil_shape[0]); p1 = hypre_StructMatrixExtractPointerByIndex(A, i, P_stencil_shape[1]); @@ -1117,25 +1137,25 @@ hypre_PFMGSetupInterpOp_CC0_SS7 * a_bc is pointer for center coefficient in plane below *-----------------------------------------------------------------*/ - hypre_SetIndex3(index,0,0,0); + hypre_SetIndex3(index, 0, 0, 0); a_cc = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index,-1,0,0); + hypre_SetIndex3(index, -1, 0, 0); a_cw = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index,1,0,0); + hypre_SetIndex3(index, 1, 0, 0); a_ce = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index,0,-1,0); + hypre_SetIndex3(index, 0, -1, 0); a_cs = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index,0,1,0); + hypre_SetIndex3(index, 0, 1, 0); a_cn = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index,0,0,1); + hypre_SetIndex3(index, 0, 0, 1); a_ac = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index,0,0,-1); + hypre_SetIndex3(index, 0, 0, -1); a_bc = hypre_StructMatrixExtractPointerByIndex(A, i, index); #define DEVICE_VAR is_device_ptr(a_cc,a_cs,a_cn,a_ac,a_bc,a_cw,a_ce,Pp0,Pp1,p0,p1) @@ -1143,24 +1163,24 @@ hypre_PFMGSetupInterpOp_CC0_SS7 A_dbox, start, stride, Ai, P_dbox, startc, stridec, Pi); { - HYPRE_Real center,left,right; + HYPRE_Real center, left, right; switch (cdir) { case 0: center = a_cc[Ai] + a_cs[Ai] + a_cn[Ai] + a_ac[Ai] + a_bc[Ai]; - left =-a_cw[Ai]; - right =-a_ce[Ai]; + left = -a_cw[Ai]; + right = -a_ce[Ai]; break; case 1: center = a_cc[Ai] + a_cw[Ai] + a_ce[Ai] + a_ac[Ai] + a_bc[Ai] ; - left =-a_cs[Ai]; - right =-a_cn[Ai]; + left = -a_cs[Ai]; + right = -a_cn[Ai]; break; - case 2: + case 2: default: center = a_cc[Ai] + a_cw[Ai] + a_ce[Ai] + a_cs[Ai] + a_cn[Ai] ; - left =-a_bc[Ai]; - right =-a_ac[Ai]; + left = -a_bc[Ai]; + right = -a_ac[Ai]; break; }; @@ -1174,12 +1194,12 @@ hypre_PFMGSetupInterpOp_CC0_SS7 switch (Pstenc0) { case -1: - Pp0[Pi] = left/center; - Pp1[Pi] = right/center; + Pp0[Pi] = left / center; + Pp1[Pi] = right / center; break; case 1: - Pp0[Pi] = right/center; - Pp1[Pi] = left/center; + Pp0[Pi] = right / center; + Pp1[Pi] = left / center; break; }; /* @@ -1193,8 +1213,8 @@ hypre_PFMGSetupInterpOp_CC0_SS7 */ } - if (p0[Ai] == 0.0) Pp0[Pi] = 0.0; - if (p1[Ai] == 0.0) Pp1[Pi] = 0.0; + if (p0[Ai] == 0.0) { Pp0[Pi] = 0.0; } + if (p1[Ai] == 0.0) { Pp1[Pi] = 0.0; } //printf("%d: %d, Pp0[%d] = %e, Pp1 = %e, %e, %e, %e, cc=%e, cw=%e, ce=%e, cs=%e, cn=%e, bc=%e, ac=%e \n",Ai,cdir, Pi,Pp0[Pi],Pp1[Pi],center, left, right, // a_cc[Ai],a_cw[Ai],a_ce[Ai],a_cs[Ai],a_cn[Ai],a_bc[Ai],a_ac[Ai]); @@ -1225,12 +1245,15 @@ hypre_PFMGSetupInterpOp_CC0_SS15 HYPRE_Int rap_type, hypre_Index *P_stencil_shape ) { + HYPRE_UNUSED_VAR(rap_type); + HYPRE_UNUSED_VAR(Pstenc1); + hypre_Index index; HYPRE_Int stencil_type15; HYPRE_Real *a_cc, *a_cw, *a_ce, *a_cs, *a_cn, *a_ac, *a_bc; HYPRE_Real *a_aw, *a_ae, *a_as, *a_an, *a_bw, *a_be, *a_bs, *a_bn; HYPRE_Real *a_csw, *a_cse, *a_cnw, *a_cne; - HYPRE_Real *p0,*p1; + HYPRE_Real *p0, *p1; p0 = hypre_StructMatrixExtractPointerByIndex(A, i, P_stencil_shape[0]); p1 = hypre_StructMatrixExtractPointerByIndex(A, i, P_stencil_shape[1]); @@ -1247,25 +1270,25 @@ hypre_PFMGSetupInterpOp_CC0_SS15 * a_bc is pointer for center coefficient in plane below *-----------------------------------------------------------------*/ - hypre_SetIndex3(index,0,0,0); + hypre_SetIndex3(index, 0, 0, 0); a_cc = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index,-1,0,0); + hypre_SetIndex3(index, -1, 0, 0); a_cw = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index,1,0,0); + hypre_SetIndex3(index, 1, 0, 0); a_ce = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index,0,-1,0); + hypre_SetIndex3(index, 0, -1, 0); a_cs = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index,0,1,0); + hypre_SetIndex3(index, 0, 1, 0); a_cn = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index,0,0,1); + hypre_SetIndex3(index, 0, 0, 1); a_ac = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index,0,0,-1); + hypre_SetIndex3(index, 0, 0, -1); a_bc = hypre_StructMatrixExtractPointerByIndex(A, i, index); /*----------------------------------------------------------------- @@ -1285,37 +1308,37 @@ hypre_PFMGSetupInterpOp_CC0_SS15 * a_cne is pointer for northeast coefficient in same plane *-----------------------------------------------------------------*/ - hypre_SetIndex3(index,-1, 0, 1); + hypre_SetIndex3(index, -1, 0, 1); a_aw = hypre_StructMatrixExtractPointerByIndex(A, i, index); hypre_SetIndex3(index, 1, 0, 1); a_ae = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index, 0,-1, 1); + hypre_SetIndex3(index, 0, -1, 1); a_as = hypre_StructMatrixExtractPointerByIndex(A, i, index); hypre_SetIndex3(index, 0, 1, 1); a_an = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index,-1, 0,-1); + hypre_SetIndex3(index, -1, 0, -1); a_bw = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index, 1, 0,-1); + hypre_SetIndex3(index, 1, 0, -1); a_be = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index, 0,-1,-1); + hypre_SetIndex3(index, 0, -1, -1); a_bs = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index, 0, 1,-1); + hypre_SetIndex3(index, 0, 1, -1); a_bn = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index,-1,-1, 0); + hypre_SetIndex3(index, -1, -1, 0); a_csw = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index, 1,-1, 0); + hypre_SetIndex3(index, 1, -1, 0); a_cse = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index,-1, 1, 0); + hypre_SetIndex3(index, -1, 1, 0); a_cnw = hypre_StructMatrixExtractPointerByIndex(A, i, index); hypre_SetIndex3(index, 1, 1, 0); @@ -1361,9 +1384,9 @@ hypre_PFMGSetupInterpOp_CC0_SS15 left = -a_cs[Ai] - a_csw[Ai] - a_cse[Ai]; /* front */ right = -a_cn[Ai] - a_cnw[Ai] - a_cne[Ai]; /* back */ break; - case 2: + case 2: default: center = a_cc[Ai] + a_cw[Ai] + a_ce[Ai] + a_cs[Ai] + a_cn[Ai] + - a_csw[Ai] + a_cse[Ai] + a_cnw[Ai] - a_cne[Ai]; + a_csw[Ai] + a_cse[Ai] + a_cnw[Ai] - a_cne[Ai]; left = -a_bc[Ai] - a_bw[Ai] - a_be[Ai]; /* below */ right = -a_ac[Ai] - a_aw[Ai] - a_ae[Ai]; /* above */ break; @@ -1403,8 +1426,8 @@ hypre_PFMGSetupInterpOp_CC0_SS15 else if (stencil_type15 == 1) { hypre_BoxLoop2Begin(hypre_StructMatrixNDim(A), loop_size, - A_dbox, start, stride, Ai, - P_dbox, startc, stridec, Pi); + A_dbox, start, stride, Ai, + P_dbox, startc, stridec, Pi); { HYPRE_Real center, left, right; @@ -1421,7 +1444,7 @@ hypre_PFMGSetupInterpOp_CC0_SS15 left = -a_cs[Ai] - a_as[Ai] - a_bs[Ai] - a_csw[Ai] - a_cse[Ai]; /* front */ right = -a_cn[Ai] - a_an[Ai] - a_bn[Ai] - a_cnw[Ai] - a_cne[Ai]; /* back */ break; - case 2: + case 2: default: center = a_cc[Ai] + a_cw[Ai] + a_ce[Ai] + a_cs[Ai] + a_cn[Ai] + a_csw[Ai] + a_cse[Ai] + a_cnw[Ai] + a_cne[Ai]; left = -a_bc[Ai] - a_bs[Ai] - a_bn[Ai]; /* below */ @@ -1482,7 +1505,7 @@ hypre_PFMGSetupInterpOp_CC0_SS15 left = -a_cs[Ai] - a_as[Ai] - a_bs[Ai]; /* front */ right = -a_cn[Ai] - a_an[Ai] - a_bn[Ai]; /* back */ break; - case 2: + case 2: default: center = a_cc[Ai] + a_cw[Ai] + a_ce[Ai] + a_cs[Ai] + a_cn[Ai]; left = -a_bc[Ai] - a_bw[Ai] - a_be[Ai] - a_bs[Ai] - a_bn[Ai]; /* below */ right = -a_ac[Ai] - a_aw[Ai] - a_ae[Ai] - a_as[Ai] - a_an[Ai]; /* above */ @@ -1545,16 +1568,19 @@ hypre_PFMGSetupInterpOp_CC0_SS19 HYPRE_Int rap_type, hypre_Index *P_stencil_shape ) { - //hypre_StructStencil *stencil = hypre_StructMatrixStencil(A); - // hypre_Index *stencil_shape = hypre_StructStencilShape(stencil); - //HYPRE_Int stencil_size = hypre_StructStencilSize(stencil); - //HYPRE_Int warning_cnt= 0; + HYPRE_UNUSED_VAR(Pstenc1); + HYPRE_UNUSED_VAR(rap_type); + + //hypre_StructStencil *stencil = hypre_StructMatrixStencil(A); + // hypre_Index *stencil_shape = hypre_StructStencilShape(stencil); + //HYPRE_Int stencil_size = hypre_StructStencilSize(stencil); + //HYPRE_Int warning_cnt= 0; hypre_Index index; HYPRE_Real *a_cc, *a_cw, *a_ce, *a_cs, *a_cn, *a_ac, *a_bc; HYPRE_Real *a_csw, *a_cse, *a_cne, *a_cnw; HYPRE_Real *a_aw, *a_ae, *a_as, *a_an, *a_bw, *a_be, *a_bs, *a_bn; - HYPRE_Real *p0,*p1; + HYPRE_Real *p0, *p1; p0 = hypre_StructMatrixExtractPointerByIndex(A, i, P_stencil_shape[0]); p1 = hypre_StructMatrixExtractPointerByIndex(A, i, P_stencil_shape[1]); @@ -1571,25 +1597,25 @@ hypre_PFMGSetupInterpOp_CC0_SS19 * a_bc is pointer for center coefficient in plane below *-----------------------------------------------------------------*/ - hypre_SetIndex3(index,0,0,0); + hypre_SetIndex3(index, 0, 0, 0); a_cc = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index,-1,0,0); + hypre_SetIndex3(index, -1, 0, 0); a_cw = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index,1,0,0); + hypre_SetIndex3(index, 1, 0, 0); a_ce = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index,0,-1,0); + hypre_SetIndex3(index, 0, -1, 0); a_cs = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index,0,1,0); + hypre_SetIndex3(index, 0, 1, 0); a_cn = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index,0,0,1); + hypre_SetIndex3(index, 0, 0, 1); a_ac = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index,0,0,-1); + hypre_SetIndex3(index, 0, 0, -1); a_bc = hypre_StructMatrixExtractPointerByIndex(A, i, index); /*----------------------------------------------------------------- @@ -1609,37 +1635,37 @@ hypre_PFMGSetupInterpOp_CC0_SS19 * a_cne is pointer for northeast coefficient in same plane *-----------------------------------------------------------------*/ - hypre_SetIndex3(index,-1, 0, 1); + hypre_SetIndex3(index, -1, 0, 1); a_aw = hypre_StructMatrixExtractPointerByIndex(A, i, index); hypre_SetIndex3(index, 1, 0, 1); a_ae = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index, 0,-1, 1); + hypre_SetIndex3(index, 0, -1, 1); a_as = hypre_StructMatrixExtractPointerByIndex(A, i, index); hypre_SetIndex3(index, 0, 1, 1); a_an = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index,-1, 0,-1); + hypre_SetIndex3(index, -1, 0, -1); a_bw = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index, 1, 0,-1); + hypre_SetIndex3(index, 1, 0, -1); a_be = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index, 0,-1,-1); + hypre_SetIndex3(index, 0, -1, -1); a_bs = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index, 0, 1,-1); + hypre_SetIndex3(index, 0, 1, -1); a_bn = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index,-1,-1, 0); + hypre_SetIndex3(index, -1, -1, 0); a_csw = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index, 1,-1, 0); + hypre_SetIndex3(index, 1, -1, 0); a_cse = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index,-1, 1, 0); + hypre_SetIndex3(index, -1, 1, 0); a_cnw = hypre_StructMatrixExtractPointerByIndex(A, i, index); hypre_SetIndex3(index, 1, 1, 0); @@ -1650,24 +1676,27 @@ hypre_PFMGSetupInterpOp_CC0_SS19 A_dbox, start, stride, Ai, P_dbox, startc, stridec, Pi); { - HYPRE_Real center,left,right; + HYPRE_Real center, left, right; switch (cdir) { case 0: - center = a_cc[Ai] + a_cs[Ai] + a_cn[Ai] + a_ac[Ai] + a_bc[Ai] + a_as[Ai] + a_an[Ai] + a_bs[Ai] + a_bn[Ai]; - left =-a_cw[Ai] - a_aw[Ai] - a_bw[Ai] - a_csw[Ai] - a_cnw[Ai]; - right =-a_ce[Ai] - a_ae[Ai] - a_be[Ai] - a_cse[Ai] - a_cne[Ai]; + center = a_cc[Ai] + a_cs[Ai] + a_cn[Ai] + a_ac[Ai] + a_bc[Ai] + a_as[Ai] + a_an[Ai] + a_bs[Ai] + + a_bn[Ai]; + left = -a_cw[Ai] - a_aw[Ai] - a_bw[Ai] - a_csw[Ai] - a_cnw[Ai]; + right = -a_ce[Ai] - a_ae[Ai] - a_be[Ai] - a_cse[Ai] - a_cne[Ai]; break; case 1: - center = a_cc[Ai] + a_cw[Ai] + a_ce[Ai] + a_ac[Ai] + a_bc[Ai] + a_aw[Ai] + a_ae[Ai] + a_bw[Ai] + a_be[Ai]; - left =-a_cs[Ai] - a_as[Ai] - a_bs[Ai] - a_csw[Ai] - a_cse[Ai]; - right =-a_cn[Ai] - a_an[Ai] - a_bn[Ai] - a_cnw[Ai] - a_cne[Ai]; + center = a_cc[Ai] + a_cw[Ai] + a_ce[Ai] + a_ac[Ai] + a_bc[Ai] + a_aw[Ai] + a_ae[Ai] + a_bw[Ai] + + a_be[Ai]; + left = -a_cs[Ai] - a_as[Ai] - a_bs[Ai] - a_csw[Ai] - a_cse[Ai]; + right = -a_cn[Ai] - a_an[Ai] - a_bn[Ai] - a_cnw[Ai] - a_cne[Ai]; break; - case 2: - center = a_cc[Ai] + a_cw[Ai] + a_ce[Ai] + a_cs[Ai] + a_cn[Ai] + a_csw[Ai] + a_cse[Ai] + a_cnw[Ai] + a_cne[Ai]; - left =-a_bc[Ai] - a_bw[Ai] - a_be[Ai] - a_bs[Ai] - a_bn[Ai]; - right =-a_ac[Ai] - a_aw[Ai] - a_ae[Ai] - a_as[Ai] - a_an[Ai]; + case 2: default: + center = a_cc[Ai] + a_cw[Ai] + a_ce[Ai] + a_cs[Ai] + a_cn[Ai] + a_csw[Ai] + a_cse[Ai] + a_cnw[Ai] + + a_cne[Ai]; + left = -a_bc[Ai] - a_bw[Ai] - a_be[Ai] - a_bs[Ai] - a_bn[Ai]; + right = -a_ac[Ai] - a_aw[Ai] - a_ae[Ai] - a_as[Ai] - a_an[Ai]; break; }; @@ -1681,12 +1710,12 @@ hypre_PFMGSetupInterpOp_CC0_SS19 switch (Pstenc0) { case -1: - Pp0[Pi] = left/center; - Pp1[Pi] = right/center; + Pp0[Pi] = left / center; + Pp1[Pi] = right / center; break; case 1: - Pp0[Pi] = right/center; - Pp1[Pi] = left/center; + Pp0[Pi] = right / center; + Pp1[Pi] = left / center; break; }; /* @@ -1700,8 +1729,8 @@ hypre_PFMGSetupInterpOp_CC0_SS19 */ } - if (p0[Ai] == 0.0) Pp0[Pi] = 0.0; - if (p1[Ai] == 0.0) Pp1[Pi] = 0.0; + if (p0[Ai] == 0.0) { Pp0[Pi] = 0.0; } + if (p1[Ai] == 0.0) { Pp1[Pi] = 0.0; } //printf("Pp0[%d] = %e, Pp1 = %e\n",Pi,Pp0[Pi],Pp1[Pi]); } hypre_BoxLoop2End(Ai, Pi); @@ -1729,17 +1758,20 @@ hypre_PFMGSetupInterpOp_CC0_SS27 HYPRE_Int rap_type, hypre_Index *P_stencil_shape ) { - //hypre_StructStencil *stencil = hypre_StructMatrixStencil(A); - //hypre_Index *stencil_shape = hypre_StructStencilShape(stencil); - //HYPRE_Int stencil_size = hypre_StructStencilSize(stencil); - //HYPRE_Int warning_cnt= 0; + HYPRE_UNUSED_VAR(rap_type); + HYPRE_UNUSED_VAR(Pstenc1); + + //hypre_StructStencil *stencil = hypre_StructMatrixStencil(A); + //hypre_Index *stencil_shape = hypre_StructStencilShape(stencil); + //HYPRE_Int stencil_size = hypre_StructStencilSize(stencil); + //HYPRE_Int warning_cnt= 0; hypre_Index index; HYPRE_Real *a_cc, *a_cw, *a_ce, *a_cs, *a_cn, *a_ac, *a_bc; HYPRE_Real *a_csw, *a_cse, *a_cne, *a_cnw; HYPRE_Real *a_aw, *a_ae, *a_as, *a_an, *a_bw, *a_be, *a_bs, *a_bn; - HYPRE_Real *a_asw, *a_ase, *a_ane, *a_anw,*a_bsw, *a_bse, *a_bne, *a_bnw; - HYPRE_Real *p0,*p1; + HYPRE_Real *a_asw, *a_ase, *a_ane, *a_anw, *a_bsw, *a_bse, *a_bne, *a_bnw; + HYPRE_Real *p0, *p1; p0 = hypre_StructMatrixExtractPointerByIndex(A, i, P_stencil_shape[0]); p1 = hypre_StructMatrixExtractPointerByIndex(A, i, P_stencil_shape[1]); @@ -1756,25 +1788,25 @@ hypre_PFMGSetupInterpOp_CC0_SS27 * a_bc is pointer for center coefficient in plane below *-----------------------------------------------------------------*/ - hypre_SetIndex3(index,0,0,0); + hypre_SetIndex3(index, 0, 0, 0); a_cc = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index,-1,0,0); + hypre_SetIndex3(index, -1, 0, 0); a_cw = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index,1,0,0); + hypre_SetIndex3(index, 1, 0, 0); a_ce = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index,0,-1,0); + hypre_SetIndex3(index, 0, -1, 0); a_cs = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index,0,1,0); + hypre_SetIndex3(index, 0, 1, 0); a_cn = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index,0,0,1); + hypre_SetIndex3(index, 0, 0, 1); a_ac = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index,0,0,-1); + hypre_SetIndex3(index, 0, 0, -1); a_bc = hypre_StructMatrixExtractPointerByIndex(A, i, index); /*----------------------------------------------------------------- @@ -1794,37 +1826,37 @@ hypre_PFMGSetupInterpOp_CC0_SS27 * a_cne is pointer for northeast coefficient in same plane *-----------------------------------------------------------------*/ - hypre_SetIndex3(index,-1, 0, 1); + hypre_SetIndex3(index, -1, 0, 1); a_aw = hypre_StructMatrixExtractPointerByIndex(A, i, index); hypre_SetIndex3(index, 1, 0, 1); a_ae = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index, 0,-1, 1); + hypre_SetIndex3(index, 0, -1, 1); a_as = hypre_StructMatrixExtractPointerByIndex(A, i, index); hypre_SetIndex3(index, 0, 1, 1); a_an = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index,-1, 0,-1); + hypre_SetIndex3(index, -1, 0, -1); a_bw = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index, 1, 0,-1); + hypre_SetIndex3(index, 1, 0, -1); a_be = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index, 0,-1,-1); + hypre_SetIndex3(index, 0, -1, -1); a_bs = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index, 0, 1,-1); + hypre_SetIndex3(index, 0, 1, -1); a_bn = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index,-1,-1, 0); + hypre_SetIndex3(index, -1, -1, 0); a_csw = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index, 1,-1, 0); + hypre_SetIndex3(index, 1, -1, 0); a_cse = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index,-1, 1, 0); + hypre_SetIndex3(index, -1, 1, 0); a_cnw = hypre_StructMatrixExtractPointerByIndex(A, i, index); hypre_SetIndex3(index, 1, 1, 0); @@ -1843,28 +1875,28 @@ hypre_PFMGSetupInterpOp_CC0_SS27 * a_bne is pointer for northeast coefficient in plane below *-----------------------------------------------------------------*/ - hypre_SetIndex3(index,-1,-1, 1); + hypre_SetIndex3(index, -1, -1, 1); a_asw = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index, 1,-1, 1); + hypre_SetIndex3(index, 1, -1, 1); a_ase = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index,-1, 1, 1); + hypre_SetIndex3(index, -1, 1, 1); a_anw = hypre_StructMatrixExtractPointerByIndex(A, i, index); hypre_SetIndex3(index, 1, 1, 1); a_ane = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index,-1,-1,-1); + hypre_SetIndex3(index, -1, -1, -1); a_bsw = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index, 1,-1,-1); + hypre_SetIndex3(index, 1, -1, -1); a_bse = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index,-1, 1,-1); + hypre_SetIndex3(index, -1, 1, -1); a_bnw = hypre_StructMatrixExtractPointerByIndex(A, i, index); - hypre_SetIndex3(index, 1, 1,-1); + hypre_SetIndex3(index, 1, 1, -1); a_bne = hypre_StructMatrixExtractPointerByIndex(A, i, index); #define DEVICE_VAR is_device_ptr(a_cc,a_cs,a_cn,a_ac,a_bc,a_as,a_an,a_bs,a_bn,a_cw,a_aw,a_bw,a_csw,a_cnw,a_asw,a_anw,a_bsw,a_bnw,a_ce,a_ae,a_be,a_cse,a_cne,a_ase,a_ane,a_bse,a_bne,Pp0,Pp1,p0,p1) @@ -1872,25 +1904,34 @@ hypre_PFMGSetupInterpOp_CC0_SS27 A_dbox, start, stride, Ai, P_dbox, startc, stridec, Pi); { - HYPRE_Real center,left,right; + HYPRE_Real center, left, right; switch (cdir) { - case 0: - center = a_cc[Ai] + a_cs[Ai] + a_cn[Ai] + a_ac[Ai] + a_bc[Ai] + a_as[Ai] + a_an[Ai] + a_bs[Ai] + a_bn[Ai]; - left =-a_cw[Ai] - a_aw[Ai] - a_bw[Ai] - a_csw[Ai] - a_cnw[Ai] - a_asw[Ai] - a_anw[Ai] - a_bsw[Ai] - a_bnw[Ai]; - right =-a_ce[Ai] - a_ae[Ai] - a_be[Ai] - a_cse[Ai] - a_cne[Ai] - a_ase[Ai] - a_ane[Ai] - a_bse[Ai] - a_bne[Ai]; - break; - case 1: - center = a_cc[Ai] + a_cw[Ai] + a_ce[Ai] + a_ac[Ai] + a_bc[Ai] + a_aw[Ai] + a_ae[Ai] + a_bw[Ai] + a_be[Ai]; - left =-a_cs[Ai] - a_as[Ai] - a_bs[Ai] - a_csw[Ai] - a_cse[Ai] - a_asw[Ai] - a_ase[Ai] - a_bsw[Ai] - a_bse[Ai]; - right =-a_cn[Ai] - a_an[Ai] - a_bn[Ai] - a_cnw[Ai] - a_cne[Ai] - a_anw[Ai] - a_ane[Ai] - a_bnw[Ai] - a_bne[Ai]; - break; - case 2: - center = a_cc[Ai] + a_cw[Ai] + a_ce[Ai] + a_cs[Ai] + a_cn[Ai] + a_csw[Ai] + a_cse[Ai] + a_cnw[Ai] + a_cne[Ai]; - left =-a_bc[Ai] - a_bw[Ai] - a_be[Ai] - a_bs[Ai] - a_bn[Ai] - a_bsw[Ai] - a_bse[Ai] - a_bnw[Ai] - a_bne[Ai]; - right =-a_ac[Ai] - a_aw[Ai] - a_ae[Ai] - a_as[Ai] - a_an[Ai] - a_asw[Ai] - a_ase[Ai] - a_anw[Ai] - a_ane[Ai]; - break; + case 0: + center = a_cc[Ai] + a_cs[Ai] + a_cn[Ai] + a_ac[Ai] + a_bc[Ai] + a_as[Ai] + a_an[Ai] + a_bs[Ai] + + a_bn[Ai]; + left = -a_cw[Ai] - a_aw[Ai] - a_bw[Ai] - a_csw[Ai] - a_cnw[Ai] - a_asw[Ai] - a_anw[Ai] - a_bsw[Ai] + - a_bnw[Ai]; + right = -a_ce[Ai] - a_ae[Ai] - a_be[Ai] - a_cse[Ai] - a_cne[Ai] - a_ase[Ai] - a_ane[Ai] - a_bse[Ai] + - a_bne[Ai]; + break; + case 1: + center = a_cc[Ai] + a_cw[Ai] + a_ce[Ai] + a_ac[Ai] + a_bc[Ai] + a_aw[Ai] + a_ae[Ai] + a_bw[Ai] + + a_be[Ai]; + left = -a_cs[Ai] - a_as[Ai] - a_bs[Ai] - a_csw[Ai] - a_cse[Ai] - a_asw[Ai] - a_ase[Ai] - a_bsw[Ai] + - a_bse[Ai]; + right = -a_cn[Ai] - a_an[Ai] - a_bn[Ai] - a_cnw[Ai] - a_cne[Ai] - a_anw[Ai] - a_ane[Ai] - a_bnw[Ai] + - a_bne[Ai]; + break; + case 2: default: + center = a_cc[Ai] + a_cw[Ai] + a_ce[Ai] + a_cs[Ai] + a_cn[Ai] + a_csw[Ai] + a_cse[Ai] + a_cnw[Ai] + + a_cne[Ai]; + left = -a_bc[Ai] - a_bw[Ai] - a_be[Ai] - a_bs[Ai] - a_bn[Ai] - a_bsw[Ai] - a_bse[Ai] - a_bnw[Ai] - + a_bne[Ai]; + right = -a_ac[Ai] - a_aw[Ai] - a_ae[Ai] - a_as[Ai] - a_an[Ai] - a_asw[Ai] - a_ase[Ai] - a_anw[Ai] - + a_ane[Ai]; + break; }; if (!center) @@ -1904,12 +1945,12 @@ hypre_PFMGSetupInterpOp_CC0_SS27 switch (Pstenc0) { case -1: - Pp0[Pi] = left/center; - Pp1[Pi] = right/center; + Pp0[Pi] = left / center; + Pp1[Pi] = right / center; break; case 1: - Pp0[Pi] = right/center; - Pp1[Pi] = left/center; + Pp0[Pi] = right / center; + Pp1[Pi] = left / center; break; }; /* @@ -1923,8 +1964,8 @@ hypre_PFMGSetupInterpOp_CC0_SS27 */ } - if (p0[Ai] == 0.0) Pp0[Pi] = 0.0; - if (p1[Ai] == 0.0) Pp1[Pi] = 0.0; + if (p0[Ai] == 0.0) { Pp0[Pi] = 0.0; } + if (p1[Ai] == 0.0) { Pp1[Pi] = 0.0; } //printf("Pp0[%d] = %e, Pp1 = %e\n",Pi,Pp0[Pi],Pp1[Pi]); } hypre_BoxLoop2End(Ai, Pi); @@ -1934,4 +1975,3 @@ hypre_PFMGSetupInterpOp_CC0_SS27 } #endif - diff --git a/external/hypre/src/struct_ls/pfmg_setup_rap.c b/external/hypre/src/struct_ls/pfmg_setup_rap.c index 331b7c85..2823f007 100644 --- a/external/hypre/src/struct_ls/pfmg_setup_rap.c +++ b/external/hypre/src/struct_ls/pfmg_setup_rap.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -32,7 +32,7 @@ hypre_PFMGCreateRAPOp( hypre_StructMatrix *R, HYPRE_Int cdir, HYPRE_Int rap_type ) { - hypre_StructMatrix *RAP=NULL; + hypre_StructMatrix *RAP = NULL; hypre_StructStencil *stencil; HYPRE_Int P_stored_as_transpose = 0; HYPRE_Int constant_coefficient; @@ -44,11 +44,11 @@ hypre_PFMGCreateRAPOp( hypre_StructMatrix *R, switch (hypre_StructStencilNDim(stencil)) { case 2: - RAP = hypre_PFMG2CreateRAPOp(R ,A, P, coarse_grid, cdir); + RAP = hypre_PFMG2CreateRAPOp(R, A, P, coarse_grid, cdir); break; case 3: - RAP = hypre_PFMG3CreateRAPOp(R ,A, P, coarse_grid, cdir); + RAP = hypre_PFMG3CreateRAPOp(R, A, P, coarse_grid, cdir); break; } } @@ -58,23 +58,23 @@ hypre_PFMGCreateRAPOp( hypre_StructMatrix *R, switch (hypre_StructStencilNDim(stencil)) { case 2: - RAP = hypre_PFMGCreateCoarseOp5(R ,A, P, coarse_grid, cdir); + RAP = hypre_PFMGCreateCoarseOp5(R, A, P, coarse_grid, cdir); break; case 3: - RAP = hypre_PFMGCreateCoarseOp7(R ,A, P, coarse_grid, cdir); + RAP = hypre_PFMGCreateCoarseOp7(R, A, P, coarse_grid, cdir); break; } } else if (rap_type == 2) { - RAP = hypre_SemiCreateRAPOp(R ,A, P, coarse_grid, cdir, + RAP = hypre_SemiCreateRAPOp(R, A, P, coarse_grid, cdir, P_stored_as_transpose); } constant_coefficient = hypre_StructMatrixConstantCoefficient(A); - if ( constant_coefficient==2 && rap_type==0 ) + if ( constant_coefficient == 2 && rap_type == 0 ) { /* A has variable diagonal, so, in the Galerkin case, P (and R) is entirely variable coefficient. Thus RAP will be variable coefficient */ @@ -140,6 +140,8 @@ hypre_PFMGSetupRAPOp( hypre_StructMatrix *R, #endif stencil = hypre_StructMatrixStencil(A); + HYPRE_ANNOTATE_FUNC_BEGIN; + if (rap_type == 0) { switch (hypre_StructStencilNDim(stencil)) @@ -153,8 +155,10 @@ hypre_PFMGSetupRAPOp( hypre_StructMatrix *R, /*-------------------------------------------------------------------- * For non-symmetric A, set upper triangular coefficients as well *--------------------------------------------------------------------*/ - if(!hypre_StructMatrixSymmetric(A)) + if (!hypre_StructMatrixSymmetric(A)) + { hypre_PFMG2BuildRAPNoSym(A, P, R, cdir, cindex, cstride, Ac_tmp); + } break; @@ -168,8 +172,10 @@ hypre_PFMGSetupRAPOp( hypre_StructMatrix *R, /*-------------------------------------------------------------------- * For non-symmetric A, set upper triangular coefficients as well *--------------------------------------------------------------------*/ - if(!hypre_StructMatrixSymmetric(A)) + if (!hypre_StructMatrixSymmetric(A)) + { hypre_PFMG3BuildRAPNoSym(A, P, R, cdir, cindex, cstride, Ac_tmp); + } break; } @@ -200,31 +206,39 @@ hypre_PFMGSetupRAPOp( hypre_StructMatrix *R, #if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) if ( data_location_A != data_location_Ac ) { - if (constant_coefficient == 0) - { - hypre_TMemcpy(hypre_StructMatrixDataConst(Ac),hypre_StructMatrixData(Ac_tmp),HYPRE_Complex,hypre_StructMatrixDataSize(Ac_tmp),HYPRE_MEMORY_HOST,HYPRE_MEMORY_DEVICE); - } - else if (constant_coefficient == 1) - { - hypre_TMemcpy(hypre_StructMatrixDataConst(Ac),hypre_StructMatrixDataConst(Ac_tmp),HYPRE_Complex,hypre_StructMatrixDataConstSize(Ac_tmp),HYPRE_MEMORY_HOST,HYPRE_MEMORY_HOST); - } - else if (constant_coefficient == 2) - { - hypre_TMemcpy(hypre_StructMatrixDataConst(Ac),hypre_StructMatrixDataConst(Ac_tmp),HYPRE_Complex,hypre_StructMatrixDataConstSize(Ac_tmp),HYPRE_MEMORY_HOST,HYPRE_MEMORY_HOST); - hypre_StructStencil *stencil_c = hypre_StructMatrixStencil(Ac); - HYPRE_Int stencil_size = hypre_StructStencilSize(stencil_c); - HYPRE_Complex *Acdiag = hypre_StructMatrixDataConst(Ac) + stencil_size; - hypre_TMemcpy(Acdiag, hypre_StructMatrixData(Ac_tmp),HYPRE_Complex,hypre_StructMatrixDataSize(Ac_tmp),HYPRE_MEMORY_HOST,HYPRE_MEMORY_DEVICE); - } - - hypre_HandleStructExecPolicy(hypre_handle()) = data_location_Ac == HYPRE_MEMORY_DEVICE ? HYPRE_EXEC_DEVICE : HYPRE_EXEC_HOST; + if (constant_coefficient == 0) + { + hypre_TMemcpy(hypre_StructMatrixDataConst(Ac), hypre_StructMatrixData(Ac_tmp), HYPRE_Complex, + hypre_StructMatrixDataSize(Ac_tmp), HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); + } + else if (constant_coefficient == 1) + { + hypre_TMemcpy(hypre_StructMatrixDataConst(Ac), hypre_StructMatrixDataConst(Ac_tmp), HYPRE_Complex, + hypre_StructMatrixDataConstSize(Ac_tmp), HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + } + else if (constant_coefficient == 2) + { + hypre_TMemcpy(hypre_StructMatrixDataConst(Ac), hypre_StructMatrixDataConst(Ac_tmp), HYPRE_Complex, + hypre_StructMatrixDataConstSize(Ac_tmp), HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + hypre_StructStencil *stencil_c = hypre_StructMatrixStencil(Ac); + HYPRE_Int stencil_size = hypre_StructStencilSize(stencil_c); + HYPRE_Complex *Acdiag = hypre_StructMatrixDataConst(Ac) + stencil_size; + hypre_TMemcpy(Acdiag, hypre_StructMatrixData(Ac_tmp), HYPRE_Complex, + hypre_StructMatrixDataSize(Ac_tmp), HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); + } + + hypre_HandleStructExecPolicy(hypre_handle()) = data_location_Ac == HYPRE_MEMORY_DEVICE ? + HYPRE_EXEC_DEVICE : HYPRE_EXEC_HOST; hypre_StructGridDataLocation(hypre_StructMatrixGrid(Ac)) = data_location_Ac; hypre_StructMatrixAssemble(Ac); - hypre_HandleStructExecPolicy(hypre_handle()) = data_location_A == HYPRE_MEMORY_DEVICE ? HYPRE_EXEC_DEVICE : HYPRE_EXEC_HOST; + hypre_HandleStructExecPolicy(hypre_handle()) = data_location_A == HYPRE_MEMORY_DEVICE ? + HYPRE_EXEC_DEVICE : HYPRE_EXEC_HOST; hypre_StructMatrixDestroy(Ac_tmp); } #endif + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; } diff --git a/external/hypre/src/struct_ls/pfmg_setup_rap5.c b/external/hypre/src/struct_ls/pfmg_setup_rap5.c index 8b3c4186..48b8b8f1 100644 --- a/external/hypre/src/struct_ls/pfmg_setup_rap5.c +++ b/external/hypre/src/struct_ls/pfmg_setup_rap5.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -35,6 +35,9 @@ hypre_PFMGCreateCoarseOp5( hypre_StructMatrix *R, hypre_StructGrid *coarse_grid, HYPRE_Int cdir ) { + HYPRE_UNUSED_VAR(R); + HYPRE_UNUSED_VAR(P); + hypre_StructMatrix *RAP; hypre_Index *RAP_stencil_shape; @@ -75,9 +78,9 @@ hypre_PFMGCreateCoarseOp5( hypre_StructMatrix *R, /*-------------------------------------------------------------- * Storage for 5 elements (c,w,e,n,s) *--------------------------------------------------------------*/ - if (i*j == 0) + if (i * j == 0) { - hypre_SetIndex3(index_temp,i,j,0); + hypre_SetIndex3(index_temp, i, j, 0); MapIndex(index_temp, cdir, RAP_stencil_shape[stencil_rank]); stencil_rank++; } @@ -108,9 +111,9 @@ hypre_PFMGCreateCoarseOp5( hypre_StructMatrix *R, /*-------------------------------------------------------------- * Store 3 elements in (c,w,s) *--------------------------------------------------------------*/ - if( i*j == 0 ) + if ( i * j == 0 ) { - hypre_SetIndex3(index_temp,i,j,0); + hypre_SetIndex3(index_temp, i, j, 0); MapIndex(index_temp, cdir, RAP_stencil_shape[stencil_rank]); stencil_rank++; } @@ -209,7 +212,7 @@ hypre_PFMGBuildCoarseOp5( hypre_StructMatrix *A, constant_coefficient = hypre_StructMatrixConstantCoefficient(RAP); hypre_assert( hypre_StructMatrixConstantCoefficient(A) == constant_coefficient ); - if ( constant_coefficient==0 ) + if ( constant_coefficient == 0 ) { hypre_assert( hypre_StructMatrixConstantCoefficient(R) == 0 ); hypre_assert( hypre_StructMatrixConstantCoefficient(P) == 0 ); @@ -248,11 +251,11 @@ hypre_PFMGBuildCoarseOp5( hypre_StructMatrix *A, * pa is pointer for weight for f-point above c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); pa = hypre_StructMatrixExtractPointerByIndex(P, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); pb = hypre_StructMatrixExtractPointerByIndex(P, fi, index); //RL PTROFFSET @@ -268,23 +271,23 @@ hypre_PFMGBuildCoarseOp5( hypre_StructMatrix *A, * a_ca is pointer for above coefficient *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,0); + hypre_SetIndex3(index_temp, 0, 0, 0); MapIndex(index_temp, cdir, index); a_cc = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,0,0); + hypre_SetIndex3(index_temp, -1, 0, 0); MapIndex(index_temp, cdir, index); a_cw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); a_ce = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); a_cb = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); a_ca = hypre_StructMatrixExtractPointerByIndex(A, fi, index); @@ -293,23 +296,23 @@ hypre_PFMGBuildCoarseOp5( hypre_StructMatrix *A, * rap_cc is pointer for center coefficient (etc.) *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,0); + hypre_SetIndex3(index_temp, 0, 0, 0); MapIndex(index_temp, cdir, index); rap_cc = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,0,0); + hypre_SetIndex3(index_temp, -1, 0, 0); MapIndex(index_temp, cdir, index); rap_cw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); rap_ce = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); rap_cb = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); rap_ca = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); @@ -321,18 +324,18 @@ hypre_PFMGBuildCoarseOp5( hypre_StructMatrix *A, * Offsets are used in refering to data associated with other points. *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); - OffsetP = hypre_BoxOffsetDistance(P_dbox,index); - OffsetA = hypre_BoxOffsetDistance(A_dbox,index); + OffsetP = hypre_BoxOffsetDistance(P_dbox, index); + OffsetA = hypre_BoxOffsetDistance(A_dbox, index); /*-------------------------------------------------------------- * Loop for symmetric 5-point fine grid operator; produces a * symmetric 5-point coarse grid operator. *--------------------------------------------------------------*/ - if ( constant_coefficient==0 ) + if ( constant_coefficient == 0 ) { hypre_BoxGetSize(cgrid_box, loop_size); @@ -342,7 +345,7 @@ hypre_PFMGBuildCoarseOp5( hypre_StructMatrix *A, A_dbox, fstart, stridef, iA, RAP_dbox, cstart, stridec, iAc); { - HYPRE_Int iAm1,iAp1,iPm1,iPp1; + HYPRE_Int iAm1, iAp1, iPm1, iPp1; HYPRE_Real west, east; iAm1 = iA - OffsetA; @@ -352,7 +355,7 @@ hypre_PFMGBuildCoarseOp5( hypre_StructMatrix *A, iPp1 = iP + OffsetP; rap_cb[iAc] = a_cb[iA] * pa[iPm1]; - rap_ca[iAc] = a_ca[iA] * pb[iPp1-pbOffset]; + rap_ca[iAc] = a_ca[iA] * pb[iPp1 - pbOffset]; west = a_cw[iA] + 0.5 * a_cw[iAm1] + 0.5 * a_cw[iAp1]; east = a_ce[iA] + 0.5 * a_ce[iAm1] + 0.5 * a_ce[iAp1]; @@ -360,40 +363,40 @@ hypre_PFMGBuildCoarseOp5( hypre_StructMatrix *A, /*----------------------------------------------------- * Prevent non-zero entries reaching off grid *-----------------------------------------------------*/ - if(a_cw[iA] == 0.0) west = 0.0; - if(a_ce[iA] == 0.0) east = 0.0; + if (a_cw[iA] == 0.0) { west = 0.0; } + if (a_ce[iA] == 0.0) { east = 0.0; } rap_cw[iAc] = west; rap_ce[iAc] = east; rap_cc[iAc] = a_cc[iA] + a_cw[iA] + a_ce[iA] - + a_cb[iA] * pb[iP-pbOffset] + a_ca[iA] * pa[iP] - - west - east; + + a_cb[iA] * pb[iP - pbOffset] + a_ca[iA] * pa[iP] + - west - east; } hypre_BoxLoop3End(iP, iA, iAc); #undef DEVICE_VAR } - else if ( constant_coefficient==1 ) + else if ( constant_coefficient == 1 ) { rap_cb[0] = rap_ca[0] = a_cb[0] * pa[0]; - rap_cw[0] = rap_ce[0] = 2.0*a_cw[0]; + rap_cw[0] = rap_ce[0] = 2.0 * a_cw[0]; - rap_cc[0] = a_cc[0] - 2.0*( a_cw[0] - rap_cb[0] ); + rap_cc[0] = a_cc[0] - 2.0 * ( a_cw[0] - rap_cb[0] ); } - else if ( constant_coefficient==2 ) + else if ( constant_coefficient == 2 ) { /* NOTE: This does not reduce to either of the above operators unless * the row sum is zero and the interpolation weights are 1/2 */ - rap_cb[0] = rap_ca[0] = 0.5*a_cb[0]; + rap_cb[0] = rap_ca[0] = 0.5 * a_cb[0]; - rap_cw[0] = rap_ce[0] = 2.0*a_cw[0]; + rap_cw[0] = rap_ce[0] = 2.0 * a_cw[0]; - center_int = 3.0*a_cb[0]; - center_bdy = 0.5*a_cb[0] + (a_cw[0] + a_cb[0]); + center_int = 3.0 * a_cb[0]; + center_bdy = 0.5 * a_cb[0] + (a_cw[0] + a_cb[0]); hypre_BoxGetSize(cgrid_box, loop_size); @@ -402,7 +405,7 @@ hypre_PFMGBuildCoarseOp5( hypre_StructMatrix *A, A_dbox, fstart, stridef, iA, RAP_dbox, cstart, stridec, iAc); { - rap_cc[iAc] = 2.0*a_cc[iA] + center_int; + rap_cc[iAc] = 2.0 * a_cc[iA] + center_int; } hypre_BoxLoop2End(iA, iAc); #undef DEVICE_VAR @@ -435,7 +438,7 @@ hypre_PFMGBuildCoarseOp5( hypre_StructMatrix *A, A_dbox, bfstart, stridef, iA, RAP_dbox, bcstart, stridec, iAc); { - rap_cc[iAc] -= 0.5*a_cc[iA] + center_bdy; + rap_cc[iAc] -= 0.5 * a_cc[iA] + center_bdy; } hypre_BoxLoop2End(iA, iAc); #undef DEVICE_VAR diff --git a/external/hypre/src/struct_ls/pfmg_setup_rap7.c b/external/hypre/src/struct_ls/pfmg_setup_rap7.c index ee8e46c8..a1f22849 100644 --- a/external/hypre/src/struct_ls/pfmg_setup_rap7.c +++ b/external/hypre/src/struct_ls/pfmg_setup_rap7.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -36,6 +36,9 @@ hypre_PFMGCreateCoarseOp7( hypre_StructMatrix *R, hypre_StructGrid *coarse_grid, HYPRE_Int cdir ) { + HYPRE_UNUSED_VAR(R); + HYPRE_UNUSED_VAR(P); + hypre_StructMatrix *RAP; hypre_Index *RAP_stencil_shape; @@ -78,9 +81,9 @@ hypre_PFMGCreateCoarseOp7( hypre_StructMatrix *R, /*-------------------------------------------------------------- * Storage for 7 elements (c,w,e,n,s,a,b) *--------------------------------------------------------------*/ - if (i*j == 0 && i*k == 0 && j*k == 0) + if (i * j == 0 && i * k == 0 && j * k == 0) { - hypre_SetIndex3(index_temp,i,j,k); + hypre_SetIndex3(index_temp, i, j, k); MapIndex(index_temp, cdir, RAP_stencil_shape[stencil_rank]); stencil_rank++; } @@ -114,9 +117,9 @@ hypre_PFMGCreateCoarseOp7( hypre_StructMatrix *R, /*-------------------------------------------------------------- * Store 4 elements in (c,w,s,b) *--------------------------------------------------------------*/ - if (i*j == 0 && i*k == 0 && j*k == 0) + if (i * j == 0 && i * k == 0 && j * k == 0) { - hypre_SetIndex3(index_temp,i,j,k); + hypre_SetIndex3(index_temp, i, j, k); MapIndex(index_temp, cdir, RAP_stencil_shape[stencil_rank]); stencil_rank++; } @@ -215,7 +218,7 @@ hypre_PFMGBuildCoarseOp7( hypre_StructMatrix *A, constant_coefficient = hypre_StructMatrixConstantCoefficient(RAP); hypre_assert( hypre_StructMatrixConstantCoefficient(A) == constant_coefficient ); - if ( constant_coefficient==0 ) + if ( constant_coefficient == 0 ) { hypre_assert( hypre_StructMatrixConstantCoefficient(R) == 0 ); hypre_assert( hypre_StructMatrixConstantCoefficient(P) == 0 ); @@ -254,11 +257,11 @@ hypre_PFMGBuildCoarseOp7( hypre_StructMatrix *A, * pa is pointer for weight for f-point above c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,-1); + hypre_SetIndex3(index_temp, 0, 0, -1); MapIndex(index_temp, cdir, index); pa = hypre_StructMatrixExtractPointerByIndex(P, fi, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); pb = hypre_StructMatrixExtractPointerByIndex(P, fi, index); //RL PTROFFSET @@ -276,31 +279,31 @@ hypre_PFMGBuildCoarseOp7( hypre_StructMatrix *A, * a_ca is pointer for above coefficient *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,0); + hypre_SetIndex3(index_temp, 0, 0, 0); MapIndex(index_temp, cdir, index); a_cc = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,0,0); + hypre_SetIndex3(index_temp, -1, 0, 0); MapIndex(index_temp, cdir, index); a_cw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); a_ce = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); a_cs = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); a_cn = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,0,-1); + hypre_SetIndex3(index_temp, 0, 0, -1); MapIndex(index_temp, cdir, index); a_cb = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); a_ca = hypre_StructMatrixExtractPointerByIndex(A, fi, index); @@ -309,31 +312,31 @@ hypre_PFMGBuildCoarseOp7( hypre_StructMatrix *A, * rap_cc is pointer for center coefficient (etc.) *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,0); + hypre_SetIndex3(index_temp, 0, 0, 0); MapIndex(index_temp, cdir, index); rap_cc = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,0,0); + hypre_SetIndex3(index_temp, -1, 0, 0); MapIndex(index_temp, cdir, index); rap_cw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); rap_ce = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); rap_cs = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); rap_cn = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,0,-1); + hypre_SetIndex3(index_temp, 0, 0, -1); MapIndex(index_temp, cdir, index); rap_cb = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); rap_ca = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); @@ -345,18 +348,18 @@ hypre_PFMGBuildCoarseOp7( hypre_StructMatrix *A, * Offsets are used in refering to data associated with other points. *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); - OffsetP = hypre_BoxOffsetDistance(P_dbox,index); - OffsetA = hypre_BoxOffsetDistance(A_dbox,index); + OffsetP = hypre_BoxOffsetDistance(P_dbox, index); + OffsetA = hypre_BoxOffsetDistance(A_dbox, index); /*-------------------------------------------------------------- * Loop for symmetric 7-point fine grid operator; produces a * symmetric 7-point coarse grid operator. *--------------------------------------------------------------*/ - if ( constant_coefficient==0 ) + if ( constant_coefficient == 0 ) { hypre_BoxGetSize(cgrid_box, loop_size); @@ -366,8 +369,8 @@ hypre_PFMGBuildCoarseOp7( hypre_StructMatrix *A, A_dbox, fstart, stridef, iA, RAP_dbox, cstart, stridec, iAc); { - HYPRE_Int iAm1,iAp1,iPm1,iPp1; - HYPRE_Real west,east,south,north; + HYPRE_Int iAm1, iAp1, iPm1, iPp1; + HYPRE_Real west, east, south, north; iAm1 = iA - OffsetA; iAp1 = iA + OffsetA; @@ -376,7 +379,7 @@ hypre_PFMGBuildCoarseOp7( hypre_StructMatrix *A, iPp1 = iP + OffsetP; rap_cb[iAc] = a_cb[iA] * pa[iPm1]; - rap_ca[iAc] = a_ca[iA] * pb[iPp1-pbOffset]; + rap_ca[iAc] = a_ca[iA] * pb[iPp1 - pbOffset]; west = a_cw[iA] + 0.5 * a_cw[iAm1] + 0.5 * a_cw[iAp1]; east = a_ce[iA] + 0.5 * a_ce[iAm1] + 0.5 * a_ce[iAp1]; @@ -386,10 +389,10 @@ hypre_PFMGBuildCoarseOp7( hypre_StructMatrix *A, /*----------------------------------------------------- * Prevent non-zero entries reaching off grid *-----------------------------------------------------*/ - if(a_cw[iA] == 0.0) west = 0.0; - if(a_ce[iA] == 0.0) east = 0.0; - if(a_cs[iA] == 0.0) south = 0.0; - if(a_cn[iA] == 0.0) north = 0.0; + if (a_cw[iA] == 0.0) { west = 0.0; } + if (a_ce[iA] == 0.0) { east = 0.0; } + if (a_cs[iA] == 0.0) { south = 0.0; } + if (a_cn[iA] == 0.0) { north = 0.0; } rap_cw[iAc] = west; rap_ce[iAc] = east; @@ -397,36 +400,36 @@ hypre_PFMGBuildCoarseOp7( hypre_StructMatrix *A, rap_cn[iAc] = north; rap_cc[iAc] = a_cc[iA] - + a_cw[iA] + a_ce[iA] + a_cs[iA] + a_cn[iA] - + a_cb[iA] * pb[iP-pbOffset] + a_ca[iA] * pa[iP] - - west - east - south - north; + + a_cw[iA] + a_ce[iA] + a_cs[iA] + a_cn[iA] + + a_cb[iA] * pb[iP - pbOffset] + a_ca[iA] * pa[iP] + - west - east - south - north; } hypre_BoxLoop3End(iP, iA, iAc); #undef DEVICE_VAR } - else if ( constant_coefficient==1 ) + else if ( constant_coefficient == 1 ) { rap_cb[0] = rap_ca[0] = a_cb[0] * pa[0]; - rap_cw[0] = rap_ce[0] = 2.0*a_cw[0]; - rap_cs[0] = rap_cn[0] = 2.0*a_cs[0]; + rap_cw[0] = rap_ce[0] = 2.0 * a_cw[0]; + rap_cs[0] = rap_cn[0] = 2.0 * a_cs[0]; - rap_cc[0] = a_cc[0] - 2.0*( a_cw[0] + a_cs[0] - rap_cb[0] ); + rap_cc[0] = a_cc[0] - 2.0 * ( a_cw[0] + a_cs[0] - rap_cb[0] ); } - else if ( constant_coefficient==2 ) + else if ( constant_coefficient == 2 ) { /* NOTE: This does not reduce to either of the above operators unless * the row sum is zero and the interpolation weights are 1/2 */ - rap_cb[0] = rap_ca[0] = 0.5*a_cb[0]; + rap_cb[0] = rap_ca[0] = 0.5 * a_cb[0]; - rap_cw[0] = rap_ce[0] = 2.0*a_cw[0]; - rap_cs[0] = rap_cn[0] = 2.0*a_cs[0]; + rap_cw[0] = rap_ce[0] = 2.0 * a_cw[0]; + rap_cs[0] = rap_cn[0] = 2.0 * a_cs[0]; - center_int = 3.0*a_cb[0]; - center_bdy = 0.5*a_cb[0] + (a_cw[0] + a_cs[0] + a_cb[0]); + center_int = 3.0 * a_cb[0]; + center_bdy = 0.5 * a_cb[0] + (a_cw[0] + a_cs[0] + a_cb[0]); hypre_BoxGetSize(cgrid_box, loop_size); @@ -435,7 +438,7 @@ hypre_PFMGBuildCoarseOp7( hypre_StructMatrix *A, A_dbox, fstart, stridef, iA, RAP_dbox, cstart, stridec, iAc); { - rap_cc[iAc] = 2.0*a_cc[iA] + center_int; + rap_cc[iAc] = 2.0 * a_cc[iA] + center_int; } hypre_BoxLoop2End(iA, iAc); #undef DEVICE_VAR @@ -469,7 +472,7 @@ hypre_PFMGBuildCoarseOp7( hypre_StructMatrix *A, A_dbox, bfstart, stridef, iA, RAP_dbox, bcstart, stridec, iAc); { - rap_cc[iAc] -= 0.5*a_cc[iA] + center_bdy; + rap_cc[iAc] -= 0.5 * a_cc[iA] + center_bdy; } hypre_BoxLoop2End(iA, iAc); #undef DEVICE_VAR diff --git a/external/hypre/src/struct_ls/pfmg_solve.c b/external/hypre/src/struct_ls/pfmg_solve.c index 1f442e2a..06c279a3 100644 --- a/external/hypre/src/struct_ls/pfmg_solve.c +++ b/external/hypre/src/struct_ls/pfmg_solve.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -105,7 +105,7 @@ hypre_PFMGSolve( void *pfmg_vdata, { /* eps = (tol^2) */ b_dot_b = hypre_StructInnerProd(b_l[0], b_l[0]); - eps = tol*tol; + eps = tol * tol; /* if rhs is zero, return a zero solution */ if (b_dot_b == 0.0) @@ -143,16 +143,20 @@ hypre_PFMGSolve( void *pfmg_vdata, } /* fine grid pre-relaxation */ + HYPRE_ANNOTATE_REGION_BEGIN("%s", "Relaxation"); hypre_PFMGRelaxSetPreRelax(relax_data_l[0]); hypre_PFMGRelaxSetMaxIter(relax_data_l[0], num_pre_relax); hypre_PFMGRelaxSetZeroGuess(relax_data_l[0], zero_guess); hypre_PFMGRelax(relax_data_l[0], A_l[0], b_l[0], x_l[0]); zero_guess = 0; + HYPRE_ANNOTATE_REGION_END("%s", "Relaxation"); /* compute fine grid residual (b - Ax) */ + HYPRE_ANNOTATE_REGION_BEGIN("%s", "Residual"); hypre_StructCopy(b_l[0], r_l[0]); hypre_StructMatvecCompute(matvec_data_l[0], -1.0, A_l[0], x_l[0], 1.0, r_l[0]); + HYPRE_ANNOTATE_REGION_END("%s", "Residual"); /* convergence check */ if (tol > 0.0) @@ -161,10 +165,10 @@ hypre_PFMGSolve( void *pfmg_vdata, if (logging > 0) { - norms[i] = sqrt(r_dot_r); + norms[i] = hypre_sqrt(r_dot_r); if (b_dot_b > 0) { - rel_norms[i] = sqrt(r_dot_r/b_dot_b); + rel_norms[i] = hypre_sqrt(r_dot_r / b_dot_b); } else { @@ -173,9 +177,9 @@ hypre_PFMGSolve( void *pfmg_vdata, } /* always do at least 1 V-cycle */ - if ((r_dot_r/b_dot_b < eps) && (i > 0)) + if ((r_dot_r / b_dot_b < eps) && (i > 0)) { - if ( ((rel_change) && (e_dot_e/x_dot_x) < eps) || (!rel_change) ) + if ( ((rel_change) && (e_dot_e / x_dot_x) < eps) || (!rel_change) ) { HYPRE_ANNOTATE_MGLEVEL_END(0); break; @@ -215,15 +219,19 @@ hypre_PFMGSolve( void *pfmg_vdata, if (active_l[l]) { /* pre-relaxation */ + HYPRE_ANNOTATE_REGION_BEGIN("%s", "Relaxation"); hypre_PFMGRelaxSetPreRelax(relax_data_l[l]); hypre_PFMGRelaxSetMaxIter(relax_data_l[l], num_pre_relax); hypre_PFMGRelaxSetZeroGuess(relax_data_l[l], 1); hypre_PFMGRelax(relax_data_l[l], A_l[l], b_l[l], x_l[l]); + HYPRE_ANNOTATE_REGION_END("%s", "Relaxation"); /* compute residual (b - Ax) */ + HYPRE_ANNOTATE_REGION_BEGIN("%s", "Residual"); hypre_StructCopy(b_l[l], r_l[l]); hypre_StructMatvecCompute(matvec_data_l[l], -1.0, A_l[l], x_l[l], 1.0, r_l[l]); + HYPRE_ANNOTATE_REGION_END("%s", "Residual"); } else { @@ -233,15 +241,15 @@ hypre_PFMGSolve( void *pfmg_vdata, } /* restrict residual */ - hypre_SemiRestrict(restrict_data_l[l], RT_l[l], r_l[l], b_l[l+1]); + hypre_SemiRestrict(restrict_data_l[l], RT_l[l], r_l[l], b_l[l + 1]); #if DEBUG - hypre_printf("Level %d: b_l = %.30e\n",l+1, hypre_StructInnerProd(b_l[l+1], b_l[l+1])); + hypre_printf("Level %d: b_l = %.30e\n", l + 1, hypre_StructInnerProd(b_l[l + 1], b_l[l + 1])); hypre_sprintf(filename, "zout_xdown.%02d", l); hypre_StructVectorPrint(filename, x_l[l], 0); hypre_sprintf(filename, "zout_rdown.%02d", l); hypre_StructVectorPrint(filename, r_l[l], 0); - hypre_sprintf(filename, "zout_b.%02d", l+1); - hypre_StructVectorPrint(filename, b_l[l+1], 0); + hypre_sprintf(filename, "zout_b.%02d", l + 1); + hypre_StructVectorPrint(filename, b_l[l + 1], 0); #endif HYPRE_ANNOTATE_MGLEVEL_END(l); @@ -254,8 +262,10 @@ hypre_PFMGSolve( void *pfmg_vdata, if (active_l[l]) { + HYPRE_ANNOTATE_REGION_BEGIN("%s", "Relaxation"); hypre_PFMGRelaxSetZeroGuess(relax_data_l[l], 1); hypre_PFMGRelax(relax_data_l[l], A_l[l], b_l[l], x_l[l]); + HYPRE_ANNOTATE_REGION_END("%s", "Relaxation"); } else { @@ -264,7 +274,7 @@ hypre_PFMGSolve( void *pfmg_vdata, #if DEBUG hypre_sprintf(filename, "zout_xbottom.%02d", l); hypre_StructVectorPrint(filename, x_l[l], 0); - hypre_printf("Level %d: x_l = %.30e\n",l, hypre_StructInnerProd(x_l[l], x_l[l])); + hypre_printf("Level %d: x_l = %.30e\n", l, hypre_StructInnerProd(x_l[l], x_l[l])); #endif /*-------------------------------------------------- @@ -284,7 +294,7 @@ hypre_PFMGSolve( void *pfmg_vdata, hypre_StructVectorClearAllValues(e_l[l]); } /* interpolate error and correct (x = x + Pe_c) */ - hypre_SemiInterp(interp_data_l[l], P_l[l], x_l[l+1], e_l[l]); + hypre_SemiInterp(interp_data_l[l], P_l[l], x_l[l + 1], e_l[l]); hypre_StructAxpy(1.0, e_l[l], x_l[l]); HYPRE_ANNOTATE_MGLEVEL_END(l + 1); #if DEBUG @@ -292,17 +302,19 @@ hypre_PFMGSolve( void *pfmg_vdata, hypre_StructVectorPrint(filename, e_l[l], 0); hypre_sprintf(filename, "zout_xup.%02d", l); hypre_StructVectorPrint(filename, x_l[l], 0); - hypre_printf("Level %d: x_l = %.15e\n",l, hypre_StructInnerProd(x_l[l], x_l[l])); + hypre_printf("Level %d: x_l = %.15e\n", l, hypre_StructInnerProd(x_l[l], x_l[l])); #endif HYPRE_ANNOTATE_MGLEVEL_BEGIN(l); if (active_l[l]) { /* post-relaxation */ + HYPRE_ANNOTATE_REGION_BEGIN("%s", "Relaxation"); hypre_PFMGRelaxSetPostRelax(relax_data_l[l]); hypre_PFMGRelaxSetMaxIter(relax_data_l[l], num_post_relax); hypre_PFMGRelaxSetZeroGuess(relax_data_l[l], 0); hypre_PFMGRelax(relax_data_l[l], A_l[l], b_l[l], x_l[l]); + HYPRE_ANNOTATE_REGION_END("%s", "Relaxation"); } } #if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) @@ -344,10 +356,12 @@ hypre_PFMGSolve( void *pfmg_vdata, } } + HYPRE_ANNOTATE_REGION_BEGIN("%s", "Relaxation"); hypre_PFMGRelaxSetPostRelax(relax_data_l[0]); hypre_PFMGRelaxSetMaxIter(relax_data_l[0], num_post_relax); hypre_PFMGRelaxSetZeroGuess(relax_data_l[0], 0); hypre_PFMGRelax(relax_data_l[0], A_l[0], b_l[0], x_l[0]); + HYPRE_ANNOTATE_REGION_END("%s", "Relaxation"); (pfmg_data -> num_iterations) = (i + 1); HYPRE_ANNOTATE_MGLEVEL_END(0); diff --git a/external/hypre/src/struct_ls/point_relax.c b/external/hypre/src/struct_ls/point_relax.c index 2c637faa..2eb44bd2 100644 --- a/external/hypre/src/struct_ls/point_relax.c +++ b/external/hypre/src/struct_ls/point_relax.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -215,7 +215,7 @@ hypre_PointRelaxSetup( void *relax_vdata, for (compute_i = 0; compute_i < 2; compute_i++) { - switch(compute_i) + switch (compute_i) { case 0: box_aa = orig_indt_boxes; @@ -253,7 +253,7 @@ hypre_PointRelaxSetup( void *relax_vdata, } } - switch(compute_i) + switch (compute_i) { case 0: hypre_ComputeInfoIndtBoxes(compute_info) = new_box_aa; @@ -298,7 +298,7 @@ hypre_PointRelaxSetup( void *relax_vdata, scale += (pointset_sizes[p] / frac); } (relax_data -> flops) = (HYPRE_BigInt)scale * (hypre_StructMatrixGlobalSize(A) + - hypre_StructVectorGlobalSize(x)); + hypre_StructVectorGlobalSize(x)); return hypre_error_flag; } @@ -324,7 +324,7 @@ hypre_PointRelax( void *relax_vdata, HYPRE_Int diag_rank = (relax_data -> diag_rank); hypre_ComputePkg **compute_pkgs = (relax_data -> compute_pkgs); HYPRE_Real tol = (relax_data -> tol); - HYPRE_Real tol2 = tol*tol; + HYPRE_Real tol2 = tol * tol; hypre_ComputePkg *compute_pkg; hypre_CommHandle *comm_handle; @@ -356,7 +356,7 @@ hypre_PointRelax( void *relax_vdata, HYPRE_Int iter, p, compute_i, i, j; HYPRE_Int pointset; - HYPRE_Real bsumsq, rsumsq; + HYPRE_Real bsumsq = 1.0, rsumsq; /*---------------------------------------------------------- * Initialize some things and deal with special cases @@ -387,11 +387,13 @@ hypre_PointRelax( void *relax_vdata, } constant_coefficient = hypre_StructMatrixConstantCoefficient(A); - if (constant_coefficient) hypre_StructVectorClearBoundGhostValues(x, 0); + if (constant_coefficient) { hypre_StructVectorClearBoundGhostValues(x, 0); } rsumsq = 0.0; - if ( tol>0.0 ) + if ( tol > 0.0 ) + { bsumsq = hypre_StructInnerProd( b, b ); + } /*---------------------------------------------------------- * Do zero_guess iteration @@ -399,7 +401,7 @@ hypre_PointRelax( void *relax_vdata, p = 0; iter = 0; - if ( tol>0.0) + if ( tol > 0.0) { matvec_data = hypre_StructMatvecCreate(); hypre_StructMatvecSetup( matvec_data, A, x ); @@ -407,7 +409,7 @@ hypre_PointRelax( void *relax_vdata, if (zero_guess) { - if ( p==0 ) rsumsq = 0.0; + if ( p == 0 ) { rsumsq = 0.0; } if (num_pointsets > 1) { hypre_StructVectorSetConstantValues(x, 0.0); @@ -418,7 +420,7 @@ hypre_PointRelax( void *relax_vdata, for (compute_i = 0; compute_i < 2; compute_i++) { - switch(compute_i) + switch (compute_i) { case 0: { @@ -456,10 +458,10 @@ hypre_PointRelax( void *relax_vdata, hypre_BoxGetStrideSize(compute_box, stride, loop_size); /* all matrix coefficients are constant */ - if ( constant_coefficient==1 ) + if ( constant_coefficient == 1 ) { Ai = hypre_CCBoxIndexRank( A_data_box, start ); - AAp0 = 1/Ap[Ai]; + AAp0 = 1 / Ap[Ai]; #define DEVICE_VAR is_device_ptr(xp,bp) hypre_BoxLoop2Begin(hypre_StructVectorNDim(x), loop_size, b_data_box, start, stride, bi, @@ -497,7 +499,7 @@ hypre_PointRelax( void *relax_vdata, p = (p + 1) % num_pointsets; iter = iter + (p == 0); - if ( tol>0.0 && p==0 ) + if ( tol > 0.0 && p == 0 ) /* ... p==0 here means we've finished going through all the pointsets, i.e. this iteration is complete. tol>0.0 means to do a convergence test, using tol. @@ -507,7 +509,7 @@ hypre_PointRelax( void *relax_vdata, hypre_StructMatvecCompute( matvec_data, -1.0, A, x, 1.0, t ); /* t = - A x + t = - A x + b */ rsumsq = hypre_StructInnerProd( t, t ); /* */ - if ( rsumsq/bsumsq0.0 && p==0 ) + if ( tol > 0.0 && p == 0 ) /* ... p==0 here means we've finished going through all the pointsets, i.e. this iteration is complete. tol>0.0 means to do a convergence test, using tol. @@ -633,16 +635,16 @@ hypre_PointRelax( void *relax_vdata, hypre_StructMatvecCompute( matvec_data, -1.0, A, x, 1.0, t ); /* t = - A x + t = - A x + b */ rsumsq = hypre_StructInnerProd( t, t ); /* */ - if ( rsumsq/bsumsq0.0 ) + if ( tol > 0.0 ) { hypre_StructMatvecDestroy( matvec_data ); } - if ( tol>0.0 ) (relax_data -> rresnorm) = sqrt( rsumsq/bsumsq ); + if ( tol > 0.0 ) { (relax_data -> rresnorm) = hypre_sqrt( rsumsq / bsumsq ); } (relax_data -> num_iterations) = iter; /*----------------------------------------------------------------------- @@ -670,8 +672,10 @@ hypre_PointRelax_core0( void *relax_vdata, hypre_Box *x_data_box, hypre_Box *t_data_box, hypre_IndexRef stride - ) + ) { + HYPRE_UNUSED_VAR(constant_coefficient); + hypre_PointRelaxData *relax_data = (hypre_PointRelaxData *)relax_vdata; HYPRE_Real *Ap0; @@ -734,49 +738,48 @@ hypre_PointRelax_core0( void *relax_vdata, } } - switch(depth) + switch (depth) { case 7: Ap6 = hypre_StructMatrixBoxData(A, boxarray_id, ssi[6]); - xoff6 = hypre_BoxOffsetDistance( - x_data_box, stencil_shape[ssi[6]]); + xoff6 = hypre_BoxOffsetDistance(x_data_box, stencil_shape[ssi[6]]); + /* fall through */ case 6: Ap5 = hypre_StructMatrixBoxData(A, boxarray_id, ssi[5]); - xoff5 = hypre_BoxOffsetDistance( - x_data_box, stencil_shape[ssi[5]]); + xoff5 = hypre_BoxOffsetDistance(x_data_box, stencil_shape[ssi[5]]); + /* fall through */ case 5: Ap4 = hypre_StructMatrixBoxData(A, boxarray_id, ssi[4]); - xoff4 = hypre_BoxOffsetDistance( - x_data_box, stencil_shape[ssi[4]]); + xoff4 = hypre_BoxOffsetDistance(x_data_box, stencil_shape[ssi[4]]); + /* fall through */ case 4: Ap3 = hypre_StructMatrixBoxData(A, boxarray_id, ssi[3]); - xoff3 = hypre_BoxOffsetDistance( - x_data_box, stencil_shape[ssi[3]]); + xoff3 = hypre_BoxOffsetDistance(x_data_box, stencil_shape[ssi[3]]); + /* fall through */ case 3: Ap2 = hypre_StructMatrixBoxData(A, boxarray_id, ssi[2]); - xoff2 = hypre_BoxOffsetDistance( - x_data_box, stencil_shape[ssi[2]]); + xoff2 = hypre_BoxOffsetDistance(x_data_box, stencil_shape[ssi[2]]); + /* fall through */ case 2: Ap1 = hypre_StructMatrixBoxData(A, boxarray_id, ssi[1]); - xoff1 = hypre_BoxOffsetDistance( - x_data_box, stencil_shape[ssi[1]]); + xoff1 = hypre_BoxOffsetDistance(x_data_box, stencil_shape[ssi[1]]); + /* fall through */ case 1: Ap0 = hypre_StructMatrixBoxData(A, boxarray_id, ssi[0]); - xoff0 = hypre_BoxOffsetDistance( - x_data_box, stencil_shape[ssi[0]]); + xoff0 = hypre_BoxOffsetDistance(x_data_box, stencil_shape[ssi[0]]); + /* fall through */ case 0: - break; } - switch(depth) + switch (depth) { case 7: #define DEVICE_VAR is_device_ptr(tp,Ap0,Ap1,Ap2,Ap3,Ap4,Ap5,Ap6,xp) @@ -921,8 +924,10 @@ hypre_PointRelax_core12( void *relax_vdata, hypre_Box *x_data_box, hypre_Box *t_data_box, hypre_IndexRef stride - ) + ) { + HYPRE_UNUSED_VAR(A_data_box); + hypre_PointRelaxData *relax_data = (hypre_PointRelaxData *)relax_vdata; HYPRE_Real *Apd; @@ -976,10 +981,10 @@ hypre_PointRelax_core12( void *relax_vdata, Ai = hypre_CCBoxIndexRank( A_data_box, start ); #define DEVICE_VAR is_device_ptr(tp,bp) - if ( constant_coefficient==1 ) /* constant diagonal */ + if ( constant_coefficient == 1 ) /* constant diagonal */ { Apd = hypre_StructMatrixBoxData(A, boxarray_id, diag_rank); - AApd = 1/Apd[Ai]; + AApd = 1 / Apd[Ai]; hypre_BoxLoop2Begin(hypre_StructMatrixNDim(A), loop_size, b_data_box, start, stride, bi, @@ -1020,59 +1025,58 @@ hypre_PointRelax_core12( void *relax_vdata, } } - switch(depth) + switch (depth) { case 7: Ap6 = hypre_StructMatrixBoxData(A, boxarray_id, ssi[6]); - xoff6 = hypre_BoxOffsetDistance( - x_data_box, stencil_shape[ssi[6]]); + xoff6 = hypre_BoxOffsetDistance(x_data_box, stencil_shape[ssi[6]]); + /* fall through */ case 6: Ap5 = hypre_StructMatrixBoxData(A, boxarray_id, ssi[5]); - xoff5 = hypre_BoxOffsetDistance( - x_data_box, stencil_shape[ssi[5]]); + xoff5 = hypre_BoxOffsetDistance(x_data_box, stencil_shape[ssi[5]]); + /* fall through */ case 5: Ap4 = hypre_StructMatrixBoxData(A, boxarray_id, ssi[4]); - xoff4 = hypre_BoxOffsetDistance( - x_data_box, stencil_shape[ssi[4]]); + xoff4 = hypre_BoxOffsetDistance(x_data_box, stencil_shape[ssi[4]]); + /* fall through */ case 4: Ap3 = hypre_StructMatrixBoxData(A, boxarray_id, ssi[3]); - xoff3 = hypre_BoxOffsetDistance( - x_data_box, stencil_shape[ssi[3]]); + xoff3 = hypre_BoxOffsetDistance(x_data_box, stencil_shape[ssi[3]]); + /* fall through */ case 3: Ap2 = hypre_StructMatrixBoxData(A, boxarray_id, ssi[2]); - xoff2 = hypre_BoxOffsetDistance( - x_data_box, stencil_shape[ssi[2]]); + xoff2 = hypre_BoxOffsetDistance(x_data_box, stencil_shape[ssi[2]]); + /* fall through */ case 2: Ap1 = hypre_StructMatrixBoxData(A, boxarray_id, ssi[1]); - xoff1 = hypre_BoxOffsetDistance( - x_data_box, stencil_shape[ssi[1]]); + xoff1 = hypre_BoxOffsetDistance(x_data_box, stencil_shape[ssi[1]]); + /* fall through */ case 1: Ap0 = hypre_StructMatrixBoxData(A, boxarray_id, ssi[0]); - xoff0 = hypre_BoxOffsetDistance( - x_data_box, stencil_shape[ssi[0]]); + xoff0 = hypre_BoxOffsetDistance(x_data_box, stencil_shape[ssi[0]]); + /* fall through */ case 0: - break; } #define DEVICE_VAR is_device_ptr(tp,xp) - switch(depth) + switch (depth) { case 7: - AAp0 = Ap0[Ai]*AApd; - AAp1 = Ap1[Ai]*AApd; - AAp2 = Ap2[Ai]*AApd; - AAp3 = Ap3[Ai]*AApd; - AAp4 = Ap4[Ai]*AApd; - AAp5 = Ap5[Ai]*AApd; - AAp6 = Ap6[Ai]*AApd; + AAp0 = Ap0[Ai] * AApd; + AAp1 = Ap1[Ai] * AApd; + AAp2 = Ap2[Ai] * AApd; + AAp3 = Ap3[Ai] * AApd; + AAp4 = Ap4[Ai] * AApd; + AAp5 = Ap5[Ai] * AApd; + AAp6 = Ap6[Ai] * AApd; hypre_BoxLoop2Begin(hypre_StructMatrixNDim(A), loop_size, x_data_box, start, stride, xi, t_data_box, start, stride, ti); @@ -1090,12 +1094,12 @@ hypre_PointRelax_core12( void *relax_vdata, break; case 6: - AAp0 = Ap0[Ai]*AApd; - AAp1 = Ap1[Ai]*AApd; - AAp2 = Ap2[Ai]*AApd; - AAp3 = Ap3[Ai]*AApd; - AAp4 = Ap4[Ai]*AApd; - AAp5 = Ap5[Ai]*AApd; + AAp0 = Ap0[Ai] * AApd; + AAp1 = Ap1[Ai] * AApd; + AAp2 = Ap2[Ai] * AApd; + AAp3 = Ap3[Ai] * AApd; + AAp4 = Ap4[Ai] * AApd; + AAp5 = Ap5[Ai] * AApd; hypre_BoxLoop2Begin(hypre_StructMatrixNDim(A), loop_size, x_data_box, start, stride, xi, t_data_box, start, stride, ti); @@ -1112,11 +1116,11 @@ hypre_PointRelax_core12( void *relax_vdata, break; case 5: - AAp0 = Ap0[Ai]*AApd; - AAp1 = Ap1[Ai]*AApd; - AAp2 = Ap2[Ai]*AApd; - AAp3 = Ap3[Ai]*AApd; - AAp4 = Ap4[Ai]*AApd; + AAp0 = Ap0[Ai] * AApd; + AAp1 = Ap1[Ai] * AApd; + AAp2 = Ap2[Ai] * AApd; + AAp3 = Ap3[Ai] * AApd; + AAp4 = Ap4[Ai] * AApd; hypre_BoxLoop2Begin(hypre_StructMatrixNDim(A), loop_size, x_data_box, start, stride, xi, t_data_box, start, stride, ti); @@ -1132,10 +1136,10 @@ hypre_PointRelax_core12( void *relax_vdata, break; case 4: - AAp0 = Ap0[Ai]*AApd; - AAp1 = Ap1[Ai]*AApd; - AAp2 = Ap2[Ai]*AApd; - AAp3 = Ap3[Ai]*AApd; + AAp0 = Ap0[Ai] * AApd; + AAp1 = Ap1[Ai] * AApd; + AAp2 = Ap2[Ai] * AApd; + AAp3 = Ap3[Ai] * AApd; hypre_BoxLoop2Begin(hypre_StructMatrixNDim(A), loop_size, x_data_box, start, stride, xi, t_data_box, start, stride, ti); @@ -1150,9 +1154,9 @@ hypre_PointRelax_core12( void *relax_vdata, break; case 3: - AAp0 = Ap0[Ai]*AApd; - AAp1 = Ap1[Ai]*AApd; - AAp2 = Ap2[Ai]*AApd; + AAp0 = Ap0[Ai] * AApd; + AAp1 = Ap1[Ai] * AApd; + AAp2 = Ap2[Ai] * AApd; hypre_BoxLoop2Begin(hypre_StructMatrixNDim(A), loop_size, x_data_box, start, stride, xi, t_data_box, start, stride, ti); @@ -1166,8 +1170,8 @@ hypre_PointRelax_core12( void *relax_vdata, break; case 2: - AAp0 = Ap0[Ai]*AApd; - AAp1 = Ap1[Ai]*AApd; + AAp0 = Ap0[Ai] * AApd; + AAp1 = Ap1[Ai] * AApd; hypre_BoxLoop2Begin(hypre_StructMatrixNDim(A), loop_size, x_data_box, start, stride, xi, t_data_box, start, stride, ti); @@ -1180,7 +1184,7 @@ hypre_PointRelax_core12( void *relax_vdata, break; case 1: - AAp0 = Ap0[Ai]*AApd; + AAp0 = Ap0[Ai] * AApd; hypre_BoxLoop2Begin(hypre_StructMatrixNDim(A), loop_size, x_data_box, start, stride, xi, t_data_box, start, stride, ti); @@ -1459,7 +1463,7 @@ HYPRE_Int hypre_relax_wtx( void *relax_vdata, HYPRE_Int pointset, for (compute_i = 0; compute_i < 2; compute_i++) { - switch(compute_i) + switch (compute_i) { case 0: { @@ -1498,7 +1502,7 @@ HYPRE_Int hypre_relax_wtx( void *relax_vdata, HYPRE_Int pointset, x_data_box, start, stride, xi, t_data_box, start, stride, ti); { - xp[xi] = weight*tp[ti] + weightc*xp[xi]; + xp[xi] = weight * tp[ti] + weightc * xp[xi]; } hypre_BoxLoop2End(xi, ti); #undef DEVICE_VAR @@ -1514,8 +1518,10 @@ HYPRE_Int hypre_relax_wtx( void *relax_vdata, HYPRE_Int pointset, * vector copy on specified pointsets. *--------------------------------------------------------------------------*/ -HYPRE_Int hypre_relax_copy( void *relax_vdata, HYPRE_Int pointset, - hypre_StructVector *t, hypre_StructVector *x ) +HYPRE_Int hypre_relax_copy( void *relax_vdata, + HYPRE_Int pointset, + hypre_StructVector *t, + hypre_StructVector *x ) /* Sets x to t, x=t, but only in the specified pointset. */ { hypre_PointRelaxData *relax_data = (hypre_PointRelaxData *)relax_vdata; @@ -1541,7 +1547,7 @@ HYPRE_Int hypre_relax_copy( void *relax_vdata, HYPRE_Int pointset, for (compute_i = 0; compute_i < 2; compute_i++) { - switch(compute_i) + switch (compute_i) { case 0: { diff --git a/external/hypre/src/struct_ls/protos.h b/external/hypre/src/struct_ls/protos.h index 67540ac0..1c8b9fcc 100644 --- a/external/hypre/src/struct_ls/protos.h +++ b/external/hypre/src/struct_ls/protos.h @@ -1,18 +1,31 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ +/* coarsen.c */ +HYPRE_Int hypre_StructMapFineToCoarse ( hypre_Index findex, hypre_Index index, hypre_Index stride, + hypre_Index cindex ); +HYPRE_Int hypre_StructMapCoarseToFine ( hypre_Index cindex, hypre_Index index, hypre_Index stride, + hypre_Index findex ); +HYPRE_Int hypre_StructCoarsen ( hypre_StructGrid *fgrid, hypre_Index index, hypre_Index stride, + HYPRE_Int prune, hypre_StructGrid **cgrid_ptr ); + /* cyclic_reduction.c */ void *hypre_CyclicReductionCreate ( MPI_Comm comm ); -hypre_StructMatrix *hypre_CycRedCreateCoarseOp ( hypre_StructMatrix *A , hypre_StructGrid *coarse_grid , HYPRE_Int cdir ); -HYPRE_Int hypre_CycRedSetupCoarseOp ( hypre_StructMatrix *A , hypre_StructMatrix *Ac , hypre_Index cindex , hypre_Index cstride, HYPRE_Int cdir ); -HYPRE_Int hypre_CyclicReductionSetup ( void *cyc_red_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); -HYPRE_Int hypre_CyclicReduction ( void *cyc_red_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); -HYPRE_Int hypre_CyclicReductionSetCDir ( void *cyc_red_vdata , HYPRE_Int cdir ); -HYPRE_Int hypre_CyclicReductionSetBase ( void *cyc_red_vdata , hypre_Index base_index , hypre_Index base_stride ); +hypre_StructMatrix *hypre_CycRedCreateCoarseOp ( hypre_StructMatrix *A, + hypre_StructGrid *coarse_grid, HYPRE_Int cdir ); +HYPRE_Int hypre_CycRedSetupCoarseOp ( hypre_StructMatrix *A, hypre_StructMatrix *Ac, + hypre_Index cindex, hypre_Index cstride, HYPRE_Int cdir ); +HYPRE_Int hypre_CyclicReductionSetup ( void *cyc_red_vdata, hypre_StructMatrix *A, + hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int hypre_CyclicReduction ( void *cyc_red_vdata, hypre_StructMatrix *A, hypre_StructVector *b, + hypre_StructVector *x ); +HYPRE_Int hypre_CyclicReductionSetCDir ( void *cyc_red_vdata, HYPRE_Int cdir ); +HYPRE_Int hypre_CyclicReductionSetBase ( void *cyc_red_vdata, hypre_Index base_index, + hypre_Index base_stride ); HYPRE_Int hypre_CyclicReductionDestroy ( void *cyc_red_vdata ); HYPRE_Int hypre_CyclicReductionSetMaxLevel( void *cyc_red_vdata, HYPRE_Int max_level ); @@ -22,33 +35,37 @@ HYPRE_Int hypre_Log2 ( HYPRE_Int p ); /* hybrid.c */ void *hypre_HybridCreate ( MPI_Comm comm ); HYPRE_Int hypre_HybridDestroy ( void *hybrid_vdata ); -HYPRE_Int hypre_HybridSetTol ( void *hybrid_vdata , HYPRE_Real tol ); -HYPRE_Int hypre_HybridSetConvergenceTol ( void *hybrid_vdata , HYPRE_Real cf_tol ); -HYPRE_Int hypre_HybridSetDSCGMaxIter ( void *hybrid_vdata , HYPRE_Int dscg_max_its ); -HYPRE_Int hypre_HybridSetPCGMaxIter ( void *hybrid_vdata , HYPRE_Int pcg_max_its ); -HYPRE_Int hypre_HybridSetPCGAbsoluteTolFactor ( void *hybrid_vdata , HYPRE_Real pcg_atolf ); -HYPRE_Int hypre_HybridSetTwoNorm ( void *hybrid_vdata , HYPRE_Int two_norm ); -HYPRE_Int hypre_HybridSetStopCrit ( void *hybrid_vdata , HYPRE_Int stop_crit ); -HYPRE_Int hypre_HybridSetRelChange ( void *hybrid_vdata , HYPRE_Int rel_change ); -HYPRE_Int hypre_HybridSetSolverType ( void *hybrid_vdata , HYPRE_Int solver_type ); -HYPRE_Int hypre_HybridSetRecomputeResidual( void *hybrid_vdata , HYPRE_Int recompute_residual ); -HYPRE_Int hypre_HybridGetRecomputeResidual( void *hybrid_vdata , HYPRE_Int *recompute_residual ); -HYPRE_Int hypre_HybridSetRecomputeResidualP( void *hybrid_vdata , HYPRE_Int recompute_residual_p ); -HYPRE_Int hypre_HybridGetRecomputeResidualP( void *hybrid_vdata , HYPRE_Int *recompute_residual_p ); -HYPRE_Int hypre_HybridSetKDim ( void *hybrid_vdata , HYPRE_Int k_dim ); -HYPRE_Int hypre_HybridSetPrecond ( void *pcg_vdata , HYPRE_Int (*pcg_precond_solve )(void*, void*, void*, void*), HYPRE_Int (*pcg_precond_setup )(void*, void*, void*, void*), void *pcg_precond ); -HYPRE_Int hypre_HybridSetLogging ( void *hybrid_vdata , HYPRE_Int logging ); -HYPRE_Int hypre_HybridSetPrintLevel ( void *hybrid_vdata , HYPRE_Int print_level ); -HYPRE_Int hypre_HybridGetNumIterations ( void *hybrid_vdata , HYPRE_Int *num_its ); -HYPRE_Int hypre_HybridGetDSCGNumIterations ( void *hybrid_vdata , HYPRE_Int *dscg_num_its ); -HYPRE_Int hypre_HybridGetPCGNumIterations ( void *hybrid_vdata , HYPRE_Int *pcg_num_its ); -HYPRE_Int hypre_HybridGetFinalRelativeResidualNorm ( void *hybrid_vdata , HYPRE_Real *final_rel_res_norm ); -HYPRE_Int hypre_HybridSetup ( void *hybrid_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); -HYPRE_Int hypre_HybridSolve ( void *hybrid_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); +HYPRE_Int hypre_HybridSetTol ( void *hybrid_vdata, HYPRE_Real tol ); +HYPRE_Int hypre_HybridSetConvergenceTol ( void *hybrid_vdata, HYPRE_Real cf_tol ); +HYPRE_Int hypre_HybridSetDSCGMaxIter ( void *hybrid_vdata, HYPRE_Int dscg_max_its ); +HYPRE_Int hypre_HybridSetPCGMaxIter ( void *hybrid_vdata, HYPRE_Int pcg_max_its ); +HYPRE_Int hypre_HybridSetPCGAbsoluteTolFactor ( void *hybrid_vdata, HYPRE_Real pcg_atolf ); +HYPRE_Int hypre_HybridSetTwoNorm ( void *hybrid_vdata, HYPRE_Int two_norm ); +HYPRE_Int hypre_HybridSetStopCrit ( void *hybrid_vdata, HYPRE_Int stop_crit ); +HYPRE_Int hypre_HybridSetRelChange ( void *hybrid_vdata, HYPRE_Int rel_change ); +HYPRE_Int hypre_HybridSetSolverType ( void *hybrid_vdata, HYPRE_Int solver_type ); +HYPRE_Int hypre_HybridSetRecomputeResidual( void *hybrid_vdata, HYPRE_Int recompute_residual ); +HYPRE_Int hypre_HybridGetRecomputeResidual( void *hybrid_vdata, HYPRE_Int *recompute_residual ); +HYPRE_Int hypre_HybridSetRecomputeResidualP( void *hybrid_vdata, HYPRE_Int recompute_residual_p ); +HYPRE_Int hypre_HybridGetRecomputeResidualP( void *hybrid_vdata, HYPRE_Int *recompute_residual_p ); +HYPRE_Int hypre_HybridSetKDim ( void *hybrid_vdata, HYPRE_Int k_dim ); +HYPRE_Int hypre_HybridSetPrecond ( void *pcg_vdata, HYPRE_Int (*pcg_precond_solve )(void*, void*, + void*, void*), HYPRE_Int (*pcg_precond_setup )(void*, void*, void*, void*), void *pcg_precond ); +HYPRE_Int hypre_HybridSetLogging ( void *hybrid_vdata, HYPRE_Int logging ); +HYPRE_Int hypre_HybridSetPrintLevel ( void *hybrid_vdata, HYPRE_Int print_level ); +HYPRE_Int hypre_HybridGetNumIterations ( void *hybrid_vdata, HYPRE_Int *num_its ); +HYPRE_Int hypre_HybridGetDSCGNumIterations ( void *hybrid_vdata, HYPRE_Int *dscg_num_its ); +HYPRE_Int hypre_HybridGetPCGNumIterations ( void *hybrid_vdata, HYPRE_Int *pcg_num_its ); +HYPRE_Int hypre_HybridGetFinalRelativeResidualNorm ( void *hybrid_vdata, + HYPRE_Real *final_rel_res_norm ); +HYPRE_Int hypre_HybridSetup ( void *hybrid_vdata, hypre_StructMatrix *A, hypre_StructVector *b, + hypre_StructVector *x ); +HYPRE_Int hypre_HybridSolve ( void *hybrid_vdata, hypre_StructMatrix *A, hypre_StructVector *b, + hypre_StructVector *x ); /* HYPRE_struct_int.c */ -HYPRE_Int hypre_StructVectorSetRandomValues ( hypre_StructVector *vector , HYPRE_Int seed ); -HYPRE_Int hypre_StructSetRandomValues ( void *v , HYPRE_Int seed ); +HYPRE_Int hypre_StructVectorSetRandomValues ( hypre_StructVector *vector, HYPRE_Int seed ); +HYPRE_Int hypre_StructSetRandomValues ( void *v, HYPRE_Int seed ); /* HYPRE_struct_pfmg.c */ HYPRE_Int hypre_PFMGSetDeviceLevel( void *pfmg_vdata, HYPRE_Int device_level ); @@ -56,257 +73,405 @@ HYPRE_Int hypre_PFMGSetDeviceLevel( void *pfmg_vdata, HYPRE_Int device_level /* jacobi.c */ void *hypre_JacobiCreate ( MPI_Comm comm ); HYPRE_Int hypre_JacobiDestroy ( void *jacobi_vdata ); -HYPRE_Int hypre_JacobiSetup ( void *jacobi_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); -HYPRE_Int hypre_JacobiSolve ( void *jacobi_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); -HYPRE_Int hypre_JacobiSetTol ( void *jacobi_vdata , HYPRE_Real tol ); -HYPRE_Int hypre_JacobiGetTol ( void *jacobi_vdata , HYPRE_Real *tol ); -HYPRE_Int hypre_JacobiSetMaxIter ( void *jacobi_vdata , HYPRE_Int max_iter ); -HYPRE_Int hypre_JacobiGetMaxIter ( void *jacobi_vdata , HYPRE_Int *max_iter ); -HYPRE_Int hypre_JacobiSetZeroGuess ( void *jacobi_vdata , HYPRE_Int zero_guess ); -HYPRE_Int hypre_JacobiGetZeroGuess ( void *jacobi_vdata , HYPRE_Int *zero_guess ); -HYPRE_Int hypre_JacobiGetNumIterations ( void *jacobi_vdata , HYPRE_Int *num_iterations ); -HYPRE_Int hypre_JacobiSetTempVec ( void *jacobi_vdata , hypre_StructVector *t ); -HYPRE_Int hypre_JacobiGetFinalRelativeResidualNorm ( void *jacobi_vdata , HYPRE_Real *norm ); +HYPRE_Int hypre_JacobiSetup ( void *jacobi_vdata, hypre_StructMatrix *A, hypre_StructVector *b, + hypre_StructVector *x ); +HYPRE_Int hypre_JacobiSolve ( void *jacobi_vdata, hypre_StructMatrix *A, hypre_StructVector *b, + hypre_StructVector *x ); +HYPRE_Int hypre_JacobiSetTol ( void *jacobi_vdata, HYPRE_Real tol ); +HYPRE_Int hypre_JacobiGetTol ( void *jacobi_vdata, HYPRE_Real *tol ); +HYPRE_Int hypre_JacobiSetMaxIter ( void *jacobi_vdata, HYPRE_Int max_iter ); +HYPRE_Int hypre_JacobiGetMaxIter ( void *jacobi_vdata, HYPRE_Int *max_iter ); +HYPRE_Int hypre_JacobiSetZeroGuess ( void *jacobi_vdata, HYPRE_Int zero_guess ); +HYPRE_Int hypre_JacobiGetZeroGuess ( void *jacobi_vdata, HYPRE_Int *zero_guess ); +HYPRE_Int hypre_JacobiGetNumIterations ( void *jacobi_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int hypre_JacobiSetTempVec ( void *jacobi_vdata, hypre_StructVector *t ); +HYPRE_Int hypre_JacobiGetFinalRelativeResidualNorm ( void *jacobi_vdata, HYPRE_Real *norm ); /* pcg_struct.c */ void *hypre_StructKrylovCAlloc ( size_t count, size_t elt_size, HYPRE_MemoryLocation location ); HYPRE_Int hypre_StructKrylovFree ( void *ptr ); void *hypre_StructKrylovCreateVector ( void *vvector ); -void *hypre_StructKrylovCreateVectorArray ( HYPRE_Int n , void *vvector ); +void *hypre_StructKrylovCreateVectorArray ( HYPRE_Int n, void *vvector ); HYPRE_Int hypre_StructKrylovDestroyVector ( void *vvector ); -void *hypre_StructKrylovMatvecCreate ( void *A , void *x ); -HYPRE_Int hypre_StructKrylovMatvec ( void *matvec_data , HYPRE_Complex alpha , void *A , void *x , HYPRE_Complex beta , void *y ); +void *hypre_StructKrylovMatvecCreate ( void *A, void *x ); +HYPRE_Int hypre_StructKrylovMatvec ( void *matvec_data, HYPRE_Complex alpha, void *A, void *x, + HYPRE_Complex beta, void *y ); HYPRE_Int hypre_StructKrylovMatvecDestroy ( void *matvec_data ); -HYPRE_Real hypre_StructKrylovInnerProd ( void *x , void *y ); -HYPRE_Int hypre_StructKrylovCopyVector ( void *x , void *y ); +HYPRE_Real hypre_StructKrylovInnerProd ( void *x, void *y ); +HYPRE_Int hypre_StructKrylovCopyVector ( void *x, void *y ); HYPRE_Int hypre_StructKrylovClearVector ( void *x ); -HYPRE_Int hypre_StructKrylovScaleVector ( HYPRE_Complex alpha , void *x ); -HYPRE_Int hypre_StructKrylovAxpy ( HYPRE_Complex alpha , void *x , void *y ); -HYPRE_Int hypre_StructKrylovIdentitySetup ( void *vdata , void *A , void *b , void *x ); -HYPRE_Int hypre_StructKrylovIdentity ( void *vdata , void *A , void *b , void *x ); -HYPRE_Int hypre_StructKrylovCommInfo ( void *A , HYPRE_Int *my_id , HYPRE_Int *num_procs ); +HYPRE_Int hypre_StructKrylovScaleVector ( HYPRE_Complex alpha, void *x ); +HYPRE_Int hypre_StructKrylovAxpy ( HYPRE_Complex alpha, void *x, void *y ); +HYPRE_Int hypre_StructKrylovIdentitySetup ( void *vdata, void *A, void *b, void *x ); +HYPRE_Int hypre_StructKrylovIdentity ( void *vdata, void *A, void *b, void *x ); +HYPRE_Int hypre_StructKrylovCommInfo ( void *A, HYPRE_Int *my_id, HYPRE_Int *num_procs ); /* pfmg2_setup_rap.c */ -hypre_StructMatrix *hypre_PFMG2CreateRAPOp ( hypre_StructMatrix *R , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructGrid *coarse_grid , HYPRE_Int cdir ); -HYPRE_Int hypre_PFMG2BuildRAPSym ( hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMG2BuildRAPSym_onebox_FSS5_CC0 ( HYPRE_Int ci , HYPRE_Int fi , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMG2BuildRAPSym_onebox_FSS5_CC1 ( HYPRE_Int ci , HYPRE_Int fi , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMG2BuildRAPSym_onebox_FSS9_CC0 ( HYPRE_Int ci , HYPRE_Int fi , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMG2BuildRAPSym_onebox_FSS9_CC1 ( HYPRE_Int ci , HYPRE_Int fi , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMG2BuildRAPNoSym ( hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMG2BuildRAPNoSym_onebox_FSS5_CC0 ( HYPRE_Int ci , HYPRE_Int fi , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMG2BuildRAPNoSym_onebox_FSS5_CC1 ( HYPRE_Int ci , HYPRE_Int fi , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMG2BuildRAPNoSym_onebox_FSS9_CC0 ( HYPRE_Int ci , HYPRE_Int fi , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMG2BuildRAPNoSym_onebox_FSS9_CC1 ( HYPRE_Int ci , HYPRE_Int fi , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); +hypre_StructMatrix *hypre_PFMG2CreateRAPOp ( hypre_StructMatrix *R, hypre_StructMatrix *A, + hypre_StructMatrix *P, hypre_StructGrid *coarse_grid, HYPRE_Int cdir ); +HYPRE_Int hypre_PFMG2BuildRAPSym ( hypre_StructMatrix *A, hypre_StructMatrix *P, + hypre_StructMatrix *R, HYPRE_Int cdir, hypre_Index cindex, hypre_Index cstride, + hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMG2BuildRAPSym_onebox_FSS5_CC0 ( HYPRE_Int ci, HYPRE_Int fi, + hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, + hypre_Index cindex, hypre_Index cstride, hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMG2BuildRAPSym_onebox_FSS5_CC1 ( HYPRE_Int ci, HYPRE_Int fi, + hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, + hypre_Index cindex, hypre_Index cstride, hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMG2BuildRAPSym_onebox_FSS9_CC0 ( HYPRE_Int ci, HYPRE_Int fi, + hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, + hypre_Index cindex, hypre_Index cstride, hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMG2BuildRAPSym_onebox_FSS9_CC1 ( HYPRE_Int ci, HYPRE_Int fi, + hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, + hypre_Index cindex, hypre_Index cstride, hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMG2BuildRAPNoSym ( hypre_StructMatrix *A, hypre_StructMatrix *P, + hypre_StructMatrix *R, HYPRE_Int cdir, hypre_Index cindex, hypre_Index cstride, + hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMG2BuildRAPNoSym_onebox_FSS5_CC0 ( HYPRE_Int ci, HYPRE_Int fi, + hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, + hypre_Index cindex, hypre_Index cstride, hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMG2BuildRAPNoSym_onebox_FSS5_CC1 ( HYPRE_Int ci, HYPRE_Int fi, + hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, + hypre_Index cindex, hypre_Index cstride, hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMG2BuildRAPNoSym_onebox_FSS9_CC0 ( HYPRE_Int ci, HYPRE_Int fi, + hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, + hypre_Index cindex, hypre_Index cstride, hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMG2BuildRAPNoSym_onebox_FSS9_CC1 ( HYPRE_Int ci, HYPRE_Int fi, + hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, + hypre_Index cindex, hypre_Index cstride, hypre_StructMatrix *RAP ); /* pfmg3_setup_rap.c */ -hypre_StructMatrix *hypre_PFMG3CreateRAPOp ( hypre_StructMatrix *R , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructGrid *coarse_grid , HYPRE_Int cdir ); -HYPRE_Int hypre_PFMG3BuildRAPSym ( hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMG3BuildRAPSym_onebox_FSS07_CC0 ( HYPRE_Int ci , HYPRE_Int fi , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMG3BuildRAPSym_onebox_FSS07_CC1 ( HYPRE_Int ci , HYPRE_Int fi , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMG3BuildRAPSym_onebox_FSS19_CC0 ( HYPRE_Int ci , HYPRE_Int fi , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMG3BuildRAPSym_onebox_FSS19_CC1 ( HYPRE_Int ci , HYPRE_Int fi , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMG3BuildRAPSym_onebox_FSS27_CC0 ( HYPRE_Int ci , HYPRE_Int fi , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMG3BuildRAPSym_onebox_FSS27_CC1 ( HYPRE_Int ci , HYPRE_Int fi , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMG3BuildRAPNoSym ( hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMG3BuildRAPNoSym_onebox_FSS07_CC0 ( HYPRE_Int ci , HYPRE_Int fi , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMG3BuildRAPNoSym_onebox_FSS07_CC1 ( HYPRE_Int ci , HYPRE_Int fi , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMG3BuildRAPNoSym_onebox_FSS19_CC0 ( HYPRE_Int ci , HYPRE_Int fi , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMG3BuildRAPNoSym_onebox_FSS19_CC1 ( HYPRE_Int ci , HYPRE_Int fi , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMG3BuildRAPNoSym_onebox_FSS27_CC0 ( HYPRE_Int ci , HYPRE_Int fi , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMG3BuildRAPNoSym_onebox_FSS27_CC1 ( HYPRE_Int ci , HYPRE_Int fi , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); +hypre_StructMatrix *hypre_PFMG3CreateRAPOp ( hypre_StructMatrix *R, hypre_StructMatrix *A, + hypre_StructMatrix *P, hypre_StructGrid *coarse_grid, HYPRE_Int cdir ); +HYPRE_Int hypre_PFMG3BuildRAPSym ( hypre_StructMatrix *A, hypre_StructMatrix *P, + hypre_StructMatrix *R, HYPRE_Int cdir, hypre_Index cindex, hypre_Index cstride, + hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMG3BuildRAPSym_onebox_FSS07_CC0 ( HYPRE_Int ci, HYPRE_Int fi, + hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, + hypre_Index cindex, hypre_Index cstride, hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMG3BuildRAPSym_onebox_FSS07_CC1 ( HYPRE_Int ci, HYPRE_Int fi, + hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, + hypre_Index cindex, hypre_Index cstride, hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMG3BuildRAPSym_onebox_FSS19_CC0 ( HYPRE_Int ci, HYPRE_Int fi, + hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, + hypre_Index cindex, hypre_Index cstride, hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMG3BuildRAPSym_onebox_FSS19_CC1 ( HYPRE_Int ci, HYPRE_Int fi, + hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, + hypre_Index cindex, hypre_Index cstride, hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMG3BuildRAPSym_onebox_FSS27_CC0 ( HYPRE_Int ci, HYPRE_Int fi, + hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, + hypre_Index cindex, hypre_Index cstride, hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMG3BuildRAPSym_onebox_FSS27_CC1 ( HYPRE_Int ci, HYPRE_Int fi, + hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, + hypre_Index cindex, hypre_Index cstride, hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMG3BuildRAPNoSym ( hypre_StructMatrix *A, hypre_StructMatrix *P, + hypre_StructMatrix *R, HYPRE_Int cdir, hypre_Index cindex, hypre_Index cstride, + hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMG3BuildRAPNoSym_onebox_FSS07_CC0 ( HYPRE_Int ci, HYPRE_Int fi, + hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, + hypre_Index cindex, hypre_Index cstride, hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMG3BuildRAPNoSym_onebox_FSS07_CC1 ( HYPRE_Int ci, HYPRE_Int fi, + hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, + hypre_Index cindex, hypre_Index cstride, hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMG3BuildRAPNoSym_onebox_FSS19_CC0 ( HYPRE_Int ci, HYPRE_Int fi, + hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, + hypre_Index cindex, hypre_Index cstride, hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMG3BuildRAPNoSym_onebox_FSS19_CC1 ( HYPRE_Int ci, HYPRE_Int fi, + hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, + hypre_Index cindex, hypre_Index cstride, hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMG3BuildRAPNoSym_onebox_FSS27_CC0 ( HYPRE_Int ci, HYPRE_Int fi, + hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, + hypre_Index cindex, hypre_Index cstride, hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMG3BuildRAPNoSym_onebox_FSS27_CC1 ( HYPRE_Int ci, HYPRE_Int fi, + hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, + hypre_Index cindex, hypre_Index cstride, hypre_StructMatrix *RAP ); /* pfmg.c */ void *hypre_PFMGCreate ( MPI_Comm comm ); HYPRE_Int hypre_PFMGDestroy ( void *pfmg_vdata ); -HYPRE_Int hypre_PFMGSetTol ( void *pfmg_vdata , HYPRE_Real tol ); -HYPRE_Int hypre_PFMGGetTol ( void *pfmg_vdata , HYPRE_Real *tol ); -HYPRE_Int hypre_PFMGSetMaxIter ( void *pfmg_vdata , HYPRE_Int max_iter ); -HYPRE_Int hypre_PFMGGetMaxIter ( void *pfmg_vdata , HYPRE_Int *max_iter ); -HYPRE_Int hypre_PFMGSetMaxLevels ( void *pfmg_vdata , HYPRE_Int max_levels ); -HYPRE_Int hypre_PFMGGetMaxLevels ( void *pfmg_vdata , HYPRE_Int *max_levels ); -HYPRE_Int hypre_PFMGSetRelChange ( void *pfmg_vdata , HYPRE_Int rel_change ); -HYPRE_Int hypre_PFMGGetRelChange ( void *pfmg_vdata , HYPRE_Int *rel_change ); -HYPRE_Int hypre_PFMGSetZeroGuess ( void *pfmg_vdata , HYPRE_Int zero_guess ); -HYPRE_Int hypre_PFMGGetZeroGuess ( void *pfmg_vdata , HYPRE_Int *zero_guess ); -HYPRE_Int hypre_PFMGSetRelaxType ( void *pfmg_vdata , HYPRE_Int relax_type ); -HYPRE_Int hypre_PFMGGetRelaxType ( void *pfmg_vdata , HYPRE_Int *relax_type ); -HYPRE_Int hypre_PFMGSetJacobiWeight ( void *pfmg_vdata , HYPRE_Real weight ); -HYPRE_Int hypre_PFMGGetJacobiWeight ( void *pfmg_vdata , HYPRE_Real *weight ); -HYPRE_Int hypre_PFMGSetRAPType ( void *pfmg_vdata , HYPRE_Int rap_type ); -HYPRE_Int hypre_PFMGGetRAPType ( void *pfmg_vdata , HYPRE_Int *rap_type ); -HYPRE_Int hypre_PFMGSetNumPreRelax ( void *pfmg_vdata , HYPRE_Int num_pre_relax ); -HYPRE_Int hypre_PFMGGetNumPreRelax ( void *pfmg_vdata , HYPRE_Int *num_pre_relax ); -HYPRE_Int hypre_PFMGSetNumPostRelax ( void *pfmg_vdata , HYPRE_Int num_post_relax ); -HYPRE_Int hypre_PFMGGetNumPostRelax ( void *pfmg_vdata , HYPRE_Int *num_post_relax ); -HYPRE_Int hypre_PFMGSetSkipRelax ( void *pfmg_vdata , HYPRE_Int skip_relax ); -HYPRE_Int hypre_PFMGGetSkipRelax ( void *pfmg_vdata , HYPRE_Int *skip_relax ); -HYPRE_Int hypre_PFMGSetDxyz ( void *pfmg_vdata , HYPRE_Real *dxyz ); -HYPRE_Int hypre_PFMGSetLogging ( void *pfmg_vdata , HYPRE_Int logging ); -HYPRE_Int hypre_PFMGGetLogging ( void *pfmg_vdata , HYPRE_Int *logging ); -HYPRE_Int hypre_PFMGSetPrintLevel ( void *pfmg_vdata , HYPRE_Int print_level ); -HYPRE_Int hypre_PFMGGetPrintLevel ( void *pfmg_vdata , HYPRE_Int *print_level ); -HYPRE_Int hypre_PFMGGetNumIterations ( void *pfmg_vdata , HYPRE_Int *num_iterations ); -HYPRE_Int hypre_PFMGPrintLogging ( void *pfmg_vdata , HYPRE_Int myid ); -HYPRE_Int hypre_PFMGGetFinalRelativeResidualNorm ( void *pfmg_vdata , HYPRE_Real *relative_residual_norm ); +HYPRE_Int hypre_PFMGSetTol ( void *pfmg_vdata, HYPRE_Real tol ); +HYPRE_Int hypre_PFMGGetTol ( void *pfmg_vdata, HYPRE_Real *tol ); +HYPRE_Int hypre_PFMGSetMaxIter ( void *pfmg_vdata, HYPRE_Int max_iter ); +HYPRE_Int hypre_PFMGGetMaxIter ( void *pfmg_vdata, HYPRE_Int *max_iter ); +HYPRE_Int hypre_PFMGSetMaxLevels ( void *pfmg_vdata, HYPRE_Int max_levels ); +HYPRE_Int hypre_PFMGGetMaxLevels ( void *pfmg_vdata, HYPRE_Int *max_levels ); +HYPRE_Int hypre_PFMGSetRelChange ( void *pfmg_vdata, HYPRE_Int rel_change ); +HYPRE_Int hypre_PFMGGetRelChange ( void *pfmg_vdata, HYPRE_Int *rel_change ); +HYPRE_Int hypre_PFMGSetZeroGuess ( void *pfmg_vdata, HYPRE_Int zero_guess ); +HYPRE_Int hypre_PFMGGetZeroGuess ( void *pfmg_vdata, HYPRE_Int *zero_guess ); +HYPRE_Int hypre_PFMGSetRelaxType ( void *pfmg_vdata, HYPRE_Int relax_type ); +HYPRE_Int hypre_PFMGGetRelaxType ( void *pfmg_vdata, HYPRE_Int *relax_type ); +HYPRE_Int hypre_PFMGSetJacobiWeight ( void *pfmg_vdata, HYPRE_Real weight ); +HYPRE_Int hypre_PFMGGetJacobiWeight ( void *pfmg_vdata, HYPRE_Real *weight ); +HYPRE_Int hypre_PFMGSetRAPType ( void *pfmg_vdata, HYPRE_Int rap_type ); +HYPRE_Int hypre_PFMGGetRAPType ( void *pfmg_vdata, HYPRE_Int *rap_type ); +HYPRE_Int hypre_PFMGSetNumPreRelax ( void *pfmg_vdata, HYPRE_Int num_pre_relax ); +HYPRE_Int hypre_PFMGGetNumPreRelax ( void *pfmg_vdata, HYPRE_Int *num_pre_relax ); +HYPRE_Int hypre_PFMGSetNumPostRelax ( void *pfmg_vdata, HYPRE_Int num_post_relax ); +HYPRE_Int hypre_PFMGGetNumPostRelax ( void *pfmg_vdata, HYPRE_Int *num_post_relax ); +HYPRE_Int hypre_PFMGSetSkipRelax ( void *pfmg_vdata, HYPRE_Int skip_relax ); +HYPRE_Int hypre_PFMGGetSkipRelax ( void *pfmg_vdata, HYPRE_Int *skip_relax ); +HYPRE_Int hypre_PFMGSetDxyz ( void *pfmg_vdata, HYPRE_Real *dxyz ); +HYPRE_Int hypre_PFMGSetLogging ( void *pfmg_vdata, HYPRE_Int logging ); +HYPRE_Int hypre_PFMGGetLogging ( void *pfmg_vdata, HYPRE_Int *logging ); +HYPRE_Int hypre_PFMGSetPrintLevel ( void *pfmg_vdata, HYPRE_Int print_level ); +HYPRE_Int hypre_PFMGGetPrintLevel ( void *pfmg_vdata, HYPRE_Int *print_level ); +HYPRE_Int hypre_PFMGGetNumIterations ( void *pfmg_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int hypre_PFMGPrintLogging ( void *pfmg_vdata, HYPRE_Int myid ); +HYPRE_Int hypre_PFMGGetFinalRelativeResidualNorm ( void *pfmg_vdata, + HYPRE_Real *relative_residual_norm ); /* pfmg_relax.c */ void *hypre_PFMGRelaxCreate ( MPI_Comm comm ); HYPRE_Int hypre_PFMGRelaxDestroy ( void *pfmg_relax_vdata ); -HYPRE_Int hypre_PFMGRelax ( void *pfmg_relax_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); -HYPRE_Int hypre_PFMGRelaxSetup ( void *pfmg_relax_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); -HYPRE_Int hypre_PFMGRelaxSetType ( void *pfmg_relax_vdata , HYPRE_Int relax_type ); -HYPRE_Int hypre_PFMGRelaxSetJacobiWeight ( void *pfmg_relax_vdata , HYPRE_Real weight ); +HYPRE_Int hypre_PFMGRelax ( void *pfmg_relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, + hypre_StructVector *x ); +HYPRE_Int hypre_PFMGRelaxSetup ( void *pfmg_relax_vdata, hypre_StructMatrix *A, + hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int hypre_PFMGRelaxSetType ( void *pfmg_relax_vdata, HYPRE_Int relax_type ); +HYPRE_Int hypre_PFMGRelaxSetJacobiWeight ( void *pfmg_relax_vdata, HYPRE_Real weight ); HYPRE_Int hypre_PFMGRelaxSetPreRelax ( void *pfmg_relax_vdata ); HYPRE_Int hypre_PFMGRelaxSetPostRelax ( void *pfmg_relax_vdata ); -HYPRE_Int hypre_PFMGRelaxSetTol ( void *pfmg_relax_vdata , HYPRE_Real tol ); -HYPRE_Int hypre_PFMGRelaxSetMaxIter ( void *pfmg_relax_vdata , HYPRE_Int max_iter ); -HYPRE_Int hypre_PFMGRelaxSetZeroGuess ( void *pfmg_relax_vdata , HYPRE_Int zero_guess ); -HYPRE_Int hypre_PFMGRelaxSetTempVec ( void *pfmg_relax_vdata , hypre_StructVector *t ); +HYPRE_Int hypre_PFMGRelaxSetTol ( void *pfmg_relax_vdata, HYPRE_Real tol ); +HYPRE_Int hypre_PFMGRelaxSetMaxIter ( void *pfmg_relax_vdata, HYPRE_Int max_iter ); +HYPRE_Int hypre_PFMGRelaxSetZeroGuess ( void *pfmg_relax_vdata, HYPRE_Int zero_guess ); +HYPRE_Int hypre_PFMGRelaxSetTempVec ( void *pfmg_relax_vdata, hypre_StructVector *t ); /* pfmg_setup.c */ -HYPRE_Int hypre_PFMGSetup ( void *pfmg_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); -HYPRE_Int hypre_PFMGComputeDxyz ( hypre_StructMatrix *A , HYPRE_Real *dxyz , HYPRE_Real *mean, HYPRE_Real *deviation); -HYPRE_Int hypre_PFMGComputeDxyz_CS ( HYPRE_Int bi, hypre_StructMatrix *A, HYPRE_Real *cxyz, HYPRE_Real *sqcxyz); -HYPRE_Int hypre_PFMGComputeDxyz_SS5 ( HYPRE_Int bi, hypre_StructMatrix *A, HYPRE_Real *cxyz, HYPRE_Real *sqcxyz); -HYPRE_Int hypre_PFMGComputeDxyz_SS9 ( HYPRE_Int bi, hypre_StructMatrix *A, HYPRE_Real *cxyz, HYPRE_Real *sqcxyz); -HYPRE_Int hypre_PFMGComputeDxyz_SS7 ( HYPRE_Int bi, hypre_StructMatrix *A, HYPRE_Real *cxyz, HYPRE_Real *sqcxyz); -HYPRE_Int hypre_PFMGComputeDxyz_SS19( HYPRE_Int bi, hypre_StructMatrix *A, HYPRE_Real *cxyz, HYPRE_Real *sqcxyz); -HYPRE_Int hypre_PFMGComputeDxyz_SS27( HYPRE_Int bi, hypre_StructMatrix *A, HYPRE_Real *cxyz, HYPRE_Real *sqcxyz); +HYPRE_Int hypre_PFMGSetup ( void *pfmg_vdata, hypre_StructMatrix *A, hypre_StructVector *b, + hypre_StructVector *x ); +HYPRE_Int hypre_PFMGComputeDxyz ( hypre_StructMatrix *A, HYPRE_Real *dxyz, HYPRE_Real *mean, + HYPRE_Real *deviation); +HYPRE_Int hypre_PFMGComputeDxyz_CS ( HYPRE_Int bi, hypre_StructMatrix *A, HYPRE_Real *cxyz, + HYPRE_Real *sqcxyz); +HYPRE_Int hypre_PFMGComputeDxyz_SS5 ( HYPRE_Int bi, hypre_StructMatrix *A, HYPRE_Real *cxyz, + HYPRE_Real *sqcxyz); +HYPRE_Int hypre_PFMGComputeDxyz_SS9 ( HYPRE_Int bi, hypre_StructMatrix *A, HYPRE_Real *cxyz, + HYPRE_Real *sqcxyz); +HYPRE_Int hypre_PFMGComputeDxyz_SS7 ( HYPRE_Int bi, hypre_StructMatrix *A, HYPRE_Real *cxyz, + HYPRE_Real *sqcxyz); +HYPRE_Int hypre_PFMGComputeDxyz_SS19( HYPRE_Int bi, hypre_StructMatrix *A, HYPRE_Real *cxyz, + HYPRE_Real *sqcxyz); +HYPRE_Int hypre_PFMGComputeDxyz_SS27( HYPRE_Int bi, hypre_StructMatrix *A, HYPRE_Real *cxyz, + HYPRE_Real *sqcxyz); HYPRE_Int hypre_ZeroDiagonal ( hypre_StructMatrix *A ); /* pfmg_setup_interp.c */ -hypre_StructMatrix *hypre_PFMGCreateInterpOp ( hypre_StructMatrix *A , hypre_StructGrid *cgrid , HYPRE_Int cdir , HYPRE_Int rap_type ); -HYPRE_Int hypre_PFMGSetupInterpOp ( hypre_StructMatrix *A , HYPRE_Int cdir , hypre_Index findex , hypre_Index stride , hypre_StructMatrix *P , HYPRE_Int rap_type ); -HYPRE_Int hypre_PFMGSetupInterpOp_CC0 ( HYPRE_Int i , hypre_StructMatrix *A , hypre_Box *A_dbox , HYPRE_Int cdir , hypre_Index stride , hypre_Index stridec , hypre_Index start , hypre_IndexRef startc , hypre_Index loop_size , hypre_Box *P_dbox , HYPRE_Int Pstenc0 , HYPRE_Int Pstenc1 , HYPRE_Real *Pp0 , HYPRE_Real *Pp1 , HYPRE_Int rap_type , HYPRE_Int si0 , HYPRE_Int si1 ); -HYPRE_Int hypre_PFMGSetupInterpOp_CC1 ( HYPRE_Int i , hypre_StructMatrix *A , hypre_Box *A_dbox , HYPRE_Int cdir , hypre_Index stride , hypre_Index stridec , hypre_Index start , hypre_IndexRef startc , hypre_Index loop_size , hypre_Box *P_dbox , HYPRE_Int Pstenc0 , HYPRE_Int Pstenc1 , HYPRE_Real *Pp0 , HYPRE_Real *Pp1 , HYPRE_Int rap_type , HYPRE_Int si0 , HYPRE_Int si1 ); -HYPRE_Int hypre_PFMGSetupInterpOp_CC2 ( HYPRE_Int i , hypre_StructMatrix *A , hypre_Box *A_dbox , HYPRE_Int cdir , hypre_Index stride , hypre_Index stridec , hypre_Index start , hypre_IndexRef startc , hypre_Index loop_size , hypre_Box *P_dbox , HYPRE_Int Pstenc0 , HYPRE_Int Pstenc1 , HYPRE_Real *Pp0 , HYPRE_Real *Pp1 , HYPRE_Int rap_type , HYPRE_Int si0 , HYPRE_Int si1 ); -HYPRE_Int hypre_PFMGSetupInterpOp_CC0_SS5 ( HYPRE_Int i , hypre_StructMatrix *A , hypre_Box *A_dbox , HYPRE_Int cdir , hypre_Index stride , hypre_Index stridec , hypre_Index start , hypre_IndexRef startc , hypre_Index loop_size , hypre_Box *P_dbox , HYPRE_Int Pstenc0 , HYPRE_Int Pstenc1 , HYPRE_Real *Pp0 , HYPRE_Real *Pp1 , HYPRE_Int rap_type , hypre_Index *P_stencil_shape ); -HYPRE_Int hypre_PFMGSetupInterpOp_CC0_SS9 ( HYPRE_Int i , hypre_StructMatrix *A , hypre_Box *A_dbox , HYPRE_Int cdir , hypre_Index stride , hypre_Index stridec , hypre_Index start , hypre_IndexRef startc , hypre_Index loop_size , hypre_Box *P_dbox , HYPRE_Int Pstenc0 , HYPRE_Int Pstenc1 , HYPRE_Real *Pp0 , HYPRE_Real *Pp1 , HYPRE_Int rap_type , hypre_Index *P_stencil_shape ); -HYPRE_Int hypre_PFMGSetupInterpOp_CC0_SS7 ( HYPRE_Int i , hypre_StructMatrix *A , hypre_Box *A_dbox , HYPRE_Int cdir , hypre_Index stride , hypre_Index stridec , hypre_Index start , hypre_IndexRef startc , hypre_Index loop_size , hypre_Box *P_dbox , HYPRE_Int Pstenc0 , HYPRE_Int Pstenc1 , HYPRE_Real *Pp0 , HYPRE_Real *Pp1 , HYPRE_Int rap_type , hypre_Index *P_stencil_shape ); - -HYPRE_Int hypre_PFMGSetupInterpOp_CC0_SS15 ( HYPRE_Int i , hypre_StructMatrix *A , hypre_Box *A_dbox , HYPRE_Int cdir , hypre_Index stride , hypre_Index stridec , hypre_Index start , hypre_IndexRef startc , hypre_Index loop_size , hypre_Box *P_dbox , HYPRE_Int Pstenc0 , HYPRE_Int Pstenc1 , HYPRE_Real *Pp0 , HYPRE_Real *Pp1 , HYPRE_Int rap_type , hypre_Index *P_stencil_shape ); - -HYPRE_Int hypre_PFMGSetupInterpOp_CC0_SS19 ( HYPRE_Int i , hypre_StructMatrix *A , hypre_Box *A_dbox , HYPRE_Int cdir , hypre_Index stride , hypre_Index stridec , hypre_Index start , hypre_IndexRef startc , hypre_Index loop_size , hypre_Box *P_dbox , HYPRE_Int Pstenc0 , HYPRE_Int Pstenc1 , HYPRE_Real *Pp0 , HYPRE_Real *Pp1 , HYPRE_Int rap_type , hypre_Index *P_stencil_shape ); - -HYPRE_Int hypre_PFMGSetupInterpOp_CC0_SS27 ( HYPRE_Int i , hypre_StructMatrix *A , hypre_Box *A_dbox , HYPRE_Int cdir , hypre_Index stride , hypre_Index stridec , hypre_Index start , hypre_IndexRef startc , hypre_Index loop_size , hypre_Box *P_dbox , HYPRE_Int Pstenc0 , HYPRE_Int Pstenc1 , HYPRE_Real *Pp0 , HYPRE_Real *Pp1 , HYPRE_Int rap_type , hypre_Index *P_stencil_shape ); +hypre_StructMatrix *hypre_PFMGCreateInterpOp ( hypre_StructMatrix *A, hypre_StructGrid *cgrid, + HYPRE_Int cdir, HYPRE_Int rap_type ); +HYPRE_Int hypre_PFMGSetupInterpOp ( hypre_StructMatrix *A, HYPRE_Int cdir, hypre_Index findex, + hypre_Index stride, hypre_StructMatrix *P, HYPRE_Int rap_type ); +HYPRE_Int hypre_PFMGSetupInterpOp_CC0 ( HYPRE_Int i, hypre_StructMatrix *A, hypre_Box *A_dbox, + HYPRE_Int cdir, hypre_Index stride, hypre_Index stridec, hypre_Index start, hypre_IndexRef startc, + hypre_Index loop_size, hypre_Box *P_dbox, HYPRE_Int Pstenc0, HYPRE_Int Pstenc1, HYPRE_Real *Pp0, + HYPRE_Real *Pp1, HYPRE_Int rap_type, HYPRE_Int si0, HYPRE_Int si1 ); +HYPRE_Int hypre_PFMGSetupInterpOp_CC1 ( HYPRE_Int i, hypre_StructMatrix *A, hypre_Box *A_dbox, + HYPRE_Int cdir, hypre_Index stride, hypre_Index stridec, hypre_Index start, hypre_IndexRef startc, + hypre_Index loop_size, hypre_Box *P_dbox, HYPRE_Int Pstenc0, HYPRE_Int Pstenc1, HYPRE_Real *Pp0, + HYPRE_Real *Pp1, HYPRE_Int rap_type, HYPRE_Int si0, HYPRE_Int si1 ); +HYPRE_Int hypre_PFMGSetupInterpOp_CC2 ( HYPRE_Int i, hypre_StructMatrix *A, hypre_Box *A_dbox, + HYPRE_Int cdir, hypre_Index stride, hypre_Index stridec, hypre_Index start, hypre_IndexRef startc, + hypre_Index loop_size, hypre_Box *P_dbox, HYPRE_Int Pstenc0, HYPRE_Int Pstenc1, HYPRE_Real *Pp0, + HYPRE_Real *Pp1, HYPRE_Int rap_type, HYPRE_Int si0, HYPRE_Int si1 ); +HYPRE_Int hypre_PFMGSetupInterpOp_CC0_SS5 ( HYPRE_Int i, hypre_StructMatrix *A, hypre_Box *A_dbox, + HYPRE_Int cdir, hypre_Index stride, hypre_Index stridec, hypre_Index start, hypre_IndexRef startc, + hypre_Index loop_size, hypre_Box *P_dbox, HYPRE_Int Pstenc0, HYPRE_Int Pstenc1, HYPRE_Real *Pp0, + HYPRE_Real *Pp1, HYPRE_Int rap_type, hypre_Index *P_stencil_shape ); +HYPRE_Int hypre_PFMGSetupInterpOp_CC0_SS9 ( HYPRE_Int i, hypre_StructMatrix *A, hypre_Box *A_dbox, + HYPRE_Int cdir, hypre_Index stride, hypre_Index stridec, hypre_Index start, hypre_IndexRef startc, + hypre_Index loop_size, hypre_Box *P_dbox, HYPRE_Int Pstenc0, HYPRE_Int Pstenc1, HYPRE_Real *Pp0, + HYPRE_Real *Pp1, HYPRE_Int rap_type, hypre_Index *P_stencil_shape ); +HYPRE_Int hypre_PFMGSetupInterpOp_CC0_SS7 ( HYPRE_Int i, hypre_StructMatrix *A, hypre_Box *A_dbox, + HYPRE_Int cdir, hypre_Index stride, hypre_Index stridec, hypre_Index start, hypre_IndexRef startc, + hypre_Index loop_size, hypre_Box *P_dbox, HYPRE_Int Pstenc0, HYPRE_Int Pstenc1, HYPRE_Real *Pp0, + HYPRE_Real *Pp1, HYPRE_Int rap_type, hypre_Index *P_stencil_shape ); + +HYPRE_Int hypre_PFMGSetupInterpOp_CC0_SS15 ( HYPRE_Int i, hypre_StructMatrix *A, hypre_Box *A_dbox, + HYPRE_Int cdir, hypre_Index stride, hypre_Index stridec, hypre_Index start, hypre_IndexRef startc, + hypre_Index loop_size, hypre_Box *P_dbox, HYPRE_Int Pstenc0, HYPRE_Int Pstenc1, HYPRE_Real *Pp0, + HYPRE_Real *Pp1, HYPRE_Int rap_type, hypre_Index *P_stencil_shape ); + +HYPRE_Int hypre_PFMGSetupInterpOp_CC0_SS19 ( HYPRE_Int i, hypre_StructMatrix *A, hypre_Box *A_dbox, + HYPRE_Int cdir, hypre_Index stride, hypre_Index stridec, hypre_Index start, hypre_IndexRef startc, + hypre_Index loop_size, hypre_Box *P_dbox, HYPRE_Int Pstenc0, HYPRE_Int Pstenc1, HYPRE_Real *Pp0, + HYPRE_Real *Pp1, HYPRE_Int rap_type, hypre_Index *P_stencil_shape ); + +HYPRE_Int hypre_PFMGSetupInterpOp_CC0_SS27 ( HYPRE_Int i, hypre_StructMatrix *A, hypre_Box *A_dbox, + HYPRE_Int cdir, hypre_Index stride, hypre_Index stridec, hypre_Index start, hypre_IndexRef startc, + hypre_Index loop_size, hypre_Box *P_dbox, HYPRE_Int Pstenc0, HYPRE_Int Pstenc1, HYPRE_Real *Pp0, + HYPRE_Real *Pp1, HYPRE_Int rap_type, hypre_Index *P_stencil_shape ); /* pfmg_setup_rap5.c */ -hypre_StructMatrix *hypre_PFMGCreateCoarseOp5 ( hypre_StructMatrix *R , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructGrid *coarse_grid , HYPRE_Int cdir ); -HYPRE_Int hypre_PFMGBuildCoarseOp5 ( hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMGBuildCoarseOp5_onebox_CC0 ( HYPRE_Int fi , HYPRE_Int ci , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMGBuildCoarseOp5_onebox_CC1 ( HYPRE_Int fi , HYPRE_Int ci , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_PFMGBuildCoarseOp5_onebox_CC2 ( HYPRE_Int fi , HYPRE_Int ci , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); +hypre_StructMatrix *hypre_PFMGCreateCoarseOp5 ( hypre_StructMatrix *R, hypre_StructMatrix *A, + hypre_StructMatrix *P, hypre_StructGrid *coarse_grid, HYPRE_Int cdir ); +HYPRE_Int hypre_PFMGBuildCoarseOp5 ( hypre_StructMatrix *A, hypre_StructMatrix *P, + hypre_StructMatrix *R, HYPRE_Int cdir, hypre_Index cindex, hypre_Index cstride, + hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMGBuildCoarseOp5_onebox_CC0 ( HYPRE_Int fi, HYPRE_Int ci, hypre_StructMatrix *A, + hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, hypre_Index cindex, + hypre_Index cstride, hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMGBuildCoarseOp5_onebox_CC1 ( HYPRE_Int fi, HYPRE_Int ci, hypre_StructMatrix *A, + hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, hypre_Index cindex, + hypre_Index cstride, hypre_StructMatrix *RAP ); +HYPRE_Int hypre_PFMGBuildCoarseOp5_onebox_CC2 ( HYPRE_Int fi, HYPRE_Int ci, hypre_StructMatrix *A, + hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, hypre_Index cindex, + hypre_Index cstride, hypre_StructMatrix *RAP ); /* pfmg_setup_rap7.c */ -hypre_StructMatrix *hypre_PFMGCreateCoarseOp7 ( hypre_StructMatrix *R , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructGrid *coarse_grid , HYPRE_Int cdir ); -HYPRE_Int hypre_PFMGBuildCoarseOp7 ( hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_StructMatrix *RAP ); +hypre_StructMatrix *hypre_PFMGCreateCoarseOp7 ( hypre_StructMatrix *R, hypre_StructMatrix *A, + hypre_StructMatrix *P, hypre_StructGrid *coarse_grid, HYPRE_Int cdir ); +HYPRE_Int hypre_PFMGBuildCoarseOp7 ( hypre_StructMatrix *A, hypre_StructMatrix *P, + hypre_StructMatrix *R, HYPRE_Int cdir, hypre_Index cindex, hypre_Index cstride, + hypre_StructMatrix *RAP ); /* pfmg_setup_rap.c */ -hypre_StructMatrix *hypre_PFMGCreateRAPOp ( hypre_StructMatrix *R , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructGrid *coarse_grid , HYPRE_Int cdir , HYPRE_Int rap_type ); -HYPRE_Int hypre_PFMGSetupRAPOp ( hypre_StructMatrix *R , hypre_StructMatrix *A , hypre_StructMatrix *P , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , HYPRE_Int rap_type , hypre_StructMatrix *Ac ); +hypre_StructMatrix *hypre_PFMGCreateRAPOp ( hypre_StructMatrix *R, hypre_StructMatrix *A, + hypre_StructMatrix *P, hypre_StructGrid *coarse_grid, HYPRE_Int cdir, HYPRE_Int rap_type ); +HYPRE_Int hypre_PFMGSetupRAPOp ( hypre_StructMatrix *R, hypre_StructMatrix *A, + hypre_StructMatrix *P, HYPRE_Int cdir, hypre_Index cindex, hypre_Index cstride, HYPRE_Int rap_type, + hypre_StructMatrix *Ac ); /* pfmg_solve.c */ -HYPRE_Int hypre_PFMGSolve ( void *pfmg_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); +HYPRE_Int hypre_PFMGSolve ( void *pfmg_vdata, hypre_StructMatrix *A, hypre_StructVector *b, + hypre_StructVector *x ); /* point_relax.c */ void *hypre_PointRelaxCreate ( MPI_Comm comm ); HYPRE_Int hypre_PointRelaxDestroy ( void *relax_vdata ); -HYPRE_Int hypre_PointRelaxSetup ( void *relax_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); -HYPRE_Int hypre_PointRelax ( void *relax_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); -HYPRE_Int hypre_PointRelax_core0 ( void *relax_vdata , hypre_StructMatrix *A , HYPRE_Int constant_coefficient , hypre_Box *compute_box , HYPRE_Real *bp , HYPRE_Real *xp , HYPRE_Real *tp , HYPRE_Int boxarray_id , hypre_Box *A_data_box , hypre_Box *b_data_box , hypre_Box *x_data_box , hypre_Box *t_data_box , hypre_IndexRef stride ); -HYPRE_Int hypre_PointRelax_core12 ( void *relax_vdata , hypre_StructMatrix *A , HYPRE_Int constant_coefficient , hypre_Box *compute_box , HYPRE_Real *bp , HYPRE_Real *xp , HYPRE_Real *tp , HYPRE_Int boxarray_id , hypre_Box *A_data_box , hypre_Box *b_data_box , hypre_Box *x_data_box , hypre_Box *t_data_box , hypre_IndexRef stride ); -HYPRE_Int hypre_PointRelaxSetTol ( void *relax_vdata , HYPRE_Real tol ); -HYPRE_Int hypre_PointRelaxGetTol ( void *relax_vdata , HYPRE_Real *tol ); -HYPRE_Int hypre_PointRelaxSetMaxIter ( void *relax_vdata , HYPRE_Int max_iter ); -HYPRE_Int hypre_PointRelaxGetMaxIter ( void *relax_vdata , HYPRE_Int *max_iter ); -HYPRE_Int hypre_PointRelaxSetZeroGuess ( void *relax_vdata , HYPRE_Int zero_guess ); -HYPRE_Int hypre_PointRelaxGetZeroGuess ( void *relax_vdata , HYPRE_Int *zero_guess ); -HYPRE_Int hypre_PointRelaxGetNumIterations ( void *relax_vdata , HYPRE_Int *num_iterations ); -HYPRE_Int hypre_PointRelaxSetWeight ( void *relax_vdata , HYPRE_Real weight ); -HYPRE_Int hypre_PointRelaxSetNumPointsets ( void *relax_vdata , HYPRE_Int num_pointsets ); -HYPRE_Int hypre_PointRelaxSetPointset ( void *relax_vdata , HYPRE_Int pointset , HYPRE_Int pointset_size , hypre_Index pointset_stride , hypre_Index *pointset_indices ); -HYPRE_Int hypre_PointRelaxSetPointsetRank ( void *relax_vdata , HYPRE_Int pointset , HYPRE_Int pointset_rank ); -HYPRE_Int hypre_PointRelaxSetTempVec ( void *relax_vdata , hypre_StructVector *t ); -HYPRE_Int hypre_PointRelaxGetFinalRelativeResidualNorm ( void *relax_vdata , HYPRE_Real *norm ); -HYPRE_Int hypre_relax_wtx ( void *relax_vdata , HYPRE_Int pointset , hypre_StructVector *t , hypre_StructVector *x ); -HYPRE_Int hypre_relax_copy ( void *relax_vdata , HYPRE_Int pointset , hypre_StructVector *t , hypre_StructVector *x ); +HYPRE_Int hypre_PointRelaxSetup ( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, + hypre_StructVector *x ); +HYPRE_Int hypre_PointRelax ( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, + hypre_StructVector *x ); +HYPRE_Int hypre_PointRelax_core0 ( void *relax_vdata, hypre_StructMatrix *A, + HYPRE_Int constant_coefficient, hypre_Box *compute_box, HYPRE_Real *bp, HYPRE_Real *xp, + HYPRE_Real *tp, HYPRE_Int boxarray_id, hypre_Box *A_data_box, hypre_Box *b_data_box, + hypre_Box *x_data_box, hypre_Box *t_data_box, hypre_IndexRef stride ); +HYPRE_Int hypre_PointRelax_core12 ( void *relax_vdata, hypre_StructMatrix *A, + HYPRE_Int constant_coefficient, hypre_Box *compute_box, HYPRE_Real *bp, HYPRE_Real *xp, + HYPRE_Real *tp, HYPRE_Int boxarray_id, hypre_Box *A_data_box, hypre_Box *b_data_box, + hypre_Box *x_data_box, hypre_Box *t_data_box, hypre_IndexRef stride ); +HYPRE_Int hypre_PointRelaxSetTol ( void *relax_vdata, HYPRE_Real tol ); +HYPRE_Int hypre_PointRelaxGetTol ( void *relax_vdata, HYPRE_Real *tol ); +HYPRE_Int hypre_PointRelaxSetMaxIter ( void *relax_vdata, HYPRE_Int max_iter ); +HYPRE_Int hypre_PointRelaxGetMaxIter ( void *relax_vdata, HYPRE_Int *max_iter ); +HYPRE_Int hypre_PointRelaxSetZeroGuess ( void *relax_vdata, HYPRE_Int zero_guess ); +HYPRE_Int hypre_PointRelaxGetZeroGuess ( void *relax_vdata, HYPRE_Int *zero_guess ); +HYPRE_Int hypre_PointRelaxGetNumIterations ( void *relax_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int hypre_PointRelaxSetWeight ( void *relax_vdata, HYPRE_Real weight ); +HYPRE_Int hypre_PointRelaxSetNumPointsets ( void *relax_vdata, HYPRE_Int num_pointsets ); +HYPRE_Int hypre_PointRelaxSetPointset ( void *relax_vdata, HYPRE_Int pointset, + HYPRE_Int pointset_size, hypre_Index pointset_stride, hypre_Index *pointset_indices ); +HYPRE_Int hypre_PointRelaxSetPointsetRank ( void *relax_vdata, HYPRE_Int pointset, + HYPRE_Int pointset_rank ); +HYPRE_Int hypre_PointRelaxSetTempVec ( void *relax_vdata, hypre_StructVector *t ); +HYPRE_Int hypre_PointRelaxGetFinalRelativeResidualNorm ( void *relax_vdata, HYPRE_Real *norm ); +HYPRE_Int hypre_relax_wtx ( void *relax_vdata, HYPRE_Int pointset, hypre_StructVector *t, + hypre_StructVector *x ); +HYPRE_Int hypre_relax_copy ( void *relax_vdata, HYPRE_Int pointset, hypre_StructVector *t, + hypre_StructVector *x ); /* red_black_constantcoef_gs.c */ -HYPRE_Int hypre_RedBlackConstantCoefGS ( void *relax_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); +HYPRE_Int hypre_RedBlackConstantCoefGS ( void *relax_vdata, hypre_StructMatrix *A, + hypre_StructVector *b, hypre_StructVector *x ); /* red_black_gs.c */ void *hypre_RedBlackGSCreate ( MPI_Comm comm ); HYPRE_Int hypre_RedBlackGSDestroy ( void *relax_vdata ); -HYPRE_Int hypre_RedBlackGSSetup ( void *relax_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); -HYPRE_Int hypre_RedBlackGS ( void *relax_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); -HYPRE_Int hypre_RedBlackGSSetTol ( void *relax_vdata , HYPRE_Real tol ); -HYPRE_Int hypre_RedBlackGSSetMaxIter ( void *relax_vdata , HYPRE_Int max_iter ); -HYPRE_Int hypre_RedBlackGSSetZeroGuess ( void *relax_vdata , HYPRE_Int zero_guess ); +HYPRE_Int hypre_RedBlackGSSetup ( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, + hypre_StructVector *x ); +HYPRE_Int hypre_RedBlackGS ( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, + hypre_StructVector *x ); +HYPRE_Int hypre_RedBlackGSSetTol ( void *relax_vdata, HYPRE_Real tol ); +HYPRE_Int hypre_RedBlackGSSetMaxIter ( void *relax_vdata, HYPRE_Int max_iter ); +HYPRE_Int hypre_RedBlackGSSetZeroGuess ( void *relax_vdata, HYPRE_Int zero_guess ); HYPRE_Int hypre_RedBlackGSSetStartRed ( void *relax_vdata ); HYPRE_Int hypre_RedBlackGSSetStartBlack ( void *relax_vdata ); /* semi.c */ -HYPRE_Int hypre_StructInterpAssemble ( hypre_StructMatrix *A , hypre_StructMatrix *P , HYPRE_Int P_stored_as_transpose , HYPRE_Int cdir , hypre_Index index , hypre_Index stride ); +HYPRE_Int hypre_StructInterpAssemble ( hypre_StructMatrix *A, hypre_StructMatrix *P, + HYPRE_Int P_stored_as_transpose, HYPRE_Int cdir, hypre_Index index, hypre_Index stride ); /* semi_interp.c */ void *hypre_SemiInterpCreate ( void ); -HYPRE_Int hypre_SemiInterpSetup ( void *interp_vdata , hypre_StructMatrix *P , HYPRE_Int P_stored_as_transpose , hypre_StructVector *xc , hypre_StructVector *e , hypre_Index cindex , hypre_Index findex , hypre_Index stride ); -HYPRE_Int hypre_SemiInterp ( void *interp_vdata , hypre_StructMatrix *P , hypre_StructVector *xc , hypre_StructVector *e ); +HYPRE_Int hypre_SemiInterpSetup ( void *interp_vdata, hypre_StructMatrix *P, + HYPRE_Int P_stored_as_transpose, hypre_StructVector *xc, hypre_StructVector *e, hypre_Index cindex, + hypre_Index findex, hypre_Index stride ); +HYPRE_Int hypre_SemiInterp ( void *interp_vdata, hypre_StructMatrix *P, hypre_StructVector *xc, + hypre_StructVector *e ); HYPRE_Int hypre_SemiInterpDestroy ( void *interp_vdata ); /* semi_restrict.c */ void *hypre_SemiRestrictCreate ( void ); -HYPRE_Int hypre_SemiRestrictSetup ( void *restrict_vdata , hypre_StructMatrix *R , HYPRE_Int R_stored_as_transpose , hypre_StructVector *r , hypre_StructVector *rc , hypre_Index cindex , hypre_Index findex , hypre_Index stride ); -HYPRE_Int hypre_SemiRestrict ( void *restrict_vdata , hypre_StructMatrix *R , hypre_StructVector *r , hypre_StructVector *rc ); +HYPRE_Int hypre_SemiRestrictSetup ( void *restrict_vdata, hypre_StructMatrix *R, + HYPRE_Int R_stored_as_transpose, hypre_StructVector *r, hypre_StructVector *rc, hypre_Index cindex, + hypre_Index findex, hypre_Index stride ); +HYPRE_Int hypre_SemiRestrict ( void *restrict_vdata, hypre_StructMatrix *R, hypre_StructVector *r, + hypre_StructVector *rc ); HYPRE_Int hypre_SemiRestrictDestroy ( void *restrict_vdata ); /* semi_setup_rap.c */ -hypre_StructMatrix *hypre_SemiCreateRAPOp ( hypre_StructMatrix *R , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructGrid *coarse_grid , HYPRE_Int cdir , HYPRE_Int P_stored_as_transpose ); -HYPRE_Int hypre_SemiBuildRAP ( hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , HYPRE_Int P_stored_as_transpose , hypre_StructMatrix *RAP ); +hypre_StructMatrix *hypre_SemiCreateRAPOp ( hypre_StructMatrix *R, hypre_StructMatrix *A, + hypre_StructMatrix *P, hypre_StructGrid *coarse_grid, HYPRE_Int cdir, + HYPRE_Int P_stored_as_transpose ); +HYPRE_Int hypre_SemiBuildRAP ( hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, + HYPRE_Int cdir, hypre_Index cindex, hypre_Index cstride, HYPRE_Int P_stored_as_transpose, + hypre_StructMatrix *RAP ); /* smg2_setup_rap.c */ -hypre_StructMatrix *hypre_SMG2CreateRAPOp ( hypre_StructMatrix *R , hypre_StructMatrix *A , hypre_StructMatrix *PT , hypre_StructGrid *coarse_grid ); -HYPRE_Int hypre_SMG2BuildRAPSym ( hypre_StructMatrix *A , hypre_StructMatrix *PT , hypre_StructMatrix *R , hypre_StructMatrix *RAP , hypre_Index cindex , hypre_Index cstride ); -HYPRE_Int hypre_SMG2BuildRAPNoSym ( hypre_StructMatrix *A , hypre_StructMatrix *PT , hypre_StructMatrix *R , hypre_StructMatrix *RAP , hypre_Index cindex , hypre_Index cstride ); -HYPRE_Int hypre_SMG2RAPPeriodicSym ( hypre_StructMatrix *RAP , hypre_Index cindex , hypre_Index cstride ); -HYPRE_Int hypre_SMG2RAPPeriodicNoSym ( hypre_StructMatrix *RAP , hypre_Index cindex , hypre_Index cstride ); +hypre_StructMatrix *hypre_SMG2CreateRAPOp ( hypre_StructMatrix *R, hypre_StructMatrix *A, + hypre_StructMatrix *PT, hypre_StructGrid *coarse_grid ); +HYPRE_Int hypre_SMG2BuildRAPSym ( hypre_StructMatrix *A, hypre_StructMatrix *PT, + hypre_StructMatrix *R, hypre_StructMatrix *RAP, hypre_Index cindex, hypre_Index cstride ); +HYPRE_Int hypre_SMG2BuildRAPNoSym ( hypre_StructMatrix *A, hypre_StructMatrix *PT, + hypre_StructMatrix *R, hypre_StructMatrix *RAP, hypre_Index cindex, hypre_Index cstride ); +HYPRE_Int hypre_SMG2RAPPeriodicSym ( hypre_StructMatrix *RAP, hypre_Index cindex, + hypre_Index cstride ); +HYPRE_Int hypre_SMG2RAPPeriodicNoSym ( hypre_StructMatrix *RAP, hypre_Index cindex, + hypre_Index cstride ); /* smg3_setup_rap.c */ -hypre_StructMatrix *hypre_SMG3CreateRAPOp ( hypre_StructMatrix *R , hypre_StructMatrix *A , hypre_StructMatrix *PT , hypre_StructGrid *coarse_grid ); -HYPRE_Int hypre_SMG3BuildRAPSym ( hypre_StructMatrix *A , hypre_StructMatrix *PT , hypre_StructMatrix *R , hypre_StructMatrix *RAP , hypre_Index cindex , hypre_Index cstride ); -HYPRE_Int hypre_SMG3BuildRAPNoSym ( hypre_StructMatrix *A , hypre_StructMatrix *PT , hypre_StructMatrix *R , hypre_StructMatrix *RAP , hypre_Index cindex , hypre_Index cstride ); -HYPRE_Int hypre_SMG3RAPPeriodicSym ( hypre_StructMatrix *RAP , hypre_Index cindex , hypre_Index cstride ); -HYPRE_Int hypre_SMG3RAPPeriodicNoSym ( hypre_StructMatrix *RAP , hypre_Index cindex , hypre_Index cstride ); +hypre_StructMatrix *hypre_SMG3CreateRAPOp ( hypre_StructMatrix *R, hypre_StructMatrix *A, + hypre_StructMatrix *PT, hypre_StructGrid *coarse_grid ); +HYPRE_Int hypre_SMG3BuildRAPSym ( hypre_StructMatrix *A, hypre_StructMatrix *PT, + hypre_StructMatrix *R, hypre_StructMatrix *RAP, hypre_Index cindex, hypre_Index cstride ); +HYPRE_Int hypre_SMG3BuildRAPNoSym ( hypre_StructMatrix *A, hypre_StructMatrix *PT, + hypre_StructMatrix *R, hypre_StructMatrix *RAP, hypre_Index cindex, hypre_Index cstride ); +HYPRE_Int hypre_SMG3RAPPeriodicSym ( hypre_StructMatrix *RAP, hypre_Index cindex, + hypre_Index cstride ); +HYPRE_Int hypre_SMG3RAPPeriodicNoSym ( hypre_StructMatrix *RAP, hypre_Index cindex, + hypre_Index cstride ); /* smg_axpy.c */ -HYPRE_Int hypre_SMGAxpy ( HYPRE_Real alpha , hypre_StructVector *x , hypre_StructVector *y , hypre_Index base_index , hypre_Index base_stride ); +HYPRE_Int hypre_SMGAxpy ( HYPRE_Real alpha, hypre_StructVector *x, hypre_StructVector *y, + hypre_Index base_index, hypre_Index base_stride ); /* smg.c */ void *hypre_SMGCreate ( MPI_Comm comm ); HYPRE_Int hypre_SMGDestroy ( void *smg_vdata ); -HYPRE_Int hypre_SMGSetMemoryUse ( void *smg_vdata , HYPRE_Int memory_use ); -HYPRE_Int hypre_SMGGetMemoryUse ( void *smg_vdata , HYPRE_Int *memory_use ); -HYPRE_Int hypre_SMGSetTol ( void *smg_vdata , HYPRE_Real tol ); -HYPRE_Int hypre_SMGGetTol ( void *smg_vdata , HYPRE_Real *tol ); -HYPRE_Int hypre_SMGSetMaxIter ( void *smg_vdata , HYPRE_Int max_iter ); -HYPRE_Int hypre_SMGGetMaxIter ( void *smg_vdata , HYPRE_Int *max_iter ); -HYPRE_Int hypre_SMGSetRelChange ( void *smg_vdata , HYPRE_Int rel_change ); -HYPRE_Int hypre_SMGGetRelChange ( void *smg_vdata , HYPRE_Int *rel_change ); -HYPRE_Int hypre_SMGSetZeroGuess ( void *smg_vdata , HYPRE_Int zero_guess ); -HYPRE_Int hypre_SMGGetZeroGuess ( void *smg_vdata , HYPRE_Int *zero_guess ); -HYPRE_Int hypre_SMGSetNumPreRelax ( void *smg_vdata , HYPRE_Int num_pre_relax ); -HYPRE_Int hypre_SMGGetNumPreRelax ( void *smg_vdata , HYPRE_Int *num_pre_relax ); -HYPRE_Int hypre_SMGSetNumPostRelax ( void *smg_vdata , HYPRE_Int num_post_relax ); -HYPRE_Int hypre_SMGGetNumPostRelax ( void *smg_vdata , HYPRE_Int *num_post_relax ); -HYPRE_Int hypre_SMGSetBase ( void *smg_vdata , hypre_Index base_index , hypre_Index base_stride ); -HYPRE_Int hypre_SMGSetLogging ( void *smg_vdata , HYPRE_Int logging ); -HYPRE_Int hypre_SMGGetLogging ( void *smg_vdata , HYPRE_Int *logging ); -HYPRE_Int hypre_SMGSetPrintLevel ( void *smg_vdata , HYPRE_Int print_level ); -HYPRE_Int hypre_SMGGetPrintLevel ( void *smg_vdata , HYPRE_Int *print_level ); -HYPRE_Int hypre_SMGGetNumIterations ( void *smg_vdata , HYPRE_Int *num_iterations ); -HYPRE_Int hypre_SMGPrintLogging ( void *smg_vdata , HYPRE_Int myid ); -HYPRE_Int hypre_SMGGetFinalRelativeResidualNorm ( void *smg_vdata , HYPRE_Real *relative_residual_norm ); -HYPRE_Int hypre_SMGSetStructVectorConstantValues ( hypre_StructVector *vector , HYPRE_Real values , hypre_BoxArray *box_array , hypre_Index stride ); +HYPRE_Int hypre_SMGSetMemoryUse ( void *smg_vdata, HYPRE_Int memory_use ); +HYPRE_Int hypre_SMGGetMemoryUse ( void *smg_vdata, HYPRE_Int *memory_use ); +HYPRE_Int hypre_SMGSetTol ( void *smg_vdata, HYPRE_Real tol ); +HYPRE_Int hypre_SMGGetTol ( void *smg_vdata, HYPRE_Real *tol ); +HYPRE_Int hypre_SMGSetMaxIter ( void *smg_vdata, HYPRE_Int max_iter ); +HYPRE_Int hypre_SMGGetMaxIter ( void *smg_vdata, HYPRE_Int *max_iter ); +HYPRE_Int hypre_SMGSetRelChange ( void *smg_vdata, HYPRE_Int rel_change ); +HYPRE_Int hypre_SMGGetRelChange ( void *smg_vdata, HYPRE_Int *rel_change ); +HYPRE_Int hypre_SMGSetZeroGuess ( void *smg_vdata, HYPRE_Int zero_guess ); +HYPRE_Int hypre_SMGGetZeroGuess ( void *smg_vdata, HYPRE_Int *zero_guess ); +HYPRE_Int hypre_SMGSetNumPreRelax ( void *smg_vdata, HYPRE_Int num_pre_relax ); +HYPRE_Int hypre_SMGGetNumPreRelax ( void *smg_vdata, HYPRE_Int *num_pre_relax ); +HYPRE_Int hypre_SMGSetNumPostRelax ( void *smg_vdata, HYPRE_Int num_post_relax ); +HYPRE_Int hypre_SMGGetNumPostRelax ( void *smg_vdata, HYPRE_Int *num_post_relax ); +HYPRE_Int hypre_SMGSetBase ( void *smg_vdata, hypre_Index base_index, hypre_Index base_stride ); +HYPRE_Int hypre_SMGSetLogging ( void *smg_vdata, HYPRE_Int logging ); +HYPRE_Int hypre_SMGGetLogging ( void *smg_vdata, HYPRE_Int *logging ); +HYPRE_Int hypre_SMGSetPrintLevel ( void *smg_vdata, HYPRE_Int print_level ); +HYPRE_Int hypre_SMGGetPrintLevel ( void *smg_vdata, HYPRE_Int *print_level ); +HYPRE_Int hypre_SMGGetNumIterations ( void *smg_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int hypre_SMGPrintLogging ( void *smg_vdata, HYPRE_Int myid ); +HYPRE_Int hypre_SMGGetFinalRelativeResidualNorm ( void *smg_vdata, + HYPRE_Real *relative_residual_norm ); +HYPRE_Int hypre_SMGSetStructVectorConstantValues ( hypre_StructVector *vector, HYPRE_Real values, + hypre_BoxArray *box_array, hypre_Index stride ); HYPRE_Int hypre_StructSMGSetMaxLevel( void *smg_vdata, HYPRE_Int max_level ); /* smg_relax.c */ @@ -315,112 +480,163 @@ HYPRE_Int hypre_SMGRelaxDestroyTempVec ( void *relax_vdata ); HYPRE_Int hypre_SMGRelaxDestroyARem ( void *relax_vdata ); HYPRE_Int hypre_SMGRelaxDestroyASol ( void *relax_vdata ); HYPRE_Int hypre_SMGRelaxDestroy ( void *relax_vdata ); -HYPRE_Int hypre_SMGRelax ( void *relax_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); -HYPRE_Int hypre_SMGRelaxSetup ( void *relax_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); -HYPRE_Int hypre_SMGRelaxSetupTempVec ( void *relax_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); -HYPRE_Int hypre_SMGRelaxSetupARem ( void *relax_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); -HYPRE_Int hypre_SMGRelaxSetupASol ( void *relax_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); -HYPRE_Int hypre_SMGRelaxSetTempVec ( void *relax_vdata , hypre_StructVector *temp_vec ); -HYPRE_Int hypre_SMGRelaxSetMemoryUse ( void *relax_vdata , HYPRE_Int memory_use ); -HYPRE_Int hypre_SMGRelaxSetTol ( void *relax_vdata , HYPRE_Real tol ); -HYPRE_Int hypre_SMGRelaxSetMaxIter ( void *relax_vdata , HYPRE_Int max_iter ); -HYPRE_Int hypre_SMGRelaxSetZeroGuess ( void *relax_vdata , HYPRE_Int zero_guess ); -HYPRE_Int hypre_SMGRelaxSetNumSpaces ( void *relax_vdata , HYPRE_Int num_spaces ); -HYPRE_Int hypre_SMGRelaxSetNumPreSpaces ( void *relax_vdata , HYPRE_Int num_pre_spaces ); -HYPRE_Int hypre_SMGRelaxSetNumRegSpaces ( void *relax_vdata , HYPRE_Int num_reg_spaces ); -HYPRE_Int hypre_SMGRelaxSetSpace ( void *relax_vdata , HYPRE_Int i , HYPRE_Int space_index , HYPRE_Int space_stride ); -HYPRE_Int hypre_SMGRelaxSetRegSpaceRank ( void *relax_vdata , HYPRE_Int i , HYPRE_Int reg_space_rank ); -HYPRE_Int hypre_SMGRelaxSetPreSpaceRank ( void *relax_vdata , HYPRE_Int i , HYPRE_Int pre_space_rank ); -HYPRE_Int hypre_SMGRelaxSetBase ( void *relax_vdata , hypre_Index base_index , hypre_Index base_stride ); -HYPRE_Int hypre_SMGRelaxSetNumPreRelax ( void *relax_vdata , HYPRE_Int num_pre_relax ); -HYPRE_Int hypre_SMGRelaxSetNumPostRelax ( void *relax_vdata , HYPRE_Int num_post_relax ); -HYPRE_Int hypre_SMGRelaxSetNewMatrixStencil ( void *relax_vdata , hypre_StructStencil *diff_stencil ); -HYPRE_Int hypre_SMGRelaxSetupBaseBoxArray ( void *relax_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); +HYPRE_Int hypre_SMGRelax ( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, + hypre_StructVector *x ); +HYPRE_Int hypre_SMGRelaxSetup ( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, + hypre_StructVector *x ); +HYPRE_Int hypre_SMGRelaxSetupTempVec ( void *relax_vdata, hypre_StructMatrix *A, + hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int hypre_SMGRelaxSetupARem ( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, + hypre_StructVector *x ); +HYPRE_Int hypre_SMGRelaxSetupASol ( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, + hypre_StructVector *x ); +HYPRE_Int hypre_SMGRelaxSetTempVec ( void *relax_vdata, hypre_StructVector *temp_vec ); +HYPRE_Int hypre_SMGRelaxSetMemoryUse ( void *relax_vdata, HYPRE_Int memory_use ); +HYPRE_Int hypre_SMGRelaxSetTol ( void *relax_vdata, HYPRE_Real tol ); +HYPRE_Int hypre_SMGRelaxSetMaxIter ( void *relax_vdata, HYPRE_Int max_iter ); +HYPRE_Int hypre_SMGRelaxSetZeroGuess ( void *relax_vdata, HYPRE_Int zero_guess ); +HYPRE_Int hypre_SMGRelaxSetNumSpaces ( void *relax_vdata, HYPRE_Int num_spaces ); +HYPRE_Int hypre_SMGRelaxSetNumPreSpaces ( void *relax_vdata, HYPRE_Int num_pre_spaces ); +HYPRE_Int hypre_SMGRelaxSetNumRegSpaces ( void *relax_vdata, HYPRE_Int num_reg_spaces ); +HYPRE_Int hypre_SMGRelaxSetSpace ( void *relax_vdata, HYPRE_Int i, HYPRE_Int space_index, + HYPRE_Int space_stride ); +HYPRE_Int hypre_SMGRelaxSetRegSpaceRank ( void *relax_vdata, HYPRE_Int i, + HYPRE_Int reg_space_rank ); +HYPRE_Int hypre_SMGRelaxSetPreSpaceRank ( void *relax_vdata, HYPRE_Int i, + HYPRE_Int pre_space_rank ); +HYPRE_Int hypre_SMGRelaxSetBase ( void *relax_vdata, hypre_Index base_index, + hypre_Index base_stride ); +HYPRE_Int hypre_SMGRelaxSetNumPreRelax ( void *relax_vdata, HYPRE_Int num_pre_relax ); +HYPRE_Int hypre_SMGRelaxSetNumPostRelax ( void *relax_vdata, HYPRE_Int num_post_relax ); +HYPRE_Int hypre_SMGRelaxSetNewMatrixStencil ( void *relax_vdata, + hypre_StructStencil *diff_stencil ); +HYPRE_Int hypre_SMGRelaxSetupBaseBoxArray ( void *relax_vdata, hypre_StructMatrix *A, + hypre_StructVector *b, hypre_StructVector *x ); HYPRE_Int hypre_SMGRelaxSetMaxLevel( void *relax_vdata, HYPRE_Int num_max_level ); /* smg_residual.c */ void *hypre_SMGResidualCreate ( void ); -HYPRE_Int hypre_SMGResidualSetup ( void *residual_vdata , hypre_StructMatrix *A , hypre_StructVector *x , hypre_StructVector *b , hypre_StructVector *r ); -HYPRE_Int hypre_SMGResidual ( void *residual_vdata , hypre_StructMatrix *A , hypre_StructVector *x , hypre_StructVector *b , hypre_StructVector *r ); -HYPRE_Int hypre_SMGResidualSetBase ( void *residual_vdata , hypre_Index base_index , hypre_Index base_stride ); +HYPRE_Int hypre_SMGResidualSetup ( void *residual_vdata, hypre_StructMatrix *A, + hypre_StructVector *x, hypre_StructVector *b, hypre_StructVector *r ); +HYPRE_Int hypre_SMGResidual ( void *residual_vdata, hypre_StructMatrix *A, hypre_StructVector *x, + hypre_StructVector *b, hypre_StructVector *r ); +HYPRE_Int hypre_SMGResidualSetBase ( void *residual_vdata, hypre_Index base_index, + hypre_Index base_stride ); HYPRE_Int hypre_SMGResidualDestroy ( void *residual_vdata ); /* smg_residual_unrolled.c */ void *hypre_SMGResidualCreate ( void ); -HYPRE_Int hypre_SMGResidualSetup ( void *residual_vdata , hypre_StructMatrix *A , hypre_StructVector *x , hypre_StructVector *b , hypre_StructVector *r ); -HYPRE_Int hypre_SMGResidual ( void *residual_vdata , hypre_StructMatrix *A , hypre_StructVector *x , hypre_StructVector *b , hypre_StructVector *r ); -HYPRE_Int hypre_SMGResidualSetBase ( void *residual_vdata , hypre_Index base_index , hypre_Index base_stride ); +HYPRE_Int hypre_SMGResidualSetup ( void *residual_vdata, hypre_StructMatrix *A, + hypre_StructVector *x, hypre_StructVector *b, hypre_StructVector *r ); +HYPRE_Int hypre_SMGResidual ( void *residual_vdata, hypre_StructMatrix *A, hypre_StructVector *x, + hypre_StructVector *b, hypre_StructVector *r ); +HYPRE_Int hypre_SMGResidualSetBase ( void *residual_vdata, hypre_Index base_index, + hypre_Index base_stride ); HYPRE_Int hypre_SMGResidualDestroy ( void *residual_vdata ); /* smg_setup.c */ -HYPRE_Int hypre_SMGSetup ( void *smg_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); +HYPRE_Int hypre_SMGSetup ( void *smg_vdata, hypre_StructMatrix *A, hypre_StructVector *b, + hypre_StructVector *x ); /* smg_setup_interp.c */ -hypre_StructMatrix *hypre_SMGCreateInterpOp ( hypre_StructMatrix *A , hypre_StructGrid *cgrid , HYPRE_Int cdir ); -HYPRE_Int hypre_SMGSetupInterpOp ( void *relax_data , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x , hypre_StructMatrix *PT , HYPRE_Int cdir , hypre_Index cindex , hypre_Index findex , hypre_Index stride ); +hypre_StructMatrix *hypre_SMGCreateInterpOp ( hypre_StructMatrix *A, hypre_StructGrid *cgrid, + HYPRE_Int cdir ); +HYPRE_Int hypre_SMGSetupInterpOp ( void *relax_data, hypre_StructMatrix *A, hypre_StructVector *b, + hypre_StructVector *x, hypre_StructMatrix *PT, HYPRE_Int cdir, hypre_Index cindex, + hypre_Index findex, hypre_Index stride ); /* smg_setup_rap.c */ -hypre_StructMatrix *hypre_SMGCreateRAPOp ( hypre_StructMatrix *R , hypre_StructMatrix *A , hypre_StructMatrix *PT , hypre_StructGrid *coarse_grid ); -HYPRE_Int hypre_SMGSetupRAPOp ( hypre_StructMatrix *R , hypre_StructMatrix *A , hypre_StructMatrix *PT , hypre_StructMatrix *Ac , hypre_Index cindex , hypre_Index cstride ); +hypre_StructMatrix *hypre_SMGCreateRAPOp ( hypre_StructMatrix *R, hypre_StructMatrix *A, + hypre_StructMatrix *PT, hypre_StructGrid *coarse_grid ); +HYPRE_Int hypre_SMGSetupRAPOp ( hypre_StructMatrix *R, hypre_StructMatrix *A, + hypre_StructMatrix *PT, hypre_StructMatrix *Ac, hypre_Index cindex, hypre_Index cstride ); /* smg_setup_restrict.c */ -hypre_StructMatrix *hypre_SMGCreateRestrictOp ( hypre_StructMatrix *A , hypre_StructGrid *cgrid , HYPRE_Int cdir ); -HYPRE_Int hypre_SMGSetupRestrictOp ( hypre_StructMatrix *A , hypre_StructMatrix *R , hypre_StructVector *temp_vec , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride ); +hypre_StructMatrix *hypre_SMGCreateRestrictOp ( hypre_StructMatrix *A, hypre_StructGrid *cgrid, + HYPRE_Int cdir ); +HYPRE_Int hypre_SMGSetupRestrictOp ( hypre_StructMatrix *A, hypre_StructMatrix *R, + hypre_StructVector *temp_vec, HYPRE_Int cdir, hypre_Index cindex, hypre_Index cstride ); /* smg_solve.c */ -HYPRE_Int hypre_SMGSolve ( void *smg_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); +HYPRE_Int hypre_SMGSolve ( void *smg_vdata, hypre_StructMatrix *A, hypre_StructVector *b, + hypre_StructVector *x ); /* sparse_msg2_setup_rap.c */ -hypre_StructMatrix *hypre_SparseMSG2CreateRAPOp ( hypre_StructMatrix *R , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructGrid *coarse_grid , HYPRE_Int cdir ); -HYPRE_Int hypre_SparseMSG2BuildRAPSym ( hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_Index stridePR , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_SparseMSG2BuildRAPNoSym ( hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_Index stridePR , hypre_StructMatrix *RAP ); +hypre_StructMatrix *hypre_SparseMSG2CreateRAPOp ( hypre_StructMatrix *R, hypre_StructMatrix *A, + hypre_StructMatrix *P, hypre_StructGrid *coarse_grid, HYPRE_Int cdir ); +HYPRE_Int hypre_SparseMSG2BuildRAPSym ( hypre_StructMatrix *A, hypre_StructMatrix *P, + hypre_StructMatrix *R, HYPRE_Int cdir, hypre_Index cindex, hypre_Index cstride, + hypre_Index stridePR, hypre_StructMatrix *RAP ); +HYPRE_Int hypre_SparseMSG2BuildRAPNoSym ( hypre_StructMatrix *A, hypre_StructMatrix *P, + hypre_StructMatrix *R, HYPRE_Int cdir, hypre_Index cindex, hypre_Index cstride, + hypre_Index stridePR, hypre_StructMatrix *RAP ); /* sparse_msg3_setup_rap.c */ -hypre_StructMatrix *hypre_SparseMSG3CreateRAPOp ( hypre_StructMatrix *R , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructGrid *coarse_grid , HYPRE_Int cdir ); -HYPRE_Int hypre_SparseMSG3BuildRAPSym ( hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_Index stridePR , hypre_StructMatrix *RAP ); -HYPRE_Int hypre_SparseMSG3BuildRAPNoSym ( hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructMatrix *R , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_Index stridePR , hypre_StructMatrix *RAP ); +hypre_StructMatrix *hypre_SparseMSG3CreateRAPOp ( hypre_StructMatrix *R, hypre_StructMatrix *A, + hypre_StructMatrix *P, hypre_StructGrid *coarse_grid, HYPRE_Int cdir ); +HYPRE_Int hypre_SparseMSG3BuildRAPSym ( hypre_StructMatrix *A, hypre_StructMatrix *P, + hypre_StructMatrix *R, HYPRE_Int cdir, hypre_Index cindex, hypre_Index cstride, + hypre_Index stridePR, hypre_StructMatrix *RAP ); +HYPRE_Int hypre_SparseMSG3BuildRAPNoSym ( hypre_StructMatrix *A, hypre_StructMatrix *P, + hypre_StructMatrix *R, HYPRE_Int cdir, hypre_Index cindex, hypre_Index cstride, + hypre_Index stridePR, hypre_StructMatrix *RAP ); /* sparse_msg.c */ void *hypre_SparseMSGCreate ( MPI_Comm comm ); HYPRE_Int hypre_SparseMSGDestroy ( void *smsg_vdata ); -HYPRE_Int hypre_SparseMSGSetTol ( void *smsg_vdata , HYPRE_Real tol ); -HYPRE_Int hypre_SparseMSGSetMaxIter ( void *smsg_vdata , HYPRE_Int max_iter ); -HYPRE_Int hypre_SparseMSGSetJump ( void *smsg_vdata , HYPRE_Int jump ); -HYPRE_Int hypre_SparseMSGSetRelChange ( void *smsg_vdata , HYPRE_Int rel_change ); -HYPRE_Int hypre_SparseMSGSetZeroGuess ( void *smsg_vdata , HYPRE_Int zero_guess ); -HYPRE_Int hypre_SparseMSGSetRelaxType ( void *smsg_vdata , HYPRE_Int relax_type ); -HYPRE_Int hypre_SparseMSGSetJacobiWeight ( void *smsg_vdata , HYPRE_Real weight ); -HYPRE_Int hypre_SparseMSGSetNumPreRelax ( void *smsg_vdata , HYPRE_Int num_pre_relax ); -HYPRE_Int hypre_SparseMSGSetNumPostRelax ( void *smsg_vdata , HYPRE_Int num_post_relax ); -HYPRE_Int hypre_SparseMSGSetNumFineRelax ( void *smsg_vdata , HYPRE_Int num_fine_relax ); -HYPRE_Int hypre_SparseMSGSetLogging ( void *smsg_vdata , HYPRE_Int logging ); -HYPRE_Int hypre_SparseMSGSetPrintLevel ( void *smsg_vdata , HYPRE_Int print_level ); -HYPRE_Int hypre_SparseMSGGetNumIterations ( void *smsg_vdata , HYPRE_Int *num_iterations ); -HYPRE_Int hypre_SparseMSGPrintLogging ( void *smsg_vdata , HYPRE_Int myid ); -HYPRE_Int hypre_SparseMSGGetFinalRelativeResidualNorm ( void *smsg_vdata , HYPRE_Real *relative_residual_norm ); +HYPRE_Int hypre_SparseMSGSetTol ( void *smsg_vdata, HYPRE_Real tol ); +HYPRE_Int hypre_SparseMSGSetMaxIter ( void *smsg_vdata, HYPRE_Int max_iter ); +HYPRE_Int hypre_SparseMSGSetJump ( void *smsg_vdata, HYPRE_Int jump ); +HYPRE_Int hypre_SparseMSGSetRelChange ( void *smsg_vdata, HYPRE_Int rel_change ); +HYPRE_Int hypre_SparseMSGSetZeroGuess ( void *smsg_vdata, HYPRE_Int zero_guess ); +HYPRE_Int hypre_SparseMSGSetRelaxType ( void *smsg_vdata, HYPRE_Int relax_type ); +HYPRE_Int hypre_SparseMSGSetJacobiWeight ( void *smsg_vdata, HYPRE_Real weight ); +HYPRE_Int hypre_SparseMSGSetNumPreRelax ( void *smsg_vdata, HYPRE_Int num_pre_relax ); +HYPRE_Int hypre_SparseMSGSetNumPostRelax ( void *smsg_vdata, HYPRE_Int num_post_relax ); +HYPRE_Int hypre_SparseMSGSetNumFineRelax ( void *smsg_vdata, HYPRE_Int num_fine_relax ); +HYPRE_Int hypre_SparseMSGSetLogging ( void *smsg_vdata, HYPRE_Int logging ); +HYPRE_Int hypre_SparseMSGSetPrintLevel ( void *smsg_vdata, HYPRE_Int print_level ); +HYPRE_Int hypre_SparseMSGGetNumIterations ( void *smsg_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int hypre_SparseMSGPrintLogging ( void *smsg_vdata, HYPRE_Int myid ); +HYPRE_Int hypre_SparseMSGGetFinalRelativeResidualNorm ( void *smsg_vdata, + HYPRE_Real *relative_residual_norm ); /* sparse_msg_filter.c */ -HYPRE_Int hypre_SparseMSGFilterSetup ( hypre_StructMatrix *A , HYPRE_Int *num_grids , HYPRE_Int lx , HYPRE_Int ly , HYPRE_Int lz , HYPRE_Int jump , hypre_StructVector *visitx , hypre_StructVector *visity , hypre_StructVector *visitz ); -HYPRE_Int hypre_SparseMSGFilter ( hypre_StructVector *visit , hypre_StructVector *e , HYPRE_Int lx , HYPRE_Int ly , HYPRE_Int lz , HYPRE_Int jump ); +HYPRE_Int hypre_SparseMSGFilterSetup ( hypre_StructMatrix *A, HYPRE_Int *num_grids, HYPRE_Int lx, + HYPRE_Int ly, HYPRE_Int lz, HYPRE_Int jump, hypre_StructVector *visitx, hypre_StructVector *visity, + hypre_StructVector *visitz ); +HYPRE_Int hypre_SparseMSGFilter ( hypre_StructVector *visit, hypre_StructVector *e, HYPRE_Int lx, + HYPRE_Int ly, HYPRE_Int lz, HYPRE_Int jump ); /* sparse_msg_interp.c */ void *hypre_SparseMSGInterpCreate ( void ); -HYPRE_Int hypre_SparseMSGInterpSetup ( void *interp_vdata , hypre_StructMatrix *P , hypre_StructVector *xc , hypre_StructVector *e , hypre_Index cindex , hypre_Index findex , hypre_Index stride , hypre_Index strideP ); -HYPRE_Int hypre_SparseMSGInterp ( void *interp_vdata , hypre_StructMatrix *P , hypre_StructVector *xc , hypre_StructVector *e ); +HYPRE_Int hypre_SparseMSGInterpSetup ( void *interp_vdata, hypre_StructMatrix *P, + hypre_StructVector *xc, hypre_StructVector *e, hypre_Index cindex, hypre_Index findex, + hypre_Index stride, hypre_Index strideP ); +HYPRE_Int hypre_SparseMSGInterp ( void *interp_vdata, hypre_StructMatrix *P, hypre_StructVector *xc, + hypre_StructVector *e ); HYPRE_Int hypre_SparseMSGInterpDestroy ( void *interp_vdata ); /* sparse_msg_restrict.c */ void *hypre_SparseMSGRestrictCreate ( void ); -HYPRE_Int hypre_SparseMSGRestrictSetup ( void *restrict_vdata , hypre_StructMatrix *R , hypre_StructVector *r , hypre_StructVector *rc , hypre_Index cindex , hypre_Index findex , hypre_Index stride , hypre_Index strideR ); -HYPRE_Int hypre_SparseMSGRestrict ( void *restrict_vdata , hypre_StructMatrix *R , hypre_StructVector *r , hypre_StructVector *rc ); +HYPRE_Int hypre_SparseMSGRestrictSetup ( void *restrict_vdata, hypre_StructMatrix *R, + hypre_StructVector *r, hypre_StructVector *rc, hypre_Index cindex, hypre_Index findex, + hypre_Index stride, hypre_Index strideR ); +HYPRE_Int hypre_SparseMSGRestrict ( void *restrict_vdata, hypre_StructMatrix *R, + hypre_StructVector *r, hypre_StructVector *rc ); HYPRE_Int hypre_SparseMSGRestrictDestroy ( void *restrict_vdata ); /* sparse_msg_setup.c */ -HYPRE_Int hypre_SparseMSGSetup ( void *smsg_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); +HYPRE_Int hypre_SparseMSGSetup ( void *smsg_vdata, hypre_StructMatrix *A, hypre_StructVector *b, + hypre_StructVector *x ); /* sparse_msg_setup_rap.c */ -hypre_StructMatrix *hypre_SparseMSGCreateRAPOp ( hypre_StructMatrix *R , hypre_StructMatrix *A , hypre_StructMatrix *P , hypre_StructGrid *coarse_grid , HYPRE_Int cdir ); -HYPRE_Int hypre_SparseMSGSetupRAPOp ( hypre_StructMatrix *R , hypre_StructMatrix *A , hypre_StructMatrix *P , HYPRE_Int cdir , hypre_Index cindex , hypre_Index cstride , hypre_Index stridePR , hypre_StructMatrix *Ac ); +hypre_StructMatrix *hypre_SparseMSGCreateRAPOp ( hypre_StructMatrix *R, hypre_StructMatrix *A, + hypre_StructMatrix *P, hypre_StructGrid *coarse_grid, HYPRE_Int cdir ); +HYPRE_Int hypre_SparseMSGSetupRAPOp ( hypre_StructMatrix *R, hypre_StructMatrix *A, + hypre_StructMatrix *P, HYPRE_Int cdir, hypre_Index cindex, hypre_Index cstride, + hypre_Index stridePR, hypre_StructMatrix *Ac ); /* sparse_msg_solve.c */ -HYPRE_Int hypre_SparseMSGSolve ( void *smsg_vdata , hypre_StructMatrix *A , hypre_StructVector *b , hypre_StructVector *x ); +HYPRE_Int hypre_SparseMSGSolve ( void *smsg_vdata, hypre_StructMatrix *A, hypre_StructVector *b, + hypre_StructVector *x ); diff --git a/external/hypre/src/struct_ls/red_black_constantcoef_gs.c b/external/hypre/src/struct_ls/red_black_constantcoef_gs.c index 3dfe151d..63fd5fd6 100644 --- a/external/hypre/src/struct_ls/red_black_constantcoef_gs.c +++ b/external/hypre/src/struct_ls/red_black_constantcoef_gs.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -44,7 +44,8 @@ hypre_RedBlackConstantCoefGS( void *relax_vdata, HYPRE_Int Ai, Astart, Ani, Anj; HYPRE_Int bstart, bni, bnj; HYPRE_Int xstart, xni, xnj; - HYPRE_Int xoff0, xoff1, xoff2, xoff3, xoff4, xoff5; + HYPRE_Int xoff0 = 0, xoff1 = 0, xoff2 = 0; + HYPRE_Int xoff3 = 0, xoff4 = 0, xoff5 = 0; HYPRE_Real *Ap; HYPRE_Real *App; @@ -52,8 +53,9 @@ hypre_RedBlackConstantCoefGS( void *relax_vdata, HYPRE_Real *xp; /* constant coefficient */ - HYPRE_Int constant_coeff= hypre_StructMatrixConstantCoefficient(A); - HYPRE_Real App0, App1, App2, App3, App4, App5, AApd; + HYPRE_Int constant_coeff = hypre_StructMatrixConstantCoefficient(A); + HYPRE_Real App0 = 1.0, App1 = 1.0, App2 = 1.0; + HYPRE_Real App3 = 1.0, App4 = 1.0, App5 = 1.0, AApd = 1.0; hypre_IndexRef start; hypre_Index loop_size; @@ -125,7 +127,7 @@ hypre_RedBlackConstantCoefGS( void *relax_vdata, { for (compute_i = 0; compute_i < 2; compute_i++) { - switch(compute_i) + switch (compute_i) { case 0: { @@ -187,17 +189,17 @@ hypre_RedBlackConstantCoefGS( void *relax_vdata, if (constant_coeff == 1) { - Ai= hypre_CCBoxIndexRank(A_dbox, start); - AApd= 1.0/Ap[Ai]; + Ai = hypre_CCBoxIndexRank(A_dbox, start); + AApd = 1.0 / Ap[Ai]; hypre_RedBlackLoopInit(); #define DEVICE_VAR is_device_ptr(xp,bp) - hypre_RedBlackConstantcoefLoopBegin(ni,nj,nk,redblack, - bstart,bni,bnj,bi, - xstart,xni,xnj,xi); + hypre_RedBlackConstantcoefLoopBegin(ni, nj, nk, redblack, + bstart, bni, bnj, bi, + xstart, xni, xnj, xi); { - xp[xi] = bp[bi]*AApd; + xp[xi] = bp[bi] * AApd; } hypre_RedBlackConstantcoefLoopEnd(); #undef DEVICE_VAR @@ -211,10 +213,10 @@ hypre_RedBlackConstantCoefGS( void *relax_vdata, hypre_RedBlackLoopInit(); #define DEVICE_VAR is_device_ptr(xp,bp,Ap) - hypre_RedBlackLoopBegin(ni,nj,nk,redblack, - Astart,Ani,Anj,Ai, - bstart,bni,bnj,bi, - xstart,xni,xnj,xi); + hypre_RedBlackLoopBegin(ni, nj, nk, redblack, + Astart, Ani, Anj, Ai, + bstart, bni, bnj, bi, + xstart, xni, xnj, xi); { xp[xi] = bp[bi] / Ap[Ai]; } @@ -234,11 +236,11 @@ hypre_RedBlackConstantCoefGS( void *relax_vdata, * Do regular iterations *----------------------------------------------------------*/ - while (iter < 2*max_iter) + while (iter < 2 * max_iter) { for (compute_i = 0; compute_i < 2; compute_i++) { - switch(compute_i) + switch (compute_i) { case 0: { @@ -288,10 +290,10 @@ hypre_RedBlackConstantCoefGS( void *relax_vdata, ni = hypre_IndexX(loop_size); nj = hypre_IndexY(loop_size); nk = hypre_IndexZ(loop_size); - bni= hypre_BoxSizeX(b_dbox); - xni= hypre_BoxSizeX(x_dbox); - bnj= hypre_BoxSizeY(b_dbox); - xnj= hypre_BoxSizeY(x_dbox); + bni = hypre_BoxSizeX(b_dbox); + xni = hypre_BoxSizeX(x_dbox); + bnj = hypre_BoxSizeY(b_dbox); + xnj = hypre_BoxSizeY(x_dbox); Ai = hypre_CCBoxIndexRank(A_dbox, start); if (ndim < 3) { @@ -302,61 +304,63 @@ hypre_RedBlackConstantCoefGS( void *relax_vdata, } } - switch(stencil_size) + switch (stencil_size) { case 7: App = hypre_StructMatrixBoxData(A, i, offd[5]); - App5= App[Ai]; + App5 = App[Ai]; App = hypre_StructMatrixBoxData(A, i, offd[4]); - App4= App[Ai]; + App4 = App[Ai]; xoff5 = hypre_BoxOffsetDistance( - x_dbox, stencil_shape[offd[5]]); + x_dbox, stencil_shape[offd[5]]); xoff4 = hypre_BoxOffsetDistance( - x_dbox, stencil_shape[offd[4]]); + x_dbox, stencil_shape[offd[4]]); + /* fall through */ case 5: App = hypre_StructMatrixBoxData(A, i, offd[3]); - App3= App[Ai]; + App3 = App[Ai]; App = hypre_StructMatrixBoxData(A, i, offd[2]); - App2= App[Ai]; + App2 = App[Ai]; xoff3 = hypre_BoxOffsetDistance( - x_dbox, stencil_shape[offd[3]]); + x_dbox, stencil_shape[offd[3]]); xoff2 = hypre_BoxOffsetDistance( - x_dbox, stencil_shape[offd[2]]); + x_dbox, stencil_shape[offd[2]]); + /* fall through */ case 3: App = hypre_StructMatrixBoxData(A, i, offd[1]); - App1= App[Ai]; + App1 = App[Ai]; App = hypre_StructMatrixBoxData(A, i, offd[0]); - App0= App[Ai]; + App0 = App[Ai]; xoff1 = hypre_BoxOffsetDistance( - x_dbox, stencil_shape[offd[1]]); + x_dbox, stencil_shape[offd[1]]); xoff0 = hypre_BoxOffsetDistance( - x_dbox, stencil_shape[offd[0]]); + x_dbox, stencil_shape[offd[0]]); break; } if (constant_coeff == 1) { - AApd = 1/Ap[Ai]; + AApd = 1 / Ap[Ai]; - switch(stencil_size) + switch (stencil_size) { case 7: hypre_RedBlackLoopInit(); #define DEVICE_VAR is_device_ptr(xp,bp) - hypre_RedBlackConstantcoefLoopBegin(ni,nj,nk,redblack, - bstart,bni,bnj,bi, - xstart,xni,xnj,xi); + hypre_RedBlackConstantcoefLoopBegin(ni, nj, nk, redblack, + bstart, bni, bnj, bi, + xstart, xni, xnj, xi); { xp[xi] = (bp[bi] - - App0*xp[xi + xoff0] - - App1*xp[xi + xoff1] - - App2*xp[xi + xoff2] - - App3*xp[xi + xoff3] - - App4*xp[xi + xoff4] - - App5*xp[xi + xoff5])*AApd; + App0 * xp[xi + xoff0] - + App1 * xp[xi + xoff1] - + App2 * xp[xi + xoff2] - + App3 * xp[xi + xoff3] - + App4 * xp[xi + xoff4] - + App5 * xp[xi + xoff5]) * AApd; } hypre_RedBlackConstantcoefLoopEnd(); #undef DEVICE_VAR @@ -366,16 +370,16 @@ hypre_RedBlackConstantCoefGS( void *relax_vdata, case 5: hypre_RedBlackLoopInit(); #define DEVICE_VAR is_device_ptr(xp,bp) - hypre_RedBlackConstantcoefLoopBegin(ni,nj,nk,redblack, - bstart,bni,bnj,bi, - xstart,xni,xnj,xi); + hypre_RedBlackConstantcoefLoopBegin(ni, nj, nk, redblack, + bstart, bni, bnj, bi, + xstart, xni, xnj, xi); { xp[xi] = (bp[bi] - - App0*xp[xi + xoff0] - - App1*xp[xi + xoff1] - - App2*xp[xi + xoff2] - - App3*xp[xi + xoff3])*AApd; + App0 * xp[xi + xoff0] - + App1 * xp[xi + xoff1] - + App2 * xp[xi + xoff2] - + App3 * xp[xi + xoff3]) * AApd; } hypre_RedBlackConstantcoefLoopEnd(); #undef DEVICE_VAR @@ -384,14 +388,14 @@ hypre_RedBlackConstantCoefGS( void *relax_vdata, case 3: hypre_RedBlackLoopInit(); #define DEVICE_VAR is_device_ptr(xp,bp) - hypre_RedBlackConstantcoefLoopBegin(ni,nj,nk,redblack, - bstart,bni,bnj,bi, - xstart,xni,xnj,xi); + hypre_RedBlackConstantcoefLoopBegin(ni, nj, nk, redblack, + bstart, bni, bnj, bi, + xstart, xni, xnj, xi); { xp[xi] = (bp[bi] - - App0*xp[xi + xoff0] - - App1*xp[xi + xoff1])*AApd; + App0 * xp[xi + xoff0] - + App1 * xp[xi + xoff1]) * AApd; } hypre_RedBlackConstantcoefLoopEnd(); #undef DEVICE_VAR @@ -406,24 +410,24 @@ hypre_RedBlackConstantCoefGS( void *relax_vdata, Ani = hypre_BoxSizeX(A_dbox); Anj = hypre_BoxSizeY(A_dbox); - switch(stencil_size) + switch (stencil_size) { case 7: hypre_RedBlackLoopInit(); #define DEVICE_VAR is_device_ptr(xp,bp,Ap) - hypre_RedBlackLoopBegin(ni,nj,nk,redblack, - Astart,Ani,Anj,Ai, - bstart,bni,bnj,bi, - xstart,xni,xnj,xi); + hypre_RedBlackLoopBegin(ni, nj, nk, redblack, + Astart, Ani, Anj, Ai, + bstart, bni, bnj, bi, + xstart, xni, xnj, xi); { xp[xi] = (bp[bi] - - App0*xp[xi + xoff0] - - App1*xp[xi + xoff1] - - App2*xp[xi + xoff2] - - App3*xp[xi + xoff3] - - App4*xp[xi + xoff4] - - App5*xp[xi + xoff5]) / Ap[Ai]; + App0 * xp[xi + xoff0] - + App1 * xp[xi + xoff1] - + App2 * xp[xi + xoff2] - + App3 * xp[xi + xoff3] - + App4 * xp[xi + xoff4] - + App5 * xp[xi + xoff5]) / Ap[Ai]; } hypre_RedBlackLoopEnd(); #undef DEVICE_VAR @@ -432,17 +436,17 @@ hypre_RedBlackConstantCoefGS( void *relax_vdata, case 5: hypre_RedBlackLoopInit(); #define DEVICE_VAR is_device_ptr(xp,bp,Ap) - hypre_RedBlackLoopBegin(ni,nj,nk,redblack, - Astart,Ani,Anj,Ai, - bstart,bni,bnj,bi, - xstart,xni,xnj,xi); + hypre_RedBlackLoopBegin(ni, nj, nk, redblack, + Astart, Ani, Anj, Ai, + bstart, bni, bnj, bi, + xstart, xni, xnj, xi); { xp[xi] = (bp[bi] - - App0*xp[xi + xoff0] - - App1*xp[xi + xoff1] - - App2*xp[xi + xoff2] - - App3*xp[xi + xoff3]) / Ap[Ai]; + App0 * xp[xi + xoff0] - + App1 * xp[xi + xoff1] - + App2 * xp[xi + xoff2] - + App3 * xp[xi + xoff3]) / Ap[Ai]; } hypre_RedBlackLoopEnd(); #undef DEVICE_VAR @@ -451,15 +455,15 @@ hypre_RedBlackConstantCoefGS( void *relax_vdata, case 3: hypre_RedBlackLoopInit(); #define DEVICE_VAR is_device_ptr(xp,bp,Ap) - hypre_RedBlackLoopBegin(ni,nj,nk,redblack, - Astart,Ani,Anj,Ai, - bstart,bni,bnj,bi, - xstart,xni,xnj,xi); + hypre_RedBlackLoopBegin(ni, nj, nk, redblack, + Astart, Ani, Anj, Ai, + bstart, bni, bnj, bi, + xstart, xni, xnj, xi); { xp[xi] = (bp[bi] - - App0*xp[xi + xoff0] - - App1*xp[xi + xoff1]) / Ap[Ai]; + App0 * xp[xi + xoff0] - + App1 * xp[xi + xoff1]) / Ap[Ai]; } hypre_RedBlackLoopEnd(); #undef DEVICE_VAR @@ -486,5 +490,3 @@ hypre_RedBlackConstantCoefGS( void *relax_vdata, return hypre_error_flag; } - - diff --git a/external/hypre/src/struct_ls/red_black_gs.c b/external/hypre/src/struct_ls/red_black_gs.c index 3cae7191..a2edbe35 100644 --- a/external/hypre/src/struct_ls/red_black_gs.c +++ b/external/hypre/src/struct_ls/red_black_gs.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -221,7 +221,7 @@ hypre_RedBlackGS( void *relax_vdata, { for (compute_i = 0; compute_i < 2; compute_i++) { - switch(compute_i) + switch (compute_i) { case 0: { @@ -286,10 +286,10 @@ hypre_RedBlackGS( void *relax_vdata, hypre_RedBlackLoopInit(); #define DEVICE_VAR is_device_ptr(xp,bp,Ap) - hypre_RedBlackLoopBegin(ni,nj,nk,redblack, - Astart,Ani,Anj,Ai, - bstart,bni,bnj,bi, - xstart,xni,xnj,xi); + hypre_RedBlackLoopBegin(ni, nj, nk, redblack, + Astart, Ani, Anj, Ai, + bstart, bni, bnj, bi, + xstart, xni, xnj, xi); { xp[xi] = bp[bi] / Ap[Ai]; } @@ -307,11 +307,11 @@ hypre_RedBlackGS( void *relax_vdata, * Do regular iterations *----------------------------------------------------------*/ - while (iter < 2*max_iter) + while (iter < 2 * max_iter) { for (compute_i = 0; compute_i < 2; compute_i++) { - switch(compute_i) + switch (compute_i) { case 0: { @@ -377,43 +377,39 @@ hypre_RedBlackGS( void *relax_vdata, } } - switch(stencil_size) + switch (stencil_size) { case 7: Ap5 = hypre_StructMatrixBoxData(A, i, offd[5]); Ap4 = hypre_StructMatrixBoxData(A, i, offd[4]); - xoff5 = hypre_BoxOffsetDistance( - x_dbox, stencil_shape[offd[5]]); - xoff4 = hypre_BoxOffsetDistance( - x_dbox, stencil_shape[offd[4]]); + xoff5 = hypre_BoxOffsetDistance(x_dbox, stencil_shape[offd[5]]); + xoff4 = hypre_BoxOffsetDistance(x_dbox, stencil_shape[offd[4]]); + // fall through case 5: Ap3 = hypre_StructMatrixBoxData(A, i, offd[3]); Ap2 = hypre_StructMatrixBoxData(A, i, offd[2]); - xoff3 = hypre_BoxOffsetDistance( - x_dbox, stencil_shape[offd[3]]); - xoff2 = hypre_BoxOffsetDistance( - x_dbox, stencil_shape[offd[2]]); + xoff3 = hypre_BoxOffsetDistance(x_dbox, stencil_shape[offd[3]]); + xoff2 = hypre_BoxOffsetDistance(x_dbox, stencil_shape[offd[2]]); + // fall through case 3: Ap1 = hypre_StructMatrixBoxData(A, i, offd[1]); Ap0 = hypre_StructMatrixBoxData(A, i, offd[0]); - xoff1 = hypre_BoxOffsetDistance( - x_dbox, stencil_shape[offd[1]]); - xoff0 = hypre_BoxOffsetDistance( - x_dbox, stencil_shape[offd[0]]); + xoff1 = hypre_BoxOffsetDistance(x_dbox, stencil_shape[offd[1]]); + xoff0 = hypre_BoxOffsetDistance(x_dbox, stencil_shape[offd[0]]); break; } - switch(stencil_size) + switch (stencil_size) { case 7: hypre_RedBlackLoopInit(); #define DEVICE_VAR is_device_ptr(xp,bp,Ap0,Ap1,Ap2,Ap3,Ap4,Ap5,Ap) - hypre_RedBlackLoopBegin(ni,nj,nk,redblack, - Astart,Ani,Anj,Ai, - bstart,bni,bnj,bi, - xstart,xni,xnj,xi); + hypre_RedBlackLoopBegin(ni, nj, nk, redblack, + Astart, Ani, Anj, Ai, + bstart, bni, bnj, bi, + xstart, xni, xnj, xi); { xp[xi] = (bp[bi] - @@ -431,10 +427,10 @@ hypre_RedBlackGS( void *relax_vdata, case 5: hypre_RedBlackLoopInit(); #define DEVICE_VAR is_device_ptr(xp,bp,Ap0,Ap1,Ap2,Ap3,Ap) - hypre_RedBlackLoopBegin(ni,nj,nk,redblack, - Astart,Ani,Anj,Ai, - bstart,bni,bnj,bi, - xstart,xni,xnj,xi); + hypre_RedBlackLoopBegin(ni, nj, nk, redblack, + Astart, Ani, Anj, Ai, + bstart, bni, bnj, bi, + xstart, xni, xnj, xi); { xp[xi] = (bp[bi] - @@ -450,10 +446,10 @@ hypre_RedBlackGS( void *relax_vdata, case 3: hypre_RedBlackLoopInit(); #define DEVICE_VAR is_device_ptr(xp,bp,Ap0,Ap1,Ap) - hypre_RedBlackLoopBegin(ni,nj,nk,redblack, - Astart,Ani,Anj,Ai, - bstart,bni,bnj,bi, - xstart,xni,xnj,xi); + hypre_RedBlackLoopBegin(ni, nj, nk, redblack, + Astart, Ani, Anj, Ai, + bstart, bni, bnj, bi, + xstart, xni, xnj, xi); { xp[xi] = (bp[bi] - @@ -552,4 +548,3 @@ hypre_RedBlackGSSetStartBlack( void *relax_vdata ) return hypre_error_flag; } - diff --git a/external/hypre/src/struct_ls/red_black_gs.h b/external/hypre/src/struct_ls/red_black_gs.h index afd8eabf..41c4008f 100644 --- a/external/hypre/src/struct_ls/red_black_gs.h +++ b/external/hypre/src/struct_ls/red_black_gs.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -209,6 +209,65 @@ typedef struct }); \ } +#elif defined(HYPRE_USING_SYCL) + +#define hypre_RedBlackLoopInit() +#define hypre_RedBlackLoopBegin(ni,nj,nk,redblack, \ + Astart,Ani,Anj,Ai, \ + bstart,bni,bnj,bi, \ + xstart,xni,xnj,xi) \ +{ \ + HYPRE_Int hypre__tot = nk*nj*((ni+1)/2); \ + BoxLoopforall(hypre__tot, [=] (sycl::nd_item<3> item) \ + { \ + HYPRE_Int idx = (HYPRE_Int) item.get_global_linear_id(); \ + HYPRE_Int idx_local = idx; \ + HYPRE_Int ii,jj,kk,Ai,bi,xi; \ + HYPRE_Int local_ii; \ + kk = idx_local % nk; \ + idx_local = idx_local / nk; \ + jj = idx_local % nj; \ + idx_local = idx_local / nj; \ + local_ii = (kk + jj + redblack) % 2; \ + ii = 2*idx_local + local_ii; \ + if (ii < ni) \ + { \ + Ai = Astart + kk*Anj*Ani + jj*Ani + ii; \ + bi = bstart + kk*bnj*bni + jj*bni + ii; \ + xi = xstart + kk*xnj*xni + jj*xni + ii; \ + +#define hypre_RedBlackLoopEnd() \ + } \ + }); \ +} + +#define hypre_RedBlackConstantcoefLoopBegin(ni,nj,nk,redblack, \ + bstart,bni,bnj,bi, \ + xstart,xni,xnj,xi) \ +{ \ + HYPRE_Int hypre__tot = nk*nj*((ni+1)/2); \ + BoxLoopforall(hypre__tot, [=] (sycl::nd_item<3> item) \ + { \ + HYPRE_Int idx = (HYPRE_Int) item.get_global_linear_id(); \ + HYPRE_Int idx_local = idx; \ + HYPRE_Int ii,jj,kk,bi,xi; \ + HYPRE_Int local_ii; \ + kk = idx_local % nk; \ + idx_local = idx_local / nk; \ + jj = idx_local % nj; \ + idx_local = idx_local / nj; \ + local_ii = (kk + jj + redblack) % 2; \ + ii = 2*idx_local + local_ii; \ + if (ii < ni) \ + { \ + bi = bstart + kk*bnj*bni + jj*bni + ii; \ + xi = xstart + kk*xnj*xni + jj*xni + ii; \ + +#define hypre_RedBlackConstantcoefLoopEnd() \ + } \ + }); \ +} + #elif defined(HYPRE_USING_DEVICE_OPENMP) /* BEGIN OF OMP 4.5 */ @@ -298,11 +357,13 @@ typedef struct #ifdef HYPRE_USING_OPENMP #define HYPRE_BOX_REDUCTION +#ifndef Pragma #if defined(WIN32) && defined(_MSC_VER) -#define Pragma(x) __pragma(HYPRE_XSTR(x)) +#define Pragma(x) __pragma(x) #else #define Pragma(x) _Pragma(HYPRE_XSTR(x)) #endif +#endif #define OMPRB1 Pragma(omp parallel for private(HYPRE_REDBLACK_PRIVATE) HYPRE_BOX_REDUCTION HYPRE_SMP_SCHEDULE) #else #define OMPRB1 diff --git a/external/hypre/src/struct_ls/semi.c b/external/hypre/src/struct_ls/semi.c index d319572d..a891eeb3 100644 --- a/external/hypre/src/struct_ls/semi.c +++ b/external/hypre/src/struct_ls/semi.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -63,13 +63,13 @@ hypre_StructInterpAssemble( hypre_StructMatrix *A, dim = hypre_StructGridNDim(grid); for (j = 0; j < dim; j++) { - num_ghost[2*j] = 1; - num_ghost[2*j+1] = 1; + num_ghost[2 * j] = 1; + num_ghost[2 * j + 1] = 1; } if (P_stored_as_transpose) { - num_ghost[2*cdir] = 2; - num_ghost[2*cdir+1] = 2; + num_ghost[2 * cdir] = 2; + num_ghost[2 * cdir + 1] = 2; } /* comm_info <-- From fine grid grown by num_ghost */ @@ -83,7 +83,7 @@ hypre_StructInterpAssemble( hypre_StructMatrix *A, for (s = 0; s < 4; s++) { - switch(s) + switch (s) { case 0: box_aa = hypre_CommInfoSendBoxes(comm_info); @@ -105,17 +105,17 @@ hypre_StructInterpAssemble( hypre_StructMatrix *A, } hypre_ForBoxArrayI(j, box_aa) + { + box_a = hypre_BoxArrayArrayBoxArray(box_aa, j); + hypre_ForBoxI(i, box_a) { - box_a = hypre_BoxArrayArrayBoxArray(box_aa, j); - hypre_ForBoxI(i, box_a) - { - box = hypre_BoxArrayBox(box_a, i); - hypre_StructMapFineToCoarse(hypre_BoxIMin(box), index, stride, - hypre_BoxIMin(box)); - hypre_StructMapFineToCoarse(hypre_BoxIMax(box), index, stride, - hypre_BoxIMax(box)); - } + box = hypre_BoxArrayBox(box_a, i); + hypre_StructMapFineToCoarse(hypre_BoxIMin(box), index, stride, + hypre_BoxIMin(box)); + hypre_StructMapFineToCoarse(hypre_BoxIMax(box), index, stride, + hypre_BoxIMax(box)); } + } } comm_pkg = hypre_StructMatrixCommPkg(P); @@ -123,7 +123,7 @@ hypre_StructInterpAssemble( hypre_StructMatrix *A, { hypre_CommPkgDestroy(comm_pkg); } - + hypre_CommPkgCreate(comm_info, hypre_StructMatrixDataSpace(P), hypre_StructMatrixDataSpace(P), @@ -136,7 +136,7 @@ hypre_StructInterpAssemble( hypre_StructMatrix *A, hypre_InitializeCommunication(comm_pkg, hypre_StructMatrixStencilData(P)[0],//hypre_StructMatrixData(P), hypre_StructMatrixStencilData(P)[0],//hypre_StructMatrixData(P), - 0, 0, + 0, 0, &comm_handle); hypre_FinalizeCommunication(comm_handle); diff --git a/external/hypre/src/struct_ls/semi_interp.c b/external/hypre/src/struct_ls/semi_interp.c index 7b4e2aa8..114a51f0 100644 --- a/external/hypre/src/struct_ls/semi_interp.c +++ b/external/hypre/src/struct_ls/semi_interp.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -28,7 +28,7 @@ typedef struct *--------------------------------------------------------------------------*/ void * -hypre_SemiInterpCreate( ) +hypre_SemiInterpCreate( void ) { hypre_SemiInterpData *interp_data; @@ -51,6 +51,8 @@ hypre_SemiInterpSetup( void *interp_vdata, hypre_Index findex, hypre_Index stride ) { + HYPRE_UNUSED_VAR(xc); + hypre_SemiInterpData *interp_data = (hypre_SemiInterpData *)interp_vdata; hypre_StructGrid *grid; @@ -63,6 +65,8 @@ hypre_SemiInterpSetup( void *interp_vdata, * Set up the compute package *----------------------------------------------------------*/ + HYPRE_ANNOTATE_FUNC_BEGIN; + grid = hypre_StructVectorGrid(e); stencil = hypre_StructMatrixStencil(P); @@ -84,6 +88,8 @@ hypre_SemiInterpSetup( void *interp_vdata, hypre_CopyIndex(findex, (interp_data -> findex)); hypre_CopyIndex(stride, (interp_data -> stride)); + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; } @@ -142,6 +148,8 @@ hypre_SemiInterp( void *interp_vdata, * Initialize some things *-----------------------------------------------------------------------*/ + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_BeginTiming(interp_data -> time_index); P_stored_as_transpose = (interp_data -> P_stored_as_transpose); @@ -153,11 +161,11 @@ hypre_SemiInterp( void *interp_vdata, stencil = hypre_StructMatrixStencil(P); stencil_shape = hypre_StructStencilShape(stencil); constant_coefficient = hypre_StructMatrixConstantCoefficient(P); - hypre_assert( constant_coefficient==0 || constant_coefficient==1 ); + hypre_assert( constant_coefficient == 0 || constant_coefficient == 1 ); /* ... constant_coefficient==2 for P shouldn't happen, see hypre_PFMGCreateInterpOp in pfmg_setup_interp.c */ - if (constant_coefficient) hypre_StructVectorClearBoundGhostValues(e, 0); + if (constant_coefficient) { hypre_StructVectorClearBoundGhostValues(e, 0); } hypre_SetIndex3(stridec, 1, 1, 1); @@ -182,7 +190,8 @@ hypre_SemiInterp( void *interp_vdata, hypre_StructGridDataLocation(cgrid) = data_location_f; hypre_StructVectorInitialize(xc_tmp); hypre_StructVectorAssemble(xc_tmp); - hypre_TMemcpy(hypre_StructVectorData(xc_tmp), hypre_StructVectorData(xc), HYPRE_Complex,hypre_StructVectorDataSize(xc),HYPRE_MEMORY_DEVICE,HYPRE_MEMORY_HOST); + hypre_TMemcpy(hypre_StructVectorData(xc_tmp), hypre_StructVectorData(xc), HYPRE_Complex, + hypre_StructVectorDataSize(xc), HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); } else { @@ -229,7 +238,7 @@ hypre_SemiInterp( void *interp_vdata, for (compute_i = 0; compute_i < 2; compute_i++) { - switch(compute_i) + switch (compute_i) { case 0: { @@ -291,17 +300,17 @@ hypre_SemiInterp( void *interp_vdata, if ( constant_coefficient ) { - HYPRE_Complex Pp0val,Pp1val; + HYPRE_Complex Pp0val, Pp1val; Pi = hypre_CCBoxIndexRank( P_dbox, startc ); Pp0val = Pp0[Pi]; - Pp1val = Pp1[Pi+Pp1_offset]; + Pp1val = Pp1[Pi + Pp1_offset]; #define DEVICE_VAR is_device_ptr(ep) hypre_BoxLoop1Begin(hypre_StructMatrixNDim(P), loop_size, e_dbox, start, stride, ei); { - ep[ei] = (Pp0val * ep[ei+ep0_offset] + - Pp1val * ep[ei+ep1_offset]); + ep[ei] = (Pp0val * ep[ei + ep0_offset] + + Pp1val * ep[ei + ep1_offset]); } hypre_BoxLoop1End(ei); #undef DEVICE_VAR @@ -313,8 +322,8 @@ hypre_SemiInterp( void *interp_vdata, P_dbox, startc, stridec, Pi, e_dbox, start, stride, ei); { - ep[ei] = (Pp0[Pi] * ep[ei+ep0_offset] + - Pp1[Pi+Pp1_offset] * ep[ei+ep1_offset]); + ep[ei] = (Pp0[Pi] * ep[ei + ep0_offset] + + Pp1[Pi + Pp1_offset] * ep[ei + ep1_offset]); } hypre_BoxLoop2End(Pi, ei); #undef DEVICE_VAR @@ -333,9 +342,11 @@ hypre_SemiInterp( void *interp_vdata, * Return *-----------------------------------------------------------------------*/ - hypre_IncFLOPCount(3*hypre_StructVectorGlobalSize(xc)); + hypre_IncFLOPCount(3 * hypre_StructVectorGlobalSize(xc)); hypre_EndTiming(interp_data -> time_index); + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; } @@ -357,4 +368,3 @@ hypre_SemiInterpDestroy( void *interp_vdata ) return hypre_error_flag; } - diff --git a/external/hypre/src/struct_ls/semi_restrict.c b/external/hypre/src/struct_ls/semi_restrict.c index 7105eabe..5bda1702 100644 --- a/external/hypre/src/struct_ls/semi_restrict.c +++ b/external/hypre/src/struct_ls/semi_restrict.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -27,7 +27,7 @@ typedef struct *--------------------------------------------------------------------------*/ void * -hypre_SemiRestrictCreate( ) +hypre_SemiRestrictCreate( void ) { hypre_SemiRestrictData *restrict_data; @@ -51,6 +51,8 @@ hypre_SemiRestrictSetup( void *restrict_vdata, hypre_Index findex, hypre_Index stride ) { + HYPRE_UNUSED_VAR(rc); + hypre_SemiRestrictData *restrict_data = (hypre_SemiRestrictData *)restrict_vdata; hypre_StructGrid *grid; @@ -63,6 +65,8 @@ hypre_SemiRestrictSetup( void *restrict_vdata, * Set up the compute package *----------------------------------------------------------*/ + HYPRE_ANNOTATE_FUNC_BEGIN; + grid = hypre_StructVectorGrid(r); stencil = hypre_StructMatrixStencil(R); @@ -80,8 +84,10 @@ hypre_SemiRestrictSetup( void *restrict_vdata, (restrict_data -> R) = hypre_StructMatrixRef(R); (restrict_data -> R_stored_as_transpose) = R_stored_as_transpose; (restrict_data -> compute_pkg) = compute_pkg; - hypre_CopyIndex(cindex ,(restrict_data -> cindex)); - hypre_CopyIndex(stride ,(restrict_data -> stride)); + hypre_CopyIndex(cindex, (restrict_data -> cindex)); + hypre_CopyIndex(stride, (restrict_data -> stride)); + + HYPRE_ANNOTATE_FUNC_END; return hypre_error_flag; } @@ -139,6 +145,8 @@ hypre_SemiRestrict( void *restrict_vdata, * Initialize some things. *-----------------------------------------------------------------------*/ + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_BeginTiming(restrict_data -> time_index); R_stored_as_transpose = (restrict_data -> R_stored_as_transpose); @@ -149,10 +157,10 @@ hypre_SemiRestrict( void *restrict_vdata, stencil = hypre_StructMatrixStencil(R); stencil_shape = hypre_StructStencilShape(stencil); constant_coefficient = hypre_StructMatrixConstantCoefficient(R); - hypre_assert( constant_coefficient==0 || constant_coefficient==1 ); + hypre_assert( constant_coefficient == 0 || constant_coefficient == 1 ); /* ... if A has constant_coefficient==2, R has constant_coefficient==0 */ - if (constant_coefficient) hypre_StructVectorClearBoundGhostValues(r, 0); + if (constant_coefficient) { hypre_StructVectorClearBoundGhostValues(r, 0); } hypre_SetIndex3(stridec, 1, 1, 1); @@ -188,7 +196,7 @@ hypre_SemiRestrict( void *restrict_vdata, for (compute_i = 0; compute_i < 2; compute_i++) { - switch(compute_i) + switch (compute_i) { case 0: { @@ -259,18 +267,18 @@ hypre_SemiRestrict( void *restrict_vdata, if ( constant_coefficient ) { - HYPRE_Complex Rp0val,Rp1val; + HYPRE_Complex Rp0val, Rp1val; Ri = hypre_CCBoxIndexRank( R_dbox, startc ); - Rp0val = Rp0[Ri+Rp0_offset]; + Rp0val = Rp0[Ri + Rp0_offset]; Rp1val = Rp1[Ri]; #define DEVICE_VAR is_device_ptr(rcp,rp) hypre_BoxLoop2Begin(hypre_StructMatrixNDim(R), loop_size, r_dbox, start, stride, ri, rc_dbox, startc, stridec, rci); { - rcp[rci] = rp[ri] + (Rp0val * rp[ri+rp0_offset] + - Rp1val * rp[ri+rp1_offset]); + rcp[rci] = rp[ri] + (Rp0val * rp[ri + rp0_offset] + + Rp1val * rp[ri + rp1_offset]); } hypre_BoxLoop2End(ri, rci); #undef DEVICE_VAR @@ -283,8 +291,8 @@ hypre_SemiRestrict( void *restrict_vdata, r_dbox, start, stride, ri, rc_dbox, startc, stridec, rci); { - rcp[rci] = rp[ri] + (Rp0[Ri+Rp0_offset] * rp[ri+rp0_offset] + - Rp1[Ri] * rp[ri+rp1_offset]); + rcp[rci] = rp[ri] + (Rp0[Ri + Rp0_offset] * rp[ri + rp0_offset] + + Rp1[Ri] * rp[ri + rp1_offset]); } hypre_BoxLoop3End(Ri, ri, rci); #undef DEVICE_VAR @@ -295,7 +303,8 @@ hypre_SemiRestrict( void *restrict_vdata, #if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) if (data_location_f != data_location_c) { - hypre_TMemcpy(hypre_StructVectorData(rc),hypre_StructVectorData(rc_tmp),HYPRE_Complex,hypre_StructVectorDataSize(rc_tmp),HYPRE_MEMORY_HOST,HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(hypre_StructVectorData(rc), hypre_StructVectorData(rc_tmp), HYPRE_Complex, + hypre_StructVectorDataSize(rc_tmp), HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); hypre_StructVectorDestroy(rc_tmp); hypre_StructGridDataLocation(cgrid) = data_location_c; } @@ -304,9 +313,11 @@ hypre_SemiRestrict( void *restrict_vdata, * Return *-----------------------------------------------------------------------*/ - hypre_IncFLOPCount(4*hypre_StructVectorGlobalSize(rc)); + hypre_IncFLOPCount(4 * hypre_StructVectorGlobalSize(rc)); hypre_EndTiming(restrict_data -> time_index); + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; } @@ -328,4 +339,3 @@ hypre_SemiRestrictDestroy( void *restrict_vdata ) return hypre_error_flag; } - diff --git a/external/hypre/src/struct_ls/semi_setup_rap.c b/external/hypre/src/struct_ls/semi_setup_rap.c index 325acb4e..3cc57c42 100644 --- a/external/hypre/src/struct_ls/semi_setup_rap.c +++ b/external/hypre/src/struct_ls/semi_setup_rap.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -46,6 +46,10 @@ hypre_SemiCreateRAPOp( hypre_StructMatrix *R, HYPRE_Int cdir, HYPRE_Int P_stored_as_transpose ) { + HYPRE_UNUSED_VAR(R); + HYPRE_UNUSED_VAR(P); + HYPRE_UNUSED_VAR(P_stored_as_transpose); + hypre_StructMatrix *RAP; hypre_Index *RAP_stencil_shape; @@ -54,7 +58,7 @@ hypre_SemiCreateRAPOp( hypre_StructMatrix *R, HYPRE_Int dim; HYPRE_Int RAP_num_ghost[] = {1, 1, 1, 1, 1, 1}; - HYPRE_Int *not_cdirs; + HYPRE_Int *not_cdirs = NULL; hypre_StructStencil *A_stencil; HYPRE_Int A_stencil_size; hypre_Index *A_stencil_shape; @@ -105,13 +109,13 @@ hypre_SemiCreateRAPOp( hypre_StructMatrix *R, *-----------------------------------------------------------------------*/ for (Rloop = -1; Rloop < 2; Rloop++) { - hypre_IndexD(indexR,cdir) = Rloop; + hypre_IndexD(indexR, cdir) = Rloop; for (Aloop = 0; Aloop < A_stencil_size; Aloop++) { for (d = 0; d < dim; d++) { hypre_IndexD(indexRA, d) = hypre_IndexD(indexR, d) + - hypre_IndexD(A_stencil_shape[Aloop], d); + hypre_IndexD(A_stencil_shape[Aloop], d); } /*----------------------------------------------------------------- @@ -121,8 +125,8 @@ hypre_SemiCreateRAPOp( hypre_StructMatrix *R, if ((hypre_IndexD(indexRA, cdir) % 2) == 0) { hypre_CopyIndex(indexRA, indexRAP); - hypre_IndexD(indexRAP,cdir) /= 2; - hypre_MapRAPMarker(indexRAP,RAP_marker_rank); + hypre_IndexD(indexRAP, cdir) /= 2; + hypre_MapRAPMarker(indexRAP, RAP_marker_rank); RAP_marker[RAP_marker_rank]++; } /*----------------------------------------------------------------- @@ -132,15 +136,15 @@ hypre_SemiCreateRAPOp( hypre_StructMatrix *R, else { hypre_CopyIndex(indexRA, indexRAP); - hypre_IndexD(indexRAP,cdir) += 1; - hypre_IndexD(indexRAP,cdir) /= 2; - hypre_MapRAPMarker(indexRAP,RAP_marker_rank); + hypre_IndexD(indexRAP, cdir) += 1; + hypre_IndexD(indexRAP, cdir) /= 2; + hypre_MapRAPMarker(indexRAP, RAP_marker_rank); RAP_marker[RAP_marker_rank]++; hypre_CopyIndex(indexRA, indexRAP); - hypre_IndexD(indexRAP,cdir) -= 1; - hypre_IndexD(indexRAP,cdir) /= 2; - hypre_MapRAPMarker(indexRAP,RAP_marker_rank); + hypre_IndexD(indexRAP, cdir) -= 1; + hypre_IndexD(indexRAP, cdir) /= 2; + hypre_MapRAPMarker(indexRAP, RAP_marker_rank); RAP_marker[RAP_marker_rank]++; } } @@ -178,27 +182,27 @@ hypre_SemiCreateRAPOp( hypre_StructMatrix *R, { if (dim > 1) { - not_cdirs = hypre_CTAlloc(HYPRE_Int, dim-1, HYPRE_MEMORY_HOST); + not_cdirs = hypre_CTAlloc(HYPRE_Int, dim - 1, HYPRE_MEMORY_HOST); } for (d = 1; d < dim; d++) { - not_cdirs[d-1] = (dim+cdir-d) % dim; + not_cdirs[d - 1] = (dim + cdir - d) % dim; } hypre_SetIndex(indexRAP, 0); hypre_IndexD(indexRAP, cdir) = 1; - hypre_MapRAPMarker(indexRAP,RAP_marker_rank); + hypre_MapRAPMarker(indexRAP, RAP_marker_rank); RAP_marker[RAP_marker_rank] = 0; if (dim > 1) { hypre_SetIndex(indexRAP, 0); - hypre_IndexD(indexRAP,not_cdirs[0]) = 1; + hypre_IndexD(indexRAP, not_cdirs[0]) = 1; for (i = -1; i < 2; i++) { - hypre_IndexD(indexRAP,cdir) = i; - hypre_MapRAPMarker(indexRAP,RAP_marker_rank); + hypre_IndexD(indexRAP, cdir) = i; + hypre_MapRAPMarker(indexRAP, RAP_marker_rank); RAP_marker[RAP_marker_rank] = 0; } } @@ -206,14 +210,14 @@ hypre_SemiCreateRAPOp( hypre_StructMatrix *R, if (dim > 2) { hypre_SetIndex(indexRAP, 0); - hypre_IndexD(indexRAP,not_cdirs[1]) = 1; + hypre_IndexD(indexRAP, not_cdirs[1]) = 1; for (i = -1; i < 2; i++) { - hypre_IndexD(indexRAP,not_cdirs[0]) = i; + hypre_IndexD(indexRAP, not_cdirs[0]) = i; for (j = -1; j < 2; j++) { - hypre_IndexD(indexRAP,cdir) = j; - hypre_MapRAPMarker(indexRAP,RAP_marker_rank); + hypre_IndexD(indexRAP, cdir) = j; + hypre_MapRAPMarker(indexRAP, RAP_marker_rank); RAP_marker[RAP_marker_rank] = 0; } @@ -226,7 +230,7 @@ hypre_SemiCreateRAPOp( hypre_StructMatrix *R, } } - RAP_stencil_size= 0; + RAP_stencil_size = 0; for (i = 0; i < RAP_marker_size; i++) { @@ -238,12 +242,12 @@ hypre_SemiCreateRAPOp( hypre_StructMatrix *R, RAP_stencil_shape = hypre_CTAlloc(hypre_Index, RAP_stencil_size, HYPRE_MEMORY_HOST); - stencil_rank= 0; + stencil_rank = 0; for (i = 0; i < RAP_marker_size; i++) { if ( RAP_marker[i] != 0 ) { - hypre_InverseMapRAPMarker(i,RAP_stencil_shape[stencil_rank]); + hypre_InverseMapRAPMarker(i, RAP_stencil_shape[stencil_rank]); stencil_rank++; } } @@ -463,8 +467,8 @@ hypre_SemiBuildRAP( hypre_StructMatrix *A, hypre_SetIndex(index, 0); hypre_IndexD(index, cdir) = 1; - COffsetA = hypre_BoxOffsetDistance(A_dbox,index); - COffsetP = hypre_BoxOffsetDistance(P_dbox,index); + COffsetA = hypre_BoxOffsetDistance(A_dbox, index); + COffsetP = hypre_BoxOffsetDistance(P_dbox, index); /*----------------------------------------------------------------- * Entries in RAP are calculated by accumulation, must first @@ -521,20 +525,20 @@ hypre_SemiBuildRAP( hypre_StructMatrix *A, case 0: - hypre_IndexD(index,cdir) = 1; + hypre_IndexD(index, cdir) = 1; rap_ptrU = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_IndexD(index,cdir) = -1; + hypre_IndexD(index, cdir) = -1; rap_ptrD = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_IndexD(index,cdir) = 0; + hypre_IndexD(index, cdir) = 0; AOffsetP = hypre_BoxOffsetDistance(P_dbox, index); rap_ptrS = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); diag = 0; for (d = 0; d < dim; d++) { - diag += hypre_IndexD(index,d) * hypre_IndexD(index,d); + diag += hypre_IndexD(index, d) * hypre_IndexD(index, d); } if (diag == 0 && hypre_StructMatrixSymmetric(RAP)) @@ -554,7 +558,7 @@ hypre_SemiBuildRAP( hypre_StructMatrix *A, A_dbox, fstart, stridef, iA, RAP_dbox, cstart, stridec, iAc); { - HYPRE_Int iAp,iPp; + HYPRE_Int iAp, iPp; /* path 1 : (stay,stay) */ rap_ptrS[iAc] += a_ptr[iA] ; @@ -567,11 +571,11 @@ hypre_SemiBuildRAP( hypre_StructMatrix *A, /* path 4 : (down,up) */ iAp = iA - COffsetA; - rap_ptrS[iAc] += rb[iR+rb_offset] * a_ptr[iAp] * pb[iPp+pb_offset]; + rap_ptrS[iAc] += rb[iR + rb_offset] * a_ptr[iAp] * pb[iPp + pb_offset]; /* path 5 : (down,down) */ iPp = iP - COffsetP + AOffsetP; - rap_ptrD[iAc] += rb[iR+rb_offset] * a_ptr[iAp] * pa[iPp]; + rap_ptrD[iAc] += rb[iR + rb_offset] * a_ptr[iAp] * pa[iPp]; } hypre_BoxLoop4End(iP, iR, iA, iAc); #undef DEVICE_VAR @@ -589,14 +593,14 @@ hypre_SemiBuildRAP( hypre_StructMatrix *A, A_dbox, fstart, stridef, iA, RAP_dbox, cstart, stridec, iAc); { - HYPRE_Int iAp,iPp; + HYPRE_Int iAp, iPp; /* path 1 : (stay,stay) */ rap_ptrS[iAc] += a_ptr[iA] ; /* path 2 : (up,up) */ iAp = iA + COffsetA; iPp = iP + COffsetP + AOffsetP; - rap_ptrU[iAc] += ra[iR] * a_ptr[iAp] * pb[iPp+pb_offset]; + rap_ptrU[iAc] += ra[iR] * a_ptr[iAp] * pb[iPp + pb_offset]; /* path 3 : (up,down) */ iPp = iP + AOffsetP; @@ -604,11 +608,11 @@ hypre_SemiBuildRAP( hypre_StructMatrix *A, /* path 4 : (down,up) */ iAp = iA - COffsetA; - rap_ptrS[iAc] += rb[iR+rb_offset] * a_ptr[iAp] * pb[iPp+pb_offset]; + rap_ptrS[iAc] += rb[iR + rb_offset] * a_ptr[iAp] * pb[iPp + pb_offset]; /* path 5 : (down,down) */ iPp = iP - COffsetP + AOffsetP; - rap_ptrD[iAc] += rb[iR+rb_offset] * a_ptr[iAp] * pa[iPp]; + rap_ptrD[iAc] += rb[iR + rb_offset] * a_ptr[iAp] * pa[iPp]; } hypre_BoxLoop4End(iP, iR, iA, iAc); #undef DEVICE_VAR @@ -616,20 +620,20 @@ hypre_SemiBuildRAP( hypre_StructMatrix *A, break; - /*----------------------------------------------------- - * If A stencil index is -1 in coarsened direction, need - * to calculate (r,p) pairs (stay,up) (stay,down) (up,stay) - * and (down,stay). Paths 2 & 4 {(s,d),(d,s)} contribute - * to RAP with same stencil index as A. Paths 1 & 3 - * {(s,u),(u,s)} contribute to RAP with index 0 in - * coarsened direction. - *-----------------------------------------------------*/ + /*----------------------------------------------------- + * If A stencil index is -1 in coarsened direction, need + * to calculate (r,p) pairs (stay,up) (stay,down) (up,stay) + * and (down,stay). Paths 2 & 4 {(s,d),(d,s)} contribute + * to RAP with same stencil index as A. Paths 1 & 3 + * {(s,u),(u,s)} contribute to RAP with index 0 in + * coarsened direction. + *-----------------------------------------------------*/ case -1: rap_ptrD = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_IndexD(index,cdir) = 0; + hypre_IndexD(index, cdir) = 0; AOffsetP = hypre_BoxOffsetDistance(P_dbox, index); rap_ptrS = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); @@ -647,7 +651,7 @@ hypre_SemiBuildRAP( hypre_StructMatrix *A, diag = 0; for (d = 0; d < dim; d++) { - diag += hypre_IndexD(index,d) * hypre_IndexD(index,d); + diag += hypre_IndexD(index, d) * hypre_IndexD(index, d); } if (diag == 0 && hypre_StructMatrixSymmetric(RAP)) { @@ -661,11 +665,11 @@ hypre_SemiBuildRAP( hypre_StructMatrix *A, A_dbox, fstart, stridef, iA, RAP_dbox, cstart, stridec, iAc); { - HYPRE_Int iAp,iPp; + HYPRE_Int iAp, iPp; /* Path 1 : (stay,up) & symmetric path */ iPp = iP + AOffsetP; rap_ptrS[iAc] += symm_path_multiplier * - (a_ptr[iA] * pb[iPp+pb_offset]); + (a_ptr[iA] * pb[iPp + pb_offset]); /* Path 2 : (stay,down) */ iPp = iP - COffsetP + AOffsetP; @@ -674,31 +678,31 @@ hypre_SemiBuildRAP( hypre_StructMatrix *A, /* Path 3 : (up,stay) */ iAp = iA + COffsetA; rap_ptrS[iAc] += symm_path_multiplier * - (ra[iR] * a_ptr[iAp] ); + (ra[iR] * a_ptr[iAp] ); /* Path 4 : (down,stay) */ iAp = iA - COffsetA; - rap_ptrD[iAc] += rb[iR+rb_offset] * a_ptr[iAp] ; + rap_ptrD[iAc] += rb[iR + rb_offset] * a_ptr[iAp] ; } hypre_BoxLoop4End(iP, iR, iA, iAc); #undef DEVICE_VAR break; - /*----------------------------------------------------- - * If A stencil index is +1 in coarsened direction, need - * to calculate (r,p) pairs (stay,up) (stay,down) (up,stay) - * and (down,stay). Paths 1 & 3 {(s,u),(u,s)} contribute - * to RAP with same stencil index as A. Paths 2 & 4 - * {(s,d),(d,s)} contribute to RAP with index 0 in - * coarsened direction. - *-----------------------------------------------------*/ + /*----------------------------------------------------- + * If A stencil index is +1 in coarsened direction, need + * to calculate (r,p) pairs (stay,up) (stay,down) (up,stay) + * and (down,stay). Paths 1 & 3 {(s,u),(u,s)} contribute + * to RAP with same stencil index as A. Paths 2 & 4 + * {(s,d),(d,s)} contribute to RAP with index 0 in + * coarsened direction. + *-----------------------------------------------------*/ case 1: rap_ptrU = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_IndexD(index,cdir) = 0; + hypre_IndexD(index, cdir) = 0; AOffsetP = hypre_BoxOffsetDistance(P_dbox, index); rap_ptrS = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); @@ -715,7 +719,7 @@ hypre_SemiBuildRAP( hypre_StructMatrix *A, diag = 0; for (d = 0; d < dim; d++) { - diag += hypre_IndexD(index,d) * hypre_IndexD(index,d); + diag += hypre_IndexD(index, d) * hypre_IndexD(index, d); } if (diag == 0 && hypre_StructMatrixSymmetric(RAP)) { @@ -729,15 +733,15 @@ hypre_SemiBuildRAP( hypre_StructMatrix *A, A_dbox, fstart, stridef, iA, RAP_dbox, cstart, stridec, iAc); { - HYPRE_Int iAp,iPp; + HYPRE_Int iAp, iPp; /* Path 1 : (stay,up) */ iPp = iP + COffsetP + AOffsetP; - rap_ptrU[iAc] += a_ptr[iA] * pb[iPp+pb_offset]; + rap_ptrU[iAc] += a_ptr[iA] * pb[iPp + pb_offset]; /* Path 2 : (stay,down) */ iPp = iP + AOffsetP; rap_ptrS[iAc] += symm_path_multiplier * - (a_ptr[iA] * pa[iPp]); + (a_ptr[iA] * pa[iPp]); /* Path 3 : (up,stay) */ iAp = iA + COffsetA; @@ -746,7 +750,7 @@ hypre_SemiBuildRAP( hypre_StructMatrix *A, /* Path 4 : (down,stay) */ iAp = iA - COffsetA; rap_ptrS[iAc] += symm_path_multiplier * - (rb[iR+rb_offset] * a_ptr[iAp] ); + (rb[iR + rb_offset] * a_ptr[iAp] ); } hypre_BoxLoop4End(iP, iR, iA, iAc); #undef DEVICE_VAR @@ -767,7 +771,7 @@ hypre_SemiBuildRAP( hypre_StructMatrix *A, * the coarsened direction. *-----------------------------------------------------------------*/ - if (hypre_IndexD(hypre_StructGridPeriodic(cgrid),cdir) == 1) + if (hypre_IndexD(hypre_StructGridPeriodic(cgrid), cdir) == 1) { hypre_ForBoxI(ci, cgrid_boxes) { @@ -797,11 +801,11 @@ hypre_SemiBuildRAP( hypre_StructMatrix *A, break; - /*----------------------------------------------------- - * If RAP stencil index is +/-1 in coarsened direction, - * to add entry to cooresponding entry with 0 in the - * coarsened direction. Also zero out current index. - *-----------------------------------------------------*/ + /*----------------------------------------------------- + * If RAP stencil index is +/-1 in coarsened direction, + * to add entry to cooresponding entry with 0 in the + * coarsened direction. Also zero out current index. + *-----------------------------------------------------*/ default: @@ -812,7 +816,7 @@ hypre_SemiBuildRAP( hypre_StructMatrix *A, *---------------------------------------------------------*/ rap_ptrD = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_IndexD(index,cdir) = 0; + hypre_IndexD(index, cdir) = 0; rap_ptrS = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); @@ -825,7 +829,7 @@ hypre_SemiBuildRAP( hypre_StructMatrix *A, diag = 0; for (d = 0; d < dim; d++) { - diag += hypre_IndexD(index,d) * hypre_IndexD(index,d); + diag += hypre_IndexD(index, d) * hypre_IndexD(index, d); } if (diag == 0 && hypre_StructMatrixSymmetric(RAP)) { @@ -836,7 +840,7 @@ hypre_SemiBuildRAP( hypre_StructMatrix *A, RAP_dbox, cstart, stridec, iAc); { rap_ptrS[iAc] += symm_path_multiplier * - (rap_ptrD[iAc]); + (rap_ptrD[iAc]); rap_ptrD[iAc] = zero; } diff --git a/external/hypre/src/struct_ls/smg.c b/external/hypre/src/struct_ls/smg.c index d790df0c..6f3be07d 100644 --- a/external/hypre/src/struct_ls/smg.c +++ b/external/hypre/src/struct_ls/smg.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,7 +17,7 @@ hypre_SMGCreate( MPI_Comm comm ) { hypre_SMGData *smg_data; - smg_data = hypre_CTAlloc(hypre_SMGData, 1, HYPRE_MEMORY_HOST); + smg_data = hypre_CTAlloc(hypre_SMGData, 1, HYPRE_MEMORY_HOST); (smg_data -> comm) = comm; (smg_data -> time_index) = hypre_InitializeTiming("SMG"); @@ -37,11 +37,11 @@ hypre_SMGCreate( MPI_Comm comm ) (smg_data -> logging) = 0; (smg_data -> print_level) = 0; + (smg_data -> memory_location) = hypre_HandleMemoryLocation(hypre_handle()); + /* initialize */ (smg_data -> num_levels) = -1; -#if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - (smg_data -> devicelevel) = 200; -#endif + return (void *) smg_data; } @@ -65,6 +65,8 @@ hypre_SMGDestroy( void *smg_vdata ) hypre_TFree(smg_data -> rel_norms, HYPRE_MEMORY_HOST); } + HYPRE_MemoryLocation memory_location = smg_data -> memory_location; + if ((smg_data -> num_levels) > -1) { for (l = 0; l < ((smg_data -> num_levels) - 1); l++) @@ -92,9 +94,9 @@ hypre_SMGDestroy( void *smg_vdata ) hypre_StructVectorDestroy(smg_data -> x_l[0]); for (l = 0; l < ((smg_data -> num_levels) - 1); l++) { - hypre_StructGridDestroy(smg_data -> grid_l[l+1]); - hypre_StructGridDestroy(smg_data -> PT_grid_l[l+1]); - hypre_StructMatrixDestroy(smg_data -> A_l[l+1]); + hypre_StructGridDestroy(smg_data -> grid_l[l + 1]); + hypre_StructGridDestroy(smg_data -> PT_grid_l[l + 1]); + hypre_StructMatrixDestroy(smg_data -> A_l[l + 1]); if (smg_data -> PT_l[l] == smg_data -> R_l[l]) { hypre_StructMatrixDestroy(smg_data -> PT_l[l]); @@ -104,12 +106,12 @@ hypre_SMGDestroy( void *smg_vdata ) hypre_StructMatrixDestroy(smg_data -> PT_l[l]); hypre_StructMatrixDestroy(smg_data -> R_l[l]); } - hypre_StructVectorDestroy(smg_data -> b_l[l+1]); - hypre_StructVectorDestroy(smg_data -> x_l[l+1]); - hypre_StructVectorDestroy(smg_data -> tb_l[l+1]); - hypre_StructVectorDestroy(smg_data -> tx_l[l+1]); + hypre_StructVectorDestroy(smg_data -> b_l[l + 1]); + hypre_StructVectorDestroy(smg_data -> x_l[l + 1]); + hypre_StructVectorDestroy(smg_data -> tb_l[l + 1]); + hypre_StructVectorDestroy(smg_data -> tx_l[l + 1]); } - hypre_TFree(smg_data -> data, HYPRE_MEMORY_DEVICE); + hypre_TFree(smg_data -> data, memory_location); hypre_TFree(smg_data -> grid_l, HYPRE_MEMORY_HOST); hypre_TFree(smg_data -> PT_grid_l, HYPRE_MEMORY_HOST); hypre_TFree(smg_data -> A_l, HYPRE_MEMORY_HOST); @@ -265,7 +267,7 @@ hypre_SMGSetNumPreRelax( void *smg_vdata, { hypre_SMGData *smg_data = (hypre_SMGData *)smg_vdata; - (smg_data -> num_pre_relax) = hypre_max(num_pre_relax,1); + (smg_data -> num_pre_relax) = hypre_max(num_pre_relax, 1); return hypre_error_flag; } @@ -416,8 +418,8 @@ hypre_SMGPrintLogging( void *smg_vdata, { for (i = 0; i < num_iterations; i++) { - hypre_printf("Residual norm[%d] = %e ",i,norms[i]); - hypre_printf("Relative residual norm[%d] = %e\n",i,rel_norms[i]); + hypre_printf("Residual norm[%d] = %e ", i, norms[i]); + hypre_printf("Relative residual norm[%d] = %e\n", i, rel_norms[i]); } } } @@ -444,7 +446,7 @@ hypre_SMGGetFinalRelativeResidualNorm( void *smg_vdata, { if (num_iterations == max_iter) { - *relative_residual_norm = rel_norms[num_iterations-1]; + *relative_residual_norm = rel_norms[num_iterations - 1]; } else { diff --git a/external/hypre/src/struct_ls/smg.h b/external/hypre/src/struct_ls/smg.h index 0a1e15c2..4273defe 100644 --- a/external/hypre/src/struct_ls/smg.h +++ b/external/hypre/src/struct_ls/smg.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -43,6 +43,7 @@ typedef struct hypre_StructGrid **grid_l; hypre_StructGrid **PT_grid_l; + HYPRE_MemoryLocation memory_location; /* memory location of data */ HYPRE_Real *data; HYPRE_Real *data_const; hypre_StructMatrix **A_l; @@ -66,15 +67,12 @@ typedef struct HYPRE_Int num_iterations; HYPRE_Int time_index; - HYPRE_Int print_level; + HYPRE_Int print_level; /* additional log info (logged when `logging' > 0) */ HYPRE_Int logging; HYPRE_Real *norms; HYPRE_Real *rel_norms; -#if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - HYPRE_Int devicelevel; -#endif } hypre_SMGData; /*-------------------------------------------------------------------------- diff --git a/external/hypre/src/struct_ls/smg2_setup_rap.c b/external/hypre/src/struct_ls/smg2_setup_rap.c index 88bbc106..8b4ed3a2 100644 --- a/external/hypre/src/struct_ls/smg2_setup_rap.c +++ b/external/hypre/src/struct_ls/smg2_setup_rap.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -19,6 +19,9 @@ hypre_SMG2CreateRAPOp( hypre_StructMatrix *R, hypre_StructMatrix *PT, hypre_StructGrid *coarse_grid ) { + HYPRE_UNUSED_VAR(R); + HYPRE_UNUSED_VAR(PT); + hypre_StructMatrix *RAP; hypre_Index *RAP_stencil_shape; @@ -58,7 +61,7 @@ hypre_SMG2CreateRAPOp( hypre_StructMatrix *R, /*-------------------------------------------------------------- * Storage for 9 elements (c,w,e,n,s,sw,se,nw,se) *--------------------------------------------------------------*/ - hypre_SetIndex3(RAP_stencil_shape[stencil_rank],i,j,0); + hypre_SetIndex3(RAP_stencil_shape[stencil_rank], i, j, 0); stencil_rank++; } } @@ -87,9 +90,9 @@ hypre_SMG2CreateRAPOp( hypre_StructMatrix *R, /*-------------------------------------------------------------- * Store 5 elements in (c,w,s,sw,se) *--------------------------------------------------------------*/ - if( i+j <=0 ) + if ( i + j <= 0 ) { - hypre_SetIndex3(RAP_stencil_shape[stencil_rank],i,j,0); + hypre_SetIndex3(RAP_stencil_shape[stencil_rank], i, j, 0); stencil_rank++; } } @@ -177,7 +180,7 @@ hypre_SMG2BuildRAPSym( hypre_StructMatrix *A, HYPRE_Real *ra, *rb; HYPRE_Real *a_cc, *a_cw, *a_ce, *a_cs, *a_cn; - HYPRE_Real *a_csw, *a_cse, *a_cnw; + HYPRE_Real *a_csw = NULL, *a_cse = NULL, *a_cnw = NULL; HYPRE_Real *rap_cc, *rap_cw, *rap_cs; HYPRE_Real *rap_csw, *rap_cse; @@ -223,10 +226,10 @@ hypre_SMG2BuildRAPSym( hypre_StructMatrix *A, * pb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index,0,1,0); + hypre_SetIndex3(index, 0, 1, 0); pa = hypre_StructMatrixExtractPointerByIndex(PT, fi, index); - hypre_SetIndex3(index,0,-1,0); + hypre_SetIndex3(index, 0, -1, 0); pb = hypre_StructMatrixExtractPointerByIndex(PT, fi, index); /*----------------------------------------------------------------- @@ -235,10 +238,10 @@ hypre_SMG2BuildRAPSym( hypre_StructMatrix *A, * rb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index,0,1,0); + hypre_SetIndex3(index, 0, 1, 0); ra = hypre_StructMatrixExtractPointerByIndex(R, fi, index); - hypre_SetIndex3(index,0,-1,0); + hypre_SetIndex3(index, 0, -1, 0); rb = hypre_StructMatrixExtractPointerByIndex(R, fi, index); /*----------------------------------------------------------------- @@ -251,19 +254,19 @@ hypre_SMG2BuildRAPSym( hypre_StructMatrix *A, * a_cn is pointer for north coefficient *-----------------------------------------------------------------*/ - hypre_SetIndex3(index,0,0,0); + hypre_SetIndex3(index, 0, 0, 0); a_cc = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,-1,0,0); + hypre_SetIndex3(index, -1, 0, 0); a_cw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,1,0,0); + hypre_SetIndex3(index, 1, 0, 0); a_ce = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,0,-1,0); + hypre_SetIndex3(index, 0, -1, 0); a_cs = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,0,1,0); + hypre_SetIndex3(index, 0, 1, 0); a_cn = hypre_StructMatrixExtractPointerByIndex(A, fi, index); /*----------------------------------------------------------------- @@ -275,15 +278,15 @@ hypre_SMG2BuildRAPSym( hypre_StructMatrix *A, * a_cne is pointer for northeast coefficient *-----------------------------------------------------------------*/ - if(fine_stencil_size > 5) + if (fine_stencil_size > 5) { - hypre_SetIndex3(index,-1,-1,0); + hypre_SetIndex3(index, -1, -1, 0); a_csw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,1,-1,0); + hypre_SetIndex3(index, 1, -1, 0); a_cse = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,-1,1,0); + hypre_SetIndex3(index, -1, 1, 0); a_cnw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); } @@ -295,19 +298,19 @@ hypre_SMG2BuildRAPSym( hypre_StructMatrix *A, * rap_cc is pointer for center coefficient (etc.) *-----------------------------------------------------------------*/ - hypre_SetIndex3(index,0,0,0); + hypre_SetIndex3(index, 0, 0, 0); rap_cc = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,-1,0,0); + hypre_SetIndex3(index, -1, 0, 0); rap_cw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,0,-1,0); + hypre_SetIndex3(index, 0, -1, 0); rap_cs = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,-1,-1,0); + hypre_SetIndex3(index, -1, -1, 0); rap_csw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,1,-1,0); + hypre_SetIndex3(index, 1, -1, 0); rap_cse = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); /*----------------------------------------------------------------- @@ -318,11 +321,11 @@ hypre_SMG2BuildRAPSym( hypre_StructMatrix *A, * Offsets are used in refering to data associated with other points. *-----------------------------------------------------------------*/ - hypre_SetIndex3(index,0,1,0); - yOffsetA = hypre_BoxOffsetDistance(A_dbox,index); - yOffsetP = hypre_BoxOffsetDistance(PT_dbox,index); - hypre_SetIndex3(index,1,0,0); - xOffsetP = hypre_BoxOffsetDistance(PT_dbox,index); + hypre_SetIndex3(index, 0, 1, 0); + yOffsetA = hypre_BoxOffsetDistance(A_dbox, index); + yOffsetP = hypre_BoxOffsetDistance(PT_dbox, index); + hypre_SetIndex3(index, 1, 0, 0); + xOffsetP = hypre_BoxOffsetDistance(PT_dbox, index); /*----------------------------------------------------------------- * Switch statement to direct control to apropriate BoxLoop depending @@ -357,36 +360,36 @@ hypre_SMG2BuildRAPSym( hypre_StructMatrix *A, iP1 = iP - yOffsetP; rap_cs[iAc] = rb[iR] * a_cc[iAm1] * pa[iP1] - + rb[iR] * a_cs[iAm1] - + a_cs[iA] * pa[iP1]; + + rb[iR] * a_cs[iAm1] + + a_cs[iA] * pa[iP1]; iP1 = iP - yOffsetP + xOffsetP; rap_cse[iAc] = rb[iR] * a_ce[iAm1] * pa[iP1]; iP1 = iP - xOffsetP; rap_cw[iAc] = a_cw[iA] - + rb[iR] * a_cw[iAm1] * pb[iP1] - + ra[iR] * a_cw[iAp1] * pa[iP1]; + + rb[iR] * a_cw[iAm1] * pb[iP1] + + ra[iR] * a_cw[iAp1] * pa[iP1]; rap_cc[iAc] = a_cc[iA] - + rb[iR] * a_cc[iAm1] * pb[iP] - + ra[iR] * a_cc[iAp1] * pa[iP] - + rb[iR] * a_cn[iAm1] - + ra[iR] * a_cs[iAp1] - + a_cs[iA] * pb[iP] - + a_cn[iA] * pa[iP]; + + rb[iR] * a_cc[iAm1] * pb[iP] + + ra[iR] * a_cc[iAp1] * pa[iP] + + rb[iR] * a_cn[iAm1] + + ra[iR] * a_cs[iAp1] + + a_cs[iA] * pb[iP] + + a_cn[iA] * pa[iP]; } hypre_BoxLoop4End(iP, iR, iA, iAc); #undef DEVICE_VAR break; - /*-------------------------------------------------------------- - * Loop for symmetric 9-point fine grid operator; produces a - * symmetric 9-point coarse grid operator. We calculate only the - * lower triangular stencil entries: (southwest, south, southeast, - * west, and center). - *--------------------------------------------------------------*/ + /*-------------------------------------------------------------- + * Loop for symmetric 9-point fine grid operator; produces a + * symmetric 9-point coarse grid operator. We calculate only the + * lower triangular stencil entries: (southwest, south, southeast, + * west, and center). + *--------------------------------------------------------------*/ default: @@ -404,35 +407,35 @@ hypre_SMG2BuildRAPSym( hypre_StructMatrix *A, HYPRE_Int iP1 = iP - yOffsetP - xOffsetP; rap_csw[iAc] = rb[iR] * a_cw[iAm1] * pa[iP1] - + rb[iR] * a_csw[iAm1] - + a_csw[iA] * pa[iP1]; + + rb[iR] * a_csw[iAm1] + + a_csw[iA] * pa[iP1]; iP1 = iP - yOffsetP; rap_cs[iAc] = rb[iR] * a_cc[iAm1] * pa[iP1] - + rb[iR] * a_cs[iAm1] - + a_cs[iA] * pa[iP1]; + + rb[iR] * a_cs[iAm1] + + a_cs[iA] * pa[iP1]; iP1 = iP - yOffsetP + xOffsetP; rap_cse[iAc] = rb[iR] * a_ce[iAm1] * pa[iP1] - + rb[iR] * a_cse[iAm1] - + a_cse[iA] * pa[iP1]; + + rb[iR] * a_cse[iAm1] + + a_cse[iA] * pa[iP1]; iP1 = iP - xOffsetP; rap_cw[iAc] = a_cw[iA] - + rb[iR] * a_cw[iAm1] * pb[iP1] - + ra[iR] * a_cw[iAp1] * pa[iP1] - + rb[iR] * a_cnw[iAm1] - + ra[iR] * a_csw[iAp1] - + a_csw[iA] * pb[iP1] - + a_cnw[iA] * pa[iP1]; + + rb[iR] * a_cw[iAm1] * pb[iP1] + + ra[iR] * a_cw[iAp1] * pa[iP1] + + rb[iR] * a_cnw[iAm1] + + ra[iR] * a_csw[iAp1] + + a_csw[iA] * pb[iP1] + + a_cnw[iA] * pa[iP1]; rap_cc[iAc] = a_cc[iA] - + rb[iR] * a_cc[iAm1] * pb[iP] - + ra[iR] * a_cc[iAp1] * pa[iP] - + rb[iR] * a_cn[iAm1] - + ra[iR] * a_cs[iAp1] - + a_cs[iA] * pb[iP] - + a_cn[iA] * pa[iP]; + + rb[iR] * a_cc[iAm1] * pb[iP] + + ra[iR] * a_cc[iAp1] * pa[iP] + + rb[iR] * a_cn[iAm1] + + ra[iR] * a_cs[iAp1] + + a_cs[iA] * pb[iP] + + a_cn[iA] * pa[iP]; } hypre_BoxLoop4End(iP, iR, iA, iAc); @@ -488,7 +491,7 @@ hypre_SMG2BuildRAPNoSym( hypre_StructMatrix *A, HYPRE_Real *ra, *rb; HYPRE_Real *a_cc, *a_cw, *a_ce, *a_cn; - HYPRE_Real *a_cse, *a_cnw, *a_cne; + HYPRE_Real *a_cse = NULL, *a_cnw = NULL, *a_cne = NULL; HYPRE_Real *rap_ce, *rap_cn; HYPRE_Real *rap_cnw, *rap_cne; @@ -534,10 +537,10 @@ hypre_SMG2BuildRAPNoSym( hypre_StructMatrix *A, * pb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index,0,1,0); + hypre_SetIndex3(index, 0, 1, 0); pa = hypre_StructMatrixExtractPointerByIndex(PT, fi, index); - hypre_SetIndex3(index,0,-1,0); + hypre_SetIndex3(index, 0, -1, 0); pb = hypre_StructMatrixExtractPointerByIndex(PT, fi, index); /*----------------------------------------------------------------- @@ -546,10 +549,10 @@ hypre_SMG2BuildRAPNoSym( hypre_StructMatrix *A, * rb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index,0,1,0); + hypre_SetIndex3(index, 0, 1, 0); ra = hypre_StructMatrixExtractPointerByIndex(R, fi, index); - hypre_SetIndex3(index,0,-1,0); + hypre_SetIndex3(index, 0, -1, 0); rb = hypre_StructMatrixExtractPointerByIndex(R, fi, index); /*----------------------------------------------------------------- @@ -562,16 +565,16 @@ hypre_SMG2BuildRAPNoSym( hypre_StructMatrix *A, * a_cn is pointer for north coefficient *-----------------------------------------------------------------*/ - hypre_SetIndex3(index,0,0,0); + hypre_SetIndex3(index, 0, 0, 0); a_cc = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,-1,0,0); + hypre_SetIndex3(index, -1, 0, 0); a_cw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,1,0,0); + hypre_SetIndex3(index, 1, 0, 0); a_ce = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,0,1,0); + hypre_SetIndex3(index, 0, 1, 0); a_cn = hypre_StructMatrixExtractPointerByIndex(A, fi, index); /*----------------------------------------------------------------- @@ -583,17 +586,16 @@ hypre_SMG2BuildRAPNoSym( hypre_StructMatrix *A, * a_cne is pointer for northeast coefficient *-----------------------------------------------------------------*/ - if(fine_stencil_size > 5) + if (fine_stencil_size > 5) { - hypre_SetIndex3(index,1,-1,0); + hypre_SetIndex3(index, 1, -1, 0); a_cse = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,-1,1,0); + hypre_SetIndex3(index, -1, 1, 0); a_cnw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,1,1,0); + hypre_SetIndex3(index, 1, 1, 0); a_cne = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - } /*----------------------------------------------------------------- @@ -604,16 +606,16 @@ hypre_SMG2BuildRAPNoSym( hypre_StructMatrix *A, * rap_ce is pointer for east coefficient (etc.) *-----------------------------------------------------------------*/ - hypre_SetIndex3(index,1,0,0); + hypre_SetIndex3(index, 1, 0, 0); rap_ce = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,0,1,0); + hypre_SetIndex3(index, 0, 1, 0); rap_cn = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,1,1,0); + hypre_SetIndex3(index, 1, 1, 0); rap_cne = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,-1,1,0); + hypre_SetIndex3(index, -1, 1, 0); rap_cnw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); /*----------------------------------------------------------------- @@ -624,11 +626,11 @@ hypre_SMG2BuildRAPNoSym( hypre_StructMatrix *A, * Offsets are used in refering to data associated with other points. *-----------------------------------------------------------------*/ - hypre_SetIndex3(index,0,1,0); - yOffsetA = hypre_BoxOffsetDistance(A_dbox,index); - yOffsetP = hypre_BoxOffsetDistance(PT_dbox,index); - hypre_SetIndex3(index,1,0,0); - xOffsetP = hypre_BoxOffsetDistance(PT_dbox,index); + hypre_SetIndex3(index, 0, 1, 0); + yOffsetA = hypre_BoxOffsetDistance(A_dbox, index); + yOffsetP = hypre_BoxOffsetDistance(PT_dbox, index); + hypre_SetIndex3(index, 1, 0, 0); + xOffsetP = hypre_BoxOffsetDistance(PT_dbox, index); /*----------------------------------------------------------------- * Switch statement to direct control to apropriate BoxLoop depending @@ -663,16 +665,16 @@ hypre_SMG2BuildRAPNoSym( hypre_StructMatrix *A, iP1 = iP + yOffsetP; rap_cn[iAc] = ra[iR] * a_cc[iAp1] * pb[iP1] - + ra[iR] * a_cn[iAp1] - + a_cn[iA] * pb[iP1]; + + ra[iR] * a_cn[iAp1] + + a_cn[iA] * pb[iP1]; iP1 = iP + yOffsetP - xOffsetP; rap_cnw[iAc] = ra[iR] * a_cw[iAp1] * pb[iP1]; iP1 = iP + xOffsetP; rap_ce[iAc] = a_ce[iA] - + rb[iR] * a_ce[iAm1] * pb[iP1] - + ra[iR] * a_ce[iAp1] * pa[iP1]; + + rb[iR] * a_ce[iAm1] * pb[iP1] + + ra[iR] * a_ce[iAp1] * pa[iP1]; } hypre_BoxLoop4End(iP, iR, iA, iAc); @@ -680,11 +682,11 @@ hypre_SMG2BuildRAPNoSym( hypre_StructMatrix *A, break; - /*-------------------------------------------------------------- - * Loop for 9-point fine grid operator; produces upper triangular - * part of 9-point coarse grid operator - excludes diagonal. - * stencil entries: (northeast, north, northwest, and east) - *--------------------------------------------------------------*/ + /*-------------------------------------------------------------- + * Loop for 9-point fine grid operator; produces upper triangular + * part of 9-point coarse grid operator - excludes diagonal. + * stencil entries: (northeast, north, northwest, and east) + *--------------------------------------------------------------*/ default: hypre_BoxGetSize(cgrid_box, loop_size); @@ -701,27 +703,27 @@ hypre_SMG2BuildRAPNoSym( hypre_StructMatrix *A, HYPRE_Int iP1 = iP + yOffsetP + xOffsetP; rap_cne[iAc] = ra[iR] * a_ce[iAp1] * pb[iP1] - + ra[iR] * a_cne[iAp1] - + a_cne[iA] * pb[iP1]; + + ra[iR] * a_cne[iAp1] + + a_cne[iA] * pb[iP1]; iP1 = iP + yOffsetP; rap_cn[iAc] = ra[iR] * a_cc[iAp1] * pb[iP1] - + ra[iR] * a_cn[iAp1] - + a_cn[iA] * pb[iP1]; + + ra[iR] * a_cn[iAp1] + + a_cn[iA] * pb[iP1]; iP1 = iP + yOffsetP - xOffsetP; rap_cnw[iAc] = ra[iR] * a_cw[iAp1] * pb[iP1] - + ra[iR] * a_cnw[iAp1] - + a_cnw[iA] * pb[iP1]; + + ra[iR] * a_cnw[iAp1] + + a_cnw[iA] * pb[iP1]; iP1 = iP + xOffsetP; rap_ce[iAc] = a_ce[iA] - + rb[iR] * a_ce[iAm1] * pb[iP1] - + ra[iR] * a_ce[iAp1] * pa[iP1] - + rb[iR] * a_cne[iAm1] - + ra[iR] * a_cse[iAp1] - + a_cse[iA] * pb[iP1] - + a_cne[iA] * pa[iP1]; + + rb[iR] * a_ce[iAm1] * pb[iP1] + + ra[iR] * a_ce[iAp1] * pa[iP1] + + rb[iR] * a_cne[iAm1] + + ra[iR] * a_cse[iAp1] + + a_cse[iA] * pb[iP1] + + a_cne[iA] * pa[iP1]; } hypre_BoxLoop4End(iP, iR, iA, iAc); @@ -748,6 +750,9 @@ hypre_SMG2RAPPeriodicSym( hypre_StructMatrix *RAP, hypre_Index cstride ) { + HYPRE_UNUSED_VAR(cindex); + HYPRE_UNUSED_VAR(cstride); + hypre_Index index; hypre_StructGrid *cgrid; @@ -785,25 +790,25 @@ hypre_SMG2RAPPeriodicSym( hypre_StructMatrix *RAP, RAP_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(RAP), ci); - hypre_SetIndex3(index,1,0,0); - xOffset = hypre_BoxOffsetDistance(RAP_dbox,index); + hypre_SetIndex3(index, 1, 0, 0); + xOffset = hypre_BoxOffsetDistance(RAP_dbox, index); /*----------------------------------------------------------------- * Extract pointers for coarse grid operator - always 9-point: *-----------------------------------------------------------------*/ - hypre_SetIndex3(index,0,0,0); + hypre_SetIndex3(index, 0, 0, 0); rap_cc = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,-1,0,0); + hypre_SetIndex3(index, -1, 0, 0); rap_cw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,0,-1,0); + hypre_SetIndex3(index, 0, -1, 0); rap_cs = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,-1,-1,0); + hypre_SetIndex3(index, -1, -1, 0); rap_csw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,1,-1,0); + hypre_SetIndex3(index, 1, -1, 0); rap_cse = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); hypre_BoxGetSize(cgrid_box, loop_size); @@ -848,6 +853,9 @@ hypre_SMG2RAPPeriodicNoSym( hypre_StructMatrix *RAP, hypre_Index cstride ) { + HYPRE_UNUSED_VAR(cindex); + HYPRE_UNUSED_VAR(cstride); + hypre_Index index; hypre_StructGrid *cgrid; @@ -886,31 +894,31 @@ hypre_SMG2RAPPeriodicNoSym( hypre_StructMatrix *RAP, /*----------------------------------------------------------------- * Extract pointers for coarse grid operator - always 9-point: *-----------------------------------------------------------------*/ - hypre_SetIndex3(index,0,0,0); + hypre_SetIndex3(index, 0, 0, 0); rap_cc = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,-1,0,0); + hypre_SetIndex3(index, -1, 0, 0); rap_cw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,0,-1,0); + hypre_SetIndex3(index, 0, -1, 0); rap_cs = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,-1,-1,0); + hypre_SetIndex3(index, -1, -1, 0); rap_csw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,1,-1,0); + hypre_SetIndex3(index, 1, -1, 0); rap_cse = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,1,0,0); + hypre_SetIndex3(index, 1, 0, 0); rap_ce = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,0,1,0); + hypre_SetIndex3(index, 0, 1, 0); rap_cn = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,1,1,0); + hypre_SetIndex3(index, 1, 1, 0); rap_cne = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,-1,1,0); + hypre_SetIndex3(index, -1, 1, 0); rap_cnw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); @@ -941,4 +949,3 @@ hypre_SMG2RAPPeriodicNoSym( hypre_StructMatrix *RAP, return hypre_error_flag; } - diff --git a/external/hypre/src/struct_ls/smg3_setup_rap.c b/external/hypre/src/struct_ls/smg3_setup_rap.c index 51a94d0e..45812162 100644 --- a/external/hypre/src/struct_ls/smg3_setup_rap.c +++ b/external/hypre/src/struct_ls/smg3_setup_rap.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -19,6 +19,9 @@ hypre_SMG3CreateRAPOp( hypre_StructMatrix *R, hypre_StructMatrix *PT, hypre_StructGrid *coarse_grid ) { + HYPRE_UNUSED_VAR(R); + HYPRE_UNUSED_VAR(PT); + hypre_StructMatrix *RAP; hypre_Index *RAP_stencil_shape; @@ -54,7 +57,7 @@ hypre_SMG3CreateRAPOp( hypre_StructMatrix *R, /*-------------------------------------------------------------------- * 7 or 15 point fine grid stencil produces 15 point RAP *--------------------------------------------------------------------*/ - if( A_stencil_size <= 15) + if ( A_stencil_size <= 15) { RAP_stencil_size = 15; RAP_stencil_shape = hypre_CTAlloc(hypre_Index, RAP_stencil_size, HYPRE_MEMORY_HOST); @@ -68,9 +71,9 @@ hypre_SMG3CreateRAPOp( hypre_StructMatrix *R, /*-------------------------------------------------------- * Storage for c,w,e,n,s elements in each plane *--------------------------------------------------------*/ - if( i*j == 0 ) + if ( i * j == 0 ) { - hypre_SetIndex3(RAP_stencil_shape[stencil_rank],i,j,k); + hypre_SetIndex3(RAP_stencil_shape[stencil_rank], i, j, k); stencil_rank++; } } @@ -96,7 +99,7 @@ hypre_SMG3CreateRAPOp( hypre_StructMatrix *R, * Storage for 9 elements (c,w,e,n,s,sw,se,nw,se) in * each plane *--------------------------------------------------------*/ - hypre_SetIndex3(RAP_stencil_shape[stencil_rank],i,j,k); + hypre_SetIndex3(RAP_stencil_shape[stencil_rank], i, j, k); stencil_rank++; } } @@ -117,7 +120,7 @@ hypre_SMG3CreateRAPOp( hypre_StructMatrix *R, * lower triangular means the lower triangular part on the matrix * in the standard lexicalgraphic ordering. *--------------------------------------------------------------------*/ - if( A_stencil_size <= 15) + if ( A_stencil_size <= 15) { RAP_stencil_size = 8; RAP_stencil_shape = hypre_CTAlloc(hypre_Index, RAP_stencil_size, HYPRE_MEMORY_HOST); @@ -132,9 +135,9 @@ hypre_SMG3CreateRAPOp( hypre_StructMatrix *R, * Store 5 elements in lower plane (c,w,e,s,n) * and 3 elements in same plane (c,w,s) *--------------------------------------------------------*/ - if( i*j == 0 && i+j+k <= 0) + if ( i * j == 0 && i + j + k <= 0) { - hypre_SetIndex3(RAP_stencil_shape[stencil_rank],i,j,k); + hypre_SetIndex3(RAP_stencil_shape[stencil_rank], i, j, k); stencil_rank++; } } @@ -163,9 +166,9 @@ hypre_SMG3CreateRAPOp( hypre_StructMatrix *R, * Store 9 elements in lower plane (c,w,e,s,n,sw,se,nw,ne) * and 5 elements in same plane (c,w,s,sw,se) *--------------------------------------------------------*/ - if( k < 0 || (i+j+k <=0 && j < 1) ) + if ( k < 0 || (i + j + k <= 0 && j < 1) ) { - hypre_SetIndex3(RAP_stencil_shape[stencil_rank],i,j,k); + hypre_SetIndex3(RAP_stencil_shape[stencil_rank], i, j, k); stencil_rank++; } } @@ -254,16 +257,21 @@ hypre_SMG3BuildRAPSym( hypre_StructMatrix *A, HYPRE_Real *ra, *rb; HYPRE_Real *a_cc, *a_cw, *a_ce, *a_cs, *a_cn; - HYPRE_Real *a_ac, *a_aw, *a_as; - HYPRE_Real *a_bc, *a_bw, *a_be, *a_bs, *a_bn; - HYPRE_Real *a_csw, *a_cse, *a_cnw, *a_cne; - HYPRE_Real *a_asw, *a_ase; - HYPRE_Real *a_bsw, *a_bse, *a_bnw, *a_bne; + HYPRE_Real *a_ac, *a_bc; + HYPRE_Real *a_aw = NULL, *a_as = NULL; + HYPRE_Real *a_bw = NULL, *a_be = NULL; + HYPRE_Real *a_bs = NULL, *a_bn = NULL; + HYPRE_Real *a_csw = NULL, *a_cse = NULL; + HYPRE_Real *a_cnw = NULL, *a_cne = NULL; + HYPRE_Real *a_asw = NULL, *a_ase = NULL; + HYPRE_Real *a_bsw = NULL, *a_bse = NULL; + HYPRE_Real *a_bnw = NULL, *a_bne = NULL; HYPRE_Real *rap_cc, *rap_cw, *rap_cs; HYPRE_Real *rap_bc, *rap_bw, *rap_be, *rap_bs, *rap_bn; - HYPRE_Real *rap_csw, *rap_cse; - HYPRE_Real *rap_bsw, *rap_bse, *rap_bnw, *rap_bne; + HYPRE_Real *rap_csw = NULL, *rap_cse = NULL; + HYPRE_Real *rap_bsw = NULL, *rap_bse = NULL; + HYPRE_Real *rap_bnw = NULL, *rap_bne = NULL; HYPRE_Int zOffsetA; HYPRE_Int xOffsetP; @@ -307,10 +315,10 @@ hypre_SMG3BuildRAPSym( hypre_StructMatrix *A, * pb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index,0,0,1); + hypre_SetIndex3(index, 0, 0, 1); pa = hypre_StructMatrixExtractPointerByIndex(PT, fi, index); - hypre_SetIndex3(index,0,0,-1); + hypre_SetIndex3(index, 0, 0, -1); pb = hypre_StructMatrixExtractPointerByIndex(PT, fi, index); /*----------------------------------------------------------------- @@ -319,10 +327,10 @@ hypre_SMG3BuildRAPSym( hypre_StructMatrix *A, * rb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index,0,0,1); + hypre_SetIndex3(index, 0, 0, 1); ra = hypre_StructMatrixExtractPointerByIndex(R, fi, index); - hypre_SetIndex3(index,0,0,-1); + hypre_SetIndex3(index, 0, 0, -1); rb = hypre_StructMatrixExtractPointerByIndex(R, fi, index); /*----------------------------------------------------------------- @@ -337,25 +345,25 @@ hypre_SMG3BuildRAPSym( hypre_StructMatrix *A, * a_bc is pointer for center coefficient in plane below *-----------------------------------------------------------------*/ - hypre_SetIndex3(index,0,0,0); + hypre_SetIndex3(index, 0, 0, 0); a_cc = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,-1,0,0); + hypre_SetIndex3(index, -1, 0, 0); a_cw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,1,0,0); + hypre_SetIndex3(index, 1, 0, 0); a_ce = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,0,-1,0); + hypre_SetIndex3(index, 0, -1, 0); a_cs = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,0,1,0); + hypre_SetIndex3(index, 0, 1, 0); a_cn = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,0,0,1); + hypre_SetIndex3(index, 0, 0, 1); a_ac = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,0,0,-1); + hypre_SetIndex3(index, 0, 0, -1); a_bc = hypre_StructMatrixExtractPointerByIndex(A, fi, index); /*----------------------------------------------------------------- @@ -371,24 +379,24 @@ hypre_SMG3BuildRAPSym( hypre_StructMatrix *A, * a_bn is pointer for north coefficient in plane below *-----------------------------------------------------------------*/ - if(fine_stencil_size > 7) + if (fine_stencil_size > 7) { - hypre_SetIndex3(index,-1,0,1); + hypre_SetIndex3(index, -1, 0, 1); a_aw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,0,-1,1); + hypre_SetIndex3(index, 0, -1, 1); a_as = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,-1,0,-1); + hypre_SetIndex3(index, -1, 0, -1); a_bw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,1,0,-1); + hypre_SetIndex3(index, 1, 0, -1); a_be = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,0,-1,-1); + hypre_SetIndex3(index, 0, -1, -1); a_bs = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,0,1,-1); + hypre_SetIndex3(index, 0, 1, -1); a_bn = hypre_StructMatrixExtractPointerByIndex(A, fi, index); } @@ -402,20 +410,19 @@ hypre_SMG3BuildRAPSym( hypre_StructMatrix *A, * a_cne is pointer for northeast coefficient in same plane *-----------------------------------------------------------------*/ - if(fine_stencil_size > 15) + if (fine_stencil_size > 15) { - hypre_SetIndex3(index,-1,-1,0); + hypre_SetIndex3(index, -1, -1, 0); a_csw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,1,-1,0); + hypre_SetIndex3(index, 1, -1, 0); a_cse = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,-1,1,0); + hypre_SetIndex3(index, -1, 1, 0); a_cnw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,1,1,0); + hypre_SetIndex3(index, 1, 1, 0); a_cne = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - } /*----------------------------------------------------------------- @@ -431,26 +438,25 @@ hypre_SMG3BuildRAPSym( hypre_StructMatrix *A, * a_bne is pointer for northeast coefficient in plane below *-----------------------------------------------------------------*/ - if(fine_stencil_size > 19) + if (fine_stencil_size > 19) { - hypre_SetIndex3(index,-1,-1,1); + hypre_SetIndex3(index, -1, -1, 1); a_asw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,1,-1,1); + hypre_SetIndex3(index, 1, -1, 1); a_ase = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,-1,-1,-1); + hypre_SetIndex3(index, -1, -1, -1); a_bsw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,1,-1,-1); + hypre_SetIndex3(index, 1, -1, -1); a_bse = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,-1,1,-1); + hypre_SetIndex3(index, -1, 1, -1); a_bnw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,1,1,-1); + hypre_SetIndex3(index, 1, 1, -1); a_bne = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - } /*----------------------------------------------------------------- @@ -461,28 +467,28 @@ hypre_SMG3BuildRAPSym( hypre_StructMatrix *A, * rap_cc is pointer for center coefficient (etc.) *-----------------------------------------------------------------*/ - hypre_SetIndex3(index,0,0,0); + hypre_SetIndex3(index, 0, 0, 0); rap_cc = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,-1,0,0); + hypre_SetIndex3(index, -1, 0, 0); rap_cw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,0,-1,0); + hypre_SetIndex3(index, 0, -1, 0); rap_cs = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,0,0,-1); + hypre_SetIndex3(index, 0, 0, -1); rap_bc = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,-1,0,-1); + hypre_SetIndex3(index, -1, 0, -1); rap_bw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,1,0,-1); + hypre_SetIndex3(index, 1, 0, -1); rap_be = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,0,-1,-1); + hypre_SetIndex3(index, 0, -1, -1); rap_bs = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,0,1,-1); + hypre_SetIndex3(index, 0, 1, -1); rap_bn = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); /*----------------------------------------------------------------- @@ -496,29 +502,29 @@ hypre_SMG3BuildRAPSym( hypre_StructMatrix *A, * rap_csw is pointer for southwest coefficient in same plane (etc.) *-----------------------------------------------------------------*/ - if(fine_stencil_size > 15) + if (fine_stencil_size > 15) { - hypre_SetIndex3(index,-1,-1,0); + hypre_SetIndex3(index, -1, -1, 0); rap_csw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,1,-1,0); + hypre_SetIndex3(index, 1, -1, 0); rap_cse = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,-1,-1,-1); + hypre_SetIndex3(index, -1, -1, -1); rap_bsw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,1,-1,-1); + hypre_SetIndex3(index, 1, -1, -1); rap_bse = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,-1,1,-1); + hypre_SetIndex3(index, -1, 1, -1); rap_bnw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,1,1,-1); + hypre_SetIndex3(index, 1, 1, -1); rap_bne = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); @@ -532,13 +538,13 @@ hypre_SMG3BuildRAPSym( hypre_StructMatrix *A, * Offsets are used in refering to data associated with other points. *-----------------------------------------------------------------*/ - hypre_SetIndex3(index,0,0,1); - zOffsetA = hypre_BoxOffsetDistance(A_dbox,index); - zOffsetP = hypre_BoxOffsetDistance(PT_dbox,index); - hypre_SetIndex3(index,0,1,0); - yOffsetP = hypre_BoxOffsetDistance(PT_dbox,index); - hypre_SetIndex3(index,1,0,0); - xOffsetP = hypre_BoxOffsetDistance(PT_dbox,index); + hypre_SetIndex3(index, 0, 0, 1); + zOffsetA = hypre_BoxOffsetDistance(A_dbox, index); + zOffsetP = hypre_BoxOffsetDistance(PT_dbox, index); + hypre_SetIndex3(index, 0, 1, 0); + yOffsetP = hypre_BoxOffsetDistance(PT_dbox, index); + hypre_SetIndex3(index, 1, 0, 0); + xOffsetP = hypre_BoxOffsetDistance(PT_dbox, index); /*-------------------------------------------------------------------- * Switch statement to direct control to apropriate BoxLoop depending @@ -578,8 +584,8 @@ hypre_SMG3BuildRAPSym( hypre_StructMatrix *A, iP1 = iP - zOffsetP; rap_bc[iAc] = a_bc[iA] * pa[iP1] - + rb[iR] * a_cc[iAm1] * pa[iP1] - + rb[iR] * a_bc[iAm1]; + + rb[iR] * a_cc[iAm1] * pa[iP1] + + rb[iR] * a_bc[iAm1]; iP1 = iP - zOffsetP + xOffsetP; rap_be[iAc] = rb[iR] * a_ce[iAm1] * pa[iP1]; @@ -589,21 +595,21 @@ hypre_SMG3BuildRAPSym( hypre_StructMatrix *A, iP1 = iP - yOffsetP; rap_cs[iAc] = a_cs[iA] - + rb[iR] * a_cs[iAm1] * pb[iP1] - + ra[iR] * a_cs[iAp1] * pa[iP1]; + + rb[iR] * a_cs[iAm1] * pb[iP1] + + ra[iR] * a_cs[iAp1] * pa[iP1]; iP1 = iP - xOffsetP; rap_cw[iAc] = a_cw[iA] - + rb[iR] * a_cw[iAm1] * pb[iP1] - + ra[iR] * a_cw[iAp1] * pa[iP1]; + + rb[iR] * a_cw[iAm1] * pb[iP1] + + ra[iR] * a_cw[iAp1] * pa[iP1]; rap_cc[iAc] = a_cc[iA] - + rb[iR] * a_cc[iAm1] * pb[iP] - + ra[iR] * a_cc[iAp1] * pa[iP] - + rb[iR] * a_ac[iAm1] - + ra[iR] * a_bc[iAp1] - + a_bc[iA] * pb[iP] - + a_ac[iA] * pa[iP]; + + rb[iR] * a_cc[iAm1] * pb[iP] + + ra[iR] * a_cc[iAp1] * pa[iP] + + rb[iR] * a_ac[iAm1] + + ra[iR] * a_bc[iAp1] + + a_bc[iA] * pb[iP] + + a_ac[iA] * pa[iP]; } hypre_BoxLoop4End(iP, iR, iA, iAc); @@ -611,13 +617,13 @@ hypre_SMG3BuildRAPSym( hypre_StructMatrix *A, break; - /*-------------------------------------------------------------- - * Loop for symmetric 15-point fine grid operator; produces a - * symmetric 15-point coarse grid operator. We calculate only the - * lower triangular stencil entries: (below-south, below-west, - * below-center, below-east, below-north, center-south, - * center-west, and center-center). - *--------------------------------------------------------------*/ + /*-------------------------------------------------------------- + * Loop for symmetric 15-point fine grid operator; produces a + * symmetric 15-point coarse grid operator. We calculate only the + * lower triangular stencil entries: (below-south, below-west, + * below-center, below-east, below-north, center-south, + * center-west, and center-center). + *--------------------------------------------------------------*/ case 15: @@ -635,54 +641,54 @@ hypre_SMG3BuildRAPSym( hypre_StructMatrix *A, HYPRE_Int iP1 = iP - zOffsetP - yOffsetP; rap_bs[iAc] = rb[iR] * a_cs[iAm1] * pa[iP1] - + rb[iR] * a_bs[iAm1] - + a_bs[iA] * pa[iP1]; + + rb[iR] * a_bs[iAm1] + + a_bs[iA] * pa[iP1]; iP1 = iP - zOffsetP - xOffsetP; rap_bw[iAc] = rb[iR] * a_cw[iAm1] * pa[iP1] - + rb[iR] * a_bw[iAm1] - + a_bw[iA] * pa[iP1]; + + rb[iR] * a_bw[iAm1] + + a_bw[iA] * pa[iP1]; iP1 = iP - zOffsetP; rap_bc[iAc] = a_bc[iA] * pa[iP1] - + rb[iR] * a_cc[iAm1] * pa[iP1] - + rb[iR] * a_bc[iAm1]; + + rb[iR] * a_cc[iAm1] * pa[iP1] + + rb[iR] * a_bc[iAm1]; iP1 = iP - zOffsetP + xOffsetP; rap_be[iAc] = rb[iR] * a_ce[iAm1] * pa[iP1] - + rb[iR] * a_be[iAm1] - + a_be[iA] * pa[iP1]; + + rb[iR] * a_be[iAm1] + + a_be[iA] * pa[iP1]; iP1 = iP - zOffsetP + yOffsetP; rap_bn[iAc] = rb[iR] * a_cn[iAm1] * pa[iP1] - + rb[iR] * a_bn[iAm1] - + a_bn[iA] * pa[iP1]; + + rb[iR] * a_bn[iAm1] + + a_bn[iA] * pa[iP1]; iP1 = iP - yOffsetP; rap_cs[iAc] = a_cs[iA] - + rb[iR] * a_cs[iAm1] * pb[iP1] - + ra[iR] * a_cs[iAp1] * pa[iP1] - + a_bs[iA] * pb[iP1] - + a_as[iA] * pa[iP1] - + rb[iR] * a_as[iAm1] - + ra[iR] * a_bs[iAp1]; + + rb[iR] * a_cs[iAm1] * pb[iP1] + + ra[iR] * a_cs[iAp1] * pa[iP1] + + a_bs[iA] * pb[iP1] + + a_as[iA] * pa[iP1] + + rb[iR] * a_as[iAm1] + + ra[iR] * a_bs[iAp1]; iP1 = iP - xOffsetP; rap_cw[iAc] = a_cw[iA] - + rb[iR] * a_cw[iAm1] * pb[iP1] - + ra[iR] * a_cw[iAp1] * pa[iP1] - + a_bw[iA] * pb[iP1] - + a_aw[iA] * pa[iP1] - + rb[iR] * a_aw[iAm1] - + ra[iR] * a_bw[iAp1]; + + rb[iR] * a_cw[iAm1] * pb[iP1] + + ra[iR] * a_cw[iAp1] * pa[iP1] + + a_bw[iA] * pb[iP1] + + a_aw[iA] * pa[iP1] + + rb[iR] * a_aw[iAm1] + + ra[iR] * a_bw[iAp1]; rap_cc[iAc] = a_cc[iA] - + rb[iR] * a_cc[iAm1] * pb[iP] - + ra[iR] * a_cc[iAp1] * pa[iP] - + rb[iR] * a_ac[iAm1] - + ra[iR] * a_bc[iAp1] - + a_bc[iA] * pb[iP] - + a_ac[iA] * pa[iP]; + + rb[iR] * a_cc[iAm1] * pb[iP] + + ra[iR] * a_cc[iAp1] * pa[iP] + + rb[iR] * a_ac[iAm1] + + ra[iR] * a_bc[iAp1] + + a_bc[iA] * pb[iP] + + a_ac[iA] * pa[iP]; } hypre_BoxLoop4End(iP, iR, iA, iAc); @@ -690,14 +696,14 @@ hypre_SMG3BuildRAPSym( hypre_StructMatrix *A, break; - /*-------------------------------------------------------------- - * Loop for symmetric 19-point fine grid operator; produces a - * symmetric 27-point coarse grid operator. We calculate only the - * lower triangular stencil entries: (below-southwest, below-south, - * below-southeast, below-west, below-center, below-east, - * below-northwest, below-north, below-northeast, center-southwest, - * center-south, center-southeast, center-west, and center-center). - *--------------------------------------------------------------*/ + /*-------------------------------------------------------------- + * Loop for symmetric 19-point fine grid operator; produces a + * symmetric 27-point coarse grid operator. We calculate only the + * lower triangular stencil entries: (below-southwest, below-south, + * below-southeast, below-west, below-center, below-east, + * below-northwest, below-north, below-northeast, center-southwest, + * center-south, center-southeast, center-west, and center-center). + *--------------------------------------------------------------*/ case 19: @@ -718,73 +724,73 @@ hypre_SMG3BuildRAPSym( hypre_StructMatrix *A, iP1 = iP - zOffsetP - yOffsetP; rap_bs[iAc] = rb[iR] * a_cs[iAm1] * pa[iP1] - + rb[iR] * a_bs[iAm1] - + a_bs[iA] * pa[iP1]; + + rb[iR] * a_bs[iAm1] + + a_bs[iA] * pa[iP1]; iP1 = iP - zOffsetP - yOffsetP + xOffsetP; rap_bse[iAc] = rb[iR] * a_cse[iAm1] * pa[iP1]; iP1 = iP - zOffsetP - xOffsetP; rap_bw[iAc] = rb[iR] * a_cw[iAm1] * pa[iP1] - + rb[iR] * a_bw[iAm1] - + a_bw[iA] * pa[iP1]; + + rb[iR] * a_bw[iAm1] + + a_bw[iA] * pa[iP1]; iP1 = iP - zOffsetP; rap_bc[iAc] = a_bc[iA] * pa[iP1] - + rb[iR] * a_cc[iAm1] * pa[iP1] - + rb[iR] * a_bc[iAm1]; + + rb[iR] * a_cc[iAm1] * pa[iP1] + + rb[iR] * a_bc[iAm1]; iP1 = iP - zOffsetP + xOffsetP; rap_be[iAc] = rb[iR] * a_ce[iAm1] * pa[iP1] - + rb[iR] * a_be[iAm1] - + a_be[iA] * pa[iP1]; + + rb[iR] * a_be[iAm1] + + a_be[iA] * pa[iP1]; iP1 = iP - zOffsetP + yOffsetP - xOffsetP; rap_bnw[iAc] = rb[iR] * a_cnw[iAm1] * pa[iP1]; iP1 = iP - zOffsetP + yOffsetP; rap_bn[iAc] = rb[iR] * a_cn[iAm1] * pa[iP1] - + rb[iR] * a_bn[iAm1] - + a_bn[iA] * pa[iP1]; + + rb[iR] * a_bn[iAm1] + + a_bn[iA] * pa[iP1]; iP1 = iP - zOffsetP + yOffsetP + xOffsetP; rap_bne[iAc] = rb[iR] * a_cne[iAm1] * pa[iP1]; iP1 = iP - yOffsetP - xOffsetP; rap_csw[iAc] = a_csw[iA] - + rb[iR] * a_csw[iAm1] * pb[iP1] - + ra[iR] * a_csw[iAp1] * pa[iP1]; + + rb[iR] * a_csw[iAm1] * pb[iP1] + + ra[iR] * a_csw[iAp1] * pa[iP1]; iP1 = iP - yOffsetP; rap_cs[iAc] = a_cs[iA] - + rb[iR] * a_cs[iAm1] * pb[iP1] - + ra[iR] * a_cs[iAp1] * pa[iP1] - + a_bs[iA] * pb[iP1] - + a_as[iA] * pa[iP1] - + rb[iR] * a_as[iAm1] - + ra[iR] * a_bs[iAp1]; + + rb[iR] * a_cs[iAm1] * pb[iP1] + + ra[iR] * a_cs[iAp1] * pa[iP1] + + a_bs[iA] * pb[iP1] + + a_as[iA] * pa[iP1] + + rb[iR] * a_as[iAm1] + + ra[iR] * a_bs[iAp1]; iP1 = iP - yOffsetP + xOffsetP; rap_cse[iAc] = a_cse[iA] - + rb[iR] * a_cse[iAm1] * pb[iP1] - + ra[iR] * a_cse[iAp1] * pa[iP1]; + + rb[iR] * a_cse[iAm1] * pb[iP1] + + ra[iR] * a_cse[iAp1] * pa[iP1]; iP1 = iP - xOffsetP; rap_cw[iAc] = a_cw[iA] - + rb[iR] * a_cw[iAm1] * pb[iP1] - + ra[iR] * a_cw[iAp1] * pa[iP1] - + a_bw[iA] * pb[iP1] - + a_aw[iA] * pa[iP1] - + rb[iR] * a_aw[iAm1] - + ra[iR] * a_bw[iAp1]; + + rb[iR] * a_cw[iAm1] * pb[iP1] + + ra[iR] * a_cw[iAp1] * pa[iP1] + + a_bw[iA] * pb[iP1] + + a_aw[iA] * pa[iP1] + + rb[iR] * a_aw[iAm1] + + ra[iR] * a_bw[iAp1]; rap_cc[iAc] = a_cc[iA] - + rb[iR] * a_cc[iAm1] * pb[iP] - + ra[iR] * a_cc[iAp1] * pa[iP] - + rb[iR] * a_ac[iAm1] - + ra[iR] * a_bc[iAp1] - + a_bc[iA] * pb[iP] - + a_ac[iA] * pa[iP]; + + rb[iR] * a_cc[iAm1] * pb[iP] + + ra[iR] * a_cc[iAp1] * pa[iP] + + rb[iR] * a_ac[iAm1] + + ra[iR] * a_bc[iAp1] + + a_bc[iA] * pb[iP] + + a_ac[iA] * pa[iP]; } hypre_BoxLoop4End(iP, iR, iA, iAc); @@ -792,14 +798,14 @@ hypre_SMG3BuildRAPSym( hypre_StructMatrix *A, break; - /*-------------------------------------------------------------- - * Loop for symmetric 27-point fine grid operator; produces a - * symmetric 27-point coarse grid operator. We calculate only the - * lower triangular stencil entries: (below-southwest, below-south, - * below-southeast, below-west, below-center, below-east, - * below-northwest, below-north, below-northeast, center-southwest, - * center-south, center-southeast, center-west, and center-center). - *--------------------------------------------------------------*/ + /*-------------------------------------------------------------- + * Loop for symmetric 27-point fine grid operator; produces a + * symmetric 27-point coarse grid operator. We calculate only the + * lower triangular stencil entries: (below-southwest, below-south, + * below-southeast, below-west, below-center, below-east, + * below-northwest, below-north, below-northeast, center-southwest, + * center-south, center-southeast, center-west, and center-center). + *--------------------------------------------------------------*/ default: @@ -817,92 +823,92 @@ hypre_SMG3BuildRAPSym( hypre_StructMatrix *A, HYPRE_Int iP1 = iP - zOffsetP - yOffsetP - xOffsetP; rap_bsw[iAc] = rb[iR] * a_csw[iAm1] * pa[iP1] - + rb[iR] * a_bsw[iAm1] - + a_bsw[iA] * pa[iP1]; + + rb[iR] * a_bsw[iAm1] + + a_bsw[iA] * pa[iP1]; iP1 = iP - zOffsetP - yOffsetP; rap_bs[iAc] = rb[iR] * a_cs[iAm1] * pa[iP1] - + rb[iR] * a_bs[iAm1] - + a_bs[iA] * pa[iP1]; + + rb[iR] * a_bs[iAm1] + + a_bs[iA] * pa[iP1]; iP1 = iP - zOffsetP - yOffsetP + xOffsetP; rap_bse[iAc] = rb[iR] * a_cse[iAm1] * pa[iP1] - + rb[iR] * a_bse[iAm1] - + a_bse[iA] * pa[iP1]; + + rb[iR] * a_bse[iAm1] + + a_bse[iA] * pa[iP1]; iP1 = iP - zOffsetP - xOffsetP; rap_bw[iAc] = rb[iR] * a_cw[iAm1] * pa[iP1] - + rb[iR] * a_bw[iAm1] - + a_bw[iA] * pa[iP1]; + + rb[iR] * a_bw[iAm1] + + a_bw[iA] * pa[iP1]; iP1 = iP - zOffsetP; rap_bc[iAc] = a_bc[iA] * pa[iP1] - + rb[iR] * a_cc[iAm1] * pa[iP1] - + rb[iR] * a_bc[iAm1]; + + rb[iR] * a_cc[iAm1] * pa[iP1] + + rb[iR] * a_bc[iAm1]; iP1 = iP - zOffsetP + xOffsetP; rap_be[iAc] = rb[iR] * a_ce[iAm1] * pa[iP1] - + rb[iR] * a_be[iAm1] - + a_be[iA] * pa[iP1]; + + rb[iR] * a_be[iAm1] + + a_be[iA] * pa[iP1]; iP1 = iP - zOffsetP + yOffsetP - xOffsetP; rap_bnw[iAc] = rb[iR] * a_cnw[iAm1] * pa[iP1] - + rb[iR] * a_bnw[iAm1] - + a_bnw[iA] * pa[iP1]; + + rb[iR] * a_bnw[iAm1] + + a_bnw[iA] * pa[iP1]; iP1 = iP - zOffsetP + yOffsetP; rap_bn[iAc] = rb[iR] * a_cn[iAm1] * pa[iP1] - + rb[iR] * a_bn[iAm1] - + a_bn[iA] * pa[iP1]; + + rb[iR] * a_bn[iAm1] + + a_bn[iA] * pa[iP1]; iP1 = iP - zOffsetP + yOffsetP + xOffsetP; rap_bne[iAc] = rb[iR] * a_cne[iAm1] * pa[iP1] - + rb[iR] * a_bne[iAm1] - + a_bne[iA] * pa[iP1]; + + rb[iR] * a_bne[iAm1] + + a_bne[iA] * pa[iP1]; iP1 = iP - yOffsetP - xOffsetP; rap_csw[iAc] = a_csw[iA] - + rb[iR] * a_csw[iAm1] * pb[iP1] - + ra[iR] * a_csw[iAp1] * pa[iP1] - + a_bsw[iA] * pb[iP1] - + a_asw[iA] * pa[iP1] - + rb[iR] * a_asw[iAm1] - + ra[iR] * a_bsw[iAp1]; + + rb[iR] * a_csw[iAm1] * pb[iP1] + + ra[iR] * a_csw[iAp1] * pa[iP1] + + a_bsw[iA] * pb[iP1] + + a_asw[iA] * pa[iP1] + + rb[iR] * a_asw[iAm1] + + ra[iR] * a_bsw[iAp1]; iP1 = iP - yOffsetP; rap_cs[iAc] = a_cs[iA] - + rb[iR] * a_cs[iAm1] * pb[iP1] - + ra[iR] * a_cs[iAp1] * pa[iP1] - + a_bs[iA] * pb[iP1] - + a_as[iA] * pa[iP1] - + rb[iR] * a_as[iAm1] - + ra[iR] * a_bs[iAp1]; + + rb[iR] * a_cs[iAm1] * pb[iP1] + + ra[iR] * a_cs[iAp1] * pa[iP1] + + a_bs[iA] * pb[iP1] + + a_as[iA] * pa[iP1] + + rb[iR] * a_as[iAm1] + + ra[iR] * a_bs[iAp1]; iP1 = iP - yOffsetP + xOffsetP; rap_cse[iAc] = a_cse[iA] - + rb[iR] * a_cse[iAm1] * pb[iP1] - + ra[iR] * a_cse[iAp1] * pa[iP1] - + a_bse[iA] * pb[iP1] - + a_ase[iA] * pa[iP1] - + rb[iR] * a_ase[iAm1] - + ra[iR] * a_bse[iAp1]; + + rb[iR] * a_cse[iAm1] * pb[iP1] + + ra[iR] * a_cse[iAp1] * pa[iP1] + + a_bse[iA] * pb[iP1] + + a_ase[iA] * pa[iP1] + + rb[iR] * a_ase[iAm1] + + ra[iR] * a_bse[iAp1]; iP1 = iP - xOffsetP; rap_cw[iAc] = a_cw[iA] - + rb[iR] * a_cw[iAm1] * pb[iP1] - + ra[iR] * a_cw[iAp1] * pa[iP1] - + a_bw[iA] * pb[iP1] - + a_aw[iA] * pa[iP1] - + rb[iR] * a_aw[iAm1] - + ra[iR] * a_bw[iAp1]; + + rb[iR] * a_cw[iAm1] * pb[iP1] + + ra[iR] * a_cw[iAp1] * pa[iP1] + + a_bw[iA] * pb[iP1] + + a_aw[iA] * pa[iP1] + + rb[iR] * a_aw[iAm1] + + ra[iR] * a_bw[iAp1]; rap_cc[iAc] = a_cc[iA] - + rb[iR] * a_cc[iAm1] * pb[iP] - + ra[iR] * a_cc[iAp1] * pa[iP] - + rb[iR] * a_ac[iAm1] - + ra[iR] * a_bc[iAp1] - + a_bc[iA] * pb[iP] - + a_ac[iA] * pa[iP]; + + rb[iR] * a_cc[iAm1] * pb[iP] + + ra[iR] * a_cc[iAp1] * pa[iP] + + rb[iR] * a_ac[iAm1] + + ra[iR] * a_bc[iAp1] + + a_bc[iA] * pb[iP] + + a_ac[iA] * pa[iP]; } hypre_BoxLoop4End(iP, iR, iA, iAc); @@ -958,16 +964,20 @@ hypre_SMG3BuildRAPNoSym( hypre_StructMatrix *A, HYPRE_Real *ra, *rb; HYPRE_Real *a_cc, *a_cw, *a_ce, *a_cs, *a_cn; - HYPRE_Real *a_ac, *a_aw, *a_ae, *a_as, *a_an; - HYPRE_Real *a_be, *a_bn; - HYPRE_Real *a_csw, *a_cse, *a_cnw, *a_cne; - HYPRE_Real *a_asw, *a_ase, *a_anw, *a_ane; - HYPRE_Real *a_bnw, *a_bne; + HYPRE_Real *a_ac, *a_aw = NULL, *a_ae = NULL; + HYPRE_Real *a_as = NULL, *a_an = NULL; + HYPRE_Real *a_be = NULL, *a_bn = NULL; + HYPRE_Real *a_csw = NULL, *a_cse = NULL; + HYPRE_Real *a_cnw = NULL, *a_cne = NULL; + HYPRE_Real *a_asw = NULL, *a_ase = NULL; + HYPRE_Real *a_anw = NULL, *a_ane = NULL; + HYPRE_Real *a_bnw = NULL, *a_bne = NULL; HYPRE_Real *rap_ce, *rap_cn; HYPRE_Real *rap_ac, *rap_aw, *rap_ae, *rap_as, *rap_an; - HYPRE_Real *rap_cnw, *rap_cne; - HYPRE_Real *rap_asw, *rap_ase, *rap_anw, *rap_ane; + HYPRE_Real *rap_cnw = NULL, *rap_cne = NULL; + HYPRE_Real *rap_asw = NULL, *rap_ase = NULL; + HYPRE_Real *rap_anw = NULL, *rap_ane = NULL; HYPRE_Int zOffsetA; HYPRE_Int xOffsetP; @@ -1011,10 +1021,10 @@ hypre_SMG3BuildRAPNoSym( hypre_StructMatrix *A, * pb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index,0,0,1); + hypre_SetIndex3(index, 0, 0, 1); pa = hypre_StructMatrixExtractPointerByIndex(PT, fi, index); - hypre_SetIndex3(index,0,0,-1); + hypre_SetIndex3(index, 0, 0, -1); pb = hypre_StructMatrixExtractPointerByIndex(PT, fi, index); @@ -1024,10 +1034,10 @@ hypre_SMG3BuildRAPNoSym( hypre_StructMatrix *A, * rb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index,0,0,1); + hypre_SetIndex3(index, 0, 0, 1); ra = hypre_StructMatrixExtractPointerByIndex(R, fi, index); - hypre_SetIndex3(index,0,0,-1); + hypre_SetIndex3(index, 0, 0, -1); rb = hypre_StructMatrixExtractPointerByIndex(R, fi, index); @@ -1043,22 +1053,22 @@ hypre_SMG3BuildRAPNoSym( hypre_StructMatrix *A, * a_bc is pointer for center coefficient in plane below *-----------------------------------------------------------------*/ - hypre_SetIndex3(index,0,0,0); + hypre_SetIndex3(index, 0, 0, 0); a_cc = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,-1,0,0); + hypre_SetIndex3(index, -1, 0, 0); a_cw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,1,0,0); + hypre_SetIndex3(index, 1, 0, 0); a_ce = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,0,-1,0); + hypre_SetIndex3(index, 0, -1, 0); a_cs = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,0,1,0); + hypre_SetIndex3(index, 0, 1, 0); a_cn = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,0,0,1); + hypre_SetIndex3(index, 0, 0, 1); a_ac = hypre_StructMatrixExtractPointerByIndex(A, fi, index); /*----------------------------------------------------------------- @@ -1074,26 +1084,25 @@ hypre_SMG3BuildRAPNoSym( hypre_StructMatrix *A, * a_bn is pointer for north coefficient in plane below *-----------------------------------------------------------------*/ - if(fine_stencil_size > 7) + if (fine_stencil_size > 7) { - hypre_SetIndex3(index,-1,0,1); + hypre_SetIndex3(index, -1, 0, 1); a_aw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,1,0,1); + hypre_SetIndex3(index, 1, 0, 1); a_ae = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,0,-1,1); + hypre_SetIndex3(index, 0, -1, 1); a_as = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,0,1,1); + hypre_SetIndex3(index, 0, 1, 1); a_an = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,1,0,-1); + hypre_SetIndex3(index, 1, 0, -1); a_be = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,0,1,-1); + hypre_SetIndex3(index, 0, 1, -1); a_bn = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - } /*----------------------------------------------------------------- @@ -1105,20 +1114,19 @@ hypre_SMG3BuildRAPNoSym( hypre_StructMatrix *A, * a_cne is pointer for northeast coefficient in same plane *-----------------------------------------------------------------*/ - if(fine_stencil_size > 15) + if (fine_stencil_size > 15) { - hypre_SetIndex3(index,-1,-1,0); + hypre_SetIndex3(index, -1, -1, 0); a_csw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,1,-1,0); + hypre_SetIndex3(index, 1, -1, 0); a_cse = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,-1,1,0); + hypre_SetIndex3(index, -1, 1, 0); a_cnw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,1,1,0); + hypre_SetIndex3(index, 1, 1, 0); a_cne = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - } /*----------------------------------------------------------------- @@ -1134,26 +1142,25 @@ hypre_SMG3BuildRAPNoSym( hypre_StructMatrix *A, * a_bne is pointer for northeast coefficient in plane below *-----------------------------------------------------------------*/ - if(fine_stencil_size > 19) + if (fine_stencil_size > 19) { - hypre_SetIndex3(index,-1,-1,1); + hypre_SetIndex3(index, -1, -1, 1); a_asw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,1,-1,1); + hypre_SetIndex3(index, 1, -1, 1); a_ase = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,-1,1,1); + hypre_SetIndex3(index, -1, 1, 1); a_anw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,1,1,1); + hypre_SetIndex3(index, 1, 1, 1); a_ane = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,-1,1,-1); + hypre_SetIndex3(index, -1, 1, -1); a_bnw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index,1,1,-1); + hypre_SetIndex3(index, 1, 1, -1); a_bne = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - } /*----------------------------------------------------------------- @@ -1164,25 +1171,25 @@ hypre_SMG3BuildRAPNoSym( hypre_StructMatrix *A, * rap_ce is pointer for east coefficient in same plane (etc.) *-----------------------------------------------------------------*/ - hypre_SetIndex3(index,1,0,0); + hypre_SetIndex3(index, 1, 0, 0); rap_ce = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,0,1,0); + hypre_SetIndex3(index, 0, 1, 0); rap_cn = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,0,0,1); + hypre_SetIndex3(index, 0, 0, 1); rap_ac = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,-1,0,1); + hypre_SetIndex3(index, -1, 0, 1); rap_aw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,1,0,1); + hypre_SetIndex3(index, 1, 0, 1); rap_ae = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,0,-1,1); + hypre_SetIndex3(index, 0, -1, 1); rap_as = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,0,1,1); + hypre_SetIndex3(index, 0, 1, 1); rap_an = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); /*----------------------------------------------------------------- @@ -1196,29 +1203,29 @@ hypre_SMG3BuildRAPNoSym( hypre_StructMatrix *A, * rap_cnw is pointer for northwest coefficient in same plane (etc.) *-----------------------------------------------------------------*/ - if(fine_stencil_size > 15) + if (fine_stencil_size > 15) { - hypre_SetIndex3(index,-1,1,0); + hypre_SetIndex3(index, -1, 1, 0); rap_cnw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,1,1,0); + hypre_SetIndex3(index, 1, 1, 0); rap_cne = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,-1,-1,1); + hypre_SetIndex3(index, -1, -1, 1); rap_asw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,1,-1,1); + hypre_SetIndex3(index, 1, -1, 1); rap_ase = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,-1,1,1); + hypre_SetIndex3(index, -1, 1, 1); rap_anw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,1,1,1); + hypre_SetIndex3(index, 1, 1, 1); rap_ane = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); @@ -1232,13 +1239,13 @@ hypre_SMG3BuildRAPNoSym( hypre_StructMatrix *A, * Offsets are used in refering to data associated with other points. *-----------------------------------------------------------------*/ - hypre_SetIndex3(index,0,0,1); - zOffsetA = hypre_BoxOffsetDistance(A_dbox,index); - zOffsetP = hypre_BoxOffsetDistance(PT_dbox,index); - hypre_SetIndex3(index,0,1,0); - yOffsetP = hypre_BoxOffsetDistance(PT_dbox,index); - hypre_SetIndex3(index,1,0,0); - xOffsetP = hypre_BoxOffsetDistance(PT_dbox,index); + hypre_SetIndex3(index, 0, 0, 1); + zOffsetA = hypre_BoxOffsetDistance(A_dbox, index); + zOffsetP = hypre_BoxOffsetDistance(PT_dbox, index); + hypre_SetIndex3(index, 0, 1, 0); + yOffsetP = hypre_BoxOffsetDistance(PT_dbox, index); + hypre_SetIndex3(index, 1, 0, 0); + xOffsetP = hypre_BoxOffsetDistance(PT_dbox, index); /*----------------------------------------------------------------- * Switch statement to direct control to apropriate BoxLoop depending @@ -1277,8 +1284,8 @@ hypre_SMG3BuildRAPNoSym( hypre_StructMatrix *A, iP1 = iP + zOffsetP; rap_ac[iAc] = a_ac[iA] * pb[iP1] - + ra[iR] * a_cc[iAp1] * pb[iP1] - + ra[iR] * a_ac[iAp1]; + + ra[iR] * a_cc[iAp1] * pb[iP1] + + ra[iR] * a_ac[iAp1]; iP1 = iP + zOffsetP - xOffsetP; rap_aw[iAc] = ra[iR] * a_cw[iAp1] * pb[iP1]; @@ -1288,13 +1295,13 @@ hypre_SMG3BuildRAPNoSym( hypre_StructMatrix *A, iP1 = iP + yOffsetP; rap_cn[iAc] = a_cn[iA] - + rb[iR] * a_cn[iAm1] * pb[iP1] - + ra[iR] * a_cn[iAp1] * pa[iP1]; + + rb[iR] * a_cn[iAm1] * pb[iP1] + + ra[iR] * a_cn[iAp1] * pa[iP1]; iP1 = iP + xOffsetP; rap_ce[iAc] = a_ce[iA] - + rb[iR] * a_ce[iAm1] * pb[iP1] - + ra[iR] * a_ce[iAp1] * pa[iP1]; + + rb[iR] * a_ce[iAm1] * pb[iP1] + + ra[iR] * a_ce[iAp1] * pa[iP1]; } hypre_BoxLoop4End(iP, iR, iA, iAc); @@ -1302,12 +1309,12 @@ hypre_SMG3BuildRAPNoSym( hypre_StructMatrix *A, break; - /*-------------------------------------------------------------- - * Loop for 15-point fine grid operator; produces upper triangular - * part of 15-point coarse grid operator. stencil entries: - * (above-north, above-east, above-center, above-west, - * above-south, center-north, and center-east). - *--------------------------------------------------------------*/ + /*-------------------------------------------------------------- + * Loop for 15-point fine grid operator; produces upper triangular + * part of 15-point coarse grid operator. stencil entries: + * (above-north, above-east, above-center, above-west, + * above-south, center-north, and center-east). + *--------------------------------------------------------------*/ case 15: @@ -1325,46 +1332,46 @@ hypre_SMG3BuildRAPNoSym( hypre_StructMatrix *A, HYPRE_Int iP1 = iP + zOffsetP + yOffsetP; rap_an[iAc] = ra[iR] * a_cn[iAp1] * pb[iP1] - + ra[iR] * a_an[iAp1] - + a_an[iA] * pb[iP1]; + + ra[iR] * a_an[iAp1] + + a_an[iA] * pb[iP1]; iP1 = iP + zOffsetP + xOffsetP; rap_ae[iAc] = ra[iR] * a_ce[iAp1] * pb[iP1] - + ra[iR] * a_ae[iAp1] - + a_ae[iA] * pb[iP1]; + + ra[iR] * a_ae[iAp1] + + a_ae[iA] * pb[iP1]; iP1 = iP + zOffsetP; rap_ac[iAc] = a_ac[iA] * pb[iP1] - + ra[iR] * a_cc[iAp1] * pb[iP1] - + ra[iR] * a_ac[iAp1]; + + ra[iR] * a_cc[iAp1] * pb[iP1] + + ra[iR] * a_ac[iAp1]; iP1 = iP + zOffsetP - xOffsetP; rap_aw[iAc] = ra[iR] * a_cw[iAp1] * pb[iP1] - + ra[iR] * a_aw[iAp1] - + a_aw[iA] * pb[iP1]; + + ra[iR] * a_aw[iAp1] + + a_aw[iA] * pb[iP1]; iP1 = iP + zOffsetP - yOffsetP; rap_as[iAc] = ra[iR] * a_cs[iAp1] * pb[iP1] - + ra[iR] * a_as[iAp1] - + a_as[iA] * pb[iP1]; + + ra[iR] * a_as[iAp1] + + a_as[iA] * pb[iP1]; iP1 = iP + yOffsetP; rap_cn[iAc] = a_cn[iA] - + rb[iR] * a_cn[iAm1] * pb[iP1] - + ra[iR] * a_cn[iAp1] * pa[iP1] - + a_bn[iA] * pb[iP1] - + a_an[iA] * pa[iP1] - + rb[iR] * a_an[iAm1] - + ra[iR] * a_bn[iAp1]; + + rb[iR] * a_cn[iAm1] * pb[iP1] + + ra[iR] * a_cn[iAp1] * pa[iP1] + + a_bn[iA] * pb[iP1] + + a_an[iA] * pa[iP1] + + rb[iR] * a_an[iAm1] + + ra[iR] * a_bn[iAp1]; iP1 = iP + xOffsetP; rap_ce[iAc] = a_ce[iA] - + rb[iR] * a_ce[iAm1] * pb[iP1] - + ra[iR] * a_ce[iAp1] * pa[iP1] - + a_be[iA] * pb[iP1] - + a_ae[iA] * pa[iP1] - + rb[iR] * a_ae[iAm1] - + ra[iR] * a_be[iAp1]; + + rb[iR] * a_ce[iAm1] * pb[iP1] + + ra[iR] * a_ce[iAp1] * pa[iP1] + + a_be[iA] * pb[iP1] + + a_ae[iA] * pa[iP1] + + rb[iR] * a_ae[iAm1] + + ra[iR] * a_be[iAp1]; } hypre_BoxLoop4End(iP, iR, iA, iAc); @@ -1373,14 +1380,14 @@ hypre_SMG3BuildRAPNoSym( hypre_StructMatrix *A, break; - /*-------------------------------------------------------------- - * Loop for 19-point fine grid operator; produces upper triangular - * part of 27-point coarse grid operator. stencil entries: - * (above-northeast, above-north, above-northwest, above-east, - * above-center, above-west, above-southeast, above-south, - * above-southwest, center-northeast, center-north, - * center-northwest, and center-east). - *--------------------------------------------------------------*/ + /*-------------------------------------------------------------- + * Loop for 19-point fine grid operator; produces upper triangular + * part of 27-point coarse grid operator. stencil entries: + * (above-northeast, above-north, above-northwest, above-east, + * above-center, above-west, above-southeast, above-south, + * above-southwest, center-northeast, center-north, + * center-northwest, and center-east). + *--------------------------------------------------------------*/ case 19: @@ -1401,65 +1408,65 @@ hypre_SMG3BuildRAPNoSym( hypre_StructMatrix *A, iP1 = iP + zOffsetP + yOffsetP; rap_an[iAc] = ra[iR] * a_cn[iAp1] * pb[iP1] - + ra[iR] * a_an[iAp1] - + a_an[iA] * pb[iP1]; + + ra[iR] * a_an[iAp1] + + a_an[iA] * pb[iP1]; iP1 = iP + zOffsetP + yOffsetP - xOffsetP; rap_anw[iAc] = ra[iR] * a_cnw[iAp1] * pb[iP1]; iP1 = iP + zOffsetP + xOffsetP; rap_ae[iAc] = ra[iR] * a_ce[iAp1] * pb[iP1] - + ra[iR] * a_ae[iAp1] - + a_ae[iA] * pb[iP1]; + + ra[iR] * a_ae[iAp1] + + a_ae[iA] * pb[iP1]; iP1 = iP + zOffsetP; rap_ac[iAc] = a_ac[iA] * pb[iP1] - + ra[iR] * a_cc[iAp1] * pb[iP1] - + ra[iR] * a_ac[iAp1]; + + ra[iR] * a_cc[iAp1] * pb[iP1] + + ra[iR] * a_ac[iAp1]; iP1 = iP + zOffsetP - xOffsetP; rap_aw[iAc] = ra[iR] * a_cw[iAp1] * pb[iP1] - + ra[iR] * a_aw[iAp1] - + a_aw[iA] * pb[iP1]; + + ra[iR] * a_aw[iAp1] + + a_aw[iA] * pb[iP1]; iP1 = iP + zOffsetP - yOffsetP + xOffsetP; rap_ase[iAc] = ra[iR] * a_cse[iAp1] * pb[iP1]; iP1 = iP + zOffsetP - yOffsetP; rap_as[iAc] = ra[iR] * a_cs[iAp1] * pb[iP1] - + ra[iR] * a_as[iAp1] - + a_as[iA] * pb[iP1]; + + ra[iR] * a_as[iAp1] + + a_as[iA] * pb[iP1]; iP1 = iP + zOffsetP - yOffsetP - xOffsetP; rap_asw[iAc] = ra[iR] * a_csw[iAp1] * pb[iP1]; iP1 = iP + yOffsetP + xOffsetP; rap_cne[iAc] = a_cne[iA] - + rb[iR] * a_cne[iAm1] * pb[iP1] - + ra[iR] * a_cne[iAp1] * pa[iP1]; + + rb[iR] * a_cne[iAm1] * pb[iP1] + + ra[iR] * a_cne[iAp1] * pa[iP1]; iP1 = iP + yOffsetP; rap_cn[iAc] = a_cn[iA] - + rb[iR] * a_cn[iAm1] * pb[iP1] - + ra[iR] * a_cn[iAp1] * pa[iP1] - + a_bn[iA] * pb[iP1] - + a_an[iA] * pa[iP1] - + rb[iR] * a_an[iAm1] - + ra[iR] * a_bn[iAp1]; + + rb[iR] * a_cn[iAm1] * pb[iP1] + + ra[iR] * a_cn[iAp1] * pa[iP1] + + a_bn[iA] * pb[iP1] + + a_an[iA] * pa[iP1] + + rb[iR] * a_an[iAm1] + + ra[iR] * a_bn[iAp1]; iP1 = iP + yOffsetP - xOffsetP; rap_cnw[iAc] = a_cnw[iA] - + rb[iR] * a_cnw[iAm1] * pb[iP1] - + ra[iR] * a_cnw[iAp1] * pa[iP1]; + + rb[iR] * a_cnw[iAm1] * pb[iP1] + + ra[iR] * a_cnw[iAp1] * pa[iP1]; iP1 = iP + xOffsetP; rap_ce[iAc] = a_ce[iA] - + rb[iR] * a_ce[iAm1] * pb[iP1] - + ra[iR] * a_ce[iAp1] * pa[iP1] - + a_be[iA] * pb[iP1] - + a_ae[iA] * pa[iP1] - + rb[iR] * a_ae[iAm1] - + ra[iR] * a_be[iAp1]; + + rb[iR] * a_ce[iAm1] * pb[iP1] + + ra[iR] * a_ce[iAp1] * pa[iP1] + + a_be[iA] * pb[iP1] + + a_ae[iA] * pa[iP1] + + rb[iR] * a_ae[iAm1] + + ra[iR] * a_be[iAp1]; } hypre_BoxLoop4End(iP, iR, iA, iAc); @@ -1467,14 +1474,14 @@ hypre_SMG3BuildRAPNoSym( hypre_StructMatrix *A, break; - /*-------------------------------------------------------------- - * Loop for 27-point fine grid operator; produces upper triangular - * part of 27-point coarse grid operator. stencil entries: - * (above-northeast, above-north, above-northwest, above-east, - * above-center, above-west, above-southeast, above-south, - * above-southwest, center-northeast, center-north, - * center-northwest, and center-east). - *--------------------------------------------------------------*/ + /*-------------------------------------------------------------- + * Loop for 27-point fine grid operator; produces upper triangular + * part of 27-point coarse grid operator. stencil entries: + * (above-northeast, above-north, above-northwest, above-east, + * above-center, above-west, above-southeast, above-south, + * above-southwest, center-northeast, center-north, + * center-northwest, and center-east). + *--------------------------------------------------------------*/ default: @@ -1492,85 +1499,85 @@ hypre_SMG3BuildRAPNoSym( hypre_StructMatrix *A, HYPRE_Int iP1 = iP + zOffsetP + yOffsetP + xOffsetP; rap_ane[iAc] = ra[iR] * a_cne[iAp1] * pb[iP1] - + ra[iR] * a_ane[iAp1] - + a_ane[iA] * pb[iP1]; + + ra[iR] * a_ane[iAp1] + + a_ane[iA] * pb[iP1]; iP1 = iP + zOffsetP + yOffsetP; rap_an[iAc] = ra[iR] * a_cn[iAp1] * pb[iP1] - + ra[iR] * a_an[iAp1] - + a_an[iA] * pb[iP1]; + + ra[iR] * a_an[iAp1] + + a_an[iA] * pb[iP1]; iP1 = iP + zOffsetP + yOffsetP - xOffsetP; rap_anw[iAc] = ra[iR] * a_cnw[iAp1] * pb[iP1] - + ra[iR] * a_anw[iAp1] - + a_anw[iA] * pb[iP1]; + + ra[iR] * a_anw[iAp1] + + a_anw[iA] * pb[iP1]; iP1 = iP + zOffsetP + xOffsetP; rap_ae[iAc] = ra[iR] * a_ce[iAp1] * pb[iP1] - + ra[iR] * a_ae[iAp1] - + a_ae[iA] * pb[iP1]; + + ra[iR] * a_ae[iAp1] + + a_ae[iA] * pb[iP1]; iP1 = iP + zOffsetP; rap_ac[iAc] = a_ac[iA] * pb[iP1] - + ra[iR] * a_cc[iAp1] * pb[iP1] - + ra[iR] * a_ac[iAp1]; + + ra[iR] * a_cc[iAp1] * pb[iP1] + + ra[iR] * a_ac[iAp1]; iP1 = iP + zOffsetP - xOffsetP; rap_aw[iAc] = ra[iR] * a_cw[iAp1] * pb[iP1] - + ra[iR] * a_aw[iAp1] - + a_aw[iA] * pb[iP1]; + + ra[iR] * a_aw[iAp1] + + a_aw[iA] * pb[iP1]; iP1 = iP + zOffsetP - yOffsetP + xOffsetP; rap_ase[iAc] = ra[iR] * a_cse[iAp1] * pb[iP1] - + ra[iR] * a_ase[iAp1] - + a_ase[iA] * pb[iP1]; + + ra[iR] * a_ase[iAp1] + + a_ase[iA] * pb[iP1]; iP1 = iP + zOffsetP - yOffsetP; rap_as[iAc] = ra[iR] * a_cs[iAp1] * pb[iP1] - + ra[iR] * a_as[iAp1] - + a_as[iA] * pb[iP1]; + + ra[iR] * a_as[iAp1] + + a_as[iA] * pb[iP1]; iP1 = iP + zOffsetP - yOffsetP - xOffsetP; rap_asw[iAc] = ra[iR] * a_csw[iAp1] * pb[iP1] - + ra[iR] * a_asw[iAp1] - + a_asw[iA] * pb[iP1]; + + ra[iR] * a_asw[iAp1] + + a_asw[iA] * pb[iP1]; iP1 = iP + yOffsetP + xOffsetP; rap_cne[iAc] = a_cne[iA] - + rb[iR] * a_cne[iAm1] * pb[iP1] - + ra[iR] * a_cne[iAp1] * pa[iP1] - + a_bne[iA] * pb[iP1] - + a_ane[iA] * pa[iP1] - + rb[iR] * a_ane[iAm1] - + ra[iR] * a_bne[iAp1]; + + rb[iR] * a_cne[iAm1] * pb[iP1] + + ra[iR] * a_cne[iAp1] * pa[iP1] + + a_bne[iA] * pb[iP1] + + a_ane[iA] * pa[iP1] + + rb[iR] * a_ane[iAm1] + + ra[iR] * a_bne[iAp1]; iP1 = iP + yOffsetP; rap_cn[iAc] = a_cn[iA] - + rb[iR] * a_cn[iAm1] * pb[iP1] - + ra[iR] * a_cn[iAp1] * pa[iP1] - + a_bn[iA] * pb[iP1] - + a_an[iA] * pa[iP1] - + rb[iR] * a_an[iAm1] - + ra[iR] * a_bn[iAp1]; + + rb[iR] * a_cn[iAm1] * pb[iP1] + + ra[iR] * a_cn[iAp1] * pa[iP1] + + a_bn[iA] * pb[iP1] + + a_an[iA] * pa[iP1] + + rb[iR] * a_an[iAm1] + + ra[iR] * a_bn[iAp1]; iP1 = iP + yOffsetP - xOffsetP; rap_cnw[iAc] = a_cnw[iA] - + rb[iR] * a_cnw[iAm1] * pb[iP1] - + ra[iR] * a_cnw[iAp1] * pa[iP1] - + a_bnw[iA] * pb[iP1] - + a_anw[iA] * pa[iP1] - + rb[iR] * a_anw[iAm1] - + ra[iR] * a_bnw[iAp1]; + + rb[iR] * a_cnw[iAm1] * pb[iP1] + + ra[iR] * a_cnw[iAp1] * pa[iP1] + + a_bnw[iA] * pb[iP1] + + a_anw[iA] * pa[iP1] + + rb[iR] * a_anw[iAm1] + + ra[iR] * a_bnw[iAp1]; iP1 = iP + xOffsetP; rap_ce[iAc] = a_ce[iA] - + rb[iR] * a_ce[iAm1] * pb[iP1] - + ra[iR] * a_ce[iAp1] * pa[iP1] - + a_be[iA] * pb[iP1] - + a_ae[iA] * pa[iP1] - + rb[iR] * a_ae[iAm1] - + ra[iR] * a_be[iAp1]; + + rb[iR] * a_ce[iAm1] * pb[iP1] + + ra[iR] * a_ce[iAp1] * pa[iP1] + + a_be[iA] * pb[iP1] + + a_ae[iA] * pa[iP1] + + rb[iR] * a_ae[iAm1] + + ra[iR] * a_be[iAp1]; } hypre_BoxLoop4End(iP, iR, iA, iAc); @@ -1596,6 +1603,8 @@ hypre_SMG3RAPPeriodicSym( hypre_StructMatrix *RAP, hypre_Index cstride ) { + HYPRE_UNUSED_VAR(cindex); + HYPRE_UNUSED_VAR(cstride); hypre_Index index; @@ -1612,8 +1621,9 @@ hypre_SMG3RAPPeriodicSym( hypre_StructMatrix *RAP, HYPRE_Real *rap_bc, *rap_bw, *rap_be, *rap_bs, *rap_bn; HYPRE_Real *rap_cc, *rap_cw, *rap_cs; - HYPRE_Real *rap_bsw, *rap_bse, *rap_bnw, *rap_bne; - HYPRE_Real *rap_csw, *rap_cse; + HYPRE_Real *rap_bsw = NULL, *rap_bse = NULL; + HYPRE_Real *rap_bnw = NULL, *rap_bne = NULL; + HYPRE_Real *rap_csw = NULL, *rap_cse = NULL; HYPRE_Int xOffset; HYPRE_Int yOffset; @@ -1643,62 +1653,62 @@ hypre_SMG3RAPPeriodicSym( hypre_StructMatrix *RAP, RAP_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(RAP), ci); - hypre_SetIndex3(index,1,0,0); - xOffset = hypre_BoxOffsetDistance(RAP_dbox,index); - hypre_SetIndex3(index,0,1,0); - yOffset = hypre_BoxOffsetDistance(RAP_dbox,index); + hypre_SetIndex3(index, 1, 0, 0); + xOffset = hypre_BoxOffsetDistance(RAP_dbox, index); + hypre_SetIndex3(index, 0, 1, 0); + yOffset = hypre_BoxOffsetDistance(RAP_dbox, index); /*----------------------------------------------------------------- * Extract pointers for 15-point coarse grid operator: *-----------------------------------------------------------------*/ - hypre_SetIndex3(index,0,0,-1); + hypre_SetIndex3(index, 0, 0, -1); rap_bc = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,-1,0,-1); + hypre_SetIndex3(index, -1, 0, -1); rap_bw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,1,0,-1); + hypre_SetIndex3(index, 1, 0, -1); rap_be = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,0,-1,-1); + hypre_SetIndex3(index, 0, -1, -1); rap_bs = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,0,1,-1); + hypre_SetIndex3(index, 0, 1, -1); rap_bn = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,0,0,0); + hypre_SetIndex3(index, 0, 0, 0); rap_cc = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,-1,0,0); + hypre_SetIndex3(index, -1, 0, 0); rap_cw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,0,-1,0); + hypre_SetIndex3(index, 0, -1, 0); rap_cs = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); /*----------------------------------------------------------------- * Extract additional pointers for 27-point coarse grid operator: *-----------------------------------------------------------------*/ - if(stencil_size == 27) + if (stencil_size == 27) { - hypre_SetIndex3(index,-1,-1,-1); + hypre_SetIndex3(index, -1, -1, -1); rap_bsw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,1,-1,-1); + hypre_SetIndex3(index, 1, -1, -1); rap_bse = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,-1,1,-1); + hypre_SetIndex3(index, -1, 1, -1); rap_bnw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,1,1,-1); + hypre_SetIndex3(index, 1, 1, -1); rap_bne = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,-1,-1,0); + hypre_SetIndex3(index, -1, -1, 0); rap_csw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,1,-1,0); + hypre_SetIndex3(index, 1, -1, 0); rap_cse = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); } @@ -1788,6 +1798,8 @@ hypre_SMG3RAPPeriodicNoSym( hypre_StructMatrix *RAP, hypre_Index cstride ) { + HYPRE_UNUSED_VAR(cindex); + HYPRE_UNUSED_VAR(cstride); hypre_Index index; @@ -1836,92 +1848,92 @@ hypre_SMG3RAPPeriodicNoSym( hypre_StructMatrix *RAP, * Extract pointers for 15-point coarse grid operator: *-----------------------------------------------------------------*/ - hypre_SetIndex3(index,0,0,-1); + hypre_SetIndex3(index, 0, 0, -1); rap_bc = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,-1,0,-1); + hypre_SetIndex3(index, -1, 0, -1); rap_bw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,1,0,-1); + hypre_SetIndex3(index, 1, 0, -1); rap_be = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,0,-1,-1); + hypre_SetIndex3(index, 0, -1, -1); rap_bs = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,0,1,-1); + hypre_SetIndex3(index, 0, 1, -1); rap_bn = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,0,0,0); + hypre_SetIndex3(index, 0, 0, 0); rap_cc = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,-1,0,0); + hypre_SetIndex3(index, -1, 0, 0); rap_cw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,1,0,0); + hypre_SetIndex3(index, 1, 0, 0); rap_ce = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,0,-1,0); + hypre_SetIndex3(index, 0, -1, 0); rap_cs = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,0,1,0); + hypre_SetIndex3(index, 0, 1, 0); rap_cn = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,0,0,1); + hypre_SetIndex3(index, 0, 0, 1); rap_ac = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,-1,0,1); + hypre_SetIndex3(index, -1, 0, 1); rap_aw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,1,0,1); + hypre_SetIndex3(index, 1, 0, 1); rap_ae = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,0,-1,1); + hypre_SetIndex3(index, 0, -1, 1); rap_as = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,0,1,1); + hypre_SetIndex3(index, 0, 1, 1); rap_an = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); /*----------------------------------------------------------------- * Extract additional pointers for 27-point coarse grid operator: *-----------------------------------------------------------------*/ - if(stencil_size == 27) + if (stencil_size == 27) { - hypre_SetIndex3(index,-1,-1,-1); + hypre_SetIndex3(index, -1, -1, -1); rap_bsw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,1,-1,-1); + hypre_SetIndex3(index, 1, -1, -1); rap_bse = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,-1,1,-1); + hypre_SetIndex3(index, -1, 1, -1); rap_bnw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,1,1,-1); + hypre_SetIndex3(index, 1, 1, -1); rap_bne = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,-1,-1,0); + hypre_SetIndex3(index, -1, -1, 0); rap_csw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,1,-1,0); + hypre_SetIndex3(index, 1, -1, 0); rap_cse = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,-1,1,0); + hypre_SetIndex3(index, -1, 1, 0); rap_cnw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,1,1,0); + hypre_SetIndex3(index, 1, 1, 0); rap_cne = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,-1,-1,1); + hypre_SetIndex3(index, -1, -1, 1); rap_asw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,1,-1,1); + hypre_SetIndex3(index, 1, -1, 1); rap_ase = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,-1,1,1); + hypre_SetIndex3(index, -1, 1, 1); rap_anw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index,1,1,1); + hypre_SetIndex3(index, 1, 1, 1); rap_ane = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); } @@ -1997,4 +2009,3 @@ hypre_SMG3RAPPeriodicNoSym( hypre_StructMatrix *RAP, return hypre_error_flag; } - diff --git a/external/hypre/src/struct_ls/smg_axpy.c b/external/hypre/src/struct_ls/smg_axpy.c index da1481cb..8b25283a 100644 --- a/external/hypre/src/struct_ls/smg_axpy.c +++ b/external/hypre/src/struct_ls/smg_axpy.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/struct_ls/smg_relax.c b/external/hypre/src/struct_ls/smg_relax.c index e8050e2a..9fc1f27e 100644 --- a/external/hypre/src/struct_ls/smg_relax.c +++ b/external/hypre/src/struct_ls/smg_relax.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -157,9 +157,13 @@ hypre_SMGRelaxDestroyASol( void *relax_vdata ) for (i = 0; i < (relax_data -> num_spaces); i++) { if (stencil_dim > 2) + { hypre_SMGDestroy(relax_data -> solve_data[i]); + } else + { hypre_CyclicReductionDestroy(relax_data -> solve_data[i]); + } } hypre_TFree(relax_data -> solve_data, HYPRE_MEMORY_HOST); hypre_StructMatrixDestroy(relax_data -> A_sol); @@ -276,7 +280,7 @@ hypre_SMGRelax( void *relax_vdata, for (k = 0; k < 2; k++) { - switch(k) + switch (k) { /* Do pre-relaxation iterations */ case 0: @@ -405,6 +409,9 @@ hypre_SMGRelaxSetupTempVec( void *relax_vdata, hypre_StructVector *b, hypre_StructVector *x ) { + HYPRE_UNUSED_VAR(A); + HYPRE_UNUSED_VAR(x); + hypre_SMGRelaxData *relax_data = (hypre_SMGRelaxData *)relax_vdata; hypre_StructVector *temp_vec = (relax_data -> temp_vec); @@ -515,6 +522,8 @@ hypre_SMGRelaxSetupASol( void *relax_vdata, hypre_StructVector *b, hypre_StructVector *x ) { + HYPRE_UNUSED_VAR(b); + hypre_SMGRelaxData *relax_data = (hypre_SMGRelaxData *)relax_vdata; HYPRE_Int num_spaces = (relax_data -> num_spaces); @@ -734,7 +743,9 @@ hypre_SMGRelaxSetNumPreSpaces( void *relax_vdata, (relax_data -> pre_space_ranks) = hypre_TAlloc(HYPRE_Int, num_pre_spaces, HYPRE_MEMORY_HOST); for (i = 0; i < num_pre_spaces; i++) + { (relax_data -> pre_space_ranks[i]) = 0; + } return hypre_error_flag; } @@ -755,7 +766,9 @@ hypre_SMGRelaxSetNumRegSpaces( void *relax_vdata, (relax_data -> reg_space_ranks) = hypre_TAlloc(HYPRE_Int, num_reg_spaces, HYPRE_MEMORY_HOST); for (i = 0; i < num_reg_spaces; i++) + { (relax_data -> reg_space_ranks[i]) = 0; + } return hypre_error_flag; } @@ -853,7 +866,7 @@ hypre_SMGRelaxSetNumPreRelax( void *relax_vdata, { hypre_SMGRelaxData *relax_data = (hypre_SMGRelaxData *)relax_vdata; - (relax_data -> num_pre_relax) = hypre_max(num_pre_relax,1); + (relax_data -> num_pre_relax) = hypre_max(num_pre_relax, 1); return hypre_error_flag; } @@ -913,6 +926,9 @@ hypre_SMGRelaxSetupBaseBoxArray( void *relax_vdata, hypre_StructVector *b, hypre_StructVector *x ) { + HYPRE_UNUSED_VAR(A); + HYPRE_UNUSED_VAR(b); + hypre_SMGRelaxData *relax_data = (hypre_SMGRelaxData *)relax_vdata; hypre_StructGrid *grid; diff --git a/external/hypre/src/struct_ls/smg_residual.c b/external/hypre/src/struct_ls/smg_residual.c index 84fd792b..2a51cb33 100644 --- a/external/hypre/src/struct_ls/smg_residual.c +++ b/external/hypre/src/struct_ls/smg_residual.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -32,7 +32,7 @@ typedef struct *--------------------------------------------------------------------------*/ void * -hypre_SMGResidualCreate( ) +hypre_SMGResidualCreate( void ) { hypre_SMGResidualData *residual_data; @@ -102,8 +102,8 @@ hypre_SMGResidualSetup( void *residual_vdata, (residual_data -> flops) = (hypre_StructMatrixGlobalSize(A) + hypre_StructVectorGlobalSize(x)) / (HYPRE_BigInt)(hypre_IndexX(base_stride) * - hypre_IndexY(base_stride) * - hypre_IndexZ(base_stride) ); + hypre_IndexY(base_stride) * + hypre_IndexZ(base_stride) ); return hypre_error_flag; } @@ -161,7 +161,7 @@ hypre_SMGResidual( void *residual_vdata, for (compute_i = 0; compute_i < 2; compute_i++) { - switch(compute_i) + switch (compute_i) { case 0: { @@ -234,7 +234,7 @@ hypre_SMGResidual( void *residual_vdata, { Ap = hypre_StructMatrixBoxData(A, i, si); xp = hypre_StructVectorBoxData(x, i); -//RL:PTROFFSET + //RL:PTROFFSET HYPRE_Int xp_off = hypre_BoxOffsetDistance(x_data_box, stencil_shape[si]); hypre_BoxGetStrideSize(compute_box, base_stride, @@ -246,7 +246,7 @@ hypre_SMGResidual( void *residual_vdata, x_data_box, start, base_stride, xi, r_data_box, start, base_stride, ri); { - rp[ri] -= Ap[Ai] * xp[xi+xp_off]; + rp[ri] -= Ap[Ai] * xp[xi + xp_off]; } hypre_BoxLoop3End(Ai, xi, ri); #undef DEVICE_VAR diff --git a/external/hypre/src/struct_ls/smg_residual_unrolled.c b/external/hypre/src/struct_ls/smg_residual_unrolled.c index 6fcbe476..6e468246 100644 --- a/external/hypre/src/struct_ls/smg_residual_unrolled.c +++ b/external/hypre/src/struct_ls/smg_residual_unrolled.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -69,7 +69,7 @@ hypre_SMGResidualSetup( void *residual_vdata, hypre_StructGrid *grid; hypre_StructStencil *stencil; - + hypre_BoxArray *base_points; hypre_ComputeInfo *compute_info; hypre_ComputePkg *compute_pkg; @@ -109,8 +109,8 @@ hypre_SMGResidualSetup( void *residual_vdata, (residual_data -> flops) = (hypre_StructMatrixGlobalSize(A) + hypre_StructVectorGlobalSize(x)) / (HYPRE_BigInt)(hypre_IndexX(base_stride) * - hypre_IndexY(base_stride) * - hypre_IndexZ(base_stride) ); + hypre_IndexY(base_stride) * + hypre_IndexZ(base_stride) ); return ierr; } @@ -135,29 +135,29 @@ hypre_SMGResidual( void *residual_vdata, hypre_ComputePkg *compute_pkg = (residual_data -> compute_pkg); hypre_CommHandle *comm_handle; - + hypre_BoxArrayArray *compute_box_aa; hypre_BoxArray *compute_box_a; hypre_Box *compute_box; - + hypre_Box *A_data_box; hypre_Box *x_data_box; hypre_Box *b_data_box; hypre_Box *r_data_box; - + HYPRE_Int Ai; HYPRE_Int xi; HYPRE_Int bi; HYPRE_Int ri; - + HYPRE_Real *Ap0; HYPRE_Real *xp0; HYPRE_Real *bp; HYPRE_Real *rp; - + hypre_Index loop_size; hypre_IndexRef start; - + hypre_StructStencil *stencil; hypre_Index *stencil_shape; HYPRE_Int stencil_size; @@ -191,7 +191,7 @@ hypre_SMGResidual( void *residual_vdata, for (compute_i = 0; compute_i < 2; compute_i++) { - switch(compute_i) + switch (compute_i) { case 0: { @@ -265,7 +265,7 @@ hypre_SMGResidual( void *residual_vdata, Ap0 = hypre_StructMatrixBoxData(A, i, 0); xp0 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[0]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[0]); break; @@ -276,11 +276,11 @@ hypre_SMGResidual( void *residual_vdata, Ap2 = hypre_StructMatrixBoxData(A, i, 2); xp0 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[0]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[0]); xp1 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[1]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[1]); xp2 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[2]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[2]); break; @@ -293,15 +293,15 @@ hypre_SMGResidual( void *residual_vdata, Ap4 = hypre_StructMatrixBoxData(A, i, 4); xp0 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[0]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[0]); xp1 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[1]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[1]); xp2 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[2]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[2]); xp3 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[3]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[3]); xp4 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[4]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[4]); break; @@ -316,19 +316,19 @@ hypre_SMGResidual( void *residual_vdata, Ap6 = hypre_StructMatrixBoxData(A, i, 6); xp0 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[0]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[0]); xp1 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[1]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[1]); xp2 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[2]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[2]); xp3 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[3]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[3]); xp4 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[4]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[4]); xp5 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[5]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[5]); xp6 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[6]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[6]); break; @@ -345,23 +345,23 @@ hypre_SMGResidual( void *residual_vdata, Ap8 = hypre_StructMatrixBoxData(A, i, 8); xp0 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[0]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[0]); xp1 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[1]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[1]); xp2 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[2]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[2]); xp3 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[3]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[3]); xp4 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[4]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[4]); xp5 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[5]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[5]); xp6 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[6]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[6]); xp7 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[7]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[7]); xp8 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[8]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[8]); break; @@ -384,35 +384,35 @@ hypre_SMGResidual( void *residual_vdata, Ap14 = hypre_StructMatrixBoxData(A, i, 14); xp0 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[0]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[0]); xp1 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[1]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[1]); xp2 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[2]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[2]); xp3 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[3]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[3]); xp4 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[4]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[4]); xp5 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[5]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[5]); xp6 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[6]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[6]); xp7 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[7]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[7]); xp8 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[8]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[8]); xp9 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[9]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[9]); xp10 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[10]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[10]); xp11 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[11]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[11]); xp12 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[12]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[12]); xp13 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[13]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[13]); xp14 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[14]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[14]); break; @@ -439,43 +439,43 @@ hypre_SMGResidual( void *residual_vdata, Ap18 = hypre_StructMatrixBoxData(A, i, 18); xp0 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[0]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[0]); xp1 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[1]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[1]); xp2 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[2]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[2]); xp3 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[3]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[3]); xp4 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[4]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[4]); xp5 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[5]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[5]); xp6 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[6]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[6]); xp7 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[7]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[7]); xp8 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[8]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[8]); xp9 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[9]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[9]); xp10 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[10]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[10]); xp11 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[11]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[11]); xp12 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[12]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[12]); xp13 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[13]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[13]); xp14 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[14]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[14]); xp15 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[15]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[15]); xp16 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[16]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[16]); xp17 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[17]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[17]); xp18 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[18]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[18]); break; @@ -510,59 +510,59 @@ hypre_SMGResidual( void *residual_vdata, Ap26 = hypre_StructMatrixBoxData(A, i, 26); xp0 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[0]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[0]); xp1 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[1]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[1]); xp2 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[2]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[2]); xp3 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[3]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[3]); xp4 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[4]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[4]); xp5 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[5]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[5]); xp6 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[6]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[6]); xp7 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[7]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[7]); xp8 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[8]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[8]); xp9 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[9]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[9]); xp10 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[10]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[10]); xp11 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[11]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[11]); xp12 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[12]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[12]); xp13 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[13]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[13]); xp14 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[14]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[14]); xp15 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[15]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[15]); xp16 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[16]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[16]); xp17 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[17]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[17]); xp18 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[18]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[18]); xp19 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[19]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[19]); xp20 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[20]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[20]); xp21 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[21]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[21]); xp22 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[22]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[22]); xp23 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[23]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[23]); xp24 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[24]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[24]); xp25 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[25]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[25]); xp26 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[26]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[26]); break; @@ -585,7 +585,7 @@ hypre_SMGResidual( void *residual_vdata, { case 1: - + hypre_BoxGetStrideSize(compute_box, base_stride, loop_size); #define DEVICE_VAR is_device_ptr(rp,Ap0,xp0) @@ -596,7 +596,7 @@ hypre_SMGResidual( void *residual_vdata, { rp[ri] = rp[ri] - - Ap0[Ai] * xp0[xi]; + - Ap0[Ai] * xp0[xi]; } hypre_BoxLoop3End(Ai, xi, ri); @@ -614,11 +614,11 @@ hypre_SMGResidual( void *residual_vdata, x_data_box, start, base_stride, xi, r_data_box, start, base_stride, ri); { - + rp[ri] = rp[ri] - - Ap0[Ai] * xp0[xi] - - Ap1[Ai] * xp1[xi] - - Ap2[Ai] * xp2[xi]; + - Ap0[Ai] * xp0[xi] + - Ap1[Ai] * xp1[xi] + - Ap2[Ai] * xp2[xi]; } hypre_BoxLoop3End(Ai, xi, ri); @@ -636,13 +636,13 @@ hypre_SMGResidual( void *residual_vdata, x_data_box, start, base_stride, xi, r_data_box, start, base_stride, ri); { - + rp[ri] = rp[ri] - - Ap0[Ai] * xp0[xi] - - Ap1[Ai] * xp1[xi] - - Ap2[Ai] * xp2[xi] - - Ap3[Ai] * xp3[xi] - - Ap4[Ai] * xp4[xi]; + - Ap0[Ai] * xp0[xi] + - Ap1[Ai] * xp1[xi] + - Ap2[Ai] * xp2[xi] + - Ap3[Ai] * xp3[xi] + - Ap4[Ai] * xp4[xi]; } hypre_BoxLoop3End(Ai, xi, ri); @@ -662,13 +662,13 @@ hypre_SMGResidual( void *residual_vdata, { rp[ri] = rp[ri] - - Ap0[Ai] * xp0[xi] - - Ap1[Ai] * xp1[xi] - - Ap2[Ai] * xp2[xi] - - Ap3[Ai] * xp3[xi] - - Ap4[Ai] * xp4[xi] - - Ap5[Ai] * xp5[xi] - - Ap6[Ai] * xp6[xi]; + - Ap0[Ai] * xp0[xi] + - Ap1[Ai] * xp1[xi] + - Ap2[Ai] * xp2[xi] + - Ap3[Ai] * xp3[xi] + - Ap4[Ai] * xp4[xi] + - Ap5[Ai] * xp5[xi] + - Ap6[Ai] * xp6[xi]; } hypre_BoxLoop3End(Ai, xi, ri); @@ -686,18 +686,18 @@ hypre_SMGResidual( void *residual_vdata, x_data_box, start, base_stride, xi, r_data_box, start, base_stride, ri); { - + rp[ri] = rp[ri] - - Ap0[Ai] * xp0[xi] - - Ap1[Ai] * xp1[xi] - - Ap2[Ai] * xp2[xi] - - Ap3[Ai] * xp3[xi] - - Ap4[Ai] * xp4[xi] - - Ap5[Ai] * xp5[xi] - - Ap6[Ai] * xp6[xi] - - Ap7[Ai] * xp7[xi] - - Ap8[Ai] * xp8[xi]; - + - Ap0[Ai] * xp0[xi] + - Ap1[Ai] * xp1[xi] + - Ap2[Ai] * xp2[xi] + - Ap3[Ai] * xp3[xi] + - Ap4[Ai] * xp4[xi] + - Ap5[Ai] * xp5[xi] + - Ap6[Ai] * xp6[xi] + - Ap7[Ai] * xp7[xi] + - Ap8[Ai] * xp8[xi]; + } hypre_BoxLoop3End(Ai, xi, ri); #undef DEVICE_VAR @@ -714,23 +714,23 @@ hypre_SMGResidual( void *residual_vdata, x_data_box, start, base_stride, xi, r_data_box, start, base_stride, ri); { - + rp[ri] = rp[ri] - - Ap0[Ai] * xp0[xi] - - Ap1[Ai] * xp1[xi] - - Ap2[Ai] * xp2[xi] - - Ap3[Ai] * xp3[xi] - - Ap4[Ai] * xp4[xi] - - Ap5[Ai] * xp5[xi] - - Ap6[Ai] * xp6[xi] - - Ap7[Ai] * xp7[xi] - - Ap8[Ai] * xp8[xi] - - Ap9[Ai] * xp9[xi] - - Ap10[Ai] * xp10[xi] - - Ap11[Ai] * xp11[xi] - - Ap12[Ai] * xp12[xi] - - Ap13[Ai] * xp13[xi] - - Ap14[Ai] * xp14[xi]; + - Ap0[Ai] * xp0[xi] + - Ap1[Ai] * xp1[xi] + - Ap2[Ai] * xp2[xi] + - Ap3[Ai] * xp3[xi] + - Ap4[Ai] * xp4[xi] + - Ap5[Ai] * xp5[xi] + - Ap6[Ai] * xp6[xi] + - Ap7[Ai] * xp7[xi] + - Ap8[Ai] * xp8[xi] + - Ap9[Ai] * xp9[xi] + - Ap10[Ai] * xp10[xi] + - Ap11[Ai] * xp11[xi] + - Ap12[Ai] * xp12[xi] + - Ap13[Ai] * xp13[xi] + - Ap14[Ai] * xp14[xi]; } hypre_BoxLoop3End(Ai, xi, ri); @@ -748,34 +748,34 @@ hypre_SMGResidual( void *residual_vdata, x_data_box, start, base_stride, xi, r_data_box, start, base_stride, ri); { - + rp[ri] = rp[ri] - - Ap0[Ai] * xp0[xi] - - Ap1[Ai] * xp1[xi] - - Ap2[Ai] * xp2[xi] - - Ap3[Ai] * xp3[xi] - - Ap4[Ai] * xp4[xi] - - Ap5[Ai] * xp5[xi] - - Ap6[Ai] * xp6[xi] - - Ap7[Ai] * xp7[xi] - - Ap8[Ai] * xp8[xi] - - Ap9[Ai] * xp9[xi] - - Ap10[Ai] * xp10[xi] - - Ap11[Ai] * xp11[xi] - - Ap12[Ai] * xp12[xi] - - Ap13[Ai] * xp13[xi] - - Ap14[Ai] * xp14[xi] - - Ap15[Ai] * xp15[xi] - - Ap16[Ai] * xp16[xi] - - Ap17[Ai] * xp17[xi] - - Ap18[Ai] * xp18[xi]; - + - Ap0[Ai] * xp0[xi] + - Ap1[Ai] * xp1[xi] + - Ap2[Ai] * xp2[xi] + - Ap3[Ai] * xp3[xi] + - Ap4[Ai] * xp4[xi] + - Ap5[Ai] * xp5[xi] + - Ap6[Ai] * xp6[xi] + - Ap7[Ai] * xp7[xi] + - Ap8[Ai] * xp8[xi] + - Ap9[Ai] * xp9[xi] + - Ap10[Ai] * xp10[xi] + - Ap11[Ai] * xp11[xi] + - Ap12[Ai] * xp12[xi] + - Ap13[Ai] * xp13[xi] + - Ap14[Ai] * xp14[xi] + - Ap15[Ai] * xp15[xi] + - Ap16[Ai] * xp16[xi] + - Ap17[Ai] * xp17[xi] + - Ap18[Ai] * xp18[xi]; + } hypre_BoxLoop3End(Ai, xi, ri); #undef DEVICE_VAR - + break; - + case 27: hypre_BoxGetStrideSize(compute_box, base_stride, loop_size); @@ -786,40 +786,40 @@ hypre_SMGResidual( void *residual_vdata, x_data_box, start, base_stride, xi, r_data_box, start, base_stride, ri); { - + rp[ri] = rp[ri] - - Ap0[Ai] * xp0[xi] - - Ap1[Ai] * xp1[xi] - - Ap2[Ai] * xp2[xi] - - Ap3[Ai] * xp3[xi] - - Ap4[Ai] * xp4[xi] - - Ap5[Ai] * xp5[xi] - - Ap6[Ai] * xp6[xi] - - Ap7[Ai] * xp7[xi] - - Ap8[Ai] * xp8[xi] - - Ap9[Ai] * xp9[xi] - - Ap10[Ai] * xp10[xi] - - Ap11[Ai] * xp11[xi] - - Ap12[Ai] * xp12[xi] - - Ap13[Ai] * xp13[xi] - - Ap14[Ai] * xp14[xi] - - Ap15[Ai] * xp15[xi] - - Ap16[Ai] * xp16[xi] - - Ap17[Ai] * xp17[xi] - - Ap18[Ai] * xp18[xi] - - Ap19[Ai] * xp19[xi] - - Ap20[Ai] * xp20[xi] - - Ap21[Ai] * xp21[xi] - - Ap22[Ai] * xp22[xi] - - Ap23[Ai] * xp23[xi] - - Ap24[Ai] * xp24[xi] - - Ap25[Ai] * xp25[xi] - - Ap26[Ai] * xp26[xi]; + - Ap0[Ai] * xp0[xi] + - Ap1[Ai] * xp1[xi] + - Ap2[Ai] * xp2[xi] + - Ap3[Ai] * xp3[xi] + - Ap4[Ai] * xp4[xi] + - Ap5[Ai] * xp5[xi] + - Ap6[Ai] * xp6[xi] + - Ap7[Ai] * xp7[xi] + - Ap8[Ai] * xp8[xi] + - Ap9[Ai] * xp9[xi] + - Ap10[Ai] * xp10[xi] + - Ap11[Ai] * xp11[xi] + - Ap12[Ai] * xp12[xi] + - Ap13[Ai] * xp13[xi] + - Ap14[Ai] * xp14[xi] + - Ap15[Ai] * xp15[xi] + - Ap16[Ai] * xp16[xi] + - Ap17[Ai] * xp17[xi] + - Ap18[Ai] * xp18[xi] + - Ap19[Ai] * xp19[xi] + - Ap20[Ai] * xp20[xi] + - Ap21[Ai] * xp21[xi] + - Ap22[Ai] * xp22[xi] + - Ap23[Ai] * xp23[xi] + - Ap24[Ai] * xp24[xi] + - Ap25[Ai] * xp25[xi] + - Ap26[Ai] * xp26[xi]; } hypre_BoxLoop3End(Ai, xi, ri); #undef DEVICE_VAR - + break; default: @@ -828,7 +828,7 @@ hypre_SMGResidual( void *residual_vdata, { Ap0 = hypre_StructMatrixBoxData(A, i, si); xp0 = hypre_StructVectorBoxData(x, i) + - hypre_BoxOffsetDistance(x_data_box, stencil_shape[si]); + hypre_BoxOffsetDistance(x_data_box, stencil_shape[si]); hypre_BoxGetStrideSize(compute_box, base_stride, loop_size); @@ -848,7 +848,7 @@ hypre_SMGResidual( void *residual_vdata, } } } - + /*----------------------------------------------------------------------- * Return *-----------------------------------------------------------------------*/ @@ -862,7 +862,7 @@ hypre_SMGResidual( void *residual_vdata, /*-------------------------------------------------------------------------- * hypre_SMGResidualSetBase *--------------------------------------------------------------------------*/ - + HYPRE_Int hypre_SMGResidualSetBase( void *residual_vdata, hypre_Index base_index, @@ -871,7 +871,7 @@ hypre_SMGResidualSetBase( void *residual_vdata, hypre_SMGResidualData *residual_data = residual_vdata; HYPRE_Int d; HYPRE_Int ierr = 0; - + for (d = 0; d < 3; d++) { hypre_IndexD((residual_data -> base_index), d) @@ -879,7 +879,7 @@ hypre_SMGResidualSetBase( void *residual_vdata, hypre_IndexD((residual_data -> base_stride), d) = hypre_IndexD(base_stride, d); } - + return ierr; } diff --git a/external/hypre/src/struct_ls/smg_setup.c b/external/hypre/src/struct_ls/smg_setup.c index dc440d21..20bd11bc 100644 --- a/external/hypre/src/struct_ls/smg_setup.c +++ b/external/hypre/src/struct_ls/smg_setup.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -19,7 +19,7 @@ hypre_SMGSetup( void *smg_vdata, hypre_StructVector *b, hypre_StructVector *x ) { - hypre_SMGData *smg_data = (hypre_SMGData *)smg_vdata; + hypre_SMGData *smg_data = (hypre_SMGData *) smg_vdata; MPI_Comm comm = (smg_data -> comm); hypre_IndexRef base_index = (smg_data -> base_index); @@ -71,9 +71,7 @@ hypre_SMGSetup( void *smg_vdata, void **interp_data_l; hypre_StructGrid *grid; - hypre_Box *cbox; - HYPRE_Int i, l; HYPRE_Int b_num_ghost[] = {0, 0, 0, 0, 0, 0}; @@ -83,12 +81,8 @@ hypre_SMGSetup( void *smg_vdata, char filename[255]; #endif -#if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - HYPRE_Int num_level_GPU = 0; - HYPRE_MemoryLocation data_location; - HYPRE_Int max_box_size = 0; - HYPRE_Int device_level = (smg_data -> devicelevel); -#endif + HYPRE_MemoryLocation memory_location = hypre_StructMatrixMemoryLocation(A); + /*----------------------------------------------------- * Set up coarsening direction *-----------------------------------------------------*/ @@ -156,30 +150,30 @@ hypre_SMGSetup( void *smg_vdata, hypre_BoxIMax(cbox)); /* build the interpolation grid */ - hypre_StructCoarsen(grid_l[l], cindex, stride, 0, &PT_grid_l[l+1]); + hypre_StructCoarsen(grid_l[l], cindex, stride, 0, &PT_grid_l[l + 1]); /* build the coarse grid */ - hypre_StructCoarsen(grid_l[l], cindex, stride, 1, &grid_l[l+1]); + hypre_StructCoarsen(grid_l[l], cindex, stride, 1, &grid_l[l + 1]); #if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - hypre_StructGridDataLocation(PT_grid_l[l+1]) = data_location; + hypre_StructGridDataLocation(PT_grid_l[l + 1]) = data_location; if (device_level == -1 && num_level_GPU > 0) { - max_box_size = hypre_StructGridGetMaxBoxSize(grid_l[l+1]); + max_box_size = hypre_StructGridGetMaxBoxSize(grid_l[l + 1]); if (max_box_size < HYPRE_MIN_GPU_SIZE) { - num_level_GPU = l+1; + num_level_GPU = l + 1; data_location = HYPRE_MEMORY_HOST; device_level = num_level_GPU; //printf("num_level_GPU = %d,device_level = %d\n",num_level_GPU,device_level); } } - else if (l+1 == device_level) + else if (l + 1 == device_level) { - num_level_GPU = l+1; + num_level_GPU = l + 1; data_location = HYPRE_MEMORY_HOST; } - hypre_StructGridDataLocation(grid_l[l+1]) = data_location; + hypre_StructGridDataLocation(grid_l[l + 1]) = data_location; #endif } num_levels = l + 1; @@ -211,8 +205,8 @@ hypre_SMGSetup( void *smg_vdata, for (i = 0; i <= cdir; i++) { - x_num_ghost[2*i] = 1; - x_num_ghost[2*i + 1] = 1; + x_num_ghost[2 * i] = 1; + x_num_ghost[2 * i + 1] = 1; } tb_l[0] = hypre_StructVectorCreate(comm, grid_l[0]); @@ -227,7 +221,7 @@ hypre_SMGSetup( void *smg_vdata, for (l = 0; l < (num_levels - 1); l++) { - PT_l[l] = hypre_SMGCreateInterpOp(A_l[l], PT_grid_l[l+1], cdir); + PT_l[l] = hypre_SMGCreateInterpOp(A_l[l], PT_grid_l[l + 1], cdir); hypre_StructMatrixInitializeShell(PT_l[l]); data_size += hypre_StructMatrixDataSize(PT_l[l]); @@ -243,47 +237,48 @@ hypre_SMGSetup( void *smg_vdata, #if 0 /* Allow R != PT for non symmetric case */ /* NOTE: Need to create a non-pruned grid for this to work */ - R_l[l] = hypre_SMGCreateRestrictOp(A_l[l], grid_l[l+1], cdir); + R_l[l] = hypre_SMGCreateRestrictOp(A_l[l], grid_l[l + 1], cdir); hypre_StructMatrixInitializeShell(R_l[l]); data_size += hypre_StructMatrixDataSize(R_l[l]); data_size_const += hypre_StructMatrixDataConstSize(R_l[l]); #endif } - A_l[l+1] = hypre_SMGCreateRAPOp(R_l[l], A_l[l], PT_l[l], grid_l[l+1]); - hypre_StructMatrixInitializeShell(A_l[l+1]); - data_size += hypre_StructMatrixDataSize(A_l[l+1]); - data_size_const += hypre_StructMatrixDataConstSize(A_l[l+1]); + A_l[l + 1] = hypre_SMGCreateRAPOp(R_l[l], A_l[l], PT_l[l], grid_l[l + 1]); + hypre_StructMatrixInitializeShell(A_l[l + 1]); + data_size += hypre_StructMatrixDataSize(A_l[l + 1]); + data_size_const += hypre_StructMatrixDataConstSize(A_l[l + 1]); - b_l[l+1] = hypre_StructVectorCreate(comm, grid_l[l+1]); - hypre_StructVectorSetNumGhost(b_l[l+1], b_num_ghost); - hypre_StructVectorInitializeShell(b_l[l+1]); - hypre_StructVectorSetDataSize(b_l[l+1], &data_size, &data_size_const); + b_l[l + 1] = hypre_StructVectorCreate(comm, grid_l[l + 1]); + hypre_StructVectorSetNumGhost(b_l[l + 1], b_num_ghost); + hypre_StructVectorInitializeShell(b_l[l + 1]); + hypre_StructVectorSetDataSize(b_l[l + 1], &data_size, &data_size_const); - x_l[l+1] = hypre_StructVectorCreate(comm, grid_l[l+1]); - hypre_StructVectorSetNumGhost(x_l[l+1], x_num_ghost); - hypre_StructVectorInitializeShell(x_l[l+1]); - hypre_StructVectorSetDataSize(x_l[l+1], &data_size, &data_size_const); + x_l[l + 1] = hypre_StructVectorCreate(comm, grid_l[l + 1]); + hypre_StructVectorSetNumGhost(x_l[l + 1], x_num_ghost); + hypre_StructVectorInitializeShell(x_l[l + 1]); + hypre_StructVectorSetDataSize(x_l[l + 1], &data_size, &data_size_const); - tb_l[l+1] = hypre_StructVectorCreate(comm, grid_l[l+1]); - hypre_StructVectorSetNumGhost(tb_l[l+1], hypre_StructVectorNumGhost(b)); - hypre_StructVectorInitializeShell(tb_l[l+1]); + tb_l[l + 1] = hypre_StructVectorCreate(comm, grid_l[l + 1]); + hypre_StructVectorSetNumGhost(tb_l[l + 1], hypre_StructVectorNumGhost(b)); + hypre_StructVectorInitializeShell(tb_l[l + 1]); - tx_l[l+1] = hypre_StructVectorCreate(comm, grid_l[l+1]); - hypre_StructVectorSetNumGhost(tx_l[l+1], hypre_StructVectorNumGhost(x)); - hypre_StructVectorInitializeShell(tx_l[l+1]); + tx_l[l + 1] = hypre_StructVectorCreate(comm, grid_l[l + 1]); + hypre_StructVectorSetNumGhost(tx_l[l + 1], hypre_StructVectorNumGhost(x)); + hypre_StructVectorInitializeShell(tx_l[l + 1]); #if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - if (l+1 == num_level_GPU) + if (l + 1 == num_level_GPU) { - hypre_StructVectorSetDataSize(tb_l[l+1], &data_size, &data_size_const); - hypre_StructVectorSetDataSize(tx_l[l+1], &data_size, &data_size_const); + hypre_StructVectorSetDataSize(tb_l[l + 1], &data_size, &data_size_const); + hypre_StructVectorSetDataSize(tx_l[l + 1], &data_size, &data_size_const); } #endif } - data = hypre_CTAlloc(HYPRE_Real, data_size, HYPRE_MEMORY_DEVICE); - data_const = hypre_CTAlloc(HYPRE_Real,data_size_const,HYPRE_MEMORY_HOST); - //printf("data =%d,data_const=%d,data_location = %d\n",data_size,data_size_const,data_location); + data = hypre_CTAlloc(HYPRE_Real, data_size, memory_location); + data_const = hypre_CTAlloc(HYPRE_Real, data_size_const, HYPRE_MEMORY_HOST); + + (smg_data -> memory_location) = memory_location; (smg_data -> data) = data; (smg_data -> data_const) = data_const; @@ -337,82 +332,82 @@ hypre_SMGSetup( void *smg_vdata, #endif #if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - if (l+1 == num_level_GPU) + if (l + 1 == num_level_GPU) { data_location = HYPRE_MEMORY_HOST; } #endif - hypre_StructMatrixInitializeData(A_l[l+1], data, data_const); - data += hypre_StructMatrixDataSize(A_l[l+1]); - data_const += hypre_StructMatrixDataConstSize(A_l[l+1]); + hypre_StructMatrixInitializeData(A_l[l + 1], data, data_const); + data += hypre_StructMatrixDataSize(A_l[l + 1]); + data_const += hypre_StructMatrixDataConstSize(A_l[l + 1]); #if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) if (data_location != HYPRE_MEMORY_HOST) { - hypre_StructVectorInitializeData(b_l[l+1], data); - hypre_StructVectorAssemble(b_l[l+1]); - data += hypre_StructVectorDataSize(b_l[l+1]); - - hypre_StructVectorInitializeData(x_l[l+1], data); - hypre_StructVectorAssemble(x_l[l+1]); - data += hypre_StructVectorDataSize(x_l[l+1]); - hypre_StructVectorInitializeData(tb_l[l+1], - hypre_StructVectorData(tb_l[0])); - hypre_StructVectorAssemble(tb_l[l+1]); - - hypre_StructVectorInitializeData(tx_l[l+1], - hypre_StructVectorData(tx_l[0])); - hypre_StructVectorAssemble(tx_l[l+1]); + hypre_StructVectorInitializeData(b_l[l + 1], data); + hypre_StructVectorAssemble(b_l[l + 1]); + data += hypre_StructVectorDataSize(b_l[l + 1]); + + hypre_StructVectorInitializeData(x_l[l + 1], data); + hypre_StructVectorAssemble(x_l[l + 1]); + data += hypre_StructVectorDataSize(x_l[l + 1]); + hypre_StructVectorInitializeData(tb_l[l + 1], + hypre_StructVectorData(tb_l[0])); + hypre_StructVectorAssemble(tb_l[l + 1]); + + hypre_StructVectorInitializeData(tx_l[l + 1], + hypre_StructVectorData(tx_l[0])); + hypre_StructVectorAssemble(tx_l[l + 1]); //printf("\n Alloc x_l,b_l[%d] on GPU\n",l+1); } else { - hypre_StructVectorInitializeData(b_l[l+1], data_const); - hypre_StructVectorAssemble(b_l[l+1]); - data_const += hypre_StructVectorDataSize(b_l[l+1]); - - hypre_StructVectorInitializeData(x_l[l+1], data_const); - hypre_StructVectorAssemble(x_l[l+1]); - data_const += hypre_StructVectorDataSize(x_l[l+1]); - if (l+1 == num_level_GPU) + hypre_StructVectorInitializeData(b_l[l + 1], data_const); + hypre_StructVectorAssemble(b_l[l + 1]); + data_const += hypre_StructVectorDataSize(b_l[l + 1]); + + hypre_StructVectorInitializeData(x_l[l + 1], data_const); + hypre_StructVectorAssemble(x_l[l + 1]); + data_const += hypre_StructVectorDataSize(x_l[l + 1]); + if (l + 1 == num_level_GPU) { - hypre_StructVectorInitializeData(tb_l[l+1], data_const); - hypre_StructVectorAssemble(tb_l[l+1]); - data_const += hypre_StructVectorDataSize(tb_l[l+1]); - hypre_StructVectorInitializeData(tx_l[l+1], data_const); - hypre_StructVectorAssemble(tx_l[l+1]); - data_const += hypre_StructVectorDataSize(tx_l[l+1]); + hypre_StructVectorInitializeData(tb_l[l + 1], data_const); + hypre_StructVectorAssemble(tb_l[l + 1]); + data_const += hypre_StructVectorDataSize(tb_l[l + 1]); + hypre_StructVectorInitializeData(tx_l[l + 1], data_const); + hypre_StructVectorAssemble(tx_l[l + 1]); + data_const += hypre_StructVectorDataSize(tx_l[l + 1]); } else { - hypre_StructVectorInitializeData(tb_l[l+1], - hypre_StructVectorData(tb_l[num_level_GPU])); - hypre_StructVectorAssemble(tb_l[l+1]); + hypre_StructVectorInitializeData(tb_l[l + 1], + hypre_StructVectorData(tb_l[num_level_GPU])); + hypre_StructVectorAssemble(tb_l[l + 1]); - hypre_StructVectorInitializeData(tx_l[l+1], - hypre_StructVectorData(tx_l[num_level_GPU])); - hypre_StructVectorAssemble(tx_l[l+1]); + hypre_StructVectorInitializeData(tx_l[l + 1], + hypre_StructVectorData(tx_l[num_level_GPU])); + hypre_StructVectorAssemble(tx_l[l + 1]); } //printf("\n Alloc x_l,b_l[%d] on CPU\n",l+1); } #else - hypre_StructVectorInitializeData(b_l[l+1], data); - hypre_StructVectorAssemble(b_l[l+1]); - data += hypre_StructVectorDataSize(b_l[l+1]); + hypre_StructVectorInitializeData(b_l[l + 1], data); + hypre_StructVectorAssemble(b_l[l + 1]); + data += hypre_StructVectorDataSize(b_l[l + 1]); - hypre_StructVectorInitializeData(x_l[l+1], data); - hypre_StructVectorAssemble(x_l[l+1]); - data += hypre_StructVectorDataSize(x_l[l+1]); + hypre_StructVectorInitializeData(x_l[l + 1], data); + hypre_StructVectorAssemble(x_l[l + 1]); + data += hypre_StructVectorDataSize(x_l[l + 1]); - hypre_StructVectorInitializeData(tb_l[l+1], + hypre_StructVectorInitializeData(tb_l[l + 1], hypre_StructVectorData(tb_l[0])); - hypre_StructVectorAssemble(tb_l[l+1]); + hypre_StructVectorAssemble(tb_l[l + 1]); - hypre_StructVectorInitializeData(tx_l[l+1], + hypre_StructVectorInitializeData(tx_l[l + 1], hypre_StructVectorData(tx_l[0])); - hypre_StructVectorAssemble(tx_l[l+1]); + hypre_StructVectorAssemble(tx_l[l + 1]); #endif } @@ -500,7 +495,7 @@ hypre_SMGSetup( void *smg_vdata, /* set up the interpolation routine */ interp_data_l[l] = hypre_SemiInterpCreate(); - hypre_SemiInterpSetup(interp_data_l[l], PT_l[l], 1, x_l[l+1], e_l[l], + hypre_SemiInterpSetup(interp_data_l[l], PT_l[l], 1, x_l[l + 1], e_l[l], cindex, findex, stride); /* set up the restriction operator */ @@ -512,11 +507,11 @@ hypre_SMGSetup( void *smg_vdata, #endif /* set up the restriction routine */ restrict_data_l[l] = hypre_SemiRestrictCreate(); - hypre_SemiRestrictSetup(restrict_data_l[l], R_l[l], 0, r_l[l], b_l[l+1], + hypre_SemiRestrictSetup(restrict_data_l[l], R_l[l], 0, r_l[l], b_l[l + 1], cindex, findex, stride); /* set up the coarse grid operator */ - hypre_SMGSetupRAPOp(R_l[l], A_l[l], PT_l[l], A_l[l+1], + hypre_SMGSetupRAPOp(R_l[l], A_l[l], PT_l[l], A_l[l + 1], cindex, stride); } @@ -539,7 +534,7 @@ hypre_SMGSetup( void *smg_vdata, hypre_SMGRelaxSetup(relax_data_l[l], A_l[l], b_l[l], x_l[l]); /* set up the residual routine in case of a single grid level */ - if( l == 0 ) + if ( l == 0 ) { residual_data_l[l] = hypre_SMGResidualCreate(); hypre_SMGResidualSetBase(residual_data_l[l], bindex, bstride); @@ -572,7 +567,7 @@ hypre_SMGSetup( void *smg_vdata, } #if DEBUG - if(hypre_StructGridNDim(grid_l[0]) == 3) + if (hypre_StructGridNDim(grid_l[0]) == 3) { for (l = 0; l < (num_levels - 1); l++) { @@ -585,12 +580,7 @@ hypre_SMGSetup( void *smg_vdata, hypre_StructMatrixPrint(filename, A_l[l], 0); } #endif -#if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - if (hypre_StructGridDataLocation(grid) != HYPRE_MEMORY_HOST) - { - hypre_SetDeviceOn(); - } -#endif + HYPRE_ANNOTATE_FUNC_END; return hypre_error_flag; diff --git a/external/hypre/src/struct_ls/smg_setup_interp.c b/external/hypre/src/struct_ls/smg_setup_interp.c index ec459466..a377daa3 100644 --- a/external/hypre/src/struct_ls/smg_setup_interp.c +++ b/external/hypre/src/struct_ls/smg_setup_interp.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -206,7 +206,7 @@ hypre_SMGSetupInterpOp( void *relax_data, for (compute_i = 0; compute_i < 2; compute_i++) { - switch(compute_i) + switch (compute_i) { case 0: { diff --git a/external/hypre/src/struct_ls/smg_setup_rap.c b/external/hypre/src/struct_ls/smg_setup_rap.c index 27242c1e..f9439e0a 100644 --- a/external/hypre/src/struct_ls/smg_setup_rap.c +++ b/external/hypre/src/struct_ls/smg_setup_rap.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -22,7 +22,7 @@ hypre_SMGCreateRAPOp( hypre_StructMatrix *R, hypre_StructMatrix *PT, hypre_StructGrid *coarse_grid ) { - hypre_StructMatrix *RAP; + hypre_StructMatrix *RAP = NULL; hypre_StructStencil *stencil; #if NEWRAP @@ -36,11 +36,11 @@ hypre_SMGCreateRAPOp( hypre_StructMatrix *R, switch (hypre_StructStencilNDim(stencil)) { case 2: - RAP = hypre_SMG2CreateRAPOp(R ,A, PT, coarse_grid); + RAP = hypre_SMG2CreateRAPOp(R, A, PT, coarse_grid); break; case 3: - RAP = hypre_SMG3CreateRAPOp(R ,A, PT, coarse_grid); + RAP = hypre_SMG3CreateRAPOp(R, A, PT, coarse_grid); break; } #endif @@ -50,13 +50,13 @@ hypre_SMGCreateRAPOp( hypre_StructMatrix *R, { case 2: cdir = 1; - RAP = hypre_SemiCreateRAPOp(R ,A, PT, coarse_grid, cdir, + RAP = hypre_SemiCreateRAPOp(R, A, PT, coarse_grid, cdir, P_stored_as_transpose); break; case 3: cdir = 2; - RAP = hypre_SemiCreateRAPOp(R ,A, PT, coarse_grid, cdir, + RAP = hypre_SemiCreateRAPOp(R, A, PT, coarse_grid, cdir, P_stored_as_transpose); break; } @@ -119,7 +119,7 @@ hypre_SMGSetupRAPOp( hypre_StructMatrix *R, /*-------------------------------------------------------------------- * For non-symmetric A, set upper triangular coefficients as well *--------------------------------------------------------------------*/ - if(!hypre_StructMatrixSymmetric(A)) + if (!hypre_StructMatrixSymmetric(A)) { hypre_SMG2BuildRAPNoSym(A, PT, R, Ac_tmp, cindex, cstride); /*----------------------------------------------------------------- @@ -147,7 +147,7 @@ hypre_SMGSetupRAPOp( hypre_StructMatrix *R, /*-------------------------------------------------------------------- * For non-symmetric A, set upper triangular coefficients as well *--------------------------------------------------------------------*/ - if(!hypre_StructMatrixSymmetric(A)) + if (!hypre_StructMatrixSymmetric(A)) { hypre_SMG3BuildRAPNoSym(A, PT, R, Ac_tmp, cindex, cstride); /*----------------------------------------------------------------- @@ -193,7 +193,8 @@ hypre_SMGSetupRAPOp( hypre_StructMatrix *R, if (data_location_A != data_location_Ac) { - hypre_TMemcpy(hypre_StructMatrixDataConst(Ac), hypre_StructMatrixData(Ac_tmp),HYPRE_Complex,hypre_StructMatrixDataSize(Ac_tmp),HYPRE_MEMORY_HOST,HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(hypre_StructMatrixDataConst(Ac), hypre_StructMatrixData(Ac_tmp), HYPRE_Complex, + hypre_StructMatrixDataSize(Ac_tmp), HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); hypre_SetDeviceOff(); hypre_StructGridDataLocation(hypre_StructMatrixGrid(Ac)) = data_location_Ac; hypre_StructMatrixAssemble(Ac); @@ -203,4 +204,3 @@ hypre_SMGSetupRAPOp( hypre_StructMatrix *R, #endif return hypre_error_flag; } - diff --git a/external/hypre/src/struct_ls/smg_setup_restrict.c b/external/hypre/src/struct_ls/smg_setup_restrict.c index 0dcfc841..71f12d50 100644 --- a/external/hypre/src/struct_ls/smg_setup_restrict.c +++ b/external/hypre/src/struct_ls/smg_setup_restrict.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -16,6 +16,10 @@ hypre_SMGCreateRestrictOp( hypre_StructMatrix *A, hypre_StructGrid *cgrid, HYPRE_Int cdir ) { + HYPRE_UNUSED_VAR(A); + HYPRE_UNUSED_VAR(cgrid); + HYPRE_UNUSED_VAR(cdir); + hypre_StructMatrix *R = NULL; return R; @@ -32,5 +36,12 @@ hypre_SMGSetupRestrictOp( hypre_StructMatrix *A, hypre_Index cindex, hypre_Index cstride ) { + HYPRE_UNUSED_VAR(A); + HYPRE_UNUSED_VAR(R); + HYPRE_UNUSED_VAR(temp_vec); + HYPRE_UNUSED_VAR(cdir); + HYPRE_UNUSED_VAR(cindex); + HYPRE_UNUSED_VAR(cstride); + return hypre_error_flag; } diff --git a/external/hypre/src/struct_ls/smg_solve.c b/external/hypre/src/struct_ls/smg_solve.c index e5877780..b8d19a96 100644 --- a/external/hypre/src/struct_ls/smg_solve.c +++ b/external/hypre/src/struct_ls/smg_solve.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -120,7 +120,7 @@ hypre_SMGSolve( void *smg_vdata, { /* eps = (tol^2) */ b_dot_b = hypre_StructInnerProd(b_l[0], b_l[0]); - eps = tol*tol; + eps = tol * tol; /* if rhs is zero, return a zero solution */ if (b_dot_b == 0.0) @@ -170,20 +170,26 @@ hypre_SMGSolve( void *smg_vdata, r_dot_r = hypre_StructInnerProd(r_l[0], r_l[0]); if (logging > 0) { - norms[i] = sqrt(r_dot_r); + norms[i] = hypre_sqrt(r_dot_r); if (b_dot_b > 0) - rel_norms[i] = sqrt(r_dot_r/b_dot_b); + { + rel_norms[i] = hypre_sqrt(r_dot_r / b_dot_b); + } else + { rel_norms[i] = 0.0; + } } /* always do at least 1 V-cycle */ - if ((r_dot_r/b_dot_b < eps) && (i > 0)) + if ((r_dot_r / b_dot_b < eps) && (i > 0)) { if (rel_change) { - if ((e_dot_e/x_dot_x) < eps) + if ((e_dot_e / x_dot_x) < eps) + { break; + } } else { @@ -197,7 +203,7 @@ hypre_SMGSolve( void *smg_vdata, /* restrict fine grid residual */ hypre_SemiRestrict(restrict_data_l[0], R_l[0], r_l[0], b_l[1]); #if DEBUG - if(hypre_StructStencilNDim(hypre_StructMatrixStencil(A)) == 3) + if (hypre_StructStencilNDim(hypre_StructMatrixStencil(A)) == 3) { hypre_sprintf(filename, "zout_xdown.%02d", 0); hypre_StructVectorPrint(filename, x_l[0], 0); @@ -221,16 +227,16 @@ hypre_SMGSolve( void *smg_vdata, A_l[l], x_l[l], b_l[l], r_l[l]); /* restrict residual */ - hypre_SemiRestrict(restrict_data_l[l], R_l[l], r_l[l], b_l[l+1]); + hypre_SemiRestrict(restrict_data_l[l], R_l[l], r_l[l], b_l[l + 1]); #if DEBUG - if(hypre_StructStencilNDim(hypre_StructMatrixStencil(A)) == 3) + if (hypre_StructStencilNDim(hypre_StructMatrixStencil(A)) == 3) { hypre_sprintf(filename, "zout_xdown.%02d", l); hypre_StructVectorPrint(filename, x_l[l], 0); hypre_sprintf(filename, "zout_rdown.%02d", l); hypre_StructVectorPrint(filename, r_l[l], 0); - hypre_sprintf(filename, "zout_b.%02d", l+1); - hypre_StructVectorPrint(filename, b_l[l+1], 0); + hypre_sprintf(filename, "zout_b.%02d", l + 1); + hypre_StructVectorPrint(filename, b_l[l + 1], 0); } #endif } @@ -242,7 +248,7 @@ hypre_SMGSolve( void *smg_vdata, hypre_SMGRelaxSetZeroGuess(relax_data_l[l], 1); hypre_SMGRelax(relax_data_l[l], A_l[l], b_l[l], x_l[l]); #if DEBUG - if(hypre_StructStencilNDim(hypre_StructMatrixStencil(A)) == 3) + if (hypre_StructStencilNDim(hypre_StructMatrixStencil(A)) == 3) { hypre_sprintf(filename, "zout_xbottom.%02d", l); hypre_StructVectorPrint(filename, x_l[l], 0); @@ -256,10 +262,10 @@ hypre_SMGSolve( void *smg_vdata, for (l = (num_levels - 2); l >= 1; l--) { /* interpolate error and correct (x = x + Pe_c) */ - hypre_SemiInterp(interp_data_l[l], PT_l[l], x_l[l+1], e_l[l]); + hypre_SemiInterp(interp_data_l[l], PT_l[l], x_l[l + 1], e_l[l]); hypre_StructAxpy(1.0, e_l[l], x_l[l]); #if DEBUG - if(hypre_StructStencilNDim(hypre_StructMatrixStencil(A)) == 3) + if (hypre_StructStencilNDim(hypre_StructMatrixStencil(A)) == 3) { hypre_sprintf(filename, "zout_eup.%02d", l); hypre_StructVectorPrint(filename, e_l[l], 0); @@ -279,7 +285,7 @@ hypre_SMGSolve( void *smg_vdata, hypre_SemiInterp(interp_data_l[0], PT_l[0], x_l[1], e_l[0]); hypre_SMGAxpy(1.0, e_l[0], x_l[0], base_index, base_stride); #if DEBUG - if(hypre_StructStencilNDim(hypre_StructMatrixStencil(A)) == 3) + if (hypre_StructStencilNDim(hypre_StructMatrixStencil(A)) == 3) { hypre_sprintf(filename, "zout_eup.%02d", 0); hypre_StructVectorPrint(filename, e_l[0], 0); diff --git a/external/hypre/src/struct_ls/sparse_msg.c b/external/hypre/src/struct_ls/sparse_msg.c index d4787ffc..5e978920 100644 --- a/external/hypre/src/struct_ls/sparse_msg.c +++ b/external/hypre/src/struct_ls/sparse_msg.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -35,7 +35,7 @@ hypre_SparseMSGCreate( MPI_Comm comm ) (smsg_data -> jump) = 0; (smsg_data -> relax_type) = 1; /* weighted Jacobi */ (smsg_data -> jacobi_weight) = 0.0; - (smsg_data -> usr_jacobi_weight)= 0; /* no user Jacobi weight */ + (smsg_data -> usr_jacobi_weight) = 0; /* no user Jacobi weight */ (smsg_data -> num_pre_relax) = 1; (smsg_data -> num_post_relax) = 1; (smsg_data -> num_fine_relax) = 1; @@ -47,6 +47,8 @@ hypre_SparseMSGCreate( MPI_Comm comm ) (smsg_data -> num_grids[1]) = 1; (smsg_data -> num_grids[2]) = 1; + (smsg_data -> memory_location) = hypre_HandleMemoryLocation(hypre_handle()); + return (void *) smsg_data; } @@ -59,7 +61,7 @@ hypre_SparseMSGDestroy( void *smsg_vdata ) { HYPRE_Int ierr = 0; -/* RDF */ + /* RDF */ #if 0 hypre_SparseMSGData *smsg_data = smsg_vdata; @@ -99,20 +101,20 @@ hypre_SparseMSGDestroy( void *smsg_vdata ) for (l = 0; l < (smsg_data -> num_grids[0]) - 1; l++) { hypre_StructMatrixDestroy(smsg_data -> Px_array[l]); - hypre_StructGridDestroy(smsg_data -> Px_grid_array[l]); + hypre_StructGridDestroy(smsg_data -> Px_grid_array[l]); } for (l = 0; l < (smsg_data -> num_grids[1]) - 1; l++) { hypre_StructMatrixDestroy(smsg_data -> Py_array[l]); - hypre_StructGridDestroy(smsg_data -> Py_grid_array[l]); + hypre_StructGridDestroy(smsg_data -> Py_grid_array[l]); } for (l = 0; l < (smsg_data -> num_grids[2]) - 1; l++) { hypre_StructMatrixDestroy(smsg_data -> Pz_array[l]); - hypre_StructGridDestroy(smsg_data -> Pz_grid_array[l]); + hypre_StructGridDestroy(smsg_data -> Pz_grid_array[l]); } - hypre_TFree(smsg_data -> data, HYPRE_MEMORY_HOST); + hypre_TFree(smsg_data -> data, HYPRE_MEMORY_HOST); hypre_TFree(smsg_data -> relax_array, HYPRE_MEMORY_HOST); hypre_TFree(smsg_data -> matvec_array, HYPRE_MEMORY_HOST); @@ -138,12 +140,14 @@ hypre_SparseMSGDestroy( void *smsg_vdata ) hypre_TFree(smsg_data -> Py_grid_array, HYPRE_MEMORY_HOST); hypre_TFree(smsg_data -> Pz_grid_array, HYPRE_MEMORY_HOST); } - + hypre_FinalizeTiming(smsg_data -> time_index); hypre_TFree(smsg_data, HYPRE_MEMORY_HOST); } +#else + HYPRE_UNUSED_VAR(smsg_vdata); #endif -/* RDF */ + /* RDF */ return ierr; } @@ -156,11 +160,11 @@ HYPRE_Int hypre_SparseMSGSetTol( void *smsg_vdata, HYPRE_Real tol ) { - hypre_SparseMSGData *smsg_data = (hypre_SparseMSGData *)smsg_vdata; + hypre_SparseMSGData *smsg_data = (hypre_SparseMSGData *)smsg_vdata; HYPRE_Int ierr = 0; - + (smsg_data -> tol) = tol; - + return ierr; } @@ -174,9 +178,9 @@ hypre_SparseMSGSetMaxIter( void *smsg_vdata, { hypre_SparseMSGData *smsg_data = (hypre_SparseMSGData *)smsg_vdata; HYPRE_Int ierr = 0; - + (smsg_data -> max_iter) = max_iter; - + return ierr; } @@ -207,25 +211,25 @@ hypre_SparseMSGSetRelChange( void *smsg_vdata, { hypre_SparseMSGData *smsg_data = (hypre_SparseMSGData *)smsg_vdata; HYPRE_Int ierr = 0; - + (smsg_data -> rel_change) = rel_change; - + return ierr; } /*-------------------------------------------------------------------------- * hypre_SparseMSGSetZeroGuess *--------------------------------------------------------------------------*/ - + HYPRE_Int hypre_SparseMSGSetZeroGuess( void *smsg_vdata, HYPRE_Int zero_guess ) { hypre_SparseMSGData *smsg_data = (hypre_SparseMSGData *)smsg_vdata; HYPRE_Int ierr = 0; - + (smsg_data -> zero_guess) = zero_guess; - + return ierr; } @@ -239,9 +243,9 @@ hypre_SparseMSGSetRelaxType( void *smsg_vdata, { hypre_SparseMSGData *smsg_data = (hypre_SparseMSGData *)smsg_vdata; HYPRE_Int ierr = 0; - + (smsg_data -> relax_type) = relax_type; - + return ierr; } @@ -255,8 +259,8 @@ hypre_SparseMSGSetJacobiWeight( void *smsg_vdata, hypre_SparseMSGData *smsg_data = (hypre_SparseMSGData *)smsg_vdata; (smsg_data -> jacobi_weight) = weight; - (smsg_data -> usr_jacobi_weight)= 1; - + (smsg_data -> usr_jacobi_weight) = 1; + return hypre_error_flag; } @@ -270,9 +274,9 @@ hypre_SparseMSGSetNumPreRelax( void *smsg_vdata, { hypre_SparseMSGData *smsg_data = (hypre_SparseMSGData *)smsg_vdata; HYPRE_Int ierr = 0; - + (smsg_data -> num_pre_relax) = num_pre_relax; - + return ierr; } @@ -286,9 +290,9 @@ hypre_SparseMSGSetNumPostRelax( void *smsg_vdata, { hypre_SparseMSGData *smsg_data = (hypre_SparseMSGData *)smsg_vdata; HYPRE_Int ierr = 0; - + (smsg_data -> num_post_relax) = num_post_relax; - + return ierr; } @@ -302,9 +306,9 @@ hypre_SparseMSGSetNumFineRelax( void *smsg_vdata, { hypre_SparseMSGData *smsg_data = (hypre_SparseMSGData *)smsg_vdata; HYPRE_Int ierr = 0; - + (smsg_data -> num_fine_relax) = num_fine_relax; - + return ierr; } @@ -318,9 +322,9 @@ hypre_SparseMSGSetLogging( void *smsg_vdata, { hypre_SparseMSGData *smsg_data = (hypre_SparseMSGData *)smsg_vdata; HYPRE_Int ierr = 0; - + (smsg_data -> logging) = logging; - + return ierr; } @@ -330,13 +334,13 @@ hypre_SparseMSGSetLogging( void *smsg_vdata, HYPRE_Int hypre_SparseMSGSetPrintLevel( void *smsg_vdata, - HYPRE_Int print_level ) + HYPRE_Int print_level ) { hypre_SparseMSGData *smsg_data = (hypre_SparseMSGData *)smsg_vdata; HYPRE_Int ierr = 0; - + (smsg_data -> print_level) = print_level; - + return ierr; } @@ -375,19 +379,19 @@ hypre_SparseMSGPrintLogging( void *smsg_vdata, if (myid == 0) { - if (print_level > 0) - { - if (logging > 0) - { - for (i = 0; i < num_iterations; i++) - { - hypre_printf("Residual norm[%d] = %e ",i,norms[i]); - hypre_printf("Relative residual norm[%d] = %e\n",i,rel_norms[i]); - } - } - } + if (print_level > 0) + { + if (logging > 0) + { + for (i = 0; i < num_iterations; i++) + { + hypre_printf("Residual norm[%d] = %e ", i, norms[i]); + hypre_printf("Relative residual norm[%d] = %e\n", i, rel_norms[i]); + } + } + } } - + return ierr; } @@ -405,10 +409,10 @@ hypre_SparseMSGGetFinalRelativeResidualNorm( void *smsg_vdata, HYPRE_Int num_iterations = (smsg_data -> num_iterations); HYPRE_Int logging = (smsg_data -> logging); HYPRE_Real *rel_norms = (smsg_data -> rel_norms); - + HYPRE_Int ierr = 0; - + if (logging > 0) { if (max_iter == 0) @@ -417,15 +421,13 @@ hypre_SparseMSGGetFinalRelativeResidualNorm( void *smsg_vdata, } else if (num_iterations == max_iter) { - *relative_residual_norm = rel_norms[num_iterations-1]; + *relative_residual_norm = rel_norms[num_iterations - 1]; } else { *relative_residual_norm = rel_norms[num_iterations]; } } - + return ierr; } - - diff --git a/external/hypre/src/struct_ls/sparse_msg.h b/external/hypre/src/struct_ls/sparse_msg.h index bbdde573..c54ca289 100644 --- a/external/hypre/src/struct_ls/sparse_msg.h +++ b/external/hypre/src/struct_ls/sparse_msg.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -21,7 +21,7 @@ typedef struct { MPI_Comm comm; - + HYPRE_Real tol; HYPRE_Int max_iter; HYPRE_Int rel_change; @@ -37,14 +37,15 @@ typedef struct HYPRE_Int num_fine_relax; /* number of fine relaxation sweeps */ HYPRE_Int num_grids[3]; /* number of grids in each dim */ - HYPRE_Int num_all_grids; - HYPRE_Int num_levels; - + HYPRE_Int num_all_grids; + HYPRE_Int num_levels; + hypre_StructGrid **grid_array; hypre_StructGrid **Px_grid_array; hypre_StructGrid **Py_grid_array; hypre_StructGrid **Pz_grid_array; + HYPRE_MemoryLocation memory_location; /* memory location of data */ HYPRE_Real *data; hypre_StructMatrix **A_array; hypre_StructMatrix **Px_array; diff --git a/external/hypre/src/struct_ls/sparse_msg2_setup_rap.c b/external/hypre/src/struct_ls/sparse_msg2_setup_rap.c index 687d77f3..a247a2bc 100644 --- a/external/hypre/src/struct_ls/sparse_msg2_setup_rap.c +++ b/external/hypre/src/struct_ls/sparse_msg2_setup_rap.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -33,6 +33,9 @@ hypre_SparseMSG2CreateRAPOp( hypre_StructMatrix *R, hypre_StructGrid *coarse_grid, HYPRE_Int cdir ) { + HYPRE_UNUSED_VAR(R); + HYPRE_UNUSED_VAR(P); + hypre_StructMatrix *RAP; hypre_Index *RAP_stencil_shape; @@ -73,7 +76,7 @@ hypre_SparseMSG2CreateRAPOp( hypre_StructMatrix *R, /*-------------------------------------------------------------- * Storage for 9 elements (c,w,e,n,s,sw,se,nw,se) *--------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,i,j,0); + hypre_SetIndex3(index_temp, i, j, 0); MapIndex(index_temp, cdir, RAP_stencil_shape[stencil_rank]); stencil_rank++; } @@ -103,9 +106,9 @@ hypre_SparseMSG2CreateRAPOp( hypre_StructMatrix *R, /*-------------------------------------------------------------- * Store 5 elements in (c,w,s,sw,se) *--------------------------------------------------------------*/ - if( i+j <=0 ) + if ( i + j <= 0 ) { - hypre_SetIndex3(index_temp,i,j,0); + hypre_SetIndex3(index_temp, i, j, 0); MapIndex(index_temp, cdir, RAP_stencil_shape[stencil_rank]); stencil_rank++; } @@ -192,7 +195,7 @@ hypre_SparseMSG2BuildRAPSym( hypre_StructMatrix *A, HYPRE_Real *ra, *rb; HYPRE_Real *a_cc, *a_cw, *a_ce, *a_cs, *a_cn; - HYPRE_Real *a_csw, *a_cse, *a_cnw; + HYPRE_Real *a_csw = NULL, *a_cse = NULL, *a_cnw = NULL; HYPRE_Real *rap_cc, *rap_cw, *rap_cs; HYPRE_Real *rap_csw, *rap_cse; @@ -241,14 +244,14 @@ hypre_SparseMSG2BuildRAPSym( hypre_StructMatrix *A, * pb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); pa = hypre_StructMatrixExtractPointerByIndex(P, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); pb = hypre_StructMatrixExtractPointerByIndex(P, fi, index) - - hypre_BoxOffsetDistance(P_dbox, index); + hypre_BoxOffsetDistance(P_dbox, index); /*----------------------------------------------------------------- * Extract pointers for restriction operator: @@ -256,14 +259,14 @@ hypre_SparseMSG2BuildRAPSym( hypre_StructMatrix *A, * rb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); ra = hypre_StructMatrixExtractPointerByIndex(R, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); rb = hypre_StructMatrixExtractPointerByIndex(R, fi, index) - - hypre_BoxOffsetDistance(R_dbox, index); + hypre_BoxOffsetDistance(R_dbox, index); /*----------------------------------------------------------------- * Extract pointers for 5-point fine grid operator: @@ -275,23 +278,23 @@ hypre_SparseMSG2BuildRAPSym( hypre_StructMatrix *A, * a_cn is pointer for north coefficient *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,0); + hypre_SetIndex3(index_temp, 0, 0, 0); MapIndex(index_temp, cdir, index); a_cc = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,0,0); + hypre_SetIndex3(index_temp, -1, 0, 0); MapIndex(index_temp, cdir, index); a_cw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); a_ce = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); a_cs = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); a_cn = hypre_StructMatrixExtractPointerByIndex(A, fi, index); @@ -304,17 +307,17 @@ hypre_SparseMSG2BuildRAPSym( hypre_StructMatrix *A, * a_cne is pointer for northeast coefficient *-----------------------------------------------------------------*/ - if(fine_stencil_size > 5) + if (fine_stencil_size > 5) { - hypre_SetIndex3(index_temp,-1,-1,0); + hypre_SetIndex3(index_temp, -1, -1, 0); MapIndex(index_temp, cdir, index); a_csw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,-1,0); + hypre_SetIndex3(index_temp, 1, -1, 0); MapIndex(index_temp, cdir, index); a_cse = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,1,0); + hypre_SetIndex3(index_temp, -1, 1, 0); MapIndex(index_temp, cdir, index); a_cnw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); } @@ -327,23 +330,23 @@ hypre_SparseMSG2BuildRAPSym( hypre_StructMatrix *A, * rap_cc is pointer for center coefficient (etc.) *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,0); + hypre_SetIndex3(index_temp, 0, 0, 0); MapIndex(index_temp, cdir, index); rap_cc = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,0,0); + hypre_SetIndex3(index_temp, -1, 0, 0); MapIndex(index_temp, cdir, index); rap_cw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); rap_cs = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,-1,0); + hypre_SetIndex3(index_temp, -1, -1, 0); MapIndex(index_temp, cdir, index); rap_csw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,-1,0); + hypre_SetIndex3(index_temp, 1, -1, 0); MapIndex(index_temp, cdir, index); rap_cse = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); @@ -355,13 +358,13 @@ hypre_SparseMSG2BuildRAPSym( hypre_StructMatrix *A, * Offsets are used in refering to data associated with other points. *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); - yOffsetA = hypre_BoxOffsetDistance(A_dbox,index); - yOffsetP = hypre_BoxOffsetDistance(P_dbox,index); - hypre_SetIndex3(index_temp,1,0,0); + yOffsetA = hypre_BoxOffsetDistance(A_dbox, index); + yOffsetP = hypre_BoxOffsetDistance(P_dbox, index); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); - xOffsetP = hypre_BoxOffsetDistance(P_dbox,index); + xOffsetP = hypre_BoxOffsetDistance(P_dbox, index); /*----------------------------------------------------------------- * Switch statement to direct control to apropriate BoxLoop depending @@ -397,36 +400,36 @@ hypre_SparseMSG2BuildRAPSym( hypre_StructMatrix *A, iP1 = iP - yOffsetP; rap_cs[iAc] = rb[iR] * a_cc[iAm1] * pa[iP1] - + rb[iR] * a_cs[iAm1] - + a_cs[iA] * pa[iP1]; + + rb[iR] * a_cs[iAm1] + + a_cs[iA] * pa[iP1]; iP1 = iP - yOffsetP + xOffsetP; rap_cse[iAc] = rb[iR] * a_ce[iAm1] * pa[iP1]; iP1 = iP - xOffsetP; rap_cw[iAc] = a_cw[iA] - + rb[iR] * a_cw[iAm1] * pb[iP1] - + ra[iR] * a_cw[iAp1] * pa[iP1]; + + rb[iR] * a_cw[iAm1] * pb[iP1] + + ra[iR] * a_cw[iAp1] * pa[iP1]; rap_cc[iAc] = a_cc[iA] - + rb[iR] * a_cc[iAm1] * pb[iP] - + ra[iR] * a_cc[iAp1] * pa[iP] - + rb[iR] * a_cn[iAm1] - + ra[iR] * a_cs[iAp1] - + a_cs[iA] * pb[iP] - + a_cn[iA] * pa[iP]; + + rb[iR] * a_cc[iAm1] * pb[iP] + + ra[iR] * a_cc[iAp1] * pa[iP] + + rb[iR] * a_cn[iAm1] + + ra[iR] * a_cs[iAp1] + + a_cs[iA] * pb[iP] + + a_cn[iA] * pa[iP]; } hypre_BoxLoop4End(iP, iR, iA, iAc); #undef DEVICE_VAR break; - /*-------------------------------------------------------------- - * Loop for symmetric 9-point fine grid operator; produces a - * symmetric 9-point coarse grid operator. We calculate only the - * lower triangular stencil entries: (southwest, south, southeast, - * west, and center). - *--------------------------------------------------------------*/ + /*-------------------------------------------------------------- + * Loop for symmetric 9-point fine grid operator; produces a + * symmetric 9-point coarse grid operator. We calculate only the + * lower triangular stencil entries: (southwest, south, southeast, + * west, and center). + *--------------------------------------------------------------*/ default: @@ -444,35 +447,35 @@ hypre_SparseMSG2BuildRAPSym( hypre_StructMatrix *A, HYPRE_Int iP1 = iP - yOffsetP - xOffsetP; rap_csw[iAc] = rb[iR] * a_cw[iAm1] * pa[iP1] - + rb[iR] * a_csw[iAm1] - + a_csw[iA] * pa[iP1]; + + rb[iR] * a_csw[iAm1] + + a_csw[iA] * pa[iP1]; iP1 = iP - yOffsetP; rap_cs[iAc] = rb[iR] * a_cc[iAm1] * pa[iP1] - + rb[iR] * a_cs[iAm1] - + a_cs[iA] * pa[iP1]; + + rb[iR] * a_cs[iAm1] + + a_cs[iA] * pa[iP1]; iP1 = iP - yOffsetP + xOffsetP; rap_cse[iAc] = rb[iR] * a_ce[iAm1] * pa[iP1] - + rb[iR] * a_cse[iAm1] - + a_cse[iA] * pa[iP1]; + + rb[iR] * a_cse[iAm1] + + a_cse[iA] * pa[iP1]; iP1 = iP - xOffsetP; rap_cw[iAc] = a_cw[iA] - + rb[iR] * a_cw[iAm1] * pb[iP1] - + ra[iR] * a_cw[iAp1] * pa[iP1] - + rb[iR] * a_cnw[iAm1] - + ra[iR] * a_csw[iAp1] - + a_csw[iA] * pb[iP1] - + a_cnw[iA] * pa[iP1]; + + rb[iR] * a_cw[iAm1] * pb[iP1] + + ra[iR] * a_cw[iAp1] * pa[iP1] + + rb[iR] * a_cnw[iAm1] + + ra[iR] * a_csw[iAp1] + + a_csw[iA] * pb[iP1] + + a_cnw[iA] * pa[iP1]; rap_cc[iAc] = a_cc[iA] - + rb[iR] * a_cc[iAm1] * pb[iP] - + ra[iR] * a_cc[iAp1] * pa[iP] - + rb[iR] * a_cn[iAm1] - + ra[iR] * a_cs[iAp1] - + a_cs[iA] * pb[iP] - + a_cn[iA] * pa[iP]; + + rb[iR] * a_cc[iAm1] * pb[iP] + + ra[iR] * a_cc[iAp1] * pa[iP] + + rb[iR] * a_cn[iAm1] + + ra[iR] * a_cs[iAp1] + + a_cs[iA] * pb[iP] + + a_cn[iA] * pa[iP]; } hypre_BoxLoop4End(iP, iR, iA, iAc); @@ -530,8 +533,8 @@ hypre_SparseMSG2BuildRAPNoSym( hypre_StructMatrix *A, HYPRE_Real *pa, *pb; HYPRE_Real *ra, *rb; - HYPRE_Real *a_cc, *a_cw, *a_ce, *a_cn; - HYPRE_Real *a_cse, *a_cnw, *a_cne; + HYPRE_Real *a_cc = NULL, *a_cw = NULL, *a_ce = NULL, *a_cn = NULL; + HYPRE_Real *a_cse = NULL, *a_cnw = NULL, *a_cne = NULL; HYPRE_Real *rap_ce, *rap_cn; HYPRE_Real *rap_cnw, *rap_cne; @@ -580,14 +583,14 @@ hypre_SparseMSG2BuildRAPNoSym( hypre_StructMatrix *A, * pb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); pa = hypre_StructMatrixExtractPointerByIndex(P, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); pb = hypre_StructMatrixExtractPointerByIndex(P, fi, index) - - hypre_BoxOffsetDistance(P_dbox, index); + hypre_BoxOffsetDistance(P_dbox, index); /*----------------------------------------------------------------- * Extract pointers for restriction operator: @@ -595,14 +598,14 @@ hypre_SparseMSG2BuildRAPNoSym( hypre_StructMatrix *A, * rb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); ra = hypre_StructMatrixExtractPointerByIndex(R, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); rb = hypre_StructMatrixExtractPointerByIndex(R, fi, index) - - hypre_BoxOffsetDistance(R_dbox, index); + hypre_BoxOffsetDistance(R_dbox, index); /*----------------------------------------------------------------- * Extract pointers for 5-point fine grid operator: @@ -614,19 +617,19 @@ hypre_SparseMSG2BuildRAPNoSym( hypre_StructMatrix *A, * a_cn is pointer for north coefficient *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,0); + hypre_SetIndex3(index_temp, 0, 0, 0); MapIndex(index_temp, cdir, index); a_cc = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,0,0); + hypre_SetIndex3(index_temp, -1, 0, 0); MapIndex(index_temp, cdir, index); a_cw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); a_ce = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); a_cn = hypre_StructMatrixExtractPointerByIndex(A, fi, index); @@ -639,17 +642,17 @@ hypre_SparseMSG2BuildRAPNoSym( hypre_StructMatrix *A, * a_cne is pointer for northeast coefficient *-----------------------------------------------------------------*/ - if(fine_stencil_size > 5) + if (fine_stencil_size > 5) { - hypre_SetIndex3(index_temp,1,-1,0); + hypre_SetIndex3(index_temp, 1, -1, 0); MapIndex(index_temp, cdir, index); a_cse = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,1,0); + hypre_SetIndex3(index_temp, -1, 1, 0); MapIndex(index_temp, cdir, index); a_cnw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,1,0); + hypre_SetIndex3(index_temp, 1, 1, 0); MapIndex(index_temp, cdir, index); a_cne = hypre_StructMatrixExtractPointerByIndex(A, fi, index); @@ -663,19 +666,19 @@ hypre_SparseMSG2BuildRAPNoSym( hypre_StructMatrix *A, * rap_ce is pointer for east coefficient (etc.) *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); rap_ce = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); rap_cn = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,1,0); + hypre_SetIndex3(index_temp, 1, 1, 0); MapIndex(index_temp, cdir, index); rap_cne = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,1,0); + hypre_SetIndex3(index_temp, -1, 1, 0); MapIndex(index_temp, cdir, index); rap_cnw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); @@ -687,13 +690,13 @@ hypre_SparseMSG2BuildRAPNoSym( hypre_StructMatrix *A, * Offsets are used in refering to data associated with other points. *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); - yOffsetA = hypre_BoxOffsetDistance(A_dbox,index); - yOffsetP = hypre_BoxOffsetDistance(P_dbox,index); - hypre_SetIndex3(index_temp,1,0,0); + yOffsetA = hypre_BoxOffsetDistance(A_dbox, index); + yOffsetP = hypre_BoxOffsetDistance(P_dbox, index); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); - xOffsetP = hypre_BoxOffsetDistance(P_dbox,index); + xOffsetP = hypre_BoxOffsetDistance(P_dbox, index); /*----------------------------------------------------------------- * Switch statement to direct control to appropriate BoxLoop depending @@ -728,27 +731,27 @@ hypre_SparseMSG2BuildRAPNoSym( hypre_StructMatrix *A, iP1 = iP + yOffsetP; rap_cn[iAc] = ra[iR] * a_cc[iAp1] * pb[iP1] - + ra[iR] * a_cn[iAp1] - + a_cn[iA] * pb[iP1]; + + ra[iR] * a_cn[iAp1] + + a_cn[iA] * pb[iP1]; iP1 = iP + yOffsetP - xOffsetP; rap_cnw[iAc] = ra[iR] * a_cw[iAp1] * pb[iP1]; iP1 = iP + xOffsetP; rap_ce[iAc] = a_ce[iA] - + rb[iR] * a_ce[iAm1] * pb[iP1] - + ra[iR] * a_ce[iAp1] * pa[iP1]; + + rb[iR] * a_ce[iAm1] * pb[iP1] + + ra[iR] * a_ce[iAp1] * pa[iP1]; } hypre_BoxLoop4End(iP, iR, iA, iAc); #undef DEVICE_VAR break; - /*-------------------------------------------------------------- - * Loop for 9-point fine grid operator; produces upper triangular - * part of 9-point coarse grid operator - excludes diagonal. - * stencil entries: (northeast, north, northwest, and east) - *--------------------------------------------------------------*/ + /*-------------------------------------------------------------- + * Loop for 9-point fine grid operator; produces upper triangular + * part of 9-point coarse grid operator - excludes diagonal. + * stencil entries: (northeast, north, northwest, and east) + *--------------------------------------------------------------*/ default: @@ -766,27 +769,27 @@ hypre_SparseMSG2BuildRAPNoSym( hypre_StructMatrix *A, HYPRE_Int iP1 = iP + yOffsetP + xOffsetP; rap_cne[iAc] = ra[iR] * a_ce[iAp1] * pb[iP1] - + ra[iR] * a_cne[iAp1] - + a_cne[iA] * pb[iP1]; + + ra[iR] * a_cne[iAp1] + + a_cne[iA] * pb[iP1]; iP1 = iP + yOffsetP; rap_cn[iAc] = ra[iR] * a_cc[iAp1] * pb[iP1] - + ra[iR] * a_cn[iAp1] - + a_cn[iA] * pb[iP1]; + + ra[iR] * a_cn[iAp1] + + a_cn[iA] * pb[iP1]; iP1 = iP + yOffsetP - xOffsetP; rap_cnw[iAc] = ra[iR] * a_cw[iAp1] * pb[iP1] - + ra[iR] * a_cnw[iAp1] - + a_cnw[iA] * pb[iP1]; + + ra[iR] * a_cnw[iAp1] + + a_cnw[iA] * pb[iP1]; iP1 = iP + xOffsetP; rap_ce[iAc] = a_ce[iA] - + rb[iR] * a_ce[iAm1] * pb[iP1] - + ra[iR] * a_ce[iAp1] * pa[iP1] - + rb[iR] * a_cne[iAm1] - + ra[iR] * a_cse[iAp1] - + a_cse[iA] * pb[iP1] - + a_cne[iA] * pa[iP1]; + + rb[iR] * a_ce[iAm1] * pb[iP1] + + ra[iR] * a_ce[iAp1] * pa[iP1] + + rb[iR] * a_cne[iAm1] + + ra[iR] * a_cse[iAp1] + + a_cse[iA] * pb[iP1] + + a_cne[iA] * pa[iP1]; } hypre_BoxLoop4End(iP, iR, iA, iAc); #undef DEVICE_VAR @@ -799,4 +802,3 @@ hypre_SparseMSG2BuildRAPNoSym( hypre_StructMatrix *A, return ierr; } - diff --git a/external/hypre/src/struct_ls/sparse_msg3_setup_rap.c b/external/hypre/src/struct_ls/sparse_msg3_setup_rap.c index d4072863..6cd90a7e 100644 --- a/external/hypre/src/struct_ls/sparse_msg3_setup_rap.c +++ b/external/hypre/src/struct_ls/sparse_msg3_setup_rap.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -34,6 +34,9 @@ hypre_SparseMSG3CreateRAPOp( hypre_StructMatrix *R, hypre_StructGrid *coarse_grid, HYPRE_Int cdir ) { + HYPRE_UNUSED_VAR(R); + HYPRE_UNUSED_VAR(P); + hypre_StructMatrix *RAP; hypre_Index *RAP_stencil_shape; @@ -73,7 +76,7 @@ hypre_SparseMSG3CreateRAPOp( hypre_StructMatrix *R, * lower triangular means the lower triangular part on the matrix * in the standard lexicographic ordering. *-----------------------------------------------------------------------*/ - if( A_stencil_size == 7) + if ( A_stencil_size == 7) { RAP_stencil_size = 19; if (hypre_StructMatrixSymmetric(A)) @@ -87,9 +90,9 @@ hypre_SparseMSG3CreateRAPOp( hypre_StructMatrix *R, { for (i = -1; i < 2; i++) { - if ((i*j*k == 0) && (stencil_rank < RAP_stencil_size)) + if ((i * j * k == 0) && (stencil_rank < RAP_stencil_size)) { - hypre_SetIndex3(index_temp,i,j,k); + hypre_SetIndex3(index_temp, i, j, k); MapIndex(index_temp, cdir, RAP_stencil_shape[stencil_rank]); stencil_rank++; @@ -124,7 +127,7 @@ hypre_SparseMSG3CreateRAPOp( hypre_StructMatrix *R, { if (stencil_rank < RAP_stencil_size) { - hypre_SetIndex3(index_temp,i,j,k); + hypre_SetIndex3(index_temp, i, j, k); MapIndex(index_temp, cdir, RAP_stencil_shape[stencil_rank]); stencil_rank++; @@ -210,17 +213,18 @@ hypre_SparseMSG3BuildRAPSym( hypre_StructMatrix *A, HYPRE_Real *pa, *pb; HYPRE_Real *ra, *rb; - HYPRE_Real *a_cc, *a_cw, *a_ce, *a_cs, *a_cn; - HYPRE_Real *a_ac, *a_aw, *a_as; - HYPRE_Real *a_bc, *a_bw, *a_be, *a_bs, *a_bn; - HYPRE_Real *a_csw, *a_cse, *a_cnw, *a_cne; - HYPRE_Real *a_asw, *a_ase; - HYPRE_Real *a_bsw, *a_bse, *a_bnw, *a_bne; + HYPRE_Real *a_cc = NULL, *a_cw = NULL, *a_ce = NULL, *a_cs = NULL, *a_cn = NULL; + HYPRE_Real *a_ac = NULL, *a_aw = NULL, *a_as = NULL; + HYPRE_Real *a_bc = NULL, *a_bw = NULL, *a_be = NULL, *a_bs = NULL, *a_bn = NULL; + HYPRE_Real *a_csw = NULL, *a_cse = NULL, *a_cnw = NULL, *a_cne = NULL; + HYPRE_Real *a_asw = NULL, *a_ase = NULL; + HYPRE_Real *a_bsw = NULL, *a_bse = NULL, *a_bnw = NULL, *a_bne = NULL; - HYPRE_Real *rap_cc, *rap_cw, *rap_cs; - HYPRE_Real *rap_bc, *rap_bw, *rap_be, *rap_bs, *rap_bn; - HYPRE_Real *rap_csw, *rap_cse; - HYPRE_Real *rap_bsw, *rap_bse, *rap_bnw, *rap_bne; + HYPRE_Real *rap_cc = NULL, *rap_cw = NULL, *rap_cs = NULL; + HYPRE_Real *rap_bc = NULL, *rap_bw = NULL, *rap_be = NULL; + HYPRE_Real *rap_bs = NULL, *rap_bn = NULL; + HYPRE_Real *rap_csw = NULL, *rap_cse = NULL; + HYPRE_Real *rap_bsw = NULL, *rap_bse = NULL, *rap_bnw = NULL, *rap_bne = NULL; HYPRE_Int zOffsetA; HYPRE_Int xOffsetP; @@ -267,14 +271,14 @@ hypre_SparseMSG3BuildRAPSym( hypre_StructMatrix *A, * pb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,-1); + hypre_SetIndex3(index_temp, 0, 0, -1); MapIndex(index_temp, cdir, index); pa = hypre_StructMatrixExtractPointerByIndex(P, fi, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); pb = hypre_StructMatrixExtractPointerByIndex(P, fi, index) - - hypre_BoxOffsetDistance(P_dbox, index); + hypre_BoxOffsetDistance(P_dbox, index); /*----------------------------------------------------------------- * Extract pointers for restriction operator: @@ -282,14 +286,14 @@ hypre_SparseMSG3BuildRAPSym( hypre_StructMatrix *A, * rb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,-1); + hypre_SetIndex3(index_temp, 0, 0, -1); MapIndex(index_temp, cdir, index); ra = hypre_StructMatrixExtractPointerByIndex(R, fi, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); rb = hypre_StructMatrixExtractPointerByIndex(R, fi, index) - - hypre_BoxOffsetDistance(R_dbox, index); + hypre_BoxOffsetDistance(R_dbox, index); /*----------------------------------------------------------------- * Extract pointers for 7-point fine grid operator: @@ -303,31 +307,31 @@ hypre_SparseMSG3BuildRAPSym( hypre_StructMatrix *A, * a_bc is pointer for center coefficient in plane below *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,0); + hypre_SetIndex3(index_temp, 0, 0, 0); MapIndex(index_temp, cdir, index); a_cc = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,0,0); + hypre_SetIndex3(index_temp, -1, 0, 0); MapIndex(index_temp, cdir, index); a_cw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); a_ce = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); a_cs = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); a_cn = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); a_ac = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,0,-1); + hypre_SetIndex3(index_temp, 0, 0, -1); MapIndex(index_temp, cdir, index); a_bc = hypre_StructMatrixExtractPointerByIndex(A, fi, index); @@ -350,43 +354,43 @@ hypre_SparseMSG3BuildRAPSym( hypre_StructMatrix *A, if (fine_stencil_size > 7) { - hypre_SetIndex3(index_temp,-1,0,1); + hypre_SetIndex3(index_temp, -1, 0, 1); MapIndex(index_temp, cdir, index); a_aw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,-1,1); + hypre_SetIndex3(index_temp, 0, -1, 1); MapIndex(index_temp, cdir, index); a_as = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,0,-1); + hypre_SetIndex3(index_temp, -1, 0, -1); MapIndex(index_temp, cdir, index); a_bw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,0,-1); + hypre_SetIndex3(index_temp, 1, 0, -1); MapIndex(index_temp, cdir, index); a_be = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,-1,-1); + hypre_SetIndex3(index_temp, 0, -1, -1); MapIndex(index_temp, cdir, index); a_bs = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,1,-1); + hypre_SetIndex3(index_temp, 0, 1, -1); MapIndex(index_temp, cdir, index); a_bn = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,-1,0); + hypre_SetIndex3(index_temp, -1, -1, 0); MapIndex(index_temp, cdir, index); a_csw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,-1,0); + hypre_SetIndex3(index_temp, 1, -1, 0); MapIndex(index_temp, cdir, index); a_cse = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,1,0); + hypre_SetIndex3(index_temp, -1, 1, 0); MapIndex(index_temp, cdir, index); a_cnw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,1,0); + hypre_SetIndex3(index_temp, 1, 1, 0); MapIndex(index_temp, cdir, index); a_cne = hypre_StructMatrixExtractPointerByIndex(A, fi, index); } @@ -406,27 +410,27 @@ hypre_SparseMSG3BuildRAPSym( hypre_StructMatrix *A, if (fine_stencil_size > 19) { - hypre_SetIndex3(index_temp,-1,-1,1); + hypre_SetIndex3(index_temp, -1, -1, 1); MapIndex(index_temp, cdir, index); a_asw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,-1,1); + hypre_SetIndex3(index_temp, 1, -1, 1); MapIndex(index_temp, cdir, index); a_ase = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,-1,-1); + hypre_SetIndex3(index_temp, -1, -1, -1); MapIndex(index_temp, cdir, index); a_bsw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,-1,-1); + hypre_SetIndex3(index_temp, 1, -1, -1); MapIndex(index_temp, cdir, index); a_bse = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,1,-1); + hypre_SetIndex3(index_temp, -1, 1, -1); MapIndex(index_temp, cdir, index); a_bnw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,1,-1); + hypre_SetIndex3(index_temp, 1, 1, -1); MapIndex(index_temp, cdir, index); a_bne = hypre_StructMatrixExtractPointerByIndex(A, fi, index); } @@ -439,43 +443,43 @@ hypre_SparseMSG3BuildRAPSym( hypre_StructMatrix *A, * rap_cc is pointer for center coefficient (etc.) *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,0); + hypre_SetIndex3(index_temp, 0, 0, 0); MapIndex(index_temp, cdir, index); rap_cc = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,0,0); + hypre_SetIndex3(index_temp, -1, 0, 0); MapIndex(index_temp, cdir, index); rap_cw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); rap_cs = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,0,-1); + hypre_SetIndex3(index_temp, 0, 0, -1); MapIndex(index_temp, cdir, index); rap_bc = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,0,-1); + hypre_SetIndex3(index_temp, -1, 0, -1); MapIndex(index_temp, cdir, index); rap_bw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,0,-1); + hypre_SetIndex3(index_temp, 1, 0, -1); MapIndex(index_temp, cdir, index); rap_be = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,-1,-1); + hypre_SetIndex3(index_temp, 0, -1, -1); MapIndex(index_temp, cdir, index); rap_bs = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,1,-1); + hypre_SetIndex3(index_temp, 0, 1, -1); MapIndex(index_temp, cdir, index); rap_bn = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,-1,0); + hypre_SetIndex3(index_temp, -1, -1, 0); MapIndex(index_temp, cdir, index); rap_csw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,-1,0); + hypre_SetIndex3(index_temp, 1, -1, 0); MapIndex(index_temp, cdir, index); rap_cse = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); @@ -492,19 +496,19 @@ hypre_SparseMSG3BuildRAPSym( hypre_StructMatrix *A, if (fine_stencil_size > 7) { - hypre_SetIndex3(index_temp,-1,-1,-1); + hypre_SetIndex3(index_temp, -1, -1, -1); MapIndex(index_temp, cdir, index); rap_bsw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,-1,-1); + hypre_SetIndex3(index_temp, 1, -1, -1); MapIndex(index_temp, cdir, index); rap_bse = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,1,-1); + hypre_SetIndex3(index_temp, -1, 1, -1); MapIndex(index_temp, cdir, index); rap_bnw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,1,-1); + hypre_SetIndex3(index_temp, 1, 1, -1); MapIndex(index_temp, cdir, index); rap_bne = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); } @@ -517,16 +521,16 @@ hypre_SparseMSG3BuildRAPSym( hypre_StructMatrix *A, * Offsets are used in refering to data associated with other points. *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); - zOffsetA = hypre_BoxOffsetDistance(A_dbox,index); - zOffsetP = hypre_BoxOffsetDistance(P_dbox,index); - hypre_SetIndex3(index_temp,0,1,0); + zOffsetA = hypre_BoxOffsetDistance(A_dbox, index); + zOffsetP = hypre_BoxOffsetDistance(P_dbox, index); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); - yOffsetP = hypre_BoxOffsetDistance(P_dbox,index); - hypre_SetIndex3(index_temp,1,0,0); + yOffsetP = hypre_BoxOffsetDistance(P_dbox, index); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); - xOffsetP = hypre_BoxOffsetDistance(P_dbox,index); + xOffsetP = hypre_BoxOffsetDistance(P_dbox, index); /*-------------------------------------------------------------------- * Switch statement to direct control to apropriate BoxLoop depending @@ -566,8 +570,8 @@ hypre_SparseMSG3BuildRAPSym( hypre_StructMatrix *A, iP1 = iP - zOffsetP; rap_bc[iAc] = a_bc[iA] * pa[iP1] - + rb[iR] * a_cc[iAm1] * pa[iP1] - + rb[iR] * a_bc[iAm1]; + + rb[iR] * a_cc[iAm1] * pa[iP1] + + rb[iR] * a_bc[iAm1]; iP1 = iP - zOffsetP + xOffsetP; rap_be[iAc] = rb[iR] * a_ce[iAm1] * pa[iP1]; @@ -577,25 +581,25 @@ hypre_SparseMSG3BuildRAPSym( hypre_StructMatrix *A, iP1 = iP - yOffsetP; rap_cs[iAc] = a_cs[iA] - + rb[iR] * a_cs[iAm1] * pb[iP1] - + ra[iR] * a_cs[iAp1] * pa[iP1]; + + rb[iR] * a_cs[iAm1] * pb[iP1] + + ra[iR] * a_cs[iAp1] * pa[iP1]; iP1 = iP - xOffsetP; rap_cw[iAc] = a_cw[iA] - + rb[iR] * a_cw[iAm1] * pb[iP1] - + ra[iR] * a_cw[iAp1] * pa[iP1]; + + rb[iR] * a_cw[iAm1] * pb[iP1] + + ra[iR] * a_cw[iAp1] * pa[iP1]; rap_csw[iAc] = 0.0; rap_cse[iAc] = 0.0; rap_cc[iAc] = a_cc[iA] - + rb[iR] * a_cc[iAm1] * pb[iP] - + ra[iR] * a_cc[iAp1] * pa[iP] - + rb[iR] * a_ac[iAm1] - + ra[iR] * a_bc[iAp1] - + a_bc[iA] * pb[iP] - + a_ac[iA] * pa[iP]; + + rb[iR] * a_cc[iAm1] * pb[iP] + + ra[iR] * a_cc[iAp1] * pa[iP] + + rb[iR] * a_ac[iAm1] + + ra[iR] * a_bc[iAp1] + + a_bc[iA] * pb[iP] + + a_ac[iA] * pa[iP]; } hypre_BoxLoop4End(iP, iR, iA, iAc); @@ -603,14 +607,14 @@ hypre_SparseMSG3BuildRAPSym( hypre_StructMatrix *A, break; - /*-------------------------------------------------------------- - * Loop for symmetric 19-point fine grid operator; produces a - * symmetric 27-point coarse grid operator. We calculate only the - * lower triangular stencil entries: (below-southwest, below-south, - * below-southeast, below-west, below-center, below-east, - * below-northwest, below-north, below-northeast, center-southwest, - * center-south, center-southeast, center-west, and center-center). - *--------------------------------------------------------------*/ + /*-------------------------------------------------------------- + * Loop for symmetric 19-point fine grid operator; produces a + * symmetric 27-point coarse grid operator. We calculate only the + * lower triangular stencil entries: (below-southwest, below-south, + * below-southeast, below-west, below-center, below-east, + * below-northwest, below-north, below-northeast, center-southwest, + * center-south, center-southeast, center-west, and center-center). + *--------------------------------------------------------------*/ case 19: @@ -631,73 +635,73 @@ hypre_SparseMSG3BuildRAPSym( hypre_StructMatrix *A, iP1 = iP - zOffsetP - yOffsetP; rap_bs[iAc] = rb[iR] * a_cs[iAm1] * pa[iP1] - + rb[iR] * a_bs[iAm1] - + a_bs[iA] * pa[iP1]; + + rb[iR] * a_bs[iAm1] + + a_bs[iA] * pa[iP1]; iP1 = iP - zOffsetP - yOffsetP + xOffsetP; rap_bse[iAc] = rb[iR] * a_cse[iAm1] * pa[iP1]; iP1 = iP - zOffsetP - xOffsetP; rap_bw[iAc] = rb[iR] * a_cw[iAm1] * pa[iP1] - + rb[iR] * a_bw[iAm1] - + a_bw[iA] * pa[iP1]; + + rb[iR] * a_bw[iAm1] + + a_bw[iA] * pa[iP1]; iP1 = iP - zOffsetP; rap_bc[iAc] = a_bc[iA] * pa[iP1] - + rb[iR] * a_cc[iAm1] * pa[iP1] - + rb[iR] * a_bc[iAm1]; + + rb[iR] * a_cc[iAm1] * pa[iP1] + + rb[iR] * a_bc[iAm1]; iP1 = iP - zOffsetP + xOffsetP; rap_be[iAc] = rb[iR] * a_ce[iAm1] * pa[iP1] - + rb[iR] * a_be[iAm1] - + a_be[iA] * pa[iP1]; + + rb[iR] * a_be[iAm1] + + a_be[iA] * pa[iP1]; iP1 = iP - zOffsetP + yOffsetP - xOffsetP; rap_bnw[iAc] = rb[iR] * a_cnw[iAm1] * pa[iP1]; iP1 = iP - zOffsetP + yOffsetP; rap_bn[iAc] = rb[iR] * a_cn[iAm1] * pa[iP1] - + rb[iR] * a_bn[iAm1] - + a_bn[iA] * pa[iP1]; + + rb[iR] * a_bn[iAm1] + + a_bn[iA] * pa[iP1]; iP1 = iP - zOffsetP + yOffsetP + xOffsetP; rap_bne[iAc] = rb[iR] * a_cne[iAm1] * pa[iP1]; iP1 = iP - yOffsetP - xOffsetP; rap_csw[iAc] = a_csw[iA] - + rb[iR] * a_csw[iAm1] * pb[iP1] - + ra[iR] * a_csw[iAp1] * pa[iP1]; + + rb[iR] * a_csw[iAm1] * pb[iP1] + + ra[iR] * a_csw[iAp1] * pa[iP1]; iP1 = iP - yOffsetP; rap_cs[iAc] = a_cs[iA] - + rb[iR] * a_cs[iAm1] * pb[iP1] - + ra[iR] * a_cs[iAp1] * pa[iP1] - + a_bs[iA] * pb[iP1] - + a_as[iA] * pa[iP1] - + rb[iR] * a_as[iAm1] - + ra[iR] * a_bs[iAp1]; + + rb[iR] * a_cs[iAm1] * pb[iP1] + + ra[iR] * a_cs[iAp1] * pa[iP1] + + a_bs[iA] * pb[iP1] + + a_as[iA] * pa[iP1] + + rb[iR] * a_as[iAm1] + + ra[iR] * a_bs[iAp1]; iP1 = iP - yOffsetP + xOffsetP; rap_cse[iAc] = a_cse[iA] - + rb[iR] * a_cse[iAm1] * pb[iP1] - + ra[iR] * a_cse[iAp1] * pa[iP1]; + + rb[iR] * a_cse[iAm1] * pb[iP1] + + ra[iR] * a_cse[iAp1] * pa[iP1]; iP1 = iP - xOffsetP; rap_cw[iAc] = a_cw[iA] - + rb[iR] * a_cw[iAm1] * pb[iP1] - + ra[iR] * a_cw[iAp1] * pa[iP1] - + a_bw[iA] * pb[iP1] - + a_aw[iA] * pa[iP1] - + rb[iR] * a_aw[iAm1] - + ra[iR] * a_bw[iAp1]; + + rb[iR] * a_cw[iAm1] * pb[iP1] + + ra[iR] * a_cw[iAp1] * pa[iP1] + + a_bw[iA] * pb[iP1] + + a_aw[iA] * pa[iP1] + + rb[iR] * a_aw[iAm1] + + ra[iR] * a_bw[iAp1]; rap_cc[iAc] = a_cc[iA] - + rb[iR] * a_cc[iAm1] * pb[iP] - + ra[iR] * a_cc[iAp1] * pa[iP] - + rb[iR] * a_ac[iAm1] - + ra[iR] * a_bc[iAp1] - + a_bc[iA] * pb[iP] - + a_ac[iA] * pa[iP]; + + rb[iR] * a_cc[iAm1] * pb[iP] + + ra[iR] * a_cc[iAp1] * pa[iP] + + rb[iR] * a_ac[iAm1] + + ra[iR] * a_bc[iAp1] + + a_bc[iA] * pb[iP] + + a_ac[iA] * pa[iP]; } hypre_BoxLoop4End(iP, iR, iA, iAc); @@ -705,14 +709,14 @@ hypre_SparseMSG3BuildRAPSym( hypre_StructMatrix *A, break; - /*-------------------------------------------------------------- - * Loop for symmetric 27-point fine grid operator; produces a - * symmetric 27-point coarse grid operator. We calculate only the - * lower triangular stencil entries: (below-southwest, below-south, - * below-southeast, below-west, below-center, below-east, - * below-northwest, below-north, below-northeast, center-southwest, - * center-south, center-southeast, center-west, and center-center). - *--------------------------------------------------------------*/ + /*-------------------------------------------------------------- + * Loop for symmetric 27-point fine grid operator; produces a + * symmetric 27-point coarse grid operator. We calculate only the + * lower triangular stencil entries: (below-southwest, below-south, + * below-southeast, below-west, below-center, below-east, + * below-northwest, below-north, below-northeast, center-southwest, + * center-south, center-southeast, center-west, and center-center). + *--------------------------------------------------------------*/ default: @@ -730,92 +734,92 @@ hypre_SparseMSG3BuildRAPSym( hypre_StructMatrix *A, HYPRE_Int iP1 = iP - zOffsetP - yOffsetP - xOffsetP; rap_bsw[iAc] = rb[iR] * a_csw[iAm1] * pa[iP1] - + rb[iR] * a_bsw[iAm1] - + a_bsw[iA] * pa[iP1]; + + rb[iR] * a_bsw[iAm1] + + a_bsw[iA] * pa[iP1]; iP1 = iP - zOffsetP - yOffsetP; rap_bs[iAc] = rb[iR] * a_cs[iAm1] * pa[iP1] - + rb[iR] * a_bs[iAm1] - + a_bs[iA] * pa[iP1]; + + rb[iR] * a_bs[iAm1] + + a_bs[iA] * pa[iP1]; iP1 = iP - zOffsetP - yOffsetP + xOffsetP; rap_bse[iAc] = rb[iR] * a_cse[iAm1] * pa[iP1] - + rb[iR] * a_bse[iAm1] - + a_bse[iA] * pa[iP1]; + + rb[iR] * a_bse[iAm1] + + a_bse[iA] * pa[iP1]; iP1 = iP - zOffsetP - xOffsetP; rap_bw[iAc] = rb[iR] * a_cw[iAm1] * pa[iP1] - + rb[iR] * a_bw[iAm1] - + a_bw[iA] * pa[iP1]; + + rb[iR] * a_bw[iAm1] + + a_bw[iA] * pa[iP1]; iP1 = iP - zOffsetP; rap_bc[iAc] = a_bc[iA] * pa[iP1] - + rb[iR] * a_cc[iAm1] * pa[iP1] - + rb[iR] * a_bc[iAm1]; + + rb[iR] * a_cc[iAm1] * pa[iP1] + + rb[iR] * a_bc[iAm1]; iP1 = iP - zOffsetP + xOffsetP; rap_be[iAc] = rb[iR] * a_ce[iAm1] * pa[iP1] - + rb[iR] * a_be[iAm1] - + a_be[iA] * pa[iP1]; + + rb[iR] * a_be[iAm1] + + a_be[iA] * pa[iP1]; iP1 = iP - zOffsetP + yOffsetP - xOffsetP; rap_bnw[iAc] = rb[iR] * a_cnw[iAm1] * pa[iP1] - + rb[iR] * a_bnw[iAm1] - + a_bnw[iA] * pa[iP1]; + + rb[iR] * a_bnw[iAm1] + + a_bnw[iA] * pa[iP1]; iP1 = iP - zOffsetP + yOffsetP; rap_bn[iAc] = rb[iR] * a_cn[iAm1] * pa[iP1] - + rb[iR] * a_bn[iAm1] - + a_bn[iA] * pa[iP1]; + + rb[iR] * a_bn[iAm1] + + a_bn[iA] * pa[iP1]; iP1 = iP - zOffsetP + yOffsetP + xOffsetP; rap_bne[iAc] = rb[iR] * a_cne[iAm1] * pa[iP1] - + rb[iR] * a_bne[iAm1] - + a_bne[iA] * pa[iP1]; + + rb[iR] * a_bne[iAm1] + + a_bne[iA] * pa[iP1]; iP1 = iP - yOffsetP - xOffsetP; rap_csw[iAc] = a_csw[iA] - + rb[iR] * a_csw[iAm1] * pb[iP1] - + ra[iR] * a_csw[iAp1] * pa[iP1] - + a_bsw[iA] * pb[iP1] - + a_asw[iA] * pa[iP1] - + rb[iR] * a_asw[iAm1] - + ra[iR] * a_bsw[iAp1]; + + rb[iR] * a_csw[iAm1] * pb[iP1] + + ra[iR] * a_csw[iAp1] * pa[iP1] + + a_bsw[iA] * pb[iP1] + + a_asw[iA] * pa[iP1] + + rb[iR] * a_asw[iAm1] + + ra[iR] * a_bsw[iAp1]; iP1 = iP - yOffsetP; rap_cs[iAc] = a_cs[iA] - + rb[iR] * a_cs[iAm1] * pb[iP1] - + ra[iR] * a_cs[iAp1] * pa[iP1] - + a_bs[iA] * pb[iP1] - + a_as[iA] * pa[iP1] - + rb[iR] * a_as[iAm1] - + ra[iR] * a_bs[iAp1]; + + rb[iR] * a_cs[iAm1] * pb[iP1] + + ra[iR] * a_cs[iAp1] * pa[iP1] + + a_bs[iA] * pb[iP1] + + a_as[iA] * pa[iP1] + + rb[iR] * a_as[iAm1] + + ra[iR] * a_bs[iAp1]; iP1 = iP - yOffsetP + xOffsetP; rap_cse[iAc] = a_cse[iA] - + rb[iR] * a_cse[iAm1] * pb[iP1] - + ra[iR] * a_cse[iAp1] * pa[iP1] - + a_bse[iA] * pb[iP1] - + a_ase[iA] * pa[iP1] - + rb[iR] * a_ase[iAm1] - + ra[iR] * a_bse[iAp1]; + + rb[iR] * a_cse[iAm1] * pb[iP1] + + ra[iR] * a_cse[iAp1] * pa[iP1] + + a_bse[iA] * pb[iP1] + + a_ase[iA] * pa[iP1] + + rb[iR] * a_ase[iAm1] + + ra[iR] * a_bse[iAp1]; iP1 = iP - xOffsetP; rap_cw[iAc] = a_cw[iA] - + rb[iR] * a_cw[iAm1] * pb[iP1] - + ra[iR] * a_cw[iAp1] * pa[iP1] - + a_bw[iA] * pb[iP1] - + a_aw[iA] * pa[iP1] - + rb[iR] * a_aw[iAm1] - + ra[iR] * a_bw[iAp1]; + + rb[iR] * a_cw[iAm1] * pb[iP1] + + ra[iR] * a_cw[iAp1] * pa[iP1] + + a_bw[iA] * pb[iP1] + + a_aw[iA] * pa[iP1] + + rb[iR] * a_aw[iAm1] + + ra[iR] * a_bw[iAp1]; rap_cc[iAc] = a_cc[iA] - + rb[iR] * a_cc[iAm1] * pb[iP] - + ra[iR] * a_cc[iAp1] * pa[iP] - + rb[iR] * a_ac[iAm1] - + ra[iR] * a_bc[iAp1] - + a_bc[iA] * pb[iP] - + a_ac[iA] * pa[iP]; + + rb[iR] * a_cc[iAm1] * pb[iP] + + ra[iR] * a_cc[iAp1] * pa[iP] + + rb[iR] * a_ac[iAm1] + + ra[iR] * a_bc[iAp1] + + a_bc[iA] * pb[iP] + + a_ac[iA] * pa[iP]; } hypre_BoxLoop4End(iP, iR, iA, iAc); #undef DEVICE_VAR @@ -872,17 +876,18 @@ hypre_SparseMSG3BuildRAPNoSym( hypre_StructMatrix *A, HYPRE_Real *pa, *pb; HYPRE_Real *ra, *rb; - HYPRE_Real *a_cc, *a_cw, *a_ce, *a_cs, *a_cn; - HYPRE_Real *a_ac, *a_aw, *a_ae, *a_as, *a_an; - HYPRE_Real *a_be, *a_bn; - HYPRE_Real *a_csw, *a_cse, *a_cnw, *a_cne; - HYPRE_Real *a_asw, *a_ase, *a_anw, *a_ane; - HYPRE_Real *a_bnw, *a_bne; + HYPRE_Real *a_cc = NULL, *a_cw = NULL, *a_ce = NULL, *a_cs = NULL, *a_cn = NULL; + HYPRE_Real *a_ac = NULL, *a_aw = NULL, *a_ae = NULL, *a_as = NULL, *a_an = NULL; + HYPRE_Real *a_be = NULL, *a_bn = NULL; + HYPRE_Real *a_csw = NULL, *a_cse = NULL, *a_cnw = NULL, *a_cne = NULL; + HYPRE_Real *a_asw = NULL, *a_ase = NULL, *a_anw = NULL, *a_ane = NULL; + HYPRE_Real *a_bnw = NULL, *a_bne = NULL; - HYPRE_Real *rap_ce, *rap_cn; - HYPRE_Real *rap_ac, *rap_aw, *rap_ae, *rap_as, *rap_an; - HYPRE_Real *rap_cnw, *rap_cne; - HYPRE_Real *rap_asw, *rap_ase, *rap_anw, *rap_ane; + HYPRE_Real *rap_ce = NULL, *rap_cn = NULL; + HYPRE_Real *rap_ac = NULL, *rap_aw = NULL, *rap_ae = NULL; + HYPRE_Real *rap_as = NULL, *rap_an = NULL; + HYPRE_Real *rap_cnw = NULL, *rap_cne = NULL; + HYPRE_Real *rap_asw = NULL, *rap_ase = NULL, *rap_anw = NULL, *rap_ane = NULL; HYPRE_Int zOffsetA; HYPRE_Int xOffsetP; @@ -929,14 +934,14 @@ hypre_SparseMSG3BuildRAPNoSym( hypre_StructMatrix *A, * pb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,-1); + hypre_SetIndex3(index_temp, 0, 0, -1); MapIndex(index_temp, cdir, index); pa = hypre_StructMatrixExtractPointerByIndex(P, fi, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); pb = hypre_StructMatrixExtractPointerByIndex(P, fi, index) - - hypre_BoxOffsetDistance(P_dbox, index); + hypre_BoxOffsetDistance(P_dbox, index); /*----------------------------------------------------------------- * Extract pointers for restriction operator: @@ -944,14 +949,14 @@ hypre_SparseMSG3BuildRAPNoSym( hypre_StructMatrix *A, * rb is pointer for weight for f-point below c-point *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,-1); + hypre_SetIndex3(index_temp, 0, 0, -1); MapIndex(index_temp, cdir, index); ra = hypre_StructMatrixExtractPointerByIndex(R, fi, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); rb = hypre_StructMatrixExtractPointerByIndex(R, fi, index) - - hypre_BoxOffsetDistance(R_dbox, index); + hypre_BoxOffsetDistance(R_dbox, index); /*----------------------------------------------------------------- * Extract pointers for 7-point fine grid operator: @@ -965,27 +970,27 @@ hypre_SparseMSG3BuildRAPNoSym( hypre_StructMatrix *A, * a_bc is pointer for center coefficient in plane below *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,0); + hypre_SetIndex3(index_temp, 0, 0, 0); MapIndex(index_temp, cdir, index); a_cc = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,0,0); + hypre_SetIndex3(index_temp, -1, 0, 0); MapIndex(index_temp, cdir, index); a_cw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); a_ce = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,-1,0); + hypre_SetIndex3(index_temp, 0, -1, 0); MapIndex(index_temp, cdir, index); a_cs = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); a_cn = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); a_ac = hypre_StructMatrixExtractPointerByIndex(A, fi, index); @@ -1008,43 +1013,43 @@ hypre_SparseMSG3BuildRAPNoSym( hypre_StructMatrix *A, if (fine_stencil_size > 7) { - hypre_SetIndex3(index_temp,-1,0,1); + hypre_SetIndex3(index_temp, -1, 0, 1); MapIndex(index_temp, cdir, index); a_aw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,0,1); + hypre_SetIndex3(index_temp, 1, 0, 1); MapIndex(index_temp, cdir, index); a_ae = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,-1,1); + hypre_SetIndex3(index_temp, 0, -1, 1); MapIndex(index_temp, cdir, index); a_as = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,1,1); + hypre_SetIndex3(index_temp, 0, 1, 1); MapIndex(index_temp, cdir, index); a_an = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,0,-1); + hypre_SetIndex3(index_temp, 1, 0, -1); MapIndex(index_temp, cdir, index); a_be = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,0,1,-1); + hypre_SetIndex3(index_temp, 0, 1, -1); MapIndex(index_temp, cdir, index); a_bn = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,-1,0); + hypre_SetIndex3(index_temp, -1, -1, 0); MapIndex(index_temp, cdir, index); a_csw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,-1,0); + hypre_SetIndex3(index_temp, 1, -1, 0); MapIndex(index_temp, cdir, index); a_cse = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,1,0); + hypre_SetIndex3(index_temp, -1, 1, 0); MapIndex(index_temp, cdir, index); a_cnw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,1,0); + hypre_SetIndex3(index_temp, 1, 1, 0); MapIndex(index_temp, cdir, index); a_cne = hypre_StructMatrixExtractPointerByIndex(A, fi, index); } @@ -1064,27 +1069,27 @@ hypre_SparseMSG3BuildRAPNoSym( hypre_StructMatrix *A, if (fine_stencil_size > 19) { - hypre_SetIndex3(index_temp,-1,-1,1); + hypre_SetIndex3(index_temp, -1, -1, 1); MapIndex(index_temp, cdir, index); a_asw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,-1,1); + hypre_SetIndex3(index_temp, 1, -1, 1); MapIndex(index_temp, cdir, index); a_ase = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,1,1); + hypre_SetIndex3(index_temp, -1, 1, 1); MapIndex(index_temp, cdir, index); a_anw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,1,1); + hypre_SetIndex3(index_temp, 1, 1, 1); MapIndex(index_temp, cdir, index); a_ane = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,-1,1,-1); + hypre_SetIndex3(index_temp, -1, 1, -1); MapIndex(index_temp, cdir, index); a_bnw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - hypre_SetIndex3(index_temp,1,1,-1); + hypre_SetIndex3(index_temp, 1, 1, -1); MapIndex(index_temp, cdir, index); a_bne = hypre_StructMatrixExtractPointerByIndex(A, fi, index); @@ -1098,39 +1103,39 @@ hypre_SparseMSG3BuildRAPNoSym( hypre_StructMatrix *A, * rap_ce is pointer for east coefficient in same plane (etc.) *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,1,0,0); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); rap_ce = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,1,0); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); rap_cn = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); rap_ac = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,0,1); + hypre_SetIndex3(index_temp, -1, 0, 1); MapIndex(index_temp, cdir, index); rap_aw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,0,1); + hypre_SetIndex3(index_temp, 1, 0, 1); MapIndex(index_temp, cdir, index); rap_ae = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,-1,1); + hypre_SetIndex3(index_temp, 0, -1, 1); MapIndex(index_temp, cdir, index); rap_as = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,0,1,1); + hypre_SetIndex3(index_temp, 0, 1, 1); MapIndex(index_temp, cdir, index); rap_an = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,1,0); + hypre_SetIndex3(index_temp, -1, 1, 0); MapIndex(index_temp, cdir, index); rap_cnw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,1,0); + hypre_SetIndex3(index_temp, 1, 1, 0); MapIndex(index_temp, cdir, index); rap_cne = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); @@ -1147,19 +1152,19 @@ hypre_SparseMSG3BuildRAPNoSym( hypre_StructMatrix *A, if (fine_stencil_size > 7) { - hypre_SetIndex3(index_temp,-1,-1,1); + hypre_SetIndex3(index_temp, -1, -1, 1); MapIndex(index_temp, cdir, index); rap_asw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,-1,1); + hypre_SetIndex3(index_temp, 1, -1, 1); MapIndex(index_temp, cdir, index); rap_ase = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,-1,1,1); + hypre_SetIndex3(index_temp, -1, 1, 1); MapIndex(index_temp, cdir, index); rap_anw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - hypre_SetIndex3(index_temp,1,1,1); + hypre_SetIndex3(index_temp, 1, 1, 1); MapIndex(index_temp, cdir, index); rap_ane = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); } @@ -1172,16 +1177,16 @@ hypre_SparseMSG3BuildRAPNoSym( hypre_StructMatrix *A, * Offsets are used in refering to data associated with other points. *-----------------------------------------------------------------*/ - hypre_SetIndex3(index_temp,0,0,1); + hypre_SetIndex3(index_temp, 0, 0, 1); MapIndex(index_temp, cdir, index); - zOffsetA = hypre_BoxOffsetDistance(A_dbox,index); - zOffsetP = hypre_BoxOffsetDistance(P_dbox,index); - hypre_SetIndex3(index_temp,0,1,0); + zOffsetA = hypre_BoxOffsetDistance(A_dbox, index); + zOffsetP = hypre_BoxOffsetDistance(P_dbox, index); + hypre_SetIndex3(index_temp, 0, 1, 0); MapIndex(index_temp, cdir, index); - yOffsetP = hypre_BoxOffsetDistance(P_dbox,index); - hypre_SetIndex3(index_temp,1,0,0); + yOffsetP = hypre_BoxOffsetDistance(P_dbox, index); + hypre_SetIndex3(index_temp, 1, 0, 0); MapIndex(index_temp, cdir, index); - xOffsetP = hypre_BoxOffsetDistance(P_dbox,index); + xOffsetP = hypre_BoxOffsetDistance(P_dbox, index); /*----------------------------------------------------------------- * Switch statement to direct control to apropriate BoxLoop depending @@ -1220,8 +1225,8 @@ hypre_SparseMSG3BuildRAPNoSym( hypre_StructMatrix *A, iP1 = iP + zOffsetP; rap_ac[iAc] = a_ac[iA] * pb[iP1] - + ra[iR] * a_cc[iAp1] * pb[iP1] - + ra[iR] * a_ac[iAp1]; + + ra[iR] * a_cc[iAp1] * pb[iP1] + + ra[iR] * a_ac[iAp1]; iP1 = iP + zOffsetP - xOffsetP; rap_aw[iAc] = ra[iR] * a_cw[iAp1] * pb[iP1]; @@ -1231,13 +1236,13 @@ hypre_SparseMSG3BuildRAPNoSym( hypre_StructMatrix *A, iP1 = iP + yOffsetP; rap_cn[iAc] = a_cn[iA] - + rb[iR] * a_cn[iAm1] * pb[iP1] - + ra[iR] * a_cn[iAp1] * pa[iP1]; + + rb[iR] * a_cn[iAm1] * pb[iP1] + + ra[iR] * a_cn[iAp1] * pa[iP1]; iP1 = iP + xOffsetP; rap_ce[iAc] = a_ce[iA] - + rb[iR] * a_ce[iAm1] * pb[iP1] - + ra[iR] * a_ce[iAp1] * pa[iP1]; + + rb[iR] * a_ce[iAm1] * pb[iP1] + + ra[iR] * a_ce[iAp1] * pa[iP1]; rap_cnw[iAc] = 0.0; @@ -1248,14 +1253,14 @@ hypre_SparseMSG3BuildRAPNoSym( hypre_StructMatrix *A, break; - /*-------------------------------------------------------------- - * Loop for 19-point fine grid operator; produces upper triangular - * part of 27-point coarse grid operator. stencil entries: - * (above-northeast, above-north, above-northwest, above-east, - * above-center, above-west, above-southeast, above-south, - * above-southwest, center-northeast, center-north, - * center-northwest, and center-east). - *--------------------------------------------------------------*/ + /*-------------------------------------------------------------- + * Loop for 19-point fine grid operator; produces upper triangular + * part of 27-point coarse grid operator. stencil entries: + * (above-northeast, above-north, above-northwest, above-east, + * above-center, above-west, above-southeast, above-south, + * above-southwest, center-northeast, center-north, + * center-northwest, and center-east). + *--------------------------------------------------------------*/ case 19: @@ -1276,65 +1281,65 @@ hypre_SparseMSG3BuildRAPNoSym( hypre_StructMatrix *A, iP1 = iP + zOffsetP + yOffsetP; rap_an[iAc] = ra[iR] * a_cn[iAp1] * pb[iP1] - + ra[iR] * a_an[iAp1] - + a_an[iA] * pb[iP1]; + + ra[iR] * a_an[iAp1] + + a_an[iA] * pb[iP1]; iP1 = iP + zOffsetP + yOffsetP - xOffsetP; rap_anw[iAc] = ra[iR] * a_cnw[iAp1] * pb[iP1]; iP1 = iP + zOffsetP + xOffsetP; rap_ae[iAc] = ra[iR] * a_ce[iAp1] * pb[iP1] - + ra[iR] * a_ae[iAp1] - + a_ae[iA] * pb[iP1]; + + ra[iR] * a_ae[iAp1] + + a_ae[iA] * pb[iP1]; iP1 = iP + zOffsetP; rap_ac[iAc] = a_ac[iA] * pb[iP1] - + ra[iR] * a_cc[iAp1] * pb[iP1] - + ra[iR] * a_ac[iAp1]; + + ra[iR] * a_cc[iAp1] * pb[iP1] + + ra[iR] * a_ac[iAp1]; iP1 = iP + zOffsetP - xOffsetP; rap_aw[iAc] = ra[iR] * a_cw[iAp1] * pb[iP1] - + ra[iR] * a_aw[iAp1] - + a_aw[iA] * pb[iP1]; + + ra[iR] * a_aw[iAp1] + + a_aw[iA] * pb[iP1]; iP1 = iP + zOffsetP - yOffsetP + xOffsetP; rap_ase[iAc] = ra[iR] * a_cse[iAp1] * pb[iP1]; iP1 = iP + zOffsetP - yOffsetP; rap_as[iAc] = ra[iR] * a_cs[iAp1] * pb[iP1] - + ra[iR] * a_as[iAp1] - + a_as[iA] * pb[iP1]; + + ra[iR] * a_as[iAp1] + + a_as[iA] * pb[iP1]; iP1 = iP + zOffsetP - yOffsetP - xOffsetP; rap_asw[iAc] = ra[iR] * a_csw[iAp1] * pb[iP1]; iP1 = iP + yOffsetP + xOffsetP; rap_cne[iAc] = a_cne[iA] - + rb[iR] * a_cne[iAm1] * pb[iP1] - + ra[iR] * a_cne[iAp1] * pa[iP1]; + + rb[iR] * a_cne[iAm1] * pb[iP1] + + ra[iR] * a_cne[iAp1] * pa[iP1]; iP1 = iP + yOffsetP; rap_cn[iAc] = a_cn[iA] - + rb[iR] * a_cn[iAm1] * pb[iP1] - + ra[iR] * a_cn[iAp1] * pa[iP1] - + a_bn[iA] * pb[iP1] - + a_an[iA] * pa[iP1] - + rb[iR] * a_an[iAm1] - + ra[iR] * a_bn[iAp1]; + + rb[iR] * a_cn[iAm1] * pb[iP1] + + ra[iR] * a_cn[iAp1] * pa[iP1] + + a_bn[iA] * pb[iP1] + + a_an[iA] * pa[iP1] + + rb[iR] * a_an[iAm1] + + ra[iR] * a_bn[iAp1]; iP1 = iP + yOffsetP - xOffsetP; rap_cnw[iAc] = a_cnw[iA] - + rb[iR] * a_cnw[iAm1] * pb[iP1] - + ra[iR] * a_cnw[iAp1] * pa[iP1]; + + rb[iR] * a_cnw[iAm1] * pb[iP1] + + ra[iR] * a_cnw[iAp1] * pa[iP1]; iP1 = iP + xOffsetP; rap_ce[iAc] = a_ce[iA] - + rb[iR] * a_ce[iAm1] * pb[iP1] - + ra[iR] * a_ce[iAp1] * pa[iP1] - + a_be[iA] * pb[iP1] - + a_ae[iA] * pa[iP1] - + rb[iR] * a_ae[iAm1] - + ra[iR] * a_be[iAp1]; + + rb[iR] * a_ce[iAm1] * pb[iP1] + + ra[iR] * a_ce[iAp1] * pa[iP1] + + a_be[iA] * pb[iP1] + + a_ae[iA] * pa[iP1] + + rb[iR] * a_ae[iAm1] + + ra[iR] * a_be[iAp1]; } hypre_BoxLoop4End(iP, iR, iA, iAc); @@ -1342,14 +1347,14 @@ hypre_SparseMSG3BuildRAPNoSym( hypre_StructMatrix *A, break; - /*-------------------------------------------------------------- - * Loop for 27-point fine grid operator; produces upper triangular - * part of 27-point coarse grid operator. stencil entries: - * (above-northeast, above-north, above-northwest, above-east, - * above-center, above-west, above-southeast, above-south, - * above-southwest, center-northeast, center-north, - * center-northwest, and center-east). - *--------------------------------------------------------------*/ + /*-------------------------------------------------------------- + * Loop for 27-point fine grid operator; produces upper triangular + * part of 27-point coarse grid operator. stencil entries: + * (above-northeast, above-north, above-northwest, above-east, + * above-center, above-west, above-southeast, above-south, + * above-southwest, center-northeast, center-north, + * center-northwest, and center-east). + *--------------------------------------------------------------*/ default: @@ -1367,85 +1372,85 @@ hypre_SparseMSG3BuildRAPNoSym( hypre_StructMatrix *A, HYPRE_Int iP1 = iP + zOffsetP + yOffsetP + xOffsetP; rap_ane[iAc] = ra[iR] * a_cne[iAp1] * pb[iP1] - + ra[iR] * a_ane[iAp1] - + a_ane[iA] * pb[iP1]; + + ra[iR] * a_ane[iAp1] + + a_ane[iA] * pb[iP1]; iP1 = iP + zOffsetP + yOffsetP; rap_an[iAc] = ra[iR] * a_cn[iAp1] * pb[iP1] - + ra[iR] * a_an[iAp1] - + a_an[iA] * pb[iP1]; + + ra[iR] * a_an[iAp1] + + a_an[iA] * pb[iP1]; iP1 = iP + zOffsetP + yOffsetP - xOffsetP; rap_anw[iAc] = ra[iR] * a_cnw[iAp1] * pb[iP1] - + ra[iR] * a_anw[iAp1] - + a_anw[iA] * pb[iP1]; + + ra[iR] * a_anw[iAp1] + + a_anw[iA] * pb[iP1]; iP1 = iP + zOffsetP + xOffsetP; rap_ae[iAc] = ra[iR] * a_ce[iAp1] * pb[iP1] - + ra[iR] * a_ae[iAp1] - + a_ae[iA] * pb[iP1]; + + ra[iR] * a_ae[iAp1] + + a_ae[iA] * pb[iP1]; iP1 = iP + zOffsetP; rap_ac[iAc] = a_ac[iA] * pb[iP1] - + ra[iR] * a_cc[iAp1] * pb[iP1] - + ra[iR] * a_ac[iAp1]; + + ra[iR] * a_cc[iAp1] * pb[iP1] + + ra[iR] * a_ac[iAp1]; iP1 = iP + zOffsetP - xOffsetP; rap_aw[iAc] = ra[iR] * a_cw[iAp1] * pb[iP1] - + ra[iR] * a_aw[iAp1] - + a_aw[iA] * pb[iP1]; + + ra[iR] * a_aw[iAp1] + + a_aw[iA] * pb[iP1]; iP1 = iP + zOffsetP - yOffsetP + xOffsetP; rap_ase[iAc] = ra[iR] * a_cse[iAp1] * pb[iP1] - + ra[iR] * a_ase[iAp1] - + a_ase[iA] * pb[iP1]; + + ra[iR] * a_ase[iAp1] + + a_ase[iA] * pb[iP1]; iP1 = iP + zOffsetP - yOffsetP; rap_as[iAc] = ra[iR] * a_cs[iAp1] * pb[iP1] - + ra[iR] * a_as[iAp1] - + a_as[iA] * pb[iP1]; + + ra[iR] * a_as[iAp1] + + a_as[iA] * pb[iP1]; iP1 = iP + zOffsetP - yOffsetP - xOffsetP; rap_asw[iAc] = ra[iR] * a_csw[iAp1] * pb[iP1] - + ra[iR] * a_asw[iAp1] - + a_asw[iA] * pb[iP1]; + + ra[iR] * a_asw[iAp1] + + a_asw[iA] * pb[iP1]; iP1 = iP + yOffsetP + xOffsetP; rap_cne[iAc] = a_cne[iA] - + rb[iR] * a_cne[iAm1] * pb[iP1] - + ra[iR] * a_cne[iAp1] * pa[iP1] - + a_bne[iA] * pb[iP1] - + a_ane[iA] * pa[iP1] - + rb[iR] * a_ane[iAm1] - + ra[iR] * a_bne[iAp1]; + + rb[iR] * a_cne[iAm1] * pb[iP1] + + ra[iR] * a_cne[iAp1] * pa[iP1] + + a_bne[iA] * pb[iP1] + + a_ane[iA] * pa[iP1] + + rb[iR] * a_ane[iAm1] + + ra[iR] * a_bne[iAp1]; iP1 = iP + yOffsetP; rap_cn[iAc] = a_cn[iA] - + rb[iR] * a_cn[iAm1] * pb[iP1] - + ra[iR] * a_cn[iAp1] * pa[iP1] - + a_bn[iA] * pb[iP1] - + a_an[iA] * pa[iP1] - + rb[iR] * a_an[iAm1] - + ra[iR] * a_bn[iAp1]; + + rb[iR] * a_cn[iAm1] * pb[iP1] + + ra[iR] * a_cn[iAp1] * pa[iP1] + + a_bn[iA] * pb[iP1] + + a_an[iA] * pa[iP1] + + rb[iR] * a_an[iAm1] + + ra[iR] * a_bn[iAp1]; iP1 = iP + yOffsetP - xOffsetP; rap_cnw[iAc] = a_cnw[iA] - + rb[iR] * a_cnw[iAm1] * pb[iP1] - + ra[iR] * a_cnw[iAp1] * pa[iP1] - + a_bnw[iA] * pb[iP1] - + a_anw[iA] * pa[iP1] - + rb[iR] * a_anw[iAm1] - + ra[iR] * a_bnw[iAp1]; + + rb[iR] * a_cnw[iAm1] * pb[iP1] + + ra[iR] * a_cnw[iAp1] * pa[iP1] + + a_bnw[iA] * pb[iP1] + + a_anw[iA] * pa[iP1] + + rb[iR] * a_anw[iAm1] + + ra[iR] * a_bnw[iAp1]; iP1 = iP + xOffsetP; rap_ce[iAc] = a_ce[iA] - + rb[iR] * a_ce[iAm1] * pb[iP1] - + ra[iR] * a_ce[iAp1] * pa[iP1] - + a_be[iA] * pb[iP1] - + a_ae[iA] * pa[iP1] - + rb[iR] * a_ae[iAm1] - + ra[iR] * a_be[iAp1]; + + rb[iR] * a_ce[iAm1] * pb[iP1] + + ra[iR] * a_ce[iAp1] * pa[iP1] + + a_be[iA] * pb[iP1] + + a_ae[iA] * pa[iP1] + + rb[iR] * a_ae[iAm1] + + ra[iR] * a_be[iAp1]; } hypre_BoxLoop4End(iP, iR, iA, iAc); @@ -1459,4 +1464,3 @@ hypre_SparseMSG3BuildRAPNoSym( hypre_StructMatrix *A, return ierr; } - diff --git a/external/hypre/src/struct_ls/sparse_msg_filter.c b/external/hypre/src/struct_ls/sparse_msg_filter.c index 63710650..11bfe493 100644 --- a/external/hypre/src/struct_ls/sparse_msg_filter.c +++ b/external/hypre/src/struct_ls/sparse_msg_filter.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -120,7 +120,7 @@ hypre_SparseMSGFilterSetup( hypre_StructMatrix *A, HYPRE_Real lambday = 0.0; HYPRE_Real lambdaz = 0.0; HYPRE_Int si, dir, Astenc; - HYPRE_Real *Ap,lambda_max; + HYPRE_Real *Ap, lambda_max; for (si = 0; si < stencil_size; si++) { @@ -307,6 +307,12 @@ hypre_SparseMSGFilterSetup( hypre_StructMatrix *A, hypre_StructVector *visity, hypre_StructVector *visitz ) { + HYPRE_UNUSED_VAR(num_grids); + HYPRE_UNUSED_VAR(jump); + HYPRE_UNUSED_VAR(lx); + HYPRE_UNUSED_VAR(ly); + HYPRE_UNUSED_VAR(lz); + HYPRE_Int ierr = 0; hypre_BoxArray *compute_boxes; @@ -319,7 +325,6 @@ hypre_SparseMSGFilterSetup( hypre_StructMatrix *A, HYPRE_Real *vyp; HYPRE_Real *vzp; - hypre_StructStencil *stencil; hypre_Index *stencil_shape; HYPRE_Int stencil_size; @@ -330,8 +335,8 @@ hypre_SparseMSGFilterSetup( hypre_StructMatrix *A, hypre_Index startv; hypre_Index stride; hypre_Index stridev; - HYPRE_Int i; + HYPRE_MemoryLocation memory_location = hypre_StructMatrixMemoryLocation(A); /*---------------------------------------------------------- * Initialize some things @@ -361,17 +366,19 @@ hypre_SparseMSGFilterSetup( hypre_StructMatrix *A, HYPRE_Int *data_indices_d; /* On device */ hypre_Index *stencil_shape_d; - if (hypre_GetActualMemLocation(HYPRE_MEMORY_DEVICE) != hypre_MEMORY_HOST) + if (hypre_GetExecPolicy1(memory_location) == HYPRE_EXEC_DEVICE) { HYPRE_Int nboxes = hypre_BoxArraySize(compute_boxes); - data_indices_d = hypre_TAlloc(HYPRE_Int, stencil_size*nboxes, HYPRE_MEMORY_DEVICE); - stencil_shape_d = hypre_TAlloc(hypre_Index, stencil_size, HYPRE_MEMORY_DEVICE); - hypre_TMemcpy(data_indices_d, data_indices[0], HYPRE_Int, stencil_size*nboxes, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - hypre_TMemcpy(stencil_shape_d, stencil_shape, hypre_Index, stencil_size, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); + data_indices_d = hypre_TAlloc(HYPRE_Int, stencil_size * nboxes, memory_location); + stencil_shape_d = hypre_TAlloc(hypre_Index, stencil_size, memory_location); + hypre_TMemcpy(data_indices_d, data_indices[0], HYPRE_Int, stencil_size * nboxes, + memory_location, HYPRE_MEMORY_HOST); + hypre_TMemcpy(stencil_shape_d, stencil_shape, hypre_Index, stencil_size, + memory_location, HYPRE_MEMORY_HOST); } else { - data_indices_d = data_indices[0]; + data_indices_d = data_indices[0]; stencil_shape_d = stencil_shape; } @@ -395,7 +402,7 @@ hypre_SparseMSGFilterSetup( hypre_StructMatrix *A, A_dbox, start, stride, Ai, v_dbox, startv, stridev, vi); { - HYPRE_Real lambdax,lambday,lambdaz; + HYPRE_Real lambdax, lambday, lambdaz; HYPRE_Real *Ap; HYPRE_Int si, Astenc; @@ -405,7 +412,7 @@ hypre_SparseMSGFilterSetup( hypre_StructMatrix *A, for (si = 0; si < stencil_size; si++) { - Ap = matrixA_data + data_indices_d[i*stencil_size+si]; + Ap = matrixA_data + data_indices_d[i * stencil_size + si]; /* compute lambdax */ Astenc = hypre_IndexD(stencil_shape_d[si], 0); @@ -453,10 +460,10 @@ hypre_SparseMSGFilterSetup( hypre_StructMatrix *A, #undef DEVICE_VAR } - if (hypre_GetActualMemLocation(HYPRE_MEMORY_DEVICE) != hypre_MEMORY_HOST) + if (hypre_GetExecPolicy1(memory_location) == HYPRE_EXEC_DEVICE) { - hypre_TFree(data_indices_d, HYPRE_MEMORY_DEVICE); - hypre_TFree(stencil_shape_d, HYPRE_MEMORY_DEVICE); + hypre_TFree(data_indices_d, memory_location); + hypre_TFree(stencil_shape_d, memory_location); } return ierr; @@ -474,6 +481,11 @@ hypre_SparseMSGFilter( hypre_StructVector *visit, HYPRE_Int lz, HYPRE_Int jump ) { + HYPRE_UNUSED_VAR(jump); + HYPRE_UNUSED_VAR(lx); + HYPRE_UNUSED_VAR(ly); + HYPRE_UNUSED_VAR(lz); + HYPRE_Int ierr = 0; hypre_BoxArray *compute_boxes; diff --git a/external/hypre/src/struct_ls/sparse_msg_interp.c b/external/hypre/src/struct_ls/sparse_msg_interp.c index 87f826e5..b8197038 100644 --- a/external/hypre/src/struct_ls/sparse_msg_interp.c +++ b/external/hypre/src/struct_ls/sparse_msg_interp.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -30,7 +30,7 @@ typedef struct *--------------------------------------------------------------------------*/ void * -hypre_SparseMSGInterpCreate( ) +hypre_SparseMSGInterpCreate( void ) { hypre_SparseMSGInterpData *interp_data; @@ -54,6 +54,8 @@ hypre_SparseMSGInterpSetup( void *interp_vdata, hypre_Index stride, hypre_Index strideP ) { + HYPRE_UNUSED_VAR(xc); + hypre_SparseMSGInterpData *interp_data = (hypre_SparseMSGInterpData *)interp_vdata; hypre_StructGrid *grid; @@ -208,7 +210,7 @@ hypre_SparseMSGInterp( void *interp_vdata, for (compute_i = 0; compute_i < 2; compute_i++) { - switch(compute_i) + switch (compute_i) { case 0: { @@ -267,7 +269,7 @@ hypre_SparseMSGInterp( void *interp_vdata, * Return *-----------------------------------------------------------------------*/ - hypre_IncFLOPCount(3*hypre_StructVectorGlobalSize(xc)); + hypre_IncFLOPCount(3 * hypre_StructVectorGlobalSize(xc)); hypre_EndTiming(interp_data -> time_index); return ierr; @@ -294,4 +296,3 @@ hypre_SparseMSGInterpDestroy( void *interp_vdata ) return ierr; } - diff --git a/external/hypre/src/struct_ls/sparse_msg_restrict.c b/external/hypre/src/struct_ls/sparse_msg_restrict.c index 367af1a3..f5635269 100644 --- a/external/hypre/src/struct_ls/sparse_msg_restrict.c +++ b/external/hypre/src/struct_ls/sparse_msg_restrict.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -29,7 +29,7 @@ typedef struct *--------------------------------------------------------------------------*/ void * -hypre_SparseMSGRestrictCreate( ) +hypre_SparseMSGRestrictCreate( void ) { hypre_SparseMSGRestrictData *restrict_data; @@ -54,6 +54,8 @@ hypre_SparseMSGRestrictSetup( void *restrict_vdata, hypre_Index stride, hypre_Index strideR ) { + HYPRE_UNUSED_VAR(rc); + hypre_SparseMSGRestrictData *restrict_data = (hypre_SparseMSGRestrictData *)restrict_vdata; hypre_StructGrid *grid; @@ -84,9 +86,9 @@ hypre_SparseMSGRestrictSetup( void *restrict_vdata, (restrict_data -> R) = hypre_StructMatrixRef(R); (restrict_data -> compute_pkg) = compute_pkg; - hypre_CopyIndex(cindex ,(restrict_data -> cindex)); - hypre_CopyIndex(stride ,(restrict_data -> stride)); - hypre_CopyIndex(strideR ,(restrict_data -> strideR)); + hypre_CopyIndex(cindex, (restrict_data -> cindex)); + hypre_CopyIndex(stride, (restrict_data -> stride)); + hypre_CopyIndex(strideR, (restrict_data -> strideR)); return ierr; } @@ -169,7 +171,7 @@ hypre_SparseMSGRestrict( void *restrict_vdata, for (compute_i = 0; compute_i < 2; compute_i++) { - switch(compute_i) + switch (compute_i) { case 0: { @@ -202,7 +204,7 @@ hypre_SparseMSGRestrict( void *restrict_vdata, rc_dbox = hypre_BoxArrayBox(hypre_StructVectorDataSpace(rc), ci); Rp0 = hypre_StructMatrixBoxData(R, fi, 1) - - hypre_BoxOffsetDistance(R_dbox, stencil_shape[1]); + hypre_BoxOffsetDistance(R_dbox, stencil_shape[1]); Rp1 = hypre_StructMatrixBoxData(R, fi, 0); rp = hypre_StructVectorBoxData(r, fi); rp0 = rp + hypre_BoxOffsetDistance(r_dbox, stencil_shape[0]); @@ -238,7 +240,7 @@ hypre_SparseMSGRestrict( void *restrict_vdata, * Return *-----------------------------------------------------------------------*/ - hypre_IncFLOPCount(4*hypre_StructVectorGlobalSize(rc)); + hypre_IncFLOPCount(4 * hypre_StructVectorGlobalSize(rc)); hypre_EndTiming(restrict_data -> time_index); return ierr; @@ -265,4 +267,3 @@ hypre_SparseMSGRestrictDestroy( void *restrict_vdata ) return ierr; } - diff --git a/external/hypre/src/struct_ls/sparse_msg_setup.c b/external/hypre/src/struct_ls/sparse_msg_setup.c index 8e6c4914..d8f1fa45 100644 --- a/external/hypre/src/struct_ls/sparse_msg_setup.c +++ b/external/hypre/src/struct_ls/sparse_msg_setup.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -45,14 +45,14 @@ hypre_SparseMSGSetup( void *smsg_vdata, hypre_StructVector *b, hypre_StructVector *x ) { - hypre_SparseMSGData *smsg_data = (hypre_SparseMSGData *)smsg_vdata; + hypre_SparseMSGData *smsg_data = (hypre_SparseMSGData *) smsg_vdata; MPI_Comm comm = (smsg_data -> comm); - + HYPRE_Int max_iter; HYPRE_Int jump = (smsg_data -> jump); HYPRE_Int relax_type = (smsg_data -> relax_type); - HYPRE_Int usr_jacobi_weight= (smsg_data -> usr_jacobi_weight); + HYPRE_Int usr_jacobi_weight = (smsg_data -> usr_jacobi_weight); HYPRE_Real jacobi_weight = (smsg_data -> jacobi_weight); HYPRE_Int *num_grids = (smsg_data -> num_grids); HYPRE_Int num_all_grids; @@ -62,7 +62,7 @@ hypre_SparseMSGSetup( void *smsg_vdata, hypre_StructGrid **Px_grid_a; hypre_StructGrid **Py_grid_a; hypre_StructGrid **Pz_grid_a; - + HYPRE_Real *data; HYPRE_Real *tdata; HYPRE_Int data_size = 0; @@ -102,15 +102,16 @@ hypre_SparseMSGSetup( void *smsg_vdata, hypre_StructGrid *grid; HYPRE_Int dim; - hypre_Box *cbox; + hypre_Box *cbox; HYPRE_Int d, l, lx, ly, lz; HYPRE_Int fi, ci; - + HYPRE_Int b_num_ghost[] = {0, 0, 0, 0, 0, 0}; HYPRE_Int x_num_ghost[] = {1, 1, 1, 1, 1, 1}; HYPRE_Int ierr = 0; + HYPRE_MemoryLocation memory_location = hypre_StructMatrixMemoryLocation(A); #if DEBUG char filename[255]; #endif @@ -128,7 +129,7 @@ hypre_SparseMSGSetup( void *smsg_vdata, cbox = hypre_BoxDuplicate(hypre_StructGridBoundingBox(grid)); for (d = 0; d < dim; d++) { - while ( hypre_BoxIMaxD(cbox,d) > hypre_BoxIMinD(cbox,d) ) + while ( hypre_BoxIMaxD(cbox, d) > hypre_BoxIMinD(cbox, d) ) { /* set cindex, findex, and stride */ hypre_SparseMSGSetCIndex(d, cindex); @@ -136,12 +137,12 @@ hypre_SparseMSGSetup( void *smsg_vdata, hypre_SparseMSGSetStride(d, stride); /* coarsen cbox */ - hypre_ProjectBox(cbox,cindex,stride); + hypre_ProjectBox(cbox, cindex, stride); hypre_StructMapFineToCoarse(hypre_BoxIMin(cbox), - cindex,stride,hypre_BoxIMin(cbox)); + cindex, stride, hypre_BoxIMin(cbox)); hypre_StructMapFineToCoarse(hypre_BoxIMax(cbox), - cindex,stride,hypre_BoxIMax(cbox)); - + cindex, stride, hypre_BoxIMax(cbox)); + /* increment level counters */ num_grids[d]++; num_levels++; @@ -153,7 +154,7 @@ hypre_SparseMSGSetup( void *smsg_vdata, num_grids[1] = 1; num_grids[2] = 1; num_levels = num_grids[0]; -#endif +#endif /* Compute the num_all_grids based on num_grids[] */ num_all_grids = num_grids[0] * num_grids[1] * num_grids[2]; @@ -174,7 +175,7 @@ hypre_SparseMSGSetup( void *smsg_vdata, Pz_grid_a[0] = NULL; /*----------------------------------------- - * Compute coarse grids + * Compute coarse grids *-----------------------------------------*/ if (num_levels > 1) @@ -185,7 +186,7 @@ hypre_SparseMSGSetup( void *smsg_vdata, for (lx = 0; lx < num_grids[0] - 1; lx++) { hypre_SparseMSGMapIndex(lx, 0, 0, num_grids, fi); - hypre_SparseMSGMapIndex(lx+1, 0, 0, num_grids, ci); + hypre_SparseMSGMapIndex(lx + 1, 0, 0, num_grids, ci); hypre_StructCoarsen(grid_a[fi], cindex, stride, 1, &grid_a[ci]); } @@ -198,7 +199,7 @@ hypre_SparseMSGSetup( void *smsg_vdata, for (lx = 0; lx < num_grids[0]; lx++) { hypre_SparseMSGMapIndex(lx, ly, 0, num_grids, fi); - hypre_SparseMSGMapIndex(lx, ly+1, 0, num_grids, ci); + hypre_SparseMSGMapIndex(lx, ly + 1, 0, num_grids, ci); hypre_StructCoarsen(grid_a[fi], cindex, stride, 1, &grid_a[ci]); } @@ -213,8 +214,8 @@ hypre_SparseMSGSetup( void *smsg_vdata, { for (lx = 0; lx < num_grids[0]; lx++) { - hypre_SparseMSGMapIndex(lx, ly, lz , num_grids, fi); - hypre_SparseMSGMapIndex(lx, ly, lz+1, num_grids, ci); + hypre_SparseMSGMapIndex(lx, ly, lz, num_grids, fi); + hypre_SparseMSGMapIndex(lx, ly, lz + 1, num_grids, ci); hypre_StructCoarsen(grid_a[fi], cindex, stride, 1, &grid_a[ci]); } @@ -223,7 +224,7 @@ hypre_SparseMSGSetup( void *smsg_vdata, } /*----------------------------------------- - * Compute interpolation grids + * Compute interpolation grids *-----------------------------------------*/ if (num_levels > 1) @@ -235,7 +236,7 @@ hypre_SparseMSGSetup( void *smsg_vdata, { hypre_SparseMSGMapIndex(lx, 0, 0, num_grids, fi); hypre_StructCoarsen(grid_a[fi], findex, stride, 1, - &Px_grid_a[lx+1]); + &Px_grid_a[lx + 1]); } /* coarsen in y direction */ @@ -245,7 +246,7 @@ hypre_SparseMSGSetup( void *smsg_vdata, { hypre_SparseMSGMapIndex(0, ly, 0, num_grids, fi); hypre_StructCoarsen(grid_a[fi], findex, stride, 1, - &Py_grid_a[ly+1]); + &Py_grid_a[ly + 1]); } /* coarsen in z direction */ @@ -255,7 +256,7 @@ hypre_SparseMSGSetup( void *smsg_vdata, { hypre_SparseMSGMapIndex(0, 0, lz, num_grids, fi); hypre_StructCoarsen(grid_a[fi], findex, stride, 1, - &Pz_grid_a[lz+1]); + &Pz_grid_a[lz + 1]); } } @@ -299,7 +300,7 @@ hypre_SparseMSGSetup( void *smsg_vdata, * create visit arrays *-------------------------------*/ -/* RDF */ + /* RDF */ #if 0 l = lx + ly + lz; if ((l >= 1) && (l <= jump)) @@ -310,7 +311,7 @@ hypre_SparseMSGSetup( void *smsg_vdata, } else #endif -/* RDF */ + /* RDF */ { visitx_a[fi] = hypre_StructVectorCreate(comm, grid_a[fi]); visity_a[fi] = hypre_StructVectorCreate(comm, grid_a[fi]); @@ -342,7 +343,7 @@ hypre_SparseMSGSetup( void *smsg_vdata, if (lx < (num_grids[0] - 1)) { hypre_SparseMSGMapIndex(lx, ly, lz, num_grids, fi); - hypre_SparseMSGMapIndex((lx+1), ly, lz, num_grids, ci); + hypre_SparseMSGMapIndex((lx + 1), ly, lz, num_grids, ci); hypre_SparseMSGSetCIndex(0, cindex); hypre_SparseMSGSetFIndex(0, findex); @@ -352,7 +353,7 @@ hypre_SparseMSGSetup( void *smsg_vdata, if ((lz == 0) && (ly == 0)) { Px_a[lx] = hypre_PFMGCreateInterpOp(A_a[fi], - Px_grid_a[lx+1], 0, 0); + Px_grid_a[lx + 1], 0, 0); hypre_StructMatrixInitialize(Px_a[lx]); hypre_PFMGSetupInterpOp(A_a[fi], 0, findex, stride, Px_a[lx], 0); @@ -364,23 +365,23 @@ hypre_SparseMSGSetup( void *smsg_vdata, hypre_SparseMSGCreateRAPOp(RTx_a[lx], A_a[fi], Px_a[lx], grid_a[ci], 0); hypre_StructMatrixInitialize(A_a[ci]); - hypre_SetIndex3(stridePR, 1, pow(2, ly), pow(2, lz)); + hypre_SetIndex3(stridePR, 1, hypre_pow2(ly), hypre_pow2(lz)); hypre_SparseMSGSetupRAPOp(RTx_a[lx], A_a[fi], Px_a[lx], 0, cindex, stride, stridePR, A_a[ci]); } } -/* RDF */ + /* RDF */ #if 0 /* free up some coarse-operators to conserve memory */ - for (lx = 1; lx <= hypre_min((jump-ly-lz), (num_grids[0]-1)); lx++) + for (lx = 1; lx <= hypre_min((jump - ly - lz), (num_grids[0] - 1)); lx++) { hypre_SparseMSGMapIndex(lx, ly, lz, num_grids, fi); hypre_StructMatrixDestroy(A_a[fi]); A_a[fi] = NULL; } #endif -/* RDF */ + /* RDF */ /*------------------------------- * compute Py, RTy, and A @@ -389,7 +390,7 @@ hypre_SparseMSGSetup( void *smsg_vdata, if (ly < (num_grids[1] - 1)) { hypre_SparseMSGMapIndex(0, ly, lz, num_grids, fi); - hypre_SparseMSGMapIndex(0, (ly+1), lz, num_grids, ci); + hypre_SparseMSGMapIndex(0, (ly + 1), lz, num_grids, ci); hypre_SparseMSGSetCIndex(1, cindex); hypre_SparseMSGSetFIndex(1, findex); @@ -399,7 +400,7 @@ hypre_SparseMSGSetup( void *smsg_vdata, if (lz == 0) { Py_a[ly] = hypre_PFMGCreateInterpOp(A_a[fi], - Py_grid_a[ly+1], 1, 0); + Py_grid_a[ly + 1], 1, 0); hypre_StructMatrixInitialize(Py_a[ly]); hypre_PFMGSetupInterpOp(A_a[fi], 1, findex, stride, Py_a[ly], 0); @@ -410,23 +411,23 @@ hypre_SparseMSGSetup( void *smsg_vdata, A_a[ci] = hypre_SparseMSGCreateRAPOp(RTy_a[ly], A_a[fi], Py_a[ly], grid_a[ci], 1); hypre_StructMatrixInitialize(A_a[ci]); - hypre_SetIndex3(stridePR, 1, 1, pow(2, lz)); + hypre_SetIndex3(stridePR, 1, 1, hypre_pow2(lz)); hypre_SparseMSGSetupRAPOp(RTy_a[ly], A_a[fi], Py_a[ly], 1, cindex, stride, stridePR, A_a[ci]); } } -/* RDF */ + /* RDF */ #if 0 /* free up some coarse-operators to conserve memory */ - for (ly = 1; ly <= hypre_min((jump-lz), (num_grids[1]-1)); ly++) + for (ly = 1; ly <= hypre_min((jump - lz), (num_grids[1] - 1)); ly++) { hypre_SparseMSGMapIndex(0, ly, lz, num_grids, fi); hypre_StructMatrixDestroy(A_a[fi]); A_a[fi] = NULL; } #endif -/* RDF */ + /* RDF */ /*------------------------------- * compute Pz, RTz, and A @@ -435,14 +436,14 @@ hypre_SparseMSGSetup( void *smsg_vdata, if (lz < (num_grids[2] - 1)) { hypre_SparseMSGMapIndex(0, 0, lz, num_grids, fi); - hypre_SparseMSGMapIndex(0, 0, (lz+1), num_grids, ci); + hypre_SparseMSGMapIndex(0, 0, (lz + 1), num_grids, ci); hypre_SparseMSGSetCIndex(2, cindex); hypre_SparseMSGSetFIndex(2, findex); hypre_SparseMSGSetStride(2, stride); /* compute z-transfer operators */ - Pz_a[lz] = hypre_PFMGCreateInterpOp(A_a[fi], Pz_grid_a[lz+1], 2, 0); + Pz_a[lz] = hypre_PFMGCreateInterpOp(A_a[fi], Pz_grid_a[lz + 1], 2, 0); hypre_StructMatrixInitialize(Pz_a[lz]); hypre_PFMGSetupInterpOp(A_a[fi], 2, findex, stride, Pz_a[lz], 0); RTz_a[lz] = Pz_a[lz]; @@ -457,17 +458,17 @@ hypre_SparseMSGSetup( void *smsg_vdata, } } -/* RDF */ + /* RDF */ #if 0 /* free up some coarse-operators to conserve memory */ - for (lz = 1; lz <= hypre_min((jump), (num_grids[2]-1)); lz++) + for (lz = 1; lz <= hypre_min((jump), (num_grids[2] - 1)); lz++) { hypre_SparseMSGMapIndex(0, 0, lz, num_grids, fi); hypre_StructMatrixDestroy(A_a[fi]); A_a[fi] = NULL; } #endif -/* RDF */ + /* RDF */ (smsg_data -> A_array) = A_a; (smsg_data -> Px_array) = Px_a; @@ -552,8 +553,10 @@ hypre_SparseMSGSetup( void *smsg_vdata, } } - data = hypre_CTAlloc(HYPRE_Real, data_size, HYPRE_MEMORY_DEVICE); + data = hypre_CTAlloc(HYPRE_Real, data_size, memory_location); + (smsg_data -> data) = data; + (smsg_data -> memory_location) = memory_location; hypre_StructVectorInitializeData(t_a[0], data); hypre_StructVectorAssemble(t_a[0]); @@ -628,9 +631,9 @@ hypre_SparseMSGSetup( void *smsg_vdata, for (ly = 0; ly < num_grids[1]; ly++) { hypre_SparseMSGMapIndex(lx, ly, lz, num_grids, fi); - hypre_SparseMSGMapIndex(lx+1, ly, lz, num_grids, ci); + hypre_SparseMSGMapIndex(lx + 1, ly, lz, num_grids, ci); - hypre_SetIndex3(stridePR, 1, pow(2, ly), pow(2, lz)); + hypre_SetIndex3(stridePR, 1, hypre_pow2(ly), hypre_pow2(lz)); interpx_a[fi] = hypre_SparseMSGInterpCreate(); hypre_SparseMSGInterpSetup(interpx_a[fi], Px_a[lx], @@ -657,9 +660,9 @@ hypre_SparseMSGSetup( void *smsg_vdata, for (lx = 0; lx < num_grids[0]; lx++) { hypre_SparseMSGMapIndex(lx, ly, lz, num_grids, fi); - hypre_SparseMSGMapIndex(lx, ly+1, lz, num_grids, ci); + hypre_SparseMSGMapIndex(lx, ly + 1, lz, num_grids, ci); - hypre_SetIndex3(stridePR, pow(2, lx), 1, pow(2, lz)); + hypre_SetIndex3(stridePR, hypre_pow2(lx), 1, hypre_pow2(lz)); interpy_a[fi] = hypre_SparseMSGInterpCreate(); hypre_SparseMSGInterpSetup(interpy_a[fi], Py_a[ly], @@ -686,9 +689,9 @@ hypre_SparseMSGSetup( void *smsg_vdata, for (lx = 0; lx < num_grids[0]; lx++) { hypre_SparseMSGMapIndex(lx, ly, lz, num_grids, fi); - hypre_SparseMSGMapIndex(lx, ly, lz+1, num_grids, ci); + hypre_SparseMSGMapIndex(lx, ly, lz + 1, num_grids, ci); - hypre_SetIndex3(stridePR, pow(2, lx), pow(2, ly), 1); + hypre_SetIndex3(stridePR, hypre_pow2(lx), hypre_pow2(ly), 1); interpz_a[fi] = hypre_SparseMSGInterpCreate(); hypre_SparseMSGInterpSetup(interpz_a[fi], Pz_a[lz], @@ -824,7 +827,7 @@ hypre_SparseMSGSetup( void *smsg_vdata, hypre_StructMatrixPrint(filename, Pz_a[lz], 0); } #endif - + return ierr; } diff --git a/external/hypre/src/struct_ls/sparse_msg_setup_rap.c b/external/hypre/src/struct_ls/sparse_msg_setup_rap.c index 7c195312..45eb6e34 100644 --- a/external/hypre/src/struct_ls/sparse_msg_setup_rap.c +++ b/external/hypre/src/struct_ls/sparse_msg_setup_rap.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -18,7 +18,7 @@ * Wrapper for 2 and 3d CreateRAPOp routines which set up new coarse * grid structures. *--------------------------------------------------------------------------*/ - + hypre_StructMatrix * hypre_SparseMSGCreateRAPOp( hypre_StructMatrix *R, hypre_StructMatrix *A, @@ -26,21 +26,21 @@ hypre_SparseMSGCreateRAPOp( hypre_StructMatrix *R, hypre_StructGrid *coarse_grid, HYPRE_Int cdir ) { - hypre_StructMatrix *RAP; + hypre_StructMatrix *RAP = NULL; hypre_StructStencil *stencil; stencil = hypre_StructMatrixStencil(A); - switch (hypre_StructStencilNDim(stencil)) + switch (hypre_StructStencilNDim(stencil)) { case 2: - RAP = hypre_SparseMSG2CreateRAPOp(R ,A, P, coarse_grid, cdir); - break; - + RAP = hypre_SparseMSG2CreateRAPOp(R, A, P, coarse_grid, cdir); + break; + case 3: - RAP = hypre_SparseMSG3CreateRAPOp(R ,A, P, coarse_grid, cdir); - break; - } + RAP = hypre_SparseMSG3CreateRAPOp(R, A, P, coarse_grid, cdir); + break; + } return RAP; } @@ -49,9 +49,9 @@ hypre_SparseMSGCreateRAPOp( hypre_StructMatrix *R, * hypre_SparseMSGSetupRAPOp * * Wrapper for 2 and 3d, symmetric and non-symmetric routines to calculate - * entries in RAP. Incomplete error handling at the moment. + * entries in RAP. Incomplete error handling at the moment. *--------------------------------------------------------------------------*/ - + HYPRE_Int hypre_SparseMSGSetupRAPOp( hypre_StructMatrix *R, hypre_StructMatrix *A, @@ -63,47 +63,47 @@ hypre_SparseMSGSetupRAPOp( hypre_StructMatrix *R, hypre_StructMatrix *Ac ) { HYPRE_Int ierr = 0; - + hypre_StructStencil *stencil; stencil = hypre_StructMatrixStencil(A); - switch (hypre_StructStencilNDim(stencil)) + switch (hypre_StructStencilNDim(stencil)) { case 2: - /*-------------------------------------------------------------------- - * Set lower triangular (+ diagonal) coefficients - *--------------------------------------------------------------------*/ - ierr = hypre_SparseMSG2BuildRAPSym(A, P, R, cdir, - cindex, cstride, stridePR, Ac); + /*-------------------------------------------------------------------- + * Set lower triangular (+ diagonal) coefficients + *--------------------------------------------------------------------*/ + ierr = hypre_SparseMSG2BuildRAPSym(A, P, R, cdir, + cindex, cstride, stridePR, Ac); - /*-------------------------------------------------------------------- - * For non-symmetric A, set upper triangular coefficients as well - *--------------------------------------------------------------------*/ - if(!hypre_StructMatrixSymmetric(A)) - ierr += hypre_SparseMSG2BuildRAPNoSym(A, P, R, cdir, - cindex, cstride, stridePR, Ac); + /*-------------------------------------------------------------------- + * For non-symmetric A, set upper triangular coefficients as well + *--------------------------------------------------------------------*/ + if (!hypre_StructMatrixSymmetric(A)) + ierr += hypre_SparseMSG2BuildRAPNoSym(A, P, R, cdir, + cindex, cstride, stridePR, Ac); - break; + break; case 3: - /*-------------------------------------------------------------------- - * Set lower triangular (+ diagonal) coefficients - *--------------------------------------------------------------------*/ - ierr = hypre_SparseMSG3BuildRAPSym(A, P, R, cdir, - cindex, cstride, stridePR, Ac); + /*-------------------------------------------------------------------- + * Set lower triangular (+ diagonal) coefficients + *--------------------------------------------------------------------*/ + ierr = hypre_SparseMSG3BuildRAPSym(A, P, R, cdir, + cindex, cstride, stridePR, Ac); - /*-------------------------------------------------------------------- - * For non-symmetric A, set upper triangular coefficients as well - *--------------------------------------------------------------------*/ - if(!hypre_StructMatrixSymmetric(A)) - ierr += hypre_SparseMSG3BuildRAPNoSym(A, P, R, cdir, - cindex, cstride, stridePR, Ac); + /*-------------------------------------------------------------------- + * For non-symmetric A, set upper triangular coefficients as well + *--------------------------------------------------------------------*/ + if (!hypre_StructMatrixSymmetric(A)) + ierr += hypre_SparseMSG3BuildRAPNoSym(A, P, R, cdir, + cindex, cstride, stridePR, Ac); - break; + break; } @@ -111,4 +111,3 @@ hypre_SparseMSGSetupRAPOp( hypre_StructMatrix *R, return ierr; } - diff --git a/external/hypre/src/struct_ls/sparse_msg_solve.c b/external/hypre/src/struct_ls/sparse_msg_solve.c index c024ac5c..863374ae 100644 --- a/external/hypre/src/struct_ls/sparse_msg_solve.c +++ b/external/hypre/src/struct_ls/sparse_msg_solve.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -25,7 +25,7 @@ hypre_SparseMSGSolve( void *smsg_vdata, hypre_StructVector *b, hypre_StructVector *x ) { - hypre_SparseMSGData *smsg_data = (hypre_SparseMSGData *)smsg_vdata; + hypre_SparseMSGData *smsg_data = (hypre_SparseMSGData *)smsg_vdata; HYPRE_Real tol = (smsg_data -> tol); HYPRE_Int max_iter = (smsg_data -> max_iter); @@ -68,12 +68,12 @@ hypre_SparseMSGSolve( void *smsg_vdata, HYPRE_Int *restrict_count; - HYPRE_Real b_dot_b, r_dot_r, eps; - HYPRE_Real e_dot_e, x_dot_x; - + HYPRE_Real b_dot_b = 0.0, r_dot_r, eps = 0.0; + HYPRE_Real e_dot_e = 1.0, x_dot_x = 1.0; + HYPRE_Int i, l, lx, ly, lz; HYPRE_Int lymin, lymax, lzmin, lzmax; - HYPRE_Int fi, ci; + HYPRE_Int fi, ci; HYPRE_Int ierr = 0; #if DEBUG @@ -113,7 +113,7 @@ hypre_SparseMSGSolve( void *smsg_vdata, { /* eps = (tol^2) */ b_dot_b = hypre_StructInnerProd(b_array[0], b_array[0]); - eps = tol*tol; + eps = tol * tol; /* if rhs is zero, return a zero solution */ if (b_dot_b == 0.0) @@ -163,26 +163,32 @@ hypre_SparseMSGSolve( void *smsg_vdata, if (logging > 0) { - norms[i] = sqrt(r_dot_r); - if (b_dot_b > 0) - rel_norms[i] = sqrt(r_dot_r/b_dot_b); + norms[i] = hypre_sqrt(r_dot_r); + if (b_dot_b > 0.0) + { + rel_norms[i] = hypre_sqrt(r_dot_r / b_dot_b); + } else + { rel_norms[i] = 0.0; + } } -/* RDF */ + /* RDF */ #if 0 -hypre_printf("iter = %d, rel_norm = %e\n", i, rel_norms[i]); + hypre_printf("iter = %d, rel_norm = %e\n", i, rel_norms[i]); #endif /* always do at least 1 V-cycle */ - if ((r_dot_r/b_dot_b < eps) && (i > 0)) + if ((r_dot_r / b_dot_b < eps) && (i > 0)) { if (rel_change) { - if ((e_dot_e/x_dot_x) < eps) + if ((e_dot_e / x_dot_x) < eps) + { break; + } } else { @@ -220,7 +226,7 @@ hypre_printf("iter = %d, rel_norm = %e\n", i, rel_norms[i]); if (restrict_count[fi] > 1) { - hypre_StructScale((1.0/restrict_count[fi]), b_array[fi]); + hypre_StructScale((1.0 / restrict_count[fi]), b_array[fi]); } if (l > jump) @@ -238,11 +244,11 @@ hypre_printf("iter = %d, rel_norm = %e\n", i, rel_norms[i]); -1.0, A_array[fi], x_array[fi], 1.0, r_array[fi]); } - - if ((lx+1) < num_grids[0]) + + if ((lx + 1) < num_grids[0]) { /* restrict to ((lx+1), ly, lz) */ - hypre_SparseMSGMapIndex((lx+1), ly, lz, num_grids, ci); + hypre_SparseMSGMapIndex((lx + 1), ly, lz, num_grids, ci); if (grid_on[ci]) { if (restrict_count[ci]) @@ -261,10 +267,10 @@ hypre_printf("iter = %d, rel_norm = %e\n", i, rel_norms[i]); restrict_count[ci]++; } } - if ((ly+1) < num_grids[1]) + if ((ly + 1) < num_grids[1]) { /* restrict to (lx, (ly+1), lz) */ - hypre_SparseMSGMapIndex(lx, (ly+1), lz, num_grids, ci); + hypre_SparseMSGMapIndex(lx, (ly + 1), lz, num_grids, ci); if (grid_on[ci]) { if (restrict_count[ci]) @@ -283,10 +289,10 @@ hypre_printf("iter = %d, rel_norm = %e\n", i, rel_norms[i]); restrict_count[ci]++; } } - if ((lz+1) < num_grids[2]) + if ((lz + 1) < num_grids[2]) { /* restrict to (lx, ly, (lz+1)) */ - hypre_SparseMSGMapIndex(lx, ly, (lz+1), num_grids, ci); + hypre_SparseMSGMapIndex(lx, ly, (lz + 1), num_grids, ci); if (grid_on[ci]) { if (restrict_count[ci]) @@ -320,12 +326,12 @@ hypre_printf("iter = %d, rel_norm = %e\n", i, rel_norms[i]); /*-------------------------------------------------- * Bottom *--------------------------------------------------*/ - + fi = num_all_grids - 1; if (restrict_count[fi] > 1) { - hypre_StructScale((1.0/restrict_count[fi]), b_array[fi]); + hypre_StructScale((1.0 / restrict_count[fi]), b_array[fi]); } hypre_PFMGRelaxSetZeroGuess(relax_array[fi], 1); @@ -357,7 +363,7 @@ hypre_printf("iter = %d, rel_norm = %e\n", i, rel_norms[i]); lx = l - lz - ly; hypre_SparseMSGMapIndex(lx, ly, lz, num_grids, fi); - + if (!grid_on[fi]) { break; @@ -367,10 +373,10 @@ hypre_printf("iter = %d, rel_norm = %e\n", i, rel_norms[i]); { hypre_StructVectorSetConstantValues(x_array[fi], 0.0); } - if ((lx+1) < num_grids[0]) + if ((lx + 1) < num_grids[0]) { /* interpolate from ((lx+1), ly, lz) */ - hypre_SparseMSGMapIndex((lx+1), ly, lz, num_grids, ci); + hypre_SparseMSGMapIndex((lx + 1), ly, lz, num_grids, ci); if (grid_on[ci]) { hypre_SparseMSGInterp(interpx_array[fi], @@ -381,10 +387,10 @@ hypre_printf("iter = %d, rel_norm = %e\n", i, rel_norms[i]); hypre_StructAxpy(1.0, e_array[fi], x_array[fi]); } } - if ((ly+1) < num_grids[1]) + if ((ly + 1) < num_grids[1]) { /* interpolate from (lx, (ly+1), lz) */ - hypre_SparseMSGMapIndex(lx, (ly+1), lz, num_grids, ci); + hypre_SparseMSGMapIndex(lx, (ly + 1), lz, num_grids, ci); if (grid_on[ci]) { hypre_SparseMSGInterp(interpy_array[fi], @@ -395,10 +401,10 @@ hypre_printf("iter = %d, rel_norm = %e\n", i, rel_norms[i]); hypre_StructAxpy(1.0, e_array[fi], x_array[fi]); } } - if ((lz+1) < num_grids[2]) + if ((lz + 1) < num_grids[2]) { /* interpolate from (lx, ly, (lz+1)) */ - hypre_SparseMSGMapIndex(lx, ly, (lz+1), num_grids, ci); + hypre_SparseMSGMapIndex(lx, ly, (lz + 1), num_grids, ci); if (grid_on[ci]) { hypre_SparseMSGInterp(interpz_array[fi], @@ -408,7 +414,7 @@ hypre_printf("iter = %d, rel_norm = %e\n", i, rel_norms[i]); lx, ly, lz, jump); hypre_StructAxpy(1.0, e_array[fi], x_array[fi]); } - } + } #if DEBUG hypre_sprintf(filename, "zoutSMSG_xup.%d.%d.%d", lx, ly, lz); hypre_StructVectorPrint(filename, x_array[fi], 0); @@ -456,4 +462,3 @@ hypre_printf("iter = %d, rel_norm = %e\n", i, rel_norms[i]); return ierr; } - diff --git a/external/hypre/src/struct_mv/CMakeLists.txt b/external/hypre/src/struct_mv/CMakeLists.txt index b77c8863..20e4dc1f 100644 --- a/external/hypre/src/struct_mv/CMakeLists.txt +++ b/external/hypre/src/struct_mv/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -44,8 +44,8 @@ target_sources(${PROJECT_NAME} ${HDRS} ) -if (HYPRE_USING_CUDA) - set(CUDA_SRCS +if (HYPRE_USING_GPU) + set(GPU_SRCS struct_axpy.c struct_communication.c struct_copy.c @@ -55,8 +55,8 @@ if (HYPRE_USING_CUDA) struct_scale.c struct_vector.c ) - convert_filenames_to_full_paths(CUDA_SRCS) - set(HYPRE_CUDA_SOURCES ${HYPRE_CUDA_SOURCES} ${CUDA_SRCS} PARENT_SCOPE) + convert_filenames_to_full_paths(GPU_SRCS) + set(HYPRE_GPU_SOURCES ${HYPRE_GPU_SOURCES} ${GPU_SRCS} PARENT_SCOPE) endif () convert_filenames_to_full_paths(HDRS) diff --git a/external/hypre/src/struct_mv/F90_HYPRE_struct_grid.c b/external/hypre/src/struct_mv/F90_HYPRE_struct_grid.c index 47ef9c0e..0136f7bf 100644 --- a/external/hypre/src/struct_mv/F90_HYPRE_struct_grid.c +++ b/external/hypre/src/struct_mv/F90_HYPRE_struct_grid.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,23 +17,23 @@ #ifdef __cplusplus extern "C" { #endif - + /*-------------------------------------------------------------------------- * HYPRE_StructGridCreate *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_structgridcreate, HYPRE_STRUCTGRIDCREATE) - ( hypre_F90_Comm *comm, - hypre_F90_Int *dim, - hypre_F90_Obj *grid, - hypre_F90_Int *ierr ) +( hypre_F90_Comm *comm, + hypre_F90_Int *dim, + hypre_F90_Obj *grid, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructGridCreate( - hypre_F90_PassComm (comm), - hypre_F90_PassInt (dim), - hypre_F90_PassObjRef (HYPRE_StructGrid, grid) ) ); + ( HYPRE_StructGridCreate( + hypre_F90_PassComm (comm), + hypre_F90_PassInt (dim), + hypre_F90_PassObjRef (HYPRE_StructGrid, grid) ) ); } /*-------------------------------------------------------------------------- @@ -42,12 +42,12 @@ hypre_F90_IFACE(hypre_structgridcreate, HYPRE_STRUCTGRIDCREATE) void hypre_F90_IFACE(hypre_structgriddestroy, HYPRE_STRUCTGRIDDESTROY) - ( hypre_F90_Obj *grid, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *grid, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructGridDestroy( - hypre_F90_PassObj (HYPRE_StructGrid, grid) ) ); + ( HYPRE_StructGridDestroy( + hypre_F90_PassObj (HYPRE_StructGrid, grid) ) ); } /*-------------------------------------------------------------------------- @@ -56,16 +56,16 @@ hypre_F90_IFACE(hypre_structgriddestroy, HYPRE_STRUCTGRIDDESTROY) void hypre_F90_IFACE(hypre_structgridsetextents, HYPRE_STRUCTGRIDSETEXTENTS) - ( hypre_F90_Obj *grid, - hypre_F90_IntArray *ilower, - hypre_F90_IntArray *iupper, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *grid, + hypre_F90_IntArray *ilower, + hypre_F90_IntArray *iupper, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructGridSetExtents( - hypre_F90_PassObj (HYPRE_StructGrid, grid), - hypre_F90_PassIntArray (ilower), - hypre_F90_PassIntArray (iupper) ) ); + ( HYPRE_StructGridSetExtents( + hypre_F90_PassObj (HYPRE_StructGrid, grid), + hypre_F90_PassIntArray (ilower), + hypre_F90_PassIntArray (iupper) ) ); } /*-------------------------------------------------------------------------- @@ -74,14 +74,14 @@ hypre_F90_IFACE(hypre_structgridsetextents, HYPRE_STRUCTGRIDSETEXTENTS) void hypre_F90_IFACE(hypre_structgridsetperiodic, HYPRE_STRUCTGRIDSETPERIODIC) - ( hypre_F90_Obj *grid, - hypre_F90_IntArray *periodic, - hypre_F90_Int *ierr) +( hypre_F90_Obj *grid, + hypre_F90_IntArray *periodic, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) - ( HYPRE_StructGridSetPeriodic( - hypre_F90_PassObj (HYPRE_StructGrid, grid), - hypre_F90_PassIntArray (periodic)) ); + ( HYPRE_StructGridSetPeriodic( + hypre_F90_PassObj (HYPRE_StructGrid, grid), + hypre_F90_PassIntArray (periodic)) ); } /*-------------------------------------------------------------------------- @@ -90,12 +90,12 @@ hypre_F90_IFACE(hypre_structgridsetperiodic, HYPRE_STRUCTGRIDSETPERIODIC) void hypre_F90_IFACE(hypre_structgridassemble, HYPRE_STRUCTGRIDASSEMBLE) - ( hypre_F90_Obj *grid, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *grid, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructGridAssemble( - hypre_F90_PassObj (HYPRE_StructGrid, grid)) ); + ( HYPRE_StructGridAssemble( + hypre_F90_PassObj (HYPRE_StructGrid, grid)) ); } /*-------------------------------------------------------------------------- @@ -104,16 +104,16 @@ hypre_F90_IFACE(hypre_structgridassemble, HYPRE_STRUCTGRIDASSEMBLE) void hypre_F90_IFACE(hypre_structgridsetnumghost, HYPRE_STRUCTGRIDSETNUMGHOST) - ( hypre_F90_Obj *grid, - hypre_F90_IntArray *num_ghost, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *grid, + hypre_F90_IntArray *num_ghost, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructGridSetNumGhost( - hypre_F90_PassObj (HYPRE_StructGrid, grid), - hypre_F90_PassIntArray (num_ghost)) ); + ( HYPRE_StructGridSetNumGhost( + hypre_F90_PassObj (HYPRE_StructGrid, grid), + hypre_F90_PassIntArray (num_ghost)) ); } - + #ifdef __cplusplus } #endif diff --git a/external/hypre/src/struct_mv/F90_HYPRE_struct_matrix.c b/external/hypre/src/struct_mv/F90_HYPRE_struct_matrix.c index 893df8ea..1dbea175 100644 --- a/external/hypre/src/struct_mv/F90_HYPRE_struct_matrix.c +++ b/external/hypre/src/struct_mv/F90_HYPRE_struct_matrix.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,37 +17,37 @@ #ifdef __cplusplus extern "C" { #endif - + /*-------------------------------------------------------------------------- * HYPRE_StructMatrixCreate *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_structmatrixcreate, HYPRE_STRUCTMATRIXCREATE) - (hypre_F90_Comm *comm, - hypre_F90_Obj *grid, - hypre_F90_Obj *stencil, - hypre_F90_Obj *matrix, - hypre_F90_Int *ierr) +(hypre_F90_Comm *comm, + hypre_F90_Obj *grid, + hypre_F90_Obj *stencil, + hypre_F90_Obj *matrix, + hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) HYPRE_StructMatrixCreate( - hypre_F90_PassComm (comm), - hypre_F90_PassObj (HYPRE_StructGrid, grid), - hypre_F90_PassObj (HYPRE_StructStencil, stencil), - hypre_F90_PassObjRef (HYPRE_StructMatrix, matrix) ); + hypre_F90_PassComm (comm), + hypre_F90_PassObj (HYPRE_StructGrid, grid), + hypre_F90_PassObj (HYPRE_StructStencil, stencil), + hypre_F90_PassObjRef (HYPRE_StructMatrix, matrix) ); } /*-------------------------------------------------------------------------- * HYPRE_StructMatrixDestroy *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_structmatrixdestroy, HYPRE_STRUCTMATRIXDESTROY) - ( hypre_F90_Obj *matrix, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *matrix, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) HYPRE_StructMatrixDestroy( - hypre_F90_PassObj (HYPRE_StructMatrix, matrix) ); + hypre_F90_PassObj (HYPRE_StructMatrix, matrix) ); } /*-------------------------------------------------------------------------- @@ -56,188 +56,188 @@ hypre_F90_IFACE(hypre_structmatrixdestroy, HYPRE_STRUCTMATRIXDESTROY) void hypre_F90_IFACE(hypre_structmatrixinitialize, HYPRE_STRUCTMATRIXINITIALIZE) - ( hypre_F90_Obj *matrix, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *matrix, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) HYPRE_StructMatrixInitialize( - hypre_F90_PassObj (HYPRE_StructMatrix, matrix) ); + hypre_F90_PassObj (HYPRE_StructMatrix, matrix) ); } /*-------------------------------------------------------------------------- * HYPRE_StructMatrixSetValues *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_structmatrixsetvalues, HYPRE_STRUCTMATRIXSETVALUES) - ( hypre_F90_Obj *matrix, - hypre_F90_IntArray *grid_index, - hypre_F90_Int *num_stencil_indices, - hypre_F90_IntArray *stencil_indices, - hypre_F90_ComplexArray *values, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *matrix, + hypre_F90_IntArray *grid_index, + hypre_F90_Int *num_stencil_indices, + hypre_F90_IntArray *stencil_indices, + hypre_F90_ComplexArray *values, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) HYPRE_StructMatrixSetValues( - hypre_F90_PassObj (HYPRE_StructMatrix, matrix), - hypre_F90_PassIntArray (grid_index), - hypre_F90_PassInt (num_stencil_indices), - hypre_F90_PassIntArray (stencil_indices), - hypre_F90_PassComplexArray (values) ); + hypre_F90_PassObj (HYPRE_StructMatrix, matrix), + hypre_F90_PassIntArray (grid_index), + hypre_F90_PassInt (num_stencil_indices), + hypre_F90_PassIntArray (stencil_indices), + hypre_F90_PassComplexArray (values) ); } /*-------------------------------------------------------------------------- * HYPRE_StructMatrixSetBoxValues *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_structmatrixsetboxvalues, HYPRE_STRUCTMATRIXSETBOXVALUES) - ( hypre_F90_Obj *matrix, - hypre_F90_IntArray *ilower, - hypre_F90_IntArray *iupper, - hypre_F90_Int *num_stencil_indices, - hypre_F90_IntArray *stencil_indices, - hypre_F90_ComplexArray *values, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *matrix, + hypre_F90_IntArray *ilower, + hypre_F90_IntArray *iupper, + hypre_F90_Int *num_stencil_indices, + hypre_F90_IntArray *stencil_indices, + hypre_F90_ComplexArray *values, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) HYPRE_StructMatrixSetBoxValues( - hypre_F90_PassObj (HYPRE_StructMatrix, matrix), - hypre_F90_PassIntArray (ilower), - hypre_F90_PassIntArray (iupper), - hypre_F90_PassInt (num_stencil_indices), - hypre_F90_PassIntArray (stencil_indices), - hypre_F90_PassComplexArray (values) ); + hypre_F90_PassObj (HYPRE_StructMatrix, matrix), + hypre_F90_PassIntArray (ilower), + hypre_F90_PassIntArray (iupper), + hypre_F90_PassInt (num_stencil_indices), + hypre_F90_PassIntArray (stencil_indices), + hypre_F90_PassComplexArray (values) ); } /*-------------------------------------------------------------------------- * HYPRE_StructMatrixGetBoxValues *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_structmatrixgetboxvalues, HYPRE_STRUCTMATRIXGETBOXVALUES) - ( hypre_F90_Obj *matrix, - hypre_F90_IntArray *ilower, - hypre_F90_IntArray *iupper, - hypre_F90_Int *num_stencil_indices, - hypre_F90_IntArray *stencil_indices, - hypre_F90_ComplexArray *values, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *matrix, + hypre_F90_IntArray *ilower, + hypre_F90_IntArray *iupper, + hypre_F90_Int *num_stencil_indices, + hypre_F90_IntArray *stencil_indices, + hypre_F90_ComplexArray *values, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) HYPRE_StructMatrixGetBoxValues( - hypre_F90_PassObj (HYPRE_StructMatrix, matrix), - hypre_F90_PassIntArray (ilower), - hypre_F90_PassIntArray (iupper), - hypre_F90_PassInt (num_stencil_indices), - hypre_F90_PassIntArray (stencil_indices), - hypre_F90_PassComplexArray (values) ); + hypre_F90_PassObj (HYPRE_StructMatrix, matrix), + hypre_F90_PassIntArray (ilower), + hypre_F90_PassIntArray (iupper), + hypre_F90_PassInt (num_stencil_indices), + hypre_F90_PassIntArray (stencil_indices), + hypre_F90_PassComplexArray (values) ); } /*-------------------------------------------------------------------------- * HYPRE_StructMatrixSetConstantValues *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_structmatrixsetconstantva, HYPRE_STRUCTMATRIXSETCONSTANTVA) - ( hypre_F90_Obj *matrix, - hypre_F90_Int *num_stencil_indices, - hypre_F90_IntArray *stencil_indices, - hypre_F90_ComplexArray *values, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *matrix, + hypre_F90_Int *num_stencil_indices, + hypre_F90_IntArray *stencil_indices, + hypre_F90_ComplexArray *values, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) HYPRE_StructMatrixSetConstantValues( - hypre_F90_PassObj (HYPRE_StructMatrix, matrix), - hypre_F90_PassInt (num_stencil_indices), - hypre_F90_PassIntArray (stencil_indices), - hypre_F90_PassComplexArray (values) ); + hypre_F90_PassObj (HYPRE_StructMatrix, matrix), + hypre_F90_PassInt (num_stencil_indices), + hypre_F90_PassIntArray (stencil_indices), + hypre_F90_PassComplexArray (values) ); } /*-------------------------------------------------------------------------- * HYPRE_StructMatrixAddToValues *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_structmatrixaddtovalues, HYPRE_STRUCTMATRIXADDTOVALUES) - ( hypre_F90_Obj *matrix, - hypre_F90_IntArray *grid_index, - hypre_F90_Int *num_stencil_indices, - hypre_F90_IntArray *stencil_indices, - hypre_F90_ComplexArray *values, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *matrix, + hypre_F90_IntArray *grid_index, + hypre_F90_Int *num_stencil_indices, + hypre_F90_IntArray *stencil_indices, + hypre_F90_ComplexArray *values, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) HYPRE_StructMatrixAddToValues( - hypre_F90_PassObj (HYPRE_StructMatrix, matrix), - hypre_F90_PassIntArray (grid_index), - hypre_F90_PassInt (num_stencil_indices), - hypre_F90_PassIntArray (stencil_indices), - hypre_F90_PassComplexArray (values) ); + hypre_F90_PassObj (HYPRE_StructMatrix, matrix), + hypre_F90_PassIntArray (grid_index), + hypre_F90_PassInt (num_stencil_indices), + hypre_F90_PassIntArray (stencil_indices), + hypre_F90_PassComplexArray (values) ); } /*-------------------------------------------------------------------------- * HYPRE_StructMatrixAddToBoxValues *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_structmatrixaddtoboxvalues, HYPRE_STRUCTMATRIXADDTOBOXVALUES) - ( hypre_F90_Obj *matrix, - hypre_F90_IntArray *ilower, - hypre_F90_IntArray *iupper, - hypre_F90_Int *num_stencil_indices, - hypre_F90_IntArray *stencil_indices, - hypre_F90_ComplexArray *values, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *matrix, + hypre_F90_IntArray *ilower, + hypre_F90_IntArray *iupper, + hypre_F90_Int *num_stencil_indices, + hypre_F90_IntArray *stencil_indices, + hypre_F90_ComplexArray *values, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) HYPRE_StructMatrixAddToBoxValues( - hypre_F90_PassObj (HYPRE_StructMatrix, matrix), - hypre_F90_PassIntArray (ilower), - hypre_F90_PassIntArray (iupper), - hypre_F90_PassInt (num_stencil_indices), - hypre_F90_PassIntArray (stencil_indices), - hypre_F90_PassComplexArray (values) ); + hypre_F90_PassObj (HYPRE_StructMatrix, matrix), + hypre_F90_PassIntArray (ilower), + hypre_F90_PassIntArray (iupper), + hypre_F90_PassInt (num_stencil_indices), + hypre_F90_PassIntArray (stencil_indices), + hypre_F90_PassComplexArray (values) ); } /*-------------------------------------------------------------------------- * HYPRE_StructMatrixAddToConstantValues *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_structmatrixaddtoconstant, HYPRE_STRUCTMATRIXADDTOCONSTANT) - ( hypre_F90_Obj *matrix, - hypre_F90_Int *num_stencil_indices, - hypre_F90_IntArray *stencil_indices, - hypre_F90_ComplexArray *values, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *matrix, + hypre_F90_Int *num_stencil_indices, + hypre_F90_IntArray *stencil_indices, + hypre_F90_ComplexArray *values, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) HYPRE_StructMatrixSetConstantValues( - hypre_F90_PassObj (HYPRE_StructMatrix, matrix), - hypre_F90_PassInt (num_stencil_indices), - hypre_F90_PassIntArray (stencil_indices), - hypre_F90_PassComplexArray (values) ); + hypre_F90_PassObj (HYPRE_StructMatrix, matrix), + hypre_F90_PassInt (num_stencil_indices), + hypre_F90_PassIntArray (stencil_indices), + hypre_F90_PassComplexArray (values) ); } /*-------------------------------------------------------------------------- * HYPRE_StructMatrixAssemble *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_structmatrixassemble, HYPRE_STRUCTMATRIXASSEMBLE) - ( hypre_F90_Obj *matrix, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *matrix, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) HYPRE_StructMatrixAssemble( - hypre_F90_PassObj (HYPRE_StructMatrix, matrix) ); + hypre_F90_PassObj (HYPRE_StructMatrix, matrix) ); } /*-------------------------------------------------------------------------- * HYPRE_StructMatrixSetNumGhost *--------------------------------------------------------------------------*/ - + void hypre_F90_IFACE(hypre_structmatrixsetnumghost, HYPRE_STRUCTMATRIXSETNUMGHOST) - ( hypre_F90_Obj *matrix, - hypre_F90_IntArray *num_ghost, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *matrix, + hypre_F90_IntArray *num_ghost, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) HYPRE_StructMatrixSetNumGhost( - hypre_F90_PassObj (HYPRE_StructMatrix, matrix), - hypre_F90_PassIntArray (num_ghost) ); + hypre_F90_PassObj (HYPRE_StructMatrix, matrix), + hypre_F90_PassIntArray (num_ghost) ); } /*-------------------------------------------------------------------------- @@ -246,45 +246,45 @@ hypre_F90_IFACE(hypre_structmatrixsetnumghost, HYPRE_STRUCTMATRIXSETNUMGHOST) void hypre_F90_IFACE(hypre_structmatrixgetgrid, HYPRE_STRUCTMATRIXGETGRID) - ( hypre_F90_Obj *matrix, - hypre_F90_Obj *grid, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *matrix, + hypre_F90_Obj *grid, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) HYPRE_StructMatrixGetGrid( - hypre_F90_PassObj (HYPRE_StructMatrix, matrix), - hypre_F90_PassObjRef (HYPRE_StructGrid, grid) ); + hypre_F90_PassObj (HYPRE_StructMatrix, matrix), + hypre_F90_PassObjRef (HYPRE_StructGrid, grid) ); } /*-------------------------------------------------------------------------- * HYPRE_StructMatrixSetSymmetric *--------------------------------------------------------------------------*/ - + void hypre_F90_IFACE(hypre_structmatrixsetsymmetric, HYPRE_STRUCTMATRIXSETSYMMETRIC) - ( hypre_F90_Obj *matrix, - hypre_F90_Int *symmetric, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *matrix, + hypre_F90_Int *symmetric, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) HYPRE_StructMatrixSetSymmetric( - hypre_F90_PassObj (HYPRE_StructMatrix, matrix), - hypre_F90_PassInt (symmetric) ); + hypre_F90_PassObj (HYPRE_StructMatrix, matrix), + hypre_F90_PassInt (symmetric) ); } /*-------------------------------------------------------------------------- * HYPRE_StructMatrixSetConstantEntries *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_structmatrixsetconstanten, HYPRE_STRUCTMATRIXSETCONSTANTEN) - ( hypre_F90_Obj *matrix, - hypre_F90_Int *nentries, - hypre_F90_IntArray *entries, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *matrix, + hypre_F90_Int *nentries, + hypre_F90_IntArray *entries, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) HYPRE_StructMatrixSetConstantEntries( - hypre_F90_PassObj (HYPRE_StructMatrix, matrix), - hypre_F90_PassInt (nentries), - hypre_F90_PassIntArray (entries) ); + hypre_F90_PassObj (HYPRE_StructMatrix, matrix), + hypre_F90_PassInt (nentries), + hypre_F90_PassIntArray (entries) ); } /*-------------------------------------------------------------------------- @@ -293,38 +293,38 @@ hypre_F90_IFACE(hypre_structmatrixsetconstanten, HYPRE_STRUCTMATRIXSETCONSTANTEN void hypre_F90_IFACE(hypre_structmatrixprint, HYPRE_STRUCTMATRIXPRINT) - ( - hypre_F90_Obj *matrix, - hypre_F90_Int *all, - hypre_F90_Int *ierr ) +( + hypre_F90_Obj *matrix, + hypre_F90_Int *all, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) HYPRE_StructMatrixPrint( - "HYPRE_StructMatrix.out", - hypre_F90_PassObj (HYPRE_StructMatrix, matrix), - hypre_F90_PassInt (all)); + "HYPRE_StructMatrix.out", + hypre_F90_PassObj (HYPRE_StructMatrix, matrix), + hypre_F90_PassInt (all)); } /*-------------------------------------------------------------------------- * HYPRE_StructMatrixMatvec *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_structmatrixmatvec, HYPRE_STRUCTMATRIXMATVEC) - ( hypre_F90_Complex *alpha, - hypre_F90_Obj *A, - hypre_F90_Obj *x, - hypre_F90_Complex *beta, - hypre_F90_Obj *y, - hypre_F90_Int *ierr ) +( hypre_F90_Complex *alpha, + hypre_F90_Obj *A, + hypre_F90_Obj *x, + hypre_F90_Complex *beta, + hypre_F90_Obj *y, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) HYPRE_StructMatrixMatvec( - hypre_F90_PassComplex (alpha), - hypre_F90_PassObj (HYPRE_StructMatrix, A), - hypre_F90_PassObj (HYPRE_StructVector, x), - hypre_F90_PassComplex (beta), - hypre_F90_PassObj (HYPRE_StructVector, y) ); + hypre_F90_PassComplex (alpha), + hypre_F90_PassObj (HYPRE_StructMatrix, A), + hypre_F90_PassObj (HYPRE_StructVector, x), + hypre_F90_PassComplex (beta), + hypre_F90_PassObj (HYPRE_StructVector, y) ); } - + #ifdef __cplusplus } #endif diff --git a/external/hypre/src/struct_mv/F90_HYPRE_struct_stencil.c b/external/hypre/src/struct_mv/F90_HYPRE_struct_stencil.c index aca0f4c1..a7f53ff5 100644 --- a/external/hypre/src/struct_mv/F90_HYPRE_struct_stencil.c +++ b/external/hypre/src/struct_mv/F90_HYPRE_struct_stencil.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,22 +17,22 @@ #ifdef __cplusplus extern "C" { #endif - + /*-------------------------------------------------------------------------- * HYPRE_StructStencilCreate *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_structstencilcreate, HYPRE_STRUCTSTENCILCREATE) - ( hypre_F90_Int *dim, - hypre_F90_Int *size, - hypre_F90_Obj *stencil, - hypre_F90_Int *ierr ) +( hypre_F90_Int *dim, + hypre_F90_Int *size, + hypre_F90_Obj *stencil, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) HYPRE_StructStencilCreate( - hypre_F90_PassInt (dim), - hypre_F90_PassInt (size), - hypre_F90_PassObjRef (HYPRE_StructStencil, stencil) ); + hypre_F90_PassInt (dim), + hypre_F90_PassInt (size), + hypre_F90_PassObjRef (HYPRE_StructStencil, stencil) ); } /*-------------------------------------------------------------------------- @@ -41,15 +41,15 @@ hypre_F90_IFACE(hypre_structstencilcreate, HYPRE_STRUCTSTENCILCREATE) void hypre_F90_IFACE(hypre_structstencilsetelement, HYPRE_STRUCTSTENCILSETELEMENT) - ( hypre_F90_Obj *stencil, - hypre_F90_Int *element_index, - hypre_F90_IntArray *offset, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *stencil, + hypre_F90_Int *element_index, + hypre_F90_IntArray *offset, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) HYPRE_StructStencilSetElement( - hypre_F90_PassObj (HYPRE_StructStencil, stencil), - hypre_F90_PassInt (element_index), - hypre_F90_PassIntArray (offset) ); + hypre_F90_PassObj (HYPRE_StructStencil, stencil), + hypre_F90_PassInt (element_index), + hypre_F90_PassIntArray (offset) ); } /*-------------------------------------------------------------------------- @@ -58,13 +58,13 @@ hypre_F90_IFACE(hypre_structstencilsetelement, HYPRE_STRUCTSTENCILSETELEMENT) void hypre_F90_IFACE(hypre_structstencildestroy, HYPRE_STRUCTSTENCILDESTROY) - ( hypre_F90_Obj *stencil, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *stencil, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) HYPRE_StructStencilDestroy( - hypre_F90_PassObj (HYPRE_StructStencil, stencil) ); + hypre_F90_PassObj (HYPRE_StructStencil, stencil) ); } - + #ifdef __cplusplus } #endif diff --git a/external/hypre/src/struct_mv/F90_HYPRE_struct_vector.c b/external/hypre/src/struct_mv/F90_HYPRE_struct_vector.c index 9c53ec8c..b53e01b9 100644 --- a/external/hypre/src/struct_mv/F90_HYPRE_struct_vector.c +++ b/external/hypre/src/struct_mv/F90_HYPRE_struct_vector.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,37 +17,37 @@ #ifdef __cplusplus extern "C" { #endif - + /*-------------------------------------------------------------------------- * HYPRE_StructVectorCreate *--------------------------------------------------------------------------*/ void hypre_F90_IFACE(hypre_structvectorcreate, HYPRE_STRUCTVECTORCREATE) - ( hypre_F90_Comm *comm, - hypre_F90_Obj *grid, - hypre_F90_Obj *vector, - hypre_F90_Int *ierr ) +( hypre_F90_Comm *comm, + hypre_F90_Obj *grid, + hypre_F90_Obj *vector, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructVectorCreate( - hypre_F90_PassComm (comm), - hypre_F90_PassObj (HYPRE_StructGrid, grid), - hypre_F90_PassObjRef (HYPRE_StructVector, vector) ) ); + ( HYPRE_StructVectorCreate( + hypre_F90_PassComm (comm), + hypre_F90_PassObj (HYPRE_StructGrid, grid), + hypre_F90_PassObjRef (HYPRE_StructVector, vector) ) ); } /*-------------------------------------------------------------------------- * HYPRE_StructVectorDestroy *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_structvectordestroy, HYPRE_STRUCTVECTORDESTROY) - ( hypre_F90_Obj *vector, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *vector, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructVectorDestroy( - hypre_F90_PassObj (HYPRE_StructVector, vector) ) ); + ( HYPRE_StructVectorDestroy( + hypre_F90_PassObj (HYPRE_StructVector, vector) ) ); } /*-------------------------------------------------------------------------- @@ -56,188 +56,188 @@ hypre_F90_IFACE(hypre_structvectordestroy, HYPRE_STRUCTVECTORDESTROY) void hypre_F90_IFACE(hypre_structvectorinitialize, HYPRE_STRUCTVECTORINITIALIZE) - ( hypre_F90_Obj *vector, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *vector, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructVectorInitialize( - hypre_F90_PassObj (HYPRE_StructVector, vector) ) ); + ( HYPRE_StructVectorInitialize( + hypre_F90_PassObj (HYPRE_StructVector, vector) ) ); } /*-------------------------------------------------------------------------- * HYPRE_StructVectorSetValues *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_structvectorsetvalues, HYPRE_STRUCTVECTORSETVALUES) - ( hypre_F90_Obj *vector, - hypre_F90_IntArray *grid_index, - hypre_F90_Complex *values, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *vector, + hypre_F90_IntArray *grid_index, + hypre_F90_Complex *values, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructVectorSetValues( - hypre_F90_PassObj (HYPRE_StructVector, vector), - hypre_F90_PassIntArray (grid_index), - hypre_F90_PassComplex (values) ) ); + ( HYPRE_StructVectorSetValues( + hypre_F90_PassObj (HYPRE_StructVector, vector), + hypre_F90_PassIntArray (grid_index), + hypre_F90_PassComplex (values) ) ); } /*-------------------------------------------------------------------------- * HYPRE_StructVectorSetBoxValues *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_structvectorsetboxvalues, HYPRE_STRUCTVECTORSETBOXVALUES) - ( hypre_F90_Obj *vector, - hypre_F90_IntArray *ilower, - hypre_F90_IntArray *iupper, - hypre_F90_ComplexArray *values, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *vector, + hypre_F90_IntArray *ilower, + hypre_F90_IntArray *iupper, + hypre_F90_ComplexArray *values, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructVectorSetBoxValues( - hypre_F90_PassObj (HYPRE_StructVector, vector), - hypre_F90_PassIntArray (ilower), - hypre_F90_PassIntArray (iupper), - hypre_F90_PassComplexArray (values) ) ); + ( HYPRE_StructVectorSetBoxValues( + hypre_F90_PassObj (HYPRE_StructVector, vector), + hypre_F90_PassIntArray (ilower), + hypre_F90_PassIntArray (iupper), + hypre_F90_PassComplexArray (values) ) ); } /*-------------------------------------------------------------------------- * HYPRE_StructVectorAddToValues *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_structvectoraddtovalues, HYPRE_STRUCTVECTORADDTOVALUES) - ( hypre_F90_Obj *vector, - hypre_F90_IntArray *grid_index, - hypre_F90_Complex *values, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *vector, + hypre_F90_IntArray *grid_index, + hypre_F90_Complex *values, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructVectorAddToValues( - hypre_F90_PassObj (HYPRE_StructVector, vector), - hypre_F90_PassIntArray (grid_index), - hypre_F90_PassComplex (values) ) ); + ( HYPRE_StructVectorAddToValues( + hypre_F90_PassObj (HYPRE_StructVector, vector), + hypre_F90_PassIntArray (grid_index), + hypre_F90_PassComplex (values) ) ); } /*-------------------------------------------------------------------------- * HYPRE_StructVectorAddToBoxValues *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_structvectoraddtoboxvalue, HYPRE_STRUCTVECTORADDTOBOXVALUE) - ( hypre_F90_Obj *vector, - hypre_F90_IntArray *ilower, - hypre_F90_IntArray *iupper, - hypre_F90_ComplexArray *values, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *vector, + hypre_F90_IntArray *ilower, + hypre_F90_IntArray *iupper, + hypre_F90_ComplexArray *values, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructVectorAddToBoxValues( - hypre_F90_PassObj (HYPRE_StructVector, vector), - hypre_F90_PassIntArray (ilower), - hypre_F90_PassIntArray (iupper), - hypre_F90_PassComplexArray (values) ) ); + ( HYPRE_StructVectorAddToBoxValues( + hypre_F90_PassObj (HYPRE_StructVector, vector), + hypre_F90_PassIntArray (ilower), + hypre_F90_PassIntArray (iupper), + hypre_F90_PassComplexArray (values) ) ); } /*-------------------------------------------------------------------------- * HYPRE_StructVectorScaleValues *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_structvectorscalevalues, HYPRE_STRUCTVECTORSCALEVALUES) - ( hypre_F90_Obj *vector, - hypre_F90_Complex *factor, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *vector, + hypre_F90_Complex *factor, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructVectorScaleValues( - hypre_F90_PassObj (HYPRE_StructVector, vector), - hypre_F90_PassComplex (factor) ) ); + ( HYPRE_StructVectorScaleValues( + hypre_F90_PassObj (HYPRE_StructVector, vector), + hypre_F90_PassComplex (factor) ) ); } /*-------------------------------------------------------------------------- * HYPRE_StructVectorGetValues *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_structvectorgetvalues, HYPRE_STRUCTVECTORGETVALUES) - ( hypre_F90_Obj *vector, - hypre_F90_IntArray *grid_index, - hypre_F90_Complex *values_ptr, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *vector, + hypre_F90_IntArray *grid_index, + hypre_F90_Complex *values_ptr, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructVectorGetValues( - hypre_F90_PassObj (HYPRE_StructVector, vector), - hypre_F90_PassIntArray (grid_index), - hypre_F90_PassComplexRef (values_ptr) ) ); + ( HYPRE_StructVectorGetValues( + hypre_F90_PassObj (HYPRE_StructVector, vector), + hypre_F90_PassIntArray (grid_index), + hypre_F90_PassComplexRef (values_ptr) ) ); } /*-------------------------------------------------------------------------- * HYPRE_StructVectorGetBoxValues *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_structvectorgetboxvalues, HYPRE_STRUCTVECTORGETBOXVALUES) - ( hypre_F90_Obj *vector, - hypre_F90_IntArray *ilower, - hypre_F90_IntArray *iupper, - hypre_F90_ComplexArray *values, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *vector, + hypre_F90_IntArray *ilower, + hypre_F90_IntArray *iupper, + hypre_F90_ComplexArray *values, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructVectorGetBoxValues( - hypre_F90_PassObj (HYPRE_StructVector, vector), - hypre_F90_PassIntArray (ilower), - hypre_F90_PassIntArray (iupper), - hypre_F90_PassComplexArray (values) ) ); + ( HYPRE_StructVectorGetBoxValues( + hypre_F90_PassObj (HYPRE_StructVector, vector), + hypre_F90_PassIntArray (ilower), + hypre_F90_PassIntArray (iupper), + hypre_F90_PassComplexArray (values) ) ); } /*-------------------------------------------------------------------------- * HYPRE_StructVectorAssemble *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_structvectorassemble, HYPRE_STRUCTVECTORASSEMBLE) - ( hypre_F90_Obj *vector, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *vector, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructVectorAssemble( - hypre_F90_PassObj (HYPRE_StructVector, vector) ) ); + ( HYPRE_StructVectorAssemble( + hypre_F90_PassObj (HYPRE_StructVector, vector) ) ); } /*-------------------------------------------------------------------------- * HYPRE_StructVectorSetNumGhost *--------------------------------------------------------------------------*/ - + void hypre_F90_IFACE(hypre_structvectorsetnumghost, HYPRE_STRUCTVECTORSETNUMGHOST) - ( hypre_F90_Obj *vector, - hypre_F90_IntArray *num_ghost, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *vector, + hypre_F90_IntArray *num_ghost, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructVectorSetNumGhost( - hypre_F90_PassObj (HYPRE_StructVector, vector), - hypre_F90_PassIntArray (num_ghost) ) ); + ( HYPRE_StructVectorSetNumGhost( + hypre_F90_PassObj (HYPRE_StructVector, vector), + hypre_F90_PassIntArray (num_ghost) ) ); } /*-------------------------------------------------------------------------- * HYPRE_StructVectorCopy *--------------------------------------------------------------------------*/ - + void hypre_F90_IFACE(hypre_structvectorcopy, HYPRE_STRUCTVECTORCOPY) - ( hypre_F90_Obj *x, - hypre_F90_Obj *y, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *x, + hypre_F90_Obj *y, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructVectorCopy( - hypre_F90_PassObj (HYPRE_StructVector, x), - hypre_F90_PassObj (HYPRE_StructVector, y) ) ); + ( HYPRE_StructVectorCopy( + hypre_F90_PassObj (HYPRE_StructVector, x), + hypre_F90_PassObj (HYPRE_StructVector, y) ) ); } /*-------------------------------------------------------------------------- @@ -246,14 +246,14 @@ hypre_F90_IFACE(hypre_structvectorcopy, HYPRE_STRUCTVECTORCOPY) void hypre_F90_IFACE(hypre_structvectorsetconstantva, HYPRE_STRUCTVECTORSETCONSTANTVA) - ( hypre_F90_Obj *vector, - hypre_F90_Complex *values, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *vector, + hypre_F90_Complex *values, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructVectorSetConstantValues( - hypre_F90_PassObj (HYPRE_StructVector, vector), - hypre_F90_PassComplex (values) ) ); + ( HYPRE_StructVectorSetConstantValues( + hypre_F90_PassObj (HYPRE_StructVector, vector), + hypre_F90_PassComplex (values) ) ); } /*-------------------------------------------------------------------------- @@ -262,34 +262,34 @@ hypre_F90_IFACE(hypre_structvectorsetconstantva, HYPRE_STRUCTVECTORSETCONSTANTVA void hypre_F90_IFACE(hypre_structvectorgetmigratecom, HYPRE_STRUCTVECTORGETMIGRATECOM) - ( hypre_F90_Obj *from_vector, - hypre_F90_Obj *to_vector, - hypre_F90_Obj *comm_pkg, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *from_vector, + hypre_F90_Obj *to_vector, + hypre_F90_Obj *comm_pkg, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructVectorGetMigrateCommPkg( - hypre_F90_PassObj (HYPRE_StructVector, from_vector), - hypre_F90_PassObj (HYPRE_StructVector, to_vector), - hypre_F90_PassObjRef (HYPRE_CommPkg, comm_pkg) ) ); + ( HYPRE_StructVectorGetMigrateCommPkg( + hypre_F90_PassObj (HYPRE_StructVector, from_vector), + hypre_F90_PassObj (HYPRE_StructVector, to_vector), + hypre_F90_PassObjRef (HYPRE_CommPkg, comm_pkg) ) ); } /*-------------------------------------------------------------------------- * HYPRE_StructVectorMigrate *--------------------------------------------------------------------------*/ -void +void hypre_F90_IFACE(hypre_structvectormigrate, HYPRE_STRUCTVECTORMIGRATE) - ( hypre_F90_Obj *comm_pkg, - hypre_F90_Obj *from_vector, - hypre_F90_Obj *to_vector, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *comm_pkg, + hypre_F90_Obj *from_vector, + hypre_F90_Obj *to_vector, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructVectorMigrate( - hypre_F90_PassObj (HYPRE_CommPkg, comm_pkg), - hypre_F90_PassObj (HYPRE_StructVector, from_vector), - hypre_F90_PassObj (HYPRE_StructVector, to_vector) ) ); + ( HYPRE_StructVectorMigrate( + hypre_F90_PassObj (HYPRE_CommPkg, comm_pkg), + hypre_F90_PassObj (HYPRE_StructVector, from_vector), + hypre_F90_PassObj (HYPRE_StructVector, to_vector) ) ); } /*-------------------------------------------------------------------------- @@ -298,12 +298,12 @@ hypre_F90_IFACE(hypre_structvectormigrate, HYPRE_STRUCTVECTORMIGRATE) void hypre_F90_IFACE(hypre_destroycommpkg, HYPRE_DESTROYCOMMPKG) - ( hypre_F90_Obj *comm_pkg, - hypre_F90_Int *ierr ) +( hypre_F90_Obj *comm_pkg, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_CommPkgDestroy( - hypre_F90_PassObj (HYPRE_CommPkg, comm_pkg) ) ); + ( HYPRE_CommPkgDestroy( + hypre_F90_PassObj (HYPRE_CommPkg, comm_pkg) ) ); } /*-------------------------------------------------------------------------- @@ -312,18 +312,18 @@ hypre_F90_IFACE(hypre_destroycommpkg, HYPRE_DESTROYCOMMPKG) void hypre_F90_IFACE(hypre_structvectorprint, HYPRE_STRUCTVECTORPRINT) - ( - hypre_F90_Obj *vector, - hypre_F90_Int *all, - hypre_F90_Int *ierr ) +( + hypre_F90_Obj *vector, + hypre_F90_Int *all, + hypre_F90_Int *ierr ) { *ierr = (hypre_F90_Int) - ( HYPRE_StructVectorPrint( - "HYPRE_StructVector.out", - hypre_F90_PassObj (HYPRE_StructVector, vector), - hypre_F90_PassInt (all)) ); + ( HYPRE_StructVectorPrint( + "HYPRE_StructVector.out", + hypre_F90_PassObj (HYPRE_StructVector, vector), + hypre_F90_PassInt (all)) ); } - + #ifdef __cplusplus } #endif diff --git a/external/hypre/src/struct_mv/HYPRE_struct_grid.c b/external/hypre/src/struct_mv/HYPRE_struct_grid.c index 215e18c0..27387260 100644 --- a/external/hypre/src/struct_mv/HYPRE_struct_grid.c +++ b/external/hypre/src/struct_mv/HYPRE_struct_grid.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/struct_mv/HYPRE_struct_matrix.c b/external/hypre/src/struct_mv/HYPRE_struct_matrix.c index 3ed09716..4538f87e 100644 --- a/external/hypre/src/struct_mv/HYPRE_struct_matrix.c +++ b/external/hypre/src/struct_mv/HYPRE_struct_matrix.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -33,7 +33,7 @@ HYPRE_StructMatrixCreate( MPI_Comm comm, HYPRE_Int HYPRE_StructMatrixDestroy( HYPRE_StructMatrix matrix ) { - return( hypre_StructMatrixDestroy(matrix) ); + return ( hypre_StructMatrixDestroy(matrix) ); } /*-------------------------------------------------------------------------- @@ -217,7 +217,7 @@ HYPRE_StructMatrixSetConstantValues( HYPRE_StructMatrix matrix, HYPRE_Complex *values ) { return hypre_StructMatrixSetConstantValues( - matrix, num_stencil_indices, stencil_indices, values, 0 ); + matrix, num_stencil_indices, stencil_indices, values, 0 ); } /*-------------------------------------------------------------------------- @@ -311,7 +311,7 @@ HYPRE_StructMatrixAddToConstantValues( HYPRE_StructMatrix matrix, HYPRE_Complex *values ) { return hypre_StructMatrixSetConstantValues( - matrix, num_stencil_indices, stencil_indices, values, 1 ); + matrix, num_stencil_indices, stencil_indices, values, 1 ); } /*-------------------------------------------------------------------------- @@ -320,7 +320,7 @@ HYPRE_StructMatrixAddToConstantValues( HYPRE_StructMatrix matrix, HYPRE_Int HYPRE_StructMatrixAssemble( HYPRE_StructMatrix matrix ) { - return( hypre_StructMatrixAssemble(matrix) ); + return ( hypre_StructMatrixAssemble(matrix) ); } /*-------------------------------------------------------------------------- @@ -372,8 +372,8 @@ HYPRE_StructMatrixSetSymmetric( HYPRE_StructMatrix matrix, *--------------------------------------------------------------------------*/ HYPRE_Int HYPRE_StructMatrixSetConstantEntries( HYPRE_StructMatrix matrix, - HYPRE_Int nentries, - HYPRE_Int *entries ) + HYPRE_Int nentries, + HYPRE_Int *entries ) { return hypre_StructMatrixSetConstantEntries( matrix, nentries, entries ); } @@ -389,6 +389,26 @@ HYPRE_StructMatrixPrint( const char *filename, return ( hypre_StructMatrixPrint(filename, matrix, all) ); } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixRead( MPI_Comm comm, + const char *filename, + HYPRE_Int *num_ghost, + HYPRE_StructMatrix *matrix ) +{ + if (!matrix) + { + hypre_error_in_arg(4); + return hypre_error_flag; + } + + *matrix = (HYPRE_StructMatrix) hypre_StructMatrixRead(comm, filename, num_ghost); + + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ @@ -410,5 +430,5 @@ HYPRE_StructMatrixMatvec( HYPRE_Complex alpha, HYPRE_Int HYPRE_StructMatrixClearBoundary( HYPRE_StructMatrix matrix ) { - return( hypre_StructMatrixClearBoundary(matrix) ); + return ( hypre_StructMatrixClearBoundary(matrix) ); } diff --git a/external/hypre/src/struct_mv/HYPRE_struct_mv.h b/external/hypre/src/struct_mv/HYPRE_struct_mv.h index 84bd9932..5298abc9 100644 --- a/external/hypre/src/struct_mv/HYPRE_struct_mv.h +++ b/external/hypre/src/struct_mv/HYPRE_struct_mv.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -27,10 +27,8 @@ typedef struct hypre_StructVector_struct *HYPRE_StructVector; /** * @defgroup StructSystemInterface Struct System Interface * - * This interface represents a structured-grid conceptual view of a linear - * system. - * - * @memo A structured-grid conceptual interface + * A structured-grid conceptual interface. This interface represents a + * structured-grid conceptual view of a linear system. * * @{ **/ @@ -55,8 +53,8 @@ typedef struct hypre_StructGrid_struct *HYPRE_StructGrid; * Create an ndim-dimensional grid object. **/ HYPRE_Int HYPRE_StructGridCreate(MPI_Comm comm, - HYPRE_Int ndim, - HYPRE_StructGrid *grid); + HYPRE_Int ndim, + HYPRE_StructGrid *grid); /** * Destroy a grid object. An object should be explicitly destroyed using this @@ -346,7 +344,7 @@ HYPRE_Int HYPRE_StructMatrixSetConstantEntries( HYPRE_StructMatrix matrix, HYPRE_Int *entries ); /** - * Set the ghost layer in the matrix + * Set the ghost layer in the matrix **/ HYPRE_Int HYPRE_StructMatrixSetNumGhost(HYPRE_StructMatrix matrix, HYPRE_Int *num_ghost); @@ -359,6 +357,14 @@ HYPRE_Int HYPRE_StructMatrixPrint(const char *filename, HYPRE_StructMatrix matrix, HYPRE_Int all); +/** + * Read the matrix from file. This is mainly for debugging purposes. + **/ +HYPRE_Int HYPRE_StructMatrixRead( MPI_Comm comm, + const char *filename, + HYPRE_Int *num_ghost, + HYPRE_StructMatrix *matrix ); + /** * Matvec operator. This operation is \f$y = \alpha A x + \beta y\f$ . * Note that you can do a simple matrix-vector multiply by setting @@ -520,6 +526,14 @@ HYPRE_Int HYPRE_StructVectorPrint(const char *filename, HYPRE_StructVector vector, HYPRE_Int all); +/** + * Read the vector from file. This is mainly for debugging purposes. + **/ +HYPRE_Int HYPRE_StructVectorRead( MPI_Comm comm, + const char *filename, + HYPRE_Int *num_ghost, + HYPRE_StructVector *vector ); + /**@}*/ /**@}*/ @@ -562,4 +576,3 @@ HYPRE_StructGridSetDataLocation( HYPRE_StructGrid grid, HYPRE_MemoryLocation dat #endif #endif - diff --git a/external/hypre/src/struct_mv/HYPRE_struct_stencil.c b/external/hypre/src/struct_mv/HYPRE_struct_stencil.c index aeaa2430..b5608211 100644 --- a/external/hypre/src/struct_mv/HYPRE_struct_stencil.c +++ b/external/hypre/src/struct_mv/HYPRE_struct_stencil.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -23,9 +23,9 @@ HYPRE_StructStencilCreate( HYPRE_Int dim, HYPRE_StructStencil *stencil ) { hypre_Index *shape; - + shape = hypre_CTAlloc(hypre_Index, size, HYPRE_MEMORY_HOST); - + *stencil = hypre_StructStencilCreate(dim, size, shape); return hypre_error_flag; @@ -42,7 +42,7 @@ HYPRE_StructStencilSetElement( HYPRE_StructStencil stencil, { hypre_Index *shape; HYPRE_Int d; - + shape = hypre_StructStencilShape(stencil); hypre_SetIndex(shape[element_index], 0); for (d = 0; d < hypre_StructStencilNDim(stencil); d++) diff --git a/external/hypre/src/struct_mv/HYPRE_struct_vector.c b/external/hypre/src/struct_mv/HYPRE_struct_vector.c index b8957378..66d567f8 100644 --- a/external/hypre/src/struct_mv/HYPRE_struct_vector.c +++ b/external/hypre/src/struct_mv/HYPRE_struct_vector.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -34,7 +34,7 @@ HYPRE_StructVectorCreate( MPI_Comm comm, HYPRE_Int HYPRE_StructVectorDestroy( HYPRE_StructVector struct_vector ) { - return( hypre_StructVectorDestroy(struct_vector) ); + return ( hypre_StructVectorDestroy(struct_vector) ); } /*-------------------------------------------------------------------------- @@ -284,7 +284,7 @@ HYPRE_StructVectorGetBoxValues2( HYPRE_StructVector vector, HYPRE_Int HYPRE_StructVectorAssemble( HYPRE_StructVector vector ) { - return( hypre_StructVectorAssemble(vector) ); + return ( hypre_StructVectorAssemble(vector) ); } /*-------------------------------------------------------------------------- @@ -299,6 +299,26 @@ HYPRE_StructVectorPrint( const char *filename, return ( hypre_StructVectorPrint(filename, vector, all) ); } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorRead( MPI_Comm comm, + const char *filename, + HYPRE_Int *num_ghost, + HYPRE_StructVector *vector ) +{ + if (!vector) + { + hypre_error_in_arg(4); + return hypre_error_flag; + } + + *vector = (HYPRE_StructVector) hypre_StructVectorRead(comm, filename, num_ghost); + + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- * HYPRE_StructVectorSetNumGhost *--------------------------------------------------------------------------*/ @@ -320,7 +340,7 @@ HYPRE_StructVectorSetNumGhost( HYPRE_StructVector vector, HYPRE_Int HYPRE_StructVectorCopy( HYPRE_StructVector x, HYPRE_StructVector y ) { - return( hypre_StructVectorCopy( x, y ) ); + return ( hypre_StructVectorCopy( x, y ) ); } /*-------------------------------------------------------------------------- @@ -331,7 +351,7 @@ HYPRE_Int HYPRE_StructVectorSetConstantValues( HYPRE_StructVector vector, HYPRE_Complex values ) { - return( hypre_StructVectorSetConstantValues(vector, values) ); + return ( hypre_StructVectorSetConstantValues(vector, values) ); } /*-------------------------------------------------------------------------- @@ -357,7 +377,7 @@ HYPRE_StructVectorMigrate( HYPRE_CommPkg comm_pkg, HYPRE_StructVector from_vector, HYPRE_StructVector to_vector ) { - return( hypre_StructVectorMigrate( comm_pkg, from_vector, to_vector) ); + return ( hypre_StructVectorMigrate( comm_pkg, from_vector, to_vector) ); } /*-------------------------------------------------------------------------- diff --git a/external/hypre/src/struct_mv/_hypre_struct_mv.h b/external/hypre/src/struct_mv/_hypre_struct_mv.h index f95c4a74..fdb019e1 100644 --- a/external/hypre/src/struct_mv/_hypre_struct_mv.h +++ b/external/hypre/src/struct_mv/_hypre_struct_mv.h @@ -16,7 +16,7 @@ extern "C" { #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -35,12 +35,6 @@ extern "C" { #define HYPRE_MAXDIM 3 #endif -#if defined(HYPRE_USING_RAJA) || defined(HYPRE_USING_KOKKOS) || defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_DEVICE_OPENMP) || defined(HYPRE_USING_HIP) -#define hypre_BoxLoopSetOneBlock() -#else -#define hypre_BoxLoopSetOneBlock zypre_BoxLoopSetOneBlock -#endif - /*-------------------------------------------------------------------------- * hypre_Index: * This is used to define indices in index space, or dimension @@ -144,7 +138,7 @@ hypre_max(0, (hypre_BoxIMaxD(box, d) - hypre_BoxIMinD(box, d) + 1)) #define hypre_CCBoxIndexRank(box, index) 0 #define hypre_CCBoxIndexRank_noargs() 0 #define hypre_CCBoxOffsetDistance(box, index) 0 - + /*----- Avoid using these Box macros -----*/ #define hypre_BoxSizeX(box) hypre_BoxSizeD(box, 0) @@ -184,92 +178,6 @@ for (i = 0; i < hypre_BoxArraySize(box_array); i++) #define hypre_ForBoxArrayI(i, box_array_array) \ for (i = 0; i < hypre_BoxArrayArraySize(box_array_array); i++) -/*-------------------------------------------------------------------------- - * BoxLoop macros: - *--------------------------------------------------------------------------*/ -#define hypre_SerialBoxLoop0Begin(ndim, loop_size)\ -{\ - zypre_BoxLoopDeclare();\ - zypre_BoxLoopInit(ndim, loop_size);\ - hypre_BoxLoopSetOneBlock();\ - for (hypre__block = 0; hypre__block < hypre__num_blocks; hypre__block++)\ - {\ - zypre_BoxLoopSet();\ - for (hypre__J = 0; hypre__J < hypre__JN; hypre__J++)\ - {\ - for (hypre__I = 0; hypre__I < hypre__IN; hypre__I++)\ - { - -#define hypre_SerialBoxLoop0End()\ - }\ - zypre_BoxLoopInc1();\ - zypre_BoxLoopInc2();\ - }\ - }\ -} - -#define hypre_SerialBoxLoop1Begin(ndim, loop_size,\ - dbox1, start1, stride1, i1)\ -{\ - HYPRE_Int i1;\ - zypre_BoxLoopDeclare();\ - zypre_BoxLoopDeclareK(1);\ - zypre_BoxLoopInit(ndim, loop_size);\ - zypre_BoxLoopInitK(1, dbox1, start1, stride1, i1);\ - zypre_BoxLoopSetOneBlock();\ - for (hypre__block = 0; hypre__block < hypre__num_blocks; hypre__block++)\ - {\ - zypre_BoxLoopSet();\ - zypre_BoxLoopSetK(1, i1);\ - for (hypre__J = 0; hypre__J < hypre__JN; hypre__J++)\ - {\ - for (hypre__I = 0; hypre__I < hypre__IN; hypre__I++)\ - { - -#define hypre_SerialBoxLoop1End(i1)\ - i1 += hypre__i0inc1;\ - }\ - zypre_BoxLoopInc1();\ - i1 += hypre__ikinc1[hypre__d];\ - zypre_BoxLoopInc2();\ - }\ - }\ -} - -#define hypre_SerialBoxLoop2Begin(ndim, loop_size,\ - dbox1, start1, stride1, i1,\ - dbox2, start2, stride2, i2)\ -{\ - HYPRE_Int i1,i2;\ - zypre_BoxLoopDeclare();\ - zypre_BoxLoopDeclareK(1);\ - zypre_BoxLoopDeclareK(2);\ - zypre_BoxLoopInit(ndim, loop_size);\ - zypre_BoxLoopInitK(1, dbox1, start1, stride1, i1);\ - zypre_BoxLoopInitK(2, dbox2, start2, stride2, i2);\ - zypre_BoxLoopSetOneBlock();\ - for (hypre__block = 0; hypre__block < hypre__num_blocks; hypre__block++)\ - {\ - zypre_BoxLoopSet();\ - zypre_BoxLoopSetK(1, i1);\ - zypre_BoxLoopSetK(2, i2);\ - for (hypre__J = 0; hypre__J < hypre__JN; hypre__J++)\ - {\ - for (hypre__I = 0; hypre__I < hypre__IN; hypre__I++)\ - { - -#define hypre_SerialBoxLoop2End(i1, i2)\ - i1 += hypre__i0inc1;\ - i2 += hypre__i0inc2;\ - }\ - zypre_BoxLoopInc1();\ - i1 += hypre__ikinc1[hypre__d];\ - i2 += hypre__ikinc2[hypre__d];\ - zypre_BoxLoopInc2();\ - }\ - }\ -} - #define ZYPRE_BOX_PRIVATE hypre__IN,hypre__JN,hypre__I,hypre__J,hypre__d,hypre__i #define HYPRE_BOX_PRIVATE ZYPRE_BOX_PRIVATE @@ -303,6 +211,11 @@ if (hypre__num_blocks > 0)\ {\ hypre__div = hypre__tot / hypre__num_blocks;\ hypre__mod = hypre__tot % hypre__num_blocks;\ +}\ +else\ +{\ + hypre__div = 0;\ + hypre__mod = 0;\ } #define zypre_BoxLoopInitK(k, dboxk, startk, stridek, ik) \ @@ -380,199 +293,6 @@ for (hypre__d = 1; hypre__d < hypre__ndim; hypre__d++)\ /* Use this to get the block iteration inside a BoxLoop */ #define zypre_BoxLoopBlock() hypre__block - - - -/* FIXME: Remove !!! */ -/*-----------------------------------*/ -#define zypre_BoxLoop0Begin(ndim, loop_size)\ -{\ - zypre_BoxLoopDeclare();\ - zypre_BoxLoopInit(ndim, loop_size); - -#define zypre_BoxLoop0For()\ - for (hypre__block = 0; hypre__block < hypre__num_blocks; hypre__block++)\ - {\ - zypre_BoxLoopSet();\ - for (hypre__J = 0; hypre__J < hypre__JN; hypre__J++)\ - {\ - for (hypre__I = 0; hypre__I < hypre__IN; hypre__I++)\ - { - -#define zypre_BoxLoop0End()\ - }\ - zypre_BoxLoopInc1();\ - zypre_BoxLoopInc2();\ - }\ - }\ -} - -/*-----------------------------------*/ - -#define zypre_BoxLoop1Begin(ndim, loop_size,\ - dbox1, start1, stride1, i1)\ -{\ - HYPRE_Int i1;\ - zypre_BoxLoopDeclare();\ - zypre_BoxLoopDeclareK(1);\ - zypre_BoxLoopInit(ndim, loop_size);\ - zypre_BoxLoopInitK(1, dbox1, start1, stride1, i1); - -#define zypre_BoxLoop1For(i1)\ - for (hypre__block = 0; hypre__block < hypre__num_blocks; hypre__block++)\ - {\ - HYPRE_Int i1;\ - zypre_BoxLoopSet();\ - zypre_BoxLoopSetK(1, i1);\ - for (hypre__J = 0; hypre__J < hypre__JN; hypre__J++)\ - {\ - for (hypre__I = 0; hypre__I < hypre__IN; hypre__I++)\ - { - -#define zypre_BoxLoop1End(i1)\ - i1 += hypre__i0inc1;\ - }\ - zypre_BoxLoopInc1();\ - i1 += hypre__ikinc1[hypre__d];\ - zypre_BoxLoopInc2();\ - }\ - }\ -} - -/*-----------------------------------*/ - -#define zypre_BoxLoop2Begin(ndim, loop_size,\ - dbox1, start1, stride1, i1,\ - dbox2, start2, stride2, i2)\ -{\ - HYPRE_Int i1,i2;\ - zypre_BoxLoopDeclare();\ - zypre_BoxLoopDeclareK(1);\ - zypre_BoxLoopDeclareK(2);\ - zypre_BoxLoopInit(ndim, loop_size);\ - zypre_BoxLoopInitK(1, dbox1, start1, stride1, i1);\ - zypre_BoxLoopInitK(2, dbox2, start2, stride2, i2); - -#define zypre_BoxLoop2For(i1, i2)\ - for (hypre__block = 0; hypre__block < hypre__num_blocks; hypre__block++)\ - {\ - HYPRE_Int i1,i2;\ - zypre_BoxLoopSet();\ - zypre_BoxLoopSetK(1, i1);\ - zypre_BoxLoopSetK(2, i2);\ - for (hypre__J = 0; hypre__J < hypre__JN; hypre__J++)\ - {\ - for (hypre__I = 0; hypre__I < hypre__IN; hypre__I++)\ - { - -#define zypre_BoxLoop2End(i1, i2)\ - i1 += hypre__i0inc1;\ - i2 += hypre__i0inc2;\ - }\ - zypre_BoxLoopInc1();\ - i1 += hypre__ikinc1[hypre__d];\ - i2 += hypre__ikinc2[hypre__d];\ - zypre_BoxLoopInc2();\ - }\ - }\ -} - -/*-----------------------------------*/ - -#define zypre_BoxLoop3Begin(ndim, loop_size,\ - dbox1, start1, stride1, i1,\ - dbox2, start2, stride2, i2,\ - dbox3, start3, stride3, i3)\ -{\ - HYPRE_Int i1,i2,i3;\ - zypre_BoxLoopDeclare();\ - zypre_BoxLoopDeclareK(1);\ - zypre_BoxLoopDeclareK(2);\ - zypre_BoxLoopDeclareK(3);\ - zypre_BoxLoopInit(ndim, loop_size);\ - zypre_BoxLoopInitK(1, dbox1, start1, stride1, i1);\ - zypre_BoxLoopInitK(2, dbox2, start2, stride2, i2);\ - zypre_BoxLoopInitK(3, dbox3, start3, stride3, i3); - -#define zypre_BoxLoop3For(i1, i2, i3)\ - for (hypre__block = 0; hypre__block < hypre__num_blocks; hypre__block++)\ - {\ - HYPRE_Int i1,i2,i3;\ - zypre_BoxLoopSet();\ - zypre_BoxLoopSetK(1, i1);\ - zypre_BoxLoopSetK(2, i2);\ - zypre_BoxLoopSetK(3, i3);\ - for (hypre__J = 0; hypre__J < hypre__JN; hypre__J++)\ - {\ - for (hypre__I = 0; hypre__I < hypre__IN; hypre__I++)\ - { - -#define zypre_BoxLoop3End(i1, i2, i3)\ - i1 += hypre__i0inc1;\ - i2 += hypre__i0inc2;\ - i3 += hypre__i0inc3;\ - }\ - zypre_BoxLoopInc1();\ - i1 += hypre__ikinc1[hypre__d];\ - i2 += hypre__ikinc2[hypre__d];\ - i3 += hypre__ikinc3[hypre__d];\ - zypre_BoxLoopInc2();\ - }\ - }\ -} - -/*-----------------------------------*/ - -#define zypre_BoxLoop4Begin(ndim, loop_size,\ - dbox1, start1, stride1, i1,\ - dbox2, start2, stride2, i2,\ - dbox3, start3, stride3, i3,\ - dbox4, start4, stride4, i4)\ -{\ - HYPRE_Int i1,i2,i3,i4;\ - zypre_BoxLoopDeclare();\ - zypre_BoxLoopDeclareK(1);\ - zypre_BoxLoopDeclareK(2);\ - zypre_BoxLoopDeclareK(3);\ - zypre_BoxLoopDeclareK(4);\ - zypre_BoxLoopInit(ndim, loop_size);\ - zypre_BoxLoopInitK(1, dbox1, start1, stride1, i1);\ - zypre_BoxLoopInitK(2, dbox2, start2, stride2, i2);\ - zypre_BoxLoopInitK(3, dbox3, start3, stride3, i3);\ - zypre_BoxLoopInitK(4, dbox4, start4, stride4, i4); - -#define zypre_BoxLoop4For(i1, i2, i3, i4)\ - for (hypre__block = 0; hypre__block < hypre__num_blocks; hypre__block++)\ - {\ - HYPRE_Int i1,i2,i3,i4;\ - zypre_BoxLoopSet();\ - zypre_BoxLoopSetK(1, i1);\ - zypre_BoxLoopSetK(2, i2);\ - zypre_BoxLoopSetK(3, i3);\ - zypre_BoxLoopSetK(4, i4);\ - for (hypre__J = 0; hypre__J < hypre__JN; hypre__J++)\ - {\ - for (hypre__I = 0; hypre__I < hypre__IN; hypre__I++)\ - { - -#define zypre_BoxLoop4End(i1, i2, i3, i4)\ - i1 += hypre__i0inc1;\ - i2 += hypre__i0inc2;\ - i3 += hypre__i0inc3;\ - i4 += hypre__i0inc4;\ - }\ - zypre_BoxLoopInc1();\ - i1 += hypre__ikinc1[hypre__d];\ - i2 += hypre__ikinc2[hypre__d];\ - i3 += hypre__ikinc3[hypre__d];\ - i4 += hypre__ikinc4[hypre__d];\ - zypre_BoxLoopInc2();\ - }\ - }\ -} - -/*-----------------------------------*/ - #define zypre_BasicBoxLoopInitK(k, stridek) \ hypre__sk##k[0] = stridek[0];\ hypre__ikinc##k[0] = 0;\ @@ -586,25 +306,6 @@ hypre__i0inc##k = hypre__sk##k[0];\ hypre__ikinc##k[hypre__ndim] = 0;\ hypre__ikstart##k = 0 -#define zypre_BasicBoxLoop2Begin(ndim, loop_size,\ - stride1, i1,\ - stride2, i2)\ -{\ - zypre_BoxLoopDeclare();\ - zypre_BoxLoopDeclareK(1);\ - zypre_BoxLoopDeclareK(2);\ - zypre_BoxLoopInit(ndim, loop_size);\ - zypre_BasicBoxLoopInitK(1, stride1);\ - zypre_BasicBoxLoopInitK(2, stride2); - -/*-----------------------------------*/ - -#endif - - - - - /*-------------------------------------------------------------------------- * NOTES - Keep these for reference here and elsewhere in the code *--------------------------------------------------------------------------*/ @@ -612,8 +313,8 @@ hypre__ikstart##k = 0 #if 0 #define hypre_BoxLoop2Begin(loop_size, - dbox1, start1, stride1, i1, - dbox2, start2, stride2, i2) +dbox1, start1, stride1, i1, + dbox2, start2, stride2, i2) { /* init hypre__i1start */ HYPRE_Int hypre__i1start = hypre_BoxIndexRank(dbox1, start1); @@ -628,28 +329,28 @@ hypre__ikstart##k = 0 #define hypre_BoxLoop2For(i, j, k, i1, i2) for (hypre__block = 0; hypre__block < hypre__num_blocks; hypre__block++) { - /* set i and hypre__n */ - hypre_BoxLoopSet(i, j, k); - /* set i1 */ - i1 = hypre__i1start + i*hypre__sx1 + j*hypre__sy1 + k*hypre__sz1; - i2 = hypre__i2start + i*hypre__sx2 + j*hypre__sy2 + k*hypre__sz2; - for (k = 0; k < hypre__nz; k++) - { - for (j = 0; j < hypre__ny; j++) + /* set i and hypre__n */ + hypre_BoxLoopSet(i, j, k); + /* set i1 */ + i1 = hypre__i1start + i * hypre__sx1 + j * hypre__sy1 + k * hypre__sz1; + i2 = hypre__i2start + i * hypre__sx2 + j * hypre__sy2 + k * hypre__sz2; + for (k = 0; k < hypre__nz; k++) { - for (i = 0; i < hypre__nx; i++) + for (j = 0; j < hypre__ny; j++) { + for (i = 0; i < hypre__nx; i++) + { #define hypre_BoxLoop2End(i1, i2) - i1 += hypre__sx1; - i2 += hypre__sx2; + i1 += hypre__sx1; + i2 += hypre__sx2; + } + i1 += hypre__sy1 - hypre__nx * hypre__sx1; + i2 += hypre__sy2 - hypre__nx * hypre__sx2; } - i1 += hypre__sy1 - hypre__nx*hypre__sx1; - i2 += hypre__sy2 - hypre__nx*hypre__sx2; + i1 += hypre__sz1 - hypre__ny * hypre__sy1; + i2 += hypre__sz2 - hypre__ny * hypre__sy2; } - i1 += hypre__sz1 - hypre__ny*hypre__sy1; - i2 += hypre__sz2 - hypre__ny*hypre__sy2; - } } } @@ -660,7 +361,7 @@ hypre__ikstart##k = 0 N = 1; for (d = 0; d < ndim; d++) { - N *= n[d]; +N *= n[d]; i[d] = 0; n[d] -= 2; /* this produces a simpler comparison below */ } @@ -668,9 +369,9 @@ i[ndim] = 0; n[ndim] = 0; for (I = 0; I < N; I++) { - /* loop body */ +/* loop body */ - for (d = 0; i[d] > n[d]; d++) +for (d = 0; i[d] > n[d]; d++) { i[d] = 0; } @@ -686,7 +387,7 @@ for (I = 0; I < N; I++) N = 1; for (d = 1; d < ndim; d++) { - N *= n[d]; +N *= n[d]; i[d] = 0; n[d] -= 2; /* this produces a simpler comparison below */ } @@ -694,7 +395,7 @@ i[ndim] = 0; n[ndim] = 0; for (J = 0; J < N; J++) { - for (I = 0; I < n[0]; I++) +for (I = 0; I < n[0]; I++) { /* loop body */ @@ -711,8 +412,9 @@ for (J = 0; J < N; J++) } #endif +#endif /* #ifndef hypre_BOX_HEADER */ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -727,13 +429,13 @@ for (J = 0; J < N; J++) #ifndef hypre_ASSUMED_PART_HEADER #define hypre_ASSUMED_PART_HEADER -typedef struct +typedef struct { - /* the entries will be the same for all procs */ + /* the entries will be the same for all procs */ HYPRE_Int ndim; /* number of dimensions */ hypre_BoxArray *regions; /* areas of the grid with boxes */ - HYPRE_Int num_regions; /* how many regions */ - HYPRE_Int *proc_partitions; /* proc ids assigned to each region + HYPRE_Int num_regions; /* how many regions */ + HYPRE_Int *proc_partitions; /* proc ids assigned to each region (this is size num_regions +1) */ hypre_Index *divisions; /* number of proc divisions in each direction for each region */ @@ -742,22 +444,22 @@ typedef struct hypre_BoxArray *my_partition_boxes; /* boxes in my portion */ HYPRE_Int *my_partition_proc_ids; HYPRE_Int *my_partition_boxnums; - HYPRE_Int my_partition_ids_size; + HYPRE_Int my_partition_ids_size; HYPRE_Int my_partition_ids_alloc; HYPRE_Int my_partition_num_distinct_procs; - + } hypre_StructAssumedPart; /*Accessor macros */ -#define hypre_StructAssumedPartNDim(apart) ((apart)->ndim) -#define hypre_StructAssumedPartRegions(apart) ((apart)->regions) -#define hypre_StructAssumedPartNumRegions(apart) ((apart)->num_regions) -#define hypre_StructAssumedPartDivisions(apart) ((apart)->divisions) -#define hypre_StructAssumedPartDivision(apart, i) ((apart)->divisions[i]) -#define hypre_StructAssumedPartProcPartitions(apart) ((apart)->proc_partitions) -#define hypre_StructAssumedPartProcPartition(apart, i) ((apart)->proc_partitions[i]) +#define hypre_StructAssumedPartNDim(apart) ((apart)->ndim) +#define hypre_StructAssumedPartRegions(apart) ((apart)->regions) +#define hypre_StructAssumedPartNumRegions(apart) ((apart)->num_regions) +#define hypre_StructAssumedPartDivisions(apart) ((apart)->divisions) +#define hypre_StructAssumedPartDivision(apart, i) ((apart)->divisions[i]) +#define hypre_StructAssumedPartProcPartitions(apart) ((apart)->proc_partitions) +#define hypre_StructAssumedPartProcPartition(apart, i) ((apart)->proc_partitions[i]) #define hypre_StructAssumedPartMyPartition(apart) ((apart)->my_partition) #define hypre_StructAssumedPartMyPartitionBoxes(apart) ((apart)->my_partition_boxes) #define hypre_StructAssumedPartMyPartitionProcIds(apart) ((apart)->my_partition_proc_ids) @@ -770,7 +472,7 @@ typedef struct #define hypre_StructAssumedPartMyPartitionBoxnum(apart, i) ((apart)->my_partition_boxnums[i]) #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -791,14 +493,14 @@ typedef struct hypre_BoxManEntry_struct HYPRE_Int proc; /* This is a two-part unique id: (proc, id) */ HYPRE_Int id; - HYPRE_Int num_ghost[2*HYPRE_MAXDIM]; + HYPRE_Int num_ghost[2 * HYPRE_MAXDIM]; HYPRE_Int position; /* This indicates the location of the entry in the the * box manager entries array and is used for pairing with * the info object (populated in addentry) */ - + void *boxman; /* The owning manager (populated in addentry) */ - + struct hypre_BoxManEntry_struct *next; } hypre_BoxManEntry; @@ -812,32 +514,32 @@ typedef struct MPI_Comm comm; HYPRE_Int max_nentries; /* storage allocated for entries */ - + HYPRE_Int is_gather_called; /* Boolean to indicate whether GatherEntries function has been called (prior to assemble) - may not want this (can tell by the size of gather_regions array) */ - + hypre_BoxArray *gather_regions; /* This is where we collect boxes input by calls to BoxManGatherEntries - to be gathered in the assemble. These are then deleted after the assemble */ - + HYPRE_Int all_global_known; /* Boolean to say that every processor already has all of the global data for this manager (this could be accessed by a coarsening routine, for example) */ - + HYPRE_Int is_entries_sort; /* Boolean to say that entries were added in sorted order (id, proc) (this could be accessed by a coarsening routine, for example) */ HYPRE_Int entry_info_size; /* In bytes, the (max) size of the info - object for the entries */ + object for the entries */ HYPRE_Int is_assembled; /* Flag to indicate if the box manager has been assembled (used to control whether @@ -851,7 +553,7 @@ typedef struct HYPRE_Int *procs_sort; /* The sorted procs corresponding to entries */ HYPRE_Int *ids_sort; /* Sorted ids corresponding to the entries */ - + HYPRE_Int num_procs_sort; /* Number of distinct procs in entries */ HYPRE_Int *procs_sort_offsets; /* Offsets for procs into the entry_sort array */ @@ -867,19 +569,19 @@ typedef struct imax of each box in the entries array */ HYPRE_Int size[HYPRE_MAXDIM]; /* How many indexes in each - direction */ + direction */ HYPRE_Int last_index[HYPRE_MAXDIM]; /* Last index used in the indexes map */ HYPRE_Int num_my_entries; /* Num entries with proc_id = myid */ - HYPRE_Int *my_ids; /* Array of ids corresponding to my entries */ + HYPRE_Int *my_ids; /* Array of ids corresponding to my entries */ hypre_BoxManEntry **my_entries; /* Points into entries that are mine and corresponds to my_ids array. This is destroyed in the assemble. */ - + void *info_objects; /* Array of info objects (each of size - entry_info_size), managed byte-wise */ + entry_info_size), managed byte-wise */ hypre_StructAssumedPart *assumed_partition; /* The assumed partition object. For now this is only used @@ -890,10 +592,10 @@ typedef struct hypre_Box *bounding_box; /* Bounding box from associated grid */ HYPRE_Int next_id; /* Counter to indicate the next id that would be - unique (regardless of proc id) */ + unique (regardless of proc id) */ /* Ghost stuff */ - HYPRE_Int num_ghost[2*HYPRE_MAXDIM]; + HYPRE_Int num_ghost[2 * HYPRE_MAXDIM]; } hypre_BoxManager; @@ -913,7 +615,7 @@ typedef struct #define hypre_BoxManNEntries(manager) ((manager) -> nentries) #define hypre_BoxManEntries(manager) ((manager) -> entries) #define hypre_BoxManInfoObjects(manager) ((manager) -> info_objects) -#define hypre_BoxManIsAssembled(manager) ((manager) -> is_assembled) +#define hypre_BoxManIsAssembled(manager) ((manager) -> is_assembled) #define hypre_BoxManProcsSort(manager) ((manager) -> procs_sort) #define hypre_BoxManIdsSort(manager) ((manager) -> ids_sort) @@ -962,7 +664,7 @@ typedef struct #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -1006,12 +708,9 @@ typedef struct hypre_StructGrid_struct HYPRE_Int ghlocal_size; /* Number of vars in box including ghosts */ - HYPRE_Int num_ghost[2*HYPRE_MAXDIM]; /* ghost layer size */ + HYPRE_Int num_ghost[2 * HYPRE_MAXDIM]; /* ghost layer size */ hypre_BoxManager *boxman; -#if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - HYPRE_MemoryLocation data_location; -#endif } hypre_StructGrid; /*-------------------------------------------------------------------------- @@ -1057,7 +756,7 @@ typedef struct hypre_StructGrid_struct #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -1080,7 +779,7 @@ typedef struct hypre_StructStencil_struct { hypre_Index *shape; /* Description of a stencil's shape */ HYPRE_Int size; /* Number of stencil coefficients */ - + HYPRE_Int ndim; /* Number of dimensions */ HYPRE_Int ref_count; @@ -1098,7 +797,7 @@ typedef struct hypre_StructStencil_struct #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -1149,7 +848,7 @@ typedef struct hypre_CommEntryType_struct HYPRE_Int offset; /* offset for the data */ HYPRE_Int dim; /* dimension of the communication */ HYPRE_Int length_array[HYPRE_MAXDIM]; /* last dim has length num_values */ - HYPRE_Int stride_array[HYPRE_MAXDIM+1]; + HYPRE_Int stride_array[HYPRE_MAXDIM + 1]; HYPRE_Int *order; /* order of last dim values */ } hypre_CommEntryType; @@ -1178,43 +877,50 @@ typedef struct hypre_CommType_struct typedef struct hypre_CommPkg_struct { - MPI_Comm comm; + MPI_Comm comm; - HYPRE_Int first_comm; /* is this the first communication? */ + /* is this the first communication? */ + HYPRE_Int first_comm; - HYPRE_Int ndim; - HYPRE_Int num_values; - hypre_Index send_stride; - hypre_Index recv_stride; + HYPRE_Int ndim; + HYPRE_Int num_values; + hypre_Index send_stride; + hypre_Index recv_stride; - HYPRE_Int send_bufsize; /* total send buffer size (in doubles) */ - HYPRE_Int recv_bufsize; /* total recv buffer size (in doubles) */ - HYPRE_Int send_bufsize_first_comm; /* total send buffer size (in doubles) at the first comm. */ - HYPRE_Int recv_bufsize_first_comm; /* total recv buffer size (in doubles) at the first comm. */ + /* total send buffer size (in doubles) */ + HYPRE_Int send_bufsize; + /* total recv buffer size (in doubles) */ + HYPRE_Int recv_bufsize; + /* total send buffer size (in doubles) at the first comm. */ + HYPRE_Int send_bufsize_first_comm; + /* total recv buffer size (in doubles) at the first comm. */ + HYPRE_Int recv_bufsize_first_comm; - HYPRE_Int num_sends; - HYPRE_Int num_recvs; - hypre_CommType *send_types; - hypre_CommType *recv_types; + HYPRE_Int num_sends; + HYPRE_Int num_recvs; + hypre_CommType *send_types; + hypre_CommType *recv_types; - hypre_CommType *copy_from_type; - hypre_CommType *copy_to_type; + hypre_CommType *copy_from_type; + hypre_CommType *copy_to_type; /* these pointers are just to help free up memory for send/from types */ hypre_CommEntryType *entries; HYPRE_Int *rem_boxnums; hypre_Box *rem_boxes; - HYPRE_Int num_orders; - HYPRE_Int **orders; /* num_orders x num_values */ - - HYPRE_Int *recv_data_offsets; /* offsets into recv data (by box) */ - hypre_BoxArray *recv_data_space; /* recv data dimensions (by box) */ + HYPRE_Int num_orders; + /* num_orders x num_values */ + HYPRE_Int **orders; - hypre_Index identity_coord; - hypre_Index identity_dir; - HYPRE_Int *identity_order; + /* offsets into recv data (by box) */ + HYPRE_Int *recv_data_offsets; + /* recv data dimensions (by box) */ + hypre_BoxArray *recv_data_space; + hypre_Index identity_coord; + hypre_Index identity_dir; + HYPRE_Int *identity_order; } hypre_CommPkg; /*-------------------------------------------------------------------------- @@ -1234,9 +940,8 @@ typedef struct hypre_CommHandle_struct HYPRE_Complex **send_buffers; HYPRE_Complex **recv_buffers; - /* these are copies of send/recv buffers on device */ - HYPRE_Complex **send_buffers_device; - HYPRE_Complex **recv_buffers_device; + HYPRE_Complex **send_buffers_mpi; + HYPRE_Complex **recv_buffers_mpi; /* set = 0, add = 1 */ HYPRE_Int action; @@ -1347,12 +1052,12 @@ typedef struct hypre_CommHandle_struct #define hypre_CommHandleSendBuffers(comm_handle) (comm_handle -> send_buffers) #define hypre_CommHandleRecvBuffers(comm_handle) (comm_handle -> recv_buffers) #define hypre_CommHandleAction(comm_handle) (comm_handle -> action) -#define hypre_CommHandleSendBuffersDevice(comm_handle) (comm_handle -> send_buffers_device) -#define hypre_CommHandleRecvBuffersDevice(comm_handle) (comm_handle -> recv_buffers_device) +#define hypre_CommHandleSendBuffersMPI(comm_handle) (comm_handle -> send_buffers_mpi) +#define hypre_CommHandleRecvBuffersMPI(comm_handle) (comm_handle -> recv_buffers_mpi) #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -1403,7 +1108,7 @@ typedef struct hypre_ComputePkg_struct /*-------------------------------------------------------------------------- * Accessor macros: hypre_ComputeInfo *--------------------------------------------------------------------------*/ - + #define hypre_ComputeInfoCommInfo(info) (info -> comm_info) #define hypre_ComputeInfoIndtBoxes(info) (info -> indt_boxes) #define hypre_ComputeInfoDeptBoxes(info) (info -> dept_boxes) @@ -1412,7 +1117,7 @@ typedef struct hypre_ComputePkg_struct /*-------------------------------------------------------------------------- * Accessor macros: hypre_ComputePkg *--------------------------------------------------------------------------*/ - + #define hypre_ComputePkgCommPkg(compute_pkg) (compute_pkg -> comm_pkg) #define hypre_ComputePkgIndtBoxes(compute_pkg) (compute_pkg -> indt_boxes) @@ -1425,7 +1130,7 @@ typedef struct hypre_ComputePkg_struct #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -1455,6 +1160,7 @@ typedef struct hypre_StructMatrix_struct hypre_BoxArray *data_space; + HYPRE_MemoryLocation memory_location; /* memory location of data */ HYPRE_Complex *data; /* Pointer to variable matrix data */ HYPRE_Complex *data_const; /* Pointer to constant matrix data */ HYPRE_Complex **stencil_data; /* Pointer for each stencil */ @@ -1473,7 +1179,7 @@ typedef struct hypre_StructMatrix_struct HYPRE_Int symmetric; /* Is the matrix symmetric */ HYPRE_Int *symm_elements; /* Which elements are "symmetric" */ - HYPRE_Int num_ghost[2*HYPRE_MAXDIM]; /* Num ghost layers in each direction */ + HYPRE_Int num_ghost[2 * HYPRE_MAXDIM]; /* Num ghost layers in each direction */ HYPRE_BigInt global_size; /* Total number of nonzero coeffs */ @@ -1493,6 +1199,7 @@ typedef struct hypre_StructMatrix_struct #define hypre_StructMatrixStencil(matrix) ((matrix) -> stencil) #define hypre_StructMatrixNumValues(matrix) ((matrix) -> num_values) #define hypre_StructMatrixDataSpace(matrix) ((matrix) -> data_space) +#define hypre_StructMatrixMemoryLocation(matrix) ((matrix) -> memory_location) #define hypre_StructMatrixData(matrix) ((matrix) -> data) #define hypre_StructMatrixDataConst(matrix) ((matrix) -> data_const) #define hypre_StructMatrixStencilData(matrix) ((matrix) -> stencil_data) @@ -1527,7 +1234,7 @@ hypre_BoxArrayBox(hypre_StructMatrixDataSpace(matrix), b) #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -1554,19 +1261,20 @@ typedef struct hypre_StructVector_struct hypre_BoxArray *data_space; - HYPRE_Complex *data; /* Pointer to vector data on device*/ - HYPRE_Int data_alloced; /* Boolean used for freeing data */ - HYPRE_Int data_size; /* Size of vector data */ - HYPRE_Int *data_indices; /* num-boxes array of indices into - the data array. data_indices[b] - is the starting index of vector - data corresponding to box b. */ + HYPRE_MemoryLocation memory_location; /* memory location of data */ + HYPRE_Complex *data; /* Pointer to vector data on device*/ + HYPRE_Int data_alloced; /* Boolean used for freeing data */ + HYPRE_Int data_size; /* Size of vector data */ + HYPRE_Int *data_indices; /* num-boxes array of indices into + the data array. data_indices[b] + is the starting index of vector + data corresponding to box b. */ - HYPRE_Int num_ghost[2*HYPRE_MAXDIM]; /* Num ghost layers in each - * direction */ - HYPRE_Int bghost_not_clear; /* Are boundary ghosts clear? */ + HYPRE_Int num_ghost[2 * HYPRE_MAXDIM]; /* Num ghost layers in each + * direction */ + HYPRE_Int bghost_not_clear; /* Are boundary ghosts clear? */ - HYPRE_BigInt global_size; /* Total number coefficients */ + HYPRE_BigInt global_size; /* Total number coefficients */ HYPRE_Int ref_count; @@ -1576,17 +1284,18 @@ typedef struct hypre_StructVector_struct * Accessor macros: hypre_StructVector *--------------------------------------------------------------------------*/ -#define hypre_StructVectorComm(vector) ((vector) -> comm) -#define hypre_StructVectorGrid(vector) ((vector) -> grid) -#define hypre_StructVectorDataSpace(vector) ((vector) -> data_space) -#define hypre_StructVectorData(vector) ((vector) -> data) -#define hypre_StructVectorDataAlloced(vector) ((vector) -> data_alloced) -#define hypre_StructVectorDataSize(vector) ((vector) -> data_size) -#define hypre_StructVectorDataIndices(vector) ((vector) -> data_indices) -#define hypre_StructVectorNumGhost(vector) ((vector) -> num_ghost) -#define hypre_StructVectorBGhostNotClear(vector)((vector) -> bghost_not_clear) -#define hypre_StructVectorGlobalSize(vector) ((vector) -> global_size) -#define hypre_StructVectorRefCount(vector) ((vector) -> ref_count) +#define hypre_StructVectorComm(vector) ((vector) -> comm) +#define hypre_StructVectorGrid(vector) ((vector) -> grid) +#define hypre_StructVectorDataSpace(vector) ((vector) -> data_space) +#define hypre_StructVectorMemoryLocation(vector) ((vector) -> memory_location) +#define hypre_StructVectorData(vector) ((vector) -> data) +#define hypre_StructVectorDataAlloced(vector) ((vector) -> data_alloced) +#define hypre_StructVectorDataSize(vector) ((vector) -> data_size) +#define hypre_StructVectorDataIndices(vector) ((vector) -> data_indices) +#define hypre_StructVectorNumGhost(vector) ((vector) -> num_ghost) +#define hypre_StructVectorBGhostNotClear(vector) ((vector) -> bghost_not_clear) +#define hypre_StructVectorGlobalSize(vector) ((vector) -> global_size) +#define hypre_StructVectorRefCount(vector) ((vector) -> ref_count) #define hypre_StructVectorNDim(vector) \ hypre_StructGridNDim(hypre_StructVectorGrid(vector)) @@ -1603,314 +1312,461 @@ hypre_BoxArrayBox(hypre_StructVectorDataSpace(vector), b) #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ /* assumed_part.c */ -HYPRE_Int hypre_APSubdivideRegion ( hypre_Box *region , HYPRE_Int dim , HYPRE_Int level , hypre_BoxArray *box_array , HYPRE_Int *num_new_boxes ); -HYPRE_Int hypre_APFindMyBoxesInRegions ( hypre_BoxArray *region_array , hypre_BoxArray *my_box_array , HYPRE_Int **p_count_array , HYPRE_Real **p_vol_array ); -HYPRE_Int hypre_APGetAllBoxesInRegions ( hypre_BoxArray *region_array , hypre_BoxArray *my_box_array , HYPRE_Int **p_count_array , HYPRE_Real **p_vol_array , MPI_Comm comm ); -HYPRE_Int hypre_APShrinkRegions ( hypre_BoxArray *region_array , hypre_BoxArray *my_box_array , MPI_Comm comm ); -HYPRE_Int hypre_APPruneRegions ( hypre_BoxArray *region_array , HYPRE_Int **p_count_array , HYPRE_Real **p_vol_array ); -HYPRE_Int hypre_APRefineRegionsByVol ( hypre_BoxArray *region_array , HYPRE_Real *vol_array , HYPRE_Int max_regions , HYPRE_Real gamma , HYPRE_Int dim , HYPRE_Int *return_code , MPI_Comm comm ); -HYPRE_Int hypre_StructAssumedPartitionCreate ( HYPRE_Int dim , hypre_Box *bounding_box , HYPRE_Real global_boxes_size , HYPRE_Int global_num_boxes , hypre_BoxArray *local_boxes , HYPRE_Int *local_boxnums , HYPRE_Int max_regions , HYPRE_Int max_refinements , HYPRE_Real gamma , MPI_Comm comm , hypre_StructAssumedPart **p_assumed_partition ); +HYPRE_Int hypre_APSubdivideRegion ( hypre_Box *region, HYPRE_Int dim, HYPRE_Int level, + hypre_BoxArray *box_array, HYPRE_Int *num_new_boxes ); +HYPRE_Int hypre_APFindMyBoxesInRegions ( hypre_BoxArray *region_array, hypre_BoxArray *my_box_array, + HYPRE_Int **p_count_array, HYPRE_Real **p_vol_array ); +HYPRE_Int hypre_APGetAllBoxesInRegions ( hypre_BoxArray *region_array, hypre_BoxArray *my_box_array, + HYPRE_Int **p_count_array, HYPRE_Real **p_vol_array, MPI_Comm comm ); +HYPRE_Int hypre_APShrinkRegions ( hypre_BoxArray *region_array, hypre_BoxArray *my_box_array, + MPI_Comm comm ); +HYPRE_Int hypre_APPruneRegions ( hypre_BoxArray *region_array, HYPRE_Int **p_count_array, + HYPRE_Real **p_vol_array ); +HYPRE_Int hypre_APRefineRegionsByVol ( hypre_BoxArray *region_array, HYPRE_Real *vol_array, + HYPRE_Int max_regions, HYPRE_Real gamma, HYPRE_Int dim, HYPRE_Int *return_code, MPI_Comm comm ); +HYPRE_Int hypre_StructAssumedPartitionCreate ( HYPRE_Int dim, hypre_Box *bounding_box, + HYPRE_Real global_boxes_size, HYPRE_Int global_num_boxes, hypre_BoxArray *local_boxes, + HYPRE_Int *local_boxnums, HYPRE_Int max_regions, HYPRE_Int max_refinements, HYPRE_Real gamma, + MPI_Comm comm, hypre_StructAssumedPart **p_assumed_partition ); HYPRE_Int hypre_StructAssumedPartitionDestroy ( hypre_StructAssumedPart *assumed_part ); -HYPRE_Int hypre_APFillResponseStructAssumedPart ( void *p_recv_contact_buf , HYPRE_Int contact_size , HYPRE_Int contact_proc , void *ro , MPI_Comm comm , void **p_send_response_buf , HYPRE_Int *response_message_size ); -HYPRE_Int hypre_StructAssumedPartitionGetRegionsFromProc ( hypre_StructAssumedPart *assumed_part , HYPRE_Int proc_id , hypre_BoxArray *assumed_regions ); -HYPRE_Int hypre_StructAssumedPartitionGetProcsFromBox ( hypre_StructAssumedPart *assumed_part , hypre_Box *box , HYPRE_Int *num_proc_array , HYPRE_Int *size_alloc_proc_array , HYPRE_Int **p_proc_array ); +HYPRE_Int hypre_APFillResponseStructAssumedPart ( void *p_recv_contact_buf, HYPRE_Int contact_size, + HYPRE_Int contact_proc, void *ro, MPI_Comm comm, void **p_send_response_buf, + HYPRE_Int *response_message_size ); +HYPRE_Int hypre_StructAssumedPartitionGetRegionsFromProc ( hypre_StructAssumedPart *assumed_part, + HYPRE_Int proc_id, hypre_BoxArray *assumed_regions ); +HYPRE_Int hypre_StructAssumedPartitionGetProcsFromBox ( hypre_StructAssumedPart *assumed_part, + hypre_Box *box, HYPRE_Int *num_proc_array, HYPRE_Int *size_alloc_proc_array, + HYPRE_Int **p_proc_array ); /* box_algebra.c */ -HYPRE_Int hypre_IntersectBoxes ( hypre_Box *box1 , hypre_Box *box2 , hypre_Box *ibox ); -HYPRE_Int hypre_SubtractBoxes ( hypre_Box *box1 , hypre_Box *box2 , hypre_BoxArray *box_array ); -HYPRE_Int hypre_SubtractBoxArrays ( hypre_BoxArray *box_array1 , hypre_BoxArray *box_array2 , hypre_BoxArray *tmp_box_array ); +HYPRE_Int hypre_IntersectBoxes ( hypre_Box *box1, hypre_Box *box2, hypre_Box *ibox ); +HYPRE_Int hypre_SubtractBoxes ( hypre_Box *box1, hypre_Box *box2, hypre_BoxArray *box_array ); +HYPRE_Int hypre_SubtractBoxArrays ( hypre_BoxArray *box_array1, hypre_BoxArray *box_array2, + hypre_BoxArray *tmp_box_array ); HYPRE_Int hypre_UnionBoxes ( hypre_BoxArray *boxes ); HYPRE_Int hypre_MinUnionBoxes ( hypre_BoxArray *boxes ); /* box_boundary.c */ -HYPRE_Int hypre_BoxBoundaryIntersect ( hypre_Box *box , hypre_StructGrid *grid , HYPRE_Int d , HYPRE_Int dir , hypre_BoxArray *boundary ); -HYPRE_Int hypre_BoxBoundaryG ( hypre_Box *box , hypre_StructGrid *g , hypre_BoxArray *boundary ); -HYPRE_Int hypre_BoxBoundaryDG ( hypre_Box *box , hypre_StructGrid *g , hypre_BoxArray *boundarym , hypre_BoxArray *boundaryp , HYPRE_Int d ); -HYPRE_Int hypre_GeneralBoxBoundaryIntersect( hypre_Box *box, hypre_StructGrid *grid, hypre_Index stencil_element, hypre_BoxArray *boundary ); +HYPRE_Int hypre_BoxBoundaryIntersect ( hypre_Box *box, hypre_StructGrid *grid, HYPRE_Int d, + HYPRE_Int dir, hypre_BoxArray *boundary ); +HYPRE_Int hypre_BoxBoundaryG ( hypre_Box *box, hypre_StructGrid *g, hypre_BoxArray *boundary ); +HYPRE_Int hypre_BoxBoundaryDG ( hypre_Box *box, hypre_StructGrid *g, hypre_BoxArray *boundarym, + hypre_BoxArray *boundaryp, HYPRE_Int d ); +HYPRE_Int hypre_GeneralBoxBoundaryIntersect( hypre_Box *box, hypre_StructGrid *grid, + hypre_Index stencil_element, hypre_BoxArray *boundary ); /* box.c */ -HYPRE_Int hypre_SetIndex ( hypre_Index index , HYPRE_Int val ); -HYPRE_Int hypre_CopyIndex( hypre_Index in_index , hypre_Index out_index ); -HYPRE_Int hypre_CopyToCleanIndex( hypre_Index in_index , HYPRE_Int ndim , hypre_Index out_index ); -HYPRE_Int hypre_IndexEqual ( hypre_Index index , HYPRE_Int val , HYPRE_Int ndim ); -HYPRE_Int hypre_IndexMin( hypre_Index index , HYPRE_Int ndim ); -HYPRE_Int hypre_IndexMax( hypre_Index index , HYPRE_Int ndim ); -HYPRE_Int hypre_AddIndexes ( hypre_Index index1 , hypre_Index index2 , HYPRE_Int ndim , hypre_Index result ); -HYPRE_Int hypre_SubtractIndexes ( hypre_Index index1 , hypre_Index index2 , HYPRE_Int ndim , hypre_Index result ); -HYPRE_Int hypre_IndexesEqual ( hypre_Index index1 , hypre_Index index2 , HYPRE_Int ndim ); +HYPRE_Int hypre_SetIndex ( hypre_Index index, HYPRE_Int val ); +HYPRE_Int hypre_CopyIndex( hypre_Index in_index, hypre_Index out_index ); +HYPRE_Int hypre_CopyToCleanIndex( hypre_Index in_index, HYPRE_Int ndim, hypre_Index out_index ); +HYPRE_Int hypre_IndexEqual ( hypre_Index index, HYPRE_Int val, HYPRE_Int ndim ); +HYPRE_Int hypre_IndexMin( hypre_Index index, HYPRE_Int ndim ); +HYPRE_Int hypre_IndexMax( hypre_Index index, HYPRE_Int ndim ); +HYPRE_Int hypre_AddIndexes ( hypre_Index index1, hypre_Index index2, HYPRE_Int ndim, + hypre_Index result ); +HYPRE_Int hypre_SubtractIndexes ( hypre_Index index1, hypre_Index index2, HYPRE_Int ndim, + hypre_Index result ); +HYPRE_Int hypre_IndexesEqual ( hypre_Index index1, hypre_Index index2, HYPRE_Int ndim ); +HYPRE_Int hypre_IndexPrint ( FILE *file, HYPRE_Int ndim, hypre_Index index ); +HYPRE_Int hypre_IndexRead ( FILE *file, HYPRE_Int ndim, hypre_Index index ); hypre_Box *hypre_BoxCreate ( HYPRE_Int ndim ); HYPRE_Int hypre_BoxDestroy ( hypre_Box *box ); -HYPRE_Int hypre_BoxInit( hypre_Box *box , HYPRE_Int ndim ); -HYPRE_Int hypre_BoxSetExtents ( hypre_Box *box , hypre_Index imin , hypre_Index imax ); -HYPRE_Int hypre_CopyBox( hypre_Box *box1 , hypre_Box *box2 ); +HYPRE_Int hypre_BoxInit( hypre_Box *box, HYPRE_Int ndim ); +HYPRE_Int hypre_BoxSetExtents ( hypre_Box *box, hypre_Index imin, hypre_Index imax ); +HYPRE_Int hypre_CopyBox( hypre_Box *box1, hypre_Box *box2 ); hypre_Box *hypre_BoxDuplicate ( hypre_Box *box ); HYPRE_Int hypre_BoxVolume( hypre_Box *box ); HYPRE_Real hypre_doubleBoxVolume( hypre_Box *box ); -HYPRE_Int hypre_IndexInBox ( hypre_Index index , hypre_Box *box ); -HYPRE_Int hypre_BoxGetSize ( hypre_Box *box , hypre_Index size ); -HYPRE_Int hypre_BoxGetStrideSize ( hypre_Box *box , hypre_Index stride , hypre_Index size ); -HYPRE_Int hypre_BoxGetStrideVolume ( hypre_Box *box , hypre_Index stride , HYPRE_Int *volume_ptr ); -HYPRE_Int hypre_BoxIndexRank( hypre_Box *box , hypre_Index index ); -HYPRE_Int hypre_BoxRankIndex( hypre_Box *box , HYPRE_Int rank , hypre_Index index ); -HYPRE_Int hypre_BoxOffsetDistance( hypre_Box *box , hypre_Index index ); -HYPRE_Int hypre_BoxShiftPos( hypre_Box *box , hypre_Index shift ); -HYPRE_Int hypre_BoxShiftNeg( hypre_Box *box , hypre_Index shift ); -HYPRE_Int hypre_BoxGrowByIndex( hypre_Box *box , hypre_Index index ); -HYPRE_Int hypre_BoxGrowByValue( hypre_Box *box , HYPRE_Int val ); -HYPRE_Int hypre_BoxGrowByArray ( hypre_Box *box , HYPRE_Int *array ); -hypre_BoxArray *hypre_BoxArrayCreate ( HYPRE_Int size , HYPRE_Int ndim ); +HYPRE_Int hypre_IndexInBox ( hypre_Index index, hypre_Box *box ); +HYPRE_Int hypre_BoxGetSize ( hypre_Box *box, hypre_Index size ); +HYPRE_Int hypre_BoxGetStrideSize ( hypre_Box *box, hypre_Index stride, hypre_Index size ); +HYPRE_Int hypre_BoxGetStrideVolume ( hypre_Box *box, hypre_Index stride, HYPRE_Int *volume_ptr ); +HYPRE_Int hypre_BoxIndexRank( hypre_Box *box, hypre_Index index ); +HYPRE_Int hypre_BoxRankIndex( hypre_Box *box, HYPRE_Int rank, hypre_Index index ); +HYPRE_Int hypre_BoxOffsetDistance( hypre_Box *box, hypre_Index index ); +HYPRE_Int hypre_BoxShiftPos( hypre_Box *box, hypre_Index shift ); +HYPRE_Int hypre_BoxShiftNeg( hypre_Box *box, hypre_Index shift ); +HYPRE_Int hypre_BoxGrowByIndex( hypre_Box *box, hypre_Index index ); +HYPRE_Int hypre_BoxGrowByValue( hypre_Box *box, HYPRE_Int val ); +HYPRE_Int hypre_BoxGrowByArray ( hypre_Box *box, HYPRE_Int *array ); +HYPRE_Int hypre_BoxPrint ( FILE *file, hypre_Box *box ); +HYPRE_Int hypre_BoxRead ( FILE *file, HYPRE_Int ndim, hypre_Box **box_ptr ); +hypre_BoxArray *hypre_BoxArrayCreate ( HYPRE_Int size, HYPRE_Int ndim ); HYPRE_Int hypre_BoxArrayDestroy ( hypre_BoxArray *box_array ); -HYPRE_Int hypre_BoxArraySetSize ( hypre_BoxArray *box_array , HYPRE_Int size ); +HYPRE_Int hypre_BoxArraySetSize ( hypre_BoxArray *box_array, HYPRE_Int size ); hypre_BoxArray *hypre_BoxArrayDuplicate ( hypre_BoxArray *box_array ); -HYPRE_Int hypre_AppendBox ( hypre_Box *box , hypre_BoxArray *box_array ); -HYPRE_Int hypre_DeleteBox ( hypre_BoxArray *box_array , HYPRE_Int index ); -HYPRE_Int hypre_DeleteMultipleBoxes ( hypre_BoxArray *box_array , HYPRE_Int *indices , HYPRE_Int num ); -HYPRE_Int hypre_AppendBoxArray ( hypre_BoxArray *box_array_0 , hypre_BoxArray *box_array_1 ); -hypre_BoxArrayArray *hypre_BoxArrayArrayCreate ( HYPRE_Int size , HYPRE_Int ndim ); +HYPRE_Int hypre_AppendBox ( hypre_Box *box, hypre_BoxArray *box_array ); +HYPRE_Int hypre_DeleteBox ( hypre_BoxArray *box_array, HYPRE_Int index ); +HYPRE_Int hypre_DeleteMultipleBoxes ( hypre_BoxArray *box_array, HYPRE_Int *indices, + HYPRE_Int num ); +HYPRE_Int hypre_AppendBoxArray ( hypre_BoxArray *box_array_0, hypre_BoxArray *box_array_1 ); +hypre_BoxArrayArray *hypre_BoxArrayArrayCreate ( HYPRE_Int size, HYPRE_Int ndim ); HYPRE_Int hypre_BoxArrayArrayDestroy ( hypre_BoxArrayArray *box_array_array ); hypre_BoxArrayArray *hypre_BoxArrayArrayDuplicate ( hypre_BoxArrayArray *box_array_array ); /* box_manager.c */ -HYPRE_Int hypre_BoxManEntryGetInfo ( hypre_BoxManEntry *entry , void **info_ptr ); -HYPRE_Int hypre_BoxManEntryGetExtents ( hypre_BoxManEntry *entry , hypre_Index imin , hypre_Index imax ); -HYPRE_Int hypre_BoxManEntryCopy ( hypre_BoxManEntry *fromentry , hypre_BoxManEntry *toentry ); -HYPRE_Int hypre_BoxManSetAllGlobalKnown ( hypre_BoxManager *manager , HYPRE_Int known ); -HYPRE_Int hypre_BoxManGetAllGlobalKnown ( hypre_BoxManager *manager , HYPRE_Int *known ); -HYPRE_Int hypre_BoxManSetIsEntriesSort ( hypre_BoxManager *manager , HYPRE_Int is_sort ); -HYPRE_Int hypre_BoxManGetIsEntriesSort ( hypre_BoxManager *manager , HYPRE_Int *is_sort ); -HYPRE_Int hypre_BoxManGetGlobalIsGatherCalled ( hypre_BoxManager *manager , MPI_Comm comm , HYPRE_Int *is_gather ); -HYPRE_Int hypre_BoxManGetAssumedPartition ( hypre_BoxManager *manager , hypre_StructAssumedPart **assumed_partition ); -HYPRE_Int hypre_BoxManSetAssumedPartition ( hypre_BoxManager *manager , hypre_StructAssumedPart *assumed_partition ); -HYPRE_Int hypre_BoxManSetBoundingBox ( hypre_BoxManager *manager , hypre_Box *bounding_box ); -HYPRE_Int hypre_BoxManSetNumGhost ( hypre_BoxManager *manager , HYPRE_Int *num_ghost ); -HYPRE_Int hypre_BoxManDeleteMultipleEntriesAndInfo ( hypre_BoxManager *manager , HYPRE_Int *indices , HYPRE_Int num ); -HYPRE_Int hypre_BoxManCreate ( HYPRE_Int max_nentries , HYPRE_Int info_size , HYPRE_Int dim , hypre_Box *bounding_box , MPI_Comm comm , hypre_BoxManager **manager_ptr ); -HYPRE_Int hypre_BoxManIncSize ( hypre_BoxManager *manager , HYPRE_Int inc_size ); +HYPRE_Int hypre_BoxManEntryGetInfo ( hypre_BoxManEntry *entry, void **info_ptr ); +HYPRE_Int hypre_BoxManEntryGetExtents ( hypre_BoxManEntry *entry, hypre_Index imin, + hypre_Index imax ); +HYPRE_Int hypre_BoxManEntryCopy ( hypre_BoxManEntry *fromentry, hypre_BoxManEntry *toentry ); +HYPRE_Int hypre_BoxManSetAllGlobalKnown ( hypre_BoxManager *manager, HYPRE_Int known ); +HYPRE_Int hypre_BoxManGetAllGlobalKnown ( hypre_BoxManager *manager, HYPRE_Int *known ); +HYPRE_Int hypre_BoxManSetIsEntriesSort ( hypre_BoxManager *manager, HYPRE_Int is_sort ); +HYPRE_Int hypre_BoxManGetIsEntriesSort ( hypre_BoxManager *manager, HYPRE_Int *is_sort ); +HYPRE_Int hypre_BoxManGetGlobalIsGatherCalled ( hypre_BoxManager *manager, MPI_Comm comm, + HYPRE_Int *is_gather ); +HYPRE_Int hypre_BoxManGetAssumedPartition ( hypre_BoxManager *manager, + hypre_StructAssumedPart **assumed_partition ); +HYPRE_Int hypre_BoxManSetAssumedPartition ( hypre_BoxManager *manager, + hypre_StructAssumedPart *assumed_partition ); +HYPRE_Int hypre_BoxManSetBoundingBox ( hypre_BoxManager *manager, hypre_Box *bounding_box ); +HYPRE_Int hypre_BoxManSetNumGhost ( hypre_BoxManager *manager, HYPRE_Int *num_ghost ); +HYPRE_Int hypre_BoxManDeleteMultipleEntriesAndInfo ( hypre_BoxManager *manager, HYPRE_Int *indices, + HYPRE_Int num ); +HYPRE_Int hypre_BoxManCreate ( HYPRE_Int max_nentries, HYPRE_Int info_size, HYPRE_Int dim, + hypre_Box *bounding_box, MPI_Comm comm, hypre_BoxManager **manager_ptr ); +HYPRE_Int hypre_BoxManIncSize ( hypre_BoxManager *manager, HYPRE_Int inc_size ); HYPRE_Int hypre_BoxManDestroy ( hypre_BoxManager *manager ); -HYPRE_Int hypre_BoxManAddEntry ( hypre_BoxManager *manager , hypre_Index imin , hypre_Index imax , HYPRE_Int proc_id , HYPRE_Int box_id , void *info ); -HYPRE_Int hypre_BoxManGetEntry ( hypre_BoxManager *manager , HYPRE_Int proc , HYPRE_Int id , hypre_BoxManEntry **entry_ptr ); -HYPRE_Int hypre_BoxManGetAllEntries ( hypre_BoxManager *manager , HYPRE_Int *num_entries , hypre_BoxManEntry **entries ); -HYPRE_Int hypre_BoxManGetAllEntriesBoxes ( hypre_BoxManager *manager , hypre_BoxArray *boxes ); -HYPRE_Int hypre_BoxManGetLocalEntriesBoxes ( hypre_BoxManager *manager , hypre_BoxArray *boxes ); -HYPRE_Int hypre_BoxManGetAllEntriesBoxesProc ( hypre_BoxManager *manager , hypre_BoxArray *boxes , HYPRE_Int **procs_ptr ); -HYPRE_Int hypre_BoxManGatherEntries ( hypre_BoxManager *manager , hypre_Index imin , hypre_Index imax ); +HYPRE_Int hypre_BoxManAddEntry ( hypre_BoxManager *manager, hypre_Index imin, hypre_Index imax, + HYPRE_Int proc_id, HYPRE_Int box_id, void *info ); +HYPRE_Int hypre_BoxManGetEntry ( hypre_BoxManager *manager, HYPRE_Int proc, HYPRE_Int id, + hypre_BoxManEntry **entry_ptr ); +HYPRE_Int hypre_BoxManGetAllEntries ( hypre_BoxManager *manager, HYPRE_Int *num_entries, + hypre_BoxManEntry **entries ); +HYPRE_Int hypre_BoxManGetAllEntriesBoxes ( hypre_BoxManager *manager, hypre_BoxArray *boxes ); +HYPRE_Int hypre_BoxManGetLocalEntriesBoxes ( hypre_BoxManager *manager, hypre_BoxArray *boxes ); +HYPRE_Int hypre_BoxManGetAllEntriesBoxesProc ( hypre_BoxManager *manager, hypre_BoxArray *boxes, + HYPRE_Int **procs_ptr ); +HYPRE_Int hypre_BoxManGatherEntries ( hypre_BoxManager *manager, hypre_Index imin, + hypre_Index imax ); HYPRE_Int hypre_BoxManAssemble ( hypre_BoxManager *manager ); -HYPRE_Int hypre_BoxManIntersect ( hypre_BoxManager *manager , hypre_Index ilower , hypre_Index iupper , hypre_BoxManEntry ***entries_ptr , HYPRE_Int *nentries_ptr ); -HYPRE_Int hypre_FillResponseBoxManAssemble1 ( void *p_recv_contact_buf , HYPRE_Int contact_size , HYPRE_Int contact_proc , void *ro , MPI_Comm comm , void **p_send_response_buf , HYPRE_Int *response_message_size ); -HYPRE_Int hypre_FillResponseBoxManAssemble2 ( void *p_recv_contact_buf , HYPRE_Int contact_size , HYPRE_Int contact_proc , void *ro , MPI_Comm comm , void **p_send_response_buf , HYPRE_Int *response_message_size ); +HYPRE_Int hypre_BoxManIntersect ( hypre_BoxManager *manager, hypre_Index ilower, hypre_Index iupper, + hypre_BoxManEntry ***entries_ptr, HYPRE_Int *nentries_ptr ); +HYPRE_Int hypre_FillResponseBoxManAssemble1 ( void *p_recv_contact_buf, HYPRE_Int contact_size, + HYPRE_Int contact_proc, void *ro, MPI_Comm comm, void **p_send_response_buf, + HYPRE_Int *response_message_size ); +HYPRE_Int hypre_FillResponseBoxManAssemble2 ( void *p_recv_contact_buf, HYPRE_Int contact_size, + HYPRE_Int contact_proc, void *ro, MPI_Comm comm, void **p_send_response_buf, + HYPRE_Int *response_message_size ); /* communication_info.c */ -HYPRE_Int hypre_CommInfoCreate ( hypre_BoxArrayArray *send_boxes , hypre_BoxArrayArray *recv_boxes , HYPRE_Int **send_procs , HYPRE_Int **recv_procs , HYPRE_Int **send_rboxnums , HYPRE_Int **recv_rboxnums , hypre_BoxArrayArray *send_rboxes , hypre_BoxArrayArray *recv_rboxes , HYPRE_Int boxes_match , hypre_CommInfo **comm_info_ptr ); -HYPRE_Int hypre_CommInfoSetTransforms ( hypre_CommInfo *comm_info , HYPRE_Int num_transforms , hypre_Index *coords , hypre_Index *dirs , HYPRE_Int **send_transforms , HYPRE_Int **recv_transforms ); -HYPRE_Int hypre_CommInfoGetTransforms ( hypre_CommInfo *comm_info , HYPRE_Int *num_transforms , hypre_Index **coords , hypre_Index **dirs ); -HYPRE_Int hypre_CommInfoProjectSend ( hypre_CommInfo *comm_info , hypre_Index index , hypre_Index stride ); -HYPRE_Int hypre_CommInfoProjectRecv ( hypre_CommInfo *comm_info , hypre_Index index , hypre_Index stride ); +HYPRE_Int hypre_CommInfoCreate ( hypre_BoxArrayArray *send_boxes, hypre_BoxArrayArray *recv_boxes, + HYPRE_Int **send_procs, HYPRE_Int **recv_procs, HYPRE_Int **send_rboxnums, + HYPRE_Int **recv_rboxnums, hypre_BoxArrayArray *send_rboxes, hypre_BoxArrayArray *recv_rboxes, + HYPRE_Int boxes_match, hypre_CommInfo **comm_info_ptr ); +HYPRE_Int hypre_CommInfoSetTransforms ( hypre_CommInfo *comm_info, HYPRE_Int num_transforms, + hypre_Index *coords, hypre_Index *dirs, HYPRE_Int **send_transforms, HYPRE_Int **recv_transforms ); +HYPRE_Int hypre_CommInfoGetTransforms ( hypre_CommInfo *comm_info, HYPRE_Int *num_transforms, + hypre_Index **coords, hypre_Index **dirs ); +HYPRE_Int hypre_CommInfoProjectSend ( hypre_CommInfo *comm_info, hypre_Index index, + hypre_Index stride ); +HYPRE_Int hypre_CommInfoProjectRecv ( hypre_CommInfo *comm_info, hypre_Index index, + hypre_Index stride ); HYPRE_Int hypre_CommInfoDestroy ( hypre_CommInfo *comm_info ); -HYPRE_Int hypre_CreateCommInfoFromStencil ( hypre_StructGrid *grid , hypre_StructStencil *stencil , hypre_CommInfo **comm_info_ptr ); -HYPRE_Int hypre_CreateCommInfoFromNumGhost ( hypre_StructGrid *grid , HYPRE_Int *num_ghost , hypre_CommInfo **comm_info_ptr ); -HYPRE_Int hypre_CreateCommInfoFromGrids ( hypre_StructGrid *from_grid , hypre_StructGrid *to_grid , hypre_CommInfo **comm_info_ptr ); +HYPRE_Int hypre_CreateCommInfoFromStencil ( hypre_StructGrid *grid, hypre_StructStencil *stencil, + hypre_CommInfo **comm_info_ptr ); +HYPRE_Int hypre_CreateCommInfoFromNumGhost ( hypre_StructGrid *grid, HYPRE_Int *num_ghost, + hypre_CommInfo **comm_info_ptr ); +HYPRE_Int hypre_CreateCommInfoFromGrids ( hypre_StructGrid *from_grid, hypre_StructGrid *to_grid, + hypre_CommInfo **comm_info_ptr ); /* computation.c */ -HYPRE_Int hypre_ComputeInfoCreate ( hypre_CommInfo *comm_info , hypre_BoxArrayArray *indt_boxes , hypre_BoxArrayArray *dept_boxes , hypre_ComputeInfo **compute_info_ptr ); -HYPRE_Int hypre_ComputeInfoProjectSend ( hypre_ComputeInfo *compute_info , hypre_Index index , hypre_Index stride ); -HYPRE_Int hypre_ComputeInfoProjectRecv ( hypre_ComputeInfo *compute_info , hypre_Index index , hypre_Index stride ); -HYPRE_Int hypre_ComputeInfoProjectComp ( hypre_ComputeInfo *compute_info , hypre_Index index , hypre_Index stride ); +HYPRE_Int hypre_ComputeInfoCreate ( hypre_CommInfo *comm_info, hypre_BoxArrayArray *indt_boxes, + hypre_BoxArrayArray *dept_boxes, hypre_ComputeInfo **compute_info_ptr ); +HYPRE_Int hypre_ComputeInfoProjectSend ( hypre_ComputeInfo *compute_info, hypre_Index index, + hypre_Index stride ); +HYPRE_Int hypre_ComputeInfoProjectRecv ( hypre_ComputeInfo *compute_info, hypre_Index index, + hypre_Index stride ); +HYPRE_Int hypre_ComputeInfoProjectComp ( hypre_ComputeInfo *compute_info, hypre_Index index, + hypre_Index stride ); HYPRE_Int hypre_ComputeInfoDestroy ( hypre_ComputeInfo *compute_info ); -HYPRE_Int hypre_CreateComputeInfo ( hypre_StructGrid *grid , hypre_StructStencil *stencil , hypre_ComputeInfo **compute_info_ptr ); -HYPRE_Int hypre_ComputePkgCreate ( hypre_ComputeInfo *compute_info , hypre_BoxArray *data_space , HYPRE_Int num_values , hypre_StructGrid *grid , hypre_ComputePkg **compute_pkg_ptr ); +HYPRE_Int hypre_CreateComputeInfo ( hypre_StructGrid *grid, hypre_StructStencil *stencil, + hypre_ComputeInfo **compute_info_ptr ); +HYPRE_Int hypre_ComputePkgCreate ( hypre_ComputeInfo *compute_info, hypre_BoxArray *data_space, + HYPRE_Int num_values, hypre_StructGrid *grid, hypre_ComputePkg **compute_pkg_ptr ); HYPRE_Int hypre_ComputePkgDestroy ( hypre_ComputePkg *compute_pkg ); -HYPRE_Int hypre_InitializeIndtComputations ( hypre_ComputePkg *compute_pkg , HYPRE_Complex *data , hypre_CommHandle **comm_handle_ptr ); +HYPRE_Int hypre_InitializeIndtComputations ( hypre_ComputePkg *compute_pkg, HYPRE_Complex *data, + hypre_CommHandle **comm_handle_ptr ); HYPRE_Int hypre_FinalizeIndtComputations ( hypre_CommHandle *comm_handle ); /* HYPRE_struct_grid.c */ -HYPRE_Int HYPRE_StructGridCreate ( MPI_Comm comm , HYPRE_Int dim , HYPRE_StructGrid *grid ); +HYPRE_Int HYPRE_StructGridCreate ( MPI_Comm comm, HYPRE_Int dim, HYPRE_StructGrid *grid ); HYPRE_Int HYPRE_StructGridDestroy ( HYPRE_StructGrid grid ); -HYPRE_Int HYPRE_StructGridSetExtents ( HYPRE_StructGrid grid , HYPRE_Int *ilower , HYPRE_Int *iupper ); -HYPRE_Int HYPRE_StructGridSetPeriodic ( HYPRE_StructGrid grid , HYPRE_Int *periodic ); +HYPRE_Int HYPRE_StructGridSetExtents ( HYPRE_StructGrid grid, HYPRE_Int *ilower, + HYPRE_Int *iupper ); +HYPRE_Int HYPRE_StructGridSetPeriodic ( HYPRE_StructGrid grid, HYPRE_Int *periodic ); HYPRE_Int HYPRE_StructGridAssemble ( HYPRE_StructGrid grid ); -HYPRE_Int HYPRE_StructGridSetNumGhost ( HYPRE_StructGrid grid , HYPRE_Int *num_ghost ); +HYPRE_Int HYPRE_StructGridSetNumGhost ( HYPRE_StructGrid grid, HYPRE_Int *num_ghost ); /* HYPRE_struct_matrix.c */ -HYPRE_Int HYPRE_StructMatrixCreate ( MPI_Comm comm , HYPRE_StructGrid grid , HYPRE_StructStencil stencil , HYPRE_StructMatrix *matrix ); +HYPRE_Int HYPRE_StructMatrixCreate ( MPI_Comm comm, HYPRE_StructGrid grid, + HYPRE_StructStencil stencil, HYPRE_StructMatrix *matrix ); HYPRE_Int HYPRE_StructMatrixDestroy ( HYPRE_StructMatrix matrix ); HYPRE_Int HYPRE_StructMatrixInitialize ( HYPRE_StructMatrix matrix ); -HYPRE_Int HYPRE_StructMatrixSetValues ( HYPRE_StructMatrix matrix , HYPRE_Int *grid_index , HYPRE_Int num_stencil_indices , HYPRE_Int *stencil_indices , HYPRE_Complex *values ); -HYPRE_Int HYPRE_StructMatrixGetValues ( HYPRE_StructMatrix matrix , HYPRE_Int *grid_index , HYPRE_Int num_stencil_indices , HYPRE_Int *stencil_indices , HYPRE_Complex *values ); -HYPRE_Int HYPRE_StructMatrixSetBoxValues ( HYPRE_StructMatrix matrix , HYPRE_Int *ilower , HYPRE_Int *iupper , HYPRE_Int num_stencil_indices , HYPRE_Int *stencil_indices , HYPRE_Complex *values ); -HYPRE_Int HYPRE_StructMatrixGetBoxValues ( HYPRE_StructMatrix matrix , HYPRE_Int *ilower , HYPRE_Int *iupper , HYPRE_Int num_stencil_indices , HYPRE_Int *stencil_indices , HYPRE_Complex *values ); -HYPRE_Int HYPRE_StructMatrixSetConstantValues ( HYPRE_StructMatrix matrix , HYPRE_Int num_stencil_indices , HYPRE_Int *stencil_indices , HYPRE_Complex *values ); -HYPRE_Int HYPRE_StructMatrixAddToValues ( HYPRE_StructMatrix matrix , HYPRE_Int *grid_index , HYPRE_Int num_stencil_indices , HYPRE_Int *stencil_indices , HYPRE_Complex *values ); -HYPRE_Int HYPRE_StructMatrixAddToBoxValues ( HYPRE_StructMatrix matrix , HYPRE_Int *ilower , HYPRE_Int *iupper , HYPRE_Int num_stencil_indices , HYPRE_Int *stencil_indices , HYPRE_Complex *values ); -HYPRE_Int HYPRE_StructMatrixAddToConstantValues ( HYPRE_StructMatrix matrix , HYPRE_Int num_stencil_indices , HYPRE_Int *stencil_indices , HYPRE_Complex *values ); +HYPRE_Int HYPRE_StructMatrixSetValues ( HYPRE_StructMatrix matrix, HYPRE_Int *grid_index, + HYPRE_Int num_stencil_indices, HYPRE_Int *stencil_indices, HYPRE_Complex *values ); +HYPRE_Int HYPRE_StructMatrixGetValues ( HYPRE_StructMatrix matrix, HYPRE_Int *grid_index, + HYPRE_Int num_stencil_indices, HYPRE_Int *stencil_indices, HYPRE_Complex *values ); +HYPRE_Int HYPRE_StructMatrixSetBoxValues ( HYPRE_StructMatrix matrix, HYPRE_Int *ilower, + HYPRE_Int *iupper, HYPRE_Int num_stencil_indices, HYPRE_Int *stencil_indices, + HYPRE_Complex *values ); +HYPRE_Int HYPRE_StructMatrixGetBoxValues ( HYPRE_StructMatrix matrix, HYPRE_Int *ilower, + HYPRE_Int *iupper, HYPRE_Int num_stencil_indices, HYPRE_Int *stencil_indices, + HYPRE_Complex *values ); +HYPRE_Int HYPRE_StructMatrixSetConstantValues ( HYPRE_StructMatrix matrix, + HYPRE_Int num_stencil_indices, HYPRE_Int *stencil_indices, HYPRE_Complex *values ); +HYPRE_Int HYPRE_StructMatrixAddToValues ( HYPRE_StructMatrix matrix, HYPRE_Int *grid_index, + HYPRE_Int num_stencil_indices, HYPRE_Int *stencil_indices, HYPRE_Complex *values ); +HYPRE_Int HYPRE_StructMatrixAddToBoxValues ( HYPRE_StructMatrix matrix, HYPRE_Int *ilower, + HYPRE_Int *iupper, HYPRE_Int num_stencil_indices, HYPRE_Int *stencil_indices, + HYPRE_Complex *values ); +HYPRE_Int HYPRE_StructMatrixAddToConstantValues ( HYPRE_StructMatrix matrix, + HYPRE_Int num_stencil_indices, HYPRE_Int *stencil_indices, HYPRE_Complex *values ); HYPRE_Int HYPRE_StructMatrixAssemble ( HYPRE_StructMatrix matrix ); -HYPRE_Int HYPRE_StructMatrixSetNumGhost ( HYPRE_StructMatrix matrix , HYPRE_Int *num_ghost ); -HYPRE_Int HYPRE_StructMatrixGetGrid ( HYPRE_StructMatrix matrix , HYPRE_StructGrid *grid ); -HYPRE_Int HYPRE_StructMatrixSetSymmetric ( HYPRE_StructMatrix matrix , HYPRE_Int symmetric ); -HYPRE_Int HYPRE_StructMatrixSetConstantEntries ( HYPRE_StructMatrix matrix , HYPRE_Int nentries , HYPRE_Int *entries ); -HYPRE_Int HYPRE_StructMatrixPrint ( const char *filename , HYPRE_StructMatrix matrix , HYPRE_Int all ); -HYPRE_Int HYPRE_StructMatrixMatvec ( HYPRE_Complex alpha , HYPRE_StructMatrix A , HYPRE_StructVector x , HYPRE_Complex beta , HYPRE_StructVector y ); +HYPRE_Int HYPRE_StructMatrixSetNumGhost ( HYPRE_StructMatrix matrix, HYPRE_Int *num_ghost ); +HYPRE_Int HYPRE_StructMatrixGetGrid ( HYPRE_StructMatrix matrix, HYPRE_StructGrid *grid ); +HYPRE_Int HYPRE_StructMatrixSetSymmetric ( HYPRE_StructMatrix matrix, HYPRE_Int symmetric ); +HYPRE_Int HYPRE_StructMatrixSetConstantEntries ( HYPRE_StructMatrix matrix, HYPRE_Int nentries, + HYPRE_Int *entries ); +HYPRE_Int HYPRE_StructMatrixPrint ( const char *filename, HYPRE_StructMatrix matrix, + HYPRE_Int all ); +HYPRE_Int HYPRE_StructMatrixMatvec ( HYPRE_Complex alpha, HYPRE_StructMatrix A, + HYPRE_StructVector x, HYPRE_Complex beta, HYPRE_StructVector y ); HYPRE_Int HYPRE_StructMatrixClearBoundary( HYPRE_StructMatrix matrix ); /* HYPRE_struct_stencil.c */ -HYPRE_Int HYPRE_StructStencilCreate ( HYPRE_Int dim , HYPRE_Int size , HYPRE_StructStencil *stencil ); -HYPRE_Int HYPRE_StructStencilSetElement ( HYPRE_StructStencil stencil , HYPRE_Int element_index , HYPRE_Int *offset ); +HYPRE_Int HYPRE_StructStencilCreate ( HYPRE_Int dim, HYPRE_Int size, HYPRE_StructStencil *stencil ); +HYPRE_Int HYPRE_StructStencilSetElement ( HYPRE_StructStencil stencil, HYPRE_Int element_index, + HYPRE_Int *offset ); HYPRE_Int HYPRE_StructStencilDestroy ( HYPRE_StructStencil stencil ); /* HYPRE_struct_vector.c */ -HYPRE_Int HYPRE_StructVectorCreate ( MPI_Comm comm , HYPRE_StructGrid grid , HYPRE_StructVector *vector ); +HYPRE_Int HYPRE_StructVectorCreate ( MPI_Comm comm, HYPRE_StructGrid grid, + HYPRE_StructVector *vector ); HYPRE_Int HYPRE_StructVectorDestroy ( HYPRE_StructVector struct_vector ); HYPRE_Int HYPRE_StructVectorInitialize ( HYPRE_StructVector vector ); -HYPRE_Int HYPRE_StructVectorSetValues ( HYPRE_StructVector vector , HYPRE_Int *grid_index , HYPRE_Complex values ); -HYPRE_Int HYPRE_StructVectorSetBoxValues ( HYPRE_StructVector vector , HYPRE_Int *ilower , HYPRE_Int *iupper , HYPRE_Complex *values ); -HYPRE_Int HYPRE_StructVectorAddToValues ( HYPRE_StructVector vector , HYPRE_Int *grid_index , HYPRE_Complex values ); -HYPRE_Int HYPRE_StructVectorAddToBoxValues ( HYPRE_StructVector vector , HYPRE_Int *ilower , HYPRE_Int *iupper , HYPRE_Complex *values ); -HYPRE_Int HYPRE_StructVectorScaleValues ( HYPRE_StructVector vector , HYPRE_Complex factor ); -HYPRE_Int HYPRE_StructVectorGetValues ( HYPRE_StructVector vector , HYPRE_Int *grid_index , HYPRE_Complex *values ); -HYPRE_Int HYPRE_StructVectorGetBoxValues ( HYPRE_StructVector vector , HYPRE_Int *ilower , HYPRE_Int *iupper , HYPRE_Complex *values ); +HYPRE_Int HYPRE_StructVectorSetValues ( HYPRE_StructVector vector, HYPRE_Int *grid_index, + HYPRE_Complex values ); +HYPRE_Int HYPRE_StructVectorSetBoxValues ( HYPRE_StructVector vector, HYPRE_Int *ilower, + HYPRE_Int *iupper, HYPRE_Complex *values ); +HYPRE_Int HYPRE_StructVectorAddToValues ( HYPRE_StructVector vector, HYPRE_Int *grid_index, + HYPRE_Complex values ); +HYPRE_Int HYPRE_StructVectorAddToBoxValues ( HYPRE_StructVector vector, HYPRE_Int *ilower, + HYPRE_Int *iupper, HYPRE_Complex *values ); +HYPRE_Int HYPRE_StructVectorScaleValues ( HYPRE_StructVector vector, HYPRE_Complex factor ); +HYPRE_Int HYPRE_StructVectorGetValues ( HYPRE_StructVector vector, HYPRE_Int *grid_index, + HYPRE_Complex *values ); +HYPRE_Int HYPRE_StructVectorGetBoxValues ( HYPRE_StructVector vector, HYPRE_Int *ilower, + HYPRE_Int *iupper, HYPRE_Complex *values ); HYPRE_Int HYPRE_StructVectorAssemble ( HYPRE_StructVector vector ); -HYPRE_Int HYPRE_StructVectorPrint ( const char *filename , HYPRE_StructVector vector , HYPRE_Int all ); -HYPRE_Int HYPRE_StructVectorSetNumGhost ( HYPRE_StructVector vector , HYPRE_Int *num_ghost ); -HYPRE_Int HYPRE_StructVectorCopy ( HYPRE_StructVector x , HYPRE_StructVector y ); -HYPRE_Int HYPRE_StructVectorSetConstantValues ( HYPRE_StructVector vector , HYPRE_Complex values ); -HYPRE_Int HYPRE_StructVectorGetMigrateCommPkg ( HYPRE_StructVector from_vector , HYPRE_StructVector to_vector , HYPRE_CommPkg *comm_pkg ); -HYPRE_Int HYPRE_StructVectorMigrate ( HYPRE_CommPkg comm_pkg , HYPRE_StructVector from_vector , HYPRE_StructVector to_vector ); +HYPRE_Int hypre_StructVectorPrintData ( FILE *file, hypre_StructVector *vector, HYPRE_Int all ); +HYPRE_Int hypre_StructVectorReadData ( FILE *file, hypre_StructVector *vector ); +HYPRE_Int HYPRE_StructVectorPrint ( const char *filename, HYPRE_StructVector vector, + HYPRE_Int all ); +HYPRE_Int HYPRE_StructVectorRead ( MPI_Comm comm, const char *filename, + HYPRE_Int *num_ghost, HYPRE_StructVector *vector ); +HYPRE_Int HYPRE_StructVectorSetNumGhost ( HYPRE_StructVector vector, HYPRE_Int *num_ghost ); +HYPRE_Int HYPRE_StructVectorCopy ( HYPRE_StructVector x, HYPRE_StructVector y ); +HYPRE_Int HYPRE_StructVectorSetConstantValues ( HYPRE_StructVector vector, HYPRE_Complex values ); +HYPRE_Int HYPRE_StructVectorGetMigrateCommPkg ( HYPRE_StructVector from_vector, + HYPRE_StructVector to_vector, HYPRE_CommPkg *comm_pkg ); +HYPRE_Int HYPRE_StructVectorMigrate ( HYPRE_CommPkg comm_pkg, HYPRE_StructVector from_vector, + HYPRE_StructVector to_vector ); HYPRE_Int HYPRE_CommPkgDestroy ( HYPRE_CommPkg comm_pkg ); /* project.c */ -HYPRE_Int hypre_ProjectBox ( hypre_Box *box , hypre_Index index , hypre_Index stride ); -HYPRE_Int hypre_ProjectBoxArray ( hypre_BoxArray *box_array , hypre_Index index , hypre_Index stride ); -HYPRE_Int hypre_ProjectBoxArrayArray ( hypre_BoxArrayArray *box_array_array , hypre_Index index , hypre_Index stride ); +HYPRE_Int hypre_ProjectBox ( hypre_Box *box, hypre_Index index, hypre_Index stride ); +HYPRE_Int hypre_ProjectBoxArray ( hypre_BoxArray *box_array, hypre_Index index, + hypre_Index stride ); +HYPRE_Int hypre_ProjectBoxArrayArray ( hypre_BoxArrayArray *box_array_array, hypre_Index index, + hypre_Index stride ); /* struct_axpy.c */ -HYPRE_Int hypre_StructAxpy ( HYPRE_Complex alpha , hypre_StructVector *x , hypre_StructVector *y ); +HYPRE_Int hypre_StructAxpy ( HYPRE_Complex alpha, hypre_StructVector *x, hypre_StructVector *y ); /* struct_communication.c */ -HYPRE_Int hypre_CommPkgCreate ( hypre_CommInfo *comm_info , hypre_BoxArray *send_data_space , hypre_BoxArray *recv_data_space , HYPRE_Int num_values , HYPRE_Int **orders , HYPRE_Int reverse , MPI_Comm comm , hypre_CommPkg **comm_pkg_ptr ); -HYPRE_Int hypre_CommTypeSetEntries ( hypre_CommType *comm_type , HYPRE_Int *boxnums , hypre_Box *boxes , hypre_Index stride , hypre_Index coord , hypre_Index dir , HYPRE_Int *order , hypre_BoxArray *data_space , HYPRE_Int *data_offsets ); -HYPRE_Int hypre_CommTypeSetEntry ( hypre_Box *box , hypre_Index stride , hypre_Index coord , hypre_Index dir , HYPRE_Int *order , hypre_Box *data_box , HYPRE_Int data_box_offset , hypre_CommEntryType *comm_entry ); -HYPRE_Int hypre_InitializeCommunication ( hypre_CommPkg *comm_pkg , HYPRE_Complex *send_data , HYPRE_Complex *recv_data , HYPRE_Int action , HYPRE_Int tag , hypre_CommHandle **comm_handle_ptr ); +HYPRE_Int hypre_CommPkgCreate ( hypre_CommInfo *comm_info, hypre_BoxArray *send_data_space, + hypre_BoxArray *recv_data_space, HYPRE_Int num_values, HYPRE_Int **orders, HYPRE_Int reverse, + MPI_Comm comm, hypre_CommPkg **comm_pkg_ptr ); +HYPRE_Int hypre_CommTypeSetEntries ( hypre_CommType *comm_type, HYPRE_Int *boxnums, + hypre_Box *boxes, hypre_Index stride, hypre_Index coord, hypre_Index dir, HYPRE_Int *order, + hypre_BoxArray *data_space, HYPRE_Int *data_offsets ); +HYPRE_Int hypre_CommTypeSetEntry ( hypre_Box *box, hypre_Index stride, hypre_Index coord, + hypre_Index dir, HYPRE_Int *order, hypre_Box *data_box, HYPRE_Int data_box_offset, + hypre_CommEntryType *comm_entry ); +HYPRE_Int hypre_InitializeCommunication ( hypre_CommPkg *comm_pkg, HYPRE_Complex *send_data, + HYPRE_Complex *recv_data, HYPRE_Int action, HYPRE_Int tag, hypre_CommHandle **comm_handle_ptr ); HYPRE_Int hypre_FinalizeCommunication ( hypre_CommHandle *comm_handle ); -HYPRE_Int hypre_ExchangeLocalData ( hypre_CommPkg *comm_pkg , HYPRE_Complex *send_data , HYPRE_Complex *recv_data , HYPRE_Int action ); +HYPRE_Int hypre_ExchangeLocalData ( hypre_CommPkg *comm_pkg, HYPRE_Complex *send_data, + HYPRE_Complex *recv_data, HYPRE_Int action ); HYPRE_Int hypre_CommPkgDestroy ( hypre_CommPkg *comm_pkg ); /* struct_copy.c */ -HYPRE_Int hypre_StructCopy ( hypre_StructVector *x , hypre_StructVector *y ); -HYPRE_Int hypre_StructPartialCopy ( hypre_StructVector *x , hypre_StructVector *y , hypre_BoxArrayArray *array_boxes ); +HYPRE_Int hypre_StructCopy ( hypre_StructVector *x, hypre_StructVector *y ); +HYPRE_Int hypre_StructPartialCopy ( hypre_StructVector *x, hypre_StructVector *y, + hypre_BoxArrayArray *array_boxes ); /* struct_grid.c */ -HYPRE_Int hypre_StructGridCreate ( MPI_Comm comm , HYPRE_Int dim , hypre_StructGrid **grid_ptr ); -HYPRE_Int hypre_StructGridRef ( hypre_StructGrid *grid , hypre_StructGrid **grid_ref ); +HYPRE_Int hypre_StructGridCreate ( MPI_Comm comm, HYPRE_Int dim, hypre_StructGrid **grid_ptr ); +HYPRE_Int hypre_StructGridRef ( hypre_StructGrid *grid, hypre_StructGrid **grid_ref ); HYPRE_Int hypre_StructGridDestroy ( hypre_StructGrid *grid ); -HYPRE_Int hypre_StructGridSetPeriodic ( hypre_StructGrid *grid , hypre_Index periodic ); -HYPRE_Int hypre_StructGridSetExtents ( hypre_StructGrid *grid , hypre_Index ilower , hypre_Index iupper ); -HYPRE_Int hypre_StructGridSetBoxes ( hypre_StructGrid *grid , hypre_BoxArray *boxes ); -HYPRE_Int hypre_StructGridSetBoundingBox ( hypre_StructGrid *grid , hypre_Box *new_bb ); -HYPRE_Int hypre_StructGridSetIDs ( hypre_StructGrid *grid , HYPRE_Int *ids ); -HYPRE_Int hypre_StructGridSetBoxManager ( hypre_StructGrid *grid , hypre_BoxManager *boxman ); -HYPRE_Int hypre_StructGridSetMaxDistance ( hypre_StructGrid *grid , hypre_Index dist ); +HYPRE_Int hypre_StructGridSetPeriodic ( hypre_StructGrid *grid, hypre_Index periodic ); +HYPRE_Int hypre_StructGridSetExtents ( hypre_StructGrid *grid, hypre_Index ilower, + hypre_Index iupper ); +HYPRE_Int hypre_StructGridSetBoxes ( hypre_StructGrid *grid, hypre_BoxArray *boxes ); +HYPRE_Int hypre_StructGridSetBoundingBox ( hypre_StructGrid *grid, hypre_Box *new_bb ); +HYPRE_Int hypre_StructGridSetIDs ( hypre_StructGrid *grid, HYPRE_Int *ids ); +HYPRE_Int hypre_StructGridSetBoxManager ( hypre_StructGrid *grid, hypre_BoxManager *boxman ); +HYPRE_Int hypre_StructGridSetMaxDistance ( hypre_StructGrid *grid, hypre_Index dist ); HYPRE_Int hypre_StructGridAssemble ( hypre_StructGrid *grid ); -HYPRE_Int hypre_GatherAllBoxes ( MPI_Comm comm , hypre_BoxArray *boxes , HYPRE_Int dim , hypre_BoxArray **all_boxes_ptr , HYPRE_Int **all_procs_ptr , HYPRE_Int *first_local_ptr ); -HYPRE_Int hypre_ComputeBoxnums ( hypre_BoxArray *boxes , HYPRE_Int *procs , HYPRE_Int **boxnums_ptr ); -HYPRE_Int hypre_StructGridPrint ( FILE *file , hypre_StructGrid *grid ); -HYPRE_Int hypre_StructGridRead ( MPI_Comm comm , FILE *file , hypre_StructGrid **grid_ptr ); -HYPRE_Int hypre_StructGridSetNumGhost ( hypre_StructGrid *grid , HYPRE_Int *num_ghost ); +HYPRE_Int hypre_GatherAllBoxes ( MPI_Comm comm, hypre_BoxArray *boxes, HYPRE_Int dim, + hypre_BoxArray **all_boxes_ptr, HYPRE_Int **all_procs_ptr, HYPRE_Int *first_local_ptr ); +HYPRE_Int hypre_ComputeBoxnums ( hypre_BoxArray *boxes, HYPRE_Int *procs, HYPRE_Int **boxnums_ptr ); +HYPRE_Int hypre_StructGridPrint ( FILE *file, hypre_StructGrid *grid ); +HYPRE_Int hypre_StructGridRead ( MPI_Comm comm, FILE *file, hypre_StructGrid **grid_ptr ); +HYPRE_Int hypre_StructGridSetNumGhost ( hypre_StructGrid *grid, HYPRE_Int *num_ghost ); +HYPRE_Int hypre_StructGridGetMaxBoxSize ( hypre_StructGrid *grid ); #if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) -HYPRE_Int hypre_StructGridGetMaxBoxSize(hypre_StructGrid *grid); -HYPRE_Int hypre_StructGridSetDataLocation( HYPRE_StructGrid grid, HYPRE_MemoryLocation data_location ); +HYPRE_Int hypre_StructGridSetDataLocation( HYPRE_StructGrid grid, + HYPRE_MemoryLocation data_location ); #endif /* struct_innerprod.c */ -HYPRE_Real hypre_StructInnerProd ( hypre_StructVector *x , hypre_StructVector *y ); +HYPRE_Real hypre_StructInnerProd ( hypre_StructVector *x, hypre_StructVector *y ); /* struct_io.c */ -HYPRE_Int hypre_PrintBoxArrayData ( FILE *file , hypre_BoxArray *box_array , hypre_BoxArray *data_space , HYPRE_Int num_values , HYPRE_Int dim , HYPRE_Complex *data ); -HYPRE_Int hypre_PrintCCVDBoxArrayData ( FILE *file , hypre_BoxArray *box_array , hypre_BoxArray *data_space , HYPRE_Int num_values , HYPRE_Int center_rank , HYPRE_Int stencil_size , HYPRE_Int *symm_elements , HYPRE_Int dim , HYPRE_Complex *data ); -HYPRE_Int hypre_PrintCCBoxArrayData ( FILE *file , hypre_BoxArray *box_array , hypre_BoxArray *data_space , HYPRE_Int num_values , HYPRE_Complex *data ); -HYPRE_Int hypre_ReadBoxArrayData ( FILE *file , hypre_BoxArray *box_array , hypre_BoxArray *data_space , HYPRE_Int num_values , HYPRE_Int dim , HYPRE_Complex *data ); -HYPRE_Int hypre_ReadBoxArrayData_CC ( FILE *file , hypre_BoxArray *box_array , hypre_BoxArray *data_space , HYPRE_Int stencil_size , HYPRE_Int real_stencil_size , HYPRE_Int constant_coefficient , HYPRE_Int dim , HYPRE_Complex *data ); +HYPRE_Int hypre_PrintBoxArrayData ( FILE *file, hypre_BoxArray *box_array, + hypre_BoxArray *data_space, HYPRE_Int num_values, HYPRE_Int dim, HYPRE_Complex *data ); +HYPRE_Int hypre_PrintCCVDBoxArrayData ( FILE *file, hypre_BoxArray *box_array, + hypre_BoxArray *data_space, HYPRE_Int num_values, HYPRE_Int center_rank, HYPRE_Int stencil_size, + HYPRE_Int *symm_elements, HYPRE_Int dim, HYPRE_Complex *data ); +HYPRE_Int hypre_PrintCCBoxArrayData ( FILE *file, hypre_BoxArray *box_array, + hypre_BoxArray *data_space, HYPRE_Int num_values, HYPRE_Complex *data ); +HYPRE_Int hypre_ReadBoxArrayData ( FILE *file, hypre_BoxArray *box_array, + hypre_BoxArray *data_space, HYPRE_Int num_values, HYPRE_Int dim, HYPRE_Complex *data ); +HYPRE_Int hypre_ReadBoxArrayData_CC ( FILE *file, hypre_BoxArray *box_array, + hypre_BoxArray *data_space, HYPRE_Int stencil_size, HYPRE_Int real_stencil_size, + HYPRE_Int constant_coefficient, HYPRE_Int dim, HYPRE_Complex *data ); /* struct_matrix.c */ -HYPRE_Complex *hypre_StructMatrixExtractPointerByIndex ( hypre_StructMatrix *matrix , HYPRE_Int b , hypre_Index index ); -hypre_StructMatrix *hypre_StructMatrixCreate ( MPI_Comm comm , hypre_StructGrid *grid , hypre_StructStencil *user_stencil ); +HYPRE_Complex *hypre_StructMatrixExtractPointerByIndex ( hypre_StructMatrix *matrix, HYPRE_Int b, + hypre_Index index ); +hypre_StructMatrix *hypre_StructMatrixCreate ( MPI_Comm comm, hypre_StructGrid *grid, + hypre_StructStencil *user_stencil ); hypre_StructMatrix *hypre_StructMatrixRef ( hypre_StructMatrix *matrix ); HYPRE_Int hypre_StructMatrixDestroy ( hypre_StructMatrix *matrix ); HYPRE_Int hypre_StructMatrixInitializeShell ( hypre_StructMatrix *matrix ); -HYPRE_Int hypre_StructMatrixInitializeData ( hypre_StructMatrix *matrix , HYPRE_Complex *data ,HYPRE_Complex *data_const); +HYPRE_Int hypre_StructMatrixInitializeData ( hypre_StructMatrix *matrix, HYPRE_Complex *data, + HYPRE_Complex *data_const); HYPRE_Int hypre_StructMatrixInitialize ( hypre_StructMatrix *matrix ); -HYPRE_Int hypre_StructMatrixSetValues ( hypre_StructMatrix *matrix , hypre_Index grid_index , HYPRE_Int num_stencil_indices , HYPRE_Int *stencil_indices , HYPRE_Complex *values , HYPRE_Int action , HYPRE_Int boxnum , HYPRE_Int outside ); -HYPRE_Int hypre_StructMatrixSetBoxValues ( hypre_StructMatrix *matrix , hypre_Box *set_box , hypre_Box *value_box , HYPRE_Int num_stencil_indices , HYPRE_Int *stencil_indices , HYPRE_Complex *values , HYPRE_Int action , HYPRE_Int boxnum , HYPRE_Int outside ); -HYPRE_Int hypre_StructMatrixSetConstantValues ( hypre_StructMatrix *matrix , HYPRE_Int num_stencil_indices , HYPRE_Int *stencil_indices , HYPRE_Complex *values , HYPRE_Int action ); -HYPRE_Int hypre_StructMatrixClearValues ( hypre_StructMatrix *matrix , hypre_Index grid_index , HYPRE_Int num_stencil_indices , HYPRE_Int *stencil_indices , HYPRE_Int boxnum , HYPRE_Int outside ); -HYPRE_Int hypre_StructMatrixClearBoxValues ( hypre_StructMatrix *matrix , hypre_Box *clear_box , HYPRE_Int num_stencil_indices , HYPRE_Int *stencil_indices , HYPRE_Int boxnum , HYPRE_Int outside ); +HYPRE_Int hypre_StructMatrixSetValues ( hypre_StructMatrix *matrix, hypre_Index grid_index, + HYPRE_Int num_stencil_indices, HYPRE_Int *stencil_indices, HYPRE_Complex *values, HYPRE_Int action, + HYPRE_Int boxnum, HYPRE_Int outside ); +HYPRE_Int hypre_StructMatrixSetBoxValues ( hypre_StructMatrix *matrix, hypre_Box *set_box, + hypre_Box *value_box, HYPRE_Int num_stencil_indices, HYPRE_Int *stencil_indices, + HYPRE_Complex *values, HYPRE_Int action, HYPRE_Int boxnum, HYPRE_Int outside ); +HYPRE_Int hypre_StructMatrixSetConstantValues ( hypre_StructMatrix *matrix, + HYPRE_Int num_stencil_indices, HYPRE_Int *stencil_indices, HYPRE_Complex *values, + HYPRE_Int action ); +HYPRE_Int hypre_StructMatrixClearValues ( hypre_StructMatrix *matrix, hypre_Index grid_index, + HYPRE_Int num_stencil_indices, HYPRE_Int *stencil_indices, HYPRE_Int boxnum, HYPRE_Int outside ); +HYPRE_Int hypre_StructMatrixClearBoxValues ( hypre_StructMatrix *matrix, hypre_Box *clear_box, + HYPRE_Int num_stencil_indices, HYPRE_Int *stencil_indices, HYPRE_Int boxnum, HYPRE_Int outside ); HYPRE_Int hypre_StructMatrixAssemble ( hypre_StructMatrix *matrix ); -HYPRE_Int hypre_StructMatrixSetNumGhost ( hypre_StructMatrix *matrix , HYPRE_Int *num_ghost ); -HYPRE_Int hypre_StructMatrixSetConstantCoefficient ( hypre_StructMatrix *matrix , HYPRE_Int constant_coefficient ); -HYPRE_Int hypre_StructMatrixSetConstantEntries ( hypre_StructMatrix *matrix , HYPRE_Int nentries , HYPRE_Int *entries ); +HYPRE_Int hypre_StructMatrixSetNumGhost ( hypre_StructMatrix *matrix, HYPRE_Int *num_ghost ); +HYPRE_Int hypre_StructMatrixSetConstantCoefficient ( hypre_StructMatrix *matrix, + HYPRE_Int constant_coefficient ); +HYPRE_Int hypre_StructMatrixSetConstantEntries ( hypre_StructMatrix *matrix, HYPRE_Int nentries, + HYPRE_Int *entries ); HYPRE_Int hypre_StructMatrixClearGhostValues ( hypre_StructMatrix *matrix ); -HYPRE_Int hypre_StructMatrixPrint ( const char *filename , hypre_StructMatrix *matrix , HYPRE_Int all ); -HYPRE_Int hypre_StructMatrixMigrate ( hypre_StructMatrix *from_matrix , hypre_StructMatrix *to_matrix ); -hypre_StructMatrix *hypre_StructMatrixRead ( MPI_Comm comm , const char *filename , HYPRE_Int *num_ghost ); +HYPRE_Int hypre_StructMatrixPrintData ( FILE *file, hypre_StructMatrix *matrix, HYPRE_Int all ); +HYPRE_Int hypre_StructMatrixReadData ( FILE *file, hypre_StructMatrix *matrix ); +HYPRE_Int hypre_StructMatrixPrint ( const char *filename, hypre_StructMatrix *matrix, + HYPRE_Int all ); +hypre_StructMatrix *hypre_StructMatrixRead ( MPI_Comm comm, const char *filename, + HYPRE_Int *num_ghost ); +HYPRE_Int hypre_StructMatrixMigrate ( hypre_StructMatrix *from_matrix, + hypre_StructMatrix *to_matrix ); HYPRE_Int hypre_StructMatrixClearBoundary( hypre_StructMatrix *matrix); /* struct_matrix_mask.c */ -hypre_StructMatrix *hypre_StructMatrixCreateMask ( hypre_StructMatrix *matrix , HYPRE_Int num_stencil_indices , HYPRE_Int *stencil_indices ); +hypre_StructMatrix *hypre_StructMatrixCreateMask ( hypre_StructMatrix *matrix, + HYPRE_Int num_stencil_indices, HYPRE_Int *stencil_indices ); /* struct_matvec.c */ void *hypre_StructMatvecCreate ( void ); -HYPRE_Int hypre_StructMatvecSetup ( void *matvec_vdata , hypre_StructMatrix *A , hypre_StructVector *x ); -HYPRE_Int hypre_StructMatvecCompute ( void *matvec_vdata , HYPRE_Complex alpha , hypre_StructMatrix *A , hypre_StructVector *x , HYPRE_Complex beta , hypre_StructVector *y ); -HYPRE_Int hypre_StructMatvecCC0 ( HYPRE_Complex alpha , hypre_StructMatrix *A , hypre_StructVector *x , hypre_StructVector *y , hypre_BoxArrayArray *compute_box_aa , hypre_IndexRef stride ); -HYPRE_Int hypre_StructMatvecCC1 ( HYPRE_Complex alpha , hypre_StructMatrix *A , hypre_StructVector *x , hypre_StructVector *y , hypre_BoxArrayArray *compute_box_aa , hypre_IndexRef stride ); -HYPRE_Int hypre_StructMatvecCC2 ( HYPRE_Complex alpha , hypre_StructMatrix *A , hypre_StructVector *x , hypre_StructVector *y , hypre_BoxArrayArray *compute_box_aa , hypre_IndexRef stride ); +HYPRE_Int hypre_StructMatvecSetup ( void *matvec_vdata, hypre_StructMatrix *A, + hypre_StructVector *x ); +HYPRE_Int hypre_StructMatvecCompute ( void *matvec_vdata, HYPRE_Complex alpha, + hypre_StructMatrix *A, hypre_StructVector *x, HYPRE_Complex beta, hypre_StructVector *y ); +HYPRE_Int hypre_StructMatvecCC0 ( HYPRE_Complex alpha, hypre_StructMatrix *A, hypre_StructVector *x, + hypre_StructVector *y, hypre_BoxArrayArray *compute_box_aa, hypre_IndexRef stride ); +HYPRE_Int hypre_StructMatvecCC1 ( HYPRE_Complex alpha, hypre_StructMatrix *A, hypre_StructVector *x, + hypre_StructVector *y, hypre_BoxArrayArray *compute_box_aa, hypre_IndexRef stride ); +HYPRE_Int hypre_StructMatvecCC2 ( HYPRE_Complex alpha, hypre_StructMatrix *A, hypre_StructVector *x, + hypre_StructVector *y, hypre_BoxArrayArray *compute_box_aa, hypre_IndexRef stride ); HYPRE_Int hypre_StructMatvecDestroy ( void *matvec_vdata ); -HYPRE_Int hypre_StructMatvec ( HYPRE_Complex alpha , hypre_StructMatrix *A , hypre_StructVector *x , HYPRE_Complex beta , hypre_StructVector *y ); +HYPRE_Int hypre_StructMatvec ( HYPRE_Complex alpha, hypre_StructMatrix *A, hypre_StructVector *x, + HYPRE_Complex beta, hypre_StructVector *y ); /* struct_scale.c */ -HYPRE_Int hypre_StructScale ( HYPRE_Complex alpha , hypre_StructVector *y ); +HYPRE_Int hypre_StructScale ( HYPRE_Complex alpha, hypre_StructVector *y ); /* struct_stencil.c */ -hypre_StructStencil *hypre_StructStencilCreate ( HYPRE_Int dim , HYPRE_Int size , hypre_Index *shape ); +hypre_StructStencil *hypre_StructStencilCreate ( HYPRE_Int dim, HYPRE_Int size, + hypre_Index *shape ); hypre_StructStencil *hypre_StructStencilRef ( hypre_StructStencil *stencil ); HYPRE_Int hypre_StructStencilDestroy ( hypre_StructStencil *stencil ); -HYPRE_Int hypre_StructStencilElementRank ( hypre_StructStencil *stencil , hypre_Index stencil_element ); -HYPRE_Int hypre_StructStencilSymmetrize ( hypre_StructStencil *stencil , hypre_StructStencil **symm_stencil_ptr , HYPRE_Int **symm_elements_ptr ); +HYPRE_Int hypre_StructStencilElementRank ( hypre_StructStencil *stencil, + hypre_Index stencil_element ); +HYPRE_Int hypre_StructStencilSymmetrize ( hypre_StructStencil *stencil, + hypre_StructStencil **symm_stencil_ptr, HYPRE_Int **symm_elements_ptr ); /* struct_vector.c */ -hypre_StructVector *hypre_StructVectorCreate ( MPI_Comm comm , hypre_StructGrid *grid ); +hypre_StructVector *hypre_StructVectorCreate ( MPI_Comm comm, hypre_StructGrid *grid ); hypre_StructVector *hypre_StructVectorRef ( hypre_StructVector *vector ); HYPRE_Int hypre_StructVectorDestroy ( hypre_StructVector *vector ); HYPRE_Int hypre_StructVectorInitializeShell ( hypre_StructVector *vector ); -HYPRE_Int hypre_StructVectorInitializeData ( hypre_StructVector *vector , HYPRE_Complex *data); +HYPRE_Int hypre_StructVectorInitializeData ( hypre_StructVector *vector, HYPRE_Complex *data); HYPRE_Int hypre_StructVectorInitialize ( hypre_StructVector *vector ); -HYPRE_Int hypre_StructVectorSetValues ( hypre_StructVector *vector , hypre_Index grid_index , HYPRE_Complex *values , HYPRE_Int action , HYPRE_Int boxnum , HYPRE_Int outside ); -HYPRE_Int hypre_StructVectorSetBoxValues ( hypre_StructVector *vector , hypre_Box *set_box , hypre_Box *value_box , HYPRE_Complex *values , HYPRE_Int action , HYPRE_Int boxnum , HYPRE_Int outside ); -HYPRE_Int hypre_StructVectorClearValues ( hypre_StructVector *vector , hypre_Index grid_index , HYPRE_Int boxnum , HYPRE_Int outside ); -HYPRE_Int hypre_StructVectorClearBoxValues ( hypre_StructVector *vector , hypre_Box *clear_box , HYPRE_Int boxnum , HYPRE_Int outside ); +HYPRE_Int hypre_StructVectorSetValues ( hypre_StructVector *vector, hypre_Index grid_index, + HYPRE_Complex *values, HYPRE_Int action, HYPRE_Int boxnum, HYPRE_Int outside ); +HYPRE_Int hypre_StructVectorSetBoxValues ( hypre_StructVector *vector, hypre_Box *set_box, + hypre_Box *value_box, HYPRE_Complex *values, HYPRE_Int action, HYPRE_Int boxnum, + HYPRE_Int outside ); +HYPRE_Int hypre_StructVectorClearValues ( hypre_StructVector *vector, hypre_Index grid_index, + HYPRE_Int boxnum, HYPRE_Int outside ); +HYPRE_Int hypre_StructVectorClearBoxValues ( hypre_StructVector *vector, hypre_Box *clear_box, + HYPRE_Int boxnum, HYPRE_Int outside ); HYPRE_Int hypre_StructVectorClearAllValues ( hypre_StructVector *vector ); -HYPRE_Int hypre_StructVectorSetNumGhost ( hypre_StructVector *vector , HYPRE_Int *num_ghost ); -HYPRE_Int hypre_StructVectorSetDataSize(hypre_StructVector *vector , HYPRE_Int *data_size, HYPRE_Int *data_host_size); +HYPRE_Int hypre_StructVectorSetNumGhost ( hypre_StructVector *vector, HYPRE_Int *num_ghost ); +HYPRE_Int hypre_StructVectorSetDataSize(hypre_StructVector *vector, HYPRE_Int *data_size, + HYPRE_Int *data_host_size); HYPRE_Int hypre_StructVectorAssemble ( hypre_StructVector *vector ); -HYPRE_Int hypre_StructVectorCopy ( hypre_StructVector *x , hypre_StructVector *y ); -HYPRE_Int hypre_StructVectorSetConstantValues ( hypre_StructVector *vector , HYPRE_Complex values ); -HYPRE_Int hypre_StructVectorSetFunctionValues ( hypre_StructVector *vector , HYPRE_Complex (*fcn )()); +HYPRE_Int hypre_StructVectorCopy ( hypre_StructVector *x, hypre_StructVector *y ); +HYPRE_Int hypre_StructVectorSetConstantValues ( hypre_StructVector *vector, HYPRE_Complex values ); +HYPRE_Int hypre_StructVectorSetFunctionValues ( hypre_StructVector *vector, + HYPRE_Complex (*fcn )( HYPRE_Int, HYPRE_Int, HYPRE_Int )); HYPRE_Int hypre_StructVectorClearGhostValues ( hypre_StructVector *vector ); -HYPRE_Int hypre_StructVectorClearBoundGhostValues ( hypre_StructVector *vector , HYPRE_Int force ); -HYPRE_Int hypre_StructVectorScaleValues ( hypre_StructVector *vector , HYPRE_Complex factor ); -hypre_CommPkg *hypre_StructVectorGetMigrateCommPkg ( hypre_StructVector *from_vector , hypre_StructVector *to_vector ); -HYPRE_Int hypre_StructVectorMigrate ( hypre_CommPkg *comm_pkg , hypre_StructVector *from_vector , hypre_StructVector *to_vector ); -HYPRE_Int hypre_StructVectorPrint ( const char *filename , hypre_StructVector *vector , HYPRE_Int all ); -hypre_StructVector *hypre_StructVectorRead ( MPI_Comm comm , const char *filename , HYPRE_Int *num_ghost ); +HYPRE_Int hypre_StructVectorClearBoundGhostValues ( hypre_StructVector *vector, HYPRE_Int force ); +HYPRE_Int hypre_StructVectorScaleValues ( hypre_StructVector *vector, HYPRE_Complex factor ); +hypre_CommPkg *hypre_StructVectorGetMigrateCommPkg ( hypre_StructVector *from_vector, + hypre_StructVector *to_vector ); +HYPRE_Int hypre_StructVectorMigrate ( hypre_CommPkg *comm_pkg, hypre_StructVector *from_vector, + hypre_StructVector *to_vector ); +HYPRE_Int hypre_StructVectorPrint ( const char *filename, hypre_StructVector *vector, + HYPRE_Int all ); +hypre_StructVector *hypre_StructVectorRead ( MPI_Comm comm, const char *filename, + HYPRE_Int *num_ghost ); hypre_StructVector *hypre_StructVectorClone ( hypre_StructVector *vector ); - -#if defined(HYPRE_USING_DEVICE_OPENMP) /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -1926,8 +1782,10 @@ hypre_StructVector *hypre_StructVectorClone ( hypre_StructVector *vector ); * BoxLoop macros: *--------------------------------------------------------------------------*/ -#ifndef HYPRE_NEWBOXLOOP_HEADER -#define HYPRE_NEWBOXLOOP_HEADER +#ifndef HYPRE_BOXLOOP_DEVICEOMP_HEADER +#define HYPRE_BOXLOOP_DEVICEOMP_HEADER + +#if defined(HYPRE_USING_DEVICE_OPENMP) && !defined(HYPRE_USING_RAJA) && !defined(HYPRE_USING_KOKKOS) #include "omp.h" @@ -1944,7 +1802,7 @@ hypre_StructVector *hypre_StructVectorClone ( hypre_StructVector *vector ); #ifndef AUTO_OMP_TEAM /* omp team size (aka. gpu block size) */ -#define hypre_gpu_block_size 512 +#define hypre_gpu_block_size HYPRE_1D_BLOCK_SIZE /* the max number of omp teams */ #define hypre_max_num_blocks 1000000 #endif @@ -1979,7 +1837,7 @@ hypre_StructVector *hypre_StructVectorClone ( hypre_StructVector *vector ); #define hypre_BoxLoop3End zypre_omp4_dist_BoxLoopEnd #define hypre_BoxLoop4Begin zypre_omp4_dist_BoxLoop4Begin #define hypre_BoxLoop4End zypre_omp4_dist_BoxLoopEnd -#define hypre_LoopBegin zypre_LoopBegin +#define hypre_LoopBegin zypre_omp4_dist_LoopBegin #define hypre_LoopEnd zypre_omp4_dist_BoxLoopEnd /* Look for more in struct_ls/red_black_gs.h" */ @@ -2442,7 +2300,7 @@ hypre__J = hypre__thread; i1 = i2 = 0; \ /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - * Basic Loop * - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ -#define zypre_LoopBegin(size, idx) \ +#define zypre_omp4_dist_LoopBegin(size, idx) \ { \ /* host code: */ \ /* HYPRE_Int idx = 0; */\ @@ -2453,14 +2311,6 @@ hypre__J = hypre__thread; i1 = i2 = 0; \ for (HYPRE_Int idx = 0; idx < hypre__tot; idx++) \ { -#if 0 -#define hypre_LoopBegin0(size, idx) \ -{ \ - HYPRE_Int idx, hypre__size = size; \ - for (idx = 0; idx < hypre__size; idx++) \ - { -#endif - #define hypre_BoxLoopGetIndex(index) \ index[0] = hypre__id_0; \ index[1] = hypre__id_1; \ @@ -2483,10 +2333,10 @@ hypre__J = hypre__thread; i1 = i2 = 0; \ #endif +#endif /* #ifndef HYPRE_BOXLOOP_DEVICEOMP_HEADER */ -#elif !defined(HYPRE_USING_RAJA) && !defined(HYPRE_USING_KOKKOS) && !defined(HYPRE_USING_CUDA) && !defined(HYPRE_USING_HIP) /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -2502,32 +2352,25 @@ hypre__J = hypre__thread; i1 = i2 = 0; \ * BoxLoop macros: *--------------------------------------------------------------------------*/ -#ifndef HYPRE_NEWBOXLOOP_HEADER -#define HYPRE_NEWBOXLOOP_HEADER +#ifndef HYPRE_BOXLOOP_HOST_HEADER +#define HYPRE_BOXLOOP_HOST_HEADER -#ifdef HYPRE_USING_OPENMP +#if defined(HYPRE_USING_OPENMP) #define HYPRE_BOX_REDUCTION +#define HYPRE_OMP_CLAUSE #if defined(WIN32) && defined(_MSC_VER) -#define Pragma(x) __pragma(HYPRE_XSTR(x)) +#define Pragma(x) __pragma(x) #else #define Pragma(x) _Pragma(HYPRE_XSTR(x)) #endif -#define OMP0 Pragma(omp parallel for HYPRE_BOX_REDUCTION HYPRE_SMP_SCHEDULE) -#define OMP1 Pragma(omp parallel for private(HYPRE_BOX_PRIVATE) HYPRE_BOX_REDUCTION HYPRE_SMP_SCHEDULE) -#else /* #ifdef HYPRE_USING_OPENMP */ +#define OMP0 Pragma(omp parallel for HYPRE_OMP_CLAUSE HYPRE_BOX_REDUCTION HYPRE_SMP_SCHEDULE) +#define OMP1 Pragma(omp parallel for private(HYPRE_BOX_PRIVATE) HYPRE_OMP_CLAUSE HYPRE_BOX_REDUCTION HYPRE_SMP_SCHEDULE) +#else /* #if defined(HYPRE_USING_OPENMP) */ #define OMP0 #define OMP1 -#endif /* #ifdef HYPRE_USING_OPENMP */ - -typedef struct hypre_Boxloop_struct -{ - HYPRE_Int lsize0,lsize1,lsize2; - HYPRE_Int strides0,strides1,strides2; - HYPRE_Int bstart0,bstart1,bstart2; - HYPRE_Int bsize0,bsize1,bsize2; -} hypre_Boxloop; +#endif /* #if defined(HYPRE_USING_OPENMP) */ -#define zypre_newBoxLoop0Begin(ndim, loop_size) \ +#define zypre_BoxLoop0Begin(ndim, loop_size) \ { \ zypre_BoxLoopDeclare(); \ zypre_BoxLoopInit(ndim, loop_size); \ @@ -2540,7 +2383,7 @@ typedef struct hypre_Boxloop_struct for (hypre__I = 0; hypre__I < hypre__IN; hypre__I++) \ { -#define zypre_newBoxLoop0End() \ +#define zypre_BoxLoop0End() \ } \ zypre_BoxLoopInc1(); \ zypre_BoxLoopInc2(); \ @@ -2548,8 +2391,8 @@ typedef struct hypre_Boxloop_struct } \ } -#define zypre_newBoxLoop1Begin(ndim, loop_size, \ - dbox1, start1, stride1, i1) \ +#define zypre_BoxLoop1Begin(ndim, loop_size, \ + dbox1, start1, stride1, i1) \ { \ HYPRE_Int i1; \ zypre_BoxLoopDeclare(); \ @@ -2567,7 +2410,7 @@ typedef struct hypre_Boxloop_struct for (hypre__I = 0; hypre__I < hypre__IN; hypre__I++) \ { -#define zypre_newBoxLoop1End(i1) \ +#define zypre_BoxLoop1End(i1) \ i1 += hypre__i0inc1; \ } \ zypre_BoxLoopInc1(); \ @@ -2578,9 +2421,9 @@ typedef struct hypre_Boxloop_struct } -#define zypre_newBoxLoop2Begin(ndim, loop_size, \ - dbox1, start1, stride1, i1, \ - dbox2, start2, stride2, i2) \ +#define zypre_BoxLoop2Begin(ndim, loop_size, \ + dbox1, start1, stride1, i1, \ + dbox2, start2, stride2, i2) \ { \ HYPRE_Int i1, i2; \ zypre_BoxLoopDeclare(); \ @@ -2601,7 +2444,7 @@ typedef struct hypre_Boxloop_struct for (hypre__I = 0; hypre__I < hypre__IN; hypre__I++) \ { -#define zypre_newBoxLoop2End(i1, i2) \ +#define zypre_BoxLoop2End(i1, i2) \ i1 += hypre__i0inc1; \ i2 += hypre__i0inc2; \ } \ @@ -2614,10 +2457,10 @@ typedef struct hypre_Boxloop_struct } -#define zypre_newBoxLoop3Begin(ndim, loop_size, \ - dbox1, start1, stride1, i1, \ - dbox2, start2, stride2, i2, \ - dbox3, start3, stride3, i3) \ +#define zypre_BoxLoop3Begin(ndim, loop_size, \ + dbox1, start1, stride1, i1, \ + dbox2, start2, stride2, i2, \ + dbox3, start3, stride3, i3) \ { \ HYPRE_Int i1, i2, i3; \ zypre_BoxLoopDeclare(); \ @@ -2641,7 +2484,7 @@ typedef struct hypre_Boxloop_struct for (hypre__I = 0; hypre__I < hypre__IN; hypre__I++) \ { -#define zypre_newBoxLoop3End(i1, i2, i3) \ +#define zypre_BoxLoop3End(i1, i2, i3) \ i1 += hypre__i0inc1; \ i2 += hypre__i0inc2; \ i3 += hypre__i0inc3; \ @@ -2655,7 +2498,7 @@ typedef struct hypre_Boxloop_struct } \ } -#define zypre_newBoxLoop4Begin(ndim, loop_size, \ +#define zypre_BoxLoop4Begin(ndim, loop_size, \ dbox1, start1, stride1, i1, \ dbox2, start2, stride2, i2, \ dbox3, start3, stride3, i3, \ @@ -2686,7 +2529,7 @@ typedef struct hypre_Boxloop_struct for (hypre__I = 0; hypre__I < hypre__IN; hypre__I++) \ { -#define zypre_newBoxLoop4End(i1, i2, i3, i4) \ +#define zypre_BoxLoop4End(i1, i2, i3, i4) \ i1 += hypre__i0inc1; \ i2 += hypre__i0inc2; \ i3 += hypre__i0inc3; \ @@ -2702,9 +2545,27 @@ typedef struct hypre_Boxloop_struct } \ } -#define zypre_newBasicBoxLoop2Begin(ndim, loop_size, \ - stride1, i1, \ - stride2, i2) \ +#define zypre_BasicBoxLoop1Begin(ndim, loop_size, \ + stride1, i1) \ +{ \ + zypre_BoxLoopDeclare(); \ + zypre_BoxLoopDeclareK(1); \ + zypre_BoxLoopInit(ndim, loop_size); \ + zypre_BasicBoxLoopInitK(1, stride1); \ + OMP1 \ + for (hypre__block = 0; hypre__block < hypre__num_blocks; hypre__block++) \ + { \ + HYPRE_Int i1; \ + zypre_BoxLoopSet(); \ + zypre_BoxLoopSetK(1, i1); \ + for (hypre__J = 0; hypre__J < hypre__JN; hypre__J++) \ + { \ + for (hypre__I = 0; hypre__I < hypre__IN; hypre__I++) \ + { + +#define zypre_BasicBoxLoop2Begin(ndim, loop_size, \ + stride1, i1, \ + stride2, i2) \ { \ zypre_BoxLoopDeclare(); \ zypre_BoxLoopDeclareK(1); \ @@ -2725,50 +2586,150 @@ typedef struct hypre_Boxloop_struct { -#define hypre_LoopBegin(size, idx) \ +#define zypre_LoopBegin(size, idx) \ { \ HYPRE_Int idx; \ OMP0 \ for (idx = 0; idx < size; idx ++) \ { -#define hypre_LoopEnd() \ - } \ +#define zypre_LoopEnd() \ + } \ } -#define hypre_BoxLoopGetIndex zypre_BoxLoopGetIndex - -#define hypre_BoxLoopBlock zypre_BoxLoopBlock -#define hypre_BoxLoop0Begin zypre_newBoxLoop0Begin -#define hypre_BoxLoop0End zypre_newBoxLoop0End -#define hypre_BoxLoop1Begin zypre_newBoxLoop1Begin -#define hypre_BoxLoop1End zypre_newBoxLoop1End -#define hypre_BoxLoop2Begin zypre_newBoxLoop2Begin -#define hypre_BoxLoop2End zypre_newBoxLoop2End -#define hypre_BoxLoop3Begin zypre_newBoxLoop3Begin -#define hypre_BoxLoop3End zypre_newBoxLoop3End -#define hypre_BoxLoop4Begin zypre_newBoxLoop4Begin -#define hypre_BoxLoop4End zypre_newBoxLoop4End -#define hypre_BasicBoxLoop2Begin zypre_newBasicBoxLoop2Begin +/*-------------------------------------------------------------------------- + * Serial BoxLoop macros: + * [same as the ones above (without OMP and with SetOneBlock)] + * TODO: combine them + *--------------------------------------------------------------------------*/ +#define hypre_SerialBoxLoop0Begin(ndim, loop_size) \ +{ \ + zypre_BoxLoopDeclare(); \ + zypre_BoxLoopInit(ndim, loop_size); \ + zypre_BoxLoopSetOneBlock(); \ + for (hypre__block = 0; hypre__block < hypre__num_blocks; hypre__block++) \ + { \ + zypre_BoxLoopSet(); \ + for (hypre__J = 0; hypre__J < hypre__JN; hypre__J++) \ + { \ + for (hypre__I = 0; hypre__I < hypre__IN; hypre__I++) \ + { -/* Reduction */ -#define hypre_BoxLoop1ReductionBegin(ndim, loop_size, dbox1, start1, stride1, i1, reducesum) \ - hypre_BoxLoop1Begin(ndim, loop_size, dbox1, start1, stride1, i1) +#define hypre_SerialBoxLoop0End() \ + } \ + zypre_BoxLoopInc1(); \ + zypre_BoxLoopInc2(); \ + } \ + } \ +} -#define hypre_BoxLoop1ReductionEnd(i1, reducesum) \ - hypre_BoxLoop1End(i1) +#define hypre_SerialBoxLoop1Begin(ndim, loop_size, \ + dbox1, start1, stride1, i1) \ +{ \ + HYPRE_Int i1; \ + zypre_BoxLoopDeclare(); \ + zypre_BoxLoopDeclareK(1); \ + zypre_BoxLoopInit(ndim, loop_size); \ + zypre_BoxLoopInitK(1, dbox1, start1, stride1, i1); \ + zypre_BoxLoopSetOneBlock(); \ + for (hypre__block = 0; hypre__block < hypre__num_blocks; hypre__block++) \ + { \ + zypre_BoxLoopSet(); \ + zypre_BoxLoopSetK(1, i1); \ + for (hypre__J = 0; hypre__J < hypre__JN; hypre__J++) \ + { \ + for (hypre__I = 0; hypre__I < hypre__IN; hypre__I++) \ + { -#define hypre_BoxLoop2ReductionBegin(ndim, loop_size, dbox1, start1, stride1, i1, \ +#define hypre_SerialBoxLoop1End(i1) zypre_BoxLoop1End(i1) + +#define hypre_SerialBoxLoop2Begin(ndim, loop_size, \ + dbox1, start1, stride1, i1, \ + dbox2, start2, stride2, i2) \ +{ \ + HYPRE_Int i1,i2; \ + zypre_BoxLoopDeclare(); \ + zypre_BoxLoopDeclareK(1); \ + zypre_BoxLoopDeclareK(2); \ + zypre_BoxLoopInit(ndim, loop_size); \ + zypre_BoxLoopInitK(1, dbox1, start1, stride1, i1); \ + zypre_BoxLoopInitK(2, dbox2, start2, stride2, i2); \ + zypre_BoxLoopSetOneBlock(); \ + for (hypre__block = 0; hypre__block < hypre__num_blocks; hypre__block++) \ + { \ + zypre_BoxLoopSet(); \ + zypre_BoxLoopSetK(1, i1); \ + zypre_BoxLoopSetK(2, i2); \ + for (hypre__J = 0; hypre__J < hypre__JN; hypre__J++) \ + { \ + for (hypre__I = 0; hypre__I < hypre__IN; hypre__I++) \ + { + +#define hypre_SerialBoxLoop2End(i1, i2) zypre_BoxLoop2End(i1, i2) + +/* Reduction BoxLoop1 */ +#define zypre_BoxLoop1ReductionBegin(ndim, loop_size, dbox1, start1, stride1, i1, reducesum) \ + zypre_BoxLoop1Begin(ndim, loop_size, dbox1, start1, stride1, i1) + +#define zypre_BoxLoop1ReductionEnd(i1, reducesum) zypre_BoxLoop1End(i1) + +/* Reduction BoxLoop2 */ +#define zypre_BoxLoop2ReductionBegin(ndim, loop_size, dbox1, start1, stride1, i1, \ dbox2, start2, stride2, i2, reducesum) \ - hypre_BoxLoop2Begin(ndim, loop_size, dbox1, start1, stride1, i1, \ + zypre_BoxLoop2Begin(ndim, loop_size, dbox1, start1, stride1, i1, \ dbox2, start2, stride2, i2) -#define hypre_BoxLoop2ReductionEnd(i1, i2, reducesum) \ - hypre_BoxLoop2End(i1, i2) - +#define zypre_BoxLoop2ReductionEnd(i1, i2, reducesum) zypre_BoxLoop2End(i1, i2) + + +/* Renaming */ +#define hypre_BoxLoopGetIndexHost zypre_BoxLoopGetIndex +#define hypre_BoxLoopBlockHost zypre_BoxLoopBlock +#define hypre_BoxLoop0BeginHost zypre_BoxLoop0Begin +#define hypre_BoxLoop0EndHost zypre_BoxLoop0End +#define hypre_BoxLoop1BeginHost zypre_BoxLoop1Begin +#define hypre_BoxLoop1EndHost zypre_BoxLoop1End +#define hypre_BoxLoop2BeginHost zypre_BoxLoop2Begin +#define hypre_BoxLoop2EndHost zypre_BoxLoop2End +#define hypre_BoxLoop3BeginHost zypre_BoxLoop3Begin +#define hypre_BoxLoop3EndHost zypre_BoxLoop3End +#define hypre_BoxLoop4BeginHost zypre_BoxLoop4Begin +#define hypre_BoxLoop4EndHost zypre_BoxLoop4End +#define hypre_BasicBoxLoop1BeginHost zypre_BasicBoxLoop1Begin +#define hypre_BasicBoxLoop2BeginHost zypre_BasicBoxLoop2Begin +#define hypre_LoopBeginHost zypre_LoopBegin +#define hypre_LoopEndHost zypre_LoopEnd +#define hypre_BoxLoop1ReductionBeginHost zypre_BoxLoop1ReductionBegin +#define hypre_BoxLoop1ReductionEndHost zypre_BoxLoop1ReductionEnd +#define hypre_BoxLoop2ReductionBeginHost zypre_BoxLoop2ReductionBegin +#define hypre_BoxLoop2ReductionEndHost zypre_BoxLoop2ReductionEnd + +//TODO TEMP FIX +#if !defined(HYPRE_USING_RAJA) && !defined(HYPRE_USING_KOKKOS) && !defined(HYPRE_USING_CUDA) && !defined(HYPRE_USING_HIP) && !defined(HYPRE_USING_DEVICE_OPENMP) && !defined(HYPRE_USING_SYCL) +#define hypre_BoxLoopGetIndex hypre_BoxLoopGetIndexHost +#define hypre_BoxLoopBlock() 0 +#define hypre_BoxLoop0Begin hypre_BoxLoop0BeginHost +#define hypre_BoxLoop0End hypre_BoxLoop0EndHost +#define hypre_BoxLoop1Begin hypre_BoxLoop1BeginHost +#define hypre_BoxLoop1End hypre_BoxLoop1EndHost +#define hypre_BoxLoop2Begin hypre_BoxLoop2BeginHost +#define hypre_BoxLoop2End hypre_BoxLoop2EndHost +#define hypre_BoxLoop3Begin hypre_BoxLoop3BeginHost +#define hypre_BoxLoop3End hypre_BoxLoop3EndHost +#define hypre_BoxLoop4Begin hypre_BoxLoop4BeginHost +#define hypre_BoxLoop4End hypre_BoxLoop4EndHost +#define hypre_BasicBoxLoop1Begin hypre_BasicBoxLoop1BeginHost +#define hypre_BasicBoxLoop2Begin hypre_BasicBoxLoop2BeginHost +#define hypre_LoopBegin hypre_LoopBeginHost +#define hypre_LoopEnd hypre_LoopEndHost +#define hypre_BoxLoop1ReductionBegin hypre_BoxLoop1ReductionBeginHost +#define hypre_BoxLoop1ReductionEnd hypre_BoxLoop1ReductionEndHost +#define hypre_BoxLoop2ReductionBegin hypre_BoxLoop2ReductionBeginHost +#define hypre_BoxLoop2ReductionEnd hypre_BoxLoop2ReductionEndHost #endif -#endif +#endif /* #ifndef HYPRE_BOXLOOP_HOST_HEADER */ + #ifdef __cplusplus } diff --git a/external/hypre/src/struct_mv/_hypre_struct_mv.hpp b/external/hypre/src/struct_mv/_hypre_struct_mv.hpp index d72e0c8f..839ae009 100644 --- a/external/hypre/src/struct_mv/_hypre_struct_mv.hpp +++ b/external/hypre/src/struct_mv/_hypre_struct_mv.hpp @@ -1,6 +1,7 @@ /*** DO NOT EDIT THIS FILE DIRECTLY (use 'headers' to generate) ***/ + #ifndef hypre_STRUCT_MV_HPP #define hypre_STRUCT_MV_HPP @@ -9,10 +10,8 @@ #ifdef __cplusplus extern "C++" { #endif - -#if defined(HYPRE_USING_RAJA) /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -28,34 +27,39 @@ extern "C++" { * BoxLoop macros: *--------------------------------------------------------------------------*/ -#ifndef HYPRE_NEWBOXLOOP_HEADER -#define HYPRE_NEWBOXLOOP_HEADER +#ifndef HYPRE_BOXLOOP_RAJA_HEADER +#define HYPRE_BOXLOOP_RAJA_HEADER + +#if defined(HYPRE_USING_RAJA) #ifdef __cplusplus -extern "C++" { +extern "C++" +{ #endif #include -using namespace RAJA; + using namespace RAJA; #ifdef __cplusplus } #endif -typedef struct hypre_Boxloop_struct { - HYPRE_Int lsize0, lsize1, lsize2; - HYPRE_Int strides0, strides1, strides2; - HYPRE_Int bstart0, bstart1, bstart2; - HYPRE_Int bsize0, bsize1, bsize2; +typedef struct hypre_Boxloop_struct +{ + HYPRE_Int lsize0, lsize1, lsize2; + HYPRE_Int strides0, strides1, strides2; + HYPRE_Int bstart0, bstart1, bstart2; + HYPRE_Int bsize0, bsize1, bsize2; } hypre_Boxloop; + #if defined(HYPRE_USING_CUDA) /* RAJA with CUDA, running on device */ -#define BLOCKSIZE 256 -#define hypre_RAJA_DEVICE RAJA_DEVICE -#define hypre_raja_exec_policy cuda_exec +#define BLOCKSIZE HYPRE_1D_BLOCK_SIZE +#define hypre_RAJA_DEVICE RAJA_DEVICE +#define hypre_raja_exec_policy cuda_exec /* #define hypre_raja_reduce_policy cuda_reduce_atomic */ -#define hypre_raja_reduce_policy cuda_reduce// +#define hypre_raja_reduce_policy cuda_reduce // #define hypre_fence() /* #define hypre_fence() \ @@ -68,124 +72,147 @@ hypre_CheckErrorDevice(cudaDeviceSynchronize()); #elif defined(HYPRE_USING_DEVICE_OPENMP) /* RAJA with OpenMP (>4.5), running on device */ -//TODO +#define hypre_RAJA_DEVICE +#define hypre_raja_exec_policy omp_target_parallel_for_exec +#define hypre_raja_reduce_policy omp_target_reduce +#define hypre_fence() #elif defined(HYPRE_USING_OPENMP) /* RAJA with OpenMP, running on host (CPU) */ #define hypre_RAJA_DEVICE -#define hypre_raja_exec_policy omp_for_exec +#define hypre_raja_exec_policy omp_for_exec #define hypre_raja_reduce_policy omp_reduce #define hypre_fence() #else /* RAJA, running on host (CPU) */ #define hypre_RAJA_DEVICE -#define hypre_raja_exec_policy seq_exec +#define hypre_raja_exec_policy seq_exec #define hypre_raja_reduce_policy seq_reduce #define hypre_fence() #endif /* #if defined(HYPRE_USING_CUDA) */ -#define zypre_BoxLoopIncK(k, box, hypre__i) \ - HYPRE_Int hypre_boxD##k = 1; \ - HYPRE_Int hypre__i = 0; \ - hypre__i += (hypre_IndexD(local_idx, 0) * box.strides0 + box.bstart0) * hypre_boxD##k; \ - hypre_boxD##k *= hypre_max(0, box.bsize0 + 1); \ - hypre__i += (hypre_IndexD(local_idx, 1) * box.strides1 + box.bstart1) * hypre_boxD##k; \ - hypre_boxD##k *= hypre_max(0, box.bsize1 + 1); \ - hypre__i += (hypre_IndexD(local_idx, 2) * box.strides2 + box.bstart2) * hypre_boxD##k; \ - hypre_boxD##k *= hypre_max(0, box.bsize2 + 1); - -#define zypre_newBoxLoopInit(ndim, loop_size) \ - HYPRE_Int hypre__tot = 1; \ - for (HYPRE_Int d = 0; d < ndim; d++) hypre__tot *= loop_size[d]; - -#define zypre_newBoxLoopDeclare(box) \ - hypre_Index local_idx; \ - HYPRE_Int idx_local = idx; \ - hypre_IndexD(local_idx, 0) = idx_local % box.lsize0; \ - idx_local = idx_local / box.lsize0; \ - hypre_IndexD(local_idx, 1) = idx_local % box.lsize1; \ - idx_local = idx_local / box.lsize1; \ - hypre_IndexD(local_idx, 2) = idx_local % box.lsize2; - -#define zypre_BoxLoopDataDeclareK(k, ndim, loop_size, dbox, start, stride) \ - hypre_Boxloop databox##k; \ - databox##k.lsize0 = loop_size[0]; \ - databox##k.strides0 = stride[0]; \ - databox##k.bstart0 = start[0] - dbox->imin[0]; \ - databox##k.bsize0 = dbox->imax[0] - dbox->imin[0]; \ - if (ndim > 1) { \ - databox##k.lsize1 = loop_size[1]; \ - databox##k.strides1 = stride[1]; \ - databox##k.bstart1 = start[1] - dbox->imin[1]; \ - databox##k.bsize1 = dbox->imax[1] - dbox->imin[1]; \ - } else { \ - databox##k.lsize1 = 1; \ - databox##k.strides1 = 0; \ - databox##k.bstart1 = 0; \ - databox##k.bsize1 = 0; \ - } \ - if (ndim == 3) { \ - databox##k.lsize2 = loop_size[2]; \ - databox##k.strides2 = stride[2]; \ - databox##k.bstart2 = start[2] - dbox->imin[2]; \ - databox##k.bsize2 = dbox->imax[2] - dbox->imin[2]; \ - } else { \ - databox##k.lsize2 = 1; \ - databox##k.strides2 = 0; \ - databox##k.bstart2 = 0; \ - databox##k.bsize2 = 0; \ - } -#define zypre_newBoxLoop0Begin(ndim, loop_size) \ - { \ - zypre_newBoxLoopInit(ndim, loop_size); \ + + +#define zypre_BoxLoopIncK(k,box,hypre__i) \ + HYPRE_Int hypre_boxD##k = 1; \ + HYPRE_Int hypre__i = 0; \ + hypre__i += (hypre_IndexD(local_idx, 0)*box.strides0 + box.bstart0) * hypre_boxD##k; \ + hypre_boxD##k *= hypre_max(0, box.bsize0 + 1); \ + hypre__i += (hypre_IndexD(local_idx, 1)*box.strides1 + box.bstart1) * hypre_boxD##k; \ + hypre_boxD##k *= hypre_max(0, box.bsize1 + 1); \ + hypre__i += (hypre_IndexD(local_idx, 2)*box.strides2 + box.bstart2) * hypre_boxD##k; \ + hypre_boxD##k *= hypre_max(0, box.bsize2 + 1); \ + + +#define zypre_newBoxLoopInit(ndim,loop_size) \ + HYPRE_Int hypre__tot = 1; \ + for (HYPRE_Int d = 0;d < ndim;d ++) \ + hypre__tot *= loop_size[d]; + + +#define zypre_newBoxLoopDeclare(box) \ + hypre_Index local_idx; \ + HYPRE_Int idx_local = idx; \ + hypre_IndexD(local_idx, 0) = idx_local % box.lsize0; \ + idx_local = idx_local / box.lsize0; \ + hypre_IndexD(local_idx, 1) = idx_local % box.lsize1; \ + idx_local = idx_local / box.lsize1; \ + hypre_IndexD(local_idx, 2) = idx_local % box.lsize2; + +#define zypre_BoxLoopDataDeclareK(k,ndim,loop_size,dbox,start,stride) \ + hypre_Boxloop databox##k; \ + databox##k.lsize0 = loop_size[0]; \ + databox##k.strides0 = stride[0]; \ + databox##k.bstart0 = start[0] - dbox->imin[0]; \ + databox##k.bsize0 = dbox->imax[0]-dbox->imin[0]; \ + if (ndim > 1) \ + { \ + databox##k.lsize1 = loop_size[1]; \ + databox##k.strides1 = stride[1]; \ + databox##k.bstart1 = start[1] - dbox->imin[1]; \ + databox##k.bsize1 = dbox->imax[1]-dbox->imin[1]; \ + } \ + else \ + { \ + databox##k.lsize1 = 1; \ + databox##k.strides1 = 0; \ + databox##k.bstart1 = 0; \ + databox##k.bsize1 = 0; \ + } \ + if (ndim == 3) \ + { \ + databox##k.lsize2 = loop_size[2]; \ + databox##k.strides2 = stride[2]; \ + databox##k.bstart2 = start[2] - dbox->imin[2]; \ + databox##k.bsize2 = dbox->imax[2]-dbox->imin[2]; \ + } \ + else \ + { \ + databox##k.lsize2 = 1; \ + databox##k.strides2 = 0; \ + databox##k.bstart2 = 0; \ + databox##k.bsize2 = 0; \ + } + +#define zypre_newBoxLoop0Begin(ndim, loop_size) \ +{ \ + zypre_newBoxLoopInit(ndim,loop_size); \ forall< hypre_raja_exec_policy >(RangeSegment(0, hypre__tot), [=] hypre_RAJA_DEVICE (HYPRE_Int idx) \ { -#define zypre_newBoxLoop0End() \ - }); \ - hypre_fence(); \ - } -#define zypre_newBoxLoop1Begin(ndim, loop_size, dbox1, start1, stride1, i1) \ - { \ - zypre_newBoxLoopInit(ndim, loop_size); \ - zypre_BoxLoopDataDeclareK(1, ndim, loop_size, dbox1, start1, stride1); \ +#define zypre_newBoxLoop0End() \ + }); \ + hypre_fence(); \ +} + +#define zypre_newBoxLoop1Begin(ndim, loop_size, \ + dbox1, start1, stride1, i1) \ +{ \ + zypre_newBoxLoopInit(ndim,loop_size); \ + zypre_BoxLoopDataDeclareK(1,ndim,loop_size,dbox1,start1,stride1); \ forall< hypre_raja_exec_policy >(RangeSegment(0, hypre__tot), [=] hypre_RAJA_DEVICE (HYPRE_Int idx) \ { \ zypre_newBoxLoopDeclare(databox1); \ zypre_BoxLoopIncK(1,databox1,i1); -#define zypre_newBoxLoop1End(i1) \ - }); \ - hypre_fence(); \ - } -#define zypre_newBoxLoop2Begin(ndim, loop_size, dbox1, start1, stride1, i1, dbox2, start2, stride2, i2) \ - { \ - zypre_newBoxLoopInit(ndim, loop_size); \ - zypre_BoxLoopDataDeclareK(1, ndim, loop_size, dbox1, start1, stride1); \ - zypre_BoxLoopDataDeclareK(2, ndim, loop_size, dbox2, start2, stride2); \ +#define zypre_newBoxLoop1End(i1) \ + }); \ + hypre_fence(); \ +} + +#define zypre_newBoxLoop2Begin(ndim, loop_size, \ + dbox1, start1, stride1, i1, \ + dbox2, start2, stride2, i2) \ +{ \ + zypre_newBoxLoopInit(ndim,loop_size); \ + zypre_BoxLoopDataDeclareK(1,ndim,loop_size,dbox1,start1,stride1); \ + zypre_BoxLoopDataDeclareK(2,ndim,loop_size,dbox2,start2,stride2); \ forall< hypre_raja_exec_policy >(RangeSegment(0, hypre__tot), [=] hypre_RAJA_DEVICE (HYPRE_Int idx) \ { \ zypre_newBoxLoopDeclare(databox1); \ zypre_BoxLoopIncK(1,databox1,i1); \ zypre_BoxLoopIncK(2,databox2,i2); -#define zypre_newBoxLoop2End(i1, i2) \ - }); \ - hypre_fence(); \ - } -#define zypre_newBoxLoop3Begin(ndim, loop_size, dbox1, start1, stride1, i1, dbox2, start2, stride2, i2, \ - dbox3, start3, stride3, i3) \ - { \ - zypre_newBoxLoopInit(ndim, loop_size); \ - zypre_BoxLoopDataDeclareK(1, ndim, loop_size, dbox1, start1, stride1); \ - zypre_BoxLoopDataDeclareK(2, ndim, loop_size, dbox2, start2, stride2); \ - zypre_BoxLoopDataDeclareK(3, ndim, loop_size, dbox3, start3, stride3); \ +#define zypre_newBoxLoop2End(i1, i2) \ + }); \ + hypre_fence(); \ +} + +#define zypre_newBoxLoop3Begin(ndim, loop_size, \ + dbox1, start1, stride1, i1, \ + dbox2, start2, stride2, i2, \ + dbox3, start3, stride3, i3) \ +{ \ + zypre_newBoxLoopInit(ndim,loop_size); \ + zypre_BoxLoopDataDeclareK(1,ndim,loop_size,dbox1,start1,stride1); \ + zypre_BoxLoopDataDeclareK(2,ndim,loop_size,dbox2,start2,stride2); \ + zypre_BoxLoopDataDeclareK(3,ndim,loop_size,dbox3,start3,stride3); \ forall< hypre_raja_exec_policy >(RangeSegment(0, hypre__tot), [=] hypre_RAJA_DEVICE (HYPRE_Int idx) \ { \ zypre_newBoxLoopDeclare(databox1); \ @@ -193,19 +220,22 @@ hypre_CheckErrorDevice(cudaDeviceSynchronize()); zypre_BoxLoopIncK(2,databox2,i2); \ zypre_BoxLoopIncK(3,databox3,i3); -#define zypre_newBoxLoop3End(i1, i2, i3) \ - }); \ - hypre_fence(); \ - } +#define zypre_newBoxLoop3End(i1, i2, i3) \ + }); \ + hypre_fence(); \ +} -#define zypre_newBoxLoop4Begin(ndim, loop_size, dbox1, start1, stride1, i1, dbox2, start2, stride2, i2, \ - dbox3, start3, stride3, i3, dbox4, start4, stride4, i4) \ - { \ - zypre_newBoxLoopInit(ndim, loop_size); \ - zypre_BoxLoopDataDeclareK(1, ndim, loop_size, dbox1, start1, stride1); \ - zypre_BoxLoopDataDeclareK(2, ndim, loop_size, dbox2, start2, stride2); \ - zypre_BoxLoopDataDeclareK(3, ndim, loop_size, dbox3, start3, stride3); \ - zypre_BoxLoopDataDeclareK(4, ndim, loop_size, dbox4, start4, stride4); \ +#define zypre_newBoxLoop4Begin(ndim, loop_size, \ + dbox1, start1, stride1, i1, \ + dbox2, start2, stride2, i2, \ + dbox3, start3, stride3, i3, \ + dbox4, start4, stride4, i4) \ +{ \ + zypre_newBoxLoopInit(ndim,loop_size); \ + zypre_BoxLoopDataDeclareK(1,ndim,loop_size,dbox1,start1,stride1); \ + zypre_BoxLoopDataDeclareK(2,ndim,loop_size,dbox2,start2,stride2); \ + zypre_BoxLoopDataDeclareK(3,ndim,loop_size,dbox3,start3,stride3); \ + zypre_BoxLoopDataDeclareK(4,ndim,loop_size,dbox4,start4,stride4); \ forall< hypre_raja_exec_policy >(RangeSegment(0, hypre__tot), [=] hypre_RAJA_DEVICE (HYPRE_Int idx) \ { \ zypre_newBoxLoopDeclare(databox1); \ @@ -214,103 +244,115 @@ hypre_CheckErrorDevice(cudaDeviceSynchronize()); zypre_BoxLoopIncK(3,databox3,i3); \ zypre_BoxLoopIncK(4,databox4,i4); -#define zypre_newBoxLoop4End(i1, i2, i3, i4) \ - }); \ - hypre_fence(); \ - } - -#define zypre_BasicBoxLoopDataDeclareK(k, ndim, loop_size, stride) \ - hypre_Boxloop databox##k; \ - databox##k.lsize0 = loop_size[0]; \ - databox##k.strides0 = stride[0]; \ - databox##k.bstart0 = 0; \ - databox##k.bsize0 = 0; \ - if (ndim > 1) { \ - databox##k.lsize1 = loop_size[1]; \ - databox##k.strides1 = stride[1]; \ - databox##k.bstart1 = 0; \ - databox##k.bsize1 = 0; \ - } else { \ - databox##k.lsize1 = 1; \ - databox##k.strides1 = 0; \ - databox##k.bstart1 = 0; \ - databox##k.bsize1 = 0; \ - } \ - if (ndim == 3) { \ - databox##k.lsize2 = loop_size[2]; \ - databox##k.strides2 = stride[2]; \ - databox##k.bstart2 = 0; \ - databox##k.bsize2 = 0; \ - } else { \ - databox##k.lsize2 = 1; \ - databox##k.strides2 = 0; \ - databox##k.bstart2 = 0; \ - databox##k.bsize2 = 0; \ - } +#define zypre_newBoxLoop4End(i1, i2, i3, i4) \ + }); \ + hypre_fence(); \ +} -#define zypre_newBasicBoxLoop2Begin(ndim, loop_size, stride1, i1, stride2, i2) \ - { \ - zypre_newBoxLoopInit(ndim, loop_size); \ - zypre_BasicBoxLoopDataDeclareK(1, ndim, loop_size, stride1); \ - zypre_BasicBoxLoopDataDeclareK(2, ndim, loop_size, stride2); \ +#define zypre_BasicBoxLoopDataDeclareK(k,ndim,loop_size,stride) \ + hypre_Boxloop databox##k; \ + databox##k.lsize0 = loop_size[0]; \ + databox##k.strides0 = stride[0]; \ + databox##k.bstart0 = 0; \ + databox##k.bsize0 = 0; \ + if (ndim > 1) \ + { \ + databox##k.lsize1 = loop_size[1]; \ + databox##k.strides1 = stride[1]; \ + databox##k.bstart1 = 0; \ + databox##k.bsize1 = 0; \ + } \ + else \ + { \ + databox##k.lsize1 = 1; \ + databox##k.strides1 = 0; \ + databox##k.bstart1 = 0; \ + databox##k.bsize1 = 0; \ + } \ + if (ndim == 3) \ + { \ + databox##k.lsize2 = loop_size[2]; \ + databox##k.strides2 = stride[2]; \ + databox##k.bstart2 = 0; \ + databox##k.bsize2 = 0; \ + } \ + else \ + { \ + databox##k.lsize2 = 1; \ + databox##k.strides2 = 0; \ + databox##k.bstart2 = 0; \ + databox##k.bsize2 = 0; \ + } + +#define zypre_newBasicBoxLoop2Begin(ndim, loop_size, \ + stride1, i1, \ + stride2, i2) \ +{ \ + zypre_newBoxLoopInit(ndim,loop_size); \ + zypre_BasicBoxLoopDataDeclareK(1,ndim,loop_size,stride1); \ + zypre_BasicBoxLoopDataDeclareK(2,ndim,loop_size,stride2); \ forall< hypre_raja_exec_policy >(RangeSegment(0, hypre__tot), [=] hypre_RAJA_DEVICE (HYPRE_Int idx) \ { \ zypre_newBoxLoopDeclare(databox1); \ zypre_BoxLoopIncK(1,databox1,i1); \ - zypre_BoxLoopIncK(2,databox2,i2); + zypre_BoxLoopIncK(2,databox2,i2); \ -#define hypre_LoopBegin(size, idx) \ - { \ +#define hypre_LoopBegin(size,idx) \ +{ \ forall< hypre_raja_exec_policy >(RangeSegment(0, size), [=] hypre_RAJA_DEVICE (HYPRE_Int idx) \ { -#define hypre_LoopEnd() \ - }); \ - hypre_fence(); \ - } +#define hypre_LoopEnd() \ + }); \ + hypre_fence(); \ +} -#define hypre_newBoxLoopGetIndex(index) \ - index[0] = hypre_IndexD(local_idx, 0); \ - index[1] = hypre_IndexD(local_idx, 1); \ - index[2] = hypre_IndexD(local_idx, 2); - -#define hypre_BoxLoopBlock() 0 -#define hypre_BoxLoop0Begin zypre_newBoxLoop0Begin -#define hypre_BoxLoop0For zypre_newBoxLoop0For -#define hypre_BoxLoop0End zypre_newBoxLoop0End -#define hypre_BoxLoop1Begin zypre_newBoxLoop1Begin -#define hypre_BoxLoop1For zypre_newBoxLoop1For -#define hypre_BoxLoop1End zypre_newBoxLoop1End -#define hypre_BoxLoop2Begin zypre_newBoxLoop2Begin -#define hypre_BoxLoop2For zypre_newBoxLoop2For -#define hypre_BoxLoop2End zypre_newBoxLoop2End -#define hypre_BoxLoop3Begin zypre_newBoxLoop3Begin -#define hypre_BoxLoop3For zypre_newBoxLoop3For -#define hypre_BoxLoop3End zypre_newBoxLoop3End -#define hypre_BoxLoop4Begin zypre_newBoxLoop4Begin -#define hypre_BoxLoop4For zypre_newBoxLoop4For -#define hypre_BoxLoop4End zypre_newBoxLoop4End -#define hypre_newBoxLoopInit zypre_newBoxLoopInit +#define hypre_BoxLoopGetIndex(index) \ + index[0] = hypre_IndexD(local_idx, 0); \ + index[1] = hypre_IndexD(local_idx, 1); \ + index[2] = hypre_IndexD(local_idx, 2); + +#define hypre_BoxLoopBlock() 0 +#define hypre_BoxLoop0Begin zypre_newBoxLoop0Begin +#define hypre_BoxLoop0For zypre_newBoxLoop0For +#define hypre_BoxLoop0End zypre_newBoxLoop0End +#define hypre_BoxLoop1Begin zypre_newBoxLoop1Begin +#define hypre_BoxLoop1For zypre_newBoxLoop1For +#define hypre_BoxLoop1End zypre_newBoxLoop1End +#define hypre_BoxLoop2Begin zypre_newBoxLoop2Begin +#define hypre_BoxLoop2For zypre_newBoxLoop2For +#define hypre_BoxLoop2End zypre_newBoxLoop2End +#define hypre_BoxLoop3Begin zypre_newBoxLoop3Begin +#define hypre_BoxLoop3For zypre_newBoxLoop3For +#define hypre_BoxLoop3End zypre_newBoxLoop3End +#define hypre_BoxLoop4Begin zypre_newBoxLoop4Begin +#define hypre_BoxLoop4For zypre_newBoxLoop4For +#define hypre_BoxLoop4End zypre_newBoxLoop4End +#define hypre_newBoxLoopInit zypre_newBoxLoopInit #define hypre_BasicBoxLoop2Begin zypre_newBasicBoxLoop2Begin /* Reduction */ -#define hypre_BoxLoop1ReductionBegin(ndim, loop_size, dbox1, start1, stride1, i1, reducesum) \ - hypre_BoxLoop1Begin(ndim, loop_size, dbox1, start1, stride1, i1) +#define hypre_BoxLoop1ReductionBegin(ndim, loop_size, dbox1, start1, stride1, i1, reducesum) \ + hypre_BoxLoop1Begin(ndim, loop_size, dbox1, start1, stride1, i1) -#define hypre_BoxLoop1ReductionEnd(i1, reducesum) hypre_BoxLoop1End(i1) +#define hypre_BoxLoop1ReductionEnd(i1, reducesum) \ + hypre_BoxLoop1End(i1) -#define hypre_BoxLoop2ReductionBegin(ndim, loop_size, dbox1, start1, stride1, i1, dbox2, start2, stride2, \ - i2, reducesum) \ - hypre_BoxLoop2Begin(ndim, loop_size, dbox1, start1, stride1, i1, dbox2, start2, stride2, i2) +#define hypre_BoxLoop2ReductionBegin(ndim, loop_size, dbox1, start1, stride1, i1, \ + dbox2, start2, stride2, i2, reducesum) \ + hypre_BoxLoop2Begin(ndim, loop_size, dbox1, start1, stride1, i1, \ + dbox2, start2, stride2, i2) -#define hypre_BoxLoop2ReductionEnd(i1, i2, reducesum) hypre_BoxLoop2End(i1, i2) +#define hypre_BoxLoop2ReductionEnd(i1, i2, reducesum) \ + hypre_BoxLoop2End(i1, i2) #endif -#elif defined(HYPRE_USING_KOKKOS) +#endif /* #ifndef HYPRE_BOXLOOP_RAJA_HEADER */ + /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -326,31 +368,36 @@ hypre_CheckErrorDevice(cudaDeviceSynchronize()); * BoxLoop macros: *--------------------------------------------------------------------------*/ -#ifndef HYPRE_NEWBOXLOOP_HEADER -#define HYPRE_NEWBOXLOOP_HEADER +#ifndef HYPRE_BOXLOOP_KOKKOS_HEADER +#define HYPRE_BOXLOOP_KOKKOS_HEADER + +#if defined(HYPRE_USING_KOKKOS) #ifdef __cplusplus -extern "C++" { +extern "C++" +{ #endif #include -using namespace Kokkos; + using namespace Kokkos; #ifdef __cplusplus } #endif -#if defined(KOKKOS_HAVE_MPI) +#if defined( KOKKOS_HAVE_MPI ) #include #endif -typedef struct hypre_Boxloop_struct { - HYPRE_Int lsize0, lsize1, lsize2; - HYPRE_Int strides0, strides1, strides2; - HYPRE_Int bstart0, bstart1, bstart2; - HYPRE_Int bsize0, bsize1, bsize2; +typedef struct hypre_Boxloop_struct +{ + HYPRE_Int lsize0, lsize1, lsize2; + HYPRE_Int strides0, strides1, strides2; + HYPRE_Int bstart0, bstart1, bstart2; + HYPRE_Int bsize0, bsize1, bsize2; } hypre_Boxloop; + #define hypre_fence() /* #define hypre_fence() \ @@ -361,106 +408,125 @@ typedef struct hypre_Boxloop_struct { hypre_CheckErrorDevice(cudaDeviceSynchronize()); */ -#define hypre_newBoxLoopInit(ndim, loop_size) \ - HYPRE_Int hypre__tot = 1; \ - for (HYPRE_Int d = 0; d < ndim; d++) hypre__tot *= loop_size[d]; - -#define hypre_BoxLoopIncK(k, box, hypre__i) \ - HYPRE_Int hypre_boxD##k = 1; \ - HYPRE_Int hypre__i = 0; \ - hypre__i += (hypre_IndexD(local_idx, 0) * box.strides0 + box.bstart0) * hypre_boxD##k; \ - hypre_boxD##k *= hypre_max(0, box.bsize0 + 1); \ - hypre__i += (hypre_IndexD(local_idx, 1) * box.strides1 + box.bstart1) * hypre_boxD##k; \ - hypre_boxD##k *= hypre_max(0, box.bsize1 + 1); \ - hypre__i += (hypre_IndexD(local_idx, 2) * box.strides2 + box.bstart2) * hypre_boxD##k; \ - hypre_boxD##k *= hypre_max(0, box.bsize2 + 1); - -#define hypre_newBoxLoopDeclare(box) \ - hypre_Index local_idx; \ - HYPRE_Int idx_local = idx; \ - hypre_IndexD(local_idx, 0) = idx_local % box.lsize0; \ - idx_local = idx_local / box.lsize0; \ - hypre_IndexD(local_idx, 1) = idx_local % box.lsize1; \ - idx_local = idx_local / box.lsize1; \ - hypre_IndexD(local_idx, 2) = idx_local % box.lsize2; - -#define hypre_BoxLoopDataDeclareK(k, ndim, loop_size, dbox, start, stride) \ - hypre_Boxloop databox##k; \ - databox##k.lsize0 = loop_size[0]; \ - databox##k.strides0 = stride[0]; \ - databox##k.bstart0 = start[0] - dbox->imin[0]; \ - databox##k.bsize0 = dbox->imax[0] - dbox->imin[0]; \ - if (ndim > 1) { \ - databox##k.lsize1 = loop_size[1]; \ - databox##k.strides1 = stride[1]; \ - databox##k.bstart1 = start[1] - dbox->imin[1]; \ - databox##k.bsize1 = dbox->imax[1] - dbox->imin[1]; \ - } else { \ - databox##k.lsize1 = 1; \ - databox##k.strides1 = 0; \ - databox##k.bstart1 = 0; \ - databox##k.bsize1 = 0; \ - } \ - if (ndim == 3) { \ - databox##k.lsize2 = loop_size[2]; \ - databox##k.strides2 = stride[2]; \ - databox##k.bstart2 = start[2] - dbox->imin[2]; \ - databox##k.bsize2 = dbox->imax[2] - dbox->imin[2]; \ - } else { \ - databox##k.lsize2 = 1; \ - databox##k.strides2 = 0; \ - databox##k.bstart2 = 0; \ - databox##k.bsize2 = 0; \ - } -#define hypre_newBoxLoop0Begin(ndim, loop_size) \ - { \ - hypre_newBoxLoopInit(ndim, loop_size); \ +#define hypre_newBoxLoopInit(ndim,loop_size) \ + HYPRE_Int hypre__tot = 1; \ + for (HYPRE_Int d = 0;d < ndim;d ++) \ + hypre__tot *= loop_size[d]; + + +#define hypre_BoxLoopIncK(k,box,hypre__i) \ + HYPRE_Int hypre_boxD##k = 1; \ + HYPRE_Int hypre__i = 0; \ + hypre__i += (hypre_IndexD(local_idx, 0)*box.strides0 + box.bstart0) * hypre_boxD##k; \ + hypre_boxD##k *= hypre_max(0, box.bsize0 + 1); \ + hypre__i += (hypre_IndexD(local_idx, 1)*box.strides1 + box.bstart1) * hypre_boxD##k; \ + hypre_boxD##k *= hypre_max(0, box.bsize1 + 1); \ + hypre__i += (hypre_IndexD(local_idx, 2)*box.strides2 + box.bstart2) * hypre_boxD##k; \ + hypre_boxD##k *= hypre_max(0, box.bsize2 + 1); \ + +#define hypre_newBoxLoopDeclare(box) \ + hypre_Index local_idx; \ + HYPRE_Int idx_local = idx; \ + hypre_IndexD(local_idx, 0) = idx_local % box.lsize0; \ + idx_local = idx_local / box.lsize0; \ + hypre_IndexD(local_idx, 1) = idx_local % box.lsize1; \ + idx_local = idx_local / box.lsize1; \ + hypre_IndexD(local_idx, 2) = idx_local % box.lsize2; + +#define hypre_BoxLoopDataDeclareK(k,ndim,loop_size,dbox,start,stride) \ + hypre_Boxloop databox##k; \ + databox##k.lsize0 = loop_size[0]; \ + databox##k.strides0 = stride[0]; \ + databox##k.bstart0 = start[0] - dbox->imin[0]; \ + databox##k.bsize0 = dbox->imax[0]-dbox->imin[0]; \ + if (ndim > 1) \ + { \ + databox##k.lsize1 = loop_size[1]; \ + databox##k.strides1 = stride[1]; \ + databox##k.bstart1 = start[1] - dbox->imin[1]; \ + databox##k.bsize1 = dbox->imax[1]-dbox->imin[1]; \ + } \ + else \ + { \ + databox##k.lsize1 = 1; \ + databox##k.strides1 = 0; \ + databox##k.bstart1 = 0; \ + databox##k.bsize1 = 0; \ + } \ + if (ndim == 3) \ + { \ + databox##k.lsize2 = loop_size[2]; \ + databox##k.strides2 = stride[2]; \ + databox##k.bstart2 = start[2] - dbox->imin[2]; \ + databox##k.bsize2 = dbox->imax[2]-dbox->imin[2]; \ + } \ + else \ + { \ + databox##k.lsize2 = 1; \ + databox##k.strides2 = 0; \ + databox##k.bstart2 = 0; \ + databox##k.bsize2 = 0; \ + } + +#define hypre_newBoxLoop0Begin(ndim, loop_size) \ +{ \ + hypre_newBoxLoopInit(ndim,loop_size); \ Kokkos::parallel_for (hypre__tot, KOKKOS_LAMBDA (HYPRE_Int idx) \ { -#define hypre_newBoxLoop0End(i1) \ - }); \ - hypre_fence(); \ - } -#define hypre_newBoxLoop1Begin(ndim, loop_size, dbox1, start1, stride1, i1) \ - { \ - hypre_newBoxLoopInit(ndim, loop_size) \ - hypre_BoxLoopDataDeclareK(1, ndim, loop_size, dbox1, start1, stride1); \ +#define hypre_newBoxLoop0End(i1) \ + }); \ + hypre_fence(); \ +} + + +#define hypre_newBoxLoop1Begin(ndim, loop_size, \ + dbox1, start1, stride1, i1) \ +{ \ + hypre_newBoxLoopInit(ndim,loop_size) \ + hypre_BoxLoopDataDeclareK(1,ndim,loop_size,dbox1,start1,stride1); \ Kokkos::parallel_for (hypre__tot, KOKKOS_LAMBDA (HYPRE_Int idx) \ { \ hypre_newBoxLoopDeclare(databox1); \ hypre_BoxLoopIncK(1,databox1,i1); -#define hypre_newBoxLoop1End(i1) \ - }); \ - hypre_fence(); \ - } -#define hypre_newBoxLoop2Begin(ndim, loop_size, dbox1, start1, stride1, i1, dbox2, start2, stride2, i2) \ - { \ - hypre_newBoxLoopInit(ndim, loop_size); \ - hypre_BoxLoopDataDeclareK(1, ndim, loop_size, dbox1, start1, stride1); \ - hypre_BoxLoopDataDeclareK(2, ndim, loop_size, dbox2, start2, stride2); \ +#define hypre_newBoxLoop1End(i1) \ + }); \ + hypre_fence(); \ + } + + +#define hypre_newBoxLoop2Begin(ndim, loop_size, \ + dbox1, start1, stride1, i1, \ + dbox2, start2, stride2, i2) \ +{ \ + hypre_newBoxLoopInit(ndim,loop_size); \ + hypre_BoxLoopDataDeclareK(1,ndim,loop_size,dbox1,start1,stride1); \ + hypre_BoxLoopDataDeclareK(2,ndim,loop_size,dbox2,start2,stride2); \ Kokkos::parallel_for (hypre__tot, KOKKOS_LAMBDA (HYPRE_Int idx) \ { \ hypre_newBoxLoopDeclare(databox1) \ hypre_BoxLoopIncK(1,databox1,i1); \ hypre_BoxLoopIncK(2,databox2,i2); -#define hypre_newBoxLoop2End(i1, i2) \ - }); \ - hypre_fence(); \ - } +#define hypre_newBoxLoop2End(i1, i2) \ + }); \ + hypre_fence(); \ +} -#define hypre_newBoxLoop3Begin(ndim, loop_size, dbox1, start1, stride1, i1, dbox2, start2, stride2, i2, \ - dbox3, start3, stride3, i3) \ - { \ - hypre_newBoxLoopInit(ndim, loop_size); \ - hypre_BoxLoopDataDeclareK(1, ndim, loop_size, dbox1, start1, stride1); \ - hypre_BoxLoopDataDeclareK(2, ndim, loop_size, dbox2, start2, stride2); \ - hypre_BoxLoopDataDeclareK(3, ndim, loop_size, dbox3, start3, stride3); \ + +#define hypre_newBoxLoop3Begin(ndim, loop_size, \ + dbox1, start1, stride1, i1, \ + dbox2, start2, stride2, i2, \ + dbox3, start3, stride3, i3) \ +{ \ + hypre_newBoxLoopInit(ndim,loop_size); \ + hypre_BoxLoopDataDeclareK(1,ndim,loop_size,dbox1,start1,stride1); \ + hypre_BoxLoopDataDeclareK(2,ndim,loop_size,dbox2,start2,stride2); \ + hypre_BoxLoopDataDeclareK(3,ndim,loop_size,dbox3,start3,stride3); \ Kokkos::parallel_for (hypre__tot, KOKKOS_LAMBDA (HYPRE_Int idx) \ { \ hypre_newBoxLoopDeclare(databox1); \ @@ -468,19 +534,22 @@ typedef struct hypre_Boxloop_struct { hypre_BoxLoopIncK(2,databox2,i2); \ hypre_BoxLoopIncK(3,databox3,i3); -#define hypre_newBoxLoop3End(i1, i2, i3) \ - }); \ - hypre_fence(); \ - } +#define hypre_newBoxLoop3End(i1, i2, i3) \ + }); \ + hypre_fence(); \ +} -#define hypre_newBoxLoop4Begin(ndim, loop_size, dbox1, start1, stride1, i1, dbox2, start2, stride2, i2, \ - dbox3, start3, stride3, i3, dbox4, start4, stride4, i4) \ - { \ - hypre_newBoxLoopInit(ndim, loop_size); \ - hypre_BoxLoopDataDeclareK(1, ndim, loop_size, dbox1, start1, stride1); \ - hypre_BoxLoopDataDeclareK(2, ndim, loop_size, dbox2, start2, stride2); \ - hypre_BoxLoopDataDeclareK(3, ndim, loop_size, dbox3, start3, stride3); \ - hypre_BoxLoopDataDeclareK(4, ndim, loop_size, dbox4, start4, stride4); \ +#define hypre_newBoxLoop4Begin(ndim, loop_size, \ + dbox1, start1, stride1, i1, \ + dbox2, start2, stride2, i2, \ + dbox3, start3, stride3, i3, \ + dbox4, start4, stride4, i4) \ +{ \ + hypre_newBoxLoopInit(ndim,loop_size); \ + hypre_BoxLoopDataDeclareK(1,ndim,loop_size,dbox1,start1,stride1); \ + hypre_BoxLoopDataDeclareK(2,ndim,loop_size,dbox2,start2,stride2); \ + hypre_BoxLoopDataDeclareK(3,ndim,loop_size,dbox3,start3,stride3); \ + hypre_BoxLoopDataDeclareK(4,ndim,loop_size,dbox4,start4,stride4); \ Kokkos::parallel_for (hypre__tot, KOKKOS_LAMBDA (HYPRE_Int idx) \ { \ hypre_newBoxLoopDeclare(databox1); \ @@ -489,99 +558,114 @@ typedef struct hypre_Boxloop_struct { hypre_BoxLoopIncK(3,databox3,i3); \ hypre_BoxLoopIncK(4,databox4,i4); -#define hypre_newBoxLoop4End(i1, i2, i3, i4) \ - }); \ - hypre_fence(); \ - } -#define hypre_BasicBoxLoopDataDeclareK(k, ndim, loop_size, stride) \ - hypre_Boxloop databox##k; \ - databox##k.lsize0 = loop_size[0]; \ - databox##k.strides0 = stride[0]; \ - databox##k.bstart0 = 0; \ - databox##k.bsize0 = 0; \ - if (ndim > 1) { \ - databox##k.lsize1 = loop_size[1]; \ - databox##k.strides1 = stride[1]; \ - databox##k.bstart1 = 0; \ - databox##k.bsize1 = 0; \ - } else { \ - databox##k.lsize1 = 1; \ - databox##k.strides1 = 0; \ - databox##k.bstart1 = 0; \ - databox##k.bsize1 = 0; \ - } \ - if (ndim == 3) { \ - databox##k.lsize2 = loop_size[2]; \ - databox##k.strides2 = stride[2]; \ - databox##k.bstart2 = 0; \ - databox##k.bsize2 = 0; \ - } else { \ - databox##k.lsize2 = 1; \ - databox##k.strides2 = 0; \ - databox##k.bstart2 = 0; \ - databox##k.bsize2 = 0; \ - } +#define hypre_newBoxLoop4End(i1, i2, i3, i4) \ + }); \ + hypre_fence(); \ +} -#define hypre_newBasicBoxLoop2Begin(ndim, loop_size, stride1, i1, stride2, i2) \ - { \ - hypre_newBoxLoopInit(ndim, loop_size); \ - hypre_BasicBoxLoopDataDeclareK(1, ndim, loop_size, stride1); \ - hypre_BasicBoxLoopDataDeclareK(2, ndim, loop_size, stride2); \ +#define hypre_BasicBoxLoopDataDeclareK(k,ndim,loop_size,stride) \ + hypre_Boxloop databox##k; \ + databox##k.lsize0 = loop_size[0]; \ + databox##k.strides0 = stride[0]; \ + databox##k.bstart0 = 0; \ + databox##k.bsize0 = 0; \ + if (ndim > 1) \ + { \ + databox##k.lsize1 = loop_size[1]; \ + databox##k.strides1 = stride[1]; \ + databox##k.bstart1 = 0; \ + databox##k.bsize1 = 0; \ + } \ + else \ + { \ + databox##k.lsize1 = 1; \ + databox##k.strides1 = 0; \ + databox##k.bstart1 = 0; \ + databox##k.bsize1 = 0; \ + } \ + if (ndim == 3) \ + { \ + databox##k.lsize2 = loop_size[2]; \ + databox##k.strides2 = stride[2]; \ + databox##k.bstart2 = 0; \ + databox##k.bsize2 = 0; \ + } \ + else \ + { \ + databox##k.lsize2 = 1; \ + databox##k.strides2 = 0; \ + databox##k.bstart2 = 0; \ + databox##k.bsize2 = 0; \ + } + +#define hypre_newBasicBoxLoop2Begin(ndim, loop_size, \ + stride1, i1, \ + stride2, i2) \ +{ \ + hypre_newBoxLoopInit(ndim,loop_size); \ + hypre_BasicBoxLoopDataDeclareK(1,ndim,loop_size,stride1); \ + hypre_BasicBoxLoopDataDeclareK(2,ndim,loop_size,stride2); \ Kokkos::parallel_for (hypre__tot, KOKKOS_LAMBDA (HYPRE_Int idx) \ { \ hypre_newBoxLoopDeclare(databox1); \ hypre_BoxLoopIncK(1,databox1,i1); \ - hypre_BoxLoopIncK(2,databox2,i2); + hypre_BoxLoopIncK(2,databox2,i2); \ -#define hypre_BoxLoop1ReductionBegin(ndim, loop_size, dbox1, start1, stride1, i1, HYPRE_BOX_REDUCTION) \ - { \ - HYPRE_Real __hypre_sum_tmp = HYPRE_BOX_REDUCTION; \ - HYPRE_BOX_REDUCTION = 0.0; \ - hypre_newBoxLoopInit(ndim, loop_size); \ - hypre_BoxLoopDataDeclareK(1, ndim, loop_size, dbox1, start1, stride1); \ +#define hypre_BoxLoop1ReductionBegin(ndim, loop_size, \ + dbox1, start1, stride1, i1, \ + HYPRE_BOX_REDUCTION) \ + { \ + HYPRE_Real __hypre_sum_tmp = HYPRE_BOX_REDUCTION; \ + HYPRE_BOX_REDUCTION = 0.0; \ + hypre_newBoxLoopInit(ndim,loop_size); \ + hypre_BoxLoopDataDeclareK(1,ndim,loop_size,dbox1,start1,stride1); \ Kokkos::parallel_reduce (hypre__tot, KOKKOS_LAMBDA (HYPRE_Int idx, \ HYPRE_Real &HYPRE_BOX_REDUCTION) \ { \ hypre_newBoxLoopDeclare(databox1); \ - hypre_BoxLoopIncK(1,databox1,i1); - -#define hypre_BoxLoop1ReductionEnd(i1, HYPRE_BOX_REDUCTION) \ - }, HYPRE_BOX_REDUCTION); \ - hypre_fence(); \ - HYPRE_BOX_REDUCTION += __hypre_sum_tmp; \ - } - -#define hypre_BoxLoop2ReductionBegin(ndim, loop_size, dbox1, start1, stride1, i1, dbox2, start2, stride2, \ - i2, HYPRE_BOX_REDUCTION) \ - { \ - HYPRE_Real __hypre_sum_tmp = HYPRE_BOX_REDUCTION; \ - HYPRE_BOX_REDUCTION = 0.0; \ - hypre_newBoxLoopInit(ndim, loop_size); \ - hypre_BoxLoopDataDeclareK(1, ndim, loop_size, dbox1, start1, stride1); \ - hypre_BoxLoopDataDeclareK(2, ndim, loop_size, dbox2, start2, stride2); \ + hypre_BoxLoopIncK(1,databox1,i1); \ + + + +#define hypre_BoxLoop1ReductionEnd(i1, HYPRE_BOX_REDUCTION) \ + }, HYPRE_BOX_REDUCTION); \ + hypre_fence(); \ + HYPRE_BOX_REDUCTION += __hypre_sum_tmp; \ + } + +#define hypre_BoxLoop2ReductionBegin(ndim, loop_size, \ + dbox1, start1, stride1, i1, \ + dbox2, start2, stride2, i2, \ + HYPRE_BOX_REDUCTION) \ + { \ + HYPRE_Real __hypre_sum_tmp = HYPRE_BOX_REDUCTION; \ + HYPRE_BOX_REDUCTION = 0.0; \ + hypre_newBoxLoopInit(ndim,loop_size); \ + hypre_BoxLoopDataDeclareK(1,ndim,loop_size,dbox1,start1,stride1); \ + hypre_BoxLoopDataDeclareK(2,ndim,loop_size,dbox2,start2,stride2); \ Kokkos::parallel_reduce (hypre__tot, KOKKOS_LAMBDA (HYPRE_Int idx, \ HYPRE_Real &HYPRE_BOX_REDUCTION) \ { \ hypre_newBoxLoopDeclare(databox1); \ hypre_BoxLoopIncK(1,databox1,i1); \ - hypre_BoxLoopIncK(2,databox2,i2); + hypre_BoxLoopIncK(2,databox2,i2); \ -#define hypre_BoxLoop2ReductionEnd(i1, i2, HYPRE_BOX_REDUCTION) \ - }, HYPRE_BOX_REDUCTION); \ - hypre_fence(); \ - HYPRE_BOX_REDUCTION += __hypre_sum_tmp; \ - } +#define hypre_BoxLoop2ReductionEnd(i1, i2, HYPRE_BOX_REDUCTION) \ + }, HYPRE_BOX_REDUCTION); \ + hypre_fence(); \ + HYPRE_BOX_REDUCTION += __hypre_sum_tmp; \ + } -#define hypre_LoopBegin(size, idx) \ - { \ +#define hypre_LoopBegin(size,idx) \ +{ \ Kokkos::parallel_for(size, KOKKOS_LAMBDA (HYPRE_Int idx) \ { -#define hypre_LoopEnd() \ - }); \ - hypre_fence(); \ - } +#define hypre_LoopEnd() \ + }); \ + hypre_fence(); \ +} /* extern "C++" @@ -620,34 +704,36 @@ struct ColumnSums } */ -#define hypre_BoxLoopGetIndex(index) \ - index[0] = hypre_IndexD(local_idx, 0); \ - index[1] = hypre_IndexD(local_idx, 1); \ - index[2] = hypre_IndexD(local_idx, 2); - -#define hypre_BoxLoopBlock() 0 -#define hypre_BoxLoop0Begin hypre_newBoxLoop0Begin -#define hypre_BoxLoop0For hypre_newBoxLoop0For -#define hypre_BoxLoop0End hypre_newBoxLoop0End -#define hypre_BoxLoop1Begin hypre_newBoxLoop1Begin -#define hypre_BoxLoop1For hypre_newBoxLoop1For -#define hypre_BoxLoop1End hypre_newBoxLoop1End -#define hypre_BoxLoop2Begin hypre_newBoxLoop2Begin -#define hypre_BoxLoop2For hypre_newBoxLoop2For -#define hypre_BoxLoop2End hypre_newBoxLoop2End -#define hypre_BoxLoop3Begin hypre_newBoxLoop3Begin -#define hypre_BoxLoop3For hypre_newBoxLoop3For -#define hypre_BoxLoop3End hypre_newBoxLoop3End -#define hypre_BoxLoop4Begin hypre_newBoxLoop4Begin -#define hypre_BoxLoop4For hypre_newBoxLoop4For -#define hypre_BoxLoop4End hypre_newBoxLoop4End +#define hypre_BoxLoopGetIndex(index) \ + index[0] = hypre_IndexD(local_idx, 0); \ + index[1] = hypre_IndexD(local_idx, 1); \ + index[2] = hypre_IndexD(local_idx, 2); + +#define hypre_BoxLoopBlock() 0 +#define hypre_BoxLoop0Begin hypre_newBoxLoop0Begin +#define hypre_BoxLoop0For hypre_newBoxLoop0For +#define hypre_BoxLoop0End hypre_newBoxLoop0End +#define hypre_BoxLoop1Begin hypre_newBoxLoop1Begin +#define hypre_BoxLoop1For hypre_newBoxLoop1For +#define hypre_BoxLoop1End hypre_newBoxLoop1End +#define hypre_BoxLoop2Begin hypre_newBoxLoop2Begin +#define hypre_BoxLoop2For hypre_newBoxLoop2For +#define hypre_BoxLoop2End hypre_newBoxLoop2End +#define hypre_BoxLoop3Begin hypre_newBoxLoop3Begin +#define hypre_BoxLoop3For hypre_newBoxLoop3For +#define hypre_BoxLoop3End hypre_newBoxLoop3End +#define hypre_BoxLoop4Begin hypre_newBoxLoop4Begin +#define hypre_BoxLoop4For hypre_newBoxLoop4For +#define hypre_BoxLoop4End hypre_newBoxLoop4End #define hypre_BasicBoxLoop2Begin hypre_newBasicBoxLoop2Begin + #endif -#elif defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#endif /* #ifndef HYPRE_BOXLOOP_KOKKOS_HEADER */ + /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -666,238 +752,299 @@ struct ColumnSums #ifndef HYPRE_BOXLOOP_CUDA_HEADER #define HYPRE_BOXLOOP_CUDA_HEADER -#define HYPRE_LAMBDA [=] __host__ __device__ +#if (defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP)) && !defined(HYPRE_USING_RAJA) && !defined(HYPRE_USING_KOKKOS) + +#define HYPRE_LAMBDA [=] __host__ __device__ /* TODO: RL: support 4-D */ -typedef struct hypre_Boxloop_struct { - HYPRE_Int lsize0, lsize1, lsize2; - HYPRE_Int strides0, strides1, strides2; - HYPRE_Int bstart0, bstart1, bstart2; - HYPRE_Int bsize0, bsize1, bsize2; +typedef struct hypre_Boxloop_struct +{ + HYPRE_Int lsize0, lsize1, lsize2; + HYPRE_Int strides0, strides1, strides2; + HYPRE_Int bstart0, bstart1, bstart2; + HYPRE_Int bsize0, bsize1, bsize2; } hypre_Boxloop; #ifdef __cplusplus -extern "C++" { +extern "C++" +{ #endif -/* ------------------------- - * parfor-loop - * ------------------------*/ + /* ------------------------- + * parfor-loop + * ------------------------*/ -template -__global__ void forall_kernel(LOOP_BODY loop_body, HYPRE_Int length) { - const HYPRE_Int idx = hypre_cuda_get_grid_thread_id<1, 1>(); - /* const HYPRE_Int number_threads = hypre_cuda_get_grid_num_threads<1,1>(); */ - - if (idx < length) { loop_body(idx); } -} - -template -void BoxLoopforall(HYPRE_Int length, LOOP_BODY loop_body) { - HYPRE_ExecutionPolicy exec_policy = hypre_HandleStructExecPolicy(hypre_handle()); + template + __global__ void + forall_kernel( hypre_DeviceItem & item, + LOOP_BODY loop_body, + HYPRE_Int length ) + { + const HYPRE_Int idx = hypre_gpu_get_grid_thread_id<1, 1>(item); + /* const HYPRE_Int number_threads = hypre_gpu_get_grid_num_threads<1,1>(item); */ + + if (idx < length) + { + loop_body(idx); + } + } + + template + void + BoxLoopforall( HYPRE_Int length, + LOOP_BODY loop_body ) + { + const HYPRE_MemoryLocation memory_location = hypre_HandleMemoryLocation(hypre_handle()); + const HYPRE_ExecutionPolicy exec_policy = hypre_GetExecPolicy1(memory_location); - if (exec_policy == HYPRE_EXEC_HOST) { + if (exec_policy == HYPRE_EXEC_HOST) + { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for HYPRE_SMP_SCHEDULE + #pragma omp parallel for HYPRE_SMP_SCHEDULE #endif - for (HYPRE_Int idx = 0; idx < length; idx++) { loop_body(idx); } - } else if (exec_policy == HYPRE_EXEC_DEVICE) { - const dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - const dim3 gDim = hypre_GetDefaultCUDAGridDimension(length, "thread", bDim); - - HYPRE_CUDA_LAUNCH(forall_kernel, gDim, bDim, loop_body, length); - } -} - -/* ------------------------------ - * parforreduction-loop - * -----------------------------*/ - -template -__global__ void reductionforall_kernel(HYPRE_Int length, REDUCER reducer, LOOP_BODY loop_body) { - const HYPRE_Int thread_id = hypre_cuda_get_grid_thread_id<1, 1>(); - const HYPRE_Int n_threads = hypre_cuda_get_grid_num_threads<1, 1>(); - - for (HYPRE_Int idx = thread_id; idx < length; idx += n_threads) { loop_body(idx, reducer); } - - /* reduction in block-level and the save the results in reducer */ - reducer.BlockReduce(); -} - -template -void ReductionBoxLoopforall(HYPRE_Int length, REDUCER &reducer, LOOP_BODY loop_body) { - if (length <= 0) { return; } - - HYPRE_ExecutionPolicy exec_policy = hypre_HandleStructExecPolicy(hypre_handle()); - - if (exec_policy == HYPRE_EXEC_HOST) { - for (HYPRE_Int idx = 0; idx < length; idx++) { loop_body(idx, reducer); } - } else if (exec_policy == HYPRE_EXEC_DEVICE) { - const dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(length, "thread", bDim); - - /* Note: we assume gDim cannot exceed 1024 - * and bDim < WARP * WARP - */ - gDim.x = hypre_min(gDim.x, 1024); - reducer.nblocks = gDim.x; - - /* - hypre_printf("length= %d, blocksize = %d, gridsize = %d\n", length, bDim.x, gDim.x); - */ - - HYPRE_CUDA_LAUNCH(reductionforall_kernel, gDim, bDim, length, reducer, loop_body); - } -} + for (HYPRE_Int idx = 0; idx < length; idx++) + { + loop_body(idx); + } + } + else if (exec_policy == HYPRE_EXEC_DEVICE) + { + const dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + const dim3 gDim = hypre_GetDefaultDeviceGridDimension(length, "thread", bDim); + + HYPRE_GPU_LAUNCH( forall_kernel, gDim, bDim, loop_body, length ); + } + } + + /* ------------------------------ + * parforreduction-loop + * -----------------------------*/ + + template + __global__ void + reductionforall_kernel( hypre_DeviceItem & item, + HYPRE_Int length, + REDUCER reducer, + LOOP_BODY loop_body ) + { + const HYPRE_Int thread_id = hypre_gpu_get_grid_thread_id<1, 1>(item); + const HYPRE_Int n_threads = hypre_gpu_get_grid_num_threads<1, 1>(item); + + for (HYPRE_Int idx = thread_id; idx < length; idx += n_threads) + { + loop_body(idx, reducer); + } + + /* reduction in block-level and the save the results in reducer */ + reducer.BlockReduce(); + } + + template + void + ReductionBoxLoopforall( HYPRE_Int length, + REDUCER & reducer, + LOOP_BODY loop_body ) + { + if (length <= 0) + { + return; + } + + const HYPRE_MemoryLocation memory_location = hypre_HandleMemoryLocation(hypre_handle()); + const HYPRE_ExecutionPolicy exec_policy = hypre_GetExecPolicy1(memory_location); + + if (exec_policy == HYPRE_EXEC_HOST) + { + for (HYPRE_Int idx = 0; idx < length; idx++) + { + loop_body(idx, reducer); + } + } + else if (exec_policy == HYPRE_EXEC_DEVICE) + { + /* Assume gDim cannot exceed HYPRE_MAX_NTHREADS_BLOCK (the max size for the 2nd reduction) + * and bDim <= WARP * WARP (because we use 1 warp fro the block-level reduction) */ + const dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(length, "thread", bDim); + gDim.x = hypre_min(gDim.x, HYPRE_MAX_NTHREADS_BLOCK); + + reducer.nblocks = gDim.x; + + reducer.Allocate2ndPhaseBuffer(); + + /* + hypre_printf("length= %d, blocksize = %d, gridsize = %d\n", length, bDim.x, gDim.x); + */ + + HYPRE_GPU_LAUNCH( reductionforall_kernel, gDim, bDim, length, reducer, loop_body ); + } + } #ifdef __cplusplus } #endif /* Get 1-D length of the loop, in hypre__tot */ -#define hypre_newBoxLoopInit(ndim, loop_size) \ - HYPRE_Int hypre__tot = 1; \ - for (HYPRE_Int hypre_d = 0; hypre_d < ndim; hypre_d++) { hypre__tot *= loop_size[hypre_d]; } +#define hypre_newBoxLoopInit(ndim, loop_size) \ + HYPRE_Int hypre__tot = 1; \ + for (HYPRE_Int hypre_d = 0; hypre_d < ndim; hypre_d ++) \ + { \ + hypre__tot *= loop_size[hypre_d]; \ + } /* Initialize struct for box-k */ -#define hypre_BoxLoopDataDeclareK(k, ndim, loop_size, dbox, start, stride) \ - hypre_Boxloop databox##k; \ - /* dim 0 */ \ - databox##k.lsize0 = loop_size[0]; \ - databox##k.strides0 = stride[0]; \ - databox##k.bstart0 = start[0] - dbox->imin[0]; \ - databox##k.bsize0 = dbox->imax[0] - dbox->imin[0]; \ - /* dim 1 */ \ - if (ndim > 1) { \ - databox##k.lsize1 = loop_size[1]; \ - databox##k.strides1 = stride[1]; \ - databox##k.bstart1 = start[1] - dbox->imin[1]; \ - databox##k.bsize1 = dbox->imax[1] - dbox->imin[1]; \ - } else { \ - databox##k.lsize1 = 1; \ - databox##k.strides1 = 0; \ - databox##k.bstart1 = 0; \ - databox##k.bsize1 = 0; \ - } \ - /* dim 2 */ \ - if (ndim == 3) { \ - databox##k.lsize2 = loop_size[2]; \ - databox##k.strides2 = stride[2]; \ - databox##k.bstart2 = start[2] - dbox->imin[2]; \ - databox##k.bsize2 = dbox->imax[2] - dbox->imin[2]; \ - } else { \ - databox##k.lsize2 = 1; \ - databox##k.strides2 = 0; \ - databox##k.bstart2 = 0; \ - databox##k.bsize2 = 0; \ - } - -#define zypre_BasicBoxLoopDataDeclareK(k, ndim, loop_size, stride) \ - hypre_Boxloop databox##k; \ - databox##k.lsize0 = loop_size[0]; \ - databox##k.strides0 = stride[0]; \ - databox##k.bstart0 = 0; \ - databox##k.bsize0 = 0; \ - if (ndim > 1) { \ - databox##k.lsize1 = loop_size[1]; \ - databox##k.strides1 = stride[1]; \ - databox##k.bstart1 = 0; \ - databox##k.bsize1 = 0; \ - } else { \ - databox##k.lsize1 = 1; \ - databox##k.strides1 = 0; \ - databox##k.bstart1 = 0; \ - databox##k.bsize1 = 0; \ - } \ - if (ndim == 3) { \ - databox##k.lsize2 = loop_size[2]; \ - databox##k.strides2 = stride[2]; \ - databox##k.bstart2 = 0; \ - databox##k.bsize2 = 0; \ - } else { \ - databox##k.lsize2 = 1; \ - databox##k.strides2 = 0; \ - databox##k.bstart2 = 0; \ - databox##k.bsize2 = 0; \ - } +#define hypre_BoxLoopDataDeclareK(k, ndim, loop_size, dbox, start, stride) \ + hypre_Boxloop databox##k; \ + /* dim 0 */ \ + databox##k.lsize0 = loop_size[0]; \ + databox##k.strides0 = stride[0]; \ + databox##k.bstart0 = start[0] - dbox->imin[0]; \ + databox##k.bsize0 = dbox->imax[0] - dbox->imin[0]; \ + /* dim 1 */ \ + if (ndim > 1) \ + { \ + databox##k.lsize1 = loop_size[1]; \ + databox##k.strides1 = stride[1]; \ + databox##k.bstart1 = start[1] - dbox->imin[1]; \ + databox##k.bsize1 = dbox->imax[1] - dbox->imin[1]; \ + } \ + else \ + { \ + databox##k.lsize1 = 1; \ + databox##k.strides1 = 0; \ + databox##k.bstart1 = 0; \ + databox##k.bsize1 = 0; \ + } \ + /* dim 2 */ \ + if (ndim == 3) \ + { \ + databox##k.lsize2 = loop_size[2]; \ + databox##k.strides2 = stride[2]; \ + databox##k.bstart2 = start[2] - dbox->imin[2]; \ + databox##k.bsize2 = dbox->imax[2] - dbox->imin[2]; \ + } \ + else \ + { \ + databox##k.lsize2 = 1; \ + databox##k.strides2 = 0; \ + databox##k.bstart2 = 0; \ + databox##k.bsize2 = 0; \ + } + +#define hypre_BasicBoxLoopDataDeclareK(k,ndim,loop_size,stride) \ +hypre_Boxloop databox##k; \ +databox##k.lsize0 = loop_size[0]; \ +databox##k.strides0 = stride[0]; \ +databox##k.bstart0 = 0; \ +databox##k.bsize0 = 0; \ +if (ndim > 1) \ +{ \ + databox##k.lsize1 = loop_size[1]; \ + databox##k.strides1 = stride[1]; \ + databox##k.bstart1 = 0; \ + databox##k.bsize1 = 0; \ +} \ +else \ +{ \ + databox##k.lsize1 = 1; \ + databox##k.strides1 = 0; \ + databox##k.bstart1 = 0; \ + databox##k.bsize1 = 0; \ +} \ +if (ndim == 3) \ +{ \ + databox##k.lsize2 = loop_size[2]; \ + databox##k.strides2 = stride[2]; \ + databox##k.bstart2 = 0; \ + databox##k.bsize2 = 0; \ +} \ +else \ +{ \ + databox##k.lsize2 = 1; \ + databox##k.strides2 = 0; \ + databox##k.bstart2 = 0; \ + databox##k.bsize2 = 0; \ +} /* RL: TODO loop_size out of box struct, bsize +1 */ /* Given input 1-D 'idx' in box, get 3-D 'local_idx' in loop_size */ -#define hypre_newBoxLoopDeclare(box) \ - hypre_Index local_idx; \ - HYPRE_Int idx_local = idx; \ - hypre_IndexD(local_idx, 0) = idx_local % box.lsize0; \ - idx_local = idx_local / box.lsize0; \ - hypre_IndexD(local_idx, 1) = idx_local % box.lsize1; \ - idx_local = idx_local / box.lsize1; \ - hypre_IndexD(local_idx, 2) = idx_local % box.lsize2; +#define hypre_newBoxLoopDeclare(box) \ + hypre_Index local_idx; \ + HYPRE_Int idx_local = idx; \ + hypre_IndexD(local_idx, 0) = idx_local % box.lsize0; \ + idx_local = idx_local / box.lsize0; \ + hypre_IndexD(local_idx, 1) = idx_local % box.lsize1; \ + idx_local = idx_local / box.lsize1; \ + hypre_IndexD(local_idx, 2) = idx_local % box.lsize2; \ /* Given input 3-D 'local_idx', get 1-D 'hypre__i' in 'box' */ -#define hypre_BoxLoopIncK(k, box, hypre__i) \ - HYPRE_Int hypre_boxD##k = 1; \ - HYPRE_Int hypre__i = 0; \ - hypre__i += (hypre_IndexD(local_idx, 0) * box.strides0 + box.bstart0) * hypre_boxD##k; \ - hypre_boxD##k *= hypre_max(0, box.bsize0 + 1); \ - hypre__i += (hypre_IndexD(local_idx, 1) * box.strides1 + box.bstart1) * hypre_boxD##k; \ - hypre_boxD##k *= hypre_max(0, box.bsize1 + 1); \ - hypre__i += (hypre_IndexD(local_idx, 2) * box.strides2 + box.bstart2) * hypre_boxD##k; \ - hypre_boxD##k *= hypre_max(0, box.bsize2 + 1); +#define hypre_BoxLoopIncK(k, box, hypre__i) \ + HYPRE_Int hypre_boxD##k = 1; \ + HYPRE_Int hypre__i = 0; \ + hypre__i += (hypre_IndexD(local_idx, 0) * box.strides0 + box.bstart0) * hypre_boxD##k; \ + hypre_boxD##k *= hypre_max(0, box.bsize0 + 1); \ + hypre__i += (hypre_IndexD(local_idx, 1) * box.strides1 + box.bstart1) * hypre_boxD##k; \ + hypre_boxD##k *= hypre_max(0, box.bsize1 + 1); \ + hypre__i += (hypre_IndexD(local_idx, 2) * box.strides2 + box.bstart2) * hypre_boxD##k; \ + hypre_boxD##k *= hypre_max(0, box.bsize2 + 1); /* get 3-D local_idx into 'index' */ -#define hypre_BoxLoopGetIndex(index) \ - index[0] = hypre_IndexD(local_idx, 0); \ - index[1] = hypre_IndexD(local_idx, 1); \ - index[2] = hypre_IndexD(local_idx, 2); +#define hypre_BoxLoopGetIndexCUDA(index) \ + index[0] = hypre_IndexD(local_idx, 0); \ + index[1] = hypre_IndexD(local_idx, 1); \ + index[2] = hypre_IndexD(local_idx, 2); /* BoxLoop 0 */ -#define hypre_newBoxLoop0Begin(ndim, loop_size) \ - { \ - hypre_newBoxLoopInit(ndim, loop_size); \ +#define hypre_BoxLoop0BeginCUDA(ndim, loop_size) \ +{ \ + hypre_newBoxLoopInit(ndim, loop_size); \ BoxLoopforall(hypre__tot, HYPRE_LAMBDA (HYPRE_Int idx) \ { -#define hypre_newBoxLoop0End() \ - }); \ - } +#define hypre_BoxLoop0EndCUDA() \ + }); \ +} /* BoxLoop 1 */ -#define hypre_newBoxLoop1Begin(ndim, loop_size, dbox1, start1, stride1, i1) \ - { \ - hypre_newBoxLoopInit(ndim, loop_size); \ - hypre_BoxLoopDataDeclareK(1, ndim, loop_size, dbox1, start1, stride1); \ +#define hypre_BoxLoop1BeginCUDA(ndim, loop_size, dbox1, start1, stride1, i1) \ +{ \ + hypre_newBoxLoopInit(ndim, loop_size); \ + hypre_BoxLoopDataDeclareK(1, ndim, loop_size, dbox1, start1, stride1); \ BoxLoopforall(hypre__tot, HYPRE_LAMBDA (HYPRE_Int idx) \ { \ hypre_newBoxLoopDeclare(databox1); \ hypre_BoxLoopIncK(1, databox1, i1); -#define hypre_newBoxLoop1End(i1) \ - }); \ - } +#define hypre_BoxLoop1EndCUDA(i1) \ + }); \ +} /* BoxLoop 2 */ -#define hypre_newBoxLoop2Begin(ndim, loop_size, dbox1, start1, stride1, i1, dbox2, start2, stride2, i2) \ - { \ - hypre_newBoxLoopInit(ndim, loop_size); \ - hypre_BoxLoopDataDeclareK(1, ndim, loop_size, dbox1, start1, stride1); \ - hypre_BoxLoopDataDeclareK(2, ndim, loop_size, dbox2, start2, stride2); \ +#define hypre_BoxLoop2BeginCUDA(ndim, loop_size, dbox1, start1, stride1, i1, \ + dbox2, start2, stride2, i2) \ +{ \ + hypre_newBoxLoopInit(ndim, loop_size); \ + hypre_BoxLoopDataDeclareK(1, ndim, loop_size, dbox1, start1, stride1); \ + hypre_BoxLoopDataDeclareK(2, ndim, loop_size, dbox2, start2, stride2); \ BoxLoopforall(hypre__tot, HYPRE_LAMBDA (HYPRE_Int idx) \ { \ hypre_newBoxLoopDeclare(databox1); \ hypre_BoxLoopIncK(1, databox1, i1); \ hypre_BoxLoopIncK(2, databox2, i2); -#define hypre_newBoxLoop2End(i1, i2) \ - }); \ - } +#define hypre_BoxLoop2EndCUDA(i1, i2) \ + }); \ +} /* BoxLoop 3 */ -#define hypre_newBoxLoop3Begin(ndim, loop_size, dbox1, start1, stride1, i1, dbox2, start2, stride2, i2, \ - dbox3, start3, stride3, i3) \ - { \ - hypre_newBoxLoopInit(ndim, loop_size); \ - hypre_BoxLoopDataDeclareK(1, ndim, loop_size, dbox1, start1, stride1); \ - hypre_BoxLoopDataDeclareK(2, ndim, loop_size, dbox2, start2, stride2); \ - hypre_BoxLoopDataDeclareK(3, ndim, loop_size, dbox3, start3, stride3); \ +#define hypre_BoxLoop3BeginCUDA(ndim, loop_size, dbox1, start1, stride1, i1, \ + dbox2, start2, stride2, i2, \ + dbox3, start3, stride3, i3) \ +{ \ + hypre_newBoxLoopInit(ndim, loop_size); \ + hypre_BoxLoopDataDeclareK(1, ndim,loop_size, dbox1, start1, stride1); \ + hypre_BoxLoopDataDeclareK(2, ndim,loop_size, dbox2, start2, stride2); \ + hypre_BoxLoopDataDeclareK(3, ndim,loop_size, dbox3, start3, stride3); \ BoxLoopforall(hypre__tot, HYPRE_LAMBDA (HYPRE_Int idx) \ { \ hypre_newBoxLoopDeclare(databox1); \ @@ -905,19 +1052,21 @@ void ReductionBoxLoopforall(HYPRE_Int length, REDUCER &reducer, LOOP_BODY loop_b hypre_BoxLoopIncK(2, databox2, i2); \ hypre_BoxLoopIncK(3, databox3, i3); -#define hypre_newBoxLoop3End(i1, i2, i3) \ - }); \ - } +#define hypre_BoxLoop3EndCUDA(i1, i2, i3) \ + }); \ +} /* BoxLoop 4 */ -#define hypre_newBoxLoop4Begin(ndim, loop_size, dbox1, start1, stride1, i1, dbox2, start2, stride2, i2, \ - dbox3, start3, stride3, i3, dbox4, start4, stride4, i4) \ - { \ - hypre_newBoxLoopInit(ndim, loop_size); \ - hypre_BoxLoopDataDeclareK(1, ndim, loop_size, dbox1, start1, stride1); \ - hypre_BoxLoopDataDeclareK(2, ndim, loop_size, dbox2, start2, stride2); \ - hypre_BoxLoopDataDeclareK(3, ndim, loop_size, dbox3, start3, stride3); \ - hypre_BoxLoopDataDeclareK(4, ndim, loop_size, dbox4, start4, stride4); \ +#define hypre_BoxLoop4BeginCUDA(ndim, loop_size, dbox1, start1, stride1, i1, \ + dbox2, start2, stride2, i2, \ + dbox3, start3, stride3, i3, \ + dbox4, start4, stride4, i4) \ +{ \ + hypre_newBoxLoopInit(ndim, loop_size); \ + hypre_BoxLoopDataDeclareK(1, ndim, loop_size, dbox1, start1, stride1); \ + hypre_BoxLoopDataDeclareK(2, ndim, loop_size, dbox2, start2, stride2); \ + hypre_BoxLoopDataDeclareK(3, ndim, loop_size, dbox3, start3, stride3); \ + hypre_BoxLoopDataDeclareK(4, ndim, loop_size, dbox4, start4, stride4); \ BoxLoopforall(hypre__tot, HYPRE_LAMBDA (HYPRE_Int idx) \ { \ hypre_newBoxLoopDeclare(databox1); \ @@ -926,102 +1075,564 @@ void ReductionBoxLoopforall(HYPRE_Int length, REDUCER &reducer, LOOP_BODY loop_b hypre_BoxLoopIncK(3, databox3, i3); \ hypre_BoxLoopIncK(4, databox4, i4); -#define hypre_newBoxLoop4End(i1, i2, i3, i4) \ - }); \ - } +#define hypre_BoxLoop4EndCUDA(i1, i2, i3, i4) \ + }); \ +} /* Basic BoxLoops have no boxes */ /* BoxLoop 1 */ -#define zypre_newBasicBoxLoop1Begin(ndim, loop_size, stride1, i1) \ - { \ - hypre_newBoxLoopInit(ndim, loop_size); \ - zypre_BasicBoxLoopDataDeclareK(1, ndim, loop_size, stride1); \ +#define hypre_BasicBoxLoop1BeginCUDA(ndim, loop_size, stride1, i1) \ +{ \ + hypre_newBoxLoopInit(ndim, loop_size); \ + hypre_BasicBoxLoopDataDeclareK(1, ndim, loop_size, stride1); \ BoxLoopforall(hypre__tot, HYPRE_LAMBDA (HYPRE_Int idx) \ { \ hypre_newBoxLoopDeclare(databox1); \ hypre_BoxLoopIncK(1, databox1, i1); /* BoxLoop 2 */ -#define zypre_newBasicBoxLoop2Begin(ndim, loop_size, stride1, i1, stride2, i2) \ - { \ - hypre_newBoxLoopInit(ndim, loop_size); \ - zypre_BasicBoxLoopDataDeclareK(1, ndim, loop_size, stride1); \ - zypre_BasicBoxLoopDataDeclareK(2, ndim, loop_size, stride2); \ +#define hypre_BasicBoxLoop2BeginCUDA(ndim, loop_size, stride1, i1, stride2, i2) \ +{ \ + hypre_newBoxLoopInit(ndim, loop_size); \ + hypre_BasicBoxLoopDataDeclareK(1, ndim, loop_size, stride1); \ + hypre_BasicBoxLoopDataDeclareK(2, ndim, loop_size, stride2); \ BoxLoopforall(hypre__tot, HYPRE_LAMBDA (HYPRE_Int idx) \ { \ hypre_newBoxLoopDeclare(databox1); \ hypre_BoxLoopIncK(1, databox1, i1); \ - hypre_BoxLoopIncK(2, databox2, i2); + hypre_BoxLoopIncK(2, databox2, i2); \ -/* TODO: RL just parallel-for, it should not be here, better in utilities */ -#define hypre_LoopBegin(size, idx) \ - { \ +/* Parallel for-loop */ +#define hypre_LoopBeginCUDA(size, idx) \ +{ \ BoxLoopforall(size, HYPRE_LAMBDA (HYPRE_Int idx) \ { -#define hypre_LoopEnd() \ - }); \ - } +#define hypre_LoopEndCUDA() \ + }); \ +} /* Reduction BoxLoop1 */ -#define hypre_BoxLoop1ReductionBegin(ndim, loop_size, dbox1, start1, stride1, i1, reducesum) \ - { \ - hypre_newBoxLoopInit(ndim, loop_size); \ - hypre_BoxLoopDataDeclareK(1, ndim, loop_size, dbox1, start1, stride1); \ +#define hypre_BoxLoop1ReductionBeginCUDA(ndim, loop_size, dbox1, start1, stride1, i1, reducesum) \ +{ \ + hypre_newBoxLoopInit(ndim, loop_size); \ + hypre_BoxLoopDataDeclareK(1, ndim, loop_size, dbox1, start1, stride1); \ ReductionBoxLoopforall(hypre__tot, reducesum, HYPRE_LAMBDA (HYPRE_Int idx, decltype(reducesum) &reducesum) \ { \ hypre_newBoxLoopDeclare(databox1); \ hypre_BoxLoopIncK(1, databox1, i1); -#define hypre_BoxLoop1ReductionEnd(i1, reducesum) \ - }); \ - } +#define hypre_BoxLoop1ReductionEndCUDA(i1, reducesum) \ + }); \ +} /* Reduction BoxLoop2 */ -#define hypre_BoxLoop2ReductionBegin(ndim, loop_size, dbox1, start1, stride1, i1, dbox2, start2, stride2, \ - i2, reducesum) \ - { \ - hypre_newBoxLoopInit(ndim, loop_size); \ - hypre_BoxLoopDataDeclareK(1, ndim, loop_size, dbox1, start1, stride1); \ - hypre_BoxLoopDataDeclareK(2, ndim, loop_size, dbox2, start2, stride2); \ +#define hypre_BoxLoop2ReductionBeginCUDA(ndim, loop_size, dbox1, start1, stride1, i1, \ + dbox2, start2, stride2, i2, reducesum) \ +{ \ + hypre_newBoxLoopInit(ndim, loop_size); \ + hypre_BoxLoopDataDeclareK(1, ndim, loop_size, dbox1, start1, stride1); \ + hypre_BoxLoopDataDeclareK(2, ndim, loop_size, dbox2, start2, stride2); \ ReductionBoxLoopforall(hypre__tot, reducesum, HYPRE_LAMBDA (HYPRE_Int idx, decltype(reducesum) &reducesum) \ { \ hypre_newBoxLoopDeclare(databox1); \ hypre_BoxLoopIncK(1, databox1, i1); \ hypre_BoxLoopIncK(2, databox2, i2); -#define hypre_BoxLoop2ReductionEnd(i1, i2, reducesum) \ - }); \ - } +#define hypre_BoxLoop2ReductionEndCUDA(i1, i2, reducesum) \ + }); \ +} /* Renamings */ -#define hypre_BoxLoopBlock() 0 - -#define hypre_BoxLoop0Begin hypre_newBoxLoop0Begin -#define hypre_BoxLoop0For hypre_newBoxLoop0For -#define hypre_BoxLoop0End hypre_newBoxLoop0End -#define hypre_BoxLoop1Begin hypre_newBoxLoop1Begin -#define hypre_BoxLoop1For hypre_newBoxLoop1For -#define hypre_BoxLoop1End hypre_newBoxLoop1End -#define hypre_BoxLoop2Begin hypre_newBoxLoop2Begin -#define hypre_BoxLoop2For hypre_newBoxLoop2For -#define hypre_BoxLoop2End hypre_newBoxLoop2End -#define hypre_BoxLoop3Begin hypre_newBoxLoop3Begin -#define hypre_BoxLoop3For hypre_newBoxLoop3For -#define hypre_BoxLoop3End hypre_newBoxLoop3End -#define hypre_BoxLoop4Begin hypre_newBoxLoop4Begin -#define hypre_BoxLoop4For hypre_newBoxLoop4For -#define hypre_BoxLoop4End hypre_newBoxLoop4End - -#define hypre_BasicBoxLoop1Begin zypre_newBasicBoxLoop1Begin -#define hypre_BasicBoxLoop2Begin zypre_newBasicBoxLoop2Begin +#define hypre_BoxLoopGetIndexDevice hypre_BoxLoopGetIndexCUDA +#define hypre_BoxLoopBlockDevice() 0 +#define hypre_BoxLoop0BeginDevice hypre_BoxLoop0BeginCUDA +#define hypre_BoxLoop0EndDevice hypre_BoxLoop0EndCUDA +#define hypre_BoxLoop1BeginDevice hypre_BoxLoop1BeginCUDA +#define hypre_BoxLoop1EndDevice hypre_BoxLoop1EndCUDA +#define hypre_BoxLoop2BeginDevice hypre_BoxLoop2BeginCUDA +#define hypre_BoxLoop2EndDevice hypre_BoxLoop2EndCUDA +#define hypre_BoxLoop3BeginDevice hypre_BoxLoop3BeginCUDA +#define hypre_BoxLoop3EndDevice hypre_BoxLoop3EndCUDA +#define hypre_BoxLoop4BeginDevice hypre_BoxLoop4BeginCUDA +#define hypre_BoxLoop4EndDevice hypre_BoxLoop4EndCUDA +#define hypre_BasicBoxLoop1BeginDevice hypre_BasicBoxLoop1BeginCUDA +#define hypre_BasicBoxLoop2BeginDevice hypre_BasicBoxLoop2BeginCUDA +#define hypre_LoopBeginDevice hypre_LoopBeginCUDA +#define hypre_LoopEndDevice hypre_LoopEndCUDA +#define hypre_BoxLoop1ReductionBeginDevice hypre_BoxLoop1ReductionBeginCUDA +#define hypre_BoxLoop1ReductionEndDevice hypre_BoxLoop1ReductionEndCUDA +#define hypre_BoxLoop2ReductionBeginDevice hypre_BoxLoop2ReductionBeginCUDA +#define hypre_BoxLoop2ReductionEndDevice hypre_BoxLoop2ReductionEndCUDA + + +//TODO TEMP FIX +#define hypre_BoxLoopGetIndex hypre_BoxLoopGetIndexDevice +#define hypre_BoxLoopBlock() 0 +#define hypre_BoxLoop0Begin hypre_BoxLoop0BeginDevice +#define hypre_BoxLoop0End hypre_BoxLoop0EndDevice +#define hypre_BoxLoop1Begin hypre_BoxLoop1BeginDevice +#define hypre_BoxLoop1End hypre_BoxLoop1EndDevice +#define hypre_BoxLoop2Begin hypre_BoxLoop2BeginDevice +#define hypre_BoxLoop2End hypre_BoxLoop2EndDevice +#define hypre_BoxLoop3Begin hypre_BoxLoop3BeginDevice +#define hypre_BoxLoop3End hypre_BoxLoop3EndDevice +#define hypre_BoxLoop4Begin hypre_BoxLoop4BeginDevice +#define hypre_BoxLoop4End hypre_BoxLoop4EndDevice +#define hypre_BasicBoxLoop1Begin hypre_BasicBoxLoop1BeginDevice +#define hypre_BasicBoxLoop2Begin hypre_BasicBoxLoop2BeginDevice +#define hypre_LoopBegin hypre_LoopBeginDevice +#define hypre_LoopEnd hypre_LoopEndDevice +#define hypre_BoxLoop1ReductionBegin hypre_BoxLoop1ReductionBeginDevice +#define hypre_BoxLoop1ReductionEnd hypre_BoxLoop1ReductionEndDevice +#define hypre_BoxLoop2ReductionBegin hypre_BoxLoop2ReductionBeginDevice +#define hypre_BoxLoop2ReductionEnd hypre_BoxLoop2ReductionEndDevice + +#endif #endif /* #ifndef HYPRE_BOXLOOP_CUDA_HEADER */ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +/****************************************************************************** + * + * Header info for the BoxLoop + * + *****************************************************************************/ + +/*-------------------------------------------------------------------------- + * BoxLoop macros: + *--------------------------------------------------------------------------*/ + +#ifndef HYPRE_BOXLOOP_SYCL_HEADER +#define HYPRE_BOXLOOP_SYCL_HEADER + +#if defined(HYPRE_USING_SYCL) && !defined(HYPRE_USING_RAJA) && !defined(HYPRE_USING_KOKKOS) + +typedef struct hypre_Boxloop_struct +{ + HYPRE_Int lsize0, lsize1, lsize2; + HYPRE_Int strides0, strides1, strides2; + HYPRE_Int bstart0, bstart1, bstart2; + HYPRE_Int bsize0, bsize1, bsize2; +} hypre_Boxloop; + + +#ifdef __cplusplus +extern "C++" +{ +#endif + + /********************************************************************* + * wrapper functions calling sycl parallel_for + * WM: todo - add runtime switch between CPU/GPU execution + *********************************************************************/ + + template + void + BoxLoopforall( HYPRE_Int length, + LOOP_BODY loop_body) + { + if (length <= 0) + { + return; + } + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(length, "thread", bDim); + + hypre_HandleComputeStream(hypre_handle())->submit([&] (sycl::handler & cgh) + { + cgh.parallel_for(sycl::nd_range<3>(gDim * bDim, bDim), loop_body); + }).wait_and_throw(); + } + + template + void + ReductionBoxLoopforall( LOOP_BODY loop_body, + HYPRE_Int length, + HYPRE_Real * shared_sum_var ) + { + if (length <= 0) + { + return; + } + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(length, "thread", bDim); + + hypre_HandleComputeStream(hypre_handle())->submit([&] (sycl::handler & cgh) + { + cgh.parallel_for(sycl::nd_range<3>(gDim * bDim, bDim), sycl::reduction(shared_sum_var, + std::plus<>()), loop_body); + }).wait_and_throw(); + } + +#ifdef __cplusplus +} +#endif + + +/********************************************************************* + * Init/Declare/IncK etc. + *********************************************************************/ + +/* Get 1-D length of the loop, in hypre__tot */ +#define hypre_newBoxLoopInit(ndim, loop_size) \ + HYPRE_Int hypre__tot = 1; \ + for (HYPRE_Int hypre_d = 0; hypre_d < ndim; hypre_d ++) \ + { \ + hypre__tot *= loop_size[hypre_d]; \ + } + +/* Initialize struct for box-k */ +#define hypre_BoxLoopDataDeclareK(k, ndim, loop_size, dbox, start, stride) \ + hypre_Boxloop databox##k; \ + databox##k.lsize0 = loop_size[0]; \ + databox##k.strides0 = stride[0]; \ + databox##k.bstart0 = start[0] - dbox->imin[0]; \ + databox##k.bsize0 = dbox->imax[0] - dbox->imin[0]; \ + if (ndim > 1) \ + { \ + databox##k.lsize1 = loop_size[1]; \ + databox##k.strides1 = stride[1]; \ + databox##k.bstart1 = start[1] - dbox->imin[1]; \ + databox##k.bsize1 = dbox->imax[1] - dbox->imin[1]; \ + } \ + else \ + { \ + databox##k.lsize1 = 1; \ + databox##k.strides1 = 0; \ + databox##k.bstart1 = 0; \ + databox##k.bsize1 = 0; \ + } \ + if (ndim == 3) \ + { \ + databox##k.lsize2 = loop_size[2]; \ + databox##k.strides2 = stride[2]; \ + databox##k.bstart2 = start[2] - dbox->imin[2]; \ + databox##k.bsize2 = dbox->imax[2] - dbox->imin[2]; \ + } \ + else \ + { \ + databox##k.lsize2 = 1; \ + databox##k.strides2 = 0; \ + databox##k.bstart2 = 0; \ + databox##k.bsize2 = 0; \ + } + +#define hypre_BasicBoxLoopDataDeclareK(k,ndim,loop_size,stride) \ +hypre_Boxloop databox##k; \ +databox##k.lsize0 = loop_size[0]; \ +databox##k.strides0 = stride[0]; \ +databox##k.bstart0 = 0; \ +databox##k.bsize0 = 0; \ +if (ndim > 1) \ +{ \ + databox##k.lsize1 = loop_size[1]; \ + databox##k.strides1 = stride[1]; \ + databox##k.bstart1 = 0; \ + databox##k.bsize1 = 0; \ +} \ +else \ +{ \ + databox##k.lsize1 = 1; \ + databox##k.strides1 = 0; \ + databox##k.bstart1 = 0; \ + databox##k.bsize1 = 0; \ +} \ +if (ndim == 3) \ +{ \ + databox##k.lsize2 = loop_size[2]; \ + databox##k.strides2 = stride[2]; \ + databox##k.bstart2 = 0; \ + databox##k.bsize2 = 0; \ +} \ +else \ +{ \ + databox##k.lsize2 = 1; \ + databox##k.strides2 = 0; \ + databox##k.bstart2 = 0; \ + databox##k.bsize2 = 0; \ +} + +/* Given input 1-D 'idx' in box, get 3-D 'local_idx' in loop_size */ +#define hypre_newBoxLoopDeclare(box) \ + hypre_Index local_idx; \ + HYPRE_Int idx_local = idx; \ + hypre_IndexD(local_idx, 0) = idx_local % box.lsize0; \ + idx_local = idx_local / box.lsize0; \ + hypre_IndexD(local_idx, 1) = idx_local % box.lsize1; \ + idx_local = idx_local / box.lsize1; \ + hypre_IndexD(local_idx, 2) = idx_local % box.lsize2; \ + +/* Given input 3-D 'local_idx', get 1-D 'hypre__i' in 'box' */ +#define hypre_BoxLoopIncK(k, box, hypre__i) \ + HYPRE_Int hypre_boxD##k = 1; \ + HYPRE_Int hypre__i = 0; \ + hypre__i += (hypre_IndexD(local_idx, 0) * box.strides0 + box.bstart0) * hypre_boxD##k; \ + hypre_boxD##k *= hypre_max(0, box.bsize0 + 1); \ + hypre__i += (hypre_IndexD(local_idx, 1) * box.strides1 + box.bstart1) * hypre_boxD##k; \ + hypre_boxD##k *= hypre_max(0, box.bsize1 + 1); \ + hypre__i += (hypre_IndexD(local_idx, 2) * box.strides2 + box.bstart2) * hypre_boxD##k; \ + hypre_boxD##k *= hypre_max(0, box.bsize2 + 1); + +/* get 3-D local_idx into 'index' */ +#define hypre_BoxLoopGetIndex(index) \ + index[0] = hypre_IndexD(local_idx, 0); \ + index[1] = hypre_IndexD(local_idx, 1); \ + index[2] = hypre_IndexD(local_idx, 2); + + +/********************************************************************* + * Boxloops + *********************************************************************/ + +/* BoxLoop 0 */ +#define hypre_newBoxLoop0Begin(ndim, loop_size) \ +{ \ + hypre_newBoxLoopInit(ndim, loop_size); \ + BoxLoopforall(hypre__tot, [=] (sycl::nd_item<3> item) \ + { \ + HYPRE_Int idx = (HYPRE_Int) item.get_global_linear_id(); \ + if (idx < hypre__tot) \ + { \ + +#define hypre_newBoxLoop0End() \ + } \ + }); \ +} + +/* BoxLoop 1 */ +#define hypre_newBoxLoop1Begin(ndim, loop_size, dbox1, start1, stride1, i1) \ +{ \ + hypre_newBoxLoopInit(ndim, loop_size); \ + hypre_BoxLoopDataDeclareK(1, ndim, loop_size, dbox1, start1, stride1); \ + BoxLoopforall(hypre__tot, [=] (sycl::nd_item<3> item) \ + { \ + HYPRE_Int idx = (HYPRE_Int) item.get_global_linear_id(); \ + if (idx < hypre__tot) \ + { \ + hypre_newBoxLoopDeclare(databox1); \ + hypre_BoxLoopIncK(1, databox1, i1); + +#define hypre_newBoxLoop1End(i1) \ + } \ + }); \ +} + +/* BoxLoop 2 */ +#define hypre_newBoxLoop2Begin(ndim, loop_size, dbox1, start1, stride1, i1, \ + dbox2, start2, stride2, i2) \ +{ \ + hypre_newBoxLoopInit(ndim, loop_size); \ + hypre_BoxLoopDataDeclareK(1, ndim, loop_size, dbox1, start1, stride1); \ + hypre_BoxLoopDataDeclareK(2, ndim, loop_size, dbox2, start2, stride2); \ + BoxLoopforall(hypre__tot, [=] (sycl::nd_item<3> item) \ + { \ + HYPRE_Int idx = (HYPRE_Int) item.get_global_linear_id(); \ + if (idx < hypre__tot) \ + { \ + hypre_newBoxLoopDeclare(databox1); \ + hypre_BoxLoopIncK(1, databox1, i1); \ + hypre_BoxLoopIncK(2, databox2, i2); + +#define hypre_newBoxLoop2End(i1, i2) \ + } \ + }); \ +} + +/* BoxLoop 3 */ +#define hypre_newBoxLoop3Begin(ndim, loop_size, dbox1, start1, stride1, i1, \ + dbox2, start2, stride2, i2, \ + dbox3, start3, stride3, i3) \ +{ \ + hypre_newBoxLoopInit(ndim, loop_size); \ + hypre_BoxLoopDataDeclareK(1, ndim,loop_size, dbox1, start1, stride1); \ + hypre_BoxLoopDataDeclareK(2, ndim,loop_size, dbox2, start2, stride2); \ + hypre_BoxLoopDataDeclareK(3, ndim,loop_size, dbox3, start3, stride3); \ + BoxLoopforall(hypre__tot, [=] (sycl::nd_item<3> item) \ + { \ + HYPRE_Int idx = (HYPRE_Int) item.get_global_linear_id(); \ + if (idx < hypre__tot) \ + { \ + hypre_newBoxLoopDeclare(databox1); \ + hypre_BoxLoopIncK(1, databox1, i1); \ + hypre_BoxLoopIncK(2, databox2, i2); \ + hypre_BoxLoopIncK(3, databox3, i3); + +#define hypre_newBoxLoop3End(i1, i2, i3) \ + } \ + }); \ +} + +/* BoxLoop 4 */ +#define hypre_newBoxLoop4Begin(ndim, loop_size, dbox1, start1, stride1, i1, \ + dbox2, start2, stride2, i2, \ + dbox3, start3, stride3, i3, \ + dbox4, start4, stride4, i4) \ +{ \ + hypre_newBoxLoopInit(ndim, loop_size); \ + hypre_BoxLoopDataDeclareK(1, ndim, loop_size, dbox1, start1, stride1); \ + hypre_BoxLoopDataDeclareK(2, ndim, loop_size, dbox2, start2, stride2); \ + hypre_BoxLoopDataDeclareK(3, ndim, loop_size, dbox3, start3, stride3); \ + hypre_BoxLoopDataDeclareK(4, ndim, loop_size, dbox4, start4, stride4); \ + BoxLoopforall(hypre__tot, [=] (sycl::nd_item<3> item) \ + { \ + HYPRE_Int idx = (HYPRE_Int) item.get_global_linear_id(); \ + if (idx < hypre__tot) \ + { \ + hypre_newBoxLoopDeclare(databox1); \ + hypre_BoxLoopIncK(1, databox1, i1); \ + hypre_BoxLoopIncK(2, databox2, i2); \ + hypre_BoxLoopIncK(3, databox3, i3); \ + hypre_BoxLoopIncK(4, databox4, i4); + +#define hypre_newBoxLoop4End(i1, i2, i3, i4) \ + } \ + }); \ +} + + +/* Basic BoxLoops have no boxes */ +/* BoxLoop 1 */ +#define hypre_newBasicBoxLoop1Begin(ndim, loop_size, stride1, i1) \ +{ \ + hypre_newBoxLoopInit(ndim, loop_size); \ + hypre_BasicBoxLoopDataDeclareK(1, ndim, loop_size, stride1); \ + BoxLoopforall(hypre__tot, [=] (sycl::nd_item<3> item) \ + { \ + HYPRE_Int idx = (HYPRE_Int) item.get_global_linear_id(); \ + if (idx < hypre__tot) \ + { \ + hypre_newBoxLoopDeclare(databox1); \ + hypre_BoxLoopIncK(1, databox1, i1); + +/* BoxLoop 2 */ +#define hypre_newBasicBoxLoop2Begin(ndim, loop_size, stride1, i1, stride2, i2) \ +{ \ + hypre_newBoxLoopInit(ndim, loop_size); \ + hypre_BasicBoxLoopDataDeclareK(1, ndim, loop_size, stride1); \ + hypre_BasicBoxLoopDataDeclareK(2, ndim, loop_size, stride2); \ + BoxLoopforall(hypre__tot, [=] (sycl::nd_item<3> item) \ + { \ + HYPRE_Int idx = (HYPRE_Int) item.get_global_linear_id(); \ + if (idx < hypre__tot) \ + { \ + hypre_newBoxLoopDeclare(databox1); \ + hypre_BoxLoopIncK(1, databox1, i1); \ + hypre_BoxLoopIncK(2, databox2, i2); + + +/* Reduction BoxLoop1 */ +#define hypre_newBoxLoop1ReductionBegin(ndim, loop_size, dbox1, start1, stride1, i1, sum_var) \ +{ \ + hypre_newBoxLoopInit(ndim, loop_size); \ + hypre_BoxLoopDataDeclareK(1, ndim, loop_size, dbox1, start1, stride1); \ + HYPRE_Real *shared_sum_var = hypre_CTAlloc(HYPRE_Real, 1, HYPRE_MEMORY_DEVICE); \ + hypre_TMemcpy(shared_sum_var, &sum_var, HYPRE_Real, 1, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); \ + ReductionBoxLoopforall( [=,hypre_unused_var=sum_var] (sycl::nd_item<3> item, auto &sum_var) \ + { \ + HYPRE_Int idx = (HYPRE_Int) item.get_global_linear_id(); \ + if (idx < hypre__tot) \ + { \ + hypre_newBoxLoopDeclare(databox1); \ + hypre_BoxLoopIncK(1, databox1, i1); + +#define hypre_newBoxLoop1ReductionEnd(i1, sum_var) \ + } \ + }, hypre__tot, shared_sum_var); \ + hypre_TMemcpy(&sum_var, shared_sum_var, HYPRE_Real, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); \ + hypre_TFree(shared_sum_var, HYPRE_MEMORY_DEVICE); \ +} + +/* Reduction BoxLoop2 */ +#define hypre_newBoxLoop2ReductionBegin(ndim, loop_size, dbox1, start1, stride1, i1, \ + dbox2, start2, stride2, i2, sum_var) \ +{ \ + hypre_newBoxLoopInit(ndim, loop_size); \ + hypre_BoxLoopDataDeclareK(1, ndim, loop_size, dbox1, start1, stride1); \ + hypre_BoxLoopDataDeclareK(2, ndim, loop_size, dbox2, start2, stride2); \ + HYPRE_Real *shared_sum_var = hypre_CTAlloc(HYPRE_Real, 1, HYPRE_MEMORY_DEVICE); \ + hypre_TMemcpy(shared_sum_var, &sum_var, HYPRE_Real, 1, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); \ + ReductionBoxLoopforall( [=,hypre_unused_var=sum_var] (sycl::nd_item<3> item, auto &sum_var) \ + { \ + HYPRE_Int idx = (HYPRE_Int) item.get_global_linear_id(); \ + if (idx < hypre__tot) \ + { \ + hypre_newBoxLoopDeclare(databox1); \ + hypre_BoxLoopIncK(1, databox1, i1); \ + hypre_BoxLoopIncK(2, databox2, i2); + +#define hypre_newBoxLoop2ReductionEnd(i1, i2, sum_var) \ + } \ + }, hypre__tot, shared_sum_var); \ + hypre_TMemcpy(&sum_var, shared_sum_var, HYPRE_Real, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); \ + hypre_TFree(shared_sum_var, HYPRE_MEMORY_DEVICE); \ +} + +/* Plain parallel_for loop */ +#define hypre_LoopBegin(size, idx) \ +{ \ + HYPRE_Int hypre__tot = size; \ + BoxLoopforall(hypre__tot, [=] (sycl::nd_item<3> item) \ + { \ + HYPRE_Int idx = (HYPRE_Int) item.get_global_linear_id(); \ + if (idx < hypre__tot) \ + { \ + +#define hypre_LoopEnd() \ + } \ + }); \ +} + + +/********************************************************************* + * renamings + *********************************************************************/ + +#define hypre_BoxLoopBlock() 0 + +#define hypre_BoxLoop0Begin hypre_newBoxLoop0Begin +#define hypre_BoxLoop0End hypre_newBoxLoop0End +#define hypre_BoxLoop1Begin hypre_newBoxLoop1Begin +#define hypre_BoxLoop1End hypre_newBoxLoop1End +#define hypre_BoxLoop2Begin hypre_newBoxLoop2Begin +#define hypre_BoxLoop2End hypre_newBoxLoop2End +#define hypre_BoxLoop3Begin hypre_newBoxLoop3Begin +#define hypre_BoxLoop3End hypre_newBoxLoop3End +#define hypre_BoxLoop4Begin hypre_newBoxLoop4Begin +#define hypre_BoxLoop4End hypre_newBoxLoop4End + +#define hypre_BasicBoxLoop1Begin hypre_newBasicBoxLoop1Begin +#define hypre_BasicBoxLoop2Begin hypre_newBasicBoxLoop2Begin + +/* Reduction */ +#define hypre_BoxLoop1ReductionBegin(ndim, loop_size, dbox1, start1, stride1, i1, reducesum) \ + hypre_newBoxLoop1ReductionBegin(ndim, loop_size, dbox1, start1, stride1, i1, reducesum) + +#define hypre_BoxLoop1ReductionEnd(i1, reducesum) \ + hypre_newBoxLoop1ReductionEnd(i1, reducesum) + +#define hypre_BoxLoop2ReductionBegin(ndim, loop_size, dbox1, start1, stride1, i1, \ + dbox2, start2, stride2, i2, reducesum) \ + hypre_newBoxLoop2ReductionBegin(ndim, loop_size, dbox1, start1, stride1, i1, \ + dbox2, start2, stride2, i2, reducesum) + +#define hypre_BoxLoop2ReductionEnd(i1, i2, reducesum) \ + hypre_newBoxLoop2ReductionEnd(i1, i2, reducesum) + #endif +#endif /* #ifndef HYPRE_BOXLOOP_SYCL_HEADER */ + + #ifdef __cplusplus } #endif #endif + diff --git a/external/hypre/src/struct_mv/assumed_part.c b/external/hypre/src/struct_mv/assumed_part.c index 2ced440f..a7badb37 100644 --- a/external/hypre/src/struct_mv/assumed_part.c +++ b/external/hypre/src/struct_mv/assumed_part.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -50,7 +50,7 @@ hypre_IndexFromRank( HYPRE_Int rank, HYPRE_Int d, r, s; r = rank; - for (d = ndim-1; d >= 0; d--) + for (d = ndim - 1; d >= 0; d--) { s = hypre_IndexProd(bsize, d); hypre_IndexD(index, d) = r / s; @@ -87,6 +87,9 @@ hypre_APSubdivideRegion( hypre_Box *region, hypre_Index isize, index, div; hypre_Box *box; + /* Initialize div */ + hypre_SetIndex(div, 0); + /* if level = 0 then no dividing */ if (!level) { @@ -112,18 +115,18 @@ hypre_APSubdivideRegion( hypre_Box *region, { dv = 1; sz = hypre_IndexD(isize, i); - for (j = 0; j< level; j++) + for (j = 0; j < level; j++) { - if (sz >= 2*dv*min_gridpts) /* Cut each dim in half */ + if (sz >= 2 * dv * min_gridpts) /* Cut each dim in half */ { dv *= 2; } } /* Space for each partition */ - partition[i] = hypre_TAlloc(HYPRE_Int, dv+1, HYPRE_MEMORY_HOST); + partition[i] = hypre_TAlloc(HYPRE_Int, dv + 1, HYPRE_MEMORY_HOST); /* Total number of regions to create */ - total = total*dv; + total = total * dv; hypre_IndexD(div, i) = dv; } @@ -143,7 +146,7 @@ hypre_APSubdivideRegion( hypre_Box *region, extra = points % dv; for (j = 1; j < dv; j++) { - partition[i][j] = partition[i][j-1] + width; + partition[i][j] = partition[i][j - 1] + width; if (j <= extra) { partition[i][j]++; @@ -161,7 +164,7 @@ hypre_APSubdivideRegion( hypre_Box *region, { j = hypre_IndexD(index, i); hypre_BoxIMinD(box, i) = partition[i][j]; - hypre_BoxIMaxD(box, i) = partition[i][j+1]-1; + hypre_BoxIMaxD(box, i) = partition[i][j + 1] - 1; } count++; } @@ -216,20 +219,20 @@ hypre_APFindMyBoxesInRegions( hypre_BoxArray *region_array, region = hypre_BoxArrayBox(region_array, i); - for (j = 0; j< num_boxes; j++) + for (j = 0; j < num_boxes; j++) { my_box = hypre_BoxArrayBox(my_box_array, j); /* Check if its a zero volume box. If so, it still need to be counted, so expand until volume is non-zero, then intersect. */ - if (hypre_BoxVolume(my_box) == 0) - { + if (hypre_BoxVolume(my_box) == 0) + { hypre_CopyBox(my_box, grow_box); for (d = 0; d < ndim; d++) { - if(!hypre_BoxSizeD(my_box, d)) + if (!hypre_BoxSizeD(my_box, d)) { hypre_IndexD(grow_index, d) = - (hypre_BoxIMinD(my_box, d) - hypre_BoxIMaxD(my_box, d) + 1)/2; + (hypre_BoxIMinD(my_box, d) - hypre_BoxIMaxD(my_box, d) + 1) / 2; } else { @@ -240,12 +243,12 @@ hypre_APFindMyBoxesInRegions( hypre_BoxArray *region_array, hypre_BoxGrowByIndex(grow_box, grow_index); /* Do they intersect? */ hypre_IntersectBoxes(grow_box, region, result_box); - } - else - { + } + else + { /* Do they intersect? */ hypre_IntersectBoxes(my_box, region, result_box); - } + } if (hypre_BoxVolume(result_box) > 0) { count_array[i]++; @@ -292,9 +295,11 @@ hypre_APGetAllBoxesInRegions( hypre_BoxArray *region_array, num_regions = hypre_BoxArraySize(region_array); send_buf_count = hypre_CTAlloc(HYPRE_Int, num_regions, HYPRE_MEMORY_HOST); - send_buf_vol = hypre_CTAlloc(HYPRE_Real, num_regions*2, HYPRE_MEMORY_HOST); /* allocate HYPRE_Real */ + send_buf_vol = hypre_CTAlloc(HYPRE_Real, num_regions * 2, + HYPRE_MEMORY_HOST); /* allocate HYPRE_Real */ - dbl_vol_and_count = hypre_CTAlloc(HYPRE_Real, num_regions*2, HYPRE_MEMORY_HOST); /* allocate HYPRE_Real */ + dbl_vol_and_count = hypre_CTAlloc(HYPRE_Real, num_regions * 2, + HYPRE_MEMORY_HOST); /* allocate HYPRE_Real */ hypre_APFindMyBoxesInRegions( region_array, my_box_array, &send_buf_count, &send_buf_vol); @@ -303,17 +308,17 @@ hypre_APGetAllBoxesInRegions( hypre_BoxArray *region_array, /* Copy ints to doubles so we can do one Allreduce */ for (i = 0; i < num_regions; i++) { - send_buf_vol[num_regions+i] = (HYPRE_Real) send_buf_count[i]; + send_buf_vol[num_regions + i] = (HYPRE_Real) send_buf_count[i]; } - hypre_MPI_Allreduce(send_buf_vol, dbl_vol_and_count, num_regions*2, + hypre_MPI_Allreduce(send_buf_vol, dbl_vol_and_count, num_regions * 2, HYPRE_MPI_REAL, hypre_MPI_SUM, comm); /* Unpack */ for (i = 0; i < num_regions; i++) { vol_array[i] = dbl_vol_and_count[i]; - count_array[i] = (HYPRE_Int) dbl_vol_and_count[num_regions+i]; + count_array[i] = (HYPRE_Int) dbl_vol_and_count[num_regions + i]; } /* Clean up */ @@ -348,13 +353,13 @@ hypre_APShrinkRegions( hypre_BoxArray *region_array, hypre_Index grow_index, imin, imax; ndim = hypre_BoxArrayNDim(my_box_array); - ndim2 = 2*ndim; + ndim2 = 2 * ndim; num_boxes = hypre_BoxArraySize(my_box_array); num_regions = hypre_BoxArraySize(region_array); - indices = hypre_CTAlloc(HYPRE_Int, num_regions*ndim2, HYPRE_MEMORY_HOST); - recvbuf = hypre_CTAlloc(HYPRE_Int, num_regions*ndim2, HYPRE_MEMORY_HOST); + indices = hypre_CTAlloc(HYPRE_Int, num_regions * ndim2, HYPRE_MEMORY_HOST); + recvbuf = hypre_CTAlloc(HYPRE_Int, num_regions * ndim2, HYPRE_MEMORY_HOST); result_box = hypre_BoxCreate(ndim); @@ -377,15 +382,15 @@ hypre_APShrinkRegions( hypre_BoxArray *region_array, /* Check if its a zero volume box. If so, it still needs to be checked, so expand until volume is nonzero, then intersect. */ - if (hypre_BoxVolume(my_box) == 0) - { + if (hypre_BoxVolume(my_box) == 0) + { hypre_CopyBox(my_box, grow_box); for (d = 0; d < ndim; d++) { - if(!hypre_BoxSizeD(my_box, d)) + if (!hypre_BoxSizeD(my_box, d)) { hypre_IndexD(grow_index, d) = - (hypre_BoxIMinD(my_box, d) - hypre_BoxIMaxD(my_box, d) + 1)/2; + (hypre_BoxIMinD(my_box, d) - hypre_BoxIMaxD(my_box, d) + 1) / 2; } else { @@ -396,9 +401,9 @@ hypre_APShrinkRegions( hypre_BoxArray *region_array, hypre_BoxGrowByIndex(grow_box, grow_index); /* Do they intersect? */ hypre_IntersectBoxes(grow_box, region, result_box); - } - else - { + } + else + { /* Do they intersect? */ hypre_IntersectBoxes( my_box, region, result_box); } @@ -407,11 +412,11 @@ hypre_APShrinkRegions( hypre_BoxArray *region_array, { if (!count) /* Set min and max for first box */ { - ii = i*ndim2; + ii = i * ndim2; for (d = 0; d < ndim; d++) { indices[ii + d] = hypre_BoxIMinD(result_box, d); - indices[ii + ndim +d] = hypre_BoxIMaxD(result_box, d); + indices[ii + ndim + d] = hypre_BoxIMaxD(result_box, d); } } @@ -419,7 +424,7 @@ hypre_APShrinkRegions( hypre_BoxArray *region_array, /* Boxes intersect, so get max and min extents of the result box (this keeps the bounds inside the region) */ - ii = i*ndim2; + ii = i * ndim2; for (d = 0; d < ndim; d++) { indices[ii + d] = hypre_min(indices[ii + d], @@ -434,7 +439,7 @@ hypre_APShrinkRegions( hypre_BoxArray *region_array, the region and the max to the min! */ if (!count) { - ii = i*ndim2; + ii = i * ndim2; for (d = 0; d < ndim; d++) { indices[ii + d] = hypre_BoxIMaxD(region, d); @@ -444,7 +449,7 @@ hypre_APShrinkRegions( hypre_BoxArray *region_array, /* Negate max indices for the Allreduce */ /* Note: min(x)= -max(-x) */ - ii = i*ndim2; + ii = i * ndim2; for (d = 0; d < ndim; d++) { indices[ii + ndim + d] = -indices[ii + ndim + d]; @@ -452,7 +457,7 @@ hypre_APShrinkRegions( hypre_BoxArray *region_array, } /* Do an Allreduce on size and volume to get the global information */ - hypre_MPI_Allreduce(indices, recvbuf, num_regions*ndim2, HYPRE_MPI_INT, + hypre_MPI_Allreduce(indices, recvbuf, num_regions * ndim2, HYPRE_MPI_INT, hypre_MPI_MIN, comm); /* Unpack the "shrunk" regions */ @@ -463,7 +468,7 @@ hypre_APShrinkRegions( hypre_BoxArray *region_array, region = hypre_BoxArrayBox(region_array, i); /* Resize the box */ - ii = i*ndim2; + ii = i * ndim2; for (d = 0; d < ndim; d++) { hypre_IndexD(imin, d) = recvbuf[ii + d]; @@ -530,14 +535,14 @@ hypre_APPruneRegions( hypre_BoxArray *region_array, { if (j < count) { - while ((i+j) == delete_indices[j]) + while ((i + j) == delete_indices[j]) { j++; /* Increase the shift */ - if (j == count) break; + if (j == count) { break; } } } - vol_array[i] = vol_array[i+j]; - count_array[i] = count_array[i+j]; + vol_array[i] = vol_array[i + j]; + count_array[i] = count_array[i + j]; } } @@ -602,7 +607,7 @@ hypre_APRefineRegionsByVol( hypre_BoxArray *region_array, /* Want to refine the regions starting with those that are the least full */ /* Sort the fraction AND the index */ - hypre_qsort2(order, fraction_full, 0, num_regions-1); + hypre_qsort2(order, fraction_full, 0, num_regions - 1); /* Now we can subdivide any that are not full enough */ /* When this is called, we know that size < max_regions */ @@ -626,7 +631,7 @@ hypre_APRefineRegionsByVol( hypre_BoxArray *region_array, est_size = num_regions + hypre_pow2(ndim) - 1; if (est_size > num_procs) { - if (loop==0) + if (loop == 0) { /* Some are less than gamma full, but we cannot further subdivide due to max processors limit (no subdividing occured) */ @@ -658,7 +663,7 @@ hypre_APRefineRegionsByVol( hypre_BoxArray *region_array, } /* If we are on the last region */ - if ((loop+1) == init_num_regions) + if ((loop + 1) == init_num_regions) { break; } @@ -670,7 +675,7 @@ hypre_APRefineRegionsByVol( hypre_BoxArray *region_array, if (num_regions >= max_regions) { /* See if next regions satifies gamma */ - if (fraction_full[order[loop+1]] > gamma) + if (fraction_full[order[loop + 1]] > gamma) { /* All regions less than gamma full have been subdivided (and we have reached max) */ @@ -687,7 +692,7 @@ hypre_APRefineRegionsByVol( hypre_BoxArray *region_array, loop++; /* Increment to repeat loop */ } - if (count ==0 ) + if (count == 0 ) { /* No refining occured so don't do any more */ *return_code = 1; @@ -696,7 +701,7 @@ hypre_APRefineRegionsByVol( hypre_BoxArray *region_array, { /* We subdivided count regions */ /* Delete the old regions */ - hypre_qsort0(delete_indices, 0, count-1); /* Put deleted indices in asc order */ + hypre_qsort0(delete_indices, 0, count - 1); /* Put deleted indices in asc order */ hypre_DeleteMultipleBoxes( region_array, delete_indices, count ); } @@ -745,12 +750,12 @@ hypre_StructAssumedPartitionCreate( HYPRE_Int myid, num_procs; HYPRE_Int num_proc_partitions; HYPRE_Int count_array_size; - HYPRE_Int *count_array=NULL; - HYPRE_Real *vol_array=NULL, one_volume, dbl_vol; + HYPRE_Int *count_array = NULL; + HYPRE_Real *vol_array = NULL, one_volume, dbl_vol; HYPRE_Int return_code; HYPRE_Int num_refine; HYPRE_Int total_boxes, proc_count, max_position; - HYPRE_Int *proc_array=NULL; + HYPRE_Int *proc_array = NULL; HYPRE_Int initial_level; HYPRE_Int dmax; HYPRE_Real width, wmin, wmax; @@ -764,9 +769,9 @@ hypre_StructAssumedPartitionCreate( HYPRE_Int proc_alloc, count, box_count; HYPRE_Int max_response_size; - HYPRE_Int *response_buf = NULL, *response_buf_starts=NULL; + HYPRE_Int *response_buf = NULL, *response_buf_starts = NULL; HYPRE_Int *tmp_proc_ids = NULL, *tmp_box_nums = NULL, *tmp_box_inds = NULL; - HYPRE_Int *proc_array_starts=NULL; + HYPRE_Int *proc_array_starts = NULL; hypre_BoxArray *my_partition; hypre_DataExchangeResponse response_obj; @@ -822,7 +827,7 @@ hypre_StructAssumedPartitionCreate( max_regions = hypre_min(num_procs, max_regions); /* Don't want more regions than boxes either */ - if (global_num_boxes) max_regions = hypre_min(global_num_boxes, max_regions); + if (global_num_boxes) { max_regions = hypre_min(global_num_boxes, max_regions); } /* Start with a region array of size 0 */ region_array = hypre_BoxArrayCreate(0, ndim); @@ -832,8 +837,8 @@ hypre_StructAssumedPartitionCreate( one_volume = hypre_doubleBoxVolume(bounding_box); - if( ((global_boxes_size/one_volume) > gamma) || - (global_num_boxes > one_volume) || (global_num_boxes == 0) ) + if ( ((global_boxes_size / one_volume) > gamma) || + (global_num_boxes > one_volume) || (global_num_boxes == 0) ) { /* Don't bother with any refinements. We are full enough, or we have a small bounding box and we are not full because of empty boxes */ @@ -849,10 +854,10 @@ hypre_StructAssumedPartitionCreate( we have a smaller number of procs */ for (i = 0; i < initial_level; i++) { - if ( hypre_pow2(initial_level*ndim) > num_procs) initial_level --; + if ( hypre_pow2(initial_level * ndim) > num_procs) { initial_level --; } /* Not be able to do any refinements due to the number of processors */ - if (!initial_level) max_refinements = 0; + if (!initial_level) { max_refinements = 0; } } } @@ -862,7 +867,7 @@ hypre_StructAssumedPartitionCreate( #endif #if REFINE_INFO - if (myid ==0) + if (myid == 0) { hypre_printf("gamma = %g\n", gamma); hypre_printf("max_regions = %d\n", max_regions); @@ -874,7 +879,7 @@ hypre_StructAssumedPartitionCreate( /* Divide the bounding box */ hypre_APSubdivideRegion(bounding_box, ndim, initial_level, region_array, &size); /* If no subdividing occured (because too small) then don't try to refine */ - if (initial_level > 0 && size ==1) max_refinements = 0; + if (initial_level > 0 && size == 1) { max_refinements = 0; } /* Need space for count and volume */ size = hypre_BoxArraySize(region_array); @@ -889,7 +894,7 @@ hypre_StructAssumedPartitionCreate( /* Don't do any initial prune and shrink if we have only one region and we can't do any refinements */ - if ( !(size ==1 && max_refinements == 0)) + if ( !(size == 1 && max_refinements == 0)) { /* Get rid of regions with no boxes (and adjust count and vol arrays) */ hypre_APPruneRegions( region_array, &count_array, &vol_array); @@ -934,7 +939,7 @@ hypre_StructAssumedPartitionCreate( { count_array = hypre_TReAlloc(count_array, HYPRE_Int, size, HYPRE_MEMORY_HOST); vol_array = hypre_TReAlloc(vol_array, HYPRE_Real, size, HYPRE_MEMORY_HOST); - count_array_size =size; + count_array_size = size; } /* FUTURE MOD: Just count and prune and shrink in the modified regions @@ -954,7 +959,7 @@ hypre_StructAssumedPartitionCreate( /* 5 = all regions < gamma full were subdivided and max reached */ /* 3 = some regions were divided (not all that needed) and max reached */ if ( (return_code == 3 || return_code == 5) - && size ==hypre_BoxArraySize(region_array) ) + && size == hypre_BoxArraySize(region_array) ) { break; } @@ -978,7 +983,7 @@ hypre_StructAssumedPartitionCreate( } #if REGION_STAT - if (myid ==0) + if (myid == 0) { hypre_printf("myid = %d, %d REGIONS (after refining %d times\n", myid, hypre_BoxArraySize(region_array), num_refine); @@ -1044,15 +1049,15 @@ hypre_StructAssumedPartitionCreate( else { proc_array[i] = (HYPRE_Int) - hypre_round( ((HYPRE_Real)count_array[i]/(HYPRE_Real)total_boxes) * - (HYPRE_Real) num_proc_partitions ); + hypre_round( ((HYPRE_Real)count_array[i] / (HYPRE_Real)total_boxes) * + (HYPRE_Real) num_proc_partitions ); } box = hypre_BoxArrayBox(region_array, i); dbl_vol = hypre_doubleBoxVolume(box); /* Can't have any zeros! */ - if (!proc_array[i]) proc_array[i] = 1; + if (!proc_array[i]) { proc_array[i] = 1; } if (dbl_vol < (HYPRE_Real) proc_array[i]) { @@ -1102,7 +1107,7 @@ hypre_StructAssumedPartitionCreate( } else { - while (i < size && proc_array[i] <=1) /* size is the number of regions */ + while (i < size && proc_array[i] <= 1) /* size is the number of regions */ { i++; } @@ -1117,11 +1122,11 @@ hypre_StructAssumedPartitionCreate( processor partition */ /* size = # of regions */ hypre_StructAssumedPartProcPartitions(assumed_part) = - hypre_CTAlloc(HYPRE_Int, size+ 1, HYPRE_MEMORY_HOST); + hypre_CTAlloc(HYPRE_Int, size + 1, HYPRE_MEMORY_HOST); hypre_StructAssumedPartProcPartition(assumed_part, 0) = 0; for (i = 0; i < size; i++) { - hypre_StructAssumedPartProcPartition(assumed_part, i+1) = + hypre_StructAssumedPartProcPartition(assumed_part, i + 1) = hypre_StructAssumedPartProcPartition(assumed_part, i) + proc_array[i]; } @@ -1160,23 +1165,23 @@ hypre_StructAssumedPartitionCreate( rn_cube_divs, then div_index[dmax] is incremented until we have more partitions than processors. */ - rn_cubes = hypre_doubleBoxVolume(box) / pow(wmin, ndim); + rn_cubes = hypre_doubleBoxVolume(box) / hypre_pow(wmin, ndim); rn_cube_procs = proc_count / rn_cubes; - rn_cube_divs = pow(rn_cube_procs, (1.0/(HYPRE_Real)ndim)); + rn_cube_divs = hypre_pow(rn_cube_procs, (1.0 / (HYPRE_Real)ndim)); for (d = 0; d < ndim; d++) { width = hypre_BoxSizeD(box, d); - rdiv = rn_cube_divs*(width/wmin); + rdiv = rn_cube_divs * (width / wmin); /* Add a small number to compensate for roundoff issues */ - hypre_IndexD(div_index, d) = (HYPRE_Int) floor(rdiv + 1.0e-6); + hypre_IndexD(div_index, d) = (HYPRE_Int) hypre_floor(rdiv + 1.0e-6); /* Make sure div_index[d] is at least 1 */ hypre_IndexD(div_index, d) = hypre_max(hypre_IndexD(div_index, d), 1); } /* Decrease div_index to ensure no more than 2 partitions per processor. * This is only needed when div_index[d] is adjusted to 1 above. */ - while (hypre_IndexProd(div_index, ndim) >= 2*proc_count) + while (hypre_IndexProd(div_index, ndim) >= 2 * proc_count) { /* Decrease the max dimension by a factor of 2 without going below 1 */ hypre_IndexD(div_index, dmax) = (hypre_IndexD(div_index, dmax) + 1) / 2; @@ -1246,7 +1251,7 @@ hypre_StructAssumedPartitionCreate( /* Probably there will mostly be one proc per box */ /* Don't want to allocate too much memory here */ - size = 1.2 * hypre_BoxArraySize(local_boxes); + size = (HYPRE_Int)(1.2 * hypre_BoxArraySize(local_boxes)); /* Each local box may live on multiple procs in the assumed partition */ tmp_proc_ids = hypre_CTAlloc(HYPRE_Int, size, HYPRE_MEMORY_HOST); /* local box proc ids */ @@ -1266,7 +1271,7 @@ hypre_StructAssumedPartitionCreate( /* Do we need more storage? */ if ((count + proc_count) > size) { - size = size + proc_count + 1.2*(hypre_BoxArraySize(local_boxes)-i); + size = (HYPRE_Int)(size + proc_count + 1.2 * (hypre_BoxArraySize(local_boxes) - i)); /* hypre_printf("myid = %d, *adjust* alloc size = %d\n", myid, size);*/ tmp_proc_ids = hypre_TReAlloc(tmp_proc_ids, HYPRE_Int, size, HYPRE_MEMORY_HOST); tmp_box_nums = hypre_TReAlloc(tmp_box_nums, HYPRE_Int, size, HYPRE_MEMORY_HOST); @@ -1288,16 +1293,16 @@ hypre_StructAssumedPartitionCreate( and then create a new buffer to send to the exchange data function. */ /* Sort the proc_ids */ - hypre_qsort3i(tmp_proc_ids, tmp_box_nums, tmp_box_inds, 0, count-1); + hypre_qsort3i(tmp_proc_ids, tmp_box_nums, tmp_box_inds, 0, count - 1); /* Use proc_array for the processor ids to contact. Use box array to get our boxes and then pass the array only (not the structure) to exchange data. */ box_count = count; - contact_boxinfo = hypre_CTAlloc(HYPRE_Int, box_count*(1+2*ndim), HYPRE_MEMORY_HOST); + contact_boxinfo = hypre_CTAlloc(HYPRE_Int, box_count * (1 + 2 * ndim), HYPRE_MEMORY_HOST); proc_array = hypre_TReAlloc(proc_array, HYPRE_Int, box_count, HYPRE_MEMORY_HOST); - proc_array_starts = hypre_CTAlloc(HYPRE_Int, box_count+1, HYPRE_MEMORY_HOST); + proc_array_starts = hypre_CTAlloc(HYPRE_Int, box_count + 1, HYPRE_MEMORY_HOST); proc_array_starts[0] = 0; proc_count = 0; @@ -1319,7 +1324,7 @@ hypre_StructAssumedPartitionCreate( for (i = 1; i < box_count; i++) { - if (tmp_proc_ids[i] != proc_array[proc_count-1]) + if (tmp_proc_ids[i] != proc_array[proc_count - 1]) { proc_array[proc_count] = tmp_proc_ids[i]; proc_array_starts[proc_count] = i; @@ -1371,7 +1376,7 @@ hypre_StructAssumedPartitionCreate( hypre_DataExchangeList(proc_count, proc_array, contact_boxinfo, proc_array_starts, - (1+2*ndim)*sizeof(HYPRE_Int), + (1 + 2 * ndim)*sizeof(HYPRE_Int), sizeof(HYPRE_Int), &response_obj, max_response_size, 1, comm, (void**) &response_buf, &response_buf_starts); @@ -1416,15 +1421,16 @@ hypre_StructAssumedPartitionDestroy( hypre_StructAssumedPart *assumed_part ) *****************************************************************************/ HYPRE_Int -hypre_APFillResponseStructAssumedPart( - void *p_recv_contact_buf, - HYPRE_Int contact_size, - HYPRE_Int contact_proc, - void *ro, - MPI_Comm comm, - void **p_send_response_buf, - HYPRE_Int *response_message_size ) +hypre_APFillResponseStructAssumedPart(void *p_recv_contact_buf, + HYPRE_Int contact_size, + HYPRE_Int contact_proc, + void *ro, + MPI_Comm comm, + void **p_send_response_buf, + HYPRE_Int *response_message_size ) { + HYPRE_UNUSED_VAR(p_send_response_buf); + HYPRE_Int ndim, size, alloc_size, myid, i, d, index; HYPRE_Int *ids, *boxnums; HYPRE_Int *recv_contact_buf; @@ -1466,8 +1472,8 @@ hypre_APFillResponseStructAssumedPart( index = 0; for (i = 0; i < contact_size; i++) { - ids[size+i] = contact_proc; /* Set the proc id */ - boxnums[size+i] = recv_contact_buf[index++]; + ids[size + i] = contact_proc; /* Set the proc id */ + boxnums[size + i] = recv_contact_buf[index++]; for (d = 0; d < ndim; d++) { hypre_BoxIMinD(box, d) = recv_contact_buf[index++]; @@ -1533,7 +1539,7 @@ hypre_StructAssumedPartitionGetRegionsFromProc( in_region = 0; if (num_regions > 1) { - while (proc_id >= proc_partitions[in_region+1]) + while (proc_id >= proc_partitions[in_region + 1]) { in_region++; } @@ -1542,7 +1548,7 @@ hypre_StructAssumedPartitionGetRegionsFromProc( /* First processor in the range */ proc_start = proc_partitions[in_region]; /* How many processors in that region? */ - proc_count = proc_partitions[in_region+1] - proc_partitions[in_region]; + proc_count = proc_partitions[in_region + 1] - proc_partitions[in_region]; /* Get the region */ region = hypre_BoxArrayBox(hypre_StructAssumedPartRegions(assumed_part), in_region); @@ -1570,7 +1576,7 @@ hypre_StructAssumedPartitionGetRegionsFromProc( /* Get my partition number */ if (adj_proc_id < extra) { - part_num = adj_proc_id*2; + part_num = adj_proc_id * 2; num_assumed = 2; } else @@ -1587,15 +1593,15 @@ hypre_StructAssumedPartitionGetRegionsFromProc( { hypre_IndexFromRank(part_num + i, div, divindex, ndim); - for (d = ndim-1; d >= 0; d--) + for (d = ndim - 1; d >= 0; d--) { width = hypre_IndexD(rsize, d) / hypre_IndexD(div, d); extra = hypre_IndexD(rsize, d) % hypre_IndexD(div, d); divi = hypre_IndexD(divindex, d); - hypre_IndexD(imin, d) = divi*width + hypre_min(divi, extra); + hypre_IndexD(imin, d) = divi * width + hypre_min(divi, extra); divi = hypre_IndexD(divindex, d) + 1; - hypre_IndexD(imax, d) = divi*width + hypre_min(divi, extra) - 1; + hypre_IndexD(imax, d) = divi * width + hypre_min(divi, extra) - 1; /* Change relative coordinates to absolute */ hypre_IndexD(imin, d) += hypre_BoxIMinD(region, d); @@ -1711,7 +1717,7 @@ hypre_StructAssumedPartitionGetProcsFromBox( /* First processor in the range */ proc_start = proc_partitions[this_region]; /* How many processors in that region? */ - proc_count = proc_partitions[this_region+1] - proc_start; + proc_count = proc_partitions[this_region + 1] - proc_start; /* Size of the regions */ hypre_BoxGetSize(region, rsize); /* Get the divisons in each dimension */ @@ -1730,27 +1736,27 @@ hypre_StructAssumedPartitionGetProcsFromBox( /* imin component, shifted by region imin */ i = hypre_BoxIMinD(result_box, d) - hypre_BoxIMinD(region, d); - p = i/(width+1); + p = i / (width + 1); if (p < extra) { hypre_BoxIMinD(part_box, d) = p + 1; } else { - q = (i - extra*(width+1))/width; + q = (i - extra * (width + 1)) / width; hypre_BoxIMinD(part_box, d) = extra + q + 1; } /* imax component, shifted by region imin */ i = hypre_BoxIMaxD(result_box, d) - hypre_BoxIMinD(region, d); - p = i/(width+1); + p = i / (width + 1); if (p < extra) { hypre_BoxIMaxD(part_box, d) = p + 1; } else { - q = (i - extra*(width+1))/width; + q = (i - extra * (width + 1)) / width; hypre_BoxIMaxD(part_box, d) = extra + q + 1; } } @@ -1768,13 +1774,13 @@ hypre_StructAssumedPartitionGetProcsFromBox( hypre_SerialBoxLoop1Begin(ndim, loop_size, part_dbox, start, stride, part_num); { /*convert the partition number to a processor number*/ - if (part_num < (2*extra)) + if (part_num < (2 * extra)) { - adj_proc_id = part_num/2 ; + adj_proc_id = part_num / 2 ; } else { - adj_proc_id = extra + (part_num - 2*extra); + adj_proc_id = extra + (part_num - 2 * extra); } if (num_proc_ids == size_proc_ids) @@ -1794,7 +1800,7 @@ hypre_StructAssumedPartitionGetProcsFromBox( { /* Determine unique proc_ids (could be duplicates due to a processor owning more than one partiton in a region). Sort the array. */ - hypre_qsort0(proc_ids, 0, num_proc_ids-1); + hypre_qsort0(proc_ids, 0, num_proc_ids - 1); /* Make sure we have enough space from proc_array */ if (*size_alloc_proc_array < num_proc_ids) @@ -1808,7 +1814,7 @@ hypre_StructAssumedPartitionGetProcsFromBox( proc_array_count = 1; for (i = 1; i < num_proc_ids; i++) { - if (proc_ids[i] != proc_array[proc_array_count-1]) + if (proc_ids[i] != proc_array[proc_array_count - 1]) { proc_array[proc_array_count] = proc_ids[i]; proc_array_count++; @@ -1869,7 +1875,7 @@ hypre_StructCoarsenAP(hypre_StructAssumedPart *ap, hypre_StructAssumedPartRegions(new_ap) = regions_array; hypre_StructAssumedPartNumRegions(new_ap) = num_regions; hypre_StructAssumedPartProcPartitions(new_ap) = - hypre_CTAlloc(HYPRE_Int, num_regions+1, HYPRE_MEMORY_HOST); + hypre_CTAlloc(HYPRE_Int, num_regions + 1, HYPRE_MEMORY_HOST); hypre_StructAssumedPartDivisions(new_ap) = hypre_CTAlloc(HYPRE_Int, num_regions, HYPRE_MEMORY_HOST); @@ -1884,8 +1890,8 @@ hypre_StructCoarsenAP(hypre_StructAssumedPart *ap, hypre_StructAssumedPartDivision(new_ap, i) = hypre_StructAssumedPartDivision(new_ap, i); - hypre_StructAssumedPartProcPartition(new_ap, i+1)= - hypre_StructAssumedPartProcPartition(ap, i+1); + hypre_StructAssumedPartProcPartition(new_ap, i + 1) = + hypre_StructAssumedPartProcPartition(ap, i + 1); } /* Copy my partition (at most 2 boxes)*/ @@ -1919,7 +1925,7 @@ hypre_StructCoarsenAP(hypre_StructAssumedPart *ap, hypre_ForBoxI(i, fine_boxes) { - box = hypre_BoxArrayBox(fine_boxes,i); + box = hypre_BoxArrayBox(fine_boxes, i); hypre_CopyBox(box, new_box); hypre_StructCoarsenBox(new_box, index, stride); } diff --git a/external/hypre/src/struct_mv/assumed_part.h b/external/hypre/src/struct_mv/assumed_part.h index f67ccd4b..8ec5edd2 100644 --- a/external/hypre/src/struct_mv/assumed_part.h +++ b/external/hypre/src/struct_mv/assumed_part.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -14,13 +14,13 @@ #ifndef hypre_ASSUMED_PART_HEADER #define hypre_ASSUMED_PART_HEADER -typedef struct +typedef struct { - /* the entries will be the same for all procs */ + /* the entries will be the same for all procs */ HYPRE_Int ndim; /* number of dimensions */ hypre_BoxArray *regions; /* areas of the grid with boxes */ - HYPRE_Int num_regions; /* how many regions */ - HYPRE_Int *proc_partitions; /* proc ids assigned to each region + HYPRE_Int num_regions; /* how many regions */ + HYPRE_Int *proc_partitions; /* proc ids assigned to each region (this is size num_regions +1) */ hypre_Index *divisions; /* number of proc divisions in each direction for each region */ @@ -29,22 +29,22 @@ typedef struct hypre_BoxArray *my_partition_boxes; /* boxes in my portion */ HYPRE_Int *my_partition_proc_ids; HYPRE_Int *my_partition_boxnums; - HYPRE_Int my_partition_ids_size; + HYPRE_Int my_partition_ids_size; HYPRE_Int my_partition_ids_alloc; HYPRE_Int my_partition_num_distinct_procs; - + } hypre_StructAssumedPart; /*Accessor macros */ -#define hypre_StructAssumedPartNDim(apart) ((apart)->ndim) -#define hypre_StructAssumedPartRegions(apart) ((apart)->regions) -#define hypre_StructAssumedPartNumRegions(apart) ((apart)->num_regions) -#define hypre_StructAssumedPartDivisions(apart) ((apart)->divisions) -#define hypre_StructAssumedPartDivision(apart, i) ((apart)->divisions[i]) -#define hypre_StructAssumedPartProcPartitions(apart) ((apart)->proc_partitions) -#define hypre_StructAssumedPartProcPartition(apart, i) ((apart)->proc_partitions[i]) +#define hypre_StructAssumedPartNDim(apart) ((apart)->ndim) +#define hypre_StructAssumedPartRegions(apart) ((apart)->regions) +#define hypre_StructAssumedPartNumRegions(apart) ((apart)->num_regions) +#define hypre_StructAssumedPartDivisions(apart) ((apart)->divisions) +#define hypre_StructAssumedPartDivision(apart, i) ((apart)->divisions[i]) +#define hypre_StructAssumedPartProcPartitions(apart) ((apart)->proc_partitions) +#define hypre_StructAssumedPartProcPartition(apart, i) ((apart)->proc_partitions[i]) #define hypre_StructAssumedPartMyPartition(apart) ((apart)->my_partition) #define hypre_StructAssumedPartMyPartitionBoxes(apart) ((apart)->my_partition_boxes) #define hypre_StructAssumedPartMyPartitionProcIds(apart) ((apart)->my_partition_proc_ids) diff --git a/external/hypre/src/struct_mv/box.c b/external/hypre/src/struct_mv/box.c index 7679a91e..4ce82449 100644 --- a/external/hypre/src/struct_mv/box.c +++ b/external/hypre/src/struct_mv/box.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -199,6 +199,51 @@ hypre_IndexesEqual( hypre_Index index1, return equal; } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IndexPrint( FILE *file, + HYPRE_Int ndim, + hypre_Index index ) +{ + HYPRE_Int d; + + hypre_fprintf(file, "[%d", hypre_IndexD(index, 0)); + for (d = 1; d < ndim; d++) + { + hypre_fprintf(file, " %d", hypre_IndexD(index, d)); + } + hypre_fprintf(file, "]"); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IndexRead( FILE *file, + HYPRE_Int ndim, + hypre_Index index ) +{ + HYPRE_Int d; + + hypre_fscanf(file, "[%d", &hypre_IndexD(index, 0)); + for (d = 1; d < ndim; d++) + { + hypre_fscanf(file, " %d", &hypre_IndexD(index, d)); + } + hypre_fscanf(file, "]"); + + for (d = ndim; d < HYPRE_MAXDIM; d++) + { + hypre_IndexD(index, d) = 0; + } + + return hypre_error_flag; +} + /*========================================================================== * Member functions: hypre_Box *==========================================================================*/ @@ -220,7 +265,7 @@ hypre_BoxCreate( HYPRE_Int ndim ) /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int hypre_BoxDestroy( hypre_Box *box ) { if (box) @@ -290,7 +335,7 @@ hypre_BoxDuplicate( hypre_Box *box ) /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int hypre_BoxVolume( hypre_Box *box ) { HYPRE_Int volume, d, ndim = hypre_BoxNDim(box); @@ -365,7 +410,7 @@ hypre_BoxGetSize( hypre_Box *box, /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int hypre_BoxGetStrideSize( hypre_Box *box, hypre_Index stride, hypre_Index size ) @@ -388,7 +433,7 @@ hypre_BoxGetStrideSize( hypre_Box *box, /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int hypre_BoxGetStrideVolume( hypre_Box *box, hypre_Index stride, HYPRE_Int *volume_ptr ) @@ -447,7 +492,7 @@ hypre_BoxRankIndex( hypre_Box *box, r = rank; s = hypre_BoxVolume(box); - for (d = ndim-1; d >= 0; d--) + for (d = ndim - 1; d >= 0; d--) { s = s / hypre_BoxSizeD(box, d); hypre_IndexD(index, d) = r / s; @@ -487,7 +532,7 @@ hypre_BoxOffsetDistance( hypre_Box *box, HYPRE_Int hypre_BoxShiftPos( hypre_Box *box, hypre_Index shift ) -{ +{ HYPRE_Int d, ndim = hypre_BoxNDim(box); for (d = 0; d < ndim; d++) @@ -495,7 +540,7 @@ hypre_BoxShiftPos( hypre_Box *box, hypre_BoxIMinD(box, d) += hypre_IndexD(shift, d); hypre_BoxIMaxD(box, d) += hypre_IndexD(shift, d); } - + return hypre_error_flag; } @@ -506,7 +551,7 @@ hypre_BoxShiftPos( hypre_Box *box, HYPRE_Int hypre_BoxShiftNeg( hypre_Box *box, hypre_Index shift ) -{ +{ HYPRE_Int d, ndim = hypre_BoxNDim(box); for (d = 0; d < ndim; d++) @@ -514,7 +559,7 @@ hypre_BoxShiftNeg( hypre_Box *box, hypre_BoxIMinD(box, d) -= hypre_IndexD(shift, d); hypre_BoxIMaxD(box, d) -= hypre_IndexD(shift, d); } - + return hypre_error_flag; } @@ -525,7 +570,7 @@ hypre_BoxShiftNeg( hypre_Box *box, HYPRE_Int hypre_BoxGrowByIndex( hypre_Box *box, hypre_Index index ) -{ +{ hypre_IndexRef imin = hypre_BoxIMin(box); hypre_IndexRef imax = hypre_BoxIMax(box); HYPRE_Int ndim = hypre_BoxNDim(box); @@ -537,7 +582,7 @@ hypre_BoxGrowByIndex( hypre_Box *box, hypre_IndexD(imin, d) -= i; hypre_IndexD(imax, d) += i; } - + return hypre_error_flag; } @@ -548,18 +593,18 @@ hypre_BoxGrowByIndex( hypre_Box *box, HYPRE_Int hypre_BoxGrowByValue( hypre_Box *box, HYPRE_Int val ) -{ +{ HYPRE_Int *imin = hypre_BoxIMin(box); HYPRE_Int *imax = hypre_BoxIMax(box); HYPRE_Int ndim = hypre_BoxNDim(box); - HYPRE_Int d; + HYPRE_Int d; for (d = 0; d < ndim; d++) { hypre_IndexD(imin, d) -= val; hypre_IndexD(imax, d) += val; } - + return hypre_error_flag; } @@ -570,18 +615,84 @@ hypre_BoxGrowByValue( hypre_Box *box, HYPRE_Int hypre_BoxGrowByArray( hypre_Box *box, HYPRE_Int *array ) -{ +{ HYPRE_Int *imin = hypre_BoxIMin(box); HYPRE_Int *imax = hypre_BoxIMax(box); HYPRE_Int ndim = hypre_BoxNDim(box); - HYPRE_Int d; + HYPRE_Int d; for (d = 0; d < ndim; d++) { - imin[d] -= array[2*d]; - imax[d] += array[2*d+1]; + imin[d] -= array[2 * d]; + imax[d] += array[2 * d + 1]; + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Print a box to file + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxPrint( FILE *file, + hypre_Box *box ) +{ + HYPRE_Int ndim = hypre_BoxNDim(box); + HYPRE_Int d; + + hypre_fprintf(file, "(%d", hypre_BoxIMinD(box, 0)); + for (d = 1; d < ndim; d++) + { + hypre_fprintf(file, ", %d", hypre_BoxIMinD(box, d)); + } + hypre_fprintf(file, ") x (%d", hypre_BoxIMaxD(box, 0)); + for (d = 1; d < ndim; d++) + { + hypre_fprintf(file, ", %d", hypre_BoxIMaxD(box, d)); + } + hypre_fprintf(file, ")"); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Read a box from file + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxRead( FILE *file, + HYPRE_Int ndim, + hypre_Box **box_ptr ) +{ + hypre_Box *box; + HYPRE_Int d; + + /* Don't create a new box if the output box already exists */ + if (*box_ptr) + { + box = *box_ptr; + hypre_BoxInit(box, ndim); + } + else + { + box = hypre_BoxCreate(ndim); + } + + hypre_fscanf(file, "(%d", &hypre_BoxIMinD(box, 0)); + for (d = 1; d < ndim; d++) + { + hypre_fscanf(file, ", %d", &hypre_BoxIMinD(box, d)); } - + hypre_fscanf(file, ") x (%d", &hypre_BoxIMaxD(box, 0)); + for (d = 1; d < ndim; d++) + { + hypre_fscanf(file, ", %d", &hypre_BoxIMaxD(box, d)); + } + hypre_fscanf(file, ")"); + + *box_ptr = box; + return hypre_error_flag; } @@ -618,7 +729,7 @@ hypre_BoxArrayCreate( HYPRE_Int size, /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int hypre_BoxArrayDestroy( hypre_BoxArray *box_array ) { if (box_array) @@ -676,7 +787,7 @@ hypre_BoxArrayDuplicate( hypre_BoxArray *box_array ) HYPRE_Int i; new_box_array = hypre_BoxArrayCreate( - hypre_BoxArraySize(box_array), hypre_BoxArrayNDim(box_array)); + hypre_BoxArraySize(box_array), hypre_BoxArrayNDim(box_array)); hypre_ForBoxI(i, box_array) { hypre_CopyBox(hypre_BoxArrayBox(box_array, i), @@ -691,7 +802,7 @@ hypre_BoxArrayDuplicate( hypre_BoxArray *box_array ) * The box_array may be empty. *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int hypre_AppendBox( hypre_Box *box, hypre_BoxArray *box_array ) { @@ -708,7 +819,7 @@ hypre_AppendBox( hypre_Box *box, * Delete box from box_array. *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int hypre_DeleteBox( hypre_BoxArray *box_array, HYPRE_Int index ) { @@ -716,7 +827,7 @@ hypre_DeleteBox( hypre_BoxArray *box_array, for (i = index; i < hypre_BoxArraySize(box_array) - 1; i++) { - hypre_CopyBox(hypre_BoxArrayBox(box_array, i+1), + hypre_CopyBox(hypre_BoxArrayBox(box_array, i + 1), hypre_BoxArrayBox(box_array, i)); } @@ -730,7 +841,7 @@ hypre_DeleteBox( hypre_BoxArray *box_array, * Assumes indices are in ascending order. (AB 11/04) *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int hypre_DeleteMultipleBoxes( hypre_BoxArray *box_array, HYPRE_Int* indices, HYPRE_Int num ) @@ -742,30 +853,30 @@ hypre_DeleteMultipleBoxes( hypre_BoxArray *box_array, return hypre_error_flag; } - array_size = hypre_BoxArraySize(box_array); + array_size = hypre_BoxArraySize(box_array); start = indices[0]; j = 0; - + for (i = start; (i + j) < array_size; i++) { if (j < num) { - while ((i+j) == indices[j]) /* see if deleting consecutive items */ + while ((i + j) == indices[j]) /* see if deleting consecutive items */ { j++; /*increase the shift*/ - if (j == num) break; + if (j == num) { break; } } } - - if ( (i+j) < array_size) /* if deleting the last item then no moving */ + + if ( (i + j) < array_size) /* if deleting the last item then no moving */ { - hypre_CopyBox(hypre_BoxArrayBox(box_array, i+j), + hypre_CopyBox(hypre_BoxArrayBox(box_array, i + j), hypre_BoxArrayBox(box_array, i)); } } hypre_BoxArraySize(box_array) = array_size - num; - + return hypre_error_flag; } @@ -774,7 +885,7 @@ hypre_DeleteMultipleBoxes( hypre_BoxArray *box_array, * The box_array_1 may be empty. *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_Int hypre_AppendBoxArray( hypre_BoxArray *box_array_0, hypre_BoxArray *box_array_1 ) { @@ -808,12 +919,12 @@ hypre_BoxArrayArrayCreate( HYPRE_Int size, { hypre_BoxArrayArray *box_array_array; HYPRE_Int i; - + box_array_array = hypre_CTAlloc(hypre_BoxArrayArray, 1, HYPRE_MEMORY_HOST); - + hypre_BoxArrayArrayBoxArrays(box_array_array) = hypre_CTAlloc(hypre_BoxArray *, size, HYPRE_MEMORY_HOST); - + for (i = 0; i < size; i++) { hypre_BoxArrayArrayBoxArray(box_array_array, i) = @@ -821,7 +932,7 @@ hypre_BoxArrayArrayCreate( HYPRE_Int size, } hypre_BoxArrayArraySize(box_array_array) = size; hypre_BoxArrayArrayNDim(box_array_array) = ndim; - + return box_array_array; } @@ -832,12 +943,12 @@ HYPRE_Int hypre_BoxArrayArrayDestroy( hypre_BoxArrayArray *box_array_array ) { HYPRE_Int i; - + if (box_array_array) { hypre_ForBoxArrayI(i, box_array_array) - hypre_BoxArrayDestroy( - hypre_BoxArrayArrayBoxArray(box_array_array, i)); + hypre_BoxArrayDestroy( + hypre_BoxArrayArrayBoxArray(box_array_array, i)); hypre_TFree(hypre_BoxArrayArrayBoxArrays(box_array_array), HYPRE_MEMORY_HOST); hypre_TFree(box_array_array, HYPRE_MEMORY_HOST); @@ -856,24 +967,24 @@ hypre_BoxArrayArrayDuplicate( hypre_BoxArrayArray *box_array_array ) hypre_BoxArrayArray *new_box_array_array; hypre_BoxArray **new_box_arrays; HYPRE_Int new_size; - + hypre_BoxArray **box_arrays; HYPRE_Int i; - + new_size = hypre_BoxArrayArraySize(box_array_array); new_box_array_array = hypre_BoxArrayArrayCreate( - new_size, hypre_BoxArrayArrayNDim(box_array_array)); - + new_size, hypre_BoxArrayArrayNDim(box_array_array)); + if (new_size) { new_box_arrays = hypre_BoxArrayArrayBoxArrays(new_box_array_array); box_arrays = hypre_BoxArrayArrayBoxArrays(box_array_array); - + for (i = 0; i < new_size; i++) { hypre_AppendBoxArray(box_arrays[i], new_box_arrays[i]); } } - + return new_box_array_array; } diff --git a/external/hypre/src/struct_mv/box.h b/external/hypre/src/struct_mv/box.h index eae00613..8d4c97de 100644 --- a/external/hypre/src/struct_mv/box.h +++ b/external/hypre/src/struct_mv/box.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -18,12 +18,6 @@ #define HYPRE_MAXDIM 3 #endif -#if defined(HYPRE_USING_RAJA) || defined(HYPRE_USING_KOKKOS) || defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_DEVICE_OPENMP) || defined(HYPRE_USING_HIP) -#define hypre_BoxLoopSetOneBlock() -#else -#define hypre_BoxLoopSetOneBlock zypre_BoxLoopSetOneBlock -#endif - /*-------------------------------------------------------------------------- * hypre_Index: * This is used to define indices in index space, or dimension @@ -127,7 +121,7 @@ hypre_max(0, (hypre_BoxIMaxD(box, d) - hypre_BoxIMinD(box, d) + 1)) #define hypre_CCBoxIndexRank(box, index) 0 #define hypre_CCBoxIndexRank_noargs() 0 #define hypre_CCBoxOffsetDistance(box, index) 0 - + /*----- Avoid using these Box macros -----*/ #define hypre_BoxSizeX(box) hypre_BoxSizeD(box, 0) @@ -167,92 +161,6 @@ for (i = 0; i < hypre_BoxArraySize(box_array); i++) #define hypre_ForBoxArrayI(i, box_array_array) \ for (i = 0; i < hypre_BoxArrayArraySize(box_array_array); i++) -/*-------------------------------------------------------------------------- - * BoxLoop macros: - *--------------------------------------------------------------------------*/ -#define hypre_SerialBoxLoop0Begin(ndim, loop_size)\ -{\ - zypre_BoxLoopDeclare();\ - zypre_BoxLoopInit(ndim, loop_size);\ - hypre_BoxLoopSetOneBlock();\ - for (hypre__block = 0; hypre__block < hypre__num_blocks; hypre__block++)\ - {\ - zypre_BoxLoopSet();\ - for (hypre__J = 0; hypre__J < hypre__JN; hypre__J++)\ - {\ - for (hypre__I = 0; hypre__I < hypre__IN; hypre__I++)\ - { - -#define hypre_SerialBoxLoop0End()\ - }\ - zypre_BoxLoopInc1();\ - zypre_BoxLoopInc2();\ - }\ - }\ -} - -#define hypre_SerialBoxLoop1Begin(ndim, loop_size,\ - dbox1, start1, stride1, i1)\ -{\ - HYPRE_Int i1;\ - zypre_BoxLoopDeclare();\ - zypre_BoxLoopDeclareK(1);\ - zypre_BoxLoopInit(ndim, loop_size);\ - zypre_BoxLoopInitK(1, dbox1, start1, stride1, i1);\ - zypre_BoxLoopSetOneBlock();\ - for (hypre__block = 0; hypre__block < hypre__num_blocks; hypre__block++)\ - {\ - zypre_BoxLoopSet();\ - zypre_BoxLoopSetK(1, i1);\ - for (hypre__J = 0; hypre__J < hypre__JN; hypre__J++)\ - {\ - for (hypre__I = 0; hypre__I < hypre__IN; hypre__I++)\ - { - -#define hypre_SerialBoxLoop1End(i1)\ - i1 += hypre__i0inc1;\ - }\ - zypre_BoxLoopInc1();\ - i1 += hypre__ikinc1[hypre__d];\ - zypre_BoxLoopInc2();\ - }\ - }\ -} - -#define hypre_SerialBoxLoop2Begin(ndim, loop_size,\ - dbox1, start1, stride1, i1,\ - dbox2, start2, stride2, i2)\ -{\ - HYPRE_Int i1,i2;\ - zypre_BoxLoopDeclare();\ - zypre_BoxLoopDeclareK(1);\ - zypre_BoxLoopDeclareK(2);\ - zypre_BoxLoopInit(ndim, loop_size);\ - zypre_BoxLoopInitK(1, dbox1, start1, stride1, i1);\ - zypre_BoxLoopInitK(2, dbox2, start2, stride2, i2);\ - zypre_BoxLoopSetOneBlock();\ - for (hypre__block = 0; hypre__block < hypre__num_blocks; hypre__block++)\ - {\ - zypre_BoxLoopSet();\ - zypre_BoxLoopSetK(1, i1);\ - zypre_BoxLoopSetK(2, i2);\ - for (hypre__J = 0; hypre__J < hypre__JN; hypre__J++)\ - {\ - for (hypre__I = 0; hypre__I < hypre__IN; hypre__I++)\ - { - -#define hypre_SerialBoxLoop2End(i1, i2)\ - i1 += hypre__i0inc1;\ - i2 += hypre__i0inc2;\ - }\ - zypre_BoxLoopInc1();\ - i1 += hypre__ikinc1[hypre__d];\ - i2 += hypre__ikinc2[hypre__d];\ - zypre_BoxLoopInc2();\ - }\ - }\ -} - #define ZYPRE_BOX_PRIVATE hypre__IN,hypre__JN,hypre__I,hypre__J,hypre__d,hypre__i #define HYPRE_BOX_PRIVATE ZYPRE_BOX_PRIVATE @@ -286,6 +194,11 @@ if (hypre__num_blocks > 0)\ {\ hypre__div = hypre__tot / hypre__num_blocks;\ hypre__mod = hypre__tot % hypre__num_blocks;\ +}\ +else\ +{\ + hypre__div = 0;\ + hypre__mod = 0;\ } #define zypre_BoxLoopInitK(k, dboxk, startk, stridek, ik) \ @@ -363,199 +276,6 @@ for (hypre__d = 1; hypre__d < hypre__ndim; hypre__d++)\ /* Use this to get the block iteration inside a BoxLoop */ #define zypre_BoxLoopBlock() hypre__block - - - -/* FIXME: Remove !!! */ -/*-----------------------------------*/ -#define zypre_BoxLoop0Begin(ndim, loop_size)\ -{\ - zypre_BoxLoopDeclare();\ - zypre_BoxLoopInit(ndim, loop_size); - -#define zypre_BoxLoop0For()\ - for (hypre__block = 0; hypre__block < hypre__num_blocks; hypre__block++)\ - {\ - zypre_BoxLoopSet();\ - for (hypre__J = 0; hypre__J < hypre__JN; hypre__J++)\ - {\ - for (hypre__I = 0; hypre__I < hypre__IN; hypre__I++)\ - { - -#define zypre_BoxLoop0End()\ - }\ - zypre_BoxLoopInc1();\ - zypre_BoxLoopInc2();\ - }\ - }\ -} - -/*-----------------------------------*/ - -#define zypre_BoxLoop1Begin(ndim, loop_size,\ - dbox1, start1, stride1, i1)\ -{\ - HYPRE_Int i1;\ - zypre_BoxLoopDeclare();\ - zypre_BoxLoopDeclareK(1);\ - zypre_BoxLoopInit(ndim, loop_size);\ - zypre_BoxLoopInitK(1, dbox1, start1, stride1, i1); - -#define zypre_BoxLoop1For(i1)\ - for (hypre__block = 0; hypre__block < hypre__num_blocks; hypre__block++)\ - {\ - HYPRE_Int i1;\ - zypre_BoxLoopSet();\ - zypre_BoxLoopSetK(1, i1);\ - for (hypre__J = 0; hypre__J < hypre__JN; hypre__J++)\ - {\ - for (hypre__I = 0; hypre__I < hypre__IN; hypre__I++)\ - { - -#define zypre_BoxLoop1End(i1)\ - i1 += hypre__i0inc1;\ - }\ - zypre_BoxLoopInc1();\ - i1 += hypre__ikinc1[hypre__d];\ - zypre_BoxLoopInc2();\ - }\ - }\ -} - -/*-----------------------------------*/ - -#define zypre_BoxLoop2Begin(ndim, loop_size,\ - dbox1, start1, stride1, i1,\ - dbox2, start2, stride2, i2)\ -{\ - HYPRE_Int i1,i2;\ - zypre_BoxLoopDeclare();\ - zypre_BoxLoopDeclareK(1);\ - zypre_BoxLoopDeclareK(2);\ - zypre_BoxLoopInit(ndim, loop_size);\ - zypre_BoxLoopInitK(1, dbox1, start1, stride1, i1);\ - zypre_BoxLoopInitK(2, dbox2, start2, stride2, i2); - -#define zypre_BoxLoop2For(i1, i2)\ - for (hypre__block = 0; hypre__block < hypre__num_blocks; hypre__block++)\ - {\ - HYPRE_Int i1,i2;\ - zypre_BoxLoopSet();\ - zypre_BoxLoopSetK(1, i1);\ - zypre_BoxLoopSetK(2, i2);\ - for (hypre__J = 0; hypre__J < hypre__JN; hypre__J++)\ - {\ - for (hypre__I = 0; hypre__I < hypre__IN; hypre__I++)\ - { - -#define zypre_BoxLoop2End(i1, i2)\ - i1 += hypre__i0inc1;\ - i2 += hypre__i0inc2;\ - }\ - zypre_BoxLoopInc1();\ - i1 += hypre__ikinc1[hypre__d];\ - i2 += hypre__ikinc2[hypre__d];\ - zypre_BoxLoopInc2();\ - }\ - }\ -} - -/*-----------------------------------*/ - -#define zypre_BoxLoop3Begin(ndim, loop_size,\ - dbox1, start1, stride1, i1,\ - dbox2, start2, stride2, i2,\ - dbox3, start3, stride3, i3)\ -{\ - HYPRE_Int i1,i2,i3;\ - zypre_BoxLoopDeclare();\ - zypre_BoxLoopDeclareK(1);\ - zypre_BoxLoopDeclareK(2);\ - zypre_BoxLoopDeclareK(3);\ - zypre_BoxLoopInit(ndim, loop_size);\ - zypre_BoxLoopInitK(1, dbox1, start1, stride1, i1);\ - zypre_BoxLoopInitK(2, dbox2, start2, stride2, i2);\ - zypre_BoxLoopInitK(3, dbox3, start3, stride3, i3); - -#define zypre_BoxLoop3For(i1, i2, i3)\ - for (hypre__block = 0; hypre__block < hypre__num_blocks; hypre__block++)\ - {\ - HYPRE_Int i1,i2,i3;\ - zypre_BoxLoopSet();\ - zypre_BoxLoopSetK(1, i1);\ - zypre_BoxLoopSetK(2, i2);\ - zypre_BoxLoopSetK(3, i3);\ - for (hypre__J = 0; hypre__J < hypre__JN; hypre__J++)\ - {\ - for (hypre__I = 0; hypre__I < hypre__IN; hypre__I++)\ - { - -#define zypre_BoxLoop3End(i1, i2, i3)\ - i1 += hypre__i0inc1;\ - i2 += hypre__i0inc2;\ - i3 += hypre__i0inc3;\ - }\ - zypre_BoxLoopInc1();\ - i1 += hypre__ikinc1[hypre__d];\ - i2 += hypre__ikinc2[hypre__d];\ - i3 += hypre__ikinc3[hypre__d];\ - zypre_BoxLoopInc2();\ - }\ - }\ -} - -/*-----------------------------------*/ - -#define zypre_BoxLoop4Begin(ndim, loop_size,\ - dbox1, start1, stride1, i1,\ - dbox2, start2, stride2, i2,\ - dbox3, start3, stride3, i3,\ - dbox4, start4, stride4, i4)\ -{\ - HYPRE_Int i1,i2,i3,i4;\ - zypre_BoxLoopDeclare();\ - zypre_BoxLoopDeclareK(1);\ - zypre_BoxLoopDeclareK(2);\ - zypre_BoxLoopDeclareK(3);\ - zypre_BoxLoopDeclareK(4);\ - zypre_BoxLoopInit(ndim, loop_size);\ - zypre_BoxLoopInitK(1, dbox1, start1, stride1, i1);\ - zypre_BoxLoopInitK(2, dbox2, start2, stride2, i2);\ - zypre_BoxLoopInitK(3, dbox3, start3, stride3, i3);\ - zypre_BoxLoopInitK(4, dbox4, start4, stride4, i4); - -#define zypre_BoxLoop4For(i1, i2, i3, i4)\ - for (hypre__block = 0; hypre__block < hypre__num_blocks; hypre__block++)\ - {\ - HYPRE_Int i1,i2,i3,i4;\ - zypre_BoxLoopSet();\ - zypre_BoxLoopSetK(1, i1);\ - zypre_BoxLoopSetK(2, i2);\ - zypre_BoxLoopSetK(3, i3);\ - zypre_BoxLoopSetK(4, i4);\ - for (hypre__J = 0; hypre__J < hypre__JN; hypre__J++)\ - {\ - for (hypre__I = 0; hypre__I < hypre__IN; hypre__I++)\ - { - -#define zypre_BoxLoop4End(i1, i2, i3, i4)\ - i1 += hypre__i0inc1;\ - i2 += hypre__i0inc2;\ - i3 += hypre__i0inc3;\ - i4 += hypre__i0inc4;\ - }\ - zypre_BoxLoopInc1();\ - i1 += hypre__ikinc1[hypre__d];\ - i2 += hypre__ikinc2[hypre__d];\ - i3 += hypre__ikinc3[hypre__d];\ - i4 += hypre__ikinc4[hypre__d];\ - zypre_BoxLoopInc2();\ - }\ - }\ -} - -/*-----------------------------------*/ - #define zypre_BasicBoxLoopInitK(k, stridek) \ hypre__sk##k[0] = stridek[0];\ hypre__ikinc##k[0] = 0;\ @@ -569,25 +289,6 @@ hypre__i0inc##k = hypre__sk##k[0];\ hypre__ikinc##k[hypre__ndim] = 0;\ hypre__ikstart##k = 0 -#define zypre_BasicBoxLoop2Begin(ndim, loop_size,\ - stride1, i1,\ - stride2, i2)\ -{\ - zypre_BoxLoopDeclare();\ - zypre_BoxLoopDeclareK(1);\ - zypre_BoxLoopDeclareK(2);\ - zypre_BoxLoopInit(ndim, loop_size);\ - zypre_BasicBoxLoopInitK(1, stride1);\ - zypre_BasicBoxLoopInitK(2, stride2); - -/*-----------------------------------*/ - -#endif - - - - - /*-------------------------------------------------------------------------- * NOTES - Keep these for reference here and elsewhere in the code *--------------------------------------------------------------------------*/ @@ -595,8 +296,8 @@ hypre__ikstart##k = 0 #if 0 #define hypre_BoxLoop2Begin(loop_size, - dbox1, start1, stride1, i1, - dbox2, start2, stride2, i2) +dbox1, start1, stride1, i1, + dbox2, start2, stride2, i2) { /* init hypre__i1start */ HYPRE_Int hypre__i1start = hypre_BoxIndexRank(dbox1, start1); @@ -611,28 +312,28 @@ hypre__ikstart##k = 0 #define hypre_BoxLoop2For(i, j, k, i1, i2) for (hypre__block = 0; hypre__block < hypre__num_blocks; hypre__block++) { - /* set i and hypre__n */ - hypre_BoxLoopSet(i, j, k); - /* set i1 */ - i1 = hypre__i1start + i*hypre__sx1 + j*hypre__sy1 + k*hypre__sz1; - i2 = hypre__i2start + i*hypre__sx2 + j*hypre__sy2 + k*hypre__sz2; - for (k = 0; k < hypre__nz; k++) - { - for (j = 0; j < hypre__ny; j++) + /* set i and hypre__n */ + hypre_BoxLoopSet(i, j, k); + /* set i1 */ + i1 = hypre__i1start + i * hypre__sx1 + j * hypre__sy1 + k * hypre__sz1; + i2 = hypre__i2start + i * hypre__sx2 + j * hypre__sy2 + k * hypre__sz2; + for (k = 0; k < hypre__nz; k++) { - for (i = 0; i < hypre__nx; i++) + for (j = 0; j < hypre__ny; j++) { + for (i = 0; i < hypre__nx; i++) + { #define hypre_BoxLoop2End(i1, i2) - i1 += hypre__sx1; - i2 += hypre__sx2; + i1 += hypre__sx1; + i2 += hypre__sx2; + } + i1 += hypre__sy1 - hypre__nx * hypre__sx1; + i2 += hypre__sy2 - hypre__nx * hypre__sx2; } - i1 += hypre__sy1 - hypre__nx*hypre__sx1; - i2 += hypre__sy2 - hypre__nx*hypre__sx2; + i1 += hypre__sz1 - hypre__ny * hypre__sy1; + i2 += hypre__sz2 - hypre__ny * hypre__sy2; } - i1 += hypre__sz1 - hypre__ny*hypre__sy1; - i2 += hypre__sz2 - hypre__ny*hypre__sy2; - } } } @@ -643,7 +344,7 @@ hypre__ikstart##k = 0 N = 1; for (d = 0; d < ndim; d++) { - N *= n[d]; +N *= n[d]; i[d] = 0; n[d] -= 2; /* this produces a simpler comparison below */ } @@ -651,9 +352,9 @@ i[ndim] = 0; n[ndim] = 0; for (I = 0; I < N; I++) { - /* loop body */ +/* loop body */ - for (d = 0; i[d] > n[d]; d++) +for (d = 0; i[d] > n[d]; d++) { i[d] = 0; } @@ -669,7 +370,7 @@ for (I = 0; I < N; I++) N = 1; for (d = 1; d < ndim; d++) { - N *= n[d]; +N *= n[d]; i[d] = 0; n[d] -= 2; /* this produces a simpler comparison below */ } @@ -677,7 +378,7 @@ i[ndim] = 0; n[ndim] = 0; for (J = 0; J < N; J++) { - for (I = 0; I < n[0]; I++) +for (I = 0; I < n[0]; I++) { /* loop body */ @@ -694,3 +395,4 @@ for (J = 0; J < N; J++) } #endif +#endif /* #ifndef hypre_BOX_HEADER */ diff --git a/external/hypre/src/struct_mv/box_algebra.c b/external/hypre/src/struct_mv/box_algebra.c index df80589b..9b175623 100644 --- a/external/hypre/src/struct_mv/box_algebra.c +++ b/external/hypre/src/struct_mv/box_algebra.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -55,7 +55,7 @@ hypre_SubtractBoxes( hypre_Box *box1, * plus one, to have space for the remainder box. *------------------------------------------------------*/ - maxboxes = 2*ndim; + maxboxes = 2 * ndim; size = hypre_BoxArraySize(box_array); hypre_BoxArraySetSize(box_array, (size + maxboxes + 1)); @@ -88,7 +88,7 @@ hypre_SubtractBoxes( hypre_Box *box1, hypre_CopyBox(rembox, box); hypre_BoxIMaxD(box, d) = hypre_BoxIMinD(box2, d) - 1; hypre_BoxIMinD(rembox, d) = hypre_BoxIMinD(box2, d); - if ( hypre_BoxVolume(box) > 0 ) size++; + if ( hypre_BoxVolume(box) > 0 ) { size++; } } if ( hypre_BoxIMaxD(box2, d) < hypre_BoxIMaxD(rembox, d) ) { @@ -96,7 +96,7 @@ hypre_SubtractBoxes( hypre_Box *box1, hypre_CopyBox(rembox, box); hypre_BoxIMinD(box, d) = hypre_BoxIMaxD(box2, d) + 1; hypre_BoxIMaxD(rembox, d) = hypre_BoxIMaxD(box2, d); - if ( hypre_BoxVolume(box) > 0 ) size++; + if ( hypre_BoxVolume(box) > 0 ) { size++; } } } } @@ -196,16 +196,16 @@ hypre_UnionBoxes( hypre_BoxArray *boxes ) HYPRE_Int index; HYPRE_Int size; HYPRE_Int factor[3]; - + HYPRE_Int iminmax[2], imin[3], imax[3]; HYPRE_Int ii[3], dd[3]; HYPRE_Int join; HYPRE_Int i_tmp0, i_tmp1; HYPRE_Int ioff, joff, koff; HYPRE_Int bi, d, i, j, k; - + HYPRE_Int index_not_there; - + /*------------------------------------------------------ * If the size of boxes is less than 2, return *------------------------------------------------------*/ @@ -214,20 +214,20 @@ hypre_UnionBoxes( hypre_BoxArray *boxes ) { return hypre_error_flag; } - + /*------------------------------------------------------ * Set up the block_index array *------------------------------------------------------*/ - + i_tmp0 = 2 * hypre_BoxArraySize(boxes); block_index[0] = hypre_TAlloc(HYPRE_Int, 3 * i_tmp0, HYPRE_MEMORY_HOST); block_sz[0] = 0; for (d = 1; d < 3; d++) { - block_index[d] = block_index[d-1] + i_tmp0; + block_index[d] = block_index[d - 1] + i_tmp0; block_sz[d] = 0; } - + hypre_ForBoxI(bi, boxes) { box = hypre_BoxArrayBox(boxes, bi); @@ -246,7 +246,9 @@ hypre_UnionBoxes( hypre_BoxArray *boxes ) if (iminmax[i] <= block_index[d][j]) { if (iminmax[i] == block_index[d][j]) + { index_not_there = 0; + } break; } } @@ -255,7 +257,9 @@ hypre_UnionBoxes( hypre_BoxArray *boxes ) if (index_not_there) { for (k = block_sz[d]; k > j; k--) - block_index[d][k] = block_index[d][k-1]; + { + block_index[d][k] = block_index[d][k - 1]; + } block_index[d][j] = iminmax[i]; block_sz[d]++; } @@ -264,23 +268,25 @@ hypre_UnionBoxes( hypre_BoxArray *boxes ) } for (d = 0; d < 3; d++) + { block_sz[d]--; + } block_volume = block_sz[0] * block_sz[1] * block_sz[2]; - + /*------------------------------------------------------ * Set factor values *------------------------------------------------------*/ - + factor[0] = 1; factor[1] = (block_sz[0] + 1); factor[2] = (block_sz[1] + 1) * factor[1]; - + /*------------------------------------------------------ * Set up the block array *------------------------------------------------------*/ - + block = hypre_CTAlloc(HYPRE_Int, block_volume, HYPRE_MEMORY_HOST); - + hypre_ForBoxI(bi, boxes) { box = hypre_BoxArrayBox(boxes, bi); @@ -291,11 +297,15 @@ hypre_UnionBoxes( hypre_BoxArray *boxes ) j = 0; while (hypre_BoxIMinD(box, d) != block_index[d][j]) + { j++; + } imin[d] = j; while (hypre_BoxIMaxD(box, d) + 1 != block_index[d][j]) + { j++; + } imax[d] = j; } @@ -313,7 +323,7 @@ hypre_UnionBoxes( hypre_BoxArray *boxes ) } } } - + /*------------------------------------------------------ * Join block array in x, then y, then z * @@ -326,7 +336,7 @@ hypre_UnionBoxes( hypre_BoxArray *boxes ) for (d = 0; d < 3; d++) { - switch(d) + switch (d) { case 0: /* join in x */ dd[0] = 0; @@ -370,13 +380,15 @@ hypre_UnionBoxes( hypre_BoxArray *boxes ) join = 1; } else + { join = 0; + } } } } } } - + /*------------------------------------------------------ * Set up the boxes BoxArray *------------------------------------------------------*/ @@ -385,7 +397,9 @@ hypre_UnionBoxes( hypre_BoxArray *boxes ) for (index = 0; index < block_volume; index++) { if (block[index]) + { size++; + } } hypre_BoxArraySetSize(boxes, size); @@ -413,7 +427,7 @@ hypre_UnionBoxes( hypre_BoxArray *boxes ) size++; } - + index++; } } @@ -425,7 +439,7 @@ hypre_UnionBoxes( hypre_BoxArray *boxes ) hypre_TFree(block_index[0], HYPRE_MEMORY_HOST); hypre_TFree(block, HYPRE_MEMORY_HOST); - + return hypre_error_flag; } @@ -450,23 +464,23 @@ hypre_MinUnionBoxes( hypre_BoxArray *boxes ) HYPRE_Int i, j, size, min_size, array; - size= hypre_BoxArraySize(boxes); - rotated_box= hypre_CTAlloc(hypre_Box, 1, HYPRE_MEMORY_HOST); - rotated_array= hypre_BoxArrayArrayCreate(5, hypre_BoxArrayNDim(boxes)); + size = hypre_BoxArraySize(boxes); + rotated_box = hypre_CTAlloc(hypre_Box, 1, HYPRE_MEMORY_HOST); + rotated_array = hypre_BoxArrayArrayCreate(5, hypre_BoxArrayNDim(boxes)); - for (i= 0; i< 5; i++) + for (i = 0; i < 5; i++) { - rotated_boxes= hypre_BoxArrayArrayBoxArray(rotated_array, i); - switch(i) + rotated_boxes = hypre_BoxArrayArrayBoxArray(rotated_array, i); + switch (i) { case 0: - for (j= 0; j< size; j++) + for (j = 0; j < size; j++) { - box= hypre_BoxArrayBox(boxes, j); + box = hypre_BoxArrayBox(boxes, j); hypre_SetIndex3(lower, hypre_BoxIMin(box)[0], hypre_BoxIMin(box)[2], - hypre_BoxIMin(box)[1]); + hypre_BoxIMin(box)[1]); hypre_SetIndex3(upper, hypre_BoxIMax(box)[0], hypre_BoxIMax(box)[2], - hypre_BoxIMax(box)[1]); + hypre_BoxIMax(box)[1]); hypre_BoxSetExtents(rotated_box, lower, upper); hypre_AppendBox(rotated_box, rotated_boxes); } @@ -474,13 +488,13 @@ hypre_MinUnionBoxes( hypre_BoxArray *boxes ) break; case 1: - for (j= 0; j< size; j++) + for (j = 0; j < size; j++) { - box= hypre_BoxArrayBox(boxes, j); + box = hypre_BoxArrayBox(boxes, j); hypre_SetIndex3(lower, hypre_BoxIMin(box)[1], hypre_BoxIMin(box)[2], - hypre_BoxIMin(box)[0]); + hypre_BoxIMin(box)[0]); hypre_SetIndex3(upper, hypre_BoxIMax(box)[1], hypre_BoxIMax(box)[2], - hypre_BoxIMax(box)[0]); + hypre_BoxIMax(box)[0]); hypre_BoxSetExtents(rotated_box, lower, upper); hypre_AppendBox(rotated_box, rotated_boxes); } @@ -488,13 +502,13 @@ hypre_MinUnionBoxes( hypre_BoxArray *boxes ) break; case 2: - for (j= 0; j< size; j++) + for (j = 0; j < size; j++) { - box= hypre_BoxArrayBox(boxes, j); + box = hypre_BoxArrayBox(boxes, j); hypre_SetIndex3(lower, hypre_BoxIMin(box)[1], hypre_BoxIMin(box)[0], - hypre_BoxIMin(box)[2]); + hypre_BoxIMin(box)[2]); hypre_SetIndex3(upper, hypre_BoxIMax(box)[1], hypre_BoxIMax(box)[0], - hypre_BoxIMax(box)[2]); + hypre_BoxIMax(box)[2]); hypre_BoxSetExtents(rotated_box, lower, upper); hypre_AppendBox(rotated_box, rotated_boxes); } @@ -502,13 +516,13 @@ hypre_MinUnionBoxes( hypre_BoxArray *boxes ) break; case 3: - for (j= 0; j< size; j++) + for (j = 0; j < size; j++) { - box= hypre_BoxArrayBox(boxes, j); + box = hypre_BoxArrayBox(boxes, j); hypre_SetIndex3(lower, hypre_BoxIMin(box)[2], hypre_BoxIMin(box)[0], - hypre_BoxIMin(box)[1]); + hypre_BoxIMin(box)[1]); hypre_SetIndex3(upper, hypre_BoxIMax(box)[2], hypre_BoxIMax(box)[0], - hypre_BoxIMax(box)[1]); + hypre_BoxIMax(box)[1]); hypre_BoxSetExtents(rotated_box, lower, upper); hypre_AppendBox(rotated_box, rotated_boxes); } @@ -516,13 +530,13 @@ hypre_MinUnionBoxes( hypre_BoxArray *boxes ) break; case 4: - for (j= 0; j< size; j++) + for (j = 0; j < size; j++) { - box= hypre_BoxArrayBox(boxes, j); + box = hypre_BoxArrayBox(boxes, j); hypre_SetIndex3(lower, hypre_BoxIMin(box)[2], hypre_BoxIMin(box)[1], - hypre_BoxIMin(box)[0]); + hypre_BoxIMin(box)[0]); hypre_SetIndex3(upper, hypre_BoxIMax(box)[2], hypre_BoxIMax(box)[1], - hypre_BoxIMax(box)[0]); + hypre_BoxIMax(box)[0]); hypre_BoxSetExtents(rotated_box, lower, upper); hypre_AppendBox(rotated_box, rotated_boxes); } @@ -535,97 +549,97 @@ hypre_MinUnionBoxes( hypre_BoxArray *boxes ) hypre_UnionBoxes(boxes); - array= 5; - min_size= hypre_BoxArraySize(boxes); - - for (i= 0; i< 5; i++) + array = 5; + min_size = hypre_BoxArraySize(boxes); + + for (i = 0; i < 5; i++) { - rotated_boxes= hypre_BoxArrayArrayBoxArray(rotated_array, i); + rotated_boxes = hypre_BoxArrayArrayBoxArray(rotated_array, i); if (hypre_BoxArraySize(rotated_boxes) < min_size) { - min_size= hypre_BoxArraySize(rotated_boxes); - array= i; + min_size = hypre_BoxArraySize(rotated_boxes); + array = i; } } - + /* copy the box_array with the minimum number of boxes to boxes */ if (array != 5) - { - rotated_boxes= hypre_BoxArrayArrayBoxArray(rotated_array, array); - hypre_BoxArraySize(boxes)= min_size; + { + rotated_boxes = hypre_BoxArrayArrayBoxArray(rotated_array, array); + hypre_BoxArraySize(boxes) = min_size; - switch(array) + switch (array) { case 0: - for (j= 0; j< min_size; j++) + for (j = 0; j < min_size; j++) { - rotated_box= hypre_BoxArrayBox(rotated_boxes, j); + rotated_box = hypre_BoxArrayBox(rotated_boxes, j); hypre_SetIndex3(lower, hypre_BoxIMin(rotated_box)[0], - hypre_BoxIMin(rotated_box)[2], - hypre_BoxIMin(rotated_box)[1]); + hypre_BoxIMin(rotated_box)[2], + hypre_BoxIMin(rotated_box)[1]); hypre_SetIndex3(upper, hypre_BoxIMax(rotated_box)[0], - hypre_BoxIMax(rotated_box)[2], - hypre_BoxIMax(rotated_box)[1]); + hypre_BoxIMax(rotated_box)[2], + hypre_BoxIMax(rotated_box)[1]); hypre_BoxSetExtents( hypre_BoxArrayBox(boxes, j), lower, upper); } break; case 1: - for (j= 0; j< min_size; j++) + for (j = 0; j < min_size; j++) { - rotated_box= hypre_BoxArrayBox(rotated_boxes, j); + rotated_box = hypre_BoxArrayBox(rotated_boxes, j); hypre_SetIndex3(lower, hypre_BoxIMin(rotated_box)[2], - hypre_BoxIMin(rotated_box)[0], - hypre_BoxIMin(rotated_box)[1]); + hypre_BoxIMin(rotated_box)[0], + hypre_BoxIMin(rotated_box)[1]); hypre_SetIndex3(upper, hypre_BoxIMax(rotated_box)[2], - hypre_BoxIMax(rotated_box)[0], - hypre_BoxIMax(rotated_box)[1]); + hypre_BoxIMax(rotated_box)[0], + hypre_BoxIMax(rotated_box)[1]); hypre_BoxSetExtents( hypre_BoxArrayBox(boxes, j), lower, upper); } break; case 2: - for (j= 0; j< min_size; j++) + for (j = 0; j < min_size; j++) { - rotated_box= hypre_BoxArrayBox(rotated_boxes, j); + rotated_box = hypre_BoxArrayBox(rotated_boxes, j); hypre_SetIndex3(lower, hypre_BoxIMin(rotated_box)[1], - hypre_BoxIMin(rotated_box)[0], - hypre_BoxIMin(rotated_box)[2]); + hypre_BoxIMin(rotated_box)[0], + hypre_BoxIMin(rotated_box)[2]); hypre_SetIndex3(upper, hypre_BoxIMax(rotated_box)[1], - hypre_BoxIMax(rotated_box)[0], - hypre_BoxIMax(rotated_box)[2]); + hypre_BoxIMax(rotated_box)[0], + hypre_BoxIMax(rotated_box)[2]); hypre_BoxSetExtents( hypre_BoxArrayBox(boxes, j), lower, upper); } break; case 3: - for (j= 0; j< min_size; j++) + for (j = 0; j < min_size; j++) { - rotated_box= hypre_BoxArrayBox(rotated_boxes, j); + rotated_box = hypre_BoxArrayBox(rotated_boxes, j); hypre_SetIndex3(lower, hypre_BoxIMin(rotated_box)[1], - hypre_BoxIMin(rotated_box)[2], - hypre_BoxIMin(rotated_box)[0]); + hypre_BoxIMin(rotated_box)[2], + hypre_BoxIMin(rotated_box)[0]); hypre_SetIndex3(upper, hypre_BoxIMax(rotated_box)[1], - hypre_BoxIMax(rotated_box)[2], - hypre_BoxIMax(rotated_box)[0]); + hypre_BoxIMax(rotated_box)[2], + hypre_BoxIMax(rotated_box)[0]); hypre_BoxSetExtents( hypre_BoxArrayBox(boxes, j), lower, upper); } break; case 4: - for (j= 0; j< min_size; j++) + for (j = 0; j < min_size; j++) { - rotated_box= hypre_BoxArrayBox(rotated_boxes, j); + rotated_box = hypre_BoxArrayBox(rotated_boxes, j); hypre_SetIndex3(lower, hypre_BoxIMin(rotated_box)[2], - hypre_BoxIMin(rotated_box)[1], - hypre_BoxIMin(rotated_box)[0]); + hypre_BoxIMin(rotated_box)[1], + hypre_BoxIMin(rotated_box)[0]); hypre_SetIndex3(upper, hypre_BoxIMax(rotated_box)[2], - hypre_BoxIMax(rotated_box)[1], - hypre_BoxIMax(rotated_box)[0]); + hypre_BoxIMax(rotated_box)[1], + hypre_BoxIMax(rotated_box)[0]); hypre_BoxSetExtents( hypre_BoxArrayBox(boxes, j), lower, upper); } diff --git a/external/hypre/src/struct_mv/box_boundary.c b/external/hypre/src/struct_mv/box_boundary.c index dcb3afe7..9a2ebd2c 100644 --- a/external/hypre/src/struct_mv/box_boundary.c +++ b/external/hypre/src/struct_mv/box_boundary.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -9,13 +9,13 @@ * * NOTE: The following routines are currently only used as follows in hypre, and * also appear in '_hypre_struct_mv.h': - * + * * hypre_BoxBoundaryG * struct_mv/box_boundary.c * struct_mv/struct_vector.c * sstruct_ls/maxwell_grad.c * sstruct_ls/maxwell_TV_setup.c - * + * * hypre_BoxBoundaryDG * struct_mv/box_boundary.c * sstruct_ls/maxwell_grad.c @@ -103,7 +103,7 @@ hypre_BoxBoundaryG( hypre_Box *box, HYPRE_Int ndim = hypre_BoxNDim(box); hypre_BoxArray *boundary_d; HYPRE_Int d; - + boundary_d = hypre_BoxArrayCreate(0, ndim); for (d = 0; d < ndim; d++) { @@ -140,7 +140,7 @@ hypre_BoxBoundaryDG( hypre_Box *box, /*-------------------------------------------------------------------------- * Intersect a surface of 'box' with the physical boundary. A stencil element - * indicates in which direction the surface should be determined. + * indicates in which direction the surface should be determined. * * The result will be returned in the box array 'boundary'. Any boxes already * in 'boundary' will be overwritten. @@ -148,9 +148,9 @@ hypre_BoxBoundaryDG( hypre_Box *box, HYPRE_Int hypre_GeneralBoxBoundaryIntersect( hypre_Box *box, - hypre_StructGrid *grid, - hypre_Index stencil_element, - hypre_BoxArray *boundary ) + hypre_StructGrid *grid, + hypre_Index stencil_element, + hypre_BoxArray *boundary ) { hypre_BoxManager *boxman; hypre_BoxManEntry **entries; @@ -163,8 +163,10 @@ hypre_GeneralBoxBoundaryIntersect( hypre_Box *box, ndim = hypre_StructGridNDim(grid); dd = hypre_CTAlloc(HYPRE_Int, ndim, HYPRE_MEMORY_HOST); - for (i=0; i < ndim; i++) - dd[i] = hypre_IndexD(stencil_element, i); + for (i = 0; i < ndim; i++) + { + dd[i] = hypre_IndexD(stencil_element, i); + } /* set bbox to the box surface of interest */ hypre_BoxArraySetSize(boundary, 1); @@ -172,7 +174,7 @@ hypre_GeneralBoxBoundaryIntersect( hypre_Box *box, hypre_CopyBox(box, bbox); /* temporarily shift bbox in direction dir and intersect with the grid */ - for (i=0; i < ndim; i++) + for (i = 0; i < ndim; i++) { hypre_BoxIMinD(bbox, i) += dd[i]; hypre_BoxIMaxD(bbox, i) += dd[i]; @@ -181,7 +183,7 @@ hypre_GeneralBoxBoundaryIntersect( hypre_Box *box, boxman = hypre_StructGridBoxMan(grid); hypre_BoxManIntersect(boxman, hypre_BoxIMin(bbox), hypre_BoxIMax(bbox), &entries, &nentries); - for (i=0; i < ndim; i++) + for (i = 0; i < ndim; i++) { hypre_BoxIMinD(bbox, i) -= dd[i]; hypre_BoxIMaxD(bbox, i) -= dd[i]; @@ -195,7 +197,7 @@ hypre_GeneralBoxBoundaryIntersect( hypre_Box *box, ibox = hypre_BoxArrayBox(int_boxes, i); hypre_BoxManEntryGetExtents( entries[i], hypre_BoxIMin(ibox), hypre_BoxIMax(ibox)); - for (j=0; j < ndim; j++) + for (j = 0; j < ndim; j++) { hypre_BoxIMinD(ibox, j) -= dd[j]; hypre_BoxIMaxD(ibox, j) -= dd[j]; diff --git a/external/hypre/src/struct_mv/box_manager.c b/external/hypre/src/struct_mv/box_manager.c index 23871914..b0ac4cf6 100644 --- a/external/hypre/src/struct_mv/box_manager.c +++ b/external/hypre/src/struct_mv/box_manager.c @@ -1,19 +1,19 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ /******************************************************************************* - + BoxManager: AHB 10/06, updated 10/09 (changes to info object) purpose:: organize arbitrary information in a spatial way -misc. notes/considerations/open questions: +misc. notes/considerations/open questions: (1) In the struct code, we want to use Box Manager instead of current box neighbor stuff (see Struct function @@ -23,7 +23,7 @@ misc. notes/considerations/open questions: (2) will associate a Box Manager with the struct grid (implement under the struct grid) - (3) will interface with the Box Manager in the struct coarsen routine + (3) will interface with the Box Manager in the struct coarsen routine the coarsen routine: @@ -32,7 +32,7 @@ misc. notes/considerations/open questions: adding the boxes via AddEntry (b) check the max_distance value and see if we have - all the neighbor info we need in the current box manager. + all the neighbor info we need in the current box manager. (c) if (b) is no, then call GatherEntries as needed on the coarse box manager @@ -40,16 +40,16 @@ misc. notes/considerations/open questions: (d) call assemble for the new coarse box manager (note: if gather entries has not been called, then no communication is required - + (4) We will associate an assumed partition with the box manager - (this will be created in the box manager assemble routine) + (this will be created in the box manager assemble routine) (5) We use the box manager with sstruct "on the side" as the boxmap is now, (at issue is modifying the "info" associated with an entry after the box manager has already been assembled through the underlying struct grid) - (6) In SStruct we will have a separate box manager for the + (6) In SStruct we will have a separate box manager for the neighbor box information ********************************************************************************/ @@ -71,7 +71,7 @@ hypre_entryswap2( HYPRE_Int *v, HYPRE_Int temp; hypre_BoxManEntry *temp_e; - + temp = v[i]; v[i] = v[j]; v[j] = temp; @@ -93,9 +93,9 @@ hypre_entryqsort2( HYPRE_Int *v, { return; } - hypre_entryswap2( v, ent, left, (left+right)/2); + hypre_entryswap2( v, ent, left, (left + right) / 2); last = left; - for (i = left+1; i <= right; i++) + for (i = left + 1; i <= right; i++) { if (v[i] < v[left]) { @@ -103,8 +103,8 @@ hypre_entryqsort2( HYPRE_Int *v, } } hypre_entryswap2(v, ent, left, last); - hypre_entryqsort2(v, ent, left, last-1); - hypre_entryqsort2(v, ent, last+1, right); + hypre_entryqsort2(v, ent, left, last - 1); + hypre_entryqsort2(v, ent, last + 1, right); } /*-------------------------------------------------------------------------- @@ -131,7 +131,7 @@ hypre_BoxManEntryGetInfo (hypre_BoxManEntry *entry, { HYPRE_Int position = hypre_BoxManEntryPosition(entry); hypre_BoxManager *boxman; - + boxman = (hypre_BoxManager *) hypre_BoxManEntryBoxMan(entry); *info_ptr = hypre_BoxManInfoObject(boxman, position); @@ -172,7 +172,7 @@ hypre_BoxManEntryCopy( hypre_BoxManEntry *fromentry, { HYPRE_Int ndim = hypre_BoxManEntryNDim(fromentry); HYPRE_Int d; - + hypre_Index imin; hypre_Index imax; @@ -191,15 +191,15 @@ hypre_BoxManEntryCopy( hypre_BoxManEntry *fromentry, hypre_IndexD(toentry_imax, d) = hypre_IndexD(imax, d); } hypre_BoxManEntryNDim(toentry) = ndim; - + /* copy proc and id */ hypre_BoxManEntryProc(toentry) = hypre_BoxManEntryProc(fromentry); hypre_BoxManEntryId(toentry) = hypre_BoxManEntryId(fromentry); /*copy ghost */ - for (d = 0; d < 2*ndim; d++) + for (d = 0; d < 2 * ndim; d++) { - hypre_BoxManEntryNumGhost(toentry)[d] = + hypre_BoxManEntryNumGhost(toentry)[d] = hypre_BoxManEntryNumGhost(fromentry)[d]; } @@ -210,7 +210,7 @@ hypre_BoxManEntryCopy( hypre_BoxManEntry *fromentry, /* copy list pointer */ hypre_BoxManEntryNext(toentry) = hypre_BoxManEntryNext(fromentry); - + return hypre_error_flag; } @@ -265,13 +265,13 @@ hypre_BoxManGetIsEntriesSort ( hypre_BoxManager *manager, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_BoxManGetGlobalIsGatherCalled( hypre_BoxManager *manager, - MPI_Comm comm, +hypre_BoxManGetGlobalIsGatherCalled( hypre_BoxManager *manager, + MPI_Comm comm, HYPRE_Int *is_gather ) { HYPRE_Int loc_is_gather; HYPRE_Int nprocs; - + hypre_MPI_Comm_size(comm, &nprocs); loc_is_gather = hypre_BoxManIsGatherCalled(manager); @@ -293,7 +293,7 @@ hypre_BoxManGetGlobalIsGatherCalled( hypre_BoxManager *manager, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_BoxManGetAssumedPartition( hypre_BoxManager *manager, +hypre_BoxManGetAssumedPartition( hypre_BoxManager *manager, hypre_StructAssumedPart **assumed_partition ) { *assumed_partition = hypre_BoxManAssumedPartition(manager); @@ -321,7 +321,7 @@ hypre_BoxManSetBoundingBox ( hypre_BoxManager *manager, hypre_Box *bounding_box ) { hypre_Box* bbox = hypre_BoxManBoundingBox(manager); - + hypre_BoxSetExtents(bbox, hypre_BoxIMin(bounding_box), hypre_BoxIMax(bounding_box)); @@ -336,8 +336,8 @@ hypre_BoxManSetNumGhost( hypre_BoxManager *manager, HYPRE_Int *num_ghost ) { HYPRE_Int i, ndim = hypre_BoxManNDim(manager); - - for (i = 0; i < 2*ndim; i++) + + for (i = 0; i < 2 * ndim; i++) { hypre_BoxManNumGhost(manager)[i] = num_ghost[i]; } @@ -353,8 +353,8 @@ hypre_BoxManSetNumGhost( hypre_BoxManager *manager, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_BoxManDeleteMultipleEntriesAndInfo( hypre_BoxManager *manager, - HYPRE_Int* indices , +hypre_BoxManDeleteMultipleEntriesAndInfo( hypre_BoxManager *manager, + HYPRE_Int* indices, HYPRE_Int num ) { HYPRE_Int i, j, start; @@ -364,37 +364,37 @@ hypre_BoxManDeleteMultipleEntriesAndInfo( hypre_BoxManager *manager, void *to_ptr; void *from_ptr; - + hypre_BoxManEntry *entries = hypre_BoxManEntries(manager); - if (num > 0) + if (num > 0) { start = indices[0]; j = 0; - + for (i = start; (i + j) < array_size; i++) { if (j < num) { - while ((i+j) == indices[j]) /* see if deleting consecutive items */ + while ((i + j) == indices[j]) /* see if deleting consecutive items */ { j++; /*increase the shift*/ - if (j == num) break; + if (j == num) { break; } } } - - if ( (i+j) < array_size) /* if deleting the last item then no moving */ + + if ( (i + j) < array_size) /* if deleting the last item then no moving */ { /*copy the entry */ - hypre_BoxManEntryCopy(&entries[i+j], &entries[i]); - + hypre_BoxManEntryCopy(&entries[i + j], &entries[i]); + /* change the position */ hypre_BoxManEntryPosition(&entries[i]) = i; - + /* copy the info object */ to_ptr = hypre_BoxManInfoObject(manager, i); - from_ptr = hypre_BoxManInfoObject(manager, i+j); + from_ptr = hypre_BoxManInfoObject(manager, i + j); hypre_TMemcpy(to_ptr, from_ptr, char, info_size, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); } @@ -415,7 +415,7 @@ hypre_BoxManDeleteMultipleEntriesAndInfo( hypre_BoxManager *manager, * adding entries with BoxManAddEntry * * (2) info_size indicates the size (in bytes) of the info object that - * will be attached to each entry in this box manager. + * will be attached to each entry in this box manager. * * (3) we will collect the bounding box - this is used by the AP * @@ -434,7 +434,7 @@ hypre_BoxManCreate( HYPRE_Int max_nentries, hypre_BoxManager *manager; hypre_Box *bbox; - HYPRE_Int i, d; + HYPRE_Int i, d; /* allocate object */ manager = hypre_CTAlloc(hypre_BoxManager, 1, HYPRE_MEMORY_HOST); @@ -449,15 +449,15 @@ hypre_BoxManCreate( HYPRE_Int max_nentries, { hypre_BoxManIndexesD(manager, d) = NULL; } - + hypre_BoxManNEntries(manager) = 0; hypre_BoxManEntries(manager) = hypre_CTAlloc(hypre_BoxManEntry, max_nentries, HYPRE_MEMORY_HOST); hypre_BoxManInfoObjects(manager) = NULL; - hypre_BoxManInfoObjects(manager) = hypre_TAlloc(char, max_nentries*info_size, HYPRE_MEMORY_HOST); + hypre_BoxManInfoObjects(manager) = hypre_TAlloc(char, max_nentries * info_size, HYPRE_MEMORY_HOST); hypre_BoxManIndexTable(manager) = NULL; - + hypre_BoxManNumProcsSort(manager) = 0; hypre_BoxManIdsSort(manager) = hypre_CTAlloc(HYPRE_Int, max_nentries, HYPRE_MEMORY_HOST); hypre_BoxManProcsSort(manager) = hypre_CTAlloc(HYPRE_Int, max_nentries, HYPRE_MEMORY_HOST); @@ -475,7 +475,7 @@ hypre_BoxManCreate( HYPRE_Int max_nentries, hypre_BoxManNumMyEntries(manager) = 0; hypre_BoxManMyIds(manager) = NULL; hypre_BoxManMyEntries(manager) = NULL; - + hypre_BoxManAssumedPartition(manager) = NULL; hypre_BoxManMyIds(manager) = hypre_CTAlloc(HYPRE_Int, max_nentries, HYPRE_MEMORY_HOST); @@ -488,9 +488,9 @@ hypre_BoxManCreate( HYPRE_Int max_nentries, hypre_BoxIMax(bounding_box)); hypre_BoxManNextId(manager) = 0; - + /* ghost points: we choose a default that will give zero everywhere..*/ - for (i = 0; i < 2*HYPRE_MAXDIM; i++) + for (i = 0; i < 2 * HYPRE_MAXDIM; i++) { hypre_BoxManNumGhost(manager)[i] = 0; } @@ -504,7 +504,7 @@ hypre_BoxManCreate( HYPRE_Int max_nentries, /*-------------------------------------------------------------------------- * Increase storage for entries (for future calls to BoxManAddEntry). * - * Notes: + * Notes: * * In addition, we will dynamically allocate more memory if needed when a call * to BoxManAddEntry is made and there is not enough storage available. @@ -518,7 +518,7 @@ hypre_BoxManIncSize ( hypre_BoxManager *manager, HYPRE_Int *ids = hypre_BoxManIdsSort(manager); HYPRE_Int *procs = hypre_BoxManProcsSort(manager); HYPRE_Int info_size = hypre_BoxManEntryInfoSize(manager); - + void *info = hypre_BoxManInfoObjects(manager); hypre_BoxManEntry *entries = hypre_BoxManEntries(manager); @@ -529,7 +529,7 @@ hypre_BoxManIncSize ( hypre_BoxManager *manager, entries = hypre_TReAlloc(entries, hypre_BoxManEntry, max_nentries, HYPRE_MEMORY_HOST); ids = hypre_TReAlloc(ids, HYPRE_Int, max_nentries, HYPRE_MEMORY_HOST); procs = hypre_TReAlloc(procs, HYPRE_Int, max_nentries, HYPRE_MEMORY_HOST); - info = (void *) hypre_TReAlloc((char *)info, char, max_nentries*info_size, HYPRE_MEMORY_HOST); + info = (void *) hypre_TReAlloc((char *)info, char, max_nentries * info_size, HYPRE_MEMORY_HOST); /* update manager */ hypre_BoxManMaxNEntries(manager) = max_nentries; @@ -542,15 +542,15 @@ hypre_BoxManIncSize ( hypre_BoxManager *manager, { HYPRE_Int *my_ids = hypre_BoxManMyIds(manager); hypre_BoxManEntry **my_entries = hypre_BoxManMyEntries(manager); - + my_ids = hypre_TReAlloc(my_ids, HYPRE_Int, max_nentries, HYPRE_MEMORY_HOST); my_entries = hypre_TReAlloc(my_entries, hypre_BoxManEntry *, max_nentries, HYPRE_MEMORY_HOST); - + hypre_BoxManMyIds(manager) = my_ids; hypre_BoxManMyEntries(manager) = my_entries; } - + return hypre_error_flag; } @@ -574,13 +574,13 @@ hypre_BoxManDestroy( hypre_BoxManager *manager ) hypre_TFree(hypre_BoxManEntries(manager), HYPRE_MEMORY_HOST); hypre_TFree(hypre_BoxManInfoObjects(manager), HYPRE_MEMORY_HOST); - + hypre_TFree(hypre_BoxManIndexTable(manager), HYPRE_MEMORY_HOST); - + hypre_TFree(hypre_BoxManIdsSort(manager), HYPRE_MEMORY_HOST); hypre_TFree(hypre_BoxManProcsSort(manager), HYPRE_MEMORY_HOST); hypre_TFree(hypre_BoxManProcsSortOffsets(manager), HYPRE_MEMORY_HOST); - + hypre_BoxArrayDestroy(hypre_BoxManGatherRegions(manager)); hypre_TFree(hypre_BoxManMyIds(manager), HYPRE_MEMORY_HOST); @@ -597,7 +597,7 @@ hypre_BoxManDestroy( hypre_BoxManager *manager ) } /*-------------------------------------------------------------------------- - * Add a box (entry) to the box manager. Each entry is given a + * Add a box (entry) to the box manager. Each entry is given a * unique id (proc_id, box_id). Need to assemble after adding entries. * * Notes: @@ -610,7 +610,7 @@ hypre_BoxManDestroy( hypre_BoxManager *manager ) * * (3) Only add entries whose boxes have non-zero volume. * - * (4) The info object will be copied (according to the info size given in + * (4) The info object will be copied (according to the info size given in * the create) to storage within the box manager. * * (5) If the id passed in is negative (user doesn't care what it is) , @@ -620,7 +620,7 @@ hypre_BoxManDestroy( hypre_BoxManager *manager ) HYPRE_Int hypre_BoxManAddEntry( hypre_BoxManager *manager, - hypre_Index imin, + hypre_Index imin, hypre_Index imax, HYPRE_Int proc_id, HYPRE_Int box_id, @@ -633,50 +633,50 @@ hypre_BoxManAddEntry( hypre_BoxManager *manager, hypre_BoxManEntry *entries = hypre_BoxManEntries(manager); hypre_BoxManEntry *entry; - + hypre_IndexRef entry_imin; hypre_IndexRef entry_imax; - + HYPRE_Int d; - HYPRE_Int *num_ghost = hypre_BoxManNumGhost(manager); + HYPRE_Int *num_ghost = hypre_BoxManNumGhost(manager); HYPRE_Int volume; - + HYPRE_Int id; - + hypre_Box *box; - + /* can only use before assembling */ if (hypre_BoxManIsAssembled(manager)) { hypre_error_in_arg(1); return hypre_error_flag; } - - /* check to see if we have a non-zero box volume (only add if non-zero) */ + + /* check to see if we have a non-zero box volume (only add if non-zero) */ box = hypre_BoxCreate(hypre_BoxManNDim(manager)); hypre_BoxSetExtents( box, imin, imax ); volume = hypre_BoxVolume(box); hypre_BoxDestroy(box); - - if (volume) + + if (volume) { hypre_MPI_Comm_rank(hypre_BoxManComm(manager), &myid ); - + /* check to make sure that there is enough storage available for this new entry - if not add space for 10 more */ - + if (nentries + 1 > hypre_BoxManMaxNEntries(manager)) { hypre_BoxManIncSize(manager, 10); - + entries = hypre_BoxManEntries(manager); } - + /* we add this to the end entry list - get pointer to location*/ entry = &entries[nentries]; entry_imin = hypre_BoxManEntryIMin(entry); entry_imax = hypre_BoxManEntryIMax(entry); - + /* copy information into entry */ for (d = 0; d < ndim; d++) { @@ -684,7 +684,7 @@ hypre_BoxManAddEntry( hypre_BoxManager *manager, hypre_IndexD(entry_imax, d) = hypre_IndexD(imax, d); } hypre_BoxManEntryNDim(entry) = ndim; - + /* set the processor */ hypre_BoxManEntryProc(entry) = proc_id; @@ -699,11 +699,11 @@ hypre_BoxManAddEntry( hypre_BoxManager *manager, /* increment fir next time */ hypre_BoxManNextId(manager) = id + 1; } - + hypre_BoxManEntryId(entry) = id; /* this is the current position in the entries array */ - hypre_BoxManEntryPosition(entry) = nentries; + hypre_BoxManEntryPosition(entry) = nentries; /*this associates it with the box manager */ hypre_BoxManEntryBoxMan(entry) = (void *) manager; @@ -717,48 +717,48 @@ hypre_BoxManAddEntry( hypre_BoxManager *manager, index_ptr = hypre_BoxManInfoObject(manager, nentries); hypre_TMemcpy(index_ptr, info, char, info_size, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); } - + /* inherit and inject the numghost from manager into the entry (as * in boxmap) */ - for (d = 0; d < 2*ndim; d++) + for (d = 0; d < 2 * ndim; d++) { hypre_BoxManEntryNumGhost(entry)[d] = num_ghost[d]; } - hypre_BoxManEntryNext(entry)= NULL; - + hypre_BoxManEntryNext(entry) = NULL; + /* add proc and id to procs_sort and ids_sort array */ hypre_BoxManProcsSort(manager)[nentries] = proc_id; hypre_BoxManIdsSort(manager)[nentries] = id; - + /* here we need to keep track of my entries separately just to improve speed at the beginning of the assemble - then this gets deleted when the entries are sorted. */ - + if (proc_id == myid) { HYPRE_Int *my_ids = hypre_BoxManMyIds(manager); hypre_BoxManEntry **my_entries = hypre_BoxManMyEntries(manager); HYPRE_Int num_my_entries = hypre_BoxManNumMyEntries(manager); - + my_ids[num_my_entries] = id; my_entries[num_my_entries] = &entries[nentries]; num_my_entries++; - + hypre_BoxManNumMyEntries(manager) = num_my_entries; } /* increment number of entries */ hypre_BoxManNEntries(manager) = nentries + 1; - + } /* end of vol > 0 */ - + return hypre_error_flag; } /*-------------------------------------------------------------------------- - * Given an id: (proc_id, box_id), return a pointer to the box entry. + * Given an id: (proc_id, box_id), return a pointer to the box entry. * - * Notes: + * Notes: * * (1) Use of this is generally to get back something that has been * added by the above function. If no entry is found, an error is returned. @@ -780,7 +780,7 @@ hypre_BoxManGetEntry( hypre_BoxManager *manager, { /* find proc_id in procs array. then find id in ids array, then grab the corresponding entry */ - + hypre_BoxManEntry *entry; HYPRE_Int myid; @@ -803,7 +803,7 @@ hypre_BoxManGetEntry( hypre_BoxManager *manager, hypre_MPI_Comm_rank(hypre_BoxManComm(manager), &myid ); - if (nentries) + if (nentries) { /* check to see if it is the local id first - this will be the case most * of the time (currently it is only used in this manner)*/ @@ -812,10 +812,10 @@ hypre_BoxManGetEntry( hypre_BoxManager *manager, start = first_local; if (start >= 0 ) { - finish = proc_offsets[hypre_BoxManLocalProcOffset(manager)+1]; + finish = proc_offsets[hypre_BoxManLocalProcOffset(manager) + 1]; } } - + else /* otherwise find proc (TO DO: just have procs_sort not contain duplicates - then we could do a regular binary search (though this list is probably short)- this has to be changed in assemble, then @@ -823,13 +823,13 @@ hypre_BoxManGetEntry( hypre_BoxManager *manager, necessary because proc = myid for all current hypre calls) */ { start = -1; - for (i = 0; i< num_proc; i++) + for (i = 0; i < num_proc; i++) { offset = proc_offsets[i]; if (proc == procs_sort[offset]) { start = offset; - finish = proc_offsets[i+1]; + finish = proc_offsets[i + 1]; break; } } @@ -837,7 +837,7 @@ hypre_BoxManGetEntry( hypre_BoxManager *manager, if (start >= 0 ) { /* now look for the id - returns -1 if not found*/ - location = hypre_BinarySearch(&ids_sort[start], id, finish-start); + location = hypre_BinarySearch(&ids_sort[start], id, finish - start); } else { @@ -854,12 +854,14 @@ hypre_BoxManGetEntry( hypre_BoxManager *manager, /* this location is relative to where we started searching - so fix if * non-negative */ location += start; - /* now grab entry */ + /* now grab entry */ entry = &hypre_BoxManEntries(manager)[location]; } else + { entry = NULL; - + } + *entry_ptr = entry; return hypre_error_flag; @@ -875,7 +877,7 @@ hypre_BoxManGetEntry( hypre_BoxManager *manager, HYPRE_Int hypre_BoxManGetAllEntries( hypre_BoxManager *manager, - HYPRE_Int *num_entries, + HYPRE_Int *num_entries, hypre_BoxManEntry **entries) { /* can only use after assembling */ @@ -884,7 +886,7 @@ hypre_BoxManGetAllEntries( hypre_BoxManager *manager, hypre_error_in_arg(1); return hypre_error_flag; } - + /* return */ *num_entries = hypre_BoxManNEntries(manager); *entries = hypre_BoxManEntries(manager); @@ -903,16 +905,16 @@ hypre_BoxManGetAllEntries( hypre_BoxManager *manager, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_BoxManGetAllEntriesBoxes( hypre_BoxManager *manager, +hypre_BoxManGetAllEntriesBoxes( hypre_BoxManager *manager, hypre_BoxArray *boxes ) { hypre_BoxManEntry entry; - + HYPRE_Int i, nentries; hypre_Index ilower, iupper; hypre_BoxManEntry *boxman_entries = hypre_BoxManEntries(manager); - + /* can only use after assembling */ if (!hypre_BoxManIsAssembled(manager)) { @@ -924,12 +926,12 @@ hypre_BoxManGetAllEntriesBoxes( hypre_BoxManager *manager, nentries = hypre_BoxManNEntries(manager); hypre_BoxArraySetSize(boxes, nentries); - - for (i= 0; i< nentries; i++) + + for (i = 0; i < nentries; i++) { entry = boxman_entries[i]; hypre_BoxManEntryGetExtents(&entry, ilower, iupper); - hypre_BoxSetExtents(hypre_BoxArrayBox(boxes,i), ilower, iupper); + hypre_BoxSetExtents(hypre_BoxArrayBox(boxes, i), ilower, iupper); } /* return */ @@ -945,11 +947,11 @@ hypre_BoxManGetAllEntriesBoxes( hypre_BoxManager *manager, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_BoxManGetLocalEntriesBoxes( hypre_BoxManager *manager, +hypre_BoxManGetLocalEntriesBoxes( hypre_BoxManager *manager, hypre_BoxArray *boxes ) { hypre_BoxManEntry entry; - + HYPRE_Int i; hypre_Index ilower, iupper; @@ -961,7 +963,7 @@ hypre_BoxManGetLocalEntriesBoxes( hypre_BoxManager *manager, hypre_BoxManEntry *boxman_entries = hypre_BoxManEntries(manager); HYPRE_Int *offsets = hypre_BoxManProcsSortOffsets(manager); - + /* can only use after assembling */ if (!hypre_BoxManIsAssembled(manager)) { @@ -972,18 +974,18 @@ hypre_BoxManGetLocalEntriesBoxes( hypre_BoxManager *manager, /* set array size */ hypre_BoxArraySetSize(boxes, num_my_entries); - finish = offsets[hypre_BoxManLocalProcOffset(manager)+1]; + finish = offsets[hypre_BoxManLocalProcOffset(manager) + 1]; if (num_my_entries && ((finish - start) != num_my_entries)) { hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Something's wrong with box manager!"); } - for (i= 0; i< num_my_entries; i++) + for (i = 0; i < num_my_entries; i++) { entry = boxman_entries[start + i]; hypre_BoxManEntryGetExtents(&entry, ilower, iupper); - hypre_BoxSetExtents(hypre_BoxArrayBox(boxes,i), ilower, iupper); + hypre_BoxSetExtents(hypre_BoxArrayBox(boxes, i), ilower, iupper); } /* return */ @@ -1016,14 +1018,14 @@ hypre_BoxManGetAllEntriesBoxesProc( hypre_BoxManager *manager, /* set array size */ nentries = hypre_BoxManNEntries(manager); hypre_BoxArraySetSize(boxes, nentries); - procs= hypre_TAlloc(HYPRE_Int, nentries, HYPRE_MEMORY_HOST); + procs = hypre_TAlloc(HYPRE_Int, nentries, HYPRE_MEMORY_HOST); - for (i= 0; i< nentries; i++) + for (i = 0; i < nentries; i++) { entry = boxman_entries[i]; hypre_BoxManEntryGetExtents(&entry, ilower, iupper); - hypre_BoxSetExtents(hypre_BoxArrayBox(boxes,i), ilower, iupper); - procs[i]= hypre_BoxManEntryProc(&entry); + hypre_BoxSetExtents(hypre_BoxArrayBox(boxes, i), ilower, iupper); + procs[i] = hypre_BoxManEntryProc(&entry); } /* return */ @@ -1037,7 +1039,7 @@ hypre_BoxManGetAllEntriesBoxesProc( hypre_BoxManager *manager, * processor's local box manager. Multiple calls may be made to this * function. The box extents supplied here are not retained after the assemble. * - * Note: + * Note: * * (1) This affects whether or not calls to BoxManIntersect() can be answered * correctly. In other words, the user needs to anticipate the areas of the @@ -1056,7 +1058,7 @@ hypre_BoxManGatherEntries(hypre_BoxManager *manager, hypre_Box *box; hypre_BoxArray *gather_regions; - + /* can only use before assembling */ if (hypre_BoxManIsAssembled(manager)) { @@ -1067,7 +1069,7 @@ hypre_BoxManGatherEntries(hypre_BoxManager *manager, /* initialize */ hypre_BoxManIsGatherCalled(manager) = 1; gather_regions = hypre_BoxManGatherRegions(manager); - + /* add the box to the gather region array */ box = hypre_BoxCreate(hypre_BoxManNDim(manager)); hypre_BoxSetExtents( box, imin, imax ); @@ -1086,7 +1088,7 @@ hypre_BoxManGatherEntries(hypre_BoxManager *manager, * is gathered that corresponds to the regions input by calls to * hypre_BoxManGatherEntries(). * - * Notes: + * Notes: * * (1) In the assumed partition (AP) case, the boxes gathered are those that * correspond to boxes living in the assumed partition regions that intersect @@ -1115,7 +1117,7 @@ hypre_BoxManGatherEntries(hypre_BoxManager *manager, * to GatherEntries(). If this was done well, then the AP and non-AP would not * have to be treated separately at all! * - * **Assumptions: + * **Assumptions: * * 1. A processor has used "add entry" to put all of the boxes that it owns into * its box manager @@ -1136,7 +1138,7 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) HYPRE_Int need_to_sort = 1; /* default it to sort */ //HYPRE_Int short_sort = 0; /*do abreviated sort */ - + HYPRE_Int non_ap_gather = 1; /* default to gather w/out ap*/ HYPRE_Int global_num_boxes = 0; @@ -1146,7 +1148,7 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) hypre_BoxArray *gather_regions; MPI_Comm comm = hypre_BoxManComm(manager); - + /* cannot re-assemble */ if (hypre_BoxManIsAssembled(manager)) { @@ -1162,7 +1164,7 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) nentries = hypre_BoxManNEntries(manager); entries = hypre_BoxManEntries(manager); procs_sort = hypre_BoxManProcsSort(manager); - + ids_sort = hypre_BoxManIdsSort(manager); /* do we need to gather entries - check to see if ANY processor called a @@ -1188,11 +1190,11 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) global_is_gather = 0; } - /* ----------------------------GATHER? ------------------------------------*/ + /* ----------------------------GATHER? ------------------------------------*/ if (global_is_gather) { - + HYPRE_Int *my_ids = hypre_BoxManMyIds(manager); HYPRE_Int num_my_entries = hypre_BoxManNumMyEntries(manager); @@ -1205,15 +1207,15 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) AP here, so this sorting needs to be done at the beginning for that too). If non-ap, then we want the allgatherv to already be sorted - so this takes care of that */ - + /* my entries may already be sorted (if all entries are then my entries are - so check first */ - - if (hypre_BoxManIsEntriesSort(manager)==0) + + if (hypre_BoxManIsEntriesSort(manager) == 0) { hypre_entryqsort2(my_ids, my_entries, 0, num_my_entries - 1); } - + /* if AP, use AP to find out who owns the data we need. In the non-AP, then just gather everything for now. */ @@ -1231,7 +1233,7 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) HYPRE_Int *proc_array; HYPRE_Int *ap_proc_ids; HYPRE_Int count; - + HYPRE_Int max_response_size; HYPRE_Int non_info_size, entry_size_bytes; HYPRE_Int *neighbor_proc_ids = NULL; @@ -1246,7 +1248,7 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) HYPRE_Int *contact_proc_ids = NULL; HYPRE_Int max_regions, max_refinements, ologp; - + HYPRE_Int *local_boxnums; HYPRE_Int statbuf[3]; @@ -1269,76 +1271,76 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) hypre_StructAssumedPart *ap; hypre_DataExchangeResponse response_obj, response_obj2; - - hypre_BoxManEntry *entry_ptr; + + hypre_BoxManEntry *entry_ptr; hypre_Index imin, imax; hypre_IndexRef min_ref, max_ref; - + /* 1. Create an assumed partition? (may have been added in the coarsen - routine) */ + routine) */ if (hypre_BoxManAssumedPartition(manager) == NULL) { - + /* create an array of local boxes. get the global box size/volume (as a HYPRE_Real). */ local_boxes = hypre_BoxArrayCreate(num_my_entries, ndim); local_boxnums = hypre_CTAlloc(HYPRE_Int, num_my_entries, HYPRE_MEMORY_HOST); - + local_volume = 0.0; - - for (i=0; i< num_my_entries; i++) + + for (i = 0; i < num_my_entries; i++) { - /* get entry */ + /* get entry */ entry_ptr = my_entries[i]; - + /* copy box info to local_boxes */ min_ref = hypre_BoxManEntryIMin(entry_ptr); max_ref = hypre_BoxManEntryIMax(entry_ptr); box = hypre_BoxArrayBox(local_boxes, i); hypre_BoxSetExtents( box, min_ref, max_ref ); - + /* keep box num also */ local_boxnums[i] = hypre_BoxManEntryId(entry_ptr); - - /* calculate volume */ + + /* calculate volume */ local_volume += (HYPRE_Real) hypre_BoxVolume(box); - + }/* end of local boxes */ - + /* get the number of global entries and the global volume */ sendbuf2[0] = local_volume; sendbuf2[1] = (HYPRE_Real) num_my_entries; - + hypre_MPI_Allreduce(&sendbuf2, &recvbuf2, 2, HYPRE_MPI_REAL, - hypre_MPI_SUM, comm); - + hypre_MPI_SUM, comm); + global_volume = recvbuf2[0]; global_num_boxes = (HYPRE_Int) recvbuf2[1]; - - /* estimates for the assumed partition */ - d = nprocs/2; + + /* estimates for the assumed partition */ + d = nprocs / 2; ologp = 0; while ( d > 0) { - d = d/2; /* note - d is an HYPRE_Int - so this is floored */ + d = d / 2; /* note - d is an HYPRE_Int - so this is floored */ ologp++; } - - max_regions = hypre_min(hypre_pow2(ologp+1), 10*ologp); + + max_regions = hypre_min(hypre_pow2(ologp + 1), 10 * ologp); max_refinements = ologp; - gamma = .6; /* percentage a region must be full to - avoid refinement */ - + gamma = .6; /* percentage a region must be full to + avoid refinement */ + hypre_StructAssumedPartitionCreate( ndim, hypre_BoxManBoundingBox(manager), global_volume, global_num_boxes, local_boxes, local_boxnums, - max_regions, max_refinements, gamma,comm, &ap); - + max_regions, max_refinements, gamma, comm, &ap); + hypre_BoxManAssumedPartition(manager) = ap; hypre_BoxArrayDestroy(local_boxes); @@ -1348,7 +1350,7 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) { ap = hypre_BoxManAssumedPartition(manager); } - + /* 2. Now go thru gather regions and find out which processor's AP region they intersect - only do the rest if we have global boxes!*/ @@ -1356,45 +1358,45 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) { gather_regions = hypre_BoxManGatherRegions(manager); - /*allocate space to store info from one box */ + /*allocate space to store info from one box */ proc_count = 0; proc_alloc = hypre_pow2(ndim); /* Just an initial estimate */ proc_array = hypre_CTAlloc(HYPRE_Int, proc_alloc, HYPRE_MEMORY_HOST); - + /* probably there will mostly be one proc per box - allocate space * for 2 */ - size = 2*hypre_BoxArraySize(gather_regions); + size = 2 * hypre_BoxArraySize(gather_regions); tmp_proc_ids = hypre_CTAlloc(HYPRE_Int, size, HYPRE_MEMORY_HOST); count = 0; - + /* loop through all boxes */ - hypre_ForBoxI(i, gather_regions) + hypre_ForBoxI(i, gather_regions) { hypre_StructAssumedPartitionGetProcsFromBox( - ap, hypre_BoxArrayBox(gather_regions, i), + ap, hypre_BoxArrayBox(gather_regions, i), &proc_count, &proc_alloc, &proc_array); - - if ((count + proc_count) > size) + + if ((count + proc_count) > size) { - size = size + proc_count - + 2*(hypre_BoxArraySize(gather_regions)-i); + size = size + proc_count + + 2 * (hypre_BoxArraySize(gather_regions) - i); tmp_proc_ids = hypre_TReAlloc(tmp_proc_ids, HYPRE_Int, size, HYPRE_MEMORY_HOST); } - for (j = 0; j< proc_count; j++) + for (j = 0; j < proc_count; j++) { tmp_proc_ids[count] = proc_array[j]; count++; } } - - hypre_TFree(proc_array, HYPRE_MEMORY_HOST); - + + hypre_TFree(proc_array, HYPRE_MEMORY_HOST); + /* now get rid of redundencies in tmp_proc_ids (since a box can lie - in more than one AP - put in ap_proc_ids*/ - hypre_qsort0(tmp_proc_ids, 0, count-1); + in more than one AP - put in ap_proc_ids*/ + hypre_qsort0(tmp_proc_ids, 0, count - 1); proc_count = 0; ap_proc_ids = hypre_CTAlloc(HYPRE_Int, count, HYPRE_MEMORY_HOST); - + if (count) { ap_proc_ids[0] = tmp_proc_ids[0]; @@ -1402,18 +1404,18 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) } for (i = 1; i < count; i++) { - if (tmp_proc_ids[i] != ap_proc_ids[proc_count-1]) + if (tmp_proc_ids[i] != ap_proc_ids[proc_count - 1]) { ap_proc_ids[proc_count] = tmp_proc_ids[i]; - proc_count++; + proc_count++; } } hypre_TFree(tmp_proc_ids, HYPRE_MEMORY_HOST); - + /* 3. now we have a sorted list with no duplicates in ap_proc_ids */ /* for each of these processor ids, we need to get infomation about the boxes in their assumed partition region */ - + /* get some stats: check how many point to point communications? (what is the max?) */ /* also get the max distinct AP procs and the max # of entries) */ @@ -1423,22 +1425,22 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) send_statbuf[2] = num_my_entries; hypre_MPI_Allreduce(send_statbuf, statbuf, 3, HYPRE_MPI_INT, - hypre_MPI_MAX, comm); + hypre_MPI_MAX, comm); //max_proc_count = statbuf[0]; - + /* we do not want a single processor to do a ton of point to point communications (relative to the number of total processors - how much is too much?*/ - /* is there a better way to figure the threshold? */ + /* is there a better way to figure the threshold? */ /* 3/07 - take out threshold calculation - shouldn't be a problem on * large number of processors if box sizes are relativesly - * similar */ + * similar */ #if 0 - threshold = hypre_min(12*ologp, nprocs); + threshold = hypre_min(12 * ologp, nprocs); if ( max_proc_count >= threshold) { @@ -1449,89 +1451,89 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) /* change coarse midstream!- now we will just gather everything! */ non_ap_gather = 1; - /*clean up from above */ + /*clean up from above */ hypre_TFree(ap_proc_ids, HYPRE_MEMORY_HOST); } #endif - + if (!non_ap_gather) { /* EXCHANGE DATA information (2 required) : - + if we simply return the boxes in the AP region, we will not have the entry information- in particular, we will not have the "info" obj. So we have to get this info by doing a second communication where we contact the actual owners of the boxes and request the entry info...So: - + (1) exchange #1: contact the AP processor, get the ids of the procs with boxes in that AP region (for now we ignore the box numbers - since we will get all of the entries from each processor) - + (2) exchange #2: use this info to contact the owner processors and from them get the rest of the entry infomation: box extents, info object, etc. ***note: we will get all of the entries from that processor, not just the ones in a particular AP region (whose box numbers we ignored above) */ - + /* exchange #1 - we send nothing, and the contacted proc returns * all of the procs with boxes in its AP region*/ - + /* build response object*/ response_obj.fill_response = hypre_FillResponseBoxManAssemble1; - response_obj.data1 = ap; /* needed to fill responses*/ - response_obj.data2 = NULL; - + response_obj.data1 = ap; /* needed to fill responses*/ + response_obj.data2 = NULL; + send_buf = NULL; send_buf_starts = hypre_CTAlloc(HYPRE_Int, proc_count + 1, HYPRE_MEMORY_HOST); - for (i=0; i< proc_count+1; i++) + for (i = 0; i < proc_count + 1; i++) { - send_buf_starts[i] = 0; + send_buf_starts[i] = 0; } - + response_buf = NULL; /*this and the next are allocated in * exchange data */ response_buf_starts = NULL; - + /*we expect back the proc id for each box owned */ size = sizeof(HYPRE_Int); - - /* this parameter needs to be the same on all processors */ + + /* this parameter needs to be the same on all processors */ /* max_response_size = (global_num_boxes/nprocs)*2;*/ /* modification - should reduce data passed */ max_response_size = statbuf[1]; /*max num of distinct procs */ - - hypre_DataExchangeList(proc_count, ap_proc_ids, - send_buf, send_buf_starts, - 0, size, &response_obj, max_response_size, 3, + + hypre_DataExchangeList(proc_count, ap_proc_ids, + send_buf, send_buf_starts, + 0, size, &response_obj, max_response_size, 3, comm, (void**) &response_buf, &response_buf_starts); - + /*how many items were returned? */ size = response_buf_starts[proc_count]; - - /* alias the response buffer */ + + /* alias the response buffer */ neighbor_proc_ids = response_buf; - + /*clean up*/ hypre_TFree(send_buf_starts, HYPRE_MEMORY_HOST); hypre_TFree(ap_proc_ids, HYPRE_MEMORY_HOST); hypre_TFree(response_buf_starts, HYPRE_MEMORY_HOST); - + /* create a contact list of these processors (eliminate duplicate * procs and also my id ) */ - + /*first sort on proc_id */ - hypre_qsort0(neighbor_proc_ids, 0, size-1); - + hypre_qsort0(neighbor_proc_ids, 0, size - 1); + /* new contact list: */ contact_proc_ids = hypre_CTAlloc(HYPRE_Int, size, HYPRE_MEMORY_HOST); proc_count = 0; /* to determine the number of unique ids) */ - + last_id = -1; - - for (i=0; i< size; i++) + + for (i = 0; i < size; i++) { if (neighbor_proc_ids[i] != last_id) { @@ -1543,18 +1545,18 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) } } } - + /* check to see if we have any entries from a processor before contacting(if we have one entry from a processor, then we have all of the entries) - + we will do we only do this if we have sorted - otherwise we can't easily seach the proc list - this will be most common usage anyways */ - + if (hypre_BoxManIsEntriesSort(manager) && nentries) { - /* so we can eliminate duplicate contacts */ + /* so we can eliminate duplicate contacts */ HYPRE_Int new_count = 0; HYPRE_Int proc_spot = 0; @@ -1564,11 +1566,11 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) not have any duplicate proc ids */ //short_sort = 1; - for (i=0; i< proc_count; i++) + for (i = 0; i < proc_count; i++) { contact_id = contact_proc_ids[i]; - - while (proc_spot < nentries) + + while (proc_spot < nentries) { known_id = procs_sort[proc_spot]; if (contact_id > known_id) @@ -1597,7 +1599,7 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) new_count++; } } - + proc_count = new_count; } #if 0 @@ -1610,24 +1612,24 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) #endif send_buf_starts = hypre_CTAlloc(HYPRE_Int, proc_count + 1, HYPRE_MEMORY_HOST); - for (i=0; i< proc_count+1; i++) + for (i = 0; i < proc_count + 1; i++) { - send_buf_starts[i] = 0; + send_buf_starts[i] = 0; } send_buf = NULL; - + /* exchange #2 - now we contact processors (send nothing) and that processor needs to send us all of their local entry - information*/ - + information*/ + entry_response_buf = NULL; /*this and the next are allocated * in exchange data */ response_buf_starts = NULL; - + response_obj2.fill_response = hypre_FillResponseBoxManAssemble2; - response_obj2.data1 = manager; /* needed to fill responses*/ - response_obj2.data2 = NULL; - + response_obj2.data1 = manager; /* needed to fill responses*/ + response_obj2.data2 = NULL; + /* How big is an entry? extents - 2*ndim HYPRE_Ints proc - 1 HYPRE_Int @@ -1637,41 +1639,41 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) Note: For now, we do not need to send num_ghost, position, or boxman, since this is just generated in addentry. */ - non_info_size = 2*ndim + 2; - entry_size_bytes = non_info_size*sizeof(HYPRE_Int) - + hypre_BoxManEntryInfoSize(manager); - - /* modification - use an true max_response_size + non_info_size = 2 * ndim + 2; + entry_size_bytes = non_info_size * sizeof(HYPRE_Int) + + hypre_BoxManEntryInfoSize(manager); + + /* modification - use an true max_response_size (should be faster and less communication */ max_response_size = statbuf[2]; /* max of num_my_entries */ - - hypre_DataExchangeList(proc_count, contact_proc_ids, + + hypre_DataExchangeList(proc_count, contact_proc_ids, send_buf, send_buf_starts, sizeof(HYPRE_Int), - entry_size_bytes, &response_obj2, - max_response_size, 4, - comm, &entry_response_buf, + entry_size_bytes, &response_obj2, + max_response_size, 4, + comm, &entry_response_buf, &response_buf_starts); - + /* now we can add entries that are in response_buf - we check for duplicates later */ - + /*how many entries do we have?*/ - response_size = response_buf_starts[proc_count]; - + response_size = response_buf_starts[proc_count]; + /* do we need more storage ?*/ if (nentries + response_size > hypre_BoxManMaxNEntries(manager)) { HYPRE_Int inc_size; - - inc_size = (response_size + nentries + + inc_size = (response_size + nentries - hypre_BoxManMaxNEntries(manager)); hypre_BoxManIncSize ( manager, inc_size); - + entries = hypre_BoxManEntries(manager); procs_sort = hypre_BoxManProcsSort(manager); ids_sort = hypre_BoxManIdsSort(manager); } - + index_ptr = entry_response_buf; /* point into response buf */ for (i = 0; i < response_size; i++) { @@ -1679,51 +1681,51 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) /* imin */ for (d = 0; d < ndim; d++) { - hypre_TMemcpy( &tmp_int, index_ptr, HYPRE_Int, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + hypre_TMemcpy( &tmp_int, index_ptr, HYPRE_Int, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); index_ptr = (void *) ((char *) index_ptr + size); hypre_IndexD(imin, d) = tmp_int; } - + /*imax */ for (d = 0; d < ndim; d++) { - hypre_TMemcpy( &tmp_int, index_ptr, HYPRE_Int, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + hypre_TMemcpy( &tmp_int, index_ptr, HYPRE_Int, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); index_ptr = (void *) ((char *) index_ptr + size); hypre_IndexD(imax, d) = tmp_int; } - - /* proc */ + + /* proc */ tmp_int_ptr = (HYPRE_Int *) index_ptr; proc = *tmp_int_ptr; index_ptr = (void *) ((char *) index_ptr + size); - + /* id */ tmp_int_ptr = (HYPRE_Int *) index_ptr; id = *tmp_int_ptr; index_ptr = (void *) ((char *) index_ptr + size); - - /* the info object (now pointer to by index_ptr) + + /* the info object (now pointer to by index_ptr) is copied by AddEntry*/ hypre_BoxManAddEntry(manager, imin, imax, proc, id, index_ptr); - - /* start of next entry */ + + /* start of next entry */ index_ptr = (void *) - ((char *) index_ptr + hypre_BoxManEntryInfoSize(manager)); + ((char *) index_ptr + hypre_BoxManEntryInfoSize(manager)); } - + /* clean up from this section of code*/ hypre_TFree(entry_response_buf, HYPRE_MEMORY_HOST); hypre_TFree(response_buf_starts, HYPRE_MEMORY_HOST); hypre_TFree(send_buf_starts, HYPRE_MEMORY_HOST); hypre_TFree(contact_proc_ids, HYPRE_MEMORY_HOST); hypre_TFree(neighbor_proc_ids, HYPRE_MEMORY_HOST); /* response_buf - aliased */ - + } /* end of nested non_ap_gather -exchange 1*/ - + } /* end of if global boxes */ - + } /********** end of gathering for the AP case *****************/ - + if (non_ap_gather) /* beginning of gathering for the non-AP case */ { /* collect global data - here we will just send each processor's local @@ -1739,7 +1741,7 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) HYPRE_Int proc, id; HYPRE_Int tmp_int; HYPRE_Int *tmp_int_ptr; - + void *send_buf = NULL; void *recv_buf = NULL; @@ -1757,19 +1759,19 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) proc - 1 HYPRE_Int id - 1 HYPRE_Int info - info_size in bytes - + Note: For now, we do not need to send num_ghost, position, or boxman, since this is just generated in addentry. */ - non_info_size = 2*ndim + 2; - entry_size_bytes = non_info_size*sizeof(HYPRE_Int) - + hypre_BoxManEntryInfoSize(manager); + non_info_size = 2 * ndim + 2; + entry_size_bytes = non_info_size * sizeof(HYPRE_Int) + + hypre_BoxManEntryInfoSize(manager); - /* figure out how many entries each proc has - let the group know */ + /* figure out how many entries each proc has - let the group know */ send_count = num_my_entries; - send_count_bytes = send_count*entry_size_bytes; + send_count_bytes = send_count * entry_size_bytes; recv_counts = hypre_CTAlloc(HYPRE_Int, nprocs, HYPRE_MEMORY_HOST); - + hypre_MPI_Allgather(&send_count_bytes, 1, HYPRE_MPI_INT, recv_counts, 1, HYPRE_MPI_INT, comm); @@ -1778,10 +1780,10 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) recv_buf_size_bytes = recv_counts[0]; for (i = 1; i < nprocs; i++) { - displs[i] = displs[i-1] + recv_counts[i-1]; + displs[i] = displs[i - 1] + recv_counts[i - 1]; recv_buf_size_bytes += recv_counts[i]; } - recv_buf_size = recv_buf_size_bytes/ entry_size_bytes; + recv_buf_size = recv_buf_size_bytes / entry_size_bytes; /* mydispls = displs[myid]/entry_size_bytes; */ global_num_boxes = recv_buf_size; @@ -1792,15 +1794,15 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) recv_buf = hypre_TAlloc(char, recv_buf_size_bytes, HYPRE_MEMORY_HOST); index_ptr = send_buf; /* step through send_buf with this pointer */ - /* loop over my entries */ - for (i=0; i < send_count; i++) + /* loop over my entries */ + for (i = 0; i < send_count; i++) { entry = my_entries[i]; size = sizeof(HYPRE_Int); /* imin */ - index = hypre_BoxManEntryIMin(entry); + index = hypre_BoxManEntryIMin(entry); for (d = 0; d < ndim; d++) { tmp_int = hypre_IndexD(index, d); @@ -1808,7 +1810,7 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) index_ptr = (void *) ((char *) index_ptr + size); } - /* imax */ + /* imax */ index = hypre_BoxManEntryIMax(entry); for (d = 0; d < ndim; d++) { @@ -1826,7 +1828,7 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) tmp_int = hypre_BoxManEntryId(entry); hypre_TMemcpy( index_ptr, &tmp_int, HYPRE_Int, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); index_ptr = (void *) ((char *) index_ptr + size); - + /*info object*/ size = hypre_BoxManEntryInfoSize(manager); position = hypre_BoxManEntryPosition(entry); @@ -1834,10 +1836,10 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) hypre_TMemcpy(index_ptr, info, char, size, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); index_ptr = (void *) ((char *) index_ptr + size); - + } /* end of loop over my entries */ - /* now send_buf is ready to go! */ + /* now send_buf is ready to go! */ hypre_MPI_Allgatherv(send_buf, send_count_bytes, hypre_MPI_BYTE, recv_buf, recv_counts, displs, hypre_MPI_BYTE, comm); @@ -1845,15 +1847,15 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) /* unpack recv_buf into entries - let's just unpack them all into the entries table - this way they will already be sorted - so we set nentries to zero so that add entries starts at the beginning (i.e., - we are deleting the current entries and re-creating)*/ - + we are deleting the current entries and re-creating)*/ + if (recv_buf_size > hypre_BoxManMaxNEntries(manager)) { HYPRE_Int inc_size; - + inc_size = (recv_buf_size - hypre_BoxManMaxNEntries(manager)); hypre_BoxManIncSize ( manager, inc_size); - + nentries = hypre_BoxManNEntries(manager); entries = hypre_BoxManEntries(manager); procs_sort = hypre_BoxManProcsSort(manager); @@ -1868,25 +1870,25 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) index_ptr = recv_buf; for (i = 0; i < recv_buf_size; i++) { - + size = sizeof(HYPRE_Int); /* imin */ for (d = 0; d < ndim; d++) { - hypre_TMemcpy( &tmp_int, index_ptr, HYPRE_Int, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + hypre_TMemcpy( &tmp_int, index_ptr, HYPRE_Int, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); index_ptr = (void *) ((char *) index_ptr + size); hypre_IndexD(imin, d) = tmp_int; } - + /*imax */ for (d = 0; d < ndim; d++) { - hypre_TMemcpy( &tmp_int, index_ptr, HYPRE_Int, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + hypre_TMemcpy( &tmp_int, index_ptr, HYPRE_Int, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); index_ptr = (void *) ((char *) index_ptr + size); hypre_IndexD(imax, d) = tmp_int; } - /* proc */ + /* proc */ tmp_int_ptr = (HYPRE_Int *) index_ptr; proc = *tmp_int_ptr; index_ptr = (void *) ((char *) index_ptr + size); @@ -1895,29 +1897,29 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) tmp_int_ptr = (HYPRE_Int *) index_ptr; id = *tmp_int_ptr; index_ptr = (void *) ((char *) index_ptr + size); - - /* info is copied by AddEntry and index_ptr is at info */ - hypre_BoxManAddEntry( manager , imin , - imax , proc, id, + + /* info is copied by AddEntry and index_ptr is at info */ + hypre_BoxManAddEntry( manager, imin, + imax, proc, id, index_ptr ); - /* start of next entry */ - index_ptr = (void *) ((char *) index_ptr + + /* start of next entry */ + index_ptr = (void *) ((char *) index_ptr + hypre_BoxManEntryInfoSize(manager)); } - + hypre_BoxManAllGlobalKnown(manager) = 1; - + hypre_TFree(send_buf, HYPRE_MEMORY_HOST); hypre_TFree(recv_buf, HYPRE_MEMORY_HOST); hypre_TFree(recv_counts, HYPRE_MEMORY_HOST); hypre_TFree(displs, HYPRE_MEMORY_HOST); - + /* now the entries and procs_sort and ids_sort are already sorted */ need_to_sort = 0; hypre_BoxManIsEntriesSort(manager) = 1; - + } /********* end of non-AP gather *****************/ }/* end of if (gather entries) for both AP and non-AP */ @@ -1925,10 +1927,12 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) { /* no gather - so check to see if the entries have been sorted by the user - if so we don't need to sort! */ - if (hypre_BoxManIsEntriesSort(manager)) + if (hypre_BoxManIsEntriesSort(manager)) + { need_to_sort = 0; + } } - + /* we don't need special access to my entries anymore - because we will create the sort table */ @@ -1947,7 +1951,7 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) /* check for and remove duplicate boxes - based on (proc, id) */ /* at the same time sort the procs_sort and ids_sort and then sort the - * entries*/ + * entries*/ { HYPRE_Int *order_index = NULL; HYPRE_Int *delete_array = NULL; @@ -1959,7 +1963,7 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) HYPRE_Int size; hypre_BoxManEntry *new_entries; - + /* (TO DO): if we are sorting after the ap gather, then the box ids may already be sorted within processor number (depends on if the check for contacting duplicate processors was performed....if so, then there may @@ -1969,12 +1973,12 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) /* initial... */ nentries = hypre_BoxManNEntries(manager); entries = hypre_BoxManEntries(manager); - + /* these are negative if a proc does not have any local entries in the manager */ first_local = -1; myoffset = -1; - + if (need_to_sort) { @@ -1989,19 +1993,19 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) } else { - /*stuff below */ + /*stuff below */ } -#endif +#endif order_index = hypre_CTAlloc(HYPRE_Int, nentries, HYPRE_MEMORY_HOST); delete_array = hypre_CTAlloc(HYPRE_Int, nentries, HYPRE_MEMORY_HOST); index = 0; - - for (i=0; i< nentries; i++) + + for (i = 0; i < nentries; i++) { order_index[i] = i; } - /* sort by proc_id */ - hypre_qsort3i(procs_sort, ids_sort, order_index, 0, nentries-1); + /* sort by proc_id */ + hypre_qsort3i(procs_sort, ids_sort, order_index, 0, nentries - 1); num_procs_sort = 0; /* get first id */ if (nentries) @@ -2009,44 +2013,44 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) tmp_id = procs_sort[0]; num_procs_sort++; } - + /* now sort on ids within each processor number*/ start = 0; - for (i=1; i< nentries; i++) + for (i = 1; i < nentries; i++) { - if (procs_sort[i] != tmp_id) + if (procs_sort[i] != tmp_id) { - hypre_qsort2i(ids_sort, order_index, start, i-1); - /*now find duplicate ids */ - for (j=start+1; j< i; j++) + hypre_qsort2i(ids_sort, order_index, start, i - 1); + /*now find duplicate ids */ + for (j = start + 1; j < i; j++) { - if (ids_sort[j] == ids_sort[j-1]) + if (ids_sort[j] == ids_sort[j - 1]) { delete_array[index++] = j; } } - /* update start and tmp_id */ + /* update start and tmp_id */ start = i; tmp_id = procs_sort[i]; - num_procs_sort++; + num_procs_sort++; } } /* final sort and purge (the last group doesn't get caught in the above loop) */ if (nentries) { - hypre_qsort2i(ids_sort, order_index, start, nentries-1); - /*now find duplicate boxnums */ - for (j=start+1; j 0) { tmp_id = procs_sort[0]; num_procs_sort++; } - for (i=1; i < nentries; i++) + for (i = 1; i < nentries; i++) { if (procs_sort[i] != tmp_id) { @@ -2148,19 +2152,19 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) proc_offsets[0] = 0; if (nentries > 0) { - j=1; + j = 1; tmp_id = procs_sort[0]; - if (myid == tmp_id) + if (myid == tmp_id) { - myoffset =0; + myoffset = 0; first_local = 0; } - - for (i=0; i < nentries; i++) + + for (i = 0; i < nentries; i++) { if (procs_sort[i] != tmp_id) { - if (myid == procs_sort[i]) + if (myid == procs_sort[i]) { myoffset = j; first_local = i; @@ -2171,7 +2175,7 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) } proc_offsets[j] = nentries; /* last one */ } - + hypre_BoxManProcsSortOffsets(manager) = proc_offsets; hypre_BoxManFirstLocal(manager) = first_local; hypre_BoxManLocalProcOffset(manager) = myoffset; @@ -2189,22 +2193,22 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) HYPRE_Int all_known = 0; HYPRE_Int global_all_known; - + nentries = hypre_BoxManNEntries(manager); - + if (!hypre_BoxManAllGlobalKnown(manager) && global_is_gather) { /*if every processor has its nentries = global_num_boxes, then all is - * known */ - if (global_num_boxes == nentries) all_known = 1; - + * known */ + if (global_num_boxes == nentries) { all_known = 1; } + hypre_MPI_Allreduce(&all_known, &global_all_known, 1, HYPRE_MPI_INT, hypre_MPI_LAND, comm); - + hypre_BoxManAllGlobalKnown(manager) = global_all_known; } } - + /*------------------------------INDEX TABLE ---------------------------*/ /* now build the index_table and indexes array */ @@ -2247,7 +2251,7 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) for (d = 0; d < ndim; d++) { /* room for min and max of each entry in each dim */ - indexes[d] = hypre_CTAlloc(HYPRE_Int, 2*nentries, HYPRE_MEMORY_HOST); + indexes[d] = hypre_CTAlloc(HYPRE_Int, 2 * nentries, HYPRE_MEMORY_HOST); size[d] = 0; } /* loop through each entry and get index */ @@ -2257,7 +2261,7 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) entry_imin = hypre_BoxManEntryIMin(entry); entry_imax = hypre_BoxManEntryIMax(entry); - /* in each dim, check if min/max positions are already in the table */ + /* in each dim, check if min/max positions are already in the table */ for (d = 0; d < ndim; d++) { iminmax[0] = hypre_IndexD(entry_imin, d); @@ -2272,22 +2276,22 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) if (!i) { location = hypre_BinarySearch2(indexes[d], iminmax[i], 0, - size[d]-1, &j); - if (location != -1) index_not_there = 0; + size[d] - 1, &j); + if (location != -1) { index_not_there = 0; } } else /* for max, we can start seach at min position */ { location = hypre_BinarySearch2(indexes[d], iminmax[i], j, - size[d]-1, &j); - if (location != -1) index_not_there = 0; + size[d] - 1, &j); + if (location != -1) { index_not_there = 0; } } - + /* if the index is already there, don't add it again */ if (index_not_there) { for (k = size[d]; k > j; k--) /* make room for new index */ { - indexes[d][k] = indexes[d][k-1]; + indexes[d][k] = indexes[d][k - 1]; } indexes[d][j] = iminmax[i]; size[d]++; /* increase the size in that dimension */ @@ -2296,7 +2300,7 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) } /* end of for each dimension of the entry */ } /* end of for each entry loop */ - if (nentries) + if (nentries) { itsize = 1; for (d = 0; d < ndim; d++) @@ -2320,10 +2324,10 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) hypre_SetIndex(stride, 1); hypre_BoxSetExtents(table_box, stride, size); hypre_BoxShiftNeg(table_box, stride); /* Want box to start at 0*/ - - /* which are my entries? (on-processor) */ + + /* which are my entries? (on-processor) */ mystart = hypre_BoxManFirstLocal(manager); - if (mystart >= 0 ) /* we have local entries) because + if (mystart >= 0 ) /* we have local entries) because firstlocal = -1 if no local entries */ { loop_num = 3; @@ -2332,15 +2336,15 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) ordering is because creating the linked list for overlapping boxes */ - myfinish = proc_offsets[hypre_BoxManLocalProcOffset(manager)+1]; + myfinish = proc_offsets[hypre_BoxManLocalProcOffset(manager) + 1]; /* #1 do off proc. entries - lower range */ start_loop[0] = 0; end_loop[0] = mystart; /* #2 do off proc. entries - upper range */ - start_loop[1]= myfinish; + start_loop[1] = myfinish; end_loop[1] = nentries; /* #3 do ON proc. entries */ - start_loop[2]= mystart; + start_loop[2] = mystart; end_loop[2] = myfinish; } else /* no on-proc entries */ @@ -2349,7 +2353,7 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) start_loop[0] = 0; end_loop[0] = nentries; } - + for (loop = 0; loop < loop_num; loop++) { for (range = start_loop[loop]; range < end_loop[loop]; range++) @@ -2357,18 +2361,18 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) entry = &entries[range]; entry_imin = hypre_BoxManEntryIMin(entry); entry_imax = hypre_BoxManEntryIMax(entry); - + /* find the indexes corresponding to the current box - put in imin and imax */ for (d = 0; d < ndim; d++) { /* need to go to size[d] because that contains the last element */ location = hypre_BinarySearch2( - indexes[d], hypre_IndexD(entry_imin, d), 0, size[d], &spot); + indexes[d], hypre_IndexD(entry_imin, d), 0, size[d], &spot); hypre_IndexD(imin, d) = location; location = hypre_BinarySearch2( - indexes[d], hypre_IndexD(entry_imax, d) + 1 , 0, size[d], &spot); + indexes[d], hypre_IndexD(entry_imax, d) + 1, 0, size[d], &spot); hypre_IndexD(imax, d) = location - 1; } /* now have imin and imax location in index array*/ @@ -2394,7 +2398,7 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) } /* end of subset of entries */ }/* end of three loops over subsets */ - /* done with the index_table! */ + /* done with the index_table! */ hypre_TFree( hypre_BoxManIndexTable(manager), HYPRE_MEMORY_HOST); /* in case this is a re-assemble - shouldn't be though */ @@ -2410,14 +2414,14 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) hypre_BoxDestroy(index_box); hypre_BoxDestroy(table_box); - + } /* end of building index table group */ /* clean up and update*/ hypre_BoxManNEntries(manager) = nentries; hypre_BoxManEntries(manager) = entries; - + hypre_BoxManIsGatherCalled(manager) = 0; hypre_BoxArrayDestroy(gather_regions); hypre_BoxManGatherRegions(manager) = hypre_BoxArrayCreate(0, ndim); @@ -2432,12 +2436,12 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) * grid that are intersected by this box. The user must insure that a processor * owns the correct global information to do the intersection. For now this is * virtually the same as the box map intersect. - * - * Notes: - * + * + * Notes: + * * (1) This function can also be used in the way that hypre_BoxMapFindEntry was * previously used - just pass in iupper=ilower. - * + * * (2) return NULL for entries if none are found * *--------------------------------------------------------------------------*/ @@ -2475,7 +2479,7 @@ hypre_BoxManIntersect ( hypre_BoxManager *manager, hypre_error_in_arg(1); return hypre_error_flag; } - + /* Check whether the box manager contains any entries */ if (hypre_BoxManNEntries(manager) == 0) { @@ -2514,7 +2518,7 @@ hypre_BoxManIntersect ( hypre_BoxManager *manager, current_index_d ++; } - if( current_index_d > (man_index_size_d - 1) ) + if ( current_index_d > (man_index_size_d - 1) ) { *entries_ptr = NULL; *nentries_ptr = 0; @@ -2526,16 +2530,16 @@ hypre_BoxManIntersect ( hypre_BoxManager *manager, } /* -----find location of iupper[d] in indexes-----*/ - + find_index_d = hypre_IndexD(iupper, d); /* Loop upward if target index is greater than current location */ - while ( (current_index_d <= (man_index_size_d-1)) && - (find_index_d >= man_indexes_d[current_index_d+1]) ) + while ( (current_index_d <= (man_index_size_d - 1)) && + (find_index_d >= man_indexes_d[current_index_d + 1]) ) { current_index_d ++; } - if( current_index_d < 0 ) + if ( current_index_d < 0 ) { *entries_ptr = NULL; *nentries_ptr = 0; @@ -2543,7 +2547,7 @@ hypre_BoxManIntersect ( hypre_BoxManager *manager, } else { - man_iupper[d] = hypre_min(current_index_d, (man_index_size_d-1)); + man_iupper[d] = hypre_min(current_index_d, (man_index_size_d - 1)); } } @@ -2613,26 +2617,31 @@ hypre_BoxManIntersect ( hypre_BoxManager *manager, *****************************************************************************/ HYPRE_Int -hypre_FillResponseBoxManAssemble1( void *p_recv_contact_buf, - HYPRE_Int contact_size, - HYPRE_Int contact_proc, - void *ro, MPI_Comm comm, - void **p_send_response_buf, - HYPRE_Int *response_message_size ) +hypre_FillResponseBoxManAssemble1( void *p_recv_contact_buf, + HYPRE_Int contact_size, + HYPRE_Int contact_proc, + void *ro, + MPI_Comm comm, + void **p_send_response_buf, + HYPRE_Int *response_message_size ) { + HYPRE_UNUSED_VAR(p_recv_contact_buf); + HYPRE_UNUSED_VAR(contact_size); + HYPRE_UNUSED_VAR(contact_proc); + HYPRE_Int myid, i, index; HYPRE_Int size, num_boxes, num_objects; HYPRE_Int *proc_ids; HYPRE_Int *send_response_buf = (HYPRE_Int *) *p_send_response_buf; - - hypre_DataExchangeResponse *response_obj = (hypre_DataExchangeResponse *)ro; - hypre_StructAssumedPart *ap = (hypre_StructAssumedPart *)response_obj->data1; + + hypre_DataExchangeResponse *response_obj = (hypre_DataExchangeResponse *)ro; + hypre_StructAssumedPart *ap = (hypre_StructAssumedPart *)response_obj->data1; HYPRE_Int overhead = response_obj->send_response_overhead; /* initialize stuff */ hypre_MPI_Comm_rank(comm, &myid ); - + proc_ids = hypre_StructAssumedPartMyPartitionProcIds(ap); /* we need to send back the list of all the processor ids for the boxes */ @@ -2644,32 +2653,36 @@ hypre_FillResponseBoxManAssemble1( void *p_recv_contact_buf, num_boxes = hypre_StructAssumedPartMyPartitionIdsSize(ap); /* how many procs do we have in the AP?*/ num_objects = hypre_StructAssumedPartMyPartitionNumDistinctProcs(ap); - + /* num_objects is then how much we need to send*/ - + /* check storage in send_buf for adding the information */ /* note: we are returning objects that are 1 ints in size */ if ( response_obj->send_response_storage < num_objects ) { - response_obj->send_response_storage = hypre_max(num_objects, 10); - size = 1*(response_obj->send_response_storage + overhead); - send_response_buf = hypre_TReAlloc( send_response_buf, HYPRE_Int, + response_obj->send_response_storage = hypre_max(num_objects, 10); + size = 1 * (response_obj->send_response_storage + overhead); + send_response_buf = hypre_TReAlloc( send_response_buf, HYPRE_Int, size, HYPRE_MEMORY_HOST); - *p_send_response_buf = send_response_buf; + *p_send_response_buf = send_response_buf; } /* populate send_response_buf with distinct proc ids*/ index = 0; - if (num_objects > 0) + if (num_objects > 0) + { send_response_buf[index++] = proc_ids[0]; + } for (i = 1; i < num_boxes && index < num_objects; i++) { /* processor id */ - if (proc_ids[i] != proc_ids[i-1]) + if (proc_ids[i] != proc_ids[i - 1]) + { send_response_buf[index++] = proc_ids[i]; + } } /* return variables */ @@ -2684,23 +2697,28 @@ hypre_FillResponseBoxManAssemble1( void *p_recv_contact_buf, *****************************************************************************/ HYPRE_Int -hypre_FillResponseBoxManAssemble2( void *p_recv_contact_buf, - HYPRE_Int contact_size, - HYPRE_Int contact_proc, - void *ro, MPI_Comm comm, - void **p_send_response_buf, - HYPRE_Int *response_message_size ) +hypre_FillResponseBoxManAssemble2( void *p_recv_contact_buf, + HYPRE_Int contact_size, + HYPRE_Int contact_proc, + void *ro, + MPI_Comm comm, + void **p_send_response_buf, + HYPRE_Int *response_message_size ) { + HYPRE_UNUSED_VAR(p_recv_contact_buf); + HYPRE_UNUSED_VAR(contact_size); + HYPRE_UNUSED_VAR(contact_proc); + HYPRE_Int myid, i, d, size, position; HYPRE_Int proc_id, box_id, tmp_int; HYPRE_Int entry_size_bytes; hypre_BoxManEntry *entry; hypre_IndexRef index; void *info, *index_ptr; - + void *send_response_buf = (void *) *p_send_response_buf; - hypre_DataExchangeResponse *response_obj = (hypre_DataExchangeResponse *)ro; - hypre_BoxManager *manager = (hypre_BoxManager *)response_obj->data1; + hypre_DataExchangeResponse *response_obj = (hypre_DataExchangeResponse *)ro; + hypre_BoxManager *manager = (hypre_BoxManager *)response_obj->data1; HYPRE_Int overhead = response_obj->send_response_overhead; HYPRE_Int ndim = hypre_BoxManNDim(manager); @@ -2710,37 +2728,37 @@ hypre_FillResponseBoxManAssemble2( void *p_recv_contact_buf, /*initialize stuff */ hypre_MPI_Comm_rank(comm, &myid ); - entry_size_bytes = 8*sizeof(HYPRE_Int) + hypre_BoxManEntryInfoSize(manager); - + entry_size_bytes = 8 * sizeof(HYPRE_Int) + hypre_BoxManEntryInfoSize(manager); + /* num_my_entries is the amount of information to send */ /*check storage in send_buf for adding the information */ if ( response_obj->send_response_storage < num_my_entries ) { - response_obj->send_response_storage = num_my_entries; - size = entry_size_bytes*(response_obj->send_response_storage + overhead); + response_obj->send_response_storage = num_my_entries; + size = entry_size_bytes * (response_obj->send_response_storage + overhead); send_response_buf = hypre_TReAlloc( (char*)send_response_buf, char, size, HYPRE_MEMORY_HOST); - *p_send_response_buf = send_response_buf; + *p_send_response_buf = send_response_buf; } index_ptr = send_response_buf; /* step through send_buf with this pointer */ - for (i=0; i < num_my_entries; i++) + for (i = 0; i < num_my_entries; i++) { entry = my_entries[i]; - + /*pack response buffer with information */ - + size = sizeof(HYPRE_Int); /* imin */ - index = hypre_BoxManEntryIMin(entry); + index = hypre_BoxManEntryIMin(entry); for (d = 0; d < ndim; d++) { tmp_int = hypre_IndexD(index, d); hypre_TMemcpy( index_ptr, &tmp_int, HYPRE_Int, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); index_ptr = (void *) ((char *) index_ptr + size); } - /* imax */ + /* imax */ index = hypre_BoxManEntryIMax(entry); for (d = 0; d < ndim; d++) { @@ -2752,12 +2770,12 @@ hypre_FillResponseBoxManAssemble2( void *p_recv_contact_buf, proc_id = hypre_BoxManEntryProc(entry); hypre_TMemcpy( index_ptr, &proc_id, HYPRE_Int, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); index_ptr = (void *) ((char *) index_ptr + size); - + /* id */ box_id = hypre_BoxManEntryId(entry); hypre_TMemcpy( index_ptr, &box_id, HYPRE_Int, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); index_ptr = (void *) ((char *) index_ptr + size); - + /*info*/ size = hypre_BoxManEntryInfoSize(manager); position = hypre_BoxManEntryPosition(entry); @@ -2766,10 +2784,10 @@ hypre_FillResponseBoxManAssemble2( void *p_recv_contact_buf, hypre_TMemcpy(index_ptr, info, char, size, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); index_ptr = (void *) ((char *) index_ptr + size); - + } - - /* now send_response_buf is full */ + + /* now send_response_buf is full */ /* return variable */ *response_message_size = num_my_entries; diff --git a/external/hypre/src/struct_mv/box_manager.h b/external/hypre/src/struct_mv/box_manager.h index 349a8a90..f162430d 100644 --- a/external/hypre/src/struct_mv/box_manager.h +++ b/external/hypre/src/struct_mv/box_manager.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -20,14 +20,14 @@ typedef struct hypre_BoxManEntry_struct HYPRE_Int proc; /* This is a two-part unique id: (proc, id) */ HYPRE_Int id; - HYPRE_Int num_ghost[2*HYPRE_MAXDIM]; + HYPRE_Int num_ghost[2 * HYPRE_MAXDIM]; HYPRE_Int position; /* This indicates the location of the entry in the the * box manager entries array and is used for pairing with * the info object (populated in addentry) */ - + void *boxman; /* The owning manager (populated in addentry) */ - + struct hypre_BoxManEntry_struct *next; } hypre_BoxManEntry; @@ -41,32 +41,32 @@ typedef struct MPI_Comm comm; HYPRE_Int max_nentries; /* storage allocated for entries */ - + HYPRE_Int is_gather_called; /* Boolean to indicate whether GatherEntries function has been called (prior to assemble) - may not want this (can tell by the size of gather_regions array) */ - + hypre_BoxArray *gather_regions; /* This is where we collect boxes input by calls to BoxManGatherEntries - to be gathered in the assemble. These are then deleted after the assemble */ - + HYPRE_Int all_global_known; /* Boolean to say that every processor already has all of the global data for this manager (this could be accessed by a coarsening routine, for example) */ - + HYPRE_Int is_entries_sort; /* Boolean to say that entries were added in sorted order (id, proc) (this could be accessed by a coarsening routine, for example) */ HYPRE_Int entry_info_size; /* In bytes, the (max) size of the info - object for the entries */ + object for the entries */ HYPRE_Int is_assembled; /* Flag to indicate if the box manager has been assembled (used to control whether @@ -80,7 +80,7 @@ typedef struct HYPRE_Int *procs_sort; /* The sorted procs corresponding to entries */ HYPRE_Int *ids_sort; /* Sorted ids corresponding to the entries */ - + HYPRE_Int num_procs_sort; /* Number of distinct procs in entries */ HYPRE_Int *procs_sort_offsets; /* Offsets for procs into the entry_sort array */ @@ -96,19 +96,19 @@ typedef struct imax of each box in the entries array */ HYPRE_Int size[HYPRE_MAXDIM]; /* How many indexes in each - direction */ + direction */ HYPRE_Int last_index[HYPRE_MAXDIM]; /* Last index used in the indexes map */ HYPRE_Int num_my_entries; /* Num entries with proc_id = myid */ - HYPRE_Int *my_ids; /* Array of ids corresponding to my entries */ + HYPRE_Int *my_ids; /* Array of ids corresponding to my entries */ hypre_BoxManEntry **my_entries; /* Points into entries that are mine and corresponds to my_ids array. This is destroyed in the assemble. */ - + void *info_objects; /* Array of info objects (each of size - entry_info_size), managed byte-wise */ + entry_info_size), managed byte-wise */ hypre_StructAssumedPart *assumed_partition; /* The assumed partition object. For now this is only used @@ -119,10 +119,10 @@ typedef struct hypre_Box *bounding_box; /* Bounding box from associated grid */ HYPRE_Int next_id; /* Counter to indicate the next id that would be - unique (regardless of proc id) */ + unique (regardless of proc id) */ /* Ghost stuff */ - HYPRE_Int num_ghost[2*HYPRE_MAXDIM]; + HYPRE_Int num_ghost[2 * HYPRE_MAXDIM]; } hypre_BoxManager; @@ -142,7 +142,7 @@ typedef struct #define hypre_BoxManNEntries(manager) ((manager) -> nentries) #define hypre_BoxManEntries(manager) ((manager) -> entries) #define hypre_BoxManInfoObjects(manager) ((manager) -> info_objects) -#define hypre_BoxManIsAssembled(manager) ((manager) -> is_assembled) +#define hypre_BoxManIsAssembled(manager) ((manager) -> is_assembled) #define hypre_BoxManProcsSort(manager) ((manager) -> procs_sort) #define hypre_BoxManIdsSort(manager) ((manager) -> ids_sort) diff --git a/external/hypre/src/struct_mv/boxloop_cuda.h b/external/hypre/src/struct_mv/boxloop_cuda.h index a5e54462..71fa486c 100644 --- a/external/hypre/src/struct_mv/boxloop_cuda.h +++ b/external/hypre/src/struct_mv/boxloop_cuda.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -18,6 +18,8 @@ #ifndef HYPRE_BOXLOOP_CUDA_HEADER #define HYPRE_BOXLOOP_CUDA_HEADER +#if (defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP)) && !defined(HYPRE_USING_RAJA) && !defined(HYPRE_USING_KOKKOS) + #define HYPRE_LAMBDA [=] __host__ __device__ /* TODO: RL: support 4-D */ @@ -30,113 +32,119 @@ typedef struct hypre_Boxloop_struct } hypre_Boxloop; #ifdef __cplusplus -extern "C++" { +extern "C++" +{ #endif -/* ------------------------- - * parfor-loop - * ------------------------*/ - -template -__global__ void -forall_kernel( LOOP_BODY loop_body, - HYPRE_Int length ) -{ - const HYPRE_Int idx = hypre_cuda_get_grid_thread_id<1,1>(); - /* const HYPRE_Int number_threads = hypre_cuda_get_grid_num_threads<1,1>(); */ + /* ------------------------- + * parfor-loop + * ------------------------*/ - if (idx < length) + template + __global__ void + forall_kernel( hypre_DeviceItem & item, + LOOP_BODY loop_body, + HYPRE_Int length ) { - loop_body(idx); - } -} + const HYPRE_Int idx = hypre_gpu_get_grid_thread_id<1, 1>(item); + /* const HYPRE_Int number_threads = hypre_gpu_get_grid_num_threads<1,1>(item); */ -template -void -BoxLoopforall( HYPRE_Int length, - LOOP_BODY loop_body ) -{ - HYPRE_ExecutionPolicy exec_policy = hypre_HandleStructExecPolicy(hypre_handle()); + if (idx < length) + { + loop_body(idx); + } + } - if (exec_policy == HYPRE_EXEC_HOST) + template + void + BoxLoopforall( HYPRE_Int length, + LOOP_BODY loop_body ) { + const HYPRE_MemoryLocation memory_location = hypre_HandleMemoryLocation(hypre_handle()); + const HYPRE_ExecutionPolicy exec_policy = hypre_GetExecPolicy1(memory_location); + + if (exec_policy == HYPRE_EXEC_HOST) + { #ifdef HYPRE_USING_OPENMP -#pragma omp parallel for HYPRE_SMP_SCHEDULE + #pragma omp parallel for HYPRE_SMP_SCHEDULE #endif - for (HYPRE_Int idx = 0; idx < length; idx++) + for (HYPRE_Int idx = 0; idx < length; idx++) + { + loop_body(idx); + } + } + else if (exec_policy == HYPRE_EXEC_DEVICE) { - loop_body(idx); + const dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + const dim3 gDim = hypre_GetDefaultDeviceGridDimension(length, "thread", bDim); + + HYPRE_GPU_LAUNCH( forall_kernel, gDim, bDim, loop_body, length ); } } - else if (exec_policy == HYPRE_EXEC_DEVICE) - { - const dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - const dim3 gDim = hypre_GetDefaultCUDAGridDimension(length, "thread", bDim); - HYPRE_CUDA_LAUNCH( forall_kernel, gDim, bDim, loop_body, length ); - } -} + /* ------------------------------ + * parforreduction-loop + * -----------------------------*/ -/* ------------------------------ - * parforreduction-loop - * -----------------------------*/ + template + __global__ void + reductionforall_kernel( hypre_DeviceItem & item, + HYPRE_Int length, + REDUCER reducer, + LOOP_BODY loop_body ) + { + const HYPRE_Int thread_id = hypre_gpu_get_grid_thread_id<1, 1>(item); + const HYPRE_Int n_threads = hypre_gpu_get_grid_num_threads<1, 1>(item); -template -__global__ void -reductionforall_kernel( HYPRE_Int length, - REDUCER reducer, - LOOP_BODY loop_body ) -{ - const HYPRE_Int thread_id = hypre_cuda_get_grid_thread_id<1,1>(); - const HYPRE_Int n_threads = hypre_cuda_get_grid_num_threads<1,1>(); + for (HYPRE_Int idx = thread_id; idx < length; idx += n_threads) + { + loop_body(idx, reducer); + } - for (HYPRE_Int idx = thread_id; idx < length; idx += n_threads) - { - loop_body(idx, reducer); + /* reduction in block-level and the save the results in reducer */ + reducer.BlockReduce(); } - /* reduction in block-level and the save the results in reducer */ - reducer.BlockReduce(); -} - -template -void -ReductionBoxLoopforall( HYPRE_Int length, - REDUCER &reducer, - LOOP_BODY loop_body ) -{ - if (length <= 0) + template + void + ReductionBoxLoopforall( HYPRE_Int length, + REDUCER & reducer, + LOOP_BODY loop_body ) { - return; - } + if (length <= 0) + { + return; + } - HYPRE_ExecutionPolicy exec_policy = hypre_HandleStructExecPolicy(hypre_handle()); + const HYPRE_MemoryLocation memory_location = hypre_HandleMemoryLocation(hypre_handle()); + const HYPRE_ExecutionPolicy exec_policy = hypre_GetExecPolicy1(memory_location); - if (exec_policy == HYPRE_EXEC_HOST) - { - for (HYPRE_Int idx = 0; idx < length; idx++) + if (exec_policy == HYPRE_EXEC_HOST) { - loop_body(idx, reducer); + for (HYPRE_Int idx = 0; idx < length; idx++) + { + loop_body(idx, reducer); + } } - } - else if (exec_policy == HYPRE_EXEC_DEVICE) - { - const dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(length, "thread", bDim); + else if (exec_policy == HYPRE_EXEC_DEVICE) + { + /* Assume gDim cannot exceed HYPRE_MAX_NTHREADS_BLOCK (the max size for the 2nd reduction) + * and bDim <= WARP * WARP (because we use 1 warp fro the block-level reduction) */ + const dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(length, "thread", bDim); + gDim.x = hypre_min(gDim.x, HYPRE_MAX_NTHREADS_BLOCK); + + reducer.nblocks = gDim.x; - /* Note: we assume gDim cannot exceed 1024 - * and bDim < WARP * WARP - */ - gDim.x = hypre_min(gDim.x, 1024); - reducer.nblocks = gDim.x; + reducer.Allocate2ndPhaseBuffer(); - /* - hypre_printf("length= %d, blocksize = %d, gridsize = %d\n", length, bDim.x, gDim.x); - */ + /* + hypre_printf("length= %d, blocksize = %d, gridsize = %d\n", length, bDim.x, gDim.x); + */ - HYPRE_CUDA_LAUNCH( reductionforall_kernel, gDim, bDim, length, reducer, loop_body ); + HYPRE_GPU_LAUNCH( reductionforall_kernel, gDim, bDim, length, reducer, loop_body ); + } } -} #ifdef __cplusplus } @@ -189,7 +197,7 @@ ReductionBoxLoopforall( HYPRE_Int length, databox##k.bsize2 = 0; \ } -#define zypre_BasicBoxLoopDataDeclareK(k,ndim,loop_size,stride) \ +#define hypre_BasicBoxLoopDataDeclareK(k,ndim,loop_size,stride) \ hypre_Boxloop databox##k; \ databox##k.lsize0 = loop_size[0]; \ databox##k.strides0 = stride[0]; \ @@ -247,24 +255,24 @@ else \ hypre_boxD##k *= hypre_max(0, box.bsize2 + 1); /* get 3-D local_idx into 'index' */ -#define hypre_BoxLoopGetIndex(index) \ - index[0] = hypre_IndexD(local_idx, 0); \ - index[1] = hypre_IndexD(local_idx, 1); \ +#define hypre_BoxLoopGetIndexCUDA(index) \ + index[0] = hypre_IndexD(local_idx, 0); \ + index[1] = hypre_IndexD(local_idx, 1); \ index[2] = hypre_IndexD(local_idx, 2); /* BoxLoop 0 */ -#define hypre_newBoxLoop0Begin(ndim, loop_size) \ +#define hypre_BoxLoop0BeginCUDA(ndim, loop_size) \ { \ hypre_newBoxLoopInit(ndim, loop_size); \ BoxLoopforall(hypre__tot, HYPRE_LAMBDA (HYPRE_Int idx) \ { -#define hypre_newBoxLoop0End() \ +#define hypre_BoxLoop0EndCUDA() \ }); \ } /* BoxLoop 1 */ -#define hypre_newBoxLoop1Begin(ndim, loop_size, dbox1, start1, stride1, i1) \ +#define hypre_BoxLoop1BeginCUDA(ndim, loop_size, dbox1, start1, stride1, i1) \ { \ hypre_newBoxLoopInit(ndim, loop_size); \ hypre_BoxLoopDataDeclareK(1, ndim, loop_size, dbox1, start1, stride1); \ @@ -273,13 +281,13 @@ else \ hypre_newBoxLoopDeclare(databox1); \ hypre_BoxLoopIncK(1, databox1, i1); -#define hypre_newBoxLoop1End(i1) \ +#define hypre_BoxLoop1EndCUDA(i1) \ }); \ } /* BoxLoop 2 */ -#define hypre_newBoxLoop2Begin(ndim, loop_size, dbox1, start1, stride1, i1, \ - dbox2, start2, stride2, i2) \ +#define hypre_BoxLoop2BeginCUDA(ndim, loop_size, dbox1, start1, stride1, i1, \ + dbox2, start2, stride2, i2) \ { \ hypre_newBoxLoopInit(ndim, loop_size); \ hypre_BoxLoopDataDeclareK(1, ndim, loop_size, dbox1, start1, stride1); \ @@ -290,14 +298,14 @@ else \ hypre_BoxLoopIncK(1, databox1, i1); \ hypre_BoxLoopIncK(2, databox2, i2); -#define hypre_newBoxLoop2End(i1, i2) \ +#define hypre_BoxLoop2EndCUDA(i1, i2) \ }); \ } /* BoxLoop 3 */ -#define hypre_newBoxLoop3Begin(ndim, loop_size, dbox1, start1, stride1, i1, \ - dbox2, start2, stride2, i2, \ - dbox3, start3, stride3, i3) \ +#define hypre_BoxLoop3BeginCUDA(ndim, loop_size, dbox1, start1, stride1, i1, \ + dbox2, start2, stride2, i2, \ + dbox3, start3, stride3, i3) \ { \ hypre_newBoxLoopInit(ndim, loop_size); \ hypre_BoxLoopDataDeclareK(1, ndim,loop_size, dbox1, start1, stride1); \ @@ -310,15 +318,15 @@ else \ hypre_BoxLoopIncK(2, databox2, i2); \ hypre_BoxLoopIncK(3, databox3, i3); -#define hypre_newBoxLoop3End(i1, i2, i3) \ +#define hypre_BoxLoop3EndCUDA(i1, i2, i3) \ }); \ } /* BoxLoop 4 */ -#define hypre_newBoxLoop4Begin(ndim, loop_size, dbox1, start1, stride1, i1, \ - dbox2, start2, stride2, i2, \ - dbox3, start3, stride3, i3, \ - dbox4, start4, stride4, i4) \ +#define hypre_BoxLoop4BeginCUDA(ndim, loop_size, dbox1, start1, stride1, i1, \ + dbox2, start2, stride2, i2, \ + dbox3, start3, stride3, i3, \ + dbox4, start4, stride4, i4) \ { \ hypre_newBoxLoopInit(ndim, loop_size); \ hypre_BoxLoopDataDeclareK(1, ndim, loop_size, dbox1, start1, stride1); \ @@ -333,45 +341,45 @@ else \ hypre_BoxLoopIncK(3, databox3, i3); \ hypre_BoxLoopIncK(4, databox4, i4); -#define hypre_newBoxLoop4End(i1, i2, i3, i4) \ +#define hypre_BoxLoop4EndCUDA(i1, i2, i3, i4) \ }); \ } /* Basic BoxLoops have no boxes */ /* BoxLoop 1 */ -#define zypre_newBasicBoxLoop1Begin(ndim, loop_size, stride1, i1) \ +#define hypre_BasicBoxLoop1BeginCUDA(ndim, loop_size, stride1, i1) \ { \ hypre_newBoxLoopInit(ndim, loop_size); \ - zypre_BasicBoxLoopDataDeclareK(1, ndim, loop_size, stride1); \ + hypre_BasicBoxLoopDataDeclareK(1, ndim, loop_size, stride1); \ BoxLoopforall(hypre__tot, HYPRE_LAMBDA (HYPRE_Int idx) \ { \ hypre_newBoxLoopDeclare(databox1); \ hypre_BoxLoopIncK(1, databox1, i1); /* BoxLoop 2 */ -#define zypre_newBasicBoxLoop2Begin(ndim, loop_size, stride1, i1, stride2, i2) \ +#define hypre_BasicBoxLoop2BeginCUDA(ndim, loop_size, stride1, i1, stride2, i2) \ { \ hypre_newBoxLoopInit(ndim, loop_size); \ - zypre_BasicBoxLoopDataDeclareK(1, ndim, loop_size, stride1); \ - zypre_BasicBoxLoopDataDeclareK(2, ndim, loop_size, stride2); \ + hypre_BasicBoxLoopDataDeclareK(1, ndim, loop_size, stride1); \ + hypre_BasicBoxLoopDataDeclareK(2, ndim, loop_size, stride2); \ BoxLoopforall(hypre__tot, HYPRE_LAMBDA (HYPRE_Int idx) \ { \ hypre_newBoxLoopDeclare(databox1); \ hypre_BoxLoopIncK(1, databox1, i1); \ hypre_BoxLoopIncK(2, databox2, i2); \ -/* TODO: RL just parallel-for, it should not be here, better in utilities */ -#define hypre_LoopBegin(size, idx) \ +/* Parallel for-loop */ +#define hypre_LoopBeginCUDA(size, idx) \ { \ BoxLoopforall(size, HYPRE_LAMBDA (HYPRE_Int idx) \ { -#define hypre_LoopEnd() \ +#define hypre_LoopEndCUDA() \ }); \ } /* Reduction BoxLoop1 */ -#define hypre_BoxLoop1ReductionBegin(ndim, loop_size, dbox1, start1, stride1, i1, reducesum) \ +#define hypre_BoxLoop1ReductionBeginCUDA(ndim, loop_size, dbox1, start1, stride1, i1, reducesum) \ { \ hypre_newBoxLoopInit(ndim, loop_size); \ hypre_BoxLoopDataDeclareK(1, ndim, loop_size, dbox1, start1, stride1); \ @@ -380,13 +388,13 @@ else \ hypre_newBoxLoopDeclare(databox1); \ hypre_BoxLoopIncK(1, databox1, i1); -#define hypre_BoxLoop1ReductionEnd(i1, reducesum) \ +#define hypre_BoxLoop1ReductionEndCUDA(i1, reducesum) \ }); \ } /* Reduction BoxLoop2 */ -#define hypre_BoxLoop2ReductionBegin(ndim, loop_size, dbox1, start1, stride1, i1, \ - dbox2, start2, stride2, i2, reducesum) \ +#define hypre_BoxLoop2ReductionBeginCUDA(ndim, loop_size, dbox1, start1, stride1, i1, \ + dbox2, start2, stride2, i2, reducesum) \ { \ hypre_newBoxLoopInit(ndim, loop_size); \ hypre_BoxLoopDataDeclareK(1, ndim, loop_size, dbox1, start1, stride1); \ @@ -397,30 +405,56 @@ else \ hypre_BoxLoopIncK(1, databox1, i1); \ hypre_BoxLoopIncK(2, databox2, i2); -#define hypre_BoxLoop2ReductionEnd(i1, i2, reducesum) \ +#define hypre_BoxLoop2ReductionEndCUDA(i1, i2, reducesum) \ }); \ } /* Renamings */ -#define hypre_BoxLoopBlock() 0 - -#define hypre_BoxLoop0Begin hypre_newBoxLoop0Begin -#define hypre_BoxLoop0For hypre_newBoxLoop0For -#define hypre_BoxLoop0End hypre_newBoxLoop0End -#define hypre_BoxLoop1Begin hypre_newBoxLoop1Begin -#define hypre_BoxLoop1For hypre_newBoxLoop1For -#define hypre_BoxLoop1End hypre_newBoxLoop1End -#define hypre_BoxLoop2Begin hypre_newBoxLoop2Begin -#define hypre_BoxLoop2For hypre_newBoxLoop2For -#define hypre_BoxLoop2End hypre_newBoxLoop2End -#define hypre_BoxLoop3Begin hypre_newBoxLoop3Begin -#define hypre_BoxLoop3For hypre_newBoxLoop3For -#define hypre_BoxLoop3End hypre_newBoxLoop3End -#define hypre_BoxLoop4Begin hypre_newBoxLoop4Begin -#define hypre_BoxLoop4For hypre_newBoxLoop4For -#define hypre_BoxLoop4End hypre_newBoxLoop4End - -#define hypre_BasicBoxLoop1Begin zypre_newBasicBoxLoop1Begin -#define hypre_BasicBoxLoop2Begin zypre_newBasicBoxLoop2Begin +#define hypre_BoxLoopGetIndexDevice hypre_BoxLoopGetIndexCUDA +#define hypre_BoxLoopBlockDevice() 0 +#define hypre_BoxLoop0BeginDevice hypre_BoxLoop0BeginCUDA +#define hypre_BoxLoop0EndDevice hypre_BoxLoop0EndCUDA +#define hypre_BoxLoop1BeginDevice hypre_BoxLoop1BeginCUDA +#define hypre_BoxLoop1EndDevice hypre_BoxLoop1EndCUDA +#define hypre_BoxLoop2BeginDevice hypre_BoxLoop2BeginCUDA +#define hypre_BoxLoop2EndDevice hypre_BoxLoop2EndCUDA +#define hypre_BoxLoop3BeginDevice hypre_BoxLoop3BeginCUDA +#define hypre_BoxLoop3EndDevice hypre_BoxLoop3EndCUDA +#define hypre_BoxLoop4BeginDevice hypre_BoxLoop4BeginCUDA +#define hypre_BoxLoop4EndDevice hypre_BoxLoop4EndCUDA +#define hypre_BasicBoxLoop1BeginDevice hypre_BasicBoxLoop1BeginCUDA +#define hypre_BasicBoxLoop2BeginDevice hypre_BasicBoxLoop2BeginCUDA +#define hypre_LoopBeginDevice hypre_LoopBeginCUDA +#define hypre_LoopEndDevice hypre_LoopEndCUDA +#define hypre_BoxLoop1ReductionBeginDevice hypre_BoxLoop1ReductionBeginCUDA +#define hypre_BoxLoop1ReductionEndDevice hypre_BoxLoop1ReductionEndCUDA +#define hypre_BoxLoop2ReductionBeginDevice hypre_BoxLoop2ReductionBeginCUDA +#define hypre_BoxLoop2ReductionEndDevice hypre_BoxLoop2ReductionEndCUDA + + +//TODO TEMP FIX +#define hypre_BoxLoopGetIndex hypre_BoxLoopGetIndexDevice +#define hypre_BoxLoopBlock() 0 +#define hypre_BoxLoop0Begin hypre_BoxLoop0BeginDevice +#define hypre_BoxLoop0End hypre_BoxLoop0EndDevice +#define hypre_BoxLoop1Begin hypre_BoxLoop1BeginDevice +#define hypre_BoxLoop1End hypre_BoxLoop1EndDevice +#define hypre_BoxLoop2Begin hypre_BoxLoop2BeginDevice +#define hypre_BoxLoop2End hypre_BoxLoop2EndDevice +#define hypre_BoxLoop3Begin hypre_BoxLoop3BeginDevice +#define hypre_BoxLoop3End hypre_BoxLoop3EndDevice +#define hypre_BoxLoop4Begin hypre_BoxLoop4BeginDevice +#define hypre_BoxLoop4End hypre_BoxLoop4EndDevice +#define hypre_BasicBoxLoop1Begin hypre_BasicBoxLoop1BeginDevice +#define hypre_BasicBoxLoop2Begin hypre_BasicBoxLoop2BeginDevice +#define hypre_LoopBegin hypre_LoopBeginDevice +#define hypre_LoopEnd hypre_LoopEndDevice +#define hypre_BoxLoop1ReductionBegin hypre_BoxLoop1ReductionBeginDevice +#define hypre_BoxLoop1ReductionEnd hypre_BoxLoop1ReductionEndDevice +#define hypre_BoxLoop2ReductionBegin hypre_BoxLoop2ReductionBeginDevice +#define hypre_BoxLoop2ReductionEnd hypre_BoxLoop2ReductionEndDevice + +#endif #endif /* #ifndef HYPRE_BOXLOOP_CUDA_HEADER */ + diff --git a/external/hypre/src/struct_mv/boxloop_host.h b/external/hypre/src/struct_mv/boxloop_host.h index d7ecad1f..6b4672c3 100644 --- a/external/hypre/src/struct_mv/boxloop_host.h +++ b/external/hypre/src/struct_mv/boxloop_host.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -15,32 +15,25 @@ * BoxLoop macros: *--------------------------------------------------------------------------*/ -#ifndef HYPRE_NEWBOXLOOP_HEADER -#define HYPRE_NEWBOXLOOP_HEADER +#ifndef HYPRE_BOXLOOP_HOST_HEADER +#define HYPRE_BOXLOOP_HOST_HEADER -#ifdef HYPRE_USING_OPENMP +#if defined(HYPRE_USING_OPENMP) #define HYPRE_BOX_REDUCTION +#define HYPRE_OMP_CLAUSE #if defined(WIN32) && defined(_MSC_VER) -#define Pragma(x) __pragma(HYPRE_XSTR(x)) +#define Pragma(x) __pragma(x) #else #define Pragma(x) _Pragma(HYPRE_XSTR(x)) #endif -#define OMP0 Pragma(omp parallel for HYPRE_BOX_REDUCTION HYPRE_SMP_SCHEDULE) -#define OMP1 Pragma(omp parallel for private(HYPRE_BOX_PRIVATE) HYPRE_BOX_REDUCTION HYPRE_SMP_SCHEDULE) -#else /* #ifdef HYPRE_USING_OPENMP */ +#define OMP0 Pragma(omp parallel for HYPRE_OMP_CLAUSE HYPRE_BOX_REDUCTION HYPRE_SMP_SCHEDULE) +#define OMP1 Pragma(omp parallel for private(HYPRE_BOX_PRIVATE) HYPRE_OMP_CLAUSE HYPRE_BOX_REDUCTION HYPRE_SMP_SCHEDULE) +#else /* #if defined(HYPRE_USING_OPENMP) */ #define OMP0 #define OMP1 -#endif /* #ifdef HYPRE_USING_OPENMP */ +#endif /* #if defined(HYPRE_USING_OPENMP) */ -typedef struct hypre_Boxloop_struct -{ - HYPRE_Int lsize0,lsize1,lsize2; - HYPRE_Int strides0,strides1,strides2; - HYPRE_Int bstart0,bstart1,bstart2; - HYPRE_Int bsize0,bsize1,bsize2; -} hypre_Boxloop; - -#define zypre_newBoxLoop0Begin(ndim, loop_size) \ +#define zypre_BoxLoop0Begin(ndim, loop_size) \ { \ zypre_BoxLoopDeclare(); \ zypre_BoxLoopInit(ndim, loop_size); \ @@ -53,7 +46,7 @@ typedef struct hypre_Boxloop_struct for (hypre__I = 0; hypre__I < hypre__IN; hypre__I++) \ { -#define zypre_newBoxLoop0End() \ +#define zypre_BoxLoop0End() \ } \ zypre_BoxLoopInc1(); \ zypre_BoxLoopInc2(); \ @@ -61,8 +54,8 @@ typedef struct hypre_Boxloop_struct } \ } -#define zypre_newBoxLoop1Begin(ndim, loop_size, \ - dbox1, start1, stride1, i1) \ +#define zypre_BoxLoop1Begin(ndim, loop_size, \ + dbox1, start1, stride1, i1) \ { \ HYPRE_Int i1; \ zypre_BoxLoopDeclare(); \ @@ -80,7 +73,7 @@ typedef struct hypre_Boxloop_struct for (hypre__I = 0; hypre__I < hypre__IN; hypre__I++) \ { -#define zypre_newBoxLoop1End(i1) \ +#define zypre_BoxLoop1End(i1) \ i1 += hypre__i0inc1; \ } \ zypre_BoxLoopInc1(); \ @@ -91,9 +84,9 @@ typedef struct hypre_Boxloop_struct } -#define zypre_newBoxLoop2Begin(ndim, loop_size, \ - dbox1, start1, stride1, i1, \ - dbox2, start2, stride2, i2) \ +#define zypre_BoxLoop2Begin(ndim, loop_size, \ + dbox1, start1, stride1, i1, \ + dbox2, start2, stride2, i2) \ { \ HYPRE_Int i1, i2; \ zypre_BoxLoopDeclare(); \ @@ -114,7 +107,7 @@ typedef struct hypre_Boxloop_struct for (hypre__I = 0; hypre__I < hypre__IN; hypre__I++) \ { -#define zypre_newBoxLoop2End(i1, i2) \ +#define zypre_BoxLoop2End(i1, i2) \ i1 += hypre__i0inc1; \ i2 += hypre__i0inc2; \ } \ @@ -127,10 +120,10 @@ typedef struct hypre_Boxloop_struct } -#define zypre_newBoxLoop3Begin(ndim, loop_size, \ - dbox1, start1, stride1, i1, \ - dbox2, start2, stride2, i2, \ - dbox3, start3, stride3, i3) \ +#define zypre_BoxLoop3Begin(ndim, loop_size, \ + dbox1, start1, stride1, i1, \ + dbox2, start2, stride2, i2, \ + dbox3, start3, stride3, i3) \ { \ HYPRE_Int i1, i2, i3; \ zypre_BoxLoopDeclare(); \ @@ -154,7 +147,7 @@ typedef struct hypre_Boxloop_struct for (hypre__I = 0; hypre__I < hypre__IN; hypre__I++) \ { -#define zypre_newBoxLoop3End(i1, i2, i3) \ +#define zypre_BoxLoop3End(i1, i2, i3) \ i1 += hypre__i0inc1; \ i2 += hypre__i0inc2; \ i3 += hypre__i0inc3; \ @@ -168,7 +161,7 @@ typedef struct hypre_Boxloop_struct } \ } -#define zypre_newBoxLoop4Begin(ndim, loop_size, \ +#define zypre_BoxLoop4Begin(ndim, loop_size, \ dbox1, start1, stride1, i1, \ dbox2, start2, stride2, i2, \ dbox3, start3, stride3, i3, \ @@ -199,7 +192,7 @@ typedef struct hypre_Boxloop_struct for (hypre__I = 0; hypre__I < hypre__IN; hypre__I++) \ { -#define zypre_newBoxLoop4End(i1, i2, i3, i4) \ +#define zypre_BoxLoop4End(i1, i2, i3, i4) \ i1 += hypre__i0inc1; \ i2 += hypre__i0inc2; \ i3 += hypre__i0inc3; \ @@ -215,9 +208,27 @@ typedef struct hypre_Boxloop_struct } \ } -#define zypre_newBasicBoxLoop2Begin(ndim, loop_size, \ - stride1, i1, \ - stride2, i2) \ +#define zypre_BasicBoxLoop1Begin(ndim, loop_size, \ + stride1, i1) \ +{ \ + zypre_BoxLoopDeclare(); \ + zypre_BoxLoopDeclareK(1); \ + zypre_BoxLoopInit(ndim, loop_size); \ + zypre_BasicBoxLoopInitK(1, stride1); \ + OMP1 \ + for (hypre__block = 0; hypre__block < hypre__num_blocks; hypre__block++) \ + { \ + HYPRE_Int i1; \ + zypre_BoxLoopSet(); \ + zypre_BoxLoopSetK(1, i1); \ + for (hypre__J = 0; hypre__J < hypre__JN; hypre__J++) \ + { \ + for (hypre__I = 0; hypre__I < hypre__IN; hypre__I++) \ + { + +#define zypre_BasicBoxLoop2Begin(ndim, loop_size, \ + stride1, i1, \ + stride2, i2) \ { \ zypre_BoxLoopDeclare(); \ zypre_BoxLoopDeclareK(1); \ @@ -238,45 +249,147 @@ typedef struct hypre_Boxloop_struct { -#define hypre_LoopBegin(size, idx) \ +#define zypre_LoopBegin(size, idx) \ { \ HYPRE_Int idx; \ OMP0 \ for (idx = 0; idx < size; idx ++) \ { -#define hypre_LoopEnd() \ - } \ +#define zypre_LoopEnd() \ + } \ +} + +/*-------------------------------------------------------------------------- + * Serial BoxLoop macros: + * [same as the ones above (without OMP and with SetOneBlock)] + * TODO: combine them + *--------------------------------------------------------------------------*/ +#define hypre_SerialBoxLoop0Begin(ndim, loop_size) \ +{ \ + zypre_BoxLoopDeclare(); \ + zypre_BoxLoopInit(ndim, loop_size); \ + zypre_BoxLoopSetOneBlock(); \ + for (hypre__block = 0; hypre__block < hypre__num_blocks; hypre__block++) \ + { \ + zypre_BoxLoopSet(); \ + for (hypre__J = 0; hypre__J < hypre__JN; hypre__J++) \ + { \ + for (hypre__I = 0; hypre__I < hypre__IN; hypre__I++) \ + { + +#define hypre_SerialBoxLoop0End() \ + } \ + zypre_BoxLoopInc1(); \ + zypre_BoxLoopInc2(); \ + } \ + } \ } -#define hypre_BoxLoopGetIndex zypre_BoxLoopGetIndex - -#define hypre_BoxLoopBlock zypre_BoxLoopBlock -#define hypre_BoxLoop0Begin zypre_newBoxLoop0Begin -#define hypre_BoxLoop0End zypre_newBoxLoop0End -#define hypre_BoxLoop1Begin zypre_newBoxLoop1Begin -#define hypre_BoxLoop1End zypre_newBoxLoop1End -#define hypre_BoxLoop2Begin zypre_newBoxLoop2Begin -#define hypre_BoxLoop2End zypre_newBoxLoop2End -#define hypre_BoxLoop3Begin zypre_newBoxLoop3Begin -#define hypre_BoxLoop3End zypre_newBoxLoop3End -#define hypre_BoxLoop4Begin zypre_newBoxLoop4Begin -#define hypre_BoxLoop4End zypre_newBoxLoop4End -#define hypre_BasicBoxLoop2Begin zypre_newBasicBoxLoop2Begin - -/* Reduction */ -#define hypre_BoxLoop1ReductionBegin(ndim, loop_size, dbox1, start1, stride1, i1, reducesum) \ - hypre_BoxLoop1Begin(ndim, loop_size, dbox1, start1, stride1, i1) - -#define hypre_BoxLoop1ReductionEnd(i1, reducesum) \ - hypre_BoxLoop1End(i1) - -#define hypre_BoxLoop2ReductionBegin(ndim, loop_size, dbox1, start1, stride1, i1, \ +#define hypre_SerialBoxLoop1Begin(ndim, loop_size, \ + dbox1, start1, stride1, i1) \ +{ \ + HYPRE_Int i1; \ + zypre_BoxLoopDeclare(); \ + zypre_BoxLoopDeclareK(1); \ + zypre_BoxLoopInit(ndim, loop_size); \ + zypre_BoxLoopInitK(1, dbox1, start1, stride1, i1); \ + zypre_BoxLoopSetOneBlock(); \ + for (hypre__block = 0; hypre__block < hypre__num_blocks; hypre__block++) \ + { \ + zypre_BoxLoopSet(); \ + zypre_BoxLoopSetK(1, i1); \ + for (hypre__J = 0; hypre__J < hypre__JN; hypre__J++) \ + { \ + for (hypre__I = 0; hypre__I < hypre__IN; hypre__I++) \ + { + +#define hypre_SerialBoxLoop1End(i1) zypre_BoxLoop1End(i1) + +#define hypre_SerialBoxLoop2Begin(ndim, loop_size, \ + dbox1, start1, stride1, i1, \ + dbox2, start2, stride2, i2) \ +{ \ + HYPRE_Int i1,i2; \ + zypre_BoxLoopDeclare(); \ + zypre_BoxLoopDeclareK(1); \ + zypre_BoxLoopDeclareK(2); \ + zypre_BoxLoopInit(ndim, loop_size); \ + zypre_BoxLoopInitK(1, dbox1, start1, stride1, i1); \ + zypre_BoxLoopInitK(2, dbox2, start2, stride2, i2); \ + zypre_BoxLoopSetOneBlock(); \ + for (hypre__block = 0; hypre__block < hypre__num_blocks; hypre__block++) \ + { \ + zypre_BoxLoopSet(); \ + zypre_BoxLoopSetK(1, i1); \ + zypre_BoxLoopSetK(2, i2); \ + for (hypre__J = 0; hypre__J < hypre__JN; hypre__J++) \ + { \ + for (hypre__I = 0; hypre__I < hypre__IN; hypre__I++) \ + { + +#define hypre_SerialBoxLoop2End(i1, i2) zypre_BoxLoop2End(i1, i2) + +/* Reduction BoxLoop1 */ +#define zypre_BoxLoop1ReductionBegin(ndim, loop_size, dbox1, start1, stride1, i1, reducesum) \ + zypre_BoxLoop1Begin(ndim, loop_size, dbox1, start1, stride1, i1) + +#define zypre_BoxLoop1ReductionEnd(i1, reducesum) zypre_BoxLoop1End(i1) + +/* Reduction BoxLoop2 */ +#define zypre_BoxLoop2ReductionBegin(ndim, loop_size, dbox1, start1, stride1, i1, \ dbox2, start2, stride2, i2, reducesum) \ - hypre_BoxLoop2Begin(ndim, loop_size, dbox1, start1, stride1, i1, \ + zypre_BoxLoop2Begin(ndim, loop_size, dbox1, start1, stride1, i1, \ dbox2, start2, stride2, i2) -#define hypre_BoxLoop2ReductionEnd(i1, i2, reducesum) \ - hypre_BoxLoop2End(i1, i2) +#define zypre_BoxLoop2ReductionEnd(i1, i2, reducesum) zypre_BoxLoop2End(i1, i2) + + +/* Renaming */ +#define hypre_BoxLoopGetIndexHost zypre_BoxLoopGetIndex +#define hypre_BoxLoopBlockHost zypre_BoxLoopBlock +#define hypre_BoxLoop0BeginHost zypre_BoxLoop0Begin +#define hypre_BoxLoop0EndHost zypre_BoxLoop0End +#define hypre_BoxLoop1BeginHost zypre_BoxLoop1Begin +#define hypre_BoxLoop1EndHost zypre_BoxLoop1End +#define hypre_BoxLoop2BeginHost zypre_BoxLoop2Begin +#define hypre_BoxLoop2EndHost zypre_BoxLoop2End +#define hypre_BoxLoop3BeginHost zypre_BoxLoop3Begin +#define hypre_BoxLoop3EndHost zypre_BoxLoop3End +#define hypre_BoxLoop4BeginHost zypre_BoxLoop4Begin +#define hypre_BoxLoop4EndHost zypre_BoxLoop4End +#define hypre_BasicBoxLoop1BeginHost zypre_BasicBoxLoop1Begin +#define hypre_BasicBoxLoop2BeginHost zypre_BasicBoxLoop2Begin +#define hypre_LoopBeginHost zypre_LoopBegin +#define hypre_LoopEndHost zypre_LoopEnd +#define hypre_BoxLoop1ReductionBeginHost zypre_BoxLoop1ReductionBegin +#define hypre_BoxLoop1ReductionEndHost zypre_BoxLoop1ReductionEnd +#define hypre_BoxLoop2ReductionBeginHost zypre_BoxLoop2ReductionBegin +#define hypre_BoxLoop2ReductionEndHost zypre_BoxLoop2ReductionEnd +//TODO TEMP FIX +#if !defined(HYPRE_USING_RAJA) && !defined(HYPRE_USING_KOKKOS) && !defined(HYPRE_USING_CUDA) && !defined(HYPRE_USING_HIP) && !defined(HYPRE_USING_DEVICE_OPENMP) && !defined(HYPRE_USING_SYCL) +#define hypre_BoxLoopGetIndex hypre_BoxLoopGetIndexHost +#define hypre_BoxLoopBlock() 0 +#define hypre_BoxLoop0Begin hypre_BoxLoop0BeginHost +#define hypre_BoxLoop0End hypre_BoxLoop0EndHost +#define hypre_BoxLoop1Begin hypre_BoxLoop1BeginHost +#define hypre_BoxLoop1End hypre_BoxLoop1EndHost +#define hypre_BoxLoop2Begin hypre_BoxLoop2BeginHost +#define hypre_BoxLoop2End hypre_BoxLoop2EndHost +#define hypre_BoxLoop3Begin hypre_BoxLoop3BeginHost +#define hypre_BoxLoop3End hypre_BoxLoop3EndHost +#define hypre_BoxLoop4Begin hypre_BoxLoop4BeginHost +#define hypre_BoxLoop4End hypre_BoxLoop4EndHost +#define hypre_BasicBoxLoop1Begin hypre_BasicBoxLoop1BeginHost +#define hypre_BasicBoxLoop2Begin hypre_BasicBoxLoop2BeginHost +#define hypre_LoopBegin hypre_LoopBeginHost +#define hypre_LoopEnd hypre_LoopEndHost +#define hypre_BoxLoop1ReductionBegin hypre_BoxLoop1ReductionBeginHost +#define hypre_BoxLoop1ReductionEnd hypre_BoxLoop1ReductionEndHost +#define hypre_BoxLoop2ReductionBegin hypre_BoxLoop2ReductionBeginHost +#define hypre_BoxLoop2ReductionEnd hypre_BoxLoop2ReductionEndHost #endif + +#endif /* #ifndef HYPRE_BOXLOOP_HOST_HEADER */ + diff --git a/external/hypre/src/struct_mv/boxloop_kokkos.h b/external/hypre/src/struct_mv/boxloop_kokkos.h index 6e42a23a..e8d8062f 100644 --- a/external/hypre/src/struct_mv/boxloop_kokkos.h +++ b/external/hypre/src/struct_mv/boxloop_kokkos.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -15,15 +15,18 @@ * BoxLoop macros: *--------------------------------------------------------------------------*/ -#ifndef HYPRE_NEWBOXLOOP_HEADER -#define HYPRE_NEWBOXLOOP_HEADER +#ifndef HYPRE_BOXLOOP_KOKKOS_HEADER +#define HYPRE_BOXLOOP_KOKKOS_HEADER + +#if defined(HYPRE_USING_KOKKOS) #ifdef __cplusplus -extern "C++" { +extern "C++" +{ #endif #include -using namespace Kokkos; + using namespace Kokkos; #ifdef __cplusplus } @@ -35,10 +38,10 @@ using namespace Kokkos; typedef struct hypre_Boxloop_struct { - HYPRE_Int lsize0,lsize1,lsize2; - HYPRE_Int strides0,strides1,strides2; - HYPRE_Int bstart0,bstart1,bstart2; - HYPRE_Int bsize0,bsize1,bsize2; + HYPRE_Int lsize0, lsize1, lsize2; + HYPRE_Int strides0, strides1, strides2; + HYPRE_Int bstart0, bstart1, bstart2; + HYPRE_Int bsize0, bsize1, bsize2; } hypre_Boxloop; @@ -272,13 +275,13 @@ typedef struct hypre_Boxloop_struct - #define hypre_BoxLoop1ReductionEnd(i1, HYPRE_BOX_REDUCTION) \ +#define hypre_BoxLoop1ReductionEnd(i1, HYPRE_BOX_REDUCTION) \ }, HYPRE_BOX_REDUCTION); \ hypre_fence(); \ HYPRE_BOX_REDUCTION += __hypre_sum_tmp; \ } - #define hypre_BoxLoop2ReductionBegin(ndim, loop_size, \ +#define hypre_BoxLoop2ReductionBegin(ndim, loop_size, \ dbox1, start1, stride1, i1, \ dbox2, start2, stride2, i2, \ HYPRE_BOX_REDUCTION) \ @@ -295,7 +298,7 @@ typedef struct hypre_Boxloop_struct hypre_BoxLoopIncK(1,databox1,i1); \ hypre_BoxLoopIncK(2,databox2,i2); \ - #define hypre_BoxLoop2ReductionEnd(i1, i2, HYPRE_BOX_REDUCTION) \ +#define hypre_BoxLoop2ReductionEnd(i1, i2, HYPRE_BOX_REDUCTION) \ }, HYPRE_BOX_REDUCTION); \ hypre_fence(); \ HYPRE_BOX_REDUCTION += __hypre_sum_tmp; \ @@ -371,4 +374,8 @@ struct ColumnSums #define hypre_BoxLoop4End hypre_newBoxLoop4End #define hypre_BasicBoxLoop2Begin hypre_newBasicBoxLoop2Begin + #endif + +#endif /* #ifndef HYPRE_BOXLOOP_KOKKOS_HEADER */ + diff --git a/external/hypre/src/struct_mv/boxloop_omp_device.h b/external/hypre/src/struct_mv/boxloop_omp_device.h index e3de12d5..801146a5 100644 --- a/external/hypre/src/struct_mv/boxloop_omp_device.h +++ b/external/hypre/src/struct_mv/boxloop_omp_device.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -15,8 +15,10 @@ * BoxLoop macros: *--------------------------------------------------------------------------*/ -#ifndef HYPRE_NEWBOXLOOP_HEADER -#define HYPRE_NEWBOXLOOP_HEADER +#ifndef HYPRE_BOXLOOP_DEVICEOMP_HEADER +#define HYPRE_BOXLOOP_DEVICEOMP_HEADER + +#if defined(HYPRE_USING_DEVICE_OPENMP) && !defined(HYPRE_USING_RAJA) && !defined(HYPRE_USING_KOKKOS) #include "omp.h" @@ -33,7 +35,7 @@ #ifndef AUTO_OMP_TEAM /* omp team size (aka. gpu block size) */ -#define hypre_gpu_block_size 512 +#define hypre_gpu_block_size HYPRE_1D_BLOCK_SIZE /* the max number of omp teams */ #define hypre_max_num_blocks 1000000 #endif @@ -68,7 +70,7 @@ #define hypre_BoxLoop3End zypre_omp4_dist_BoxLoopEnd #define hypre_BoxLoop4Begin zypre_omp4_dist_BoxLoop4Begin #define hypre_BoxLoop4End zypre_omp4_dist_BoxLoopEnd -#define hypre_LoopBegin zypre_LoopBegin +#define hypre_LoopBegin zypre_omp4_dist_LoopBegin #define hypre_LoopEnd zypre_omp4_dist_BoxLoopEnd /* Look for more in struct_ls/red_black_gs.h" */ @@ -531,7 +533,7 @@ hypre__J = hypre__thread; i1 = i2 = 0; \ /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - * Basic Loop * - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ -#define zypre_LoopBegin(size, idx) \ +#define zypre_omp4_dist_LoopBegin(size, idx) \ { \ /* host code: */ \ /* HYPRE_Int idx = 0; */\ @@ -542,14 +544,6 @@ hypre__J = hypre__thread; i1 = i2 = 0; \ for (HYPRE_Int idx = 0; idx < hypre__tot; idx++) \ { -#if 0 -#define hypre_LoopBegin0(size, idx) \ -{ \ - HYPRE_Int idx, hypre__size = size; \ - for (idx = 0; idx < hypre__size; idx++) \ - { -#endif - #define hypre_BoxLoopGetIndex(index) \ index[0] = hypre__id_0; \ index[1] = hypre__id_1; \ @@ -572,3 +566,5 @@ hypre__J = hypre__thread; i1 = i2 = 0; \ #endif +#endif /* #ifndef HYPRE_BOXLOOP_DEVICEOMP_HEADER */ + diff --git a/external/hypre/src/struct_mv/boxloop_raja.h b/external/hypre/src/struct_mv/boxloop_raja.h index 216f292d..c9b7f7a2 100644 --- a/external/hypre/src/struct_mv/boxloop_raja.h +++ b/external/hypre/src/struct_mv/boxloop_raja.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -15,15 +15,18 @@ * BoxLoop macros: *--------------------------------------------------------------------------*/ -#ifndef HYPRE_NEWBOXLOOP_HEADER -#define HYPRE_NEWBOXLOOP_HEADER +#ifndef HYPRE_BOXLOOP_RAJA_HEADER +#define HYPRE_BOXLOOP_RAJA_HEADER + +#if defined(HYPRE_USING_RAJA) #ifdef __cplusplus -extern "C++" { +extern "C++" +{ #endif #include -using namespace RAJA; + using namespace RAJA; #ifdef __cplusplus } @@ -31,17 +34,17 @@ using namespace RAJA; typedef struct hypre_Boxloop_struct { - HYPRE_Int lsize0,lsize1,lsize2; - HYPRE_Int strides0,strides1,strides2; - HYPRE_Int bstart0,bstart1,bstart2; - HYPRE_Int bsize0,bsize1,bsize2; + HYPRE_Int lsize0, lsize1, lsize2; + HYPRE_Int strides0, strides1, strides2; + HYPRE_Int bstart0, bstart1, bstart2; + HYPRE_Int bsize0, bsize1, bsize2; } hypre_Boxloop; #if defined(HYPRE_USING_CUDA) /* RAJA with CUDA, running on device */ -#define BLOCKSIZE 256 -#define hypre_RAJA_DEVICE RAJA_DEVICE +#define BLOCKSIZE HYPRE_1D_BLOCK_SIZE +#define hypre_RAJA_DEVICE RAJA_DEVICE #define hypre_raja_exec_policy cuda_exec /* #define hypre_raja_reduce_policy cuda_reduce_atomic */ #define hypre_raja_reduce_policy cuda_reduce // @@ -57,7 +60,10 @@ hypre_CheckErrorDevice(cudaDeviceSynchronize()); #elif defined(HYPRE_USING_DEVICE_OPENMP) /* RAJA with OpenMP (>4.5), running on device */ -//TODO +#define hypre_RAJA_DEVICE +#define hypre_raja_exec_policy omp_target_parallel_for_exec +#define hypre_raja_reduce_policy omp_target_reduce +#define hypre_fence() #elif defined(HYPRE_USING_OPENMP) /* RAJA with OpenMP, running on host (CPU) */ @@ -289,7 +295,7 @@ hypre_CheckErrorDevice(cudaDeviceSynchronize()); hypre_fence(); \ } -#define hypre_newBoxLoopGetIndex(index) \ +#define hypre_BoxLoopGetIndex(index) \ index[0] = hypre_IndexD(local_idx, 0); \ index[1] = hypre_IndexD(local_idx, 1); \ index[2] = hypre_IndexD(local_idx, 2); @@ -330,3 +336,6 @@ hypre_CheckErrorDevice(cudaDeviceSynchronize()); hypre_BoxLoop2End(i1, i2) #endif + +#endif /* #ifndef HYPRE_BOXLOOP_RAJA_HEADER */ + diff --git a/external/hypre/src/struct_mv/boxloop_sycl.h b/external/hypre/src/struct_mv/boxloop_sycl.h new file mode 100644 index 00000000..fded90e7 --- /dev/null +++ b/external/hypre/src/struct_mv/boxloop_sycl.h @@ -0,0 +1,437 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +/****************************************************************************** + * + * Header info for the BoxLoop + * + *****************************************************************************/ + +/*-------------------------------------------------------------------------- + * BoxLoop macros: + *--------------------------------------------------------------------------*/ + +#ifndef HYPRE_BOXLOOP_SYCL_HEADER +#define HYPRE_BOXLOOP_SYCL_HEADER + +#if defined(HYPRE_USING_SYCL) && !defined(HYPRE_USING_RAJA) && !defined(HYPRE_USING_KOKKOS) + +typedef struct hypre_Boxloop_struct +{ + HYPRE_Int lsize0, lsize1, lsize2; + HYPRE_Int strides0, strides1, strides2; + HYPRE_Int bstart0, bstart1, bstart2; + HYPRE_Int bsize0, bsize1, bsize2; +} hypre_Boxloop; + + +#ifdef __cplusplus +extern "C++" +{ +#endif + + /********************************************************************* + * wrapper functions calling sycl parallel_for + * WM: todo - add runtime switch between CPU/GPU execution + *********************************************************************/ + + template + void + BoxLoopforall( HYPRE_Int length, + LOOP_BODY loop_body) + { + if (length <= 0) + { + return; + } + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(length, "thread", bDim); + + hypre_HandleComputeStream(hypre_handle())->submit([&] (sycl::handler & cgh) + { + cgh.parallel_for(sycl::nd_range<3>(gDim * bDim, bDim), loop_body); + }).wait_and_throw(); + } + + template + void + ReductionBoxLoopforall( LOOP_BODY loop_body, + HYPRE_Int length, + HYPRE_Real * shared_sum_var ) + { + if (length <= 0) + { + return; + } + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(length, "thread", bDim); + + hypre_HandleComputeStream(hypre_handle())->submit([&] (sycl::handler & cgh) + { + cgh.parallel_for(sycl::nd_range<3>(gDim * bDim, bDim), sycl::reduction(shared_sum_var, + std::plus<>()), loop_body); + }).wait_and_throw(); + } + +#ifdef __cplusplus +} +#endif + + +/********************************************************************* + * Init/Declare/IncK etc. + *********************************************************************/ + +/* Get 1-D length of the loop, in hypre__tot */ +#define hypre_newBoxLoopInit(ndim, loop_size) \ + HYPRE_Int hypre__tot = 1; \ + for (HYPRE_Int hypre_d = 0; hypre_d < ndim; hypre_d ++) \ + { \ + hypre__tot *= loop_size[hypre_d]; \ + } + +/* Initialize struct for box-k */ +#define hypre_BoxLoopDataDeclareK(k, ndim, loop_size, dbox, start, stride) \ + hypre_Boxloop databox##k; \ + databox##k.lsize0 = loop_size[0]; \ + databox##k.strides0 = stride[0]; \ + databox##k.bstart0 = start[0] - dbox->imin[0]; \ + databox##k.bsize0 = dbox->imax[0] - dbox->imin[0]; \ + if (ndim > 1) \ + { \ + databox##k.lsize1 = loop_size[1]; \ + databox##k.strides1 = stride[1]; \ + databox##k.bstart1 = start[1] - dbox->imin[1]; \ + databox##k.bsize1 = dbox->imax[1] - dbox->imin[1]; \ + } \ + else \ + { \ + databox##k.lsize1 = 1; \ + databox##k.strides1 = 0; \ + databox##k.bstart1 = 0; \ + databox##k.bsize1 = 0; \ + } \ + if (ndim == 3) \ + { \ + databox##k.lsize2 = loop_size[2]; \ + databox##k.strides2 = stride[2]; \ + databox##k.bstart2 = start[2] - dbox->imin[2]; \ + databox##k.bsize2 = dbox->imax[2] - dbox->imin[2]; \ + } \ + else \ + { \ + databox##k.lsize2 = 1; \ + databox##k.strides2 = 0; \ + databox##k.bstart2 = 0; \ + databox##k.bsize2 = 0; \ + } + +#define hypre_BasicBoxLoopDataDeclareK(k,ndim,loop_size,stride) \ +hypre_Boxloop databox##k; \ +databox##k.lsize0 = loop_size[0]; \ +databox##k.strides0 = stride[0]; \ +databox##k.bstart0 = 0; \ +databox##k.bsize0 = 0; \ +if (ndim > 1) \ +{ \ + databox##k.lsize1 = loop_size[1]; \ + databox##k.strides1 = stride[1]; \ + databox##k.bstart1 = 0; \ + databox##k.bsize1 = 0; \ +} \ +else \ +{ \ + databox##k.lsize1 = 1; \ + databox##k.strides1 = 0; \ + databox##k.bstart1 = 0; \ + databox##k.bsize1 = 0; \ +} \ +if (ndim == 3) \ +{ \ + databox##k.lsize2 = loop_size[2]; \ + databox##k.strides2 = stride[2]; \ + databox##k.bstart2 = 0; \ + databox##k.bsize2 = 0; \ +} \ +else \ +{ \ + databox##k.lsize2 = 1; \ + databox##k.strides2 = 0; \ + databox##k.bstart2 = 0; \ + databox##k.bsize2 = 0; \ +} + +/* Given input 1-D 'idx' in box, get 3-D 'local_idx' in loop_size */ +#define hypre_newBoxLoopDeclare(box) \ + hypre_Index local_idx; \ + HYPRE_Int idx_local = idx; \ + hypre_IndexD(local_idx, 0) = idx_local % box.lsize0; \ + idx_local = idx_local / box.lsize0; \ + hypre_IndexD(local_idx, 1) = idx_local % box.lsize1; \ + idx_local = idx_local / box.lsize1; \ + hypre_IndexD(local_idx, 2) = idx_local % box.lsize2; \ + +/* Given input 3-D 'local_idx', get 1-D 'hypre__i' in 'box' */ +#define hypre_BoxLoopIncK(k, box, hypre__i) \ + HYPRE_Int hypre_boxD##k = 1; \ + HYPRE_Int hypre__i = 0; \ + hypre__i += (hypre_IndexD(local_idx, 0) * box.strides0 + box.bstart0) * hypre_boxD##k; \ + hypre_boxD##k *= hypre_max(0, box.bsize0 + 1); \ + hypre__i += (hypre_IndexD(local_idx, 1) * box.strides1 + box.bstart1) * hypre_boxD##k; \ + hypre_boxD##k *= hypre_max(0, box.bsize1 + 1); \ + hypre__i += (hypre_IndexD(local_idx, 2) * box.strides2 + box.bstart2) * hypre_boxD##k; \ + hypre_boxD##k *= hypre_max(0, box.bsize2 + 1); + +/* get 3-D local_idx into 'index' */ +#define hypre_BoxLoopGetIndex(index) \ + index[0] = hypre_IndexD(local_idx, 0); \ + index[1] = hypre_IndexD(local_idx, 1); \ + index[2] = hypre_IndexD(local_idx, 2); + + +/********************************************************************* + * Boxloops + *********************************************************************/ + +/* BoxLoop 0 */ +#define hypre_newBoxLoop0Begin(ndim, loop_size) \ +{ \ + hypre_newBoxLoopInit(ndim, loop_size); \ + BoxLoopforall(hypre__tot, [=] (sycl::nd_item<3> item) \ + { \ + HYPRE_Int idx = (HYPRE_Int) item.get_global_linear_id(); \ + if (idx < hypre__tot) \ + { \ + +#define hypre_newBoxLoop0End() \ + } \ + }); \ +} + +/* BoxLoop 1 */ +#define hypre_newBoxLoop1Begin(ndim, loop_size, dbox1, start1, stride1, i1) \ +{ \ + hypre_newBoxLoopInit(ndim, loop_size); \ + hypre_BoxLoopDataDeclareK(1, ndim, loop_size, dbox1, start1, stride1); \ + BoxLoopforall(hypre__tot, [=] (sycl::nd_item<3> item) \ + { \ + HYPRE_Int idx = (HYPRE_Int) item.get_global_linear_id(); \ + if (idx < hypre__tot) \ + { \ + hypre_newBoxLoopDeclare(databox1); \ + hypre_BoxLoopIncK(1, databox1, i1); + +#define hypre_newBoxLoop1End(i1) \ + } \ + }); \ +} + +/* BoxLoop 2 */ +#define hypre_newBoxLoop2Begin(ndim, loop_size, dbox1, start1, stride1, i1, \ + dbox2, start2, stride2, i2) \ +{ \ + hypre_newBoxLoopInit(ndim, loop_size); \ + hypre_BoxLoopDataDeclareK(1, ndim, loop_size, dbox1, start1, stride1); \ + hypre_BoxLoopDataDeclareK(2, ndim, loop_size, dbox2, start2, stride2); \ + BoxLoopforall(hypre__tot, [=] (sycl::nd_item<3> item) \ + { \ + HYPRE_Int idx = (HYPRE_Int) item.get_global_linear_id(); \ + if (idx < hypre__tot) \ + { \ + hypre_newBoxLoopDeclare(databox1); \ + hypre_BoxLoopIncK(1, databox1, i1); \ + hypre_BoxLoopIncK(2, databox2, i2); + +#define hypre_newBoxLoop2End(i1, i2) \ + } \ + }); \ +} + +/* BoxLoop 3 */ +#define hypre_newBoxLoop3Begin(ndim, loop_size, dbox1, start1, stride1, i1, \ + dbox2, start2, stride2, i2, \ + dbox3, start3, stride3, i3) \ +{ \ + hypre_newBoxLoopInit(ndim, loop_size); \ + hypre_BoxLoopDataDeclareK(1, ndim,loop_size, dbox1, start1, stride1); \ + hypre_BoxLoopDataDeclareK(2, ndim,loop_size, dbox2, start2, stride2); \ + hypre_BoxLoopDataDeclareK(3, ndim,loop_size, dbox3, start3, stride3); \ + BoxLoopforall(hypre__tot, [=] (sycl::nd_item<3> item) \ + { \ + HYPRE_Int idx = (HYPRE_Int) item.get_global_linear_id(); \ + if (idx < hypre__tot) \ + { \ + hypre_newBoxLoopDeclare(databox1); \ + hypre_BoxLoopIncK(1, databox1, i1); \ + hypre_BoxLoopIncK(2, databox2, i2); \ + hypre_BoxLoopIncK(3, databox3, i3); + +#define hypre_newBoxLoop3End(i1, i2, i3) \ + } \ + }); \ +} + +/* BoxLoop 4 */ +#define hypre_newBoxLoop4Begin(ndim, loop_size, dbox1, start1, stride1, i1, \ + dbox2, start2, stride2, i2, \ + dbox3, start3, stride3, i3, \ + dbox4, start4, stride4, i4) \ +{ \ + hypre_newBoxLoopInit(ndim, loop_size); \ + hypre_BoxLoopDataDeclareK(1, ndim, loop_size, dbox1, start1, stride1); \ + hypre_BoxLoopDataDeclareK(2, ndim, loop_size, dbox2, start2, stride2); \ + hypre_BoxLoopDataDeclareK(3, ndim, loop_size, dbox3, start3, stride3); \ + hypre_BoxLoopDataDeclareK(4, ndim, loop_size, dbox4, start4, stride4); \ + BoxLoopforall(hypre__tot, [=] (sycl::nd_item<3> item) \ + { \ + HYPRE_Int idx = (HYPRE_Int) item.get_global_linear_id(); \ + if (idx < hypre__tot) \ + { \ + hypre_newBoxLoopDeclare(databox1); \ + hypre_BoxLoopIncK(1, databox1, i1); \ + hypre_BoxLoopIncK(2, databox2, i2); \ + hypre_BoxLoopIncK(3, databox3, i3); \ + hypre_BoxLoopIncK(4, databox4, i4); + +#define hypre_newBoxLoop4End(i1, i2, i3, i4) \ + } \ + }); \ +} + + +/* Basic BoxLoops have no boxes */ +/* BoxLoop 1 */ +#define hypre_newBasicBoxLoop1Begin(ndim, loop_size, stride1, i1) \ +{ \ + hypre_newBoxLoopInit(ndim, loop_size); \ + hypre_BasicBoxLoopDataDeclareK(1, ndim, loop_size, stride1); \ + BoxLoopforall(hypre__tot, [=] (sycl::nd_item<3> item) \ + { \ + HYPRE_Int idx = (HYPRE_Int) item.get_global_linear_id(); \ + if (idx < hypre__tot) \ + { \ + hypre_newBoxLoopDeclare(databox1); \ + hypre_BoxLoopIncK(1, databox1, i1); + +/* BoxLoop 2 */ +#define hypre_newBasicBoxLoop2Begin(ndim, loop_size, stride1, i1, stride2, i2) \ +{ \ + hypre_newBoxLoopInit(ndim, loop_size); \ + hypre_BasicBoxLoopDataDeclareK(1, ndim, loop_size, stride1); \ + hypre_BasicBoxLoopDataDeclareK(2, ndim, loop_size, stride2); \ + BoxLoopforall(hypre__tot, [=] (sycl::nd_item<3> item) \ + { \ + HYPRE_Int idx = (HYPRE_Int) item.get_global_linear_id(); \ + if (idx < hypre__tot) \ + { \ + hypre_newBoxLoopDeclare(databox1); \ + hypre_BoxLoopIncK(1, databox1, i1); \ + hypre_BoxLoopIncK(2, databox2, i2); + + +/* Reduction BoxLoop1 */ +#define hypre_newBoxLoop1ReductionBegin(ndim, loop_size, dbox1, start1, stride1, i1, sum_var) \ +{ \ + hypre_newBoxLoopInit(ndim, loop_size); \ + hypre_BoxLoopDataDeclareK(1, ndim, loop_size, dbox1, start1, stride1); \ + HYPRE_Real *shared_sum_var = hypre_CTAlloc(HYPRE_Real, 1, HYPRE_MEMORY_DEVICE); \ + hypre_TMemcpy(shared_sum_var, &sum_var, HYPRE_Real, 1, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); \ + ReductionBoxLoopforall( [=,hypre_unused_var=sum_var] (sycl::nd_item<3> item, auto &sum_var) \ + { \ + HYPRE_Int idx = (HYPRE_Int) item.get_global_linear_id(); \ + if (idx < hypre__tot) \ + { \ + hypre_newBoxLoopDeclare(databox1); \ + hypre_BoxLoopIncK(1, databox1, i1); + +#define hypre_newBoxLoop1ReductionEnd(i1, sum_var) \ + } \ + }, hypre__tot, shared_sum_var); \ + hypre_TMemcpy(&sum_var, shared_sum_var, HYPRE_Real, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); \ + hypre_TFree(shared_sum_var, HYPRE_MEMORY_DEVICE); \ +} + +/* Reduction BoxLoop2 */ +#define hypre_newBoxLoop2ReductionBegin(ndim, loop_size, dbox1, start1, stride1, i1, \ + dbox2, start2, stride2, i2, sum_var) \ +{ \ + hypre_newBoxLoopInit(ndim, loop_size); \ + hypre_BoxLoopDataDeclareK(1, ndim, loop_size, dbox1, start1, stride1); \ + hypre_BoxLoopDataDeclareK(2, ndim, loop_size, dbox2, start2, stride2); \ + HYPRE_Real *shared_sum_var = hypre_CTAlloc(HYPRE_Real, 1, HYPRE_MEMORY_DEVICE); \ + hypre_TMemcpy(shared_sum_var, &sum_var, HYPRE_Real, 1, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); \ + ReductionBoxLoopforall( [=,hypre_unused_var=sum_var] (sycl::nd_item<3> item, auto &sum_var) \ + { \ + HYPRE_Int idx = (HYPRE_Int) item.get_global_linear_id(); \ + if (idx < hypre__tot) \ + { \ + hypre_newBoxLoopDeclare(databox1); \ + hypre_BoxLoopIncK(1, databox1, i1); \ + hypre_BoxLoopIncK(2, databox2, i2); + +#define hypre_newBoxLoop2ReductionEnd(i1, i2, sum_var) \ + } \ + }, hypre__tot, shared_sum_var); \ + hypre_TMemcpy(&sum_var, shared_sum_var, HYPRE_Real, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); \ + hypre_TFree(shared_sum_var, HYPRE_MEMORY_DEVICE); \ +} + +/* Plain parallel_for loop */ +#define hypre_LoopBegin(size, idx) \ +{ \ + HYPRE_Int hypre__tot = size; \ + BoxLoopforall(hypre__tot, [=] (sycl::nd_item<3> item) \ + { \ + HYPRE_Int idx = (HYPRE_Int) item.get_global_linear_id(); \ + if (idx < hypre__tot) \ + { \ + +#define hypre_LoopEnd() \ + } \ + }); \ +} + + +/********************************************************************* + * renamings + *********************************************************************/ + +#define hypre_BoxLoopBlock() 0 + +#define hypre_BoxLoop0Begin hypre_newBoxLoop0Begin +#define hypre_BoxLoop0End hypre_newBoxLoop0End +#define hypre_BoxLoop1Begin hypre_newBoxLoop1Begin +#define hypre_BoxLoop1End hypre_newBoxLoop1End +#define hypre_BoxLoop2Begin hypre_newBoxLoop2Begin +#define hypre_BoxLoop2End hypre_newBoxLoop2End +#define hypre_BoxLoop3Begin hypre_newBoxLoop3Begin +#define hypre_BoxLoop3End hypre_newBoxLoop3End +#define hypre_BoxLoop4Begin hypre_newBoxLoop4Begin +#define hypre_BoxLoop4End hypre_newBoxLoop4End + +#define hypre_BasicBoxLoop1Begin hypre_newBasicBoxLoop1Begin +#define hypre_BasicBoxLoop2Begin hypre_newBasicBoxLoop2Begin + +/* Reduction */ +#define hypre_BoxLoop1ReductionBegin(ndim, loop_size, dbox1, start1, stride1, i1, reducesum) \ + hypre_newBoxLoop1ReductionBegin(ndim, loop_size, dbox1, start1, stride1, i1, reducesum) + +#define hypre_BoxLoop1ReductionEnd(i1, reducesum) \ + hypre_newBoxLoop1ReductionEnd(i1, reducesum) + +#define hypre_BoxLoop2ReductionBegin(ndim, loop_size, dbox1, start1, stride1, i1, \ + dbox2, start2, stride2, i2, reducesum) \ + hypre_newBoxLoop2ReductionBegin(ndim, loop_size, dbox1, start1, stride1, i1, \ + dbox2, start2, stride2, i2, reducesum) + +#define hypre_BoxLoop2ReductionEnd(i1, i2, reducesum) \ + hypre_newBoxLoop2ReductionEnd(i1, i2, reducesum) + +#endif + +#endif /* #ifndef HYPRE_BOXLOOP_SYCL_HEADER */ + diff --git a/external/hypre/src/struct_mv/communication_info.c b/external/hypre/src/struct_mv/communication_info.c index 3db012fe..60eb4b0a 100644 --- a/external/hypre/src/struct_mv/communication_info.c +++ b/external/hypre/src/struct_mv/communication_info.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -134,72 +134,75 @@ hypre_CommInfoDestroy( hypre_CommInfo *comm_info ) HYPRE_Int **transforms; HYPRE_Int i, size; - size = hypre_BoxArrayArraySize(hypre_CommInfoSendBoxes(comm_info)); - hypre_BoxArrayArrayDestroy(hypre_CommInfoSendBoxes(comm_info)); - processes = hypre_CommInfoSendProcesses(comm_info); - for (i = 0; i < size; i++) - { - hypre_TFree(processes[i], HYPRE_MEMORY_HOST); - } - hypre_TFree(processes, HYPRE_MEMORY_HOST); - rboxnums = hypre_CommInfoSendRBoxnums(comm_info); - if (rboxnums != NULL) + if (comm_info) { + size = hypre_BoxArrayArraySize(hypre_CommInfoSendBoxes(comm_info)); + hypre_BoxArrayArrayDestroy(hypre_CommInfoSendBoxes(comm_info)); + processes = hypre_CommInfoSendProcesses(comm_info); for (i = 0; i < size; i++) { - hypre_TFree(rboxnums[i], HYPRE_MEMORY_HOST); + hypre_TFree(processes[i], HYPRE_MEMORY_HOST); } - hypre_TFree(rboxnums, HYPRE_MEMORY_HOST); - } - hypre_BoxArrayArrayDestroy(hypre_CommInfoSendRBoxes(comm_info)); - transforms = hypre_CommInfoSendTransforms(comm_info); - if (transforms != NULL) - { - for (i = 0; i < size; i++) + hypre_TFree(processes, HYPRE_MEMORY_HOST); + rboxnums = hypre_CommInfoSendRBoxnums(comm_info); + if (rboxnums != NULL) { - hypre_TFree(transforms[i], HYPRE_MEMORY_HOST); + for (i = 0; i < size; i++) + { + hypre_TFree(rboxnums[i], HYPRE_MEMORY_HOST); + } + hypre_TFree(rboxnums, HYPRE_MEMORY_HOST); + } + hypre_BoxArrayArrayDestroy(hypre_CommInfoSendRBoxes(comm_info)); + transforms = hypre_CommInfoSendTransforms(comm_info); + if (transforms != NULL) + { + for (i = 0; i < size; i++) + { + hypre_TFree(transforms[i], HYPRE_MEMORY_HOST); + } + hypre_TFree(transforms, HYPRE_MEMORY_HOST); } - hypre_TFree(transforms, HYPRE_MEMORY_HOST); - } - size = hypre_BoxArrayArraySize(hypre_CommInfoRecvBoxes(comm_info)); - hypre_BoxArrayArrayDestroy(hypre_CommInfoRecvBoxes(comm_info)); - processes = hypre_CommInfoRecvProcesses(comm_info); - for (i = 0; i < size; i++) - { - hypre_TFree(processes[i], HYPRE_MEMORY_HOST); - } - hypre_TFree(processes, HYPRE_MEMORY_HOST); - rboxnums = hypre_CommInfoRecvRBoxnums(comm_info); - if (rboxnums != NULL) - { + size = hypre_BoxArrayArraySize(hypre_CommInfoRecvBoxes(comm_info)); + hypre_BoxArrayArrayDestroy(hypre_CommInfoRecvBoxes(comm_info)); + processes = hypre_CommInfoRecvProcesses(comm_info); for (i = 0; i < size; i++) { - hypre_TFree(rboxnums[i], HYPRE_MEMORY_HOST); + hypre_TFree(processes[i], HYPRE_MEMORY_HOST); } - hypre_TFree(rboxnums, HYPRE_MEMORY_HOST); - } - hypre_BoxArrayArrayDestroy(hypre_CommInfoRecvRBoxes(comm_info)); - transforms = hypre_CommInfoRecvTransforms(comm_info); - if (transforms != NULL) - { - for (i = 0; i < size; i++) + hypre_TFree(processes, HYPRE_MEMORY_HOST); + rboxnums = hypre_CommInfoRecvRBoxnums(comm_info); + if (rboxnums != NULL) { - hypre_TFree(transforms[i], HYPRE_MEMORY_HOST); + for (i = 0; i < size; i++) + { + hypre_TFree(rboxnums[i], HYPRE_MEMORY_HOST); + } + hypre_TFree(rboxnums, HYPRE_MEMORY_HOST); + } + hypre_BoxArrayArrayDestroy(hypre_CommInfoRecvRBoxes(comm_info)); + transforms = hypre_CommInfoRecvTransforms(comm_info); + if (transforms != NULL) + { + for (i = 0; i < size; i++) + { + hypre_TFree(transforms[i], HYPRE_MEMORY_HOST); + } + hypre_TFree(transforms, HYPRE_MEMORY_HOST); } - hypre_TFree(transforms, HYPRE_MEMORY_HOST); - } - hypre_TFree(hypre_CommInfoCoords(comm_info), HYPRE_MEMORY_HOST); - hypre_TFree(hypre_CommInfoDirs(comm_info), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_CommInfoCoords(comm_info), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_CommInfoDirs(comm_info), HYPRE_MEMORY_HOST); - hypre_TFree(comm_info, HYPRE_MEMORY_HOST); + hypre_TFree(comm_info, HYPRE_MEMORY_HOST); + } return hypre_error_flag; } /*-------------------------------------------------------------------------- - * NEW version that uses the box manager to find neighbors boxes. + * NEW version that uses the box manager to find neighbors boxes. * AHB 9/06 * * Return descriptions of communications patterns for a given @@ -223,20 +226,20 @@ hypre_CommInfoDestroy( hypre_CommInfo *comm_info ) * difference between doing 26 communications versus 6): * * To compute send/recv regions, do - * + * * for i = local box * { * gbox_i = grow box i according to stencil * - * //find neighbors of i - * call BoxManIntersect on gbox_i (and periodic gbox_i) + * //find neighbors of i + * call BoxManIntersect on gbox_i (and periodic gbox_i) * * // receives * for j = neighbor box of i * { * intersect gbox_i with box j and add to recv region * } - * + * * // sends * for j = neighbor box of i * { @@ -244,21 +247,21 @@ hypre_CommInfoDestroy( hypre_CommInfo *comm_info ) * intersect gbox_j with box i and add to send region * } * } - * - * (Note: no ordering is assumed) + * + * (Note: no ordering is assumed) * * 2. Optimization on basic algorithm: - * + * * Before looping over the neighbors in the above algorithm, do a * preliminary sweep through the neighbors to select a subset of * neighbors to do the intersections with. To select the subset, * compute a so-called "distance index" and check the corresponding * entry in the so-called "stencil grid" to decide whether or not to * use the box. - * + * * The "stencil grid" is a 3x3x3 grid in 3D that is built from the * stencil as follows: - * + * * // assume for simplicity that i,j,k are -1, 0, or 1 * for each stencil entry (i,j,k) * { @@ -268,25 +271,25 @@ hypre_CommInfoDestroy( hypre_CommInfo *comm_info ) * * * 3. Complications with periodicity: - * + * * When periodicity is on, it is possible to have a box-pair region * (the description of a communication pattern between two boxes) that * consists of more than one box. - * + * * 4. Box Manager * - * The box manager is used to determine neighbors. It is assumed - * that the grid's box manager contains sufficient neighbor + * The box manager is used to determine neighbors. It is assumed + * that the grid's box manager contains sufficient neighbor * information. * - * NOTES: + * NOTES: * * A. No concept of data ownership is assumed. As a result, * redundant communication patterns can be produced when the grid * boxes overlap. * * B. Boxes in the send and recv regions do not need to be in any - * particular order (including those that are periodic). + * particular order (including those that are periodic). * *--------------------------------------------------------------------------*/ @@ -296,7 +299,7 @@ hypre_CreateCommInfoFromStencil( hypre_StructGrid *grid, hypre_CommInfo **comm_info_ptr ) { HYPRE_Int ndim = hypre_StructGridNDim(grid); - HYPRE_Int i,j,k, d, m, s, si; + HYPRE_Int i, j, k, d, m, s, si; hypre_BoxArrayArray *send_boxes; hypre_BoxArrayArray *recv_boxes; @@ -312,25 +315,25 @@ hypre_CreateCommInfoFromStencil( hypre_StructGrid *grid, HYPRE_Int num_boxes; hypre_BoxManager *boxman; - + hypre_Index *stencil_shape; hypre_IndexRef stencil_offset; hypre_IndexRef pshift; - + hypre_Box *box; hypre_Box *hood_box; hypre_Box *grow_box; hypre_Box *extend_box; hypre_Box *int_box; hypre_Box *periodic_box; - + hypre_Box *stencil_box, *sbox; /* extents of the stencil grid */ HYPRE_Int *stencil_grid; HYPRE_Int grow[HYPRE_MAXDIM][2]; - + hypre_BoxManEntry **entries; hypre_BoxManEntry *entry; - + HYPRE_Int num_entries; hypre_BoxArray *neighbor_boxes = NULL; HYPRE_Int *neighbor_procs = NULL; @@ -345,19 +348,19 @@ hypre_CreateCommInfoFromStencil( hypre_StructGrid *grid, hypre_BoxArray *recv_box_array; hypre_BoxArray *send_rbox_array; hypre_BoxArray *recv_rbox_array; - + hypre_Box **cboxes; hypre_Box *cboxes_mem; HYPRE_Int *cboxes_neighbor_location; HYPRE_Int num_cboxes, cbox_alloc; - + hypre_Index istart, istop, sgindex; hypre_IndexRef start; hypre_Index loop_size, stride; HYPRE_Int num_periods, loc, box_id, id, proc_id; HYPRE_Int myid; - + MPI_Comm comm; /*------------------------------------------------------ @@ -373,10 +376,10 @@ hypre_CreateCommInfoFromStencil( hypre_StructGrid *grid, local_boxes = hypre_StructGridBoxes(grid); num_boxes = hypre_BoxArraySize(local_boxes); num_periods = hypre_StructGridNumPeriods(grid); - + boxman = hypre_StructGridBoxMan(grid); comm = hypre_StructGridComm(grid); - + hypre_MPI_Comm_rank(comm, &myid); stencil_box = hypre_BoxCreate(ndim); @@ -388,7 +391,7 @@ hypre_CreateCommInfoFromStencil( hypre_StructGrid *grid, sbox = hypre_BoxCreate(ndim); hypre_SetIndex(stride, 1); - + /*------------------------------------------------------ * Compute the "grow" information from the stencil *------------------------------------------------------*/ @@ -430,7 +433,7 @@ hypre_CreateCommInfoFromStencil( hypre_StructGrid *grid, hypre_BoxGetSize(sbox, loop_size); hypre_SerialBoxLoop1Begin(ndim, loop_size, - stencil_box, start, stride, si); + stencil_box, start, stride, si); { stencil_grid[si] = 1; } @@ -460,7 +463,7 @@ hypre_CreateCommInfoFromStencil( hypre_StructGrid *grid, extend_box = hypre_BoxCreate(hypre_StructGridNDim(grid)); int_box = hypre_BoxCreate(hypre_StructGridNDim(grid)); periodic_box = hypre_BoxCreate(hypre_StructGridNDim(grid)); - + /* storage we will use and keep track of the neighbors */ neighbor_alloc = 30; /* initial guess at max size */ neighbor_boxes = hypre_BoxArrayCreate(neighbor_alloc, ndim); @@ -484,7 +487,7 @@ hypre_CreateCommInfoFromStencil( hypre_StructGrid *grid, /* get the box */ box = hypre_BoxArrayBox(local_boxes, i); box_id = i; - + /* grow box local i according to the stencil*/ hypre_CopyBox(box, grow_box); for (d = 0; d < ndim; d++) @@ -498,16 +501,16 @@ hypre_CreateCommInfoFromStencil( hypre_StructGrid *grid, in one dimension [0] and not the other [1] */ hypre_CopyBox(box, extend_box); for (d = 0; d < ndim; d++) - { - hypre_BoxIMinD(extend_box, d) -= hypre_max(grow[d][0],grow[d][1]); - hypre_BoxIMaxD(extend_box, d) += hypre_max(grow[d][0],grow[d][1]); + { + hypre_BoxIMinD(extend_box, d) -= hypre_max(grow[d][0], grow[d][1]); + hypre_BoxIMaxD(extend_box, d) += hypre_max(grow[d][0], grow[d][1]); } /*------------------------------------------------ * Determine the neighbors of box i *------------------------------------------------*/ - - /* Do this by intersecting the extend box with the BoxManager. + + /* Do this by intersecting the extend box with the BoxManager. We must also check for periodic neighbors. */ neighbor_count = 0; @@ -518,23 +521,23 @@ hypre_CreateCommInfoFromStencil( hypre_StructGrid *grid, hypre_CopyBox(extend_box, periodic_box); pshift = hypre_StructGridPShift(grid, k); hypre_BoxShiftPos(periodic_box, pshift); - + /* get the intersections */ - hypre_BoxManIntersect(boxman, hypre_BoxIMin(periodic_box) , - hypre_BoxIMax(periodic_box) , - &entries , &num_entries); - + hypre_BoxManIntersect(boxman, hypre_BoxIMin(periodic_box), + hypre_BoxIMax(periodic_box), + &entries, &num_entries); + /* note: do we need to remove the intersection with our original box? - no if periodic, yes if non-periodic (k=0) */ + no if periodic, yes if non-periodic (k=0) */ /* unpack entries (first check storage) */ if (neighbor_count + num_entries > neighbor_alloc) { neighbor_alloc = neighbor_count + num_entries + 5; - neighbor_procs = hypre_TReAlloc(neighbor_procs, HYPRE_Int, + neighbor_procs = hypre_TReAlloc(neighbor_procs, HYPRE_Int, neighbor_alloc, HYPRE_MEMORY_HOST); neighbor_ids = hypre_TReAlloc(neighbor_ids, HYPRE_Int, neighbor_alloc, HYPRE_MEMORY_HOST); - neighbor_shifts = hypre_TReAlloc(neighbor_shifts, HYPRE_Int, + neighbor_shifts = hypre_TReAlloc(neighbor_shifts, HYPRE_Int, neighbor_alloc, HYPRE_MEMORY_HOST); } /* check storage for the array */ @@ -543,18 +546,18 @@ hypre_CreateCommInfoFromStencil( hypre_StructGrid *grid, for (j = 0; j < num_entries; j++) { entry = entries[j]; - proc_id = hypre_BoxManEntryProc(entry); - id = hypre_BoxManEntryId(entry); - /* don't keep box i in the non-periodic case*/ + proc_id = hypre_BoxManEntryProc(entry); + id = hypre_BoxManEntryId(entry); + /* don't keep box i in the non-periodic case*/ if (!k) { - if((myid == proc_id) && (box_id == id)) + if ((myid == proc_id) && (box_id == id)) { continue; } } - hypre_BoxManEntryGetExtents(entry, ilower, iupper); + hypre_BoxManEntryGetExtents(entry, ilower, iupper); hypre_BoxSetExtents(hypre_BoxArrayBox(neighbor_boxes, neighbor_count), ilower, iupper); /* shift the periodic boxes (needs to be the opposite of above) */ @@ -563,7 +566,7 @@ hypre_CreateCommInfoFromStencil( hypre_StructGrid *grid, hypre_BoxShiftNeg( hypre_BoxArrayBox(neighbor_boxes, neighbor_count), pshift); } - + neighbor_procs[neighbor_count] = proc_id; neighbor_ids[neighbor_count] = id; neighbor_shifts[neighbor_count] = k; @@ -572,7 +575,7 @@ hypre_CreateCommInfoFromStencil( hypre_StructGrid *grid, hypre_BoxArraySetSize(neighbor_boxes, neighbor_count); hypre_TFree(entries, HYPRE_MEMORY_HOST); - + } /* end of loop through periods k */ /* Now we have a list of all of the neighbors for box i! */ @@ -581,8 +584,8 @@ hypre_CreateCommInfoFromStencil( hypre_StructGrid *grid, different intersections (TO DO: put more thought into if there are ever any exceptions to this? - the intersection routine already eliminates duplicates - so what i mean is eliminating duplicates from multiple - intersection calls in periodic case) */ - + intersection calls in periodic case) */ + /*------------------------------------------------ * Compute recv_box_array for box i *------------------------------------------------*/ @@ -593,7 +596,7 @@ hypre_CreateCommInfoFromStencil( hypre_StructGrid *grid, if (neighbor_count > cbox_alloc) { cbox_alloc = neighbor_count; - cboxes_neighbor_location = hypre_TReAlloc(cboxes_neighbor_location, + cboxes_neighbor_location = hypre_TReAlloc(cboxes_neighbor_location, HYPRE_Int, cbox_alloc, HYPRE_MEMORY_HOST); cboxes = hypre_TReAlloc(cboxes, hypre_Box *, cbox_alloc, HYPRE_MEMORY_HOST); cboxes_mem = hypre_TReAlloc(cboxes_mem, hypre_Box, cbox_alloc, HYPRE_MEMORY_HOST); @@ -605,7 +608,7 @@ hypre_CreateCommInfoFromStencil( hypre_StructGrid *grid, we need to (positive) shift it back. */ num_cboxes = 0; - + for (k = 0; k < neighbor_count; k++) { hood_box = hypre_BoxArrayBox(neighbor_boxes, k); @@ -613,7 +616,7 @@ hypre_CreateCommInfoFromStencil( hypre_StructGrid *grid, for (d = 0; d < ndim; d++) { sgindex[d] = 1; - + s = hypre_BoxIMinD(hood_box, d) - hypre_BoxIMaxD(box, d); if (s > 0) { @@ -625,8 +628,8 @@ hypre_CreateCommInfoFromStencil( hypre_StructGrid *grid, sgindex[d] = 0; } } - /* it makes sense only if we have at least one non-zero entry */ - si = hypre_BoxIndexRank(stencil_box, sgindex); + /* it makes sense only if we have at least one non-zero entry */ + si = hypre_BoxIndexRank(stencil_box, sgindex); if (stencil_grid[si]) { /* intersect - result is int_box */ @@ -687,7 +690,7 @@ hypre_CreateCommInfoFromStencil( hypre_StructGrid *grid, for (d = 0; d < ndim; d++) { sgindex[d] = 1; - + s = hypre_BoxIMinD(box, d) - hypre_BoxIMaxD(hood_box, d); if (s > 0) { @@ -699,8 +702,8 @@ hypre_CreateCommInfoFromStencil( hypre_StructGrid *grid, sgindex[d] = 0; } } - /* it makes sense only if we have at least one non-zero entry */ - si = hypre_BoxIndexRank(stencil_box, sgindex); + /* it makes sense only if we have at least one non-zero entry */ + si = hypre_BoxIndexRank(stencil_box, sgindex); if (stencil_grid[si]) { /* grow the neighbor box and intersect */ @@ -765,7 +768,7 @@ hypre_CreateCommInfoFromStencil( hypre_StructGrid *grid, hypre_BoxDestroy(int_box); hypre_BoxDestroy(periodic_box); hypre_BoxDestroy(extend_box); - + hypre_BoxDestroy(stencil_box); hypre_BoxDestroy(sbox); hypre_TFree(stencil_grid, HYPRE_MEMORY_HOST); @@ -800,13 +803,13 @@ hypre_CreateCommInfoFromNumGhost( hypre_StructGrid *grid, hypre_IndexRef start; HYPRE_Int i, d, size; - size = (HYPRE_Int)(pow(3, ndim) + 0.5); + size = (HYPRE_Int)(pow(3.0, ndim) + 0.5); stencil_shape = hypre_CTAlloc(hypre_Index, size, HYPRE_MEMORY_HOST); box = hypre_BoxCreate(ndim); for (d = 0; d < ndim; d++) { - hypre_BoxIMinD(box, d) = -(num_ghost[2*d] ? 1 : 0); - hypre_BoxIMaxD(box, d) = (num_ghost[2*d+1] ? 1 : 0); + hypre_BoxIMinD(box, d) = -(num_ghost[2 * d] ? 1 : 0); + hypre_BoxIMaxD(box, d) = (num_ghost[2 * d + 1] ? 1 : 0); } size = 0; @@ -817,14 +820,14 @@ hypre_CreateCommInfoFromNumGhost( hypre_StructGrid *grid, zypre_BoxLoopGetIndex(ii); for (d = 0; d < ndim; d++) { - i = ii[d]+start[d]; + i = ii[d] + start[d]; if (i < 0) { - stencil_shape[size][d] = -num_ghost[2*d]; + stencil_shape[size][d] = -num_ghost[2 * d]; } else if (i > 0) { - stencil_shape[size][d] = num_ghost[2*d+1]; + stencil_shape[size][d] = num_ghost[2 * d + 1]; } } size++; @@ -883,12 +886,12 @@ hypre_CreateCommInfoFromGrids( hypre_StructGrid *from_grid, /*------------------------------------------------------ * Set up communication info *------------------------------------------------------*/ - + ndim = hypre_StructGridNDim(from_grid); for (r = 0; r < 2; r++) { - switch(r) + switch (r) { case 0: local_grid = from_grid; @@ -939,16 +942,16 @@ hypre_CreateCommInfoFromGrids( hypre_StructGrid *from_grid, k = hypre_BoxArraySize(comm_box_array); comm_procs[i][k] = remote_all_procs[j]; comm_boxnums[i][k] = remote_all_boxnums[j]; - + hypre_AppendBox(comm_box, comm_box_array); } } comm_procs[i] = - hypre_TReAlloc(comm_procs[i], + hypre_TReAlloc(comm_procs[i], HYPRE_Int, hypre_BoxArraySize(comm_box_array), HYPRE_MEMORY_HOST); comm_boxnums[i] = - hypre_TReAlloc(comm_boxnums[i], + hypre_TReAlloc(comm_boxnums[i], HYPRE_Int, hypre_BoxArraySize(comm_box_array), HYPRE_MEMORY_HOST); } hypre_BoxDestroy(comm_box); @@ -957,7 +960,7 @@ hypre_CreateCommInfoFromGrids( hypre_StructGrid *from_grid, hypre_TFree(remote_all_procs, HYPRE_MEMORY_HOST); hypre_TFree(remote_all_boxnums, HYPRE_MEMORY_HOST); - switch(r) + switch (r) { case 0: send_boxes = comm_boxes; diff --git a/external/hypre/src/struct_mv/computation.c b/external/hypre/src/struct_mv/computation.c index e357fde7..6677f46d 100644 --- a/external/hypre/src/struct_mv/computation.c +++ b/external/hypre/src/struct_mv/computation.c @@ -1,12 +1,12 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ /****************************************************************************** - * + * *****************************************************************************/ #include "_hypre_struct_mv.h" @@ -172,7 +172,7 @@ hypre_CreateComputeInfo( hypre_StructGrid *grid, hypre_ForBoxI(i, boxes) { cbox_array = hypre_BoxArrayArrayBoxArray(dept_boxes, i); - hypre_BoxArraySetSize(cbox_array, 2*ndim); + hypre_BoxArraySetSize(cbox_array, 2 * ndim); hypre_CopyBox(hypre_BoxArrayBox(boxes, i), rembox); cbox_array_size = 0; @@ -288,7 +288,7 @@ hypre_ComputePkgCreate( hypre_ComputeInfo *compute_info, hypre_CommInfoDestroy(hypre_ComputeInfoCommInfo(compute_info)); hypre_ComputePkgCommPkg(compute_pkg) = comm_pkg; - hypre_ComputePkgIndtBoxes(compute_pkg) = + hypre_ComputePkgIndtBoxes(compute_pkg) = hypre_ComputeInfoIndtBoxes(compute_info); hypre_ComputePkgDeptBoxes(compute_pkg) = hypre_ComputeInfoDeptBoxes(compute_info); diff --git a/external/hypre/src/struct_mv/computation.h b/external/hypre/src/struct_mv/computation.h index 49ef9155..eed2d7bd 100644 --- a/external/hypre/src/struct_mv/computation.h +++ b/external/hypre/src/struct_mv/computation.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -50,7 +50,7 @@ typedef struct hypre_ComputePkg_struct /*-------------------------------------------------------------------------- * Accessor macros: hypre_ComputeInfo *--------------------------------------------------------------------------*/ - + #define hypre_ComputeInfoCommInfo(info) (info -> comm_info) #define hypre_ComputeInfoIndtBoxes(info) (info -> indt_boxes) #define hypre_ComputeInfoDeptBoxes(info) (info -> dept_boxes) @@ -59,7 +59,7 @@ typedef struct hypre_ComputePkg_struct /*-------------------------------------------------------------------------- * Accessor macros: hypre_ComputePkg *--------------------------------------------------------------------------*/ - + #define hypre_ComputePkgCommPkg(compute_pkg) (compute_pkg -> comm_pkg) #define hypre_ComputePkgIndtBoxes(compute_pkg) (compute_pkg -> indt_boxes) diff --git a/external/hypre/src/struct_mv/headers b/external/hypre/src/struct_mv/headers old mode 100644 new mode 100755 index 645f39c4..0e3b688f --- a/external/hypre/src/struct_mv/headers +++ b/external/hypre/src/struct_mv/headers @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -51,25 +51,8 @@ cat protos.h >> $INTERNAL_HEADER #=========================================================================== # BoxLoops #=========================================================================== - -cat >> $INTERNAL_HEADER <<@ - -#if defined(HYPRE_USING_DEVICE_OPENMP) -@ - -cat boxloop_omp_device.h >> $INTERNAL_HEADER - -cat >> $INTERNAL_HEADER <<@ - -#elif !defined(HYPRE_USING_RAJA) && !defined(HYPRE_USING_KOKKOS) && !defined(HYPRE_USING_CUDA) && !defined(HYPRE_USING_HIP) -@ - -cat boxloop_host.h >> $INTERNAL_HEADER - -cat >> $INTERNAL_HEADER <<@ - -#endif -@ +cat boxloop_omp_device.h >> $INTERNAL_HEADER +cat boxloop_host.h >> $INTERNAL_HEADER #=========================================================================== # Include guards @@ -114,31 +97,10 @@ extern "C++" { # BoxLoops #=========================================================================== -cat >> $INTERNAL_HEADER <<@ - -#if defined(HYPRE_USING_RAJA) -@ - -cat boxloop_raja.h >> $INTERNAL_HEADER - -cat >> $INTERNAL_HEADER <<@ - -#elif defined(HYPRE_USING_KOKKOS) -@ - -cat boxloop_kokkos.h >> $INTERNAL_HEADER - -cat >> $INTERNAL_HEADER <<@ - -#elif defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) -@ - -cat boxloop_cuda.h >> $INTERNAL_HEADER - -cat >> $INTERNAL_HEADER <<@ - -#endif -@ +cat boxloop_raja.h >> $INTERNAL_HEADER +cat boxloop_kokkos.h >> $INTERNAL_HEADER +cat boxloop_cuda.h >> $INTERNAL_HEADER +cat boxloop_sycl.h >> $INTERNAL_HEADER #=========================================================================== # Include guards diff --git a/external/hypre/src/struct_mv/project.c b/external/hypre/src/struct_mv/project.c index c1604926..3aad2200 100644 --- a/external/hypre/src/struct_mv/project.c +++ b/external/hypre/src/struct_mv/project.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -42,14 +42,22 @@ hypre_ProjectBox( hypre_Box *box, hu = hypre_BoxIMaxD(box, d) - i; if ( hl <= 0 ) + { kl = (HYPRE_Int) (hl / s); + } else - kl = (HYPRE_Int) ((hl + (s-1)) / s); + { + kl = (HYPRE_Int) ((hl + (s - 1)) / s); + } if ( hu >= 0 ) + { ku = (HYPRE_Int) (hu / s); + } else - ku = (HYPRE_Int) ((hu - (s-1)) / s); + { + ku = (HYPRE_Int) ((hu - (s - 1)) / s); + } hypre_BoxIMinD(box, d) = i + kl * s; hypre_BoxIMaxD(box, d) = i + ku * s; diff --git a/external/hypre/src/struct_mv/protos.h b/external/hypre/src/struct_mv/protos.h index 9c5ae4a4..640a1c5d 100644 --- a/external/hypre/src/struct_mv/protos.h +++ b/external/hypre/src/struct_mv/protos.h @@ -1,305 +1,454 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ /* assumed_part.c */ -HYPRE_Int hypre_APSubdivideRegion ( hypre_Box *region , HYPRE_Int dim , HYPRE_Int level , hypre_BoxArray *box_array , HYPRE_Int *num_new_boxes ); -HYPRE_Int hypre_APFindMyBoxesInRegions ( hypre_BoxArray *region_array , hypre_BoxArray *my_box_array , HYPRE_Int **p_count_array , HYPRE_Real **p_vol_array ); -HYPRE_Int hypre_APGetAllBoxesInRegions ( hypre_BoxArray *region_array , hypre_BoxArray *my_box_array , HYPRE_Int **p_count_array , HYPRE_Real **p_vol_array , MPI_Comm comm ); -HYPRE_Int hypre_APShrinkRegions ( hypre_BoxArray *region_array , hypre_BoxArray *my_box_array , MPI_Comm comm ); -HYPRE_Int hypre_APPruneRegions ( hypre_BoxArray *region_array , HYPRE_Int **p_count_array , HYPRE_Real **p_vol_array ); -HYPRE_Int hypre_APRefineRegionsByVol ( hypre_BoxArray *region_array , HYPRE_Real *vol_array , HYPRE_Int max_regions , HYPRE_Real gamma , HYPRE_Int dim , HYPRE_Int *return_code , MPI_Comm comm ); -HYPRE_Int hypre_StructAssumedPartitionCreate ( HYPRE_Int dim , hypre_Box *bounding_box , HYPRE_Real global_boxes_size , HYPRE_Int global_num_boxes , hypre_BoxArray *local_boxes , HYPRE_Int *local_boxnums , HYPRE_Int max_regions , HYPRE_Int max_refinements , HYPRE_Real gamma , MPI_Comm comm , hypre_StructAssumedPart **p_assumed_partition ); +HYPRE_Int hypre_APSubdivideRegion ( hypre_Box *region, HYPRE_Int dim, HYPRE_Int level, + hypre_BoxArray *box_array, HYPRE_Int *num_new_boxes ); +HYPRE_Int hypre_APFindMyBoxesInRegions ( hypre_BoxArray *region_array, hypre_BoxArray *my_box_array, + HYPRE_Int **p_count_array, HYPRE_Real **p_vol_array ); +HYPRE_Int hypre_APGetAllBoxesInRegions ( hypre_BoxArray *region_array, hypre_BoxArray *my_box_array, + HYPRE_Int **p_count_array, HYPRE_Real **p_vol_array, MPI_Comm comm ); +HYPRE_Int hypre_APShrinkRegions ( hypre_BoxArray *region_array, hypre_BoxArray *my_box_array, + MPI_Comm comm ); +HYPRE_Int hypre_APPruneRegions ( hypre_BoxArray *region_array, HYPRE_Int **p_count_array, + HYPRE_Real **p_vol_array ); +HYPRE_Int hypre_APRefineRegionsByVol ( hypre_BoxArray *region_array, HYPRE_Real *vol_array, + HYPRE_Int max_regions, HYPRE_Real gamma, HYPRE_Int dim, HYPRE_Int *return_code, MPI_Comm comm ); +HYPRE_Int hypre_StructAssumedPartitionCreate ( HYPRE_Int dim, hypre_Box *bounding_box, + HYPRE_Real global_boxes_size, HYPRE_Int global_num_boxes, hypre_BoxArray *local_boxes, + HYPRE_Int *local_boxnums, HYPRE_Int max_regions, HYPRE_Int max_refinements, HYPRE_Real gamma, + MPI_Comm comm, hypre_StructAssumedPart **p_assumed_partition ); HYPRE_Int hypre_StructAssumedPartitionDestroy ( hypre_StructAssumedPart *assumed_part ); -HYPRE_Int hypre_APFillResponseStructAssumedPart ( void *p_recv_contact_buf , HYPRE_Int contact_size , HYPRE_Int contact_proc , void *ro , MPI_Comm comm , void **p_send_response_buf , HYPRE_Int *response_message_size ); -HYPRE_Int hypre_StructAssumedPartitionGetRegionsFromProc ( hypre_StructAssumedPart *assumed_part , HYPRE_Int proc_id , hypre_BoxArray *assumed_regions ); -HYPRE_Int hypre_StructAssumedPartitionGetProcsFromBox ( hypre_StructAssumedPart *assumed_part , hypre_Box *box , HYPRE_Int *num_proc_array , HYPRE_Int *size_alloc_proc_array , HYPRE_Int **p_proc_array ); +HYPRE_Int hypre_APFillResponseStructAssumedPart ( void *p_recv_contact_buf, HYPRE_Int contact_size, + HYPRE_Int contact_proc, void *ro, MPI_Comm comm, void **p_send_response_buf, + HYPRE_Int *response_message_size ); +HYPRE_Int hypre_StructAssumedPartitionGetRegionsFromProc ( hypre_StructAssumedPart *assumed_part, + HYPRE_Int proc_id, hypre_BoxArray *assumed_regions ); +HYPRE_Int hypre_StructAssumedPartitionGetProcsFromBox ( hypre_StructAssumedPart *assumed_part, + hypre_Box *box, HYPRE_Int *num_proc_array, HYPRE_Int *size_alloc_proc_array, + HYPRE_Int **p_proc_array ); /* box_algebra.c */ -HYPRE_Int hypre_IntersectBoxes ( hypre_Box *box1 , hypre_Box *box2 , hypre_Box *ibox ); -HYPRE_Int hypre_SubtractBoxes ( hypre_Box *box1 , hypre_Box *box2 , hypre_BoxArray *box_array ); -HYPRE_Int hypre_SubtractBoxArrays ( hypre_BoxArray *box_array1 , hypre_BoxArray *box_array2 , hypre_BoxArray *tmp_box_array ); +HYPRE_Int hypre_IntersectBoxes ( hypre_Box *box1, hypre_Box *box2, hypre_Box *ibox ); +HYPRE_Int hypre_SubtractBoxes ( hypre_Box *box1, hypre_Box *box2, hypre_BoxArray *box_array ); +HYPRE_Int hypre_SubtractBoxArrays ( hypre_BoxArray *box_array1, hypre_BoxArray *box_array2, + hypre_BoxArray *tmp_box_array ); HYPRE_Int hypre_UnionBoxes ( hypre_BoxArray *boxes ); HYPRE_Int hypre_MinUnionBoxes ( hypre_BoxArray *boxes ); /* box_boundary.c */ -HYPRE_Int hypre_BoxBoundaryIntersect ( hypre_Box *box , hypre_StructGrid *grid , HYPRE_Int d , HYPRE_Int dir , hypre_BoxArray *boundary ); -HYPRE_Int hypre_BoxBoundaryG ( hypre_Box *box , hypre_StructGrid *g , hypre_BoxArray *boundary ); -HYPRE_Int hypre_BoxBoundaryDG ( hypre_Box *box , hypre_StructGrid *g , hypre_BoxArray *boundarym , hypre_BoxArray *boundaryp , HYPRE_Int d ); -HYPRE_Int hypre_GeneralBoxBoundaryIntersect( hypre_Box *box, hypre_StructGrid *grid, hypre_Index stencil_element, hypre_BoxArray *boundary ); +HYPRE_Int hypre_BoxBoundaryIntersect ( hypre_Box *box, hypre_StructGrid *grid, HYPRE_Int d, + HYPRE_Int dir, hypre_BoxArray *boundary ); +HYPRE_Int hypre_BoxBoundaryG ( hypre_Box *box, hypre_StructGrid *g, hypre_BoxArray *boundary ); +HYPRE_Int hypre_BoxBoundaryDG ( hypre_Box *box, hypre_StructGrid *g, hypre_BoxArray *boundarym, + hypre_BoxArray *boundaryp, HYPRE_Int d ); +HYPRE_Int hypre_GeneralBoxBoundaryIntersect( hypre_Box *box, hypre_StructGrid *grid, + hypre_Index stencil_element, hypre_BoxArray *boundary ); /* box.c */ -HYPRE_Int hypre_SetIndex ( hypre_Index index , HYPRE_Int val ); -HYPRE_Int hypre_CopyIndex( hypre_Index in_index , hypre_Index out_index ); -HYPRE_Int hypre_CopyToCleanIndex( hypre_Index in_index , HYPRE_Int ndim , hypre_Index out_index ); -HYPRE_Int hypre_IndexEqual ( hypre_Index index , HYPRE_Int val , HYPRE_Int ndim ); -HYPRE_Int hypre_IndexMin( hypre_Index index , HYPRE_Int ndim ); -HYPRE_Int hypre_IndexMax( hypre_Index index , HYPRE_Int ndim ); -HYPRE_Int hypre_AddIndexes ( hypre_Index index1 , hypre_Index index2 , HYPRE_Int ndim , hypre_Index result ); -HYPRE_Int hypre_SubtractIndexes ( hypre_Index index1 , hypre_Index index2 , HYPRE_Int ndim , hypre_Index result ); -HYPRE_Int hypre_IndexesEqual ( hypre_Index index1 , hypre_Index index2 , HYPRE_Int ndim ); +HYPRE_Int hypre_SetIndex ( hypre_Index index, HYPRE_Int val ); +HYPRE_Int hypre_CopyIndex( hypre_Index in_index, hypre_Index out_index ); +HYPRE_Int hypre_CopyToCleanIndex( hypre_Index in_index, HYPRE_Int ndim, hypre_Index out_index ); +HYPRE_Int hypre_IndexEqual ( hypre_Index index, HYPRE_Int val, HYPRE_Int ndim ); +HYPRE_Int hypre_IndexMin( hypre_Index index, HYPRE_Int ndim ); +HYPRE_Int hypre_IndexMax( hypre_Index index, HYPRE_Int ndim ); +HYPRE_Int hypre_AddIndexes ( hypre_Index index1, hypre_Index index2, HYPRE_Int ndim, + hypre_Index result ); +HYPRE_Int hypre_SubtractIndexes ( hypre_Index index1, hypre_Index index2, HYPRE_Int ndim, + hypre_Index result ); +HYPRE_Int hypre_IndexesEqual ( hypre_Index index1, hypre_Index index2, HYPRE_Int ndim ); +HYPRE_Int hypre_IndexPrint ( FILE *file, HYPRE_Int ndim, hypre_Index index ); +HYPRE_Int hypre_IndexRead ( FILE *file, HYPRE_Int ndim, hypre_Index index ); hypre_Box *hypre_BoxCreate ( HYPRE_Int ndim ); HYPRE_Int hypre_BoxDestroy ( hypre_Box *box ); -HYPRE_Int hypre_BoxInit( hypre_Box *box , HYPRE_Int ndim ); -HYPRE_Int hypre_BoxSetExtents ( hypre_Box *box , hypre_Index imin , hypre_Index imax ); -HYPRE_Int hypre_CopyBox( hypre_Box *box1 , hypre_Box *box2 ); +HYPRE_Int hypre_BoxInit( hypre_Box *box, HYPRE_Int ndim ); +HYPRE_Int hypre_BoxSetExtents ( hypre_Box *box, hypre_Index imin, hypre_Index imax ); +HYPRE_Int hypre_CopyBox( hypre_Box *box1, hypre_Box *box2 ); hypre_Box *hypre_BoxDuplicate ( hypre_Box *box ); HYPRE_Int hypre_BoxVolume( hypre_Box *box ); HYPRE_Real hypre_doubleBoxVolume( hypre_Box *box ); -HYPRE_Int hypre_IndexInBox ( hypre_Index index , hypre_Box *box ); -HYPRE_Int hypre_BoxGetSize ( hypre_Box *box , hypre_Index size ); -HYPRE_Int hypre_BoxGetStrideSize ( hypre_Box *box , hypre_Index stride , hypre_Index size ); -HYPRE_Int hypre_BoxGetStrideVolume ( hypre_Box *box , hypre_Index stride , HYPRE_Int *volume_ptr ); -HYPRE_Int hypre_BoxIndexRank( hypre_Box *box , hypre_Index index ); -HYPRE_Int hypre_BoxRankIndex( hypre_Box *box , HYPRE_Int rank , hypre_Index index ); -HYPRE_Int hypre_BoxOffsetDistance( hypre_Box *box , hypre_Index index ); -HYPRE_Int hypre_BoxShiftPos( hypre_Box *box , hypre_Index shift ); -HYPRE_Int hypre_BoxShiftNeg( hypre_Box *box , hypre_Index shift ); -HYPRE_Int hypre_BoxGrowByIndex( hypre_Box *box , hypre_Index index ); -HYPRE_Int hypre_BoxGrowByValue( hypre_Box *box , HYPRE_Int val ); -HYPRE_Int hypre_BoxGrowByArray ( hypre_Box *box , HYPRE_Int *array ); -hypre_BoxArray *hypre_BoxArrayCreate ( HYPRE_Int size , HYPRE_Int ndim ); +HYPRE_Int hypre_IndexInBox ( hypre_Index index, hypre_Box *box ); +HYPRE_Int hypre_BoxGetSize ( hypre_Box *box, hypre_Index size ); +HYPRE_Int hypre_BoxGetStrideSize ( hypre_Box *box, hypre_Index stride, hypre_Index size ); +HYPRE_Int hypre_BoxGetStrideVolume ( hypre_Box *box, hypre_Index stride, HYPRE_Int *volume_ptr ); +HYPRE_Int hypre_BoxIndexRank( hypre_Box *box, hypre_Index index ); +HYPRE_Int hypre_BoxRankIndex( hypre_Box *box, HYPRE_Int rank, hypre_Index index ); +HYPRE_Int hypre_BoxOffsetDistance( hypre_Box *box, hypre_Index index ); +HYPRE_Int hypre_BoxShiftPos( hypre_Box *box, hypre_Index shift ); +HYPRE_Int hypre_BoxShiftNeg( hypre_Box *box, hypre_Index shift ); +HYPRE_Int hypre_BoxGrowByIndex( hypre_Box *box, hypre_Index index ); +HYPRE_Int hypre_BoxGrowByValue( hypre_Box *box, HYPRE_Int val ); +HYPRE_Int hypre_BoxGrowByArray ( hypre_Box *box, HYPRE_Int *array ); +HYPRE_Int hypre_BoxPrint ( FILE *file, hypre_Box *box ); +HYPRE_Int hypre_BoxRead ( FILE *file, HYPRE_Int ndim, hypre_Box **box_ptr ); +hypre_BoxArray *hypre_BoxArrayCreate ( HYPRE_Int size, HYPRE_Int ndim ); HYPRE_Int hypre_BoxArrayDestroy ( hypre_BoxArray *box_array ); -HYPRE_Int hypre_BoxArraySetSize ( hypre_BoxArray *box_array , HYPRE_Int size ); +HYPRE_Int hypre_BoxArraySetSize ( hypre_BoxArray *box_array, HYPRE_Int size ); hypre_BoxArray *hypre_BoxArrayDuplicate ( hypre_BoxArray *box_array ); -HYPRE_Int hypre_AppendBox ( hypre_Box *box , hypre_BoxArray *box_array ); -HYPRE_Int hypre_DeleteBox ( hypre_BoxArray *box_array , HYPRE_Int index ); -HYPRE_Int hypre_DeleteMultipleBoxes ( hypre_BoxArray *box_array , HYPRE_Int *indices , HYPRE_Int num ); -HYPRE_Int hypre_AppendBoxArray ( hypre_BoxArray *box_array_0 , hypre_BoxArray *box_array_1 ); -hypre_BoxArrayArray *hypre_BoxArrayArrayCreate ( HYPRE_Int size , HYPRE_Int ndim ); +HYPRE_Int hypre_AppendBox ( hypre_Box *box, hypre_BoxArray *box_array ); +HYPRE_Int hypre_DeleteBox ( hypre_BoxArray *box_array, HYPRE_Int index ); +HYPRE_Int hypre_DeleteMultipleBoxes ( hypre_BoxArray *box_array, HYPRE_Int *indices, + HYPRE_Int num ); +HYPRE_Int hypre_AppendBoxArray ( hypre_BoxArray *box_array_0, hypre_BoxArray *box_array_1 ); +hypre_BoxArrayArray *hypre_BoxArrayArrayCreate ( HYPRE_Int size, HYPRE_Int ndim ); HYPRE_Int hypre_BoxArrayArrayDestroy ( hypre_BoxArrayArray *box_array_array ); hypre_BoxArrayArray *hypre_BoxArrayArrayDuplicate ( hypre_BoxArrayArray *box_array_array ); /* box_manager.c */ -HYPRE_Int hypre_BoxManEntryGetInfo ( hypre_BoxManEntry *entry , void **info_ptr ); -HYPRE_Int hypre_BoxManEntryGetExtents ( hypre_BoxManEntry *entry , hypre_Index imin , hypre_Index imax ); -HYPRE_Int hypre_BoxManEntryCopy ( hypre_BoxManEntry *fromentry , hypre_BoxManEntry *toentry ); -HYPRE_Int hypre_BoxManSetAllGlobalKnown ( hypre_BoxManager *manager , HYPRE_Int known ); -HYPRE_Int hypre_BoxManGetAllGlobalKnown ( hypre_BoxManager *manager , HYPRE_Int *known ); -HYPRE_Int hypre_BoxManSetIsEntriesSort ( hypre_BoxManager *manager , HYPRE_Int is_sort ); -HYPRE_Int hypre_BoxManGetIsEntriesSort ( hypre_BoxManager *manager , HYPRE_Int *is_sort ); -HYPRE_Int hypre_BoxManGetGlobalIsGatherCalled ( hypre_BoxManager *manager , MPI_Comm comm , HYPRE_Int *is_gather ); -HYPRE_Int hypre_BoxManGetAssumedPartition ( hypre_BoxManager *manager , hypre_StructAssumedPart **assumed_partition ); -HYPRE_Int hypre_BoxManSetAssumedPartition ( hypre_BoxManager *manager , hypre_StructAssumedPart *assumed_partition ); -HYPRE_Int hypre_BoxManSetBoundingBox ( hypre_BoxManager *manager , hypre_Box *bounding_box ); -HYPRE_Int hypre_BoxManSetNumGhost ( hypre_BoxManager *manager , HYPRE_Int *num_ghost ); -HYPRE_Int hypre_BoxManDeleteMultipleEntriesAndInfo ( hypre_BoxManager *manager , HYPRE_Int *indices , HYPRE_Int num ); -HYPRE_Int hypre_BoxManCreate ( HYPRE_Int max_nentries , HYPRE_Int info_size , HYPRE_Int dim , hypre_Box *bounding_box , MPI_Comm comm , hypre_BoxManager **manager_ptr ); -HYPRE_Int hypre_BoxManIncSize ( hypre_BoxManager *manager , HYPRE_Int inc_size ); +HYPRE_Int hypre_BoxManEntryGetInfo ( hypre_BoxManEntry *entry, void **info_ptr ); +HYPRE_Int hypre_BoxManEntryGetExtents ( hypre_BoxManEntry *entry, hypre_Index imin, + hypre_Index imax ); +HYPRE_Int hypre_BoxManEntryCopy ( hypre_BoxManEntry *fromentry, hypre_BoxManEntry *toentry ); +HYPRE_Int hypre_BoxManSetAllGlobalKnown ( hypre_BoxManager *manager, HYPRE_Int known ); +HYPRE_Int hypre_BoxManGetAllGlobalKnown ( hypre_BoxManager *manager, HYPRE_Int *known ); +HYPRE_Int hypre_BoxManSetIsEntriesSort ( hypre_BoxManager *manager, HYPRE_Int is_sort ); +HYPRE_Int hypre_BoxManGetIsEntriesSort ( hypre_BoxManager *manager, HYPRE_Int *is_sort ); +HYPRE_Int hypre_BoxManGetGlobalIsGatherCalled ( hypre_BoxManager *manager, MPI_Comm comm, + HYPRE_Int *is_gather ); +HYPRE_Int hypre_BoxManGetAssumedPartition ( hypre_BoxManager *manager, + hypre_StructAssumedPart **assumed_partition ); +HYPRE_Int hypre_BoxManSetAssumedPartition ( hypre_BoxManager *manager, + hypre_StructAssumedPart *assumed_partition ); +HYPRE_Int hypre_BoxManSetBoundingBox ( hypre_BoxManager *manager, hypre_Box *bounding_box ); +HYPRE_Int hypre_BoxManSetNumGhost ( hypre_BoxManager *manager, HYPRE_Int *num_ghost ); +HYPRE_Int hypre_BoxManDeleteMultipleEntriesAndInfo ( hypre_BoxManager *manager, HYPRE_Int *indices, + HYPRE_Int num ); +HYPRE_Int hypre_BoxManCreate ( HYPRE_Int max_nentries, HYPRE_Int info_size, HYPRE_Int dim, + hypre_Box *bounding_box, MPI_Comm comm, hypre_BoxManager **manager_ptr ); +HYPRE_Int hypre_BoxManIncSize ( hypre_BoxManager *manager, HYPRE_Int inc_size ); HYPRE_Int hypre_BoxManDestroy ( hypre_BoxManager *manager ); -HYPRE_Int hypre_BoxManAddEntry ( hypre_BoxManager *manager , hypre_Index imin , hypre_Index imax , HYPRE_Int proc_id , HYPRE_Int box_id , void *info ); -HYPRE_Int hypre_BoxManGetEntry ( hypre_BoxManager *manager , HYPRE_Int proc , HYPRE_Int id , hypre_BoxManEntry **entry_ptr ); -HYPRE_Int hypre_BoxManGetAllEntries ( hypre_BoxManager *manager , HYPRE_Int *num_entries , hypre_BoxManEntry **entries ); -HYPRE_Int hypre_BoxManGetAllEntriesBoxes ( hypre_BoxManager *manager , hypre_BoxArray *boxes ); -HYPRE_Int hypre_BoxManGetLocalEntriesBoxes ( hypre_BoxManager *manager , hypre_BoxArray *boxes ); -HYPRE_Int hypre_BoxManGetAllEntriesBoxesProc ( hypre_BoxManager *manager , hypre_BoxArray *boxes , HYPRE_Int **procs_ptr ); -HYPRE_Int hypre_BoxManGatherEntries ( hypre_BoxManager *manager , hypre_Index imin , hypre_Index imax ); +HYPRE_Int hypre_BoxManAddEntry ( hypre_BoxManager *manager, hypre_Index imin, hypre_Index imax, + HYPRE_Int proc_id, HYPRE_Int box_id, void *info ); +HYPRE_Int hypre_BoxManGetEntry ( hypre_BoxManager *manager, HYPRE_Int proc, HYPRE_Int id, + hypre_BoxManEntry **entry_ptr ); +HYPRE_Int hypre_BoxManGetAllEntries ( hypre_BoxManager *manager, HYPRE_Int *num_entries, + hypre_BoxManEntry **entries ); +HYPRE_Int hypre_BoxManGetAllEntriesBoxes ( hypre_BoxManager *manager, hypre_BoxArray *boxes ); +HYPRE_Int hypre_BoxManGetLocalEntriesBoxes ( hypre_BoxManager *manager, hypre_BoxArray *boxes ); +HYPRE_Int hypre_BoxManGetAllEntriesBoxesProc ( hypre_BoxManager *manager, hypre_BoxArray *boxes, + HYPRE_Int **procs_ptr ); +HYPRE_Int hypre_BoxManGatherEntries ( hypre_BoxManager *manager, hypre_Index imin, + hypre_Index imax ); HYPRE_Int hypre_BoxManAssemble ( hypre_BoxManager *manager ); -HYPRE_Int hypre_BoxManIntersect ( hypre_BoxManager *manager , hypre_Index ilower , hypre_Index iupper , hypre_BoxManEntry ***entries_ptr , HYPRE_Int *nentries_ptr ); -HYPRE_Int hypre_FillResponseBoxManAssemble1 ( void *p_recv_contact_buf , HYPRE_Int contact_size , HYPRE_Int contact_proc , void *ro , MPI_Comm comm , void **p_send_response_buf , HYPRE_Int *response_message_size ); -HYPRE_Int hypre_FillResponseBoxManAssemble2 ( void *p_recv_contact_buf , HYPRE_Int contact_size , HYPRE_Int contact_proc , void *ro , MPI_Comm comm , void **p_send_response_buf , HYPRE_Int *response_message_size ); +HYPRE_Int hypre_BoxManIntersect ( hypre_BoxManager *manager, hypre_Index ilower, hypre_Index iupper, + hypre_BoxManEntry ***entries_ptr, HYPRE_Int *nentries_ptr ); +HYPRE_Int hypre_FillResponseBoxManAssemble1 ( void *p_recv_contact_buf, HYPRE_Int contact_size, + HYPRE_Int contact_proc, void *ro, MPI_Comm comm, void **p_send_response_buf, + HYPRE_Int *response_message_size ); +HYPRE_Int hypre_FillResponseBoxManAssemble2 ( void *p_recv_contact_buf, HYPRE_Int contact_size, + HYPRE_Int contact_proc, void *ro, MPI_Comm comm, void **p_send_response_buf, + HYPRE_Int *response_message_size ); /* communication_info.c */ -HYPRE_Int hypre_CommInfoCreate ( hypre_BoxArrayArray *send_boxes , hypre_BoxArrayArray *recv_boxes , HYPRE_Int **send_procs , HYPRE_Int **recv_procs , HYPRE_Int **send_rboxnums , HYPRE_Int **recv_rboxnums , hypre_BoxArrayArray *send_rboxes , hypre_BoxArrayArray *recv_rboxes , HYPRE_Int boxes_match , hypre_CommInfo **comm_info_ptr ); -HYPRE_Int hypre_CommInfoSetTransforms ( hypre_CommInfo *comm_info , HYPRE_Int num_transforms , hypre_Index *coords , hypre_Index *dirs , HYPRE_Int **send_transforms , HYPRE_Int **recv_transforms ); -HYPRE_Int hypre_CommInfoGetTransforms ( hypre_CommInfo *comm_info , HYPRE_Int *num_transforms , hypre_Index **coords , hypre_Index **dirs ); -HYPRE_Int hypre_CommInfoProjectSend ( hypre_CommInfo *comm_info , hypre_Index index , hypre_Index stride ); -HYPRE_Int hypre_CommInfoProjectRecv ( hypre_CommInfo *comm_info , hypre_Index index , hypre_Index stride ); +HYPRE_Int hypre_CommInfoCreate ( hypre_BoxArrayArray *send_boxes, hypre_BoxArrayArray *recv_boxes, + HYPRE_Int **send_procs, HYPRE_Int **recv_procs, HYPRE_Int **send_rboxnums, + HYPRE_Int **recv_rboxnums, hypre_BoxArrayArray *send_rboxes, hypre_BoxArrayArray *recv_rboxes, + HYPRE_Int boxes_match, hypre_CommInfo **comm_info_ptr ); +HYPRE_Int hypre_CommInfoSetTransforms ( hypre_CommInfo *comm_info, HYPRE_Int num_transforms, + hypre_Index *coords, hypre_Index *dirs, HYPRE_Int **send_transforms, HYPRE_Int **recv_transforms ); +HYPRE_Int hypre_CommInfoGetTransforms ( hypre_CommInfo *comm_info, HYPRE_Int *num_transforms, + hypre_Index **coords, hypre_Index **dirs ); +HYPRE_Int hypre_CommInfoProjectSend ( hypre_CommInfo *comm_info, hypre_Index index, + hypre_Index stride ); +HYPRE_Int hypre_CommInfoProjectRecv ( hypre_CommInfo *comm_info, hypre_Index index, + hypre_Index stride ); HYPRE_Int hypre_CommInfoDestroy ( hypre_CommInfo *comm_info ); -HYPRE_Int hypre_CreateCommInfoFromStencil ( hypre_StructGrid *grid , hypre_StructStencil *stencil , hypre_CommInfo **comm_info_ptr ); -HYPRE_Int hypre_CreateCommInfoFromNumGhost ( hypre_StructGrid *grid , HYPRE_Int *num_ghost , hypre_CommInfo **comm_info_ptr ); -HYPRE_Int hypre_CreateCommInfoFromGrids ( hypre_StructGrid *from_grid , hypre_StructGrid *to_grid , hypre_CommInfo **comm_info_ptr ); +HYPRE_Int hypre_CreateCommInfoFromStencil ( hypre_StructGrid *grid, hypre_StructStencil *stencil, + hypre_CommInfo **comm_info_ptr ); +HYPRE_Int hypre_CreateCommInfoFromNumGhost ( hypre_StructGrid *grid, HYPRE_Int *num_ghost, + hypre_CommInfo **comm_info_ptr ); +HYPRE_Int hypre_CreateCommInfoFromGrids ( hypre_StructGrid *from_grid, hypre_StructGrid *to_grid, + hypre_CommInfo **comm_info_ptr ); /* computation.c */ -HYPRE_Int hypre_ComputeInfoCreate ( hypre_CommInfo *comm_info , hypre_BoxArrayArray *indt_boxes , hypre_BoxArrayArray *dept_boxes , hypre_ComputeInfo **compute_info_ptr ); -HYPRE_Int hypre_ComputeInfoProjectSend ( hypre_ComputeInfo *compute_info , hypre_Index index , hypre_Index stride ); -HYPRE_Int hypre_ComputeInfoProjectRecv ( hypre_ComputeInfo *compute_info , hypre_Index index , hypre_Index stride ); -HYPRE_Int hypre_ComputeInfoProjectComp ( hypre_ComputeInfo *compute_info , hypre_Index index , hypre_Index stride ); +HYPRE_Int hypre_ComputeInfoCreate ( hypre_CommInfo *comm_info, hypre_BoxArrayArray *indt_boxes, + hypre_BoxArrayArray *dept_boxes, hypre_ComputeInfo **compute_info_ptr ); +HYPRE_Int hypre_ComputeInfoProjectSend ( hypre_ComputeInfo *compute_info, hypre_Index index, + hypre_Index stride ); +HYPRE_Int hypre_ComputeInfoProjectRecv ( hypre_ComputeInfo *compute_info, hypre_Index index, + hypre_Index stride ); +HYPRE_Int hypre_ComputeInfoProjectComp ( hypre_ComputeInfo *compute_info, hypre_Index index, + hypre_Index stride ); HYPRE_Int hypre_ComputeInfoDestroy ( hypre_ComputeInfo *compute_info ); -HYPRE_Int hypre_CreateComputeInfo ( hypre_StructGrid *grid , hypre_StructStencil *stencil , hypre_ComputeInfo **compute_info_ptr ); -HYPRE_Int hypre_ComputePkgCreate ( hypre_ComputeInfo *compute_info , hypre_BoxArray *data_space , HYPRE_Int num_values , hypre_StructGrid *grid , hypre_ComputePkg **compute_pkg_ptr ); +HYPRE_Int hypre_CreateComputeInfo ( hypre_StructGrid *grid, hypre_StructStencil *stencil, + hypre_ComputeInfo **compute_info_ptr ); +HYPRE_Int hypre_ComputePkgCreate ( hypre_ComputeInfo *compute_info, hypre_BoxArray *data_space, + HYPRE_Int num_values, hypre_StructGrid *grid, hypre_ComputePkg **compute_pkg_ptr ); HYPRE_Int hypre_ComputePkgDestroy ( hypre_ComputePkg *compute_pkg ); -HYPRE_Int hypre_InitializeIndtComputations ( hypre_ComputePkg *compute_pkg , HYPRE_Complex *data , hypre_CommHandle **comm_handle_ptr ); +HYPRE_Int hypre_InitializeIndtComputations ( hypre_ComputePkg *compute_pkg, HYPRE_Complex *data, + hypre_CommHandle **comm_handle_ptr ); HYPRE_Int hypre_FinalizeIndtComputations ( hypre_CommHandle *comm_handle ); /* HYPRE_struct_grid.c */ -HYPRE_Int HYPRE_StructGridCreate ( MPI_Comm comm , HYPRE_Int dim , HYPRE_StructGrid *grid ); +HYPRE_Int HYPRE_StructGridCreate ( MPI_Comm comm, HYPRE_Int dim, HYPRE_StructGrid *grid ); HYPRE_Int HYPRE_StructGridDestroy ( HYPRE_StructGrid grid ); -HYPRE_Int HYPRE_StructGridSetExtents ( HYPRE_StructGrid grid , HYPRE_Int *ilower , HYPRE_Int *iupper ); -HYPRE_Int HYPRE_StructGridSetPeriodic ( HYPRE_StructGrid grid , HYPRE_Int *periodic ); +HYPRE_Int HYPRE_StructGridSetExtents ( HYPRE_StructGrid grid, HYPRE_Int *ilower, + HYPRE_Int *iupper ); +HYPRE_Int HYPRE_StructGridSetPeriodic ( HYPRE_StructGrid grid, HYPRE_Int *periodic ); HYPRE_Int HYPRE_StructGridAssemble ( HYPRE_StructGrid grid ); -HYPRE_Int HYPRE_StructGridSetNumGhost ( HYPRE_StructGrid grid , HYPRE_Int *num_ghost ); +HYPRE_Int HYPRE_StructGridSetNumGhost ( HYPRE_StructGrid grid, HYPRE_Int *num_ghost ); /* HYPRE_struct_matrix.c */ -HYPRE_Int HYPRE_StructMatrixCreate ( MPI_Comm comm , HYPRE_StructGrid grid , HYPRE_StructStencil stencil , HYPRE_StructMatrix *matrix ); +HYPRE_Int HYPRE_StructMatrixCreate ( MPI_Comm comm, HYPRE_StructGrid grid, + HYPRE_StructStencil stencil, HYPRE_StructMatrix *matrix ); HYPRE_Int HYPRE_StructMatrixDestroy ( HYPRE_StructMatrix matrix ); HYPRE_Int HYPRE_StructMatrixInitialize ( HYPRE_StructMatrix matrix ); -HYPRE_Int HYPRE_StructMatrixSetValues ( HYPRE_StructMatrix matrix , HYPRE_Int *grid_index , HYPRE_Int num_stencil_indices , HYPRE_Int *stencil_indices , HYPRE_Complex *values ); -HYPRE_Int HYPRE_StructMatrixGetValues ( HYPRE_StructMatrix matrix , HYPRE_Int *grid_index , HYPRE_Int num_stencil_indices , HYPRE_Int *stencil_indices , HYPRE_Complex *values ); -HYPRE_Int HYPRE_StructMatrixSetBoxValues ( HYPRE_StructMatrix matrix , HYPRE_Int *ilower , HYPRE_Int *iupper , HYPRE_Int num_stencil_indices , HYPRE_Int *stencil_indices , HYPRE_Complex *values ); -HYPRE_Int HYPRE_StructMatrixGetBoxValues ( HYPRE_StructMatrix matrix , HYPRE_Int *ilower , HYPRE_Int *iupper , HYPRE_Int num_stencil_indices , HYPRE_Int *stencil_indices , HYPRE_Complex *values ); -HYPRE_Int HYPRE_StructMatrixSetConstantValues ( HYPRE_StructMatrix matrix , HYPRE_Int num_stencil_indices , HYPRE_Int *stencil_indices , HYPRE_Complex *values ); -HYPRE_Int HYPRE_StructMatrixAddToValues ( HYPRE_StructMatrix matrix , HYPRE_Int *grid_index , HYPRE_Int num_stencil_indices , HYPRE_Int *stencil_indices , HYPRE_Complex *values ); -HYPRE_Int HYPRE_StructMatrixAddToBoxValues ( HYPRE_StructMatrix matrix , HYPRE_Int *ilower , HYPRE_Int *iupper , HYPRE_Int num_stencil_indices , HYPRE_Int *stencil_indices , HYPRE_Complex *values ); -HYPRE_Int HYPRE_StructMatrixAddToConstantValues ( HYPRE_StructMatrix matrix , HYPRE_Int num_stencil_indices , HYPRE_Int *stencil_indices , HYPRE_Complex *values ); +HYPRE_Int HYPRE_StructMatrixSetValues ( HYPRE_StructMatrix matrix, HYPRE_Int *grid_index, + HYPRE_Int num_stencil_indices, HYPRE_Int *stencil_indices, HYPRE_Complex *values ); +HYPRE_Int HYPRE_StructMatrixGetValues ( HYPRE_StructMatrix matrix, HYPRE_Int *grid_index, + HYPRE_Int num_stencil_indices, HYPRE_Int *stencil_indices, HYPRE_Complex *values ); +HYPRE_Int HYPRE_StructMatrixSetBoxValues ( HYPRE_StructMatrix matrix, HYPRE_Int *ilower, + HYPRE_Int *iupper, HYPRE_Int num_stencil_indices, HYPRE_Int *stencil_indices, + HYPRE_Complex *values ); +HYPRE_Int HYPRE_StructMatrixGetBoxValues ( HYPRE_StructMatrix matrix, HYPRE_Int *ilower, + HYPRE_Int *iupper, HYPRE_Int num_stencil_indices, HYPRE_Int *stencil_indices, + HYPRE_Complex *values ); +HYPRE_Int HYPRE_StructMatrixSetConstantValues ( HYPRE_StructMatrix matrix, + HYPRE_Int num_stencil_indices, HYPRE_Int *stencil_indices, HYPRE_Complex *values ); +HYPRE_Int HYPRE_StructMatrixAddToValues ( HYPRE_StructMatrix matrix, HYPRE_Int *grid_index, + HYPRE_Int num_stencil_indices, HYPRE_Int *stencil_indices, HYPRE_Complex *values ); +HYPRE_Int HYPRE_StructMatrixAddToBoxValues ( HYPRE_StructMatrix matrix, HYPRE_Int *ilower, + HYPRE_Int *iupper, HYPRE_Int num_stencil_indices, HYPRE_Int *stencil_indices, + HYPRE_Complex *values ); +HYPRE_Int HYPRE_StructMatrixAddToConstantValues ( HYPRE_StructMatrix matrix, + HYPRE_Int num_stencil_indices, HYPRE_Int *stencil_indices, HYPRE_Complex *values ); HYPRE_Int HYPRE_StructMatrixAssemble ( HYPRE_StructMatrix matrix ); -HYPRE_Int HYPRE_StructMatrixSetNumGhost ( HYPRE_StructMatrix matrix , HYPRE_Int *num_ghost ); -HYPRE_Int HYPRE_StructMatrixGetGrid ( HYPRE_StructMatrix matrix , HYPRE_StructGrid *grid ); -HYPRE_Int HYPRE_StructMatrixSetSymmetric ( HYPRE_StructMatrix matrix , HYPRE_Int symmetric ); -HYPRE_Int HYPRE_StructMatrixSetConstantEntries ( HYPRE_StructMatrix matrix , HYPRE_Int nentries , HYPRE_Int *entries ); -HYPRE_Int HYPRE_StructMatrixPrint ( const char *filename , HYPRE_StructMatrix matrix , HYPRE_Int all ); -HYPRE_Int HYPRE_StructMatrixMatvec ( HYPRE_Complex alpha , HYPRE_StructMatrix A , HYPRE_StructVector x , HYPRE_Complex beta , HYPRE_StructVector y ); +HYPRE_Int HYPRE_StructMatrixSetNumGhost ( HYPRE_StructMatrix matrix, HYPRE_Int *num_ghost ); +HYPRE_Int HYPRE_StructMatrixGetGrid ( HYPRE_StructMatrix matrix, HYPRE_StructGrid *grid ); +HYPRE_Int HYPRE_StructMatrixSetSymmetric ( HYPRE_StructMatrix matrix, HYPRE_Int symmetric ); +HYPRE_Int HYPRE_StructMatrixSetConstantEntries ( HYPRE_StructMatrix matrix, HYPRE_Int nentries, + HYPRE_Int *entries ); +HYPRE_Int HYPRE_StructMatrixPrint ( const char *filename, HYPRE_StructMatrix matrix, + HYPRE_Int all ); +HYPRE_Int HYPRE_StructMatrixMatvec ( HYPRE_Complex alpha, HYPRE_StructMatrix A, + HYPRE_StructVector x, HYPRE_Complex beta, HYPRE_StructVector y ); HYPRE_Int HYPRE_StructMatrixClearBoundary( HYPRE_StructMatrix matrix ); /* HYPRE_struct_stencil.c */ -HYPRE_Int HYPRE_StructStencilCreate ( HYPRE_Int dim , HYPRE_Int size , HYPRE_StructStencil *stencil ); -HYPRE_Int HYPRE_StructStencilSetElement ( HYPRE_StructStencil stencil , HYPRE_Int element_index , HYPRE_Int *offset ); +HYPRE_Int HYPRE_StructStencilCreate ( HYPRE_Int dim, HYPRE_Int size, HYPRE_StructStencil *stencil ); +HYPRE_Int HYPRE_StructStencilSetElement ( HYPRE_StructStencil stencil, HYPRE_Int element_index, + HYPRE_Int *offset ); HYPRE_Int HYPRE_StructStencilDestroy ( HYPRE_StructStencil stencil ); /* HYPRE_struct_vector.c */ -HYPRE_Int HYPRE_StructVectorCreate ( MPI_Comm comm , HYPRE_StructGrid grid , HYPRE_StructVector *vector ); +HYPRE_Int HYPRE_StructVectorCreate ( MPI_Comm comm, HYPRE_StructGrid grid, + HYPRE_StructVector *vector ); HYPRE_Int HYPRE_StructVectorDestroy ( HYPRE_StructVector struct_vector ); HYPRE_Int HYPRE_StructVectorInitialize ( HYPRE_StructVector vector ); -HYPRE_Int HYPRE_StructVectorSetValues ( HYPRE_StructVector vector , HYPRE_Int *grid_index , HYPRE_Complex values ); -HYPRE_Int HYPRE_StructVectorSetBoxValues ( HYPRE_StructVector vector , HYPRE_Int *ilower , HYPRE_Int *iupper , HYPRE_Complex *values ); -HYPRE_Int HYPRE_StructVectorAddToValues ( HYPRE_StructVector vector , HYPRE_Int *grid_index , HYPRE_Complex values ); -HYPRE_Int HYPRE_StructVectorAddToBoxValues ( HYPRE_StructVector vector , HYPRE_Int *ilower , HYPRE_Int *iupper , HYPRE_Complex *values ); -HYPRE_Int HYPRE_StructVectorScaleValues ( HYPRE_StructVector vector , HYPRE_Complex factor ); -HYPRE_Int HYPRE_StructVectorGetValues ( HYPRE_StructVector vector , HYPRE_Int *grid_index , HYPRE_Complex *values ); -HYPRE_Int HYPRE_StructVectorGetBoxValues ( HYPRE_StructVector vector , HYPRE_Int *ilower , HYPRE_Int *iupper , HYPRE_Complex *values ); +HYPRE_Int HYPRE_StructVectorSetValues ( HYPRE_StructVector vector, HYPRE_Int *grid_index, + HYPRE_Complex values ); +HYPRE_Int HYPRE_StructVectorSetBoxValues ( HYPRE_StructVector vector, HYPRE_Int *ilower, + HYPRE_Int *iupper, HYPRE_Complex *values ); +HYPRE_Int HYPRE_StructVectorAddToValues ( HYPRE_StructVector vector, HYPRE_Int *grid_index, + HYPRE_Complex values ); +HYPRE_Int HYPRE_StructVectorAddToBoxValues ( HYPRE_StructVector vector, HYPRE_Int *ilower, + HYPRE_Int *iupper, HYPRE_Complex *values ); +HYPRE_Int HYPRE_StructVectorScaleValues ( HYPRE_StructVector vector, HYPRE_Complex factor ); +HYPRE_Int HYPRE_StructVectorGetValues ( HYPRE_StructVector vector, HYPRE_Int *grid_index, + HYPRE_Complex *values ); +HYPRE_Int HYPRE_StructVectorGetBoxValues ( HYPRE_StructVector vector, HYPRE_Int *ilower, + HYPRE_Int *iupper, HYPRE_Complex *values ); HYPRE_Int HYPRE_StructVectorAssemble ( HYPRE_StructVector vector ); -HYPRE_Int HYPRE_StructVectorPrint ( const char *filename , HYPRE_StructVector vector , HYPRE_Int all ); -HYPRE_Int HYPRE_StructVectorSetNumGhost ( HYPRE_StructVector vector , HYPRE_Int *num_ghost ); -HYPRE_Int HYPRE_StructVectorCopy ( HYPRE_StructVector x , HYPRE_StructVector y ); -HYPRE_Int HYPRE_StructVectorSetConstantValues ( HYPRE_StructVector vector , HYPRE_Complex values ); -HYPRE_Int HYPRE_StructVectorGetMigrateCommPkg ( HYPRE_StructVector from_vector , HYPRE_StructVector to_vector , HYPRE_CommPkg *comm_pkg ); -HYPRE_Int HYPRE_StructVectorMigrate ( HYPRE_CommPkg comm_pkg , HYPRE_StructVector from_vector , HYPRE_StructVector to_vector ); +HYPRE_Int hypre_StructVectorPrintData ( FILE *file, hypre_StructVector *vector, HYPRE_Int all ); +HYPRE_Int hypre_StructVectorReadData ( FILE *file, hypre_StructVector *vector ); +HYPRE_Int HYPRE_StructVectorPrint ( const char *filename, HYPRE_StructVector vector, + HYPRE_Int all ); +HYPRE_Int HYPRE_StructVectorRead ( MPI_Comm comm, const char *filename, + HYPRE_Int *num_ghost, HYPRE_StructVector *vector ); +HYPRE_Int HYPRE_StructVectorSetNumGhost ( HYPRE_StructVector vector, HYPRE_Int *num_ghost ); +HYPRE_Int HYPRE_StructVectorCopy ( HYPRE_StructVector x, HYPRE_StructVector y ); +HYPRE_Int HYPRE_StructVectorSetConstantValues ( HYPRE_StructVector vector, HYPRE_Complex values ); +HYPRE_Int HYPRE_StructVectorGetMigrateCommPkg ( HYPRE_StructVector from_vector, + HYPRE_StructVector to_vector, HYPRE_CommPkg *comm_pkg ); +HYPRE_Int HYPRE_StructVectorMigrate ( HYPRE_CommPkg comm_pkg, HYPRE_StructVector from_vector, + HYPRE_StructVector to_vector ); HYPRE_Int HYPRE_CommPkgDestroy ( HYPRE_CommPkg comm_pkg ); /* project.c */ -HYPRE_Int hypre_ProjectBox ( hypre_Box *box , hypre_Index index , hypre_Index stride ); -HYPRE_Int hypre_ProjectBoxArray ( hypre_BoxArray *box_array , hypre_Index index , hypre_Index stride ); -HYPRE_Int hypre_ProjectBoxArrayArray ( hypre_BoxArrayArray *box_array_array , hypre_Index index , hypre_Index stride ); +HYPRE_Int hypre_ProjectBox ( hypre_Box *box, hypre_Index index, hypre_Index stride ); +HYPRE_Int hypre_ProjectBoxArray ( hypre_BoxArray *box_array, hypre_Index index, + hypre_Index stride ); +HYPRE_Int hypre_ProjectBoxArrayArray ( hypre_BoxArrayArray *box_array_array, hypre_Index index, + hypre_Index stride ); /* struct_axpy.c */ -HYPRE_Int hypre_StructAxpy ( HYPRE_Complex alpha , hypre_StructVector *x , hypre_StructVector *y ); +HYPRE_Int hypre_StructAxpy ( HYPRE_Complex alpha, hypre_StructVector *x, hypre_StructVector *y ); /* struct_communication.c */ -HYPRE_Int hypre_CommPkgCreate ( hypre_CommInfo *comm_info , hypre_BoxArray *send_data_space , hypre_BoxArray *recv_data_space , HYPRE_Int num_values , HYPRE_Int **orders , HYPRE_Int reverse , MPI_Comm comm , hypre_CommPkg **comm_pkg_ptr ); -HYPRE_Int hypre_CommTypeSetEntries ( hypre_CommType *comm_type , HYPRE_Int *boxnums , hypre_Box *boxes , hypre_Index stride , hypre_Index coord , hypre_Index dir , HYPRE_Int *order , hypre_BoxArray *data_space , HYPRE_Int *data_offsets ); -HYPRE_Int hypre_CommTypeSetEntry ( hypre_Box *box , hypre_Index stride , hypre_Index coord , hypre_Index dir , HYPRE_Int *order , hypre_Box *data_box , HYPRE_Int data_box_offset , hypre_CommEntryType *comm_entry ); -HYPRE_Int hypre_InitializeCommunication ( hypre_CommPkg *comm_pkg , HYPRE_Complex *send_data , HYPRE_Complex *recv_data , HYPRE_Int action , HYPRE_Int tag , hypre_CommHandle **comm_handle_ptr ); +HYPRE_Int hypre_CommPkgCreate ( hypre_CommInfo *comm_info, hypre_BoxArray *send_data_space, + hypre_BoxArray *recv_data_space, HYPRE_Int num_values, HYPRE_Int **orders, HYPRE_Int reverse, + MPI_Comm comm, hypre_CommPkg **comm_pkg_ptr ); +HYPRE_Int hypre_CommTypeSetEntries ( hypre_CommType *comm_type, HYPRE_Int *boxnums, + hypre_Box *boxes, hypre_Index stride, hypre_Index coord, hypre_Index dir, HYPRE_Int *order, + hypre_BoxArray *data_space, HYPRE_Int *data_offsets ); +HYPRE_Int hypre_CommTypeSetEntry ( hypre_Box *box, hypre_Index stride, hypre_Index coord, + hypre_Index dir, HYPRE_Int *order, hypre_Box *data_box, HYPRE_Int data_box_offset, + hypre_CommEntryType *comm_entry ); +HYPRE_Int hypre_InitializeCommunication ( hypre_CommPkg *comm_pkg, HYPRE_Complex *send_data, + HYPRE_Complex *recv_data, HYPRE_Int action, HYPRE_Int tag, hypre_CommHandle **comm_handle_ptr ); HYPRE_Int hypre_FinalizeCommunication ( hypre_CommHandle *comm_handle ); -HYPRE_Int hypre_ExchangeLocalData ( hypre_CommPkg *comm_pkg , HYPRE_Complex *send_data , HYPRE_Complex *recv_data , HYPRE_Int action ); +HYPRE_Int hypre_ExchangeLocalData ( hypre_CommPkg *comm_pkg, HYPRE_Complex *send_data, + HYPRE_Complex *recv_data, HYPRE_Int action ); HYPRE_Int hypre_CommPkgDestroy ( hypre_CommPkg *comm_pkg ); /* struct_copy.c */ -HYPRE_Int hypre_StructCopy ( hypre_StructVector *x , hypre_StructVector *y ); -HYPRE_Int hypre_StructPartialCopy ( hypre_StructVector *x , hypre_StructVector *y , hypre_BoxArrayArray *array_boxes ); +HYPRE_Int hypre_StructCopy ( hypre_StructVector *x, hypre_StructVector *y ); +HYPRE_Int hypre_StructPartialCopy ( hypre_StructVector *x, hypre_StructVector *y, + hypre_BoxArrayArray *array_boxes ); /* struct_grid.c */ -HYPRE_Int hypre_StructGridCreate ( MPI_Comm comm , HYPRE_Int dim , hypre_StructGrid **grid_ptr ); -HYPRE_Int hypre_StructGridRef ( hypre_StructGrid *grid , hypre_StructGrid **grid_ref ); +HYPRE_Int hypre_StructGridCreate ( MPI_Comm comm, HYPRE_Int dim, hypre_StructGrid **grid_ptr ); +HYPRE_Int hypre_StructGridRef ( hypre_StructGrid *grid, hypre_StructGrid **grid_ref ); HYPRE_Int hypre_StructGridDestroy ( hypre_StructGrid *grid ); -HYPRE_Int hypre_StructGridSetPeriodic ( hypre_StructGrid *grid , hypre_Index periodic ); -HYPRE_Int hypre_StructGridSetExtents ( hypre_StructGrid *grid , hypre_Index ilower , hypre_Index iupper ); -HYPRE_Int hypre_StructGridSetBoxes ( hypre_StructGrid *grid , hypre_BoxArray *boxes ); -HYPRE_Int hypre_StructGridSetBoundingBox ( hypre_StructGrid *grid , hypre_Box *new_bb ); -HYPRE_Int hypre_StructGridSetIDs ( hypre_StructGrid *grid , HYPRE_Int *ids ); -HYPRE_Int hypre_StructGridSetBoxManager ( hypre_StructGrid *grid , hypre_BoxManager *boxman ); -HYPRE_Int hypre_StructGridSetMaxDistance ( hypre_StructGrid *grid , hypre_Index dist ); +HYPRE_Int hypre_StructGridSetPeriodic ( hypre_StructGrid *grid, hypre_Index periodic ); +HYPRE_Int hypre_StructGridSetExtents ( hypre_StructGrid *grid, hypre_Index ilower, + hypre_Index iupper ); +HYPRE_Int hypre_StructGridSetBoxes ( hypre_StructGrid *grid, hypre_BoxArray *boxes ); +HYPRE_Int hypre_StructGridSetBoundingBox ( hypre_StructGrid *grid, hypre_Box *new_bb ); +HYPRE_Int hypre_StructGridSetIDs ( hypre_StructGrid *grid, HYPRE_Int *ids ); +HYPRE_Int hypre_StructGridSetBoxManager ( hypre_StructGrid *grid, hypre_BoxManager *boxman ); +HYPRE_Int hypre_StructGridSetMaxDistance ( hypre_StructGrid *grid, hypre_Index dist ); HYPRE_Int hypre_StructGridAssemble ( hypre_StructGrid *grid ); -HYPRE_Int hypre_GatherAllBoxes ( MPI_Comm comm , hypre_BoxArray *boxes , HYPRE_Int dim , hypre_BoxArray **all_boxes_ptr , HYPRE_Int **all_procs_ptr , HYPRE_Int *first_local_ptr ); -HYPRE_Int hypre_ComputeBoxnums ( hypre_BoxArray *boxes , HYPRE_Int *procs , HYPRE_Int **boxnums_ptr ); -HYPRE_Int hypre_StructGridPrint ( FILE *file , hypre_StructGrid *grid ); -HYPRE_Int hypre_StructGridRead ( MPI_Comm comm , FILE *file , hypre_StructGrid **grid_ptr ); -HYPRE_Int hypre_StructGridSetNumGhost ( hypre_StructGrid *grid , HYPRE_Int *num_ghost ); +HYPRE_Int hypre_GatherAllBoxes ( MPI_Comm comm, hypre_BoxArray *boxes, HYPRE_Int dim, + hypre_BoxArray **all_boxes_ptr, HYPRE_Int **all_procs_ptr, HYPRE_Int *first_local_ptr ); +HYPRE_Int hypre_ComputeBoxnums ( hypre_BoxArray *boxes, HYPRE_Int *procs, HYPRE_Int **boxnums_ptr ); +HYPRE_Int hypre_StructGridPrint ( FILE *file, hypre_StructGrid *grid ); +HYPRE_Int hypre_StructGridRead ( MPI_Comm comm, FILE *file, hypre_StructGrid **grid_ptr ); +HYPRE_Int hypre_StructGridSetNumGhost ( hypre_StructGrid *grid, HYPRE_Int *num_ghost ); +HYPRE_Int hypre_StructGridGetMaxBoxSize ( hypre_StructGrid *grid ); #if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) -HYPRE_Int hypre_StructGridGetMaxBoxSize(hypre_StructGrid *grid); -HYPRE_Int hypre_StructGridSetDataLocation( HYPRE_StructGrid grid, HYPRE_MemoryLocation data_location ); +HYPRE_Int hypre_StructGridSetDataLocation( HYPRE_StructGrid grid, + HYPRE_MemoryLocation data_location ); #endif /* struct_innerprod.c */ -HYPRE_Real hypre_StructInnerProd ( hypre_StructVector *x , hypre_StructVector *y ); +HYPRE_Real hypre_StructInnerProd ( hypre_StructVector *x, hypre_StructVector *y ); /* struct_io.c */ -HYPRE_Int hypre_PrintBoxArrayData ( FILE *file , hypre_BoxArray *box_array , hypre_BoxArray *data_space , HYPRE_Int num_values , HYPRE_Int dim , HYPRE_Complex *data ); -HYPRE_Int hypre_PrintCCVDBoxArrayData ( FILE *file , hypre_BoxArray *box_array , hypre_BoxArray *data_space , HYPRE_Int num_values , HYPRE_Int center_rank , HYPRE_Int stencil_size , HYPRE_Int *symm_elements , HYPRE_Int dim , HYPRE_Complex *data ); -HYPRE_Int hypre_PrintCCBoxArrayData ( FILE *file , hypre_BoxArray *box_array , hypre_BoxArray *data_space , HYPRE_Int num_values , HYPRE_Complex *data ); -HYPRE_Int hypre_ReadBoxArrayData ( FILE *file , hypre_BoxArray *box_array , hypre_BoxArray *data_space , HYPRE_Int num_values , HYPRE_Int dim , HYPRE_Complex *data ); -HYPRE_Int hypre_ReadBoxArrayData_CC ( FILE *file , hypre_BoxArray *box_array , hypre_BoxArray *data_space , HYPRE_Int stencil_size , HYPRE_Int real_stencil_size , HYPRE_Int constant_coefficient , HYPRE_Int dim , HYPRE_Complex *data ); +HYPRE_Int hypre_PrintBoxArrayData ( FILE *file, hypre_BoxArray *box_array, + hypre_BoxArray *data_space, HYPRE_Int num_values, HYPRE_Int dim, HYPRE_Complex *data ); +HYPRE_Int hypre_PrintCCVDBoxArrayData ( FILE *file, hypre_BoxArray *box_array, + hypre_BoxArray *data_space, HYPRE_Int num_values, HYPRE_Int center_rank, HYPRE_Int stencil_size, + HYPRE_Int *symm_elements, HYPRE_Int dim, HYPRE_Complex *data ); +HYPRE_Int hypre_PrintCCBoxArrayData ( FILE *file, hypre_BoxArray *box_array, + hypre_BoxArray *data_space, HYPRE_Int num_values, HYPRE_Complex *data ); +HYPRE_Int hypre_ReadBoxArrayData ( FILE *file, hypre_BoxArray *box_array, + hypre_BoxArray *data_space, HYPRE_Int num_values, HYPRE_Int dim, HYPRE_Complex *data ); +HYPRE_Int hypre_ReadBoxArrayData_CC ( FILE *file, hypre_BoxArray *box_array, + hypre_BoxArray *data_space, HYPRE_Int stencil_size, HYPRE_Int real_stencil_size, + HYPRE_Int constant_coefficient, HYPRE_Int dim, HYPRE_Complex *data ); /* struct_matrix.c */ -HYPRE_Complex *hypre_StructMatrixExtractPointerByIndex ( hypre_StructMatrix *matrix , HYPRE_Int b , hypre_Index index ); -hypre_StructMatrix *hypre_StructMatrixCreate ( MPI_Comm comm , hypre_StructGrid *grid , hypre_StructStencil *user_stencil ); +HYPRE_Complex *hypre_StructMatrixExtractPointerByIndex ( hypre_StructMatrix *matrix, HYPRE_Int b, + hypre_Index index ); +hypre_StructMatrix *hypre_StructMatrixCreate ( MPI_Comm comm, hypre_StructGrid *grid, + hypre_StructStencil *user_stencil ); hypre_StructMatrix *hypre_StructMatrixRef ( hypre_StructMatrix *matrix ); HYPRE_Int hypre_StructMatrixDestroy ( hypre_StructMatrix *matrix ); HYPRE_Int hypre_StructMatrixInitializeShell ( hypre_StructMatrix *matrix ); -HYPRE_Int hypre_StructMatrixInitializeData ( hypre_StructMatrix *matrix , HYPRE_Complex *data ,HYPRE_Complex *data_const); +HYPRE_Int hypre_StructMatrixInitializeData ( hypre_StructMatrix *matrix, HYPRE_Complex *data, + HYPRE_Complex *data_const); HYPRE_Int hypre_StructMatrixInitialize ( hypre_StructMatrix *matrix ); -HYPRE_Int hypre_StructMatrixSetValues ( hypre_StructMatrix *matrix , hypre_Index grid_index , HYPRE_Int num_stencil_indices , HYPRE_Int *stencil_indices , HYPRE_Complex *values , HYPRE_Int action , HYPRE_Int boxnum , HYPRE_Int outside ); -HYPRE_Int hypre_StructMatrixSetBoxValues ( hypre_StructMatrix *matrix , hypre_Box *set_box , hypre_Box *value_box , HYPRE_Int num_stencil_indices , HYPRE_Int *stencil_indices , HYPRE_Complex *values , HYPRE_Int action , HYPRE_Int boxnum , HYPRE_Int outside ); -HYPRE_Int hypre_StructMatrixSetConstantValues ( hypre_StructMatrix *matrix , HYPRE_Int num_stencil_indices , HYPRE_Int *stencil_indices , HYPRE_Complex *values , HYPRE_Int action ); -HYPRE_Int hypre_StructMatrixClearValues ( hypre_StructMatrix *matrix , hypre_Index grid_index , HYPRE_Int num_stencil_indices , HYPRE_Int *stencil_indices , HYPRE_Int boxnum , HYPRE_Int outside ); -HYPRE_Int hypre_StructMatrixClearBoxValues ( hypre_StructMatrix *matrix , hypre_Box *clear_box , HYPRE_Int num_stencil_indices , HYPRE_Int *stencil_indices , HYPRE_Int boxnum , HYPRE_Int outside ); +HYPRE_Int hypre_StructMatrixSetValues ( hypre_StructMatrix *matrix, hypre_Index grid_index, + HYPRE_Int num_stencil_indices, HYPRE_Int *stencil_indices, HYPRE_Complex *values, HYPRE_Int action, + HYPRE_Int boxnum, HYPRE_Int outside ); +HYPRE_Int hypre_StructMatrixSetBoxValues ( hypre_StructMatrix *matrix, hypre_Box *set_box, + hypre_Box *value_box, HYPRE_Int num_stencil_indices, HYPRE_Int *stencil_indices, + HYPRE_Complex *values, HYPRE_Int action, HYPRE_Int boxnum, HYPRE_Int outside ); +HYPRE_Int hypre_StructMatrixSetConstantValues ( hypre_StructMatrix *matrix, + HYPRE_Int num_stencil_indices, HYPRE_Int *stencil_indices, HYPRE_Complex *values, + HYPRE_Int action ); +HYPRE_Int hypre_StructMatrixClearValues ( hypre_StructMatrix *matrix, hypre_Index grid_index, + HYPRE_Int num_stencil_indices, HYPRE_Int *stencil_indices, HYPRE_Int boxnum, HYPRE_Int outside ); +HYPRE_Int hypre_StructMatrixClearBoxValues ( hypre_StructMatrix *matrix, hypre_Box *clear_box, + HYPRE_Int num_stencil_indices, HYPRE_Int *stencil_indices, HYPRE_Int boxnum, HYPRE_Int outside ); HYPRE_Int hypre_StructMatrixAssemble ( hypre_StructMatrix *matrix ); -HYPRE_Int hypre_StructMatrixSetNumGhost ( hypre_StructMatrix *matrix , HYPRE_Int *num_ghost ); -HYPRE_Int hypre_StructMatrixSetConstantCoefficient ( hypre_StructMatrix *matrix , HYPRE_Int constant_coefficient ); -HYPRE_Int hypre_StructMatrixSetConstantEntries ( hypre_StructMatrix *matrix , HYPRE_Int nentries , HYPRE_Int *entries ); +HYPRE_Int hypre_StructMatrixSetNumGhost ( hypre_StructMatrix *matrix, HYPRE_Int *num_ghost ); +HYPRE_Int hypre_StructMatrixSetConstantCoefficient ( hypre_StructMatrix *matrix, + HYPRE_Int constant_coefficient ); +HYPRE_Int hypre_StructMatrixSetConstantEntries ( hypre_StructMatrix *matrix, HYPRE_Int nentries, + HYPRE_Int *entries ); HYPRE_Int hypre_StructMatrixClearGhostValues ( hypre_StructMatrix *matrix ); -HYPRE_Int hypre_StructMatrixPrint ( const char *filename , hypre_StructMatrix *matrix , HYPRE_Int all ); -HYPRE_Int hypre_StructMatrixMigrate ( hypre_StructMatrix *from_matrix , hypre_StructMatrix *to_matrix ); -hypre_StructMatrix *hypre_StructMatrixRead ( MPI_Comm comm , const char *filename , HYPRE_Int *num_ghost ); +HYPRE_Int hypre_StructMatrixPrintData ( FILE *file, hypre_StructMatrix *matrix, HYPRE_Int all ); +HYPRE_Int hypre_StructMatrixReadData ( FILE *file, hypre_StructMatrix *matrix ); +HYPRE_Int hypre_StructMatrixPrint ( const char *filename, hypre_StructMatrix *matrix, + HYPRE_Int all ); +hypre_StructMatrix *hypre_StructMatrixRead ( MPI_Comm comm, const char *filename, + HYPRE_Int *num_ghost ); +HYPRE_Int hypre_StructMatrixMigrate ( hypre_StructMatrix *from_matrix, + hypre_StructMatrix *to_matrix ); HYPRE_Int hypre_StructMatrixClearBoundary( hypre_StructMatrix *matrix); /* struct_matrix_mask.c */ -hypre_StructMatrix *hypre_StructMatrixCreateMask ( hypre_StructMatrix *matrix , HYPRE_Int num_stencil_indices , HYPRE_Int *stencil_indices ); +hypre_StructMatrix *hypre_StructMatrixCreateMask ( hypre_StructMatrix *matrix, + HYPRE_Int num_stencil_indices, HYPRE_Int *stencil_indices ); /* struct_matvec.c */ void *hypre_StructMatvecCreate ( void ); -HYPRE_Int hypre_StructMatvecSetup ( void *matvec_vdata , hypre_StructMatrix *A , hypre_StructVector *x ); -HYPRE_Int hypre_StructMatvecCompute ( void *matvec_vdata , HYPRE_Complex alpha , hypre_StructMatrix *A , hypre_StructVector *x , HYPRE_Complex beta , hypre_StructVector *y ); -HYPRE_Int hypre_StructMatvecCC0 ( HYPRE_Complex alpha , hypre_StructMatrix *A , hypre_StructVector *x , hypre_StructVector *y , hypre_BoxArrayArray *compute_box_aa , hypre_IndexRef stride ); -HYPRE_Int hypre_StructMatvecCC1 ( HYPRE_Complex alpha , hypre_StructMatrix *A , hypre_StructVector *x , hypre_StructVector *y , hypre_BoxArrayArray *compute_box_aa , hypre_IndexRef stride ); -HYPRE_Int hypre_StructMatvecCC2 ( HYPRE_Complex alpha , hypre_StructMatrix *A , hypre_StructVector *x , hypre_StructVector *y , hypre_BoxArrayArray *compute_box_aa , hypre_IndexRef stride ); +HYPRE_Int hypre_StructMatvecSetup ( void *matvec_vdata, hypre_StructMatrix *A, + hypre_StructVector *x ); +HYPRE_Int hypre_StructMatvecCompute ( void *matvec_vdata, HYPRE_Complex alpha, + hypre_StructMatrix *A, hypre_StructVector *x, HYPRE_Complex beta, hypre_StructVector *y ); +HYPRE_Int hypre_StructMatvecCC0 ( HYPRE_Complex alpha, hypre_StructMatrix *A, hypre_StructVector *x, + hypre_StructVector *y, hypre_BoxArrayArray *compute_box_aa, hypre_IndexRef stride ); +HYPRE_Int hypre_StructMatvecCC1 ( HYPRE_Complex alpha, hypre_StructMatrix *A, hypre_StructVector *x, + hypre_StructVector *y, hypre_BoxArrayArray *compute_box_aa, hypre_IndexRef stride ); +HYPRE_Int hypre_StructMatvecCC2 ( HYPRE_Complex alpha, hypre_StructMatrix *A, hypre_StructVector *x, + hypre_StructVector *y, hypre_BoxArrayArray *compute_box_aa, hypre_IndexRef stride ); HYPRE_Int hypre_StructMatvecDestroy ( void *matvec_vdata ); -HYPRE_Int hypre_StructMatvec ( HYPRE_Complex alpha , hypre_StructMatrix *A , hypre_StructVector *x , HYPRE_Complex beta , hypre_StructVector *y ); +HYPRE_Int hypre_StructMatvec ( HYPRE_Complex alpha, hypre_StructMatrix *A, hypre_StructVector *x, + HYPRE_Complex beta, hypre_StructVector *y ); /* struct_scale.c */ -HYPRE_Int hypre_StructScale ( HYPRE_Complex alpha , hypre_StructVector *y ); +HYPRE_Int hypre_StructScale ( HYPRE_Complex alpha, hypre_StructVector *y ); /* struct_stencil.c */ -hypre_StructStencil *hypre_StructStencilCreate ( HYPRE_Int dim , HYPRE_Int size , hypre_Index *shape ); +hypre_StructStencil *hypre_StructStencilCreate ( HYPRE_Int dim, HYPRE_Int size, + hypre_Index *shape ); hypre_StructStencil *hypre_StructStencilRef ( hypre_StructStencil *stencil ); HYPRE_Int hypre_StructStencilDestroy ( hypre_StructStencil *stencil ); -HYPRE_Int hypre_StructStencilElementRank ( hypre_StructStencil *stencil , hypre_Index stencil_element ); -HYPRE_Int hypre_StructStencilSymmetrize ( hypre_StructStencil *stencil , hypre_StructStencil **symm_stencil_ptr , HYPRE_Int **symm_elements_ptr ); +HYPRE_Int hypre_StructStencilElementRank ( hypre_StructStencil *stencil, + hypre_Index stencil_element ); +HYPRE_Int hypre_StructStencilSymmetrize ( hypre_StructStencil *stencil, + hypre_StructStencil **symm_stencil_ptr, HYPRE_Int **symm_elements_ptr ); /* struct_vector.c */ -hypre_StructVector *hypre_StructVectorCreate ( MPI_Comm comm , hypre_StructGrid *grid ); +hypre_StructVector *hypre_StructVectorCreate ( MPI_Comm comm, hypre_StructGrid *grid ); hypre_StructVector *hypre_StructVectorRef ( hypre_StructVector *vector ); HYPRE_Int hypre_StructVectorDestroy ( hypre_StructVector *vector ); HYPRE_Int hypre_StructVectorInitializeShell ( hypre_StructVector *vector ); -HYPRE_Int hypre_StructVectorInitializeData ( hypre_StructVector *vector , HYPRE_Complex *data); +HYPRE_Int hypre_StructVectorInitializeData ( hypre_StructVector *vector, HYPRE_Complex *data); HYPRE_Int hypre_StructVectorInitialize ( hypre_StructVector *vector ); -HYPRE_Int hypre_StructVectorSetValues ( hypre_StructVector *vector , hypre_Index grid_index , HYPRE_Complex *values , HYPRE_Int action , HYPRE_Int boxnum , HYPRE_Int outside ); -HYPRE_Int hypre_StructVectorSetBoxValues ( hypre_StructVector *vector , hypre_Box *set_box , hypre_Box *value_box , HYPRE_Complex *values , HYPRE_Int action , HYPRE_Int boxnum , HYPRE_Int outside ); -HYPRE_Int hypre_StructVectorClearValues ( hypre_StructVector *vector , hypre_Index grid_index , HYPRE_Int boxnum , HYPRE_Int outside ); -HYPRE_Int hypre_StructVectorClearBoxValues ( hypre_StructVector *vector , hypre_Box *clear_box , HYPRE_Int boxnum , HYPRE_Int outside ); +HYPRE_Int hypre_StructVectorSetValues ( hypre_StructVector *vector, hypre_Index grid_index, + HYPRE_Complex *values, HYPRE_Int action, HYPRE_Int boxnum, HYPRE_Int outside ); +HYPRE_Int hypre_StructVectorSetBoxValues ( hypre_StructVector *vector, hypre_Box *set_box, + hypre_Box *value_box, HYPRE_Complex *values, HYPRE_Int action, HYPRE_Int boxnum, + HYPRE_Int outside ); +HYPRE_Int hypre_StructVectorClearValues ( hypre_StructVector *vector, hypre_Index grid_index, + HYPRE_Int boxnum, HYPRE_Int outside ); +HYPRE_Int hypre_StructVectorClearBoxValues ( hypre_StructVector *vector, hypre_Box *clear_box, + HYPRE_Int boxnum, HYPRE_Int outside ); HYPRE_Int hypre_StructVectorClearAllValues ( hypre_StructVector *vector ); -HYPRE_Int hypre_StructVectorSetNumGhost ( hypre_StructVector *vector , HYPRE_Int *num_ghost ); -HYPRE_Int hypre_StructVectorSetDataSize(hypre_StructVector *vector , HYPRE_Int *data_size, HYPRE_Int *data_host_size); +HYPRE_Int hypre_StructVectorSetNumGhost ( hypre_StructVector *vector, HYPRE_Int *num_ghost ); +HYPRE_Int hypre_StructVectorSetDataSize(hypre_StructVector *vector, HYPRE_Int *data_size, + HYPRE_Int *data_host_size); HYPRE_Int hypre_StructVectorAssemble ( hypre_StructVector *vector ); -HYPRE_Int hypre_StructVectorCopy ( hypre_StructVector *x , hypre_StructVector *y ); -HYPRE_Int hypre_StructVectorSetConstantValues ( hypre_StructVector *vector , HYPRE_Complex values ); -HYPRE_Int hypre_StructVectorSetFunctionValues ( hypre_StructVector *vector , HYPRE_Complex (*fcn )()); +HYPRE_Int hypre_StructVectorCopy ( hypre_StructVector *x, hypre_StructVector *y ); +HYPRE_Int hypre_StructVectorSetConstantValues ( hypre_StructVector *vector, HYPRE_Complex values ); +HYPRE_Int hypre_StructVectorSetFunctionValues ( hypre_StructVector *vector, + HYPRE_Complex (*fcn )( HYPRE_Int, HYPRE_Int, HYPRE_Int )); HYPRE_Int hypre_StructVectorClearGhostValues ( hypre_StructVector *vector ); -HYPRE_Int hypre_StructVectorClearBoundGhostValues ( hypre_StructVector *vector , HYPRE_Int force ); -HYPRE_Int hypre_StructVectorScaleValues ( hypre_StructVector *vector , HYPRE_Complex factor ); -hypre_CommPkg *hypre_StructVectorGetMigrateCommPkg ( hypre_StructVector *from_vector , hypre_StructVector *to_vector ); -HYPRE_Int hypre_StructVectorMigrate ( hypre_CommPkg *comm_pkg , hypre_StructVector *from_vector , hypre_StructVector *to_vector ); -HYPRE_Int hypre_StructVectorPrint ( const char *filename , hypre_StructVector *vector , HYPRE_Int all ); -hypre_StructVector *hypre_StructVectorRead ( MPI_Comm comm , const char *filename , HYPRE_Int *num_ghost ); +HYPRE_Int hypre_StructVectorClearBoundGhostValues ( hypre_StructVector *vector, HYPRE_Int force ); +HYPRE_Int hypre_StructVectorScaleValues ( hypre_StructVector *vector, HYPRE_Complex factor ); +hypre_CommPkg *hypre_StructVectorGetMigrateCommPkg ( hypre_StructVector *from_vector, + hypre_StructVector *to_vector ); +HYPRE_Int hypre_StructVectorMigrate ( hypre_CommPkg *comm_pkg, hypre_StructVector *from_vector, + hypre_StructVector *to_vector ); +HYPRE_Int hypre_StructVectorPrint ( const char *filename, hypre_StructVector *vector, + HYPRE_Int all ); +hypre_StructVector *hypre_StructVectorRead ( MPI_Comm comm, const char *filename, + HYPRE_Int *num_ghost ); hypre_StructVector *hypre_StructVectorClone ( hypre_StructVector *vector ); diff --git a/external/hypre/src/struct_mv/struct_axpy.c b/external/hypre/src/struct_mv/struct_axpy.c index 561543fb..e6b0cd59 100644 --- a/external/hypre/src/struct_mv/struct_axpy.c +++ b/external/hypre/src/struct_mv/struct_axpy.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -53,6 +53,18 @@ hypre_StructAxpy( HYPRE_Complex alpha, hypre_BoxGetSize(box, loop_size); +#if 0 + HYPRE_BOXLOOP ( + hypre_BoxLoop2Begin, (hypre_StructVectorNDim(x), loop_size, + x_data_box, start, unit_stride, xi, + y_data_box, start, unit_stride, yi), + { + yp[yi] += alpha * xp[xi]; + }, + hypre_BoxLoop2End, (xi, yi) ) + +#else + #define DEVICE_VAR is_device_ptr(yp,xp) hypre_BoxLoop2Begin(hypre_StructVectorNDim(x), loop_size, x_data_box, start, unit_stride, xi, @@ -62,7 +74,10 @@ hypre_StructAxpy( HYPRE_Complex alpha, } hypre_BoxLoop2End(xi, yi); #undef DEVICE_VAR + +#endif } return hypre_error_flag; } + diff --git a/external/hypre/src/struct_mv/struct_communication.c b/external/hypre/src/struct_mv/struct_communication.c index 81be1bb7..a6ea8a8d 100644 --- a/external/hypre/src/struct_mv/struct_communication.c +++ b/external/hypre/src/struct_mv/struct_communication.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -212,7 +212,7 @@ hypre_CommPkgCreate( hypre_CommInfo *comm_info, num_boxes++; } } - hypre_qsort3i(comm_boxes_p, comm_boxes_i, comm_boxes_j, 0, num_boxes-1); + hypre_qsort3i(comm_boxes_p, comm_boxes_i, comm_boxes_j, 0, num_boxes - 1); /* compute comm_types */ @@ -228,6 +228,7 @@ hypre_CommPkgCreate( hypre_CommInfo *comm_info, p_old = -1; num_comms = 0; comm_bufsize = 0; + comm_type = &comm_types[0]; for (m = 0; m < num_boxes; m++) { i = comm_boxes_i[m]; @@ -246,7 +247,7 @@ hypre_CommPkgCreate( hypre_CommInfo *comm_info, { if (p != my_proc) { - comm_type = &comm_types[num_comms+1]; + comm_type = &comm_types[num_comms + 1]; num_comms++; } else @@ -264,8 +265,8 @@ hypre_CommPkgCreate( hypre_CommInfo *comm_info, k = hypre_CommTypeNumEntries(comm_type); hypre_BoxGetStrideVolume(box, send_stride, &size); - hypre_CommTypeBufsize(comm_type) += (size*num_values); - comm_bufsize += (size*num_values); + hypre_CommTypeBufsize(comm_type) += (size * num_values); + comm_bufsize += (size * num_values); rbox_array = hypre_BoxArrayArrayBoxArray(send_rboxes, i); data_box = hypre_BoxArrayBox(send_data_space, i); if (send_transforms != NULL) @@ -350,7 +351,7 @@ hypre_CommPkgCreate( hypre_CommInfo *comm_info, num_boxes++; } } - hypre_qsort3i(comm_boxes_p, comm_boxes_i, comm_boxes_j, 0, num_boxes-1); + hypre_qsort3i(comm_boxes_p, comm_boxes_i, comm_boxes_j, 0, num_boxes - 1); /* compute comm_types */ @@ -360,6 +361,7 @@ hypre_CommPkgCreate( hypre_CommInfo *comm_info, p_old = -1; num_comms = 0; comm_bufsize = 0; + comm_type = &comm_types[0]; for (m = 0; m < num_boxes; m++) { i = comm_boxes_i[m]; @@ -378,7 +380,7 @@ hypre_CommPkgCreate( hypre_CommInfo *comm_info, { if (p != my_proc) { - comm_type = &comm_types[num_comms+1]; + comm_type = &comm_types[num_comms + 1]; num_comms++; } else @@ -393,8 +395,8 @@ hypre_CommPkgCreate( hypre_CommInfo *comm_info, k = hypre_CommTypeNumEntries(comm_type); hypre_BoxGetStrideVolume(box, recv_stride, &size); - hypre_CommTypeBufsize(comm_type) += (size*num_values); - comm_bufsize += (size*num_values); + hypre_CommTypeBufsize(comm_type) += (size * num_values); + comm_bufsize += (size * num_values); hypre_CommTypeNumEntries(comm_type) ++; } } @@ -689,7 +691,7 @@ hypre_CommTypeSetEntry( hypre_Box *box, { if (dir[i] < 0) { - offset += (length_array[i] - 1)*stride_array[i]; + offset += (length_array[i] - 1) * stride_array[i]; stride_array[i] = -stride_array[i]; } } @@ -712,12 +714,12 @@ hypre_CommTypeSetEntry( hypre_Box *box, i = 0; while (i < dim) { - if(length_array[i] == 1) + if (length_array[i] == 1) { - for(j = i; j < (dim - 1); j++) + for (j = i; j < (dim - 1); j++) { - length_array[j] = length_array[j+1]; - stride_array[j] = stride_array[j+1]; + length_array[j] = length_array[j + 1]; + stride_array[j] = stride_array[j + 1]; } length_array[dim - 1] = 1; stride_array[dim - 1] = 1; @@ -731,26 +733,26 @@ hypre_CommTypeSetEntry( hypre_Box *box, #if 0 /* sort the array according to length_array (largest to smallest) */ - for (i = (dim-1); i > 0; i--) + for (i = (dim - 1); i > 0; i--) { for (j = 0; j < i; j++) { - if (length_array[j] < length_array[j+1]) + if (length_array[j] < length_array[j + 1]) { i_tmp = length_array[j]; - length_array[j] = length_array[j+1]; - length_array[j+1] = i_tmp; + length_array[j] = length_array[j + 1]; + length_array[j + 1] = i_tmp; i_tmp = stride_array[j]; - stride_array[j] = stride_array[j+1]; - stride_array[j+1] = i_tmp; + stride_array[j] = stride_array[j + 1]; + stride_array[j + 1] = i_tmp; } } } #endif /* if every len was 1 we need to fix to communicate at least one */ - if(!dim) + if (!dim) { dim = 1; } @@ -762,6 +764,47 @@ hypre_CommTypeSetEntry( hypre_Box *box, return hypre_error_flag; } +HYPRE_Complex * +hypre_StructCommunicationGetBuffer(HYPRE_MemoryLocation memory_location, + HYPRE_Int size) +{ + HYPRE_Complex *ptr; + +#if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) + if (hypre_GetActualMemLocation(memory_location) != hypre_MEMORY_HOST) + { + if (size > hypre_HandleStructCommSendBufferSize(hypre_handle())) + { + HYPRE_Int new_size = 5 * size; + hypre_HandleStructCommSendBufferSize(hypre_handle()) = new_size; + hypre_TFree(hypre_HandleStructCommSendBuffer(hypre_handle()), memory_location); + hypre_HandleStructCommSendBuffer(hypre_handle()) = hypre_CTAlloc(HYPRE_Complex, new_size, + memory_location); + } + + ptr = hypre_HandleStructCommSendBuffer(hypre_handle()); + } + else +#endif + { + ptr = hypre_CTAlloc(HYPRE_Complex, size, memory_location); + } + + return ptr; +} + +HYPRE_Int +hypre_StructCommunicationReleaseBuffer(HYPRE_Complex *buffer, + HYPRE_MemoryLocation memory_location) +{ + if (hypre_GetActualMemLocation(memory_location) == hypre_MEMORY_HOST) + { + hypre_TFree(buffer, memory_location); + } + + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- * Initialize a non-blocking communication exchange. * @@ -774,12 +817,12 @@ hypre_CommTypeSetEntry( hypre_Box *box, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_InitializeCommunication( hypre_CommPkg *comm_pkg, - HYPRE_Complex *send_data, - HYPRE_Complex *recv_data, - HYPRE_Int action, - HYPRE_Int tag, - hypre_CommHandle **comm_handle_ptr ) +hypre_InitializeCommunication( hypre_CommPkg *comm_pkg, + HYPRE_Complex *send_data, + HYPRE_Complex *recv_data, + HYPRE_Int action, + HYPRE_Int tag, + hypre_CommHandle **comm_handle_ptr ) { hypre_CommHandle *comm_handle; @@ -795,15 +838,15 @@ hypre_InitializeCommunication( hypre_CommPkg *comm_pkg, HYPRE_Complex **send_buffers; HYPRE_Complex **recv_buffers; - HYPRE_Complex **send_buffers_device; - HYPRE_Complex **recv_buffers_device; + HYPRE_Complex **send_buffers_mpi; + HYPRE_Complex **recv_buffers_mpi; hypre_CommType *comm_type, *from_type, *to_type; hypre_CommEntryType *comm_entry; HYPRE_Int num_entries; HYPRE_Int *length_array; - HYPRE_Int *stride_array, unitst_array[HYPRE_MAXDIM+1]; + HYPRE_Int *stride_array, unitst_array[HYPRE_MAXDIM + 1]; HYPRE_Int *order; HYPRE_Complex *dptr, *kptr, *lptr; @@ -812,13 +855,16 @@ hypre_InitializeCommunication( hypre_CommPkg *comm_pkg, HYPRE_Int i, j, d, ll; HYPRE_Int size; + HYPRE_MemoryLocation memory_location = hypre_HandleMemoryLocation(hypre_handle()); + HYPRE_MemoryLocation memory_location_mpi = memory_location; + /*-------------------------------------------------------------------- * allocate requests and status *--------------------------------------------------------------------*/ num_requests = num_sends + num_recvs; requests = hypre_CTAlloc(hypre_MPI_Request, num_requests, HYPRE_MEMORY_HOST); - status = hypre_CTAlloc(hypre_MPI_Status, num_requests, HYPRE_MEMORY_HOST); + status = hypre_CTAlloc(hypre_MPI_Status, num_requests, HYPRE_MEMORY_HOST); /*-------------------------------------------------------------------- * allocate buffers @@ -829,103 +875,28 @@ hypre_InitializeCommunication( hypre_CommPkg *comm_pkg, if (num_sends > 0) { size = hypre_CommPkgSendBufsize(comm_pkg); - send_buffers[0] = hypre_CTAlloc(HYPRE_Complex, size, HYPRE_MEMORY_HOST); + send_buffers[0] = hypre_StructCommunicationGetBuffer(memory_location, size); for (i = 1; i < num_sends; i++) { - comm_type = hypre_CommPkgSendType(comm_pkg, i-1); + comm_type = hypre_CommPkgSendType(comm_pkg, i - 1); size = hypre_CommTypeBufsize(comm_type); - send_buffers[i] = send_buffers[i-1] + size; + send_buffers[i] = send_buffers[i - 1] + size; } } - /* allocate device send buffer - * If boxloops run on GPUs, allocate device buffer, - * since cannot access host memory from device */ - HYPRE_Int alloc_dev_buffer = 0; - /* In the case of running on device and cannot access host memory from device */ -#if defined(HYPRE_USING_GPU) -#if defined(HYPRE_USING_RAJA) || defined(HYPRE_USING_KOKKOS) - alloc_dev_buffer = 1; -#elif defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - alloc_dev_buffer = (hypre_HandleStructExecPolicy(hypre_handle()) == HYPRE_EXEC_DEVICE); -#elif defined(HYPRE_USING_DEVICE_OPENMP) - alloc_dev_buffer = hypre__global_offload; -#endif -#endif - -#if defined(HYPRE_USING_GPU) - if (alloc_dev_buffer) - { - send_buffers_device = hypre_TAlloc(HYPRE_Complex *, num_sends, HYPRE_MEMORY_HOST); - if (num_sends > 0) - { - size = hypre_CommPkgSendBufsize(comm_pkg); - if (size > hypre_HandleStructCommSendBufferSize(hypre_handle())) - { - hypre_TFree(hypre_HandleStructCommSendBuffer(hypre_handle()), HYPRE_MEMORY_DEVICE); - hypre_HandleStructCommSendBufferSize(hypre_handle()) = 5 * size; - hypre_HandleStructCommSendBuffer(hypre_handle()) = - hypre_CTAlloc(HYPRE_Complex, hypre_HandleStructCommSendBufferSize(hypre_handle()), HYPRE_MEMORY_DEVICE); - } - send_buffers_device[0] = hypre_HandleStructCommSendBuffer(hypre_handle()); - for (i = 1; i < num_sends; i++) - { - comm_type = hypre_CommPkgSendType(comm_pkg, i-1); - size = hypre_CommTypeBufsize(comm_type); - send_buffers_device[i] = send_buffers_device[i-1] + size; - } - } - } - else -#endif - { - send_buffers_device = send_buffers; - } - /* allocate recv buffers */ recv_buffers = hypre_TAlloc(HYPRE_Complex *, num_recvs, HYPRE_MEMORY_HOST); if (num_recvs > 0) { size = hypre_CommPkgRecvBufsize(comm_pkg); - recv_buffers[0] = hypre_TAlloc(HYPRE_Complex, size, HYPRE_MEMORY_HOST); + recv_buffers[0] = hypre_StructCommunicationGetBuffer(memory_location, size); for (i = 1; i < num_recvs; i++) { - comm_type = hypre_CommPkgRecvType(comm_pkg, i-1); + comm_type = hypre_CommPkgRecvType(comm_pkg, i - 1); size = hypre_CommTypeBufsize(comm_type); - recv_buffers[i] = recv_buffers[i-1] + size; - } - } - - /* allocate device recv buffers */ -#if defined(HYPRE_USING_GPU) - if (alloc_dev_buffer) - { - recv_buffers_device = hypre_TAlloc(HYPRE_Complex *, num_recvs, HYPRE_MEMORY_HOST); - if (num_recvs > 0) - { - size = hypre_CommPkgRecvBufsize(comm_pkg); - - if (size > hypre_HandleStructCommRecvBufferSize(hypre_handle())) - { - hypre_TFree(hypre_HandleStructCommRecvBuffer(hypre_handle()), HYPRE_MEMORY_DEVICE); - hypre_HandleStructCommRecvBufferSize(hypre_handle()) = 5 * size; - hypre_HandleStructCommRecvBuffer(hypre_handle()) = - hypre_CTAlloc(HYPRE_Complex, hypre_HandleStructCommRecvBufferSize(hypre_handle()), HYPRE_MEMORY_DEVICE); - } - recv_buffers_device[0] = hypre_HandleStructCommRecvBuffer(hypre_handle()); - for (i = 1; i < num_recvs; i++) - { - comm_type = hypre_CommPkgRecvType(comm_pkg, i-1); - size = hypre_CommTypeBufsize(comm_type); - recv_buffers_device[i] = recv_buffers_device[i-1] + size; - } + recv_buffers[i] = recv_buffers[i - 1] + size; } } - else -#endif - { - recv_buffers_device = recv_buffers; - } /*-------------------------------------------------------------------- * pack send buffers @@ -936,7 +907,7 @@ hypre_InitializeCommunication( hypre_CommPkg *comm_pkg, comm_type = hypre_CommPkgSendType(comm_pkg, i); num_entries = hypre_CommTypeNumEntries(comm_type); - dptr = (HYPRE_Complex *) send_buffers_device[i]; + dptr = (HYPRE_Complex *) send_buffers[i]; if ( hypre_CommPkgFirstComm(comm_pkg) ) { dptr += hypre_CommPrefixSize(num_entries); @@ -951,7 +922,7 @@ hypre_InitializeCommunication( hypre_CommPkg *comm_pkg, unitst_array[0] = 1; for (d = 1; d <= ndim; d++) { - unitst_array[d] = unitst_array[d-1]*length_array[d-1]; + unitst_array[d] = unitst_array[d - 1] * length_array[d - 1]; } lptr = send_data + hypre_CommEntryTypeOffset(comm_entry); @@ -959,7 +930,7 @@ hypre_InitializeCommunication( hypre_CommPkg *comm_pkg, { if (order[ll] > -1) { - kptr = lptr + order[ll]*stride_array[ndim]; + kptr = lptr + order[ll] * stride_array[ndim]; #define DEVICE_VAR is_device_ptr(dptr,kptr) hypre_BasicBoxLoop2Begin(ndim, length_array, @@ -981,7 +952,7 @@ hypre_InitializeCommunication( hypre_CommPkg *comm_pkg, size *= length_array[d]; } - hypre_Memset(dptr, 0, size*sizeof(HYPRE_Complex), HYPRE_MEMORY_DEVICE); + hypre_Memset(dptr, 0, size * sizeof(HYPRE_Complex), memory_location); dptr += size; } @@ -989,37 +960,71 @@ hypre_InitializeCommunication( hypre_CommPkg *comm_pkg, } } - /* Copy buffer data from Device to Host */ - if (num_sends > 0 && alloc_dev_buffer) +#if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) + if (hypre_GetActualMemLocation(memory_location) != hypre_MEMORY_HOST) { - HYPRE_Complex *dptr_host; - size = hypre_CommPkgSendBufsize(comm_pkg); - dptr_host = (HYPRE_Complex *) send_buffers[0]; - dptr = (HYPRE_Complex *) send_buffers_device[0]; - if (dptr_host != dptr) + if (hypre_GetGpuAwareMPI()) { - hypre_TMemcpy(dptr_host, dptr, HYPRE_Complex, size, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); +#if defined(HYPRE_USING_GPU) + hypre_ForceSyncComputeStream(); +#endif + send_buffers_mpi = send_buffers; + recv_buffers_mpi = recv_buffers; + } + else + { + memory_location_mpi = HYPRE_MEMORY_HOST; + + send_buffers_mpi = hypre_TAlloc(HYPRE_Complex *, num_sends, HYPRE_MEMORY_HOST); + if (num_sends > 0) + { + size = hypre_CommPkgSendBufsize(comm_pkg); + send_buffers_mpi[0] = hypre_CTAlloc(HYPRE_Complex, size, memory_location_mpi); + for (i = 1; i < num_sends; i++) + { + send_buffers_mpi[i] = send_buffers_mpi[i - 1] + (send_buffers[i] - send_buffers[i - 1]); + } + hypre_TMemcpy(send_buffers_mpi[0], send_buffers[0], HYPRE_Complex, size, HYPRE_MEMORY_HOST, + memory_location); + } + + recv_buffers_mpi = hypre_TAlloc(HYPRE_Complex *, num_recvs, HYPRE_MEMORY_HOST); + if (num_recvs > 0) + { + size = hypre_CommPkgRecvBufsize(comm_pkg); + recv_buffers_mpi[0] = hypre_CTAlloc(HYPRE_Complex, size, memory_location_mpi); + for (i = 1; i < num_recvs; i++) + { + recv_buffers_mpi[i] = recv_buffers_mpi[i - 1] + (recv_buffers[i] - recv_buffers[i - 1]); + } + } } } + else +#endif + { + send_buffers_mpi = send_buffers; + recv_buffers_mpi = recv_buffers; + } for (i = 0; i < num_sends; i++) { comm_type = hypre_CommPkgSendType(comm_pkg, i); num_entries = hypre_CommTypeNumEntries(comm_type); - dptr = (HYPRE_Complex *) send_buffers[i]; if ( hypre_CommPkgFirstComm(comm_pkg) ) { - qptr = (HYPRE_Int *) send_buffers[i]; - *qptr = num_entries; + qptr = (HYPRE_Int *) send_buffers_mpi[i]; + hypre_TMemcpy(qptr, &num_entries, + HYPRE_Int, 1, memory_location_mpi, HYPRE_MEMORY_HOST); qptr ++; hypre_TMemcpy(qptr, hypre_CommTypeRemBoxnums(comm_type), - HYPRE_Int, num_entries, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + HYPRE_Int, num_entries, memory_location_mpi, HYPRE_MEMORY_HOST); qptr += num_entries; hypre_TMemcpy(qptr, hypre_CommTypeRemBoxes(comm_type), - hypre_Box, num_entries, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + hypre_Box, num_entries, memory_location_mpi, HYPRE_MEMORY_HOST); hypre_CommTypeRemBoxnums(comm_type) = NULL; - hypre_CommTypeRemBoxes(comm_type) = NULL; + hypre_CommTypeRemBoxes(comm_type) = NULL; } } @@ -1031,7 +1036,7 @@ hypre_InitializeCommunication( hypre_CommPkg *comm_pkg, for (i = 0; i < num_recvs; i++) { comm_type = hypre_CommPkgRecvType(comm_pkg, i); - hypre_MPI_Irecv(recv_buffers[i], + hypre_MPI_Irecv(recv_buffers_mpi[i], hypre_CommTypeBufsize(comm_type)*sizeof(HYPRE_Complex), hypre_MPI_BYTE, hypre_CommTypeProc(comm_type), tag, comm, &requests[j++]); @@ -1043,10 +1048,10 @@ hypre_InitializeCommunication( hypre_CommPkg *comm_pkg, } } - for(i = 0; i < num_sends; i++) + for (i = 0; i < num_sends; i++) { comm_type = hypre_CommPkgSendType(comm_pkg, i); - hypre_MPI_Isend(send_buffers[i], + hypre_MPI_Isend(send_buffers_mpi[i], hypre_CommTypeBufsize(comm_type)*sizeof(HYPRE_Complex), hypre_MPI_BYTE, hypre_CommTypeProc(comm_type), tag, comm, &requests[j++]); @@ -1091,17 +1096,17 @@ hypre_InitializeCommunication( hypre_CommPkg *comm_pkg, comm_handle = hypre_TAlloc(hypre_CommHandle, 1, HYPRE_MEMORY_HOST); - hypre_CommHandleCommPkg(comm_handle) = comm_pkg; - hypre_CommHandleSendData(comm_handle) = send_data; - hypre_CommHandleRecvData(comm_handle) = recv_data; - hypre_CommHandleNumRequests(comm_handle) = num_requests; - hypre_CommHandleRequests(comm_handle) = requests; - hypre_CommHandleStatus(comm_handle) = status; - hypre_CommHandleSendBuffers(comm_handle) = send_buffers; - hypre_CommHandleRecvBuffers(comm_handle) = recv_buffers; - hypre_CommHandleAction(comm_handle) = action; - hypre_CommHandleSendBuffersDevice(comm_handle) = send_buffers_device; - hypre_CommHandleRecvBuffersDevice(comm_handle) = recv_buffers_device; + hypre_CommHandleCommPkg(comm_handle) = comm_pkg; + hypre_CommHandleSendData(comm_handle) = send_data; + hypre_CommHandleRecvData(comm_handle) = recv_data; + hypre_CommHandleNumRequests(comm_handle) = num_requests; + hypre_CommHandleRequests(comm_handle) = requests; + hypre_CommHandleStatus(comm_handle) = status; + hypre_CommHandleSendBuffers(comm_handle) = send_buffers; + hypre_CommHandleRecvBuffers(comm_handle) = recv_buffers; + hypre_CommHandleAction(comm_handle) = action; + hypre_CommHandleSendBuffersMPI(comm_handle) = send_buffers_mpi; + hypre_CommHandleRecvBuffersMPI(comm_handle) = recv_buffers_mpi; *comm_handle_ptr = comm_handle; @@ -1119,10 +1124,12 @@ hypre_InitializeCommunication( hypre_CommPkg *comm_pkg, HYPRE_Int hypre_FinalizeCommunication( hypre_CommHandle *comm_handle ) { - hypre_CommPkg *comm_pkg = hypre_CommHandleCommPkg(comm_handle); - HYPRE_Complex **send_buffers = hypre_CommHandleSendBuffers(comm_handle); - HYPRE_Complex **recv_buffers = hypre_CommHandleRecvBuffers(comm_handle); - HYPRE_Int action = hypre_CommHandleAction(comm_handle); + hypre_CommPkg *comm_pkg = hypre_CommHandleCommPkg(comm_handle); + HYPRE_Complex **send_buffers = hypre_CommHandleSendBuffers(comm_handle); + HYPRE_Complex **recv_buffers = hypre_CommHandleRecvBuffers(comm_handle); + HYPRE_Complex **send_buffers_mpi = hypre_CommHandleSendBuffersMPI(comm_handle); + HYPRE_Complex **recv_buffers_mpi = hypre_CommHandleRecvBuffersMPI(comm_handle); + HYPRE_Int action = hypre_CommHandleAction(comm_handle); HYPRE_Int ndim = hypre_CommPkgNDim(comm_pkg); HYPRE_Int num_values = hypre_CommPkgNumValues(comm_pkg); @@ -1134,7 +1141,7 @@ hypre_FinalizeCommunication( hypre_CommHandle *comm_handle ) HYPRE_Int num_entries; HYPRE_Int *length_array; - HYPRE_Int *stride_array, unitst_array[HYPRE_MAXDIM+1]; + HYPRE_Int *stride_array, unitst_array[HYPRE_MAXDIM + 1]; HYPRE_Complex *kptr, *lptr; HYPRE_Complex *dptr; @@ -1145,8 +1152,15 @@ hypre_FinalizeCommunication( hypre_CommHandle *comm_handle ) HYPRE_Int i, j, d, ll; - HYPRE_Complex **send_buffers_device = hypre_CommHandleSendBuffersDevice(comm_handle); - HYPRE_Complex **recv_buffers_device = hypre_CommHandleRecvBuffersDevice(comm_handle); + HYPRE_MemoryLocation memory_location = hypre_HandleMemoryLocation(hypre_handle()); + HYPRE_MemoryLocation memory_location_mpi = memory_location; + +#if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) + if (!hypre_GetGpuAwareMPI()) + { + memory_location_mpi = HYPRE_MEMORY_HOST; + } +#endif /*-------------------------------------------------------------------- * finish communications @@ -1166,15 +1180,18 @@ hypre_FinalizeCommunication( hypre_CommHandle *comm_handle ) if ( hypre_CommPkgFirstComm(comm_pkg) ) { - hypre_CommEntryType *ct_entries; + hypre_CommEntryType *ct_entries; num_entries = 0; for (i = 0; i < num_recvs; i++) { comm_type = hypre_CommPkgRecvType(comm_pkg, i); - qptr = (HYPRE_Int *) recv_buffers[i]; - hypre_CommTypeNumEntries(comm_type) = *qptr; + qptr = (HYPRE_Int *) recv_buffers_mpi[i]; + + hypre_TMemcpy(&hypre_CommTypeNumEntries(comm_type), qptr, + HYPRE_Int, 1, HYPRE_MEMORY_HOST, memory_location_mpi); + num_entries += hypre_CommTypeNumEntries(comm_type); } @@ -1185,15 +1202,34 @@ hypre_FinalizeCommunication( hypre_CommHandle *comm_handle ) for (i = 0; i < num_recvs; i++) { comm_type = hypre_CommPkgRecvType(comm_pkg, i); + + /* Assign the entries to the comm_type */ hypre_CommTypeEntries(comm_type) = ct_entries; - ct_entries += hypre_CommTypeNumEntries(comm_type); + num_entries = hypre_CommTypeNumEntries(comm_type); + ct_entries += num_entries; - qptr = (HYPRE_Int *) recv_buffers[i]; - num_entries = *qptr; - qptr ++; - boxnums = qptr; - qptr += num_entries; - boxes = (hypre_Box *) qptr; + qptr = (HYPRE_Int *) recv_buffers_mpi[i]; + qptr++; + + /* Set boxnums and boxes from MPI recv buffer */ + if (!hypre_GetGpuAwareMPI()) + { + boxnums = (HYPRE_Int*) qptr; + qptr += num_entries; + boxes = (hypre_Box*) qptr; + } + else + { + boxnums = hypre_TAlloc(HYPRE_Int, num_entries, HYPRE_MEMORY_HOST); + hypre_TMemcpy(boxnums, qptr, HYPRE_Int, num_entries, + HYPRE_MEMORY_HOST, memory_location_mpi); + qptr += num_entries; + boxes = hypre_TAlloc(hypre_Box, num_entries, HYPRE_MEMORY_HOST); + hypre_TMemcpy(boxes, qptr, hypre_Box, num_entries, + HYPRE_MEMORY_HOST, memory_location_mpi); + } + + /* Set the entries for the comm_type */ hypre_CommTypeSetEntries(comm_type, boxnums, boxes, hypre_CommPkgRecvStride(comm_pkg), hypre_CommPkgIdentityCoord(comm_pkg), @@ -1201,6 +1237,13 @@ hypre_FinalizeCommunication( hypre_CommHandle *comm_handle ) hypre_CommPkgIdentityOrder(comm_pkg), hypre_CommPkgRecvDataSpace(comm_pkg), hypre_CommPkgRecvDataOffsets(comm_pkg)); + + /* Free allocated memory if using GPU-aware MPI */ + if (hypre_GetGpuAwareMPI()) + { + hypre_TFree(boxnums, HYPRE_MEMORY_HOST); + hypre_TFree(boxes, HYPRE_MEMORY_HOST); + } } } @@ -1208,35 +1251,18 @@ hypre_FinalizeCommunication( hypre_CommHandle *comm_handle ) * unpack receive buffer data *--------------------------------------------------------------------*/ - /* if boxloops run on GPUs, since cannot access host memory from device, - * copy the received buffer data in the host buffer to the device buffer, - * which was allocated in hypre_InitializeCommunication and has the same size of the host buffer - */ - /* **be cautious to hypre_CommPkgRecvBufsize that is different in the first comm.** */ - - HYPRE_Int alloc_dev_buffer = 0; -#if defined(HYPRE_USING_GPU) -#if defined(HYPRE_USING_RAJA) || defined(HYPRE_USING_KOKKOS) - alloc_dev_buffer = 1; -#elif defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - alloc_dev_buffer = (hypre_HandleStructExecPolicy(hypre_handle()) == HYPRE_EXEC_DEVICE); -#elif defined(HYPRE_USING_DEVICE_OPENMP) - alloc_dev_buffer = hypre__global_offload; -#endif -#endif - - if (num_recvs > 0 && alloc_dev_buffer) + /* Note: hypre_CommPkgRecvBufsize is different in the first comm */ + if (recv_buffers != recv_buffers_mpi) { - HYPRE_Complex *dptr_host; - size_t recv_buf_size = hypre_CommPkgFirstComm(comm_pkg) ? hypre_CommPkgRecvBufsizeFirstComm(comm_pkg) : - hypre_CommPkgRecvBufsize(comm_pkg); + if (num_recvs > 0) + { + HYPRE_Int recv_buf_size; - dptr_host = (HYPRE_Complex *) recv_buffers[0]; - dptr = (HYPRE_Complex *) recv_buffers_device[0]; + recv_buf_size = hypre_CommPkgFirstComm(comm_pkg) ? hypre_CommPkgRecvBufsizeFirstComm(comm_pkg) : + hypre_CommPkgRecvBufsize(comm_pkg); - if (dptr != dptr_host) - { - hypre_TMemcpy( dptr, dptr_host, HYPRE_Complex, recv_buf_size, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST ); + hypre_TMemcpy(recv_buffers[0], recv_buffers_mpi[0], HYPRE_Complex, recv_buf_size, + memory_location, memory_location_mpi); } } @@ -1245,7 +1271,7 @@ hypre_FinalizeCommunication( hypre_CommHandle *comm_handle ) comm_type = hypre_CommPkgRecvType(comm_pkg, i); num_entries = hypre_CommTypeNumEntries(comm_type); - dptr = (HYPRE_Complex *) recv_buffers_device[i]; + dptr = (HYPRE_Complex *) recv_buffers[i]; if ( hypre_CommPkgFirstComm(comm_pkg) ) { @@ -1260,14 +1286,14 @@ hypre_FinalizeCommunication( hypre_CommHandle *comm_handle ) unitst_array[0] = 1; for (d = 1; d <= ndim; d++) { - unitst_array[d] = unitst_array[d-1]*length_array[d-1]; + unitst_array[d] = unitst_array[d - 1] * length_array[d - 1]; } lptr = hypre_CommHandleRecvData(comm_handle) + - hypre_CommEntryTypeOffset(comm_entry); + hypre_CommEntryTypeOffset(comm_entry); for (ll = 0; ll < num_values; ll++) { - kptr = lptr + ll*stride_array[ndim]; + kptr = lptr + ll * stride_array[ndim]; #define DEVICE_VAR is_device_ptr(kptr,dptr) hypre_BasicBoxLoop2Begin(ndim, length_array, @@ -1305,34 +1331,29 @@ hypre_FinalizeCommunication( hypre_CommHandle *comm_handle ) hypre_TFree(hypre_CommHandleStatus(comm_handle), HYPRE_MEMORY_HOST); if (num_sends > 0) { - hypre_TFree(send_buffers[0], HYPRE_MEMORY_HOST); + hypre_StructCommunicationReleaseBuffer(send_buffers[0], memory_location); } if (num_recvs > 0) { - hypre_TFree(recv_buffers[0], HYPRE_MEMORY_HOST); + hypre_StructCommunicationReleaseBuffer(recv_buffers[0], memory_location); } hypre_TFree(comm_handle, HYPRE_MEMORY_HOST); - if (send_buffers == send_buffers_device) + if (send_buffers != send_buffers_mpi) { - hypre_TFree(send_buffers, HYPRE_MEMORY_HOST); + hypre_TFree(send_buffers_mpi[0], memory_location_mpi); + hypre_TFree(send_buffers_mpi, HYPRE_MEMORY_HOST); } - else - { - hypre_TFree(send_buffers, HYPRE_MEMORY_HOST); - hypre_TFree(send_buffers_device, HYPRE_MEMORY_HOST); - } - if (recv_buffers == recv_buffers_device) + if (recv_buffers != recv_buffers_mpi) { - hypre_TFree(recv_buffers, HYPRE_MEMORY_HOST); - } - else - { - hypre_TFree(recv_buffers, HYPRE_MEMORY_HOST); - hypre_TFree(recv_buffers_device, HYPRE_MEMORY_HOST); + hypre_TFree(recv_buffers_mpi[0], memory_location_mpi); + hypre_TFree(recv_buffers_mpi, HYPRE_MEMORY_HOST); } + hypre_TFree(send_buffers, HYPRE_MEMORY_HOST); + hypre_TFree(recv_buffers, HYPRE_MEMORY_HOST); + return hypre_error_flag; } @@ -1392,8 +1413,8 @@ hypre_ExchangeLocalData( hypre_CommPkg *comm_pkg, { if (order[ll] > -1) { - fr_dpl = fr_dp + (order[ll])*fr_stride_array[ndim]; - to_dpl = to_dp + ( ll )*to_stride_array[ndim]; + fr_dpl = fr_dp + (order[ll]) * fr_stride_array[ndim]; + to_dpl = to_dp + ( ll ) * to_stride_array[ndim]; #define DEVICE_VAR is_device_ptr(to_dpl,fr_dpl) hypre_BasicBoxLoop2Begin(ndim, length_array, diff --git a/external/hypre/src/struct_mv/struct_communication.h b/external/hypre/src/struct_mv/struct_communication.h index fcb9bf87..fa5ddf1a 100644 --- a/external/hypre/src/struct_mv/struct_communication.h +++ b/external/hypre/src/struct_mv/struct_communication.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -50,7 +50,7 @@ typedef struct hypre_CommEntryType_struct HYPRE_Int offset; /* offset for the data */ HYPRE_Int dim; /* dimension of the communication */ HYPRE_Int length_array[HYPRE_MAXDIM]; /* last dim has length num_values */ - HYPRE_Int stride_array[HYPRE_MAXDIM+1]; + HYPRE_Int stride_array[HYPRE_MAXDIM + 1]; HYPRE_Int *order; /* order of last dim values */ } hypre_CommEntryType; @@ -79,43 +79,50 @@ typedef struct hypre_CommType_struct typedef struct hypre_CommPkg_struct { - MPI_Comm comm; + MPI_Comm comm; - HYPRE_Int first_comm; /* is this the first communication? */ + /* is this the first communication? */ + HYPRE_Int first_comm; - HYPRE_Int ndim; - HYPRE_Int num_values; - hypre_Index send_stride; - hypre_Index recv_stride; + HYPRE_Int ndim; + HYPRE_Int num_values; + hypre_Index send_stride; + hypre_Index recv_stride; - HYPRE_Int send_bufsize; /* total send buffer size (in doubles) */ - HYPRE_Int recv_bufsize; /* total recv buffer size (in doubles) */ - HYPRE_Int send_bufsize_first_comm; /* total send buffer size (in doubles) at the first comm. */ - HYPRE_Int recv_bufsize_first_comm; /* total recv buffer size (in doubles) at the first comm. */ + /* total send buffer size (in doubles) */ + HYPRE_Int send_bufsize; + /* total recv buffer size (in doubles) */ + HYPRE_Int recv_bufsize; + /* total send buffer size (in doubles) at the first comm. */ + HYPRE_Int send_bufsize_first_comm; + /* total recv buffer size (in doubles) at the first comm. */ + HYPRE_Int recv_bufsize_first_comm; - HYPRE_Int num_sends; - HYPRE_Int num_recvs; - hypre_CommType *send_types; - hypre_CommType *recv_types; + HYPRE_Int num_sends; + HYPRE_Int num_recvs; + hypre_CommType *send_types; + hypre_CommType *recv_types; - hypre_CommType *copy_from_type; - hypre_CommType *copy_to_type; + hypre_CommType *copy_from_type; + hypre_CommType *copy_to_type; /* these pointers are just to help free up memory for send/from types */ hypre_CommEntryType *entries; HYPRE_Int *rem_boxnums; hypre_Box *rem_boxes; - HYPRE_Int num_orders; - HYPRE_Int **orders; /* num_orders x num_values */ + HYPRE_Int num_orders; + /* num_orders x num_values */ + HYPRE_Int **orders; - HYPRE_Int *recv_data_offsets; /* offsets into recv data (by box) */ - hypre_BoxArray *recv_data_space; /* recv data dimensions (by box) */ - - hypre_Index identity_coord; - hypre_Index identity_dir; - HYPRE_Int *identity_order; + /* offsets into recv data (by box) */ + HYPRE_Int *recv_data_offsets; + /* recv data dimensions (by box) */ + hypre_BoxArray *recv_data_space; + hypre_Index identity_coord; + hypre_Index identity_dir; + HYPRE_Int *identity_order; } hypre_CommPkg; /*-------------------------------------------------------------------------- @@ -135,9 +142,8 @@ typedef struct hypre_CommHandle_struct HYPRE_Complex **send_buffers; HYPRE_Complex **recv_buffers; - /* these are copies of send/recv buffers on device */ - HYPRE_Complex **send_buffers_device; - HYPRE_Complex **recv_buffers_device; + HYPRE_Complex **send_buffers_mpi; + HYPRE_Complex **recv_buffers_mpi; /* set = 0, add = 1 */ HYPRE_Int action; @@ -248,7 +254,7 @@ typedef struct hypre_CommHandle_struct #define hypre_CommHandleSendBuffers(comm_handle) (comm_handle -> send_buffers) #define hypre_CommHandleRecvBuffers(comm_handle) (comm_handle -> recv_buffers) #define hypre_CommHandleAction(comm_handle) (comm_handle -> action) -#define hypre_CommHandleSendBuffersDevice(comm_handle) (comm_handle -> send_buffers_device) -#define hypre_CommHandleRecvBuffersDevice(comm_handle) (comm_handle -> recv_buffers_device) +#define hypre_CommHandleSendBuffersMPI(comm_handle) (comm_handle -> send_buffers_mpi) +#define hypre_CommHandleRecvBuffersMPI(comm_handle) (comm_handle -> recv_buffers_mpi) #endif diff --git a/external/hypre/src/struct_mv/struct_copy.c b/external/hypre/src/struct_mv/struct_copy.c index a9f30af6..425fc641 100644 --- a/external/hypre/src/struct_mv/struct_copy.c +++ b/external/hypre/src/struct_mv/struct_copy.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/struct_mv/struct_grid.c b/external/hypre/src/struct_mv/struct_grid.c index c98e6b43..254a47fa 100644 --- a/external/hypre/src/struct_mv/struct_grid.c +++ b/external/hypre/src/struct_mv/struct_grid.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -42,7 +42,7 @@ hypre_StructGridCreate( MPI_Comm comm, hypre_StructGridBoxes(grid) = hypre_BoxArrayCreate(0, ndim); hypre_StructGridIDs(grid) = NULL; - hypre_SetIndex(hypre_StructGridMaxDistance(grid),8); + hypre_SetIndex(hypre_StructGridMaxDistance(grid), 8); hypre_StructGridBoundingBox(grid) = NULL; hypre_StructGridLocalSize(grid) = 0; @@ -55,14 +55,11 @@ hypre_StructGridCreate( MPI_Comm comm, hypre_StructGridPShifts(grid) = NULL; hypre_StructGridGhlocalSize(grid) = 0; - for (i = 0; i < 2*ndim; i++) + for (i = 0; i < 2 * ndim; i++) { hypre_StructGridNumGhost(grid)[i] = 1; } -#if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - hypre_StructGridDataLocation(grid) = HYPRE_MEMORY_DEVICE; -#endif *grid_ptr = grid; return hypre_error_flag; @@ -243,7 +240,7 @@ hypre_StructGridAssemble( hypre_StructGrid *grid ) HYPRE_Int *ids = NULL; HYPRE_Int iperiodic, notcenter; - HYPRE_Int sendbuf6[2*HYPRE_MAXDIM], recvbuf6[2*HYPRE_MAXDIM]; + HYPRE_Int sendbuf6[2 * HYPRE_MAXDIM], recvbuf6[2 * HYPRE_MAXDIM]; hypre_Box *box; hypre_Box *ghostbox; @@ -268,7 +265,9 @@ hypre_StructGridAssemble( hypre_StructGrid *grid ) HYPRE_Int *numghost = hypre_StructGridNumGhost(grid); if (!time_index) + { time_index = hypre_InitializeTiming("StructGridAssemble"); + } hypre_BeginTiming(time_index); @@ -293,7 +292,7 @@ hypre_StructGridAssemble( hypre_StructGrid *grid ) if (hypre_StructGridIDs(grid) == NULL) { ids = hypre_CTAlloc(HYPRE_Int, num_local_boxes, HYPRE_MEMORY_HOST); - for (i=0; i< num_local_boxes; i++) + for (i = 0; i < num_local_boxes; i++) { ids[i] = i; } @@ -434,15 +433,15 @@ hypre_StructGridAssemble( hypre_StructGrid *grid ) for (d = 0; d < ndim; d++) { sendbuf6[d] = hypre_BoxIMinD(bounding_box, d); - sendbuf6[d+ndim] = -hypre_BoxIMaxD(bounding_box, d); + sendbuf6[d + ndim] = -hypre_BoxIMaxD(bounding_box, d); } - hypre_MPI_Allreduce(sendbuf6, recvbuf6, 2*ndim, HYPRE_MPI_INT, + hypre_MPI_Allreduce(sendbuf6, recvbuf6, 2 * ndim, HYPRE_MPI_INT, hypre_MPI_MIN, comm); /* unpack buffer */ for (d = 0; d < ndim; d++) { hypre_BoxIMinD(bounding_box, d) = recvbuf6[d]; - hypre_BoxIMaxD(bounding_box, d) = -recvbuf6[d+ndim]; + hypre_BoxIMaxD(bounding_box, d) = -recvbuf6[d + ndim]; } hypre_StructGridBoundingBox(grid) = bounding_box; @@ -470,13 +469,13 @@ hypre_StructGridAssemble( hypre_StructGrid *grid ) myid, i, entry_info ); /* now expand box by max_distance or larger and gather entries */ - hypre_CopyBox(box ,grow_box); + hypre_CopyBox(box, grow_box); hypre_BoxGrowByIndex(grow_box, max_distance); hypre_BoxManGatherEntries(boxman, hypre_BoxIMin(grow_box), hypre_BoxIMax(grow_box)); /* now repeat for any periodic boxes - by shifting the grow_box*/ - for (k=1; k < num_periods; k++) /* k=0 is original box */ + for (k = 1; k < num_periods; k++) /* k=0 is original box */ { hypre_CopyBox(grow_box, periodic_box); pshift = pshifts[k]; @@ -516,13 +515,13 @@ hypre_StructGridAssemble( hypre_StructGrid *grid ) box = hypre_BoxArrayBox(local_boxes, i); /* now expand box by max_distance or larger and gather entries */ - hypre_CopyBox(box ,grow_box); + hypre_CopyBox(box, grow_box); hypre_BoxGrowByIndex(grow_box, max_distance); hypre_BoxManGatherEntries(boxman, hypre_BoxIMin(grow_box), hypre_BoxIMax(grow_box)); /* now repeat for any periodic boxes - by shifting the grow_box*/ - for (k=1; k < num_periods; k++) /* k=0 is original box */ + for (k = 1; k < num_periods; k++) /* k=0 is original box */ { hypre_CopyBox(grow_box, periodic_box); pshift = pshifts[k]; @@ -596,8 +595,8 @@ hypre_GatherAllBoxes(MPI_Comm comm, hypre_MPI_Comm_rank(comm, &my_rank); /* compute recvcounts and displs */ - item_size = 2*ndim + 1; - sendcount = item_size*hypre_BoxArraySize(boxes); + item_size = 2 * ndim + 1; + sendcount = item_size * hypre_BoxArraySize(boxes); recvcounts = hypre_TAlloc(HYPRE_Int, num_all_procs, HYPRE_MEMORY_HOST); displs = hypre_TAlloc(HYPRE_Int, num_all_procs, HYPRE_MEMORY_HOST); hypre_MPI_Allgather(&sendcount, 1, HYPRE_MPI_INT, @@ -606,7 +605,7 @@ hypre_GatherAllBoxes(MPI_Comm comm, recvbuf_size = recvcounts[0]; for (p = 1; p < num_all_procs; p++) { - displs[p] = displs[p-1] + recvcounts[p-1]; + displs[p] = displs[p - 1] + recvcounts[p - 1]; recvbuf_size += recvcounts[p]; } @@ -671,8 +670,8 @@ hypre_GatherAllBoxes(MPI_Comm comm, *-----------------------------------------------------*/ hypre_TFree(sendbuf, HYPRE_MEMORY_HOST); - hypre_TFree(recvbuf, HYPRE_MEMORY_HOST); - hypre_TFree(recvcounts, HYPRE_MEMORY_HOST); + hypre_TFree(recvbuf, HYPRE_MEMORY_HOST); + hypre_TFree(recvcounts, HYPRE_MEMORY_HOST); hypre_TFree(displs, HYPRE_MEMORY_HOST); *all_boxes_ptr = all_boxes; @@ -701,7 +700,8 @@ hypre_ComputeBoxnums(hypre_BoxArray *boxes, HYPRE_Int *boxnums; HYPRE_Int num_boxes; - HYPRE_Int p, b, boxnum; + HYPRE_Int p, b; + HYPRE_Int boxnum = 0; /*----------------------------------------------------- *-----------------------------------------------------*/ @@ -710,7 +710,7 @@ hypre_ComputeBoxnums(hypre_BoxArray *boxes, boxnums = hypre_TAlloc(HYPRE_Int, num_boxes, HYPRE_MEMORY_HOST); p = -1; - for(b = 0; b < num_boxes; b++) + for (b = 0; b < num_boxes; b++) { /* start boxnum count at zero for each new process */ if (procs[b] != p) @@ -847,7 +847,7 @@ hypre_StructGridSetNumGhost( hypre_StructGrid *grid, HYPRE_Int *num_ghost ) { HYPRE_Int i, ndim = hypre_StructGridNDim(grid); - for (i = 0; i < 2*ndim; i++) + for (i = 0; i < 2 * ndim; i++) { hypre_StructGridNumGhost(grid)[i] = num_ghost[i]; } @@ -855,29 +855,28 @@ hypre_StructGridSetNumGhost( hypre_StructGrid *grid, HYPRE_Int *num_ghost ) return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_StructGridGetMaxBoxSize + *--------------------------------------------------------------------------*/ -#if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) HYPRE_Int -hypre_StructGridGetMaxBoxSize(hypre_StructGrid *grid) +hypre_StructGridGetMaxBoxSize( hypre_StructGrid *grid ) { - hypre_Box *box; - hypre_BoxArray *boxes; - HYPRE_Int box_size; - HYPRE_Int i; - HYPRE_Int max_box_size = 0; + hypre_BoxArray *boxes; + hypre_Box *box; + HYPRE_Int i, max_box_size = 0; + boxes = hypre_StructGridBoxes(grid); hypre_ForBoxI(i, boxes) { box = hypre_BoxArrayBox(hypre_StructGridBoxes(grid), i); - box_size = hypre_BoxVolume(box); - if (box_size > max_box_size) - { - max_box_size = box_size; - } + max_box_size = hypre_max(max_box_size, hypre_BoxVolume(box)); } + return max_box_size; } +#if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) HYPRE_Int hypre_StructGridSetDataLocation( HYPRE_StructGrid grid, HYPRE_MemoryLocation data_location ) { diff --git a/external/hypre/src/struct_mv/struct_grid.h b/external/hypre/src/struct_mv/struct_grid.h index 3d4c43b6..d22a4aca 100644 --- a/external/hypre/src/struct_mv/struct_grid.h +++ b/external/hypre/src/struct_mv/struct_grid.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -43,12 +43,9 @@ typedef struct hypre_StructGrid_struct HYPRE_Int ghlocal_size; /* Number of vars in box including ghosts */ - HYPRE_Int num_ghost[2*HYPRE_MAXDIM]; /* ghost layer size */ + HYPRE_Int num_ghost[2 * HYPRE_MAXDIM]; /* ghost layer size */ hypre_BoxManager *boxman; -#if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - HYPRE_MemoryLocation data_location; -#endif } hypre_StructGrid; /*-------------------------------------------------------------------------- diff --git a/external/hypre/src/struct_mv/struct_innerprod.c b/external/hypre/src/struct_mv/struct_innerprod.c index 497cd428..d15b5cc0 100644 --- a/external/hypre/src/struct_mv/struct_innerprod.c +++ b/external/hypre/src/struct_mv/struct_innerprod.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -62,7 +62,7 @@ hypre_StructInnerProd( hypre_StructVector *x, hypre_BoxGetSize(box, loop_size); -#if defined(HYPRE_USING_KOKKOS) +#if defined(HYPRE_USING_KOKKOS) || defined(HYPRE_USING_SYCL) HYPRE_Real box_sum = 0.0; #elif defined(HYPRE_USING_RAJA) ReduceSum box_sum(0.0); @@ -101,7 +101,7 @@ hypre_StructInnerProd( hypre_StructVector *x, hypre_MPI_Allreduce(&process_result, &final_innerprod_result, 1, HYPRE_MPI_REAL, hypre_MPI_SUM, hypre_StructVectorComm(x)); - hypre_IncFLOPCount(2*hypre_StructVectorGlobalSize(x)); + hypre_IncFLOPCount(2 * hypre_StructVectorGlobalSize(x)); return final_innerprod_result; } diff --git a/external/hypre/src/struct_mv/struct_io.c b/external/hypre/src/struct_mv/struct_io.c index 0b69e85c..34046c4f 100644 --- a/external/hypre/src/struct_mv/struct_io.c +++ b/external/hypre/src/struct_mv/struct_io.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -15,6 +15,8 @@ /*-------------------------------------------------------------------------- * hypre_PrintBoxArrayData + * + * Note: data array is expected to live on the host memory. *--------------------------------------------------------------------------*/ HYPRE_Int @@ -37,32 +39,9 @@ hypre_PrintBoxArrayData( FILE *file, HYPRE_Int i, j, d; HYPRE_Complex value; - HYPRE_Complex *data_host; - HYPRE_Complex *data_host_saved = NULL; - - /*---------------------------------------- - * Print data - *----------------------------------------*/ - if (hypre_GetActualMemLocation(HYPRE_MEMORY_DEVICE) != hypre_MEMORY_HOST) - { - HYPRE_Int tot_size = 0; - hypre_ForBoxI(i, data_space) - { - data_box = hypre_BoxArrayBox(data_space, i); - data_box_volume = hypre_BoxVolume(data_box); - tot_size += num_values * data_box_volume; - } - data_host = hypre_CTAlloc(HYPRE_Complex, tot_size, HYPRE_MEMORY_HOST); - hypre_TMemcpy(data_host, data, HYPRE_Complex, tot_size, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); - data_host_saved = data_host; - } - else - { - data_host = data; - } + /* Print data from the host */ hypre_SetIndex(stride, 1); - hypre_ForBoxI(i, box_array) { box = hypre_BoxArrayBox(box_array, i); @@ -87,7 +66,7 @@ hypre_PrintBoxArrayData( FILE *file, hypre_fprintf(file, ", %d", hypre_IndexD(start, d) + hypre_IndexD(index, d)); } - value = data_host[datai + j*data_box_volume]; + value = data[datai + j * data_box_volume]; #ifdef HYPRE_COMPLEX hypre_fprintf(file, "; %d) %.14e , %.14e\n", j, hypre_creal(value), hypre_cimag(value)); @@ -98,18 +77,20 @@ hypre_PrintBoxArrayData( FILE *file, } hypre_SerialBoxLoop1End(datai); - data_host += num_values*data_box_volume; + data += num_values * data_box_volume; } - hypre_TFree(data_host_saved, HYPRE_MEMORY_HOST); - return hypre_error_flag; } /*-------------------------------------------------------------------------- * hypre_PrintCCVDBoxArrayData - * Note that the the stencil loop (j) is _outside_ the space index loop (datai), - * unlie hypre_PrintBoxArrayData (there is no j loop in hypre_PrintCCBoxArrayData) + * + * Note that the the stencil loop (j) is _outside_ the space index loop + * (datai), unlike hypre_PrintBoxArrayData (there is no j loop in + * hypre_PrintCCBoxArrayData) + * + * Note: data array is expected to live on the host memory. *--------------------------------------------------------------------------*/ HYPRE_Int @@ -123,6 +104,9 @@ hypre_PrintCCVDBoxArrayData( FILE *file, HYPRE_Int dim, HYPRE_Complex *data ) { + HYPRE_UNUSED_VAR(num_values); + HYPRE_UNUSED_VAR(data_space); + hypre_Box *box; hypre_Box *data_box; @@ -143,9 +127,9 @@ hypre_PrintCCVDBoxArrayData( FILE *file, hypre_SetIndex(stride, 1); /* First is the constant, off-diagonal, part of the matrix: */ - for ( j=0; j 0) { - hypre_TFree(hypre_StructMatrixDataIndices(matrix)[0],HYPRE_MEMORY_HOST); + hypre_TFree(hypre_StructMatrixDataIndices(matrix)[0], HYPRE_MEMORY_HOST); } - hypre_TFree(hypre_StructMatrixDataIndices(matrix),HYPRE_MEMORY_HOST); + hypre_TFree(hypre_StructMatrixDataIndices(matrix), HYPRE_MEMORY_HOST); hypre_BoxArrayDestroy(hypre_StructMatrixDataSpace(matrix)); hypre_TFree(hypre_StructMatrixSymmElements(matrix), HYPRE_MEMORY_HOST); hypre_StructStencilDestroy(hypre_StructMatrixUserStencil(matrix)); @@ -142,7 +144,7 @@ hypre_StructMatrixInitializeShell( hypre_StructMatrix *matrix ) HYPRE_Int constant_coefficient; HYPRE_Int *num_ghost; - HYPRE_Int extra_ghost[2*HYPRE_MAXDIM]; + HYPRE_Int extra_ghost[2 * HYPRE_MAXDIM]; hypre_BoxArray *data_space; hypre_BoxArray *boxes; @@ -211,7 +213,7 @@ hypre_StructMatrixInitializeShell( hypre_StructMatrix *matrix ) stencil_data = hypre_TAlloc(HYPRE_Complex*, stencil_size, HYPRE_MEMORY_HOST); hypre_StructMatrixStencilData(matrix) = stencil_data; - for (d = 0; d < 2*ndim; d++) + for (d = 0; d < 2 * ndim; d++) { extra_ghost[d] = 0; } @@ -222,18 +224,18 @@ hypre_StructMatrixInitializeShell( hypre_StructMatrix *matrix ) { for (d = 0; d < ndim; d++) { - extra_ghost[2*d] = hypre_max( extra_ghost[2*d], - -hypre_IndexD(stencil_shape[i], d) ); - extra_ghost[2*d + 1] = hypre_max( extra_ghost[2*d + 1], - hypre_IndexD(stencil_shape[i], d) ); + extra_ghost[2 * d] = hypre_max( extra_ghost[2 * d], + -hypre_IndexD(stencil_shape[i], d) ); + extra_ghost[2 * d + 1] = hypre_max( extra_ghost[2 * d + 1], + hypre_IndexD(stencil_shape[i], d) ); } } } for (d = 0; d < ndim; d++) { - num_ghost[2*d] += extra_ghost[2*d]; - num_ghost[2*d + 1] += extra_ghost[2*d + 1]; + num_ghost[2 * d] += extra_ghost[2 * d]; + num_ghost[2 * d + 1] += extra_ghost[2 * d + 1]; } /*----------------------------------------------------------------------- @@ -253,8 +255,8 @@ hypre_StructMatrixInitializeShell( hypre_StructMatrix *matrix ) hypre_CopyBox(box, data_box); for (d = 0; d < ndim; d++) { - hypre_BoxIMinD(data_box, d) -= num_ghost[2*d]; - hypre_BoxIMaxD(data_box, d) += num_ghost[2*d + 1]; + hypre_BoxIMinD(data_box, d) -= num_ghost[2 * d]; + hypre_BoxIMaxD(data_box, d) += num_ghost[2 * d + 1]; } } @@ -272,7 +274,7 @@ hypre_StructMatrixInitializeShell( hypre_StructMatrix *matrix ) HYPRE_MEMORY_HOST); if (hypre_BoxArraySize(data_space) > 0) { - data_indices[0] = hypre_TAlloc(HYPRE_Int, stencil_size*hypre_BoxArraySize(data_space), + data_indices[0] = hypre_TAlloc(HYPRE_Int, stencil_size * hypre_BoxArraySize(data_space), HYPRE_MEMORY_HOST); } constant_coefficient = hypre_StructMatrixConstantCoefficient(matrix); @@ -385,7 +387,7 @@ hypre_StructMatrixInitializeShell( hypre_StructMatrix *matrix ) if (hypre_IndexEqual(stencil_shape[j], 0, ndim)) { data_indices[i][j] = data_indices[i][symm_elements[j]] + - hypre_BoxOffsetDistance(data_box, stencil_shape[j]); + hypre_BoxOffsetDistance(data_box, stencil_shape[j]); } /* off-diagonal, constant coefficient */ else @@ -532,8 +534,10 @@ hypre_StructMatrixInitialize( hypre_StructMatrix *matrix ) hypre_StructMatrixInitializeShell(matrix); - data = hypre_CTAlloc(HYPRE_Complex, hypre_StructMatrixDataSize(matrix), HYPRE_MEMORY_DEVICE); - data_const = hypre_CTAlloc(HYPRE_Complex, hypre_StructMatrixDataConstSize(matrix), HYPRE_MEMORY_HOST); + data = hypre_CTAlloc(HYPRE_Complex, hypre_StructMatrixDataSize(matrix), + hypre_StructMatrixMemoryLocation(matrix)); + data_const = hypre_CTAlloc(HYPRE_Complex, hypre_StructMatrixDataConstSize(matrix), + HYPRE_MEMORY_HOST); hypre_StructMatrixInitializeData(matrix, data, data_const); @@ -568,10 +572,11 @@ hypre_StructMatrixSetValues( hypre_StructMatrix *matrix, HYPRE_Int center_rank; HYPRE_Int *symm_elements; HYPRE_Int constant_coefficient; - HYPRE_Complex *matp; - HYPRE_Int i, s, istart, istop; +#if defined(HYPRE_USING_GPU) + HYPRE_MemoryLocation memory_location = hypre_StructMatrixMemoryLocation(matrix); +#endif /*----------------------------------------------------------------------- * Initialize some things @@ -605,7 +610,7 @@ hypre_StructMatrixSetValues( hypre_StructMatrix *matrix, *-----------------------------------------------------------------------*/ center_rank = 0; - if ( constant_coefficient==2 ) + if ( constant_coefficient == 2 ) { hypre_SetIndex(center_index, 0); stencil = hypre_StructMatrixStencil(matrix); @@ -623,8 +628,8 @@ hypre_StructMatrixSetValues( hypre_StructMatrix *matrix, /* only set stored stencil values */ if (symm_elements[stencil_indices[s]] < 0) { - if ( (constant_coefficient==1) || - (constant_coefficient==2 && stencil_indices[s]!=center_rank) ) + if ( (constant_coefficient == 1) || + (constant_coefficient == 2 && stencil_indices[s] != center_rank) ) { /* call SetConstantValues instead */ hypre_error(HYPRE_ERROR_GENERIC); @@ -635,7 +640,8 @@ hypre_StructMatrixSetValues( hypre_StructMatrix *matrix, matp = hypre_StructMatrixBoxDataValue(matrix, i, stencil_indices[s], grid_index); } - if (hypre_GetActualMemLocation(HYPRE_MEMORY_DEVICE) != hypre_MEMORY_HOST) +#if defined(HYPRE_USING_GPU) + if (hypre_GetExecPolicy1(memory_location) == HYPRE_EXEC_DEVICE) { if (action > 0) { @@ -649,14 +655,15 @@ hypre_StructMatrixSetValues( hypre_StructMatrix *matrix, } else if (action > -1) { - hypre_TMemcpy(matp, values + s, HYPRE_Complex, 1, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(matp, values + s, HYPRE_Complex, 1, memory_location, memory_location); } else /* action < 0 */ { - hypre_TMemcpy(values + s, matp, HYPRE_Complex, 1, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(values + s, matp, HYPRE_Complex, 1, memory_location, memory_location); } } else +#endif { if (action > 0) { @@ -705,7 +712,7 @@ hypre_StructMatrixSetBoxValues( hypre_StructMatrix *matrix, hypre_Box *int_box; hypre_Index center_index; hypre_StructStencil *stencil; - HYPRE_Int center_rank; + HYPRE_Int center_rank = 0; HYPRE_Int *symm_elements; hypre_BoxArray *data_space; @@ -781,11 +788,11 @@ hypre_StructMatrixSetBoxValues( hypre_StructMatrix *matrix, hypre_CopyIndex(data_start, dval_start); hypre_IndexD(dval_start, 0) *= num_stencil_indices; - if ( constant_coefficient==2 ) + if (constant_coefficient == 2) { hypre_SetIndex(center_index, 0); stencil = hypre_StructMatrixStencil(matrix); - center_rank = hypre_StructStencilElementRank( stencil, center_index ); + center_rank = hypre_StructStencilElementRank(stencil, center_index); } for (s = 0; s < num_stencil_indices; s++) @@ -795,8 +802,8 @@ hypre_StructMatrixSetBoxValues( hypre_StructMatrix *matrix, { datap = hypre_StructMatrixBoxData(matrix, i, stencil_indices[s]); - if ( (constant_coefficient==1) || - (constant_coefficient==2 && stencil_indices[s]!=center_rank )) + if ( (constant_coefficient == 1) || + (constant_coefficient == 2 && stencil_indices[s] != center_rank )) /* datap has only one data point for a given i and s */ { /* should have called SetConstantValues */ @@ -805,20 +812,20 @@ hypre_StructMatrixSetBoxValues( hypre_StructMatrix *matrix, if (action > 0) { - datai = hypre_CCBoxIndexRank(data_box,data_start); - dvali = hypre_BoxIndexRank(dval_box,dval_start); + datai = hypre_CCBoxIndexRank(data_box, data_start); + dvali = hypre_BoxIndexRank(dval_box, dval_start); datap[datai] += values[dvali]; } else if (action > -1) { - datai = hypre_CCBoxIndexRank(data_box,data_start); - dvali = hypre_BoxIndexRank(dval_box,dval_start); + datai = hypre_CCBoxIndexRank(data_box, data_start); + dvali = hypre_BoxIndexRank(dval_box, dval_start); datap[datai] = values[dvali]; } else { - datai = hypre_CCBoxIndexRank(data_box,data_start); - dvali = hypre_BoxIndexRank(dval_box,dval_start); + datai = hypre_CCBoxIndexRank(data_box, data_start); + dvali = hypre_BoxIndexRank(dval_box, dval_start); values[dvali] = datap[datai]; if (action == -2) { @@ -836,8 +843,8 @@ hypre_StructMatrixSetBoxValues( hypre_StructMatrix *matrix, if (action > 0) { hypre_BoxLoop2Begin(hypre_StructMatrixNDim(matrix), loop_size, - data_box,data_start,data_stride,datai, - dval_box,dval_start,dval_stride,dvali); + data_box, data_start, data_stride, datai, + dval_box, dval_start, dval_stride, dvali); { datap[datai] += values[dvali]; } @@ -846,8 +853,8 @@ hypre_StructMatrixSetBoxValues( hypre_StructMatrix *matrix, else if (action > -1) { hypre_BoxLoop2Begin(hypre_StructMatrixNDim(matrix), loop_size, - data_box,data_start,data_stride,datai, - dval_box,dval_start,dval_stride,dvali); + data_box, data_start, data_stride, datai, + dval_box, dval_start, dval_stride, dvali); { datap[datai] = values[dvali]; } @@ -856,8 +863,8 @@ hypre_StructMatrixSetBoxValues( hypre_StructMatrix *matrix, else if (action == -2) { hypre_BoxLoop2Begin(hypre_StructMatrixNDim(matrix), loop_size, - data_box,data_start,data_stride,datai, - dval_box,dval_start,dval_stride,dvali); + data_box, data_start, data_stride, datai, + dval_box, dval_start, dval_stride, dvali); { values[dvali] = datap[datai]; datap[datai] = 0; @@ -867,8 +874,8 @@ hypre_StructMatrixSetBoxValues( hypre_StructMatrix *matrix, else { hypre_BoxLoop2Begin(hypre_StructMatrixNDim(matrix), loop_size, - data_box,data_start,data_stride,datai, - dval_box,dval_start,dval_stride,dvali); + data_box, data_start, data_stride, datai, + dval_box, dval_start, dval_stride, dvali); { values[dvali] = datap[datai]; } @@ -918,7 +925,7 @@ hypre_StructMatrixSetConstantValues( hypre_StructMatrix *matrix, boxes = hypre_StructGridBoxes(hypre_StructMatrixGrid(matrix)); constant_coefficient = hypre_StructMatrixConstantCoefficient(matrix); - if ( constant_coefficient==1 ) + if ( constant_coefficient == 1 ) { hypre_ForBoxI(i, boxes) { @@ -952,7 +959,7 @@ hypre_StructMatrixSetConstantValues( hypre_StructMatrix *matrix, } } } - else if ( constant_coefficient==2 ) + else if ( constant_coefficient == 2 ) { hypre_SetIndex(center_index, 0); stencil = hypre_StructMatrixStencil(matrix); @@ -962,7 +969,8 @@ hypre_StructMatrixSetConstantValues( hypre_StructMatrix *matrix, for (s = 0; s < num_stencil_indices; s++) { if ( stencil_indices[s] == center_rank ) - { /* center (diagonal), like constant_coefficient==0 + { + /* center (diagonal), like constant_coefficient==0 We consider it an error, but do the best we can. */ hypre_error(HYPRE_ERROR_GENERIC); hypre_ForBoxI(i, boxes) @@ -975,7 +983,8 @@ hypre_StructMatrixSetConstantValues( hypre_StructMatrix *matrix, } } else - { /* non-center, like constant_coefficient==1 */ + { + /* non-center, like constant_coefficient==1 */ matp = hypre_StructMatrixBoxData(matrix, 0, stencil_indices[s]); *matp += values[s]; @@ -987,7 +996,8 @@ hypre_StructMatrixSetConstantValues( hypre_StructMatrix *matrix, for (s = 0; s < num_stencil_indices; s++) { if ( stencil_indices[s] == center_rank ) - { /* center (diagonal), like constant_coefficient==0 + { + /* center (diagonal), like constant_coefficient==0 We consider it an error, but do the best we can. */ hypre_error(HYPRE_ERROR_GENERIC); hypre_ForBoxI(i, boxes) @@ -1000,7 +1010,8 @@ hypre_StructMatrixSetConstantValues( hypre_StructMatrix *matrix, } } else - { /* non-center, like constant_coefficient==1 */ + { + /* non-center, like constant_coefficient==1 */ matp = hypre_StructMatrixBoxData(matrix, 0, stencil_indices[s]); *matp += values[s]; @@ -1012,7 +1023,8 @@ hypre_StructMatrixSetConstantValues( hypre_StructMatrix *matrix, for (s = 0; s < num_stencil_indices; s++) { if ( stencil_indices[s] == center_rank ) - { /* center (diagonal), like constant_coefficient==0 + { + /* center (diagonal), like constant_coefficient==0 We consider it an error, but do the best we can. */ hypre_error(HYPRE_ERROR_GENERIC); hypre_ForBoxI(i, boxes) @@ -1025,7 +1037,8 @@ hypre_StructMatrixSetConstantValues( hypre_StructMatrix *matrix, } } else - { /* non-center, like constant_coefficient==1 */ + { + /* non-center, like constant_coefficient==1 */ matp = hypre_StructMatrixBoxData(matrix, 0, stencil_indices[s]); values[s] = *matp; @@ -1201,7 +1214,7 @@ hypre_StructMatrixClearBoxValues( hypre_StructMatrix *matrix, #define DEVICE_VAR is_device_ptr(datap) hypre_BoxLoop1Begin(hypre_StructMatrixNDim(matrix), loop_size, - data_box,data_start,data_stride,datai); + data_box, data_start, data_stride, datai); { datap[datai] = 0.0; } @@ -1271,14 +1284,14 @@ hypre_StructMatrixAssemble( hypre_StructMatrix *matrix ) * the neighbors from the box to get the boundary boxes. *-----------------------------------------------------------------------*/ - if ( constant_coefficient!=1 ) + if ( constant_coefficient != 1 ) { data_space = hypre_StructMatrixDataSpace(matrix); grid = hypre_StructMatrixGrid(matrix); boxman = hypre_StructGridBoxMan(grid); boundary_boxes = hypre_BoxArrayArrayCreate( - hypre_BoxArraySize(data_space), ndim); + hypre_BoxArraySize(data_space), ndim); entry_box_a = hypre_BoxArrayCreate(0, ndim); tmp_box_a = hypre_BoxArrayCreate(0, ndim); hypre_ForBoxI(i, data_space) @@ -1292,7 +1305,7 @@ hypre_StructMatrixAssemble( hypre_StructMatrix *matrix ) hypre_BoxManIntersect(boxman, hypre_BoxIMin(boundary_box), hypre_BoxIMax(boundary_box), - &entries , &num_entries); + &entries, &num_entries); /* put neighbor boxes into entry_box_a */ hypre_BoxArraySetSize(entry_box_a, num_entries); @@ -1360,7 +1373,7 @@ hypre_StructMatrixAssemble( hypre_StructMatrix *matrix ) mat_num_values = hypre_StructMatrixNumValues(matrix); - if ( constant_coefficient==0 ) + if ( constant_coefficient == 0 ) { comm_num_values = mat_num_values; #if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) @@ -1370,7 +1383,7 @@ hypre_StructMatrixAssemble( hypre_StructMatrix *matrix ) } #endif } - else if ( constant_coefficient==1 ) + else if ( constant_coefficient == 1 ) { comm_num_values = 0; } @@ -1414,7 +1427,7 @@ hypre_StructMatrixAssemble( hypre_StructMatrix *matrix ) * a matrix with a very similar one, we may not want to recompute comm_pkg. *-----------------------------------------------------------------------*/ - if ( constant_coefficient!=1 ) + if ( constant_coefficient != 1 ) { hypre_InitializeCommunication( comm_pkg, matrix_data_comm, @@ -1438,8 +1451,8 @@ hypre_StructMatrixSetNumGhost( hypre_StructMatrix *matrix, for (d = 0; d < ndim; d++) { - hypre_StructMatrixNumGhost(matrix)[2*d] = num_ghost[2*d]; - hypre_StructMatrixNumGhost(matrix)[2*d + 1] = num_ghost[2*d + 1]; + hypre_StructMatrixNumGhost(matrix)[2 * d] = num_ghost[2 * d]; + hypre_StructMatrixNumGhost(matrix)[2 * d + 1] = num_ghost[2 * d + 1]; } return hypre_error_flag; @@ -1495,39 +1508,39 @@ HYPRE_Int hypre_StructMatrixSetConstantEntries( hypre_StructMatrix *matrix, hypre_Index diag_index; HYPRE_Int i, j; - for ( i=0; i=stencil_size ) + else if ( nconst >= stencil_size ) { - constant_coefficient=1; + constant_coefficient = 1; } else { hypre_SetIndex(diag_index, 0); diag_rank = hypre_StructStencilElementRank( stencil, diag_index ); - if ( offdconst[diag_rank]==0 ) + if ( offdconst[diag_rank] == 0 ) { - constant_coefficient=2; - if ( nconst!=(stencil_size-1) ) + constant_coefficient = 2; + if ( nconst != (stencil_size - 1) ) { hypre_error(HYPRE_ERROR_GENERIC); } } else { - constant_coefficient=0; + constant_coefficient = 0; hypre_error(HYPRE_ERROR_GENERIC); } } @@ -1608,6 +1621,146 @@ hypre_StructMatrixClearGhostValues( hypre_StructMatrix *matrix ) return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_StructMatrixPrintData + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixPrintData( FILE *file, + hypre_StructMatrix *matrix, + HYPRE_Int all ) +{ + HYPRE_Int ndim = hypre_StructMatrixNDim(matrix); + HYPRE_Int num_values = hypre_StructMatrixNumValues(matrix); + HYPRE_Int ctecoef = hypre_StructMatrixConstantCoefficient(matrix); + hypre_StructGrid *grid = hypre_StructMatrixGrid(matrix); + hypre_StructStencil *stencil = hypre_StructMatrixStencil(matrix); + HYPRE_Int stencil_size = hypre_StructStencilSize(stencil); + HYPRE_Int *symm_elements = hypre_StructMatrixSymmElements(matrix); + hypre_BoxArray *data_space = hypre_StructMatrixDataSpace(matrix); + HYPRE_Int data_size = hypre_StructMatrixDataSize(matrix); + hypre_BoxArray *grid_boxes = hypre_StructGridBoxes(grid); + HYPRE_Complex *data = hypre_StructMatrixData(matrix); + HYPRE_MemoryLocation memory_location = hypre_StructMatrixMemoryLocation(matrix); + hypre_BoxArray *boxes; + hypre_Index center_index; + HYPRE_Int center_rank; + HYPRE_Complex *h_data; + + /* Allocate/Point to data on the host memory */ + if (hypre_GetActualMemLocation(memory_location) != hypre_MEMORY_HOST) + { + h_data = hypre_CTAlloc(HYPRE_Complex, data_size, HYPRE_MEMORY_HOST); + hypre_TMemcpy(h_data, data, HYPRE_Complex, data_size, + HYPRE_MEMORY_HOST, memory_location); + } + else + { + h_data = data; + } + + /* Print ghost data (all) also or only real data? */ + boxes = (all) ? data_space : grid_boxes; + + /* Print data to file */ + if (ctecoef == 1) + { + hypre_PrintCCBoxArrayData(file, boxes, data_space, num_values, h_data); + } + else if (ctecoef == 2) + { + hypre_SetIndex(center_index, 0); + center_rank = hypre_StructStencilElementRank(stencil, center_index); + + hypre_PrintCCVDBoxArrayData(file, boxes, data_space, num_values, + center_rank, stencil_size, symm_elements, + ndim, h_data); + } + else + { + hypre_PrintBoxArrayData(file, boxes, data_space, num_values, + ndim, h_data); + } + + /* Free memory */ + if (hypre_GetActualMemLocation(memory_location) != hypre_MEMORY_HOST) + { + hypre_TFree(h_data, HYPRE_MEMORY_HOST); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_StructMatrixReadData + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixReadData( FILE *file, + hypre_StructMatrix *matrix ) +{ + HYPRE_Int ndim = hypre_StructMatrixNDim(matrix); + HYPRE_Int num_values = hypre_StructMatrixNumValues(matrix); + HYPRE_Int ctecoef = hypre_StructMatrixConstantCoefficient(matrix); + hypre_StructGrid *grid = hypre_StructMatrixGrid(matrix); + hypre_StructStencil *stencil = hypre_StructMatrixStencil(matrix); + HYPRE_Int stencil_size = hypre_StructStencilSize(stencil); + HYPRE_Int symmetric = hypre_StructMatrixSymmetric(matrix); + hypre_BoxArray *data_space = hypre_StructMatrixDataSpace(matrix); + hypre_BoxArray *boxes = hypre_StructGridBoxes(grid); + HYPRE_Complex *data = hypre_StructMatrixData(matrix); + HYPRE_Int data_size = hypre_StructMatrixDataSize(matrix); + HYPRE_MemoryLocation memory_location = hypre_StructMatrixMemoryLocation(matrix); + HYPRE_Complex *h_data; + HYPRE_Int real_stencil_size; + + /* Allocate/Point to data on the host memory */ + if (hypre_GetActualMemLocation(memory_location) != hypre_MEMORY_HOST) + { + h_data = hypre_CTAlloc(HYPRE_Complex, data_size, HYPRE_MEMORY_HOST); + } + else + { + h_data = data; + } + + /* real_stencil_size is the stencil size of the matrix after it's fixed up + by the call (if any) of hypre_StructStencilSymmetrize from + hypre_StructMatrixInitializeShell.*/ + if (symmetric) + { + real_stencil_size = 2 * stencil_size - 1; + } + else + { + real_stencil_size = stencil_size; + } + + /* Read data from file */ + if (ctecoef == 0) + { + hypre_ReadBoxArrayData(file, boxes, data_space, + num_values, ndim, h_data); + } + else + { + hypre_assert(ctecoef <= 2); + hypre_ReadBoxArrayData_CC(file, boxes, data_space, + stencil_size, real_stencil_size, + ctecoef, ndim, h_data); + } + + /* Move data to the device memory if necessary and free host data */ + if (hypre_GetActualMemLocation(memory_location) != hypre_MEMORY_HOST) + { + hypre_TMemcpy(data, h_data, HYPRE_Complex, data_size, + memory_location, HYPRE_MEMORY_HOST); + hypre_TFree(h_data, HYPRE_MEMORY_HOST); + } + + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- * hypre_StructMatrixPrint *--------------------------------------------------------------------------*/ @@ -1621,26 +1774,18 @@ hypre_StructMatrixPrint( const char *filename, char new_filename[255]; hypre_StructGrid *grid; - hypre_BoxArray *boxes; hypre_StructStencil *stencil; hypre_Index *stencil_shape; HYPRE_Int stencil_size; - hypre_Index center_index; HYPRE_Int ndim, num_values; - hypre_BoxArray *data_space; - HYPRE_Int *symm_elements; HYPRE_Int i, j, d; - HYPRE_Int constant_coefficient; - HYPRE_Int center_rank; HYPRE_Int myid; - constant_coefficient = hypre_StructMatrixConstantCoefficient(matrix); - /*---------------------------------------- * Open file *----------------------------------------*/ @@ -1681,7 +1826,7 @@ hypre_StructMatrixPrint( const char *filename, hypre_fprintf(file, "%d\n", num_values); stencil_size = hypre_StructStencilSize(stencil); j = 0; - for (i=0; i stencil) #define hypre_StructMatrixNumValues(matrix) ((matrix) -> num_values) #define hypre_StructMatrixDataSpace(matrix) ((matrix) -> data_space) +#define hypre_StructMatrixMemoryLocation(matrix) ((matrix) -> memory_location) #define hypre_StructMatrixData(matrix) ((matrix) -> data) #define hypre_StructMatrixDataConst(matrix) ((matrix) -> data_const) #define hypre_StructMatrixStencilData(matrix) ((matrix) -> stencil_data) diff --git a/external/hypre/src/struct_mv/struct_matrix_mask.c b/external/hypre/src/struct_mv/struct_matrix_mask.c index dff84266..fda89755 100644 --- a/external/hypre/src/struct_mv/struct_matrix_mask.c +++ b/external/hypre/src/struct_mv/struct_matrix_mask.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -56,7 +56,7 @@ hypre_StructMatrixCreateMask( hypre_StructMatrix *matrix, stencil_size = hypre_StructStencilSize(stencil); stencil_data = hypre_StructMatrixStencilData(matrix); - mask = hypre_CTAlloc(hypre_StructMatrix, 1, HYPRE_MEMORY_HOST); + mask = hypre_CTAlloc(hypre_StructMatrix, 1, HYPRE_MEMORY_HOST); hypre_StructMatrixComm(mask) = hypre_StructMatrixComm(matrix); @@ -67,7 +67,7 @@ hypre_StructMatrixCreateMask( hypre_StructMatrix *matrix, hypre_StructStencilRef(hypre_StructMatrixUserStencil(matrix)); mask_stencil_size = num_stencil_indices; - mask_stencil_shape = hypre_CTAlloc(hypre_Index, num_stencil_indices, HYPRE_MEMORY_HOST); + mask_stencil_shape = hypre_CTAlloc(hypre_Index, num_stencil_indices, HYPRE_MEMORY_HOST); for (i = 0; i < num_stencil_indices; i++) { hypre_CopyIndex(stencil_shape[stencil_indices[i]], @@ -83,9 +83,11 @@ hypre_StructMatrixCreateMask( hypre_StructMatrix *matrix, hypre_StructMatrixDataSpace(mask) = hypre_BoxArrayDuplicate(hypre_StructMatrixDataSpace(matrix)); + hypre_StructMatrixMemoryLocation(mask) = hypre_StructMatrixMemoryLocation(matrix); + hypre_StructMatrixData(mask) = hypre_StructMatrixData(matrix); hypre_StructMatrixDataConst(mask) = hypre_StructMatrixDataConst(matrix); - + hypre_StructMatrixDataAlloced(mask) = 0; hypre_StructMatrixDataSize(mask) = hypre_StructMatrixDataSize(matrix); hypre_StructMatrixDataConstSize(mask) = hypre_StructMatrixDataConstSize(matrix); @@ -94,11 +96,15 @@ hypre_StructMatrixCreateMask( hypre_StructMatrix *matrix, mask_data_indices = hypre_CTAlloc(HYPRE_Int *, hypre_BoxArraySize(data_space), HYPRE_MEMORY_HOST); mask_stencil_data = hypre_TAlloc(HYPRE_Complex*, mask_stencil_size, HYPRE_MEMORY_HOST); if (hypre_BoxArraySize(data_space) > 0) - mask_data_indices[0] = hypre_TAlloc(HYPRE_Int, num_stencil_indices*hypre_BoxArraySize(data_space), HYPRE_MEMORY_HOST); - + { + mask_data_indices[0] = hypre_TAlloc(HYPRE_Int, + num_stencil_indices * hypre_BoxArraySize(data_space), + HYPRE_MEMORY_HOST); + } + hypre_ForBoxI(i, data_space) { - mask_data_indices[i] = mask_data_indices[0] + num_stencil_indices*i; + mask_data_indices[i] = mask_data_indices[0] + num_stencil_indices * i; for (j = 0; j < num_stencil_indices; j++) { mask_data_indices[i][j] = data_indices[i][stencil_indices[j]]; @@ -121,7 +127,7 @@ hypre_StructMatrixCreateMask( hypre_StructMatrix *matrix, hypre_StructMatrixSymmElements(matrix)[i]; } - for (i = 0; i < 2*ndim; i++) + for (i = 0; i < 2 * ndim; i++) { hypre_StructMatrixNumGhost(mask)[i] = hypre_StructMatrixNumGhost(matrix)[i]; diff --git a/external/hypre/src/struct_mv/struct_matvec.c b/external/hypre/src/struct_mv/struct_matvec.c index 6434bf14..7fd38a04 100644 --- a/external/hypre/src/struct_mv/struct_matvec.c +++ b/external/hypre/src/struct_mv/struct_matvec.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -37,7 +37,7 @@ typedef struct *--------------------------------------------------------------------------*/ void * -hypre_StructMatvecCreate( ) +hypre_StructMatvecCreate( void ) { hypre_StructMatvecData *matvec_data; @@ -62,6 +62,8 @@ hypre_StructMatvecSetup( void *matvec_vdata, hypre_ComputeInfo *compute_info; hypre_ComputePkg *compute_pkg; + HYPRE_ANNOTATE_FUNC_BEGIN; + /*---------------------------------------------------------- * Set up the compute package *----------------------------------------------------------*/ @@ -81,6 +83,8 @@ hypre_StructMatvecSetup( void *matvec_vdata, (matvec_data -> x) = hypre_StructVectorRef(x); (matvec_data -> compute_pkg) = compute_pkg; + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; } @@ -125,8 +129,10 @@ hypre_StructMatvecCompute( void *matvec_vdata, * Initialize some things *-----------------------------------------------------------------------*/ + HYPRE_ANNOTATE_FUNC_BEGIN; + constant_coefficient = hypre_StructMatrixConstantCoefficient(A); - if (constant_coefficient) hypre_StructVectorClearBoundGhostValues(x, 0); + if (constant_coefficient) { hypre_StructVectorClearBoundGhostValues(x, 0); } compute_pkg = (matvec_data -> compute_pkg); @@ -173,7 +179,7 @@ hypre_StructMatvecCompute( void *matvec_vdata, for (compute_i = 0; compute_i < 2; compute_i++) { - switch(compute_i) + switch (compute_i) { case 0: { @@ -187,7 +193,7 @@ hypre_StructMatvecCompute( void *matvec_vdata, * beta*y for constant coefficient (where only Ax gets multiplied by alpha) *--------------------------------------------------------------*/ - if ( constant_coefficient==1 ) + if ( constant_coefficient == 1 ) { temp = beta; } @@ -248,7 +254,7 @@ hypre_StructMatvecCompute( void *matvec_vdata, * y += A*x *--------------------------------------------------------------------*/ - switch( constant_coefficient ) + switch ( constant_coefficient ) { case 0: { @@ -275,6 +281,8 @@ hypre_StructMatvecCompute( void *matvec_vdata, x = y; } + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; } @@ -290,7 +298,7 @@ HYPRE_Int hypre_StructMatvecCC0( HYPRE_Complex alpha, hypre_StructVector *y, hypre_BoxArrayArray *compute_box_aa, hypre_IndexRef stride - ) + ) { HYPRE_Int i, j, si; HYPRE_Complex *Ap0; @@ -348,34 +356,34 @@ HYPRE_Int hypre_StructMatvecCC0( HYPRE_Complex alpha, start = hypre_BoxIMin(compute_box); /* unroll up to depth MAX_DEPTH */ - for (si = 0; si < stencil_size; si+= MAX_DEPTH) + for (si = 0; si < stencil_size; si += MAX_DEPTH) { - depth = hypre_min(MAX_DEPTH, (stencil_size -si)); - switch(depth) + depth = hypre_min(MAX_DEPTH, (stencil_size - si)); + switch (depth) { case 7: - Ap0 = hypre_StructMatrixBoxData(A, i, si+0); - Ap1 = hypre_StructMatrixBoxData(A, i, si+1); - Ap2 = hypre_StructMatrixBoxData(A, i, si+2); - Ap3 = hypre_StructMatrixBoxData(A, i, si+3); - Ap4 = hypre_StructMatrixBoxData(A, i, si+4); - Ap5 = hypre_StructMatrixBoxData(A, i, si+5); - Ap6 = hypre_StructMatrixBoxData(A, i, si+6); + Ap0 = hypre_StructMatrixBoxData(A, i, si + 0); + Ap1 = hypre_StructMatrixBoxData(A, i, si + 1); + Ap2 = hypre_StructMatrixBoxData(A, i, si + 2); + Ap3 = hypre_StructMatrixBoxData(A, i, si + 3); + Ap4 = hypre_StructMatrixBoxData(A, i, si + 4); + Ap5 = hypre_StructMatrixBoxData(A, i, si + 5); + Ap6 = hypre_StructMatrixBoxData(A, i, si + 6); xoff0 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+0]); + stencil_shape[si + 0]); xoff1 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+1]); + stencil_shape[si + 1]); xoff2 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+2]); + stencil_shape[si + 2]); xoff3 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+3]); + stencil_shape[si + 3]); xoff4 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+4]); + stencil_shape[si + 4]); xoff5 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+5]); + stencil_shape[si + 5]); xoff6 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+6]); + stencil_shape[si + 6]); #define DEVICE_VAR is_device_ptr(yp,Ap0,Ap1,Ap2,Ap3,Ap4,Ap5,Ap6,xp) hypre_BoxLoop3Begin(ndim, loop_size, @@ -398,25 +406,25 @@ HYPRE_Int hypre_StructMatvecCC0( HYPRE_Complex alpha, break; case 6: - Ap0 = hypre_StructMatrixBoxData(A, i, si+0); - Ap1 = hypre_StructMatrixBoxData(A, i, si+1); - Ap2 = hypre_StructMatrixBoxData(A, i, si+2); - Ap3 = hypre_StructMatrixBoxData(A, i, si+3); - Ap4 = hypre_StructMatrixBoxData(A, i, si+4); - Ap5 = hypre_StructMatrixBoxData(A, i, si+5); + Ap0 = hypre_StructMatrixBoxData(A, i, si + 0); + Ap1 = hypre_StructMatrixBoxData(A, i, si + 1); + Ap2 = hypre_StructMatrixBoxData(A, i, si + 2); + Ap3 = hypre_StructMatrixBoxData(A, i, si + 3); + Ap4 = hypre_StructMatrixBoxData(A, i, si + 4); + Ap5 = hypre_StructMatrixBoxData(A, i, si + 5); xoff0 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+0]); + stencil_shape[si + 0]); xoff1 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+1]); + stencil_shape[si + 1]); xoff2 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+2]); + stencil_shape[si + 2]); xoff3 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+3]); + stencil_shape[si + 3]); xoff4 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+4]); + stencil_shape[si + 4]); xoff5 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+5]); + stencil_shape[si + 5]); #define DEVICE_VAR is_device_ptr(yp,Ap0,Ap1,Ap2,Ap3,Ap4,Ap5,xp) hypre_BoxLoop3Begin(ndim, loop_size, @@ -438,22 +446,22 @@ HYPRE_Int hypre_StructMatvecCC0( HYPRE_Complex alpha, break; case 5: - Ap0 = hypre_StructMatrixBoxData(A, i, si+0); - Ap1 = hypre_StructMatrixBoxData(A, i, si+1); - Ap2 = hypre_StructMatrixBoxData(A, i, si+2); - Ap3 = hypre_StructMatrixBoxData(A, i, si+3); - Ap4 = hypre_StructMatrixBoxData(A, i, si+4); + Ap0 = hypre_StructMatrixBoxData(A, i, si + 0); + Ap1 = hypre_StructMatrixBoxData(A, i, si + 1); + Ap2 = hypre_StructMatrixBoxData(A, i, si + 2); + Ap3 = hypre_StructMatrixBoxData(A, i, si + 3); + Ap4 = hypre_StructMatrixBoxData(A, i, si + 4); xoff0 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+0]); + stencil_shape[si + 0]); xoff1 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+1]); + stencil_shape[si + 1]); xoff2 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+2]); + stencil_shape[si + 2]); xoff3 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+3]); + stencil_shape[si + 3]); xoff4 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+4]); + stencil_shape[si + 4]); #define DEVICE_VAR is_device_ptr(yp,Ap0,Ap1,Ap2,Ap3,Ap4,xp) hypre_BoxLoop3Begin(ndim, loop_size, @@ -474,19 +482,19 @@ HYPRE_Int hypre_StructMatvecCC0( HYPRE_Complex alpha, break; case 4: - Ap0 = hypre_StructMatrixBoxData(A, i, si+0); - Ap1 = hypre_StructMatrixBoxData(A, i, si+1); - Ap2 = hypre_StructMatrixBoxData(A, i, si+2); - Ap3 = hypre_StructMatrixBoxData(A, i, si+3); + Ap0 = hypre_StructMatrixBoxData(A, i, si + 0); + Ap1 = hypre_StructMatrixBoxData(A, i, si + 1); + Ap2 = hypre_StructMatrixBoxData(A, i, si + 2); + Ap3 = hypre_StructMatrixBoxData(A, i, si + 3); xoff0 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+0]); + stencil_shape[si + 0]); xoff1 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+1]); + stencil_shape[si + 1]); xoff2 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+2]); + stencil_shape[si + 2]); xoff3 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+3]); + stencil_shape[si + 3]); #define DEVICE_VAR is_device_ptr(yp,Ap0,Ap1,Ap2,Ap3,xp) hypre_BoxLoop3Begin(ndim, loop_size, @@ -506,16 +514,16 @@ HYPRE_Int hypre_StructMatvecCC0( HYPRE_Complex alpha, break; case 3: - Ap0 = hypre_StructMatrixBoxData(A, i, si+0); - Ap1 = hypre_StructMatrixBoxData(A, i, si+1); - Ap2 = hypre_StructMatrixBoxData(A, i, si+2); + Ap0 = hypre_StructMatrixBoxData(A, i, si + 0); + Ap1 = hypre_StructMatrixBoxData(A, i, si + 1); + Ap2 = hypre_StructMatrixBoxData(A, i, si + 2); xoff0 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+0]); + stencil_shape[si + 0]); xoff1 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+1]); + stencil_shape[si + 1]); xoff2 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+2]); + stencil_shape[si + 2]); #define DEVICE_VAR is_device_ptr(yp,Ap0,Ap1,Ap2,xp) hypre_BoxLoop3Begin(ndim, loop_size, @@ -534,13 +542,13 @@ HYPRE_Int hypre_StructMatvecCC0( HYPRE_Complex alpha, break; case 2: - Ap0 = hypre_StructMatrixBoxData(A, i, si+0); - Ap1 = hypre_StructMatrixBoxData(A, i, si+1); + Ap0 = hypre_StructMatrixBoxData(A, i, si + 0); + Ap1 = hypre_StructMatrixBoxData(A, i, si + 1); xoff0 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+0]); + stencil_shape[si + 0]); xoff1 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+1]); + stencil_shape[si + 1]); #define DEVICE_VAR is_device_ptr(yp,Ap0,Ap1,xp) hypre_BoxLoop3Begin(ndim, loop_size, @@ -558,10 +566,10 @@ HYPRE_Int hypre_StructMatvecCC0( HYPRE_Complex alpha, break; case 1: - Ap0 = hypre_StructMatrixBoxData(A, i, si+0); + Ap0 = hypre_StructMatrixBoxData(A, i, si + 0); xoff0 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+0]); + stencil_shape[si + 0]); #define DEVICE_VAR is_device_ptr(yp,Ap0,xp) hypre_BoxLoop3Begin(ndim, loop_size, @@ -608,7 +616,7 @@ HYPRE_Int hypre_StructMatvecCC1( HYPRE_Complex alpha, hypre_StructVector *y, hypre_BoxArrayArray *compute_box_aa, hypre_IndexRef stride - ) + ) { HYPRE_Int i, j, si; HYPRE_Complex *Ap0; @@ -675,41 +683,41 @@ HYPRE_Int hypre_StructMatvecCC1( HYPRE_Complex alpha, Ai = 0; /* unroll up to depth MAX_DEPTH */ - for (si = 0; si < stencil_size; si+= MAX_DEPTH) + for (si = 0; si < stencil_size; si += MAX_DEPTH) { - depth = hypre_min(MAX_DEPTH, (stencil_size -si)); - switch(depth) + depth = hypre_min(MAX_DEPTH, (stencil_size - si)); + switch (depth) { case 7: - Ap0 = hypre_StructMatrixBoxData(A, i, si+0); - Ap1 = hypre_StructMatrixBoxData(A, i, si+1); - Ap2 = hypre_StructMatrixBoxData(A, i, si+2); - Ap3 = hypre_StructMatrixBoxData(A, i, si+3); - Ap4 = hypre_StructMatrixBoxData(A, i, si+4); - Ap5 = hypre_StructMatrixBoxData(A, i, si+5); - Ap6 = hypre_StructMatrixBoxData(A, i, si+6); - AAp0 = Ap0[Ai]*alpha; - AAp1 = Ap1[Ai]*alpha; - AAp2 = Ap2[Ai]*alpha; - AAp3 = Ap3[Ai]*alpha; - AAp4 = Ap4[Ai]*alpha; - AAp5 = Ap5[Ai]*alpha; - AAp6 = Ap6[Ai]*alpha; + Ap0 = hypre_StructMatrixBoxData(A, i, si + 0); + Ap1 = hypre_StructMatrixBoxData(A, i, si + 1); + Ap2 = hypre_StructMatrixBoxData(A, i, si + 2); + Ap3 = hypre_StructMatrixBoxData(A, i, si + 3); + Ap4 = hypre_StructMatrixBoxData(A, i, si + 4); + Ap5 = hypre_StructMatrixBoxData(A, i, si + 5); + Ap6 = hypre_StructMatrixBoxData(A, i, si + 6); + AAp0 = Ap0[Ai] * alpha; + AAp1 = Ap1[Ai] * alpha; + AAp2 = Ap2[Ai] * alpha; + AAp3 = Ap3[Ai] * alpha; + AAp4 = Ap4[Ai] * alpha; + AAp5 = Ap5[Ai] * alpha; + AAp6 = Ap6[Ai] * alpha; xoff0 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+0]); + stencil_shape[si + 0]); xoff1 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+1]); + stencil_shape[si + 1]); xoff2 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+2]); + stencil_shape[si + 2]); xoff3 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+3]); + stencil_shape[si + 3]); xoff4 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+4]); + stencil_shape[si + 4]); xoff5 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+5]); + stencil_shape[si + 5]); xoff6 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+6]); + stencil_shape[si + 6]); #define DEVICE_VAR is_device_ptr(yp,xp) hypre_BoxLoop2Begin(ndim, loop_size, @@ -730,31 +738,31 @@ HYPRE_Int hypre_StructMatvecCC1( HYPRE_Complex alpha, break; case 6: - Ap0 = hypre_StructMatrixBoxData(A, i, si+0); - Ap1 = hypre_StructMatrixBoxData(A, i, si+1); - Ap2 = hypre_StructMatrixBoxData(A, i, si+2); - Ap3 = hypre_StructMatrixBoxData(A, i, si+3); - Ap4 = hypre_StructMatrixBoxData(A, i, si+4); - Ap5 = hypre_StructMatrixBoxData(A, i, si+5); - AAp0 = Ap0[Ai]*alpha; - AAp1 = Ap1[Ai]*alpha; - AAp2 = Ap2[Ai]*alpha; - AAp3 = Ap3[Ai]*alpha; - AAp4 = Ap4[Ai]*alpha; - AAp5 = Ap5[Ai]*alpha; + Ap0 = hypre_StructMatrixBoxData(A, i, si + 0); + Ap1 = hypre_StructMatrixBoxData(A, i, si + 1); + Ap2 = hypre_StructMatrixBoxData(A, i, si + 2); + Ap3 = hypre_StructMatrixBoxData(A, i, si + 3); + Ap4 = hypre_StructMatrixBoxData(A, i, si + 4); + Ap5 = hypre_StructMatrixBoxData(A, i, si + 5); + AAp0 = Ap0[Ai] * alpha; + AAp1 = Ap1[Ai] * alpha; + AAp2 = Ap2[Ai] * alpha; + AAp3 = Ap3[Ai] * alpha; + AAp4 = Ap4[Ai] * alpha; + AAp5 = Ap5[Ai] * alpha; xoff0 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+0]); + stencil_shape[si + 0]); xoff1 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+1]); + stencil_shape[si + 1]); xoff2 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+2]); + stencil_shape[si + 2]); xoff3 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+3]); + stencil_shape[si + 3]); xoff4 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+4]); + stencil_shape[si + 4]); xoff5 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+5]); + stencil_shape[si + 5]); #define DEVICE_VAR is_device_ptr(yp,xp) hypre_BoxLoop2Begin(ndim, loop_size, @@ -774,27 +782,27 @@ HYPRE_Int hypre_StructMatvecCC1( HYPRE_Complex alpha, break; case 5: - Ap0 = hypre_StructMatrixBoxData(A, i, si+0); - Ap1 = hypre_StructMatrixBoxData(A, i, si+1); - Ap2 = hypre_StructMatrixBoxData(A, i, si+2); - Ap3 = hypre_StructMatrixBoxData(A, i, si+3); - Ap4 = hypre_StructMatrixBoxData(A, i, si+4); - AAp0 = Ap0[Ai]*alpha; - AAp1 = Ap1[Ai]*alpha; - AAp2 = Ap2[Ai]*alpha; - AAp3 = Ap3[Ai]*alpha; - AAp4 = Ap4[Ai]*alpha; + Ap0 = hypre_StructMatrixBoxData(A, i, si + 0); + Ap1 = hypre_StructMatrixBoxData(A, i, si + 1); + Ap2 = hypre_StructMatrixBoxData(A, i, si + 2); + Ap3 = hypre_StructMatrixBoxData(A, i, si + 3); + Ap4 = hypre_StructMatrixBoxData(A, i, si + 4); + AAp0 = Ap0[Ai] * alpha; + AAp1 = Ap1[Ai] * alpha; + AAp2 = Ap2[Ai] * alpha; + AAp3 = Ap3[Ai] * alpha; + AAp4 = Ap4[Ai] * alpha; xoff0 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+0]); + stencil_shape[si + 0]); xoff1 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+1]); + stencil_shape[si + 1]); xoff2 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+2]); + stencil_shape[si + 2]); xoff3 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+3]); + stencil_shape[si + 3]); xoff4 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+4]); + stencil_shape[si + 4]); #define DEVICE_VAR is_device_ptr(yp,xp) hypre_BoxLoop2Begin(ndim, loop_size, @@ -813,23 +821,23 @@ HYPRE_Int hypre_StructMatvecCC1( HYPRE_Complex alpha, break; case 4: - Ap0 = hypre_StructMatrixBoxData(A, i, si+0); - Ap1 = hypre_StructMatrixBoxData(A, i, si+1); - Ap2 = hypre_StructMatrixBoxData(A, i, si+2); - Ap3 = hypre_StructMatrixBoxData(A, i, si+3); - AAp0 = Ap0[Ai]*alpha; - AAp1 = Ap1[Ai]*alpha; - AAp2 = Ap2[Ai]*alpha; - AAp3 = Ap3[Ai]*alpha; + Ap0 = hypre_StructMatrixBoxData(A, i, si + 0); + Ap1 = hypre_StructMatrixBoxData(A, i, si + 1); + Ap2 = hypre_StructMatrixBoxData(A, i, si + 2); + Ap3 = hypre_StructMatrixBoxData(A, i, si + 3); + AAp0 = Ap0[Ai] * alpha; + AAp1 = Ap1[Ai] * alpha; + AAp2 = Ap2[Ai] * alpha; + AAp3 = Ap3[Ai] * alpha; xoff0 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+0]); + stencil_shape[si + 0]); xoff1 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+1]); + stencil_shape[si + 1]); xoff2 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+2]); + stencil_shape[si + 2]); xoff3 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+3]); + stencil_shape[si + 3]); #define DEVICE_VAR is_device_ptr(yp,xp) hypre_BoxLoop2Begin(ndim, loop_size, @@ -847,19 +855,19 @@ HYPRE_Int hypre_StructMatvecCC1( HYPRE_Complex alpha, break; case 3: - Ap0 = hypre_StructMatrixBoxData(A, i, si+0); - Ap1 = hypre_StructMatrixBoxData(A, i, si+1); - Ap2 = hypre_StructMatrixBoxData(A, i, si+2); - AAp0 = Ap0[Ai]*alpha; - AAp1 = Ap1[Ai]*alpha; - AAp2 = Ap2[Ai]*alpha; + Ap0 = hypre_StructMatrixBoxData(A, i, si + 0); + Ap1 = hypre_StructMatrixBoxData(A, i, si + 1); + Ap2 = hypre_StructMatrixBoxData(A, i, si + 2); + AAp0 = Ap0[Ai] * alpha; + AAp1 = Ap1[Ai] * alpha; + AAp2 = Ap2[Ai] * alpha; xoff0 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+0]); + stencil_shape[si + 0]); xoff1 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+1]); + stencil_shape[si + 1]); xoff2 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+2]); + stencil_shape[si + 2]); #define DEVICE_VAR is_device_ptr(yp,xp) hypre_BoxLoop2Begin(ndim, loop_size, @@ -876,15 +884,15 @@ HYPRE_Int hypre_StructMatvecCC1( HYPRE_Complex alpha, break; case 2: - Ap0 = hypre_StructMatrixBoxData(A, i, si+0); - Ap1 = hypre_StructMatrixBoxData(A, i, si+1); - AAp0 = Ap0[Ai]*alpha; - AAp1 = Ap1[Ai]*alpha; + Ap0 = hypre_StructMatrixBoxData(A, i, si + 0); + Ap1 = hypre_StructMatrixBoxData(A, i, si + 1); + AAp0 = Ap0[Ai] * alpha; + AAp1 = Ap1[Ai] * alpha; xoff0 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+0]); + stencil_shape[si + 0]); xoff1 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+1]); + stencil_shape[si + 1]); #define DEVICE_VAR is_device_ptr(yp,xp) hypre_BoxLoop2Begin(ndim, loop_size, @@ -900,11 +908,11 @@ HYPRE_Int hypre_StructMatvecCC1( HYPRE_Complex alpha, break; case 1: - Ap0 = hypre_StructMatrixBoxData(A, i, si+0); - AAp0 = Ap0[Ai]*alpha; + Ap0 = hypre_StructMatrixBoxData(A, i, si + 0); + AAp0 = Ap0[Ai] * alpha; xoff0 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+0]); + stencil_shape[si + 0]); #define DEVICE_VAR is_device_ptr(yp,xp) hypre_BoxLoop2Begin(ndim, loop_size, @@ -936,7 +944,7 @@ HYPRE_Int hypre_StructMatvecCC2( HYPRE_Complex alpha, hypre_StructVector *y, hypre_BoxArrayArray *compute_box_aa, hypre_IndexRef stride - ) + ) { HYPRE_Int i, j, si; HYPRE_Complex *Ap0; @@ -979,7 +987,7 @@ HYPRE_Int hypre_StructMatvecCC2( HYPRE_Complex alpha, hypre_Index loop_size; hypre_IndexRef start; HYPRE_Int ndim; - HYPRE_Complex zero[1]={0}; + HYPRE_Complex zero[1] = {0}; stencil = hypre_StructMatrixStencil(A); stencil_shape = hypre_StructStencilShape(stencil); @@ -1016,22 +1024,22 @@ HYPRE_Int hypre_StructMatvecCC2( HYPRE_Complex alpha, /* unroll up to depth MAX_DEPTH Only the constant coefficient part of the matrix is referenced here, the center (variable) coefficient part is deferred. */ - for (si = 0; si < stencil_size; si+= MAX_DEPTH) + for (si = 0; si < stencil_size; si += MAX_DEPTH) { - depth = hypre_min(MAX_DEPTH, (stencil_size -si)); - switch(depth) + depth = hypre_min(MAX_DEPTH, (stencil_size - si)); + switch (depth) { case 7: - Ap0 = hypre_StructMatrixBoxData(A, i, si+0); - Ap1 = hypre_StructMatrixBoxData(A, i, si+1); - Ap2 = hypre_StructMatrixBoxData(A, i, si+2); - Ap3 = hypre_StructMatrixBoxData(A, i, si+3); - Ap4 = hypre_StructMatrixBoxData(A, i, si+4); - Ap5 = hypre_StructMatrixBoxData(A, i, si+5); - Ap6 = hypre_StructMatrixBoxData(A, i, si+6); - if ( (0 <= si_center-si) && (si_center-si < 7) ) + Ap0 = hypre_StructMatrixBoxData(A, i, si + 0); + Ap1 = hypre_StructMatrixBoxData(A, i, si + 1); + Ap2 = hypre_StructMatrixBoxData(A, i, si + 2); + Ap3 = hypre_StructMatrixBoxData(A, i, si + 3); + Ap4 = hypre_StructMatrixBoxData(A, i, si + 4); + Ap5 = hypre_StructMatrixBoxData(A, i, si + 5); + Ap6 = hypre_StructMatrixBoxData(A, i, si + 6); + if ( (0 <= si_center - si) && (si_center - si < 7) ) { - switch ( si_center-si ) + switch ( si_center - si ) { case 0: Ap0 = zero; break; case 1: Ap1 = zero; break; @@ -1053,21 +1061,21 @@ HYPRE_Int hypre_StructMatvecCC2( HYPRE_Complex alpha, xoff0 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+0]); + stencil_shape[si + 0]); xoff0 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+0]); + stencil_shape[si + 0]); xoff1 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+1]); + stencil_shape[si + 1]); xoff2 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+2]); + stencil_shape[si + 2]); xoff3 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+3]); + stencil_shape[si + 3]); xoff4 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+4]); + stencil_shape[si + 4]); xoff5 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+5]); + stencil_shape[si + 5]); xoff6 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+6]); + stencil_shape[si + 6]); #define DEVICE_VAR is_device_ptr(yp,xp) hypre_BoxLoop2Begin(ndim, loop_size, @@ -1089,15 +1097,15 @@ HYPRE_Int hypre_StructMatvecCC2( HYPRE_Complex alpha, break; case 6: - Ap0 = hypre_StructMatrixBoxData(A, i, si+0); - Ap1 = hypre_StructMatrixBoxData(A, i, si+1); - Ap2 = hypre_StructMatrixBoxData(A, i, si+2); - Ap3 = hypre_StructMatrixBoxData(A, i, si+3); - Ap4 = hypre_StructMatrixBoxData(A, i, si+4); - Ap5 = hypre_StructMatrixBoxData(A, i, si+5); - if ( (0 <= si_center-si) && (si_center-si < 6) ) + Ap0 = hypre_StructMatrixBoxData(A, i, si + 0); + Ap1 = hypre_StructMatrixBoxData(A, i, si + 1); + Ap2 = hypre_StructMatrixBoxData(A, i, si + 2); + Ap3 = hypre_StructMatrixBoxData(A, i, si + 3); + Ap4 = hypre_StructMatrixBoxData(A, i, si + 4); + Ap5 = hypre_StructMatrixBoxData(A, i, si + 5); + if ( (0 <= si_center - si) && (si_center - si < 6) ) { - switch ( si_center-si ) + switch ( si_center - si ) { case 0: Ap0 = zero; break; case 1: Ap1 = zero; break; @@ -1115,17 +1123,17 @@ HYPRE_Int hypre_StructMatvecCC2( HYPRE_Complex alpha, AAp5 = Ap5[Ai_CC]; xoff0 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+0]); + stencil_shape[si + 0]); xoff1 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+1]); + stencil_shape[si + 1]); xoff2 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+2]); + stencil_shape[si + 2]); xoff3 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+3]); + stencil_shape[si + 3]); xoff4 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+4]); + stencil_shape[si + 4]); xoff5 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+5]); + stencil_shape[si + 5]); #define DEVICE_VAR is_device_ptr(yp,xp) hypre_BoxLoop2Begin(ndim, loop_size, @@ -1145,14 +1153,14 @@ HYPRE_Int hypre_StructMatvecCC2( HYPRE_Complex alpha, break; case 5: - Ap0 = hypre_StructMatrixBoxData(A, i, si+0); - Ap1 = hypre_StructMatrixBoxData(A, i, si+1); - Ap2 = hypre_StructMatrixBoxData(A, i, si+2); - Ap3 = hypre_StructMatrixBoxData(A, i, si+3); - Ap4 = hypre_StructMatrixBoxData(A, i, si+4); - if ( (0 <= si_center-si) && (si_center-si < 5) ) + Ap0 = hypre_StructMatrixBoxData(A, i, si + 0); + Ap1 = hypre_StructMatrixBoxData(A, i, si + 1); + Ap2 = hypre_StructMatrixBoxData(A, i, si + 2); + Ap3 = hypre_StructMatrixBoxData(A, i, si + 3); + Ap4 = hypre_StructMatrixBoxData(A, i, si + 4); + if ( (0 <= si_center - si) && (si_center - si < 5) ) { - switch ( si_center-si ) + switch ( si_center - si ) { case 0: Ap0 = zero; break; case 1: Ap1 = zero; break; @@ -1168,15 +1176,15 @@ HYPRE_Int hypre_StructMatvecCC2( HYPRE_Complex alpha, AAp4 = Ap4[Ai_CC]; xoff0 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+0]); + stencil_shape[si + 0]); xoff1 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+1]); + stencil_shape[si + 1]); xoff2 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+2]); + stencil_shape[si + 2]); xoff3 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+3]); + stencil_shape[si + 3]); xoff4 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+4]); + stencil_shape[si + 4]); #define DEVICE_VAR is_device_ptr(yp,xp) hypre_BoxLoop2Begin(ndim, loop_size, @@ -1195,13 +1203,13 @@ HYPRE_Int hypre_StructMatvecCC2( HYPRE_Complex alpha, break; case 4: - Ap0 = hypre_StructMatrixBoxData(A, i, si+0); - Ap1 = hypre_StructMatrixBoxData(A, i, si+1); - Ap2 = hypre_StructMatrixBoxData(A, i, si+2); - Ap3 = hypre_StructMatrixBoxData(A, i, si+3); - if ( (0 <= si_center-si) && (si_center-si < 4) ) + Ap0 = hypre_StructMatrixBoxData(A, i, si + 0); + Ap1 = hypre_StructMatrixBoxData(A, i, si + 1); + Ap2 = hypre_StructMatrixBoxData(A, i, si + 2); + Ap3 = hypre_StructMatrixBoxData(A, i, si + 3); + if ( (0 <= si_center - si) && (si_center - si < 4) ) { - switch ( si_center-si ) + switch ( si_center - si ) { case 0: Ap0 = zero; break; case 1: Ap1 = zero; break; @@ -1215,13 +1223,13 @@ HYPRE_Int hypre_StructMatvecCC2( HYPRE_Complex alpha, AAp3 = Ap3[Ai_CC]; xoff0 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+0]); + stencil_shape[si + 0]); xoff1 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+1]); + stencil_shape[si + 1]); xoff2 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+2]); + stencil_shape[si + 2]); xoff3 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+3]); + stencil_shape[si + 3]); #define DEVICE_VAR is_device_ptr(yp,xp) hypre_BoxLoop2Begin(ndim, loop_size, @@ -1239,12 +1247,12 @@ HYPRE_Int hypre_StructMatvecCC2( HYPRE_Complex alpha, break; case 3: - Ap0 = hypre_StructMatrixBoxData(A, i, si+0); - Ap1 = hypre_StructMatrixBoxData(A, i, si+1); - Ap2 = hypre_StructMatrixBoxData(A, i, si+2); - if ( (0 <= si_center-si) && (si_center-si < 3) ) + Ap0 = hypre_StructMatrixBoxData(A, i, si + 0); + Ap1 = hypre_StructMatrixBoxData(A, i, si + 1); + Ap2 = hypre_StructMatrixBoxData(A, i, si + 2); + if ( (0 <= si_center - si) && (si_center - si < 3) ) { - switch ( si_center-si ) + switch ( si_center - si ) { case 0: Ap0 = zero; break; case 1: Ap1 = zero; break; @@ -1256,11 +1264,11 @@ HYPRE_Int hypre_StructMatvecCC2( HYPRE_Complex alpha, AAp2 = Ap2[Ai_CC]; xoff0 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+0]); + stencil_shape[si + 0]); xoff1 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+1]); + stencil_shape[si + 1]); xoff2 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+2]); + stencil_shape[si + 2]); #define DEVICE_VAR is_device_ptr(yp,xp) hypre_BoxLoop2Begin(ndim, loop_size, @@ -1277,11 +1285,11 @@ HYPRE_Int hypre_StructMatvecCC2( HYPRE_Complex alpha, break; case 2: - Ap0 = hypre_StructMatrixBoxData(A, i, si+0); - Ap1 = hypre_StructMatrixBoxData(A, i, si+1); - if ( (0 <= si_center-si) && (si_center-si < 2) ) + Ap0 = hypre_StructMatrixBoxData(A, i, si + 0); + Ap1 = hypre_StructMatrixBoxData(A, i, si + 1); + if ( (0 <= si_center - si) && (si_center - si < 2) ) { - switch ( si_center-si ) + switch ( si_center - si ) { case 0: Ap0 = zero; break; case 1: Ap1 = zero; break; @@ -1291,9 +1299,9 @@ HYPRE_Int hypre_StructMatvecCC2( HYPRE_Complex alpha, AAp1 = Ap1[Ai_CC]; xoff0 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+0]); + stencil_shape[si + 0]); xoff1 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+1]); + stencil_shape[si + 1]); #define DEVICE_VAR is_device_ptr(yp,xp) hypre_BoxLoop2Begin(ndim, loop_size, @@ -1309,15 +1317,15 @@ HYPRE_Int hypre_StructMatvecCC2( HYPRE_Complex alpha, break; case 1: - Ap0 = hypre_StructMatrixBoxData(A, i, si+0); - if ( si_center-si == 0 ) + Ap0 = hypre_StructMatrixBoxData(A, i, si + 0); + if ( si_center - si == 0 ) { Ap0 = zero; } AAp0 = Ap0[Ai_CC]; xoff0 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si+0]); + stencil_shape[si + 0]); #define DEVICE_VAR is_device_ptr(yp,xp) hypre_BoxLoop2Begin(ndim, loop_size, @@ -1337,7 +1345,7 @@ HYPRE_Int hypre_StructMatvecCC2( HYPRE_Complex alpha, Ap0 = hypre_StructMatrixBoxData(A, i, si_center); xoff0 = hypre_BoxOffsetDistance(x_data_box, stencil_shape[si_center]); - if (alpha!= 1.0 ) + if (alpha != 1.0 ) { #define DEVICE_VAR is_device_ptr(yp,Ap0,xp) hypre_BoxLoop3Begin(ndim, loop_size, diff --git a/external/hypre/src/struct_mv/struct_scale.c b/external/hypre/src/struct_mv/struct_scale.c index d8f1ef0a..cdbdb117 100644 --- a/external/hypre/src/struct_mv/struct_scale.c +++ b/external/hypre/src/struct_mv/struct_scale.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/struct_mv/struct_stencil.c b/external/hypre/src/struct_mv/struct_stencil.c index e1ded8e6..25bd74f1 100644 --- a/external/hypre/src/struct_mv/struct_stencil.c +++ b/external/hypre/src/struct_mv/struct_stencil.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -111,7 +111,7 @@ hypre_StructStencilSymmetrize( hypre_StructStencil *stencil, HYPRE_Int **symm_elements_ptr ) { hypre_Index *stencil_shape = hypre_StructStencilShape(stencil); - HYPRE_Int stencil_size = hypre_StructStencilSize(stencil); + HYPRE_Int stencil_size = hypre_StructStencilSize(stencil); hypre_StructStencil *symm_stencil; hypre_Index *symm_stencil_shape; @@ -120,13 +120,13 @@ hypre_StructStencilSymmetrize( hypre_StructStencil *stencil, HYPRE_Int no_symmetric_stencil_element, symmetric; HYPRE_Int i, j, d, ndim; - + /*------------------------------------------------------ * Copy stencil elements into `symm_stencil_shape' *------------------------------------------------------*/ ndim = hypre_StructStencilNDim(stencil); - symm_stencil_shape = hypre_CTAlloc(hypre_Index, 2*stencil_size, HYPRE_MEMORY_HOST); + symm_stencil_shape = hypre_CTAlloc(hypre_Index, 2 * stencil_size, HYPRE_MEMORY_HOST); for (i = 0; i < stencil_size; i++) { hypre_CopyIndex(stencil_shape[i], symm_stencil_shape[i]); @@ -136,9 +136,11 @@ hypre_StructStencilSymmetrize( hypre_StructStencil *stencil, * Create symmetric stencil elements and `symm_elements' *------------------------------------------------------*/ - symm_elements = hypre_CTAlloc(HYPRE_Int, 2*stencil_size, HYPRE_MEMORY_HOST); - for (i = 0; i < 2*stencil_size; i++) + symm_elements = hypre_CTAlloc(HYPRE_Int, 2 * stencil_size, HYPRE_MEMORY_HOST); + for (i = 0; i < 2 * stencil_size; i++) + { symm_elements[i] = -1; + } symm_stencil_size = stencil_size; for (i = 0; i < stencil_size; i++) @@ -178,7 +180,7 @@ hypre_StructStencilSymmetrize( hypre_StructStencil *stencil, hypre_IndexD(symm_stencil_shape[symm_stencil_size], d) = -hypre_IndexD(symm_stencil_shape[i], d); } - + symm_elements[symm_stencil_size] = i; symm_stencil_size++; } diff --git a/external/hypre/src/struct_mv/struct_stencil.h b/external/hypre/src/struct_mv/struct_stencil.h index 4d1566a7..8c74313c 100644 --- a/external/hypre/src/struct_mv/struct_stencil.h +++ b/external/hypre/src/struct_mv/struct_stencil.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -22,7 +22,7 @@ typedef struct hypre_StructStencil_struct { hypre_Index *shape; /* Description of a stencil's shape */ HYPRE_Int size; /* Number of stencil coefficients */ - + HYPRE_Int ndim; /* Number of dimensions */ HYPRE_Int ref_count; diff --git a/external/hypre/src/struct_mv/struct_vector.c b/external/hypre/src/struct_mv/struct_vector.c index 07841d89..1a5d418f 100644 --- a/external/hypre/src/struct_mv/struct_vector.c +++ b/external/hypre/src/struct_mv/struct_vector.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -25,7 +25,7 @@ hypre_StructVectorCreate( MPI_Comm comm, hypre_StructVector *vector; HYPRE_Int i; - vector = hypre_CTAlloc(hypre_StructVector, 1, HYPRE_MEMORY_HOST); + vector = hypre_CTAlloc(hypre_StructVector, 1, HYPRE_MEMORY_HOST); hypre_StructVectorComm(vector) = comm; hypre_StructGridRef(grid, &hypre_StructVectorGrid(vector)); @@ -34,11 +34,13 @@ hypre_StructVectorCreate( MPI_Comm comm, hypre_StructVectorRefCount(vector) = 1; /* set defaults */ - for (i = 0; i < 2*ndim; i++) + for (i = 0; i < 2 * ndim; i++) { hypre_StructVectorNumGhost(vector)[i] = hypre_StructGridNumGhost(grid)[i]; } + hypre_StructVectorMemoryLocation(vector) = hypre_HandleMemoryLocation(hypre_handle()); + return vector; } @@ -66,20 +68,9 @@ hypre_StructVectorDestroy( hypre_StructVector *vector ) { if (hypre_StructVectorDataAlloced(vector)) { -#if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - hypre_StructGrid *grid = hypre_StructVectorGrid(vector); - if (hypre_StructGridDataLocation(grid) != HYPRE_MEMORY_HOST) - { - hypre_TFree(hypre_StructVectorData(vector),HYPRE_MEMORY_DEVICE); - } - else - { - hypre_TFree(hypre_StructVectorData(vector),HYPRE_MEMORY_HOST); - } -#else - hypre_TFree(hypre_StructVectorData(vector),HYPRE_MEMORY_DEVICE); -#endif + hypre_TFree(hypre_StructVectorData(vector), hypre_StructVectorMemoryLocation(vector)); } + hypre_TFree(hypre_StructVectorDataIndices(vector), HYPRE_MEMORY_HOST); hypre_BoxArrayDestroy(hypre_StructVectorDataSpace(vector)); hypre_StructGridDestroy(hypre_StructVectorGrid(vector)); @@ -132,8 +123,8 @@ hypre_StructVectorInitializeShell( hypre_StructVector *vector ) hypre_CopyBox(box, data_box); for (d = 0; d < ndim; d++) { - hypre_BoxIMinD(data_box, d) -= num_ghost[2*d]; - hypre_BoxIMaxD(data_box, d) += num_ghost[2*d + 1]; + hypre_BoxIMinD(data_box, d) -= num_ghost[2 * d]; + hypre_BoxIMaxD(data_box, d) += num_ghost[2 * d + 1]; } } @@ -195,19 +186,9 @@ hypre_StructVectorInitialize( hypre_StructVector *vector ) HYPRE_Complex *data; hypre_StructVectorInitializeShell(vector); -#if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - hypre_StructGrid *grid = hypre_StructVectorGrid(vector); - if (hypre_StructGridDataLocation(grid) != HYPRE_MEMORY_HOST) - { - data = hypre_CTAlloc(HYPRE_Complex, hypre_StructVectorDataSize(vector),HYPRE_MEMORY_DEVICE); - } - else - { - data = hypre_CTAlloc(HYPRE_Complex, hypre_StructVectorDataSize(vector),HYPRE_MEMORY_HOST); - } -#else - data = hypre_CTAlloc(HYPRE_Complex, hypre_StructVectorDataSize(vector),HYPRE_MEMORY_DEVICE); -#endif + + data = hypre_CTAlloc(HYPRE_Complex, hypre_StructVectorDataSize(vector), + hypre_StructVectorMemoryLocation(vector)); hypre_StructVectorInitializeData(vector, data); hypre_StructVectorDataAlloced(vector) = 1; @@ -235,12 +216,13 @@ hypre_StructVectorSetValues( hypre_StructVector *vector, HYPRE_Int boxnum, HYPRE_Int outside ) { - hypre_BoxArray *grid_boxes; - hypre_Box *grid_box; - - HYPRE_Complex *vecp; - - HYPRE_Int i, istart, istop; + hypre_BoxArray *grid_boxes; + hypre_Box *grid_box; + HYPRE_Complex *vecp; + HYPRE_Int i, istart, istop; +#if defined(HYPRE_USING_GPU) + HYPRE_MemoryLocation memory_location = hypre_StructVectorMemoryLocation(vector); +#endif if (outside > 0) { @@ -270,7 +252,8 @@ hypre_StructVectorSetValues( hypre_StructVector *vector, { vecp = hypre_StructVectorBoxDataValue(vector, i, grid_index); - if (hypre_GetActualMemLocation(HYPRE_MEMORY_DEVICE) != hypre_MEMORY_HOST) +#if defined(HYPRE_USING_GPU) + if (hypre_GetExecPolicy1(memory_location) == HYPRE_EXEC_DEVICE) { if (action > 0) { @@ -284,14 +267,15 @@ hypre_StructVectorSetValues( hypre_StructVector *vector, } else if (action > -1) { - hypre_TMemcpy(vecp, values, HYPRE_Complex, 1, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(vecp, values, HYPRE_Complex, 1, memory_location, memory_location); } else /* action < 0 */ { - hypre_TMemcpy(values, vecp, HYPRE_Complex, 1, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(values, vecp, HYPRE_Complex, 1, memory_location, memory_location); } } else +#endif { if (action > 0) { @@ -407,8 +391,8 @@ hypre_StructVectorSetBoxValues( hypre_StructVector *vector, if (action > 0) { hypre_BoxLoop2Begin(hypre_StructVectorNDim(vector), loop_size, - data_box,data_start,data_stride,datai, - dval_box,dval_start,dval_stride,dvali); + data_box, data_start, data_stride, datai, + dval_box, dval_start, dval_stride, dvali); { datap[datai] += values[dvali]; } @@ -417,8 +401,8 @@ hypre_StructVectorSetBoxValues( hypre_StructVector *vector, else if (action > -1) { hypre_BoxLoop2Begin(hypre_StructVectorNDim(vector), loop_size, - data_box,data_start,data_stride,datai, - dval_box,dval_start,dval_stride,dvali); + data_box, data_start, data_stride, datai, + dval_box, dval_start, dval_stride, dvali); { datap[datai] = values[dvali]; } @@ -427,8 +411,8 @@ hypre_StructVectorSetBoxValues( hypre_StructVector *vector, else /* action < 0 */ { hypre_BoxLoop2Begin(hypre_StructVectorNDim(vector), loop_size, - data_box,data_start,data_stride,datai, - dval_box,dval_start,dval_stride,dvali); + data_box, data_start, data_stride, datai, + dval_box, dval_start, dval_stride, dvali); { values[dvali] = datap[datai]; } @@ -455,12 +439,13 @@ hypre_StructVectorClearValues( hypre_StructVector *vector, HYPRE_Int boxnum, HYPRE_Int outside ) { - hypre_BoxArray *grid_boxes; - hypre_Box *grid_box; - - HYPRE_Complex *vecp; - - HYPRE_Int i, istart, istop; + hypre_BoxArray *grid_boxes; + hypre_Box *grid_box; + HYPRE_Complex *vecp; + HYPRE_Int i, istart, istop; +#if defined(HYPRE_USING_GPU) + HYPRE_MemoryLocation memory_location = hypre_StructVectorMemoryLocation(vector); +#endif if (outside > 0) { @@ -490,7 +475,8 @@ hypre_StructVectorClearValues( hypre_StructVector *vector, { vecp = hypre_StructVectorBoxDataValue(vector, i, grid_index); - if (hypre_GetActualMemLocation(HYPRE_MEMORY_DEVICE) != hypre_MEMORY_HOST) +#if defined(HYPRE_USING_GPU) + if (hypre_GetExecPolicy1(memory_location) == HYPRE_EXEC_DEVICE) { #define DEVICE_VAR is_device_ptr(vecp) hypre_LoopBegin(1, k) @@ -501,6 +487,7 @@ hypre_StructVectorClearValues( hypre_StructVector *vector, #undef DEVICE_VAR } else +#endif { *vecp = 0.0; } @@ -586,7 +573,7 @@ hypre_StructVectorClearBoxValues( hypre_StructVector *vector, #define DEVICE_VAR is_device_ptr(datap) hypre_BoxLoop1Begin(hypre_StructVectorNDim(vector), loop_size, - data_box,data_start,data_stride,datai); + data_box, data_start, data_stride, datai); { datap[datai] = 0.0; } @@ -641,8 +628,8 @@ hypre_StructVectorSetNumGhost( hypre_StructVector *vector, for (d = 0; d < ndim; d++) { - hypre_StructVectorNumGhost(vector)[2*d] = num_ghost[2*d]; - hypre_StructVectorNumGhost(vector)[2*d + 1] = num_ghost[2*d + 1]; + hypre_StructVectorNumGhost(vector)[2 * d] = num_ghost[2 * d]; + hypre_StructVectorNumGhost(vector)[2 * d + 1] = num_ghost[2 * d + 1]; } return hypre_error_flag; @@ -656,6 +643,8 @@ hypre_StructVectorSetDataSize(hypre_StructVector *vector, HYPRE_Int *data_size, HYPRE_Int *data_host_size) { + HYPRE_UNUSED_VAR(data_host_size); + #if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_StructGrid *grid = hypre_StructVectorGrid(vector); if (hypre_StructGridDataLocation(grid) != HYPRE_MEMORY_HOST) @@ -678,6 +667,8 @@ hypre_StructVectorSetDataSize(hypre_StructVector *vector, HYPRE_Int hypre_StructVectorAssemble( hypre_StructVector *vector ) { + HYPRE_UNUSED_VAR(vector); + return hypre_error_flag; } @@ -713,7 +704,7 @@ hypre_StructVectorCopy( hypre_StructVector *x, boxes = hypre_StructGridBoxes( hypre_StructVectorGrid(x) ); hypre_ForBoxI(i, boxes) { - box = hypre_BoxArrayBox(boxes, i); + box = hypre_BoxArrayBox(boxes, i); start = hypre_BoxIMin(box); x_data_box = @@ -1070,6 +1061,93 @@ hypre_StructVectorMigrate( hypre_CommPkg *comm_pkg, return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_StructVectorPrintData + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorPrintData( FILE *file, + hypre_StructVector *vector, + HYPRE_Int all ) +{ + HYPRE_Int ndim = hypre_StructVectorNDim(vector); + hypre_StructGrid *grid = hypre_StructVectorGrid(vector); + hypre_BoxArray *grid_boxes = hypre_StructGridBoxes(grid); + hypre_BoxArray *data_space = hypre_StructVectorDataSpace(vector); + HYPRE_Int data_size = hypre_StructVectorDataSize(vector); + HYPRE_Complex *data = hypre_StructVectorData(vector); + HYPRE_MemoryLocation memory_location = hypre_StructVectorMemoryLocation(vector); + hypre_BoxArray *boxes; + HYPRE_Complex *h_data; + + /* Allocate/Point to data on the host memory */ + if (hypre_GetActualMemLocation(memory_location) != hypre_MEMORY_HOST) + { + h_data = hypre_CTAlloc(HYPRE_Complex, data_size, HYPRE_MEMORY_HOST); + hypre_TMemcpy(h_data, data, HYPRE_Complex, data_size, + HYPRE_MEMORY_HOST, memory_location); + } + else + { + h_data = data; + } + + /* Print ghost data (all) also or only real data? */ + boxes = (all) ? data_space : grid_boxes; + + /* Print data to file */ + hypre_PrintBoxArrayData(file, boxes, data_space, 1, ndim, h_data); + + /* Free memory */ + if (hypre_GetActualMemLocation(memory_location) != hypre_MEMORY_HOST) + { + hypre_TFree(h_data, HYPRE_MEMORY_HOST); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_StructVectorReadData + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorReadData( FILE *file, + hypre_StructVector *vector ) +{ + HYPRE_Int ndim = hypre_StructVectorNDim(vector); + hypre_StructGrid *grid = hypre_StructVectorGrid(vector); + hypre_BoxArray *grid_boxes = hypre_StructGridBoxes(grid); + hypre_BoxArray *data_space = hypre_StructVectorDataSpace(vector); + HYPRE_Int data_size = hypre_StructVectorDataSize(vector); + HYPRE_Complex *data = hypre_StructVectorData(vector); + HYPRE_MemoryLocation memory_location = hypre_StructVectorMemoryLocation(vector); + HYPRE_Complex *h_data; + + /* Allocate/Point to data on the host memory */ + if (hypre_GetActualMemLocation(memory_location) != hypre_MEMORY_HOST) + { + h_data = hypre_CTAlloc(HYPRE_Complex, data_size, HYPRE_MEMORY_HOST); + } + else + { + h_data = data; + } + + /* Read data from file */ + hypre_ReadBoxArrayData(file, grid_boxes, data_space, 1, ndim, h_data); + + /* Move data to the device memory if necessary and free host data */ + if (hypre_GetActualMemLocation(memory_location) != hypre_MEMORY_HOST) + { + hypre_TMemcpy(data, h_data, HYPRE_Complex, data_size, + memory_location, HYPRE_MEMORY_HOST); + hypre_TFree(h_data, HYPRE_MEMORY_HOST); + } + + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- * hypre_StructVectorPrint *--------------------------------------------------------------------------*/ @@ -1083,24 +1161,21 @@ hypre_StructVectorPrint( const char *filename, char new_filename[255]; hypre_StructGrid *grid; - hypre_BoxArray *boxes; - - hypre_BoxArray *data_space; - HYPRE_Int myid; /*---------------------------------------- * Open file *----------------------------------------*/ - hypre_MPI_Comm_rank(hypre_StructVectorComm(vector), &myid ); - + hypre_MPI_Comm_rank(hypre_StructVectorComm(vector), &myid); hypre_sprintf(new_filename, "%s.%05d", filename, myid); if ((file = fopen(new_filename, "w")) == NULL) { hypre_printf("Error: can't open output file %s\n", new_filename); - exit(1); + hypre_error_in_arg(1); + + return hypre_error_flag; } /*---------------------------------------- @@ -1118,17 +1193,8 @@ hypre_StructVectorPrint( const char *filename, * Print data *----------------------------------------*/ - data_space = hypre_StructVectorDataSpace(vector); - - if (all) - boxes = data_space; - else - boxes = hypre_StructGridBoxes(grid); - hypre_fprintf(file, "\nData:\n"); - hypre_PrintBoxArrayData(file, boxes, data_space, 1, - hypre_StructGridNDim(grid), - hypre_StructVectorData(vector)); + hypre_StructVectorPrintData(file, vector, all); /*---------------------------------------- * Close file @@ -1141,6 +1207,7 @@ hypre_StructVectorPrint( const char *filename, } /*-------------------------------------------------------------------------- + * hypre_StructVectorRead *--------------------------------------------------------------------------*/ hypre_StructVector * @@ -1152,11 +1219,7 @@ hypre_StructVectorRead( MPI_Comm comm, char new_filename[255]; hypre_StructVector *vector; - hypre_StructGrid *grid; - hypre_BoxArray *boxes; - - hypre_BoxArray *data_space; HYPRE_Int myid; @@ -1164,13 +1227,13 @@ hypre_StructVectorRead( MPI_Comm comm, * Open file *----------------------------------------*/ - hypre_MPI_Comm_rank(comm, &myid ); - + hypre_MPI_Comm_rank(comm, &myid); hypre_sprintf(new_filename, "%s.%05d", filename, myid); if ((file = fopen(new_filename, "r")) == NULL) { - hypre_printf("Error: can't open output file %s\n", new_filename); + hypre_printf("Error: can't open input file %s\n", new_filename); + hypre_error_in_arg(2); exit(1); } @@ -1182,7 +1245,7 @@ hypre_StructVectorRead( MPI_Comm comm, /* read grid info */ hypre_fscanf(file, "\nGrid:\n"); - hypre_StructGridRead(comm,file,&grid); + hypre_StructGridRead(comm, file, &grid); /*---------------------------------------- * Initialize the vector @@ -1196,13 +1259,8 @@ hypre_StructVectorRead( MPI_Comm comm, * Read data *----------------------------------------*/ - boxes = hypre_StructGridBoxes(grid); - data_space = hypre_StructVectorDataSpace(vector); - hypre_fscanf(file, "\nData:\n"); - hypre_ReadBoxArrayData(file, boxes, data_space, 1, - hypre_StructGridNDim(grid), - hypre_StructVectorData(vector)); + hypre_StructVectorReadData(file, vector); /*---------------------------------------- * Assemble the vector @@ -1225,36 +1283,40 @@ hypre_StructVectorRead( MPI_Comm comm, * hypre_StructVectorClone * Returns a complete copy of x - a deep copy, with its own copy of the data. *--------------------------------------------------------------------------*/ + hypre_StructVector * hypre_StructVectorClone(hypre_StructVector *x) { - MPI_Comm comm = hypre_StructVectorComm(x); - hypre_StructGrid *grid = hypre_StructVectorGrid(x); - hypre_BoxArray *data_space = hypre_StructVectorDataSpace(x); - HYPRE_Int *data_indices = hypre_StructVectorDataIndices(x); - HYPRE_Int data_size = hypre_StructVectorDataSize(x); - HYPRE_Int ndim = hypre_StructGridNDim(grid); + MPI_Comm comm = hypre_StructVectorComm(x); + hypre_StructGrid *grid = hypre_StructVectorGrid(x); + HYPRE_MemoryLocation memory_location = hypre_StructVectorMemoryLocation(x); + hypre_BoxArray *data_space = hypre_StructVectorDataSpace(x); + HYPRE_Int *data_indices = hypre_StructVectorDataIndices(x); + HYPRE_Int data_size = hypre_StructVectorDataSize(x); + HYPRE_Int ndim = hypre_StructGridNDim(grid); HYPRE_Int data_space_size = hypre_BoxArraySize(data_space); + hypre_StructVector *y = hypre_StructVectorCreate(comm, grid); HYPRE_Int i; - hypre_StructVector *y = hypre_StructVectorCreate(comm, grid); - hypre_StructVectorDataSize(y) = data_size; - hypre_StructVectorDataSpace(y) = hypre_BoxArrayDuplicate(data_space); - hypre_StructVectorData(y) = hypre_CTAlloc(HYPRE_Complex, data_size, HYPRE_MEMORY_DEVICE); + hypre_StructVectorDataSize(y) = data_size; + hypre_StructVectorDataSpace(y) = hypre_BoxArrayDuplicate(data_space); + hypre_StructVectorData(y) = hypre_CTAlloc(HYPRE_Complex, data_size, memory_location); + hypre_StructVectorDataIndices(y) = hypre_CTAlloc(HYPRE_Int, data_space_size, HYPRE_MEMORY_HOST); - hypre_StructVectorDataIndices(y) = hypre_CTAlloc(HYPRE_Int, data_space_size, HYPRE_MEMORY_HOST); - - for (i=0; i < data_space_size; i++) + for (i = 0; i < data_space_size; i++) + { hypre_StructVectorDataIndices(y)[i] = data_indices[i]; + } hypre_StructVectorCopy( x, y ); - for (i=0; i < 2*ndim; i++) + for (i = 0; i < 2 * ndim; i++) + { hypre_StructVectorNumGhost(y)[i] = hypre_StructVectorNumGhost(x)[i]; + } hypre_StructVectorBGhostNotClear(y) = hypre_StructVectorBGhostNotClear(x); hypre_StructVectorGlobalSize(y) = hypre_StructVectorGlobalSize(x); return y; } - diff --git a/external/hypre/src/struct_mv/struct_vector.h b/external/hypre/src/struct_mv/struct_vector.h index 7e396afd..551a9505 100644 --- a/external/hypre/src/struct_mv/struct_vector.h +++ b/external/hypre/src/struct_mv/struct_vector.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -26,19 +26,20 @@ typedef struct hypre_StructVector_struct hypre_BoxArray *data_space; - HYPRE_Complex *data; /* Pointer to vector data on device*/ - HYPRE_Int data_alloced; /* Boolean used for freeing data */ - HYPRE_Int data_size; /* Size of vector data */ - HYPRE_Int *data_indices; /* num-boxes array of indices into - the data array. data_indices[b] - is the starting index of vector - data corresponding to box b. */ + HYPRE_MemoryLocation memory_location; /* memory location of data */ + HYPRE_Complex *data; /* Pointer to vector data on device*/ + HYPRE_Int data_alloced; /* Boolean used for freeing data */ + HYPRE_Int data_size; /* Size of vector data */ + HYPRE_Int *data_indices; /* num-boxes array of indices into + the data array. data_indices[b] + is the starting index of vector + data corresponding to box b. */ - HYPRE_Int num_ghost[2*HYPRE_MAXDIM]; /* Num ghost layers in each - * direction */ - HYPRE_Int bghost_not_clear; /* Are boundary ghosts clear? */ + HYPRE_Int num_ghost[2 * HYPRE_MAXDIM]; /* Num ghost layers in each + * direction */ + HYPRE_Int bghost_not_clear; /* Are boundary ghosts clear? */ - HYPRE_BigInt global_size; /* Total number coefficients */ + HYPRE_BigInt global_size; /* Total number coefficients */ HYPRE_Int ref_count; @@ -48,17 +49,18 @@ typedef struct hypre_StructVector_struct * Accessor macros: hypre_StructVector *--------------------------------------------------------------------------*/ -#define hypre_StructVectorComm(vector) ((vector) -> comm) -#define hypre_StructVectorGrid(vector) ((vector) -> grid) -#define hypre_StructVectorDataSpace(vector) ((vector) -> data_space) -#define hypre_StructVectorData(vector) ((vector) -> data) -#define hypre_StructVectorDataAlloced(vector) ((vector) -> data_alloced) -#define hypre_StructVectorDataSize(vector) ((vector) -> data_size) -#define hypre_StructVectorDataIndices(vector) ((vector) -> data_indices) -#define hypre_StructVectorNumGhost(vector) ((vector) -> num_ghost) -#define hypre_StructVectorBGhostNotClear(vector)((vector) -> bghost_not_clear) -#define hypre_StructVectorGlobalSize(vector) ((vector) -> global_size) -#define hypre_StructVectorRefCount(vector) ((vector) -> ref_count) +#define hypre_StructVectorComm(vector) ((vector) -> comm) +#define hypre_StructVectorGrid(vector) ((vector) -> grid) +#define hypre_StructVectorDataSpace(vector) ((vector) -> data_space) +#define hypre_StructVectorMemoryLocation(vector) ((vector) -> memory_location) +#define hypre_StructVectorData(vector) ((vector) -> data) +#define hypre_StructVectorDataAlloced(vector) ((vector) -> data_alloced) +#define hypre_StructVectorDataSize(vector) ((vector) -> data_size) +#define hypre_StructVectorDataIndices(vector) ((vector) -> data_indices) +#define hypre_StructVectorNumGhost(vector) ((vector) -> num_ghost) +#define hypre_StructVectorBGhostNotClear(vector) ((vector) -> bghost_not_clear) +#define hypre_StructVectorGlobalSize(vector) ((vector) -> global_size) +#define hypre_StructVectorRefCount(vector) ((vector) -> ref_count) #define hypre_StructVectorNDim(vector) \ hypre_StructGridNDim(hypre_StructVectorGrid(vector)) diff --git a/external/hypre/src/tarch b/external/hypre/src/tarch old mode 100644 new mode 100755 index f62254ec..d4fbb04f --- a/external/hypre/src/tarch +++ b/external/hypre/src/tarch @@ -1,4 +1,4 @@ -#! /bin/sh +#! /bin/bash # set -x # # Returns the architecture of the host machine @@ -59,7 +59,7 @@ for LARCH in $ARCHLIST ; do mips|dec-5000) FARCH=dec5000 ; break ;; IP12|iris-4d) GARCH=IRIX ;; cray|CRAY*) GARCH=CRAY ;; - KSR1|KSR2) FARCH=ksr ; break ;; + KSR1|KSR2) FARCH=ksr ; break ;; FreeBSD) FARCH=freebsd ; break ;; i386) GARCH=ipsc2 ;; ULTRIX|RISC) GARCH=dec5000 ;; diff --git a/external/hypre/src/test/CMakeLists.txt b/external/hypre/src/test/CMakeLists.txt index b5eaa3a1..9c286cc2 100644 --- a/external/hypre/src/test/CMakeLists.txt +++ b/external/hypre/src/test/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -9,6 +9,11 @@ if (MSVC) add_definitions(-D_CRT_SECURE_NO_WARNINGS) endif () +# Set default tolerance if not defined +if(NOT DEFINED HYPRE_CHECK_TOL) + set(HYPRE_CHECK_TOL 1.0e-6) +endif() + set(TEST_SRCS ij.c sstruct.c @@ -17,8 +22,118 @@ set(TEST_SRCS maxwell_unscaled.c struct_migrate.c sstruct_fac.c - ij_mv.c + ij_assembly.c ) add_hypre_executables(TEST_SRCS) - + +# Copy test input files +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/TEST_sstruct/sstruct.in.default + ${CMAKE_CURRENT_BINARY_DIR}/sstruct.in.default COPYONLY) + +# Add check target +find_program(BASH_PROGRAM bash) + +# Run check target +add_custom_target(check + COMMAND ${CMAKE_COMMAND} -E echo "Checking the library..." + COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} 1 $ 2> ij.err + COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} 1 $ 2> struct.err + COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} 1 $ 2> sstruct.err + COMMAND ${CMAKE_COMMAND} -E echo "Test error files:" + COMMAND ${CMAKE_COMMAND} -E cat ij.err struct.err sstruct.err + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS ij struct sstruct + COMMENT "Running basic library check" + VERBATIM +) + +# Add checkpar target for parallel testing +add_custom_target(checkpar + COMMAND ${CMAKE_COMMAND} -E echo "Checking the library..." + + COMMAND ${CMAKE_COMMAND} -E echo_append "Testing IJ... " + COMMAND ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/runtest.sh + -atol ${HYPRE_CHECK_TOL} + -mpi "${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG}" + ${CMAKE_CURRENT_SOURCE_DIR}/TEST_ij/solvers.sh + COMMAND ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/checktest.sh + COMMAND ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/cleantest.sh + COMMAND echo "" + + COMMAND ${CMAKE_COMMAND} -E echo_append "Testing Struct... " + COMMAND ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/runtest.sh + -atol ${HYPRE_CHECK_TOL} + -mpi "${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG}" + ${CMAKE_CURRENT_SOURCE_DIR}/TEST_struct/solvers.sh + COMMAND ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/checktest.sh + COMMAND ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/cleantest.sh + COMMAND echo "" + + COMMAND ${CMAKE_COMMAND} -E echo_append "Testing SStruct... " + COMMAND ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/runtest.sh + -atol ${HYPRE_CHECK_TOL} + -mpi "${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG}" + ${CMAKE_CURRENT_SOURCE_DIR}/TEST_sstruct/solvers.sh + COMMAND ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/checktest.sh + COMMAND ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/cleantest.sh + COMMAND echo "" + + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS ${TEST_SRCS} + COMMENT "Running parallel tests" + VERBATIM +) + +# Add CTest support +if(BUILD_TESTING) + message(STATUS "Building tests with CTest support") + + # IJ tests + add_test(NAME test_ij_solvers + COMMAND ${BASH_PROGRAM} -c "\ + ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/runtest.sh \ + -atol ${HYPRE_CHECK_TOL} \ + -mpi \"${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG}\" \ + ${CMAKE_CURRENT_SOURCE_DIR}/TEST_ij/solvers.sh && \ + ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/checktest.sh && \ + ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/cleantest.sh" + ) + set_tests_properties(test_ij_solvers PROPERTIES + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS ij + FAIL_REGULAR_EXPRESSION "Failed" + ) + + # Struct tests + add_test(NAME test_struct_solvers + COMMAND ${BASH_PROGRAM} -c "\ + ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/runtest.sh \ + -atol ${HYPRE_CHECK_TOL} \ + -mpi \"${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG}\" \ + ${CMAKE_CURRENT_SOURCE_DIR}/TEST_struct/solvers.sh && \ + ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/checktest.sh && \ + ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/cleantest.sh" + ) + set_tests_properties(test_struct_solvers PROPERTIES + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS struct + FAIL_REGULAR_EXPRESSION "Failed" + ) + + # SStruct tests + add_test(NAME test_sstruct_solvers + COMMAND ${BASH_PROGRAM} -c "\ + ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/runtest.sh \ + -atol ${HYPRE_CHECK_TOL} \ + -mpi \"${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG}\" \ + ${CMAKE_CURRENT_SOURCE_DIR}/TEST_sstruct/solvers.sh && \ + ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/checktest.sh && \ + ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/cleantest.sh" + ) + set_tests_properties(test_sstruct_solvers PROPERTIES + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS sstruct + FAIL_REGULAR_EXPRESSION "Failed" + ) +endif() diff --git a/external/hypre/src/test/TEST_ams/solvers.jobs b/external/hypre/src/test/TEST_ams/solvers.jobs old mode 100644 new mode 100755 index 625932a9..3121faff --- a/external/hypre/src/test/TEST_ams/solvers.jobs +++ b/external/hypre/src/test/TEST_ams/solvers.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_ams/solvers.saved b/external/hypre/src/test/TEST_ams/solvers.saved index 8b486edc..bcea4aee 100644 --- a/external/hypre/src/test/TEST_ams/solvers.saved +++ b/external/hypre/src/test/TEST_ams/solvers.saved @@ -37,81 +37,81 @@ # Output file: solvers.out.4 Iterations = 6 -Final Relative Residual Norm = 6.440027e-07 +Final Relative Residual Norm = 6.440062e-07 # Output file: solvers.out.5 Iterations = 6 -Final Relative Residual Norm = 6.440027e-07 +Final Relative Residual Norm = 6.440062e-07 # Output file: solvers.out.6 Iterations = 9 -Final Relative Residual Norm = 9.646705e-07 +Final Relative Residual Norm = 9.646675e-07 # Output file: solvers.out.7 Iterations = 9 -Final Relative Residual Norm = 9.646705e-07 +Final Relative Residual Norm = 9.646675e-07 # Output file: solvers.out.12 Iterations = 18 -Final Relative Residual Norm = 4.160115e-03 +Final Relative Residual Norm = 4.151612e-03 # Output file: solvers.out.8 -Eigenvalue lambda 3.02357653918323e+01 -Eigenvalue lambda 3.03135374700825e+01 -Eigenvalue lambda 3.85013899426296e+01 -Eigenvalue lambda 5.14395940109411e+01 -Eigenvalue lambda 5.15742481830257e+01 -Residual 4.25157808772846e-05 -Residual 4.19035189193737e-05 -Residual 4.81288033011393e-05 -Residual 7.10760463298080e-05 -Residual 8.91382143494275e-05 +Eigenvalue lambda 3.02357653918321e+01 +Eigenvalue lambda 3.03135374700838e+01 +Eigenvalue lambda 3.85013899426301e+01 +Eigenvalue lambda 5.14395940109376e+01 +Eigenvalue lambda 5.15742481830319e+01 +Residual 4.25157808820118e-05 +Residual 4.19035189015216e-05 +Residual 4.81288033055862e-05 +Residual 7.10760463267777e-05 +Residual 8.91382144508726e-05 17 iterations # Output file: solvers.out.9 -Eigenvalue lambda 3.02357653918323e+01 -Eigenvalue lambda 3.03135374700825e+01 -Eigenvalue lambda 3.85013899426296e+01 -Eigenvalue lambda 5.14395940109411e+01 -Eigenvalue lambda 5.15742481830257e+01 -Residual 4.25157808772846e-05 -Residual 4.19035189193737e-05 -Residual 4.81288033011393e-05 -Residual 7.10760463298080e-05 -Residual 8.91382143494275e-05 +Eigenvalue lambda 3.02357653918321e+01 +Eigenvalue lambda 3.03135374700838e+01 +Eigenvalue lambda 3.85013899426301e+01 +Eigenvalue lambda 5.14395940109376e+01 +Eigenvalue lambda 5.15742481830319e+01 +Residual 4.25157808820118e-05 +Residual 4.19035189015216e-05 +Residual 4.81288033055862e-05 +Residual 7.10760463267777e-05 +Residual 8.91382144508726e-05 17 iterations # Output file: solvers.out.10 -Eigenvalue lambda 3.02357653920282e+01 -Eigenvalue lambda 3.03135374703452e+01 -Eigenvalue lambda 3.85013899427150e+01 -Eigenvalue lambda 5.14395940116978e+01 -Eigenvalue lambda 5.15742481833418e+01 -Residual 8.05720052499174e-05 -Residual 9.77366136433341e-05 -Residual 5.87715311094864e-05 -Residual 1.00991497914808e-04 -Residual 9.93611224113933e-05 +Eigenvalue lambda 3.02357653920285e+01 +Eigenvalue lambda 3.03135374703450e+01 +Eigenvalue lambda 3.85013899427157e+01 +Eigenvalue lambda 5.14395940117001e+01 +Eigenvalue lambda 5.15742481833368e+01 +Residual 8.05720052532315e-05 +Residual 9.77366136479502e-05 +Residual 5.87715311287244e-05 +Residual 1.00991497909373e-04 +Residual 9.93611224218808e-05 23 iterations # Output file: solvers.out.11 -Eigenvalue lambda 3.02357653920282e+01 -Eigenvalue lambda 3.03135374703452e+01 -Eigenvalue lambda 3.85013899427150e+01 -Eigenvalue lambda 5.14395940116978e+01 -Eigenvalue lambda 5.15742481833418e+01 -Residual 8.05720052499174e-05 -Residual 9.77366136433341e-05 -Residual 5.87715311094864e-05 -Residual 1.00991497914808e-04 -Residual 9.93611224113933e-05 +Eigenvalue lambda 3.02357653920285e+01 +Eigenvalue lambda 3.03135374703450e+01 +Eigenvalue lambda 3.85013899427157e+01 +Eigenvalue lambda 5.14395940117001e+01 +Eigenvalue lambda 5.15742481833368e+01 +Residual 8.05720052532315e-05 +Residual 9.77366136479502e-05 +Residual 5.87715311287244e-05 +Residual 1.00991497909373e-04 +Residual 9.93611224218808e-05 23 iterations diff --git a/external/hypre/src/test/TEST_ams/solvers.saved.lassen b/external/hypre/src/test/TEST_ams/solvers.saved.lassen index a4a47fac..2a4d0684 100644 --- a/external/hypre/src/test/TEST_ams/solvers.saved.lassen +++ b/external/hypre/src/test/TEST_ams/solvers.saved.lassen @@ -1,117 +1,117 @@ # Output file: solvers.out.0 - Cycle 14 1.003820e-04 0.443695 7.475878e-06 - Cycle 15 4.456509e-05 0.443955 3.318954e-06 - Cycle 16 1.978675e-05 0.443997 1.473605e-06 - Cycle 17 8.792626e-06 0.444369 6.548248e-07 + Cycle 58 2.180961e-05 0.801052 1.624256e-06 + Cycle 59 1.747620e-05 0.801308 1.301528e-06 + Cycle 60 1.400242e-05 0.801228 1.042821e-06 + Cycle 61 1.121910e-05 0.801226 8.355349e-07 - Average Convergence Factor = 0.432756 + Average Convergence Factor = 0.794987 # Output file: solvers.out.1 - Cycle 14 1.003820e-04 0.443695 7.475878e-06 - Cycle 15 4.456509e-05 0.443955 3.318954e-06 - Cycle 16 1.978675e-05 0.443997 1.473605e-06 - Cycle 17 8.792626e-06 0.444369 6.548248e-07 + Cycle 58 2.180961e-05 0.801052 1.624256e-06 + Cycle 59 1.747620e-05 0.801308 1.301528e-06 + Cycle 60 1.400242e-05 0.801228 1.042821e-06 + Cycle 61 1.121910e-05 0.801226 8.355349e-07 - Average Convergence Factor = 0.432756 + Average Convergence Factor = 0.794987 # Output file: solvers.out.2 - Cycle 38 3.369434e-05 0.713724 2.509363e-06 - Cycle 39 2.404713e-05 0.713685 1.790894e-06 - Cycle 40 1.716799e-05 0.713931 1.278574e-06 - Cycle 41 1.225526e-05 0.713844 9.127023e-07 + Cycle 97 1.784019e-05 0.873467 1.328636e-06 + Cycle 98 1.557979e-05 0.873297 1.160294e-06 + Cycle 99 1.360847e-05 0.873470 1.013482e-06 + Cycle 100 1.188950e-05 0.873684 8.854624e-07 - Average Convergence Factor = 0.712346 + Average Convergence Factor = 0.869905 # Output file: solvers.out.3 - Cycle 38 3.369434e-05 0.713724 2.509363e-06 - Cycle 39 2.404713e-05 0.713685 1.790894e-06 - Cycle 40 1.716799e-05 0.713931 1.278574e-06 - Cycle 41 1.225526e-05 0.713844 9.127023e-07 + Cycle 97 1.784019e-05 0.873467 1.328636e-06 + Cycle 98 1.557979e-05 0.873297 1.160294e-06 + Cycle 99 1.360847e-05 0.873470 1.013482e-06 + Cycle 100 1.188950e-05 0.873684 8.854624e-07 - Average Convergence Factor = 0.712346 + Average Convergence Factor = 0.869905 # Output file: solvers.out.4 -Iterations = 6 -Final Relative Residual Norm = 6.842679e-07 +Iterations = 13 +Final Relative Residual Norm = 4.939034e-07 # Output file: solvers.out.5 -Iterations = 6 -Final Relative Residual Norm = 6.842679e-07 +Iterations = 13 +Final Relative Residual Norm = 4.939034e-07 # Output file: solvers.out.6 -Iterations = 9 -Final Relative Residual Norm = 9.378342e-07 +Iterations = 16 +Final Relative Residual Norm = 6.410653e-07 # Output file: solvers.out.7 -Iterations = 9 -Final Relative Residual Norm = 9.378342e-07 +Iterations = 16 +Final Relative Residual Norm = 6.410653e-07 # Output file: solvers.out.12 Iterations = 18 -Final Relative Residual Norm = 5.754561e-02 +Final Relative Residual Norm = 2.433983e+01 # Output file: solvers.out.8 -Eigenvalue lambda 3.02357653918663e+01 -Eigenvalue lambda 3.03135374700730e+01 -Eigenvalue lambda 3.85013899425891e+01 -Eigenvalue lambda 5.14395940123130e+01 -Eigenvalue lambda 5.15742481829733e+01 -Residual 5.33482232270343e-05 -Residual 5.22860302078229e-05 -Residual 4.48232393059438e-05 -Residual 1.06939003829700e-04 -Residual 1.08675530154519e-04 - -17 iterations +Eigenvalue lambda 3.02357653920079e+01 +Eigenvalue lambda 3.03135374702236e+01 +Eigenvalue lambda 3.85013899430559e+01 +Eigenvalue lambda 5.14395940112081e+01 +Eigenvalue lambda 5.15742481823856e+01 +Residual 7.45352588578718e-05 +Residual 7.43880032620007e-05 +Residual 1.26594022215394e-04 +Residual 8.99904406834779e-05 +Residual 9.30548921427010e-05 + +24 iterations # Output file: solvers.out.9 -Eigenvalue lambda 3.02357653918663e+01 -Eigenvalue lambda 3.03135374700730e+01 -Eigenvalue lambda 3.85013899425891e+01 -Eigenvalue lambda 5.14395940123130e+01 -Eigenvalue lambda 5.15742481829733e+01 -Residual 5.33482232270343e-05 -Residual 5.22860302078229e-05 -Residual 4.48232393059438e-05 -Residual 1.06939003829700e-04 -Residual 1.08675530154519e-04 - -17 iterations +Eigenvalue lambda 3.02357653920079e+01 +Eigenvalue lambda 3.03135374702236e+01 +Eigenvalue lambda 3.85013899430559e+01 +Eigenvalue lambda 5.14395940112081e+01 +Eigenvalue lambda 5.15742481823856e+01 +Residual 7.45352588578718e-05 +Residual 7.43880032620007e-05 +Residual 1.26594022215394e-04 +Residual 8.99904406834779e-05 +Residual 9.30548921427010e-05 + +24 iterations # Output file: solvers.out.10 -Eigenvalue lambda 3.02357653920130e+01 -Eigenvalue lambda 3.03135374702041e+01 -Eigenvalue lambda 3.85013899426646e+01 -Eigenvalue lambda 5.14395940117347e+01 -Eigenvalue lambda 5.15742481837296e+01 -Residual 8.66608457629204e-05 -Residual 7.54689609250768e-05 -Residual 5.61686440230009e-05 -Residual 9.69558816562899e-05 -Residual 1.09642437331197e-04 - -23 iterations +Eigenvalue lambda 3.02357653967707e+01 +Eigenvalue lambda 3.03135374800728e+01 +Eigenvalue lambda 3.85013899397799e+01 +Eigenvalue lambda 5.14395940101665e+01 +Eigenvalue lambda 5.15742480845151e+01 +Residual 8.77562666069003e-05 +Residual 1.06541449357735e-04 +Residual 8.94425865221178e-05 +Residual 1.08234881163452e-04 +Residual 1.17205182508686e-04 + +35 iterations # Output file: solvers.out.11 -Eigenvalue lambda 3.02357653920130e+01 -Eigenvalue lambda 3.03135374702041e+01 -Eigenvalue lambda 3.85013899426646e+01 -Eigenvalue lambda 5.14395940117347e+01 -Eigenvalue lambda 5.15742481837296e+01 -Residual 8.66608457629204e-05 -Residual 7.54689609250768e-05 -Residual 5.61686440230009e-05 -Residual 9.69558816562899e-05 -Residual 1.09642437331197e-04 - -23 iterations +Eigenvalue lambda 3.02357653967707e+01 +Eigenvalue lambda 3.03135374800728e+01 +Eigenvalue lambda 3.85013899397799e+01 +Eigenvalue lambda 5.14395940101665e+01 +Eigenvalue lambda 5.15742480845151e+01 +Residual 8.77562666069003e-05 +Residual 1.06541449357735e-04 +Residual 8.94425865221178e-05 +Residual 1.08234881163452e-04 +Residual 1.17205182508686e-04 + +35 iterations diff --git a/external/hypre/src/test/TEST_ams/solvers.saved.lassen_cpu b/external/hypre/src/test/TEST_ams/solvers.saved.lassen_cpu new file mode 100644 index 00000000..ce26acea --- /dev/null +++ b/external/hypre/src/test/TEST_ams/solvers.saved.lassen_cpu @@ -0,0 +1,117 @@ +# Output file: solvers.out.0 + Cycle 14 7.391091e-05 0.433321 5.504465e-06 + Cycle 15 3.204423e-05 0.433552 2.386472e-06 + Cycle 16 1.390144e-05 0.433820 1.035300e-06 + Cycle 17 6.033147e-06 0.433994 4.493145e-07 + + + Average Convergence Factor = 0.423273 + +# Output file: solvers.out.1 + Cycle 14 7.391091e-05 0.433321 5.504465e-06 + Cycle 15 3.204423e-05 0.433552 2.386472e-06 + Cycle 16 1.390144e-05 0.433820 1.035300e-06 + Cycle 17 6.033147e-06 0.433994 4.493145e-07 + + + Average Convergence Factor = 0.423273 + +# Output file: solvers.out.2 + Cycle 39 3.557147e-05 0.721153 2.649161e-06 + Cycle 40 2.564968e-05 0.721074 1.910242e-06 + Cycle 41 1.849492e-05 0.721059 1.377397e-06 + Cycle 42 1.334509e-05 0.721554 9.938662e-07 + + + Average Convergence Factor = 0.719580 + +# Output file: solvers.out.3 + Cycle 39 3.557147e-05 0.721153 2.649161e-06 + Cycle 40 2.564968e-05 0.721074 1.910242e-06 + Cycle 41 1.849492e-05 0.721059 1.377397e-06 + Cycle 42 1.334509e-05 0.721554 9.938662e-07 + + + Average Convergence Factor = 0.719580 + +# Output file: solvers.out.4 + +Iterations = 6 +Final Relative Residual Norm = 6.440241e-07 + +# Output file: solvers.out.5 + +Iterations = 6 +Final Relative Residual Norm = 6.440241e-07 + +# Output file: solvers.out.6 + +Iterations = 9 +Final Relative Residual Norm = 9.646766e-07 + +# Output file: solvers.out.7 + +Iterations = 9 +Final Relative Residual Norm = 9.646766e-07 + +# Output file: solvers.out.12 + +Iterations = 18 +Final Relative Residual Norm = 4.179935e-03 + +# Output file: solvers.out.8 + +Eigenvalue lambda 3.02357653918326e+01 +Eigenvalue lambda 3.03135374700829e+01 +Eigenvalue lambda 3.85013899426297e+01 +Eigenvalue lambda 5.14395940109399e+01 +Eigenvalue lambda 5.15742481830345e+01 +Residual 4.25157808762576e-05 +Residual 4.19035188905720e-05 +Residual 4.81288032817812e-05 +Residual 7.10760463236367e-05 +Residual 8.91382143291588e-05 + +17 iterations +# Output file: solvers.out.9 + +Eigenvalue lambda 3.02357653918326e+01 +Eigenvalue lambda 3.03135374700829e+01 +Eigenvalue lambda 3.85013899426297e+01 +Eigenvalue lambda 5.14395940109399e+01 +Eigenvalue lambda 5.15742481830345e+01 +Residual 4.25157808762576e-05 +Residual 4.19035188905720e-05 +Residual 4.81288032817812e-05 +Residual 7.10760463236367e-05 +Residual 8.91382143291588e-05 + +17 iterations +# Output file: solvers.out.10 + +Eigenvalue lambda 3.02357653920283e+01 +Eigenvalue lambda 3.03135374703454e+01 +Eigenvalue lambda 3.85013899427141e+01 +Eigenvalue lambda 5.14395940116978e+01 +Eigenvalue lambda 5.15742481833472e+01 +Residual 8.05720052502644e-05 +Residual 9.77366136562239e-05 +Residual 5.87715311134351e-05 +Residual 1.00991497903153e-04 +Residual 9.93611223972704e-05 + +23 iterations +# Output file: solvers.out.11 + +Eigenvalue lambda 3.02357653920283e+01 +Eigenvalue lambda 3.03135374703454e+01 +Eigenvalue lambda 3.85013899427141e+01 +Eigenvalue lambda 5.14395940116978e+01 +Eigenvalue lambda 5.15742481833472e+01 +Residual 8.05720052502644e-05 +Residual 9.77366136562239e-05 +Residual 5.87715311134351e-05 +Residual 1.00991497903153e-04 +Residual 9.93611223972704e-05 + +23 iterations diff --git a/external/hypre/src/test/TEST_ams/solvers.saved.ray b/external/hypre/src/test/TEST_ams/solvers.saved.ray deleted file mode 100644 index a435b678..00000000 --- a/external/hypre/src/test/TEST_ams/solvers.saved.ray +++ /dev/null @@ -1,117 +0,0 @@ -# Output file: solvers.out.0 - Cycle 14 1.003795e-04 0.443687 7.475693e-06 - Cycle 15 4.455956e-05 0.443911 3.318543e-06 - Cycle 16 1.979036e-05 0.444133 1.473873e-06 - Cycle 17 8.791560e-06 0.444234 6.547454e-07 - - - Average Convergence Factor = 0.432752 - -# Output file: solvers.out.1 - Cycle 14 1.003795e-04 0.443687 7.475693e-06 - Cycle 15 4.455956e-05 0.443911 3.318543e-06 - Cycle 16 1.979036e-05 0.444133 1.473873e-06 - Cycle 17 8.791560e-06 0.444234 6.547454e-07 - - - Average Convergence Factor = 0.432752 - -# Output file: solvers.out.2 - Cycle 38 3.369300e-05 0.713688 2.509263e-06 - Cycle 39 2.405174e-05 0.713850 1.791237e-06 - Cycle 40 1.716435e-05 0.713643 1.278303e-06 - Cycle 41 1.225445e-05 0.713948 9.126416e-07 - - - Average Convergence Factor = 0.712345 - -# Output file: solvers.out.3 - Cycle 38 3.369300e-05 0.713688 2.509263e-06 - Cycle 39 2.405174e-05 0.713850 1.791237e-06 - Cycle 40 1.716435e-05 0.713643 1.278303e-06 - Cycle 41 1.225445e-05 0.713948 9.126416e-07 - - - Average Convergence Factor = 0.712345 - -# Output file: solvers.out.4 - -Iterations = 6 -Final Relative Residual Norm = 6.843299e-07 - -# Output file: solvers.out.5 - -Iterations = 6 -Final Relative Residual Norm = 6.843299e-07 - -# Output file: solvers.out.6 - -Iterations = 9 -Final Relative Residual Norm = 9.378478e-07 - -# Output file: solvers.out.7 - -Iterations = 9 -Final Relative Residual Norm = 9.378478e-07 - -# Output file: solvers.out.12 - -Iterations = 18 -Final Relative Residual Norm = 4.582470e-02 - -# Output file: solvers.out.8 - -Eigenvalue lambda 3.02357653918664e+01 -Eigenvalue lambda 3.03135374700725e+01 -Eigenvalue lambda 3.85013899425893e+01 -Eigenvalue lambda 5.14395940123201e+01 -Eigenvalue lambda 5.15742481829777e+01 -Residual 5.33481978661958e-05 -Residual 5.22859545027289e-05 -Residual 4.48232237385845e-05 -Residual 1.06939001504331e-04 -Residual 1.08675672218529e-04 - -17 iterations -# Output file: solvers.out.9 - -Eigenvalue lambda 3.02357653918664e+01 -Eigenvalue lambda 3.03135374700725e+01 -Eigenvalue lambda 3.85013899425893e+01 -Eigenvalue lambda 5.14395940123201e+01 -Eigenvalue lambda 5.15742481829777e+01 -Residual 5.33481978661958e-05 -Residual 5.22859545027289e-05 -Residual 4.48232237385845e-05 -Residual 1.06939001504331e-04 -Residual 1.08675672218529e-04 - -17 iterations -# Output file: solvers.out.10 - -Eigenvalue lambda 3.02357653920128e+01 -Eigenvalue lambda 3.03135374702037e+01 -Eigenvalue lambda 3.85013899426639e+01 -Eigenvalue lambda 5.14395940117345e+01 -Eigenvalue lambda 5.15742481837252e+01 -Residual 8.66608457691982e-05 -Residual 7.54689609111018e-05 -Residual 5.61686440464391e-05 -Residual 9.69558816609399e-05 -Residual 1.09642437334342e-04 - -23 iterations -# Output file: solvers.out.11 - -Eigenvalue lambda 3.02357653920128e+01 -Eigenvalue lambda 3.03135374702037e+01 -Eigenvalue lambda 3.85013899426639e+01 -Eigenvalue lambda 5.14395940117345e+01 -Eigenvalue lambda 5.15742481837252e+01 -Residual 8.66608457691982e-05 -Residual 7.54689609111018e-05 -Residual 5.61686440464391e-05 -Residual 9.69558816609399e-05 -Residual 1.09642437334342e-04 - -23 iterations diff --git a/external/hypre/src/test/TEST_ams/solvers.saved.tioga b/external/hypre/src/test/TEST_ams/solvers.saved.tioga new file mode 100644 index 00000000..b3bab421 --- /dev/null +++ b/external/hypre/src/test/TEST_ams/solvers.saved.tioga @@ -0,0 +1,117 @@ +# Output file: solvers.out.0 + Cycle 52 2.432799e-05 0.789655 1.811810e-06 + Cycle 53 1.921940e-05 0.790012 1.431352e-06 + Cycle 54 1.518539e-05 0.790107 1.130921e-06 + Cycle 55 1.200092e-05 0.790294 8.937605e-07 + + + Average Convergence Factor = 0.776287 + +# Output file: solvers.out.1 + Cycle 52 2.432799e-05 0.789655 1.811810e-06 + Cycle 53 1.921940e-05 0.790012 1.431352e-06 + Cycle 54 1.518539e-05 0.790107 1.130921e-06 + Cycle 55 1.200092e-05 0.790294 8.937605e-07 + + + Average Convergence Factor = 0.776287 + +# Output file: solvers.out.2 + Cycle 102 1.884886e-05 0.881924 1.403756e-06 + Cycle 103 1.662181e-05 0.881847 1.237898e-06 + Cycle 104 1.465878e-05 0.881900 1.091702e-06 + Cycle 105 1.292522e-05 0.881739 9.625970e-07 + + + Average Convergence Factor = 0.876394 + +# Output file: solvers.out.3 + Cycle 102 1.884886e-05 0.881924 1.403756e-06 + Cycle 103 1.662181e-05 0.881847 1.237898e-06 + Cycle 104 1.465878e-05 0.881900 1.091702e-06 + Cycle 105 1.292522e-05 0.881739 9.625970e-07 + + + Average Convergence Factor = 0.876394 + +# Output file: solvers.out.4 + +Iterations = 13 +Final Relative Residual Norm = 4.186509e-07 + +# Output file: solvers.out.5 + +Iterations = 13 +Final Relative Residual Norm = 4.186509e-07 + +# Output file: solvers.out.6 + +Iterations = 16 +Final Relative Residual Norm = 9.720506e-07 + +# Output file: solvers.out.7 + +Iterations = 16 +Final Relative Residual Norm = 9.720506e-07 + +# Output file: solvers.out.12 + +Iterations = 18 +Final Relative Residual Norm = 1.952380e+01 + +# Output file: solvers.out.8 + +Eigenvalue lambda 3.02357653921852e+01 +Eigenvalue lambda 3.03135374702992e+01 +Eigenvalue lambda 3.85013899428591e+01 +Eigenvalue lambda 5.14395940113556e+01 +Eigenvalue lambda 5.15742481828119e+01 +Residual 1.12566352525743e-04 +Residual 1.02377055805912e-04 +Residual 9.77540709672278e-05 +Residual 1.08807691685354e-04 +Residual 1.16451618925874e-04 + +24 iterations +# Output file: solvers.out.9 + +Eigenvalue lambda 3.02357653921852e+01 +Eigenvalue lambda 3.03135374702992e+01 +Eigenvalue lambda 3.85013899428591e+01 +Eigenvalue lambda 5.14395940113556e+01 +Eigenvalue lambda 5.15742481828119e+01 +Residual 1.12566352525743e-04 +Residual 1.02377055805912e-04 +Residual 9.77540709672278e-05 +Residual 1.08807691685354e-04 +Residual 1.16451618925874e-04 + +24 iterations +# Output file: solvers.out.10 + +Eigenvalue lambda 3.02357653918967e+01 +Eigenvalue lambda 3.03135374700399e+01 +Eigenvalue lambda 3.85013899425749e+01 +Eigenvalue lambda 5.14395940102517e+01 +Eigenvalue lambda 5.15742481828689e+01 +Residual 9.46960846127793e-05 +Residual 7.49350518395312e-05 +Residual 9.49105044744681e-05 +Residual 1.18284840227265e-04 +Residual 1.04914545371963e-04 + +31 iterations +# Output file: solvers.out.11 + +Eigenvalue lambda 3.02357653918967e+01 +Eigenvalue lambda 3.03135374700399e+01 +Eigenvalue lambda 3.85013899425749e+01 +Eigenvalue lambda 5.14395940102517e+01 +Eigenvalue lambda 5.15742481828689e+01 +Residual 9.46960846127793e-05 +Residual 7.49350518395312e-05 +Residual 9.49105044744681e-05 +Residual 1.18284840227265e-04 +Residual 1.04914545371963e-04 + +31 iterations diff --git a/external/hypre/src/test/TEST_ams/solvers.sh b/external/hypre/src/test/TEST_ams/solvers.sh old mode 100644 new mode 100755 index 2c80ad4a..53b16a33 --- a/external/hypre/src/test/TEST_ams/solvers.sh +++ b/external/hypre/src/test/TEST_ams/solvers.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_bench/benchmark_ij.jobs b/external/hypre/src/test/TEST_bench/benchmark_ij.jobs old mode 100644 new mode 100755 index f16ded69..3829785b --- a/external/hypre/src/test/TEST_bench/benchmark_ij.jobs +++ b/external/hypre/src/test/TEST_bench/benchmark_ij.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -9,80 +9,85 @@ #============================================================================= # RAP 1 -mpirun -np 4 ./ij -n 256 256 128 -P 2 2 1 -pmis -keepT 1 -rlx 18 -exec_device -rap 1 -mod_rap2 1 -mm_cusparse 0 -interptype 3 -solver 1 \ +mpirun -np 4 ./ij -n 256 256 128 -P 2 2 1 -pmis -keepT 1 -rlx 18 -exec_device -rap 1 -mod_rap2 1 -mm_vendor 0 -interptype 3 -solver 1 -benchmark 1 \ > benchmark_ij.out.1 -mpirun -np 3 ./ij -n 128 128 384 -P 1 1 3 -pmis -keepT 1 -rlx 7 -w 0.85 -exec_device -rap 1 -mod_rap2 1 -mm_cusparse 0 -interptype 3 -solver 1 \ +mpirun -np 3 ./ij -n 128 128 384 -P 1 1 3 -pmis -keepT 1 -rlx 7 -w 0.85 -exec_device -rap 1 -mod_rap2 1 -mm_vendor 0 -interptype 3 -solver 1 -benchmark 1 \ >> benchmark_ij.out.2 -mpirun -np 4 ./ij -n 4096 4096 1 -P 2 2 1 -9pt -pmis -keepT 1 -rlx 18 -exec_device -rap 1 -mod_rap2 1 -mm_cusparse 0 -interptype 3 -solver 1 \ +mpirun -np 4 ./ij -n 4096 4096 1 -P 2 2 1 -9pt -pmis -keepT 1 -rlx 18 -exec_device -rap 1 -mod_rap2 1 -mm_vendor 0 -interptype 3 -solver 1 -benchmark 1 \ >> benchmark_ij.out.3 -mpirun -np 4 ./ij -n 256 256 128 -P 2 2 1 -pmis -keepT 1 -rlx 18 -exec_device -rap 1 -mod_rap2 1 -mm_cusparse 0 -interptype 14 -solver 1 \ +mpirun -np 4 ./ij -n 256 256 128 -P 2 2 1 -pmis -keepT 1 -rlx 18 -exec_device -rap 1 -mod_rap2 1 -mm_vendor 0 -interptype 14 -solver 1 -benchmark 1 \ >> benchmark_ij.out.4 -mpirun -np 4 ./ij -n 256 256 128 -P 2 2 1 -27pt -pmis -keepT 1 -rlx 18 -exec_device -rap 1 -mod_rap2 1 -mm_cusparse 0 -interptype 6 -solver 1 \ +mpirun -np 4 ./ij -n 256 256 128 -P 2 2 1 -27pt -pmis -keepT 1 -rlx 18 -exec_device -rap 1 -mod_rap2 1 -mm_vendor 0 -interptype 6 -solver 1 -benchmark 1 \ >> benchmark_ij.out.5 -mpirun -np 4 ./ij -n 4096 4096 1 -P 2 2 1 -9pt -pmis -keepT 1 -rlx 18 -exec_device -rap 1 -mod_rap2 1 -mm_cusparse 0 -interptype 15 -solver 1 \ +mpirun -np 4 ./ij -n 4096 4096 1 -P 2 2 1 -9pt -pmis -keepT 1 -rlx 18 -exec_device -rap 1 -mod_rap2 1 -mm_vendor 0 -interptype 15 -solver 1 -benchmark 1 \ >> benchmark_ij.out.6 -mpirun -np 4 ./ij -n 4096 4096 1 -P 2 2 1 -9pt -pmis -keepT 1 -rlx 18 -exec_device -rap 1 -mod_rap2 1 -mm_cusparse 0 -interptype 18 -solver 1 \ +mpirun -np 4 ./ij -n 4096 4096 1 -P 2 2 1 -9pt -pmis -keepT 1 -rlx 18 -exec_device -rap 1 -mod_rap2 1 -mm_vendor 0 -interptype 18 -solver 1 -benchmark 1 \ >> benchmark_ij.out.7 # RAP 0 -mpirun -np 4 ./ij -n 256 256 128 -P 2 2 1 -pmis -keepT 1 -rlx 18 -exec_device -rap 0 -mod_rap2 1 -mm_cusparse 0 -interptype 3 -solver 1 \ +mpirun -np 4 ./ij -n 256 256 128 -P 2 2 1 -pmis -keepT 1 -rlx 18 -exec_device -rap 0 -mod_rap2 1 -mm_vendor 0 -interptype 3 -solver 1 -benchmark 1 \ > benchmark_ij.out.8 -mpirun -np 3 ./ij -n 128 128 384 -P 1 1 3 -pmis -keepT 1 -rlx 7 -w 0.85 -exec_device -rap 0 -mod_rap2 1 -mm_cusparse 0 -interptype 3 -solver 1 \ +mpirun -np 3 ./ij -n 128 128 384 -P 1 1 3 -pmis -keepT 1 -rlx 7 -w 0.85 -exec_device -rap 0 -mod_rap2 1 -mm_vendor 0 -interptype 3 -solver 1 -benchmark 1 \ >> benchmark_ij.out.9 -mpirun -np 4 ./ij -n 4096 4096 1 -P 2 2 1 -9pt -pmis -keepT 1 -rlx 18 -exec_device -rap 0 -mod_rap2 1 -mm_cusparse 0 -interptype 3 -solver 1 \ +mpirun -np 4 ./ij -n 4096 4096 1 -P 2 2 1 -9pt -pmis -keepT 1 -rlx 18 -exec_device -rap 0 -mod_rap2 1 -mm_vendor 0 -interptype 3 -solver 1 -benchmark 1 \ >> benchmark_ij.out.10 -mpirun -np 4 ./ij -n 256 256 128 -P 2 2 1 -pmis -keepT 1 -rlx 18 -exec_device -rap 0 -mod_rap2 1 -mm_cusparse 0 -interptype 14 -solver 1 \ +mpirun -np 4 ./ij -n 256 256 128 -P 2 2 1 -pmis -keepT 1 -rlx 18 -exec_device -rap 0 -mod_rap2 1 -mm_vendor 0 -interptype 14 -solver 1 -benchmark 1 \ >> benchmark_ij.out.11 -mpirun -np 4 ./ij -n 256 256 128 -P 2 2 1 -27pt -pmis -keepT 1 -rlx 18 -exec_device -rap 0 -mod_rap2 1 -mm_cusparse 0 -interptype 6 -solver 1 \ +mpirun -np 4 ./ij -n 256 256 128 -P 2 2 1 -27pt -pmis -keepT 1 -rlx 18 -exec_device -rap 0 -mod_rap2 1 -mm_vendor 0 -interptype 6 -solver 1 -benchmark 1 \ >> benchmark_ij.out.12 -mpirun -np 4 ./ij -n 4096 4096 1 -P 2 2 1 -9pt -pmis -keepT 1 -rlx 18 -exec_device -rap 0 -mod_rap2 1 -mm_cusparse 0 -interptype 15 -solver 1 \ +mpirun -np 4 ./ij -n 4096 4096 1 -P 2 2 1 -9pt -pmis -keepT 1 -rlx 18 -exec_device -rap 0 -mod_rap2 1 -mm_vendor 0 -interptype 15 -solver 1 -benchmark 1 \ >> benchmark_ij.out.13 - -mpirun -np 1 ./ij -n 256 256 256 -P 1 1 1 -pmis -keepT 1 -rlx 18 -exec_device -rap 1 -mod_rap2 1 -mm_cusparse 0 -interptype 6 -solver 1 \ +mpirun -np 1 ./ij -n 256 256 256 -P 1 1 1 -pmis -keepT 1 -rlx 18 -exec_device -rap 1 -mod_rap2 1 -mm_vendor 0 -interptype 6 -solver 1 -benchmark 1 \ >> benchmark_ij.out.14 -mpirun -np 1 ./ij -n 256 256 256 -P 1 1 1 -pmis -keepT 1 -rlx 18 -exec_device -rap 0 -mod_rap2 1 -mm_cusparse 0 -interptype 14 -solver 1 \ +mpirun -np 1 ./ij -n 256 256 256 -P 1 1 1 -pmis -keepT 1 -rlx 18 -exec_device -rap 0 -mod_rap2 1 -mm_vendor 0 -interptype 14 -solver 1 -benchmark 1 \ >> benchmark_ij.out.15 -mpirun -np 1 ./ij -n 256 256 256 -P 1 1 1 -pmis -keepT 1 -rlx 18 -exec_device -rap 0 -mod_rap2 1 -mm_cusparse 0 -interptype 18 -solver 1 \ +mpirun -np 1 ./ij -n 256 256 256 -P 1 1 1 -pmis -keepT 1 -rlx 18 -exec_device -rap 0 -mod_rap2 1 -mm_vendor 0 -interptype 18 -solver 1 -benchmark 1 \ >> benchmark_ij.out.16 -mpirun -np 4 ./ij -n 256 256 128 -P 2 2 1 -27pt -pmis -keepT 1 -rlx 7 -w 0.85 -exec_device -mm_cusparse 0 -agg_nl 1 -agg_interp 5 -solver 1 \ +mpirun -np 4 ./ij -n 256 256 128 -P 2 2 1 -27pt -pmis -keepT 1 -rlx 7 -w 0.85 -exec_device -mm_vendor 0 -agg_nl 1 -agg_interp 5 -solver 1 -benchmark 1 \ >> benchmark_ij.out.17 -mpirun -np 4 ./ij -n 256 256 128 -P 2 2 1 -pmis -keepT 1 -rlx 7 -w 0.85 -exec_device -mm_cusparse 0 -agg_nl 1 -agg_interp 7 -agg_P12_mx 4 -solver 1 \ +mpirun -np 4 ./ij -n 256 256 128 -P 2 2 1 -pmis -keepT 1 -rlx 7 -w 0.85 -exec_device -mm_vendor 0 -agg_nl 1 -agg_interp 7 -agg_P12_mx 4 -solver 1 -benchmark 1 \ >> benchmark_ij.out.18 -mpirun -np 4 ./ij -n 128 128 128 -P 2 2 1 -pmis -keepT 1 -rlx 7 -w 0.5 -exec_device -mm_cusparse 0 -agg_nl 1 -agg_interp 5 -agg_Pmx 4 -interptype 18 -solver 1 -sysL 3 -nf 3 \ +mpirun -np 4 ./ij -n 128 128 128 -P 2 2 1 -pmis -keepT 1 -rlx 7 -w 0.5 -exec_device -mm_vendor 0 -agg_nl 1 -agg_interp 5 -agg_Pmx 4 -interptype 18 -solver 1 -sysL 3 -nf 3 -benchmark 1 \ >> benchmark_ij.out.19 -mpirun -np 2 ./ij -n 200 128 128 -P 2 1 1 -pmis -keepT 1 -rlx 7 -w 0.7 -exec_device -mm_cusparse 0 -agg_nl 1 -agg_interp 5 -agg_Pmx 4 -interptype 18 -solver 1 -vardifconv -eps 1 \ +mpirun -np 2 ./ij -n 200 128 128 -P 2 1 1 -pmis -keepT 1 -rlx 7 -w 0.7 -exec_device -mm_vendor 0 -agg_nl 1 -agg_interp 5 -agg_Pmx 4 -interptype 18 -solver 1 -vardifconv -eps 1 -benchmark 1 \ >> benchmark_ij.out.20 -mpirun -np 4 ./ij -n 200 200 200 -P 2 2 1 -pmis -keepT 1 -rlx 18 -ns 2 -exec_device -mm_cusparse 0 -agg_nl 3 -agg_interp 7 -agg_P12_mx 6 -interptype 6 -solver 1 \ +mpirun -np 4 ./ij -n 200 200 200 -P 2 2 1 -pmis -keepT 1 -rlx 18 -ns 2 -exec_device -mm_vendor 0 -agg_nl 3 -agg_interp 7 -agg_P12_mx 6 -interptype 6 -solver 1 -benchmark 1 \ >> benchmark_ij.out.21 - -mpirun -np 4 ./ij -n 256 256 128 -P 2 2 1 -rlx 16 -cheby_scale 1 -cheby_eig_est 10 -exec_device -solver 1 \ +mpirun -np 4 ./ij -n 256 256 128 -P 2 2 1 -rlx 16 -cheby_scale 1 -cheby_eig_est 10 -exec_device -solver 1 -benchmark 1 \ >> benchmark_ij.out.22 -mpirun -np 4 ./ij -n 256 256 128 -P 2 2 1 -rlx 16 -cheby_scale 0 -cheby_eig_est 10 -exec_device -solver 1 \ +mpirun -np 4 ./ij -n 256 256 128 -P 2 2 1 -rlx 16 -cheby_scale 0 -cheby_eig_est 10 -exec_device -solver 1 -benchmark 1 \ >> benchmark_ij.out.23 -mpirun -np 4 ./ij -n 256 256 128 -P 2 2 1 -rlx 16 -cheby_scale 1 -cheby_eig_est 0 -exec_device -solver 1 \ +mpirun -np 4 ./ij -n 256 256 128 -P 2 2 1 -rlx 16 -cheby_scale 1 -cheby_eig_est 0 -exec_device -solver 1 -benchmark 1 \ >> benchmark_ij.out.24 -mpirun -np 4 ./ij -n 256 256 128 -P 2 2 1 -rlx 16 -cheby_scale 0 -cheby_eig_est 0 -exec_device -solver 1 \ +mpirun -np 4 ./ij -n 256 256 128 -P 2 2 1 -rlx 16 -cheby_scale 0 -cheby_eig_est 0 -exec_device -solver 1 -benchmark 1 \ >> benchmark_ij.out.25 + +mpirun -np 4 ./ij -n 248 248 248 -P 2 2 1 -27pt -pmis -keepT 1 -rlx 18 -ns 2 -exec_device -rap 1 -mod_rap2 1 -mm_vendor 0 -agg_nl 2 -agg_interp 8 -interptype 6 -mxrs 0.9 -Pmx 8 -solver 1 -benchmark 1 \ + >> benchmark_ij.out.26 + +mpirun -np 4 ./ij -n 256 256 256 -P 1 2 2 -27pt -pmis -keepT 1 -rlx 18 -ns 2 -exec_device -rap 0 -mod_rap2 1 -mm_vendor 0 -agg_nl 1 -agg_interp 9 -interptype 6 -mxrs 0.9 -Pmx 8 -solver 1 -benchmark 1 \ + >> benchmark_ij.out.27 + diff --git a/external/hypre/src/test/TEST_bench/benchmark_ij.perf.saved.lassen b/external/hypre/src/test/TEST_bench/benchmark_ij.perf.saved.lassen index 91e850d0..f4162a30 100644 --- a/external/hypre/src/test/TEST_bench/benchmark_ij.perf.saved.lassen +++ b/external/hypre/src/test/TEST_bench/benchmark_ij.perf.saved.lassen @@ -1,75 +1,81 @@ # Output file: benchmark_ij.out.1 -PCG Setup wall clock time = 0.442274 seconds -PCG Solve wall clock time = 0.586363 seconds +PCG Setup wall clock time = 0.160712 seconds +PCG Solve wall clock time = 0.411117 seconds # Output file: benchmark_ij.out.2 -PCG Setup wall clock time = 0.421415 seconds -PCG Solve wall clock time = 0.481981 seconds +PCG Setup wall clock time = 0.153834 seconds +PCG Solve wall clock time = 0.333679 seconds # Output file: benchmark_ij.out.3 -PCG Setup wall clock time = 0.592196 seconds -PCG Solve wall clock time = 1.116149 seconds +PCG Setup wall clock time = 0.190193 seconds +PCG Solve wall clock time = 0.867654 seconds # Output file: benchmark_ij.out.4 -PCG Setup wall clock time = 0.574467 seconds -PCG Solve wall clock time = 0.224829 seconds +PCG Setup wall clock time = 0.219071 seconds +PCG Solve wall clock time = 0.155456 seconds # Output file: benchmark_ij.out.5 -PCG Setup wall clock time = 0.760889 seconds -PCG Solve wall clock time = 0.208459 seconds +PCG Setup wall clock time = 0.251006 seconds +PCG Solve wall clock time = 0.160191 seconds # Output file: benchmark_ij.out.6 -PCG Setup wall clock time = 0.551022 seconds -PCG Solve wall clock time = 1.059372 seconds +PCG Setup wall clock time = 0.187103 seconds +PCG Solve wall clock time = 0.823428 seconds # Output file: benchmark_ij.out.7 -PCG Setup wall clock time = 0.759444 seconds -PCG Solve wall clock time = 0.265704 seconds +PCG Setup wall clock time = 0.270900 seconds +PCG Solve wall clock time = 0.199480 seconds # Output file: benchmark_ij.out.8 -PCG Setup wall clock time = 0.411739 seconds -PCG Solve wall clock time = 0.572450 seconds +PCG Setup wall clock time = 0.147579 seconds +PCG Solve wall clock time = 0.400133 seconds # Output file: benchmark_ij.out.9 -PCG Setup wall clock time = 0.409877 seconds -PCG Solve wall clock time = 0.485815 seconds +PCG Setup wall clock time = 0.139928 seconds +PCG Solve wall clock time = 0.339869 seconds # Output file: benchmark_ij.out.10 -PCG Setup wall clock time = 0.537107 seconds -PCG Solve wall clock time = 1.159050 seconds +PCG Setup wall clock time = 0.175378 seconds +PCG Solve wall clock time = 0.877038 seconds # Output file: benchmark_ij.out.11 -PCG Setup wall clock time = 0.588887 seconds -PCG Solve wall clock time = 0.225021 seconds +PCG Setup wall clock time = 0.205073 seconds +PCG Solve wall clock time = 0.154485 seconds # Output file: benchmark_ij.out.12 -PCG Setup wall clock time = 0.738114 seconds -PCG Solve wall clock time = 0.206896 seconds +PCG Setup wall clock time = 0.236875 seconds +PCG Solve wall clock time = 0.155606 seconds # Output file: benchmark_ij.out.13 -PCG Setup wall clock time = 0.576056 seconds -PCG Solve wall clock time = 1.061516 seconds +PCG Setup wall clock time = 0.169760 seconds +PCG Solve wall clock time = 0.823498 seconds # Output file: benchmark_ij.out.14 -PCG Setup wall clock time = 3.096025 seconds -PCG Solve wall clock time = 0.745310 seconds +PCG Setup wall clock time = 0.705901 seconds +PCG Solve wall clock time = 0.580016 seconds # Output file: benchmark_ij.out.15 -PCG Setup wall clock time = 3.102031 seconds -PCG Solve wall clock time = 0.794782 seconds +PCG Setup wall clock time = 0.671039 seconds +PCG Solve wall clock time = 0.647755 seconds # Output file: benchmark_ij.out.16 -PCG Setup wall clock time = 3.024356 seconds -PCG Solve wall clock time = 0.745560 seconds +PCG Setup wall clock time = 0.693543 seconds +PCG Solve wall clock time = 0.607744 seconds # Output file: benchmark_ij.out.17 -PCG Setup wall clock time = 0.735291 seconds -PCG Solve wall clock time = 0.199601 seconds +PCG Setup wall clock time = 0.263890 seconds +PCG Solve wall clock time = 0.160268 seconds # Output file: benchmark_ij.out.18 -PCG Setup wall clock time = 0.441699 seconds -PCG Solve wall clock time = 0.180786 seconds +PCG Setup wall clock time = 0.223569 seconds +PCG Solve wall clock time = 0.125239 seconds # Output file: benchmark_ij.out.19 -PCG Setup wall clock time = 0.599613 seconds -PCG Solve wall clock time = 0.423136 seconds +PCG Setup wall clock time = 0.264460 seconds +PCG Solve wall clock time = 0.315377 seconds # Output file: benchmark_ij.out.20 -PCG Setup wall clock time = 0.351212 seconds -PCG Solve wall clock time = 0.248475 seconds +PCG Setup wall clock time = 0.175446 seconds +PCG Solve wall clock time = 0.179951 seconds # Output file: benchmark_ij.out.21 -PCG Setup wall clock time = 0.473500 seconds -PCG Solve wall clock time = 0.245645 seconds +PCG Setup wall clock time = 0.233091 seconds +PCG Solve wall clock time = 0.208051 seconds # Output file: benchmark_ij.out.22 -PCG Setup wall clock time = 0.585721 seconds -PCG Solve wall clock time = 0.184083 seconds +PCG Setup wall clock time = 0.242838 seconds +PCG Solve wall clock time = 0.194378 seconds # Output file: benchmark_ij.out.23 -PCG Setup wall clock time = 0.577237 seconds -PCG Solve wall clock time = 0.187903 seconds +PCG Setup wall clock time = 0.238777 seconds +PCG Solve wall clock time = 0.178903 seconds # Output file: benchmark_ij.out.24 -PCG Setup wall clock time = 0.554462 seconds -PCG Solve wall clock time = 0.212726 seconds +PCG Setup wall clock time = 0.211336 seconds +PCG Solve wall clock time = 0.193785 seconds # Output file: benchmark_ij.out.25 -PCG Setup wall clock time = 0.572496 seconds -PCG Solve wall clock time = 0.214806 seconds +PCG Setup wall clock time = 0.211109 seconds +PCG Solve wall clock time = 0.202104 seconds +# Output file: benchmark_ij.out.26 +PCG Setup wall clock time = 0.256645 seconds +PCG Solve wall clock time = 0.618981 seconds +# Output file: benchmark_ij.out.27 +PCG Setup wall clock time = 0.282368 seconds +PCG Solve wall clock time = 0.411413 seconds diff --git a/external/hypre/src/test/TEST_bench/benchmark_ij.perf.saved.ray b/external/hypre/src/test/TEST_bench/benchmark_ij.perf.saved.ray deleted file mode 100644 index 3f925306..00000000 --- a/external/hypre/src/test/TEST_bench/benchmark_ij.perf.saved.ray +++ /dev/null @@ -1,75 +0,0 @@ -# Output file: benchmark_ij.out.1 -PCG Setup wall clock time = 0.447182 seconds -PCG Solve wall clock time = 0.667648 seconds -# Output file: benchmark_ij.out.2 -PCG Setup wall clock time = 0.442885 seconds -PCG Solve wall clock time = 0.525688 seconds -# Output file: benchmark_ij.out.3 -PCG Setup wall clock time = 0.594930 seconds -PCG Solve wall clock time = 1.403769 seconds -# Output file: benchmark_ij.out.4 -PCG Setup wall clock time = 0.598627 seconds -PCG Solve wall clock time = 0.272439 seconds -# Output file: benchmark_ij.out.5 -PCG Setup wall clock time = 0.771948 seconds -PCG Solve wall clock time = 0.267343 seconds -# Output file: benchmark_ij.out.6 -PCG Setup wall clock time = 0.589172 seconds -PCG Solve wall clock time = 1.272172 seconds -# Output file: benchmark_ij.out.7 -PCG Setup wall clock time = 0.803751 seconds -PCG Solve wall clock time = 0.328909 seconds -# Output file: benchmark_ij.out.8 -PCG Setup wall clock time = 0.417764 seconds -PCG Solve wall clock time = 0.655497 seconds -# Output file: benchmark_ij.out.9 -PCG Setup wall clock time = 0.410270 seconds -PCG Solve wall clock time = 0.525057 seconds -# Output file: benchmark_ij.out.10 -PCG Setup wall clock time = 0.565856 seconds -PCG Solve wall clock time = 1.398698 seconds -# Output file: benchmark_ij.out.11 -PCG Setup wall clock time = 0.575358 seconds -PCG Solve wall clock time = 0.268788 seconds -# Output file: benchmark_ij.out.12 -PCG Setup wall clock time = 0.733949 seconds -PCG Solve wall clock time = 0.266458 seconds -# Output file: benchmark_ij.out.13 -PCG Setup wall clock time = 0.561592 seconds -PCG Solve wall clock time = 1.272704 seconds -# Output file: benchmark_ij.out.14 -PCG Setup wall clock time = 3.677906 seconds -PCG Solve wall clock time = 1.281065 seconds -# Output file: benchmark_ij.out.15 -PCG Setup wall clock time = 3.627375 seconds -PCG Solve wall clock time = 1.379409 seconds -# Output file: benchmark_ij.out.16 -PCG Setup wall clock time = 3.566712 seconds -PCG Solve wall clock time = 1.223101 seconds -# Output file: benchmark_ij.out.17 -PCG Setup wall clock time = 0.767321 seconds -PCG Solve wall clock time = 0.259651 seconds -# Output file: benchmark_ij.out.18 -PCG Setup wall clock time = 0.487871 seconds -PCG Solve wall clock time = 0.194575 seconds -# Output file: benchmark_ij.out.19 -PCG Setup wall clock time = 0.633908 seconds -PCG Solve wall clock time = 0.498295 seconds -# Output file: benchmark_ij.out.20 -PCG Setup wall clock time = 0.372523 seconds -PCG Solve wall clock time = 0.292024 seconds -# Output file: benchmark_ij.out.21 -PCG Setup wall clock time = 0.495310 seconds -PCG Solve wall clock time = 0.306979 seconds -# Output file: benchmark_ij.out.22 -PCG Setup wall clock time = 0.621549 seconds -PCG Solve wall clock time = 0.237298 seconds -# Output file: benchmark_ij.out.23 -PCG Setup wall clock time = 0.604897 seconds -PCG Solve wall clock time = 0.232853 seconds -# Output file: benchmark_ij.out.24 -PCG Setup wall clock time = 0.610861 seconds -PCG Solve wall clock time = 0.261864 seconds -# Output file: benchmark_ij.out.25 -PCG Setup wall clock time = 0.574478 seconds -PCG Solve wall clock time = 0.268362 seconds diff --git a/external/hypre/src/test/TEST_bench/benchmark_ij.perf.saved.tioga b/external/hypre/src/test/TEST_bench/benchmark_ij.perf.saved.tioga new file mode 100644 index 00000000..f335bba3 --- /dev/null +++ b/external/hypre/src/test/TEST_bench/benchmark_ij.perf.saved.tioga @@ -0,0 +1,81 @@ +# Output file: benchmark_ij.out.1 +PCG Setup wall clock time = 0.170772 seconds +PCG Solve wall clock time = 0.335337 seconds +# Output file: benchmark_ij.out.2 +PCG Setup wall clock time = 0.163119 seconds +PCG Solve wall clock time = 0.271529 seconds +# Output file: benchmark_ij.out.3 +PCG Setup wall clock time = 0.201941 seconds +PCG Solve wall clock time = 0.672232 seconds +# Output file: benchmark_ij.out.4 +PCG Setup wall clock time = 0.226705 seconds +PCG Solve wall clock time = 0.152017 seconds +# Output file: benchmark_ij.out.5 +PCG Setup wall clock time = 0.254766 seconds +PCG Solve wall clock time = 0.137966 seconds +# Output file: benchmark_ij.out.6 +PCG Setup wall clock time = 0.204024 seconds +PCG Solve wall clock time = 0.613917 seconds +# Output file: benchmark_ij.out.7 +PCG Setup wall clock time = 0.282569 seconds +PCG Solve wall clock time = 0.158339 seconds +# Output file: benchmark_ij.out.8 +PCG Setup wall clock time = 0.159975 seconds +PCG Solve wall clock time = 0.334356 seconds +# Output file: benchmark_ij.out.9 +PCG Setup wall clock time = 0.151504 seconds +PCG Solve wall clock time = 0.272460 seconds +# Output file: benchmark_ij.out.10 +PCG Setup wall clock time = 0.190785 seconds +PCG Solve wall clock time = 0.639297 seconds +# Output file: benchmark_ij.out.11 +PCG Setup wall clock time = 0.217895 seconds +PCG Solve wall clock time = 0.145796 seconds +# Output file: benchmark_ij.out.12 +PCG Setup wall clock time = 0.245100 seconds +PCG Solve wall clock time = 0.132285 seconds +# Output file: benchmark_ij.out.13 +PCG Setup wall clock time = 0.188967 seconds +PCG Solve wall clock time = 0.596166 seconds +# Output file: benchmark_ij.out.14 +PCG Setup wall clock time = 0.953187 seconds +PCG Solve wall clock time = 0.680926 seconds +# Output file: benchmark_ij.out.15 +PCG Setup wall clock time = 0.868636 seconds +PCG Solve wall clock time = 0.733326 seconds +# Output file: benchmark_ij.out.16 +PCG Setup wall clock time = 0.882904 seconds +PCG Solve wall clock time = 0.647630 seconds +# Output file: benchmark_ij.out.17 +PCG Setup wall clock time = 0.243402 seconds +PCG Solve wall clock time = 0.143477 seconds +# Output file: benchmark_ij.out.18 +PCG Setup wall clock time = 0.231762 seconds +PCG Solve wall clock time = 0.111623 seconds +# Output file: benchmark_ij.out.19 +PCG Setup wall clock time = 0.276950 seconds +PCG Solve wall clock time = 0.324065 seconds +# Output file: benchmark_ij.out.20 +PCG Setup wall clock time = 0.185776 seconds +PCG Solve wall clock time = 0.177456 seconds +# Output file: benchmark_ij.out.21 +PCG Setup wall clock time = 0.240707 seconds +PCG Solve wall clock time = 0.189251 seconds +# Output file: benchmark_ij.out.22 +PCG Setup wall clock time = 0.291317 seconds +PCG Solve wall clock time = 0.205310 seconds +# Output file: benchmark_ij.out.23 +PCG Setup wall clock time = 0.288176 seconds +PCG Solve wall clock time = 0.199249 seconds +# Output file: benchmark_ij.out.24 +PCG Setup wall clock time = 0.258924 seconds +PCG Solve wall clock time = 0.228139 seconds +# Output file: benchmark_ij.out.25 +PCG Setup wall clock time = 0.257346 seconds +PCG Solve wall clock time = 0.233506 seconds +# Output file: benchmark_ij.out.26 +PCG Setup wall clock time = 0.265667 seconds +PCG Solve wall clock time = 0.438971 seconds +# Output file: benchmark_ij.out.27 +PCG Setup wall clock time = 0.287397 seconds +PCG Solve wall clock time = 0.319967 seconds diff --git a/external/hypre/src/test/TEST_bench/benchmark_ij.saved.lassen b/external/hypre/src/test/TEST_bench/benchmark_ij.saved.lassen index 75f7d84d..4f85e851 100644 --- a/external/hypre/src/test/TEST_bench/benchmark_ij.saved.lassen +++ b/external/hypre/src/test/TEST_bench/benchmark_ij.saved.lassen @@ -1,200 +1,108 @@ # Output file: benchmark_ij.out.1 - Complexity: grid = 1.386675 - operator = 2.320880 - memory = 2.744642 - -Iterations = 56 -Final Relative Residual Norm = 8.307127e-09 +Iterations = 55 +Final Relative Residual Norm = 7.087579e-09 # Output file: benchmark_ij.out.2 - Complexity: grid = 1.387055 - operator = 2.317302 - memory = 2.741383 - -Iterations = 47 -Final Relative Residual Norm = 6.442666e-09 +Iterations = 46 +Final Relative Residual Norm = 9.524807e-09 # Output file: benchmark_ij.out.3 - Complexity: grid = 1.233928 - operator = 1.239456 - memory = 1.468423 - -Iterations = 91 -Final Relative Residual Norm = 8.690762e-09 +Iterations = 92 +Final Relative Residual Norm = 8.647764e-09 # Output file: benchmark_ij.out.4 - Complexity: grid = 1.364012 - operator = 2.855853 - memory = 3.482026 - Iterations = 21 -Final Relative Residual Norm = 4.058213e-09 +Final Relative Residual Norm = 4.137778e-09 # Output file: benchmark_ij.out.5 - Complexity: grid = 1.091824 - operator = 1.219624 - memory = 1.372738 - Iterations = 18 -Final Relative Residual Norm = 7.323212e-09 +Final Relative Residual Norm = 6.100830e-09 # Output file: benchmark_ij.out.6 - Complexity: grid = 1.233919 - operator = 1.239480 - memory = 1.468487 - -Iterations = 86 -Final Relative Residual Norm = 8.703512e-09 +Iterations = 87 +Final Relative Residual Norm = 8.492893e-09 # Output file: benchmark_ij.out.7 - Complexity: grid = 1.223590 - operator = 1.527021 - memory = 1.986749 - Iterations = 20 -Final Relative Residual Norm = 6.987022e-09 +Final Relative Residual Norm = 6.894372e-09 # Output file: benchmark_ij.out.8 - Complexity: grid = 1.386664 - operator = 2.320762 - memory = 2.744512 - -Iterations = 55 -Final Relative Residual Norm = 8.845940e-09 +Iterations = 54 +Final Relative Residual Norm = 6.808957e-09 # Output file: benchmark_ij.out.9 - Complexity: grid = 1.387055 - operator = 2.317302 - memory = 2.741383 - Iterations = 47 -Final Relative Residual Norm = 6.443110e-09 +Final Relative Residual Norm = 7.886349e-09 # Output file: benchmark_ij.out.10 - Complexity: grid = 1.233928 - operator = 1.239458 - memory = 1.468426 - Iterations = 93 -Final Relative Residual Norm = 7.570811e-09 +Final Relative Residual Norm = 8.244493e-09 # Output file: benchmark_ij.out.11 - Complexity: grid = 1.364012 - operator = 2.855853 - memory = 3.482026 - Iterations = 21 -Final Relative Residual Norm = 4.058213e-09 +Final Relative Residual Norm = 4.060704e-09 # Output file: benchmark_ij.out.12 - Complexity: grid = 1.091824 - operator = 1.219624 - memory = 1.372738 - Iterations = 18 -Final Relative Residual Norm = 7.323212e-09 +Final Relative Residual Norm = 6.100830e-09 # Output file: benchmark_ij.out.13 - Complexity: grid = 1.233919 - operator = 1.239480 - memory = 1.468487 - -Iterations = 86 -Final Relative Residual Norm = 8.703480e-09 +Iterations = 87 +Final Relative Residual Norm = 8.492862e-09 # Output file: benchmark_ij.out.14 - Complexity: grid = 1.353519 - operator = 2.780828 - memory = 3.404837 - -Iterations = 21 -Final Relative Residual Norm = 3.421896e-09 +Iterations = 20 +Final Relative Residual Norm = 7.903625e-09 # Output file: benchmark_ij.out.15 - Complexity: grid = 1.363215 - operator = 2.858849 - memory = 3.484214 - Iterations = 22 -Final Relative Residual Norm = 5.645705e-09 +Final Relative Residual Norm = 5.658262e-09 # Output file: benchmark_ij.out.16 - Complexity: grid = 1.353517 - operator = 2.783027 - memory = 3.407035 - Iterations = 21 -Final Relative Residual Norm = 3.301396e-09 +Final Relative Residual Norm = 4.524887e-09 # Output file: benchmark_ij.out.17 - Complexity: grid = 1.015779 - operator = 1.046674 - memory = 1.317909 - Iterations = 20 Final Relative Residual Norm = 3.328281e-09 # Output file: benchmark_ij.out.18 - Complexity: grid = 1.070875 - operator = 1.447982 - memory = 1.989067 - Iterations = 20 -Final Relative Residual Norm = 3.966823e-09 +Final Relative Residual Norm = 4.132101e-09 # Output file: benchmark_ij.out.19 - Complexity: grid = 1.079926 - operator = 1.533788 - memory = 1.702008 - Iterations = 43 -Final Relative Residual Norm = 6.701259e-09 +Final Relative Residual Norm = 7.821010e-09 # Output file: benchmark_ij.out.20 - Complexity: grid = 1.082226 - operator = 1.551614 - memory = 2.055232 - -Iterations = 38 -Final Relative Residual Norm = 6.553323e-09 +Iterations = 37 +Final Relative Residual Norm = 8.751003e-09 # Output file: benchmark_ij.out.21 - Complexity: grid = 1.061711 - operator = 1.424330 - memory = 2.083418 - Iterations = 26 -Final Relative Residual Norm = 9.192336e-09 +Final Relative Residual Norm = 9.541467e-09 # Output file: benchmark_ij.out.22 - Complexity: grid = 1.354713 - operator = 2.779966 - memory = 3.404837 - -Iterations = 12 -Final Relative Residual Norm = 9.479329e-09 +Iterations = 13 +Final Relative Residual Norm = 1.759314e-09 # Output file: benchmark_ij.out.23 - Complexity: grid = 1.354713 - operator = 2.779966 - memory = 3.404837 - Iterations = 13 -Final Relative Residual Norm = 5.649324e-09 +Final Relative Residual Norm = 5.903110e-09 # Output file: benchmark_ij.out.24 - Complexity: grid = 1.354713 - operator = 2.779966 - memory = 3.404837 - -Iterations = 14 -Final Relative Residual Norm = 2.350370e-09 +Iterations = 13 +Final Relative Residual Norm = 9.939673e-09 # Output file: benchmark_ij.out.25 - Complexity: grid = 1.354713 - operator = 2.779966 - memory = 3.404837 - Iterations = 15 -Final Relative Residual Norm = 4.896099e-09 +Final Relative Residual Norm = 4.124880e-09 + +# Output file: benchmark_ij.out.26 +Iterations = 37 +Final Relative Residual Norm = 7.069482e-09 + +# Output file: benchmark_ij.out.27 +Iterations = 22 +Final Relative Residual Norm = 9.619150e-09 diff --git a/external/hypre/src/test/TEST_bench/benchmark_ij.saved.ray b/external/hypre/src/test/TEST_bench/benchmark_ij.saved.ray deleted file mode 100644 index 459f18f8..00000000 --- a/external/hypre/src/test/TEST_bench/benchmark_ij.saved.ray +++ /dev/null @@ -1,200 +0,0 @@ -# Output file: benchmark_ij.out.1 - Complexity: grid = 1.386675 - operator = 2.320880 - memory = 2.744642 - -Iterations = 56 -Final Relative Residual Norm = 8.310273e-09 - -# Output file: benchmark_ij.out.2 - Complexity: grid = 1.387054 - operator = 2.317317 - memory = 2.741399 - -Iterations = 46 -Final Relative Residual Norm = 9.983060e-09 - -# Output file: benchmark_ij.out.3 - Complexity: grid = 1.233935 - operator = 1.239483 - memory = 1.468458 - -Iterations = 95 -Final Relative Residual Norm = 9.752976e-09 - -# Output file: benchmark_ij.out.4 - Complexity: grid = 1.364009 - operator = 2.855804 - memory = 3.481976 - -Iterations = 21 -Final Relative Residual Norm = 4.823877e-09 - -# Output file: benchmark_ij.out.5 - Complexity: grid = 1.091841 - operator = 1.219680 - memory = 1.372794 - -Iterations = 18 -Final Relative Residual Norm = 7.067935e-09 - -# Output file: benchmark_ij.out.6 - Complexity: grid = 1.233924 - operator = 1.239488 - memory = 1.468501 - -Iterations = 86 -Final Relative Residual Norm = 8.776839e-09 - -# Output file: benchmark_ij.out.7 - Complexity: grid = 1.223589 - operator = 1.527003 - memory = 1.986731 - -Iterations = 20 -Final Relative Residual Norm = 6.113255e-09 - -# Output file: benchmark_ij.out.8 - Complexity: grid = 1.386664 - operator = 2.320762 - memory = 2.744512 - -Iterations = 55 -Final Relative Residual Norm = 8.842660e-09 - -# Output file: benchmark_ij.out.9 - Complexity: grid = 1.387054 - operator = 2.317317 - memory = 2.741399 - -Iterations = 46 -Final Relative Residual Norm = 9.984042e-09 - -# Output file: benchmark_ij.out.10 - Complexity: grid = 1.233941 - operator = 1.239494 - memory = 1.468474 - -Iterations = 94 -Final Relative Residual Norm = 8.552975e-09 - -# Output file: benchmark_ij.out.11 - Complexity: grid = 1.364009 - operator = 2.855804 - memory = 3.481976 - -Iterations = 21 -Final Relative Residual Norm = 4.823877e-09 - -# Output file: benchmark_ij.out.12 - Complexity: grid = 1.091841 - operator = 1.219680 - memory = 1.372794 - -Iterations = 18 -Final Relative Residual Norm = 7.067935e-09 - -# Output file: benchmark_ij.out.13 - Complexity: grid = 1.233924 - operator = 1.239488 - memory = 1.468501 - -Iterations = 86 -Final Relative Residual Norm = 8.776848e-09 - -# Output file: benchmark_ij.out.14 - Complexity: grid = 1.353525 - operator = 2.780984 - memory = 3.404994 - -Iterations = 21 -Final Relative Residual Norm = 3.275619e-09 - -# Output file: benchmark_ij.out.15 - Complexity: grid = 1.363207 - operator = 2.858725 - memory = 3.484089 - -Iterations = 22 -Final Relative Residual Norm = 5.998149e-09 - -# Output file: benchmark_ij.out.16 - Complexity: grid = 1.353543 - operator = 2.783373 - memory = 3.407385 - -Iterations = 20 -Final Relative Residual Norm = 9.658787e-09 - -# Output file: benchmark_ij.out.17 - Complexity: grid = 1.015779 - operator = 1.046674 - memory = 1.317909 - -Iterations = 20 -Final Relative Residual Norm = 3.328281e-09 - -# Output file: benchmark_ij.out.18 - Complexity: grid = 1.070876 - operator = 1.447936 - memory = 1.989021 - -Iterations = 20 -Final Relative Residual Norm = 4.032191e-09 - -# Output file: benchmark_ij.out.19 - Complexity: grid = 1.079936 - operator = 1.533947 - memory = 1.702168 - -Iterations = 43 -Final Relative Residual Norm = 6.646561e-09 - -# Output file: benchmark_ij.out.20 - Complexity: grid = 1.082238 - operator = 1.551861 - memory = 2.055481 - -Iterations = 38 -Final Relative Residual Norm = 7.983322e-09 - -# Output file: benchmark_ij.out.21 - Complexity: grid = 1.061719 - operator = 1.424455 - memory = 2.083605 - -Iterations = 27 -Final Relative Residual Norm = 5.988024e-09 - -# Output file: benchmark_ij.out.22 - Complexity: grid = 1.354729 - operator = 2.780162 - memory = 3.405036 - -Iterations = 12 -Final Relative Residual Norm = 7.696220e-09 - -# Output file: benchmark_ij.out.23 - Complexity: grid = 1.354729 - operator = 2.780162 - memory = 3.405036 - -Iterations = 13 -Final Relative Residual Norm = 5.699345e-09 - -# Output file: benchmark_ij.out.24 - Complexity: grid = 1.354729 - operator = 2.780162 - memory = 3.405036 - -Iterations = 14 -Final Relative Residual Norm = 2.049078e-09 - -# Output file: benchmark_ij.out.25 - Complexity: grid = 1.354729 - operator = 2.780162 - memory = 3.405036 - -Iterations = 15 -Final Relative Residual Norm = 3.378361e-09 - diff --git a/external/hypre/src/test/TEST_bench/benchmark_ij.saved.tioga b/external/hypre/src/test/TEST_bench/benchmark_ij.saved.tioga new file mode 100644 index 00000000..c0268171 --- /dev/null +++ b/external/hypre/src/test/TEST_bench/benchmark_ij.saved.tioga @@ -0,0 +1,107 @@ +# Output file: benchmark_ij.out.1 +Iterations = 55 +Final Relative Residual Norm = 9.274314e-09 + +# Output file: benchmark_ij.out.2 +Iterations = 46 +Final Relative Residual Norm = 9.988931e-09 + +# Output file: benchmark_ij.out.3 +Iterations = 98 +Final Relative Residual Norm = 7.887687e-09 + +# Output file: benchmark_ij.out.4 +Iterations = 21 +Final Relative Residual Norm = 3.469813e-09 + +# Output file: benchmark_ij.out.5 +Iterations = 18 +Final Relative Residual Norm = 4.722489e-09 + +# Output file: benchmark_ij.out.6 +Iterations = 87 +Final Relative Residual Norm = 7.730705e-09 + +# Output file: benchmark_ij.out.7 +Iterations = 20 +Final Relative Residual Norm = 4.901688e-09 + +# Output file: benchmark_ij.out.8 +Iterations = 55 +Final Relative Residual Norm = 8.477809e-09 + +# Output file: benchmark_ij.out.9 +Iterations = 46 +Final Relative Residual Norm = 9.985837e-09 + +# Output file: benchmark_ij.out.10 +Iterations = 93 +Final Relative Residual Norm = 8.530145e-09 + +# Output file: benchmark_ij.out.11 +Iterations = 21 +Final Relative Residual Norm = 3.234870e-09 + +# Output file: benchmark_ij.out.12 +Iterations = 18 +Final Relative Residual Norm = 4.722489e-09 + +# Output file: benchmark_ij.out.13 +Iterations = 87 +Final Relative Residual Norm = 7.730127e-09 + +# Output file: benchmark_ij.out.14 +Iterations = 21 +Final Relative Residual Norm = 3.509276e-09 + +# Output file: benchmark_ij.out.15 +Iterations = 22 +Final Relative Residual Norm = 5.410863e-09 + +# Output file: benchmark_ij.out.16 +Iterations = 20 +Final Relative Residual Norm = 9.649695e-09 + +# Output file: benchmark_ij.out.17 +Iterations = 20 +Final Relative Residual Norm = 3.529822e-09 + +# Output file: benchmark_ij.out.18 +Iterations = 20 +Final Relative Residual Norm = 3.320123e-09 + +# Output file: benchmark_ij.out.19 +Iterations = 43 +Final Relative Residual Norm = 7.541043e-09 + +# Output file: benchmark_ij.out.20 +Iterations = 38 +Final Relative Residual Norm = 4.440293e-09 + +# Output file: benchmark_ij.out.21 +Iterations = 27 +Final Relative Residual Norm = 4.476621e-09 + +# Output file: benchmark_ij.out.22 +Iterations = 13 +Final Relative Residual Norm = 1.810780e-09 + +# Output file: benchmark_ij.out.23 +Iterations = 13 +Final Relative Residual Norm = 6.103525e-09 + +# Output file: benchmark_ij.out.24 +Iterations = 14 +Final Relative Residual Norm = 3.116077e-09 + +# Output file: benchmark_ij.out.25 +Iterations = 15 +Final Relative Residual Norm = 5.382858e-09 + +# Output file: benchmark_ij.out.26 +Iterations = 37 +Final Relative Residual Norm = 6.305999e-09 + +# Output file: benchmark_ij.out.27 +Iterations = 22 +Final Relative Residual Norm = 8.787135e-09 diff --git a/external/hypre/src/test/TEST_bench/benchmark_ij.sh b/external/hypre/src/test/TEST_bench/benchmark_ij.sh old mode 100644 new mode 100755 index e81c2a35..dbcbeb2a --- a/external/hypre/src/test/TEST_bench/benchmark_ij.sh +++ b/external/hypre/src/test/TEST_bench/benchmark_ij.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -38,6 +38,8 @@ FILES="\ ${TNAME}.out.23\ ${TNAME}.out.24\ ${TNAME}.out.25\ + ${TNAME}.out.26\ + ${TNAME}.out.27\ " for i in $FILES @@ -58,26 +60,11 @@ done > ${TNAME}.perf.out # Make sure that the output file is reasonable RUNCOUNT=`echo $FILES | wc -w` -OUTCOUNT=`grep "Complexity" ${TNAME}.out | wc -l` +OUTCOUNT=`grep "Iterations" ${TNAME}.out | wc -l` if [ "$OUTCOUNT" != "$RUNCOUNT" ]; then echo "Incorrect number of runs in ${TNAME}.out" >&2 fi -# Check performance -HOST=`hostname` -case $HOST in - lassen*) - SavePerfExt="saved.lassen" - rtol=0.15 - ;; - *) SavePerfExt="" - ;; -esac - -if [ -n "$SavePerfExt" ]; then - ../runcheck.sh $TNAME.perf.out $TNAME.perf.$SavePerfExt $rtol >&2 -fi - #============================================================================= # remove temporary files #============================================================================= diff --git a/external/hypre/src/test/TEST_bench/benchmark_spgemm.jobs b/external/hypre/src/test/TEST_bench/benchmark_spgemm.jobs new file mode 100755 index 00000000..b79ee824 --- /dev/null +++ b/external/hypre/src/test/TEST_bench/benchmark_spgemm.jobs @@ -0,0 +1,65 @@ +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +#============================================================================= +# ij_mm: SpGEMM GPU benchmarks +#============================================================================= + +# A^2 + +mpirun -np 1 ./ij_mm -n 128 128 128 -7pt -verify 1 -spgemm_binned 0 -spgemmalg 1 -rep 10 > benchmark_spgemm.out.1 +mpirun -np 1 ./ij_mm -n 128 128 128 -27pt -verify 1 -spgemm_binned 0 -spgemmalg 1 -rep 10 > benchmark_spgemm.out.2 +mpirun -np 1 ./ij_mm -n 1024 1024 1 -5pt -verify 1 -spgemm_binned 0 -spgemmalg 1 -rep 10 > benchmark_spgemm.out.3 +mpirun -np 1 ./ij_mm -n 1024 1024 1 -9pt -verify 1 -spgemm_binned 0 -spgemmalg 1 -rep 10 > benchmark_spgemm.out.4 + +mpirun -np 1 ./ij_mm -n 128 128 128 -7pt -verify 1 -spgemm_binned 1 -spgemmalg 1 -rep 10 > benchmark_spgemm.out.5 +mpirun -np 1 ./ij_mm -n 128 128 128 -27pt -verify 1 -spgemm_binned 1 -spgemmalg 1 -rep 10 > benchmark_spgemm.out.6 +mpirun -np 1 ./ij_mm -n 1024 1024 1 -5pt -verify 1 -spgemm_binned 1 -spgemmalg 1 -rep 10 > benchmark_spgemm.out.7 +mpirun -np 1 ./ij_mm -n 1024 1024 1 -9pt -verify 1 -spgemm_binned 1 -spgemmalg 1 -rep 10 > benchmark_spgemm.out.8 + +mpirun -np 1 ./ij_mm -n 128 128 128 -7pt -verify 1 -spgemm_binned 0 -spgemmalg 3 -rep 10 > benchmark_spgemm.out.9 +mpirun -np 1 ./ij_mm -n 128 128 128 -27pt -verify 1 -spgemm_binned 0 -spgemmalg 3 -rep 10 > benchmark_spgemm.out.10 +mpirun -np 1 ./ij_mm -n 1024 1024 1 -5pt -verify 1 -spgemm_binned 0 -spgemmalg 3 -rep 10 > benchmark_spgemm.out.11 +mpirun -np 1 ./ij_mm -n 1024 1024 1 -9pt -verify 1 -spgemm_binned 0 -spgemmalg 3 -rep 10 > benchmark_spgemm.out.12 + +mpirun -np 1 ./ij_mm -n 128 128 128 -7pt -verify 1 -vendor 1 -rep 10 > benchmark_spgemm.out.13 +mpirun -np 1 ./ij_mm -n 80 80 80 -27pt -verify 1 -vendor 1 -rep 10 > benchmark_spgemm.out.14 +mpirun -np 1 ./ij_mm -n 1024 1024 1 -5pt -verify 1 -vendor 1 -rep 10 > benchmark_spgemm.out.15 +mpirun -np 1 ./ij_mm -n 1024 1024 1 -9pt -verify 1 -vendor 1 -rep 10 > benchmark_spgemm.out.16 + +# Diag(A) * A + +mpirun -np 1 ./ij_mm -n 128 128 128 -7pt -verify 1 -spgemm_binned 1 -spgemmalg 1 -job 5 -rep 10 > benchmark_spgemm.out.17 +mpirun -np 1 ./ij_mm -n 128 128 128 -27pt -verify 1 -spgemm_binned 1 -spgemmalg 1 -job 5 -rep 10 > benchmark_spgemm.out.18 +mpirun -np 1 ./ij_mm -n 1024 1024 1 -5pt -verify 1 -spgemm_binned 1 -spgemmalg 1 -job 5 -rep 10 > benchmark_spgemm.out.19 +mpirun -np 1 ./ij_mm -n 1024 1024 1 -9pt -verify 1 -spgemm_binned 1 -spgemmalg 1 -job 5 -rep 10 > benchmark_spgemm.out.20 + +# A^2 + +mpirun -np 4 ./ij_mm -n 256 256 128 -P 2 2 1 -7pt -verify 1 -rep 10 > benchmark_spgemm.out.21 +mpirun -np 4 ./ij_mm -n 256 256 128 -P 2 2 1 -27pt -verify 1 -rep 10 > benchmark_spgemm.out.22 +mpirun -np 4 ./ij_mm -n 2048 2048 1 -P 2 2 1 -5pt -verify 1 -rep 10 > benchmark_spgemm.out.23 +mpirun -np 4 ./ij_mm -n 2048 2048 1 -P 2 2 1 -9pt -verify 1 -rep 10 > benchmark_spgemm.out.24 + +# A^T * A + +mpirun -np 4 ./ij_mm -n 256 256 128 -P 2 2 1 -7pt -verify 1 -rep 10 -job 2 > benchmark_spgemm.out.25 +mpirun -np 4 ./ij_mm -n 256 256 128 -P 2 2 1 -27pt -verify 1 -rep 10 -job 2 > benchmark_spgemm.out.26 +mpirun -np 4 ./ij_mm -n 2048 2048 1 -P 2 2 1 -5pt -verify 1 -rep 10 -job 2 > benchmark_spgemm.out.27 +mpirun -np 4 ./ij_mm -n 2048 2048 1 -P 2 2 1 -9pt -verify 1 -rep 10 -job 2 > benchmark_spgemm.out.28 + +# P^T*A*P + +mpirun -np 4 ./ij_mm -n 256 256 128 -P 2 2 1 -7pt -verify 1 -rep 10 -rap2 0 -job 4 > benchmark_spgemm.out.29 +mpirun -np 4 ./ij_mm -n 256 256 128 -P 2 2 1 -27pt -verify 1 -rep 10 -rap2 0 -job 4 > benchmark_spgemm.out.30 +mpirun -np 4 ./ij_mm -n 2048 2048 1 -P 2 2 1 -5pt -verify 1 -rep 10 -rap2 0 -job 4 > benchmark_spgemm.out.31 +mpirun -np 4 ./ij_mm -n 2048 2048 1 -P 2 2 1 -9pt -verify 1 -rep 10 -rap2 0 -job 4 > benchmark_spgemm.out.32 + +mpirun -np 4 ./ij_mm -n 256 256 128 -P 2 2 1 -7pt -verify 1 -rep 10 -rap2 1 -job 4 > benchmark_spgemm.out.33 +mpirun -np 4 ./ij_mm -n 256 256 128 -P 2 2 1 -27pt -verify 1 -rep 10 -rap2 1 -job 4 > benchmark_spgemm.out.34 +mpirun -np 4 ./ij_mm -n 2048 2048 1 -P 2 2 1 -5pt -verify 1 -rep 10 -rap2 1 -job 4 > benchmark_spgemm.out.35 +mpirun -np 4 ./ij_mm -n 2048 2048 1 -P 2 2 1 -9pt -verify 1 -rep 10 -rap2 1 -job 4 > benchmark_spgemm.out.36 + diff --git a/external/hypre/src/test/TEST_bench/benchmark_spgemm.perf.saved.lassen b/external/hypre/src/test/TEST_bench/benchmark_spgemm.perf.saved.lassen new file mode 100644 index 00000000..a03752cc --- /dev/null +++ b/external/hypre/src/test/TEST_bench/benchmark_spgemm.perf.saved.lassen @@ -0,0 +1,72 @@ +# Output file: benchmark_spgemm.out.1 +Device Parcsr Matrix-by-Matrix wall clock time = 0.010967 seconds +# Output file: benchmark_spgemm.out.2 +Device Parcsr Matrix-by-Matrix wall clock time = 0.078255 seconds +# Output file: benchmark_spgemm.out.3 +Device Parcsr Matrix-by-Matrix wall clock time = 0.004247 seconds +# Output file: benchmark_spgemm.out.4 +Device Parcsr Matrix-by-Matrix wall clock time = 0.006737 seconds +# Output file: benchmark_spgemm.out.5 +Device Parcsr Matrix-by-Matrix wall clock time = 0.006479 seconds +# Output file: benchmark_spgemm.out.6 +Device Parcsr Matrix-by-Matrix wall clock time = 0.078124 seconds +# Output file: benchmark_spgemm.out.7 +Device Parcsr Matrix-by-Matrix wall clock time = 0.002043 seconds +# Output file: benchmark_spgemm.out.8 +Device Parcsr Matrix-by-Matrix wall clock time = 0.004348 seconds +# Output file: benchmark_spgemm.out.9 +Device Parcsr Matrix-by-Matrix wall clock time = 0.021769 seconds +# Output file: benchmark_spgemm.out.10 +Device Parcsr Matrix-by-Matrix wall clock time = 0.097855 seconds +# Output file: benchmark_spgemm.out.11 +Device Parcsr Matrix-by-Matrix wall clock time = 0.008427 seconds +# Output file: benchmark_spgemm.out.12 +Device Parcsr Matrix-by-Matrix wall clock time = 0.011918 seconds +# Output file: benchmark_spgemm.out.13 +Device Parcsr Matrix-by-Matrix wall clock time = 0.027048 seconds +# Output file: benchmark_spgemm.out.14 +Device Parcsr Matrix-by-Matrix wall clock time = 0.064765 seconds +# Output file: benchmark_spgemm.out.15 +Device Parcsr Matrix-by-Matrix wall clock time = 0.006528 seconds +# Output file: benchmark_spgemm.out.16 +Device Parcsr Matrix-by-Matrix wall clock time = 0.018399 seconds +# Output file: benchmark_spgemm.out.17 +Device Parcsr Matrix-by-Matrix wall clock time = 0.001937 seconds +# Output file: benchmark_spgemm.out.18 +Device Parcsr Matrix-by-Matrix wall clock time = 0.006223 seconds +# Output file: benchmark_spgemm.out.19 +Device Parcsr Matrix-by-Matrix wall clock time = 0.001117 seconds +# Output file: benchmark_spgemm.out.20 +Device Parcsr Matrix-by-Matrix wall clock time = 0.001318 seconds +# Output file: benchmark_spgemm.out.21 +Device Parcsr Matrix-by-Matrix wall clock time = 0.026565 seconds +# Output file: benchmark_spgemm.out.22 +Device Parcsr Matrix-by-Matrix wall clock time = 0.138814 seconds +# Output file: benchmark_spgemm.out.23 +Device Parcsr Matrix-by-Matrix wall clock time = 0.009921 seconds +# Output file: benchmark_spgemm.out.24 +Device Parcsr Matrix-by-Matrix wall clock time = 0.015210 seconds +# Output file: benchmark_spgemm.out.25 +Device Parcsr Matrix-by-Matrix wall clock time = 0.044715 seconds +# Output file: benchmark_spgemm.out.26 +Device Parcsr Matrix-by-Matrix wall clock time = 0.213106 seconds +# Output file: benchmark_spgemm.out.27 +Device Parcsr Matrix-by-Matrix wall clock time = 0.016736 seconds +# Output file: benchmark_spgemm.out.28 +Device Parcsr Matrix-by-Matrix wall clock time = 0.024992 seconds +# Output file: benchmark_spgemm.out.29 +Device Parcsr Matrix-by-Matrix wall clock time = 0.043242 seconds +# Output file: benchmark_spgemm.out.30 +Device Parcsr Matrix-by-Matrix wall clock time = 0.057250 seconds +# Output file: benchmark_spgemm.out.31 +Device Parcsr Matrix-by-Matrix wall clock time = 0.014796 seconds +# Output file: benchmark_spgemm.out.32 +Device Parcsr Matrix-by-Matrix wall clock time = 0.015555 seconds +# Output file: benchmark_spgemm.out.33 +Device Parcsr Matrix-by-Matrix wall clock time = 0.052184 seconds +# Output file: benchmark_spgemm.out.34 +Device Parcsr Matrix-by-Matrix wall clock time = 0.072126 seconds +# Output file: benchmark_spgemm.out.35 +Device Parcsr Matrix-by-Matrix wall clock time = 0.017392 seconds +# Output file: benchmark_spgemm.out.36 +Device Parcsr Matrix-by-Matrix wall clock time = 0.019193 seconds diff --git a/external/hypre/src/test/TEST_bench/benchmark_spgemm.perf.saved.tioga b/external/hypre/src/test/TEST_bench/benchmark_spgemm.perf.saved.tioga new file mode 100644 index 00000000..9e3aaa30 --- /dev/null +++ b/external/hypre/src/test/TEST_bench/benchmark_spgemm.perf.saved.tioga @@ -0,0 +1,72 @@ +# Output file: benchmark_spgemm.out.1 +Device Parcsr Matrix-by-Matrix wall clock time = 0.019578 seconds +# Output file: benchmark_spgemm.out.2 +Device Parcsr Matrix-by-Matrix wall clock time = 0.076419 seconds +# Output file: benchmark_spgemm.out.3 +Device Parcsr Matrix-by-Matrix wall clock time = 0.008474 seconds +# Output file: benchmark_spgemm.out.4 +Device Parcsr Matrix-by-Matrix wall clock time = 0.009719 seconds +# Output file: benchmark_spgemm.out.5 +Device Parcsr Matrix-by-Matrix wall clock time = 0.007846 seconds +# Output file: benchmark_spgemm.out.6 +Device Parcsr Matrix-by-Matrix wall clock time = 0.080421 seconds +# Output file: benchmark_spgemm.out.7 +Device Parcsr Matrix-by-Matrix wall clock time = 0.002626 seconds +# Output file: benchmark_spgemm.out.8 +Device Parcsr Matrix-by-Matrix wall clock time = 0.006074 seconds +# Output file: benchmark_spgemm.out.9 +Device Parcsr Matrix-by-Matrix wall clock time = 0.038709 seconds +# Output file: benchmark_spgemm.out.10 +Device Parcsr Matrix-by-Matrix wall clock time = 0.115453 seconds +# Output file: benchmark_spgemm.out.11 +Device Parcsr Matrix-by-Matrix wall clock time = 0.016367 seconds +# Output file: benchmark_spgemm.out.12 +Device Parcsr Matrix-by-Matrix wall clock time = 0.019611 seconds +# Output file: benchmark_spgemm.out.13 +Device Parcsr Matrix-by-Matrix wall clock time = 0.018017 seconds +# Output file: benchmark_spgemm.out.14 +Device Parcsr Matrix-by-Matrix wall clock time = 0.014804 seconds +# Output file: benchmark_spgemm.out.15 +Device Parcsr Matrix-by-Matrix wall clock time = 0.006545 seconds +# Output file: benchmark_spgemm.out.16 +Device Parcsr Matrix-by-Matrix wall clock time = 0.013026 seconds +# Output file: benchmark_spgemm.out.17 +Device Parcsr Matrix-by-Matrix wall clock time = 0.002087 seconds +# Output file: benchmark_spgemm.out.18 +Device Parcsr Matrix-by-Matrix wall clock time = 0.005301 seconds +# Output file: benchmark_spgemm.out.19 +Device Parcsr Matrix-by-Matrix wall clock time = 0.001359 seconds +# Output file: benchmark_spgemm.out.20 +Device Parcsr Matrix-by-Matrix wall clock time = 0.001621 seconds +# Output file: benchmark_spgemm.out.21 +Device Parcsr Matrix-by-Matrix wall clock time = 0.031799 seconds +# Output file: benchmark_spgemm.out.22 +Device Parcsr Matrix-by-Matrix wall clock time = 0.112757 seconds +# Output file: benchmark_spgemm.out.23 +Device Parcsr Matrix-by-Matrix wall clock time = 0.013535 seconds +# Output file: benchmark_spgemm.out.24 +Device Parcsr Matrix-by-Matrix wall clock time = 0.016090 seconds +# Output file: benchmark_spgemm.out.25 +Device Parcsr Matrix-by-Matrix wall clock time = 0.057450 seconds +# Output file: benchmark_spgemm.out.26 +Device Parcsr Matrix-by-Matrix wall clock time = 0.587366 seconds +# Output file: benchmark_spgemm.out.27 +Device Parcsr Matrix-by-Matrix wall clock time = 0.022603 seconds +# Output file: benchmark_spgemm.out.28 +Device Parcsr Matrix-by-Matrix wall clock time = 0.028229 seconds +# Output file: benchmark_spgemm.out.29 +Device Parcsr Matrix-by-Matrix wall clock time = 0.057857 seconds +# Output file: benchmark_spgemm.out.30 +Device Parcsr Matrix-by-Matrix wall clock time = 0.060432 seconds +# Output file: benchmark_spgemm.out.31 +Device Parcsr Matrix-by-Matrix wall clock time = 0.020985 seconds +# Output file: benchmark_spgemm.out.32 +Device Parcsr Matrix-by-Matrix wall clock time = 0.019986 seconds +# Output file: benchmark_spgemm.out.33 +Device Parcsr Matrix-by-Matrix wall clock time = 0.063040 seconds +# Output file: benchmark_spgemm.out.34 +Device Parcsr Matrix-by-Matrix wall clock time = 0.067800 seconds +# Output file: benchmark_spgemm.out.35 +Device Parcsr Matrix-by-Matrix wall clock time = 0.023271 seconds +# Output file: benchmark_spgemm.out.36 +Device Parcsr Matrix-by-Matrix wall clock time = 0.022089 seconds diff --git a/external/hypre/src/test/TEST_bench/benchmark_spgemm.saved.lassen b/external/hypre/src/test/TEST_bench/benchmark_spgemm.saved.lassen new file mode 100644 index 00000000..2c1fd8cd --- /dev/null +++ b/external/hypre/src/test/TEST_bench/benchmark_spgemm.saved.lassen @@ -0,0 +1,108 @@ +# Output file: benchmark_spgemm.out.1 +A^2: 2097152 x 2097152, nnz [CPU 51742208, GPU 51742208], CPU-GPU err 0.000000e+00 +B 2097152 x 2097152, NNZ 51742208, RNZ 24 +# Output file: benchmark_spgemm.out.2 +A^2: 2097152 x 2097152, nnz [CPU 254840104, GPU 254840104], CPU-GPU err 0.000000e+00 +B 2097152 x 2097152, NNZ 254840104, RNZ 121 +# Output file: benchmark_spgemm.out.3 +A^2: 1048576 x 1048576, nnz [CPU 13611012, GPU 13611012], CPU-GPU err 0.000000e+00 +B 1048576 x 1048576, NNZ 13611012, RNZ 12 +# Output file: benchmark_spgemm.out.4 +A^2: 1048576 x 1048576, nnz [CPU 26152996, GPU 26152996], CPU-GPU err 0.000000e+00 +B 1048576 x 1048576, NNZ 26152996, RNZ 24 +# Output file: benchmark_spgemm.out.5 +A^2: 2097152 x 2097152, nnz [CPU 51742208, GPU 51742208], CPU-GPU err 0.000000e+00 +B 2097152 x 2097152, NNZ 51742208, RNZ 24 +# Output file: benchmark_spgemm.out.6 +A^2: 2097152 x 2097152, nnz [CPU 254840104, GPU 254840104], CPU-GPU err 0.000000e+00 +B 2097152 x 2097152, NNZ 254840104, RNZ 121 +# Output file: benchmark_spgemm.out.7 +A^2: 1048576 x 1048576, nnz [CPU 13611012, GPU 13611012], CPU-GPU err 0.000000e+00 +B 1048576 x 1048576, NNZ 13611012, RNZ 12 +# Output file: benchmark_spgemm.out.8 +A^2: 1048576 x 1048576, nnz [CPU 26152996, GPU 26152996], CPU-GPU err 0.000000e+00 +B 1048576 x 1048576, NNZ 26152996, RNZ 24 +# Output file: benchmark_spgemm.out.9 +A^2: 2097152 x 2097152, nnz [CPU 51742208, GPU 51742208], CPU-GPU err 0.000000e+00 +B 2097152 x 2097152, NNZ 51742208, RNZ 24 +# Output file: benchmark_spgemm.out.10 +A^2: 2097152 x 2097152, nnz [CPU 254840104, GPU 254840104], CPU-GPU err 0.000000e+00 +B 2097152 x 2097152, NNZ 254840104, RNZ 121 +# Output file: benchmark_spgemm.out.11 +A^2: 1048576 x 1048576, nnz [CPU 13611012, GPU 13611012], CPU-GPU err 0.000000e+00 +B 1048576 x 1048576, NNZ 13611012, RNZ 12 +# Output file: benchmark_spgemm.out.12 +A^2: 1048576 x 1048576, nnz [CPU 26152996, GPU 26152996], CPU-GPU err 0.000000e+00 +B 1048576 x 1048576, NNZ 26152996, RNZ 24 +# Output file: benchmark_spgemm.out.13 +A^2: 2097152 x 2097152, nnz [CPU 51742208, GPU 51742208], CPU-GPU err 0.000000e+00 +B 2097152 x 2097152, NNZ 51742208, RNZ 24 +# Output file: benchmark_spgemm.out.14 +A^2: 512000 x 512000, nnz [CPU 61162984, GPU 61162984], CPU-GPU err 0.000000e+00 +B 512000 x 512000, NNZ 61162984, RNZ 119 +# Output file: benchmark_spgemm.out.15 +A^2: 1048576 x 1048576, nnz [CPU 13611012, GPU 13611012], CPU-GPU err 0.000000e+00 +B 1048576 x 1048576, NNZ 13611012, RNZ 12 +# Output file: benchmark_spgemm.out.16 +A^2: 1048576 x 1048576, nnz [CPU 26152996, GPU 26152996], CPU-GPU err 0.000000e+00 +B 1048576 x 1048576, NNZ 26152996, RNZ 24 +# Output file: benchmark_spgemm.out.17 +Diag(A)*A: 2097152 x 2097152, nnz [CPU 14581760, GPU 14581760], CPU-GPU err 0.000000e+00 +B 2097152 x 2097152, NNZ 14581760, RNZ 6 +# Output file: benchmark_spgemm.out.18 +Diag(A)*A: 2097152 x 2097152, nnz [CPU 55742968, GPU 55742968], CPU-GPU err 0.000000e+00 +B 2097152 x 2097152, NNZ 55742968, RNZ 26 +# Output file: benchmark_spgemm.out.19 +Diag(A)*A: 1048576 x 1048576, nnz [CPU 5238784, GPU 5238784], CPU-GPU err 0.000000e+00 +B 1048576 x 1048576, NNZ 5238784, RNZ 4 +# Output file: benchmark_spgemm.out.20 +Diag(A)*A: 1048576 x 1048576, nnz [CPU 9424900, GPU 9424900], CPU-GPU err 0.000000e+00 +B 1048576 x 1048576, NNZ 9424900, RNZ 8 +# Output file: benchmark_spgemm.out.21 +A^2: 8388608 x 8388608, nnz [CPU 207882752, GPU 207882752], CPU-GPU err 0.000000e+00 +B 8388608 x 8388608, NNZ 207882752, RNZ 24 +# Output file: benchmark_spgemm.out.22 +A^2: 8388608 x 8388608, nnz [CPU 1029030184, GPU 1029030184], CPU-GPU err 0.000000e+00 +B 8388608 x 8388608, NNZ 1029030184, RNZ 122 +# Output file: benchmark_spgemm.out.23 +A^2: 4194304 x 4194304, nnz [CPU 54484996, GPU 54484996], CPU-GPU err 0.000000e+00 +B 4194304 x 4194304, NNZ 54484996, RNZ 12 +# Output file: benchmark_spgemm.out.24 +A^2: 4194304 x 4194304, nnz [CPU 104734756, GPU 104734756], CPU-GPU err 0.000000e+00 +B 4194304 x 4194304, NNZ 104734756, RNZ 24 +# Output file: benchmark_spgemm.out.25 +A^T*A: 8388608 x 8388608, nnz [CPU 207882752, GPU 207882752], CPU-GPU err 0.000000e+00 +B 8388608 x 8388608, NNZ 207882752, RNZ 24 +# Output file: benchmark_spgemm.out.26 +A^T*A: 8388608 x 8388608, nnz [CPU 1029030184, GPU 1029030184], CPU-GPU err 0.000000e+00 +B 8388608 x 8388608, NNZ 1029030184, RNZ 122 +# Output file: benchmark_spgemm.out.27 +A^T*A: 4194304 x 4194304, nnz [CPU 54484996, GPU 54484996], CPU-GPU err 0.000000e+00 +B 4194304 x 4194304, NNZ 54484996, RNZ 12 +# Output file: benchmark_spgemm.out.28 +A^T*A: 4194304 x 4194304, nnz [CPU 104734756, GPU 104734756], CPU-GPU err 0.000000e+00 +B 4194304 x 4194304, NNZ 104734756, RNZ 24 +# Output file: benchmark_spgemm.out.29 +AH: 2584577 x 2584577, nnz [CPU 135117205, GPU 135117205], CPU-GPU err 1.014792e-16 +AH 2584577 x 2584577, NNZ 135117205, RNZ 52 +# Output file: benchmark_spgemm.out.30 +AH: 681352 x 681352, nnz [CPU 63795454, GPU 63795454], CPU-GPU err 1.495569e-16 +AH 681352 x 681352, NNZ 63795454, RNZ 93 +# Output file: benchmark_spgemm.out.31 +AH: 1526810 x 1526810, nnz [CPU 22113948, GPU 22113948], CPU-GPU err 7.252008e-17 +AH 1526810 x 1526810, NNZ 22113948, RNZ 14 +# Output file: benchmark_spgemm.out.32 +AH: 785055 x 785055, nnz [CPU 17526581, GPU 17526581], CPU-GPU err 1.037485e-16 +AH 785055 x 785055, NNZ 17526581, RNZ 22 +# Output file: benchmark_spgemm.out.33 +AH: 2584577 x 2584577, nnz [CPU 135117205, GPU 135117205], CPU-GPU err 1.014372e-16 +AH 2584577 x 2584577, NNZ 135117205, RNZ 52 +# Output file: benchmark_spgemm.out.34 +AH: 681352 x 681352, nnz [CPU 63795454, GPU 63795454], CPU-GPU err 1.498314e-16 +AH 681352 x 681352, NNZ 63795454, RNZ 93 +# Output file: benchmark_spgemm.out.35 +AH: 1526810 x 1526810, nnz [CPU 22113948, GPU 22113948], CPU-GPU err 7.252372e-17 +AH 1526810 x 1526810, NNZ 22113948, RNZ 14 +# Output file: benchmark_spgemm.out.36 +AH: 785055 x 785055, nnz [CPU 17526581, GPU 17526581], CPU-GPU err 1.037275e-16 +AH 785055 x 785055, NNZ 17526581, RNZ 22 diff --git a/external/hypre/src/test/TEST_bench/benchmark_spgemm.saved.tioga b/external/hypre/src/test/TEST_bench/benchmark_spgemm.saved.tioga new file mode 100644 index 00000000..9e15f62d --- /dev/null +++ b/external/hypre/src/test/TEST_bench/benchmark_spgemm.saved.tioga @@ -0,0 +1,108 @@ +# Output file: benchmark_spgemm.out.1 +A^2: 2097152 x 2097152, nnz [CPU 51742208, GPU 51742208], CPU-GPU err 0.000000e+00 +B 2097152 x 2097152, NNZ 51742208, RNZ 24 +# Output file: benchmark_spgemm.out.2 +A^2: 2097152 x 2097152, nnz [CPU 254840104, GPU 254840104], CPU-GPU err 0.000000e+00 +B 2097152 x 2097152, NNZ 254840104, RNZ 121 +# Output file: benchmark_spgemm.out.3 +A^2: 1048576 x 1048576, nnz [CPU 13611012, GPU 13611012], CPU-GPU err 0.000000e+00 +B 1048576 x 1048576, NNZ 13611012, RNZ 12 +# Output file: benchmark_spgemm.out.4 +A^2: 1048576 x 1048576, nnz [CPU 26152996, GPU 26152996], CPU-GPU err 0.000000e+00 +B 1048576 x 1048576, NNZ 26152996, RNZ 24 +# Output file: benchmark_spgemm.out.5 +A^2: 2097152 x 2097152, nnz [CPU 51742208, GPU 51742208], CPU-GPU err 0.000000e+00 +B 2097152 x 2097152, NNZ 51742208, RNZ 24 +# Output file: benchmark_spgemm.out.6 +A^2: 2097152 x 2097152, nnz [CPU 254840104, GPU 254840104], CPU-GPU err 0.000000e+00 +B 2097152 x 2097152, NNZ 254840104, RNZ 121 +# Output file: benchmark_spgemm.out.7 +A^2: 1048576 x 1048576, nnz [CPU 13611012, GPU 13611012], CPU-GPU err 0.000000e+00 +B 1048576 x 1048576, NNZ 13611012, RNZ 12 +# Output file: benchmark_spgemm.out.8 +A^2: 1048576 x 1048576, nnz [CPU 26152996, GPU 26152996], CPU-GPU err 0.000000e+00 +B 1048576 x 1048576, NNZ 26152996, RNZ 24 +# Output file: benchmark_spgemm.out.9 +A^2: 2097152 x 2097152, nnz [CPU 51742208, GPU 51742208], CPU-GPU err 0.000000e+00 +B 2097152 x 2097152, NNZ 51742208, RNZ 24 +# Output file: benchmark_spgemm.out.10 +A^2: 2097152 x 2097152, nnz [CPU 254840104, GPU 254840104], CPU-GPU err 0.000000e+00 +B 2097152 x 2097152, NNZ 254840104, RNZ 121 +# Output file: benchmark_spgemm.out.11 +A^2: 1048576 x 1048576, nnz [CPU 13611012, GPU 13611012], CPU-GPU err 0.000000e+00 +B 1048576 x 1048576, NNZ 13611012, RNZ 12 +# Output file: benchmark_spgemm.out.12 +A^2: 1048576 x 1048576, nnz [CPU 26152996, GPU 26152996], CPU-GPU err 0.000000e+00 +B 1048576 x 1048576, NNZ 26152996, RNZ 24 +# Output file: benchmark_spgemm.out.13 +A^2: 2097152 x 2097152, nnz [CPU 51742208, GPU 51742208], CPU-GPU err 0.000000e+00 +B 2097152 x 2097152, NNZ 51742208, RNZ 24 +# Output file: benchmark_spgemm.out.14 +A^2: 512000 x 512000, nnz [CPU 61162984, GPU 61162984], CPU-GPU err 0.000000e+00 +B 512000 x 512000, NNZ 61162984, RNZ 119 +# Output file: benchmark_spgemm.out.15 +A^2: 1048576 x 1048576, nnz [CPU 13611012, GPU 13611012], CPU-GPU err 0.000000e+00 +B 1048576 x 1048576, NNZ 13611012, RNZ 12 +# Output file: benchmark_spgemm.out.16 +A^2: 1048576 x 1048576, nnz [CPU 26152996, GPU 26152996], CPU-GPU err 0.000000e+00 +B 1048576 x 1048576, NNZ 26152996, RNZ 24 +# Output file: benchmark_spgemm.out.17 +Diag(A)*A: 2097152 x 2097152, nnz [CPU 14581760, GPU 14581760], CPU-GPU err 0.000000e+00 +B 2097152 x 2097152, NNZ 14581760, RNZ 6 +# Output file: benchmark_spgemm.out.18 +Diag(A)*A: 2097152 x 2097152, nnz [CPU 55742968, GPU 55742968], CPU-GPU err 0.000000e+00 +B 2097152 x 2097152, NNZ 55742968, RNZ 26 +# Output file: benchmark_spgemm.out.19 +Diag(A)*A: 1048576 x 1048576, nnz [CPU 5238784, GPU 5238784], CPU-GPU err 0.000000e+00 +B 1048576 x 1048576, NNZ 5238784, RNZ 4 +# Output file: benchmark_spgemm.out.20 +Diag(A)*A: 1048576 x 1048576, nnz [CPU 9424900, GPU 9424900], CPU-GPU err 0.000000e+00 +B 1048576 x 1048576, NNZ 9424900, RNZ 8 +# Output file: benchmark_spgemm.out.21 +A^2: 8388608 x 8388608, nnz [CPU 207882752, GPU 207882752], CPU-GPU err 0.000000e+00 +B 8388608 x 8388608, NNZ 207882752, RNZ 24 +# Output file: benchmark_spgemm.out.22 +A^2: 8388608 x 8388608, nnz [CPU 1029030184, GPU 1029030184], CPU-GPU err 0.000000e+00 +B 8388608 x 8388608, NNZ 1029030184, RNZ 122 +# Output file: benchmark_spgemm.out.23 +A^2: 4194304 x 4194304, nnz [CPU 54484996, GPU 54484996], CPU-GPU err 0.000000e+00 +B 4194304 x 4194304, NNZ 54484996, RNZ 12 +# Output file: benchmark_spgemm.out.24 +A^2: 4194304 x 4194304, nnz [CPU 104734756, GPU 104734756], CPU-GPU err 0.000000e+00 +B 4194304 x 4194304, NNZ 104734756, RNZ 24 +# Output file: benchmark_spgemm.out.25 +A^T*A: 8388608 x 8388608, nnz [CPU 207882752, GPU 207882752], CPU-GPU err 0.000000e+00 +B 8388608 x 8388608, NNZ 207882752, RNZ 24 +# Output file: benchmark_spgemm.out.26 +A^T*A: 8388608 x 8388608, nnz [CPU 1029030184, GPU 1029030184], CPU-GPU err 0.000000e+00 +B 8388608 x 8388608, NNZ 1029030184, RNZ 122 +# Output file: benchmark_spgemm.out.27 +A^T*A: 4194304 x 4194304, nnz [CPU 54484996, GPU 54484996], CPU-GPU err 0.000000e+00 +B 4194304 x 4194304, NNZ 54484996, RNZ 12 +# Output file: benchmark_spgemm.out.28 +A^T*A: 4194304 x 4194304, nnz [CPU 104734756, GPU 104734756], CPU-GPU err 0.000000e+00 +B 4194304 x 4194304, NNZ 104734756, RNZ 24 +# Output file: benchmark_spgemm.out.29 +AH: 2583446 x 2583446, nnz [CPU 135091866, GPU 135091866], CPU-GPU err 1.147135e-16 +AH 2583446 x 2583446, NNZ 135091866, RNZ 52 +# Output file: benchmark_spgemm.out.30 +AH: 680505 x 680505, nnz [CPU 63647301, GPU 63647301], CPU-GPU err 1.755166e-16 +AH 680505 x 680505, NNZ 63647301, RNZ 93 +# Output file: benchmark_spgemm.out.31 +AH: 1528997 x 1528997, nnz [CPU 22132459, GPU 22132459], CPU-GPU err 6.243446e-17 +AH 1528997 x 1528997, NNZ 22132459, RNZ 14 +# Output file: benchmark_spgemm.out.32 +AH: 784265 x 784265, nnz [CPU 17497231, GPU 17497231], CPU-GPU err 1.048829e-16 +AH 784265 x 784265, NNZ 17497231, RNZ 22 +# Output file: benchmark_spgemm.out.33 +AH: 2583446 x 2583446, nnz [CPU 135091866, GPU 135091866], CPU-GPU err 1.145884e-16 +AH 2583446 x 2583446, NNZ 135091866, RNZ 52 +# Output file: benchmark_spgemm.out.34 +AH: 680505 x 680505, nnz [CPU 63647301, GPU 63647301], CPU-GPU err 1.759819e-16 +AH 680505 x 680505, NNZ 63647301, RNZ 93 +# Output file: benchmark_spgemm.out.35 +AH: 1528997 x 1528997, nnz [CPU 22132459, GPU 22132459], CPU-GPU err 6.242405e-17 +AH 1528997 x 1528997, NNZ 22132459, RNZ 14 +# Output file: benchmark_spgemm.out.36 +AH: 784265 x 784265, nnz [CPU 17497231, GPU 17497231], CPU-GPU err 1.048567e-16 +AH 784265 x 784265, NNZ 17497231, RNZ 22 diff --git a/external/hypre/src/test/TEST_bench/benchmark_spgemm.sh b/external/hypre/src/test/TEST_bench/benchmark_spgemm.sh new file mode 100755 index 00000000..6cfdff63 --- /dev/null +++ b/external/hypre/src/test/TEST_bench/benchmark_spgemm.sh @@ -0,0 +1,78 @@ +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +TNAME=`basename $0 .sh` +RTOL=$1 +ATOL=$2 + +#============================================================================= +# compare with baseline case +#============================================================================= + +FILES="\ + ${TNAME}.out.1\ + ${TNAME}.out.2\ + ${TNAME}.out.3\ + ${TNAME}.out.4\ + ${TNAME}.out.5\ + ${TNAME}.out.6\ + ${TNAME}.out.7\ + ${TNAME}.out.8\ + ${TNAME}.out.9\ + ${TNAME}.out.10\ + ${TNAME}.out.11\ + ${TNAME}.out.12\ + ${TNAME}.out.13\ + ${TNAME}.out.14\ + ${TNAME}.out.15\ + ${TNAME}.out.16\ + ${TNAME}.out.17\ + ${TNAME}.out.18\ + ${TNAME}.out.19\ + ${TNAME}.out.20\ + ${TNAME}.out.21\ + ${TNAME}.out.22\ + ${TNAME}.out.23\ + ${TNAME}.out.24\ + ${TNAME}.out.25\ + ${TNAME}.out.26\ + ${TNAME}.out.27\ + ${TNAME}.out.28\ + ${TNAME}.out.29\ + ${TNAME}.out.30\ + ${TNAME}.out.31\ + ${TNAME}.out.32\ + ${TNAME}.out.33\ + ${TNAME}.out.34\ + ${TNAME}.out.35\ + ${TNAME}.out.36\ +" + +for i in $FILES +do + echo "# Output file: $i" + tail -2 $i +done > ${TNAME}.out + +for i in $FILES +do + echo "# Output file: $i" + setup_time=$(grep -A 1 "Device Parcsr Matrix-by-Matrix" $i | tail -n 1) + echo "Device Parcsr Matrix-by-Matrix"${setup_time} +done > ${TNAME}.perf.out + +# Make sure that the output file is reasonable +RUNCOUNT=`echo $FILES | wc -w` +OUTCOUNT=`grep "CPU-GPU err" ${TNAME}.out | wc -l` +if [ "$OUTCOUNT" != "$RUNCOUNT" ]; then + echo "Incorrect number of runs in ${TNAME}.out" >&2 +fi + +#============================================================================= +# remove temporary files +#============================================================================= + +rm -f ${TNAME}.testdata* diff --git a/external/hypre/src/test/TEST_bench/benchmark_struct.jobs b/external/hypre/src/test/TEST_bench/benchmark_struct.jobs old mode 100644 new mode 100755 index c695b6ff..98e7309f --- a/external/hypre/src/test/TEST_bench/benchmark_struct.jobs +++ b/external/hypre/src/test/TEST_bench/benchmark_struct.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -9,20 +9,20 @@ #============================================================================= # SMG CG -mpirun -np 4 ./struct -n 2048 2048 1 -d 2 -solver 10 > benchmark_struct.out.1 +mpirun -np 4 ./struct -n 2048 2048 1 -d 2 -solver 10 -repeats 2 > benchmark_struct.out.1 -mpirun -np 4 ./struct -n 3072 3072 1 -d 2 -solver 10 > benchmark_struct.out.2 +mpirun -np 4 ./struct -n 3072 3072 1 -d 2 -solver 10 -repeats 2 > benchmark_struct.out.2 -mpirun -np 4 ./struct -n 128 128 128 -solver 10 > benchmark_struct.out.3 +mpirun -np 4 ./struct -n 128 128 128 -solver 10 -repeats 2 > benchmark_struct.out.3 -mpirun -np 4 ./struct -n 200 200 200 -solver 10 > benchmark_struct.out.4 +mpirun -np 4 ./struct -n 200 200 200 -solver 10 -repeats 2 > benchmark_struct.out.4 # PFMG CG -mpirun -np 4 ./struct -n 2048 2048 1 -d 2 -solver 11 > benchmark_struct.out.5 +mpirun -np 4 ./struct -n 2048 2048 1 -d 2 -solver 11 -repeats 2 > benchmark_struct.out.5 -mpirun -np 4 ./struct -n 4096 4096 1 -d 2 -solver 11 > benchmark_struct.out.6 +mpirun -np 4 ./struct -n 4096 4096 1 -d 2 -solver 11 -repeats 2 > benchmark_struct.out.6 -mpirun -np 4 ./struct -n 256 256 256 -solver 11 > benchmark_struct.out.7 +mpirun -np 4 ./struct -n 256 256 256 -solver 11 -repeats 2 > benchmark_struct.out.7 -mpirun -np 4 ./struct -n 300 300 300 -solver 11 > benchmark_struct.out.8 +mpirun -np 4 ./struct -n 300 300 300 -solver 11 -repeats 2 > benchmark_struct.out.8 diff --git a/external/hypre/src/test/TEST_bench/benchmark_struct.perf.saved.lassen b/external/hypre/src/test/TEST_bench/benchmark_struct.perf.saved.lassen index eff61569..73f95744 100644 --- a/external/hypre/src/test/TEST_bench/benchmark_struct.perf.saved.lassen +++ b/external/hypre/src/test/TEST_bench/benchmark_struct.perf.saved.lassen @@ -1,24 +1,24 @@ # Output file: benchmark_struct.out.1 -PCG Setup wall clock time = 0.160423 seconds -PCG Solve wall clock time = 0.611084 seconds +PCG Setup wall clock time = 0.120866 seconds +PCG Solve wall clock time = 0.577228 seconds # Output file: benchmark_struct.out.2 -PCG Setup wall clock time = 0.205320 seconds -PCG Solve wall clock time = 0.816661 seconds +PCG Setup wall clock time = 0.139227 seconds +PCG Solve wall clock time = 0.769984 seconds # Output file: benchmark_struct.out.3 -PCG Setup wall clock time = 1.361077 seconds -PCG Solve wall clock time = 6.217676 seconds +PCG Setup wall clock time = 1.197938 seconds +PCG Solve wall clock time = 6.011690 seconds # Output file: benchmark_struct.out.4 -PCG Setup wall clock time = 2.124761 seconds -PCG Solve wall clock time = 9.681350 seconds +PCG Setup wall clock time = 1.791265 seconds +PCG Solve wall clock time = 9.300076 seconds # Output file: benchmark_struct.out.5 -PCG Setup wall clock time = 0.036715 seconds -PCG Solve wall clock time = 0.122633 seconds +PCG Setup wall clock time = 0.012325 seconds +PCG Solve wall clock time = 0.138208 seconds # Output file: benchmark_struct.out.6 -PCG Setup wall clock time = 0.219045 seconds -PCG Solve wall clock time = 0.331478 seconds +PCG Setup wall clock time = 0.019830 seconds +PCG Solve wall clock time = 0.313756 seconds # Output file: benchmark_struct.out.7 -PCG Setup wall clock time = 0.250209 seconds -PCG Solve wall clock time = 0.429207 seconds +PCG Setup wall clock time = 0.050781 seconds +PCG Solve wall clock time = 0.408700 seconds # Output file: benchmark_struct.out.8 -PCG Setup wall clock time = 0.249751 seconds -PCG Solve wall clock time = 0.654347 seconds +PCG Setup wall clock time = 0.069028 seconds +PCG Solve wall clock time = 0.629209 seconds diff --git a/external/hypre/src/test/TEST_bench/benchmark_struct.perf.saved.ray b/external/hypre/src/test/TEST_bench/benchmark_struct.perf.saved.ray deleted file mode 100644 index e286f477..00000000 --- a/external/hypre/src/test/TEST_bench/benchmark_struct.perf.saved.ray +++ /dev/null @@ -1,24 +0,0 @@ -# Output file: benchmark_struct.out.1 -PCG Setup wall clock time = 0.117209 seconds -PCG Solve wall clock time = 0.512375 seconds -# Output file: benchmark_struct.out.2 -PCG Setup wall clock time = 0.144187 seconds -PCG Solve wall clock time = 0.752631 seconds -# Output file: benchmark_struct.out.3 -PCG Setup wall clock time = 1.032979 seconds -PCG Solve wall clock time = 4.858539 seconds -# Output file: benchmark_struct.out.4 -PCG Setup wall clock time = 1.623183 seconds -PCG Solve wall clock time = 7.950859 seconds -# Output file: benchmark_struct.out.5 -PCG Setup wall clock time = 0.021501 seconds -PCG Solve wall clock time = 0.144316 seconds -# Output file: benchmark_struct.out.6 -PCG Setup wall clock time = 0.049996 seconds -PCG Solve wall clock time = 0.445686 seconds -# Output file: benchmark_struct.out.7 -PCG Setup wall clock time = 0.084665 seconds -PCG Solve wall clock time = 0.588257 seconds -# Output file: benchmark_struct.out.8 -PCG Setup wall clock time = 0.107986 seconds -PCG Solve wall clock time = 0.917126 seconds diff --git a/external/hypre/src/test/TEST_bench/benchmark_struct.perf.saved.tioga b/external/hypre/src/test/TEST_bench/benchmark_struct.perf.saved.tioga new file mode 100644 index 00000000..7703d652 --- /dev/null +++ b/external/hypre/src/test/TEST_bench/benchmark_struct.perf.saved.tioga @@ -0,0 +1,24 @@ +# Output file: benchmark_struct.out.1 +PCG Setup wall clock time = 0.091983 seconds +PCG Solve wall clock time = 0.421361 seconds +# Output file: benchmark_struct.out.2 +PCG Setup wall clock time = 0.114076 seconds +PCG Solve wall clock time = 0.568872 seconds +# Output file: benchmark_struct.out.3 +PCG Setup wall clock time = 0.862025 seconds +PCG Solve wall clock time = 4.294343 seconds +# Output file: benchmark_struct.out.4 +PCG Setup wall clock time = 1.412173 seconds +PCG Solve wall clock time = 7.285773 seconds +# Output file: benchmark_struct.out.5 +PCG Setup wall clock time = 0.012046 seconds +PCG Solve wall clock time = 0.095558 seconds +# Output file: benchmark_struct.out.6 +PCG Setup wall clock time = 0.016907 seconds +PCG Solve wall clock time = 0.241860 seconds +# Output file: benchmark_struct.out.7 +PCG Setup wall clock time = 0.044571 seconds +PCG Solve wall clock time = 0.333274 seconds +# Output file: benchmark_struct.out.8 +PCG Setup wall clock time = 0.071390 seconds +PCG Solve wall clock time = 0.519030 seconds diff --git a/external/hypre/src/test/TEST_bench/benchmark_struct.saved.ray b/external/hypre/src/test/TEST_bench/benchmark_struct.saved.tioga similarity index 100% rename from external/hypre/src/test/TEST_bench/benchmark_struct.saved.ray rename to external/hypre/src/test/TEST_bench/benchmark_struct.saved.tioga diff --git a/external/hypre/src/test/TEST_bench/benchmark_struct.sh b/external/hypre/src/test/TEST_bench/benchmark_struct.sh old mode 100644 new mode 100755 index 749db9c9..d0ba7ba5 --- a/external/hypre/src/test/TEST_bench/benchmark_struct.sh +++ b/external/hypre/src/test/TEST_bench/benchmark_struct.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -45,21 +45,6 @@ if [ "$OUTCOUNT" != "$RUNCOUNT" ]; then echo "Incorrect number of runs in ${TNAME}.out" >&2 fi -# Check performance -HOST=`hostname` -case $HOST in - lassen*) - SavePerfExt="saved.lassen" - rtol=0.15 - ;; - *) SavePerfExt="" - ;; -esac - -if [ -n "$SavePerfExt" ]; then - ../runcheck.sh $TNAME.perf.out $TNAME.perf.$SavePerfExt $rtol >&2 -fi - #============================================================================= # remove temporary files #============================================================================= diff --git a/external/hypre/src/test/TEST_error/error.jobs b/external/hypre/src/test/TEST_error/error.jobs new file mode 100755 index 00000000..2edd62aa --- /dev/null +++ b/external/hypre/src/test/TEST_error/error.jobs @@ -0,0 +1,22 @@ +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +#============================================================================= +# These runs generate errors +#============================================================================= + +mpirun -np 2 ./ij -solver 2 -max_iter 2 > error.out.0 +mpirun -np 2 ./ij -solver 1 -mg_max_iter 2 > error.out.1 +mpirun -np 2 ./ij -solver 1 -mg_max_iter 2 -difconv -c 0 0 0 > error.out.2 +mpirun -np 2 ./ij -solver 1 -mg_max_iter 2 -rlx 0 -w -1.0 > error.out.3 +mpirun -np 2 ./ij -solver 0 -mg_max_iter 2 > error.out.4 + +# Test the HYPRE_GetErrorMessages() and HYPRE_SetPrintErrorVerbosity() routines +mpirun -np 2 ./ij -solver 1 -mg_max_iter 2 -rlx 0 -w -1.0 > error.out.10 +mpirun -np 2 ./ij -solver 0 -mg_max_iter 1 -ns 0 -nc 2 > error.out.11 +mpirun -np 2 ./ij -solver 1 -mg_max_iter 2 -rlx 0 -w -1.0 -test_error 1 > error.out.15 +mpirun -np 2 ./ij -solver 0 -mg_max_iter 1 -ns 0 -nc 2 -test_error 1 > error.out.16 + diff --git a/external/hypre/src/test/TEST_error/error.saved b/external/hypre/src/test/TEST_error/error.saved new file mode 100644 index 00000000..56e0f3c0 --- /dev/null +++ b/external/hypre/src/test/TEST_error/error.saved @@ -0,0 +1,97 @@ +# Output file: error.out.0 + + +Iters ||r||_2 conv.rate ||r||_2/||b||_2 +----- ------------ --------- ------------ + 1 3.651484e+01 1.154701 1.154701e+00 + 2 2.779522e+01 0.761203 8.789620e-01 +# Output file: error.out.1 + + +Iters ||r||_2 conv.rate ||r||_2/||b||_2 +----- ------------ --------- ------------ + 1 9.666492e+00 0.305681 3.056813e-01 + 2 6.025557e-01 0.062334 1.905448e-02 +# Output file: error.out.2 +: 1.000000e+03 + + +Iters ||r||_2 conv.rate ||r||_2/||b||_2 +----- ------------ --------- ------------ + 1 1.995213e+00 0.063094 6.309416e-02 +# Output file: error.out.3 + + +Iters ||r||_2 conv.rate ||r||_2/||b||_2 +----- ------------ --------- ------------ + 1 5.298880e+01 1.675653 1.675653e+00 + 2 5.298880e+01 1.000000 1.675653e+00 +# Output file: error.out.4 + Average Convergence Factor = 0.235234 + + Complexity: grid = 1.555000 + operator = 2.667344 + cycle = 5.332187 + +# Output file: error.out.10 + + +Iters ||r||_2 conv.rate ||r||_2/||b||_2 +----- ------------ --------- ------------ + 1 5.298880e+01 1.675653 1.675653e+00 + 2 5.298880e+01 1.000000 1.675653e+00 +# Output file: error.out.11 + Average Convergence Factor = 1.379821 + + Complexity: grid = 1.555000 + operator = 2.667344 + cycle = 5.332187 + +# Output file: error.out.15 + + +Iters ||r||_2 conv.rate ||r||_2/||b||_2 +----- ------------ --------- ------------ + 1 5.298880e+01 1.675653 1.675653e+00 + 2 5.298880e+01 1.000000 1.675653e+00 +# Output file: error.out.16 + Average Convergence Factor = 1.379821 + + Complexity: grid = 1.555000 + operator = 2.667344 + cycle = 5.332187 + +0: hypre error in file "par_amg.c", line 2025, error code = 20 +0: hypre error in file "par_amg_solve.c", line 341, error code = 256 +0: hypre error in file "par_amg_solve.c", line 341, error code = 256 +0: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors +0: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors +0: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors +0: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors +0: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors +0: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors +0: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors +0: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors +0: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors +0: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors +0: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors +0: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors +0: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors +0: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors +0: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors +0: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors +0: hypre error in file "pcg.c", line 851, error code = 256 - Negative or zero gamma value in PCG +0: hypre error in file "pcg.c", line 851, error code = 256 - Negative or zero gamma value in PCG +0: hypre error in file "pcg.c", line 851, error code = 256 - Negative or zero gamma value in PCG +0: hypre error in file "pcg.c", line 992, error code = 256 - Reached max iterations 2 in PCG before convergence +0: hypre error in file "pcg.c", line 992, error code = 256 - Reached max iterations 2 in PCG before convergence +0: hypre error in file "pcg.c", line 992, error code = 256 - Reached max iterations 2 in PCG before convergence +0: hypre error in file "pcg.c", line 992, error code = 256 - Reached max iterations 2 in PCG before convergence +1: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors +1: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors +1: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors +1: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors +1: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors +1: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors +1: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors +1: hypre error in file "par_relax.c", line 753, error code = 1 - Hybrid GS relaxation doesn't support multicomponent vectors diff --git a/external/hypre/src/test/TEST_error/error.saved.lassen b/external/hypre/src/test/TEST_error/error.saved.lassen new file mode 100644 index 00000000..dfbd1791 --- /dev/null +++ b/external/hypre/src/test/TEST_error/error.saved.lassen @@ -0,0 +1,71 @@ +# Output file: error.out.0 + + +Iters ||r||_2 conv.rate ||r||_2/||b||_2 +----- ------------ --------- ------------ + 1 3.651484e+01 1.154701 1.154701e+00 + 2 2.779522e+01 0.761203 8.789620e-01 +# Output file: error.out.1 + + +Iters ||r||_2 conv.rate ||r||_2/||b||_2 +----- ------------ --------- ------------ + 1 1.382238e+01 0.437102 4.371021e-01 + 2 2.890219e+00 0.209097 9.139676e-02 +# Output file: error.out.2 +: 1.000000e+03 + + +Iters ||r||_2 conv.rate ||r||_2/||b||_2 +----- ------------ --------- ------------ + 1 1.880957e+01 0.594811 5.948108e-01 +# Output file: error.out.3 + + +Iters ||r||_2 conv.rate ||r||_2/||b||_2 +----- ------------ --------- ------------ + 1 5.536410e+01 1.750767 1.750767e+00 + 2 5.536410e+01 1.000000 1.750767e+00 +# Output file: error.out.4 + Average Convergence Factor = 0.388883 + + Complexity: grid = 1.427000 + operator = 2.492344 + cycle = 4.982188 + +# Output file: error.out.10 + + +Iters ||r||_2 conv.rate ||r||_2/||b||_2 +----- ------------ --------- ------------ + 1 5.536410e+01 1.750767 1.750767e+00 + 2 5.536410e+01 1.000000 1.750767e+00 +# Output file: error.out.11 + Average Convergence Factor = 0.397074 + + Complexity: grid = 1.427000 + operator = 2.492344 + cycle = 4.982188 + +# Output file: error.out.15 + + +Iters ||r||_2 conv.rate ||r||_2/||b||_2 +----- ------------ --------- ------------ + 1 5.536410e+01 1.750767 1.750767e+00 + 2 5.536410e+01 1.000000 1.750767e+00 +# Output file: error.out.16 + Average Convergence Factor = 0.397074 + + Complexity: grid = 1.427000 + operator = 2.492344 + cycle = 4.982188 + +0: hypre error in file "par_amg.c", line 2025, error code = 20 +0: hypre error in file "par_amg_solve.c", line 341, error code = 256 +0: hypre error in file "par_amg_solve.c", line 341, error code = 256 +0: hypre error in file "pcg.c", line 851, error code = 256 - Negative or zero gamma value in PCG +0: hypre error in file "pcg.c", line 992, error code = 256 - Reached max iterations 2 in PCG before convergence +0: hypre error in file "pcg.c", line 992, error code = 256 - Reached max iterations 2 in PCG before convergence +0: hypre error in file "pcg.c", line 992, error code = 256 - Reached max iterations 2 in PCG before convergence +0: hypre error in file "pcg.c", line 992, error code = 256 - Reached max iterations 2 in PCG before convergence diff --git a/external/hypre/src/test/TEST_error/error.sh b/external/hypre/src/test/TEST_error/error.sh new file mode 100755 index 00000000..f6a900ae --- /dev/null +++ b/external/hypre/src/test/TEST_error/error.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +TNAME=`basename $0 .sh` +RTOL=$1 +ATOL=$2 + +#============================================================================= +# compare with baseline case +#============================================================================= + +FILES="\ + ${TNAME}.out.0\ + ${TNAME}.out.1\ + ${TNAME}.out.2\ + ${TNAME}.out.3\ + ${TNAME}.out.4\ + ${TNAME}.out.10\ + ${TNAME}.out.11\ + ${TNAME}.out.15\ + ${TNAME}.out.16\ +" + +for i in $FILES +do + echo "# Output file: $i" + tail -21 $i | head -6 +done > ${TNAME}.out + +# Remove the "hypre error" lines from '.err' file and append them to '.out' +mv ${TNAME}.err ${TNAME}.tmp +egrep "hypre error" ${TNAME}.tmp | sort >> ${TNAME}.out +egrep -v "hypre error" ${TNAME}.tmp > ${TNAME}.err + +#============================================================================= +# remove temporary files +#============================================================================= + +rm -f ${TNAME}.testdata* +rm -f ${TNAME}.tmp diff --git a/external/hypre/src/test/TEST_examples/bigint.jobs b/external/hypre/src/test/TEST_examples/bigint.jobs old mode 100644 new mode 100755 index 9ce12ac3..55084409 --- a/external/hypre/src/test/TEST_examples/bigint.jobs +++ b/external/hypre/src/test/TEST_examples/bigint.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_examples/bigint.saved b/external/hypre/src/test/TEST_examples/bigint.saved index 9fd2ce36..63fb6e33 100644 --- a/external/hypre/src/test/TEST_examples/bigint.saved +++ b/external/hypre/src/test/TEST_examples/bigint.saved @@ -9,3 +9,4 @@ Final Relative Residual Norm = 6.309891e-09 Iterations = 7 Final Relative Residual Norm = 4.81542e-07 + diff --git a/external/hypre/src/test/TEST_examples/bigint.sh b/external/hypre/src/test/TEST_examples/bigint.sh old mode 100644 new mode 100755 index 3383a615..ccfab3d0 --- a/external/hypre/src/test/TEST_examples/bigint.sh +++ b/external/hypre/src/test/TEST_examples/bigint.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_examples/complex.jobs b/external/hypre/src/test/TEST_examples/complex.jobs old mode 100644 new mode 100755 index 3904b791..ad564611 --- a/external/hypre/src/test/TEST_examples/complex.jobs +++ b/external/hypre/src/test/TEST_examples/complex.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_examples/complex.sh b/external/hypre/src/test/TEST_examples/complex.sh old mode 100644 new mode 100755 index 7e4b5b02..d07a6312 --- a/external/hypre/src/test/TEST_examples/complex.sh +++ b/external/hypre/src/test/TEST_examples/complex.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_examples/default.jobs b/external/hypre/src/test/TEST_examples/default.jobs old mode 100644 new mode 100755 index 4df8d6f4..9907a3e6 --- a/external/hypre/src/test/TEST_examples/default.jobs +++ b/external/hypre/src/test/TEST_examples/default.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_examples/default.saved b/external/hypre/src/test/TEST_examples/default.saved index 02da5792..b443f0b7 100644 --- a/external/hypre/src/test/TEST_examples/default.saved +++ b/external/hypre/src/test/TEST_examples/default.saved @@ -87,3 +87,4 @@ Final Relative Residual Norm = 2.7253e-07 Iterations = 7 Final Relative Residual Norm = 4.81542e-07 + diff --git a/external/hypre/src/test/TEST_examples/default.sh b/external/hypre/src/test/TEST_examples/default.sh old mode 100644 new mode 100755 index 3f76cb86..de64a25d --- a/external/hypre/src/test/TEST_examples/default.sh +++ b/external/hypre/src/test/TEST_examples/default.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_examples/fortran_examples.jobs b/external/hypre/src/test/TEST_examples/fortran_examples.jobs old mode 100644 new mode 100755 index 00188a95..d13be0df --- a/external/hypre/src/test/TEST_examples/fortran_examples.jobs +++ b/external/hypre/src/test/TEST_examples/fortran_examples.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_examples/fortran_examples.sh b/external/hypre/src/test/TEST_examples/fortran_examples.sh old mode 100644 new mode 100755 index 9c21c1de..9409d51c --- a/external/hypre/src/test/TEST_examples/fortran_examples.sh +++ b/external/hypre/src/test/TEST_examples/fortran_examples.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_examples/gpu.jobs b/external/hypre/src/test/TEST_examples/gpu.jobs old mode 100644 new mode 100755 index 3d80562a..36074efc --- a/external/hypre/src/test/TEST_examples/gpu.jobs +++ b/external/hypre/src/test/TEST_examples/gpu.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -18,7 +18,7 @@ mpirun -np 16 ./ex4 -n 33 -solver 10 -K 3 -B 0 -C 1 -UO 2 -F 4 > gpu.out.4 mpirun -np 4 ./ex5 > gpu.out.5 -# mpirun -np 4 ./ex5f > gpu.out.5f +mpirun -np 4 ./ex5f > gpu.out.5f mpirun -np 2 ./ex6 > gpu.out.6 @@ -32,7 +32,7 @@ mpirun -np 16 ./ex9 -n 33 -solver 0 -v 1 1 > gpu.out.9 mpirun -np 2 ./ex12 -pfmg > gpu.out.12 -# mpirun -np 2 ./ex12f -pfmg > gpu.out.12f +mpirun -np 2 ./ex12f -pfmg > gpu.out.12f mpirun -np 6 ./ex13 -n 10 > gpu.out.13 diff --git a/external/hypre/src/test/TEST_examples/gpu.saved.lassen b/external/hypre/src/test/TEST_examples/gpu.saved.lassen index dff1f699..e53456de 100644 --- a/external/hypre/src/test/TEST_examples/gpu.saved.lassen +++ b/external/hypre/src/test/TEST_examples/gpu.saved.lassen @@ -25,9 +25,15 @@ Final Relative Residual Norm = 5.961443e-08 # Output file: gpu.out.5 -Iterations = 7 -Final Relative Residual Norm = 8.839175e-09 +Iterations = 6 +Final Relative Residual Norm = 8.921046e-08 + +# Output file: gpu.out.5f + + Iterations = 6 + Final Relative Residual Norm = 8.92104626E-08 + # Output file: gpu.out.6 1 3.503257e-02 0.004729 4.728807e-03 2 1.386843e-04 0.003959 1.872005e-05 @@ -58,15 +64,21 @@ Final Relative Residual Norm = 6.57147e-07 4 1.544291e-06 0.023226 2.725642e-07 +# Output file: gpu.out.12f + 2 3.255341e-03 0.014358 5.745609e-04 + 3 6.649011e-05 0.020425 1.173537e-05 + 4 1.544291e-06 0.023226 2.725642e-07 + + # Output file: gpu.out.13 Iterations = 11 -Final Relative Residual Norm = 7.02512e-07 +Final Relative Residual Norm = 9.59155e-07 # Output file: gpu.out.14 Iterations = 11 -Final Relative Residual Norm = 7.02512e-07 +Final Relative Residual Norm = 9.59155e-07 diff --git a/external/hypre/src/test/TEST_examples/gpu.saved.ray b/external/hypre/src/test/TEST_examples/gpu.saved.ray deleted file mode 100644 index 8f8c3d2a..00000000 --- a/external/hypre/src/test/TEST_examples/gpu.saved.ray +++ /dev/null @@ -1,78 +0,0 @@ -# Output file: gpu.out.1 - 11 5.329671e-05 0.179526 1.256215e-05 - 12 7.308483e-06 0.137128 1.722626e-06 - 13 7.411552e-07 0.101410 1.746920e-07 - - -# Output file: gpu.out.2 - 1 3.503257e-02 0.004729 4.728807e-03 - 2 1.386843e-04 0.003959 1.872005e-05 - 3 8.429961e-07 0.006079 1.137903e-07 - - -# Output file: gpu.out.3 - - -Iterations = 5 -Final Relative Residual Norm = 9.21374e-08 - -# Output file: gpu.out.4 - - -Iterations = 6 -Final Relative Residual Norm = 5.961443e-08 - -# Output file: gpu.out.5 - - -Iterations = 7 -Final Relative Residual Norm = 8.839174e-09 - -# Output file: gpu.out.6 - 1 3.503257e-02 0.004729 4.728807e-03 - 2 1.386843e-04 0.003959 1.872005e-05 - 3 8.429961e-07 0.006079 1.137903e-07 - - -# Output file: gpu.out.7 - - -Iterations = 6 -Final Relative Residual Norm = 5.961443e-08 - -# Output file: gpu.out.8 - 7 1.315332e-04 0.128961 2.233203e-05 - 8 1.350294e-05 0.102658 2.292562e-06 - 9 4.148659e-06 0.307241 7.043691e-07 - - -# Output file: gpu.out.9 - - -Iterations = 9 -Final Relative Residual Norm = 6.57147e-07 - -# Output file: gpu.out.12 - 2 3.255341e-03 0.014358 5.745609e-04 - 3 6.649011e-05 0.020425 1.173537e-05 - 4 1.544291e-06 0.023226 2.725642e-07 - - -# Output file: gpu.out.13 - - -Iterations = 11 -Final Relative Residual Norm = 7.02512e-07 - -# Output file: gpu.out.14 - - -Iterations = 11 -Final Relative Residual Norm = 7.02512e-07 - -# Output file: gpu.out.15 - - -#Iterations = 6 -#Final Relative Residual Norm = 7.75826e-07 - diff --git a/external/hypre/src/test/TEST_examples/gpu.sh b/external/hypre/src/test/TEST_examples/gpu.sh old mode 100644 new mode 100755 index 8d303c1f..1397dea7 --- a/external/hypre/src/test/TEST_examples/gpu.sh +++ b/external/hypre/src/test/TEST_examples/gpu.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -16,11 +16,13 @@ FILES="\ ${TNAME}.out.3\ ${TNAME}.out.4\ ${TNAME}.out.5\ + ${TNAME}.out.5f\ ${TNAME}.out.6\ ${TNAME}.out.7\ ${TNAME}.out.8\ ${TNAME}.out.9\ ${TNAME}.out.12\ + ${TNAME}.out.12f\ ${TNAME}.out.13\ ${TNAME}.out.14\ " @@ -34,7 +36,7 @@ do done > ${TNAME}.out # Make sure that the output file is reasonable -RUNCOUNT=7 +RUNCOUNT=8 OUTCOUNT=`grep "Iterations" ${TNAME}.out | wc -l` if [ "$OUTCOUNT" != "$RUNCOUNT" ]; then echo "Incorrect number of runs in ${TNAME}.out" >&2 diff --git a/external/hypre/src/test/TEST_examples/maxdim.jobs b/external/hypre/src/test/TEST_examples/maxdim.jobs old mode 100644 new mode 100755 index 9caff4bc..3cc39c41 --- a/external/hypre/src/test/TEST_examples/maxdim.jobs +++ b/external/hypre/src/test/TEST_examples/maxdim.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_examples/maxdim.sh b/external/hypre/src/test/TEST_examples/maxdim.sh old mode 100644 new mode 100755 index 28d3e338..5178e97a --- a/external/hypre/src/test/TEST_examples/maxdim.sh +++ b/external/hypre/src/test/TEST_examples/maxdim.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_fac/3lev.in b/external/hypre/src/test/TEST_fac/3lev.in index 52edb010..d1399042 100644 --- a/external/hypre/src/test/TEST_fac/3lev.in +++ b/external/hypre/src/test/TEST_fac/3lev.in @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_fac/3lev_multibox.in b/external/hypre/src/test/TEST_fac/3lev_multibox.in index d4598ff6..fbd33db2 100644 --- a/external/hypre/src/test/TEST_fac/3lev_multibox.in +++ b/external/hypre/src/test/TEST_fac/3lev_multibox.in @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_fac/4lev.in b/external/hypre/src/test/TEST_fac/4lev.in index 736db1fc..45af06ae 100644 --- a/external/hypre/src/test/TEST_fac/4lev.in +++ b/external/hypre/src/test/TEST_fac/4lev.in @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_fac/5lev.in b/external/hypre/src/test/TEST_fac/5lev.in index 6b629076..2c04e7cb 100644 --- a/external/hypre/src/test/TEST_fac/5lev.in +++ b/external/hypre/src/test/TEST_fac/5lev.in @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_fac/6lev.in b/external/hypre/src/test/TEST_fac/6lev.in index 390469f3..4a553f0c 100644 --- a/external/hypre/src/test/TEST_fac/6lev.in +++ b/external/hypre/src/test/TEST_fac/6lev.in @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_fac/7lev.in b/external/hypre/src/test/TEST_fac/7lev.in index 867235d3..b01a036e 100644 --- a/external/hypre/src/test/TEST_fac/7lev.in +++ b/external/hypre/src/test/TEST_fac/7lev.in @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_fac/sstruct_fac.jobs b/external/hypre/src/test/TEST_fac/sstruct_fac.jobs old mode 100644 new mode 100755 index 3ed8807e..d3ae37e7 --- a/external/hypre/src/test/TEST_fac/sstruct_fac.jobs +++ b/external/hypre/src/test/TEST_fac/sstruct_fac.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,11 +17,13 @@ mpirun -np 2 ./sstruct_fac -in 3lev.in -solver 99 -P 2 1 1 > sstruct_fac.out.1 # mpirun -np 6 ./sstruct_fac -in 3lev_multibox.in -solver 99 -P 2 3 1 \ # > sstruct_fac.out.3 -mpirun -np 1 ./sstruct_fac -in 4lev.in -solver 99 -r 1 2 2 > sstruct_fac.out.4 -mpirun -np 4 ./sstruct_fac -in 4lev.in -solver 99 -P 1 2 2 > sstruct_fac.out.5 +# RDF: AddFEMBoxValues() breaks these for some reason +# mpirun -np 1 ./sstruct_fac -in 4lev.in -solver 99 -r 1 2 2 > sstruct_fac.out.4 +# mpirun -np 4 ./sstruct_fac -in 4lev.in -solver 99 -P 1 2 2 > sstruct_fac.out.5 -mpirun -np 1 ./sstruct_fac -in 5lev.in -solver 99 -r 1 5 1 > sstruct_fac.out.6 -mpirun -np 5 ./sstruct_fac -in 5lev.in -solver 99 -P 1 5 1 > sstruct_fac.out.7 +# RDF: AddFEMBoxValues() breaks these for some reason +# mpirun -np 1 ./sstruct_fac -in 5lev.in -solver 99 -r 1 5 1 > sstruct_fac.out.6 +# mpirun -np 5 ./sstruct_fac -in 5lev.in -solver 99 -P 1 5 1 > sstruct_fac.out.7 # RLU: For the new memory model, these two examples does not work right now #mpirun -np 1 ./sstruct_fac -in 6lev.in -solver 99 -r 2 1 2 > sstruct_fac.out.8 diff --git a/external/hypre/src/test/TEST_fac/sstruct_fac.saved b/external/hypre/src/test/TEST_fac/sstruct_fac.saved index 81f48a4e..58746e20 100644 --- a/external/hypre/src/test/TEST_fac/sstruct_fac.saved +++ b/external/hypre/src/test/TEST_fac/sstruct_fac.saved @@ -6,22 +6,6 @@ Final Relative Residual Norm = 9.546812e-07 Iterations = 14 Final Relative Residual Norm = 9.546812e-07 -# Output file: sstruct_fac.out.4 -Iterations = 16 -Final Relative Residual Norm = 4.466155e-07 - -# Output file: sstruct_fac.out.5 -Iterations = 16 -Final Relative Residual Norm = 4.466155e-07 - -# Output file: sstruct_fac.out.6 -Iterations = 16 -Final Relative Residual Norm = 6.294807e-07 - -# Output file: sstruct_fac.out.7 -Iterations = 16 -Final Relative Residual Norm = 6.294807e-07 - # Output file: sstruct_fac.out.10 Iterations = 14 Final Relative Residual Norm = 7.049377e-07 diff --git a/external/hypre/src/test/TEST_fac/sstruct_fac.sh b/external/hypre/src/test/TEST_fac/sstruct_fac.sh old mode 100644 new mode 100755 index b4865108..ad4f0f74 --- a/external/hypre/src/test/TEST_fac/sstruct_fac.sh +++ b/external/hypre/src/test/TEST_fac/sstruct_fac.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -23,15 +23,15 @@ diff ${TNAME}.testdata ${TNAME}.testdata.temp >&2 #============================================================================= -tail -3 ${TNAME}.out.4 > ${TNAME}.testdata -tail -3 ${TNAME}.out.5 > ${TNAME}.testdata.temp -diff ${TNAME}.testdata ${TNAME}.testdata.temp >&2 +# tail -3 ${TNAME}.out.4 > ${TNAME}.testdata +# tail -3 ${TNAME}.out.5 > ${TNAME}.testdata.temp +# diff ${TNAME}.testdata ${TNAME}.testdata.temp >&2 #============================================================================= -tail -3 ${TNAME}.out.6 > ${TNAME}.testdata -tail -3 ${TNAME}.out.7 > ${TNAME}.testdata.temp -diff ${TNAME}.testdata ${TNAME}.testdata.temp >&2 +# tail -3 ${TNAME}.out.6 > ${TNAME}.testdata +# tail -3 ${TNAME}.out.7 > ${TNAME}.testdata.temp +# diff ${TNAME}.testdata ${TNAME}.testdata.temp >&2 #============================================================================= @@ -52,15 +52,15 @@ diff ${TNAME}.testdata ${TNAME}.testdata.temp >&2 FILES="\ ${TNAME}.out.0\ ${TNAME}.out.1\ - ${TNAME}.out.4\ - ${TNAME}.out.5\ - ${TNAME}.out.6\ - ${TNAME}.out.7\ ${TNAME}.out.10\ ${TNAME}.out.11\ " -# ${TNAME}.out.2\ -# ${TNAME}.out.3\ +# ${TNAME}.out.2\ +# ${TNAME}.out.3\ +# ${TNAME}.out.4\ +# ${TNAME}.out.5\ +# ${TNAME}.out.6\ +# ${TNAME}.out.7\ # ${TNAME}.out.8\ # ${TNAME}.out.9\ for i in $FILES diff --git a/external/hypre/src/test/TEST_fei/solvers.jobs b/external/hypre/src/test/TEST_fei/solvers.jobs old mode 100644 new mode 100755 index d0e09ed0..1bf1a7c0 --- a/external/hypre/src/test/TEST_fei/solvers.jobs +++ b/external/hypre/src/test/TEST_fei/solvers.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_fei/solvers.sh b/external/hypre/src/test/TEST_fei/solvers.sh old mode 100644 new mode 100755 index 74f9e0ed..a1869927 --- a/external/hypre/src/test/TEST_fei/solvers.sh +++ b/external/hypre/src/test/TEST_fei/solvers.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_gpumemcheck/gpu.jobs b/external/hypre/src/test/TEST_gpumemcheck/gpu.jobs new file mode 100644 index 00000000..eda10d23 --- /dev/null +++ b/external/hypre/src/test/TEST_gpumemcheck/gpu.jobs @@ -0,0 +1,13 @@ +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +mpirun -np 4 ./ij -n 20 20 10 -P 2 2 1 -solver 1 > gpu.out.1 + +mpirun -np 4 ./ij -n 20 20 10 -P 2 2 1 -solver 3 > gpu.out.2 + +mpirun -np 4 ./struct -P 2 2 1 -solver 0 > gpu.out.3 + +mpirun -np 4 ./struct -P 2 2 1 -solver 1 > gpu.out.4 diff --git a/external/hypre/src/test/TEST_gpumemcheck/gpu.saved.lassen b/external/hypre/src/test/TEST_gpumemcheck/gpu.saved.lassen new file mode 100644 index 00000000..2279d14e --- /dev/null +++ b/external/hypre/src/test/TEST_gpumemcheck/gpu.saved.lassen @@ -0,0 +1,40 @@ +# Output file: gpu.out.1 +========= LEAK SUMMARY: 0 bytes leaked in 0 allocations +========= LEAK SUMMARY: 0 bytes leaked in 0 allocations +========= LEAK SUMMARY: 0 bytes leaked in 0 allocations +========= LEAK SUMMARY: 0 bytes leaked in 0 allocations +========= ERROR SUMMARY: 0 errors +========= ERROR SUMMARY: 0 errors +========= ERROR SUMMARY: 0 errors +========= ERROR SUMMARY: 0 errors + +# Output file: gpu.out.2 +========= LEAK SUMMARY: 0 bytes leaked in 0 allocations +========= LEAK SUMMARY: 0 bytes leaked in 0 allocations +========= LEAK SUMMARY: 0 bytes leaked in 0 allocations +========= LEAK SUMMARY: 0 bytes leaked in 0 allocations +========= ERROR SUMMARY: 0 errors +========= ERROR SUMMARY: 0 errors +========= ERROR SUMMARY: 0 errors +========= ERROR SUMMARY: 0 errors + +# Output file: gpu.out.3 +========= LEAK SUMMARY: 0 bytes leaked in 0 allocations +========= LEAK SUMMARY: 0 bytes leaked in 0 allocations +========= LEAK SUMMARY: 0 bytes leaked in 0 allocations +========= LEAK SUMMARY: 0 bytes leaked in 0 allocations +========= ERROR SUMMARY: 0 errors +========= ERROR SUMMARY: 0 errors +========= ERROR SUMMARY: 0 errors +========= ERROR SUMMARY: 0 errors + +# Output file: gpu.out.4 +========= LEAK SUMMARY: 0 bytes leaked in 0 allocations +========= LEAK SUMMARY: 0 bytes leaked in 0 allocations +========= LEAK SUMMARY: 0 bytes leaked in 0 allocations +========= LEAK SUMMARY: 0 bytes leaked in 0 allocations +========= ERROR SUMMARY: 0 errors +========= ERROR SUMMARY: 0 errors +========= ERROR SUMMARY: 0 errors +========= ERROR SUMMARY: 0 errors + diff --git a/external/hypre/src/test/TEST_gpumemcheck/gpu.sh b/external/hypre/src/test/TEST_gpumemcheck/gpu.sh new file mode 100755 index 00000000..e15f65c0 --- /dev/null +++ b/external/hypre/src/test/TEST_gpumemcheck/gpu.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +TNAME=`basename $0 .sh` +RTOL=$1 +ATOL=$2 + +#============================================================================= +# compare with baseline case +#============================================================================= + +FILES="\ + ${TNAME}.out.1\ + ${TNAME}.out.2\ + ${TNAME}.out.3\ + ${TNAME}.out.4\ +" + +for i in $FILES +do + echo "# Output file: $i" + grep "LEAK SUMMARY" $i + grep "ERROR SUMMARY" $i + echo +done > ${TNAME}.out + +#============================================================================= +# remove temporary files +#============================================================================= + +rm -f ${TNAME}.testdata* diff --git a/external/hypre/src/test/TEST_ij/agg_interp.jobs b/external/hypre/src/test/TEST_ij/agg_interp.jobs old mode 100644 new mode 100755 index 0caf46c5..3f06c369 --- a/external/hypre/src/test/TEST_ij/agg_interp.jobs +++ b/external/hypre/src/test/TEST_ij/agg_interp.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -26,6 +26,7 @@ # 18: 2s-mod-ext interpolation all levels for systems problem hybrid approach # 19: 2s-mod-ee interpolation 1 levels (agg_tr 0.3) # 20: 2s-mod-ee interpolation all levels (agg_Pmx 4 agg_P12_mx 4) +# 22: multipass interpolation all levels (agg_Pmx 4 agg_P12_mx 4) #============================================================================= mpirun -np 8 ./ij -rhsrand -n 30 29 31 -P 2 2 2 -agg_nl 1 -agg_interp 1 -agg_Pmx 4 -solver 1 -rlx 6 \ @@ -40,6 +41,12 @@ mpirun -np 8 ./ij -rhsrand -n 30 29 31 -P 2 2 2 -agg_nl 1 -agg_interp 3 -agg_ mpirun -np 8 ./ij -rhsrand -n 30 29 31 -P 2 2 2 -agg_nl 1 -agg_interp 4 -solver 1 -rlx 6 \ >> agg_interp.out.4 +mpirun -np 8 ./ij -rhsrand -n 30 29 31 -P 2 2 2 -agg_nl 1 -agg_interp 8 -solver 1 -rlx 6 \ + >> agg_interp.out.4.1 + +mpirun -np 8 ./ij -rhsrand -n 30 29 31 -P 2 2 2 -agg_nl 1 -agg_interp 9 -solver 1 -rlx 6 \ + >> agg_interp.out.4.2 + mpirun -np 8 ./ij -rhsrand -n 30 29 31 -P 2 2 2 -agg_nl 10 -agg_interp 1 -agg_Pmx 4 -solver 1 -rlx 6 \ > agg_interp.out.5 @@ -52,18 +59,36 @@ mpirun -np 8 ./ij -rhsrand -n 30 29 31 -P 2 2 2 -agg_nl 10 -agg_interp 3 -agg mpirun -np 8 ./ij -rhsrand -n 30 29 31 -P 2 2 2 -agg_nl 10 -agg_interp 4 -solver 1 -rlx 6 \ >> agg_interp.out.8 +mpirun -np 8 ./ij -rhsrand -n 30 29 31 -P 2 2 2 -agg_nl 10 -agg_interp 8 -solver 1 -rlx 6 \ + >> agg_interp.out.8.1 + +mpirun -np 8 ./ij -rhsrand -n 30 29 31 -P 2 2 2 -agg_nl 10 -agg_interp 9 -solver 1 -rlx 6 \ + >> agg_interp.out.8.2 + mpirun -np 8 ./ij -rhsrand -n 30 29 31 -P 2 2 2 -agg_nl 1 -agg_interp 1 -agg_Pmx 4 -agg_P12_mx 3 -solver 1 -rlx 6 \ > agg_interp.out.9 mpirun -np 8 ./ij -rhsrand -n 20 19 22 -P 2 2 2 -sysL 3 -nf 3 -agg_nl 10 -agg_interp 4 -solver 1 -rlx 6 \ >> agg_interp.out.10 +mpirun -np 8 ./ij -rhsrand -n 20 19 22 -P 2 2 2 -sysL 3 -nf 3 -agg_nl 10 -agg_interp 8 -solver 1 -rlx 6 \ + >> agg_interp.out.10.1 + +mpirun -np 8 ./ij -rhsrand -n 20 19 22 -P 2 2 2 -sysL 3 -nf 3 -agg_nl 10 -agg_interp 9 -solver 1 -rlx 6 \ + >> agg_interp.out.10.2 + mpirun -np 8 ./ij -rhsrand -n 20 19 22 -P 2 2 2 -sysL 3 -nf 3 -agg_nl 10 -agg_interp 1 -agg_Pmx 4 -agg_P12_mx 4 -solver 1 -rlx 6 \ >> agg_interp.out.11 mpirun -np 8 ./ij -rhsrand -n 20 19 22 -P 2 2 2 -sysL 3 -nf 3 -agg_nl 10 -agg_interp 4 -nodal 1 -solver 1 -rlx 6 \ >> agg_interp.out.12 +mpirun -np 8 ./ij -rhsrand -n 20 19 22 -P 2 2 2 -sysL 3 -nf 3 -agg_nl 10 -agg_interp 8 -nodal 1 -solver 1 -rlx 6 \ + >> agg_interp.out.12.1 + +mpirun -np 8 ./ij -rhsrand -n 20 19 22 -P 2 2 2 -sysL 3 -nf 3 -agg_nl 10 -agg_interp 9 -nodal 1 -solver 1 -rlx 6 \ + >> agg_interp.out.12.2 + mpirun -np 8 ./ij -rhsrand -n 20 19 22 -P 2 2 2 -sysL 3 -nf 3 -agg_nl 10 -agg_interp 1 -agg_Pmx 4 -agg_P12_mx 4 -nodal 1 -solver 1 -rlx 6 \ >> agg_interp.out.13 @@ -85,6 +110,17 @@ mpirun -np 8 ./ij -rhsrand -n 20 19 22 -P 2 2 2 -sysL 3 -nf 3 -agg_nl 10 -int mpirun -np 8 ./ij -rhsrand -n 30 29 31 -P 2 2 2 -agg_nl 1 -agg_interp 7 -interptype 18 -agg_tr 0.3 -solver 1 -rlx 8 \ >> agg_interp.out.19 +mpirun -np 8 ./ij -rhsrand -n 30 29 31 -P 2 2 2 -agg_nl 1 -agg_interp 7 -interptype 18 -agg_tr 0.3 -solver 1 -rlx 88 \ + >> agg_interp.out.19.1 + +mpirun -np 8 ./ij -rhsrand -n 30 29 31 -P 2 2 2 -agg_nl 1 -agg_interp 7 -interptype 18 -agg_tr 0.3 -solver 1 -rlx 89 \ + >> agg_interp.out.19.2 + mpirun -np 8 ./ij -rhsrand -n 30 29 31 -P 2 2 2 -agg_nl 10 -agg_interp 7 -agg_Pmx 4 -agg_P12_mx 4 -solver 1 -rlx 6 \ >> agg_interp.out.20 +mpirun -np 2 ./ij -fromfile tst -agg_nl 1 -agg_interp 8 \ + >> agg_interp.out.21 + +mpirun -np 8 ./ij -rhsrand -n 30 29 31 -P 2 2 2 -agg_nl 10 -agg_interp 8 -agg_Pmx 4 -agg_P12_mx 4 -solver 1 -rlx 6 \ + >> agg_interp.out.22 diff --git a/external/hypre/src/test/TEST_ij/agg_interp.saved b/external/hypre/src/test/TEST_ij/agg_interp.saved index 5fdfc79a..8b522a3f 100644 --- a/external/hypre/src/test/TEST_ij/agg_interp.saved +++ b/external/hypre/src/test/TEST_ij/agg_interp.saved @@ -19,6 +19,18 @@ Final Relative Residual Norm = 7.511453e-09 # Output file: agg_interp.out.4 +Iterations = 12 +Final Relative Residual Norm = 3.507939e-09 + +# Output file: agg_interp.out.4.1 + + +Iterations = 12 +Final Relative Residual Norm = 3.309428e-09 + +# Output file: agg_interp.out.4.2 + + Iterations = 12 Final Relative Residual Norm = 3.507939e-09 @@ -43,6 +55,18 @@ Final Relative Residual Norm = 5.781132e-09 # Output file: agg_interp.out.8 +Iterations = 15 +Final Relative Residual Norm = 5.637036e-09 + +# Output file: agg_interp.out.8.1 + + +Iterations = 15 +Final Relative Residual Norm = 6.004315e-09 + +# Output file: agg_interp.out.8.2 + + Iterations = 15 Final Relative Residual Norm = 5.637036e-09 @@ -55,6 +79,18 @@ Final Relative Residual Norm = 4.335635e-09 # Output file: agg_interp.out.10 +Iterations = 22 +Final Relative Residual Norm = 8.737365e-09 + +# Output file: agg_interp.out.10.1 + + +Iterations = 22 +Final Relative Residual Norm = 8.190338e-09 + +# Output file: agg_interp.out.10.2 + + Iterations = 22 Final Relative Residual Norm = 8.737365e-09 @@ -67,6 +103,18 @@ Final Relative Residual Norm = 9.807905e-09 # Output file: agg_interp.out.12 +Iterations = 20 +Final Relative Residual Norm = 5.870410e-09 + +# Output file: agg_interp.out.12.1 + + +Iterations = 20 +Final Relative Residual Norm = 5.148867e-09 + +# Output file: agg_interp.out.12.2 + + Iterations = 20 Final Relative Residual Norm = 5.870410e-09 @@ -112,9 +160,33 @@ Final Relative Residual Norm = 3.612041e-09 Iterations = 10 Final Relative Residual Norm = 2.874370e-09 +# Output file: agg_interp.out.19.1 + + +Iterations = 10 +Final Relative Residual Norm = 5.100843e-09 + +# Output file: agg_interp.out.19.2 + + +Iterations = 9 +Final Relative Residual Norm = 4.307036e-09 + # Output file: agg_interp.out.20 Iterations = 11 Final Relative Residual Norm = 1.654514e-09 +# Output file: agg_interp.out.21 + + +BoomerAMG Iterations = 1 +Final Relative Residual Norm = 0.000000e+00 + +# Output file: agg_interp.out.22 + + +Iterations = 15 +Final Relative Residual Norm = 6.535343e-09 + diff --git a/external/hypre/src/test/TEST_ij/agg_interp.saved.aurora b/external/hypre/src/test/TEST_ij/agg_interp.saved.aurora new file mode 100644 index 00000000..87885e1c --- /dev/null +++ b/external/hypre/src/test/TEST_ij/agg_interp.saved.aurora @@ -0,0 +1,192 @@ +# Output file: agg_interp.out.1 + + +Iterations = 10 +Final Relative Residual Norm = 6.498298e-09 + +# Output file: agg_interp.out.2 + + +Iterations = 10 +Final Relative Residual Norm = 4.080317e-09 + +# Output file: agg_interp.out.3 + + +Iterations = 12 +Final Relative Residual Norm = 2.800234e-09 + +# Output file: agg_interp.out.4 + + +Iterations = 14 +Final Relative Residual Norm = 3.104296e-09 + +# Output file: agg_interp.out.4.1 + + +Iterations = 14 +Final Relative Residual Norm = 2.931926e-09 + +# Output file: agg_interp.out.4.2 + + +Iterations = 14 +Final Relative Residual Norm = 3.104296e-09 + +# Output file: agg_interp.out.5 + + +Iterations = 11 +Final Relative Residual Norm = 5.531986e-09 + +# Output file: agg_interp.out.6 + + +Iterations = 11 +Final Relative Residual Norm = 5.806018e-09 + +# Output file: agg_interp.out.7 + + +Iterations = 14 +Final Relative Residual Norm = 4.328016e-09 + +# Output file: agg_interp.out.8 + + +Iterations = 16 +Final Relative Residual Norm = 8.158525e-09 + +# Output file: agg_interp.out.8.1 + + +Iterations = 17 +Final Relative Residual Norm = 3.991337e-09 + +# Output file: agg_interp.out.8.2 + + +Iterations = 16 +Final Relative Residual Norm = 8.158525e-09 + +# Output file: agg_interp.out.9 + + +Iterations = 12 +Final Relative Residual Norm = 2.787662e-09 + +# Output file: agg_interp.out.10 + + +Iterations = 25 +Final Relative Residual Norm = 7.794962e-09 + +# Output file: agg_interp.out.10.1 + + +Iterations = 25 +Final Relative Residual Norm = 7.309743e-09 + +# Output file: agg_interp.out.10.2 + + +Iterations = 25 +Final Relative Residual Norm = 7.794962e-09 + +# Output file: agg_interp.out.11 + + +Iterations = 18 +Final Relative Residual Norm = 9.111019e-09 + +# Output file: agg_interp.out.12 + + +Iterations = 22 +Final Relative Residual Norm = 5.756606e-09 + +# Output file: agg_interp.out.12.1 + + +Iterations = 22 +Final Relative Residual Norm = 4.462172e-09 + +# Output file: agg_interp.out.12.2 + + +Iterations = 22 +Final Relative Residual Norm = 5.756606e-09 + +# Output file: agg_interp.out.13 + + +Iterations = 16 +Final Relative Residual Norm = 6.401116e-09 + +# Output file: agg_interp.out.14 + + +Iterations = 11 +Final Relative Residual Norm = 7.565865e-09 + +# Output file: agg_interp.out.15 + + +Iterations = 12 +Final Relative Residual Norm = 2.808498e-09 + +# Output file: agg_interp.out.16 + + +Iterations = 11 +Final Relative Residual Norm = 1.781423e-09 + +# Output file: agg_interp.out.17 + + +Iterations = 20 +Final Relative Residual Norm = 8.742609e-09 + +# Output file: agg_interp.out.18 + + +Iterations = 19 +Final Relative Residual Norm = 3.903948e-09 + +# Output file: agg_interp.out.19 + + +Iterations = 11 +Final Relative Residual Norm = 2.045275e-09 + +# Output file: agg_interp.out.19.1 + + +Iterations = 11 +Final Relative Residual Norm = 3.407818e-09 + +# Output file: agg_interp.out.19.2 + + +Iterations = 10 +Final Relative Residual Norm = 4.782432e-09 + +# Output file: agg_interp.out.20 + + +Iterations = 12 +Final Relative Residual Norm = 2.136187e-09 + +# Output file: agg_interp.out.21 + + +BoomerAMG Iterations = 9 +Final Relative Residual Norm = 2.176372e-09 + +# Output file: agg_interp.out.22 + + +Iterations = 17 +Final Relative Residual Norm = 4.919351e-09 + diff --git a/external/hypre/src/test/TEST_ij/agg_interp.saved.lassen b/external/hypre/src/test/TEST_ij/agg_interp.saved.lassen index d61cedc0..dc3ddd6c 100644 --- a/external/hypre/src/test/TEST_ij/agg_interp.saved.lassen +++ b/external/hypre/src/test/TEST_ij/agg_interp.saved.lassen @@ -2,13 +2,13 @@ Iterations = 10 -Final Relative Residual Norm = 4.534816e-09 +Final Relative Residual Norm = 4.175693e-09 # Output file: agg_interp.out.2 Iterations = 10 -Final Relative Residual Norm = 3.245546e-09 +Final Relative Residual Norm = 3.083921e-09 # Output file: agg_interp.out.3 @@ -19,6 +19,18 @@ Final Relative Residual Norm = 6.408748e-09 # Output file: agg_interp.out.4 +Iterations = 13 +Final Relative Residual Norm = 9.962426e-09 + +# Output file: agg_interp.out.4.1 + + +Iterations = 13 +Final Relative Residual Norm = 9.947240e-09 + +# Output file: agg_interp.out.4.2 + + Iterations = 13 Final Relative Residual Norm = 9.962426e-09 @@ -26,23 +38,35 @@ Final Relative Residual Norm = 9.962426e-09 Iterations = 11 -Final Relative Residual Norm = 3.901126e-09 +Final Relative Residual Norm = 5.655711e-09 # Output file: agg_interp.out.6 Iterations = 11 -Final Relative Residual Norm = 4.614195e-09 +Final Relative Residual Norm = 3.179034e-09 # Output file: agg_interp.out.7 Iterations = 13 -Final Relative Residual Norm = 8.031241e-09 +Final Relative Residual Norm = 8.027473e-09 # Output file: agg_interp.out.8 +Iterations = 16 +Final Relative Residual Norm = 8.359411e-09 + +# Output file: agg_interp.out.8.1 + + +Iterations = 16 +Final Relative Residual Norm = 7.750810e-09 + +# Output file: agg_interp.out.8.2 + + Iterations = 16 Final Relative Residual Norm = 8.359411e-09 @@ -50,11 +74,23 @@ Final Relative Residual Norm = 8.359411e-09 Iterations = 11 -Final Relative Residual Norm = 7.761156e-09 +Final Relative Residual Norm = 7.218488e-09 # Output file: agg_interp.out.10 +Iterations = 25 +Final Relative Residual Norm = 8.200302e-09 + +# Output file: agg_interp.out.10.1 + + +Iterations = 25 +Final Relative Residual Norm = 8.671776e-09 + +# Output file: agg_interp.out.10.2 + + Iterations = 25 Final Relative Residual Norm = 8.200302e-09 @@ -62,25 +98,37 @@ Final Relative Residual Norm = 8.200302e-09 Iterations = 19 -Final Relative Residual Norm = 4.085208e-09 +Final Relative Residual Norm = 4.180972e-09 # Output file: agg_interp.out.12 +Iterations = 22 +Final Relative Residual Norm = 4.656670e-09 + +# Output file: agg_interp.out.12.1 + + +Iterations = 22 +Final Relative Residual Norm = 5.415649e-09 + +# Output file: agg_interp.out.12.2 + + Iterations = 22 Final Relative Residual Norm = 4.656670e-09 # Output file: agg_interp.out.13 -Iterations = 17 -Final Relative Residual Norm = 3.479761e-09 +Iterations = 16 +Final Relative Residual Norm = 9.072689e-09 # Output file: agg_interp.out.14 Iterations = 11 -Final Relative Residual Norm = 4.065039e-09 +Final Relative Residual Norm = 4.051025e-09 # Output file: agg_interp.out.15 @@ -92,29 +140,53 @@ Final Relative Residual Norm = 6.606006e-09 Iterations = 10 -Final Relative Residual Norm = 3.954124e-09 +Final Relative Residual Norm = 4.938299e-09 # Output file: agg_interp.out.17 Iterations = 20 -Final Relative Residual Norm = 8.245507e-09 +Final Relative Residual Norm = 6.711024e-09 # Output file: agg_interp.out.18 Iterations = 18 -Final Relative Residual Norm = 5.326617e-09 +Final Relative Residual Norm = 5.325382e-09 # Output file: agg_interp.out.19 Iterations = 10 -Final Relative Residual Norm = 6.953099e-09 +Final Relative Residual Norm = 6.953719e-09 -# Output file: agg_interp.out.20 +# Output file: agg_interp.out.19.1 Iterations = 11 -Final Relative Residual Norm = 9.091177e-09 +Final Relative Residual Norm = 1.959614e-09 + +# Output file: agg_interp.out.19.2 + + +Iterations = 10 +Final Relative Residual Norm = 2.361979e-09 + +# Output file: agg_interp.out.20 + + +Iterations = 12 +Final Relative Residual Norm = 2.442371e-09 + +# Output file: agg_interp.out.21 + + +BoomerAMG Iterations = 9 +Final Relative Residual Norm = 2.176372e-09 + +# Output file: agg_interp.out.22 + + +Iterations = 16 +Final Relative Residual Norm = 7.077723e-09 diff --git a/external/hypre/src/test/TEST_ij/agg_interp.saved.lassen_cpu b/external/hypre/src/test/TEST_ij/agg_interp.saved.lassen_cpu new file mode 100644 index 00000000..e3532833 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/agg_interp.saved.lassen_cpu @@ -0,0 +1,192 @@ +# Output file: agg_interp.out.1 + + +Iterations = 9 +Final Relative Residual Norm = 4.675538e-09 + +# Output file: agg_interp.out.2 + + +Iterations = 9 +Final Relative Residual Norm = 3.807119e-09 + +# Output file: agg_interp.out.3 + + +Iterations = 10 +Final Relative Residual Norm = 7.511453e-09 + +# Output file: agg_interp.out.4 + + +Iterations = 12 +Final Relative Residual Norm = 3.507939e-09 + +# Output file: agg_interp.out.4.1 + + +Iterations = 12 +Final Relative Residual Norm = 3.309428e-09 + +# Output file: agg_interp.out.4.2 + + +Iterations = 12 +Final Relative Residual Norm = 3.507939e-09 + +# Output file: agg_interp.out.5 + + +Iterations = 10 +Final Relative Residual Norm = 7.397596e-09 + +# Output file: agg_interp.out.6 + + +Iterations = 10 +Final Relative Residual Norm = 5.088038e-09 + +# Output file: agg_interp.out.7 + + +Iterations = 12 +Final Relative Residual Norm = 5.781132e-09 + +# Output file: agg_interp.out.8 + + +Iterations = 15 +Final Relative Residual Norm = 5.637036e-09 + +# Output file: agg_interp.out.8.1 + + +Iterations = 15 +Final Relative Residual Norm = 6.004315e-09 + +# Output file: agg_interp.out.8.2 + + +Iterations = 15 +Final Relative Residual Norm = 5.637036e-09 + +# Output file: agg_interp.out.9 + + +Iterations = 10 +Final Relative Residual Norm = 4.335635e-09 + +# Output file: agg_interp.out.10 + + +Iterations = 22 +Final Relative Residual Norm = 8.737365e-09 + +# Output file: agg_interp.out.10.1 + + +Iterations = 22 +Final Relative Residual Norm = 8.190338e-09 + +# Output file: agg_interp.out.10.2 + + +Iterations = 22 +Final Relative Residual Norm = 8.737365e-09 + +# Output file: agg_interp.out.11 + + +Iterations = 17 +Final Relative Residual Norm = 9.807905e-09 + +# Output file: agg_interp.out.12 + + +Iterations = 20 +Final Relative Residual Norm = 5.870410e-09 + +# Output file: agg_interp.out.12.1 + + +Iterations = 20 +Final Relative Residual Norm = 5.148867e-09 + +# Output file: agg_interp.out.12.2 + + +Iterations = 20 +Final Relative Residual Norm = 5.870410e-09 + +# Output file: agg_interp.out.13 + + +Iterations = 16 +Final Relative Residual Norm = 5.163837e-09 + +# Output file: agg_interp.out.14 + + +Iterations = 10 +Final Relative Residual Norm = 2.493000e-09 + +# Output file: agg_interp.out.15 + + +Iterations = 10 +Final Relative Residual Norm = 7.511453e-09 + +# Output file: agg_interp.out.16 + + +Iterations = 9 +Final Relative Residual Norm = 6.146679e-09 + +# Output file: agg_interp.out.17 + + +Iterations = 17 +Final Relative Residual Norm = 7.573922e-09 + +# Output file: agg_interp.out.18 + + +Iterations = 16 +Final Relative Residual Norm = 5.577693e-09 + +# Output file: agg_interp.out.19 + + +Iterations = 10 +Final Relative Residual Norm = 2.864587e-09 + +# Output file: agg_interp.out.19.1 + + +Iterations = 10 +Final Relative Residual Norm = 5.100364e-09 + +# Output file: agg_interp.out.19.2 + + +Iterations = 9 +Final Relative Residual Norm = 4.344114e-09 + +# Output file: agg_interp.out.20 + + +Iterations = 10 +Final Relative Residual Norm = 5.375178e-09 + +# Output file: agg_interp.out.21 + + +BoomerAMG Iterations = 1 +Final Relative Residual Norm = 0.000000e+00 + +# Output file: agg_interp.out.22 + + +Iterations = 15 +Final Relative Residual Norm = 6.853574e-09 + diff --git a/external/hypre/src/test/TEST_ij/agg_interp.saved.ray b/external/hypre/src/test/TEST_ij/agg_interp.saved.ray deleted file mode 100644 index d790905b..00000000 --- a/external/hypre/src/test/TEST_ij/agg_interp.saved.ray +++ /dev/null @@ -1,120 +0,0 @@ -# Output file: agg_interp.out.1 - - -Iterations = 10 -Final Relative Residual Norm = 4.534816e-09 - -# Output file: agg_interp.out.2 - - -Iterations = 10 -Final Relative Residual Norm = 3.245546e-09 - -# Output file: agg_interp.out.3 - - -Iterations = 11 -Final Relative Residual Norm = 6.408748e-09 - -# Output file: agg_interp.out.4 - - -Iterations = 13 -Final Relative Residual Norm = 9.962426e-09 - -# Output file: agg_interp.out.5 - - -Iterations = 11 -Final Relative Residual Norm = 3.901126e-09 - -# Output file: agg_interp.out.6 - - -Iterations = 11 -Final Relative Residual Norm = 4.614195e-09 - -# Output file: agg_interp.out.7 - - -Iterations = 13 -Final Relative Residual Norm = 8.031241e-09 - -# Output file: agg_interp.out.8 - - -Iterations = 16 -Final Relative Residual Norm = 8.359411e-09 - -# Output file: agg_interp.out.9 - - -Iterations = 11 -Final Relative Residual Norm = 7.761156e-09 - -# Output file: agg_interp.out.10 - - -Iterations = 25 -Final Relative Residual Norm = 8.200302e-09 - -# Output file: agg_interp.out.11 - - -Iterations = 19 -Final Relative Residual Norm = 4.085208e-09 - -# Output file: agg_interp.out.12 - - -Iterations = 22 -Final Relative Residual Norm = 4.656670e-09 - -# Output file: agg_interp.out.13 - - -Iterations = 17 -Final Relative Residual Norm = 3.479761e-09 - -# Output file: agg_interp.out.14 - - -Iterations = 11 -Final Relative Residual Norm = 4.065039e-09 - -# Output file: agg_interp.out.15 - - -Iterations = 11 -Final Relative Residual Norm = 6.606006e-09 - -# Output file: agg_interp.out.16 - - -Iterations = 10 -Final Relative Residual Norm = 3.954075e-09 - -# Output file: agg_interp.out.17 - - -Iterations = 20 -Final Relative Residual Norm = 8.245507e-09 - -# Output file: agg_interp.out.18 - - -Iterations = 18 -Final Relative Residual Norm = 5.326617e-09 - -# Output file: agg_interp.out.19 - - -Iterations = 10 -Final Relative Residual Norm = 6.953719e-09 - -# Output file: agg_interp.out.20 - - -Iterations = 11 -Final Relative Residual Norm = 9.106706e-09 - diff --git a/external/hypre/src/test/TEST_ij/agg_interp.sh b/external/hypre/src/test/TEST_ij/agg_interp.sh old mode 100644 new mode 100755 index 32ccbde0..2ae82bc8 --- a/external/hypre/src/test/TEST_ij/agg_interp.sh +++ b/external/hypre/src/test/TEST_ij/agg_interp.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,14 +17,22 @@ FILES="\ ${TNAME}.out.2\ ${TNAME}.out.3\ ${TNAME}.out.4\ + ${TNAME}.out.4.1\ + ${TNAME}.out.4.2\ ${TNAME}.out.5\ ${TNAME}.out.6\ ${TNAME}.out.7\ ${TNAME}.out.8\ + ${TNAME}.out.8.1\ + ${TNAME}.out.8.2\ ${TNAME}.out.9\ ${TNAME}.out.10\ + ${TNAME}.out.10.1\ + ${TNAME}.out.10.2\ ${TNAME}.out.11\ ${TNAME}.out.12\ + ${TNAME}.out.12.1\ + ${TNAME}.out.12.2\ ${TNAME}.out.13\ ${TNAME}.out.14\ ${TNAME}.out.15\ @@ -32,7 +40,11 @@ FILES="\ ${TNAME}.out.17\ ${TNAME}.out.18\ ${TNAME}.out.19\ + ${TNAME}.out.19.1\ + ${TNAME}.out.19.2\ ${TNAME}.out.20\ + ${TNAME}.out.21\ + ${TNAME}.out.22\ " for i in $FILES diff --git a/external/hypre/src/test/TEST_ij/air.jobs b/external/hypre/src/test/TEST_ij/air.jobs old mode 100644 new mode 100755 index c479f78c..34d92461 --- a/external/hypre/src/test/TEST_ij/air.jobs +++ b/external/hypre/src/test/TEST_ij/air.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_ij/air.saved.aurora b/external/hypre/src/test/TEST_ij/air.saved.aurora new file mode 100644 index 00000000..af57a0c2 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/air.saved.aurora @@ -0,0 +1,48 @@ +# Output file: air.out.20 +BoomerAMG Iterations = 25 +Final Relative Residual Norm = 5.387301e-09 + +# Output file: air.out.21 +BoomerAMG Iterations = 18 +Final Relative Residual Norm = 7.663841e-09 + +# Output file: air.out.22 +BoomerAMG Iterations = 15 +Final Relative Residual Norm = 4.043648e-09 + +# Output file: air.out.23 +GMRES Iterations = 13 +Final GMRES Relative Residual Norm = 9.567861e-09 + +# Output file: air.out.24 +GMRES Iterations = 11 +Final GMRES Relative Residual Norm = 5.102120e-09 + +# Output file: air.out.25 +GMRES Iterations = 9 +Final GMRES Relative Residual Norm = 9.575076e-09 + +# Output file: air.out.26 +BoomerAMG Iterations = 11 +Final Relative Residual Norm = 2.902926e-10 + +# Output file: air.out.27 +BoomerAMG Iterations = 10 +Final Relative Residual Norm = 3.965599e-09 + +# Output file: air.out.28 +BoomerAMG Iterations = 10 +Final Relative Residual Norm = 6.850225e-09 + +# Output file: air.out.29 +GMRES Iterations = 11 +Final GMRES Relative Residual Norm = 2.978902e-09 + +# Output file: air.out.30 +GMRES Iterations = 10 +Final GMRES Relative Residual Norm = 2.603853e-09 + +# Output file: air.out.31 +GMRES Iterations = 10 +Final GMRES Relative Residual Norm = 5.553389e-09 + diff --git a/external/hypre/src/test/TEST_ij/air.saved.lassen b/external/hypre/src/test/TEST_ij/air.saved.lassen index 9332f596..7c381d45 100644 --- a/external/hypre/src/test/TEST_ij/air.saved.lassen +++ b/external/hypre/src/test/TEST_ij/air.saved.lassen @@ -4,11 +4,11 @@ Final Relative Residual Norm = 9.312591e-09 # Output file: air.out.21 BoomerAMG Iterations = 18 -Final Relative Residual Norm = 7.892897e-09 +Final Relative Residual Norm = 7.891369e-09 # Output file: air.out.22 BoomerAMG Iterations = 16 -Final Relative Residual Norm = 6.456267e-09 +Final Relative Residual Norm = 6.452598e-09 # Output file: air.out.23 GMRES Iterations = 14 @@ -16,11 +16,11 @@ Final GMRES Relative Residual Norm = 3.144844e-09 # Output file: air.out.24 GMRES Iterations = 11 -Final GMRES Relative Residual Norm = 9.682026e-09 +Final GMRES Relative Residual Norm = 9.678669e-09 # Output file: air.out.25 GMRES Iterations = 10 -Final GMRES Relative Residual Norm = 1.934862e-09 +Final GMRES Relative Residual Norm = 1.934858e-09 # Output file: air.out.26 BoomerAMG Iterations = 11 @@ -40,9 +40,9 @@ Final GMRES Relative Residual Norm = 1.821590e-09 # Output file: air.out.30 GMRES Iterations = 10 -Final GMRES Relative Residual Norm = 3.031157e-09 +Final GMRES Relative Residual Norm = 3.031124e-09 # Output file: air.out.31 GMRES Iterations = 10 -Final GMRES Relative Residual Norm = 6.135785e-09 +Final GMRES Relative Residual Norm = 6.029147e-09 diff --git a/external/hypre/src/test/TEST_ij/air.saved.lassen_cpu b/external/hypre/src/test/TEST_ij/air.saved.lassen_cpu new file mode 100644 index 00000000..70ce6b33 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/air.saved.lassen_cpu @@ -0,0 +1,48 @@ +# Output file: air.out.20 +BoomerAMG Iterations = 24 +Final Relative Residual Norm = 7.174911e-09 + +# Output file: air.out.21 +BoomerAMG Iterations = 17 +Final Relative Residual Norm = 3.655624e-09 + +# Output file: air.out.22 +BoomerAMG Iterations = 15 +Final Relative Residual Norm = 3.128157e-09 + +# Output file: air.out.23 +GMRES Iterations = 14 +Final GMRES Relative Residual Norm = 4.260195e-09 + +# Output file: air.out.24 +GMRES Iterations = 11 +Final GMRES Relative Residual Norm = 2.336948e-09 + +# Output file: air.out.25 +GMRES Iterations = 10 +Final GMRES Relative Residual Norm = 2.980381e-09 + +# Output file: air.out.26 +BoomerAMG Iterations = 11 +Final Relative Residual Norm = 1.195660e-10 + +# Output file: air.out.27 +BoomerAMG Iterations = 10 +Final Relative Residual Norm = 2.607892e-10 + +# Output file: air.out.28 +BoomerAMG Iterations = 10 +Final Relative Residual Norm = 9.100800e-10 + +# Output file: air.out.29 +GMRES Iterations = 11 +Final GMRES Relative Residual Norm = 4.903657e-09 + +# Output file: air.out.30 +GMRES Iterations = 10 +Final GMRES Relative Residual Norm = 2.748050e-10 + +# Output file: air.out.31 +GMRES Iterations = 10 +Final GMRES Relative Residual Norm = 1.904458e-09 + diff --git a/external/hypre/src/test/TEST_ij/air.saved.ray b/external/hypre/src/test/TEST_ij/air.saved.ray deleted file mode 100644 index 567eb164..00000000 --- a/external/hypre/src/test/TEST_ij/air.saved.ray +++ /dev/null @@ -1,48 +0,0 @@ -# Output file: air.out.20 -BoomerAMG Iterations = 25 -Final Relative Residual Norm = 9.312591e-09 - -# Output file: air.out.21 -BoomerAMG Iterations = 18 -Final Relative Residual Norm = 7.892897e-09 - -# Output file: air.out.22 -BoomerAMG Iterations = 16 -Final Relative Residual Norm = 6.453441e-09 - -# Output file: air.out.23 -GMRES Iterations = 14 -Final GMRES Relative Residual Norm = 3.144844e-09 - -# Output file: air.out.24 -GMRES Iterations = 11 -Final GMRES Relative Residual Norm = 9.682026e-09 - -# Output file: air.out.25 -GMRES Iterations = 10 -Final GMRES Relative Residual Norm = 1.935052e-09 - -# Output file: air.out.26 -BoomerAMG Iterations = 11 -Final Relative Residual Norm = 1.541616e-09 - -# Output file: air.out.27 -BoomerAMG Iterations = 10 -Final Relative Residual Norm = 4.818763e-09 - -# Output file: air.out.28 -BoomerAMG Iterations = 10 -Final Relative Residual Norm = 4.701521e-09 - -# Output file: air.out.29 -GMRES Iterations = 12 -Final GMRES Relative Residual Norm = 1.821590e-09 - -# Output file: air.out.30 -GMRES Iterations = 10 -Final GMRES Relative Residual Norm = 3.031157e-09 - -# Output file: air.out.31 -GMRES Iterations = 10 -Final GMRES Relative Residual Norm = 6.135785e-09 - diff --git a/external/hypre/src/test/TEST_ij/air.sh b/external/hypre/src/test/TEST_ij/air.sh old mode 100644 new mode 100755 index 39fb573a..40c7618c --- a/external/hypre/src/test/TEST_ij/air.sh +++ b/external/hypre/src/test/TEST_ij/air.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_ij/amgdd.jobs b/external/hypre/src/test/TEST_ij/amgdd.jobs old mode 100644 new mode 100755 index a5b99da1..31d83063 --- a/external/hypre/src/test/TEST_ij/amgdd.jobs +++ b/external/hypre/src/test/TEST_ij/amgdd.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_ij/amgdd.saved.aurora b/external/hypre/src/test/TEST_ij/amgdd.saved.aurora new file mode 100644 index 00000000..bd911cc4 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/amgdd.saved.aurora @@ -0,0 +1,64 @@ +# Output file: amgdd.out.900 +BoomerAMG-DD Iterations = 10 +Final Relative Residual Norm = 1.974236e-09 + +# Output file: amgdd.out.901 +BoomerAMG-DD Iterations = 10 +Final Relative Residual Norm = 6.283398e-09 + +# Output file: amgdd.out.902 +BoomerAMG-DD Iterations = 10 +Final Relative Residual Norm = 5.065796e-09 + +# Output file: amgdd.out.903 +BoomerAMG-DD Iterations = 23 +Final Relative Residual Norm = 9.593628e-09 + +# Output file: amgdd.out.904 +BoomerAMG-DD Iterations = 23 +Final Relative Residual Norm = 9.593628e-09 + +# Output file: amgdd.out.905 +BoomerAMG-DD Iterations = 10 +Final Relative Residual Norm = 4.862475e-09 + +# Output file: amgdd.out.906 +BoomerAMG-DD Iterations = 10 +Final Relative Residual Norm = 4.878252e-09 + +# Output file: amgdd.out.910 +GMRES Iterations = 7 +Final GMRES Relative Residual Norm = 9.651980e-10 + +# Output file: amgdd.out.911 +GMRES Iterations = 7 +Final GMRES Relative Residual Norm = 3.485453e-09 + +# Output file: amgdd.out.912 +GMRES Iterations = 7 +Final GMRES Relative Residual Norm = 4.261629e-09 + +# Output file: amgdd.out.913 +GMRES Iterations = 6 +Final GMRES Relative Residual Norm = 1.693835e-09 + +# Output file: amgdd.out.914 +GMRES Iterations = 15 +Final GMRES Relative Residual Norm = 3.189651e-09 + +# Output file: amgdd.out.915 +GMRES Iterations = 5 +Final GMRES Relative Residual Norm = 7.922017e-09 + +# Output file: amgdd.out.916 +GMRES Iterations = 15 +Final GMRES Relative Residual Norm = 3.188967e-03 + +# Output file: amgdd.out.917 +GMRES Iterations = 7 +Final GMRES Relative Residual Norm = 1.815824e-09 + +# Output file: amgdd.out.918 +GMRES Iterations = 7 +Final GMRES Relative Residual Norm = 1.073711e-09 + diff --git a/external/hypre/src/test/TEST_ij/amgdd.saved.lassen b/external/hypre/src/test/TEST_ij/amgdd.saved.lassen index 4a6bc20e..82bc4353 100644 --- a/external/hypre/src/test/TEST_ij/amgdd.saved.lassen +++ b/external/hypre/src/test/TEST_ij/amgdd.saved.lassen @@ -1,64 +1,64 @@ # Output file: amgdd.out.900 -BoomerAMG-DD Iterations = 10 -Final Relative Residual Norm = 8.474980e-09 +BoomerAMG-DD Iterations = 11 +Final Relative Residual Norm = 2.637142e-09 # Output file: amgdd.out.901 -BoomerAMG-DD Iterations = 11 -Final Relative Residual Norm = 3.978926e-09 +BoomerAMG-DD Iterations = 10 +Final Relative Residual Norm = 5.434597e-09 # Output file: amgdd.out.902 BoomerAMG-DD Iterations = 11 -Final Relative Residual Norm = 3.608239e-09 +Final Relative Residual Norm = 3.272845e-09 # Output file: amgdd.out.903 BoomerAMG-DD Iterations = 25 -Final Relative Residual Norm = 6.743448e-09 +Final Relative Residual Norm = 6.508851e-09 # Output file: amgdd.out.904 BoomerAMG-DD Iterations = 25 -Final Relative Residual Norm = 7.071246e-09 +Final Relative Residual Norm = 6.758206e-09 # Output file: amgdd.out.905 BoomerAMG-DD Iterations = 11 -Final Relative Residual Norm = 2.865652e-09 +Final Relative Residual Norm = 2.682944e-09 # Output file: amgdd.out.906 BoomerAMG-DD Iterations = 11 -Final Relative Residual Norm = 2.872730e-09 +Final Relative Residual Norm = 2.688644e-09 # Output file: amgdd.out.910 GMRES Iterations = 7 -Final GMRES Relative Residual Norm = 2.627495e-09 +Final GMRES Relative Residual Norm = 2.783446e-09 # Output file: amgdd.out.911 GMRES Iterations = 7 -Final GMRES Relative Residual Norm = 6.257514e-09 +Final GMRES Relative Residual Norm = 3.807194e-09 # Output file: amgdd.out.912 GMRES Iterations = 7 -Final GMRES Relative Residual Norm = 6.425568e-09 +Final GMRES Relative Residual Norm = 6.374572e-09 # Output file: amgdd.out.913 GMRES Iterations = 6 -Final GMRES Relative Residual Norm = 2.720128e-09 +Final GMRES Relative Residual Norm = 2.680719e-09 # Output file: amgdd.out.914 -GMRES Iterations = 14 -Final GMRES Relative Residual Norm = 6.291930e-09 +GMRES Iterations = 15 +Final GMRES Relative Residual Norm = 3.887000e-09 # Output file: amgdd.out.915 GMRES Iterations = 5 -Final GMRES Relative Residual Norm = 4.766657e-09 +Final GMRES Relative Residual Norm = 5.001224e-09 # Output file: amgdd.out.916 GMRES Iterations = 13 -Final GMRES Relative Residual Norm = 1.700551e-03 +Final GMRES Relative Residual Norm = 1.087777e-03 # Output file: amgdd.out.917 GMRES Iterations = 7 -Final GMRES Relative Residual Norm = 4.118020e-09 +Final GMRES Relative Residual Norm = 4.055942e-09 # Output file: amgdd.out.918 GMRES Iterations = 7 -Final GMRES Relative Residual Norm = 1.980700e-09 +Final GMRES Relative Residual Norm = 2.041613e-09 diff --git a/external/hypre/src/test/TEST_ij/amgdd.saved.lassen_cpu b/external/hypre/src/test/TEST_ij/amgdd.saved.lassen_cpu new file mode 100644 index 00000000..5b964144 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/amgdd.saved.lassen_cpu @@ -0,0 +1,64 @@ +# Output file: amgdd.out.900 +BoomerAMG-DD Iterations = 5 +Final Relative Residual Norm = 3.991216e-09 + +# Output file: amgdd.out.901 +BoomerAMG-DD Iterations = 10 +Final Relative Residual Norm = 5.653340e-09 + +# Output file: amgdd.out.902 +BoomerAMG-DD Iterations = 10 +Final Relative Residual Norm = 9.214818e-09 + +# Output file: amgdd.out.903 +BoomerAMG-DD Iterations = 12 +Final Relative Residual Norm = 3.122094e-09 + +# Output file: amgdd.out.904 +BoomerAMG-DD Iterations = 12 +Final Relative Residual Norm = 3.342726e-09 + +# Output file: amgdd.out.905 +BoomerAMG-DD Iterations = 10 +Final Relative Residual Norm = 4.924406e-09 + +# Output file: amgdd.out.906 +BoomerAMG-DD Iterations = 10 +Final Relative Residual Norm = 4.724593e-09 + +# Output file: amgdd.out.910 +GMRES Iterations = 4 +Final GMRES Relative Residual Norm = 6.125599e-09 + +# Output file: amgdd.out.911 +GMRES Iterations = 7 +Final GMRES Relative Residual Norm = 1.821559e-09 + +# Output file: amgdd.out.912 +GMRES Iterations = 7 +Final GMRES Relative Residual Norm = 5.755980e-09 + +# Output file: amgdd.out.913 +GMRES Iterations = 6 +Final GMRES Relative Residual Norm = 2.248814e-09 + +# Output file: amgdd.out.914 +GMRES Iterations = 15 +Final GMRES Relative Residual Norm = 4.036024e-09 + +# Output file: amgdd.out.915 +GMRES Iterations = 5 +Final GMRES Relative Residual Norm = 5.121200e-09 + +# Output file: amgdd.out.916 +GMRES Iterations = 14 +Final GMRES Relative Residual Norm = 5.260812e-03 + +# Output file: amgdd.out.917 +GMRES Iterations = 7 +Final GMRES Relative Residual Norm = 3.281089e-09 + +# Output file: amgdd.out.918 +GMRES Iterations = 7 +Final GMRES Relative Residual Norm = 1.828708e-09 + diff --git a/external/hypre/src/test/TEST_ij/amgdd.saved.ray b/external/hypre/src/test/TEST_ij/amgdd.saved.ray deleted file mode 100644 index 4a6bc20e..00000000 --- a/external/hypre/src/test/TEST_ij/amgdd.saved.ray +++ /dev/null @@ -1,64 +0,0 @@ -# Output file: amgdd.out.900 -BoomerAMG-DD Iterations = 10 -Final Relative Residual Norm = 8.474980e-09 - -# Output file: amgdd.out.901 -BoomerAMG-DD Iterations = 11 -Final Relative Residual Norm = 3.978926e-09 - -# Output file: amgdd.out.902 -BoomerAMG-DD Iterations = 11 -Final Relative Residual Norm = 3.608239e-09 - -# Output file: amgdd.out.903 -BoomerAMG-DD Iterations = 25 -Final Relative Residual Norm = 6.743448e-09 - -# Output file: amgdd.out.904 -BoomerAMG-DD Iterations = 25 -Final Relative Residual Norm = 7.071246e-09 - -# Output file: amgdd.out.905 -BoomerAMG-DD Iterations = 11 -Final Relative Residual Norm = 2.865652e-09 - -# Output file: amgdd.out.906 -BoomerAMG-DD Iterations = 11 -Final Relative Residual Norm = 2.872730e-09 - -# Output file: amgdd.out.910 -GMRES Iterations = 7 -Final GMRES Relative Residual Norm = 2.627495e-09 - -# Output file: amgdd.out.911 -GMRES Iterations = 7 -Final GMRES Relative Residual Norm = 6.257514e-09 - -# Output file: amgdd.out.912 -GMRES Iterations = 7 -Final GMRES Relative Residual Norm = 6.425568e-09 - -# Output file: amgdd.out.913 -GMRES Iterations = 6 -Final GMRES Relative Residual Norm = 2.720128e-09 - -# Output file: amgdd.out.914 -GMRES Iterations = 14 -Final GMRES Relative Residual Norm = 6.291930e-09 - -# Output file: amgdd.out.915 -GMRES Iterations = 5 -Final GMRES Relative Residual Norm = 4.766657e-09 - -# Output file: amgdd.out.916 -GMRES Iterations = 13 -Final GMRES Relative Residual Norm = 1.700551e-03 - -# Output file: amgdd.out.917 -GMRES Iterations = 7 -Final GMRES Relative Residual Norm = 4.118020e-09 - -# Output file: amgdd.out.918 -GMRES Iterations = 7 -Final GMRES Relative Residual Norm = 1.980700e-09 - diff --git a/external/hypre/src/test/TEST_ij/amgdd.sh b/external/hypre/src/test/TEST_ij/amgdd.sh old mode 100644 new mode 100755 index 261f5d33..4854a4f2 --- a/external/hypre/src/test/TEST_ij/amgdd.sh +++ b/external/hypre/src/test/TEST_ij/amgdd.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_ij/assembly.jobs b/external/hypre/src/test/TEST_ij/assembly.jobs new file mode 100755 index 00000000..851fe71d --- /dev/null +++ b/external/hypre/src/test/TEST_ij/assembly.jobs @@ -0,0 +1,20 @@ +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +#============================================================================= +# ij_assembly: Run default case +#============================================================================= + +mpirun -np 1 ./ij_assembly > assembly.out.0 + +mpirun -np 2 ./ij_assembly > assembly.out.1 + +mpirun -np 3 ./ij_assembly > assembly.out.2 + +mpirun -np 7 ./ij_assembly > assembly.out.3 + +mpirun -np 7 ./ij_assembly -early 1 > assembly.out.4 + diff --git a/external/hypre/src/test/TEST_ij/assembly.sh b/external/hypre/src/test/TEST_ij/assembly.sh new file mode 100755 index 00000000..ceb39a54 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/assembly.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +TNAME=`basename $0 .sh` +RTOL=$1 +ATOL=$2 + +#============================================================================= +# compare with baseline case +#============================================================================= + +FILES="\ + ${TNAME}.out.0\ + ${TNAME}.out.1\ + ${TNAME}.out.2\ + ${TNAME}.out.3\ + ${TNAME}.out.4\ +" + +for i in $FILES +do + echo "# Output file: $i" + tail -1 $i +done > ${TNAME}.out + +# Make sure that the output file is reasonable +RUNCOUNT=`echo $FILES | wc -w` +OUTCOUNT=`grep "error code" ${TNAME}.out | wc -l` +if [ "$OUTCOUNT" != "$RUNCOUNT" ]; then + echo "Incorrect number of runs in ${TNAME}.out" >&2 +fi + +# Make sure that the output file has no errors +for i in $FILES +do + echo "# Output file: $i" + echo "Test error code = 0" +done > ${TNAME}.testdata + +diff ${TNAME}.testdata ${TNAME}.out >&2 + +#============================================================================= +# remove temporary files +#============================================================================= + +rm -f ${TNAME}.testdata diff --git a/external/hypre/src/test/TEST_ij/coarsening.jobs b/external/hypre/src/test/TEST_ij/coarsening.jobs old mode 100644 new mode 100755 index 5efb00c7..aca335af --- a/external/hypre/src/test/TEST_ij/coarsening.jobs +++ b/external/hypre/src/test/TEST_ij/coarsening.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_ij/coarsening.saved.ray b/external/hypre/src/test/TEST_ij/coarsening.saved.aurora similarity index 61% rename from external/hypre/src/test/TEST_ij/coarsening.saved.ray rename to external/hypre/src/test/TEST_ij/coarsening.saved.aurora index 80ea51ea..43c084e2 100644 --- a/external/hypre/src/test/TEST_ij/coarsening.saved.ray +++ b/external/hypre/src/test/TEST_ij/coarsening.saved.aurora @@ -20,45 +20,45 @@ cycle = 2.756625 # Output file: coarsening.out.3 - Average Convergence Factor = 0.347587 + Average Convergence Factor = 0.347564 - Complexity: grid = 1.204889 - operator = 1.315634 - cycle = 2.631094 + Complexity: grid = 1.202667 + operator = 1.314765 + cycle = 2.628293 # Output file: coarsening.out.4 - Average Convergence Factor = 0.427978 + Average Convergence Factor = 0.438291 - Complexity: grid = 1.100889 - operator = 1.158136 - cycle = 2.315962 + Complexity: grid = 1.107556 + operator = 1.162559 + cycle = 2.323882 # Output file: coarsening.out.5 - Average Convergence Factor = 0.427978 + Average Convergence Factor = 0.438291 - Complexity: grid = 1.100889 - operator = 1.158136 - cycle = 2.315962 + Complexity: grid = 1.107556 + operator = 1.162559 + cycle = 2.323882 # Output file: coarsening.out.6 Iterations = 12 -Final Relative Residual Norm = 3.729996e-09 +Final Relative Residual Norm = 4.310193e-09 # Output file: coarsening.out.7 Iterations = 13 -Final Relative Residual Norm = 2.767220e-09 +Final Relative Residual Norm = 3.231950e-09 # Output file: coarsening.out.8 BoomerAMG Iterations = 21 -Final Relative Residual Norm = 5.888646e-09 +Final Relative Residual Norm = 5.651891e-09 # Output file: coarsening.out.9 BoomerAMG Iterations = 26 -Final Relative Residual Norm = 9.316749e-09 +Final Relative Residual Norm = 9.810361e-09 # Output file: coarsening.out.11 -BoomerAMG Iterations = 21 -Final Relative Residual Norm = 5.008125e-09 +BoomerAMG Iterations = 20 +Final Relative Residual Norm = 9.665671e-09 # Output file: coarsening.out.12 BoomerAMG Iterations = 15 @@ -66,7 +66,7 @@ Final Relative Residual Norm = 3.865632e-09 # Output file: coarsening.out.13 BoomerAMG Iterations = 24 -Final Relative Residual Norm = 9.878259e-09 +Final Relative Residual Norm = 8.745416e-09 # Output file: coarsening.out.14 BoomerAMG Iterations = 10 diff --git a/external/hypre/src/test/TEST_ij/coarsening.saved.lassen b/external/hypre/src/test/TEST_ij/coarsening.saved.lassen index 80ea51ea..e4e1f69a 100644 --- a/external/hypre/src/test/TEST_ij/coarsening.saved.lassen +++ b/external/hypre/src/test/TEST_ij/coarsening.saved.lassen @@ -20,25 +20,25 @@ cycle = 2.756625 # Output file: coarsening.out.3 - Average Convergence Factor = 0.347587 + Average Convergence Factor = 0.347564 - Complexity: grid = 1.204889 - operator = 1.315634 - cycle = 2.631094 + Complexity: grid = 1.202667 + operator = 1.314765 + cycle = 2.628293 # Output file: coarsening.out.4 - Average Convergence Factor = 0.427978 + Average Convergence Factor = 0.427073 - Complexity: grid = 1.100889 - operator = 1.158136 - cycle = 2.315962 + Complexity: grid = 1.102222 + operator = 1.158928 + cycle = 2.317160 # Output file: coarsening.out.5 - Average Convergence Factor = 0.427978 + Average Convergence Factor = 0.427073 - Complexity: grid = 1.100889 - operator = 1.158136 - cycle = 2.315962 + Complexity: grid = 1.102222 + operator = 1.158928 + cycle = 2.317160 # Output file: coarsening.out.6 Iterations = 12 @@ -50,15 +50,15 @@ Final Relative Residual Norm = 2.767220e-09 # Output file: coarsening.out.8 BoomerAMG Iterations = 21 -Final Relative Residual Norm = 5.888646e-09 +Final Relative Residual Norm = 5.651891e-09 # Output file: coarsening.out.9 BoomerAMG Iterations = 26 -Final Relative Residual Norm = 9.316749e-09 +Final Relative Residual Norm = 9.673887e-09 # Output file: coarsening.out.11 -BoomerAMG Iterations = 21 -Final Relative Residual Norm = 5.008125e-09 +BoomerAMG Iterations = 20 +Final Relative Residual Norm = 9.665671e-09 # Output file: coarsening.out.12 BoomerAMG Iterations = 15 @@ -66,7 +66,7 @@ Final Relative Residual Norm = 3.865632e-09 # Output file: coarsening.out.13 BoomerAMG Iterations = 24 -Final Relative Residual Norm = 9.878259e-09 +Final Relative Residual Norm = 9.339080e-09 # Output file: coarsening.out.14 BoomerAMG Iterations = 10 diff --git a/external/hypre/src/test/TEST_ij/coarsening.saved.lassen_cpu b/external/hypre/src/test/TEST_ij/coarsening.saved.lassen_cpu new file mode 100644 index 00000000..5a3e1c7b --- /dev/null +++ b/external/hypre/src/test/TEST_ij/coarsening.saved.lassen_cpu @@ -0,0 +1,74 @@ +# Output file: coarsening.out.0 + Average Convergence Factor = 0.094028 + + Complexity: grid = 1.220000 + operator = 1.408310 + cycle = 2.816445 + +# Output file: coarsening.out.1 + Average Convergence Factor = 0.124105 + + Complexity: grid = 1.190222 + operator = 1.269219 + cycle = 2.538129 + +# Output file: coarsening.out.2 + Average Convergence Factor = 0.121893 + + Complexity: grid = 1.236444 + operator = 1.378931 + cycle = 2.756625 + +# Output file: coarsening.out.3 + Average Convergence Factor = 0.114604 + + Complexity: grid = 1.204889 + operator = 1.315634 + cycle = 2.631094 + +# Output file: coarsening.out.4 + Average Convergence Factor = 0.126924 + + Complexity: grid = 1.104889 + operator = 1.161632 + cycle = 2.322568 + +# Output file: coarsening.out.5 + Average Convergence Factor = 0.115880 + + Complexity: grid = 1.130222 + operator = 1.225044 + cycle = 2.449915 + +# Output file: coarsening.out.6 +Iterations = 12 +Final Relative Residual Norm = 3.821883e-09 + +# Output file: coarsening.out.7 +Iterations = 11 +Final Relative Residual Norm = 7.519111e-09 + +# Output file: coarsening.out.8 +BoomerAMG Iterations = 13 +Final Relative Residual Norm = 3.043813e-09 + +# Output file: coarsening.out.9 +BoomerAMG Iterations = 15 +Final Relative Residual Norm = 3.616706e-09 + +# Output file: coarsening.out.11 +BoomerAMG Iterations = 13 +Final Relative Residual Norm = 5.238459e-09 + +# Output file: coarsening.out.12 +BoomerAMG Iterations = 13 +Final Relative Residual Norm = 2.784140e-09 + +# Output file: coarsening.out.13 +BoomerAMG Iterations = 14 +Final Relative Residual Norm = 3.301634e-09 + +# Output file: coarsening.out.14 +BoomerAMG Iterations = 10 +Final Relative Residual Norm = 7.834527e-09 + diff --git a/external/hypre/src/test/TEST_ij/coarsening.sh b/external/hypre/src/test/TEST_ij/coarsening.sh old mode 100644 new mode 100755 index aa4235af..03a2380e --- a/external/hypre/src/test/TEST_ij/coarsening.sh +++ b/external/hypre/src/test/TEST_ij/coarsening.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_ij/data/beam_hex_dof459_np2/A.IJ.00000 b/external/hypre/src/test/TEST_ij/data/beam_hex_dof459_np2/A.IJ.00000 new file mode 100644 index 00000000..e6267520 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/data/beam_hex_dof459_np2/A.IJ.00000 @@ -0,0 +1,11467 @@ +0 242 0 242 +0 0 1.00000000000000e+00 +0 233 0.00000000000000e+00 +0 173 0.00000000000000e+00 +0 86 0.00000000000000e+00 +0 71 0.00000000000000e+00 +0 170 0.00000000000000e+00 +0 62 0.00000000000000e+00 +0 2 0.00000000000000e+00 +0 181 0.00000000000000e+00 +0 232 0.00000000000000e+00 +0 172 0.00000000000000e+00 +0 85 0.00000000000000e+00 +0 70 0.00000000000000e+00 +0 169 0.00000000000000e+00 +0 61 0.00000000000000e+00 +0 1 0.00000000000000e+00 +0 180 0.00000000000000e+00 +0 231 0.00000000000000e+00 +0 171 0.00000000000000e+00 +0 84 0.00000000000000e+00 +0 69 0.00000000000000e+00 +0 168 0.00000000000000e+00 +0 60 0.00000000000000e+00 +0 182 0.00000000000000e+00 +1 1 1.00000000000000e+00 +1 233 0.00000000000000e+00 +1 173 0.00000000000000e+00 +1 86 0.00000000000000e+00 +1 71 0.00000000000000e+00 +1 170 0.00000000000000e+00 +1 62 0.00000000000000e+00 +1 2 0.00000000000000e+00 +1 181 0.00000000000000e+00 +1 232 0.00000000000000e+00 +1 172 0.00000000000000e+00 +1 85 0.00000000000000e+00 +1 70 0.00000000000000e+00 +1 169 0.00000000000000e+00 +1 61 0.00000000000000e+00 +1 182 0.00000000000000e+00 +1 180 0.00000000000000e+00 +1 231 0.00000000000000e+00 +1 171 0.00000000000000e+00 +1 84 0.00000000000000e+00 +1 69 0.00000000000000e+00 +1 168 0.00000000000000e+00 +1 60 0.00000000000000e+00 +1 0 0.00000000000000e+00 +2 2 1.00000000000000e+00 +2 233 0.00000000000000e+00 +2 173 0.00000000000000e+00 +2 86 0.00000000000000e+00 +2 71 0.00000000000000e+00 +2 170 0.00000000000000e+00 +2 62 0.00000000000000e+00 +2 182 0.00000000000000e+00 +2 181 0.00000000000000e+00 +2 232 0.00000000000000e+00 +2 172 0.00000000000000e+00 +2 85 0.00000000000000e+00 +2 70 0.00000000000000e+00 +2 169 0.00000000000000e+00 +2 61 0.00000000000000e+00 +2 1 0.00000000000000e+00 +2 180 0.00000000000000e+00 +2 231 0.00000000000000e+00 +2 171 0.00000000000000e+00 +2 84 0.00000000000000e+00 +2 69 0.00000000000000e+00 +2 168 0.00000000000000e+00 +2 60 0.00000000000000e+00 +2 0 0.00000000000000e+00 +3 3 2.77777777777778e+01 +3 191 -4.16666666666667e+00 +3 188 -2.54787510534094e-17 +3 98 1.84178844050975e-16 +3 235 -2.08333333333333e+00 +3 190 3.30681662608079e-17 +3 187 -4.16666666666667e+00 +3 97 2.14699135206442e-16 +3 234 -3.47222222222222e+00 +3 189 -4.86111111111111e+00 +3 186 -4.86111111111111e+00 +3 96 -5.55555555555555e+00 +3 233 2.08333333333333e+00 +3 176 1.92554305833426e-16 +3 89 -1.50812522192734e-16 +3 173 4.16666666666667e+00 +3 170 -9.45424294407360e-17 +3 65 8.88178419700125e-16 +3 5 8.88178419700125e-16 +3 62 -9.36750677027476e-17 +3 232 2.08333333333333e+00 +3 175 6.15826833971767e-17 +3 88 -4.44089209850063e-16 +3 172 1.30104260698261e-17 +3 169 4.16666666666666e+00 +3 64 -9.25908655302621e-17 +3 4 -8.88178419700125e-16 +3 61 -1.96891114523368e-16 +3 231 -3.47222222222222e+00 +3 174 -1.38888888888889e+00 +3 87 5.55555555555556e+00 +3 171 -4.86111111111112e+00 +3 168 -4.86111111111111e+00 +3 63 5.55555555555556e+00 +3 236 -2.08333333333333e+00 +3 60 -5.55555555555555e+00 +4 4 2.77777777777778e+01 +4 191 3.13984949151802e-16 +4 188 6.94973592563208e-17 +4 98 2.08333333333333e+00 +4 235 -3.47222222222222e+00 +4 190 -6.94444444444444e-01 +4 187 -4.86111111111111e+00 +4 97 2.77777777777778e+00 +4 234 -2.08333333333333e+00 +4 189 5.55111512312578e-17 +4 186 -4.16666666666667e+00 +4 96 2.53161207275365e-16 +4 233 -2.08333333333333e+00 +4 176 -8.33333333333333e+00 +4 89 2.18141477104083e-16 +4 173 1.50920942409982e-16 +4 170 1.95590071916385e-16 +4 65 -2.29891518148395e-16 +4 5 8.33333333333333e+00 +4 62 2.08333333333333e+00 +4 232 -3.47222222222222e+00 +4 175 -9.72222222222223e+00 +4 88 5.55555555555556e+00 +4 172 -6.94444444444445e-01 +4 169 -4.86111111111111e+00 +4 64 -1.11111111111111e+01 +4 236 -2.08333333333333e+00 +4 61 2.77777777777778e+00 +4 231 2.08333333333333e+00 +4 174 6.88468379528295e-17 +4 87 -4.44089209850063e-16 +4 171 -3.39355279987963e-17 +4 168 4.16666666666666e+00 +4 63 1.95562966862073e-17 +4 3 0.00000000000000e+00 +4 60 -2.07299455379228e-16 +5 5 2.77777777777778e+01 +5 191 -4.86111111111111e+00 +5 188 -6.94444444444443e-01 +5 98 2.77777777777778e+00 +5 235 -2.08333333333333e+00 +5 190 2.53486467927111e-16 +5 187 1.63931368479808e-16 +5 97 2.08333333333333e+00 +5 234 -2.08333333333333e+00 +5 189 -4.16666666666667e+00 +5 186 1.41379963292110e-16 +5 96 1.55908272403416e-16 +5 233 -3.47222222222222e+00 +5 176 -9.72222222222222e+00 +5 89 -1.11111111111111e+01 +5 173 -4.86111111111111e+00 +5 170 -6.94444444444443e-01 +5 65 5.55555555555556e+00 +5 236 -3.47222222222222e+00 +5 62 2.77777777777778e+00 +5 232 -2.08333333333333e+00 +5 175 -8.33333333333333e+00 +5 88 3.33798743853975e-17 +5 172 7.44846892497542e-17 +5 169 1.56992474575901e-16 +5 64 -1.81061762805079e-17 +5 4 8.33333333333333e+00 +5 61 2.08333333333333e+00 +5 231 2.08333333333333e+00 +5 174 1.72713406076941e-16 +5 87 -5.13884724703817e-16 +5 171 4.16666666666666e+00 +5 168 4.11996825544492e-18 +5 63 8.88178419700125e-16 +5 3 8.88178419700125e-16 +5 60 -9.87979229677416e-18 +6 6 2.77777777777778e+01 +6 206 -4.16666666666667e+00 +6 203 -2.24321429487251e-16 +6 122 2.15281893874153e-16 +6 238 -2.08333333333333e+00 +6 205 -9.26992857475106e-17 +6 202 -4.16666666666667e+00 +6 121 -9.34311222139383e-17 +6 237 -3.47222222222222e+00 +6 204 -4.86111111111112e+00 +6 201 -4.86111111111111e+00 +6 120 -5.55555555555556e+00 +6 236 2.08333333333333e+00 +6 194 5.13478148889135e-16 +6 116 3.82940207321880e-16 +6 191 4.16666666666667e+00 +6 188 -1.08420217248550e-16 +6 101 8.88178419700125e-16 +6 8 3.55271367880050e-15 +6 98 -9.74914593498966e-16 +6 235 2.08333333333333e+00 +6 193 2.26381413614973e-16 +6 115 0.00000000000000e+00 +6 190 -2.16840434497101e-17 +6 187 4.16666666666667e+00 +6 100 2.93276687657329e-16 +6 7 -8.88178419700125e-16 +6 97 -1.98625837999344e-16 +6 234 -3.47222222222222e+00 +6 192 -1.38888888888889e+00 +6 114 5.55555555555556e+00 +6 189 -4.86111111111111e+00 +6 186 -4.86111111111111e+00 +6 99 5.55555555555556e+00 +6 239 -2.08333333333333e+00 +6 96 -5.55555555555555e+00 +7 7 2.77777777777778e+01 +7 206 -3.64291929955129e-16 +7 203 -3.84891771232354e-17 +7 122 2.08333333333333e+00 +7 238 -3.47222222222222e+00 +7 205 -6.94444444444445e-01 +7 202 -4.86111111111111e+00 +7 121 2.77777777777778e+00 +7 237 -2.08333333333333e+00 +7 204 -6.93889390390723e-18 +7 201 -4.16666666666667e+00 +7 120 1.94397449526651e-16 +7 236 -2.08333333333333e+00 +7 194 -8.33333333333333e+00 +7 116 8.32016747165376e-16 +7 191 2.64545330086463e-16 +7 188 4.56882795485392e-16 +7 101 6.76054264653336e-16 +7 8 8.33333333333333e+00 +7 98 2.08333333333333e+00 +7 235 -3.47222222222222e+00 +7 193 -9.72222222222223e+00 +7 115 5.55555555555556e+00 +7 190 -6.94444444444444e-01 +7 187 -4.86111111111111e+00 +7 100 -1.11111111111111e+01 +7 239 -2.08333333333333e+00 +7 97 2.77777777777778e+00 +7 234 2.08333333333333e+00 +7 192 1.42897846333589e-16 +7 114 0.00000000000000e+00 +7 189 -4.84638371101020e-17 +7 186 4.16666666666666e+00 +7 99 2.90755917606300e-16 +7 6 -8.88178419700125e-16 +7 96 -1.21511958481313e-16 +8 8 2.77777777777778e+01 +8 206 -4.86111111111111e+00 +8 203 -6.94444444444444e-01 +8 122 2.77777777777777e+00 +8 238 -2.08333333333333e+00 +8 205 -3.07262895682392e-16 +8 202 -1.05818132034585e-16 +8 121 2.08333333333333e+00 +8 237 -2.08333333333333e+00 +8 204 -4.16666666666667e+00 +8 201 -1.30104260698261e-16 +8 120 2.67147415300428e-16 +8 236 -3.47222222222222e+00 +8 194 -9.72222222222222e+00 +8 116 -1.11111111111111e+01 +8 191 -4.86111111111111e+00 +8 188 -6.94444444444444e-01 +8 101 5.55555555555556e+00 +8 239 -3.47222222222222e+00 +8 98 2.77777777777778e+00 +8 235 -2.08333333333333e+00 +8 193 -8.33333333333333e+00 +8 115 4.13053922662665e-16 +8 190 1.96782694306119e-16 +8 187 4.90059381963448e-16 +8 100 1.03259414907519e-15 +8 7 8.33333333333333e+00 +8 97 2.08333333333333e+00 +8 234 2.08333333333333e+00 +8 192 2.63786388565723e-16 +8 114 2.64260727016186e-16 +8 189 4.16666666666666e+00 +8 186 -1.64690310000548e-16 +8 99 8.88178419700125e-16 +8 6 3.55271367880050e-15 +8 96 -1.13957779844520e-15 +9 9 2.77777777777778e+01 +9 221 -4.16666666666667e+00 +9 218 1.61220863048595e-16 +9 146 -8.16729496533330e-16 +9 241 -2.08333333333333e+00 +9 220 -9.44340092234874e-17 +9 217 -4.16666666666667e+00 +9 145 -4.88297553433159e-16 +9 240 -3.47222222222222e+00 +9 219 -4.86111111111111e+00 +9 216 -4.86111111111111e+00 +9 144 -5.55555555555555e+00 +9 239 2.08333333333333e+00 +9 209 -7.80625564189563e-18 +9 140 9.38810661155198e-16 +9 206 4.16666666666667e+00 +9 203 -1.11022302462516e-16 +9 125 4.44089209850063e-16 +9 11 2.66453525910038e-15 +9 122 -1.14817010066215e-15 +9 238 2.08333333333333e+00 +9 208 -1.12757025938492e-17 +9 139 -8.88178419700125e-16 +9 205 2.25514051876985e-16 +9 202 4.16666666666667e+00 +9 124 -8.78203759713259e-18 +9 10 0.00000000000000e+00 +9 121 9.24824453130135e-16 +9 237 -3.47222222222222e+00 +9 207 -1.38888888888889e+00 +9 138 5.55555555555555e+00 +9 204 -4.86111111111111e+00 +9 201 -4.86111111111111e+00 +9 123 5.55555555555556e+00 +9 242 -2.08333333333333e+00 +9 120 -5.55555555555554e+00 +10 10 2.77777777777778e+01 +10 221 -2.60208521396521e-16 +10 218 -5.33427468862868e-16 +10 146 2.08333333333333e+00 +10 241 -3.47222222222222e+00 +10 220 -6.94444444444445e-01 +10 217 -4.86111111111111e+00 +10 145 2.77777777777778e+00 +10 240 -2.08333333333333e+00 +10 219 -2.86229373536173e-17 +10 216 -4.16666666666667e+00 +10 144 -4.28043017697277e-16 +10 239 -2.08333333333333e+00 +10 209 -8.33333333333334e+00 +10 140 -5.41016884070267e-16 +10 206 -4.11129463806503e-16 +10 203 -5.38848479725296e-17 +10 125 4.19355847790237e-16 +10 11 8.33333333333333e+00 +10 122 2.08333333333333e+00 +10 238 -3.47222222222222e+00 +10 208 -9.72222222222223e+00 +10 139 5.55555555555556e+00 +10 205 -6.94444444444444e-01 +10 202 -4.86111111111111e+00 +10 124 -1.11111111111111e+01 +10 242 -2.08333333333333e+00 +10 121 2.77777777777778e+00 +10 237 2.08333333333333e+00 +10 207 4.15249432061948e-17 +10 138 -8.88178419700125e-16 +10 204 2.67147415300428e-16 +10 201 4.16666666666666e+00 +10 123 -1.59513244626930e-17 +10 9 -8.88178419700125e-16 +10 120 9.10092856111488e-16 +11 11 2.77777777777778e+01 +11 221 -4.86111111111111e+00 +11 218 -6.94444444444444e-01 +11 146 2.77777777777778e+00 +11 241 -2.08333333333333e+00 +11 220 -3.72965547335014e-16 +11 217 -5.52509427098613e-16 +11 145 2.08333333333333e+00 +11 240 -2.08333333333333e+00 +11 219 -4.16666666666667e+00 +11 216 1.00613961606655e-16 +11 144 -9.26559176606112e-16 +11 239 -3.47222222222222e+00 +11 209 -9.72222222222222e+00 +11 140 -1.11111111111111e+01 +11 206 -4.86111111111111e+00 +11 203 -6.94444444444443e-01 +11 125 5.55555555555556e+00 +11 242 -3.47222222222222e+00 +11 122 2.77777777777778e+00 +11 238 -2.08333333333333e+00 +11 208 -8.33333333333334e+00 +11 139 -6.01339182441929e-16 +11 205 -2.68990558993654e-16 +11 202 -6.41847686111419e-17 +11 124 6.67001176513082e-16 +11 10 8.33333333333333e+00 +11 121 2.08333333333333e+00 +11 237 2.08333333333333e+00 +11 207 7.32920668600201e-17 +11 138 7.98121876748048e-16 +11 204 4.16666666666666e+00 +11 201 -1.55257751099924e-16 +11 123 4.44089209850063e-16 +11 9 2.66453525910038e-15 +11 120 -1.33897613049244e-15 +12 12 1.41666666666667e+01 +12 164 -8.04701628682319e-16 +12 149 -2.04166666666667e+00 +12 14 -4.08333333333333e+00 +12 223 -2.15620707053055e-17 +12 163 -2.04166666666667e+00 +12 148 5.77337656848531e-17 +12 13 -4.08333333333333e+00 +12 222 -7.08333333333333e-01 +12 162 2.83333333333334e+00 +12 147 2.83333333333334e+00 +12 224 8.09085871217308e-18 +12 221 4.16666666666667e+00 +12 218 1.27502175484295e-16 +12 146 6.97358837342676e-16 +12 241 2.08333333333333e+00 +12 220 1.30104260698261e-17 +12 217 4.16666666666667e+00 +12 145 -8.67361737988404e-17 +12 240 -3.47222222222222e+00 +12 219 -4.86111111111112e+00 +12 216 -4.86111111111111e+00 +12 242 2.08333333333333e+00 +12 144 -5.55555555555556e+00 +12 449 -4.16666666666667e-02 +12 392 -8.33333333333333e-02 +12 389 -1.39082809939156e-18 +12 293 2.28836538612590e-17 +12 448 -4.16666666666667e-02 +12 391 9.09713385351119e-19 +12 388 -8.33333333333334e-02 +12 292 1.43783842796417e-19 +12 447 -6.94444444444445e-02 +12 390 -9.72222222222222e-02 +12 387 -9.72222222222222e-02 +12 291 -1.11111111111111e-01 +13 13 1.41666666666667e+01 +13 164 2.26630441301466e-16 +13 149 4.76153218551901e-17 +13 14 4.25000000000000e+00 +13 223 -4.95833333333333e+00 +13 163 2.83333333333333e+00 +13 148 -5.66666666666666e+00 +13 224 -4.25000000000000e+00 +13 222 -1.59089728153303e-17 +13 162 -2.04166666666667e+00 +13 147 1.73936098136302e-16 +13 12 -4.08333333333333e+00 +13 221 1.54390389361936e-16 +13 218 -8.82540568403201e-17 +13 146 2.08333333333333e+00 +13 241 -3.47222222222222e+00 +13 220 -6.94444444444446e-01 +13 217 -4.86111111111111e+00 +13 242 -2.08333333333333e+00 +13 145 2.77777777777778e+00 +13 240 2.08333333333333e+00 +13 219 3.96817995129695e-17 +13 216 4.16666666666666e+00 +13 144 -1.59066011230780e-16 +13 449 -4.16666666666667e-02 +13 392 -7.99599102208060e-18 +13 389 7.74357520379881e-18 +13 293 4.16666666666666e-02 +13 448 -6.94444444444444e-02 +13 391 -1.38888888888889e-02 +13 388 -9.72222222222222e-02 +13 292 5.55555555555555e-02 +13 447 -4.16666666666667e-02 +13 390 7.45388993583784e-19 +13 387 -8.33333333333334e-02 +13 291 4.33680868994202e-19 +14 14 1.41666666666667e+01 +14 164 -5.66666666666666e+00 +14 149 2.83333333333333e+00 +14 224 -4.95833333333333e+00 +14 223 -4.25000000000000e+00 +14 163 -6.77708943515798e-17 +14 148 -9.84404750640003e-17 +14 13 4.25000000000000e+00 +14 222 -1.57463424894574e-17 +14 162 -3.83377276322663e-16 +14 147 -2.04166666666667e+00 +14 12 -4.08333333333333e+00 +14 221 -4.86111111111111e+00 +14 218 -6.94444444444444e-01 +14 242 -3.47222222222222e+00 +14 146 2.77777777777778e+00 +14 241 -2.08333333333333e+00 +14 220 3.31765864780564e-17 +14 217 -2.25514051876985e-17 +14 145 2.08333333333333e+00 +14 240 2.08333333333333e+00 +14 219 4.16666666666667e+00 +14 216 1.71520783687207e-16 +14 144 6.84876959831937e-16 +14 449 -6.94444444444444e-02 +14 392 -9.72222222222222e-02 +14 389 -1.38888888888889e-02 +14 293 5.55555555555555e-02 +14 448 -4.16666666666667e-02 +14 391 -7.70630575411962e-18 +14 388 6.65429083362978e-18 +14 292 4.16666666666666e-02 +14 447 -4.16666666666667e-02 +14 390 -8.33333333333333e-02 +14 387 -2.84603070277445e-19 +14 291 2.64477567450683e-17 +15 15 1.00000000000000e+00 +15 179 0.00000000000000e+00 +15 233 0.00000000000000e+00 +15 182 0.00000000000000e+00 +15 17 0.00000000000000e+00 +15 68 0.00000000000000e+00 +15 170 0.00000000000000e+00 +15 71 0.00000000000000e+00 +15 94 0.00000000000000e+00 +15 178 0.00000000000000e+00 +15 232 0.00000000000000e+00 +15 181 0.00000000000000e+00 +15 16 0.00000000000000e+00 +15 67 0.00000000000000e+00 +15 169 0.00000000000000e+00 +15 70 0.00000000000000e+00 +15 93 0.00000000000000e+00 +15 177 0.00000000000000e+00 +15 231 0.00000000000000e+00 +15 180 0.00000000000000e+00 +15 95 0.00000000000000e+00 +15 66 0.00000000000000e+00 +15 168 0.00000000000000e+00 +15 69 0.00000000000000e+00 +16 16 1.00000000000000e+00 +16 179 0.00000000000000e+00 +16 233 0.00000000000000e+00 +16 182 0.00000000000000e+00 +16 17 0.00000000000000e+00 +16 68 0.00000000000000e+00 +16 170 0.00000000000000e+00 +16 71 0.00000000000000e+00 +16 94 0.00000000000000e+00 +16 178 0.00000000000000e+00 +16 232 0.00000000000000e+00 +16 181 0.00000000000000e+00 +16 95 0.00000000000000e+00 +16 67 0.00000000000000e+00 +16 169 0.00000000000000e+00 +16 70 0.00000000000000e+00 +16 93 0.00000000000000e+00 +16 177 0.00000000000000e+00 +16 231 0.00000000000000e+00 +16 180 0.00000000000000e+00 +16 15 0.00000000000000e+00 +16 66 0.00000000000000e+00 +16 168 0.00000000000000e+00 +16 69 0.00000000000000e+00 +17 17 1.00000000000000e+00 +17 179 0.00000000000000e+00 +17 233 0.00000000000000e+00 +17 182 0.00000000000000e+00 +17 95 0.00000000000000e+00 +17 68 0.00000000000000e+00 +17 170 0.00000000000000e+00 +17 71 0.00000000000000e+00 +17 94 0.00000000000000e+00 +17 178 0.00000000000000e+00 +17 232 0.00000000000000e+00 +17 181 0.00000000000000e+00 +17 16 0.00000000000000e+00 +17 67 0.00000000000000e+00 +17 169 0.00000000000000e+00 +17 70 0.00000000000000e+00 +17 93 0.00000000000000e+00 +17 177 0.00000000000000e+00 +17 231 0.00000000000000e+00 +17 180 0.00000000000000e+00 +17 15 0.00000000000000e+00 +17 66 0.00000000000000e+00 +17 168 0.00000000000000e+00 +17 69 0.00000000000000e+00 +18 18 2.77777777777778e+01 +18 236 -2.08333333333333e+00 +18 104 -9.62771529167128e-17 +18 188 -7.92551788086904e-17 +18 196 6.50521303491303e-17 +18 235 2.08333333333333e+00 +18 103 6.84131570838353e-17 +18 187 4.16666666666666e+00 +18 195 -4.86111111111111e+00 +18 234 -3.47222222222222e+00 +18 102 -5.55555555555555e+00 +18 186 -4.86111111111111e+00 +18 179 4.16666666666667e+00 +18 92 1.24900090270330e-16 +18 176 7.37257477290143e-17 +18 233 2.08333333333333e+00 +18 68 -2.15105711021124e-16 +18 20 0.00000000000000e+00 +18 65 8.88178419700125e-16 +18 170 1.48318857196017e-16 +18 178 -9.71445146547012e-17 +18 91 8.88178419700125e-16 +18 175 2.09251019289702e-17 +18 232 -2.08333333333333e+00 +18 67 -1.70870262383715e-16 +18 19 0.00000000000000e+00 +18 64 -3.43285512863223e-17 +18 169 -4.16666666666667e+00 +18 177 -4.86111111111111e+00 +18 90 5.55555555555556e+00 +18 174 -1.38888888888889e+00 +18 231 -3.47222222222222e+00 +18 66 -5.55555555555555e+00 +18 197 -4.16666666666667e+00 +18 63 5.55555555555556e+00 +18 168 -4.86111111111111e+00 +19 19 2.77777777777778e+01 +19 236 2.08333333333333e+00 +19 104 -2.08333333333333e+00 +19 188 2.18575157973078e-16 +19 196 -6.94444444444445e-01 +19 235 -3.47222222222222e+00 +19 103 2.77777777777778e+00 +19 187 -4.86111111111111e+00 +19 195 -4.85722573273506e-17 +19 234 2.08333333333333e+00 +19 102 -5.37764277552810e-17 +19 186 4.16666666666667e+00 +19 179 1.17961196366423e-16 +19 92 -2.41993924898765e-16 +19 176 8.33333333333333e+00 +19 233 2.08333333333333e+00 +19 68 -2.08333333333333e+00 +19 20 -8.33333333333333e+00 +19 65 2.59341159658533e-16 +19 170 1.20563281580388e-16 +19 178 -6.94444444444445e-01 +19 91 5.55555555555556e+00 +19 175 -9.72222222222223e+00 +19 232 -3.47222222222222e+00 +19 67 2.77777777777778e+00 +19 197 1.11022302462516e-16 +19 64 -1.11111111111111e+01 +19 169 -4.86111111111111e+00 +19 177 -8.32667268468867e-17 +19 90 8.88178419700125e-16 +19 174 6.85215773010839e-17 +19 231 -2.08333333333333e+00 +19 66 -2.15539391890118e-16 +19 18 -8.88178419700125e-16 +19 63 1.85398571495021e-17 +19 168 -4.16666666666667e+00 +20 20 2.77777777777778e+01 +20 236 -3.47222222222222e+00 +20 104 2.77777777777778e+00 +20 188 -6.94444444444444e-01 +20 196 -1.38777878078145e-17 +20 235 2.08333333333333e+00 +20 103 -2.08333333333333e+00 +20 187 2.07407875596477e-16 +20 195 -4.16666666666667e+00 +20 234 -2.08333333333333e+00 +20 102 -1.59594559789866e-16 +20 186 -9.28077059647592e-17 +20 179 -4.86111111111111e+00 +20 92 -1.11111111111111e+01 +20 176 -9.72222222222222e+00 +20 233 -3.47222222222222e+00 +20 68 2.77777777777778e+00 +20 197 -4.86111111111111e+00 +20 65 5.55555555555556e+00 +20 170 -6.94444444444444e-01 +20 178 2.14238349283136e-16 +20 91 -3.71881345162528e-17 +20 175 8.33333333333333e+00 +20 232 2.08333333333333e+00 +20 67 -2.08333333333333e+00 +20 19 -8.33333333333333e+00 +20 64 -7.84691322336384e-18 +20 169 1.02782365951626e-16 +20 177 4.16666666666667e+00 +20 90 9.54097911787244e-18 +20 174 2.70508442035133e-16 +20 231 2.08333333333333e+00 +20 66 -8.93382590128056e-17 +20 18 0.00000000000000e+00 +20 63 8.88178419700125e-16 +20 168 8.99887803162969e-17 +21 21 2.77777777777778e+01 +21 239 -2.08333333333333e+00 +21 128 -1.36089056690381e-15 +21 203 -2.96312453740288e-16 +21 211 -1.46584133720040e-16 +21 238 2.08333333333333e+00 +21 127 -1.56667213924155e-16 +21 202 4.16666666666666e+00 +21 210 -4.86111111111112e+00 +21 237 -3.47222222222222e+00 +21 126 -5.55555555555556e+00 +21 201 -4.86111111111111e+00 +21 197 4.16666666666667e+00 +21 119 9.08995101411847e-16 +21 194 4.57966997657877e-16 +21 236 2.08333333333333e+00 +21 104 -6.73072708679001e-16 +21 23 1.77635683940025e-15 +21 101 8.88178419700125e-16 +21 188 2.60208521396521e-18 +21 196 -2.77555756156289e-17 +21 118 8.88178419700125e-16 +21 193 1.30646361784503e-16 +21 235 -2.08333333333333e+00 +21 103 -3.39138439553466e-16 +21 22 -8.88178419700125e-16 +21 100 4.08825534189972e-16 +21 187 -4.16666666666667e+00 +21 195 -4.86111111111111e+00 +21 117 5.55555555555556e+00 +21 192 -1.38888888888889e+00 +21 234 -3.47222222222222e+00 +21 102 -5.55555555555555e+00 +21 212 -4.16666666666667e+00 +21 99 5.55555555555556e+00 +21 186 -4.86111111111111e+00 +22 22 2.77777777777778e+01 +22 239 2.08333333333333e+00 +22 128 -2.08333333333333e+00 +22 203 8.30065183254902e-16 +22 211 -6.94444444444446e-01 +22 238 -3.47222222222222e+00 +22 127 2.77777777777778e+00 +22 202 -4.86111111111111e+00 +22 210 -1.52655665885959e-16 +22 237 2.08333333333333e+00 +22 126 -2.78423117894278e-16 +22 201 4.16666666666667e+00 +22 197 2.98372437868011e-16 +22 119 -7.77156117237610e-16 +22 194 8.33333333333333e+00 +22 236 2.08333333333333e+00 +22 104 -2.08333333333333e+00 +22 23 -8.33333333333333e+00 +22 101 9.84021891747844e-16 +22 188 -5.01335084557297e-16 +22 196 -6.94444444444444e-01 +22 118 5.55555555555556e+00 +22 193 -9.72222222222223e+00 +22 235 -3.47222222222222e+00 +22 103 2.77777777777778e+00 +22 212 8.32667268468867e-17 +22 100 -1.11111111111111e+01 +22 187 -4.86111111111111e+00 +22 195 -5.81132364452230e-17 +22 117 8.88178419700125e-16 +22 192 1.16226472890446e-16 +22 234 -2.08333333333333e+00 +22 102 -3.02492406123456e-16 +22 21 -8.88178419700125e-16 +22 99 2.93276687657329e-16 +22 186 -4.16666666666667e+00 +23 23 2.77777777777778e+01 +23 239 -3.47222222222222e+00 +23 128 2.77777777777778e+00 +23 203 -6.94444444444444e-01 +23 211 8.50014503228635e-17 +23 238 2.08333333333333e+00 +23 127 -2.08333333333333e+00 +23 202 8.49255561707896e-16 +23 210 -4.16666666666667e+00 +23 237 -2.08333333333333e+00 +23 126 -1.40859546249317e-15 +23 201 -2.47198095326695e-16 +23 197 -4.86111111111111e+00 +23 119 -1.11111111111111e+01 +23 194 -9.72222222222222e+00 +23 236 -3.47222222222222e+00 +23 104 2.77777777777778e+00 +23 212 -4.86111111111111e+00 +23 101 5.55555555555556e+00 +23 188 -6.94444444444444e-01 +23 196 3.09648140461860e-16 +23 118 -3.57461456268471e-16 +23 193 8.33333333333333e+00 +23 235 2.08333333333333e+00 +23 103 -2.08333333333333e+00 +23 22 -8.33333333333333e+00 +23 100 8.91159975674460e-16 +23 187 -4.36282954208167e-16 +23 195 4.16666666666667e+00 +23 117 7.39859562504108e-16 +23 192 1.52764086103208e-16 +23 234 2.08333333333333e+00 +23 102 -5.03069808033274e-16 +23 21 1.77635683940025e-15 +23 99 8.88178419700125e-16 +23 186 -4.42354486374086e-17 +24 24 2.77777777777778e+01 +24 242 -2.08333333333333e+00 +24 152 6.75674793892966e-16 +24 218 6.59194920871187e-17 +24 226 -9.19403442267708e-17 +24 241 2.08333333333333e+00 +24 151 -4.39535560725623e-16 +24 217 4.16666666666666e+00 +24 225 -4.86111111111111e+00 +24 240 -3.47222222222222e+00 +24 150 -5.55555555555555e+00 +24 216 -4.86111111111111e+00 +24 212 4.16666666666667e+00 +24 143 -9.78384040450919e-16 +24 209 -4.94396190653390e-17 +24 239 2.08333333333333e+00 +24 128 4.64905891561784e-16 +24 26 0.00000000000000e+00 +24 125 4.44089209850063e-16 +24 203 -1.23165366794353e-16 +24 211 2.84494650060196e-16 +24 142 8.88178419700125e-16 +24 208 -5.42101086242752e-18 +24 238 -2.08333333333333e+00 +24 127 6.76542155630955e-16 +24 25 -1.77635683940025e-15 +24 124 -1.42166009867162e-17 +24 202 -4.16666666666667e+00 +24 210 -4.86111111111111e+00 +24 141 5.55555555555555e+00 +24 207 -1.38888888888889e+00 +24 237 -3.47222222222222e+00 +24 126 -5.55555555555555e+00 +24 227 -4.16666666666667e+00 +24 123 5.55555555555556e+00 +24 201 -4.86111111111111e+00 +25 25 2.77777777777778e+01 +25 242 2.08333333333333e+00 +25 152 -2.08333333333333e+00 +25 218 -5.64652491430451e-16 +25 226 -6.94444444444443e-01 +25 241 -3.47222222222222e+00 +25 151 2.77777777777778e+00 +25 217 -4.86111111111111e+00 +25 225 -9.02056207507940e-17 +25 240 2.08333333333333e+00 +25 150 -4.79651041107587e-16 +25 216 4.16666666666667e+00 +25 212 -5.96744875736022e-16 +25 143 -1.10068204550728e-15 +25 209 8.33333333333334e+00 +25 239 2.08333333333333e+00 +25 128 -2.08333333333333e+00 +25 26 -8.33333333333334e+00 +25 125 1.06251812903579e-15 +25 203 -7.10369263412503e-16 +25 211 -6.94444444444445e-01 +25 142 5.55555555555556e+00 +25 208 -9.72222222222223e+00 +25 238 -3.47222222222222e+00 +25 127 2.77777777777778e+00 +25 227 8.32667268468867e-17 +25 124 -1.11111111111111e+01 +25 202 -4.86111111111111e+00 +25 210 2.94035629178069e-16 +25 141 8.88178419700125e-16 +25 207 -2.51534904016637e-17 +25 237 -2.08333333333333e+00 +25 126 8.35160933465584e-16 +25 24 -1.77635683940025e-15 +25 123 9.87708179134295e-17 +25 201 -4.16666666666667e+00 +26 26 2.77777777777778e+01 +26 242 -3.47222222222222e+00 +26 152 2.77777777777778e+00 +26 218 -6.94444444444443e-01 +26 226 1.21430643318376e-17 +26 241 2.08333333333333e+00 +26 151 -2.08333333333333e+00 +26 217 -5.58906219916278e-16 +26 225 -4.16666666666667e+00 +26 240 -2.08333333333333e+00 +26 150 7.28583859910259e-16 +26 216 -2.34187669256869e-17 +26 212 -4.86111111111111e+00 +26 143 -1.11111111111111e+01 +26 209 -9.72222222222222e+00 +26 239 -3.47222222222222e+00 +26 128 2.77777777777778e+00 +26 227 -4.86111111111111e+00 +26 125 5.55555555555556e+00 +26 203 -6.94444444444442e-01 +26 211 -6.33174068731535e-16 +26 142 -8.99670962728472e-16 +26 208 8.33333333333334e+00 +26 238 2.08333333333333e+00 +26 127 -2.08333333333333e+00 +26 25 -8.33333333333334e+00 +26 124 5.58133725868382e-16 +26 202 -6.57026516526216e-16 +26 210 4.16666666666667e+00 +26 141 -7.28583859910259e-16 +26 207 8.08814820674186e-17 +26 237 2.08333333333333e+00 +26 126 5.16080234103100e-16 +26 24 0.00000000000000e+00 +26 123 4.44089209850063e-16 +26 201 -1.04191828775857e-16 +27 27 1.41666666666667e+01 +27 224 -4.74202925190848e-17 +27 29 -4.08333333333334e+00 +27 149 -2.04166666666667e+00 +27 166 2.04166666666667e+00 +27 223 -1.50568576703924e-17 +27 28 4.08333333333333e+00 +27 148 6.63832426257404e-17 +27 165 2.83333333333333e+00 +27 222 -7.08333333333333e-01 +27 167 2.92951427005583e-16 +27 147 2.83333333333334e+00 +27 242 2.08333333333333e+00 +27 152 6.24500451351651e-17 +27 218 2.59341159658533e-16 +27 226 6.93889390390723e-17 +27 241 -2.08333333333333e+00 +27 151 -6.07153216591882e-18 +27 217 -4.16666666666667e+00 +27 225 -4.86111111111111e+00 +27 240 -3.47222222222222e+00 +27 150 -5.55555555555556e+00 +27 227 4.16666666666667e+00 +27 216 -4.86111111111111e+00 +27 398 -8.33333333333334e-02 +27 449 -4.16666666666667e-02 +27 299 -3.46944695195361e-17 +27 389 -3.22041926546085e-18 +27 397 -6.77626357803440e-20 +27 448 4.16666666666667e-02 +27 298 -1.66696084019646e-18 +27 388 8.33333333333334e-02 +27 396 -9.72222222222223e-02 +27 447 -6.94444444444445e-02 +27 297 -1.11111111111111e-01 +27 387 -9.72222222222222e-02 +28 28 1.41666666666667e+01 +28 224 4.25000000000000e+00 +28 29 -4.25000000000000e+00 +28 149 2.93661240615382e-16 +28 166 2.83333333333333e+00 +28 223 -4.95833333333333e+00 +28 167 -5.69788899222601e-16 +28 148 -5.66666666666666e+00 +28 165 2.04166666666667e+00 +28 222 -2.15485181781494e-17 +28 27 4.08333333333333e+00 +28 147 5.68664039468647e-17 +28 242 2.08333333333333e+00 +28 152 -2.08333333333333e+00 +28 218 3.57353036051222e-16 +28 226 -6.94444444444445e-01 +28 241 -3.47222222222222e+00 +28 151 2.77777777777778e+00 +28 227 -2.22044604925031e-16 +28 217 -4.86111111111111e+00 +28 225 6.41847686111419e-17 +28 240 -2.08333333333333e+00 +28 150 -1.14925430283463e-17 +28 216 -4.16666666666667e+00 +28 398 -1.26851654180804e-17 +28 449 4.16666666666667e-02 +28 299 -4.16666666666667e-02 +28 389 1.57073789738837e-17 +28 397 -1.38888888888889e-02 +28 448 -6.94444444444444e-02 +28 298 5.55555555555555e-02 +28 388 -9.72222222222222e-02 +28 396 -5.42101086242752e-19 +28 447 4.16666666666667e-02 +28 297 -8.53809210832335e-19 +28 387 8.33333333333334e-02 +29 29 1.41666666666667e+01 +29 224 -4.95833333333333e+00 +29 167 -5.66666666666667e+00 +29 149 2.83333333333333e+00 +29 166 -2.25827454067469e-16 +29 223 4.25000000000000e+00 +29 28 -4.25000000000000e+00 +29 148 1.88127711651075e-16 +29 165 1.15860554657232e-16 +29 222 4.23499532968205e-17 +29 27 -4.08333333333334e+00 +29 147 -2.04166666666667e+00 +29 242 -3.47222222222222e+00 +29 152 2.77777777777778e+00 +29 227 -4.86111111111111e+00 +29 218 -6.94444444444444e-01 +29 226 -1.83880688453542e-16 +29 241 2.08333333333333e+00 +29 151 -2.08333333333333e+00 +29 217 3.43041567374414e-16 +29 225 4.16666666666667e+00 +29 240 2.08333333333333e+00 +29 150 -6.85215773010839e-17 +29 216 2.54028569013354e-16 +29 398 -9.72222222222223e-02 +29 449 -6.94444444444444e-02 +29 299 5.55555555555556e-02 +29 389 -1.38888888888889e-02 +29 397 -1.35389746289127e-17 +29 448 4.16666666666667e-02 +29 298 -4.16666666666667e-02 +29 388 1.57785297414531e-17 +29 396 -8.33333333333334e-02 +29 447 -4.16666666666667e-02 +29 297 -3.31765864780564e-17 +29 387 -2.23616698075135e-18 +30 30 1.00000000000000e+00 +30 185 0.00000000000000e+00 +30 74 0.00000000000000e+00 +30 32 0.00000000000000e+00 +30 182 0.00000000000000e+00 +30 233 0.00000000000000e+00 +30 173 0.00000000000000e+00 +30 86 0.00000000000000e+00 +30 82 0.00000000000000e+00 +30 184 0.00000000000000e+00 +30 73 0.00000000000000e+00 +30 31 0.00000000000000e+00 +30 181 0.00000000000000e+00 +30 232 0.00000000000000e+00 +30 172 0.00000000000000e+00 +30 85 0.00000000000000e+00 +30 81 0.00000000000000e+00 +30 183 0.00000000000000e+00 +30 72 0.00000000000000e+00 +30 83 0.00000000000000e+00 +30 180 0.00000000000000e+00 +30 231 0.00000000000000e+00 +30 171 0.00000000000000e+00 +30 84 0.00000000000000e+00 +31 31 1.00000000000000e+00 +31 185 0.00000000000000e+00 +31 74 0.00000000000000e+00 +31 32 0.00000000000000e+00 +31 182 0.00000000000000e+00 +31 233 0.00000000000000e+00 +31 173 0.00000000000000e+00 +31 86 0.00000000000000e+00 +31 82 0.00000000000000e+00 +31 184 0.00000000000000e+00 +31 73 0.00000000000000e+00 +31 83 0.00000000000000e+00 +31 181 0.00000000000000e+00 +31 232 0.00000000000000e+00 +31 172 0.00000000000000e+00 +31 85 0.00000000000000e+00 +31 81 0.00000000000000e+00 +31 183 0.00000000000000e+00 +31 72 0.00000000000000e+00 +31 30 0.00000000000000e+00 +31 180 0.00000000000000e+00 +31 231 0.00000000000000e+00 +31 171 0.00000000000000e+00 +31 84 0.00000000000000e+00 +32 32 1.00000000000000e+00 +32 185 0.00000000000000e+00 +32 74 0.00000000000000e+00 +32 83 0.00000000000000e+00 +32 182 0.00000000000000e+00 +32 233 0.00000000000000e+00 +32 173 0.00000000000000e+00 +32 86 0.00000000000000e+00 +32 82 0.00000000000000e+00 +32 184 0.00000000000000e+00 +32 73 0.00000000000000e+00 +32 31 0.00000000000000e+00 +32 181 0.00000000000000e+00 +32 232 0.00000000000000e+00 +32 172 0.00000000000000e+00 +32 85 0.00000000000000e+00 +32 81 0.00000000000000e+00 +32 183 0.00000000000000e+00 +32 72 0.00000000000000e+00 +32 30 0.00000000000000e+00 +32 180 0.00000000000000e+00 +32 231 0.00000000000000e+00 +32 171 0.00000000000000e+00 +32 84 0.00000000000000e+00 +33 33 2.77777777777778e+01 +33 107 2.29850860566927e-16 +33 236 2.08333333333333e+00 +33 191 4.16666666666667e+00 +33 199 -4.16666666666667e+00 +33 106 2.11636264069170e-16 +33 235 -2.08333333333333e+00 +33 190 5.55111512312578e-17 +33 198 -4.86111111111111e+00 +33 105 -5.55555555555555e+00 +33 234 -3.47222222222222e+00 +33 189 -4.86111111111111e+00 +33 185 -1.11022302462516e-16 +33 77 8.88178419700125e-16 +33 35 -8.88178419700125e-16 +33 74 2.42861286636753e-17 +33 233 -2.08333333333333e+00 +33 176 1.65666091955785e-16 +33 89 -6.99174875981590e-17 +33 173 -4.16666666666667e+00 +33 184 4.16666666666667e+00 +33 76 7.63278329429795e-17 +33 34 0.00000000000000e+00 +33 73 -2.28983498828939e-16 +33 232 2.08333333333333e+00 +33 175 5.46437894932694e-17 +33 88 -4.44089209850063e-16 +33 172 1.30104260698261e-17 +33 183 -4.86111111111111e+00 +33 75 5.55555555555556e+00 +33 200 1.82145964977565e-17 +33 72 -5.55555555555556e+00 +33 231 -3.47222222222222e+00 +33 174 -1.38888888888889e+00 +33 87 5.55555555555556e+00 +33 171 -4.86111111111112e+00 +34 34 2.77777777777778e+01 +34 107 -2.08333333333333e+00 +34 236 2.08333333333333e+00 +34 191 -1.23599047663348e-17 +34 199 -4.86111111111111e+00 +34 106 2.77777777777778e+00 +34 235 -3.47222222222222e+00 +34 190 -6.94444444444445e-01 +34 198 -4.16666666666667e+00 +34 105 2.35922392732846e-16 +34 234 -2.08333333333333e+00 +34 189 5.03069808033274e-17 +34 185 2.09901540593194e-16 +34 77 1.78676518025611e-16 +34 35 -8.33333333333333e+00 +34 74 -2.08333333333333e+00 +34 233 2.08333333333333e+00 +34 176 8.33333333333333e+00 +34 89 3.33798743853975e-17 +34 173 -1.35742111995185e-16 +34 184 -4.86111111111111e+00 +34 76 -1.11111111111111e+01 +34 200 7.54604712049911e-17 +34 73 2.77777777777778e+00 +34 232 -3.47222222222222e+00 +34 175 -9.72222222222223e+00 +34 88 5.55555555555556e+00 +34 172 -6.94444444444445e-01 +34 183 4.16666666666667e+00 +34 75 6.76542155630955e-17 +34 33 0.00000000000000e+00 +34 72 -2.13370987545147e-16 +34 231 2.08333333333333e+00 +34 174 9.75781955236954e-19 +34 87 -4.44089209850063e-16 +34 171 -3.39355279987963e-17 +35 35 2.77777777777778e+01 +35 107 2.77777777777778e+00 +35 236 -3.47222222222222e+00 +35 191 -4.86111111111111e+00 +35 199 3.46944695195361e-17 +35 106 -2.08333333333333e+00 +35 235 2.08333333333333e+00 +35 190 -2.16840434497101e-17 +35 198 6.93889390390723e-18 +35 105 1.35308431126191e-16 +35 234 2.08333333333333e+00 +35 189 4.16666666666667e+00 +35 185 -6.94444444444444e-01 +35 77 5.55555555555556e+00 +35 200 -6.94444444444445e-01 +35 74 2.77777777777778e+00 +35 233 -3.47222222222222e+00 +35 176 -9.72222222222222e+00 +35 89 -1.11111111111111e+01 +35 173 -4.86111111111111e+00 +35 184 2.49800180540660e-16 +35 76 -5.37764277552810e-17 +35 34 -8.33333333333333e+00 +35 73 -2.08333333333333e+00 +35 232 2.08333333333333e+00 +35 175 8.33333333333333e+00 +35 88 2.73652628335341e-16 +35 172 -8.67361737988404e-17 +35 183 -4.33680868994202e-17 +35 75 8.88178419700125e-16 +35 33 -1.77635683940025e-15 +35 72 -7.53520509877426e-17 +35 231 -2.08333333333333e+00 +35 174 8.84708972748172e-17 +35 87 -3.97902197302180e-17 +35 171 -4.16666666666667e+00 +36 36 2.77777777777778e+01 +36 131 1.93313247354165e-16 +36 239 2.08333333333333e+00 +36 206 4.16666666666667e+00 +36 214 -4.16666666666667e+00 +36 130 -7.97972798949331e-17 +36 238 -2.08333333333333e+00 +36 205 -1.06577073555325e-16 +36 213 -4.86111111111111e+00 +36 129 -5.55555555555556e+00 +36 237 -3.47222222222222e+00 +36 204 -4.86111111111112e+00 +36 200 -8.32667268468867e-17 +36 110 8.88178419700125e-16 +36 38 8.88178419700125e-16 +36 107 -9.23740250957650e-16 +36 236 -2.08333333333333e+00 +36 194 3.89553840574042e-16 +36 116 3.19880298464692e-16 +36 191 -4.16666666666667e+00 +36 199 4.16666666666667e+00 +36 109 5.06539254985228e-16 +36 37 8.88178419700125e-16 +36 106 -2.28983498828939e-16 +36 235 2.08333333333333e+00 +36 193 1.16226472890446e-16 +36 115 0.00000000000000e+00 +36 190 3.38271077815477e-17 +36 198 -4.86111111111111e+00 +36 108 5.55555555555556e+00 +36 215 -2.53269627492614e-16 +36 105 -5.55555555555556e+00 +36 234 -3.47222222222222e+00 +36 192 -1.38888888888889e+00 +36 114 5.55555555555556e+00 +36 189 -4.86111111111112e+00 +37 37 2.77777777777778e+01 +37 131 -2.08333333333333e+00 +37 239 2.08333333333333e+00 +37 206 -1.25767452008319e-17 +37 214 -4.86111111111111e+00 +37 130 2.77777777777778e+00 +37 238 -3.47222222222222e+00 +37 205 -6.94444444444446e-01 +37 213 -4.16666666666667e+00 +37 129 2.08166817117217e-16 +37 237 -2.08333333333333e+00 +37 204 -1.99493199737333e-17 +37 200 3.09648140461860e-16 +37 110 -3.82723366887383e-17 +37 38 -8.33333333333333e+00 +37 107 -2.08333333333333e+00 +37 236 2.08333333333333e+00 +37 194 8.33333333333333e+00 +37 116 4.82442861701737e-16 +37 191 1.67400815431762e-16 +37 199 -4.86111111111111e+00 +37 109 -1.11111111111111e+01 +37 215 -4.07660016854550e-17 +37 106 2.77777777777778e+00 +37 235 -3.47222222222222e+00 +37 193 -9.72222222222223e+00 +37 115 5.55555555555556e+00 +37 190 -6.94444444444446e-01 +37 198 4.16666666666667e+00 +37 108 2.23779328401008e-16 +37 36 8.88178419700125e-16 +37 105 -1.70002900645727e-16 +37 234 2.08333333333333e+00 +37 192 1.44524149592318e-16 +37 114 0.00000000000000e+00 +37 189 -2.77555756156289e-17 +38 38 2.77777777777778e+01 +38 131 2.77777777777778e+00 +38 239 -3.47222222222222e+00 +38 206 -4.86111111111111e+00 +38 109 9.71445146547012e-17 +38 214 -9.71445146547012e-17 +38 130 -2.08333333333333e+00 +38 238 2.08333333333333e+00 +38 205 -1.76941794549634e-16 +38 213 -2.98372437868011e-16 +38 129 1.21430643318376e-17 +38 237 2.08333333333333e+00 +38 204 4.16666666666667e+00 +38 200 -6.94444444444444e-01 +38 110 5.55555555555555e+00 +38 215 -6.94444444444444e-01 +38 107 2.77777777777778e+00 +38 236 -3.47222222222222e+00 +38 194 -9.72222222222222e+00 +38 116 -1.11111111111111e+01 +38 191 -4.86111111111111e+00 +38 199 2.98372437868011e-16 +38 37 -8.33333333333333e+00 +38 106 -2.08333333333333e+00 +38 235 2.08333333333333e+00 +38 193 8.33333333333333e+00 +38 115 8.38955641069283e-16 +38 190 1.33573707650214e-16 +38 198 -9.28077059647592e-17 +38 108 8.88178419700125e-16 +38 36 8.88178419700125e-16 +38 105 -1.04419511232079e-15 +38 234 -2.08333333333333e+00 +38 192 4.85722573273506e-16 +38 114 1.88542757795229e-16 +38 189 -4.16666666666667e+00 +39 39 2.77777777777778e+01 +39 155 -7.15898694492179e-16 +39 242 2.08333333333333e+00 +39 221 4.16666666666667e+00 +39 229 -4.16666666666667e+00 +39 154 -4.89192020225460e-16 +39 241 -2.08333333333333e+00 +39 220 -1.01372903127395e-16 +39 228 -4.86111111111111e+00 +39 153 -5.55555555555555e+00 +39 240 -3.47222222222222e+00 +39 219 -4.86111111111111e+00 +39 215 -1.73472347597681e-16 +39 134 0.00000000000000e+00 +39 41 8.88178419700125e-16 +39 131 -1.43635103810880e-15 +39 239 -2.08333333333333e+00 +39 209 2.54787510534094e-17 +39 140 7.98121876748048e-16 +39 206 -4.16666666666667e+00 +39 214 4.16666666666667e+00 +39 133 2.15105711021124e-16 +39 40 0.00000000000000e+00 +39 130 8.95117313604032e-16 +39 238 2.08333333333333e+00 +39 208 -2.42861286636753e-17 +39 139 -8.88178419700125e-16 +39 205 2.20309881449055e-16 +39 213 -4.86111111111111e+00 +39 132 5.55555555555555e+00 +39 230 1.80411241501588e-16 +39 129 -5.55555555555555e+00 +39 237 -3.47222222222222e+00 +39 207 -1.38888888888889e+00 +39 138 5.55555555555555e+00 +39 204 -4.86111111111111e+00 +40 40 2.77777777777778e+01 +40 155 -2.08333333333333e+00 +40 242 2.08333333333333e+00 +40 221 2.44053909026487e-16 +40 229 -4.86111111111111e+00 +40 154 2.77777777777778e+00 +40 241 -3.47222222222222e+00 +40 220 -6.94444444444443e-01 +40 228 -4.16666666666667e+00 +40 153 -4.51028103753970e-16 +40 240 -2.08333333333333e+00 +40 219 -5.63785129692462e-17 +40 215 3.10515502199848e-16 +40 134 2.78206277459780e-16 +40 41 -8.33333333333334e+00 +40 131 -2.08333333333333e+00 +40 239 2.08333333333333e+00 +40 209 8.33333333333334e+00 +40 140 -6.49911439769280e-16 +40 206 6.82180006927879e-16 +40 214 -4.86111111111111e+00 +40 133 -1.11111111111111e+01 +40 230 -2.22911966663020e-16 +40 130 2.77777777777778e+00 +40 238 -3.47222222222222e+00 +40 208 -9.72222222222223e+00 +40 139 5.55555555555556e+00 +40 205 -6.94444444444446e-01 +40 213 4.16666666666667e+00 +40 132 -8.76035355368288e-17 +40 39 0.00000000000000e+00 +40 129 9.11597186625812e-16 +40 237 2.08333333333333e+00 +40 207 -5.52943107967607e-18 +40 138 -8.88178419700125e-16 +40 204 2.73977888987087e-16 +41 41 2.77777777777778e+01 +41 155 2.77777777777778e+00 +41 242 -3.47222222222222e+00 +41 221 -4.86111111111111e+00 +41 229 -2.63677968348475e-16 +41 154 -2.08333333333333e+00 +41 241 2.08333333333333e+00 +41 220 3.62557206479153e-16 +41 228 2.63677968348475e-16 +41 153 -6.60062282609175e-16 +41 240 2.08333333333333e+00 +41 219 4.16666666666667e+00 +41 215 -6.94444444444445e-01 +41 134 5.55555555555556e+00 +41 230 -6.94444444444444e-01 +41 131 2.77777777777778e+00 +41 239 -3.47222222222222e+00 +41 209 -9.72222222222222e+00 +41 140 -1.11111111111111e+01 +41 206 -4.86111111111111e+00 +41 214 4.02455846426619e-16 +41 133 7.71951946809679e-17 +41 40 -8.33333333333334e+00 +41 130 -2.08333333333333e+00 +41 238 2.08333333333333e+00 +41 208 8.33333333333334e+00 +41 139 -4.23055687703844e-16 +41 205 8.43942971062717e-16 +41 213 -1.77809156287623e-16 +41 132 0.00000000000000e+00 +41 39 8.88178419700125e-16 +41 129 -1.35406009321715e-15 +41 237 -2.08333333333333e+00 +41 207 -4.94396190653390e-17 +41 138 1.04983296361771e-15 +41 204 -4.16666666666667e+00 +42 42 1.41666666666667e+01 +42 44 4.08333333333333e+00 +42 224 -6.95380168377890e-17 +42 164 -6.01952434295741e-16 +42 157 5.74627151417317e-17 +42 43 -4.08333333333333e+00 +42 223 -2.15620707053055e-17 +42 163 -2.04166666666667e+00 +42 156 2.83333333333333e+00 +42 158 2.04166666666667e+00 +42 222 -7.08333333333333e-01 +42 162 2.83333333333334e+00 +42 155 6.92154666914746e-16 +42 242 -2.08333333333333e+00 +42 221 -4.16666666666667e+00 +42 229 4.16666666666667e+00 +42 154 -2.28983498828939e-16 +42 241 2.08333333333333e+00 +42 220 6.07153216591882e-18 +42 228 -4.86111111111111e+00 +42 230 1.17961196366423e-16 +42 153 -5.55555555555556e+00 +42 240 -3.47222222222222e+00 +42 219 -4.86111111111112e+00 +42 401 -1.34170018845081e-18 +42 302 2.31070588010973e-17 +42 449 4.16666666666667e-02 +42 392 8.33333333333334e-02 +42 400 -8.33333333333333e-02 +42 301 3.76760254938713e-18 +42 448 -4.16666666666667e-02 +42 391 7.11507675693612e-20 +42 399 -9.72222222222222e-02 +42 300 -1.11111111111111e-01 +42 447 -6.94444444444445e-02 +42 390 -9.72222222222223e-02 +43 43 1.41666666666667e+01 +43 44 -4.25000000000000e+00 +43 224 4.25000000000000e+00 +43 164 -6.77708943515798e-17 +43 157 -5.66666666666667e+00 +43 158 -7.16808407877530e-16 +43 223 -4.95833333333333e+00 +43 163 2.83333333333333e+00 +43 156 1.04164723721545e-16 +43 42 -4.08333333333333e+00 +43 222 -1.41911899982985e-17 +43 162 -2.04166666666667e+00 +43 155 -2.08333333333333e+00 +43 242 2.08333333333333e+00 +43 221 -6.63531729561129e-17 +43 229 -4.86111111111111e+00 +43 230 -4.61436444609831e-16 +43 154 2.77777777777778e+00 +43 241 -3.47222222222222e+00 +43 220 -6.94444444444445e-01 +43 228 4.16666666666667e+00 +43 153 -1.24032728532342e-16 +43 240 2.08333333333333e+00 +43 219 3.96817995129695e-17 +43 401 8.18572640226556e-18 +43 302 -4.16666666666667e-02 +43 449 4.16666666666667e-02 +43 392 -9.01243055878576e-18 +43 400 -9.72222222222222e-02 +43 301 5.55555555555555e-02 +43 448 -6.94444444444444e-02 +43 391 -1.38888888888889e-02 +43 399 -8.33333333333334e-02 +43 300 1.08420217248550e-18 +43 447 -4.16666666666667e-02 +43 390 2.16840434497101e-19 +44 44 1.41666666666667e+01 +44 158 2.83333333333333e+00 +44 224 -4.95833333333333e+00 +44 164 -5.66666666666666e+00 +44 157 -6.14932367179466e-16 +44 43 -4.25000000000000e+00 +44 223 4.25000000000000e+00 +44 163 1.71171806112938e-16 +44 156 2.04166666666667e+00 +44 42 4.08333333333333e+00 +44 222 -4.74067399919287e-17 +44 162 -8.05514780311684e-16 +44 230 -6.94444444444445e-01 +44 155 2.77777777777778e+00 +44 242 -3.47222222222222e+00 +44 221 -4.86111111111111e+00 +44 229 -4.99600361081320e-16 +44 154 -2.08333333333333e+00 +44 241 2.08333333333333e+00 +44 220 -1.00613961606655e-16 +44 228 1.89084858881472e-16 +44 153 7.68265659423228e-16 +44 240 -2.08333333333333e+00 +44 219 -4.16666666666667e+00 +44 401 -1.38888888888889e-02 +44 302 5.55555555555555e-02 +44 449 -6.94444444444445e-02 +44 392 -9.72222222222223e-02 +44 400 6.39679281766448e-18 +44 301 -4.16666666666667e-02 +44 448 4.16666666666667e-02 +44 391 -9.14795583034644e-18 +44 399 -7.58941520739853e-19 +44 300 2.26191678234788e-17 +44 447 4.16666666666667e-02 +44 390 8.33333333333334e-02 +45 45 1.00000000000000e+00 +45 80 0.00000000000000e+00 +45 185 0.00000000000000e+00 +45 83 0.00000000000000e+00 +45 95 0.00000000000000e+00 +45 179 0.00000000000000e+00 +45 233 0.00000000000000e+00 +45 182 0.00000000000000e+00 +45 46 0.00000000000000e+00 +45 79 0.00000000000000e+00 +45 184 0.00000000000000e+00 +45 82 0.00000000000000e+00 +45 94 0.00000000000000e+00 +45 178 0.00000000000000e+00 +45 232 0.00000000000000e+00 +45 181 0.00000000000000e+00 +45 47 0.00000000000000e+00 +45 78 0.00000000000000e+00 +45 183 0.00000000000000e+00 +45 81 0.00000000000000e+00 +45 93 0.00000000000000e+00 +45 177 0.00000000000000e+00 +45 231 0.00000000000000e+00 +45 180 0.00000000000000e+00 +46 46 1.00000000000000e+00 +46 80 0.00000000000000e+00 +46 185 0.00000000000000e+00 +46 83 0.00000000000000e+00 +46 95 0.00000000000000e+00 +46 179 0.00000000000000e+00 +46 233 0.00000000000000e+00 +46 182 0.00000000000000e+00 +46 47 0.00000000000000e+00 +46 79 0.00000000000000e+00 +46 184 0.00000000000000e+00 +46 82 0.00000000000000e+00 +46 94 0.00000000000000e+00 +46 178 0.00000000000000e+00 +46 232 0.00000000000000e+00 +46 181 0.00000000000000e+00 +46 45 0.00000000000000e+00 +46 78 0.00000000000000e+00 +46 183 0.00000000000000e+00 +46 81 0.00000000000000e+00 +46 93 0.00000000000000e+00 +46 177 0.00000000000000e+00 +46 231 0.00000000000000e+00 +46 180 0.00000000000000e+00 +47 47 1.00000000000000e+00 +47 80 0.00000000000000e+00 +47 185 0.00000000000000e+00 +47 83 0.00000000000000e+00 +47 95 0.00000000000000e+00 +47 179 0.00000000000000e+00 +47 233 0.00000000000000e+00 +47 182 0.00000000000000e+00 +47 46 0.00000000000000e+00 +47 79 0.00000000000000e+00 +47 184 0.00000000000000e+00 +47 82 0.00000000000000e+00 +47 94 0.00000000000000e+00 +47 178 0.00000000000000e+00 +47 232 0.00000000000000e+00 +47 181 0.00000000000000e+00 +47 45 0.00000000000000e+00 +47 78 0.00000000000000e+00 +47 183 0.00000000000000e+00 +47 81 0.00000000000000e+00 +47 93 0.00000000000000e+00 +47 177 0.00000000000000e+00 +47 231 0.00000000000000e+00 +47 180 0.00000000000000e+00 +48 48 2.77777777777778e+01 +48 200 -1.07552855510562e-16 +48 197 4.16666666666667e+00 +48 236 2.08333333333333e+00 +48 112 6.93889390390723e-17 +48 199 4.16666666666667e+00 +48 196 8.67361737988404e-18 +48 235 2.08333333333333e+00 +48 111 -5.55555555555555e+00 +48 198 -4.86111111111111e+00 +48 195 -4.86111111111111e+00 +48 234 -3.47222222222222e+00 +48 80 -2.22044604925031e-16 +48 50 0.00000000000000e+00 +48 77 8.88178419700125e-16 +48 185 1.17961196366423e-16 +48 179 -4.16666666666667e+00 +48 92 2.94902990916057e-16 +48 176 1.71846044338952e-16 +48 233 -2.08333333333333e+00 +48 79 -1.66533453693773e-16 +48 49 0.00000000000000e+00 +48 76 2.41126563160776e-16 +48 184 -4.16666666666667e+00 +48 178 -9.02056207507940e-17 +48 91 8.88178419700125e-16 +48 175 6.88468379528295e-17 +48 232 -2.08333333333333e+00 +48 78 -5.55555555555556e+00 +48 113 -2.42861286636753e-16 +48 75 5.55555555555556e+00 +48 183 -4.86111111111111e+00 +48 177 -4.86111111111111e+00 +48 90 5.55555555555556e+00 +48 174 -1.38888888888889e+00 +48 231 -3.47222222222222e+00 +49 49 2.77777777777778e+01 +49 200 1.87350135405495e-16 +49 197 -2.90566182226115e-16 +49 236 -2.08333333333333e+00 +49 112 2.77777777777778e+00 +49 199 -4.86111111111111e+00 +49 196 -6.94444444444444e-01 +49 235 -3.47222222222222e+00 +49 111 0.00000000000000e+00 +49 198 4.16666666666667e+00 +49 195 -6.24500451351651e-17 +49 234 2.08333333333333e+00 +49 80 2.08333333333333e+00 +49 50 8.33333333333333e+00 +49 77 1.96023752785379e-16 +49 185 9.02056207507940e-17 +49 179 -2.47198095326695e-16 +49 92 -4.06575814682064e-17 +49 176 -8.33333333333333e+00 +49 233 -2.08333333333333e+00 +49 79 2.77777777777778e+00 +49 113 2.08333333333333e+00 +49 76 -1.11111111111111e+01 +49 184 -4.86111111111111e+00 +49 178 -6.94444444444445e-01 +49 91 5.55555555555556e+00 +49 175 -9.72222222222223e+00 +49 232 -3.47222222222222e+00 +49 78 -2.77555756156289e-16 +49 48 0.00000000000000e+00 +49 75 3.53883589099269e-16 +49 183 -4.16666666666667e+00 +49 177 -6.85215773010839e-17 +49 90 8.88178419700125e-16 +49 174 4.77048955893622e-17 +49 231 -2.08333333333333e+00 +50 50 2.77777777777778e+01 +50 200 -6.94444444444445e-01 +50 197 -4.86111111111111e+00 +50 236 -3.47222222222222e+00 +50 112 2.08333333333333e+00 +50 199 1.74339709335669e-16 +50 196 -1.38777878078145e-16 +50 235 -2.08333333333333e+00 +50 111 -2.77555756156289e-16 +50 198 -1.31838984174237e-16 +50 195 4.16666666666667e+00 +50 234 2.08333333333333e+00 +50 80 2.77777777777778e+00 +50 113 2.77777777777778e+00 +50 77 5.55555555555556e+00 +50 185 -6.94444444444445e-01 +50 179 -4.86111111111111e+00 +50 92 -1.11111111111111e+01 +50 176 -9.72222222222222e+00 +50 233 -3.47222222222222e+00 +50 79 2.08333333333333e+00 +50 49 8.33333333333333e+00 +50 76 1.75315491290906e-16 +50 184 7.54604712049911e-17 +50 178 -1.80411241501588e-16 +50 91 -1.03216046820620e-16 +50 175 -8.33333333333333e+00 +50 232 -2.08333333333333e+00 +50 78 -1.80411241501588e-16 +50 48 0.00000000000000e+00 +50 75 8.88178419700125e-16 +50 183 7.45931094670027e-17 +50 177 -4.16666666666667e+00 +50 90 2.91433543964104e-16 +50 174 -3.12250225675825e-17 +50 231 -2.08333333333333e+00 +51 51 2.77777777777778e+01 +51 215 -3.01841884819964e-16 +51 212 4.16666666666667e+00 +51 239 2.08333333333333e+00 +51 136 -1.24900090270330e-16 +51 214 4.16666666666667e+00 +51 211 -1.75207071073658e-16 +51 238 2.08333333333333e+00 +51 135 -5.55555555555556e+00 +51 213 -4.86111111111111e+00 +51 210 -4.86111111111111e+00 +51 237 -3.47222222222222e+00 +51 113 -4.44089209850063e-16 +51 53 2.66453525910038e-15 +51 110 8.88178419700125e-16 +51 200 2.77555756156289e-17 +51 197 -4.16666666666667e+00 +51 119 7.38992200766120e-16 +51 194 1.11239142897013e-16 +51 236 -2.08333333333333e+00 +51 112 -3.33066907387547e-16 +51 52 8.88178419700125e-16 +51 109 3.34801630863524e-16 +51 199 -4.16666666666667e+00 +51 196 -2.77555756156289e-17 +51 118 8.88178419700125e-16 +51 193 1.70761842166467e-16 +51 235 -2.08333333333333e+00 +51 111 -5.55555555555556e+00 +51 137 -1.40859546249317e-15 +51 108 5.55555555555556e+00 +51 198 -4.86111111111111e+00 +51 195 -4.86111111111111e+00 +51 117 5.55555555555556e+00 +51 192 -1.38888888888889e+00 +51 234 -3.47222222222222e+00 +52 52 2.77777777777778e+01 +52 215 7.00828284294630e-16 +52 212 1.83013326715553e-16 +52 239 -2.08333333333333e+00 +52 136 2.77777777777778e+00 +52 214 -4.86111111111111e+00 +52 211 -6.94444444444444e-01 +52 238 -3.47222222222222e+00 +52 135 -2.22044604925031e-16 +52 213 4.16666666666667e+00 +52 210 -2.08166817117217e-16 +52 237 2.08333333333333e+00 +52 113 2.08333333333333e+00 +52 53 8.33333333333333e+00 +52 110 3.74700270810990e-16 +52 200 -6.03683769639929e-16 +52 197 9.54097911787244e-17 +52 119 -3.50414142147315e-16 +52 194 -8.33333333333333e+00 +52 236 -2.08333333333333e+00 +52 112 2.77777777777778e+00 +52 137 2.08333333333333e+00 +52 109 -1.11111111111111e+01 +52 199 -4.86111111111111e+00 +52 196 -6.94444444444445e-01 +52 118 5.55555555555556e+00 +52 193 -9.72222222222223e+00 +52 235 -3.47222222222222e+00 +52 111 -3.53883589099269e-16 +52 51 8.88178419700125e-16 +52 108 5.06539254985228e-16 +52 198 -4.16666666666667e+00 +52 195 -8.41340885848751e-17 +52 117 8.88178419700125e-16 +52 192 2.41126563160776e-16 +52 234 -2.08333333333333e+00 +53 53 2.77777777777778e+01 +53 215 -6.94444444444444e-01 +53 212 -4.86111111111111e+00 +53 239 -3.47222222222222e+00 +53 136 2.08333333333333e+00 +53 214 6.74807432154978e-16 +53 211 2.91433543964104e-16 +53 238 -2.08333333333333e+00 +53 135 -1.44328993201270e-15 +53 213 -4.37150315946155e-16 +53 210 4.16666666666667e+00 +53 237 2.08333333333333e+00 +53 113 2.77777777777778e+00 +53 137 2.77777777777778e+00 +53 110 5.55555555555555e+00 +53 200 -6.94444444444444e-01 +53 197 -4.86111111111111e+00 +53 119 -1.11111111111111e+01 +53 194 -9.72222222222222e+00 +53 236 -3.47222222222222e+00 +53 112 2.08333333333333e+00 +53 52 8.33333333333333e+00 +53 109 1.83772268236293e-16 +53 199 -5.36896915814822e-16 +53 196 -4.85722573273506e-17 +53 118 -7.77156117237610e-16 +53 193 -8.33333333333333e+00 +53 235 -2.08333333333333e+00 +53 111 -5.75928194024300e-16 +53 51 2.66453525910038e-15 +53 108 8.88178419700125e-16 +53 198 1.90819582357449e-17 +53 195 -4.16666666666667e+00 +53 117 9.08995101411847e-16 +53 192 4.85722573273506e-16 +53 234 -2.08333333333333e+00 +54 54 2.77777777777778e+01 +54 230 5.55111512312578e-17 +54 227 4.16666666666667e+00 +54 242 2.08333333333333e+00 +54 160 -4.09394740330526e-16 +54 229 4.16666666666667e+00 +54 226 -1.13624387676481e-16 +54 241 2.08333333333333e+00 +54 159 -5.55555555555555e+00 +54 228 -4.86111111111111e+00 +54 225 -4.86111111111111e+00 +54 240 -3.47222222222222e+00 +54 137 5.55111512312578e-16 +54 56 -8.88178419700125e-16 +54 134 4.44089209850063e-16 +54 215 -4.85722573273506e-17 +54 212 -4.16666666666667e+00 +54 143 -7.28583859910259e-16 +54 209 -3.87060175577325e-17 +54 239 -2.08333333333333e+00 +54 136 7.77156117237610e-16 +54 55 0.00000000000000e+00 +54 133 -8.76035355368288e-17 +54 214 -4.16666666666667e+00 +54 211 3.12250225675825e-16 +54 142 8.88178419700125e-16 +54 208 6.84131570838353e-17 +54 238 -2.08333333333333e+00 +54 135 -5.55555555555555e+00 +54 161 7.21644966006352e-16 +54 132 5.55555555555555e+00 +54 213 -4.86111111111111e+00 +54 210 -4.86111111111111e+00 +54 141 5.55555555555555e+00 +54 207 -1.38888888888889e+00 +54 237 -3.47222222222222e+00 +55 55 2.77777777777778e+01 +55 230 -2.49800180540660e-16 +55 227 5.68989300120393e-16 +55 242 -2.08333333333333e+00 +55 160 2.77777777777778e+00 +55 229 -4.86111111111111e+00 +55 226 -6.94444444444445e-01 +55 241 -3.47222222222222e+00 +55 159 -4.99600361081320e-16 +55 228 4.16666666666667e+00 +55 225 -9.02056207507940e-17 +55 240 2.08333333333333e+00 +55 137 2.08333333333333e+00 +55 56 8.33333333333333e+00 +55 134 3.54750950837257e-16 +55 215 -9.02056207507940e-17 +55 212 4.77048955893622e-16 +55 143 -7.81601346144800e-16 +55 209 -8.33333333333334e+00 +55 239 -2.08333333333333e+00 +55 136 2.77777777777778e+00 +55 161 2.08333333333333e+00 +55 133 -1.11111111111111e+01 +55 214 -4.86111111111111e+00 +55 211 -6.94444444444444e-01 +55 142 5.55555555555556e+00 +55 208 -9.72222222222223e+00 +55 238 -3.47222222222222e+00 +55 135 7.97972798949331e-16 +55 54 0.00000000000000e+00 +55 132 2.63677968348475e-16 +55 213 -4.16666666666667e+00 +55 210 3.15719672627779e-16 +55 141 4.44089209850063e-16 +55 207 -1.12757025938492e-17 +55 237 -2.08333333333333e+00 +56 56 2.77777777777778e+01 +56 230 -6.94444444444443e-01 +56 227 -4.86111111111111e+00 +56 242 -3.47222222222222e+00 +56 160 2.08333333333333e+00 +56 229 -3.20056481317721e-16 +56 226 6.93889390390723e-16 +56 241 -2.08333333333333e+00 +56 159 6.66133814775094e-16 +56 228 1.52655665885959e-16 +56 225 4.16666666666667e+00 +56 240 2.08333333333333e+00 +56 137 2.77777777777778e+00 +56 161 2.77777777777778e+00 +56 134 5.55555555555556e+00 +56 215 -6.94444444444444e-01 +56 212 -4.86111111111111e+00 +56 143 -1.11111111111111e+01 +56 209 -9.72222222222222e+00 +56 239 -3.47222222222222e+00 +56 136 2.08333333333333e+00 +56 55 8.33333333333333e+00 +56 133 4.51678625057461e-16 +56 214 -1.06685493772574e-16 +56 211 5.20417042793042e-16 +56 142 -1.15619319673854e-15 +56 208 -8.33333333333334e+00 +56 238 -2.08333333333333e+00 +56 135 5.75928194024300e-16 +56 54 -8.88178419700125e-16 +56 132 4.44089209850063e-16 +56 213 -8.06646416329215e-17 +56 210 -4.16666666666667e+00 +56 141 -1.02695629777827e-15 +56 207 -7.80625564189563e-18 +56 237 -2.08333333333333e+00 +57 57 1.41666666666667e+01 +57 158 2.04166666666667e+00 +57 167 1.15847002130076e-16 +57 224 -7.11609319647283e-17 +57 58 4.08333333333333e+00 +57 157 1.04164723721545e-16 +57 166 2.04166666666667e+00 +57 223 -1.93462325152882e-18 +57 59 4.08333333333333e+00 +57 156 2.83333333333333e+00 +57 165 2.83333333333333e+00 +57 222 -7.08333333333333e-01 +57 230 3.46944695195361e-16 +57 227 -4.16666666666667e+00 +57 242 -2.08333333333333e+00 +57 160 -2.22044604925031e-16 +57 229 -4.16666666666667e+00 +57 226 6.24500451351651e-17 +57 241 -2.08333333333333e+00 +57 159 -5.55555555555556e+00 +57 161 -1.11022302462516e-16 +57 228 -4.86111111111111e+00 +57 225 -4.86111111111111e+00 +57 240 -3.47222222222222e+00 +57 308 -3.32850066953050e-17 +57 401 -2.98155597433514e-18 +57 398 8.33333333333333e-02 +57 449 4.16666666666667e-02 +57 307 1.95156391047391e-18 +57 400 8.33333333333334e-02 +57 397 -5.14996031930615e-19 +57 448 4.16666666666667e-02 +57 306 -1.11111111111111e-01 +57 399 -9.72222222222222e-02 +57 396 -9.72222222222223e-02 +57 447 -6.94444444444445e-02 +58 58 1.41666666666667e+01 +58 158 -5.02188893768130e-16 +58 167 -5.92397902650713e-17 +58 224 -4.25000000000000e+00 +58 59 4.25000000000000e+00 +58 157 -5.66666666666667e+00 +58 166 2.83333333333333e+00 +58 223 -4.95833333333333e+00 +58 57 4.08333333333333e+00 +58 156 1.68593437821496e-16 +58 165 2.04166666666667e+00 +58 222 -2.32967941812823e-17 +58 230 1.38777878078145e-17 +58 227 -1.21430643318376e-16 +58 242 -2.08333333333333e+00 +58 160 2.77777777777778e+00 +58 161 2.08333333333333e+00 +58 229 -4.86111111111111e+00 +58 226 -6.94444444444445e-01 +58 241 -3.47222222222222e+00 +58 159 -9.71445146547012e-17 +58 228 -4.16666666666667e+00 +58 225 7.19910242530375e-17 +58 240 -2.08333333333333e+00 +58 308 4.16666666666666e-02 +58 401 1.44198888940572e-17 +58 398 -1.35931847375370e-17 +58 449 -4.16666666666666e-02 +58 307 5.55555555555555e-02 +58 400 -9.72222222222222e-02 +58 397 -1.38888888888889e-02 +58 448 -6.94444444444444e-02 +58 306 0.00000000000000e+00 +58 399 8.33333333333333e-02 +58 396 -1.08420217248550e-18 +58 447 4.16666666666667e-02 +59 59 1.41666666666667e+01 +59 158 2.83333333333333e+00 +59 167 -5.66666666666667e+00 +59 224 -4.95833333333333e+00 +59 58 4.25000000000000e+00 +59 157 -5.48486020599155e-16 +59 166 -5.69788899222601e-16 +59 223 -4.25000000000000e+00 +59 57 4.08333333333333e+00 +59 156 2.04166666666667e+00 +59 165 4.04082149685348e-16 +59 222 -1.58442594981600e-16 +59 161 2.77777777777778e+00 +59 230 -6.94444444444445e-01 +59 227 -4.86111111111111e+00 +59 242 -3.47222222222222e+00 +59 160 2.08333333333333e+00 +59 229 5.29090660172926e-17 +59 226 -4.16333634234434e-17 +59 241 -2.08333333333333e+00 +59 159 -9.71445146547012e-17 +59 228 2.80157841370254e-16 +59 225 -4.16666666666667e+00 +59 240 -2.08333333333333e+00 +59 308 5.55555555555555e-02 +59 401 -1.38888888888889e-02 +59 398 -9.72222222222222e-02 +59 449 -6.94444444444445e-02 +59 307 4.16666666666666e-02 +59 400 1.54092233764502e-17 +59 397 -1.27935856353290e-17 +59 448 -4.16666666666666e-02 +59 306 -3.38271077815477e-17 +59 399 -2.71050543121376e-18 +59 396 8.33333333333333e-02 +59 447 4.16666666666667e-02 +60 60 2.77777777777778e+01 +60 89 -4.16666666666667e+00 +60 65 -1.66967134562768e-17 +60 5 4.55229387172351e-17 +60 175 -2.08333333333333e+00 +60 88 -3.30681662608079e-17 +60 64 -4.16666666666667e+00 +60 4 -2.07407875596477e-16 +60 174 -3.47222222222222e+00 +60 87 -4.86111111111112e+00 +60 63 -4.86111111111111e+00 +60 3 -5.55555555555555e+00 +60 182 0.00000000000000e+00 +60 233 3.64291929955129e-17 +60 173 -3.83807569059869e-17 +60 86 0.00000000000000e+00 +60 71 0.00000000000000e+00 +60 170 4.44089209850063e-16 +60 62 1.77635683940025e-15 +60 2 0.00000000000000e+00 +60 181 0.00000000000000e+00 +60 232 3.38271077815477e-17 +60 172 0.00000000000000e+00 +60 85 0.00000000000000e+00 +60 70 0.00000000000000e+00 +60 169 3.48245737802344e-16 +60 61 -8.88178419700125e-16 +60 1 0.00000000000000e+00 +60 180 0.00000000000000e+00 +60 231 -1.38888888888889e+00 +60 171 5.55555555555556e+00 +60 84 0.00000000000000e+00 +60 69 0.00000000000000e+00 +60 168 5.55555555555556e+00 +60 176 -2.08333333333333e+00 +60 0 0.00000000000000e+00 +61 61 2.77777777777778e+01 +61 89 -1.42247325030098e-16 +61 65 1.02782365951626e-16 +61 5 2.08333333333333e+00 +61 175 -3.47222222222222e+00 +61 88 -6.94444444444445e-01 +61 64 -4.86111111111111e+00 +61 4 2.77777777777778e+00 +61 174 -2.08333333333333e+00 +61 87 1.30104260698261e-17 +61 63 -4.16666666666667e+00 +61 3 -8.68445940160889e-17 +61 182 0.00000000000000e+00 +61 233 -8.33333333333333e+00 +61 173 4.36174533990918e-16 +61 86 0.00000000000000e+00 +61 71 0.00000000000000e+00 +61 170 -7.18283939271647e-17 +61 62 8.33333333333333e+00 +61 2 0.00000000000000e+00 +61 181 0.00000000000000e+00 +61 232 -9.72222222222223e+00 +61 172 5.55555555555556e+00 +61 85 0.00000000000000e+00 +61 70 0.00000000000000e+00 +61 169 -1.11111111111111e+01 +61 176 -2.08333333333333e+00 +61 1 0.00000000000000e+00 +61 180 0.00000000000000e+00 +61 231 7.68699340292223e-17 +61 171 0.00000000000000e+00 +61 84 0.00000000000000e+00 +61 69 0.00000000000000e+00 +61 168 3.00717025066011e-16 +61 60 -8.88178419700125e-16 +61 0 0.00000000000000e+00 +62 62 2.77777777777778e+01 +62 89 -4.86111111111111e+00 +62 65 -6.94444444444444e-01 +62 5 2.77777777777778e+00 +62 175 -2.08333333333333e+00 +62 88 -1.35742111995185e-16 +62 64 1.20563281580388e-16 +62 4 2.08333333333333e+00 +62 174 -2.08333333333333e+00 +62 87 -4.16666666666667e+00 +62 63 -8.06646416329215e-17 +62 3 1.72388145425195e-17 +62 182 0.00000000000000e+00 +62 233 -9.72222222222222e+00 +62 173 -1.11111111111111e+01 +62 86 0.00000000000000e+00 +62 71 0.00000000000000e+00 +62 170 5.55555555555556e+00 +62 176 -3.47222222222222e+00 +62 2 0.00000000000000e+00 +62 181 0.00000000000000e+00 +62 232 -8.33333333333333e+00 +62 172 3.62015105392910e-16 +62 85 0.00000000000000e+00 +62 70 0.00000000000000e+00 +62 169 -1.81603863891322e-16 +62 61 8.33333333333333e+00 +62 1 0.00000000000000e+00 +62 180 0.00000000000000e+00 +62 231 1.75966012594397e-16 +62 171 4.31092336307393e-16 +62 84 0.00000000000000e+00 +62 69 0.00000000000000e+00 +62 168 4.44089209850063e-16 +62 60 1.77635683940025e-15 +62 0 0.00000000000000e+00 +63 63 5.55555555555556e+01 +63 104 8.55435514091063e-17 +63 196 -2.08333333333333e+00 +63 103 -4.16666666666667e+00 +63 195 -3.47222222222222e+00 +63 102 -4.86111111111111e+00 +63 236 -8.33333333333333e+00 +63 191 -2.08333333333333e+00 +63 188 -2.31070588010973e-17 +63 98 4.01154803819637e-18 +63 235 9.81202966099382e-17 +63 190 2.08333333333333e+00 +63 187 2.83112292290277e-16 +63 97 4.16666666666666e+00 +63 234 -9.72222222222223e+00 +63 189 -3.47222222222222e+00 +63 186 -1.11111111111111e+01 +63 96 -4.86111111111111e+00 +63 179 2.08333333333333e+00 +63 92 8.06646416329215e-17 +63 68 -1.01481323344643e-16 +63 20 8.88178419700125e-16 +63 178 2.08333333333333e+00 +63 91 6.15826833971767e-17 +63 67 4.16666666666666e+00 +63 19 -9.25908655302621e-17 +63 177 -3.47222222222222e+00 +63 90 -1.38888888888889e+00 +63 66 -4.86111111111111e+00 +63 18 5.55555555555556e+00 +63 233 8.33333333333333e+00 +63 176 -2.59124319224036e-17 +63 89 7.37257477290143e-17 +63 173 2.08333333333333e+00 +63 170 -1.97758476261356e-16 +63 65 8.88178419700125e-16 +63 5 8.88178419700125e-16 +63 62 -8.06646416329215e-17 +63 232 -8.41340885848751e-17 +63 175 4.44089209850063e-16 +63 88 2.09251019289702e-17 +63 172 -2.08333333333333e+00 +63 169 -3.67761376907083e-16 +63 64 -8.88178419700125e-16 +63 4 -3.43285512863223e-17 +63 61 -4.16666666666667e+00 +63 231 -9.72222222222223e+00 +63 174 1.11111111111111e+01 +63 87 -1.38888888888889e+00 +63 171 -3.47222222222222e+00 +63 168 -1.11111111111111e+01 +63 197 -2.08333333333333e+00 +63 3 5.55555555555556e+00 +63 60 -4.86111111111111e+00 +64 64 5.55555555555556e+01 +64 104 6.96057794735694e-17 +64 196 -3.47222222222222e+00 +64 103 -4.86111111111111e+00 +64 195 -2.08333333333333e+00 +64 102 -4.16666666666667e+00 +64 236 4.24139889876329e-16 +64 191 2.08333333333333e+00 +64 188 1.77635683940025e-15 +64 98 2.18575157973078e-16 +64 235 -1.38888888888889e+00 +64 190 -3.47222222222222e+00 +64 187 5.55555555555556e+00 +64 97 -4.86111111111111e+00 +64 234 6.93889390390723e-18 +64 189 2.08333333333333e+00 +64 186 1.99384779520084e-16 +64 96 4.16666666666667e+00 +64 179 -2.08333333333333e+00 +64 92 -8.33333333333333e+00 +64 68 1.95590071916385e-16 +64 20 -1.18869215685879e-16 +64 178 -3.47222222222222e+00 +64 91 -9.72222222222223e+00 +64 67 -4.86111111111111e+00 +64 19 -1.11111111111111e+01 +64 177 2.08333333333333e+00 +64 90 6.88468379528295e-17 +64 66 4.16666666666666e+00 +64 18 1.95562966862073e-17 +64 233 2.68882138776405e-16 +64 176 -2.39608680119296e-17 +64 89 8.33333333333333e+00 +64 173 2.08333333333333e+00 +64 170 8.88178419700125e-16 +64 65 -2.66453525910038e-15 +64 5 3.72965547335014e-17 +64 62 1.20563281580388e-16 +64 232 -1.38888888888889e+00 +64 175 1.11111111111111e+01 +64 88 -9.72222222222223e+00 +64 172 -3.47222222222222e+00 +64 169 5.55555555555556e+00 +64 197 -2.08333333333333e+00 +64 4 -1.11111111111111e+01 +64 61 -4.86111111111111e+00 +64 231 -1.17202254845683e-16 +64 174 4.44089209850063e-16 +64 87 6.85215773010839e-17 +64 171 -2.08333333333333e+00 +64 168 -4.22838847269347e-16 +64 63 -8.88178419700125e-16 +64 3 1.85398571495021e-17 +64 60 -4.16666666666667e+00 +65 65 5.55555555555556e+01 +65 104 -6.94444444444443e-01 +65 196 -2.08333333333333e+00 +65 103 1.63931368479808e-16 +65 195 -2.08333333333333e+00 +65 102 1.41379963292110e-16 +65 236 -9.72222222222222e+00 +65 191 -3.47222222222222e+00 +65 188 5.55555555555556e+00 +65 98 -6.94444444444444e-01 +65 235 2.38741318381308e-16 +65 190 2.08333333333333e+00 +65 187 1.77635683940025e-15 +65 97 1.48427277413266e-16 +65 234 -8.33333333333333e+00 +65 189 -2.08333333333333e+00 +65 186 -1.14708589848966e-16 +65 96 1.29236898960272e-16 +65 179 -3.47222222222222e+00 +65 92 -9.72222222222222e+00 +65 68 -6.94444444444443e-01 +65 20 5.55555555555556e+00 +65 178 -2.08333333333333e+00 +65 91 -8.33333333333333e+00 +65 67 2.68014777038417e-16 +65 19 2.03938428644523e-16 +65 177 2.08333333333333e+00 +65 90 1.71846044338952e-16 +65 66 -7.91467585914418e-17 +65 18 8.88178419700125e-16 +65 233 -9.72222222222222e+00 +65 176 -2.22222222222222e+01 +65 89 -9.72222222222222e+00 +65 173 -3.47222222222222e+00 +65 170 5.55555555555556e+00 +65 197 -3.47222222222222e+00 +65 5 5.55555555555556e+00 +65 62 -6.94444444444444e-01 +65 232 2.88614618315641e-16 +65 175 2.17260562838939e-16 +65 88 8.33333333333333e+00 +65 172 2.08333333333333e+00 +65 169 8.88178419700125e-16 +65 64 -2.66453525910038e-15 +65 4 -1.18869215685879e-16 +65 61 1.02782365951626e-16 +65 231 8.33333333333333e+00 +65 174 -2.82204272970821e-16 +65 87 2.69749500514394e-16 +65 171 2.08333333333333e+00 +65 168 -1.54729202540838e-16 +65 63 8.88178419700125e-16 +65 3 8.88178419700125e-16 +65 60 3.25260651745651e-18 +66 66 2.77777777777778e+01 +66 182 0.00000000000000e+00 +66 17 0.00000000000000e+00 +66 71 0.00000000000000e+00 +66 94 0.00000000000000e+00 +66 181 0.00000000000000e+00 +66 16 0.00000000000000e+00 +66 70 0.00000000000000e+00 +66 93 0.00000000000000e+00 +66 180 0.00000000000000e+00 +66 15 0.00000000000000e+00 +66 69 0.00000000000000e+00 +66 179 5.96744875736022e-16 +66 92 -4.16666666666667e+00 +66 176 -2.08333333333333e+00 +66 233 3.72965547335014e-17 +66 68 0.00000000000000e+00 +66 20 -8.93382590128056e-17 +66 65 -8.60856524953491e-17 +66 170 4.44089209850063e-16 +66 178 8.88178419700125e-16 +66 91 -3.38271077815477e-17 +66 175 2.08333333333333e+00 +66 232 7.84962372879505e-17 +66 67 -8.88178419700125e-16 +66 19 -2.15539391890118e-16 +66 64 4.16666666666666e+00 +66 169 4.10004604052550e-16 +66 177 5.55555555555556e+00 +66 90 -4.86111111111111e+00 +66 174 -3.47222222222222e+00 +66 231 -1.38888888888889e+00 +66 95 0.00000000000000e+00 +66 18 -5.55555555555555e+00 +66 63 -4.86111111111111e+00 +66 168 5.55555555555556e+00 +67 67 2.77777777777778e+01 +67 182 0.00000000000000e+00 +67 17 0.00000000000000e+00 +67 71 0.00000000000000e+00 +67 94 0.00000000000000e+00 +67 181 0.00000000000000e+00 +67 16 0.00000000000000e+00 +67 70 0.00000000000000e+00 +67 93 0.00000000000000e+00 +67 180 0.00000000000000e+00 +67 15 0.00000000000000e+00 +67 69 0.00000000000000e+00 +67 179 -2.41126563160776e-16 +67 92 -1.80411241501588e-16 +67 176 2.08333333333333e+00 +67 233 8.33333333333333e+00 +67 68 -8.33333333333333e+00 +67 20 -2.08333333333333e+00 +67 65 2.68014777038417e-16 +67 170 4.04407410337093e-17 +67 178 5.55555555555556e+00 +67 91 -6.94444444444445e-01 +67 175 -3.47222222222222e+00 +67 232 -9.72222222222223e+00 +67 95 0.00000000000000e+00 +67 19 2.77777777777778e+00 +67 64 -4.86111111111111e+00 +67 169 -1.11111111111111e+01 +67 177 8.88178419700125e-16 +67 90 -7.63278329429795e-17 +67 174 2.08333333333333e+00 +67 231 1.45716771982052e-16 +67 66 -8.88178419700125e-16 +67 18 -1.72604985859692e-16 +67 63 4.16666666666666e+00 +67 168 3.48245737802344e-16 +68 68 2.77777777777778e+01 +68 182 0.00000000000000e+00 +68 17 0.00000000000000e+00 +68 71 0.00000000000000e+00 +68 94 0.00000000000000e+00 +68 181 0.00000000000000e+00 +68 16 0.00000000000000e+00 +68 70 0.00000000000000e+00 +68 93 0.00000000000000e+00 +68 180 0.00000000000000e+00 +68 15 0.00000000000000e+00 +68 69 0.00000000000000e+00 +68 179 -1.11111111111111e+01 +68 92 -4.86111111111111e+00 +68 176 -3.47222222222222e+00 +68 233 -9.72222222222222e+00 +68 95 0.00000000000000e+00 +68 20 2.77777777777778e+00 +68 65 -6.94444444444443e-01 +68 170 5.55555555555556e+00 +68 178 -5.06322414550731e-17 +68 91 -2.48065457064683e-16 +68 175 2.08333333333333e+00 +68 232 8.33333333333333e+00 +68 67 -8.33333333333333e+00 +68 19 -2.08333333333333e+00 +68 64 1.95590071916385e-16 +68 169 5.30581438160094e-17 +68 177 -6.76542155630955e-17 +68 90 -4.16666666666667e+00 +68 174 -2.08333333333333e+00 +68 231 1.77592315853126e-16 +68 66 0.00000000000000e+00 +68 18 -2.70616862252382e-16 +68 63 -1.00613961606655e-16 +68 168 4.44089209850063e-16 +69 69 1.00000000000000e+00 +69 179 0.00000000000000e+00 +69 17 0.00000000000000e+00 +69 68 0.00000000000000e+00 +69 94 0.00000000000000e+00 +69 178 0.00000000000000e+00 +69 16 0.00000000000000e+00 +69 67 0.00000000000000e+00 +69 93 0.00000000000000e+00 +69 177 0.00000000000000e+00 +69 15 0.00000000000000e+00 +69 66 0.00000000000000e+00 +69 182 0.00000000000000e+00 +69 233 0.00000000000000e+00 +69 173 0.00000000000000e+00 +69 86 0.00000000000000e+00 +69 71 0.00000000000000e+00 +69 170 0.00000000000000e+00 +69 62 0.00000000000000e+00 +69 2 0.00000000000000e+00 +69 181 0.00000000000000e+00 +69 232 0.00000000000000e+00 +69 172 0.00000000000000e+00 +69 85 0.00000000000000e+00 +69 70 0.00000000000000e+00 +69 169 0.00000000000000e+00 +69 61 0.00000000000000e+00 +69 1 0.00000000000000e+00 +69 180 0.00000000000000e+00 +69 231 0.00000000000000e+00 +69 171 0.00000000000000e+00 +69 84 0.00000000000000e+00 +69 95 0.00000000000000e+00 +69 168 0.00000000000000e+00 +69 60 0.00000000000000e+00 +69 0 0.00000000000000e+00 +70 70 1.00000000000000e+00 +70 179 0.00000000000000e+00 +70 17 0.00000000000000e+00 +70 68 0.00000000000000e+00 +70 94 0.00000000000000e+00 +70 178 0.00000000000000e+00 +70 16 0.00000000000000e+00 +70 67 0.00000000000000e+00 +70 93 0.00000000000000e+00 +70 177 0.00000000000000e+00 +70 15 0.00000000000000e+00 +70 66 0.00000000000000e+00 +70 182 0.00000000000000e+00 +70 233 0.00000000000000e+00 +70 173 0.00000000000000e+00 +70 86 0.00000000000000e+00 +70 71 0.00000000000000e+00 +70 170 0.00000000000000e+00 +70 62 0.00000000000000e+00 +70 2 0.00000000000000e+00 +70 181 0.00000000000000e+00 +70 232 0.00000000000000e+00 +70 172 0.00000000000000e+00 +70 85 0.00000000000000e+00 +70 95 0.00000000000000e+00 +70 169 0.00000000000000e+00 +70 61 0.00000000000000e+00 +70 1 0.00000000000000e+00 +70 180 0.00000000000000e+00 +70 231 0.00000000000000e+00 +70 171 0.00000000000000e+00 +70 84 0.00000000000000e+00 +70 69 0.00000000000000e+00 +70 168 0.00000000000000e+00 +70 60 0.00000000000000e+00 +70 0 0.00000000000000e+00 +71 71 1.00000000000000e+00 +71 179 0.00000000000000e+00 +71 17 0.00000000000000e+00 +71 68 0.00000000000000e+00 +71 94 0.00000000000000e+00 +71 178 0.00000000000000e+00 +71 16 0.00000000000000e+00 +71 67 0.00000000000000e+00 +71 93 0.00000000000000e+00 +71 177 0.00000000000000e+00 +71 15 0.00000000000000e+00 +71 66 0.00000000000000e+00 +71 182 0.00000000000000e+00 +71 233 0.00000000000000e+00 +71 173 0.00000000000000e+00 +71 86 0.00000000000000e+00 +71 95 0.00000000000000e+00 +71 170 0.00000000000000e+00 +71 62 0.00000000000000e+00 +71 2 0.00000000000000e+00 +71 181 0.00000000000000e+00 +71 232 0.00000000000000e+00 +71 172 0.00000000000000e+00 +71 85 0.00000000000000e+00 +71 70 0.00000000000000e+00 +71 169 0.00000000000000e+00 +71 61 0.00000000000000e+00 +71 1 0.00000000000000e+00 +71 180 0.00000000000000e+00 +71 231 0.00000000000000e+00 +71 171 0.00000000000000e+00 +71 84 0.00000000000000e+00 +71 69 0.00000000000000e+00 +71 168 0.00000000000000e+00 +71 60 0.00000000000000e+00 +71 0 0.00000000000000e+00 +72 72 2.77777777777778e+01 +72 35 -2.07082614944731e-17 +72 176 2.08333333333333e+00 +72 89 4.16666666666667e+00 +72 76 -4.16666666666667e+00 +72 34 -2.13370987545147e-16 +72 175 -2.08333333333333e+00 +72 88 -4.08744219027035e-17 +72 75 -4.86111111111111e+00 +72 33 -5.55555555555556e+00 +72 174 -3.47222222222222e+00 +72 87 -4.86111111111112e+00 +72 83 0.00000000000000e+00 +72 185 8.88178419700125e-16 +72 74 0.00000000000000e+00 +72 32 0.00000000000000e+00 +72 182 0.00000000000000e+00 +72 233 1.77700736070374e-16 +72 173 4.31078783780237e-16 +72 86 0.00000000000000e+00 +72 82 0.00000000000000e+00 +72 184 2.77555756156289e-17 +72 73 8.88178419700125e-16 +72 31 0.00000000000000e+00 +72 181 0.00000000000000e+00 +72 232 1.45716771982052e-16 +72 172 -4.44089209850063e-16 +72 85 0.00000000000000e+00 +72 81 0.00000000000000e+00 +72 183 5.55555555555556e+00 +72 77 -3.64291929955129e-17 +72 30 0.00000000000000e+00 +72 180 0.00000000000000e+00 +72 231 -1.38888888888889e+00 +72 171 5.55555555555556e+00 +72 84 0.00000000000000e+00 +73 73 2.77777777777778e+01 +73 35 -2.08333333333333e+00 +73 176 2.08333333333333e+00 +73 89 1.29995840481012e-16 +73 76 -4.86111111111111e+00 +73 34 2.77777777777778e+00 +73 175 -3.47222222222222e+00 +73 88 -6.94444444444445e-01 +73 75 -4.16666666666667e+00 +73 33 -2.28983498828939e-16 +73 174 -2.08333333333333e+00 +73 87 -6.93889390390723e-18 +73 83 0.00000000000000e+00 +73 185 -9.67108337857070e-17 +73 74 -8.33333333333333e+00 +73 32 0.00000000000000e+00 +73 182 0.00000000000000e+00 +73 233 8.33333333333333e+00 +73 173 2.50979250403238e-16 +73 86 0.00000000000000e+00 +73 82 0.00000000000000e+00 +73 184 -1.11111111111111e+01 +73 77 1.90819582357449e-17 +73 31 0.00000000000000e+00 +73 181 0.00000000000000e+00 +73 232 -9.72222222222223e+00 +73 172 5.55555555555556e+00 +73 85 0.00000000000000e+00 +73 81 0.00000000000000e+00 +73 183 1.38777878078145e-16 +73 72 8.88178419700125e-16 +73 30 0.00000000000000e+00 +73 180 0.00000000000000e+00 +73 231 7.83878170707020e-17 +73 171 0.00000000000000e+00 +73 84 0.00000000000000e+00 +74 74 2.77777777777778e+01 +74 35 2.77777777777778e+00 +74 176 -3.47222222222222e+00 +74 89 -4.86111111111111e+00 +74 76 -2.08166817117217e-17 +74 34 -2.08333333333333e+00 +74 175 2.08333333333333e+00 +74 88 1.50920942409982e-16 +74 75 -1.04083408558608e-16 +74 33 2.34187669256869e-17 +74 174 2.08333333333333e+00 +74 87 4.16666666666667e+00 +74 83 0.00000000000000e+00 +74 185 5.55555555555556e+00 +74 77 -6.94444444444445e-01 +74 32 0.00000000000000e+00 +74 182 0.00000000000000e+00 +74 233 -9.72222222222222e+00 +74 173 -1.11111111111111e+01 +74 86 0.00000000000000e+00 +74 82 0.00000000000000e+00 +74 184 -2.31585584042904e-16 +74 73 -8.33333333333333e+00 +74 31 0.00000000000000e+00 +74 181 0.00000000000000e+00 +74 232 8.33333333333333e+00 +74 172 4.91685685222176e-16 +74 85 0.00000000000000e+00 +74 81 0.00000000000000e+00 +74 183 8.88178419700125e-16 +74 72 0.00000000000000e+00 +74 30 0.00000000000000e+00 +74 180 0.00000000000000e+00 +74 231 3.72965547335014e-17 +74 171 -3.83807569059869e-17 +74 84 0.00000000000000e+00 +75 75 5.55555555555556e+01 +75 197 2.08333333333333e+00 +75 112 -4.16666666666667e+00 +75 196 -2.08333333333333e+00 +75 111 -4.86111111111111e+00 +75 195 -3.47222222222222e+00 +75 200 -1.24791670053082e-16 +75 107 -2.42861286636753e-17 +75 236 8.33333333333333e+00 +75 191 2.08333333333333e+00 +75 199 2.81025203108243e-16 +75 106 4.16666666666667e+00 +75 235 6.41847686111419e-17 +75 190 2.08333333333333e+00 +75 198 -1.11111111111111e+01 +75 105 -4.86111111111111e+00 +75 234 -9.72222222222223e+00 +75 189 -3.47222222222222e+00 +75 80 -1.11022302462516e-16 +75 50 8.88178419700125e-16 +75 179 -2.08333333333333e+00 +75 92 5.45353692760209e-17 +75 79 4.16666666666667e+00 +75 49 7.63278329429795e-17 +75 178 2.08333333333333e+00 +75 91 5.46437894932694e-17 +75 78 -4.86111111111111e+00 +75 48 5.55555555555556e+00 +75 177 -3.47222222222222e+00 +75 90 -1.38888888888889e+00 +75 185 -1.97758476261356e-16 +75 77 -8.88178419700125e-16 +75 35 8.88178419700125e-16 +75 74 -1.04083408558608e-16 +75 233 -8.33333333333333e+00 +75 176 2.25093923535147e-16 +75 89 2.83735708539457e-16 +75 173 -2.08333333333333e+00 +75 184 -3.95516952522712e-16 +75 76 0.00000000000000e+00 +75 34 2.41126563160776e-16 +75 73 -4.16666666666667e+00 +75 232 -7.71951946809679e-17 +75 175 4.44089209850063e-16 +75 88 6.88468379528295e-17 +75 172 -2.08333333333333e+00 +75 183 -1.11111111111111e+01 +75 113 7.45931094670027e-17 +75 33 5.55555555555556e+00 +75 72 -4.86111111111111e+00 +75 231 -9.72222222222223e+00 +75 174 1.11111111111111e+01 +75 87 -1.38888888888889e+00 +75 171 -3.47222222222222e+00 +76 76 5.55555555555556e+01 +76 197 2.08333333333333e+00 +76 112 -4.86111111111111e+00 +76 196 -3.47222222222222e+00 +76 111 -4.16666666666667e+00 +76 195 -2.08333333333333e+00 +76 200 8.88178419700125e-16 +76 107 2.08166817117217e-17 +76 236 -3.03034507209698e-16 +76 191 -2.08333333333333e+00 +76 199 5.55555555555556e+00 +76 106 -4.86111111111111e+00 +76 235 -1.38888888888889e+00 +76 190 -3.47222222222222e+00 +76 198 2.35922392732846e-16 +76 105 4.16666666666667e+00 +76 234 -1.21430643318376e-17 +76 189 2.08333333333333e+00 +76 80 2.10768902331182e-16 +76 50 2.89807240705375e-16 +76 179 2.08333333333333e+00 +76 92 8.33333333333333e+00 +76 79 -4.86111111111111e+00 +76 49 -1.11111111111111e+01 +76 178 -3.47222222222222e+00 +76 91 -9.72222222222223e+00 +76 78 4.16666666666667e+00 +76 48 6.76542155630955e-17 +76 177 2.08333333333333e+00 +76 90 9.75781955236954e-19 +76 185 4.44089209850063e-16 +76 77 0.00000000000000e+00 +76 35 -2.60208521396521e-17 +76 74 -2.08166817117217e-17 +76 233 -3.83048627539129e-16 +76 176 2.14644925097818e-16 +76 89 -8.33333333333333e+00 +76 173 -2.08333333333333e+00 +76 184 5.55555555555556e+00 +76 113 7.63278329429795e-17 +76 34 -1.11111111111111e+01 +76 73 -4.86111111111111e+00 +76 232 -1.38888888888889e+00 +76 175 1.11111111111111e+01 +76 88 -9.72222222222223e+00 +76 172 -3.47222222222222e+00 +76 183 -4.90926743701436e-16 +76 75 0.00000000000000e+00 +76 33 3.53883589099269e-16 +76 72 -4.16666666666667e+00 +76 231 -1.02457105299880e-16 +76 174 4.44089209850063e-16 +76 87 4.77048955893622e-17 +76 171 -2.08333333333333e+00 +77 77 5.55555555555556e+01 +77 197 -3.47222222222222e+00 +77 112 3.46944695195361e-17 +77 196 2.08333333333333e+00 +77 111 6.93889390390723e-18 +77 195 2.08333333333333e+00 +77 200 5.55555555555556e+00 +77 107 -6.94444444444445e-01 +77 236 -9.72222222222222e+00 +77 191 -3.47222222222222e+00 +77 199 0.00000000000000e+00 +77 106 1.17961196366423e-16 +77 235 -1.60461921527855e-16 +77 190 -2.08333333333333e+00 +77 198 -2.54136989230602e-16 +77 105 -1.24900090270330e-16 +77 234 8.33333333333333e+00 +77 189 2.08333333333333e+00 +77 80 -6.94444444444444e-01 +77 50 5.55555555555556e+00 +77 179 -3.47222222222222e+00 +77 92 -9.72222222222222e+00 +77 79 2.49800180540660e-16 +77 49 1.68268177169750e-16 +77 178 2.08333333333333e+00 +77 91 8.33333333333333e+00 +77 78 -9.88792381306780e-17 +77 48 8.88178419700125e-16 +77 177 -2.08333333333333e+00 +77 90 8.84708972748172e-17 +77 185 5.55555555555556e+00 +77 113 -6.94444444444445e-01 +77 35 5.55555555555556e+00 +77 74 -6.94444444444445e-01 +77 233 -9.72222222222222e+00 +77 176 -2.22222222222222e+01 +77 89 -9.72222222222222e+00 +77 173 -3.47222222222222e+00 +77 184 8.88178419700125e-16 +77 76 0.00000000000000e+00 +77 34 -5.37764277552810e-17 +77 73 1.90819582357449e-17 +77 232 -2.68014777038417e-16 +77 175 1.70328161297473e-16 +77 88 -8.33333333333333e+00 +77 172 -2.08333333333333e+00 +77 183 -2.00143721040824e-16 +77 75 -8.88178419700125e-16 +77 33 8.88178419700125e-16 +77 72 -3.72965547335014e-17 +77 231 -8.33333333333333e+00 +77 174 2.52402265754625e-16 +77 87 8.06646416329215e-17 +77 171 -2.08333333333333e+00 +78 78 2.77777777777778e+01 +78 83 0.00000000000000e+00 +78 95 0.00000000000000e+00 +78 182 0.00000000000000e+00 +78 46 0.00000000000000e+00 +78 82 0.00000000000000e+00 +78 94 0.00000000000000e+00 +78 181 0.00000000000000e+00 +78 45 0.00000000000000e+00 +78 81 0.00000000000000e+00 +78 93 0.00000000000000e+00 +78 180 0.00000000000000e+00 +78 80 -8.88178419700125e-16 +78 50 -1.80411241501588e-16 +78 77 -7.11236625150491e-17 +78 185 8.88178419700125e-16 +78 179 -6.76542155630955e-17 +78 92 4.16666666666667e+00 +78 176 2.08333333333333e+00 +78 233 6.49437101318817e-17 +78 79 -8.88178419700125e-16 +78 49 -2.15105711021124e-16 +78 76 4.16666666666667e+00 +78 184 1.38777878078145e-16 +78 178 8.88178419700125e-16 +78 91 -9.02056207507940e-17 +78 175 2.08333333333333e+00 +78 232 7.67615138119737e-17 +78 47 0.00000000000000e+00 +78 48 -5.55555555555556e+00 +78 75 -4.86111111111111e+00 +78 183 5.55555555555556e+00 +78 177 5.55555555555556e+00 +78 90 -4.86111111111111e+00 +78 174 -3.47222222222222e+00 +78 231 -1.38888888888889e+00 +79 79 2.77777777777778e+01 +79 83 0.00000000000000e+00 +79 95 0.00000000000000e+00 +79 182 0.00000000000000e+00 +79 46 0.00000000000000e+00 +79 82 0.00000000000000e+00 +79 94 0.00000000000000e+00 +79 181 0.00000000000000e+00 +79 45 0.00000000000000e+00 +79 81 0.00000000000000e+00 +79 93 0.00000000000000e+00 +79 180 0.00000000000000e+00 +79 80 8.33333333333333e+00 +79 50 2.08333333333333e+00 +79 77 1.94289029309402e-16 +79 185 2.12503625807159e-16 +79 179 -4.35849273339173e-17 +79 92 1.04950770296597e-16 +79 176 -2.08333333333333e+00 +79 233 -8.33333333333333e+00 +79 47 0.00000000000000e+00 +79 49 2.77777777777778e+00 +79 76 -4.86111111111111e+00 +79 184 -1.11111111111111e+01 +79 178 5.55555555555556e+00 +79 91 -6.94444444444445e-01 +79 175 -3.47222222222222e+00 +79 232 -9.72222222222223e+00 +79 78 0.00000000000000e+00 +79 48 -1.66533453693773e-16 +79 75 4.16666666666667e+00 +79 183 2.77555756156289e-17 +79 177 8.88178419700125e-16 +79 90 -1.04083408558608e-16 +79 174 2.08333333333333e+00 +79 231 3.38271077815477e-17 +80 80 2.77777777777778e+01 +80 83 0.00000000000000e+00 +80 95 0.00000000000000e+00 +80 182 0.00000000000000e+00 +80 46 0.00000000000000e+00 +80 82 0.00000000000000e+00 +80 94 0.00000000000000e+00 +80 181 0.00000000000000e+00 +80 45 0.00000000000000e+00 +80 81 0.00000000000000e+00 +80 93 0.00000000000000e+00 +80 180 0.00000000000000e+00 +80 47 0.00000000000000e+00 +80 50 2.77777777777778e+00 +80 77 -6.94444444444444e-01 +80 185 5.55555555555556e+00 +80 179 -1.11111111111111e+01 +80 92 -4.86111111111111e+00 +80 176 -3.47222222222222e+00 +80 233 -9.72222222222222e+00 +80 79 8.33333333333333e+00 +80 49 2.08333333333333e+00 +80 76 2.11636264069170e-16 +80 184 2.13587827979644e-17 +80 178 -2.41126563160776e-16 +80 91 1.11022302462516e-16 +80 175 -2.08333333333333e+00 +80 232 -8.33333333333333e+00 +80 78 -8.88178419700125e-16 +80 48 -2.22044604925031e-16 +80 75 -1.17961196366423e-16 +80 183 8.88178419700125e-16 +80 177 5.96744875736022e-16 +80 90 4.16666666666667e+00 +80 174 2.08333333333333e+00 +80 231 -7.45931094670027e-17 +81 81 1.00000000000000e+00 +81 80 0.00000000000000e+00 +81 95 0.00000000000000e+00 +81 179 0.00000000000000e+00 +81 46 0.00000000000000e+00 +81 79 0.00000000000000e+00 +81 94 0.00000000000000e+00 +81 178 0.00000000000000e+00 +81 45 0.00000000000000e+00 +81 78 0.00000000000000e+00 +81 93 0.00000000000000e+00 +81 177 0.00000000000000e+00 +81 83 0.00000000000000e+00 +81 185 0.00000000000000e+00 +81 74 0.00000000000000e+00 +81 32 0.00000000000000e+00 +81 182 0.00000000000000e+00 +81 233 0.00000000000000e+00 +81 173 0.00000000000000e+00 +81 86 0.00000000000000e+00 +81 82 0.00000000000000e+00 +81 184 0.00000000000000e+00 +81 73 0.00000000000000e+00 +81 31 0.00000000000000e+00 +81 181 0.00000000000000e+00 +81 232 0.00000000000000e+00 +81 172 0.00000000000000e+00 +81 85 0.00000000000000e+00 +81 47 0.00000000000000e+00 +81 183 0.00000000000000e+00 +81 72 0.00000000000000e+00 +81 30 0.00000000000000e+00 +81 180 0.00000000000000e+00 +81 231 0.00000000000000e+00 +81 171 0.00000000000000e+00 +81 84 0.00000000000000e+00 +82 82 1.00000000000000e+00 +82 80 0.00000000000000e+00 +82 95 0.00000000000000e+00 +82 179 0.00000000000000e+00 +82 46 0.00000000000000e+00 +82 79 0.00000000000000e+00 +82 94 0.00000000000000e+00 +82 178 0.00000000000000e+00 +82 45 0.00000000000000e+00 +82 78 0.00000000000000e+00 +82 93 0.00000000000000e+00 +82 177 0.00000000000000e+00 +82 83 0.00000000000000e+00 +82 185 0.00000000000000e+00 +82 74 0.00000000000000e+00 +82 32 0.00000000000000e+00 +82 182 0.00000000000000e+00 +82 233 0.00000000000000e+00 +82 173 0.00000000000000e+00 +82 86 0.00000000000000e+00 +82 47 0.00000000000000e+00 +82 184 0.00000000000000e+00 +82 73 0.00000000000000e+00 +82 31 0.00000000000000e+00 +82 181 0.00000000000000e+00 +82 232 0.00000000000000e+00 +82 172 0.00000000000000e+00 +82 85 0.00000000000000e+00 +82 81 0.00000000000000e+00 +82 183 0.00000000000000e+00 +82 72 0.00000000000000e+00 +82 30 0.00000000000000e+00 +82 180 0.00000000000000e+00 +82 231 0.00000000000000e+00 +82 171 0.00000000000000e+00 +82 84 0.00000000000000e+00 +83 83 1.00000000000000e+00 +83 80 0.00000000000000e+00 +83 95 0.00000000000000e+00 +83 179 0.00000000000000e+00 +83 46 0.00000000000000e+00 +83 79 0.00000000000000e+00 +83 94 0.00000000000000e+00 +83 178 0.00000000000000e+00 +83 45 0.00000000000000e+00 +83 78 0.00000000000000e+00 +83 93 0.00000000000000e+00 +83 177 0.00000000000000e+00 +83 47 0.00000000000000e+00 +83 185 0.00000000000000e+00 +83 74 0.00000000000000e+00 +83 32 0.00000000000000e+00 +83 182 0.00000000000000e+00 +83 233 0.00000000000000e+00 +83 173 0.00000000000000e+00 +83 86 0.00000000000000e+00 +83 82 0.00000000000000e+00 +83 184 0.00000000000000e+00 +83 73 0.00000000000000e+00 +83 31 0.00000000000000e+00 +83 181 0.00000000000000e+00 +83 232 0.00000000000000e+00 +83 172 0.00000000000000e+00 +83 85 0.00000000000000e+00 +83 81 0.00000000000000e+00 +83 183 0.00000000000000e+00 +83 72 0.00000000000000e+00 +83 30 0.00000000000000e+00 +83 180 0.00000000000000e+00 +83 231 0.00000000000000e+00 +83 171 0.00000000000000e+00 +83 84 0.00000000000000e+00 +84 84 1.00000000000000e+00 +84 185 0.00000000000000e+00 +84 74 0.00000000000000e+00 +84 32 0.00000000000000e+00 +84 82 0.00000000000000e+00 +84 184 0.00000000000000e+00 +84 73 0.00000000000000e+00 +84 31 0.00000000000000e+00 +84 81 0.00000000000000e+00 +84 183 0.00000000000000e+00 +84 72 0.00000000000000e+00 +84 30 0.00000000000000e+00 +84 182 0.00000000000000e+00 +84 233 0.00000000000000e+00 +84 173 0.00000000000000e+00 +84 86 0.00000000000000e+00 +84 71 0.00000000000000e+00 +84 170 0.00000000000000e+00 +84 62 0.00000000000000e+00 +84 2 0.00000000000000e+00 +84 181 0.00000000000000e+00 +84 232 0.00000000000000e+00 +84 172 0.00000000000000e+00 +84 85 0.00000000000000e+00 +84 70 0.00000000000000e+00 +84 169 0.00000000000000e+00 +84 61 0.00000000000000e+00 +84 1 0.00000000000000e+00 +84 180 0.00000000000000e+00 +84 231 0.00000000000000e+00 +84 171 0.00000000000000e+00 +84 83 0.00000000000000e+00 +84 69 0.00000000000000e+00 +84 168 0.00000000000000e+00 +84 60 0.00000000000000e+00 +84 0 0.00000000000000e+00 +85 85 1.00000000000000e+00 +85 185 0.00000000000000e+00 +85 74 0.00000000000000e+00 +85 32 0.00000000000000e+00 +85 82 0.00000000000000e+00 +85 184 0.00000000000000e+00 +85 73 0.00000000000000e+00 +85 31 0.00000000000000e+00 +85 81 0.00000000000000e+00 +85 183 0.00000000000000e+00 +85 72 0.00000000000000e+00 +85 30 0.00000000000000e+00 +85 182 0.00000000000000e+00 +85 233 0.00000000000000e+00 +85 173 0.00000000000000e+00 +85 86 0.00000000000000e+00 +85 71 0.00000000000000e+00 +85 170 0.00000000000000e+00 +85 62 0.00000000000000e+00 +85 2 0.00000000000000e+00 +85 181 0.00000000000000e+00 +85 232 0.00000000000000e+00 +85 172 0.00000000000000e+00 +85 83 0.00000000000000e+00 +85 70 0.00000000000000e+00 +85 169 0.00000000000000e+00 +85 61 0.00000000000000e+00 +85 1 0.00000000000000e+00 +85 180 0.00000000000000e+00 +85 231 0.00000000000000e+00 +85 171 0.00000000000000e+00 +85 84 0.00000000000000e+00 +85 69 0.00000000000000e+00 +85 168 0.00000000000000e+00 +85 60 0.00000000000000e+00 +85 0 0.00000000000000e+00 +86 86 1.00000000000000e+00 +86 185 0.00000000000000e+00 +86 74 0.00000000000000e+00 +86 32 0.00000000000000e+00 +86 82 0.00000000000000e+00 +86 184 0.00000000000000e+00 +86 73 0.00000000000000e+00 +86 31 0.00000000000000e+00 +86 81 0.00000000000000e+00 +86 183 0.00000000000000e+00 +86 72 0.00000000000000e+00 +86 30 0.00000000000000e+00 +86 182 0.00000000000000e+00 +86 233 0.00000000000000e+00 +86 173 0.00000000000000e+00 +86 83 0.00000000000000e+00 +86 71 0.00000000000000e+00 +86 170 0.00000000000000e+00 +86 62 0.00000000000000e+00 +86 2 0.00000000000000e+00 +86 181 0.00000000000000e+00 +86 232 0.00000000000000e+00 +86 172 0.00000000000000e+00 +86 85 0.00000000000000e+00 +86 70 0.00000000000000e+00 +86 169 0.00000000000000e+00 +86 61 0.00000000000000e+00 +86 1 0.00000000000000e+00 +86 180 0.00000000000000e+00 +86 231 0.00000000000000e+00 +86 171 0.00000000000000e+00 +86 84 0.00000000000000e+00 +86 69 0.00000000000000e+00 +86 168 0.00000000000000e+00 +86 60 0.00000000000000e+00 +86 0 0.00000000000000e+00 +87 87 5.55555555555556e+01 +87 107 -4.16666666666667e+00 +87 199 -2.08333333333333e+00 +87 106 3.39355279987963e-17 +87 198 -3.47222222222222e+00 +87 105 -4.86111111111111e+00 +87 236 -7.26415455565288e-18 +87 191 4.14029704617902e-16 +87 188 2.08333333333333e+00 +87 98 4.16666666666667e+00 +87 235 -8.33333333333333e+00 +87 190 4.24709096016884e-16 +87 187 -2.08333333333333e+00 +87 97 6.93889390390723e-17 +87 234 -9.72222222222222e+00 +87 189 -1.11111111111111e+01 +87 186 -3.47222222222222e+00 +87 96 -4.86111111111111e+00 +87 185 2.08333333333333e+00 +87 77 1.92554305833426e-16 +87 35 -1.50812522192734e-16 +87 74 4.16666666666667e+00 +87 184 2.08333333333333e+00 +87 76 4.77048955893622e-17 +87 34 -4.44089209850063e-16 +87 73 -8.67361737988404e-19 +87 183 -3.47222222222222e+00 +87 75 -1.38888888888889e+00 +87 33 5.55555555555556e+00 +87 72 -4.86111111111112e+00 +87 233 -2.05564731903252e-16 +87 176 1.77635683940025e-15 +87 89 0.00000000000000e+00 +87 173 -6.93889390390723e-17 +87 170 -2.08333333333333e+00 +87 65 1.65666091955785e-16 +87 5 -6.99174875981590e-17 +87 62 -4.16666666666667e+00 +87 232 8.33333333333333e+00 +87 175 -1.62630325872826e-17 +87 88 -1.77635683940025e-15 +87 172 -4.26741975090295e-16 +87 169 2.08333333333333e+00 +87 64 5.46437894932694e-17 +87 4 -4.44089209850063e-16 +87 61 1.30104260698261e-17 +87 231 -9.72222222222222e+00 +87 174 1.11111111111111e+01 +87 200 -2.08333333333333e+00 +87 171 -1.11111111111111e+01 +87 168 -3.47222222222222e+00 +87 63 -1.38888888888889e+00 +87 3 5.55555555555556e+00 +87 60 -4.86111111111112e+00 +88 88 5.55555555555556e+01 +88 107 3.13984949151802e-16 +88 199 -3.47222222222222e+00 +88 106 -6.94444444444445e-01 +88 198 -2.08333333333333e+00 +88 105 5.55111512312578e-17 +88 236 1.44849410244063e-16 +88 191 8.88178419700125e-16 +88 188 2.08333333333333e+00 +88 98 -1.23599047663348e-17 +88 235 -9.72222222222222e+00 +88 190 5.55555555555556e+00 +88 187 -3.47222222222222e+00 +88 97 -6.94444444444445e-01 +88 234 -8.33333333333333e+00 +88 189 4.87348876532234e-16 +88 186 -2.08333333333333e+00 +88 96 5.03069808033274e-17 +88 185 -2.08333333333333e+00 +88 77 -8.33333333333333e+00 +88 35 2.73652628335341e-16 +88 74 1.50920942409982e-16 +88 184 -3.47222222222222e+00 +88 76 -9.72222222222223e+00 +88 34 5.55555555555556e+00 +88 73 -6.94444444444445e-01 +88 183 2.08333333333333e+00 +88 75 6.88468379528295e-17 +88 33 -4.44089209850063e-16 +88 72 -4.08744219027035e-17 +88 233 4.01913745340376e-16 +88 176 -6.59737021957429e-17 +88 89 -2.66453525910038e-15 +88 173 0.00000000000000e+00 +88 170 2.08333333333333e+00 +88 65 8.33333333333333e+00 +88 5 3.33798743853975e-17 +88 62 -1.35742111995185e-16 +88 232 -9.72222222222222e+00 +88 175 -2.22222222222222e+01 +88 200 -2.08333333333333e+00 +88 172 5.55555555555556e+00 +88 169 -3.47222222222222e+00 +88 64 -9.72222222222223e+00 +88 4 5.55555555555556e+00 +88 61 -6.94444444444445e-01 +88 231 8.33333333333333e+00 +88 174 9.07748268913489e-17 +88 87 -8.88178419700125e-16 +88 171 -4.22296746183104e-16 +88 168 2.08333333333333e+00 +88 63 2.16840434497101e-19 +88 3 -4.44089209850063e-16 +88 60 -3.39355279987963e-17 +89 89 5.55555555555556e+01 +89 107 -4.86111111111111e+00 +89 199 -2.08333333333333e+00 +89 106 2.53486467927111e-16 +89 198 -2.08333333333333e+00 +89 105 -4.16666666666667e+00 +89 236 -1.38888888888889e+00 +89 191 5.55555555555556e+00 +89 188 -3.47222222222222e+00 +89 98 -4.86111111111111e+00 +89 235 1.98625837999344e-16 +89 190 8.88178419700125e-16 +89 187 2.08333333333333e+00 +89 97 -2.16840434497101e-17 +89 234 1.48318857196017e-16 +89 189 2.91216703529606e-16 +89 186 2.08333333333333e+00 +89 96 4.16666666666667e+00 +89 185 -3.47222222222222e+00 +89 77 -9.72222222222222e+00 +89 35 -1.11111111111111e+01 +89 74 -4.86111111111111e+00 +89 184 -2.08333333333333e+00 +89 76 -8.33333333333333e+00 +89 34 3.33798743853975e-17 +89 73 7.44846892497542e-17 +89 183 2.08333333333333e+00 +89 75 1.72713406076941e-16 +89 33 -5.13884724703817e-16 +89 72 4.16666666666666e+00 +89 233 -1.38888888888889e+00 +89 176 1.11111111111111e+01 +89 200 -3.47222222222222e+00 +89 173 5.55555555555556e+00 +89 170 -3.47222222222222e+00 +89 65 -9.72222222222222e+00 +89 5 -1.11111111111111e+01 +89 62 -4.86111111111111e+00 +89 232 4.06792655116561e-16 +89 175 -7.19910242530375e-17 +89 88 -2.66453525910038e-15 +89 172 0.00000000000000e+00 +89 169 2.08333333333333e+00 +89 64 8.33333333333333e+00 +89 4 2.18141477104083e-16 +89 61 -8.67361737988404e-17 +89 231 -3.92481186439753e-17 +89 174 1.77635683940025e-15 +89 87 -8.88178419700125e-16 +89 171 -8.52318432845167e-17 +89 168 -2.08333333333333e+00 +89 63 8.84708972748172e-17 +89 3 -3.97902197302180e-17 +89 60 -4.16666666666667e+00 +90 90 5.55555555555556e+01 +90 200 -2.08333333333333e+00 +90 112 6.59194920871187e-17 +90 199 2.08333333333333e+00 +90 111 -4.86111111111111e+00 +90 198 -3.47222222222222e+00 +90 197 -3.39138439553466e-16 +90 236 -1.86808034319252e-16 +90 104 4.16666666666667e+00 +90 188 2.08333333333333e+00 +90 196 1.36934734384919e-16 +90 235 8.33333333333333e+00 +90 103 2.25514051876985e-17 +90 187 2.08333333333333e+00 +90 195 -1.11111111111111e+01 +90 234 -9.72222222222222e+00 +90 102 -4.86111111111111e+00 +90 186 -3.47222222222222e+00 +90 80 4.16666666666667e+00 +90 50 1.24900090270330e-16 +90 77 7.37257477290143e-17 +90 185 2.08333333333333e+00 +90 79 -1.04083408558608e-16 +90 49 8.88178419700125e-16 +90 76 2.17924636669586e-17 +90 184 -2.08333333333333e+00 +90 78 -4.86111111111111e+00 +90 48 5.55555555555556e+00 +90 75 -1.38888888888889e+00 +90 183 -3.47222222222222e+00 +90 179 -4.37150315946155e-16 +90 92 0.00000000000000e+00 +90 176 1.77635683940025e-15 +90 233 2.66280053562440e-16 +90 68 -4.16666666666667e+00 +90 20 2.94902990916057e-16 +90 65 1.71846044338952e-16 +90 170 -2.08333333333333e+00 +90 178 -3.38271077815477e-16 +90 91 0.00000000000000e+00 +90 175 2.08627603040523e-16 +90 232 -8.33333333333333e+00 +90 67 -9.02056207507940e-17 +90 19 8.88178419700125e-16 +90 64 8.27246257606440e-17 +90 169 -2.08333333333333e+00 +90 177 -1.11111111111111e+01 +90 113 -4.16666666666667e+00 +90 174 1.11111111111111e+01 +90 231 -9.72222222222222e+00 +90 66 -4.86111111111111e+00 +90 18 5.55555555555556e+00 +90 63 -1.38888888888889e+00 +90 168 -3.47222222222222e+00 +91 91 5.55555555555556e+01 +91 200 2.08333333333333e+00 +91 112 -6.94444444444445e-01 +91 199 -3.47222222222222e+00 +91 111 -4.85722573273506e-17 +91 198 2.08333333333333e+00 +91 197 1.77635683940025e-15 +91 236 4.05925293378573e-16 +91 104 -2.91433543964104e-16 +91 188 -2.08333333333333e+00 +91 196 5.55555555555556e+00 +91 235 -9.72222222222222e+00 +91 103 -6.94444444444444e-01 +91 187 -3.47222222222222e+00 +91 195 -5.46437894932694e-17 +91 234 8.33333333333333e+00 +91 102 -4.16333634234434e-17 +91 186 2.08333333333333e+00 +91 80 1.17961196366423e-16 +91 50 -2.41993924898765e-16 +91 77 8.33333333333333e+00 +91 185 2.08333333333333e+00 +91 79 -6.94444444444445e-01 +91 49 5.55555555555556e+00 +91 76 -9.72222222222223e+00 +91 184 -3.47222222222222e+00 +91 78 -9.02056207507940e-17 +91 48 8.88178419700125e-16 +91 75 6.85215773010839e-17 +91 183 -2.08333333333333e+00 +91 179 1.77635683940025e-15 +91 92 0.00000000000000e+00 +91 176 4.55364912443912e-16 +91 233 2.02962646689286e-16 +91 68 -2.48065457064683e-16 +91 20 -4.77048955893622e-17 +91 65 -8.33333333333333e+00 +91 170 -2.08333333333333e+00 +91 178 5.55555555555556e+00 +91 113 1.11022302462516e-16 +91 175 -2.22222222222222e+01 +91 232 -9.72222222222222e+00 +91 67 -6.94444444444445e-01 +91 19 5.55555555555556e+00 +91 64 -9.72222222222223e+00 +91 169 -3.47222222222222e+00 +91 177 -4.93854089567147e-16 +91 90 -8.88178419700125e-16 +91 174 3.72423446248771e-16 +91 231 -8.33333333333333e+00 +91 66 -6.93889390390723e-17 +91 18 8.88178419700125e-16 +91 63 6.15826833971767e-17 +91 168 -2.08333333333333e+00 +92 92 5.55555555555556e+01 +92 200 -3.47222222222222e+00 +92 112 -1.30104260698261e-17 +92 199 2.08333333333333e+00 +92 111 -4.16666666666667e+00 +92 198 -2.08333333333333e+00 +92 197 5.55555555555556e+00 +92 236 -1.38888888888889e+00 +92 104 -4.86111111111111e+00 +92 188 -3.47222222222222e+00 +92 196 8.88178419700125e-16 +92 235 3.78169717762944e-16 +92 103 -1.38777878078145e-16 +92 187 -2.08333333333333e+00 +92 195 -4.37150315946155e-16 +92 234 -2.24646690138997e-16 +92 102 4.16666666666667e+00 +92 186 2.08333333333333e+00 +92 80 -4.86111111111111e+00 +92 50 -1.11111111111111e+01 +92 77 -9.72222222222222e+00 +92 185 -3.47222222222222e+00 +92 79 2.15105711021124e-16 +92 49 -3.70797142990043e-17 +92 76 8.33333333333333e+00 +92 184 2.08333333333333e+00 +92 78 4.16666666666667e+00 +92 48 9.54097911787244e-18 +92 75 2.70508442035133e-16 +92 183 2.08333333333333e+00 +92 179 5.55555555555556e+00 +92 113 -4.86111111111111e+00 +92 176 1.11111111111111e+01 +92 233 -1.38888888888889e+00 +92 68 -4.86111111111111e+00 +92 20 -1.11111111111111e+01 +92 65 -9.72222222222222e+00 +92 170 -3.47222222222222e+00 +92 178 1.77635683940025e-15 +92 91 0.00000000000000e+00 +92 175 1.66601216329554e-16 +92 232 1.78134416939368e-16 +92 67 -1.80411241501588e-16 +92 19 -1.03216046820620e-16 +92 64 -8.33333333333333e+00 +92 169 -2.08333333333333e+00 +92 177 -2.69749500514394e-16 +92 90 0.00000000000000e+00 +92 174 1.77635683940025e-15 +92 231 1.64581889783300e-16 +92 66 -4.16666666666667e+00 +92 18 2.91433543964104e-16 +92 63 -3.12250225675825e-17 +92 168 -2.08333333333333e+00 +93 93 1.00000000000000e+00 +93 80 0.00000000000000e+00 +93 185 0.00000000000000e+00 +93 83 0.00000000000000e+00 +93 46 0.00000000000000e+00 +93 79 0.00000000000000e+00 +93 184 0.00000000000000e+00 +93 82 0.00000000000000e+00 +93 45 0.00000000000000e+00 +93 78 0.00000000000000e+00 +93 183 0.00000000000000e+00 +93 81 0.00000000000000e+00 +93 95 0.00000000000000e+00 +93 179 0.00000000000000e+00 +93 233 0.00000000000000e+00 +93 182 0.00000000000000e+00 +93 17 0.00000000000000e+00 +93 68 0.00000000000000e+00 +93 170 0.00000000000000e+00 +93 71 0.00000000000000e+00 +93 94 0.00000000000000e+00 +93 178 0.00000000000000e+00 +93 232 0.00000000000000e+00 +93 181 0.00000000000000e+00 +93 16 0.00000000000000e+00 +93 67 0.00000000000000e+00 +93 169 0.00000000000000e+00 +93 70 0.00000000000000e+00 +93 47 0.00000000000000e+00 +93 177 0.00000000000000e+00 +93 231 0.00000000000000e+00 +93 180 0.00000000000000e+00 +93 15 0.00000000000000e+00 +93 66 0.00000000000000e+00 +93 168 0.00000000000000e+00 +93 69 0.00000000000000e+00 +94 94 1.00000000000000e+00 +94 80 0.00000000000000e+00 +94 185 0.00000000000000e+00 +94 83 0.00000000000000e+00 +94 46 0.00000000000000e+00 +94 79 0.00000000000000e+00 +94 184 0.00000000000000e+00 +94 82 0.00000000000000e+00 +94 45 0.00000000000000e+00 +94 78 0.00000000000000e+00 +94 183 0.00000000000000e+00 +94 81 0.00000000000000e+00 +94 95 0.00000000000000e+00 +94 179 0.00000000000000e+00 +94 233 0.00000000000000e+00 +94 182 0.00000000000000e+00 +94 17 0.00000000000000e+00 +94 68 0.00000000000000e+00 +94 170 0.00000000000000e+00 +94 71 0.00000000000000e+00 +94 47 0.00000000000000e+00 +94 178 0.00000000000000e+00 +94 232 0.00000000000000e+00 +94 181 0.00000000000000e+00 +94 16 0.00000000000000e+00 +94 67 0.00000000000000e+00 +94 169 0.00000000000000e+00 +94 70 0.00000000000000e+00 +94 93 0.00000000000000e+00 +94 177 0.00000000000000e+00 +94 231 0.00000000000000e+00 +94 180 0.00000000000000e+00 +94 15 0.00000000000000e+00 +94 66 0.00000000000000e+00 +94 168 0.00000000000000e+00 +94 69 0.00000000000000e+00 +95 95 1.00000000000000e+00 +95 80 0.00000000000000e+00 +95 185 0.00000000000000e+00 +95 83 0.00000000000000e+00 +95 46 0.00000000000000e+00 +95 79 0.00000000000000e+00 +95 184 0.00000000000000e+00 +95 82 0.00000000000000e+00 +95 45 0.00000000000000e+00 +95 78 0.00000000000000e+00 +95 183 0.00000000000000e+00 +95 81 0.00000000000000e+00 +95 47 0.00000000000000e+00 +95 179 0.00000000000000e+00 +95 233 0.00000000000000e+00 +95 182 0.00000000000000e+00 +95 17 0.00000000000000e+00 +95 68 0.00000000000000e+00 +95 170 0.00000000000000e+00 +95 71 0.00000000000000e+00 +95 94 0.00000000000000e+00 +95 178 0.00000000000000e+00 +95 232 0.00000000000000e+00 +95 181 0.00000000000000e+00 +95 16 0.00000000000000e+00 +95 67 0.00000000000000e+00 +95 169 0.00000000000000e+00 +95 70 0.00000000000000e+00 +95 93 0.00000000000000e+00 +95 177 0.00000000000000e+00 +95 231 0.00000000000000e+00 +95 180 0.00000000000000e+00 +95 15 0.00000000000000e+00 +95 66 0.00000000000000e+00 +95 168 0.00000000000000e+00 +95 69 0.00000000000000e+00 +96 96 2.77777777777778e+01 +96 116 -4.16666666666667e+00 +96 101 -1.02348685082632e-16 +96 8 -1.02866391619993e-15 +96 193 -2.08333333333333e+00 +96 115 -2.68882138776405e-17 +96 100 -4.16666666666667e+00 +96 7 -1.79733615143784e-16 +96 192 -3.47222222222222e+00 +96 114 -4.86111111111112e+00 +96 99 -4.86111111111111e+00 +96 6 -5.55555555555555e+00 +96 176 2.08333333333333e+00 +96 236 1.98625837999344e-16 +96 191 3.96492734477949e-16 +96 89 4.16666666666667e+00 +96 65 1.29236898960272e-16 +96 188 4.44089209850063e-16 +96 98 3.55271367880050e-15 +96 5 1.42030484595601e-16 +96 175 2.08333333333333e+00 +96 235 -5.11743425413158e-17 +96 190 -4.44089209850063e-16 +96 88 4.94396190653390e-17 +96 64 4.16666666666666e+00 +96 187 1.86591193884755e-16 +96 97 0.00000000000000e+00 +96 4 2.53161207275365e-16 +96 174 -3.47222222222222e+00 +96 234 -1.38888888888889e+00 +96 189 5.55555555555556e+00 +96 87 -4.86111111111111e+00 +96 63 -4.86111111111111e+00 +96 186 5.55555555555556e+00 +96 194 -2.08333333333333e+00 +96 3 -5.55555555555555e+00 +97 97 2.77777777777778e+01 +97 116 1.61329283265843e-16 +97 101 -4.63171168085807e-16 +97 8 2.08333333333333e+00 +97 193 -3.47222222222222e+00 +97 115 -6.94444444444446e-01 +97 100 -4.86111111111111e+00 +97 7 2.77777777777778e+00 +97 192 -2.08333333333333e+00 +97 114 6.07153216591882e-18 +97 99 -4.16666666666667e+00 +97 6 -2.00468981692570e-16 +97 176 -2.08333333333333e+00 +97 236 -8.33333333333333e+00 +97 191 1.18481613409216e-15 +97 89 -2.16840434497101e-17 +97 65 1.48427277413266e-16 +97 188 1.29670579829266e-16 +97 98 8.33333333333333e+00 +97 5 2.08333333333333e+00 +97 175 -3.47222222222222e+00 +97 235 -9.72222222222223e+00 +97 190 5.55555555555556e+00 +97 88 -6.94444444444445e-01 +97 64 -4.86111111111111e+00 +97 187 -1.11111111111111e+01 +97 194 -2.08333333333333e+00 +97 4 2.77777777777778e+00 +97 174 2.08333333333333e+00 +97 234 4.07660016854550e-17 +97 189 0.00000000000000e+00 +97 87 2.77555756156289e-17 +97 63 4.16666666666667e+00 +97 186 1.69000013636178e-17 +97 96 -8.88178419700125e-16 +97 3 1.30673466838815e-16 +98 98 2.77777777777778e+01 +98 116 -4.86111111111111e+00 +98 101 -6.94444444444444e-01 +98 8 2.77777777777778e+00 +98 193 -2.08333333333333e+00 +98 115 1.68268177169750e-16 +98 100 -5.08273978461204e-16 +98 7 2.08333333333333e+00 +98 192 -2.08333333333333e+00 +98 114 -4.16666666666667e+00 +98 99 -1.04950770296597e-16 +98 6 -9.85431354572075e-16 +98 176 -3.47222222222222e+00 +98 236 -9.72222222222222e+00 +98 191 -1.11111111111111e+01 +98 89 -4.86111111111111e+00 +98 65 -6.94444444444444e-01 +98 188 5.55555555555556e+00 +98 194 -3.47222222222222e+00 +98 5 2.77777777777778e+00 +98 175 -2.08333333333333e+00 +98 235 -8.33333333333334e+00 +98 190 5.71171256992520e-16 +98 88 -1.23599047663348e-17 +98 64 1.49186218934005e-16 +98 187 5.67254576644416e-16 +98 97 8.33333333333333e+00 +98 4 2.08333333333333e+00 +98 174 2.08333333333333e+00 +98 234 1.67400815431762e-16 +98 189 3.69387680165811e-16 +98 87 4.16666666666667e+00 +98 63 -2.37440275774325e-17 +98 186 4.44089209850063e-16 +98 96 3.55271367880050e-15 +98 3 2.25812207474418e-16 +99 99 5.55555555555556e+01 +99 128 -1.13299127024735e-16 +99 211 -2.08333333333333e+00 +99 127 -4.16666666666667e+00 +99 210 -3.47222222222222e+00 +99 126 -4.86111111111111e+00 +99 239 -8.33333333333333e+00 +99 206 -2.08333333333333e+00 +99 203 -1.20111982426091e-15 +99 122 -2.37331855557077e-16 +99 238 -2.39283419467551e-16 +99 205 2.08333333333333e+00 +99 202 -2.50098336138094e-16 +99 121 4.16666666666666e+00 +99 237 -9.72222222222223e+00 +99 204 -3.47222222222222e+00 +99 201 -1.11111111111111e+01 +99 120 -4.86111111111111e+00 +99 197 2.08333333333333e+00 +99 119 4.02455846426619e-16 +99 104 -2.19442519711066e-16 +99 23 1.33226762955019e-15 +99 196 2.08333333333333e+00 +99 118 2.26381413614973e-16 +99 103 4.16666666666667e+00 +99 22 2.93276687657329e-16 +99 195 -3.47222222222222e+00 +99 117 -1.38888888888889e+00 +99 102 -4.86111111111111e+00 +99 21 5.55555555555556e+00 +99 236 8.33333333333333e+00 +99 194 1.29193530873373e-15 +99 116 4.57966997657877e-16 +99 191 2.08333333333333e+00 +99 188 -1.64798730217797e-15 +99 101 4.44089209850063e-15 +99 8 8.88178419700125e-16 +99 98 -1.08420217248550e-16 +99 235 -4.94396190653390e-17 +99 193 8.88178419700125e-16 +99 115 1.30646361784503e-16 +99 190 -2.08333333333333e+00 +99 187 -5.37764277552810e-16 +99 100 -1.77635683940025e-15 +99 7 4.08825534189972e-16 +99 97 -4.16666666666667e+00 +99 234 -9.72222222222223e+00 +99 192 1.11111111111111e+01 +99 114 -1.38888888888889e+00 +99 189 -3.47222222222222e+00 +99 186 -1.11111111111111e+01 +99 212 -2.08333333333333e+00 +99 6 5.55555555555556e+00 +99 96 -4.86111111111111e+00 +100 100 5.55555555555556e+01 +100 128 -3.84891771232354e-17 +100 211 -3.47222222222222e+00 +100 127 -4.86111111111111e+00 +100 210 -2.08333333333333e+00 +100 126 -4.16666666666667e+00 +100 239 -2.81025203108243e-16 +100 206 2.08333333333333e+00 +100 203 1.33226762955019e-15 +100 122 8.30065183254902e-16 +100 238 -1.38888888888889e+00 +100 205 -3.47222222222222e+00 +100 202 5.55555555555555e+00 +100 121 -4.86111111111111e+00 +100 237 -1.59594559789866e-16 +100 204 2.08333333333333e+00 +100 201 -8.40256683676266e-17 +100 120 4.16666666666667e+00 +100 197 -2.08333333333333e+00 +100 119 -8.33333333333333e+00 +100 104 5.12393946716649e-16 +100 23 7.87076567115852e-16 +100 196 -3.47222222222222e+00 +100 118 -9.72222222222223e+00 +100 103 -4.86111111111111e+00 +100 22 -1.11111111111111e+01 +100 195 2.08333333333333e+00 +100 117 1.42897846333589e-16 +100 102 4.16666666666666e+00 +100 21 2.90755917606300e-16 +100 236 4.51895465491958e-16 +100 194 4.98949839777829e-16 +100 116 8.33333333333333e+00 +100 191 2.08333333333333e+00 +100 188 1.33226762955019e-15 +100 101 -5.32907051820075e-15 +100 8 9.84021891747844e-16 +100 98 -5.01335084557297e-16 +100 235 -1.38888888888889e+00 +100 193 1.11111111111111e+01 +100 115 -9.72222222222223e+00 +100 190 -3.47222222222222e+00 +100 187 5.55555555555556e+00 +100 212 -2.08333333333333e+00 +100 7 -1.11111111111111e+01 +100 97 -4.86111111111111e+00 +100 234 -1.06577073555325e-16 +100 192 8.88178419700125e-16 +100 114 1.16226472890446e-16 +100 189 -2.08333333333333e+00 +100 186 -4.24004364604769e-16 +100 99 -1.77635683940025e-15 +100 6 2.93276687657329e-16 +100 96 -4.16666666666667e+00 +101 101 5.55555555555556e+01 +101 128 -6.94444444444444e-01 +101 211 -2.08333333333333e+00 +101 127 -1.05818132034585e-16 +101 210 -2.08333333333333e+00 +101 126 -1.90819582357449e-17 +101 239 -9.72222222222222e+00 +101 206 -3.47222222222222e+00 +101 203 5.55555555555555e+00 +101 122 -6.94444444444444e-01 +101 238 -2.22369865576777e-16 +101 205 2.08333333333333e+00 +101 202 8.88178419700125e-16 +101 121 7.38233259245380e-16 +101 237 -8.33333333333333e+00 +101 204 -2.08333333333333e+00 +101 201 -1.14144804719274e-15 +101 120 -1.36175792864179e-16 +101 197 -3.47222222222222e+00 +101 119 -9.72222222222222e+00 +101 104 -6.94444444444444e-01 +101 23 5.55555555555556e+00 +101 196 -2.08333333333333e+00 +101 118 -8.33333333333333e+00 +101 103 5.03937169771262e-16 +101 22 1.08810530030645e-15 +101 195 2.08333333333333e+00 +101 117 1.52764086103208e-16 +101 102 -2.20201461231806e-16 +101 21 1.33226762955019e-15 +101 236 -9.72222222222222e+00 +101 194 -2.22222222222222e+01 +101 116 -9.72222222222222e+00 +101 191 -3.47222222222222e+00 +101 188 5.55555555555555e+00 +101 212 -3.47222222222222e+00 +101 8 5.55555555555556e+00 +101 98 -6.94444444444444e-01 +101 235 3.95300112088215e-16 +101 193 2.77623518792069e-16 +101 115 8.33333333333333e+00 +101 190 2.08333333333333e+00 +101 187 1.33226762955019e-15 +101 100 -6.21724893790088e-15 +101 7 6.69115370749429e-16 +101 97 -4.91794105439425e-16 +101 234 8.33333333333333e+00 +101 192 1.00410673699314e-15 +101 114 1.52764086103208e-16 +101 189 2.08333333333333e+00 +101 186 -1.64264760647848e-15 +101 99 4.44089209850063e-15 +101 6 8.88178419700125e-16 +101 96 -1.27502175484295e-16 +102 102 2.77777777777778e+01 +102 176 2.08333333333333e+00 +102 20 -1.66533453693773e-16 +102 65 1.27502175484295e-16 +102 91 -4.16333634234434e-17 +102 175 -2.08333333333333e+00 +102 19 5.81132364452230e-17 +102 64 -4.16666666666667e+00 +102 90 -4.86111111111111e+00 +102 174 -3.47222222222222e+00 +102 18 -5.55555555555555e+00 +102 63 -4.86111111111111e+00 +102 197 2.84494650060196e-16 +102 119 -4.16666666666667e+00 +102 194 -2.08333333333333e+00 +102 236 1.43114686768087e-16 +102 104 8.88178419700125e-16 +102 23 -5.03069808033274e-16 +102 101 -1.89084858881472e-16 +102 188 4.44089209850063e-16 +102 196 8.88178419700125e-16 +102 118 -8.50014503228635e-17 +102 193 2.08333333333333e+00 +102 235 7.52436307704940e-17 +102 103 -1.77635683940025e-15 +102 22 -2.99890320909491e-16 +102 100 4.16666666666666e+00 +102 187 -3.86111498676400e-17 +102 195 5.55555555555556e+00 +102 117 -4.86111111111111e+00 +102 192 -3.47222222222222e+00 +102 234 -1.38888888888889e+00 +102 92 4.16666666666667e+00 +102 21 -5.55555555555555e+00 +102 99 -4.86111111111111e+00 +102 186 5.55555555555556e+00 +103 103 2.77777777777778e+01 +103 176 2.08333333333333e+00 +103 20 -2.08333333333333e+00 +103 65 1.09287578986539e-16 +103 91 -6.94444444444444e-01 +103 175 -3.47222222222222e+00 +103 19 2.77777777777778e+00 +103 64 -4.86111111111111e+00 +103 90 3.64291929955129e-17 +103 174 -2.08333333333333e+00 +103 18 2.34838190560360e-16 +103 63 -4.16666666666667e+00 +103 197 -8.29197821516914e-16 +103 119 -5.55111512312578e-17 +103 194 2.08333333333333e+00 +103 236 8.33333333333333e+00 +103 104 -8.33333333333333e+00 +103 23 -2.08333333333333e+00 +103 101 5.03937169771262e-16 +103 188 6.29704621779581e-16 +103 196 5.55555555555556e+00 +103 118 -6.94444444444445e-01 +103 193 -3.47222222222222e+00 +103 235 -9.72222222222223e+00 +103 92 -1.66533453693773e-16 +103 22 2.77777777777778e+00 +103 100 -4.86111111111111e+00 +103 187 -1.11111111111111e+01 +103 195 8.88178419700125e-16 +103 117 -2.77555756156289e-17 +103 192 2.08333333333333e+00 +103 234 -9.54097911787244e-18 +103 102 -1.77635683940025e-15 +103 21 -2.26381413614973e-16 +103 99 4.16666666666667e+00 +103 186 7.20994444702860e-17 +104 104 2.77777777777778e+01 +104 176 -3.47222222222222e+00 +104 20 2.77777777777778e+00 +104 65 -6.94444444444443e-01 +104 91 -1.80411241501588e-16 +104 175 2.08333333333333e+00 +104 19 -2.08333333333333e+00 +104 64 1.25116930704827e-16 +104 90 4.16666666666667e+00 +104 174 2.08333333333333e+00 +104 18 -2.15105711021124e-16 +104 63 8.39172481503780e-17 +104 197 -1.11111111111111e+01 +104 119 -4.86111111111111e+00 +104 194 -3.47222222222222e+00 +104 236 -9.72222222222222e+00 +104 92 -4.86111111111111e+00 +104 23 2.77777777777778e+00 +104 101 -6.94444444444444e-01 +104 188 5.55555555555556e+00 +104 196 -3.46727854760864e-16 +104 118 9.45424294407360e-17 +104 193 2.08333333333333e+00 +104 235 8.33333333333333e+00 +104 103 -8.33333333333333e+00 +104 22 -2.08333333333333e+00 +104 100 5.71374544899861e-16 +104 187 4.69676381120721e-16 +104 195 2.59341159658533e-16 +104 117 -4.16666666666667e+00 +104 192 -2.08333333333333e+00 +104 234 5.78963960107259e-17 +104 102 8.88178419700125e-16 +104 21 -6.73072708679001e-16 +104 99 -2.35922392732846e-16 +104 186 4.44089209850063e-16 +105 105 2.77777777777778e+01 +105 38 -9.88683961089531e-16 +105 194 2.08333333333333e+00 +105 116 4.16666666666666e+00 +105 109 -4.16666666666667e+00 +105 37 -2.81025203108243e-16 +105 193 -2.08333333333333e+00 +105 115 -6.24500451351651e-17 +105 108 -4.86111111111111e+00 +105 36 -5.55555555555556e+00 +105 192 -3.47222222222222e+00 +105 114 -4.86111111111111e+00 +105 77 -1.38777878078145e-17 +105 200 1.33226762955019e-15 +105 107 -8.88178419700125e-16 +105 35 1.37043154602168e-16 +105 176 -2.08333333333333e+00 +105 236 1.67292395214513e-16 +105 191 4.24898831397069e-16 +105 89 -4.16666666666667e+00 +105 76 4.16666666666667e+00 +105 199 1.73472347597681e-16 +105 106 8.88178419700125e-16 +105 34 2.28983498828939e-16 +105 175 2.08333333333333e+00 +105 235 4.33680868994202e-18 +105 190 0.00000000000000e+00 +105 88 4.16333634234434e-17 +105 75 -4.86111111111111e+00 +105 198 5.55555555555555e+00 +105 110 -9.28077059647592e-17 +105 33 -5.55555555555555e+00 +105 174 -3.47222222222222e+00 +105 234 -1.38888888888889e+00 +105 189 5.55555555555556e+00 +105 87 -4.86111111111111e+00 +106 106 2.77777777777778e+01 +106 38 -2.08333333333333e+00 +106 194 2.08333333333333e+00 +106 116 8.57603918436034e-17 +106 109 -4.86111111111111e+00 +106 37 2.77777777777778e+00 +106 193 -3.47222222222222e+00 +106 115 -6.94444444444444e-01 +106 108 -4.16666666666667e+00 +106 36 -3.40005801291454e-16 +106 192 -2.08333333333333e+00 +106 114 -2.77555756156289e-17 +106 77 1.17961196366423e-16 +106 200 -4.02347426209371e-16 +106 107 -8.33333333333333e+00 +106 35 -2.08333333333333e+00 +106 176 2.08333333333333e+00 +106 236 8.33333333333333e+00 +106 191 5.50354575280798e-16 +106 89 2.53594888144359e-16 +106 76 -4.86111111111111e+00 +106 199 -1.11111111111111e+01 +106 110 -5.93275428784068e-16 +106 34 2.77777777777778e+00 +106 175 -3.47222222222222e+00 +106 235 -9.72222222222223e+00 +106 190 5.55555555555556e+00 +106 88 -6.94444444444445e-01 +106 75 4.16666666666667e+00 +106 198 1.34441069388203e-16 +106 105 8.88178419700125e-16 +106 33 1.35308431126191e-16 +106 174 2.08333333333333e+00 +106 234 7.60025722912339e-17 +106 189 0.00000000000000e+00 +106 87 3.29597460435593e-17 +107 107 2.77777777777778e+01 +107 38 2.77777777777778e+00 +107 194 -3.47222222222222e+00 +107 116 -4.86111111111111e+00 +107 109 -7.21644966006352e-16 +107 37 -2.08333333333333e+00 +107 193 2.08333333333333e+00 +107 115 2.92300905702092e-16 +107 108 -8.32667268468867e-17 +107 36 -1.14578485588268e-15 +107 192 2.08333333333333e+00 +107 114 4.16666666666667e+00 +107 77 -6.94444444444445e-01 +107 200 5.55555555555556e+00 +107 110 -6.94444444444444e-01 +107 35 2.77777777777778e+00 +107 176 -3.47222222222222e+00 +107 236 -9.72222222222222e+00 +107 191 -1.11111111111111e+01 +107 89 -4.86111111111111e+00 +107 76 4.85722573273506e-17 +107 199 -5.51642065360625e-16 +107 106 -8.33333333333333e+00 +107 34 -2.08333333333333e+00 +107 175 2.08333333333333e+00 +107 235 8.33333333333333e+00 +107 190 1.12236608895699e-15 +107 88 3.69496100383060e-16 +107 75 1.82145964977565e-17 +107 198 1.33226762955019e-15 +107 105 -8.88178419700125e-16 +107 33 1.75207071073658e-16 +107 174 -2.08333333333333e+00 +107 234 1.36175792864179e-16 +107 189 2.86337793753422e-16 +107 87 -4.16666666666667e+00 +108 108 5.55555555555556e+01 +108 212 2.08333333333333e+00 +108 136 -4.16666666666667e+00 +108 211 -2.08333333333333e+00 +108 135 -4.86111111111111e+00 +108 210 -3.47222222222222e+00 +108 215 -1.27155230789100e-15 +108 131 -2.67147415300428e-16 +108 239 8.33333333333333e+00 +108 206 2.08333333333333e+00 +108 214 -2.04697370165263e-16 +108 130 4.16666666666667e+00 +108 238 -2.81784144628983e-16 +108 205 2.08333333333333e+00 +108 213 -1.11111111111111e+01 +108 129 -4.86111111111111e+00 +108 237 -9.72222222222223e+00 +108 204 -3.47222222222222e+00 +108 113 -8.32667268468867e-17 +108 53 8.88178419700125e-16 +108 197 -2.08333333333333e+00 +108 119 3.33934269125535e-16 +108 112 4.16666666666667e+00 +108 52 5.06539254985228e-16 +108 196 2.08333333333333e+00 +108 118 1.16226472890446e-16 +108 111 -4.86111111111111e+00 +108 51 5.55555555555556e+00 +108 195 -3.47222222222222e+00 +108 117 -1.38888888888889e+00 +108 200 -1.47885176327023e-15 +108 110 3.55271367880050e-15 +108 38 8.88178419700125e-16 +108 107 -8.32667268468867e-17 +108 236 -8.33333333333333e+00 +108 194 1.05885894670366e-15 +108 116 3.33283747822044e-16 +108 191 -2.08333333333333e+00 +108 199 -5.62050406216485e-16 +108 109 1.77635683940025e-15 +108 37 3.34801630863524e-16 +108 106 -4.16666666666667e+00 +108 235 6.07153216591882e-18 +108 193 8.88178419700125e-16 +108 115 1.70761842166467e-16 +108 190 -2.08333333333333e+00 +108 198 -1.11111111111111e+01 +108 137 -1.13624387676481e-16 +108 36 5.55555555555556e+00 +108 105 -4.86111111111111e+00 +108 234 -9.72222222222223e+00 +108 192 1.11111111111111e+01 +108 114 -1.38888888888889e+00 +108 189 -3.47222222222222e+00 +109 109 5.55555555555556e+01 +109 212 2.08333333333333e+00 +109 136 -4.86111111111111e+00 +109 211 -3.47222222222222e+00 +109 135 -4.16666666666667e+00 +109 210 -2.08333333333333e+00 +109 215 4.44089209850063e-16 +109 131 7.00828284294630e-16 +109 38 4.16333634234434e-17 +109 239 1.14817010066215e-16 +109 206 -2.08333333333333e+00 +109 214 5.55555555555555e+00 +109 130 -4.86111111111111e+00 +109 238 -1.38888888888889e+00 +109 205 -3.47222222222222e+00 +109 213 -1.38777878078145e-17 +109 129 4.16666666666667e+00 +109 237 -2.28116137090950e-16 +109 204 2.08333333333333e+00 +109 113 3.65159291693118e-16 +109 53 4.05925293378573e-16 +109 197 2.08333333333333e+00 +109 119 8.33333333333333e+00 +109 112 -4.86111111111111e+00 +109 52 -1.11111111111111e+01 +109 196 -3.47222222222222e+00 +109 118 -9.72222222222223e+00 +109 111 4.16666666666667e+00 +109 51 2.23779328401008e-16 +109 195 2.08333333333333e+00 +109 117 1.44524149592318e-16 +109 200 1.77635683940025e-15 +109 110 0.00000000000000e+00 +109 107 -7.14706072102445e-16 +109 236 2.62810606610486e-16 +109 194 2.98548620721040e-16 +109 116 -8.33333333333333e+00 +109 191 -2.08333333333333e+00 +109 199 5.55555555555556e+00 +109 137 -3.98986399474666e-17 +109 37 -1.11111111111111e+01 +109 106 -4.86111111111111e+00 +109 235 -1.38888888888889e+00 +109 193 1.11111111111111e+01 +109 115 -9.72222222222223e+00 +109 190 -3.47222222222222e+00 +109 198 -5.23886489744996e-16 +109 108 1.77635683940025e-15 +109 36 5.06539254985228e-16 +109 105 -4.16666666666667e+00 +109 234 -1.11889664200504e-16 +109 192 8.88178419700125e-16 +109 114 2.41126563160776e-16 +109 189 -2.08333333333333e+00 +110 110 5.55555555555556e+01 +110 212 -3.47222222222222e+00 +110 136 -4.16333634234434e-17 +110 211 2.08333333333333e+00 +110 135 -1.80411241501588e-16 +110 210 2.08333333333333e+00 +110 215 5.55555555555555e+00 +110 131 -6.94444444444444e-01 +110 239 -9.72222222222222e+00 +110 206 -3.47222222222222e+00 +110 214 4.44089209850063e-16 +110 130 6.74807432154978e-16 +110 238 1.13624387676481e-16 +110 205 -2.08333333333333e+00 +110 213 -1.43114686768087e-15 +110 129 -3.19189119579733e-16 +110 237 8.33333333333333e+00 +110 204 2.08333333333333e+00 +110 113 -6.94444444444444e-01 +110 53 5.55555555555555e+00 +110 197 -3.47222222222222e+00 +110 119 -9.72222222222222e+00 +110 112 3.53883589099269e-16 +110 52 4.30211422042248e-16 +110 196 2.08333333333333e+00 +110 118 8.33333333333333e+00 +110 111 -1.76074432811646e-16 +110 51 8.88178419700125e-16 +110 195 -2.08333333333333e+00 +110 117 4.30211422042248e-16 +110 200 5.55555555555556e+00 +110 137 -6.94444444444444e-01 +110 38 5.55555555555555e+00 +110 107 -6.94444444444444e-01 +110 236 -9.72222222222222e+00 +110 194 -2.22222222222222e+01 +110 116 -9.72222222222222e+00 +110 191 -3.47222222222222e+00 +110 199 2.22044604925031e-15 +110 109 8.88178419700125e-16 +110 37 -3.82723366887383e-17 +110 106 -5.93275428784068e-16 +110 235 8.50014503228635e-17 +110 193 5.05888733681736e-16 +110 115 -8.33333333333333e+00 +110 190 -2.08333333333333e+00 +110 198 -1.50899258366533e-15 +110 108 3.55271367880050e-15 +110 36 8.88178419700125e-16 +110 105 -9.28077059647592e-17 +110 234 -8.33333333333333e+00 +110 192 1.54162706905714e-15 +110 114 5.96744875736022e-16 +110 189 -2.08333333333333e+00 +111 111 2.77777777777778e+01 +111 77 1.24900090270330e-16 +111 92 -4.16666666666667e+00 +111 176 -2.08333333333333e+00 +111 49 5.55111512312578e-17 +111 76 -4.16666666666667e+00 +111 91 -2.77555756156289e-17 +111 175 -2.08333333333333e+00 +111 48 -5.55555555555555e+00 +111 75 -4.86111111111111e+00 +111 90 -4.86111111111111e+00 +111 174 -3.47222222222222e+00 +111 113 8.88178419700125e-16 +111 53 -5.75928194024300e-16 +111 110 -1.76074432811646e-16 +111 200 1.33226762955019e-15 +111 197 3.72965547335014e-17 +111 119 4.16666666666667e+00 +111 194 2.08333333333333e+00 +111 236 5.71374544899861e-17 +111 112 0.00000000000000e+00 +111 52 -2.98372437868011e-16 +111 109 4.16666666666667e+00 +111 199 1.64798730217797e-17 +111 196 8.88178419700125e-16 +111 118 -5.81132364452230e-17 +111 193 2.08333333333333e+00 +111 235 2.67797936603920e-17 +111 50 -1.11022302462516e-16 +111 51 -5.55555555555556e+00 +111 108 -4.86111111111111e+00 +111 198 5.55555555555555e+00 +111 195 5.55555555555556e+00 +111 117 -4.86111111111111e+00 +111 192 -3.47222222222222e+00 +111 234 -1.38888888888889e+00 +112 112 2.77777777777778e+01 +112 77 3.46944695195361e-17 +112 92 9.80118763926896e-17 +112 176 -2.08333333333333e+00 +112 49 2.77777777777778e+00 +112 76 -4.86111111111111e+00 +112 91 -6.94444444444445e-01 +112 175 -3.47222222222222e+00 +112 48 2.91433543964104e-16 +112 75 -4.16666666666667e+00 +112 90 6.50521303491303e-17 +112 174 -2.08333333333333e+00 +112 113 8.33333333333333e+00 +112 53 2.08333333333333e+00 +112 110 3.53883589099269e-16 +112 200 -1.07552855510562e-16 +112 197 -4.47233396150271e-16 +112 119 3.10515502199848e-16 +112 194 -2.08333333333333e+00 +112 236 -8.33333333333334e+00 +112 50 2.08333333333333e+00 +112 52 2.77777777777778e+00 +112 109 -4.86111111111111e+00 +112 199 -1.11111111111111e+01 +112 196 5.55555555555556e+00 +112 118 -6.94444444444444e-01 +112 193 -3.47222222222222e+00 +112 235 -9.72222222222223e+00 +112 111 0.00000000000000e+00 +112 51 -2.77555756156289e-16 +112 108 4.16666666666667e+00 +112 198 5.55111512312578e-17 +112 195 8.88178419700125e-16 +112 117 -3.46944695195361e-17 +112 192 2.08333333333333e+00 +112 234 -5.11743425413158e-17 +113 113 2.77777777777778e+01 +113 77 -6.94444444444445e-01 +113 92 -4.86111111111111e+00 +113 176 -3.47222222222222e+00 +113 49 2.08333333333333e+00 +113 76 2.08166817117217e-17 +113 91 1.11022302462516e-16 +113 175 -2.08333333333333e+00 +113 48 -1.87350135405495e-16 +113 75 7.37257477290143e-17 +113 90 -4.16666666666667e+00 +113 174 -2.08333333333333e+00 +113 50 2.77777777777778e+00 +113 53 2.77777777777778e+00 +113 110 -6.94444444444444e-01 +113 200 5.55555555555556e+00 +113 197 -1.11111111111111e+01 +113 119 -4.86111111111111e+00 +113 194 -3.47222222222222e+00 +113 236 -9.72222222222222e+00 +113 112 8.33333333333333e+00 +113 52 2.08333333333333e+00 +113 109 4.20670442924376e-16 +113 199 -1.76724954115137e-16 +113 196 -7.73686670285656e-16 +113 118 2.98372437868011e-16 +113 193 -2.08333333333333e+00 +113 235 -8.33333333333333e+00 +113 111 8.88178419700125e-16 +113 51 -3.88578058618805e-16 +113 108 -8.32667268468867e-17 +113 198 1.33226762955019e-15 +113 195 2.22044604925031e-16 +113 117 4.16666666666667e+00 +113 192 2.08333333333333e+00 +113 234 -2.34187669256869e-17 +114 114 5.55555555555556e+01 +114 131 -4.16666666666667e+00 +114 214 -2.08333333333333e+00 +114 130 -8.57603918436034e-17 +114 213 -3.47222222222222e+00 +114 129 -4.86111111111112e+00 +114 239 -4.77591056979865e-16 +114 206 4.08595141228318e-16 +114 203 2.08333333333333e+00 +114 122 4.16666666666667e+00 +114 238 -8.33333333333333e+00 +114 205 -1.73987343629611e-16 +114 202 -2.08333333333333e+00 +114 121 -9.26992857475106e-17 +114 237 -9.72222222222222e+00 +114 204 -1.11111111111111e+01 +114 201 -3.47222222222222e+00 +114 120 -4.86111111111112e+00 +114 200 2.08333333333333e+00 +114 110 5.13478148889135e-16 +114 38 3.82940207321880e-16 +114 107 4.16666666666667e+00 +114 199 2.08333333333333e+00 +114 109 2.40259201422788e-16 +114 37 0.00000000000000e+00 +114 106 -2.86229373536173e-17 +114 198 -3.47222222222222e+00 +114 108 -1.38888888888889e+00 +114 36 5.55555555555556e+00 +114 105 -4.86111111111111e+00 +114 236 -1.91686944095437e-16 +114 194 1.77635683940025e-15 +114 116 4.44089209850063e-15 +114 191 -1.89865484445662e-15 +114 188 -2.08333333333333e+00 +114 101 3.89553840574042e-16 +114 8 3.19880298464692e-16 +114 98 -4.16666666666667e+00 +114 235 8.33333333333333e+00 +114 193 7.99815942642557e-16 +114 115 0.00000000000000e+00 +114 190 -4.28476698566271e-16 +114 187 2.08333333333333e+00 +114 100 1.16226472890446e-16 +114 7 0.00000000000000e+00 +114 97 3.38271077815477e-17 +114 234 -9.72222222222222e+00 +114 192 1.11111111111111e+01 +114 215 -2.08333333333333e+00 +114 189 -1.11111111111111e+01 +114 186 -3.47222222222222e+00 +114 99 -1.38888888888889e+00 +114 6 5.55555555555556e+00 +114 96 -4.86111111111112e+00 +115 115 5.55555555555556e+01 +115 131 -3.64291929955129e-16 +115 214 -3.47222222222222e+00 +115 130 -6.94444444444445e-01 +115 213 -2.08333333333333e+00 +115 129 -6.93889390390723e-18 +115 239 -8.28330459778925e-17 +115 206 -4.44089209850063e-16 +115 203 2.08333333333333e+00 +115 122 -1.25767452008319e-17 +115 238 -9.72222222222222e+00 +115 205 5.55555555555555e+00 +115 202 -3.47222222222222e+00 +115 121 -6.94444444444446e-01 +115 237 -8.33333333333333e+00 +115 204 4.01696904905879e-16 +115 201 -2.08333333333333e+00 +115 120 8.67361737988404e-19 +115 200 -2.08333333333333e+00 +115 110 -8.33333333333333e+00 +115 38 8.87527898396634e-16 +115 107 2.64545330086463e-16 +115 199 -3.47222222222222e+00 +115 109 -9.72222222222223e+00 +115 37 5.55555555555556e+00 +115 106 -6.94444444444444e-01 +115 198 2.08333333333333e+00 +115 108 1.56775634141404e-16 +115 36 0.00000000000000e+00 +115 105 -5.54027310140093e-17 +115 236 7.66422515730003e-16 +115 194 6.23023225891639e-16 +115 116 -4.44089209850063e-15 +115 191 0.00000000000000e+00 +115 188 2.08333333333333e+00 +115 101 8.33333333333333e+00 +115 8 4.13053922662665e-16 +115 98 1.67400815431762e-16 +115 235 -9.72222222222222e+00 +115 193 -2.22222222222222e+01 +115 215 -2.08333333333333e+00 +115 190 5.55555555555556e+00 +115 187 -3.47222222222222e+00 +115 100 -9.72222222222223e+00 +115 7 5.55555555555556e+00 +115 97 -6.94444444444446e-01 +115 234 8.33333333333333e+00 +115 192 5.18099560649354e-16 +115 114 0.00000000000000e+00 +115 189 -2.93141162385768e-16 +115 186 2.08333333333333e+00 +115 99 1.43765208071578e-16 +115 6 0.00000000000000e+00 +115 96 -2.86229373536173e-17 +116 116 5.55555555555556e+01 +116 131 -4.86111111111111e+00 +116 214 -2.08333333333333e+00 +116 130 -3.07262895682392e-16 +116 213 -2.08333333333333e+00 +116 129 -4.16666666666667e+00 +116 239 -1.38888888888889e+00 +116 206 5.55555555555555e+00 +116 203 -3.47222222222222e+00 +116 122 -4.86111111111111e+00 +116 238 -2.02962646689286e-16 +116 205 0.00000000000000e+00 +116 202 2.08333333333333e+00 +116 121 -1.76941794549634e-16 +116 237 -4.28476698566271e-16 +116 204 2.79290479632266e-16 +116 201 2.08333333333333e+00 +116 120 4.16666666666667e+00 +116 200 -3.47222222222222e+00 +116 110 -9.72222222222222e+00 +116 38 -1.11111111111111e+01 +116 107 -4.86111111111111e+00 +116 199 -2.08333333333333e+00 +116 109 -8.33333333333333e+00 +116 37 4.82442861701737e-16 +116 106 1.96782694306119e-16 +116 193 1.11575245570483e-15 +116 198 2.08333333333333e+00 +116 108 2.63786388565723e-16 +116 36 2.64260727016186e-16 +116 105 4.16666666666666e+00 +116 236 -1.38888888888889e+00 +116 194 1.11111111111111e+01 +116 215 -3.47222222222222e+00 +116 191 5.55555555555556e+00 +116 188 -3.47222222222222e+00 +116 101 -9.72222222222222e+00 +116 8 -1.11111111111111e+01 +116 98 -4.86111111111111e+00 +116 235 7.88431819831459e-16 +116 115 -4.44089209850063e-15 +116 190 4.44089209850063e-16 +116 187 2.08333333333333e+00 +116 100 8.33333333333333e+00 +116 7 7.83444489838026e-16 +116 97 1.33573707650214e-16 +116 234 -2.57498015965307e-16 +116 192 1.77635683940025e-15 +116 114 4.44089209850063e-15 +116 189 -2.18377291076599e-15 +116 186 -2.08333333333333e+00 +116 99 4.85722573273506e-16 +116 6 1.88542757795229e-16 +116 96 -4.16666666666667e+00 +117 117 5.55555555555556e+01 +117 215 -2.08333333333333e+00 +117 136 -1.45716771982052e-16 +117 214 2.08333333333333e+00 +117 135 -4.86111111111112e+00 +117 213 -3.47222222222222e+00 +117 212 -2.76948602939697e-15 +117 239 -5.98154338560253e-16 +117 128 4.16666666666667e+00 +117 203 2.08333333333333e+00 +117 211 -2.82326245715225e-16 +117 238 8.33333333333333e+00 +117 127 -1.68268177169750e-16 +117 202 2.08333333333333e+00 +117 210 -1.11111111111111e+01 +117 237 -9.72222222222222e+00 +117 126 -4.86111111111111e+00 +117 201 -3.47222222222222e+00 +117 113 4.16666666666667e+00 +117 53 9.08995101411847e-16 +117 110 4.57966997657877e-16 +117 200 2.08333333333333e+00 +117 112 -3.46944695195361e-17 +117 52 8.88178419700125e-16 +117 109 1.45283091113058e-16 +117 199 -2.08333333333333e+00 +117 111 -4.86111111111111e+00 +117 51 5.55555555555556e+00 +117 108 -1.38888888888889e+00 +117 198 -3.47222222222222e+00 +117 197 -1.11716191852906e-15 +117 119 4.44089209850063e-15 +117 194 1.77635683940025e-15 +117 236 3.03576608295941e-17 +117 104 -4.16666666666667e+00 +117 23 7.38992200766120e-16 +117 101 1.11239142897013e-16 +117 188 -2.08333333333333e+00 +117 196 -6.73072708679001e-16 +117 118 -8.88178419700125e-16 +117 193 7.43613612526339e-16 +117 235 -8.33333333333333e+00 +117 103 -2.77555756156289e-17 +117 22 8.88178419700125e-16 +117 100 1.70761842166467e-16 +117 187 -2.08333333333333e+00 +117 195 -1.11111111111111e+01 +117 137 -4.16666666666667e+00 +117 192 1.11111111111111e+01 +117 234 -9.72222222222222e+00 +117 102 -4.86111111111111e+00 +117 21 5.55555555555556e+00 +117 99 -1.38888888888889e+00 +117 186 -3.47222222222222e+00 +118 118 5.55555555555556e+01 +118 215 2.08333333333333e+00 +118 136 -6.94444444444446e-01 +118 214 -3.47222222222222e+00 +118 135 -1.52655665885959e-16 +118 213 2.08333333333333e+00 +118 212 2.22044604925031e-15 +118 239 1.53089346754953e-15 +118 128 1.82145964977565e-16 +118 203 -2.08333333333333e+00 +118 211 5.55555555555555e+00 +118 238 -9.72222222222222e+00 +118 127 -6.94444444444444e-01 +118 202 -3.47222222222222e+00 +118 210 -5.02202446295286e-16 +118 237 8.33333333333333e+00 +118 126 -1.87350135405495e-16 +118 201 2.08333333333333e+00 +118 113 2.98372437868011e-16 +118 53 -7.77156117237610e-16 +118 110 8.33333333333333e+00 +118 200 2.08333333333333e+00 +118 112 -6.94444444444444e-01 +118 52 5.55555555555556e+00 +118 109 -9.72222222222223e+00 +118 199 -3.47222222222222e+00 +118 111 -7.19910242530375e-17 +118 51 8.88178419700125e-16 +118 108 1.16226472890446e-16 +118 198 -2.08333333333333e+00 +118 197 3.10862446895044e-15 +118 119 -1.77635683940025e-15 +118 194 1.34473595453377e-15 +118 236 -1.10501885419723e-15 +118 104 9.45424294407360e-17 +118 23 -3.57461456268471e-16 +118 101 -8.33333333333333e+00 +118 188 -2.08333333333333e+00 +118 196 5.55555555555556e+00 +118 137 8.32667268468867e-17 +118 193 -2.22222222222222e+01 +118 235 -9.72222222222222e+00 +118 103 -6.94444444444445e-01 +118 22 5.55555555555556e+00 +118 100 -9.72222222222223e+00 +118 187 -3.47222222222222e+00 +118 195 -6.57134936743464e-16 +118 117 -8.88178419700125e-16 +118 192 7.99815942642557e-16 +118 234 -8.33333333333333e+00 +118 102 -8.50014503228635e-17 +118 21 8.88178419700125e-16 +118 99 2.27248775352962e-16 +118 186 -2.08333333333333e+00 +119 119 5.55555555555556e+01 +119 215 -3.47222222222222e+00 +119 136 8.58688120608520e-17 +119 214 2.08333333333333e+00 +119 135 -4.16666666666667e+00 +119 213 -2.08333333333333e+00 +119 212 5.55555555555555e+00 +119 239 -1.38888888888889e+00 +119 128 -4.86111111111111e+00 +119 203 -3.47222222222222e+00 +119 211 1.77635683940025e-15 +119 238 1.52395457364563e-15 +119 127 2.91433543964104e-16 +119 202 -2.08333333333333e+00 +119 210 -2.85188539450587e-15 +119 237 -6.84348411272850e-16 +119 126 4.16666666666667e+00 +119 201 2.08333333333333e+00 +119 113 -4.86111111111111e+00 +119 53 -1.11111111111111e+01 +119 110 -9.72222222222222e+00 +119 200 -3.47222222222222e+00 +119 112 3.10515502199848e-16 +119 52 -3.50414142147315e-16 +119 109 8.33333333333333e+00 +119 199 2.08333333333333e+00 +119 111 4.16666666666667e+00 +119 51 7.39859562504108e-16 +119 108 1.52764086103208e-16 +119 198 2.08333333333333e+00 +119 197 5.55555555555556e+00 +119 137 -4.86111111111111e+00 +119 194 1.11111111111111e+01 +119 236 -1.38888888888889e+00 +119 104 -4.86111111111111e+00 +119 23 -1.11111111111111e+01 +119 101 -9.72222222222222e+00 +119 188 -3.47222222222222e+00 +119 196 3.10862446895044e-15 +119 118 -8.88178419700125e-16 +119 193 1.06017354183779e-15 +119 235 -9.73179870022989e-16 +119 103 -4.85722573273506e-17 +119 22 -7.77156117237610e-16 +119 100 -8.33333333333333e+00 +119 187 -2.08333333333333e+00 +119 195 -1.07899800205757e-15 +119 117 4.44089209850063e-15 +119 192 1.77635683940025e-15 +119 234 -2.51534904016637e-17 +119 102 -4.16666666666667e+00 +119 21 9.08995101411847e-16 +119 99 4.85722573273506e-16 +119 186 -2.08333333333333e+00 +120 120 2.77777777777778e+01 +120 140 -4.16666666666667e+00 +120 125 -1.95156391047391e-16 +120 11 -1.28693442621314e-15 +120 208 -2.08333333333333e+00 +120 139 2.65412691824451e-16 +120 124 -4.16666666666667e+00 +120 10 9.10092856111488e-16 +120 207 -3.47222222222222e+00 +120 138 -4.86111111111111e+00 +120 123 -4.86111111111111e+00 +120 9 -5.55555555555554e+00 +120 194 2.08333333333333e+00 +120 239 2.89698820488127e-16 +120 206 1.16443313324943e-16 +120 116 4.16666666666667e+00 +120 101 -1.92554305833426e-16 +120 203 8.88178419700125e-16 +120 122 1.77635683940025e-15 +120 8 2.67038995083180e-16 +120 193 2.08333333333333e+00 +120 238 3.29597460435593e-17 +120 205 -4.44089209850063e-16 +120 115 -6.24500451351651e-17 +120 100 4.16666666666667e+00 +120 202 -1.66316613259276e-16 +120 121 -1.77635683940025e-15 +120 7 2.60208521396521e-17 +120 192 -3.47222222222222e+00 +120 237 -1.38888888888889e+00 +120 204 5.55555555555556e+00 +120 114 -4.86111111111112e+00 +120 99 -4.86111111111111e+00 +120 201 5.55555555555556e+00 +120 209 -2.08333333333333e+00 +120 6 -5.55555555555556e+00 +121 121 2.77777777777778e+01 +121 140 8.54351311918577e-16 +121 125 -6.60495963478169e-16 +121 11 2.08333333333333e+00 +121 208 -3.47222222222222e+00 +121 139 -6.94444444444446e-01 +121 124 -4.86111111111111e+00 +121 10 2.77777777777778e+00 +121 207 -2.08333333333333e+00 +121 138 2.08166817117217e-16 +121 123 -4.16666666666667e+00 +121 9 8.14669512405608e-16 +121 194 -2.08333333333333e+00 +121 239 -8.33333333333334e+00 +121 206 6.37185616769731e-16 +121 116 -1.21430643318376e-16 +121 101 7.86805516572731e-16 +121 203 -1.53425449428424e-15 +121 122 8.33333333333333e+00 +121 8 2.08333333333333e+00 +121 193 -3.47222222222222e+00 +121 238 -9.72222222222223e+00 +121 205 5.55555555555556e+00 +121 115 -6.94444444444446e-01 +121 100 -4.86111111111111e+00 +121 202 -1.11111111111111e+01 +121 209 -2.08333333333333e+00 +121 7 2.77777777777778e+00 +121 192 2.08333333333333e+00 +121 237 4.35849273339173e-17 +121 204 -8.88178419700125e-16 +121 114 -1.28369537222284e-16 +121 99 4.16666666666666e+00 +121 201 -1.63999131115589e-16 +121 120 -1.77635683940025e-15 +121 6 -2.06296568369679e-16 +122 122 2.77777777777778e+01 +122 140 -4.86111111111111e+00 +122 125 -6.94444444444442e-01 +122 11 2.77777777777778e+00 +122 208 -2.08333333333333e+00 +122 139 6.82180006927879e-16 +122 124 -6.86083134748827e-16 +122 10 2.08333333333333e+00 +122 207 -2.08333333333333e+00 +122 138 -4.16666666666667e+00 +122 123 -2.22044604925031e-16 +122 9 -1.37368415253913e-15 +122 194 -3.47222222222222e+00 +122 239 -9.72222222222222e+00 +122 206 -1.11111111111111e+01 +122 116 -4.86111111111111e+00 +122 101 -6.94444444444444e-01 +122 203 5.55555555555556e+00 +122 209 -3.47222222222222e+00 +122 8 2.77777777777777e+00 +122 193 -2.08333333333333e+00 +122 238 -8.33333333333334e+00 +122 205 2.16081492976361e-16 +122 115 -1.23599047663348e-16 +122 100 7.45931094670027e-16 +122 202 -1.49305481172979e-15 +122 121 8.33333333333333e+00 +122 7 2.08333333333333e+00 +122 192 2.08333333333333e+00 +122 237 4.29560900738757e-16 +122 204 5.86919293547872e-16 +122 114 4.16666666666667e+00 +122 99 -2.30392961653170e-16 +122 201 8.88178419700125e-16 +122 120 1.77635683940025e-15 +122 6 1.59323509246745e-16 +123 123 5.55555555555556e+01 +123 152 2.44487589895481e-16 +123 226 -2.08333333333333e+00 +123 151 -4.16666666666667e+00 +123 225 -3.47222222222222e+00 +123 150 -4.86111111111111e+00 +123 242 -8.33333333333333e+00 +123 221 -2.08333333333333e+00 +123 218 -1.41054702640364e-16 +123 146 1.28369537222284e-16 +123 241 -1.86374353450258e-16 +123 220 2.08333333333333e+00 +123 217 -9.27833114158783e-16 +123 145 4.16666666666666e+00 +123 240 -9.72222222222222e+00 +123 219 -3.47222222222222e+00 +123 216 -1.11111111111111e+01 +123 144 -4.86111111111111e+00 +123 212 2.08333333333333e+00 +123 143 -7.80625564189563e-18 +123 128 -3.33066907387547e-16 +123 26 4.44089209850063e-16 +123 211 2.08333333333333e+00 +123 142 -1.12757025938492e-17 +123 127 4.16666666666667e+00 +123 25 -8.78203759713259e-18 +123 210 -3.47222222222222e+00 +123 141 -1.38888888888889e+00 +123 126 -4.86111111111111e+00 +123 24 5.55555555555556e+00 +123 239 8.33333333333333e+00 +123 209 1.82471225629310e-16 +123 140 6.15826833971767e-17 +123 206 2.08333333333333e+00 +123 203 -9.05308814025396e-16 +123 125 3.55271367880050e-15 +123 11 4.44089209850063e-16 +123 122 -1.23165366794353e-16 +123 238 5.10008701937181e-16 +123 208 0.00000000000000e+00 +123 139 -5.42101086242752e-18 +123 205 -2.08333333333333e+00 +123 202 1.60136660876109e-15 +123 124 -1.77635683940025e-15 +123 10 -1.42166009867162e-17 +123 121 -4.16666666666667e+00 +123 237 -9.72222222222222e+00 +123 207 1.11111111111111e+01 +123 138 -1.38888888888889e+00 +123 204 -3.47222222222222e+00 +123 201 -1.11111111111111e+01 +123 227 -2.08333333333333e+00 +123 9 5.55555555555556e+00 +123 120 -4.86111111111111e+00 +124 124 5.55555555555556e+01 +124 152 -5.33427468862868e-16 +124 226 -3.47222222222222e+00 +124 151 -4.86111111111111e+00 +124 225 -2.08333333333333e+00 +124 150 -4.16666666666667e+00 +124 242 -1.76941794549634e-16 +124 221 2.08333333333333e+00 +124 218 1.77635683940025e-15 +124 146 -6.75674793892966e-16 +124 241 -1.38888888888889e+00 +124 220 -3.47222222222222e+00 +124 217 5.55555555555556e+00 +124 145 -4.86111111111111e+00 +124 240 -1.18828558104411e-16 +124 219 2.08333333333333e+00 +124 216 -9.07694058804864e-16 +124 144 4.16666666666667e+00 +124 212 -2.08333333333333e+00 +124 143 -8.33333333333334e+00 +124 128 1.62630325872826e-18 +124 26 5.30378150252753e-16 +124 211 -3.47222222222222e+00 +124 142 -9.72222222222223e+00 +124 127 -4.86111111111111e+00 +124 25 -1.11111111111111e+01 +124 210 2.08333333333333e+00 +124 141 4.15249432061948e-17 +124 126 4.16666666666666e+00 +124 24 -1.59513244626930e-17 +124 239 -1.00787433954252e-15 +124 209 -1.41976274486977e-15 +124 140 8.33333333333334e+00 +124 206 2.08333333333333e+00 +124 203 1.77635683940025e-15 +124 125 -8.88178419700125e-16 +124 11 8.40473524110763e-16 +124 122 -7.10369263412503e-16 +124 238 -1.38888888888889e+00 +124 208 1.11111111111111e+01 +124 139 -9.72222222222223e+00 +124 205 -3.47222222222222e+00 +124 202 5.55555555555557e+00 +124 227 -2.08333333333333e+00 +124 10 -1.11111111111111e+01 +124 121 -4.86111111111111e+00 +124 237 5.61183044478497e-16 +124 207 0.00000000000000e+00 +124 138 -2.51534904016637e-17 +124 204 -2.08333333333333e+00 +124 201 1.74525378957707e-15 +124 123 -2.66453525910038e-15 +124 9 9.87708179134295e-17 +124 120 -4.16666666666667e+00 +125 125 5.55555555555556e+01 +125 152 -6.94444444444444e-01 +125 226 -2.08333333333333e+00 +125 151 -4.96998275867355e-16 +125 225 -2.08333333333333e+00 +125 150 2.11636264069170e-16 +125 242 -9.72222222222222e+00 +125 221 -3.47222222222222e+00 +125 218 5.55555555555556e+00 +125 146 -6.94444444444443e-01 +125 241 -3.60930903220424e-16 +125 220 2.08333333333333e+00 +125 217 2.22044604925031e-15 +125 145 -6.69928522378793e-16 +125 240 -8.33333333333333e+00 +125 219 -2.08333333333333e+00 +125 216 -3.08997619158369e-16 +125 144 2.12503625807159e-16 +125 212 -3.47222222222222e+00 +125 143 -9.72222222222222e+00 +125 128 -6.94444444444443e-01 +125 26 5.55555555555556e+00 +125 211 -2.08333333333333e+00 +125 142 -8.33333333333334e+00 +125 127 -8.67361737988404e-18 +125 25 8.89045781438114e-16 +125 210 2.08333333333333e+00 +125 141 -3.77302356024956e-17 +125 126 -2.41993924898765e-16 +125 24 0.00000000000000e+00 +125 239 -9.72222222222222e+00 +125 209 -2.22222222222222e+01 +125 140 -9.72222222222222e+00 +125 206 -3.47222222222222e+00 +125 203 5.55555555555556e+00 +125 227 -3.47222222222222e+00 +125 11 5.55555555555556e+00 +125 122 -6.94444444444442e-01 +125 238 -9.02164627725188e-16 +125 208 -1.27984645451051e-15 +125 139 8.33333333333334e+00 +125 205 2.08333333333333e+00 +125 202 2.22044604925031e-15 +125 124 -1.77635683940025e-15 +125 10 4.47111423405866e-16 +125 121 -7.12537667757474e-16 +125 237 8.33333333333333e+00 +125 207 6.96328845278815e-17 +125 138 8.01225405466788e-17 +125 204 2.08333333333333e+00 +125 201 -9.33918198851857e-16 +125 123 3.55271367880050e-15 +125 9 4.44089209850063e-16 +125 120 -1.90928002574697e-16 +126 126 2.77777777777778e+01 +126 194 2.08333333333333e+00 +126 23 -1.40859546249317e-15 +126 101 -1.99493199737333e-17 +126 118 -1.87350135405495e-16 +126 193 -2.08333333333333e+00 +126 22 -1.67400815431762e-16 +126 100 -4.16666666666667e+00 +126 117 -4.86111111111111e+00 +126 192 -3.47222222222222e+00 +126 21 -5.55555555555556e+00 +126 99 -4.86111111111111e+00 +126 212 6.86950496486816e-16 +126 143 -4.16666666666667e+00 +126 209 -2.08333333333333e+00 +126 239 1.24032728532342e-16 +126 128 8.88178419700125e-16 +126 26 4.67507976775750e-16 +126 125 -2.43728648374741e-16 +126 203 8.88178419700125e-16 +126 211 8.88178419700125e-16 +126 142 3.07913416985883e-16 +126 208 2.08333333333333e+00 +126 238 -5.19332840620557e-17 +126 127 -1.77635683940025e-15 +126 25 7.78782420496338e-16 +126 124 4.16666666666667e+00 +126 202 -2.75021433578104e-16 +126 210 5.55555555555556e+00 +126 141 -4.86111111111111e+00 +126 207 -3.47222222222222e+00 +126 237 -1.38888888888889e+00 +126 119 4.16666666666667e+00 +126 24 -5.55555555555555e+00 +126 123 -4.86111111111111e+00 +126 201 5.55555555555556e+00 +127 127 2.77777777777778e+01 +127 194 2.08333333333333e+00 +127 23 -2.08333333333333e+00 +127 101 -1.12757025938492e-16 +127 118 -6.94444444444444e-01 +127 193 -3.47222222222222e+00 +127 22 2.77777777777778e+00 +127 100 -4.86111111111111e+00 +127 117 -1.61329283265843e-16 +127 192 -2.08333333333333e+00 +127 21 -4.48859699408999e-17 +127 99 -4.16666666666667e+00 +127 212 7.01695646032618e-16 +127 143 4.92661467177413e-16 +127 209 2.08333333333333e+00 +127 239 8.33333333333333e+00 +127 128 -8.33333333333333e+00 +127 26 -2.08333333333333e+00 +127 125 -8.67361737988404e-18 +127 203 -1.48611591782588e-15 +127 211 5.55555555555556e+00 +127 142 -6.94444444444444e-01 +127 208 -3.47222222222222e+00 +127 238 -9.72222222222223e+00 +127 119 2.91433543964104e-16 +127 25 2.77777777777778e+00 +127 124 -4.86111111111111e+00 +127 202 -1.11111111111111e+01 +127 210 8.88178419700125e-16 +127 141 3.12250225675825e-16 +127 207 2.08333333333333e+00 +127 237 -7.71951946809679e-17 +127 126 -1.77635683940025e-15 +127 24 8.98586760555986e-16 +127 123 4.16666666666667e+00 +127 201 -3.86518074491082e-16 +128 128 2.77777777777778e+01 +128 194 -3.47222222222222e+00 +128 23 2.77777777777778e+00 +128 101 -6.94444444444444e-01 +128 118 1.82145964977565e-16 +128 193 2.08333333333333e+00 +128 22 -2.08333333333333e+00 +128 100 -3.83807569059869e-17 +128 117 4.16666666666667e+00 +128 192 2.08333333333333e+00 +128 21 -1.41640171813506e-15 +128 99 -1.55691431968918e-16 +128 212 -1.11111111111111e+01 +128 143 -4.86111111111111e+00 +128 209 -3.47222222222222e+00 +128 239 -9.72222222222222e+00 +128 119 -4.86111111111111e+00 +128 26 2.77777777777778e+00 +128 125 -6.94444444444443e-01 +128 203 5.55555555555556e+00 +128 211 3.02600826340704e-16 +128 142 4.83120488059541e-16 +128 208 2.08333333333333e+00 +128 238 8.33333333333333e+00 +128 127 -8.33333333333333e+00 +128 25 -2.08333333333333e+00 +128 124 1.62630325872826e-18 +128 202 -1.17343201128106e-15 +128 210 9.06393016197882e-16 +128 141 -4.16666666666667e+00 +128 207 -2.08333333333333e+00 +128 237 3.20164901534969e-16 +128 126 8.88178419700125e-16 +128 24 5.06539254985228e-16 +128 123 -3.43475248243408e-16 +128 201 8.88178419700125e-16 +129 129 2.77777777777778e+01 +129 41 -1.35406009321715e-15 +129 209 2.08333333333333e+00 +129 140 4.16666666666666e+00 +129 133 -4.16666666666667e+00 +129 40 8.56086035394554e-16 +129 208 -2.08333333333333e+00 +129 139 2.68014777038417e-16 +129 132 -4.86111111111111e+00 +129 39 -5.55555555555555e+00 +129 207 -3.47222222222222e+00 +129 138 -4.86111111111111e+00 +129 110 -2.91433543964104e-16 +129 215 1.77635683940025e-15 +129 131 8.88178419700125e-16 +129 38 4.07660016854550e-17 +129 194 -2.08333333333333e+00 +129 239 3.75676052766227e-16 +129 206 5.31408142316614e-16 +129 116 -4.16666666666667e+00 +129 109 4.16666666666667e+00 +129 214 7.63278329429795e-17 +129 130 -8.88178419700125e-16 +129 37 -5.55111512312578e-17 +129 193 2.08333333333333e+00 +129 238 3.38271077815477e-17 +129 205 -4.44089209850063e-16 +129 115 -6.93889390390723e-17 +129 108 -4.86111111111111e+00 +129 213 5.55555555555556e+00 +129 134 -1.63931368479808e-16 +129 36 -5.55555555555556e+00 +129 192 -3.47222222222222e+00 +129 237 -1.38888888888889e+00 +129 204 5.55555555555556e+00 +129 114 -4.86111111111112e+00 +130 130 2.77777777777778e+01 +130 41 -2.08333333333333e+00 +130 209 2.08333333333333e+00 +130 140 -2.68990558993654e-16 +130 133 -4.86111111111111e+00 +130 40 2.77777777777778e+00 +130 208 -3.47222222222222e+00 +130 139 -6.94444444444444e-01 +130 132 -4.16666666666667e+00 +130 39 8.39606162372775e-16 +130 207 -2.08333333333333e+00 +130 138 3.36536354339501e-16 +130 110 7.02563007770607e-16 +130 215 -6.89661001918029e-16 +130 131 -8.33333333333333e+00 +130 38 -2.08333333333333e+00 +130 194 2.08333333333333e+00 +130 239 8.33333333333333e+00 +130 206 2.15214131238373e-16 +130 116 -3.07371315899641e-16 +130 109 -4.86111111111111e+00 +130 214 -1.11111111111111e+01 +130 134 -2.10768902331182e-16 +130 37 2.77777777777778e+00 +130 193 -3.47222222222222e+00 +130 238 -9.72222222222223e+00 +130 205 5.55555555555556e+00 +130 115 -6.94444444444445e-01 +130 108 4.16666666666667e+00 +130 213 2.61075883134509e-16 +130 129 -8.88178419700125e-16 +130 36 -1.90819582357449e-16 +130 192 2.08333333333333e+00 +130 237 4.51028103753970e-17 +130 204 -8.88178419700125e-16 +130 114 -9.35666474854990e-17 +131 131 2.77777777777778e+01 +131 41 2.77777777777778e+00 +131 209 -3.47222222222222e+00 +131 140 -4.86111111111111e+00 +131 133 -2.28983498828939e-16 +131 40 -2.08333333333333e+00 +131 208 2.08333333333333e+00 +131 139 -4.11129463806503e-16 +131 132 -1.04083408558608e-16 +131 39 -1.43635103810880e-15 +131 207 2.08333333333333e+00 +131 138 4.16666666666667e+00 +131 110 -6.94444444444444e-01 +131 215 5.55555555555555e+00 +131 134 -6.94444444444444e-01 +131 38 2.77777777777778e+00 +131 194 -3.47222222222222e+00 +131 239 -9.72222222222222e+00 +131 206 -1.11111111111111e+01 +131 116 -4.86111111111111e+00 +131 109 7.84095011141517e-16 +131 214 -8.52616588442601e-16 +131 130 -8.33333333333333e+00 +131 37 -2.08333333333333e+00 +131 193 2.08333333333333e+00 +131 238 8.33333333333333e+00 +131 205 4.70652163075957e-16 +131 115 -3.15719672627779e-16 +131 108 -2.68014777038417e-16 +131 213 1.77635683940025e-15 +131 129 8.88178419700125e-16 +131 36 2.49691760323412e-16 +131 192 -2.08333333333333e+00 +131 237 2.07299455379228e-16 +131 204 8.35919874986324e-17 +131 114 -4.16666666666667e+00 +132 132 5.55555555555556e+01 +132 227 2.08333333333333e+00 +132 160 -4.16666666666667e+00 +132 226 -2.08333333333333e+00 +132 159 -4.86111111111111e+00 +132 225 -3.47222222222222e+00 +132 230 -1.06902334207071e-16 +132 155 1.52655665885959e-16 +132 242 8.33333333333333e+00 +132 221 2.08333333333333e+00 +132 229 -8.98586760555986e-16 +132 154 4.16666666666667e+00 +132 241 -2.14997290803876e-16 +132 220 2.08333333333333e+00 +132 228 -1.11111111111111e+01 +132 153 -4.86111111111111e+00 +132 240 -9.72222222222222e+00 +132 219 -3.47222222222222e+00 +132 137 -1.80411241501588e-16 +132 56 4.44089209850063e-16 +132 212 -2.08333333333333e+00 +132 143 -8.47846098883664e-17 +132 136 4.16666666666667e+00 +132 55 2.15105711021124e-16 +132 211 2.08333333333333e+00 +132 142 -2.42861286636753e-17 +132 135 -4.86111111111111e+00 +132 54 5.55555555555555e+00 +132 210 -3.47222222222222e+00 +132 141 -1.38888888888889e+00 +132 215 -6.60062282609175e-16 +132 134 1.77635683940025e-15 +132 41 0.00000000000000e+00 +132 131 -1.59594559789866e-16 +132 239 -8.33333333333333e+00 +132 209 2.91677489452913e-16 +132 140 7.23162849047831e-17 +132 206 -2.08333333333333e+00 +132 214 1.67227343084164e-15 +132 133 0.00000000000000e+00 +132 40 -8.76035355368288e-17 +132 130 -4.16666666666667e+00 +132 238 5.32560107124880e-16 +132 208 0.00000000000000e+00 +132 139 6.84131570838353e-17 +132 205 -2.08333333333333e+00 +132 213 -1.11111111111111e+01 +132 161 2.64545330086463e-16 +132 39 5.55555555555555e+00 +132 129 -4.86111111111111e+00 +132 237 -9.72222222222222e+00 +132 207 1.11111111111111e+01 +132 138 -1.38888888888889e+00 +132 204 -3.47222222222222e+00 +133 133 5.55555555555556e+01 +133 227 2.08333333333333e+00 +133 160 -4.86111111111111e+00 +133 226 -3.47222222222222e+00 +133 159 -4.16666666666667e+00 +133 225 -2.08333333333333e+00 +133 230 8.88178419700125e-16 +133 155 -3.60822483003176e-16 +133 242 8.12934788929631e-16 +133 221 -2.08333333333333e+00 +133 229 5.55555555555556e+00 +133 154 -4.86111111111111e+00 +133 241 -1.38888888888889e+00 +133 220 -3.47222222222222e+00 +133 228 -9.50628464835290e-16 +133 153 4.16666666666667e+00 +133 240 -1.46584133720040e-16 +133 219 2.08333333333333e+00 +133 137 3.11382863937837e-16 +133 56 5.07298196505968e-16 +133 212 2.08333333333333e+00 +133 143 8.33333333333334e+00 +133 136 -4.86111111111111e+00 +133 55 -1.11111111111111e+01 +133 211 -3.47222222222222e+00 +133 142 -9.72222222222223e+00 +133 135 4.16666666666667e+00 +133 54 -8.76035355368288e-17 +133 210 2.08333333333333e+00 +133 141 -5.52943107967607e-18 +133 215 1.33226762955019e-15 +133 134 -6.21724893790088e-15 +133 41 1.32706345912226e-16 +133 131 -2.01227923213310e-16 +133 239 1.15912054260425e-15 +133 209 -1.48790485141048e-15 +133 140 -8.33333333333334e+00 +133 206 -2.08333333333333e+00 +133 214 5.55555555555556e+00 +133 161 -2.22911966663020e-16 +133 40 -1.11111111111111e+01 +133 130 -4.86111111111111e+00 +133 238 -1.38888888888889e+00 +133 208 1.11111111111111e+01 +133 139 -9.72222222222223e+00 +133 205 -3.47222222222222e+00 +133 213 1.70956998557514e-15 +133 132 0.00000000000000e+00 +133 39 2.63677968348475e-16 +133 129 -4.16666666666667e+00 +133 237 5.89697561614866e-16 +133 207 -4.44089209850063e-16 +133 138 -1.12757025938492e-17 +133 204 -2.08333333333333e+00 +134 134 5.55555555555556e+01 +134 227 -3.47222222222222e+00 +134 160 -2.08166817117217e-16 +134 226 2.08333333333333e+00 +134 159 2.63677968348475e-16 +134 225 2.08333333333333e+00 +134 230 5.55555555555556e+00 +134 155 -6.94444444444443e-01 +134 242 -9.72222222222222e+00 +134 221 -3.47222222222222e+00 +134 229 1.33226762955019e-15 +134 154 -3.76434994286967e-16 +134 241 1.05644659686988e-15 +134 220 -2.08333333333333e+00 +134 228 -5.03069808033274e-17 +134 153 2.15105711021124e-16 +134 240 8.33333333333333e+00 +134 219 2.08333333333333e+00 +134 137 -6.94444444444445e-01 +134 56 5.55555555555556e+00 +134 212 -3.47222222222222e+00 +134 143 -9.72222222222222e+00 +134 136 4.02455846426619e-16 +134 55 4.10262102068515e-16 +134 211 2.08333333333333e+00 +134 142 8.33333333333334e+00 +134 135 -2.40259201422788e-16 +134 54 4.44089209850063e-16 +134 210 -2.08333333333333e+00 +134 141 -4.94396190653390e-17 +134 215 5.55555555555556e+00 +134 161 -6.94444444444444e-01 +134 41 5.55555555555556e+00 +134 131 -6.94444444444444e-01 +134 239 -9.72222222222222e+00 +134 209 -2.22222222222222e+01 +134 140 -9.72222222222222e+00 +134 206 -3.47222222222222e+00 +134 214 1.33226762955019e-15 +134 133 -5.32907051820075e-15 +134 40 3.33717428691038e-16 +134 130 -2.17707796235089e-16 +134 238 1.36349265211777e-15 +134 208 -1.35731269973460e-15 +134 139 -8.33333333333334e+00 +134 205 -2.08333333333333e+00 +134 213 -7.78999260930835e-16 +134 132 1.77635683940025e-15 +134 39 0.00000000000000e+00 +134 129 -1.63931368479808e-16 +134 237 -8.33333333333333e+00 +134 207 2.44921270764475e-16 +134 138 -7.80625564189563e-18 +134 204 -2.08333333333333e+00 +135 135 2.77777777777778e+01 +135 110 -1.52655665885959e-16 +135 119 -4.16666666666667e+00 +135 194 -2.08333333333333e+00 +135 52 -1.11022302462516e-16 +135 109 -4.16666666666667e+00 +135 118 -1.52655665885959e-16 +135 193 -2.08333333333333e+00 +135 51 -5.55555555555556e+00 +135 108 -4.86111111111111e+00 +135 117 -4.86111111111112e+00 +135 192 -3.47222222222222e+00 +135 137 0.00000000000000e+00 +135 56 5.20417042793042e-16 +135 134 -2.40259201422788e-16 +135 215 1.33226762955019e-15 +135 212 7.95370713735366e-16 +135 143 4.16666666666667e+00 +135 209 2.08333333333333e+00 +135 239 4.29560900738757e-16 +135 136 -8.88178419700125e-16 +135 55 8.53483950180589e-16 +135 133 4.16666666666667e+00 +135 214 -1.83013326715553e-16 +135 211 8.88178419700125e-16 +135 142 2.73218947466347e-16 +135 208 2.08333333333333e+00 +135 238 -1.19262238973405e-17 +135 53 -1.33226762955019e-15 +135 54 -5.55555555555555e+00 +135 132 -4.86111111111111e+00 +135 213 5.55555555555556e+00 +135 210 5.55555555555556e+00 +135 141 -4.86111111111111e+00 +135 207 -3.47222222222222e+00 +135 237 -1.38888888888889e+00 +136 136 2.77777777777778e+01 +136 110 -4.16333634234434e-17 +136 119 8.50014503228635e-17 +136 194 -2.08333333333333e+00 +136 52 2.77777777777778e+00 +136 109 -4.86111111111111e+00 +136 118 -6.94444444444446e-01 +136 193 -3.47222222222222e+00 +136 51 -6.24500451351651e-17 +136 108 -4.16666666666667e+00 +136 117 -1.38777878078145e-16 +136 192 -2.08333333333333e+00 +136 137 8.33333333333334e+00 +136 56 2.08333333333333e+00 +136 134 3.74700270810990e-16 +136 215 -5.75060832286312e-16 +136 212 3.09648140461860e-16 +136 143 -6.32306706993546e-16 +136 209 -2.08333333333333e+00 +136 239 -8.33333333333334e+00 +136 53 2.08333333333333e+00 +136 55 2.77777777777778e+00 +136 133 -4.86111111111111e+00 +136 214 -1.11111111111111e+01 +136 211 5.55555555555556e+00 +136 142 -6.94444444444445e-01 +136 208 -3.47222222222222e+00 +136 238 -9.72222222222223e+00 +136 135 -8.88178419700125e-16 +136 54 7.77156117237610e-16 +136 132 4.16666666666667e+00 +136 213 -1.45716771982052e-16 +136 210 8.88178419700125e-16 +136 141 2.77555756156289e-16 +136 207 2.08333333333333e+00 +136 237 5.46437894932694e-17 +137 137 2.77777777777778e+01 +137 110 -6.94444444444444e-01 +137 119 -4.86111111111111e+00 +137 194 -3.47222222222222e+00 +137 52 2.08333333333333e+00 +137 109 -3.98986399474666e-17 +137 118 0.00000000000000e+00 +137 193 -2.08333333333333e+00 +137 51 -1.35308431126191e-15 +137 108 -1.13624387676481e-16 +137 117 -4.16666666666667e+00 +137 192 -2.08333333333333e+00 +137 53 2.77777777777778e+00 +137 56 2.77777777777778e+00 +137 134 -6.94444444444445e-01 +137 215 5.55555555555555e+00 +137 212 -1.11111111111111e+01 +137 143 -4.86111111111111e+00 +137 209 -3.47222222222222e+00 +137 239 -9.72222222222222e+00 +137 136 8.33333333333334e+00 +137 55 2.08333333333333e+00 +137 133 3.11382863937837e-16 +137 214 -3.49655200626575e-16 +137 211 7.57206797263876e-16 +137 142 -5.96744875736022e-16 +137 208 -2.08333333333333e+00 +137 238 -8.33333333333334e+00 +137 135 0.00000000000000e+00 +137 54 5.55111512312578e-16 +137 132 -1.80411241501588e-16 +137 213 1.33226762955019e-15 +137 210 6.86950496486816e-16 +137 141 4.16666666666667e+00 +137 207 2.08333333333333e+00 +137 237 2.14238349283136e-16 +138 138 5.55555555555556e+01 +138 155 -4.16666666666667e+00 +138 229 -2.08333333333333e+00 +138 154 -9.35666474854990e-17 +138 228 -3.47222222222222e+00 +138 153 -4.86111111111111e+00 +138 242 3.41632104550182e-16 +138 221 -1.53262819102551e-15 +138 218 2.08333333333333e+00 +138 146 4.16666666666667e+00 +138 241 -8.33333333333333e+00 +138 220 -9.79115876917347e-16 +138 217 -2.08333333333333e+00 +138 145 -9.44340092234874e-17 +138 240 -9.72222222222222e+00 +138 219 -1.11111111111111e+01 +138 216 -3.47222222222222e+00 +138 144 -4.86111111111111e+00 +138 215 2.08333333333333e+00 +138 134 -7.80625564189563e-18 +138 41 9.38810661155198e-16 +138 131 4.16666666666667e+00 +138 214 2.08333333333333e+00 +138 133 2.60208521396521e-18 +138 40 -8.88178419700125e-16 +138 130 2.18575157973078e-16 +138 213 -3.47222222222222e+00 +138 132 -1.38888888888889e+00 +138 39 5.55555555555555e+00 +138 129 -4.86111111111111e+00 +138 239 -2.84494650060196e-16 +138 209 4.44089209850063e-16 +138 140 3.55271367880050e-15 +138 206 -2.58452113877095e-15 +138 203 -2.08333333333333e+00 +138 125 2.54787510534094e-17 +138 11 7.98121876748048e-16 +138 122 -4.16666666666667e+00 +138 238 8.33333333333333e+00 +138 208 2.06323673423991e-16 +138 139 8.88178419700125e-16 +138 205 1.81907440499618e-15 +138 202 2.08333333333333e+00 +138 124 -2.42861286636753e-17 +138 10 -8.88178419700125e-16 +138 121 2.20309881449055e-16 +138 237 -9.72222222222222e+00 +138 207 1.11111111111111e+01 +138 230 -2.08333333333333e+00 +138 204 -1.11111111111111e+01 +138 201 -3.47222222222222e+00 +138 123 -1.38888888888889e+00 +138 9 5.55555555555555e+00 +138 120 -4.86111111111111e+00 +139 139 5.55555555555556e+01 +139 155 -2.60208521396521e-16 +139 229 -3.47222222222222e+00 +139 154 -6.94444444444445e-01 +139 228 -2.08333333333333e+00 +139 153 -2.86229373536173e-17 +139 242 -7.56447855743136e-16 +139 221 0.00000000000000e+00 +139 218 2.08333333333333e+00 +139 146 2.40584462074533e-16 +139 241 -9.72222222222222e+00 +139 220 5.55555555555556e+00 +139 217 -3.47222222222222e+00 +139 145 -6.94444444444443e-01 +139 240 -8.33333333333333e+00 +139 219 -8.79071121451247e-16 +139 216 -2.08333333333333e+00 +139 144 -2.16840434497101e-17 +139 215 -2.08333333333333e+00 +139 134 -8.33333333333334e+00 +139 41 -5.41016884070267e-16 +139 131 -4.11129463806503e-16 +139 214 -3.47222222222222e+00 +139 133 -9.72222222222223e+00 +139 40 5.55555555555556e+00 +139 130 -6.94444444444444e-01 +139 213 2.08333333333333e+00 +139 132 4.15249432061948e-17 +139 39 -8.88178419700125e-16 +139 129 2.60208521396521e-16 +139 239 2.53052787058117e-16 +139 209 6.96681210984873e-16 +139 140 -5.32907051820075e-15 +139 206 1.33226762955019e-15 +139 203 2.08333333333333e+00 +139 125 8.33333333333334e+00 +139 11 -7.05422591000537e-16 +139 122 6.82180006927879e-16 +139 238 -9.72222222222222e+00 +139 208 -2.22222222222222e+01 +139 230 -2.08333333333333e+00 +139 205 5.55555555555556e+00 +139 202 -3.47222222222222e+00 +139 124 -9.72222222222223e+00 +139 10 5.55555555555556e+00 +139 121 -6.94444444444446e-01 +139 237 8.33333333333333e+00 +139 207 -1.03446439782273e-16 +139 138 -8.88178419700125e-16 +139 204 1.82006373947857e-15 +139 201 2.08333333333333e+00 +139 123 -6.28837260041593e-18 +139 9 -8.88178419700125e-16 +139 120 2.73110527249099e-16 +140 140 5.55555555555556e+01 +140 155 -4.86111111111111e+00 +140 229 -2.08333333333333e+00 +140 154 -3.66026653431106e-16 +140 228 -2.08333333333333e+00 +140 153 -4.16666666666667e+00 +140 242 -1.38888888888889e+00 +140 221 5.55555555555556e+00 +140 218 -3.47222222222222e+00 +140 146 -4.86111111111111e+00 +140 241 -8.23126289350995e-16 +140 220 4.44089209850063e-16 +140 217 2.08333333333333e+00 +140 145 3.62557206479153e-16 +140 240 3.64291929955129e-16 +140 219 -1.58662145921529e-15 +140 216 2.08333333333333e+00 +140 144 4.16666666666667e+00 +140 215 -3.47222222222222e+00 +140 134 -9.72222222222222e+00 +140 41 -1.11111111111111e+01 +140 131 -4.86111111111111e+00 +140 214 -2.08333333333333e+00 +140 133 -8.33333333333334e+00 +140 40 -5.38889137306764e-16 +140 130 -2.68990558993654e-16 +140 213 2.08333333333333e+00 +140 132 7.32920668600201e-17 +140 39 7.98121876748048e-16 +140 129 4.16666666666666e+00 +140 239 -1.38888888888889e+00 +140 209 1.11111111111111e+01 +140 230 -3.47222222222222e+00 +140 206 5.55555555555557e+00 +140 203 -3.47222222222222e+00 +140 125 -9.72222222222222e+00 +140 11 -1.11111111111111e+01 +140 122 -4.86111111111111e+00 +140 238 3.38271077815477e-16 +140 208 7.37257477290143e-16 +140 139 -5.32907051820075e-15 +140 205 1.77635683940025e-15 +140 202 2.08333333333333e+00 +140 124 8.33333333333334e+00 +140 10 -4.23055687703844e-16 +140 121 8.43942971062717e-16 +140 237 -3.33066907387547e-16 +140 207 4.44089209850063e-16 +140 138 3.55271367880050e-15 +140 204 -2.69303622370959e-15 +140 201 -2.08333333333333e+00 +140 123 -4.94396190653390e-17 +140 9 1.04983296361771e-15 +140 120 -4.16666666666667e+00 +141 141 5.55555555555556e+01 +141 230 -2.08333333333333e+00 +141 160 -9.10729824887824e-17 +141 229 2.08333333333333e+00 +141 159 -4.86111111111111e+00 +141 228 -3.47222222222222e+00 +141 227 1.39731975989932e-15 +141 242 1.21430643318376e-16 +141 152 4.16666666666667e+00 +141 218 2.08333333333333e+00 +141 226 -8.50556604314878e-16 +141 241 8.33333333333333e+00 +141 151 -1.06685493772574e-16 +141 217 2.08333333333333e+00 +141 225 -1.11111111111111e+01 +141 240 -9.72222222222222e+00 +141 150 -4.86111111111111e+00 +141 216 -3.47222222222222e+00 +141 137 4.16666666666667e+00 +141 56 -9.78384040450919e-16 +141 134 -4.94396190653390e-17 +141 215 2.08333333333333e+00 +141 136 2.77555756156289e-16 +141 55 8.88178419700125e-16 +141 133 -4.66206934168767e-18 +141 214 -2.08333333333333e+00 +141 135 -4.86111111111111e+00 +141 54 5.55555555555555e+00 +141 132 -1.38888888888889e+00 +141 213 -3.47222222222222e+00 +141 212 1.02001740387436e-15 +141 143 -8.88178419700125e-16 +141 209 8.88178419700125e-16 +141 239 -1.71737624121704e-16 +141 128 -4.16666666666667e+00 +141 26 -7.28583859910259e-16 +141 125 -3.87060175577325e-17 +141 203 -2.08333333333333e+00 +141 211 1.45109618765460e-15 +141 142 -1.77635683940025e-15 +141 208 -9.99905453574756e-17 +141 238 -8.33333333333333e+00 +141 127 3.12250225675825e-16 +141 25 8.88178419700125e-16 +141 124 6.84131570838353e-17 +141 202 -2.08333333333333e+00 +141 210 -1.11111111111111e+01 +141 161 -4.16666666666667e+00 +141 207 1.11111111111111e+01 +141 237 -9.72222222222222e+00 +141 126 -4.86111111111111e+00 +141 24 5.55555555555555e+00 +141 123 -1.38888888888889e+00 +141 201 -3.47222222222222e+00 +142 142 5.55555555555556e+01 +142 230 2.08333333333333e+00 +142 160 -6.94444444444443e-01 +142 229 -3.47222222222222e+00 +142 159 -9.02056207507940e-17 +142 228 2.08333333333333e+00 +142 227 2.66453525910038e-15 +142 242 -8.14452671971111e-16 +142 152 5.68121938382404e-16 +142 218 -2.08333333333333e+00 +142 226 5.55555555555556e+00 +142 241 -9.72222222222222e+00 +142 151 -6.94444444444445e-01 +142 217 -3.47222222222222e+00 +142 225 -9.80118763926896e-16 +142 240 8.33333333333333e+00 +142 150 -8.32667268468867e-17 +142 216 2.08333333333333e+00 +142 137 -5.96744875736022e-16 +142 56 -1.10068204550728e-15 +142 134 8.33333333333334e+00 +142 215 2.08333333333333e+00 +142 136 -6.94444444444445e-01 +142 55 5.55555555555556e+00 +142 133 -9.72222222222223e+00 +142 214 -3.47222222222222e+00 +142 135 2.87096735274162e-16 +142 54 8.88178419700125e-16 +142 132 -2.51534904016637e-17 +142 213 -2.08333333333333e+00 +142 212 1.77635683940025e-15 +142 143 -8.88178419700125e-16 +142 209 1.40339129206524e-15 +142 239 -8.00574884163296e-16 +142 128 4.76181594155634e-16 +142 26 -7.88648660265956e-16 +142 125 -8.33333333333334e+00 +142 203 -2.08333333333333e+00 +142 211 5.55555555555556e+00 +142 161 8.32667268468867e-17 +142 208 -2.22222222222222e+01 +142 238 -9.72222222222222e+00 +142 127 -6.94444444444444e-01 +142 25 5.55555555555556e+00 +142 124 -9.72222222222223e+00 +142 202 -3.47222222222222e+00 +142 210 1.63150742915619e-15 +142 141 -1.77635683940025e-15 +142 207 3.64183509737881e-16 +142 237 -8.33333333333333e+00 +142 126 3.07913416985883e-16 +142 24 4.44089209850063e-16 +142 123 -1.12757025938492e-17 +142 201 -2.08333333333333e+00 +143 143 5.55555555555556e+01 +143 230 -3.47222222222222e+00 +143 160 1.30104260698261e-17 +143 229 2.08333333333333e+00 +143 159 -4.16666666666667e+00 +143 228 -2.08333333333333e+00 +143 227 5.55555555555556e+00 +143 242 -1.38888888888889e+00 +143 152 -4.86111111111111e+00 +143 218 -3.47222222222222e+00 +143 226 3.10862446895044e-15 +143 241 -8.79071121451247e-16 +143 151 6.93889390390723e-16 +143 217 -2.08333333333333e+00 +143 225 1.39471767468535e-15 +143 240 1.29236898960272e-16 +143 150 4.16666666666667e+00 +143 216 2.08333333333333e+00 +143 137 -4.86111111111111e+00 +143 56 -1.11111111111111e+01 +143 134 -9.72222222222222e+00 +143 215 -3.47222222222222e+00 +143 136 -6.32306706993546e-16 +143 55 -8.92623648607316e-16 +143 133 8.33333333333334e+00 +143 214 2.08333333333333e+00 +143 135 4.16666666666667e+00 +143 54 -7.28583859910259e-16 +143 132 8.08814820674186e-17 +143 213 2.08333333333333e+00 +143 212 5.55555555555556e+00 +143 161 -4.86111111111111e+00 +143 209 1.11111111111111e+01 +143 239 -1.38888888888889e+00 +143 128 -4.86111111111111e+00 +143 26 -1.11111111111111e+01 +143 125 -9.72222222222222e+00 +143 203 -3.47222222222222e+00 +143 211 1.77635683940025e-15 +143 142 -8.88178419700125e-16 +143 208 9.95053648852884e-16 +143 238 -7.63820430516038e-16 +143 127 5.20417042793042e-16 +143 25 -1.15619319673854e-15 +143 124 -8.33333333333334e+00 +143 202 -2.08333333333333e+00 +143 210 1.09200842812740e-15 +143 141 -8.88178419700125e-16 +143 207 8.88178419700125e-16 +143 237 -1.84856470408779e-16 +143 126 -4.16666666666667e+00 +143 24 -1.02695629777827e-15 +143 123 -7.80625564189563e-18 +143 201 -2.08333333333333e+00 +144 144 2.77777777777778e+01 +144 164 -4.16666666666667e+00 +144 149 1.47234655023532e-16 +144 14 7.40279690845946e-16 +144 223 -2.08333333333333e+00 +144 163 3.27429056090622e-17 +144 148 -4.16666666666667e+00 +144 13 -4.72847672475241e-17 +144 222 -3.47222222222222e+00 +144 162 -4.86111111111112e+00 +144 147 -4.86111111111111e+00 +144 12 -5.55555555555556e+00 +144 209 2.08333333333333e+00 +144 242 -2.68882138776405e-17 +144 221 3.67436116255337e-16 +144 140 4.16666666666667e+00 +144 125 1.04950770296597e-16 +144 218 -4.44089209850063e-16 +144 146 1.77635683940025e-15 +144 11 -9.36967517461973e-16 +144 208 2.08333333333333e+00 +144 241 2.16840434497101e-17 +144 220 0.00000000000000e+00 +144 139 -4.94396190653390e-17 +144 124 4.16666666666667e+00 +144 217 7.62953068778049e-16 +144 145 0.00000000000000e+00 +144 10 -4.23597788790087e-16 +144 207 -3.47222222222222e+00 +144 240 -1.38888888888889e+00 +144 219 5.55555555555556e+00 +144 138 -4.86111111111111e+00 +144 123 -4.86111111111111e+00 +144 216 5.55555555555556e+00 +144 224 -2.08333333333333e+00 +144 9 -5.55555555555555e+00 +145 145 2.77777777777778e+01 +145 164 -5.89805981832114e-17 +145 149 3.42933147157165e-16 +145 14 2.08333333333333e+00 +145 223 -3.47222222222222e+00 +145 163 -6.94444444444445e-01 +145 148 -4.86111111111111e+00 +145 13 2.77777777777778e+00 +145 222 -2.08333333333333e+00 +145 162 6.07153216591882e-18 +145 147 -4.16666666666667e+00 +145 12 2.41777084464267e-17 +145 209 -2.08333333333333e+00 +145 242 -8.33333333333333e+00 +145 221 -2.85470432015433e-16 +145 140 2.51534904016637e-16 +145 125 -6.65483293471603e-16 +145 218 8.31284910698948e-16 +145 146 8.33333333333333e+00 +145 11 2.08333333333333e+00 +145 208 -3.47222222222222e+00 +145 241 -9.72222222222223e+00 +145 220 5.55555555555556e+00 +145 139 -6.94444444444443e-01 +145 124 -4.86111111111111e+00 +145 217 -1.11111111111111e+01 +145 224 -2.08333333333333e+00 +145 10 2.77777777777778e+00 +145 207 2.08333333333333e+00 +145 240 6.97141996908179e-17 +145 219 0.00000000000000e+00 +145 138 -9.35666474854990e-17 +145 123 4.16666666666666e+00 +145 216 4.79366438037310e-16 +145 144 0.00000000000000e+00 +145 9 -4.30062344243531e-16 +146 146 2.77777777777778e+01 +146 164 -4.86111111111111e+00 +146 149 -6.94444444444444e-01 +146 14 2.77777777777778e+00 +146 223 -2.08333333333333e+00 +146 163 -6.63531729561129e-17 +146 148 3.84241249928863e-16 +146 13 2.08333333333333e+00 +146 222 -2.08333333333333e+00 +146 162 -4.16666666666667e+00 +146 147 1.41379963292110e-16 +146 12 6.97250417125428e-16 +146 209 -3.47222222222222e+00 +146 242 -9.72222222222222e+00 +146 221 -1.11111111111111e+01 +146 140 -4.86111111111111e+00 +146 125 -6.94444444444443e-01 +146 218 5.55555555555556e+00 +146 224 -3.47222222222222e+00 +146 11 2.77777777777778e+00 +146 208 -2.08333333333333e+00 +146 241 -8.33333333333333e+00 +146 220 -2.45111006144660e-16 +146 139 2.41451823812522e-16 +146 124 -6.75674793892966e-16 +146 217 6.99852502339393e-16 +146 145 8.33333333333333e+00 +146 10 2.08333333333333e+00 +146 207 2.08333333333333e+00 +146 240 -1.18178036800920e-17 +146 219 5.99279198314207e-16 +146 138 4.16666666666667e+00 +146 123 1.31730563956989e-16 +146 216 -4.44089209850063e-16 +146 144 1.77635683940025e-15 +146 9 -8.13138076836972e-16 +147 147 2.83333333333334e+01 +147 29 -2.04166666666667e+00 +147 166 -2.15620707053055e-17 +147 28 5.77337656848531e-17 +147 165 -7.08333333333333e-01 +147 27 2.83333333333334e+00 +147 224 -5.11750201676736e-16 +147 164 -4.74202925190848e-17 +147 149 -8.16666666666667e+00 +147 14 -2.04166666666667e+00 +147 223 -6.93889390390723e-18 +147 163 -1.50568576703924e-17 +147 148 1.77635683940025e-15 +147 13 6.63832426257404e-17 +147 222 5.66666666666667e+00 +147 162 -7.08333333333333e-01 +147 167 -4.74202925190848e-17 +147 12 2.83333333333334e+00 +147 152 1.27502175484295e-16 +147 226 2.08333333333333e+00 +147 151 4.16666666666667e+00 +147 225 -3.47222222222222e+00 +147 150 -4.86111111111111e+00 +147 242 8.33333333333333e+00 +147 221 2.08333333333333e+00 +147 218 7.59808882477842e-16 +147 146 1.48318857196017e-16 +147 241 8.23993651088983e-17 +147 220 -2.08333333333333e+00 +147 217 -9.28077059647592e-17 +147 145 -4.16666666666667e+00 +147 240 -9.72222222222223e+00 +147 219 -3.47222222222222e+00 +147 216 -1.11111111111111e+01 +147 227 2.08333333333333e+00 +147 144 -4.86111111111111e+00 +147 398 -4.16666666666667e-02 +147 299 8.31786354203723e-19 +147 397 -4.16666666666667e-02 +147 298 -8.33333333333334e-02 +147 396 -6.94444444444445e-02 +147 297 -9.72222222222222e-02 +147 449 -1.66666666666667e-01 +147 392 -4.16666666666667e-02 +147 389 -1.18108156582772e-17 +147 293 -1.37727557223549e-18 +147 448 8.41950749570775e-19 +147 391 4.16666666666667e-02 +147 388 -1.52317699740005e-18 +147 292 8.33333333333334e-02 +147 447 -1.94444444444445e-01 +147 390 -6.94444444444445e-02 +147 387 -2.22222222222222e-01 +147 291 -9.72222222222222e-02 +148 148 2.83333333333333e+01 +148 29 1.60372347793683e-16 +148 166 -4.95833333333333e+00 +148 28 -5.66666666666666e+00 +148 165 -1.59089728153303e-17 +148 27 1.73936098136302e-16 +148 224 -3.43158457921135e-16 +148 164 4.25000000000000e+00 +148 149 -3.58046925441613e-15 +148 14 -4.28751137241182e-17 +148 223 5.66666666666667e+00 +148 163 -4.95833333333333e+00 +148 167 -4.25000000000000e+00 +148 13 -5.66666666666666e+00 +148 222 -6.93889390390723e-18 +148 162 -2.15485181781494e-17 +148 147 1.77635683940025e-15 +148 12 5.68664039468647e-17 +148 152 -8.82540568403201e-17 +148 226 -3.47222222222222e+00 +148 151 -4.86111111111111e+00 +148 225 2.08333333333333e+00 +148 150 4.16666666666666e+00 +148 242 -6.76542155630955e-17 +148 221 2.08333333333333e+00 +148 218 1.77635683940025e-15 +148 146 3.56485674313234e-16 +148 241 -1.38888888888889e+00 +148 220 -3.47222222222222e+00 +148 217 5.55555555555555e+00 +148 227 -2.08333333333333e+00 +148 145 -4.86111111111111e+00 +148 240 1.03866568124111e-16 +148 219 -2.08333333333333e+00 +148 216 -1.70558554259126e-16 +148 144 -4.16666666666667e+00 +148 398 -4.16666666666667e-02 +148 299 8.61093694178722e-18 +148 397 -6.94444444444444e-02 +148 298 -9.72222222222222e-02 +148 396 -4.16666666666667e-02 +148 297 -8.33333333333334e-02 +148 449 -1.89464329641842e-17 +148 392 4.16666666666667e-02 +148 389 -4.16333634234434e-17 +148 293 1.57073789738837e-17 +148 448 -2.77777777777778e-02 +148 391 -6.94444444444444e-02 +148 388 1.11111111111111e-01 +148 292 -9.72222222222222e-02 +148 447 2.03287907341032e-19 +148 390 4.16666666666667e-02 +148 387 -4.20128341838133e-19 +148 291 8.33333333333334e-02 +149 149 2.83333333333333e+01 +149 29 2.83333333333333e+00 +149 166 -4.25000000000000e+00 +149 28 2.38095879275500e-16 +149 165 -7.12574937207153e-17 +149 27 -2.04166666666667e+00 +149 224 -1.13333333333333e+01 +149 164 -4.95833333333333e+00 +149 167 -4.95833333333333e+00 +149 14 2.83333333333333e+00 +149 223 -2.94465921915274e-16 +149 163 4.25000000000000e+00 +149 148 -4.46864767411626e-15 +149 13 6.32276213807445e-17 +149 222 -2.67408513206419e-16 +149 162 4.14842856247266e-17 +149 147 -8.16666666666667e+00 +149 12 -2.04166666666667e+00 +149 152 -6.94444444444444e-01 +149 226 -2.08333333333333e+00 +149 151 -2.25514051876985e-17 +149 225 2.08333333333333e+00 +149 150 8.13151629364128e-17 +149 242 -9.72222222222222e+00 +149 221 -3.47222222222222e+00 +149 218 5.55555555555555e+00 +149 227 -3.47222222222222e+00 +149 146 -6.94444444444444e-01 +149 241 -1.50812522192734e-16 +149 220 2.08333333333333e+00 +149 217 1.77635683940025e-15 +149 145 3.42933147157165e-16 +149 240 8.33333333333333e+00 +149 219 2.08333333333333e+00 +149 216 5.05346632595494e-16 +149 144 1.67183974997265e-16 +149 398 -6.94444444444444e-02 +149 299 -1.38888888888889e-02 +149 397 -4.16666666666667e-02 +149 298 6.87113126812688e-18 +149 396 -4.16666666666667e-02 +149 297 2.42590236093632e-18 +149 449 -1.94444444444444e-01 +149 392 -6.94444444444444e-02 +149 389 1.11111111111111e-01 +149 293 -1.38888888888889e-02 +149 448 -1.77775274969733e-17 +149 391 4.16666666666667e-02 +149 388 -4.16333634234434e-17 +149 292 1.40438062654763e-17 +149 447 -1.66666666666667e-01 +149 390 -4.16666666666667e-02 +149 387 -6.72882973298816e-18 +149 291 -1.15196480826585e-18 +150 150 2.77777777777778e+01 +150 209 2.08333333333333e+00 +150 26 7.21644966006352e-16 +150 125 2.14238349283136e-16 +150 142 -9.02056207507940e-17 +150 208 -2.08333333333333e+00 +150 25 -4.78783679369599e-16 +150 124 -4.16666666666667e+00 +150 141 -4.86111111111111e+00 +150 207 -3.47222222222222e+00 +150 24 -5.55555555555555e+00 +150 123 -4.86111111111111e+00 +150 227 -4.57966997657877e-16 +150 167 -4.16666666666667e+00 +150 224 -2.08333333333333e+00 +150 242 -1.92554305833426e-16 +150 152 -1.77635683940025e-15 +150 29 -1.99493199737333e-17 +150 149 1.02131844648135e-16 +150 218 -4.44089209850063e-16 +150 226 8.88178419700125e-16 +150 166 7.11236625150491e-17 +150 223 2.08333333333333e+00 +150 241 7.13405029495462e-17 +150 151 0.00000000000000e+00 +150 28 -1.22514845490862e-16 +150 148 4.16666666666666e+00 +150 217 5.93966607669028e-16 +150 225 5.55555555555556e+00 +150 165 -4.86111111111111e+00 +150 222 -3.47222222222222e+00 +150 240 -1.38888888888889e+00 +150 143 4.16666666666667e+00 +150 27 -5.55555555555556e+00 +150 147 -4.86111111111111e+00 +150 216 5.55555555555556e+00 +151 151 2.77777777777778e+01 +151 209 2.08333333333333e+00 +151 26 -2.08333333333333e+00 +151 125 -5.52509427098613e-16 +151 142 -6.94444444444445e-01 +151 208 -3.47222222222222e+00 +151 25 2.77777777777778e+00 +151 124 -4.86111111111111e+00 +151 141 -1.13624387676481e-16 +151 207 -2.08333333333333e+00 +151 24 -4.97648797170847e-16 +151 123 -4.16666666666667e+00 +151 227 -1.18047932540222e-15 +151 167 -5.55111512312578e-17 +151 224 2.08333333333333e+00 +151 242 8.33333333333333e+00 +151 152 -8.33333333333333e+00 +151 29 -2.08333333333333e+00 +151 149 -2.60208521396521e-17 +151 218 8.10874804801909e-16 +151 226 5.55555555555556e+00 +151 166 -6.94444444444445e-01 +151 223 -3.47222222222222e+00 +151 241 -9.72222222222223e+00 +151 143 6.93889390390723e-16 +151 28 2.77777777777778e+00 +151 148 -4.86111111111111e+00 +151 217 -1.11111111111111e+01 +151 225 8.88178419700125e-16 +151 165 6.24500451351651e-17 +151 222 2.08333333333333e+00 +151 240 2.25514051876985e-17 +151 150 0.00000000000000e+00 +151 27 -2.28983498828939e-16 +151 147 4.16666666666667e+00 +151 216 6.56267575005476e-16 +152 152 2.77777777777778e+01 +152 209 -3.47222222222222e+00 +152 26 2.77777777777778e+00 +152 125 -6.94444444444444e-01 +152 142 5.68121938382404e-16 +152 208 2.08333333333333e+00 +152 25 -2.08333333333333e+00 +152 124 -4.70977423727703e-16 +152 141 4.16666666666667e+00 +152 207 2.08333333333333e+00 +152 24 7.38124839028131e-16 +152 123 2.47957036847435e-16 +152 227 -1.11111111111111e+01 +152 167 -4.86111111111111e+00 +152 224 -3.47222222222222e+00 +152 242 -9.72222222222222e+00 +152 143 -4.86111111111111e+00 +152 29 2.77777777777778e+00 +152 149 -6.94444444444444e-01 +152 218 5.55555555555556e+00 +152 226 -1.49587373737825e-15 +152 166 -1.22298005056365e-16 +152 223 2.08333333333333e+00 +152 241 8.33333333333333e+00 +152 151 -8.33333333333333e+00 +152 28 -2.08333333333333e+00 +152 148 -8.82540568403201e-17 +152 217 9.49259659592527e-16 +152 225 -6.74807432154978e-16 +152 165 -4.16666666666667e+00 +152 222 -2.08333333333333e+00 +152 240 -1.21322223101128e-16 +152 150 -1.77635683940025e-15 +152 27 6.93889390390723e-18 +152 147 1.35308431126191e-16 +152 216 -4.44089209850063e-16 +153 153 2.77777777777778e+01 +153 44 7.95153873300869e-16 +153 224 2.08333333333333e+00 +153 164 4.16666666666667e+00 +153 157 -4.16666666666667e+00 +153 43 -2.41993924898765e-16 +153 223 -2.08333333333333e+00 +153 163 1.88651178012478e-17 +153 156 -4.86111111111111e+00 +153 42 -5.55555555555556e+00 +153 222 -3.47222222222222e+00 +153 162 -4.86111111111112e+00 +153 134 1.59594559789866e-16 +153 230 0.00000000000000e+00 +153 155 -1.77635683940025e-15 +153 41 -6.59194920871187e-16 +153 209 -2.08333333333333e+00 +153 242 -6.57026516526216e-17 +153 221 4.88256895851691e-16 +153 140 -4.16666666666667e+00 +153 133 4.16666666666667e+00 +153 229 4.85722573273506e-16 +153 154 8.88178419700125e-16 +153 40 -4.51028103753970e-16 +153 208 2.08333333333333e+00 +153 241 5.72458747072346e-17 +153 220 0.00000000000000e+00 +153 139 -1.56125112837913e-17 +153 132 -4.86111111111111e+00 +153 228 5.55555555555555e+00 +153 158 1.96023752785379e-16 +153 39 -5.55555555555555e+00 +153 207 -3.47222222222222e+00 +153 240 -1.38888888888889e+00 +153 219 5.55555555555556e+00 +153 138 -4.86111111111111e+00 +154 154 2.77777777777778e+01 +154 44 -2.08333333333333e+00 +154 224 2.08333333333333e+00 +154 164 3.31765864780564e-17 +154 157 -4.86111111111111e+00 +154 43 2.77777777777778e+00 +154 223 -3.47222222222222e+00 +154 163 -6.94444444444446e-01 +154 156 -4.16666666666667e+00 +154 42 -2.84494650060196e-16 +154 222 -2.08333333333333e+00 +154 162 -6.93889390390723e-18 +154 134 -3.76434994286967e-16 +154 230 5.58038858178289e-16 +154 155 -8.33333333333333e+00 +154 41 -2.08333333333333e+00 +154 209 2.08333333333333e+00 +154 242 8.33333333333333e+00 +154 221 -4.60216717165784e-16 +154 140 -3.65918233213858e-16 +154 133 -4.86111111111111e+00 +154 229 -1.11111111111111e+01 +154 158 5.20417042793042e-17 +154 40 2.77777777777778e+00 +154 208 -3.47222222222222e+00 +154 241 -9.72222222222223e+00 +154 220 5.55555555555556e+00 +154 139 -6.94444444444445e-01 +154 132 4.16666666666667e+00 +154 228 4.21537804662364e-16 +154 153 0.00000000000000e+00 +154 39 -4.25874613352306e-16 +154 207 2.08333333333333e+00 +154 240 1.96132173002628e-16 +154 219 0.00000000000000e+00 +154 138 -7.96888596776846e-17 +155 155 2.77777777777778e+01 +155 44 2.77777777777778e+00 +155 224 -3.47222222222222e+00 +155 164 -4.86111111111111e+00 +155 157 1.38777878078145e-17 +155 43 -2.08333333333333e+00 +155 223 2.08333333333333e+00 +155 163 1.61329283265843e-16 +155 156 1.24900090270330e-16 +155 42 6.91287305176758e-16 +155 222 2.08333333333333e+00 +155 162 4.16666666666667e+00 +155 134 -6.94444444444443e-01 +155 230 5.55555555555556e+00 +155 158 -6.94444444444445e-01 +155 41 2.77777777777778e+00 +155 209 -3.47222222222222e+00 +155 242 -9.72222222222222e+00 +155 221 -1.11111111111111e+01 +155 140 -4.86111111111111e+00 +155 133 -3.53883589099269e-16 +155 229 6.51388665229291e-16 +155 154 -8.33333333333333e+00 +155 40 -2.08333333333333e+00 +155 208 2.08333333333333e+00 +155 241 8.33333333333333e+00 +155 220 -2.29959280784175e-16 +155 139 -2.32452945780892e-16 +155 132 1.80411241501588e-16 +155 228 0.00000000000000e+00 +155 153 -1.77635683940025e-15 +155 39 -7.70542483985448e-16 +155 207 -2.08333333333333e+00 +155 240 -3.29597460435593e-17 +155 219 5.93817529870311e-16 +155 138 -4.16666666666667e+00 +156 156 2.83333333333333e+01 +156 167 -6.86706550998006e-17 +156 58 5.74627151417317e-17 +156 166 -2.15620707053055e-17 +156 57 2.83333333333333e+00 +156 165 -7.08333333333333e-01 +156 158 8.16666666666667e+00 +156 44 2.04166666666667e+00 +156 224 -4.85997011948416e-16 +156 164 -1.56497807334705e-17 +156 157 0.00000000000000e+00 +156 43 1.04164723721545e-16 +156 223 0.00000000000000e+00 +156 163 -1.93462325152882e-18 +156 59 2.04166666666667e+00 +156 42 2.83333333333333e+00 +156 222 5.66666666666667e+00 +156 162 -7.08333333333333e-01 +156 227 -2.08333333333333e+00 +156 160 4.16666666666667e+00 +156 226 2.08333333333333e+00 +156 159 -4.86111111111111e+00 +156 225 -3.47222222222222e+00 +156 230 5.80265002714242e-16 +156 155 1.24900090270330e-16 +156 242 -8.33333333333333e+00 +156 221 -2.08333333333333e+00 +156 229 -4.51028103753970e-16 +156 154 -4.16666666666667e+00 +156 241 6.85215773010839e-17 +156 220 -2.08333333333333e+00 +156 228 -1.11111111111111e+01 +156 161 1.11022302462516e-16 +156 153 -4.86111111111111e+00 +156 240 -9.72222222222223e+00 +156 219 -3.47222222222222e+00 +156 308 3.93023287525995e-19 +156 398 4.16666666666667e-02 +156 307 -8.33333333333333e-02 +156 397 -4.16666666666667e-02 +156 306 -9.72222222222222e-02 +156 396 -6.94444444444445e-02 +156 401 -1.19397764244966e-17 +156 302 -1.57209315010398e-18 +156 449 1.66666666666667e-01 +156 392 4.16666666666667e-02 +156 400 5.71916645986104e-18 +156 301 8.33333333333334e-02 +156 448 -4.43845264361253e-19 +156 391 4.16666666666667e-02 +156 399 -2.22222222222222e-01 +156 300 -9.72222222222222e-02 +156 447 -1.94444444444445e-01 +156 390 -6.94444444444445e-02 +157 157 2.83333333333333e+01 +157 167 4.25000000000000e+00 +157 58 -5.66666666666667e+00 +157 166 -4.95833333333333e+00 +157 57 1.04164723721545e-16 +157 165 -1.41911899982985e-17 +157 158 9.02056207507940e-16 +157 44 -6.14945919706622e-16 +157 224 -1.27878046354639e-16 +157 164 -4.25000000000000e+00 +157 59 -6.04051381939037e-16 +157 43 -5.66666666666667e+00 +157 223 5.66666666666667e+00 +157 163 -4.95833333333333e+00 +157 156 0.00000000000000e+00 +157 42 1.68593437821496e-16 +157 222 0.00000000000000e+00 +157 162 -2.32967941812823e-17 +157 227 2.08333333333333e+00 +157 160 -4.86111111111111e+00 +157 226 -3.47222222222222e+00 +157 159 4.16666666666667e+00 +157 225 2.08333333333333e+00 +157 230 8.88178419700125e-16 +157 155 1.38777878078145e-17 +157 242 -1.88759598229726e-16 +157 221 -2.08333333333333e+00 +157 229 5.55555555555555e+00 +157 161 -4.05925293378573e-16 +157 154 -4.86111111111111e+00 +157 241 -1.38888888888889e+00 +157 220 -3.47222222222222e+00 +157 228 -2.21177243187043e-16 +157 153 -4.16666666666667e+00 +157 240 1.11672823766007e-16 +157 219 -2.08333333333333e+00 +157 308 8.18572640226556e-18 +157 398 4.16666666666667e-02 +157 307 -9.72222222222222e-02 +157 397 -6.94444444444444e-02 +157 306 -8.33333333333334e-02 +157 396 -4.16666666666667e-02 +157 401 -2.08166817117217e-17 +157 302 1.35525271560688e-17 +157 449 -2.26056152963228e-17 +157 392 -4.16666666666666e-02 +157 400 1.11111111111111e-01 +157 301 -9.72222222222222e-02 +157 448 -2.77777777777778e-02 +157 391 -6.94444444444444e-02 +157 399 1.08420217248550e-18 +157 300 8.33333333333333e-02 +157 447 -8.67361737988404e-19 +157 390 4.16666666666667e-02 +158 158 2.83333333333333e+01 +158 167 -4.95833333333333e+00 +158 58 -5.02175341240974e-16 +158 166 4.25000000000000e+00 +158 57 2.04166666666667e+00 +158 165 -4.74067399919287e-17 +158 59 2.83333333333333e+00 +158 44 2.83333333333333e+00 +158 224 -1.13333333333333e+01 +158 164 -4.95833333333333e+00 +158 157 9.02056207507940e-16 +158 43 -6.68183634507449e-16 +158 223 -3.98617093109663e-16 +158 163 -4.25000000000000e+00 +158 156 8.16666666666667e+00 +158 42 2.04166666666667e+00 +158 222 -4.01432630626336e-16 +158 162 -4.74202925190848e-17 +158 227 -3.47222222222222e+00 +158 160 -4.44089209850063e-16 +158 226 2.08333333333333e+00 +158 159 9.88792381306780e-17 +158 225 -2.08333333333333e+00 +158 230 5.55555555555555e+00 +158 161 -6.94444444444445e-01 +158 155 -6.94444444444445e-01 +158 242 -9.72222222222222e+00 +158 221 -3.47222222222222e+00 +158 229 1.33226762955019e-15 +158 154 5.20417042793042e-17 +158 241 -1.43982048506075e-16 +158 220 -2.08333333333333e+00 +158 228 6.14851052016530e-16 +158 153 1.96023752785379e-16 +158 240 -8.33333333333333e+00 +158 219 -2.08333333333333e+00 +158 308 -1.38888888888889e-02 +158 398 -6.94444444444445e-02 +158 307 7.26415455565288e-18 +158 397 4.16666666666667e-02 +158 306 1.08420217248550e-19 +158 396 4.16666666666667e-02 +158 401 1.11111111111111e-01 +158 302 -1.38888888888889e-02 +158 449 -1.94444444444444e-01 +158 392 -6.94444444444445e-02 +158 400 -2.77555756156289e-17 +158 301 1.36609473733174e-17 +158 448 -2.36762649416522e-17 +158 391 -4.16666666666666e-02 +158 399 -1.12214924852250e-17 +158 300 -8.67361737988404e-19 +158 447 1.66666666666667e-01 +158 390 4.16666666666667e-02 +159 159 2.77777777777778e+01 +159 134 2.70616862252382e-16 +159 143 -4.16666666666667e+00 +159 209 -2.08333333333333e+00 +159 55 -4.99600361081320e-16 +159 133 -4.16666666666667e+00 +159 142 -8.32667268468867e-17 +159 208 -2.08333333333333e+00 +159 54 -5.55555555555555e+00 +159 132 -4.86111111111111e+00 +159 141 -4.86111111111111e+00 +159 207 -3.47222222222222e+00 +159 161 0.00000000000000e+00 +159 59 -9.71445146547012e-17 +159 158 1.26634813746307e-16 +159 230 0.00000000000000e+00 +159 227 -6.74807432154978e-16 +159 167 4.16666666666667e+00 +159 224 2.08333333333333e+00 +159 242 -1.23707467880596e-16 +159 160 8.88178419700125e-16 +159 58 -1.52655665885959e-16 +159 157 4.16666666666667e+00 +159 229 3.10515502199848e-16 +159 226 8.88178419700125e-16 +159 166 5.72458747072346e-17 +159 223 2.08333333333333e+00 +159 241 5.58364118830035e-17 +159 56 4.99600361081320e-16 +159 57 -5.55555555555556e+00 +159 156 -4.86111111111111e+00 +159 228 5.55555555555555e+00 +159 225 5.55555555555556e+00 +159 165 -4.86111111111111e+00 +159 222 -3.47222222222222e+00 +159 240 -1.38888888888889e+00 +160 160 2.77777777777778e+01 +160 134 -2.08166817117217e-16 +160 143 1.30104260698261e-17 +160 209 -2.08333333333333e+00 +160 55 2.77777777777778e+00 +160 133 -4.86111111111111e+00 +160 142 -6.94444444444443e-01 +160 208 -3.47222222222222e+00 +160 54 -4.64905891561784e-16 +160 132 -4.16666666666667e+00 +160 141 -1.05818132034585e-16 +160 207 -2.08333333333333e+00 +160 161 8.33333333333333e+00 +160 59 2.08333333333333e+00 +160 158 -4.99600361081320e-16 +160 230 7.06899816460549e-16 +160 227 -1.26678181833206e-15 +160 167 -1.83013326715553e-16 +160 224 -2.08333333333333e+00 +160 242 -8.33333333333333e+00 +160 56 2.08333333333333e+00 +160 58 2.77777777777778e+00 +160 157 -4.86111111111111e+00 +160 229 -1.11111111111111e+01 +160 226 5.55555555555556e+00 +160 166 -6.94444444444445e-01 +160 223 -3.47222222222222e+00 +160 241 -9.72222222222223e+00 +160 159 8.88178419700125e-16 +160 57 -2.22044604925031e-16 +160 156 4.16666666666667e+00 +160 228 4.85722573273506e-16 +160 225 8.88178419700125e-16 +160 165 4.85722573273506e-17 +160 222 2.08333333333333e+00 +160 240 1.47451495458029e-17 +161 161 2.77777777777778e+01 +161 134 -6.94444444444444e-01 +161 143 -4.86111111111111e+00 +161 209 -3.47222222222222e+00 +161 55 2.08333333333333e+00 +161 133 -2.22044604925031e-16 +161 142 8.32667268468867e-17 +161 208 -2.08333333333333e+00 +161 54 6.59194920871187e-16 +161 132 2.64545330086463e-16 +161 141 -4.16666666666667e+00 +161 207 -2.08333333333333e+00 +161 56 2.77777777777778e+00 +161 59 2.77777777777778e+00 +161 158 -6.94444444444445e-01 +161 230 5.55555555555556e+00 +161 227 -1.11111111111111e+01 +161 167 -4.86111111111111e+00 +161 224 -3.47222222222222e+00 +161 242 -9.72222222222222e+00 +161 160 8.33333333333333e+00 +161 58 2.08333333333333e+00 +161 157 -4.05057931640584e-16 +161 229 6.76108474761961e-16 +161 226 -1.62370117351429e-15 +161 166 -2.22044604925031e-16 +161 223 -2.08333333333333e+00 +161 241 -8.33333333333333e+00 +161 159 0.00000000000000e+00 +161 57 -1.11022302462516e-16 +161 156 1.11022302462516e-16 +161 228 0.00000000000000e+00 +161 225 -5.13478148889135e-16 +161 165 4.16666666666667e+00 +161 222 2.08333333333333e+00 +161 240 -9.02056207507940e-17 +162 162 2.83333333333333e+01 +162 44 -8.04701628682319e-16 +162 157 -2.15620707053055e-17 +162 43 -2.04166666666667e+00 +162 156 -7.08333333333333e-01 +162 42 2.83333333333334e+00 +162 224 1.33226762955019e-15 +162 164 3.58046925441613e-15 +162 149 -6.95380168377890e-17 +162 14 -6.01952434295741e-16 +162 223 1.18665927778538e-16 +162 163 -8.16666666666667e+00 +162 148 -2.15620707053055e-17 +162 13 -2.04166666666667e+00 +162 222 5.66666666666667e+00 +162 158 8.09085871217308e-18 +162 147 -7.08333333333333e-01 +162 12 2.83333333333334e+00 +162 155 4.16666666666667e+00 +162 229 2.08333333333333e+00 +162 154 6.07153216591882e-18 +162 228 -3.47222222222222e+00 +162 153 -4.86111111111112e+00 +162 242 2.45463371850718e-16 +162 221 1.38951350425742e-15 +162 218 -2.08333333333333e+00 +162 146 -4.16666666666667e+00 +162 241 8.33333333333333e+00 +162 220 -3.16587034365767e-16 +162 217 2.08333333333333e+00 +162 145 6.07153216591882e-18 +162 240 -9.72222222222222e+00 +162 230 2.08333333333333e+00 +162 219 -1.11111111111111e+01 +162 216 -3.47222222222222e+00 +162 144 -4.86111111111112e+00 +162 401 -4.16666666666667e-02 +162 302 -8.33333333333333e-02 +162 400 -4.16666666666667e-02 +162 301 1.03168612975574e-18 +162 399 -6.94444444444445e-02 +162 300 -9.72222222222222e-02 +162 449 -2.73252828784237e-18 +162 392 4.59907126623563e-17 +162 389 4.16666666666667e-02 +162 293 8.33333333333334e-02 +162 448 -1.66666666666667e-01 +162 391 3.88597540376592e-18 +162 388 -4.16666666666667e-02 +162 292 2.87991202066462e-19 +162 447 -1.94444444444444e-01 +162 390 -2.22222222222222e-01 +162 387 -6.94444444444445e-02 +162 291 -9.72222222222223e-02 +163 163 2.83333333333333e+01 +163 44 2.26630441301466e-16 +163 157 -4.95833333333333e+00 +163 43 2.83333333333333e+00 +163 156 -1.59089728153303e-17 +163 42 -2.04166666666667e+00 +163 224 -6.70060659518565e-16 +163 164 -8.60422844084496e-16 +163 149 4.25000000000000e+00 +163 14 -6.77708943515798e-17 +163 223 -1.13333333333333e+01 +163 158 -4.25000000000000e+00 +163 148 -4.95833333333333e+00 +163 13 2.83333333333333e+00 +163 222 2.81678477268813e-16 +163 162 -8.16666666666667e+00 +163 147 -1.50568576703924e-17 +163 12 -2.04166666666667e+00 +163 155 1.54390389361936e-16 +163 229 -3.47222222222222e+00 +163 154 -6.94444444444446e-01 +163 228 2.08333333333333e+00 +163 153 3.27429056090622e-17 +163 242 -5.49798921667399e-16 +163 221 4.44089209850063e-16 +163 218 2.08333333333333e+00 +163 146 -6.63531729561129e-17 +163 241 -9.72222222222222e+00 +163 230 -2.08333333333333e+00 +163 220 5.55555555555555e+00 +163 217 -3.47222222222222e+00 +163 145 -6.94444444444445e-01 +163 240 8.33333333333333e+00 +163 219 -2.83857681283861e-16 +163 216 2.08333333333333e+00 +163 144 3.96817995129695e-17 +163 401 -4.16666666666667e-02 +163 302 -7.99599102208060e-18 +163 400 -6.94444444444444e-02 +163 301 -1.38888888888889e-02 +163 399 -4.16666666666667e-02 +163 300 8.53809210832335e-19 +163 449 1.58191873229213e-17 +163 392 -2.08166817117217e-17 +163 389 4.16666666666667e-02 +163 293 -9.01243055878576e-18 +163 448 -1.94444444444444e-01 +163 391 1.11111111111111e-01 +163 388 -6.94444444444444e-02 +163 292 -1.38888888888889e-02 +163 447 -1.66666666666667e-01 +163 390 1.47722546001150e-18 +163 387 -4.16666666666667e-02 +163 291 5.42101086242752e-19 +164 164 2.83333333333333e+01 +164 44 -5.66666666666666e+00 +164 157 -4.25000000000000e+00 +164 43 -6.77708943515798e-17 +164 156 -1.57463424894574e-17 +164 42 -3.83377276322663e-16 +164 224 5.66666666666667e+00 +164 158 -4.95833333333333e+00 +164 149 -4.95833333333333e+00 +164 14 -5.66666666666666e+00 +164 223 -7.13372842243466e-16 +164 163 -8.60422844084496e-16 +164 148 4.25000000000000e+00 +164 13 1.71171806112938e-16 +164 222 1.33226762955019e-15 +164 162 3.58046925441613e-15 +164 147 -4.74067399919287e-17 +164 12 -8.05514780311684e-16 +164 155 -4.86111111111111e+00 +164 229 -2.08333333333333e+00 +164 154 3.31765864780564e-17 +164 228 2.08333333333333e+00 +164 153 4.16666666666667e+00 +164 242 -1.38888888888889e+00 +164 230 -3.47222222222222e+00 +164 221 5.55555555555555e+00 +164 218 -3.47222222222222e+00 +164 146 -4.86111111111111e+00 +164 241 -5.25621213220973e-16 +164 220 8.88178419700125e-16 +164 217 2.08333333333333e+00 +164 145 -1.14491749414469e-16 +164 240 3.60605642568679e-16 +164 219 1.45314261925517e-15 +164 216 -2.08333333333333e+00 +164 144 -4.16666666666667e+00 +164 401 -6.94444444444444e-02 +164 302 -9.72222222222222e-02 +164 400 -4.16666666666667e-02 +164 301 -7.59788553687107e-18 +164 399 -4.16666666666667e-02 +164 300 -8.33333333333333e-02 +164 449 -2.77777777777778e-02 +164 392 1.11111111111111e-01 +164 389 -6.94444444444445e-02 +164 293 -9.72222222222223e-02 +164 448 1.29426634340457e-17 +164 391 -2.77555756156289e-17 +164 388 4.16666666666667e-02 +164 292 -9.14795583034644e-18 +164 447 -1.04354459101730e-18 +164 390 4.90669245685471e-17 +164 387 4.16666666666667e-02 +164 291 8.33333333333334e-02 +165 165 2.83333333333333e+01 +165 158 -4.74202925190848e-17 +165 58 2.04166666666667e+00 +165 157 -1.50568576703924e-17 +165 57 2.83333333333333e+00 +165 156 -7.08333333333333e-01 +165 167 -1.69309011255336e-15 +165 224 1.33920652345410e-15 +165 29 1.15847002130076e-16 +165 149 -7.11609319647283e-17 +165 166 8.16666666666667e+00 +165 223 1.74125833516487e-16 +165 28 2.04166666666667e+00 +165 148 -1.58124110593433e-17 +165 59 2.92951427005583e-16 +165 222 5.66666666666667e+00 +165 27 2.83333333333333e+00 +165 147 -7.08333333333333e-01 +165 230 2.08333333333333e+00 +165 160 5.55111512312578e-17 +165 229 -2.08333333333333e+00 +165 159 -4.86111111111111e+00 +165 228 -3.47222222222222e+00 +165 227 -4.85722573273506e-17 +165 242 6.06285854853894e-16 +165 152 -4.16666666666667e+00 +165 218 -2.08333333333333e+00 +165 226 -2.28116137090950e-16 +165 241 -8.33333333333333e+00 +165 151 6.24500451351651e-17 +165 217 -2.08333333333333e+00 +165 225 -1.11111111111111e+01 +165 161 4.16666666666667e+00 +165 240 -9.72222222222222e+00 +165 150 -4.86111111111111e+00 +165 216 -3.47222222222222e+00 +165 308 -8.33333333333334e-02 +165 401 -4.16666666666667e-02 +165 307 -6.77626357803440e-20 +165 400 4.16666666666667e-02 +165 306 -9.72222222222223e-02 +165 399 -6.94444444444445e-02 +165 398 -6.79794762148411e-17 +165 449 -6.20197523979599e-18 +165 299 8.33333333333333e-02 +165 389 4.16666666666667e-02 +165 397 2.71050543121376e-19 +165 448 1.66666666666667e-01 +165 298 -2.98155597433514e-19 +165 388 4.16666666666667e-02 +165 396 -2.22222222222222e-01 +165 447 -1.94444444444444e-01 +165 297 -9.72222222222223e-02 +165 387 -6.94444444444445e-02 +166 166 2.83333333333333e+01 +166 158 4.25000000000000e+00 +166 58 2.83333333333333e+00 +166 157 -4.95833333333333e+00 +166 57 2.04166666666667e+00 +166 156 -2.15485181781494e-17 +166 167 -2.70616862252382e-15 +166 224 -2.08527653152747e-16 +166 29 -1.21691529466131e-16 +166 149 -4.25000000000000e+00 +166 59 -5.69788899222601e-16 +166 223 -1.13333333333333e+01 +166 28 2.83333333333333e+00 +166 148 -4.95833333333333e+00 +166 165 8.16666666666667e+00 +166 222 2.29796650458303e-16 +166 27 2.04166666666667e+00 +166 147 -2.32967941812823e-17 +166 230 2.08333333333333e+00 +166 160 -6.94444444444445e-01 +166 229 -3.47222222222222e+00 +166 159 5.72458747072346e-17 +166 228 -2.08333333333333e+00 +166 227 2.22044604925031e-15 +166 242 3.70363462121048e-16 +166 152 -1.22298005056365e-16 +166 218 -2.08333333333333e+00 +166 226 5.55555555555555e+00 +166 161 -2.22044604925031e-16 +166 241 -9.72222222222222e+00 +166 151 -6.94444444444445e-01 +166 217 -3.47222222222222e+00 +166 225 -1.09395999203787e-16 +166 240 -8.33333333333333e+00 +166 150 7.11236625150491e-17 +166 216 -2.08333333333333e+00 +166 308 -1.26851654180804e-17 +166 401 4.16666666666667e-02 +166 307 -1.38888888888889e-02 +166 400 -6.94444444444444e-02 +166 306 -3.25260651745651e-19 +166 399 4.16666666666667e-02 +166 398 -4.16333634234434e-17 +166 449 3.01272678679410e-17 +166 299 -1.36067372646931e-17 +166 389 -4.16666666666666e-02 +166 397 1.11111111111111e-01 +166 448 -1.94444444444444e-01 +166 298 -1.38888888888889e-02 +166 388 -6.94444444444444e-02 +166 396 -8.67361737988404e-19 +166 447 1.66666666666667e-01 +166 297 -5.42101086242752e-19 +166 387 4.16666666666667e-02 +167 167 2.83333333333333e+01 +167 158 -4.95833333333333e+00 +167 58 -1.70316302836211e-16 +167 157 4.25000000000000e+00 +167 57 1.15860554657232e-16 +167 156 4.23499532968205e-17 +167 59 -5.66666666666667e+00 +167 224 5.66666666666667e+00 +167 29 -5.66666666666667e+00 +167 149 -4.95833333333333e+00 +167 166 -2.70616862252382e-15 +167 223 -3.74236096755895e-16 +167 28 -5.69788899222601e-16 +167 148 -4.25000000000000e+00 +167 165 -1.69309011255336e-15 +167 222 1.33920652345410e-15 +167 27 4.04082149685348e-16 +167 147 -1.58442594981600e-16 +167 230 -3.47222222222222e+00 +167 160 -1.83013326715553e-16 +167 229 2.08333333333333e+00 +167 159 4.16666666666667e+00 +167 228 2.08333333333333e+00 +167 227 5.55555555555555e+00 +167 161 -4.86111111111111e+00 +167 242 -1.38888888888889e+00 +167 152 -4.86111111111111e+00 +167 218 -3.47222222222222e+00 +167 226 2.22044604925031e-15 +167 241 3.95842213174458e-16 +167 151 -4.85722573273506e-17 +167 217 -2.08333333333333e+00 +167 225 -1.65666091955785e-16 +167 240 5.34186410383608e-16 +167 150 -4.16666666666667e+00 +167 216 -2.08333333333333e+00 +167 308 -9.72222222222223e-02 +167 401 -6.94444444444444e-02 +167 307 -1.35389746289127e-17 +167 400 4.16666666666667e-02 +167 306 -8.33333333333334e-02 +167 399 -4.16666666666667e-02 +167 398 1.11111111111111e-01 +167 449 -2.77777777777778e-02 +167 299 -9.72222222222222e-02 +167 389 -6.94444444444445e-02 +167 397 -4.16333634234434e-17 +167 448 3.11877531179033e-17 +167 298 -1.29020058525775e-17 +167 388 -4.16666666666666e-02 +167 396 -6.70036942596042e-17 +167 447 -4.94667241196511e-18 +167 297 8.33333333333333e-02 +167 387 4.16666666666667e-02 +168 168 5.55555555555556e+01 +168 17 0.00000000000000e+00 +168 94 0.00000000000000e+00 +168 16 0.00000000000000e+00 +168 93 0.00000000000000e+00 +168 15 0.00000000000000e+00 +168 179 -7.45931094670027e-17 +168 92 -2.08333333333333e+00 +168 68 4.44089209850063e-16 +168 20 9.77950359581925e-17 +168 178 3.38271077815477e-17 +168 91 -2.08333333333333e+00 +168 67 3.48245737802344e-16 +168 19 -4.16666666666667e+00 +168 177 -1.38888888888889e+00 +168 90 -3.47222222222222e+00 +168 66 5.55555555555556e+00 +168 18 -4.86111111111111e+00 +168 176 -8.33333333333333e+00 +168 89 -2.08333333333333e+00 +168 65 -1.54837622758086e-16 +168 5 -2.81892564846231e-18 +168 175 -6.68952740423556e-17 +168 88 2.08333333333333e+00 +168 64 -4.22947267486595e-16 +168 4 4.16666666666666e+00 +168 174 -9.72222222222223e+00 +168 87 -3.47222222222222e+00 +168 63 -1.11111111111111e+01 +168 3 -4.86111111111111e+00 +168 182 0.00000000000000e+00 +168 233 5.58364118830035e-16 +168 173 3.72965547335014e-17 +168 86 0.00000000000000e+00 +168 71 0.00000000000000e+00 +168 170 1.77635683940025e-15 +168 62 4.44089209850063e-16 +168 2 0.00000000000000e+00 +168 181 0.00000000000000e+00 +168 232 8.88178419700125e-16 +168 172 7.84962372879505e-17 +168 85 0.00000000000000e+00 +168 70 0.00000000000000e+00 +168 169 -1.77635683940025e-15 +168 61 4.10004604052550e-16 +168 1 0.00000000000000e+00 +168 180 0.00000000000000e+00 +168 231 1.11111111111111e+01 +168 171 -1.38888888888889e+00 +168 84 0.00000000000000e+00 +168 69 0.00000000000000e+00 +168 95 0.00000000000000e+00 +168 60 5.55555555555556e+00 +168 0 0.00000000000000e+00 +169 169 5.55555555555556e+01 +169 17 0.00000000000000e+00 +169 94 0.00000000000000e+00 +169 16 0.00000000000000e+00 +169 93 0.00000000000000e+00 +169 15 0.00000000000000e+00 +169 179 -8.33333333333333e+00 +169 92 -2.08333333333333e+00 +169 68 3.91939085353510e-17 +169 20 1.02782365951626e-16 +169 178 -9.72222222222223e+00 +169 91 -3.47222222222222e+00 +169 67 -1.11111111111111e+01 +169 19 -4.86111111111111e+00 +169 177 7.68699340292223e-17 +169 90 -2.08333333333333e+00 +169 66 3.00717025066011e-16 +169 18 -4.16666666666667e+00 +169 176 -3.23525928269675e-16 +169 89 2.08333333333333e+00 +169 65 8.88178419700125e-16 +169 5 1.56992474575901e-16 +169 175 -1.38888888888889e+00 +169 88 -3.47222222222222e+00 +169 64 5.55555555555556e+00 +169 4 -4.86111111111111e+00 +169 174 -6.33174068731535e-17 +169 87 2.08333333333333e+00 +169 63 -2.59449579875781e-16 +169 3 4.16666666666666e+00 +169 182 0.00000000000000e+00 +169 233 1.95047970830142e-16 +169 173 8.33333333333333e+00 +169 86 0.00000000000000e+00 +169 71 0.00000000000000e+00 +169 170 -8.88178419700125e-16 +169 62 -1.81603863891322e-16 +169 2 0.00000000000000e+00 +169 181 0.00000000000000e+00 +169 232 1.11111111111111e+01 +169 172 -9.72222222222223e+00 +169 85 0.00000000000000e+00 +169 70 0.00000000000000e+00 +169 95 0.00000000000000e+00 +169 61 -1.11111111111111e+01 +169 1 0.00000000000000e+00 +169 180 0.00000000000000e+00 +169 231 8.88178419700125e-16 +169 171 1.45716771982052e-16 +169 84 0.00000000000000e+00 +169 69 0.00000000000000e+00 +169 168 -1.77635683940025e-15 +169 60 3.48245737802344e-16 +169 0 0.00000000000000e+00 +170 170 5.55555555555556e+01 +170 17 0.00000000000000e+00 +170 94 0.00000000000000e+00 +170 16 0.00000000000000e+00 +170 93 0.00000000000000e+00 +170 15 0.00000000000000e+00 +170 179 -9.72222222222222e+00 +170 92 -3.47222222222222e+00 +170 68 5.55555555555556e+00 +170 20 -6.94444444444444e-01 +170 178 -8.33333333333333e+00 +170 91 -2.08333333333333e+00 +170 67 4.04407410337093e-17 +170 19 1.20563281580388e-16 +170 177 1.75966012594397e-16 +170 90 -2.08333333333333e+00 +170 66 4.44089209850063e-16 +170 18 1.41379963292110e-16 +170 176 -9.72222222222222e+00 +170 89 -3.47222222222222e+00 +170 65 5.55555555555556e+00 +170 5 -6.94444444444443e-01 +170 175 -3.83915989277117e-16 +170 88 2.08333333333333e+00 +170 64 8.88178419700125e-16 +170 4 1.95590071916385e-16 +170 174 -8.33333333333333e+00 +170 87 -2.08333333333333e+00 +170 63 -2.53378047709862e-16 +170 3 -9.36750677027476e-17 +170 182 0.00000000000000e+00 +170 233 -2.22222222222222e+01 +170 173 -9.72222222222222e+00 +170 86 0.00000000000000e+00 +170 71 0.00000000000000e+00 +170 95 0.00000000000000e+00 +170 62 5.55555555555556e+00 +170 2 0.00000000000000e+00 +170 181 0.00000000000000e+00 +170 232 8.84573447476611e-17 +170 172 8.33333333333333e+00 +170 85 0.00000000000000e+00 +170 70 0.00000000000000e+00 +170 169 -8.88178419700125e-16 +170 61 -7.18419464543207e-17 +170 1 0.00000000000000e+00 +170 180 0.00000000000000e+00 +170 231 1.41488383509358e-16 +170 171 1.76833374332386e-16 +170 84 0.00000000000000e+00 +170 69 0.00000000000000e+00 +170 168 1.77635683940025e-15 +170 60 4.44089209850063e-16 +170 0 0.00000000000000e+00 +171 171 5.55555555555556e+01 +171 35 -4.16666666666667e+00 +171 76 -2.08333333333333e+00 +171 34 -3.30681662608079e-17 +171 75 -3.47222222222222e+00 +171 33 -4.86111111111112e+00 +171 83 0.00000000000000e+00 +171 185 3.64291929955129e-17 +171 74 -3.83807569059869e-17 +171 32 0.00000000000000e+00 +171 82 0.00000000000000e+00 +171 184 3.38271077815477e-17 +171 73 0.00000000000000e+00 +171 31 0.00000000000000e+00 +171 81 0.00000000000000e+00 +171 183 -1.38888888888889e+00 +171 72 5.55555555555556e+00 +171 30 0.00000000000000e+00 +171 176 -5.31259064517897e-17 +171 89 2.48146772227620e-17 +171 65 2.08333333333333e+00 +171 5 4.16666666666667e+00 +171 175 -8.33333333333333e+00 +171 88 -4.22513586617601e-16 +171 64 -2.08333333333333e+00 +171 4 -3.39355279987963e-17 +171 174 -9.72222222222222e+00 +171 87 -1.11111111111111e+01 +171 63 -3.47222222222222e+00 +171 3 -4.86111111111112e+00 +171 182 0.00000000000000e+00 +171 233 1.33226762955019e-15 +171 173 1.77635683940025e-15 +171 86 0.00000000000000e+00 +171 71 0.00000000000000e+00 +171 170 1.77700736070374e-16 +171 62 4.31078783780237e-16 +171 2 0.00000000000000e+00 +171 181 0.00000000000000e+00 +171 232 3.75892893200724e-16 +171 172 0.00000000000000e+00 +171 85 0.00000000000000e+00 +171 70 0.00000000000000e+00 +171 169 1.45716771982052e-16 +171 61 -4.44089209850063e-16 +171 1 0.00000000000000e+00 +171 180 0.00000000000000e+00 +171 231 1.11111111111111e+01 +171 77 -2.08333333333333e+00 +171 84 0.00000000000000e+00 +171 69 0.00000000000000e+00 +171 168 -1.38888888888889e+00 +171 60 5.55555555555556e+00 +171 0 0.00000000000000e+00 +172 172 5.55555555555556e+01 +172 35 -1.42247325030098e-16 +172 76 -3.47222222222222e+00 +172 34 -6.94444444444445e-01 +172 75 -2.08333333333333e+00 +172 33 1.30104260698261e-17 +172 83 0.00000000000000e+00 +172 185 -8.33333333333333e+00 +172 74 4.91685685222176e-16 +172 32 0.00000000000000e+00 +172 82 0.00000000000000e+00 +172 184 -9.72222222222223e+00 +172 73 5.55555555555556e+00 +172 31 0.00000000000000e+00 +172 81 0.00000000000000e+00 +172 183 7.68699340292223e-17 +172 72 0.00000000000000e+00 +172 30 0.00000000000000e+00 +172 176 1.21755903970122e-16 +172 89 0.00000000000000e+00 +172 65 2.08333333333333e+00 +172 5 1.29995840481012e-16 +172 175 -9.72222222222222e+00 +172 88 5.55555555555556e+00 +172 64 -3.47222222222222e+00 +172 4 -6.94444444444445e-01 +172 174 -8.33333333333333e+00 +172 87 -3.15828092845027e-16 +172 63 -2.08333333333333e+00 +172 3 0.00000000000000e+00 +172 182 0.00000000000000e+00 +172 233 -1.83297929785831e-16 +172 173 0.00000000000000e+00 +172 86 0.00000000000000e+00 +172 71 0.00000000000000e+00 +172 170 8.33333333333333e+00 +172 62 1.39956947940723e-16 +172 2 0.00000000000000e+00 +172 181 0.00000000000000e+00 +172 232 -2.22222222222222e+01 +172 77 -2.08333333333333e+00 +172 85 0.00000000000000e+00 +172 70 0.00000000000000e+00 +172 169 -9.72222222222223e+00 +172 61 5.55555555555556e+00 +172 1 0.00000000000000e+00 +172 180 0.00000000000000e+00 +172 231 4.39589770834248e-16 +172 171 0.00000000000000e+00 +172 84 0.00000000000000e+00 +172 69 0.00000000000000e+00 +172 168 7.76288755499621e-17 +172 60 0.00000000000000e+00 +172 0 0.00000000000000e+00 +173 173 5.55555555555556e+01 +173 35 -4.86111111111111e+00 +173 76 -2.08333333333333e+00 +173 34 -1.35742111995185e-16 +173 75 -2.08333333333333e+00 +173 33 -4.16666666666667e+00 +173 83 0.00000000000000e+00 +173 185 -9.72222222222222e+00 +173 74 -1.11111111111111e+01 +173 32 0.00000000000000e+00 +173 82 0.00000000000000e+00 +173 184 -8.33333333333333e+00 +173 73 3.62015105392910e-16 +173 31 0.00000000000000e+00 +173 81 0.00000000000000e+00 +173 183 1.75966012594397e-16 +173 72 4.31092336307393e-16 +173 30 0.00000000000000e+00 +173 176 -1.38888888888889e+00 +173 89 5.55555555555556e+00 +173 65 -3.47222222222222e+00 +173 5 -4.86111111111111e+00 +173 175 9.19403442267708e-17 +173 88 0.00000000000000e+00 +173 64 2.08333333333333e+00 +173 4 1.50920942409982e-16 +173 174 -1.84748050191530e-16 +173 87 4.06575814682064e-17 +173 63 2.08333333333333e+00 +173 3 4.16666666666667e+00 +173 182 0.00000000000000e+00 +173 233 1.11111111111111e+01 +173 77 -3.47222222222222e+00 +173 86 0.00000000000000e+00 +173 71 0.00000000000000e+00 +173 170 -9.72222222222222e+00 +173 62 -1.11111111111111e+01 +173 2 0.00000000000000e+00 +173 181 0.00000000000000e+00 +173 232 -4.13189447934226e-16 +173 172 0.00000000000000e+00 +173 85 0.00000000000000e+00 +173 70 0.00000000000000e+00 +173 169 8.33333333333333e+00 +173 61 4.36174533990918e-16 +173 1 0.00000000000000e+00 +173 180 0.00000000000000e+00 +173 231 1.33226762955019e-15 +173 171 1.77635683940025e-15 +173 84 0.00000000000000e+00 +173 69 0.00000000000000e+00 +173 168 3.72965547335014e-17 +173 60 -3.83807569059869e-17 +173 0 0.00000000000000e+00 +174 174 1.11111111111111e+02 +174 112 -2.08333333333333e+00 +174 111 -3.47222222222222e+00 +174 200 -8.33333333333333e+00 +174 107 -2.08333333333333e+00 +174 199 9.98550200859150e-17 +174 106 2.08333333333333e+00 +174 198 -9.72222222222223e+00 +174 105 -3.47222222222222e+00 +174 197 1.60136660876109e-16 +174 104 2.08333333333333e+00 +174 196 -8.33333333333333e+00 +174 103 -2.08333333333333e+00 +174 195 -9.72222222222222e+00 +174 102 -3.47222222222222e+00 +174 236 -1.47898728854179e-16 +174 191 -2.02745806254789e-17 +174 188 8.33333333333333e+00 +174 98 2.08333333333333e+00 +174 235 5.61643830401803e-16 +174 190 8.33333333333333e+00 +174 187 9.19403442267708e-17 +174 97 2.08333333333333e+00 +174 234 -2.22222222222222e+01 +174 189 -9.72222222222222e+00 +174 186 -9.72222222222223e+00 +174 96 -3.47222222222222e+00 +174 80 2.08333333333333e+00 +174 50 8.06646416329215e-17 +174 79 2.08333333333333e+00 +174 49 4.77048955893622e-17 +174 78 -3.47222222222222e+00 +174 48 -1.38888888888889e+00 +174 185 8.33333333333333e+00 +174 77 -2.59124319224036e-17 +174 35 7.37257477290143e-17 +174 74 2.08333333333333e+00 +174 184 -1.04950770296597e-16 +174 76 4.44089209850063e-16 +174 34 2.17924636669586e-17 +174 73 -2.08333333333333e+00 +174 183 -9.72222222222223e+00 +174 75 1.11111111111111e+01 +174 33 -1.38888888888889e+00 +174 72 -3.47222222222222e+00 +174 179 -2.12503625807159e-16 +174 92 1.77635683940025e-15 +174 68 -2.08333333333333e+00 +174 20 5.45353692760209e-17 +174 178 8.33333333333333e+00 +174 91 -1.62630325872826e-17 +174 67 2.08333333333333e+00 +174 19 5.46437894932694e-17 +174 177 -9.72222222222222e+00 +174 90 1.11111111111111e+01 +174 66 -3.47222222222222e+00 +174 18 -1.38888888888889e+00 +174 233 -3.95516952522712e-16 +174 176 8.88178419700125e-16 +174 89 1.77635683940025e-15 +174 173 -1.84748050191530e-16 +174 170 -8.33333333333333e+00 +174 65 2.25093923535147e-16 +174 5 2.83735708539457e-16 +174 62 -2.08333333333333e+00 +174 232 -7.65013052905772e-16 +174 175 -8.88178419700125e-16 +174 88 2.08627603040523e-16 +174 172 -8.33333333333333e+00 +174 169 -7.71951946809679e-17 +174 64 4.44089209850063e-16 +174 4 8.27246257606440e-17 +174 61 -2.08333333333333e+00 +174 231 -2.22222222222222e+01 +174 113 -2.08333333333333e+00 +174 87 1.11111111111111e+01 +174 171 -9.72222222222222e+00 +174 168 -9.72222222222223e+00 +174 63 1.11111111111111e+01 +174 3 -1.38888888888889e+00 +174 60 -3.47222222222222e+00 +175 175 1.11111111111111e+02 +175 112 -3.47222222222222e+00 +175 111 -2.08333333333333e+00 +175 200 4.24139889876329e-16 +175 107 2.08333333333333e+00 +175 199 -1.38888888888889e+00 +175 106 -3.47222222222222e+00 +175 198 6.93889390390723e-18 +175 105 2.08333333333333e+00 +175 197 1.45825192199300e-16 +175 104 2.08333333333333e+00 +175 196 -9.72222222222222e+00 +175 103 -3.47222222222222e+00 +175 195 -8.33333333333333e+00 +175 102 -2.08333333333333e+00 +175 236 2.66453525910038e-15 +175 191 2.39391839684799e-16 +175 188 -3.03901868947687e-16 +175 98 -2.08333333333333e+00 +175 235 1.11111111111111e+01 +175 190 -9.72222222222222e+00 +175 187 -1.38888888888889e+00 +175 97 -3.47222222222222e+00 +175 234 4.32705087038965e-16 +175 189 8.33333333333333e+00 +175 186 8.67361737988404e-18 +175 96 2.08333333333333e+00 +175 80 -2.08333333333333e+00 +175 50 -8.33333333333333e+00 +175 79 -3.47222222222222e+00 +175 49 -9.72222222222223e+00 +175 78 2.08333333333333e+00 +175 48 6.88468379528295e-17 +175 185 2.68882138776405e-16 +175 77 3.15502832193282e-17 +175 35 8.33333333333333e+00 +175 74 2.08333333333333e+00 +175 184 -1.38888888888889e+00 +175 76 1.11111111111111e+01 +175 34 -9.72222222222223e+00 +175 73 -3.47222222222222e+00 +175 183 -1.31080042653497e-16 +175 75 4.44089209850063e-16 +175 33 6.85215773010839e-17 +175 72 -2.08333333333333e+00 +175 179 4.02781107078365e-16 +175 92 1.56192875473693e-16 +175 68 2.08333333333333e+00 +175 20 8.33333333333333e+00 +175 178 -9.72222222222222e+00 +175 91 -2.22222222222222e+01 +175 67 -3.47222222222222e+00 +175 19 -9.72222222222223e+00 +175 177 8.33333333333333e+00 +175 90 9.07748268913489e-17 +175 66 2.08333333333333e+00 +175 18 2.16840434497101e-19 +175 233 1.33226762955019e-15 +175 176 -2.66453525910038e-15 +175 89 1.11672823766007e-17 +175 173 9.19403442267708e-17 +175 170 -3.83915989277117e-16 +175 65 2.07597610976662e-16 +175 5 -8.33333333333333e+00 +175 62 -2.08333333333333e+00 +175 232 1.11111111111111e+01 +175 113 -2.08333333333333e+00 +175 88 -2.22222222222222e+01 +175 172 -9.72222222222222e+00 +175 169 -1.38888888888889e+00 +175 64 1.11111111111111e+01 +175 4 -9.72222222222223e+00 +175 61 -3.47222222222222e+00 +175 231 -9.16150835750251e-16 +175 174 -8.88178419700125e-16 +175 87 3.72423446248771e-16 +175 171 -8.33333333333333e+00 +175 168 -1.03324467037869e-16 +175 63 4.44089209850063e-16 +175 3 6.15826833971767e-17 +175 60 -2.08333333333333e+00 +176 176 1.11111111111111e+02 +176 112 -2.08333333333333e+00 +176 111 -2.08333333333333e+00 +176 200 -9.72222222222222e+00 +176 107 -3.47222222222222e+00 +176 199 2.39608680119296e-16 +176 106 2.08333333333333e+00 +176 198 -8.33333333333333e+00 +176 105 -2.08333333333333e+00 +176 197 -1.38888888888889e+00 +176 104 -3.47222222222222e+00 +176 196 1.98625837999344e-16 +176 103 2.08333333333333e+00 +176 195 1.48318857196017e-16 +176 102 2.08333333333333e+00 +176 236 1.11111111111111e+01 +176 191 -1.38888888888889e+00 +176 188 -9.72222222222222e+00 +176 98 -3.47222222222222e+00 +176 235 1.77635683940025e-15 +176 190 2.66280053562440e-16 +176 187 -1.60461921527855e-16 +176 97 -2.08333333333333e+00 +176 234 -3.68845579079569e-16 +176 189 4.33680868994202e-18 +176 186 8.33333333333333e+00 +176 96 2.08333333333333e+00 +176 80 -3.47222222222222e+00 +176 50 -9.72222222222222e+00 +176 79 -2.08333333333333e+00 +176 49 -8.33333333333333e+00 +176 78 2.08333333333333e+00 +176 48 1.71846044338952e-16 +176 185 -9.72222222222222e+00 +176 77 -2.22222222222222e+01 +176 35 -9.72222222222222e+00 +176 74 -3.47222222222222e+00 +176 184 2.89481980053630e-16 +176 76 2.17368983056188e-16 +176 34 8.33333333333333e+00 +176 73 2.08333333333333e+00 +176 183 8.33333333333333e+00 +176 75 -2.82204272970821e-16 +176 33 2.69749500514394e-16 +176 72 2.08333333333333e+00 +176 179 -1.38888888888889e+00 +176 92 1.11111111111111e+01 +176 68 -3.47222222222222e+00 +176 20 -9.72222222222222e+00 +176 178 5.17814957579077e-16 +176 91 3.72206605814274e-16 +176 67 2.08333333333333e+00 +176 19 8.33333333333333e+00 +176 177 -1.78025996722120e-16 +176 90 1.77635683940025e-15 +176 66 -2.08333333333333e+00 +176 18 8.84708972748172e-17 +176 233 1.11111111111111e+01 +176 113 -3.47222222222222e+00 +176 89 1.11111111111111e+01 +176 173 -1.38888888888889e+00 +176 170 -9.72222222222222e+00 +176 65 -2.22222222222222e+01 +176 5 -9.72222222222222e+00 +176 62 -3.47222222222222e+00 +176 232 1.77635683940025e-15 +176 175 -2.66453525910038e-15 +176 88 -1.73526557706305e-16 +176 172 1.21755903970122e-16 +176 169 -2.68014777038417e-16 +176 64 1.14817010066215e-16 +176 4 -8.33333333333333e+00 +176 61 -2.08333333333333e+00 +176 231 -3.54872923581662e-16 +176 174 8.88178419700125e-16 +176 87 1.77635683940025e-15 +176 171 -3.40439482160448e-17 +176 168 -8.33333333333333e+00 +176 63 2.52402265754625e-16 +176 3 8.06646416329215e-17 +176 60 -2.08333333333333e+00 +177 177 5.55555555555556e+01 +177 83 0.00000000000000e+00 +177 46 0.00000000000000e+00 +177 82 0.00000000000000e+00 +177 45 0.00000000000000e+00 +177 81 0.00000000000000e+00 +177 80 5.96744875736022e-16 +177 50 -4.16666666666667e+00 +177 77 -2.08333333333333e+00 +177 185 3.72965547335014e-17 +177 79 8.88178419700125e-16 +177 49 -3.38271077815477e-17 +177 76 2.08333333333333e+00 +177 184 7.92551788086904e-17 +177 78 5.55555555555556e+00 +177 48 -4.86111111111111e+00 +177 75 -3.47222222222222e+00 +177 183 -1.38888888888889e+00 +177 95 0.00000000000000e+00 +177 182 0.00000000000000e+00 +177 17 0.00000000000000e+00 +177 71 0.00000000000000e+00 +177 94 0.00000000000000e+00 +177 181 0.00000000000000e+00 +177 16 0.00000000000000e+00 +177 70 0.00000000000000e+00 +177 93 0.00000000000000e+00 +177 180 0.00000000000000e+00 +177 15 0.00000000000000e+00 +177 69 0.00000000000000e+00 +177 179 -8.88178419700125e-16 +177 92 -2.69749500514394e-16 +177 176 -1.57209315010398e-16 +177 233 1.33226762955019e-15 +177 68 -6.76542155630955e-17 +177 20 4.16666666666667e+00 +177 65 2.08333333333333e+00 +177 170 6.49437101318817e-17 +177 178 -1.77635683940025e-15 +177 91 -4.31404044431982e-16 +177 175 8.33333333333333e+00 +177 232 5.48877349820787e-16 +177 67 8.88178419700125e-16 +177 19 -8.32667268468867e-17 +177 64 2.08333333333333e+00 +177 169 7.67615138119737e-17 +177 47 0.00000000000000e+00 +177 90 -1.11111111111111e+01 +177 174 -9.72222222222222e+00 +177 231 1.11111111111111e+01 +177 66 5.55555555555556e+00 +177 18 -4.86111111111111e+00 +177 63 -3.47222222222222e+00 +177 168 -1.38888888888889e+00 +178 178 5.55555555555556e+01 +178 83 0.00000000000000e+00 +178 46 0.00000000000000e+00 +178 82 0.00000000000000e+00 +178 45 0.00000000000000e+00 +178 81 0.00000000000000e+00 +178 80 -2.41126563160776e-16 +178 50 -1.80411241501588e-16 +178 77 2.08333333333333e+00 +178 185 8.33333333333333e+00 +178 79 5.55555555555556e+00 +178 49 -6.94444444444445e-01 +178 76 -3.47222222222222e+00 +178 184 -9.72222222222223e+00 +178 78 8.88178419700125e-16 +178 48 -7.63278329429795e-17 +178 75 2.08333333333333e+00 +178 183 1.45716771982052e-16 +178 95 0.00000000000000e+00 +178 182 0.00000000000000e+00 +178 17 0.00000000000000e+00 +178 71 0.00000000000000e+00 +178 94 0.00000000000000e+00 +178 181 0.00000000000000e+00 +178 16 0.00000000000000e+00 +178 70 0.00000000000000e+00 +178 93 0.00000000000000e+00 +178 180 0.00000000000000e+00 +178 15 0.00000000000000e+00 +178 69 0.00000000000000e+00 +178 179 -8.88178419700125e-16 +178 92 1.77635683940025e-15 +178 176 4.62303806347819e-16 +178 233 2.52944366840868e-16 +178 68 -5.06322414550731e-17 +178 20 1.04083408558608e-16 +178 65 -2.08333333333333e+00 +178 170 -8.33333333333333e+00 +178 47 0.00000000000000e+00 +178 91 5.55555555555556e+00 +178 175 -9.72222222222222e+00 +178 232 -2.22222222222222e+01 +178 67 5.55555555555556e+00 +178 19 -6.94444444444445e-01 +178 64 -3.47222222222222e+00 +178 169 -9.72222222222223e+00 +178 177 -8.88178419700125e-16 +178 90 -3.39138439553466e-16 +178 174 8.33333333333333e+00 +178 231 3.74158169724748e-16 +178 66 8.88178419700125e-16 +178 18 -9.71445146547012e-17 +178 63 2.08333333333333e+00 +178 168 3.38271077815477e-17 +179 179 5.55555555555556e+01 +179 83 0.00000000000000e+00 +179 46 0.00000000000000e+00 +179 82 0.00000000000000e+00 +179 45 0.00000000000000e+00 +179 81 0.00000000000000e+00 +179 80 -1.11111111111111e+01 +179 50 -4.86111111111111e+00 +179 77 -3.47222222222222e+00 +179 185 -9.72222222222222e+00 +179 79 -4.36933475511658e-17 +179 49 -2.47198095326695e-16 +179 76 2.08333333333333e+00 +179 184 8.33333333333333e+00 +179 78 -6.76542155630955e-17 +179 48 -4.16666666666667e+00 +179 75 -2.08333333333333e+00 +179 183 1.77592315853126e-16 +179 95 0.00000000000000e+00 +179 182 0.00000000000000e+00 +179 17 0.00000000000000e+00 +179 71 0.00000000000000e+00 +179 94 0.00000000000000e+00 +179 181 0.00000000000000e+00 +179 16 0.00000000000000e+00 +179 70 0.00000000000000e+00 +179 93 0.00000000000000e+00 +179 180 0.00000000000000e+00 +179 15 0.00000000000000e+00 +179 69 0.00000000000000e+00 +179 47 0.00000000000000e+00 +179 92 5.55555555555556e+00 +179 176 -1.38888888888889e+00 +179 233 1.11111111111111e+01 +179 68 -1.11111111111111e+01 +179 20 -4.86111111111111e+00 +179 65 -3.47222222222222e+00 +179 170 -9.72222222222222e+00 +179 178 -8.88178419700125e-16 +179 91 1.77635683940025e-15 +179 175 4.07117915768307e-16 +179 232 5.96582245410149e-17 +179 67 -2.41126563160776e-16 +179 19 1.11022302462516e-16 +179 64 -2.08333333333333e+00 +179 169 -8.33333333333333e+00 +179 177 -8.88178419700125e-16 +179 90 -4.92661467177413e-16 +179 174 -2.18575157973078e-16 +179 231 1.33226762955019e-15 +179 66 5.96744875736022e-16 +179 18 4.16666666666667e+00 +179 63 2.08333333333333e+00 +179 168 -7.45931094670027e-17 +180 180 1.00000000000000e+00 +180 80 0.00000000000000e+00 +180 46 0.00000000000000e+00 +180 79 0.00000000000000e+00 +180 45 0.00000000000000e+00 +180 78 0.00000000000000e+00 +180 83 0.00000000000000e+00 +180 185 0.00000000000000e+00 +180 74 0.00000000000000e+00 +180 32 0.00000000000000e+00 +180 82 0.00000000000000e+00 +180 184 0.00000000000000e+00 +180 73 0.00000000000000e+00 +180 31 0.00000000000000e+00 +180 81 0.00000000000000e+00 +180 183 0.00000000000000e+00 +180 72 0.00000000000000e+00 +180 30 0.00000000000000e+00 +180 95 0.00000000000000e+00 +180 179 0.00000000000000e+00 +180 17 0.00000000000000e+00 +180 68 0.00000000000000e+00 +180 94 0.00000000000000e+00 +180 178 0.00000000000000e+00 +180 16 0.00000000000000e+00 +180 67 0.00000000000000e+00 +180 93 0.00000000000000e+00 +180 177 0.00000000000000e+00 +180 15 0.00000000000000e+00 +180 66 0.00000000000000e+00 +180 182 0.00000000000000e+00 +180 233 0.00000000000000e+00 +180 173 0.00000000000000e+00 +180 86 0.00000000000000e+00 +180 71 0.00000000000000e+00 +180 170 0.00000000000000e+00 +180 62 0.00000000000000e+00 +180 2 0.00000000000000e+00 +180 181 0.00000000000000e+00 +180 232 0.00000000000000e+00 +180 172 0.00000000000000e+00 +180 85 0.00000000000000e+00 +180 70 0.00000000000000e+00 +180 169 0.00000000000000e+00 +180 61 0.00000000000000e+00 +180 1 0.00000000000000e+00 +180 47 0.00000000000000e+00 +180 231 0.00000000000000e+00 +180 171 0.00000000000000e+00 +180 84 0.00000000000000e+00 +180 69 0.00000000000000e+00 +180 168 0.00000000000000e+00 +180 60 0.00000000000000e+00 +180 0 0.00000000000000e+00 +181 181 1.00000000000000e+00 +181 80 0.00000000000000e+00 +181 46 0.00000000000000e+00 +181 79 0.00000000000000e+00 +181 45 0.00000000000000e+00 +181 78 0.00000000000000e+00 +181 83 0.00000000000000e+00 +181 185 0.00000000000000e+00 +181 74 0.00000000000000e+00 +181 32 0.00000000000000e+00 +181 82 0.00000000000000e+00 +181 184 0.00000000000000e+00 +181 73 0.00000000000000e+00 +181 31 0.00000000000000e+00 +181 81 0.00000000000000e+00 +181 183 0.00000000000000e+00 +181 72 0.00000000000000e+00 +181 30 0.00000000000000e+00 +181 95 0.00000000000000e+00 +181 179 0.00000000000000e+00 +181 17 0.00000000000000e+00 +181 68 0.00000000000000e+00 +181 94 0.00000000000000e+00 +181 178 0.00000000000000e+00 +181 16 0.00000000000000e+00 +181 67 0.00000000000000e+00 +181 93 0.00000000000000e+00 +181 177 0.00000000000000e+00 +181 15 0.00000000000000e+00 +181 66 0.00000000000000e+00 +181 182 0.00000000000000e+00 +181 233 0.00000000000000e+00 +181 173 0.00000000000000e+00 +181 86 0.00000000000000e+00 +181 71 0.00000000000000e+00 +181 170 0.00000000000000e+00 +181 62 0.00000000000000e+00 +181 2 0.00000000000000e+00 +181 47 0.00000000000000e+00 +181 232 0.00000000000000e+00 +181 172 0.00000000000000e+00 +181 85 0.00000000000000e+00 +181 70 0.00000000000000e+00 +181 169 0.00000000000000e+00 +181 61 0.00000000000000e+00 +181 1 0.00000000000000e+00 +181 180 0.00000000000000e+00 +181 231 0.00000000000000e+00 +181 171 0.00000000000000e+00 +181 84 0.00000000000000e+00 +181 69 0.00000000000000e+00 +181 168 0.00000000000000e+00 +181 60 0.00000000000000e+00 +181 0 0.00000000000000e+00 +182 182 1.00000000000000e+00 +182 80 0.00000000000000e+00 +182 46 0.00000000000000e+00 +182 79 0.00000000000000e+00 +182 45 0.00000000000000e+00 +182 78 0.00000000000000e+00 +182 83 0.00000000000000e+00 +182 185 0.00000000000000e+00 +182 74 0.00000000000000e+00 +182 32 0.00000000000000e+00 +182 82 0.00000000000000e+00 +182 184 0.00000000000000e+00 +182 73 0.00000000000000e+00 +182 31 0.00000000000000e+00 +182 81 0.00000000000000e+00 +182 183 0.00000000000000e+00 +182 72 0.00000000000000e+00 +182 30 0.00000000000000e+00 +182 95 0.00000000000000e+00 +182 179 0.00000000000000e+00 +182 17 0.00000000000000e+00 +182 68 0.00000000000000e+00 +182 94 0.00000000000000e+00 +182 178 0.00000000000000e+00 +182 16 0.00000000000000e+00 +182 67 0.00000000000000e+00 +182 93 0.00000000000000e+00 +182 177 0.00000000000000e+00 +182 15 0.00000000000000e+00 +182 66 0.00000000000000e+00 +182 47 0.00000000000000e+00 +182 233 0.00000000000000e+00 +182 173 0.00000000000000e+00 +182 86 0.00000000000000e+00 +182 71 0.00000000000000e+00 +182 170 0.00000000000000e+00 +182 62 0.00000000000000e+00 +182 2 0.00000000000000e+00 +182 181 0.00000000000000e+00 +182 232 0.00000000000000e+00 +182 172 0.00000000000000e+00 +182 85 0.00000000000000e+00 +182 70 0.00000000000000e+00 +182 169 0.00000000000000e+00 +182 61 0.00000000000000e+00 +182 1 0.00000000000000e+00 +182 180 0.00000000000000e+00 +182 231 0.00000000000000e+00 +182 171 0.00000000000000e+00 +182 84 0.00000000000000e+00 +182 69 0.00000000000000e+00 +182 168 0.00000000000000e+00 +182 60 0.00000000000000e+00 +182 0 0.00000000000000e+00 +183 183 5.55555555555556e+01 +183 95 0.00000000000000e+00 +183 46 0.00000000000000e+00 +183 94 0.00000000000000e+00 +183 45 0.00000000000000e+00 +183 93 0.00000000000000e+00 +183 80 8.88178419700125e-16 +183 50 7.45931094670027e-17 +183 179 1.78459677591114e-16 +183 92 2.08333333333333e+00 +183 79 2.77555756156289e-17 +183 49 -4.16666666666667e+00 +183 178 1.45716771982052e-16 +183 91 -2.08333333333333e+00 +183 78 5.55555555555556e+00 +183 48 -4.86111111111111e+00 +183 177 -1.38888888888889e+00 +183 90 -3.47222222222222e+00 +183 77 -2.01011082778813e-16 +183 35 -1.56125112837913e-17 +183 176 8.33333333333333e+00 +183 89 2.08333333333333e+00 +183 76 -4.28476698566271e-16 +183 34 4.16666666666667e+00 +183 175 -1.31080042653497e-16 +183 88 2.08333333333333e+00 +183 75 -1.11111111111111e+01 +183 33 -4.86111111111111e+00 +183 174 -9.72222222222223e+00 +183 87 -3.47222222222222e+00 +183 83 0.00000000000000e+00 +183 185 -1.77635683940025e-15 +183 74 8.88178419700125e-16 +183 32 0.00000000000000e+00 +183 182 0.00000000000000e+00 +183 233 3.63519435907234e-16 +183 173 1.75966012594397e-16 +183 86 0.00000000000000e+00 +183 82 0.00000000000000e+00 +183 184 0.00000000000000e+00 +183 73 1.38777878078145e-16 +183 31 0.00000000000000e+00 +183 181 0.00000000000000e+00 +183 232 4.44089209850063e-16 +183 172 7.67615138119737e-17 +183 85 0.00000000000000e+00 +183 81 0.00000000000000e+00 +183 47 0.00000000000000e+00 +183 72 5.55555555555556e+00 +183 30 0.00000000000000e+00 +183 180 0.00000000000000e+00 +183 231 1.11111111111111e+01 +183 171 -1.38888888888889e+00 +183 84 0.00000000000000e+00 +184 184 5.55555555555556e+01 +184 95 0.00000000000000e+00 +184 46 0.00000000000000e+00 +184 94 0.00000000000000e+00 +184 45 0.00000000000000e+00 +184 93 0.00000000000000e+00 +184 80 1.32381085260480e-16 +184 50 1.30971622436249e-16 +184 179 8.33333333333333e+00 +184 92 2.08333333333333e+00 +184 79 -1.11111111111111e+01 +184 49 -4.86111111111111e+00 +184 178 -9.72222222222223e+00 +184 91 -3.47222222222222e+00 +184 78 1.38777878078145e-16 +184 48 -4.16666666666667e+00 +184 177 7.83878170707020e-17 +184 90 -2.08333333333333e+00 +184 77 4.44089209850063e-16 +184 35 1.94289029309402e-16 +184 176 2.34838190560360e-16 +184 89 -2.08333333333333e+00 +184 76 5.55555555555556e+00 +184 34 -4.86111111111111e+00 +184 175 -1.38888888888889e+00 +184 88 -3.47222222222222e+00 +184 75 -3.95516952522712e-16 +184 33 4.16666666666667e+00 +184 174 -1.11022302462516e-16 +184 87 2.08333333333333e+00 +184 83 0.00000000000000e+00 +184 185 -8.88178419700125e-16 +184 74 -2.31585584042904e-16 +184 32 0.00000000000000e+00 +184 182 0.00000000000000e+00 +184 233 9.55046588688169e-17 +184 173 -8.33333333333333e+00 +184 86 0.00000000000000e+00 +184 82 0.00000000000000e+00 +184 47 0.00000000000000e+00 +184 73 -1.11111111111111e+01 +184 31 0.00000000000000e+00 +184 181 0.00000000000000e+00 +184 232 1.11111111111111e+01 +184 172 -9.72222222222223e+00 +184 85 0.00000000000000e+00 +184 81 0.00000000000000e+00 +184 183 8.88178419700125e-16 +184 72 2.77555756156289e-17 +184 30 0.00000000000000e+00 +184 180 0.00000000000000e+00 +184 231 8.88178419700125e-16 +184 171 3.38271077815477e-17 +184 84 0.00000000000000e+00 +185 185 5.55555555555556e+01 +185 95 0.00000000000000e+00 +185 46 0.00000000000000e+00 +185 94 0.00000000000000e+00 +185 45 0.00000000000000e+00 +185 93 0.00000000000000e+00 +185 80 5.55555555555556e+00 +185 50 -6.94444444444445e-01 +185 179 -9.72222222222222e+00 +185 92 -3.47222222222222e+00 +185 79 3.23525928269675e-16 +185 49 9.02056207507940e-17 +185 178 8.33333333333333e+00 +185 91 2.08333333333333e+00 +185 78 8.88178419700125e-16 +185 48 6.93889390390723e-18 +185 177 3.72965547335014e-17 +185 90 2.08333333333333e+00 +185 77 5.55555555555556e+00 +185 35 -6.94444444444444e-01 +185 176 -9.72222222222222e+00 +185 89 -3.47222222222222e+00 +185 76 4.44089209850063e-16 +185 34 2.10768902331182e-16 +185 175 2.61943244872498e-16 +185 88 -2.08333333333333e+00 +185 75 -1.99493199737333e-16 +185 33 -1.11022302462516e-16 +185 174 8.33333333333333e+00 +185 87 2.08333333333333e+00 +185 83 0.00000000000000e+00 +185 47 0.00000000000000e+00 +185 74 5.55555555555556e+00 +185 32 0.00000000000000e+00 +185 182 0.00000000000000e+00 +185 233 -2.22222222222222e+01 +185 173 -9.72222222222222e+00 +185 86 0.00000000000000e+00 +185 82 0.00000000000000e+00 +185 184 -8.88178419700125e-16 +185 73 -2.07733136248223e-16 +185 31 0.00000000000000e+00 +185 181 0.00000000000000e+00 +185 232 2.50559122061400e-16 +185 172 -8.33333333333333e+00 +185 85 0.00000000000000e+00 +185 81 0.00000000000000e+00 +185 183 -1.77635683940025e-15 +185 72 8.88178419700125e-16 +185 30 0.00000000000000e+00 +185 180 0.00000000000000e+00 +185 231 5.58364118830035e-16 +185 171 3.64291929955129e-17 +185 84 0.00000000000000e+00 +186 186 5.55555555555556e+01 +186 20 -9.28077059647592e-17 +186 91 2.08333333333333e+00 +186 19 4.16666666666666e+00 +186 90 -3.47222222222222e+00 +186 18 -4.86111111111111e+00 +186 197 8.76035355368288e-17 +186 119 -2.08333333333333e+00 +186 104 4.44089209850063e-16 +186 23 -1.90819582357449e-17 +186 196 -5.11743425413158e-17 +186 118 -2.08333333333333e+00 +186 103 1.86591193884755e-16 +186 22 -4.16666666666667e+00 +186 195 -1.38888888888889e+00 +186 117 -3.47222222222222e+00 +186 102 5.55555555555556e+00 +186 21 -4.86111111111111e+00 +186 194 -8.33333333333333e+00 +186 116 -2.08333333333333e+00 +186 101 -1.53173372423321e-15 +186 8 -1.33573707650214e-16 +186 193 -1.11889664200504e-16 +186 115 2.08333333333333e+00 +186 100 -4.79623936053275e-16 +186 7 4.16666666666666e+00 +186 192 -9.72222222222223e+00 +186 114 -3.47222222222222e+00 +186 99 -1.11111111111111e+01 +186 6 -4.86111111111111e+00 +186 176 8.33333333333333e+00 +186 236 6.80987384538145e-16 +186 191 1.98625837999344e-16 +186 89 2.08333333333333e+00 +186 65 -1.35525271560688e-16 +186 188 3.55271367880050e-15 +186 98 4.44089209850063e-16 +186 5 1.64798730217797e-17 +186 175 7.80625564189563e-18 +186 235 4.44089209850063e-16 +186 190 7.52436307704940e-17 +186 88 -2.08333333333333e+00 +186 64 3.11274443720588e-16 +186 187 -1.77635683940025e-15 +186 97 -3.86111498676400e-17 +186 4 -4.16666666666667e+00 +186 174 -9.72222222222223e+00 +186 234 1.11111111111111e+01 +186 189 -1.38888888888889e+00 +186 87 -3.47222222222222e+00 +186 63 -1.11111111111111e+01 +186 92 2.08333333333333e+00 +186 96 5.55555555555556e+00 +186 3 -4.86111111111111e+00 +187 187 5.55555555555556e+01 +187 20 2.07407875596477e-16 +187 91 -3.47222222222222e+00 +187 19 -4.86111111111111e+00 +187 90 2.08333333333333e+00 +187 18 4.16666666666667e+00 +187 197 -8.33333333333333e+00 +187 119 -2.08333333333333e+00 +187 104 3.51715184754298e-16 +187 23 -4.07660016854550e-16 +187 196 -9.72222222222223e+00 +187 118 -3.47222222222222e+00 +187 103 -1.11111111111111e+01 +187 22 -4.86111111111111e+00 +187 195 4.07660016854550e-17 +187 117 -2.08333333333333e+00 +187 102 1.69000013636178e-17 +187 21 -4.16666666666667e+00 +187 194 1.05818132034585e-16 +187 116 2.08333333333333e+00 +187 101 1.77635683940025e-15 +187 8 4.90059381963448e-16 +187 193 -1.38888888888889e+00 +187 115 -3.47222222222222e+00 +187 100 5.55555555555556e+00 +187 7 -4.86111111111111e+00 +187 192 -2.16840434497101e-17 +187 114 2.08333333333333e+00 +187 99 -4.26850395307543e-16 +187 6 4.16666666666667e+00 +187 176 -1.88217497143484e-16 +187 236 -8.84708972748172e-17 +187 191 8.33333333333333e+00 +187 89 2.08333333333333e+00 +187 65 1.77635683940025e-15 +187 188 -3.55271367880050e-15 +187 98 5.04804531509251e-16 +187 5 1.09287578986539e-16 +187 175 -1.38888888888889e+00 +187 235 1.11111111111111e+01 +187 190 -9.72222222222223e+00 +187 88 -3.47222222222222e+00 +187 64 5.55555555555556e+00 +187 92 -2.08333333333333e+00 +187 97 -1.11111111111111e+01 +187 4 -4.86111111111111e+00 +187 174 6.41847686111419e-17 +187 234 8.88178419700125e-16 +187 189 -9.54097911787244e-18 +187 87 -2.08333333333333e+00 +187 63 3.65511657399176e-16 +187 186 -2.66453525910038e-15 +187 96 7.20994444702860e-17 +187 3 -4.16666666666667e+00 +188 188 5.55555555555556e+01 +188 20 -6.94444444444444e-01 +188 91 -2.08333333333333e+00 +188 19 1.63064006741820e-16 +188 90 2.08333333333333e+00 +188 18 -1.07010754424319e-16 +188 197 -9.72222222222222e+00 +188 119 -3.47222222222222e+00 +188 104 5.55555555555556e+00 +188 23 -6.94444444444444e-01 +188 196 -8.33333333333334e+00 +188 118 -2.08333333333333e+00 +188 103 6.92154666914746e-16 +188 22 -5.08273978461204e-16 +188 195 1.67400815431762e-16 +188 117 -2.08333333333333e+00 +188 102 4.44089209850063e-16 +188 21 6.07153216591882e-18 +188 194 -9.72222222222222e+00 +188 116 -3.47222222222222e+00 +188 101 5.55555555555555e+00 +188 8 -6.94444444444444e-01 +188 193 2.62810606610486e-16 +188 115 2.08333333333333e+00 +188 100 1.33226762955019e-15 +188 7 5.15863393668603e-16 +188 192 -8.33333333333333e+00 +188 114 -2.08333333333333e+00 +188 99 -1.76952636571359e-15 +188 6 -1.24900090270330e-16 +188 176 -9.72222222222222e+00 +188 236 -2.22222222222222e+01 +188 191 -9.72222222222222e+00 +188 89 -3.47222222222222e+00 +188 65 5.55555555555556e+00 +188 92 -3.47222222222222e+00 +188 98 5.55555555555556e+00 +188 5 -6.94444444444443e-01 +188 175 -3.03793448730438e-16 +188 235 1.68051336735253e-16 +188 190 8.33333333333333e+00 +188 88 2.08333333333333e+00 +188 64 1.77635683940025e-15 +188 187 -3.55271367880050e-15 +188 97 1.36609473733174e-16 +188 4 1.25116930704827e-16 +188 174 8.33333333333333e+00 +188 234 4.06779102589405e-16 +188 189 5.71374544899861e-17 +188 87 2.08333333333333e+00 +188 63 -1.00302253482065e-16 +188 186 3.55271367880050e-15 +188 96 4.44089209850063e-16 +188 3 -2.72134745293862e-17 +189 189 5.55555555555556e+01 +189 38 -4.16666666666667e+00 +189 109 -2.08333333333333e+00 +189 37 -2.68882138776405e-17 +189 108 -3.47222222222222e+00 +189 36 -4.86111111111112e+00 +189 77 2.08333333333333e+00 +189 200 1.98625837999344e-16 +189 107 3.96492734477949e-16 +189 35 4.16666666666667e+00 +189 76 2.08333333333333e+00 +189 199 -3.72965547335014e-17 +189 106 -4.44089209850063e-16 +189 34 4.25007251614318e-17 +189 75 -3.47222222222222e+00 +189 198 -1.38888888888889e+00 +189 105 5.55555555555556e+00 +189 33 -4.86111111111111e+00 +189 194 -1.95156391047391e-16 +189 116 -2.01734787728947e-15 +189 101 2.08333333333333e+00 +189 8 4.16666666666666e+00 +189 193 -8.33333333333333e+00 +189 115 -4.62493541728004e-16 +189 100 -2.08333333333333e+00 +189 7 -5.55111512312578e-17 +189 192 -9.72222222222222e+00 +189 114 -1.11111111111111e+01 +189 99 -3.47222222222222e+00 +189 6 -4.86111111111111e+00 +189 176 1.15359111152458e-16 +189 236 1.77635683940025e-15 +189 191 2.66453525910038e-15 +189 89 2.79073639197769e-16 +189 65 -2.08333333333333e+00 +189 188 1.67292395214513e-16 +189 98 4.24898831397069e-16 +189 5 -4.16666666666667e+00 +189 175 8.33333333333333e+00 +189 235 3.60063541482436e-16 +189 190 8.88178419700125e-16 +189 88 4.80409982628327e-16 +189 64 2.08333333333333e+00 +189 187 4.33680868994202e-18 +189 97 0.00000000000000e+00 +189 4 4.16333634234434e-17 +189 174 -9.72222222222222e+00 +189 234 1.11111111111111e+01 +189 110 -2.08333333333333e+00 +189 87 -1.11111111111111e+01 +189 63 -3.47222222222222e+00 +189 186 -1.38888888888889e+00 +189 96 5.55555555555556e+00 +189 3 -4.86111111111111e+00 +190 190 5.55555555555556e+01 +190 38 1.61329283265843e-16 +190 109 -3.47222222222222e+00 +190 37 -6.94444444444446e-01 +190 108 -2.08333333333333e+00 +190 36 6.07153216591882e-18 +190 77 -2.08333333333333e+00 +190 200 -8.33333333333333e+00 +190 107 1.18481613409216e-15 +190 35 -2.16840434497101e-17 +190 76 -3.47222222222222e+00 +190 199 -9.72222222222223e+00 +190 106 5.55555555555556e+00 +190 34 -6.94444444444445e-01 +190 75 2.08333333333333e+00 +190 198 4.07660016854550e-17 +190 105 0.00000000000000e+00 +190 33 1.38777878078145e-17 +190 194 -1.05644659686988e-15 +190 116 4.44089209850063e-16 +190 101 2.08333333333333e+00 +190 8 8.57603918436034e-17 +190 193 -9.72222222222222e+00 +190 115 5.55555555555556e+00 +190 100 -3.47222222222222e+00 +190 7 -6.94444444444444e-01 +190 192 -8.33333333333333e+00 +190 114 -5.42209506460001e-16 +190 99 -2.08333333333333e+00 +190 6 -2.08166817117217e-17 +190 176 2.66280053562440e-16 +190 236 -2.80496654549156e-16 +190 191 -8.88178419700125e-16 +190 89 8.88178419700125e-16 +190 65 2.08333333333333e+00 +190 188 8.33333333333333e+00 +190 98 5.50354575280798e-16 +190 5 2.53594888144359e-16 +190 175 -9.72222222222222e+00 +190 235 -2.22222222222222e+01 +190 110 -2.08333333333333e+00 +190 88 5.55555555555556e+00 +190 64 -3.47222222222222e+00 +190 187 -9.72222222222223e+00 +190 97 5.55555555555556e+00 +190 4 -6.94444444444444e-01 +190 174 8.33333333333333e+00 +190 234 1.51435938441913e-16 +190 189 0.00000000000000e+00 +190 87 2.64247174489030e-16 +190 63 2.08333333333333e+00 +190 186 7.52436307704940e-17 +190 96 0.00000000000000e+00 +190 3 3.20923843055709e-17 +191 191 5.55555555555556e+01 +191 38 -4.86111111111111e+00 +191 109 -2.08333333333333e+00 +191 37 1.68268177169750e-16 +191 108 -2.08333333333333e+00 +191 36 -4.16666666666667e+00 +191 77 -3.47222222222222e+00 +191 200 -9.72222222222222e+00 +191 107 -1.11111111111111e+01 +191 35 -4.86111111111111e+00 +191 76 -2.08333333333333e+00 +191 199 -8.33333333333334e+00 +191 106 5.78110150896427e-16 +191 34 -1.23599047663348e-17 +191 75 2.08333333333333e+00 +191 198 1.67400815431762e-16 +191 105 3.69387680165811e-16 +191 33 4.16666666666667e+00 +191 194 -1.38888888888889e+00 +191 116 5.55555555555556e+00 +191 101 -3.47222222222222e+00 +191 8 -4.86111111111111e+00 +191 193 -1.23685783837146e-15 +191 115 0.00000000000000e+00 +191 100 2.08333333333333e+00 +191 7 2.92300905702092e-16 +191 192 -1.88217497143484e-16 +191 114 -2.13121621045476e-15 +191 99 2.08333333333333e+00 +191 6 4.16666666666667e+00 +191 176 -1.38888888888889e+00 +191 236 1.11111111111111e+01 +191 110 -3.47222222222222e+00 +191 89 5.55555555555556e+00 +191 65 -3.47222222222222e+00 +191 188 -9.72222222222222e+00 +191 98 -1.11111111111111e+01 +191 5 -4.86111111111111e+00 +191 175 1.97758476261356e-16 +191 235 8.67361737988404e-18 +191 190 -8.88178419700125e-16 +191 88 8.88178419700125e-16 +191 64 2.08333333333333e+00 +191 187 8.33333333333333e+00 +191 97 1.12236608895699e-15 +191 4 3.69496100383060e-16 +191 174 -5.52943107967607e-18 +191 234 1.77635683940025e-15 +191 189 2.66453525910038e-15 +191 87 4.01019278548076e-16 +191 63 -2.08333333333333e+00 +191 186 1.36175792864179e-16 +191 96 2.86337793753422e-16 +191 3 -4.16666666666667e+00 +192 192 1.11111111111111e+02 +192 136 -2.08333333333333e+00 +192 135 -3.47222222222222e+00 +192 215 -8.33333333333333e+00 +192 131 -2.08333333333333e+00 +192 214 -2.31477163825655e-16 +192 130 2.08333333333333e+00 +192 213 -9.72222222222223e+00 +192 129 -3.47222222222222e+00 +192 212 -2.26923514701216e-16 +192 128 2.08333333333333e+00 +192 211 -8.33333333333333e+00 +192 127 -2.08333333333333e+00 +192 210 -9.72222222222222e+00 +192 126 -3.47222222222222e+00 +192 239 -2.47267213215191e-15 +192 206 -5.04479270857505e-16 +192 203 8.33333333333333e+00 +192 122 2.08333333333333e+00 +192 238 -4.56313589344837e-16 +192 205 8.33333333333333e+00 +192 202 -2.60967462917261e-16 +192 121 2.08333333333333e+00 +192 237 -2.22222222222222e+01 +192 204 -9.72222222222222e+00 +192 201 -9.72222222222223e+00 +192 120 -3.47222222222222e+00 +192 113 2.08333333333333e+00 +192 53 4.02455846426619e-16 +192 112 2.08333333333333e+00 +192 52 2.40259201422788e-16 +192 111 -3.47222222222222e+00 +192 51 -1.38888888888889e+00 +192 200 8.33333333333333e+00 +192 110 1.29193530873373e-15 +192 38 4.57966997657877e-16 +192 107 2.08333333333333e+00 +192 199 -6.33174068731535e-17 +192 109 8.88178419700125e-16 +192 37 1.45283091113058e-16 +192 106 -2.08333333333333e+00 +192 198 -9.72222222222223e+00 +192 108 1.11111111111111e+01 +192 36 -1.38888888888889e+00 +192 105 -3.47222222222222e+00 +192 197 -3.02709246557953e-16 +192 119 2.22044604925031e-15 +192 104 -2.08333333333333e+00 +192 23 3.33934269125535e-16 +192 196 8.33333333333333e+00 +192 118 7.99815942642557e-16 +192 103 2.08333333333333e+00 +192 22 1.16226472890446e-16 +192 195 -9.72222222222222e+00 +192 117 1.11111111111111e+01 +192 102 -3.47222222222222e+00 +192 21 -1.38888888888889e+00 +192 236 -3.12683906544819e-15 +192 194 7.99360577730113e-15 +192 116 1.77635683940025e-15 +192 191 -1.91686944095437e-16 +192 188 -8.33333333333333e+00 +192 101 1.05885894670366e-15 +192 8 3.33283747822044e-16 +192 98 -2.08333333333333e+00 +192 235 -1.10154940724527e-15 +192 193 0.00000000000000e+00 +192 115 7.43613612526339e-16 +192 190 -8.33333333333333e+00 +192 187 6.07153216591882e-18 +192 100 8.88178419700125e-16 +192 7 1.70761842166467e-16 +192 97 -2.08333333333333e+00 +192 234 -2.22222222222222e+01 +192 137 -2.08333333333333e+00 +192 114 1.11111111111111e+01 +192 189 -9.72222222222222e+00 +192 186 -9.72222222222223e+00 +192 99 1.11111111111111e+01 +192 6 -1.38888888888889e+00 +192 96 -3.47222222222222e+00 +193 193 1.11111111111111e+02 +193 136 -3.47222222222222e+00 +193 135 -2.08333333333333e+00 +193 215 -2.81025203108243e-16 +193 131 2.08333333333333e+00 +193 214 -1.38888888888889e+00 +193 130 -3.47222222222222e+00 +193 213 -1.59594559789866e-16 +193 129 2.08333333333333e+00 +193 212 -8.19656842399041e-17 +193 128 2.08333333333333e+00 +193 211 -9.72222222222222e+00 +193 127 -3.47222222222222e+00 +193 210 -8.33333333333333e+00 +193 126 -2.08333333333333e+00 +193 239 1.77635683940025e-15 +193 206 1.53089346754953e-15 +193 203 1.13949648328227e-16 +193 122 -2.08333333333333e+00 +193 238 1.11111111111111e+01 +193 205 -9.72222222222222e+00 +193 202 -1.38888888888889e+00 +193 121 -3.47222222222222e+00 +193 237 -1.00505541389406e-16 +193 204 8.33333333333333e+00 +193 201 -1.86482773667507e-16 +193 120 2.08333333333333e+00 +193 113 -2.08333333333333e+00 +193 53 -8.33333333333333e+00 +193 112 -3.47222222222222e+00 +193 52 -9.72222222222223e+00 +193 111 2.08333333333333e+00 +193 51 1.56775634141404e-16 +193 200 4.51895465491958e-16 +193 110 5.54460991009087e-16 +193 38 8.33333333333333e+00 +193 107 2.08333333333333e+00 +193 116 9.97791259338410e-16 +193 199 -1.38888888888889e+00 +193 109 1.11111111111111e+01 +193 37 -9.72222222222223e+00 +193 106 -3.47222222222222e+00 +193 198 -1.27393755267047e-16 +193 108 8.88178419700125e-16 +193 36 1.16226472890446e-16 +193 105 -2.08333333333333e+00 +193 197 8.77444818192519e-16 +193 119 1.17824315842147e-15 +193 104 2.08333333333333e+00 +193 23 8.33333333333333e+00 +193 196 -9.72222222222222e+00 +193 118 -2.22222222222222e+01 +193 103 -3.47222222222222e+00 +193 22 -9.72222222222223e+00 +193 195 8.33333333333333e+00 +193 117 5.18099560649354e-16 +193 102 2.08333333333333e+00 +193 21 1.43765208071578e-16 +193 236 3.10862446895044e-15 +193 194 -5.32907051820075e-15 +193 191 -1.21604115665974e-15 +193 188 2.61943244872498e-16 +193 101 2.77623518792069e-16 +193 8 -8.33333333333333e+00 +193 98 -2.08333333333333e+00 +193 235 1.11111111111111e+01 +193 137 -2.08333333333333e+00 +193 115 -2.22222222222222e+01 +193 190 -9.72222222222222e+00 +193 187 -1.38888888888889e+00 +193 100 1.11111111111111e+01 +193 7 -9.72222222222223e+00 +193 97 -3.47222222222222e+00 +193 234 -9.50276099129232e-16 +193 192 0.00000000000000e+00 +193 114 7.99815942642557e-16 +193 189 -8.33333333333333e+00 +193 186 -1.13624387676481e-16 +193 99 8.88178419700125e-16 +193 6 2.27248775352962e-16 +193 96 -2.08333333333333e+00 +194 194 1.11111111111111e+02 +194 136 -2.08333333333333e+00 +194 135 -2.08333333333333e+00 +194 215 -9.72222222222222e+00 +194 131 -3.47222222222222e+00 +194 214 -2.21502503838789e-16 +194 130 2.08333333333333e+00 +194 213 -8.33333333333333e+00 +194 129 -2.08333333333333e+00 +194 212 -1.38888888888889e+00 +194 128 -3.47222222222222e+00 +194 211 -1.47451495458029e-16 +194 127 2.08333333333333e+00 +194 210 -1.99493199737333e-16 +194 126 2.08333333333333e+00 +194 239 1.11111111111111e+01 +194 206 -1.38888888888889e+00 +194 203 -9.72222222222222e+00 +194 122 -3.47222222222222e+00 +194 238 1.33226762955019e-15 +194 205 1.41293227118311e-15 +194 202 1.13624387676481e-16 +194 121 -2.08333333333333e+00 +194 237 -2.57259491487360e-15 +194 204 -4.55364912443912e-16 +194 201 8.33333333333333e+00 +194 120 2.08333333333333e+00 +194 113 -3.47222222222222e+00 +194 53 -9.72222222222222e+00 +194 112 -2.08333333333333e+00 +194 52 -8.33333333333333e+00 +194 111 2.08333333333333e+00 +194 51 1.52764086103208e-16 +194 200 -9.72222222222222e+00 +194 110 -2.22222222222222e+01 +194 38 -9.72222222222222e+00 +194 107 -3.47222222222222e+00 +194 199 3.96167473826203e-16 +194 109 2.98548620721040e-16 +194 37 8.33333333333333e+00 +194 106 2.08333333333333e+00 +194 198 8.33333333333333e+00 +194 108 1.00410673699314e-15 +194 36 1.52764086103208e-16 +194 105 2.08333333333333e+00 +194 197 -1.38888888888889e+00 +194 119 1.11111111111111e+01 +194 104 -3.47222222222222e+00 +194 23 -9.72222222222222e+00 +194 196 8.43942971062717e-16 +194 118 1.47657493870801e-15 +194 103 2.08333333333333e+00 +194 22 8.33333333333333e+00 +194 195 -3.96275894043452e-16 +194 117 2.22044604925031e-15 +194 102 -2.08333333333333e+00 +194 21 4.30211422042248e-16 +194 236 1.11111111111111e+01 +194 137 -3.47222222222222e+00 +194 116 1.11111111111111e+01 +194 191 -1.38888888888889e+00 +194 188 -9.72222222222222e+00 +194 101 -2.22222222222222e+01 +194 8 -9.72222222222222e+00 +194 98 -3.47222222222222e+00 +194 235 3.55271367880050e-15 +194 193 -5.32907051820075e-15 +194 115 6.16084331987732e-16 +194 190 -1.08506953422349e-15 +194 187 8.50014503228635e-17 +194 100 4.50377582450479e-16 +194 7 -8.33333333333333e+00 +194 97 -2.08333333333333e+00 +194 234 -3.15164019014380e-15 +194 192 7.99360577730113e-15 +194 114 1.77635683940025e-15 +194 189 -2.20309881449055e-16 +194 186 -8.33333333333333e+00 +194 99 1.54162706905714e-15 +194 6 5.96744875736022e-16 +194 96 -2.08333333333333e+00 +195 195 5.55555555555556e+01 +195 77 2.08333333333333e+00 +195 49 -4.85722573273506e-17 +195 76 -2.08333333333333e+00 +195 48 -4.86111111111111e+00 +195 75 -3.47222222222222e+00 +195 113 2.84494650060196e-16 +195 53 -4.16666666666667e+00 +195 110 -2.08333333333333e+00 +195 200 1.43114686768087e-16 +195 112 8.88178419700125e-16 +195 52 -8.41340885848751e-17 +195 109 2.08333333333333e+00 +195 199 7.60025722912339e-17 +195 111 5.55555555555556e+00 +195 51 -4.86111111111111e+00 +195 108 -3.47222222222222e+00 +195 198 -1.38888888888889e+00 +195 92 -2.77555756156289e-16 +195 176 2.52402265754625e-16 +195 20 -4.16666666666667e+00 +195 65 -2.08333333333333e+00 +195 91 1.12757025938492e-16 +195 175 -8.33333333333333e+00 +195 19 -3.46944695195361e-17 +195 64 -2.08333333333333e+00 +195 90 -1.11111111111111e+01 +195 174 -9.72222222222222e+00 +195 18 -4.86111111111111e+00 +195 63 -3.47222222222222e+00 +195 197 1.77635683940025e-15 +195 119 -1.07899800205757e-15 +195 194 -3.65159291693118e-16 +195 236 1.77635683940025e-15 +195 104 3.72965547335014e-17 +195 23 4.16666666666667e+00 +195 101 2.08333333333333e+00 +195 188 5.71374544899861e-17 +195 196 -1.77635683940025e-15 +195 118 -5.99021700298241e-16 +195 193 8.33333333333333e+00 +195 235 -2.20364091557679e-17 +195 103 8.88178419700125e-16 +195 22 -4.42354486374086e-17 +195 100 2.08333333333333e+00 +195 187 1.29020058525775e-17 +195 50 4.16666666666667e+00 +195 117 -1.11111111111111e+01 +195 192 -9.72222222222222e+00 +195 234 1.11111111111111e+01 +195 102 5.55555555555556e+00 +195 21 -4.86111111111111e+00 +195 99 -3.47222222222222e+00 +195 186 -1.38888888888889e+00 +196 196 5.55555555555556e+01 +196 77 2.08333333333333e+00 +196 49 -6.94444444444444e-01 +196 76 -3.47222222222222e+00 +196 48 2.94902990916057e-17 +196 75 -2.08333333333333e+00 +196 113 -7.73686670285656e-16 +196 53 -5.55111512312578e-17 +196 110 2.08333333333333e+00 +196 200 8.33333333333333e+00 +196 112 5.55555555555556e+00 +196 52 -6.94444444444445e-01 +196 109 -3.47222222222222e+00 +196 199 -9.72222222222223e+00 +196 111 8.88178419700125e-16 +196 51 -2.77555756156289e-17 +196 108 2.08333333333333e+00 +196 198 -9.54097911787244e-18 +196 92 1.33226762955019e-15 +196 176 1.43982048506075e-16 +196 20 9.71445146547012e-17 +196 65 -2.08333333333333e+00 +196 91 5.55555555555556e+00 +196 175 -9.72222222222222e+00 +196 19 -6.94444444444445e-01 +196 64 -3.47222222222222e+00 +196 90 5.25512793003724e-16 +196 174 -8.33333333333333e+00 +196 18 6.41847686111419e-17 +196 63 -2.08333333333333e+00 +196 197 0.00000000000000e+00 +196 119 3.10862446895044e-15 +196 194 8.43942971062717e-16 +196 236 5.08273978461204e-16 +196 104 -4.54280710271426e-16 +196 23 3.09648140461860e-16 +196 101 -2.08333333333333e+00 +196 188 -8.33333333333334e+00 +196 50 -1.66533453693773e-16 +196 118 5.55555555555556e+00 +196 193 -9.72222222222222e+00 +196 235 -2.22222222222222e+01 +196 103 5.55555555555556e+00 +196 22 -6.94444444444444e-01 +196 100 -3.47222222222222e+00 +196 187 -9.72222222222223e+00 +196 195 -1.77635683940025e-15 +196 117 -5.06539254985228e-16 +196 192 8.33333333333333e+00 +196 234 1.27610595701544e-16 +196 102 8.88178419700125e-16 +196 21 -2.77555756156289e-17 +196 99 2.08333333333333e+00 +196 186 -5.11743425413158e-17 +197 197 5.55555555555556e+01 +197 77 -3.47222222222222e+00 +197 49 -1.79543879763600e-16 +197 76 2.08333333333333e+00 +197 48 4.16666666666667e+00 +197 75 2.08333333333333e+00 +197 113 -1.11111111111111e+01 +197 53 -4.86111111111111e+00 +197 110 -3.47222222222222e+00 +197 200 -9.72222222222222e+00 +197 112 -3.39680540639709e-16 +197 52 9.54097911787244e-17 +197 109 2.08333333333333e+00 +197 199 8.33333333333333e+00 +197 111 2.59341159658533e-16 +197 51 -4.16666666666667e+00 +197 108 -2.08333333333333e+00 +197 198 5.78963960107259e-17 +197 92 5.55555555555556e+00 +197 176 -1.38888888888889e+00 +197 20 -4.86111111111111e+00 +197 65 -3.47222222222222e+00 +197 91 1.77635683940025e-15 +197 175 1.45933612416549e-16 +197 19 1.11022302462516e-16 +197 64 -2.08333333333333e+00 +197 90 -4.02455846426619e-16 +197 174 1.57642995879392e-16 +197 18 -4.16666666666667e+00 +197 63 -2.08333333333333e+00 +197 50 -4.86111111111111e+00 +197 119 5.55555555555556e+00 +197 194 -1.38888888888889e+00 +197 236 1.11111111111111e+01 +197 104 -1.11111111111111e+01 +197 23 -4.86111111111111e+00 +197 101 -3.47222222222222e+00 +197 188 -9.72222222222222e+00 +197 196 -1.77635683940025e-15 +197 118 2.66453525910038e-15 +197 193 9.91936567606988e-16 +197 235 2.85131618836532e-16 +197 103 -8.29197821516914e-16 +197 22 2.98372437868011e-16 +197 100 -2.08333333333333e+00 +197 187 -8.33333333333333e+00 +197 195 1.77635683940025e-15 +197 117 -1.06165076729781e-15 +197 192 -3.19189119579733e-16 +197 234 1.77635683940025e-15 +197 102 2.22044604925031e-16 +197 21 4.16666666666667e+00 +197 99 2.08333333333333e+00 +197 186 -2.34187669256869e-17 +198 198 5.55555555555556e+01 +198 92 -2.08333333333333e+00 +198 49 4.16666666666667e+00 +198 91 2.08333333333333e+00 +198 48 -4.86111111111111e+00 +198 90 -3.47222222222222e+00 +198 113 1.33226762955019e-15 +198 53 -8.67361737988404e-18 +198 197 1.68051336735253e-16 +198 119 2.08333333333333e+00 +198 112 1.73472347597681e-16 +198 52 -4.16666666666667e+00 +198 196 4.33680868994202e-18 +198 118 -2.08333333333333e+00 +198 111 5.55555555555555e+00 +198 51 -4.86111111111111e+00 +198 195 -1.38888888888889e+00 +198 117 -3.47222222222222e+00 +198 110 -1.62001488612784e-15 +198 38 -1.20563281580388e-16 +198 194 8.33333333333333e+00 +198 116 2.08333333333333e+00 +198 109 -5.79397640976254e-16 +198 37 4.16666666666667e+00 +198 193 -1.20563281580388e-16 +198 115 2.08333333333333e+00 +198 108 -1.11111111111111e+01 +198 36 -4.86111111111111e+00 +198 192 -9.72222222222223e+00 +198 114 -3.47222222222222e+00 +198 77 -8.58688120608520e-17 +198 200 0.00000000000000e+00 +198 107 1.33226762955019e-15 +198 35 1.38777878078145e-17 +198 176 -8.33333333333333e+00 +198 236 2.95756800126890e-16 +198 191 1.68159756952502e-16 +198 89 -2.08333333333333e+00 +198 76 2.84494650060196e-16 +198 199 8.88178419700125e-16 +198 106 1.64798730217797e-17 +198 34 -4.16666666666667e+00 +198 175 1.38777878078145e-17 +198 235 8.88178419700125e-16 +198 190 2.67797936603920e-17 +198 88 -2.08333333333333e+00 +198 75 -1.11111111111111e+01 +198 50 -1.24900090270330e-16 +198 105 5.55555555555555e+00 +198 33 -4.86111111111111e+00 +198 174 -9.72222222222223e+00 +198 234 1.11111111111111e+01 +198 189 -1.38888888888889e+00 +198 87 -3.47222222222222e+00 +199 199 5.55555555555556e+01 +199 92 2.08333333333333e+00 +199 49 -4.86111111111111e+00 +199 91 -3.47222222222222e+00 +199 48 4.16666666666667e+00 +199 90 2.08333333333333e+00 +199 113 -1.73255507163184e-16 +199 53 -5.36896915814822e-16 +199 197 8.33333333333333e+00 +199 119 2.08333333333333e+00 +199 112 -1.11111111111111e+01 +199 52 -4.86111111111111e+00 +199 196 -9.72222222222223e+00 +199 118 -3.47222222222222e+00 +199 111 1.34441069388203e-16 +199 51 -4.16666666666667e+00 +199 195 7.60025722912339e-17 +199 117 -2.08333333333333e+00 +199 110 2.22044604925031e-15 +199 38 2.98372437868011e-16 +199 194 3.96167473826203e-16 +199 116 -2.08333333333333e+00 +199 109 5.55555555555556e+00 +199 37 -4.86111111111111e+00 +199 193 -1.38888888888889e+00 +199 115 -3.47222222222222e+00 +199 108 -6.17561557447743e-16 +199 36 4.16666666666667e+00 +199 192 -6.24500451351651e-17 +199 114 2.08333333333333e+00 +199 77 4.44089209850063e-16 +199 200 2.66453525910038e-15 +199 107 -5.51642065360625e-16 +199 35 3.46944695195361e-17 +199 176 3.50630982581812e-16 +199 236 1.02240264865383e-16 +199 191 -8.33333333333334e+00 +199 89 -2.08333333333333e+00 +199 76 5.55555555555556e+00 +199 50 1.74339709335669e-16 +199 106 -1.11111111111111e+01 +199 34 -4.86111111111111e+00 +199 175 -1.38888888888889e+00 +199 235 1.11111111111111e+01 +199 190 -9.72222222222223e+00 +199 88 -3.47222222222222e+00 +199 75 4.26741975090295e-16 +199 198 8.88178419700125e-16 +199 105 5.55111512312578e-17 +199 33 -4.16666666666667e+00 +199 174 9.80118763926896e-17 +199 234 8.88178419700125e-16 +199 189 -5.11743425413158e-17 +199 87 -2.08333333333333e+00 +200 200 5.55555555555556e+01 +200 92 -3.47222222222222e+00 +200 49 1.59594559789866e-16 +200 91 2.08333333333333e+00 +200 48 -6.50521303491303e-17 +200 90 -2.08333333333333e+00 +200 113 5.55555555555556e+00 +200 53 -6.94444444444444e-01 +200 197 -9.72222222222222e+00 +200 119 -3.47222222222222e+00 +200 112 -3.29597460435593e-16 +200 52 -6.10622663543836e-16 +200 196 8.33333333333333e+00 +200 118 2.08333333333333e+00 +200 111 1.33226762955019e-15 +200 51 2.77555756156289e-17 +200 195 1.36175792864179e-16 +200 117 2.08333333333333e+00 +200 110 5.55555555555556e+00 +200 38 -6.94444444444444e-01 +200 194 -9.72222222222222e+00 +200 116 -3.47222222222222e+00 +200 109 1.33226762955019e-15 +200 37 3.09648140461860e-16 +200 193 5.35162192338845e-16 +200 115 -2.08333333333333e+00 +200 108 -1.42334061203897e-15 +200 36 -8.32667268468867e-17 +200 192 8.33333333333333e+00 +200 114 2.08333333333333e+00 +200 77 5.55555555555556e+00 +200 50 -6.94444444444445e-01 +200 107 5.55555555555556e+00 +200 35 -6.94444444444445e-01 +200 176 -9.72222222222222e+00 +200 236 -2.22222222222222e+01 +200 191 -9.72222222222222e+00 +200 89 -3.47222222222222e+00 +200 76 8.88178419700125e-16 +200 199 8.88178419700125e-16 +200 106 -5.16839175623840e-16 +200 34 1.99493199737333e-17 +200 175 5.90673343570103e-16 +200 235 -9.54097911787244e-17 +200 190 -8.33333333333333e+00 +200 88 -2.08333333333333e+00 +200 75 -6.84131570838353e-17 +200 198 0.00000000000000e+00 +200 105 1.33226762955019e-15 +200 33 1.82145964977565e-17 +200 174 -8.33333333333333e+00 +200 234 7.30427003603484e-16 +200 189 8.76035355368288e-17 +200 87 -2.08333333333333e+00 +201 201 5.55555555555556e+01 +201 23 -2.48065457064683e-16 +201 118 2.08333333333333e+00 +201 22 4.16666666666667e+00 +201 117 -3.47222222222222e+00 +201 21 -4.86111111111111e+00 +201 212 1.78676518025611e-16 +201 143 -2.08333333333333e+00 +201 128 8.88178419700125e-16 +201 26 -8.06646416329215e-17 +201 211 3.29597460435593e-17 +201 142 -2.08333333333333e+00 +201 127 -1.66316613259276e-16 +201 25 -4.16666666666667e+00 +201 210 -1.38888888888889e+00 +201 141 -3.47222222222222e+00 +201 126 5.55555555555556e+00 +201 24 -4.86111111111111e+00 +201 209 -8.33333333333333e+00 +201 140 -2.08333333333333e+00 +201 125 -9.30448751899904e-16 +201 11 -1.56992474575901e-16 +201 208 5.73326108810335e-16 +201 139 2.08333333333333e+00 +201 124 1.68887527660783e-15 +201 10 4.16666666666667e+00 +201 207 -9.72222222222222e+00 +201 138 -3.47222222222222e+00 +201 123 -1.11111111111111e+01 +201 9 -4.86111111111111e+00 +201 194 8.33333333333333e+00 +201 239 8.03393809811759e-16 +201 206 2.35055030994857e-16 +201 116 2.08333333333333e+00 +201 101 -1.14155646740999e-15 +201 203 2.66453525910038e-15 +201 122 8.88178419700125e-16 +201 8 -2.41993924898765e-16 +201 193 -2.49800180540660e-16 +201 238 4.44089209850063e-16 +201 205 -5.19332840620557e-17 +201 115 -2.08333333333333e+00 +201 100 -1.41379963292110e-16 +201 202 -3.55271367880050e-15 +201 121 -2.75021433578104e-16 +201 7 -4.16666666666667e+00 +201 192 -9.72222222222223e+00 +201 237 1.11111111111111e+01 +201 204 -1.38888888888889e+00 +201 114 -3.47222222222222e+00 +201 99 -1.11111111111111e+01 +201 119 2.08333333333333e+00 +201 120 5.55555555555556e+00 +201 6 -4.86111111111111e+00 +202 202 5.55555555555556e+01 +202 23 8.42316667803988e-16 +202 118 -3.47222222222222e+00 +202 22 -4.86111111111111e+00 +202 117 2.08333333333333e+00 +202 21 4.16666666666666e+00 +202 212 -8.33333333333334e+00 +202 143 -2.08333333333333e+00 +202 128 -1.20118758689669e-15 +202 26 -6.60495963478169e-16 +202 211 -9.72222222222223e+00 +202 142 -3.47222222222222e+00 +202 127 -1.11111111111111e+01 +202 25 -4.86111111111111e+00 +202 210 4.35849273339173e-17 +202 141 -2.08333333333333e+00 +202 126 -1.63999131115589e-16 +202 24 -4.16666666666667e+00 +202 209 1.34614541735800e-15 +202 140 2.08333333333333e+00 +202 125 2.22044604925031e-15 +202 11 -6.41847686111419e-17 +202 208 -1.38888888888889e+00 +202 139 -3.47222222222222e+00 +202 124 5.55555555555557e+00 +202 10 -4.86111111111111e+00 +202 207 5.20417042793042e-16 +202 138 2.08333333333333e+00 +202 123 1.71325627296159e-15 +202 9 4.16666666666667e+00 +202 194 1.69135538907739e-16 +202 239 1.22785896033983e-15 +202 206 8.33333333333333e+00 +202 116 2.08333333333333e+00 +202 101 8.88178419700125e-16 +202 203 -8.88178419700125e-16 +202 122 -1.70816052275091e-15 +202 8 -1.12757025938492e-16 +202 193 -1.38888888888889e+00 +202 238 1.11111111111111e+01 +202 205 -9.72222222222223e+00 +202 115 -3.47222222222222e+00 +202 100 5.55555555555555e+00 +202 119 -2.08333333333333e+00 +202 121 -1.11111111111111e+01 +202 7 -4.86111111111111e+00 +202 192 -2.89698820488127e-16 +202 237 0.00000000000000e+00 +202 204 -7.71951946809679e-17 +202 114 -2.08333333333333e+00 +202 99 -2.51182538310579e-16 +202 201 -3.55271367880050e-15 +202 120 -3.86518074491082e-16 +202 6 -4.16666666666667e+00 +203 203 5.55555555555556e+01 +203 23 -6.94444444444444e-01 +203 118 -2.08333333333333e+00 +203 22 8.56953397132543e-16 +203 117 2.08333333333333e+00 +203 21 -2.85904112884428e-16 +203 212 -9.72222222222222e+00 +203 143 -3.47222222222222e+00 +203 128 5.55555555555556e+00 +203 26 -6.94444444444442e-01 +203 211 -8.33333333333334e+00 +203 142 -2.08333333333333e+00 +203 127 -1.27101020680476e-15 +203 25 -6.86083134748827e-16 +203 210 4.29560900738757e-16 +203 141 -2.08333333333333e+00 +203 126 8.88178419700125e-16 +203 24 -1.11022302462516e-16 +203 209 -9.72222222222222e+00 +203 140 -3.47222222222222e+00 +203 125 5.55555555555556e+00 +203 11 -6.94444444444443e-01 +203 208 1.16530049498742e-15 +203 139 2.08333333333333e+00 +203 124 1.77635683940025e-15 +203 10 -5.38848479725296e-17 +203 207 -8.33333333333333e+00 +203 138 -2.08333333333333e+00 +203 123 -8.67144897553906e-16 +203 9 -2.32452945780892e-16 +203 194 -9.72222222222222e+00 +203 239 -2.22222222222222e+01 +203 206 -9.72222222222222e+00 +203 116 -3.47222222222222e+00 +203 101 5.55555555555555e+00 +203 119 -3.47222222222222e+00 +203 122 5.55555555555555e+00 +203 8 -6.94444444444444e-01 +203 193 1.69460799559484e-16 +203 238 8.50881864966624e-16 +203 205 8.33333333333333e+00 +203 115 2.08333333333333e+00 +203 100 8.88178419700125e-16 +203 202 -8.88178419700125e-16 +203 121 -1.50649891866861e-15 +203 7 -9.38919081372447e-17 +203 192 8.33333333333333e+00 +203 237 1.43790957873174e-15 +203 204 4.31187203997485e-16 +203 114 2.08333333333333e+00 +203 99 -1.31258936011958e-15 +203 201 2.66453525910038e-15 +203 120 8.88178419700125e-16 +203 6 -2.38958158815805e-16 +204 204 5.55555555555556e+01 +204 41 -4.16666666666667e+00 +204 133 -2.08333333333333e+00 +204 40 2.66280053562440e-16 +204 132 -3.47222222222222e+00 +204 39 -4.86111111111111e+00 +204 110 2.08333333333333e+00 +204 215 2.89698820488127e-16 +204 131 1.16443313324943e-16 +204 38 4.16666666666667e+00 +204 109 2.08333333333333e+00 +204 214 4.68375338513738e-17 +204 130 -4.44089209850063e-16 +204 37 -8.32667268468867e-17 +204 108 -3.47222222222222e+00 +204 213 -1.38888888888889e+00 +204 129 5.55555555555556e+00 +204 36 -4.86111111111112e+00 +204 209 -3.59087759527199e-16 +204 140 -2.64099451943028e-15 +204 125 2.08333333333333e+00 +204 11 4.16666666666666e+00 +204 208 -8.33333333333333e+00 +204 139 1.76455258824731e-15 +204 124 -2.08333333333333e+00 +204 10 2.74953670942324e-16 +204 207 -9.72222222222222e+00 +204 138 -1.11111111111111e+01 +204 123 -3.47222222222222e+00 +204 9 -4.86111111111111e+00 +204 194 -4.83987849797529e-16 +204 239 2.66453525910038e-15 +204 206 2.66453525910038e-15 +204 116 3.07804996768635e-16 +204 101 -2.08333333333333e+00 +204 203 3.75676052766227e-16 +204 122 5.31408142316614e-16 +204 8 -4.16666666666667e+00 +204 193 8.33333333333333e+00 +204 238 -8.82540568403201e-17 +204 205 -2.66453525910038e-15 +204 115 -3.03576608295941e-17 +204 100 2.08333333333333e+00 +204 202 3.38271077815477e-17 +204 121 -4.44089209850063e-16 +204 7 -6.93889390390723e-17 +204 192 -9.72222222222222e+00 +204 237 1.11111111111111e+01 +204 134 -2.08333333333333e+00 +204 114 -1.11111111111111e+01 +204 99 -3.47222222222222e+00 +204 201 -1.38888888888889e+00 +204 120 5.55555555555556e+00 +204 6 -4.86111111111112e+00 +205 205 5.55555555555556e+01 +205 41 8.54351311918577e-16 +205 133 -3.47222222222222e+00 +205 40 -6.94444444444446e-01 +205 132 -2.08333333333333e+00 +205 39 2.08166817117217e-16 +205 110 -2.08333333333333e+00 +205 215 -8.33333333333334e+00 +205 131 6.37185616769731e-16 +205 38 -1.21430643318376e-16 +205 109 -3.47222222222222e+00 +205 214 -9.72222222222223e+00 +205 130 5.55555555555556e+00 +205 37 -6.94444444444446e-01 +205 108 2.08333333333333e+00 +205 213 5.74627151417317e-17 +205 129 -8.88178419700125e-16 +205 36 -1.42247325030098e-16 +205 209 -8.71264865809351e-16 +205 140 1.77635683940025e-15 +205 125 2.08333333333333e+00 +205 11 -2.68990558993654e-16 +205 208 -9.72222222222222e+00 +205 139 5.55555555555556e+00 +205 124 -3.47222222222222e+00 +205 10 -6.94444444444444e-01 +205 207 -8.33333333333333e+00 +205 138 1.65340831304039e-15 +205 123 -2.08333333333333e+00 +205 9 3.36536354339501e-16 +205 194 1.48926010412609e-15 +205 239 -2.22479641046741e-15 +205 206 0.00000000000000e+00 +205 116 -4.44089209850063e-16 +205 101 2.08333333333333e+00 +205 203 8.33333333333333e+00 +205 122 2.15214131238373e-16 +205 8 -3.07371315899641e-16 +205 193 -9.72222222222222e+00 +205 238 -2.22222222222222e+01 +205 134 -2.08333333333333e+00 +205 115 5.55555555555555e+00 +205 100 -3.47222222222222e+00 +205 202 -9.72222222222223e+00 +205 121 5.55555555555556e+00 +205 7 -6.94444444444445e-01 +205 192 8.33333333333333e+00 +205 237 9.71716197090133e-17 +205 204 -2.66453525910038e-15 +205 114 -3.97875092247868e-16 +205 99 2.08333333333333e+00 +205 201 3.04660810468427e-17 +205 120 -8.88178419700125e-16 +205 6 -1.00505541389406e-16 +206 206 5.55555555555556e+01 +206 41 -4.86111111111111e+00 +206 133 -2.08333333333333e+00 +206 40 6.82180006927879e-16 +206 132 -2.08333333333333e+00 +206 39 -4.16666666666667e+00 +206 110 -3.47222222222222e+00 +206 215 -9.72222222222222e+00 +206 131 -1.11111111111111e+01 +206 38 -4.86111111111111e+00 +206 109 -2.08333333333333e+00 +206 214 -8.33333333333334e+00 +206 130 2.16081492976361e-16 +206 37 -1.23599047663348e-16 +206 108 2.08333333333333e+00 +206 213 4.29560900738757e-16 +206 129 5.86919293547872e-16 +206 36 4.16666666666667e+00 +206 209 -1.38888888888889e+00 +206 140 5.55555555555557e+00 +206 125 -3.47222222222222e+00 +206 11 -4.86111111111111e+00 +206 208 -9.15066633577766e-16 +206 139 1.33226762955019e-15 +206 124 2.08333333333333e+00 +206 10 -4.11129463806503e-16 +206 207 -3.26128013483640e-16 +206 138 -2.81003519064793e-15 +206 123 2.08333333333333e+00 +206 9 4.16666666666667e+00 +206 194 -1.38888888888889e+00 +206 239 1.11111111111111e+01 +206 134 -3.47222222222222e+00 +206 116 5.55555555555555e+00 +206 101 -3.47222222222222e+00 +206 203 -9.72222222222222e+00 +206 122 -1.11111111111111e+01 +206 8 -4.86111111111111e+00 +206 193 1.53002610581154e-15 +206 238 -2.35954918798020e-15 +206 205 -1.77635683940025e-15 +206 115 -4.44089209850063e-16 +206 100 2.08333333333333e+00 +206 202 8.33333333333333e+00 +206 121 4.70652163075957e-16 +206 7 -3.15719672627779e-16 +206 192 -4.98407738691586e-16 +206 237 2.66453525910038e-15 +206 204 2.66453525910038e-15 +206 114 4.09015269570157e-16 +206 99 -2.08333333333333e+00 +206 201 2.07299455379228e-16 +206 120 8.35919874986324e-17 +206 6 -4.16666666666667e+00 +207 207 1.11111111111111e+02 +207 160 -2.08333333333333e+00 +207 159 -3.47222222222222e+00 +207 230 -8.33333333333333e+00 +207 155 -2.08333333333333e+00 +207 229 -1.84639629974281e-16 +207 154 2.08333333333333e+00 +207 228 -9.72222222222222e+00 +207 153 -3.47222222222222e+00 +207 227 5.09032919981944e-16 +207 152 2.08333333333333e+00 +207 226 -8.33333333333333e+00 +207 151 -2.08333333333333e+00 +207 225 -9.72222222222222e+00 +207 150 -3.47222222222222e+00 +207 242 -2.47957036847435e-16 +207 221 2.81025203108243e-16 +207 218 8.33333333333333e+00 +207 146 2.08333333333333e+00 +207 241 -1.82967248123223e-15 +207 220 8.33333333333333e+00 +207 217 -2.01119502996061e-16 +207 145 2.08333333333333e+00 +207 240 -2.22222222222222e+01 +207 219 -9.72222222222222e+00 +207 216 -9.72222222222222e+00 +207 144 -3.47222222222222e+00 +207 137 2.08333333333333e+00 +207 56 -7.80625564189563e-18 +207 136 2.08333333333333e+00 +207 55 2.60208521396521e-18 +207 135 -3.47222222222222e+00 +207 54 -1.38888888888889e+00 +207 215 8.33333333333333e+00 +207 134 1.82471225629310e-16 +207 41 6.15826833971767e-17 +207 131 2.08333333333333e+00 +207 214 4.96130914129367e-16 +207 133 0.00000000000000e+00 +207 40 -4.66206934168767e-18 +207 130 -2.08333333333333e+00 +207 213 -9.72222222222222e+00 +207 132 1.11111111111111e+01 +207 39 -1.38888888888889e+00 +207 129 -3.47222222222222e+00 +207 212 -5.13478148889135e-16 +207 143 8.88178419700125e-16 +207 128 -2.08333333333333e+00 +207 26 -8.47846098883664e-17 +207 211 8.33333333333333e+00 +207 142 2.06323673423991e-16 +207 127 2.08333333333333e+00 +207 25 -2.42861286636753e-17 +207 210 -9.72222222222222e+00 +207 141 1.11111111111111e+01 +207 126 -3.47222222222222e+00 +207 24 -1.38888888888889e+00 +207 239 -1.56537109663457e-15 +207 209 5.32907051820075e-15 +207 140 4.44089209850063e-16 +207 206 -2.82759926584220e-16 +207 203 -8.33333333333333e+00 +207 125 2.91677489452913e-16 +207 11 7.23162849047831e-17 +207 122 -2.08333333333333e+00 +207 238 3.27017059265078e-15 +207 208 -1.77635683940025e-15 +207 139 -9.99905453574756e-17 +207 205 -8.33333333333333e+00 +207 202 5.32560107124880e-16 +207 124 0.00000000000000e+00 +207 10 6.84131570838353e-17 +207 121 -2.08333333333333e+00 +207 237 -2.22222222222222e+01 +207 161 -2.08333333333333e+00 +207 138 1.11111111111111e+01 +207 204 -9.72222222222222e+00 +207 201 -9.72222222222222e+00 +207 123 1.11111111111111e+01 +207 9 -1.38888888888889e+00 +207 120 -3.47222222222222e+00 +208 208 1.11111111111111e+02 +208 160 -3.47222222222222e+00 +208 159 -2.08333333333333e+00 +208 230 -1.76941794549634e-16 +208 155 2.08333333333333e+00 +208 229 -1.38888888888889e+00 +208 154 -3.47222222222222e+00 +208 228 -1.18828558104411e-16 +208 153 2.08333333333333e+00 +208 227 -7.56447855743136e-16 +208 152 2.08333333333333e+00 +208 226 -9.72222222222222e+00 +208 151 -3.47222222222222e+00 +208 225 -8.33333333333333e+00 +208 150 -2.08333333333333e+00 +208 242 2.66453525910038e-15 +208 221 -1.03649727689614e-15 +208 218 8.08597980239689e-16 +208 146 -2.08333333333333e+00 +208 241 1.11111111111111e+01 +208 220 -9.72222222222222e+00 +208 217 -1.38888888888889e+00 +208 145 -3.47222222222222e+00 +208 240 -1.85918988537814e-15 +208 219 8.33333333333333e+00 +208 216 -1.04950770296597e-16 +208 144 2.08333333333333e+00 +208 137 -2.08333333333333e+00 +208 56 -8.33333333333334e+00 +208 136 -3.47222222222222e+00 +208 55 -9.72222222222223e+00 +208 135 2.08333333333333e+00 +208 54 4.15249432061948e-17 +208 215 -1.00787433954252e-15 +208 134 -1.41976274486977e-15 +208 41 8.33333333333334e+00 +208 131 2.08333333333333e+00 +208 214 -1.38888888888889e+00 +208 133 1.11111111111111e+01 +208 40 -9.72222222222223e+00 +208 130 -3.47222222222222e+00 +208 213 5.47305256670683e-16 +208 132 0.00000000000000e+00 +208 39 -2.51534904016637e-17 +208 129 -2.08333333333333e+00 +208 212 3.09431300027363e-16 +208 143 1.03679543249358e-15 +208 128 2.08333333333333e+00 +208 26 8.33333333333334e+00 +208 211 -9.72222222222222e+00 +208 142 -2.22222222222222e+01 +208 127 -3.47222222222222e+00 +208 25 -9.72222222222223e+00 +208 210 8.33333333333333e+00 +208 141 -1.03446439782273e-16 +208 126 2.08333333333333e+00 +208 24 -6.28837260041593e-18 +208 239 3.10862446895044e-15 +208 209 -7.10542735760100e-15 +208 140 9.59302082215174e-16 +208 206 -9.11597186625812e-16 +208 203 1.15825318086626e-15 +208 125 -1.49495216553164e-15 +208 11 -8.33333333333334e+00 +208 122 -2.08333333333333e+00 +208 238 1.11111111111111e+01 +208 161 -2.08333333333333e+00 +208 139 -2.22222222222222e+01 +208 205 -9.72222222222222e+00 +208 202 -1.38888888888889e+00 +208 124 1.11111111111111e+01 +208 10 -9.72222222222223e+00 +208 121 -3.47222222222222e+00 +208 237 3.45157116863476e-15 +208 207 -2.66453525910038e-15 +208 138 3.64183509737881e-16 +208 204 -8.33333333333333e+00 +208 201 5.81023944234982e-16 +208 123 -4.44089209850063e-16 +208 9 -1.12757025938492e-17 +208 120 -2.08333333333333e+00 +209 209 1.11111111111111e+02 +209 160 -2.08333333333333e+00 +209 159 -2.08333333333333e+00 +209 230 -9.72222222222222e+00 +209 155 -3.47222222222222e+00 +209 229 -3.53124647578529e-16 +209 154 2.08333333333333e+00 +209 228 -8.33333333333333e+00 +209 153 -2.08333333333333e+00 +209 227 -1.38888888888889e+00 +209 152 -3.47222222222222e+00 +209 226 -7.12103986888479e-16 +209 151 2.08333333333333e+00 +209 225 4.75314232417645e-16 +209 150 2.08333333333333e+00 +209 242 1.11111111111111e+01 +209 221 -1.38888888888889e+00 +209 218 -9.72222222222222e+00 +209 146 -3.47222222222222e+00 +209 241 3.55271367880050e-15 +209 220 -1.04647193688301e-15 +209 217 1.05644659686988e-15 +209 145 -2.08333333333333e+00 +209 240 -3.59304599961696e-16 +209 219 4.27609336828283e-16 +209 216 8.33333333333333e+00 +209 144 2.08333333333333e+00 +209 137 -3.47222222222222e+00 +209 56 -9.72222222222222e+00 +209 136 -2.08333333333333e+00 +209 55 -8.33333333333334e+00 +209 135 2.08333333333333e+00 +209 54 -3.77302356024956e-17 +209 215 -9.72222222222222e+00 +209 134 -2.22222222222222e+01 +209 41 -9.72222222222222e+00 +209 131 -3.47222222222222e+00 +209 214 -9.01297265987200e-16 +209 133 -1.26586024648545e-15 +209 40 8.33333333333334e+00 +209 130 2.08333333333333e+00 +209 213 8.33333333333333e+00 +209 132 6.96328845278815e-17 +209 39 8.01225405466788e-17 +209 129 2.08333333333333e+00 +209 212 -1.38888888888889e+00 +209 143 1.11111111111111e+01 +209 128 -3.47222222222222e+00 +209 26 -9.72222222222222e+00 +209 211 3.93782229046735e-16 +209 142 1.29236898960272e-15 +209 127 2.08333333333333e+00 +209 25 8.33333333333334e+00 +209 210 -4.82253126321552e-16 +209 141 4.44089209850063e-16 +209 126 -2.08333333333333e+00 +209 24 -4.94396190653390e-17 +209 239 1.11111111111111e+01 +209 161 -3.47222222222222e+00 +209 140 1.11111111111111e+01 +209 206 -1.38888888888889e+00 +209 203 -9.72222222222222e+00 +209 125 -2.22222222222222e+01 +209 11 -9.72222222222222e+00 +209 122 -3.47222222222222e+00 +209 238 3.55271367880050e-15 +209 208 -7.10542735760100e-15 +209 139 7.66070150023945e-16 +209 205 -9.30353884209811e-16 +209 202 1.36349265211777e-15 +209 124 -1.35731269973460e-15 +209 10 -8.33333333333334e+00 +209 121 -2.08333333333333e+00 +209 237 -1.71291745978269e-15 +209 207 5.32907051820075e-15 +209 138 4.44089209850063e-16 +209 204 -3.54859371054506e-16 +209 201 -8.33333333333333e+00 +209 123 2.44921270764475e-16 +209 9 -7.80625564189563e-18 +209 120 -2.08333333333333e+00 +210 210 5.55555555555556e+01 +210 110 2.08333333333333e+00 +210 52 -1.94289029309402e-16 +210 109 -2.08333333333333e+00 +210 51 -4.86111111111111e+00 +210 108 -3.47222222222222e+00 +210 137 6.86950496486816e-16 +210 56 -4.16666666666667e+00 +210 134 -2.08333333333333e+00 +210 215 1.24032728532342e-16 +210 136 8.88178419700125e-16 +210 55 3.08780778723872e-16 +210 133 2.08333333333333e+00 +210 214 -5.19332840620557e-17 +210 135 5.55555555555556e+00 +210 54 -4.86111111111111e+00 +210 132 -3.47222222222222e+00 +210 213 -1.38888888888889e+00 +210 119 -2.74086309204336e-15 +210 194 -1.72604985859692e-16 +210 23 -4.16666666666667e+00 +210 101 -2.08333333333333e+00 +210 118 -2.80157841370254e-16 +210 193 -8.33333333333333e+00 +210 22 -1.52655665885959e-16 +210 100 -2.08333333333333e+00 +210 117 -1.11111111111111e+01 +210 192 -9.72222222222222e+00 +210 21 -4.86111111111112e+00 +210 99 -3.47222222222222e+00 +210 212 8.88178419700125e-16 +210 143 9.87925019568792e-16 +210 209 -4.83987849797529e-16 +210 239 2.22044604925031e-15 +210 128 7.95370713735366e-16 +210 26 4.16666666666667e+00 +210 125 2.08333333333333e+00 +210 203 4.29560900738757e-16 +210 211 -2.66453525910038e-15 +210 142 1.63053164720095e-15 +210 208 8.33333333333333e+00 +210 238 -4.56205169127588e-16 +210 127 8.88178419700125e-16 +210 25 2.80157841370254e-16 +210 124 2.08333333333333e+00 +210 202 -2.58040117051550e-17 +210 53 4.16666666666667e+00 +210 141 -1.11111111111111e+01 +210 207 -9.72222222222222e+00 +210 237 1.11111111111111e+01 +210 126 5.55555555555556e+00 +210 24 -4.86111111111111e+00 +210 123 -3.47222222222222e+00 +210 201 -1.38888888888889e+00 +211 211 5.55555555555556e+01 +211 110 2.08333333333333e+00 +211 52 -6.94444444444444e-01 +211 109 -3.47222222222222e+00 +211 51 -1.68268177169750e-16 +211 108 -2.08333333333333e+00 +211 137 7.01695646032618e-16 +211 56 4.92661467177413e-16 +211 134 2.08333333333333e+00 +211 215 8.33333333333333e+00 +211 136 5.55555555555556e+00 +211 55 -6.94444444444444e-01 +211 133 -3.47222222222222e+00 +211 214 -9.72222222222223e+00 +211 135 8.88178419700125e-16 +211 54 3.12250225675825e-16 +211 132 2.08333333333333e+00 +211 213 -7.71951946809679e-17 +211 119 1.77635683940025e-15 +211 194 -1.54390389361936e-16 +211 23 8.50014503228635e-17 +211 101 -2.08333333333333e+00 +211 118 5.55555555555555e+00 +211 193 -9.72222222222222e+00 +211 22 -6.94444444444446e-01 +211 100 -3.47222222222222e+00 +211 117 -1.08094956596805e-16 +211 192 -8.33333333333333e+00 +211 21 -1.39645239816133e-16 +211 99 -2.08333333333333e+00 +211 212 3.55271367880050e-15 +211 143 1.77635683940025e-15 +211 209 3.66026653431106e-16 +211 239 -2.07505453792001e-15 +211 128 3.09539720244612e-16 +211 26 -6.33174068731535e-16 +211 125 -2.08333333333333e+00 +211 203 -8.33333333333334e+00 +211 53 2.91433543964104e-16 +211 142 5.55555555555556e+00 +211 208 -9.72222222222222e+00 +211 238 -2.22222222222222e+01 +211 127 5.55555555555556e+00 +211 25 -6.94444444444445e-01 +211 124 -3.47222222222222e+00 +211 202 -9.72222222222223e+00 +211 210 -2.66453525910038e-15 +211 141 1.67487551605561e-15 +211 207 8.33333333333333e+00 +211 237 -5.30500122997157e-16 +211 126 8.88178419700125e-16 +211 24 2.98372437868011e-16 +211 123 2.08333333333333e+00 +211 201 4.07660016854550e-17 +212 212 5.55555555555556e+01 +212 110 -3.47222222222222e+00 +212 52 1.82145964977565e-16 +212 109 2.08333333333333e+00 +212 51 4.16666666666667e+00 +212 108 2.08333333333333e+00 +212 137 -1.11111111111111e+01 +212 56 -4.86111111111111e+00 +212 134 -3.47222222222222e+00 +212 215 -9.72222222222222e+00 +212 136 4.20562022707127e-16 +212 55 4.83987849797529e-16 +212 133 2.08333333333333e+00 +212 214 8.33333333333333e+00 +212 135 9.06393016197882e-16 +212 54 -4.16666666666667e+00 +212 132 -2.08333333333333e+00 +212 213 3.20164901534969e-16 +212 119 5.55555555555555e+00 +212 194 -1.38888888888889e+00 +212 23 -4.86111111111111e+00 +212 101 -3.47222222222222e+00 +212 118 2.22044604925031e-15 +212 193 -8.18572640226556e-17 +212 22 0.00000000000000e+00 +212 100 -2.08333333333333e+00 +212 117 -2.76948602939697e-15 +212 192 -2.69315819645399e-16 +212 21 -4.16666666666667e+00 +212 99 -2.08333333333333e+00 +212 53 -4.86111111111111e+00 +212 143 5.55555555555556e+00 +212 209 -1.38888888888889e+00 +212 239 1.11111111111111e+01 +212 128 -1.11111111111111e+01 +212 26 -4.86111111111111e+00 +212 125 -3.47222222222222e+00 +212 203 -9.72222222222222e+00 +212 211 2.66453525910038e-15 +212 142 1.77635683940025e-15 +212 208 3.12900746979317e-16 +212 238 -1.53784591398060e-15 +212 127 7.57206797263876e-16 +212 25 -5.96744875736022e-16 +212 124 -2.08333333333333e+00 +212 202 -8.33333333333334e+00 +212 210 8.88178419700125e-16 +212 141 1.06165076729781e-15 +212 207 -5.23886489744996e-16 +212 237 2.22044604925031e-15 +212 126 6.86950496486816e-16 +212 24 4.16666666666667e+00 +212 123 2.08333333333333e+00 +212 201 2.14238349283136e-16 +213 213 5.55555555555556e+01 +213 119 -2.08333333333333e+00 +213 52 4.16666666666667e+00 +213 118 2.08333333333333e+00 +213 51 -4.86111111111111e+00 +213 117 -3.47222222222222e+00 +213 137 1.33226762955019e-15 +213 56 -5.29090660172926e-17 +213 212 2.65521112041700e-16 +213 143 2.08333333333333e+00 +213 136 7.63278329429795e-17 +213 55 -4.16666666666667e+00 +213 211 3.38271077815477e-17 +213 142 -2.08333333333333e+00 +213 135 5.55555555555556e+00 +213 54 -4.86111111111111e+00 +213 210 -1.38888888888889e+00 +213 141 -3.47222222222222e+00 +213 134 -8.34510412162093e-16 +213 41 -1.77809156287623e-16 +213 209 8.33333333333333e+00 +213 140 2.08333333333333e+00 +213 133 1.70956998557514e-15 +213 40 4.16666666666667e+00 +213 208 5.41233724504764e-16 +213 139 2.08333333333333e+00 +213 132 -1.11111111111111e+01 +213 39 -4.86111111111111e+00 +213 207 -9.72222222222222e+00 +213 138 -3.47222222222222e+00 +213 110 -1.29236898960272e-15 +213 215 8.88178419700125e-16 +213 131 1.77635683940025e-15 +213 38 -2.70616862252382e-16 +213 194 -8.33333333333333e+00 +213 239 1.32677885605198e-15 +213 206 5.40583203201273e-16 +213 116 -2.08333333333333e+00 +213 109 -1.66533453693773e-16 +213 214 -1.77635683940025e-15 +213 130 -1.83013326715553e-16 +213 37 -4.16666666666667e+00 +213 193 -2.22044604925031e-16 +213 238 4.44089209850063e-16 +213 205 -1.19262238973405e-17 +213 115 -2.08333333333333e+00 +213 108 -1.11111111111111e+01 +213 53 -2.98372437868011e-16 +213 129 5.55555555555556e+00 +213 36 -4.86111111111111e+00 +213 192 -9.72222222222223e+00 +213 237 1.11111111111111e+01 +213 204 -1.38888888888889e+00 +213 114 -3.47222222222222e+00 +214 214 5.55555555555556e+01 +214 119 2.08333333333333e+00 +214 52 -4.86111111111111e+00 +214 118 -3.47222222222222e+00 +214 51 4.16666666666667e+00 +214 117 2.08333333333333e+00 +214 137 -4.67616396992998e-16 +214 56 -1.55257751099924e-16 +214 212 8.33333333333333e+00 +214 143 2.08333333333333e+00 +214 136 -1.11111111111111e+01 +214 55 -4.86111111111111e+00 +214 211 -9.72222222222223e+00 +214 142 -3.47222222222222e+00 +214 135 2.61075883134509e-16 +214 54 -4.16666666666667e+00 +214 210 4.51028103753970e-17 +214 141 -2.08333333333333e+00 +214 134 1.33226762955019e-15 +214 41 3.74700270810990e-16 +214 209 -9.01297265987200e-16 +214 140 -2.08333333333333e+00 +214 133 5.55555555555556e+00 +214 40 -4.86111111111111e+00 +214 208 -1.38888888888889e+00 +214 139 -3.47222222222222e+00 +214 132 1.61676227961038e-15 +214 39 4.16666666666667e+00 +214 207 6.14092110495790e-16 +214 138 2.08333333333333e+00 +214 110 0.00000000000000e+00 +214 215 3.55271367880050e-15 +214 131 -5.75060832286312e-16 +214 38 -9.71445146547012e-17 +214 194 -2.22478285794026e-16 +214 239 7.46906876625264e-16 +214 206 -8.33333333333334e+00 +214 116 -2.08333333333333e+00 +214 109 5.55555555555555e+00 +214 53 7.31185945124224e-16 +214 130 -1.11111111111111e+01 +214 37 -4.86111111111111e+00 +214 193 -1.38888888888889e+00 +214 238 1.11111111111111e+01 +214 205 -9.72222222222223e+00 +214 115 -3.47222222222222e+00 +214 108 -2.53269627492614e-16 +214 213 -1.77635683940025e-15 +214 129 -1.45716771982052e-16 +214 36 -4.16666666666667e+00 +214 192 -2.32344525563644e-16 +214 237 0.00000000000000e+00 +214 204 5.46437894932694e-17 +214 114 -2.08333333333333e+00 +215 215 5.55555555555556e+01 +215 119 -3.47222222222222e+00 +215 52 7.84095011141517e-16 +215 118 2.08333333333333e+00 +215 51 -3.02709246557953e-16 +215 117 -2.08333333333333e+00 +215 137 5.55555555555555e+00 +215 56 -6.94444444444444e-01 +215 212 -9.72222222222222e+00 +215 143 -3.47222222222222e+00 +215 136 -6.30571983517569e-16 +215 55 -2.28983498828939e-16 +215 211 8.33333333333333e+00 +215 142 2.08333333333333e+00 +215 135 1.33226762955019e-15 +215 54 -4.85722573273506e-17 +215 210 9.62771529167128e-17 +215 141 2.08333333333333e+00 +215 134 5.55555555555556e+00 +215 41 -6.94444444444445e-01 +215 209 -9.72222222222222e+00 +215 140 -3.47222222222222e+00 +215 133 1.33226762955019e-15 +215 40 3.10515502199848e-16 +215 208 -1.00787433954252e-15 +215 139 -2.08333333333333e+00 +215 132 -7.15573433840433e-16 +215 39 -1.17961196366423e-16 +215 207 8.33333333333333e+00 +215 138 2.08333333333333e+00 +215 110 5.55555555555555e+00 +215 53 -6.94444444444444e-01 +215 131 5.55555555555555e+00 +215 38 -6.94444444444444e-01 +215 194 -9.72222222222222e+00 +215 239 -2.22222222222222e+01 +215 206 -9.72222222222222e+00 +215 116 -3.47222222222222e+00 +215 109 8.88178419700125e-16 +215 214 3.55271367880050e-15 +215 130 -8.00683304380545e-16 +215 37 -9.54097911787244e-17 +215 193 -3.15719672627779e-16 +215 238 1.11683665787732e-15 +215 205 -8.33333333333334e+00 +215 115 -2.08333333333333e+00 +215 108 -1.15977106390774e-15 +215 213 8.88178419700125e-16 +215 129 1.77635683940025e-15 +215 36 -1.97758476261356e-16 +215 192 -8.33333333333333e+00 +215 237 7.70542483985448e-16 +215 204 2.14238349283136e-16 +215 114 -2.08333333333333e+00 +216 216 5.55555555555556e+01 +216 26 -1.99493199737333e-17 +216 142 2.08333333333333e+00 +216 25 4.16666666666667e+00 +216 141 -3.47222222222222e+00 +216 24 -4.86111111111111e+00 +216 227 -1.38777878078145e-16 +216 167 -2.08333333333333e+00 +216 152 -4.44089209850063e-16 +216 29 2.58365377703296e-16 +216 226 2.16840434497101e-17 +216 166 -2.08333333333333e+00 +216 151 7.62953068778049e-16 +216 28 -4.16666666666667e+00 +216 225 -1.38888888888889e+00 +216 165 -3.47222222222222e+00 +216 150 5.55555555555556e+00 +216 27 -4.86111111111111e+00 +216 224 -8.33333333333333e+00 +216 164 -2.08333333333333e+00 +216 149 6.64832772168111e-16 +216 14 1.64581889783300e-16 +216 223 1.03866568124111e-16 +216 163 2.08333333333333e+00 +216 148 -1.69799612738386e-16 +216 13 4.16666666666666e+00 +216 222 -9.72222222222223e+00 +216 162 -3.47222222222222e+00 +216 147 -1.11111111111111e+01 +216 12 -4.86111111111111e+00 +216 209 8.33333333333333e+00 +216 242 -3.12683906544819e-16 +216 221 -1.92554305833426e-16 +216 140 2.08333333333333e+00 +216 125 -2.15322551455621e-16 +216 218 0.00000000000000e+00 +216 146 -4.44089209850063e-16 +216 11 2.14238349283136e-16 +216 208 -1.39645239816133e-16 +216 241 8.88178419700125e-16 +216 220 7.13405029495462e-17 +216 139 -2.08333333333333e+00 +216 124 -9.02381468159685e-16 +216 217 0.00000000000000e+00 +216 145 5.93966607669028e-16 +216 10 -4.16666666666667e+00 +216 207 -9.72222222222222e+00 +216 240 1.11111111111111e+01 +216 219 -1.38888888888889e+00 +216 138 -3.47222222222222e+00 +216 123 -1.11111111111111e+01 +216 143 2.08333333333333e+00 +216 144 5.55555555555556e+00 +216 9 -4.86111111111111e+00 +217 217 5.55555555555556e+01 +217 26 -5.54460991009087e-16 +217 142 -3.47222222222222e+00 +217 25 -4.86111111111111e+00 +217 141 2.08333333333333e+00 +217 24 4.16666666666666e+00 +217 227 -8.33333333333333e+00 +217 167 -2.08333333333333e+00 +217 152 8.31284910698948e-16 +217 29 3.43041567374414e-16 +217 226 -9.72222222222223e+00 +217 166 -3.47222222222222e+00 +217 151 -1.11111111111111e+01 +217 28 -4.86111111111111e+00 +217 225 6.97141996908179e-17 +217 165 -2.08333333333333e+00 +217 150 4.79366438037310e-16 +217 27 -4.16666666666667e+00 +217 224 -1.16226472890446e-16 +217 164 2.08333333333333e+00 +217 149 1.77635683940025e-15 +217 14 -2.60208521396521e-17 +217 223 -1.38888888888889e+00 +217 163 -3.47222222222222e+00 +217 148 5.55555555555555e+00 +217 13 -4.86111111111111e+00 +217 222 6.85215773010839e-17 +217 162 2.08333333333333e+00 +217 147 -2.04805790382512e-16 +217 12 4.16666666666667e+00 +217 209 9.45424294407360e-16 +217 242 -1.24401357270987e-15 +217 221 8.33333333333333e+00 +217 140 2.08333333333333e+00 +217 125 2.22044604925031e-15 +217 218 -3.55271367880050e-15 +217 146 6.99852502339393e-16 +217 11 -5.52509427098613e-16 +217 208 -1.38888888888889e+00 +217 241 1.11111111111111e+01 +217 220 -9.72222222222223e+00 +217 139 -3.47222222222222e+00 +217 124 5.55555555555556e+00 +217 143 -2.08333333333333e+00 +217 145 -1.11111111111111e+01 +217 10 -4.86111111111111e+00 +217 207 -2.07191035161980e-16 +217 240 8.88178419700125e-16 +217 219 2.25514051876985e-17 +217 138 -2.08333333333333e+00 +217 123 -9.27711141414378e-16 +217 216 0.00000000000000e+00 +217 144 6.56267575005476e-16 +217 9 -4.16666666666667e+00 +218 218 5.55555555555556e+01 +218 26 -6.94444444444443e-01 +218 142 -2.08333333333333e+00 +218 25 -5.64652491430451e-16 +218 141 2.08333333333333e+00 +218 24 4.15249432061948e-17 +218 227 -9.72222222222222e+00 +218 167 -3.47222222222222e+00 +218 152 5.55555555555556e+00 +218 29 -6.94444444444444e-01 +218 226 -8.33333333333333e+00 +218 166 -2.08333333333333e+00 +218 151 8.10874804801909e-16 +218 28 3.85108611666851e-16 +218 225 -1.23707467880596e-16 +218 165 -2.08333333333333e+00 +218 150 -4.44089209850063e-16 +218 27 3.63424568217141e-16 +218 224 -9.72222222222222e+00 +218 164 -3.47222222222222e+00 +218 149 5.55555555555555e+00 +218 14 -6.94444444444444e-01 +218 223 -1.89626959967715e-16 +218 163 2.08333333333333e+00 +218 148 1.77635683940025e-15 +218 13 -8.82540568403201e-17 +218 222 -8.33333333333333e+00 +218 162 -2.08333333333333e+00 +218 147 7.04189311029335e-16 +218 12 1.35308431126191e-16 +218 209 -9.72222222222222e+00 +218 242 -2.22222222222222e+01 +218 221 -9.72222222222222e+00 +218 140 -3.47222222222222e+00 +218 125 5.55555555555556e+00 +218 143 -3.47222222222222e+00 +218 146 5.55555555555556e+00 +218 11 -6.94444444444444e-01 +218 208 8.09465341977678e-16 +218 241 -1.51992947308027e-15 +218 220 8.33333333333333e+00 +218 139 2.08333333333333e+00 +218 124 1.77635683940025e-15 +218 217 -3.55271367880050e-15 +218 145 7.27201502140340e-16 +218 10 -5.33427468862868e-16 +218 207 8.33333333333333e+00 +218 240 -7.55417863679275e-17 +218 219 -1.22081164621868e-16 +218 138 2.08333333333333e+00 +218 123 -7.50132378088408e-17 +218 216 0.00000000000000e+00 +218 144 -4.44089209850063e-16 +218 9 1.64690310000548e-16 +219 219 5.55555555555556e+01 +219 44 -4.16666666666667e+00 +219 157 -2.08333333333333e+00 +219 43 3.36102673470506e-17 +219 156 -3.47222222222222e+00 +219 42 -4.86111111111112e+00 +219 134 2.08333333333333e+00 +219 230 -2.68882138776405e-17 +219 155 3.67436116255337e-16 +219 41 4.16666666666667e+00 +219 133 2.08333333333333e+00 +219 229 2.16840434497101e-17 +219 154 0.00000000000000e+00 +219 40 -4.94396190653390e-17 +219 132 -3.47222222222222e+00 +219 228 -1.38888888888889e+00 +219 153 5.55555555555556e+00 +219 39 -4.86111111111111e+00 +219 224 3.43258407808911e-16 +219 164 1.53543356414682e-15 +219 149 2.08333333333333e+00 +219 14 4.16666666666667e+00 +219 223 -8.33333333333333e+00 +219 163 -2.91013415622265e-16 +219 148 -2.08333333333333e+00 +219 13 2.58040117051550e-17 +219 222 -9.72222222222222e+00 +219 162 -1.11111111111111e+01 +219 147 -3.47222222222222e+00 +219 12 -4.86111111111112e+00 +219 209 2.64545330086463e-16 +219 242 -4.44089209850063e-16 +219 221 0.00000000000000e+00 +219 140 -1.59616243833316e-15 +219 125 -2.08333333333333e+00 +219 218 -6.57026516526216e-17 +219 146 4.88256895851691e-16 +219 11 -4.16666666666667e+00 +219 208 8.33333333333333e+00 +219 241 1.24867564205156e-15 +219 220 8.88178419700125e-16 +219 139 -8.77227977758022e-16 +219 124 2.08333333333333e+00 +219 217 2.25514051876985e-17 +219 145 0.00000000000000e+00 +219 10 -1.56125112837913e-17 +219 207 -9.72222222222222e+00 +219 240 1.11111111111111e+01 +219 158 -2.08333333333333e+00 +219 138 -1.11111111111111e+01 +219 123 -3.47222222222222e+00 +219 216 -1.38888888888889e+00 +219 144 5.55555555555556e+00 +219 9 -4.86111111111111e+00 +220 220 5.55555555555556e+01 +220 44 -4.51028103753970e-17 +220 157 -3.47222222222222e+00 +220 43 -6.94444444444445e-01 +220 156 -2.08333333333333e+00 +220 42 6.07153216591882e-18 +220 134 -2.08333333333333e+00 +220 230 -8.33333333333333e+00 +220 155 -2.29959280784175e-16 +220 41 2.51534904016637e-16 +220 133 -3.47222222222222e+00 +220 229 -9.72222222222223e+00 +220 154 5.55555555555556e+00 +220 40 -6.94444444444443e-01 +220 132 2.08333333333333e+00 +220 228 6.97141996908179e-17 +220 153 0.00000000000000e+00 +220 39 -1.00505541389406e-16 +220 224 3.94974851436469e-16 +220 164 8.88178419700125e-16 +220 149 2.08333333333333e+00 +220 14 3.31765864780564e-17 +220 223 -9.72222222222222e+00 +220 163 5.55555555555555e+00 +220 148 -3.47222222222222e+00 +220 13 -6.94444444444446e-01 +220 222 -8.33333333333333e+00 +220 162 -2.61184303351758e-16 +220 147 -2.08333333333333e+00 +220 12 -6.93889390390723e-18 +220 209 -1.04202670797582e-15 +220 242 1.36762617290037e-15 +220 221 -3.55271367880050e-15 +220 140 4.44089209850063e-16 +220 125 2.08333333333333e+00 +220 218 8.33333333333333e+00 +220 146 -4.67155611069692e-16 +220 11 -3.72857127117765e-16 +220 208 -9.72222222222222e+00 +220 241 -2.22222222222222e+01 +220 158 -2.08333333333333e+00 +220 139 5.55555555555556e+00 +220 124 -3.47222222222222e+00 +220 217 -9.72222222222223e+00 +220 145 5.55555555555556e+00 +220 10 -6.94444444444445e-01 +220 207 8.33333333333333e+00 +220 240 9.02733833865743e-16 +220 219 0.00000000000000e+00 +220 138 -8.57563260854566e-16 +220 123 2.08333333333333e+00 +220 216 1.95373231481888e-16 +220 144 0.00000000000000e+00 +220 9 -8.05562214156730e-17 +221 221 5.55555555555556e+01 +221 44 -4.86111111111111e+00 +221 157 -2.08333333333333e+00 +221 43 -6.63531729561129e-17 +221 156 -2.08333333333333e+00 +221 42 -4.16666666666667e+00 +221 134 -3.47222222222222e+00 +221 230 -9.72222222222222e+00 +221 155 -1.11111111111111e+01 +221 41 -4.86111111111111e+00 +221 133 -2.08333333333333e+00 +221 229 -8.33333333333333e+00 +221 154 -2.45111006144660e-16 +221 40 2.44921270764475e-16 +221 132 2.08333333333333e+00 +221 228 -1.18178036800920e-17 +221 153 5.99279198314207e-16 +221 39 4.16666666666667e+00 +221 224 -1.38888888888889e+00 +221 164 5.55555555555555e+00 +221 149 -3.47222222222222e+00 +221 14 -4.86111111111111e+00 +221 223 3.98119037736677e-16 +221 163 4.44089209850063e-16 +221 148 2.08333333333333e+00 +221 13 1.61329283265843e-16 +221 222 2.66280053562440e-16 +221 162 1.38853772230219e-15 +221 147 2.08333333333333e+00 +221 12 4.16666666666667e+00 +221 209 -1.38888888888889e+00 +221 242 1.11111111111111e+01 +221 158 -3.47222222222222e+00 +221 140 5.55555555555556e+00 +221 125 -3.47222222222222e+00 +221 218 -9.72222222222222e+00 +221 146 -1.11111111111111e+01 +221 11 -4.86111111111111e+00 +221 208 -1.02955838299224e-15 +221 241 1.34430227366478e-15 +221 220 -3.55271367880050e-15 +221 139 -4.44089209850063e-16 +221 124 2.08333333333333e+00 +221 217 8.33333333333333e+00 +221 145 -2.85470432015433e-16 +221 10 -2.32452945780892e-16 +221 207 3.12141805458577e-16 +221 240 -4.44089209850063e-16 +221 219 0.00000000000000e+00 +221 138 -1.58368056082242e-15 +221 123 -2.08333333333333e+00 +221 216 -3.29597460435593e-17 +221 144 5.93817529870311e-16 +221 9 -4.16666666666667e+00 +222 222 5.66666666666667e+01 +222 58 -2.15620707053055e-17 +222 57 -7.08333333333333e-01 +222 158 -5.11750201676736e-16 +222 44 -4.74202925190848e-17 +222 157 -6.93889390390723e-18 +222 43 -1.50568576703924e-17 +222 156 5.66666666666667e+00 +222 42 -7.08333333333333e-01 +222 167 1.33920652345410e-15 +222 29 -6.86706550998006e-17 +222 166 1.18665927778538e-16 +222 28 -2.15620707053055e-17 +222 165 5.66666666666667e+00 +222 27 -7.08333333333333e-01 +222 224 1.85962356624714e-15 +222 164 1.33226762955019e-15 +222 149 -4.85997011948416e-16 +222 14 -1.56497807334705e-17 +222 223 1.77635683940025e-15 +222 163 1.74125833516487e-16 +222 148 0.00000000000000e+00 +222 13 -1.58124110593433e-17 +222 59 -4.74202925190848e-17 +222 162 5.66666666666667e+00 +222 147 5.66666666666667e+00 +222 12 -7.08333333333333e-01 +222 160 2.08333333333333e+00 +222 159 -3.47222222222222e+00 +222 230 8.33333333333333e+00 +222 155 2.08333333333333e+00 +222 229 6.15826833971767e-17 +222 154 -2.08333333333333e+00 +222 228 -9.72222222222223e+00 +222 153 -3.47222222222222e+00 +222 227 2.38524477946811e-16 +222 152 -2.08333333333333e+00 +222 226 8.33333333333333e+00 +222 151 2.08333333333333e+00 +222 225 -9.72222222222222e+00 +222 150 -3.47222222222222e+00 +222 242 1.34007388519208e-15 +222 221 2.73218947466347e-16 +222 218 -8.33333333333333e+00 +222 146 -2.08333333333333e+00 +222 241 -5.44703171456717e-16 +222 220 -8.33333333333333e+00 +222 217 6.85215773010839e-17 +222 145 -2.08333333333333e+00 +222 240 -2.22222222222222e+01 +222 161 2.08333333333333e+00 +222 219 -9.72222222222222e+00 +222 216 -9.72222222222223e+00 +222 144 -3.47222222222222e+00 +222 308 -4.16666666666667e-02 +222 307 -4.16666666666667e-02 +222 306 -6.94444444444445e-02 +222 401 -1.66666666666667e-01 +222 302 -4.16666666666667e-02 +222 400 9.63923493975394e-19 +222 301 4.16666666666667e-02 +222 399 -1.94444444444445e-01 +222 300 -6.94444444444445e-02 +222 398 1.22480964172972e-18 +222 299 4.16666666666667e-02 +222 397 -1.66666666666667e-01 +222 298 -4.16666666666667e-02 +222 396 -1.94444444444444e-01 +222 297 -6.94444444444445e-02 +222 449 -2.37505920827738e-17 +222 392 -2.94936872233947e-18 +222 389 1.66666666666667e-01 +222 293 4.16666666666667e-02 +222 448 4.15702594688729e-18 +222 391 1.66666666666667e-01 +222 388 -1.01643953670516e-20 +222 292 4.16666666666667e-02 +222 447 -4.44444444444445e-01 +222 390 -1.94444444444444e-01 +222 387 -1.94444444444445e-01 +222 291 -6.94444444444445e-02 +223 223 5.66666666666667e+01 +223 58 -4.95833333333333e+00 +223 57 -1.59089728153303e-17 +223 158 -3.43158457921135e-16 +223 44 4.25000000000000e+00 +223 157 5.66666666666667e+00 +223 43 -4.95833333333333e+00 +223 156 -6.93889390390723e-18 +223 42 -2.15485181781494e-17 +223 167 -4.44546607641580e-16 +223 29 4.25000000000000e+00 +223 166 -1.13333333333333e+01 +223 28 -4.95833333333333e+00 +223 165 2.81678477268813e-16 +223 27 -1.50568576703924e-17 +223 224 -2.67841304690819e-15 +223 164 -6.57821033430740e-16 +223 149 -1.90329785555699e-16 +223 14 -4.25000000000000e+00 +223 59 -4.25000000000000e+00 +223 163 -1.13333333333333e+01 +223 148 5.66666666666667e+00 +223 13 -4.95833333333333e+00 +223 222 1.77635683940025e-15 +223 162 2.29796650458303e-16 +223 147 0.00000000000000e+00 +223 12 -2.32967941812823e-17 +223 160 -3.47222222222222e+00 +223 159 2.08333333333333e+00 +223 230 -6.76542155630955e-17 +223 155 2.08333333333333e+00 +223 229 -1.38888888888889e+00 +223 154 -3.47222222222222e+00 +223 228 8.99887803162969e-17 +223 153 -2.08333333333333e+00 +223 227 -4.94287770436141e-16 +223 152 2.08333333333333e+00 +223 226 -9.72222222222222e+00 +223 151 -3.47222222222222e+00 +223 225 8.33333333333333e+00 +223 150 2.08333333333333e+00 +223 242 2.66453525910038e-15 +223 221 3.70363462121048e-16 +223 218 -1.89626959967715e-16 +223 146 -2.08333333333333e+00 +223 241 1.11111111111111e+01 +223 161 -2.08333333333333e+00 +223 220 -9.72222222222222e+00 +223 217 -1.38888888888889e+00 +223 145 -3.47222222222222e+00 +223 240 -3.93253680487649e-16 +223 219 -8.33333333333333e+00 +223 216 1.10805462028019e-16 +223 144 -2.08333333333333e+00 +223 308 -4.16666666666667e-02 +223 307 -6.94444444444444e-02 +223 306 -4.16666666666667e-02 +223 401 -1.89464329641842e-17 +223 302 4.16666666666667e-02 +223 400 -2.77777777777778e-02 +223 301 -6.94444444444444e-02 +223 399 5.28548559086683e-19 +223 300 4.16666666666667e-02 +223 398 1.66865490609097e-17 +223 299 4.16666666666667e-02 +223 397 -1.94444444444444e-01 +223 298 -6.94444444444444e-02 +223 396 -1.66666666666667e-01 +223 297 -4.16666666666667e-02 +223 449 -6.24500451351651e-17 +223 392 2.92599061299526e-17 +223 389 -2.26191678234788e-17 +223 293 -4.16666666666666e-02 +223 448 2.22222222222222e-01 +223 391 -1.94444444444444e-01 +223 388 -2.77777777777778e-02 +223 292 -6.94444444444444e-02 +223 447 6.09863722023096e-19 +223 390 1.66666666666667e-01 +223 387 0.00000000000000e+00 +223 291 4.16666666666667e-02 +224 224 5.66666666666667e+01 +224 58 -4.25000000000000e+00 +224 57 -7.12574937207153e-17 +224 158 -1.13333333333333e+01 +224 44 -4.95833333333333e+00 +224 157 -2.38954770684016e-16 +224 43 4.25000000000000e+00 +224 156 -2.67408513206419e-16 +224 42 4.14842856247266e-17 +224 167 5.66666666666667e+00 +224 29 -4.95833333333333e+00 +224 166 -2.64079461965473e-16 +224 28 4.25000000000000e+00 +224 165 1.33920652345410e-15 +224 27 -4.74067399919287e-17 +224 59 -4.95833333333333e+00 +224 164 5.66666666666667e+00 +224 149 -1.13333333333333e+01 +224 14 -4.95833333333333e+00 +224 223 -3.56659146660832e-15 +224 163 -6.18833800934519e-16 +224 148 -3.98617093109663e-16 +224 13 -4.25000000000000e+00 +224 222 1.85962356624714e-15 +224 162 1.33226762955019e-15 +224 147 -4.01432630626336e-16 +224 12 -4.74202925190848e-17 +224 160 -2.08333333333333e+00 +224 159 2.08333333333333e+00 +224 230 -9.72222222222222e+00 +224 155 -3.47222222222222e+00 +224 229 -1.49945160454745e-16 +224 154 2.08333333333333e+00 +224 228 8.33333333333333e+00 +224 153 2.08333333333333e+00 +224 227 -1.38888888888889e+00 +224 152 -3.47222222222222e+00 +224 226 -4.70110061989715e-16 +224 151 2.08333333333333e+00 +224 225 1.80194401067091e-16 +224 150 -2.08333333333333e+00 +224 242 1.11111111111111e+01 +224 161 -3.47222222222222e+00 +224 221 -1.38888888888889e+00 +224 218 -9.72222222222222e+00 +224 146 -3.47222222222222e+00 +224 241 3.10862446895044e-15 +224 220 3.94974851436469e-16 +224 217 -1.64798730217797e-16 +224 145 -2.08333333333333e+00 +224 240 1.12019768461202e-15 +224 219 3.63207727782644e-16 +224 216 -8.33333333333333e+00 +224 144 -2.08333333333333e+00 +224 308 -6.94444444444444e-02 +224 307 -4.16666666666667e-02 +224 306 -4.16666666666667e-02 +224 401 -1.94444444444444e-01 +224 302 -6.94444444444444e-02 +224 400 -1.76691072797247e-17 +224 301 4.16666666666667e-02 +224 399 -1.66666666666667e-01 +224 300 -4.16666666666667e-02 +224 398 -2.77777777777778e-02 +224 299 -6.94444444444445e-02 +224 397 1.40268656065312e-17 +224 298 4.16666666666667e-02 +224 396 2.53432257818487e-18 +224 297 4.16666666666667e-02 +224 449 2.22222222222222e-01 +224 392 -2.77777777777778e-02 +224 389 -1.94444444444444e-01 +224 293 -6.94444444444445e-02 +224 448 -6.93889390390723e-17 +224 391 2.75963334215451e-17 +224 388 -2.37846851589008e-17 +224 292 -4.16666666666666e-02 +224 447 -1.79503222182131e-17 +224 390 -2.01932654625425e-18 +224 387 1.66666666666667e-01 +224 291 4.16666666666667e-02 +225 225 5.55555555555556e+01 +225 134 2.08333333333333e+00 +225 55 -9.02056207507940e-17 +225 133 -2.08333333333333e+00 +225 54 -4.86111111111111e+00 +225 132 -3.47222222222222e+00 +225 161 -4.57966997657877e-16 +225 59 -4.16666666666667e+00 +225 158 -2.08333333333333e+00 +225 230 -1.92554305833426e-16 +225 160 8.88178419700125e-16 +225 58 7.19910242530375e-17 +225 157 2.08333333333333e+00 +225 229 7.20994444702860e-17 +225 159 5.55555555555556e+00 +225 57 -4.86111111111111e+00 +225 156 -3.47222222222222e+00 +225 228 -1.38888888888889e+00 +225 143 1.22124532708767e-15 +225 209 4.84855211535518e-16 +225 26 -4.16666666666667e+00 +225 125 -2.08333333333333e+00 +225 142 -9.79251402188908e-16 +225 208 -8.33333333333333e+00 +225 25 -8.32667268468867e-17 +225 124 -2.08333333333333e+00 +225 141 -1.11111111111111e+01 +225 207 -9.72222222222222e+00 +225 24 -4.86111111111111e+00 +225 123 -3.47222222222222e+00 +225 227 -1.77635683940025e-15 +225 167 -1.17093834628434e-16 +225 224 2.28766658394441e-16 +225 242 -4.44089209850063e-16 +225 152 -6.74807432154978e-16 +225 29 4.16666666666667e+00 +225 149 2.08333333333333e+00 +225 218 -1.23707467880596e-16 +225 226 8.88178419700125e-16 +225 166 -2.75929452897561e-16 +225 223 8.33333333333333e+00 +225 241 9.06325253562101e-16 +225 151 8.88178419700125e-16 +225 28 6.41847686111419e-17 +225 148 2.08333333333333e+00 +225 217 5.58364118830035e-17 +225 56 4.16666666666667e+00 +225 165 -1.11111111111111e+01 +225 222 -9.72222222222222e+00 +225 240 1.11111111111111e+01 +225 150 5.55555555555556e+00 +225 27 -4.86111111111111e+00 +225 147 -3.47222222222222e+00 +225 216 -1.38888888888889e+00 +226 226 5.55555555555556e+01 +226 134 2.08333333333333e+00 +226 55 -6.94444444444445e-01 +226 133 -3.47222222222222e+00 +226 54 -1.20563281580388e-16 +226 132 -2.08333333333333e+00 +226 161 -1.17961196366423e-15 +226 59 -4.85722573273506e-17 +226 158 2.08333333333333e+00 +226 230 8.33333333333333e+00 +226 160 5.55555555555556e+00 +226 58 -6.94444444444445e-01 +226 157 -3.47222222222222e+00 +226 229 -9.72222222222223e+00 +226 159 8.88178419700125e-16 +226 57 6.24500451351651e-17 +226 156 2.08333333333333e+00 +226 228 5.03069808033274e-17 +226 143 3.10862446895044e-15 +226 209 -7.67615138119737e-16 +226 26 1.21430643318376e-17 +226 125 -2.08333333333333e+00 +226 142 5.55555555555556e+00 +226 208 -9.72222222222222e+00 +226 25 -6.94444444444443e-01 +226 124 -3.47222222222222e+00 +226 141 -9.64180991991359e-16 +226 207 -8.33333333333333e+00 +226 24 -1.06685493772574e-16 +226 123 -2.08333333333333e+00 +226 227 -1.77635683940025e-15 +226 167 2.22044604925031e-15 +226 224 -5.25621213220973e-16 +226 242 1.51777462126246e-15 +226 152 -1.27382913245322e-15 +226 29 -1.83013326715553e-16 +226 149 -2.08333333333333e+00 +226 218 -8.33333333333333e+00 +226 56 6.93889390390723e-16 +226 166 5.55555555555555e+00 +226 223 -9.72222222222222e+00 +226 241 -2.22222222222222e+01 +226 151 5.55555555555556e+00 +226 28 -6.94444444444445e-01 +226 148 -3.47222222222222e+00 +226 217 -9.72222222222223e+00 +226 225 8.88178419700125e-16 +226 165 -4.51895465491958e-16 +226 222 8.33333333333333e+00 +226 240 1.14199014827898e-15 +226 150 8.88178419700125e-16 +226 27 5.55111512312578e-17 +226 147 2.08333333333333e+00 +226 216 1.47451495458029e-17 +227 227 5.55555555555556e+01 +227 134 -3.47222222222222e+00 +227 55 5.68989300120393e-16 +227 133 2.08333333333333e+00 +227 54 4.16666666666667e+00 +227 132 2.08333333333333e+00 +227 161 -1.11111111111111e+01 +227 59 -4.86111111111111e+00 +227 158 -3.47222222222222e+00 +227 230 -9.72222222222222e+00 +227 160 -1.48893484347434e-15 +227 58 -1.21430643318376e-16 +227 157 2.08333333333333e+00 +227 229 8.33333333333333e+00 +227 159 -6.74807432154978e-16 +227 57 -4.16666666666667e+00 +227 156 -2.08333333333333e+00 +227 228 -1.21322223101128e-16 +227 143 5.55555555555556e+00 +227 209 -1.38888888888889e+00 +227 26 -4.86111111111111e+00 +227 125 -3.47222222222222e+00 +227 142 2.66453525910038e-15 +227 208 -6.93130448869983e-16 +227 25 8.32667268468867e-17 +227 124 -2.08333333333333e+00 +227 141 1.39731975989932e-15 +227 207 5.12502366933898e-16 +227 24 -4.16666666666667e+00 +227 123 -2.08333333333333e+00 +227 56 -4.86111111111111e+00 +227 167 5.55555555555555e+00 +227 224 -1.38888888888889e+00 +227 242 1.11111111111111e+01 +227 152 -1.11111111111111e+01 +227 29 -4.86111111111111e+00 +227 149 -3.47222222222222e+00 +227 218 -9.72222222222222e+00 +227 226 -1.77635683940025e-15 +227 166 2.22044604925031e-15 +227 223 -4.93420408698153e-16 +227 241 1.61754832618544e-15 +227 151 -1.62456853525228e-15 +227 28 -2.22044604925031e-16 +227 148 -2.08333333333333e+00 +227 217 -8.33333333333333e+00 +227 225 -1.77635683940025e-15 +227 165 -1.04083408558608e-16 +227 222 2.46330733588707e-16 +227 240 -4.44089209850063e-16 +227 150 -5.13478148889135e-16 +227 27 4.16666666666667e+00 +227 147 2.08333333333333e+00 +227 216 -9.02056207507940e-17 +228 228 5.55555555555556e+01 +228 143 -2.08333333333333e+00 +228 55 4.16666666666667e+00 +228 142 2.08333333333333e+00 +228 54 -4.86111111111111e+00 +228 141 -3.47222222222222e+00 +228 161 0.00000000000000e+00 +228 59 2.80157841370254e-16 +228 227 -6.40763483938933e-17 +228 167 2.08333333333333e+00 +228 160 4.85722573273506e-16 +228 58 -4.16666666666667e+00 +228 226 5.72458747072346e-17 +228 166 -2.08333333333333e+00 +228 159 5.55555555555555e+00 +228 57 -4.86111111111111e+00 +228 225 -1.38888888888889e+00 +228 165 -3.47222222222222e+00 +228 158 6.69494841509799e-16 +228 44 1.61329283265843e-16 +228 224 8.33333333333333e+00 +228 164 2.08333333333333e+00 +228 157 -3.94649590784724e-16 +228 43 4.16666666666667e+00 +228 223 7.61109925084824e-17 +228 163 2.08333333333333e+00 +228 156 -1.11111111111111e+01 +228 42 -4.86111111111111e+00 +228 222 -9.72222222222223e+00 +228 162 -3.47222222222222e+00 +228 134 -2.72351585728359e-16 +228 230 -8.88178419700125e-16 +228 155 0.00000000000000e+00 +228 41 1.59594559789866e-16 +228 209 -8.33333333333333e+00 +228 242 -1.86442116086039e-16 +228 221 -1.18178036800920e-17 +228 140 -2.08333333333333e+00 +228 133 -9.50628464835290e-16 +228 229 1.77635683940025e-15 +228 154 3.10515502199848e-16 +228 40 -4.16666666666667e+00 +228 208 -9.88792381306780e-17 +228 241 8.88178419700125e-16 +228 220 5.58364118830035e-17 +228 139 -2.08333333333333e+00 +228 132 -1.11111111111111e+01 +228 56 1.45716771982052e-16 +228 153 5.55555555555555e+00 +228 39 -4.86111111111111e+00 +228 207 -9.72222222222222e+00 +228 240 1.11111111111111e+01 +228 219 -1.38888888888889e+00 +228 138 -3.47222222222222e+00 +229 229 5.55555555555556e+01 +229 143 2.08333333333333e+00 +229 55 -4.86111111111111e+00 +229 142 -3.47222222222222e+00 +229 54 4.16666666666667e+00 +229 141 2.08333333333333e+00 +229 161 6.76000054544712e-16 +229 59 1.08420217248550e-16 +229 227 8.33333333333333e+00 +229 167 2.08333333333333e+00 +229 160 -1.11111111111111e+01 +229 58 -4.86111111111111e+00 +229 226 -9.72222222222223e+00 +229 166 -3.47222222222222e+00 +229 159 4.21537804662364e-16 +229 57 -4.16666666666667e+00 +229 225 1.96132173002628e-16 +229 165 -2.08333333333333e+00 +229 158 1.33226762955019e-15 +229 44 -4.99600361081320e-16 +229 224 -1.49945160454745e-16 +229 164 -2.08333333333333e+00 +229 157 5.55555555555555e+00 +229 43 -4.86111111111111e+00 +229 223 -1.38888888888889e+00 +229 163 -3.47222222222222e+00 +229 156 -5.06539254985228e-16 +229 42 4.16666666666667e+00 +229 222 4.16333634234434e-17 +229 162 2.08333333333333e+00 +229 134 1.33226762955019e-15 +229 230 0.00000000000000e+00 +229 155 5.95877513998033e-16 +229 41 -2.63677968348475e-16 +229 209 -3.53124647578529e-16 +229 242 -1.50681062679320e-15 +229 221 -8.33333333333333e+00 +229 140 -2.08333333333333e+00 +229 133 5.55555555555556e+00 +229 56 -3.19189119579733e-16 +229 154 -1.11111111111111e+01 +229 40 -4.86111111111111e+00 +229 208 -1.38888888888889e+00 +229 241 1.11111111111111e+01 +229 220 -9.72222222222223e+00 +229 139 -3.47222222222222e+00 +229 132 -8.90780504914090e-16 +229 228 8.88178419700125e-16 +229 153 4.85722573273506e-16 +229 39 -4.16666666666667e+00 +229 207 -1.85506991712270e-16 +229 240 8.88178419700125e-16 +229 219 1.47451495458029e-17 +229 138 -2.08333333333333e+00 +230 230 5.55555555555556e+01 +230 143 -3.47222222222222e+00 +230 55 -2.42861286636753e-16 +230 142 2.08333333333333e+00 +230 54 5.55111512312578e-17 +230 141 -2.08333333333333e+00 +230 161 5.55555555555556e+00 +230 59 -6.94444444444445e-01 +230 227 -9.72222222222222e+00 +230 167 -3.47222222222222e+00 +230 160 7.62410967691807e-16 +230 58 1.38777878078145e-17 +230 226 8.33333333333333e+00 +230 166 2.08333333333333e+00 +230 159 0.00000000000000e+00 +230 57 3.46944695195361e-16 +230 225 -2.55004350968591e-16 +230 165 2.08333333333333e+00 +230 158 5.55555555555555e+00 +230 44 -6.94444444444445e-01 +230 224 -9.72222222222222e+00 +230 164 -3.47222222222222e+00 +230 157 8.88178419700125e-16 +230 43 -4.61436444609831e-16 +230 223 -6.07153216591882e-17 +230 163 -2.08333333333333e+00 +230 156 5.79397640976254e-16 +230 42 1.17961196366423e-16 +230 222 8.33333333333333e+00 +230 162 2.08333333333333e+00 +230 134 5.55555555555556e+00 +230 56 -6.94444444444443e-01 +230 155 5.55555555555556e+00 +230 41 -6.94444444444444e-01 +230 209 -9.72222222222222e+00 +230 242 -2.22222222222222e+01 +230 221 -9.72222222222222e+00 +230 140 -3.47222222222222e+00 +230 133 8.88178419700125e-16 +230 229 0.00000000000000e+00 +230 154 5.58038858178289e-16 +230 40 -2.22911966663020e-16 +230 208 -1.49186218934005e-16 +230 241 -1.18763505974062e-15 +230 220 -8.33333333333333e+00 +230 139 -2.08333333333333e+00 +230 132 -2.79507320066763e-16 +230 228 -8.88178419700125e-16 +230 153 0.00000000000000e+00 +230 39 1.80411241501588e-16 +230 207 -8.33333333333333e+00 +230 240 -1.41813644161104e-16 +230 219 2.16840434497101e-17 +230 138 -2.08333333333333e+00 +231 231 1.11111111111111e+02 +231 46 0.00000000000000e+00 +231 45 0.00000000000000e+00 +231 80 -7.45931094670027e-17 +231 50 -2.08333333333333e+00 +231 79 3.38271077815477e-17 +231 49 -2.08333333333333e+00 +231 78 -1.38888888888889e+00 +231 48 -3.47222222222222e+00 +231 77 -8.33333333333333e+00 +231 35 -2.08333333333333e+00 +231 76 -6.68952740423556e-17 +231 34 2.08333333333333e+00 +231 75 -9.72222222222223e+00 +231 33 -3.47222222222222e+00 +231 83 0.00000000000000e+00 +231 185 5.58364118830035e-16 +231 74 3.72965547335014e-17 +231 32 0.00000000000000e+00 +231 82 0.00000000000000e+00 +231 184 8.88178419700125e-16 +231 73 7.92551788086904e-17 +231 31 0.00000000000000e+00 +231 81 0.00000000000000e+00 +231 183 1.11111111111111e+01 +231 72 -1.38888888888889e+00 +231 30 0.00000000000000e+00 +231 95 0.00000000000000e+00 +231 17 0.00000000000000e+00 +231 94 0.00000000000000e+00 +231 16 0.00000000000000e+00 +231 93 0.00000000000000e+00 +231 15 0.00000000000000e+00 +231 179 1.33226762955019e-15 +231 92 1.72388145425195e-16 +231 68 1.78459677591114e-16 +231 20 2.08333333333333e+00 +231 178 3.75892893200724e-16 +231 91 -8.33333333333333e+00 +231 67 1.45716771982052e-16 +231 19 -2.08333333333333e+00 +231 177 1.11111111111111e+01 +231 90 -9.72222222222222e+00 +231 66 -1.38888888888889e+00 +231 18 -3.47222222222222e+00 +231 176 -3.55848705536899e-16 +231 89 -1.84314369322536e-17 +231 65 8.33333333333333e+00 +231 5 2.08333333333333e+00 +231 175 -8.53917631049583e-16 +231 88 8.33333333333333e+00 +231 64 -1.17202254845683e-16 +231 4 2.08333333333333e+00 +231 174 -2.22222222222222e+01 +231 87 -9.72222222222222e+00 +231 63 -9.72222222222223e+00 +231 3 -3.47222222222222e+00 +231 182 0.00000000000000e+00 +231 233 0.00000000000000e+00 +231 173 1.33226762955019e-15 +231 86 0.00000000000000e+00 +231 71 0.00000000000000e+00 +231 170 3.63519435907234e-16 +231 62 1.75966012594397e-16 +231 2 0.00000000000000e+00 +231 181 0.00000000000000e+00 +231 232 -1.77635683940025e-15 +231 172 5.48877349820787e-16 +231 85 0.00000000000000e+00 +231 70 0.00000000000000e+00 +231 169 4.44089209850063e-16 +231 61 7.67615138119737e-17 +231 1 0.00000000000000e+00 +231 180 0.00000000000000e+00 +231 47 0.00000000000000e+00 +231 171 1.11111111111111e+01 +231 84 0.00000000000000e+00 +231 69 0.00000000000000e+00 +231 168 1.11111111111111e+01 +231 60 -1.38888888888889e+00 +231 0 0.00000000000000e+00 +232 232 1.11111111111111e+02 +232 46 0.00000000000000e+00 +232 45 0.00000000000000e+00 +232 80 -8.33333333333333e+00 +232 50 -2.08333333333333e+00 +232 79 -9.72222222222223e+00 +232 49 -3.47222222222222e+00 +232 78 7.68699340292223e-17 +232 48 -2.08333333333333e+00 +232 77 -3.23525928269675e-16 +232 35 2.08333333333333e+00 +232 76 -1.38888888888889e+00 +232 34 -3.47222222222222e+00 +232 75 -6.33174068731535e-17 +232 33 2.08333333333333e+00 +232 83 0.00000000000000e+00 +232 185 2.50559122061400e-16 +232 74 8.33333333333333e+00 +232 32 0.00000000000000e+00 +232 82 0.00000000000000e+00 +232 184 1.11111111111111e+01 +232 73 -9.72222222222223e+00 +232 31 0.00000000000000e+00 +232 81 0.00000000000000e+00 +232 183 8.88178419700125e-16 +232 72 1.45716771982052e-16 +232 30 0.00000000000000e+00 +232 95 0.00000000000000e+00 +232 17 0.00000000000000e+00 +232 94 0.00000000000000e+00 +232 16 0.00000000000000e+00 +232 93 0.00000000000000e+00 +232 15 0.00000000000000e+00 +232 179 1.56816291722872e-16 +232 92 2.33645568170626e-16 +232 68 8.33333333333333e+00 +232 20 2.08333333333333e+00 +232 178 -2.22222222222222e+01 +232 91 -9.72222222222222e+00 +232 67 -9.72222222222223e+00 +232 19 -3.47222222222222e+00 +232 177 4.39589770834248e-16 +232 90 -8.33333333333333e+00 +232 66 7.76288755499621e-17 +232 18 -2.08333333333333e+00 +232 176 1.33226762955019e-15 +232 89 3.51281503885303e-16 +232 65 2.33970828822372e-16 +232 5 -2.08333333333333e+00 +232 175 1.11111111111111e+01 +232 88 -9.72222222222222e+00 +232 64 -1.38888888888889e+00 +232 4 -3.47222222222222e+00 +232 174 -6.54966532398493e-16 +232 87 8.33333333333333e+00 +232 63 -9.71445146547012e-17 +232 3 2.08333333333333e+00 +232 182 0.00000000000000e+00 +232 233 -2.66453525910038e-15 +232 173 -4.13189447934226e-16 +232 86 0.00000000000000e+00 +232 71 0.00000000000000e+00 +232 170 8.84573447476611e-17 +232 62 -8.33333333333333e+00 +232 2 0.00000000000000e+00 +232 181 0.00000000000000e+00 +232 47 0.00000000000000e+00 +232 172 -2.22222222222222e+01 +232 85 0.00000000000000e+00 +232 70 0.00000000000000e+00 +232 169 1.11111111111111e+01 +232 61 -9.72222222222223e+00 +232 1 0.00000000000000e+00 +232 180 0.00000000000000e+00 +232 231 -8.88178419700125e-16 +232 171 3.74158169724748e-16 +232 84 0.00000000000000e+00 +232 69 0.00000000000000e+00 +232 168 8.88178419700125e-16 +232 60 3.38271077815477e-17 +232 0 0.00000000000000e+00 +233 233 1.11111111111111e+02 +233 46 0.00000000000000e+00 +233 45 0.00000000000000e+00 +233 80 -9.72222222222222e+00 +233 50 -3.47222222222222e+00 +233 79 -8.33333333333333e+00 +233 49 -2.08333333333333e+00 +233 78 1.75966012594397e-16 +233 48 -2.08333333333333e+00 +233 77 -9.72222222222222e+00 +233 35 -3.47222222222222e+00 +233 76 -3.83048627539129e-16 +233 34 2.08333333333333e+00 +233 75 -8.33333333333333e+00 +233 33 -2.08333333333333e+00 +233 83 0.00000000000000e+00 +233 185 -2.22222222222222e+01 +233 74 -9.72222222222222e+00 +233 32 0.00000000000000e+00 +233 82 0.00000000000000e+00 +233 184 9.53962386515683e-17 +233 73 8.33333333333333e+00 +233 31 0.00000000000000e+00 +233 81 0.00000000000000e+00 +233 183 1.41488383509358e-16 +233 72 1.76833374332386e-16 +233 30 0.00000000000000e+00 +233 95 0.00000000000000e+00 +233 17 0.00000000000000e+00 +233 94 0.00000000000000e+00 +233 16 0.00000000000000e+00 +233 93 0.00000000000000e+00 +233 15 0.00000000000000e+00 +233 179 1.11111111111111e+01 +233 92 -1.38888888888889e+00 +233 68 -9.72222222222222e+00 +233 20 -3.47222222222222e+00 +233 178 3.63966669303384e-16 +233 91 2.02962646689286e-16 +233 67 8.33333333333333e+00 +233 19 2.08333333333333e+00 +233 177 1.33226762955019e-15 +233 90 1.48318857196017e-16 +233 66 3.72965547335014e-17 +233 18 2.08333333333333e+00 +233 176 1.11111111111111e+01 +233 89 -1.38888888888889e+00 +233 65 -9.72222222222222e+00 +233 5 -3.47222222222222e+00 +233 175 1.33226762955019e-15 +233 88 4.06250554030319e-16 +233 64 2.61943244872498e-16 +233 4 -2.08333333333333e+00 +233 174 -4.52871247447195e-16 +233 87 -2.04697370165263e-16 +233 63 8.33333333333333e+00 +233 3 2.08333333333333e+00 +233 182 0.00000000000000e+00 +233 47 0.00000000000000e+00 +233 173 1.11111111111111e+01 +233 86 0.00000000000000e+00 +233 71 0.00000000000000e+00 +233 170 -2.22222222222222e+01 +233 62 -9.72222222222222e+00 +233 2 0.00000000000000e+00 +233 181 0.00000000000000e+00 +233 232 -2.66453525910038e-15 +233 172 -2.80455996967688e-16 +233 85 0.00000000000000e+00 +233 70 0.00000000000000e+00 +233 169 1.95047970830142e-16 +233 61 -8.33333333333333e+00 +233 1 0.00000000000000e+00 +233 180 0.00000000000000e+00 +233 231 0.00000000000000e+00 +233 171 1.33226762955019e-15 +233 84 0.00000000000000e+00 +233 69 0.00000000000000e+00 +233 168 5.58364118830035e-16 +233 60 3.64291929955129e-17 +233 0 0.00000000000000e+00 +234 234 1.11111111111111e+02 +234 49 2.08333333333333e+00 +234 48 -3.47222222222222e+00 +234 113 8.76035355368288e-17 +234 53 -2.08333333333333e+00 +234 112 -3.72965547335014e-17 +234 52 -2.08333333333333e+00 +234 111 -1.38888888888889e+00 +234 51 -3.47222222222222e+00 +234 110 -8.33333333333333e+00 +234 38 -2.08333333333333e+00 +234 109 -1.11022302462516e-16 +234 37 2.08333333333333e+00 +234 108 -9.72222222222223e+00 +234 36 -3.47222222222222e+00 +234 77 8.33333333333333e+00 +234 200 6.80987384538145e-16 +234 107 1.98625837999344e-16 +234 35 2.08333333333333e+00 +234 76 -6.07153216591882e-18 +234 199 4.44089209850063e-16 +234 106 7.60025722912339e-17 +234 34 -2.08333333333333e+00 +234 75 -9.72222222222223e+00 +234 198 1.11111111111111e+01 +234 105 -1.38888888888889e+00 +234 33 -3.47222222222222e+00 +234 92 -2.17707796235089e-16 +234 20 -2.08333333333333e+00 +234 91 8.33333333333333e+00 +234 19 2.08333333333333e+00 +234 90 -9.72222222222222e+00 +234 18 -3.47222222222222e+00 +234 197 1.77635683940025e-15 +234 119 -2.77555756156289e-17 +234 104 1.68051336735253e-16 +234 23 2.08333333333333e+00 +234 196 3.60063541482436e-16 +234 118 -8.33333333333333e+00 +234 103 4.33680868994202e-18 +234 22 -2.08333333333333e+00 +234 195 1.11111111111111e+01 +234 117 -9.72222222222222e+00 +234 102 -1.38888888888889e+00 +234 21 -3.47222222222222e+00 +234 194 -3.15174861036105e-15 +234 116 -2.54136989230602e-16 +234 101 8.33333333333333e+00 +234 8 2.08333333333333e+00 +234 193 -1.06151524202625e-15 +234 115 8.33333333333333e+00 +234 100 -9.97465998686664e-17 +234 7 2.08333333333333e+00 +234 192 -2.22222222222222e+01 +234 114 -9.72222222222222e+00 +234 99 -9.72222222222223e+00 +234 6 -3.47222222222222e+00 +234 176 -2.21394083621540e-16 +234 236 3.55271367880050e-15 +234 191 1.77635683940025e-15 +234 89 3.03576608295941e-17 +234 65 -8.33333333333333e+00 +234 188 2.95756800126890e-16 +234 98 1.68159756952502e-16 +234 5 -2.08333333333333e+00 +234 175 5.93167008566819e-16 +234 235 -8.88178419700125e-16 +234 190 -2.20364091557679e-17 +234 88 -8.33333333333333e+00 +234 64 6.93889390390723e-18 +234 187 8.88178419700125e-16 +234 97 1.29020058525775e-17 +234 4 -2.08333333333333e+00 +234 174 -2.22222222222222e+01 +234 50 2.08333333333333e+00 +234 189 1.11111111111111e+01 +234 87 -9.72222222222222e+00 +234 63 -9.72222222222223e+00 +234 186 1.11111111111111e+01 +234 96 -1.38888888888889e+00 +234 3 -3.47222222222222e+00 +235 235 1.11111111111111e+02 +235 49 -3.47222222222222e+00 +235 48 2.08333333333333e+00 +235 113 -8.33333333333333e+00 +235 53 -2.08333333333333e+00 +235 112 -9.72222222222223e+00 +235 52 -3.47222222222222e+00 +235 111 4.07660016854550e-17 +235 51 -2.08333333333333e+00 +235 110 1.05818132034585e-16 +235 38 2.08333333333333e+00 +235 109 -1.38888888888889e+00 +235 37 -3.47222222222222e+00 +235 108 -2.16840434497101e-17 +235 36 2.08333333333333e+00 +235 77 -1.88217497143484e-16 +235 200 -3.29597460435593e-17 +235 107 8.33333333333333e+00 +235 35 2.08333333333333e+00 +235 76 -1.38888888888889e+00 +235 199 1.11111111111111e+01 +235 106 -9.72222222222223e+00 +235 34 -3.47222222222222e+00 +235 75 4.33680868994202e-17 +235 198 8.88178419700125e-16 +235 105 -9.54097911787244e-18 +235 33 -2.08333333333333e+00 +235 92 3.78169717762944e-16 +235 20 2.08333333333333e+00 +235 91 -9.72222222222222e+00 +235 19 -3.47222222222222e+00 +235 90 8.33333333333333e+00 +235 18 2.08333333333333e+00 +235 197 1.70639869422062e-16 +235 119 -9.44556932669371e-16 +235 104 8.33333333333333e+00 +235 23 2.08333333333333e+00 +235 196 -2.22222222222222e+01 +235 118 -9.72222222222222e+00 +235 103 -9.72222222222223e+00 +235 22 -3.47222222222222e+00 +235 195 1.51435938441913e-16 +235 117 -8.33333333333333e+00 +235 102 7.52436307704940e-17 +235 21 -2.08333333333333e+00 +235 194 3.99680288865056e-15 +235 116 7.88431819831459e-16 +235 101 3.95300112088215e-16 +235 8 -2.08333333333333e+00 +235 193 1.11111111111111e+01 +235 115 -9.72222222222222e+00 +235 100 -1.38888888888889e+00 +235 7 -3.47222222222222e+00 +235 192 -1.04874876144523e-15 +235 114 8.33333333333333e+00 +235 99 -4.85722573273506e-17 +235 6 2.08333333333333e+00 +235 176 2.22044604925031e-15 +235 236 -1.77635683940025e-15 +235 191 -4.68375338513738e-17 +235 89 1.43982048506075e-16 +235 65 3.49763620843824e-16 +235 188 9.51929507442273e-17 +235 98 -8.33333333333334e+00 +235 5 -2.08333333333333e+00 +235 175 1.11111111111111e+01 +235 50 -2.08333333333333e+00 +235 190 -2.22222222222222e+01 +235 88 -9.72222222222222e+00 +235 64 -1.38888888888889e+00 +235 187 1.11111111111111e+01 +235 97 -9.72222222222223e+00 +235 4 -3.47222222222222e+00 +235 174 7.89759967492754e-16 +235 234 -1.77635683940025e-15 +235 189 1.27610595701544e-16 +235 87 -8.33333333333333e+00 +235 63 9.62771529167128e-17 +235 186 8.88178419700125e-16 +235 96 -5.11743425413158e-17 +235 3 -2.08333333333333e+00 +236 236 1.11111111111111e+02 +236 49 -2.08333333333333e+00 +236 48 2.08333333333333e+00 +236 113 -9.72222222222222e+00 +236 53 -3.47222222222222e+00 +236 112 -8.33333333333334e+00 +236 52 -2.08333333333333e+00 +236 111 1.67400815431762e-16 +236 51 -2.08333333333333e+00 +236 110 -9.72222222222222e+00 +236 38 -3.47222222222222e+00 +236 109 2.63677968348475e-16 +236 37 2.08333333333333e+00 +236 108 -8.33333333333333e+00 +236 36 -2.08333333333333e+00 +236 77 -9.72222222222222e+00 +236 200 -2.22222222222222e+01 +236 107 -9.72222222222222e+00 +236 35 -3.47222222222222e+00 +236 76 -3.02926086992450e-16 +236 199 2.37548695991574e-16 +236 106 8.33333333333333e+00 +236 34 2.08333333333333e+00 +236 75 8.33333333333333e+00 +236 198 4.06779102589405e-16 +236 105 5.71374544899861e-17 +236 33 2.08333333333333e+00 +236 92 -1.38888888888889e+00 +236 20 -3.47222222222222e+00 +236 91 3.22658566531686e-16 +236 19 2.08333333333333e+00 +236 90 -1.72062884773450e-16 +236 18 -2.08333333333333e+00 +236 197 1.11111111111111e+01 +236 119 -1.38888888888889e+00 +236 104 -9.72222222222222e+00 +236 23 -3.47222222222222e+00 +236 196 3.41740524767431e-16 +236 118 -1.12583553590895e-15 +236 103 8.33333333333333e+00 +236 22 2.08333333333333e+00 +236 195 1.77635683940025e-15 +236 117 3.38271077815477e-17 +236 102 1.36175792864179e-16 +236 21 2.08333333333333e+00 +236 194 1.11111111111111e+01 +236 116 -1.38888888888889e+00 +236 101 -9.72222222222222e+00 +236 8 -3.47222222222222e+00 +236 193 2.66453525910038e-15 +236 115 8.25403113913215e-16 +236 100 5.35162192338845e-16 +236 7 -2.08333333333333e+00 +236 192 -3.19286697775256e-15 +236 114 -2.08166817117217e-16 +236 99 8.33333333333333e+00 +236 6 2.08333333333333e+00 +236 176 1.11111111111111e+01 +236 50 -3.47222222222222e+00 +236 191 1.11111111111111e+01 +236 89 -1.38888888888889e+00 +236 65 -9.72222222222222e+00 +236 188 -2.22222222222222e+01 +236 98 -9.72222222222222e+00 +236 5 -3.47222222222222e+00 +236 175 2.66453525910038e-15 +236 235 -1.77635683940025e-15 +236 190 -3.88049510059718e-16 +236 88 1.44957830461312e-16 +236 64 5.90673343570103e-16 +236 187 -1.50920942409982e-16 +236 97 -8.33333333333333e+00 +236 4 -2.08333333333333e+00 +236 174 -1.68715410565901e-16 +236 234 3.55271367880050e-15 +236 189 1.77635683940025e-15 +236 87 -8.99887803162969e-18 +236 63 -8.33333333333333e+00 +236 186 7.30427003603484e-16 +236 96 8.76035355368288e-17 +236 3 -2.08333333333333e+00 +237 237 1.11111111111111e+02 +237 52 2.08333333333333e+00 +237 51 -3.47222222222222e+00 +237 137 1.78676518025611e-16 +237 56 -2.08333333333333e+00 +237 136 4.68375338513738e-17 +237 55 -2.08333333333333e+00 +237 135 -1.38888888888889e+00 +237 54 -3.47222222222222e+00 +237 134 -8.33333333333333e+00 +237 41 -2.08333333333333e+00 +237 133 5.75060832286312e-16 +237 40 2.08333333333333e+00 +237 132 -9.72222222222222e+00 +237 39 -3.47222222222222e+00 +237 110 8.33333333333333e+00 +237 215 8.03393809811759e-16 +237 131 2.35055030994857e-16 +237 38 2.08333333333333e+00 +237 109 -2.77555756156289e-16 +237 214 4.44089209850063e-16 +237 130 -5.19332840620557e-17 +237 37 -2.08333333333333e+00 +237 108 -9.72222222222223e+00 +237 213 1.11111111111111e+01 +237 129 -1.38888888888889e+00 +237 36 -3.47222222222222e+00 +237 119 -5.46437894932694e-16 +237 23 -2.08333333333333e+00 +237 118 8.33333333333333e+00 +237 22 2.08333333333333e+00 +237 117 -9.72222222222222e+00 +237 21 -3.47222222222222e+00 +237 212 2.22044604925031e-15 +237 143 -1.33573707650214e-16 +237 128 2.65521112041700e-16 +237 26 2.08333333333333e+00 +237 211 -8.82540568403201e-17 +237 142 -8.33333333333333e+00 +237 127 3.38271077815477e-17 +237 25 -2.08333333333333e+00 +237 210 1.11111111111111e+01 +237 141 -9.72222222222222e+00 +237 126 -1.38888888888889e+00 +237 24 -3.47222222222222e+00 +237 209 -1.76495916406200e-15 +237 140 -3.34801630863524e-16 +237 125 8.33333333333333e+00 +237 11 2.08333333333333e+00 +237 208 3.39508423544826e-15 +237 139 8.33333333333333e+00 +237 124 5.55111512312578e-16 +237 10 2.08333333333333e+00 +237 207 -2.22222222222222e+01 +237 138 -9.72222222222222e+00 +237 123 -9.72222222222222e+00 +237 9 -3.47222222222222e+00 +237 194 -2.43392545701271e-15 +237 239 3.55271367880050e-15 +237 206 2.66453525910038e-15 +237 116 -5.12610787151146e-16 +237 101 -8.33333333333333e+00 +237 203 1.32677885605198e-15 +237 122 5.40583203201273e-16 +237 8 -2.08333333333333e+00 +237 193 -3.10515502199848e-16 +237 238 -5.32907051820075e-15 +237 205 -4.56205169127588e-16 +237 115 -8.33333333333333e+00 +237 100 -2.22044604925031e-16 +237 202 4.44089209850063e-16 +237 121 -2.58040117051550e-17 +237 7 -2.08333333333333e+00 +237 192 -2.22222222222222e+01 +237 53 2.08333333333333e+00 +237 204 1.11111111111111e+01 +237 114 -9.72222222222222e+00 +237 99 -9.72222222222223e+00 +237 201 1.11111111111111e+01 +237 120 -1.38888888888889e+00 +237 6 -3.47222222222222e+00 +238 238 1.11111111111111e+02 +238 52 -3.47222222222222e+00 +238 51 2.08333333333333e+00 +238 137 -8.33333333333334e+00 +238 56 -2.08333333333333e+00 +238 136 -9.72222222222223e+00 +238 55 -3.47222222222222e+00 +238 135 5.74627151417317e-17 +238 54 -2.08333333333333e+00 +238 134 1.34614541735800e-15 +238 41 2.08333333333333e+00 +238 133 -1.38888888888889e+00 +238 40 -3.47222222222222e+00 +238 132 5.20417042793042e-16 +238 39 2.08333333333333e+00 +238 110 1.69135538907739e-16 +238 215 1.22785896033983e-15 +238 131 8.33333333333333e+00 +238 38 2.08333333333333e+00 +238 109 -1.38888888888889e+00 +238 214 1.11111111111111e+01 +238 130 -9.72222222222223e+00 +238 37 -3.47222222222222e+00 +238 108 -3.10515502199848e-16 +238 213 0.00000000000000e+00 +238 129 -7.71951946809679e-17 +238 36 -2.08333333333333e+00 +238 119 1.57339419271096e-15 +238 23 2.08333333333333e+00 +238 118 -9.72222222222222e+00 +238 22 -3.47222222222222e+00 +238 117 8.33333333333333e+00 +238 21 2.08333333333333e+00 +238 212 -1.66968489815483e-15 +238 143 -8.15753714578094e-16 +238 128 8.33333333333333e+00 +238 26 2.08333333333333e+00 +238 211 -2.22222222222222e+01 +238 142 -9.72222222222222e+00 +238 127 -9.72222222222223e+00 +238 25 -3.47222222222222e+00 +238 210 9.71716197090133e-17 +238 141 -8.33333333333333e+00 +238 126 3.04660810468427e-17 +238 24 -2.08333333333333e+00 +238 209 3.55271367880050e-15 +238 140 3.10515502199848e-16 +238 125 -9.02164627725188e-16 +238 11 -2.08333333333333e+00 +238 208 1.11111111111111e+01 +238 139 -9.72222222222222e+00 +238 124 -1.38888888888889e+00 +238 10 -3.47222222222222e+00 +238 207 3.32828382909600e-15 +238 138 8.33333333333333e+00 +238 123 6.34908792207511e-16 +238 9 2.08333333333333e+00 +238 194 8.88178419700125e-16 +238 239 2.66453525910038e-15 +238 206 -2.29709914284504e-15 +238 116 -2.09901540593194e-16 +238 101 -2.22478285794026e-16 +238 203 7.46798456408015e-16 +238 122 -8.33333333333334e+00 +238 8 -2.08333333333333e+00 +238 193 1.11111111111111e+01 +238 53 -2.08333333333333e+00 +238 205 -2.22222222222222e+01 +238 115 -9.72222222222222e+00 +238 100 -1.38888888888889e+00 +238 202 1.11111111111111e+01 +238 121 -9.72222222222223e+00 +238 7 -3.47222222222222e+00 +238 192 -5.05970048844673e-16 +238 237 -5.32907051820075e-15 +238 204 -5.30500122997157e-16 +238 114 -8.33333333333333e+00 +238 99 -2.40150781205539e-16 +238 201 0.00000000000000e+00 +238 120 4.07660016854550e-17 +238 6 -2.08333333333333e+00 +239 239 1.11111111111111e+02 +239 52 -2.08333333333333e+00 +239 51 2.08333333333333e+00 +239 137 -9.72222222222222e+00 +239 56 -3.47222222222222e+00 +239 136 -8.33333333333334e+00 +239 55 -2.08333333333333e+00 +239 135 4.29560900738757e-16 +239 54 -2.08333333333333e+00 +239 134 -9.72222222222222e+00 +239 41 -3.47222222222222e+00 +239 133 1.16616785672541e-15 +239 40 2.08333333333333e+00 +239 132 -8.33333333333333e+00 +239 39 -2.08333333333333e+00 +239 110 -9.72222222222222e+00 +239 215 -2.22222222222222e+01 +239 131 -9.72222222222222e+00 +239 38 -3.47222222222222e+00 +239 109 1.69460799559484e-16 +239 214 9.68843061333047e-16 +239 130 8.33333333333333e+00 +239 37 2.08333333333333e+00 +239 108 8.33333333333333e+00 +239 213 1.43790957873174e-15 +239 129 4.31187203997485e-16 +239 36 2.08333333333333e+00 +239 119 -1.38888888888889e+00 +239 23 -3.47222222222222e+00 +239 118 1.64104840827406e-15 +239 22 2.08333333333333e+00 +239 117 -5.88613359442380e-16 +239 21 -2.08333333333333e+00 +239 212 1.11111111111111e+01 +239 143 -1.38888888888889e+00 +239 128 -9.72222222222222e+00 +239 26 -3.47222222222222e+00 +239 211 -1.91545997813014e-15 +239 142 -9.15066633577766e-16 +239 127 8.33333333333333e+00 +239 25 2.08333333333333e+00 +239 210 2.22044604925031e-15 +239 141 -1.59594559789866e-16 +239 126 9.62771529167128e-17 +239 24 2.08333333333333e+00 +239 209 1.11111111111111e+01 +239 140 -1.38888888888889e+00 +239 125 -9.72222222222222e+00 +239 11 -3.47222222222222e+00 +239 208 3.10862446895044e-15 +239 139 2.56522234010070e-16 +239 124 -1.00787433954252e-15 +239 10 -2.08333333333333e+00 +239 207 -1.58271833139434e-15 +239 138 -3.50414142147315e-16 +239 123 8.33333333333333e+00 +239 9 2.08333333333333e+00 +239 194 1.11111111111111e+01 +239 53 -3.47222222222222e+00 +239 206 1.11111111111111e+01 +239 116 -1.38888888888889e+00 +239 101 -9.72222222222222e+00 +239 203 -2.22222222222222e+01 +239 122 -9.72222222222222e+00 +239 8 -3.47222222222222e+00 +239 193 1.77635683940025e-15 +239 238 2.66453525910038e-15 +239 205 -2.32194092512211e-15 +239 115 -1.92879566485171e-16 +239 100 -3.15719672627779e-16 +239 202 1.11683665787732e-15 +239 121 -8.33333333333334e+00 +239 7 -2.08333333333333e+00 +239 192 -2.47236042402732e-15 +239 237 3.55271367880050e-15 +239 204 2.66453525910038e-15 +239 114 -4.36716635077161e-16 +239 99 -8.33333333333333e+00 +239 201 7.70542483985448e-16 +239 120 2.14238349283136e-16 +239 6 -2.08333333333333e+00 +240 240 1.11111111111111e+02 +240 55 2.08333333333333e+00 +240 54 -3.47222222222222e+00 +240 161 -1.38777878078145e-16 +240 59 -2.08333333333333e+00 +240 160 2.16840434497101e-17 +240 58 -2.08333333333333e+00 +240 159 -1.38888888888889e+00 +240 57 -3.47222222222222e+00 +240 158 -8.33333333333333e+00 +240 44 -2.08333333333333e+00 +240 157 1.05601291600088e-16 +240 43 2.08333333333333e+00 +240 156 -9.72222222222223e+00 +240 42 -3.47222222222222e+00 +240 134 8.33333333333333e+00 +240 230 -3.12683906544819e-16 +240 155 -1.92554305833426e-16 +240 41 2.08333333333333e+00 +240 133 -1.39645239816133e-16 +240 229 8.88178419700125e-16 +240 154 7.20994444702860e-17 +240 40 -2.08333333333333e+00 +240 132 -9.72222222222222e+00 +240 228 1.11111111111111e+01 +240 153 -1.38888888888889e+00 +240 39 -3.47222222222222e+00 +240 143 1.25767452008319e-16 +240 26 -2.08333333333333e+00 +240 142 8.33333333333333e+00 +240 25 2.08333333333333e+00 +240 141 -9.72222222222222e+00 +240 24 -3.47222222222222e+00 +240 227 -4.44089209850063e-16 +240 167 5.38523219073550e-16 +240 152 -6.40763483938933e-17 +240 29 2.08333333333333e+00 +240 226 1.24867564205156e-15 +240 166 -8.33333333333333e+00 +240 151 2.25514051876985e-17 +240 28 -2.08333333333333e+00 +240 225 1.11111111111111e+01 +240 165 -9.72222222222222e+00 +240 150 -1.38888888888889e+00 +240 27 -3.47222222222222e+00 +240 224 1.33432761367791e-15 +240 164 3.25911173049143e-16 +240 149 8.33333333333333e+00 +240 14 2.08333333333333e+00 +240 223 -5.66942868519826e-16 +240 163 8.33333333333333e+00 +240 148 8.99887803162969e-17 +240 13 2.08333333333333e+00 +240 222 -2.22222222222222e+01 +240 162 -9.72222222222222e+00 +240 147 -9.72222222222223e+00 +240 12 -3.47222222222222e+00 +240 209 -4.87674137183980e-16 +240 242 -8.88178419700125e-16 +240 221 -4.44089209850063e-16 +240 140 3.73832909073002e-16 +240 125 -8.33333333333333e+00 +240 218 -1.86442116086039e-16 +240 146 -1.18178036800920e-17 +240 11 -2.08333333333333e+00 +240 208 -1.85647937994693e-15 +240 241 1.77635683940025e-15 +240 220 9.06325253562101e-16 +240 139 -8.33333333333333e+00 +240 124 -9.88792381306780e-17 +240 217 8.88178419700125e-16 +240 145 5.58364118830035e-17 +240 10 -2.08333333333333e+00 +240 207 -2.22222222222222e+01 +240 56 2.08333333333333e+00 +240 219 1.11111111111111e+01 +240 138 -9.72222222222222e+00 +240 123 -9.72222222222222e+00 +240 216 1.11111111111111e+01 +240 144 -1.38888888888889e+00 +240 9 -3.47222222222222e+00 +241 241 1.11111111111111e+02 +241 55 -3.47222222222222e+00 +241 54 2.08333333333333e+00 +241 161 -8.33333333333333e+00 +241 59 -2.08333333333333e+00 +241 160 -9.72222222222223e+00 +241 58 -3.47222222222222e+00 +241 159 6.97141996908179e-17 +241 57 -2.08333333333333e+00 +241 158 -9.54097911787244e-17 +241 44 2.08333333333333e+00 +241 157 -1.38888888888889e+00 +241 43 -3.47222222222222e+00 +241 156 6.85215773010839e-17 +241 42 2.08333333333333e+00 +241 134 9.45424294407360e-16 +241 230 -1.18763505974062e-15 +241 155 8.33333333333333e+00 +241 41 2.08333333333333e+00 +241 133 -1.38888888888889e+00 +241 229 1.11111111111111e+01 +241 154 -9.72222222222223e+00 +241 40 -3.47222222222222e+00 +241 132 -2.21068822969794e-16 +241 228 8.88178419700125e-16 +241 153 5.03069808033274e-17 +241 39 -2.08333333333333e+00 +241 143 -8.73758530806068e-16 +241 26 2.08333333333333e+00 +241 142 -9.72222222222222e+00 +241 25 -3.47222222222222e+00 +241 141 8.33333333333333e+00 +241 24 2.08333333333333e+00 +241 227 1.49947870960176e-15 +241 167 4.51353364405715e-16 +241 152 8.33333333333333e+00 +241 29 2.08333333333333e+00 +241 226 -2.22222222222222e+01 +241 166 -9.72222222222222e+00 +241 151 -9.72222222222223e+00 +241 28 -3.47222222222222e+00 +241 225 9.02733833865743e-16 +241 165 -8.33333333333333e+00 +241 150 1.95373231481888e-16 +241 27 -2.08333333333333e+00 +241 224 3.10862446895044e-15 +241 164 -5.25621213220973e-16 +241 149 -1.49945160454745e-16 +241 14 -2.08333333333333e+00 +241 223 1.11111111111111e+01 +241 163 -9.72222222222222e+00 +241 148 -1.38888888888889e+00 +241 13 -3.47222222222222e+00 +241 222 -7.13079768843716e-16 +241 162 8.33333333333333e+00 +241 147 4.85722573273506e-17 +241 12 2.08333333333333e+00 +241 209 3.55271367880050e-15 +241 242 -3.55271367880050e-15 +241 221 1.29573001633743e-15 +241 140 -8.23126289350995e-16 +241 125 -3.60930903220424e-16 +241 218 -1.52079683481826e-15 +241 146 -8.33333333333333e+00 +241 11 -2.08333333333333e+00 +241 208 1.11111111111111e+01 +241 56 -2.08333333333333e+00 +241 220 -2.22222222222222e+01 +241 139 -9.72222222222222e+00 +241 124 -1.38888888888889e+00 +241 217 1.11111111111111e+01 +241 145 -9.72222222222223e+00 +241 10 -3.47222222222222e+00 +241 207 -1.82174425284592e-15 +241 240 8.88178419700125e-16 +241 219 1.14199014827898e-15 +241 138 -8.33333333333333e+00 +241 123 -1.87241715188247e-16 +241 216 8.88178419700125e-16 +241 144 1.47451495458029e-17 +241 9 -2.08333333333333e+00 +242 242 1.11111111111111e+02 +242 55 -2.08333333333333e+00 +242 54 2.08333333333333e+00 +242 161 -9.72222222222222e+00 +242 59 -3.47222222222222e+00 +242 160 -8.33333333333333e+00 +242 58 -2.08333333333333e+00 +242 159 -1.23707467880596e-16 +242 57 -2.08333333333333e+00 +242 158 -9.72222222222222e+00 +242 44 -3.47222222222222e+00 +242 157 -1.88759598229726e-16 +242 43 2.08333333333333e+00 +242 156 -8.33333333333333e+00 +242 42 -2.08333333333333e+00 +242 134 -9.72222222222222e+00 +242 230 -2.22222222222222e+01 +242 155 -9.72222222222222e+00 +242 41 -3.47222222222222e+00 +242 133 8.13802150667620e-16 +242 229 -1.51299057917637e-15 +242 154 8.33333333333333e+00 +242 40 2.08333333333333e+00 +242 132 8.33333333333333e+00 +242 228 -7.55417863679275e-17 +242 153 -1.22081164621868e-16 +242 39 2.08333333333333e+00 +242 143 -1.38888888888889e+00 +242 26 -3.47222222222222e+00 +242 142 -8.07513778067204e-16 +242 25 2.08333333333333e+00 +242 141 9.70360944374526e-17 +242 24 -2.08333333333333e+00 +242 227 1.11111111111111e+01 +242 167 -1.38888888888889e+00 +242 152 -9.72222222222222e+00 +242 29 -3.47222222222222e+00 +242 226 1.56634687858981e-15 +242 166 3.98119037736677e-16 +242 151 8.33333333333333e+00 +242 28 2.08333333333333e+00 +242 225 -4.44089209850063e-16 +242 165 7.10369263412503e-16 +242 150 -2.55004350968591e-16 +242 27 2.08333333333333e+00 +242 224 1.11111111111111e+01 +242 164 -1.38888888888889e+00 +242 149 -9.72222222222222e+00 +242 14 -3.47222222222222e+00 +242 223 2.66453525910038e-15 +242 163 -5.49798921667399e-16 +242 148 -6.07153216591882e-17 +242 13 -2.08333333333333e+00 +242 222 1.28358695200559e-15 +242 162 2.53269627492614e-16 +242 147 8.33333333333333e+00 +242 12 2.08333333333333e+00 +242 209 1.11111111111111e+01 +242 56 -3.47222222222222e+00 +242 221 1.11111111111111e+01 +242 140 -1.38888888888889e+00 +242 125 -9.72222222222222e+00 +242 218 -2.22222222222222e+01 +242 146 -9.72222222222222e+00 +242 11 -3.47222222222222e+00 +242 208 2.66453525910038e-15 +242 241 -3.55271367880050e-15 +242 220 1.27742055214958e-15 +242 139 -7.56447855743136e-16 +242 124 -1.49186218934005e-16 +242 217 -1.24401357270987e-15 +242 145 -8.33333333333333e+00 +242 10 -2.08333333333333e+00 +242 207 -3.54520557875604e-16 +242 240 -8.88178419700125e-16 +242 219 -4.44089209850063e-16 +242 138 3.45101551502136e-16 +242 123 -8.33333333333333e+00 +242 216 -1.41813644161104e-16 +242 144 2.16840434497101e-17 +242 9 -2.08333333333333e+00 diff --git a/external/hypre/src/test/TEST_ij/data/beam_hex_dof459_np2/A.IJ.00001 b/external/hypre/src/test/TEST_ij/data/beam_hex_dof459_np2/A.IJ.00001 new file mode 100644 index 00000000..ae4d64a0 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/data/beam_hex_dof459_np2/A.IJ.00001 @@ -0,0 +1,10142 @@ +243 458 243 458 +243 243 5.55555555555555e-01 +243 407 -8.33333333333334e-02 +243 404 -1.21871100450949e-17 +243 317 -7.15747075594620e-17 +243 451 -4.16666666666667e-02 +243 406 -7.44372554047079e-18 +243 403 -8.33333333333334e-02 +243 316 -4.50100602676726e-17 +243 450 -6.94444444444444e-02 +243 405 -9.72222222222222e-02 +243 402 -9.72222222222221e-02 +243 315 -1.11111111111111e-01 +243 449 4.16666666666667e-02 +243 395 1.25496401465197e-17 +243 311 5.25651706407074e-17 +243 392 8.33333333333333e-02 +243 389 -1.47451495458029e-17 +243 296 4.16333634234434e-17 +243 245 1.11022302462516e-16 +243 293 -4.60260762879042e-17 +243 448 4.16666666666667e-02 +243 394 7.67073037033494e-18 +243 310 1.38777878078145e-17 +243 391 -8.40256683676266e-18 +243 388 8.33333333333334e-02 +243 295 2.84823298843731e-17 +243 244 4.16333634234434e-17 +243 292 -1.44622405414199e-17 +243 447 -6.94444444444444e-02 +243 393 -2.77777777777779e-02 +243 309 1.11111111111111e-01 +243 390 -9.72222222222223e-02 +243 387 -9.72222222222223e-02 +243 294 1.11111111111111e-01 +243 452 -4.16666666666667e-02 +243 291 -1.11111111111111e-01 +244 244 5.55555555555556e-01 +244 407 -2.01390553539182e-17 +244 404 -3.32629838386764e-17 +244 317 4.16666666666667e-02 +244 451 -6.94444444444445e-02 +244 406 -1.38888888888889e-02 +244 403 -9.72222222222224e-02 +244 316 5.55555555555557e-02 +244 450 -4.16666666666667e-02 +244 405 -7.38612730005750e-18 +244 402 -8.33333333333334e-02 +244 315 -4.19975875907627e-17 +244 449 -4.16666666666666e-02 +244 395 -1.66666666666667e-01 +244 311 2.20702904736580e-17 +244 392 -3.38813178901720e-19 +244 389 3.39541627236359e-17 +244 296 -3.51963365407843e-18 +244 245 1.66666666666667e-01 +244 293 4.16666666666666e-02 +244 448 -6.94444444444444e-02 +244 394 -1.94444444444445e-01 +244 310 1.11111111111111e-01 +244 391 -1.38888888888889e-02 +244 388 -9.72222222222221e-02 +244 295 -2.22222222222222e-01 +244 452 -4.16666666666668e-02 +244 292 5.55555555555554e-02 +244 447 4.16666666666667e-02 +244 393 9.03953561309789e-18 +244 309 1.38777878078145e-17 +244 390 -9.91536768055884e-18 +244 387 8.33333333333334e-02 +244 294 3.21883107868475e-17 +244 243 4.16333634234434e-17 +244 291 -1.47330793263045e-17 +245 245 5.55555555555556e-01 +245 407 -9.72222222222225e-02 +245 404 -1.38888888888889e-02 +245 317 5.55555555555557e-02 +245 451 -4.16666666666668e-02 +245 406 -2.04287406218792e-17 +245 403 -3.29326409892472e-17 +245 316 4.16666666666667e-02 +245 450 -4.16666666666667e-02 +245 405 -8.33333333333334e-02 +245 402 -1.29833210155139e-17 +245 315 -7.26957556651531e-17 +245 449 -6.94444444444444e-02 +245 395 -1.94444444444445e-01 +245 311 -2.22222222222222e-01 +245 392 -9.72222222222221e-02 +245 389 -1.38888888888889e-02 +245 296 1.11111111111111e-01 +245 452 -6.94444444444445e-02 +245 293 5.55555555555554e-02 +245 448 -4.16666666666666e-02 +245 394 -1.66666666666667e-01 +245 310 1.94944632810577e-17 +245 391 5.86146799499976e-19 +245 388 3.28648783534669e-17 +245 295 -8.12643409595776e-18 +245 244 1.66666666666667e-01 +245 292 4.16666666666666e-02 +245 447 4.16666666666667e-02 +245 393 1.45554141656179e-17 +245 309 4.70810558237094e-17 +245 390 8.33333333333333e-02 +245 387 -1.33424629851497e-17 +245 294 4.16333634234434e-17 +245 243 1.11022302462516e-16 +245 291 -4.49395447748137e-17 +246 246 5.55555555555555e-01 +246 422 -8.33333333333334e-02 +246 419 -1.58733974315456e-17 +246 341 -2.12969493928149e-17 +246 454 -4.16666666666667e-02 +246 421 3.34408607575998e-18 +246 418 -8.33333333333334e-02 +246 340 1.11545768823919e-17 +246 453 -6.94444444444444e-02 +246 420 -9.72222222222223e-02 +246 417 -9.72222222222222e-02 +246 339 -1.11111111111111e-01 +246 452 4.16666666666667e-02 +246 410 1.51788304147971e-18 +246 335 -2.45639554703747e-18 +246 407 8.33333333333334e-02 +246 404 6.83047368665868e-18 +246 320 6.93889390390723e-18 +246 248 0.00000000000000e+00 +246 317 6.22738622821362e-18 +246 451 4.16666666666667e-02 +246 409 -4.11996825544492e-18 +246 334 -6.93889390390723e-18 +246 406 3.79470760369927e-18 +246 403 8.33333333333334e-02 +246 319 -1.18889544476614e-17 +246 247 0.00000000000000e+00 +246 316 8.32125167382625e-18 +246 450 -6.94444444444445e-02 +246 408 -2.77777777777777e-02 +246 333 1.11111111111111e-01 +246 405 -9.72222222222222e-02 +246 402 -9.72222222222222e-02 +246 318 1.11111111111111e-01 +246 455 -4.16666666666667e-02 +246 315 -1.11111111111111e-01 +247 247 5.55555555555556e-01 +247 422 1.40268656065312e-17 +247 419 -3.78488202151112e-17 +247 341 4.16666666666667e-02 +247 454 -6.94444444444444e-02 +247 421 -1.38888888888889e-02 +247 418 -9.72222222222221e-02 +247 340 5.55555555555555e-02 +247 453 -4.16666666666667e-02 +247 420 3.15773882736403e-18 +247 417 -8.33333333333334e-02 +247 339 1.27021060770255e-17 +247 452 -4.16666666666667e-02 +247 410 -1.66666666666667e-01 +247 335 -8.52115144937826e-19 +247 407 -1.09504419421036e-17 +247 404 1.56192875473693e-18 +247 320 1.01290317415037e-17 +247 248 1.66666666666667e-01 +247 317 4.16666666666667e-02 +247 451 -6.94444444444445e-02 +247 409 -1.94444444444444e-01 +247 334 1.11111111111111e-01 +247 406 -1.38888888888889e-02 +247 403 -9.72222222222222e-02 +247 319 -2.22222222222222e-01 +247 455 -4.16666666666667e-02 +247 316 5.55555555555555e-02 +247 450 4.16666666666667e-02 +247 408 -4.42320605056196e-18 +247 333 0.00000000000000e+00 +247 405 4.34019682173103e-18 +247 402 8.33333333333334e-02 +247 318 -1.61016728108306e-17 +247 246 0.00000000000000e+00 +247 315 1.10588621593521e-17 +248 248 5.55555555555555e-01 +248 422 -9.72222222222223e-02 +248 419 -1.38888888888889e-02 +248 341 5.55555555555556e-02 +248 454 -4.16666666666667e-02 +248 421 1.27292111313376e-17 +248 418 -3.80690487813973e-17 +248 340 4.16666666666667e-02 +248 453 -4.16666666666667e-02 +248 420 -8.33333333333334e-02 +248 417 -1.53008031592017e-17 +248 339 -2.15281893874153e-17 +248 452 -6.94444444444445e-02 +248 410 -1.94444444444444e-01 +248 335 -2.22222222222222e-01 +248 407 -9.72222222222222e-02 +248 404 -1.38888888888889e-02 +248 320 1.11111111111111e-01 +248 455 -6.94444444444445e-02 +248 317 5.55555555555555e-02 +248 451 -4.16666666666667e-02 +248 409 -1.66666666666667e-01 +248 334 -3.38622596488588e-18 +248 406 -1.31561157367538e-17 +248 403 3.17129135452010e-18 +248 319 1.51940770078476e-17 +248 247 1.66666666666667e-01 +248 316 4.16666666666667e-02 +248 450 4.16666666666667e-02 +248 408 2.90871114087127e-18 +248 333 1.02533338265133e-18 +248 405 8.33333333333334e-02 +248 402 6.70003061278152e-18 +248 318 6.93889390390723e-18 +248 246 0.00000000000000e+00 +248 315 6.78346335808606e-18 +249 249 5.55555555555555e-01 +249 437 -8.33333333333333e-02 +249 434 8.36868551887249e-18 +249 365 3.66822440885052e-17 +249 457 -4.16666666666667e-02 +249 436 3.80148386727730e-18 +249 433 -8.33333333333334e-02 +249 364 -1.41899194488777e-18 +249 456 -6.94444444444444e-02 +249 435 -9.72222222222222e-02 +249 432 -9.72222222222222e-02 +249 363 -1.11111111111111e-01 +249 455 4.16666666666667e-02 +249 425 2.31748214368777e-18 +249 359 -5.67156320822534e-17 +249 422 8.33333333333334e-02 +249 419 5.14996031930615e-18 +249 344 -2.77555756156289e-17 +249 251 -1.38777878078145e-16 +249 341 7.92585669404794e-17 +249 454 4.16666666666667e-02 +249 424 -1.06929439261383e-17 +249 358 -1.38777878078145e-17 +249 421 8.89045781438114e-18 +249 418 8.33333333333334e-02 +249 343 -1.83890852848909e-17 +249 250 -5.55111512312578e-17 +249 340 4.02747225760475e-17 +249 453 -6.94444444444444e-02 +249 423 -2.77777777777778e-02 +249 357 1.11111111111111e-01 +249 420 -9.72222222222222e-02 +249 417 -9.72222222222221e-02 +249 342 1.11111111111111e-01 +249 458 -4.16666666666667e-02 +249 339 -1.11111111111111e-01 +250 250 5.55555555555556e-01 +250 437 4.14707330975705e-18 +250 434 9.24282352043893e-18 +250 365 4.16666666666667e-02 +250 457 -6.94444444444444e-02 +250 436 -1.38888888888889e-02 +250 433 -9.72222222222222e-02 +250 364 5.55555555555555e-02 +250 456 -4.16666666666667e-02 +250 435 2.68340037690162e-18 +250 432 -8.33333333333334e-02 +250 363 2.82909004382936e-19 +250 455 -4.16666666666667e-02 +250 425 -1.66666666666667e-01 +250 359 1.54024471128722e-17 +250 422 -3.16587034365767e-17 +250 419 -1.60648268776251e-17 +250 344 -7.35436356453546e-18 +250 251 1.66666666666667e-01 +250 341 4.16666666666667e-02 +250 454 -6.94444444444445e-02 +250 424 -1.94444444444445e-01 +250 358 1.11111111111111e-01 +250 421 -1.38888888888889e-02 +250 418 -9.72222222222223e-02 +250 343 -2.22222222222222e-01 +250 458 -4.16666666666667e-02 +250 340 5.55555555555556e-02 +250 453 4.16666666666667e-02 +250 423 -6.50013083722950e-18 +250 357 -1.38777878078145e-17 +250 420 8.91417473690426e-18 +250 417 8.33333333333334e-02 +250 342 -1.72011215763667e-17 +250 249 -5.55111512312578e-17 +250 339 4.08553636613903e-17 +251 251 5.55555555555556e-01 +251 437 -9.72222222222222e-02 +251 434 -1.38888888888889e-02 +251 365 5.55555555555555e-02 +251 457 -4.16666666666667e-02 +251 436 4.54009659728305e-18 +251 433 9.13440330319037e-18 +251 364 4.16666666666667e-02 +251 456 -4.16666666666667e-02 +251 435 -8.33333333333333e-02 +251 432 6.96599895821937e-18 +251 363 3.71305362758395e-17 +251 455 -6.94444444444445e-02 +251 425 -1.94444444444444e-01 +251 359 -2.22222222222222e-01 +251 422 -9.72222222222224e-02 +251 419 -1.38888888888889e-02 +251 344 1.11111111111111e-01 +251 458 -6.94444444444444e-02 +251 341 5.55555555555556e-02 +251 454 -4.16666666666667e-02 +251 424 -1.66666666666667e-01 +251 358 2.75179828739241e-17 +251 421 -3.10403693850811e-17 +251 418 -1.63714528045311e-17 +251 343 -7.14895807482629e-18 +251 250 1.66666666666667e-01 +251 340 4.16666666666667e-02 +251 453 4.16666666666667e-02 +251 423 2.06506632540598e-18 +251 357 -6.60867810942014e-17 +251 420 8.33333333333334e-02 +251 417 3.79131947191025e-18 +251 342 -2.77555756156289e-17 +251 249 -1.24900090270330e-16 +251 339 8.11656616212224e-17 +252 252 2.77777777777778e-01 +252 440 -6.61363325216158e-18 +252 383 -2.13858878522766e-17 +252 437 8.33333333333334e-02 +252 434 8.13151629364128e-18 +252 368 -4.16666666666667e-02 +252 254 -8.33333333333334e-02 +252 365 4.34765071166687e-17 +252 457 4.16666666666667e-02 +252 439 -5.42101086242752e-19 +252 382 -4.16666666666667e-02 +252 436 1.40946282423116e-18 +252 433 8.33333333333334e-02 +252 367 2.62919026827735e-18 +252 253 -8.33333333333334e-02 +252 364 -2.26327203506349e-18 +252 456 -6.94444444444444e-02 +252 438 -1.38888888888889e-02 +252 381 5.55555555555555e-02 +252 435 -9.72222222222223e-02 +252 432 -9.72222222222222e-02 +252 366 5.55555555555556e-02 +252 458 4.16666666666667e-02 +252 363 -1.11111111111111e-01 +253 253 2.77777777777778e-01 +253 440 -8.33333333333334e-02 +253 383 2.25514051876985e-17 +253 437 -4.06575814682064e-18 +253 434 -1.07928938139143e-17 +253 368 -1.18042511529359e-17 +253 254 8.33333333333334e-02 +253 365 4.16666666666667e-02 +253 457 -6.94444444444444e-02 +253 439 -9.72222222222223e-02 +253 382 5.55555555555556e-02 +253 436 -1.38888888888889e-02 +253 433 -9.72222222222222e-02 +253 367 -1.11111111111111e-01 +253 458 -4.16666666666667e-02 +253 364 5.55555555555555e-02 +253 456 4.16666666666667e-02 +253 438 -8.94466792300541e-19 +253 381 -4.16666666666667e-02 +253 435 1.10622502911412e-18 +253 432 8.33333333333334e-02 +253 366 3.99799551104030e-19 +253 252 -8.33333333333334e-02 +253 363 -1.26970238793420e-18 +254 254 2.77777777777778e-01 +254 440 -9.72222222222222e-02 +254 383 -1.11111111111111e-01 +254 437 -9.72222222222223e-02 +254 434 -1.38888888888889e-02 +254 368 5.55555555555556e-02 +254 458 -6.94444444444445e-02 +254 365 5.55555555555555e-02 +254 457 -4.16666666666667e-02 +254 439 -8.33333333333334e-02 +254 382 2.27953506765077e-17 +254 436 -4.54517879496658e-18 +254 433 -8.94466792300541e-18 +254 367 -1.21430643318376e-17 +254 253 8.33333333333334e-02 +254 364 4.16666666666667e-02 +254 456 4.16666666666667e-02 +254 438 -2.64274279543342e-18 +254 381 -2.18551441050555e-17 +254 435 8.33333333333334e-02 +254 432 6.86604907044336e-18 +254 366 -4.16666666666667e-02 +254 252 -8.33333333333334e-02 +254 363 4.30690842690394e-17 +255 255 5.55555555555555e-01 +255 452 -4.16666666666667e-02 +255 323 3.07642366442762e-18 +255 404 -1.36880524276295e-17 +255 412 -9.14795583034644e-18 +255 451 4.16666666666667e-02 +255 322 -4.73355892243593e-17 +255 403 8.33333333333333e-02 +255 411 -9.72222222222221e-02 +255 450 -6.94444444444444e-02 +255 321 -1.11111111111111e-01 +255 402 -9.72222222222220e-02 +255 398 8.33333333333334e-02 +255 314 4.11996825544492e-18 +255 395 1.23327997120226e-17 +255 449 4.16666666666667e-02 +255 299 -1.58293517182884e-17 +255 257 1.38777878078145e-17 +255 296 3.46944695195361e-17 +255 389 -1.12892551210053e-17 +255 397 -9.10729824887824e-18 +255 313 2.77555756156289e-17 +255 394 1.08928437016903e-17 +255 448 -4.16666666666667e-02 +255 298 -1.66153982933404e-17 +255 256 6.93889390390723e-17 +255 295 3.21902166109788e-17 +255 388 -8.33333333333334e-02 +255 396 -9.72222222222222e-02 +255 312 1.11111111111111e-01 +255 393 -2.77777777777779e-02 +255 447 -6.94444444444445e-02 +255 297 -1.11111111111111e-01 +255 413 -8.33333333333334e-02 +255 294 1.11111111111111e-01 +255 387 -9.72222222222223e-02 +256 256 5.55555555555555e-01 +256 452 4.16666666666667e-02 +256 323 -4.16666666666667e-02 +256 404 1.33898968301960e-17 +256 412 -1.38888888888888e-02 +256 451 -6.94444444444444e-02 +256 322 5.55555555555557e-02 +256 403 -9.72222222222221e-02 +256 411 -7.26415455565288e-18 +256 450 4.16666666666667e-02 +256 321 -4.72170046117437e-17 +256 402 8.33333333333333e-02 +256 398 2.27682456221956e-18 +256 314 -1.99222149194211e-17 +256 395 1.66666666666667e-01 +256 449 4.16666666666667e-02 +256 299 -4.16666666666667e-02 +256 257 -1.66666666666667e-01 +256 296 -3.21872519956634e-19 +256 389 -7.86046575051991e-18 +256 397 -1.38888888888889e-02 +256 313 1.11111111111111e-01 +256 394 -1.94444444444445e-01 +256 448 -6.94444444444444e-02 +256 298 5.55555555555555e-02 +256 413 -2.87313575708659e-17 +256 295 -2.22222222222222e-01 +256 388 -9.72222222222222e-02 +256 396 -9.87979229677416e-18 +256 312 2.77555756156289e-17 +256 393 5.93600689435814e-18 +256 447 -4.16666666666667e-02 +256 297 -1.81773270480773e-17 +256 255 5.55111512312578e-17 +256 294 3.07032502720739e-17 +256 387 -8.33333333333334e-02 +257 257 5.55555555555556e-01 +257 452 -6.94444444444445e-02 +257 323 5.55555555555557e-02 +257 404 -1.38888888888888e-02 +257 412 -2.97477971075710e-17 +257 451 4.16666666666667e-02 +257 322 -4.16666666666667e-02 +257 403 1.43521262582769e-17 +257 411 -8.33333333333334e-02 +257 450 -4.16666666666667e-02 +257 321 1.84314369322536e-18 +257 402 -1.30104260698261e-17 +257 398 -9.72222222222222e-02 +257 314 -2.22222222222222e-01 +257 395 -1.94444444444445e-01 +257 449 -6.94444444444444e-02 +257 299 5.55555555555556e-02 +257 413 -9.72222222222222e-02 +257 296 1.11111111111111e-01 +257 389 -1.38888888888889e-02 +257 397 1.62630325872826e-18 +257 313 -1.62325394011814e-17 +257 394 1.66666666666667e-01 +257 448 4.16666666666667e-02 +257 298 -4.16666666666667e-02 +257 256 -1.66666666666667e-01 +257 295 -5.49787910239085e-18 +257 388 -6.72713566709365e-18 +257 396 8.33333333333334e-02 +257 312 3.29326409892472e-18 +257 393 1.01203496537944e-17 +257 447 4.16666666666667e-02 +257 297 -1.67915811463692e-17 +257 255 1.38777878078145e-17 +257 294 3.46944695195361e-17 +257 387 -1.13756524816253e-17 +258 258 5.55555555555556e-01 +258 455 -4.16666666666667e-02 +258 347 -5.30039337073851e-17 +258 419 -1.68915310341453e-17 +258 427 2.90024081139872e-18 +258 454 4.16666666666667e-02 +258 346 1.15670819277047e-17 +258 418 8.33333333333334e-02 +258 426 -9.72222222222223e-02 +258 453 -6.94444444444444e-02 +258 345 -1.11111111111111e-01 +258 417 -9.72222222222223e-02 +258 413 8.33333333333333e-02 +258 338 3.75133951679985e-17 +258 410 3.26615904461258e-18 +258 452 4.16666666666667e-02 +258 323 -2.10335221462188e-17 +258 260 6.93889390390723e-17 +258 320 6.93889390390723e-18 +258 404 1.05167610731094e-17 +258 412 3.25260651745651e-18 +258 337 -1.38777878078145e-17 +258 409 -4.18095462764723e-18 +258 451 -4.16666666666667e-02 +258 322 9.62229428080885e-18 +258 259 -1.38777878078145e-17 +258 319 -1.34199664998235e-17 +258 403 -8.33333333333334e-02 +258 411 -9.72222222222222e-02 +258 336 1.11111111111111e-01 +258 408 -2.77777777777777e-02 +258 450 -6.94444444444444e-02 +258 321 -1.11111111111111e-01 +258 428 -8.33333333333333e-02 +258 318 1.11111111111111e-01 +258 402 -9.72222222222222e-02 +259 259 5.55555555555555e-01 +259 455 4.16666666666667e-02 +259 347 -4.16666666666667e-02 +259 419 1.52194879962653e-17 +259 427 -1.38888888888889e-02 +259 454 -6.94444444444444e-02 +259 346 5.55555555555555e-02 +259 418 -9.72222222222222e-02 +259 426 3.03576608295941e-18 +259 453 4.16666666666667e-02 +259 345 9.79847713383775e-18 +259 417 8.33333333333334e-02 +259 413 -5.74627151417317e-18 +259 338 -1.63443477502190e-17 +259 410 1.66666666666667e-01 +259 452 4.16666666666667e-02 +259 323 -4.16666666666667e-02 +259 260 -1.66666666666667e-01 +259 320 1.68237683983649e-17 +259 404 4.30970363562988e-18 +259 412 -1.38888888888889e-02 +259 337 1.11111111111111e-01 +259 409 -1.94444444444444e-01 +259 451 -6.94444444444444e-02 +259 322 5.55555555555555e-02 +259 428 5.09575021068187e-18 +259 319 -2.22222222222222e-01 +259 403 -9.72222222222221e-02 +259 411 3.27971157176865e-18 +259 336 -1.38777878078145e-17 +259 408 -4.11996825544492e-18 +259 450 -4.16666666666667e-02 +259 321 7.81811410315719e-18 +259 258 -1.38777878078145e-17 +259 318 -1.17534291761007e-17 +259 402 -8.33333333333334e-02 +260 260 5.55555555555556e-01 +260 455 -6.94444444444445e-02 +260 347 5.55555555555555e-02 +260 419 -1.38888888888889e-02 +260 427 2.18195687212708e-18 +260 454 4.16666666666667e-02 +260 346 -4.16666666666667e-02 +260 418 1.70287503716005e-17 +260 426 -8.33333333333334e-02 +260 453 -4.16666666666667e-02 +260 345 -5.24753851482984e-17 +260 417 -1.73201297054559e-17 +260 413 -9.72222222222222e-02 +260 338 -2.22222222222222e-01 +260 410 -1.94444444444444e-01 +260 452 -6.94444444444445e-02 +260 323 5.55555555555556e-02 +260 428 -9.72222222222223e-02 +260 320 1.11111111111111e-01 +260 404 -1.38888888888889e-02 +260 412 -6.60008072500551e-18 +260 337 -1.60766853388866e-17 +260 409 1.66666666666667e-01 +260 451 4.16666666666667e-02 +260 322 -4.16666666666667e-02 +260 259 -1.66666666666667e-01 +260 319 1.86059257193880e-17 +260 403 4.37407813962121e-18 +260 411 8.33333333333334e-02 +260 336 3.80961538357094e-17 +260 408 1.22650370762423e-18 +260 450 4.16666666666667e-02 +260 321 -2.12503625807159e-17 +260 258 6.93889390390723e-17 +260 318 6.93889390390723e-18 +260 402 9.12762703961234e-18 +261 261 5.55555555555556e-01 +261 458 -4.16666666666667e-02 +261 371 -3.23905399030044e-18 +261 434 6.03934491392316e-18 +261 442 2.18195687212708e-18 +261 457 4.16666666666667e-02 +261 370 -2.91887553623832e-18 +261 433 8.33333333333334e-02 +261 441 -9.72222222222223e-02 +261 456 -6.94444444444444e-02 +261 369 -1.11111111111111e-01 +261 432 -9.72222222222222e-02 +261 428 8.33333333333334e-02 +261 362 -6.61363325216158e-18 +261 425 2.19550939928315e-18 +261 455 4.16666666666667e-02 +261 347 1.75640751942652e-17 +261 263 -5.55111512312578e-17 +261 344 -2.77555756156289e-17 +261 419 5.12285526499401e-18 +261 427 8.13151629364128e-18 +261 361 -6.93889390390723e-18 +261 424 -6.05289744107923e-18 +261 454 -4.16666666666667e-02 +261 346 3.80012861456169e-17 +261 262 -2.77555756156289e-17 +261 343 -1.37318863826499e-17 +261 418 -8.33333333333334e-02 +261 426 -9.72222222222222e-02 +261 360 1.11111111111111e-01 +261 423 -2.77777777777778e-02 +261 453 -6.94444444444444e-02 +261 345 -1.11111111111111e-01 +261 443 -8.33333333333334e-02 +261 342 1.11111111111111e-01 +261 417 -9.72222222222221e-02 +262 262 5.55555555555555e-01 +262 458 4.16666666666667e-02 +262 371 -4.16666666666667e-02 +262 434 -1.36202897918491e-17 +262 442 -1.38888888888889e-02 +262 457 -6.94444444444444e-02 +262 370 5.55555555555555e-02 +262 433 -9.72222222222222e-02 +262 441 3.25260651745651e-18 +262 456 4.16666666666667e-02 +262 369 -2.75116301268197e-18 +262 432 8.33333333333334e-02 +262 428 -2.87313575708659e-17 +262 362 -1.22785896033983e-17 +262 425 1.66666666666667e-01 +262 455 4.16666666666667e-02 +262 347 -4.16666666666667e-02 +262 263 -1.66666666666667e-01 +262 344 -2.75963334215451e-18 +262 419 3.68493213373511e-17 +262 427 -1.38888888888889e-02 +262 361 1.11111111111111e-01 +262 424 -1.94444444444445e-01 +262 454 -6.94444444444444e-02 +262 346 5.55555555555557e-02 +262 443 -9.32413868337534e-18 +262 343 -2.22222222222222e-01 +262 418 -9.72222222222221e-02 +262 426 9.14795583034644e-18 +262 360 -6.93889390390723e-18 +262 423 -1.07064964532944e-17 +262 453 -4.16666666666667e-02 +262 345 3.96021784159276e-17 +262 261 -2.77555756156289e-17 +262 342 -2.05591836957564e-17 +262 417 -8.33333333333334e-02 +263 263 5.55555555555556e-01 +263 458 -6.94444444444444e-02 +263 371 5.55555555555555e-02 +263 434 -1.38888888888889e-02 +263 442 -8.40256683676266e-18 +263 457 4.16666666666667e-02 +263 370 -4.16666666666667e-02 +263 433 -1.25835214644099e-17 +263 441 -8.33333333333334e-02 +263 456 -4.16666666666667e-02 +263 369 -5.09575021068187e-18 +263 432 5.89534931288993e-18 +263 428 -9.72222222222223e-02 +263 362 -2.22222222222222e-01 +263 425 -1.94444444444445e-01 +263 455 -6.94444444444445e-02 +263 347 5.55555555555557e-02 +263 443 -9.72222222222222e-02 +263 344 1.11111111111111e-01 +263 419 -1.38888888888888e-02 +263 427 -2.91921434941722e-17 +263 361 -1.35237280358622e-17 +263 424 1.66666666666667e-01 +263 454 4.16666666666667e-02 +263 346 -4.16666666666667e-02 +263 262 -1.66666666666667e-01 +263 343 -1.98629226131133e-19 +263 418 3.52450409352514e-17 +263 426 8.33333333333334e-02 +263 360 -7.04731412115578e-18 +263 423 1.95495204226293e-18 +263 453 4.16666666666667e-02 +263 345 1.59784295170051e-17 +263 261 -5.55111512312578e-17 +263 342 -2.08166817117217e-17 +263 417 5.69206140554890e-18 +264 264 2.77777777777778e-01 +264 386 6.07153216591882e-18 +264 440 -6.61363325216158e-18 +264 458 4.16666666666667e-02 +264 371 -1.62630325872826e-18 +264 266 -8.33333333333334e-02 +264 368 -4.16666666666667e-02 +264 434 9.85268724246202e-18 +264 442 1.95156391047391e-18 +264 385 4.16666666666667e-02 +264 439 -1.09775469964157e-18 +264 457 -4.16666666666667e-02 +264 370 -9.35124373768748e-19 +264 265 8.33333333333334e-02 +264 367 1.31967733182220e-18 +264 433 -8.33333333333334e-02 +264 441 -9.72222222222223e-02 +264 384 5.55555555555555e-02 +264 438 -1.38888888888889e-02 +264 456 -6.94444444444444e-02 +264 369 -1.11111111111111e-01 +264 443 8.33333333333334e-02 +264 366 5.55555555555556e-02 +264 432 -9.72222222222222e-02 +265 265 2.77777777777778e-01 +265 386 -8.67361737988404e-18 +265 440 8.33333333333333e-02 +265 458 4.16666666666667e-02 +265 371 -4.16666666666667e-02 +265 266 -8.33333333333334e-02 +265 368 -8.56519716263549e-18 +265 434 1.79570984817912e-17 +265 442 -1.38888888888889e-02 +265 385 5.55555555555556e-02 +265 439 -9.72222222222223e-02 +265 457 -6.94444444444445e-02 +265 370 5.55555555555555e-02 +265 443 -2.60208521396521e-18 +265 367 -1.11111111111111e-01 +265 433 -9.72222222222222e-02 +265 441 9.35124373768748e-19 +265 384 4.16666666666667e-02 +265 438 -1.40946282423116e-18 +265 456 -4.16666666666667e-02 +265 369 -3.61344255298685e-18 +265 264 8.33333333333334e-02 +265 366 2.62919026827735e-18 +265 432 -8.33333333333334e-02 +266 266 2.77777777777778e-01 +266 386 -1.11111111111111e-01 +266 440 -9.72222222222223e-02 +266 458 -6.94444444444445e-02 +266 371 5.55555555555555e-02 +266 443 -9.72222222222222e-02 +266 368 5.55555555555556e-02 +266 434 -1.38888888888889e-02 +266 442 -1.72117094882074e-18 +266 385 -8.67361737988404e-18 +266 439 8.33333333333334e-02 +266 457 4.16666666666667e-02 +266 370 -4.16666666666667e-02 +266 265 -8.33333333333334e-02 +266 367 -8.33480420098232e-18 +266 433 1.81265050712420e-17 +266 441 8.33333333333334e-02 +266 384 5.74627151417317e-18 +266 438 -6.08508469307489e-18 +266 456 4.16666666666667e-02 +266 369 -1.70761842166467e-18 +266 264 -8.33333333333334e-02 +266 366 -4.16666666666667e-02 +266 432 9.22757692738835e-18 +267 267 5.55555555555556e-01 +267 326 -7.45490637537455e-17 +267 452 4.16666666666667e-02 +267 407 8.33333333333333e-02 +267 415 -8.33333333333334e-02 +267 325 -4.46284719249346e-17 +267 451 -4.16666666666667e-02 +267 406 -8.25348903804590e-18 +267 414 -9.72222222222222e-02 +267 324 -1.11111111111111e-01 +267 450 -6.94444444444444e-02 +267 405 -9.72222222222220e-02 +267 401 -1.31188462870746e-17 +267 305 1.38777878078145e-17 +267 269 1.24900090270330e-16 +267 302 -4.26226979058364e-17 +267 449 -4.16666666666667e-02 +267 395 1.01067971266383e-17 +267 311 5.06047128842873e-17 +267 392 -8.33333333333334e-02 +267 400 8.33333333333333e-02 +267 304 3.10081821330854e-17 +267 268 6.93889390390723e-17 +267 301 -1.40946282423116e-17 +267 448 4.16666666666667e-02 +267 394 7.67073037033494e-18 +267 310 6.93889390390723e-18 +267 391 -8.36190925529445e-18 +267 399 -9.72222222222222e-02 +267 303 1.11111111111111e-01 +267 416 -1.28342432167972e-17 +267 300 -1.11111111111111e-01 +267 447 -6.94444444444445e-02 +267 393 -2.77777777777778e-02 +267 309 1.11111111111111e-01 +267 390 -9.72222222222223e-02 +268 268 5.55555555555556e-01 +268 326 -4.16666666666667e-02 +268 452 4.16666666666667e-02 +268 407 2.66578209159873e-17 +268 415 -9.72222222222224e-02 +268 325 5.55555555555557e-02 +268 451 -6.94444444444445e-02 +268 406 -1.38888888888888e-02 +268 414 -8.33333333333334e-02 +268 324 -4.39101879856629e-17 +268 450 -4.16666666666667e-02 +268 405 -8.15862134795342e-18 +268 401 4.62412226565068e-17 +268 305 -5.10354291379661e-17 +268 269 -1.66666666666667e-01 +268 302 -4.16666666666667e-02 +268 449 4.16666666666667e-02 +268 395 1.66666666666667e-01 +268 311 1.94946750392945e-17 +268 392 -2.35305752747245e-17 +268 400 -9.72222222222222e-02 +268 304 -2.22222222222222e-01 +268 416 -2.34594245071551e-17 +268 301 5.55555555555555e-02 +268 448 -6.94444444444444e-02 +268 394 -1.94444444444445e-01 +268 310 1.11111111111111e-01 +268 391 -1.38888888888889e-02 +268 399 8.33333333333333e-02 +268 303 3.64698505769812e-17 +268 267 8.32667268468867e-17 +268 300 -1.52872506320456e-17 +268 447 4.16666666666667e-02 +268 393 1.09030080970574e-17 +268 309 6.93889390390723e-18 +268 390 -9.11576857835078e-18 +269 269 5.55555555555555e-01 +269 326 5.55555555555557e-02 +269 452 -6.94444444444445e-02 +269 407 -9.72222222222220e-02 +269 415 -2.43945488809238e-17 +269 325 -4.16666666666667e-02 +269 451 4.16666666666667e-02 +269 406 2.58582218137793e-17 +269 414 -1.36609473733174e-17 +269 324 -7.49590277002166e-17 +269 450 4.16666666666667e-02 +269 405 8.33333333333333e-02 +269 401 -1.38888888888889e-02 +269 305 1.11111111111111e-01 +269 416 -1.38888888888889e-02 +269 302 5.55555555555556e-02 +269 449 -6.94444444444444e-02 +269 395 -1.94444444444445e-01 +269 311 -2.22222222222222e-01 +269 392 -9.72222222222223e-02 +269 400 4.78133158066107e-17 +269 304 -5.67850887839283e-17 +269 268 -1.66666666666667e-01 +269 301 -4.16666666666667e-02 +269 448 4.16666666666667e-02 +269 394 1.66666666666667e-01 +269 310 2.72727668356940e-17 +269 391 -2.11012847819991e-17 +269 399 -1.29020058525775e-17 +269 303 6.93889390390723e-18 +269 267 1.24900090270330e-16 +269 300 -4.54331532248262e-17 +269 447 -4.16666666666667e-02 +269 393 1.34170018845081e-17 +269 309 4.95683680733217e-17 +269 390 -8.33333333333334e-02 +270 270 5.55555555555556e-01 +270 350 -2.20025278378777e-17 +270 455 4.16666666666667e-02 +270 422 8.33333333333333e-02 +270 430 -8.33333333333333e-02 +270 349 1.25902977279879e-17 +270 454 -4.16666666666667e-02 +270 421 3.45081222711402e-18 +270 429 -9.72222222222223e-02 +270 348 -1.11111111111111e-01 +270 453 -6.94444444444444e-02 +270 420 -9.72222222222222e-02 +270 416 6.72205346941013e-18 +270 329 -1.38777878078145e-17 +270 272 1.38777878078145e-17 +270 326 8.34835672813838e-18 +270 452 -4.16666666666667e-02 +270 410 1.19939865331209e-18 +270 335 1.02194525086231e-18 +270 407 -8.33333333333333e-02 +270 415 8.33333333333333e-02 +270 328 -7.58941520739853e-18 +270 271 -1.38777878078145e-17 +270 325 1.06251812903579e-17 +270 451 4.16666666666667e-02 +270 409 -4.10641572828885e-18 +270 334 -6.93889390390723e-18 +270 406 3.88957529379175e-18 +270 414 -9.72222222222223e-02 +270 327 1.11111111111111e-01 +270 431 -1.65069780760918e-17 +270 324 -1.11111111111111e-01 +270 450 -6.94444444444444e-02 +270 408 -2.77777777777777e-02 +270 333 1.11111111111111e-01 +270 405 -9.72222222222222e-02 +271 271 5.55555555555556e-01 +271 350 -4.16666666666666e-02 +271 455 4.16666666666666e-02 +271 422 2.06506632540598e-18 +271 430 -9.72222222222222e-02 +271 349 5.55555555555555e-02 +271 454 -6.94444444444444e-02 +271 421 -1.38888888888889e-02 +271 429 -8.33333333333333e-02 +271 348 1.50704101975485e-17 +271 453 -4.16666666666667e-02 +271 420 2.84603070277445e-18 +271 416 1.01779478942077e-17 +271 329 -8.84302396933490e-19 +271 272 -1.66666666666667e-01 +271 326 -4.16666666666667e-02 +271 452 4.16666666666667e-02 +271 410 1.66666666666667e-01 +271 335 8.97854924089558e-20 +271 407 -1.86177841806495e-18 +271 415 -9.72222222222223e-02 +271 328 -2.22222222222222e-01 +271 431 -3.39219754716402e-17 +271 325 5.55555555555555e-02 +271 451 -6.94444444444444e-02 +271 409 -1.94444444444444e-01 +271 334 1.11111111111111e-01 +271 406 -1.38888888888889e-02 +271 414 8.33333333333334e-02 +271 327 -9.28348110190713e-18 +271 270 -1.38777878078145e-17 +271 324 9.31058615621927e-18 +271 450 4.16666666666667e-02 +271 408 -3.93700913883799e-18 +271 333 0.00000000000000e+00 +271 405 3.98783111567325e-18 +272 272 5.55555555555555e-01 +272 350 5.55555555555554e-02 +272 455 -6.94444444444444e-02 +272 422 -9.72222222222222e-02 +272 430 -3.17671236538253e-17 +272 349 -4.16666666666666e-02 +272 454 4.16666666666666e-02 +272 421 1.70761842166467e-18 +272 429 -1.64798730217797e-17 +272 348 -2.21854869544846e-17 +272 453 4.16666666666667e-02 +272 420 8.33333333333333e-02 +272 416 -1.38888888888889e-02 +272 329 1.11111111111111e-01 +272 431 -1.38888888888889e-02 +272 326 5.55555555555555e-02 +272 452 -6.94444444444444e-02 +272 410 -1.94444444444444e-01 +272 335 -2.22222222222222e-01 +272 407 -9.72222222222222e-02 +272 415 6.72205346941013e-18 +272 328 2.30392961653170e-18 +272 271 -1.66666666666667e-01 +272 325 -4.16666666666667e-02 +272 451 4.16666666666667e-02 +272 409 1.66666666666667e-01 +272 334 3.48808167679321e-18 +272 406 2.24971950790742e-18 +272 414 6.43745039913268e-18 +272 327 -1.38777878078145e-17 +272 270 1.38777878078145e-17 +272 324 8.34496859634937e-18 +272 450 -4.16666666666667e-02 +272 408 1.08420217248550e-18 +272 333 -1.14180041289880e-18 +272 405 -8.33333333333333e-02 +273 273 5.55555555555556e-01 +273 374 3.57329319128699e-17 +273 458 4.16666666666667e-02 +273 437 8.33333333333334e-02 +273 445 -8.33333333333334e-02 +273 373 -3.23905399030044e-18 +273 457 -4.16666666666667e-02 +273 436 2.75963334215451e-18 +273 444 -9.72222222222222e-02 +273 372 -1.11111111111111e-01 +273 456 -6.94444444444444e-02 +273 435 -9.72222222222222e-02 +273 431 2.05998412772246e-18 +273 353 0.00000000000000e+00 +273 275 -1.11022302462516e-16 +273 350 8.00412253837424e-17 +273 455 -4.16666666666667e-02 +273 425 1.94309358100136e-18 +273 359 -6.17789832827028e-17 +273 422 -8.33333333333333e-02 +273 430 8.33333333333334e-02 +273 352 -2.56955914879065e-17 +273 274 -5.55111512312578e-17 +273 349 4.73796349376165e-17 +273 454 4.16666666666667e-02 +273 424 -1.02728155843002e-17 +273 358 -1.38777878078145e-17 +273 421 9.28348110190713e-18 +273 429 -9.72222222222223e-02 +273 351 1.11111111111111e-01 +273 446 6.95244643106330e-18 +273 348 -1.11111111111111e-01 +273 453 -6.94444444444445e-02 +273 423 -2.77777777777778e-02 +273 357 1.11111111111111e-01 +273 420 -9.72222222222221e-02 +274 274 5.55555555555556e-01 +274 374 -4.16666666666667e-02 +274 458 4.16666666666667e-02 +274 437 9.01751275646928e-18 +274 445 -9.72222222222223e-02 +274 373 5.55555555555556e-02 +274 457 -6.94444444444444e-02 +274 436 -1.38888888888889e-02 +274 444 -8.33333333333334e-02 +274 372 -5.96311194867027e-18 +274 456 -4.16666666666667e-02 +274 435 2.38524477946811e-18 +274 431 -5.47522097105180e-18 +274 353 -3.70644677059537e-17 +274 275 -1.66666666666667e-01 +274 350 -4.16666666666667e-02 +274 455 4.16666666666667e-02 +274 425 1.66666666666667e-01 +274 359 2.42789288836236e-17 +274 422 1.32509834268463e-17 +274 430 -9.72222222222224e-02 +274 352 -2.22222222222222e-01 +274 446 1.06793913989822e-17 +274 349 5.55555555555557e-02 +274 454 -6.94444444444445e-02 +274 424 -1.94444444444445e-01 +274 358 1.11111111111111e-01 +274 421 -1.38888888888888e-02 +274 429 8.33333333333334e-02 +274 351 -2.00577401909818e-17 +274 273 -5.55111512312578e-17 +274 348 4.61192499121021e-17 +274 453 4.16666666666667e-02 +274 423 -6.70511281046504e-18 +274 357 -1.38777878078145e-17 +274 420 8.93111539584934e-18 +275 275 5.55555555555555e-01 +275 374 5.55555555555555e-02 +275 458 -6.94444444444444e-02 +275 437 -9.72222222222223e-02 +275 445 9.75781955236954e-18 +275 373 -4.16666666666667e-02 +275 457 4.16666666666667e-02 +275 436 1.03134731657684e-17 +275 444 8.23993651088983e-18 +275 372 3.67680061744147e-17 +275 456 4.16666666666667e-02 +275 435 8.33333333333334e-02 +275 431 -1.38888888888889e-02 +275 353 1.11111111111111e-01 +275 446 -1.38888888888889e-02 +275 350 5.55555555555558e-02 +275 455 -6.94444444444445e-02 +275 425 -1.94444444444444e-01 +275 359 -2.22222222222222e-01 +275 422 -9.72222222222220e-02 +275 430 -7.04731412115578e-18 +275 352 -3.65647182670736e-17 +275 274 -1.66666666666667e-01 +275 349 -4.16666666666667e-02 +275 454 4.16666666666667e-02 +275 424 1.66666666666667e-01 +275 358 1.37202396796252e-17 +275 421 1.45147565841497e-17 +275 429 2.31748214368777e-18 +275 351 0.00000000000000e+00 +275 273 -1.11022302462516e-16 +275 348 7.72239938011746e-17 +275 453 -4.16666666666667e-02 +275 423 2.30392961653170e-18 +275 357 -5.93194113621132e-17 +275 420 -8.33333333333333e-02 +276 276 2.77777777777778e-01 +276 377 4.16666666666667e-02 +276 278 8.33333333333333e-02 +276 374 4.20263867109694e-17 +276 458 -4.16666666666667e-02 +276 440 -2.64274279543342e-18 +276 383 -2.09352663243373e-17 +276 437 -8.33333333333333e-02 +276 445 8.33333333333333e-02 +276 376 2.60208521396521e-18 +276 277 -8.33333333333333e-02 +276 373 -7.58941520739853e-19 +276 457 4.16666666666667e-02 +276 439 -9.75781955236954e-19 +276 382 -4.16666666666667e-02 +276 436 1.82959116606929e-18 +276 444 -9.72222222222222e-02 +276 375 5.55555555555555e-02 +276 446 6.93889390390723e-18 +276 372 -1.11111111111111e-01 +276 456 -6.94444444444444e-02 +276 438 -1.38888888888889e-02 +276 381 5.55555555555555e-02 +276 435 -9.72222222222222e-02 +277 277 2.77777777777778e-01 +277 377 -1.48535697630514e-17 +277 278 -8.33333333333333e-02 +277 374 -4.16666666666667e-02 +277 458 4.16666666666667e-02 +277 440 8.33333333333334e-02 +277 383 2.28089032036638e-17 +277 437 -2.20228566286118e-18 +277 445 -9.72222222222222e-02 +277 376 -1.11111111111111e-01 +277 446 -8.57874968979155e-18 +277 373 5.55555555555556e-02 +277 457 -6.94444444444444e-02 +277 439 -9.72222222222223e-02 +277 382 5.55555555555556e-02 +277 436 -1.38888888888889e-02 +277 444 8.33333333333334e-02 +277 375 6.50521303491303e-19 +277 276 -8.33333333333333e-02 +277 372 -2.57498015965307e-18 +277 456 4.16666666666667e-02 +277 438 0.00000000000000e+00 +277 381 -4.16666666666667e-02 +277 435 1.32475952950573e-18 +278 278 2.77777777777778e-01 +278 377 5.55555555555555e-02 +278 446 -1.38888888888889e-02 +278 374 5.55555555555556e-02 +278 458 -6.94444444444444e-02 +278 440 -9.72222222222222e-02 +278 383 -1.11111111111111e-01 +278 437 -9.72222222222221e-02 +278 445 -7.80625564189563e-18 +278 376 -1.47451495458029e-17 +278 277 -8.33333333333333e-02 +278 373 -4.16666666666667e-02 +278 457 4.16666666666667e-02 +278 439 8.33333333333333e-02 +278 382 2.26598254049470e-17 +278 436 -2.53432257818487e-18 +278 444 6.57297567069337e-18 +278 375 4.16666666666667e-02 +278 276 8.33333333333333e-02 +278 372 4.19772588000286e-17 +278 456 -4.16666666666667e-02 +278 438 -6.61363325216158e-18 +278 381 -2.13858878522766e-17 +278 435 -8.33333333333333e-02 +279 279 5.55555555555556e-01 +279 416 -1.40268656065312e-17 +279 413 8.33333333333333e-02 +279 452 4.16666666666667e-02 +279 331 -4.45607092891542e-17 +279 415 8.33333333333333e-02 +279 412 -8.71427496135224e-18 +279 451 4.16666666666667e-02 +279 330 -1.11111111111111e-01 +279 414 -9.72222222222221e-02 +279 411 -9.72222222222221e-02 +279 450 -6.94444444444444e-02 +279 308 -1.47451495458029e-17 +279 281 0.00000000000000e+00 +279 305 6.93889390390723e-18 +279 401 -1.02999206386123e-17 +279 398 -8.33333333333334e-02 +279 314 -6.77626357803440e-20 +279 395 1.09775469964157e-17 +279 449 -4.16666666666667e-02 +279 307 -1.64798730217797e-17 +279 280 8.32667268468867e-17 +279 304 3.48435473182529e-17 +279 400 -8.33333333333334e-02 +279 397 -8.99887803162969e-18 +279 313 2.77555756156289e-17 +279 394 1.06793913989822e-17 +279 448 -4.16666666666667e-02 +279 306 -1.11111111111111e-01 +279 332 2.27682456221956e-18 +279 303 1.11111111111111e-01 +279 399 -9.72222222222223e-02 +279 396 -9.72222222222223e-02 +279 312 1.11111111111111e-01 +279 393 -2.77777777777778e-02 +279 447 -6.94444444444445e-02 +280 280 5.55555555555556e-01 +280 416 2.08166817117217e-17 +280 413 2.55736187435018e-17 +280 452 -4.16666666666667e-02 +280 331 5.55555555555558e-02 +280 415 -9.72222222222222e-02 +280 412 -1.38888888888888e-02 +280 451 -6.94444444444444e-02 +280 330 -4.33680868994202e-17 +280 414 8.33333333333333e-02 +280 411 -7.58941520739853e-18 +280 450 4.16666666666667e-02 +280 308 4.16666666666667e-02 +280 281 1.66666666666667e-01 +280 305 -4.42083435830964e-17 +280 401 3.46944695195361e-18 +280 398 -2.11825999449355e-17 +280 314 -1.62291512693924e-17 +280 395 -1.66666666666667e-01 +280 449 -4.16666666666667e-02 +280 307 5.55555555555556e-02 +280 332 4.16666666666667e-02 +280 304 -2.22222222222222e-01 +280 400 -9.72222222222222e-02 +280 397 -1.38888888888889e-02 +280 313 1.11111111111111e-01 +280 394 -1.94444444444445e-01 +280 448 -6.94444444444445e-02 +280 306 -1.65882932390282e-17 +280 279 8.32667268468867e-17 +280 303 3.18755438710738e-17 +280 399 -8.33333333333334e-02 +280 396 -9.31058615621927e-18 +280 312 2.77555756156289e-17 +280 393 8.30769914667018e-18 +280 447 -4.16666666666667e-02 +281 281 5.55555555555556e-01 +281 416 -1.38888888888888e-02 +281 413 -9.72222222222223e-02 +281 452 -6.94444444444444e-02 +281 331 4.16666666666667e-02 +281 415 2.38253427403690e-17 +281 412 2.73218947466347e-17 +281 451 -4.16666666666667e-02 +281 330 1.73472347597681e-18 +281 414 -1.52872506320456e-17 +281 411 8.33333333333333e-02 +281 450 4.16666666666667e-02 +281 308 5.55555555555554e-02 +281 332 5.55555555555558e-02 +281 305 1.11111111111111e-01 +281 401 -1.38888888888889e-02 +281 398 -9.72222222222222e-02 +281 314 -2.22222222222222e-01 +281 395 -1.94444444444445e-01 +281 449 -6.94444444444445e-02 +281 307 4.16666666666667e-02 +281 280 1.66666666666667e-01 +281 304 -4.74575619687639e-17 +281 400 6.28837260041593e-18 +281 397 -2.17924636669586e-17 +281 313 -1.99086623922651e-17 +281 394 -1.66666666666667e-01 +281 448 -4.16666666666667e-02 +281 306 -1.53956708492942e-17 +281 279 0.00000000000000e+00 +281 303 6.93889390390723e-18 +281 399 -1.04896560187973e-17 +281 396 -8.33333333333334e-02 +281 312 4.98732999343332e-18 +281 393 1.35118695746006e-17 +281 447 -4.16666666666667e-02 +282 282 5.55555555555555e-01 +282 431 -1.79299934274790e-17 +282 428 8.33333333333334e-02 +282 455 4.16666666666667e-02 +282 355 1.34441069388203e-17 +282 430 8.33333333333334e-02 +282 427 2.45300741524845e-18 +282 454 4.16666666666667e-02 +282 354 -1.11111111111111e-01 +282 429 -9.72222222222223e-02 +282 426 -9.72222222222222e-02 +282 453 -6.94444444444444e-02 +282 332 -1.99493199737333e-17 +282 284 4.16333634234434e-17 +282 329 -1.38777878078145e-17 +282 416 8.45677694538693e-18 +282 413 -8.33333333333334e-02 +282 338 3.10488397145536e-17 +282 410 1.27054942088145e-18 +282 452 -4.16666666666667e-02 +282 331 5.20417042793042e-18 +282 283 -4.16333634234434e-17 +282 328 -9.17506088465858e-18 +282 415 -8.33333333333334e-02 +282 412 4.98732999343332e-18 +282 337 -1.38777878078145e-17 +282 409 -3.87941089842470e-18 +282 451 -4.16666666666667e-02 +282 330 -1.11111111111111e-01 +282 356 -5.24753851482984e-17 +282 327 1.11111111111111e-01 +282 414 -9.72222222222223e-02 +282 411 -9.72222222222222e-02 +282 336 1.11111111111111e-01 +282 408 -2.77777777777777e-02 +282 450 -6.94444444444444e-02 +283 283 5.55555555555555e-01 +283 431 1.88651178012478e-17 +283 428 -1.14654379740342e-17 +283 455 -4.16666666666667e-02 +283 355 5.55555555555555e-02 +283 430 -9.72222222222223e-02 +283 427 -1.38888888888888e-02 +283 454 -6.94444444444444e-02 +283 354 1.56125112837913e-17 +283 429 8.33333333333334e-02 +283 426 2.60208521396521e-18 +283 453 4.16666666666667e-02 +283 332 4.16666666666667e-02 +283 284 1.66666666666667e-01 +283 329 2.31748214368777e-18 +283 416 1.00830802041152e-17 +283 413 -2.16840434497101e-19 +283 338 -1.23903979524359e-17 +283 410 -1.66666666666667e-01 +283 452 -4.16666666666667e-02 +283 331 5.55555555555555e-02 +283 356 4.16666666666667e-02 +283 328 -2.22222222222222e-01 +283 415 -9.72222222222222e-02 +283 412 -1.38888888888889e-02 +283 337 1.11111111111111e-01 +283 409 -1.94444444444444e-01 +283 451 -6.94444444444444e-02 +283 330 7.15573433840433e-18 +283 282 -4.16333634234434e-17 +283 327 -7.69783542464708e-18 +283 414 -8.33333333333333e-02 +283 411 3.07642366442762e-18 +283 336 -6.93889390390723e-18 +283 408 -3.67273485929465e-18 +283 450 -4.16666666666667e-02 +284 284 5.55555555555555e-01 +284 431 -1.38888888888889e-02 +284 428 -9.72222222222221e-02 +284 455 -6.94444444444444e-02 +284 355 4.16666666666667e-02 +284 430 1.95427441590512e-17 +284 427 -1.19262238973405e-17 +284 454 -4.16666666666667e-02 +284 354 -5.03069808033274e-17 +284 429 -1.75640751942652e-17 +284 426 8.33333333333333e-02 +284 453 4.16666666666667e-02 +284 332 5.55555555555555e-02 +284 356 5.55555555555555e-02 +284 329 1.11111111111111e-01 +284 416 -1.38888888888889e-02 +284 413 -9.72222222222222e-02 +284 338 -2.22222222222222e-01 +284 410 -1.94444444444444e-01 +284 452 -6.94444444444444e-02 +284 331 4.16666666666667e-02 +284 283 1.66666666666667e-01 +284 328 1.01305140491614e-18 +284 415 1.10859672136643e-17 +284 412 5.42101086242752e-19 +284 337 -2.24023273889817e-17 +284 409 -1.66666666666667e-01 +284 451 -4.16666666666667e-02 +284 330 -2.02745806254789e-17 +284 282 4.16333634234434e-17 +284 327 -1.38777878078145e-17 +284 414 8.61940727125976e-18 +284 411 -8.33333333333334e-02 +284 336 3.39355279987963e-17 +284 408 1.20617491689012e-18 +284 450 -4.16666666666667e-02 +285 285 5.55555555555555e-01 +285 446 5.31259064517897e-18 +285 443 8.33333333333334e-02 +285 458 4.16666666666667e-02 +285 379 -5.09575021068187e-18 +285 445 8.33333333333334e-02 +285 442 1.73472347597681e-18 +285 457 4.16666666666667e-02 +285 378 -1.11111111111111e-01 +285 444 -9.72222222222223e-02 +285 441 -9.72222222222222e-02 +285 456 -6.94444444444444e-02 +285 356 1.82145964977565e-17 +285 287 1.38777878078145e-17 +285 353 -6.93889390390723e-18 +285 431 3.79470760369927e-18 +285 428 -8.33333333333333e-02 +285 362 -1.39862080250630e-17 +285 425 -1.30781887056064e-18 +285 455 -4.16666666666667e-02 +285 355 4.42354486374086e-17 +285 286 -2.77555756156289e-17 +285 352 -2.17924636669586e-17 +285 430 -8.33333333333333e-02 +285 427 8.34835672813838e-18 +285 361 -6.93889390390723e-18 +285 424 -5.53620734325411e-18 +285 454 -4.16666666666667e-02 +285 354 -1.11111111111111e-01 +285 380 -4.22838847269347e-18 +285 351 1.11111111111111e-01 +285 429 -9.72222222222222e-02 +285 426 -9.72222222222222e-02 +285 360 1.11111111111111e-01 +285 423 -2.77777777777778e-02 +285 453 -6.94444444444444e-02 +286 286 5.55555555555556e-01 +286 446 -1.17093834628434e-17 +286 443 -6.42389787197661e-18 +286 458 -4.16666666666667e-02 +286 379 5.55555555555555e-02 +286 445 -9.72222222222222e-02 +286 442 -1.38888888888889e-02 +286 457 -6.94444444444444e-02 +286 378 -3.46944695195361e-18 +286 444 8.33333333333333e-02 +286 441 2.81892564846231e-18 +286 456 4.16666666666667e-02 +286 356 4.16666666666667e-02 +286 287 1.66666666666667e-01 +286 353 -2.87720151523341e-17 +286 431 4.41270284201600e-17 +286 428 2.17653586126465e-17 +286 362 -1.33594036440948e-17 +286 425 -1.66666666666667e-01 +286 455 -4.16666666666667e-02 +286 355 5.55555555555557e-02 +286 380 4.16666666666667e-02 +286 352 -2.22222222222222e-01 +286 430 -9.72222222222221e-02 +286 427 -1.38888888888888e-02 +286 361 1.11111111111111e-01 +286 424 -1.94444444444445e-01 +286 454 -6.94444444444444e-02 +286 354 4.53196508098941e-17 +286 285 -2.77555756156289e-17 +286 351 -2.39608680119296e-17 +286 429 -8.33333333333333e-02 +286 426 9.16150835750251e-18 +286 360 -6.93889390390723e-18 +286 423 -1.02728155843002e-17 +286 453 -4.16666666666667e-02 +287 287 5.55555555555556e-01 +287 446 -1.38888888888889e-02 +287 443 -9.72222222222222e-02 +287 458 -6.94444444444444e-02 +287 379 4.16666666666667e-02 +287 445 -1.16280682999070e-17 +287 442 -4.77048955893622e-18 +287 457 -4.16666666666667e-02 +287 378 -6.93889390390723e-18 +287 444 6.28837260041593e-18 +287 441 8.33333333333334e-02 +287 456 4.16666666666667e-02 +287 356 5.55555555555556e-02 +287 380 5.55555555555555e-02 +287 353 1.11111111111111e-01 +287 431 -1.38888888888888e-02 +287 428 -9.72222222222222e-02 +287 362 -2.22222222222222e-01 +287 425 -1.94444444444444e-01 +287 455 -6.94444444444445e-02 +287 355 4.16666666666667e-02 +287 286 1.66666666666667e-01 +287 352 -2.99612494102791e-17 +287 430 4.58346468418247e-17 +287 427 2.11419423634673e-17 +287 361 -1.14247803925660e-17 +287 424 -1.66666666666667e-01 +287 454 -4.16666666666667e-02 +287 354 1.58293517182884e-17 +287 285 1.38777878078145e-17 +287 351 -6.93889390390723e-18 +287 429 4.93311988480905e-18 +287 426 -8.33333333333333e-02 +287 360 -6.61363325216158e-18 +287 423 5.69206140554890e-19 +287 453 -4.16666666666667e-02 +288 288 2.77777777777778e-01 +288 377 4.16666666666667e-02 +288 446 9.54097911787244e-18 +288 443 -8.33333333333334e-02 +288 386 2.27682456221956e-18 +288 440 -2.64274279543342e-18 +288 458 -4.16666666666667e-02 +288 379 -1.73472347597681e-18 +288 289 8.33333333333334e-02 +288 376 5.42101086242752e-19 +288 445 -8.33333333333334e-02 +288 442 2.16840434497101e-18 +288 385 4.16666666666667e-02 +288 439 -9.08019319456610e-19 +288 457 -4.16666666666667e-02 +288 378 -1.11111111111111e-01 +288 290 8.33333333333333e-02 +288 375 5.55555555555555e-02 +288 444 -9.72222222222222e-02 +288 441 -9.72222222222223e-02 +288 384 5.55555555555555e-02 +288 438 -1.38888888888889e-02 +288 456 -6.94444444444444e-02 +289 289 2.77777777777778e-01 +289 290 8.33333333333334e-02 +289 377 -1.12757025938492e-17 +289 446 1.98408997564847e-17 +289 443 -7.79270311473956e-18 +289 386 -8.45677694538693e-18 +289 440 -8.33333333333334e-02 +289 458 -4.16666666666666e-02 +289 379 5.55555555555555e-02 +289 380 4.16666666666667e-02 +289 376 -1.11111111111111e-01 +289 445 -9.72222222222222e-02 +289 442 -1.38888888888889e-02 +289 385 5.55555555555556e-02 +289 439 -9.72222222222223e-02 +289 457 -6.94444444444444e-02 +289 378 -1.95156391047391e-18 +289 288 8.33333333333334e-02 +289 375 2.60208521396521e-18 +289 444 -8.33333333333334e-02 +289 441 8.53809210832335e-19 +289 384 4.16666666666667e-02 +289 438 -5.42101086242752e-19 +289 456 -4.16666666666667e-02 +290 290 2.77777777777778e-01 +290 380 5.55555555555555e-02 +290 377 5.55555555555555e-02 +290 446 -1.38888888888889e-02 +290 443 -9.72222222222222e-02 +290 386 -1.11111111111111e-01 +290 440 -9.72222222222222e-02 +290 458 -6.94444444444444e-02 +290 379 4.16666666666667e-02 +290 289 8.33333333333334e-02 +290 376 -9.54097911787244e-18 +290 445 1.90955107629009e-17 +290 442 -7.04731412115578e-18 +290 385 -7.80625564189563e-18 +290 439 -8.33333333333334e-02 +290 457 -4.16666666666667e-02 +290 378 -1.95156391047391e-18 +290 288 8.33333333333333e-02 +290 375 4.16666666666667e-02 +290 444 8.76848506997652e-18 +290 441 -8.33333333333333e-02 +290 384 6.07153216591882e-18 +290 438 -6.61363325216158e-18 +290 456 -4.16666666666667e-02 +291 291 5.55555555555555e-01 +291 311 -8.33333333333334e-02 +291 296 -1.33153579308376e-17 +291 245 -4.58700104673726e-17 +291 394 -4.16666666666667e-02 +291 310 -8.71088682956322e-18 +291 295 -8.33333333333334e-02 +291 244 -1.43436559288043e-17 +291 393 -6.94444444444445e-02 +291 309 -9.72222222222223e-02 +291 294 -9.72222222222223e-02 +291 243 -1.11111111111111e-01 +291 449 1.12892551210053e-17 +291 392 7.73849300611529e-18 +291 389 2.77555756156289e-17 +291 293 1.38777878078145e-17 +291 448 1.47722546001150e-18 +291 391 2.77555756156289e-17 +291 388 9.46644021851406e-18 +291 292 0.00000000000000e+00 +291 447 -2.77777777777777e-02 +291 390 1.11111111111111e-01 +291 387 1.11111111111111e-01 +291 395 -4.16666666666667e-02 +291 224 4.16666666666667e-02 +291 164 8.33333333333334e-02 +291 149 -1.08420217248550e-18 +291 14 2.49840838122128e-17 +291 223 4.16666666666667e-02 +291 163 5.42101086242752e-19 +291 148 8.33333333333334e-02 +291 13 -1.24683249835833e-18 +291 222 -6.94444444444445e-02 +291 162 -9.72222222222223e-02 +291 147 -9.72222222222222e-02 +291 12 -1.11111111111111e-01 +292 292 5.55555555555556e-01 +292 311 -2.10877322548431e-17 +292 296 -7.48607718783351e-18 +292 245 4.16666666666666e-02 +292 394 -6.94444444444445e-02 +292 310 -1.38888888888889e-02 +292 295 -9.72222222222222e-02 +292 244 5.55555555555554e-02 +292 393 -4.16666666666667e-02 +292 309 -8.37546178245052e-18 +292 294 -8.33333333333334e-02 +292 243 -1.45503319679344e-17 +292 449 -1.66666666666667e-01 +292 392 2.48959923856984e-17 +292 389 -3.65793295854138e-17 +292 293 1.66666666666667e-01 +292 448 -1.94444444444444e-01 +292 391 1.11111111111111e-01 +292 388 -2.22222222222222e-01 +292 395 -4.16666666666667e-02 +292 447 3.46267068837558e-18 +292 390 2.08166817117217e-17 +292 387 1.14196981948825e-17 +292 291 0.00000000000000e+00 +292 224 -4.16666666666667e-02 +292 164 -9.29703362906320e-18 +292 149 1.40438062654763e-17 +292 14 4.16666666666666e-02 +292 223 -6.94444444444444e-02 +292 163 -1.38888888888889e-02 +292 148 -9.72222222222222e-02 +292 13 5.55555555555555e-02 +292 222 4.16666666666667e-02 +292 162 2.86297136171954e-19 +292 147 8.33333333333334e-02 +292 12 -6.67673720673202e-19 +293 293 5.55555555555556e-01 +293 311 -9.72222222222223e-02 +293 296 -1.38888888888889e-02 +293 245 5.55555555555554e-02 +293 394 -4.16666666666667e-02 +293 310 -2.35305752747245e-17 +293 295 -8.28059409235804e-18 +293 244 4.16666666666666e-02 +293 393 -4.16666666666667e-02 +293 309 -8.33333333333334e-02 +293 294 -1.40946282423116e-17 +293 243 -4.43472569864461e-17 +293 449 -1.94444444444444e-01 +293 392 -2.22222222222222e-01 +293 389 1.11111111111111e-01 +293 395 -6.94444444444445e-02 +293 448 -1.66666666666667e-01 +293 391 3.31621869179531e-17 +293 388 -3.57397081764479e-17 +293 292 1.66666666666667e-01 +293 447 1.16348445634851e-17 +293 390 1.21301470793920e-17 +293 387 3.46944695195361e-17 +293 291 1.38777878078145e-17 +293 224 -6.94444444444445e-02 +293 164 -9.72222222222223e-02 +293 149 -1.38888888888889e-02 +293 14 5.55555555555555e-02 +293 223 -4.16666666666666e-02 +293 163 -9.01243055878576e-18 +293 148 1.56667213924155e-17 +293 13 4.16666666666666e-02 +293 222 4.16666666666667e-02 +293 162 8.33333333333334e-02 +293 147 -1.75844039849993e-18 +293 12 2.20702904736580e-17 +294 294 1.11111111111111e+00 +294 323 -9.96449559149959e-18 +294 412 -4.16666666666667e-02 +294 322 -8.33333333333334e-02 +294 411 -6.94444444444444e-02 +294 321 -9.72222222222221e-02 +294 452 -1.66666666666667e-01 +294 407 -4.16666666666667e-02 +294 404 -7.02330073710112e-17 +294 317 -1.19533289516527e-17 +294 451 -1.65916813708172e-17 +294 406 4.16666666666667e-02 +294 403 -9.23456494920320e-17 +294 316 8.33333333333333e-02 +294 450 -1.94444444444444e-01 +294 405 -6.94444444444444e-02 +294 402 -2.22222222222222e-01 +294 315 -9.72222222222220e-02 +294 398 4.16666666666667e-02 +294 314 1.25496401465197e-17 +294 299 -1.47451495458029e-17 +294 257 3.46944695195361e-17 +294 397 4.16666666666667e-02 +294 313 7.67073037033494e-18 +294 298 8.33333333333334e-02 +294 256 2.84823298843731e-17 +294 396 -6.94444444444444e-02 +294 312 -2.77777777777778e-02 +294 297 -9.72222222222223e-02 +294 255 1.11111111111111e-01 +294 449 1.66666666666667e-01 +294 395 6.01545858481059e-17 +294 311 1.23327997120226e-17 +294 392 4.16666666666667e-02 +294 389 -6.35901514821693e-17 +294 296 1.24900090270330e-16 +294 245 3.46944695195361e-17 +294 293 -1.47587020729589e-17 +294 448 -1.75098650856409e-17 +294 394 4.16333634234434e-17 +294 310 1.08928437016903e-17 +294 391 -4.16666666666667e-02 +294 388 -3.10776388347603e-17 +294 295 1.11022302462516e-16 +294 244 3.21902166109788e-17 +294 292 -8.33333333333334e-02 +294 447 -1.94444444444445e-01 +294 393 2.22222222222222e-01 +294 309 -2.77777777777778e-02 +294 390 -6.94444444444445e-02 +294 387 -2.22222222222223e-01 +294 413 -4.16666666666667e-02 +294 243 1.11111111111111e-01 +294 291 -9.72222222222223e-02 +295 295 1.11111111111111e+00 +295 323 -3.15282603626996e-17 +295 412 -6.94444444444445e-02 +295 322 -9.72222222222224e-02 +295 411 -4.16666666666667e-02 +295 321 -8.33333333333334e-02 +295 452 -4.71356894488073e-17 +295 407 4.16666666666667e-02 +295 404 0.00000000000000e+00 +295 317 1.33898968301960e-17 +295 451 -2.77777777777777e-02 +295 406 -6.94444444444444e-02 +295 403 1.11111111111111e-01 +295 316 -9.72222222222221e-02 +295 450 -1.46502818557104e-17 +295 405 4.16666666666667e-02 +295 402 -8.92145922025064e-17 +295 315 8.33333333333333e-02 +295 398 -4.16666666666666e-02 +295 314 -1.66666666666667e-01 +295 299 3.48215244616243e-17 +295 257 -5.01867021248173e-20 +295 397 -6.94444444444444e-02 +295 313 -1.94444444444445e-01 +295 298 -9.72222222222221e-02 +295 256 -2.22222222222222e-01 +295 396 4.16666666666667e-02 +295 312 9.03953561309789e-18 +295 297 8.33333333333334e-02 +295 255 3.21883107868475e-17 +295 449 3.67273485929465e-18 +295 395 2.14807555423691e-18 +295 311 1.66666666666667e-01 +295 392 4.16666666666667e-02 +295 389 -9.71445146547012e-17 +295 296 1.94289029309402e-16 +295 245 -7.26076642386386e-18 +295 293 -7.86046575051991e-18 +295 448 -2.77777777777777e-02 +295 394 2.22222222222222e-01 +295 310 -1.94444444444445e-01 +295 391 -6.94444444444444e-02 +295 388 1.11111111111111e-01 +295 413 -4.16666666666668e-02 +295 244 -2.22222222222222e-01 +295 292 -9.72222222222222e-02 +295 447 -1.97951599773330e-17 +295 393 4.16333634234434e-17 +295 309 5.93600689435814e-18 +295 390 -4.16666666666667e-02 +295 387 -3.29104063743818e-17 +295 294 9.71445146547012e-17 +295 243 3.07032502720739e-17 +295 291 -8.33333333333334e-02 +296 296 1.11111111111111e+00 +296 323 -1.38888888888889e-02 +296 412 -4.16666666666668e-02 +296 322 -2.94631940372936e-17 +296 411 -4.16666666666667e-02 +296 321 -9.51387406356030e-18 +296 452 -1.94444444444445e-01 +296 407 -6.94444444444445e-02 +296 404 1.11111111111111e-01 +296 317 -1.38888888888888e-02 +296 451 -5.01765377294502e-17 +296 406 4.16666666666667e-02 +296 403 -6.93889390390723e-18 +296 316 1.34847645202885e-17 +296 450 -1.66666666666667e-01 +296 405 -4.16666666666667e-02 +296 402 -7.08526119719277e-17 +296 315 -1.29020058525775e-17 +296 398 -6.94444444444444e-02 +296 314 -1.94444444444445e-01 +296 299 -1.38888888888889e-02 +296 257 1.11111111111111e-01 +296 397 -4.16666666666666e-02 +296 313 -1.66666666666667e-01 +296 298 3.45996018294437e-17 +296 256 2.28190675990309e-18 +296 396 4.16666666666667e-02 +296 312 1.10859672136643e-17 +296 297 -1.50771864611265e-17 +296 255 3.46944695195361e-17 +296 449 -1.94444444444444e-01 +296 395 -4.44444444444445e-01 +296 311 -1.94444444444445e-01 +296 392 -6.94444444444444e-02 +296 389 1.11111111111111e-01 +296 413 -6.94444444444445e-02 +296 245 1.11111111111111e-01 +296 293 -1.38888888888889e-02 +296 448 2.21075599233372e-18 +296 394 3.24815959448343e-18 +296 310 1.66666666666667e-01 +296 391 4.16666666666667e-02 +296 388 -9.71445146547012e-17 +296 295 1.94289029309402e-16 +296 244 -9.18416648884157e-18 +296 292 -7.59449740508206e-18 +296 447 1.66666666666667e-01 +296 393 5.55799726582222e-17 +296 309 1.01084911925328e-17 +296 390 4.16666666666667e-02 +296 387 -6.43332111351482e-17 +296 294 1.24900090270330e-16 +296 243 4.16333634234434e-17 +296 291 -1.26766950886079e-17 +297 297 5.55555555555556e-01 +297 398 6.28837260041593e-18 +297 314 -8.33333333333334e-02 +297 395 -4.16666666666667e-02 +297 449 1.12892551210053e-17 +297 299 2.77555756156289e-17 +297 257 -1.77673631016062e-17 +297 296 -1.51042915154387e-17 +297 389 2.77555756156289e-17 +297 397 -6.93889390390723e-18 +297 313 -9.10729824887824e-18 +297 394 4.16666666666667e-02 +297 448 3.26954717640160e-18 +297 298 1.38777878078145e-17 +297 256 -1.72964127829328e-17 +297 295 8.33333333333334e-02 +297 388 8.00255552742182e-18 +297 396 1.11111111111111e-01 +297 312 -9.72222222222223e-02 +297 393 -6.94444444444445e-02 +297 447 -2.77777777777778e-02 +297 255 -1.11111111111111e-01 +297 294 -9.72222222222223e-02 +297 387 1.11111111111111e-01 +297 224 4.16666666666667e-02 +297 29 -3.66460334300100e-17 +297 149 1.62630325872826e-18 +297 166 -5.42101086242752e-19 +297 223 -4.16666666666667e-02 +297 28 -2.58853268680914e-18 +297 148 -8.33333333333334e-02 +297 165 -9.72222222222223e-02 +297 222 -6.94444444444445e-02 +297 27 -1.11111111111111e-01 +297 147 -9.72222222222222e-02 +297 167 8.33333333333333e-02 +298 298 5.55555555555555e-01 +298 398 2.11419423634673e-18 +298 314 -2.17924636669586e-17 +298 395 4.16666666666667e-02 +298 449 1.66666666666667e-01 +298 299 -1.66666666666667e-01 +298 257 -4.16666666666667e-02 +298 296 3.50332826984379e-17 +298 389 -3.22702612244943e-17 +298 397 1.11111111111111e-01 +298 313 -1.38888888888889e-02 +298 394 -6.94444444444444e-02 +298 448 -1.94444444444444e-01 +298 256 5.55555555555555e-02 +298 295 -9.72222222222221e-02 +298 388 -2.22222222222222e-01 +298 396 -6.93889390390723e-18 +298 312 -8.89045781438114e-18 +298 393 4.16666666666667e-02 +298 447 1.02999206386123e-18 +298 297 1.38777878078145e-17 +298 255 -1.48671222902075e-17 +298 294 8.33333333333334e-02 +298 387 1.29341931045732e-17 +298 224 4.16666666666667e-02 +298 29 -4.16666666666667e-02 +298 149 6.91178884959509e-18 +298 166 -1.38888888888889e-02 +298 223 -6.94444444444444e-02 +298 28 5.55555555555555e-02 +298 148 -9.72222222222222e-02 +298 165 -1.89735380184963e-19 +298 222 -4.16666666666667e-02 +298 27 -2.04643160056639e-18 +298 147 -8.33333333333334e-02 +298 167 -1.29020058525775e-17 +299 299 5.55555555555555e-01 +299 398 -2.22222222222222e-01 +299 314 -9.72222222222222e-02 +299 395 -6.94444444444444e-02 +299 449 -1.94444444444444e-01 +299 257 5.55555555555556e-02 +299 296 -1.38888888888889e-02 +299 389 1.11111111111111e-01 +299 397 1.27969737671180e-17 +299 313 -2.11961524720916e-17 +299 394 4.16666666666667e-02 +299 448 1.66666666666667e-01 +299 298 -1.66666666666667e-01 +299 256 -4.16666666666667e-02 +299 295 3.48198303957298e-17 +299 388 -3.14156049807147e-17 +299 396 1.75640751942652e-17 +299 312 -8.33333333333334e-02 +299 393 -4.16666666666667e-02 +299 447 8.18911453405458e-18 +299 297 2.77555756156289e-17 +299 255 -1.58293517182884e-17 +299 294 -1.48942273445196e-17 +299 387 2.08166817117217e-17 +299 224 -6.94444444444445e-02 +299 29 5.55555555555556e-02 +299 149 -1.38888888888889e-02 +299 166 -1.37287100090977e-17 +299 223 4.16666666666667e-02 +299 28 -4.16666666666667e-02 +299 148 8.61093694178722e-18 +299 165 8.33333333333333e-02 +299 222 4.16666666666667e-02 +299 27 -3.55753837846806e-17 +299 147 4.52315593833796e-19 +299 167 -9.72222222222222e-02 +300 300 5.55555555555556e-01 +300 269 -4.54314591589317e-17 +300 395 4.16666666666667e-02 +300 311 8.33333333333333e-02 +300 400 5.85469173142172e-18 +300 304 -8.33333333333334e-02 +300 268 -1.61681648971901e-17 +300 394 -4.16666666666667e-02 +300 310 -9.29364549727418e-18 +300 303 -9.72222222222223e-02 +300 267 -1.11111111111111e-01 +300 393 -6.94444444444445e-02 +300 309 -9.72222222222223e-02 +300 401 0.00000000000000e+00 +300 302 1.38777878078145e-17 +300 449 8.17556200689851e-18 +300 392 8.71279265369455e-18 +300 301 2.77555756156289e-17 +300 448 1.15196480826585e-18 +300 391 1.38777878078145e-17 +300 399 1.11111111111111e-01 +300 305 -1.26580603637683e-17 +300 447 -2.77777777777777e-02 +300 390 1.11111111111111e-01 +300 158 -8.67361737988404e-19 +300 44 2.26191678234788e-17 +300 224 -4.16666666666667e-02 +300 164 -8.33333333333333e-02 +300 157 8.33333333333333e-02 +300 43 2.81892564846231e-18 +300 223 4.16666666666667e-02 +300 163 8.53809210832335e-19 +300 156 -9.72222222222222e-02 +300 42 -1.11111111111111e-01 +300 222 -6.94444444444445e-02 +300 162 -9.72222222222222e-02 +301 301 5.55555555555556e-01 +301 269 -4.16666666666667e-02 +301 395 4.16666666666667e-02 +301 311 5.84452733605467e-19 +301 304 -9.72222222222222e-02 +301 268 5.55555555555555e-02 +301 394 -6.94444444444444e-02 +301 310 -1.38888888888889e-02 +301 303 -8.33333333333333e-02 +301 267 -1.75640751942652e-17 +301 393 -4.16666666666667e-02 +301 309 -8.94466792300541e-18 +301 401 -7.70139296302555e-17 +301 302 -1.66666666666667e-01 +301 449 1.66666666666667e-01 +301 392 3.31621869179531e-17 +301 400 -2.22222222222222e-01 +301 305 5.42101086242752e-18 +301 448 -1.94444444444444e-01 +301 391 1.11111111111111e-01 +301 399 5.97666447582634e-18 +301 300 2.77555756156289e-17 +301 447 3.28140563766316e-18 +301 390 3.46944695195361e-17 +301 158 1.35660796832249e-17 +301 44 -4.16666666666667e-02 +301 224 4.16666666666667e-02 +301 164 -7.59788553687107e-18 +301 157 -9.72222222222222e-02 +301 43 5.55555555555555e-02 +301 223 -6.94444444444444e-02 +301 163 -1.38888888888889e-02 +301 156 8.33333333333334e-02 +301 42 3.86247023947961e-18 +301 222 4.16666666666667e-02 +301 162 1.03168612975574e-18 +302 302 5.55555555555555e-01 +302 269 5.55555555555556e-02 +302 395 -6.94444444444444e-02 +302 311 -9.72222222222221e-02 +302 304 2.60208521396521e-18 +302 268 -4.16666666666667e-02 +302 394 4.16666666666667e-02 +302 310 1.40946282423116e-18 +302 303 -1.29020058525775e-17 +302 267 -4.26226979058364e-17 +302 393 4.16666666666667e-02 +302 309 8.33333333333333e-02 +302 401 1.11111111111111e-01 +302 305 -1.38888888888889e-02 +302 449 -1.94444444444444e-01 +302 392 -2.22222222222222e-01 +302 400 -7.59890197640778e-17 +302 301 -1.66666666666667e-01 +302 448 1.66666666666667e-01 +302 391 3.19416124409597e-17 +302 399 0.00000000000000e+00 +302 300 1.38777878078145e-17 +302 447 7.81980816905170e-18 +302 390 5.16181878056771e-18 +302 158 -1.38888888888889e-02 +302 44 5.55555555555555e-02 +302 224 -6.94444444444444e-02 +302 164 -9.72222222222222e-02 +302 157 1.35525271560688e-17 +302 43 -4.16666666666667e-02 +302 223 4.16666666666667e-02 +302 163 -7.94178091345632e-18 +302 156 -1.47722546001150e-18 +302 42 2.27275880407274e-17 +302 222 -4.16666666666667e-02 +302 162 -8.33333333333333e-02 +303 303 1.11111111111111e+00 +303 413 4.16666666666667e-02 +303 331 -8.33333333333334e-02 +303 412 -4.16666666666667e-02 +303 330 -9.72222222222222e-02 +303 411 -6.94444444444444e-02 +303 416 -7.09711965845433e-17 +303 326 -1.31595038685428e-17 +303 452 1.66666666666667e-01 +303 407 4.16666666666667e-02 +303 415 -8.91891812140888e-17 +303 325 8.33333333333333e-02 +303 451 -1.69677639993981e-17 +303 406 4.16666666666667e-02 +303 414 -2.22222222222222e-01 +303 324 -9.72222222222221e-02 +303 450 -1.94444444444444e-01 +303 405 -6.94444444444444e-02 +303 308 -1.58293517182884e-17 +303 281 6.93889390390723e-18 +303 398 -4.16666666666667e-02 +303 314 1.01339021809504e-17 +303 307 8.33333333333333e-02 +303 280 3.10081821330854e-17 +303 397 4.16666666666667e-02 +303 313 7.67073037033494e-18 +303 306 -9.72222222222222e-02 +303 279 1.11111111111111e-01 +303 396 -6.94444444444445e-02 +303 312 -2.77777777777779e-02 +303 401 -5.91296759819282e-17 +303 305 1.52655665885959e-16 +303 269 6.93889390390723e-18 +303 302 -1.29020058525775e-17 +303 449 -1.66666666666667e-01 +303 395 5.57445088082264e-17 +303 311 1.44469939483693e-17 +303 392 -4.16666666666667e-02 +303 400 -3.05745012640912e-17 +303 304 1.52655665885959e-16 +303 268 3.48435473182529e-17 +303 301 -8.33333333333334e-02 +303 448 -1.73607872869241e-17 +303 394 3.46944695195361e-17 +303 310 1.06793913989822e-17 +303 391 -4.16666666666667e-02 +303 399 -2.22222222222222e-01 +303 332 -1.06658388718261e-17 +303 267 1.11111111111111e-01 +303 300 -9.72222222222223e-02 +303 447 -1.94444444444445e-01 +303 393 2.22222222222222e-01 +303 309 -2.77777777777779e-02 +303 390 -6.94444444444445e-02 +304 304 1.11111111111111e+00 +304 413 4.16666666666667e-02 +304 331 -9.72222222222224e-02 +304 412 -6.94444444444445e-02 +304 330 -8.33333333333334e-02 +304 411 -4.16666666666667e-02 +304 416 3.46944695195361e-17 +304 326 2.08166817117217e-17 +304 452 5.22314396594892e-17 +304 407 -4.16666666666667e-02 +304 415 1.11111111111111e-01 +304 325 -9.72222222222222e-02 +304 451 -2.77777777777776e-02 +304 406 -6.94444444444444e-02 +304 414 -8.72782748850831e-17 +304 324 8.33333333333333e-02 +304 450 -1.57480365553520e-17 +304 405 4.16666666666667e-02 +304 308 4.79894986596396e-17 +304 281 -4.90838652274922e-17 +304 398 4.16666666666667e-02 +304 314 1.66666666666667e-01 +304 307 -9.72222222222222e-02 +304 280 -2.22222222222222e-01 +304 397 -6.94444444444444e-02 +304 313 -1.94444444444445e-01 +304 306 8.33333333333333e-02 +304 279 3.64698505769812e-17 +304 396 4.16666666666667e-02 +304 312 1.09030080970574e-17 +304 401 1.38777878078145e-17 +304 305 -1.38777878078145e-17 +304 269 -5.11472374870037e-17 +304 302 2.60208521396521e-18 +304 449 -4.64495927615313e-17 +304 395 3.23841871559000e-18 +304 311 -1.66666666666667e-01 +304 392 -4.16666666666667e-02 +304 400 1.11111111111111e-01 +304 332 -2.17247010311783e-17 +304 268 -2.22222222222222e-01 +304 301 -9.72222222222222e-02 +304 448 -2.77777777777778e-02 +304 394 2.22222222222222e-01 +304 310 -1.94444444444445e-01 +304 391 -6.94444444444445e-02 +304 399 -3.18755438710738e-17 +304 303 1.66533453693773e-16 +304 267 3.18755438710738e-17 +304 300 -8.33333333333334e-02 +304 447 -1.84263547345700e-17 +304 393 3.46944695195361e-17 +304 309 8.30769914667018e-18 +304 390 -4.16666666666667e-02 +305 305 1.11111111111111e+00 +305 413 -6.94444444444445e-02 +305 331 -2.26598254049470e-17 +305 412 4.16666666666667e-02 +305 330 -1.10588621593521e-17 +305 411 4.16666666666667e-02 +305 416 1.11111111111111e-01 +305 326 -1.38888888888888e-02 +305 452 -1.94444444444444e-01 +305 407 -6.94444444444444e-02 +305 415 3.46944695195361e-17 +305 325 2.38253427403690e-17 +305 451 5.31801165604140e-17 +305 406 -4.16666666666667e-02 +305 414 -7.23569424862514e-17 +305 324 -1.26851654180804e-17 +305 450 1.66666666666667e-01 +305 405 4.16666666666667e-02 +305 308 -1.38888888888889e-02 +305 281 1.11111111111111e-01 +305 398 -6.94444444444444e-02 +305 314 -1.94444444444445e-01 +305 307 4.86806775445991e-17 +305 280 -4.63767479280675e-17 +305 397 4.16666666666667e-02 +305 313 1.66666666666667e-01 +305 306 -1.47451495458029e-17 +305 279 6.93889390390723e-18 +305 396 -4.16666666666667e-02 +305 312 1.34170018845081e-17 +305 401 1.11111111111111e-01 +305 332 -1.38888888888889e-02 +305 269 1.11111111111111e-01 +305 302 -1.38888888888889e-02 +305 449 -1.94444444444444e-01 +305 395 -4.44444444444445e-01 +305 311 -1.94444444444445e-01 +305 392 -6.94444444444445e-02 +305 400 1.38777878078145e-17 +305 304 -1.38777878078145e-17 +305 268 -5.10371232038606e-17 +305 301 5.40745833527145e-18 +305 448 -4.46284719249346e-17 +305 394 7.36410444342889e-18 +305 310 -1.66666666666667e-01 +305 391 -4.16666666666667e-02 +305 399 -6.08542350625380e-17 +305 303 1.24900090270330e-16 +305 267 1.38777878078145e-17 +305 300 -1.22379320219301e-17 +305 447 -1.66666666666667e-01 +305 393 5.45556980667550e-17 +305 309 1.35118695746006e-17 +305 390 -4.16666666666667e-02 +306 306 5.55555555555555e-01 +306 308 2.77555756156289e-17 +306 281 -1.53956708492942e-17 +306 305 -1.47315970186468e-17 +306 401 0.00000000000000e+00 +306 398 1.39726554979069e-17 +306 314 8.33333333333334e-02 +306 395 4.16666666666667e-02 +306 449 8.13659849132481e-18 +306 307 -1.38777878078145e-17 +306 280 -1.65882932390282e-17 +306 304 8.33333333333333e-02 +306 400 5.97666447582634e-18 +306 397 -6.93889390390723e-18 +306 313 -9.98821251402271e-18 +306 394 4.16666666666667e-02 +306 448 3.66426452982210e-18 +306 279 -1.11111111111111e-01 +306 303 -9.72222222222222e-02 +306 399 1.11111111111111e-01 +306 396 1.11111111111111e-01 +306 312 -9.72222222222222e-02 +306 393 -6.94444444444444e-02 +306 447 -2.77777777777777e-02 +306 158 2.16840434497101e-19 +306 167 -8.33333333333334e-02 +306 224 -4.16666666666667e-02 +306 58 8.67361737988404e-19 +306 157 -8.33333333333334e-02 +306 166 -3.25260651745651e-19 +306 223 -4.16666666666667e-02 +306 57 -1.11111111111111e-01 +306 156 -9.72222222222222e-02 +306 165 -9.72222222222223e-02 +306 222 -6.94444444444445e-02 +306 59 -3.29597460435593e-17 +307 307 5.55555555555555e-01 +307 308 1.66666666666667e-01 +307 281 4.16666666666667e-02 +307 305 4.86806775445991e-17 +307 401 -7.33869345501126e-17 +307 398 1.24751012471613e-17 +307 314 1.63985578588433e-18 +307 395 -4.16666666666666e-02 +307 449 -1.66666666666667e-01 +307 280 5.55555555555556e-02 +307 304 -9.72222222222222e-02 +307 400 -2.22222222222222e-01 +307 397 1.11111111111111e-01 +307 313 -1.38888888888889e-02 +307 394 -6.94444444444444e-02 +307 448 -1.94444444444444e-01 +307 306 -1.38777878078145e-17 +307 279 -1.56125112837913e-17 +307 303 8.33333333333333e-02 +307 399 5.74627151417317e-18 +307 396 -6.93889390390723e-18 +307 312 -9.43255890062389e-18 +307 393 4.16666666666667e-02 +307 447 1.46367293285543e-18 +307 158 7.26415455565288e-18 +307 167 -1.34305544116642e-17 +307 224 -4.16666666666667e-02 +307 58 5.55555555555555e-02 +307 157 -9.72222222222222e-02 +307 166 -1.38888888888889e-02 +307 223 -6.94444444444444e-02 +307 57 1.95156391047391e-18 +307 156 -8.33333333333333e-02 +307 165 -3.79470760369927e-19 +307 222 -4.16666666666667e-02 +307 59 4.16666666666666e-02 +308 308 5.55555555555555e-01 +308 281 5.55555555555554e-02 +308 305 -1.38888888888889e-02 +308 401 1.11111111111111e-01 +308 398 -2.22222222222222e-01 +308 314 -9.72222222222222e-02 +308 395 -6.94444444444444e-02 +308 449 -1.94444444444444e-01 +308 307 1.66666666666667e-01 +308 280 4.16666666666667e-02 +308 304 4.71221369216512e-17 +308 400 -7.00750357263483e-17 +308 397 1.26038502551440e-18 +308 313 2.27682456221956e-18 +308 394 -4.16666666666666e-02 +308 448 -1.66666666666667e-01 +308 306 2.77555756156289e-17 +308 279 -1.64798730217797e-17 +308 303 -1.40946282423116e-17 +308 399 0.00000000000000e+00 +308 396 6.17995238316738e-18 +308 312 8.33333333333334e-02 +308 393 4.16666666666667e-02 +308 447 8.02309607639273e-18 +308 158 -1.38888888888889e-02 +308 167 -9.72222222222223e-02 +308 224 -6.94444444444444e-02 +308 58 4.16666666666666e-02 +308 157 8.29414661951411e-18 +308 166 -1.26851654180804e-17 +308 223 -4.16666666666667e-02 +308 57 -3.32850066953050e-17 +308 156 4.06575814682064e-19 +308 165 -8.33333333333334e-02 +308 222 -4.16666666666667e-02 +308 59 5.55555555555555e-02 +309 309 1.11111111111111e+00 +309 326 -8.33333333333334e-02 +309 415 -4.16666666666667e-02 +309 325 -7.32175279606617e-18 +309 414 -6.94444444444444e-02 +309 324 -9.72222222222222e-02 +309 452 -2.50213532618920e-17 +309 407 -1.46123771313207e-16 +309 404 4.16666666666667e-02 +309 317 8.33333333333333e-02 +309 451 -1.66666666666667e-01 +309 406 -8.96774957081809e-17 +309 403 -4.16666666666667e-02 +309 316 -7.92822838630025e-18 +309 450 -1.94444444444444e-01 +309 405 -2.22222222222222e-01 +309 402 -6.94444444444444e-02 +309 315 -9.72222222222220e-02 +309 401 4.16666666666667e-02 +309 305 1.25496401465197e-17 +309 269 5.25651706407074e-17 +309 302 8.33333333333333e-02 +309 400 4.16666666666667e-02 +309 304 7.88757080483204e-18 +309 268 6.93889390390723e-18 +309 301 -8.72782748850831e-18 +309 399 -6.94444444444444e-02 +309 303 -2.77777777777779e-02 +309 267 1.11111111111111e-01 +309 300 -9.72222222222223e-02 +309 449 -2.78639958328775e-17 +309 395 5.55111512312578e-17 +309 311 2.35922392732846e-16 +309 392 -8.86487741937406e-17 +309 389 -4.16666666666667e-02 +309 296 1.01067971266383e-17 +309 245 5.06047128842873e-17 +309 293 -8.33333333333334e-02 +309 448 1.66666666666667e-01 +309 394 5.94888179515640e-17 +309 310 1.11022302462516e-16 +309 391 -2.85975263651997e-17 +309 388 4.16666666666667e-02 +309 295 7.67073037033494e-18 +309 244 1.38777878078145e-17 +309 292 -8.36190925529445e-18 +309 447 -1.94444444444444e-01 +309 393 2.22222222222222e-01 +309 416 -4.16666666666667e-02 +309 390 -2.22222222222223e-01 +309 387 -6.94444444444445e-02 +309 294 -2.77777777777778e-02 +309 243 1.11111111111111e-01 +309 291 -9.72222222222223e-02 +310 310 1.11111111111111e+00 +310 326 -2.01390553539182e-17 +310 415 -6.94444444444445e-02 +310 325 -1.38888888888889e-02 +310 414 -4.16666666666667e-02 +310 324 -7.27770708280895e-18 +310 452 -5.67241024117260e-17 +310 407 2.77555756156289e-17 +310 404 4.16666666666667e-02 +310 317 2.65494006987388e-17 +310 451 -1.94444444444445e-01 +310 406 1.11111111111111e-01 +310 403 -6.94444444444445e-02 +310 316 -1.38888888888888e-02 +310 450 -1.66666666666667e-01 +310 405 -8.59213281035817e-17 +310 402 -4.16666666666667e-02 +310 315 -7.83336069620777e-18 +310 401 -4.16666666666666e-02 +310 305 -1.66666666666667e-01 +310 269 2.29376522116465e-17 +310 302 -3.38813178901720e-19 +310 400 -6.94444444444444e-02 +310 304 -1.94444444444445e-01 +310 268 1.11111111111111e-01 +310 301 -1.38888888888889e-02 +310 399 4.16666666666667e-02 +310 303 9.25637604759499e-18 +310 267 6.93889390390723e-18 +310 300 -1.01322081150559e-17 +310 449 8.01919972483536e-17 +310 395 -5.47992200390906e-17 +310 311 1.38777878078145e-16 +310 392 -4.85722573273506e-17 +310 389 4.16666666666667e-02 +310 296 1.66666666666667e-01 +310 245 1.94946750392945e-17 +310 293 -2.35305752747245e-17 +310 448 -1.94444444444444e-01 +310 394 -4.44444444444445e-01 +310 416 -4.16666666666668e-02 +310 391 1.11111111111111e-01 +310 388 -6.94444444444444e-02 +310 295 -1.94444444444445e-01 +310 244 1.11111111111111e-01 +310 292 -1.38888888888889e-02 +310 447 1.66666666666667e-01 +310 393 6.86867487257985e-17 +310 309 1.38777878078145e-16 +310 390 -3.00592934739238e-17 +310 387 4.16666666666667e-02 +310 294 1.06624507400371e-17 +310 243 1.38777878078145e-17 +310 291 -9.14287363266292e-18 +311 311 1.11111111111111e+00 +311 326 -9.72222222222225e-02 +311 415 -4.16666666666668e-02 +311 325 -2.04287406218792e-17 +311 414 -4.16666666666667e-02 +311 324 -8.33333333333334e-02 +311 452 -2.77777777777778e-02 +311 407 1.11111111111111e-01 +311 404 -6.94444444444445e-02 +311 317 -9.72222222222220e-02 +311 451 -5.73407423973271e-17 +311 406 3.46944695195361e-17 +311 403 4.16666666666667e-02 +311 316 2.58582218137793e-17 +311 450 -2.66442683888313e-17 +311 405 -1.47654783365370e-16 +311 402 4.16666666666667e-02 +311 315 8.33333333333333e-02 +311 401 -6.94444444444444e-02 +311 305 -1.94444444444445e-01 +311 269 -2.22222222222222e-01 +311 302 -9.72222222222221e-02 +311 400 -4.16666666666666e-02 +311 304 -1.66666666666667e-01 +311 268 1.94944632810577e-17 +311 301 5.86146799499976e-19 +311 399 4.16666666666667e-02 +311 303 1.45554141656179e-17 +311 267 4.70810558237094e-17 +311 300 8.33333333333333e-02 +311 449 -2.77777777777778e-02 +311 395 2.22222222222222e-01 +311 416 -6.94444444444445e-02 +311 392 1.11111111111111e-01 +311 389 -6.94444444444444e-02 +311 296 -1.94444444444445e-01 +311 245 -2.22222222222222e-01 +311 293 -9.72222222222223e-02 +311 448 8.06781941600776e-17 +311 394 -6.51283633143832e-17 +311 310 1.38777878078145e-16 +311 391 -4.85722573273506e-17 +311 388 4.16666666666667e-02 +311 295 1.66666666666667e-01 +311 244 2.64054050977056e-17 +311 292 -2.11012847819991e-17 +311 447 -2.62444688377272e-17 +311 393 4.85722573273506e-17 +311 309 2.35922392732846e-16 +311 390 -9.03726979996399e-17 +311 387 -4.16666666666667e-02 +311 294 1.34170018845081e-17 +311 243 4.95683680733217e-17 +311 291 -8.33333333333334e-02 +312 312 1.11111111111111e+00 +312 416 -4.16666666666667e-02 +312 331 -9.13440330319037e-18 +312 415 4.16666666666667e-02 +312 330 -9.72222222222221e-02 +312 414 -6.94444444444444e-02 +312 413 5.35324822664718e-18 +312 452 -2.77149180341607e-17 +312 323 8.33333333333333e-02 +312 404 4.16666666666667e-02 +312 412 -9.19488145562433e-17 +312 451 1.66666666666667e-01 +312 322 -8.38901430960659e-18 +312 403 4.16666666666667e-02 +312 411 -2.22222222222222e-01 +312 450 -1.94444444444444e-01 +312 321 -9.72222222222221e-02 +312 402 -6.94444444444444e-02 +312 308 8.33333333333334e-02 +312 281 4.11996825544492e-18 +312 305 1.23327997120226e-17 +312 401 4.16666666666667e-02 +312 307 -9.32413868337534e-18 +312 280 2.77555756156289e-17 +312 304 1.08911496357958e-17 +312 400 -4.16666666666667e-02 +312 306 -9.72222222222222e-02 +312 279 1.11111111111111e-01 +312 303 -2.77777777777779e-02 +312 399 -6.94444444444445e-02 +312 398 -3.05745012640912e-17 +312 314 1.38777878078145e-17 +312 395 4.16333634234434e-17 +312 449 -2.15891757596176e-17 +312 299 -8.33333333333334e-02 +312 257 -6.77626357803440e-20 +312 296 1.09775469964157e-17 +312 389 -4.16666666666667e-02 +312 397 -3.31223763694322e-17 +312 313 1.52655665885959e-16 +312 394 6.70604454670702e-17 +312 448 -1.66666666666667e-01 +312 298 -8.99887803162969e-18 +312 256 2.77555756156289e-17 +312 295 1.06793913989822e-17 +312 388 -4.16666666666667e-02 +312 396 -2.22222222222222e-01 +312 332 -8.33333333333334e-02 +312 393 2.22222222222222e-01 +312 447 -1.94444444444445e-01 +312 297 -9.72222222222223e-02 +312 255 1.11111111111111e-01 +312 294 -2.77777777777778e-02 +312 387 -6.94444444444445e-02 +313 313 1.11111111111111e+00 +313 416 4.16666666666667e-02 +313 331 -1.38888888888888e-02 +313 415 -6.94444444444444e-02 +313 330 -7.26415455565288e-18 +313 414 4.16666666666667e-02 +313 413 -6.93889390390723e-18 +313 452 3.42065785419177e-17 +313 323 2.55600662163458e-17 +313 404 -4.16666666666667e-02 +313 412 1.11111111111112e-01 +313 451 -1.94444444444444e-01 +313 322 -1.38888888888888e-02 +313 403 -6.94444444444444e-02 +313 411 -9.05986440383200e-17 +313 450 1.66666666666667e-01 +313 321 -7.26415455565288e-18 +313 402 4.16666666666667e-02 +313 308 2.27682456221956e-18 +313 281 -1.99086623922651e-17 +313 305 1.66666666666667e-01 +313 401 4.16666666666667e-02 +313 307 -1.38888888888889e-02 +313 280 1.11111111111111e-01 +313 304 -1.94444444444445e-01 +313 400 -6.94444444444444e-02 +313 306 -9.98821251402271e-18 +313 279 2.77555756156289e-17 +313 303 5.93600689435814e-18 +313 399 -4.16666666666667e-02 +313 398 -3.46944695195361e-17 +313 314 4.16333634234434e-17 +313 395 -4.47470565375502e-17 +313 449 -4.39101879856629e-18 +313 299 -2.11961524720916e-17 +313 257 -1.63409596184300e-17 +313 296 -1.66666666666667e-01 +313 389 -4.16666666666667e-02 +313 397 1.11111111111111e-01 +313 332 -2.87313575708659e-17 +313 394 -4.44444444444445e-01 +313 448 -1.94444444444444e-01 +313 298 -1.38888888888889e-02 +313 256 1.11111111111111e-01 +313 295 -1.94444444444445e-01 +313 388 -6.94444444444445e-02 +313 396 -3.47774787483671e-17 +313 312 1.52655665885959e-16 +313 393 6.25771000772532e-17 +313 447 -1.66666666666667e-01 +313 297 -9.32413868337534e-18 +313 255 2.77555756156289e-17 +313 294 8.09085871217308e-18 +313 387 -4.16666666666667e-02 +314 314 1.11111111111111e+00 +314 416 -6.94444444444445e-02 +314 331 -2.97342445804150e-17 +314 415 4.16666666666667e-02 +314 330 -8.33333333333334e-02 +314 414 -4.16666666666667e-02 +314 413 1.11111111111111e-01 +314 452 -2.77777777777776e-02 +314 323 -9.72222222222223e-02 +314 404 -6.94444444444444e-02 +314 412 -6.93889390390723e-18 +314 451 3.81740808668568e-17 +314 322 2.73218947466347e-17 +314 403 -4.16666666666667e-02 +314 411 3.57786716920216e-18 +314 450 -2.82976767018717e-17 +314 321 8.33333333333333e-02 +314 402 4.16666666666667e-02 +314 308 -9.72222222222222e-02 +314 281 -2.22222222222222e-01 +314 305 -1.94444444444445e-01 +314 401 -6.94444444444444e-02 +314 307 1.62630325872826e-18 +314 280 -1.62308453352869e-17 +314 304 1.66666666666667e-01 +314 400 4.16666666666667e-02 +314 306 8.33333333333334e-02 +314 279 3.29326409892472e-18 +314 303 1.01203496537944e-17 +314 399 4.16666666666667e-02 +314 398 1.11111111111111e-01 +314 332 -9.72222222222222e-02 +314 395 2.22222222222222e-01 +314 449 -2.77777777777778e-02 +314 299 -9.72222222222222e-02 +314 257 -2.22222222222222e-01 +314 296 -1.94444444444445e-01 +314 389 -6.94444444444445e-02 +314 397 -3.46944695195361e-17 +314 313 4.16333634234434e-17 +314 394 -5.33895454566226e-17 +314 448 -4.38763066677728e-19 +314 298 -2.17924636669586e-17 +314 256 -1.99222149194211e-17 +314 295 -1.66666666666667e-01 +314 388 -4.16666666666667e-02 +314 396 -3.21872519956634e-17 +314 312 1.38777878078145e-17 +314 393 4.16333634234434e-17 +314 447 -2.18653085004225e-17 +314 297 -8.33333333333334e-02 +314 255 4.98732999343332e-18 +314 294 1.35118695746006e-17 +314 387 -4.16666666666667e-02 +315 315 5.55555555555555e-01 +315 335 -8.33333333333333e-02 +315 320 7.33869345501126e-18 +315 248 6.56662292358896e-18 +315 409 -4.16666666666667e-02 +315 334 4.31478583331341e-18 +315 319 -8.33333333333334e-02 +315 247 8.82290693683761e-18 +315 408 -6.94444444444444e-02 +315 333 -9.72222222222222e-02 +315 318 -9.72222222222222e-02 +315 246 -1.11111111111111e-01 +315 395 4.16666666666667e-02 +315 452 4.05220561966457e-18 +315 407 3.00086832553254e-17 +315 311 8.33333333333333e-02 +315 296 -1.30781887056064e-17 +315 404 -1.38777878078145e-17 +315 317 8.32667268468867e-17 +315 245 -7.09051280146575e-17 +315 394 4.16666666666667e-02 +315 451 -6.77626357803440e-19 +315 406 -2.77555756156289e-17 +315 310 -7.73849300611529e-18 +315 295 8.33333333333333e-02 +315 403 1.71388646547435e-17 +315 316 4.16333634234434e-17 +315 244 -4.36509959038031e-17 +315 393 -6.94444444444444e-02 +315 450 -2.77777777777778e-02 +315 405 1.11111111111111e-01 +315 309 -9.72222222222220e-02 +315 294 -9.72222222222220e-02 +315 402 1.11111111111111e-01 +315 410 -4.16666666666667e-02 +315 243 -1.11111111111111e-01 +316 316 5.55555555555555e-01 +316 335 2.08708918203460e-18 +316 320 3.50502233573829e-18 +316 248 4.16666666666667e-02 +316 409 -6.94444444444444e-02 +316 334 -1.38888888888889e-02 +316 319 -9.72222222222221e-02 +316 247 5.55555555555555e-02 +316 408 -4.16666666666667e-02 +316 333 3.56431464204610e-18 +316 318 -8.33333333333334e-02 +316 246 5.65140382408069e-18 +316 395 -4.16666666666667e-02 +316 452 -1.66666666666667e-01 +316 407 -1.99239089853157e-17 +316 311 2.75793927626000e-17 +316 296 1.34830704543940e-17 +316 404 9.06897000801498e-18 +316 317 1.66666666666667e-01 +316 245 4.16666666666667e-02 +316 394 -6.94444444444444e-02 +316 451 -1.94444444444445e-01 +316 406 1.11111111111111e-01 +316 310 -1.38888888888888e-02 +316 295 -9.72222222222221e-02 +316 403 -2.22222222222222e-01 +316 410 -4.16666666666667e-02 +316 244 5.55555555555557e-02 +316 393 4.16666666666667e-02 +316 450 1.11300129269215e-18 +316 405 -2.08166817117217e-17 +316 309 -7.90112333198811e-18 +316 294 8.33333333333333e-02 +316 402 2.32421605561844e-17 +316 315 4.16333634234434e-17 +316 243 -4.49134985116856e-17 +317 317 5.55555555555556e-01 +317 335 -9.72222222222222e-02 +317 320 -1.38888888888889e-02 +317 248 5.55555555555555e-02 +317 409 -4.16666666666667e-02 +317 334 -1.86177841806495e-18 +317 319 4.25549352700560e-18 +317 247 4.16666666666667e-02 +317 408 -4.16666666666667e-02 +317 333 -8.33333333333333e-02 +317 318 8.78203759713259e-18 +317 246 9.69683318016723e-18 +317 395 -6.94444444444444e-02 +317 452 -1.94444444444445e-01 +317 407 -2.22222222222222e-01 +317 311 -9.72222222222220e-02 +317 296 -1.38888888888888e-02 +317 404 1.11111111111111e-01 +317 410 -6.94444444444444e-02 +317 245 5.55555555555557e-02 +317 394 -4.16666666666667e-02 +317 451 -1.66666666666667e-01 +317 406 -2.37042170289116e-17 +317 310 2.56820389607504e-17 +317 295 1.33763443030399e-17 +317 403 6.28837260041593e-18 +317 316 1.66666666666667e-01 +317 244 4.16666666666667e-02 +317 393 4.16666666666667e-02 +317 450 1.83297929785831e-18 +317 405 2.55280907225869e-17 +317 309 8.33333333333333e-02 +317 294 -1.21024067503694e-17 +317 402 -1.38777878078145e-17 +317 315 6.93889390390723e-17 +317 243 -7.32552209268145e-17 +318 318 1.11111111111111e+00 +318 347 -1.37049930865746e-17 +318 427 -4.16666666666667e-02 +318 346 -8.33333333333334e-02 +318 426 -6.94444444444444e-02 +318 345 -9.72222222222222e-02 +318 455 -1.66666666666667e-01 +318 422 -4.16666666666667e-02 +318 419 -7.34369094940006e-17 +318 341 -1.64442976379950e-17 +318 454 6.24432688715870e-18 +318 421 4.16666666666667e-02 +318 418 2.27216588100966e-17 +318 340 8.33333333333334e-02 +318 453 -1.94444444444445e-01 +318 420 -6.94444444444444e-02 +318 417 -2.22222222222223e-01 +318 339 -9.72222222222223e-02 +318 413 4.16666666666667e-02 +318 338 1.51788304147971e-18 +318 323 6.83047368665868e-18 +318 260 6.93889390390723e-18 +318 412 4.16666666666667e-02 +318 337 -4.11996825544492e-18 +318 322 8.33333333333334e-02 +318 259 -1.18889544476614e-17 +318 411 -6.94444444444445e-02 +318 336 -2.77777777777777e-02 +318 321 -9.72222222222222e-02 +318 258 1.11111111111111e-01 +318 452 1.66666666666667e-01 +318 410 3.50569996209610e-17 +318 335 1.53143556863578e-18 +318 407 4.16666666666667e-02 +318 404 -1.30714124420284e-17 +318 320 8.32667268468867e-17 +318 248 6.93889390390723e-18 +318 317 7.91467585914418e-18 +318 451 7.04731412115578e-18 +318 409 -2.08166817117217e-17 +318 334 -4.18095462764723e-18 +318 406 -4.16666666666667e-02 +318 403 1.79435459546351e-17 +318 319 -1.38777878078145e-17 +318 247 -1.34199664998235e-17 +318 316 -8.33333333333334e-02 +318 450 -1.94444444444444e-01 +318 408 2.22222222222222e-01 +318 333 -2.77777777777777e-02 +318 405 -6.94444444444444e-02 +318 402 -2.22222222222222e-01 +318 428 -4.16666666666667e-02 +318 246 1.11111111111111e-01 +318 315 -9.72222222222222e-02 +319 319 1.11111111111111e+00 +319 347 -3.69814584771228e-17 +319 427 -6.94444444444444e-02 +319 346 -9.72222222222221e-02 +319 426 -4.16666666666667e-02 +319 345 -8.33333333333334e-02 +319 455 1.91226158172131e-17 +319 422 4.16666666666667e-02 +319 419 6.93889390390723e-18 +319 341 1.52059354691092e-17 +319 454 -2.77777777777778e-02 +319 421 -6.94444444444444e-02 +319 418 1.11111111111111e-01 +319 340 -9.72222222222222e-02 +319 453 6.19350491032344e-18 +319 420 4.16666666666667e-02 +319 417 2.25005832108632e-17 +319 339 8.33333333333334e-02 +319 413 -4.16666666666667e-02 +319 338 -1.66666666666667e-01 +319 323 1.56192875473693e-18 +319 260 1.70679256454110e-17 +319 412 -6.94444444444445e-02 +319 337 -1.94444444444444e-01 +319 322 -9.72222222222222e-02 +319 259 -2.22222222222222e-01 +319 411 4.16666666666667e-02 +319 336 -4.42320605056196e-18 +319 321 8.33333333333334e-02 +319 258 -1.61016728108306e-17 +319 452 -1.66967134562768e-17 +319 410 -1.71964628951568e-17 +319 335 1.66666666666667e-01 +319 407 4.16666666666667e-02 +319 404 -3.46944695195361e-17 +319 320 6.93889390390723e-17 +319 248 1.50890449223881e-17 +319 317 4.30970363562988e-18 +319 451 -2.77777777777778e-02 +319 409 2.22222222222222e-01 +319 334 -1.94444444444444e-01 +319 406 -6.94444444444444e-02 +319 403 1.11111111111111e-01 +319 428 -4.16666666666667e-02 +319 247 -2.22222222222222e-01 +319 316 -9.72222222222221e-02 +319 450 7.61990839349969e-18 +319 408 -1.38777878078145e-17 +319 333 -4.11996825544492e-18 +319 405 -4.16666666666667e-02 +319 402 1.88769762625093e-17 +319 318 -1.38777878078145e-17 +319 246 -1.17534291761007e-17 +319 315 -8.33333333333334e-02 +320 320 1.11111111111111e+00 +320 347 -1.38888888888889e-02 +320 427 -4.16666666666667e-02 +320 346 -3.80690487813973e-17 +320 426 -4.16666666666667e-02 +320 345 -1.44334414212133e-17 +320 455 -1.94444444444445e-01 +320 422 -6.94444444444445e-02 +320 419 1.11111111111111e-01 +320 341 -1.38888888888889e-02 +320 454 1.49094739375702e-17 +320 421 4.16666666666667e-02 +320 418 6.93889390390723e-18 +320 340 1.52923328297291e-17 +320 453 -1.66666666666667e-01 +320 420 -4.16666666666667e-02 +320 417 -7.40069626675027e-17 +320 339 -1.64392154403115e-17 +320 413 -6.94444444444445e-02 +320 338 -1.94444444444444e-01 +320 323 -1.38888888888889e-02 +320 260 1.11111111111111e-01 +320 412 -4.16666666666667e-02 +320 337 -1.66666666666667e-01 +320 322 3.17129135452010e-18 +320 259 1.51940770078476e-17 +320 411 4.16666666666667e-02 +320 336 2.90871114087127e-18 +320 321 5.34477789717464e-18 +320 258 6.93889390390723e-18 +320 452 -1.94444444444444e-01 +320 410 -4.44444444444445e-01 +320 335 -1.94444444444444e-01 +320 407 -6.94444444444445e-02 +320 404 1.11111111111111e-01 +320 428 -6.94444444444445e-02 +320 248 1.11111111111111e-01 +320 317 -1.38888888888889e-02 +320 451 -1.97578905276538e-17 +320 409 -1.60072286372118e-17 +320 334 1.66666666666667e-01 +320 406 4.16666666666667e-02 +320 403 -3.46944695195361e-17 +320 319 6.93889390390723e-17 +320 247 1.16670318154807e-17 +320 316 3.50671640163280e-18 +320 450 1.66666666666667e-01 +320 408 3.91229695260184e-17 +320 333 4.68409219831628e-18 +320 405 4.16666666666667e-02 +320 402 -1.27321757466530e-17 +320 318 8.32667268468867e-17 +320 246 6.93889390390723e-18 +320 315 7.33869345501126e-18 +321 321 5.55555555555556e-01 +321 395 4.16666666666667e-02 +321 257 2.92734586571086e-18 +321 296 -9.24282352043893e-18 +321 313 -7.15573433840433e-18 +321 394 -4.16666666666667e-02 +321 256 -4.72034520845876e-17 +321 295 -8.33333333333334e-02 +321 312 -9.72222222222221e-02 +321 393 -6.94444444444444e-02 +321 255 -1.11111111111111e-01 +321 294 -9.72222222222221e-02 +321 413 1.08420217248550e-17 +321 338 -8.33333333333334e-02 +321 410 -4.16666666666667e-02 +321 452 4.06575814682064e-18 +321 323 -1.38777878078145e-17 +321 260 -1.95156391047391e-17 +321 320 6.21213963516304e-18 +321 404 -6.93889390390723e-18 +321 412 6.93889390390723e-18 +321 337 3.71339244076285e-18 +321 409 4.16666666666667e-02 +321 451 1.91260039490021e-18 +321 322 5.55111512312578e-17 +321 259 8.75323847692594e-18 +321 319 8.33333333333334e-02 +321 403 1.89038695585847e-17 +321 411 1.11111111111111e-01 +321 336 -9.72222222222222e-02 +321 408 -6.94444444444444e-02 +321 450 -2.77777777777779e-02 +321 314 8.33333333333333e-02 +321 258 -1.11111111111111e-01 +321 318 -9.72222222222222e-02 +321 402 1.11111111111111e-01 +322 322 5.55555555555556e-01 +322 395 4.16666666666667e-02 +322 257 -4.16666666666667e-02 +322 296 -3.11979175132704e-17 +322 313 -1.38888888888888e-02 +322 394 -6.94444444444445e-02 +322 256 5.55555555555557e-02 +322 295 -9.72222222222224e-02 +322 312 -8.49743452685514e-18 +322 393 -4.16666666666667e-02 +322 255 -4.64411224320588e-17 +322 294 -8.33333333333334e-02 +322 413 -2.42996811908314e-17 +322 338 5.42101086242752e-19 +322 410 4.16666666666667e-02 +322 452 1.66666666666667e-01 +322 323 -1.66666666666667e-01 +322 260 -4.16666666666667e-02 +322 320 3.22550146314438e-18 +322 404 8.94636198889992e-18 +322 412 1.11111111111111e-01 +322 337 -1.38888888888889e-02 +322 409 -6.94444444444444e-02 +322 451 -1.94444444444445e-01 +322 314 2.77555756156289e-17 +322 259 5.55555555555555e-02 +322 319 -9.72222222222222e-02 +322 403 -2.22222222222222e-01 +322 411 6.93889390390723e-18 +322 336 5.09575021068187e-18 +322 408 4.16666666666667e-02 +322 450 1.93801138331784e-18 +322 321 5.55111512312578e-17 +322 258 9.63584680796492e-18 +322 318 8.33333333333334e-02 +322 402 1.66933253244878e-17 +323 323 5.55555555555556e-01 +323 395 -6.94444444444445e-02 +323 257 5.55555555555557e-02 +323 296 -1.38888888888889e-02 +323 313 2.73896573824151e-17 +323 394 4.16666666666667e-02 +323 256 -4.16666666666667e-02 +323 295 -3.15248722309106e-17 +323 312 8.33333333333333e-02 +323 393 4.16666666666667e-02 +323 255 4.81114714040443e-18 +323 294 -9.42070043936233e-18 +323 413 -2.22222222222222e-01 +323 338 -9.72222222222222e-02 +323 410 -6.94444444444444e-02 +323 452 -1.94444444444445e-01 +323 314 -9.72222222222223e-02 +323 260 5.55555555555556e-02 +323 320 -1.38888888888889e-02 +323 404 1.11111111111111e-01 +323 412 -1.89379626347116e-17 +323 337 -3.52365706057789e-19 +323 409 4.16666666666667e-02 +323 451 1.66666666666667e-01 +323 322 -1.66666666666667e-01 +323 259 -4.16666666666667e-02 +323 319 2.43098455861984e-18 +323 403 1.25384169599686e-17 +323 411 7.87401827767598e-18 +323 336 -8.33333333333334e-02 +323 408 -4.16666666666667e-02 +323 450 1.76352259618345e-18 +323 321 -1.38777878078145e-17 +323 258 -1.75640751942652e-17 +323 318 7.68428289749101e-18 +323 402 -6.93889390390723e-18 +324 324 5.55555555555556e-01 +324 272 8.29245255361960e-18 +324 410 4.16666666666667e-02 +324 335 8.33333333333334e-02 +324 328 -8.33333333333333e-02 +324 271 9.29703362906320e-18 +324 409 -4.16666666666667e-02 +324 334 3.79809573548828e-18 +324 327 -9.72222222222223e-02 +324 270 -1.11111111111111e-01 +324 408 -6.94444444444444e-02 +324 333 -9.72222222222222e-02 +324 305 -1.29020058525775e-17 +324 416 2.08166817117217e-17 +324 326 5.55111512312578e-17 +324 269 -7.36444325660779e-17 +324 395 -4.16666666666667e-02 +324 452 1.74997006902738e-18 +324 407 2.89958436086460e-17 +324 311 -8.33333333333334e-02 +324 304 8.33333333333333e-02 +324 415 1.74556549770166e-17 +324 325 2.77555756156289e-17 +324 268 -4.39101879856629e-17 +324 394 4.16666666666667e-02 +324 451 2.16840434497101e-18 +324 406 -2.77555756156289e-17 +324 310 -7.06086664831185e-18 +324 303 -9.72222222222221e-02 +324 414 1.11111111111111e-01 +324 329 6.88468379528295e-18 +324 267 -1.11111111111111e-01 +324 393 -6.94444444444444e-02 +324 450 -2.77777777777778e-02 +324 405 1.11111111111111e-01 +324 309 -9.72222222222222e-02 +325 325 5.55555555555556e-01 +325 272 -4.16666666666667e-02 +325 410 4.16666666666667e-02 +325 335 -1.31578098026483e-17 +325 328 -9.72222222222222e-02 +325 271 5.55555555555555e-02 +325 409 -6.94444444444444e-02 +325 334 -1.38888888888889e-02 +325 327 -8.33333333333334e-02 +325 270 7.15573433840433e-18 +325 408 -4.16666666666667e-02 +325 333 3.57786716920216e-18 +325 305 2.37033699959643e-17 +325 416 3.22092748522920e-17 +325 326 -1.66666666666667e-01 +325 269 -4.16666666666667e-02 +325 395 4.16666666666667e-02 +325 452 1.66666666666667e-01 +325 407 -2.02349818351948e-17 +325 311 -2.04253524900902e-17 +325 304 -9.72222222222222e-02 +325 415 -2.22222222222222e-01 +325 329 1.09639944692597e-17 +325 268 5.55555555555557e-02 +325 394 -6.94444444444444e-02 +325 451 -1.94444444444445e-01 +325 406 1.11111111111111e-01 +325 310 -1.38888888888889e-02 +325 303 8.33333333333333e-02 +325 414 2.04643160056639e-17 +325 324 2.77555756156289e-17 +325 267 -4.46284719249346e-17 +325 393 4.16666666666667e-02 +325 450 1.07064964532944e-18 +325 405 -2.08166817117217e-17 +325 309 -7.53689916466876e-18 +326 326 5.55555555555556e-01 +326 272 5.55555555555555e-02 +326 410 -6.94444444444445e-02 +326 335 -9.72222222222222e-02 +326 328 1.00830802041152e-17 +326 271 -4.16666666666667e-02 +326 409 4.16666666666667e-02 +326 334 -1.08962318334793e-17 +326 327 6.72205346941013e-18 +326 270 7.46744246299391e-18 +326 408 4.16666666666667e-02 +326 333 8.33333333333334e-02 +326 305 -1.38888888888888e-02 +326 416 1.11111111111111e-01 +326 329 -1.38888888888889e-02 +326 269 5.55555555555557e-02 +326 395 -6.94444444444445e-02 +326 452 -1.94444444444445e-01 +326 407 -2.22222222222222e-01 +326 311 -9.72222222222225e-02 +326 304 2.08166817117217e-17 +326 415 3.03170032481259e-17 +326 325 -1.66666666666667e-01 +326 268 -4.16666666666667e-02 +326 394 4.16666666666667e-02 +326 451 1.66666666666667e-01 +326 406 -1.98680048107969e-17 +326 310 -2.01390553539182e-17 +326 303 -1.26174027823001e-17 +326 414 1.38777878078145e-17 +326 324 5.55111512312578e-17 +326 267 -7.41170769506458e-17 +326 393 -4.16666666666667e-02 +326 450 3.63207727782644e-18 +326 405 2.96156599677994e-17 +326 309 -8.33333333333334e-02 +327 327 1.11111111111111e+00 +327 428 4.16666666666667e-02 +327 355 -8.33333333333333e-02 +327 427 -4.16666666666667e-02 +327 354 -9.72222222222223e-02 +327 426 -6.94444444444444e-02 +327 431 -7.62261889893090e-17 +327 350 -1.65205306032479e-17 +327 455 1.66666666666667e-01 +327 422 4.16666666666667e-02 +327 430 2.60344046668082e-17 +327 349 8.33333333333334e-02 +327 454 5.90381964236247e-18 +327 421 4.16666666666667e-02 +327 429 -2.22222222222222e-01 +327 348 -9.72222222222223e-02 +327 453 -1.94444444444444e-01 +327 420 -6.94444444444444e-02 +327 332 4.77048955893622e-18 +327 284 -1.38777878078145e-17 +327 413 -4.16666666666667e-02 +327 338 1.22650370762423e-18 +327 331 8.33333333333333e-02 +327 283 -7.58941520739853e-18 +327 412 4.16666666666667e-02 +327 337 -4.10641572828885e-18 +327 330 -9.72222222222223e-02 +327 282 1.11111111111111e-01 +327 411 -6.94444444444444e-02 +327 336 -2.77777777777777e-02 +327 416 -1.24954300378954e-17 +327 329 5.55111512312578e-17 +327 272 -1.38777878078145e-17 +327 326 6.72205346941013e-18 +327 452 -1.66666666666667e-01 +327 410 3.29415348351934e-17 +327 335 1.27054942088145e-18 +327 407 -4.16666666666667e-02 +327 415 1.58293517182884e-17 +327 328 -5.55111512312578e-17 +327 271 -9.17506088465858e-18 +327 325 -8.33333333333334e-02 +327 451 8.87690528722507e-18 +327 409 -2.08166817117217e-17 +327 334 -3.87941089842470e-18 +327 406 -4.16666666666667e-02 +327 414 -2.22222222222222e-01 +327 356 -1.43385737311208e-17 +327 270 1.11111111111111e-01 +327 324 -9.72222222222223e-02 +327 450 -1.94444444444444e-01 +327 408 2.22222222222222e-01 +327 333 -2.77777777777777e-02 +327 405 -6.94444444444444e-02 +328 328 1.11111111111111e+00 +328 428 4.16666666666666e-02 +328 355 -9.72222222222222e-02 +328 427 -6.94444444444444e-02 +328 354 -8.33333333333333e-02 +328 426 -4.16666666666667e-02 +328 431 5.55111512312578e-17 +328 350 1.88651178012478e-17 +328 455 -9.42747670294036e-18 +328 422 -4.16666666666667e-02 +328 430 1.11111111111111e-01 +328 349 -9.72222222222223e-02 +328 454 -2.77777777777777e-02 +328 421 -6.94444444444444e-02 +328 429 3.06829214813398e-17 +328 348 8.33333333333334e-02 +328 453 5.44811591673966e-18 +328 420 4.16666666666667e-02 +328 332 1.01915004213637e-17 +328 284 1.06726151354042e-18 +328 413 4.16666666666667e-02 +328 338 1.66666666666667e-01 +328 331 -9.72222222222223e-02 +328 283 -2.22222222222222e-01 +328 412 -6.94444444444444e-02 +328 337 -1.94444444444444e-01 +328 330 8.33333333333334e-02 +328 282 -9.28348110190713e-18 +328 411 4.16666666666667e-02 +328 336 -3.93700913883799e-18 +328 416 -1.38777878078145e-17 +328 329 0.00000000000000e+00 +328 272 -1.15196480826585e-18 +328 326 1.00830802041152e-17 +328 452 -3.45589442479755e-19 +328 410 -1.23277175143391e-17 +328 335 -1.66666666666667e-01 +328 407 -4.16666666666667e-02 +328 415 1.11111111111111e-01 +328 356 -3.39219754716402e-17 +328 271 -2.22222222222222e-01 +328 325 -9.72222222222222e-02 +328 451 -2.77777777777778e-02 +328 409 2.22222222222222e-01 +328 334 -1.94444444444444e-01 +328 406 -6.94444444444444e-02 +328 414 1.64663204946236e-17 +328 327 -5.55111512312578e-17 +328 270 -7.69783542464708e-18 +328 324 -8.33333333333333e-02 +328 450 7.06425478010086e-18 +328 408 -6.93889390390723e-18 +328 333 -3.67273485929465e-18 +328 405 -4.16666666666667e-02 +329 329 1.11111111111111e+00 +329 428 -6.94444444444444e-02 +329 355 -3.17671236538253e-17 +329 427 4.16666666666666e-02 +329 354 -1.47451495458029e-17 +329 426 4.16666666666667e-02 +329 431 1.11111111111111e-01 +329 350 -1.38888888888889e-02 +329 455 -1.94444444444444e-01 +329 422 -6.94444444444444e-02 +329 430 5.55111512312578e-17 +329 349 1.86618298939067e-17 +329 454 -1.02321580028319e-17 +329 421 -4.16666666666667e-02 +329 429 -7.51081054989333e-17 +329 348 -1.65882932390282e-17 +329 453 1.66666666666667e-01 +329 420 4.16666666666667e-02 +329 332 -1.38888888888889e-02 +329 284 1.11111111111111e-01 +329 413 -6.94444444444444e-02 +329 338 -1.94444444444444e-01 +329 331 8.45677694538693e-18 +329 283 2.30392961653170e-18 +329 412 4.16666666666667e-02 +329 337 1.66666666666667e-01 +329 330 5.78692909564138e-18 +329 282 -1.38777878078145e-17 +329 411 -4.16666666666667e-02 +329 336 2.81892564846231e-18 +329 416 1.11111111111111e-01 +329 356 -1.38888888888889e-02 +329 272 1.11111111111111e-01 +329 326 -1.38888888888889e-02 +329 452 -1.94444444444444e-01 +329 410 -4.44444444444445e-01 +329 335 -1.94444444444444e-01 +329 407 -6.94444444444444e-02 +329 415 -2.08166817117217e-17 +329 328 0.00000000000000e+00 +329 271 -8.31786354203723e-19 +329 325 9.33769121053141e-18 +329 451 4.51299154297091e-18 +329 409 -2.23836926641421e-17 +329 334 -1.66666666666667e-01 +329 406 -4.16666666666667e-02 +329 414 -1.28223847555356e-17 +329 327 5.55111512312578e-17 +329 270 -1.38777878078145e-17 +329 324 6.87113126812688e-18 +329 450 -1.66666666666667e-01 +329 408 3.27937275858975e-17 +329 333 1.20617491689012e-18 +329 405 -4.16666666666667e-02 +330 330 5.55555555555555e-01 +330 305 -1.04083408558608e-17 +330 314 -8.33333333333334e-02 +330 395 -4.16666666666667e-02 +330 280 -4.33680868994202e-17 +330 304 -8.33333333333334e-02 +330 313 -8.23993651088983e-18 +330 394 -4.16666666666667e-02 +330 279 -1.11111111111111e-01 +330 303 -9.72222222222222e-02 +330 312 -9.72222222222221e-02 +330 393 -6.94444444444444e-02 +330 332 1.38777878078145e-17 +330 284 -2.02745806254789e-17 +330 329 5.80048162279745e-18 +330 416 2.08166817117217e-17 +330 413 1.13299127024735e-17 +330 338 8.33333333333334e-02 +330 410 4.16666666666667e-02 +330 452 1.94139951510686e-18 +330 331 2.77555756156289e-17 +330 283 6.28837260041593e-18 +330 328 8.33333333333334e-02 +330 415 2.04643160056639e-17 +330 412 6.93889390390723e-18 +330 337 2.73761048552590e-18 +330 409 4.16666666666667e-02 +330 451 2.30562368242621e-18 +330 281 1.73472347597681e-18 +330 282 -1.11111111111111e-01 +330 327 -9.72222222222223e-02 +330 414 1.11111111111111e-01 +330 411 1.11111111111111e-01 +330 336 -9.72222222222222e-02 +330 408 -6.94444444444445e-02 +330 450 -2.77777777777778e-02 +331 331 5.55555555555556e-01 +331 305 -2.39608680119296e-17 +331 314 -2.96122718360103e-17 +331 395 -4.16666666666668e-02 +331 280 5.55555555555558e-02 +331 304 -9.72222222222224e-02 +331 313 -1.38888888888888e-02 +331 394 -6.94444444444445e-02 +331 279 -4.62954327651310e-17 +331 303 -8.33333333333334e-02 +331 312 -8.03664860354880e-18 +331 393 -4.16666666666667e-02 +331 332 1.66666666666667e-01 +331 284 4.16666666666667e-02 +331 329 8.45677694538693e-18 +331 416 3.55211736760563e-17 +331 413 -1.86635239598013e-17 +331 338 -6.45100292628875e-18 +331 410 -4.16666666666667e-02 +331 452 -1.66666666666667e-01 +331 281 4.16666666666667e-02 +331 283 5.55555555555555e-02 +331 328 -9.72222222222223e-02 +331 415 -2.22222222222222e-01 +331 412 1.11111111111111e-01 +331 337 -1.38888888888889e-02 +331 409 -6.94444444444445e-02 +331 451 -1.94444444444445e-01 +331 330 5.55111512312578e-17 +331 282 6.07153216591882e-18 +331 327 8.33333333333333e-02 +331 414 1.82145964977565e-17 +331 411 1.38777878078145e-17 +331 336 4.77048955893622e-18 +331 408 4.16666666666667e-02 +331 450 -1.20617491689012e-18 +332 332 5.55555555555556e-01 +332 305 -1.38888888888889e-02 +332 314 -9.72222222222222e-02 +332 395 -6.94444444444445e-02 +332 280 4.16666666666667e-02 +332 304 -2.18195687212708e-17 +332 313 -2.87313575708659e-17 +332 394 -4.16666666666668e-02 +332 279 3.14418630020796e-18 +332 303 -1.06522863446701e-17 +332 312 -8.33333333333334e-02 +332 393 -4.16666666666667e-02 +332 281 5.55555555555558e-02 +332 284 5.55555555555555e-02 +332 329 -1.38888888888889e-02 +332 416 1.11111111111111e-01 +332 413 -2.22222222222222e-01 +332 338 -9.72222222222222e-02 +332 410 -6.94444444444445e-02 +332 452 -1.94444444444445e-01 +332 331 1.66666666666667e-01 +332 283 4.16666666666667e-02 +332 328 1.02999206386123e-17 +332 415 3.58430461960130e-17 +332 412 -1.82145964977565e-17 +332 337 -5.74627151417317e-18 +332 409 -4.16666666666667e-02 +332 451 -1.66666666666667e-01 +332 330 -1.38777878078145e-17 +332 282 -1.99493199737333e-17 +332 327 4.77048955893622e-18 +332 414 1.38777878078145e-17 +332 411 3.90312782094782e-18 +332 336 8.33333333333333e-02 +332 408 4.16666666666667e-02 +332 450 3.51010453342182e-18 +333 333 1.11111111111111e+00 +333 350 -8.33333333333334e-02 +333 430 -4.16666666666667e-02 +333 349 3.35763860291605e-18 +333 429 -6.94444444444444e-02 +333 348 -9.72222222222223e-02 +333 455 -3.23803755076374e-17 +333 422 -4.32994772306926e-17 +333 419 4.16666666666667e-02 +333 341 8.33333333333333e-02 +333 454 -1.66666666666667e-01 +333 421 2.37330161491182e-17 +333 418 -4.16666666666667e-02 +333 340 3.66765266161112e-18 +333 453 -1.94444444444445e-01 +333 420 -2.22222222222223e-01 +333 417 -6.94444444444444e-02 +333 339 -9.72222222222222e-02 +333 416 4.16666666666667e-02 +333 329 1.51788304147971e-18 +333 272 -2.45639554703747e-18 +333 326 8.33333333333334e-02 +333 415 4.16666666666667e-02 +333 328 -3.68628738645072e-18 +333 271 -6.93889390390723e-18 +333 325 3.46944695195361e-18 +333 414 -6.94444444444445e-02 +333 327 -2.77777777777777e-02 +333 270 1.11111111111111e-01 +333 324 -9.72222222222222e-02 +333 452 1.35525271560688e-17 +333 410 -6.93889390390723e-18 +333 335 1.38777878078145e-17 +333 407 1.45757429563520e-17 +333 404 -4.16666666666667e-02 +333 320 1.19939865331209e-18 +333 248 1.02194525086231e-18 +333 317 -8.33333333333333e-02 +333 451 1.66666666666667e-01 +333 409 -1.93970544921235e-17 +333 334 -1.38777878078145e-17 +333 406 1.89057753827160e-17 +333 403 4.16666666666667e-02 +333 319 -4.54009659728305e-18 +333 247 -6.93889390390723e-18 +333 316 3.67273485929465e-18 +333 450 -1.94444444444445e-01 +333 408 2.22222222222222e-01 +333 431 -4.16666666666667e-02 +333 405 -2.22222222222222e-01 +333 402 -6.94444444444444e-02 +333 318 -2.77777777777777e-02 +333 246 1.11111111111111e-01 +333 315 -9.72222222222222e-02 +334 334 1.11111111111111e+00 +334 350 1.40268656065312e-17 +334 430 -6.94444444444444e-02 +334 349 -1.38888888888889e-02 +334 429 -4.16666666666667e-02 +334 348 3.15773882736403e-18 +334 455 -7.17724897526459e-17 +334 422 6.24500451351651e-17 +334 419 4.16666666666666e-02 +334 341 2.06506632540598e-18 +334 454 -1.94444444444444e-01 +334 421 1.11111111111111e-01 +334 418 -6.94444444444444e-02 +334 340 -1.38888888888889e-02 +334 453 -1.66666666666667e-01 +334 420 2.77589637474179e-17 +334 417 -4.16666666666667e-02 +334 339 3.17129135452010e-18 +334 416 -4.16666666666667e-02 +334 329 -1.66666666666667e-01 +334 272 2.61733180701579e-18 +334 326 -1.09504419421036e-17 +334 415 -6.94444444444445e-02 +334 328 -1.94444444444444e-01 +334 271 1.11111111111111e-01 +334 325 -1.38888888888889e-02 +334 414 4.16666666666667e-02 +334 327 -4.20636561606486e-18 +334 270 0.00000000000000e+00 +334 324 4.01493616998538e-18 +334 452 1.17381825830501e-17 +334 410 9.01412462468026e-18 +334 335 1.38777878078145e-16 +334 407 -1.38777878078145e-17 +334 404 4.16666666666667e-02 +334 320 1.66666666666667e-01 +334 248 8.97854924089558e-20 +334 317 -1.86177841806495e-18 +334 451 -1.94444444444444e-01 +334 409 -4.44444444444444e-01 +334 431 -4.16666666666667e-02 +334 406 1.11111111111111e-01 +334 403 -6.94444444444444e-02 +334 319 -1.94444444444444e-01 +334 247 1.11111111111111e-01 +334 316 -1.38888888888889e-02 +334 450 1.66666666666667e-01 +334 408 -2.53294614964558e-17 +334 333 -1.38777878078145e-17 +334 405 2.03440373271538e-17 +334 402 4.16666666666667e-02 +334 318 -4.16570803459665e-18 +334 246 0.00000000000000e+00 +334 315 3.97427858851718e-18 +335 335 1.11111111111111e+00 +335 350 -9.72222222222223e-02 +335 430 -4.16666666666667e-02 +335 349 1.27292111313376e-17 +335 429 -4.16666666666667e-02 +335 348 -8.33333333333334e-02 +335 455 -2.77777777777778e-02 +335 422 1.11111111111111e-01 +335 419 -6.94444444444444e-02 +335 341 -9.72222222222222e-02 +335 454 -6.98361724352226e-17 +335 421 5.55111512312578e-17 +335 418 4.16666666666666e-02 +335 340 1.70761842166467e-18 +335 453 -3.17806761809813e-17 +335 420 -4.37136763418999e-17 +335 417 4.16666666666667e-02 +335 339 8.33333333333333e-02 +335 416 -6.94444444444445e-02 +335 329 -1.94444444444444e-01 +335 272 -2.22222222222222e-01 +335 326 -9.72222222222222e-02 +335 415 -4.16666666666667e-02 +335 328 -1.66666666666667e-01 +335 271 -3.38622596488588e-18 +335 325 -1.31561157367538e-17 +335 414 4.16666666666667e-02 +335 327 2.90871114087127e-18 +335 270 1.02533338265133e-18 +335 324 8.33333333333334e-02 +335 452 -2.77777777777778e-02 +335 410 2.22222222222222e-01 +335 431 -6.94444444444445e-02 +335 407 1.11111111111111e-01 +335 404 -6.94444444444444e-02 +335 320 -1.94444444444444e-01 +335 248 -2.22222222222222e-01 +335 317 -9.72222222222222e-02 +335 451 9.89334482393023e-18 +335 409 1.72811661898822e-17 +335 334 1.38777878078145e-16 +335 406 -1.38777878078145e-17 +335 403 4.16666666666667e-02 +335 319 1.66666666666667e-01 +335 247 1.86347248395946e-20 +335 316 2.24971950790742e-18 +335 450 1.31374810119142e-17 +335 408 -6.93889390390723e-18 +335 333 1.38777878078145e-17 +335 405 1.51284319544354e-17 +335 402 -4.16666666666667e-02 +335 318 1.08420217248550e-18 +335 246 -1.14180041289880e-18 +335 315 -8.33333333333333e-02 +336 336 1.11111111111111e+00 +336 431 -4.16666666666667e-02 +336 355 2.90024081139872e-18 +336 430 4.16666666666667e-02 +336 354 -9.72222222222223e-02 +336 429 -6.94444444444444e-02 +336 428 -1.05479318855684e-16 +336 455 -3.48215244616243e-17 +336 347 8.33333333333334e-02 +336 419 4.16666666666667e-02 +336 427 2.49840838122128e-17 +336 454 1.66666666666667e-01 +336 346 2.66984784974555e-18 +336 418 4.16666666666667e-02 +336 426 -2.22222222222222e-01 +336 453 -1.94444444444445e-01 +336 345 -9.72222222222222e-02 +336 417 -6.94444444444444e-02 +336 332 8.33333333333333e-02 +336 284 3.75133951679985e-17 +336 329 3.26615904461258e-18 +336 416 4.16666666666667e-02 +336 331 2.60208521396521e-18 +336 283 -1.38777878078145e-17 +336 328 -3.93700913883799e-18 +336 415 -4.16666666666667e-02 +336 330 -9.72222222222222e-02 +336 282 1.11111111111111e-01 +336 327 -2.77777777777777e-02 +336 414 -6.94444444444444e-02 +336 413 -4.09828421199521e-17 +336 338 1.11022302462516e-16 +336 410 -6.93889390390723e-18 +336 452 1.89735380184963e-17 +336 323 -8.33333333333334e-02 +336 260 3.10488397145536e-17 +336 320 1.27054942088145e-18 +336 404 -4.16666666666667e-02 +336 412 1.47722546001150e-17 +336 337 -6.93889390390723e-17 +336 409 -2.25645341983809e-17 +336 451 -1.66666666666667e-01 +336 322 4.98732999343332e-18 +336 259 -1.38777878078145e-17 +336 319 -4.09625133292180e-18 +336 403 -4.16666666666667e-02 +336 411 -2.22222222222222e-01 +336 356 -8.33333333333333e-02 +336 408 2.22222222222222e-01 +336 450 -1.94444444444444e-01 +336 321 -9.72222222222222e-02 +336 258 1.11111111111111e-01 +336 318 -2.77777777777777e-02 +336 402 -6.94444444444444e-02 +337 337 1.11111111111111e+00 +337 431 4.16666666666667e-02 +337 355 -1.38888888888889e-02 +337 430 -6.94444444444444e-02 +337 354 3.03576608295941e-18 +337 429 4.16666666666667e-02 +337 428 0.00000000000000e+00 +337 455 3.40710532703570e-17 +337 347 -1.14789905011903e-17 +337 419 -4.16666666666667e-02 +337 427 1.11111111111111e-01 +337 454 -1.94444444444445e-01 +337 346 -1.38888888888888e-02 +337 418 -6.94444444444444e-02 +337 426 2.53703308361608e-17 +337 453 1.66666666666667e-01 +337 345 2.71050543121376e-18 +337 417 4.16666666666667e-02 +337 332 -5.63785129692462e-18 +337 284 -1.63443477502190e-17 +337 329 1.66666666666667e-01 +337 416 4.16666666666667e-02 +337 331 -1.38888888888889e-02 +337 283 1.11111111111111e-01 +337 328 -1.94444444444444e-01 +337 415 -6.94444444444444e-02 +337 330 2.95445092002300e-18 +337 282 -1.38777878078145e-17 +337 327 -3.68628738645072e-18 +337 414 -4.16666666666667e-02 +337 413 -3.46944695195361e-17 +337 338 -6.93889390390723e-17 +337 410 1.91412505420527e-17 +337 452 1.43792313125890e-17 +337 323 -2.30392961653170e-19 +337 260 -1.25005122355790e-17 +337 320 -1.66666666666667e-01 +337 404 -4.16666666666667e-02 +337 412 1.11111111111111e-01 +337 356 5.09575021068187e-18 +337 409 -4.44444444444444e-01 +337 451 -1.94444444444444e-01 +337 322 -1.38888888888889e-02 +337 259 1.11111111111111e-01 +337 319 -1.94444444444444e-01 +337 403 -6.94444444444444e-02 +337 411 1.49348849259878e-17 +337 336 -6.93889390390723e-17 +337 408 -1.93970544921235e-17 +337 450 -1.66666666666667e-01 +337 321 3.06287113727155e-18 +337 258 -6.93889390390723e-18 +337 318 -4.10641572828885e-18 +337 402 -4.16666666666667e-02 +338 338 1.11111111111111e+00 +338 431 -6.94444444444445e-02 +338 355 2.18195687212708e-18 +338 430 4.16666666666667e-02 +338 354 -8.33333333333334e-02 +338 429 -4.16666666666667e-02 +338 428 1.11111111111111e-01 +338 455 -2.77777777777778e-02 +338 347 -9.72222222222221e-02 +338 419 -6.94444444444444e-02 +338 427 6.93889390390723e-18 +338 454 3.64630743134031e-17 +338 346 -1.19262238973405e-17 +338 418 -4.16666666666667e-02 +338 426 -1.02782365951626e-16 +338 453 -3.48842048997211e-17 +338 345 8.33333333333333e-02 +338 417 4.16666666666667e-02 +338 332 -9.72222222222222e-02 +338 284 -2.22222222222222e-01 +338 329 -1.94444444444444e-01 +338 416 -6.94444444444445e-02 +338 331 -6.57297567069337e-18 +338 283 -1.58598449043895e-17 +338 328 1.66666666666667e-01 +338 415 4.16666666666667e-02 +338 330 8.33333333333334e-02 +338 282 3.80961538357094e-17 +338 327 1.22650370762423e-18 +338 414 4.16666666666667e-02 +338 413 1.11111111111111e-01 +338 356 -9.72222222222223e-02 +338 410 2.22222222222222e-01 +338 452 -2.77777777777778e-02 +338 323 -9.72222222222222e-02 +338 260 -2.22222222222222e-01 +338 320 -1.94444444444444e-01 +338 404 -6.94444444444444e-02 +338 412 -4.16333634234434e-17 +338 337 -6.93889390390723e-17 +338 409 1.91717437281538e-17 +338 451 1.54566572214965e-17 +338 322 5.42101086242752e-19 +338 259 -2.24023273889817e-17 +338 319 -1.66666666666667e-01 +338 403 -4.16666666666667e-02 +338 411 -4.15249432061948e-17 +338 336 1.11022302462516e-16 +338 408 -6.93889390390723e-18 +338 450 1.77470343108721e-17 +338 321 -8.33333333333334e-02 +338 258 3.39355279987963e-17 +338 318 1.20617491689012e-18 +338 402 -4.16666666666667e-02 +339 339 5.55555555555555e-01 +339 359 -8.33333333333333e-02 +339 344 3.87602276663568e-18 +339 251 7.94292440793511e-17 +339 424 -4.16666666666667e-02 +339 358 8.91756286869327e-18 +339 343 -8.33333333333334e-02 +339 250 4.08282586070782e-17 +339 423 -6.94444444444444e-02 +339 357 -9.72222222222221e-02 +339 342 -9.72222222222221e-02 +339 249 -1.11111111111111e-01 +339 410 4.16666666666667e-02 +339 455 6.57297567069337e-18 +339 422 -3.41337337084538e-17 +339 335 8.33333333333333e-02 +339 320 -1.63307952230629e-17 +339 419 2.08166817117217e-17 +339 341 -6.93889390390723e-17 +339 248 -2.15281893874153e-17 +339 409 4.16666666666667e-02 +339 454 -5.67850887839283e-18 +339 421 0.00000000000000e+00 +339 334 3.38813178901720e-18 +339 319 8.33333333333334e-02 +339 418 -2.32375018749745e-17 +339 340 -5.55111512312578e-17 +339 247 1.01542309716846e-17 +339 408 -6.94444444444444e-02 +339 453 -2.77777777777778e-02 +339 420 1.11111111111111e-01 +339 333 -9.72222222222222e-02 +339 318 -9.72222222222223e-02 +339 417 1.11111111111111e-01 +339 425 -4.16666666666667e-02 +339 246 -1.11111111111111e-01 +340 340 5.55555555555555e-01 +340 359 1.27800331081729e-17 +340 344 3.42692589800145e-17 +340 251 4.16666666666667e-02 +340 424 -6.94444444444444e-02 +340 358 -1.38888888888888e-02 +340 343 -9.72222222222221e-02 +340 250 5.55555555555556e-02 +340 423 -4.16666666666667e-02 +340 357 7.54875762593032e-18 +340 342 -8.33333333333334e-02 +340 249 3.84569898712397e-17 +340 410 -4.16666666666667e-02 +340 455 -1.66666666666667e-01 +340 422 -3.72863903381343e-17 +340 335 1.59919820441612e-18 +340 320 1.52940268956236e-17 +340 419 8.14083365606108e-18 +340 341 1.66666666666667e-01 +340 248 4.16666666666667e-02 +340 409 -6.94444444444444e-02 +340 454 -1.94444444444445e-01 +340 421 1.11111111111111e-01 +340 334 -1.38888888888889e-02 +340 319 -9.72222222222222e-02 +340 418 -2.22222222222222e-01 +340 425 -4.16666666666667e-02 +340 247 5.55555555555555e-02 +340 408 4.16666666666667e-02 +340 453 -5.42101086242752e-18 +340 420 6.93889390390723e-18 +340 333 3.34239200986547e-18 +340 318 8.33333333333334e-02 +340 417 -2.55795479741326e-17 +340 339 -5.55111512312578e-17 +340 246 1.20911835638183e-17 +341 341 5.55555555555555e-01 +341 359 -9.72222222222220e-02 +341 344 -1.38888888888888e-02 +341 251 5.55555555555556e-02 +341 424 -4.16666666666667e-02 +341 358 1.32645359540023e-17 +341 343 3.53314382958714e-17 +341 250 4.16666666666667e-02 +341 423 -4.16666666666667e-02 +341 357 -8.33333333333333e-02 +341 342 4.03865309250850e-18 +341 249 7.92585669404794e-17 +341 410 -6.94444444444444e-02 +341 455 -1.94444444444445e-01 +341 422 -2.22222222222222e-01 +341 335 -9.72222222222222e-02 +341 320 -1.38888888888889e-02 +341 419 1.11111111111111e-01 +341 425 -6.94444444444445e-02 +341 248 5.55555555555556e-02 +341 409 -4.16666666666667e-02 +341 454 -1.66666666666667e-01 +341 421 -3.80529551553994e-17 +341 334 2.06676039130049e-18 +341 319 1.52059354691092e-17 +341 418 9.55114351323949e-18 +341 340 1.66666666666667e-01 +341 247 4.16666666666667e-02 +341 408 4.16666666666667e-02 +341 453 4.54009659728305e-18 +341 420 -2.88202960303276e-17 +341 333 8.33333333333333e-02 +341 318 -1.60241692961569e-17 +341 417 2.08166817117217e-17 +341 339 -6.93889390390723e-17 +341 246 -2.13496771937815e-17 +342 342 1.11111111111111e+00 +342 371 9.66972812585509e-18 +342 442 -4.16666666666667e-02 +342 370 -8.33333333333334e-02 +342 441 -6.94444444444444e-02 +342 369 -9.72222222222222e-02 +342 458 -1.66666666666667e-01 +342 437 -4.16666666666667e-02 +342 434 3.13289958618580e-17 +342 365 7.50301784677859e-18 +342 457 5.98344073940438e-18 +342 436 4.16666666666667e-02 +342 433 -4.33786748112609e-18 +342 364 8.33333333333334e-02 +342 456 -1.94444444444444e-01 +342 435 -6.94444444444444e-02 +342 432 -2.22222222222223e-01 +342 363 -9.72222222222222e-02 +342 428 4.16666666666667e-02 +342 362 5.82758667710959e-19 +342 347 2.54787510534094e-18 +342 263 -2.08166817117217e-17 +342 427 4.16666666666667e-02 +342 361 -1.06929439261383e-17 +342 346 8.33333333333334e-02 +342 262 -1.83890852848909e-17 +342 426 -6.94444444444444e-02 +342 360 -2.77777777777778e-02 +342 345 -9.72222222222221e-02 +342 261 1.11111111111111e-01 +342 455 1.66666666666667e-01 +342 425 -6.33292653344150e-17 +342 359 2.19550939928315e-18 +342 422 4.16666666666667e-02 +342 419 1.00292089086698e-16 +342 344 -2.08166817117217e-16 +342 251 -2.77555756156289e-17 +342 341 5.01443504774546e-18 +342 454 1.70219741080224e-17 +342 424 -2.08166817117217e-17 +342 358 -6.05289744107923e-18 +342 421 -4.16666666666667e-02 +342 418 7.82760087216644e-17 +342 343 -8.32667268468867e-17 +342 250 -1.37318863826499e-17 +342 340 -8.33333333333334e-02 +342 453 -1.94444444444444e-01 +342 423 2.22222222222222e-01 +342 357 -2.77777777777778e-02 +342 420 -6.94444444444444e-02 +342 417 -2.22222222222222e-01 +342 443 -4.16666666666667e-02 +342 249 1.11111111111111e-01 +342 339 -9.72222222222221e-02 +343 343 1.11111111111111e+00 +343 371 1.09775469964157e-17 +343 442 -6.94444444444444e-02 +343 370 -9.72222222222222e-02 +343 441 -4.16666666666667e-02 +343 369 -8.33333333333334e-02 +343 458 -4.30970363562988e-18 +343 437 4.16666666666667e-02 +343 434 6.93889390390723e-18 +343 365 -1.53550132678260e-17 +343 457 -2.77777777777778e-02 +343 436 -6.94444444444444e-02 +343 433 1.11111111111111e-01 +343 364 -9.72222222222222e-02 +343 456 5.93600689435814e-18 +343 435 4.16666666666667e-02 +343 432 -2.46825400829903e-18 +343 363 8.33333333333334e-02 +343 428 -4.16666666666667e-02 +343 362 -1.66666666666667e-01 +343 347 -1.43301034016483e-17 +343 263 -2.15019313660504e-18 +343 427 -6.94444444444445e-02 +343 361 -1.94444444444445e-01 +343 346 -9.72222222222223e-02 +343 262 -2.22222222222222e-01 +343 426 4.16666666666667e-02 +343 360 -6.50013083722950e-18 +343 345 8.33333333333334e-02 +343 261 -1.72011215763667e-17 +343 455 -6.03900610074426e-17 +343 425 3.12385750947386e-18 +343 359 1.66666666666667e-01 +343 422 4.16666666666667e-02 +343 419 -5.55111512312578e-17 +343 344 1.66533453693773e-16 +343 251 -6.22908029410812e-18 +343 341 3.51145978613743e-17 +343 454 -2.77777777777778e-02 +343 424 2.22222222222222e-01 +343 358 -1.94444444444445e-01 +343 421 -6.94444444444444e-02 +343 418 1.11111111111111e-01 +343 443 -4.16666666666667e-02 +343 250 -2.22222222222222e-01 +343 340 -9.72222222222221e-02 +343 453 1.80621305672507e-17 +343 423 -2.08166817117217e-17 +343 357 -1.07064964532944e-17 +343 420 -4.16666666666667e-02 +343 417 8.04575420773179e-17 +343 342 -8.32667268468867e-17 +343 249 -2.05591836957564e-17 +343 339 -8.33333333333334e-02 +344 344 1.11111111111111e+00 +344 371 -1.38888888888889e-02 +344 442 -4.16666666666667e-02 +344 370 1.08691267791672e-17 +344 441 -4.16666666666667e-02 +344 369 1.04354459101730e-17 +344 458 -1.94444444444444e-01 +344 437 -6.94444444444444e-02 +344 434 1.11111111111111e-01 +344 365 -1.38888888888889e-02 +344 457 -2.99680256738571e-18 +344 436 4.16666666666667e-02 +344 433 0.00000000000000e+00 +344 364 -1.35593034196468e-17 +344 456 -1.66666666666667e-01 +344 435 -4.16666666666667e-02 +344 432 2.68306156372272e-17 +344 363 6.97955148537543e-18 +344 428 -6.94444444444445e-02 +344 362 -1.94444444444444e-01 +344 347 -1.38888888888889e-02 +344 263 1.11111111111111e-01 +344 427 -4.16666666666667e-02 +344 361 -1.66666666666667e-01 +344 346 -1.63714528045311e-17 +344 262 -3.67951112287268e-18 +344 426 4.16666666666667e-02 +344 360 -1.40438062654763e-18 +344 345 2.49027686492764e-18 +344 261 -2.77555756156289e-17 +344 455 -1.94444444444445e-01 +344 425 -4.44444444444445e-01 +344 359 -1.94444444444444e-01 +344 422 -6.94444444444445e-02 +344 419 1.11111111111111e-01 +344 443 -6.94444444444444e-02 +344 251 1.11111111111111e-01 +344 341 -1.38888888888888e-02 +344 454 -6.02342069451478e-17 +344 424 1.05110436007154e-17 +344 358 1.66666666666667e-01 +344 421 4.16666666666667e-02 +344 418 -5.55111512312578e-17 +344 343 1.66533453693773e-16 +344 250 -3.66807617808475e-18 +344 340 3.42692589800145e-17 +344 453 1.66666666666667e-01 +344 423 -6.87958042177575e-17 +344 357 1.94478764689587e-18 +344 420 4.16666666666667e-02 +344 417 9.71440911382276e-17 +344 342 -1.80411241501588e-16 +344 249 -2.77555756156289e-17 +344 339 3.90312782094782e-18 +345 345 5.55555555555556e-01 +345 410 4.16666666666667e-02 +345 260 -5.14996031930615e-17 +345 320 -1.44334414212133e-17 +345 337 2.71050543121376e-18 +345 409 -4.16666666666667e-02 +345 259 1.15332006098146e-17 +345 319 -8.33333333333334e-02 +345 336 -9.72222222222222e-02 +345 408 -6.94444444444444e-02 +345 258 -1.11111111111111e-01 +345 318 -9.72222222222222e-02 +345 428 1.81061762805079e-17 +345 362 -8.33333333333333e-02 +345 425 -4.16666666666667e-02 +345 455 5.61074624261249e-18 +345 347 4.16333634234434e-17 +345 263 1.85805147309703e-17 +345 344 2.58683862091463e-18 +345 419 2.08166817117217e-17 +345 427 -1.38777878078145e-17 +345 361 8.17217387510949e-18 +345 424 4.16666666666667e-02 +345 454 -4.21483594553740e-18 +345 346 -5.55111512312578e-17 +345 262 3.86789125034204e-17 +345 343 8.33333333333334e-02 +345 418 -2.55827243476848e-17 +345 426 1.11111111111111e-01 +345 360 -9.72222222222222e-02 +345 423 -6.94444444444445e-02 +345 453 -2.77777777777778e-02 +345 338 8.33333333333334e-02 +345 261 -1.11111111111111e-01 +345 342 -9.72222222222221e-02 +345 417 1.11111111111111e-01 +346 346 5.55555555555556e-01 +346 410 4.16666666666666e-02 +346 260 -4.16666666666667e-02 +346 320 -3.80012861456169e-17 +346 337 -1.38888888888888e-02 +346 409 -6.94444444444444e-02 +346 259 5.55555555555555e-02 +346 319 -9.72222222222221e-02 +346 336 2.99510850149121e-18 +346 408 -4.16666666666667e-02 +346 258 1.16060454432784e-17 +346 318 -8.33333333333334e-02 +346 428 1.99764250280454e-17 +346 362 2.46113893154210e-17 +346 425 4.16666666666667e-02 +346 455 1.66666666666667e-01 +346 347 -1.66666666666667e-01 +346 263 -4.16666666666667e-02 +346 344 -1.54092233764502e-17 +346 419 9.55114351323949e-18 +346 427 1.11111111111111e-01 +346 361 -1.38888888888888e-02 +346 424 -6.94444444444445e-02 +346 454 -1.94444444444445e-01 +346 338 -1.19262238973405e-17 +346 262 5.55555555555557e-02 +346 343 -9.72222222222223e-02 +346 418 -2.22222222222222e-01 +346 426 -1.38777878078145e-17 +346 360 7.69783542464708e-18 +346 423 4.16666666666667e-02 +346 453 -4.79759461324836e-18 +346 345 -5.55111512312578e-17 +346 261 3.93158812797556e-17 +346 342 8.33333333333334e-02 +346 417 -2.44843343733328e-17 +347 347 5.55555555555556e-01 +347 410 -6.94444444444444e-02 +347 260 5.55555555555555e-02 +347 320 -1.38888888888889e-02 +347 337 -1.14789905011903e-17 +347 409 4.16666666666666e-02 +347 259 -4.16666666666667e-02 +347 319 -3.78352676879551e-17 +347 336 8.33333333333333e-02 +347 408 4.16666666666667e-02 +347 258 -5.12556577042522e-17 +347 318 -1.36507829779503e-17 +347 428 -2.22222222222222e-01 +347 362 -9.72222222222222e-02 +347 425 -6.94444444444445e-02 +347 455 -1.94444444444445e-01 +347 338 -9.72222222222221e-02 +347 263 5.55555555555557e-02 +347 344 -1.38888888888889e-02 +347 419 1.11111111111111e-01 +347 427 2.27953506765077e-17 +347 361 2.17382535583344e-17 +347 424 4.16666666666667e-02 +347 454 1.66666666666667e-01 +347 346 -1.66666666666667e-01 +347 262 -4.16666666666667e-02 +347 343 -1.34746001249214e-17 +347 418 1.01197143790839e-17 +347 426 1.54634334850745e-17 +347 360 -8.33333333333333e-02 +347 423 -4.16666666666667e-02 +347 453 1.86686061574848e-18 +347 345 4.16333634234434e-17 +347 261 2.00577401909818e-17 +347 342 1.57209315010398e-18 +347 417 2.08166817117217e-17 +348 348 5.55555555555556e-01 +348 275 7.98243849492453e-17 +348 425 4.16666666666667e-02 +348 359 8.33333333333334e-02 +348 352 -8.33333333333333e-02 +348 274 4.76371329535819e-17 +348 424 -4.16666666666667e-02 +348 358 8.82100111270628e-18 +348 351 -9.72222222222222e-02 +348 273 -1.11111111111111e-01 +348 423 -6.94444444444444e-02 +348 357 -9.72222222222222e-02 +348 329 -1.66967134562768e-17 +348 431 1.38777878078145e-17 +348 350 -5.55111512312578e-17 +348 272 -2.21854869544846e-17 +348 410 -4.16666666666667e-02 +348 455 4.45878143434664e-18 +348 422 -3.31585870279273e-17 +348 335 -8.33333333333334e-02 +348 328 8.33333333333334e-02 +348 430 -3.48028897367847e-17 +348 349 -4.16333634234434e-17 +348 271 1.24683249835833e-17 +348 409 4.16666666666667e-02 +348 454 -5.55653613398821e-18 +348 421 0.00000000000000e+00 +348 334 2.95445092002300e-18 +348 327 -9.72222222222223e-02 +348 429 1.11111111111111e-01 +348 353 2.31748214368777e-18 +348 270 -1.11111111111111e-01 +348 408 -6.94444444444444e-02 +348 453 -2.77777777777778e-02 +348 420 1.11111111111111e-01 +348 333 -9.72222222222223e-02 +349 349 5.55555555555556e-01 +349 275 -4.16666666666667e-02 +349 425 4.16666666666667e-02 +349 359 -3.10386753191866e-17 +349 352 -9.72222222222221e-02 +349 274 5.55555555555557e-02 +349 424 -6.94444444444444e-02 +349 358 -1.38888888888889e-02 +349 351 -8.33333333333333e-02 +349 273 4.30428262476745e-17 +349 423 -4.16666666666667e-02 +349 357 8.67361737988404e-18 +349 329 1.86618298939067e-17 +349 431 1.12485975395371e-18 +349 350 -1.66666666666667e-01 +349 272 -4.16666666666666e-02 +349 410 4.16666666666667e-02 +349 455 1.66666666666667e-01 +349 422 -4.32433612979370e-17 +349 335 1.27292111313376e-17 +349 328 -9.72222222222223e-02 +349 430 -2.22222222222222e-01 +349 353 4.49401800495242e-17 +349 271 5.55555555555555e-02 +349 409 -6.94444444444444e-02 +349 454 -1.94444444444445e-01 +349 421 1.11111111111111e-01 +349 334 -1.38888888888889e-02 +349 327 8.33333333333334e-02 +349 429 -2.95309566730739e-17 +349 348 -4.16333634234434e-17 +349 270 1.26038502551440e-17 +349 408 4.16666666666667e-02 +349 453 -3.97427858851718e-18 +349 420 6.93889390390723e-18 +349 333 3.46605882016460e-18 +350 350 5.55555555555556e-01 +350 275 5.55555555555558e-02 +350 425 -6.94444444444445e-02 +350 359 -9.72222222222224e-02 +350 352 4.36933475511658e-17 +350 274 -4.16666666666667e-02 +350 424 4.16666666666667e-02 +350 358 -3.16722559637328e-17 +350 351 1.95156391047391e-18 +350 273 8.00547779108984e-17 +350 423 4.16666666666667e-02 +350 357 8.33333333333334e-02 +350 329 -1.38888888888889e-02 +350 431 1.11111111111111e-01 +350 353 -1.38888888888888e-02 +350 272 5.55555555555554e-02 +350 410 -6.94444444444445e-02 +350 455 -1.94444444444445e-01 +350 422 -2.22222222222222e-01 +350 335 -9.72222222222223e-02 +350 328 1.88651178012478e-17 +350 430 9.13440330319037e-18 +350 349 -1.66666666666667e-01 +350 271 -4.16666666666666e-02 +350 409 4.16666666666667e-02 +350 454 1.66666666666667e-01 +350 421 -3.56600870794060e-17 +350 334 1.40404181336873e-17 +350 327 -1.66289508204964e-17 +350 429 1.38777878078145e-17 +350 348 -5.55111512312578e-17 +350 270 -2.11368601657838e-17 +350 408 -4.16666666666667e-02 +350 453 8.32125167382625e-18 +350 420 -3.50146479735983e-17 +350 333 -8.33333333333334e-02 +351 351 1.11111111111111e+00 +351 443 4.16666666666667e-02 +351 379 -8.33333333333334e-02 +351 442 -4.16666666666667e-02 +351 378 -9.72222222222222e-02 +351 441 -6.94444444444444e-02 +351 446 2.97427149098875e-17 +351 374 6.83047368665868e-18 +351 458 1.66666666666667e-01 +351 437 4.16666666666667e-02 +351 445 -8.33480420098232e-18 +351 373 8.33333333333334e-02 +351 457 4.49435681813132e-18 +351 436 4.16666666666667e-02 +351 444 -2.22222222222222e-01 +351 372 -9.72222222222223e-02 +351 456 -1.94444444444444e-01 +351 435 -6.94444444444444e-02 +351 356 1.08420217248550e-19 +351 287 -6.93889390390723e-18 +351 428 -4.16666666666667e-02 +351 362 1.97019863531350e-18 +351 355 8.33333333333334e-02 +351 286 -2.56955914879065e-17 +351 427 4.16666666666667e-02 +351 361 -1.02728155843002e-17 +351 354 -9.72222222222223e-02 +351 285 1.11111111111111e-01 +351 426 -6.94444444444445e-02 +351 360 -2.77777777777778e-02 +351 431 9.82287168271867e-17 +351 353 -1.38777878078145e-16 +351 275 0.00000000000000e+00 +351 350 2.05998412772246e-18 +351 455 -1.66666666666667e-01 +351 425 -7.22923562240232e-17 +351 359 2.16162808139297e-18 +351 422 -4.16666666666667e-02 +351 430 9.16150835750251e-17 +351 352 -8.32667268468867e-17 +351 274 -2.17924636669586e-17 +351 349 -8.33333333333333e-02 +351 454 1.76318378300455e-17 +351 424 -2.08166817117217e-17 +351 358 -5.53620734325411e-18 +351 421 -4.16666666666667e-02 +351 429 -2.22222222222222e-01 +351 380 9.55453164502851e-18 +351 273 1.11111111111111e-01 +351 348 -9.72222222222222e-02 +351 453 -1.94444444444444e-01 +351 423 2.22222222222222e-01 +351 357 -2.77777777777778e-02 +351 420 -6.94444444444444e-02 +352 352 1.11111111111111e+00 +352 443 4.16666666666667e-02 +352 379 -9.72222222222223e-02 +352 442 -6.94444444444444e-02 +352 378 -8.33333333333334e-02 +352 441 -4.16666666666667e-02 +352 446 6.93889390390723e-18 +352 374 -1.51788304147971e-17 +352 458 8.58891408515861e-19 +352 437 -4.16666666666667e-02 +352 445 1.11111111111111e-01 +352 373 -9.72222222222222e-02 +352 457 -2.77777777777778e-02 +352 436 -6.94444444444444e-02 +352 444 -9.43255890062389e-18 +352 372 8.33333333333333e-02 +352 456 5.20417042793042e-18 +352 435 4.16666666666667e-02 +352 356 -5.44811591673966e-18 +352 287 -2.82824301088211e-17 +352 428 4.16666666666667e-02 +352 362 1.66666666666667e-01 +352 355 -9.72222222222224e-02 +352 286 -2.22222222222222e-01 +352 427 -6.94444444444445e-02 +352 361 -1.94444444444445e-01 +352 354 8.33333333333334e-02 +352 285 -2.00577401909818e-17 +352 426 4.16666666666667e-02 +352 360 -6.70511281046504e-18 +352 431 -1.38777878078145e-17 +352 353 2.77555756156289e-17 +352 275 -3.57109090562413e-17 +352 350 4.41270284201600e-17 +352 455 3.50146479735983e-17 +352 425 7.42297323326306e-18 +352 359 -1.66666666666667e-01 +352 422 -4.16666666666667e-02 +352 430 1.11111111111111e-01 +352 380 1.15467531369706e-17 +352 274 -2.22222222222222e-01 +352 349 -9.72222222222221e-02 +352 454 -2.77777777777777e-02 +352 424 2.22222222222222e-01 +352 358 -1.94444444444445e-01 +352 421 -6.94444444444444e-02 +352 429 9.14389007219962e-17 +352 351 -8.32667268468867e-17 +352 273 -2.39608680119296e-17 +352 348 -8.33333333333333e-02 +352 453 1.80926237533519e-17 +352 423 -2.08166817117217e-17 +352 357 -1.02728155843002e-17 +352 420 -4.16666666666667e-02 +353 353 1.11111111111111e+00 +353 443 -6.94444444444445e-02 +353 379 1.14925430283463e-17 +353 442 4.16666666666667e-02 +353 378 9.97465998686664e-18 +353 441 4.16666666666667e-02 +353 446 1.11111111111111e-01 +353 374 -1.38888888888889e-02 +353 458 -1.94444444444444e-01 +353 437 -6.94444444444444e-02 +353 445 1.38777878078145e-17 +353 373 -1.25089825650515e-17 +353 457 3.80826013085533e-18 +353 436 -4.16666666666667e-02 +353 444 3.15502832193282e-17 +353 372 7.26415455565288e-18 +353 456 1.66666666666667e-01 +353 435 4.16666666666667e-02 +353 356 -1.38888888888889e-02 +353 287 1.11111111111111e-01 +353 428 -6.94444444444445e-02 +353 362 -1.94444444444445e-01 +353 355 -5.31259064517897e-18 +353 286 -2.96258243631664e-17 +353 427 4.16666666666667e-02 +353 361 1.66666666666667e-01 +353 354 1.23327997120226e-18 +353 285 -6.93889390390723e-18 +353 426 -4.16666666666667e-02 +353 360 2.30392961653170e-18 +353 431 1.11111111111111e-01 +353 380 -1.38888888888889e-02 +353 275 1.11111111111111e-01 +353 350 -1.38888888888888e-02 +353 455 -1.94444444444444e-01 +353 425 -4.44444444444445e-01 +353 359 -1.94444444444444e-01 +353 422 -6.94444444444445e-02 +353 430 -1.38777878078145e-17 +353 352 1.38777878078145e-17 +353 274 -3.52755341213526e-17 +353 349 4.49537325766802e-17 +353 454 3.39219754716402e-17 +353 424 2.29545928705915e-18 +353 358 -1.66666666666667e-01 +353 421 -4.16666666666667e-02 +353 429 9.30279345310453e-17 +353 351 -1.24900090270330e-16 +353 273 0.00000000000000e+00 +353 348 2.31748214368777e-18 +353 453 -1.66666666666667e-01 +353 423 -6.59330446142747e-17 +353 357 2.30392961653170e-18 +353 420 -4.16666666666667e-02 +354 354 5.55555555555555e-01 +354 329 -1.48535697630514e-17 +354 338 -8.33333333333334e-02 +354 410 -4.16666666666667e-02 +354 283 1.30104260698261e-17 +354 328 -8.33333333333333e-02 +354 337 2.71050543121376e-18 +354 409 -4.16666666666667e-02 +354 282 -1.11111111111111e-01 +354 327 -9.72222222222223e-02 +354 336 -9.72222222222223e-02 +354 408 -6.94444444444444e-02 +354 356 6.93889390390723e-17 +354 287 1.57209315010398e-17 +354 353 1.21972744404619e-18 +354 431 1.38777878078145e-17 +354 428 1.90548531814327e-17 +354 362 8.33333333333334e-02 +354 425 4.16666666666667e-02 +354 455 2.91548740444930e-18 +354 355 -6.93889390390723e-17 +354 286 4.43438688546571e-17 +354 352 8.33333333333334e-02 +354 430 -2.75658402354440e-17 +354 427 -1.38777878078145e-17 +354 361 7.83336069620777e-18 +354 424 4.16666666666667e-02 +354 454 -4.66037527579316e-18 +354 284 -5.29090660172926e-17 +354 285 -1.11111111111111e-01 +354 351 -9.72222222222223e-02 +354 429 1.11111111111111e-01 +354 426 1.11111111111111e-01 +354 360 -9.72222222222222e-02 +354 423 -6.94444444444444e-02 +354 453 -2.77777777777778e-02 +355 355 5.55555555555556e-01 +355 329 -3.17671236538253e-17 +355 338 2.18195687212708e-18 +355 410 -4.16666666666667e-02 +355 283 5.55555555555555e-02 +355 328 -9.72222222222222e-02 +355 337 -1.38888888888889e-02 +355 409 -6.94444444444444e-02 +355 282 1.35525271560688e-17 +355 327 -8.33333333333333e-02 +355 336 2.79182059415017e-18 +355 408 -4.16666666666667e-02 +355 356 1.66666666666667e-01 +355 287 4.16666666666667e-02 +355 353 -5.20417042793042e-18 +355 431 8.71427496135224e-18 +355 428 3.00611992980551e-17 +355 362 -2.91921434941722e-17 +355 425 -4.16666666666667e-02 +355 455 -1.66666666666667e-01 +355 284 4.16666666666667e-02 +355 286 5.55555555555557e-02 +355 352 -9.72222222222224e-02 +355 430 -2.22222222222222e-01 +355 427 1.11111111111111e-01 +355 361 -1.38888888888889e-02 +355 424 -6.94444444444445e-02 +355 454 -1.94444444444445e-01 +355 354 -6.93889390390723e-17 +355 285 4.42354486374086e-17 +355 351 8.33333333333334e-02 +355 429 -3.65376132127615e-17 +355 426 -1.38777878078145e-17 +355 360 7.69783542464708e-18 +355 423 4.16666666666667e-02 +355 453 -4.81114714040443e-18 +356 356 5.55555555555556e-01 +356 329 -1.38888888888889e-02 +356 338 -9.72222222222223e-02 +356 410 -6.94444444444445e-02 +356 283 4.16666666666667e-02 +356 328 -3.30546137336518e-17 +356 337 5.09575021068187e-18 +356 409 -4.16666666666667e-02 +356 282 -5.41016884070267e-17 +356 327 -1.43385737311208e-17 +356 336 -8.33333333333333e-02 +356 408 -4.16666666666667e-02 +356 284 5.55555555555555e-02 +356 287 5.55555555555556e-02 +356 353 -1.38888888888889e-02 +356 431 1.11111111111111e-01 +356 428 -2.22222222222222e-01 +356 362 -9.72222222222223e-02 +356 425 -6.94444444444445e-02 +356 455 -1.94444444444444e-01 +356 355 1.66666666666667e-01 +356 286 4.16666666666667e-02 +356 352 -5.46166844389573e-18 +356 430 4.92126142354748e-18 +356 427 2.17247010311783e-17 +356 361 -2.81892564846231e-17 +356 424 -4.16666666666667e-02 +356 454 -1.66666666666667e-01 +356 354 8.32667268468867e-17 +356 285 1.82145964977565e-17 +356 351 2.16840434497101e-19 +356 429 1.38777878078145e-17 +356 426 1.81061762805079e-17 +356 360 8.33333333333334e-02 +356 423 4.16666666666667e-02 +356 453 3.21194893598831e-18 +357 357 1.11111111111111e+00 +357 374 -8.33333333333333e-02 +357 445 -4.16666666666667e-02 +357 373 3.92345661168192e-18 +357 444 -6.94444444444444e-02 +357 372 -9.72222222222222e-02 +357 458 1.53211319499358e-17 +357 437 7.24151760013751e-17 +357 434 4.16666666666667e-02 +357 365 8.33333333333334e-02 +357 457 -1.66666666666667e-01 +357 436 -4.68345692360584e-18 +357 433 -4.16666666666667e-02 +357 364 2.97647377665161e-18 +357 456 -1.94444444444444e-01 +357 435 -2.22222222222222e-01 +357 432 -6.94444444444444e-02 +357 363 -9.72222222222222e-02 +357 431 4.16666666666667e-02 +357 353 2.31748214368777e-18 +357 275 -5.67156320822534e-17 +357 350 8.33333333333334e-02 +357 430 4.16666666666667e-02 +357 352 -1.06929439261383e-17 +357 274 -1.38777878078145e-17 +357 349 8.56519716263549e-18 +357 429 -6.94444444444444e-02 +357 351 -2.77777777777778e-02 +357 273 1.11111111111111e-01 +357 348 -9.72222222222222e-02 +357 455 7.20994444702860e-18 +357 425 -2.77555756156289e-17 +357 359 -2.49800180540660e-16 +357 422 1.59299792324222e-16 +357 419 -4.16666666666667e-02 +357 344 1.94309358100136e-18 +357 251 -6.17789832827028e-17 +357 341 -8.33333333333333e-02 +357 454 1.66666666666667e-01 +357 424 -4.40846767727973e-17 +357 358 -1.11022302462516e-16 +357 421 8.76136999321958e-17 +357 418 4.16666666666667e-02 +357 343 -1.02728155843002e-17 +357 250 -1.38777878078145e-17 +357 340 9.28348110190713e-18 +357 453 -1.94444444444444e-01 +357 423 2.22222222222222e-01 +357 446 -4.16666666666667e-02 +357 420 -2.22222222222222e-01 +357 417 -6.94444444444445e-02 +357 342 -2.77777777777778e-02 +357 249 1.11111111111111e-01 +357 339 -9.72222222222221e-02 +358 358 1.11111111111111e+00 +358 374 4.14707330975705e-18 +358 445 -6.94444444444444e-02 +358 373 -1.38888888888889e-02 +358 444 -4.16666666666667e-02 +358 372 2.90024081139872e-18 +358 458 1.99205208535266e-17 +358 437 1.38777878078145e-17 +358 434 4.16666666666667e-02 +358 365 9.01751275646928e-18 +358 457 -1.94444444444444e-01 +358 436 1.11111111111111e-01 +358 433 -6.94444444444444e-02 +358 364 -1.38888888888889e-02 +358 456 -1.66666666666667e-01 +358 435 -5.70730799859948e-18 +358 432 -4.16666666666667e-02 +358 363 2.49366499671666e-18 +358 431 -4.16666666666667e-02 +358 353 -1.66666666666667e-01 +358 275 1.54024471128722e-17 +358 350 -3.16587034365767e-17 +358 430 -6.94444444444445e-02 +358 352 -1.94444444444445e-01 +358 274 1.11111111111111e-01 +358 349 -1.38888888888889e-02 +358 429 4.16666666666667e-02 +358 351 -6.50013083722950e-18 +358 273 -1.38777878078145e-17 +358 348 8.69733430240716e-18 +358 455 -2.15417419145714e-17 +358 425 -4.48662764248762e-17 +358 359 1.80411241501588e-16 +358 422 -2.77555756156289e-17 +358 419 4.16666666666667e-02 +358 344 1.66666666666667e-01 +358 251 2.40620884491265e-17 +358 341 1.32509834268463e-17 +358 454 -1.94444444444445e-01 +358 424 -4.44444444444445e-01 +358 446 -4.16666666666667e-02 +358 421 1.11111111111111e-01 +358 418 -6.94444444444445e-02 +358 343 -1.94444444444445e-01 +358 250 1.11111111111111e-01 +358 340 -1.38888888888888e-02 +358 453 1.66666666666667e-01 +358 423 -3.72302744053787e-17 +358 357 -1.11022302462516e-16 +358 420 8.69492025850748e-17 +358 417 4.16666666666667e-02 +358 342 -6.71527720583209e-18 +358 249 -1.38777878078145e-17 +358 339 8.91756286869327e-18 +359 359 1.11111111111111e+00 +359 374 -9.72222222222222e-02 +359 445 -4.16666666666667e-02 +359 373 4.54009659728305e-18 +359 444 -4.16666666666667e-02 +359 372 -8.33333333333333e-02 +359 458 -2.77777777777778e-02 +359 437 1.11111111111111e-01 +359 434 -6.94444444444444e-02 +359 365 -9.72222222222223e-02 +359 457 1.88922228555599e-17 +359 436 1.38777878078145e-17 +359 433 4.16666666666667e-02 +359 364 1.03134731657684e-17 +359 456 1.52059354691092e-17 +359 435 7.38985424502542e-17 +359 432 4.16666666666667e-02 +359 363 8.33333333333334e-02 +359 431 -6.94444444444445e-02 +359 353 -1.94444444444444e-01 +359 275 -2.22222222222222e-01 +359 350 -9.72222222222224e-02 +359 430 -4.16666666666667e-02 +359 352 -1.66666666666667e-01 +359 274 2.77348233084212e-17 +359 349 -3.10403693850811e-17 +359 429 4.16666666666667e-02 +359 351 2.06506632540598e-18 +359 273 -6.60867810942014e-17 +359 348 8.33333333333334e-02 +359 455 -2.77777777777778e-02 +359 425 2.22222222222222e-01 +359 446 -6.94444444444444e-02 +359 422 1.11111111111111e-01 +359 419 -6.94444444444445e-02 +359 344 -1.94444444444444e-01 +359 251 -2.22222222222222e-01 +359 341 -9.72222222222220e-02 +359 454 -2.34323194528430e-17 +359 424 -4.41473572108941e-17 +359 358 1.80411241501588e-16 +359 421 -2.77555756156289e-17 +359 418 4.16666666666667e-02 +359 343 1.66666666666667e-01 +359 250 1.37202396796252e-17 +359 340 1.45147565841497e-17 +359 453 6.10880161559801e-18 +359 423 -2.77555756156289e-17 +359 357 -2.35922392732846e-16 +359 420 1.58389655422397e-16 +359 417 -4.16666666666667e-02 +359 342 2.30392961653170e-18 +359 249 -5.93194113621132e-17 +359 339 -8.33333333333333e-02 +360 360 1.11111111111111e+00 +360 446 -4.16666666666667e-02 +360 379 2.18195687212708e-18 +360 445 4.16666666666667e-02 +360 378 -9.72222222222223e-02 +360 444 -6.94444444444444e-02 +360 443 -7.46744246299391e-18 +360 458 1.13519355591021e-17 +360 371 8.33333333333334e-02 +360 434 4.16666666666667e-02 +360 442 -8.05528332838840e-18 +360 457 1.66666666666667e-01 +360 370 2.05998412772246e-18 +360 433 4.16666666666667e-02 +360 441 -2.22222222222222e-01 +360 456 -1.94444444444444e-01 +360 369 -9.72222222222222e-02 +360 432 -6.94444444444444e-02 +360 356 8.33333333333334e-02 +360 287 -6.61363325216158e-18 +360 353 2.19550939928315e-18 +360 431 4.16666666666667e-02 +360 355 7.91467585914418e-18 +360 286 -6.93889390390723e-18 +360 352 -6.05289744107923e-18 +360 430 -4.16666666666667e-02 +360 354 -9.72222222222222e-02 +360 285 1.11111111111111e-01 +360 351 -2.77777777777778e-02 +360 429 -6.94444444444444e-02 +360 428 3.57786716920216e-17 +360 362 -4.16333634234434e-17 +360 425 -3.46944695195361e-17 +360 455 8.91756286869327e-18 +360 347 -8.33333333333333e-02 +360 263 -1.39862080250630e-17 +360 344 -1.30781887056064e-18 +360 419 -4.16666666666667e-02 +360 427 8.22638398373376e-17 +360 361 -5.55111512312578e-17 +360 424 -3.55243500496085e-17 +360 454 -1.66666666666667e-01 +360 346 8.13151629364128e-18 +360 262 -6.93889390390723e-18 +360 343 -5.53620734325411e-18 +360 418 -4.16666666666667e-02 +360 426 -2.22222222222222e-01 +360 380 -8.33333333333334e-02 +360 423 2.22222222222222e-01 +360 453 -1.94444444444444e-01 +360 345 -9.72222222222222e-02 +360 261 1.11111111111111e-01 +360 342 -2.77777777777778e-02 +360 417 -6.94444444444444e-02 +361 361 1.11111111111111e+00 +361 446 4.16666666666667e-02 +361 379 -1.38888888888889e-02 +361 445 -6.94444444444444e-02 +361 378 3.25260651745651e-18 +361 444 4.16666666666667e-02 +361 443 0.00000000000000e+00 +361 458 -2.53296732546926e-17 +361 371 -6.43745039913268e-18 +361 434 -4.16666666666667e-02 +361 442 1.11111111111111e-01 +361 457 -1.94444444444444e-01 +361 370 -1.38888888888889e-02 +361 433 -6.94444444444444e-02 +361 441 -6.23416249179165e-18 +361 456 1.66666666666667e-01 +361 369 3.36102673470506e-18 +361 432 4.16666666666667e-02 +361 356 -2.87313575708659e-17 +361 287 -1.22785896033983e-17 +361 353 1.66666666666667e-01 +361 431 4.16666666666667e-02 +361 355 -1.38888888888889e-02 +361 286 1.11111111111111e-01 +361 352 -1.94444444444445e-01 +361 430 -6.94444444444444e-02 +361 354 9.03953561309789e-18 +361 285 -6.93889390390723e-18 +361 351 -1.02728155843002e-17 +361 429 -4.16666666666667e-02 +361 428 -4.16333634234434e-17 +361 362 0.00000000000000e+00 +361 425 -3.19653293634828e-17 +361 455 8.09763497575111e-17 +361 347 2.17518060854904e-17 +361 263 -1.34695179272379e-17 +361 344 -1.66666666666667e-01 +361 419 -4.16666666666667e-02 +361 427 1.11111111111111e-01 +361 380 -9.32413868337534e-18 +361 424 -4.44444444444445e-01 +361 454 -1.94444444444444e-01 +361 346 -1.38888888888888e-02 +361 262 1.11111111111111e-01 +361 343 -1.94444444444445e-01 +361 418 -6.94444444444444e-02 +361 426 8.49370758188722e-17 +361 360 -5.55111512312578e-17 +361 423 -4.45200517076860e-17 +361 453 -1.66666666666667e-01 +361 345 9.14795583034644e-18 +361 261 -6.93889390390723e-18 +361 342 -1.02728155843002e-17 +361 417 -4.16666666666667e-02 +362 362 1.11111111111111e+00 +362 446 -6.94444444444444e-02 +362 379 -8.40256683676266e-18 +362 445 4.16666666666667e-02 +362 378 -8.33333333333334e-02 +362 444 -4.16666666666667e-02 +362 443 1.11111111111111e-01 +362 458 -2.77777777777778e-02 +362 371 -9.72222222222222e-02 +362 434 -6.94444444444444e-02 +362 442 6.93889390390723e-18 +362 457 -2.42115897643169e-17 +362 370 -4.77048955893622e-18 +362 433 -4.16666666666667e-02 +362 441 -1.20346441145891e-17 +362 456 1.21837219133059e-17 +362 369 8.33333333333334e-02 +362 432 4.16666666666667e-02 +362 356 -9.72222222222223e-02 +362 287 -2.22222222222222e-01 +362 353 -1.94444444444445e-01 +362 431 -6.94444444444445e-02 +362 355 -2.91921434941722e-17 +362 286 -1.35237280358622e-17 +362 352 1.66666666666667e-01 +362 430 4.16666666666667e-02 +362 354 8.33333333333334e-02 +362 285 -7.04731412115578e-18 +362 351 1.95495204226293e-18 +362 429 4.16666666666667e-02 +362 428 1.11111111111111e-01 +362 380 -9.72222222222222e-02 +362 425 2.22222222222222e-01 +362 455 -2.77777777777777e-02 +362 347 -9.72222222222222e-02 +362 263 -2.22222222222222e-01 +362 344 -1.94444444444444e-01 +362 419 -6.94444444444445e-02 +362 427 -4.16333634234434e-17 +362 361 0.00000000000000e+00 +362 424 -3.05935595054044e-17 +362 454 8.10796877770761e-17 +362 346 2.11419423634673e-17 +362 262 -1.14247803925660e-17 +362 343 -1.66666666666667e-01 +362 418 -4.16666666666667e-02 +362 426 3.18077812352935e-17 +362 360 -4.16333634234434e-17 +362 423 -2.77555756156289e-17 +362 453 1.06251812903579e-17 +362 345 -8.33333333333333e-02 +362 261 -6.61363325216158e-18 +362 342 5.69206140554890e-19 +362 417 -4.16666666666667e-02 +363 363 5.55555555555555e-01 +363 383 -8.33333333333333e-02 +363 368 7.38273916826848e-18 +363 254 4.30148741604151e-17 +363 439 -4.16666666666667e-02 +363 382 1.74488787134386e-18 +363 367 -8.33333333333334e-02 +363 253 -1.75928743144718e-18 +363 438 -6.94444444444444e-02 +363 381 -9.72222222222222e-02 +363 366 -9.72222222222222e-02 +363 252 -1.11111111111111e-01 +363 425 4.16666666666667e-02 +363 458 -9.87979229677416e-18 +363 437 -3.52145477491503e-17 +363 359 8.33333333333334e-02 +363 344 7.02020906684364e-18 +363 434 -4.16333634234434e-17 +363 365 -6.93889390390723e-17 +363 251 3.69662118840722e-17 +363 424 4.16666666666667e-02 +363 457 -1.20617491689012e-18 +363 436 -6.93889390390723e-18 +363 358 3.36102673470506e-18 +363 343 8.33333333333334e-02 +363 433 4.68409219831628e-18 +363 364 1.38777878078145e-17 +363 250 -5.57347679293330e-19 +363 423 -6.94444444444444e-02 +363 456 -2.77777777777778e-02 +363 435 1.11111111111111e-01 +363 357 -9.72222222222223e-02 +363 342 -9.72222222222222e-02 +363 432 1.11111111111111e-01 +363 440 -4.16666666666667e-02 +363 249 -1.11111111111111e-01 +364 364 5.55555555555555e-01 +364 383 -2.58853268680914e-18 +364 368 1.72574492673591e-17 +364 254 4.16666666666667e-02 +364 439 -6.94444444444444e-02 +364 382 -1.38888888888889e-02 +364 367 -9.72222222222222e-02 +364 253 5.55555555555555e-02 +364 438 -4.16666666666667e-02 +364 381 1.61275073157219e-18 +364 366 -8.33333333333334e-02 +364 252 -3.18484388167617e-18 +364 425 -4.16666666666667e-02 +364 458 -1.66666666666667e-01 +364 437 1.56108172178968e-17 +364 359 9.48676900924816e-18 +364 344 -1.35576093537523e-17 +364 434 3.94251485299514e-18 +364 365 1.66666666666667e-01 +364 251 4.16666666666667e-02 +364 424 -6.94444444444444e-02 +364 457 -1.94444444444444e-01 +364 436 1.11111111111111e-01 +364 358 -1.38888888888889e-02 +364 343 -9.72222222222222e-02 +364 433 -2.22222222222222e-01 +364 440 -4.16666666666667e-02 +364 250 5.55555555555555e-02 +364 423 4.16666666666667e-02 +364 456 -3.48638761089870e-18 +364 435 0.00000000000000e+00 +364 357 2.97477971075710e-18 +364 342 8.33333333333334e-02 +364 432 3.82922419629988e-18 +364 363 1.38777878078145e-17 +364 249 -2.25755456266952e-18 +365 365 5.55555555555556e-01 +365 383 -9.72222222222221e-02 +365 368 -1.38888888888889e-02 +365 254 5.55555555555555e-02 +365 439 -4.16666666666666e-02 +365 382 -2.20228566286118e-18 +365 367 1.78893358460108e-17 +365 253 4.16666666666667e-02 +365 438 -4.16666666666667e-02 +365 381 -8.33333333333333e-02 +365 366 8.06375365786094e-18 +365 252 4.34222970080445e-17 +365 425 -6.94444444444444e-02 +365 458 -1.94444444444444e-01 +365 437 -2.22222222222222e-01 +365 359 -9.72222222222223e-02 +365 344 -1.38888888888889e-02 +365 434 1.11111111111111e-01 +365 440 -6.94444444444444e-02 +365 251 5.55555555555555e-02 +365 424 -4.16666666666667e-02 +365 457 -1.66666666666667e-01 +365 436 1.74137268461275e-17 +365 358 7.28448334638698e-18 +365 343 -1.51923829419531e-17 +365 433 1.29934854108810e-18 +365 364 1.66666666666667e-01 +365 250 4.16666666666667e-02 +365 423 4.16666666666667e-02 +365 456 -9.99160064581173e-18 +365 435 -3.62049410227274e-17 +365 357 8.33333333333334e-02 +365 342 7.55553388950836e-18 +365 432 -3.46944695195361e-17 +365 363 -6.93889390390723e-17 +365 249 3.55438318073954e-17 +366 366 5.55555555555555e-01 +366 386 -6.61363325216158e-18 +366 371 7.15573433840433e-18 +366 266 -4.16666666666667e-02 +366 442 4.16666666666667e-02 +366 385 -5.42101086242752e-19 +366 370 8.33333333333334e-02 +366 265 2.62919026827735e-18 +366 441 -6.94444444444444e-02 +366 384 -1.38888888888889e-02 +366 369 -9.72222222222222e-02 +366 264 5.55555555555556e-02 +366 458 1.66666666666667e-01 +366 440 -1.53143556863578e-17 +366 383 -6.61363325216158e-18 +366 437 4.16666666666667e-02 +366 434 4.01154803819637e-17 +366 368 -1.66666666666667e-01 +366 254 -4.16666666666667e-02 +366 365 8.11796376648521e-18 +366 457 3.36102673470506e-18 +366 439 -1.38777878078145e-17 +366 382 -1.09775469964157e-18 +366 436 -4.16666666666667e-02 +366 433 -3.19839640883224e-18 +366 367 2.77555756156289e-17 +366 253 1.31967733182220e-18 +366 364 -8.33333333333334e-02 +366 456 -1.94444444444445e-01 +366 438 1.11111111111111e-01 +366 381 -1.38888888888889e-02 +366 435 -6.94444444444444e-02 +366 432 -2.22222222222223e-01 +366 443 4.16666666666667e-02 +366 252 5.55555555555556e-02 +366 363 -9.72222222222222e-02 +367 367 5.55555555555556e-01 +367 386 -8.33333333333334e-02 +367 371 -9.92553207592589e-18 +367 266 -8.33480420098232e-18 +367 442 -6.94444444444444e-02 +367 385 -9.72222222222223e-02 +367 370 -9.72222222222222e-02 +367 265 -1.11111111111111e-01 +367 441 4.16666666666667e-02 +367 384 -8.94466792300541e-19 +367 369 8.33333333333334e-02 +367 264 3.99799551104030e-19 +367 458 -6.66784336078585e-18 +367 440 1.38777878078145e-17 +367 383 8.33333333333333e-02 +367 437 4.16666666666667e-02 +367 434 -6.93889390390723e-18 +367 368 5.55111512312578e-17 +367 254 -1.20346441145891e-17 +367 365 1.79435459546351e-17 +367 457 -2.77777777777778e-02 +367 439 1.11111111111111e-01 +367 382 -9.72222222222223e-02 +367 436 -6.94444444444445e-02 +367 433 1.11111111111111e-01 +367 443 -4.16666666666667e-02 +367 253 -1.11111111111111e-01 +367 364 -9.72222222222222e-02 +367 456 2.04134940288286e-18 +367 438 -6.93889390390723e-18 +367 381 -1.40946282423116e-18 +367 435 -4.16666666666667e-02 +367 432 -4.88314494092104e-18 +367 366 2.77555756156289e-17 +367 252 2.62919026827735e-18 +367 363 -8.33333333333334e-02 +368 368 5.55555555555556e-01 +368 386 -9.72222222222222e-02 +368 371 -1.38888888888889e-02 +368 266 5.55555555555556e-02 +368 442 -4.16666666666667e-02 +368 385 -8.33333333333334e-02 +368 370 -8.94466792300541e-18 +368 265 -8.67361737988404e-18 +368 441 4.16666666666667e-02 +368 384 -2.64274279543342e-18 +368 369 5.45658624621220e-18 +368 264 -4.16666666666667e-02 +368 458 -1.94444444444444e-01 +368 440 -2.22222222222222e-01 +368 383 -9.72222222222222e-02 +368 437 -6.94444444444445e-02 +368 434 1.11111111111111e-01 +368 443 -6.94444444444445e-02 +368 254 5.55555555555556e-02 +368 365 -1.38888888888889e-02 +368 457 -6.26804380968182e-18 +368 439 1.41081807694676e-17 +368 382 8.33333333333334e-02 +368 436 4.16666666666667e-02 +368 433 -6.93889390390723e-18 +368 367 5.55111512312578e-17 +368 253 -1.20210915874330e-17 +368 364 1.71490290501106e-17 +368 456 1.66666666666667e-01 +368 438 -8.30092288309214e-18 +368 381 -2.62919026827735e-18 +368 435 4.16666666666667e-02 +368 432 4.04943158676231e-17 +368 366 -1.66666666666667e-01 +368 252 -4.16666666666667e-02 +368 363 7.00326840789856e-18 +369 369 5.55555555555556e-01 +369 425 4.16666666666667e-02 +369 263 -3.36102673470506e-18 +369 344 9.63584680796492e-18 +369 361 3.36102673470506e-18 +369 424 -4.16666666666667e-02 +369 262 -2.75116301268197e-18 +369 343 -8.33333333333334e-02 +369 360 -9.72222222222222e-02 +369 423 -6.94444444444444e-02 +369 261 -1.11111111111111e-01 +369 342 -9.72222222222222e-02 +369 443 5.09575021068187e-18 +369 386 -8.33333333333333e-02 +369 440 -4.16666666666667e-02 +369 458 -1.09639944692597e-17 +369 371 -4.16333634234434e-17 +369 266 -8.26704156520197e-19 +369 368 5.89196118110091e-18 +369 434 -4.16333634234434e-17 +369 442 0.00000000000000e+00 +369 385 1.17906986257799e-18 +369 439 4.16666666666667e-02 +369 457 -2.83925443919641e-18 +369 370 0.00000000000000e+00 +369 265 -2.69017664047966e-18 +369 367 8.33333333333334e-02 +369 433 2.14871082894735e-18 +369 441 1.11111111111111e-01 +369 384 -9.72222222222223e-02 +369 438 -6.94444444444444e-02 +369 456 -2.77777777777778e-02 +369 362 8.33333333333334e-02 +369 264 -1.11111111111111e-01 +369 366 -9.72222222222222e-02 +369 432 1.11111111111111e-01 +370 370 5.55555555555555e-01 +370 425 4.16666666666667e-02 +370 263 -4.16666666666667e-02 +370 344 1.09097843606354e-17 +370 361 -1.38888888888889e-02 +370 424 -6.94444444444444e-02 +370 262 5.55555555555555e-02 +370 343 -9.72222222222222e-02 +370 360 2.05998412772246e-18 +370 423 -4.16666666666667e-02 +370 261 -2.92056960213283e-18 +370 342 -8.33333333333334e-02 +370 443 -2.54109884176290e-17 +370 386 -7.04731412115578e-18 +370 440 4.16666666666667e-02 +370 458 1.66666666666667e-01 +370 371 -1.66666666666667e-01 +370 266 -4.16666666666667e-02 +370 368 -8.90401034153721e-18 +370 434 5.79878755690294e-18 +370 442 1.11111111111111e-01 +370 385 -1.38888888888889e-02 +370 439 -6.94444444444444e-02 +370 457 -1.94444444444444e-01 +370 362 -4.77048955893622e-18 +370 265 5.55555555555555e-02 +370 367 -9.72222222222222e-02 +370 433 -2.22222222222222e-01 +370 441 0.00000000000000e+00 +370 384 2.05998412772246e-18 +370 438 4.16666666666667e-02 +370 456 -2.49366499671666e-18 +370 369 0.00000000000000e+00 +370 264 -2.66984784974555e-18 +370 366 8.33333333333334e-02 +370 432 4.68409219831628e-18 +371 371 5.55555555555555e-01 +371 425 -6.94444444444445e-02 +371 263 5.55555555555555e-02 +371 344 -1.38888888888889e-02 +371 361 -6.54587061638123e-18 +371 424 4.16666666666667e-02 +371 262 -4.16666666666667e-02 +371 343 1.10859672136643e-17 +371 360 8.33333333333334e-02 +371 423 4.16666666666667e-02 +371 261 -3.23905399030044e-18 +371 342 9.72563230037388e-18 +371 443 -2.22222222222222e-01 +371 386 -9.72222222222222e-02 +371 440 -6.94444444444444e-02 +371 458 -1.94444444444445e-01 +371 362 -9.72222222222222e-02 +371 266 5.55555555555555e-02 +371 368 -1.38888888888889e-02 +371 434 1.11111111111111e-01 +371 442 -2.44809462415438e-17 +371 385 -7.91467585914418e-18 +371 439 4.16666666666667e-02 +371 457 1.66666666666667e-01 +371 370 -1.66666666666667e-01 +371 265 -4.16666666666667e-02 +371 367 -9.92722614182040e-18 +371 433 9.13313275376949e-18 +371 441 8.38901430960659e-18 +371 384 -8.33333333333334e-02 +371 438 -4.16666666666667e-02 +371 456 -1.10656384229302e-17 +371 369 -4.16333634234434e-17 +371 264 -1.62630325872826e-18 +371 366 7.10152422978005e-18 +371 432 -2.77555756156289e-17 +372 372 5.55555555555556e-01 +372 278 4.29005247125358e-17 +372 440 4.16666666666667e-02 +372 383 8.33333333333334e-02 +372 376 -8.33333333333334e-02 +372 277 -1.69406589450860e-18 +372 439 -4.16666666666667e-02 +372 382 1.32475952950573e-18 +372 375 -9.72222222222222e-02 +372 276 -1.11111111111111e-01 +372 438 -6.94444444444444e-02 +372 381 -9.72222222222223e-02 +372 353 7.26415455565288e-18 +372 446 -6.93889390390723e-18 +372 374 -5.55111512312578e-17 +372 275 3.67680061744147e-17 +372 425 -4.16666666666667e-02 +372 458 -1.08623505155891e-17 +372 437 -3.61507309141031e-17 +372 359 -8.33333333333333e-02 +372 352 8.33333333333333e-02 +372 445 5.09575021068187e-18 +372 373 0.00000000000000e+00 +372 274 -2.49366499671666e-18 +372 424 4.16666666666667e-02 +372 457 -2.50721752387273e-18 +372 436 -6.93889390390723e-18 +372 358 3.78115507654320e-18 +372 351 -9.72222222222223e-02 +372 444 1.11111111111111e-01 +372 377 6.60008072500551e-18 +372 273 -1.11111111111111e-01 +372 423 -6.94444444444444e-02 +372 456 -2.77777777777778e-02 +372 435 1.11111111111111e-01 +372 357 -9.72222222222222e-02 +373 373 5.55555555555556e-01 +373 278 -4.16666666666667e-02 +373 440 4.16666666666667e-02 +373 383 -4.54687286086108e-18 +373 376 -9.72222222222222e-02 +373 277 5.55555555555556e-02 +373 439 -6.94444444444444e-02 +373 382 -1.38888888888889e-02 +373 375 -8.33333333333334e-02 +373 276 -2.49366499671666e-18 +373 438 -4.16666666666667e-02 +373 381 1.30104260698261e-18 +373 353 -1.26174027823001e-17 +373 446 -1.94817577868489e-19 +373 374 -1.66666666666667e-01 +373 275 -4.16666666666667e-02 +373 425 4.16666666666667e-02 +373 458 1.66666666666667e-01 +373 437 1.74135150878907e-17 +373 359 4.54009659728305e-18 +373 352 -9.72222222222222e-02 +373 445 -2.22222222222222e-01 +373 377 1.89870905456524e-17 +373 274 5.55555555555556e-02 +373 424 -6.94444444444444e-02 +373 457 -1.94444444444444e-01 +373 436 1.11111111111111e-01 +373 358 -1.38888888888889e-02 +373 351 8.33333333333334e-02 +373 444 -2.01932654625425e-18 +373 372 0.00000000000000e+00 +373 273 -7.45388993583784e-19 +373 423 4.16666666666667e-02 +373 456 -3.69306365002875e-18 +373 435 0.00000000000000e+00 +373 357 4.04712342198105e-18 +374 374 5.55555555555555e-01 +374 278 5.55555555555556e-02 +374 440 -6.94444444444445e-02 +374 383 -9.72222222222223e-02 +374 376 1.90819582357449e-17 +374 277 -4.16666666666667e-02 +374 439 4.16666666666667e-02 +374 382 -4.02510056535244e-18 +374 375 6.93889390390723e-18 +374 276 4.37475576597901e-17 +374 438 4.16666666666667e-02 +374 381 8.33333333333334e-02 +374 353 -1.38888888888889e-02 +374 446 1.11111111111111e-01 +374 377 -1.38888888888889e-02 +374 275 5.55555555555555e-02 +374 425 -6.94444444444444e-02 +374 458 -1.94444444444444e-01 +374 437 -2.22222222222222e-01 +374 359 -9.72222222222222e-02 +374 352 -1.51788304147971e-17 +374 445 -1.11130722679764e-18 +374 373 -1.66666666666667e-01 +374 274 -4.16666666666667e-02 +374 424 4.16666666666667e-02 +374 457 1.66666666666667e-01 +374 436 2.02186764509601e-17 +374 358 4.18773089122526e-18 +374 351 6.39679281766448e-18 +374 444 -6.93889390390723e-18 +374 372 -5.55111512312578e-17 +374 273 3.31291526330102e-17 +374 423 -4.16666666666667e-02 +374 456 -1.00830802041152e-17 +374 435 -3.52281002763064e-17 +374 357 -8.33333333333333e-02 +375 375 5.55555555555556e-01 +375 290 4.16666666666667e-02 +375 443 -4.16666666666667e-02 +375 386 -6.08508469307489e-18 +375 379 8.33333333333333e-02 +375 289 2.60208521396521e-18 +375 442 4.16666666666667e-02 +375 385 -9.75781955236954e-19 +375 378 -9.72222222222222e-02 +375 288 5.55555555555555e-02 +375 441 -6.94444444444444e-02 +375 384 -1.38888888888889e-02 +375 446 4.02645581806804e-17 +375 377 1.66666666666667e-01 +375 278 4.16666666666667e-02 +375 374 6.93889390390723e-18 +375 458 -1.66666666666667e-01 +375 440 -1.17178537923160e-17 +375 383 -2.64274279543342e-18 +375 437 -4.16666666666667e-02 +375 445 -2.49366499671666e-18 +375 376 1.38777878078145e-17 +375 277 5.42101086242752e-19 +375 373 -8.33333333333334e-02 +375 457 3.99799551104030e-18 +375 439 -1.38777878078145e-17 +375 382 -9.08019319456610e-19 +375 436 -4.16666666666667e-02 +375 444 -2.22222222222222e-01 +375 380 4.98732999343332e-18 +375 276 5.55555555555555e-02 +375 372 -9.72222222222222e-02 +375 456 -1.94444444444444e-01 +375 438 1.11111111111111e-01 +375 381 -1.38888888888889e-02 +375 435 -6.94444444444444e-02 +376 376 5.55555555555555e-01 +376 290 -9.43255890062389e-18 +376 443 4.16666666666667e-02 +376 386 8.33333333333334e-02 +376 379 -9.72222222222222e-02 +376 289 -1.11111111111111e-01 +376 442 -6.94444444444444e-02 +376 385 -9.72222222222223e-02 +376 378 8.33333333333334e-02 +376 288 6.50521303491303e-19 +376 441 4.16666666666667e-02 +376 384 0.00000000000000e+00 +376 446 0.00000000000000e+00 +376 377 4.16333634234434e-17 +376 278 -1.47451495458029e-17 +376 374 1.89735380184963e-17 +376 458 -8.27551189467451e-18 +376 440 1.43250212039647e-17 +376 383 -8.33333333333334e-02 +376 437 -4.16666666666666e-02 +376 445 1.11111111111111e-01 +376 380 -7.68428289749101e-18 +376 277 -1.11111111111111e-01 +376 373 -9.72222222222222e-02 +376 457 -2.77777777777778e-02 +376 439 1.11111111111111e-01 +376 382 -9.72222222222223e-02 +376 436 -6.94444444444444e-02 +376 444 -4.52654407012698e-18 +376 375 1.38777878078145e-17 +376 276 2.60208521396521e-18 +376 372 -8.33333333333334e-02 +376 456 2.17856874033806e-18 +376 438 -6.93889390390723e-18 +376 381 -5.42101086242752e-19 +376 435 -4.16666666666667e-02 +377 377 5.55555555555555e-01 +377 290 5.55555555555555e-02 +377 443 -6.94444444444444e-02 +377 386 -9.72222222222223e-02 +377 379 -7.80625564189563e-18 +377 289 -1.12757025938492e-17 +377 442 4.16666666666667e-02 +377 385 8.33333333333333e-02 +377 378 5.05509262921366e-18 +377 288 4.16666666666667e-02 +377 441 -4.16666666666667e-02 +377 384 -6.61363325216158e-18 +377 446 1.11111111111111e-01 +377 380 -1.38888888888889e-02 +377 278 5.55555555555555e-02 +377 374 -1.38888888888889e-02 +377 458 -1.94444444444444e-01 +377 440 -2.22222222222222e-01 +377 383 -9.72222222222222e-02 +377 437 -6.94444444444444e-02 +377 445 0.00000000000000e+00 +377 376 4.16333634234434e-17 +377 277 -1.48535697630514e-17 +377 373 1.82145964977565e-17 +377 457 -7.87401827767598e-18 +377 439 1.48535697630514e-17 +377 382 -8.33333333333334e-02 +377 436 -4.16666666666667e-02 +377 444 4.00002839011371e-17 +377 375 1.66666666666667e-01 +377 276 4.16666666666667e-02 +377 372 6.58652819784944e-18 +377 456 -1.66666666666667e-01 +377 438 -1.53143556863578e-17 +377 381 -6.61363325216158e-18 +377 435 -4.16666666666667e-02 +378 378 5.55555555555555e-01 +378 353 9.97465998686664e-18 +378 362 -8.33333333333334e-02 +378 425 -4.16666666666667e-02 +378 286 -3.46944695195361e-18 +378 352 -8.33333333333334e-02 +378 361 3.25260651745651e-18 +378 424 -4.16666666666667e-02 +378 285 -1.11111111111111e-01 +378 351 -9.72222222222222e-02 +378 360 -9.72222222222223e-02 +378 423 -6.94444444444444e-02 +378 380 2.77555756156289e-17 +378 290 -1.19262238973405e-18 +378 377 5.05509262921366e-18 +378 446 -6.93889390390723e-18 +378 443 8.38901430960659e-18 +378 386 8.33333333333334e-02 +378 440 4.16666666666667e-02 +378 458 -9.70530350963977e-18 +378 379 4.16333634234434e-17 +378 289 -2.05998412772246e-18 +378 376 8.33333333333334e-02 +378 445 4.91956735765298e-18 +378 442 6.93889390390723e-18 +378 385 3.93023287525995e-19 +378 439 4.16666666666667e-02 +378 457 -1.88549534058807e-18 +378 287 -6.93889390390723e-18 +378 288 -1.11111111111111e-01 +378 375 -9.72222222222222e-02 +378 444 1.11111111111111e-01 +378 441 1.11111111111111e-01 +378 384 -9.72222222222223e-02 +378 438 -6.94444444444444e-02 +378 456 -2.77777777777778e-02 +379 379 5.55555555555555e-01 +379 353 1.06251812903579e-17 +379 362 -8.29414661951411e-18 +379 425 -4.16666666666667e-02 +379 286 5.55555555555555e-02 +379 352 -9.72222222222223e-02 +379 361 -1.38888888888889e-02 +379 424 -6.94444444444444e-02 +379 285 -5.09575021068187e-18 +379 351 -8.33333333333334e-02 +379 360 2.18195687212708e-18 +379 423 -4.16666666666667e-02 +379 380 1.66666666666667e-01 +379 290 4.16666666666667e-02 +379 377 -7.69783542464708e-18 +379 446 6.69494841509799e-18 +379 443 -2.44267361329195e-17 +379 386 -1.59919820441612e-18 +379 440 -4.16666666666667e-02 +379 458 -1.66666666666667e-01 +379 287 4.16666666666667e-02 +379 289 5.55555555555555e-02 +379 376 -9.72222222222222e-02 +379 445 -2.22222222222222e-01 +379 442 1.11111111111111e-01 +379 385 -1.38888888888889e-02 +379 439 -6.94444444444444e-02 +379 457 -1.94444444444444e-01 +379 378 4.16333634234434e-17 +379 288 -2.60208521396521e-18 +379 375 8.33333333333333e-02 +379 444 5.20417042793042e-18 +379 441 6.93889390390723e-18 +379 384 1.84314369322536e-18 +379 438 4.16666666666667e-02 +379 456 -2.94089839286693e-18 +380 380 5.55555555555555e-01 +380 353 -1.38888888888889e-02 +380 362 -9.72222222222222e-02 +380 425 -6.94444444444444e-02 +380 286 4.16666666666667e-02 +380 352 1.16551733542192e-17 +380 361 -9.32413868337534e-18 +380 424 -4.16666666666667e-02 +380 285 -4.22838847269347e-18 +380 351 9.55453164502851e-18 +380 360 -8.33333333333334e-02 +380 423 -4.16666666666667e-02 +380 287 5.55555555555555e-02 +380 290 5.55555555555556e-02 +380 377 -1.38888888888889e-02 +380 446 1.11111111111111e-01 +380 443 -2.22222222222222e-01 +380 386 -9.72222222222222e-02 +380 440 -6.94444444444445e-02 +380 458 -1.94444444444444e-01 +380 379 1.66666666666667e-01 +380 289 4.16666666666667e-02 +380 376 -7.57586268024246e-18 +380 445 3.32883948270940e-18 +380 442 -2.53974358904729e-17 +380 385 -2.49366499671666e-18 +380 439 -4.16666666666667e-02 +380 457 -1.66666666666667e-01 +380 378 2.77555756156289e-17 +380 375 4.98732999343332e-18 +380 444 0.00000000000000e+00 +380 441 5.20417042793042e-18 +380 384 8.33333333333334e-02 +380 438 4.16666666666667e-02 +380 456 -1.00017650411788e-17 +381 381 5.55555555555555e-01 +381 377 -6.61363325216158e-18 +381 278 -2.13858878522766e-17 +381 374 8.33333333333334e-02 +381 445 4.16666666666667e-02 +381 376 -5.42101086242752e-19 +381 277 -4.16666666666667e-02 +381 373 1.30104260698261e-18 +381 444 -6.94444444444444e-02 +381 375 -1.38888888888889e-02 +381 276 5.55555555555555e-02 +381 372 -9.72222222222223e-02 +381 458 1.50704101975485e-17 +381 440 -2.77555756156289e-17 +381 383 -1.24900090270330e-16 +381 437 8.55028938276381e-17 +381 434 -4.16666666666667e-02 +381 368 -2.64274279543342e-18 +381 254 -2.09352663243373e-17 +381 365 -8.33333333333333e-02 +381 457 1.66666666666667e-01 +381 439 5.27193306371077e-18 +381 382 -1.66666666666667e-01 +381 436 -3.03576608295941e-18 +381 433 4.16666666666667e-02 +381 367 -1.40946282423116e-18 +381 253 -4.16666666666667e-02 +381 364 1.82959116606929e-18 +381 456 -1.94444444444444e-01 +381 438 1.11111111111111e-01 +381 446 4.16666666666667e-02 +381 435 -2.22222222222222e-01 +381 432 -6.94444444444444e-02 +381 366 -1.38888888888889e-02 +381 252 5.55555555555555e-02 +381 363 -9.72222222222222e-02 +382 382 5.55555555555556e-01 +382 377 -8.33333333333334e-02 +382 278 2.25514051876985e-17 +382 374 -4.06575814682064e-18 +382 445 -6.94444444444444e-02 +382 376 -9.72222222222223e-02 +382 277 5.55555555555556e-02 +382 373 -1.38888888888889e-02 +382 444 4.16666666666667e-02 +382 375 -8.94466792300541e-19 +382 276 -4.16666666666667e-02 +382 372 9.97804811865566e-19 +382 458 -1.93733375696004e-17 +382 440 -2.68882138776405e-17 +382 383 1.11022302462516e-16 +382 437 6.93889390390723e-18 +382 434 4.16666666666667e-02 +382 368 8.33333333333334e-02 +382 254 2.25920627691667e-17 +382 365 -2.20228566286118e-18 +382 457 -1.94444444444444e-01 +382 439 -2.22222222222222e-01 +382 446 -4.16666666666667e-02 +382 436 1.11111111111111e-01 +382 433 -6.94444444444444e-02 +382 367 -9.72222222222223e-02 +382 253 5.55555555555556e-02 +382 364 -1.38888888888889e-02 +382 456 1.66666666666667e-01 +382 438 1.07911997480198e-18 +382 381 -1.66666666666667e-01 +382 435 -3.85654100884883e-18 +382 432 4.16666666666667e-02 +382 366 -2.30392961653170e-19 +382 252 -4.16666666666667e-02 +382 363 1.31120700234966e-18 +383 383 5.55555555555555e-01 +383 377 -9.72222222222222e-02 +383 278 -1.11111111111111e-01 +383 374 -9.72222222222223e-02 +383 445 -4.16666666666667e-02 +383 376 -8.33333333333334e-02 +383 277 2.27953506765077e-17 +383 373 -4.54517879496658e-18 +383 444 4.16666666666667e-02 +383 375 -2.64274279543342e-18 +383 276 -2.18551441050555e-17 +383 372 8.33333333333334e-02 +383 458 -2.77777777777778e-02 +383 440 1.11111111111111e-01 +383 446 -6.94444444444445e-02 +383 437 1.11111111111111e-01 +383 434 -6.94444444444444e-02 +383 368 -9.72222222222222e-02 +383 254 -1.11111111111111e-01 +383 365 -9.72222222222221e-02 +383 457 -1.68593437821496e-17 +383 439 -2.68882138776405e-17 +383 382 1.11022302462516e-16 +383 436 6.93889390390723e-18 +383 433 4.16666666666667e-02 +383 367 8.33333333333333e-02 +383 253 2.26598254049470e-17 +383 364 -2.53432257818487e-18 +383 456 1.34390247411367e-17 +383 438 -2.08166817117217e-17 +383 381 -1.24900090270330e-16 +383 435 8.50463430690680e-17 +383 432 -4.16666666666667e-02 +383 366 -6.61363325216158e-18 +383 252 -2.13858878522766e-17 +383 363 -8.33333333333333e-02 +384 384 5.55555555555556e-01 +384 290 6.07153216591882e-18 +384 377 -6.61363325216158e-18 +384 446 4.16666666666667e-02 +384 443 -1.62630325872826e-18 +384 379 1.84314369322536e-18 +384 289 4.16666666666667e-02 +384 376 -8.67361737988404e-19 +384 445 -4.16666666666667e-02 +384 378 -9.72222222222223e-02 +384 288 5.55555555555555e-02 +384 375 -1.38888888888889e-02 +384 444 -6.94444444444444e-02 +384 386 -4.16333634234434e-17 +384 440 -2.77555756156289e-17 +384 458 1.93936663603345e-17 +384 371 -8.33333333333334e-02 +384 266 2.27682456221956e-18 +384 368 -2.64274279543342e-18 +384 434 -4.16666666666667e-02 +384 442 -2.71050543121376e-18 +384 385 1.66666666666667e-01 +384 439 1.89227160416611e-18 +384 457 -1.66666666666667e-01 +384 370 2.16840434497101e-18 +384 265 4.16666666666667e-02 +384 367 -9.08019319456610e-19 +384 433 -4.16666666666667e-02 +384 441 -2.22222222222222e-01 +384 380 8.33333333333334e-02 +384 438 1.11111111111111e-01 +384 456 -1.94444444444444e-01 +384 369 -9.72222222222223e-02 +384 264 5.55555555555555e-02 +384 366 -1.38888888888889e-02 +384 432 -6.94444444444444e-02 +385 385 5.55555555555555e-01 +385 290 -8.67361737988404e-18 +385 377 8.33333333333333e-02 +385 446 4.16666666666667e-02 +385 379 -1.38888888888889e-02 +385 289 5.55555555555556e-02 +385 376 -9.72222222222223e-02 +385 445 -6.94444444444445e-02 +385 378 7.18283939271647e-19 +385 288 4.16666666666667e-02 +385 375 -9.75781955236954e-19 +385 444 -4.16666666666667e-02 +385 443 -6.93889390390723e-18 +385 386 -1.38777878078145e-17 +385 440 -1.98408997564847e-17 +385 458 3.77844457111198e-17 +385 371 -7.80625564189563e-18 +385 266 -8.67361737988404e-18 +385 368 -8.33333333333334e-02 +385 434 -4.16666666666666e-02 +385 442 1.11111111111111e-01 +385 380 -2.60208521396521e-18 +385 439 -2.22222222222222e-01 +385 457 -1.94444444444444e-01 +385 370 -1.38888888888889e-02 +385 265 5.55555555555556e-02 +385 367 -9.72222222222223e-02 +385 433 -6.94444444444444e-02 +385 441 -5.59041745187838e-18 +385 384 1.66666666666667e-01 +385 438 5.27193306371077e-18 +385 456 -1.66666666666667e-01 +385 369 7.31836466427715e-19 +385 264 4.16666666666667e-02 +385 366 -5.42101086242752e-19 +385 432 -4.16666666666667e-02 +386 386 5.55555555555555e-01 +386 290 -1.11111111111111e-01 +386 377 -9.72222222222223e-02 +386 446 -6.94444444444445e-02 +386 379 -1.70761842166467e-18 +386 289 -8.56519716263549e-18 +386 376 8.33333333333334e-02 +386 445 4.16666666666667e-02 +386 378 8.33333333333334e-02 +386 288 5.74627151417317e-18 +386 375 -6.08508469307489e-18 +386 444 4.16666666666667e-02 +386 443 1.11111111111111e-01 +386 380 -9.72222222222222e-02 +386 440 1.11111111111111e-01 +386 458 -2.77777777777778e-02 +386 371 -9.72222222222222e-02 +386 266 -1.11111111111111e-01 +386 368 -9.72222222222222e-02 +386 434 -6.94444444444444e-02 +386 442 -6.93889390390723e-18 +386 385 -1.38777878078145e-17 +386 439 -1.81061762805079e-17 +386 457 3.71102074851054e-17 +386 370 -7.04731412115578e-18 +386 265 -7.80625564189563e-18 +386 367 -8.33333333333334e-02 +386 433 -4.16666666666667e-02 +386 441 -3.65918233213858e-18 +386 384 -4.16333634234434e-17 +386 438 -2.08166817117217e-17 +386 456 1.79960619973649e-17 +386 369 -8.33333333333333e-02 +386 264 6.07153216591882e-18 +386 366 -6.61363325216158e-18 +386 432 -4.16666666666667e-02 +387 387 1.11111111111111e+00 +387 398 7.81980816905170e-18 +387 314 -4.16666666666667e-02 +387 299 2.77555756156289e-17 +387 257 -1.15264243462365e-17 +387 397 1.47722546001150e-18 +387 313 -4.16666666666667e-02 +387 298 9.46644021851406e-18 +387 256 -8.33333333333334e-02 +387 396 -2.77777777777777e-02 +387 312 -6.94444444444445e-02 +387 297 1.11111111111111e-01 +387 255 -9.72222222222223e-02 +387 395 -1.66666666666667e-01 +387 311 -4.16666666666667e-02 +387 296 -6.53720970449556e-17 +387 245 -1.33695680394619e-17 +387 394 -1.78181850784415e-17 +387 310 4.16666666666667e-02 +387 295 -3.16400687117371e-17 +387 244 8.33333333333334e-02 +387 393 -1.94444444444445e-01 +387 309 -6.94444444444445e-02 +387 294 -2.22222222222223e-01 +387 243 -9.72222222222223e-02 +387 449 1.40268656065312e-17 +387 392 7.81980816905170e-18 +387 389 5.55111512312578e-17 +387 293 2.77555756156289e-17 +387 448 2.08166817117217e-17 +387 391 3.26954717640160e-18 +387 388 1.38777878078145e-17 +387 292 8.00255552742182e-18 +387 447 2.22222222222222e-01 +387 390 -2.77777777777777e-02 +387 291 1.11111111111111e-01 +387 29 -3.03576608295941e-18 +387 166 4.16666666666667e-02 +387 28 8.33333333333334e-02 +387 165 -6.94444444444445e-02 +387 27 -9.72222222222222e-02 +387 224 1.66666666666667e-01 +387 164 4.16666666666667e-02 +387 149 -1.33966730937740e-17 +387 14 -1.08420217248550e-18 +387 223 0.00000000000000e+00 +387 163 -4.16666666666667e-02 +387 148 -3.83536518516747e-18 +387 13 -8.33333333333334e-02 +387 222 -1.94444444444445e-01 +387 162 -6.94444444444445e-02 +387 147 -2.22222222222222e-01 +387 167 4.16666666666667e-02 +387 12 -9.72222222222222e-02 +388 388 1.11111111111111e+00 +388 398 -1.66666666666667e-01 +388 314 -4.16666666666667e-02 +388 299 -3.31098826334602e-17 +388 257 -6.61871544984510e-18 +388 397 -1.94444444444444e-01 +388 313 -6.94444444444445e-02 +388 298 -2.22222222222222e-01 +388 256 -9.72222222222222e-02 +388 396 3.46267068837558e-18 +388 312 -4.16666666666667e-02 +388 297 1.14196981948825e-17 +388 255 -8.33333333333334e-02 +388 395 -4.46149193977785e-17 +388 311 4.16666666666667e-02 +388 296 -9.02056207507940e-17 +388 245 3.32985592224611e-17 +388 394 -2.77777777777778e-02 +388 310 -6.94444444444444e-02 +388 295 1.11111111111111e-01 +388 244 -9.72222222222221e-02 +388 393 -1.72659195968317e-17 +388 309 4.16666666666667e-02 +388 294 -2.94174542581419e-17 +388 243 8.33333333333334e-02 +388 449 2.69017664047966e-17 +388 392 1.66666666666667e-01 +388 389 1.52655665885959e-16 +388 293 -3.57397081764479e-17 +388 448 2.22222222222222e-01 +388 391 -1.94444444444444e-01 +388 292 -2.22222222222222e-01 +388 447 1.38777878078145e-17 +388 390 1.02999206386123e-18 +388 387 1.38777878078145e-17 +388 291 1.29341931045732e-17 +388 29 1.57785297414531e-17 +388 166 -6.94444444444444e-02 +388 28 -9.72222222222222e-02 +388 165 4.16666666666667e-02 +388 27 8.33333333333334e-02 +388 224 -2.39337629576175e-17 +388 164 4.16666666666667e-02 +388 149 -4.16333634234434e-17 +388 14 6.69494841509799e-18 +388 223 -2.77777777777778e-02 +388 163 -6.94444444444444e-02 +388 148 1.11111111111111e-01 +388 167 -4.16666666666667e-02 +388 13 -9.72222222222222e-02 +388 222 9.65617559869902e-20 +388 162 -4.16666666666667e-02 +388 147 -2.71410532123959e-18 +388 12 -8.33333333333334e-02 +389 389 1.11111111111111e+00 +389 398 -1.94444444444444e-01 +389 314 -6.94444444444445e-02 +389 299 1.11111111111111e-01 +389 257 -1.38888888888889e-02 +389 397 -1.66666666666667e-01 +389 313 -4.16666666666667e-02 +389 298 -3.05355377485175e-17 +389 256 -8.28059409235804e-18 +389 396 8.16539761153146e-18 +389 312 -4.16666666666667e-02 +389 297 3.46944695195361e-17 +389 255 -1.13841228110978e-17 +389 395 -1.94444444444444e-01 +389 311 -6.94444444444444e-02 +389 296 1.11111111111111e-01 +389 245 -1.38888888888889e-02 +389 394 -4.64631452886874e-17 +389 310 4.16666666666667e-02 +389 295 -9.71445146547012e-17 +389 244 3.39524686577414e-17 +389 393 -1.66666666666667e-01 +389 309 -4.16666666666667e-02 +389 294 -6.36460556566881e-17 +389 243 -1.39184453892827e-17 +389 449 -4.44444444444444e-01 +389 392 -1.94444444444444e-01 +389 293 1.11111111111111e-01 +389 448 4.59453963996782e-17 +389 391 1.66666666666667e-01 +389 388 1.52655665885959e-16 +389 292 -3.83544988846220e-17 +389 447 2.96954928230781e-17 +389 390 8.17725607279302e-18 +389 387 4.16333634234434e-17 +389 291 2.08166817117217e-17 +389 29 -1.38888888888889e-02 +389 166 -4.16666666666666e-02 +389 28 1.74014448683923e-17 +389 165 4.16666666666667e-02 +389 27 -3.60158409172529e-18 +389 224 -1.94444444444444e-01 +389 164 -6.94444444444445e-02 +389 149 1.11111111111111e-01 +389 167 -6.94444444444445e-02 +389 14 -1.38888888888889e-02 +389 223 -2.10081111578012e-17 +389 163 4.16666666666667e-02 +389 148 -4.16333634234434e-17 +389 13 7.74357520379881e-18 +389 222 1.66666666666667e-01 +389 162 4.16666666666667e-02 +389 147 -1.43724550490110e-17 +389 12 -1.77029885976149e-18 +390 390 1.11111111111111e+00 +390 269 -8.33333333333334e-02 +390 304 -4.16666666666667e-02 +390 268 -8.68378177525109e-18 +390 303 -6.94444444444445e-02 +390 267 -9.72222222222223e-02 +390 401 1.12892551210053e-17 +390 302 7.73849300611529e-18 +390 400 1.47722546001150e-18 +390 301 2.77555756156289e-17 +390 399 -2.77777777777777e-02 +390 300 1.11111111111111e-01 +390 395 -2.59734182946059e-17 +390 311 -9.13014696263042e-17 +390 296 4.16666666666667e-02 +390 245 8.33333333333333e-02 +390 448 1.53753420585601e-17 +390 394 -1.66666666666667e-01 +390 310 -3.05507843415681e-17 +390 295 -4.16666666666667e-02 +390 244 -9.07680506277708e-18 +390 393 -1.94444444444445e-01 +390 309 -2.22222222222223e-01 +390 294 -6.94444444444445e-02 +390 243 -9.72222222222223e-02 +390 449 2.77555756156289e-17 +390 392 2.77555756156289e-17 +390 389 8.17556200689851e-18 +390 293 8.71279265369455e-18 +390 391 2.77555756156289e-17 +390 388 1.04354459101730e-18 +390 292 1.38777878078145e-17 +390 447 2.22222222222222e-01 +390 305 -4.16666666666667e-02 +390 387 -2.77777777777777e-02 +390 291 1.11111111111111e-01 +390 158 4.16666666666667e-02 +390 44 8.33333333333334e-02 +390 157 4.16666666666667e-02 +390 43 2.16840434497101e-19 +390 156 -6.94444444444445e-02 +390 42 -9.72222222222223e-02 +390 224 -1.95156391047391e-18 +390 164 4.76032516356917e-17 +390 149 -4.16666666666667e-02 +390 14 -8.33333333333333e-02 +390 223 1.66666666666667e-01 +390 163 1.53143556863578e-18 +390 148 4.16666666666667e-02 +390 13 7.45388993583784e-19 +390 222 -1.94444444444444e-01 +390 162 -2.22222222222222e-01 +390 147 -6.94444444444445e-02 +390 12 -9.72222222222222e-02 +391 391 1.11111111111111e+00 +391 269 -2.10877322548431e-17 +391 304 -6.94444444444445e-02 +391 268 -1.38888888888889e-02 +391 303 -4.16666666666667e-02 +391 267 -8.37546178245052e-18 +391 401 -1.66666666666667e-01 +391 302 2.48959923856984e-17 +391 400 -1.94444444444444e-01 +391 301 1.11111111111111e-01 +391 399 3.67951112287268e-18 +391 300 2.08166817117217e-17 +391 395 -2.06676039130049e-18 +391 311 -4.16333634234434e-17 +391 296 4.16666666666667e-02 +391 245 5.84452733605467e-19 +391 394 -1.94444444444444e-01 +391 310 1.11111111111111e-01 +391 295 -6.94444444444444e-02 +391 244 -1.38888888888889e-02 +391 393 -1.66666666666667e-01 +391 309 -3.21279596893556e-17 +391 294 -4.16666666666667e-02 +391 243 -8.40256683676266e-18 +391 449 -1.13823863935559e-16 +391 392 2.77555756156289e-16 +391 389 1.66666666666667e-01 +391 293 3.31621869179531e-17 +391 448 -4.44444444444444e-01 +391 305 -4.16666666666667e-02 +391 388 -1.94444444444444e-01 +391 292 1.11111111111111e-01 +391 447 1.73995390442610e-17 +391 390 2.77555756156289e-17 +391 387 3.26954717640160e-18 +391 291 3.46944695195361e-17 +391 158 -4.16666666666667e-02 +391 44 -9.29703362906320e-18 +391 157 -6.94444444444444e-02 +391 43 -1.38888888888889e-02 +391 156 4.16666666666667e-02 +391 42 6.94567016748526e-20 +391 224 2.76081918828067e-17 +391 164 -2.77555756156289e-17 +391 149 4.16666666666667e-02 +391 14 -7.70630575411962e-18 +391 223 -1.94444444444444e-01 +391 163 1.11111111111111e-01 +391 148 -6.94444444444444e-02 +391 13 -1.38888888888889e-02 +391 222 1.66666666666667e-01 +391 162 3.16938553038878e-18 +391 147 4.16666666666667e-02 +391 12 1.01813360259967e-18 +392 392 1.11111111111111e+00 +392 269 -9.72222222222223e-02 +392 304 -4.16666666666667e-02 +392 268 -2.35305752747245e-17 +392 303 -4.16666666666667e-02 +392 267 -8.33333333333334e-02 +392 401 -1.94444444444444e-01 +392 302 -2.22222222222222e-01 +392 400 -1.66666666666667e-01 +392 301 3.31621869179531e-17 +392 399 1.16348445634851e-17 +392 300 1.21301470793920e-17 +392 395 -2.77777777777778e-02 +392 311 1.11111111111111e-01 +392 296 -6.94444444444444e-02 +392 245 -9.72222222222221e-02 +392 394 -5.67850887839283e-18 +392 310 -4.85722573273506e-17 +392 295 4.16666666666667e-02 +392 244 1.40946282423116e-18 +392 393 -2.69966340948891e-17 +392 309 -8.69699548922825e-17 +392 294 4.16666666666667e-02 +392 243 8.33333333333333e-02 +392 449 2.22222222222222e-01 +392 305 -6.94444444444445e-02 +392 389 -1.94444444444444e-01 +392 293 -2.22222222222222e-01 +392 448 -1.11945568375023e-16 +392 391 2.49800180540660e-16 +392 388 1.66666666666667e-01 +392 292 3.19416124409597e-17 +392 447 3.46944695195361e-17 +392 390 2.77555756156289e-17 +392 387 7.81980816905170e-18 +392 291 5.16181878056771e-18 +392 158 -6.94444444444445e-02 +392 44 -9.72222222222223e-02 +392 157 -4.16666666666666e-02 +392 43 -9.01243055878576e-18 +392 156 4.16666666666667e-02 +392 42 8.33333333333334e-02 +392 224 -2.77777777777778e-02 +392 164 1.11111111111111e-01 +392 149 -6.94444444444444e-02 +392 14 -9.72222222222222e-02 +392 223 2.92192485484843e-17 +392 163 -2.08166817117217e-17 +392 148 4.16666666666667e-02 +392 13 -7.94178091345632e-18 +392 222 -3.23566585851143e-18 +392 162 4.47978785143854e-17 +392 147 -4.16666666666667e-02 +392 12 -8.33333333333333e-02 +393 393 2.22222222222222e+00 +393 331 -4.16666666666667e-02 +393 330 -6.94444444444444e-02 +393 416 -1.66666666666667e-01 +393 326 -4.16666666666667e-02 +393 415 -1.64561560992565e-17 +393 325 4.16666666666667e-02 +393 414 -1.94444444444444e-01 +393 324 -6.94444444444444e-02 +393 413 -2.06303344633257e-17 +393 323 4.16666666666667e-02 +393 412 -1.66666666666667e-01 +393 322 -4.16666666666667e-02 +393 411 -1.94444444444444e-01 +393 321 -6.94444444444444e-02 +393 452 -1.41204203955555e-16 +393 407 -2.51128328201955e-17 +393 404 1.66666666666667e-01 +393 317 4.16666666666667e-02 +393 451 -1.81626310264424e-16 +393 406 1.66666666666667e-01 +393 403 -1.63172426959068e-17 +393 316 4.16666666666667e-02 +393 450 -4.44444444444444e-01 +393 405 -1.94444444444444e-01 +393 402 -1.94444444444444e-01 +393 315 -6.94444444444444e-02 +393 308 4.16666666666667e-02 +393 281 1.25496401465197e-17 +393 307 4.16666666666667e-02 +393 280 7.88757080483204e-18 +393 306 -6.94444444444444e-02 +393 279 -2.77777777777778e-02 +393 401 1.66666666666667e-01 +393 305 6.01545858481059e-17 +393 269 1.23327997120226e-17 +393 302 4.16666666666667e-02 +393 400 -1.80519661718836e-17 +393 304 3.46944695195361e-17 +393 268 1.08911496357958e-17 +393 301 -4.16666666666667e-02 +393 399 -1.94444444444445e-01 +393 303 2.22222222222222e-01 +393 267 -2.77777777777778e-02 +393 300 -6.94444444444445e-02 +393 398 -3.05745012640912e-17 +393 314 4.16333634234434e-17 +393 299 -4.16666666666667e-02 +393 257 1.01339021809504e-17 +393 397 1.66666666666667e-01 +393 313 5.94888179515640e-17 +393 298 4.16666666666667e-02 +393 256 7.67073037033494e-18 +393 396 -1.94444444444444e-01 +393 312 2.22222222222222e-01 +393 297 -6.94444444444445e-02 +393 255 -2.77777777777779e-02 +393 449 -1.22719827464098e-16 +393 395 2.63677968348475e-16 +393 311 4.16333634234434e-17 +393 392 -2.76607079255364e-17 +393 389 -1.66666666666667e-01 +393 296 5.57445088082264e-17 +393 245 1.44469939483693e-17 +393 293 -4.16666666666667e-02 +393 448 -6.17199027346318e-17 +393 394 2.63677968348475e-16 +393 310 6.70604454670702e-17 +393 391 -1.66666666666667e-01 +393 388 -1.73607872869241e-17 +393 295 4.16333634234434e-17 +393 244 1.06793913989822e-17 +393 292 -4.16666666666667e-02 +393 447 -4.44444444444445e-01 +393 332 -4.16666666666667e-02 +393 309 2.22222222222222e-01 +393 390 -1.94444444444445e-01 +393 387 -1.94444444444445e-01 +393 294 2.22222222222222e-01 +393 243 -2.77777777777779e-02 +393 291 -6.94444444444445e-02 +394 394 2.22222222222222e+00 +394 331 -6.94444444444445e-02 +394 330 -4.16666666666667e-02 +394 416 -4.71356894488073e-17 +394 326 4.16666666666667e-02 +394 415 -2.77777777777777e-02 +394 325 -6.94444444444444e-02 +394 414 -1.45418616384618e-17 +394 324 4.16666666666667e-02 +394 413 -5.32546554597724e-17 +394 323 4.16666666666667e-02 +394 412 -1.94444444444445e-01 +394 322 -6.94444444444445e-02 +394 411 -1.66666666666667e-01 +394 321 -4.16666666666667e-02 +394 452 2.77555756156289e-17 +394 407 3.42065785419177e-17 +394 404 5.21094669150846e-17 +394 317 -4.16666666666667e-02 +394 451 2.22222222222223e-01 +394 406 -1.94444444444444e-01 +394 403 -2.77777777777776e-02 +394 316 -6.94444444444444e-02 +394 450 -1.76519972141902e-16 +394 405 1.66666666666667e-01 +394 402 -1.50975152518606e-17 +394 315 4.16666666666667e-02 +394 308 -4.16666666666666e-02 +394 281 -1.66666666666667e-01 +394 307 -6.94444444444444e-02 +394 280 -1.94444444444445e-01 +394 306 4.16666666666667e-02 +394 279 9.25637604759499e-18 +394 401 3.67273485929465e-18 +394 305 3.02898981938138e-18 +394 269 1.66666666666667e-01 +394 302 4.16666666666667e-02 +394 400 -2.77777777777777e-02 +394 304 2.22222222222222e-01 +394 268 -1.94444444444445e-01 +394 301 -6.94444444444444e-02 +394 399 -2.01204206290787e-17 +394 303 3.46944695195361e-17 +394 267 5.93600689435814e-18 +394 300 -4.16666666666667e-02 +394 398 8.28076349894749e-17 +394 314 -4.93782091766631e-17 +394 299 4.16666666666667e-02 +394 257 1.66666666666667e-01 +394 397 -1.94444444444444e-01 +394 313 -4.44444444444445e-01 +394 298 -6.94444444444444e-02 +394 256 -1.94444444444445e-01 +394 396 1.66666666666667e-01 +394 312 6.86867487257985e-17 +394 297 4.16666666666667e-02 +394 255 1.06624507400371e-17 +394 449 -8.32667268468867e-17 +394 395 1.80411241501588e-16 +394 311 -5.86248443453646e-17 +394 392 -5.25838053655470e-18 +394 389 -4.64631452886874e-17 +394 296 3.12661036655244e-18 +394 245 -1.66666666666667e-01 +394 293 -4.16666666666667e-02 +394 448 2.22222222222222e-01 +394 332 -4.16666666666668e-02 +394 310 -4.44444444444445e-01 +394 391 -1.94444444444444e-01 +394 388 -2.77777777777778e-02 +394 295 2.22222222222222e-01 +394 244 -1.94444444444445e-01 +394 292 -6.94444444444445e-02 +394 447 -6.48367722222909e-17 +394 393 2.63677968348475e-16 +394 309 6.25771000772532e-17 +394 390 -1.66666666666667e-01 +394 387 -1.84670123160383e-17 +394 294 4.16333634234434e-17 +394 243 8.09085871217308e-18 +394 291 -4.16666666666667e-02 +395 395 2.22222222222222e+00 +395 331 -4.16666666666668e-02 +395 330 -4.16666666666667e-02 +395 416 -1.94444444444445e-01 +395 326 -6.94444444444445e-02 +395 415 -5.01629852022942e-17 +395 325 4.16666666666667e-02 +395 414 -1.66666666666667e-01 +395 324 -4.16666666666667e-02 +395 413 -2.77777777777778e-02 +395 323 -6.94444444444445e-02 +395 412 -5.21365719693967e-17 +395 322 4.16666666666667e-02 +395 411 -2.05727362229124e-17 +395 321 4.16666666666667e-02 +395 452 2.22222222222223e-01 +395 407 -2.77777777777776e-02 +395 404 -1.94444444444444e-01 +395 317 -6.94444444444444e-02 +395 451 2.08166817117217e-17 +395 406 3.73067191288684e-17 +395 403 5.31801165604140e-17 +395 316 -4.16666666666667e-02 +395 450 -1.43209554458179e-16 +395 405 -2.55871712706579e-17 +395 402 1.66666666666667e-01 +395 315 4.16666666666667e-02 +395 308 -6.94444444444444e-02 +395 281 -1.94444444444445e-01 +395 307 -4.16666666666666e-02 +395 280 -1.66666666666667e-01 +395 306 4.16666666666667e-02 +395 279 1.10859672136643e-17 +395 401 -1.94444444444444e-01 +395 305 -4.44444444444445e-01 +395 269 -1.94444444444445e-01 +395 302 -6.94444444444444e-02 +395 400 2.21075599233372e-18 +395 304 3.24985366037794e-18 +395 268 1.66666666666667e-01 +395 301 4.16666666666667e-02 +395 399 1.66666666666667e-01 +395 303 5.55799726582222e-17 +395 267 1.01084911925328e-17 +395 300 4.16666666666667e-02 +395 398 -2.77777777777778e-02 +395 314 2.22222222222222e-01 +395 299 -6.94444444444444e-02 +395 257 -1.94444444444445e-01 +395 397 8.32802793740428e-17 +395 313 -4.43116816026615e-17 +395 298 4.16666666666667e-02 +395 256 1.66666666666667e-01 +395 396 -2.98223360069294e-17 +395 312 4.16333634234434e-17 +395 297 -4.16666666666667e-02 +395 255 1.34170018845081e-17 +395 449 2.22222222222222e-01 +395 332 -6.94444444444445e-02 +395 311 2.22222222222222e-01 +395 392 -2.77777777777778e-02 +395 389 -1.94444444444444e-01 +395 296 -4.44444444444445e-01 +395 245 -1.94444444444445e-01 +395 293 -6.94444444444445e-02 +395 448 -8.32667268468867e-17 +395 394 1.80411241501588e-16 +395 310 -6.04385536436729e-17 +395 391 -2.18703906981060e-18 +395 388 -4.46284719249346e-17 +395 295 6.48319017828441e-18 +395 244 -1.66666666666667e-01 +395 292 -4.16666666666667e-02 +395 447 -1.25187446197686e-16 +395 393 2.63677968348475e-16 +395 309 5.55111512312578e-17 +395 390 -2.49146271105380e-17 +395 387 -1.66666666666667e-01 +395 294 5.45556980667550e-17 +395 243 1.35118695746006e-17 +395 291 -4.16666666666667e-02 +396 396 1.11111111111111e+00 +396 308 6.28837260041593e-18 +396 281 -8.33333333333334e-02 +396 305 -4.16666666666667e-02 +396 401 1.12892551210053e-17 +396 307 -6.93889390390723e-18 +396 280 -9.08019319456610e-18 +396 304 4.16666666666667e-02 +396 400 3.28140563766316e-18 +396 306 1.11111111111111e-01 +396 279 -9.72222222222223e-02 +396 303 -6.94444444444445e-02 +396 399 -2.77777777777778e-02 +396 398 5.55111512312578e-17 +396 314 -3.31630339509004e-17 +396 395 -2.98358885340855e-17 +396 449 2.77555756156289e-17 +396 299 1.39726554979069e-17 +396 257 8.33333333333334e-02 +396 296 4.16666666666667e-02 +396 389 8.13659849132481e-18 +396 397 0.00000000000000e+00 +396 313 -3.38965644832226e-17 +396 394 1.66666666666667e-01 +396 448 1.39823963768004e-17 +396 298 -6.93889390390723e-18 +396 256 -9.87979229677416e-18 +396 295 4.16666666666667e-02 +396 388 3.44742409532500e-18 +396 312 -2.22222222222222e-01 +396 393 -1.94444444444444e-01 +396 447 2.22222222222222e-01 +396 297 1.11111111111111e-01 +396 255 -9.72222222222222e-02 +396 294 -6.94444444444444e-02 +396 387 -2.77777777777777e-02 +396 158 4.16666666666667e-02 +396 58 -1.08420217248550e-18 +396 157 -4.16666666666667e-02 +396 57 -9.72222222222223e-02 +396 156 -6.94444444444445e-02 +396 167 -6.96057794735694e-17 +396 224 1.84314369322536e-18 +396 29 -8.33333333333334e-02 +396 149 -4.16666666666667e-02 +396 166 -1.73472347597681e-18 +396 223 -1.66666666666667e-01 +396 28 -5.42101086242752e-19 +396 148 -4.16666666666667e-02 +396 165 -2.22222222222222e-01 +396 222 -1.94444444444444e-01 +396 27 -9.72222222222223e-02 +396 147 -6.94444444444445e-02 +396 59 8.33333333333333e-02 +397 397 1.11111111111111e+00 +397 308 2.11419423634673e-18 +397 281 -2.17924636669586e-17 +397 305 4.16666666666667e-02 +397 401 1.66666666666667e-01 +397 307 1.11111111111111e-01 +397 280 -1.38888888888889e-02 +397 304 -6.94444444444444e-02 +397 400 -1.94444444444444e-01 +397 306 -6.93889390390723e-18 +397 279 -8.89045781438114e-18 +397 303 4.16666666666667e-02 +397 399 1.13841228110978e-18 +397 398 1.38777878078145e-17 +397 314 -3.46944695195361e-17 +397 395 8.37139602430370e-17 +397 449 -1.05657195774607e-16 +397 299 1.22565667467697e-17 +397 257 1.62630325872826e-18 +397 296 -4.16666666666666e-02 +397 389 -1.66666666666667e-01 +397 313 1.11111111111111e-01 +397 394 -1.94444444444444e-01 +397 448 -4.44444444444444e-01 +397 298 1.11111111111111e-01 +397 256 -1.38888888888889e-02 +397 295 -6.94444444444444e-02 +397 388 -1.94444444444444e-01 +397 396 0.00000000000000e+00 +397 312 -3.05338436826230e-17 +397 393 1.66666666666667e-01 +397 447 1.87346747273706e-17 +397 297 -6.93889390390723e-18 +397 255 -8.99887803162969e-18 +397 294 4.16666666666667e-02 +397 387 1.46367293285543e-18 +397 158 4.16666666666667e-02 +397 58 -1.38888888888889e-02 +397 157 -6.94444444444444e-02 +397 57 -4.06575814682064e-19 +397 156 -4.16666666666667e-02 +397 167 -4.16333634234434e-17 +397 224 1.40675231879994e-17 +397 29 -1.34441069388203e-17 +397 149 -4.16666666666667e-02 +397 166 1.11111111111111e-01 +397 223 -1.94444444444444e-01 +397 28 -1.38888888888889e-02 +397 148 -6.94444444444444e-02 +397 165 -1.20278678510111e-19 +397 222 -1.66666666666667e-01 +397 27 -3.93023287525995e-19 +397 147 -4.16666666666667e-02 +397 59 -1.27935856353290e-17 +398 398 1.11111111111111e+00 +398 308 -2.22222222222222e-01 +398 281 -9.72222222222222e-02 +398 305 -6.94444444444444e-02 +398 401 -1.94444444444444e-01 +398 307 1.29087821161555e-17 +398 280 -2.11825999449355e-17 +398 304 4.16666666666667e-02 +398 400 1.66666666666667e-01 +398 306 1.75640751942652e-17 +398 279 -8.33333333333334e-02 +398 303 -4.16666666666667e-02 +398 399 8.18911453405458e-18 +398 314 1.11111111111111e-01 +398 395 -2.77777777777778e-02 +398 449 2.22222222222222e-01 +398 299 -2.22222222222222e-01 +398 257 -9.72222222222222e-02 +398 296 -6.94444444444444e-02 +398 389 -1.94444444444444e-01 +398 397 1.38777878078145e-17 +398 313 -3.46944695195361e-17 +398 394 8.19402732514865e-17 +398 448 -1.01735009712346e-16 +398 298 1.26038502551440e-18 +398 256 2.27682456221956e-18 +398 295 -4.16666666666666e-02 +398 388 -1.66666666666667e-01 +398 396 5.55111512312578e-17 +398 312 -3.23092247400680e-17 +398 393 -2.89888555868312e-17 +398 447 2.08166817117217e-17 +398 297 6.17995238316738e-18 +398 255 8.33333333333334e-02 +398 294 4.16666666666667e-02 +398 387 8.02309607639273e-18 +398 158 -6.94444444444445e-02 +398 58 -1.37016049547856e-17 +398 157 4.16666666666667e-02 +398 57 8.33333333333333e-02 +398 156 4.16666666666667e-02 +398 167 1.11111111111111e-01 +398 224 -2.77777777777778e-02 +398 29 -9.72222222222223e-02 +398 149 -6.94444444444444e-02 +398 166 -4.16333634234434e-17 +398 223 1.67932752122638e-17 +398 28 -1.26851654180804e-17 +398 148 -4.16666666666667e-02 +398 165 -6.88603904799856e-17 +398 222 8.58891408515861e-19 +398 27 -8.33333333333334e-02 +398 147 -4.16666666666667e-02 +398 59 -9.72222222222222e-02 +399 399 1.11111111111111e+00 +399 308 0.00000000000000e+00 +399 281 -1.09233368877915e-17 +399 398 8.20266706121064e-18 +399 314 4.16666666666667e-02 +399 307 5.85469173142172e-18 +399 280 -8.33333333333334e-02 +399 397 1.15196480826585e-18 +399 313 -4.16666666666667e-02 +399 306 1.11111111111111e-01 +399 279 -9.72222222222223e-02 +399 396 -2.77777777777778e-02 +399 312 -6.94444444444445e-02 +399 305 -6.17215968005264e-17 +399 269 -1.28884533254214e-17 +399 395 1.66666666666667e-01 +399 311 4.16666666666667e-02 +399 304 -3.27564581362183e-17 +399 268 8.33333333333333e-02 +399 394 -1.92818580112969e-17 +399 310 4.16666666666667e-02 +399 303 -2.22222222222222e-01 +399 267 -9.72222222222222e-02 +399 393 -1.94444444444445e-01 +399 309 -6.94444444444444e-02 +399 401 5.55111512312578e-17 +399 302 0.00000000000000e+00 +399 449 2.26871422174960e-17 +399 392 1.16060454432784e-17 +399 400 1.38777878078145e-17 +399 301 5.97666447582634e-18 +399 448 6.93889390390723e-18 +399 391 3.66426452982210e-18 +399 300 1.11111111111111e-01 +399 447 2.22222222222222e-01 +399 390 -2.77777777777777e-02 +399 167 -4.16666666666667e-02 +399 58 8.33333333333333e-02 +399 166 4.16666666666667e-02 +399 57 -9.72222222222222e-02 +399 165 -6.94444444444445e-02 +399 158 -1.03676832743926e-17 +399 44 -6.50521303491303e-19 +399 224 -1.66666666666667e-01 +399 164 -4.16666666666667e-02 +399 157 3.68628738645072e-18 +399 43 -8.33333333333334e-02 +399 223 5.28548559086683e-19 +399 163 -4.16666666666667e-02 +399 156 -2.22222222222222e-01 +399 59 -3.57786716920216e-18 +399 42 -9.72222222222222e-02 +399 222 -1.94444444444445e-01 +399 162 -6.94444444444445e-02 +400 400 1.11111111111111e+00 +400 308 -6.99666155090997e-17 +400 281 5.42101086242752e-18 +400 398 1.66666666666667e-01 +400 314 4.16666666666667e-02 +400 307 -2.22222222222222e-01 +400 280 -9.72222222222222e-02 +400 397 -1.94444444444444e-01 +400 313 -6.94444444444444e-02 +400 306 5.97666447582634e-18 +400 279 -8.33333333333333e-02 +400 396 3.28140563766316e-18 +400 312 -4.16666666666667e-02 +400 305 1.38777878078145e-17 +400 269 4.69459540686223e-17 +400 395 2.22430851948979e-18 +400 311 -4.16666666666666e-02 +400 304 1.11111111111111e-01 +400 268 -9.72222222222222e-02 +400 394 -2.77777777777777e-02 +400 310 -6.94444444444444e-02 +400 303 -3.31765864780564e-17 +400 267 8.33333333333333e-02 +400 300 5.74627151417317e-18 +400 393 -1.83772268236293e-17 +400 309 4.16666666666667e-02 +400 401 9.71445146547012e-17 +400 302 -7.68563815020662e-17 +400 449 4.21407361588487e-17 +400 392 -1.66666666666667e-01 +400 301 -2.22222222222222e-01 +400 448 2.22222222222222e-01 +400 391 -1.94444444444444e-01 +400 399 1.38777878078145e-17 +400 447 2.77555756156289e-17 +400 390 1.46367293285543e-18 +400 167 4.16666666666667e-02 +400 58 -9.72222222222222e-02 +400 166 -6.94444444444444e-02 +400 57 8.33333333333334e-02 +400 165 4.16666666666667e-02 +400 158 -2.77555756156289e-17 +400 44 6.39679281766448e-18 +400 224 -1.75623811283707e-17 +400 164 -4.16666666666667e-02 +400 157 1.11111111111111e-01 +400 59 1.53143556863578e-17 +400 43 -9.72222222222222e-02 +400 223 -2.77777777777778e-02 +400 163 -6.94444444444444e-02 +400 156 5.81403414995352e-18 +400 42 -8.33333333333333e-02 +400 222 6.52215369385811e-19 +400 162 -4.16666666666667e-02 +401 401 1.11111111111111e+00 +401 308 1.11111111111111e-01 +401 281 -1.38888888888889e-02 +401 398 -1.94444444444444e-01 +401 314 -6.94444444444444e-02 +401 307 -7.25195728121242e-17 +401 280 3.46944695195361e-18 +401 397 1.66666666666667e-01 +401 313 4.16666666666667e-02 +401 306 0.00000000000000e+00 +401 279 -1.02999206386123e-17 +401 396 1.12892551210053e-17 +401 312 4.16666666666667e-02 +401 305 1.11111111111111e-01 +401 269 -1.38888888888889e-02 +401 395 -1.94444444444444e-01 +401 311 -6.94444444444444e-02 +401 304 1.38777878078145e-17 +401 268 4.62276701293507e-17 +401 394 3.68628738645072e-18 +401 310 -4.16666666666666e-02 +401 303 -6.25855704067257e-17 +401 267 -1.21430643318376e-17 +401 393 1.66666666666667e-01 +401 309 4.16666666666667e-02 +401 302 1.11111111111111e-01 +401 449 -4.44444444444444e-01 +401 392 -1.94444444444444e-01 +401 400 8.32667268468867e-17 +401 301 -7.53893204374217e-17 +401 448 3.32019974664741e-17 +401 391 -1.66666666666667e-01 +401 399 5.55111512312578e-17 +401 300 0.00000000000000e+00 +401 447 1.13417711637351e-17 +401 390 1.14925430283463e-17 +401 167 -6.94444444444444e-02 +401 58 1.44198888940572e-17 +401 166 4.16666666666667e-02 +401 57 -2.88668828424266e-18 +401 165 -4.16666666666667e-02 +401 158 1.11111111111111e-01 +401 59 -1.38888888888889e-02 +401 44 -1.38888888888889e-02 +401 224 -1.94444444444444e-01 +401 164 -6.94444444444444e-02 +401 157 -2.08166817117217e-17 +401 43 7.41323235436964e-18 +401 223 -1.88922228555599e-17 +401 163 -4.16666666666667e-02 +401 156 -1.18838722499778e-17 +401 42 -1.34170018845081e-18 +401 222 -1.66666666666667e-01 +401 162 -4.16666666666667e-02 +402 402 1.11111111111111e+00 +402 257 -1.30781887056064e-17 +402 313 4.16666666666667e-02 +402 256 8.33333333333333e-02 +402 312 -6.94444444444444e-02 +402 255 -9.72222222222220e-02 +402 413 4.05220561966457e-18 +402 338 -4.16666666666667e-02 +402 323 -1.38777878078145e-17 +402 260 9.94077866897647e-18 +402 412 -6.77626357803440e-19 +402 337 -4.16666666666667e-02 +402 322 1.71388646547435e-17 +402 259 -8.33333333333334e-02 +402 411 -2.77777777777778e-02 +402 336 -6.94444444444444e-02 +402 321 1.11111111111111e-01 +402 258 -9.72222222222222e-02 +402 410 -1.66666666666667e-01 +402 335 -4.16666666666667e-02 +402 320 -1.29490161811501e-17 +402 248 7.13371148177572e-18 +402 409 8.02817827407626e-18 +402 334 4.16666666666667e-02 +402 319 1.75761454137635e-17 +402 247 8.33333333333334e-02 +402 408 -1.94444444444444e-01 +402 333 -6.94444444444444e-02 +402 318 -2.22222222222222e-01 +402 246 -9.72222222222222e-02 +402 395 1.66666666666667e-01 +402 452 4.08507049801804e-17 +402 407 4.06575814682064e-18 +402 311 4.16666666666667e-02 +402 296 -6.97125056249234e-17 +402 404 5.55111512312578e-17 +402 317 -6.93889390390723e-18 +402 245 -1.18449087344041e-17 +402 394 -1.48942273445196e-17 +402 451 -2.08166817117217e-17 +402 406 1.91260039490021e-18 +402 310 -4.16666666666667e-02 +402 295 -9.08544479883908e-17 +402 403 9.71445146547012e-17 +402 316 1.89038695585847e-17 +402 244 -8.33333333333334e-02 +402 393 -1.94444444444444e-01 +402 450 2.22222222222222e-01 +402 405 -2.77777777777778e-02 +402 309 -6.94444444444444e-02 +402 294 -2.22222222222222e-01 +402 314 4.16666666666667e-02 +402 315 1.11111111111111e-01 +402 243 -9.72222222222221e-02 +403 403 1.11111111111111e+00 +403 257 1.34830704543940e-17 +403 313 -6.94444444444444e-02 +403 256 -9.72222222222221e-02 +403 312 4.16666666666667e-02 +403 255 8.33333333333333e-02 +403 413 -1.66666666666667e-01 +403 338 -4.16666666666667e-02 +403 323 1.42731404359454e-17 +403 260 4.37238407372670e-18 +403 412 -1.94444444444445e-01 +403 337 -6.94444444444444e-02 +403 322 -2.22222222222222e-01 +403 259 -9.72222222222221e-02 +403 411 1.11300129269215e-18 +403 336 -4.16666666666667e-02 +403 321 2.32421605561844e-17 +403 258 -8.33333333333334e-02 +403 410 4.35036121709809e-18 +403 335 4.16666666666667e-02 +403 320 -3.46944695195361e-17 +403 248 3.22550146314438e-18 +403 409 -2.77777777777778e-02 +403 334 -6.94444444444444e-02 +403 319 1.11111111111111e-01 +403 247 -9.72222222222222e-02 +403 408 8.66006485272797e-18 +403 333 4.16666666666667e-02 +403 318 1.52872506320456e-17 +403 246 8.33333333333334e-02 +403 395 5.53349683782289e-17 +403 452 -3.03458023683326e-17 +403 407 1.66666666666667e-01 +403 311 4.16666666666667e-02 +403 296 -6.93889390390723e-18 +403 404 -8.32667268468867e-17 +403 317 5.47691503694631e-18 +403 245 -3.29326409892472e-17 +403 394 -2.77777777777776e-02 +403 451 2.22222222222222e-01 +403 406 -1.94444444444445e-01 +403 310 -6.94444444444445e-02 +403 295 1.11111111111111e-01 +403 314 -4.16666666666667e-02 +403 316 -2.22222222222222e-01 +403 244 -9.72222222222224e-02 +403 393 -1.63985578588433e-17 +403 450 -1.38777878078145e-17 +403 405 1.93801138331784e-18 +403 309 -4.16666666666667e-02 +403 294 -9.13546209437444e-17 +403 402 9.71445146547012e-17 +403 315 1.66933253244878e-17 +403 243 -8.33333333333334e-02 +404 404 1.11111111111111e+00 +404 257 -1.38888888888888e-02 +404 313 -4.16666666666667e-02 +404 256 1.33763443030399e-17 +404 312 4.16666666666667e-02 +404 255 -1.34034493573520e-17 +404 413 -1.94444444444445e-01 +404 338 -6.94444444444444e-02 +404 323 1.11111111111111e-01 +404 260 -1.38888888888889e-02 +404 412 -1.66666666666667e-01 +404 337 -4.16666666666667e-02 +404 322 1.32272665043232e-17 +404 259 4.25549352700560e-18 +404 411 1.83297929785831e-18 +404 336 -4.16666666666667e-02 +404 321 -6.93889390390723e-18 +404 258 1.05167610731094e-17 +404 410 -1.94444444444444e-01 +404 335 -6.94444444444444e-02 +404 320 1.11111111111111e-01 +404 248 -1.38888888888889e-02 +404 409 -4.81114714040443e-19 +404 334 4.16666666666667e-02 +404 319 -3.46944695195361e-17 +404 247 2.43098455861984e-18 +404 408 -1.66666666666667e-01 +404 333 -4.16666666666667e-02 +404 318 -7.86724201409794e-18 +404 246 7.68428289749101e-18 +404 395 -1.94444444444444e-01 +404 452 -4.44444444444445e-01 +404 407 -1.94444444444445e-01 +404 311 -6.94444444444445e-02 +404 296 1.11111111111111e-01 +404 314 -6.94444444444444e-02 +404 317 1.11111111111111e-01 +404 245 -1.38888888888889e-02 +404 394 5.30700022772709e-17 +404 451 -3.57034975179528e-17 +404 406 1.66666666666667e-01 +404 310 4.16666666666667e-02 +404 295 -6.93889390390723e-18 +404 403 -8.32667268468867e-17 +404 316 9.06897000801498e-18 +404 244 -3.32595957068874e-17 +404 393 1.66666666666667e-01 +404 450 3.34018972420261e-17 +404 405 1.76521666207796e-18 +404 309 4.16666666666667e-02 +404 294 -6.93114355243985e-17 +404 402 5.55111512312578e-17 +404 315 -6.93889390390723e-18 +404 243 -1.15891047843333e-17 +405 405 1.11111111111111e+00 +405 272 -8.33333333333333e-02 +405 328 -4.16666666666667e-02 +405 271 4.32833836046947e-18 +405 327 -6.94444444444444e-02 +405 270 -9.72222222222222e-02 +405 305 4.16666666666667e-02 +405 416 4.05220561966457e-18 +405 326 3.00086832553254e-17 +405 269 8.33333333333333e-02 +405 304 4.16666666666667e-02 +405 415 -6.77626357803440e-19 +405 325 -2.77555756156289e-17 +405 268 -8.28059409235804e-18 +405 303 -6.94444444444444e-02 +405 414 -2.77777777777778e-02 +405 324 1.11111111111111e-01 +405 267 -9.72222222222220e-02 +405 410 1.42233772502942e-17 +405 335 1.48590754772086e-17 +405 320 4.16666666666667e-02 +405 248 8.33333333333334e-02 +405 409 -1.66666666666667e-01 +405 334 1.80945295774832e-17 +405 319 -4.16666666666667e-02 +405 247 4.12335638723393e-18 +405 408 -1.94444444444444e-01 +405 333 -2.22222222222222e-01 +405 318 -6.94444444444444e-02 +405 246 -9.72222222222222e-02 +405 395 -2.59801945581839e-17 +405 452 6.93889390390723e-18 +405 407 1.38777878078145e-16 +405 311 -1.44549560580735e-16 +405 296 -4.16666666666667e-02 +405 404 1.74997006902738e-18 +405 317 2.89958436086460e-17 +405 245 -8.33333333333334e-02 +405 394 1.66666666666667e-01 +405 451 3.45945196317601e-17 +405 406 6.93889390390723e-17 +405 310 -8.76018414709342e-17 +405 295 4.16666666666667e-02 +405 403 1.73472347597681e-18 +405 316 -2.77555756156289e-17 +405 244 -7.06086664831185e-18 +405 393 -1.94444444444444e-01 +405 450 2.22222222222222e-01 +405 329 -4.16666666666667e-02 +405 309 -2.22222222222222e-01 +405 294 -6.94444444444444e-02 +405 402 -2.77777777777778e-02 +405 315 1.11111111111111e-01 +405 243 -9.72222222222222e-02 +406 406 1.11111111111111e+00 +406 272 2.08708918203460e-18 +406 328 -6.94444444444444e-02 +406 271 -1.38888888888889e-02 +406 327 -4.16666666666667e-02 +406 270 3.56431464204610e-18 +406 305 -4.16666666666667e-02 +406 416 -1.66666666666667e-01 +406 326 -1.99239089853157e-17 +406 269 2.75793927626000e-17 +406 304 -6.94444444444444e-02 +406 415 -1.94444444444445e-01 +406 325 1.11111111111111e-01 +406 268 -1.38888888888888e-02 +406 303 4.16666666666667e-02 +406 414 1.11300129269215e-18 +406 324 -2.08166817117217e-17 +406 267 -8.22638398373376e-18 +406 410 1.44673227391034e-17 +406 335 -2.08166817117217e-17 +406 320 4.16666666666667e-02 +406 248 -1.31578098026483e-17 +406 409 -1.94444444444444e-01 +406 334 1.11111111111111e-01 +406 319 -6.94444444444444e-02 +406 247 -1.38888888888889e-02 +406 408 -1.66666666666667e-01 +406 333 1.27664805810168e-17 +406 318 -4.16666666666667e-02 +406 246 3.68628738645072e-18 +406 395 3.71847463844638e-17 +406 452 4.10476401404170e-17 +406 407 -2.77555756156289e-17 +406 311 3.46944695195361e-17 +406 296 4.16666666666667e-02 +406 404 1.66666666666667e-01 +406 317 -2.02349818351948e-17 +406 245 -2.04253524900902e-17 +406 394 -1.94444444444444e-01 +406 451 -4.44444444444445e-01 +406 329 -4.16666666666667e-02 +406 310 1.11111111111111e-01 +406 295 -6.94444444444444e-02 +406 403 -1.94444444444445e-01 +406 316 1.11111111111111e-01 +406 244 -1.38888888888889e-02 +406 393 1.66666666666667e-01 +406 450 4.37350639238181e-17 +406 405 6.93889390390723e-17 +406 309 -8.95809339521939e-17 +406 294 4.16666666666667e-02 +406 402 1.05879118406788e-18 +406 315 -2.08166817117217e-17 +406 243 -7.55045169182483e-18 +407 407 1.11111111111111e+00 +407 272 -9.72222222222222e-02 +407 328 -4.16666666666667e-02 +407 271 -1.86177841806495e-18 +407 327 -4.16666666666667e-02 +407 270 -8.33333333333333e-02 +407 305 -6.94444444444444e-02 +407 416 -1.94444444444445e-01 +407 326 -2.22222222222222e-01 +407 269 -9.72222222222220e-02 +407 304 -4.16666666666667e-02 +407 415 -1.66666666666667e-01 +407 325 -2.37042170289116e-17 +407 268 2.57904591779989e-17 +407 303 4.16666666666667e-02 +407 414 1.83297929785831e-18 +407 324 2.55280907225869e-17 +407 267 8.33333333333333e-02 +407 410 -2.77777777777778e-02 +407 335 1.11111111111111e-01 +407 320 -6.94444444444445e-02 +407 248 -9.72222222222222e-02 +407 409 1.43250212039647e-17 +407 334 -1.38777878078145e-17 +407 319 4.16666666666667e-02 +407 247 -1.08962318334793e-17 +407 408 1.55040910665427e-17 +407 333 1.71642756431611e-17 +407 318 4.16666666666667e-02 +407 246 8.33333333333334e-02 +407 395 -2.77777777777776e-02 +407 452 2.22222222222222e-01 +407 329 -6.94444444444444e-02 +407 311 1.11111111111111e-01 +407 296 -6.94444444444445e-02 +407 404 -1.94444444444445e-01 +407 317 -2.22222222222222e-01 +407 245 -9.72222222222225e-02 +407 394 3.41930260147616e-17 +407 451 3.62801151967962e-17 +407 406 -2.77555756156289e-17 +407 310 2.77555756156289e-17 +407 295 4.16666666666667e-02 +407 403 1.66666666666667e-01 +407 316 -1.98680048107969e-17 +407 244 -2.01390553539182e-17 +407 393 -2.47198095326695e-17 +407 450 0.00000000000000e+00 +407 405 1.24900090270330e-16 +407 309 -1.47372297877460e-16 +407 294 -4.16666666666667e-02 +407 402 3.63207727782644e-18 +407 315 2.96156599677994e-17 +407 243 -8.33333333333334e-02 +408 408 2.22222222222222e+00 +408 355 -4.16666666666667e-02 +408 354 -6.94444444444444e-02 +408 431 -1.66666666666667e-01 +408 350 -4.16666666666667e-02 +408 430 6.25787941431477e-18 +408 349 4.16666666666667e-02 +408 429 -1.94444444444445e-01 +408 348 -6.94444444444444e-02 +408 428 -2.80435668176954e-17 +408 347 4.16666666666667e-02 +408 427 -1.66666666666667e-01 +408 346 -4.16666666666667e-02 +408 426 -1.94444444444445e-01 +408 345 -6.94444444444444e-02 +408 455 -1.49663098483310e-16 +408 422 -3.29648282412429e-17 +408 419 1.66666666666667e-01 +408 341 4.16666666666667e-02 +408 454 4.87170999613311e-17 +408 421 1.66666666666667e-01 +408 418 6.33750051135668e-18 +408 340 4.16666666666667e-02 +408 453 -4.44444444444445e-01 +408 420 -1.94444444444445e-01 +408 417 -1.94444444444444e-01 +408 339 -6.94444444444444e-02 +408 332 4.16666666666667e-02 +408 284 1.51788304147971e-18 +408 331 4.16666666666667e-02 +408 283 -3.68628738645072e-18 +408 330 -6.94444444444445e-02 +408 282 -2.77777777777777e-02 +408 416 1.66666666666667e-01 +408 329 3.50569996209610e-17 +408 272 1.53143556863578e-18 +408 326 4.16666666666667e-02 +408 415 6.07153216591882e-18 +408 328 -2.08166817117217e-17 +408 271 -3.93700913883799e-18 +408 325 -4.16666666666667e-02 +408 414 -1.94444444444444e-01 +408 327 2.22222222222222e-01 +408 270 -2.77777777777777e-02 +408 324 -6.94444444444444e-02 +408 413 1.16009632455949e-17 +408 338 -6.93889390390723e-18 +408 323 -4.16666666666667e-02 +408 260 1.22650370762423e-18 +408 412 1.66666666666667e-01 +408 337 -1.93970544921235e-17 +408 322 4.16666666666667e-02 +408 259 -4.54009659728305e-18 +408 411 -1.94444444444445e-01 +408 336 2.22222222222222e-01 +408 321 -6.94444444444444e-02 +408 258 -2.77777777777777e-02 +408 452 -2.55668424799238e-17 +408 410 1.38777878078145e-16 +408 335 -6.93889390390723e-18 +408 407 1.46367293285543e-17 +408 404 -1.66666666666667e-01 +408 320 3.29415348351934e-17 +408 248 1.27054942088145e-18 +408 317 -4.16666666666667e-02 +408 451 3.36780299828310e-17 +408 409 -6.93889390390723e-17 +408 334 -2.25645341983809e-17 +408 406 -1.66666666666667e-01 +408 403 8.66006485272797e-18 +408 319 -2.08166817117217e-17 +408 247 -4.09625133292180e-18 +408 316 -4.16666666666667e-02 +408 450 -4.44444444444445e-01 +408 356 -4.16666666666667e-02 +408 333 2.22222222222222e-01 +408 405 -1.94444444444444e-01 +408 402 -1.94444444444444e-01 +408 318 2.22222222222222e-01 +408 246 -2.77777777777777e-02 +408 315 -6.94444444444444e-02 +409 409 2.22222222222222e+00 +409 355 -6.94444444444444e-02 +409 354 -4.16666666666667e-02 +409 431 1.91226158172131e-17 +409 350 4.16666666666667e-02 +409 430 -2.77777777777778e-02 +409 349 -6.94444444444444e-02 +409 429 6.19350491032344e-18 +409 348 4.16666666666667e-02 +409 428 -7.09051280146575e-17 +409 347 4.16666666666666e-02 +409 427 -1.94444444444444e-01 +409 346 -6.94444444444444e-02 +409 426 -1.66666666666667e-01 +409 345 -4.16666666666667e-02 +409 455 6.24500451351651e-17 +409 422 3.40710532703570e-17 +409 419 -9.44102923009643e-18 +409 341 -4.16666666666667e-02 +409 454 2.22222222222222e-01 +409 421 -1.94444444444445e-01 +409 418 -2.77777777777777e-02 +409 340 -6.94444444444444e-02 +409 453 5.31292945835787e-17 +409 420 1.66666666666667e-01 +409 417 5.88179678573386e-18 +409 339 4.16666666666667e-02 +409 332 -4.16666666666667e-02 +409 284 -1.66666666666667e-01 +409 331 -6.94444444444445e-02 +409 283 -1.94444444444444e-01 +409 330 4.16666666666667e-02 +409 282 -4.20636561606486e-18 +409 416 -1.65882932390282e-17 +409 329 -1.71964628951568e-17 +409 272 1.66666666666667e-01 +409 326 4.16666666666667e-02 +409 415 -2.77777777777778e-02 +409 328 2.22222222222222e-01 +409 271 -1.94444444444444e-01 +409 325 -6.94444444444444e-02 +409 414 6.96938709000838e-18 +409 327 -1.38777878078145e-17 +409 270 -3.68628738645072e-18 +409 324 -4.16666666666667e-02 +409 413 1.17517351102062e-17 +409 338 1.79045824390614e-17 +409 323 4.16666666666667e-02 +409 260 1.66666666666667e-01 +409 412 -1.94444444444444e-01 +409 337 -4.44444444444444e-01 +409 322 -6.94444444444444e-02 +409 259 -1.94444444444444e-01 +409 411 1.66666666666667e-01 +409 336 -2.53294614964558e-17 +409 321 4.16666666666667e-02 +409 258 -4.16570803459665e-18 +409 452 -4.85722573273506e-17 +409 410 6.93889390390723e-17 +409 335 1.39370801141223e-17 +409 407 1.43792313125890e-17 +409 404 -3.59141969635823e-19 +409 320 -1.24378317974821e-17 +409 248 -1.66666666666667e-01 +409 317 -4.16666666666667e-02 +409 451 2.22222222222222e-01 +409 356 -4.16666666666667e-02 +409 334 -4.44444444444444e-01 +409 406 -1.94444444444444e-01 +409 403 -2.77777777777778e-02 +409 319 2.22222222222222e-01 +409 247 -1.94444444444444e-01 +409 316 -6.94444444444444e-02 +409 450 3.52789222531416e-17 +409 408 -6.93889390390723e-17 +409 333 -1.93970544921235e-17 +409 405 -1.66666666666667e-01 +409 402 7.03714972578873e-18 +409 318 -6.93889390390723e-18 +409 246 -4.10641572828885e-18 +409 315 -4.16666666666667e-02 +410 410 2.22222222222222e+00 +410 355 -4.16666666666667e-02 +410 354 -4.16666666666667e-02 +410 431 -1.94444444444445e-01 +410 350 -6.94444444444445e-02 +410 430 1.49094739375702e-17 +410 349 4.16666666666667e-02 +410 429 -1.66666666666667e-01 +410 348 -4.16666666666667e-02 +410 428 -2.77777777777778e-02 +410 347 -6.94444444444444e-02 +410 427 -6.98361724352226e-17 +410 346 4.16666666666666e-02 +410 426 -2.91785909670161e-17 +410 345 4.16666666666667e-02 +410 455 2.22222222222222e-01 +410 422 -2.77777777777778e-02 +410 419 -1.94444444444444e-01 +410 341 -6.94444444444444e-02 +410 454 6.24500451351651e-17 +410 421 3.38457425063873e-17 +410 418 -1.02321580028319e-17 +410 340 -4.16666666666667e-02 +410 453 -1.49115068166436e-16 +410 420 -3.30275086793397e-17 +410 417 1.66666666666667e-01 +410 339 4.16666666666667e-02 +410 332 -6.94444444444445e-02 +410 284 -1.94444444444444e-01 +410 331 -4.16666666666667e-02 +410 283 -1.66666666666667e-01 +410 330 4.16666666666667e-02 +410 282 2.90871114087127e-18 +410 416 -1.94444444444444e-01 +410 329 -4.44444444444445e-01 +410 272 -1.94444444444444e-01 +410 326 -6.94444444444445e-02 +410 415 -1.97307854733417e-17 +410 328 -1.57903882027147e-17 +410 271 1.66666666666667e-01 +410 325 4.16666666666667e-02 +410 414 1.66666666666667e-01 +410 327 3.91229695260184e-17 +410 270 4.68409219831628e-18 +410 324 4.16666666666667e-02 +410 413 -2.77777777777778e-02 +410 338 2.22222222222222e-01 +410 323 -6.94444444444444e-02 +410 260 -1.94444444444444e-01 +410 412 1.16280682999070e-17 +410 337 1.72811661898822e-17 +410 322 4.16666666666667e-02 +410 259 1.66666666666667e-01 +410 411 1.11317069928160e-17 +410 336 -6.93889390390723e-18 +410 321 -4.16666666666667e-02 +410 258 2.81892564846231e-18 +410 452 2.22222222222222e-01 +410 356 -6.94444444444445e-02 +410 335 2.22222222222222e-01 +410 407 -2.77777777777778e-02 +410 404 -1.94444444444444e-01 +410 320 -4.44444444444445e-01 +410 248 -1.94444444444444e-01 +410 317 -6.94444444444444e-02 +410 451 -5.55111512312578e-17 +410 409 6.93889390390723e-17 +410 334 1.03880120651267e-17 +410 406 1.28410194803752e-17 +410 403 4.51299154297091e-18 +410 319 -2.23836926641421e-17 +410 247 -1.66666666666667e-01 +410 316 -4.16666666666667e-02 +410 450 -2.55545605021886e-17 +410 408 1.38777878078145e-16 +410 333 -6.93889390390723e-18 +410 405 1.42098247231381e-17 +410 402 -1.66666666666667e-01 +410 318 3.27937275858975e-17 +410 246 1.20617491689012e-18 +410 315 -4.16666666666667e-02 +411 411 1.11111111111111e+00 +411 305 4.16666666666667e-02 +411 280 -7.48099499014998e-18 +411 304 -4.16666666666667e-02 +411 279 -9.72222222222221e-02 +411 303 -6.94444444444444e-02 +411 332 1.08420217248550e-17 +411 284 -8.33333333333334e-02 +411 329 -4.16666666666667e-02 +411 416 4.06575814682064e-18 +411 331 6.93889390390723e-18 +411 283 3.72694496791892e-18 +411 328 4.16666666666667e-02 +411 415 1.93801138331784e-18 +411 330 1.11111111111111e-01 +411 282 -9.72222222222222e-02 +411 327 -6.94444444444444e-02 +411 414 -2.77777777777779e-02 +411 314 4.66206934168767e-18 +411 395 -1.96511643762998e-17 +411 257 -8.33333333333334e-02 +411 296 -4.16666666666667e-02 +411 313 -9.06257490926321e-17 +411 394 -1.66666666666667e-01 +411 256 -8.23993651088983e-18 +411 295 -4.16666666666667e-02 +411 312 -2.22222222222222e-01 +411 393 -1.94444444444444e-01 +411 255 -9.72222222222221e-02 +411 294 -6.94444444444444e-02 +411 413 0.00000000000000e+00 +411 338 -3.97902197302180e-17 +411 410 1.20126212579605e-17 +411 452 1.38777878078145e-17 +411 323 1.13299127024735e-17 +411 260 8.33333333333334e-02 +411 320 4.16666666666667e-02 +411 404 1.94139951510686e-18 +411 412 8.32667268468867e-17 +411 337 1.50026475617682e-17 +411 409 1.66666666666667e-01 +411 451 3.94255720464250e-17 +411 322 6.93889390390723e-18 +411 259 3.06287113727155e-18 +411 319 4.16666666666667e-02 +411 403 2.08878324792910e-18 +411 281 8.33333333333333e-02 +411 336 -2.22222222222222e-01 +411 408 -1.94444444444445e-01 +411 450 2.22222222222222e-01 +411 321 1.11111111111111e-01 +411 258 -9.72222222222222e-02 +411 318 -6.94444444444445e-02 +411 402 -2.77777777777778e-02 +412 412 1.11111111111111e+00 +412 305 4.16666666666667e-02 +412 280 -1.38888888888888e-02 +412 304 -6.94444444444445e-02 +412 279 -8.82269517860079e-18 +412 303 -4.16666666666667e-02 +412 332 -2.42996811908314e-17 +412 284 5.42101086242752e-19 +412 329 4.16666666666667e-02 +412 416 1.66666666666667e-01 +412 331 1.11111111111111e-01 +412 283 -1.38888888888889e-02 +412 328 -6.94444444444444e-02 +412 415 -1.94444444444445e-01 +412 330 6.93889390390723e-18 +412 282 5.09575021068187e-18 +412 327 4.16666666666667e-02 +412 414 1.93801138331784e-18 +412 314 -6.93889390390723e-18 +412 395 -5.51723380523561e-17 +412 257 -2.96258243631664e-17 +412 296 -4.16666666666668e-02 +412 313 1.11111111111112e-01 +412 394 -1.94444444444445e-01 +412 256 -1.38888888888888e-02 +412 295 -6.94444444444445e-02 +412 312 -9.27873771740251e-17 +412 393 -1.66666666666667e-01 +412 255 -8.05020113070487e-18 +412 294 -4.16666666666667e-02 +412 413 -6.93889390390723e-17 +412 338 -3.46944695195361e-17 +412 410 1.16822784085313e-17 +412 452 4.41422750132106e-17 +412 323 -1.87736382429443e-17 +412 260 -6.46455545344482e-18 +412 320 -4.16666666666667e-02 +412 404 -1.66666666666667e-01 +412 281 2.77555756156289e-17 +412 337 1.11111111111111e-01 +412 409 -1.94444444444444e-01 +412 451 -4.44444444444445e-01 +412 322 1.11111111111111e-01 +412 259 -1.38888888888889e-02 +412 319 -6.94444444444445e-02 +412 403 -1.94444444444445e-01 +412 411 1.11022302462516e-16 +412 336 1.56667213924155e-17 +412 408 1.66666666666667e-01 +412 450 3.49079218222442e-17 +412 321 1.38777878078145e-17 +412 258 4.87890977618477e-18 +412 318 4.16666666666667e-02 +412 402 -1.42301535138722e-18 +413 413 1.11111111111111e+00 +413 305 -6.94444444444445e-02 +413 280 2.74167624367272e-17 +413 304 4.16666666666667e-02 +413 279 8.33333333333333e-02 +413 303 4.16666666666667e-02 +413 332 -2.22222222222222e-01 +413 284 -9.72222222222222e-02 +413 329 -6.94444444444444e-02 +413 416 -1.94444444444445e-01 +413 331 -1.88278483515686e-17 +413 283 -3.25260651745651e-19 +413 328 4.16666666666667e-02 +413 415 1.66666666666667e-01 +413 330 7.87401827767598e-18 +413 282 -8.33333333333334e-02 +413 327 -4.16666666666667e-02 +413 414 1.76352259618345e-18 +413 314 1.11111111111111e-01 +413 395 -2.77777777777778e-02 +413 257 -9.72222222222222e-02 +413 296 -6.94444444444445e-02 +413 313 0.00000000000000e+00 +413 394 -5.33478290839703e-17 +413 256 -2.87313575708659e-17 +413 295 -4.16666666666668e-02 +413 312 7.95533344061239e-18 +413 393 -2.00729867840324e-17 +413 255 -8.33333333333334e-02 +413 294 -4.16666666666667e-02 +413 281 -9.72222222222223e-02 +413 338 1.11111111111111e-01 +413 410 -2.77777777777778e-02 +413 452 2.22222222222222e-01 +413 323 -2.22222222222222e-01 +413 260 -9.72222222222222e-02 +413 320 -6.94444444444445e-02 +413 404 -1.94444444444445e-01 +413 412 -6.93889390390723e-17 +413 337 -3.46944695195361e-17 +413 409 1.27292111313376e-17 +413 451 4.81506466778548e-17 +413 322 -1.82145964977565e-17 +413 259 -5.85469173142172e-18 +413 319 -4.16666666666667e-02 +413 403 -1.66666666666667e-01 +413 411 -2.77555756156289e-17 +413 336 -3.75133951679985e-17 +413 408 1.24547724564272e-17 +413 450 6.93889390390723e-18 +413 321 3.90312782094782e-18 +413 258 8.33333333333333e-02 +413 318 4.16666666666667e-02 +413 402 3.51010453342182e-18 +414 414 1.11111111111111e+00 +414 314 -4.16666666666667e-02 +414 280 8.33333333333333e-02 +414 313 4.16666666666667e-02 +414 279 -9.72222222222221e-02 +414 312 -6.94444444444444e-02 +414 332 2.08166817117217e-17 +414 284 8.61940727125976e-18 +414 413 1.74997006902738e-18 +414 338 4.16666666666667e-02 +414 331 1.74556549770166e-17 +414 283 -8.33333333333333e-02 +414 412 2.16840434497101e-18 +414 337 -4.16666666666667e-02 +414 330 1.11111111111111e-01 +414 282 -9.72222222222223e-02 +414 411 -2.77777777777779e-02 +414 336 -6.94444444444444e-02 +414 329 -1.28765948641599e-17 +414 272 6.88468379528295e-18 +414 410 1.66666666666667e-01 +414 335 4.16666666666667e-02 +414 328 1.55854062294791e-17 +414 271 8.33333333333334e-02 +414 409 6.53570622101418e-18 +414 334 4.16666666666667e-02 +414 327 -2.22222222222222e-01 +414 270 -9.72222222222223e-02 +414 408 -1.94444444444444e-01 +414 333 -6.94444444444445e-02 +414 305 -7.01749856141243e-17 +414 416 8.32667268468867e-17 +414 326 2.08166817117217e-17 +414 269 -1.21430643318376e-17 +414 395 -1.66666666666667e-01 +414 452 3.68563093591659e-17 +414 407 1.94139951510686e-18 +414 311 -4.16666666666667e-02 +414 304 -8.72782748850831e-17 +414 415 5.55111512312578e-17 +414 325 2.04643160056639e-17 +414 268 -8.33333333333334e-02 +414 394 -1.53008031592017e-17 +414 451 -2.08166817117217e-17 +414 406 2.30562368242621e-18 +414 310 -4.16666666666667e-02 +414 303 -2.22222222222222e-01 +414 281 -1.37693675905659e-17 +414 324 1.11111111111111e-01 +414 267 -9.72222222222222e-02 +414 393 -1.94444444444444e-01 +414 450 2.22222222222222e-01 +414 405 -2.77777777777778e-02 +414 309 -6.94444444444444e-02 +415 415 1.11111111111111e+00 +415 314 4.16666666666667e-02 +415 280 -9.72222222222222e-02 +415 313 -6.94444444444444e-02 +415 279 8.33333333333333e-02 +415 312 4.16666666666667e-02 +415 332 3.39439983282688e-17 +415 284 1.09639944692597e-17 +415 413 1.66666666666667e-01 +415 338 4.16666666666667e-02 +415 331 -2.22222222222222e-01 +415 283 -9.72222222222222e-02 +415 412 -1.94444444444445e-01 +415 337 -6.94444444444444e-02 +415 330 2.04643160056639e-17 +415 282 -8.33333333333334e-02 +415 411 1.07064964532944e-18 +415 336 -4.16666666666667e-02 +415 329 -2.08166817117217e-17 +415 272 8.45677694538693e-18 +415 410 -1.96088127289371e-17 +415 335 -4.16666666666667e-02 +415 328 1.11111111111111e-01 +415 271 -9.72222222222223e-02 +415 409 -2.77777777777778e-02 +415 334 -6.94444444444445e-02 +415 327 1.32272665043232e-17 +415 270 8.33333333333333e-02 +415 408 8.34835672813838e-18 +415 333 4.16666666666667e-02 +415 305 3.46944695195361e-17 +415 416 1.38777878078145e-17 +415 326 3.37864502000795e-17 +415 269 -2.39608680119296e-17 +415 395 -4.83029008501237e-17 +415 452 -3.19596118910888e-17 +415 407 -1.66666666666667e-01 +415 311 -4.16666666666668e-02 +415 304 1.11111111111111e-01 +415 281 2.37033699959643e-17 +415 325 -2.22222222222222e-01 +415 268 -9.72222222222224e-02 +415 394 -2.77777777777777e-02 +415 451 2.22222222222222e-01 +415 406 -1.94444444444445e-01 +415 310 -6.94444444444445e-02 +415 303 -9.09239046900656e-17 +415 414 8.32667268468867e-17 +415 324 1.82145964977565e-17 +415 267 -8.33333333333334e-02 +415 393 -1.55735477682176e-17 +415 450 -6.93889390390723e-18 +415 405 -1.20617491689012e-18 +415 309 -4.16666666666667e-02 +416 416 1.11111111111111e+00 +416 314 -6.94444444444445e-02 +416 280 2.08166817117217e-17 +416 313 4.16666666666667e-02 +416 279 -1.39184453892827e-17 +416 312 -4.16666666666667e-02 +416 332 1.11111111111111e-01 +416 284 -1.38888888888889e-02 +416 413 -1.94444444444445e-01 +416 338 -6.94444444444445e-02 +416 331 3.20517267241027e-17 +416 283 1.00830802041152e-17 +416 412 1.66666666666667e-01 +416 337 4.16666666666667e-02 +416 330 1.38777878078145e-17 +416 282 8.45677694538693e-18 +416 411 3.63207727782644e-18 +416 336 4.16666666666667e-02 +416 329 1.11111111111111e-01 +416 272 -1.38888888888889e-02 +416 410 -1.94444444444444e-01 +416 335 -6.94444444444445e-02 +416 328 -1.38777878078145e-17 +416 271 1.02863681114562e-17 +416 409 -1.66425033476525e-17 +416 334 -4.16666666666667e-02 +416 327 -1.33627917758838e-17 +416 270 5.74627151417317e-18 +416 408 1.66666666666667e-01 +416 333 4.16666666666667e-02 +416 305 1.11111111111111e-01 +416 281 -1.38888888888888e-02 +416 326 1.11111111111111e-01 +416 269 -1.38888888888889e-02 +416 395 -1.94444444444445e-01 +416 452 -4.44444444444445e-01 +416 407 -1.94444444444445e-01 +416 311 -6.94444444444445e-02 +416 304 3.46944695195361e-17 +416 415 1.38777878078145e-17 +416 325 3.06371817021880e-17 +416 268 -2.27004829864152e-17 +416 394 -4.71356894488073e-17 +416 451 -2.76742604526925e-17 +416 406 -1.66666666666667e-01 +416 310 -4.16666666666668e-02 +416 303 -7.05375157155491e-17 +416 414 5.55111512312578e-17 +416 324 1.38777878078145e-17 +416 267 -1.24005623478030e-17 +416 393 -1.66666666666667e-01 +416 450 3.35187877887472e-17 +416 405 3.51010453342182e-18 +416 309 -4.16666666666667e-02 +417 417 1.11111111111111e+00 +417 260 -1.72117094882074e-17 +417 337 4.16666666666667e-02 +417 259 8.33333333333334e-02 +417 336 -6.94444444444444e-02 +417 258 -9.72222222222223e-02 +417 428 3.21194893598831e-18 +417 362 -4.16666666666667e-02 +417 347 2.08166817117217e-17 +417 263 5.61074624261249e-18 +417 427 -5.67850887839283e-18 +417 361 -4.16666666666667e-02 +417 346 -2.32375018749745e-17 +417 262 -8.33333333333334e-02 +417 426 -2.77777777777778e-02 +417 360 -6.94444444444444e-02 +417 345 1.11111111111111e-01 +417 261 -9.72222222222221e-02 +417 425 -1.66666666666667e-01 +417 359 -4.16666666666667e-02 +417 344 9.97444822862983e-17 +417 251 3.88788122789724e-18 +417 424 1.70897367438028e-17 +417 358 4.16666666666667e-02 +417 343 7.95071711104985e-17 +417 250 8.33333333333334e-02 +417 423 -1.94444444444444e-01 +417 357 -6.94444444444445e-02 +417 342 -2.22222222222222e-01 +417 249 -9.72222222222221e-02 +417 410 1.66666666666667e-01 +417 455 -1.60021464395282e-17 +417 422 8.21283145657770e-18 +417 335 4.16666666666667e-02 +417 320 -7.30311807122658e-17 +417 419 -2.77555756156289e-17 +417 341 2.08166817117217e-17 +417 248 -1.61681648971901e-17 +417 409 6.09863722023096e-18 +417 454 -1.38777878078145e-17 +417 421 -4.21483594553740e-18 +417 334 -4.16666666666667e-02 +417 319 2.16874315814991e-17 +417 418 -1.11022302462516e-16 +417 340 -2.55827243476848e-17 +417 247 -8.33333333333334e-02 +417 408 -1.94444444444444e-01 +417 453 2.22222222222222e-01 +417 420 -2.77777777777778e-02 +417 333 -6.94444444444444e-02 +417 318 -2.22222222222223e-01 +417 338 4.16666666666667e-02 +417 339 1.11111111111111e-01 +417 246 -9.72222222222222e-02 +418 418 1.11111111111111e+00 +418 260 1.70304444374950e-17 +418 337 -6.94444444444444e-02 +418 259 -9.72222222222222e-02 +418 336 4.16666666666667e-02 +418 258 8.33333333333334e-02 +418 428 -1.66666666666667e-01 +418 362 -4.16666666666667e-02 +418 347 9.90266218635003e-18 +418 263 3.52450409352514e-17 +418 427 -1.94444444444445e-01 +418 361 -6.94444444444444e-02 +418 346 -2.22222222222222e-01 +418 262 -9.72222222222221e-02 +418 426 -5.42101086242752e-18 +418 360 -4.16666666666667e-02 +418 345 -2.55795479741326e-17 +418 261 -8.33333333333334e-02 +418 425 3.73914224235938e-17 +418 359 4.16666666666667e-02 +418 344 -5.55111512312578e-17 +418 251 -1.71439468524270e-17 +418 424 -2.77777777777777e-02 +418 358 -6.94444444444445e-02 +418 343 1.11111111111111e-01 +418 250 -9.72222222222223e-02 +418 423 1.52465930505774e-17 +418 357 4.16666666666667e-02 +418 342 7.77728711509953e-17 +418 249 8.33333333333334e-02 +418 410 -1.03541307472366e-17 +418 455 -1.04811856893247e-17 +418 422 1.66666666666667e-01 +418 335 4.16666666666666e-02 +418 320 0.00000000000000e+00 +418 419 1.38777878078145e-17 +418 341 7.81642003726268e-18 +418 248 -3.80012861456169e-17 +418 409 -2.77777777777777e-02 +418 454 2.22222222222222e-01 +418 421 -1.94444444444445e-01 +418 334 -6.94444444444444e-02 +418 319 1.11111111111111e-01 +418 338 -4.16666666666667e-02 +418 340 -2.22222222222222e-01 +418 247 -9.72222222222221e-02 +418 408 6.33750051135668e-18 +418 453 -6.93889390390723e-18 +418 420 -4.79759461324836e-18 +418 333 -4.16666666666667e-02 +418 318 2.36972290070967e-17 +418 417 -1.11022302462516e-16 +418 339 -2.44843343733328e-17 +418 246 -8.33333333333334e-02 +419 419 1.11111111111111e+00 +419 260 -1.38888888888889e-02 +419 337 -4.16666666666667e-02 +419 259 1.52194879962653e-17 +419 336 4.16666666666667e-02 +419 258 -1.69050835613013e-17 +419 428 -1.94444444444444e-01 +419 362 -6.94444444444445e-02 +419 347 1.11111111111111e-01 +419 263 -1.38888888888888e-02 +419 427 -1.66666666666667e-01 +419 361 -4.16666666666667e-02 +419 346 9.55114351323949e-18 +419 262 3.70661617718482e-17 +419 426 4.64851681453160e-18 +419 360 -4.16666666666667e-02 +419 345 2.08166817117217e-17 +419 261 4.90601483049691e-18 +419 425 -1.94444444444444e-01 +419 359 -6.94444444444445e-02 +419 344 1.11111111111111e-01 +419 251 -1.38888888888889e-02 +419 424 3.50010954464422e-17 +419 358 4.16666666666667e-02 +419 343 -5.55111512312578e-17 +419 250 -1.52093236008982e-17 +419 423 -1.66666666666667e-01 +419 357 -4.16666666666667e-02 +419 342 1.01051030607438e-16 +419 249 3.30681662608079e-18 +419 410 -1.94444444444444e-01 +419 455 -4.44444444444445e-01 +419 422 -1.94444444444445e-01 +419 335 -6.94444444444444e-02 +419 320 1.11111111111111e-01 +419 338 -6.94444444444444e-02 +419 341 1.11111111111111e-01 +419 248 -1.38888888888889e-02 +419 409 -9.44102923009643e-18 +419 454 -1.53797889815331e-17 +419 421 1.66666666666667e-01 +419 334 4.16666666666666e-02 +419 319 1.38777878078145e-17 +419 418 1.38777878078145e-17 +419 340 6.63671489997426e-18 +419 247 -3.78352676879551e-17 +419 408 1.66666666666667e-01 +419 453 -1.42091894484277e-17 +419 420 2.72236389247532e-18 +419 333 4.16666666666667e-02 +419 318 -7.17413612918343e-17 +419 417 -2.77555756156289e-17 +419 339 2.08166817117217e-17 +419 246 -1.58733974315456e-17 +420 420 1.11111111111111e+00 +420 275 -8.33333333333333e-02 +420 352 -4.16666666666667e-02 +420 274 8.93111539584934e-18 +420 351 -6.94444444444444e-02 +420 273 -9.72222222222221e-02 +420 329 4.16666666666667e-02 +420 431 6.57297567069337e-18 +420 350 -3.41337337084538e-17 +420 272 8.33333333333333e-02 +420 328 4.16666666666667e-02 +420 430 -5.67850887839283e-18 +420 349 0.00000000000000e+00 +420 271 3.06287113727155e-18 +420 327 -6.94444444444444e-02 +420 429 -2.77777777777778e-02 +420 348 1.11111111111111e-01 +420 270 -9.72222222222222e-02 +420 425 6.19350491032344e-18 +420 359 1.59253629028596e-16 +420 344 4.16666666666667e-02 +420 251 8.33333333333334e-02 +420 424 -1.66666666666667e-01 +420 358 8.84399805722424e-17 +420 343 -4.16666666666667e-02 +420 250 9.03784154720338e-18 +420 423 -1.94444444444444e-01 +420 357 -2.22222222222222e-01 +420 342 -6.94444444444444e-02 +420 249 -9.72222222222222e-02 +420 410 -3.30275086793397e-17 +420 455 3.46944695195361e-17 +420 422 -1.24900090270330e-16 +420 335 -4.37136763418999e-17 +420 320 -4.16666666666667e-02 +420 419 4.45878143434664e-18 +420 341 -3.31585870279273e-17 +420 248 -8.33333333333334e-02 +420 409 1.66666666666667e-01 +420 454 -5.80014280961855e-17 +420 421 -9.71445146547012e-17 +420 334 2.26090034281118e-17 +420 319 4.16666666666667e-02 +420 418 -5.55653613398821e-18 +420 340 0.00000000000000e+00 +420 247 2.95445092002300e-18 +420 408 -1.94444444444445e-01 +420 453 2.22222222222222e-01 +420 353 -4.16666666666667e-02 +420 333 -2.22222222222223e-01 +420 318 -6.94444444444444e-02 +420 417 -2.77777777777778e-02 +420 339 1.11111111111111e-01 +420 246 -9.72222222222223e-02 +421 421 1.11111111111111e+00 +421 275 1.27800331081729e-17 +421 352 -6.94444444444444e-02 +421 274 -1.38888888888888e-02 +421 351 -4.16666666666667e-02 +421 273 7.54875762593032e-18 +421 329 -4.16666666666667e-02 +421 431 -1.66666666666667e-01 +421 350 -3.38169433861807e-17 +421 272 1.59919820441612e-18 +421 328 -6.94444444444444e-02 +421 430 -1.94444444444445e-01 +421 349 1.11111111111111e-01 +421 271 -1.38888888888889e-02 +421 327 4.16666666666667e-02 +421 429 -5.20417042793042e-18 +421 348 6.93889390390723e-18 +421 270 3.12555157536837e-18 +421 425 7.92077449636441e-17 +421 359 -2.77555756156289e-17 +421 344 4.16666666666667e-02 +421 251 -3.11470955364351e-17 +421 424 -1.94444444444444e-01 +421 358 1.11111111111111e-01 +421 343 -6.94444444444444e-02 +421 250 -1.38888888888889e-02 +421 423 -1.66666666666667e-01 +421 357 8.14862635917582e-17 +421 342 -4.16666666666667e-02 +421 249 8.99887803162969e-18 +421 410 3.38457425063873e-17 +421 455 9.03508869012481e-18 +421 422 -1.38777878078145e-17 +421 335 5.55111512312578e-17 +421 320 4.16666666666667e-02 +421 419 1.66666666666667e-01 +421 341 -4.32433612979370e-17 +421 248 1.27292111313376e-17 +421 409 -1.94444444444445e-01 +421 454 -4.44444444444445e-01 +421 353 -4.16666666666667e-02 +421 334 1.11111111111111e-01 +421 319 -6.94444444444444e-02 +421 418 -1.94444444444445e-01 +421 340 1.11111111111111e-01 +421 247 -1.38888888888889e-02 +421 408 1.66666666666667e-01 +421 453 -5.50819172852367e-17 +421 420 -9.71445146547012e-17 +421 333 2.46696228305447e-17 +421 318 4.16666666666667e-02 +421 417 -3.98613704977874e-18 +421 339 6.93889390390723e-18 +421 246 3.45250629300853e-18 +422 422 1.11111111111111e+00 +422 275 -9.72222222222220e-02 +422 352 -4.16666666666667e-02 +422 274 1.32645359540023e-17 +422 351 -4.16666666666667e-02 +422 273 -8.33333333333333e-02 +422 329 -6.94444444444444e-02 +422 431 -1.94444444444445e-01 +422 350 -2.22222222222222e-01 +422 272 -9.72222222222222e-02 +422 328 -4.16666666666667e-02 +422 430 -1.66666666666667e-01 +422 349 -3.80529551553994e-17 +422 271 2.06676039130049e-18 +422 327 4.16666666666667e-02 +422 429 4.54009659728305e-18 +422 348 -2.88202960303276e-17 +422 270 8.33333333333333e-02 +422 425 -2.77777777777777e-02 +422 359 1.11111111111111e-01 +422 344 -6.94444444444445e-02 +422 251 -9.72222222222224e-02 +422 424 7.90247858470372e-17 +422 358 -2.77555756156289e-17 +422 343 4.16666666666667e-02 +422 250 -3.16722559637328e-17 +422 423 5.99021700298241e-18 +422 357 1.59313344851378e-16 +422 342 4.16666666666667e-02 +422 249 8.33333333333334e-02 +422 410 -2.77777777777778e-02 +422 455 2.22222222222222e-01 +422 353 -6.94444444444445e-02 +422 335 1.11111111111111e-01 +422 320 -6.94444444444445e-02 +422 419 -1.94444444444445e-01 +422 341 -2.22222222222222e-01 +422 248 -9.72222222222223e-02 +422 409 3.40710532703570e-17 +422 454 1.82501718815412e-17 +422 421 -1.38777878078145e-17 +422 334 6.24500451351651e-17 +422 319 4.16666666666667e-02 +422 418 1.66666666666667e-01 +422 340 -3.91295340313597e-17 +422 247 1.40404181336873e-17 +422 408 -3.26531201166533e-17 +422 453 3.46944695195361e-17 +422 420 -1.24900090270330e-16 +422 333 -4.24865373595653e-17 +422 318 -4.16666666666667e-02 +422 417 8.32125167382625e-18 +422 339 -3.50146479735983e-17 +422 246 -8.33333333333334e-02 +423 423 2.22222222222222e+00 +423 379 -4.16666666666667e-02 +423 378 -6.94444444444444e-02 +423 446 -1.66666666666667e-01 +423 374 -4.16666666666667e-02 +423 445 6.10541348380900e-18 +423 373 4.16666666666667e-02 +423 444 -1.94444444444444e-01 +423 372 -6.94444444444444e-02 +423 443 1.92242597708836e-17 +423 371 4.16666666666667e-02 +423 442 -1.66666666666667e-01 +423 370 -4.16666666666667e-02 +423 441 -1.94444444444444e-01 +423 369 -6.94444444444444e-02 +423 458 6.10717107717455e-17 +423 437 1.43334915334373e-17 +423 434 1.66666666666667e-01 +423 365 4.16666666666667e-02 +423 457 -1.27387402519942e-17 +423 436 1.66666666666667e-01 +423 433 5.03645790437407e-18 +423 364 4.16666666666667e-02 +423 456 -4.44444444444445e-01 +423 435 -1.94444444444444e-01 +423 432 -1.94444444444444e-01 +423 363 -6.94444444444444e-02 +423 356 4.16666666666667e-02 +423 287 5.82758667710959e-19 +423 355 4.16666666666667e-02 +423 286 -1.06929439261383e-17 +423 354 -6.94444444444444e-02 +423 285 -2.77777777777778e-02 +423 431 1.66666666666667e-01 +423 353 -6.33292653344150e-17 +423 275 2.19550939928315e-18 +423 350 4.16666666666667e-02 +423 430 1.64798730217797e-17 +423 352 -2.08166817117217e-17 +423 274 -6.05289744107923e-18 +423 349 -4.16666666666667e-02 +423 429 -1.94444444444444e-01 +423 351 2.22222222222222e-01 +423 273 -2.77777777777778e-02 +423 348 -6.94444444444444e-02 +423 428 2.65629532258949e-18 +423 362 -2.77555756156289e-17 +423 347 -4.16666666666667e-02 +423 263 1.97019863531350e-18 +423 427 1.66666666666667e-01 +423 361 -4.40846767727973e-17 +423 346 4.16666666666667e-02 +423 262 -1.02728155843002e-17 +423 426 -1.94444444444444e-01 +423 360 2.22222222222222e-01 +423 345 -6.94444444444445e-02 +423 261 -2.77777777777778e-02 +423 455 1.98520805913885e-16 +423 425 -3.19189119579733e-16 +423 359 -2.77555756156289e-17 +423 422 7.07441917546792e-18 +423 419 -1.66666666666667e-01 +423 344 -7.22923562240232e-17 +423 251 2.16162808139297e-18 +423 341 -4.16666666666667e-02 +423 454 1.69877539769533e-16 +423 424 -1.66533453693773e-16 +423 358 -3.55243500496085e-17 +423 421 -1.66666666666667e-01 +423 418 1.74149973955484e-17 +423 343 -2.08166817117217e-17 +423 250 -5.53620734325411e-18 +423 340 -4.16666666666667e-02 +423 453 -4.44444444444444e-01 +423 380 -4.16666666666667e-02 +423 357 2.22222222222222e-01 +423 420 -1.94444444444444e-01 +423 417 -1.94444444444444e-01 +423 342 2.22222222222222e-01 +423 249 -2.77777777777778e-02 +423 339 -6.94444444444444e-02 +424 424 2.22222222222222e+00 +424 379 -6.94444444444444e-02 +424 378 -4.16666666666667e-02 +424 446 -4.30970363562988e-18 +424 374 4.16666666666667e-02 +424 445 -2.77777777777778e-02 +424 373 -6.94444444444444e-02 +424 444 6.15284732885524e-18 +424 372 4.16666666666667e-02 +424 443 2.25226060674918e-17 +424 371 4.16666666666667e-02 +424 442 -1.94444444444444e-01 +424 370 -6.94444444444444e-02 +424 441 -1.66666666666667e-01 +424 369 -4.16666666666667e-02 +424 458 1.38777878078145e-17 +424 437 -3.05338436826230e-17 +424 434 8.45338881359792e-19 +424 365 -4.16666666666667e-02 +424 457 2.22222222222222e-01 +424 436 -1.94444444444444e-01 +424 433 -2.77777777777778e-02 +424 364 -6.94444444444444e-02 +424 456 -1.19414704903911e-17 +424 435 1.66666666666667e-01 +424 432 5.85469173142172e-18 +424 363 4.16666666666667e-02 +424 356 -4.16666666666667e-02 +424 287 -1.66666666666667e-01 +424 355 -6.94444444444445e-02 +424 286 -1.94444444444445e-01 +424 354 4.16666666666667e-02 +424 285 -6.50013083722950e-18 +424 431 -6.03900610074426e-17 +424 353 3.12385750947386e-18 +424 275 1.66666666666667e-01 +424 350 4.16666666666667e-02 +424 430 -2.77777777777778e-02 +424 352 2.22222222222222e-01 +424 274 -1.94444444444445e-01 +424 349 -6.94444444444444e-02 +424 429 1.77368699155050e-17 +424 351 -2.08166817117217e-17 +424 273 -1.02728155843002e-17 +424 348 -4.16666666666667e-02 +424 428 -1.97799133842824e-17 +424 362 -3.08800683998132e-17 +424 347 4.16666666666667e-02 +424 263 1.66666666666667e-01 +424 427 -1.94444444444445e-01 +424 361 -4.44444444444445e-01 +424 346 -6.94444444444445e-02 +424 262 -1.94444444444445e-01 +424 426 1.66666666666667e-01 +424 360 -3.72302744053787e-17 +424 345 4.16666666666667e-02 +424 261 -6.71527720583209e-18 +424 455 -6.93889390390723e-17 +424 425 1.80411241501588e-16 +424 359 -4.23736702193436e-17 +424 422 7.92416262815343e-17 +424 419 3.50010954464422e-17 +424 344 7.09601851562290e-18 +424 251 -1.66666666666667e-01 +424 341 -4.16666666666667e-02 +424 454 2.22222222222223e-01 +424 380 -4.16666666666667e-02 +424 358 -4.44444444444445e-01 +424 421 -1.94444444444444e-01 +424 418 -2.77777777777777e-02 +424 343 2.22222222222222e-01 +424 250 -1.94444444444445e-01 +424 340 -6.94444444444444e-02 +424 453 1.71886278403947e-16 +424 423 -1.66533453693773e-16 +424 357 -4.45200517076860e-17 +424 420 -1.66666666666667e-01 +424 417 1.80655186990397e-17 +424 342 -2.08166817117217e-17 +424 249 -1.02728155843002e-17 +424 339 -4.16666666666667e-02 +425 425 2.22222222222222e+00 +425 379 -4.16666666666667e-02 +425 378 -4.16666666666667e-02 +425 446 -1.94444444444444e-01 +425 374 -6.94444444444444e-02 +425 445 -2.99680256738571e-18 +425 373 4.16666666666667e-02 +425 444 -1.66666666666667e-01 +425 372 -4.16666666666667e-02 +425 443 -2.77777777777778e-02 +425 371 -6.94444444444445e-02 +425 442 2.23616698075135e-17 +425 370 4.16666666666667e-02 +425 441 2.04101058970396e-17 +425 369 4.16666666666667e-02 +425 458 2.22222222222222e-01 +425 437 -2.77777777777778e-02 +425 434 -1.94444444444444e-01 +425 365 -6.94444444444444e-02 +425 457 1.38777878078145e-17 +425 436 -2.60682859846983e-17 +425 433 3.80826013085533e-18 +425 364 -4.16666666666667e-02 +425 456 5.83808988565554e-17 +425 435 1.42437060410283e-17 +425 432 1.66666666666667e-01 +425 363 4.16666666666667e-02 +425 356 -6.94444444444445e-02 +425 287 -1.94444444444444e-01 +425 355 -4.16666666666667e-02 +425 286 -1.66666666666667e-01 +425 354 4.16666666666667e-02 +425 285 -1.40438062654763e-18 +425 431 -1.94444444444445e-01 +425 353 -4.44444444444445e-01 +425 275 -1.94444444444444e-01 +425 350 -6.94444444444445e-02 +425 430 -6.02342069451478e-17 +425 352 1.07278840352125e-17 +425 274 1.66666666666667e-01 +425 349 4.16666666666667e-02 +425 429 1.66666666666667e-01 +425 351 -6.87958042177575e-17 +425 273 1.94478764689587e-18 +425 348 4.16666666666667e-02 +425 428 -2.77777777777778e-02 +425 362 2.22222222222222e-01 +425 347 -6.94444444444445e-02 +425 263 -1.94444444444445e-01 +425 427 -2.16975959768662e-17 +425 361 -3.37390163550333e-17 +425 346 4.16666666666667e-02 +425 262 1.66666666666667e-01 +425 426 3.72355683612990e-18 +425 360 -3.46944695195361e-17 +425 345 -4.16666666666667e-02 +425 261 2.30392961653170e-18 +425 455 2.22222222222223e-01 +425 380 -6.94444444444444e-02 +425 359 2.22222222222222e-01 +425 422 -2.77777777777777e-02 +425 419 -1.94444444444444e-01 +425 344 -4.44444444444445e-01 +425 251 -1.94444444444444e-01 +425 341 -6.94444444444445e-02 +425 454 -6.93889390390723e-17 +425 424 1.80411241501588e-16 +425 358 -3.93772911684315e-17 +425 421 7.92229915566947e-17 +425 418 3.39219754716402e-17 +425 343 2.29545928705915e-18 +425 250 -1.66666666666667e-01 +425 340 -4.16666666666667e-02 +425 453 1.90172025669273e-16 +425 423 -3.19189119579733e-16 +425 357 -2.77555756156289e-17 +425 420 6.22060996463558e-18 +425 417 -1.66666666666667e-01 +425 342 -6.59330446142747e-17 +425 249 2.30392961653170e-18 +425 339 -4.16666666666667e-02 +426 426 1.11111111111111e+00 +426 329 4.16666666666667e-02 +426 283 2.60208521396521e-18 +426 328 -4.16666666666667e-02 +426 282 -9.72222222222222e-02 +426 327 -6.94444444444444e-02 +426 356 1.81061762805079e-17 +426 287 -8.33333333333333e-02 +426 353 -4.16666666666667e-02 +426 431 5.61074624261249e-18 +426 355 -1.38777878078145e-17 +426 286 8.18572640226556e-18 +426 352 4.16666666666667e-02 +426 430 -3.98783111567325e-18 +426 354 1.11111111111111e-01 +426 285 -9.72222222222222e-02 +426 351 -6.94444444444445e-02 +426 429 -2.77777777777778e-02 +426 338 -1.04408669210354e-16 +426 410 -2.92870111842647e-17 +426 260 -8.33333333333334e-02 +426 320 -4.16666666666667e-02 +426 337 2.45029690981724e-17 +426 409 -1.66666666666667e-01 +426 259 2.71050543121376e-18 +426 319 -4.16666666666667e-02 +426 336 -2.22222222222222e-01 +426 408 -1.94444444444445e-01 +426 258 -9.72222222222223e-02 +426 318 -6.94444444444444e-02 +426 428 1.11022302462516e-16 +426 362 3.43014462320101e-17 +426 425 3.80656606496083e-18 +426 455 3.46944695195361e-17 +426 347 1.90548531814327e-17 +426 263 8.33333333333334e-02 +426 344 4.16666666666667e-02 +426 419 2.91548740444930e-18 +426 427 -1.24900090270330e-16 +426 361 8.30261694898665e-17 +426 424 1.66666666666667e-01 +426 454 -5.30642848048770e-17 +426 346 -1.38777878078145e-17 +426 262 7.94178091345632e-18 +426 343 4.16666666666667e-02 +426 418 -4.87721571029026e-18 +426 284 8.33333333333334e-02 +426 360 -2.22222222222222e-01 +426 423 -1.94444444444444e-01 +426 453 2.22222222222222e-01 +426 345 1.11111111111111e-01 +426 261 -9.72222222222222e-02 +426 342 -6.94444444444444e-02 +426 417 -2.77777777777778e-02 +427 427 1.11111111111111e+00 +427 329 4.16666666666666e-02 +427 283 -1.38888888888888e-02 +427 328 -6.94444444444444e-02 +427 282 2.77826806699411e-18 +427 327 -4.16666666666667e-02 +427 356 2.08437867660338e-17 +427 287 2.46113893154210e-17 +427 353 4.16666666666667e-02 +427 431 1.66666666666667e-01 +427 355 1.11111111111111e-01 +427 286 -1.38888888888888e-02 +427 352 -6.94444444444445e-02 +427 430 -1.94444444444445e-01 +427 354 -1.38777878078145e-17 +427 285 7.91467585914418e-18 +427 351 4.16666666666667e-02 +427 429 -4.79759461324836e-18 +427 338 0.00000000000000e+00 +427 410 -6.97684097994422e-17 +427 260 2.16840434497101e-18 +427 320 -4.16666666666667e-02 +427 337 1.11111111111111e-01 +427 409 -1.94444444444444e-01 +427 259 -1.38888888888889e-02 +427 319 -6.94444444444444e-02 +427 336 2.51331616109296e-17 +427 408 -1.66666666666667e-01 +427 258 2.77826806699411e-18 +427 318 -4.16666666666667e-02 +427 428 5.55111512312578e-17 +427 362 -4.16333634234434e-17 +427 425 -2.06269463315367e-17 +427 455 1.78300435397030e-17 +427 347 2.99510850149121e-17 +427 263 -2.92056960213283e-17 +427 344 -4.16666666666667e-02 +427 419 -1.66666666666667e-01 +427 284 -1.19262238973405e-17 +427 361 1.11111111111111e-01 +427 424 -1.94444444444445e-01 +427 454 -4.44444444444445e-01 +427 346 1.11111111111111e-01 +427 262 -1.38888888888889e-02 +427 343 -6.94444444444445e-02 +427 418 -1.94444444444445e-01 +427 426 -1.24900090270330e-16 +427 360 8.35377773900081e-17 +427 423 1.66666666666667e-01 +427 453 -6.09829840705206e-17 +427 345 -1.38777878078145e-17 +427 261 7.80625564189563e-18 +427 342 4.16666666666667e-02 +427 417 -4.81114714040443e-18 +428 428 1.11111111111111e+00 +428 329 -6.94444444444444e-02 +428 283 -1.14654379740342e-17 +428 328 4.16666666666666e-02 +428 282 8.33333333333333e-02 +428 327 4.16666666666667e-02 +428 356 -2.22222222222222e-01 +428 287 -9.72222222222222e-02 +428 353 -6.94444444444445e-02 +428 431 -1.94444444444445e-01 +428 355 2.30155792427938e-17 +428 286 2.17653586126465e-17 +428 352 4.16666666666667e-02 +428 430 1.66666666666667e-01 +428 354 1.54634334850745e-17 +428 285 -8.33333333333333e-02 +428 351 -4.16666666666667e-02 +428 429 1.86686061574848e-18 +428 338 1.11111111111111e-01 +428 410 -2.77777777777778e-02 +428 260 -9.72222222222223e-02 +428 320 -6.94444444444445e-02 +428 337 6.93889390390723e-18 +428 409 -7.08915754875014e-17 +428 259 5.09575021068187e-18 +428 319 -4.16666666666667e-02 +428 336 -1.05357346111279e-16 +428 408 -2.79893567090711e-17 +428 258 -8.33333333333333e-02 +428 318 -4.16666666666667e-02 +428 284 -9.72222222222221e-02 +428 362 1.11111111111111e-01 +428 425 -2.77777777777778e-02 +428 455 2.22222222222222e-01 +428 347 -2.22222222222222e-01 +428 263 -9.72222222222223e-02 +428 344 -6.94444444444445e-02 +428 419 -1.94444444444444e-01 +428 427 5.55111512312578e-17 +428 361 -4.16333634234434e-17 +428 424 -1.89379626347116e-17 +428 454 1.45933188900075e-17 +428 346 2.08573392931899e-17 +428 262 -2.81892564846231e-17 +428 343 -4.16666666666667e-02 +428 418 -1.66666666666667e-01 +428 426 1.24900090270330e-16 +428 360 3.82723366887383e-17 +428 423 1.78893358460108e-18 +428 453 3.46944695195361e-17 +428 345 1.81061762805079e-17 +428 261 8.33333333333334e-02 +428 342 4.16666666666667e-02 +428 417 3.21194893598831e-18 +429 429 1.11111111111111e+00 +429 338 -4.16666666666667e-02 +429 283 8.33333333333334e-02 +429 337 4.16666666666667e-02 +429 282 -9.72222222222223e-02 +429 336 -6.94444444444444e-02 +429 356 1.38777878078145e-17 +429 287 4.93311988480905e-18 +429 428 3.60158409172529e-18 +429 362 4.16666666666667e-02 +429 355 -3.48028897367847e-17 +429 286 -8.33333333333333e-02 +429 427 -5.55653613398821e-18 +429 361 -4.16666666666667e-02 +429 354 1.11111111111111e-01 +429 285 -9.72222222222222e-02 +429 426 -2.77777777777778e-02 +429 360 -6.94444444444444e-02 +429 353 9.46542377897736e-17 +429 275 2.30392961653170e-18 +429 425 1.66666666666667e-01 +429 359 4.16666666666667e-02 +429 352 9.19810018082390e-17 +429 274 8.33333333333334e-02 +429 424 1.66543618089141e-17 +429 358 4.16666666666667e-02 +429 351 -2.22222222222222e-01 +429 273 -9.72222222222223e-02 +429 423 -1.94444444444444e-01 +429 357 -6.94444444444444e-02 +429 329 -7.68428289749101e-17 +429 431 2.77555756156289e-17 +429 350 1.38777878078145e-17 +429 272 -1.65882932390282e-17 +429 410 -1.66666666666667e-01 +429 455 -1.40872167040231e-17 +429 422 2.80706718720075e-18 +429 335 -4.16666666666667e-02 +429 328 2.54787510534094e-17 +429 430 -1.11022302462516e-16 +429 349 -2.75658402354440e-17 +429 271 -8.33333333333333e-02 +429 409 5.66495635123676e-18 +429 454 -1.38777878078145e-17 +429 421 -4.66037527579316e-18 +429 334 -4.16666666666667e-02 +429 327 -2.22222222222222e-01 +429 284 -1.68051336735253e-17 +429 348 1.11111111111111e-01 +429 270 -9.72222222222223e-02 +429 408 -1.94444444444445e-01 +429 453 2.22222222222222e-01 +429 420 -2.77777777777778e-02 +429 333 -6.94444444444444e-02 +430 430 1.11111111111111e+00 +430 338 4.16666666666667e-02 +430 283 -9.72222222222223e-02 +430 337 -6.94444444444444e-02 +430 282 8.33333333333334e-02 +430 336 4.16666666666667e-02 +430 356 4.81453527219344e-18 +430 287 4.49672851038363e-17 +430 428 1.66666666666667e-01 +430 362 4.16666666666667e-02 +430 355 -2.22222222222222e-01 +430 286 -9.72222222222221e-02 +430 427 -1.94444444444445e-01 +430 361 -6.94444444444444e-02 +430 354 -2.95309566730739e-17 +430 285 -8.33333333333333e-02 +430 426 -3.97427858851718e-18 +430 360 -4.16666666666667e-02 +430 353 -1.38777878078145e-17 +430 275 -6.93889390390723e-18 +430 425 -6.02325128792533e-17 +430 359 -4.16666666666667e-02 +430 352 1.11111111111111e-01 +430 274 -9.72222222222224e-02 +430 424 -2.77777777777778e-02 +430 358 -6.94444444444445e-02 +430 351 8.72782748850831e-17 +430 273 8.33333333333334e-02 +430 423 1.63714528045311e-17 +430 357 4.16666666666667e-02 +430 329 5.55111512312578e-17 +430 431 0.00000000000000e+00 +430 350 3.51010453342182e-18 +430 272 -3.17671236538253e-17 +430 410 1.49094739375702e-17 +430 455 -1.50528342638930e-17 +430 422 -1.66666666666667e-01 +430 335 -4.16666666666667e-02 +430 328 1.11111111111111e-01 +430 284 1.95427441590512e-17 +430 349 -2.22222222222222e-01 +430 271 -9.72222222222222e-02 +430 409 -2.77777777777778e-02 +430 454 2.22222222222222e-01 +430 421 -1.94444444444445e-01 +430 334 -6.94444444444444e-02 +430 327 2.61563774112128e-17 +430 429 -1.11022302462516e-16 +430 348 -3.65376132127615e-17 +430 270 -8.33333333333333e-02 +430 408 6.25787941431477e-18 +430 453 -6.93889390390723e-18 +430 420 -4.81114714040443e-18 +430 333 -4.16666666666667e-02 +431 431 1.11111111111111e+00 +431 338 -6.94444444444445e-02 +431 283 1.88651178012478e-17 +431 337 4.16666666666667e-02 +431 282 -1.80384136447276e-17 +431 336 -4.16666666666667e-02 +431 356 1.11111111111111e-01 +431 287 -1.38888888888888e-02 +431 428 -1.94444444444445e-01 +431 362 -6.94444444444445e-02 +431 355 1.26038502551440e-17 +431 286 4.36933475511658e-17 +431 427 1.66666666666667e-01 +431 361 4.16666666666667e-02 +431 354 1.38777878078145e-17 +431 285 3.79470760369927e-18 +431 426 5.71916645986104e-18 +431 360 4.16666666666667e-02 +431 353 1.11111111111111e-01 +431 275 -1.38888888888889e-02 +431 425 -1.94444444444445e-01 +431 359 -6.94444444444445e-02 +431 352 -1.38777878078145e-17 +431 274 -5.48877349820787e-18 +431 424 -5.98615124483559e-17 +431 358 -4.16666666666667e-02 +431 351 9.73884601435104e-17 +431 273 2.05998412772246e-18 +431 423 1.66666666666667e-01 +431 357 4.16666666666667e-02 +431 329 1.11111111111111e-01 +431 284 -1.38888888888889e-02 +431 350 1.11111111111111e-01 +431 272 -1.38888888888889e-02 +431 410 -1.94444444444445e-01 +431 455 -4.44444444444445e-01 +431 422 -1.94444444444445e-01 +431 335 -6.94444444444445e-02 +431 328 5.55111512312578e-17 +431 430 1.38777878078145e-17 +431 349 -2.12774676350280e-18 +431 271 -3.39355279987963e-17 +431 409 1.91361683443692e-17 +431 454 -1.40455003313708e-17 +431 421 -1.66666666666667e-01 +431 334 -4.16666666666667e-02 +431 327 -7.69851305100488e-17 +431 429 2.77555756156289e-17 +431 348 1.38777878078145e-17 +431 270 -1.65205306032479e-17 +431 408 -1.66666666666667e-01 +431 453 -1.68830607046727e-17 +431 420 6.57297567069337e-18 +431 333 -4.16666666666667e-02 +432 432 1.11111111111111e+00 +432 263 5.93600689435814e-18 +432 361 4.16666666666667e-02 +432 262 8.33333333333334e-02 +432 360 -6.94444444444444e-02 +432 261 -9.72222222222222e-02 +432 443 -9.89334482393023e-18 +432 386 -4.16666666666667e-02 +432 371 -4.16333634234434e-17 +432 266 9.55453164502851e-18 +432 442 -1.20617491689012e-18 +432 385 -4.16666666666667e-02 +432 370 4.68409219831628e-18 +432 265 -8.33333333333334e-02 +432 441 -2.77777777777778e-02 +432 384 -6.94444444444444e-02 +432 369 1.11111111111111e-01 +432 264 -9.72222222222222e-02 +432 440 -1.66666666666667e-01 +432 383 -4.16666666666667e-02 +432 368 3.95865083064034e-17 +432 254 7.73510487432627e-18 +432 439 2.92395773392184e-18 +432 382 4.16666666666667e-02 +432 367 -4.44946407192684e-18 +432 253 8.33333333333334e-02 +432 438 -1.94444444444444e-01 +432 381 -6.94444444444444e-02 +432 366 -2.22222222222223e-01 +432 252 -9.72222222222222e-02 +432 425 1.66666666666667e-01 +432 458 -3.01221856702574e-17 +432 437 -1.09639944692597e-17 +432 359 4.16666666666667e-02 +432 344 3.01357381974135e-17 +432 434 -1.11022302462516e-16 +432 365 -4.16333634234434e-17 +432 251 7.90112333198811e-18 +432 424 6.72205346941013e-18 +432 457 -6.93889390390723e-18 +432 436 -2.83925443919641e-18 +432 358 -4.16666666666667e-02 +432 343 -3.30851069197530e-18 +432 433 1.38777878078145e-17 +432 364 2.14871082894735e-18 +432 250 -8.33333333333334e-02 +432 423 -1.94444444444444e-01 +432 456 2.22222222222222e-01 +432 435 -2.77777777777778e-02 +432 357 -6.94444444444444e-02 +432 342 -2.22222222222223e-01 +432 362 4.16666666666667e-02 +432 363 1.11111111111111e-01 +432 249 -9.72222222222222e-02 +433 433 1.11111111111111e+00 +433 263 -1.26902476157639e-17 +433 361 -6.94444444444444e-02 +433 262 -9.72222222222222e-02 +433 360 4.16666666666667e-02 +433 261 8.33333333333334e-02 +433 443 -1.66666666666667e-01 +433 386 -4.16666666666667e-02 +433 371 3.94272661123195e-18 +433 266 1.81265050712420e-17 +433 442 -1.94444444444444e-01 +433 385 -6.94444444444444e-02 +433 370 -2.22222222222222e-01 +433 265 -9.72222222222222e-02 +433 441 -3.48638761089870e-18 +433 384 -4.16666666666667e-02 +433 369 3.82922419629988e-18 +433 264 -8.33333333333334e-02 +433 440 -7.92822838630025e-18 +433 383 4.16666666666667e-02 +433 368 -6.93889390390723e-18 +433 254 -8.90401034153721e-18 +433 439 -2.77777777777778e-02 +433 382 -6.94444444444444e-02 +433 367 1.11111111111111e-01 +433 253 -9.72222222222222e-02 +433 438 3.67273485929465e-18 +433 381 4.16666666666667e-02 +433 366 -5.85469173142172e-18 +433 252 8.33333333333334e-02 +433 425 2.98155597433514e-18 +433 458 -1.67407591695340e-17 +433 437 1.66666666666667e-01 +433 359 4.16666666666667e-02 +433 344 6.93889390390723e-18 +433 434 5.55111512312578e-17 +433 365 1.46197886696092e-18 +433 251 9.17506088465858e-18 +433 424 -2.77777777777778e-02 +433 457 2.22222222222222e-01 +433 436 -1.94444444444444e-01 +433 358 -6.94444444444444e-02 +433 343 1.11111111111111e-01 +433 362 -4.16666666666667e-02 +433 364 -2.22222222222222e-01 +433 250 -9.72222222222222e-02 +433 423 5.03476383847956e-18 +433 456 0.00000000000000e+00 +433 435 -2.49366499671666e-18 +433 357 -4.16666666666667e-02 +433 342 -5.17812416480235e-18 +433 432 1.38777878078145e-17 +433 363 4.68409219831628e-18 +433 249 -8.33333333333334e-02 +434 434 1.11111111111111e+00 +434 263 -1.38888888888889e-02 +434 361 -4.16666666666667e-02 +434 262 -1.34576594659763e-17 +434 360 4.16666666666667e-02 +434 261 6.52554182564713e-18 +434 443 -1.94444444444444e-01 +434 386 -6.94444444444444e-02 +434 371 1.11111111111111e-01 +434 266 -1.38888888888889e-02 +434 442 -1.66666666666667e-01 +434 385 -4.16666666666666e-02 +434 370 5.63615723103011e-18 +434 265 1.79028883731669e-17 +434 441 -1.00051531729678e-17 +434 384 -4.16666666666667e-02 +434 369 -2.77555756156289e-17 +434 264 9.79847713383775e-18 +434 440 -1.94444444444444e-01 +434 383 -6.94444444444444e-02 +434 368 1.11111111111111e-01 +434 254 -1.38888888888889e-02 +434 439 -8.39748463907913e-18 +434 382 4.16666666666667e-02 +434 367 -6.93889390390723e-18 +434 253 -1.07945878798088e-17 +434 438 -1.66666666666667e-01 +434 381 -4.16666666666667e-02 +434 366 4.17959937493162e-17 +434 252 8.07730618501701e-18 +434 425 -1.94444444444444e-01 +434 458 -4.44444444444445e-01 +434 437 -1.94444444444444e-01 +434 359 -6.94444444444444e-02 +434 344 1.11111111111111e-01 +434 362 -6.94444444444444e-02 +434 365 1.11111111111111e-01 +434 251 -1.38888888888889e-02 +434 424 7.35224598216733e-19 +434 457 -1.05523364568941e-17 +434 436 1.66666666666667e-01 +434 358 4.16666666666667e-02 +434 343 6.93889390390723e-18 +434 433 5.55111512312578e-17 +434 364 3.92875056760226e-18 +434 250 9.24282352043893e-18 +434 423 1.66666666666667e-01 +434 456 -2.78178325372521e-17 +434 435 -1.10774968841917e-17 +434 357 4.16666666666667e-02 +434 342 3.14916261877308e-17 +434 432 -1.11022302462516e-16 +434 363 -3.46944695195361e-17 +434 249 7.99090882439707e-18 +435 435 1.11111111111111e+00 +435 278 -8.33333333333333e-02 +435 376 -4.16666666666667e-02 +435 277 1.74488787134386e-18 +435 375 -6.94444444444444e-02 +435 276 -9.72222222222222e-02 +435 353 4.16666666666667e-02 +435 446 -9.87979229677416e-18 +435 374 -3.52145477491503e-17 +435 275 8.33333333333334e-02 +435 352 4.16666666666667e-02 +435 445 -7.72494047895922e-19 +435 373 -6.93889390390723e-18 +435 274 3.25260651745651e-18 +435 351 -6.94444444444444e-02 +435 444 -2.77777777777778e-02 +435 372 1.11111111111111e-01 +435 273 -9.72222222222223e-02 +435 440 1.39828198932740e-17 +435 383 8.59153988729509e-17 +435 368 4.16666666666667e-02 +435 254 8.33333333333334e-02 +435 439 -1.66666666666667e-01 +435 382 -3.46521178721734e-18 +435 367 -4.16666666666667e-02 +435 253 1.43317974675428e-18 +435 438 -1.94444444444444e-01 +435 381 -2.22222222222222e-01 +435 366 -6.94444444444444e-02 +435 252 -9.72222222222223e-02 +435 425 1.42843636224965e-17 +435 458 -4.85722573273506e-17 +435 437 -1.24900090270330e-16 +435 359 7.37342180584868e-17 +435 344 -4.16666666666667e-02 +435 434 -1.08623505155891e-17 +435 365 -3.61507309141031e-17 +435 251 -8.33333333333333e-02 +435 424 1.66666666666667e-01 +435 457 9.80694746331029e-18 +435 436 1.38777878078145e-17 +435 358 -3.05101267600999e-18 +435 343 4.16666666666667e-02 +435 433 -2.50721752387273e-18 +435 364 -6.93889390390723e-18 +435 250 3.78115507654320e-18 +435 423 -1.94444444444444e-01 +435 456 2.22222222222222e-01 +435 377 -4.16666666666667e-02 +435 357 -2.22222222222222e-01 +435 342 -6.94444444444444e-02 +435 432 -2.77777777777778e-02 +435 363 1.11111111111111e-01 +435 249 -9.72222222222222e-02 +436 436 1.11111111111111e+00 +436 278 -2.58853268680914e-18 +436 376 -6.94444444444444e-02 +436 277 -1.38888888888889e-02 +436 375 -4.16666666666667e-02 +436 276 1.61275073157219e-18 +436 353 -4.16666666666667e-02 +436 446 -1.66666666666667e-01 +436 374 1.64781789558852e-17 +436 275 9.48676900924816e-18 +436 352 -6.94444444444444e-02 +436 445 -1.94444444444444e-01 +436 373 1.11111111111111e-01 +436 274 -1.38888888888889e-02 +436 351 4.16666666666667e-02 +436 444 -3.26954717640160e-18 +436 372 0.00000000000000e+00 +436 273 2.75793927626000e-18 +436 440 3.61327314639739e-17 +436 383 6.93889390390723e-18 +436 368 4.16666666666667e-02 +436 254 -4.54687286086108e-18 +436 439 -1.94444444444444e-01 +436 382 1.11111111111111e-01 +436 367 -6.94444444444444e-02 +436 253 -1.38888888888889e-02 +436 438 -1.66666666666667e-01 +436 381 -5.71916645986104e-18 +436 366 -4.16666666666667e-02 +436 252 1.40946282423116e-18 +436 425 -2.61767062019469e-17 +436 458 3.50332826984379e-18 +436 437 5.55111512312578e-17 +436 359 1.38777878078145e-17 +436 344 4.16666666666667e-02 +436 434 1.66666666666667e-01 +436 365 1.74135150878907e-17 +436 251 4.54009659728305e-18 +436 424 -1.94444444444444e-01 +436 457 -4.44444444444445e-01 +436 377 -4.16666666666667e-02 +436 358 1.11111111111111e-01 +436 343 -6.94444444444444e-02 +436 433 -1.94444444444444e-01 +436 364 1.11111111111111e-01 +436 250 -1.38888888888889e-02 +436 423 1.66666666666667e-01 +436 456 1.83848501201546e-18 +436 435 1.38777878078145e-17 +436 357 -3.01480201751487e-18 +436 342 4.16666666666667e-02 +436 432 -3.70492211129031e-18 +436 363 0.00000000000000e+00 +436 249 3.92515067757643e-18 +437 437 1.11111111111111e+00 +437 278 -9.72222222222221e-02 +437 376 -4.16666666666666e-02 +437 277 -2.20228566286118e-18 +437 375 -4.16666666666667e-02 +437 276 -8.33333333333333e-02 +437 353 -6.94444444444444e-02 +437 446 -1.94444444444444e-01 +437 374 -2.22222222222222e-01 +437 275 -9.72222222222223e-02 +437 352 -4.16666666666667e-02 +437 445 -1.66666666666667e-01 +437 373 1.74137268461275e-17 +437 274 7.28448334638698e-18 +437 351 4.16666666666667e-02 +437 444 -9.99160064581173e-18 +437 372 -3.62049410227274e-17 +437 273 8.33333333333334e-02 +437 440 -2.77777777777778e-02 +437 383 1.11111111111111e-01 +437 368 -6.94444444444445e-02 +437 254 -9.72222222222223e-02 +437 439 3.69712940817557e-17 +437 382 6.93889390390723e-18 +437 367 4.16666666666667e-02 +437 253 -4.02510056535244e-18 +437 438 1.50026475617682e-17 +437 381 8.71698546678346e-17 +437 366 4.16666666666667e-02 +437 252 8.33333333333334e-02 +437 425 -2.77777777777778e-02 +437 458 2.22222222222222e-01 +437 377 -6.94444444444444e-02 +437 359 1.11111111111111e-01 +437 344 -6.94444444444444e-02 +437 434 -1.94444444444444e-01 +437 365 -2.22222222222222e-01 +437 251 -9.72222222222222e-02 +437 424 -3.03712133567502e-17 +437 457 -2.87991202066462e-20 +437 436 5.55111512312578e-17 +437 358 1.38777878078145e-17 +437 343 4.16666666666667e-02 +437 433 1.66666666666667e-01 +437 364 1.93513147129717e-17 +437 250 4.18773089122526e-18 +437 423 1.39523267071728e-17 +437 456 -4.16333634234434e-17 +437 435 -1.24900090270330e-16 +437 357 6.86729844404056e-17 +437 342 -4.16666666666667e-02 +437 432 -1.00830802041152e-17 +437 363 -3.52281002763064e-17 +437 249 -8.33333333333333e-02 +438 438 1.11111111111111e+00 +438 290 -6.61363325216158e-18 +438 379 4.16666666666667e-02 +438 289 -5.42101086242752e-19 +438 378 -6.94444444444444e-02 +438 288 -1.38888888888889e-02 +438 446 1.66666666666667e-01 +438 377 -1.53143556863578e-17 +438 278 -6.61363325216158e-18 +438 374 4.16666666666667e-02 +438 445 3.14418630020796e-18 +438 376 -1.38777878078145e-17 +438 277 -8.67361737988404e-19 +438 373 -4.16666666666667e-02 +438 444 -1.94444444444445e-01 +438 375 1.11111111111111e-01 +438 276 -1.38888888888889e-02 +438 372 -6.94444444444444e-02 +438 443 1.21430643318376e-17 +438 386 -2.77555756156289e-17 +438 371 -4.16666666666667e-02 +438 266 -6.08508469307489e-18 +438 442 1.66666666666667e-01 +438 385 5.27193306371077e-18 +438 370 4.16666666666667e-02 +438 265 -1.40946282423116e-18 +438 441 -1.94444444444444e-01 +438 384 1.11111111111111e-01 +438 369 -6.94444444444444e-02 +438 264 -1.38888888888889e-02 +438 458 8.03800385626441e-17 +438 440 -1.80411241501588e-16 +438 383 -2.77555756156289e-17 +438 437 1.50568576703924e-17 +438 434 -1.66666666666667e-01 +438 368 -1.17178537923160e-17 +438 254 -2.64274279543342e-18 +438 365 -4.16666666666667e-02 +438 457 -5.74627151417317e-18 +438 439 4.16333634234434e-17 +438 382 1.89227160416611e-18 +438 436 -1.66666666666667e-01 +438 433 3.99799551104030e-18 +438 367 -1.38777878078145e-17 +438 253 -9.08019319456610e-19 +438 364 -4.16666666666667e-02 +438 456 -4.44444444444445e-01 +438 380 4.16666666666667e-02 +438 381 1.11111111111111e-01 +438 435 -1.94444444444444e-01 +438 432 -1.94444444444444e-01 +438 366 1.11111111111111e-01 +438 252 -1.38888888888889e-02 +438 363 -6.94444444444444e-02 +439 439 1.11111111111111e+00 +439 290 -8.33333333333334e-02 +439 379 -6.94444444444444e-02 +439 289 -9.72222222222223e-02 +439 378 4.16666666666667e-02 +439 288 -8.94466792300541e-19 +439 446 -6.66784336078585e-18 +439 377 1.38777878078145e-17 +439 278 8.33333333333333e-02 +439 374 4.16666666666667e-02 +439 445 -2.77777777777778e-02 +439 376 1.11111111111111e-01 +439 277 -9.72222222222223e-02 +439 373 -6.94444444444445e-02 +439 444 1.71608875113721e-18 +439 375 -6.93889390390723e-18 +439 276 -9.75781955236954e-19 +439 372 -4.16666666666667e-02 +439 443 -1.76115090393114e-17 +439 386 -1.79977560632594e-17 +439 371 4.16666666666667e-02 +439 266 8.33333333333334e-02 +439 442 -1.94444444444444e-01 +439 385 -2.22222222222222e-01 +439 370 -6.94444444444444e-02 +439 265 -9.72222222222223e-02 +439 441 1.66666666666667e-01 +439 384 1.07911997480198e-18 +439 369 4.16666666666667e-02 +439 264 -2.30392961653170e-19 +439 458 -6.93889390390723e-18 +439 440 9.71445146547012e-17 +439 383 -2.67797936603920e-17 +439 437 3.69170839731314e-17 +439 434 -8.28906442183058e-18 +439 368 1.38913403349705e-17 +439 254 -8.33333333333334e-02 +439 365 -4.16666666666666e-02 +439 457 2.22222222222222e-01 +439 380 -4.16666666666667e-02 +439 382 -2.22222222222222e-01 +439 436 -1.94444444444444e-01 +439 433 -2.77777777777778e-02 +439 367 1.11111111111111e-01 +439 253 -9.72222222222223e-02 +439 364 -6.94444444444444e-02 +439 456 -9.44695846072721e-18 +439 438 4.16333634234434e-17 +439 381 5.27193306371077e-18 +439 435 -1.66666666666667e-01 +439 432 2.04304346877737e-18 +439 366 -6.93889390390723e-18 +439 252 -5.42101086242752e-19 +439 363 -4.16666666666667e-02 +440 440 1.11111111111111e+00 +440 290 -9.72222222222222e-02 +440 379 -4.16666666666667e-02 +440 289 -8.33333333333334e-02 +440 378 4.16666666666667e-02 +440 288 -2.64274279543342e-18 +440 446 -1.94444444444444e-01 +440 377 -2.22222222222222e-01 +440 278 -9.72222222222222e-02 +440 374 -6.94444444444445e-02 +440 445 -6.25449128252575e-18 +440 376 1.42166009867162e-17 +440 277 8.33333333333334e-02 +440 373 4.16666666666667e-02 +440 444 1.66666666666667e-01 +440 375 -8.30092288309214e-18 +440 276 -2.62919026827735e-18 +440 372 4.16666666666667e-02 +440 443 -2.77777777777778e-02 +440 386 1.11111111111111e-01 +440 371 -6.94444444444444e-02 +440 266 -9.72222222222223e-02 +440 442 -1.68593437821496e-17 +440 385 -1.99493199737333e-17 +440 370 4.16666666666667e-02 +440 265 8.33333333333333e-02 +440 441 1.05116788754259e-17 +440 384 -2.08166817117217e-17 +440 369 -4.16666666666667e-02 +440 264 -6.61363325216158e-18 +440 458 2.22222222222222e-01 +440 380 -6.94444444444445e-02 +440 383 1.11111111111111e-01 +440 437 -2.77777777777778e-02 +440 434 -1.94444444444444e-01 +440 368 -2.22222222222222e-01 +440 254 -9.72222222222222e-02 +440 365 -6.94444444444444e-02 +440 457 -6.93889390390723e-18 +440 439 9.71445146547012e-17 +440 382 -2.71050543121376e-17 +440 436 3.53602374160780e-17 +440 433 -7.87401827767598e-18 +440 367 1.48535697630514e-17 +440 253 -8.33333333333334e-02 +440 364 -4.16666666666667e-02 +440 456 8.04945997687602e-17 +440 438 -1.80411241501588e-16 +440 381 -2.08166817117217e-17 +440 435 1.35897966057480e-17 +440 432 -1.66666666666667e-01 +440 366 -1.53143556863578e-17 +440 252 -6.61363325216158e-18 +440 363 -4.16666666666667e-02 +441 441 1.11111111111111e+00 +441 353 4.16666666666667e-02 +441 286 2.71050543121376e-18 +441 352 -4.16666666666667e-02 +441 285 -9.72222222222222e-02 +441 351 -6.94444444444444e-02 +441 380 5.09575021068187e-18 +441 290 -8.33333333333333e-02 +441 377 -4.16666666666667e-02 +441 446 -1.09639944692597e-17 +441 379 0.00000000000000e+00 +441 289 1.28749007982654e-18 +441 376 4.16666666666667e-02 +441 445 -2.81214938488428e-18 +441 378 1.11111111111111e-01 +441 288 -9.72222222222223e-02 +441 375 -6.94444444444444e-02 +441 444 -2.77777777777778e-02 +441 362 -1.02999206386123e-17 +441 425 1.96105067948316e-17 +441 263 -8.33333333333334e-02 +441 344 -4.16666666666667e-02 +441 361 -6.24771501894772e-18 +441 424 -1.66666666666667e-01 +441 262 3.25260651745651e-18 +441 343 -4.16666666666667e-02 +441 360 -2.22222222222222e-01 +441 423 -1.94444444444444e-01 +441 261 -9.72222222222223e-02 +441 342 -6.94444444444444e-02 +441 443 -1.38777878078145e-17 +441 386 -2.01932654625425e-18 +441 440 1.09470538103146e-17 +441 458 -4.85722573273506e-17 +441 371 8.38901430960659e-18 +441 266 8.33333333333334e-02 +441 368 4.16666666666667e-02 +441 434 -9.70530350963977e-18 +441 442 4.16333634234434e-17 +441 385 -4.77726582251425e-18 +441 439 1.66666666666667e-01 +441 457 7.09707730680697e-18 +441 370 6.93889390390723e-18 +441 265 6.09863722023096e-19 +441 367 4.16666666666667e-02 +441 433 -2.10233577508517e-18 +441 287 8.33333333333334e-02 +441 384 -2.22222222222222e-01 +441 438 -1.94444444444444e-01 +441 456 2.22222222222222e-01 +441 369 1.11111111111111e-01 +441 264 -9.72222222222223e-02 +441 366 -6.94444444444444e-02 +441 432 -2.77777777777778e-02 +442 442 1.11111111111111e+00 +442 353 4.16666666666667e-02 +442 286 -1.38888888888889e-02 +442 352 -6.94444444444444e-02 +442 285 1.73472347597681e-18 +442 351 -4.16666666666667e-02 +442 380 -2.53974358904729e-17 +442 290 -7.04731412115578e-18 +442 377 4.16666666666667e-02 +442 446 1.66666666666667e-01 +442 379 1.11111111111111e-01 +442 289 -1.38888888888889e-02 +442 376 -6.94444444444444e-02 +442 445 -1.94444444444444e-01 +442 378 0.00000000000000e+00 +442 288 2.05998412772246e-18 +442 375 4.16666666666667e-02 +442 444 -2.49366499671666e-18 +442 362 6.93889390390723e-18 +442 425 2.15349656509933e-17 +442 263 -8.30769914667018e-18 +442 344 -4.16666666666667e-02 +442 361 1.11111111111111e-01 +442 424 -1.94444444444444e-01 +442 262 -1.38888888888889e-02 +442 343 -6.94444444444444e-02 +442 360 -8.05358926249389e-18 +442 423 -1.66666666666667e-01 +442 261 2.16840434497101e-18 +442 342 -4.16666666666667e-02 +442 443 -2.77555756156289e-17 +442 386 -6.93889390390723e-18 +442 440 -1.67102659834328e-17 +442 458 1.22768955375038e-17 +442 371 -2.45368504160626e-17 +442 266 -1.61275073157219e-18 +442 368 -4.16666666666667e-02 +442 434 -1.66666666666667e-01 +442 287 -4.77048955893622e-18 +442 385 1.11111111111111e-01 +442 439 -1.94444444444444e-01 +442 457 -4.44444444444444e-01 +442 370 1.11111111111111e-01 +442 265 -1.38888888888889e-02 +442 367 -6.94444444444444e-02 +442 433 -1.94444444444444e-01 +442 441 4.16333634234434e-17 +442 384 -5.31259064517897e-18 +442 438 1.66666666666667e-01 +442 456 9.91536768055884e-18 +442 369 6.93889390390723e-18 +442 264 1.95156391047391e-18 +442 366 4.16666666666667e-02 +442 432 -3.37457926186113e-18 +443 443 1.11111111111111e+00 +443 353 -6.94444444444445e-02 +443 286 -6.51876556206910e-18 +443 352 4.16666666666667e-02 +443 285 8.33333333333334e-02 +443 351 4.16666666666667e-02 +443 380 -2.22222222222222e-01 +443 290 -9.72222222222222e-02 +443 377 -6.94444444444444e-02 +443 446 -1.94444444444445e-01 +443 379 -2.43725260242952e-17 +443 289 -7.91467585914418e-18 +443 376 4.16666666666667e-02 +443 445 1.66666666666667e-01 +443 378 8.38901430960659e-18 +443 288 -8.33333333333334e-02 +443 375 -4.16666666666667e-02 +443 444 -1.10656384229302e-17 +443 384 -1.62630325872826e-18 +443 362 1.11111111111111e-01 +443 425 -2.77777777777778e-02 +443 263 -9.72222222222222e-02 +443 344 -6.94444444444444e-02 +443 361 0.00000000000000e+00 +443 424 2.27377524360944e-17 +443 262 -9.32413868337534e-18 +443 343 -4.16666666666667e-02 +443 360 -7.46744246299391e-18 +443 423 1.92801639454024e-17 +443 261 -8.33333333333334e-02 +443 342 -4.16666666666667e-02 +443 287 -9.72222222222222e-02 +443 386 1.11111111111111e-01 +443 440 -2.77777777777778e-02 +443 458 2.22222222222222e-01 +443 371 -2.22222222222222e-01 +443 266 -9.72222222222222e-02 +443 368 -6.94444444444445e-02 +443 434 -1.94444444444444e-01 +443 442 -2.77555756156289e-17 +443 385 -6.93889390390723e-18 +443 439 -1.75030888220629e-17 +443 457 1.22180267476697e-17 +443 370 -2.54109884176290e-17 +443 265 -2.49366499671666e-18 +443 367 -4.16666666666667e-02 +443 433 -1.66666666666667e-01 +443 441 -1.38777878078145e-17 +443 438 1.20888542232134e-17 +443 456 -2.77555756156289e-17 +443 369 5.20417042793042e-18 +443 264 8.33333333333334e-02 +443 366 4.16666666666667e-02 +443 432 -1.00017650411788e-17 +444 444 1.11111111111111e+00 +444 362 -4.16666666666667e-02 +444 286 8.33333333333333e-02 +444 361 4.16666666666667e-02 +444 285 -9.72222222222223e-02 +444 360 -6.94444444444444e-02 +444 380 -6.93889390390723e-18 +444 290 9.20216593897072e-18 +444 443 -1.08352454612770e-17 +444 386 4.16666666666667e-02 +444 379 5.09575021068187e-18 +444 289 -8.33333333333334e-02 +444 442 -2.50721752387273e-18 +444 385 -4.16666666666667e-02 +444 378 1.11111111111111e-01 +444 288 -9.72222222222222e-02 +444 441 -2.77777777777778e-02 +444 384 -6.94444444444444e-02 +444 377 4.16807972684896e-17 +444 278 6.57297567069337e-18 +444 440 1.66666666666667e-01 +444 383 4.16666666666667e-02 +444 376 -3.75405002223106e-18 +444 277 8.33333333333334e-02 +444 439 1.71778281703172e-18 +444 382 4.16666666666667e-02 +444 375 -2.22222222222222e-01 +444 276 -9.72222222222222e-02 +444 438 -1.94444444444445e-01 +444 381 -6.94444444444444e-02 +444 353 2.63325602642417e-17 +444 446 -5.55111512312578e-17 +444 374 -6.93889390390723e-18 +444 275 7.37257477290143e-18 +444 425 -1.66666666666667e-01 +444 458 -2.77634106703910e-17 +444 437 -9.69175098248370e-18 +444 359 -4.16666666666667e-02 +444 352 -5.96311194867027e-18 +444 445 4.16333634234434e-17 +444 373 4.91956735765298e-18 +444 274 -8.33333333333334e-02 +444 424 7.03376159399971e-18 +444 457 0.00000000000000e+00 +444 436 -1.88549534058807e-18 +444 358 -4.16666666666667e-02 +444 351 -2.22222222222222e-01 +444 287 6.17995238316738e-18 +444 372 1.11111111111111e-01 +444 273 -9.72222222222222e-02 +444 423 -1.94444444444444e-01 +444 456 2.22222222222222e-01 +444 435 -2.77777777777778e-02 +444 357 -6.94444444444444e-02 +445 445 1.11111111111111e+00 +445 362 4.16666666666667e-02 +445 286 -9.72222222222222e-02 +445 361 -6.94444444444444e-02 +445 285 8.33333333333334e-02 +445 360 4.16666666666667e-02 +445 380 6.85249654328729e-18 +445 290 1.89870905456524e-17 +445 443 1.66666666666667e-01 +445 386 4.16666666666667e-02 +445 379 -2.22222222222222e-01 +445 289 -9.72222222222222e-02 +445 442 -1.94444444444445e-01 +445 385 -6.94444444444444e-02 +445 378 -2.01932654625425e-18 +445 288 -8.33333333333334e-02 +445 441 -3.69306365002875e-18 +445 384 -4.16666666666667e-02 +445 377 0.00000000000000e+00 +445 278 -7.69783542464708e-18 +445 440 -6.14607106527720e-18 +445 383 -4.16666666666667e-02 +445 376 1.11111111111111e-01 +445 277 -9.72222222222222e-02 +445 439 -2.77777777777778e-02 +445 382 -6.94444444444444e-02 +445 375 -5.09575021068187e-18 +445 276 8.33333333333333e-02 +445 438 3.14418630020796e-18 +445 381 4.16666666666667e-02 +445 353 1.38777878078145e-17 +445 446 -1.38777878078145e-17 +445 374 -1.11130722679764e-18 +445 275 8.89045781438114e-18 +445 425 -2.89007641603167e-18 +445 458 -7.04202016523544e-18 +445 437 -1.66666666666667e-01 +445 359 -4.16666666666667e-02 +445 352 1.11111111111111e-01 +445 287 -1.17229359899995e-17 +445 373 -2.22222222222222e-01 +445 274 -9.72222222222223e-02 +445 424 -2.77777777777778e-02 +445 457 2.22222222222222e-01 +445 436 -1.94444444444444e-01 +445 358 -6.94444444444444e-02 +445 351 -5.84113920426566e-18 +445 444 4.16333634234434e-17 +445 372 5.20417042793042e-18 +445 273 -8.33333333333334e-02 +445 423 6.22908029410812e-18 +445 456 6.93889390390723e-18 +445 435 -2.94089839286693e-18 +445 357 -4.16666666666667e-02 +446 446 1.11111111111111e+00 +446 362 -6.94444444444444e-02 +446 286 -1.17093834628434e-17 +446 361 4.16666666666667e-02 +446 285 4.87890977618477e-18 +446 360 -4.16666666666667e-02 +446 380 1.11111111111111e-01 +446 290 -1.38888888888889e-02 +446 443 -1.94444444444445e-01 +446 386 -6.94444444444445e-02 +446 379 6.69494841509799e-18 +446 289 1.99493199737333e-17 +446 442 1.66666666666667e-01 +446 385 4.16666666666667e-02 +446 378 -6.93889390390723e-18 +446 288 1.04083408558608e-17 +446 441 -1.00830802041152e-17 +446 384 4.16666666666667e-02 +446 377 1.11111111111111e-01 +446 278 -1.38888888888889e-02 +446 440 -1.94444444444444e-01 +446 383 -6.94444444444445e-02 +446 376 0.00000000000000e+00 +446 277 -7.60296773455460e-18 +446 439 -6.51876556206910e-18 +446 382 -4.16666666666667e-02 +446 375 4.19992816566572e-17 +446 276 6.83047368665868e-18 +446 438 1.66666666666667e-01 +446 381 4.16666666666667e-02 +446 353 1.11111111111111e-01 +446 287 -1.38888888888889e-02 +446 374 1.11111111111111e-01 +446 275 -1.38888888888889e-02 +446 425 -1.94444444444444e-01 +446 458 -4.44444444444445e-01 +446 437 -1.94444444444444e-01 +446 359 -6.94444444444444e-02 +446 352 6.93889390390723e-18 +446 445 -1.38777878078145e-17 +446 373 -1.98544522836408e-18 +446 274 1.07742590890747e-17 +446 424 -3.40168431617327e-18 +446 457 -1.21193474093145e-17 +446 436 -1.66666666666667e-01 +446 358 -4.16666666666667e-02 +446 351 2.62749620238284e-17 +446 444 -5.55111512312578e-17 +446 372 -6.93889390390723e-18 +446 273 6.93889390390723e-18 +446 423 -1.66666666666667e-01 +446 456 -3.00256239142704e-17 +446 435 -9.98821251402271e-18 +446 357 -4.16666666666667e-02 +447 447 2.22222222222222e+00 +447 308 7.81980816905170e-18 +447 281 -4.16666666666667e-02 +447 307 1.47722546001150e-18 +447 280 -4.16666666666667e-02 +447 306 -2.77777777777777e-02 +447 279 -6.94444444444445e-02 +447 305 -1.66666666666667e-01 +447 269 -4.16666666666667e-02 +447 304 -1.77639749698172e-17 +447 268 4.16666666666667e-02 +447 303 -1.94444444444445e-01 +447 267 -6.94444444444445e-02 +447 401 1.40268656065312e-17 +447 302 7.81980816905170e-18 +447 400 2.08166817117217e-17 +447 301 3.28140563766316e-18 +447 399 2.22222222222222e-01 +447 300 -2.77777777777777e-02 +447 398 2.77555756156289e-17 +447 314 -2.24497612340280e-17 +447 299 8.20266706121064e-18 +447 257 4.16666666666667e-02 +447 397 1.53753420585601e-17 +447 313 -1.66666666666667e-01 +447 298 1.04354459101730e-18 +447 256 -4.16666666666667e-02 +447 396 2.22222222222222e-01 +447 312 -1.94444444444445e-01 +447 297 -2.77777777777778e-02 +447 255 -6.94444444444445e-02 +447 395 -1.27093693845482e-16 +447 311 -2.62580213648833e-17 +447 296 1.66666666666667e-01 +447 245 4.16666666666667e-02 +447 394 -6.44473488247907e-17 +447 310 1.66666666666667e-01 +447 295 -1.89565973595512e-17 +447 244 4.16666666666667e-02 +447 393 -4.44444444444445e-01 +447 309 -1.94444444444444e-01 +447 294 -1.94444444444445e-01 +447 243 -6.94444444444444e-02 +447 449 1.11022302462516e-16 +447 392 2.77555756156289e-17 +447 389 2.26871422174960e-17 +447 293 1.16060454432784e-17 +447 448 2.77555756156289e-17 +447 391 1.39823963768004e-17 +447 388 6.93889390390723e-18 +447 292 3.44742409532500e-18 +447 390 2.22222222222222e-01 +447 387 2.22222222222222e-01 +447 291 -2.77777777777777e-02 +447 58 4.16666666666667e-02 +447 57 -6.94444444444445e-02 +447 158 1.66666666666667e-01 +447 44 4.16666666666667e-02 +447 157 -8.67361737988404e-19 +447 43 -4.16666666666667e-02 +447 156 -1.94444444444445e-01 +447 42 -6.94444444444445e-02 +447 167 -6.61363325216158e-18 +447 29 -4.16666666666667e-02 +447 166 1.66666666666667e-01 +447 28 4.16666666666667e-02 +447 165 -1.94444444444444e-01 +447 27 -6.94444444444445e-02 +447 224 -2.37643563681667e-17 +447 164 -1.73472347597681e-18 +447 149 -1.66666666666667e-01 +447 14 -4.16666666666667e-02 +447 223 -2.03287907341032e-19 +447 163 -1.66666666666667e-01 +447 148 2.03287907341032e-19 +447 13 -4.16666666666667e-02 +447 222 -4.44444444444445e-01 +447 59 4.16666666666667e-02 +447 162 -1.94444444444444e-01 +447 147 -1.94444444444445e-01 +447 12 -6.94444444444445e-02 +448 448 2.22222222222222e+00 +448 308 -1.66666666666667e-01 +448 281 -4.16666666666667e-02 +448 307 -1.94444444444444e-01 +448 280 -6.94444444444445e-02 +448 306 3.67951112287268e-18 +448 279 -4.16666666666667e-02 +448 305 -4.46149193977785e-17 +448 269 4.16666666666667e-02 +448 304 -2.77777777777778e-02 +448 268 -6.94444444444444e-02 +448 303 -1.72659195968317e-17 +448 267 4.16666666666667e-02 +448 401 2.69017664047966e-17 +448 302 1.66666666666667e-01 +448 400 2.22222222222222e-01 +448 301 -1.94444444444444e-01 +448 399 1.38777878078145e-17 +448 300 1.13841228110978e-18 +448 398 -1.03307102862450e-16 +448 314 -1.19939865331209e-18 +448 299 1.66666666666667e-01 +448 257 4.16666666666667e-02 +448 397 -4.44444444444444e-01 +448 313 -1.94444444444444e-01 +448 298 -1.94444444444444e-01 +448 256 -6.94444444444444e-02 +448 396 1.73995390442610e-17 +448 312 -1.66666666666667e-01 +448 297 3.26954717640160e-18 +448 255 -4.16666666666667e-02 +448 395 -7.63278329429795e-17 +448 311 8.02445132910834e-17 +448 296 2.21075599233372e-18 +448 245 -4.16666666666666e-02 +448 394 2.22222222222222e-01 +448 310 -1.94444444444444e-01 +448 295 -2.77777777777777e-02 +448 244 -6.94444444444444e-02 +448 393 -6.26618033719786e-17 +448 309 1.66666666666667e-01 +448 390 1.87346747273706e-17 +448 294 -1.74014448683923e-17 +448 243 4.16666666666667e-02 +448 449 2.63677968348475e-16 +448 392 -1.12812930113011e-16 +448 389 4.19222016584571e-17 +448 293 -1.66666666666667e-01 +448 391 -4.44444444444444e-01 +448 388 2.22222222222222e-01 +448 292 -1.94444444444444e-01 +448 447 2.77555756156289e-17 +448 387 2.77555756156289e-17 +448 291 1.46367293285543e-18 +448 58 -6.94444444444444e-02 +448 57 4.16666666666667e-02 +448 158 -2.38253427403690e-17 +448 44 4.16666666666667e-02 +448 157 -2.77777777777778e-02 +448 43 -6.94444444444444e-02 +448 156 -3.37119113007212e-19 +448 42 -4.16666666666667e-02 +448 167 3.10911913619163e-17 +448 29 4.16666666666667e-02 +448 166 -1.94444444444444e-01 +448 28 -6.94444444444444e-02 +448 165 1.66666666666667e-01 +448 27 4.16666666666667e-02 +448 224 -6.93889390390723e-17 +448 164 1.29833210155139e-17 +448 149 -1.76843538727753e-17 +448 14 -4.16666666666667e-02 +448 223 2.22222222222222e-01 +448 59 -4.16666666666667e-02 +448 163 -1.94444444444444e-01 +448 148 -2.77777777777778e-02 +448 13 -6.94444444444444e-02 +448 222 3.04910685187867e-18 +448 162 -1.66666666666667e-01 +448 147 6.25110315073674e-19 +448 12 -4.16666666666667e-02 +449 449 2.22222222222222e+00 +449 308 -1.94444444444444e-01 +449 281 -6.94444444444445e-02 +449 307 -1.66666666666667e-01 +449 280 -4.16666666666667e-02 +449 306 8.16539761153146e-18 +449 279 -4.16666666666667e-02 +449 305 -1.94444444444444e-01 +449 269 -6.94444444444444e-02 +449 304 -4.64495927615313e-17 +449 268 4.16666666666667e-02 +449 303 -1.66666666666667e-01 +449 267 -4.16666666666667e-02 +449 401 -4.44444444444444e-01 +449 302 -1.94444444444444e-01 +449 400 4.60572047487158e-17 +449 301 1.66666666666667e-01 +449 399 2.96954928230781e-17 +449 300 8.17725607279302e-18 +449 398 2.22222222222222e-01 +449 314 -2.77777777777778e-02 +449 299 -1.94444444444444e-01 +449 257 -6.94444444444444e-02 +449 397 -1.03055110560642e-16 +449 313 -4.81114714040443e-18 +449 298 1.66666666666667e-01 +449 256 4.16666666666667e-02 +449 396 3.46944695195361e-17 +449 312 -2.16840434497101e-17 +449 297 1.12892551210053e-17 +449 255 4.16666666666667e-02 +449 395 2.22222222222222e-01 +449 311 -2.77777777777778e-02 +449 296 -1.94444444444444e-01 +449 245 -6.94444444444444e-02 +449 394 -8.32667268468867e-17 +449 310 8.01784447211976e-17 +449 295 3.68628738645072e-18 +449 244 -4.16666666666666e-02 +449 393 -1.26231626063414e-16 +449 309 -2.60615097211203e-17 +449 294 1.66666666666667e-01 +449 243 4.16666666666667e-02 +449 392 2.22222222222222e-01 +449 389 -4.44444444444444e-01 +449 293 -1.94444444444444e-01 +449 448 2.63677968348475e-16 +449 391 -1.13988188327327e-16 +449 388 3.32019974664741e-17 +449 292 -1.66666666666667e-01 +449 447 9.71445146547012e-17 +449 390 2.08166817117217e-17 +449 387 1.13417711637351e-17 +449 291 1.14925430283463e-17 +449 58 -4.16666666666666e-02 +449 57 4.16666666666667e-02 +449 158 -1.94444444444444e-01 +449 44 -6.94444444444445e-02 +449 157 -2.09810061034890e-17 +449 43 4.16666666666667e-02 +449 156 1.66666666666667e-01 +449 42 4.16666666666667e-02 +449 167 -2.77777777777778e-02 +449 29 -6.94444444444444e-02 +449 166 3.18213337624496e-17 +449 28 4.16666666666667e-02 +449 165 -6.48827237596794e-18 +449 27 -4.16666666666667e-02 +449 224 2.22222222222222e-01 +449 59 -6.94444444444445e-02 +449 164 -2.77777777777778e-02 +449 149 -1.94444444444444e-01 +449 14 -6.94444444444444e-02 +449 223 -6.24500451351651e-17 +449 163 1.50449992091309e-17 +449 148 -1.88922228555599e-17 +449 13 -4.16666666666667e-02 +449 222 -2.62563272989888e-17 +449 162 -3.11199904821230e-18 +449 147 -1.66666666666667e-01 +449 12 -4.16666666666667e-02 +450 450 2.22222222222222e+00 +450 280 4.16666666666667e-02 +450 279 -6.94444444444444e-02 +450 332 4.05220561966457e-18 +450 284 -4.16666666666667e-02 +450 331 -6.77626357803440e-19 +450 283 -4.16666666666667e-02 +450 330 -2.77777777777778e-02 +450 282 -6.94444444444444e-02 +450 329 -1.66666666666667e-01 +450 272 -4.16666666666667e-02 +450 328 8.05528332838840e-18 +450 271 4.16666666666667e-02 +450 327 -1.94444444444444e-01 +450 270 -6.94444444444444e-02 +450 305 1.66666666666667e-01 +450 416 4.08507049801804e-17 +450 326 4.06575814682064e-18 +450 269 4.16666666666667e-02 +450 304 -1.57615890825080e-17 +450 415 -2.08166817117217e-17 +450 325 1.93801138331784e-18 +450 268 -4.16666666666667e-02 +450 303 -1.94444444444444e-01 +450 414 2.22222222222222e-01 +450 324 -2.77777777777778e-02 +450 267 -6.94444444444444e-02 +450 314 -2.68475562961723e-17 +450 257 -4.16666666666667e-02 +450 313 1.66666666666667e-01 +450 256 4.16666666666667e-02 +450 312 -1.94444444444444e-01 +450 255 -6.94444444444444e-02 +450 413 6.93889390390723e-18 +450 338 1.85601859402362e-17 +450 323 1.74997006902738e-18 +450 260 4.16666666666667e-02 +450 412 3.45945196317601e-17 +450 337 -1.66666666666667e-01 +450 322 1.73472347597681e-18 +450 259 -4.16666666666667e-02 +450 411 2.22222222222222e-01 +450 336 -1.94444444444444e-01 +450 321 -2.77777777777779e-02 +450 258 -6.94444444444444e-02 +450 410 -2.58256110453100e-17 +450 335 1.40183952770587e-17 +450 320 1.66666666666667e-01 +450 248 4.16666666666667e-02 +450 409 3.30971771392513e-17 +450 334 1.66666666666667e-01 +450 319 7.18622752450548e-18 +450 247 4.16666666666667e-02 +450 408 -4.44444444444445e-01 +450 333 -1.94444444444445e-01 +450 318 -1.94444444444444e-01 +450 246 -6.94444444444445e-02 +450 395 -1.39887491239048e-16 +450 452 1.38777878078145e-16 +450 407 1.38777878078145e-17 +450 311 -2.39879730662418e-17 +450 296 -1.66666666666667e-01 +450 404 3.68563093591659e-17 +450 317 1.94139951510686e-18 +450 245 -4.16666666666667e-02 +450 394 -1.78227590563566e-16 +450 451 1.52655665885959e-16 +450 406 3.94255720464250e-17 +450 310 -1.66666666666667e-01 +450 295 -1.53008031592017e-17 +450 403 -2.08166817117217e-17 +450 316 2.08878324792910e-18 +450 244 -4.16666666666667e-02 +450 393 -4.44444444444444e-01 +450 281 4.16666666666667e-02 +450 405 2.22222222222222e-01 +450 309 -1.94444444444444e-01 +450 294 -1.94444444444444e-01 +450 402 2.22222222222222e-01 +450 315 -2.77777777777778e-02 +450 243 -6.94444444444444e-02 +451 451 2.22222222222222e+00 +451 280 -6.94444444444444e-02 +451 279 4.16666666666667e-02 +451 332 -1.66666666666667e-01 +451 284 -4.16666666666667e-02 +451 331 -1.94444444444445e-01 +451 283 -6.94444444444444e-02 +451 330 1.11300129269215e-18 +451 282 -4.16666666666667e-02 +451 329 4.35036121709809e-18 +451 272 4.16666666666667e-02 +451 328 -2.77777777777778e-02 +451 271 -6.94444444444444e-02 +451 327 8.66006485272797e-18 +451 270 4.16666666666667e-02 +451 305 5.53349683782289e-17 +451 416 -3.03458023683326e-17 +451 326 1.66666666666667e-01 +451 269 4.16666666666667e-02 +451 304 -2.77777777777776e-02 +451 415 2.22222222222222e-01 +451 325 -1.94444444444445e-01 +451 268 -6.94444444444445e-02 +451 303 -1.70490791623346e-17 +451 414 -1.38777878078145e-17 +451 324 1.93801138331784e-18 +451 267 -4.16666666666667e-02 +451 314 3.71847463844638e-17 +451 257 4.16666666666667e-02 +451 313 -1.94444444444444e-01 +451 256 -6.94444444444444e-02 +451 312 1.66666666666667e-01 +451 255 4.16666666666667e-02 +451 413 4.79865340443242e-17 +451 338 1.53346844770919e-17 +451 323 1.66666666666667e-01 +451 260 4.16666666666667e-02 +451 412 -4.44444444444445e-01 +451 337 -1.94444444444444e-01 +451 322 -1.94444444444445e-01 +451 259 -6.94444444444444e-02 +451 411 4.37350639238181e-17 +451 336 -1.66666666666667e-01 +451 321 1.05879118406788e-18 +451 258 -4.16666666666667e-02 +451 410 -5.55111512312578e-17 +451 335 1.16822784085313e-17 +451 320 -1.96223652560931e-17 +451 248 -4.16666666666667e-02 +451 409 2.22222222222222e-01 +451 334 -1.94444444444444e-01 +451 319 -2.77777777777778e-02 +451 247 -6.94444444444445e-02 +451 408 2.84332019734324e-17 +451 333 1.66666666666667e-01 +451 318 8.56519716263549e-18 +451 246 4.16666666666667e-02 +451 395 2.08166817117217e-17 +451 452 -8.32667268468867e-17 +451 407 3.89381045852802e-17 +451 311 -5.69070615283329e-17 +451 296 -4.83164533772798e-17 +451 404 -3.20697261742319e-17 +451 317 -1.66666666666667e-01 +451 245 -4.16666666666668e-02 +451 394 2.22222222222223e-01 +451 281 -4.16666666666667e-02 +451 406 -4.44444444444445e-01 +451 310 -1.94444444444445e-01 +451 295 -2.77777777777777e-02 +451 403 2.22222222222222e-01 +451 316 -1.94444444444445e-01 +451 244 -6.94444444444445e-02 +451 393 -1.82368311126219e-16 +451 450 1.80411241501588e-16 +451 405 3.49079218222442e-17 +451 309 -1.66666666666667e-01 +451 294 -1.56006528225297e-17 +451 402 -6.93889390390723e-18 +451 315 -1.42301535138722e-18 +451 243 -4.16666666666667e-02 +452 452 2.22222222222222e+00 +452 280 -4.16666666666667e-02 +452 279 4.16666666666667e-02 +452 332 -1.94444444444445e-01 +452 284 -6.94444444444444e-02 +452 331 -1.66666666666667e-01 +452 283 -4.16666666666667e-02 +452 330 1.83297929785831e-18 +452 282 -4.16666666666667e-02 +452 329 -1.94444444444444e-01 +452 272 -6.94444444444444e-02 +452 328 -4.54009659728305e-19 +452 271 4.16666666666667e-02 +452 327 -1.66666666666667e-01 +452 270 -4.16666666666667e-02 +452 305 -1.94444444444444e-01 +452 416 -4.44444444444445e-01 +452 326 -1.94444444444445e-01 +452 269 -6.94444444444445e-02 +452 304 5.32055275488316e-17 +452 415 -3.55933832348098e-17 +452 325 1.66666666666667e-01 +452 268 4.16666666666667e-02 +452 303 1.66666666666667e-01 +452 414 3.34018972420261e-17 +452 324 1.76521666207796e-18 +452 267 4.16666666666667e-02 +452 314 -2.77777777777776e-02 +452 257 -6.94444444444445e-02 +452 313 3.41930260147616e-17 +452 256 4.16666666666667e-02 +452 312 -2.73218947466347e-17 +452 255 -4.16666666666667e-02 +452 413 2.22222222222222e-01 +452 338 -2.77777777777778e-02 +452 323 -1.94444444444445e-01 +452 260 -6.94444444444445e-02 +452 412 4.49537325766802e-17 +452 337 1.43250212039647e-17 +452 322 1.66666666666667e-01 +452 259 4.16666666666667e-02 +452 411 6.93889390390723e-18 +452 336 1.89735380184963e-17 +452 321 3.63207727782644e-18 +452 258 4.16666666666667e-02 +452 410 2.22222222222222e-01 +452 335 -2.77777777777778e-02 +452 320 -1.94444444444444e-01 +452 248 -6.94444444444445e-02 +452 409 -4.85722573273506e-17 +452 334 1.27156586041816e-17 +452 319 -1.67509235649010e-17 +452 247 -4.16666666666667e-02 +452 408 -2.12300337899818e-17 +452 333 1.34305544116642e-17 +452 318 1.66666666666667e-01 +452 246 4.16666666666667e-02 +452 395 2.22222222222223e-01 +452 281 -6.94444444444444e-02 +452 407 2.22222222222222e-01 +452 311 -2.77777777777778e-02 +452 296 -1.94444444444445e-01 +452 404 -4.44444444444445e-01 +452 317 -1.94444444444445e-01 +452 245 -6.94444444444445e-02 +452 394 2.77555756156289e-17 +452 451 -8.32667268468867e-17 +452 406 3.94753352320762e-17 +452 310 -5.59634668250916e-17 +452 295 -4.71356894488073e-17 +452 403 -2.76742604526925e-17 +452 316 -1.66666666666667e-01 +452 244 -4.16666666666668e-02 +452 393 -1.39848951239948e-16 +452 450 1.11022302462516e-16 +452 405 6.93889390390723e-18 +452 309 -2.39896671321363e-17 +452 294 -1.66666666666667e-01 +452 402 3.35187877887472e-17 +452 315 3.51010453342182e-18 +452 243 -4.16666666666667e-02 +453 453 2.22222222222222e+00 +453 283 4.16666666666667e-02 +453 282 -6.94444444444444e-02 +453 356 3.21194893598831e-18 +453 287 -4.16666666666667e-02 +453 355 -5.67850887839283e-18 +453 286 -4.16666666666667e-02 +453 354 -2.77777777777778e-02 +453 285 -6.94444444444444e-02 +453 353 -1.66666666666667e-01 +453 275 -4.16666666666667e-02 +453 352 1.71168417981149e-17 +453 274 4.16666666666667e-02 +453 351 -1.94444444444444e-01 +453 273 -6.94444444444445e-02 +453 329 1.66666666666667e-01 +453 431 -1.60021464395282e-17 +453 350 8.21283145657770e-18 +453 272 4.16666666666667e-02 +453 328 5.66495635123676e-18 +453 430 -1.38777878078145e-17 +453 349 -3.98783111567325e-18 +453 271 -4.16666666666667e-02 +453 327 -1.94444444444444e-01 +453 429 2.22222222222222e-01 +453 348 -2.77777777777778e-02 +453 270 -6.94444444444444e-02 +453 338 -3.40168431617327e-17 +453 260 -4.16666666666667e-02 +453 337 1.66666666666667e-01 +453 259 4.16666666666667e-02 +453 336 -1.94444444444445e-01 +453 258 -6.94444444444444e-02 +453 428 3.46944695195361e-17 +453 362 1.05438661274215e-17 +453 347 3.60158409172529e-18 +453 263 4.16666666666667e-02 +453 427 -5.80014280961855e-17 +453 361 -1.66666666666667e-01 +453 346 -5.55653613398821e-18 +453 262 -4.16666666666667e-02 +453 426 2.22222222222222e-01 +453 360 -1.94444444444444e-01 +453 345 -2.77777777777778e-02 +453 261 -6.94444444444444e-02 +453 425 1.94398720076072e-16 +453 359 6.19181084442894e-18 +453 344 1.66666666666667e-01 +453 251 4.16666666666667e-02 +453 424 1.71466150062109e-16 +453 358 1.66666666666667e-01 +453 343 1.69796224606597e-17 +453 250 4.16666666666667e-02 +453 423 -4.44444444444444e-01 +453 357 -1.94444444444444e-01 +453 342 -1.94444444444444e-01 +453 249 -6.94444444444444e-02 +453 410 -1.49874009687176e-16 +453 455 0.00000000000000e+00 +453 422 3.46944695195361e-17 +453 335 -3.27564581362183e-17 +453 320 -1.66666666666667e-01 +453 419 -1.40872167040231e-17 +453 341 2.80706718720075e-18 +453 248 -4.16666666666667e-02 +453 409 4.71119725262842e-17 +453 454 -2.22044604925031e-16 +453 421 -5.30642848048770e-17 +453 334 -1.66666666666667e-01 +453 319 5.66495635123676e-18 +453 418 -1.38777878078145e-17 +453 340 -4.87721571029026e-18 +453 247 -4.16666666666667e-02 +453 408 -4.44444444444445e-01 +453 284 4.16666666666667e-02 +453 420 2.22222222222222e-01 +453 333 -1.94444444444445e-01 +453 318 -1.94444444444445e-01 +453 417 2.22222222222222e-01 +453 339 -2.77777777777778e-02 +453 246 -6.94444444444444e-02 +454 454 2.22222222222222e+00 +454 283 -6.94444444444444e-02 +454 282 4.16666666666667e-02 +454 356 -1.66666666666667e-01 +454 287 -4.16666666666667e-02 +454 355 -1.94444444444445e-01 +454 286 -6.94444444444444e-02 +454 354 -5.20417042793042e-18 +454 285 -4.16666666666667e-02 +454 353 3.73914224235938e-17 +454 275 4.16666666666667e-02 +454 352 -2.77777777777777e-02 +454 274 -6.94444444444445e-02 +454 351 1.54634334850745e-17 +454 273 4.16666666666667e-02 +454 329 -1.03541307472366e-17 +454 431 -9.61382395133631e-18 +454 350 1.66666666666667e-01 +454 272 4.16666666666666e-02 +454 328 -2.77777777777777e-02 +454 430 2.22222222222222e-01 +454 349 -1.94444444444445e-01 +454 271 -6.94444444444444e-02 +454 327 5.90381964236247e-18 +454 429 -6.93889390390723e-18 +454 348 -4.79759461324836e-18 +454 270 -4.16666666666667e-02 +454 338 3.64630743134031e-17 +454 260 4.16666666666667e-02 +454 337 -1.94444444444445e-01 +454 259 -6.94444444444444e-02 +454 336 1.66666666666667e-01 +454 258 4.16666666666667e-02 +454 428 1.44865927386535e-17 +454 362 8.02106319731932e-17 +454 347 1.66666666666667e-01 +454 263 4.16666666666667e-02 +454 427 -4.44444444444445e-01 +454 361 -1.94444444444444e-01 +454 346 -1.94444444444445e-01 +454 262 -6.94444444444444e-02 +454 426 -5.50819172852367e-17 +454 360 -1.66666666666667e-01 +454 345 -3.98613704977874e-18 +454 261 -4.16666666666667e-02 +454 425 -6.93889390390723e-17 +454 359 -2.40963932834903e-17 +454 344 -6.03544856236579e-17 +454 251 -4.16666666666667e-02 +454 424 2.22222222222223e-01 +454 358 -1.94444444444445e-01 +454 343 -2.77777777777778e-02 +454 250 -6.94444444444445e-02 +454 423 1.65024040981766e-16 +454 357 1.66666666666667e-01 +454 342 1.68051336735253e-17 +454 249 4.16666666666667e-02 +454 410 5.55111512312578e-17 +454 455 1.38777878078145e-17 +454 422 1.08911496357958e-17 +454 335 -6.97684097994422e-17 +454 320 1.48959214104141e-17 +454 419 -1.51629485470360e-17 +454 341 -1.66666666666667e-01 +454 248 -4.16666666666667e-02 +454 409 2.22222222222222e-01 +454 284 -4.16666666666667e-02 +454 421 -4.44444444444445e-01 +454 334 -1.94444444444444e-01 +454 319 -2.77777777777778e-02 +454 418 2.22222222222222e-01 +454 340 -1.94444444444445e-01 +454 247 -6.94444444444444e-02 +454 408 4.98027844414743e-17 +454 453 -2.22044604925031e-16 +454 420 -6.09829840705206e-17 +454 333 -1.66666666666667e-01 +454 318 6.23077436000263e-18 +454 417 -6.93889390390723e-18 +454 339 -4.81114714040443e-18 +454 246 -4.16666666666667e-02 +455 455 2.22222222222222e+00 +455 283 -4.16666666666667e-02 +455 282 4.16666666666667e-02 +455 356 -1.94444444444444e-01 +455 287 -6.94444444444445e-02 +455 355 -1.66666666666667e-01 +455 286 -4.16666666666667e-02 +455 354 4.64851681453160e-18 +455 285 -4.16666666666667e-02 +455 353 -1.94444444444444e-01 +455 275 -6.94444444444445e-02 +455 352 3.50282005007543e-17 +455 274 4.16666666666667e-02 +455 351 -1.66666666666667e-01 +455 273 -4.16666666666667e-02 +455 329 -1.94444444444444e-01 +455 431 -4.44444444444445e-01 +455 350 -1.94444444444445e-01 +455 272 -6.94444444444444e-02 +455 328 -9.42747670294036e-18 +455 430 -1.51595604152470e-17 +455 349 1.66666666666667e-01 +455 271 4.16666666666666e-02 +455 327 1.66666666666667e-01 +455 429 -1.42091894484277e-17 +455 348 2.72236389247532e-18 +455 270 4.16666666666667e-02 +455 338 -2.77777777777778e-02 +455 260 -6.94444444444445e-02 +455 337 3.40710532703570e-17 +455 259 4.16666666666667e-02 +455 336 -3.49434972060289e-17 +455 258 -4.16666666666667e-02 +455 428 2.22222222222222e-01 +455 362 -2.77777777777777e-02 +455 347 -1.94444444444445e-01 +455 263 -6.94444444444445e-02 +455 427 2.17196188334948e-17 +455 361 8.07595093230140e-17 +455 346 1.66666666666667e-01 +455 262 4.16666666666667e-02 +455 426 3.46944695195361e-17 +455 360 8.70072243419617e-18 +455 345 5.71916645986104e-18 +455 261 4.16666666666667e-02 +455 425 2.22222222222223e-01 +455 359 -2.77777777777778e-02 +455 344 -1.94444444444445e-01 +455 251 -6.94444444444445e-02 +455 424 -6.93889390390723e-17 +455 358 -2.06997911650006e-17 +455 343 -5.98615124483559e-17 +455 250 -4.16666666666667e-02 +455 423 1.98439490750948e-16 +455 357 5.36680075380325e-18 +455 342 1.66666666666667e-01 +455 249 4.16666666666667e-02 +455 410 2.22222222222222e-01 +455 284 -6.94444444444444e-02 +455 422 2.22222222222222e-01 +455 335 -2.77777777777778e-02 +455 320 -1.94444444444445e-01 +455 419 -4.44444444444445e-01 +455 341 -1.94444444444445e-01 +455 248 -6.94444444444445e-02 +455 409 6.93889390390723e-17 +455 454 1.38777878078145e-17 +455 421 4.04775869669149e-18 +455 334 -7.17724897526459e-17 +455 319 1.91361683443692e-17 +455 418 -1.49128620693592e-17 +455 340 -1.66666666666667e-01 +455 247 -4.16666666666667e-02 +455 408 -1.48726491801883e-16 +455 453 0.00000000000000e+00 +455 420 3.46944695195361e-17 +455 333 -3.23939280347935e-17 +455 318 -1.66666666666667e-01 +455 417 -1.68830607046727e-17 +455 339 6.57297567069337e-18 +455 246 -4.16666666666667e-02 +456 456 2.22222222222222e+00 +456 286 4.16666666666667e-02 +456 285 -6.94444444444444e-02 +456 380 -9.89334482393023e-18 +456 290 -4.16666666666667e-02 +456 379 -7.72494047895922e-19 +456 289 -4.16666666666667e-02 +456 378 -2.77777777777778e-02 +456 288 -6.94444444444444e-02 +456 377 -1.66666666666667e-01 +456 278 -4.16666666666667e-02 +456 376 3.03237795117040e-18 +456 277 4.16666666666667e-02 +456 375 -1.94444444444444e-01 +456 276 -6.94444444444444e-02 +456 353 1.66666666666667e-01 +456 446 -3.01221856702574e-17 +456 374 -1.09639944692597e-17 +456 275 4.16666666666667e-02 +456 352 5.96311194867027e-18 +456 445 -6.93889390390723e-18 +456 373 -2.81214938488428e-18 +456 274 -4.16666666666667e-02 +456 351 -1.94444444444444e-01 +456 444 2.22222222222222e-01 +456 372 -2.77777777777778e-02 +456 273 -6.94444444444444e-02 +456 362 1.21159592775255e-17 +456 263 -4.16666666666667e-02 +456 361 1.66666666666667e-01 +456 262 4.16666666666667e-02 +456 360 -1.94444444444444e-01 +456 261 -6.94444444444444e-02 +456 443 -4.85722573273506e-17 +456 386 1.87566975839992e-17 +456 371 -1.08352454612770e-17 +456 266 4.16666666666667e-02 +456 442 9.80694746331029e-18 +456 385 -1.66666666666667e-01 +456 370 -2.50721752387273e-18 +456 265 -4.16666666666667e-02 +456 441 2.22222222222222e-01 +456 384 -1.94444444444444e-01 +456 369 -2.77777777777778e-02 +456 264 -6.94444444444444e-02 +456 440 8.12673055748930e-17 +456 383 1.43080805450196e-17 +456 368 1.66666666666667e-01 +456 254 4.16666666666667e-02 +456 439 -8.24247760973160e-18 +456 382 1.66666666666667e-01 +456 367 2.04304346877737e-18 +456 253 4.16666666666667e-02 +456 438 -4.44444444444445e-01 +456 381 -1.94444444444444e-01 +456 366 -1.94444444444445e-01 +456 252 -6.94444444444444e-02 +456 425 5.64682984616552e-17 +456 458 -1.66533453693773e-16 +456 437 -4.85722573273506e-17 +456 359 1.52736981048895e-17 +456 344 -1.66666666666667e-01 +456 434 -2.77634106703910e-17 +456 365 -9.69175098248370e-18 +456 251 -4.16666666666667e-02 +456 424 -9.29872769495771e-18 +456 457 5.55111512312578e-17 +456 436 7.09707730680697e-18 +456 358 -1.66666666666667e-01 +456 343 7.03376159399971e-18 +456 433 0.00000000000000e+00 +456 364 -2.10233577508517e-18 +456 250 -4.16666666666667e-02 +456 423 -4.44444444444445e-01 +456 287 4.16666666666667e-02 +456 435 2.22222222222222e-01 +456 357 -1.94444444444444e-01 +456 342 -1.94444444444444e-01 +456 432 2.22222222222222e-01 +456 363 -2.77777777777778e-02 +456 249 -6.94444444444444e-02 +457 457 2.22222222222222e+00 +457 286 -6.94444444444444e-02 +457 285 4.16666666666667e-02 +457 380 -1.66666666666667e-01 +457 290 -4.16666666666667e-02 +457 379 -1.94444444444444e-01 +457 289 -6.94444444444444e-02 +457 378 -3.26954717640160e-18 +457 288 -4.16666666666667e-02 +457 377 -7.92822838630025e-18 +457 278 4.16666666666667e-02 +457 376 -2.77777777777778e-02 +457 277 -6.94444444444444e-02 +457 375 3.67273485929465e-18 +457 276 4.16666666666667e-02 +457 353 2.98155597433514e-18 +457 446 -1.58598449043895e-17 +457 374 1.66666666666667e-01 +457 275 4.16666666666667e-02 +457 352 -2.77777777777778e-02 +457 445 2.22222222222222e-01 +457 373 -1.94444444444444e-01 +457 274 -6.94444444444444e-02 +457 351 4.49266275223681e-18 +457 444 0.00000000000000e+00 +457 372 -2.49366499671666e-18 +457 273 -4.16666666666667e-02 +457 362 -2.44148776716580e-17 +457 263 4.16666666666667e-02 +457 361 -1.94444444444444e-01 +457 262 -6.94444444444444e-02 +457 360 1.66666666666667e-01 +457 261 4.16666666666667e-02 +457 443 1.05510659074732e-17 +457 386 3.70034813337514e-17 +457 371 1.66666666666667e-01 +457 266 4.16666666666667e-02 +457 442 -4.44444444444444e-01 +457 385 -1.94444444444444e-01 +457 370 -1.94444444444444e-01 +457 265 -6.94444444444444e-02 +457 441 1.83848501201546e-18 +457 384 -1.66666666666667e-01 +457 369 -3.70492211129031e-18 +457 264 -4.16666666666667e-02 +457 440 -6.93889390390723e-18 +457 383 -1.67102659834328e-17 +457 368 -6.15962359243327e-18 +457 254 -4.16666666666667e-02 +457 439 2.22222222222222e-01 +457 382 -1.94444444444444e-01 +457 367 -2.77777777777778e-02 +457 253 -6.94444444444444e-02 +457 438 -1.10317571050400e-17 +457 381 1.66666666666667e-01 +457 366 3.36102673470506e-18 +457 252 4.16666666666667e-02 +457 425 2.08166817117217e-17 +457 458 0.00000000000000e+00 +457 437 1.33831205666179e-19 +457 359 1.80655186990397e-17 +457 344 -2.90362894318774e-18 +457 434 -7.15213444837850e-18 +457 365 -1.66666666666667e-01 +457 251 -4.16666666666667e-02 +457 424 2.22222222222222e-01 +457 287 -4.16666666666667e-02 +457 436 -4.44444444444445e-01 +457 358 -1.94444444444444e-01 +457 343 -2.77777777777778e-02 +457 433 2.22222222222222e-01 +457 364 -1.94444444444444e-01 +457 250 -6.94444444444444e-02 +457 423 -1.10683912800088e-17 +457 456 5.55111512312578e-17 +457 435 9.91536768055884e-18 +457 357 -1.66666666666667e-01 +457 342 6.09355502254744e-18 +457 432 6.93889390390723e-18 +457 363 -3.37457926186113e-18 +457 249 -4.16666666666667e-02 +458 458 2.22222222222222e+00 +458 286 -4.16666666666667e-02 +458 285 4.16666666666667e-02 +458 380 -1.94444444444444e-01 +458 290 -6.94444444444444e-02 +458 379 -1.66666666666667e-01 +458 289 -4.16666666666666e-02 +458 378 -1.00051531729678e-17 +458 288 -4.16666666666667e-02 +458 377 -1.94444444444444e-01 +458 278 -6.94444444444444e-02 +458 376 -8.39748463907913e-18 +458 277 4.16666666666667e-02 +458 375 -1.66666666666667e-01 +458 276 -4.16666666666667e-02 +458 353 -1.94444444444444e-01 +458 446 -4.44444444444445e-01 +458 374 -1.94444444444444e-01 +458 275 -6.94444444444444e-02 +458 352 7.62329652528870e-19 +458 445 -1.04439162396455e-17 +458 373 1.66666666666667e-01 +458 274 4.16666666666667e-02 +458 351 1.66666666666667e-01 +458 444 -2.78178325372521e-17 +458 372 -1.10774968841917e-17 +458 273 4.16666666666667e-02 +458 362 -2.77777777777778e-02 +458 263 -6.94444444444444e-02 +458 361 -2.51670429288198e-17 +458 262 4.16666666666667e-02 +458 360 1.14044516018319e-17 +458 261 -4.16666666666667e-02 +458 443 2.22222222222222e-01 +458 386 -2.77777777777778e-02 +458 371 -1.94444444444445e-01 +458 266 -6.94444444444445e-02 +458 442 1.21142652116310e-17 +458 385 3.78386558197441e-17 +458 370 1.66666666666667e-01 +458 265 4.16666666666667e-02 +458 441 -3.46944695195361e-17 +458 384 2.02068179896986e-17 +458 369 -1.00830802041152e-17 +458 264 4.16666666666667e-02 +458 440 2.22222222222222e-01 +458 383 -2.77777777777778e-02 +458 368 -1.94444444444444e-01 +458 254 -6.94444444444445e-02 +458 439 -6.93889390390723e-18 +458 382 -1.83975556143634e-17 +458 367 -6.51876556206910e-18 +458 253 -4.16666666666667e-02 +458 438 8.37952754059734e-17 +458 381 1.49077798716757e-17 +458 366 1.66666666666667e-01 +458 252 4.16666666666667e-02 +458 425 2.22222222222222e-01 +458 287 -6.94444444444444e-02 +458 437 2.22222222222222e-01 +458 359 -2.77777777777778e-02 +458 344 -1.94444444444444e-01 +458 434 -4.44444444444445e-01 +458 365 -1.94444444444444e-01 +458 251 -6.94444444444444e-02 +458 424 1.38777878078145e-17 +458 457 0.00000000000000e+00 +458 436 1.69935985042894e-18 +458 358 2.00136944777246e-17 +458 343 -3.40168431617327e-18 +458 433 -1.30002616744590e-17 +458 364 -1.66666666666667e-01 +458 250 -4.16666666666667e-02 +458 423 5.77665882115592e-17 +458 456 -1.66533453693773e-16 +458 435 -4.16333634234434e-17 +458 357 1.49298027283043e-17 +458 342 -1.66666666666667e-01 +458 432 -3.00256239142704e-17 +458 363 -9.98821251402271e-18 +458 249 -4.16666666666667e-02 diff --git a/external/hypre/src/test/TEST_ij/data/beam_hex_dof459_np2/b.IJ.00000 b/external/hypre/src/test/TEST_ij/data/beam_hex_dof459_np2/b.IJ.00000 new file mode 100644 index 00000000..d736e2f8 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/data/beam_hex_dof459_np2/b.IJ.00000 @@ -0,0 +1,244 @@ +0 242 +0 0.00000000000000e+00 +1 0.00000000000000e+00 +2 0.00000000000000e+00 +3 0.00000000000000e+00 +4 0.00000000000000e+00 +5 0.00000000000000e+00 +6 0.00000000000000e+00 +7 0.00000000000000e+00 +8 0.00000000000000e+00 +9 0.00000000000000e+00 +10 0.00000000000000e+00 +11 0.00000000000000e+00 +12 0.00000000000000e+00 +13 0.00000000000000e+00 +14 0.00000000000000e+00 +15 0.00000000000000e+00 +16 0.00000000000000e+00 +17 0.00000000000000e+00 +18 0.00000000000000e+00 +19 0.00000000000000e+00 +20 0.00000000000000e+00 +21 0.00000000000000e+00 +22 0.00000000000000e+00 +23 0.00000000000000e+00 +24 0.00000000000000e+00 +25 0.00000000000000e+00 +26 0.00000000000000e+00 +27 0.00000000000000e+00 +28 0.00000000000000e+00 +29 0.00000000000000e+00 +30 0.00000000000000e+00 +31 0.00000000000000e+00 +32 0.00000000000000e+00 +33 0.00000000000000e+00 +34 0.00000000000000e+00 +35 0.00000000000000e+00 +36 0.00000000000000e+00 +37 0.00000000000000e+00 +38 0.00000000000000e+00 +39 0.00000000000000e+00 +40 0.00000000000000e+00 +41 0.00000000000000e+00 +42 0.00000000000000e+00 +43 0.00000000000000e+00 +44 0.00000000000000e+00 +45 0.00000000000000e+00 +46 0.00000000000000e+00 +47 0.00000000000000e+00 +48 0.00000000000000e+00 +49 0.00000000000000e+00 +50 0.00000000000000e+00 +51 0.00000000000000e+00 +52 0.00000000000000e+00 +53 0.00000000000000e+00 +54 0.00000000000000e+00 +55 0.00000000000000e+00 +56 0.00000000000000e+00 +57 0.00000000000000e+00 +58 0.00000000000000e+00 +59 0.00000000000000e+00 +60 0.00000000000000e+00 +61 0.00000000000000e+00 +62 0.00000000000000e+00 +63 0.00000000000000e+00 +64 0.00000000000000e+00 +65 0.00000000000000e+00 +66 0.00000000000000e+00 +67 0.00000000000000e+00 +68 0.00000000000000e+00 +69 0.00000000000000e+00 +70 0.00000000000000e+00 +71 0.00000000000000e+00 +72 0.00000000000000e+00 +73 0.00000000000000e+00 +74 0.00000000000000e+00 +75 0.00000000000000e+00 +76 0.00000000000000e+00 +77 0.00000000000000e+00 +78 0.00000000000000e+00 +79 0.00000000000000e+00 +80 0.00000000000000e+00 +81 0.00000000000000e+00 +82 0.00000000000000e+00 +83 0.00000000000000e+00 +84 0.00000000000000e+00 +85 0.00000000000000e+00 +86 0.00000000000000e+00 +87 0.00000000000000e+00 +88 0.00000000000000e+00 +89 0.00000000000000e+00 +90 0.00000000000000e+00 +91 0.00000000000000e+00 +92 0.00000000000000e+00 +93 0.00000000000000e+00 +94 0.00000000000000e+00 +95 0.00000000000000e+00 +96 0.00000000000000e+00 +97 0.00000000000000e+00 +98 0.00000000000000e+00 +99 0.00000000000000e+00 +100 0.00000000000000e+00 +101 0.00000000000000e+00 +102 0.00000000000000e+00 +103 0.00000000000000e+00 +104 0.00000000000000e+00 +105 0.00000000000000e+00 +106 0.00000000000000e+00 +107 0.00000000000000e+00 +108 0.00000000000000e+00 +109 0.00000000000000e+00 +110 0.00000000000000e+00 +111 0.00000000000000e+00 +112 0.00000000000000e+00 +113 0.00000000000000e+00 +114 0.00000000000000e+00 +115 0.00000000000000e+00 +116 0.00000000000000e+00 +117 0.00000000000000e+00 +118 0.00000000000000e+00 +119 0.00000000000000e+00 +120 0.00000000000000e+00 +121 0.00000000000000e+00 +122 0.00000000000000e+00 +123 0.00000000000000e+00 +124 0.00000000000000e+00 +125 0.00000000000000e+00 +126 0.00000000000000e+00 +127 0.00000000000000e+00 +128 0.00000000000000e+00 +129 0.00000000000000e+00 +130 0.00000000000000e+00 +131 0.00000000000000e+00 +132 0.00000000000000e+00 +133 0.00000000000000e+00 +134 0.00000000000000e+00 +135 0.00000000000000e+00 +136 0.00000000000000e+00 +137 0.00000000000000e+00 +138 0.00000000000000e+00 +139 0.00000000000000e+00 +140 0.00000000000000e+00 +141 0.00000000000000e+00 +142 0.00000000000000e+00 +143 0.00000000000000e+00 +144 0.00000000000000e+00 +145 0.00000000000000e+00 +146 0.00000000000000e+00 +147 0.00000000000000e+00 +148 0.00000000000000e+00 +149 0.00000000000000e+00 +150 0.00000000000000e+00 +151 0.00000000000000e+00 +152 0.00000000000000e+00 +153 0.00000000000000e+00 +154 0.00000000000000e+00 +155 0.00000000000000e+00 +156 0.00000000000000e+00 +157 0.00000000000000e+00 +158 0.00000000000000e+00 +159 0.00000000000000e+00 +160 0.00000000000000e+00 +161 0.00000000000000e+00 +162 0.00000000000000e+00 +163 0.00000000000000e+00 +164 0.00000000000000e+00 +165 0.00000000000000e+00 +166 0.00000000000000e+00 +167 0.00000000000000e+00 +168 0.00000000000000e+00 +169 0.00000000000000e+00 +170 0.00000000000000e+00 +171 0.00000000000000e+00 +172 0.00000000000000e+00 +173 0.00000000000000e+00 +174 0.00000000000000e+00 +175 0.00000000000000e+00 +176 0.00000000000000e+00 +177 0.00000000000000e+00 +178 0.00000000000000e+00 +179 0.00000000000000e+00 +180 0.00000000000000e+00 +181 0.00000000000000e+00 +182 0.00000000000000e+00 +183 0.00000000000000e+00 +184 0.00000000000000e+00 +185 0.00000000000000e+00 +186 0.00000000000000e+00 +187 0.00000000000000e+00 +188 0.00000000000000e+00 +189 0.00000000000000e+00 +190 0.00000000000000e+00 +191 0.00000000000000e+00 +192 0.00000000000000e+00 +193 0.00000000000000e+00 +194 0.00000000000000e+00 +195 0.00000000000000e+00 +196 0.00000000000000e+00 +197 0.00000000000000e+00 +198 0.00000000000000e+00 +199 0.00000000000000e+00 +200 0.00000000000000e+00 +201 0.00000000000000e+00 +202 0.00000000000000e+00 +203 0.00000000000000e+00 +204 0.00000000000000e+00 +205 0.00000000000000e+00 +206 0.00000000000000e+00 +207 0.00000000000000e+00 +208 0.00000000000000e+00 +209 0.00000000000000e+00 +210 0.00000000000000e+00 +211 0.00000000000000e+00 +212 0.00000000000000e+00 +213 0.00000000000000e+00 +214 0.00000000000000e+00 +215 0.00000000000000e+00 +216 0.00000000000000e+00 +217 0.00000000000000e+00 +218 0.00000000000000e+00 +219 0.00000000000000e+00 +220 0.00000000000000e+00 +221 0.00000000000000e+00 +222 0.00000000000000e+00 +223 0.00000000000000e+00 +224 0.00000000000000e+00 +225 0.00000000000000e+00 +226 0.00000000000000e+00 +227 0.00000000000000e+00 +228 0.00000000000000e+00 +229 0.00000000000000e+00 +230 0.00000000000000e+00 +231 0.00000000000000e+00 +232 0.00000000000000e+00 +233 0.00000000000000e+00 +234 0.00000000000000e+00 +235 0.00000000000000e+00 +236 0.00000000000000e+00 +237 0.00000000000000e+00 +238 0.00000000000000e+00 +239 0.00000000000000e+00 +240 0.00000000000000e+00 +241 0.00000000000000e+00 +242 0.00000000000000e+00 diff --git a/external/hypre/src/test/TEST_ij/data/beam_hex_dof459_np2/b.IJ.00001 b/external/hypre/src/test/TEST_ij/data/beam_hex_dof459_np2/b.IJ.00001 new file mode 100644 index 00000000..3f05c33e --- /dev/null +++ b/external/hypre/src/test/TEST_ij/data/beam_hex_dof459_np2/b.IJ.00001 @@ -0,0 +1,217 @@ +243 458 +243 0.00000000000000e+00 +244 0.00000000000000e+00 +245 0.00000000000000e+00 +246 0.00000000000000e+00 +247 0.00000000000000e+00 +248 0.00000000000000e+00 +249 0.00000000000000e+00 +250 0.00000000000000e+00 +251 0.00000000000000e+00 +252 0.00000000000000e+00 +253 0.00000000000000e+00 +254 -6.25000000000000e-04 +255 0.00000000000000e+00 +256 0.00000000000000e+00 +257 0.00000000000000e+00 +258 0.00000000000000e+00 +259 0.00000000000000e+00 +260 0.00000000000000e+00 +261 0.00000000000000e+00 +262 0.00000000000000e+00 +263 0.00000000000000e+00 +264 0.00000000000000e+00 +265 0.00000000000000e+00 +266 -6.25000000000000e-04 +267 0.00000000000000e+00 +268 0.00000000000000e+00 +269 0.00000000000000e+00 +270 0.00000000000000e+00 +271 0.00000000000000e+00 +272 0.00000000000000e+00 +273 0.00000000000000e+00 +274 0.00000000000000e+00 +275 0.00000000000000e+00 +276 0.00000000000000e+00 +277 0.00000000000000e+00 +278 -6.25000000000000e-04 +279 0.00000000000000e+00 +280 0.00000000000000e+00 +281 0.00000000000000e+00 +282 0.00000000000000e+00 +283 0.00000000000000e+00 +284 0.00000000000000e+00 +285 0.00000000000000e+00 +286 0.00000000000000e+00 +287 0.00000000000000e+00 +288 0.00000000000000e+00 +289 0.00000000000000e+00 +290 -6.25000000000000e-04 +291 0.00000000000000e+00 +292 0.00000000000000e+00 +293 0.00000000000000e+00 +294 0.00000000000000e+00 +295 0.00000000000000e+00 +296 0.00000000000000e+00 +297 0.00000000000000e+00 +298 0.00000000000000e+00 +299 0.00000000000000e+00 +300 0.00000000000000e+00 +301 0.00000000000000e+00 +302 0.00000000000000e+00 +303 0.00000000000000e+00 +304 0.00000000000000e+00 +305 0.00000000000000e+00 +306 0.00000000000000e+00 +307 0.00000000000000e+00 +308 0.00000000000000e+00 +309 0.00000000000000e+00 +310 0.00000000000000e+00 +311 0.00000000000000e+00 +312 0.00000000000000e+00 +313 0.00000000000000e+00 +314 0.00000000000000e+00 +315 0.00000000000000e+00 +316 0.00000000000000e+00 +317 0.00000000000000e+00 +318 0.00000000000000e+00 +319 0.00000000000000e+00 +320 0.00000000000000e+00 +321 0.00000000000000e+00 +322 0.00000000000000e+00 +323 0.00000000000000e+00 +324 0.00000000000000e+00 +325 0.00000000000000e+00 +326 0.00000000000000e+00 +327 0.00000000000000e+00 +328 0.00000000000000e+00 +329 0.00000000000000e+00 +330 0.00000000000000e+00 +331 0.00000000000000e+00 +332 0.00000000000000e+00 +333 0.00000000000000e+00 +334 0.00000000000000e+00 +335 0.00000000000000e+00 +336 0.00000000000000e+00 +337 0.00000000000000e+00 +338 0.00000000000000e+00 +339 0.00000000000000e+00 +340 0.00000000000000e+00 +341 0.00000000000000e+00 +342 0.00000000000000e+00 +343 0.00000000000000e+00 +344 0.00000000000000e+00 +345 0.00000000000000e+00 +346 0.00000000000000e+00 +347 0.00000000000000e+00 +348 0.00000000000000e+00 +349 0.00000000000000e+00 +350 0.00000000000000e+00 +351 0.00000000000000e+00 +352 0.00000000000000e+00 +353 0.00000000000000e+00 +354 0.00000000000000e+00 +355 0.00000000000000e+00 +356 0.00000000000000e+00 +357 0.00000000000000e+00 +358 0.00000000000000e+00 +359 0.00000000000000e+00 +360 0.00000000000000e+00 +361 0.00000000000000e+00 +362 0.00000000000000e+00 +363 0.00000000000000e+00 +364 0.00000000000000e+00 +365 0.00000000000000e+00 +366 0.00000000000000e+00 +367 0.00000000000000e+00 +368 -1.25000000000000e-03 +369 0.00000000000000e+00 +370 0.00000000000000e+00 +371 0.00000000000000e+00 +372 0.00000000000000e+00 +373 0.00000000000000e+00 +374 0.00000000000000e+00 +375 0.00000000000000e+00 +376 0.00000000000000e+00 +377 -1.25000000000000e-03 +378 0.00000000000000e+00 +379 0.00000000000000e+00 +380 0.00000000000000e+00 +381 0.00000000000000e+00 +382 0.00000000000000e+00 +383 -1.25000000000000e-03 +384 0.00000000000000e+00 +385 0.00000000000000e+00 +386 -1.25000000000000e-03 +387 0.00000000000000e+00 +388 0.00000000000000e+00 +389 0.00000000000000e+00 +390 0.00000000000000e+00 +391 0.00000000000000e+00 +392 0.00000000000000e+00 +393 0.00000000000000e+00 +394 0.00000000000000e+00 +395 0.00000000000000e+00 +396 0.00000000000000e+00 +397 0.00000000000000e+00 +398 0.00000000000000e+00 +399 0.00000000000000e+00 +400 0.00000000000000e+00 +401 0.00000000000000e+00 +402 0.00000000000000e+00 +403 0.00000000000000e+00 +404 0.00000000000000e+00 +405 0.00000000000000e+00 +406 0.00000000000000e+00 +407 0.00000000000000e+00 +408 0.00000000000000e+00 +409 0.00000000000000e+00 +410 0.00000000000000e+00 +411 0.00000000000000e+00 +412 0.00000000000000e+00 +413 0.00000000000000e+00 +414 0.00000000000000e+00 +415 0.00000000000000e+00 +416 0.00000000000000e+00 +417 0.00000000000000e+00 +418 0.00000000000000e+00 +419 0.00000000000000e+00 +420 0.00000000000000e+00 +421 0.00000000000000e+00 +422 0.00000000000000e+00 +423 0.00000000000000e+00 +424 0.00000000000000e+00 +425 0.00000000000000e+00 +426 0.00000000000000e+00 +427 0.00000000000000e+00 +428 0.00000000000000e+00 +429 0.00000000000000e+00 +430 0.00000000000000e+00 +431 0.00000000000000e+00 +432 0.00000000000000e+00 +433 0.00000000000000e+00 +434 0.00000000000000e+00 +435 0.00000000000000e+00 +436 0.00000000000000e+00 +437 0.00000000000000e+00 +438 0.00000000000000e+00 +439 0.00000000000000e+00 +440 -2.50000000000000e-03 +441 0.00000000000000e+00 +442 0.00000000000000e+00 +443 0.00000000000000e+00 +444 0.00000000000000e+00 +445 0.00000000000000e+00 +446 0.00000000000000e+00 +447 0.00000000000000e+00 +448 0.00000000000000e+00 +449 0.00000000000000e+00 +450 0.00000000000000e+00 +451 0.00000000000000e+00 +452 0.00000000000000e+00 +453 0.00000000000000e+00 +454 0.00000000000000e+00 +455 0.00000000000000e+00 +456 0.00000000000000e+00 +457 0.00000000000000e+00 +458 0.00000000000000e+00 diff --git a/external/hypre/src/test/TEST_ij/data/beam_hex_dof459_np2/mfem.txt b/external/hypre/src/test/TEST_ij/data/beam_hex_dof459_np2/mfem.txt new file mode 100644 index 00000000..72747178 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/data/beam_hex_dof459_np2/mfem.txt @@ -0,0 +1,19 @@ +$ mpirun -np 2 ./ex2p -m ../beam-hex.mesh -sr 0 -sp 1 + +Produced with mfem-4.4 (https://github.com/mfem/mfem/archive/refs/tags/v4.4.tar.gz) + +Options used: + --mesh ../beam-hex.mesh + --order 1 + --serial_ref 0 + --parallel_ref 1 + --amg-for-systems + --no-static-condensation + --visualization + --by-vdim + --device cpu +Device configuration: cpu +Memory configuration: host-std +Number of finite element unknowns: 459 +Assembling: r.h.s. ... matrix ... done. +Size of linear system: 459 \ No newline at end of file diff --git a/external/hypre/src/test/TEST_ij/data/beam_hex_dof459_np2/rbms.0.00000 b/external/hypre/src/test/TEST_ij/data/beam_hex_dof459_np2/rbms.0.00000 new file mode 100644 index 00000000..7d333f7d --- /dev/null +++ b/external/hypre/src/test/TEST_ij/data/beam_hex_dof459_np2/rbms.0.00000 @@ -0,0 +1,244 @@ +0 243 +0 0.00000000000000e+00 +1 0.00000000000000e+00 +2 0.00000000000000e+00 +3 0.00000000000000e+00 +4 -1.00000000000000e+00 +5 0.00000000000000e+00 +6 0.00000000000000e+00 +7 -2.00000000000000e+00 +8 0.00000000000000e+00 +9 0.00000000000000e+00 +10 -3.00000000000000e+00 +11 0.00000000000000e+00 +12 0.00000000000000e+00 +13 -4.00000000000000e+00 +14 0.00000000000000e+00 +15 1.00000000000000e+00 +16 0.00000000000000e+00 +17 0.00000000000000e+00 +18 1.00000000000000e+00 +19 -1.00000000000000e+00 +20 0.00000000000000e+00 +21 1.00000000000000e+00 +22 -2.00000000000000e+00 +23 0.00000000000000e+00 +24 1.00000000000000e+00 +25 -3.00000000000000e+00 +26 0.00000000000000e+00 +27 1.00000000000000e+00 +28 -4.00000000000000e+00 +29 0.00000000000000e+00 +30 0.00000000000000e+00 +31 0.00000000000000e+00 +32 0.00000000000000e+00 +33 0.00000000000000e+00 +34 -1.00000000000000e+00 +35 0.00000000000000e+00 +36 0.00000000000000e+00 +37 -2.00000000000000e+00 +38 0.00000000000000e+00 +39 0.00000000000000e+00 +40 -3.00000000000000e+00 +41 0.00000000000000e+00 +42 0.00000000000000e+00 +43 -4.00000000000000e+00 +44 0.00000000000000e+00 +45 1.00000000000000e+00 +46 0.00000000000000e+00 +47 0.00000000000000e+00 +48 1.00000000000000e+00 +49 -1.00000000000000e+00 +50 0.00000000000000e+00 +51 1.00000000000000e+00 +52 -2.00000000000000e+00 +53 0.00000000000000e+00 +54 1.00000000000000e+00 +55 -3.00000000000000e+00 +56 0.00000000000000e+00 +57 1.00000000000000e+00 +58 -4.00000000000000e+00 +59 0.00000000000000e+00 +60 0.00000000000000e+00 +61 -5.00000000000000e-01 +62 0.00000000000000e+00 +63 5.00000000000000e-01 +64 -1.00000000000000e+00 +65 0.00000000000000e+00 +66 1.00000000000000e+00 +67 -5.00000000000000e-01 +68 0.00000000000000e+00 +69 5.00000000000000e-01 +70 0.00000000000000e+00 +71 0.00000000000000e+00 +72 0.00000000000000e+00 +73 -5.00000000000000e-01 +74 0.00000000000000e+00 +75 5.00000000000000e-01 +76 -1.00000000000000e+00 +77 0.00000000000000e+00 +78 1.00000000000000e+00 +79 -5.00000000000000e-01 +80 0.00000000000000e+00 +81 5.00000000000000e-01 +82 0.00000000000000e+00 +83 0.00000000000000e+00 +84 0.00000000000000e+00 +85 0.00000000000000e+00 +86 0.00000000000000e+00 +87 0.00000000000000e+00 +88 -1.00000000000000e+00 +89 0.00000000000000e+00 +90 1.00000000000000e+00 +91 -1.00000000000000e+00 +92 0.00000000000000e+00 +93 1.00000000000000e+00 +94 0.00000000000000e+00 +95 0.00000000000000e+00 +96 0.00000000000000e+00 +97 -1.50000000000000e+00 +98 0.00000000000000e+00 +99 5.00000000000000e-01 +100 -2.00000000000000e+00 +101 0.00000000000000e+00 +102 1.00000000000000e+00 +103 -1.50000000000000e+00 +104 0.00000000000000e+00 +105 0.00000000000000e+00 +106 -1.50000000000000e+00 +107 0.00000000000000e+00 +108 5.00000000000000e-01 +109 -2.00000000000000e+00 +110 0.00000000000000e+00 +111 1.00000000000000e+00 +112 -1.50000000000000e+00 +113 0.00000000000000e+00 +114 0.00000000000000e+00 +115 -2.00000000000000e+00 +116 0.00000000000000e+00 +117 1.00000000000000e+00 +118 -2.00000000000000e+00 +119 0.00000000000000e+00 +120 0.00000000000000e+00 +121 -2.50000000000000e+00 +122 0.00000000000000e+00 +123 5.00000000000000e-01 +124 -3.00000000000000e+00 +125 0.00000000000000e+00 +126 1.00000000000000e+00 +127 -2.50000000000000e+00 +128 0.00000000000000e+00 +129 0.00000000000000e+00 +130 -2.50000000000000e+00 +131 0.00000000000000e+00 +132 5.00000000000000e-01 +133 -3.00000000000000e+00 +134 0.00000000000000e+00 +135 1.00000000000000e+00 +136 -2.50000000000000e+00 +137 0.00000000000000e+00 +138 0.00000000000000e+00 +139 -3.00000000000000e+00 +140 0.00000000000000e+00 +141 1.00000000000000e+00 +142 -3.00000000000000e+00 +143 0.00000000000000e+00 +144 0.00000000000000e+00 +145 -3.50000000000000e+00 +146 0.00000000000000e+00 +147 5.00000000000000e-01 +148 -4.00000000000000e+00 +149 0.00000000000000e+00 +150 1.00000000000000e+00 +151 -3.50000000000000e+00 +152 0.00000000000000e+00 +153 0.00000000000000e+00 +154 -3.50000000000000e+00 +155 0.00000000000000e+00 +156 5.00000000000000e-01 +157 -4.00000000000000e+00 +158 0.00000000000000e+00 +159 1.00000000000000e+00 +160 -3.50000000000000e+00 +161 0.00000000000000e+00 +162 0.00000000000000e+00 +163 -4.00000000000000e+00 +164 0.00000000000000e+00 +165 1.00000000000000e+00 +166 -4.00000000000000e+00 +167 0.00000000000000e+00 +168 5.00000000000000e-01 +169 -5.00000000000000e-01 +170 0.00000000000000e+00 +171 0.00000000000000e+00 +172 -5.00000000000000e-01 +173 0.00000000000000e+00 +174 5.00000000000000e-01 +175 -1.00000000000000e+00 +176 0.00000000000000e+00 +177 1.00000000000000e+00 +178 -5.00000000000000e-01 +179 0.00000000000000e+00 +180 5.00000000000000e-01 +181 0.00000000000000e+00 +182 0.00000000000000e+00 +183 5.00000000000000e-01 +184 -5.00000000000000e-01 +185 0.00000000000000e+00 +186 5.00000000000000e-01 +187 -1.50000000000000e+00 +188 0.00000000000000e+00 +189 0.00000000000000e+00 +190 -1.50000000000000e+00 +191 0.00000000000000e+00 +192 5.00000000000000e-01 +193 -2.00000000000000e+00 +194 0.00000000000000e+00 +195 1.00000000000000e+00 +196 -1.50000000000000e+00 +197 0.00000000000000e+00 +198 5.00000000000000e-01 +199 -1.50000000000000e+00 +200 0.00000000000000e+00 +201 5.00000000000000e-01 +202 -2.50000000000000e+00 +203 0.00000000000000e+00 +204 0.00000000000000e+00 +205 -2.50000000000000e+00 +206 0.00000000000000e+00 +207 5.00000000000000e-01 +208 -3.00000000000000e+00 +209 0.00000000000000e+00 +210 1.00000000000000e+00 +211 -2.50000000000000e+00 +212 0.00000000000000e+00 +213 5.00000000000000e-01 +214 -2.50000000000000e+00 +215 0.00000000000000e+00 +216 5.00000000000000e-01 +217 -3.50000000000000e+00 +218 0.00000000000000e+00 +219 0.00000000000000e+00 +220 -3.50000000000000e+00 +221 0.00000000000000e+00 +222 5.00000000000000e-01 +223 -4.00000000000000e+00 +224 0.00000000000000e+00 +225 1.00000000000000e+00 +226 -3.50000000000000e+00 +227 0.00000000000000e+00 +228 5.00000000000000e-01 +229 -3.50000000000000e+00 +230 0.00000000000000e+00 +231 5.00000000000000e-01 +232 -5.00000000000000e-01 +233 0.00000000000000e+00 +234 5.00000000000000e-01 +235 -1.50000000000000e+00 +236 0.00000000000000e+00 +237 5.00000000000000e-01 +238 -2.50000000000000e+00 +239 0.00000000000000e+00 +240 5.00000000000000e-01 +241 -3.50000000000000e+00 +242 0.00000000000000e+00 diff --git a/external/hypre/src/test/TEST_ij/data/beam_hex_dof459_np2/rbms.0.00001 b/external/hypre/src/test/TEST_ij/data/beam_hex_dof459_np2/rbms.0.00001 new file mode 100644 index 00000000..2526adb2 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/data/beam_hex_dof459_np2/rbms.0.00001 @@ -0,0 +1,217 @@ +243 459 +243 0.00000000000000e+00 +244 -5.00000000000000e+00 +245 0.00000000000000e+00 +246 0.00000000000000e+00 +247 -6.00000000000000e+00 +248 0.00000000000000e+00 +249 0.00000000000000e+00 +250 -7.00000000000000e+00 +251 0.00000000000000e+00 +252 0.00000000000000e+00 +253 -8.00000000000000e+00 +254 0.00000000000000e+00 +255 1.00000000000000e+00 +256 -5.00000000000000e+00 +257 0.00000000000000e+00 +258 1.00000000000000e+00 +259 -6.00000000000000e+00 +260 0.00000000000000e+00 +261 1.00000000000000e+00 +262 -7.00000000000000e+00 +263 0.00000000000000e+00 +264 1.00000000000000e+00 +265 -8.00000000000000e+00 +266 0.00000000000000e+00 +267 0.00000000000000e+00 +268 -5.00000000000000e+00 +269 0.00000000000000e+00 +270 0.00000000000000e+00 +271 -6.00000000000000e+00 +272 0.00000000000000e+00 +273 0.00000000000000e+00 +274 -7.00000000000000e+00 +275 0.00000000000000e+00 +276 0.00000000000000e+00 +277 -8.00000000000000e+00 +278 0.00000000000000e+00 +279 1.00000000000000e+00 +280 -5.00000000000000e+00 +281 0.00000000000000e+00 +282 1.00000000000000e+00 +283 -6.00000000000000e+00 +284 0.00000000000000e+00 +285 1.00000000000000e+00 +286 -7.00000000000000e+00 +287 0.00000000000000e+00 +288 1.00000000000000e+00 +289 -8.00000000000000e+00 +290 0.00000000000000e+00 +291 0.00000000000000e+00 +292 -4.50000000000000e+00 +293 0.00000000000000e+00 +294 5.00000000000000e-01 +295 -5.00000000000000e+00 +296 0.00000000000000e+00 +297 1.00000000000000e+00 +298 -4.50000000000000e+00 +299 0.00000000000000e+00 +300 0.00000000000000e+00 +301 -4.50000000000000e+00 +302 0.00000000000000e+00 +303 5.00000000000000e-01 +304 -5.00000000000000e+00 +305 0.00000000000000e+00 +306 1.00000000000000e+00 +307 -4.50000000000000e+00 +308 0.00000000000000e+00 +309 0.00000000000000e+00 +310 -5.00000000000000e+00 +311 0.00000000000000e+00 +312 1.00000000000000e+00 +313 -5.00000000000000e+00 +314 0.00000000000000e+00 +315 0.00000000000000e+00 +316 -5.50000000000000e+00 +317 0.00000000000000e+00 +318 5.00000000000000e-01 +319 -6.00000000000000e+00 +320 0.00000000000000e+00 +321 1.00000000000000e+00 +322 -5.50000000000000e+00 +323 0.00000000000000e+00 +324 0.00000000000000e+00 +325 -5.50000000000000e+00 +326 0.00000000000000e+00 +327 5.00000000000000e-01 +328 -6.00000000000000e+00 +329 0.00000000000000e+00 +330 1.00000000000000e+00 +331 -5.50000000000000e+00 +332 0.00000000000000e+00 +333 0.00000000000000e+00 +334 -6.00000000000000e+00 +335 0.00000000000000e+00 +336 1.00000000000000e+00 +337 -6.00000000000000e+00 +338 0.00000000000000e+00 +339 0.00000000000000e+00 +340 -6.50000000000000e+00 +341 0.00000000000000e+00 +342 5.00000000000000e-01 +343 -7.00000000000000e+00 +344 0.00000000000000e+00 +345 1.00000000000000e+00 +346 -6.50000000000000e+00 +347 0.00000000000000e+00 +348 0.00000000000000e+00 +349 -6.50000000000000e+00 +350 0.00000000000000e+00 +351 5.00000000000000e-01 +352 -7.00000000000000e+00 +353 0.00000000000000e+00 +354 1.00000000000000e+00 +355 -6.50000000000000e+00 +356 0.00000000000000e+00 +357 0.00000000000000e+00 +358 -7.00000000000000e+00 +359 0.00000000000000e+00 +360 1.00000000000000e+00 +361 -7.00000000000000e+00 +362 0.00000000000000e+00 +363 0.00000000000000e+00 +364 -7.50000000000000e+00 +365 0.00000000000000e+00 +366 5.00000000000000e-01 +367 -8.00000000000000e+00 +368 0.00000000000000e+00 +369 1.00000000000000e+00 +370 -7.50000000000000e+00 +371 0.00000000000000e+00 +372 0.00000000000000e+00 +373 -7.50000000000000e+00 +374 0.00000000000000e+00 +375 5.00000000000000e-01 +376 -8.00000000000000e+00 +377 0.00000000000000e+00 +378 1.00000000000000e+00 +379 -7.50000000000000e+00 +380 0.00000000000000e+00 +381 0.00000000000000e+00 +382 -8.00000000000000e+00 +383 0.00000000000000e+00 +384 1.00000000000000e+00 +385 -8.00000000000000e+00 +386 0.00000000000000e+00 +387 5.00000000000000e-01 +388 -4.50000000000000e+00 +389 0.00000000000000e+00 +390 0.00000000000000e+00 +391 -4.50000000000000e+00 +392 0.00000000000000e+00 +393 5.00000000000000e-01 +394 -5.00000000000000e+00 +395 0.00000000000000e+00 +396 1.00000000000000e+00 +397 -4.50000000000000e+00 +398 0.00000000000000e+00 +399 5.00000000000000e-01 +400 -4.50000000000000e+00 +401 0.00000000000000e+00 +402 5.00000000000000e-01 +403 -5.50000000000000e+00 +404 0.00000000000000e+00 +405 0.00000000000000e+00 +406 -5.50000000000000e+00 +407 0.00000000000000e+00 +408 5.00000000000000e-01 +409 -6.00000000000000e+00 +410 0.00000000000000e+00 +411 1.00000000000000e+00 +412 -5.50000000000000e+00 +413 0.00000000000000e+00 +414 5.00000000000000e-01 +415 -5.50000000000000e+00 +416 0.00000000000000e+00 +417 5.00000000000000e-01 +418 -6.50000000000000e+00 +419 0.00000000000000e+00 +420 0.00000000000000e+00 +421 -6.50000000000000e+00 +422 0.00000000000000e+00 +423 5.00000000000000e-01 +424 -7.00000000000000e+00 +425 0.00000000000000e+00 +426 1.00000000000000e+00 +427 -6.50000000000000e+00 +428 0.00000000000000e+00 +429 5.00000000000000e-01 +430 -6.50000000000000e+00 +431 0.00000000000000e+00 +432 5.00000000000000e-01 +433 -7.50000000000000e+00 +434 0.00000000000000e+00 +435 0.00000000000000e+00 +436 -7.50000000000000e+00 +437 0.00000000000000e+00 +438 5.00000000000000e-01 +439 -8.00000000000000e+00 +440 0.00000000000000e+00 +441 1.00000000000000e+00 +442 -7.50000000000000e+00 +443 0.00000000000000e+00 +444 5.00000000000000e-01 +445 -7.50000000000000e+00 +446 0.00000000000000e+00 +447 5.00000000000000e-01 +448 -4.50000000000000e+00 +449 0.00000000000000e+00 +450 5.00000000000000e-01 +451 -5.50000000000000e+00 +452 0.00000000000000e+00 +453 5.00000000000000e-01 +454 -6.50000000000000e+00 +455 0.00000000000000e+00 +456 5.00000000000000e-01 +457 -7.50000000000000e+00 +458 0.00000000000000e+00 diff --git a/external/hypre/src/test/TEST_ij/data/beam_hex_dof459_np2/rbms.1.00000 b/external/hypre/src/test/TEST_ij/data/beam_hex_dof459_np2/rbms.1.00000 new file mode 100644 index 00000000..6dfcc9d8 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/data/beam_hex_dof459_np2/rbms.1.00000 @@ -0,0 +1,244 @@ +0 243 +0 0.00000000000000e+00 +1 0.00000000000000e+00 +2 0.00000000000000e+00 +3 0.00000000000000e+00 +4 0.00000000000000e+00 +5 0.00000000000000e+00 +6 0.00000000000000e+00 +7 0.00000000000000e+00 +8 0.00000000000000e+00 +9 0.00000000000000e+00 +10 0.00000000000000e+00 +11 0.00000000000000e+00 +12 0.00000000000000e+00 +13 0.00000000000000e+00 +14 0.00000000000000e+00 +15 0.00000000000000e+00 +16 0.00000000000000e+00 +17 -1.00000000000000e+00 +18 0.00000000000000e+00 +19 0.00000000000000e+00 +20 -1.00000000000000e+00 +21 0.00000000000000e+00 +22 0.00000000000000e+00 +23 -1.00000000000000e+00 +24 0.00000000000000e+00 +25 0.00000000000000e+00 +26 -1.00000000000000e+00 +27 0.00000000000000e+00 +28 0.00000000000000e+00 +29 -1.00000000000000e+00 +30 0.00000000000000e+00 +31 1.00000000000000e+00 +32 0.00000000000000e+00 +33 0.00000000000000e+00 +34 1.00000000000000e+00 +35 0.00000000000000e+00 +36 0.00000000000000e+00 +37 1.00000000000000e+00 +38 0.00000000000000e+00 +39 0.00000000000000e+00 +40 1.00000000000000e+00 +41 0.00000000000000e+00 +42 0.00000000000000e+00 +43 1.00000000000000e+00 +44 0.00000000000000e+00 +45 0.00000000000000e+00 +46 1.00000000000000e+00 +47 -1.00000000000000e+00 +48 0.00000000000000e+00 +49 1.00000000000000e+00 +50 -1.00000000000000e+00 +51 0.00000000000000e+00 +52 1.00000000000000e+00 +53 -1.00000000000000e+00 +54 0.00000000000000e+00 +55 1.00000000000000e+00 +56 -1.00000000000000e+00 +57 0.00000000000000e+00 +58 1.00000000000000e+00 +59 -1.00000000000000e+00 +60 0.00000000000000e+00 +61 0.00000000000000e+00 +62 0.00000000000000e+00 +63 0.00000000000000e+00 +64 0.00000000000000e+00 +65 -5.00000000000000e-01 +66 0.00000000000000e+00 +67 0.00000000000000e+00 +68 -1.00000000000000e+00 +69 0.00000000000000e+00 +70 0.00000000000000e+00 +71 -5.00000000000000e-01 +72 0.00000000000000e+00 +73 1.00000000000000e+00 +74 0.00000000000000e+00 +75 0.00000000000000e+00 +76 1.00000000000000e+00 +77 -5.00000000000000e-01 +78 0.00000000000000e+00 +79 1.00000000000000e+00 +80 -1.00000000000000e+00 +81 0.00000000000000e+00 +82 1.00000000000000e+00 +83 -5.00000000000000e-01 +84 0.00000000000000e+00 +85 5.00000000000000e-01 +86 0.00000000000000e+00 +87 0.00000000000000e+00 +88 5.00000000000000e-01 +89 0.00000000000000e+00 +90 0.00000000000000e+00 +91 5.00000000000000e-01 +92 -1.00000000000000e+00 +93 0.00000000000000e+00 +94 5.00000000000000e-01 +95 -1.00000000000000e+00 +96 0.00000000000000e+00 +97 0.00000000000000e+00 +98 0.00000000000000e+00 +99 0.00000000000000e+00 +100 0.00000000000000e+00 +101 -5.00000000000000e-01 +102 0.00000000000000e+00 +103 0.00000000000000e+00 +104 -1.00000000000000e+00 +105 0.00000000000000e+00 +106 1.00000000000000e+00 +107 0.00000000000000e+00 +108 0.00000000000000e+00 +109 1.00000000000000e+00 +110 -5.00000000000000e-01 +111 0.00000000000000e+00 +112 1.00000000000000e+00 +113 -1.00000000000000e+00 +114 0.00000000000000e+00 +115 5.00000000000000e-01 +116 0.00000000000000e+00 +117 0.00000000000000e+00 +118 5.00000000000000e-01 +119 -1.00000000000000e+00 +120 0.00000000000000e+00 +121 0.00000000000000e+00 +122 0.00000000000000e+00 +123 0.00000000000000e+00 +124 0.00000000000000e+00 +125 -5.00000000000000e-01 +126 0.00000000000000e+00 +127 0.00000000000000e+00 +128 -1.00000000000000e+00 +129 0.00000000000000e+00 +130 1.00000000000000e+00 +131 0.00000000000000e+00 +132 0.00000000000000e+00 +133 1.00000000000000e+00 +134 -5.00000000000000e-01 +135 0.00000000000000e+00 +136 1.00000000000000e+00 +137 -1.00000000000000e+00 +138 0.00000000000000e+00 +139 5.00000000000000e-01 +140 0.00000000000000e+00 +141 0.00000000000000e+00 +142 5.00000000000000e-01 +143 -1.00000000000000e+00 +144 0.00000000000000e+00 +145 0.00000000000000e+00 +146 0.00000000000000e+00 +147 0.00000000000000e+00 +148 0.00000000000000e+00 +149 -5.00000000000000e-01 +150 0.00000000000000e+00 +151 0.00000000000000e+00 +152 -1.00000000000000e+00 +153 0.00000000000000e+00 +154 1.00000000000000e+00 +155 0.00000000000000e+00 +156 0.00000000000000e+00 +157 1.00000000000000e+00 +158 -5.00000000000000e-01 +159 0.00000000000000e+00 +160 1.00000000000000e+00 +161 -1.00000000000000e+00 +162 0.00000000000000e+00 +163 5.00000000000000e-01 +164 0.00000000000000e+00 +165 0.00000000000000e+00 +166 5.00000000000000e-01 +167 -1.00000000000000e+00 +168 0.00000000000000e+00 +169 0.00000000000000e+00 +170 -5.00000000000000e-01 +171 0.00000000000000e+00 +172 5.00000000000000e-01 +173 0.00000000000000e+00 +174 0.00000000000000e+00 +175 5.00000000000000e-01 +176 -5.00000000000000e-01 +177 0.00000000000000e+00 +178 5.00000000000000e-01 +179 -1.00000000000000e+00 +180 0.00000000000000e+00 +181 5.00000000000000e-01 +182 -5.00000000000000e-01 +183 0.00000000000000e+00 +184 1.00000000000000e+00 +185 -5.00000000000000e-01 +186 0.00000000000000e+00 +187 0.00000000000000e+00 +188 -5.00000000000000e-01 +189 0.00000000000000e+00 +190 5.00000000000000e-01 +191 0.00000000000000e+00 +192 0.00000000000000e+00 +193 5.00000000000000e-01 +194 -5.00000000000000e-01 +195 0.00000000000000e+00 +196 5.00000000000000e-01 +197 -1.00000000000000e+00 +198 0.00000000000000e+00 +199 1.00000000000000e+00 +200 -5.00000000000000e-01 +201 0.00000000000000e+00 +202 0.00000000000000e+00 +203 -5.00000000000000e-01 +204 0.00000000000000e+00 +205 5.00000000000000e-01 +206 0.00000000000000e+00 +207 0.00000000000000e+00 +208 5.00000000000000e-01 +209 -5.00000000000000e-01 +210 0.00000000000000e+00 +211 5.00000000000000e-01 +212 -1.00000000000000e+00 +213 0.00000000000000e+00 +214 1.00000000000000e+00 +215 -5.00000000000000e-01 +216 0.00000000000000e+00 +217 0.00000000000000e+00 +218 -5.00000000000000e-01 +219 0.00000000000000e+00 +220 5.00000000000000e-01 +221 0.00000000000000e+00 +222 0.00000000000000e+00 +223 5.00000000000000e-01 +224 -5.00000000000000e-01 +225 0.00000000000000e+00 +226 5.00000000000000e-01 +227 -1.00000000000000e+00 +228 0.00000000000000e+00 +229 1.00000000000000e+00 +230 -5.00000000000000e-01 +231 0.00000000000000e+00 +232 5.00000000000000e-01 +233 -5.00000000000000e-01 +234 0.00000000000000e+00 +235 5.00000000000000e-01 +236 -5.00000000000000e-01 +237 0.00000000000000e+00 +238 5.00000000000000e-01 +239 -5.00000000000000e-01 +240 0.00000000000000e+00 +241 5.00000000000000e-01 +242 -5.00000000000000e-01 diff --git a/external/hypre/src/test/TEST_ij/data/beam_hex_dof459_np2/rbms.1.00001 b/external/hypre/src/test/TEST_ij/data/beam_hex_dof459_np2/rbms.1.00001 new file mode 100644 index 00000000..adc00d4d --- /dev/null +++ b/external/hypre/src/test/TEST_ij/data/beam_hex_dof459_np2/rbms.1.00001 @@ -0,0 +1,217 @@ +243 459 +243 0.00000000000000e+00 +244 0.00000000000000e+00 +245 0.00000000000000e+00 +246 0.00000000000000e+00 +247 0.00000000000000e+00 +248 0.00000000000000e+00 +249 0.00000000000000e+00 +250 0.00000000000000e+00 +251 0.00000000000000e+00 +252 0.00000000000000e+00 +253 0.00000000000000e+00 +254 0.00000000000000e+00 +255 0.00000000000000e+00 +256 0.00000000000000e+00 +257 -1.00000000000000e+00 +258 0.00000000000000e+00 +259 0.00000000000000e+00 +260 -1.00000000000000e+00 +261 0.00000000000000e+00 +262 0.00000000000000e+00 +263 -1.00000000000000e+00 +264 0.00000000000000e+00 +265 0.00000000000000e+00 +266 -1.00000000000000e+00 +267 0.00000000000000e+00 +268 1.00000000000000e+00 +269 0.00000000000000e+00 +270 0.00000000000000e+00 +271 1.00000000000000e+00 +272 0.00000000000000e+00 +273 0.00000000000000e+00 +274 1.00000000000000e+00 +275 0.00000000000000e+00 +276 0.00000000000000e+00 +277 1.00000000000000e+00 +278 0.00000000000000e+00 +279 0.00000000000000e+00 +280 1.00000000000000e+00 +281 -1.00000000000000e+00 +282 0.00000000000000e+00 +283 1.00000000000000e+00 +284 -1.00000000000000e+00 +285 0.00000000000000e+00 +286 1.00000000000000e+00 +287 -1.00000000000000e+00 +288 0.00000000000000e+00 +289 1.00000000000000e+00 +290 -1.00000000000000e+00 +291 0.00000000000000e+00 +292 0.00000000000000e+00 +293 0.00000000000000e+00 +294 0.00000000000000e+00 +295 0.00000000000000e+00 +296 -5.00000000000000e-01 +297 0.00000000000000e+00 +298 0.00000000000000e+00 +299 -1.00000000000000e+00 +300 0.00000000000000e+00 +301 1.00000000000000e+00 +302 0.00000000000000e+00 +303 0.00000000000000e+00 +304 1.00000000000000e+00 +305 -5.00000000000000e-01 +306 0.00000000000000e+00 +307 1.00000000000000e+00 +308 -1.00000000000000e+00 +309 0.00000000000000e+00 +310 5.00000000000000e-01 +311 0.00000000000000e+00 +312 0.00000000000000e+00 +313 5.00000000000000e-01 +314 -1.00000000000000e+00 +315 0.00000000000000e+00 +316 0.00000000000000e+00 +317 0.00000000000000e+00 +318 0.00000000000000e+00 +319 0.00000000000000e+00 +320 -5.00000000000000e-01 +321 0.00000000000000e+00 +322 0.00000000000000e+00 +323 -1.00000000000000e+00 +324 0.00000000000000e+00 +325 1.00000000000000e+00 +326 0.00000000000000e+00 +327 0.00000000000000e+00 +328 1.00000000000000e+00 +329 -5.00000000000000e-01 +330 0.00000000000000e+00 +331 1.00000000000000e+00 +332 -1.00000000000000e+00 +333 0.00000000000000e+00 +334 5.00000000000000e-01 +335 0.00000000000000e+00 +336 0.00000000000000e+00 +337 5.00000000000000e-01 +338 -1.00000000000000e+00 +339 0.00000000000000e+00 +340 0.00000000000000e+00 +341 0.00000000000000e+00 +342 0.00000000000000e+00 +343 0.00000000000000e+00 +344 -5.00000000000000e-01 +345 0.00000000000000e+00 +346 0.00000000000000e+00 +347 -1.00000000000000e+00 +348 0.00000000000000e+00 +349 1.00000000000000e+00 +350 0.00000000000000e+00 +351 0.00000000000000e+00 +352 1.00000000000000e+00 +353 -5.00000000000000e-01 +354 0.00000000000000e+00 +355 1.00000000000000e+00 +356 -1.00000000000000e+00 +357 0.00000000000000e+00 +358 5.00000000000000e-01 +359 0.00000000000000e+00 +360 0.00000000000000e+00 +361 5.00000000000000e-01 +362 -1.00000000000000e+00 +363 0.00000000000000e+00 +364 0.00000000000000e+00 +365 0.00000000000000e+00 +366 0.00000000000000e+00 +367 0.00000000000000e+00 +368 -5.00000000000000e-01 +369 0.00000000000000e+00 +370 0.00000000000000e+00 +371 -1.00000000000000e+00 +372 0.00000000000000e+00 +373 1.00000000000000e+00 +374 0.00000000000000e+00 +375 0.00000000000000e+00 +376 1.00000000000000e+00 +377 -5.00000000000000e-01 +378 0.00000000000000e+00 +379 1.00000000000000e+00 +380 -1.00000000000000e+00 +381 0.00000000000000e+00 +382 5.00000000000000e-01 +383 0.00000000000000e+00 +384 0.00000000000000e+00 +385 5.00000000000000e-01 +386 -1.00000000000000e+00 +387 0.00000000000000e+00 +388 0.00000000000000e+00 +389 -5.00000000000000e-01 +390 0.00000000000000e+00 +391 5.00000000000000e-01 +392 0.00000000000000e+00 +393 0.00000000000000e+00 +394 5.00000000000000e-01 +395 -5.00000000000000e-01 +396 0.00000000000000e+00 +397 5.00000000000000e-01 +398 -1.00000000000000e+00 +399 0.00000000000000e+00 +400 1.00000000000000e+00 +401 -5.00000000000000e-01 +402 0.00000000000000e+00 +403 0.00000000000000e+00 +404 -5.00000000000000e-01 +405 0.00000000000000e+00 +406 5.00000000000000e-01 +407 0.00000000000000e+00 +408 0.00000000000000e+00 +409 5.00000000000000e-01 +410 -5.00000000000000e-01 +411 0.00000000000000e+00 +412 5.00000000000000e-01 +413 -1.00000000000000e+00 +414 0.00000000000000e+00 +415 1.00000000000000e+00 +416 -5.00000000000000e-01 +417 0.00000000000000e+00 +418 0.00000000000000e+00 +419 -5.00000000000000e-01 +420 0.00000000000000e+00 +421 5.00000000000000e-01 +422 0.00000000000000e+00 +423 0.00000000000000e+00 +424 5.00000000000000e-01 +425 -5.00000000000000e-01 +426 0.00000000000000e+00 +427 5.00000000000000e-01 +428 -1.00000000000000e+00 +429 0.00000000000000e+00 +430 1.00000000000000e+00 +431 -5.00000000000000e-01 +432 0.00000000000000e+00 +433 0.00000000000000e+00 +434 -5.00000000000000e-01 +435 0.00000000000000e+00 +436 5.00000000000000e-01 +437 0.00000000000000e+00 +438 0.00000000000000e+00 +439 5.00000000000000e-01 +440 -5.00000000000000e-01 +441 0.00000000000000e+00 +442 5.00000000000000e-01 +443 -1.00000000000000e+00 +444 0.00000000000000e+00 +445 1.00000000000000e+00 +446 -5.00000000000000e-01 +447 0.00000000000000e+00 +448 5.00000000000000e-01 +449 -5.00000000000000e-01 +450 0.00000000000000e+00 +451 5.00000000000000e-01 +452 -5.00000000000000e-01 +453 0.00000000000000e+00 +454 5.00000000000000e-01 +455 -5.00000000000000e-01 +456 0.00000000000000e+00 +457 5.00000000000000e-01 +458 -5.00000000000000e-01 diff --git a/external/hypre/src/test/TEST_ij/data/beam_hex_dof459_np2/rbms.2.00000 b/external/hypre/src/test/TEST_ij/data/beam_hex_dof459_np2/rbms.2.00000 new file mode 100644 index 00000000..88ed98dc --- /dev/null +++ b/external/hypre/src/test/TEST_ij/data/beam_hex_dof459_np2/rbms.2.00000 @@ -0,0 +1,244 @@ +0 243 +0 0.00000000000000e+00 +1 0.00000000000000e+00 +2 0.00000000000000e+00 +3 0.00000000000000e+00 +4 0.00000000000000e+00 +5 1.00000000000000e+00 +6 0.00000000000000e+00 +7 0.00000000000000e+00 +8 2.00000000000000e+00 +9 0.00000000000000e+00 +10 0.00000000000000e+00 +11 3.00000000000000e+00 +12 0.00000000000000e+00 +13 0.00000000000000e+00 +14 4.00000000000000e+00 +15 0.00000000000000e+00 +16 0.00000000000000e+00 +17 0.00000000000000e+00 +18 0.00000000000000e+00 +19 0.00000000000000e+00 +20 1.00000000000000e+00 +21 0.00000000000000e+00 +22 0.00000000000000e+00 +23 2.00000000000000e+00 +24 0.00000000000000e+00 +25 0.00000000000000e+00 +26 3.00000000000000e+00 +27 0.00000000000000e+00 +28 0.00000000000000e+00 +29 4.00000000000000e+00 +30 -1.00000000000000e+00 +31 0.00000000000000e+00 +32 0.00000000000000e+00 +33 -1.00000000000000e+00 +34 0.00000000000000e+00 +35 1.00000000000000e+00 +36 -1.00000000000000e+00 +37 0.00000000000000e+00 +38 2.00000000000000e+00 +39 -1.00000000000000e+00 +40 0.00000000000000e+00 +41 3.00000000000000e+00 +42 -1.00000000000000e+00 +43 0.00000000000000e+00 +44 4.00000000000000e+00 +45 -1.00000000000000e+00 +46 0.00000000000000e+00 +47 0.00000000000000e+00 +48 -1.00000000000000e+00 +49 0.00000000000000e+00 +50 1.00000000000000e+00 +51 -1.00000000000000e+00 +52 0.00000000000000e+00 +53 2.00000000000000e+00 +54 -1.00000000000000e+00 +55 0.00000000000000e+00 +56 3.00000000000000e+00 +57 -1.00000000000000e+00 +58 0.00000000000000e+00 +59 4.00000000000000e+00 +60 0.00000000000000e+00 +61 0.00000000000000e+00 +62 5.00000000000000e-01 +63 0.00000000000000e+00 +64 0.00000000000000e+00 +65 1.00000000000000e+00 +66 0.00000000000000e+00 +67 0.00000000000000e+00 +68 5.00000000000000e-01 +69 0.00000000000000e+00 +70 0.00000000000000e+00 +71 0.00000000000000e+00 +72 -1.00000000000000e+00 +73 0.00000000000000e+00 +74 5.00000000000000e-01 +75 -1.00000000000000e+00 +76 0.00000000000000e+00 +77 1.00000000000000e+00 +78 -1.00000000000000e+00 +79 0.00000000000000e+00 +80 5.00000000000000e-01 +81 -1.00000000000000e+00 +82 0.00000000000000e+00 +83 0.00000000000000e+00 +84 -5.00000000000000e-01 +85 0.00000000000000e+00 +86 0.00000000000000e+00 +87 -5.00000000000000e-01 +88 0.00000000000000e+00 +89 1.00000000000000e+00 +90 -5.00000000000000e-01 +91 0.00000000000000e+00 +92 1.00000000000000e+00 +93 -5.00000000000000e-01 +94 0.00000000000000e+00 +95 0.00000000000000e+00 +96 0.00000000000000e+00 +97 0.00000000000000e+00 +98 1.50000000000000e+00 +99 0.00000000000000e+00 +100 0.00000000000000e+00 +101 2.00000000000000e+00 +102 0.00000000000000e+00 +103 0.00000000000000e+00 +104 1.50000000000000e+00 +105 -1.00000000000000e+00 +106 0.00000000000000e+00 +107 1.50000000000000e+00 +108 -1.00000000000000e+00 +109 0.00000000000000e+00 +110 2.00000000000000e+00 +111 -1.00000000000000e+00 +112 0.00000000000000e+00 +113 1.50000000000000e+00 +114 -5.00000000000000e-01 +115 0.00000000000000e+00 +116 2.00000000000000e+00 +117 -5.00000000000000e-01 +118 0.00000000000000e+00 +119 2.00000000000000e+00 +120 0.00000000000000e+00 +121 0.00000000000000e+00 +122 2.50000000000000e+00 +123 0.00000000000000e+00 +124 0.00000000000000e+00 +125 3.00000000000000e+00 +126 0.00000000000000e+00 +127 0.00000000000000e+00 +128 2.50000000000000e+00 +129 -1.00000000000000e+00 +130 0.00000000000000e+00 +131 2.50000000000000e+00 +132 -1.00000000000000e+00 +133 0.00000000000000e+00 +134 3.00000000000000e+00 +135 -1.00000000000000e+00 +136 0.00000000000000e+00 +137 2.50000000000000e+00 +138 -5.00000000000000e-01 +139 0.00000000000000e+00 +140 3.00000000000000e+00 +141 -5.00000000000000e-01 +142 0.00000000000000e+00 +143 3.00000000000000e+00 +144 0.00000000000000e+00 +145 0.00000000000000e+00 +146 3.50000000000000e+00 +147 0.00000000000000e+00 +148 0.00000000000000e+00 +149 4.00000000000000e+00 +150 0.00000000000000e+00 +151 0.00000000000000e+00 +152 3.50000000000000e+00 +153 -1.00000000000000e+00 +154 0.00000000000000e+00 +155 3.50000000000000e+00 +156 -1.00000000000000e+00 +157 0.00000000000000e+00 +158 4.00000000000000e+00 +159 -1.00000000000000e+00 +160 0.00000000000000e+00 +161 3.50000000000000e+00 +162 -5.00000000000000e-01 +163 0.00000000000000e+00 +164 4.00000000000000e+00 +165 -5.00000000000000e-01 +166 0.00000000000000e+00 +167 4.00000000000000e+00 +168 0.00000000000000e+00 +169 0.00000000000000e+00 +170 5.00000000000000e-01 +171 -5.00000000000000e-01 +172 0.00000000000000e+00 +173 5.00000000000000e-01 +174 -5.00000000000000e-01 +175 0.00000000000000e+00 +176 1.00000000000000e+00 +177 -5.00000000000000e-01 +178 0.00000000000000e+00 +179 5.00000000000000e-01 +180 -5.00000000000000e-01 +181 0.00000000000000e+00 +182 0.00000000000000e+00 +183 -1.00000000000000e+00 +184 0.00000000000000e+00 +185 5.00000000000000e-01 +186 0.00000000000000e+00 +187 0.00000000000000e+00 +188 1.50000000000000e+00 +189 -5.00000000000000e-01 +190 0.00000000000000e+00 +191 1.50000000000000e+00 +192 -5.00000000000000e-01 +193 0.00000000000000e+00 +194 2.00000000000000e+00 +195 -5.00000000000000e-01 +196 0.00000000000000e+00 +197 1.50000000000000e+00 +198 -1.00000000000000e+00 +199 0.00000000000000e+00 +200 1.50000000000000e+00 +201 0.00000000000000e+00 +202 0.00000000000000e+00 +203 2.50000000000000e+00 +204 -5.00000000000000e-01 +205 0.00000000000000e+00 +206 2.50000000000000e+00 +207 -5.00000000000000e-01 +208 0.00000000000000e+00 +209 3.00000000000000e+00 +210 -5.00000000000000e-01 +211 0.00000000000000e+00 +212 2.50000000000000e+00 +213 -1.00000000000000e+00 +214 0.00000000000000e+00 +215 2.50000000000000e+00 +216 0.00000000000000e+00 +217 0.00000000000000e+00 +218 3.50000000000000e+00 +219 -5.00000000000000e-01 +220 0.00000000000000e+00 +221 3.50000000000000e+00 +222 -5.00000000000000e-01 +223 0.00000000000000e+00 +224 4.00000000000000e+00 +225 -5.00000000000000e-01 +226 0.00000000000000e+00 +227 3.50000000000000e+00 +228 -1.00000000000000e+00 +229 0.00000000000000e+00 +230 3.50000000000000e+00 +231 -5.00000000000000e-01 +232 0.00000000000000e+00 +233 5.00000000000000e-01 +234 -5.00000000000000e-01 +235 0.00000000000000e+00 +236 1.50000000000000e+00 +237 -5.00000000000000e-01 +238 0.00000000000000e+00 +239 2.50000000000000e+00 +240 -5.00000000000000e-01 +241 0.00000000000000e+00 +242 3.50000000000000e+00 diff --git a/external/hypre/src/test/TEST_ij/data/beam_hex_dof459_np2/rbms.2.00001 b/external/hypre/src/test/TEST_ij/data/beam_hex_dof459_np2/rbms.2.00001 new file mode 100644 index 00000000..4c70df8a --- /dev/null +++ b/external/hypre/src/test/TEST_ij/data/beam_hex_dof459_np2/rbms.2.00001 @@ -0,0 +1,217 @@ +243 459 +243 0.00000000000000e+00 +244 0.00000000000000e+00 +245 5.00000000000000e+00 +246 0.00000000000000e+00 +247 0.00000000000000e+00 +248 6.00000000000000e+00 +249 0.00000000000000e+00 +250 0.00000000000000e+00 +251 7.00000000000000e+00 +252 0.00000000000000e+00 +253 0.00000000000000e+00 +254 8.00000000000000e+00 +255 0.00000000000000e+00 +256 0.00000000000000e+00 +257 5.00000000000000e+00 +258 0.00000000000000e+00 +259 0.00000000000000e+00 +260 6.00000000000000e+00 +261 0.00000000000000e+00 +262 0.00000000000000e+00 +263 7.00000000000000e+00 +264 0.00000000000000e+00 +265 0.00000000000000e+00 +266 8.00000000000000e+00 +267 -1.00000000000000e+00 +268 0.00000000000000e+00 +269 5.00000000000000e+00 +270 -1.00000000000000e+00 +271 0.00000000000000e+00 +272 6.00000000000000e+00 +273 -1.00000000000000e+00 +274 0.00000000000000e+00 +275 7.00000000000000e+00 +276 -1.00000000000000e+00 +277 0.00000000000000e+00 +278 8.00000000000000e+00 +279 -1.00000000000000e+00 +280 0.00000000000000e+00 +281 5.00000000000000e+00 +282 -1.00000000000000e+00 +283 0.00000000000000e+00 +284 6.00000000000000e+00 +285 -1.00000000000000e+00 +286 0.00000000000000e+00 +287 7.00000000000000e+00 +288 -1.00000000000000e+00 +289 0.00000000000000e+00 +290 8.00000000000000e+00 +291 0.00000000000000e+00 +292 0.00000000000000e+00 +293 4.50000000000000e+00 +294 0.00000000000000e+00 +295 0.00000000000000e+00 +296 5.00000000000000e+00 +297 0.00000000000000e+00 +298 0.00000000000000e+00 +299 4.50000000000000e+00 +300 -1.00000000000000e+00 +301 0.00000000000000e+00 +302 4.50000000000000e+00 +303 -1.00000000000000e+00 +304 0.00000000000000e+00 +305 5.00000000000000e+00 +306 -1.00000000000000e+00 +307 0.00000000000000e+00 +308 4.50000000000000e+00 +309 -5.00000000000000e-01 +310 0.00000000000000e+00 +311 5.00000000000000e+00 +312 -5.00000000000000e-01 +313 0.00000000000000e+00 +314 5.00000000000000e+00 +315 0.00000000000000e+00 +316 0.00000000000000e+00 +317 5.50000000000000e+00 +318 0.00000000000000e+00 +319 0.00000000000000e+00 +320 6.00000000000000e+00 +321 0.00000000000000e+00 +322 0.00000000000000e+00 +323 5.50000000000000e+00 +324 -1.00000000000000e+00 +325 0.00000000000000e+00 +326 5.50000000000000e+00 +327 -1.00000000000000e+00 +328 0.00000000000000e+00 +329 6.00000000000000e+00 +330 -1.00000000000000e+00 +331 0.00000000000000e+00 +332 5.50000000000000e+00 +333 -5.00000000000000e-01 +334 0.00000000000000e+00 +335 6.00000000000000e+00 +336 -5.00000000000000e-01 +337 0.00000000000000e+00 +338 6.00000000000000e+00 +339 0.00000000000000e+00 +340 0.00000000000000e+00 +341 6.50000000000000e+00 +342 0.00000000000000e+00 +343 0.00000000000000e+00 +344 7.00000000000000e+00 +345 0.00000000000000e+00 +346 0.00000000000000e+00 +347 6.50000000000000e+00 +348 -1.00000000000000e+00 +349 0.00000000000000e+00 +350 6.50000000000000e+00 +351 -1.00000000000000e+00 +352 0.00000000000000e+00 +353 7.00000000000000e+00 +354 -1.00000000000000e+00 +355 0.00000000000000e+00 +356 6.50000000000000e+00 +357 -5.00000000000000e-01 +358 0.00000000000000e+00 +359 7.00000000000000e+00 +360 -5.00000000000000e-01 +361 0.00000000000000e+00 +362 7.00000000000000e+00 +363 0.00000000000000e+00 +364 0.00000000000000e+00 +365 7.50000000000000e+00 +366 0.00000000000000e+00 +367 0.00000000000000e+00 +368 8.00000000000000e+00 +369 0.00000000000000e+00 +370 0.00000000000000e+00 +371 7.50000000000000e+00 +372 -1.00000000000000e+00 +373 0.00000000000000e+00 +374 7.50000000000000e+00 +375 -1.00000000000000e+00 +376 0.00000000000000e+00 +377 8.00000000000000e+00 +378 -1.00000000000000e+00 +379 0.00000000000000e+00 +380 7.50000000000000e+00 +381 -5.00000000000000e-01 +382 0.00000000000000e+00 +383 8.00000000000000e+00 +384 -5.00000000000000e-01 +385 0.00000000000000e+00 +386 8.00000000000000e+00 +387 0.00000000000000e+00 +388 0.00000000000000e+00 +389 4.50000000000000e+00 +390 -5.00000000000000e-01 +391 0.00000000000000e+00 +392 4.50000000000000e+00 +393 -5.00000000000000e-01 +394 0.00000000000000e+00 +395 5.00000000000000e+00 +396 -5.00000000000000e-01 +397 0.00000000000000e+00 +398 4.50000000000000e+00 +399 -1.00000000000000e+00 +400 0.00000000000000e+00 +401 4.50000000000000e+00 +402 0.00000000000000e+00 +403 0.00000000000000e+00 +404 5.50000000000000e+00 +405 -5.00000000000000e-01 +406 0.00000000000000e+00 +407 5.50000000000000e+00 +408 -5.00000000000000e-01 +409 0.00000000000000e+00 +410 6.00000000000000e+00 +411 -5.00000000000000e-01 +412 0.00000000000000e+00 +413 5.50000000000000e+00 +414 -1.00000000000000e+00 +415 0.00000000000000e+00 +416 5.50000000000000e+00 +417 0.00000000000000e+00 +418 0.00000000000000e+00 +419 6.50000000000000e+00 +420 -5.00000000000000e-01 +421 0.00000000000000e+00 +422 6.50000000000000e+00 +423 -5.00000000000000e-01 +424 0.00000000000000e+00 +425 7.00000000000000e+00 +426 -5.00000000000000e-01 +427 0.00000000000000e+00 +428 6.50000000000000e+00 +429 -1.00000000000000e+00 +430 0.00000000000000e+00 +431 6.50000000000000e+00 +432 0.00000000000000e+00 +433 0.00000000000000e+00 +434 7.50000000000000e+00 +435 -5.00000000000000e-01 +436 0.00000000000000e+00 +437 7.50000000000000e+00 +438 -5.00000000000000e-01 +439 0.00000000000000e+00 +440 8.00000000000000e+00 +441 -5.00000000000000e-01 +442 0.00000000000000e+00 +443 7.50000000000000e+00 +444 -1.00000000000000e+00 +445 0.00000000000000e+00 +446 7.50000000000000e+00 +447 -5.00000000000000e-01 +448 0.00000000000000e+00 +449 4.50000000000000e+00 +450 -5.00000000000000e-01 +451 0.00000000000000e+00 +452 5.50000000000000e+00 +453 -5.00000000000000e-01 +454 0.00000000000000e+00 +455 6.50000000000000e+00 +456 -5.00000000000000e-01 +457 0.00000000000000e+00 +458 7.50000000000000e+00 diff --git a/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/A.IJ.00000 b/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/A.IJ.00000 new file mode 100644 index 00000000..7112b3f6 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/A.IJ.00000 @@ -0,0 +1,20224 @@ +0 674 0 674 +0 0 1.70833333333333e+01 +0 152 2.12500000000000e+00 +0 1 -4.16666666666667e+00 +0 139 2.12500000000000e+00 +0 138 -2.16666666666667e+00 +0 2 -4.16666666666667e+00 +0 146 2.12500000000000e+00 +0 145 -2.08333333333333e+00 +0 151 2.12500000000000e+00 +0 140 -2.08333333333333e+00 +0 144 -2.16666666666667e+00 +0 143 4.16666666666667e-02 +0 155 -8.33333333333333e-02 +0 136 4.16666666666667e-02 +0 142 -8.33333333333333e-02 +0 137 4.16666666666667e-02 +0 148 4.16666666666667e-02 +0 154 -8.33333333333333e-02 +0 135 -2.50000000000000e-01 +0 149 -8.33333333333333e-02 +0 1429 2.08333333333333e+00 +0 1430 2.08333333333333e+00 +0 1428 -1.25000000000000e+01 +1 1 1.29166666666667e+01 +1 139 -6.50000000000000e+00 +1 0 -4.16666666666667e+00 +1 138 2.12500000000000e+00 +1 146 2.12500000000000e+00 +1 152 -4.25000000000000e+00 +1 140 2.12500000000000e+00 +1 145 -2.16666666666667e+00 +1 144 -2.08333333333333e+00 +1 150 2.12500000000000e+00 +1 135 4.16666666666667e-02 +1 141 -8.33333333333333e-02 +1 136 -8.33333333333333e-02 +1 147 4.16666666666667e-02 +1 153 -8.33333333333333e-02 +1 149 4.16666666666667e-02 +1 155 -8.33333333333333e-02 +1 143 4.16666666666667e-02 +1 1428 2.08333333333333e+00 +1 1429 -4.16666666666667e+00 +2 2 1.29166666666667e+01 +2 139 2.12500000000000e+00 +2 138 -2.08333333333333e+00 +2 150 2.12500000000000e+00 +2 140 -2.16666666666667e+00 +2 146 -6.50000000000000e+00 +2 145 2.12500000000000e+00 +2 151 -4.25000000000000e+00 +2 0 -4.16666666666667e+00 +2 144 2.12500000000000e+00 +2 141 4.16666666666667e-02 +2 153 -8.33333333333333e-02 +2 137 -8.33333333333333e-02 +2 135 4.16666666666667e-02 +2 142 4.16666666666667e-02 +2 148 4.16666666666667e-02 +2 154 -8.33333333333333e-02 +2 147 -8.33333333333333e-02 +2 1430 -4.16666666666667e+00 +2 1428 2.08333333333333e+00 +3 3 7.50000000000000e-01 +3 179 -8.33333333333333e-02 +3 160 4.16666666666667e-02 +3 166 -8.33333333333333e-02 +3 161 4.16666666666667e-02 +3 172 4.16666666666667e-02 +3 178 -8.33333333333333e-02 +3 159 -2.50000000000000e-01 +3 173 -8.33333333333333e-02 +3 164 -4.16666666666667e-02 +3 176 8.33333333333333e-02 +3 4 -8.33333333333333e-02 +3 163 8.33333333333333e-02 +3 157 4.16666666666667e-02 +3 162 -1.25000000000000e-01 +3 5 -8.33333333333333e-02 +3 170 8.33333333333333e-02 +3 158 4.16666666666667e-02 +3 169 -4.16666666666667e-02 +3 175 8.33333333333333e-02 +3 167 4.16666666666667e-02 +3 168 -1.25000000000000e-01 +3 156 -2.50000000000000e-01 +4 4 6.66666666666667e-01 +4 159 4.16666666666667e-02 +4 165 -8.33333333333333e-02 +4 160 -8.33333333333333e-02 +4 171 4.16666666666667e-02 +4 177 -8.33333333333333e-02 +4 173 4.16666666666667e-02 +4 179 -8.33333333333333e-02 +4 164 8.33333333333333e-02 +4 163 -3.75000000000000e-01 +4 3 -8.33333333333333e-02 +4 162 8.33333333333333e-02 +4 156 4.16666666666667e-02 +4 170 8.33333333333333e-02 +4 176 -1.66666666666667e-01 +4 167 4.16666666666667e-02 +4 169 -1.25000000000000e-01 +4 157 -8.33333333333333e-02 +4 168 -4.16666666666667e-02 +4 174 8.33333333333333e-02 +5 5 6.66666666666667e-01 +5 165 4.16666666666667e-02 +5 177 -8.33333333333333e-02 +5 161 -8.33333333333333e-02 +5 159 4.16666666666667e-02 +5 172 4.16666666666667e-02 +5 178 -8.33333333333333e-02 +5 171 -8.33333333333333e-02 +5 164 -1.25000000000000e-01 +5 163 8.33333333333333e-02 +5 162 -4.16666666666667e-02 +5 174 8.33333333333333e-02 +5 166 4.16666666666667e-02 +5 170 -3.75000000000000e-01 +5 158 -8.33333333333333e-02 +5 169 8.33333333333333e-02 +5 175 -1.66666666666667e-01 +5 3 -8.33333333333333e-02 +5 168 8.33333333333333e-02 +5 156 4.16666666666667e-02 +6 6 7.50000000000000e-01 +6 190 8.33333333333333e-02 +6 183 -1.25000000000000e-01 +6 191 8.33333333333333e-02 +6 188 8.33333333333333e-02 +6 186 -1.25000000000000e-01 +6 184 8.33333333333333e-02 +6 7 -8.33333333333333e-02 +6 181 4.16666666666667e-02 +6 8 -8.33333333333333e-02 +6 182 4.16666666666667e-02 +6 187 -4.16666666666667e-02 +6 185 -4.16666666666667e-02 +6 180 -2.50000000000000e-01 +6 788 4.16666666666667e-02 +6 794 -8.33333333333333e-02 +6 784 4.16666666666667e-02 +6 787 -8.33333333333333e-02 +6 785 4.16666666666667e-02 +6 790 4.16666666666667e-02 +6 793 -8.33333333333333e-02 +6 783 -2.50000000000000e-01 +6 791 -8.33333333333333e-02 +7 7 6.66666666666667e-01 +7 183 8.33333333333333e-02 +7 185 8.33333333333333e-02 +7 184 -3.75000000000000e-01 +7 189 8.33333333333333e-02 +7 191 -1.66666666666667e-01 +7 188 8.33333333333333e-02 +7 187 -1.25000000000000e-01 +7 6 -8.33333333333333e-02 +7 180 4.16666666666667e-02 +7 181 -8.33333333333333e-02 +7 186 -4.16666666666667e-02 +7 783 4.16666666666667e-02 +7 786 -8.33333333333333e-02 +7 784 -8.33333333333333e-02 +7 789 4.16666666666667e-02 +7 792 -8.33333333333333e-02 +7 791 4.16666666666667e-02 +7 794 -8.33333333333333e-02 +7 788 4.16666666666667e-02 +8 8 6.66666666666667e-01 +8 185 -1.25000000000000e-01 +8 184 8.33333333333333e-02 +8 190 -1.66666666666667e-01 +8 187 8.33333333333333e-02 +8 189 8.33333333333333e-02 +8 188 -3.75000000000000e-01 +8 186 8.33333333333333e-02 +8 183 -4.16666666666667e-02 +8 182 -8.33333333333333e-02 +8 6 -8.33333333333333e-02 +8 180 4.16666666666667e-02 +8 786 4.16666666666667e-02 +8 792 -8.33333333333333e-02 +8 785 -8.33333333333333e-02 +8 783 4.16666666666667e-02 +8 787 4.16666666666667e-02 +8 790 4.16666666666667e-02 +8 793 -8.33333333333333e-02 +8 789 -8.33333333333333e-02 +9 9 1.27500000000000e+01 +9 200 2.12500000000000e+00 +9 194 -2.08333333333333e+00 +9 193 2.12500000000000e+00 +9 192 -2.16666666666667e+00 +9 11 -4.16666666666667e+00 +9 198 -4.20833333333333e+00 +9 196 4.16666666666667e-02 +9 10 -8.33333333333333e-02 +9 195 -1.25000000000000e-01 +9 203 -8.33333333333333e-02 +9 199 -4.16666666666667e-02 +9 202 4.16666666666667e-02 +9 197 4.16666666666667e-02 +9 1466 2.08333333333333e+00 +9 1465 2.08333333333333e+00 +9 1464 -6.25000000000000e+00 +9 1463 2.08333333333333e+00 +9 1462 -4.16666666666667e+00 +10 10 1.28333333333333e+01 +10 194 2.12500000000000e+00 +10 11 -4.25000000000000e+00 +10 200 2.12500000000000e+00 +10 193 -6.50000000000000e+00 +10 199 -4.20833333333333e+00 +10 192 2.12500000000000e+00 +10 203 4.16666666666667e-02 +10 196 -4.16666666666667e-02 +10 195 4.16666666666667e-02 +10 9 -8.33333333333333e-02 +10 197 -4.16666666666667e-02 +10 198 -4.16666666666667e-02 +10 201 4.16666666666667e-02 +10 1463 2.08333333333333e+00 +10 1465 -2.08333333333333e+00 +10 1464 2.08333333333333e+00 +10 1466 -2.08333333333333e+00 +10 1461 -4.16666666666667e+00 +11 11 1.69166666666667e+01 +11 9 -4.16666666666667e+00 +11 198 2.12500000000000e+00 +11 194 -2.16666666666667e+00 +11 200 -1.26250000000000e+01 +11 193 2.12500000000000e+00 +11 10 -4.25000000000000e+00 +11 199 2.12500000000000e+00 +11 192 -2.08333333333333e+00 +11 196 -4.16666666666667e-02 +11 202 4.16666666666667e-02 +11 195 4.16666666666667e-02 +11 197 -4.16666666666667e-02 +11 201 -8.33333333333333e-02 +11 1465 -2.08333333333333e+00 +11 1462 2.08333333333333e+00 +11 1464 2.08333333333333e+00 +11 1466 -2.08333333333333e+00 +11 1461 2.08333333333333e+00 +12 12 5.00000000000000e-01 +12 214 4.16666666666667e-02 +12 13 -8.33333333333333e-02 +12 213 -1.25000000000000e-01 +12 221 -8.33333333333333e-02 +12 217 -4.16666666666667e-02 +12 220 4.16666666666667e-02 +12 14 -8.33333333333333e-02 +12 212 4.16666666666667e-02 +12 218 8.33333333333333e-02 +12 211 4.16666666666667e-02 +12 210 -1.25000000000000e-01 +12 209 -4.16666666666667e-02 +12 206 4.16666666666667e-02 +12 208 8.33333333333333e-02 +12 205 -8.33333333333333e-02 +12 207 -1.25000000000000e-01 +12 215 4.16666666666667e-02 +12 216 -1.25000000000000e-01 +13 13 5.83333333333333e-01 +13 221 4.16666666666667e-02 +13 214 -4.16666666666667e-02 +13 213 4.16666666666667e-02 +13 12 -8.33333333333333e-02 +13 216 -4.16666666666667e-02 +13 219 4.16666666666667e-02 +13 212 -4.16666666666667e-02 +13 206 4.16666666666667e-02 +13 211 -4.16666666666667e-02 +13 210 4.16666666666667e-02 +13 209 8.33333333333333e-02 +13 14 -1.66666666666667e-01 +13 218 8.33333333333333e-02 +13 208 -3.75000000000000e-01 +13 215 -4.16666666666667e-02 +13 217 -1.25000000000000e-01 +13 207 8.33333333333333e-02 +13 204 -8.33333333333333e-02 +14 14 5.83333333333333e-01 +14 214 -4.16666666666667e-02 +14 220 4.16666666666667e-02 +14 213 4.16666666666667e-02 +14 219 -8.33333333333333e-02 +14 212 -4.16666666666667e-02 +14 211 -4.16666666666667e-02 +14 205 4.16666666666667e-02 +14 12 -8.33333333333333e-02 +14 210 4.16666666666667e-02 +14 216 8.33333333333333e-02 +14 209 -1.25000000000000e-01 +14 215 -4.16666666666667e-02 +14 218 -3.75000000000000e-01 +14 208 8.33333333333333e-02 +14 13 -1.66666666666667e-01 +14 217 8.33333333333333e-02 +14 207 -4.16666666666667e-02 +14 204 4.16666666666667e-02 +15 15 5.00000000000000e-01 +15 16 -8.33333333333333e-02 +15 226 8.33333333333333e-02 +15 233 8.33333333333333e-02 +15 232 -4.16666666666667e-02 +15 231 -1.25000000000000e-01 +15 225 -1.25000000000000e-01 +15 230 4.16666666666667e-02 +15 229 4.16666666666667e-02 +15 228 -1.25000000000000e-01 +15 227 -4.16666666666667e-02 +15 224 4.16666666666667e-02 +15 223 -8.33333333333333e-02 +15 17 -8.33333333333333e-02 +15 832 4.16666666666667e-02 +15 831 -1.25000000000000e-01 +15 836 -8.33333333333333e-02 +15 835 4.16666666666667e-02 +15 833 4.16666666666667e-02 +16 16 5.83333333333333e-01 +16 15 -8.33333333333333e-02 +16 225 8.33333333333333e-02 +16 233 8.33333333333333e-02 +16 17 -1.66666666666667e-01 +16 227 8.33333333333333e-02 +16 232 -1.25000000000000e-01 +16 226 -3.75000000000000e-01 +16 231 -4.16666666666667e-02 +16 224 4.16666666666667e-02 +16 229 -4.16666666666667e-02 +16 228 4.16666666666667e-02 +16 230 -4.16666666666667e-02 +16 222 -8.33333333333333e-02 +16 836 4.16666666666667e-02 +16 832 -4.16666666666667e-02 +16 831 4.16666666666667e-02 +16 833 -4.16666666666667e-02 +16 834 4.16666666666667e-02 +17 17 5.83333333333333e-01 +17 233 -3.75000000000000e-01 +17 227 -1.25000000000000e-01 +17 232 8.33333333333333e-02 +17 16 -1.66666666666667e-01 +17 226 8.33333333333333e-02 +17 231 8.33333333333333e-02 +17 229 -4.16666666666667e-02 +17 223 4.16666666666667e-02 +17 15 -8.33333333333333e-02 +17 228 4.16666666666667e-02 +17 230 -4.16666666666667e-02 +17 225 -4.16666666666667e-02 +17 222 4.16666666666667e-02 +17 832 -4.16666666666667e-02 +17 835 4.16666666666667e-02 +17 831 4.16666666666667e-02 +17 833 -4.16666666666667e-02 +17 834 -8.33333333333333e-02 +18 18 1.27500000000000e+01 +18 235 -2.08333333333333e+00 +18 234 -2.16666666666667e+00 +18 19 -4.16666666666667e+00 +18 241 2.12500000000000e+00 +18 236 2.12500000000000e+00 +18 240 -4.20833333333333e+00 +18 245 4.16666666666667e-02 +18 20 -8.33333333333333e-02 +18 239 4.16666666666667e-02 +18 238 4.16666666666667e-02 +18 244 -8.33333333333333e-02 +18 242 -4.16666666666667e-02 +18 237 -1.25000000000000e-01 +18 1498 2.08333333333333e+00 +18 1502 2.08333333333333e+00 +18 1499 -4.16666666666667e+00 +18 1501 2.08333333333333e+00 +18 1500 -6.25000000000000e+00 +19 19 1.69166666666667e+01 +19 20 -4.25000000000000e+00 +19 242 2.12500000000000e+00 +19 235 -2.16666666666667e+00 +19 234 -2.08333333333333e+00 +19 236 2.12500000000000e+00 +19 241 -1.26250000000000e+01 +19 18 -4.16666666666667e+00 +19 240 2.12500000000000e+00 +19 239 -4.16666666666667e-02 +19 245 4.16666666666667e-02 +19 238 -4.16666666666667e-02 +19 237 4.16666666666667e-02 +19 243 -8.33333333333333e-02 +19 1497 2.08333333333333e+00 +19 1502 -2.08333333333333e+00 +19 1499 2.08333333333333e+00 +19 1501 -2.08333333333333e+00 +19 1500 2.08333333333333e+00 +20 20 1.28333333333333e+01 +20 235 2.12500000000000e+00 +20 19 -4.25000000000000e+00 +20 241 2.12500000000000e+00 +20 234 2.12500000000000e+00 +20 236 -6.50000000000000e+00 +20 242 -4.20833333333333e+00 +20 240 -4.16666666666667e-02 +20 243 4.16666666666667e-02 +20 239 -4.16666666666667e-02 +20 238 -4.16666666666667e-02 +20 244 4.16666666666667e-02 +20 18 -8.33333333333333e-02 +20 237 4.16666666666667e-02 +20 1502 -2.08333333333333e+00 +20 1501 -2.08333333333333e+00 +20 1498 2.08333333333333e+00 +20 1500 2.08333333333333e+00 +20 1497 -4.16666666666667e+00 +21 21 5.00000000000000e-01 +21 263 4.16666666666667e-02 +21 23 -8.33333333333333e-02 +21 257 4.16666666666667e-02 +21 256 4.16666666666667e-02 +21 262 -8.33333333333333e-02 +21 255 -1.25000000000000e-01 +21 251 8.33333333333333e-02 +21 250 -4.16666666666667e-02 +21 247 4.16666666666667e-02 +21 249 -1.25000000000000e-01 +21 254 4.16666666666667e-02 +21 248 -8.33333333333333e-02 +21 253 4.16666666666667e-02 +21 22 -8.33333333333333e-02 +21 259 8.33333333333333e-02 +21 252 -1.25000000000000e-01 +21 260 -4.16666666666667e-02 +21 258 -1.25000000000000e-01 +22 22 5.83333333333333e-01 +22 263 4.16666666666667e-02 +22 256 -4.16666666666667e-02 +22 255 4.16666666666667e-02 +22 261 -8.33333333333333e-02 +22 251 8.33333333333333e-02 +22 23 -1.66666666666667e-01 +22 260 8.33333333333333e-02 +22 250 -1.25000000000000e-01 +22 249 -4.16666666666667e-02 +22 246 4.16666666666667e-02 +22 254 -4.16666666666667e-02 +22 248 4.16666666666667e-02 +22 253 -4.16666666666667e-02 +22 257 -4.16666666666667e-02 +22 259 -3.75000000000000e-01 +22 252 4.16666666666667e-02 +22 21 -8.33333333333333e-02 +22 258 8.33333333333333e-02 +23 23 5.83333333333333e-01 +23 261 4.16666666666667e-02 +23 257 -4.16666666666667e-02 +23 256 -4.16666666666667e-02 +23 262 4.16666666666667e-02 +23 21 -8.33333333333333e-02 +23 255 4.16666666666667e-02 +23 251 -3.75000000000000e-01 +23 250 8.33333333333333e-02 +23 22 -1.66666666666667e-01 +23 259 8.33333333333333e-02 +23 249 8.33333333333333e-02 +23 254 -4.16666666666667e-02 +23 258 -4.16666666666667e-02 +23 260 -1.25000000000000e-01 +23 253 -4.16666666666667e-02 +23 247 4.16666666666667e-02 +23 252 4.16666666666667e-02 +23 246 -8.33333333333333e-02 +24 24 5.00000000000000e-01 +24 274 8.33333333333333e-02 +24 273 -1.25000000000000e-01 +24 26 -8.33333333333333e-02 +24 269 8.33333333333333e-02 +24 275 -4.16666666666667e-02 +24 267 -1.25000000000000e-01 +24 268 -4.16666666666667e-02 +24 265 4.16666666666667e-02 +24 272 4.16666666666667e-02 +24 266 -8.33333333333333e-02 +24 271 4.16666666666667e-02 +24 25 -8.33333333333333e-02 +24 270 -1.25000000000000e-01 +24 872 4.16666666666667e-02 +24 869 4.16666666666667e-02 +24 868 4.16666666666667e-02 +24 871 -8.33333333333333e-02 +24 867 -1.25000000000000e-01 +25 25 5.83333333333333e-01 +25 26 -1.66666666666667e-01 +25 269 8.33333333333333e-02 +25 274 -3.75000000000000e-01 +25 273 8.33333333333333e-02 +25 275 8.33333333333333e-02 +25 268 -1.25000000000000e-01 +25 267 -4.16666666666667e-02 +25 264 4.16666666666667e-02 +25 272 -4.16666666666667e-02 +25 266 4.16666666666667e-02 +25 271 -4.16666666666667e-02 +25 270 4.16666666666667e-02 +25 24 -8.33333333333333e-02 +25 869 -4.16666666666667e-02 +25 872 4.16666666666667e-02 +25 868 -4.16666666666667e-02 +25 867 4.16666666666667e-02 +25 870 -8.33333333333333e-02 +26 26 5.83333333333333e-01 +26 274 8.33333333333333e-02 +26 25 -1.66666666666667e-01 +26 268 8.33333333333333e-02 +26 273 -4.16666666666667e-02 +26 275 -1.25000000000000e-01 +26 269 -3.75000000000000e-01 +26 24 -8.33333333333333e-02 +26 267 8.33333333333333e-02 +26 272 -4.16666666666667e-02 +26 271 -4.16666666666667e-02 +26 265 4.16666666666667e-02 +26 270 4.16666666666667e-02 +26 264 -8.33333333333333e-02 +26 870 4.16666666666667e-02 +26 869 -4.16666666666667e-02 +26 868 -4.16666666666667e-02 +26 871 4.16666666666667e-02 +26 867 4.16666666666667e-02 +27 27 2.11666666666667e+01 +27 278 2.12500000000000e+00 +27 279 -4.20833333333333e+00 +27 277 2.12500000000000e+00 +27 283 2.12500000000000e+00 +27 282 -4.20833333333333e+00 +27 281 2.12500000000000e+00 +27 287 4.16666666666667e-02 +27 280 -4.16666666666667e-02 +27 284 -4.16666666666667e-02 +27 28 -8.33333333333333e-02 +27 286 4.16666666666667e-02 +27 29 -8.33333333333333e-02 +27 285 -2.50000000000000e-01 +27 1550 2.08333333333333e+00 +27 1544 -4.16666666666667e+00 +27 1543 2.08333333333333e+00 +27 1547 2.08333333333333e+00 +27 1549 2.08333333333333e+00 +27 1548 -1.25000000000000e+01 +27 1541 -4.16666666666667e+00 +27 1540 -4.16666666666667e+00 +27 1546 -4.16666666666667e+00 +28 28 2.10833333333333e+01 +28 281 2.12500000000000e+00 +28 280 -4.20833333333333e+00 +28 278 -4.25000000000000e+00 +28 284 2.12500000000000e+00 +28 276 2.12500000000000e+00 +28 283 -1.26250000000000e+01 +28 282 2.12500000000000e+00 +28 279 -4.16666666666667e-02 +28 286 -8.33333333333333e-02 +28 27 -8.33333333333333e-02 +28 285 4.16666666666667e-02 +28 1542 2.08333333333333e+00 +28 1549 -4.16666666666667e+00 +28 1548 2.08333333333333e+00 +28 1539 -4.16666666666667e+00 +28 1547 2.08333333333333e+00 +28 1541 -4.16666666666667e+00 +28 1544 2.08333333333333e+00 +28 1545 -4.16666666666667e+00 +29 29 2.10833333333333e+01 +29 279 2.12500000000000e+00 +29 281 -1.26250000000000e+01 +29 280 2.12500000000000e+00 +29 276 2.12500000000000e+00 +29 277 -4.25000000000000e+00 +29 283 2.12500000000000e+00 +29 284 -4.20833333333333e+00 +29 27 -8.33333333333333e-02 +29 285 4.16666666666667e-02 +29 287 -8.33333333333333e-02 +29 282 -4.16666666666667e-02 +29 1548 2.08333333333333e+00 +29 1542 -4.16666666666667e+00 +29 1550 -4.16666666666667e+00 +29 1545 2.08333333333333e+00 +29 1539 -4.16666666666667e+00 +29 1543 2.08333333333333e+00 +29 1546 2.08333333333333e+00 +29 1540 -4.16666666666667e+00 +30 30 7.50000000000000e-01 +30 311 4.16666666666667e-02 +30 298 -4.16666666666667e-02 +30 305 -4.16666666666667e-02 +30 31 -8.33333333333333e-02 +30 310 4.16666666666667e-02 +30 309 -2.50000000000000e-01 +30 299 8.33333333333333e-02 +30 308 4.16666666666667e-02 +30 296 -8.33333333333333e-02 +30 295 4.16666666666667e-02 +30 302 4.16666666666667e-02 +30 307 4.16666666666667e-02 +30 306 -2.50000000000000e-01 +30 293 8.33333333333333e-02 +30 290 -8.33333333333333e-02 +30 297 -1.25000000000000e-01 +30 292 8.33333333333333e-02 +30 289 -8.33333333333333e-02 +30 301 -8.33333333333333e-02 +30 304 8.33333333333333e-02 +30 303 -1.25000000000000e-01 +30 32 -8.33333333333333e-02 +31 31 6.66666666666667e-01 +31 310 -8.33333333333333e-02 +31 30 -8.33333333333333e-02 +31 309 4.16666666666667e-02 +31 296 4.16666666666667e-02 +31 294 4.16666666666667e-02 +31 307 -8.33333333333333e-02 +31 306 4.16666666666667e-02 +31 299 8.33333333333333e-02 +31 298 -1.25000000000000e-01 +31 293 -1.66666666666667e-01 +31 305 8.33333333333333e-02 +31 291 8.33333333333333e-02 +31 288 -8.33333333333333e-02 +31 302 4.16666666666667e-02 +31 290 -8.33333333333333e-02 +31 304 -3.75000000000000e-01 +31 297 -4.16666666666667e-02 +31 300 -8.33333333333333e-02 +31 303 8.33333333333333e-02 +32 32 6.66666666666667e-01 +32 309 4.16666666666667e-02 +32 311 -8.33333333333333e-02 +32 303 -4.16666666666667e-02 +32 295 4.16666666666667e-02 +32 297 8.33333333333333e-02 +32 306 4.16666666666667e-02 +32 294 -8.33333333333333e-02 +32 308 -8.33333333333333e-02 +32 300 4.16666666666667e-02 +32 299 -3.75000000000000e-01 +32 298 8.33333333333333e-02 +32 291 8.33333333333333e-02 +32 288 -8.33333333333333e-02 +32 292 -1.66666666666667e-01 +32 304 8.33333333333333e-02 +32 305 -1.25000000000000e-01 +32 30 -8.33333333333333e-02 +32 301 4.16666666666667e-02 +32 289 -8.33333333333333e-02 +33 33 7.50000000000000e-01 +33 323 8.33333333333333e-02 +33 322 -4.16666666666667e-02 +33 316 8.33333333333333e-02 +33 321 -1.25000000000000e-01 +33 329 -4.16666666666667e-02 +33 317 8.33333333333333e-02 +33 34 -8.33333333333333e-02 +33 328 8.33333333333333e-02 +33 35 -8.33333333333333e-02 +33 327 -1.25000000000000e-01 +33 332 4.16666666666667e-02 +33 320 -8.33333333333333e-02 +33 319 4.16666666666667e-02 +33 326 4.16666666666667e-02 +33 331 4.16666666666667e-02 +33 330 -2.50000000000000e-01 +33 314 -8.33333333333333e-02 +33 313 -8.33333333333333e-02 +33 325 -8.33333333333333e-02 +33 905 4.16666666666667e-02 +33 904 4.16666666666667e-02 +33 903 -2.50000000000000e-01 +34 34 6.66666666666667e-01 +34 322 -1.25000000000000e-01 +34 321 -4.16666666666667e-02 +34 315 8.33333333333333e-02 +34 329 8.33333333333333e-02 +34 317 -1.66666666666667e-01 +34 323 8.33333333333333e-02 +34 328 -3.75000000000000e-01 +34 33 -8.33333333333333e-02 +34 327 8.33333333333333e-02 +34 318 4.16666666666667e-02 +34 331 -8.33333333333333e-02 +34 330 4.16666666666667e-02 +34 312 -8.33333333333333e-02 +34 326 4.16666666666667e-02 +34 314 -8.33333333333333e-02 +34 320 4.16666666666667e-02 +34 324 -8.33333333333333e-02 +34 904 -8.33333333333333e-02 +34 903 4.16666666666667e-02 +35 35 6.66666666666667e-01 +35 322 8.33333333333333e-02 +35 33 -8.33333333333333e-02 +35 321 8.33333333333333e-02 +35 323 -3.75000000000000e-01 +35 329 -1.25000000000000e-01 +35 328 8.33333333333333e-02 +35 316 -1.66666666666667e-01 +35 327 -4.16666666666667e-02 +35 315 8.33333333333333e-02 +35 330 4.16666666666667e-02 +35 318 -8.33333333333333e-02 +35 332 -8.33333333333333e-02 +35 324 4.16666666666667e-02 +35 312 -8.33333333333333e-02 +35 319 4.16666666666667e-02 +35 325 4.16666666666667e-02 +35 313 -8.33333333333333e-02 +35 903 4.16666666666667e-02 +35 905 -8.33333333333333e-02 +36 36 7.50000000000000e-01 +36 157 4.16666666666667e-02 +36 343 -8.33333333333333e-02 +36 335 -4.16666666666667e-02 +36 37 -8.33333333333333e-02 +36 334 8.33333333333333e-02 +36 136 4.16666666666667e-02 +36 333 -1.25000000000000e-01 +36 350 -8.33333333333333e-02 +36 341 8.33333333333333e-02 +36 158 4.16666666666667e-02 +36 347 -8.33333333333333e-02 +36 346 4.16666666666667e-02 +36 349 -8.33333333333333e-02 +36 156 -2.50000000000000e-01 +36 38 -8.33333333333333e-02 +36 338 8.33333333333333e-02 +36 137 4.16666666666667e-02 +36 337 -4.16666666666667e-02 +36 340 8.33333333333333e-02 +36 344 4.16666666666667e-02 +36 336 -1.25000000000000e-01 +36 135 -2.50000000000000e-01 +37 37 6.66666666666667e-01 +37 156 4.16666666666667e-02 +37 342 -8.33333333333333e-02 +37 335 8.33333333333333e-02 +37 334 -3.75000000000000e-01 +37 36 -8.33333333333333e-02 +37 333 8.33333333333333e-02 +37 135 4.16666666666667e-02 +37 347 4.16666666666667e-02 +37 350 -8.33333333333333e-02 +37 157 -8.33333333333333e-02 +37 345 4.16666666666667e-02 +37 348 -8.33333333333333e-02 +37 338 8.33333333333333e-02 +37 341 -1.66666666666667e-01 +37 344 4.16666666666667e-02 +37 337 -1.25000000000000e-01 +37 136 -8.33333333333333e-02 +37 336 -4.16666666666667e-02 +37 339 8.33333333333333e-02 +38 38 6.66666666666667e-01 +38 342 4.16666666666667e-02 +38 335 -1.25000000000000e-01 +38 334 8.33333333333333e-02 +38 333 -4.16666666666667e-02 +38 346 4.16666666666667e-02 +38 349 -8.33333333333333e-02 +38 348 -8.33333333333333e-02 +38 339 8.33333333333333e-02 +38 158 -8.33333333333333e-02 +38 156 4.16666666666667e-02 +38 345 -8.33333333333333e-02 +38 343 4.16666666666667e-02 +38 338 -3.75000000000000e-01 +38 137 -8.33333333333333e-02 +38 337 8.33333333333333e-02 +38 340 -1.66666666666667e-01 +38 36 -8.33333333333333e-02 +38 336 8.33333333333333e-02 +38 135 4.16666666666667e-02 +39 39 2.98333333333333e+01 +39 41 -8.33333333333333e+00 +39 356 4.25000000000000e+00 +39 364 2.12500000000000e+00 +39 355 -2.12500000000000e+00 +39 140 -2.08333333333333e+00 +39 139 2.12500000000000e+00 +39 138 -2.16666666666667e+00 +39 354 -6.37500000000000e+00 +39 194 -2.08333333333333e+00 +39 365 2.12500000000000e+00 +39 40 -4.25000000000000e+00 +39 193 2.12500000000000e+00 +39 192 -2.16666666666667e+00 +39 361 -8.33333333333333e-02 +39 353 8.33333333333333e-02 +39 352 8.33333333333333e-02 +39 351 -3.75000000000000e-01 +39 368 -8.33333333333333e-02 +39 367 -8.33333333333333e-02 +39 359 -1.66666666666667e-01 +39 358 8.33333333333333e-02 +39 362 4.16666666666667e-02 +39 1688 2.08333333333333e+00 +39 1687 -4.16666666666667e+00 +39 1717 4.16666666666667e+00 +39 1718 4.16666666666667e+00 +39 1716 -1.87500000000000e+01 +40 40 2.57500000000000e+01 +40 363 2.12500000000000e+00 +40 354 -2.12500000000000e+00 +40 140 2.12500000000000e+00 +40 41 -4.25000000000000e+00 +40 356 4.25000000000000e+00 +40 139 -6.50000000000000e+00 +40 355 -6.37500000000000e+00 +40 138 2.12500000000000e+00 +40 194 2.12500000000000e+00 +40 365 -4.25000000000000e+00 +40 193 -6.50000000000000e+00 +40 39 -4.25000000000000e+00 +40 192 2.12500000000000e+00 +40 360 -8.33333333333333e-02 +40 353 -4.16666666666667e-02 +40 352 -1.25000000000000e-01 +40 351 8.33333333333333e-02 +40 368 -8.33333333333333e-02 +40 359 8.33333333333333e-02 +40 366 -8.33333333333333e-02 +40 362 4.16666666666667e-02 +40 357 8.33333333333333e-02 +40 1688 2.08333333333333e+00 +40 1686 -4.16666666666667e+00 +40 1718 -2.08333333333333e+00 +40 1717 -6.25000000000000e+00 +40 1716 4.16666666666667e+00 +41 41 2.98333333333333e+01 +41 39 -8.33333333333333e+00 +41 354 4.25000000000000e+00 +41 140 -2.16666666666667e+00 +41 356 -1.91250000000000e+01 +41 139 2.12500000000000e+00 +41 40 -4.25000000000000e+00 +41 355 4.25000000000000e+00 +41 138 -2.08333333333333e+00 +41 194 -2.16666666666667e+00 +41 193 2.12500000000000e+00 +41 364 -4.25000000000000e+00 +41 192 -2.08333333333333e+00 +41 363 2.12500000000000e+00 +41 361 4.16666666666667e-02 +41 353 -1.25000000000000e-01 +41 352 -4.16666666666667e-02 +41 351 8.33333333333333e-02 +41 366 -8.33333333333333e-02 +41 367 -8.33333333333333e-02 +41 358 8.33333333333333e-02 +41 360 4.16666666666667e-02 +41 357 -1.66666666666667e-01 +41 1687 2.08333333333333e+00 +41 1716 4.16666666666667e+00 +41 1686 2.08333333333333e+00 +41 1717 -2.08333333333333e+00 +41 1718 -6.25000000000000e+00 +42 42 1.25000000000000e+00 +42 382 8.33333333333333e-02 +42 383 8.33333333333333e-02 +42 379 8.33333333333333e-02 +42 378 -1.25000000000000e-01 +42 44 -1.66666666666667e-01 +42 353 8.33333333333333e-02 +42 352 8.33333333333333e-02 +42 351 -3.75000000000000e-01 +42 370 -8.33333333333333e-02 +42 43 -1.66666666666667e-01 +42 374 8.33333333333333e-02 +42 385 -8.33333333333333e-02 +42 376 8.33333333333333e-02 +42 371 1.66666666666667e-01 +42 377 -1.66666666666667e-01 +42 206 4.16666666666667e-02 +42 386 -8.33333333333333e-02 +42 373 8.33333333333333e-02 +42 205 -8.33333333333333e-02 +42 372 -3.75000000000000e-01 +42 335 -4.16666666666667e-02 +42 143 4.16666666666667e-02 +42 334 8.33333333333333e-02 +42 142 -8.33333333333333e-02 +42 333 -1.25000000000000e-01 +42 380 -4.16666666666667e-02 +42 369 -2.50000000000000e-01 +43 43 1.25000000000000e+00 +43 381 8.33333333333333e-02 +43 383 -1.66666666666667e-01 +43 206 4.16666666666667e-02 +43 379 -3.75000000000000e-01 +43 378 8.33333333333333e-02 +43 353 -4.16666666666667e-02 +43 143 4.16666666666667e-02 +43 352 -1.25000000000000e-01 +43 351 8.33333333333333e-02 +43 369 -8.33333333333333e-02 +43 374 -4.16666666666667e-02 +43 42 -1.66666666666667e-01 +43 384 -8.33333333333333e-02 +43 375 8.33333333333333e-02 +43 386 -8.33333333333333e-02 +43 377 8.33333333333333e-02 +43 373 -1.25000000000000e-01 +43 372 8.33333333333333e-02 +43 204 -8.33333333333333e-02 +43 335 8.33333333333333e-02 +43 44 -1.66666666666667e-01 +43 371 1.66666666666667e-01 +43 334 -3.75000000000000e-01 +43 380 8.33333333333333e-02 +43 370 -2.50000000000000e-01 +43 333 8.33333333333333e-02 +43 141 -8.33333333333333e-02 +44 44 1.25000000000000e+00 +44 379 8.33333333333333e-02 +44 382 -1.66666666666667e-01 +44 381 8.33333333333333e-02 +44 380 -1.25000000000000e-01 +44 205 4.16666666666667e-02 +44 353 -1.25000000000000e-01 +44 352 -4.16666666666667e-02 +44 142 4.16666666666667e-02 +44 42 -1.66666666666667e-01 +44 351 8.33333333333333e-02 +44 373 -4.16666666666667e-02 +44 372 8.33333333333333e-02 +44 385 -8.33333333333333e-02 +44 376 8.33333333333333e-02 +44 369 1.66666666666667e-01 +44 375 -1.66666666666667e-01 +44 374 -1.25000000000000e-01 +44 204 4.16666666666667e-02 +44 384 -8.33333333333333e-02 +44 335 -1.25000000000000e-01 +44 378 -4.16666666666667e-02 +44 371 -7.50000000000000e-01 +44 334 8.33333333333333e-02 +44 43 -1.66666666666667e-01 +44 370 1.66666666666667e-01 +44 333 -4.16666666666667e-02 +44 141 4.16666666666667e-02 +45 45 2.98333333333333e+01 +45 392 -2.12500000000000e+00 +45 46 -8.33333333333333e+00 +45 391 4.25000000000000e+00 +45 146 2.12500000000000e+00 +45 145 -2.08333333333333e+00 +45 144 -2.16666666666667e+00 +45 390 -6.37500000000000e+00 +45 47 -4.25000000000000e+00 +45 236 2.12500000000000e+00 +45 235 -2.08333333333333e+00 +45 400 2.12500000000000e+00 +45 401 2.12500000000000e+00 +45 234 -2.16666666666667e+00 +45 395 8.33333333333333e-02 +45 404 -8.33333333333333e-02 +45 397 4.16666666666667e-02 +45 403 -8.33333333333333e-02 +45 398 -8.33333333333333e-02 +45 389 8.33333333333333e-02 +45 388 8.33333333333333e-02 +45 394 -1.66666666666667e-01 +45 387 -3.75000000000000e-01 +45 1753 4.16666666666667e+00 +45 1691 -4.16666666666667e+00 +45 1690 2.08333333333333e+00 +45 1754 4.16666666666667e+00 +45 1752 -1.87500000000000e+01 +46 46 2.98333333333333e+01 +46 45 -8.33333333333333e+00 +46 390 4.25000000000000e+00 +46 146 2.12500000000000e+00 +46 47 -4.25000000000000e+00 +46 392 4.25000000000000e+00 +46 145 -2.16666666666667e+00 +46 391 -1.91250000000000e+01 +46 144 -2.08333333333333e+00 +46 236 2.12500000000000e+00 +46 401 -4.25000000000000e+00 +46 235 -2.16666666666667e+00 +46 234 -2.08333333333333e+00 +46 399 2.12500000000000e+00 +46 396 4.16666666666667e-02 +46 402 -8.33333333333333e-02 +46 398 4.16666666666667e-02 +46 404 -8.33333333333333e-02 +46 389 -4.16666666666667e-02 +46 395 8.33333333333333e-02 +46 388 -1.25000000000000e-01 +46 387 8.33333333333333e-02 +46 393 -1.66666666666667e-01 +46 1754 -2.08333333333333e+00 +46 1752 4.16666666666667e+00 +46 1689 2.08333333333333e+00 +46 1691 2.08333333333333e+00 +46 1753 -6.25000000000000e+00 +47 47 2.57500000000000e+01 +47 390 -2.12500000000000e+00 +47 146 -6.50000000000000e+00 +47 392 -6.37500000000000e+00 +47 145 2.12500000000000e+00 +47 46 -4.25000000000000e+00 +47 391 4.25000000000000e+00 +47 144 2.12500000000000e+00 +47 399 2.12500000000000e+00 +47 236 -6.50000000000000e+00 +47 235 2.12500000000000e+00 +47 400 -4.25000000000000e+00 +47 45 -4.25000000000000e+00 +47 234 2.12500000000000e+00 +47 393 8.33333333333333e-02 +47 402 -8.33333333333333e-02 +47 397 4.16666666666667e-02 +47 403 -8.33333333333333e-02 +47 396 -8.33333333333333e-02 +47 389 -1.25000000000000e-01 +47 388 -4.16666666666667e-02 +47 394 8.33333333333333e-02 +47 387 8.33333333333333e-02 +47 1690 2.08333333333333e+00 +47 1753 -2.08333333333333e+00 +47 1689 -4.16666666666667e+00 +47 1754 -6.25000000000000e+00 +47 1752 4.16666666666667e+00 +48 48 1.25000000000000e+00 +48 413 8.33333333333333e-02 +48 412 -1.66666666666667e-01 +48 410 8.33333333333333e-02 +48 247 4.16666666666667e-02 +48 408 -3.75000000000000e-01 +48 338 8.33333333333333e-02 +48 337 -4.16666666666667e-02 +48 148 4.16666666666667e-02 +48 336 -1.25000000000000e-01 +48 407 -8.33333333333333e-02 +48 50 -1.66666666666667e-01 +48 415 -4.16666666666667e-02 +48 422 -8.33333333333333e-02 +48 419 8.33333333333333e-02 +48 421 -8.33333333333333e-02 +48 418 8.33333333333333e-02 +48 416 8.33333333333333e-02 +48 248 -8.33333333333333e-02 +48 414 -1.25000000000000e-01 +48 389 8.33333333333333e-02 +48 149 -8.33333333333333e-02 +48 388 8.33333333333333e-02 +48 49 -1.66666666666667e-01 +48 406 1.66666666666667e-01 +48 387 -3.75000000000000e-01 +48 409 8.33333333333333e-02 +48 405 -2.50000000000000e-01 +49 49 1.25000000000000e+00 +49 413 8.33333333333333e-02 +49 408 8.33333333333333e-02 +49 411 -1.66666666666667e-01 +49 409 -1.25000000000000e-01 +49 246 4.16666666666667e-02 +49 338 8.33333333333333e-02 +49 50 -1.66666666666667e-01 +49 337 -1.25000000000000e-01 +49 336 -4.16666666666667e-02 +49 147 4.16666666666667e-02 +49 414 -4.16666666666667e-02 +49 416 8.33333333333333e-02 +49 407 1.66666666666667e-01 +49 419 -1.66666666666667e-01 +49 420 -8.33333333333333e-02 +49 417 8.33333333333333e-02 +49 248 4.16666666666667e-02 +49 422 -8.33333333333333e-02 +49 415 -1.25000000000000e-01 +49 389 -4.16666666666667e-02 +49 149 4.16666666666667e-02 +49 388 -1.25000000000000e-01 +49 410 -4.16666666666667e-02 +49 406 -7.50000000000000e-01 +49 387 8.33333333333333e-02 +49 48 -1.66666666666667e-01 +49 405 1.66666666666667e-01 +50 50 1.25000000000000e+00 +50 412 8.33333333333333e-02 +50 411 8.33333333333333e-02 +50 410 -1.25000000000000e-01 +50 408 8.33333333333333e-02 +50 338 -3.75000000000000e-01 +50 337 8.33333333333333e-02 +50 49 -1.66666666666667e-01 +50 336 8.33333333333333e-02 +50 405 -8.33333333333333e-02 +50 48 -1.66666666666667e-01 +50 415 8.33333333333333e-02 +50 420 -8.33333333333333e-02 +50 417 8.33333333333333e-02 +50 406 1.66666666666667e-01 +50 418 -1.66666666666667e-01 +50 416 -3.75000000000000e-01 +50 247 4.16666666666667e-02 +50 421 -8.33333333333333e-02 +50 414 8.33333333333333e-02 +50 246 -8.33333333333333e-02 +50 389 -1.25000000000000e-01 +50 409 -4.16666666666667e-02 +50 407 -2.50000000000000e-01 +50 388 -4.16666666666667e-02 +50 148 4.16666666666667e-02 +50 387 8.33333333333333e-02 +50 147 -8.33333333333333e-02 +51 51 6.37500000000000e+01 +51 355 -2.12500000000000e+00 +51 152 2.12500000000000e+00 +51 354 -6.37500000000000e+00 +51 428 -2.12500000000000e+00 +51 278 2.12500000000000e+00 +51 52 -8.50000000000000e+00 +51 427 4.25000000000000e+00 +51 426 -6.37500000000000e+00 +51 392 -2.12500000000000e+00 +51 391 4.25000000000000e+00 +51 151 2.12500000000000e+00 +51 390 -6.37500000000000e+00 +51 53 -8.50000000000000e+00 +51 434 4.25000000000000e+00 +51 433 -2.12500000000000e+00 +51 277 2.12500000000000e+00 +51 356 4.25000000000000e+00 +51 432 -6.37500000000000e+00 +51 430 -1.66666666666667e-01 +51 425 1.66666666666667e-01 +51 437 -1.66666666666667e-01 +51 439 -8.33333333333333e-02 +51 436 8.33333333333333e-02 +51 440 -8.33333333333333e-02 +51 424 1.66666666666667e-01 +51 431 8.33333333333333e-02 +51 423 -7.50000000000000e-01 +51 1720 4.16666666666667e+00 +51 1721 -8.33333333333333e+00 +51 1694 -4.16666666666667e+00 +51 1757 4.16666666666667e+00 +51 1786 8.33333333333333e+00 +51 1756 -8.33333333333333e+00 +51 1693 -4.16666666666667e+00 +51 1787 8.33333333333333e+00 +51 1785 -3.75000000000000e+01 +52 52 6.37500000000000e+01 +52 354 -2.12500000000000e+00 +52 356 4.25000000000000e+00 +52 355 -6.37500000000000e+00 +52 428 4.25000000000000e+00 +52 427 -1.91250000000000e+01 +52 51 -8.50000000000000e+00 +52 426 4.25000000000000e+00 +52 53 -8.50000000000000e+00 +52 390 4.25000000000000e+00 +52 152 -4.25000000000000e+00 +52 392 4.25000000000000e+00 +52 391 -1.91250000000000e+01 +52 150 2.12500000000000e+00 +52 434 4.25000000000000e+00 +52 278 -4.25000000000000e+00 +52 433 -6.37500000000000e+00 +52 432 -2.12500000000000e+00 +52 276 2.12500000000000e+00 +52 431 8.33333333333333e-02 +52 429 -1.66666666666667e-01 +52 425 -8.33333333333333e-02 +52 440 -8.33333333333333e-02 +52 437 8.33333333333333e-02 +52 438 -8.33333333333333e-02 +52 435 8.33333333333333e-02 +52 424 -2.50000000000000e-01 +52 423 1.66666666666667e-01 +52 1721 4.16666666666667e+00 +52 1787 -4.16666666666667e+00 +52 1694 -4.16666666666667e+00 +52 1757 4.16666666666667e+00 +52 1785 8.33333333333333e+00 +52 1755 -8.33333333333333e+00 +52 1692 -4.16666666666667e+00 +52 1719 4.16666666666667e+00 +52 1786 -1.25000000000000e+01 +53 53 6.37500000000000e+01 +53 356 -1.91250000000000e+01 +53 355 4.25000000000000e+00 +53 150 2.12500000000000e+00 +53 428 -6.37500000000000e+00 +53 427 4.25000000000000e+00 +53 426 -2.12500000000000e+00 +53 276 2.12500000000000e+00 +53 52 -8.50000000000000e+00 +53 390 -2.12500000000000e+00 +53 392 -6.37500000000000e+00 +53 151 -4.25000000000000e+00 +53 391 4.25000000000000e+00 +53 354 4.25000000000000e+00 +53 434 -1.91250000000000e+01 +53 433 4.25000000000000e+00 +53 277 -4.25000000000000e+00 +53 51 -8.50000000000000e+00 +53 432 4.25000000000000e+00 +53 430 8.33333333333333e-02 +53 424 -8.33333333333333e-02 +53 439 -8.33333333333333e-02 +53 436 8.33333333333333e-02 +53 423 1.66666666666667e-01 +53 435 -1.66666666666667e-01 +53 438 -8.33333333333333e-02 +53 429 8.33333333333333e-02 +53 425 -2.50000000000000e-01 +53 1720 4.16666666666667e+00 +53 1719 -8.33333333333333e+00 +53 1786 -4.16666666666667e+00 +53 1693 -4.16666666666667e+00 +53 1756 4.16666666666667e+00 +53 1692 -4.16666666666667e+00 +53 1755 4.16666666666667e+00 +53 1787 -1.25000000000000e+01 +53 1785 8.33333333333333e+00 +54 54 2.50000000000000e+00 +54 445 1.66666666666667e-01 +54 444 -2.50000000000000e-01 +54 359 -1.66666666666667e-01 +54 358 8.33333333333333e-02 +54 425 1.66666666666667e-01 +54 457 8.33333333333333e-02 +54 424 1.66666666666667e-01 +54 423 -7.50000000000000e-01 +54 458 8.33333333333333e-02 +54 370 -8.33333333333333e-02 +54 371 1.66666666666667e-01 +54 56 -3.33333333333333e-01 +54 155 -8.33333333333333e-02 +54 369 -2.50000000000000e-01 +54 449 8.33333333333333e-02 +54 290 -8.33333333333333e-02 +54 448 -1.66666666666667e-01 +54 341 8.33333333333333e-02 +54 442 1.66666666666667e-01 +54 55 -3.33333333333333e-01 +54 443 1.66666666666667e-01 +54 289 -8.33333333333333e-02 +54 441 -7.50000000000000e-01 +54 340 8.33333333333333e-02 +54 154 -8.33333333333333e-02 +54 407 -8.33333333333333e-02 +54 395 8.33333333333333e-02 +54 454 8.33333333333333e-02 +54 451 -8.33333333333333e-02 +54 394 -1.66666666666667e-01 +54 406 1.66666666666667e-01 +54 405 -2.50000000000000e-01 +54 452 1.66666666666667e-01 +54 455 -1.66666666666667e-01 +54 450 -2.50000000000000e-01 +54 446 -8.33333333333333e-02 +55 55 2.50000000000000e+00 +55 444 1.66666666666667e-01 +55 446 1.66666666666667e-01 +55 445 -7.50000000000000e-01 +55 357 8.33333333333333e-02 +55 425 -8.33333333333333e-02 +55 456 8.33333333333333e-02 +55 424 -2.50000000000000e-01 +55 423 1.66666666666667e-01 +55 458 -1.66666666666667e-01 +55 369 -8.33333333333333e-02 +55 449 8.33333333333333e-02 +55 371 1.66666666666667e-01 +55 370 -2.50000000000000e-01 +55 447 -1.66666666666667e-01 +55 443 -8.33333333333333e-02 +55 441 1.66666666666667e-01 +55 54 -3.33333333333333e-01 +55 442 -2.50000000000000e-01 +55 288 -8.33333333333333e-02 +55 341 -1.66666666666667e-01 +55 339 8.33333333333333e-02 +55 153 -8.33333333333333e-02 +55 407 1.66666666666667e-01 +55 56 -3.33333333333333e-01 +55 452 1.66666666666667e-01 +55 453 8.33333333333333e-02 +55 450 -8.33333333333333e-02 +55 395 8.33333333333333e-02 +55 155 -8.33333333333333e-02 +55 406 -7.50000000000000e-01 +55 393 -1.66666666666667e-01 +55 405 1.66666666666667e-01 +55 455 8.33333333333333e-02 +55 290 -8.33333333333333e-02 +55 451 -2.50000000000000e-01 +55 359 8.33333333333333e-02 +56 56 2.50000000000000e+00 +56 358 8.33333333333333e-02 +56 446 -2.50000000000000e-01 +56 445 1.66666666666667e-01 +56 357 -1.66666666666667e-01 +56 424 -8.33333333333333e-02 +56 423 1.66666666666667e-01 +56 425 -2.50000000000000e-01 +56 457 -1.66666666666667e-01 +56 456 8.33333333333333e-02 +56 448 8.33333333333333e-02 +56 369 1.66666666666667e-01 +56 54 -3.33333333333333e-01 +56 371 -7.50000000000000e-01 +56 370 1.66666666666667e-01 +56 153 -8.33333333333333e-02 +56 447 8.33333333333333e-02 +56 288 -8.33333333333333e-02 +56 442 -8.33333333333333e-02 +56 339 8.33333333333333e-02 +56 443 -2.50000000000000e-01 +56 441 1.66666666666667e-01 +56 340 -1.66666666666667e-01 +56 405 -8.33333333333333e-02 +56 393 8.33333333333333e-02 +56 406 1.66666666666667e-01 +56 55 -3.33333333333333e-01 +56 451 1.66666666666667e-01 +56 407 -2.50000000000000e-01 +56 394 8.33333333333333e-02 +56 154 -8.33333333333333e-02 +56 452 -7.50000000000000e-01 +56 444 -8.33333333333333e-02 +56 454 8.33333333333333e-02 +56 289 -8.33333333333333e-02 +56 450 1.66666666666667e-01 +56 453 -1.66666666666667e-01 +57 57 7.50000000000000e-01 +57 181 4.16666666666667e-02 +57 469 -8.33333333333333e-02 +57 461 -4.16666666666667e-02 +57 58 -8.33333333333333e-02 +57 460 8.33333333333333e-02 +57 160 4.16666666666667e-02 +57 459 -1.25000000000000e-01 +57 476 -8.33333333333333e-02 +57 467 8.33333333333333e-02 +57 182 4.16666666666667e-02 +57 473 -8.33333333333333e-02 +57 472 4.16666666666667e-02 +57 475 -8.33333333333333e-02 +57 180 -2.50000000000000e-01 +57 59 -8.33333333333333e-02 +57 464 8.33333333333333e-02 +57 161 4.16666666666667e-02 +57 463 -4.16666666666667e-02 +57 466 8.33333333333333e-02 +57 470 4.16666666666667e-02 +57 462 -1.25000000000000e-01 +57 159 -2.50000000000000e-01 +58 58 6.66666666666667e-01 +58 180 4.16666666666667e-02 +58 468 -8.33333333333333e-02 +58 461 8.33333333333333e-02 +58 460 -3.75000000000000e-01 +58 57 -8.33333333333333e-02 +58 459 8.33333333333333e-02 +58 159 4.16666666666667e-02 +58 473 4.16666666666667e-02 +58 476 -8.33333333333333e-02 +58 181 -8.33333333333333e-02 +58 471 4.16666666666667e-02 +58 474 -8.33333333333333e-02 +58 464 8.33333333333333e-02 +58 467 -1.66666666666667e-01 +58 470 4.16666666666667e-02 +58 463 -1.25000000000000e-01 +58 160 -8.33333333333333e-02 +58 462 -4.16666666666667e-02 +58 465 8.33333333333333e-02 +59 59 6.66666666666667e-01 +59 468 4.16666666666667e-02 +59 461 -1.25000000000000e-01 +59 460 8.33333333333333e-02 +59 459 -4.16666666666667e-02 +59 472 4.16666666666667e-02 +59 475 -8.33333333333333e-02 +59 474 -8.33333333333333e-02 +59 465 8.33333333333333e-02 +59 182 -8.33333333333333e-02 +59 180 4.16666666666667e-02 +59 471 -8.33333333333333e-02 +59 469 4.16666666666667e-02 +59 464 -3.75000000000000e-01 +59 161 -8.33333333333333e-02 +59 463 8.33333333333333e-02 +59 466 -1.66666666666667e-01 +59 57 -8.33333333333333e-02 +59 462 8.33333333333333e-02 +59 159 4.16666666666667e-02 +60 60 1.25000000000000e+00 +60 487 -8.33333333333333e-02 +60 479 8.33333333333333e-02 +60 478 8.33333333333333e-02 +60 477 -3.75000000000000e-01 +60 494 -8.33333333333333e-02 +60 493 -8.33333333333333e-02 +60 485 -1.66666666666667e-01 +60 484 8.33333333333333e-02 +60 374 8.33333333333333e-02 +60 62 -1.66666666666667e-01 +60 482 1.66666666666667e-01 +60 490 8.33333333333333e-02 +60 481 -8.33333333333333e-02 +60 164 -4.16666666666667e-02 +60 344 4.16666666666667e-02 +60 163 8.33333333333333e-02 +60 343 -8.33333333333333e-02 +60 162 -1.25000000000000e-01 +60 480 -2.50000000000000e-01 +60 209 -4.16666666666667e-02 +60 491 8.33333333333333e-02 +60 61 -1.66666666666667e-01 +60 208 8.33333333333333e-02 +60 373 8.33333333333333e-02 +60 488 4.16666666666667e-02 +60 207 -1.25000000000000e-01 +60 372 -3.75000000000000e-01 +61 61 1.25000000000000e+00 +61 486 -8.33333333333333e-02 +61 479 -4.16666666666667e-02 +61 478 -1.25000000000000e-01 +61 477 8.33333333333333e-02 +61 494 -8.33333333333333e-02 +61 485 8.33333333333333e-02 +61 492 -8.33333333333333e-02 +61 483 8.33333333333333e-02 +61 374 -4.16666666666667e-02 +61 344 4.16666666666667e-02 +61 489 8.33333333333333e-02 +61 480 -8.33333333333333e-02 +61 164 8.33333333333333e-02 +61 62 -1.66666666666667e-01 +61 482 1.66666666666667e-01 +61 163 -3.75000000000000e-01 +61 481 -2.50000000000000e-01 +61 162 8.33333333333333e-02 +61 342 -8.33333333333333e-02 +61 209 8.33333333333333e-02 +61 491 -1.66666666666667e-01 +61 488 4.16666666666667e-02 +61 208 -3.75000000000000e-01 +61 373 -1.25000000000000e-01 +61 60 -1.66666666666667e-01 +61 207 8.33333333333333e-02 +61 372 8.33333333333333e-02 +62 62 1.25000000000000e+00 +62 487 4.16666666666667e-02 +62 479 -1.25000000000000e-01 +62 478 -4.16666666666667e-02 +62 477 8.33333333333333e-02 +62 492 -8.33333333333333e-02 +62 493 -8.33333333333333e-02 +62 484 8.33333333333333e-02 +62 483 -1.66666666666667e-01 +62 373 -4.16666666666667e-02 +62 343 4.16666666666667e-02 +62 372 8.33333333333333e-02 +62 60 -1.66666666666667e-01 +62 480 1.66666666666667e-01 +62 164 -1.25000000000000e-01 +62 482 -7.50000000000000e-01 +62 163 8.33333333333333e-02 +62 61 -1.66666666666667e-01 +62 481 1.66666666666667e-01 +62 162 -4.16666666666667e-02 +62 342 4.16666666666667e-02 +62 486 4.16666666666667e-02 +62 209 -1.25000000000000e-01 +62 374 -1.25000000000000e-01 +62 208 8.33333333333333e-02 +62 490 -1.66666666666667e-01 +62 207 -4.16666666666667e-02 +62 489 8.33333333333333e-02 +63 63 1.25000000000000e+00 +63 508 8.33333333333333e-02 +63 509 8.33333333333333e-02 +63 505 8.33333333333333e-02 +63 504 -1.25000000000000e-01 +63 65 -1.66666666666667e-01 +63 479 8.33333333333333e-02 +63 478 8.33333333333333e-02 +63 477 -3.75000000000000e-01 +63 496 -8.33333333333333e-02 +63 64 -1.66666666666667e-01 +63 500 8.33333333333333e-02 +63 511 -8.33333333333333e-02 +63 502 8.33333333333333e-02 +63 497 1.66666666666667e-01 +63 503 -1.66666666666667e-01 +63 224 4.16666666666667e-02 +63 512 -8.33333333333333e-02 +63 499 8.33333333333333e-02 +63 223 -8.33333333333333e-02 +63 498 -3.75000000000000e-01 +63 461 -4.16666666666667e-02 +63 167 4.16666666666667e-02 +63 460 8.33333333333333e-02 +63 166 -8.33333333333333e-02 +63 459 -1.25000000000000e-01 +63 506 -4.16666666666667e-02 +63 495 -2.50000000000000e-01 +64 64 1.25000000000000e+00 +64 507 8.33333333333333e-02 +64 509 -1.66666666666667e-01 +64 224 4.16666666666667e-02 +64 505 -3.75000000000000e-01 +64 504 8.33333333333333e-02 +64 479 -4.16666666666667e-02 +64 167 4.16666666666667e-02 +64 478 -1.25000000000000e-01 +64 477 8.33333333333333e-02 +64 495 -8.33333333333333e-02 +64 500 -4.16666666666667e-02 +64 63 -1.66666666666667e-01 +64 510 -8.33333333333333e-02 +64 501 8.33333333333333e-02 +64 512 -8.33333333333333e-02 +64 503 8.33333333333333e-02 +64 499 -1.25000000000000e-01 +64 498 8.33333333333333e-02 +64 222 -8.33333333333333e-02 +64 461 8.33333333333333e-02 +64 65 -1.66666666666667e-01 +64 497 1.66666666666667e-01 +64 460 -3.75000000000000e-01 +64 506 8.33333333333333e-02 +64 496 -2.50000000000000e-01 +64 459 8.33333333333333e-02 +64 165 -8.33333333333333e-02 +65 65 1.25000000000000e+00 +65 505 8.33333333333333e-02 +65 508 -1.66666666666667e-01 +65 507 8.33333333333333e-02 +65 506 -1.25000000000000e-01 +65 223 4.16666666666667e-02 +65 479 -1.25000000000000e-01 +65 478 -4.16666666666667e-02 +65 166 4.16666666666667e-02 +65 63 -1.66666666666667e-01 +65 477 8.33333333333333e-02 +65 499 -4.16666666666667e-02 +65 498 8.33333333333333e-02 +65 511 -8.33333333333333e-02 +65 502 8.33333333333333e-02 +65 495 1.66666666666667e-01 +65 501 -1.66666666666667e-01 +65 500 -1.25000000000000e-01 +65 222 4.16666666666667e-02 +65 510 -8.33333333333333e-02 +65 461 -1.25000000000000e-01 +65 504 -4.16666666666667e-02 +65 497 -7.50000000000000e-01 +65 460 8.33333333333333e-02 +65 64 -1.66666666666667e-01 +65 496 1.66666666666667e-01 +65 459 -4.16666666666667e-02 +65 165 4.16666666666667e-02 +66 66 1.25000000000000e+00 +66 530 -8.33333333333333e-02 +66 523 4.16666666666667e-02 +66 529 -8.33333333333333e-02 +66 524 -8.33333333333333e-02 +66 515 8.33333333333333e-02 +66 514 8.33333333333333e-02 +66 520 -1.66666666666667e-01 +66 513 -3.75000000000000e-01 +66 527 8.33333333333333e-02 +66 518 -8.33333333333333e-02 +66 67 -1.66666666666667e-01 +66 517 1.66666666666667e-01 +66 409 8.33333333333333e-02 +66 170 8.33333333333333e-02 +66 347 -8.33333333333333e-02 +66 169 -4.16666666666667e-02 +66 346 4.16666666666667e-02 +66 168 -1.25000000000000e-01 +66 516 -2.50000000000000e-01 +66 68 -1.66666666666667e-01 +66 251 8.33333333333333e-02 +66 410 8.33333333333333e-02 +66 250 -4.16666666666667e-02 +66 526 8.33333333333333e-02 +66 521 8.33333333333333e-02 +66 249 -1.25000000000000e-01 +66 408 -3.75000000000000e-01 +67 67 1.25000000000000e+00 +67 528 -8.33333333333333e-02 +67 524 4.16666666666667e-02 +67 530 -8.33333333333333e-02 +67 515 -4.16666666666667e-02 +67 521 8.33333333333333e-02 +67 514 -1.25000000000000e-01 +67 513 8.33333333333333e-02 +67 519 -1.66666666666667e-01 +67 347 4.16666666666667e-02 +67 410 -4.16666666666667e-02 +67 66 -1.66666666666667e-01 +67 516 1.66666666666667e-01 +67 408 8.33333333333333e-02 +67 170 8.33333333333333e-02 +67 68 -1.66666666666667e-01 +67 518 1.66666666666667e-01 +67 169 -1.25000000000000e-01 +67 517 -7.50000000000000e-01 +67 168 -4.16666666666667e-02 +67 345 4.16666666666667e-02 +67 251 8.33333333333333e-02 +67 527 -1.66666666666667e-01 +67 522 4.16666666666667e-02 +67 250 -1.25000000000000e-01 +67 409 -1.25000000000000e-01 +67 249 -4.16666666666667e-02 +67 525 8.33333333333333e-02 +68 68 1.25000000000000e+00 +68 528 -8.33333333333333e-02 +68 523 4.16666666666667e-02 +68 529 -8.33333333333333e-02 +68 522 -8.33333333333333e-02 +68 515 -1.25000000000000e-01 +68 514 -4.16666666666667e-02 +68 520 8.33333333333333e-02 +68 513 8.33333333333333e-02 +68 525 8.33333333333333e-02 +68 516 -8.33333333333333e-02 +68 346 4.16666666666667e-02 +68 409 -4.16666666666667e-02 +68 170 -3.75000000000000e-01 +68 518 -2.50000000000000e-01 +68 169 8.33333333333333e-02 +68 67 -1.66666666666667e-01 +68 517 1.66666666666667e-01 +68 168 8.33333333333333e-02 +68 345 -8.33333333333333e-02 +68 519 8.33333333333333e-02 +68 251 -3.75000000000000e-01 +68 410 -1.25000000000000e-01 +68 250 8.33333333333333e-02 +68 526 -1.66666666666667e-01 +68 66 -1.66666666666667e-01 +68 249 8.33333333333333e-02 +68 408 8.33333333333333e-02 +69 69 1.25000000000000e+00 +69 539 8.33333333333333e-02 +69 538 -1.66666666666667e-01 +69 536 8.33333333333333e-02 +69 265 4.16666666666667e-02 +69 534 -3.75000000000000e-01 +69 464 8.33333333333333e-02 +69 463 -4.16666666666667e-02 +69 172 4.16666666666667e-02 +69 462 -1.25000000000000e-01 +69 533 -8.33333333333333e-02 +69 71 -1.66666666666667e-01 +69 541 -4.16666666666667e-02 +69 548 -8.33333333333333e-02 +69 545 8.33333333333333e-02 +69 547 -8.33333333333333e-02 +69 544 8.33333333333333e-02 +69 542 8.33333333333333e-02 +69 266 -8.33333333333333e-02 +69 540 -1.25000000000000e-01 +69 515 8.33333333333333e-02 +69 173 -8.33333333333333e-02 +69 514 8.33333333333333e-02 +69 70 -1.66666666666667e-01 +69 532 1.66666666666667e-01 +69 513 -3.75000000000000e-01 +69 535 8.33333333333333e-02 +69 531 -2.50000000000000e-01 +70 70 1.25000000000000e+00 +70 539 8.33333333333333e-02 +70 534 8.33333333333333e-02 +70 537 -1.66666666666667e-01 +70 535 -1.25000000000000e-01 +70 264 4.16666666666667e-02 +70 464 8.33333333333333e-02 +70 71 -1.66666666666667e-01 +70 463 -1.25000000000000e-01 +70 462 -4.16666666666667e-02 +70 171 4.16666666666667e-02 +70 540 -4.16666666666667e-02 +70 542 8.33333333333333e-02 +70 533 1.66666666666667e-01 +70 545 -1.66666666666667e-01 +70 546 -8.33333333333333e-02 +70 543 8.33333333333333e-02 +70 266 4.16666666666667e-02 +70 548 -8.33333333333333e-02 +70 541 -1.25000000000000e-01 +70 515 -4.16666666666667e-02 +70 173 4.16666666666667e-02 +70 514 -1.25000000000000e-01 +70 536 -4.16666666666667e-02 +70 532 -7.50000000000000e-01 +70 513 8.33333333333333e-02 +70 69 -1.66666666666667e-01 +70 531 1.66666666666667e-01 +71 71 1.25000000000000e+00 +71 538 8.33333333333333e-02 +71 537 8.33333333333333e-02 +71 536 -1.25000000000000e-01 +71 534 8.33333333333333e-02 +71 464 -3.75000000000000e-01 +71 463 8.33333333333333e-02 +71 70 -1.66666666666667e-01 +71 462 8.33333333333333e-02 +71 531 -8.33333333333333e-02 +71 69 -1.66666666666667e-01 +71 541 8.33333333333333e-02 +71 546 -8.33333333333333e-02 +71 543 8.33333333333333e-02 +71 532 1.66666666666667e-01 +71 544 -1.66666666666667e-01 +71 542 -3.75000000000000e-01 +71 265 4.16666666666667e-02 +71 547 -8.33333333333333e-02 +71 540 8.33333333333333e-02 +71 264 -8.33333333333333e-02 +71 515 -1.25000000000000e-01 +71 535 -4.16666666666667e-02 +71 533 -2.50000000000000e-01 +71 514 -4.16666666666667e-02 +71 172 4.16666666666667e-02 +71 513 8.33333333333333e-02 +71 171 -8.33333333333333e-02 +72 72 2.50000000000000e+00 +72 556 -1.66666666666667e-01 +72 551 1.66666666666667e-01 +72 563 -1.66666666666667e-01 +72 565 -8.33333333333333e-02 +72 562 8.33333333333333e-02 +72 566 -8.33333333333333e-02 +72 550 1.66666666666667e-01 +72 549 -7.50000000000000e-01 +72 482 1.66666666666667e-01 +72 376 8.33333333333333e-02 +72 481 -8.33333333333333e-02 +72 377 -1.66666666666667e-01 +72 176 8.33333333333333e-02 +72 480 -2.50000000000000e-01 +72 554 -8.33333333333333e-02 +72 293 8.33333333333333e-02 +72 73 -3.33333333333333e-01 +72 553 1.66666666666667e-01 +72 552 -2.50000000000000e-01 +72 518 -8.33333333333333e-02 +72 517 1.66666666666667e-01 +72 350 -8.33333333333333e-02 +72 413 8.33333333333333e-02 +72 442 1.66666666666667e-01 +72 412 -1.66666666666667e-01 +72 175 8.33333333333333e-02 +72 349 -8.33333333333333e-02 +72 516 -2.50000000000000e-01 +72 74 -3.33333333333333e-01 +72 560 1.66666666666667e-01 +72 443 1.66666666666667e-01 +72 559 -8.33333333333333e-02 +72 292 8.33333333333333e-02 +72 557 8.33333333333333e-02 +72 558 -2.50000000000000e-01 +72 441 -7.50000000000000e-01 +73 73 2.50000000000000e+00 +73 555 -1.66666666666667e-01 +73 551 -8.33333333333333e-02 +73 566 -8.33333333333333e-02 +73 563 8.33333333333333e-02 +73 564 -8.33333333333333e-02 +73 561 8.33333333333333e-02 +73 550 -2.50000000000000e-01 +73 549 1.66666666666667e-01 +73 375 8.33333333333333e-02 +73 480 -8.33333333333333e-02 +73 377 8.33333333333333e-02 +73 482 1.66666666666667e-01 +73 481 -2.50000000000000e-01 +73 554 1.66666666666667e-01 +73 553 -7.50000000000000e-01 +73 72 -3.33333333333333e-01 +73 552 1.66666666666667e-01 +73 443 -8.33333333333333e-02 +73 74 -3.33333333333333e-01 +73 350 -8.33333333333333e-02 +73 413 8.33333333333333e-02 +73 516 1.66666666666667e-01 +73 441 1.66666666666667e-01 +73 411 -1.66666666666667e-01 +73 176 -1.66666666666667e-01 +73 518 1.66666666666667e-01 +73 517 -7.50000000000000e-01 +73 174 8.33333333333333e-02 +73 348 -8.33333333333333e-02 +73 560 1.66666666666667e-01 +73 293 -1.66666666666667e-01 +73 557 8.33333333333333e-02 +73 559 -2.50000000000000e-01 +73 442 -2.50000000000000e-01 +73 558 -8.33333333333333e-02 +73 291 8.33333333333333e-02 +74 74 2.50000000000000e+00 +74 556 8.33333333333333e-02 +74 550 -8.33333333333333e-02 +74 565 -8.33333333333333e-02 +74 562 8.33333333333333e-02 +74 549 1.66666666666667e-01 +74 561 -1.66666666666667e-01 +74 564 -8.33333333333333e-02 +74 551 -2.50000000000000e-01 +74 480 1.66666666666667e-01 +74 376 8.33333333333333e-02 +74 375 -1.66666666666667e-01 +74 482 -7.50000000000000e-01 +74 481 1.66666666666667e-01 +74 174 8.33333333333333e-02 +74 554 -2.50000000000000e-01 +74 553 1.66666666666667e-01 +74 552 -8.33333333333333e-02 +74 291 8.33333333333333e-02 +74 442 -8.33333333333333e-02 +74 73 -3.33333333333333e-01 +74 516 -8.33333333333333e-02 +74 349 -8.33333333333333e-02 +74 412 8.33333333333333e-02 +74 348 -8.33333333333333e-02 +74 411 8.33333333333333e-02 +74 518 -2.50000000000000e-01 +74 175 -1.66666666666667e-01 +74 517 1.66666666666667e-01 +74 555 8.33333333333333e-02 +74 560 -7.50000000000000e-01 +74 443 -2.50000000000000e-01 +74 559 1.66666666666667e-01 +74 292 -1.66666666666667e-01 +74 72 -3.33333333333333e-01 +74 558 1.66666666666667e-01 +74 441 1.66666666666667e-01 +75 75 2.50000000000000e+00 +75 571 1.66666666666667e-01 +75 570 -2.50000000000000e-01 +75 485 -1.66666666666667e-01 +75 484 8.33333333333333e-02 +75 551 1.66666666666667e-01 +75 583 8.33333333333333e-02 +75 550 1.66666666666667e-01 +75 549 -7.50000000000000e-01 +75 584 8.33333333333333e-02 +75 496 -8.33333333333333e-02 +75 497 1.66666666666667e-01 +75 77 -3.33333333333333e-01 +75 179 -8.33333333333333e-02 +75 495 -2.50000000000000e-01 +75 575 8.33333333333333e-02 +75 314 -8.33333333333333e-02 +75 574 -1.66666666666667e-01 +75 467 8.33333333333333e-02 +75 568 1.66666666666667e-01 +75 76 -3.33333333333333e-01 +75 569 1.66666666666667e-01 +75 313 -8.33333333333333e-02 +75 567 -7.50000000000000e-01 +75 466 8.33333333333333e-02 +75 178 -8.33333333333333e-02 +75 533 -8.33333333333333e-02 +75 521 8.33333333333333e-02 +75 580 8.33333333333333e-02 +75 577 -8.33333333333333e-02 +75 520 -1.66666666666667e-01 +75 532 1.66666666666667e-01 +75 531 -2.50000000000000e-01 +75 578 1.66666666666667e-01 +75 581 -1.66666666666667e-01 +75 576 -2.50000000000000e-01 +75 572 -8.33333333333333e-02 +76 76 2.50000000000000e+00 +76 570 1.66666666666667e-01 +76 572 1.66666666666667e-01 +76 571 -7.50000000000000e-01 +76 483 8.33333333333333e-02 +76 551 -8.33333333333333e-02 +76 582 8.33333333333333e-02 +76 550 -2.50000000000000e-01 +76 549 1.66666666666667e-01 +76 584 -1.66666666666667e-01 +76 495 -8.33333333333333e-02 +76 575 8.33333333333333e-02 +76 497 1.66666666666667e-01 +76 496 -2.50000000000000e-01 +76 573 -1.66666666666667e-01 +76 569 -8.33333333333333e-02 +76 567 1.66666666666667e-01 +76 75 -3.33333333333333e-01 +76 568 -2.50000000000000e-01 +76 312 -8.33333333333333e-02 +76 467 -1.66666666666667e-01 +76 465 8.33333333333333e-02 +76 177 -8.33333333333333e-02 +76 533 1.66666666666667e-01 +76 77 -3.33333333333333e-01 +76 578 1.66666666666667e-01 +76 579 8.33333333333333e-02 +76 576 -8.33333333333333e-02 +76 521 8.33333333333333e-02 +76 179 -8.33333333333333e-02 +76 532 -7.50000000000000e-01 +76 519 -1.66666666666667e-01 +76 531 1.66666666666667e-01 +76 581 8.33333333333333e-02 +76 314 -8.33333333333333e-02 +76 577 -2.50000000000000e-01 +76 485 8.33333333333333e-02 +77 77 2.50000000000000e+00 +77 484 8.33333333333333e-02 +77 572 -2.50000000000000e-01 +77 571 1.66666666666667e-01 +77 483 -1.66666666666667e-01 +77 550 -8.33333333333333e-02 +77 549 1.66666666666667e-01 +77 551 -2.50000000000000e-01 +77 583 -1.66666666666667e-01 +77 582 8.33333333333333e-02 +77 574 8.33333333333333e-02 +77 495 1.66666666666667e-01 +77 75 -3.33333333333333e-01 +77 497 -7.50000000000000e-01 +77 496 1.66666666666667e-01 +77 177 -8.33333333333333e-02 +77 573 8.33333333333333e-02 +77 312 -8.33333333333333e-02 +77 568 -8.33333333333333e-02 +77 465 8.33333333333333e-02 +77 569 -2.50000000000000e-01 +77 567 1.66666666666667e-01 +77 466 -1.66666666666667e-01 +77 531 -8.33333333333333e-02 +77 519 8.33333333333333e-02 +77 532 1.66666666666667e-01 +77 76 -3.33333333333333e-01 +77 577 1.66666666666667e-01 +77 533 -2.50000000000000e-01 +77 520 8.33333333333333e-02 +77 178 -8.33333333333333e-02 +77 578 -7.50000000000000e-01 +77 570 -8.33333333333333e-02 +77 580 8.33333333333333e-02 +77 313 -8.33333333333333e-02 +77 576 1.66666666666667e-01 +77 579 -1.66666666666667e-01 +78 78 1.25000000000000e+00 +78 226 8.33333333333333e-02 +78 79 -1.66666666666667e-01 +78 184 8.33333333333333e-02 +78 590 8.33333333333333e-02 +78 589 8.33333333333333e-02 +78 225 -1.25000000000000e-01 +78 587 1.66666666666667e-01 +78 586 -8.33333333333333e-02 +78 585 -2.50000000000000e-01 +78 183 -1.25000000000000e-01 +78 80 -1.66666666666667e-01 +78 185 -4.16666666666667e-02 +78 470 4.16666666666667e-02 +78 469 -8.33333333333333e-02 +78 227 -4.16666666666667e-02 +78 499 8.33333333333333e-02 +78 500 8.33333333333333e-02 +78 498 -3.75000000000000e-01 +78 976 -8.33333333333333e-02 +78 971 8.33333333333333e-02 +78 970 8.33333333333333e-02 +78 969 -3.75000000000000e-01 +78 980 -8.33333333333333e-02 +78 979 -8.33333333333333e-02 +78 974 -1.66666666666667e-01 +78 973 8.33333333333333e-02 +78 977 4.16666666666667e-02 +79 79 1.25000000000000e+00 +79 225 8.33333333333333e-02 +79 78 -1.66666666666667e-01 +79 183 8.33333333333333e-02 +79 590 -1.66666666666667e-01 +79 227 8.33333333333333e-02 +79 226 -3.75000000000000e-01 +79 588 8.33333333333333e-02 +79 587 1.66666666666667e-01 +79 80 -1.66666666666667e-01 +79 185 8.33333333333333e-02 +79 586 -2.50000000000000e-01 +79 184 -3.75000000000000e-01 +79 585 -8.33333333333333e-02 +79 470 4.16666666666667e-02 +79 468 -8.33333333333333e-02 +79 500 -4.16666666666667e-02 +79 499 -1.25000000000000e-01 +79 498 8.33333333333333e-02 +79 975 -8.33333333333333e-02 +79 971 -4.16666666666667e-02 +79 970 -1.25000000000000e-01 +79 969 8.33333333333333e-02 +79 980 -8.33333333333333e-02 +79 974 8.33333333333333e-02 +79 978 -8.33333333333333e-02 +79 977 4.16666666666667e-02 +79 972 8.33333333333333e-02 +80 80 1.25000000000000e+00 +80 588 8.33333333333333e-02 +80 227 -1.25000000000000e-01 +80 589 -1.66666666666667e-01 +80 226 8.33333333333333e-02 +80 587 -7.50000000000000e-01 +80 185 -1.25000000000000e-01 +80 586 1.66666666666667e-01 +80 79 -1.66666666666667e-01 +80 184 8.33333333333333e-02 +80 585 1.66666666666667e-01 +80 469 4.16666666666667e-02 +80 498 8.33333333333333e-02 +80 78 -1.66666666666667e-01 +80 183 -4.16666666666667e-02 +80 468 4.16666666666667e-02 +80 499 -4.16666666666667e-02 +80 500 -1.25000000000000e-01 +80 225 -4.16666666666667e-02 +80 976 4.16666666666667e-02 +80 971 -1.25000000000000e-01 +80 970 -4.16666666666667e-02 +80 969 8.33333333333333e-02 +80 978 -8.33333333333333e-02 +80 979 -8.33333333333333e-02 +80 973 8.33333333333333e-02 +80 975 4.16666666666667e-02 +80 972 -1.66666666666667e-01 +81 81 1.25000000000000e+00 +81 596 8.33333333333333e-02 +81 593 -8.33333333333333e-02 +81 592 1.66666666666667e-01 +81 591 -2.50000000000000e-01 +81 269 8.33333333333333e-02 +81 267 -1.25000000000000e-01 +81 83 -1.66666666666667e-01 +81 188 8.33333333333333e-02 +81 595 8.33333333333333e-02 +81 186 -1.25000000000000e-01 +81 82 -1.66666666666667e-01 +81 535 8.33333333333333e-02 +81 473 -8.33333333333333e-02 +81 187 -4.16666666666667e-02 +81 472 4.16666666666667e-02 +81 536 8.33333333333333e-02 +81 268 -4.16666666666667e-02 +81 534 -3.75000000000000e-01 +81 1004 8.33333333333333e-02 +81 1010 -8.33333333333333e-02 +81 1006 4.16666666666667e-02 +81 1009 -8.33333333333333e-02 +81 1007 -8.33333333333333e-02 +81 1001 8.33333333333333e-02 +81 1000 8.33333333333333e-02 +81 1003 -1.66666666666667e-01 +81 999 -3.75000000000000e-01 +82 82 1.25000000000000e+00 +82 596 -1.66666666666667e-01 +82 269 8.33333333333333e-02 +82 593 1.66666666666667e-01 +82 83 -1.66666666666667e-01 +82 188 8.33333333333333e-02 +82 592 -7.50000000000000e-01 +82 591 1.66666666666667e-01 +82 268 -1.25000000000000e-01 +82 594 8.33333333333333e-02 +82 187 -1.25000000000000e-01 +82 536 -4.16666666666667e-02 +82 81 -1.66666666666667e-01 +82 534 8.33333333333333e-02 +82 186 -4.16666666666667e-02 +82 471 4.16666666666667e-02 +82 473 4.16666666666667e-02 +82 535 -1.25000000000000e-01 +82 267 -4.16666666666667e-02 +82 1005 4.16666666666667e-02 +82 1008 -8.33333333333333e-02 +82 1007 4.16666666666667e-02 +82 1010 -8.33333333333333e-02 +82 1001 -4.16666666666667e-02 +82 1004 8.33333333333333e-02 +82 1000 -1.25000000000000e-01 +82 999 8.33333333333333e-02 +82 1002 -1.66666666666667e-01 +83 83 1.25000000000000e+00 +83 268 8.33333333333333e-02 +83 594 8.33333333333333e-02 +83 593 -2.50000000000000e-01 +83 592 1.66666666666667e-01 +83 82 -1.66666666666667e-01 +83 187 8.33333333333333e-02 +83 591 -8.33333333333333e-02 +83 269 -3.75000000000000e-01 +83 267 8.33333333333333e-02 +83 595 -1.66666666666667e-01 +83 188 -3.75000000000000e-01 +83 81 -1.66666666666667e-01 +83 186 8.33333333333333e-02 +83 472 4.16666666666667e-02 +83 535 -4.16666666666667e-02 +83 471 -8.33333333333333e-02 +83 536 -1.25000000000000e-01 +83 534 8.33333333333333e-02 +83 1002 8.33333333333333e-02 +83 1008 -8.33333333333333e-02 +83 1006 4.16666666666667e-02 +83 1009 -8.33333333333333e-02 +83 1005 -8.33333333333333e-02 +83 1001 -1.25000000000000e-01 +83 1000 -4.16666666666667e-02 +83 1003 8.33333333333333e-02 +83 999 8.33333333333333e-02 +84 84 2.50000000000000e+00 +84 599 -8.33333333333333e-02 +84 598 1.66666666666667e-01 +84 316 8.33333333333333e-02 +84 597 -2.50000000000000e-01 +84 86 -3.33333333333333e-01 +84 587 1.66666666666667e-01 +84 586 -8.33333333333333e-02 +84 190 8.33333333333333e-02 +84 585 -2.50000000000000e-01 +84 601 -8.33333333333333e-02 +84 602 1.66666666666667e-01 +84 317 8.33333333333333e-02 +84 600 -2.50000000000000e-01 +84 593 -8.33333333333333e-02 +84 191 8.33333333333333e-02 +84 85 -3.33333333333333e-01 +84 592 1.66666666666667e-01 +84 591 -2.50000000000000e-01 +84 502 8.33333333333333e-02 +84 503 -1.66666666666667e-01 +84 476 -8.33333333333333e-02 +84 539 8.33333333333333e-02 +84 568 1.66666666666667e-01 +84 538 -1.66666666666667e-01 +84 475 -8.33333333333333e-02 +84 569 1.66666666666667e-01 +84 567 -7.50000000000000e-01 +84 1033 -1.66666666666667e-01 +84 1031 1.66666666666667e-01 +84 1037 -1.66666666666667e-01 +84 1039 -8.33333333333333e-02 +84 1036 8.33333333333333e-02 +84 1040 -8.33333333333333e-02 +84 1030 1.66666666666667e-01 +84 1034 8.33333333333333e-02 +84 1029 -7.50000000000000e-01 +85 85 2.50000000000000e+00 +85 599 1.66666666666667e-01 +85 598 -7.50000000000000e-01 +85 315 8.33333333333333e-02 +85 587 1.66666666666667e-01 +85 586 -2.50000000000000e-01 +85 585 -8.33333333333333e-02 +85 189 8.33333333333333e-02 +85 86 -3.33333333333333e-01 +85 600 -8.33333333333333e-02 +85 317 -1.66666666666667e-01 +85 602 1.66666666666667e-01 +85 601 -2.50000000000000e-01 +85 593 1.66666666666667e-01 +85 191 -1.66666666666667e-01 +85 597 1.66666666666667e-01 +85 592 -7.50000000000000e-01 +85 84 -3.33333333333333e-01 +85 591 1.66666666666667e-01 +85 503 8.33333333333333e-02 +85 569 -8.33333333333333e-02 +85 476 -8.33333333333333e-02 +85 539 8.33333333333333e-02 +85 567 1.66666666666667e-01 +85 537 -1.66666666666667e-01 +85 474 -8.33333333333333e-02 +85 501 8.33333333333333e-02 +85 568 -2.50000000000000e-01 +85 1034 8.33333333333333e-02 +85 1032 -1.66666666666667e-01 +85 1031 -8.33333333333333e-02 +85 1040 -8.33333333333333e-02 +85 1037 8.33333333333333e-02 +85 1038 -8.33333333333333e-02 +85 1035 8.33333333333333e-02 +85 1030 -2.50000000000000e-01 +85 1029 1.66666666666667e-01 +86 86 2.50000000000000e+00 +86 597 -8.33333333333333e-02 +86 599 -2.50000000000000e-01 +86 598 1.66666666666667e-01 +86 587 -7.50000000000000e-01 +86 586 1.66666666666667e-01 +86 84 -3.33333333333333e-01 +86 585 1.66666666666667e-01 +86 85 -3.33333333333333e-01 +86 600 1.66666666666667e-01 +86 602 -7.50000000000000e-01 +86 316 -1.66666666666667e-01 +86 601 1.66666666666667e-01 +86 315 8.33333333333333e-02 +86 593 -2.50000000000000e-01 +86 592 1.66666666666667e-01 +86 190 -1.66666666666667e-01 +86 591 -8.33333333333333e-02 +86 189 8.33333333333333e-02 +86 502 8.33333333333333e-02 +86 501 -1.66666666666667e-01 +86 568 -8.33333333333333e-02 +86 475 -8.33333333333333e-02 +86 538 8.33333333333333e-02 +86 474 -8.33333333333333e-02 +86 537 8.33333333333333e-02 +86 569 -2.50000000000000e-01 +86 567 1.66666666666667e-01 +86 1033 8.33333333333333e-02 +86 1030 -8.33333333333333e-02 +86 1039 -8.33333333333333e-02 +86 1036 8.33333333333333e-02 +86 1029 1.66666666666667e-01 +86 1035 -1.66666666666667e-01 +86 1038 -8.33333333333333e-02 +86 1032 8.33333333333333e-02 +86 1031 -2.50000000000000e-01 +87 87 5.00000000000000e-01 +87 380 -4.16666666666667e-02 +87 607 4.16666666666667e-02 +87 604 -4.16666666666667e-02 +87 212 4.16666666666667e-02 +87 608 -8.33333333333333e-02 +87 211 4.16666666666667e-02 +87 88 -8.33333333333333e-02 +87 379 8.33333333333333e-02 +87 210 -1.25000000000000e-01 +87 378 -1.25000000000000e-01 +87 89 -8.33333333333333e-02 +87 197 4.16666666666667e-02 +87 605 8.33333333333333e-02 +87 196 4.16666666666667e-02 +87 361 -8.33333333333333e-02 +87 362 4.16666666666667e-02 +87 195 -1.25000000000000e-01 +87 603 -1.25000000000000e-01 +88 88 5.83333333333333e-01 +88 380 8.33333333333333e-02 +88 605 8.33333333333333e-02 +88 606 4.16666666666667e-02 +88 603 -4.16666666666667e-02 +88 212 -4.16666666666667e-02 +88 608 4.16666666666667e-02 +88 211 -4.16666666666667e-02 +88 379 -3.75000000000000e-01 +88 210 4.16666666666667e-02 +88 87 -8.33333333333333e-02 +88 378 8.33333333333333e-02 +88 197 -4.16666666666667e-02 +88 362 4.16666666666667e-02 +88 89 -1.66666666666667e-01 +88 196 -4.16666666666667e-02 +88 604 -1.25000000000000e-01 +88 195 4.16666666666667e-02 +88 360 -8.33333333333333e-02 +89 89 5.83333333333333e-01 +89 378 -4.16666666666667e-02 +89 88 -1.66666666666667e-01 +89 379 8.33333333333333e-02 +89 604 8.33333333333333e-02 +89 212 -4.16666666666667e-02 +89 380 -1.25000000000000e-01 +89 211 -4.16666666666667e-02 +89 607 4.16666666666667e-02 +89 210 4.16666666666667e-02 +89 606 -8.33333333333333e-02 +89 360 4.16666666666667e-02 +89 197 -4.16666666666667e-02 +89 605 -3.75000000000000e-01 +89 196 -4.16666666666667e-02 +89 361 4.16666666666667e-02 +89 87 -8.33333333333333e-02 +89 195 4.16666666666667e-02 +89 603 8.33333333333333e-02 +90 90 3.39166666666667e+01 +90 200 2.12500000000000e+00 +90 92 -4.25000000000000e+00 +90 281 2.12500000000000e+00 +90 364 2.12500000000000e+00 +90 365 2.12500000000000e+00 +90 198 -4.20833333333333e+00 +90 428 -2.12500000000000e+00 +90 427 4.25000000000000e+00 +90 426 -6.37500000000000e+00 +90 279 -4.20833333333333e+00 +90 610 8.33333333333333e-02 +90 91 -1.66666666666667e-01 +90 614 -8.33333333333333e-02 +90 280 -4.16666666666667e-02 +90 613 4.16666666666667e-02 +90 611 8.33333333333333e-02 +90 199 -4.16666666666667e-02 +90 609 -3.75000000000000e-01 +90 1826 -4.16666666666667e+00 +90 1835 4.16666666666667e+00 +90 1834 4.16666666666667e+00 +90 1833 -1.87500000000000e+01 +90 1729 -4.16666666666667e+00 +90 1730 -4.16666666666667e+00 +90 1793 4.16666666666667e+00 +90 1792 -8.33333333333333e+00 +90 1825 2.08333333333333e+00 +91 91 3.39166666666667e+01 +91 363 2.12500000000000e+00 +91 365 -4.25000000000000e+00 +91 200 2.12500000000000e+00 +91 199 -4.20833333333333e+00 +91 428 4.25000000000000e+00 +91 92 -4.25000000000000e+00 +91 281 2.12500000000000e+00 +91 427 -1.91250000000000e+01 +91 280 -4.20833333333333e+00 +91 426 4.25000000000000e+00 +91 614 4.16666666666667e-02 +91 609 8.33333333333333e-02 +91 90 -1.66666666666667e-01 +91 279 -4.16666666666667e-02 +91 612 4.16666666666667e-02 +91 611 -4.16666666666667e-02 +91 610 -1.25000000000000e-01 +91 198 -4.16666666666667e-02 +91 1826 2.08333333333333e+00 +91 1835 -2.08333333333333e+00 +91 1834 -6.25000000000000e+00 +91 1833 4.16666666666667e+00 +91 1728 -4.16666666666667e+00 +91 1730 -4.16666666666667e+00 +91 1793 4.16666666666667e+00 +91 1824 2.08333333333333e+00 +91 1791 -8.33333333333333e+00 +92 92 3.80000000000000e+01 +92 198 2.12500000000000e+00 +92 90 -4.25000000000000e+00 +92 279 2.12500000000000e+00 +92 200 -1.26250000000000e+01 +92 364 -4.25000000000000e+00 +92 199 2.12500000000000e+00 +92 363 2.12500000000000e+00 +92 428 -6.37500000000000e+00 +92 281 -1.26250000000000e+01 +92 427 4.25000000000000e+00 +92 91 -4.25000000000000e+00 +92 280 2.12500000000000e+00 +92 426 -2.12500000000000e+00 +92 613 4.16666666666667e-02 +92 612 -8.33333333333333e-02 +92 610 -4.16666666666667e-02 +92 611 -1.25000000000000e-01 +92 609 8.33333333333333e-02 +92 1824 -4.16666666666667e+00 +92 1835 -6.25000000000000e+00 +92 1834 -2.08333333333333e+00 +92 1833 4.16666666666667e+00 +92 1729 -4.16666666666667e+00 +92 1792 4.16666666666667e+00 +92 1728 -4.16666666666667e+00 +92 1825 2.08333333333333e+00 +92 1791 4.16666666666667e+00 +93 93 1.25000000000000e+00 +93 382 8.33333333333333e-02 +93 383 8.33333333333333e-02 +93 605 8.33333333333333e-02 +93 603 -1.25000000000000e-01 +93 617 8.33333333333333e-02 +93 616 8.33333333333333e-02 +93 94 -1.66666666666667e-01 +93 615 -3.75000000000000e-01 +93 446 -8.33333333333333e-02 +93 95 -1.66666666666667e-01 +93 368 -8.33333333333333e-02 +93 431 8.33333333333333e-02 +93 610 8.33333333333333e-02 +93 445 1.66666666666667e-01 +93 430 -1.66666666666667e-01 +93 611 8.33333333333333e-02 +93 203 -8.33333333333333e-02 +93 202 4.16666666666667e-02 +93 367 -8.33333333333333e-02 +93 609 -3.75000000000000e-01 +93 620 8.33333333333333e-02 +93 296 -8.33333333333333e-02 +93 619 -4.16666666666667e-02 +93 295 4.16666666666667e-02 +93 618 -1.25000000000000e-01 +93 604 -4.16666666666667e-02 +93 444 -2.50000000000000e-01 +94 94 1.25000000000000e+00 +94 603 -4.16666666666667e-02 +94 381 8.33333333333333e-02 +94 383 -1.66666666666667e-01 +94 203 4.16666666666667e-02 +94 604 -1.25000000000000e-01 +94 617 -4.16666666666667e-02 +94 296 4.16666666666667e-02 +94 616 -1.25000000000000e-01 +94 615 8.33333333333333e-02 +94 93 -1.66666666666667e-01 +94 611 -4.16666666666667e-02 +94 609 8.33333333333333e-02 +94 368 -8.33333333333333e-02 +94 431 8.33333333333333e-02 +94 444 1.66666666666667e-01 +94 429 -1.66666666666667e-01 +94 610 -1.25000000000000e-01 +94 201 4.16666666666667e-02 +94 366 -8.33333333333333e-02 +94 620 8.33333333333333e-02 +94 95 -1.66666666666667e-01 +94 446 1.66666666666667e-01 +94 619 -1.25000000000000e-01 +94 605 8.33333333333333e-02 +94 445 -7.50000000000000e-01 +94 618 -4.16666666666667e-02 +94 294 4.16666666666667e-02 +95 95 1.25000000000000e+00 +95 382 -1.66666666666667e-01 +95 381 8.33333333333333e-02 +95 605 -3.75000000000000e-01 +95 202 4.16666666666667e-02 +95 603 8.33333333333333e-02 +95 617 -1.25000000000000e-01 +95 616 -4.16666666666667e-02 +95 295 4.16666666666667e-02 +95 615 8.33333333333333e-02 +95 444 -8.33333333333333e-02 +95 610 -4.16666666666667e-02 +95 93 -1.66666666666667e-01 +95 366 -8.33333333333333e-02 +95 429 8.33333333333333e-02 +95 367 -8.33333333333333e-02 +95 430 8.33333333333333e-02 +95 611 -1.25000000000000e-01 +95 609 8.33333333333333e-02 +95 201 -8.33333333333333e-02 +95 620 -3.75000000000000e-01 +95 604 8.33333333333333e-02 +95 446 -2.50000000000000e-01 +95 619 8.33333333333333e-02 +95 94 -1.66666666666667e-01 +95 445 1.66666666666667e-01 +95 618 8.33333333333333e-02 +95 294 -8.33333333333333e-02 +96 96 5.00000000000000e-01 +96 506 -4.16666666666667e-02 +96 625 4.16666666666667e-02 +96 622 -4.16666666666667e-02 +96 230 4.16666666666667e-02 +96 626 -8.33333333333333e-02 +96 229 4.16666666666667e-02 +96 97 -8.33333333333333e-02 +96 505 8.33333333333333e-02 +96 228 -1.25000000000000e-01 +96 504 -1.25000000000000e-01 +96 98 -8.33333333333333e-02 +96 215 4.16666666666667e-02 +96 623 8.33333333333333e-02 +96 214 4.16666666666667e-02 +96 487 -8.33333333333333e-02 +96 488 4.16666666666667e-02 +96 213 -1.25000000000000e-01 +96 621 -1.25000000000000e-01 +97 97 5.83333333333333e-01 +97 506 8.33333333333333e-02 +97 623 8.33333333333333e-02 +97 624 4.16666666666667e-02 +97 621 -4.16666666666667e-02 +97 230 -4.16666666666667e-02 +97 626 4.16666666666667e-02 +97 229 -4.16666666666667e-02 +97 505 -3.75000000000000e-01 +97 228 4.16666666666667e-02 +97 96 -8.33333333333333e-02 +97 504 8.33333333333333e-02 +97 215 -4.16666666666667e-02 +97 488 4.16666666666667e-02 +97 98 -1.66666666666667e-01 +97 214 -4.16666666666667e-02 +97 622 -1.25000000000000e-01 +97 213 4.16666666666667e-02 +97 486 -8.33333333333333e-02 +98 98 5.83333333333333e-01 +98 504 -4.16666666666667e-02 +98 97 -1.66666666666667e-01 +98 505 8.33333333333333e-02 +98 622 8.33333333333333e-02 +98 230 -4.16666666666667e-02 +98 506 -1.25000000000000e-01 +98 229 -4.16666666666667e-02 +98 625 4.16666666666667e-02 +98 228 4.16666666666667e-02 +98 624 -8.33333333333333e-02 +98 486 4.16666666666667e-02 +98 215 -4.16666666666667e-02 +98 623 -3.75000000000000e-01 +98 214 -4.16666666666667e-02 +98 487 4.16666666666667e-02 +98 96 -8.33333333333333e-02 +98 213 4.16666666666667e-02 +98 621 8.33333333333333e-02 +99 99 1.25000000000000e+00 +99 100 -1.66666666666667e-01 +99 632 -8.33333333333333e-02 +99 298 -4.16666666666667e-02 +99 631 4.16666666666667e-02 +99 629 8.33333333333333e-02 +99 217 -4.16666666666667e-02 +99 627 -3.75000000000000e-01 +99 607 4.16666666666667e-02 +99 218 8.33333333333333e-02 +99 608 -8.33333333333333e-02 +99 101 -1.66666666666667e-01 +99 617 8.33333333333333e-02 +99 299 8.33333333333333e-02 +99 616 8.33333333333333e-02 +99 615 -3.75000000000000e-01 +99 385 -8.33333333333333e-02 +99 490 8.33333333333333e-02 +99 491 8.33333333333333e-02 +99 386 -8.33333333333333e-02 +99 216 -1.25000000000000e-01 +99 554 -8.33333333333333e-02 +99 449 8.33333333333333e-02 +99 553 1.66666666666667e-01 +99 448 -1.66666666666667e-01 +99 552 -2.50000000000000e-01 +99 628 8.33333333333333e-02 +99 297 -1.25000000000000e-01 +100 100 1.25000000000000e+00 +100 632 4.16666666666667e-02 +100 627 8.33333333333333e-02 +100 99 -1.66666666666667e-01 +100 297 -4.16666666666667e-02 +100 630 4.16666666666667e-02 +100 628 -1.25000000000000e-01 +100 216 -4.16666666666667e-02 +100 606 4.16666666666667e-02 +100 608 4.16666666666667e-02 +100 617 -4.16666666666667e-02 +100 616 -1.25000000000000e-01 +100 615 8.33333333333333e-02 +100 384 -8.33333333333333e-02 +100 489 8.33333333333333e-02 +100 386 -8.33333333333333e-02 +100 449 8.33333333333333e-02 +100 491 -1.66666666666667e-01 +100 218 8.33333333333333e-02 +100 217 -1.25000000000000e-01 +100 554 1.66666666666667e-01 +100 101 -1.66666666666667e-01 +100 299 8.33333333333333e-02 +100 553 -7.50000000000000e-01 +100 629 -4.16666666666667e-02 +100 298 -1.25000000000000e-01 +100 552 1.66666666666667e-01 +100 447 -1.66666666666667e-01 +101 101 1.25000000000000e+00 +101 631 4.16666666666667e-02 +101 630 -8.33333333333333e-02 +101 629 -1.25000000000000e-01 +101 627 8.33333333333333e-02 +101 607 4.16666666666667e-02 +101 216 8.33333333333333e-02 +101 606 -8.33333333333333e-02 +101 617 -1.25000000000000e-01 +101 616 -4.16666666666667e-02 +101 99 -1.66666666666667e-01 +101 615 8.33333333333333e-02 +101 297 8.33333333333333e-02 +101 385 -8.33333333333333e-02 +101 448 8.33333333333333e-02 +101 218 -3.75000000000000e-01 +101 490 -1.66666666666667e-01 +101 217 8.33333333333333e-02 +101 489 8.33333333333333e-02 +101 384 -8.33333333333333e-02 +101 554 -2.50000000000000e-01 +101 628 -4.16666666666667e-02 +101 299 -3.75000000000000e-01 +101 553 1.66666666666667e-01 +101 100 -1.66666666666667e-01 +101 298 8.33333333333333e-02 +101 552 -8.33333333333333e-02 +101 447 8.33333333333333e-02 +102 102 1.25000000000000e+00 +102 508 8.33333333333333e-02 +102 509 8.33333333333333e-02 +102 623 8.33333333333333e-02 +102 621 -1.25000000000000e-01 +102 635 8.33333333333333e-02 +102 634 8.33333333333333e-02 +102 103 -1.66666666666667e-01 +102 633 -3.75000000000000e-01 +102 572 -8.33333333333333e-02 +102 104 -1.66666666666667e-01 +102 494 -8.33333333333333e-02 +102 557 8.33333333333333e-02 +102 628 8.33333333333333e-02 +102 571 1.66666666666667e-01 +102 556 -1.66666666666667e-01 +102 629 8.33333333333333e-02 +102 221 -8.33333333333333e-02 +102 220 4.16666666666667e-02 +102 493 -8.33333333333333e-02 +102 627 -3.75000000000000e-01 +102 638 8.33333333333333e-02 +102 320 -8.33333333333333e-02 +102 637 -4.16666666666667e-02 +102 319 4.16666666666667e-02 +102 636 -1.25000000000000e-01 +102 622 -4.16666666666667e-02 +102 570 -2.50000000000000e-01 +103 103 1.25000000000000e+00 +103 621 -4.16666666666667e-02 +103 507 8.33333333333333e-02 +103 509 -1.66666666666667e-01 +103 221 4.16666666666667e-02 +103 622 -1.25000000000000e-01 +103 635 -4.16666666666667e-02 +103 320 4.16666666666667e-02 +103 634 -1.25000000000000e-01 +103 633 8.33333333333333e-02 +103 102 -1.66666666666667e-01 +103 629 -4.16666666666667e-02 +103 627 8.33333333333333e-02 +103 494 -8.33333333333333e-02 +103 557 8.33333333333333e-02 +103 570 1.66666666666667e-01 +103 555 -1.66666666666667e-01 +103 628 -1.25000000000000e-01 +103 219 4.16666666666667e-02 +103 492 -8.33333333333333e-02 +103 638 8.33333333333333e-02 +103 104 -1.66666666666667e-01 +103 572 1.66666666666667e-01 +103 637 -1.25000000000000e-01 +103 623 8.33333333333333e-02 +103 571 -7.50000000000000e-01 +103 636 -4.16666666666667e-02 +103 318 4.16666666666667e-02 +104 104 1.25000000000000e+00 +104 508 -1.66666666666667e-01 +104 507 8.33333333333333e-02 +104 623 -3.75000000000000e-01 +104 220 4.16666666666667e-02 +104 621 8.33333333333333e-02 +104 635 -1.25000000000000e-01 +104 634 -4.16666666666667e-02 +104 319 4.16666666666667e-02 +104 633 8.33333333333333e-02 +104 570 -8.33333333333333e-02 +104 628 -4.16666666666667e-02 +104 102 -1.66666666666667e-01 +104 492 -8.33333333333333e-02 +104 555 8.33333333333333e-02 +104 493 -8.33333333333333e-02 +104 556 8.33333333333333e-02 +104 629 -1.25000000000000e-01 +104 627 8.33333333333333e-02 +104 219 -8.33333333333333e-02 +104 638 -3.75000000000000e-01 +104 622 8.33333333333333e-02 +104 572 -2.50000000000000e-01 +104 637 8.33333333333333e-02 +104 103 -1.66666666666667e-01 +104 571 1.66666666666667e-01 +104 636 8.33333333333333e-02 +104 318 -8.33333333333333e-02 +105 105 1.25000000000000e+00 +105 599 -8.33333333333333e-02 +105 106 -1.66666666666667e-01 +105 598 1.66666666666667e-01 +105 323 8.33333333333333e-02 +105 322 -4.16666666666667e-02 +105 321 -1.25000000000000e-01 +105 597 -2.50000000000000e-01 +105 107 -1.66666666666667e-01 +105 233 8.33333333333333e-02 +105 232 -4.16666666666667e-02 +105 589 8.33333333333333e-02 +105 590 8.33333333333333e-02 +105 231 -1.25000000000000e-01 +105 626 -8.33333333333333e-02 +105 635 8.33333333333333e-02 +105 634 8.33333333333333e-02 +105 633 -3.75000000000000e-01 +105 511 -8.33333333333333e-02 +105 512 -8.33333333333333e-02 +105 575 8.33333333333333e-02 +105 574 -1.66666666666667e-01 +105 625 4.16666666666667e-02 +105 1210 8.33333333333333e-02 +105 1214 -8.33333333333333e-02 +105 1213 4.16666666666667e-02 +105 1211 8.33333333333333e-02 +105 1209 -3.75000000000000e-01 +106 106 1.25000000000000e+00 +106 105 -1.66666666666667e-01 +106 597 1.66666666666667e-01 +106 323 8.33333333333333e-02 +106 107 -1.66666666666667e-01 +106 599 1.66666666666667e-01 +106 322 -1.25000000000000e-01 +106 598 -7.50000000000000e-01 +106 321 -4.16666666666667e-02 +106 233 8.33333333333333e-02 +106 590 -1.66666666666667e-01 +106 232 -1.25000000000000e-01 +106 231 -4.16666666666667e-02 +106 588 8.33333333333333e-02 +106 626 4.16666666666667e-02 +106 635 -4.16666666666667e-02 +106 634 -1.25000000000000e-01 +106 633 8.33333333333333e-02 +106 510 -8.33333333333333e-02 +106 512 -8.33333333333333e-02 +106 575 8.33333333333333e-02 +106 624 4.16666666666667e-02 +106 573 -1.66666666666667e-01 +106 1214 4.16666666666667e-02 +106 1209 8.33333333333333e-02 +106 1212 4.16666666666667e-02 +106 1211 -4.16666666666667e-02 +106 1210 -1.25000000000000e-01 +107 107 1.25000000000000e+00 +107 588 8.33333333333333e-02 +107 597 -8.33333333333333e-02 +107 323 -3.75000000000000e-01 +107 599 -2.50000000000000e-01 +107 322 8.33333333333333e-02 +107 106 -1.66666666666667e-01 +107 598 1.66666666666667e-01 +107 321 8.33333333333333e-02 +107 233 -3.75000000000000e-01 +107 232 8.33333333333333e-02 +107 589 -1.66666666666667e-01 +107 105 -1.66666666666667e-01 +107 231 8.33333333333333e-02 +107 624 -8.33333333333333e-02 +107 635 -1.25000000000000e-01 +107 634 -4.16666666666667e-02 +107 633 8.33333333333333e-02 +107 511 -8.33333333333333e-02 +107 574 8.33333333333333e-02 +107 510 -8.33333333333333e-02 +107 625 4.16666666666667e-02 +107 573 8.33333333333333e-02 +107 1213 4.16666666666667e-02 +107 1212 -8.33333333333333e-02 +107 1210 -4.16666666666667e-02 +107 1211 -1.25000000000000e-01 +107 1209 8.33333333333333e-02 +108 108 5.00000000000000e-01 +108 397 4.16666666666667e-02 +108 644 4.16666666666667e-02 +108 641 -4.16666666666667e-02 +108 239 4.16666666666667e-02 +108 398 -8.33333333333333e-02 +108 238 4.16666666666667e-02 +108 109 -8.33333333333333e-02 +108 640 8.33333333333333e-02 +108 237 -1.25000000000000e-01 +108 639 -1.25000000000000e-01 +108 110 -8.33333333333333e-02 +108 254 4.16666666666667e-02 +108 416 8.33333333333333e-02 +108 253 4.16666666666667e-02 +108 643 -8.33333333333333e-02 +108 415 -4.16666666666667e-02 +108 252 -1.25000000000000e-01 +108 414 -1.25000000000000e-01 +109 109 5.83333333333333e-01 +109 396 4.16666666666667e-02 +109 416 8.33333333333333e-02 +109 110 -1.66666666666667e-01 +109 641 8.33333333333333e-02 +109 239 -4.16666666666667e-02 +109 398 4.16666666666667e-02 +109 238 -4.16666666666667e-02 +109 640 -3.75000000000000e-01 +109 237 4.16666666666667e-02 +109 108 -8.33333333333333e-02 +109 639 8.33333333333333e-02 +109 254 -4.16666666666667e-02 +109 644 4.16666666666667e-02 +109 414 -4.16666666666667e-02 +109 253 -4.16666666666667e-02 +109 415 -1.25000000000000e-01 +109 252 4.16666666666667e-02 +109 642 -8.33333333333333e-02 +110 110 5.83333333333333e-01 +110 109 -1.66666666666667e-01 +110 640 8.33333333333333e-02 +110 642 4.16666666666667e-02 +110 639 -4.16666666666667e-02 +110 239 -4.16666666666667e-02 +110 641 -1.25000000000000e-01 +110 238 -4.16666666666667e-02 +110 397 4.16666666666667e-02 +110 237 4.16666666666667e-02 +110 396 -8.33333333333333e-02 +110 415 8.33333333333333e-02 +110 254 -4.16666666666667e-02 +110 416 -3.75000000000000e-01 +110 253 -4.16666666666667e-02 +110 643 4.16666666666667e-02 +110 108 -8.33333333333333e-02 +110 252 4.16666666666667e-02 +110 414 8.33333333333333e-02 +111 111 3.39166666666667e+01 +111 400 2.12500000000000e+00 +111 434 4.25000000000000e+00 +111 433 -2.12500000000000e+00 +111 432 -6.37500000000000e+00 +111 241 2.12500000000000e+00 +111 240 -4.20833333333333e+00 +111 112 -4.25000000000000e+00 +111 283 2.12500000000000e+00 +111 401 2.12500000000000e+00 +111 282 -4.20833333333333e+00 +111 113 -1.66666666666667e-01 +111 647 8.33333333333333e-02 +111 284 -4.16666666666667e-02 +111 650 4.16666666666667e-02 +111 649 -8.33333333333333e-02 +111 242 -4.16666666666667e-02 +111 646 8.33333333333333e-02 +111 645 -3.75000000000000e-01 +111 1766 -4.16666666666667e+00 +111 1862 2.08333333333333e+00 +111 1765 -4.16666666666667e+00 +111 1798 4.16666666666667e+00 +111 1861 -4.16666666666667e+00 +111 1871 4.16666666666667e+00 +111 1799 -8.33333333333333e+00 +111 1870 4.16666666666667e+00 +111 1869 -1.87500000000000e+01 +112 112 3.80000000000000e+01 +112 242 2.12500000000000e+00 +112 399 2.12500000000000e+00 +112 434 4.25000000000000e+00 +112 113 -4.25000000000000e+00 +112 284 2.12500000000000e+00 +112 433 -6.37500000000000e+00 +112 432 -2.12500000000000e+00 +112 241 -1.26250000000000e+01 +112 240 2.12500000000000e+00 +112 401 -4.25000000000000e+00 +112 283 -1.26250000000000e+01 +112 111 -4.25000000000000e+00 +112 282 2.12500000000000e+00 +112 650 4.16666666666667e-02 +112 647 -4.16666666666667e-02 +112 648 -8.33333333333333e-02 +112 646 -1.25000000000000e-01 +112 645 8.33333333333333e-02 +112 1764 -4.16666666666667e+00 +112 1797 4.16666666666667e+00 +112 1862 2.08333333333333e+00 +112 1766 -4.16666666666667e+00 +112 1860 -4.16666666666667e+00 +112 1871 -2.08333333333333e+00 +112 1799 4.16666666666667e+00 +112 1870 -6.25000000000000e+00 +112 1869 4.16666666666667e+00 +113 113 3.39166666666667e+01 +113 400 -4.25000000000000e+00 +113 241 2.12500000000000e+00 +113 434 -1.91250000000000e+01 +113 433 4.25000000000000e+00 +113 112 -4.25000000000000e+00 +113 283 2.12500000000000e+00 +113 432 4.25000000000000e+00 +113 242 -4.20833333333333e+00 +113 399 2.12500000000000e+00 +113 284 -4.20833333333333e+00 +113 646 -4.16666666666667e-02 +113 111 -1.66666666666667e-01 +113 645 8.33333333333333e-02 +113 282 -4.16666666666667e-02 +113 648 4.16666666666667e-02 +113 649 4.16666666666667e-02 +113 647 -1.25000000000000e-01 +113 240 -4.16666666666667e-02 +113 1764 -4.16666666666667e+00 +113 1860 2.08333333333333e+00 +113 1861 2.08333333333333e+00 +113 1765 -4.16666666666667e+00 +113 1871 -6.25000000000000e+00 +113 1870 -2.08333333333333e+00 +113 1798 4.16666666666667e+00 +113 1869 4.16666666666667e+00 +113 1797 -8.33333333333333e+00 +114 114 1.25000000000000e+00 +114 437 -1.66666666666667e-01 +114 436 8.33333333333333e-02 +114 245 4.16666666666667e-02 +114 646 8.33333333333333e-02 +114 645 -3.75000000000000e-01 +114 656 -4.16666666666667e-02 +114 302 4.16666666666667e-02 +114 655 8.33333333333333e-02 +114 654 -1.25000000000000e-01 +114 404 -8.33333333333333e-02 +114 403 -8.33333333333333e-02 +114 419 8.33333333333333e-02 +114 641 -4.16666666666667e-02 +114 115 -1.66666666666667e-01 +114 418 8.33333333333333e-02 +114 451 -8.33333333333333e-02 +114 244 -8.33333333333333e-02 +114 640 8.33333333333333e-02 +114 639 -1.25000000000000e-01 +114 116 -1.66666666666667e-01 +114 653 8.33333333333333e-02 +114 452 1.66666666666667e-01 +114 652 8.33333333333333e-02 +114 301 -8.33333333333333e-02 +114 647 8.33333333333333e-02 +114 651 -3.75000000000000e-01 +114 450 -2.50000000000000e-01 +115 115 1.25000000000000e+00 +115 437 8.33333333333333e-02 +115 435 8.33333333333333e-02 +115 646 -1.25000000000000e-01 +115 645 8.33333333333333e-02 +115 656 8.33333333333333e-02 +115 116 -1.66666666666667e-01 +115 655 -3.75000000000000e-01 +115 654 8.33333333333333e-02 +115 402 -8.33333333333333e-02 +115 641 8.33333333333333e-02 +115 114 -1.66666666666667e-01 +115 419 -1.66666666666667e-01 +115 452 1.66666666666667e-01 +115 417 8.33333333333333e-02 +115 450 -8.33333333333333e-02 +115 245 4.16666666666667e-02 +115 404 -8.33333333333333e-02 +115 640 -3.75000000000000e-01 +115 243 -8.33333333333333e-02 +115 639 8.33333333333333e-02 +115 653 -4.16666666666667e-02 +115 302 4.16666666666667e-02 +115 647 -4.16666666666667e-02 +115 652 -1.25000000000000e-01 +115 451 -2.50000000000000e-01 +115 651 8.33333333333333e-02 +115 300 -8.33333333333333e-02 +116 116 1.25000000000000e+00 +116 436 8.33333333333333e-02 +116 645 8.33333333333333e-02 +116 435 -1.66666666666667e-01 +116 647 -1.25000000000000e-01 +116 243 4.16666666666667e-02 +116 656 -1.25000000000000e-01 +116 655 8.33333333333333e-02 +116 115 -1.66666666666667e-01 +116 654 -4.16666666666667e-02 +116 300 4.16666666666667e-02 +116 402 -8.33333333333333e-02 +116 640 8.33333333333333e-02 +116 417 8.33333333333333e-02 +116 639 -4.16666666666667e-02 +116 418 -1.66666666666667e-01 +116 451 1.66666666666667e-01 +116 641 -1.25000000000000e-01 +116 244 4.16666666666667e-02 +116 403 -8.33333333333333e-02 +116 646 -4.16666666666667e-02 +116 653 -1.25000000000000e-01 +116 452 -7.50000000000000e-01 +116 652 -4.16666666666667e-02 +116 301 4.16666666666667e-02 +116 114 -1.66666666666667e-01 +116 651 8.33333333333333e-02 +116 450 1.66666666666667e-01 +117 117 5.00000000000000e-01 +117 523 4.16666666666667e-02 +117 662 4.16666666666667e-02 +117 659 -4.16666666666667e-02 +117 257 4.16666666666667e-02 +117 524 -8.33333333333333e-02 +117 256 4.16666666666667e-02 +117 118 -8.33333333333333e-02 +117 658 8.33333333333333e-02 +117 255 -1.25000000000000e-01 +117 657 -1.25000000000000e-01 +117 119 -8.33333333333333e-02 +117 272 4.16666666666667e-02 +117 542 8.33333333333333e-02 +117 271 4.16666666666667e-02 +117 661 -8.33333333333333e-02 +117 541 -4.16666666666667e-02 +117 270 -1.25000000000000e-01 +117 540 -1.25000000000000e-01 +118 118 5.83333333333333e-01 +118 522 4.16666666666667e-02 +118 542 8.33333333333333e-02 +118 119 -1.66666666666667e-01 +118 659 8.33333333333333e-02 +118 257 -4.16666666666667e-02 +118 524 4.16666666666667e-02 +118 256 -4.16666666666667e-02 +118 658 -3.75000000000000e-01 +118 255 4.16666666666667e-02 +118 117 -8.33333333333333e-02 +118 657 8.33333333333333e-02 +118 272 -4.16666666666667e-02 +118 662 4.16666666666667e-02 +118 540 -4.16666666666667e-02 +118 271 -4.16666666666667e-02 +118 541 -1.25000000000000e-01 +118 270 4.16666666666667e-02 +118 660 -8.33333333333333e-02 +119 119 5.83333333333333e-01 +119 118 -1.66666666666667e-01 +119 658 8.33333333333333e-02 +119 660 4.16666666666667e-02 +119 657 -4.16666666666667e-02 +119 257 -4.16666666666667e-02 +119 659 -1.25000000000000e-01 +119 256 -4.16666666666667e-02 +119 523 4.16666666666667e-02 +119 255 4.16666666666667e-02 +119 522 -8.33333333333333e-02 +119 541 8.33333333333333e-02 +119 272 -4.16666666666667e-02 +119 542 -3.75000000000000e-01 +119 271 -4.16666666666667e-02 +119 661 4.16666666666667e-02 +119 117 -8.33333333333333e-02 +119 270 4.16666666666667e-02 +119 540 8.33333333333333e-02 +120 120 1.25000000000000e+00 +120 665 8.33333333333333e-02 +120 305 -4.16666666666667e-02 +120 668 4.16666666666667e-02 +120 667 -8.33333333333333e-02 +120 260 -4.16666666666667e-02 +120 664 8.33333333333333e-02 +120 663 -3.75000000000000e-01 +120 527 8.33333333333333e-02 +120 526 8.33333333333333e-02 +120 560 1.66666666666667e-01 +120 559 -8.33333333333333e-02 +120 558 -2.50000000000000e-01 +120 422 -8.33333333333333e-02 +120 644 4.16666666666667e-02 +120 421 -8.33333333333333e-02 +120 454 8.33333333333333e-02 +120 643 -8.33333333333333e-02 +120 259 8.33333333333333e-02 +120 258 -1.25000000000000e-01 +120 653 8.33333333333333e-02 +120 455 -1.66666666666667e-01 +120 652 8.33333333333333e-02 +120 121 -1.66666666666667e-01 +120 304 8.33333333333333e-02 +120 651 -3.75000000000000e-01 +120 122 -1.66666666666667e-01 +120 303 -1.25000000000000e-01 +121 121 1.25000000000000e+00 +121 665 -4.16666666666667e-02 +121 666 -8.33333333333333e-02 +121 664 -1.25000000000000e-01 +121 663 8.33333333333333e-02 +121 527 -1.66666666666667e-01 +121 260 8.33333333333333e-02 +121 525 8.33333333333333e-02 +121 560 1.66666666666667e-01 +121 122 -1.66666666666667e-01 +121 305 8.33333333333333e-02 +121 559 -2.50000000000000e-01 +121 558 -8.33333333333333e-02 +121 420 -8.33333333333333e-02 +121 453 8.33333333333333e-02 +121 644 4.16666666666667e-02 +121 422 -8.33333333333333e-02 +121 259 -3.75000000000000e-01 +121 642 -8.33333333333333e-02 +121 258 8.33333333333333e-02 +121 653 -4.16666666666667e-02 +121 455 8.33333333333333e-02 +121 652 -1.25000000000000e-01 +121 668 4.16666666666667e-02 +121 304 -3.75000000000000e-01 +121 651 8.33333333333333e-02 +121 120 -1.66666666666667e-01 +121 303 8.33333333333333e-02 +122 122 1.25000000000000e+00 +122 664 -4.16666666666667e-02 +122 120 -1.66666666666667e-01 +122 663 8.33333333333333e-02 +122 303 -4.16666666666667e-02 +122 666 4.16666666666667e-02 +122 665 -1.25000000000000e-01 +122 258 -4.16666666666667e-02 +122 525 8.33333333333333e-02 +122 526 -1.66666666666667e-01 +122 259 8.33333333333333e-02 +122 560 -7.50000000000000e-01 +122 559 1.66666666666667e-01 +122 121 -1.66666666666667e-01 +122 304 8.33333333333333e-02 +122 558 1.66666666666667e-01 +122 420 -8.33333333333333e-02 +122 642 4.16666666666667e-02 +122 260 -1.25000000000000e-01 +122 643 4.16666666666667e-02 +122 421 -8.33333333333333e-02 +122 653 -1.25000000000000e-01 +122 667 4.16666666666667e-02 +122 305 -1.25000000000000e-01 +122 652 -4.16666666666667e-02 +122 454 8.33333333333333e-02 +122 651 8.33333333333333e-02 +122 453 -1.66666666666667e-01 +123 123 1.25000000000000e+00 +123 563 -1.66666666666667e-01 +123 562 8.33333333333333e-02 +123 263 4.16666666666667e-02 +123 664 8.33333333333333e-02 +123 663 -3.75000000000000e-01 +123 674 -4.16666666666667e-02 +123 326 4.16666666666667e-02 +123 673 8.33333333333333e-02 +123 672 -1.25000000000000e-01 +123 530 -8.33333333333333e-02 +123 529 -8.33333333333333e-02 +123 545 8.33333333333333e-02 +123 659 -4.16666666666667e-02 +123 124 -1.66666666666667e-01 +123 544 8.33333333333333e-02 +123 577 -8.33333333333333e-02 +123 262 -8.33333333333333e-02 +123 658 8.33333333333333e-02 +123 657 -1.25000000000000e-01 +123 125 -1.66666666666667e-01 +123 671 8.33333333333333e-02 +123 578 1.66666666666667e-01 +123 670 8.33333333333333e-02 +123 325 -8.33333333333333e-02 +123 665 8.33333333333333e-02 +123 669 -3.75000000000000e-01 +123 576 -2.50000000000000e-01 +124 124 1.25000000000000e+00 +124 563 8.33333333333333e-02 +124 561 8.33333333333333e-02 +124 664 -1.25000000000000e-01 +124 663 8.33333333333333e-02 +124 674 8.33333333333333e-02 +124 125 -1.66666666666667e-01 +124 673 -3.75000000000000e-01 +124 672 8.33333333333333e-02 +124 528 -8.33333333333333e-02 +124 659 8.33333333333333e-02 +124 123 -1.66666666666667e-01 +124 545 -1.66666666666667e-01 +124 578 1.66666666666667e-01 +124 543 8.33333333333333e-02 +124 576 -8.33333333333333e-02 +124 263 4.16666666666667e-02 +124 530 -8.33333333333333e-02 +124 658 -3.75000000000000e-01 +124 261 -8.33333333333333e-02 +124 657 8.33333333333333e-02 +124 671 -4.16666666666667e-02 +124 326 4.16666666666667e-02 +124 665 -4.16666666666667e-02 +124 670 -1.25000000000000e-01 +124 577 -2.50000000000000e-01 +124 669 8.33333333333333e-02 +124 324 -8.33333333333333e-02 +125 125 1.25000000000000e+00 +125 562 8.33333333333333e-02 +125 663 8.33333333333333e-02 +125 561 -1.66666666666667e-01 +125 665 -1.25000000000000e-01 +125 261 4.16666666666667e-02 +125 674 -1.25000000000000e-01 +125 673 8.33333333333333e-02 +125 124 -1.66666666666667e-01 +125 672 -4.16666666666667e-02 +125 324 4.16666666666667e-02 +125 528 -8.33333333333333e-02 +125 658 8.33333333333333e-02 +125 543 8.33333333333333e-02 +125 657 -4.16666666666667e-02 +125 544 -1.66666666666667e-01 +125 577 1.66666666666667e-01 +125 659 -1.25000000000000e-01 +125 262 4.16666666666667e-02 +125 529 -8.33333333333333e-02 +125 664 -4.16666666666667e-02 +125 671 -1.25000000000000e-01 +125 578 -7.50000000000000e-01 +125 670 -4.16666666666667e-02 +125 325 4.16666666666667e-02 +125 123 -1.66666666666667e-01 +125 669 8.33333333333333e-02 +125 576 1.66666666666667e-01 +126 126 1.25000000000000e+00 +126 601 -8.33333333333333e-02 +126 128 -1.66666666666667e-01 +126 602 1.66666666666667e-01 +126 329 -4.16666666666667e-02 +126 328 8.33333333333333e-02 +126 327 -1.25000000000000e-01 +126 600 -2.50000000000000e-01 +126 275 -4.16666666666667e-02 +126 596 8.33333333333333e-02 +126 127 -1.66666666666667e-01 +126 274 8.33333333333333e-02 +126 595 8.33333333333333e-02 +126 273 -1.25000000000000e-01 +126 548 -8.33333333333333e-02 +126 662 4.16666666666667e-02 +126 547 -8.33333333333333e-02 +126 580 8.33333333333333e-02 +126 661 -8.33333333333333e-02 +126 671 8.33333333333333e-02 +126 581 -1.66666666666667e-01 +126 670 8.33333333333333e-02 +126 669 -3.75000000000000e-01 +126 1247 8.33333333333333e-02 +126 1250 4.16666666666667e-02 +126 1249 -8.33333333333333e-02 +126 1246 8.33333333333333e-02 +126 1245 -3.75000000000000e-01 +127 127 1.25000000000000e+00 +127 600 -8.33333333333333e-02 +127 329 8.33333333333333e-02 +127 128 -1.66666666666667e-01 +127 602 1.66666666666667e-01 +127 328 -3.75000000000000e-01 +127 601 -2.50000000000000e-01 +127 327 8.33333333333333e-02 +127 275 8.33333333333333e-02 +127 596 -1.66666666666667e-01 +127 594 8.33333333333333e-02 +127 274 -3.75000000000000e-01 +127 126 -1.66666666666667e-01 +127 273 8.33333333333333e-02 +127 546 -8.33333333333333e-02 +127 579 8.33333333333333e-02 +127 662 4.16666666666667e-02 +127 548 -8.33333333333333e-02 +127 660 -8.33333333333333e-02 +127 671 -4.16666666666667e-02 +127 581 8.33333333333333e-02 +127 670 -1.25000000000000e-01 +127 669 8.33333333333333e-02 +127 1250 4.16666666666667e-02 +127 1247 -4.16666666666667e-02 +127 1248 -8.33333333333333e-02 +127 1246 -1.25000000000000e-01 +127 1245 8.33333333333333e-02 +128 128 1.25000000000000e+00 +128 126 -1.66666666666667e-01 +128 600 1.66666666666667e-01 +128 329 -1.25000000000000e-01 +128 602 -7.50000000000000e-01 +128 328 8.33333333333333e-02 +128 127 -1.66666666666667e-01 +128 601 1.66666666666667e-01 +128 327 -4.16666666666667e-02 +128 275 -1.25000000000000e-01 +128 274 8.33333333333333e-02 +128 595 -1.66666666666667e-01 +128 273 -4.16666666666667e-02 +128 594 8.33333333333333e-02 +128 546 -8.33333333333333e-02 +128 660 4.16666666666667e-02 +128 661 4.16666666666667e-02 +128 547 -8.33333333333333e-02 +128 671 -1.25000000000000e-01 +128 670 -4.16666666666667e-02 +128 580 8.33333333333333e-02 +128 669 8.33333333333333e-02 +128 579 -1.66666666666667e-01 +128 1246 -4.16666666666667e-02 +128 1245 8.33333333333333e-02 +128 1248 4.16666666666667e-02 +128 1249 4.16666666666667e-02 +128 1247 -1.25000000000000e-01 +129 129 7.50000000000000e-01 +129 614 -8.33333333333333e-02 +129 613 4.16666666666667e-02 +129 131 -8.33333333333333e-02 +129 620 8.33333333333333e-02 +129 308 4.16666666666667e-02 +129 619 -4.16666666666667e-02 +129 618 -1.25000000000000e-01 +129 439 -8.33333333333333e-02 +129 457 8.33333333333333e-02 +129 650 4.16666666666667e-02 +129 440 -8.33333333333333e-02 +129 286 4.16666666666667e-02 +129 649 -8.33333333333333e-02 +129 285 -2.50000000000000e-01 +129 656 -4.16666666666667e-02 +129 458 8.33333333333333e-02 +129 130 -8.33333333333333e-02 +129 655 8.33333333333333e-02 +129 307 4.16666666666667e-02 +129 287 4.16666666666667e-02 +129 654 -1.25000000000000e-01 +129 306 -2.50000000000000e-01 +130 130 6.66666666666667e-01 +130 612 4.16666666666667e-02 +130 620 8.33333333333333e-02 +130 619 -1.25000000000000e-01 +130 618 -4.16666666666667e-02 +130 650 4.16666666666667e-02 +130 440 -8.33333333333333e-02 +130 438 -8.33333333333333e-02 +130 456 8.33333333333333e-02 +130 286 -8.33333333333333e-02 +130 285 4.16666666666667e-02 +130 648 -8.33333333333333e-02 +130 656 8.33333333333333e-02 +130 458 -1.66666666666667e-01 +130 614 4.16666666666667e-02 +130 655 -3.75000000000000e-01 +130 307 -8.33333333333333e-02 +130 129 -8.33333333333333e-02 +130 654 8.33333333333333e-02 +130 306 4.16666666666667e-02 +131 131 6.66666666666667e-01 +131 285 4.16666666666667e-02 +131 612 -8.33333333333333e-02 +131 620 -3.75000000000000e-01 +131 619 8.33333333333333e-02 +131 129 -8.33333333333333e-02 +131 618 8.33333333333333e-02 +131 306 4.16666666666667e-02 +131 649 4.16666666666667e-02 +131 439 -8.33333333333333e-02 +131 287 -8.33333333333333e-02 +131 648 4.16666666666667e-02 +131 438 -8.33333333333333e-02 +131 613 4.16666666666667e-02 +131 656 -1.25000000000000e-01 +131 308 -8.33333333333333e-02 +131 655 8.33333333333333e-02 +131 457 -1.66666666666667e-01 +131 654 -4.16666666666667e-02 +131 456 8.33333333333333e-02 +132 132 7.50000000000000e-01 +132 632 -8.33333333333333e-02 +132 631 4.16666666666667e-02 +132 134 -8.33333333333333e-02 +132 638 8.33333333333333e-02 +132 332 4.16666666666667e-02 +132 637 -4.16666666666667e-02 +132 636 -1.25000000000000e-01 +132 565 -8.33333333333333e-02 +132 583 8.33333333333333e-02 +132 668 4.16666666666667e-02 +132 566 -8.33333333333333e-02 +132 310 4.16666666666667e-02 +132 667 -8.33333333333333e-02 +132 309 -2.50000000000000e-01 +132 674 -4.16666666666667e-02 +132 584 8.33333333333333e-02 +132 133 -8.33333333333333e-02 +132 673 8.33333333333333e-02 +132 331 4.16666666666667e-02 +132 311 4.16666666666667e-02 +132 672 -1.25000000000000e-01 +132 330 -2.50000000000000e-01 +133 133 6.66666666666667e-01 +133 630 4.16666666666667e-02 +133 638 8.33333333333333e-02 +133 637 -1.25000000000000e-01 +133 636 -4.16666666666667e-02 +133 668 4.16666666666667e-02 +133 566 -8.33333333333333e-02 +133 564 -8.33333333333333e-02 +133 582 8.33333333333333e-02 +133 310 -8.33333333333333e-02 +133 309 4.16666666666667e-02 +133 666 -8.33333333333333e-02 +133 674 8.33333333333333e-02 +133 584 -1.66666666666667e-01 +133 632 4.16666666666667e-02 +133 673 -3.75000000000000e-01 +133 331 -8.33333333333333e-02 +133 132 -8.33333333333333e-02 +133 672 8.33333333333333e-02 +133 330 4.16666666666667e-02 +134 134 6.66666666666667e-01 +134 309 4.16666666666667e-02 +134 630 -8.33333333333333e-02 +134 638 -3.75000000000000e-01 +134 637 8.33333333333333e-02 +134 132 -8.33333333333333e-02 +134 636 8.33333333333333e-02 +134 330 4.16666666666667e-02 +134 667 4.16666666666667e-02 +134 565 -8.33333333333333e-02 +134 311 -8.33333333333333e-02 +134 666 4.16666666666667e-02 +134 564 -8.33333333333333e-02 +134 631 4.16666666666667e-02 +134 674 -1.25000000000000e-01 +134 332 -8.33333333333333e-02 +134 673 8.33333333333333e-02 +134 583 -1.66666666666667e-01 +134 672 -4.16666666666667e-02 +134 582 8.33333333333333e-02 +135 135 7.50000000000000e-01 +135 37 4.16666666666667e-02 +135 334 -8.33333333333333e-02 +135 143 -4.16666666666667e-02 +135 136 -8.33333333333333e-02 +135 142 8.33333333333333e-02 +135 1 4.16666666666667e-02 +135 141 -1.25000000000000e-01 +135 341 -8.33333333333333e-02 +135 155 8.33333333333333e-02 +135 38 4.16666666666667e-02 +135 338 -8.33333333333333e-02 +135 337 4.16666666666667e-02 +135 340 -8.33333333333333e-02 +135 36 -2.50000000000000e-01 +135 137 -8.33333333333333e-02 +135 149 8.33333333333333e-02 +135 2 4.16666666666667e-02 +135 148 -4.16666666666667e-02 +135 154 8.33333333333333e-02 +135 335 4.16666666666667e-02 +135 147 -1.25000000000000e-01 +135 0 -2.50000000000000e-01 +136 136 6.66666666666667e-01 +136 36 4.16666666666667e-02 +136 333 -8.33333333333333e-02 +136 143 8.33333333333333e-02 +136 142 -3.75000000000000e-01 +136 135 -8.33333333333333e-02 +136 141 8.33333333333333e-02 +136 0 4.16666666666667e-02 +136 338 4.16666666666667e-02 +136 341 -8.33333333333333e-02 +136 37 -8.33333333333333e-02 +136 336 4.16666666666667e-02 +136 339 -8.33333333333333e-02 +136 149 8.33333333333333e-02 +136 155 -1.66666666666667e-01 +136 335 4.16666666666667e-02 +136 148 -1.25000000000000e-01 +136 1 -8.33333333333333e-02 +136 147 -4.16666666666667e-02 +136 153 8.33333333333333e-02 +137 137 6.66666666666667e-01 +137 333 4.16666666666667e-02 +137 143 -1.25000000000000e-01 +137 142 8.33333333333333e-02 +137 141 -4.16666666666667e-02 +137 337 4.16666666666667e-02 +137 340 -8.33333333333333e-02 +137 339 -8.33333333333333e-02 +137 153 8.33333333333333e-02 +137 38 -8.33333333333333e-02 +137 36 4.16666666666667e-02 +137 336 -8.33333333333333e-02 +137 334 4.16666666666667e-02 +137 149 -3.75000000000000e-01 +137 2 -8.33333333333333e-02 +137 148 8.33333333333333e-02 +137 154 -1.66666666666667e-01 +137 135 -8.33333333333333e-02 +137 147 8.33333333333333e-02 +137 0 4.16666666666667e-02 +138 138 2.98333333333333e+01 +138 140 -8.33333333333333e+00 +138 152 4.25000000000000e+00 +138 355 2.12500000000000e+00 +138 151 -2.12500000000000e+00 +138 2 -2.08333333333333e+00 +138 1 2.12500000000000e+00 +138 0 -2.16666666666667e+00 +138 150 -6.37500000000000e+00 +138 41 -2.08333333333333e+00 +138 356 2.12500000000000e+00 +138 139 -4.25000000000000e+00 +138 40 2.12500000000000e+00 +138 39 -2.16666666666667e+00 +138 352 -8.33333333333333e-02 +138 143 8.33333333333333e-02 +138 142 8.33333333333333e-02 +138 141 -3.75000000000000e-01 +138 359 -8.33333333333333e-02 +138 358 -8.33333333333333e-02 +138 155 -1.66666666666667e-01 +138 154 8.33333333333333e-02 +138 353 4.16666666666667e-02 +138 1430 2.08333333333333e+00 +138 1429 -4.16666666666667e+00 +138 1687 4.16666666666667e+00 +138 1688 4.16666666666667e+00 +138 1686 -1.87500000000000e+01 +139 139 2.57500000000000e+01 +139 354 2.12500000000000e+00 +139 150 -2.12500000000000e+00 +139 2 2.12500000000000e+00 +139 140 -4.25000000000000e+00 +139 152 4.25000000000000e+00 +139 1 -6.50000000000000e+00 +139 151 -6.37500000000000e+00 +139 0 2.12500000000000e+00 +139 41 2.12500000000000e+00 +139 356 -4.25000000000000e+00 +139 40 -6.50000000000000e+00 +139 138 -4.25000000000000e+00 +139 39 2.12500000000000e+00 +139 351 -8.33333333333333e-02 +139 143 -4.16666666666667e-02 +139 142 -1.25000000000000e-01 +139 141 8.33333333333333e-02 +139 359 -8.33333333333333e-02 +139 155 8.33333333333333e-02 +139 357 -8.33333333333333e-02 +139 353 4.16666666666667e-02 +139 153 8.33333333333333e-02 +139 1430 2.08333333333333e+00 +139 1428 -4.16666666666667e+00 +139 1688 -2.08333333333333e+00 +139 1687 -6.25000000000000e+00 +139 1686 4.16666666666667e+00 +140 140 2.98333333333333e+01 +140 138 -8.33333333333333e+00 +140 150 4.25000000000000e+00 +140 2 -2.16666666666667e+00 +140 152 -1.91250000000000e+01 +140 1 2.12500000000000e+00 +140 139 -4.25000000000000e+00 +140 151 4.25000000000000e+00 +140 0 -2.08333333333333e+00 +140 41 -2.16666666666667e+00 +140 40 2.12500000000000e+00 +140 355 -4.25000000000000e+00 +140 39 -2.08333333333333e+00 +140 354 2.12500000000000e+00 +140 352 4.16666666666667e-02 +140 143 -1.25000000000000e-01 +140 142 -4.16666666666667e-02 +140 141 8.33333333333333e-02 +140 357 -8.33333333333333e-02 +140 358 -8.33333333333333e-02 +140 154 8.33333333333333e-02 +140 351 4.16666666666667e-02 +140 153 -1.66666666666667e-01 +140 1429 2.08333333333333e+00 +140 1686 4.16666666666667e+00 +140 1428 2.08333333333333e+00 +140 1687 -2.08333333333333e+00 +140 1688 -6.25000000000000e+00 +141 141 1.25000000000000e+00 +141 358 8.33333333333333e-02 +141 359 8.33333333333333e-02 +141 352 8.33333333333333e-02 +141 351 -1.25000000000000e-01 +141 143 -1.66666666666667e-01 +141 140 8.33333333333333e-02 +141 139 8.33333333333333e-02 +141 138 -3.75000000000000e-01 +141 154 -8.33333333333333e-02 +141 142 -1.66666666666667e-01 +141 335 8.33333333333333e-02 +141 370 -8.33333333333333e-02 +141 340 8.33333333333333e-02 +141 155 1.66666666666667e-01 +141 341 -1.66666666666667e-01 +141 44 4.16666666666667e-02 +141 371 -8.33333333333333e-02 +141 334 8.33333333333333e-02 +141 43 -8.33333333333333e-02 +141 333 -3.75000000000000e-01 +141 137 -4.16666666666667e-02 +141 2 4.16666666666667e-02 +141 136 8.33333333333333e-02 +141 1 -8.33333333333333e-02 +141 135 -1.25000000000000e-01 +141 353 -4.16666666666667e-02 +141 153 -2.50000000000000e-01 +142 142 1.25000000000000e+00 +142 357 8.33333333333333e-02 +142 359 -1.66666666666667e-01 +142 44 4.16666666666667e-02 +142 352 -3.75000000000000e-01 +142 351 8.33333333333333e-02 +142 140 -4.16666666666667e-02 +142 2 4.16666666666667e-02 +142 139 -1.25000000000000e-01 +142 138 8.33333333333333e-02 +142 153 -8.33333333333333e-02 +142 335 -4.16666666666667e-02 +142 141 -1.66666666666667e-01 +142 369 -8.33333333333333e-02 +142 339 8.33333333333333e-02 +142 371 -8.33333333333333e-02 +142 341 8.33333333333333e-02 +142 334 -1.25000000000000e-01 +142 333 8.33333333333333e-02 +142 42 -8.33333333333333e-02 +142 137 8.33333333333333e-02 +142 143 -1.66666666666667e-01 +142 155 1.66666666666667e-01 +142 136 -3.75000000000000e-01 +142 353 8.33333333333333e-02 +142 154 -2.50000000000000e-01 +142 135 8.33333333333333e-02 +142 0 -8.33333333333333e-02 +143 143 1.25000000000000e+00 +143 352 8.33333333333333e-02 +143 358 -1.66666666666667e-01 +143 357 8.33333333333333e-02 +143 353 -1.25000000000000e-01 +143 43 4.16666666666667e-02 +143 140 -1.25000000000000e-01 +143 139 -4.16666666666667e-02 +143 1 4.16666666666667e-02 +143 141 -1.66666666666667e-01 +143 138 8.33333333333333e-02 +143 334 -4.16666666666667e-02 +143 333 8.33333333333333e-02 +143 370 -8.33333333333333e-02 +143 340 8.33333333333333e-02 +143 153 1.66666666666667e-01 +143 339 -1.66666666666667e-01 +143 335 -1.25000000000000e-01 +143 42 4.16666666666667e-02 +143 369 -8.33333333333333e-02 +143 137 -1.25000000000000e-01 +143 351 -4.16666666666667e-02 +143 155 -7.50000000000000e-01 +143 136 8.33333333333333e-02 +143 142 -1.66666666666667e-01 +143 154 1.66666666666667e-01 +143 135 -4.16666666666667e-02 +143 0 4.16666666666667e-02 +144 144 2.98333333333333e+01 +144 152 -2.12500000000000e+00 +144 145 -8.33333333333333e+00 +144 151 4.25000000000000e+00 +144 2 2.12500000000000e+00 +144 1 -2.08333333333333e+00 +144 0 -2.16666666666667e+00 +144 150 -6.37500000000000e+00 +144 146 -4.25000000000000e+00 +144 47 2.12500000000000e+00 +144 46 -2.08333333333333e+00 +144 391 2.12500000000000e+00 +144 392 2.12500000000000e+00 +144 45 -2.16666666666667e+00 +144 155 8.33333333333333e-02 +144 395 -8.33333333333333e-02 +144 388 4.16666666666667e-02 +144 394 -8.33333333333333e-02 +144 389 -8.33333333333333e-02 +144 149 8.33333333333333e-02 +144 148 8.33333333333333e-02 +144 154 -1.66666666666667e-01 +144 147 -3.75000000000000e-01 +144 1690 4.16666666666667e+00 +144 1430 -4.16666666666667e+00 +144 1429 2.08333333333333e+00 +144 1691 4.16666666666667e+00 +144 1689 -1.87500000000000e+01 +145 145 2.98333333333333e+01 +145 144 -8.33333333333333e+00 +145 150 4.25000000000000e+00 +145 2 2.12500000000000e+00 +145 146 -4.25000000000000e+00 +145 152 4.25000000000000e+00 +145 1 -2.16666666666667e+00 +145 151 -1.91250000000000e+01 +145 0 -2.08333333333333e+00 +145 47 2.12500000000000e+00 +145 392 -4.25000000000000e+00 +145 46 -2.16666666666667e+00 +145 45 -2.08333333333333e+00 +145 390 2.12500000000000e+00 +145 387 4.16666666666667e-02 +145 393 -8.33333333333333e-02 +145 389 4.16666666666667e-02 +145 395 -8.33333333333333e-02 +145 149 -4.16666666666667e-02 +145 155 8.33333333333333e-02 +145 148 -1.25000000000000e-01 +145 147 8.33333333333333e-02 +145 153 -1.66666666666667e-01 +145 1691 -2.08333333333333e+00 +145 1689 4.16666666666667e+00 +145 1428 2.08333333333333e+00 +145 1430 2.08333333333333e+00 +145 1690 -6.25000000000000e+00 +146 146 2.57500000000000e+01 +146 150 -2.12500000000000e+00 +146 2 -6.50000000000000e+00 +146 152 -6.37500000000000e+00 +146 1 2.12500000000000e+00 +146 145 -4.25000000000000e+00 +146 151 4.25000000000000e+00 +146 0 2.12500000000000e+00 +146 390 2.12500000000000e+00 +146 47 -6.50000000000000e+00 +146 46 2.12500000000000e+00 +146 391 -4.25000000000000e+00 +146 144 -4.25000000000000e+00 +146 45 2.12500000000000e+00 +146 153 8.33333333333333e-02 +146 393 -8.33333333333333e-02 +146 388 4.16666666666667e-02 +146 394 -8.33333333333333e-02 +146 387 -8.33333333333333e-02 +146 149 -1.25000000000000e-01 +146 148 -4.16666666666667e-02 +146 154 8.33333333333333e-02 +146 147 8.33333333333333e-02 +146 1429 2.08333333333333e+00 +146 1690 -2.08333333333333e+00 +146 1428 -4.16666666666667e+00 +146 1691 -6.25000000000000e+00 +146 1689 4.16666666666667e+00 +147 147 1.25000000000000e+00 +147 341 8.33333333333333e-02 +147 340 -1.66666666666667e-01 +147 338 8.33333333333333e-02 +147 49 4.16666666666667e-02 +147 336 -3.75000000000000e-01 +147 137 8.33333333333333e-02 +147 136 -4.16666666666667e-02 +147 1 4.16666666666667e-02 +147 135 -1.25000000000000e-01 +147 155 -8.33333333333333e-02 +147 149 -1.66666666666667e-01 +147 388 -4.16666666666667e-02 +147 407 -8.33333333333333e-02 +147 395 8.33333333333333e-02 +147 406 -8.33333333333333e-02 +147 394 8.33333333333333e-02 +147 389 8.33333333333333e-02 +147 50 -8.33333333333333e-02 +147 387 -1.25000000000000e-01 +147 146 8.33333333333333e-02 +147 2 -8.33333333333333e-02 +147 145 8.33333333333333e-02 +147 148 -1.66666666666667e-01 +147 154 1.66666666666667e-01 +147 144 -3.75000000000000e-01 +147 337 8.33333333333333e-02 +147 153 -2.50000000000000e-01 +148 148 1.25000000000000e+00 +148 341 8.33333333333333e-02 +148 336 8.33333333333333e-02 +148 339 -1.66666666666667e-01 +148 337 -1.25000000000000e-01 +148 48 4.16666666666667e-02 +148 137 8.33333333333333e-02 +148 149 -1.66666666666667e-01 +148 136 -1.25000000000000e-01 +148 135 -4.16666666666667e-02 +148 0 4.16666666666667e-02 +148 387 -4.16666666666667e-02 +148 389 8.33333333333333e-02 +148 155 1.66666666666667e-01 +148 395 -1.66666666666667e-01 +148 405 -8.33333333333333e-02 +148 393 8.33333333333333e-02 +148 50 4.16666666666667e-02 +148 407 -8.33333333333333e-02 +148 388 -1.25000000000000e-01 +148 146 -4.16666666666667e-02 +148 2 4.16666666666667e-02 +148 145 -1.25000000000000e-01 +148 338 -4.16666666666667e-02 +148 154 -7.50000000000000e-01 +148 144 8.33333333333333e-02 +148 147 -1.66666666666667e-01 +148 153 1.66666666666667e-01 +149 149 1.25000000000000e+00 +149 340 8.33333333333333e-02 +149 339 8.33333333333333e-02 +149 338 -1.25000000000000e-01 +149 336 8.33333333333333e-02 +149 137 -3.75000000000000e-01 +149 136 8.33333333333333e-02 +149 148 -1.66666666666667e-01 +149 135 8.33333333333333e-02 +149 153 -8.33333333333333e-02 +149 147 -1.66666666666667e-01 +149 388 8.33333333333333e-02 +149 405 -8.33333333333333e-02 +149 393 8.33333333333333e-02 +149 154 1.66666666666667e-01 +149 394 -1.66666666666667e-01 +149 389 -3.75000000000000e-01 +149 49 4.16666666666667e-02 +149 406 -8.33333333333333e-02 +149 387 8.33333333333333e-02 +149 48 -8.33333333333333e-02 +149 146 -1.25000000000000e-01 +149 337 -4.16666666666667e-02 +149 155 -2.50000000000000e-01 +149 145 -4.16666666666667e-02 +149 1 4.16666666666667e-02 +149 144 8.33333333333333e-02 +149 0 -8.33333333333333e-02 +150 150 6.37500000000000e+01 +150 139 -2.12500000000000e+00 +150 2 2.12500000000000e+00 +150 138 -6.37500000000000e+00 +150 356 -2.12500000000000e+00 +150 53 2.12500000000000e+00 +150 151 -8.50000000000000e+00 +150 355 4.25000000000000e+00 +150 354 -6.37500000000000e+00 +150 146 -2.12500000000000e+00 +150 145 4.25000000000000e+00 +150 1 2.12500000000000e+00 +150 144 -6.37500000000000e+00 +150 152 -8.50000000000000e+00 +150 392 4.25000000000000e+00 +150 391 -2.12500000000000e+00 +150 52 2.12500000000000e+00 +150 140 4.25000000000000e+00 +150 390 -6.37500000000000e+00 +150 358 -1.66666666666667e-01 +150 155 1.66666666666667e-01 +150 395 -1.66666666666667e-01 +150 424 -8.33333333333333e-02 +150 394 8.33333333333333e-02 +150 425 -8.33333333333333e-02 +150 154 1.66666666666667e-01 +150 359 8.33333333333333e-02 +150 153 -7.50000000000000e-01 +150 1687 4.16666666666667e+00 +150 1688 -8.33333333333333e+00 +150 1430 -4.16666666666667e+00 +150 1691 4.16666666666667e+00 +150 1693 8.33333333333333e+00 +150 1690 -8.33333333333333e+00 +150 1429 -4.16666666666667e+00 +150 1694 8.33333333333333e+00 +150 1692 -3.75000000000000e+01 +151 151 6.37500000000000e+01 +151 138 -2.12500000000000e+00 +151 140 4.25000000000000e+00 +151 139 -6.37500000000000e+00 +151 356 4.25000000000000e+00 +151 355 -1.91250000000000e+01 +151 150 -8.50000000000000e+00 +151 354 4.25000000000000e+00 +151 152 -8.50000000000000e+00 +151 144 4.25000000000000e+00 +151 2 -4.25000000000000e+00 +151 146 4.25000000000000e+00 +151 145 -1.91250000000000e+01 +151 0 2.12500000000000e+00 +151 392 4.25000000000000e+00 +151 53 -4.25000000000000e+00 +151 391 -6.37500000000000e+00 +151 390 -2.12500000000000e+00 +151 51 2.12500000000000e+00 +151 359 8.33333333333333e-02 +151 357 -1.66666666666667e-01 +151 155 -8.33333333333333e-02 +151 425 -8.33333333333333e-02 +151 395 8.33333333333333e-02 +151 423 -8.33333333333333e-02 +151 393 8.33333333333333e-02 +151 154 -2.50000000000000e-01 +151 153 1.66666666666667e-01 +151 1688 4.16666666666667e+00 +151 1694 -4.16666666666667e+00 +151 1430 -4.16666666666667e+00 +151 1691 4.16666666666667e+00 +151 1692 8.33333333333333e+00 +151 1689 -8.33333333333333e+00 +151 1428 -4.16666666666667e+00 +151 1686 4.16666666666667e+00 +151 1693 -1.25000000000000e+01 +152 152 6.37500000000000e+01 +152 140 -1.91250000000000e+01 +152 139 4.25000000000000e+00 +152 0 2.12500000000000e+00 +152 356 -6.37500000000000e+00 +152 355 4.25000000000000e+00 +152 354 -2.12500000000000e+00 +152 51 2.12500000000000e+00 +152 151 -8.50000000000000e+00 +152 144 -2.12500000000000e+00 +152 146 -6.37500000000000e+00 +152 1 -4.25000000000000e+00 +152 145 4.25000000000000e+00 +152 138 4.25000000000000e+00 +152 392 -1.91250000000000e+01 +152 391 4.25000000000000e+00 +152 52 -4.25000000000000e+00 +152 150 -8.50000000000000e+00 +152 390 4.25000000000000e+00 +152 358 8.33333333333333e-02 +152 154 -8.33333333333333e-02 +152 424 -8.33333333333333e-02 +152 394 8.33333333333333e-02 +152 153 1.66666666666667e-01 +152 393 -1.66666666666667e-01 +152 423 -8.33333333333333e-02 +152 357 8.33333333333333e-02 +152 155 -2.50000000000000e-01 +152 1687 4.16666666666667e+00 +152 1686 -8.33333333333333e+00 +152 1693 -4.16666666666667e+00 +152 1429 -4.16666666666667e+00 +152 1690 4.16666666666667e+00 +152 1428 -4.16666666666667e+00 +152 1689 4.16666666666667e+00 +152 1694 -1.25000000000000e+01 +152 1692 8.33333333333333e+00 +153 153 2.50000000000000e+00 +153 358 1.66666666666667e-01 +153 357 -2.50000000000000e-01 +153 140 -1.66666666666667e-01 +153 139 8.33333333333333e-02 +153 152 1.66666666666667e-01 +153 424 8.33333333333333e-02 +153 151 1.66666666666667e-01 +153 150 -7.50000000000000e-01 +153 425 8.33333333333333e-02 +153 142 -8.33333333333333e-02 +153 143 1.66666666666667e-01 +153 155 -3.33333333333333e-01 +153 2 -8.33333333333333e-02 +153 141 -2.50000000000000e-01 +153 371 8.33333333333333e-02 +153 56 -8.33333333333333e-02 +153 370 -1.66666666666667e-01 +153 137 8.33333333333333e-02 +153 340 1.66666666666667e-01 +153 154 -3.33333333333333e-01 +153 341 1.66666666666667e-01 +153 55 -8.33333333333333e-02 +153 339 -7.50000000000000e-01 +153 136 8.33333333333333e-02 +153 1 -8.33333333333333e-02 +153 149 -8.33333333333333e-02 +153 146 8.33333333333333e-02 +153 406 8.33333333333333e-02 +153 394 -8.33333333333333e-02 +153 145 -1.66666666666667e-01 +153 148 1.66666666666667e-01 +153 147 -2.50000000000000e-01 +153 395 1.66666666666667e-01 +153 407 -1.66666666666667e-01 +153 393 -2.50000000000000e-01 +153 359 -8.33333333333333e-02 +154 154 2.50000000000000e+00 +154 357 1.66666666666667e-01 +154 359 1.66666666666667e-01 +154 358 -7.50000000000000e-01 +154 138 8.33333333333333e-02 +154 152 -8.33333333333333e-02 +154 423 8.33333333333333e-02 +154 151 -2.50000000000000e-01 +154 150 1.66666666666667e-01 +154 425 -1.66666666666667e-01 +154 141 -8.33333333333333e-02 +154 371 8.33333333333333e-02 +154 143 1.66666666666667e-01 +154 142 -2.50000000000000e-01 +154 369 -1.66666666666667e-01 +154 341 -8.33333333333333e-02 +154 339 1.66666666666667e-01 +154 153 -3.33333333333333e-01 +154 340 -2.50000000000000e-01 +154 54 -8.33333333333333e-02 +154 137 -1.66666666666667e-01 +154 135 8.33333333333333e-02 +154 0 -8.33333333333333e-02 +154 149 1.66666666666667e-01 +154 155 -3.33333333333333e-01 +154 395 1.66666666666667e-01 +154 405 8.33333333333333e-02 +154 393 -8.33333333333333e-02 +154 146 8.33333333333333e-02 +154 2 -8.33333333333333e-02 +154 148 -7.50000000000000e-01 +154 144 -1.66666666666667e-01 +154 147 1.66666666666667e-01 +154 407 8.33333333333333e-02 +154 56 -8.33333333333333e-02 +154 394 -2.50000000000000e-01 +154 140 8.33333333333333e-02 +155 155 2.50000000000000e+00 +155 139 8.33333333333333e-02 +155 359 -2.50000000000000e-01 +155 358 1.66666666666667e-01 +155 138 -1.66666666666667e-01 +155 151 -8.33333333333333e-02 +155 150 1.66666666666667e-01 +155 152 -2.50000000000000e-01 +155 424 -1.66666666666667e-01 +155 423 8.33333333333333e-02 +155 370 8.33333333333333e-02 +155 141 1.66666666666667e-01 +155 153 -3.33333333333333e-01 +155 143 -7.50000000000000e-01 +155 142 1.66666666666667e-01 +155 0 -8.33333333333333e-02 +155 369 8.33333333333333e-02 +155 54 -8.33333333333333e-02 +155 340 -8.33333333333333e-02 +155 135 8.33333333333333e-02 +155 341 -2.50000000000000e-01 +155 339 1.66666666666667e-01 +155 136 -1.66666666666667e-01 +155 147 -8.33333333333333e-02 +155 144 8.33333333333333e-02 +155 148 1.66666666666667e-01 +155 154 -3.33333333333333e-01 +155 394 1.66666666666667e-01 +155 149 -2.50000000000000e-01 +155 145 8.33333333333333e-02 +155 1 -8.33333333333333e-02 +155 395 -7.50000000000000e-01 +155 357 -8.33333333333333e-02 +155 406 8.33333333333333e-02 +155 55 -8.33333333333333e-02 +155 393 1.66666666666667e-01 +155 405 -1.66666666666667e-01 +156 156 7.50000000000000e-01 +156 4 4.16666666666667e-02 +156 163 -8.33333333333333e-02 +156 344 -4.16666666666667e-02 +156 157 -8.33333333333333e-02 +156 343 8.33333333333333e-02 +156 37 4.16666666666667e-02 +156 342 -1.25000000000000e-01 +156 176 -8.33333333333333e-02 +156 350 8.33333333333333e-02 +156 5 4.16666666666667e-02 +156 170 -8.33333333333333e-02 +156 169 4.16666666666667e-02 +156 175 -8.33333333333333e-02 +156 3 -2.50000000000000e-01 +156 158 -8.33333333333333e-02 +156 347 8.33333333333333e-02 +156 38 4.16666666666667e-02 +156 346 -4.16666666666667e-02 +156 349 8.33333333333333e-02 +156 164 4.16666666666667e-02 +156 345 -1.25000000000000e-01 +156 36 -2.50000000000000e-01 +157 157 6.66666666666667e-01 +157 3 4.16666666666667e-02 +157 162 -8.33333333333333e-02 +157 344 8.33333333333333e-02 +157 343 -3.75000000000000e-01 +157 156 -8.33333333333333e-02 +157 342 8.33333333333333e-02 +157 36 4.16666666666667e-02 +157 170 4.16666666666667e-02 +157 176 -8.33333333333333e-02 +157 4 -8.33333333333333e-02 +157 168 4.16666666666667e-02 +157 174 -8.33333333333333e-02 +157 347 8.33333333333333e-02 +157 350 -1.66666666666667e-01 +157 164 4.16666666666667e-02 +157 346 -1.25000000000000e-01 +157 37 -8.33333333333333e-02 +157 345 -4.16666666666667e-02 +157 348 8.33333333333333e-02 +158 158 6.66666666666667e-01 +158 162 4.16666666666667e-02 +158 344 -1.25000000000000e-01 +158 343 8.33333333333333e-02 +158 342 -4.16666666666667e-02 +158 169 4.16666666666667e-02 +158 175 -8.33333333333333e-02 +158 174 -8.33333333333333e-02 +158 348 8.33333333333333e-02 +158 5 -8.33333333333333e-02 +158 3 4.16666666666667e-02 +158 168 -8.33333333333333e-02 +158 163 4.16666666666667e-02 +158 347 -3.75000000000000e-01 +158 38 -8.33333333333333e-02 +158 346 8.33333333333333e-02 +158 349 -1.66666666666667e-01 +158 156 -8.33333333333333e-02 +158 345 8.33333333333333e-02 +158 36 4.16666666666667e-02 +159 159 7.50000000000000e-01 +159 58 4.16666666666667e-02 +159 460 -8.33333333333333e-02 +159 167 -4.16666666666667e-02 +159 160 -8.33333333333333e-02 +159 166 8.33333333333333e-02 +159 4 4.16666666666667e-02 +159 165 -1.25000000000000e-01 +159 467 -8.33333333333333e-02 +159 179 8.33333333333333e-02 +159 59 4.16666666666667e-02 +159 464 -8.33333333333333e-02 +159 463 4.16666666666667e-02 +159 466 -8.33333333333333e-02 +159 57 -2.50000000000000e-01 +159 161 -8.33333333333333e-02 +159 173 8.33333333333333e-02 +159 5 4.16666666666667e-02 +159 172 -4.16666666666667e-02 +159 178 8.33333333333333e-02 +159 461 4.16666666666667e-02 +159 171 -1.25000000000000e-01 +159 3 -2.50000000000000e-01 +160 160 6.66666666666667e-01 +160 57 4.16666666666667e-02 +160 459 -8.33333333333333e-02 +160 167 8.33333333333333e-02 +160 166 -3.75000000000000e-01 +160 159 -8.33333333333333e-02 +160 165 8.33333333333333e-02 +160 3 4.16666666666667e-02 +160 464 4.16666666666667e-02 +160 467 -8.33333333333333e-02 +160 58 -8.33333333333333e-02 +160 462 4.16666666666667e-02 +160 465 -8.33333333333333e-02 +160 173 8.33333333333333e-02 +160 179 -1.66666666666667e-01 +160 461 4.16666666666667e-02 +160 172 -1.25000000000000e-01 +160 4 -8.33333333333333e-02 +160 171 -4.16666666666667e-02 +160 177 8.33333333333333e-02 +161 161 6.66666666666667e-01 +161 459 4.16666666666667e-02 +161 167 -1.25000000000000e-01 +161 166 8.33333333333333e-02 +161 165 -4.16666666666667e-02 +161 463 4.16666666666667e-02 +161 466 -8.33333333333333e-02 +161 465 -8.33333333333333e-02 +161 177 8.33333333333333e-02 +161 59 -8.33333333333333e-02 +161 57 4.16666666666667e-02 +161 462 -8.33333333333333e-02 +161 460 4.16666666666667e-02 +161 173 -3.75000000000000e-01 +161 5 -8.33333333333333e-02 +161 172 8.33333333333333e-02 +161 178 -1.66666666666667e-01 +161 159 -8.33333333333333e-02 +161 171 8.33333333333333e-02 +161 3 4.16666666666667e-02 +162 162 1.25000000000000e+00 +162 478 -8.33333333333333e-02 +162 167 8.33333333333333e-02 +162 166 8.33333333333333e-02 +162 165 -3.75000000000000e-01 +162 485 -8.33333333333333e-02 +162 484 -8.33333333333333e-02 +162 179 -1.66666666666667e-01 +162 178 8.33333333333333e-02 +162 344 8.33333333333333e-02 +162 164 -1.66666666666667e-01 +162 176 1.66666666666667e-01 +162 481 8.33333333333333e-02 +162 175 -8.33333333333333e-02 +162 5 -4.16666666666667e-02 +162 158 4.16666666666667e-02 +162 4 8.33333333333333e-02 +162 157 -8.33333333333333e-02 +162 3 -1.25000000000000e-01 +162 174 -2.50000000000000e-01 +162 62 -4.16666666666667e-02 +162 482 8.33333333333333e-02 +162 163 -1.66666666666667e-01 +162 61 8.33333333333333e-02 +162 343 8.33333333333333e-02 +162 479 4.16666666666667e-02 +162 60 -1.25000000000000e-01 +162 342 -3.75000000000000e-01 +163 163 1.25000000000000e+00 +163 477 -8.33333333333333e-02 +163 167 -4.16666666666667e-02 +163 166 -1.25000000000000e-01 +163 165 8.33333333333333e-02 +163 485 -8.33333333333333e-02 +163 179 8.33333333333333e-02 +163 483 -8.33333333333333e-02 +163 177 8.33333333333333e-02 +163 344 -4.16666666666667e-02 +163 158 4.16666666666667e-02 +163 480 8.33333333333333e-02 +163 174 -8.33333333333333e-02 +163 5 8.33333333333333e-02 +163 164 -1.66666666666667e-01 +163 176 1.66666666666667e-01 +163 4 -3.75000000000000e-01 +163 175 -2.50000000000000e-01 +163 3 8.33333333333333e-02 +163 156 -8.33333333333333e-02 +163 62 8.33333333333333e-02 +163 482 -1.66666666666667e-01 +163 479 4.16666666666667e-02 +163 61 -3.75000000000000e-01 +163 343 -1.25000000000000e-01 +163 162 -1.66666666666667e-01 +163 60 8.33333333333333e-02 +163 342 8.33333333333333e-02 +164 164 1.25000000000000e+00 +164 478 4.16666666666667e-02 +164 167 -1.25000000000000e-01 +164 166 -4.16666666666667e-02 +164 165 8.33333333333333e-02 +164 483 -8.33333333333333e-02 +164 484 -8.33333333333333e-02 +164 178 8.33333333333333e-02 +164 177 -1.66666666666667e-01 +164 343 -4.16666666666667e-02 +164 157 4.16666666666667e-02 +164 342 8.33333333333333e-02 +164 162 -1.66666666666667e-01 +164 174 1.66666666666667e-01 +164 5 -1.25000000000000e-01 +164 176 -7.50000000000000e-01 +164 4 8.33333333333333e-02 +164 163 -1.66666666666667e-01 +164 175 1.66666666666667e-01 +164 3 -4.16666666666667e-02 +164 156 4.16666666666667e-02 +164 477 4.16666666666667e-02 +164 62 -1.25000000000000e-01 +164 344 -1.25000000000000e-01 +164 61 8.33333333333333e-02 +164 481 -1.66666666666667e-01 +164 60 -4.16666666666667e-02 +164 480 8.33333333333333e-02 +165 165 1.25000000000000e+00 +165 484 8.33333333333333e-02 +165 485 8.33333333333333e-02 +165 478 8.33333333333333e-02 +165 477 -1.25000000000000e-01 +165 167 -1.66666666666667e-01 +165 164 8.33333333333333e-02 +165 163 8.33333333333333e-02 +165 162 -3.75000000000000e-01 +165 178 -8.33333333333333e-02 +165 166 -1.66666666666667e-01 +165 461 8.33333333333333e-02 +165 496 -8.33333333333333e-02 +165 466 8.33333333333333e-02 +165 179 1.66666666666667e-01 +165 467 -1.66666666666667e-01 +165 65 4.16666666666667e-02 +165 497 -8.33333333333333e-02 +165 460 8.33333333333333e-02 +165 64 -8.33333333333333e-02 +165 459 -3.75000000000000e-01 +165 161 -4.16666666666667e-02 +165 5 4.16666666666667e-02 +165 160 8.33333333333333e-02 +165 4 -8.33333333333333e-02 +165 159 -1.25000000000000e-01 +165 479 -4.16666666666667e-02 +165 177 -2.50000000000000e-01 +166 166 1.25000000000000e+00 +166 483 8.33333333333333e-02 +166 485 -1.66666666666667e-01 +166 65 4.16666666666667e-02 +166 478 -3.75000000000000e-01 +166 477 8.33333333333333e-02 +166 164 -4.16666666666667e-02 +166 5 4.16666666666667e-02 +166 163 -1.25000000000000e-01 +166 162 8.33333333333333e-02 +166 177 -8.33333333333333e-02 +166 461 -4.16666666666667e-02 +166 165 -1.66666666666667e-01 +166 495 -8.33333333333333e-02 +166 465 8.33333333333333e-02 +166 497 -8.33333333333333e-02 +166 467 8.33333333333333e-02 +166 460 -1.25000000000000e-01 +166 459 8.33333333333333e-02 +166 63 -8.33333333333333e-02 +166 161 8.33333333333333e-02 +166 167 -1.66666666666667e-01 +166 179 1.66666666666667e-01 +166 160 -3.75000000000000e-01 +166 479 8.33333333333333e-02 +166 178 -2.50000000000000e-01 +166 159 8.33333333333333e-02 +166 3 -8.33333333333333e-02 +167 167 1.25000000000000e+00 +167 478 8.33333333333333e-02 +167 484 -1.66666666666667e-01 +167 483 8.33333333333333e-02 +167 479 -1.25000000000000e-01 +167 64 4.16666666666667e-02 +167 164 -1.25000000000000e-01 +167 163 -4.16666666666667e-02 +167 4 4.16666666666667e-02 +167 165 -1.66666666666667e-01 +167 162 8.33333333333333e-02 +167 460 -4.16666666666667e-02 +167 459 8.33333333333333e-02 +167 496 -8.33333333333333e-02 +167 466 8.33333333333333e-02 +167 177 1.66666666666667e-01 +167 465 -1.66666666666667e-01 +167 461 -1.25000000000000e-01 +167 63 4.16666666666667e-02 +167 495 -8.33333333333333e-02 +167 161 -1.25000000000000e-01 +167 477 -4.16666666666667e-02 +167 179 -7.50000000000000e-01 +167 160 8.33333333333333e-02 +167 166 -1.66666666666667e-01 +167 178 1.66666666666667e-01 +167 159 -4.16666666666667e-02 +167 3 4.16666666666667e-02 +168 168 1.25000000000000e+00 +168 521 -8.33333333333333e-02 +168 514 4.16666666666667e-02 +168 520 -8.33333333333333e-02 +168 515 -8.33333333333333e-02 +168 173 8.33333333333333e-02 +168 172 8.33333333333333e-02 +168 178 -1.66666666666667e-01 +168 171 -3.75000000000000e-01 +168 518 8.33333333333333e-02 +168 176 -8.33333333333333e-02 +168 169 -1.66666666666667e-01 +168 175 1.66666666666667e-01 +168 346 8.33333333333333e-02 +168 5 8.33333333333333e-02 +168 158 -8.33333333333333e-02 +168 4 -4.16666666666667e-02 +168 157 4.16666666666667e-02 +168 3 -1.25000000000000e-01 +168 174 -2.50000000000000e-01 +168 170 -1.66666666666667e-01 +168 68 8.33333333333333e-02 +168 347 8.33333333333333e-02 +168 67 -4.16666666666667e-02 +168 517 8.33333333333333e-02 +168 179 8.33333333333333e-02 +168 66 -1.25000000000000e-01 +168 345 -3.75000000000000e-01 +169 169 1.25000000000000e+00 +169 519 -8.33333333333333e-02 +169 515 4.16666666666667e-02 +169 521 -8.33333333333333e-02 +169 173 -4.16666666666667e-02 +169 179 8.33333333333333e-02 +169 172 -1.25000000000000e-01 +169 171 8.33333333333333e-02 +169 177 -1.66666666666667e-01 +169 158 4.16666666666667e-02 +169 347 -4.16666666666667e-02 +169 168 -1.66666666666667e-01 +169 174 1.66666666666667e-01 +169 345 8.33333333333333e-02 +169 5 8.33333333333333e-02 +169 170 -1.66666666666667e-01 +169 176 1.66666666666667e-01 +169 4 -1.25000000000000e-01 +169 175 -7.50000000000000e-01 +169 3 -4.16666666666667e-02 +169 156 4.16666666666667e-02 +169 68 8.33333333333333e-02 +169 518 -1.66666666666667e-01 +169 513 4.16666666666667e-02 +169 67 -1.25000000000000e-01 +169 346 -1.25000000000000e-01 +169 66 -4.16666666666667e-02 +169 516 8.33333333333333e-02 +170 170 1.25000000000000e+00 +170 519 -8.33333333333333e-02 +170 514 4.16666666666667e-02 +170 520 -8.33333333333333e-02 +170 513 -8.33333333333333e-02 +170 173 -1.25000000000000e-01 +170 172 -4.16666666666667e-02 +170 178 8.33333333333333e-02 +170 171 8.33333333333333e-02 +170 516 8.33333333333333e-02 +170 174 -8.33333333333333e-02 +170 157 4.16666666666667e-02 +170 346 -4.16666666666667e-02 +170 5 -3.75000000000000e-01 +170 176 -2.50000000000000e-01 +170 4 8.33333333333333e-02 +170 169 -1.66666666666667e-01 +170 175 1.66666666666667e-01 +170 3 8.33333333333333e-02 +170 156 -8.33333333333333e-02 +170 177 8.33333333333333e-02 +170 68 -3.75000000000000e-01 +170 347 -1.25000000000000e-01 +170 67 8.33333333333333e-02 +170 517 -1.66666666666667e-01 +170 168 -1.66666666666667e-01 +170 66 8.33333333333333e-02 +170 345 8.33333333333333e-02 +171 171 1.25000000000000e+00 +171 467 8.33333333333333e-02 +171 466 -1.66666666666667e-01 +171 464 8.33333333333333e-02 +171 70 4.16666666666667e-02 +171 462 -3.75000000000000e-01 +171 161 8.33333333333333e-02 +171 160 -4.16666666666667e-02 +171 4 4.16666666666667e-02 +171 159 -1.25000000000000e-01 +171 179 -8.33333333333333e-02 +171 173 -1.66666666666667e-01 +171 514 -4.16666666666667e-02 +171 533 -8.33333333333333e-02 +171 521 8.33333333333333e-02 +171 532 -8.33333333333333e-02 +171 520 8.33333333333333e-02 +171 515 8.33333333333333e-02 +171 71 -8.33333333333333e-02 +171 513 -1.25000000000000e-01 +171 170 8.33333333333333e-02 +171 5 -8.33333333333333e-02 +171 169 8.33333333333333e-02 +171 172 -1.66666666666667e-01 +171 178 1.66666666666667e-01 +171 168 -3.75000000000000e-01 +171 463 8.33333333333333e-02 +171 177 -2.50000000000000e-01 +172 172 1.25000000000000e+00 +172 467 8.33333333333333e-02 +172 462 8.33333333333333e-02 +172 465 -1.66666666666667e-01 +172 463 -1.25000000000000e-01 +172 69 4.16666666666667e-02 +172 161 8.33333333333333e-02 +172 173 -1.66666666666667e-01 +172 160 -1.25000000000000e-01 +172 159 -4.16666666666667e-02 +172 3 4.16666666666667e-02 +172 513 -4.16666666666667e-02 +172 515 8.33333333333333e-02 +172 179 1.66666666666667e-01 +172 521 -1.66666666666667e-01 +172 531 -8.33333333333333e-02 +172 519 8.33333333333333e-02 +172 71 4.16666666666667e-02 +172 533 -8.33333333333333e-02 +172 514 -1.25000000000000e-01 +172 170 -4.16666666666667e-02 +172 5 4.16666666666667e-02 +172 169 -1.25000000000000e-01 +172 464 -4.16666666666667e-02 +172 178 -7.50000000000000e-01 +172 168 8.33333333333333e-02 +172 171 -1.66666666666667e-01 +172 177 1.66666666666667e-01 +173 173 1.25000000000000e+00 +173 466 8.33333333333333e-02 +173 465 8.33333333333333e-02 +173 464 -1.25000000000000e-01 +173 462 8.33333333333333e-02 +173 161 -3.75000000000000e-01 +173 160 8.33333333333333e-02 +173 172 -1.66666666666667e-01 +173 159 8.33333333333333e-02 +173 177 -8.33333333333333e-02 +173 171 -1.66666666666667e-01 +173 514 8.33333333333333e-02 +173 531 -8.33333333333333e-02 +173 519 8.33333333333333e-02 +173 178 1.66666666666667e-01 +173 520 -1.66666666666667e-01 +173 515 -3.75000000000000e-01 +173 70 4.16666666666667e-02 +173 532 -8.33333333333333e-02 +173 513 8.33333333333333e-02 +173 69 -8.33333333333333e-02 +173 170 -1.25000000000000e-01 +173 463 -4.16666666666667e-02 +173 179 -2.50000000000000e-01 +173 169 -4.16666666666667e-02 +173 4 4.16666666666667e-02 +173 168 8.33333333333333e-02 +173 3 -8.33333333333333e-02 +174 174 2.50000000000000e+00 +174 484 -1.66666666666667e-01 +174 179 1.66666666666667e-01 +174 521 -1.66666666666667e-01 +174 550 -8.33333333333333e-02 +174 520 8.33333333333333e-02 +174 551 -8.33333333333333e-02 +174 178 1.66666666666667e-01 +174 177 -7.50000000000000e-01 +174 164 1.66666666666667e-01 +174 343 8.33333333333333e-02 +174 163 -8.33333333333333e-02 +174 344 -1.66666666666667e-01 +174 5 8.33333333333333e-02 +174 162 -2.50000000000000e-01 +174 482 -8.33333333333333e-02 +174 74 8.33333333333333e-02 +174 175 -3.33333333333333e-01 +174 481 1.66666666666667e-01 +174 480 -2.50000000000000e-01 +174 170 -8.33333333333333e-02 +174 169 1.66666666666667e-01 +174 158 -8.33333333333333e-02 +174 347 8.33333333333333e-02 +174 349 1.66666666666667e-01 +174 346 -1.66666666666667e-01 +174 4 8.33333333333333e-02 +174 157 -8.33333333333333e-02 +174 168 -2.50000000000000e-01 +174 176 -3.33333333333333e-01 +174 518 1.66666666666667e-01 +174 350 1.66666666666667e-01 +174 517 -8.33333333333333e-02 +174 73 8.33333333333333e-02 +174 485 8.33333333333333e-02 +174 516 -2.50000000000000e-01 +174 348 -7.50000000000000e-01 +175 175 2.50000000000000e+00 +175 483 -1.66666666666667e-01 +175 179 -8.33333333333333e-02 +175 551 -8.33333333333333e-02 +175 521 8.33333333333333e-02 +175 549 -8.33333333333333e-02 +175 519 8.33333333333333e-02 +175 178 -2.50000000000000e-01 +175 177 1.66666666666667e-01 +175 342 8.33333333333333e-02 +175 162 -8.33333333333333e-02 +175 344 8.33333333333333e-02 +175 164 1.66666666666667e-01 +175 163 -2.50000000000000e-01 +175 482 1.66666666666667e-01 +175 481 -7.50000000000000e-01 +175 174 -3.33333333333333e-01 +175 480 1.66666666666667e-01 +175 350 -8.33333333333333e-02 +175 176 -3.33333333333333e-01 +175 158 -8.33333333333333e-02 +175 347 8.33333333333333e-02 +175 168 1.66666666666667e-01 +175 348 1.66666666666667e-01 +175 345 -1.66666666666667e-01 +175 5 -1.66666666666667e-01 +175 170 1.66666666666667e-01 +175 169 -7.50000000000000e-01 +175 3 8.33333333333333e-02 +175 156 -8.33333333333333e-02 +175 518 1.66666666666667e-01 +175 74 -1.66666666666667e-01 +175 485 8.33333333333333e-02 +175 517 -2.50000000000000e-01 +175 349 -2.50000000000000e-01 +175 516 -8.33333333333333e-02 +175 72 8.33333333333333e-02 +176 176 2.50000000000000e+00 +176 484 8.33333333333333e-02 +176 178 -8.33333333333333e-02 +176 550 -8.33333333333333e-02 +176 520 8.33333333333333e-02 +176 177 1.66666666666667e-01 +176 519 -1.66666666666667e-01 +176 549 -8.33333333333333e-02 +176 179 -2.50000000000000e-01 +176 162 1.66666666666667e-01 +176 343 8.33333333333333e-02 +176 342 -1.66666666666667e-01 +176 164 -7.50000000000000e-01 +176 163 1.66666666666667e-01 +176 3 8.33333333333333e-02 +176 482 -2.50000000000000e-01 +176 481 1.66666666666667e-01 +176 480 -8.33333333333333e-02 +176 72 8.33333333333333e-02 +176 349 -8.33333333333333e-02 +176 175 -3.33333333333333e-01 +176 168 -8.33333333333333e-02 +176 157 -8.33333333333333e-02 +176 346 8.33333333333333e-02 +176 156 -8.33333333333333e-02 +176 345 8.33333333333333e-02 +176 170 -2.50000000000000e-01 +176 4 -1.66666666666667e-01 +176 169 1.66666666666667e-01 +176 483 8.33333333333333e-02 +176 518 -7.50000000000000e-01 +176 350 -2.50000000000000e-01 +176 517 1.66666666666667e-01 +176 73 -1.66666666666667e-01 +176 174 -3.33333333333333e-01 +176 516 1.66666666666667e-01 +176 348 1.66666666666667e-01 +177 177 2.50000000000000e+00 +177 484 1.66666666666667e-01 +177 483 -2.50000000000000e-01 +177 164 -1.66666666666667e-01 +177 163 8.33333333333333e-02 +177 176 1.66666666666667e-01 +177 550 8.33333333333333e-02 +177 175 1.66666666666667e-01 +177 174 -7.50000000000000e-01 +177 551 8.33333333333333e-02 +177 166 -8.33333333333333e-02 +177 167 1.66666666666667e-01 +177 179 -3.33333333333333e-01 +177 5 -8.33333333333333e-02 +177 165 -2.50000000000000e-01 +177 497 8.33333333333333e-02 +177 77 -8.33333333333333e-02 +177 496 -1.66666666666667e-01 +177 161 8.33333333333333e-02 +177 466 1.66666666666667e-01 +177 178 -3.33333333333333e-01 +177 467 1.66666666666667e-01 +177 76 -8.33333333333333e-02 +177 465 -7.50000000000000e-01 +177 160 8.33333333333333e-02 +177 4 -8.33333333333333e-02 +177 173 -8.33333333333333e-02 +177 170 8.33333333333333e-02 +177 532 8.33333333333333e-02 +177 520 -8.33333333333333e-02 +177 169 -1.66666666666667e-01 +177 172 1.66666666666667e-01 +177 171 -2.50000000000000e-01 +177 521 1.66666666666667e-01 +177 533 -1.66666666666667e-01 +177 519 -2.50000000000000e-01 +177 485 -8.33333333333333e-02 +178 178 2.50000000000000e+00 +178 483 1.66666666666667e-01 +178 485 1.66666666666667e-01 +178 484 -7.50000000000000e-01 +178 162 8.33333333333333e-02 +178 176 -8.33333333333333e-02 +178 549 8.33333333333333e-02 +178 175 -2.50000000000000e-01 +178 174 1.66666666666667e-01 +178 551 -1.66666666666667e-01 +178 165 -8.33333333333333e-02 +178 497 8.33333333333333e-02 +178 167 1.66666666666667e-01 +178 166 -2.50000000000000e-01 +178 495 -1.66666666666667e-01 +178 467 -8.33333333333333e-02 +178 465 1.66666666666667e-01 +178 177 -3.33333333333333e-01 +178 466 -2.50000000000000e-01 +178 75 -8.33333333333333e-02 +178 161 -1.66666666666667e-01 +178 159 8.33333333333333e-02 +178 3 -8.33333333333333e-02 +178 173 1.66666666666667e-01 +178 179 -3.33333333333333e-01 +178 521 1.66666666666667e-01 +178 531 8.33333333333333e-02 +178 519 -8.33333333333333e-02 +178 170 8.33333333333333e-02 +178 5 -8.33333333333333e-02 +178 172 -7.50000000000000e-01 +178 168 -1.66666666666667e-01 +178 171 1.66666666666667e-01 +178 533 8.33333333333333e-02 +178 77 -8.33333333333333e-02 +178 520 -2.50000000000000e-01 +178 164 8.33333333333333e-02 +179 179 2.50000000000000e+00 +179 163 8.33333333333333e-02 +179 485 -2.50000000000000e-01 +179 484 1.66666666666667e-01 +179 162 -1.66666666666667e-01 +179 175 -8.33333333333333e-02 +179 174 1.66666666666667e-01 +179 176 -2.50000000000000e-01 +179 550 -1.66666666666667e-01 +179 549 8.33333333333333e-02 +179 496 8.33333333333333e-02 +179 165 1.66666666666667e-01 +179 177 -3.33333333333333e-01 +179 167 -7.50000000000000e-01 +179 166 1.66666666666667e-01 +179 3 -8.33333333333333e-02 +179 495 8.33333333333333e-02 +179 75 -8.33333333333333e-02 +179 466 -8.33333333333333e-02 +179 159 8.33333333333333e-02 +179 467 -2.50000000000000e-01 +179 465 1.66666666666667e-01 +179 160 -1.66666666666667e-01 +179 171 -8.33333333333333e-02 +179 168 8.33333333333333e-02 +179 172 1.66666666666667e-01 +179 178 -3.33333333333333e-01 +179 520 1.66666666666667e-01 +179 173 -2.50000000000000e-01 +179 169 8.33333333333333e-02 +179 4 -8.33333333333333e-02 +179 521 -7.50000000000000e-01 +179 483 -8.33333333333333e-02 +179 532 8.33333333333333e-02 +179 76 -8.33333333333333e-02 +179 519 1.66666666666667e-01 +179 531 -1.66666666666667e-01 +180 180 7.50000000000000e-01 +180 7 4.16666666666667e-02 +180 184 -8.33333333333333e-02 +180 470 -4.16666666666667e-02 +180 181 -8.33333333333333e-02 +180 469 8.33333333333333e-02 +180 58 4.16666666666667e-02 +180 468 -1.25000000000000e-01 +180 191 -8.33333333333333e-02 +180 476 8.33333333333333e-02 +180 8 4.16666666666667e-02 +180 188 -8.33333333333333e-02 +180 187 4.16666666666667e-02 +180 190 -8.33333333333333e-02 +180 6 -2.50000000000000e-01 +180 182 -8.33333333333333e-02 +180 473 8.33333333333333e-02 +180 59 4.16666666666667e-02 +180 472 -4.16666666666667e-02 +180 475 8.33333333333333e-02 +180 185 4.16666666666667e-02 +180 471 -1.25000000000000e-01 +180 57 -2.50000000000000e-01 +181 181 6.66666666666667e-01 +181 6 4.16666666666667e-02 +181 183 -8.33333333333333e-02 +181 470 8.33333333333333e-02 +181 469 -3.75000000000000e-01 +181 180 -8.33333333333333e-02 +181 468 8.33333333333333e-02 +181 57 4.16666666666667e-02 +181 188 4.16666666666667e-02 +181 191 -8.33333333333333e-02 +181 7 -8.33333333333333e-02 +181 186 4.16666666666667e-02 +181 189 -8.33333333333333e-02 +181 473 8.33333333333333e-02 +181 476 -1.66666666666667e-01 +181 185 4.16666666666667e-02 +181 472 -1.25000000000000e-01 +181 58 -8.33333333333333e-02 +181 471 -4.16666666666667e-02 +181 474 8.33333333333333e-02 +182 182 6.66666666666667e-01 +182 183 4.16666666666667e-02 +182 470 -1.25000000000000e-01 +182 469 8.33333333333333e-02 +182 468 -4.16666666666667e-02 +182 187 4.16666666666667e-02 +182 190 -8.33333333333333e-02 +182 189 -8.33333333333333e-02 +182 474 8.33333333333333e-02 +182 8 -8.33333333333333e-02 +182 6 4.16666666666667e-02 +182 186 -8.33333333333333e-02 +182 184 4.16666666666667e-02 +182 473 -3.75000000000000e-01 +182 59 -8.33333333333333e-02 +182 472 8.33333333333333e-02 +182 475 -1.66666666666667e-01 +182 180 -8.33333333333333e-02 +182 471 8.33333333333333e-02 +182 57 4.16666666666667e-02 +183 183 1.25000000000000e+00 +183 79 8.33333333333333e-02 +183 184 -1.66666666666667e-01 +183 7 8.33333333333333e-02 +183 587 8.33333333333333e-02 +183 586 8.33333333333333e-02 +183 78 -1.25000000000000e-01 +183 191 1.66666666666667e-01 +183 190 -8.33333333333333e-02 +183 189 -2.50000000000000e-01 +183 6 -1.25000000000000e-01 +183 185 -1.66666666666667e-01 +183 8 -4.16666666666667e-02 +183 182 4.16666666666667e-02 +183 181 -8.33333333333333e-02 +183 80 -4.16666666666667e-02 +183 469 8.33333333333333e-02 +183 470 8.33333333333333e-02 +183 468 -3.75000000000000e-01 +183 970 -8.33333333333333e-02 +183 788 8.33333333333333e-02 +183 787 8.33333333333333e-02 +183 786 -3.75000000000000e-01 +183 974 -8.33333333333333e-02 +183 973 -8.33333333333333e-02 +183 794 -1.66666666666667e-01 +183 793 8.33333333333333e-02 +183 971 4.16666666666667e-02 +184 184 1.25000000000000e+00 +184 78 8.33333333333333e-02 +184 183 -1.66666666666667e-01 +184 6 8.33333333333333e-02 +184 587 -1.66666666666667e-01 +184 80 8.33333333333333e-02 +184 79 -3.75000000000000e-01 +184 585 8.33333333333333e-02 +184 191 1.66666666666667e-01 +184 185 -1.66666666666667e-01 +184 8 8.33333333333333e-02 +184 190 -2.50000000000000e-01 +184 7 -3.75000000000000e-01 +184 189 -8.33333333333333e-02 +184 182 4.16666666666667e-02 +184 180 -8.33333333333333e-02 +184 470 -4.16666666666667e-02 +184 469 -1.25000000000000e-01 +184 468 8.33333333333333e-02 +184 969 -8.33333333333333e-02 +184 788 -4.16666666666667e-02 +184 787 -1.25000000000000e-01 +184 786 8.33333333333333e-02 +184 974 -8.33333333333333e-02 +184 794 8.33333333333333e-02 +184 972 -8.33333333333333e-02 +184 971 4.16666666666667e-02 +184 792 8.33333333333333e-02 +185 185 1.25000000000000e+00 +185 585 8.33333333333333e-02 +185 80 -1.25000000000000e-01 +185 586 -1.66666666666667e-01 +185 79 8.33333333333333e-02 +185 191 -7.50000000000000e-01 +185 8 -1.25000000000000e-01 +185 190 1.66666666666667e-01 +185 184 -1.66666666666667e-01 +185 7 8.33333333333333e-02 +185 189 1.66666666666667e-01 +185 181 4.16666666666667e-02 +185 468 8.33333333333333e-02 +185 183 -1.66666666666667e-01 +185 6 -4.16666666666667e-02 +185 180 4.16666666666667e-02 +185 469 -4.16666666666667e-02 +185 470 -1.25000000000000e-01 +185 78 -4.16666666666667e-02 +185 970 4.16666666666667e-02 +185 788 -1.25000000000000e-01 +185 787 -4.16666666666667e-02 +185 786 8.33333333333333e-02 +185 972 -8.33333333333333e-02 +185 973 -8.33333333333333e-02 +185 793 8.33333333333333e-02 +185 969 4.16666666666667e-02 +185 792 -1.66666666666667e-01 +186 186 1.25000000000000e+00 +186 593 8.33333333333333e-02 +186 191 -8.33333333333333e-02 +186 190 1.66666666666667e-01 +186 189 -2.50000000000000e-01 +186 83 8.33333333333333e-02 +186 81 -1.25000000000000e-01 +186 188 -1.66666666666667e-01 +186 8 8.33333333333333e-02 +186 592 8.33333333333333e-02 +186 6 -1.25000000000000e-01 +186 187 -1.66666666666667e-01 +186 472 8.33333333333333e-02 +186 182 -8.33333333333333e-02 +186 7 -4.16666666666667e-02 +186 181 4.16666666666667e-02 +186 473 8.33333333333333e-02 +186 82 -4.16666666666667e-02 +186 471 -3.75000000000000e-01 +186 794 8.33333333333333e-02 +186 1004 -8.33333333333333e-02 +186 1000 4.16666666666667e-02 +186 1003 -8.33333333333333e-02 +186 1001 -8.33333333333333e-02 +186 791 8.33333333333333e-02 +186 790 8.33333333333333e-02 +186 793 -1.66666666666667e-01 +186 789 -3.75000000000000e-01 +187 187 1.25000000000000e+00 +187 593 -1.66666666666667e-01 +187 83 8.33333333333333e-02 +187 191 1.66666666666667e-01 +187 188 -1.66666666666667e-01 +187 8 8.33333333333333e-02 +187 190 -7.50000000000000e-01 +187 189 1.66666666666667e-01 +187 82 -1.25000000000000e-01 +187 591 8.33333333333333e-02 +187 7 -1.25000000000000e-01 +187 473 -4.16666666666667e-02 +187 186 -1.66666666666667e-01 +187 471 8.33333333333333e-02 +187 6 -4.16666666666667e-02 +187 180 4.16666666666667e-02 +187 182 4.16666666666667e-02 +187 472 -1.25000000000000e-01 +187 81 -4.16666666666667e-02 +187 999 4.16666666666667e-02 +187 1002 -8.33333333333333e-02 +187 1001 4.16666666666667e-02 +187 1004 -8.33333333333333e-02 +187 791 -4.16666666666667e-02 +187 794 8.33333333333333e-02 +187 790 -1.25000000000000e-01 +187 789 8.33333333333333e-02 +187 792 -1.66666666666667e-01 +188 188 1.25000000000000e+00 +188 82 8.33333333333333e-02 +188 591 8.33333333333333e-02 +188 191 -2.50000000000000e-01 +188 190 1.66666666666667e-01 +188 187 -1.66666666666667e-01 +188 7 8.33333333333333e-02 +188 189 -8.33333333333333e-02 +188 83 -3.75000000000000e-01 +188 81 8.33333333333333e-02 +188 592 -1.66666666666667e-01 +188 8 -3.75000000000000e-01 +188 186 -1.66666666666667e-01 +188 6 8.33333333333333e-02 +188 181 4.16666666666667e-02 +188 472 -4.16666666666667e-02 +188 180 -8.33333333333333e-02 +188 473 -1.25000000000000e-01 +188 471 8.33333333333333e-02 +188 792 8.33333333333333e-02 +188 1002 -8.33333333333333e-02 +188 1000 4.16666666666667e-02 +188 1003 -8.33333333333333e-02 +188 999 -8.33333333333333e-02 +188 791 -1.25000000000000e-01 +188 790 -4.16666666666667e-02 +188 793 8.33333333333333e-02 +188 789 8.33333333333333e-02 +189 189 2.50000000000000e+00 +189 587 -8.33333333333333e-02 +189 586 1.66666666666667e-01 +189 85 8.33333333333333e-02 +189 585 -2.50000000000000e-01 +189 191 -3.33333333333333e-01 +189 185 1.66666666666667e-01 +189 184 -8.33333333333333e-02 +189 7 8.33333333333333e-02 +189 183 -2.50000000000000e-01 +189 592 -8.33333333333333e-02 +189 593 1.66666666666667e-01 +189 86 8.33333333333333e-02 +189 591 -2.50000000000000e-01 +189 188 -8.33333333333333e-02 +189 8 8.33333333333333e-02 +189 190 -3.33333333333333e-01 +189 187 1.66666666666667e-01 +189 186 -2.50000000000000e-01 +189 469 8.33333333333333e-02 +189 470 -1.66666666666667e-01 +189 182 -8.33333333333333e-02 +189 473 8.33333333333333e-02 +189 475 1.66666666666667e-01 +189 472 -1.66666666666667e-01 +189 181 -8.33333333333333e-02 +189 476 1.66666666666667e-01 +189 474 -7.50000000000000e-01 +189 973 -1.66666666666667e-01 +189 794 1.66666666666667e-01 +189 1004 -1.66666666666667e-01 +189 1030 -8.33333333333333e-02 +189 1003 8.33333333333333e-02 +189 1031 -8.33333333333333e-02 +189 793 1.66666666666667e-01 +189 974 8.33333333333333e-02 +189 792 -7.50000000000000e-01 +190 190 2.50000000000000e+00 +190 587 1.66666666666667e-01 +190 586 -7.50000000000000e-01 +190 84 8.33333333333333e-02 +190 185 1.66666666666667e-01 +190 184 -2.50000000000000e-01 +190 183 -8.33333333333333e-02 +190 6 8.33333333333333e-02 +190 191 -3.33333333333333e-01 +190 591 -8.33333333333333e-02 +190 86 -1.66666666666667e-01 +190 593 1.66666666666667e-01 +190 592 -2.50000000000000e-01 +190 188 1.66666666666667e-01 +190 8 -1.66666666666667e-01 +190 585 1.66666666666667e-01 +190 187 -7.50000000000000e-01 +190 189 -3.33333333333333e-01 +190 186 1.66666666666667e-01 +190 470 8.33333333333333e-02 +190 476 -8.33333333333333e-02 +190 182 -8.33333333333333e-02 +190 473 8.33333333333333e-02 +190 474 1.66666666666667e-01 +190 471 -1.66666666666667e-01 +190 180 -8.33333333333333e-02 +190 468 8.33333333333333e-02 +190 475 -2.50000000000000e-01 +190 974 8.33333333333333e-02 +190 972 -1.66666666666667e-01 +190 794 -8.33333333333333e-02 +190 1031 -8.33333333333333e-02 +190 1004 8.33333333333333e-02 +190 1029 -8.33333333333333e-02 +190 1002 8.33333333333333e-02 +190 793 -2.50000000000000e-01 +190 792 1.66666666666667e-01 +191 191 2.50000000000000e+00 +191 585 -8.33333333333333e-02 +191 587 -2.50000000000000e-01 +191 586 1.66666666666667e-01 +191 185 -7.50000000000000e-01 +191 184 1.66666666666667e-01 +191 189 -3.33333333333333e-01 +191 183 1.66666666666667e-01 +191 190 -3.33333333333333e-01 +191 591 1.66666666666667e-01 +191 593 -7.50000000000000e-01 +191 85 -1.66666666666667e-01 +191 592 1.66666666666667e-01 +191 84 8.33333333333333e-02 +191 188 -2.50000000000000e-01 +191 187 1.66666666666667e-01 +191 7 -1.66666666666667e-01 +191 186 -8.33333333333333e-02 +191 6 8.33333333333333e-02 +191 469 8.33333333333333e-02 +191 468 -1.66666666666667e-01 +191 475 -8.33333333333333e-02 +191 181 -8.33333333333333e-02 +191 472 8.33333333333333e-02 +191 180 -8.33333333333333e-02 +191 471 8.33333333333333e-02 +191 476 -2.50000000000000e-01 +191 474 1.66666666666667e-01 +191 973 8.33333333333333e-02 +191 793 -8.33333333333333e-02 +191 1030 -8.33333333333333e-02 +191 1003 8.33333333333333e-02 +191 792 1.66666666666667e-01 +191 1002 -1.66666666666667e-01 +191 1029 -8.33333333333333e-02 +191 972 8.33333333333333e-02 +191 794 -2.50000000000000e-01 +192 192 2.98333333333333e+01 +192 194 -8.33333333333333e+00 +192 365 4.25000000000000e+00 +192 199 2.12500000000000e+00 +192 364 -2.12500000000000e+00 +192 41 -2.08333333333333e+00 +192 40 2.12500000000000e+00 +192 39 -2.16666666666667e+00 +192 363 -6.37500000000000e+00 +192 11 -2.08333333333333e+00 +192 200 2.12500000000000e+00 +192 193 -4.25000000000000e+00 +192 10 2.12500000000000e+00 +192 9 -2.16666666666667e+00 +192 196 -8.33333333333333e-02 +192 362 8.33333333333333e-02 +192 361 8.33333333333333e-02 +192 360 -3.75000000000000e-01 +192 203 -8.33333333333333e-02 +192 202 -8.33333333333333e-02 +192 368 -1.66666666666667e-01 +192 367 8.33333333333333e-02 +192 197 4.16666666666667e-02 +192 1718 2.08333333333333e+00 +192 1717 -4.16666666666667e+00 +192 1462 4.16666666666667e+00 +192 1463 4.16666666666667e+00 +192 1461 -1.87500000000000e+01 +193 193 2.57500000000000e+01 +193 198 2.12500000000000e+00 +193 363 -2.12500000000000e+00 +193 41 2.12500000000000e+00 +193 194 -4.25000000000000e+00 +193 365 4.25000000000000e+00 +193 40 -6.50000000000000e+00 +193 364 -6.37500000000000e+00 +193 39 2.12500000000000e+00 +193 11 2.12500000000000e+00 +193 200 -4.25000000000000e+00 +193 10 -6.50000000000000e+00 +193 192 -4.25000000000000e+00 +193 9 2.12500000000000e+00 +193 195 -8.33333333333333e-02 +193 362 -4.16666666666667e-02 +193 361 -1.25000000000000e-01 +193 360 8.33333333333333e-02 +193 203 -8.33333333333333e-02 +193 368 8.33333333333333e-02 +193 201 -8.33333333333333e-02 +193 197 4.16666666666667e-02 +193 366 8.33333333333333e-02 +193 1718 2.08333333333333e+00 +193 1716 -4.16666666666667e+00 +193 1463 -2.08333333333333e+00 +193 1462 -6.25000000000000e+00 +193 1461 4.16666666666667e+00 +194 194 2.98333333333333e+01 +194 192 -8.33333333333333e+00 +194 363 4.25000000000000e+00 +194 41 -2.16666666666667e+00 +194 365 -1.91250000000000e+01 +194 40 2.12500000000000e+00 +194 193 -4.25000000000000e+00 +194 364 4.25000000000000e+00 +194 39 -2.08333333333333e+00 +194 11 -2.16666666666667e+00 +194 10 2.12500000000000e+00 +194 199 -4.25000000000000e+00 +194 9 -2.08333333333333e+00 +194 198 2.12500000000000e+00 +194 196 4.16666666666667e-02 +194 362 -1.25000000000000e-01 +194 361 -4.16666666666667e-02 +194 360 8.33333333333333e-02 +194 201 -8.33333333333333e-02 +194 202 -8.33333333333333e-02 +194 367 8.33333333333333e-02 +194 195 4.16666666666667e-02 +194 366 -1.66666666666667e-01 +194 1717 2.08333333333333e+00 +194 1461 4.16666666666667e+00 +194 1716 2.08333333333333e+00 +194 1462 -2.08333333333333e+00 +194 1463 -6.25000000000000e+00 +195 195 5.00000000000000e-01 +195 362 -4.16666666666667e-02 +195 604 4.16666666666667e-02 +195 202 -4.16666666666667e-02 +195 89 4.16666666666667e-02 +195 605 -8.33333333333333e-02 +195 88 4.16666666666667e-02 +195 196 -8.33333333333333e-02 +195 361 8.33333333333333e-02 +195 87 -1.25000000000000e-01 +195 360 -1.25000000000000e-01 +195 197 -8.33333333333333e-02 +195 11 4.16666666666667e-02 +195 203 8.33333333333333e-02 +195 10 4.16666666666667e-02 +195 193 -8.33333333333333e-02 +195 194 4.16666666666667e-02 +195 9 -1.25000000000000e-01 +195 201 -1.25000000000000e-01 +196 196 5.83333333333333e-01 +196 362 8.33333333333333e-02 +196 203 8.33333333333333e-02 +196 603 4.16666666666667e-02 +196 201 -4.16666666666667e-02 +196 89 -4.16666666666667e-02 +196 605 4.16666666666667e-02 +196 88 -4.16666666666667e-02 +196 361 -3.75000000000000e-01 +196 87 4.16666666666667e-02 +196 195 -8.33333333333333e-02 +196 360 8.33333333333333e-02 +196 11 -4.16666666666667e-02 +196 194 4.16666666666667e-02 +196 197 -1.66666666666667e-01 +196 10 -4.16666666666667e-02 +196 202 -1.25000000000000e-01 +196 9 4.16666666666667e-02 +196 192 -8.33333333333333e-02 +197 197 5.83333333333333e-01 +197 360 -4.16666666666667e-02 +197 196 -1.66666666666667e-01 +197 361 8.33333333333333e-02 +197 202 8.33333333333333e-02 +197 89 -4.16666666666667e-02 +197 362 -1.25000000000000e-01 +197 88 -4.16666666666667e-02 +197 604 4.16666666666667e-02 +197 87 4.16666666666667e-02 +197 603 -8.33333333333333e-02 +197 192 4.16666666666667e-02 +197 11 -4.16666666666667e-02 +197 203 -3.75000000000000e-01 +197 10 -4.16666666666667e-02 +197 193 4.16666666666667e-02 +197 195 -8.33333333333333e-02 +197 9 4.16666666666667e-02 +197 201 8.33333333333333e-02 +198 198 3.39166666666667e+01 +198 11 2.12500000000000e+00 +198 200 -4.25000000000000e+00 +198 92 2.12500000000000e+00 +198 193 2.12500000000000e+00 +198 194 2.12500000000000e+00 +198 9 -4.20833333333333e+00 +198 365 -2.12500000000000e+00 +198 364 4.25000000000000e+00 +198 363 -6.37500000000000e+00 +198 90 -4.20833333333333e+00 +198 202 8.33333333333333e-02 +198 199 -1.66666666666667e-01 +198 611 -8.33333333333333e-02 +198 91 -4.16666666666667e-02 +198 610 4.16666666666667e-02 +198 203 8.33333333333333e-02 +198 10 -4.16666666666667e-02 +198 201 -3.75000000000000e-01 +198 1466 -4.16666666666667e+00 +198 1826 4.16666666666667e+00 +198 1825 4.16666666666667e+00 +198 1824 -1.87500000000000e+01 +198 1462 -4.16666666666667e+00 +198 1463 -4.16666666666667e+00 +198 1730 4.16666666666667e+00 +198 1729 -8.33333333333333e+00 +198 1465 2.08333333333333e+00 +199 199 3.39166666666667e+01 +199 192 2.12500000000000e+00 +199 194 -4.25000000000000e+00 +199 11 2.12500000000000e+00 +199 10 -4.20833333333333e+00 +199 365 4.25000000000000e+00 +199 200 -4.25000000000000e+00 +199 92 2.12500000000000e+00 +199 364 -1.91250000000000e+01 +199 91 -4.20833333333333e+00 +199 363 4.25000000000000e+00 +199 611 4.16666666666667e-02 +199 201 8.33333333333333e-02 +199 198 -1.66666666666667e-01 +199 90 -4.16666666666667e-02 +199 609 4.16666666666667e-02 +199 203 -4.16666666666667e-02 +199 202 -1.25000000000000e-01 +199 9 -4.16666666666667e-02 +199 1466 2.08333333333333e+00 +199 1826 -2.08333333333333e+00 +199 1825 -6.25000000000000e+00 +199 1824 4.16666666666667e+00 +199 1461 -4.16666666666667e+00 +199 1463 -4.16666666666667e+00 +199 1730 4.16666666666667e+00 +199 1464 2.08333333333333e+00 +199 1728 -8.33333333333333e+00 +200 200 3.80000000000000e+01 +200 9 2.12500000000000e+00 +200 198 -4.25000000000000e+00 +200 90 2.12500000000000e+00 +200 11 -1.26250000000000e+01 +200 193 -4.25000000000000e+00 +200 10 2.12500000000000e+00 +200 192 2.12500000000000e+00 +200 365 -6.37500000000000e+00 +200 92 -1.26250000000000e+01 +200 364 4.25000000000000e+00 +200 199 -4.25000000000000e+00 +200 91 2.12500000000000e+00 +200 363 -2.12500000000000e+00 +200 610 4.16666666666667e-02 +200 609 -8.33333333333333e-02 +200 202 -4.16666666666667e-02 +200 203 -1.25000000000000e-01 +200 201 8.33333333333333e-02 +200 1464 -4.16666666666667e+00 +200 1826 -6.25000000000000e+00 +200 1825 -2.08333333333333e+00 +200 1824 4.16666666666667e+00 +200 1462 -4.16666666666667e+00 +200 1729 4.16666666666667e+00 +200 1461 -4.16666666666667e+00 +200 1465 2.08333333333333e+00 +200 1728 4.16666666666667e+00 +201 201 1.25000000000000e+00 +201 361 8.33333333333333e-02 +201 362 8.33333333333333e-02 +201 197 8.33333333333333e-02 +201 195 -1.25000000000000e-01 +201 605 8.33333333333333e-02 +201 604 8.33333333333333e-02 +201 202 -1.66666666666667e-01 +201 603 -3.75000000000000e-01 +201 368 -8.33333333333333e-02 +201 203 -1.66666666666667e-01 +201 194 -8.33333333333333e-02 +201 365 8.33333333333333e-02 +201 199 8.33333333333333e-02 +201 367 1.66666666666667e-01 +201 364 -1.66666666666667e-01 +201 200 8.33333333333333e-02 +201 11 -8.33333333333333e-02 +201 10 4.16666666666667e-02 +201 193 -8.33333333333333e-02 +201 198 -3.75000000000000e-01 +201 611 8.33333333333333e-02 +201 95 -8.33333333333333e-02 +201 610 -4.16666666666667e-02 +201 94 4.16666666666667e-02 +201 609 -1.25000000000000e-01 +201 196 -4.16666666666667e-02 +201 366 -2.50000000000000e-01 +202 202 1.25000000000000e+00 +202 195 -4.16666666666667e-02 +202 360 8.33333333333333e-02 +202 362 -1.66666666666667e-01 +202 11 4.16666666666667e-02 +202 196 -1.25000000000000e-01 +202 605 -4.16666666666667e-02 +202 95 4.16666666666667e-02 +202 604 -1.25000000000000e-01 +202 603 8.33333333333333e-02 +202 201 -1.66666666666667e-01 +202 200 -4.16666666666667e-02 +202 198 8.33333333333333e-02 +202 194 -8.33333333333333e-02 +202 365 8.33333333333333e-02 +202 366 1.66666666666667e-01 +202 363 -1.66666666666667e-01 +202 199 -1.25000000000000e-01 +202 9 4.16666666666667e-02 +202 192 -8.33333333333333e-02 +202 611 8.33333333333333e-02 +202 203 -1.66666666666667e-01 +202 368 1.66666666666667e-01 +202 610 -1.25000000000000e-01 +202 197 8.33333333333333e-02 +202 367 -7.50000000000000e-01 +202 609 -4.16666666666667e-02 +202 93 4.16666666666667e-02 +203 203 1.25000000000000e+00 +203 361 -1.66666666666667e-01 +203 360 8.33333333333333e-02 +203 197 -3.75000000000000e-01 +203 10 4.16666666666667e-02 +203 195 8.33333333333333e-02 +203 605 -1.25000000000000e-01 +203 604 -4.16666666666667e-02 +203 94 4.16666666666667e-02 +203 603 8.33333333333333e-02 +203 366 -8.33333333333333e-02 +203 199 -4.16666666666667e-02 +203 201 -1.66666666666667e-01 +203 192 -8.33333333333333e-02 +203 363 8.33333333333333e-02 +203 193 -8.33333333333333e-02 +203 364 8.33333333333333e-02 +203 200 -1.25000000000000e-01 +203 198 8.33333333333333e-02 +203 9 -8.33333333333333e-02 +203 611 -3.75000000000000e-01 +203 196 8.33333333333333e-02 +203 368 -2.50000000000000e-01 +203 610 8.33333333333333e-02 +203 202 -1.66666666666667e-01 +203 367 1.66666666666667e-01 +203 609 8.33333333333333e-02 +203 93 -8.33333333333333e-02 +204 204 1.25000000000000e+00 +204 607 8.33333333333333e-02 +204 608 8.33333333333333e-02 +204 211 8.33333333333333e-02 +204 210 -1.25000000000000e-01 +204 206 -1.66666666666667e-01 +204 380 8.33333333333333e-02 +204 379 8.33333333333333e-02 +204 378 -3.75000000000000e-01 +204 385 -8.33333333333333e-02 +204 205 -1.66666666666667e-01 +204 209 8.33333333333333e-02 +204 217 -8.33333333333333e-02 +204 490 8.33333333333333e-02 +204 386 1.66666666666667e-01 +204 491 -1.66666666666667e-01 +204 14 4.16666666666667e-02 +204 218 -8.33333333333333e-02 +204 208 8.33333333333333e-02 +204 13 -8.33333333333333e-02 +204 207 -3.75000000000000e-01 +204 374 -4.16666666666667e-02 +204 44 4.16666666666667e-02 +204 373 8.33333333333333e-02 +204 43 -8.33333333333333e-02 +204 372 -1.25000000000000e-01 +204 212 -4.16666666666667e-02 +204 384 -2.50000000000000e-01 +205 205 1.25000000000000e+00 +205 606 8.33333333333333e-02 +205 608 -1.66666666666667e-01 +205 14 4.16666666666667e-02 +205 211 -3.75000000000000e-01 +205 210 8.33333333333333e-02 +205 380 -4.16666666666667e-02 +205 44 4.16666666666667e-02 +205 379 -1.25000000000000e-01 +205 378 8.33333333333333e-02 +205 384 -8.33333333333333e-02 +205 209 -4.16666666666667e-02 +205 204 -1.66666666666667e-01 +205 216 -8.33333333333333e-02 +205 489 8.33333333333333e-02 +205 218 -8.33333333333333e-02 +205 491 8.33333333333333e-02 +205 208 -1.25000000000000e-01 +205 207 8.33333333333333e-02 +205 12 -8.33333333333333e-02 +205 374 8.33333333333333e-02 +205 206 -1.66666666666667e-01 +205 386 1.66666666666667e-01 +205 373 -3.75000000000000e-01 +205 212 8.33333333333333e-02 +205 385 -2.50000000000000e-01 +205 372 8.33333333333333e-02 +205 42 -8.33333333333333e-02 +206 206 1.25000000000000e+00 +206 211 8.33333333333333e-02 +206 607 -1.66666666666667e-01 +206 606 8.33333333333333e-02 +206 212 -1.25000000000000e-01 +206 13 4.16666666666667e-02 +206 380 -1.25000000000000e-01 +206 379 -4.16666666666667e-02 +206 43 4.16666666666667e-02 +206 204 -1.66666666666667e-01 +206 378 8.33333333333333e-02 +206 208 -4.16666666666667e-02 +206 207 8.33333333333333e-02 +206 217 -8.33333333333333e-02 +206 490 8.33333333333333e-02 +206 384 1.66666666666667e-01 +206 489 -1.66666666666667e-01 +206 209 -1.25000000000000e-01 +206 12 4.16666666666667e-02 +206 216 -8.33333333333333e-02 +206 374 -1.25000000000000e-01 +206 210 -4.16666666666667e-02 +206 386 -7.50000000000000e-01 +206 373 8.33333333333333e-02 +206 205 -1.66666666666667e-01 +206 385 1.66666666666667e-01 +206 372 -4.16666666666667e-02 +206 42 4.16666666666667e-02 +207 207 1.25000000000000e+00 +207 214 -8.33333333333333e-02 +207 488 8.33333333333333e-02 +207 487 8.33333333333333e-02 +207 486 -3.75000000000000e-01 +207 221 -8.33333333333333e-02 +207 220 -8.33333333333333e-02 +207 494 -1.66666666666667e-01 +207 493 8.33333333333333e-02 +207 206 8.33333333333333e-02 +207 209 -1.66666666666667e-01 +207 491 1.66666666666667e-01 +207 217 8.33333333333333e-02 +207 490 -8.33333333333333e-02 +207 62 -4.16666666666667e-02 +207 374 4.16666666666667e-02 +207 61 8.33333333333333e-02 +207 373 -8.33333333333333e-02 +207 60 -1.25000000000000e-01 +207 489 -2.50000000000000e-01 +207 14 -4.16666666666667e-02 +207 218 8.33333333333333e-02 +207 208 -1.66666666666667e-01 +207 13 8.33333333333333e-02 +207 205 8.33333333333333e-02 +207 215 4.16666666666667e-02 +207 12 -1.25000000000000e-01 +207 204 -3.75000000000000e-01 +208 208 1.25000000000000e+00 +208 213 -8.33333333333333e-02 +208 488 -4.16666666666667e-02 +208 487 -1.25000000000000e-01 +208 486 8.33333333333333e-02 +208 221 -8.33333333333333e-02 +208 494 8.33333333333333e-02 +208 219 -8.33333333333333e-02 +208 492 8.33333333333333e-02 +208 206 -4.16666666666667e-02 +208 374 4.16666666666667e-02 +208 216 8.33333333333333e-02 +208 489 -8.33333333333333e-02 +208 62 8.33333333333333e-02 +208 209 -1.66666666666667e-01 +208 491 1.66666666666667e-01 +208 61 -3.75000000000000e-01 +208 490 -2.50000000000000e-01 +208 60 8.33333333333333e-02 +208 372 -8.33333333333333e-02 +208 14 8.33333333333333e-02 +208 218 -1.66666666666667e-01 +208 215 4.16666666666667e-02 +208 13 -3.75000000000000e-01 +208 205 -1.25000000000000e-01 +208 207 -1.66666666666667e-01 +208 12 8.33333333333333e-02 +208 204 8.33333333333333e-02 +209 209 1.25000000000000e+00 +209 214 4.16666666666667e-02 +209 488 -1.25000000000000e-01 +209 487 -4.16666666666667e-02 +209 486 8.33333333333333e-02 +209 219 -8.33333333333333e-02 +209 220 -8.33333333333333e-02 +209 493 8.33333333333333e-02 +209 492 -1.66666666666667e-01 +209 205 -4.16666666666667e-02 +209 373 4.16666666666667e-02 +209 204 8.33333333333333e-02 +209 207 -1.66666666666667e-01 +209 489 1.66666666666667e-01 +209 62 -1.25000000000000e-01 +209 491 -7.50000000000000e-01 +209 61 8.33333333333333e-02 +209 208 -1.66666666666667e-01 +209 490 1.66666666666667e-01 +209 60 -4.16666666666667e-02 +209 372 4.16666666666667e-02 +209 213 4.16666666666667e-02 +209 14 -1.25000000000000e-01 +209 206 -1.25000000000000e-01 +209 13 8.33333333333333e-02 +209 217 -1.66666666666667e-01 +209 12 -4.16666666666667e-02 +209 216 8.33333333333333e-02 +210 210 5.00000000000000e-01 +210 206 -4.16666666666667e-02 +210 217 4.16666666666667e-02 +210 607 -4.16666666666667e-02 +210 14 4.16666666666667e-02 +210 218 -8.33333333333333e-02 +210 13 4.16666666666667e-02 +210 211 -8.33333333333333e-02 +210 205 8.33333333333333e-02 +210 12 -1.25000000000000e-01 +210 204 -1.25000000000000e-01 +210 212 -8.33333333333333e-02 +210 89 4.16666666666667e-02 +210 608 8.33333333333333e-02 +210 88 4.16666666666667e-02 +210 379 -8.33333333333333e-02 +210 380 4.16666666666667e-02 +210 87 -1.25000000000000e-01 +210 606 -1.25000000000000e-01 +211 211 5.83333333333333e-01 +211 206 8.33333333333333e-02 +211 608 8.33333333333333e-02 +211 216 4.16666666666667e-02 +211 606 -4.16666666666667e-02 +211 14 -4.16666666666667e-02 +211 218 4.16666666666667e-02 +211 13 -4.16666666666667e-02 +211 205 -3.75000000000000e-01 +211 12 4.16666666666667e-02 +211 210 -8.33333333333333e-02 +211 204 8.33333333333333e-02 +211 89 -4.16666666666667e-02 +211 380 4.16666666666667e-02 +211 212 -1.66666666666667e-01 +211 88 -4.16666666666667e-02 +211 607 -1.25000000000000e-01 +211 87 4.16666666666667e-02 +211 378 -8.33333333333333e-02 +212 212 5.83333333333333e-01 +212 204 -4.16666666666667e-02 +212 211 -1.66666666666667e-01 +212 205 8.33333333333333e-02 +212 607 8.33333333333333e-02 +212 14 -4.16666666666667e-02 +212 206 -1.25000000000000e-01 +212 13 -4.16666666666667e-02 +212 217 4.16666666666667e-02 +212 12 4.16666666666667e-02 +212 216 -8.33333333333333e-02 +212 378 4.16666666666667e-02 +212 89 -4.16666666666667e-02 +212 608 -3.75000000000000e-01 +212 88 -4.16666666666667e-02 +212 379 4.16666666666667e-02 +212 210 -8.33333333333333e-02 +212 87 4.16666666666667e-02 +212 606 8.33333333333333e-02 +213 213 5.00000000000000e-01 +213 488 -4.16666666666667e-02 +213 622 4.16666666666667e-02 +213 220 -4.16666666666667e-02 +213 98 4.16666666666667e-02 +213 623 -8.33333333333333e-02 +213 97 4.16666666666667e-02 +213 214 -8.33333333333333e-02 +213 487 8.33333333333333e-02 +213 96 -1.25000000000000e-01 +213 486 -1.25000000000000e-01 +213 215 -8.33333333333333e-02 +213 14 4.16666666666667e-02 +213 221 8.33333333333333e-02 +213 13 4.16666666666667e-02 +213 208 -8.33333333333333e-02 +213 209 4.16666666666667e-02 +213 12 -1.25000000000000e-01 +213 219 -1.25000000000000e-01 +214 214 5.83333333333333e-01 +214 488 8.33333333333333e-02 +214 221 8.33333333333333e-02 +214 621 4.16666666666667e-02 +214 219 -4.16666666666667e-02 +214 98 -4.16666666666667e-02 +214 623 4.16666666666667e-02 +214 97 -4.16666666666667e-02 +214 487 -3.75000000000000e-01 +214 96 4.16666666666667e-02 +214 213 -8.33333333333333e-02 +214 486 8.33333333333333e-02 +214 14 -4.16666666666667e-02 +214 209 4.16666666666667e-02 +214 215 -1.66666666666667e-01 +214 13 -4.16666666666667e-02 +214 220 -1.25000000000000e-01 +214 12 4.16666666666667e-02 +214 207 -8.33333333333333e-02 +215 215 5.83333333333333e-01 +215 486 -4.16666666666667e-02 +215 214 -1.66666666666667e-01 +215 487 8.33333333333333e-02 +215 220 8.33333333333333e-02 +215 98 -4.16666666666667e-02 +215 488 -1.25000000000000e-01 +215 97 -4.16666666666667e-02 +215 622 4.16666666666667e-02 +215 96 4.16666666666667e-02 +215 621 -8.33333333333333e-02 +215 207 4.16666666666667e-02 +215 14 -4.16666666666667e-02 +215 221 -3.75000000000000e-01 +215 13 -4.16666666666667e-02 +215 208 4.16666666666667e-02 +215 213 -8.33333333333333e-02 +215 12 4.16666666666667e-02 +215 219 8.33333333333333e-02 +216 216 1.25000000000000e+00 +216 217 -1.66666666666667e-01 +216 629 -8.33333333333333e-02 +216 100 -4.16666666666667e-02 +216 628 4.16666666666667e-02 +216 221 8.33333333333333e-02 +216 13 -4.16666666666667e-02 +216 219 -3.75000000000000e-01 +216 211 4.16666666666667e-02 +216 14 8.33333333333333e-02 +216 212 -8.33333333333333e-02 +216 218 -1.66666666666667e-01 +216 608 8.33333333333333e-02 +216 101 8.33333333333333e-02 +216 607 8.33333333333333e-02 +216 606 -3.75000000000000e-01 +216 205 -8.33333333333333e-02 +216 208 8.33333333333333e-02 +216 209 8.33333333333333e-02 +216 206 -8.33333333333333e-02 +216 12 -1.25000000000000e-01 +216 491 -8.33333333333333e-02 +216 386 8.33333333333333e-02 +216 490 1.66666666666667e-01 +216 385 -1.66666666666667e-01 +216 489 -2.50000000000000e-01 +216 220 8.33333333333333e-02 +216 99 -1.25000000000000e-01 +217 217 1.25000000000000e+00 +217 629 4.16666666666667e-02 +217 219 8.33333333333333e-02 +217 216 -1.66666666666667e-01 +217 99 -4.16666666666667e-02 +217 627 4.16666666666667e-02 +217 220 -1.25000000000000e-01 +217 12 -4.16666666666667e-02 +217 210 4.16666666666667e-02 +217 212 4.16666666666667e-02 +217 608 -4.16666666666667e-02 +217 607 -1.25000000000000e-01 +217 606 8.33333333333333e-02 +217 204 -8.33333333333333e-02 +217 207 8.33333333333333e-02 +217 206 -8.33333333333333e-02 +217 386 8.33333333333333e-02 +217 209 -1.66666666666667e-01 +217 14 8.33333333333333e-02 +217 13 -1.25000000000000e-01 +217 491 1.66666666666667e-01 +217 218 -1.66666666666667e-01 +217 101 8.33333333333333e-02 +217 490 -7.50000000000000e-01 +217 221 -4.16666666666667e-02 +217 100 -1.25000000000000e-01 +217 489 1.66666666666667e-01 +217 384 -1.66666666666667e-01 +218 218 1.25000000000000e+00 +218 628 4.16666666666667e-02 +218 627 -8.33333333333333e-02 +218 221 -1.25000000000000e-01 +218 219 8.33333333333333e-02 +218 211 4.16666666666667e-02 +218 12 8.33333333333333e-02 +218 210 -8.33333333333333e-02 +218 608 -1.25000000000000e-01 +218 607 -4.16666666666667e-02 +218 216 -1.66666666666667e-01 +218 606 8.33333333333333e-02 +218 99 8.33333333333333e-02 +218 205 -8.33333333333333e-02 +218 385 8.33333333333333e-02 +218 14 -3.75000000000000e-01 +218 208 -1.66666666666667e-01 +218 13 8.33333333333333e-02 +218 207 8.33333333333333e-02 +218 204 -8.33333333333333e-02 +218 491 -2.50000000000000e-01 +218 220 -4.16666666666667e-02 +218 101 -3.75000000000000e-01 +218 490 1.66666666666667e-01 +218 217 -1.66666666666667e-01 +218 100 8.33333333333333e-02 +218 489 -8.33333333333333e-02 +218 384 8.33333333333333e-02 +219 219 1.25000000000000e+00 +219 487 8.33333333333333e-02 +219 488 8.33333333333333e-02 +219 215 8.33333333333333e-02 +219 213 -1.25000000000000e-01 +219 623 8.33333333333333e-02 +219 622 8.33333333333333e-02 +219 220 -1.66666666666667e-01 +219 621 -3.75000000000000e-01 +219 494 -8.33333333333333e-02 +219 221 -1.66666666666667e-01 +219 209 -8.33333333333333e-02 +219 491 8.33333333333333e-02 +219 217 8.33333333333333e-02 +219 493 1.66666666666667e-01 +219 490 -1.66666666666667e-01 +219 218 8.33333333333333e-02 +219 14 -8.33333333333333e-02 +219 13 4.16666666666667e-02 +219 208 -8.33333333333333e-02 +219 216 -3.75000000000000e-01 +219 629 8.33333333333333e-02 +219 104 -8.33333333333333e-02 +219 628 -4.16666666666667e-02 +219 103 4.16666666666667e-02 +219 627 -1.25000000000000e-01 +219 214 -4.16666666666667e-02 +219 492 -2.50000000000000e-01 +220 220 1.25000000000000e+00 +220 213 -4.16666666666667e-02 +220 486 8.33333333333333e-02 +220 488 -1.66666666666667e-01 +220 14 4.16666666666667e-02 +220 214 -1.25000000000000e-01 +220 623 -4.16666666666667e-02 +220 104 4.16666666666667e-02 +220 622 -1.25000000000000e-01 +220 621 8.33333333333333e-02 +220 219 -1.66666666666667e-01 +220 218 -4.16666666666667e-02 +220 216 8.33333333333333e-02 +220 209 -8.33333333333333e-02 +220 491 8.33333333333333e-02 +220 492 1.66666666666667e-01 +220 489 -1.66666666666667e-01 +220 217 -1.25000000000000e-01 +220 12 4.16666666666667e-02 +220 207 -8.33333333333333e-02 +220 629 8.33333333333333e-02 +220 221 -1.66666666666667e-01 +220 494 1.66666666666667e-01 +220 628 -1.25000000000000e-01 +220 215 8.33333333333333e-02 +220 493 -7.50000000000000e-01 +220 627 -4.16666666666667e-02 +220 102 4.16666666666667e-02 +221 221 1.25000000000000e+00 +221 487 -1.66666666666667e-01 +221 486 8.33333333333333e-02 +221 215 -3.75000000000000e-01 +221 13 4.16666666666667e-02 +221 213 8.33333333333333e-02 +221 623 -1.25000000000000e-01 +221 622 -4.16666666666667e-02 +221 103 4.16666666666667e-02 +221 621 8.33333333333333e-02 +221 492 -8.33333333333333e-02 +221 217 -4.16666666666667e-02 +221 219 -1.66666666666667e-01 +221 207 -8.33333333333333e-02 +221 489 8.33333333333333e-02 +221 208 -8.33333333333333e-02 +221 490 8.33333333333333e-02 +221 218 -1.25000000000000e-01 +221 216 8.33333333333333e-02 +221 12 -8.33333333333333e-02 +221 629 -3.75000000000000e-01 +221 214 8.33333333333333e-02 +221 494 -2.50000000000000e-01 +221 628 8.33333333333333e-02 +221 220 -1.66666666666667e-01 +221 493 1.66666666666667e-01 +221 627 8.33333333333333e-02 +221 102 -8.33333333333333e-02 +222 222 1.25000000000000e+00 +222 625 8.33333333333333e-02 +222 626 8.33333333333333e-02 +222 229 8.33333333333333e-02 +222 228 -1.25000000000000e-01 +222 224 -1.66666666666667e-01 +222 506 8.33333333333333e-02 +222 505 8.33333333333333e-02 +222 504 -3.75000000000000e-01 +222 511 -8.33333333333333e-02 +222 223 -1.66666666666667e-01 +222 227 8.33333333333333e-02 +222 232 -8.33333333333333e-02 +222 589 8.33333333333333e-02 +222 512 1.66666666666667e-01 +222 590 -1.66666666666667e-01 +222 17 4.16666666666667e-02 +222 233 -8.33333333333333e-02 +222 226 8.33333333333333e-02 +222 16 -8.33333333333333e-02 +222 225 -3.75000000000000e-01 +222 500 -4.16666666666667e-02 +222 65 4.16666666666667e-02 +222 499 8.33333333333333e-02 +222 64 -8.33333333333333e-02 +222 498 -1.25000000000000e-01 +222 230 -4.16666666666667e-02 +222 510 -2.50000000000000e-01 +223 223 1.25000000000000e+00 +223 624 8.33333333333333e-02 +223 626 -1.66666666666667e-01 +223 17 4.16666666666667e-02 +223 229 -3.75000000000000e-01 +223 228 8.33333333333333e-02 +223 506 -4.16666666666667e-02 +223 65 4.16666666666667e-02 +223 505 -1.25000000000000e-01 +223 504 8.33333333333333e-02 +223 510 -8.33333333333333e-02 +223 227 -4.16666666666667e-02 +223 222 -1.66666666666667e-01 +223 231 -8.33333333333333e-02 +223 588 8.33333333333333e-02 +223 233 -8.33333333333333e-02 +223 590 8.33333333333333e-02 +223 226 -1.25000000000000e-01 +223 225 8.33333333333333e-02 +223 15 -8.33333333333333e-02 +223 500 8.33333333333333e-02 +223 224 -1.66666666666667e-01 +223 512 1.66666666666667e-01 +223 499 -3.75000000000000e-01 +223 230 8.33333333333333e-02 +223 511 -2.50000000000000e-01 +223 498 8.33333333333333e-02 +223 63 -8.33333333333333e-02 +224 224 1.25000000000000e+00 +224 229 8.33333333333333e-02 +224 625 -1.66666666666667e-01 +224 624 8.33333333333333e-02 +224 230 -1.25000000000000e-01 +224 16 4.16666666666667e-02 +224 506 -1.25000000000000e-01 +224 505 -4.16666666666667e-02 +224 64 4.16666666666667e-02 +224 222 -1.66666666666667e-01 +224 504 8.33333333333333e-02 +224 226 -4.16666666666667e-02 +224 225 8.33333333333333e-02 +224 232 -8.33333333333333e-02 +224 589 8.33333333333333e-02 +224 510 1.66666666666667e-01 +224 588 -1.66666666666667e-01 +224 227 -1.25000000000000e-01 +224 15 4.16666666666667e-02 +224 231 -8.33333333333333e-02 +224 500 -1.25000000000000e-01 +224 228 -4.16666666666667e-02 +224 512 -7.50000000000000e-01 +224 499 8.33333333333333e-02 +224 223 -1.66666666666667e-01 +224 511 1.66666666666667e-01 +224 498 -4.16666666666667e-02 +224 63 4.16666666666667e-02 +225 225 1.25000000000000e+00 +225 16 8.33333333333333e-02 +225 226 -1.66666666666667e-01 +225 79 8.33333333333333e-02 +225 233 8.33333333333333e-02 +225 232 8.33333333333333e-02 +225 15 -1.25000000000000e-01 +225 590 1.66666666666667e-01 +225 589 -8.33333333333333e-02 +225 588 -2.50000000000000e-01 +225 78 -1.25000000000000e-01 +225 227 -1.66666666666667e-01 +225 80 -4.16666666666667e-02 +225 500 4.16666666666667e-02 +225 499 -8.33333333333333e-02 +225 17 -4.16666666666667e-02 +225 223 8.33333333333333e-02 +225 224 8.33333333333333e-02 +225 222 -3.75000000000000e-01 +225 832 -8.33333333333333e-02 +225 977 8.33333333333333e-02 +225 976 8.33333333333333e-02 +225 975 -3.75000000000000e-01 +225 836 -8.33333333333333e-02 +225 835 -8.33333333333333e-02 +225 980 -1.66666666666667e-01 +225 979 8.33333333333333e-02 +225 833 4.16666666666667e-02 +226 226 1.25000000000000e+00 +226 15 8.33333333333333e-02 +226 225 -1.66666666666667e-01 +226 78 8.33333333333333e-02 +226 233 -1.66666666666667e-01 +226 17 8.33333333333333e-02 +226 16 -3.75000000000000e-01 +226 231 8.33333333333333e-02 +226 590 1.66666666666667e-01 +226 227 -1.66666666666667e-01 +226 80 8.33333333333333e-02 +226 589 -2.50000000000000e-01 +226 79 -3.75000000000000e-01 +226 588 -8.33333333333333e-02 +226 500 4.16666666666667e-02 +226 498 -8.33333333333333e-02 +226 224 -4.16666666666667e-02 +226 223 -1.25000000000000e-01 +226 222 8.33333333333333e-02 +226 831 -8.33333333333333e-02 +226 977 -4.16666666666667e-02 +226 976 -1.25000000000000e-01 +226 975 8.33333333333333e-02 +226 836 -8.33333333333333e-02 +226 980 8.33333333333333e-02 +226 834 -8.33333333333333e-02 +226 833 4.16666666666667e-02 +226 978 8.33333333333333e-02 +227 227 1.25000000000000e+00 +227 231 8.33333333333333e-02 +227 17 -1.25000000000000e-01 +227 232 -1.66666666666667e-01 +227 16 8.33333333333333e-02 +227 590 -7.50000000000000e-01 +227 80 -1.25000000000000e-01 +227 589 1.66666666666667e-01 +227 226 -1.66666666666667e-01 +227 79 8.33333333333333e-02 +227 588 1.66666666666667e-01 +227 499 4.16666666666667e-02 +227 222 8.33333333333333e-02 +227 225 -1.66666666666667e-01 +227 78 -4.16666666666667e-02 +227 498 4.16666666666667e-02 +227 223 -4.16666666666667e-02 +227 224 -1.25000000000000e-01 +227 15 -4.16666666666667e-02 +227 832 4.16666666666667e-02 +227 977 -1.25000000000000e-01 +227 976 -4.16666666666667e-02 +227 975 8.33333333333333e-02 +227 834 -8.33333333333333e-02 +227 835 -8.33333333333333e-02 +227 979 8.33333333333333e-02 +227 831 4.16666666666667e-02 +227 978 -1.66666666666667e-01 +228 228 5.00000000000000e-01 +228 224 -4.16666666666667e-02 +228 232 4.16666666666667e-02 +228 625 -4.16666666666667e-02 +228 17 4.16666666666667e-02 +228 233 -8.33333333333333e-02 +228 16 4.16666666666667e-02 +228 229 -8.33333333333333e-02 +228 223 8.33333333333333e-02 +228 15 -1.25000000000000e-01 +228 222 -1.25000000000000e-01 +228 230 -8.33333333333333e-02 +228 98 4.16666666666667e-02 +228 626 8.33333333333333e-02 +228 97 4.16666666666667e-02 +228 505 -8.33333333333333e-02 +228 506 4.16666666666667e-02 +228 96 -1.25000000000000e-01 +228 624 -1.25000000000000e-01 +229 229 5.83333333333333e-01 +229 224 8.33333333333333e-02 +229 626 8.33333333333333e-02 +229 231 4.16666666666667e-02 +229 624 -4.16666666666667e-02 +229 17 -4.16666666666667e-02 +229 233 4.16666666666667e-02 +229 16 -4.16666666666667e-02 +229 223 -3.75000000000000e-01 +229 15 4.16666666666667e-02 +229 228 -8.33333333333333e-02 +229 222 8.33333333333333e-02 +229 98 -4.16666666666667e-02 +229 506 4.16666666666667e-02 +229 230 -1.66666666666667e-01 +229 97 -4.16666666666667e-02 +229 625 -1.25000000000000e-01 +229 96 4.16666666666667e-02 +229 504 -8.33333333333333e-02 +230 230 5.83333333333333e-01 +230 222 -4.16666666666667e-02 +230 229 -1.66666666666667e-01 +230 223 8.33333333333333e-02 +230 625 8.33333333333333e-02 +230 17 -4.16666666666667e-02 +230 224 -1.25000000000000e-01 +230 16 -4.16666666666667e-02 +230 232 4.16666666666667e-02 +230 15 4.16666666666667e-02 +230 231 -8.33333333333333e-02 +230 504 4.16666666666667e-02 +230 98 -4.16666666666667e-02 +230 626 -3.75000000000000e-01 +230 97 -4.16666666666667e-02 +230 505 4.16666666666667e-02 +230 228 -8.33333333333333e-02 +230 96 4.16666666666667e-02 +230 624 8.33333333333333e-02 +231 231 1.25000000000000e+00 +231 590 -8.33333333333333e-02 +231 232 -1.66666666666667e-01 +231 589 1.66666666666667e-01 +231 107 8.33333333333333e-02 +231 106 -4.16666666666667e-02 +231 105 -1.25000000000000e-01 +231 588 -2.50000000000000e-01 +231 233 -1.66666666666667e-01 +231 17 8.33333333333333e-02 +231 16 -4.16666666666667e-02 +231 226 8.33333333333333e-02 +231 227 8.33333333333333e-02 +231 15 -1.25000000000000e-01 +231 230 -8.33333333333333e-02 +231 626 8.33333333333333e-02 +231 625 8.33333333333333e-02 +231 624 -3.75000000000000e-01 +231 223 -8.33333333333333e-02 +231 224 -8.33333333333333e-02 +231 512 8.33333333333333e-02 +231 511 -1.66666666666667e-01 +231 229 4.16666666666667e-02 +231 835 8.33333333333333e-02 +231 1211 -8.33333333333333e-02 +231 1210 4.16666666666667e-02 +231 836 8.33333333333333e-02 +231 834 -3.75000000000000e-01 +232 232 1.25000000000000e+00 +232 231 -1.66666666666667e-01 +232 588 1.66666666666667e-01 +232 107 8.33333333333333e-02 +232 233 -1.66666666666667e-01 +232 590 1.66666666666667e-01 +232 106 -1.25000000000000e-01 +232 589 -7.50000000000000e-01 +232 105 -4.16666666666667e-02 +232 17 8.33333333333333e-02 +232 227 -1.66666666666667e-01 +232 16 -1.25000000000000e-01 +232 15 -4.16666666666667e-02 +232 225 8.33333333333333e-02 +232 230 4.16666666666667e-02 +232 626 -4.16666666666667e-02 +232 625 -1.25000000000000e-01 +232 624 8.33333333333333e-02 +232 222 -8.33333333333333e-02 +232 224 -8.33333333333333e-02 +232 512 8.33333333333333e-02 +232 228 4.16666666666667e-02 +232 510 -1.66666666666667e-01 +232 1211 4.16666666666667e-02 +232 834 8.33333333333333e-02 +232 1209 4.16666666666667e-02 +232 836 -4.16666666666667e-02 +232 835 -1.25000000000000e-01 +233 233 1.25000000000000e+00 +233 225 8.33333333333333e-02 +233 588 -8.33333333333333e-02 +233 107 -3.75000000000000e-01 +233 590 -2.50000000000000e-01 +233 106 8.33333333333333e-02 +233 232 -1.66666666666667e-01 +233 589 1.66666666666667e-01 +233 105 8.33333333333333e-02 +233 17 -3.75000000000000e-01 +233 16 8.33333333333333e-02 +233 226 -1.66666666666667e-01 +233 231 -1.66666666666667e-01 +233 15 8.33333333333333e-02 +233 228 -8.33333333333333e-02 +233 626 -1.25000000000000e-01 +233 625 -4.16666666666667e-02 +233 624 8.33333333333333e-02 +233 223 -8.33333333333333e-02 +233 511 8.33333333333333e-02 +233 222 -8.33333333333333e-02 +233 229 4.16666666666667e-02 +233 510 8.33333333333333e-02 +233 1210 4.16666666666667e-02 +233 1209 -8.33333333333333e-02 +233 835 -4.16666666666667e-02 +233 836 -1.25000000000000e-01 +233 834 8.33333333333333e-02 +234 234 2.98333333333333e+01 +234 401 -2.12500000000000e+00 +234 235 -8.33333333333333e+00 +234 400 4.25000000000000e+00 +234 47 2.12500000000000e+00 +234 46 -2.08333333333333e+00 +234 45 -2.16666666666667e+00 +234 399 -6.37500000000000e+00 +234 236 -4.25000000000000e+00 +234 20 2.12500000000000e+00 +234 19 -2.08333333333333e+00 +234 241 2.12500000000000e+00 +234 242 2.12500000000000e+00 +234 18 -2.16666666666667e+00 +234 404 8.33333333333333e-02 +234 245 -8.33333333333333e-02 +234 238 4.16666666666667e-02 +234 244 -8.33333333333333e-02 +234 239 -8.33333333333333e-02 +234 398 8.33333333333333e-02 +234 397 8.33333333333333e-02 +234 403 -1.66666666666667e-01 +234 396 -3.75000000000000e-01 +234 1498 4.16666666666667e+00 +234 1754 -4.16666666666667e+00 +234 1753 2.08333333333333e+00 +234 1499 4.16666666666667e+00 +234 1497 -1.87500000000000e+01 +235 235 2.98333333333333e+01 +235 234 -8.33333333333333e+00 +235 399 4.25000000000000e+00 +235 47 2.12500000000000e+00 +235 236 -4.25000000000000e+00 +235 401 4.25000000000000e+00 +235 46 -2.16666666666667e+00 +235 400 -1.91250000000000e+01 +235 45 -2.08333333333333e+00 +235 20 2.12500000000000e+00 +235 242 -4.25000000000000e+00 +235 19 -2.16666666666667e+00 +235 18 -2.08333333333333e+00 +235 240 2.12500000000000e+00 +235 237 4.16666666666667e-02 +235 243 -8.33333333333333e-02 +235 239 4.16666666666667e-02 +235 245 -8.33333333333333e-02 +235 398 -4.16666666666667e-02 +235 404 8.33333333333333e-02 +235 397 -1.25000000000000e-01 +235 396 8.33333333333333e-02 +235 402 -1.66666666666667e-01 +235 1499 -2.08333333333333e+00 +235 1497 4.16666666666667e+00 +235 1752 2.08333333333333e+00 +235 1754 2.08333333333333e+00 +235 1498 -6.25000000000000e+00 +236 236 2.57500000000000e+01 +236 399 -2.12500000000000e+00 +236 47 -6.50000000000000e+00 +236 401 -6.37500000000000e+00 +236 46 2.12500000000000e+00 +236 235 -4.25000000000000e+00 +236 400 4.25000000000000e+00 +236 45 2.12500000000000e+00 +236 240 2.12500000000000e+00 +236 20 -6.50000000000000e+00 +236 19 2.12500000000000e+00 +236 241 -4.25000000000000e+00 +236 234 -4.25000000000000e+00 +236 18 2.12500000000000e+00 +236 402 8.33333333333333e-02 +236 243 -8.33333333333333e-02 +236 238 4.16666666666667e-02 +236 244 -8.33333333333333e-02 +236 237 -8.33333333333333e-02 +236 398 -1.25000000000000e-01 +236 397 -4.16666666666667e-02 +236 403 8.33333333333333e-02 +236 396 8.33333333333333e-02 +236 1753 2.08333333333333e+00 +236 1498 -2.08333333333333e+00 +236 1752 -4.16666666666667e+00 +236 1499 -6.25000000000000e+00 +236 1497 4.16666666666667e+00 +237 237 5.00000000000000e-01 +237 235 4.16666666666667e-02 +237 641 4.16666666666667e-02 +237 245 -4.16666666666667e-02 +237 20 4.16666666666667e-02 +237 236 -8.33333333333333e-02 +237 19 4.16666666666667e-02 +237 238 -8.33333333333333e-02 +237 244 8.33333333333333e-02 +237 18 -1.25000000000000e-01 +237 243 -1.25000000000000e-01 +237 239 -8.33333333333333e-02 +237 110 4.16666666666667e-02 +237 398 8.33333333333333e-02 +237 109 4.16666666666667e-02 +237 640 -8.33333333333333e-02 +237 397 -4.16666666666667e-02 +237 108 -1.25000000000000e-01 +237 396 -1.25000000000000e-01 +238 238 5.83333333333333e-01 +238 234 4.16666666666667e-02 +238 398 8.33333333333333e-02 +238 239 -1.66666666666667e-01 +238 245 8.33333333333333e-02 +238 20 -4.16666666666667e-02 +238 236 4.16666666666667e-02 +238 19 -4.16666666666667e-02 +238 244 -3.75000000000000e-01 +238 18 4.16666666666667e-02 +238 237 -8.33333333333333e-02 +238 243 8.33333333333333e-02 +238 110 -4.16666666666667e-02 +238 641 4.16666666666667e-02 +238 396 -4.16666666666667e-02 +238 109 -4.16666666666667e-02 +238 397 -1.25000000000000e-01 +238 108 4.16666666666667e-02 +238 639 -8.33333333333333e-02 +239 239 5.83333333333333e-01 +239 238 -1.66666666666667e-01 +239 244 8.33333333333333e-02 +239 639 4.16666666666667e-02 +239 243 -4.16666666666667e-02 +239 20 -4.16666666666667e-02 +239 245 -1.25000000000000e-01 +239 19 -4.16666666666667e-02 +239 235 4.16666666666667e-02 +239 18 4.16666666666667e-02 +239 234 -8.33333333333333e-02 +239 397 8.33333333333333e-02 +239 110 -4.16666666666667e-02 +239 398 -3.75000000000000e-01 +239 109 -4.16666666666667e-02 +239 640 4.16666666666667e-02 +239 237 -8.33333333333333e-02 +239 108 4.16666666666667e-02 +239 396 8.33333333333333e-02 +240 240 3.39166666666667e+01 +240 235 2.12500000000000e+00 +240 401 4.25000000000000e+00 +240 400 -2.12500000000000e+00 +240 399 -6.37500000000000e+00 +240 19 2.12500000000000e+00 +240 18 -4.20833333333333e+00 +240 241 -4.25000000000000e+00 +240 112 2.12500000000000e+00 +240 236 2.12500000000000e+00 +240 111 -4.20833333333333e+00 +240 242 -1.66666666666667e-01 +240 245 8.33333333333333e-02 +240 113 -4.16666666666667e-02 +240 647 4.16666666666667e-02 +240 646 -8.33333333333333e-02 +240 20 -4.16666666666667e-02 +240 244 8.33333333333333e-02 +240 243 -3.75000000000000e-01 +240 1499 -4.16666666666667e+00 +240 1502 2.08333333333333e+00 +240 1498 -4.16666666666667e+00 +240 1765 4.16666666666667e+00 +240 1501 -4.16666666666667e+00 +240 1862 4.16666666666667e+00 +240 1766 -8.33333333333333e+00 +240 1861 4.16666666666667e+00 +240 1860 -1.87500000000000e+01 +241 241 3.80000000000000e+01 +241 20 2.12500000000000e+00 +241 234 2.12500000000000e+00 +241 401 4.25000000000000e+00 +241 242 -4.25000000000000e+00 +241 113 2.12500000000000e+00 +241 400 -6.37500000000000e+00 +241 399 -2.12500000000000e+00 +241 19 -1.26250000000000e+01 +241 18 2.12500000000000e+00 +241 236 -4.25000000000000e+00 +241 112 -1.26250000000000e+01 +241 240 -4.25000000000000e+00 +241 111 2.12500000000000e+00 +241 647 4.16666666666667e-02 +241 245 -4.16666666666667e-02 +241 645 -8.33333333333333e-02 +241 244 -1.25000000000000e-01 +241 243 8.33333333333333e-02 +241 1497 -4.16666666666667e+00 +241 1764 4.16666666666667e+00 +241 1502 2.08333333333333e+00 +241 1499 -4.16666666666667e+00 +241 1500 -4.16666666666667e+00 +241 1862 -2.08333333333333e+00 +241 1766 4.16666666666667e+00 +241 1861 -6.25000000000000e+00 +241 1860 4.16666666666667e+00 +242 242 3.39166666666667e+01 +242 235 -4.25000000000000e+00 +242 19 2.12500000000000e+00 +242 401 -1.91250000000000e+01 +242 400 4.25000000000000e+00 +242 241 -4.25000000000000e+00 +242 112 2.12500000000000e+00 +242 399 4.25000000000000e+00 +242 20 -4.20833333333333e+00 +242 234 2.12500000000000e+00 +242 113 -4.20833333333333e+00 +242 244 -4.16666666666667e-02 +242 240 -1.66666666666667e-01 +242 243 8.33333333333333e-02 +242 111 -4.16666666666667e-02 +242 645 4.16666666666667e-02 +242 646 4.16666666666667e-02 +242 245 -1.25000000000000e-01 +242 18 -4.16666666666667e-02 +242 1497 -4.16666666666667e+00 +242 1500 2.08333333333333e+00 +242 1501 2.08333333333333e+00 +242 1498 -4.16666666666667e+00 +242 1862 -6.25000000000000e+00 +242 1861 -2.08333333333333e+00 +242 1765 4.16666666666667e+00 +242 1860 4.16666666666667e+00 +242 1764 -8.33333333333333e+00 +243 243 1.25000000000000e+00 +243 401 -1.66666666666667e-01 +243 400 8.33333333333333e-02 +243 20 4.16666666666667e-02 +243 241 8.33333333333333e-02 +243 240 -3.75000000000000e-01 +243 647 -4.16666666666667e-02 +243 116 4.16666666666667e-02 +243 646 8.33333333333333e-02 +243 645 -1.25000000000000e-01 +243 236 -8.33333333333333e-02 +243 235 -8.33333333333333e-02 +243 398 8.33333333333333e-02 +243 239 -4.16666666666667e-02 +243 244 -1.66666666666667e-01 +243 397 8.33333333333333e-02 +243 403 -8.33333333333333e-02 +243 19 -8.33333333333333e-02 +243 238 8.33333333333333e-02 +243 237 -1.25000000000000e-01 +243 245 -1.66666666666667e-01 +243 641 8.33333333333333e-02 +243 404 1.66666666666667e-01 +243 640 8.33333333333333e-02 +243 115 -8.33333333333333e-02 +243 242 8.33333333333333e-02 +243 639 -3.75000000000000e-01 +243 402 -2.50000000000000e-01 +244 244 1.25000000000000e+00 +244 401 8.33333333333333e-02 +244 399 8.33333333333333e-02 +244 241 -1.25000000000000e-01 +244 240 8.33333333333333e-02 +244 647 8.33333333333333e-02 +244 245 -1.66666666666667e-01 +244 646 -3.75000000000000e-01 +244 645 8.33333333333333e-02 +244 234 -8.33333333333333e-02 +244 239 8.33333333333333e-02 +244 243 -1.66666666666667e-01 +244 398 -1.66666666666667e-01 +244 404 1.66666666666667e-01 +244 396 8.33333333333333e-02 +244 402 -8.33333333333333e-02 +244 20 4.16666666666667e-02 +244 236 -8.33333333333333e-02 +244 238 -3.75000000000000e-01 +244 18 -8.33333333333333e-02 +244 237 8.33333333333333e-02 +244 641 -4.16666666666667e-02 +244 116 4.16666666666667e-02 +244 242 -4.16666666666667e-02 +244 640 -1.25000000000000e-01 +244 403 -2.50000000000000e-01 +244 639 8.33333333333333e-02 +244 114 -8.33333333333333e-02 +245 245 1.25000000000000e+00 +245 400 8.33333333333333e-02 +245 240 8.33333333333333e-02 +245 399 -1.66666666666667e-01 +245 242 -1.25000000000000e-01 +245 18 4.16666666666667e-02 +245 647 -1.25000000000000e-01 +245 646 8.33333333333333e-02 +245 244 -1.66666666666667e-01 +245 645 -4.16666666666667e-02 +245 114 4.16666666666667e-02 +245 234 -8.33333333333333e-02 +245 238 8.33333333333333e-02 +245 396 8.33333333333333e-02 +245 237 -4.16666666666667e-02 +245 397 -1.66666666666667e-01 +245 403 1.66666666666667e-01 +245 239 -1.25000000000000e-01 +245 19 4.16666666666667e-02 +245 235 -8.33333333333333e-02 +245 241 -4.16666666666667e-02 +245 641 -1.25000000000000e-01 +245 404 -7.50000000000000e-01 +245 640 -4.16666666666667e-02 +245 115 4.16666666666667e-02 +245 243 -1.66666666666667e-01 +245 639 8.33333333333333e-02 +245 402 1.66666666666667e-01 +246 246 1.25000000000000e+00 +246 527 8.33333333333333e-02 +246 526 -1.66666666666667e-01 +246 251 8.33333333333333e-02 +246 22 4.16666666666667e-02 +246 249 -3.75000000000000e-01 +246 410 8.33333333333333e-02 +246 409 -4.16666666666667e-02 +246 49 4.16666666666667e-02 +246 408 -1.25000000000000e-01 +246 422 -8.33333333333333e-02 +246 248 -1.66666666666667e-01 +246 253 -4.16666666666667e-02 +246 260 -8.33333333333333e-02 +246 644 8.33333333333333e-02 +246 259 -8.33333333333333e-02 +246 643 8.33333333333333e-02 +246 254 8.33333333333333e-02 +246 23 -8.33333333333333e-02 +246 252 -1.25000000000000e-01 +246 416 8.33333333333333e-02 +246 50 -8.33333333333333e-02 +246 415 8.33333333333333e-02 +246 247 -1.66666666666667e-01 +246 421 1.66666666666667e-01 +246 414 -3.75000000000000e-01 +246 250 8.33333333333333e-02 +246 420 -2.50000000000000e-01 +247 247 1.25000000000000e+00 +247 527 8.33333333333333e-02 +247 249 8.33333333333333e-02 +247 525 -1.66666666666667e-01 +247 250 -1.25000000000000e-01 +247 21 4.16666666666667e-02 +247 410 8.33333333333333e-02 +247 248 -1.66666666666667e-01 +247 409 -1.25000000000000e-01 +247 408 -4.16666666666667e-02 +247 48 4.16666666666667e-02 +247 252 -4.16666666666667e-02 +247 254 8.33333333333333e-02 +247 422 1.66666666666667e-01 +247 644 -1.66666666666667e-01 +247 258 -8.33333333333333e-02 +247 642 8.33333333333333e-02 +247 23 4.16666666666667e-02 +247 260 -8.33333333333333e-02 +247 253 -1.25000000000000e-01 +247 416 -4.16666666666667e-02 +247 50 4.16666666666667e-02 +247 415 -1.25000000000000e-01 +247 251 -4.16666666666667e-02 +247 421 -7.50000000000000e-01 +247 414 8.33333333333333e-02 +247 246 -1.66666666666667e-01 +247 420 1.66666666666667e-01 +248 248 1.25000000000000e+00 +248 526 8.33333333333333e-02 +248 525 8.33333333333333e-02 +248 251 -1.25000000000000e-01 +248 249 8.33333333333333e-02 +248 410 -3.75000000000000e-01 +248 409 8.33333333333333e-02 +248 247 -1.66666666666667e-01 +248 408 8.33333333333333e-02 +248 420 -8.33333333333333e-02 +248 246 -1.66666666666667e-01 +248 253 8.33333333333333e-02 +248 258 -8.33333333333333e-02 +248 642 8.33333333333333e-02 +248 421 1.66666666666667e-01 +248 643 -1.66666666666667e-01 +248 254 -3.75000000000000e-01 +248 22 4.16666666666667e-02 +248 259 -8.33333333333333e-02 +248 252 8.33333333333333e-02 +248 21 -8.33333333333333e-02 +248 416 -1.25000000000000e-01 +248 250 -4.16666666666667e-02 +248 422 -2.50000000000000e-01 +248 415 -4.16666666666667e-02 +248 49 4.16666666666667e-02 +248 414 8.33333333333333e-02 +248 48 -8.33333333333333e-02 +249 249 1.25000000000000e+00 +249 263 -8.33333333333333e-02 +249 256 4.16666666666667e-02 +249 262 -8.33333333333333e-02 +249 257 -8.33333333333333e-02 +249 524 8.33333333333333e-02 +249 523 8.33333333333333e-02 +249 529 -1.66666666666667e-01 +249 522 -3.75000000000000e-01 +249 260 8.33333333333333e-02 +249 527 -8.33333333333333e-02 +249 250 -1.66666666666667e-01 +249 526 1.66666666666667e-01 +249 247 8.33333333333333e-02 +249 68 8.33333333333333e-02 +249 410 -8.33333333333333e-02 +249 67 -4.16666666666667e-02 +249 409 4.16666666666667e-02 +249 66 -1.25000000000000e-01 +249 525 -2.50000000000000e-01 +249 251 -1.66666666666667e-01 +249 23 8.33333333333333e-02 +249 248 8.33333333333333e-02 +249 22 -4.16666666666667e-02 +249 259 8.33333333333333e-02 +249 530 8.33333333333333e-02 +249 21 -1.25000000000000e-01 +249 246 -3.75000000000000e-01 +250 250 1.25000000000000e+00 +250 261 -8.33333333333333e-02 +250 257 4.16666666666667e-02 +250 263 -8.33333333333333e-02 +250 524 -4.16666666666667e-02 +250 530 8.33333333333333e-02 +250 523 -1.25000000000000e-01 +250 522 8.33333333333333e-02 +250 528 -1.66666666666667e-01 +250 410 4.16666666666667e-02 +250 248 -4.16666666666667e-02 +250 249 -1.66666666666667e-01 +250 525 1.66666666666667e-01 +250 246 8.33333333333333e-02 +250 68 8.33333333333333e-02 +250 251 -1.66666666666667e-01 +250 527 1.66666666666667e-01 +250 67 -1.25000000000000e-01 +250 526 -7.50000000000000e-01 +250 66 -4.16666666666667e-02 +250 408 4.16666666666667e-02 +250 23 8.33333333333333e-02 +250 260 -1.66666666666667e-01 +250 255 4.16666666666667e-02 +250 22 -1.25000000000000e-01 +250 247 -1.25000000000000e-01 +250 21 -4.16666666666667e-02 +250 258 8.33333333333333e-02 +251 251 1.25000000000000e+00 +251 261 -8.33333333333333e-02 +251 256 4.16666666666667e-02 +251 262 -8.33333333333333e-02 +251 255 -8.33333333333333e-02 +251 524 -1.25000000000000e-01 +251 523 -4.16666666666667e-02 +251 529 8.33333333333333e-02 +251 522 8.33333333333333e-02 +251 258 8.33333333333333e-02 +251 525 -8.33333333333333e-02 +251 409 4.16666666666667e-02 +251 247 -4.16666666666667e-02 +251 68 -3.75000000000000e-01 +251 527 -2.50000000000000e-01 +251 67 8.33333333333333e-02 +251 250 -1.66666666666667e-01 +251 526 1.66666666666667e-01 +251 66 8.33333333333333e-02 +251 408 -8.33333333333333e-02 +251 528 8.33333333333333e-02 +251 23 -3.75000000000000e-01 +251 248 -1.25000000000000e-01 +251 22 8.33333333333333e-02 +251 259 -1.66666666666667e-01 +251 249 -1.66666666666667e-01 +251 21 8.33333333333333e-02 +251 246 8.33333333333333e-02 +252 252 5.00000000000000e-01 +252 415 4.16666666666667e-02 +252 260 4.16666666666667e-02 +252 644 -4.16666666666667e-02 +252 110 4.16666666666667e-02 +252 416 -8.33333333333333e-02 +252 109 4.16666666666667e-02 +252 253 -8.33333333333333e-02 +252 643 8.33333333333333e-02 +252 108 -1.25000000000000e-01 +252 642 -1.25000000000000e-01 +252 254 -8.33333333333333e-02 +252 23 4.16666666666667e-02 +252 248 8.33333333333333e-02 +252 22 4.16666666666667e-02 +252 259 -8.33333333333333e-02 +252 247 -4.16666666666667e-02 +252 21 -1.25000000000000e-01 +252 246 -1.25000000000000e-01 +253 253 5.83333333333333e-01 +253 414 4.16666666666667e-02 +253 248 8.33333333333333e-02 +253 254 -1.66666666666667e-01 +253 644 8.33333333333333e-02 +253 110 -4.16666666666667e-02 +253 416 4.16666666666667e-02 +253 109 -4.16666666666667e-02 +253 643 -3.75000000000000e-01 +253 108 4.16666666666667e-02 +253 252 -8.33333333333333e-02 +253 642 8.33333333333333e-02 +253 23 -4.16666666666667e-02 +253 260 4.16666666666667e-02 +253 246 -4.16666666666667e-02 +253 22 -4.16666666666667e-02 +253 247 -1.25000000000000e-01 +253 21 4.16666666666667e-02 +253 258 -8.33333333333333e-02 +254 254 5.83333333333333e-01 +254 253 -1.66666666666667e-01 +254 643 8.33333333333333e-02 +254 258 4.16666666666667e-02 +254 642 -4.16666666666667e-02 +254 110 -4.16666666666667e-02 +254 644 -1.25000000000000e-01 +254 109 -4.16666666666667e-02 +254 415 4.16666666666667e-02 +254 108 4.16666666666667e-02 +254 414 -8.33333333333333e-02 +254 247 8.33333333333333e-02 +254 23 -4.16666666666667e-02 +254 248 -3.75000000000000e-01 +254 22 -4.16666666666667e-02 +254 259 4.16666666666667e-02 +254 252 -8.33333333333333e-02 +254 21 4.16666666666667e-02 +254 246 8.33333333333333e-02 +255 255 5.00000000000000e-01 +255 250 4.16666666666667e-02 +255 659 4.16666666666667e-02 +255 263 -4.16666666666667e-02 +255 23 4.16666666666667e-02 +255 251 -8.33333333333333e-02 +255 22 4.16666666666667e-02 +255 256 -8.33333333333333e-02 +255 262 8.33333333333333e-02 +255 21 -1.25000000000000e-01 +255 261 -1.25000000000000e-01 +255 257 -8.33333333333333e-02 +255 119 4.16666666666667e-02 +255 524 8.33333333333333e-02 +255 118 4.16666666666667e-02 +255 658 -8.33333333333333e-02 +255 523 -4.16666666666667e-02 +255 117 -1.25000000000000e-01 +255 522 -1.25000000000000e-01 +256 256 5.83333333333333e-01 +256 249 4.16666666666667e-02 +256 524 8.33333333333333e-02 +256 257 -1.66666666666667e-01 +256 263 8.33333333333333e-02 +256 23 -4.16666666666667e-02 +256 251 4.16666666666667e-02 +256 22 -4.16666666666667e-02 +256 262 -3.75000000000000e-01 +256 21 4.16666666666667e-02 +256 255 -8.33333333333333e-02 +256 261 8.33333333333333e-02 +256 119 -4.16666666666667e-02 +256 659 4.16666666666667e-02 +256 522 -4.16666666666667e-02 +256 118 -4.16666666666667e-02 +256 523 -1.25000000000000e-01 +256 117 4.16666666666667e-02 +256 657 -8.33333333333333e-02 +257 257 5.83333333333333e-01 +257 256 -1.66666666666667e-01 +257 262 8.33333333333333e-02 +257 657 4.16666666666667e-02 +257 261 -4.16666666666667e-02 +257 23 -4.16666666666667e-02 +257 263 -1.25000000000000e-01 +257 22 -4.16666666666667e-02 +257 250 4.16666666666667e-02 +257 21 4.16666666666667e-02 +257 249 -8.33333333333333e-02 +257 523 8.33333333333333e-02 +257 119 -4.16666666666667e-02 +257 524 -3.75000000000000e-01 +257 118 -4.16666666666667e-02 +257 658 4.16666666666667e-02 +257 255 -8.33333333333333e-02 +257 117 4.16666666666667e-02 +257 522 8.33333333333333e-02 +258 258 1.25000000000000e+00 +258 263 8.33333333333333e-02 +258 122 -4.16666666666667e-02 +258 665 4.16666666666667e-02 +258 664 -8.33333333333333e-02 +258 23 -4.16666666666667e-02 +258 262 8.33333333333333e-02 +258 261 -3.75000000000000e-01 +258 251 8.33333333333333e-02 +258 250 8.33333333333333e-02 +258 527 1.66666666666667e-01 +258 526 -8.33333333333333e-02 +258 525 -2.50000000000000e-01 +258 248 -8.33333333333333e-02 +258 254 4.16666666666667e-02 +258 247 -8.33333333333333e-02 +258 421 8.33333333333333e-02 +258 253 -8.33333333333333e-02 +258 22 8.33333333333333e-02 +258 21 -1.25000000000000e-01 +258 644 8.33333333333333e-02 +258 422 -1.66666666666667e-01 +258 643 8.33333333333333e-02 +258 259 -1.66666666666667e-01 +258 121 8.33333333333333e-02 +258 642 -3.75000000000000e-01 +258 260 -1.66666666666667e-01 +258 120 -1.25000000000000e-01 +259 259 1.25000000000000e+00 +259 263 -4.16666666666667e-02 +259 663 -8.33333333333333e-02 +259 262 -1.25000000000000e-01 +259 261 8.33333333333333e-02 +259 251 -1.66666666666667e-01 +259 23 8.33333333333333e-02 +259 249 8.33333333333333e-02 +259 527 1.66666666666667e-01 +259 260 -1.66666666666667e-01 +259 122 8.33333333333333e-02 +259 526 -2.50000000000000e-01 +259 525 -8.33333333333333e-02 +259 246 -8.33333333333333e-02 +259 420 8.33333333333333e-02 +259 254 4.16666666666667e-02 +259 248 -8.33333333333333e-02 +259 22 -3.75000000000000e-01 +259 252 -8.33333333333333e-02 +259 21 8.33333333333333e-02 +259 644 -4.16666666666667e-02 +259 422 8.33333333333333e-02 +259 643 -1.25000000000000e-01 +259 665 4.16666666666667e-02 +259 121 -3.75000000000000e-01 +259 642 8.33333333333333e-02 +259 258 -1.66666666666667e-01 +259 120 8.33333333333333e-02 +260 260 1.25000000000000e+00 +260 262 -4.16666666666667e-02 +260 258 -1.66666666666667e-01 +260 261 8.33333333333333e-02 +260 120 -4.16666666666667e-02 +260 663 4.16666666666667e-02 +260 263 -1.25000000000000e-01 +260 21 -4.16666666666667e-02 +260 249 8.33333333333333e-02 +260 250 -1.66666666666667e-01 +260 22 8.33333333333333e-02 +260 527 -7.50000000000000e-01 +260 526 1.66666666666667e-01 +260 259 -1.66666666666667e-01 +260 121 8.33333333333333e-02 +260 525 1.66666666666667e-01 +260 246 -8.33333333333333e-02 +260 252 4.16666666666667e-02 +260 23 -1.25000000000000e-01 +260 253 4.16666666666667e-02 +260 247 -8.33333333333333e-02 +260 644 -1.25000000000000e-01 +260 664 4.16666666666667e-02 +260 122 -1.25000000000000e-01 +260 643 -4.16666666666667e-02 +260 421 8.33333333333333e-02 +260 642 8.33333333333333e-02 +260 420 -1.66666666666667e-01 +261 261 1.25000000000000e+00 +261 527 -1.66666666666667e-01 +261 526 8.33333333333333e-02 +261 23 4.16666666666667e-02 +261 259 8.33333333333333e-02 +261 258 -3.75000000000000e-01 +261 665 -4.16666666666667e-02 +261 125 4.16666666666667e-02 +261 664 8.33333333333333e-02 +261 663 -1.25000000000000e-01 +261 251 -8.33333333333333e-02 +261 250 -8.33333333333333e-02 +261 524 8.33333333333333e-02 +261 257 -4.16666666666667e-02 +261 262 -1.66666666666667e-01 +261 523 8.33333333333333e-02 +261 529 -8.33333333333333e-02 +261 22 -8.33333333333333e-02 +261 256 8.33333333333333e-02 +261 255 -1.25000000000000e-01 +261 263 -1.66666666666667e-01 +261 659 8.33333333333333e-02 +261 530 1.66666666666667e-01 +261 658 8.33333333333333e-02 +261 124 -8.33333333333333e-02 +261 260 8.33333333333333e-02 +261 657 -3.75000000000000e-01 +261 528 -2.50000000000000e-01 +262 262 1.25000000000000e+00 +262 527 8.33333333333333e-02 +262 525 8.33333333333333e-02 +262 259 -1.25000000000000e-01 +262 258 8.33333333333333e-02 +262 665 8.33333333333333e-02 +262 263 -1.66666666666667e-01 +262 664 -3.75000000000000e-01 +262 663 8.33333333333333e-02 +262 249 -8.33333333333333e-02 +262 257 8.33333333333333e-02 +262 261 -1.66666666666667e-01 +262 524 -1.66666666666667e-01 +262 530 1.66666666666667e-01 +262 522 8.33333333333333e-02 +262 528 -8.33333333333333e-02 +262 23 4.16666666666667e-02 +262 251 -8.33333333333333e-02 +262 256 -3.75000000000000e-01 +262 21 -8.33333333333333e-02 +262 255 8.33333333333333e-02 +262 659 -4.16666666666667e-02 +262 125 4.16666666666667e-02 +262 260 -4.16666666666667e-02 +262 658 -1.25000000000000e-01 +262 529 -2.50000000000000e-01 +262 657 8.33333333333333e-02 +262 123 -8.33333333333333e-02 +263 263 1.25000000000000e+00 +263 526 8.33333333333333e-02 +263 258 8.33333333333333e-02 +263 525 -1.66666666666667e-01 +263 260 -1.25000000000000e-01 +263 21 4.16666666666667e-02 +263 665 -1.25000000000000e-01 +263 664 8.33333333333333e-02 +263 262 -1.66666666666667e-01 +263 663 -4.16666666666667e-02 +263 123 4.16666666666667e-02 +263 249 -8.33333333333333e-02 +263 256 8.33333333333333e-02 +263 522 8.33333333333333e-02 +263 255 -4.16666666666667e-02 +263 523 -1.66666666666667e-01 +263 529 1.66666666666667e-01 +263 257 -1.25000000000000e-01 +263 22 4.16666666666667e-02 +263 250 -8.33333333333333e-02 +263 259 -4.16666666666667e-02 +263 659 -1.25000000000000e-01 +263 530 -7.50000000000000e-01 +263 658 -4.16666666666667e-02 +263 124 4.16666666666667e-02 +263 261 -1.66666666666667e-01 +263 657 8.33333333333333e-02 +263 528 1.66666666666667e-01 +264 264 1.25000000000000e+00 +264 596 8.33333333333333e-02 +264 595 -1.66666666666667e-01 +264 269 8.33333333333333e-02 +264 25 4.16666666666667e-02 +264 267 -3.75000000000000e-01 +264 536 8.33333333333333e-02 +264 535 -4.16666666666667e-02 +264 70 4.16666666666667e-02 +264 534 -1.25000000000000e-01 +264 548 -8.33333333333333e-02 +264 266 -1.66666666666667e-01 +264 271 -4.16666666666667e-02 +264 275 -8.33333333333333e-02 +264 662 8.33333333333333e-02 +264 274 -8.33333333333333e-02 +264 661 8.33333333333333e-02 +264 272 8.33333333333333e-02 +264 26 -8.33333333333333e-02 +264 270 -1.25000000000000e-01 +264 542 8.33333333333333e-02 +264 71 -8.33333333333333e-02 +264 541 8.33333333333333e-02 +264 265 -1.66666666666667e-01 +264 547 1.66666666666667e-01 +264 540 -3.75000000000000e-01 +264 268 8.33333333333333e-02 +264 546 -2.50000000000000e-01 +265 265 1.25000000000000e+00 +265 596 8.33333333333333e-02 +265 267 8.33333333333333e-02 +265 594 -1.66666666666667e-01 +265 268 -1.25000000000000e-01 +265 24 4.16666666666667e-02 +265 536 8.33333333333333e-02 +265 266 -1.66666666666667e-01 +265 535 -1.25000000000000e-01 +265 534 -4.16666666666667e-02 +265 69 4.16666666666667e-02 +265 270 -4.16666666666667e-02 +265 272 8.33333333333333e-02 +265 548 1.66666666666667e-01 +265 662 -1.66666666666667e-01 +265 273 -8.33333333333333e-02 +265 660 8.33333333333333e-02 +265 26 4.16666666666667e-02 +265 275 -8.33333333333333e-02 +265 271 -1.25000000000000e-01 +265 542 -4.16666666666667e-02 +265 71 4.16666666666667e-02 +265 541 -1.25000000000000e-01 +265 269 -4.16666666666667e-02 +265 547 -7.50000000000000e-01 +265 540 8.33333333333333e-02 +265 264 -1.66666666666667e-01 +265 546 1.66666666666667e-01 +266 266 1.25000000000000e+00 +266 595 8.33333333333333e-02 +266 594 8.33333333333333e-02 +266 269 -1.25000000000000e-01 +266 267 8.33333333333333e-02 +266 536 -3.75000000000000e-01 +266 535 8.33333333333333e-02 +266 265 -1.66666666666667e-01 +266 534 8.33333333333333e-02 +266 546 -8.33333333333333e-02 +266 264 -1.66666666666667e-01 +266 271 8.33333333333333e-02 +266 273 -8.33333333333333e-02 +266 660 8.33333333333333e-02 +266 547 1.66666666666667e-01 +266 661 -1.66666666666667e-01 +266 272 -3.75000000000000e-01 +266 25 4.16666666666667e-02 +266 274 -8.33333333333333e-02 +266 270 8.33333333333333e-02 +266 24 -8.33333333333333e-02 +266 542 -1.25000000000000e-01 +266 268 -4.16666666666667e-02 +266 548 -2.50000000000000e-01 +266 541 -4.16666666666667e-02 +266 70 4.16666666666667e-02 +266 540 8.33333333333333e-02 +266 69 -8.33333333333333e-02 +267 267 1.25000000000000e+00 +267 275 8.33333333333333e-02 +267 596 -8.33333333333333e-02 +267 595 1.66666666666667e-01 +267 594 -2.50000000000000e-01 +267 26 8.33333333333333e-02 +267 24 -1.25000000000000e-01 +267 269 -1.66666666666667e-01 +267 83 8.33333333333333e-02 +267 274 8.33333333333333e-02 +267 81 -1.25000000000000e-01 +267 268 -1.66666666666667e-01 +267 265 8.33333333333333e-02 +267 536 -8.33333333333333e-02 +267 82 -4.16666666666667e-02 +267 535 4.16666666666667e-02 +267 266 8.33333333333333e-02 +267 25 -4.16666666666667e-02 +267 264 -3.75000000000000e-01 +267 1010 8.33333333333333e-02 +267 872 -8.33333333333333e-02 +267 868 4.16666666666667e-02 +267 871 -8.33333333333333e-02 +267 869 -8.33333333333333e-02 +267 1007 8.33333333333333e-02 +267 1006 8.33333333333333e-02 +267 1009 -1.66666666666667e-01 +267 1005 -3.75000000000000e-01 +268 268 1.25000000000000e+00 +268 275 -1.66666666666667e-01 +268 26 8.33333333333333e-02 +268 596 1.66666666666667e-01 +268 269 -1.66666666666667e-01 +268 83 8.33333333333333e-02 +268 595 -7.50000000000000e-01 +268 594 1.66666666666667e-01 +268 25 -1.25000000000000e-01 +268 273 8.33333333333333e-02 +268 82 -1.25000000000000e-01 +268 266 -4.16666666666667e-02 +268 267 -1.66666666666667e-01 +268 264 8.33333333333333e-02 +268 81 -4.16666666666667e-02 +268 534 4.16666666666667e-02 +268 536 4.16666666666667e-02 +268 265 -1.25000000000000e-01 +268 24 -4.16666666666667e-02 +268 867 4.16666666666667e-02 +268 870 -8.33333333333333e-02 +268 869 4.16666666666667e-02 +268 872 -8.33333333333333e-02 +268 1007 -4.16666666666667e-02 +268 1010 8.33333333333333e-02 +268 1006 -1.25000000000000e-01 +268 1005 8.33333333333333e-02 +268 1008 -1.66666666666667e-01 +269 269 1.25000000000000e+00 +269 25 8.33333333333333e-02 +269 273 8.33333333333333e-02 +269 596 -2.50000000000000e-01 +269 595 1.66666666666667e-01 +269 268 -1.66666666666667e-01 +269 82 8.33333333333333e-02 +269 594 -8.33333333333333e-02 +269 26 -3.75000000000000e-01 +269 24 8.33333333333333e-02 +269 274 -1.66666666666667e-01 +269 83 -3.75000000000000e-01 +269 267 -1.66666666666667e-01 +269 81 8.33333333333333e-02 +269 535 4.16666666666667e-02 +269 265 -4.16666666666667e-02 +269 534 -8.33333333333333e-02 +269 266 -1.25000000000000e-01 +269 264 8.33333333333333e-02 +269 1008 8.33333333333333e-02 +269 870 -8.33333333333333e-02 +269 868 4.16666666666667e-02 +269 871 -8.33333333333333e-02 +269 867 -8.33333333333333e-02 +269 1007 -1.25000000000000e-01 +269 1006 -4.16666666666667e-02 +269 1009 8.33333333333333e-02 +269 1005 8.33333333333333e-02 +270 270 5.00000000000000e-01 +270 541 4.16666666666667e-02 +270 275 4.16666666666667e-02 +270 662 -4.16666666666667e-02 +270 119 4.16666666666667e-02 +270 542 -8.33333333333333e-02 +270 118 4.16666666666667e-02 +270 271 -8.33333333333333e-02 +270 661 8.33333333333333e-02 +270 117 -1.25000000000000e-01 +270 660 -1.25000000000000e-01 +270 272 -8.33333333333333e-02 +270 26 4.16666666666667e-02 +270 266 8.33333333333333e-02 +270 25 4.16666666666667e-02 +270 274 -8.33333333333333e-02 +270 265 -4.16666666666667e-02 +270 24 -1.25000000000000e-01 +270 264 -1.25000000000000e-01 +271 271 5.83333333333333e-01 +271 540 4.16666666666667e-02 +271 266 8.33333333333333e-02 +271 272 -1.66666666666667e-01 +271 662 8.33333333333333e-02 +271 119 -4.16666666666667e-02 +271 542 4.16666666666667e-02 +271 118 -4.16666666666667e-02 +271 661 -3.75000000000000e-01 +271 117 4.16666666666667e-02 +271 270 -8.33333333333333e-02 +271 660 8.33333333333333e-02 +271 26 -4.16666666666667e-02 +271 275 4.16666666666667e-02 +271 264 -4.16666666666667e-02 +271 25 -4.16666666666667e-02 +271 265 -1.25000000000000e-01 +271 24 4.16666666666667e-02 +271 273 -8.33333333333333e-02 +272 272 5.83333333333333e-01 +272 271 -1.66666666666667e-01 +272 661 8.33333333333333e-02 +272 273 4.16666666666667e-02 +272 660 -4.16666666666667e-02 +272 119 -4.16666666666667e-02 +272 662 -1.25000000000000e-01 +272 118 -4.16666666666667e-02 +272 541 4.16666666666667e-02 +272 117 4.16666666666667e-02 +272 540 -8.33333333333333e-02 +272 265 8.33333333333333e-02 +272 26 -4.16666666666667e-02 +272 266 -3.75000000000000e-01 +272 25 -4.16666666666667e-02 +272 274 4.16666666666667e-02 +272 270 -8.33333333333333e-02 +272 24 4.16666666666667e-02 +272 264 8.33333333333333e-02 +273 273 1.25000000000000e+00 +273 595 -8.33333333333333e-02 +273 275 -1.66666666666667e-01 +273 596 1.66666666666667e-01 +273 128 -4.16666666666667e-02 +273 127 8.33333333333333e-02 +273 126 -1.25000000000000e-01 +273 594 -2.50000000000000e-01 +273 26 -4.16666666666667e-02 +273 269 8.33333333333333e-02 +273 274 -1.66666666666667e-01 +273 25 8.33333333333333e-02 +273 268 8.33333333333333e-02 +273 24 -1.25000000000000e-01 +273 266 -8.33333333333333e-02 +273 272 4.16666666666667e-02 +273 265 -8.33333333333333e-02 +273 547 8.33333333333333e-02 +273 271 -8.33333333333333e-02 +273 662 8.33333333333333e-02 +273 548 -1.66666666666667e-01 +273 661 8.33333333333333e-02 +273 660 -3.75000000000000e-01 +273 872 8.33333333333333e-02 +273 1247 4.16666666666667e-02 +273 1246 -8.33333333333333e-02 +273 871 8.33333333333333e-02 +273 870 -3.75000000000000e-01 +274 274 1.25000000000000e+00 +274 594 -8.33333333333333e-02 +274 128 8.33333333333333e-02 +274 275 -1.66666666666667e-01 +274 596 1.66666666666667e-01 +274 127 -3.75000000000000e-01 +274 595 -2.50000000000000e-01 +274 126 8.33333333333333e-02 +274 26 8.33333333333333e-02 +274 269 -1.66666666666667e-01 +274 267 8.33333333333333e-02 +274 25 -3.75000000000000e-01 +274 273 -1.66666666666667e-01 +274 24 8.33333333333333e-02 +274 264 -8.33333333333333e-02 +274 546 8.33333333333333e-02 +274 272 4.16666666666667e-02 +274 266 -8.33333333333333e-02 +274 270 -8.33333333333333e-02 +274 662 -4.16666666666667e-02 +274 548 8.33333333333333e-02 +274 661 -1.25000000000000e-01 +274 660 8.33333333333333e-02 +274 1247 4.16666666666667e-02 +274 872 -4.16666666666667e-02 +274 1245 -8.33333333333333e-02 +274 871 -1.25000000000000e-01 +274 870 8.33333333333333e-02 +275 275 1.25000000000000e+00 +275 273 -1.66666666666667e-01 +275 594 1.66666666666667e-01 +275 128 -1.25000000000000e-01 +275 596 -7.50000000000000e-01 +275 127 8.33333333333333e-02 +275 274 -1.66666666666667e-01 +275 595 1.66666666666667e-01 +275 126 -4.16666666666667e-02 +275 26 -1.25000000000000e-01 +275 25 8.33333333333333e-02 +275 268 -1.66666666666667e-01 +275 24 -4.16666666666667e-02 +275 267 8.33333333333333e-02 +275 264 -8.33333333333333e-02 +275 270 4.16666666666667e-02 +275 271 4.16666666666667e-02 +275 265 -8.33333333333333e-02 +275 662 -1.25000000000000e-01 +275 661 -4.16666666666667e-02 +275 547 8.33333333333333e-02 +275 660 8.33333333333333e-02 +275 546 -1.66666666666667e-01 +275 871 -4.16666666666667e-02 +275 870 8.33333333333333e-02 +275 1245 4.16666666666667e-02 +275 1246 4.16666666666667e-02 +275 872 -1.25000000000000e-01 +276 276 6.37500000000000e+01 +276 427 -2.12500000000000e+00 +276 53 2.12500000000000e+00 +276 426 -6.37500000000000e+00 +276 281 -2.12500000000000e+00 +276 29 2.12500000000000e+00 +276 277 -8.50000000000000e+00 +276 280 4.25000000000000e+00 +276 279 -6.37500000000000e+00 +276 434 -2.12500000000000e+00 +276 433 4.25000000000000e+00 +276 52 2.12500000000000e+00 +276 432 -6.37500000000000e+00 +276 278 -8.50000000000000e+00 +276 284 4.25000000000000e+00 +276 283 -2.12500000000000e+00 +276 28 2.12500000000000e+00 +276 428 4.25000000000000e+00 +276 282 -6.37500000000000e+00 +276 613 -1.66666666666667e-01 +276 440 1.66666666666667e-01 +276 650 -1.66666666666667e-01 +276 286 -8.33333333333333e-02 +276 649 8.33333333333333e-02 +276 287 -8.33333333333333e-02 +276 439 1.66666666666667e-01 +276 614 8.33333333333333e-02 +276 438 -7.50000000000000e-01 +276 1792 4.16666666666667e+00 +276 1793 -8.33333333333333e+00 +276 1787 -4.16666666666667e+00 +276 1799 4.16666666666667e+00 +276 1540 8.33333333333333e+00 +276 1798 -8.33333333333333e+00 +276 1786 -4.16666666666667e+00 +276 1541 8.33333333333333e+00 +276 1539 -3.75000000000000e+01 +277 277 6.37500000000000e+01 +277 426 -2.12500000000000e+00 +277 428 4.25000000000000e+00 +277 427 -6.37500000000000e+00 +277 281 4.25000000000000e+00 +277 280 -1.91250000000000e+01 +277 276 -8.50000000000000e+00 +277 279 4.25000000000000e+00 +277 278 -8.50000000000000e+00 +277 432 4.25000000000000e+00 +277 53 -4.25000000000000e+00 +277 434 4.25000000000000e+00 +277 433 -1.91250000000000e+01 +277 51 2.12500000000000e+00 +277 284 4.25000000000000e+00 +277 29 -4.25000000000000e+00 +277 283 -6.37500000000000e+00 +277 282 -2.12500000000000e+00 +277 27 2.12500000000000e+00 +277 614 8.33333333333333e-02 +277 612 -1.66666666666667e-01 +277 440 -8.33333333333333e-02 +277 287 -8.33333333333333e-02 +277 650 8.33333333333333e-02 +277 285 -8.33333333333333e-02 +277 648 8.33333333333333e-02 +277 439 -2.50000000000000e-01 +277 438 1.66666666666667e-01 +277 1793 4.16666666666667e+00 +277 1541 -4.16666666666667e+00 +277 1787 -4.16666666666667e+00 +277 1799 4.16666666666667e+00 +277 1539 8.33333333333333e+00 +277 1797 -8.33333333333333e+00 +277 1785 -4.16666666666667e+00 +277 1791 4.16666666666667e+00 +277 1540 -1.25000000000000e+01 +278 278 6.37500000000000e+01 +278 428 -1.91250000000000e+01 +278 427 4.25000000000000e+00 +278 51 2.12500000000000e+00 +278 281 -6.37500000000000e+00 +278 280 4.25000000000000e+00 +278 279 -2.12500000000000e+00 +278 27 2.12500000000000e+00 +278 277 -8.50000000000000e+00 +278 432 -2.12500000000000e+00 +278 434 -6.37500000000000e+00 +278 52 -4.25000000000000e+00 +278 433 4.25000000000000e+00 +278 426 4.25000000000000e+00 +278 284 -1.91250000000000e+01 +278 283 4.25000000000000e+00 +278 28 -4.25000000000000e+00 +278 276 -8.50000000000000e+00 +278 282 4.25000000000000e+00 +278 613 8.33333333333333e-02 +278 439 -8.33333333333333e-02 +278 286 -8.33333333333333e-02 +278 649 8.33333333333333e-02 +278 438 1.66666666666667e-01 +278 648 -1.66666666666667e-01 +278 285 -8.33333333333333e-02 +278 612 8.33333333333333e-02 +278 440 -2.50000000000000e-01 +278 1792 4.16666666666667e+00 +278 1791 -8.33333333333333e+00 +278 1540 -4.16666666666667e+00 +278 1786 -4.16666666666667e+00 +278 1798 4.16666666666667e+00 +278 1785 -4.16666666666667e+00 +278 1797 4.16666666666667e+00 +278 1541 -1.25000000000000e+01 +278 1539 8.33333333333333e+00 +279 279 3.39166666666667e+01 +279 92 2.12500000000000e+00 +279 281 -4.25000000000000e+00 +279 29 2.12500000000000e+00 +279 427 2.12500000000000e+00 +279 428 2.12500000000000e+00 +279 90 -4.20833333333333e+00 +279 278 -2.12500000000000e+00 +279 277 4.25000000000000e+00 +279 276 -6.37500000000000e+00 +279 27 -4.20833333333333e+00 +279 613 8.33333333333333e-02 +279 280 -1.66666666666667e-01 +279 287 -8.33333333333333e-02 +279 28 -4.16666666666667e-02 +279 286 4.16666666666667e-02 +279 614 8.33333333333333e-02 +279 91 -4.16666666666667e-02 +279 612 -3.75000000000000e-01 +279 1835 -4.16666666666667e+00 +279 1544 4.16666666666667e+00 +279 1543 4.16666666666667e+00 +279 1542 -1.87500000000000e+01 +279 1792 -4.16666666666667e+00 +279 1793 -4.16666666666667e+00 +279 1541 4.16666666666667e+00 +279 1540 -8.33333333333333e+00 +279 1834 2.08333333333333e+00 +280 280 3.39166666666667e+01 +280 426 2.12500000000000e+00 +280 428 -4.25000000000000e+00 +280 92 2.12500000000000e+00 +280 91 -4.20833333333333e+00 +280 278 4.25000000000000e+00 +280 281 -4.25000000000000e+00 +280 29 2.12500000000000e+00 +280 277 -1.91250000000000e+01 +280 28 -4.20833333333333e+00 +280 276 4.25000000000000e+00 +280 287 4.16666666666667e-02 +280 612 8.33333333333333e-02 +280 279 -1.66666666666667e-01 +280 27 -4.16666666666667e-02 +280 285 4.16666666666667e-02 +280 614 -4.16666666666667e-02 +280 613 -1.25000000000000e-01 +280 90 -4.16666666666667e-02 +280 1835 2.08333333333333e+00 +280 1544 -2.08333333333333e+00 +280 1543 -6.25000000000000e+00 +280 1542 4.16666666666667e+00 +280 1791 -4.16666666666667e+00 +280 1793 -4.16666666666667e+00 +280 1541 4.16666666666667e+00 +280 1833 2.08333333333333e+00 +280 1539 -8.33333333333333e+00 +281 281 3.80000000000000e+01 +281 90 2.12500000000000e+00 +281 279 -4.25000000000000e+00 +281 27 2.12500000000000e+00 +281 92 -1.26250000000000e+01 +281 427 -4.25000000000000e+00 +281 91 2.12500000000000e+00 +281 426 2.12500000000000e+00 +281 278 -6.37500000000000e+00 +281 29 -1.26250000000000e+01 +281 277 4.25000000000000e+00 +281 280 -4.25000000000000e+00 +281 28 2.12500000000000e+00 +281 276 -2.12500000000000e+00 +281 286 4.16666666666667e-02 +281 285 -8.33333333333333e-02 +281 613 -4.16666666666667e-02 +281 614 -1.25000000000000e-01 +281 612 8.33333333333333e-02 +281 1833 -4.16666666666667e+00 +281 1544 -6.25000000000000e+00 +281 1543 -2.08333333333333e+00 +281 1542 4.16666666666667e+00 +281 1792 -4.16666666666667e+00 +281 1540 4.16666666666667e+00 +281 1791 -4.16666666666667e+00 +281 1834 2.08333333333333e+00 +281 1539 4.16666666666667e+00 +282 282 3.39166666666667e+01 +282 433 2.12500000000000e+00 +282 278 4.25000000000000e+00 +282 277 -2.12500000000000e+00 +282 276 -6.37500000000000e+00 +282 112 2.12500000000000e+00 +282 111 -4.20833333333333e+00 +282 283 -4.25000000000000e+00 +282 28 2.12500000000000e+00 +282 434 2.12500000000000e+00 +282 27 -4.20833333333333e+00 +282 284 -1.66666666666667e-01 +282 650 8.33333333333333e-02 +282 29 -4.16666666666667e-02 +282 287 4.16666666666667e-02 +282 286 -8.33333333333333e-02 +282 113 -4.16666666666667e-02 +282 649 8.33333333333333e-02 +282 648 -3.75000000000000e-01 +282 1799 -4.16666666666667e+00 +282 1871 2.08333333333333e+00 +282 1798 -4.16666666666667e+00 +282 1540 4.16666666666667e+00 +282 1870 -4.16666666666667e+00 +282 1547 4.16666666666667e+00 +282 1541 -8.33333333333333e+00 +282 1546 4.16666666666667e+00 +282 1545 -1.87500000000000e+01 +283 283 3.80000000000000e+01 +283 113 2.12500000000000e+00 +283 432 2.12500000000000e+00 +283 278 4.25000000000000e+00 +283 284 -4.25000000000000e+00 +283 29 2.12500000000000e+00 +283 277 -6.37500000000000e+00 +283 276 -2.12500000000000e+00 +283 112 -1.26250000000000e+01 +283 111 2.12500000000000e+00 +283 434 -4.25000000000000e+00 +283 28 -1.26250000000000e+01 +283 282 -4.25000000000000e+00 +283 27 2.12500000000000e+00 +283 287 4.16666666666667e-02 +283 650 -4.16666666666667e-02 +283 285 -8.33333333333333e-02 +283 649 -1.25000000000000e-01 +283 648 8.33333333333333e-02 +283 1797 -4.16666666666667e+00 +283 1539 4.16666666666667e+00 +283 1871 2.08333333333333e+00 +283 1799 -4.16666666666667e+00 +283 1869 -4.16666666666667e+00 +283 1547 -2.08333333333333e+00 +283 1541 4.16666666666667e+00 +283 1546 -6.25000000000000e+00 +283 1545 4.16666666666667e+00 +284 284 3.39166666666667e+01 +284 433 -4.25000000000000e+00 +284 112 2.12500000000000e+00 +284 278 -1.91250000000000e+01 +284 277 4.25000000000000e+00 +284 283 -4.25000000000000e+00 +284 28 2.12500000000000e+00 +284 276 4.25000000000000e+00 +284 113 -4.20833333333333e+00 +284 432 2.12500000000000e+00 +284 29 -4.20833333333333e+00 +284 649 -4.16666666666667e-02 +284 282 -1.66666666666667e-01 +284 648 8.33333333333333e-02 +284 27 -4.16666666666667e-02 +284 285 4.16666666666667e-02 +284 286 4.16666666666667e-02 +284 650 -1.25000000000000e-01 +284 111 -4.16666666666667e-02 +284 1797 -4.16666666666667e+00 +284 1869 2.08333333333333e+00 +284 1870 2.08333333333333e+00 +284 1798 -4.16666666666667e+00 +284 1547 -6.25000000000000e+00 +284 1546 -2.08333333333333e+00 +284 1540 4.16666666666667e+00 +284 1545 4.16666666666667e+00 +284 1539 -8.33333333333333e+00 +285 285 7.50000000000000e-01 +285 281 -8.33333333333333e-02 +285 280 4.16666666666667e-02 +285 287 -8.33333333333333e-02 +285 614 8.33333333333333e-02 +285 131 4.16666666666667e-02 +285 613 -4.16666666666667e-02 +285 612 -1.25000000000000e-01 +285 277 -8.33333333333333e-02 +285 439 8.33333333333333e-02 +285 284 4.16666666666667e-02 +285 278 -8.33333333333333e-02 +285 28 4.16666666666667e-02 +285 283 -8.33333333333333e-02 +285 27 -2.50000000000000e-01 +285 650 -4.16666666666667e-02 +285 440 8.33333333333333e-02 +285 286 -8.33333333333333e-02 +285 649 8.33333333333333e-02 +285 130 4.16666666666667e-02 +285 29 4.16666666666667e-02 +285 648 -1.25000000000000e-01 +285 129 -2.50000000000000e-01 +286 286 6.66666666666667e-01 +286 279 4.16666666666667e-02 +286 614 8.33333333333333e-02 +286 613 -1.25000000000000e-01 +286 612 -4.16666666666667e-02 +286 284 4.16666666666667e-02 +286 278 -8.33333333333333e-02 +286 276 -8.33333333333333e-02 +286 438 8.33333333333333e-02 +286 28 -8.33333333333333e-02 +286 27 4.16666666666667e-02 +286 282 -8.33333333333333e-02 +286 650 8.33333333333333e-02 +286 440 -1.66666666666667e-01 +286 281 4.16666666666667e-02 +286 649 -3.75000000000000e-01 +286 130 -8.33333333333333e-02 +286 285 -8.33333333333333e-02 +286 648 8.33333333333333e-02 +286 129 4.16666666666667e-02 +287 287 6.66666666666667e-01 +287 27 4.16666666666667e-02 +287 279 -8.33333333333333e-02 +287 614 -3.75000000000000e-01 +287 613 8.33333333333333e-02 +287 285 -8.33333333333333e-02 +287 612 8.33333333333333e-02 +287 129 4.16666666666667e-02 +287 283 4.16666666666667e-02 +287 277 -8.33333333333333e-02 +287 29 -8.33333333333333e-02 +287 282 4.16666666666667e-02 +287 276 -8.33333333333333e-02 +287 280 4.16666666666667e-02 +287 650 -1.25000000000000e-01 +287 131 -8.33333333333333e-02 +287 649 8.33333333333333e-02 +287 439 -1.66666666666667e-01 +287 648 -4.16666666666667e-02 +287 438 8.33333333333333e-02 +288 288 2.50000000000000e+00 +288 295 1.66666666666667e-01 +288 294 -2.50000000000000e-01 +288 446 -1.66666666666667e-01 +288 445 8.33333333333333e-02 +288 458 1.66666666666667e-01 +288 307 8.33333333333333e-02 +288 457 1.66666666666667e-01 +288 456 -7.50000000000000e-01 +288 308 8.33333333333333e-02 +288 448 -8.33333333333333e-02 +288 449 1.66666666666667e-01 +288 290 -3.33333333333333e-01 +288 56 -8.33333333333333e-02 +288 447 -2.50000000000000e-01 +288 299 8.33333333333333e-02 +288 32 -8.33333333333333e-02 +288 298 -1.66666666666667e-01 +288 443 8.33333333333333e-02 +288 292 1.66666666666667e-01 +288 289 -3.33333333333333e-01 +288 293 1.66666666666667e-01 +288 31 -8.33333333333333e-02 +288 291 -7.50000000000000e-01 +288 442 8.33333333333333e-02 +288 55 -8.33333333333333e-02 +288 455 -8.33333333333333e-02 +288 452 8.33333333333333e-02 +288 304 8.33333333333333e-02 +288 301 -8.33333333333333e-02 +288 451 -1.66666666666667e-01 +288 454 1.66666666666667e-01 +288 453 -2.50000000000000e-01 +288 302 1.66666666666667e-01 +288 305 -1.66666666666667e-01 +288 300 -2.50000000000000e-01 +288 296 -8.33333333333333e-02 +289 289 2.50000000000000e+00 +289 294 1.66666666666667e-01 +289 296 1.66666666666667e-01 +289 295 -7.50000000000000e-01 +289 444 8.33333333333333e-02 +289 458 -8.33333333333333e-02 +289 306 8.33333333333333e-02 +289 457 -2.50000000000000e-01 +289 456 1.66666666666667e-01 +289 308 -1.66666666666667e-01 +289 447 -8.33333333333333e-02 +289 299 8.33333333333333e-02 +289 449 1.66666666666667e-01 +289 448 -2.50000000000000e-01 +289 297 -1.66666666666667e-01 +289 293 -8.33333333333333e-02 +289 291 1.66666666666667e-01 +289 288 -3.33333333333333e-01 +289 292 -2.50000000000000e-01 +289 30 -8.33333333333333e-02 +289 443 -1.66666666666667e-01 +289 441 8.33333333333333e-02 +289 54 -8.33333333333333e-02 +289 455 1.66666666666667e-01 +289 290 -3.33333333333333e-01 +289 302 1.66666666666667e-01 +289 303 8.33333333333333e-02 +289 300 -8.33333333333333e-02 +289 452 8.33333333333333e-02 +289 56 -8.33333333333333e-02 +289 454 -7.50000000000000e-01 +289 450 -1.66666666666667e-01 +289 453 1.66666666666667e-01 +289 305 8.33333333333333e-02 +289 32 -8.33333333333333e-02 +289 301 -2.50000000000000e-01 +289 446 8.33333333333333e-02 +290 290 2.50000000000000e+00 +290 445 8.33333333333333e-02 +290 296 -2.50000000000000e-01 +290 295 1.66666666666667e-01 +290 444 -1.66666666666667e-01 +290 457 -8.33333333333333e-02 +290 456 1.66666666666667e-01 +290 458 -2.50000000000000e-01 +290 307 -1.66666666666667e-01 +290 306 8.33333333333333e-02 +290 298 8.33333333333333e-02 +290 447 1.66666666666667e-01 +290 288 -3.33333333333333e-01 +290 449 -7.50000000000000e-01 +290 448 1.66666666666667e-01 +290 54 -8.33333333333333e-02 +290 297 8.33333333333333e-02 +290 30 -8.33333333333333e-02 +290 292 -8.33333333333333e-02 +290 441 8.33333333333333e-02 +290 293 -2.50000000000000e-01 +290 291 1.66666666666667e-01 +290 442 -1.66666666666667e-01 +290 453 -8.33333333333333e-02 +290 450 8.33333333333333e-02 +290 454 1.66666666666667e-01 +290 289 -3.33333333333333e-01 +290 301 1.66666666666667e-01 +290 455 -2.50000000000000e-01 +290 451 8.33333333333333e-02 +290 55 -8.33333333333333e-02 +290 302 -7.50000000000000e-01 +290 294 -8.33333333333333e-02 +290 304 8.33333333333333e-02 +290 31 -8.33333333333333e-02 +290 300 1.66666666666667e-01 +290 303 -1.66666666666667e-01 +291 291 2.50000000000000e+00 +291 631 -1.66666666666667e-01 +291 566 1.66666666666667e-01 +291 668 -1.66666666666667e-01 +291 310 -8.33333333333333e-02 +291 667 8.33333333333333e-02 +291 311 -8.33333333333333e-02 +291 565 1.66666666666667e-01 +291 564 -7.50000000000000e-01 +291 554 1.66666666666667e-01 +291 448 8.33333333333333e-02 +291 553 -8.33333333333333e-02 +291 449 -1.66666666666667e-01 +291 74 8.33333333333333e-02 +291 552 -2.50000000000000e-01 +291 299 -8.33333333333333e-02 +291 32 8.33333333333333e-02 +291 292 -3.33333333333333e-01 +291 298 1.66666666666667e-01 +291 297 -2.50000000000000e-01 +291 560 -8.33333333333333e-02 +291 559 1.66666666666667e-01 +291 443 -8.33333333333333e-02 +291 455 8.33333333333333e-02 +291 289 1.66666666666667e-01 +291 454 -1.66666666666667e-01 +291 73 8.33333333333333e-02 +291 442 -8.33333333333333e-02 +291 558 -2.50000000000000e-01 +291 293 -3.33333333333333e-01 +291 305 1.66666666666667e-01 +291 290 1.66666666666667e-01 +291 304 -8.33333333333333e-02 +291 31 8.33333333333333e-02 +291 632 8.33333333333333e-02 +291 303 -2.50000000000000e-01 +291 288 -7.50000000000000e-01 +292 292 2.50000000000000e+00 +292 630 -1.66666666666667e-01 +292 566 -8.33333333333333e-02 +292 311 -8.33333333333333e-02 +292 668 8.33333333333333e-02 +292 309 -8.33333333333333e-02 +292 666 8.33333333333333e-02 +292 565 -2.50000000000000e-01 +292 564 1.66666666666667e-01 +292 447 8.33333333333333e-02 +292 552 -8.33333333333333e-02 +292 449 8.33333333333333e-02 +292 554 1.66666666666667e-01 +292 553 -2.50000000000000e-01 +292 299 1.66666666666667e-01 +292 298 -7.50000000000000e-01 +292 291 -3.33333333333333e-01 +292 297 1.66666666666667e-01 +292 290 -8.33333333333333e-02 +292 293 -3.33333333333333e-01 +292 443 -8.33333333333333e-02 +292 455 8.33333333333333e-02 +292 558 1.66666666666667e-01 +292 288 1.66666666666667e-01 +292 453 -1.66666666666667e-01 +292 74 -1.66666666666667e-01 +292 560 1.66666666666667e-01 +292 559 -7.50000000000000e-01 +292 72 8.33333333333333e-02 +292 441 -8.33333333333333e-02 +292 305 1.66666666666667e-01 +292 32 -1.66666666666667e-01 +292 632 8.33333333333333e-02 +292 304 -2.50000000000000e-01 +292 289 -2.50000000000000e-01 +292 303 -8.33333333333333e-02 +292 30 8.33333333333333e-02 +293 293 2.50000000000000e+00 +293 631 8.33333333333333e-02 +293 565 -8.33333333333333e-02 +293 310 -8.33333333333333e-02 +293 667 8.33333333333333e-02 +293 564 1.66666666666667e-01 +293 666 -1.66666666666667e-01 +293 309 -8.33333333333333e-02 +293 566 -2.50000000000000e-01 +293 552 1.66666666666667e-01 +293 448 8.33333333333333e-02 +293 447 -1.66666666666667e-01 +293 554 -7.50000000000000e-01 +293 553 1.66666666666667e-01 +293 72 8.33333333333333e-02 +293 299 -2.50000000000000e-01 +293 298 1.66666666666667e-01 +293 297 -8.33333333333333e-02 +293 30 8.33333333333333e-02 +293 289 -8.33333333333333e-02 +293 292 -3.33333333333333e-01 +293 558 -8.33333333333333e-02 +293 442 -8.33333333333333e-02 +293 454 8.33333333333333e-02 +293 441 -8.33333333333333e-02 +293 453 8.33333333333333e-02 +293 560 -2.50000000000000e-01 +293 73 -1.66666666666667e-01 +293 559 1.66666666666667e-01 +293 630 8.33333333333333e-02 +293 305 -7.50000000000000e-01 +293 290 -2.50000000000000e-01 +293 304 1.66666666666667e-01 +293 31 -1.66666666666667e-01 +293 291 -3.33333333333333e-01 +293 303 1.66666666666667e-01 +293 288 1.66666666666667e-01 +294 294 1.25000000000000e+00 +294 448 8.33333333333333e-02 +294 449 8.33333333333333e-02 +294 617 8.33333333333333e-02 +294 615 -1.25000000000000e-01 +294 299 8.33333333333333e-02 +294 298 8.33333333333333e-02 +294 295 -1.66666666666667e-01 +294 297 -3.75000000000000e-01 +294 290 -8.33333333333333e-02 +294 296 -1.66666666666667e-01 +294 446 -8.33333333333333e-02 +294 458 8.33333333333333e-02 +294 619 8.33333333333333e-02 +294 289 1.66666666666667e-01 +294 457 -1.66666666666667e-01 +294 620 8.33333333333333e-02 +294 95 -8.33333333333333e-02 +294 94 4.16666666666667e-02 +294 445 -8.33333333333333e-02 +294 618 -3.75000000000000e-01 +294 308 8.33333333333333e-02 +294 32 -8.33333333333333e-02 +294 307 -4.16666666666667e-02 +294 31 4.16666666666667e-02 +294 306 -1.25000000000000e-01 +294 616 -4.16666666666667e-02 +294 288 -2.50000000000000e-01 +295 295 1.25000000000000e+00 +295 615 -4.16666666666667e-02 +295 447 8.33333333333333e-02 +295 449 -1.66666666666667e-01 +295 95 4.16666666666667e-02 +295 616 -1.25000000000000e-01 +295 299 -4.16666666666667e-02 +295 32 4.16666666666667e-02 +295 298 -1.25000000000000e-01 +295 297 8.33333333333333e-02 +295 294 -1.66666666666667e-01 +295 620 -4.16666666666667e-02 +295 618 8.33333333333333e-02 +295 446 -8.33333333333333e-02 +295 458 8.33333333333333e-02 +295 288 1.66666666666667e-01 +295 456 -1.66666666666667e-01 +295 619 -1.25000000000000e-01 +295 93 4.16666666666667e-02 +295 444 -8.33333333333333e-02 +295 308 8.33333333333333e-02 +295 296 -1.66666666666667e-01 +295 290 1.66666666666667e-01 +295 307 -1.25000000000000e-01 +295 617 8.33333333333333e-02 +295 289 -7.50000000000000e-01 +295 306 -4.16666666666667e-02 +295 30 4.16666666666667e-02 +296 296 1.25000000000000e+00 +296 448 -1.66666666666667e-01 +296 447 8.33333333333333e-02 +296 617 -3.75000000000000e-01 +296 94 4.16666666666667e-02 +296 615 8.33333333333333e-02 +296 299 -1.25000000000000e-01 +296 298 -4.16666666666667e-02 +296 31 4.16666666666667e-02 +296 297 8.33333333333333e-02 +296 288 -8.33333333333333e-02 +296 619 -4.16666666666667e-02 +296 294 -1.66666666666667e-01 +296 444 -8.33333333333333e-02 +296 456 8.33333333333333e-02 +296 445 -8.33333333333333e-02 +296 457 8.33333333333333e-02 +296 620 -1.25000000000000e-01 +296 618 8.33333333333333e-02 +296 93 -8.33333333333333e-02 +296 308 -3.75000000000000e-01 +296 616 8.33333333333333e-02 +296 290 -2.50000000000000e-01 +296 307 8.33333333333333e-02 +296 295 -1.66666666666667e-01 +296 289 1.66666666666667e-01 +296 306 8.33333333333333e-02 +296 30 -8.33333333333333e-02 +297 297 1.25000000000000e+00 +297 298 -1.66666666666667e-01 +297 311 -8.33333333333333e-02 +297 31 -4.16666666666667e-02 +297 310 4.16666666666667e-02 +297 632 8.33333333333333e-02 +297 100 -4.16666666666667e-02 +297 630 -3.75000000000000e-01 +297 616 4.16666666666667e-02 +297 101 8.33333333333333e-02 +297 617 -8.33333333333333e-02 +297 299 -1.66666666666667e-01 +297 296 8.33333333333333e-02 +297 32 8.33333333333333e-02 +297 295 8.33333333333333e-02 +297 294 -3.75000000000000e-01 +297 448 -8.33333333333333e-02 +297 553 8.33333333333333e-02 +297 554 8.33333333333333e-02 +297 449 -8.33333333333333e-02 +297 99 -1.25000000000000e-01 +297 293 -8.33333333333333e-02 +297 290 8.33333333333333e-02 +297 292 1.66666666666667e-01 +297 289 -1.66666666666667e-01 +297 291 -2.50000000000000e-01 +297 631 8.33333333333333e-02 +297 30 -1.25000000000000e-01 +298 298 1.25000000000000e+00 +298 311 4.16666666666667e-02 +298 630 8.33333333333333e-02 +298 297 -1.66666666666667e-01 +298 30 -4.16666666666667e-02 +298 309 4.16666666666667e-02 +298 631 -1.25000000000000e-01 +298 99 -4.16666666666667e-02 +298 615 4.16666666666667e-02 +298 617 4.16666666666667e-02 +298 296 -4.16666666666667e-02 +298 295 -1.25000000000000e-01 +298 294 8.33333333333333e-02 +298 447 -8.33333333333333e-02 +298 552 8.33333333333333e-02 +298 449 -8.33333333333333e-02 +298 290 8.33333333333333e-02 +298 554 -1.66666666666667e-01 +298 101 8.33333333333333e-02 +298 100 -1.25000000000000e-01 +298 293 1.66666666666667e-01 +298 299 -1.66666666666667e-01 +298 32 8.33333333333333e-02 +298 292 -7.50000000000000e-01 +298 632 -4.16666666666667e-02 +298 31 -1.25000000000000e-01 +298 291 1.66666666666667e-01 +298 288 -1.66666666666667e-01 +299 299 1.25000000000000e+00 +299 310 4.16666666666667e-02 +299 309 -8.33333333333333e-02 +299 632 -1.25000000000000e-01 +299 630 8.33333333333333e-02 +299 616 4.16666666666667e-02 +299 99 8.33333333333333e-02 +299 615 -8.33333333333333e-02 +299 296 -1.25000000000000e-01 +299 295 -4.16666666666667e-02 +299 297 -1.66666666666667e-01 +299 294 8.33333333333333e-02 +299 30 8.33333333333333e-02 +299 448 -8.33333333333333e-02 +299 289 8.33333333333333e-02 +299 101 -3.75000000000000e-01 +299 553 -1.66666666666667e-01 +299 100 8.33333333333333e-02 +299 552 8.33333333333333e-02 +299 447 -8.33333333333333e-02 +299 293 -2.50000000000000e-01 +299 631 -4.16666666666667e-02 +299 32 -3.75000000000000e-01 +299 292 1.66666666666667e-01 +299 298 -1.66666666666667e-01 +299 31 8.33333333333333e-02 +299 291 -8.33333333333333e-02 +299 288 8.33333333333333e-02 +300 300 1.25000000000000e+00 +300 458 -1.66666666666667e-01 +300 457 8.33333333333333e-02 +300 116 4.16666666666667e-02 +300 655 8.33333333333333e-02 +300 654 -3.75000000000000e-01 +300 308 -4.16666666666667e-02 +300 32 4.16666666666667e-02 +300 307 8.33333333333333e-02 +300 306 -1.25000000000000e-01 +300 452 -8.33333333333333e-02 +300 451 -8.33333333333333e-02 +300 455 8.33333333333333e-02 +300 653 -4.16666666666667e-02 +300 301 -1.66666666666667e-01 +300 454 8.33333333333333e-02 +300 289 -8.33333333333333e-02 +300 115 -8.33333333333333e-02 +300 652 8.33333333333333e-02 +300 651 -1.25000000000000e-01 +300 302 -1.66666666666667e-01 +300 305 8.33333333333333e-02 +300 290 1.66666666666667e-01 +300 304 8.33333333333333e-02 +300 31 -8.33333333333333e-02 +300 656 8.33333333333333e-02 +300 303 -3.75000000000000e-01 +300 288 -2.50000000000000e-01 +301 301 1.25000000000000e+00 +301 458 8.33333333333333e-02 +301 456 8.33333333333333e-02 +301 655 -1.25000000000000e-01 +301 654 8.33333333333333e-02 +301 308 8.33333333333333e-02 +301 302 -1.66666666666667e-01 +301 307 -3.75000000000000e-01 +301 306 8.33333333333333e-02 +301 450 -8.33333333333333e-02 +301 653 8.33333333333333e-02 +301 300 -1.66666666666667e-01 +301 455 -1.66666666666667e-01 +301 290 1.66666666666667e-01 +301 453 8.33333333333333e-02 +301 288 -8.33333333333333e-02 +301 116 4.16666666666667e-02 +301 452 -8.33333333333333e-02 +301 652 -3.75000000000000e-01 +301 114 -8.33333333333333e-02 +301 651 8.33333333333333e-02 +301 305 -4.16666666666667e-02 +301 32 4.16666666666667e-02 +301 656 -4.16666666666667e-02 +301 304 -1.25000000000000e-01 +301 289 -2.50000000000000e-01 +301 303 8.33333333333333e-02 +301 30 -8.33333333333333e-02 +302 302 1.25000000000000e+00 +302 457 8.33333333333333e-02 +302 654 8.33333333333333e-02 +302 456 -1.66666666666667e-01 +302 656 -1.25000000000000e-01 +302 114 4.16666666666667e-02 +302 308 -1.25000000000000e-01 +302 307 8.33333333333333e-02 +302 301 -1.66666666666667e-01 +302 306 -4.16666666666667e-02 +302 30 4.16666666666667e-02 +302 450 -8.33333333333333e-02 +302 652 8.33333333333333e-02 +302 453 8.33333333333333e-02 +302 651 -4.16666666666667e-02 +302 454 -1.66666666666667e-01 +302 289 1.66666666666667e-01 +302 653 -1.25000000000000e-01 +302 115 4.16666666666667e-02 +302 451 -8.33333333333333e-02 +302 655 -4.16666666666667e-02 +302 305 -1.25000000000000e-01 +302 290 -7.50000000000000e-01 +302 304 -4.16666666666667e-02 +302 31 4.16666666666667e-02 +302 300 -1.66666666666667e-01 +302 303 8.33333333333333e-02 +302 288 1.66666666666667e-01 +303 303 1.25000000000000e+00 +303 668 8.33333333333333e-02 +303 32 -4.16666666666667e-02 +303 311 4.16666666666667e-02 +303 310 -8.33333333333333e-02 +303 122 -4.16666666666667e-02 +303 667 8.33333333333333e-02 +303 666 -3.75000000000000e-01 +303 560 8.33333333333333e-02 +303 559 8.33333333333333e-02 +303 293 1.66666666666667e-01 +303 292 -8.33333333333333e-02 +303 291 -2.50000000000000e-01 +303 455 -8.33333333333333e-02 +303 653 4.16666666666667e-02 +303 454 -8.33333333333333e-02 +303 289 8.33333333333333e-02 +303 652 -8.33333333333333e-02 +303 121 8.33333333333333e-02 +303 120 -1.25000000000000e-01 +303 302 8.33333333333333e-02 +303 290 -1.66666666666667e-01 +303 301 8.33333333333333e-02 +303 304 -1.66666666666667e-01 +303 31 8.33333333333333e-02 +303 300 -3.75000000000000e-01 +303 305 -1.66666666666667e-01 +303 30 -1.25000000000000e-01 +304 304 1.25000000000000e+00 +304 668 -4.16666666666667e-02 +304 309 -8.33333333333333e-02 +304 667 -1.25000000000000e-01 +304 666 8.33333333333333e-02 +304 560 -1.66666666666667e-01 +304 122 8.33333333333333e-02 +304 558 8.33333333333333e-02 +304 293 1.66666666666667e-01 +304 305 -1.66666666666667e-01 +304 32 8.33333333333333e-02 +304 292 -2.50000000000000e-01 +304 291 -8.33333333333333e-02 +304 453 -8.33333333333333e-02 +304 288 8.33333333333333e-02 +304 653 4.16666666666667e-02 +304 455 -8.33333333333333e-02 +304 121 -3.75000000000000e-01 +304 651 -8.33333333333333e-02 +304 120 8.33333333333333e-02 +304 302 -4.16666666666667e-02 +304 290 8.33333333333333e-02 +304 301 -1.25000000000000e-01 +304 311 4.16666666666667e-02 +304 31 -3.75000000000000e-01 +304 300 8.33333333333333e-02 +304 303 -1.66666666666667e-01 +304 30 8.33333333333333e-02 +305 305 1.25000000000000e+00 +305 667 -4.16666666666667e-02 +305 303 -1.66666666666667e-01 +305 666 8.33333333333333e-02 +305 30 -4.16666666666667e-02 +305 309 4.16666666666667e-02 +305 668 -1.25000000000000e-01 +305 120 -4.16666666666667e-02 +305 558 8.33333333333333e-02 +305 559 -1.66666666666667e-01 +305 121 8.33333333333333e-02 +305 293 -7.50000000000000e-01 +305 292 1.66666666666667e-01 +305 304 -1.66666666666667e-01 +305 31 8.33333333333333e-02 +305 291 1.66666666666667e-01 +305 453 -8.33333333333333e-02 +305 651 4.16666666666667e-02 +305 122 -1.25000000000000e-01 +305 652 4.16666666666667e-02 +305 454 -8.33333333333333e-02 +305 302 -1.25000000000000e-01 +305 310 4.16666666666667e-02 +305 32 -1.25000000000000e-01 +305 301 -4.16666666666667e-02 +305 289 8.33333333333333e-02 +305 300 8.33333333333333e-02 +305 288 -1.66666666666667e-01 +306 306 7.50000000000000e-01 +306 620 -8.33333333333333e-02 +306 619 4.16666666666667e-02 +306 308 -8.33333333333333e-02 +306 296 8.33333333333333e-02 +306 32 4.16666666666667e-02 +306 295 -4.16666666666667e-02 +306 294 -1.25000000000000e-01 +306 457 -8.33333333333333e-02 +306 289 8.33333333333333e-02 +306 656 4.16666666666667e-02 +306 458 -8.33333333333333e-02 +306 130 4.16666666666667e-02 +306 655 -8.33333333333333e-02 +306 129 -2.50000000000000e-01 +306 302 -4.16666666666667e-02 +306 290 8.33333333333333e-02 +306 307 -8.33333333333333e-02 +306 301 8.33333333333333e-02 +306 31 4.16666666666667e-02 +306 131 4.16666666666667e-02 +306 300 -1.25000000000000e-01 +306 30 -2.50000000000000e-01 +307 307 6.66666666666667e-01 +307 618 4.16666666666667e-02 +307 296 8.33333333333333e-02 +307 295 -1.25000000000000e-01 +307 294 -4.16666666666667e-02 +307 656 4.16666666666667e-02 +307 458 -8.33333333333333e-02 +307 456 -8.33333333333333e-02 +307 288 8.33333333333333e-02 +307 130 -8.33333333333333e-02 +307 129 4.16666666666667e-02 +307 654 -8.33333333333333e-02 +307 302 8.33333333333333e-02 +307 290 -1.66666666666667e-01 +307 620 4.16666666666667e-02 +307 301 -3.75000000000000e-01 +307 31 -8.33333333333333e-02 +307 306 -8.33333333333333e-02 +307 300 8.33333333333333e-02 +307 30 4.16666666666667e-02 +308 308 6.66666666666667e-01 +308 129 4.16666666666667e-02 +308 618 -8.33333333333333e-02 +308 296 -3.75000000000000e-01 +308 295 8.33333333333333e-02 +308 306 -8.33333333333333e-02 +308 294 8.33333333333333e-02 +308 30 4.16666666666667e-02 +308 655 4.16666666666667e-02 +308 457 -8.33333333333333e-02 +308 131 -8.33333333333333e-02 +308 654 4.16666666666667e-02 +308 456 -8.33333333333333e-02 +308 619 4.16666666666667e-02 +308 302 -1.25000000000000e-01 +308 32 -8.33333333333333e-02 +308 301 8.33333333333333e-02 +308 289 -1.66666666666667e-01 +308 300 -4.16666666666667e-02 +308 288 8.33333333333333e-02 +309 309 7.50000000000000e-01 +309 299 -8.33333333333333e-02 +309 298 4.16666666666667e-02 +309 311 -8.33333333333333e-02 +309 632 8.33333333333333e-02 +309 134 4.16666666666667e-02 +309 631 -4.16666666666667e-02 +309 630 -1.25000000000000e-01 +309 292 -8.33333333333333e-02 +309 565 8.33333333333333e-02 +309 305 4.16666666666667e-02 +309 293 -8.33333333333333e-02 +309 31 4.16666666666667e-02 +309 304 -8.33333333333333e-02 +309 30 -2.50000000000000e-01 +309 668 -4.16666666666667e-02 +309 566 8.33333333333333e-02 +309 310 -8.33333333333333e-02 +309 667 8.33333333333333e-02 +309 133 4.16666666666667e-02 +309 32 4.16666666666667e-02 +309 666 -1.25000000000000e-01 +309 132 -2.50000000000000e-01 +310 310 6.66666666666667e-01 +310 297 4.16666666666667e-02 +310 632 8.33333333333333e-02 +310 631 -1.25000000000000e-01 +310 630 -4.16666666666667e-02 +310 305 4.16666666666667e-02 +310 293 -8.33333333333333e-02 +310 291 -8.33333333333333e-02 +310 564 8.33333333333333e-02 +310 31 -8.33333333333333e-02 +310 30 4.16666666666667e-02 +310 303 -8.33333333333333e-02 +310 668 8.33333333333333e-02 +310 566 -1.66666666666667e-01 +310 299 4.16666666666667e-02 +310 667 -3.75000000000000e-01 +310 133 -8.33333333333333e-02 +310 309 -8.33333333333333e-02 +310 666 8.33333333333333e-02 +310 132 4.16666666666667e-02 +311 311 6.66666666666667e-01 +311 30 4.16666666666667e-02 +311 297 -8.33333333333333e-02 +311 632 -3.75000000000000e-01 +311 631 8.33333333333333e-02 +311 309 -8.33333333333333e-02 +311 630 8.33333333333333e-02 +311 132 4.16666666666667e-02 +311 304 4.16666666666667e-02 +311 292 -8.33333333333333e-02 +311 32 -8.33333333333333e-02 +311 303 4.16666666666667e-02 +311 291 -8.33333333333333e-02 +311 298 4.16666666666667e-02 +311 668 -1.25000000000000e-01 +311 134 -8.33333333333333e-02 +311 667 8.33333333333333e-02 +311 565 -1.66666666666667e-01 +311 666 -4.16666666666667e-02 +311 564 8.33333333333333e-02 +312 312 2.50000000000000e+00 +312 319 1.66666666666667e-01 +312 318 -2.50000000000000e-01 +312 572 -1.66666666666667e-01 +312 571 8.33333333333333e-02 +312 584 1.66666666666667e-01 +312 331 8.33333333333333e-02 +312 583 1.66666666666667e-01 +312 582 -7.50000000000000e-01 +312 332 8.33333333333333e-02 +312 574 -8.33333333333333e-02 +312 575 1.66666666666667e-01 +312 314 -3.33333333333333e-01 +312 77 -8.33333333333333e-02 +312 573 -2.50000000000000e-01 +312 323 8.33333333333333e-02 +312 35 -8.33333333333333e-02 +312 322 -1.66666666666667e-01 +312 569 8.33333333333333e-02 +312 316 1.66666666666667e-01 +312 313 -3.33333333333333e-01 +312 317 1.66666666666667e-01 +312 34 -8.33333333333333e-02 +312 315 -7.50000000000000e-01 +312 568 8.33333333333333e-02 +312 76 -8.33333333333333e-02 +312 581 -8.33333333333333e-02 +312 578 8.33333333333333e-02 +312 328 8.33333333333333e-02 +312 325 -8.33333333333333e-02 +312 577 -1.66666666666667e-01 +312 580 1.66666666666667e-01 +312 579 -2.50000000000000e-01 +312 326 1.66666666666667e-01 +312 329 -1.66666666666667e-01 +312 324 -2.50000000000000e-01 +312 320 -8.33333333333333e-02 +313 313 2.50000000000000e+00 +313 318 1.66666666666667e-01 +313 320 1.66666666666667e-01 +313 319 -7.50000000000000e-01 +313 570 8.33333333333333e-02 +313 584 -8.33333333333333e-02 +313 330 8.33333333333333e-02 +313 583 -2.50000000000000e-01 +313 582 1.66666666666667e-01 +313 332 -1.66666666666667e-01 +313 573 -8.33333333333333e-02 +313 323 8.33333333333333e-02 +313 575 1.66666666666667e-01 +313 574 -2.50000000000000e-01 +313 321 -1.66666666666667e-01 +313 317 -8.33333333333333e-02 +313 315 1.66666666666667e-01 +313 312 -3.33333333333333e-01 +313 316 -2.50000000000000e-01 +313 33 -8.33333333333333e-02 +313 569 -1.66666666666667e-01 +313 567 8.33333333333333e-02 +313 75 -8.33333333333333e-02 +313 581 1.66666666666667e-01 +313 314 -3.33333333333333e-01 +313 326 1.66666666666667e-01 +313 327 8.33333333333333e-02 +313 324 -8.33333333333333e-02 +313 578 8.33333333333333e-02 +313 77 -8.33333333333333e-02 +313 580 -7.50000000000000e-01 +313 576 -1.66666666666667e-01 +313 579 1.66666666666667e-01 +313 329 8.33333333333333e-02 +313 35 -8.33333333333333e-02 +313 325 -2.50000000000000e-01 +313 572 8.33333333333333e-02 +314 314 2.50000000000000e+00 +314 571 8.33333333333333e-02 +314 320 -2.50000000000000e-01 +314 319 1.66666666666667e-01 +314 570 -1.66666666666667e-01 +314 583 -8.33333333333333e-02 +314 582 1.66666666666667e-01 +314 584 -2.50000000000000e-01 +314 331 -1.66666666666667e-01 +314 330 8.33333333333333e-02 +314 322 8.33333333333333e-02 +314 573 1.66666666666667e-01 +314 312 -3.33333333333333e-01 +314 575 -7.50000000000000e-01 +314 574 1.66666666666667e-01 +314 75 -8.33333333333333e-02 +314 321 8.33333333333333e-02 +314 33 -8.33333333333333e-02 +314 316 -8.33333333333333e-02 +314 567 8.33333333333333e-02 +314 317 -2.50000000000000e-01 +314 315 1.66666666666667e-01 +314 568 -1.66666666666667e-01 +314 579 -8.33333333333333e-02 +314 576 8.33333333333333e-02 +314 580 1.66666666666667e-01 +314 313 -3.33333333333333e-01 +314 325 1.66666666666667e-01 +314 581 -2.50000000000000e-01 +314 577 8.33333333333333e-02 +314 76 -8.33333333333333e-02 +314 326 -7.50000000000000e-01 +314 318 -8.33333333333333e-02 +314 328 8.33333333333333e-02 +314 34 -8.33333333333333e-02 +314 324 1.66666666666667e-01 +314 327 -1.66666666666667e-01 +315 315 2.50000000000000e+00 +315 323 -8.33333333333333e-02 +315 322 1.66666666666667e-01 +315 34 8.33333333333333e-02 +315 321 -2.50000000000000e-01 +315 317 -3.33333333333333e-01 +315 599 1.66666666666667e-01 +315 598 -8.33333333333333e-02 +315 85 8.33333333333333e-02 +315 597 -2.50000000000000e-01 +315 328 -8.33333333333333e-02 +315 329 1.66666666666667e-01 +315 35 8.33333333333333e-02 +315 327 -2.50000000000000e-01 +315 602 -8.33333333333333e-02 +315 86 8.33333333333333e-02 +315 316 -3.33333333333333e-01 +315 601 1.66666666666667e-01 +315 600 -2.50000000000000e-01 +315 574 8.33333333333333e-02 +315 575 -1.66666666666667e-01 +315 569 -8.33333333333333e-02 +315 581 8.33333333333333e-02 +315 313 1.66666666666667e-01 +315 580 -1.66666666666667e-01 +315 568 -8.33333333333333e-02 +315 314 1.66666666666667e-01 +315 312 -7.50000000000000e-01 +315 1213 -1.66666666666667e-01 +315 1040 1.66666666666667e-01 +315 1250 -1.66666666666667e-01 +315 904 -8.33333333333333e-02 +315 1249 8.33333333333333e-02 +315 905 -8.33333333333333e-02 +315 1039 1.66666666666667e-01 +315 1214 8.33333333333333e-02 +315 1038 -7.50000000000000e-01 +316 316 2.50000000000000e+00 +316 323 1.66666666666667e-01 +316 322 -7.50000000000000e-01 +316 33 8.33333333333333e-02 +316 599 1.66666666666667e-01 +316 598 -2.50000000000000e-01 +316 597 -8.33333333333333e-02 +316 84 8.33333333333333e-02 +316 317 -3.33333333333333e-01 +316 327 -8.33333333333333e-02 +316 35 -1.66666666666667e-01 +316 329 1.66666666666667e-01 +316 328 -2.50000000000000e-01 +316 602 1.66666666666667e-01 +316 86 -1.66666666666667e-01 +316 321 1.66666666666667e-01 +316 601 -7.50000000000000e-01 +316 315 -3.33333333333333e-01 +316 600 1.66666666666667e-01 +316 575 8.33333333333333e-02 +316 314 -8.33333333333333e-02 +316 569 -8.33333333333333e-02 +316 581 8.33333333333333e-02 +316 312 1.66666666666667e-01 +316 579 -1.66666666666667e-01 +316 567 -8.33333333333333e-02 +316 573 8.33333333333333e-02 +316 313 -2.50000000000000e-01 +316 1214 8.33333333333333e-02 +316 1212 -1.66666666666667e-01 +316 1040 -8.33333333333333e-02 +316 905 -8.33333333333333e-02 +316 1250 8.33333333333333e-02 +316 903 -8.33333333333333e-02 +316 1248 8.33333333333333e-02 +316 1039 -2.50000000000000e-01 +316 1038 1.66666666666667e-01 +317 317 2.50000000000000e+00 +317 321 -8.33333333333333e-02 +317 323 -2.50000000000000e-01 +317 322 1.66666666666667e-01 +317 599 -7.50000000000000e-01 +317 598 1.66666666666667e-01 +317 315 -3.33333333333333e-01 +317 597 1.66666666666667e-01 +317 316 -3.33333333333333e-01 +317 327 1.66666666666667e-01 +317 329 -7.50000000000000e-01 +317 34 -1.66666666666667e-01 +317 328 1.66666666666667e-01 +317 33 8.33333333333333e-02 +317 602 -2.50000000000000e-01 +317 601 1.66666666666667e-01 +317 85 -1.66666666666667e-01 +317 600 -8.33333333333333e-02 +317 84 8.33333333333333e-02 +317 574 8.33333333333333e-02 +317 573 -1.66666666666667e-01 +317 313 -8.33333333333333e-02 +317 568 -8.33333333333333e-02 +317 580 8.33333333333333e-02 +317 567 -8.33333333333333e-02 +317 579 8.33333333333333e-02 +317 314 -2.50000000000000e-01 +317 312 1.66666666666667e-01 +317 1213 8.33333333333333e-02 +317 1039 -8.33333333333333e-02 +317 904 -8.33333333333333e-02 +317 1249 8.33333333333333e-02 +317 1038 1.66666666666667e-01 +317 1248 -1.66666666666667e-01 +317 903 -8.33333333333333e-02 +317 1212 8.33333333333333e-02 +317 1040 -2.50000000000000e-01 +318 318 1.25000000000000e+00 +318 574 8.33333333333333e-02 +318 575 8.33333333333333e-02 +318 635 8.33333333333333e-02 +318 633 -1.25000000000000e-01 +318 323 8.33333333333333e-02 +318 322 8.33333333333333e-02 +318 319 -1.66666666666667e-01 +318 321 -3.75000000000000e-01 +318 314 -8.33333333333333e-02 +318 320 -1.66666666666667e-01 +318 572 -8.33333333333333e-02 +318 584 8.33333333333333e-02 +318 637 8.33333333333333e-02 +318 313 1.66666666666667e-01 +318 583 -1.66666666666667e-01 +318 638 8.33333333333333e-02 +318 104 -8.33333333333333e-02 +318 103 4.16666666666667e-02 +318 571 -8.33333333333333e-02 +318 636 -3.75000000000000e-01 +318 332 8.33333333333333e-02 +318 35 -8.33333333333333e-02 +318 331 -4.16666666666667e-02 +318 34 4.16666666666667e-02 +318 330 -1.25000000000000e-01 +318 634 -4.16666666666667e-02 +318 312 -2.50000000000000e-01 +319 319 1.25000000000000e+00 +319 633 -4.16666666666667e-02 +319 573 8.33333333333333e-02 +319 575 -1.66666666666667e-01 +319 104 4.16666666666667e-02 +319 634 -1.25000000000000e-01 +319 323 -4.16666666666667e-02 +319 35 4.16666666666667e-02 +319 322 -1.25000000000000e-01 +319 321 8.33333333333333e-02 +319 318 -1.66666666666667e-01 +319 638 -4.16666666666667e-02 +319 636 8.33333333333333e-02 +319 572 -8.33333333333333e-02 +319 584 8.33333333333333e-02 +319 312 1.66666666666667e-01 +319 582 -1.66666666666667e-01 +319 637 -1.25000000000000e-01 +319 102 4.16666666666667e-02 +319 570 -8.33333333333333e-02 +319 332 8.33333333333333e-02 +319 320 -1.66666666666667e-01 +319 314 1.66666666666667e-01 +319 331 -1.25000000000000e-01 +319 635 8.33333333333333e-02 +319 313 -7.50000000000000e-01 +319 330 -4.16666666666667e-02 +319 33 4.16666666666667e-02 +320 320 1.25000000000000e+00 +320 574 -1.66666666666667e-01 +320 573 8.33333333333333e-02 +320 635 -3.75000000000000e-01 +320 103 4.16666666666667e-02 +320 633 8.33333333333333e-02 +320 323 -1.25000000000000e-01 +320 322 -4.16666666666667e-02 +320 34 4.16666666666667e-02 +320 321 8.33333333333333e-02 +320 312 -8.33333333333333e-02 +320 637 -4.16666666666667e-02 +320 318 -1.66666666666667e-01 +320 570 -8.33333333333333e-02 +320 582 8.33333333333333e-02 +320 571 -8.33333333333333e-02 +320 583 8.33333333333333e-02 +320 638 -1.25000000000000e-01 +320 636 8.33333333333333e-02 +320 102 -8.33333333333333e-02 +320 332 -3.75000000000000e-01 +320 634 8.33333333333333e-02 +320 314 -2.50000000000000e-01 +320 331 8.33333333333333e-02 +320 319 -1.66666666666667e-01 +320 313 1.66666666666667e-01 +320 330 8.33333333333333e-02 +320 33 -8.33333333333333e-02 +321 321 1.25000000000000e+00 +321 317 -8.33333333333333e-02 +321 322 -1.66666666666667e-01 +321 316 1.66666666666667e-01 +321 35 8.33333333333333e-02 +321 34 -4.16666666666667e-02 +321 33 -1.25000000000000e-01 +321 315 -2.50000000000000e-01 +321 323 -1.66666666666667e-01 +321 107 8.33333333333333e-02 +321 106 -4.16666666666667e-02 +321 598 8.33333333333333e-02 +321 599 8.33333333333333e-02 +321 105 -1.25000000000000e-01 +321 635 -8.33333333333333e-02 +321 320 8.33333333333333e-02 +321 319 8.33333333333333e-02 +321 318 -3.75000000000000e-01 +321 574 -8.33333333333333e-02 +321 575 -8.33333333333333e-02 +321 314 8.33333333333333e-02 +321 313 -1.66666666666667e-01 +321 634 4.16666666666667e-02 +321 1213 8.33333333333333e-02 +321 905 -8.33333333333333e-02 +321 904 4.16666666666667e-02 +321 1214 8.33333333333333e-02 +321 1212 -3.75000000000000e-01 +322 322 1.25000000000000e+00 +322 321 -1.66666666666667e-01 +322 315 1.66666666666667e-01 +322 35 8.33333333333333e-02 +322 323 -1.66666666666667e-01 +322 317 1.66666666666667e-01 +322 34 -1.25000000000000e-01 +322 316 -7.50000000000000e-01 +322 33 -4.16666666666667e-02 +322 107 8.33333333333333e-02 +322 599 -1.66666666666667e-01 +322 106 -1.25000000000000e-01 +322 105 -4.16666666666667e-02 +322 597 8.33333333333333e-02 +322 635 4.16666666666667e-02 +322 320 -4.16666666666667e-02 +322 319 -1.25000000000000e-01 +322 318 8.33333333333333e-02 +322 573 -8.33333333333333e-02 +322 575 -8.33333333333333e-02 +322 314 8.33333333333333e-02 +322 633 4.16666666666667e-02 +322 312 -1.66666666666667e-01 +322 905 4.16666666666667e-02 +322 1212 8.33333333333333e-02 +322 903 4.16666666666667e-02 +322 1214 -4.16666666666667e-02 +322 1213 -1.25000000000000e-01 +323 323 1.25000000000000e+00 +323 597 8.33333333333333e-02 +323 315 -8.33333333333333e-02 +323 35 -3.75000000000000e-01 +323 317 -2.50000000000000e-01 +323 34 8.33333333333333e-02 +323 322 -1.66666666666667e-01 +323 316 1.66666666666667e-01 +323 33 8.33333333333333e-02 +323 107 -3.75000000000000e-01 +323 106 8.33333333333333e-02 +323 598 -1.66666666666667e-01 +323 321 -1.66666666666667e-01 +323 105 8.33333333333333e-02 +323 633 -8.33333333333333e-02 +323 320 -1.25000000000000e-01 +323 319 -4.16666666666667e-02 +323 318 8.33333333333333e-02 +323 574 -8.33333333333333e-02 +323 313 8.33333333333333e-02 +323 573 -8.33333333333333e-02 +323 634 4.16666666666667e-02 +323 312 8.33333333333333e-02 +323 904 4.16666666666667e-02 +323 903 -8.33333333333333e-02 +323 1213 -4.16666666666667e-02 +323 1214 -1.25000000000000e-01 +323 1212 8.33333333333333e-02 +324 324 1.25000000000000e+00 +324 584 -1.66666666666667e-01 +324 583 8.33333333333333e-02 +324 125 4.16666666666667e-02 +324 673 8.33333333333333e-02 +324 672 -3.75000000000000e-01 +324 332 -4.16666666666667e-02 +324 35 4.16666666666667e-02 +324 331 8.33333333333333e-02 +324 330 -1.25000000000000e-01 +324 578 -8.33333333333333e-02 +324 577 -8.33333333333333e-02 +324 581 8.33333333333333e-02 +324 671 -4.16666666666667e-02 +324 325 -1.66666666666667e-01 +324 580 8.33333333333333e-02 +324 313 -8.33333333333333e-02 +324 124 -8.33333333333333e-02 +324 670 8.33333333333333e-02 +324 669 -1.25000000000000e-01 +324 326 -1.66666666666667e-01 +324 329 8.33333333333333e-02 +324 314 1.66666666666667e-01 +324 328 8.33333333333333e-02 +324 34 -8.33333333333333e-02 +324 674 8.33333333333333e-02 +324 327 -3.75000000000000e-01 +324 312 -2.50000000000000e-01 +325 325 1.25000000000000e+00 +325 584 8.33333333333333e-02 +325 582 8.33333333333333e-02 +325 673 -1.25000000000000e-01 +325 672 8.33333333333333e-02 +325 332 8.33333333333333e-02 +325 326 -1.66666666666667e-01 +325 331 -3.75000000000000e-01 +325 330 8.33333333333333e-02 +325 576 -8.33333333333333e-02 +325 671 8.33333333333333e-02 +325 324 -1.66666666666667e-01 +325 581 -1.66666666666667e-01 +325 314 1.66666666666667e-01 +325 579 8.33333333333333e-02 +325 312 -8.33333333333333e-02 +325 125 4.16666666666667e-02 +325 578 -8.33333333333333e-02 +325 670 -3.75000000000000e-01 +325 123 -8.33333333333333e-02 +325 669 8.33333333333333e-02 +325 329 -4.16666666666667e-02 +325 35 4.16666666666667e-02 +325 674 -4.16666666666667e-02 +325 328 -1.25000000000000e-01 +325 313 -2.50000000000000e-01 +325 327 8.33333333333333e-02 +325 33 -8.33333333333333e-02 +326 326 1.25000000000000e+00 +326 583 8.33333333333333e-02 +326 672 8.33333333333333e-02 +326 582 -1.66666666666667e-01 +326 674 -1.25000000000000e-01 +326 123 4.16666666666667e-02 +326 332 -1.25000000000000e-01 +326 331 8.33333333333333e-02 +326 325 -1.66666666666667e-01 +326 330 -4.16666666666667e-02 +326 33 4.16666666666667e-02 +326 576 -8.33333333333333e-02 +326 670 8.33333333333333e-02 +326 579 8.33333333333333e-02 +326 669 -4.16666666666667e-02 +326 580 -1.66666666666667e-01 +326 313 1.66666666666667e-01 +326 671 -1.25000000000000e-01 +326 124 4.16666666666667e-02 +326 577 -8.33333333333333e-02 +326 673 -4.16666666666667e-02 +326 329 -1.25000000000000e-01 +326 314 -7.50000000000000e-01 +326 328 -4.16666666666667e-02 +326 34 4.16666666666667e-02 +326 324 -1.66666666666667e-01 +326 327 8.33333333333333e-02 +326 312 1.66666666666667e-01 +327 327 1.25000000000000e+00 +327 316 -8.33333333333333e-02 +327 329 -1.66666666666667e-01 +327 317 1.66666666666667e-01 +327 35 -4.16666666666667e-02 +327 34 8.33333333333333e-02 +327 33 -1.25000000000000e-01 +327 315 -2.50000000000000e-01 +327 128 -4.16666666666667e-02 +327 602 8.33333333333333e-02 +327 328 -1.66666666666667e-01 +327 127 8.33333333333333e-02 +327 601 8.33333333333333e-02 +327 126 -1.25000000000000e-01 +327 581 -8.33333333333333e-02 +327 671 4.16666666666667e-02 +327 580 -8.33333333333333e-02 +327 313 8.33333333333333e-02 +327 670 -8.33333333333333e-02 +327 326 8.33333333333333e-02 +327 314 -1.66666666666667e-01 +327 325 8.33333333333333e-02 +327 324 -3.75000000000000e-01 +327 1250 8.33333333333333e-02 +327 905 4.16666666666667e-02 +327 904 -8.33333333333333e-02 +327 1249 8.33333333333333e-02 +327 1248 -3.75000000000000e-01 +328 328 1.25000000000000e+00 +328 315 -8.33333333333333e-02 +328 35 8.33333333333333e-02 +328 329 -1.66666666666667e-01 +328 317 1.66666666666667e-01 +328 34 -3.75000000000000e-01 +328 316 -2.50000000000000e-01 +328 33 8.33333333333333e-02 +328 128 8.33333333333333e-02 +328 602 -1.66666666666667e-01 +328 600 8.33333333333333e-02 +328 127 -3.75000000000000e-01 +328 327 -1.66666666666667e-01 +328 126 8.33333333333333e-02 +328 579 -8.33333333333333e-02 +328 312 8.33333333333333e-02 +328 671 4.16666666666667e-02 +328 581 -8.33333333333333e-02 +328 669 -8.33333333333333e-02 +328 326 -4.16666666666667e-02 +328 314 8.33333333333333e-02 +328 325 -1.25000000000000e-01 +328 324 8.33333333333333e-02 +328 905 4.16666666666667e-02 +328 1250 -4.16666666666667e-02 +328 903 -8.33333333333333e-02 +328 1249 -1.25000000000000e-01 +328 1248 8.33333333333333e-02 +329 329 1.25000000000000e+00 +329 327 -1.66666666666667e-01 +329 315 1.66666666666667e-01 +329 35 -1.25000000000000e-01 +329 317 -7.50000000000000e-01 +329 34 8.33333333333333e-02 +329 328 -1.66666666666667e-01 +329 316 1.66666666666667e-01 +329 33 -4.16666666666667e-02 +329 128 -1.25000000000000e-01 +329 127 8.33333333333333e-02 +329 601 -1.66666666666667e-01 +329 126 -4.16666666666667e-02 +329 600 8.33333333333333e-02 +329 579 -8.33333333333333e-02 +329 669 4.16666666666667e-02 +329 670 4.16666666666667e-02 +329 580 -8.33333333333333e-02 +329 326 -1.25000000000000e-01 +329 325 -4.16666666666667e-02 +329 313 8.33333333333333e-02 +329 324 8.33333333333333e-02 +329 312 -1.66666666666667e-01 +329 1249 -4.16666666666667e-02 +329 1248 8.33333333333333e-02 +329 903 4.16666666666667e-02 +329 904 4.16666666666667e-02 +329 1250 -1.25000000000000e-01 +330 330 7.50000000000000e-01 +330 638 -8.33333333333333e-02 +330 637 4.16666666666667e-02 +330 332 -8.33333333333333e-02 +330 320 8.33333333333333e-02 +330 35 4.16666666666667e-02 +330 319 -4.16666666666667e-02 +330 318 -1.25000000000000e-01 +330 583 -8.33333333333333e-02 +330 313 8.33333333333333e-02 +330 674 4.16666666666667e-02 +330 584 -8.33333333333333e-02 +330 133 4.16666666666667e-02 +330 673 -8.33333333333333e-02 +330 132 -2.50000000000000e-01 +330 326 -4.16666666666667e-02 +330 314 8.33333333333333e-02 +330 331 -8.33333333333333e-02 +330 325 8.33333333333333e-02 +330 34 4.16666666666667e-02 +330 134 4.16666666666667e-02 +330 324 -1.25000000000000e-01 +330 33 -2.50000000000000e-01 +331 331 6.66666666666667e-01 +331 636 4.16666666666667e-02 +331 320 8.33333333333333e-02 +331 319 -1.25000000000000e-01 +331 318 -4.16666666666667e-02 +331 674 4.16666666666667e-02 +331 584 -8.33333333333333e-02 +331 582 -8.33333333333333e-02 +331 312 8.33333333333333e-02 +331 133 -8.33333333333333e-02 +331 132 4.16666666666667e-02 +331 672 -8.33333333333333e-02 +331 326 8.33333333333333e-02 +331 314 -1.66666666666667e-01 +331 638 4.16666666666667e-02 +331 325 -3.75000000000000e-01 +331 34 -8.33333333333333e-02 +331 330 -8.33333333333333e-02 +331 324 8.33333333333333e-02 +331 33 4.16666666666667e-02 +332 332 6.66666666666667e-01 +332 132 4.16666666666667e-02 +332 636 -8.33333333333333e-02 +332 320 -3.75000000000000e-01 +332 319 8.33333333333333e-02 +332 330 -8.33333333333333e-02 +332 318 8.33333333333333e-02 +332 33 4.16666666666667e-02 +332 673 4.16666666666667e-02 +332 583 -8.33333333333333e-02 +332 134 -8.33333333333333e-02 +332 672 4.16666666666667e-02 +332 582 -8.33333333333333e-02 +332 637 4.16666666666667e-02 +332 326 -1.25000000000000e-01 +332 35 -8.33333333333333e-02 +332 325 8.33333333333333e-02 +332 313 -1.66666666666667e-01 +332 324 -4.16666666666667e-02 +332 312 8.33333333333333e-02 +333 333 1.25000000000000e+00 +333 377 -8.33333333333333e-02 +333 349 8.33333333333333e-02 +333 376 -8.33333333333333e-02 +333 373 -8.33333333333333e-02 +333 344 8.33333333333333e-02 +333 350 -1.66666666666667e-01 +333 343 8.33333333333333e-02 +333 342 -3.75000000000000e-01 +333 143 8.33333333333333e-02 +333 335 -1.66666666666667e-01 +333 341 1.66666666666667e-01 +333 370 8.33333333333333e-02 +333 340 -8.33333333333333e-02 +333 38 -4.16666666666667e-02 +333 137 4.16666666666667e-02 +333 37 8.33333333333333e-02 +333 136 -8.33333333333333e-02 +333 36 -1.25000000000000e-01 +333 339 -2.50000000000000e-01 +333 44 -4.16666666666667e-02 +333 371 8.33333333333333e-02 +333 334 -1.66666666666667e-01 +333 43 8.33333333333333e-02 +333 142 8.33333333333333e-02 +333 374 4.16666666666667e-02 +333 42 -1.25000000000000e-01 +333 141 -3.75000000000000e-01 +334 334 1.25000000000000e+00 +334 375 -8.33333333333333e-02 +334 374 4.16666666666667e-02 +334 377 -8.33333333333333e-02 +334 372 -8.33333333333333e-02 +334 344 -4.16666666666667e-02 +334 350 8.33333333333333e-02 +334 343 -1.25000000000000e-01 +334 342 8.33333333333333e-02 +334 143 -4.16666666666667e-02 +334 137 4.16666666666667e-02 +334 369 8.33333333333333e-02 +334 339 -8.33333333333333e-02 +334 38 8.33333333333333e-02 +334 335 -1.66666666666667e-01 +334 341 1.66666666666667e-01 +334 37 -3.75000000000000e-01 +334 340 -2.50000000000000e-01 +334 36 8.33333333333333e-02 +334 135 -8.33333333333333e-02 +334 44 8.33333333333333e-02 +334 371 -1.66666666666667e-01 +334 348 8.33333333333333e-02 +334 43 -3.75000000000000e-01 +334 142 -1.25000000000000e-01 +334 333 -1.66666666666667e-01 +334 42 8.33333333333333e-02 +334 141 8.33333333333333e-02 +335 335 1.25000000000000e+00 +335 375 -8.33333333333333e-02 +335 373 4.16666666666667e-02 +335 376 -8.33333333333333e-02 +335 344 -1.25000000000000e-01 +335 343 -4.16666666666667e-02 +335 349 8.33333333333333e-02 +335 342 8.33333333333333e-02 +335 348 -1.66666666666667e-01 +335 142 -4.16666666666667e-02 +335 136 4.16666666666667e-02 +335 141 8.33333333333333e-02 +335 333 -1.66666666666667e-01 +335 339 1.66666666666667e-01 +335 38 -1.25000000000000e-01 +335 341 -7.50000000000000e-01 +335 37 8.33333333333333e-02 +335 334 -1.66666666666667e-01 +335 340 1.66666666666667e-01 +335 36 -4.16666666666667e-02 +335 135 4.16666666666667e-02 +335 372 4.16666666666667e-02 +335 44 -1.25000000000000e-01 +335 143 -1.25000000000000e-01 +335 43 8.33333333333333e-02 +335 370 -1.66666666666667e-01 +335 42 -4.16666666666667e-02 +335 369 8.33333333333333e-02 +336 336 1.25000000000000e+00 +336 347 8.33333333333333e-02 +336 346 8.33333333333333e-02 +336 345 -3.75000000000000e-01 +336 410 -8.33333333333333e-02 +336 412 -8.33333333333333e-02 +336 350 8.33333333333333e-02 +336 349 -1.66666666666667e-01 +336 413 -8.33333333333333e-02 +336 407 8.33333333333333e-02 +336 341 -8.33333333333333e-02 +336 337 -1.66666666666667e-01 +336 340 1.66666666666667e-01 +336 148 8.33333333333333e-02 +336 38 8.33333333333333e-02 +336 137 -8.33333333333333e-02 +336 37 -4.16666666666667e-02 +336 136 4.16666666666667e-02 +336 36 -1.25000000000000e-01 +336 339 -2.50000000000000e-01 +336 338 -1.66666666666667e-01 +336 50 8.33333333333333e-02 +336 149 8.33333333333333e-02 +336 49 -4.16666666666667e-02 +336 406 8.33333333333333e-02 +336 409 4.16666666666667e-02 +336 48 -1.25000000000000e-01 +336 147 -3.75000000000000e-01 +337 337 1.25000000000000e+00 +337 347 -4.16666666666667e-02 +337 346 -1.25000000000000e-01 +337 345 8.33333333333333e-02 +337 410 4.16666666666667e-02 +337 350 8.33333333333333e-02 +337 413 -8.33333333333333e-02 +337 411 -8.33333333333333e-02 +337 348 -1.66666666666667e-01 +337 137 4.16666666666667e-02 +337 149 -4.16666666666667e-02 +337 336 -1.66666666666667e-01 +337 339 1.66666666666667e-01 +337 147 8.33333333333333e-02 +337 38 8.33333333333333e-02 +337 338 -1.66666666666667e-01 +337 341 1.66666666666667e-01 +337 37 -1.25000000000000e-01 +337 340 -7.50000000000000e-01 +337 36 -4.16666666666667e-02 +337 135 4.16666666666667e-02 +337 50 8.33333333333333e-02 +337 407 -1.66666666666667e-01 +337 408 4.16666666666667e-02 +337 49 -1.25000000000000e-01 +337 148 -1.25000000000000e-01 +337 48 -4.16666666666667e-02 +337 405 8.33333333333333e-02 +338 338 1.25000000000000e+00 +338 346 -4.16666666666667e-02 +338 345 8.33333333333333e-02 +338 409 4.16666666666667e-02 +338 408 -8.33333333333333e-02 +338 349 8.33333333333333e-02 +338 412 -8.33333333333333e-02 +338 348 8.33333333333333e-02 +338 411 -8.33333333333333e-02 +338 405 8.33333333333333e-02 +338 339 -8.33333333333333e-02 +338 136 4.16666666666667e-02 +338 148 -4.16666666666667e-02 +338 38 -3.75000000000000e-01 +338 341 -2.50000000000000e-01 +338 37 8.33333333333333e-02 +338 337 -1.66666666666667e-01 +338 340 1.66666666666667e-01 +338 36 8.33333333333333e-02 +338 135 -8.33333333333333e-02 +338 347 -1.25000000000000e-01 +338 50 -3.75000000000000e-01 +338 149 -1.25000000000000e-01 +338 49 8.33333333333333e-02 +338 406 -1.66666666666667e-01 +338 336 -1.66666666666667e-01 +338 48 8.33333333333333e-02 +338 147 8.33333333333333e-02 +339 339 2.50000000000000e+00 +339 376 -1.66666666666667e-01 +339 335 1.66666666666667e-01 +339 142 8.33333333333333e-02 +339 334 -8.33333333333333e-02 +339 143 -1.66666666666667e-01 +339 333 -2.50000000000000e-01 +339 371 -8.33333333333333e-02 +339 370 1.66666666666667e-01 +339 369 -2.50000000000000e-01 +339 442 -8.33333333333333e-02 +339 350 1.66666666666667e-01 +339 413 -1.66666666666667e-01 +339 412 8.33333333333333e-02 +339 38 8.33333333333333e-02 +339 349 1.66666666666667e-01 +339 340 -3.33333333333333e-01 +339 348 -7.50000000000000e-01 +339 443 -8.33333333333333e-02 +339 56 8.33333333333333e-02 +339 338 -8.33333333333333e-02 +339 337 1.66666666666667e-01 +339 137 -8.33333333333333e-02 +339 149 8.33333333333333e-02 +339 154 1.66666666666667e-01 +339 148 -1.66666666666667e-01 +339 37 8.33333333333333e-02 +339 136 -8.33333333333333e-02 +339 336 -2.50000000000000e-01 +339 341 -3.33333333333333e-01 +339 407 1.66666666666667e-01 +339 155 1.66666666666667e-01 +339 406 -8.33333333333333e-02 +339 55 8.33333333333333e-02 +339 377 8.33333333333333e-02 +339 405 -2.50000000000000e-01 +339 153 -7.50000000000000e-01 +340 340 2.50000000000000e+00 +340 375 -1.66666666666667e-01 +340 141 8.33333333333333e-02 +340 333 -8.33333333333333e-02 +340 143 8.33333333333333e-02 +340 335 1.66666666666667e-01 +340 334 -2.50000000000000e-01 +340 371 1.66666666666667e-01 +340 370 -7.50000000000000e-01 +340 369 1.66666666666667e-01 +340 443 -8.33333333333333e-02 +340 441 -8.33333333333333e-02 +340 350 -8.33333333333333e-02 +340 413 8.33333333333333e-02 +340 411 8.33333333333333e-02 +340 349 -2.50000000000000e-01 +340 348 1.66666666666667e-01 +340 339 -3.33333333333333e-01 +340 155 -8.33333333333333e-02 +340 341 -3.33333333333333e-01 +340 137 -8.33333333333333e-02 +340 149 8.33333333333333e-02 +340 336 1.66666666666667e-01 +340 153 1.66666666666667e-01 +340 147 -1.66666666666667e-01 +340 38 -1.66666666666667e-01 +340 338 1.66666666666667e-01 +340 337 -7.50000000000000e-01 +340 36 8.33333333333333e-02 +340 135 -8.33333333333333e-02 +340 407 1.66666666666667e-01 +340 56 -1.66666666666667e-01 +340 377 8.33333333333333e-02 +340 406 -2.50000000000000e-01 +340 154 -2.50000000000000e-01 +340 405 -8.33333333333333e-02 +340 54 8.33333333333333e-02 +341 341 2.50000000000000e+00 +341 375 8.33333333333333e-02 +341 333 1.66666666666667e-01 +341 142 8.33333333333333e-02 +341 141 -1.66666666666667e-01 +341 335 -7.50000000000000e-01 +341 334 1.66666666666667e-01 +341 371 -2.50000000000000e-01 +341 370 1.66666666666667e-01 +341 369 -8.33333333333333e-02 +341 442 -8.33333333333333e-02 +341 349 -8.33333333333333e-02 +341 412 8.33333333333333e-02 +341 348 1.66666666666667e-01 +341 411 -1.66666666666667e-01 +341 350 -2.50000000000000e-01 +341 36 8.33333333333333e-02 +341 441 -8.33333333333333e-02 +341 54 8.33333333333333e-02 +341 154 -8.33333333333333e-02 +341 340 -3.33333333333333e-01 +341 336 -8.33333333333333e-02 +341 136 -8.33333333333333e-02 +341 148 8.33333333333333e-02 +341 135 -8.33333333333333e-02 +341 147 8.33333333333333e-02 +341 338 -2.50000000000000e-01 +341 37 -1.66666666666667e-01 +341 337 1.66666666666667e-01 +341 376 8.33333333333333e-02 +341 407 -7.50000000000000e-01 +341 155 -2.50000000000000e-01 +341 406 1.66666666666667e-01 +341 55 -1.66666666666667e-01 +341 339 -3.33333333333333e-01 +341 405 1.66666666666667e-01 +341 153 1.66666666666667e-01 +342 342 1.25000000000000e+00 +342 376 8.33333333333333e-02 +342 377 8.33333333333333e-02 +342 335 8.33333333333333e-02 +342 344 -1.66666666666667e-01 +342 334 8.33333333333333e-02 +342 333 -3.75000000000000e-01 +342 373 8.33333333333333e-02 +342 372 -1.25000000000000e-01 +342 349 -8.33333333333333e-02 +342 343 -1.66666666666667e-01 +342 164 8.33333333333333e-02 +342 481 -8.33333333333333e-02 +342 175 8.33333333333333e-02 +342 350 1.66666666666667e-01 +342 176 -1.66666666666667e-01 +342 62 4.16666666666667e-02 +342 482 -8.33333333333333e-02 +342 163 8.33333333333333e-02 +342 61 -8.33333333333333e-02 +342 162 -3.75000000000000e-01 +342 158 -4.16666666666667e-02 +342 38 4.16666666666667e-02 +342 157 8.33333333333333e-02 +342 37 -8.33333333333333e-02 +342 156 -1.25000000000000e-01 +342 374 -4.16666666666667e-02 +342 348 -2.50000000000000e-01 +343 343 1.25000000000000e+00 +343 375 8.33333333333333e-02 +343 377 -1.66666666666667e-01 +343 335 -4.16666666666667e-02 +343 38 4.16666666666667e-02 +343 334 -1.25000000000000e-01 +343 333 8.33333333333333e-02 +343 62 4.16666666666667e-02 +343 373 -3.75000000000000e-01 +343 372 8.33333333333333e-02 +343 348 -8.33333333333333e-02 +343 164 -4.16666666666667e-02 +343 342 -1.66666666666667e-01 +343 480 -8.33333333333333e-02 +343 174 8.33333333333333e-02 +343 482 -8.33333333333333e-02 +343 176 8.33333333333333e-02 +343 163 -1.25000000000000e-01 +343 162 8.33333333333333e-02 +343 60 -8.33333333333333e-02 +343 158 8.33333333333333e-02 +343 344 -1.66666666666667e-01 +343 350 1.66666666666667e-01 +343 157 -3.75000000000000e-01 +343 374 8.33333333333333e-02 +343 349 -2.50000000000000e-01 +343 156 8.33333333333333e-02 +343 36 -8.33333333333333e-02 +344 344 1.25000000000000e+00 +344 372 -4.16666666666667e-02 +344 376 -1.66666666666667e-01 +344 375 8.33333333333333e-02 +344 335 -1.25000000000000e-01 +344 334 -4.16666666666667e-02 +344 37 4.16666666666667e-02 +344 333 8.33333333333333e-02 +344 342 -1.66666666666667e-01 +344 374 -1.25000000000000e-01 +344 61 4.16666666666667e-02 +344 163 -4.16666666666667e-02 +344 162 8.33333333333333e-02 +344 481 -8.33333333333333e-02 +344 175 8.33333333333333e-02 +344 348 1.66666666666667e-01 +344 174 -1.66666666666667e-01 +344 164 -1.25000000000000e-01 +344 60 4.16666666666667e-02 +344 480 -8.33333333333333e-02 +344 158 -1.25000000000000e-01 +344 373 8.33333333333333e-02 +344 350 -7.50000000000000e-01 +344 157 8.33333333333333e-02 +344 343 -1.66666666666667e-01 +344 349 1.66666666666667e-01 +344 156 -4.16666666666667e-02 +344 36 4.16666666666667e-02 +345 345 1.25000000000000e+00 +345 409 -4.16666666666667e-02 +345 412 8.33333333333333e-02 +345 410 8.33333333333333e-02 +345 408 -1.25000000000000e-01 +345 338 8.33333333333333e-02 +345 346 -1.66666666666667e-01 +345 337 8.33333333333333e-02 +345 336 -3.75000000000000e-01 +345 518 -8.33333333333333e-02 +345 347 -1.66666666666667e-01 +345 169 8.33333333333333e-02 +345 176 8.33333333333333e-02 +345 350 -8.33333333333333e-02 +345 175 -1.66666666666667e-01 +345 349 1.66666666666667e-01 +345 170 8.33333333333333e-02 +345 68 -8.33333333333333e-02 +345 67 4.16666666666667e-02 +345 517 -8.33333333333333e-02 +345 168 -3.75000000000000e-01 +345 158 8.33333333333333e-02 +345 38 -8.33333333333333e-02 +345 157 -4.16666666666667e-02 +345 37 4.16666666666667e-02 +345 156 -1.25000000000000e-01 +345 413 8.33333333333333e-02 +345 348 -2.50000000000000e-01 +346 346 1.25000000000000e+00 +346 413 -1.66666666666667e-01 +346 408 -4.16666666666667e-02 +346 411 8.33333333333333e-02 +346 68 4.16666666666667e-02 +346 409 -1.25000000000000e-01 +346 38 4.16666666666667e-02 +346 338 -4.16666666666667e-02 +346 337 -1.25000000000000e-01 +346 345 -1.66666666666667e-01 +346 336 8.33333333333333e-02 +346 518 -8.33333333333333e-02 +346 170 -4.16666666666667e-02 +346 176 8.33333333333333e-02 +346 168 8.33333333333333e-02 +346 174 -1.66666666666667e-01 +346 348 1.66666666666667e-01 +346 169 -1.25000000000000e-01 +346 66 4.16666666666667e-02 +346 516 -8.33333333333333e-02 +346 158 8.33333333333333e-02 +346 347 -1.66666666666667e-01 +346 350 1.66666666666667e-01 +346 157 -1.25000000000000e-01 +346 410 8.33333333333333e-02 +346 349 -7.50000000000000e-01 +346 156 -4.16666666666667e-02 +346 36 4.16666666666667e-02 +347 347 1.25000000000000e+00 +347 409 8.33333333333333e-02 +347 412 -1.66666666666667e-01 +347 410 -3.75000000000000e-01 +347 67 4.16666666666667e-02 +347 408 8.33333333333333e-02 +347 338 -1.25000000000000e-01 +347 37 4.16666666666667e-02 +347 337 -4.16666666666667e-02 +347 336 8.33333333333333e-02 +347 517 -8.33333333333333e-02 +347 516 -8.33333333333333e-02 +347 169 -4.16666666666667e-02 +347 175 8.33333333333333e-02 +347 345 -1.66666666666667e-01 +347 174 8.33333333333333e-02 +347 348 -8.33333333333333e-02 +347 170 -1.25000000000000e-01 +347 168 8.33333333333333e-02 +347 66 -8.33333333333333e-02 +347 158 -3.75000000000000e-01 +347 411 8.33333333333333e-02 +347 350 -2.50000000000000e-01 +347 157 8.33333333333333e-02 +347 346 -1.66666666666667e-01 +347 349 1.66666666666667e-01 +347 156 8.33333333333333e-02 +347 36 -8.33333333333333e-02 +348 348 2.50000000000000e+00 +348 377 -8.33333333333333e-02 +348 335 -1.66666666666667e-01 +348 376 1.66666666666667e-01 +348 375 -2.50000000000000e-01 +348 343 -8.33333333333333e-02 +348 344 1.66666666666667e-01 +348 342 -2.50000000000000e-01 +348 482 8.33333333333333e-02 +348 481 -1.66666666666667e-01 +348 442 8.33333333333333e-02 +348 412 -8.33333333333333e-02 +348 350 -3.33333333333333e-01 +348 341 1.66666666666667e-01 +348 413 1.66666666666667e-01 +348 38 -8.33333333333333e-02 +348 338 8.33333333333333e-02 +348 340 1.66666666666667e-01 +348 337 -1.66666666666667e-01 +348 339 -7.50000000000000e-01 +348 74 -8.33333333333333e-02 +348 443 8.33333333333333e-02 +348 411 -2.50000000000000e-01 +348 158 8.33333333333333e-02 +348 347 -8.33333333333333e-02 +348 175 1.66666666666667e-01 +348 349 -3.33333333333333e-01 +348 346 1.66666666666667e-01 +348 176 1.66666666666667e-01 +348 518 -1.66666666666667e-01 +348 517 8.33333333333333e-02 +348 73 -8.33333333333333e-02 +348 174 -7.50000000000000e-01 +348 157 8.33333333333333e-02 +348 37 -8.33333333333333e-02 +348 345 -2.50000000000000e-01 +348 334 8.33333333333333e-02 +349 349 2.50000000000000e+00 +349 377 1.66666666666667e-01 +349 335 8.33333333333333e-02 +349 376 -7.50000000000000e-01 +349 375 1.66666666666667e-01 +349 342 -8.33333333333333e-02 +349 482 8.33333333333333e-02 +349 344 1.66666666666667e-01 +349 343 -2.50000000000000e-01 +349 480 -1.66666666666667e-01 +349 350 -3.33333333333333e-01 +349 74 -8.33333333333333e-02 +349 38 -8.33333333333333e-02 +349 441 8.33333333333333e-02 +349 411 -8.33333333333333e-02 +349 341 -8.33333333333333e-02 +349 338 8.33333333333333e-02 +349 340 -2.50000000000000e-01 +349 339 1.66666666666667e-01 +349 336 -1.66666666666667e-01 +349 443 -1.66666666666667e-01 +349 413 1.66666666666667e-01 +349 412 -2.50000000000000e-01 +349 176 -8.33333333333333e-02 +349 518 8.33333333333333e-02 +349 174 1.66666666666667e-01 +349 348 -3.33333333333333e-01 +349 345 1.66666666666667e-01 +349 175 -2.50000000000000e-01 +349 516 8.33333333333333e-02 +349 72 -8.33333333333333e-02 +349 158 -1.66666666666667e-01 +349 347 1.66666666666667e-01 +349 346 -7.50000000000000e-01 +349 333 8.33333333333333e-02 +349 156 8.33333333333333e-02 +349 36 -8.33333333333333e-02 +350 350 2.50000000000000e+00 +350 375 -8.33333333333333e-02 +350 334 8.33333333333333e-02 +350 333 -1.66666666666667e-01 +350 377 -2.50000000000000e-01 +350 481 8.33333333333333e-02 +350 342 1.66666666666667e-01 +350 344 -7.50000000000000e-01 +350 343 1.66666666666667e-01 +350 480 8.33333333333333e-02 +350 349 -3.33333333333333e-01 +350 73 -8.33333333333333e-02 +350 37 -8.33333333333333e-02 +350 340 -8.33333333333333e-02 +350 337 8.33333333333333e-02 +350 348 -3.33333333333333e-01 +350 339 1.66666666666667e-01 +350 411 1.66666666666667e-01 +350 341 -2.50000000000000e-01 +350 36 -8.33333333333333e-02 +350 336 8.33333333333333e-02 +350 413 -7.50000000000000e-01 +350 442 -1.66666666666667e-01 +350 412 1.66666666666667e-01 +350 72 -8.33333333333333e-02 +350 441 8.33333333333333e-02 +350 175 -8.33333333333333e-02 +350 517 8.33333333333333e-02 +350 156 8.33333333333333e-02 +350 345 -8.33333333333333e-02 +350 176 -2.50000000000000e-01 +350 174 1.66666666666667e-01 +350 516 -1.66666666666667e-01 +350 347 -2.50000000000000e-01 +350 376 1.66666666666667e-01 +350 157 -1.66666666666667e-01 +350 346 1.66666666666667e-01 +351 351 1.25000000000000e+00 +351 382 -8.33333333333333e-02 +351 362 -4.16666666666667e-02 +351 368 8.33333333333333e-02 +351 361 8.33333333333333e-02 +351 360 -1.25000000000000e-01 +351 380 4.16666666666667e-02 +351 383 -8.33333333333333e-02 +351 379 -8.33333333333333e-02 +351 140 4.16666666666667e-02 +351 143 -4.16666666666667e-02 +351 370 8.33333333333333e-02 +351 358 -8.33333333333333e-02 +351 44 8.33333333333333e-02 +351 371 -1.66666666666667e-01 +351 43 8.33333333333333e-02 +351 352 -1.66666666666667e-01 +351 142 8.33333333333333e-02 +351 42 -3.75000000000000e-01 +351 141 -1.25000000000000e-01 +351 353 -1.66666666666667e-01 +351 41 8.33333333333333e-02 +351 359 1.66666666666667e-01 +351 40 8.33333333333333e-02 +351 139 -8.33333333333333e-02 +351 367 8.33333333333333e-02 +351 39 -3.75000000000000e-01 +351 357 -2.50000000000000e-01 +352 352 1.25000000000000e+00 +352 383 -8.33333333333333e-02 +352 366 8.33333333333333e-02 +352 381 -8.33333333333333e-02 +352 362 8.33333333333333e-02 +352 368 -1.66666666666667e-01 +352 361 -3.75000000000000e-01 +352 360 8.33333333333333e-02 +352 378 -8.33333333333333e-02 +352 353 -1.66666666666667e-01 +352 143 8.33333333333333e-02 +352 359 1.66666666666667e-01 +352 369 8.33333333333333e-02 +352 357 -8.33333333333333e-02 +352 44 -4.16666666666667e-02 +352 371 8.33333333333333e-02 +352 43 -1.25000000000000e-01 +352 142 -3.75000000000000e-01 +352 42 8.33333333333333e-02 +352 351 -1.66666666666667e-01 +352 141 8.33333333333333e-02 +352 41 -4.16666666666667e-02 +352 140 4.16666666666667e-02 +352 380 4.16666666666667e-02 +352 40 -1.25000000000000e-01 +352 358 -2.50000000000000e-01 +352 39 8.33333333333333e-02 +352 138 -8.33333333333333e-02 +353 353 1.25000000000000e+00 +353 382 -8.33333333333333e-02 +353 362 -1.25000000000000e-01 +353 361 8.33333333333333e-02 +353 367 -1.66666666666667e-01 +353 360 -4.16666666666667e-02 +353 366 8.33333333333333e-02 +353 378 4.16666666666667e-02 +353 381 -8.33333333333333e-02 +353 138 4.16666666666667e-02 +353 141 -4.16666666666667e-02 +353 352 -1.66666666666667e-01 +353 142 8.33333333333333e-02 +353 358 1.66666666666667e-01 +353 44 -1.25000000000000e-01 +353 143 -1.25000000000000e-01 +353 43 -4.16666666666667e-02 +353 370 8.33333333333333e-02 +353 42 8.33333333333333e-02 +353 369 -1.66666666666667e-01 +353 379 4.16666666666667e-02 +353 41 -1.25000000000000e-01 +353 359 -7.50000000000000e-01 +353 40 -4.16666666666667e-02 +353 139 4.16666666666667e-02 +353 351 -1.66666666666667e-01 +353 39 8.33333333333333e-02 +353 357 1.66666666666667e-01 +354 354 6.37500000000000e+01 +354 428 2.12500000000000e+00 +354 364 4.25000000000000e+00 +354 355 -8.50000000000000e+00 +354 41 4.25000000000000e+00 +354 40 -2.12500000000000e+00 +354 363 -6.37500000000000e+00 +354 356 -8.50000000000000e+00 +354 53 4.25000000000000e+00 +354 427 2.12500000000000e+00 +354 52 -2.12500000000000e+00 +354 139 2.12500000000000e+00 +354 140 2.12500000000000e+00 +354 39 -6.37500000000000e+00 +354 152 -2.12500000000000e+00 +354 151 4.25000000000000e+00 +354 150 -6.37500000000000e+00 +354 365 -2.12500000000000e+00 +354 51 -6.37500000000000e+00 +354 368 8.33333333333333e-02 +354 431 -8.33333333333333e-02 +354 430 -8.33333333333333e-02 +354 367 -1.66666666666667e-01 +354 358 1.66666666666667e-01 +354 425 -1.66666666666667e-01 +354 424 8.33333333333333e-02 +354 359 1.66666666666667e-01 +354 357 -7.50000000000000e-01 +354 1720 8.33333333333333e+00 +354 1718 -8.33333333333333e+00 +354 1717 4.16666666666667e+00 +354 1721 8.33333333333333e+00 +354 1719 -3.75000000000000e+01 +354 1687 -4.16666666666667e+00 +354 1688 -4.16666666666667e+00 +354 1694 4.16666666666667e+00 +354 1693 -8.33333333333333e+00 +355 355 6.37500000000000e+01 +355 363 4.25000000000000e+00 +355 354 -8.50000000000000e+00 +355 365 4.25000000000000e+00 +355 364 -1.91250000000000e+01 +355 39 -2.12500000000000e+00 +355 428 -4.25000000000000e+00 +355 426 2.12500000000000e+00 +355 51 -2.12500000000000e+00 +355 138 2.12500000000000e+00 +355 140 -4.25000000000000e+00 +355 41 4.25000000000000e+00 +355 40 -6.37500000000000e+00 +355 152 4.25000000000000e+00 +355 356 -8.50000000000000e+00 +355 53 4.25000000000000e+00 +355 151 -1.91250000000000e+01 +355 52 -6.37500000000000e+00 +355 150 4.25000000000000e+00 +355 429 -8.33333333333333e-02 +355 368 8.33333333333333e-02 +355 366 -1.66666666666667e-01 +355 431 -8.33333333333333e-02 +355 359 -8.33333333333333e-02 +355 425 8.33333333333333e-02 +355 357 1.66666666666667e-01 +355 423 8.33333333333333e-02 +355 358 -2.50000000000000e-01 +355 1721 -4.16666666666667e+00 +355 1719 8.33333333333333e+00 +355 1716 4.16666666666667e+00 +355 1720 -1.25000000000000e+01 +355 1686 -4.16666666666667e+00 +355 1688 -4.16666666666667e+00 +355 1694 4.16666666666667e+00 +355 1718 4.16666666666667e+00 +355 1692 -8.33333333333333e+00 +356 356 6.37500000000000e+01 +356 363 -2.12500000000000e+00 +356 426 2.12500000000000e+00 +356 365 -6.37500000000000e+00 +356 364 4.25000000000000e+00 +356 39 4.25000000000000e+00 +356 427 -4.25000000000000e+00 +356 354 -8.50000000000000e+00 +356 51 4.25000000000000e+00 +356 41 -1.91250000000000e+01 +356 139 -4.25000000000000e+00 +356 40 4.25000000000000e+00 +356 138 2.12500000000000e+00 +356 152 -6.37500000000000e+00 +356 53 -1.91250000000000e+01 +356 151 4.25000000000000e+00 +356 355 -8.50000000000000e+00 +356 52 4.25000000000000e+00 +356 150 -2.12500000000000e+00 +356 366 8.33333333333333e-02 +356 429 -8.33333333333333e-02 +356 367 8.33333333333333e-02 +356 430 -8.33333333333333e-02 +356 358 -8.33333333333333e-02 +356 424 8.33333333333333e-02 +356 423 -1.66666666666667e-01 +356 359 -2.50000000000000e-01 +356 357 1.66666666666667e-01 +356 1720 -4.16666666666667e+00 +356 1716 -8.33333333333333e+00 +356 1721 -1.25000000000000e+01 +356 1719 8.33333333333333e+00 +356 1687 -4.16666666666667e+00 +356 1693 4.16666666666667e+00 +356 1686 -4.16666666666667e+00 +356 1717 4.16666666666667e+00 +356 1692 4.16666666666667e+00 +357 357 2.50000000000000e+00 +357 382 -1.66666666666667e-01 +357 352 -8.33333333333333e-02 +357 142 8.33333333333333e-02 +357 143 8.33333333333333e-02 +357 353 1.66666666666667e-01 +357 351 -2.50000000000000e-01 +357 371 1.66666666666667e-01 +357 370 1.66666666666667e-01 +357 369 -7.50000000000000e-01 +357 446 -8.33333333333333e-02 +357 445 -8.33333333333333e-02 +357 368 -8.33333333333333e-02 +357 431 8.33333333333333e-02 +357 430 8.33333333333333e-02 +357 367 1.66666666666667e-01 +357 358 -3.33333333333333e-01 +357 366 -2.50000000000000e-01 +357 155 -8.33333333333333e-02 +357 359 -3.33333333333333e-01 +357 140 -8.33333333333333e-02 +357 152 8.33333333333333e-02 +357 355 1.66666666666667e-01 +357 154 1.66666666666667e-01 +357 151 -1.66666666666667e-01 +357 356 1.66666666666667e-01 +357 41 -1.66666666666667e-01 +357 40 8.33333333333333e-02 +357 139 -8.33333333333333e-02 +357 354 -7.50000000000000e-01 +357 425 1.66666666666667e-01 +357 56 -1.66666666666667e-01 +357 424 -8.33333333333333e-02 +357 55 8.33333333333333e-02 +357 423 -2.50000000000000e-01 +357 383 8.33333333333333e-02 +357 153 -2.50000000000000e-01 +358 358 2.50000000000000e+00 +358 381 -1.66666666666667e-01 +358 353 1.66666666666667e-01 +358 351 -8.33333333333333e-02 +358 141 8.33333333333333e-02 +358 143 -1.66666666666667e-01 +358 352 -2.50000000000000e-01 +358 371 -8.33333333333333e-02 +358 370 -2.50000000000000e-01 +358 369 1.66666666666667e-01 +358 444 -8.33333333333333e-02 +358 368 1.66666666666667e-01 +358 431 -1.66666666666667e-01 +358 429 8.33333333333333e-02 +358 41 8.33333333333333e-02 +358 367 -7.50000000000000e-01 +358 366 1.66666666666667e-01 +358 357 -3.33333333333333e-01 +358 446 -8.33333333333333e-02 +358 56 8.33333333333333e-02 +358 356 -8.33333333333333e-02 +358 354 1.66666666666667e-01 +358 140 -8.33333333333333e-02 +358 152 8.33333333333333e-02 +358 153 1.66666666666667e-01 +358 150 -1.66666666666667e-01 +358 355 -2.50000000000000e-01 +358 39 8.33333333333333e-02 +358 138 -8.33333333333333e-02 +358 425 1.66666666666667e-01 +358 359 -3.33333333333333e-01 +358 155 1.66666666666667e-01 +358 424 -2.50000000000000e-01 +358 383 8.33333333333333e-02 +358 154 -7.50000000000000e-01 +358 423 -8.33333333333333e-02 +358 54 8.33333333333333e-02 +359 359 2.50000000000000e+00 +359 382 8.33333333333333e-02 +359 352 1.66666666666667e-01 +359 142 -1.66666666666667e-01 +359 141 8.33333333333333e-02 +359 353 -7.50000000000000e-01 +359 351 1.66666666666667e-01 +359 371 -2.50000000000000e-01 +359 370 -8.33333333333333e-02 +359 369 1.66666666666667e-01 +359 444 -8.33333333333333e-02 +359 367 1.66666666666667e-01 +359 366 -8.33333333333333e-02 +359 429 8.33333333333333e-02 +359 430 -1.66666666666667e-01 +359 368 -2.50000000000000e-01 +359 40 8.33333333333333e-02 +359 445 -8.33333333333333e-02 +359 55 8.33333333333333e-02 +359 153 -8.33333333333333e-02 +359 355 -8.33333333333333e-02 +359 357 -3.33333333333333e-01 +359 138 -8.33333333333333e-02 +359 150 8.33333333333333e-02 +359 139 -8.33333333333333e-02 +359 151 8.33333333333333e-02 +359 356 -2.50000000000000e-01 +359 354 1.66666666666667e-01 +359 39 -1.66666666666667e-01 +359 425 -7.50000000000000e-01 +359 381 8.33333333333333e-02 +359 155 -2.50000000000000e-01 +359 424 1.66666666666667e-01 +359 358 -3.33333333333333e-01 +359 154 1.66666666666667e-01 +359 423 1.66666666666667e-01 +359 54 -1.66666666666667e-01 +360 360 1.25000000000000e+00 +360 382 8.33333333333333e-02 +360 383 -1.66666666666667e-01 +360 41 4.16666666666667e-02 +360 353 -4.16666666666667e-02 +360 352 8.33333333333333e-02 +360 351 -1.25000000000000e-01 +360 89 4.16666666666667e-02 +360 379 8.33333333333333e-02 +360 378 -3.75000000000000e-01 +360 367 -8.33333333333333e-02 +360 197 -4.16666666666667e-02 +360 361 -1.66666666666667e-01 +360 604 -8.33333333333333e-02 +360 202 8.33333333333333e-02 +360 605 -8.33333333333333e-02 +360 203 8.33333333333333e-02 +360 88 -8.33333333333333e-02 +360 196 8.33333333333333e-02 +360 195 -1.25000000000000e-01 +360 362 -1.66666666666667e-01 +360 194 8.33333333333333e-02 +360 368 1.66666666666667e-01 +360 193 8.33333333333333e-02 +360 40 -8.33333333333333e-02 +360 380 8.33333333333333e-02 +360 192 -3.75000000000000e-01 +360 366 -2.50000000000000e-01 +361 361 1.25000000000000e+00 +361 381 8.33333333333333e-02 +361 383 8.33333333333333e-02 +361 353 8.33333333333333e-02 +361 362 -1.66666666666667e-01 +361 352 -3.75000000000000e-01 +361 351 8.33333333333333e-02 +361 379 -1.25000000000000e-01 +361 378 8.33333333333333e-02 +361 366 -8.33333333333333e-02 +361 360 -1.66666666666667e-01 +361 197 8.33333333333333e-02 +361 603 -8.33333333333333e-02 +361 201 8.33333333333333e-02 +361 368 1.66666666666667e-01 +361 203 -1.66666666666667e-01 +361 89 4.16666666666667e-02 +361 605 -8.33333333333333e-02 +361 196 -3.75000000000000e-01 +361 87 -8.33333333333333e-02 +361 195 8.33333333333333e-02 +361 194 -4.16666666666667e-02 +361 41 4.16666666666667e-02 +361 380 -4.16666666666667e-02 +361 193 -1.25000000000000e-01 +361 367 -2.50000000000000e-01 +361 192 8.33333333333333e-02 +361 39 -8.33333333333333e-02 +362 362 1.25000000000000e+00 +362 378 8.33333333333333e-02 +362 382 8.33333333333333e-02 +362 381 -1.66666666666667e-01 +362 353 -1.25000000000000e-01 +362 352 8.33333333333333e-02 +362 361 -1.66666666666667e-01 +362 39 4.16666666666667e-02 +362 351 -4.16666666666667e-02 +362 380 -1.25000000000000e-01 +362 87 4.16666666666667e-02 +362 195 -4.16666666666667e-02 +362 196 8.33333333333333e-02 +362 367 1.66666666666667e-01 +362 202 -1.66666666666667e-01 +362 603 -8.33333333333333e-02 +362 201 8.33333333333333e-02 +362 197 -1.25000000000000e-01 +362 88 4.16666666666667e-02 +362 604 -8.33333333333333e-02 +362 379 -4.16666666666667e-02 +362 194 -1.25000000000000e-01 +362 368 -7.50000000000000e-01 +362 193 -4.16666666666667e-02 +362 40 4.16666666666667e-02 +362 360 -1.66666666666667e-01 +362 192 8.33333333333333e-02 +362 366 1.66666666666667e-01 +363 363 6.37500000000000e+01 +363 355 4.25000000000000e+00 +363 40 2.12500000000000e+00 +363 354 -6.37500000000000e+00 +363 365 -8.50000000000000e+00 +363 428 4.25000000000000e+00 +363 91 2.12500000000000e+00 +363 427 -2.12500000000000e+00 +363 426 -6.37500000000000e+00 +363 194 4.25000000000000e+00 +363 193 -2.12500000000000e+00 +363 41 2.12500000000000e+00 +363 192 -6.37500000000000e+00 +363 200 -2.12500000000000e+00 +363 92 2.12500000000000e+00 +363 364 -8.50000000000000e+00 +363 199 4.25000000000000e+00 +363 356 -2.12500000000000e+00 +363 198 -6.37500000000000e+00 +363 431 -1.66666666666667e-01 +363 430 8.33333333333333e-02 +363 611 -8.33333333333333e-02 +363 203 8.33333333333333e-02 +363 202 -1.66666666666667e-01 +363 367 1.66666666666667e-01 +363 610 -8.33333333333333e-02 +363 368 1.66666666666667e-01 +363 366 -7.50000000000000e-01 +363 1721 4.16666666666667e+00 +363 1720 -8.33333333333333e+00 +363 1717 -4.16666666666667e+00 +363 1462 4.16666666666667e+00 +363 1463 -8.33333333333333e+00 +363 1730 8.33333333333333e+00 +363 1718 -4.16666666666667e+00 +363 1729 8.33333333333333e+00 +363 1728 -3.75000000000000e+01 +364 364 6.37500000000000e+01 +364 354 4.25000000000000e+00 +364 356 4.25000000000000e+00 +364 355 -1.91250000000000e+01 +364 39 2.12500000000000e+00 +364 428 4.25000000000000e+00 +364 427 -6.37500000000000e+00 +364 90 2.12500000000000e+00 +364 426 -2.12500000000000e+00 +364 365 -8.50000000000000e+00 +364 192 -2.12500000000000e+00 +364 41 -4.25000000000000e+00 +364 194 4.25000000000000e+00 +364 193 -6.37500000000000e+00 +364 200 4.25000000000000e+00 +364 92 -4.25000000000000e+00 +364 199 -1.91250000000000e+01 +364 363 -8.50000000000000e+00 +364 198 4.25000000000000e+00 +364 429 8.33333333333333e-02 +364 611 -8.33333333333333e-02 +364 203 8.33333333333333e-02 +364 368 -8.33333333333333e-02 +364 201 -1.66666666666667e-01 +364 366 1.66666666666667e-01 +364 609 -8.33333333333333e-02 +364 431 8.33333333333333e-02 +364 367 -2.50000000000000e-01 +364 1719 -8.33333333333333e+00 +364 1716 -4.16666666666667e+00 +364 1718 -4.16666666666667e+00 +364 1461 4.16666666666667e+00 +364 1463 4.16666666666667e+00 +364 1730 -4.16666666666667e+00 +364 1721 4.16666666666667e+00 +364 1729 -1.25000000000000e+01 +364 1728 8.33333333333333e+00 +365 365 6.37500000000000e+01 +365 354 -2.12500000000000e+00 +365 356 -6.37500000000000e+00 +365 355 4.25000000000000e+00 +365 428 -1.91250000000000e+01 +365 427 4.25000000000000e+00 +365 363 -8.50000000000000e+00 +365 426 4.25000000000000e+00 +365 364 -8.50000000000000e+00 +365 192 4.25000000000000e+00 +365 194 -1.91250000000000e+01 +365 40 -4.25000000000000e+00 +365 193 4.25000000000000e+00 +365 39 2.12500000000000e+00 +365 200 -6.37500000000000e+00 +365 199 4.25000000000000e+00 +365 91 -4.25000000000000e+00 +365 198 -2.12500000000000e+00 +365 90 2.12500000000000e+00 +365 429 -1.66666666666667e-01 +365 609 -8.33333333333333e-02 +365 610 -8.33333333333333e-02 +365 201 8.33333333333333e-02 +365 202 8.33333333333333e-02 +365 367 -8.33333333333333e-02 +365 430 8.33333333333333e-02 +365 368 -2.50000000000000e-01 +365 366 1.66666666666667e-01 +365 1719 4.16666666666667e+00 +365 1717 -4.16666666666667e+00 +365 1462 4.16666666666667e+00 +365 1729 -4.16666666666667e+00 +365 1461 -8.33333333333333e+00 +365 1728 8.33333333333333e+00 +365 1716 -4.16666666666667e+00 +365 1720 4.16666666666667e+00 +365 1730 -1.25000000000000e+01 +366 366 2.50000000000000e+00 +366 383 1.66666666666667e-01 +366 353 8.33333333333333e-02 +366 382 1.66666666666667e-01 +366 381 -7.50000000000000e-01 +366 361 -8.33333333333333e-02 +366 605 8.33333333333333e-02 +366 362 1.66666666666667e-01 +366 360 -2.50000000000000e-01 +366 604 -1.66666666666667e-01 +366 368 -3.33333333333333e-01 +366 95 -8.33333333333333e-02 +366 41 -8.33333333333333e-02 +366 445 8.33333333333333e-02 +366 430 -8.33333333333333e-02 +366 359 -8.33333333333333e-02 +366 356 8.33333333333333e-02 +366 446 -1.66666666666667e-01 +366 431 1.66666666666667e-01 +366 429 -2.50000000000000e-01 +366 358 1.66666666666667e-01 +366 355 -1.66666666666667e-01 +366 357 -2.50000000000000e-01 +366 203 -8.33333333333333e-02 +366 611 8.33333333333333e-02 +366 202 1.66666666666667e-01 +366 367 -3.33333333333333e-01 +366 364 1.66666666666667e-01 +366 610 8.33333333333333e-02 +366 94 -8.33333333333333e-02 +366 201 -2.50000000000000e-01 +366 365 1.66666666666667e-01 +366 194 -1.66666666666667e-01 +366 193 8.33333333333333e-02 +366 40 -8.33333333333333e-02 +366 363 -7.50000000000000e-01 +366 352 8.33333333333333e-02 +367 367 2.50000000000000e+00 +367 383 -8.33333333333333e-02 +367 353 -1.66666666666667e-01 +367 382 -2.50000000000000e-01 +367 381 1.66666666666667e-01 +367 360 -8.33333333333333e-02 +367 362 1.66666666666667e-01 +367 361 -2.50000000000000e-01 +367 605 8.33333333333333e-02 +367 603 -1.66666666666667e-01 +367 444 8.33333333333333e-02 +367 429 -8.33333333333333e-02 +367 359 1.66666666666667e-01 +367 368 -3.33333333333333e-01 +367 431 1.66666666666667e-01 +367 95 -8.33333333333333e-02 +367 446 8.33333333333333e-02 +367 430 -2.50000000000000e-01 +367 41 -8.33333333333333e-02 +367 356 8.33333333333333e-02 +367 358 -7.50000000000000e-01 +367 357 1.66666666666667e-01 +367 354 -1.66666666666667e-01 +367 194 8.33333333333333e-02 +367 365 -8.33333333333333e-02 +367 201 1.66666666666667e-01 +367 366 -3.33333333333333e-01 +367 363 1.66666666666667e-01 +367 611 -1.66666666666667e-01 +367 203 1.66666666666667e-01 +367 202 -7.50000000000000e-01 +367 609 8.33333333333333e-02 +367 93 -8.33333333333333e-02 +367 364 -2.50000000000000e-01 +367 351 8.33333333333333e-02 +367 192 8.33333333333333e-02 +367 39 -8.33333333333333e-02 +368 368 2.50000000000000e+00 +368 381 1.66666666666667e-01 +368 352 -1.66666666666667e-01 +368 351 8.33333333333333e-02 +368 383 -2.50000000000000e-01 +368 361 1.66666666666667e-01 +368 603 8.33333333333333e-02 +368 362 -7.50000000000000e-01 +368 360 1.66666666666667e-01 +368 604 8.33333333333333e-02 +368 366 -3.33333333333333e-01 +368 93 -8.33333333333333e-02 +368 39 -8.33333333333333e-02 +368 358 1.66666666666667e-01 +368 367 -3.33333333333333e-01 +368 430 1.66666666666667e-01 +368 357 -8.33333333333333e-02 +368 354 8.33333333333333e-02 +368 431 -7.50000000000000e-01 +368 94 -8.33333333333333e-02 +368 445 8.33333333333333e-02 +368 444 -1.66666666666667e-01 +368 429 1.66666666666667e-01 +368 359 -2.50000000000000e-01 +368 40 -8.33333333333333e-02 +368 355 8.33333333333333e-02 +368 201 -8.33333333333333e-02 +368 609 8.33333333333333e-02 +368 193 8.33333333333333e-02 +368 364 -8.33333333333333e-02 +368 203 -2.50000000000000e-01 +368 610 -1.66666666666667e-01 +368 202 1.66666666666667e-01 +368 365 -2.50000000000000e-01 +368 382 -8.33333333333333e-02 +368 363 1.66666666666667e-01 +368 192 -1.66666666666667e-01 +369 369 2.50000000000000e+00 +369 383 -8.33333333333333e-02 +369 382 1.66666666666667e-01 +369 381 -2.50000000000000e-01 +369 446 8.33333333333333e-02 +369 352 8.33333333333333e-02 +369 353 -1.66666666666667e-01 +369 359 1.66666666666667e-01 +369 358 1.66666666666667e-01 +369 357 -7.50000000000000e-01 +369 370 -3.33333333333333e-01 +369 43 -8.33333333333333e-02 +369 55 -8.33333333333333e-02 +369 448 -8.33333333333333e-02 +369 442 8.33333333333333e-02 +369 449 -8.33333333333333e-02 +369 386 8.33333333333333e-02 +369 44 1.66666666666667e-01 +369 371 -3.33333333333333e-01 +369 377 1.66666666666667e-01 +369 385 -1.66666666666667e-01 +369 376 1.66666666666667e-01 +369 375 -7.50000000000000e-01 +369 56 1.66666666666667e-01 +369 443 -1.66666666666667e-01 +369 142 -8.33333333333333e-02 +369 334 8.33333333333333e-02 +369 335 8.33333333333333e-02 +369 143 -8.33333333333333e-02 +369 42 -2.50000000000000e-01 +369 341 -8.33333333333333e-02 +369 155 8.33333333333333e-02 +369 340 1.66666666666667e-01 +369 154 -1.66666666666667e-01 +369 339 -2.50000000000000e-01 +369 445 8.33333333333333e-02 +369 54 -2.50000000000000e-01 +370 370 2.50000000000000e+00 +370 383 1.66666666666667e-01 +370 382 -7.50000000000000e-01 +370 381 1.66666666666667e-01 +370 446 -1.66666666666667e-01 +370 351 8.33333333333333e-02 +370 353 8.33333333333333e-02 +370 359 -8.33333333333333e-02 +370 358 -2.50000000000000e-01 +370 357 1.66666666666667e-01 +370 369 -3.33333333333333e-01 +370 42 -8.33333333333333e-02 +370 54 -8.33333333333333e-02 +370 447 -8.33333333333333e-02 +370 441 8.33333333333333e-02 +370 386 8.33333333333333e-02 +370 377 -8.33333333333333e-02 +370 376 -2.50000000000000e-01 +370 384 -1.66666666666667e-01 +370 375 1.66666666666667e-01 +370 449 -8.33333333333333e-02 +370 443 8.33333333333333e-02 +370 141 -8.33333333333333e-02 +370 333 8.33333333333333e-02 +370 143 -8.33333333333333e-02 +370 155 8.33333333333333e-02 +370 335 -1.66666666666667e-01 +370 44 1.66666666666667e-01 +370 43 -2.50000000000000e-01 +370 341 1.66666666666667e-01 +370 371 -3.33333333333333e-01 +370 56 1.66666666666667e-01 +370 340 -7.50000000000000e-01 +370 444 8.33333333333333e-02 +370 55 -2.50000000000000e-01 +370 339 1.66666666666667e-01 +370 153 -1.66666666666667e-01 +371 371 2.50000000000000e+00 +371 382 1.66666666666667e-01 +371 381 -8.33333333333333e-02 +371 445 -1.66666666666667e-01 +371 444 8.33333333333333e-02 +371 352 8.33333333333333e-02 +371 351 -1.66666666666667e-01 +371 359 -2.50000000000000e-01 +371 358 -8.33333333333333e-02 +371 357 1.66666666666667e-01 +371 447 -8.33333333333333e-02 +371 384 8.33333333333333e-02 +371 377 -2.50000000000000e-01 +371 385 8.33333333333333e-02 +371 376 -8.33333333333333e-02 +371 42 1.66666666666667e-01 +371 369 -3.33333333333333e-01 +371 375 1.66666666666667e-01 +371 448 -8.33333333333333e-02 +371 442 8.33333333333333e-02 +371 54 1.66666666666667e-01 +371 441 -1.66666666666667e-01 +371 142 -8.33333333333333e-02 +371 154 8.33333333333333e-02 +371 44 -7.50000000000000e-01 +371 334 -1.66666666666667e-01 +371 43 1.66666666666667e-01 +371 333 8.33333333333333e-02 +371 141 -8.33333333333333e-02 +371 341 -2.50000000000000e-01 +371 383 -2.50000000000000e-01 +371 56 -7.50000000000000e-01 +371 340 1.66666666666667e-01 +371 370 -3.33333333333333e-01 +371 55 1.66666666666667e-01 +371 339 -8.33333333333333e-02 +371 153 8.33333333333333e-02 +372 372 1.25000000000000e+00 +372 335 4.16666666666667e-02 +372 334 -8.33333333333333e-02 +372 343 8.33333333333333e-02 +372 342 -1.25000000000000e-01 +372 44 8.33333333333333e-02 +372 374 -1.66666666666667e-01 +372 377 1.66666666666667e-01 +372 376 -8.33333333333333e-02 +372 375 -2.50000000000000e-01 +372 62 8.33333333333333e-02 +372 482 -1.66666666666667e-01 +372 481 8.33333333333333e-02 +372 385 8.33333333333333e-02 +372 490 -8.33333333333333e-02 +372 209 4.16666666666667e-02 +372 491 -8.33333333333333e-02 +372 61 8.33333333333333e-02 +372 208 -8.33333333333333e-02 +372 60 -3.75000000000000e-01 +372 206 -4.16666666666667e-02 +372 386 8.33333333333333e-02 +372 373 -1.66666666666667e-01 +372 205 8.33333333333333e-02 +372 43 8.33333333333333e-02 +372 344 -4.16666666666667e-02 +372 204 -1.25000000000000e-01 +372 42 -3.75000000000000e-01 +373 373 1.25000000000000e+00 +373 374 -1.66666666666667e-01 +373 44 -4.16666666666667e-02 +373 335 4.16666666666667e-02 +373 333 -8.33333333333333e-02 +373 62 -4.16666666666667e-02 +373 343 -3.75000000000000e-01 +373 342 8.33333333333333e-02 +373 482 8.33333333333333e-02 +373 377 1.66666666666667e-01 +373 376 -2.50000000000000e-01 +373 375 -8.33333333333333e-02 +373 480 8.33333333333333e-02 +373 384 8.33333333333333e-02 +373 489 -8.33333333333333e-02 +373 209 4.16666666666667e-02 +373 491 -8.33333333333333e-02 +373 61 -1.25000000000000e-01 +373 60 8.33333333333333e-02 +373 207 -8.33333333333333e-02 +373 206 8.33333333333333e-02 +373 386 -1.66666666666667e-01 +373 344 8.33333333333333e-02 +373 205 -3.75000000000000e-01 +373 43 -1.25000000000000e-01 +373 372 -1.66666666666667e-01 +373 204 8.33333333333333e-02 +373 42 8.33333333333333e-02 +374 374 1.25000000000000e+00 +374 373 -1.66666666666667e-01 +374 342 -4.16666666666667e-02 +374 333 4.16666666666667e-02 +374 43 -4.16666666666667e-02 +374 334 4.16666666666667e-02 +374 344 -1.25000000000000e-01 +374 61 -4.16666666666667e-02 +374 481 8.33333333333333e-02 +374 377 -7.50000000000000e-01 +374 376 1.66666666666667e-01 +374 42 8.33333333333333e-02 +374 372 -1.66666666666667e-01 +374 375 1.66666666666667e-01 +374 60 8.33333333333333e-02 +374 480 -1.66666666666667e-01 +374 208 4.16666666666667e-02 +374 490 -8.33333333333333e-02 +374 62 -1.25000000000000e-01 +374 207 4.16666666666667e-02 +374 489 -8.33333333333333e-02 +374 343 8.33333333333333e-02 +374 206 -1.25000000000000e-01 +374 44 -1.25000000000000e-01 +374 205 8.33333333333333e-02 +374 385 -1.66666666666667e-01 +374 204 -4.16666666666667e-02 +374 384 8.33333333333333e-02 +375 375 2.50000000000000e+00 +375 340 -1.66666666666667e-01 +375 335 -8.33333333333333e-02 +375 343 8.33333333333333e-02 +375 334 -8.33333333333333e-02 +375 344 8.33333333333333e-02 +375 350 -8.33333333333333e-02 +375 349 1.66666666666667e-01 +375 348 -2.50000000000000e-01 +375 491 8.33333333333333e-02 +375 490 -1.66666666666667e-01 +375 481 1.66666666666667e-01 +375 374 1.66666666666667e-01 +375 43 8.33333333333333e-02 +375 373 -8.33333333333333e-02 +375 372 -2.50000000000000e-01 +375 482 1.66666666666667e-01 +375 73 8.33333333333333e-02 +375 480 -7.50000000000000e-01 +375 377 -3.33333333333333e-01 +375 442 -8.33333333333333e-02 +375 386 -8.33333333333333e-02 +375 448 8.33333333333333e-02 +375 553 -8.33333333333333e-02 +375 449 8.33333333333333e-02 +375 554 -8.33333333333333e-02 +375 44 -1.66666666666667e-01 +375 371 1.66666666666667e-01 +375 385 1.66666666666667e-01 +375 370 1.66666666666667e-01 +375 376 -3.33333333333333e-01 +375 384 -2.50000000000000e-01 +375 369 -7.50000000000000e-01 +375 443 1.66666666666667e-01 +375 74 -1.66666666666667e-01 +375 341 8.33333333333333e-02 +375 441 -2.50000000000000e-01 +376 376 2.50000000000000e+00 +376 339 -1.66666666666667e-01 +376 342 8.33333333333333e-02 +376 333 -8.33333333333333e-02 +376 344 -1.66666666666667e-01 +376 350 1.66666666666667e-01 +376 335 -8.33333333333333e-02 +376 349 -7.50000000000000e-01 +376 348 1.66666666666667e-01 +376 491 8.33333333333333e-02 +376 482 -8.33333333333333e-02 +376 489 -1.66666666666667e-01 +376 480 1.66666666666667e-01 +376 374 1.66666666666667e-01 +376 377 -3.33333333333333e-01 +376 373 -2.50000000000000e-01 +376 42 8.33333333333333e-02 +376 372 -8.33333333333333e-02 +376 481 -2.50000000000000e-01 +376 72 8.33333333333333e-02 +376 441 -8.33333333333333e-02 +376 386 1.66666666666667e-01 +376 447 8.33333333333333e-02 +376 552 -8.33333333333333e-02 +376 449 -1.66666666666667e-01 +376 443 1.66666666666667e-01 +376 44 8.33333333333333e-02 +376 371 -8.33333333333333e-02 +376 385 -7.50000000000000e-01 +376 370 -2.50000000000000e-01 +376 384 1.66666666666667e-01 +376 369 1.66666666666667e-01 +376 375 -3.33333333333333e-01 +376 554 -8.33333333333333e-02 +376 74 8.33333333333333e-02 +376 341 8.33333333333333e-02 +376 442 -2.50000000000000e-01 +377 377 2.50000000000000e+00 +377 339 8.33333333333333e-02 +377 333 -8.33333333333333e-02 +377 343 -1.66666666666667e-01 +377 349 1.66666666666667e-01 +377 342 8.33333333333333e-02 +377 348 -8.33333333333333e-02 +377 334 -8.33333333333333e-02 +377 350 -2.50000000000000e-01 +377 490 8.33333333333333e-02 +377 481 -8.33333333333333e-02 +377 489 8.33333333333333e-02 +377 374 -7.50000000000000e-01 +377 373 1.66666666666667e-01 +377 376 -3.33333333333333e-01 +377 372 1.66666666666667e-01 +377 482 -2.50000000000000e-01 +377 480 1.66666666666667e-01 +377 375 -3.33333333333333e-01 +377 384 -8.33333333333333e-02 +377 385 1.66666666666667e-01 +377 448 -1.66666666666667e-01 +377 442 1.66666666666667e-01 +377 447 8.33333333333333e-02 +377 552 -8.33333333333333e-02 +377 386 -2.50000000000000e-01 +377 371 -2.50000000000000e-01 +377 43 8.33333333333333e-02 +377 370 -8.33333333333333e-02 +377 42 -1.66666666666667e-01 +377 369 1.66666666666667e-01 +377 340 8.33333333333333e-02 +377 443 -7.50000000000000e-01 +377 553 -8.33333333333333e-02 +377 73 8.33333333333333e-02 +377 441 1.66666666666667e-01 +377 72 -1.66666666666667e-01 +378 378 1.25000000000000e+00 +378 362 8.33333333333333e-02 +378 353 4.16666666666667e-02 +378 44 -4.16666666666667e-02 +378 352 -8.33333333333333e-02 +378 89 -4.16666666666667e-02 +378 361 8.33333333333333e-02 +378 360 -3.75000000000000e-01 +378 605 8.33333333333333e-02 +378 604 8.33333333333333e-02 +378 383 1.66666666666667e-01 +378 382 -8.33333333333333e-02 +378 381 -2.50000000000000e-01 +378 385 8.33333333333333e-02 +378 607 -8.33333333333333e-02 +378 212 4.16666666666667e-02 +378 608 -8.33333333333333e-02 +378 211 -8.33333333333333e-02 +378 88 8.33333333333333e-02 +378 87 -1.25000000000000e-01 +378 206 8.33333333333333e-02 +378 386 -1.66666666666667e-01 +378 205 8.33333333333333e-02 +378 379 -1.66666666666667e-01 +378 43 8.33333333333333e-02 +378 204 -3.75000000000000e-01 +378 380 -1.66666666666667e-01 +378 42 -1.25000000000000e-01 +379 379 1.25000000000000e+00 +379 353 4.16666666666667e-02 +379 351 -8.33333333333333e-02 +379 361 -1.25000000000000e-01 +379 360 8.33333333333333e-02 +379 89 8.33333333333333e-02 +379 605 -1.66666666666667e-01 +379 603 8.33333333333333e-02 +379 380 -1.66666666666667e-01 +379 44 8.33333333333333e-02 +379 383 1.66666666666667e-01 +379 382 -2.50000000000000e-01 +379 381 -8.33333333333333e-02 +379 384 8.33333333333333e-02 +379 606 -8.33333333333333e-02 +379 212 4.16666666666667e-02 +379 608 -8.33333333333333e-02 +379 88 -3.75000000000000e-01 +379 210 -8.33333333333333e-02 +379 87 8.33333333333333e-02 +379 206 -4.16666666666667e-02 +379 386 8.33333333333333e-02 +379 205 -1.25000000000000e-01 +379 362 -4.16666666666667e-02 +379 43 -3.75000000000000e-01 +379 204 8.33333333333333e-02 +379 378 -1.66666666666667e-01 +379 42 8.33333333333333e-02 +380 380 1.25000000000000e+00 +380 352 4.16666666666667e-02 +380 378 -1.66666666666667e-01 +380 360 8.33333333333333e-02 +380 351 4.16666666666667e-02 +380 42 -4.16666666666667e-02 +380 362 -1.25000000000000e-01 +380 87 -4.16666666666667e-02 +380 603 8.33333333333333e-02 +380 88 8.33333333333333e-02 +380 604 -1.66666666666667e-01 +380 383 -7.50000000000000e-01 +380 379 -1.66666666666667e-01 +380 43 8.33333333333333e-02 +380 382 1.66666666666667e-01 +380 381 1.66666666666667e-01 +380 210 4.16666666666667e-02 +380 606 -8.33333333333333e-02 +380 89 -1.25000000000000e-01 +380 211 4.16666666666667e-02 +380 607 -8.33333333333333e-02 +380 206 -1.25000000000000e-01 +380 361 -4.16666666666667e-02 +380 44 -1.25000000000000e-01 +380 205 -4.16666666666667e-02 +380 385 8.33333333333333e-02 +380 204 8.33333333333333e-02 +380 384 -1.66666666666667e-01 +381 381 2.50000000000000e+00 +381 358 -1.66666666666667e-01 +381 352 -8.33333333333333e-02 +381 361 8.33333333333333e-02 +381 368 1.66666666666667e-01 +381 362 -1.66666666666667e-01 +381 353 -8.33333333333333e-02 +381 367 1.66666666666667e-01 +381 366 -7.50000000000000e-01 +381 608 8.33333333333333e-02 +381 605 -8.33333333333333e-02 +381 604 1.66666666666667e-01 +381 607 -1.66666666666667e-01 +381 380 1.66666666666667e-01 +381 383 -3.33333333333333e-01 +381 379 -8.33333333333333e-02 +381 43 8.33333333333333e-02 +381 378 -2.50000000000000e-01 +381 94 8.33333333333333e-02 +381 603 -2.50000000000000e-01 +381 445 -8.33333333333333e-02 +381 386 1.66666666666667e-01 +381 448 8.33333333333333e-02 +381 616 -8.33333333333333e-02 +381 449 -1.66666666666667e-01 +381 446 1.66666666666667e-01 +381 44 8.33333333333333e-02 +381 371 -8.33333333333333e-02 +381 385 1.66666666666667e-01 +381 370 1.66666666666667e-01 +381 382 -3.33333333333333e-01 +381 384 -7.50000000000000e-01 +381 369 -2.50000000000000e-01 +381 617 -8.33333333333333e-02 +381 95 8.33333333333333e-02 +381 359 8.33333333333333e-02 +381 444 -2.50000000000000e-01 +382 382 2.50000000000000e+00 +382 357 -1.66666666666667e-01 +382 353 -8.33333333333333e-02 +382 351 -8.33333333333333e-02 +382 360 8.33333333333333e-02 +382 368 -8.33333333333333e-02 +382 362 8.33333333333333e-02 +382 367 -2.50000000000000e-01 +382 366 1.66666666666667e-01 +382 608 8.33333333333333e-02 +382 603 1.66666666666667e-01 +382 606 -1.66666666666667e-01 +382 380 1.66666666666667e-01 +382 379 -2.50000000000000e-01 +382 378 -8.33333333333333e-02 +382 42 8.33333333333333e-02 +382 605 1.66666666666667e-01 +382 604 -7.50000000000000e-01 +382 93 8.33333333333333e-02 +382 383 -3.33333333333333e-01 +382 444 -8.33333333333333e-02 +382 386 -8.33333333333333e-02 +382 447 8.33333333333333e-02 +382 615 -8.33333333333333e-02 +382 617 -8.33333333333333e-02 +382 449 8.33333333333333e-02 +382 44 -1.66666666666667e-01 +382 371 1.66666666666667e-01 +382 385 -2.50000000000000e-01 +382 370 -7.50000000000000e-01 +382 384 1.66666666666667e-01 +382 369 1.66666666666667e-01 +382 381 -3.33333333333333e-01 +382 446 1.66666666666667e-01 +382 95 -1.66666666666667e-01 +382 359 8.33333333333333e-02 +382 445 -2.50000000000000e-01 +383 383 2.50000000000000e+00 +383 358 8.33333333333333e-02 +383 352 -8.33333333333333e-02 +383 367 -8.33333333333333e-02 +383 361 8.33333333333333e-02 +383 366 1.66666666666667e-01 +383 360 -1.66666666666667e-01 +383 351 -8.33333333333333e-02 +383 368 -2.50000000000000e-01 +383 606 8.33333333333333e-02 +383 603 -8.33333333333333e-02 +383 607 8.33333333333333e-02 +383 380 -7.50000000000000e-01 +383 379 1.66666666666667e-01 +383 378 1.66666666666667e-01 +383 381 -3.33333333333333e-01 +383 605 -2.50000000000000e-01 +383 604 1.66666666666667e-01 +383 382 -3.33333333333333e-01 +383 385 -8.33333333333333e-02 +383 384 1.66666666666667e-01 +383 616 -8.33333333333333e-02 +383 448 8.33333333333333e-02 +383 447 -1.66666666666667e-01 +383 444 1.66666666666667e-01 +383 386 -2.50000000000000e-01 +383 371 -2.50000000000000e-01 +383 43 -1.66666666666667e-01 +383 370 1.66666666666667e-01 +383 42 8.33333333333333e-02 +383 369 -8.33333333333333e-02 +383 357 8.33333333333333e-02 +383 446 -7.50000000000000e-01 +383 445 1.66666666666667e-01 +383 94 -1.66666666666667e-01 +383 615 -8.33333333333333e-02 +383 93 8.33333333333333e-02 +384 384 2.50000000000000e+00 +384 616 8.33333333333333e-02 +384 617 8.33333333333333e-02 +384 382 1.66666666666667e-01 +384 381 -7.50000000000000e-01 +384 379 8.33333333333333e-02 +384 608 -8.33333333333333e-02 +384 380 -1.66666666666667e-01 +384 607 1.66666666666667e-01 +384 606 -2.50000000000000e-01 +384 385 -3.33333333333333e-01 +384 43 -8.33333333333333e-02 +384 100 -8.33333333333333e-02 +384 371 8.33333333333333e-02 +384 377 -8.33333333333333e-02 +384 448 -8.33333333333333e-02 +384 553 8.33333333333333e-02 +384 370 -1.66666666666667e-01 +384 376 1.66666666666667e-01 +384 375 -2.50000000000000e-01 +384 449 1.66666666666667e-01 +384 554 -1.66666666666667e-01 +384 447 -2.50000000000000e-01 +384 205 -8.33333333333333e-02 +384 373 8.33333333333333e-02 +384 206 1.66666666666667e-01 +384 386 -3.33333333333333e-01 +384 491 1.66666666666667e-01 +384 374 8.33333333333333e-02 +384 44 -8.33333333333333e-02 +384 204 -2.50000000000000e-01 +384 218 8.33333333333333e-02 +384 101 -8.33333333333333e-02 +384 490 1.66666666666667e-01 +384 217 -1.66666666666667e-01 +384 489 -7.50000000000000e-01 +384 383 1.66666666666667e-01 +385 385 2.50000000000000e+00 +385 615 8.33333333333333e-02 +385 617 -1.66666666666667e-01 +385 382 -2.50000000000000e-01 +385 381 1.66666666666667e-01 +385 378 8.33333333333333e-02 +385 608 1.66666666666667e-01 +385 380 8.33333333333333e-02 +385 607 -7.50000000000000e-01 +385 606 1.66666666666667e-01 +385 384 -3.33333333333333e-01 +385 42 -8.33333333333333e-02 +385 99 -8.33333333333333e-02 +385 449 1.66666666666667e-01 +385 386 -3.33333333333333e-01 +385 377 1.66666666666667e-01 +385 447 -8.33333333333333e-02 +385 552 8.33333333333333e-02 +385 44 -8.33333333333333e-02 +385 371 8.33333333333333e-02 +385 376 -7.50000000000000e-01 +385 369 -1.66666666666667e-01 +385 375 1.66666666666667e-01 +385 101 -8.33333333333333e-02 +385 554 8.33333333333333e-02 +385 448 -2.50000000000000e-01 +385 204 -8.33333333333333e-02 +385 372 8.33333333333333e-02 +385 218 8.33333333333333e-02 +385 491 -8.33333333333333e-02 +385 374 -1.66666666666667e-01 +385 206 1.66666666666667e-01 +385 205 -2.50000000000000e-01 +385 490 -2.50000000000000e-01 +385 383 -8.33333333333333e-02 +385 489 1.66666666666667e-01 +385 216 -1.66666666666667e-01 +386 386 2.50000000000000e+00 +386 381 1.66666666666667e-01 +386 616 -1.66666666666667e-01 +386 615 8.33333333333333e-02 +386 383 -2.50000000000000e-01 +386 607 1.66666666666667e-01 +386 606 -8.33333333333333e-02 +386 379 8.33333333333333e-02 +386 378 -1.66666666666667e-01 +386 608 -2.50000000000000e-01 +386 369 8.33333333333333e-02 +386 375 -8.33333333333333e-02 +386 448 1.66666666666667e-01 +386 385 -3.33333333333333e-01 +386 376 1.66666666666667e-01 +386 377 -2.50000000000000e-01 +386 43 -8.33333333333333e-02 +386 370 8.33333333333333e-02 +386 449 -7.50000000000000e-01 +386 100 -8.33333333333333e-02 +386 553 8.33333333333333e-02 +386 447 1.66666666666667e-01 +386 552 -1.66666666666667e-01 +386 217 8.33333333333333e-02 +386 490 -8.33333333333333e-02 +386 204 1.66666666666667e-01 +386 384 -3.33333333333333e-01 +386 489 1.66666666666667e-01 +386 206 -7.50000000000000e-01 +386 373 -1.66666666666667e-01 +386 205 1.66666666666667e-01 +386 372 8.33333333333333e-02 +386 42 -8.33333333333333e-02 +386 491 -2.50000000000000e-01 +386 382 -8.33333333333333e-02 +386 216 8.33333333333333e-02 +386 99 -8.33333333333333e-02 +387 387 1.25000000000000e+00 +387 419 -8.33333333333333e-02 +387 416 -8.33333333333333e-02 +387 415 4.16666666666667e-02 +387 418 -8.33333333333333e-02 +387 398 8.33333333333333e-02 +387 397 -4.16666666666667e-02 +387 403 8.33333333333333e-02 +387 396 -1.25000000000000e-01 +387 148 -4.16666666666667e-02 +387 145 4.16666666666667e-02 +387 407 8.33333333333333e-02 +387 395 -8.33333333333333e-02 +387 47 8.33333333333333e-02 +387 146 -8.33333333333333e-02 +387 46 8.33333333333333e-02 +387 388 -1.66666666666667e-01 +387 394 1.66666666666667e-01 +387 45 -3.75000000000000e-01 +387 393 -2.50000000000000e-01 +387 389 -1.66666666666667e-01 +387 50 8.33333333333333e-02 +387 149 8.33333333333333e-02 +387 49 8.33333333333333e-02 +387 406 -1.66666666666667e-01 +387 404 8.33333333333333e-02 +387 48 -3.75000000000000e-01 +387 147 -1.25000000000000e-01 +388 388 1.25000000000000e+00 +388 419 -8.33333333333333e-02 +388 414 4.16666666666667e-02 +388 417 -8.33333333333333e-02 +388 398 8.33333333333333e-02 +388 404 -1.66666666666667e-01 +388 397 -1.25000000000000e-01 +388 396 -4.16666666666667e-02 +388 402 8.33333333333333e-02 +388 147 -4.16666666666667e-02 +388 144 4.16666666666667e-02 +388 149 8.33333333333333e-02 +388 389 -1.66666666666667e-01 +388 395 1.66666666666667e-01 +388 47 -4.16666666666667e-02 +388 146 4.16666666666667e-02 +388 46 -1.25000000000000e-01 +388 394 -7.50000000000000e-01 +388 45 8.33333333333333e-02 +388 387 -1.66666666666667e-01 +388 393 1.66666666666667e-01 +388 50 -4.16666666666667e-02 +388 407 8.33333333333333e-02 +388 416 4.16666666666667e-02 +388 49 -1.25000000000000e-01 +388 148 -1.25000000000000e-01 +388 48 8.33333333333333e-02 +388 405 -1.66666666666667e-01 +389 389 1.25000000000000e+00 +389 418 -8.33333333333333e-02 +389 402 8.33333333333333e-02 +389 417 -8.33333333333333e-02 +389 414 -8.33333333333333e-02 +389 398 -3.75000000000000e-01 +389 397 8.33333333333333e-02 +389 403 -1.66666666666667e-01 +389 396 8.33333333333333e-02 +389 148 8.33333333333333e-02 +389 388 -1.66666666666667e-01 +389 394 1.66666666666667e-01 +389 405 8.33333333333333e-02 +389 393 -8.33333333333333e-02 +389 47 -1.25000000000000e-01 +389 395 -2.50000000000000e-01 +389 46 -4.16666666666667e-02 +389 145 4.16666666666667e-02 +389 45 8.33333333333333e-02 +389 144 -8.33333333333333e-02 +389 415 4.16666666666667e-02 +389 50 -1.25000000000000e-01 +389 149 -3.75000000000000e-01 +389 49 -4.16666666666667e-02 +389 406 8.33333333333333e-02 +389 387 -1.66666666666667e-01 +389 48 8.33333333333333e-02 +389 147 8.33333333333333e-02 +390 390 6.37500000000000e+01 +390 401 4.25000000000000e+00 +390 400 -2.12500000000000e+00 +390 433 2.12500000000000e+00 +390 434 2.12500000000000e+00 +390 53 -2.12500000000000e+00 +390 47 -2.12500000000000e+00 +390 399 -6.37500000000000e+00 +390 46 4.25000000000000e+00 +390 391 -8.50000000000000e+00 +390 52 4.25000000000000e+00 +390 146 2.12500000000000e+00 +390 145 2.12500000000000e+00 +390 45 -6.37500000000000e+00 +390 152 4.25000000000000e+00 +390 151 -2.12500000000000e+00 +390 150 -6.37500000000000e+00 +390 392 -8.50000000000000e+00 +390 51 -6.37500000000000e+00 +390 437 -8.33333333333333e-02 +390 404 -1.66666666666667e-01 +390 403 8.33333333333333e-02 +390 436 -8.33333333333333e-02 +390 395 1.66666666666667e-01 +390 425 8.33333333333333e-02 +390 424 -1.66666666666667e-01 +390 394 1.66666666666667e-01 +390 393 -7.50000000000000e-01 +390 1754 4.16666666666667e+00 +390 1753 -8.33333333333333e+00 +390 1757 8.33333333333333e+00 +390 1756 8.33333333333333e+00 +390 1755 -3.75000000000000e+01 +390 1691 -4.16666666666667e+00 +390 1690 -4.16666666666667e+00 +390 1694 -8.33333333333333e+00 +390 1693 4.16666666666667e+00 +391 391 6.37500000000000e+01 +391 432 2.12500000000000e+00 +391 434 -4.25000000000000e+00 +391 401 4.25000000000000e+00 +391 400 -6.37500000000000e+00 +391 45 4.25000000000000e+00 +391 390 -8.50000000000000e+00 +391 51 4.25000000000000e+00 +391 146 -4.25000000000000e+00 +391 47 4.25000000000000e+00 +391 46 -1.91250000000000e+01 +391 144 2.12500000000000e+00 +391 152 4.25000000000000e+00 +391 392 -8.50000000000000e+00 +391 53 4.25000000000000e+00 +391 151 -6.37500000000000e+00 +391 399 -2.12500000000000e+00 +391 52 -1.91250000000000e+01 +391 150 -2.12500000000000e+00 +391 437 -8.33333333333333e-02 +391 402 8.33333333333333e-02 +391 435 -8.33333333333333e-02 +391 425 8.33333333333333e-02 +391 395 -8.33333333333333e-02 +391 423 -1.66666666666667e-01 +391 404 8.33333333333333e-02 +391 394 -2.50000000000000e-01 +391 393 1.66666666666667e-01 +391 1754 4.16666666666667e+00 +391 1752 -8.33333333333333e+00 +391 1757 -4.16666666666667e+00 +391 1756 -1.25000000000000e+01 +391 1755 8.33333333333333e+00 +391 1694 4.16666666666667e+00 +391 1691 -4.16666666666667e+00 +391 1689 -4.16666666666667e+00 +391 1692 4.16666666666667e+00 +392 392 6.37500000000000e+01 +392 399 4.25000000000000e+00 +392 433 -4.25000000000000e+00 +392 432 2.12500000000000e+00 +392 51 -2.12500000000000e+00 +392 401 -1.91250000000000e+01 +392 400 4.25000000000000e+00 +392 45 -2.12500000000000e+00 +392 144 2.12500000000000e+00 +392 47 -6.37500000000000e+00 +392 145 -4.25000000000000e+00 +392 46 4.25000000000000e+00 +392 152 -1.91250000000000e+01 +392 390 -8.50000000000000e+00 +392 53 -6.37500000000000e+00 +392 151 4.25000000000000e+00 +392 391 -8.50000000000000e+00 +392 52 4.25000000000000e+00 +392 150 4.25000000000000e+00 +392 435 -8.33333333333333e-02 +392 403 8.33333333333333e-02 +392 436 -8.33333333333333e-02 +392 402 -1.66666666666667e-01 +392 424 8.33333333333333e-02 +392 394 -8.33333333333333e-02 +392 393 1.66666666666667e-01 +392 423 8.33333333333333e-02 +392 395 -2.50000000000000e-01 +392 1752 4.16666666666667e+00 +392 1753 4.16666666666667e+00 +392 1757 -1.25000000000000e+01 +392 1756 -4.16666666666667e+00 +392 1755 8.33333333333333e+00 +392 1693 4.16666666666667e+00 +392 1690 -4.16666666666667e+00 +392 1689 -4.16666666666667e+00 +392 1692 -8.33333333333333e+00 +393 393 2.50000000000000e+00 +393 437 8.33333333333333e-02 +393 392 1.66666666666667e-01 +393 152 -1.66666666666667e-01 +393 151 8.33333333333333e-02 +393 391 1.66666666666667e-01 +393 390 -7.50000000000000e-01 +393 425 -8.33333333333333e-02 +393 424 1.66666666666667e-01 +393 423 -2.50000000000000e-01 +393 403 -8.33333333333333e-02 +393 451 -8.33333333333333e-02 +393 418 8.33333333333333e-02 +393 404 1.66666666666667e-01 +393 419 -1.66666666666667e-01 +393 56 8.33333333333333e-02 +393 452 -8.33333333333333e-02 +393 47 8.33333333333333e-02 +393 402 -2.50000000000000e-01 +393 146 -8.33333333333333e-02 +393 145 -8.33333333333333e-02 +393 149 8.33333333333333e-02 +393 389 -8.33333333333333e-02 +393 394 -3.33333333333333e-01 +393 148 8.33333333333333e-02 +393 154 -8.33333333333333e-02 +393 46 -1.66666666666667e-01 +393 388 1.66666666666667e-01 +393 387 -2.50000000000000e-01 +393 395 -3.33333333333333e-01 +393 407 1.66666666666667e-01 +393 155 1.66666666666667e-01 +393 406 1.66666666666667e-01 +393 55 -1.66666666666667e-01 +393 436 8.33333333333333e-02 +393 405 -7.50000000000000e-01 +393 153 -2.50000000000000e-01 +394 394 2.50000000000000e+00 +394 437 -1.66666666666667e-01 +394 392 -8.33333333333333e-02 +394 152 8.33333333333333e-02 +394 150 8.33333333333333e-02 +394 391 -2.50000000000000e-01 +394 390 1.66666666666667e-01 +394 425 1.66666666666667e-01 +394 424 -7.50000000000000e-01 +394 423 1.66666666666667e-01 +394 402 -8.33333333333333e-02 +394 450 -8.33333333333333e-02 +394 417 8.33333333333333e-02 +394 452 -8.33333333333333e-02 +394 419 8.33333333333333e-02 +394 395 -3.33333333333333e-01 +394 404 1.66666666666667e-01 +394 403 -2.50000000000000e-01 +394 144 -8.33333333333333e-02 +394 389 1.66666666666667e-01 +394 393 -3.33333333333333e-01 +394 149 -1.66666666666667e-01 +394 155 1.66666666666667e-01 +394 147 8.33333333333333e-02 +394 153 -8.33333333333333e-02 +394 47 8.33333333333333e-02 +394 146 -8.33333333333333e-02 +394 388 -7.50000000000000e-01 +394 45 -1.66666666666667e-01 +394 387 1.66666666666667e-01 +394 407 -8.33333333333333e-02 +394 56 8.33333333333333e-02 +394 435 8.33333333333333e-02 +394 406 -2.50000000000000e-01 +394 154 -2.50000000000000e-01 +394 405 1.66666666666667e-01 +394 54 -1.66666666666667e-01 +395 395 2.50000000000000e+00 +395 435 8.33333333333333e-02 +395 391 -8.33333333333333e-02 +395 151 8.33333333333333e-02 +395 390 1.66666666666667e-01 +395 150 -1.66666666666667e-01 +395 392 -2.50000000000000e-01 +395 425 -2.50000000000000e-01 +395 424 1.66666666666667e-01 +395 423 -8.33333333333333e-02 +395 451 -8.33333333333333e-02 +395 418 8.33333333333333e-02 +395 402 1.66666666666667e-01 +395 417 -1.66666666666667e-01 +395 54 8.33333333333333e-02 +395 450 -8.33333333333333e-02 +395 404 -7.50000000000000e-01 +395 394 -3.33333333333333e-01 +395 403 1.66666666666667e-01 +395 45 8.33333333333333e-02 +395 144 -8.33333333333333e-02 +395 388 1.66666666666667e-01 +395 147 8.33333333333333e-02 +395 387 -8.33333333333333e-02 +395 148 -1.66666666666667e-01 +395 154 1.66666666666667e-01 +395 389 -2.50000000000000e-01 +395 46 8.33333333333333e-02 +395 145 -8.33333333333333e-02 +395 436 -1.66666666666667e-01 +395 407 -2.50000000000000e-01 +395 155 -7.50000000000000e-01 +395 406 -8.33333333333333e-02 +395 55 8.33333333333333e-02 +395 393 -3.33333333333333e-01 +395 405 1.66666666666667e-01 +395 153 1.66666666666667e-01 +396 396 1.25000000000000e+00 +396 419 8.33333333333333e-02 +396 418 -1.66666666666667e-01 +396 389 8.33333333333333e-02 +396 388 -4.16666666666667e-02 +396 46 4.16666666666667e-02 +396 387 -1.25000000000000e-01 +396 416 8.33333333333333e-02 +396 109 4.16666666666667e-02 +396 414 -3.75000000000000e-01 +396 404 -8.33333333333333e-02 +396 398 -1.66666666666667e-01 +396 238 -4.16666666666667e-02 +396 641 -8.33333333333333e-02 +396 245 8.33333333333333e-02 +396 640 -8.33333333333333e-02 +396 244 8.33333333333333e-02 +396 239 8.33333333333333e-02 +396 110 -8.33333333333333e-02 +396 237 -1.25000000000000e-01 +396 236 8.33333333333333e-02 +396 47 -8.33333333333333e-02 +396 235 8.33333333333333e-02 +396 397 -1.66666666666667e-01 +396 403 1.66666666666667e-01 +396 234 -3.75000000000000e-01 +396 415 8.33333333333333e-02 +396 402 -2.50000000000000e-01 +397 397 1.25000000000000e+00 +397 414 8.33333333333333e-02 +397 419 8.33333333333333e-02 +397 417 -1.66666666666667e-01 +397 389 8.33333333333333e-02 +397 398 -1.66666666666667e-01 +397 388 -1.25000000000000e-01 +397 387 -4.16666666666667e-02 +397 45 4.16666666666667e-02 +397 415 -1.25000000000000e-01 +397 108 4.16666666666667e-02 +397 237 -4.16666666666667e-02 +397 239 8.33333333333333e-02 +397 404 1.66666666666667e-01 +397 245 -1.66666666666667e-01 +397 639 -8.33333333333333e-02 +397 243 8.33333333333333e-02 +397 110 4.16666666666667e-02 +397 641 -8.33333333333333e-02 +397 238 -1.25000000000000e-01 +397 236 -4.16666666666667e-02 +397 47 4.16666666666667e-02 +397 235 -1.25000000000000e-01 +397 416 -4.16666666666667e-02 +397 403 -7.50000000000000e-01 +397 234 8.33333333333333e-02 +397 396 -1.66666666666667e-01 +397 402 1.66666666666667e-01 +398 398 1.25000000000000e+00 +398 417 8.33333333333333e-02 +398 418 8.33333333333333e-02 +398 389 -3.75000000000000e-01 +398 388 8.33333333333333e-02 +398 397 -1.66666666666667e-01 +398 387 8.33333333333333e-02 +398 416 -1.25000000000000e-01 +398 414 8.33333333333333e-02 +398 402 -8.33333333333333e-02 +398 396 -1.66666666666667e-01 +398 238 8.33333333333333e-02 +398 639 -8.33333333333333e-02 +398 243 8.33333333333333e-02 +398 403 1.66666666666667e-01 +398 244 -1.66666666666667e-01 +398 239 -3.75000000000000e-01 +398 109 4.16666666666667e-02 +398 640 -8.33333333333333e-02 +398 237 8.33333333333333e-02 +398 108 -8.33333333333333e-02 +398 236 -1.25000000000000e-01 +398 415 -4.16666666666667e-02 +398 404 -2.50000000000000e-01 +398 235 -4.16666666666667e-02 +398 46 4.16666666666667e-02 +398 234 8.33333333333333e-02 +398 45 -8.33333333333333e-02 +399 399 6.37500000000000e+01 +399 391 -2.12500000000000e+00 +399 113 2.12500000000000e+00 +399 434 -2.12500000000000e+00 +399 433 4.25000000000000e+00 +399 400 -8.50000000000000e+00 +399 432 -6.37500000000000e+00 +399 47 2.12500000000000e+00 +399 390 -6.37500000000000e+00 +399 236 -2.12500000000000e+00 +399 235 4.25000000000000e+00 +399 46 2.12500000000000e+00 +399 234 -6.37500000000000e+00 +399 401 -8.50000000000000e+00 +399 242 4.25000000000000e+00 +399 241 -2.12500000000000e+00 +399 112 2.12500000000000e+00 +399 392 4.25000000000000e+00 +399 240 -6.37500000000000e+00 +399 437 8.33333333333333e-02 +399 436 -1.66666666666667e-01 +399 404 1.66666666666667e-01 +399 245 -1.66666666666667e-01 +399 646 -8.33333333333333e-02 +399 244 8.33333333333333e-02 +399 647 -8.33333333333333e-02 +399 403 1.66666666666667e-01 +399 402 -7.50000000000000e-01 +399 1757 -8.33333333333333e+00 +399 1756 4.16666666666667e+00 +399 1754 -4.16666666666667e+00 +399 1499 4.16666666666667e+00 +399 1765 8.33333333333333e+00 +399 1498 -8.33333333333333e+00 +399 1753 -4.16666666666667e+00 +399 1766 8.33333333333333e+00 +399 1764 -3.75000000000000e+01 +400 400 6.37500000000000e+01 +400 434 4.25000000000000e+00 +400 433 -1.91250000000000e+01 +400 432 4.25000000000000e+00 +400 399 -8.50000000000000e+00 +400 392 4.25000000000000e+00 +400 391 -6.37500000000000e+00 +400 401 -8.50000000000000e+00 +400 234 4.25000000000000e+00 +400 47 -4.25000000000000e+00 +400 236 4.25000000000000e+00 +400 235 -1.91250000000000e+01 +400 45 2.12500000000000e+00 +400 242 4.25000000000000e+00 +400 113 -4.25000000000000e+00 +400 390 -2.12500000000000e+00 +400 241 -6.37500000000000e+00 +400 240 -2.12500000000000e+00 +400 111 2.12500000000000e+00 +400 437 8.33333333333333e-02 +400 435 -1.66666666666667e-01 +400 404 -8.33333333333333e-02 +400 647 -8.33333333333333e-02 +400 245 8.33333333333333e-02 +400 645 -8.33333333333333e-02 +400 243 8.33333333333333e-02 +400 403 -2.50000000000000e-01 +400 402 1.66666666666667e-01 +400 1757 4.16666666666667e+00 +400 1755 4.16666666666667e+00 +400 1766 -4.16666666666667e+00 +400 1754 -4.16666666666667e+00 +400 1499 4.16666666666667e+00 +400 1764 8.33333333333333e+00 +400 1497 -8.33333333333333e+00 +400 1752 -4.16666666666667e+00 +400 1765 -1.25000000000000e+01 +401 401 6.37500000000000e+01 +401 434 -6.37500000000000e+00 +401 433 4.25000000000000e+00 +401 111 2.12500000000000e+00 +401 432 -2.12500000000000e+00 +401 392 -1.91250000000000e+01 +401 391 4.25000000000000e+00 +401 45 2.12500000000000e+00 +401 400 -8.50000000000000e+00 +401 234 -2.12500000000000e+00 +401 236 -6.37500000000000e+00 +401 46 -4.25000000000000e+00 +401 235 4.25000000000000e+00 +401 390 4.25000000000000e+00 +401 242 -1.91250000000000e+01 +401 241 4.25000000000000e+00 +401 112 -4.25000000000000e+00 +401 399 -8.50000000000000e+00 +401 240 4.25000000000000e+00 +401 436 8.33333333333333e-02 +401 435 8.33333333333333e-02 +401 403 -8.33333333333333e-02 +401 646 -8.33333333333333e-02 +401 244 8.33333333333333e-02 +401 402 1.66666666666667e-01 +401 243 -1.66666666666667e-01 +401 645 -8.33333333333333e-02 +401 404 -2.50000000000000e-01 +401 1756 4.16666666666667e+00 +401 1755 -8.33333333333333e+00 +401 1765 -4.16666666666667e+00 +401 1753 -4.16666666666667e+00 +401 1498 4.16666666666667e+00 +401 1752 -4.16666666666667e+00 +401 1497 4.16666666666667e+00 +401 1766 -1.25000000000000e+01 +401 1764 8.33333333333333e+00 +402 402 2.50000000000000e+00 +402 436 1.66666666666667e-01 +402 392 -1.66666666666667e-01 +402 391 8.33333333333333e-02 +402 435 -2.50000000000000e-01 +402 401 1.66666666666667e-01 +402 646 8.33333333333333e-02 +402 400 1.66666666666667e-01 +402 399 -7.50000000000000e-01 +402 647 8.33333333333333e-02 +402 394 -8.33333333333333e-02 +402 395 1.66666666666667e-01 +402 404 -3.33333333333333e-01 +402 47 -8.33333333333333e-02 +402 393 -2.50000000000000e-01 +402 452 8.33333333333333e-02 +402 116 -8.33333333333333e-02 +402 451 -1.66666666666667e-01 +402 389 8.33333333333333e-02 +402 403 -3.33333333333333e-01 +402 418 1.66666666666667e-01 +402 388 8.33333333333333e-02 +402 46 -8.33333333333333e-02 +402 419 1.66666666666667e-01 +402 115 -8.33333333333333e-02 +402 417 -7.50000000000000e-01 +402 398 -8.33333333333333e-02 +402 236 8.33333333333333e-02 +402 640 8.33333333333333e-02 +402 244 -8.33333333333333e-02 +402 235 -1.66666666666667e-01 +402 397 1.66666666666667e-01 +402 396 -2.50000000000000e-01 +402 245 1.66666666666667e-01 +402 641 -1.66666666666667e-01 +402 243 -2.50000000000000e-01 +402 437 -8.33333333333333e-02 +403 403 2.50000000000000e+00 +403 435 1.66666666666667e-01 +403 390 8.33333333333333e-02 +403 437 1.66666666666667e-01 +403 436 -7.50000000000000e-01 +403 401 -8.33333333333333e-02 +403 645 8.33333333333333e-02 +403 400 -2.50000000000000e-01 +403 399 1.66666666666667e-01 +403 647 -1.66666666666667e-01 +403 393 -8.33333333333333e-02 +403 452 8.33333333333333e-02 +403 395 1.66666666666667e-01 +403 394 -2.50000000000000e-01 +403 450 -1.66666666666667e-01 +403 419 -8.33333333333333e-02 +403 402 -3.33333333333333e-01 +403 417 1.66666666666667e-01 +403 389 -1.66666666666667e-01 +403 387 8.33333333333333e-02 +403 45 -8.33333333333333e-02 +403 418 -2.50000000000000e-01 +403 114 -8.33333333333333e-02 +403 398 1.66666666666667e-01 +403 404 -3.33333333333333e-01 +403 245 1.66666666666667e-01 +403 639 8.33333333333333e-02 +403 243 -8.33333333333333e-02 +403 236 8.33333333333333e-02 +403 47 -8.33333333333333e-02 +403 397 -7.50000000000000e-01 +403 234 -1.66666666666667e-01 +403 396 1.66666666666667e-01 +403 641 8.33333333333333e-02 +403 116 -8.33333333333333e-02 +403 244 -2.50000000000000e-01 +403 392 8.33333333333333e-02 +404 404 2.50000000000000e+00 +404 435 -8.33333333333333e-02 +404 390 -1.66666666666667e-01 +404 437 -2.50000000000000e-01 +404 436 1.66666666666667e-01 +404 400 -8.33333333333333e-02 +404 399 1.66666666666667e-01 +404 401 -2.50000000000000e-01 +404 646 -1.66666666666667e-01 +404 645 8.33333333333333e-02 +404 451 8.33333333333333e-02 +404 393 1.66666666666667e-01 +404 402 -3.33333333333333e-01 +404 395 -7.50000000000000e-01 +404 394 1.66666666666667e-01 +404 45 -8.33333333333333e-02 +404 450 8.33333333333333e-02 +404 114 -8.33333333333333e-02 +404 387 8.33333333333333e-02 +404 418 -8.33333333333333e-02 +404 388 -1.66666666666667e-01 +404 419 -2.50000000000000e-01 +404 417 1.66666666666667e-01 +404 396 -8.33333333333333e-02 +404 234 8.33333333333333e-02 +404 397 1.66666666666667e-01 +404 403 -3.33333333333333e-01 +404 244 1.66666666666667e-01 +404 398 -2.50000000000000e-01 +404 235 8.33333333333333e-02 +404 46 -8.33333333333333e-02 +404 245 -7.50000000000000e-01 +404 391 8.33333333333333e-02 +404 640 8.33333333333333e-02 +404 115 -8.33333333333333e-02 +404 243 1.66666666666667e-01 +404 639 -1.66666666666667e-01 +405 405 2.50000000000000e+00 +405 443 8.33333333333333e-02 +405 442 -1.66666666666667e-01 +405 412 1.66666666666667e-01 +405 411 -7.50000000000000e-01 +405 338 8.33333333333333e-02 +405 337 8.33333333333333e-02 +405 341 1.66666666666667e-01 +405 340 -8.33333333333333e-02 +405 339 -2.50000000000000e-01 +405 407 -3.33333333333333e-01 +405 50 -8.33333333333333e-02 +405 56 -8.33333333333333e-02 +405 455 -8.33333333333333e-02 +405 452 8.33333333333333e-02 +405 422 -1.66666666666667e-01 +405 419 1.66666666666667e-01 +405 421 8.33333333333333e-02 +405 418 -8.33333333333333e-02 +405 417 -2.50000000000000e-01 +405 454 -8.33333333333333e-02 +405 451 8.33333333333333e-02 +405 149 -8.33333333333333e-02 +405 389 8.33333333333333e-02 +405 148 -8.33333333333333e-02 +405 154 8.33333333333333e-02 +405 388 -1.66666666666667e-01 +405 49 1.66666666666667e-01 +405 48 -2.50000000000000e-01 +405 395 1.66666666666667e-01 +405 155 -1.66666666666667e-01 +405 394 1.66666666666667e-01 +405 406 -3.33333333333333e-01 +405 55 1.66666666666667e-01 +405 393 -7.50000000000000e-01 +405 413 1.66666666666667e-01 +405 54 -2.50000000000000e-01 +406 406 2.50000000000000e+00 +406 413 -8.33333333333333e-02 +406 441 -1.66666666666667e-01 +406 412 -2.50000000000000e-01 +406 411 1.66666666666667e-01 +406 338 -1.66666666666667e-01 +406 336 8.33333333333333e-02 +406 341 1.66666666666667e-01 +406 340 -2.50000000000000e-01 +406 339 -8.33333333333333e-02 +406 455 -8.33333333333333e-02 +406 422 8.33333333333333e-02 +406 50 1.66666666666667e-01 +406 407 -3.33333333333333e-01 +406 419 1.66666666666667e-01 +406 418 -2.50000000000000e-01 +406 420 8.33333333333333e-02 +406 417 -8.33333333333333e-02 +406 56 1.66666666666667e-01 +406 452 -1.66666666666667e-01 +406 453 -8.33333333333333e-02 +406 450 8.33333333333333e-02 +406 147 -8.33333333333333e-02 +406 153 8.33333333333333e-02 +406 389 8.33333333333333e-02 +406 149 -8.33333333333333e-02 +406 49 -7.50000000000000e-01 +406 387 -1.66666666666667e-01 +406 48 1.66666666666667e-01 +406 395 -8.33333333333333e-02 +406 155 8.33333333333333e-02 +406 394 -2.50000000000000e-01 +406 443 8.33333333333333e-02 +406 55 -7.50000000000000e-01 +406 393 1.66666666666667e-01 +406 405 -3.33333333333333e-01 +406 54 1.66666666666667e-01 +407 407 2.50000000000000e+00 +407 412 -8.33333333333333e-02 +407 411 1.66666666666667e-01 +407 441 8.33333333333333e-02 +407 413 -2.50000000000000e-01 +407 336 8.33333333333333e-02 +407 337 -1.66666666666667e-01 +407 341 -7.50000000000000e-01 +407 340 1.66666666666667e-01 +407 339 1.66666666666667e-01 +407 405 -3.33333333333333e-01 +407 48 -8.33333333333333e-02 +407 54 -8.33333333333333e-02 +407 453 -8.33333333333333e-02 +407 450 8.33333333333333e-02 +407 454 -8.33333333333333e-02 +407 421 8.33333333333333e-02 +407 419 -7.50000000000000e-01 +407 49 1.66666666666667e-01 +407 406 -3.33333333333333e-01 +407 418 1.66666666666667e-01 +407 420 -1.66666666666667e-01 +407 417 1.66666666666667e-01 +407 55 1.66666666666667e-01 +407 451 -1.66666666666667e-01 +407 147 -8.33333333333333e-02 +407 387 8.33333333333333e-02 +407 50 -2.50000000000000e-01 +407 388 8.33333333333333e-02 +407 148 -8.33333333333333e-02 +407 395 -2.50000000000000e-01 +407 442 8.33333333333333e-02 +407 56 -2.50000000000000e-01 +407 394 -8.33333333333333e-02 +407 154 8.33333333333333e-02 +407 393 1.66666666666667e-01 +407 153 -1.66666666666667e-01 +408 408 1.25000000000000e+00 +408 413 -8.33333333333333e-02 +408 346 -4.16666666666667e-02 +408 337 4.16666666666667e-02 +408 347 8.33333333333333e-02 +408 67 8.33333333333333e-02 +408 517 -1.66666666666667e-01 +408 345 -1.25000000000000e-01 +408 338 -8.33333333333333e-02 +408 409 -1.66666666666667e-01 +408 412 1.66666666666667e-01 +408 49 8.33333333333333e-02 +408 411 -2.50000000000000e-01 +408 527 -8.33333333333333e-02 +408 422 8.33333333333333e-02 +408 68 8.33333333333333e-02 +408 251 -8.33333333333333e-02 +408 250 4.16666666666667e-02 +408 526 -8.33333333333333e-02 +408 66 -3.75000000000000e-01 +408 410 -1.66666666666667e-01 +408 248 8.33333333333333e-02 +408 50 8.33333333333333e-02 +408 247 -4.16666666666667e-02 +408 421 8.33333333333333e-02 +408 518 8.33333333333333e-02 +408 246 -1.25000000000000e-01 +408 48 -3.75000000000000e-01 +409 409 1.25000000000000e+00 +409 347 8.33333333333333e-02 +409 413 1.66666666666667e-01 +409 345 -4.16666666666667e-02 +409 336 4.16666666666667e-02 +409 68 -4.16666666666667e-02 +409 518 8.33333333333333e-02 +409 346 -1.25000000000000e-01 +409 66 8.33333333333333e-02 +409 516 -1.66666666666667e-01 +409 338 4.16666666666667e-02 +409 50 -4.16666666666667e-02 +409 412 -7.50000000000000e-01 +409 408 -1.66666666666667e-01 +409 411 1.66666666666667e-01 +409 48 8.33333333333333e-02 +409 251 4.16666666666667e-02 +409 527 -8.33333333333333e-02 +409 67 -1.25000000000000e-01 +409 249 4.16666666666667e-02 +409 525 -8.33333333333333e-02 +409 248 8.33333333333333e-02 +409 422 -1.66666666666667e-01 +409 410 -1.66666666666667e-01 +409 247 -1.25000000000000e-01 +409 49 -1.25000000000000e-01 +409 246 -4.16666666666667e-02 +409 420 8.33333333333333e-02 +410 410 1.25000000000000e+00 +410 411 -8.33333333333333e-02 +410 409 -1.66666666666667e-01 +410 346 8.33333333333333e-02 +410 412 1.66666666666667e-01 +410 347 -3.75000000000000e-01 +410 67 -4.16666666666667e-02 +410 517 8.33333333333333e-02 +410 345 8.33333333333333e-02 +410 413 -2.50000000000000e-01 +410 337 4.16666666666667e-02 +410 49 -4.16666666666667e-02 +410 336 -8.33333333333333e-02 +410 250 4.16666666666667e-02 +410 526 -8.33333333333333e-02 +410 525 -8.33333333333333e-02 +410 420 8.33333333333333e-02 +410 68 -1.25000000000000e-01 +410 66 8.33333333333333e-02 +410 249 -8.33333333333333e-02 +410 516 8.33333333333333e-02 +410 248 -3.75000000000000e-01 +410 50 -1.25000000000000e-01 +410 247 8.33333333333333e-02 +410 421 -1.66666666666667e-01 +410 408 -1.66666666666667e-01 +410 246 8.33333333333333e-02 +410 48 8.33333333333333e-02 +411 411 2.50000000000000e+00 +411 454 8.33333333333333e-02 +411 559 -8.33333333333333e-02 +411 422 1.66666666666667e-01 +411 527 -1.66666666666667e-01 +411 421 -8.33333333333333e-02 +411 526 8.33333333333333e-02 +411 560 -8.33333333333333e-02 +411 420 -2.50000000000000e-01 +411 347 8.33333333333333e-02 +411 410 -8.33333333333333e-02 +411 346 8.33333333333333e-02 +411 518 1.66666666666667e-01 +411 413 -3.33333333333333e-01 +411 517 1.66666666666667e-01 +411 516 -7.50000000000000e-01 +411 409 1.66666666666667e-01 +411 408 -2.50000000000000e-01 +411 412 -3.33333333333333e-01 +411 349 -8.33333333333333e-02 +411 350 1.66666666666667e-01 +411 341 -1.66666666666667e-01 +411 407 1.66666666666667e-01 +411 337 -8.33333333333333e-02 +411 340 8.33333333333333e-02 +411 74 8.33333333333333e-02 +411 443 -8.33333333333333e-02 +411 73 -1.66666666666667e-01 +411 442 1.66666666666667e-01 +411 348 -2.50000000000000e-01 +411 441 -2.50000000000000e-01 +411 338 -8.33333333333333e-02 +411 50 8.33333333333333e-02 +411 406 1.66666666666667e-01 +411 49 -1.66666666666667e-01 +411 455 8.33333333333333e-02 +411 405 -7.50000000000000e-01 +412 412 2.50000000000000e+00 +412 453 8.33333333333333e-02 +412 558 -8.33333333333333e-02 +412 560 -8.33333333333333e-02 +412 527 8.33333333333333e-02 +412 420 -8.33333333333333e-02 +412 525 8.33333333333333e-02 +412 422 1.66666666666667e-01 +412 421 -2.50000000000000e-01 +412 410 1.66666666666667e-01 +412 347 -1.66666666666667e-01 +412 345 8.33333333333333e-02 +412 518 -8.33333333333333e-02 +412 74 8.33333333333333e-02 +412 517 -2.50000000000000e-01 +412 516 1.66666666666667e-01 +412 50 8.33333333333333e-02 +412 409 -7.50000000000000e-01 +412 408 1.66666666666667e-01 +412 407 -8.33333333333333e-02 +412 411 -3.33333333333333e-01 +412 348 -8.33333333333333e-02 +412 341 8.33333333333333e-02 +412 338 -8.33333333333333e-02 +412 336 -8.33333333333333e-02 +412 339 8.33333333333333e-02 +412 350 1.66666666666667e-01 +412 443 1.66666666666667e-01 +412 413 -3.33333333333333e-01 +412 349 -2.50000000000000e-01 +412 442 -7.50000000000000e-01 +412 72 -1.66666666666667e-01 +412 441 1.66666666666667e-01 +412 455 -1.66666666666667e-01 +412 406 -2.50000000000000e-01 +412 405 1.66666666666667e-01 +412 48 -1.66666666666667e-01 +413 413 2.50000000000000e+00 +413 454 -1.66666666666667e-01 +413 559 -8.33333333333333e-02 +413 526 8.33333333333333e-02 +413 420 1.66666666666667e-01 +413 525 -1.66666666666667e-01 +413 558 -8.33333333333333e-02 +413 422 -7.50000000000000e-01 +413 421 1.66666666666667e-01 +413 345 8.33333333333333e-02 +413 408 -8.33333333333333e-02 +413 409 1.66666666666667e-01 +413 346 -1.66666666666667e-01 +413 518 -2.50000000000000e-01 +413 517 -8.33333333333333e-02 +413 73 8.33333333333333e-02 +413 516 1.66666666666667e-01 +413 411 -3.33333333333333e-01 +413 410 -2.50000000000000e-01 +413 49 8.33333333333333e-02 +413 406 -8.33333333333333e-02 +413 340 8.33333333333333e-02 +413 337 -8.33333333333333e-02 +413 348 1.66666666666667e-01 +413 339 -1.66666666666667e-01 +413 405 1.66666666666667e-01 +413 350 -7.50000000000000e-01 +413 443 -2.50000000000000e-01 +413 349 1.66666666666667e-01 +413 442 1.66666666666667e-01 +413 412 -3.33333333333333e-01 +413 72 8.33333333333333e-02 +413 441 -8.33333333333333e-02 +413 453 8.33333333333333e-02 +413 407 -2.50000000000000e-01 +413 336 -8.33333333333333e-02 +413 48 8.33333333333333e-02 +414 414 1.25000000000000e+00 +414 415 -1.66666666666667e-01 +414 389 -8.33333333333333e-02 +414 49 -4.16666666666667e-02 +414 388 4.16666666666667e-02 +414 398 8.33333333333333e-02 +414 109 -4.16666666666667e-02 +414 396 -3.75000000000000e-01 +414 640 8.33333333333333e-02 +414 419 -8.33333333333333e-02 +414 418 1.66666666666667e-01 +414 417 -2.50000000000000e-01 +414 641 8.33333333333333e-02 +414 422 8.33333333333333e-02 +414 644 -8.33333333333333e-02 +414 253 4.16666666666667e-02 +414 643 -8.33333333333333e-02 +414 110 8.33333333333333e-02 +414 254 -8.33333333333333e-02 +414 108 -1.25000000000000e-01 +414 416 -1.66666666666667e-01 +414 248 8.33333333333333e-02 +414 50 8.33333333333333e-02 +414 247 8.33333333333333e-02 +414 421 -1.66666666666667e-01 +414 397 8.33333333333333e-02 +414 246 -3.75000000000000e-01 +414 48 -1.25000000000000e-01 +415 415 1.25000000000000e+00 +415 389 4.16666666666667e-02 +415 396 8.33333333333333e-02 +415 414 -1.66666666666667e-01 +415 48 -4.16666666666667e-02 +415 387 4.16666666666667e-02 +415 397 -1.25000000000000e-01 +415 108 -4.16666666666667e-02 +415 639 8.33333333333333e-02 +415 50 8.33333333333333e-02 +415 416 -1.66666666666667e-01 +415 419 1.66666666666667e-01 +415 418 -7.50000000000000e-01 +415 417 1.66666666666667e-01 +415 110 8.33333333333333e-02 +415 641 -1.66666666666667e-01 +415 252 4.16666666666667e-02 +415 642 -8.33333333333333e-02 +415 254 4.16666666666667e-02 +415 644 -8.33333333333333e-02 +415 109 -1.25000000000000e-01 +415 248 -4.16666666666667e-02 +415 422 8.33333333333333e-02 +415 398 -4.16666666666667e-02 +415 247 -1.25000000000000e-01 +415 49 -1.25000000000000e-01 +415 246 8.33333333333333e-02 +415 420 -1.66666666666667e-01 +416 416 1.25000000000000e+00 +416 388 4.16666666666667e-02 +416 387 -8.33333333333333e-02 +416 398 -1.25000000000000e-01 +416 396 8.33333333333333e-02 +416 419 -2.50000000000000e-01 +416 49 8.33333333333333e-02 +416 415 -1.66666666666667e-01 +416 418 1.66666666666667e-01 +416 417 -8.33333333333333e-02 +416 109 8.33333333333333e-02 +416 640 -1.66666666666667e-01 +416 639 8.33333333333333e-02 +416 420 8.33333333333333e-02 +416 642 -8.33333333333333e-02 +416 110 -3.75000000000000e-01 +416 253 4.16666666666667e-02 +416 643 -8.33333333333333e-02 +416 108 8.33333333333333e-02 +416 252 -8.33333333333333e-02 +416 397 -4.16666666666667e-02 +416 248 -1.25000000000000e-01 +416 50 -3.75000000000000e-01 +416 247 -4.16666666666667e-02 +416 421 8.33333333333333e-02 +416 414 -1.66666666666667e-01 +416 246 8.33333333333333e-02 +416 48 8.33333333333333e-02 +417 417 2.50000000000000e+00 +417 395 -1.66666666666667e-01 +417 398 8.33333333333333e-02 +417 389 -8.33333333333333e-02 +417 397 -1.66666666666667e-01 +417 403 1.66666666666667e-01 +417 388 -8.33333333333333e-02 +417 404 1.66666666666667e-01 +417 402 -7.50000000000000e-01 +417 643 8.33333333333333e-02 +417 640 -8.33333333333333e-02 +417 644 -1.66666666666667e-01 +417 641 1.66666666666667e-01 +417 50 8.33333333333333e-02 +417 416 -8.33333333333333e-02 +417 415 1.66666666666667e-01 +417 418 -3.33333333333333e-01 +417 414 -2.50000000000000e-01 +417 116 8.33333333333333e-02 +417 639 -2.50000000000000e-01 +417 452 -8.33333333333333e-02 +417 455 8.33333333333333e-02 +417 653 -8.33333333333333e-02 +417 421 1.66666666666667e-01 +417 454 -1.66666666666667e-01 +417 451 1.66666666666667e-01 +417 422 1.66666666666667e-01 +417 407 1.66666666666667e-01 +417 419 -3.33333333333333e-01 +417 49 8.33333333333333e-02 +417 406 -8.33333333333333e-02 +417 420 -7.50000000000000e-01 +417 405 -2.50000000000000e-01 +417 652 -8.33333333333333e-02 +417 115 8.33333333333333e-02 +417 394 8.33333333333333e-02 +417 450 -2.50000000000000e-01 +418 418 2.50000000000000e+00 +418 395 8.33333333333333e-02 +418 389 -8.33333333333333e-02 +418 398 8.33333333333333e-02 +418 404 -8.33333333333333e-02 +418 396 -1.66666666666667e-01 +418 402 1.66666666666667e-01 +418 387 -8.33333333333333e-02 +418 403 -2.50000000000000e-01 +418 642 8.33333333333333e-02 +418 639 -8.33333333333333e-02 +418 644 8.33333333333333e-02 +418 416 1.66666666666667e-01 +418 415 -7.50000000000000e-01 +418 414 1.66666666666667e-01 +418 417 -3.33333333333333e-01 +418 641 1.66666666666667e-01 +418 640 -2.50000000000000e-01 +418 419 -3.33333333333333e-01 +418 422 -8.33333333333333e-02 +418 420 1.66666666666667e-01 +418 455 8.33333333333333e-02 +418 653 -8.33333333333333e-02 +418 453 -1.66666666666667e-01 +418 450 1.66666666666667e-01 +418 50 -1.66666666666667e-01 +418 407 1.66666666666667e-01 +418 421 -2.50000000000000e-01 +418 406 -2.50000000000000e-01 +418 48 8.33333333333333e-02 +418 405 -8.33333333333333e-02 +418 452 1.66666666666667e-01 +418 116 -1.66666666666667e-01 +418 393 8.33333333333333e-02 +418 451 -7.50000000000000e-01 +418 651 -8.33333333333333e-02 +418 114 8.33333333333333e-02 +419 419 2.50000000000000e+00 +419 393 -1.66666666666667e-01 +419 388 -8.33333333333333e-02 +419 396 8.33333333333333e-02 +419 387 -8.33333333333333e-02 +419 397 8.33333333333333e-02 +419 403 -8.33333333333333e-02 +419 404 -2.50000000000000e-01 +419 402 1.66666666666667e-01 +419 643 8.33333333333333e-02 +419 642 -1.66666666666667e-01 +419 639 1.66666666666667e-01 +419 416 -2.50000000000000e-01 +419 415 1.66666666666667e-01 +419 48 8.33333333333333e-02 +419 414 -8.33333333333333e-02 +419 641 -7.50000000000000e-01 +419 640 1.66666666666667e-01 +419 114 8.33333333333333e-02 +419 418 -3.33333333333333e-01 +419 450 -8.33333333333333e-02 +419 421 -8.33333333333333e-02 +419 453 8.33333333333333e-02 +419 651 -8.33333333333333e-02 +419 454 8.33333333333333e-02 +419 652 -8.33333333333333e-02 +419 422 -2.50000000000000e-01 +419 407 -7.50000000000000e-01 +419 49 -1.66666666666667e-01 +419 406 1.66666666666667e-01 +419 420 1.66666666666667e-01 +419 405 1.66666666666667e-01 +419 417 -3.33333333333333e-01 +419 394 8.33333333333333e-02 +419 452 -2.50000000000000e-01 +419 451 1.66666666666667e-01 +419 115 -1.66666666666667e-01 +420 420 2.50000000000000e+00 +420 412 -8.33333333333333e-02 +420 560 8.33333333333333e-02 +420 559 -1.66666666666667e-01 +420 411 -2.50000000000000e-01 +420 410 8.33333333333333e-02 +420 526 1.66666666666667e-01 +420 527 1.66666666666667e-01 +420 525 -7.50000000000000e-01 +420 409 8.33333333333333e-02 +420 422 -3.33333333333333e-01 +420 50 -8.33333333333333e-02 +420 122 -8.33333333333333e-02 +420 455 -8.33333333333333e-02 +420 653 8.33333333333333e-02 +420 454 1.66666666666667e-01 +420 421 -3.33333333333333e-01 +420 418 1.66666666666667e-01 +420 407 -1.66666666666667e-01 +420 419 1.66666666666667e-01 +420 49 -8.33333333333333e-02 +420 406 8.33333333333333e-02 +420 417 -7.50000000000000e-01 +420 121 -8.33333333333333e-02 +420 652 8.33333333333333e-02 +420 453 -2.50000000000000e-01 +420 248 -8.33333333333333e-02 +420 416 8.33333333333333e-02 +420 259 8.33333333333333e-02 +420 643 -8.33333333333333e-02 +420 415 -1.66666666666667e-01 +420 247 1.66666666666667e-01 +420 246 -2.50000000000000e-01 +420 644 1.66666666666667e-01 +420 260 -1.66666666666667e-01 +420 642 -2.50000000000000e-01 +420 413 1.66666666666667e-01 +421 421 2.50000000000000e+00 +421 411 -8.33333333333333e-02 +421 558 -1.66666666666667e-01 +421 413 1.66666666666667e-01 +421 412 -2.50000000000000e-01 +421 527 -8.33333333333333e-02 +421 525 1.66666666666667e-01 +421 526 -2.50000000000000e-01 +421 410 -1.66666666666667e-01 +421 408 8.33333333333333e-02 +421 407 8.33333333333333e-02 +421 419 -8.33333333333333e-02 +421 453 1.66666666666667e-01 +421 420 -3.33333333333333e-01 +421 417 1.66666666666667e-01 +421 418 -2.50000000000000e-01 +421 48 -8.33333333333333e-02 +421 405 8.33333333333333e-02 +421 455 1.66666666666667e-01 +421 653 -1.66666666666667e-01 +421 454 -7.50000000000000e-01 +421 120 -8.33333333333333e-02 +421 651 8.33333333333333e-02 +421 248 1.66666666666667e-01 +421 422 -3.33333333333333e-01 +421 644 1.66666666666667e-01 +421 258 8.33333333333333e-02 +421 642 -8.33333333333333e-02 +421 416 8.33333333333333e-02 +421 50 -8.33333333333333e-02 +421 247 -7.50000000000000e-01 +421 414 -1.66666666666667e-01 +421 246 1.66666666666667e-01 +421 260 8.33333333333333e-02 +421 122 -8.33333333333333e-02 +421 643 -2.50000000000000e-01 +421 560 8.33333333333333e-02 +422 422 2.50000000000000e+00 +422 411 1.66666666666667e-01 +422 558 8.33333333333333e-02 +422 413 -7.50000000000000e-01 +422 412 1.66666666666667e-01 +422 526 -8.33333333333333e-02 +422 408 8.33333333333333e-02 +422 527 -2.50000000000000e-01 +422 525 1.66666666666667e-01 +422 409 -1.66666666666667e-01 +422 420 -3.33333333333333e-01 +422 48 -8.33333333333333e-02 +422 120 -8.33333333333333e-02 +422 406 8.33333333333333e-02 +422 418 -8.33333333333333e-02 +422 453 -8.33333333333333e-02 +422 651 8.33333333333333e-02 +422 419 -2.50000000000000e-01 +422 405 -1.66666666666667e-01 +422 417 1.66666666666667e-01 +422 455 -2.50000000000000e-01 +422 454 1.66666666666667e-01 +422 652 -1.66666666666667e-01 +422 246 -8.33333333333333e-02 +422 414 8.33333333333333e-02 +422 247 1.66666666666667e-01 +422 421 -3.33333333333333e-01 +422 643 1.66666666666667e-01 +422 248 -2.50000000000000e-01 +422 415 8.33333333333333e-02 +422 49 -8.33333333333333e-02 +422 644 -7.50000000000000e-01 +422 559 8.33333333333333e-02 +422 259 8.33333333333333e-02 +422 121 -8.33333333333333e-02 +422 642 1.66666666666667e-01 +422 258 -1.66666666666667e-01 +423 423 2.50000000000000e+00 +423 431 -8.33333333333333e-02 +423 445 -1.66666666666667e-01 +423 430 1.66666666666667e-01 +423 429 -2.50000000000000e-01 +423 356 -1.66666666666667e-01 +423 355 8.33333333333333e-02 +423 359 1.66666666666667e-01 +423 358 -8.33333333333333e-02 +423 357 -2.50000000000000e-01 +423 458 -8.33333333333333e-02 +423 440 8.33333333333333e-02 +423 53 1.66666666666667e-01 +423 425 -3.33333333333333e-01 +423 437 1.66666666666667e-01 +423 439 8.33333333333333e-02 +423 436 -8.33333333333333e-02 +423 435 -2.50000000000000e-01 +423 56 1.66666666666667e-01 +423 452 -1.66666666666667e-01 +423 457 -8.33333333333333e-02 +423 451 8.33333333333333e-02 +423 151 -8.33333333333333e-02 +423 154 8.33333333333333e-02 +423 392 8.33333333333333e-02 +423 152 -8.33333333333333e-02 +423 52 1.66666666666667e-01 +423 391 -1.66666666666667e-01 +423 51 -7.50000000000000e-01 +423 395 -8.33333333333333e-02 +423 155 8.33333333333333e-02 +423 424 -3.33333333333333e-01 +423 394 1.66666666666667e-01 +423 55 1.66666666666667e-01 +423 446 8.33333333333333e-02 +423 393 -2.50000000000000e-01 +423 54 -7.50000000000000e-01 +424 424 2.50000000000000e+00 +424 446 8.33333333333333e-02 +424 444 -1.66666666666667e-01 +424 430 -7.50000000000000e-01 +424 429 1.66666666666667e-01 +424 356 8.33333333333333e-02 +424 354 8.33333333333333e-02 +424 359 1.66666666666667e-01 +424 358 -2.50000000000000e-01 +424 357 -8.33333333333333e-02 +424 425 -3.33333333333333e-01 +424 56 -8.33333333333333e-02 +424 53 -8.33333333333333e-02 +424 452 8.33333333333333e-02 +424 458 -8.33333333333333e-02 +424 440 -1.66666666666667e-01 +424 437 1.66666666666667e-01 +424 436 -2.50000000000000e-01 +424 438 8.33333333333333e-02 +424 435 -8.33333333333333e-02 +424 456 -8.33333333333333e-02 +424 450 8.33333333333333e-02 +424 392 8.33333333333333e-02 +424 152 -8.33333333333333e-02 +424 150 -8.33333333333333e-02 +424 153 8.33333333333333e-02 +424 52 -2.50000000000000e-01 +424 51 1.66666666666667e-01 +424 390 -1.66666666666667e-01 +424 395 1.66666666666667e-01 +424 155 -1.66666666666667e-01 +424 431 1.66666666666667e-01 +424 394 -7.50000000000000e-01 +424 55 -2.50000000000000e-01 +424 423 -3.33333333333333e-01 +424 393 1.66666666666667e-01 +424 54 1.66666666666667e-01 +425 425 2.50000000000000e+00 +425 429 -8.33333333333333e-02 +425 430 1.66666666666667e-01 +425 445 8.33333333333333e-02 +425 431 -2.50000000000000e-01 +425 355 8.33333333333333e-02 +425 354 -1.66666666666667e-01 +425 359 -7.50000000000000e-01 +425 358 1.66666666666667e-01 +425 357 1.66666666666667e-01 +425 424 -3.33333333333333e-01 +425 55 -8.33333333333333e-02 +425 52 -8.33333333333333e-02 +425 451 8.33333333333333e-02 +425 457 -8.33333333333333e-02 +425 456 -8.33333333333333e-02 +425 438 8.33333333333333e-02 +425 437 -7.50000000000000e-01 +425 439 -1.66666666666667e-01 +425 436 1.66666666666667e-01 +425 51 1.66666666666667e-01 +425 423 -3.33333333333333e-01 +425 435 1.66666666666667e-01 +425 54 1.66666666666667e-01 +425 450 -1.66666666666667e-01 +425 391 8.33333333333333e-02 +425 151 -8.33333333333333e-02 +425 53 -2.50000000000000e-01 +425 390 8.33333333333333e-02 +425 150 -8.33333333333333e-02 +425 444 8.33333333333333e-02 +425 395 -2.50000000000000e-01 +425 56 -2.50000000000000e-01 +425 394 1.66666666666667e-01 +425 154 -1.66666666666667e-01 +425 393 -8.33333333333333e-02 +425 153 8.33333333333333e-02 +426 426 6.37500000000000e+01 +426 365 4.25000000000000e+00 +426 364 -2.12500000000000e+00 +426 363 -6.37500000000000e+00 +426 355 2.12500000000000e+00 +426 428 -8.50000000000000e+00 +426 278 4.25000000000000e+00 +426 280 2.12500000000000e+00 +426 277 -2.12500000000000e+00 +426 53 -2.12500000000000e+00 +426 52 4.25000000000000e+00 +426 51 -6.37500000000000e+00 +426 276 -6.37500000000000e+00 +426 92 -2.12500000000000e+00 +426 281 2.12500000000000e+00 +426 427 -8.50000000000000e+00 +426 91 4.25000000000000e+00 +426 356 2.12500000000000e+00 +426 90 -6.37500000000000e+00 +426 431 1.66666666666667e-01 +426 611 8.33333333333333e-02 +426 610 -1.66666666666667e-01 +426 430 1.66666666666667e-01 +426 429 -7.50000000000000e-01 +426 614 -8.33333333333333e-02 +426 613 -8.33333333333333e-02 +426 440 -1.66666666666667e-01 +426 439 8.33333333333333e-02 +426 1729 4.16666666666667e+00 +426 1720 -4.16666666666667e+00 +426 1721 -4.16666666666667e+00 +426 1730 -8.33333333333333e+00 +426 1793 8.33333333333333e+00 +426 1787 4.16666666666667e+00 +426 1786 -8.33333333333333e+00 +426 1792 8.33333333333333e+00 +426 1791 -3.75000000000000e+01 +427 427 6.37500000000000e+01 +427 364 -6.37500000000000e+00 +427 363 -2.12500000000000e+00 +427 356 -4.25000000000000e+00 +427 354 2.12500000000000e+00 +427 279 2.12500000000000e+00 +427 276 -2.12500000000000e+00 +427 53 4.25000000000000e+00 +427 428 -8.50000000000000e+00 +427 278 4.25000000000000e+00 +427 52 -1.91250000000000e+01 +427 277 -6.37500000000000e+00 +427 51 4.25000000000000e+00 +427 92 4.25000000000000e+00 +427 281 -4.25000000000000e+00 +427 365 4.25000000000000e+00 +427 91 -1.91250000000000e+01 +427 426 -8.50000000000000e+00 +427 90 4.25000000000000e+00 +427 431 -8.33333333333333e-02 +427 609 -1.66666666666667e-01 +427 430 -2.50000000000000e-01 +427 429 1.66666666666667e-01 +427 614 -8.33333333333333e-02 +427 440 8.33333333333333e-02 +427 612 -8.33333333333333e-02 +427 611 8.33333333333333e-02 +427 438 8.33333333333333e-02 +427 1728 4.16666666666667e+00 +427 1719 -4.16666666666667e+00 +427 1730 4.16666666666667e+00 +427 1721 -4.16666666666667e+00 +427 1793 -4.16666666666667e+00 +427 1787 4.16666666666667e+00 +427 1785 -8.33333333333333e+00 +427 1792 -1.25000000000000e+01 +427 1791 8.33333333333333e+00 +428 428 6.37500000000000e+01 +428 365 -1.91250000000000e+01 +428 364 4.25000000000000e+00 +428 363 4.25000000000000e+00 +428 355 -4.25000000000000e+00 +428 426 -8.50000000000000e+00 +428 276 4.25000000000000e+00 +428 53 -6.37500000000000e+00 +428 278 -1.91250000000000e+01 +428 52 4.25000000000000e+00 +428 427 -8.50000000000000e+00 +428 277 4.25000000000000e+00 +428 51 -2.12500000000000e+00 +428 354 2.12500000000000e+00 +428 92 -6.37500000000000e+00 +428 91 4.25000000000000e+00 +428 280 -4.25000000000000e+00 +428 90 -2.12500000000000e+00 +428 279 2.12500000000000e+00 +428 430 -8.33333333333333e-02 +428 429 1.66666666666667e-01 +428 609 8.33333333333333e-02 +428 431 -2.50000000000000e-01 +428 612 -8.33333333333333e-02 +428 613 -8.33333333333333e-02 +428 439 8.33333333333333e-02 +428 610 8.33333333333333e-02 +428 438 -1.66666666666667e-01 +428 1719 -4.16666666666667e+00 +428 1729 4.16666666666667e+00 +428 1728 -8.33333333333333e+00 +428 1720 -4.16666666666667e+00 +428 1792 -4.16666666666667e+00 +428 1786 4.16666666666667e+00 +428 1791 8.33333333333333e+00 +428 1785 4.16666666666667e+00 +428 1793 -1.25000000000000e+01 +429 429 2.50000000000000e+00 +429 457 8.33333333333333e-02 +429 619 -8.33333333333333e-02 +429 614 8.33333333333333e-02 +429 620 -8.33333333333333e-02 +429 613 8.33333333333333e-02 +429 439 -8.33333333333333e-02 +429 440 1.66666666666667e-01 +429 438 -2.50000000000000e-01 +429 365 -1.66666666666667e-01 +429 428 1.66666666666667e-01 +429 364 8.33333333333333e-02 +429 95 8.33333333333333e-02 +429 611 -8.33333333333333e-02 +429 610 1.66666666666667e-01 +429 609 -2.50000000000000e-01 +429 53 8.33333333333333e-02 +429 427 1.66666666666667e-01 +429 426 -7.50000000000000e-01 +429 425 -8.33333333333333e-02 +429 430 -3.33333333333333e-01 +429 367 -8.33333333333333e-02 +429 359 8.33333333333333e-02 +429 356 -8.33333333333333e-02 +429 358 8.33333333333333e-02 +429 355 -8.33333333333333e-02 +429 368 1.66666666666667e-01 +429 446 1.66666666666667e-01 +429 431 -3.33333333333333e-01 +429 94 -1.66666666666667e-01 +429 445 1.66666666666667e-01 +429 366 -2.50000000000000e-01 +429 444 -7.50000000000000e-01 +429 424 1.66666666666667e-01 +429 52 -1.66666666666667e-01 +429 458 -1.66666666666667e-01 +429 423 -2.50000000000000e-01 +430 430 2.50000000000000e+00 +430 456 8.33333333333333e-02 +430 618 -8.33333333333333e-02 +430 614 -1.66666666666667e-01 +430 440 1.66666666666667e-01 +430 612 8.33333333333333e-02 +430 438 -8.33333333333333e-02 +430 620 -8.33333333333333e-02 +430 439 -2.50000000000000e-01 +430 365 8.33333333333333e-02 +430 428 -8.33333333333333e-02 +430 363 8.33333333333333e-02 +430 611 1.66666666666667e-01 +430 431 -3.33333333333333e-01 +430 610 -7.50000000000000e-01 +430 609 1.66666666666667e-01 +430 427 -2.50000000000000e-01 +430 426 1.66666666666667e-01 +430 429 -3.33333333333333e-01 +430 366 -8.33333333333333e-02 +430 368 1.66666666666667e-01 +430 359 -1.66666666666667e-01 +430 425 1.66666666666667e-01 +430 357 8.33333333333333e-02 +430 354 -8.33333333333333e-02 +430 95 8.33333333333333e-02 +430 446 -8.33333333333333e-02 +430 367 -2.50000000000000e-01 +430 445 -2.50000000000000e-01 +430 93 -1.66666666666667e-01 +430 444 1.66666666666667e-01 +430 356 -8.33333333333333e-02 +430 53 8.33333333333333e-02 +430 458 8.33333333333333e-02 +430 424 -7.50000000000000e-01 +430 423 1.66666666666667e-01 +430 51 -1.66666666666667e-01 +431 431 2.50000000000000e+00 +431 456 -1.66666666666667e-01 +431 612 8.33333333333333e-02 +431 618 -8.33333333333333e-02 +431 613 -1.66666666666667e-01 +431 439 1.66666666666667e-01 +431 619 -8.33333333333333e-02 +431 440 -7.50000000000000e-01 +431 438 1.66666666666667e-01 +431 364 8.33333333333333e-02 +431 427 -8.33333333333333e-02 +431 363 -1.66666666666667e-01 +431 426 1.66666666666667e-01 +431 611 -2.50000000000000e-01 +431 610 1.66666666666667e-01 +431 430 -3.33333333333333e-01 +431 93 8.33333333333333e-02 +431 609 -8.33333333333333e-02 +431 428 -2.50000000000000e-01 +431 51 8.33333333333333e-02 +431 423 -8.33333333333333e-02 +431 367 1.66666666666667e-01 +431 357 8.33333333333333e-02 +431 354 -8.33333333333333e-02 +431 358 -1.66666666666667e-01 +431 424 1.66666666666667e-01 +431 368 -7.50000000000000e-01 +431 446 -2.50000000000000e-01 +431 94 8.33333333333333e-02 +431 445 -8.33333333333333e-02 +431 366 1.66666666666667e-01 +431 444 1.66666666666667e-01 +431 429 -3.33333333333333e-01 +431 457 8.33333333333333e-02 +431 425 -2.50000000000000e-01 +431 355 -8.33333333333333e-02 +431 52 8.33333333333333e-02 +432 432 6.37500000000000e+01 +432 401 -2.12500000000000e+00 +432 400 4.25000000000000e+00 +432 399 -6.37500000000000e+00 +432 392 2.12500000000000e+00 +432 284 2.12500000000000e+00 +432 278 -2.12500000000000e+00 +432 433 -8.50000000000000e+00 +432 277 4.25000000000000e+00 +432 53 4.25000000000000e+00 +432 52 -2.12500000000000e+00 +432 51 -6.37500000000000e+00 +432 276 -6.37500000000000e+00 +432 434 -8.50000000000000e+00 +432 113 4.25000000000000e+00 +432 112 -2.12500000000000e+00 +432 283 2.12500000000000e+00 +432 391 2.12500000000000e+00 +432 111 -6.37500000000000e+00 +432 646 8.33333333333333e-02 +432 647 -1.66666666666667e-01 +432 437 1.66666666666667e-01 +432 436 1.66666666666667e-01 +432 435 -7.50000000000000e-01 +432 649 -8.33333333333333e-02 +432 650 -8.33333333333333e-02 +432 440 8.33333333333333e-02 +432 439 -1.66666666666667e-01 +432 1756 -4.16666666666667e+00 +432 1766 4.16666666666667e+00 +432 1765 -8.33333333333333e+00 +432 1757 -4.16666666666667e+00 +432 1798 8.33333333333333e+00 +432 1787 -8.33333333333333e+00 +432 1786 4.16666666666667e+00 +432 1799 8.33333333333333e+00 +432 1797 -3.75000000000000e+01 +433 433 6.37500000000000e+01 +433 401 4.25000000000000e+00 +433 400 -1.91250000000000e+01 +433 399 4.25000000000000e+00 +433 392 -4.25000000000000e+00 +433 432 -8.50000000000000e+00 +433 276 4.25000000000000e+00 +433 53 4.25000000000000e+00 +433 434 -8.50000000000000e+00 +433 278 4.25000000000000e+00 +433 52 -6.37500000000000e+00 +433 277 -1.91250000000000e+01 +433 51 -2.12500000000000e+00 +433 113 4.25000000000000e+00 +433 284 -4.25000000000000e+00 +433 390 2.12500000000000e+00 +433 112 -6.37500000000000e+00 +433 111 -2.12500000000000e+00 +433 282 2.12500000000000e+00 +433 645 8.33333333333333e-02 +433 647 8.33333333333333e-02 +433 437 -8.33333333333333e-02 +433 436 -2.50000000000000e-01 +433 435 1.66666666666667e-01 +433 440 8.33333333333333e-02 +433 650 -8.33333333333333e-02 +433 648 -8.33333333333333e-02 +433 438 -1.66666666666667e-01 +433 1755 -4.16666666666667e+00 +433 1766 4.16666666666667e+00 +433 1757 -4.16666666666667e+00 +433 1764 -8.33333333333333e+00 +433 1787 4.16666666666667e+00 +433 1799 -4.16666666666667e+00 +433 1797 8.33333333333333e+00 +433 1785 4.16666666666667e+00 +433 1798 -1.25000000000000e+01 +434 434 6.37500000000000e+01 +434 401 -6.37500000000000e+00 +434 400 4.25000000000000e+00 +434 399 -2.12500000000000e+00 +434 391 -4.25000000000000e+00 +434 390 2.12500000000000e+00 +434 282 2.12500000000000e+00 +434 276 -2.12500000000000e+00 +434 53 -1.91250000000000e+01 +434 278 -6.37500000000000e+00 +434 52 4.25000000000000e+00 +434 433 -8.50000000000000e+00 +434 277 4.25000000000000e+00 +434 51 4.25000000000000e+00 +434 113 -1.91250000000000e+01 +434 112 4.25000000000000e+00 +434 283 -4.25000000000000e+00 +434 432 -8.50000000000000e+00 +434 111 4.25000000000000e+00 +434 646 8.33333333333333e-02 +434 645 -1.66666666666667e-01 +434 437 -2.50000000000000e-01 +434 436 -8.33333333333333e-02 +434 435 1.66666666666667e-01 +434 439 8.33333333333333e-02 +434 649 -8.33333333333333e-02 +434 648 -8.33333333333333e-02 +434 438 8.33333333333333e-02 +434 1756 -4.16666666666667e+00 +434 1764 4.16666666666667e+00 +434 1755 -4.16666666666667e+00 +434 1786 4.16666666666667e+00 +434 1798 -4.16666666666667e+00 +434 1785 -8.33333333333333e+00 +434 1765 4.16666666666667e+00 +434 1799 -1.25000000000000e+01 +434 1797 8.33333333333333e+00 +435 435 2.50000000000000e+00 +435 395 8.33333333333333e-02 +435 392 -8.33333333333333e-02 +435 404 -8.33333333333333e-02 +435 401 8.33333333333333e-02 +435 403 1.66666666666667e-01 +435 400 -1.66666666666667e-01 +435 391 -8.33333333333333e-02 +435 402 -2.50000000000000e-01 +435 649 8.33333333333333e-02 +435 646 -8.33333333333333e-02 +435 650 8.33333333333333e-02 +435 434 1.66666666666667e-01 +435 433 1.66666666666667e-01 +435 436 -3.33333333333333e-01 +435 432 -7.50000000000000e-01 +435 647 1.66666666666667e-01 +435 645 -2.50000000000000e-01 +435 437 -3.33333333333333e-01 +435 440 -8.33333333333333e-02 +435 439 1.66666666666667e-01 +435 656 -8.33333333333333e-02 +435 458 8.33333333333333e-02 +435 457 -1.66666666666667e-01 +435 451 1.66666666666667e-01 +435 53 -1.66666666666667e-01 +435 425 1.66666666666667e-01 +435 52 8.33333333333333e-02 +435 424 -8.33333333333333e-02 +435 438 -2.50000000000000e-01 +435 423 -2.50000000000000e-01 +435 452 1.66666666666667e-01 +435 116 -1.66666666666667e-01 +435 655 -8.33333333333333e-02 +435 115 8.33333333333333e-02 +435 394 8.33333333333333e-02 +435 450 -7.50000000000000e-01 +436 436 2.50000000000000e+00 +436 395 -1.66666666666667e-01 +436 392 -8.33333333333333e-02 +436 401 8.33333333333333e-02 +436 402 1.66666666666667e-01 +436 399 -1.66666666666667e-01 +436 390 -8.33333333333333e-02 +436 404 1.66666666666667e-01 +436 403 -7.50000000000000e-01 +436 648 8.33333333333333e-02 +436 645 -8.33333333333333e-02 +436 647 1.66666666666667e-01 +436 650 -1.66666666666667e-01 +436 434 -8.33333333333333e-02 +436 53 8.33333333333333e-02 +436 433 -2.50000000000000e-01 +436 432 1.66666666666667e-01 +436 435 -3.33333333333333e-01 +436 116 8.33333333333333e-02 +436 646 -2.50000000000000e-01 +436 452 -8.33333333333333e-02 +436 458 8.33333333333333e-02 +436 656 -8.33333333333333e-02 +436 438 1.66666666666667e-01 +436 456 -1.66666666666667e-01 +436 450 1.66666666666667e-01 +436 440 1.66666666666667e-01 +436 425 1.66666666666667e-01 +436 437 -3.33333333333333e-01 +436 439 -7.50000000000000e-01 +436 424 -2.50000000000000e-01 +436 51 8.33333333333333e-02 +436 423 -8.33333333333333e-02 +436 393 8.33333333333333e-02 +436 451 -2.50000000000000e-01 +436 654 -8.33333333333333e-02 +436 114 8.33333333333333e-02 +437 437 2.50000000000000e+00 +437 393 8.33333333333333e-02 +437 390 -8.33333333333333e-02 +437 391 -8.33333333333333e-02 +437 400 8.33333333333333e-02 +437 402 -8.33333333333333e-02 +437 399 8.33333333333333e-02 +437 404 -2.50000000000000e-01 +437 403 1.66666666666667e-01 +437 646 1.66666666666667e-01 +437 649 -1.66666666666667e-01 +437 648 8.33333333333333e-02 +437 434 -2.50000000000000e-01 +437 433 -8.33333333333333e-02 +437 52 8.33333333333333e-02 +437 432 1.66666666666667e-01 +437 647 -7.50000000000000e-01 +437 115 8.33333333333333e-02 +437 645 1.66666666666667e-01 +437 451 -8.33333333333333e-02 +437 435 -3.33333333333333e-01 +437 438 -8.33333333333333e-02 +437 457 8.33333333333333e-02 +437 655 -8.33333333333333e-02 +437 654 -8.33333333333333e-02 +437 456 8.33333333333333e-02 +437 440 -2.50000000000000e-01 +437 425 -7.50000000000000e-01 +437 439 1.66666666666667e-01 +437 424 1.66666666666667e-01 +437 436 -3.33333333333333e-01 +437 51 -1.66666666666667e-01 +437 423 1.66666666666667e-01 +437 394 -1.66666666666667e-01 +437 452 -2.50000000000000e-01 +437 450 1.66666666666667e-01 +437 114 -1.66666666666667e-01 +438 438 2.50000000000000e+00 +438 430 -8.33333333333333e-02 +438 619 -1.66666666666667e-01 +438 431 1.66666666666667e-01 +438 429 -2.50000000000000e-01 +438 614 -8.33333333333333e-02 +438 613 1.66666666666667e-01 +438 612 -2.50000000000000e-01 +438 428 -1.66666666666667e-01 +438 427 8.33333333333333e-02 +438 425 8.33333333333333e-02 +438 437 -8.33333333333333e-02 +438 439 -3.33333333333333e-01 +438 457 1.66666666666667e-01 +438 436 1.66666666666667e-01 +438 458 1.66666666666667e-01 +438 656 -1.66666666666667e-01 +438 130 -8.33333333333333e-02 +438 655 8.33333333333333e-02 +438 456 -7.50000000000000e-01 +438 52 -8.33333333333333e-02 +438 424 8.33333333333333e-02 +438 435 -2.50000000000000e-01 +438 278 1.66666666666667e-01 +438 440 -3.33333333333333e-01 +438 650 1.66666666666667e-01 +438 286 8.33333333333333e-02 +438 649 -8.33333333333333e-02 +438 434 8.33333333333333e-02 +438 53 -8.33333333333333e-02 +438 277 1.66666666666667e-01 +438 433 -1.66666666666667e-01 +438 276 -7.50000000000000e-01 +438 287 8.33333333333333e-02 +438 131 -8.33333333333333e-02 +438 648 -2.50000000000000e-01 +438 620 8.33333333333333e-02 +439 439 2.50000000000000e+00 +439 429 -8.33333333333333e-02 +439 620 8.33333333333333e-02 +439 618 -1.66666666666667e-01 +439 430 -2.50000000000000e-01 +439 428 8.33333333333333e-02 +439 612 1.66666666666667e-01 +439 614 1.66666666666667e-01 +439 613 -7.50000000000000e-01 +439 426 8.33333333333333e-02 +439 440 -3.33333333333333e-01 +439 53 -8.33333333333333e-02 +439 131 -8.33333333333333e-02 +439 458 -8.33333333333333e-02 +439 656 8.33333333333333e-02 +439 438 -3.33333333333333e-01 +439 456 1.66666666666667e-01 +439 435 1.66666666666667e-01 +439 457 -2.50000000000000e-01 +439 129 -8.33333333333333e-02 +439 654 8.33333333333333e-02 +439 425 -1.66666666666667e-01 +439 437 1.66666666666667e-01 +439 436 -7.50000000000000e-01 +439 51 -8.33333333333333e-02 +439 423 8.33333333333333e-02 +439 278 -8.33333333333333e-02 +439 434 8.33333333333333e-02 +439 285 8.33333333333333e-02 +439 648 -8.33333333333333e-02 +439 277 -2.50000000000000e-01 +439 276 1.66666666666667e-01 +439 432 -1.66666666666667e-01 +439 287 -1.66666666666667e-01 +439 650 1.66666666666667e-01 +439 649 -2.50000000000000e-01 +439 431 1.66666666666667e-01 +440 440 2.50000000000000e+00 +440 430 1.66666666666667e-01 +440 619 8.33333333333333e-02 +440 431 -7.50000000000000e-01 +440 429 1.66666666666667e-01 +440 612 -8.33333333333333e-02 +440 427 8.33333333333333e-02 +440 614 -2.50000000000000e-01 +440 613 1.66666666666667e-01 +440 426 -1.66666666666667e-01 +440 439 -3.33333333333333e-01 +440 52 -8.33333333333333e-02 +440 130 -8.33333333333333e-02 +440 423 8.33333333333333e-02 +440 435 -8.33333333333333e-02 +440 457 -8.33333333333333e-02 +440 655 8.33333333333333e-02 +440 458 -2.50000000000000e-01 +440 456 1.66666666666667e-01 +440 654 -1.66666666666667e-01 +440 437 -2.50000000000000e-01 +440 424 -1.66666666666667e-01 +440 436 1.66666666666667e-01 +440 277 -8.33333333333333e-02 +440 433 8.33333333333333e-02 +440 276 1.66666666666667e-01 +440 438 -3.33333333333333e-01 +440 648 1.66666666666667e-01 +440 278 -2.50000000000000e-01 +440 432 8.33333333333333e-02 +440 51 -8.33333333333333e-02 +440 650 -7.50000000000000e-01 +440 618 8.33333333333333e-02 +440 286 -1.66666666666667e-01 +440 649 1.66666666666667e-01 +440 285 8.33333333333333e-02 +440 129 -8.33333333333333e-02 +441 441 2.50000000000000e+00 +441 376 -8.33333333333333e-02 +441 371 -1.66666666666667e-01 +441 377 1.66666666666667e-01 +441 375 -2.50000000000000e-01 +441 554 8.33333333333333e-02 +441 553 -1.66666666666667e-01 +441 449 -8.33333333333333e-02 +441 448 1.66666666666667e-01 +441 447 -2.50000000000000e-01 +441 340 -8.33333333333333e-02 +441 349 8.33333333333333e-02 +441 350 8.33333333333333e-02 +441 413 -8.33333333333333e-02 +441 73 1.66666666666667e-01 +441 442 -3.33333333333333e-01 +441 412 1.66666666666667e-01 +441 411 -2.50000000000000e-01 +441 341 -8.33333333333333e-02 +441 407 8.33333333333333e-02 +441 55 1.66666666666667e-01 +441 406 -1.66666666666667e-01 +441 293 -8.33333333333333e-02 +441 290 8.33333333333333e-02 +441 74 1.66666666666667e-01 +441 560 -1.66666666666667e-01 +441 559 8.33333333333333e-02 +441 292 -8.33333333333333e-02 +441 72 -7.50000000000000e-01 +441 443 -3.33333333333333e-01 +441 455 1.66666666666667e-01 +441 56 1.66666666666667e-01 +441 454 -8.33333333333333e-02 +441 289 8.33333333333333e-02 +441 370 8.33333333333333e-02 +441 453 -2.50000000000000e-01 +441 54 -7.50000000000000e-01 +442 442 2.50000000000000e+00 +442 375 -8.33333333333333e-02 +442 377 1.66666666666667e-01 +442 371 8.33333333333333e-02 +442 376 -2.50000000000000e-01 +442 554 8.33333333333333e-02 +442 552 -1.66666666666667e-01 +442 449 1.66666666666667e-01 +442 448 -7.50000000000000e-01 +442 447 1.66666666666667e-01 +442 443 -3.33333333333333e-01 +442 56 -8.33333333333333e-02 +442 74 -8.33333333333333e-02 +442 407 8.33333333333333e-02 +442 341 -8.33333333333333e-02 +442 339 -8.33333333333333e-02 +442 348 8.33333333333333e-02 +442 350 -1.66666666666667e-01 +442 413 1.66666666666667e-01 +442 412 -7.50000000000000e-01 +442 72 1.66666666666667e-01 +442 441 -3.33333333333333e-01 +442 411 1.66666666666667e-01 +442 54 1.66666666666667e-01 +442 405 -1.66666666666667e-01 +442 560 8.33333333333333e-02 +442 293 -8.33333333333333e-02 +442 73 -2.50000000000000e-01 +442 558 8.33333333333333e-02 +442 291 -8.33333333333333e-02 +442 455 1.66666666666667e-01 +442 290 -1.66666666666667e-01 +442 369 8.33333333333333e-02 +442 454 -2.50000000000000e-01 +442 55 -2.50000000000000e-01 +442 453 -8.33333333333333e-02 +442 288 8.33333333333333e-02 +443 443 2.50000000000000e+00 +443 370 8.33333333333333e-02 +443 369 -1.66666666666667e-01 +443 377 -7.50000000000000e-01 +443 375 1.66666666666667e-01 +443 553 8.33333333333333e-02 +443 552 8.33333333333333e-02 +443 449 -2.50000000000000e-01 +443 448 1.66666666666667e-01 +443 447 -8.33333333333333e-02 +443 442 -3.33333333333333e-01 +443 55 -8.33333333333333e-02 +443 73 -8.33333333333333e-02 +443 406 8.33333333333333e-02 +443 340 -8.33333333333333e-02 +443 413 -2.50000000000000e-01 +443 349 -1.66666666666667e-01 +443 412 1.66666666666667e-01 +443 348 8.33333333333333e-02 +443 411 -8.33333333333333e-02 +443 339 -8.33333333333333e-02 +443 405 8.33333333333333e-02 +443 559 8.33333333333333e-02 +443 292 -8.33333333333333e-02 +443 291 -8.33333333333333e-02 +443 288 8.33333333333333e-02 +443 74 -2.50000000000000e-01 +443 72 1.66666666666667e-01 +443 558 -1.66666666666667e-01 +443 376 1.66666666666667e-01 +443 455 -7.50000000000000e-01 +443 56 -2.50000000000000e-01 +443 454 1.66666666666667e-01 +443 289 -1.66666666666667e-01 +443 441 -3.33333333333333e-01 +443 453 1.66666666666667e-01 +443 54 1.66666666666667e-01 +444 444 2.50000000000000e+00 +444 382 -8.33333333333333e-02 +444 383 1.66666666666667e-01 +444 371 8.33333333333333e-02 +444 381 -2.50000000000000e-01 +444 617 8.33333333333333e-02 +444 616 -1.66666666666667e-01 +444 449 1.66666666666667e-01 +444 448 1.66666666666667e-01 +444 447 -7.50000000000000e-01 +444 446 -3.33333333333333e-01 +444 95 -8.33333333333333e-02 +444 56 -8.33333333333333e-02 +444 359 -8.33333333333333e-02 +444 425 8.33333333333333e-02 +444 358 -8.33333333333333e-02 +444 367 8.33333333333333e-02 +444 368 -1.66666666666667e-01 +444 431 1.66666666666667e-01 +444 94 1.66666666666667e-01 +444 445 -3.33333333333333e-01 +444 430 1.66666666666667e-01 +444 429 -7.50000000000000e-01 +444 55 1.66666666666667e-01 +444 424 -1.66666666666667e-01 +444 296 -8.33333333333333e-02 +444 620 8.33333333333333e-02 +444 619 8.33333333333333e-02 +444 295 -8.33333333333333e-02 +444 93 -2.50000000000000e-01 +444 458 1.66666666666667e-01 +444 290 -1.66666666666667e-01 +444 457 -8.33333333333333e-02 +444 289 8.33333333333333e-02 +444 456 -2.50000000000000e-01 +444 370 8.33333333333333e-02 +444 54 -2.50000000000000e-01 +445 445 2.50000000000000e+00 +445 381 -8.33333333333333e-02 +445 371 -1.66666666666667e-01 +445 383 1.66666666666667e-01 +445 382 -2.50000000000000e-01 +445 617 8.33333333333333e-02 +445 615 -1.66666666666667e-01 +445 449 -8.33333333333333e-02 +445 448 -2.50000000000000e-01 +445 447 1.66666666666667e-01 +445 357 -8.33333333333333e-02 +445 366 8.33333333333333e-02 +445 368 8.33333333333333e-02 +445 431 -8.33333333333333e-02 +445 430 -2.50000000000000e-01 +445 93 1.66666666666667e-01 +445 444 -3.33333333333333e-01 +445 429 1.66666666666667e-01 +445 359 -8.33333333333333e-02 +445 425 8.33333333333333e-02 +445 54 1.66666666666667e-01 +445 423 -1.66666666666667e-01 +445 296 -8.33333333333333e-02 +445 290 8.33333333333333e-02 +445 620 -1.66666666666667e-01 +445 95 1.66666666666667e-01 +445 94 -7.50000000000000e-01 +445 618 8.33333333333333e-02 +445 294 -8.33333333333333e-02 +445 458 1.66666666666667e-01 +445 446 -3.33333333333333e-01 +445 56 1.66666666666667e-01 +445 457 -2.50000000000000e-01 +445 369 8.33333333333333e-02 +445 55 -7.50000000000000e-01 +445 456 -8.33333333333333e-02 +445 288 8.33333333333333e-02 +446 446 2.50000000000000e+00 +446 370 -1.66666666666667e-01 +446 369 8.33333333333333e-02 +446 383 -7.50000000000000e-01 +446 382 1.66666666666667e-01 +446 615 8.33333333333333e-02 +446 616 8.33333333333333e-02 +446 449 -2.50000000000000e-01 +446 448 -8.33333333333333e-02 +446 447 1.66666666666667e-01 +446 444 -3.33333333333333e-01 +446 93 -8.33333333333333e-02 +446 54 -8.33333333333333e-02 +446 357 -8.33333333333333e-02 +446 423 8.33333333333333e-02 +446 431 -2.50000000000000e-01 +446 367 8.33333333333333e-02 +446 430 -8.33333333333333e-02 +446 366 -1.66666666666667e-01 +446 429 1.66666666666667e-01 +446 358 -8.33333333333333e-02 +446 424 8.33333333333333e-02 +446 294 -8.33333333333333e-02 +446 618 8.33333333333333e-02 +446 295 -8.33333333333333e-02 +446 289 8.33333333333333e-02 +446 95 -2.50000000000000e-01 +446 619 -1.66666666666667e-01 +446 94 1.66666666666667e-01 +446 458 -7.50000000000000e-01 +446 381 1.66666666666667e-01 +446 56 -2.50000000000000e-01 +446 457 1.66666666666667e-01 +446 445 -3.33333333333333e-01 +446 55 1.66666666666667e-01 +446 456 1.66666666666667e-01 +446 288 -1.66666666666667e-01 +447 447 2.50000000000000e+00 +447 383 -1.66666666666667e-01 +447 617 -8.33333333333333e-02 +447 295 8.33333333333333e-02 +447 296 8.33333333333333e-02 +447 616 1.66666666666667e-01 +447 615 -2.50000000000000e-01 +447 446 1.66666666666667e-01 +447 445 1.66666666666667e-01 +447 444 -7.50000000000000e-01 +447 370 -8.33333333333333e-02 +447 371 -8.33333333333333e-02 +447 385 -8.33333333333333e-02 +447 376 8.33333333333333e-02 +447 377 8.33333333333333e-02 +447 386 1.66666666666667e-01 +447 449 -3.33333333333333e-01 +447 384 -2.50000000000000e-01 +447 289 -8.33333333333333e-02 +447 448 -3.33333333333333e-01 +447 554 1.66666666666667e-01 +447 298 -8.33333333333333e-02 +447 292 8.33333333333333e-02 +447 290 1.66666666666667e-01 +447 293 -1.66666666666667e-01 +447 101 8.33333333333333e-02 +447 299 -8.33333333333333e-02 +447 553 1.66666666666667e-01 +447 100 -1.66666666666667e-01 +447 552 -7.50000000000000e-01 +447 443 -8.33333333333333e-02 +447 56 8.33333333333333e-02 +447 442 1.66666666666667e-01 +447 55 -1.66666666666667e-01 +447 441 -2.50000000000000e-01 +447 382 8.33333333333333e-02 +447 288 -2.50000000000000e-01 +448 448 2.50000000000000e+00 +448 383 8.33333333333333e-02 +448 617 1.66666666666667e-01 +448 294 8.33333333333333e-02 +448 296 -1.66666666666667e-01 +448 616 -7.50000000000000e-01 +448 615 1.66666666666667e-01 +448 446 -8.33333333333333e-02 +448 445 -2.50000000000000e-01 +448 444 1.66666666666667e-01 +448 369 -8.33333333333333e-02 +448 386 1.66666666666667e-01 +448 384 -8.33333333333333e-02 +448 375 8.33333333333333e-02 +448 377 -1.66666666666667e-01 +448 101 8.33333333333333e-02 +448 385 -2.50000000000000e-01 +448 371 -8.33333333333333e-02 +448 56 8.33333333333333e-02 +448 288 -8.33333333333333e-02 +448 554 -8.33333333333333e-02 +448 447 -3.33333333333333e-01 +448 297 -8.33333333333333e-02 +448 291 8.33333333333333e-02 +448 299 -8.33333333333333e-02 +448 293 8.33333333333333e-02 +448 553 -2.50000000000000e-01 +448 552 1.66666666666667e-01 +448 99 -1.66666666666667e-01 +448 443 1.66666666666667e-01 +448 449 -3.33333333333333e-01 +448 290 1.66666666666667e-01 +448 442 -7.50000000000000e-01 +448 381 8.33333333333333e-02 +448 289 -2.50000000000000e-01 +448 441 1.66666666666667e-01 +448 54 -1.66666666666667e-01 +449 449 2.50000000000000e+00 +449 381 -1.66666666666667e-01 +449 615 -8.33333333333333e-02 +449 616 1.66666666666667e-01 +449 295 -1.66666666666667e-01 +449 294 8.33333333333333e-02 +449 617 -2.50000000000000e-01 +449 446 -2.50000000000000e-01 +449 445 -8.33333333333333e-02 +449 444 1.66666666666667e-01 +449 369 -8.33333333333333e-02 +449 385 1.66666666666667e-01 +449 376 -1.66666666666667e-01 +449 375 8.33333333333333e-02 +449 386 -7.50000000000000e-01 +449 100 8.33333333333333e-02 +449 384 1.66666666666667e-01 +449 447 -3.33333333333333e-01 +449 370 -8.33333333333333e-02 +449 55 8.33333333333333e-02 +449 553 -8.33333333333333e-02 +449 552 1.66666666666667e-01 +449 298 -8.33333333333333e-02 +449 292 8.33333333333333e-02 +449 288 1.66666666666667e-01 +449 291 -1.66666666666667e-01 +449 554 -2.50000000000000e-01 +449 99 8.33333333333333e-02 +449 297 -8.33333333333333e-02 +449 443 -2.50000000000000e-01 +449 382 8.33333333333333e-02 +449 290 -7.50000000000000e-01 +449 442 1.66666666666667e-01 +449 448 -3.33333333333333e-01 +449 289 1.66666666666667e-01 +449 441 -8.33333333333333e-02 +449 54 8.33333333333333e-02 +450 450 2.50000000000000e+00 +450 425 -1.66666666666667e-01 +450 424 8.33333333333333e-02 +450 437 1.66666666666667e-01 +450 435 -7.50000000000000e-01 +450 655 8.33333333333333e-02 +450 656 8.33333333333333e-02 +450 458 -8.33333333333333e-02 +450 457 1.66666666666667e-01 +450 456 -2.50000000000000e-01 +450 394 -8.33333333333333e-02 +450 395 -8.33333333333333e-02 +450 404 8.33333333333333e-02 +450 403 -1.66666666666667e-01 +450 407 8.33333333333333e-02 +450 419 -8.33333333333333e-02 +450 451 -3.33333333333333e-01 +450 418 1.66666666666667e-01 +450 406 8.33333333333333e-02 +450 55 -8.33333333333333e-02 +450 115 -8.33333333333333e-02 +450 417 -2.50000000000000e-01 +450 290 8.33333333333333e-02 +450 302 -8.33333333333333e-02 +450 652 8.33333333333333e-02 +450 301 -8.33333333333333e-02 +450 116 1.66666666666667e-01 +450 653 -1.66666666666667e-01 +450 114 -2.50000000000000e-01 +450 452 -3.33333333333333e-01 +450 455 1.66666666666667e-01 +450 56 1.66666666666667e-01 +450 454 1.66666666666667e-01 +450 289 -1.66666666666667e-01 +450 436 1.66666666666667e-01 +450 453 -7.50000000000000e-01 +450 54 -2.50000000000000e-01 +451 451 2.50000000000000e+00 +451 437 -8.33333333333333e-02 +451 435 1.66666666666667e-01 +451 423 8.33333333333333e-02 +451 436 -2.50000000000000e-01 +451 654 8.33333333333333e-02 +451 656 -1.66666666666667e-01 +451 458 1.66666666666667e-01 +451 457 -7.50000000000000e-01 +451 456 1.66666666666667e-01 +451 393 -8.33333333333333e-02 +451 395 -8.33333333333333e-02 +451 404 8.33333333333333e-02 +451 402 -1.66666666666667e-01 +451 450 -3.33333333333333e-01 +451 417 1.66666666666667e-01 +451 407 -1.66666666666667e-01 +451 56 1.66666666666667e-01 +451 405 8.33333333333333e-02 +451 54 -8.33333333333333e-02 +451 419 1.66666666666667e-01 +451 452 -3.33333333333333e-01 +451 116 1.66666666666667e-01 +451 418 -7.50000000000000e-01 +451 114 -8.33333333333333e-02 +451 651 8.33333333333333e-02 +451 300 -8.33333333333333e-02 +451 653 8.33333333333333e-02 +451 302 -8.33333333333333e-02 +451 115 -2.50000000000000e-01 +451 455 -8.33333333333333e-02 +451 290 8.33333333333333e-02 +451 425 8.33333333333333e-02 +451 454 -2.50000000000000e-01 +451 55 -2.50000000000000e-01 +451 453 1.66666666666667e-01 +451 288 -1.66666666666667e-01 +452 452 2.50000000000000e+00 +452 436 -8.33333333333333e-02 +452 423 -1.66666666666667e-01 +452 437 -2.50000000000000e-01 +452 435 1.66666666666667e-01 +452 655 -1.66666666666667e-01 +452 654 8.33333333333333e-02 +452 458 -2.50000000000000e-01 +452 457 1.66666666666667e-01 +452 456 -8.33333333333333e-02 +452 394 -8.33333333333333e-02 +452 403 8.33333333333333e-02 +452 393 -8.33333333333333e-02 +452 402 8.33333333333333e-02 +452 405 8.33333333333333e-02 +452 417 -8.33333333333333e-02 +452 406 -1.66666666666667e-01 +452 55 1.66666666666667e-01 +452 419 -2.50000000000000e-01 +452 418 1.66666666666667e-01 +452 451 -3.33333333333333e-01 +452 115 1.66666666666667e-01 +452 288 8.33333333333333e-02 +452 300 -8.33333333333333e-02 +452 116 -7.50000000000000e-01 +452 652 8.33333333333333e-02 +452 301 -8.33333333333333e-02 +452 114 1.66666666666667e-01 +452 651 -1.66666666666667e-01 +452 424 8.33333333333333e-02 +452 455 -2.50000000000000e-01 +452 56 -7.50000000000000e-01 +452 454 -8.33333333333333e-02 +452 289 8.33333333333333e-02 +452 450 -3.33333333333333e-01 +452 453 1.66666666666667e-01 +452 54 1.66666666666667e-01 +453 453 2.50000000000000e+00 +453 412 8.33333333333333e-02 +453 559 1.66666666666667e-01 +453 293 8.33333333333333e-02 +453 292 -1.66666666666667e-01 +453 560 1.66666666666667e-01 +453 558 -7.50000000000000e-01 +453 443 1.66666666666667e-01 +453 442 -8.33333333333333e-02 +453 441 -2.50000000000000e-01 +453 407 -8.33333333333333e-02 +453 422 -8.33333333333333e-02 +453 419 8.33333333333333e-02 +453 421 1.66666666666667e-01 +453 418 -1.66666666666667e-01 +453 121 8.33333333333333e-02 +453 420 -2.50000000000000e-01 +453 406 -8.33333333333333e-02 +453 55 8.33333333333333e-02 +453 290 -8.33333333333333e-02 +453 455 -3.33333333333333e-01 +453 652 -8.33333333333333e-02 +453 305 -8.33333333333333e-02 +453 302 8.33333333333333e-02 +453 304 -8.33333333333333e-02 +453 301 8.33333333333333e-02 +453 653 1.66666666666667e-01 +453 122 -1.66666666666667e-01 +453 651 -2.50000000000000e-01 +453 452 1.66666666666667e-01 +453 56 -1.66666666666667e-01 +453 451 1.66666666666667e-01 +453 454 -3.33333333333333e-01 +453 289 1.66666666666667e-01 +453 450 -7.50000000000000e-01 +453 413 8.33333333333333e-02 +453 288 -2.50000000000000e-01 +454 454 2.50000000000000e+00 +454 411 8.33333333333333e-02 +454 560 -8.33333333333333e-02 +454 293 8.33333333333333e-02 +454 558 1.66666666666667e-01 +454 291 -1.66666666666667e-01 +454 559 -2.50000000000000e-01 +454 443 1.66666666666667e-01 +454 442 -2.50000000000000e-01 +454 441 -8.33333333333333e-02 +454 407 -8.33333333333333e-02 +454 420 1.66666666666667e-01 +454 419 8.33333333333333e-02 +454 417 -1.66666666666667e-01 +454 422 1.66666666666667e-01 +454 455 -3.33333333333333e-01 +454 421 -7.50000000000000e-01 +454 120 8.33333333333333e-02 +454 405 -8.33333333333333e-02 +454 54 8.33333333333333e-02 +454 651 -8.33333333333333e-02 +454 653 1.66666666666667e-01 +454 290 1.66666666666667e-01 +454 302 -1.66666666666667e-01 +454 303 -8.33333333333333e-02 +454 300 8.33333333333333e-02 +454 122 8.33333333333333e-02 +454 305 -8.33333333333333e-02 +454 652 -2.50000000000000e-01 +454 452 -8.33333333333333e-02 +454 56 8.33333333333333e-02 +454 451 -2.50000000000000e-01 +454 413 -1.66666666666667e-01 +454 289 -7.50000000000000e-01 +454 450 1.66666666666667e-01 +454 453 -3.33333333333333e-01 +454 288 1.66666666666667e-01 +455 455 2.50000000000000e+00 +455 412 -1.66666666666667e-01 +455 559 -8.33333333333333e-02 +455 292 8.33333333333333e-02 +455 291 8.33333333333333e-02 +455 560 -2.50000000000000e-01 +455 558 1.66666666666667e-01 +455 443 -7.50000000000000e-01 +455 442 1.66666666666667e-01 +455 441 1.66666666666667e-01 +455 405 -8.33333333333333e-02 +455 406 -8.33333333333333e-02 +455 420 -8.33333333333333e-02 +455 417 8.33333333333333e-02 +455 418 8.33333333333333e-02 +455 422 -2.50000000000000e-01 +455 421 1.66666666666667e-01 +455 454 -3.33333333333333e-01 +455 288 -8.33333333333333e-02 +455 453 -3.33333333333333e-01 +455 652 1.66666666666667e-01 +455 303 -8.33333333333333e-02 +455 300 8.33333333333333e-02 +455 289 1.66666666666667e-01 +455 301 -1.66666666666667e-01 +455 653 -7.50000000000000e-01 +455 121 8.33333333333333e-02 +455 304 -8.33333333333333e-02 +455 651 1.66666666666667e-01 +455 120 -1.66666666666667e-01 +455 452 -2.50000000000000e-01 +455 411 8.33333333333333e-02 +455 290 -2.50000000000000e-01 +455 451 -8.33333333333333e-02 +455 55 8.33333333333333e-02 +455 450 1.66666666666667e-01 +455 54 -1.66666666666667e-01 +456 456 2.50000000000000e+00 +456 430 8.33333333333333e-02 +456 296 8.33333333333333e-02 +456 620 -8.33333333333333e-02 +456 619 1.66666666666667e-01 +456 295 -1.66666666666667e-01 +456 618 -2.50000000000000e-01 +456 446 1.66666666666667e-01 +456 445 -8.33333333333333e-02 +456 444 -2.50000000000000e-01 +456 425 -8.33333333333333e-02 +456 439 1.66666666666667e-01 +456 437 8.33333333333333e-02 +456 436 -1.66666666666667e-01 +456 440 1.66666666666667e-01 +456 458 -3.33333333333333e-01 +456 130 8.33333333333333e-02 +456 438 -7.50000000000000e-01 +456 424 -8.33333333333333e-02 +456 55 8.33333333333333e-02 +456 655 -8.33333333333333e-02 +456 656 1.66666666666667e-01 +456 290 1.66666666666667e-01 +456 302 -1.66666666666667e-01 +456 307 -8.33333333333333e-02 +456 301 8.33333333333333e-02 +456 131 8.33333333333333e-02 +456 308 -8.33333333333333e-02 +456 654 -2.50000000000000e-01 +456 452 -8.33333333333333e-02 +456 56 8.33333333333333e-02 +456 457 -3.33333333333333e-01 +456 451 1.66666666666667e-01 +456 289 1.66666666666667e-01 +456 431 -1.66666666666667e-01 +456 450 -2.50000000000000e-01 +456 288 -7.50000000000000e-01 +457 457 2.50000000000000e+00 +457 429 8.33333333333333e-02 +457 618 1.66666666666667e-01 +457 296 8.33333333333333e-02 +457 294 -1.66666666666667e-01 +457 620 1.66666666666667e-01 +457 619 -7.50000000000000e-01 +457 446 1.66666666666667e-01 +457 445 -2.50000000000000e-01 +457 444 -8.33333333333333e-02 +457 425 -8.33333333333333e-02 +457 440 -8.33333333333333e-02 +457 437 8.33333333333333e-02 +457 438 1.66666666666667e-01 +457 435 -1.66666666666667e-01 +457 439 -2.50000000000000e-01 +457 129 8.33333333333333e-02 +457 423 -8.33333333333333e-02 +457 54 8.33333333333333e-02 +457 290 -8.33333333333333e-02 +457 458 -3.33333333333333e-01 +457 654 -8.33333333333333e-02 +457 308 -8.33333333333333e-02 +457 302 8.33333333333333e-02 +457 306 -8.33333333333333e-02 +457 300 8.33333333333333e-02 +457 131 -1.66666666666667e-01 +457 656 1.66666666666667e-01 +457 655 -2.50000000000000e-01 +457 452 1.66666666666667e-01 +457 56 -1.66666666666667e-01 +457 431 8.33333333333333e-02 +457 451 -7.50000000000000e-01 +457 289 -2.50000000000000e-01 +457 456 -3.33333333333333e-01 +457 450 1.66666666666667e-01 +457 288 1.66666666666667e-01 +458 458 2.50000000000000e+00 +458 429 -1.66666666666667e-01 +458 294 8.33333333333333e-02 +458 618 -8.33333333333333e-02 +458 295 8.33333333333333e-02 +458 620 -2.50000000000000e-01 +458 619 1.66666666666667e-01 +458 446 -7.50000000000000e-01 +458 445 1.66666666666667e-01 +458 444 1.66666666666667e-01 +458 424 -8.33333333333333e-02 +458 423 -8.33333333333333e-02 +458 439 -8.33333333333333e-02 +458 436 8.33333333333333e-02 +458 435 8.33333333333333e-02 +458 440 -2.50000000000000e-01 +458 438 1.66666666666667e-01 +458 456 -3.33333333333333e-01 +458 289 -8.33333333333333e-02 +458 457 -3.33333333333333e-01 +458 307 -8.33333333333333e-02 +458 301 8.33333333333333e-02 +458 654 1.66666666666667e-01 +458 288 1.66666666666667e-01 +458 300 -1.66666666666667e-01 +458 656 -7.50000000000000e-01 +458 130 -1.66666666666667e-01 +458 655 1.66666666666667e-01 +458 129 8.33333333333333e-02 +458 306 -8.33333333333333e-02 +458 430 8.33333333333333e-02 +458 452 -2.50000000000000e-01 +458 290 -2.50000000000000e-01 +458 451 1.66666666666667e-01 +458 55 -1.66666666666667e-01 +458 450 -8.33333333333333e-02 +458 54 8.33333333333333e-02 +459 459 1.25000000000000e+00 +459 503 -8.33333333333333e-02 +459 475 8.33333333333333e-02 +459 502 -8.33333333333333e-02 +459 499 -8.33333333333333e-02 +459 470 8.33333333333333e-02 +459 476 -1.66666666666667e-01 +459 469 8.33333333333333e-02 +459 468 -3.75000000000000e-01 +459 167 8.33333333333333e-02 +459 461 -1.66666666666667e-01 +459 467 1.66666666666667e-01 +459 496 8.33333333333333e-02 +459 466 -8.33333333333333e-02 +459 59 -4.16666666666667e-02 +459 161 4.16666666666667e-02 +459 58 8.33333333333333e-02 +459 160 -8.33333333333333e-02 +459 57 -1.25000000000000e-01 +459 465 -2.50000000000000e-01 +459 65 -4.16666666666667e-02 +459 497 8.33333333333333e-02 +459 460 -1.66666666666667e-01 +459 64 8.33333333333333e-02 +459 166 8.33333333333333e-02 +459 500 4.16666666666667e-02 +459 63 -1.25000000000000e-01 +459 165 -3.75000000000000e-01 +460 460 1.25000000000000e+00 +460 501 -8.33333333333333e-02 +460 500 4.16666666666667e-02 +460 503 -8.33333333333333e-02 +460 498 -8.33333333333333e-02 +460 470 -4.16666666666667e-02 +460 476 8.33333333333333e-02 +460 469 -1.25000000000000e-01 +460 468 8.33333333333333e-02 +460 167 -4.16666666666667e-02 +460 161 4.16666666666667e-02 +460 495 8.33333333333333e-02 +460 465 -8.33333333333333e-02 +460 59 8.33333333333333e-02 +460 461 -1.66666666666667e-01 +460 467 1.66666666666667e-01 +460 58 -3.75000000000000e-01 +460 466 -2.50000000000000e-01 +460 57 8.33333333333333e-02 +460 159 -8.33333333333333e-02 +460 65 8.33333333333333e-02 +460 497 -1.66666666666667e-01 +460 474 8.33333333333333e-02 +460 64 -3.75000000000000e-01 +460 166 -1.25000000000000e-01 +460 459 -1.66666666666667e-01 +460 63 8.33333333333333e-02 +460 165 8.33333333333333e-02 +461 461 1.25000000000000e+00 +461 501 -8.33333333333333e-02 +461 499 4.16666666666667e-02 +461 502 -8.33333333333333e-02 +461 470 -1.25000000000000e-01 +461 469 -4.16666666666667e-02 +461 475 8.33333333333333e-02 +461 468 8.33333333333333e-02 +461 474 -1.66666666666667e-01 +461 166 -4.16666666666667e-02 +461 160 4.16666666666667e-02 +461 165 8.33333333333333e-02 +461 459 -1.66666666666667e-01 +461 465 1.66666666666667e-01 +461 59 -1.25000000000000e-01 +461 467 -7.50000000000000e-01 +461 58 8.33333333333333e-02 +461 460 -1.66666666666667e-01 +461 466 1.66666666666667e-01 +461 57 -4.16666666666667e-02 +461 159 4.16666666666667e-02 +461 498 4.16666666666667e-02 +461 65 -1.25000000000000e-01 +461 167 -1.25000000000000e-01 +461 64 8.33333333333333e-02 +461 496 -1.66666666666667e-01 +461 63 -4.16666666666667e-02 +461 495 8.33333333333333e-02 +462 462 1.25000000000000e+00 +462 473 8.33333333333333e-02 +462 472 8.33333333333333e-02 +462 471 -3.75000000000000e-01 +462 536 -8.33333333333333e-02 +462 538 -8.33333333333333e-02 +462 476 8.33333333333333e-02 +462 475 -1.66666666666667e-01 +462 539 -8.33333333333333e-02 +462 533 8.33333333333333e-02 +462 467 -8.33333333333333e-02 +462 463 -1.66666666666667e-01 +462 466 1.66666666666667e-01 +462 172 8.33333333333333e-02 +462 59 8.33333333333333e-02 +462 161 -8.33333333333333e-02 +462 58 -4.16666666666667e-02 +462 160 4.16666666666667e-02 +462 57 -1.25000000000000e-01 +462 465 -2.50000000000000e-01 +462 464 -1.66666666666667e-01 +462 71 8.33333333333333e-02 +462 173 8.33333333333333e-02 +462 70 -4.16666666666667e-02 +462 532 8.33333333333333e-02 +462 535 4.16666666666667e-02 +462 69 -1.25000000000000e-01 +462 171 -3.75000000000000e-01 +463 463 1.25000000000000e+00 +463 473 -4.16666666666667e-02 +463 472 -1.25000000000000e-01 +463 471 8.33333333333333e-02 +463 536 4.16666666666667e-02 +463 476 8.33333333333333e-02 +463 539 -8.33333333333333e-02 +463 537 -8.33333333333333e-02 +463 474 -1.66666666666667e-01 +463 161 4.16666666666667e-02 +463 173 -4.16666666666667e-02 +463 462 -1.66666666666667e-01 +463 465 1.66666666666667e-01 +463 171 8.33333333333333e-02 +463 59 8.33333333333333e-02 +463 464 -1.66666666666667e-01 +463 467 1.66666666666667e-01 +463 58 -1.25000000000000e-01 +463 466 -7.50000000000000e-01 +463 57 -4.16666666666667e-02 +463 159 4.16666666666667e-02 +463 71 8.33333333333333e-02 +463 533 -1.66666666666667e-01 +463 534 4.16666666666667e-02 +463 70 -1.25000000000000e-01 +463 172 -1.25000000000000e-01 +463 69 -4.16666666666667e-02 +463 531 8.33333333333333e-02 +464 464 1.25000000000000e+00 +464 472 -4.16666666666667e-02 +464 471 8.33333333333333e-02 +464 535 4.16666666666667e-02 +464 534 -8.33333333333333e-02 +464 475 8.33333333333333e-02 +464 538 -8.33333333333333e-02 +464 474 8.33333333333333e-02 +464 537 -8.33333333333333e-02 +464 531 8.33333333333333e-02 +464 465 -8.33333333333333e-02 +464 160 4.16666666666667e-02 +464 172 -4.16666666666667e-02 +464 59 -3.75000000000000e-01 +464 467 -2.50000000000000e-01 +464 58 8.33333333333333e-02 +464 463 -1.66666666666667e-01 +464 466 1.66666666666667e-01 +464 57 8.33333333333333e-02 +464 159 -8.33333333333333e-02 +464 473 -1.25000000000000e-01 +464 71 -3.75000000000000e-01 +464 173 -1.25000000000000e-01 +464 70 8.33333333333333e-02 +464 532 -1.66666666666667e-01 +464 462 -1.66666666666667e-01 +464 69 8.33333333333333e-02 +464 171 8.33333333333333e-02 +465 465 2.50000000000000e+00 +465 502 -1.66666666666667e-01 +465 461 1.66666666666667e-01 +465 166 8.33333333333333e-02 +465 460 -8.33333333333333e-02 +465 167 -1.66666666666667e-01 +465 459 -2.50000000000000e-01 +465 497 -8.33333333333333e-02 +465 496 1.66666666666667e-01 +465 495 -2.50000000000000e-01 +465 568 -8.33333333333333e-02 +465 476 1.66666666666667e-01 +465 539 -1.66666666666667e-01 +465 538 8.33333333333333e-02 +465 59 8.33333333333333e-02 +465 475 1.66666666666667e-01 +465 466 -3.33333333333333e-01 +465 474 -7.50000000000000e-01 +465 569 -8.33333333333333e-02 +465 77 8.33333333333333e-02 +465 464 -8.33333333333333e-02 +465 463 1.66666666666667e-01 +465 161 -8.33333333333333e-02 +465 173 8.33333333333333e-02 +465 178 1.66666666666667e-01 +465 172 -1.66666666666667e-01 +465 58 8.33333333333333e-02 +465 160 -8.33333333333333e-02 +465 462 -2.50000000000000e-01 +465 467 -3.33333333333333e-01 +465 533 1.66666666666667e-01 +465 179 1.66666666666667e-01 +465 532 -8.33333333333333e-02 +465 76 8.33333333333333e-02 +465 503 8.33333333333333e-02 +465 531 -2.50000000000000e-01 +465 177 -7.50000000000000e-01 +466 466 2.50000000000000e+00 +466 501 -1.66666666666667e-01 +466 165 8.33333333333333e-02 +466 459 -8.33333333333333e-02 +466 167 8.33333333333333e-02 +466 461 1.66666666666667e-01 +466 460 -2.50000000000000e-01 +466 497 1.66666666666667e-01 +466 496 -7.50000000000000e-01 +466 495 1.66666666666667e-01 +466 569 -8.33333333333333e-02 +466 567 -8.33333333333333e-02 +466 476 -8.33333333333333e-02 +466 539 8.33333333333333e-02 +466 537 8.33333333333333e-02 +466 475 -2.50000000000000e-01 +466 474 1.66666666666667e-01 +466 465 -3.33333333333333e-01 +466 179 -8.33333333333333e-02 +466 467 -3.33333333333333e-01 +466 161 -8.33333333333333e-02 +466 173 8.33333333333333e-02 +466 462 1.66666666666667e-01 +466 177 1.66666666666667e-01 +466 171 -1.66666666666667e-01 +466 59 -1.66666666666667e-01 +466 464 1.66666666666667e-01 +466 463 -7.50000000000000e-01 +466 57 8.33333333333333e-02 +466 159 -8.33333333333333e-02 +466 533 1.66666666666667e-01 +466 77 -1.66666666666667e-01 +466 503 8.33333333333333e-02 +466 532 -2.50000000000000e-01 +466 178 -2.50000000000000e-01 +466 531 -8.33333333333333e-02 +466 75 8.33333333333333e-02 +467 467 2.50000000000000e+00 +467 501 8.33333333333333e-02 +467 459 1.66666666666667e-01 +467 166 8.33333333333333e-02 +467 165 -1.66666666666667e-01 +467 461 -7.50000000000000e-01 +467 460 1.66666666666667e-01 +467 497 -2.50000000000000e-01 +467 496 1.66666666666667e-01 +467 495 -8.33333333333333e-02 +467 568 -8.33333333333333e-02 +467 475 -8.33333333333333e-02 +467 538 8.33333333333333e-02 +467 474 1.66666666666667e-01 +467 537 -1.66666666666667e-01 +467 476 -2.50000000000000e-01 +467 57 8.33333333333333e-02 +467 567 -8.33333333333333e-02 +467 75 8.33333333333333e-02 +467 178 -8.33333333333333e-02 +467 466 -3.33333333333333e-01 +467 462 -8.33333333333333e-02 +467 160 -8.33333333333333e-02 +467 172 8.33333333333333e-02 +467 159 -8.33333333333333e-02 +467 171 8.33333333333333e-02 +467 464 -2.50000000000000e-01 +467 58 -1.66666666666667e-01 +467 463 1.66666666666667e-01 +467 502 8.33333333333333e-02 +467 533 -7.50000000000000e-01 +467 179 -2.50000000000000e-01 +467 532 1.66666666666667e-01 +467 76 -1.66666666666667e-01 +467 465 -3.33333333333333e-01 +467 531 1.66666666666667e-01 +467 177 1.66666666666667e-01 +468 468 1.25000000000000e+00 +468 502 8.33333333333333e-02 +468 503 8.33333333333333e-02 +468 461 8.33333333333333e-02 +468 470 -1.66666666666667e-01 +468 460 8.33333333333333e-02 +468 459 -3.75000000000000e-01 +468 499 8.33333333333333e-02 +468 498 -1.25000000000000e-01 +468 475 -8.33333333333333e-02 +468 469 -1.66666666666667e-01 +468 185 8.33333333333333e-02 +468 586 -8.33333333333333e-02 +468 190 8.33333333333333e-02 +468 476 1.66666666666667e-01 +468 191 -1.66666666666667e-01 +468 80 4.16666666666667e-02 +468 587 -8.33333333333333e-02 +468 184 8.33333333333333e-02 +468 79 -8.33333333333333e-02 +468 183 -3.75000000000000e-01 +468 182 -4.16666666666667e-02 +468 59 4.16666666666667e-02 +468 181 8.33333333333333e-02 +468 58 -8.33333333333333e-02 +468 180 -1.25000000000000e-01 +468 500 -4.16666666666667e-02 +468 474 -2.50000000000000e-01 +469 469 1.25000000000000e+00 +469 501 8.33333333333333e-02 +469 503 -1.66666666666667e-01 +469 461 -4.16666666666667e-02 +469 59 4.16666666666667e-02 +469 460 -1.25000000000000e-01 +469 459 8.33333333333333e-02 +469 80 4.16666666666667e-02 +469 499 -3.75000000000000e-01 +469 498 8.33333333333333e-02 +469 474 -8.33333333333333e-02 +469 185 -4.16666666666667e-02 +469 468 -1.66666666666667e-01 +469 585 -8.33333333333333e-02 +469 189 8.33333333333333e-02 +469 587 -8.33333333333333e-02 +469 191 8.33333333333333e-02 +469 184 -1.25000000000000e-01 +469 183 8.33333333333333e-02 +469 78 -8.33333333333333e-02 +469 182 8.33333333333333e-02 +469 470 -1.66666666666667e-01 +469 476 1.66666666666667e-01 +469 181 -3.75000000000000e-01 +469 500 8.33333333333333e-02 +469 475 -2.50000000000000e-01 +469 180 8.33333333333333e-02 +469 57 -8.33333333333333e-02 +470 470 1.25000000000000e+00 +470 498 -4.16666666666667e-02 +470 502 -1.66666666666667e-01 +470 501 8.33333333333333e-02 +470 461 -1.25000000000000e-01 +470 460 -4.16666666666667e-02 +470 58 4.16666666666667e-02 +470 459 8.33333333333333e-02 +470 468 -1.66666666666667e-01 +470 500 -1.25000000000000e-01 +470 79 4.16666666666667e-02 +470 184 -4.16666666666667e-02 +470 183 8.33333333333333e-02 +470 586 -8.33333333333333e-02 +470 190 8.33333333333333e-02 +470 474 1.66666666666667e-01 +470 189 -1.66666666666667e-01 +470 185 -1.25000000000000e-01 +470 78 4.16666666666667e-02 +470 585 -8.33333333333333e-02 +470 182 -1.25000000000000e-01 +470 499 8.33333333333333e-02 +470 476 -7.50000000000000e-01 +470 181 8.33333333333333e-02 +470 469 -1.66666666666667e-01 +470 475 1.66666666666667e-01 +470 180 -4.16666666666667e-02 +470 57 4.16666666666667e-02 +471 471 1.25000000000000e+00 +471 535 -4.16666666666667e-02 +471 538 8.33333333333333e-02 +471 536 8.33333333333333e-02 +471 534 -1.25000000000000e-01 +471 464 8.33333333333333e-02 +471 472 -1.66666666666667e-01 +471 463 8.33333333333333e-02 +471 462 -3.75000000000000e-01 +471 593 -8.33333333333333e-02 +471 473 -1.66666666666667e-01 +471 187 8.33333333333333e-02 +471 191 8.33333333333333e-02 +471 476 -8.33333333333333e-02 +471 190 -1.66666666666667e-01 +471 475 1.66666666666667e-01 +471 188 8.33333333333333e-02 +471 83 -8.33333333333333e-02 +471 82 4.16666666666667e-02 +471 592 -8.33333333333333e-02 +471 186 -3.75000000000000e-01 +471 182 8.33333333333333e-02 +471 59 -8.33333333333333e-02 +471 181 -4.16666666666667e-02 +471 58 4.16666666666667e-02 +471 180 -1.25000000000000e-01 +471 539 8.33333333333333e-02 +471 474 -2.50000000000000e-01 +472 472 1.25000000000000e+00 +472 539 -1.66666666666667e-01 +472 534 -4.16666666666667e-02 +472 537 8.33333333333333e-02 +472 83 4.16666666666667e-02 +472 535 -1.25000000000000e-01 +472 59 4.16666666666667e-02 +472 464 -4.16666666666667e-02 +472 463 -1.25000000000000e-01 +472 471 -1.66666666666667e-01 +472 462 8.33333333333333e-02 +472 593 -8.33333333333333e-02 +472 188 -4.16666666666667e-02 +472 191 8.33333333333333e-02 +472 186 8.33333333333333e-02 +472 189 -1.66666666666667e-01 +472 474 1.66666666666667e-01 +472 187 -1.25000000000000e-01 +472 81 4.16666666666667e-02 +472 591 -8.33333333333333e-02 +472 182 8.33333333333333e-02 +472 473 -1.66666666666667e-01 +472 476 1.66666666666667e-01 +472 181 -1.25000000000000e-01 +472 536 8.33333333333333e-02 +472 475 -7.50000000000000e-01 +472 180 -4.16666666666667e-02 +472 57 4.16666666666667e-02 +473 473 1.25000000000000e+00 +473 535 8.33333333333333e-02 +473 538 -1.66666666666667e-01 +473 536 -3.75000000000000e-01 +473 82 4.16666666666667e-02 +473 534 8.33333333333333e-02 +473 464 -1.25000000000000e-01 +473 58 4.16666666666667e-02 +473 463 -4.16666666666667e-02 +473 462 8.33333333333333e-02 +473 592 -8.33333333333333e-02 +473 591 -8.33333333333333e-02 +473 187 -4.16666666666667e-02 +473 190 8.33333333333333e-02 +473 471 -1.66666666666667e-01 +473 189 8.33333333333333e-02 +473 474 -8.33333333333333e-02 +473 188 -1.25000000000000e-01 +473 186 8.33333333333333e-02 +473 81 -8.33333333333333e-02 +473 182 -3.75000000000000e-01 +473 537 8.33333333333333e-02 +473 476 -2.50000000000000e-01 +473 181 8.33333333333333e-02 +473 472 -1.66666666666667e-01 +473 475 1.66666666666667e-01 +473 180 8.33333333333333e-02 +473 57 -8.33333333333333e-02 +474 474 2.50000000000000e+00 +474 503 -8.33333333333333e-02 +474 461 -1.66666666666667e-01 +474 502 1.66666666666667e-01 +474 501 -2.50000000000000e-01 +474 469 -8.33333333333333e-02 +474 470 1.66666666666667e-01 +474 468 -2.50000000000000e-01 +474 587 8.33333333333333e-02 +474 586 -1.66666666666667e-01 +474 568 8.33333333333333e-02 +474 538 -8.33333333333333e-02 +474 476 -3.33333333333333e-01 +474 467 1.66666666666667e-01 +474 539 1.66666666666667e-01 +474 59 -8.33333333333333e-02 +474 464 8.33333333333333e-02 +474 466 1.66666666666667e-01 +474 463 -1.66666666666667e-01 +474 465 -7.50000000000000e-01 +474 86 -8.33333333333333e-02 +474 569 8.33333333333333e-02 +474 537 -2.50000000000000e-01 +474 182 8.33333333333333e-02 +474 473 -8.33333333333333e-02 +474 190 1.66666666666667e-01 +474 475 -3.33333333333333e-01 +474 472 1.66666666666667e-01 +474 191 1.66666666666667e-01 +474 593 -1.66666666666667e-01 +474 592 8.33333333333333e-02 +474 85 -8.33333333333333e-02 +474 189 -7.50000000000000e-01 +474 181 8.33333333333333e-02 +474 58 -8.33333333333333e-02 +474 471 -2.50000000000000e-01 +474 460 8.33333333333333e-02 +475 475 2.50000000000000e+00 +475 503 1.66666666666667e-01 +475 461 8.33333333333333e-02 +475 502 -7.50000000000000e-01 +475 501 1.66666666666667e-01 +475 468 -8.33333333333333e-02 +475 587 8.33333333333333e-02 +475 470 1.66666666666667e-01 +475 469 -2.50000000000000e-01 +475 585 -1.66666666666667e-01 +475 476 -3.33333333333333e-01 +475 86 -8.33333333333333e-02 +475 59 -8.33333333333333e-02 +475 567 8.33333333333333e-02 +475 537 -8.33333333333333e-02 +475 467 -8.33333333333333e-02 +475 464 8.33333333333333e-02 +475 466 -2.50000000000000e-01 +475 465 1.66666666666667e-01 +475 462 -1.66666666666667e-01 +475 569 -1.66666666666667e-01 +475 539 1.66666666666667e-01 +475 538 -2.50000000000000e-01 +475 191 -8.33333333333333e-02 +475 593 8.33333333333333e-02 +475 189 1.66666666666667e-01 +475 474 -3.33333333333333e-01 +475 471 1.66666666666667e-01 +475 190 -2.50000000000000e-01 +475 591 8.33333333333333e-02 +475 84 -8.33333333333333e-02 +475 182 -1.66666666666667e-01 +475 473 1.66666666666667e-01 +475 472 -7.50000000000000e-01 +475 459 8.33333333333333e-02 +475 180 8.33333333333333e-02 +475 57 -8.33333333333333e-02 +476 476 2.50000000000000e+00 +476 501 -8.33333333333333e-02 +476 460 8.33333333333333e-02 +476 459 -1.66666666666667e-01 +476 503 -2.50000000000000e-01 +476 586 8.33333333333333e-02 +476 468 1.66666666666667e-01 +476 470 -7.50000000000000e-01 +476 469 1.66666666666667e-01 +476 585 8.33333333333333e-02 +476 475 -3.33333333333333e-01 +476 85 -8.33333333333333e-02 +476 58 -8.33333333333333e-02 +476 466 -8.33333333333333e-02 +476 463 8.33333333333333e-02 +476 474 -3.33333333333333e-01 +476 465 1.66666666666667e-01 +476 537 1.66666666666667e-01 +476 467 -2.50000000000000e-01 +476 57 -8.33333333333333e-02 +476 462 8.33333333333333e-02 +476 539 -7.50000000000000e-01 +476 568 -1.66666666666667e-01 +476 538 1.66666666666667e-01 +476 84 -8.33333333333333e-02 +476 567 8.33333333333333e-02 +476 190 -8.33333333333333e-02 +476 592 8.33333333333333e-02 +476 180 8.33333333333333e-02 +476 471 -8.33333333333333e-02 +476 191 -2.50000000000000e-01 +476 189 1.66666666666667e-01 +476 591 -1.66666666666667e-01 +476 473 -2.50000000000000e-01 +476 502 1.66666666666667e-01 +476 181 -1.66666666666667e-01 +476 472 1.66666666666667e-01 +477 477 1.25000000000000e+00 +477 508 -8.33333333333333e-02 +477 488 -4.16666666666667e-02 +477 494 8.33333333333333e-02 +477 487 8.33333333333333e-02 +477 486 -1.25000000000000e-01 +477 506 4.16666666666667e-02 +477 509 -8.33333333333333e-02 +477 505 -8.33333333333333e-02 +477 164 4.16666666666667e-02 +477 167 -4.16666666666667e-02 +477 496 8.33333333333333e-02 +477 484 -8.33333333333333e-02 +477 65 8.33333333333333e-02 +477 497 -1.66666666666667e-01 +477 64 8.33333333333333e-02 +477 478 -1.66666666666667e-01 +477 166 8.33333333333333e-02 +477 63 -3.75000000000000e-01 +477 165 -1.25000000000000e-01 +477 479 -1.66666666666667e-01 +477 62 8.33333333333333e-02 +477 485 1.66666666666667e-01 +477 61 8.33333333333333e-02 +477 163 -8.33333333333333e-02 +477 493 8.33333333333333e-02 +477 60 -3.75000000000000e-01 +477 483 -2.50000000000000e-01 +478 478 1.25000000000000e+00 +478 509 -8.33333333333333e-02 +478 492 8.33333333333333e-02 +478 507 -8.33333333333333e-02 +478 488 8.33333333333333e-02 +478 494 -1.66666666666667e-01 +478 487 -3.75000000000000e-01 +478 486 8.33333333333333e-02 +478 504 -8.33333333333333e-02 +478 479 -1.66666666666667e-01 +478 167 8.33333333333333e-02 +478 485 1.66666666666667e-01 +478 495 8.33333333333333e-02 +478 483 -8.33333333333333e-02 +478 65 -4.16666666666667e-02 +478 497 8.33333333333333e-02 +478 64 -1.25000000000000e-01 +478 166 -3.75000000000000e-01 +478 63 8.33333333333333e-02 +478 477 -1.66666666666667e-01 +478 165 8.33333333333333e-02 +478 62 -4.16666666666667e-02 +478 164 4.16666666666667e-02 +478 506 4.16666666666667e-02 +478 61 -1.25000000000000e-01 +478 484 -2.50000000000000e-01 +478 60 8.33333333333333e-02 +478 162 -8.33333333333333e-02 +479 479 1.25000000000000e+00 +479 508 -8.33333333333333e-02 +479 488 -1.25000000000000e-01 +479 487 8.33333333333333e-02 +479 493 -1.66666666666667e-01 +479 486 -4.16666666666667e-02 +479 492 8.33333333333333e-02 +479 504 4.16666666666667e-02 +479 507 -8.33333333333333e-02 +479 162 4.16666666666667e-02 +479 165 -4.16666666666667e-02 +479 478 -1.66666666666667e-01 +479 166 8.33333333333333e-02 +479 484 1.66666666666667e-01 +479 65 -1.25000000000000e-01 +479 167 -1.25000000000000e-01 +479 64 -4.16666666666667e-02 +479 496 8.33333333333333e-02 +479 63 8.33333333333333e-02 +479 495 -1.66666666666667e-01 +479 505 4.16666666666667e-02 +479 62 -1.25000000000000e-01 +479 485 -7.50000000000000e-01 +479 61 -4.16666666666667e-02 +479 163 4.16666666666667e-02 +479 477 -1.66666666666667e-01 +479 60 8.33333333333333e-02 +479 483 1.66666666666667e-01 +480 480 2.50000000000000e+00 +480 557 -8.33333333333333e-02 +480 556 -8.33333333333333e-02 +480 493 -1.66666666666667e-01 +480 484 1.66666666666667e-01 +480 551 -1.66666666666667e-01 +480 550 8.33333333333333e-02 +480 485 1.66666666666667e-01 +480 483 -7.50000000000000e-01 +480 491 -8.33333333333333e-02 +480 554 8.33333333333333e-02 +480 490 1.66666666666667e-01 +480 481 -3.33333333333333e-01 +480 376 1.66666666666667e-01 +480 374 -1.66666666666667e-01 +480 62 1.66666666666667e-01 +480 373 8.33333333333333e-02 +480 61 -8.33333333333333e-02 +480 489 -2.50000000000000e-01 +480 377 1.66666666666667e-01 +480 482 -3.33333333333333e-01 +480 74 1.66666666666667e-01 +480 553 8.33333333333333e-02 +480 73 -8.33333333333333e-02 +480 375 -7.50000000000000e-01 +480 343 -8.33333333333333e-02 +480 163 8.33333333333333e-02 +480 164 8.33333333333333e-02 +480 344 -8.33333333333333e-02 +480 60 -2.50000000000000e-01 +480 176 -8.33333333333333e-02 +480 350 8.33333333333333e-02 +480 175 1.66666666666667e-01 +480 349 -1.66666666666667e-01 +480 174 -2.50000000000000e-01 +480 494 8.33333333333333e-02 +480 72 -2.50000000000000e-01 +481 481 2.50000000000000e+00 +481 494 8.33333333333333e-02 +481 492 -1.66666666666667e-01 +481 557 -8.33333333333333e-02 +481 485 -8.33333333333333e-02 +481 551 8.33333333333333e-02 +481 483 1.66666666666667e-01 +481 549 8.33333333333333e-02 +481 484 -2.50000000000000e-01 +481 374 8.33333333333333e-02 +481 377 -8.33333333333333e-02 +481 489 1.66666666666667e-01 +481 480 -3.33333333333333e-01 +481 375 1.66666666666667e-01 +481 491 1.66666666666667e-01 +481 490 -7.50000000000000e-01 +481 372 8.33333333333333e-02 +481 60 -8.33333333333333e-02 +481 554 -1.66666666666667e-01 +481 376 -2.50000000000000e-01 +481 552 8.33333333333333e-02 +481 72 -8.33333333333333e-02 +481 342 -8.33333333333333e-02 +481 162 8.33333333333333e-02 +481 344 -8.33333333333333e-02 +481 350 8.33333333333333e-02 +481 164 -1.66666666666667e-01 +481 62 1.66666666666667e-01 +481 61 -2.50000000000000e-01 +481 176 1.66666666666667e-01 +481 482 -3.33333333333333e-01 +481 74 1.66666666666667e-01 +481 175 -7.50000000000000e-01 +481 555 -8.33333333333333e-02 +481 73 -2.50000000000000e-01 +481 174 1.66666666666667e-01 +481 348 -1.66666666666667e-01 +482 482 2.50000000000000e+00 +482 555 -8.33333333333333e-02 +482 493 8.33333333333333e-02 +482 556 -8.33333333333333e-02 +482 484 -8.33333333333333e-02 +482 550 8.33333333333333e-02 +482 549 -1.66666666666667e-01 +482 485 -2.50000000000000e-01 +482 483 1.66666666666667e-01 +482 373 8.33333333333333e-02 +482 376 -8.33333333333333e-02 +482 489 -8.33333333333333e-02 +482 552 8.33333333333333e-02 +482 491 -2.50000000000000e-01 +482 490 1.66666666666667e-01 +482 372 -1.66666666666667e-01 +482 60 1.66666666666667e-01 +482 377 -2.50000000000000e-01 +482 553 -1.66666666666667e-01 +482 375 1.66666666666667e-01 +482 480 -3.33333333333333e-01 +482 72 1.66666666666667e-01 +482 343 -8.33333333333333e-02 +482 349 8.33333333333333e-02 +482 62 -7.50000000000000e-01 +482 163 -1.66666666666667e-01 +482 61 1.66666666666667e-01 +482 162 8.33333333333333e-02 +482 342 -8.33333333333333e-02 +482 176 -2.50000000000000e-01 +482 492 8.33333333333333e-02 +482 74 -7.50000000000000e-01 +482 175 1.66666666666667e-01 +482 481 -3.33333333333333e-01 +482 73 1.66666666666667e-01 +482 174 -8.33333333333333e-02 +482 348 8.33333333333333e-02 +483 483 2.50000000000000e+00 +483 508 -1.66666666666667e-01 +483 478 -8.33333333333333e-02 +483 166 8.33333333333333e-02 +483 167 8.33333333333333e-02 +483 479 1.66666666666667e-01 +483 477 -2.50000000000000e-01 +483 497 1.66666666666667e-01 +483 496 1.66666666666667e-01 +483 495 -7.50000000000000e-01 +483 572 -8.33333333333333e-02 +483 571 -8.33333333333333e-02 +483 494 -8.33333333333333e-02 +483 557 8.33333333333333e-02 +483 556 8.33333333333333e-02 +483 493 1.66666666666667e-01 +483 484 -3.33333333333333e-01 +483 492 -2.50000000000000e-01 +483 179 -8.33333333333333e-02 +483 485 -3.33333333333333e-01 +483 164 -8.33333333333333e-02 +483 176 8.33333333333333e-02 +483 481 1.66666666666667e-01 +483 178 1.66666666666667e-01 +483 175 -1.66666666666667e-01 +483 482 1.66666666666667e-01 +483 62 -1.66666666666667e-01 +483 61 8.33333333333333e-02 +483 163 -8.33333333333333e-02 +483 480 -7.50000000000000e-01 +483 551 1.66666666666667e-01 +483 77 -1.66666666666667e-01 +483 550 -8.33333333333333e-02 +483 76 8.33333333333333e-02 +483 549 -2.50000000000000e-01 +483 509 8.33333333333333e-02 +483 177 -2.50000000000000e-01 +484 484 2.50000000000000e+00 +484 507 -1.66666666666667e-01 +484 479 1.66666666666667e-01 +484 477 -8.33333333333333e-02 +484 165 8.33333333333333e-02 +484 167 -1.66666666666667e-01 +484 478 -2.50000000000000e-01 +484 497 -8.33333333333333e-02 +484 496 -2.50000000000000e-01 +484 495 1.66666666666667e-01 +484 570 -8.33333333333333e-02 +484 494 1.66666666666667e-01 +484 557 -1.66666666666667e-01 +484 555 8.33333333333333e-02 +484 62 8.33333333333333e-02 +484 493 -7.50000000000000e-01 +484 492 1.66666666666667e-01 +484 483 -3.33333333333333e-01 +484 572 -8.33333333333333e-02 +484 77 8.33333333333333e-02 +484 482 -8.33333333333333e-02 +484 480 1.66666666666667e-01 +484 164 -8.33333333333333e-02 +484 176 8.33333333333333e-02 +484 177 1.66666666666667e-01 +484 174 -1.66666666666667e-01 +484 481 -2.50000000000000e-01 +484 60 8.33333333333333e-02 +484 162 -8.33333333333333e-02 +484 551 1.66666666666667e-01 +484 485 -3.33333333333333e-01 +484 179 1.66666666666667e-01 +484 550 -2.50000000000000e-01 +484 509 8.33333333333333e-02 +484 178 -7.50000000000000e-01 +484 549 -8.33333333333333e-02 +484 75 8.33333333333333e-02 +485 485 2.50000000000000e+00 +485 508 8.33333333333333e-02 +485 478 1.66666666666667e-01 +485 166 -1.66666666666667e-01 +485 165 8.33333333333333e-02 +485 479 -7.50000000000000e-01 +485 477 1.66666666666667e-01 +485 497 -2.50000000000000e-01 +485 496 -8.33333333333333e-02 +485 495 1.66666666666667e-01 +485 570 -8.33333333333333e-02 +485 493 1.66666666666667e-01 +485 492 -8.33333333333333e-02 +485 555 8.33333333333333e-02 +485 556 -1.66666666666667e-01 +485 494 -2.50000000000000e-01 +485 61 8.33333333333333e-02 +485 571 -8.33333333333333e-02 +485 76 8.33333333333333e-02 +485 177 -8.33333333333333e-02 +485 481 -8.33333333333333e-02 +485 483 -3.33333333333333e-01 +485 162 -8.33333333333333e-02 +485 174 8.33333333333333e-02 +485 163 -8.33333333333333e-02 +485 175 8.33333333333333e-02 +485 482 -2.50000000000000e-01 +485 480 1.66666666666667e-01 +485 60 -1.66666666666667e-01 +485 551 -7.50000000000000e-01 +485 507 8.33333333333333e-02 +485 179 -2.50000000000000e-01 +485 550 1.66666666666667e-01 +485 484 -3.33333333333333e-01 +485 178 1.66666666666667e-01 +485 549 1.66666666666667e-01 +485 75 -1.66666666666667e-01 +486 486 1.25000000000000e+00 +486 508 8.33333333333333e-02 +486 509 -1.66666666666667e-01 +486 62 4.16666666666667e-02 +486 479 -4.16666666666667e-02 +486 478 8.33333333333333e-02 +486 477 -1.25000000000000e-01 +486 98 4.16666666666667e-02 +486 505 8.33333333333333e-02 +486 504 -3.75000000000000e-01 +486 493 -8.33333333333333e-02 +486 215 -4.16666666666667e-02 +486 487 -1.66666666666667e-01 +486 622 -8.33333333333333e-02 +486 220 8.33333333333333e-02 +486 623 -8.33333333333333e-02 +486 221 8.33333333333333e-02 +486 97 -8.33333333333333e-02 +486 214 8.33333333333333e-02 +486 213 -1.25000000000000e-01 +486 488 -1.66666666666667e-01 +486 209 8.33333333333333e-02 +486 494 1.66666666666667e-01 +486 208 8.33333333333333e-02 +486 61 -8.33333333333333e-02 +486 506 8.33333333333333e-02 +486 207 -3.75000000000000e-01 +486 492 -2.50000000000000e-01 +487 487 1.25000000000000e+00 +487 507 8.33333333333333e-02 +487 509 8.33333333333333e-02 +487 479 8.33333333333333e-02 +487 488 -1.66666666666667e-01 +487 478 -3.75000000000000e-01 +487 477 8.33333333333333e-02 +487 505 -1.25000000000000e-01 +487 504 8.33333333333333e-02 +487 492 -8.33333333333333e-02 +487 486 -1.66666666666667e-01 +487 215 8.33333333333333e-02 +487 621 -8.33333333333333e-02 +487 219 8.33333333333333e-02 +487 494 1.66666666666667e-01 +487 221 -1.66666666666667e-01 +487 98 4.16666666666667e-02 +487 623 -8.33333333333333e-02 +487 214 -3.75000000000000e-01 +487 96 -8.33333333333333e-02 +487 213 8.33333333333333e-02 +487 209 -4.16666666666667e-02 +487 62 4.16666666666667e-02 +487 506 -4.16666666666667e-02 +487 208 -1.25000000000000e-01 +487 493 -2.50000000000000e-01 +487 207 8.33333333333333e-02 +487 60 -8.33333333333333e-02 +488 488 1.25000000000000e+00 +488 504 8.33333333333333e-02 +488 508 8.33333333333333e-02 +488 507 -1.66666666666667e-01 +488 479 -1.25000000000000e-01 +488 478 8.33333333333333e-02 +488 487 -1.66666666666667e-01 +488 60 4.16666666666667e-02 +488 477 -4.16666666666667e-02 +488 506 -1.25000000000000e-01 +488 96 4.16666666666667e-02 +488 213 -4.16666666666667e-02 +488 214 8.33333333333333e-02 +488 493 1.66666666666667e-01 +488 220 -1.66666666666667e-01 +488 621 -8.33333333333333e-02 +488 219 8.33333333333333e-02 +488 215 -1.25000000000000e-01 +488 97 4.16666666666667e-02 +488 622 -8.33333333333333e-02 +488 505 -4.16666666666667e-02 +488 209 -1.25000000000000e-01 +488 494 -7.50000000000000e-01 +488 208 -4.16666666666667e-02 +488 61 4.16666666666667e-02 +488 486 -1.66666666666667e-01 +488 207 8.33333333333333e-02 +488 492 1.66666666666667e-01 +489 489 2.50000000000000e+00 +489 556 8.33333333333333e-02 +489 629 -8.33333333333333e-02 +489 221 8.33333333333333e-02 +489 220 -1.66666666666667e-01 +489 493 1.66666666666667e-01 +489 628 -8.33333333333333e-02 +489 494 1.66666666666667e-01 +489 492 -7.50000000000000e-01 +489 482 -8.33333333333333e-02 +489 377 8.33333333333333e-02 +489 481 1.66666666666667e-01 +489 376 -1.66666666666667e-01 +489 61 8.33333333333333e-02 +489 480 -2.50000000000000e-01 +489 491 -3.33333333333333e-01 +489 554 1.66666666666667e-01 +489 100 8.33333333333333e-02 +489 553 -8.33333333333333e-02 +489 552 -2.50000000000000e-01 +489 373 -8.33333333333333e-02 +489 209 1.66666666666667e-01 +489 205 8.33333333333333e-02 +489 208 -8.33333333333333e-02 +489 206 -1.66666666666667e-01 +489 386 1.66666666666667e-01 +489 62 8.33333333333333e-02 +489 374 -8.33333333333333e-02 +489 207 -2.50000000000000e-01 +489 218 -8.33333333333333e-02 +489 101 8.33333333333333e-02 +489 490 -3.33333333333333e-01 +489 217 1.66666666666667e-01 +489 385 1.66666666666667e-01 +489 557 -1.66666666666667e-01 +489 216 -2.50000000000000e-01 +489 384 -7.50000000000000e-01 +490 490 2.50000000000000e+00 +490 555 8.33333333333333e-02 +490 629 -8.33333333333333e-02 +490 221 8.33333333333333e-02 +490 494 -8.33333333333333e-02 +490 219 -1.66666666666667e-01 +490 492 1.66666666666667e-01 +490 627 -8.33333333333333e-02 +490 493 -2.50000000000000e-01 +490 377 8.33333333333333e-02 +490 480 1.66666666666667e-01 +490 375 -1.66666666666667e-01 +490 482 1.66666666666667e-01 +490 481 -7.50000000000000e-01 +490 60 8.33333333333333e-02 +490 554 1.66666666666667e-01 +490 553 -2.50000000000000e-01 +490 99 8.33333333333333e-02 +490 552 -8.33333333333333e-02 +490 372 -8.33333333333333e-02 +490 374 -8.33333333333333e-02 +490 491 -3.33333333333333e-01 +490 204 8.33333333333333e-02 +490 207 -8.33333333333333e-02 +490 206 8.33333333333333e-02 +490 386 -8.33333333333333e-02 +490 62 -1.66666666666667e-01 +490 209 1.66666666666667e-01 +490 208 -2.50000000000000e-01 +490 218 1.66666666666667e-01 +490 101 -1.66666666666667e-01 +490 557 8.33333333333333e-02 +490 217 -7.50000000000000e-01 +490 385 -2.50000000000000e-01 +490 489 -3.33333333333333e-01 +490 216 1.66666666666667e-01 +490 384 1.66666666666667e-01 +491 491 2.50000000000000e+00 +491 555 -1.66666666666667e-01 +491 627 -8.33333333333333e-02 +491 628 -8.33333333333333e-02 +491 219 8.33333333333333e-02 +491 220 8.33333333333333e-02 +491 493 -8.33333333333333e-02 +491 494 -2.50000000000000e-01 +491 492 1.66666666666667e-01 +491 376 8.33333333333333e-02 +491 480 -8.33333333333333e-02 +491 375 8.33333333333333e-02 +491 482 -2.50000000000000e-01 +491 481 1.66666666666667e-01 +491 554 -7.50000000000000e-01 +491 553 1.66666666666667e-01 +491 489 -3.33333333333333e-01 +491 552 1.66666666666667e-01 +491 373 -8.33333333333333e-02 +491 490 -3.33333333333333e-01 +491 207 1.66666666666667e-01 +491 205 8.33333333333333e-02 +491 385 -8.33333333333333e-02 +491 204 -1.66666666666667e-01 +491 384 1.66666666666667e-01 +491 209 -7.50000000000000e-01 +491 61 -1.66666666666667e-01 +491 208 1.66666666666667e-01 +491 60 8.33333333333333e-02 +491 372 -8.33333333333333e-02 +491 556 8.33333333333333e-02 +491 218 -2.50000000000000e-01 +491 386 -2.50000000000000e-01 +491 217 1.66666666666667e-01 +491 100 -1.66666666666667e-01 +491 216 -8.33333333333333e-02 +491 99 8.33333333333333e-02 +492 492 2.50000000000000e+00 +492 509 1.66666666666667e-01 +492 479 8.33333333333333e-02 +492 508 1.66666666666667e-01 +492 507 -7.50000000000000e-01 +492 487 -8.33333333333333e-02 +492 623 8.33333333333333e-02 +492 488 1.66666666666667e-01 +492 486 -2.50000000000000e-01 +492 622 -1.66666666666667e-01 +492 494 -3.33333333333333e-01 +492 104 -8.33333333333333e-02 +492 62 -8.33333333333333e-02 +492 571 8.33333333333333e-02 +492 556 -8.33333333333333e-02 +492 485 -8.33333333333333e-02 +492 482 8.33333333333333e-02 +492 572 -1.66666666666667e-01 +492 557 1.66666666666667e-01 +492 555 -2.50000000000000e-01 +492 484 1.66666666666667e-01 +492 481 -1.66666666666667e-01 +492 483 -2.50000000000000e-01 +492 221 -8.33333333333333e-02 +492 629 8.33333333333333e-02 +492 220 1.66666666666667e-01 +492 493 -3.33333333333333e-01 +492 490 1.66666666666667e-01 +492 628 8.33333333333333e-02 +492 103 -8.33333333333333e-02 +492 219 -2.50000000000000e-01 +492 491 1.66666666666667e-01 +492 209 -1.66666666666667e-01 +492 208 8.33333333333333e-02 +492 61 -8.33333333333333e-02 +492 489 -7.50000000000000e-01 +492 478 8.33333333333333e-02 +493 493 2.50000000000000e+00 +493 509 -8.33333333333333e-02 +493 479 -1.66666666666667e-01 +493 508 -2.50000000000000e-01 +493 507 1.66666666666667e-01 +493 486 -8.33333333333333e-02 +493 488 1.66666666666667e-01 +493 487 -2.50000000000000e-01 +493 623 8.33333333333333e-02 +493 621 -1.66666666666667e-01 +493 570 8.33333333333333e-02 +493 555 -8.33333333333333e-02 +493 485 1.66666666666667e-01 +493 494 -3.33333333333333e-01 +493 557 1.66666666666667e-01 +493 104 -8.33333333333333e-02 +493 572 8.33333333333333e-02 +493 556 -2.50000000000000e-01 +493 62 -8.33333333333333e-02 +493 482 8.33333333333333e-02 +493 484 -7.50000000000000e-01 +493 483 1.66666666666667e-01 +493 480 -1.66666666666667e-01 +493 209 8.33333333333333e-02 +493 491 -8.33333333333333e-02 +493 219 1.66666666666667e-01 +493 492 -3.33333333333333e-01 +493 489 1.66666666666667e-01 +493 629 -1.66666666666667e-01 +493 221 1.66666666666667e-01 +493 220 -7.50000000000000e-01 +493 627 8.33333333333333e-02 +493 102 -8.33333333333333e-02 +493 490 -2.50000000000000e-01 +493 477 8.33333333333333e-02 +493 207 8.33333333333333e-02 +493 60 -8.33333333333333e-02 +494 494 2.50000000000000e+00 +494 507 1.66666666666667e-01 +494 478 -1.66666666666667e-01 +494 477 8.33333333333333e-02 +494 509 -2.50000000000000e-01 +494 487 1.66666666666667e-01 +494 621 8.33333333333333e-02 +494 488 -7.50000000000000e-01 +494 486 1.66666666666667e-01 +494 622 8.33333333333333e-02 +494 492 -3.33333333333333e-01 +494 102 -8.33333333333333e-02 +494 60 -8.33333333333333e-02 +494 484 1.66666666666667e-01 +494 493 -3.33333333333333e-01 +494 556 1.66666666666667e-01 +494 483 -8.33333333333333e-02 +494 480 8.33333333333333e-02 +494 557 -7.50000000000000e-01 +494 103 -8.33333333333333e-02 +494 571 8.33333333333333e-02 +494 570 -1.66666666666667e-01 +494 555 1.66666666666667e-01 +494 485 -2.50000000000000e-01 +494 61 -8.33333333333333e-02 +494 481 8.33333333333333e-02 +494 219 -8.33333333333333e-02 +494 627 8.33333333333333e-02 +494 208 8.33333333333333e-02 +494 490 -8.33333333333333e-02 +494 221 -2.50000000000000e-01 +494 628 -1.66666666666667e-01 +494 220 1.66666666666667e-01 +494 491 -2.50000000000000e-01 +494 508 -8.33333333333333e-02 +494 489 1.66666666666667e-01 +494 207 -1.66666666666667e-01 +495 495 2.50000000000000e+00 +495 509 -8.33333333333333e-02 +495 508 1.66666666666667e-01 +495 507 -2.50000000000000e-01 +495 572 8.33333333333333e-02 +495 478 8.33333333333333e-02 +495 479 -1.66666666666667e-01 +495 485 1.66666666666667e-01 +495 484 1.66666666666667e-01 +495 483 -7.50000000000000e-01 +495 496 -3.33333333333333e-01 +495 64 -8.33333333333333e-02 +495 76 -8.33333333333333e-02 +495 574 -8.33333333333333e-02 +495 568 8.33333333333333e-02 +495 575 -8.33333333333333e-02 +495 512 8.33333333333333e-02 +495 65 1.66666666666667e-01 +495 497 -3.33333333333333e-01 +495 503 1.66666666666667e-01 +495 511 -1.66666666666667e-01 +495 502 1.66666666666667e-01 +495 501 -7.50000000000000e-01 +495 77 1.66666666666667e-01 +495 569 -1.66666666666667e-01 +495 166 -8.33333333333333e-02 +495 460 8.33333333333333e-02 +495 461 8.33333333333333e-02 +495 167 -8.33333333333333e-02 +495 63 -2.50000000000000e-01 +495 467 -8.33333333333333e-02 +495 179 8.33333333333333e-02 +495 466 1.66666666666667e-01 +495 178 -1.66666666666667e-01 +495 465 -2.50000000000000e-01 +495 571 8.33333333333333e-02 +495 75 -2.50000000000000e-01 +496 496 2.50000000000000e+00 +496 509 1.66666666666667e-01 +496 508 -7.50000000000000e-01 +496 507 1.66666666666667e-01 +496 572 -1.66666666666667e-01 +496 477 8.33333333333333e-02 +496 479 8.33333333333333e-02 +496 485 -8.33333333333333e-02 +496 484 -2.50000000000000e-01 +496 483 1.66666666666667e-01 +496 495 -3.33333333333333e-01 +496 63 -8.33333333333333e-02 +496 75 -8.33333333333333e-02 +496 573 -8.33333333333333e-02 +496 567 8.33333333333333e-02 +496 512 8.33333333333333e-02 +496 503 -8.33333333333333e-02 +496 502 -2.50000000000000e-01 +496 510 -1.66666666666667e-01 +496 501 1.66666666666667e-01 +496 575 -8.33333333333333e-02 +496 569 8.33333333333333e-02 +496 165 -8.33333333333333e-02 +496 459 8.33333333333333e-02 +496 167 -8.33333333333333e-02 +496 179 8.33333333333333e-02 +496 461 -1.66666666666667e-01 +496 65 1.66666666666667e-01 +496 64 -2.50000000000000e-01 +496 467 1.66666666666667e-01 +496 497 -3.33333333333333e-01 +496 77 1.66666666666667e-01 +496 466 -7.50000000000000e-01 +496 570 8.33333333333333e-02 +496 76 -2.50000000000000e-01 +496 465 1.66666666666667e-01 +496 177 -1.66666666666667e-01 +497 497 2.50000000000000e+00 +497 508 1.66666666666667e-01 +497 507 -8.33333333333333e-02 +497 571 -1.66666666666667e-01 +497 570 8.33333333333333e-02 +497 478 8.33333333333333e-02 +497 477 -1.66666666666667e-01 +497 485 -2.50000000000000e-01 +497 484 -8.33333333333333e-02 +497 483 1.66666666666667e-01 +497 573 -8.33333333333333e-02 +497 510 8.33333333333333e-02 +497 503 -2.50000000000000e-01 +497 511 8.33333333333333e-02 +497 502 -8.33333333333333e-02 +497 63 1.66666666666667e-01 +497 495 -3.33333333333333e-01 +497 501 1.66666666666667e-01 +497 574 -8.33333333333333e-02 +497 568 8.33333333333333e-02 +497 75 1.66666666666667e-01 +497 567 -1.66666666666667e-01 +497 166 -8.33333333333333e-02 +497 178 8.33333333333333e-02 +497 65 -7.50000000000000e-01 +497 460 -1.66666666666667e-01 +497 64 1.66666666666667e-01 +497 459 8.33333333333333e-02 +497 165 -8.33333333333333e-02 +497 467 -2.50000000000000e-01 +497 509 -2.50000000000000e-01 +497 77 -7.50000000000000e-01 +497 466 1.66666666666667e-01 +497 496 -3.33333333333333e-01 +497 76 1.66666666666667e-01 +497 465 -8.33333333333333e-02 +497 177 8.33333333333333e-02 +498 498 1.25000000000000e+00 +498 461 4.16666666666667e-02 +498 460 -8.33333333333333e-02 +498 469 8.33333333333333e-02 +498 468 -1.25000000000000e-01 +498 65 8.33333333333333e-02 +498 500 -1.66666666666667e-01 +498 503 1.66666666666667e-01 +498 502 -8.33333333333333e-02 +498 501 -2.50000000000000e-01 +498 80 8.33333333333333e-02 +498 587 -1.66666666666667e-01 +498 586 8.33333333333333e-02 +498 511 8.33333333333333e-02 +498 589 -8.33333333333333e-02 +498 227 4.16666666666667e-02 +498 590 -8.33333333333333e-02 +498 79 8.33333333333333e-02 +498 226 -8.33333333333333e-02 +498 78 -3.75000000000000e-01 +498 224 -4.16666666666667e-02 +498 512 8.33333333333333e-02 +498 499 -1.66666666666667e-01 +498 223 8.33333333333333e-02 +498 64 8.33333333333333e-02 +498 470 -4.16666666666667e-02 +498 222 -1.25000000000000e-01 +498 63 -3.75000000000000e-01 +499 499 1.25000000000000e+00 +499 500 -1.66666666666667e-01 +499 65 -4.16666666666667e-02 +499 461 4.16666666666667e-02 +499 459 -8.33333333333333e-02 +499 80 -4.16666666666667e-02 +499 469 -3.75000000000000e-01 +499 468 8.33333333333333e-02 +499 587 8.33333333333333e-02 +499 503 1.66666666666667e-01 +499 502 -2.50000000000000e-01 +499 501 -8.33333333333333e-02 +499 585 8.33333333333333e-02 +499 510 8.33333333333333e-02 +499 588 -8.33333333333333e-02 +499 227 4.16666666666667e-02 +499 590 -8.33333333333333e-02 +499 79 -1.25000000000000e-01 +499 78 8.33333333333333e-02 +499 225 -8.33333333333333e-02 +499 224 8.33333333333333e-02 +499 512 -1.66666666666667e-01 +499 470 8.33333333333333e-02 +499 223 -3.75000000000000e-01 +499 64 -1.25000000000000e-01 +499 498 -1.66666666666667e-01 +499 222 8.33333333333333e-02 +499 63 8.33333333333333e-02 +500 500 1.25000000000000e+00 +500 499 -1.66666666666667e-01 +500 468 -4.16666666666667e-02 +500 459 4.16666666666667e-02 +500 64 -4.16666666666667e-02 +500 460 4.16666666666667e-02 +500 470 -1.25000000000000e-01 +500 79 -4.16666666666667e-02 +500 586 8.33333333333333e-02 +500 503 -7.50000000000000e-01 +500 502 1.66666666666667e-01 +500 63 8.33333333333333e-02 +500 498 -1.66666666666667e-01 +500 501 1.66666666666667e-01 +500 78 8.33333333333333e-02 +500 585 -1.66666666666667e-01 +500 226 4.16666666666667e-02 +500 589 -8.33333333333333e-02 +500 80 -1.25000000000000e-01 +500 225 4.16666666666667e-02 +500 588 -8.33333333333333e-02 +500 469 8.33333333333333e-02 +500 224 -1.25000000000000e-01 +500 65 -1.25000000000000e-01 +500 223 8.33333333333333e-02 +500 511 -1.66666666666667e-01 +500 222 -4.16666666666667e-02 +500 510 8.33333333333333e-02 +501 501 2.50000000000000e+00 +501 466 -1.66666666666667e-01 +501 461 -8.33333333333333e-02 +501 469 8.33333333333333e-02 +501 460 -8.33333333333333e-02 +501 470 8.33333333333333e-02 +501 476 -8.33333333333333e-02 +501 475 1.66666666666667e-01 +501 474 -2.50000000000000e-01 +501 590 8.33333333333333e-02 +501 589 -1.66666666666667e-01 +501 586 1.66666666666667e-01 +501 500 1.66666666666667e-01 +501 64 8.33333333333333e-02 +501 499 -8.33333333333333e-02 +501 498 -2.50000000000000e-01 +501 587 1.66666666666667e-01 +501 85 8.33333333333333e-02 +501 585 -7.50000000000000e-01 +501 503 -3.33333333333333e-01 +501 568 -8.33333333333333e-02 +501 512 -8.33333333333333e-02 +501 574 8.33333333333333e-02 +501 598 -8.33333333333333e-02 +501 575 8.33333333333333e-02 +501 599 -8.33333333333333e-02 +501 65 -1.66666666666667e-01 +501 497 1.66666666666667e-01 +501 511 1.66666666666667e-01 +501 496 1.66666666666667e-01 +501 502 -3.33333333333333e-01 +501 510 -2.50000000000000e-01 +501 495 -7.50000000000000e-01 +501 569 1.66666666666667e-01 +501 86 -1.66666666666667e-01 +501 467 8.33333333333333e-02 +501 567 -2.50000000000000e-01 +502 502 2.50000000000000e+00 +502 465 -1.66666666666667e-01 +502 468 8.33333333333333e-02 +502 459 -8.33333333333333e-02 +502 470 -1.66666666666667e-01 +502 476 1.66666666666667e-01 +502 461 -8.33333333333333e-02 +502 475 -7.50000000000000e-01 +502 474 1.66666666666667e-01 +502 590 8.33333333333333e-02 +502 587 -8.33333333333333e-02 +502 588 -1.66666666666667e-01 +502 585 1.66666666666667e-01 +502 500 1.66666666666667e-01 +502 503 -3.33333333333333e-01 +502 499 -2.50000000000000e-01 +502 63 8.33333333333333e-02 +502 498 -8.33333333333333e-02 +502 586 -2.50000000000000e-01 +502 84 8.33333333333333e-02 +502 567 -8.33333333333333e-02 +502 512 1.66666666666667e-01 +502 573 8.33333333333333e-02 +502 597 -8.33333333333333e-02 +502 575 -1.66666666666667e-01 +502 569 1.66666666666667e-01 +502 65 8.33333333333333e-02 +502 497 -8.33333333333333e-02 +502 511 -7.50000000000000e-01 +502 496 -2.50000000000000e-01 +502 510 1.66666666666667e-01 +502 495 1.66666666666667e-01 +502 501 -3.33333333333333e-01 +502 599 -8.33333333333333e-02 +502 86 8.33333333333333e-02 +502 467 8.33333333333333e-02 +502 568 -2.50000000000000e-01 +503 503 2.50000000000000e+00 +503 465 8.33333333333333e-02 +503 459 -8.33333333333333e-02 +503 469 -1.66666666666667e-01 +503 475 1.66666666666667e-01 +503 468 8.33333333333333e-02 +503 474 -8.33333333333333e-02 +503 460 -8.33333333333333e-02 +503 476 -2.50000000000000e-01 +503 589 8.33333333333333e-02 +503 586 -8.33333333333333e-02 +503 588 8.33333333333333e-02 +503 500 -7.50000000000000e-01 +503 499 1.66666666666667e-01 +503 502 -3.33333333333333e-01 +503 498 1.66666666666667e-01 +503 587 -2.50000000000000e-01 +503 585 1.66666666666667e-01 +503 501 -3.33333333333333e-01 +503 510 -8.33333333333333e-02 +503 511 1.66666666666667e-01 +503 574 -1.66666666666667e-01 +503 568 1.66666666666667e-01 +503 573 8.33333333333333e-02 +503 597 -8.33333333333333e-02 +503 512 -2.50000000000000e-01 +503 497 -2.50000000000000e-01 +503 64 8.33333333333333e-02 +503 496 -8.33333333333333e-02 +503 63 -1.66666666666667e-01 +503 495 1.66666666666667e-01 +503 466 8.33333333333333e-02 +503 569 -7.50000000000000e-01 +503 598 -8.33333333333333e-02 +503 85 8.33333333333333e-02 +503 567 1.66666666666667e-01 +503 84 -1.66666666666667e-01 +504 504 1.25000000000000e+00 +504 488 8.33333333333333e-02 +504 479 4.16666666666667e-02 +504 65 -4.16666666666667e-02 +504 478 -8.33333333333333e-02 +504 98 -4.16666666666667e-02 +504 487 8.33333333333333e-02 +504 486 -3.75000000000000e-01 +504 623 8.33333333333333e-02 +504 622 8.33333333333333e-02 +504 509 1.66666666666667e-01 +504 508 -8.33333333333333e-02 +504 507 -2.50000000000000e-01 +504 511 8.33333333333333e-02 +504 625 -8.33333333333333e-02 +504 230 4.16666666666667e-02 +504 626 -8.33333333333333e-02 +504 229 -8.33333333333333e-02 +504 97 8.33333333333333e-02 +504 96 -1.25000000000000e-01 +504 224 8.33333333333333e-02 +504 512 -1.66666666666667e-01 +504 223 8.33333333333333e-02 +504 505 -1.66666666666667e-01 +504 64 8.33333333333333e-02 +504 222 -3.75000000000000e-01 +504 506 -1.66666666666667e-01 +504 63 -1.25000000000000e-01 +505 505 1.25000000000000e+00 +505 479 4.16666666666667e-02 +505 477 -8.33333333333333e-02 +505 487 -1.25000000000000e-01 +505 486 8.33333333333333e-02 +505 98 8.33333333333333e-02 +505 623 -1.66666666666667e-01 +505 621 8.33333333333333e-02 +505 506 -1.66666666666667e-01 +505 65 8.33333333333333e-02 +505 509 1.66666666666667e-01 +505 508 -2.50000000000000e-01 +505 507 -8.33333333333333e-02 +505 510 8.33333333333333e-02 +505 624 -8.33333333333333e-02 +505 230 4.16666666666667e-02 +505 626 -8.33333333333333e-02 +505 97 -3.75000000000000e-01 +505 228 -8.33333333333333e-02 +505 96 8.33333333333333e-02 +505 224 -4.16666666666667e-02 +505 512 8.33333333333333e-02 +505 223 -1.25000000000000e-01 +505 488 -4.16666666666667e-02 +505 64 -3.75000000000000e-01 +505 222 8.33333333333333e-02 +505 504 -1.66666666666667e-01 +505 63 8.33333333333333e-02 +506 506 1.25000000000000e+00 +506 478 4.16666666666667e-02 +506 504 -1.66666666666667e-01 +506 486 8.33333333333333e-02 +506 477 4.16666666666667e-02 +506 63 -4.16666666666667e-02 +506 488 -1.25000000000000e-01 +506 96 -4.16666666666667e-02 +506 621 8.33333333333333e-02 +506 97 8.33333333333333e-02 +506 622 -1.66666666666667e-01 +506 509 -7.50000000000000e-01 +506 505 -1.66666666666667e-01 +506 64 8.33333333333333e-02 +506 508 1.66666666666667e-01 +506 507 1.66666666666667e-01 +506 228 4.16666666666667e-02 +506 624 -8.33333333333333e-02 +506 98 -1.25000000000000e-01 +506 229 4.16666666666667e-02 +506 625 -8.33333333333333e-02 +506 224 -1.25000000000000e-01 +506 487 -4.16666666666667e-02 +506 65 -1.25000000000000e-01 +506 223 -4.16666666666667e-02 +506 511 8.33333333333333e-02 +506 222 8.33333333333333e-02 +506 510 -1.66666666666667e-01 +507 507 2.50000000000000e+00 +507 484 -1.66666666666667e-01 +507 478 -8.33333333333333e-02 +507 487 8.33333333333333e-02 +507 494 1.66666666666667e-01 +507 488 -1.66666666666667e-01 +507 479 -8.33333333333333e-02 +507 493 1.66666666666667e-01 +507 492 -7.50000000000000e-01 +507 626 8.33333333333333e-02 +507 623 -8.33333333333333e-02 +507 622 1.66666666666667e-01 +507 625 -1.66666666666667e-01 +507 506 1.66666666666667e-01 +507 509 -3.33333333333333e-01 +507 505 -8.33333333333333e-02 +507 64 8.33333333333333e-02 +507 504 -2.50000000000000e-01 +507 103 8.33333333333333e-02 +507 621 -2.50000000000000e-01 +507 571 -8.33333333333333e-02 +507 512 1.66666666666667e-01 +507 574 8.33333333333333e-02 +507 634 -8.33333333333333e-02 +507 575 -1.66666666666667e-01 +507 572 1.66666666666667e-01 +507 65 8.33333333333333e-02 +507 497 -8.33333333333333e-02 +507 511 1.66666666666667e-01 +507 496 1.66666666666667e-01 +507 508 -3.33333333333333e-01 +507 510 -7.50000000000000e-01 +507 495 -2.50000000000000e-01 +507 635 -8.33333333333333e-02 +507 104 8.33333333333333e-02 +507 485 8.33333333333333e-02 +507 570 -2.50000000000000e-01 +508 508 2.50000000000000e+00 +508 483 -1.66666666666667e-01 +508 479 -8.33333333333333e-02 +508 477 -8.33333333333333e-02 +508 486 8.33333333333333e-02 +508 494 -8.33333333333333e-02 +508 488 8.33333333333333e-02 +508 493 -2.50000000000000e-01 +508 492 1.66666666666667e-01 +508 626 8.33333333333333e-02 +508 621 1.66666666666667e-01 +508 624 -1.66666666666667e-01 +508 506 1.66666666666667e-01 +508 505 -2.50000000000000e-01 +508 504 -8.33333333333333e-02 +508 63 8.33333333333333e-02 +508 623 1.66666666666667e-01 +508 622 -7.50000000000000e-01 +508 102 8.33333333333333e-02 +508 509 -3.33333333333333e-01 +508 570 -8.33333333333333e-02 +508 512 -8.33333333333333e-02 +508 573 8.33333333333333e-02 +508 633 -8.33333333333333e-02 +508 635 -8.33333333333333e-02 +508 575 8.33333333333333e-02 +508 65 -1.66666666666667e-01 +508 497 1.66666666666667e-01 +508 511 -2.50000000000000e-01 +508 496 -7.50000000000000e-01 +508 510 1.66666666666667e-01 +508 495 1.66666666666667e-01 +508 507 -3.33333333333333e-01 +508 572 1.66666666666667e-01 +508 104 -1.66666666666667e-01 +508 485 8.33333333333333e-02 +508 571 -2.50000000000000e-01 +509 509 2.50000000000000e+00 +509 484 8.33333333333333e-02 +509 478 -8.33333333333333e-02 +509 493 -8.33333333333333e-02 +509 487 8.33333333333333e-02 +509 492 1.66666666666667e-01 +509 486 -1.66666666666667e-01 +509 477 -8.33333333333333e-02 +509 494 -2.50000000000000e-01 +509 624 8.33333333333333e-02 +509 621 -8.33333333333333e-02 +509 625 8.33333333333333e-02 +509 506 -7.50000000000000e-01 +509 505 1.66666666666667e-01 +509 504 1.66666666666667e-01 +509 507 -3.33333333333333e-01 +509 623 -2.50000000000000e-01 +509 622 1.66666666666667e-01 +509 508 -3.33333333333333e-01 +509 511 -8.33333333333333e-02 +509 510 1.66666666666667e-01 +509 634 -8.33333333333333e-02 +509 574 8.33333333333333e-02 +509 573 -1.66666666666667e-01 +509 570 1.66666666666667e-01 +509 512 -2.50000000000000e-01 +509 497 -2.50000000000000e-01 +509 64 -1.66666666666667e-01 +509 496 1.66666666666667e-01 +509 63 8.33333333333333e-02 +509 495 -8.33333333333333e-02 +509 483 8.33333333333333e-02 +509 572 -7.50000000000000e-01 +509 571 1.66666666666667e-01 +509 103 -1.66666666666667e-01 +509 633 -8.33333333333333e-02 +509 102 8.33333333333333e-02 +510 510 2.50000000000000e+00 +510 634 8.33333333333333e-02 +510 635 8.33333333333333e-02 +510 508 1.66666666666667e-01 +510 507 -7.50000000000000e-01 +510 505 8.33333333333333e-02 +510 626 -8.33333333333333e-02 +510 506 -1.66666666666667e-01 +510 625 1.66666666666667e-01 +510 624 -2.50000000000000e-01 +510 511 -3.33333333333333e-01 +510 64 -8.33333333333333e-02 +510 106 -8.33333333333333e-02 +510 497 8.33333333333333e-02 +510 503 -8.33333333333333e-02 +510 574 -8.33333333333333e-02 +510 598 8.33333333333333e-02 +510 496 -1.66666666666667e-01 +510 502 1.66666666666667e-01 +510 501 -2.50000000000000e-01 +510 575 1.66666666666667e-01 +510 599 -1.66666666666667e-01 +510 573 -2.50000000000000e-01 +510 223 -8.33333333333333e-02 +510 499 8.33333333333333e-02 +510 224 1.66666666666667e-01 +510 512 -3.33333333333333e-01 +510 590 1.66666666666667e-01 +510 500 8.33333333333333e-02 +510 65 -8.33333333333333e-02 +510 222 -2.50000000000000e-01 +510 233 8.33333333333333e-02 +510 107 -8.33333333333333e-02 +510 589 1.66666666666667e-01 +510 232 -1.66666666666667e-01 +510 588 -7.50000000000000e-01 +510 509 1.66666666666667e-01 +511 511 2.50000000000000e+00 +511 633 8.33333333333333e-02 +511 635 -1.66666666666667e-01 +511 508 -2.50000000000000e-01 +511 507 1.66666666666667e-01 +511 504 8.33333333333333e-02 +511 626 1.66666666666667e-01 +511 506 8.33333333333333e-02 +511 625 -7.50000000000000e-01 +511 624 1.66666666666667e-01 +511 510 -3.33333333333333e-01 +511 63 -8.33333333333333e-02 +511 105 -8.33333333333333e-02 +511 575 1.66666666666667e-01 +511 512 -3.33333333333333e-01 +511 503 1.66666666666667e-01 +511 573 -8.33333333333333e-02 +511 597 8.33333333333333e-02 +511 65 -8.33333333333333e-02 +511 497 8.33333333333333e-02 +511 502 -7.50000000000000e-01 +511 495 -1.66666666666667e-01 +511 501 1.66666666666667e-01 +511 107 -8.33333333333333e-02 +511 599 8.33333333333333e-02 +511 574 -2.50000000000000e-01 +511 222 -8.33333333333333e-02 +511 498 8.33333333333333e-02 +511 233 8.33333333333333e-02 +511 590 -8.33333333333333e-02 +511 500 -1.66666666666667e-01 +511 224 1.66666666666667e-01 +511 223 -2.50000000000000e-01 +511 589 -2.50000000000000e-01 +511 509 -8.33333333333333e-02 +511 588 1.66666666666667e-01 +511 231 -1.66666666666667e-01 +512 512 2.50000000000000e+00 +512 507 1.66666666666667e-01 +512 634 -1.66666666666667e-01 +512 633 8.33333333333333e-02 +512 509 -2.50000000000000e-01 +512 625 1.66666666666667e-01 +512 624 -8.33333333333333e-02 +512 505 8.33333333333333e-02 +512 504 -1.66666666666667e-01 +512 626 -2.50000000000000e-01 +512 495 8.33333333333333e-02 +512 501 -8.33333333333333e-02 +512 574 1.66666666666667e-01 +512 511 -3.33333333333333e-01 +512 502 1.66666666666667e-01 +512 503 -2.50000000000000e-01 +512 64 -8.33333333333333e-02 +512 496 8.33333333333333e-02 +512 575 -7.50000000000000e-01 +512 106 -8.33333333333333e-02 +512 598 8.33333333333333e-02 +512 573 1.66666666666667e-01 +512 597 -1.66666666666667e-01 +512 232 8.33333333333333e-02 +512 589 -8.33333333333333e-02 +512 222 1.66666666666667e-01 +512 510 -3.33333333333333e-01 +512 588 1.66666666666667e-01 +512 224 -7.50000000000000e-01 +512 499 -1.66666666666667e-01 +512 223 1.66666666666667e-01 +512 498 8.33333333333333e-02 +512 63 -8.33333333333333e-02 +512 590 -2.50000000000000e-01 +512 508 -8.33333333333333e-02 +512 231 8.33333333333333e-02 +512 105 -8.33333333333333e-02 +513 513 1.25000000000000e+00 +513 545 -8.33333333333333e-02 +513 542 -8.33333333333333e-02 +513 541 4.16666666666667e-02 +513 544 -8.33333333333333e-02 +513 524 8.33333333333333e-02 +513 523 -4.16666666666667e-02 +513 529 8.33333333333333e-02 +513 522 -1.25000000000000e-01 +513 172 -4.16666666666667e-02 +513 169 4.16666666666667e-02 +513 533 8.33333333333333e-02 +513 521 -8.33333333333333e-02 +513 68 8.33333333333333e-02 +513 170 -8.33333333333333e-02 +513 67 8.33333333333333e-02 +513 514 -1.66666666666667e-01 +513 520 1.66666666666667e-01 +513 66 -3.75000000000000e-01 +513 519 -2.50000000000000e-01 +513 515 -1.66666666666667e-01 +513 71 8.33333333333333e-02 +513 173 8.33333333333333e-02 +513 70 8.33333333333333e-02 +513 532 -1.66666666666667e-01 +513 530 8.33333333333333e-02 +513 69 -3.75000000000000e-01 +513 171 -1.25000000000000e-01 +514 514 1.25000000000000e+00 +514 545 -8.33333333333333e-02 +514 540 4.16666666666667e-02 +514 543 -8.33333333333333e-02 +514 524 8.33333333333333e-02 +514 530 -1.66666666666667e-01 +514 523 -1.25000000000000e-01 +514 522 -4.16666666666667e-02 +514 528 8.33333333333333e-02 +514 171 -4.16666666666667e-02 +514 168 4.16666666666667e-02 +514 173 8.33333333333333e-02 +514 515 -1.66666666666667e-01 +514 521 1.66666666666667e-01 +514 68 -4.16666666666667e-02 +514 170 4.16666666666667e-02 +514 67 -1.25000000000000e-01 +514 520 -7.50000000000000e-01 +514 66 8.33333333333333e-02 +514 513 -1.66666666666667e-01 +514 519 1.66666666666667e-01 +514 71 -4.16666666666667e-02 +514 533 8.33333333333333e-02 +514 542 4.16666666666667e-02 +514 70 -1.25000000000000e-01 +514 172 -1.25000000000000e-01 +514 69 8.33333333333333e-02 +514 531 -1.66666666666667e-01 +515 515 1.25000000000000e+00 +515 544 -8.33333333333333e-02 +515 528 8.33333333333333e-02 +515 543 -8.33333333333333e-02 +515 540 -8.33333333333333e-02 +515 524 -3.75000000000000e-01 +515 523 8.33333333333333e-02 +515 529 -1.66666666666667e-01 +515 522 8.33333333333333e-02 +515 172 8.33333333333333e-02 +515 514 -1.66666666666667e-01 +515 520 1.66666666666667e-01 +515 531 8.33333333333333e-02 +515 519 -8.33333333333333e-02 +515 68 -1.25000000000000e-01 +515 521 -2.50000000000000e-01 +515 67 -4.16666666666667e-02 +515 169 4.16666666666667e-02 +515 66 8.33333333333333e-02 +515 168 -8.33333333333333e-02 +515 541 4.16666666666667e-02 +515 71 -1.25000000000000e-01 +515 173 -3.75000000000000e-01 +515 70 -4.16666666666667e-02 +515 532 8.33333333333333e-02 +515 513 -1.66666666666667e-01 +515 69 8.33333333333333e-02 +515 171 8.33333333333333e-02 +516 516 2.50000000000000e+00 +516 530 -1.66666666666667e-01 +516 529 8.33333333333333e-02 +516 562 -8.33333333333333e-02 +516 521 1.66666666666667e-01 +516 551 8.33333333333333e-02 +516 550 -1.66666666666667e-01 +516 520 1.66666666666667e-01 +516 519 -7.50000000000000e-01 +516 518 -3.33333333333333e-01 +516 527 1.66666666666667e-01 +516 526 -8.33333333333333e-02 +516 559 8.33333333333333e-02 +516 560 8.33333333333333e-02 +516 74 -8.33333333333333e-02 +516 68 -8.33333333333333e-02 +516 525 -2.50000000000000e-01 +516 410 8.33333333333333e-02 +516 67 1.66666666666667e-01 +516 409 -1.66666666666667e-01 +516 413 1.66666666666667e-01 +516 517 -3.33333333333333e-01 +516 73 1.66666666666667e-01 +516 412 1.66666666666667e-01 +516 411 -7.50000000000000e-01 +516 170 8.33333333333333e-02 +516 347 -8.33333333333333e-02 +516 169 8.33333333333333e-02 +516 346 -8.33333333333333e-02 +516 66 -2.50000000000000e-01 +516 176 1.66666666666667e-01 +516 350 -1.66666666666667e-01 +516 175 -8.33333333333333e-02 +516 349 8.33333333333333e-02 +516 174 -2.50000000000000e-01 +516 563 -8.33333333333333e-02 +516 72 -2.50000000000000e-01 +517 517 2.50000000000000e+00 +517 563 -8.33333333333333e-02 +517 528 8.33333333333333e-02 +517 561 -8.33333333333333e-02 +517 551 8.33333333333333e-02 +517 521 -8.33333333333333e-02 +517 549 -1.66666666666667e-01 +517 520 -2.50000000000000e-01 +517 519 1.66666666666667e-01 +517 525 -8.33333333333333e-02 +517 558 8.33333333333333e-02 +517 560 -1.66666666666667e-01 +517 527 1.66666666666667e-01 +517 526 -2.50000000000000e-01 +517 410 8.33333333333333e-02 +517 66 1.66666666666667e-01 +517 408 -1.66666666666667e-01 +517 413 -8.33333333333333e-02 +517 412 -2.50000000000000e-01 +517 516 -3.33333333333333e-01 +517 72 1.66666666666667e-01 +517 411 1.66666666666667e-01 +517 350 8.33333333333333e-02 +517 347 -8.33333333333333e-02 +517 170 -1.66666666666667e-01 +517 68 1.66666666666667e-01 +517 67 -7.50000000000000e-01 +517 168 8.33333333333333e-02 +517 345 -8.33333333333333e-02 +517 176 1.66666666666667e-01 +517 518 -3.33333333333333e-01 +517 74 1.66666666666667e-01 +517 175 -2.50000000000000e-01 +517 530 8.33333333333333e-02 +517 73 -7.50000000000000e-01 +517 174 -8.33333333333333e-02 +517 348 8.33333333333333e-02 +518 518 2.50000000000000e+00 +518 529 8.33333333333333e-02 +518 562 -8.33333333333333e-02 +518 528 -1.66666666666667e-01 +518 550 8.33333333333333e-02 +518 520 -8.33333333333333e-02 +518 519 1.66666666666667e-01 +518 549 8.33333333333333e-02 +518 521 -2.50000000000000e-01 +518 516 -3.33333333333333e-01 +518 525 1.66666666666667e-01 +518 559 -1.66666666666667e-01 +518 558 8.33333333333333e-02 +518 72 -8.33333333333333e-02 +518 527 -7.50000000000000e-01 +518 526 1.66666666666667e-01 +518 66 -8.33333333333333e-02 +518 408 8.33333333333333e-02 +518 409 8.33333333333333e-02 +518 413 -2.50000000000000e-01 +518 412 -8.33333333333333e-02 +518 411 1.66666666666667e-01 +518 349 8.33333333333333e-02 +518 346 -8.33333333333333e-02 +518 168 8.33333333333333e-02 +518 345 -8.33333333333333e-02 +518 68 -2.50000000000000e-01 +518 169 -1.66666666666667e-01 +518 67 1.66666666666667e-01 +518 176 -7.50000000000000e-01 +518 561 -8.33333333333333e-02 +518 74 -2.50000000000000e-01 +518 175 1.66666666666667e-01 +518 517 -3.33333333333333e-01 +518 73 1.66666666666667e-01 +518 174 1.66666666666667e-01 +518 348 -1.66666666666667e-01 +519 519 2.50000000000000e+00 +519 563 8.33333333333333e-02 +519 518 1.66666666666667e-01 +519 176 -1.66666666666667e-01 +519 175 8.33333333333333e-02 +519 517 1.66666666666667e-01 +519 516 -7.50000000000000e-01 +519 551 -8.33333333333333e-02 +519 550 1.66666666666667e-01 +519 549 -2.50000000000000e-01 +519 529 -8.33333333333333e-02 +519 577 -8.33333333333333e-02 +519 544 8.33333333333333e-02 +519 530 1.66666666666667e-01 +519 545 -1.66666666666667e-01 +519 77 8.33333333333333e-02 +519 578 -8.33333333333333e-02 +519 68 8.33333333333333e-02 +519 528 -2.50000000000000e-01 +519 170 -8.33333333333333e-02 +519 169 -8.33333333333333e-02 +519 173 8.33333333333333e-02 +519 515 -8.33333333333333e-02 +519 520 -3.33333333333333e-01 +519 172 8.33333333333333e-02 +519 178 -8.33333333333333e-02 +519 67 -1.66666666666667e-01 +519 514 1.66666666666667e-01 +519 513 -2.50000000000000e-01 +519 521 -3.33333333333333e-01 +519 533 1.66666666666667e-01 +519 179 1.66666666666667e-01 +519 532 1.66666666666667e-01 +519 76 -1.66666666666667e-01 +519 562 8.33333333333333e-02 +519 531 -7.50000000000000e-01 +519 177 -2.50000000000000e-01 +520 520 2.50000000000000e+00 +520 563 -1.66666666666667e-01 +520 518 -8.33333333333333e-02 +520 176 8.33333333333333e-02 +520 174 8.33333333333333e-02 +520 517 -2.50000000000000e-01 +520 516 1.66666666666667e-01 +520 551 1.66666666666667e-01 +520 550 -7.50000000000000e-01 +520 549 1.66666666666667e-01 +520 528 -8.33333333333333e-02 +520 576 -8.33333333333333e-02 +520 543 8.33333333333333e-02 +520 578 -8.33333333333333e-02 +520 545 8.33333333333333e-02 +520 521 -3.33333333333333e-01 +520 530 1.66666666666667e-01 +520 529 -2.50000000000000e-01 +520 168 -8.33333333333333e-02 +520 515 1.66666666666667e-01 +520 519 -3.33333333333333e-01 +520 173 -1.66666666666667e-01 +520 179 1.66666666666667e-01 +520 171 8.33333333333333e-02 +520 177 -8.33333333333333e-02 +520 68 8.33333333333333e-02 +520 170 -8.33333333333333e-02 +520 514 -7.50000000000000e-01 +520 66 -1.66666666666667e-01 +520 513 1.66666666666667e-01 +520 533 -8.33333333333333e-02 +520 77 8.33333333333333e-02 +520 561 8.33333333333333e-02 +520 532 -2.50000000000000e-01 +520 178 -2.50000000000000e-01 +520 531 1.66666666666667e-01 +520 75 -1.66666666666667e-01 +521 521 2.50000000000000e+00 +521 561 8.33333333333333e-02 +521 517 -8.33333333333333e-02 +521 175 8.33333333333333e-02 +521 516 1.66666666666667e-01 +521 174 -1.66666666666667e-01 +521 518 -2.50000000000000e-01 +521 551 -2.50000000000000e-01 +521 550 1.66666666666667e-01 +521 549 -8.33333333333333e-02 +521 577 -8.33333333333333e-02 +521 544 8.33333333333333e-02 +521 528 1.66666666666667e-01 +521 543 -1.66666666666667e-01 +521 75 8.33333333333333e-02 +521 576 -8.33333333333333e-02 +521 530 -7.50000000000000e-01 +521 520 -3.33333333333333e-01 +521 529 1.66666666666667e-01 +521 66 8.33333333333333e-02 +521 168 -8.33333333333333e-02 +521 514 1.66666666666667e-01 +521 171 8.33333333333333e-02 +521 513 -8.33333333333333e-02 +521 172 -1.66666666666667e-01 +521 178 1.66666666666667e-01 +521 515 -2.50000000000000e-01 +521 67 8.33333333333333e-02 +521 169 -8.33333333333333e-02 +521 562 -1.66666666666667e-01 +521 533 -2.50000000000000e-01 +521 179 -7.50000000000000e-01 +521 532 -8.33333333333333e-02 +521 76 8.33333333333333e-02 +521 519 -3.33333333333333e-01 +521 531 1.66666666666667e-01 +521 177 1.66666666666667e-01 +522 522 1.25000000000000e+00 +522 545 8.33333333333333e-02 +522 544 -1.66666666666667e-01 +522 515 8.33333333333333e-02 +522 514 -4.16666666666667e-02 +522 67 4.16666666666667e-02 +522 513 -1.25000000000000e-01 +522 542 8.33333333333333e-02 +522 118 4.16666666666667e-02 +522 540 -3.75000000000000e-01 +522 530 -8.33333333333333e-02 +522 524 -1.66666666666667e-01 +522 256 -4.16666666666667e-02 +522 659 -8.33333333333333e-02 +522 263 8.33333333333333e-02 +522 658 -8.33333333333333e-02 +522 262 8.33333333333333e-02 +522 257 8.33333333333333e-02 +522 119 -8.33333333333333e-02 +522 255 -1.25000000000000e-01 +522 251 8.33333333333333e-02 +522 68 -8.33333333333333e-02 +522 250 8.33333333333333e-02 +522 523 -1.66666666666667e-01 +522 529 1.66666666666667e-01 +522 249 -3.75000000000000e-01 +522 541 8.33333333333333e-02 +522 528 -2.50000000000000e-01 +523 523 1.25000000000000e+00 +523 540 8.33333333333333e-02 +523 545 8.33333333333333e-02 +523 543 -1.66666666666667e-01 +523 515 8.33333333333333e-02 +523 524 -1.66666666666667e-01 +523 514 -1.25000000000000e-01 +523 513 -4.16666666666667e-02 +523 66 4.16666666666667e-02 +523 541 -1.25000000000000e-01 +523 117 4.16666666666667e-02 +523 255 -4.16666666666667e-02 +523 257 8.33333333333333e-02 +523 530 1.66666666666667e-01 +523 263 -1.66666666666667e-01 +523 657 -8.33333333333333e-02 +523 261 8.33333333333333e-02 +523 119 4.16666666666667e-02 +523 659 -8.33333333333333e-02 +523 256 -1.25000000000000e-01 +523 251 -4.16666666666667e-02 +523 68 4.16666666666667e-02 +523 250 -1.25000000000000e-01 +523 542 -4.16666666666667e-02 +523 529 -7.50000000000000e-01 +523 249 8.33333333333333e-02 +523 522 -1.66666666666667e-01 +523 528 1.66666666666667e-01 +524 524 1.25000000000000e+00 +524 543 8.33333333333333e-02 +524 544 8.33333333333333e-02 +524 515 -3.75000000000000e-01 +524 514 8.33333333333333e-02 +524 523 -1.66666666666667e-01 +524 513 8.33333333333333e-02 +524 542 -1.25000000000000e-01 +524 540 8.33333333333333e-02 +524 528 -8.33333333333333e-02 +524 522 -1.66666666666667e-01 +524 256 8.33333333333333e-02 +524 657 -8.33333333333333e-02 +524 261 8.33333333333333e-02 +524 529 1.66666666666667e-01 +524 262 -1.66666666666667e-01 +524 257 -3.75000000000000e-01 +524 118 4.16666666666667e-02 +524 658 -8.33333333333333e-02 +524 255 8.33333333333333e-02 +524 117 -8.33333333333333e-02 +524 251 -1.25000000000000e-01 +524 541 -4.16666666666667e-02 +524 530 -2.50000000000000e-01 +524 250 -4.16666666666667e-02 +524 67 4.16666666666667e-02 +524 249 8.33333333333333e-02 +524 66 -8.33333333333333e-02 +525 525 2.50000000000000e+00 +525 562 -1.66666666666667e-01 +525 530 1.66666666666667e-01 +525 263 -1.66666666666667e-01 +525 664 -8.33333333333333e-02 +525 262 8.33333333333333e-02 +525 665 -8.33333333333333e-02 +525 529 1.66666666666667e-01 +525 528 -7.50000000000000e-01 +525 518 1.66666666666667e-01 +525 517 -8.33333333333333e-02 +525 413 -1.66666666666667e-01 +525 412 8.33333333333333e-02 +525 122 8.33333333333333e-02 +525 560 -8.33333333333333e-02 +525 559 1.66666666666667e-01 +525 526 -3.33333333333333e-01 +525 558 -2.50000000000000e-01 +525 68 8.33333333333333e-02 +525 516 -2.50000000000000e-01 +525 251 -8.33333333333333e-02 +525 250 1.66666666666667e-01 +525 410 -8.33333333333333e-02 +525 248 8.33333333333333e-02 +525 421 1.66666666666667e-01 +525 247 -1.66666666666667e-01 +525 67 8.33333333333333e-02 +525 409 -8.33333333333333e-02 +525 249 -2.50000000000000e-01 +525 527 -3.33333333333333e-01 +525 260 1.66666666666667e-01 +525 422 1.66666666666667e-01 +525 259 -8.33333333333333e-02 +525 121 8.33333333333333e-02 +525 563 8.33333333333333e-02 +525 258 -2.50000000000000e-01 +525 420 -7.50000000000000e-01 +526 526 2.50000000000000e+00 +526 561 -1.66666666666667e-01 +526 530 -8.33333333333333e-02 +526 665 -8.33333333333333e-02 +526 263 8.33333333333333e-02 +526 663 -8.33333333333333e-02 +526 261 8.33333333333333e-02 +526 529 -2.50000000000000e-01 +526 528 1.66666666666667e-01 +526 516 -8.33333333333333e-02 +526 413 8.33333333333333e-02 +526 411 8.33333333333333e-02 +526 560 1.66666666666667e-01 +526 559 -7.50000000000000e-01 +526 558 1.66666666666667e-01 +526 525 -3.33333333333333e-01 +526 518 1.66666666666667e-01 +526 517 -2.50000000000000e-01 +526 422 -8.33333333333333e-02 +526 527 -3.33333333333333e-01 +526 410 -8.33333333333333e-02 +526 248 8.33333333333333e-02 +526 249 1.66666666666667e-01 +526 420 1.66666666666667e-01 +526 246 -1.66666666666667e-01 +526 68 -1.66666666666667e-01 +526 251 1.66666666666667e-01 +526 250 -7.50000000000000e-01 +526 66 8.33333333333333e-02 +526 408 -8.33333333333333e-02 +526 260 1.66666666666667e-01 +526 122 -1.66666666666667e-01 +526 563 8.33333333333333e-02 +526 259 -2.50000000000000e-01 +526 421 -2.50000000000000e-01 +526 258 -8.33333333333333e-02 +526 120 8.33333333333333e-02 +527 527 2.50000000000000e+00 +527 561 8.33333333333333e-02 +527 529 -8.33333333333333e-02 +527 664 -8.33333333333333e-02 +527 262 8.33333333333333e-02 +527 528 1.66666666666667e-01 +527 261 -1.66666666666667e-01 +527 663 -8.33333333333333e-02 +527 530 -2.50000000000000e-01 +527 516 1.66666666666667e-01 +527 412 8.33333333333333e-02 +527 411 -1.66666666666667e-01 +527 560 -2.50000000000000e-01 +527 559 1.66666666666667e-01 +527 120 8.33333333333333e-02 +527 558 -8.33333333333333e-02 +527 518 -7.50000000000000e-01 +527 517 1.66666666666667e-01 +527 66 8.33333333333333e-02 +527 421 -8.33333333333333e-02 +527 526 -3.33333333333333e-01 +527 249 -8.33333333333333e-02 +527 409 -8.33333333333333e-02 +527 247 8.33333333333333e-02 +527 408 -8.33333333333333e-02 +527 246 8.33333333333333e-02 +527 251 -2.50000000000000e-01 +527 67 -1.66666666666667e-01 +527 250 1.66666666666667e-01 +527 562 8.33333333333333e-02 +527 260 -7.50000000000000e-01 +527 422 -2.50000000000000e-01 +527 259 1.66666666666667e-01 +527 121 -1.66666666666667e-01 +527 525 -3.33333333333333e-01 +527 258 1.66666666666667e-01 +527 420 1.66666666666667e-01 +528 528 2.50000000000000e+00 +528 562 1.66666666666667e-01 +528 518 -1.66666666666667e-01 +528 517 8.33333333333333e-02 +528 561 -2.50000000000000e-01 +528 527 1.66666666666667e-01 +528 664 8.33333333333333e-02 +528 526 1.66666666666667e-01 +528 525 -7.50000000000000e-01 +528 665 8.33333333333333e-02 +528 520 -8.33333333333333e-02 +528 521 1.66666666666667e-01 +528 530 -3.33333333333333e-01 +528 68 -8.33333333333333e-02 +528 519 -2.50000000000000e-01 +528 578 8.33333333333333e-02 +528 125 -8.33333333333333e-02 +528 577 -1.66666666666667e-01 +528 515 8.33333333333333e-02 +528 529 -3.33333333333333e-01 +528 544 1.66666666666667e-01 +528 514 8.33333333333333e-02 +528 67 -8.33333333333333e-02 +528 545 1.66666666666667e-01 +528 124 -8.33333333333333e-02 +528 543 -7.50000000000000e-01 +528 524 -8.33333333333333e-02 +528 251 8.33333333333333e-02 +528 658 8.33333333333333e-02 +528 262 -8.33333333333333e-02 +528 250 -1.66666666666667e-01 +528 523 1.66666666666667e-01 +528 522 -2.50000000000000e-01 +528 263 1.66666666666667e-01 +528 659 -1.66666666666667e-01 +528 261 -2.50000000000000e-01 +528 563 -8.33333333333333e-02 +529 529 2.50000000000000e+00 +529 561 1.66666666666667e-01 +529 516 8.33333333333333e-02 +529 563 1.66666666666667e-01 +529 562 -7.50000000000000e-01 +529 527 -8.33333333333333e-02 +529 663 8.33333333333333e-02 +529 526 -2.50000000000000e-01 +529 525 1.66666666666667e-01 +529 665 -1.66666666666667e-01 +529 519 -8.33333333333333e-02 +529 578 8.33333333333333e-02 +529 521 1.66666666666667e-01 +529 520 -2.50000000000000e-01 +529 576 -1.66666666666667e-01 +529 545 -8.33333333333333e-02 +529 528 -3.33333333333333e-01 +529 543 1.66666666666667e-01 +529 515 -1.66666666666667e-01 +529 513 8.33333333333333e-02 +529 66 -8.33333333333333e-02 +529 544 -2.50000000000000e-01 +529 123 -8.33333333333333e-02 +529 524 1.66666666666667e-01 +529 530 -3.33333333333333e-01 +529 263 1.66666666666667e-01 +529 657 8.33333333333333e-02 +529 261 -8.33333333333333e-02 +529 251 8.33333333333333e-02 +529 68 -8.33333333333333e-02 +529 523 -7.50000000000000e-01 +529 249 -1.66666666666667e-01 +529 522 1.66666666666667e-01 +529 659 8.33333333333333e-02 +529 125 -8.33333333333333e-02 +529 262 -2.50000000000000e-01 +529 518 8.33333333333333e-02 +530 530 2.50000000000000e+00 +530 561 -8.33333333333333e-02 +530 516 -1.66666666666667e-01 +530 563 -2.50000000000000e-01 +530 562 1.66666666666667e-01 +530 526 -8.33333333333333e-02 +530 525 1.66666666666667e-01 +530 527 -2.50000000000000e-01 +530 664 -1.66666666666667e-01 +530 663 8.33333333333333e-02 +530 577 8.33333333333333e-02 +530 519 1.66666666666667e-01 +530 528 -3.33333333333333e-01 +530 521 -7.50000000000000e-01 +530 520 1.66666666666667e-01 +530 66 -8.33333333333333e-02 +530 576 8.33333333333333e-02 +530 123 -8.33333333333333e-02 +530 513 8.33333333333333e-02 +530 544 -8.33333333333333e-02 +530 514 -1.66666666666667e-01 +530 545 -2.50000000000000e-01 +530 543 1.66666666666667e-01 +530 522 -8.33333333333333e-02 +530 249 8.33333333333333e-02 +530 523 1.66666666666667e-01 +530 529 -3.33333333333333e-01 +530 262 1.66666666666667e-01 +530 524 -2.50000000000000e-01 +530 250 8.33333333333333e-02 +530 67 -8.33333333333333e-02 +530 263 -7.50000000000000e-01 +530 517 8.33333333333333e-02 +530 658 8.33333333333333e-02 +530 124 -8.33333333333333e-02 +530 261 1.66666666666667e-01 +530 657 -1.66666666666667e-01 +531 531 2.50000000000000e+00 +531 569 8.33333333333333e-02 +531 568 -1.66666666666667e-01 +531 538 1.66666666666667e-01 +531 537 -7.50000000000000e-01 +531 464 8.33333333333333e-02 +531 463 8.33333333333333e-02 +531 467 1.66666666666667e-01 +531 466 -8.33333333333333e-02 +531 465 -2.50000000000000e-01 +531 533 -3.33333333333333e-01 +531 71 -8.33333333333333e-02 +531 77 -8.33333333333333e-02 +531 581 -8.33333333333333e-02 +531 578 8.33333333333333e-02 +531 548 -1.66666666666667e-01 +531 545 1.66666666666667e-01 +531 547 8.33333333333333e-02 +531 544 -8.33333333333333e-02 +531 543 -2.50000000000000e-01 +531 580 -8.33333333333333e-02 +531 577 8.33333333333333e-02 +531 173 -8.33333333333333e-02 +531 515 8.33333333333333e-02 +531 172 -8.33333333333333e-02 +531 178 8.33333333333333e-02 +531 514 -1.66666666666667e-01 +531 70 1.66666666666667e-01 +531 69 -2.50000000000000e-01 +531 521 1.66666666666667e-01 +531 179 -1.66666666666667e-01 +531 520 1.66666666666667e-01 +531 532 -3.33333333333333e-01 +531 76 1.66666666666667e-01 +531 519 -7.50000000000000e-01 +531 539 1.66666666666667e-01 +531 75 -2.50000000000000e-01 +532 532 2.50000000000000e+00 +532 539 -8.33333333333333e-02 +532 567 -1.66666666666667e-01 +532 538 -2.50000000000000e-01 +532 537 1.66666666666667e-01 +532 464 -1.66666666666667e-01 +532 462 8.33333333333333e-02 +532 467 1.66666666666667e-01 +532 466 -2.50000000000000e-01 +532 465 -8.33333333333333e-02 +532 581 -8.33333333333333e-02 +532 548 8.33333333333333e-02 +532 71 1.66666666666667e-01 +532 533 -3.33333333333333e-01 +532 545 1.66666666666667e-01 +532 544 -2.50000000000000e-01 +532 546 8.33333333333333e-02 +532 543 -8.33333333333333e-02 +532 77 1.66666666666667e-01 +532 578 -1.66666666666667e-01 +532 579 -8.33333333333333e-02 +532 576 8.33333333333333e-02 +532 171 -8.33333333333333e-02 +532 177 8.33333333333333e-02 +532 515 8.33333333333333e-02 +532 173 -8.33333333333333e-02 +532 70 -7.50000000000000e-01 +532 513 -1.66666666666667e-01 +532 69 1.66666666666667e-01 +532 521 -8.33333333333333e-02 +532 179 8.33333333333333e-02 +532 520 -2.50000000000000e-01 +532 569 8.33333333333333e-02 +532 76 -7.50000000000000e-01 +532 519 1.66666666666667e-01 +532 531 -3.33333333333333e-01 +532 75 1.66666666666667e-01 +533 533 2.50000000000000e+00 +533 538 -8.33333333333333e-02 +533 537 1.66666666666667e-01 +533 567 8.33333333333333e-02 +533 539 -2.50000000000000e-01 +533 462 8.33333333333333e-02 +533 463 -1.66666666666667e-01 +533 467 -7.50000000000000e-01 +533 466 1.66666666666667e-01 +533 465 1.66666666666667e-01 +533 531 -3.33333333333333e-01 +533 69 -8.33333333333333e-02 +533 75 -8.33333333333333e-02 +533 579 -8.33333333333333e-02 +533 576 8.33333333333333e-02 +533 580 -8.33333333333333e-02 +533 547 8.33333333333333e-02 +533 545 -7.50000000000000e-01 +533 70 1.66666666666667e-01 +533 532 -3.33333333333333e-01 +533 544 1.66666666666667e-01 +533 546 -1.66666666666667e-01 +533 543 1.66666666666667e-01 +533 76 1.66666666666667e-01 +533 577 -1.66666666666667e-01 +533 171 -8.33333333333333e-02 +533 513 8.33333333333333e-02 +533 71 -2.50000000000000e-01 +533 514 8.33333333333333e-02 +533 172 -8.33333333333333e-02 +533 521 -2.50000000000000e-01 +533 568 8.33333333333333e-02 +533 77 -2.50000000000000e-01 +533 520 -8.33333333333333e-02 +533 178 8.33333333333333e-02 +533 519 1.66666666666667e-01 +533 177 -1.66666666666667e-01 +534 534 1.25000000000000e+00 +534 539 -8.33333333333333e-02 +534 472 -4.16666666666667e-02 +534 463 4.16666666666667e-02 +534 473 8.33333333333333e-02 +534 82 8.33333333333333e-02 +534 592 -1.66666666666667e-01 +534 471 -1.25000000000000e-01 +534 464 -8.33333333333333e-02 +534 535 -1.66666666666667e-01 +534 538 1.66666666666667e-01 +534 70 8.33333333333333e-02 +534 537 -2.50000000000000e-01 +534 596 -8.33333333333333e-02 +534 548 8.33333333333333e-02 +534 83 8.33333333333333e-02 +534 269 -8.33333333333333e-02 +534 268 4.16666666666667e-02 +534 595 -8.33333333333333e-02 +534 81 -3.75000000000000e-01 +534 536 -1.66666666666667e-01 +534 266 8.33333333333333e-02 +534 71 8.33333333333333e-02 +534 265 -4.16666666666667e-02 +534 547 8.33333333333333e-02 +534 593 8.33333333333333e-02 +534 264 -1.25000000000000e-01 +534 69 -3.75000000000000e-01 +535 535 1.25000000000000e+00 +535 473 8.33333333333333e-02 +535 539 1.66666666666667e-01 +535 471 -4.16666666666667e-02 +535 462 4.16666666666667e-02 +535 83 -4.16666666666667e-02 +535 593 8.33333333333333e-02 +535 472 -1.25000000000000e-01 +535 81 8.33333333333333e-02 +535 591 -1.66666666666667e-01 +535 464 4.16666666666667e-02 +535 71 -4.16666666666667e-02 +535 538 -7.50000000000000e-01 +535 534 -1.66666666666667e-01 +535 537 1.66666666666667e-01 +535 69 8.33333333333333e-02 +535 269 4.16666666666667e-02 +535 596 -8.33333333333333e-02 +535 82 -1.25000000000000e-01 +535 267 4.16666666666667e-02 +535 594 -8.33333333333333e-02 +535 266 8.33333333333333e-02 +535 548 -1.66666666666667e-01 +535 536 -1.66666666666667e-01 +535 265 -1.25000000000000e-01 +535 70 -1.25000000000000e-01 +535 264 -4.16666666666667e-02 +535 546 8.33333333333333e-02 +536 536 1.25000000000000e+00 +536 537 -8.33333333333333e-02 +536 535 -1.66666666666667e-01 +536 472 8.33333333333333e-02 +536 538 1.66666666666667e-01 +536 473 -3.75000000000000e-01 +536 82 -4.16666666666667e-02 +536 592 8.33333333333333e-02 +536 471 8.33333333333333e-02 +536 539 -2.50000000000000e-01 +536 463 4.16666666666667e-02 +536 70 -4.16666666666667e-02 +536 462 -8.33333333333333e-02 +536 268 4.16666666666667e-02 +536 595 -8.33333333333333e-02 +536 594 -8.33333333333333e-02 +536 546 8.33333333333333e-02 +536 83 -1.25000000000000e-01 +536 81 8.33333333333333e-02 +536 267 -8.33333333333333e-02 +536 591 8.33333333333333e-02 +536 266 -3.75000000000000e-01 +536 71 -1.25000000000000e-01 +536 265 8.33333333333333e-02 +536 547 -1.66666666666667e-01 +536 534 -1.66666666666667e-01 +536 264 8.33333333333333e-02 +536 69 8.33333333333333e-02 +537 537 2.50000000000000e+00 +537 580 8.33333333333333e-02 +537 601 -8.33333333333333e-02 +537 548 1.66666666666667e-01 +537 596 -1.66666666666667e-01 +537 547 -8.33333333333333e-02 +537 595 8.33333333333333e-02 +537 602 -8.33333333333333e-02 +537 546 -2.50000000000000e-01 +537 473 8.33333333333333e-02 +537 536 -8.33333333333333e-02 +537 472 8.33333333333333e-02 +537 593 1.66666666666667e-01 +537 539 -3.33333333333333e-01 +537 592 1.66666666666667e-01 +537 591 -7.50000000000000e-01 +537 535 1.66666666666667e-01 +537 534 -2.50000000000000e-01 +537 538 -3.33333333333333e-01 +537 475 -8.33333333333333e-02 +537 476 1.66666666666667e-01 +537 467 -1.66666666666667e-01 +537 533 1.66666666666667e-01 +537 463 -8.33333333333333e-02 +537 466 8.33333333333333e-02 +537 86 8.33333333333333e-02 +537 569 -8.33333333333333e-02 +537 85 -1.66666666666667e-01 +537 568 1.66666666666667e-01 +537 474 -2.50000000000000e-01 +537 567 -2.50000000000000e-01 +537 464 -8.33333333333333e-02 +537 71 8.33333333333333e-02 +537 532 1.66666666666667e-01 +537 70 -1.66666666666667e-01 +537 581 8.33333333333333e-02 +537 531 -7.50000000000000e-01 +538 538 2.50000000000000e+00 +538 579 8.33333333333333e-02 +538 600 -8.33333333333333e-02 +538 602 -8.33333333333333e-02 +538 596 8.33333333333333e-02 +538 546 -8.33333333333333e-02 +538 594 8.33333333333333e-02 +538 548 1.66666666666667e-01 +538 547 -2.50000000000000e-01 +538 536 1.66666666666667e-01 +538 473 -1.66666666666667e-01 +538 471 8.33333333333333e-02 +538 593 -8.33333333333333e-02 +538 86 8.33333333333333e-02 +538 592 -2.50000000000000e-01 +538 591 1.66666666666667e-01 +538 71 8.33333333333333e-02 +538 535 -7.50000000000000e-01 +538 534 1.66666666666667e-01 +538 533 -8.33333333333333e-02 +538 537 -3.33333333333333e-01 +538 474 -8.33333333333333e-02 +538 467 8.33333333333333e-02 +538 464 -8.33333333333333e-02 +538 462 -8.33333333333333e-02 +538 465 8.33333333333333e-02 +538 476 1.66666666666667e-01 +538 569 1.66666666666667e-01 +538 539 -3.33333333333333e-01 +538 475 -2.50000000000000e-01 +538 568 -7.50000000000000e-01 +538 84 -1.66666666666667e-01 +538 567 1.66666666666667e-01 +538 581 -1.66666666666667e-01 +538 532 -2.50000000000000e-01 +538 531 1.66666666666667e-01 +538 69 -1.66666666666667e-01 +539 539 2.50000000000000e+00 +539 580 -1.66666666666667e-01 +539 601 -8.33333333333333e-02 +539 595 8.33333333333333e-02 +539 546 1.66666666666667e-01 +539 594 -1.66666666666667e-01 +539 600 -8.33333333333333e-02 +539 548 -7.50000000000000e-01 +539 547 1.66666666666667e-01 +539 471 8.33333333333333e-02 +539 534 -8.33333333333333e-02 +539 535 1.66666666666667e-01 +539 472 -1.66666666666667e-01 +539 593 -2.50000000000000e-01 +539 592 -8.33333333333333e-02 +539 85 8.33333333333333e-02 +539 591 1.66666666666667e-01 +539 537 -3.33333333333333e-01 +539 536 -2.50000000000000e-01 +539 70 8.33333333333333e-02 +539 532 -8.33333333333333e-02 +539 466 8.33333333333333e-02 +539 463 -8.33333333333333e-02 +539 474 1.66666666666667e-01 +539 465 -1.66666666666667e-01 +539 531 1.66666666666667e-01 +539 476 -7.50000000000000e-01 +539 569 -2.50000000000000e-01 +539 475 1.66666666666667e-01 +539 568 1.66666666666667e-01 +539 538 -3.33333333333333e-01 +539 84 8.33333333333333e-02 +539 567 -8.33333333333333e-02 +539 579 8.33333333333333e-02 +539 533 -2.50000000000000e-01 +539 462 -8.33333333333333e-02 +539 69 8.33333333333333e-02 +540 540 1.25000000000000e+00 +540 541 -1.66666666666667e-01 +540 515 -8.33333333333333e-02 +540 70 -4.16666666666667e-02 +540 514 4.16666666666667e-02 +540 524 8.33333333333333e-02 +540 118 -4.16666666666667e-02 +540 522 -3.75000000000000e-01 +540 658 8.33333333333333e-02 +540 545 -8.33333333333333e-02 +540 544 1.66666666666667e-01 +540 543 -2.50000000000000e-01 +540 659 8.33333333333333e-02 +540 548 8.33333333333333e-02 +540 662 -8.33333333333333e-02 +540 271 4.16666666666667e-02 +540 661 -8.33333333333333e-02 +540 119 8.33333333333333e-02 +540 272 -8.33333333333333e-02 +540 117 -1.25000000000000e-01 +540 542 -1.66666666666667e-01 +540 266 8.33333333333333e-02 +540 71 8.33333333333333e-02 +540 265 8.33333333333333e-02 +540 547 -1.66666666666667e-01 +540 523 8.33333333333333e-02 +540 264 -3.75000000000000e-01 +540 69 -1.25000000000000e-01 +541 541 1.25000000000000e+00 +541 515 4.16666666666667e-02 +541 522 8.33333333333333e-02 +541 540 -1.66666666666667e-01 +541 69 -4.16666666666667e-02 +541 513 4.16666666666667e-02 +541 523 -1.25000000000000e-01 +541 117 -4.16666666666667e-02 +541 657 8.33333333333333e-02 +541 71 8.33333333333333e-02 +541 542 -1.66666666666667e-01 +541 545 1.66666666666667e-01 +541 544 -7.50000000000000e-01 +541 543 1.66666666666667e-01 +541 119 8.33333333333333e-02 +541 659 -1.66666666666667e-01 +541 270 4.16666666666667e-02 +541 660 -8.33333333333333e-02 +541 272 4.16666666666667e-02 +541 662 -8.33333333333333e-02 +541 118 -1.25000000000000e-01 +541 266 -4.16666666666667e-02 +541 548 8.33333333333333e-02 +541 524 -4.16666666666667e-02 +541 265 -1.25000000000000e-01 +541 70 -1.25000000000000e-01 +541 264 8.33333333333333e-02 +541 546 -1.66666666666667e-01 +542 542 1.25000000000000e+00 +542 514 4.16666666666667e-02 +542 513 -8.33333333333333e-02 +542 524 -1.25000000000000e-01 +542 522 8.33333333333333e-02 +542 545 -2.50000000000000e-01 +542 70 8.33333333333333e-02 +542 541 -1.66666666666667e-01 +542 544 1.66666666666667e-01 +542 543 -8.33333333333333e-02 +542 118 8.33333333333333e-02 +542 658 -1.66666666666667e-01 +542 657 8.33333333333333e-02 +542 546 8.33333333333333e-02 +542 660 -8.33333333333333e-02 +542 119 -3.75000000000000e-01 +542 271 4.16666666666667e-02 +542 661 -8.33333333333333e-02 +542 117 8.33333333333333e-02 +542 270 -8.33333333333333e-02 +542 523 -4.16666666666667e-02 +542 266 -1.25000000000000e-01 +542 71 -3.75000000000000e-01 +542 265 -4.16666666666667e-02 +542 547 8.33333333333333e-02 +542 540 -1.66666666666667e-01 +542 264 8.33333333333333e-02 +542 69 8.33333333333333e-02 +543 543 2.50000000000000e+00 +543 521 -1.66666666666667e-01 +543 524 8.33333333333333e-02 +543 515 -8.33333333333333e-02 +543 523 -1.66666666666667e-01 +543 529 1.66666666666667e-01 +543 514 -8.33333333333333e-02 +543 530 1.66666666666667e-01 +543 528 -7.50000000000000e-01 +543 661 8.33333333333333e-02 +543 658 -8.33333333333333e-02 +543 662 -1.66666666666667e-01 +543 659 1.66666666666667e-01 +543 71 8.33333333333333e-02 +543 542 -8.33333333333333e-02 +543 541 1.66666666666667e-01 +543 544 -3.33333333333333e-01 +543 540 -2.50000000000000e-01 +543 125 8.33333333333333e-02 +543 657 -2.50000000000000e-01 +543 578 -8.33333333333333e-02 +543 581 8.33333333333333e-02 +543 671 -8.33333333333333e-02 +543 547 1.66666666666667e-01 +543 580 -1.66666666666667e-01 +543 577 1.66666666666667e-01 +543 548 1.66666666666667e-01 +543 533 1.66666666666667e-01 +543 545 -3.33333333333333e-01 +543 70 8.33333333333333e-02 +543 532 -8.33333333333333e-02 +543 546 -7.50000000000000e-01 +543 531 -2.50000000000000e-01 +543 670 -8.33333333333333e-02 +543 124 8.33333333333333e-02 +543 520 8.33333333333333e-02 +543 576 -2.50000000000000e-01 +544 544 2.50000000000000e+00 +544 521 8.33333333333333e-02 +544 515 -8.33333333333333e-02 +544 524 8.33333333333333e-02 +544 530 -8.33333333333333e-02 +544 522 -1.66666666666667e-01 +544 528 1.66666666666667e-01 +544 513 -8.33333333333333e-02 +544 529 -2.50000000000000e-01 +544 660 8.33333333333333e-02 +544 657 -8.33333333333333e-02 +544 662 8.33333333333333e-02 +544 542 1.66666666666667e-01 +544 541 -7.50000000000000e-01 +544 540 1.66666666666667e-01 +544 543 -3.33333333333333e-01 +544 659 1.66666666666667e-01 +544 658 -2.50000000000000e-01 +544 545 -3.33333333333333e-01 +544 548 -8.33333333333333e-02 +544 546 1.66666666666667e-01 +544 581 8.33333333333333e-02 +544 671 -8.33333333333333e-02 +544 579 -1.66666666666667e-01 +544 576 1.66666666666667e-01 +544 71 -1.66666666666667e-01 +544 533 1.66666666666667e-01 +544 547 -2.50000000000000e-01 +544 532 -2.50000000000000e-01 +544 69 8.33333333333333e-02 +544 531 -8.33333333333333e-02 +544 578 1.66666666666667e-01 +544 125 -1.66666666666667e-01 +544 519 8.33333333333333e-02 +544 577 -7.50000000000000e-01 +544 669 -8.33333333333333e-02 +544 123 8.33333333333333e-02 +545 545 2.50000000000000e+00 +545 519 -1.66666666666667e-01 +545 514 -8.33333333333333e-02 +545 522 8.33333333333333e-02 +545 513 -8.33333333333333e-02 +545 523 8.33333333333333e-02 +545 529 -8.33333333333333e-02 +545 530 -2.50000000000000e-01 +545 528 1.66666666666667e-01 +545 661 8.33333333333333e-02 +545 660 -1.66666666666667e-01 +545 657 1.66666666666667e-01 +545 542 -2.50000000000000e-01 +545 541 1.66666666666667e-01 +545 69 8.33333333333333e-02 +545 540 -8.33333333333333e-02 +545 659 -7.50000000000000e-01 +545 658 1.66666666666667e-01 +545 123 8.33333333333333e-02 +545 544 -3.33333333333333e-01 +545 576 -8.33333333333333e-02 +545 547 -8.33333333333333e-02 +545 579 8.33333333333333e-02 +545 669 -8.33333333333333e-02 +545 580 8.33333333333333e-02 +545 670 -8.33333333333333e-02 +545 548 -2.50000000000000e-01 +545 533 -7.50000000000000e-01 +545 70 -1.66666666666667e-01 +545 532 1.66666666666667e-01 +545 546 1.66666666666667e-01 +545 531 1.66666666666667e-01 +545 543 -3.33333333333333e-01 +545 520 8.33333333333333e-02 +545 578 -2.50000000000000e-01 +545 577 1.66666666666667e-01 +545 124 -1.66666666666667e-01 +546 546 2.50000000000000e+00 +546 538 -8.33333333333333e-02 +546 602 8.33333333333333e-02 +546 601 -1.66666666666667e-01 +546 537 -2.50000000000000e-01 +546 536 8.33333333333333e-02 +546 595 1.66666666666667e-01 +546 596 1.66666666666667e-01 +546 594 -7.50000000000000e-01 +546 535 8.33333333333333e-02 +546 548 -3.33333333333333e-01 +546 71 -8.33333333333333e-02 +546 128 -8.33333333333333e-02 +546 581 -8.33333333333333e-02 +546 671 8.33333333333333e-02 +546 580 1.66666666666667e-01 +546 547 -3.33333333333333e-01 +546 544 1.66666666666667e-01 +546 533 -1.66666666666667e-01 +546 545 1.66666666666667e-01 +546 70 -8.33333333333333e-02 +546 532 8.33333333333333e-02 +546 543 -7.50000000000000e-01 +546 127 -8.33333333333333e-02 +546 670 8.33333333333333e-02 +546 579 -2.50000000000000e-01 +546 266 -8.33333333333333e-02 +546 542 8.33333333333333e-02 +546 274 8.33333333333333e-02 +546 661 -8.33333333333333e-02 +546 541 -1.66666666666667e-01 +546 265 1.66666666666667e-01 +546 264 -2.50000000000000e-01 +546 662 1.66666666666667e-01 +546 275 -1.66666666666667e-01 +546 660 -2.50000000000000e-01 +546 539 1.66666666666667e-01 +547 547 2.50000000000000e+00 +547 537 -8.33333333333333e-02 +547 600 -1.66666666666667e-01 +547 539 1.66666666666667e-01 +547 538 -2.50000000000000e-01 +547 596 -8.33333333333333e-02 +547 594 1.66666666666667e-01 +547 595 -2.50000000000000e-01 +547 536 -1.66666666666667e-01 +547 534 8.33333333333333e-02 +547 533 8.33333333333333e-02 +547 545 -8.33333333333333e-02 +547 579 1.66666666666667e-01 +547 546 -3.33333333333333e-01 +547 543 1.66666666666667e-01 +547 544 -2.50000000000000e-01 +547 69 -8.33333333333333e-02 +547 531 8.33333333333333e-02 +547 581 1.66666666666667e-01 +547 671 -1.66666666666667e-01 +547 580 -7.50000000000000e-01 +547 126 -8.33333333333333e-02 +547 669 8.33333333333333e-02 +547 266 1.66666666666667e-01 +547 548 -3.33333333333333e-01 +547 662 1.66666666666667e-01 +547 273 8.33333333333333e-02 +547 660 -8.33333333333333e-02 +547 542 8.33333333333333e-02 +547 71 -8.33333333333333e-02 +547 265 -7.50000000000000e-01 +547 540 -1.66666666666667e-01 +547 264 1.66666666666667e-01 +547 275 8.33333333333333e-02 +547 128 -8.33333333333333e-02 +547 661 -2.50000000000000e-01 +547 602 8.33333333333333e-02 +548 548 2.50000000000000e+00 +548 537 1.66666666666667e-01 +548 600 8.33333333333333e-02 +548 539 -7.50000000000000e-01 +548 538 1.66666666666667e-01 +548 595 -8.33333333333333e-02 +548 534 8.33333333333333e-02 +548 596 -2.50000000000000e-01 +548 594 1.66666666666667e-01 +548 535 -1.66666666666667e-01 +548 546 -3.33333333333333e-01 +548 69 -8.33333333333333e-02 +548 126 -8.33333333333333e-02 +548 532 8.33333333333333e-02 +548 544 -8.33333333333333e-02 +548 579 -8.33333333333333e-02 +548 669 8.33333333333333e-02 +548 545 -2.50000000000000e-01 +548 531 -1.66666666666667e-01 +548 543 1.66666666666667e-01 +548 581 -2.50000000000000e-01 +548 580 1.66666666666667e-01 +548 670 -1.66666666666667e-01 +548 264 -8.33333333333333e-02 +548 540 8.33333333333333e-02 +548 265 1.66666666666667e-01 +548 547 -3.33333333333333e-01 +548 661 1.66666666666667e-01 +548 266 -2.50000000000000e-01 +548 541 8.33333333333333e-02 +548 70 -8.33333333333333e-02 +548 662 -7.50000000000000e-01 +548 601 8.33333333333333e-02 +548 274 8.33333333333333e-02 +548 127 -8.33333333333333e-02 +548 660 1.66666666666667e-01 +548 273 -1.66666666666667e-01 +549 549 2.50000000000000e+00 +549 557 -8.33333333333333e-02 +549 571 -1.66666666666667e-01 +549 556 1.66666666666667e-01 +549 555 -2.50000000000000e-01 +549 482 -1.66666666666667e-01 +549 481 8.33333333333333e-02 +549 485 1.66666666666667e-01 +549 484 -8.33333333333333e-02 +549 483 -2.50000000000000e-01 +549 584 -8.33333333333333e-02 +549 566 8.33333333333333e-02 +549 74 1.66666666666667e-01 +549 551 -3.33333333333333e-01 +549 563 1.66666666666667e-01 +549 565 8.33333333333333e-02 +549 562 -8.33333333333333e-02 +549 561 -2.50000000000000e-01 +549 77 1.66666666666667e-01 +549 578 -1.66666666666667e-01 +549 583 -8.33333333333333e-02 +549 577 8.33333333333333e-02 +549 175 -8.33333333333333e-02 +549 178 8.33333333333333e-02 +549 518 8.33333333333333e-02 +549 176 -8.33333333333333e-02 +549 73 1.66666666666667e-01 +549 517 -1.66666666666667e-01 +549 72 -7.50000000000000e-01 +549 521 -8.33333333333333e-02 +549 179 8.33333333333333e-02 +549 550 -3.33333333333333e-01 +549 520 1.66666666666667e-01 +549 76 1.66666666666667e-01 +549 572 8.33333333333333e-02 +549 519 -2.50000000000000e-01 +549 75 -7.50000000000000e-01 +550 550 2.50000000000000e+00 +550 572 8.33333333333333e-02 +550 570 -1.66666666666667e-01 +550 556 -7.50000000000000e-01 +550 555 1.66666666666667e-01 +550 482 8.33333333333333e-02 +550 480 8.33333333333333e-02 +550 485 1.66666666666667e-01 +550 484 -2.50000000000000e-01 +550 483 -8.33333333333333e-02 +550 551 -3.33333333333333e-01 +550 77 -8.33333333333333e-02 +550 74 -8.33333333333333e-02 +550 578 8.33333333333333e-02 +550 584 -8.33333333333333e-02 +550 566 -1.66666666666667e-01 +550 563 1.66666666666667e-01 +550 562 -2.50000000000000e-01 +550 564 8.33333333333333e-02 +550 561 -8.33333333333333e-02 +550 582 -8.33333333333333e-02 +550 576 8.33333333333333e-02 +550 518 8.33333333333333e-02 +550 176 -8.33333333333333e-02 +550 174 -8.33333333333333e-02 +550 177 8.33333333333333e-02 +550 73 -2.50000000000000e-01 +550 72 1.66666666666667e-01 +550 516 -1.66666666666667e-01 +550 521 1.66666666666667e-01 +550 179 -1.66666666666667e-01 +550 557 1.66666666666667e-01 +550 520 -7.50000000000000e-01 +550 76 -2.50000000000000e-01 +550 549 -3.33333333333333e-01 +550 519 1.66666666666667e-01 +550 75 1.66666666666667e-01 +551 551 2.50000000000000e+00 +551 555 -8.33333333333333e-02 +551 556 1.66666666666667e-01 +551 571 8.33333333333333e-02 +551 557 -2.50000000000000e-01 +551 481 8.33333333333333e-02 +551 480 -1.66666666666667e-01 +551 485 -7.50000000000000e-01 +551 484 1.66666666666667e-01 +551 483 1.66666666666667e-01 +551 550 -3.33333333333333e-01 +551 76 -8.33333333333333e-02 +551 73 -8.33333333333333e-02 +551 577 8.33333333333333e-02 +551 583 -8.33333333333333e-02 +551 582 -8.33333333333333e-02 +551 564 8.33333333333333e-02 +551 563 -7.50000000000000e-01 +551 565 -1.66666666666667e-01 +551 562 1.66666666666667e-01 +551 72 1.66666666666667e-01 +551 549 -3.33333333333333e-01 +551 561 1.66666666666667e-01 +551 75 1.66666666666667e-01 +551 576 -1.66666666666667e-01 +551 517 8.33333333333333e-02 +551 175 -8.33333333333333e-02 +551 74 -2.50000000000000e-01 +551 516 8.33333333333333e-02 +551 174 -8.33333333333333e-02 +551 570 8.33333333333333e-02 +551 521 -2.50000000000000e-01 +551 77 -2.50000000000000e-01 +551 520 1.66666666666667e-01 +551 178 -1.66666666666667e-01 +551 519 -8.33333333333333e-02 +551 177 8.33333333333333e-02 +552 552 2.50000000000000e+00 +552 629 8.33333333333333e-02 +552 628 -1.66666666666667e-01 +552 556 1.66666666666667e-01 +552 555 -7.50000000000000e-01 +552 632 -8.33333333333333e-02 +552 631 -8.33333333333333e-02 +552 566 -1.66666666666667e-01 +552 565 8.33333333333333e-02 +552 482 8.33333333333333e-02 +552 491 1.66666666666667e-01 +552 490 -8.33333333333333e-02 +552 489 -2.50000000000000e-01 +552 481 8.33333333333333e-02 +552 385 8.33333333333333e-02 +552 376 -8.33333333333333e-02 +552 377 -8.33333333333333e-02 +552 386 -1.66666666666667e-01 +552 449 1.66666666666667e-01 +552 554 -3.33333333333333e-01 +552 293 1.66666666666667e-01 +552 298 8.33333333333333e-02 +552 292 -8.33333333333333e-02 +552 74 -8.33333333333333e-02 +552 443 8.33333333333333e-02 +552 73 1.66666666666667e-01 +552 442 -1.66666666666667e-01 +552 72 -2.50000000000000e-01 +552 291 -2.50000000000000e-01 +552 101 -8.33333333333333e-02 +552 299 8.33333333333333e-02 +552 553 -3.33333333333333e-01 +552 100 1.66666666666667e-01 +552 448 1.66666666666667e-01 +552 557 1.66666666666667e-01 +552 99 -2.50000000000000e-01 +552 447 -7.50000000000000e-01 +553 553 2.50000000000000e+00 +553 557 -8.33333333333333e-02 +553 627 -1.66666666666667e-01 +553 556 -2.50000000000000e-01 +553 555 1.66666666666667e-01 +553 632 -8.33333333333333e-02 +553 566 8.33333333333333e-02 +553 630 -8.33333333333333e-02 +553 564 8.33333333333333e-02 +553 491 1.66666666666667e-01 +553 490 -2.50000000000000e-01 +553 489 -8.33333333333333e-02 +553 482 -1.66666666666667e-01 +553 480 8.33333333333333e-02 +553 384 8.33333333333333e-02 +553 375 -8.33333333333333e-02 +553 386 8.33333333333333e-02 +553 377 -8.33333333333333e-02 +553 449 -8.33333333333333e-02 +553 443 8.33333333333333e-02 +553 297 8.33333333333333e-02 +553 291 -8.33333333333333e-02 +553 74 1.66666666666667e-01 +553 554 -3.33333333333333e-01 +553 293 1.66666666666667e-01 +553 73 -7.50000000000000e-01 +553 292 -2.50000000000000e-01 +553 72 1.66666666666667e-01 +553 441 -1.66666666666667e-01 +553 101 1.66666666666667e-01 +553 299 -1.66666666666667e-01 +553 629 8.33333333333333e-02 +553 100 -7.50000000000000e-01 +553 448 -2.50000000000000e-01 +553 552 -3.33333333333333e-01 +553 99 1.66666666666667e-01 +553 447 1.66666666666667e-01 +554 554 2.50000000000000e+00 +554 556 -8.33333333333333e-02 +554 555 1.66666666666667e-01 +554 627 8.33333333333333e-02 +554 557 -2.50000000000000e-01 +554 630 -8.33333333333333e-02 +554 631 -8.33333333333333e-02 +554 565 8.33333333333333e-02 +554 564 -1.66666666666667e-01 +554 480 8.33333333333333e-02 +554 491 -7.50000000000000e-01 +554 490 1.66666666666667e-01 +554 489 1.66666666666667e-01 +554 481 -1.66666666666667e-01 +554 375 -8.33333333333333e-02 +554 385 8.33333333333333e-02 +554 384 -1.66666666666667e-01 +554 376 -8.33333333333333e-02 +554 448 -8.33333333333333e-02 +554 442 8.33333333333333e-02 +554 447 1.66666666666667e-01 +554 552 -3.33333333333333e-01 +554 291 1.66666666666667e-01 +554 74 -2.50000000000000e-01 +554 293 -7.50000000000000e-01 +554 73 1.66666666666667e-01 +554 553 -3.33333333333333e-01 +554 292 1.66666666666667e-01 +554 72 -8.33333333333333e-02 +554 441 8.33333333333333e-02 +554 628 8.33333333333333e-02 +554 101 -2.50000000000000e-01 +554 449 -2.50000000000000e-01 +554 100 1.66666666666667e-01 +554 298 -1.66666666666667e-01 +554 99 -8.33333333333333e-02 +554 297 8.33333333333333e-02 +555 555 2.50000000000000e+00 +555 583 8.33333333333333e-02 +555 637 -8.33333333333333e-02 +555 632 8.33333333333333e-02 +555 638 -8.33333333333333e-02 +555 631 8.33333333333333e-02 +555 565 -8.33333333333333e-02 +555 566 1.66666666666667e-01 +555 564 -2.50000000000000e-01 +555 491 -1.66666666666667e-01 +555 554 1.66666666666667e-01 +555 490 8.33333333333333e-02 +555 104 8.33333333333333e-02 +555 629 -8.33333333333333e-02 +555 628 1.66666666666667e-01 +555 627 -2.50000000000000e-01 +555 74 8.33333333333333e-02 +555 553 1.66666666666667e-01 +555 552 -7.50000000000000e-01 +555 551 -8.33333333333333e-02 +555 556 -3.33333333333333e-01 +555 493 -8.33333333333333e-02 +555 485 8.33333333333333e-02 +555 482 -8.33333333333333e-02 +555 484 8.33333333333333e-02 +555 481 -8.33333333333333e-02 +555 494 1.66666666666667e-01 +555 572 1.66666666666667e-01 +555 557 -3.33333333333333e-01 +555 103 -1.66666666666667e-01 +555 571 1.66666666666667e-01 +555 492 -2.50000000000000e-01 +555 570 -7.50000000000000e-01 +555 550 1.66666666666667e-01 +555 73 -1.66666666666667e-01 +555 584 -1.66666666666667e-01 +555 549 -2.50000000000000e-01 +556 556 2.50000000000000e+00 +556 582 8.33333333333333e-02 +556 636 -8.33333333333333e-02 +556 632 -1.66666666666667e-01 +556 566 1.66666666666667e-01 +556 630 8.33333333333333e-02 +556 564 -8.33333333333333e-02 +556 638 -8.33333333333333e-02 +556 565 -2.50000000000000e-01 +556 491 8.33333333333333e-02 +556 554 -8.33333333333333e-02 +556 489 8.33333333333333e-02 +556 629 1.66666666666667e-01 +556 557 -3.33333333333333e-01 +556 628 -7.50000000000000e-01 +556 627 1.66666666666667e-01 +556 553 -2.50000000000000e-01 +556 552 1.66666666666667e-01 +556 555 -3.33333333333333e-01 +556 492 -8.33333333333333e-02 +556 494 1.66666666666667e-01 +556 485 -1.66666666666667e-01 +556 551 1.66666666666667e-01 +556 483 8.33333333333333e-02 +556 480 -8.33333333333333e-02 +556 104 8.33333333333333e-02 +556 572 -8.33333333333333e-02 +556 493 -2.50000000000000e-01 +556 571 -2.50000000000000e-01 +556 102 -1.66666666666667e-01 +556 570 1.66666666666667e-01 +556 482 -8.33333333333333e-02 +556 74 8.33333333333333e-02 +556 584 8.33333333333333e-02 +556 550 -7.50000000000000e-01 +556 549 1.66666666666667e-01 +556 72 -1.66666666666667e-01 +557 557 2.50000000000000e+00 +557 582 -1.66666666666667e-01 +557 630 8.33333333333333e-02 +557 636 -8.33333333333333e-02 +557 631 -1.66666666666667e-01 +557 565 1.66666666666667e-01 +557 637 -8.33333333333333e-02 +557 566 -7.50000000000000e-01 +557 564 1.66666666666667e-01 +557 490 8.33333333333333e-02 +557 553 -8.33333333333333e-02 +557 489 -1.66666666666667e-01 +557 552 1.66666666666667e-01 +557 629 -2.50000000000000e-01 +557 628 1.66666666666667e-01 +557 556 -3.33333333333333e-01 +557 102 8.33333333333333e-02 +557 627 -8.33333333333333e-02 +557 554 -2.50000000000000e-01 +557 72 8.33333333333333e-02 +557 549 -8.33333333333333e-02 +557 493 1.66666666666667e-01 +557 483 8.33333333333333e-02 +557 480 -8.33333333333333e-02 +557 484 -1.66666666666667e-01 +557 550 1.66666666666667e-01 +557 494 -7.50000000000000e-01 +557 572 -2.50000000000000e-01 +557 103 8.33333333333333e-02 +557 571 -8.33333333333333e-02 +557 492 1.66666666666667e-01 +557 570 1.66666666666667e-01 +557 555 -3.33333333333333e-01 +557 583 8.33333333333333e-02 +557 551 -2.50000000000000e-01 +557 481 -8.33333333333333e-02 +557 73 8.33333333333333e-02 +558 558 2.50000000000000e+00 +558 665 -1.66666666666667e-01 +558 563 1.66666666666667e-01 +558 562 1.66666666666667e-01 +558 561 -7.50000000000000e-01 +558 667 -8.33333333333333e-02 +558 668 -8.33333333333333e-02 +558 566 8.33333333333333e-02 +558 565 -1.66666666666667e-01 +558 517 8.33333333333333e-02 +558 412 -8.33333333333333e-02 +558 527 -8.33333333333333e-02 +558 422 8.33333333333333e-02 +558 526 1.66666666666667e-01 +558 421 -1.66666666666667e-01 +558 525 -2.50000000000000e-01 +558 518 8.33333333333333e-02 +558 413 -8.33333333333333e-02 +558 305 8.33333333333333e-02 +558 293 -8.33333333333333e-02 +558 559 -3.33333333333333e-01 +558 292 1.66666666666667e-01 +558 454 1.66666666666667e-01 +558 74 1.66666666666667e-01 +558 443 -1.66666666666667e-01 +558 73 -8.33333333333333e-02 +558 442 8.33333333333333e-02 +558 72 -2.50000000000000e-01 +558 291 -2.50000000000000e-01 +558 560 -3.33333333333333e-01 +558 122 1.66666666666667e-01 +558 455 1.66666666666667e-01 +558 121 -8.33333333333333e-02 +558 304 8.33333333333333e-02 +558 664 8.33333333333333e-02 +558 120 -2.50000000000000e-01 +558 453 -7.50000000000000e-01 +559 559 2.50000000000000e+00 +559 665 8.33333333333333e-02 +559 563 -8.33333333333333e-02 +559 562 -2.50000000000000e-01 +559 561 1.66666666666667e-01 +559 566 8.33333333333333e-02 +559 668 -8.33333333333333e-02 +559 666 -8.33333333333333e-02 +559 564 -1.66666666666667e-01 +559 516 8.33333333333333e-02 +559 411 -8.33333333333333e-02 +559 422 8.33333333333333e-02 +559 413 -8.33333333333333e-02 +559 527 1.66666666666667e-01 +559 526 -7.50000000000000e-01 +559 525 1.66666666666667e-01 +559 420 -1.66666666666667e-01 +559 518 -1.66666666666667e-01 +559 443 8.33333333333333e-02 +559 455 -8.33333333333333e-02 +559 558 -3.33333333333333e-01 +559 291 1.66666666666667e-01 +559 453 1.66666666666667e-01 +559 74 1.66666666666667e-01 +559 560 -3.33333333333333e-01 +559 293 1.66666666666667e-01 +559 73 -2.50000000000000e-01 +559 292 -7.50000000000000e-01 +559 72 -8.33333333333333e-02 +559 441 8.33333333333333e-02 +559 122 1.66666666666667e-01 +559 305 -1.66666666666667e-01 +559 663 8.33333333333333e-02 +559 121 -2.50000000000000e-01 +559 454 -2.50000000000000e-01 +559 120 -8.33333333333333e-02 +559 303 8.33333333333333e-02 +560 560 2.50000000000000e+00 +560 663 -1.66666666666667e-01 +560 563 -2.50000000000000e-01 +560 562 -8.33333333333333e-02 +560 561 1.66666666666667e-01 +560 565 8.33333333333333e-02 +560 667 -8.33333333333333e-02 +560 666 -8.33333333333333e-02 +560 564 8.33333333333333e-02 +560 421 8.33333333333333e-02 +560 412 -8.33333333333333e-02 +560 527 -2.50000000000000e-01 +560 526 1.66666666666667e-01 +560 525 -8.33333333333333e-02 +560 420 8.33333333333333e-02 +560 517 -1.66666666666667e-01 +560 516 8.33333333333333e-02 +560 411 -8.33333333333333e-02 +560 303 8.33333333333333e-02 +560 291 -8.33333333333333e-02 +560 442 8.33333333333333e-02 +560 454 -8.33333333333333e-02 +560 74 -7.50000000000000e-01 +560 293 -2.50000000000000e-01 +560 73 1.66666666666667e-01 +560 559 -3.33333333333333e-01 +560 292 1.66666666666667e-01 +560 72 1.66666666666667e-01 +560 441 -1.66666666666667e-01 +560 664 8.33333333333333e-02 +560 122 -7.50000000000000e-01 +560 455 -2.50000000000000e-01 +560 121 1.66666666666667e-01 +560 304 -1.66666666666667e-01 +560 558 -3.33333333333333e-01 +560 120 1.66666666666667e-01 +560 453 1.66666666666667e-01 +561 561 2.50000000000000e+00 +561 521 8.33333333333333e-02 +561 518 -8.33333333333333e-02 +561 530 -8.33333333333333e-02 +561 527 8.33333333333333e-02 +561 529 1.66666666666667e-01 +561 526 -1.66666666666667e-01 +561 517 -8.33333333333333e-02 +561 528 -2.50000000000000e-01 +561 667 8.33333333333333e-02 +561 664 -8.33333333333333e-02 +561 668 8.33333333333333e-02 +561 560 1.66666666666667e-01 +561 559 1.66666666666667e-01 +561 562 -3.33333333333333e-01 +561 558 -7.50000000000000e-01 +561 665 1.66666666666667e-01 +561 663 -2.50000000000000e-01 +561 563 -3.33333333333333e-01 +561 566 -8.33333333333333e-02 +561 565 1.66666666666667e-01 +561 674 -8.33333333333333e-02 +561 584 8.33333333333333e-02 +561 583 -1.66666666666667e-01 +561 577 1.66666666666667e-01 +561 74 -1.66666666666667e-01 +561 551 1.66666666666667e-01 +561 73 8.33333333333333e-02 +561 550 -8.33333333333333e-02 +561 564 -2.50000000000000e-01 +561 549 -2.50000000000000e-01 +561 578 1.66666666666667e-01 +561 125 -1.66666666666667e-01 +561 673 -8.33333333333333e-02 +561 124 8.33333333333333e-02 +561 520 8.33333333333333e-02 +561 576 -7.50000000000000e-01 +562 562 2.50000000000000e+00 +562 521 -1.66666666666667e-01 +562 518 -8.33333333333333e-02 +562 527 8.33333333333333e-02 +562 528 1.66666666666667e-01 +562 525 -1.66666666666667e-01 +562 516 -8.33333333333333e-02 +562 530 1.66666666666667e-01 +562 529 -7.50000000000000e-01 +562 666 8.33333333333333e-02 +562 663 -8.33333333333333e-02 +562 665 1.66666666666667e-01 +562 668 -1.66666666666667e-01 +562 560 -8.33333333333333e-02 +562 74 8.33333333333333e-02 +562 559 -2.50000000000000e-01 +562 558 1.66666666666667e-01 +562 561 -3.33333333333333e-01 +562 125 8.33333333333333e-02 +562 664 -2.50000000000000e-01 +562 578 -8.33333333333333e-02 +562 584 8.33333333333333e-02 +562 674 -8.33333333333333e-02 +562 564 1.66666666666667e-01 +562 582 -1.66666666666667e-01 +562 576 1.66666666666667e-01 +562 566 1.66666666666667e-01 +562 551 1.66666666666667e-01 +562 563 -3.33333333333333e-01 +562 565 -7.50000000000000e-01 +562 550 -2.50000000000000e-01 +562 72 8.33333333333333e-02 +562 549 -8.33333333333333e-02 +562 519 8.33333333333333e-02 +562 577 -2.50000000000000e-01 +562 672 -8.33333333333333e-02 +562 123 8.33333333333333e-02 +563 563 2.50000000000000e+00 +563 519 8.33333333333333e-02 +563 516 -8.33333333333333e-02 +563 517 -8.33333333333333e-02 +563 526 8.33333333333333e-02 +563 528 -8.33333333333333e-02 +563 525 8.33333333333333e-02 +563 530 -2.50000000000000e-01 +563 529 1.66666666666667e-01 +563 664 1.66666666666667e-01 +563 667 -1.66666666666667e-01 +563 666 8.33333333333333e-02 +563 560 -2.50000000000000e-01 +563 559 -8.33333333333333e-02 +563 73 8.33333333333333e-02 +563 558 1.66666666666667e-01 +563 665 -7.50000000000000e-01 +563 124 8.33333333333333e-02 +563 663 1.66666666666667e-01 +563 577 -8.33333333333333e-02 +563 561 -3.33333333333333e-01 +563 564 -8.33333333333333e-02 +563 583 8.33333333333333e-02 +563 673 -8.33333333333333e-02 +563 672 -8.33333333333333e-02 +563 582 8.33333333333333e-02 +563 566 -2.50000000000000e-01 +563 551 -7.50000000000000e-01 +563 565 1.66666666666667e-01 +563 550 1.66666666666667e-01 +563 562 -3.33333333333333e-01 +563 72 -1.66666666666667e-01 +563 549 1.66666666666667e-01 +563 520 -1.66666666666667e-01 +563 578 -2.50000000000000e-01 +563 576 1.66666666666667e-01 +563 123 -1.66666666666667e-01 +564 564 2.50000000000000e+00 +564 556 -8.33333333333333e-02 +564 637 -1.66666666666667e-01 +564 557 1.66666666666667e-01 +564 555 -2.50000000000000e-01 +564 632 -8.33333333333333e-02 +564 631 1.66666666666667e-01 +564 630 -2.50000000000000e-01 +564 554 -1.66666666666667e-01 +564 553 8.33333333333333e-02 +564 551 8.33333333333333e-02 +564 563 -8.33333333333333e-02 +564 565 -3.33333333333333e-01 +564 583 1.66666666666667e-01 +564 562 1.66666666666667e-01 +564 584 1.66666666666667e-01 +564 674 -1.66666666666667e-01 +564 133 -8.33333333333333e-02 +564 673 8.33333333333333e-02 +564 582 -7.50000000000000e-01 +564 73 -8.33333333333333e-02 +564 550 8.33333333333333e-02 +564 561 -2.50000000000000e-01 +564 293 1.66666666666667e-01 +564 566 -3.33333333333333e-01 +564 668 1.66666666666667e-01 +564 310 8.33333333333333e-02 +564 667 -8.33333333333333e-02 +564 560 8.33333333333333e-02 +564 74 -8.33333333333333e-02 +564 292 1.66666666666667e-01 +564 559 -1.66666666666667e-01 +564 291 -7.50000000000000e-01 +564 311 8.33333333333333e-02 +564 134 -8.33333333333333e-02 +564 666 -2.50000000000000e-01 +564 638 8.33333333333333e-02 +565 565 2.50000000000000e+00 +565 555 -8.33333333333333e-02 +565 638 8.33333333333333e-02 +565 636 -1.66666666666667e-01 +565 556 -2.50000000000000e-01 +565 554 8.33333333333333e-02 +565 630 1.66666666666667e-01 +565 632 1.66666666666667e-01 +565 631 -7.50000000000000e-01 +565 552 8.33333333333333e-02 +565 566 -3.33333333333333e-01 +565 74 -8.33333333333333e-02 +565 134 -8.33333333333333e-02 +565 584 -8.33333333333333e-02 +565 674 8.33333333333333e-02 +565 564 -3.33333333333333e-01 +565 582 1.66666666666667e-01 +565 561 1.66666666666667e-01 +565 583 -2.50000000000000e-01 +565 132 -8.33333333333333e-02 +565 672 8.33333333333333e-02 +565 551 -1.66666666666667e-01 +565 563 1.66666666666667e-01 +565 562 -7.50000000000000e-01 +565 72 -8.33333333333333e-02 +565 549 8.33333333333333e-02 +565 293 -8.33333333333333e-02 +565 560 8.33333333333333e-02 +565 309 8.33333333333333e-02 +565 666 -8.33333333333333e-02 +565 292 -2.50000000000000e-01 +565 291 1.66666666666667e-01 +565 558 -1.66666666666667e-01 +565 311 -1.66666666666667e-01 +565 668 1.66666666666667e-01 +565 667 -2.50000000000000e-01 +565 557 1.66666666666667e-01 +566 566 2.50000000000000e+00 +566 556 1.66666666666667e-01 +566 637 8.33333333333333e-02 +566 557 -7.50000000000000e-01 +566 555 1.66666666666667e-01 +566 630 -8.33333333333333e-02 +566 553 8.33333333333333e-02 +566 632 -2.50000000000000e-01 +566 631 1.66666666666667e-01 +566 552 -1.66666666666667e-01 +566 565 -3.33333333333333e-01 +566 73 -8.33333333333333e-02 +566 133 -8.33333333333333e-02 +566 549 8.33333333333333e-02 +566 561 -8.33333333333333e-02 +566 583 -8.33333333333333e-02 +566 673 8.33333333333333e-02 +566 584 -2.50000000000000e-01 +566 582 1.66666666666667e-01 +566 672 -1.66666666666667e-01 +566 563 -2.50000000000000e-01 +566 550 -1.66666666666667e-01 +566 562 1.66666666666667e-01 +566 292 -8.33333333333333e-02 +566 559 8.33333333333333e-02 +566 291 1.66666666666667e-01 +566 564 -3.33333333333333e-01 +566 666 1.66666666666667e-01 +566 293 -2.50000000000000e-01 +566 558 8.33333333333333e-02 +566 72 -8.33333333333333e-02 +566 668 -7.50000000000000e-01 +566 636 8.33333333333333e-02 +566 310 -1.66666666666667e-01 +566 667 1.66666666666667e-01 +566 309 8.33333333333333e-02 +566 132 -8.33333333333333e-02 +567 567 2.50000000000000e+00 +567 502 -8.33333333333333e-02 +567 497 -1.66666666666667e-01 +567 503 1.66666666666667e-01 +567 501 -2.50000000000000e-01 +567 599 8.33333333333333e-02 +567 598 -1.66666666666667e-01 +567 575 -8.33333333333333e-02 +567 574 1.66666666666667e-01 +567 573 -2.50000000000000e-01 +567 466 -8.33333333333333e-02 +567 475 8.33333333333333e-02 +567 476 8.33333333333333e-02 +567 539 -8.33333333333333e-02 +567 85 1.66666666666667e-01 +567 568 -3.33333333333333e-01 +567 538 1.66666666666667e-01 +567 537 -2.50000000000000e-01 +567 467 -8.33333333333333e-02 +567 533 8.33333333333333e-02 +567 76 1.66666666666667e-01 +567 532 -1.66666666666667e-01 +567 317 -8.33333333333333e-02 +567 314 8.33333333333333e-02 +567 86 1.66666666666667e-01 +567 602 -1.66666666666667e-01 +567 601 8.33333333333333e-02 +567 316 -8.33333333333333e-02 +567 84 -7.50000000000000e-01 +567 569 -3.33333333333333e-01 +567 581 1.66666666666667e-01 +567 77 1.66666666666667e-01 +567 580 -8.33333333333333e-02 +567 313 8.33333333333333e-02 +567 496 8.33333333333333e-02 +567 579 -2.50000000000000e-01 +567 75 -7.50000000000000e-01 +568 568 2.50000000000000e+00 +568 501 -8.33333333333333e-02 +568 503 1.66666666666667e-01 +568 497 8.33333333333333e-02 +568 502 -2.50000000000000e-01 +568 599 8.33333333333333e-02 +568 597 -1.66666666666667e-01 +568 575 1.66666666666667e-01 +568 574 -7.50000000000000e-01 +568 573 1.66666666666667e-01 +568 569 -3.33333333333333e-01 +568 77 -8.33333333333333e-02 +568 86 -8.33333333333333e-02 +568 533 8.33333333333333e-02 +568 467 -8.33333333333333e-02 +568 465 -8.33333333333333e-02 +568 474 8.33333333333333e-02 +568 476 -1.66666666666667e-01 +568 539 1.66666666666667e-01 +568 538 -7.50000000000000e-01 +568 84 1.66666666666667e-01 +568 567 -3.33333333333333e-01 +568 537 1.66666666666667e-01 +568 75 1.66666666666667e-01 +568 531 -1.66666666666667e-01 +568 602 8.33333333333333e-02 +568 317 -8.33333333333333e-02 +568 85 -2.50000000000000e-01 +568 600 8.33333333333333e-02 +568 315 -8.33333333333333e-02 +568 581 1.66666666666667e-01 +568 314 -1.66666666666667e-01 +568 495 8.33333333333333e-02 +568 580 -2.50000000000000e-01 +568 76 -2.50000000000000e-01 +568 579 -8.33333333333333e-02 +568 312 8.33333333333333e-02 +569 569 2.50000000000000e+00 +569 496 8.33333333333333e-02 +569 495 -1.66666666666667e-01 +569 503 -7.50000000000000e-01 +569 501 1.66666666666667e-01 +569 598 8.33333333333333e-02 +569 597 8.33333333333333e-02 +569 575 -2.50000000000000e-01 +569 574 1.66666666666667e-01 +569 573 -8.33333333333333e-02 +569 568 -3.33333333333333e-01 +569 76 -8.33333333333333e-02 +569 85 -8.33333333333333e-02 +569 532 8.33333333333333e-02 +569 466 -8.33333333333333e-02 +569 539 -2.50000000000000e-01 +569 475 -1.66666666666667e-01 +569 538 1.66666666666667e-01 +569 474 8.33333333333333e-02 +569 537 -8.33333333333333e-02 +569 465 -8.33333333333333e-02 +569 531 8.33333333333333e-02 +569 601 8.33333333333333e-02 +569 316 -8.33333333333333e-02 +569 315 -8.33333333333333e-02 +569 312 8.33333333333333e-02 +569 86 -2.50000000000000e-01 +569 84 1.66666666666667e-01 +569 600 -1.66666666666667e-01 +569 502 1.66666666666667e-01 +569 581 -7.50000000000000e-01 +569 77 -2.50000000000000e-01 +569 580 1.66666666666667e-01 +569 313 -1.66666666666667e-01 +569 567 -3.33333333333333e-01 +569 579 1.66666666666667e-01 +569 75 1.66666666666667e-01 +570 570 2.50000000000000e+00 +570 508 -8.33333333333333e-02 +570 509 1.66666666666667e-01 +570 497 8.33333333333333e-02 +570 507 -2.50000000000000e-01 +570 635 8.33333333333333e-02 +570 634 -1.66666666666667e-01 +570 575 1.66666666666667e-01 +570 574 1.66666666666667e-01 +570 573 -7.50000000000000e-01 +570 572 -3.33333333333333e-01 +570 104 -8.33333333333333e-02 +570 77 -8.33333333333333e-02 +570 485 -8.33333333333333e-02 +570 551 8.33333333333333e-02 +570 484 -8.33333333333333e-02 +570 493 8.33333333333333e-02 +570 494 -1.66666666666667e-01 +570 557 1.66666666666667e-01 +570 103 1.66666666666667e-01 +570 571 -3.33333333333333e-01 +570 556 1.66666666666667e-01 +570 555 -7.50000000000000e-01 +570 76 1.66666666666667e-01 +570 550 -1.66666666666667e-01 +570 320 -8.33333333333333e-02 +570 638 8.33333333333333e-02 +570 637 8.33333333333333e-02 +570 319 -8.33333333333333e-02 +570 102 -2.50000000000000e-01 +570 584 1.66666666666667e-01 +570 314 -1.66666666666667e-01 +570 583 -8.33333333333333e-02 +570 313 8.33333333333333e-02 +570 582 -2.50000000000000e-01 +570 496 8.33333333333333e-02 +570 75 -2.50000000000000e-01 +571 571 2.50000000000000e+00 +571 507 -8.33333333333333e-02 +571 497 -1.66666666666667e-01 +571 509 1.66666666666667e-01 +571 508 -2.50000000000000e-01 +571 635 8.33333333333333e-02 +571 633 -1.66666666666667e-01 +571 575 -8.33333333333333e-02 +571 574 -2.50000000000000e-01 +571 573 1.66666666666667e-01 +571 483 -8.33333333333333e-02 +571 492 8.33333333333333e-02 +571 494 8.33333333333333e-02 +571 557 -8.33333333333333e-02 +571 556 -2.50000000000000e-01 +571 102 1.66666666666667e-01 +571 570 -3.33333333333333e-01 +571 555 1.66666666666667e-01 +571 485 -8.33333333333333e-02 +571 551 8.33333333333333e-02 +571 75 1.66666666666667e-01 +571 549 -1.66666666666667e-01 +571 320 -8.33333333333333e-02 +571 314 8.33333333333333e-02 +571 638 -1.66666666666667e-01 +571 104 1.66666666666667e-01 +571 103 -7.50000000000000e-01 +571 636 8.33333333333333e-02 +571 318 -8.33333333333333e-02 +571 584 1.66666666666667e-01 +571 572 -3.33333333333333e-01 +571 77 1.66666666666667e-01 +571 583 -2.50000000000000e-01 +571 495 8.33333333333333e-02 +571 76 -7.50000000000000e-01 +571 582 -8.33333333333333e-02 +571 312 8.33333333333333e-02 +572 572 2.50000000000000e+00 +572 496 -1.66666666666667e-01 +572 495 8.33333333333333e-02 +572 509 -7.50000000000000e-01 +572 508 1.66666666666667e-01 +572 633 8.33333333333333e-02 +572 634 8.33333333333333e-02 +572 575 -2.50000000000000e-01 +572 574 -8.33333333333333e-02 +572 573 1.66666666666667e-01 +572 570 -3.33333333333333e-01 +572 102 -8.33333333333333e-02 +572 75 -8.33333333333333e-02 +572 483 -8.33333333333333e-02 +572 549 8.33333333333333e-02 +572 557 -2.50000000000000e-01 +572 493 8.33333333333333e-02 +572 556 -8.33333333333333e-02 +572 492 -1.66666666666667e-01 +572 555 1.66666666666667e-01 +572 484 -8.33333333333333e-02 +572 550 8.33333333333333e-02 +572 318 -8.33333333333333e-02 +572 636 8.33333333333333e-02 +572 319 -8.33333333333333e-02 +572 313 8.33333333333333e-02 +572 104 -2.50000000000000e-01 +572 637 -1.66666666666667e-01 +572 103 1.66666666666667e-01 +572 584 -7.50000000000000e-01 +572 507 1.66666666666667e-01 +572 77 -2.50000000000000e-01 +572 583 1.66666666666667e-01 +572 571 -3.33333333333333e-01 +572 76 1.66666666666667e-01 +572 582 1.66666666666667e-01 +572 312 -1.66666666666667e-01 +573 573 2.50000000000000e+00 +573 509 -1.66666666666667e-01 +573 635 -8.33333333333333e-02 +573 319 8.33333333333333e-02 +573 320 8.33333333333333e-02 +573 634 1.66666666666667e-01 +573 633 -2.50000000000000e-01 +573 572 1.66666666666667e-01 +573 571 1.66666666666667e-01 +573 570 -7.50000000000000e-01 +573 496 -8.33333333333333e-02 +573 497 -8.33333333333333e-02 +573 511 -8.33333333333333e-02 +573 502 8.33333333333333e-02 +573 503 8.33333333333333e-02 +573 512 1.66666666666667e-01 +573 575 -3.33333333333333e-01 +573 510 -2.50000000000000e-01 +573 313 -8.33333333333333e-02 +573 574 -3.33333333333333e-01 +573 599 1.66666666666667e-01 +573 322 -8.33333333333333e-02 +573 316 8.33333333333333e-02 +573 314 1.66666666666667e-01 +573 317 -1.66666666666667e-01 +573 107 8.33333333333333e-02 +573 323 -8.33333333333333e-02 +573 598 1.66666666666667e-01 +573 106 -1.66666666666667e-01 +573 597 -7.50000000000000e-01 +573 569 -8.33333333333333e-02 +573 77 8.33333333333333e-02 +573 568 1.66666666666667e-01 +573 76 -1.66666666666667e-01 +573 567 -2.50000000000000e-01 +573 508 8.33333333333333e-02 +573 312 -2.50000000000000e-01 +574 574 2.50000000000000e+00 +574 509 8.33333333333333e-02 +574 635 1.66666666666667e-01 +574 318 8.33333333333333e-02 +574 320 -1.66666666666667e-01 +574 634 -7.50000000000000e-01 +574 633 1.66666666666667e-01 +574 572 -8.33333333333333e-02 +574 571 -2.50000000000000e-01 +574 570 1.66666666666667e-01 +574 495 -8.33333333333333e-02 +574 512 1.66666666666667e-01 +574 510 -8.33333333333333e-02 +574 501 8.33333333333333e-02 +574 503 -1.66666666666667e-01 +574 107 8.33333333333333e-02 +574 511 -2.50000000000000e-01 +574 497 -8.33333333333333e-02 +574 77 8.33333333333333e-02 +574 312 -8.33333333333333e-02 +574 599 -8.33333333333333e-02 +574 573 -3.33333333333333e-01 +574 321 -8.33333333333333e-02 +574 315 8.33333333333333e-02 +574 323 -8.33333333333333e-02 +574 317 8.33333333333333e-02 +574 598 -2.50000000000000e-01 +574 597 1.66666666666667e-01 +574 105 -1.66666666666667e-01 +574 569 1.66666666666667e-01 +574 575 -3.33333333333333e-01 +574 314 1.66666666666667e-01 +574 568 -7.50000000000000e-01 +574 507 8.33333333333333e-02 +574 313 -2.50000000000000e-01 +574 567 1.66666666666667e-01 +574 75 -1.66666666666667e-01 +575 575 2.50000000000000e+00 +575 507 -1.66666666666667e-01 +575 633 -8.33333333333333e-02 +575 634 1.66666666666667e-01 +575 319 -1.66666666666667e-01 +575 318 8.33333333333333e-02 +575 635 -2.50000000000000e-01 +575 572 -2.50000000000000e-01 +575 571 -8.33333333333333e-02 +575 570 1.66666666666667e-01 +575 495 -8.33333333333333e-02 +575 511 1.66666666666667e-01 +575 502 -1.66666666666667e-01 +575 501 8.33333333333333e-02 +575 512 -7.50000000000000e-01 +575 106 8.33333333333333e-02 +575 510 1.66666666666667e-01 +575 573 -3.33333333333333e-01 +575 496 -8.33333333333333e-02 +575 76 8.33333333333333e-02 +575 598 -8.33333333333333e-02 +575 597 1.66666666666667e-01 +575 322 -8.33333333333333e-02 +575 316 8.33333333333333e-02 +575 312 1.66666666666667e-01 +575 315 -1.66666666666667e-01 +575 599 -2.50000000000000e-01 +575 105 8.33333333333333e-02 +575 321 -8.33333333333333e-02 +575 569 -2.50000000000000e-01 +575 508 8.33333333333333e-02 +575 314 -7.50000000000000e-01 +575 568 1.66666666666667e-01 +575 574 -3.33333333333333e-01 +575 313 1.66666666666667e-01 +575 567 -8.33333333333333e-02 +575 75 8.33333333333333e-02 +576 576 2.50000000000000e+00 +576 551 -1.66666666666667e-01 +576 550 8.33333333333333e-02 +576 563 1.66666666666667e-01 +576 561 -7.50000000000000e-01 +576 673 8.33333333333333e-02 +576 674 8.33333333333333e-02 +576 584 -8.33333333333333e-02 +576 583 1.66666666666667e-01 +576 582 -2.50000000000000e-01 +576 520 -8.33333333333333e-02 +576 521 -8.33333333333333e-02 +576 530 8.33333333333333e-02 +576 529 -1.66666666666667e-01 +576 533 8.33333333333333e-02 +576 545 -8.33333333333333e-02 +576 577 -3.33333333333333e-01 +576 544 1.66666666666667e-01 +576 532 8.33333333333333e-02 +576 76 -8.33333333333333e-02 +576 124 -8.33333333333333e-02 +576 543 -2.50000000000000e-01 +576 314 8.33333333333333e-02 +576 326 -8.33333333333333e-02 +576 670 8.33333333333333e-02 +576 325 -8.33333333333333e-02 +576 125 1.66666666666667e-01 +576 671 -1.66666666666667e-01 +576 123 -2.50000000000000e-01 +576 578 -3.33333333333333e-01 +576 581 1.66666666666667e-01 +576 77 1.66666666666667e-01 +576 580 1.66666666666667e-01 +576 313 -1.66666666666667e-01 +576 562 1.66666666666667e-01 +576 579 -7.50000000000000e-01 +576 75 -2.50000000000000e-01 +577 577 2.50000000000000e+00 +577 563 -8.33333333333333e-02 +577 561 1.66666666666667e-01 +577 549 8.33333333333333e-02 +577 562 -2.50000000000000e-01 +577 672 8.33333333333333e-02 +577 674 -1.66666666666667e-01 +577 584 1.66666666666667e-01 +577 583 -7.50000000000000e-01 +577 582 1.66666666666667e-01 +577 519 -8.33333333333333e-02 +577 521 -8.33333333333333e-02 +577 530 8.33333333333333e-02 +577 528 -1.66666666666667e-01 +577 576 -3.33333333333333e-01 +577 543 1.66666666666667e-01 +577 533 -1.66666666666667e-01 +577 77 1.66666666666667e-01 +577 531 8.33333333333333e-02 +577 75 -8.33333333333333e-02 +577 545 1.66666666666667e-01 +577 578 -3.33333333333333e-01 +577 125 1.66666666666667e-01 +577 544 -7.50000000000000e-01 +577 123 -8.33333333333333e-02 +577 669 8.33333333333333e-02 +577 324 -8.33333333333333e-02 +577 671 8.33333333333333e-02 +577 326 -8.33333333333333e-02 +577 124 -2.50000000000000e-01 +577 581 -8.33333333333333e-02 +577 314 8.33333333333333e-02 +577 551 8.33333333333333e-02 +577 580 -2.50000000000000e-01 +577 76 -2.50000000000000e-01 +577 579 1.66666666666667e-01 +577 312 -1.66666666666667e-01 +578 578 2.50000000000000e+00 +578 562 -8.33333333333333e-02 +578 549 -1.66666666666667e-01 +578 563 -2.50000000000000e-01 +578 561 1.66666666666667e-01 +578 673 -1.66666666666667e-01 +578 672 8.33333333333333e-02 +578 584 -2.50000000000000e-01 +578 583 1.66666666666667e-01 +578 582 -8.33333333333333e-02 +578 520 -8.33333333333333e-02 +578 529 8.33333333333333e-02 +578 519 -8.33333333333333e-02 +578 528 8.33333333333333e-02 +578 531 8.33333333333333e-02 +578 543 -8.33333333333333e-02 +578 532 -1.66666666666667e-01 +578 76 1.66666666666667e-01 +578 545 -2.50000000000000e-01 +578 544 1.66666666666667e-01 +578 577 -3.33333333333333e-01 +578 124 1.66666666666667e-01 +578 312 8.33333333333333e-02 +578 324 -8.33333333333333e-02 +578 125 -7.50000000000000e-01 +578 670 8.33333333333333e-02 +578 325 -8.33333333333333e-02 +578 123 1.66666666666667e-01 +578 669 -1.66666666666667e-01 +578 550 8.33333333333333e-02 +578 581 -2.50000000000000e-01 +578 77 -7.50000000000000e-01 +578 580 -8.33333333333333e-02 +578 313 8.33333333333333e-02 +578 576 -3.33333333333333e-01 +578 579 1.66666666666667e-01 +578 75 1.66666666666667e-01 +579 579 2.50000000000000e+00 +579 538 8.33333333333333e-02 +579 601 1.66666666666667e-01 +579 317 8.33333333333333e-02 +579 316 -1.66666666666667e-01 +579 602 1.66666666666667e-01 +579 600 -7.50000000000000e-01 +579 569 1.66666666666667e-01 +579 568 -8.33333333333333e-02 +579 567 -2.50000000000000e-01 +579 533 -8.33333333333333e-02 +579 548 -8.33333333333333e-02 +579 545 8.33333333333333e-02 +579 547 1.66666666666667e-01 +579 544 -1.66666666666667e-01 +579 127 8.33333333333333e-02 +579 546 -2.50000000000000e-01 +579 532 -8.33333333333333e-02 +579 76 8.33333333333333e-02 +579 314 -8.33333333333333e-02 +579 581 -3.33333333333333e-01 +579 670 -8.33333333333333e-02 +579 329 -8.33333333333333e-02 +579 326 8.33333333333333e-02 +579 328 -8.33333333333333e-02 +579 325 8.33333333333333e-02 +579 671 1.66666666666667e-01 +579 128 -1.66666666666667e-01 +579 669 -2.50000000000000e-01 +579 578 1.66666666666667e-01 +579 77 -1.66666666666667e-01 +579 577 1.66666666666667e-01 +579 580 -3.33333333333333e-01 +579 313 1.66666666666667e-01 +579 576 -7.50000000000000e-01 +579 539 8.33333333333333e-02 +579 312 -2.50000000000000e-01 +580 580 2.50000000000000e+00 +580 537 8.33333333333333e-02 +580 602 -8.33333333333333e-02 +580 317 8.33333333333333e-02 +580 600 1.66666666666667e-01 +580 315 -1.66666666666667e-01 +580 601 -2.50000000000000e-01 +580 569 1.66666666666667e-01 +580 568 -2.50000000000000e-01 +580 567 -8.33333333333333e-02 +580 533 -8.33333333333333e-02 +580 546 1.66666666666667e-01 +580 545 8.33333333333333e-02 +580 543 -1.66666666666667e-01 +580 548 1.66666666666667e-01 +580 581 -3.33333333333333e-01 +580 547 -7.50000000000000e-01 +580 126 8.33333333333333e-02 +580 531 -8.33333333333333e-02 +580 75 8.33333333333333e-02 +580 669 -8.33333333333333e-02 +580 671 1.66666666666667e-01 +580 314 1.66666666666667e-01 +580 326 -1.66666666666667e-01 +580 327 -8.33333333333333e-02 +580 324 8.33333333333333e-02 +580 128 8.33333333333333e-02 +580 329 -8.33333333333333e-02 +580 670 -2.50000000000000e-01 +580 578 -8.33333333333333e-02 +580 77 8.33333333333333e-02 +580 577 -2.50000000000000e-01 +580 539 -1.66666666666667e-01 +580 313 -7.50000000000000e-01 +580 576 1.66666666666667e-01 +580 579 -3.33333333333333e-01 +580 312 1.66666666666667e-01 +581 581 2.50000000000000e+00 +581 538 -1.66666666666667e-01 +581 601 -8.33333333333333e-02 +581 316 8.33333333333333e-02 +581 315 8.33333333333333e-02 +581 602 -2.50000000000000e-01 +581 600 1.66666666666667e-01 +581 569 -7.50000000000000e-01 +581 568 1.66666666666667e-01 +581 567 1.66666666666667e-01 +581 531 -8.33333333333333e-02 +581 532 -8.33333333333333e-02 +581 546 -8.33333333333333e-02 +581 543 8.33333333333333e-02 +581 544 8.33333333333333e-02 +581 548 -2.50000000000000e-01 +581 547 1.66666666666667e-01 +581 580 -3.33333333333333e-01 +581 312 -8.33333333333333e-02 +581 579 -3.33333333333333e-01 +581 670 1.66666666666667e-01 +581 327 -8.33333333333333e-02 +581 324 8.33333333333333e-02 +581 313 1.66666666666667e-01 +581 325 -1.66666666666667e-01 +581 671 -7.50000000000000e-01 +581 127 8.33333333333333e-02 +581 328 -8.33333333333333e-02 +581 669 1.66666666666667e-01 +581 126 -1.66666666666667e-01 +581 578 -2.50000000000000e-01 +581 537 8.33333333333333e-02 +581 314 -2.50000000000000e-01 +581 577 -8.33333333333333e-02 +581 76 8.33333333333333e-02 +581 576 1.66666666666667e-01 +581 75 -1.66666666666667e-01 +582 582 2.50000000000000e+00 +582 556 8.33333333333333e-02 +582 320 8.33333333333333e-02 +582 638 -8.33333333333333e-02 +582 637 1.66666666666667e-01 +582 319 -1.66666666666667e-01 +582 636 -2.50000000000000e-01 +582 572 1.66666666666667e-01 +582 571 -8.33333333333333e-02 +582 570 -2.50000000000000e-01 +582 551 -8.33333333333333e-02 +582 565 1.66666666666667e-01 +582 563 8.33333333333333e-02 +582 562 -1.66666666666667e-01 +582 566 1.66666666666667e-01 +582 584 -3.33333333333333e-01 +582 133 8.33333333333333e-02 +582 564 -7.50000000000000e-01 +582 550 -8.33333333333333e-02 +582 76 8.33333333333333e-02 +582 673 -8.33333333333333e-02 +582 674 1.66666666666667e-01 +582 314 1.66666666666667e-01 +582 326 -1.66666666666667e-01 +582 331 -8.33333333333333e-02 +582 325 8.33333333333333e-02 +582 134 8.33333333333333e-02 +582 332 -8.33333333333333e-02 +582 672 -2.50000000000000e-01 +582 578 -8.33333333333333e-02 +582 77 8.33333333333333e-02 +582 583 -3.33333333333333e-01 +582 577 1.66666666666667e-01 +582 313 1.66666666666667e-01 +582 557 -1.66666666666667e-01 +582 576 -2.50000000000000e-01 +582 312 -7.50000000000000e-01 +583 583 2.50000000000000e+00 +583 555 8.33333333333333e-02 +583 636 1.66666666666667e-01 +583 320 8.33333333333333e-02 +583 318 -1.66666666666667e-01 +583 638 1.66666666666667e-01 +583 637 -7.50000000000000e-01 +583 572 1.66666666666667e-01 +583 571 -2.50000000000000e-01 +583 570 -8.33333333333333e-02 +583 551 -8.33333333333333e-02 +583 566 -8.33333333333333e-02 +583 563 8.33333333333333e-02 +583 564 1.66666666666667e-01 +583 561 -1.66666666666667e-01 +583 565 -2.50000000000000e-01 +583 132 8.33333333333333e-02 +583 549 -8.33333333333333e-02 +583 75 8.33333333333333e-02 +583 314 -8.33333333333333e-02 +583 584 -3.33333333333333e-01 +583 672 -8.33333333333333e-02 +583 332 -8.33333333333333e-02 +583 326 8.33333333333333e-02 +583 330 -8.33333333333333e-02 +583 324 8.33333333333333e-02 +583 134 -1.66666666666667e-01 +583 674 1.66666666666667e-01 +583 673 -2.50000000000000e-01 +583 578 1.66666666666667e-01 +583 77 -1.66666666666667e-01 +583 557 8.33333333333333e-02 +583 577 -7.50000000000000e-01 +583 313 -2.50000000000000e-01 +583 582 -3.33333333333333e-01 +583 576 1.66666666666667e-01 +583 312 1.66666666666667e-01 +584 584 2.50000000000000e+00 +584 555 -1.66666666666667e-01 +584 318 8.33333333333333e-02 +584 636 -8.33333333333333e-02 +584 319 8.33333333333333e-02 +584 638 -2.50000000000000e-01 +584 637 1.66666666666667e-01 +584 572 -7.50000000000000e-01 +584 571 1.66666666666667e-01 +584 570 1.66666666666667e-01 +584 550 -8.33333333333333e-02 +584 549 -8.33333333333333e-02 +584 565 -8.33333333333333e-02 +584 562 8.33333333333333e-02 +584 561 8.33333333333333e-02 +584 566 -2.50000000000000e-01 +584 564 1.66666666666667e-01 +584 582 -3.33333333333333e-01 +584 313 -8.33333333333333e-02 +584 583 -3.33333333333333e-01 +584 331 -8.33333333333333e-02 +584 325 8.33333333333333e-02 +584 672 1.66666666666667e-01 +584 312 1.66666666666667e-01 +584 324 -1.66666666666667e-01 +584 674 -7.50000000000000e-01 +584 133 -1.66666666666667e-01 +584 673 1.66666666666667e-01 +584 132 8.33333333333333e-02 +584 330 -8.33333333333333e-02 +584 556 8.33333333333333e-02 +584 578 -2.50000000000000e-01 +584 314 -2.50000000000000e-01 +584 577 1.66666666666667e-01 +584 76 -1.66666666666667e-01 +584 576 -8.33333333333333e-02 +584 75 8.33333333333333e-02 +585 585 2.50000000000000e+00 +585 590 -8.33333333333333e-02 +585 589 1.66666666666667e-01 +585 588 -2.50000000000000e-01 +585 599 8.33333333333333e-02 +585 185 8.33333333333333e-02 +585 191 -8.33333333333333e-02 +585 586 -3.33333333333333e-01 +585 190 1.66666666666667e-01 +585 86 1.66666666666667e-01 +585 85 -8.33333333333333e-02 +585 84 -2.50000000000000e-01 +585 189 -2.50000000000000e-01 +585 587 -3.33333333333333e-01 +585 80 1.66666666666667e-01 +585 79 -8.33333333333333e-02 +585 184 8.33333333333333e-02 +585 598 8.33333333333333e-02 +585 78 -2.50000000000000e-01 +585 502 1.66666666666667e-01 +585 500 -1.66666666666667e-01 +585 499 8.33333333333333e-02 +585 503 1.66666666666667e-01 +585 501 -7.50000000000000e-01 +585 469 -8.33333333333333e-02 +585 470 -8.33333333333333e-02 +585 476 8.33333333333333e-02 +585 475 -1.66666666666667e-01 +585 980 8.33333333333333e-02 +585 1034 -8.33333333333333e-02 +585 1033 -8.33333333333333e-02 +585 979 -1.66666666666667e-01 +585 973 1.66666666666667e-01 +585 1031 -1.66666666666667e-01 +585 1030 8.33333333333333e-02 +585 974 1.66666666666667e-01 +585 972 -7.50000000000000e-01 +586 586 2.50000000000000e+00 +586 590 1.66666666666667e-01 +586 589 -7.50000000000000e-01 +586 588 1.66666666666667e-01 +586 599 -1.66666666666667e-01 +586 585 -3.33333333333333e-01 +586 189 1.66666666666667e-01 +586 86 1.66666666666667e-01 +586 587 -3.33333333333333e-01 +586 191 1.66666666666667e-01 +586 85 -2.50000000000000e-01 +586 190 -7.50000000000000e-01 +586 84 -8.33333333333333e-02 +586 80 1.66666666666667e-01 +586 185 -1.66666666666667e-01 +586 597 8.33333333333333e-02 +586 79 -2.50000000000000e-01 +586 78 -8.33333333333333e-02 +586 183 8.33333333333333e-02 +586 503 -8.33333333333333e-02 +586 501 1.66666666666667e-01 +586 498 8.33333333333333e-02 +586 502 -2.50000000000000e-01 +586 468 -8.33333333333333e-02 +586 470 -8.33333333333333e-02 +586 476 8.33333333333333e-02 +586 500 8.33333333333333e-02 +586 474 -1.66666666666667e-01 +586 1032 -8.33333333333333e-02 +586 980 8.33333333333333e-02 +586 978 -1.66666666666667e-01 +586 1034 -8.33333333333333e-02 +586 974 -8.33333333333333e-02 +586 1031 8.33333333333333e-02 +586 972 1.66666666666667e-01 +586 1029 8.33333333333333e-02 +586 973 -2.50000000000000e-01 +587 587 2.50000000000000e+00 +587 589 1.66666666666667e-01 +587 588 -8.33333333333333e-02 +587 598 -1.66666666666667e-01 +587 597 8.33333333333333e-02 +587 183 8.33333333333333e-02 +587 189 -8.33333333333333e-02 +587 86 -7.50000000000000e-01 +587 191 -2.50000000000000e-01 +587 85 1.66666666666667e-01 +587 586 -3.33333333333333e-01 +587 190 1.66666666666667e-01 +587 84 1.66666666666667e-01 +587 590 -2.50000000000000e-01 +587 80 -7.50000000000000e-01 +587 79 1.66666666666667e-01 +587 184 -1.66666666666667e-01 +587 585 -3.33333333333333e-01 +587 78 1.66666666666667e-01 +587 502 -8.33333333333333e-02 +587 498 -1.66666666666667e-01 +587 503 -2.50000000000000e-01 +587 501 1.66666666666667e-01 +587 469 -8.33333333333333e-02 +587 475 8.33333333333333e-02 +587 468 -8.33333333333333e-02 +587 499 8.33333333333333e-02 +587 474 8.33333333333333e-02 +587 978 8.33333333333333e-02 +587 1032 -8.33333333333333e-02 +587 979 8.33333333333333e-02 +587 1033 -8.33333333333333e-02 +587 973 -8.33333333333333e-02 +587 1030 8.33333333333333e-02 +587 1029 -1.66666666666667e-01 +587 974 -2.50000000000000e-01 +587 972 1.66666666666667e-01 +588 588 2.50000000000000e+00 +588 598 -8.33333333333333e-02 +588 107 8.33333333333333e-02 +588 597 -2.50000000000000e-01 +588 80 8.33333333333333e-02 +588 587 -8.33333333333333e-02 +588 589 -3.33333333333333e-01 +588 586 1.66666666666667e-01 +588 585 -2.50000000000000e-01 +588 233 -8.33333333333333e-02 +588 232 1.66666666666667e-01 +588 106 8.33333333333333e-02 +588 231 -2.50000000000000e-01 +588 590 -3.33333333333333e-01 +588 227 1.66666666666667e-01 +588 226 -8.33333333333333e-02 +588 79 8.33333333333333e-02 +588 599 1.66666666666667e-01 +588 225 -2.50000000000000e-01 +588 503 8.33333333333333e-02 +588 502 -1.66666666666667e-01 +588 499 -8.33333333333333e-02 +588 223 8.33333333333333e-02 +588 224 -1.66666666666667e-01 +588 512 1.66666666666667e-01 +588 500 -8.33333333333333e-02 +588 511 1.66666666666667e-01 +588 510 -7.50000000000000e-01 +588 1034 -1.66666666666667e-01 +588 1033 8.33333333333333e-02 +588 1211 -8.33333333333333e-02 +588 836 8.33333333333333e-02 +588 835 -1.66666666666667e-01 +588 979 1.66666666666667e-01 +588 1210 -8.33333333333333e-02 +588 980 1.66666666666667e-01 +588 978 -7.50000000000000e-01 +589 589 2.50000000000000e+00 +589 597 -8.33333333333333e-02 +589 599 1.66666666666667e-01 +589 598 -2.50000000000000e-01 +589 587 1.66666666666667e-01 +589 586 -7.50000000000000e-01 +589 588 -3.33333333333333e-01 +589 585 1.66666666666667e-01 +589 590 -3.33333333333333e-01 +589 231 1.66666666666667e-01 +589 107 -1.66666666666667e-01 +589 233 1.66666666666667e-01 +589 232 -7.50000000000000e-01 +589 105 8.33333333333333e-02 +589 227 1.66666666666667e-01 +589 80 -1.66666666666667e-01 +589 226 -2.50000000000000e-01 +589 225 -8.33333333333333e-02 +589 78 8.33333333333333e-02 +589 501 -1.66666666666667e-01 +589 498 -8.33333333333333e-02 +589 500 -8.33333333333333e-02 +589 222 8.33333333333333e-02 +589 224 8.33333333333333e-02 +589 512 -8.33333333333333e-02 +589 503 8.33333333333333e-02 +589 511 -2.50000000000000e-01 +589 510 1.66666666666667e-01 +589 1032 8.33333333333333e-02 +589 1211 -8.33333333333333e-02 +589 836 8.33333333333333e-02 +589 980 -8.33333333333333e-02 +589 834 -1.66666666666667e-01 +589 978 1.66666666666667e-01 +589 1209 -8.33333333333333e-02 +589 1034 8.33333333333333e-02 +589 979 -2.50000000000000e-01 +590 590 2.50000000000000e+00 +590 597 1.66666666666667e-01 +590 599 -7.50000000000000e-01 +590 598 1.66666666666667e-01 +590 105 8.33333333333333e-02 +590 587 -2.50000000000000e-01 +590 586 1.66666666666667e-01 +590 78 8.33333333333333e-02 +590 585 -8.33333333333333e-02 +590 589 -3.33333333333333e-01 +590 231 -8.33333333333333e-02 +590 233 -2.50000000000000e-01 +590 106 -1.66666666666667e-01 +590 232 1.66666666666667e-01 +590 227 -7.50000000000000e-01 +590 226 1.66666666666667e-01 +590 79 -1.66666666666667e-01 +590 588 -3.33333333333333e-01 +590 225 1.66666666666667e-01 +590 501 8.33333333333333e-02 +590 499 -8.33333333333333e-02 +590 223 8.33333333333333e-02 +590 511 -8.33333333333333e-02 +590 222 -1.66666666666667e-01 +590 510 1.66666666666667e-01 +590 498 -8.33333333333333e-02 +590 502 8.33333333333333e-02 +590 512 -2.50000000000000e-01 +590 1032 -1.66666666666667e-01 +590 1209 -8.33333333333333e-02 +590 1210 -8.33333333333333e-02 +590 834 8.33333333333333e-02 +590 835 8.33333333333333e-02 +590 979 -8.33333333333333e-02 +590 1033 8.33333333333333e-02 +590 980 -2.50000000000000e-01 +590 978 1.66666666666667e-01 +591 591 2.50000000000000e+00 +591 596 1.66666666666667e-01 +591 595 -8.33333333333333e-02 +591 594 -2.50000000000000e-01 +591 601 8.33333333333333e-02 +591 187 8.33333333333333e-02 +591 190 -8.33333333333333e-02 +591 593 -3.33333333333333e-01 +591 191 1.66666666666667e-01 +591 86 -8.33333333333333e-02 +591 85 1.66666666666667e-01 +591 84 -2.50000000000000e-01 +591 189 -2.50000000000000e-01 +591 83 -8.33333333333333e-02 +591 188 8.33333333333333e-02 +591 592 -3.33333333333333e-01 +591 82 1.66666666666667e-01 +591 602 8.33333333333333e-02 +591 81 -2.50000000000000e-01 +591 536 8.33333333333333e-02 +591 535 -1.66666666666667e-01 +591 539 1.66666666666667e-01 +591 538 1.66666666666667e-01 +591 537 -7.50000000000000e-01 +591 473 -8.33333333333333e-02 +591 472 -8.33333333333333e-02 +591 476 -1.66666666666667e-01 +591 475 8.33333333333333e-02 +591 1037 -8.33333333333333e-02 +591 1010 -1.66666666666667e-01 +591 1009 8.33333333333333e-02 +591 1036 -8.33333333333333e-02 +591 1004 1.66666666666667e-01 +591 1031 8.33333333333333e-02 +591 1030 -1.66666666666667e-01 +591 1003 1.66666666666667e-01 +591 1002 -7.50000000000000e-01 +592 592 2.50000000000000e+00 +592 596 1.66666666666667e-01 +592 595 -2.50000000000000e-01 +592 594 -8.33333333333333e-02 +592 602 -1.66666666666667e-01 +592 600 8.33333333333333e-02 +592 186 8.33333333333333e-02 +592 189 -8.33333333333333e-02 +592 86 1.66666666666667e-01 +592 593 -3.33333333333333e-01 +592 191 1.66666666666667e-01 +592 85 -7.50000000000000e-01 +592 190 -2.50000000000000e-01 +592 84 1.66666666666667e-01 +592 83 1.66666666666667e-01 +592 188 -1.66666666666667e-01 +592 82 -7.50000000000000e-01 +592 591 -3.33333333333333e-01 +592 81 1.66666666666667e-01 +592 536 8.33333333333333e-02 +592 534 -1.66666666666667e-01 +592 539 -8.33333333333333e-02 +592 538 -2.50000000000000e-01 +592 537 1.66666666666667e-01 +592 476 8.33333333333333e-02 +592 473 -8.33333333333333e-02 +592 471 -8.33333333333333e-02 +592 474 8.33333333333333e-02 +592 1037 -8.33333333333333e-02 +592 1008 8.33333333333333e-02 +592 1035 -8.33333333333333e-02 +592 1031 8.33333333333333e-02 +592 1004 -8.33333333333333e-02 +592 1029 -1.66666666666667e-01 +592 1010 8.33333333333333e-02 +592 1003 -2.50000000000000e-01 +592 1002 1.66666666666667e-01 +593 593 2.50000000000000e+00 +593 596 -7.50000000000000e-01 +593 595 1.66666666666667e-01 +593 594 1.66666666666667e-01 +593 601 -1.66666666666667e-01 +593 591 -3.33333333333333e-01 +593 189 1.66666666666667e-01 +593 86 -2.50000000000000e-01 +593 191 -7.50000000000000e-01 +593 85 1.66666666666667e-01 +593 592 -3.33333333333333e-01 +593 190 1.66666666666667e-01 +593 84 -8.33333333333333e-02 +593 600 8.33333333333333e-02 +593 83 -2.50000000000000e-01 +593 82 1.66666666666667e-01 +593 187 -1.66666666666667e-01 +593 81 -8.33333333333333e-02 +593 186 8.33333333333333e-02 +593 534 8.33333333333333e-02 +593 535 8.33333333333333e-02 +593 539 -2.50000000000000e-01 +593 538 -8.33333333333333e-02 +593 537 1.66666666666667e-01 +593 475 8.33333333333333e-02 +593 472 -8.33333333333333e-02 +593 471 -8.33333333333333e-02 +593 474 -1.66666666666667e-01 +593 1035 -8.33333333333333e-02 +593 1009 8.33333333333333e-02 +593 1036 -8.33333333333333e-02 +593 1008 -1.66666666666667e-01 +593 1030 8.33333333333333e-02 +593 1003 -8.33333333333333e-02 +593 1002 1.66666666666667e-01 +593 1029 8.33333333333333e-02 +593 1004 -2.50000000000000e-01 +594 594 2.50000000000000e+00 +594 601 1.66666666666667e-01 +594 593 1.66666666666667e-01 +594 596 -3.33333333333333e-01 +594 82 8.33333333333333e-02 +594 592 -8.33333333333333e-02 +594 591 -2.50000000000000e-01 +594 127 8.33333333333333e-02 +594 600 -2.50000000000000e-01 +594 274 -8.33333333333333e-02 +594 275 1.66666666666667e-01 +594 128 8.33333333333333e-02 +594 273 -2.50000000000000e-01 +594 269 -8.33333333333333e-02 +594 83 8.33333333333333e-02 +594 595 -3.33333333333333e-01 +594 268 1.66666666666667e-01 +594 602 -8.33333333333333e-02 +594 267 -2.50000000000000e-01 +594 539 -1.66666666666667e-01 +594 538 8.33333333333333e-02 +594 536 -8.33333333333333e-02 +594 266 8.33333333333333e-02 +594 547 1.66666666666667e-01 +594 265 -1.66666666666667e-01 +594 535 -8.33333333333333e-02 +594 548 1.66666666666667e-01 +594 546 -7.50000000000000e-01 +594 1037 8.33333333333333e-02 +594 1036 -1.66666666666667e-01 +594 1010 1.66666666666667e-01 +594 872 -1.66666666666667e-01 +594 1246 -8.33333333333333e-02 +594 871 8.33333333333333e-02 +594 1247 -8.33333333333333e-02 +594 1009 1.66666666666667e-01 +594 1008 -7.50000000000000e-01 +595 595 2.50000000000000e+00 +595 593 1.66666666666667e-01 +595 592 -2.50000000000000e-01 +595 81 8.33333333333333e-02 +595 591 -8.33333333333333e-02 +595 602 1.66666666666667e-01 +595 601 -7.50000000000000e-01 +595 126 8.33333333333333e-02 +595 596 -3.33333333333333e-01 +595 273 -8.33333333333333e-02 +595 128 -1.66666666666667e-01 +595 275 1.66666666666667e-01 +595 274 -2.50000000000000e-01 +595 269 1.66666666666667e-01 +595 83 -1.66666666666667e-01 +595 600 1.66666666666667e-01 +595 268 -7.50000000000000e-01 +595 594 -3.33333333333333e-01 +595 267 1.66666666666667e-01 +595 539 8.33333333333333e-02 +595 537 8.33333333333333e-02 +595 548 -8.33333333333333e-02 +595 536 -8.33333333333333e-02 +595 266 8.33333333333333e-02 +595 546 1.66666666666667e-01 +595 264 -1.66666666666667e-01 +595 534 -8.33333333333333e-02 +595 547 -2.50000000000000e-01 +595 1037 8.33333333333333e-02 +595 1035 -1.66666666666667e-01 +595 1010 -8.33333333333333e-02 +595 1247 -8.33333333333333e-02 +595 872 8.33333333333333e-02 +595 1245 -8.33333333333333e-02 +595 870 8.33333333333333e-02 +595 1009 -2.50000000000000e-01 +595 1008 1.66666666666667e-01 +596 596 2.50000000000000e+00 +596 593 -7.50000000000000e-01 +596 592 1.66666666666667e-01 +596 591 1.66666666666667e-01 +596 594 -3.33333333333333e-01 +596 602 -2.50000000000000e-01 +596 601 1.66666666666667e-01 +596 595 -3.33333333333333e-01 +596 273 1.66666666666667e-01 +596 275 -7.50000000000000e-01 +596 127 -1.66666666666667e-01 +596 274 1.66666666666667e-01 +596 126 8.33333333333333e-02 +596 600 -8.33333333333333e-02 +596 269 -2.50000000000000e-01 +596 268 1.66666666666667e-01 +596 82 -1.66666666666667e-01 +596 267 -8.33333333333333e-02 +596 81 8.33333333333333e-02 +596 538 8.33333333333333e-02 +596 537 -1.66666666666667e-01 +596 547 -8.33333333333333e-02 +596 535 -8.33333333333333e-02 +596 265 8.33333333333333e-02 +596 534 -8.33333333333333e-02 +596 264 8.33333333333333e-02 +596 548 -2.50000000000000e-01 +596 546 1.66666666666667e-01 +596 1036 8.33333333333333e-02 +596 1035 8.33333333333333e-02 +596 1009 -8.33333333333333e-02 +596 1246 -8.33333333333333e-02 +596 871 8.33333333333333e-02 +596 1008 1.66666666666667e-01 +596 870 -1.66666666666667e-01 +596 1245 -8.33333333333333e-02 +596 1010 -2.50000000000000e-01 +597 597 2.50000000000000e+00 +597 599 -3.33333333333333e-01 +597 589 -8.33333333333333e-02 +597 586 8.33333333333333e-02 +597 107 -8.33333333333333e-02 +597 106 1.66666666666667e-01 +597 588 -2.50000000000000e-01 +597 587 8.33333333333333e-02 +597 86 -8.33333333333333e-02 +597 598 -3.33333333333333e-01 +597 85 1.66666666666667e-01 +597 323 8.33333333333333e-02 +597 322 8.33333333333333e-02 +597 105 -2.50000000000000e-01 +597 317 1.66666666666667e-01 +597 316 -8.33333333333333e-02 +597 315 -2.50000000000000e-01 +597 590 1.66666666666667e-01 +597 84 -2.50000000000000e-01 +597 511 8.33333333333333e-02 +597 502 -8.33333333333333e-02 +597 503 -8.33333333333333e-02 +597 512 -1.66666666666667e-01 +597 575 1.66666666666667e-01 +597 569 8.33333333333333e-02 +597 568 -1.66666666666667e-01 +597 574 1.66666666666667e-01 +597 573 -7.50000000000000e-01 +597 1034 1.66666666666667e-01 +597 1211 8.33333333333333e-02 +597 1210 -1.66666666666667e-01 +597 1033 1.66666666666667e-01 +597 1032 -7.50000000000000e-01 +597 1214 -8.33333333333333e-02 +597 1213 -8.33333333333333e-02 +597 1040 -1.66666666666667e-01 +597 1039 8.33333333333333e-02 +598 598 2.50000000000000e+00 +598 588 -8.33333333333333e-02 +598 585 8.33333333333333e-02 +598 590 1.66666666666667e-01 +598 589 -2.50000000000000e-01 +598 105 1.66666666666667e-01 +598 587 -1.66666666666667e-01 +598 597 -3.33333333333333e-01 +598 84 1.66666666666667e-01 +598 323 -1.66666666666667e-01 +598 107 1.66666666666667e-01 +598 106 -7.50000000000000e-01 +598 321 8.33333333333333e-02 +598 317 1.66666666666667e-01 +598 599 -3.33333333333333e-01 +598 86 1.66666666666667e-01 +598 316 -2.50000000000000e-01 +598 85 -7.50000000000000e-01 +598 315 -8.33333333333333e-02 +598 510 8.33333333333333e-02 +598 501 -8.33333333333333e-02 +598 512 8.33333333333333e-02 +598 503 -8.33333333333333e-02 +598 575 -8.33333333333333e-02 +598 569 8.33333333333333e-02 +598 567 -1.66666666666667e-01 +598 574 -2.50000000000000e-01 +598 573 1.66666666666667e-01 +598 1034 -8.33333333333333e-02 +598 1209 -1.66666666666667e-01 +598 1033 -2.50000000000000e-01 +598 1032 1.66666666666667e-01 +598 1214 -8.33333333333333e-02 +598 1040 8.33333333333333e-02 +598 1212 -8.33333333333333e-02 +598 1211 8.33333333333333e-02 +598 1038 8.33333333333333e-02 +599 599 2.50000000000000e+00 +599 588 1.66666666666667e-01 +599 597 -3.33333333333333e-01 +599 590 -7.50000000000000e-01 +599 589 1.66666666666667e-01 +599 105 -8.33333333333333e-02 +599 586 -1.66666666666667e-01 +599 585 8.33333333333333e-02 +599 84 -8.33333333333333e-02 +599 321 8.33333333333333e-02 +599 107 -2.50000000000000e-01 +599 322 -1.66666666666667e-01 +599 106 1.66666666666667e-01 +599 317 -7.50000000000000e-01 +599 86 -2.50000000000000e-01 +599 316 1.66666666666667e-01 +599 598 -3.33333333333333e-01 +599 85 1.66666666666667e-01 +599 315 1.66666666666667e-01 +599 501 -8.33333333333333e-02 +599 511 8.33333333333333e-02 +599 510 -1.66666666666667e-01 +599 502 -8.33333333333333e-02 +599 574 -8.33333333333333e-02 +599 568 8.33333333333333e-02 +599 573 1.66666666666667e-01 +599 567 8.33333333333333e-02 +599 575 -2.50000000000000e-01 +599 1033 -8.33333333333333e-02 +599 1032 1.66666666666667e-01 +599 1209 8.33333333333333e-02 +599 1034 -2.50000000000000e-01 +599 1212 -8.33333333333333e-02 +599 1213 -8.33333333333333e-02 +599 1039 8.33333333333333e-02 +599 1210 8.33333333333333e-02 +599 1038 -1.66666666666667e-01 +600 600 2.50000000000000e+00 +600 593 8.33333333333333e-02 +600 601 -3.33333333333333e-01 +600 595 1.66666666666667e-01 +600 592 8.33333333333333e-02 +600 85 -8.33333333333333e-02 +600 127 -8.33333333333333e-02 +600 594 -2.50000000000000e-01 +600 128 1.66666666666667e-01 +600 602 -3.33333333333333e-01 +600 86 1.66666666666667e-01 +600 328 8.33333333333333e-02 +600 329 8.33333333333333e-02 +600 126 -2.50000000000000e-01 +600 317 -8.33333333333333e-02 +600 316 1.66666666666667e-01 +600 315 -2.50000000000000e-01 +600 596 -8.33333333333333e-02 +600 84 -2.50000000000000e-01 +600 538 -8.33333333333333e-02 +600 548 8.33333333333333e-02 +600 547 -1.66666666666667e-01 +600 539 -8.33333333333333e-02 +600 580 1.66666666666667e-01 +600 569 -1.66666666666667e-01 +600 568 8.33333333333333e-02 +600 581 1.66666666666667e-01 +600 579 -7.50000000000000e-01 +600 1246 8.33333333333333e-02 +600 1247 -1.66666666666667e-01 +600 1037 1.66666666666667e-01 +600 1036 1.66666666666667e-01 +600 1035 -7.50000000000000e-01 +600 1249 -8.33333333333333e-02 +600 1250 -8.33333333333333e-02 +600 1040 8.33333333333333e-02 +600 1039 -1.66666666666667e-01 +601 601 2.50000000000000e+00 +601 594 1.66666666666667e-01 +601 593 -1.66666666666667e-01 +601 591 8.33333333333333e-02 +601 84 -8.33333333333333e-02 +601 596 1.66666666666667e-01 +601 595 -7.50000000000000e-01 +601 126 -8.33333333333333e-02 +601 327 8.33333333333333e-02 +601 329 -1.66666666666667e-01 +601 128 1.66666666666667e-01 +601 127 -2.50000000000000e-01 +601 317 1.66666666666667e-01 +601 602 -3.33333333333333e-01 +601 86 1.66666666666667e-01 +601 316 -7.50000000000000e-01 +601 600 -3.33333333333333e-01 +601 85 -2.50000000000000e-01 +601 315 1.66666666666667e-01 +601 537 -8.33333333333333e-02 +601 548 8.33333333333333e-02 +601 539 -8.33333333333333e-02 +601 546 -1.66666666666667e-01 +601 569 8.33333333333333e-02 +601 581 -8.33333333333333e-02 +601 579 1.66666666666667e-01 +601 567 8.33333333333333e-02 +601 580 -2.50000000000000e-01 +601 1245 8.33333333333333e-02 +601 1247 8.33333333333333e-02 +601 1037 -8.33333333333333e-02 +601 1036 -2.50000000000000e-01 +601 1035 1.66666666666667e-01 +601 1040 8.33333333333333e-02 +601 1250 -8.33333333333333e-02 +601 1248 -8.33333333333333e-02 +601 1038 -1.66666666666667e-01 +602 602 2.50000000000000e+00 +602 591 8.33333333333333e-02 +602 592 -1.66666666666667e-01 +602 596 -2.50000000000000e-01 +602 595 1.66666666666667e-01 +602 126 1.66666666666667e-01 +602 600 -3.33333333333333e-01 +602 84 1.66666666666667e-01 +602 128 -7.50000000000000e-01 +602 328 -1.66666666666667e-01 +602 127 1.66666666666667e-01 +602 327 8.33333333333333e-02 +602 317 -2.50000000000000e-01 +602 594 -8.33333333333333e-02 +602 86 -7.50000000000000e-01 +602 316 1.66666666666667e-01 +602 601 -3.33333333333333e-01 +602 85 1.66666666666667e-01 +602 315 -8.33333333333333e-02 +602 538 -8.33333333333333e-02 +602 546 8.33333333333333e-02 +602 537 -8.33333333333333e-02 +602 568 8.33333333333333e-02 +602 580 -8.33333333333333e-02 +602 567 -1.66666666666667e-01 +602 547 8.33333333333333e-02 +602 581 -2.50000000000000e-01 +602 579 1.66666666666667e-01 +602 1246 8.33333333333333e-02 +602 1245 -1.66666666666667e-01 +602 1037 -2.50000000000000e-01 +602 1036 -8.33333333333333e-02 +602 1035 1.66666666666667e-01 +602 1039 8.33333333333333e-02 +602 1249 -8.33333333333333e-02 +602 1248 -8.33333333333333e-02 +602 1038 8.33333333333333e-02 +603 603 1.25000000000000e+00 +603 383 -8.33333333333333e-02 +603 604 -1.66666666666667e-01 +603 607 8.33333333333333e-02 +603 382 1.66666666666667e-01 +603 608 8.33333333333333e-02 +603 88 -4.16666666666667e-02 +603 379 8.33333333333333e-02 +603 606 -3.75000000000000e-01 +603 617 -8.33333333333333e-02 +603 616 4.16666666666667e-02 +603 94 -4.16666666666667e-02 +603 381 -2.50000000000000e-01 +603 196 4.16666666666667e-02 +603 361 -8.33333333333333e-02 +603 362 -8.33333333333333e-02 +603 368 8.33333333333333e-02 +603 89 8.33333333333333e-02 +603 197 -8.33333333333333e-02 +603 87 -1.25000000000000e-01 +603 605 -1.66666666666667e-01 +603 203 8.33333333333333e-02 +603 95 8.33333333333333e-02 +603 202 8.33333333333333e-02 +603 367 -1.66666666666667e-01 +603 380 8.33333333333333e-02 +603 201 -3.75000000000000e-01 +603 93 -1.25000000000000e-01 +604 604 1.25000000000000e+00 +604 617 4.16666666666667e-02 +604 603 -1.66666666666667e-01 +604 606 8.33333333333333e-02 +604 381 1.66666666666667e-01 +604 89 8.33333333333333e-02 +604 380 -1.66666666666667e-01 +604 607 -1.25000000000000e-01 +604 87 -4.16666666666667e-02 +604 378 8.33333333333333e-02 +604 605 -1.66666666666667e-01 +604 383 1.66666666666667e-01 +604 95 8.33333333333333e-02 +604 382 -7.50000000000000e-01 +604 615 4.16666666666667e-02 +604 93 -4.16666666666667e-02 +604 195 4.16666666666667e-02 +604 360 -8.33333333333333e-02 +604 197 4.16666666666667e-02 +604 362 -8.33333333333333e-02 +604 88 -1.25000000000000e-01 +604 203 -4.16666666666667e-02 +604 368 8.33333333333333e-02 +604 608 -4.16666666666667e-02 +604 202 -1.25000000000000e-01 +604 94 -1.25000000000000e-01 +604 201 8.33333333333333e-02 +604 366 -1.66666666666667e-01 +605 605 1.25000000000000e+00 +605 381 -8.33333333333333e-02 +605 607 -4.16666666666667e-02 +605 616 4.16666666666667e-02 +605 608 -1.25000000000000e-01 +605 88 8.33333333333333e-02 +605 379 -1.66666666666667e-01 +605 606 8.33333333333333e-02 +605 383 -2.50000000000000e-01 +605 604 -1.66666666666667e-01 +605 382 1.66666666666667e-01 +605 94 8.33333333333333e-02 +605 615 -8.33333333333333e-02 +605 360 -8.33333333333333e-02 +605 366 8.33333333333333e-02 +605 89 -3.75000000000000e-01 +605 196 4.16666666666667e-02 +605 361 -8.33333333333333e-02 +605 87 8.33333333333333e-02 +605 195 -8.33333333333333e-02 +605 378 8.33333333333333e-02 +605 203 -1.25000000000000e-01 +605 95 -3.75000000000000e-01 +605 202 -4.16666666666667e-02 +605 367 8.33333333333333e-02 +605 603 -1.66666666666667e-01 +605 201 8.33333333333333e-02 +605 93 8.33333333333333e-02 +606 606 1.25000000000000e+00 +606 604 8.33333333333333e-02 +606 382 -1.66666666666667e-01 +606 605 8.33333333333333e-02 +606 88 4.16666666666667e-02 +606 603 -3.75000000000000e-01 +606 617 8.33333333333333e-02 +606 100 4.16666666666667e-02 +606 616 -4.16666666666667e-02 +606 615 -1.25000000000000e-01 +606 379 -8.33333333333333e-02 +606 380 -8.33333333333333e-02 +606 608 -1.66666666666667e-01 +606 211 -4.16666666666667e-02 +606 205 8.33333333333333e-02 +606 206 8.33333333333333e-02 +606 386 -8.33333333333333e-02 +606 212 8.33333333333333e-02 +606 89 -8.33333333333333e-02 +606 210 -1.25000000000000e-01 +606 218 8.33333333333333e-02 +606 101 -8.33333333333333e-02 +606 217 8.33333333333333e-02 +606 607 -1.66666666666667e-01 +606 385 1.66666666666667e-01 +606 216 -3.75000000000000e-01 +606 383 8.33333333333333e-02 +606 384 -2.50000000000000e-01 +607 607 1.25000000000000e+00 +607 383 8.33333333333333e-02 +607 603 8.33333333333333e-02 +607 381 -1.66666666666667e-01 +607 604 -1.25000000000000e-01 +607 87 4.16666666666667e-02 +607 608 -1.66666666666667e-01 +607 617 8.33333333333333e-02 +607 616 -1.25000000000000e-01 +607 99 4.16666666666667e-02 +607 615 -4.16666666666667e-02 +607 378 -8.33333333333333e-02 +607 212 8.33333333333333e-02 +607 210 -4.16666666666667e-02 +607 204 8.33333333333333e-02 +607 206 -1.66666666666667e-01 +607 386 1.66666666666667e-01 +607 89 4.16666666666667e-02 +607 380 -8.33333333333333e-02 +607 211 -1.25000000000000e-01 +607 218 -4.16666666666667e-02 +607 101 4.16666666666667e-02 +607 217 -1.25000000000000e-01 +607 605 -4.16666666666667e-02 +607 385 -7.50000000000000e-01 +607 216 8.33333333333333e-02 +607 606 -1.66666666666667e-01 +607 384 1.66666666666667e-01 +608 608 1.25000000000000e+00 +608 604 -4.16666666666667e-02 +608 382 8.33333333333333e-02 +608 605 -1.25000000000000e-01 +608 603 8.33333333333333e-02 +608 617 -3.75000000000000e-01 +608 607 -1.66666666666667e-01 +608 616 8.33333333333333e-02 +608 615 8.33333333333333e-02 +608 378 -8.33333333333333e-02 +608 211 8.33333333333333e-02 +608 606 -1.66666666666667e-01 +608 205 -1.66666666666667e-01 +608 385 1.66666666666667e-01 +608 204 8.33333333333333e-02 +608 384 -8.33333333333333e-02 +608 212 -3.75000000000000e-01 +608 88 4.16666666666667e-02 +608 379 -8.33333333333333e-02 +608 210 8.33333333333333e-02 +608 87 -8.33333333333333e-02 +608 218 -1.25000000000000e-01 +608 381 8.33333333333333e-02 +608 386 -2.50000000000000e-01 +608 217 -4.16666666666667e-02 +608 100 4.16666666666667e-02 +608 216 8.33333333333333e-02 +608 99 -8.33333333333333e-02 +609 609 1.25000000000000e+00 +609 619 4.16666666666667e-02 +609 620 -8.33333333333333e-02 +609 614 8.33333333333333e-02 +609 612 -1.25000000000000e-01 +609 431 -8.33333333333333e-02 +609 94 8.33333333333333e-02 +609 610 -1.66666666666667e-01 +609 430 1.66666666666667e-01 +609 429 -2.50000000000000e-01 +609 428 8.33333333333333e-02 +609 91 8.33333333333333e-02 +609 427 -1.66666666666667e-01 +609 368 8.33333333333333e-02 +609 365 -8.33333333333333e-02 +609 92 8.33333333333333e-02 +609 200 -8.33333333333333e-02 +609 199 4.16666666666667e-02 +609 364 -8.33333333333333e-02 +609 90 -3.75000000000000e-01 +609 611 -1.66666666666667e-01 +609 203 8.33333333333333e-02 +609 95 8.33333333333333e-02 +609 202 -4.16666666666667e-02 +609 367 8.33333333333333e-02 +609 613 -4.16666666666667e-02 +609 201 -1.25000000000000e-01 +609 93 -3.75000000000000e-01 +610 610 1.25000000000000e+00 +610 611 -1.66666666666667e-01 +610 612 -4.16666666666667e-02 +610 618 4.16666666666667e-02 +610 95 -4.16666666666667e-02 +610 620 4.16666666666667e-02 +610 92 -4.16666666666667e-02 +610 613 -1.25000000000000e-01 +610 428 8.33333333333333e-02 +610 431 1.66666666666667e-01 +610 430 -7.50000000000000e-01 +610 93 8.33333333333333e-02 +610 609 -1.66666666666667e-01 +610 429 1.66666666666667e-01 +610 90 8.33333333333333e-02 +610 426 -1.66666666666667e-01 +610 200 4.16666666666667e-02 +610 365 -8.33333333333333e-02 +610 91 -1.25000000000000e-01 +610 198 4.16666666666667e-02 +610 363 -8.33333333333333e-02 +610 203 8.33333333333333e-02 +610 368 -1.66666666666667e-01 +610 614 8.33333333333333e-02 +610 202 -1.25000000000000e-01 +610 94 -1.25000000000000e-01 +610 201 -4.16666666666667e-02 +610 366 8.33333333333333e-02 +611 611 1.25000000000000e+00 +611 610 -1.66666666666667e-01 +611 94 -4.16666666666667e-02 +611 619 4.16666666666667e-02 +611 618 -8.33333333333333e-02 +611 614 -3.75000000000000e-01 +611 91 -4.16666666666667e-02 +611 612 8.33333333333333e-02 +611 427 8.33333333333333e-02 +611 431 -2.50000000000000e-01 +611 430 1.66666666666667e-01 +611 429 -8.33333333333333e-02 +611 426 8.33333333333333e-02 +611 366 8.33333333333333e-02 +611 363 -8.33333333333333e-02 +611 199 4.16666666666667e-02 +611 364 -8.33333333333333e-02 +611 92 -1.25000000000000e-01 +611 90 8.33333333333333e-02 +611 198 -8.33333333333333e-02 +611 613 8.33333333333333e-02 +611 203 -3.75000000000000e-01 +611 95 -1.25000000000000e-01 +611 202 8.33333333333333e-02 +611 367 -1.66666666666667e-01 +611 609 -1.66666666666667e-01 +611 201 8.33333333333333e-02 +611 93 8.33333333333333e-02 +612 612 1.25000000000000e+00 +612 431 8.33333333333333e-02 +612 430 8.33333333333333e-02 +612 620 8.33333333333333e-02 +612 619 8.33333333333333e-02 +612 613 -1.66666666666667e-01 +612 618 -3.75000000000000e-01 +612 611 8.33333333333333e-02 +612 609 -1.25000000000000e-01 +612 440 -8.33333333333333e-02 +612 614 -1.66666666666667e-01 +612 428 -8.33333333333333e-02 +612 278 8.33333333333333e-02 +612 280 8.33333333333333e-02 +612 439 1.66666666666667e-01 +612 277 -1.66666666666667e-01 +612 281 8.33333333333333e-02 +612 92 -8.33333333333333e-02 +612 91 4.16666666666667e-02 +612 427 -8.33333333333333e-02 +612 279 -3.75000000000000e-01 +612 287 8.33333333333333e-02 +612 131 -8.33333333333333e-02 +612 286 -4.16666666666667e-02 +612 130 4.16666666666667e-02 +612 285 -1.25000000000000e-01 +612 610 -4.16666666666667e-02 +612 438 -2.50000000000000e-01 +613 613 1.25000000000000e+00 +613 609 -4.16666666666667e-02 +613 431 -1.66666666666667e-01 +613 429 8.33333333333333e-02 +613 620 -4.16666666666667e-02 +613 131 4.16666666666667e-02 +613 619 -1.25000000000000e-01 +613 618 8.33333333333333e-02 +613 612 -1.66666666666667e-01 +613 92 4.16666666666667e-02 +613 610 -1.25000000000000e-01 +613 281 -4.16666666666667e-02 +613 279 8.33333333333333e-02 +613 428 -8.33333333333333e-02 +613 278 8.33333333333333e-02 +613 438 1.66666666666667e-01 +613 276 -1.66666666666667e-01 +613 280 -1.25000000000000e-01 +613 90 4.16666666666667e-02 +613 426 -8.33333333333333e-02 +613 287 8.33333333333333e-02 +613 614 -1.66666666666667e-01 +613 440 1.66666666666667e-01 +613 286 -1.25000000000000e-01 +613 611 8.33333333333333e-02 +613 439 -7.50000000000000e-01 +613 285 -4.16666666666667e-02 +613 129 4.16666666666667e-02 +614 614 1.25000000000000e+00 +614 429 8.33333333333333e-02 +614 430 -1.66666666666667e-01 +614 620 -1.25000000000000e-01 +614 619 -4.16666666666667e-02 +614 130 4.16666666666667e-02 +614 618 8.33333333333333e-02 +614 611 -3.75000000000000e-01 +614 91 4.16666666666667e-02 +614 609 8.33333333333333e-02 +614 438 -8.33333333333333e-02 +614 280 -4.16666666666667e-02 +614 612 -1.66666666666667e-01 +614 426 -8.33333333333333e-02 +614 276 8.33333333333333e-02 +614 427 -8.33333333333333e-02 +614 277 8.33333333333333e-02 +614 281 -1.25000000000000e-01 +614 279 8.33333333333333e-02 +614 90 -8.33333333333333e-02 +614 287 -3.75000000000000e-01 +614 610 8.33333333333333e-02 +614 440 -2.50000000000000e-01 +614 286 8.33333333333333e-02 +614 613 -1.66666666666667e-01 +614 439 1.66666666666667e-01 +614 285 8.33333333333333e-02 +614 129 -8.33333333333333e-02 +615 615 1.25000000000000e+00 +615 607 -4.16666666666667e-02 +615 606 -1.25000000000000e-01 +615 605 -8.33333333333333e-02 +615 604 4.16666666666667e-02 +615 385 8.33333333333333e-02 +615 382 -8.33333333333333e-02 +615 386 8.33333333333333e-02 +615 383 -8.33333333333333e-02 +615 446 8.33333333333333e-02 +615 449 -8.33333333333333e-02 +615 298 4.16666666666667e-02 +615 295 -4.16666666666667e-02 +615 101 8.33333333333333e-02 +615 299 -8.33333333333333e-02 +615 100 8.33333333333333e-02 +615 616 -1.66666666666667e-01 +615 448 1.66666666666667e-01 +615 99 -3.75000000000000e-01 +615 447 -2.50000000000000e-01 +615 617 -1.66666666666667e-01 +615 95 8.33333333333333e-02 +615 296 8.33333333333333e-02 +615 94 8.33333333333333e-02 +615 445 -1.66666666666667e-01 +615 608 8.33333333333333e-02 +615 93 -3.75000000000000e-01 +615 294 -1.25000000000000e-01 +616 616 1.25000000000000e+00 +616 608 8.33333333333333e-02 +616 607 -1.25000000000000e-01 +616 606 -4.16666666666667e-02 +616 603 4.16666666666667e-02 +616 384 8.33333333333333e-02 +616 381 -8.33333333333333e-02 +616 383 -8.33333333333333e-02 +616 386 -1.66666666666667e-01 +616 617 -1.66666666666667e-01 +616 449 1.66666666666667e-01 +616 296 8.33333333333333e-02 +616 297 4.16666666666667e-02 +616 294 -4.16666666666667e-02 +616 101 -4.16666666666667e-02 +616 299 4.16666666666667e-02 +616 100 -1.25000000000000e-01 +616 448 -7.50000000000000e-01 +616 99 8.33333333333333e-02 +616 615 -1.66666666666667e-01 +616 447 1.66666666666667e-01 +616 95 -4.16666666666667e-02 +616 446 8.33333333333333e-02 +616 605 4.16666666666667e-02 +616 94 -1.25000000000000e-01 +616 295 -1.25000000000000e-01 +616 93 8.33333333333333e-02 +616 444 -1.66666666666667e-01 +617 617 1.25000000000000e+00 +617 608 -3.75000000000000e-01 +617 607 8.33333333333333e-02 +617 606 8.33333333333333e-02 +617 603 -8.33333333333333e-02 +617 382 -8.33333333333333e-02 +617 385 -1.66666666666667e-01 +617 384 8.33333333333333e-02 +617 381 -8.33333333333333e-02 +617 444 8.33333333333333e-02 +617 447 -8.33333333333333e-02 +617 616 -1.66666666666667e-01 +617 448 1.66666666666667e-01 +617 295 8.33333333333333e-02 +617 101 -1.25000000000000e-01 +617 449 -2.50000000000000e-01 +617 100 -4.16666666666667e-02 +617 298 4.16666666666667e-02 +617 99 8.33333333333333e-02 +617 297 -8.33333333333333e-02 +617 604 4.16666666666667e-02 +617 95 -1.25000000000000e-01 +617 296 -3.75000000000000e-01 +617 94 -4.16666666666667e-02 +617 445 8.33333333333333e-02 +617 615 -1.66666666666667e-01 +617 93 8.33333333333333e-02 +617 294 8.33333333333333e-02 +618 618 1.25000000000000e+00 +618 430 -8.33333333333333e-02 +618 440 8.33333333333333e-02 +618 431 -8.33333333333333e-02 +618 611 -8.33333333333333e-02 +618 614 8.33333333333333e-02 +618 613 8.33333333333333e-02 +618 439 -1.66666666666667e-01 +618 612 -3.75000000000000e-01 +618 446 8.33333333333333e-02 +618 458 -8.33333333333333e-02 +618 295 8.33333333333333e-02 +618 619 -1.66666666666667e-01 +618 457 1.66666666666667e-01 +618 131 8.33333333333333e-02 +618 308 -8.33333333333333e-02 +618 130 -4.16666666666667e-02 +618 307 4.16666666666667e-02 +618 129 -1.25000000000000e-01 +618 456 -2.50000000000000e-01 +618 620 -1.66666666666667e-01 +618 95 8.33333333333333e-02 +618 296 8.33333333333333e-02 +618 94 -4.16666666666667e-02 +618 445 8.33333333333333e-02 +618 610 4.16666666666667e-02 +618 93 -1.25000000000000e-01 +618 294 -3.75000000000000e-01 +619 619 1.25000000000000e+00 +619 429 -8.33333333333333e-02 +619 611 4.16666666666667e-02 +619 431 -8.33333333333333e-02 +619 614 -4.16666666666667e-02 +619 440 8.33333333333333e-02 +619 613 -1.25000000000000e-01 +619 612 8.33333333333333e-02 +619 438 -1.66666666666667e-01 +619 296 -4.16666666666667e-02 +619 308 4.16666666666667e-02 +619 294 8.33333333333333e-02 +619 618 -1.66666666666667e-01 +619 456 1.66666666666667e-01 +619 131 8.33333333333333e-02 +619 620 -1.66666666666667e-01 +619 458 1.66666666666667e-01 +619 130 -1.25000000000000e-01 +619 457 -7.50000000000000e-01 +619 129 -4.16666666666667e-02 +619 306 4.16666666666667e-02 +619 95 8.33333333333333e-02 +619 446 -1.66666666666667e-01 +619 609 4.16666666666667e-02 +619 94 -1.25000000000000e-01 +619 295 -1.25000000000000e-01 +619 93 -4.16666666666667e-02 +619 444 8.33333333333333e-02 +620 620 1.25000000000000e+00 +620 429 -8.33333333333333e-02 +620 610 4.16666666666667e-02 +620 430 -8.33333333333333e-02 +620 609 -8.33333333333333e-02 +620 614 -1.25000000000000e-01 +620 613 -4.16666666666667e-02 +620 439 8.33333333333333e-02 +620 612 8.33333333333333e-02 +620 295 -4.16666666666667e-02 +620 307 4.16666666666667e-02 +620 444 8.33333333333333e-02 +620 456 -8.33333333333333e-02 +620 131 -3.75000000000000e-01 +620 458 -2.50000000000000e-01 +620 130 8.33333333333333e-02 +620 619 -1.66666666666667e-01 +620 457 1.66666666666667e-01 +620 129 8.33333333333333e-02 +620 306 -8.33333333333333e-02 +620 438 8.33333333333333e-02 +620 95 -3.75000000000000e-01 +620 296 -1.25000000000000e-01 +620 94 8.33333333333333e-02 +620 445 -1.66666666666667e-01 +620 618 -1.66666666666667e-01 +620 93 8.33333333333333e-02 +620 294 8.33333333333333e-02 +621 621 1.25000000000000e+00 +621 509 -8.33333333333333e-02 +621 622 -1.66666666666667e-01 +621 625 8.33333333333333e-02 +621 508 1.66666666666667e-01 +621 626 8.33333333333333e-02 +621 97 -4.16666666666667e-02 +621 505 8.33333333333333e-02 +621 624 -3.75000000000000e-01 +621 635 -8.33333333333333e-02 +621 634 4.16666666666667e-02 +621 103 -4.16666666666667e-02 +621 507 -2.50000000000000e-01 +621 214 4.16666666666667e-02 +621 487 -8.33333333333333e-02 +621 488 -8.33333333333333e-02 +621 494 8.33333333333333e-02 +621 98 8.33333333333333e-02 +621 215 -8.33333333333333e-02 +621 96 -1.25000000000000e-01 +621 623 -1.66666666666667e-01 +621 221 8.33333333333333e-02 +621 104 8.33333333333333e-02 +621 220 8.33333333333333e-02 +621 493 -1.66666666666667e-01 +621 506 8.33333333333333e-02 +621 219 -3.75000000000000e-01 +621 102 -1.25000000000000e-01 +622 622 1.25000000000000e+00 +622 635 4.16666666666667e-02 +622 621 -1.66666666666667e-01 +622 624 8.33333333333333e-02 +622 507 1.66666666666667e-01 +622 98 8.33333333333333e-02 +622 506 -1.66666666666667e-01 +622 625 -1.25000000000000e-01 +622 96 -4.16666666666667e-02 +622 504 8.33333333333333e-02 +622 623 -1.66666666666667e-01 +622 509 1.66666666666667e-01 +622 104 8.33333333333333e-02 +622 508 -7.50000000000000e-01 +622 633 4.16666666666667e-02 +622 102 -4.16666666666667e-02 +622 213 4.16666666666667e-02 +622 486 -8.33333333333333e-02 +622 215 4.16666666666667e-02 +622 488 -8.33333333333333e-02 +622 97 -1.25000000000000e-01 +622 221 -4.16666666666667e-02 +622 494 8.33333333333333e-02 +622 626 -4.16666666666667e-02 +622 220 -1.25000000000000e-01 +622 103 -1.25000000000000e-01 +622 219 8.33333333333333e-02 +622 492 -1.66666666666667e-01 +623 623 1.25000000000000e+00 +623 507 -8.33333333333333e-02 +623 625 -4.16666666666667e-02 +623 634 4.16666666666667e-02 +623 626 -1.25000000000000e-01 +623 97 8.33333333333333e-02 +623 505 -1.66666666666667e-01 +623 624 8.33333333333333e-02 +623 509 -2.50000000000000e-01 +623 622 -1.66666666666667e-01 +623 508 1.66666666666667e-01 +623 103 8.33333333333333e-02 +623 633 -8.33333333333333e-02 +623 486 -8.33333333333333e-02 +623 492 8.33333333333333e-02 +623 98 -3.75000000000000e-01 +623 214 4.16666666666667e-02 +623 487 -8.33333333333333e-02 +623 96 8.33333333333333e-02 +623 213 -8.33333333333333e-02 +623 504 8.33333333333333e-02 +623 221 -1.25000000000000e-01 +623 104 -3.75000000000000e-01 +623 220 -4.16666666666667e-02 +623 493 8.33333333333333e-02 +623 621 -1.66666666666667e-01 +623 219 8.33333333333333e-02 +623 102 8.33333333333333e-02 +624 624 1.25000000000000e+00 +624 622 8.33333333333333e-02 +624 508 -1.66666666666667e-01 +624 623 8.33333333333333e-02 +624 97 4.16666666666667e-02 +624 621 -3.75000000000000e-01 +624 635 8.33333333333333e-02 +624 106 4.16666666666667e-02 +624 634 -4.16666666666667e-02 +624 633 -1.25000000000000e-01 +624 505 -8.33333333333333e-02 +624 506 -8.33333333333333e-02 +624 626 -1.66666666666667e-01 +624 229 -4.16666666666667e-02 +624 223 8.33333333333333e-02 +624 224 8.33333333333333e-02 +624 512 -8.33333333333333e-02 +624 230 8.33333333333333e-02 +624 98 -8.33333333333333e-02 +624 228 -1.25000000000000e-01 +624 233 8.33333333333333e-02 +624 107 -8.33333333333333e-02 +624 232 8.33333333333333e-02 +624 625 -1.66666666666667e-01 +624 511 1.66666666666667e-01 +624 231 -3.75000000000000e-01 +624 509 8.33333333333333e-02 +624 510 -2.50000000000000e-01 +625 625 1.25000000000000e+00 +625 509 8.33333333333333e-02 +625 621 8.33333333333333e-02 +625 507 -1.66666666666667e-01 +625 622 -1.25000000000000e-01 +625 96 4.16666666666667e-02 +625 626 -1.66666666666667e-01 +625 635 8.33333333333333e-02 +625 634 -1.25000000000000e-01 +625 105 4.16666666666667e-02 +625 633 -4.16666666666667e-02 +625 504 -8.33333333333333e-02 +625 230 8.33333333333333e-02 +625 228 -4.16666666666667e-02 +625 222 8.33333333333333e-02 +625 224 -1.66666666666667e-01 +625 512 1.66666666666667e-01 +625 98 4.16666666666667e-02 +625 506 -8.33333333333333e-02 +625 229 -1.25000000000000e-01 +625 233 -4.16666666666667e-02 +625 107 4.16666666666667e-02 +625 232 -1.25000000000000e-01 +625 623 -4.16666666666667e-02 +625 511 -7.50000000000000e-01 +625 231 8.33333333333333e-02 +625 624 -1.66666666666667e-01 +625 510 1.66666666666667e-01 +626 626 1.25000000000000e+00 +626 622 -4.16666666666667e-02 +626 508 8.33333333333333e-02 +626 623 -1.25000000000000e-01 +626 621 8.33333333333333e-02 +626 635 -3.75000000000000e-01 +626 625 -1.66666666666667e-01 +626 634 8.33333333333333e-02 +626 633 8.33333333333333e-02 +626 504 -8.33333333333333e-02 +626 229 8.33333333333333e-02 +626 624 -1.66666666666667e-01 +626 223 -1.66666666666667e-01 +626 511 1.66666666666667e-01 +626 222 8.33333333333333e-02 +626 510 -8.33333333333333e-02 +626 230 -3.75000000000000e-01 +626 97 4.16666666666667e-02 +626 505 -8.33333333333333e-02 +626 228 8.33333333333333e-02 +626 96 -8.33333333333333e-02 +626 233 -1.25000000000000e-01 +626 507 8.33333333333333e-02 +626 512 -2.50000000000000e-01 +626 232 -4.16666666666667e-02 +626 106 4.16666666666667e-02 +626 231 8.33333333333333e-02 +626 105 -8.33333333333333e-02 +627 627 1.25000000000000e+00 +627 637 4.16666666666667e-02 +627 638 -8.33333333333333e-02 +627 632 8.33333333333333e-02 +627 630 -1.25000000000000e-01 +627 557 -8.33333333333333e-02 +627 103 8.33333333333333e-02 +627 628 -1.66666666666667e-01 +627 556 1.66666666666667e-01 +627 555 -2.50000000000000e-01 +627 554 8.33333333333333e-02 +627 100 8.33333333333333e-02 +627 553 -1.66666666666667e-01 +627 494 8.33333333333333e-02 +627 491 -8.33333333333333e-02 +627 101 8.33333333333333e-02 +627 218 -8.33333333333333e-02 +627 217 4.16666666666667e-02 +627 490 -8.33333333333333e-02 +627 99 -3.75000000000000e-01 +627 629 -1.66666666666667e-01 +627 221 8.33333333333333e-02 +627 104 8.33333333333333e-02 +627 220 -4.16666666666667e-02 +627 493 8.33333333333333e-02 +627 631 -4.16666666666667e-02 +627 219 -1.25000000000000e-01 +627 102 -3.75000000000000e-01 +628 628 1.25000000000000e+00 +628 629 -1.66666666666667e-01 +628 630 -4.16666666666667e-02 +628 636 4.16666666666667e-02 +628 104 -4.16666666666667e-02 +628 638 4.16666666666667e-02 +628 101 -4.16666666666667e-02 +628 631 -1.25000000000000e-01 +628 554 8.33333333333333e-02 +628 557 1.66666666666667e-01 +628 556 -7.50000000000000e-01 +628 102 8.33333333333333e-02 +628 627 -1.66666666666667e-01 +628 555 1.66666666666667e-01 +628 99 8.33333333333333e-02 +628 552 -1.66666666666667e-01 +628 218 4.16666666666667e-02 +628 491 -8.33333333333333e-02 +628 100 -1.25000000000000e-01 +628 216 4.16666666666667e-02 +628 489 -8.33333333333333e-02 +628 221 8.33333333333333e-02 +628 494 -1.66666666666667e-01 +628 632 8.33333333333333e-02 +628 220 -1.25000000000000e-01 +628 103 -1.25000000000000e-01 +628 219 -4.16666666666667e-02 +628 492 8.33333333333333e-02 +629 629 1.25000000000000e+00 +629 628 -1.66666666666667e-01 +629 103 -4.16666666666667e-02 +629 637 4.16666666666667e-02 +629 636 -8.33333333333333e-02 +629 632 -3.75000000000000e-01 +629 100 -4.16666666666667e-02 +629 630 8.33333333333333e-02 +629 553 8.33333333333333e-02 +629 557 -2.50000000000000e-01 +629 556 1.66666666666667e-01 +629 555 -8.33333333333333e-02 +629 552 8.33333333333333e-02 +629 492 8.33333333333333e-02 +629 489 -8.33333333333333e-02 +629 217 4.16666666666667e-02 +629 490 -8.33333333333333e-02 +629 101 -1.25000000000000e-01 +629 99 8.33333333333333e-02 +629 216 -8.33333333333333e-02 +629 631 8.33333333333333e-02 +629 221 -3.75000000000000e-01 +629 104 -1.25000000000000e-01 +629 220 8.33333333333333e-02 +629 493 -1.66666666666667e-01 +629 627 -1.66666666666667e-01 +629 219 8.33333333333333e-02 +629 102 8.33333333333333e-02 +630 630 1.25000000000000e+00 +630 557 8.33333333333333e-02 +630 556 8.33333333333333e-02 +630 638 8.33333333333333e-02 +630 637 8.33333333333333e-02 +630 631 -1.66666666666667e-01 +630 636 -3.75000000000000e-01 +630 629 8.33333333333333e-02 +630 627 -1.25000000000000e-01 +630 566 -8.33333333333333e-02 +630 632 -1.66666666666667e-01 +630 554 -8.33333333333333e-02 +630 293 8.33333333333333e-02 +630 298 8.33333333333333e-02 +630 565 1.66666666666667e-01 +630 292 -1.66666666666667e-01 +630 299 8.33333333333333e-02 +630 101 -8.33333333333333e-02 +630 100 4.16666666666667e-02 +630 553 -8.33333333333333e-02 +630 297 -3.75000000000000e-01 +630 311 8.33333333333333e-02 +630 134 -8.33333333333333e-02 +630 310 -4.16666666666667e-02 +630 133 4.16666666666667e-02 +630 309 -1.25000000000000e-01 +630 628 -4.16666666666667e-02 +630 564 -2.50000000000000e-01 +631 631 1.25000000000000e+00 +631 627 -4.16666666666667e-02 +631 557 -1.66666666666667e-01 +631 555 8.33333333333333e-02 +631 638 -4.16666666666667e-02 +631 134 4.16666666666667e-02 +631 637 -1.25000000000000e-01 +631 636 8.33333333333333e-02 +631 630 -1.66666666666667e-01 +631 101 4.16666666666667e-02 +631 628 -1.25000000000000e-01 +631 299 -4.16666666666667e-02 +631 297 8.33333333333333e-02 +631 554 -8.33333333333333e-02 +631 293 8.33333333333333e-02 +631 564 1.66666666666667e-01 +631 291 -1.66666666666667e-01 +631 298 -1.25000000000000e-01 +631 99 4.16666666666667e-02 +631 552 -8.33333333333333e-02 +631 311 8.33333333333333e-02 +631 632 -1.66666666666667e-01 +631 566 1.66666666666667e-01 +631 310 -1.25000000000000e-01 +631 629 8.33333333333333e-02 +631 565 -7.50000000000000e-01 +631 309 -4.16666666666667e-02 +631 132 4.16666666666667e-02 +632 632 1.25000000000000e+00 +632 555 8.33333333333333e-02 +632 556 -1.66666666666667e-01 +632 638 -1.25000000000000e-01 +632 637 -4.16666666666667e-02 +632 133 4.16666666666667e-02 +632 636 8.33333333333333e-02 +632 629 -3.75000000000000e-01 +632 100 4.16666666666667e-02 +632 627 8.33333333333333e-02 +632 564 -8.33333333333333e-02 +632 298 -4.16666666666667e-02 +632 630 -1.66666666666667e-01 +632 552 -8.33333333333333e-02 +632 291 8.33333333333333e-02 +632 553 -8.33333333333333e-02 +632 292 8.33333333333333e-02 +632 299 -1.25000000000000e-01 +632 297 8.33333333333333e-02 +632 99 -8.33333333333333e-02 +632 311 -3.75000000000000e-01 +632 628 8.33333333333333e-02 +632 566 -2.50000000000000e-01 +632 310 8.33333333333333e-02 +632 631 -1.66666666666667e-01 +632 565 1.66666666666667e-01 +632 309 8.33333333333333e-02 +632 132 -8.33333333333333e-02 +633 633 1.25000000000000e+00 +633 625 -4.16666666666667e-02 +633 624 -1.25000000000000e-01 +633 623 -8.33333333333333e-02 +633 622 4.16666666666667e-02 +633 511 8.33333333333333e-02 +633 508 -8.33333333333333e-02 +633 512 8.33333333333333e-02 +633 509 -8.33333333333333e-02 +633 572 8.33333333333333e-02 +633 575 -8.33333333333333e-02 +633 322 4.16666666666667e-02 +633 319 -4.16666666666667e-02 +633 107 8.33333333333333e-02 +633 323 -8.33333333333333e-02 +633 106 8.33333333333333e-02 +633 634 -1.66666666666667e-01 +633 574 1.66666666666667e-01 +633 105 -3.75000000000000e-01 +633 573 -2.50000000000000e-01 +633 635 -1.66666666666667e-01 +633 104 8.33333333333333e-02 +633 320 8.33333333333333e-02 +633 103 8.33333333333333e-02 +633 571 -1.66666666666667e-01 +633 626 8.33333333333333e-02 +633 102 -3.75000000000000e-01 +633 318 -1.25000000000000e-01 +634 634 1.25000000000000e+00 +634 626 8.33333333333333e-02 +634 625 -1.25000000000000e-01 +634 624 -4.16666666666667e-02 +634 621 4.16666666666667e-02 +634 510 8.33333333333333e-02 +634 507 -8.33333333333333e-02 +634 509 -8.33333333333333e-02 +634 512 -1.66666666666667e-01 +634 635 -1.66666666666667e-01 +634 575 1.66666666666667e-01 +634 320 8.33333333333333e-02 +634 321 4.16666666666667e-02 +634 318 -4.16666666666667e-02 +634 107 -4.16666666666667e-02 +634 323 4.16666666666667e-02 +634 106 -1.25000000000000e-01 +634 574 -7.50000000000000e-01 +634 105 8.33333333333333e-02 +634 633 -1.66666666666667e-01 +634 573 1.66666666666667e-01 +634 104 -4.16666666666667e-02 +634 572 8.33333333333333e-02 +634 623 4.16666666666667e-02 +634 103 -1.25000000000000e-01 +634 319 -1.25000000000000e-01 +634 102 8.33333333333333e-02 +634 570 -1.66666666666667e-01 +635 635 1.25000000000000e+00 +635 626 -3.75000000000000e-01 +635 625 8.33333333333333e-02 +635 624 8.33333333333333e-02 +635 621 -8.33333333333333e-02 +635 508 -8.33333333333333e-02 +635 511 -1.66666666666667e-01 +635 510 8.33333333333333e-02 +635 507 -8.33333333333333e-02 +635 570 8.33333333333333e-02 +635 573 -8.33333333333333e-02 +635 634 -1.66666666666667e-01 +635 574 1.66666666666667e-01 +635 319 8.33333333333333e-02 +635 107 -1.25000000000000e-01 +635 575 -2.50000000000000e-01 +635 106 -4.16666666666667e-02 +635 322 4.16666666666667e-02 +635 105 8.33333333333333e-02 +635 321 -8.33333333333333e-02 +635 622 4.16666666666667e-02 +635 104 -1.25000000000000e-01 +635 320 -3.75000000000000e-01 +635 103 -4.16666666666667e-02 +635 571 8.33333333333333e-02 +635 633 -1.66666666666667e-01 +635 102 8.33333333333333e-02 +635 318 8.33333333333333e-02 +636 636 1.25000000000000e+00 +636 556 -8.33333333333333e-02 +636 566 8.33333333333333e-02 +636 557 -8.33333333333333e-02 +636 629 -8.33333333333333e-02 +636 632 8.33333333333333e-02 +636 631 8.33333333333333e-02 +636 565 -1.66666666666667e-01 +636 630 -3.75000000000000e-01 +636 572 8.33333333333333e-02 +636 584 -8.33333333333333e-02 +636 319 8.33333333333333e-02 +636 637 -1.66666666666667e-01 +636 583 1.66666666666667e-01 +636 134 8.33333333333333e-02 +636 332 -8.33333333333333e-02 +636 133 -4.16666666666667e-02 +636 331 4.16666666666667e-02 +636 132 -1.25000000000000e-01 +636 582 -2.50000000000000e-01 +636 638 -1.66666666666667e-01 +636 104 8.33333333333333e-02 +636 320 8.33333333333333e-02 +636 103 -4.16666666666667e-02 +636 571 8.33333333333333e-02 +636 628 4.16666666666667e-02 +636 102 -1.25000000000000e-01 +636 318 -3.75000000000000e-01 +637 637 1.25000000000000e+00 +637 555 -8.33333333333333e-02 +637 629 4.16666666666667e-02 +637 557 -8.33333333333333e-02 +637 632 -4.16666666666667e-02 +637 566 8.33333333333333e-02 +637 631 -1.25000000000000e-01 +637 630 8.33333333333333e-02 +637 564 -1.66666666666667e-01 +637 320 -4.16666666666667e-02 +637 332 4.16666666666667e-02 +637 318 8.33333333333333e-02 +637 636 -1.66666666666667e-01 +637 582 1.66666666666667e-01 +637 134 8.33333333333333e-02 +637 638 -1.66666666666667e-01 +637 584 1.66666666666667e-01 +637 133 -1.25000000000000e-01 +637 583 -7.50000000000000e-01 +637 132 -4.16666666666667e-02 +637 330 4.16666666666667e-02 +637 104 8.33333333333333e-02 +637 572 -1.66666666666667e-01 +637 627 4.16666666666667e-02 +637 103 -1.25000000000000e-01 +637 319 -1.25000000000000e-01 +637 102 -4.16666666666667e-02 +637 570 8.33333333333333e-02 +638 638 1.25000000000000e+00 +638 555 -8.33333333333333e-02 +638 628 4.16666666666667e-02 +638 556 -8.33333333333333e-02 +638 627 -8.33333333333333e-02 +638 632 -1.25000000000000e-01 +638 631 -4.16666666666667e-02 +638 565 8.33333333333333e-02 +638 630 8.33333333333333e-02 +638 319 -4.16666666666667e-02 +638 331 4.16666666666667e-02 +638 570 8.33333333333333e-02 +638 582 -8.33333333333333e-02 +638 134 -3.75000000000000e-01 +638 584 -2.50000000000000e-01 +638 133 8.33333333333333e-02 +638 637 -1.66666666666667e-01 +638 583 1.66666666666667e-01 +638 132 8.33333333333333e-02 +638 330 -8.33333333333333e-02 +638 564 8.33333333333333e-02 +638 104 -3.75000000000000e-01 +638 320 -1.25000000000000e-01 +638 103 8.33333333333333e-02 +638 571 -1.66666666666667e-01 +638 636 -1.66666666666667e-01 +638 102 8.33333333333333e-02 +638 318 8.33333333333333e-02 +639 639 1.25000000000000e+00 +639 418 -8.33333333333333e-02 +639 644 8.33333333333333e-02 +639 641 -1.66666666666667e-01 +639 419 1.66666666666667e-01 +639 416 8.33333333333333e-02 +639 110 -4.16666666666667e-02 +639 643 8.33333333333333e-02 +639 642 -3.75000000000000e-01 +639 653 4.16666666666667e-02 +639 116 -4.16666666666667e-02 +639 652 -8.33333333333333e-02 +639 417 -2.50000000000000e-01 +639 398 -8.33333333333333e-02 +639 239 4.16666666666667e-02 +639 397 -8.33333333333333e-02 +639 403 8.33333333333333e-02 +639 238 -8.33333333333333e-02 +639 109 8.33333333333333e-02 +639 108 -1.25000000000000e-01 +639 245 8.33333333333333e-02 +639 404 -1.66666666666667e-01 +639 244 8.33333333333333e-02 +639 640 -1.66666666666667e-01 +639 115 8.33333333333333e-02 +639 243 -3.75000000000000e-01 +639 415 8.33333333333333e-02 +639 114 -1.25000000000000e-01 +640 640 1.25000000000000e+00 +640 417 -8.33333333333333e-02 +640 644 -4.16666666666667e-02 +640 653 4.16666666666667e-02 +640 416 -1.66666666666667e-01 +640 110 8.33333333333333e-02 +640 643 -1.25000000000000e-01 +640 642 8.33333333333333e-02 +640 419 1.66666666666667e-01 +640 641 -1.66666666666667e-01 +640 116 8.33333333333333e-02 +640 418 -2.50000000000000e-01 +640 651 -8.33333333333333e-02 +640 396 -8.33333333333333e-02 +640 402 8.33333333333333e-02 +640 239 4.16666666666667e-02 +640 398 -8.33333333333333e-02 +640 109 -3.75000000000000e-01 +640 237 -8.33333333333333e-02 +640 108 8.33333333333333e-02 +640 245 -4.16666666666667e-02 +640 404 8.33333333333333e-02 +640 244 -1.25000000000000e-01 +640 414 8.33333333333333e-02 +640 115 -3.75000000000000e-01 +640 243 8.33333333333333e-02 +640 639 -1.66666666666667e-01 +640 114 8.33333333333333e-02 +641 641 1.25000000000000e+00 +641 652 4.16666666666667e-02 +641 642 8.33333333333333e-02 +641 639 -1.66666666666667e-01 +641 417 1.66666666666667e-01 +641 644 -1.25000000000000e-01 +641 415 -1.66666666666667e-01 +641 109 8.33333333333333e-02 +641 414 8.33333333333333e-02 +641 108 -4.16666666666667e-02 +641 419 -7.50000000000000e-01 +641 418 1.66666666666667e-01 +641 640 -1.66666666666667e-01 +641 115 8.33333333333333e-02 +641 651 4.16666666666667e-02 +641 114 -4.16666666666667e-02 +641 396 -8.33333333333333e-02 +641 237 4.16666666666667e-02 +641 110 -1.25000000000000e-01 +641 238 4.16666666666667e-02 +641 397 -8.33333333333333e-02 +641 245 -1.25000000000000e-01 +641 643 -4.16666666666667e-02 +641 116 -1.25000000000000e-01 +641 244 -4.16666666666667e-02 +641 403 8.33333333333333e-02 +641 243 8.33333333333333e-02 +641 402 -1.66666666666667e-01 +642 642 1.25000000000000e+00 +642 641 8.33333333333333e-02 +642 419 -1.66666666666667e-01 +642 110 4.16666666666667e-02 +642 640 8.33333333333333e-02 +642 639 -3.75000000000000e-01 +642 122 4.16666666666667e-02 +642 653 -4.16666666666667e-02 +642 652 8.33333333333333e-02 +642 651 -1.25000000000000e-01 +642 416 -8.33333333333333e-02 +642 415 -8.33333333333333e-02 +642 248 8.33333333333333e-02 +642 254 -4.16666666666667e-02 +642 643 -1.66666666666667e-01 +642 247 8.33333333333333e-02 +642 421 -8.33333333333333e-02 +642 109 -8.33333333333333e-02 +642 253 8.33333333333333e-02 +642 252 -1.25000000000000e-01 +642 644 -1.66666666666667e-01 +642 260 8.33333333333333e-02 +642 422 1.66666666666667e-01 +642 259 8.33333333333333e-02 +642 121 -8.33333333333333e-02 +642 418 8.33333333333333e-02 +642 258 -3.75000000000000e-01 +642 420 -2.50000000000000e-01 +643 643 1.25000000000000e+00 +643 641 -4.16666666666667e-02 +643 419 8.33333333333333e-02 +643 640 -1.25000000000000e-01 +643 639 8.33333333333333e-02 +643 644 -1.66666666666667e-01 +643 653 8.33333333333333e-02 +643 652 -3.75000000000000e-01 +643 651 8.33333333333333e-02 +643 414 -8.33333333333333e-02 +643 254 8.33333333333333e-02 +643 642 -1.66666666666667e-01 +643 248 -1.66666666666667e-01 +643 422 1.66666666666667e-01 +643 246 8.33333333333333e-02 +643 420 -8.33333333333333e-02 +643 110 4.16666666666667e-02 +643 416 -8.33333333333333e-02 +643 253 -3.75000000000000e-01 +643 108 -8.33333333333333e-02 +643 252 8.33333333333333e-02 +643 260 -4.16666666666667e-02 +643 122 4.16666666666667e-02 +643 417 8.33333333333333e-02 +643 259 -1.25000000000000e-01 +643 421 -2.50000000000000e-01 +643 258 8.33333333333333e-02 +643 120 -8.33333333333333e-02 +644 644 1.25000000000000e+00 +644 418 8.33333333333333e-02 +644 639 8.33333333333333e-02 +644 417 -1.66666666666667e-01 +644 641 -1.25000000000000e-01 +644 108 4.16666666666667e-02 +644 653 -1.25000000000000e-01 +644 643 -1.66666666666667e-01 +644 652 8.33333333333333e-02 +644 120 4.16666666666667e-02 +644 651 -4.16666666666667e-02 +644 414 -8.33333333333333e-02 +644 253 8.33333333333333e-02 +644 246 8.33333333333333e-02 +644 252 -4.16666666666667e-02 +644 247 -1.66666666666667e-01 +644 421 1.66666666666667e-01 +644 254 -1.25000000000000e-01 +644 109 4.16666666666667e-02 +644 415 -8.33333333333333e-02 +644 640 -4.16666666666667e-02 +644 260 -1.25000000000000e-01 +644 422 -7.50000000000000e-01 +644 259 -4.16666666666667e-02 +644 121 4.16666666666667e-02 +644 642 -1.66666666666667e-01 +644 258 8.33333333333333e-02 +644 420 1.66666666666667e-01 +645 645 1.25000000000000e+00 +645 436 -8.33333333333333e-02 +645 650 -4.16666666666667e-02 +645 656 4.16666666666667e-02 +645 113 8.33333333333333e-02 +645 434 -1.66666666666667e-01 +645 649 8.33333333333333e-02 +645 648 -1.25000000000000e-01 +645 647 -1.66666666666667e-01 +645 437 1.66666666666667e-01 +645 116 8.33333333333333e-02 +645 655 -8.33333333333333e-02 +645 435 -2.50000000000000e-01 +645 400 -8.33333333333333e-02 +645 403 8.33333333333333e-02 +645 242 4.16666666666667e-02 +645 401 -8.33333333333333e-02 +645 112 8.33333333333333e-02 +645 241 -8.33333333333333e-02 +645 111 -3.75000000000000e-01 +645 245 -4.16666666666667e-02 +645 404 8.33333333333333e-02 +645 646 -1.66666666666667e-01 +645 244 8.33333333333333e-02 +645 115 8.33333333333333e-02 +645 433 8.33333333333333e-02 +645 243 -1.25000000000000e-01 +645 114 -3.75000000000000e-01 +646 646 1.25000000000000e+00 +646 435 -8.33333333333333e-02 +646 647 -1.66666666666667e-01 +646 650 8.33333333333333e-02 +646 437 1.66666666666667e-01 +646 113 -4.16666666666667e-02 +646 434 8.33333333333333e-02 +646 649 -3.75000000000000e-01 +646 648 8.33333333333333e-02 +646 656 4.16666666666667e-02 +646 116 -4.16666666666667e-02 +646 436 -2.50000000000000e-01 +646 654 -8.33333333333333e-02 +646 242 4.16666666666667e-02 +646 401 -8.33333333333333e-02 +646 399 -8.33333333333333e-02 +646 402 8.33333333333333e-02 +646 112 -1.25000000000000e-01 +646 111 8.33333333333333e-02 +646 240 -8.33333333333333e-02 +646 245 8.33333333333333e-02 +646 404 -1.66666666666667e-01 +646 432 8.33333333333333e-02 +646 244 -3.75000000000000e-01 +646 115 -1.25000000000000e-01 +646 645 -1.66666666666667e-01 +646 243 8.33333333333333e-02 +646 114 8.33333333333333e-02 +647 647 1.25000000000000e+00 +647 649 8.33333333333333e-02 +647 436 1.66666666666667e-01 +647 648 -4.16666666666667e-02 +647 654 4.16666666666667e-02 +647 650 -1.25000000000000e-01 +647 112 -4.16666666666667e-02 +647 433 8.33333333333333e-02 +647 111 8.33333333333333e-02 +647 432 -1.66666666666667e-01 +647 437 -7.50000000000000e-01 +647 655 4.16666666666667e-02 +647 115 -4.16666666666667e-02 +647 645 -1.66666666666667e-01 +647 435 1.66666666666667e-01 +647 114 8.33333333333333e-02 +647 241 4.16666666666667e-02 +647 400 -8.33333333333333e-02 +647 113 -1.25000000000000e-01 +647 240 4.16666666666667e-02 +647 399 -8.33333333333333e-02 +647 646 -1.66666666666667e-01 +647 245 -1.25000000000000e-01 +647 116 -1.25000000000000e-01 +647 244 8.33333333333333e-02 +647 403 -1.66666666666667e-01 +647 243 -4.16666666666667e-02 +647 402 8.33333333333333e-02 +648 648 1.25000000000000e+00 +648 647 -4.16666666666667e-02 +648 437 8.33333333333333e-02 +648 646 8.33333333333333e-02 +648 645 -1.25000000000000e-01 +648 650 -1.66666666666667e-01 +648 656 8.33333333333333e-02 +648 655 8.33333333333333e-02 +648 654 -3.75000000000000e-01 +648 433 -8.33333333333333e-02 +648 284 8.33333333333333e-02 +648 649 -1.66666666666667e-01 +648 278 -1.66666666666667e-01 +648 440 1.66666666666667e-01 +648 277 8.33333333333333e-02 +648 439 -8.33333333333333e-02 +648 113 4.16666666666667e-02 +648 434 -8.33333333333333e-02 +648 283 8.33333333333333e-02 +648 112 -8.33333333333333e-02 +648 282 -3.75000000000000e-01 +648 287 -4.16666666666667e-02 +648 131 4.16666666666667e-02 +648 286 8.33333333333333e-02 +648 130 -8.33333333333333e-02 +648 285 -1.25000000000000e-01 +648 436 8.33333333333333e-02 +648 438 -2.50000000000000e-01 +649 649 1.25000000000000e+00 +649 647 8.33333333333333e-02 +649 437 -1.66666666666667e-01 +649 113 4.16666666666667e-02 +649 646 -3.75000000000000e-01 +649 645 8.33333333333333e-02 +649 131 4.16666666666667e-02 +649 656 -4.16666666666667e-02 +649 655 -1.25000000000000e-01 +649 654 8.33333333333333e-02 +649 434 -8.33333333333333e-02 +649 432 -8.33333333333333e-02 +649 284 -4.16666666666667e-02 +649 278 8.33333333333333e-02 +649 648 -1.66666666666667e-01 +649 276 8.33333333333333e-02 +649 438 -8.33333333333333e-02 +649 283 -1.25000000000000e-01 +649 282 8.33333333333333e-02 +649 111 -8.33333333333333e-02 +649 287 8.33333333333333e-02 +649 650 -1.66666666666667e-01 +649 440 1.66666666666667e-01 +649 286 -3.75000000000000e-01 +649 435 8.33333333333333e-02 +649 439 -2.50000000000000e-01 +649 285 8.33333333333333e-02 +649 129 -8.33333333333333e-02 +650 650 1.25000000000000e+00 +650 436 -1.66666666666667e-01 +650 645 -4.16666666666667e-02 +650 435 8.33333333333333e-02 +650 647 -1.25000000000000e-01 +650 112 4.16666666666667e-02 +650 656 -1.25000000000000e-01 +650 130 4.16666666666667e-02 +650 655 -4.16666666666667e-02 +650 648 -1.66666666666667e-01 +650 654 8.33333333333333e-02 +650 433 -8.33333333333333e-02 +650 283 -4.16666666666667e-02 +650 277 8.33333333333333e-02 +650 282 8.33333333333333e-02 +650 276 -1.66666666666667e-01 +650 438 1.66666666666667e-01 +650 284 -1.25000000000000e-01 +650 111 4.16666666666667e-02 +650 432 -8.33333333333333e-02 +650 287 -1.25000000000000e-01 +650 646 8.33333333333333e-02 +650 440 -7.50000000000000e-01 +650 286 8.33333333333333e-02 +650 649 -1.66666666666667e-01 +650 439 1.66666666666667e-01 +650 285 -4.16666666666667e-02 +650 129 4.16666666666667e-02 +651 651 1.25000000000000e+00 +651 643 8.33333333333333e-02 +651 642 -1.25000000000000e-01 +651 641 4.16666666666667e-02 +651 640 -8.33333333333333e-02 +651 422 8.33333333333333e-02 +651 419 -8.33333333333333e-02 +651 421 8.33333333333333e-02 +651 418 -8.33333333333333e-02 +651 454 -8.33333333333333e-02 +651 451 8.33333333333333e-02 +651 305 4.16666666666667e-02 +651 302 -4.16666666666667e-02 +651 116 8.33333333333333e-02 +651 452 -1.66666666666667e-01 +651 115 8.33333333333333e-02 +651 652 -1.66666666666667e-01 +651 301 8.33333333333333e-02 +651 114 -3.75000000000000e-01 +651 300 -1.25000000000000e-01 +651 653 -1.66666666666667e-01 +651 122 8.33333333333333e-02 +651 455 1.66666666666667e-01 +651 121 8.33333333333333e-02 +651 304 -8.33333333333333e-02 +651 644 -4.16666666666667e-02 +651 120 -3.75000000000000e-01 +651 453 -2.50000000000000e-01 +652 652 1.25000000000000e+00 +652 644 8.33333333333333e-02 +652 643 -3.75000000000000e-01 +652 642 8.33333333333333e-02 +652 639 -8.33333333333333e-02 +652 419 -8.33333333333333e-02 +652 422 -1.66666666666667e-01 +652 420 8.33333333333333e-02 +652 417 -8.33333333333333e-02 +652 453 -8.33333333333333e-02 +652 450 8.33333333333333e-02 +652 455 1.66666666666667e-01 +652 653 -1.66666666666667e-01 +652 302 8.33333333333333e-02 +652 116 -4.16666666666667e-02 +652 452 8.33333333333333e-02 +652 115 -1.25000000000000e-01 +652 301 -3.75000000000000e-01 +652 114 8.33333333333333e-02 +652 651 -1.66666666666667e-01 +652 300 8.33333333333333e-02 +652 122 -4.16666666666667e-02 +652 305 4.16666666666667e-02 +652 641 4.16666666666667e-02 +652 121 -1.25000000000000e-01 +652 454 -2.50000000000000e-01 +652 120 8.33333333333333e-02 +652 303 -8.33333333333333e-02 +653 653 1.25000000000000e+00 +653 644 -1.25000000000000e-01 +653 643 8.33333333333333e-02 +653 642 -4.16666666666667e-02 +653 639 4.16666666666667e-02 +653 420 8.33333333333333e-02 +653 417 -8.33333333333333e-02 +653 418 -8.33333333333333e-02 +653 421 -1.66666666666667e-01 +653 454 1.66666666666667e-01 +653 652 -1.66666666666667e-01 +653 301 8.33333333333333e-02 +653 303 4.16666666666667e-02 +653 300 -4.16666666666667e-02 +653 116 -1.25000000000000e-01 +653 302 -1.25000000000000e-01 +653 115 -4.16666666666667e-02 +653 451 8.33333333333333e-02 +653 114 8.33333333333333e-02 +653 450 -1.66666666666667e-01 +653 640 4.16666666666667e-02 +653 122 -1.25000000000000e-01 +653 455 -7.50000000000000e-01 +653 121 -4.16666666666667e-02 +653 304 4.16666666666667e-02 +653 651 -1.66666666666667e-01 +653 120 8.33333333333333e-02 +653 453 1.66666666666667e-01 +654 654 1.25000000000000e+00 +654 650 8.33333333333333e-02 +654 649 8.33333333333333e-02 +654 648 -3.75000000000000e-01 +654 646 -8.33333333333333e-02 +654 437 -8.33333333333333e-02 +654 440 -1.66666666666667e-01 +654 439 8.33333333333333e-02 +654 436 -8.33333333333333e-02 +654 451 8.33333333333333e-02 +654 457 -8.33333333333333e-02 +654 656 -1.66666666666667e-01 +654 458 1.66666666666667e-01 +654 302 8.33333333333333e-02 +654 131 -4.16666666666667e-02 +654 308 4.16666666666667e-02 +654 130 8.33333333333333e-02 +654 307 -8.33333333333333e-02 +654 129 -1.25000000000000e-01 +654 456 -2.50000000000000e-01 +654 116 -4.16666666666667e-02 +654 452 8.33333333333333e-02 +654 655 -1.66666666666667e-01 +654 115 8.33333333333333e-02 +654 301 8.33333333333333e-02 +654 647 4.16666666666667e-02 +654 114 -1.25000000000000e-01 +654 300 -3.75000000000000e-01 +655 655 1.25000000000000e+00 +655 649 -1.25000000000000e-01 +655 648 8.33333333333333e-02 +655 647 4.16666666666667e-02 +655 645 -8.33333333333333e-02 +655 440 8.33333333333333e-02 +655 437 -8.33333333333333e-02 +655 438 8.33333333333333e-02 +655 435 -8.33333333333333e-02 +655 450 8.33333333333333e-02 +655 456 -8.33333333333333e-02 +655 308 4.16666666666667e-02 +655 302 -4.16666666666667e-02 +655 131 8.33333333333333e-02 +655 656 -1.66666666666667e-01 +655 458 1.66666666666667e-01 +655 130 -3.75000000000000e-01 +655 457 -2.50000000000000e-01 +655 129 8.33333333333333e-02 +655 306 -8.33333333333333e-02 +655 116 8.33333333333333e-02 +655 452 -1.66666666666667e-01 +655 650 -4.16666666666667e-02 +655 115 -3.75000000000000e-01 +655 301 -1.25000000000000e-01 +655 654 -1.66666666666667e-01 +655 114 8.33333333333333e-02 +655 300 8.33333333333333e-02 +656 656 1.25000000000000e+00 +656 650 -1.25000000000000e-01 +656 649 -4.16666666666667e-02 +656 648 8.33333333333333e-02 +656 646 4.16666666666667e-02 +656 439 8.33333333333333e-02 +656 436 -8.33333333333333e-02 +656 435 -8.33333333333333e-02 +656 438 -1.66666666666667e-01 +656 307 4.16666666666667e-02 +656 301 -4.16666666666667e-02 +656 654 -1.66666666666667e-01 +656 456 1.66666666666667e-01 +656 300 8.33333333333333e-02 +656 131 -1.25000000000000e-01 +656 458 -7.50000000000000e-01 +656 130 8.33333333333333e-02 +656 655 -1.66666666666667e-01 +656 457 1.66666666666667e-01 +656 129 -4.16666666666667e-02 +656 306 4.16666666666667e-02 +656 645 4.16666666666667e-02 +656 116 -1.25000000000000e-01 +656 302 -1.25000000000000e-01 +656 115 8.33333333333333e-02 +656 451 -1.66666666666667e-01 +656 114 -4.16666666666667e-02 +656 450 8.33333333333333e-02 +657 657 1.25000000000000e+00 +657 544 -8.33333333333333e-02 +657 662 8.33333333333333e-02 +657 659 -1.66666666666667e-01 +657 545 1.66666666666667e-01 +657 542 8.33333333333333e-02 +657 119 -4.16666666666667e-02 +657 661 8.33333333333333e-02 +657 660 -3.75000000000000e-01 +657 671 4.16666666666667e-02 +657 125 -4.16666666666667e-02 +657 670 -8.33333333333333e-02 +657 543 -2.50000000000000e-01 +657 524 -8.33333333333333e-02 +657 257 4.16666666666667e-02 +657 523 -8.33333333333333e-02 +657 529 8.33333333333333e-02 +657 256 -8.33333333333333e-02 +657 118 8.33333333333333e-02 +657 117 -1.25000000000000e-01 +657 263 8.33333333333333e-02 +657 530 -1.66666666666667e-01 +657 262 8.33333333333333e-02 +657 658 -1.66666666666667e-01 +657 124 8.33333333333333e-02 +657 261 -3.75000000000000e-01 +657 541 8.33333333333333e-02 +657 123 -1.25000000000000e-01 +658 658 1.25000000000000e+00 +658 543 -8.33333333333333e-02 +658 662 -4.16666666666667e-02 +658 671 4.16666666666667e-02 +658 542 -1.66666666666667e-01 +658 119 8.33333333333333e-02 +658 661 -1.25000000000000e-01 +658 660 8.33333333333333e-02 +658 545 1.66666666666667e-01 +658 659 -1.66666666666667e-01 +658 125 8.33333333333333e-02 +658 544 -2.50000000000000e-01 +658 669 -8.33333333333333e-02 +658 522 -8.33333333333333e-02 +658 528 8.33333333333333e-02 +658 257 4.16666666666667e-02 +658 524 -8.33333333333333e-02 +658 118 -3.75000000000000e-01 +658 255 -8.33333333333333e-02 +658 117 8.33333333333333e-02 +658 263 -4.16666666666667e-02 +658 530 8.33333333333333e-02 +658 262 -1.25000000000000e-01 +658 540 8.33333333333333e-02 +658 124 -3.75000000000000e-01 +658 261 8.33333333333333e-02 +658 657 -1.66666666666667e-01 +658 123 8.33333333333333e-02 +659 659 1.25000000000000e+00 +659 670 4.16666666666667e-02 +659 660 8.33333333333333e-02 +659 657 -1.66666666666667e-01 +659 543 1.66666666666667e-01 +659 662 -1.25000000000000e-01 +659 541 -1.66666666666667e-01 +659 118 8.33333333333333e-02 +659 540 8.33333333333333e-02 +659 117 -4.16666666666667e-02 +659 545 -7.50000000000000e-01 +659 544 1.66666666666667e-01 +659 658 -1.66666666666667e-01 +659 124 8.33333333333333e-02 +659 669 4.16666666666667e-02 +659 123 -4.16666666666667e-02 +659 522 -8.33333333333333e-02 +659 255 4.16666666666667e-02 +659 119 -1.25000000000000e-01 +659 256 4.16666666666667e-02 +659 523 -8.33333333333333e-02 +659 263 -1.25000000000000e-01 +659 661 -4.16666666666667e-02 +659 125 -1.25000000000000e-01 +659 262 -4.16666666666667e-02 +659 529 8.33333333333333e-02 +659 261 8.33333333333333e-02 +659 528 -1.66666666666667e-01 +660 660 1.25000000000000e+00 +660 659 8.33333333333333e-02 +660 545 -1.66666666666667e-01 +660 119 4.16666666666667e-02 +660 658 8.33333333333333e-02 +660 657 -3.75000000000000e-01 +660 128 4.16666666666667e-02 +660 671 -4.16666666666667e-02 +660 670 8.33333333333333e-02 +660 669 -1.25000000000000e-01 +660 542 -8.33333333333333e-02 +660 541 -8.33333333333333e-02 +660 266 8.33333333333333e-02 +660 272 -4.16666666666667e-02 +660 661 -1.66666666666667e-01 +660 265 8.33333333333333e-02 +660 547 -8.33333333333333e-02 +660 118 -8.33333333333333e-02 +660 271 8.33333333333333e-02 +660 270 -1.25000000000000e-01 +660 662 -1.66666666666667e-01 +660 275 8.33333333333333e-02 +660 548 1.66666666666667e-01 +660 274 8.33333333333333e-02 +660 127 -8.33333333333333e-02 +660 544 8.33333333333333e-02 +660 273 -3.75000000000000e-01 +660 546 -2.50000000000000e-01 +661 661 1.25000000000000e+00 +661 659 -4.16666666666667e-02 +661 545 8.33333333333333e-02 +661 658 -1.25000000000000e-01 +661 657 8.33333333333333e-02 +661 662 -1.66666666666667e-01 +661 671 8.33333333333333e-02 +661 670 -3.75000000000000e-01 +661 669 8.33333333333333e-02 +661 540 -8.33333333333333e-02 +661 272 8.33333333333333e-02 +661 660 -1.66666666666667e-01 +661 266 -1.66666666666667e-01 +661 548 1.66666666666667e-01 +661 264 8.33333333333333e-02 +661 546 -8.33333333333333e-02 +661 119 4.16666666666667e-02 +661 542 -8.33333333333333e-02 +661 271 -3.75000000000000e-01 +661 117 -8.33333333333333e-02 +661 270 8.33333333333333e-02 +661 275 -4.16666666666667e-02 +661 128 4.16666666666667e-02 +661 543 8.33333333333333e-02 +661 274 -1.25000000000000e-01 +661 547 -2.50000000000000e-01 +661 273 8.33333333333333e-02 +661 126 -8.33333333333333e-02 +662 662 1.25000000000000e+00 +662 544 8.33333333333333e-02 +662 657 8.33333333333333e-02 +662 543 -1.66666666666667e-01 +662 659 -1.25000000000000e-01 +662 117 4.16666666666667e-02 +662 671 -1.25000000000000e-01 +662 661 -1.66666666666667e-01 +662 670 8.33333333333333e-02 +662 126 4.16666666666667e-02 +662 669 -4.16666666666667e-02 +662 540 -8.33333333333333e-02 +662 271 8.33333333333333e-02 +662 264 8.33333333333333e-02 +662 270 -4.16666666666667e-02 +662 265 -1.66666666666667e-01 +662 547 1.66666666666667e-01 +662 272 -1.25000000000000e-01 +662 118 4.16666666666667e-02 +662 541 -8.33333333333333e-02 +662 658 -4.16666666666667e-02 +662 275 -1.25000000000000e-01 +662 548 -7.50000000000000e-01 +662 274 -4.16666666666667e-02 +662 127 4.16666666666667e-02 +662 660 -1.66666666666667e-01 +662 273 8.33333333333333e-02 +662 546 1.66666666666667e-01 +663 663 1.25000000000000e+00 +663 562 -8.33333333333333e-02 +663 668 -4.16666666666667e-02 +663 674 4.16666666666667e-02 +663 122 8.33333333333333e-02 +663 560 -1.66666666666667e-01 +663 667 8.33333333333333e-02 +663 666 -1.25000000000000e-01 +663 665 -1.66666666666667e-01 +663 563 1.66666666666667e-01 +663 125 8.33333333333333e-02 +663 673 -8.33333333333333e-02 +663 561 -2.50000000000000e-01 +663 526 -8.33333333333333e-02 +663 529 8.33333333333333e-02 +663 260 4.16666666666667e-02 +663 527 -8.33333333333333e-02 +663 121 8.33333333333333e-02 +663 259 -8.33333333333333e-02 +663 120 -3.75000000000000e-01 +663 263 -4.16666666666667e-02 +663 530 8.33333333333333e-02 +663 664 -1.66666666666667e-01 +663 262 8.33333333333333e-02 +663 124 8.33333333333333e-02 +663 559 8.33333333333333e-02 +663 261 -1.25000000000000e-01 +663 123 -3.75000000000000e-01 +664 664 1.25000000000000e+00 +664 561 -8.33333333333333e-02 +664 665 -1.66666666666667e-01 +664 668 8.33333333333333e-02 +664 563 1.66666666666667e-01 +664 122 -4.16666666666667e-02 +664 560 8.33333333333333e-02 +664 667 -3.75000000000000e-01 +664 666 8.33333333333333e-02 +664 674 4.16666666666667e-02 +664 125 -4.16666666666667e-02 +664 562 -2.50000000000000e-01 +664 672 -8.33333333333333e-02 +664 260 4.16666666666667e-02 +664 527 -8.33333333333333e-02 +664 525 -8.33333333333333e-02 +664 528 8.33333333333333e-02 +664 121 -1.25000000000000e-01 +664 120 8.33333333333333e-02 +664 258 -8.33333333333333e-02 +664 263 8.33333333333333e-02 +664 530 -1.66666666666667e-01 +664 558 8.33333333333333e-02 +664 262 -3.75000000000000e-01 +664 124 -1.25000000000000e-01 +664 663 -1.66666666666667e-01 +664 261 8.33333333333333e-02 +664 123 8.33333333333333e-02 +665 665 1.25000000000000e+00 +665 667 8.33333333333333e-02 +665 562 1.66666666666667e-01 +665 666 -4.16666666666667e-02 +665 672 4.16666666666667e-02 +665 668 -1.25000000000000e-01 +665 121 -4.16666666666667e-02 +665 559 8.33333333333333e-02 +665 120 8.33333333333333e-02 +665 558 -1.66666666666667e-01 +665 563 -7.50000000000000e-01 +665 673 4.16666666666667e-02 +665 124 -4.16666666666667e-02 +665 663 -1.66666666666667e-01 +665 561 1.66666666666667e-01 +665 123 8.33333333333333e-02 +665 259 4.16666666666667e-02 +665 526 -8.33333333333333e-02 +665 122 -1.25000000000000e-01 +665 258 4.16666666666667e-02 +665 525 -8.33333333333333e-02 +665 664 -1.66666666666667e-01 +665 263 -1.25000000000000e-01 +665 125 -1.25000000000000e-01 +665 262 8.33333333333333e-02 +665 529 -1.66666666666667e-01 +665 261 -4.16666666666667e-02 +665 528 8.33333333333333e-02 +666 666 1.25000000000000e+00 +666 665 -4.16666666666667e-02 +666 563 8.33333333333333e-02 +666 664 8.33333333333333e-02 +666 663 -1.25000000000000e-01 +666 668 -1.66666666666667e-01 +666 674 8.33333333333333e-02 +666 673 8.33333333333333e-02 +666 672 -3.75000000000000e-01 +666 559 -8.33333333333333e-02 +666 305 8.33333333333333e-02 +666 667 -1.66666666666667e-01 +666 293 -1.66666666666667e-01 +666 566 1.66666666666667e-01 +666 292 8.33333333333333e-02 +666 565 -8.33333333333333e-02 +666 122 4.16666666666667e-02 +666 560 -8.33333333333333e-02 +666 304 8.33333333333333e-02 +666 121 -8.33333333333333e-02 +666 303 -3.75000000000000e-01 +666 311 -4.16666666666667e-02 +666 134 4.16666666666667e-02 +666 310 8.33333333333333e-02 +666 133 -8.33333333333333e-02 +666 309 -1.25000000000000e-01 +666 562 8.33333333333333e-02 +666 564 -2.50000000000000e-01 +667 667 1.25000000000000e+00 +667 665 8.33333333333333e-02 +667 563 -1.66666666666667e-01 +667 122 4.16666666666667e-02 +667 664 -3.75000000000000e-01 +667 663 8.33333333333333e-02 +667 134 4.16666666666667e-02 +667 674 -4.16666666666667e-02 +667 673 -1.25000000000000e-01 +667 672 8.33333333333333e-02 +667 560 -8.33333333333333e-02 +667 558 -8.33333333333333e-02 +667 305 -4.16666666666667e-02 +667 293 8.33333333333333e-02 +667 666 -1.66666666666667e-01 +667 291 8.33333333333333e-02 +667 564 -8.33333333333333e-02 +667 304 -1.25000000000000e-01 +667 303 8.33333333333333e-02 +667 120 -8.33333333333333e-02 +667 311 8.33333333333333e-02 +667 668 -1.66666666666667e-01 +667 566 1.66666666666667e-01 +667 310 -3.75000000000000e-01 +667 561 8.33333333333333e-02 +667 565 -2.50000000000000e-01 +667 309 8.33333333333333e-02 +667 132 -8.33333333333333e-02 +668 668 1.25000000000000e+00 +668 562 -1.66666666666667e-01 +668 663 -4.16666666666667e-02 +668 561 8.33333333333333e-02 +668 665 -1.25000000000000e-01 +668 121 4.16666666666667e-02 +668 674 -1.25000000000000e-01 +668 133 4.16666666666667e-02 +668 673 -4.16666666666667e-02 +668 666 -1.66666666666667e-01 +668 672 8.33333333333333e-02 +668 559 -8.33333333333333e-02 +668 304 -4.16666666666667e-02 +668 292 8.33333333333333e-02 +668 303 8.33333333333333e-02 +668 291 -1.66666666666667e-01 +668 564 1.66666666666667e-01 +668 305 -1.25000000000000e-01 +668 120 4.16666666666667e-02 +668 558 -8.33333333333333e-02 +668 311 -1.25000000000000e-01 +668 664 8.33333333333333e-02 +668 566 -7.50000000000000e-01 +668 310 8.33333333333333e-02 +668 667 -1.66666666666667e-01 +668 565 1.66666666666667e-01 +668 309 -4.16666666666667e-02 +668 132 4.16666666666667e-02 +669 669 1.25000000000000e+00 +669 661 8.33333333333333e-02 +669 660 -1.25000000000000e-01 +669 659 4.16666666666667e-02 +669 658 -8.33333333333333e-02 +669 548 8.33333333333333e-02 +669 545 -8.33333333333333e-02 +669 547 8.33333333333333e-02 +669 544 -8.33333333333333e-02 +669 580 -8.33333333333333e-02 +669 577 8.33333333333333e-02 +669 329 4.16666666666667e-02 +669 326 -4.16666666666667e-02 +669 125 8.33333333333333e-02 +669 578 -1.66666666666667e-01 +669 124 8.33333333333333e-02 +669 670 -1.66666666666667e-01 +669 325 8.33333333333333e-02 +669 123 -3.75000000000000e-01 +669 324 -1.25000000000000e-01 +669 671 -1.66666666666667e-01 +669 128 8.33333333333333e-02 +669 581 1.66666666666667e-01 +669 127 8.33333333333333e-02 +669 328 -8.33333333333333e-02 +669 662 -4.16666666666667e-02 +669 126 -3.75000000000000e-01 +669 579 -2.50000000000000e-01 +670 670 1.25000000000000e+00 +670 662 8.33333333333333e-02 +670 661 -3.75000000000000e-01 +670 660 8.33333333333333e-02 +670 657 -8.33333333333333e-02 +670 545 -8.33333333333333e-02 +670 548 -1.66666666666667e-01 +670 546 8.33333333333333e-02 +670 543 -8.33333333333333e-02 +670 579 -8.33333333333333e-02 +670 576 8.33333333333333e-02 +670 581 1.66666666666667e-01 +670 671 -1.66666666666667e-01 +670 326 8.33333333333333e-02 +670 125 -4.16666666666667e-02 +670 578 8.33333333333333e-02 +670 124 -1.25000000000000e-01 +670 325 -3.75000000000000e-01 +670 123 8.33333333333333e-02 +670 669 -1.66666666666667e-01 +670 324 8.33333333333333e-02 +670 128 -4.16666666666667e-02 +670 329 4.16666666666667e-02 +670 659 4.16666666666667e-02 +670 127 -1.25000000000000e-01 +670 580 -2.50000000000000e-01 +670 126 8.33333333333333e-02 +670 327 -8.33333333333333e-02 +671 671 1.25000000000000e+00 +671 662 -1.25000000000000e-01 +671 661 8.33333333333333e-02 +671 660 -4.16666666666667e-02 +671 657 4.16666666666667e-02 +671 546 8.33333333333333e-02 +671 543 -8.33333333333333e-02 +671 544 -8.33333333333333e-02 +671 547 -1.66666666666667e-01 +671 580 1.66666666666667e-01 +671 670 -1.66666666666667e-01 +671 325 8.33333333333333e-02 +671 327 4.16666666666667e-02 +671 324 -4.16666666666667e-02 +671 125 -1.25000000000000e-01 +671 326 -1.25000000000000e-01 +671 124 -4.16666666666667e-02 +671 577 8.33333333333333e-02 +671 123 8.33333333333333e-02 +671 576 -1.66666666666667e-01 +671 658 4.16666666666667e-02 +671 128 -1.25000000000000e-01 +671 581 -7.50000000000000e-01 +671 127 -4.16666666666667e-02 +671 328 4.16666666666667e-02 +671 669 -1.66666666666667e-01 +671 126 8.33333333333333e-02 +671 579 1.66666666666667e-01 +672 672 1.25000000000000e+00 +672 668 8.33333333333333e-02 +672 667 8.33333333333333e-02 +672 666 -3.75000000000000e-01 +672 664 -8.33333333333333e-02 +672 563 -8.33333333333333e-02 +672 566 -1.66666666666667e-01 +672 565 8.33333333333333e-02 +672 562 -8.33333333333333e-02 +672 577 8.33333333333333e-02 +672 583 -8.33333333333333e-02 +672 674 -1.66666666666667e-01 +672 584 1.66666666666667e-01 +672 326 8.33333333333333e-02 +672 134 -4.16666666666667e-02 +672 332 4.16666666666667e-02 +672 133 8.33333333333333e-02 +672 331 -8.33333333333333e-02 +672 132 -1.25000000000000e-01 +672 582 -2.50000000000000e-01 +672 125 -4.16666666666667e-02 +672 578 8.33333333333333e-02 +672 673 -1.66666666666667e-01 +672 124 8.33333333333333e-02 +672 325 8.33333333333333e-02 +672 665 4.16666666666667e-02 +672 123 -1.25000000000000e-01 +672 324 -3.75000000000000e-01 +673 673 1.25000000000000e+00 +673 667 -1.25000000000000e-01 +673 666 8.33333333333333e-02 +673 665 4.16666666666667e-02 +673 663 -8.33333333333333e-02 +673 566 8.33333333333333e-02 +673 563 -8.33333333333333e-02 +673 564 8.33333333333333e-02 +673 561 -8.33333333333333e-02 +673 576 8.33333333333333e-02 +673 582 -8.33333333333333e-02 +673 332 4.16666666666667e-02 +673 326 -4.16666666666667e-02 +673 134 8.33333333333333e-02 +673 674 -1.66666666666667e-01 +673 584 1.66666666666667e-01 +673 133 -3.75000000000000e-01 +673 583 -2.50000000000000e-01 +673 132 8.33333333333333e-02 +673 330 -8.33333333333333e-02 +673 125 8.33333333333333e-02 +673 578 -1.66666666666667e-01 +673 668 -4.16666666666667e-02 +673 124 -3.75000000000000e-01 +673 325 -1.25000000000000e-01 +673 672 -1.66666666666667e-01 +673 123 8.33333333333333e-02 +673 324 8.33333333333333e-02 +674 674 1.25000000000000e+00 +674 668 -1.25000000000000e-01 +674 667 -4.16666666666667e-02 +674 666 8.33333333333333e-02 +674 664 4.16666666666667e-02 +674 565 8.33333333333333e-02 +674 562 -8.33333333333333e-02 +674 561 -8.33333333333333e-02 +674 564 -1.66666666666667e-01 +674 331 4.16666666666667e-02 +674 325 -4.16666666666667e-02 +674 672 -1.66666666666667e-01 +674 582 1.66666666666667e-01 +674 324 8.33333333333333e-02 +674 134 -1.25000000000000e-01 +674 584 -7.50000000000000e-01 +674 133 8.33333333333333e-02 +674 673 -1.66666666666667e-01 +674 583 1.66666666666667e-01 +674 132 -4.16666666666667e-02 +674 330 4.16666666666667e-02 +674 663 4.16666666666667e-02 +674 125 -1.25000000000000e-01 +674 326 -1.25000000000000e-01 +674 124 8.33333333333333e-02 +674 577 -1.66666666666667e-01 +674 123 -4.16666666666667e-02 +674 576 8.33333333333333e-02 diff --git a/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/A.IJ.00001 b/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/A.IJ.00001 new file mode 100644 index 00000000..60a6775b --- /dev/null +++ b/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/A.IJ.00001 @@ -0,0 +1,17368 @@ +675 1274 675 1274 +675 675 7.50000000000000e-01 +675 818 -8.33333333333333e-02 +675 799 4.16666666666667e-02 +675 805 -8.33333333333333e-02 +675 800 4.16666666666667e-02 +675 811 4.16666666666667e-02 +675 817 -8.33333333333333e-02 +675 798 -2.50000000000000e-01 +675 812 -8.33333333333333e-02 +675 803 -4.16666666666667e-02 +675 815 8.33333333333333e-02 +675 676 -8.33333333333333e-02 +675 802 8.33333333333333e-02 +675 796 4.16666666666667e-02 +675 801 -1.25000000000000e-01 +675 677 -8.33333333333333e-02 +675 809 8.33333333333333e-02 +675 797 4.16666666666667e-02 +675 808 -4.16666666666667e-02 +675 814 8.33333333333333e-02 +675 806 4.16666666666667e-02 +675 807 -1.25000000000000e-01 +675 795 -2.50000000000000e-01 +676 676 6.66666666666667e-01 +676 798 4.16666666666667e-02 +676 804 -8.33333333333333e-02 +676 799 -8.33333333333333e-02 +676 810 4.16666666666667e-02 +676 816 -8.33333333333333e-02 +676 812 4.16666666666667e-02 +676 818 -8.33333333333333e-02 +676 803 8.33333333333333e-02 +676 802 -3.75000000000000e-01 +676 675 -8.33333333333333e-02 +676 801 8.33333333333333e-02 +676 795 4.16666666666667e-02 +676 809 8.33333333333333e-02 +676 815 -1.66666666666667e-01 +676 806 4.16666666666667e-02 +676 808 -1.25000000000000e-01 +676 796 -8.33333333333333e-02 +676 807 -4.16666666666667e-02 +676 813 8.33333333333333e-02 +677 677 6.66666666666667e-01 +677 804 4.16666666666667e-02 +677 816 -8.33333333333333e-02 +677 800 -8.33333333333333e-02 +677 798 4.16666666666667e-02 +677 811 4.16666666666667e-02 +677 817 -8.33333333333333e-02 +677 810 -8.33333333333333e-02 +677 803 -1.25000000000000e-01 +677 802 8.33333333333333e-02 +677 801 -4.16666666666667e-02 +677 813 8.33333333333333e-02 +677 805 4.16666666666667e-02 +677 809 -3.75000000000000e-01 +677 797 -8.33333333333333e-02 +677 808 8.33333333333333e-02 +677 814 -1.66666666666667e-01 +677 675 -8.33333333333333e-02 +677 807 8.33333333333333e-02 +677 795 4.16666666666667e-02 +678 678 3.33333333333333e-01 +678 830 4.16666666666667e-02 +678 679 -8.33333333333333e-02 +678 823 4.16666666666667e-02 +678 820 4.16666666666667e-02 +678 822 -4.16666666666667e-02 +678 680 -8.33333333333333e-02 +678 827 4.16666666666667e-02 +678 821 4.16666666666667e-02 +678 826 -4.16666666666667e-02 +678 829 4.16666666666667e-02 +678 824 -4.16666666666667e-02 +678 825 -4.16666666666667e-02 +678 819 -2.50000000000000e-01 +679 679 2.50000000000000e-01 +679 823 -1.25000000000000e-01 +679 678 -8.33333333333333e-02 +679 822 4.16666666666667e-02 +679 819 4.16666666666667e-02 +679 827 4.16666666666667e-02 +679 830 -8.33333333333333e-02 +679 824 4.16666666666667e-02 +679 826 -4.16666666666667e-02 +679 820 -8.33333333333333e-02 +679 825 -4.16666666666667e-02 +679 828 4.16666666666667e-02 +680 680 2.50000000000000e-01 +680 823 4.16666666666667e-02 +680 822 -4.16666666666667e-02 +680 828 4.16666666666667e-02 +680 824 -4.16666666666667e-02 +680 827 -1.25000000000000e-01 +680 821 -8.33333333333333e-02 +680 826 4.16666666666667e-02 +680 829 -8.33333333333333e-02 +680 678 -8.33333333333333e-02 +680 825 4.16666666666667e-02 +680 819 4.16666666666667e-02 +681 681 5.00000000000000e-01 +681 847 4.16666666666667e-02 +681 682 -8.33333333333333e-02 +681 846 -1.25000000000000e-01 +681 854 -8.33333333333333e-02 +681 850 -4.16666666666667e-02 +681 853 4.16666666666667e-02 +681 683 -8.33333333333333e-02 +681 845 4.16666666666667e-02 +681 851 8.33333333333333e-02 +681 844 4.16666666666667e-02 +681 843 -1.25000000000000e-01 +681 842 -4.16666666666667e-02 +681 839 4.16666666666667e-02 +681 841 8.33333333333333e-02 +681 838 -8.33333333333333e-02 +681 840 -1.25000000000000e-01 +681 848 4.16666666666667e-02 +681 849 -1.25000000000000e-01 +682 682 5.83333333333333e-01 +682 854 4.16666666666667e-02 +682 847 -4.16666666666667e-02 +682 846 4.16666666666667e-02 +682 681 -8.33333333333333e-02 +682 849 -4.16666666666667e-02 +682 852 4.16666666666667e-02 +682 845 -4.16666666666667e-02 +682 839 4.16666666666667e-02 +682 844 -4.16666666666667e-02 +682 843 4.16666666666667e-02 +682 842 8.33333333333333e-02 +682 683 -1.66666666666667e-01 +682 851 8.33333333333333e-02 +682 841 -3.75000000000000e-01 +682 848 -4.16666666666667e-02 +682 850 -1.25000000000000e-01 +682 840 8.33333333333333e-02 +682 837 -8.33333333333333e-02 +683 683 5.83333333333333e-01 +683 847 -4.16666666666667e-02 +683 853 4.16666666666667e-02 +683 846 4.16666666666667e-02 +683 852 -8.33333333333333e-02 +683 845 -4.16666666666667e-02 +683 844 -4.16666666666667e-02 +683 838 4.16666666666667e-02 +683 681 -8.33333333333333e-02 +683 843 4.16666666666667e-02 +683 849 8.33333333333333e-02 +683 842 -1.25000000000000e-01 +683 848 -4.16666666666667e-02 +683 851 -3.75000000000000e-01 +683 841 8.33333333333333e-02 +683 682 -1.66666666666667e-01 +683 850 8.33333333333333e-02 +683 840 -4.16666666666667e-02 +683 837 4.16666666666667e-02 +684 684 2.50000000000000e-01 +684 863 4.16666666666667e-02 +684 866 4.16666666666667e-02 +684 862 4.16666666666667e-02 +684 861 -1.25000000000000e-01 +684 860 -4.16666666666667e-02 +684 857 4.16666666666667e-02 +684 859 4.16666666666667e-02 +684 856 -8.33333333333333e-02 +684 858 -4.16666666666667e-02 +684 686 -8.33333333333333e-02 +684 864 -8.33333333333333e-02 +685 685 2.50000000000000e-01 +685 857 4.16666666666667e-02 +685 862 -4.16666666666667e-02 +685 861 4.16666666666667e-02 +685 860 4.16666666666667e-02 +685 686 -8.33333333333333e-02 +685 866 4.16666666666667e-02 +685 859 -1.25000000000000e-01 +685 863 -4.16666666666667e-02 +685 865 -8.33333333333333e-02 +685 858 4.16666666666667e-02 +685 855 -8.33333333333333e-02 +686 686 3.33333333333333e-01 +686 862 -4.16666666666667e-02 +686 856 4.16666666666667e-02 +686 684 -8.33333333333333e-02 +686 861 4.16666666666667e-02 +686 864 4.16666666666667e-02 +686 860 -4.16666666666667e-02 +686 863 -4.16666666666667e-02 +686 866 -2.50000000000000e-01 +686 859 4.16666666666667e-02 +686 685 -8.33333333333333e-02 +686 865 4.16666666666667e-02 +686 858 -4.16666666666667e-02 +686 855 4.16666666666667e-02 +687 687 5.00000000000000e-01 +687 890 4.16666666666667e-02 +687 689 -8.33333333333333e-02 +687 884 4.16666666666667e-02 +687 883 4.16666666666667e-02 +687 889 -8.33333333333333e-02 +687 882 -1.25000000000000e-01 +687 878 8.33333333333333e-02 +687 877 -4.16666666666667e-02 +687 874 4.16666666666667e-02 +687 876 -1.25000000000000e-01 +687 881 4.16666666666667e-02 +687 875 -8.33333333333333e-02 +687 880 4.16666666666667e-02 +687 688 -8.33333333333333e-02 +687 886 8.33333333333333e-02 +687 879 -1.25000000000000e-01 +687 887 -4.16666666666667e-02 +687 885 -1.25000000000000e-01 +688 688 5.83333333333333e-01 +688 890 4.16666666666667e-02 +688 883 -4.16666666666667e-02 +688 882 4.16666666666667e-02 +688 888 -8.33333333333333e-02 +688 878 8.33333333333333e-02 +688 689 -1.66666666666667e-01 +688 887 8.33333333333333e-02 +688 877 -1.25000000000000e-01 +688 876 -4.16666666666667e-02 +688 873 4.16666666666667e-02 +688 881 -4.16666666666667e-02 +688 875 4.16666666666667e-02 +688 880 -4.16666666666667e-02 +688 884 -4.16666666666667e-02 +688 886 -3.75000000000000e-01 +688 879 4.16666666666667e-02 +688 687 -8.33333333333333e-02 +688 885 8.33333333333333e-02 +689 689 5.83333333333333e-01 +689 888 4.16666666666667e-02 +689 884 -4.16666666666667e-02 +689 883 -4.16666666666667e-02 +689 889 4.16666666666667e-02 +689 687 -8.33333333333333e-02 +689 882 4.16666666666667e-02 +689 878 -3.75000000000000e-01 +689 877 8.33333333333333e-02 +689 688 -1.66666666666667e-01 +689 886 8.33333333333333e-02 +689 876 8.33333333333333e-02 +689 881 -4.16666666666667e-02 +689 885 -4.16666666666667e-02 +689 887 -1.25000000000000e-01 +689 880 -4.16666666666667e-02 +689 874 4.16666666666667e-02 +689 879 4.16666666666667e-02 +689 873 -8.33333333333333e-02 +690 690 2.50000000000000e-01 +690 895 -4.16666666666667e-02 +690 892 4.16666666666667e-02 +690 894 -4.16666666666667e-02 +690 899 4.16666666666667e-02 +690 893 -8.33333333333333e-02 +690 898 4.16666666666667e-02 +690 691 -8.33333333333333e-02 +690 901 4.16666666666667e-02 +690 897 -1.25000000000000e-01 +690 896 4.16666666666667e-02 +690 900 -8.33333333333333e-02 +691 691 3.33333333333333e-01 +691 692 -8.33333333333333e-02 +691 902 4.16666666666667e-02 +691 895 -4.16666666666667e-02 +691 894 -4.16666666666667e-02 +691 891 4.16666666666667e-02 +691 899 -4.16666666666667e-02 +691 893 4.16666666666667e-02 +691 898 -4.16666666666667e-02 +691 896 4.16666666666667e-02 +691 901 -2.50000000000000e-01 +691 897 4.16666666666667e-02 +691 690 -8.33333333333333e-02 +691 900 4.16666666666667e-02 +692 692 2.50000000000000e-01 +692 895 4.16666666666667e-02 +692 691 -8.33333333333333e-02 +692 901 4.16666666666667e-02 +692 894 4.16666666666667e-02 +692 899 -4.16666666666667e-02 +692 896 -1.25000000000000e-01 +692 902 -8.33333333333333e-02 +692 898 -4.16666666666667e-02 +692 892 4.16666666666667e-02 +692 897 4.16666666666667e-02 +692 891 -8.33333333333333e-02 +693 693 7.50000000000000e-01 +693 929 4.16666666666667e-02 +693 916 -4.16666666666667e-02 +693 923 -4.16666666666667e-02 +693 694 -8.33333333333333e-02 +693 928 4.16666666666667e-02 +693 927 -2.50000000000000e-01 +693 917 8.33333333333333e-02 +693 926 4.16666666666667e-02 +693 914 -8.33333333333333e-02 +693 913 4.16666666666667e-02 +693 920 4.16666666666667e-02 +693 925 4.16666666666667e-02 +693 924 -2.50000000000000e-01 +693 911 8.33333333333333e-02 +693 908 -8.33333333333333e-02 +693 915 -1.25000000000000e-01 +693 910 8.33333333333333e-02 +693 907 -8.33333333333333e-02 +693 919 -8.33333333333333e-02 +693 922 8.33333333333333e-02 +693 921 -1.25000000000000e-01 +693 695 -8.33333333333333e-02 +694 694 6.66666666666667e-01 +694 928 -8.33333333333333e-02 +694 693 -8.33333333333333e-02 +694 927 4.16666666666667e-02 +694 914 4.16666666666667e-02 +694 912 4.16666666666667e-02 +694 925 -8.33333333333333e-02 +694 924 4.16666666666667e-02 +694 917 8.33333333333333e-02 +694 916 -1.25000000000000e-01 +694 911 -1.66666666666667e-01 +694 923 8.33333333333333e-02 +694 909 8.33333333333333e-02 +694 906 -8.33333333333333e-02 +694 920 4.16666666666667e-02 +694 908 -8.33333333333333e-02 +694 922 -3.75000000000000e-01 +694 915 -4.16666666666667e-02 +694 918 -8.33333333333333e-02 +694 921 8.33333333333333e-02 +695 695 6.66666666666667e-01 +695 927 4.16666666666667e-02 +695 929 -8.33333333333333e-02 +695 921 -4.16666666666667e-02 +695 913 4.16666666666667e-02 +695 915 8.33333333333333e-02 +695 924 4.16666666666667e-02 +695 912 -8.33333333333333e-02 +695 926 -8.33333333333333e-02 +695 918 4.16666666666667e-02 +695 917 -3.75000000000000e-01 +695 916 8.33333333333333e-02 +695 909 8.33333333333333e-02 +695 906 -8.33333333333333e-02 +695 910 -1.66666666666667e-01 +695 922 8.33333333333333e-02 +695 923 -1.25000000000000e-01 +695 693 -8.33333333333333e-02 +695 919 4.16666666666667e-02 +695 907 -8.33333333333333e-02 +696 696 4.16666666666667e-01 +696 950 4.16666666666667e-02 +696 938 -8.33333333333333e-02 +696 937 4.16666666666667e-02 +696 944 4.16666666666667e-02 +696 949 4.16666666666667e-02 +696 948 -2.50000000000000e-01 +696 935 4.16666666666667e-02 +696 932 -8.33333333333333e-02 +696 939 -8.33333333333333e-02 +696 934 4.16666666666667e-02 +696 931 -8.33333333333333e-02 +696 943 -8.33333333333333e-02 +696 946 4.16666666666667e-02 +696 945 -8.33333333333333e-02 +696 941 4.16666666666667e-02 +697 697 4.16666666666667e-01 +697 936 4.16666666666667e-02 +697 949 -8.33333333333333e-02 +697 948 4.16666666666667e-02 +697 941 4.16666666666667e-02 +697 940 -8.33333333333333e-02 +697 935 -8.33333333333333e-02 +697 947 4.16666666666667e-02 +697 933 4.16666666666667e-02 +697 930 -8.33333333333333e-02 +697 944 4.16666666666667e-02 +697 932 -8.33333333333333e-02 +697 946 -2.50000000000000e-01 +697 938 4.16666666666667e-02 +697 942 -8.33333333333333e-02 +697 945 4.16666666666667e-02 +698 698 4.16666666666667e-01 +698 939 4.16666666666667e-02 +698 948 4.16666666666667e-02 +698 936 -8.33333333333333e-02 +698 950 -8.33333333333333e-02 +698 942 4.16666666666667e-02 +698 941 -2.50000000000000e-01 +698 940 4.16666666666667e-02 +698 933 4.16666666666667e-02 +698 930 -8.33333333333333e-02 +698 934 -8.33333333333333e-02 +698 946 4.16666666666667e-02 +698 947 -8.33333333333333e-02 +698 937 4.16666666666667e-02 +698 943 4.16666666666667e-02 +698 931 -8.33333333333333e-02 +699 699 7.50000000000000e-01 +699 796 4.16666666666667e-02 +699 961 -8.33333333333333e-02 +699 953 -4.16666666666667e-02 +699 700 -8.33333333333333e-02 +699 952 8.33333333333333e-02 +699 784 4.16666666666667e-02 +699 951 -1.25000000000000e-01 +699 968 -8.33333333333333e-02 +699 959 8.33333333333333e-02 +699 797 4.16666666666667e-02 +699 965 -8.33333333333333e-02 +699 964 4.16666666666667e-02 +699 967 -8.33333333333333e-02 +699 795 -2.50000000000000e-01 +699 701 -8.33333333333333e-02 +699 956 8.33333333333333e-02 +699 785 4.16666666666667e-02 +699 955 -4.16666666666667e-02 +699 958 8.33333333333333e-02 +699 962 4.16666666666667e-02 +699 954 -1.25000000000000e-01 +699 783 -2.50000000000000e-01 +700 700 6.66666666666667e-01 +700 795 4.16666666666667e-02 +700 960 -8.33333333333333e-02 +700 953 8.33333333333333e-02 +700 952 -3.75000000000000e-01 +700 699 -8.33333333333333e-02 +700 951 8.33333333333333e-02 +700 783 4.16666666666667e-02 +700 965 4.16666666666667e-02 +700 968 -8.33333333333333e-02 +700 796 -8.33333333333333e-02 +700 963 4.16666666666667e-02 +700 966 -8.33333333333333e-02 +700 956 8.33333333333333e-02 +700 959 -1.66666666666667e-01 +700 962 4.16666666666667e-02 +700 955 -1.25000000000000e-01 +700 784 -8.33333333333333e-02 +700 954 -4.16666666666667e-02 +700 957 8.33333333333333e-02 +701 701 6.66666666666667e-01 +701 960 4.16666666666667e-02 +701 953 -1.25000000000000e-01 +701 952 8.33333333333333e-02 +701 951 -4.16666666666667e-02 +701 964 4.16666666666667e-02 +701 967 -8.33333333333333e-02 +701 966 -8.33333333333333e-02 +701 957 8.33333333333333e-02 +701 797 -8.33333333333333e-02 +701 795 4.16666666666667e-02 +701 963 -8.33333333333333e-02 +701 961 4.16666666666667e-02 +701 956 -3.75000000000000e-01 +701 785 -8.33333333333333e-02 +701 955 8.33333333333333e-02 +701 958 -1.66666666666667e-01 +701 699 -8.33333333333333e-02 +701 954 8.33333333333333e-02 +701 783 4.16666666666667e-02 +702 702 1.25000000000000e+00 +702 994 8.33333333333333e-02 +702 995 8.33333333333333e-02 +702 991 8.33333333333333e-02 +702 990 -1.25000000000000e-01 +702 704 -1.66666666666667e-01 +702 971 8.33333333333333e-02 +702 970 8.33333333333333e-02 +702 969 -3.75000000000000e-01 +702 982 -8.33333333333333e-02 +702 703 -1.66666666666667e-01 +702 986 8.33333333333333e-02 +702 997 -8.33333333333333e-02 +702 988 8.33333333333333e-02 +702 983 1.66666666666667e-01 +702 989 -1.66666666666667e-01 +702 839 4.16666666666667e-02 +702 998 -8.33333333333333e-02 +702 985 8.33333333333333e-02 +702 838 -8.33333333333333e-02 +702 984 -3.75000000000000e-01 +702 953 -4.16666666666667e-02 +702 788 4.16666666666667e-02 +702 952 8.33333333333333e-02 +702 787 -8.33333333333333e-02 +702 951 -1.25000000000000e-01 +702 992 -4.16666666666667e-02 +702 981 -2.50000000000000e-01 +703 703 1.25000000000000e+00 +703 993 8.33333333333333e-02 +703 995 -1.66666666666667e-01 +703 839 4.16666666666667e-02 +703 991 -3.75000000000000e-01 +703 990 8.33333333333333e-02 +703 971 -4.16666666666667e-02 +703 788 4.16666666666667e-02 +703 970 -1.25000000000000e-01 +703 969 8.33333333333333e-02 +703 981 -8.33333333333333e-02 +703 986 -4.16666666666667e-02 +703 702 -1.66666666666667e-01 +703 996 -8.33333333333333e-02 +703 987 8.33333333333333e-02 +703 998 -8.33333333333333e-02 +703 989 8.33333333333333e-02 +703 985 -1.25000000000000e-01 +703 984 8.33333333333333e-02 +703 837 -8.33333333333333e-02 +703 953 8.33333333333333e-02 +703 704 -1.66666666666667e-01 +703 983 1.66666666666667e-01 +703 952 -3.75000000000000e-01 +703 992 8.33333333333333e-02 +703 982 -2.50000000000000e-01 +703 951 8.33333333333333e-02 +703 786 -8.33333333333333e-02 +704 704 1.25000000000000e+00 +704 991 8.33333333333333e-02 +704 994 -1.66666666666667e-01 +704 993 8.33333333333333e-02 +704 992 -1.25000000000000e-01 +704 838 4.16666666666667e-02 +704 971 -1.25000000000000e-01 +704 970 -4.16666666666667e-02 +704 787 4.16666666666667e-02 +704 702 -1.66666666666667e-01 +704 969 8.33333333333333e-02 +704 985 -4.16666666666667e-02 +704 984 8.33333333333333e-02 +704 997 -8.33333333333333e-02 +704 988 8.33333333333333e-02 +704 981 1.66666666666667e-01 +704 987 -1.66666666666667e-01 +704 986 -1.25000000000000e-01 +704 837 4.16666666666667e-02 +704 996 -8.33333333333333e-02 +704 953 -1.25000000000000e-01 +704 990 -4.16666666666667e-02 +704 983 -7.50000000000000e-01 +704 952 8.33333333333333e-02 +704 703 -1.66666666666667e-01 +704 982 1.66666666666667e-01 +704 951 -4.16666666666667e-02 +704 786 4.16666666666667e-02 +705 705 1.25000000000000e+00 +705 1019 8.33333333333333e-02 +705 1018 -1.66666666666667e-01 +705 1016 8.33333333333333e-02 +705 874 4.16666666666667e-02 +705 1014 -3.75000000000000e-01 +705 956 8.33333333333333e-02 +705 955 -4.16666666666667e-02 +705 790 4.16666666666667e-02 +705 954 -1.25000000000000e-01 +705 1013 -8.33333333333333e-02 +705 707 -1.66666666666667e-01 +705 1021 -4.16666666666667e-02 +705 1028 -8.33333333333333e-02 +705 1025 8.33333333333333e-02 +705 1027 -8.33333333333333e-02 +705 1024 8.33333333333333e-02 +705 1022 8.33333333333333e-02 +705 875 -8.33333333333333e-02 +705 1020 -1.25000000000000e-01 +705 1001 8.33333333333333e-02 +705 791 -8.33333333333333e-02 +705 1000 8.33333333333333e-02 +705 706 -1.66666666666667e-01 +705 1012 1.66666666666667e-01 +705 999 -3.75000000000000e-01 +705 1015 8.33333333333333e-02 +705 1011 -2.50000000000000e-01 +706 706 1.25000000000000e+00 +706 1019 8.33333333333333e-02 +706 1014 8.33333333333333e-02 +706 1017 -1.66666666666667e-01 +706 1015 -1.25000000000000e-01 +706 873 4.16666666666667e-02 +706 956 8.33333333333333e-02 +706 707 -1.66666666666667e-01 +706 955 -1.25000000000000e-01 +706 954 -4.16666666666667e-02 +706 789 4.16666666666667e-02 +706 1020 -4.16666666666667e-02 +706 1022 8.33333333333333e-02 +706 1013 1.66666666666667e-01 +706 1025 -1.66666666666667e-01 +706 1026 -8.33333333333333e-02 +706 1023 8.33333333333333e-02 +706 875 4.16666666666667e-02 +706 1028 -8.33333333333333e-02 +706 1021 -1.25000000000000e-01 +706 1001 -4.16666666666667e-02 +706 791 4.16666666666667e-02 +706 1000 -1.25000000000000e-01 +706 1016 -4.16666666666667e-02 +706 1012 -7.50000000000000e-01 +706 999 8.33333333333333e-02 +706 705 -1.66666666666667e-01 +706 1011 1.66666666666667e-01 +707 707 1.25000000000000e+00 +707 1018 8.33333333333333e-02 +707 1017 8.33333333333333e-02 +707 1016 -1.25000000000000e-01 +707 1014 8.33333333333333e-02 +707 956 -3.75000000000000e-01 +707 955 8.33333333333333e-02 +707 706 -1.66666666666667e-01 +707 954 8.33333333333333e-02 +707 1011 -8.33333333333333e-02 +707 705 -1.66666666666667e-01 +707 1021 8.33333333333333e-02 +707 1026 -8.33333333333333e-02 +707 1023 8.33333333333333e-02 +707 1012 1.66666666666667e-01 +707 1024 -1.66666666666667e-01 +707 1022 -3.75000000000000e-01 +707 874 4.16666666666667e-02 +707 1027 -8.33333333333333e-02 +707 1020 8.33333333333333e-02 +707 873 -8.33333333333333e-02 +707 1001 -1.25000000000000e-01 +707 1015 -4.16666666666667e-02 +707 1013 -2.50000000000000e-01 +707 1000 -4.16666666666667e-02 +707 790 4.16666666666667e-02 +707 999 8.33333333333333e-02 +707 789 -8.33333333333333e-02 +708 708 2.50000000000000e+00 +708 1045 1.66666666666667e-01 +708 1044 -2.50000000000000e-01 +708 974 -1.66666666666667e-01 +708 973 8.33333333333333e-02 +708 1031 1.66666666666667e-01 +708 1057 8.33333333333333e-02 +708 1030 1.66666666666667e-01 +708 1029 -7.50000000000000e-01 +708 1058 8.33333333333333e-02 +708 982 -8.33333333333333e-02 +708 983 1.66666666666667e-01 +708 710 -3.33333333333333e-01 +708 794 -8.33333333333333e-02 +708 981 -2.50000000000000e-01 +708 1049 8.33333333333333e-02 +708 908 -8.33333333333333e-02 +708 1048 -1.66666666666667e-01 +708 959 8.33333333333333e-02 +708 1042 1.66666666666667e-01 +708 709 -3.33333333333333e-01 +708 1043 1.66666666666667e-01 +708 907 -8.33333333333333e-02 +708 1041 -7.50000000000000e-01 +708 958 8.33333333333333e-02 +708 793 -8.33333333333333e-02 +708 1013 -8.33333333333333e-02 +708 1004 8.33333333333333e-02 +708 1054 8.33333333333333e-02 +708 1051 -8.33333333333333e-02 +708 1003 -1.66666666666667e-01 +708 1012 1.66666666666667e-01 +708 1011 -2.50000000000000e-01 +708 1052 1.66666666666667e-01 +708 1055 -1.66666666666667e-01 +708 1050 -2.50000000000000e-01 +708 1046 -8.33333333333333e-02 +709 709 2.50000000000000e+00 +709 1044 1.66666666666667e-01 +709 1046 1.66666666666667e-01 +709 1045 -7.50000000000000e-01 +709 972 8.33333333333333e-02 +709 1031 -8.33333333333333e-02 +709 1056 8.33333333333333e-02 +709 1030 -2.50000000000000e-01 +709 1029 1.66666666666667e-01 +709 1058 -1.66666666666667e-01 +709 981 -8.33333333333333e-02 +709 1049 8.33333333333333e-02 +709 983 1.66666666666667e-01 +709 982 -2.50000000000000e-01 +709 1047 -1.66666666666667e-01 +709 1043 -8.33333333333333e-02 +709 1041 1.66666666666667e-01 +709 708 -3.33333333333333e-01 +709 1042 -2.50000000000000e-01 +709 906 -8.33333333333333e-02 +709 959 -1.66666666666667e-01 +709 957 8.33333333333333e-02 +709 792 -8.33333333333333e-02 +709 1013 1.66666666666667e-01 +709 710 -3.33333333333333e-01 +709 1052 1.66666666666667e-01 +709 1053 8.33333333333333e-02 +709 1050 -8.33333333333333e-02 +709 1004 8.33333333333333e-02 +709 794 -8.33333333333333e-02 +709 1012 -7.50000000000000e-01 +709 1002 -1.66666666666667e-01 +709 1011 1.66666666666667e-01 +709 1055 8.33333333333333e-02 +709 908 -8.33333333333333e-02 +709 1051 -2.50000000000000e-01 +709 974 8.33333333333333e-02 +710 710 2.50000000000000e+00 +710 973 8.33333333333333e-02 +710 1046 -2.50000000000000e-01 +710 1045 1.66666666666667e-01 +710 972 -1.66666666666667e-01 +710 1030 -8.33333333333333e-02 +710 1029 1.66666666666667e-01 +710 1031 -2.50000000000000e-01 +710 1057 -1.66666666666667e-01 +710 1056 8.33333333333333e-02 +710 1048 8.33333333333333e-02 +710 981 1.66666666666667e-01 +710 708 -3.33333333333333e-01 +710 983 -7.50000000000000e-01 +710 982 1.66666666666667e-01 +710 792 -8.33333333333333e-02 +710 1047 8.33333333333333e-02 +710 906 -8.33333333333333e-02 +710 1042 -8.33333333333333e-02 +710 957 8.33333333333333e-02 +710 1043 -2.50000000000000e-01 +710 1041 1.66666666666667e-01 +710 958 -1.66666666666667e-01 +710 1011 -8.33333333333333e-02 +710 1002 8.33333333333333e-02 +710 1012 1.66666666666667e-01 +710 709 -3.33333333333333e-01 +710 1051 1.66666666666667e-01 +710 1013 -2.50000000000000e-01 +710 1003 8.33333333333333e-02 +710 793 -8.33333333333333e-02 +710 1052 -7.50000000000000e-01 +710 1044 -8.33333333333333e-02 +710 1054 8.33333333333333e-02 +710 907 -8.33333333333333e-02 +710 1050 1.66666666666667e-01 +710 1053 -1.66666666666667e-01 +711 711 7.50000000000000e-01 +711 820 4.16666666666667e-02 +711 1069 -8.33333333333333e-02 +711 1061 -4.16666666666667e-02 +711 712 -8.33333333333333e-02 +711 1060 8.33333333333333e-02 +711 799 4.16666666666667e-02 +711 1059 -1.25000000000000e-01 +711 1076 -8.33333333333333e-02 +711 1067 8.33333333333333e-02 +711 821 4.16666666666667e-02 +711 1073 -8.33333333333333e-02 +711 1072 4.16666666666667e-02 +711 1075 -8.33333333333333e-02 +711 819 -2.50000000000000e-01 +711 713 -8.33333333333333e-02 +711 1064 8.33333333333333e-02 +711 800 4.16666666666667e-02 +711 1063 -4.16666666666667e-02 +711 1066 8.33333333333333e-02 +711 1070 4.16666666666667e-02 +711 1062 -1.25000000000000e-01 +711 798 -2.50000000000000e-01 +712 712 6.66666666666667e-01 +712 819 4.16666666666667e-02 +712 1068 -8.33333333333333e-02 +712 1061 8.33333333333333e-02 +712 1060 -3.75000000000000e-01 +712 711 -8.33333333333333e-02 +712 1059 8.33333333333333e-02 +712 798 4.16666666666667e-02 +712 1073 4.16666666666667e-02 +712 1076 -8.33333333333333e-02 +712 820 -8.33333333333333e-02 +712 1071 4.16666666666667e-02 +712 1074 -8.33333333333333e-02 +712 1064 8.33333333333333e-02 +712 1067 -1.66666666666667e-01 +712 1070 4.16666666666667e-02 +712 1063 -1.25000000000000e-01 +712 799 -8.33333333333333e-02 +712 1062 -4.16666666666667e-02 +712 1065 8.33333333333333e-02 +713 713 6.66666666666667e-01 +713 1068 4.16666666666667e-02 +713 1061 -1.25000000000000e-01 +713 1060 8.33333333333333e-02 +713 1059 -4.16666666666667e-02 +713 1072 4.16666666666667e-02 +713 1075 -8.33333333333333e-02 +713 1074 -8.33333333333333e-02 +713 1065 8.33333333333333e-02 +713 821 -8.33333333333333e-02 +713 819 4.16666666666667e-02 +713 1071 -8.33333333333333e-02 +713 1069 4.16666666666667e-02 +713 1064 -3.75000000000000e-01 +713 800 -8.33333333333333e-02 +713 1063 8.33333333333333e-02 +713 1066 -1.66666666666667e-01 +713 711 -8.33333333333333e-02 +713 1062 8.33333333333333e-02 +713 798 4.16666666666667e-02 +714 714 1.25000000000000e+00 +714 1087 -8.33333333333333e-02 +714 1079 8.33333333333333e-02 +714 1078 8.33333333333333e-02 +714 1077 -3.75000000000000e-01 +714 1094 -8.33333333333333e-02 +714 1093 -8.33333333333333e-02 +714 1085 -1.66666666666667e-01 +714 1084 8.33333333333333e-02 +714 986 8.33333333333333e-02 +714 716 -1.66666666666667e-01 +714 1082 1.66666666666667e-01 +714 1090 8.33333333333333e-02 +714 1081 -8.33333333333333e-02 +714 803 -4.16666666666667e-02 +714 962 4.16666666666667e-02 +714 802 8.33333333333333e-02 +714 961 -8.33333333333333e-02 +714 801 -1.25000000000000e-01 +714 1080 -2.50000000000000e-01 +714 842 -4.16666666666667e-02 +714 1091 8.33333333333333e-02 +714 715 -1.66666666666667e-01 +714 841 8.33333333333333e-02 +714 985 8.33333333333333e-02 +714 1088 4.16666666666667e-02 +714 840 -1.25000000000000e-01 +714 984 -3.75000000000000e-01 +715 715 1.25000000000000e+00 +715 1086 -8.33333333333333e-02 +715 1079 -4.16666666666667e-02 +715 1078 -1.25000000000000e-01 +715 1077 8.33333333333333e-02 +715 1094 -8.33333333333333e-02 +715 1085 8.33333333333333e-02 +715 1092 -8.33333333333333e-02 +715 1083 8.33333333333333e-02 +715 986 -4.16666666666667e-02 +715 962 4.16666666666667e-02 +715 1089 8.33333333333333e-02 +715 1080 -8.33333333333333e-02 +715 803 8.33333333333333e-02 +715 716 -1.66666666666667e-01 +715 1082 1.66666666666667e-01 +715 802 -3.75000000000000e-01 +715 1081 -2.50000000000000e-01 +715 801 8.33333333333333e-02 +715 960 -8.33333333333333e-02 +715 842 8.33333333333333e-02 +715 1091 -1.66666666666667e-01 +715 1088 4.16666666666667e-02 +715 841 -3.75000000000000e-01 +715 985 -1.25000000000000e-01 +715 714 -1.66666666666667e-01 +715 840 8.33333333333333e-02 +715 984 8.33333333333333e-02 +716 716 1.25000000000000e+00 +716 1087 4.16666666666667e-02 +716 1079 -1.25000000000000e-01 +716 1078 -4.16666666666667e-02 +716 1077 8.33333333333333e-02 +716 1092 -8.33333333333333e-02 +716 1093 -8.33333333333333e-02 +716 1084 8.33333333333333e-02 +716 1083 -1.66666666666667e-01 +716 985 -4.16666666666667e-02 +716 961 4.16666666666667e-02 +716 984 8.33333333333333e-02 +716 714 -1.66666666666667e-01 +716 1080 1.66666666666667e-01 +716 803 -1.25000000000000e-01 +716 1082 -7.50000000000000e-01 +716 802 8.33333333333333e-02 +716 715 -1.66666666666667e-01 +716 1081 1.66666666666667e-01 +716 801 -4.16666666666667e-02 +716 960 4.16666666666667e-02 +716 1086 4.16666666666667e-02 +716 842 -1.25000000000000e-01 +716 986 -1.25000000000000e-01 +716 841 8.33333333333333e-02 +716 1090 -1.66666666666667e-01 +716 840 -4.16666666666667e-02 +716 1089 8.33333333333333e-02 +717 717 1.25000000000000e+00 +717 1108 8.33333333333333e-02 +717 1109 8.33333333333333e-02 +717 1105 8.33333333333333e-02 +717 1104 -1.25000000000000e-01 +717 719 -1.66666666666667e-01 +717 1079 8.33333333333333e-02 +717 1078 8.33333333333333e-02 +717 1077 -3.75000000000000e-01 +717 1096 -8.33333333333333e-02 +717 718 -1.66666666666667e-01 +717 1100 8.33333333333333e-02 +717 1111 -8.33333333333333e-02 +717 1102 8.33333333333333e-02 +717 1097 1.66666666666667e-01 +717 1103 -1.66666666666667e-01 +717 857 4.16666666666667e-02 +717 1112 -8.33333333333333e-02 +717 1099 8.33333333333333e-02 +717 856 -8.33333333333333e-02 +717 1098 -3.75000000000000e-01 +717 1061 -4.16666666666667e-02 +717 806 4.16666666666667e-02 +717 1060 8.33333333333333e-02 +717 805 -8.33333333333333e-02 +717 1059 -1.25000000000000e-01 +717 1106 -4.16666666666667e-02 +717 1095 -2.50000000000000e-01 +718 718 1.25000000000000e+00 +718 1107 8.33333333333333e-02 +718 1109 -1.66666666666667e-01 +718 857 4.16666666666667e-02 +718 1105 -3.75000000000000e-01 +718 1104 8.33333333333333e-02 +718 1079 -4.16666666666667e-02 +718 806 4.16666666666667e-02 +718 1078 -1.25000000000000e-01 +718 1077 8.33333333333333e-02 +718 1095 -8.33333333333333e-02 +718 1100 -4.16666666666667e-02 +718 717 -1.66666666666667e-01 +718 1110 -8.33333333333333e-02 +718 1101 8.33333333333333e-02 +718 1112 -8.33333333333333e-02 +718 1103 8.33333333333333e-02 +718 1099 -1.25000000000000e-01 +718 1098 8.33333333333333e-02 +718 855 -8.33333333333333e-02 +718 1061 8.33333333333333e-02 +718 719 -1.66666666666667e-01 +718 1097 1.66666666666667e-01 +718 1060 -3.75000000000000e-01 +718 1106 8.33333333333333e-02 +718 1096 -2.50000000000000e-01 +718 1059 8.33333333333333e-02 +718 804 -8.33333333333333e-02 +719 719 1.25000000000000e+00 +719 1105 8.33333333333333e-02 +719 1108 -1.66666666666667e-01 +719 1107 8.33333333333333e-02 +719 1106 -1.25000000000000e-01 +719 856 4.16666666666667e-02 +719 1079 -1.25000000000000e-01 +719 1078 -4.16666666666667e-02 +719 805 4.16666666666667e-02 +719 717 -1.66666666666667e-01 +719 1077 8.33333333333333e-02 +719 1099 -4.16666666666667e-02 +719 1098 8.33333333333333e-02 +719 1111 -8.33333333333333e-02 +719 1102 8.33333333333333e-02 +719 1095 1.66666666666667e-01 +719 1101 -1.66666666666667e-01 +719 1100 -1.25000000000000e-01 +719 855 4.16666666666667e-02 +719 1110 -8.33333333333333e-02 +719 1061 -1.25000000000000e-01 +719 1104 -4.16666666666667e-02 +719 1097 -7.50000000000000e-01 +719 1060 8.33333333333333e-02 +719 718 -1.66666666666667e-01 +719 1096 1.66666666666667e-01 +719 1059 -4.16666666666667e-02 +719 804 4.16666666666667e-02 +720 720 1.25000000000000e+00 +720 1130 -8.33333333333333e-02 +720 1123 4.16666666666667e-02 +720 1129 -8.33333333333333e-02 +720 1124 -8.33333333333333e-02 +720 1115 8.33333333333333e-02 +720 1114 8.33333333333333e-02 +720 1120 -1.66666666666667e-01 +720 1113 -3.75000000000000e-01 +720 1127 8.33333333333333e-02 +720 1118 -8.33333333333333e-02 +720 721 -1.66666666666667e-01 +720 1117 1.66666666666667e-01 +720 1015 8.33333333333333e-02 +720 809 8.33333333333333e-02 +720 965 -8.33333333333333e-02 +720 808 -4.16666666666667e-02 +720 964 4.16666666666667e-02 +720 807 -1.25000000000000e-01 +720 1116 -2.50000000000000e-01 +720 722 -1.66666666666667e-01 +720 878 8.33333333333333e-02 +720 1016 8.33333333333333e-02 +720 877 -4.16666666666667e-02 +720 1126 8.33333333333333e-02 +720 1121 8.33333333333333e-02 +720 876 -1.25000000000000e-01 +720 1014 -3.75000000000000e-01 +721 721 1.25000000000000e+00 +721 1128 -8.33333333333333e-02 +721 1124 4.16666666666667e-02 +721 1130 -8.33333333333333e-02 +721 1115 -4.16666666666667e-02 +721 1121 8.33333333333333e-02 +721 1114 -1.25000000000000e-01 +721 1113 8.33333333333333e-02 +721 1119 -1.66666666666667e-01 +721 965 4.16666666666667e-02 +721 1016 -4.16666666666667e-02 +721 720 -1.66666666666667e-01 +721 1116 1.66666666666667e-01 +721 1014 8.33333333333333e-02 +721 809 8.33333333333333e-02 +721 722 -1.66666666666667e-01 +721 1118 1.66666666666667e-01 +721 808 -1.25000000000000e-01 +721 1117 -7.50000000000000e-01 +721 807 -4.16666666666667e-02 +721 963 4.16666666666667e-02 +721 878 8.33333333333333e-02 +721 1127 -1.66666666666667e-01 +721 1122 4.16666666666667e-02 +721 877 -1.25000000000000e-01 +721 1015 -1.25000000000000e-01 +721 876 -4.16666666666667e-02 +721 1125 8.33333333333333e-02 +722 722 1.25000000000000e+00 +722 1128 -8.33333333333333e-02 +722 1123 4.16666666666667e-02 +722 1129 -8.33333333333333e-02 +722 1122 -8.33333333333333e-02 +722 1115 -1.25000000000000e-01 +722 1114 -4.16666666666667e-02 +722 1120 8.33333333333333e-02 +722 1113 8.33333333333333e-02 +722 1125 8.33333333333333e-02 +722 1116 -8.33333333333333e-02 +722 964 4.16666666666667e-02 +722 1015 -4.16666666666667e-02 +722 809 -3.75000000000000e-01 +722 1118 -2.50000000000000e-01 +722 808 8.33333333333333e-02 +722 721 -1.66666666666667e-01 +722 1117 1.66666666666667e-01 +722 807 8.33333333333333e-02 +722 963 -8.33333333333333e-02 +722 1119 8.33333333333333e-02 +722 878 -3.75000000000000e-01 +722 1016 -1.25000000000000e-01 +722 877 8.33333333333333e-02 +722 1126 -1.66666666666667e-01 +722 720 -1.66666666666667e-01 +722 876 8.33333333333333e-02 +722 1014 8.33333333333333e-02 +723 723 1.25000000000000e+00 +723 1139 8.33333333333333e-02 +723 1138 -1.66666666666667e-01 +723 1136 8.33333333333333e-02 +723 892 4.16666666666667e-02 +723 1134 -3.75000000000000e-01 +723 1064 8.33333333333333e-02 +723 1063 -4.16666666666667e-02 +723 811 4.16666666666667e-02 +723 1062 -1.25000000000000e-01 +723 1133 -8.33333333333333e-02 +723 725 -1.66666666666667e-01 +723 1141 -4.16666666666667e-02 +723 1148 -8.33333333333333e-02 +723 1145 8.33333333333333e-02 +723 1147 -8.33333333333333e-02 +723 1144 8.33333333333333e-02 +723 1142 8.33333333333333e-02 +723 893 -8.33333333333333e-02 +723 1140 -1.25000000000000e-01 +723 1115 8.33333333333333e-02 +723 812 -8.33333333333333e-02 +723 1114 8.33333333333333e-02 +723 724 -1.66666666666667e-01 +723 1132 1.66666666666667e-01 +723 1113 -3.75000000000000e-01 +723 1135 8.33333333333333e-02 +723 1131 -2.50000000000000e-01 +724 724 1.25000000000000e+00 +724 1139 8.33333333333333e-02 +724 1134 8.33333333333333e-02 +724 1137 -1.66666666666667e-01 +724 1135 -1.25000000000000e-01 +724 891 4.16666666666667e-02 +724 1064 8.33333333333333e-02 +724 725 -1.66666666666667e-01 +724 1063 -1.25000000000000e-01 +724 1062 -4.16666666666667e-02 +724 810 4.16666666666667e-02 +724 1140 -4.16666666666667e-02 +724 1142 8.33333333333333e-02 +724 1133 1.66666666666667e-01 +724 1145 -1.66666666666667e-01 +724 1146 -8.33333333333333e-02 +724 1143 8.33333333333333e-02 +724 893 4.16666666666667e-02 +724 1148 -8.33333333333333e-02 +724 1141 -1.25000000000000e-01 +724 1115 -4.16666666666667e-02 +724 812 4.16666666666667e-02 +724 1114 -1.25000000000000e-01 +724 1136 -4.16666666666667e-02 +724 1132 -7.50000000000000e-01 +724 1113 8.33333333333333e-02 +724 723 -1.66666666666667e-01 +724 1131 1.66666666666667e-01 +725 725 1.25000000000000e+00 +725 1138 8.33333333333333e-02 +725 1137 8.33333333333333e-02 +725 1136 -1.25000000000000e-01 +725 1134 8.33333333333333e-02 +725 1064 -3.75000000000000e-01 +725 1063 8.33333333333333e-02 +725 724 -1.66666666666667e-01 +725 1062 8.33333333333333e-02 +725 1131 -8.33333333333333e-02 +725 723 -1.66666666666667e-01 +725 1141 8.33333333333333e-02 +725 1146 -8.33333333333333e-02 +725 1143 8.33333333333333e-02 +725 1132 1.66666666666667e-01 +725 1144 -1.66666666666667e-01 +725 1142 -3.75000000000000e-01 +725 892 4.16666666666667e-02 +725 1147 -8.33333333333333e-02 +725 1140 8.33333333333333e-02 +725 891 -8.33333333333333e-02 +725 1115 -1.25000000000000e-01 +725 1135 -4.16666666666667e-02 +725 1133 -2.50000000000000e-01 +725 1114 -4.16666666666667e-02 +725 811 4.16666666666667e-02 +725 1113 8.33333333333333e-02 +725 810 -8.33333333333333e-02 +726 726 2.50000000000000e+00 +726 1156 -1.66666666666667e-01 +726 1151 1.66666666666667e-01 +726 1163 -1.66666666666667e-01 +726 1165 -8.33333333333333e-02 +726 1162 8.33333333333333e-02 +726 1166 -8.33333333333333e-02 +726 1150 1.66666666666667e-01 +726 1149 -7.50000000000000e-01 +726 1082 1.66666666666667e-01 +726 988 8.33333333333333e-02 +726 1081 -8.33333333333333e-02 +726 989 -1.66666666666667e-01 +726 815 8.33333333333333e-02 +726 1080 -2.50000000000000e-01 +726 1154 -8.33333333333333e-02 +726 911 8.33333333333333e-02 +726 727 -3.33333333333333e-01 +726 1153 1.66666666666667e-01 +726 1152 -2.50000000000000e-01 +726 1118 -8.33333333333333e-02 +726 1117 1.66666666666667e-01 +726 968 -8.33333333333333e-02 +726 1019 8.33333333333333e-02 +726 1042 1.66666666666667e-01 +726 1018 -1.66666666666667e-01 +726 814 8.33333333333333e-02 +726 967 -8.33333333333333e-02 +726 1116 -2.50000000000000e-01 +726 728 -3.33333333333333e-01 +726 1160 1.66666666666667e-01 +726 1043 1.66666666666667e-01 +726 1159 -8.33333333333333e-02 +726 910 8.33333333333333e-02 +726 1157 8.33333333333333e-02 +726 1158 -2.50000000000000e-01 +726 1041 -7.50000000000000e-01 +727 727 2.50000000000000e+00 +727 1155 -1.66666666666667e-01 +727 1151 -8.33333333333333e-02 +727 1166 -8.33333333333333e-02 +727 1163 8.33333333333333e-02 +727 1164 -8.33333333333333e-02 +727 1161 8.33333333333333e-02 +727 1150 -2.50000000000000e-01 +727 1149 1.66666666666667e-01 +727 987 8.33333333333333e-02 +727 1080 -8.33333333333333e-02 +727 989 8.33333333333333e-02 +727 1082 1.66666666666667e-01 +727 1081 -2.50000000000000e-01 +727 1154 1.66666666666667e-01 +727 1153 -7.50000000000000e-01 +727 726 -3.33333333333333e-01 +727 1152 1.66666666666667e-01 +727 1043 -8.33333333333333e-02 +727 728 -3.33333333333333e-01 +727 968 -8.33333333333333e-02 +727 1019 8.33333333333333e-02 +727 1116 1.66666666666667e-01 +727 1041 1.66666666666667e-01 +727 1017 -1.66666666666667e-01 +727 815 -1.66666666666667e-01 +727 1118 1.66666666666667e-01 +727 1117 -7.50000000000000e-01 +727 813 8.33333333333333e-02 +727 966 -8.33333333333333e-02 +727 1160 1.66666666666667e-01 +727 911 -1.66666666666667e-01 +727 1157 8.33333333333333e-02 +727 1159 -2.50000000000000e-01 +727 1042 -2.50000000000000e-01 +727 1158 -8.33333333333333e-02 +727 909 8.33333333333333e-02 +728 728 2.50000000000000e+00 +728 1156 8.33333333333333e-02 +728 1150 -8.33333333333333e-02 +728 1165 -8.33333333333333e-02 +728 1162 8.33333333333333e-02 +728 1149 1.66666666666667e-01 +728 1161 -1.66666666666667e-01 +728 1164 -8.33333333333333e-02 +728 1151 -2.50000000000000e-01 +728 1080 1.66666666666667e-01 +728 988 8.33333333333333e-02 +728 987 -1.66666666666667e-01 +728 1082 -7.50000000000000e-01 +728 1081 1.66666666666667e-01 +728 813 8.33333333333333e-02 +728 1154 -2.50000000000000e-01 +728 1153 1.66666666666667e-01 +728 1152 -8.33333333333333e-02 +728 909 8.33333333333333e-02 +728 1042 -8.33333333333333e-02 +728 727 -3.33333333333333e-01 +728 1116 -8.33333333333333e-02 +728 967 -8.33333333333333e-02 +728 1018 8.33333333333333e-02 +728 966 -8.33333333333333e-02 +728 1017 8.33333333333333e-02 +728 1118 -2.50000000000000e-01 +728 814 -1.66666666666667e-01 +728 1117 1.66666666666667e-01 +728 1155 8.33333333333333e-02 +728 1160 -7.50000000000000e-01 +728 1043 -2.50000000000000e-01 +728 1159 1.66666666666667e-01 +728 910 -1.66666666666667e-01 +728 726 -3.33333333333333e-01 +728 1158 1.66666666666667e-01 +728 1041 1.66666666666667e-01 +729 729 2.50000000000000e+00 +729 1171 1.66666666666667e-01 +729 1170 -2.50000000000000e-01 +729 1085 -1.66666666666667e-01 +729 1084 8.33333333333333e-02 +729 1151 1.66666666666667e-01 +729 1183 8.33333333333333e-02 +729 1150 1.66666666666667e-01 +729 1149 -7.50000000000000e-01 +729 1184 8.33333333333333e-02 +729 1096 -8.33333333333333e-02 +729 1097 1.66666666666667e-01 +729 731 -3.33333333333333e-01 +729 818 -8.33333333333333e-02 +729 1095 -2.50000000000000e-01 +729 1175 8.33333333333333e-02 +729 932 -8.33333333333333e-02 +729 1174 -1.66666666666667e-01 +729 1067 8.33333333333333e-02 +729 1168 1.66666666666667e-01 +729 730 -3.33333333333333e-01 +729 1169 1.66666666666667e-01 +729 931 -8.33333333333333e-02 +729 1167 -7.50000000000000e-01 +729 1066 8.33333333333333e-02 +729 817 -8.33333333333333e-02 +729 1133 -8.33333333333333e-02 +729 1121 8.33333333333333e-02 +729 1180 8.33333333333333e-02 +729 1177 -8.33333333333333e-02 +729 1120 -1.66666666666667e-01 +729 1132 1.66666666666667e-01 +729 1131 -2.50000000000000e-01 +729 1178 1.66666666666667e-01 +729 1181 -1.66666666666667e-01 +729 1176 -2.50000000000000e-01 +729 1172 -8.33333333333333e-02 +730 730 2.50000000000000e+00 +730 1170 1.66666666666667e-01 +730 1172 1.66666666666667e-01 +730 1171 -7.50000000000000e-01 +730 1083 8.33333333333333e-02 +730 1151 -8.33333333333333e-02 +730 1182 8.33333333333333e-02 +730 1150 -2.50000000000000e-01 +730 1149 1.66666666666667e-01 +730 1184 -1.66666666666667e-01 +730 1095 -8.33333333333333e-02 +730 1175 8.33333333333333e-02 +730 1097 1.66666666666667e-01 +730 1096 -2.50000000000000e-01 +730 1173 -1.66666666666667e-01 +730 1169 -8.33333333333333e-02 +730 1167 1.66666666666667e-01 +730 729 -3.33333333333333e-01 +730 1168 -2.50000000000000e-01 +730 930 -8.33333333333333e-02 +730 1067 -1.66666666666667e-01 +730 1065 8.33333333333333e-02 +730 816 -8.33333333333333e-02 +730 1133 1.66666666666667e-01 +730 731 -3.33333333333333e-01 +730 1178 1.66666666666667e-01 +730 1179 8.33333333333333e-02 +730 1176 -8.33333333333333e-02 +730 1121 8.33333333333333e-02 +730 818 -8.33333333333333e-02 +730 1132 -7.50000000000000e-01 +730 1119 -1.66666666666667e-01 +730 1131 1.66666666666667e-01 +730 1181 8.33333333333333e-02 +730 932 -8.33333333333333e-02 +730 1177 -2.50000000000000e-01 +730 1085 8.33333333333333e-02 +731 731 2.50000000000000e+00 +731 1084 8.33333333333333e-02 +731 1172 -2.50000000000000e-01 +731 1171 1.66666666666667e-01 +731 1083 -1.66666666666667e-01 +731 1150 -8.33333333333333e-02 +731 1149 1.66666666666667e-01 +731 1151 -2.50000000000000e-01 +731 1183 -1.66666666666667e-01 +731 1182 8.33333333333333e-02 +731 1174 8.33333333333333e-02 +731 1095 1.66666666666667e-01 +731 729 -3.33333333333333e-01 +731 1097 -7.50000000000000e-01 +731 1096 1.66666666666667e-01 +731 816 -8.33333333333333e-02 +731 1173 8.33333333333333e-02 +731 930 -8.33333333333333e-02 +731 1168 -8.33333333333333e-02 +731 1065 8.33333333333333e-02 +731 1169 -2.50000000000000e-01 +731 1167 1.66666666666667e-01 +731 1066 -1.66666666666667e-01 +731 1131 -8.33333333333333e-02 +731 1119 8.33333333333333e-02 +731 1132 1.66666666666667e-01 +731 730 -3.33333333333333e-01 +731 1177 1.66666666666667e-01 +731 1133 -2.50000000000000e-01 +731 1120 8.33333333333333e-02 +731 817 -8.33333333333333e-02 +731 1178 -7.50000000000000e-01 +731 1170 -8.33333333333333e-02 +731 1180 8.33333333333333e-02 +731 931 -8.33333333333333e-02 +731 1176 1.66666666666667e-01 +731 1179 -1.66666666666667e-01 +732 732 5.83333333333333e-01 +732 734 -1.66666666666667e-01 +732 1187 8.33333333333333e-02 +732 1189 4.16666666666667e-02 +732 1186 -4.16666666666667e-02 +732 824 -4.16666666666667e-02 +732 1070 4.16666666666667e-02 +732 823 4.16666666666667e-02 +732 1069 -8.33333333333333e-02 +732 822 -4.16666666666667e-02 +732 1185 -1.25000000000000e-01 +732 860 -4.16666666666667e-02 +732 1190 4.16666666666667e-02 +732 733 -8.33333333333333e-02 +732 859 4.16666666666667e-02 +732 1099 8.33333333333333e-02 +732 1100 8.33333333333333e-02 +732 858 -4.16666666666667e-02 +732 1098 -3.75000000000000e-01 +733 733 5.00000000000000e-01 +733 1070 4.16666666666667e-02 +733 1188 4.16666666666667e-02 +733 1185 -4.16666666666667e-02 +733 824 4.16666666666667e-02 +733 734 -8.33333333333333e-02 +733 1187 8.33333333333333e-02 +733 823 -1.25000000000000e-01 +733 1186 -1.25000000000000e-01 +733 822 4.16666666666667e-02 +733 1068 -8.33333333333333e-02 +733 860 4.16666666666667e-02 +733 1190 -8.33333333333333e-02 +733 1100 -4.16666666666667e-02 +733 859 -1.25000000000000e-01 +733 1099 -1.25000000000000e-01 +733 732 -8.33333333333333e-02 +733 858 4.16666666666667e-02 +733 1098 8.33333333333333e-02 +734 734 5.83333333333333e-01 +734 1069 4.16666666666667e-02 +734 1098 8.33333333333333e-02 +734 732 -1.66666666666667e-01 +734 1185 8.33333333333333e-02 +734 824 -4.16666666666667e-02 +734 1187 -3.75000000000000e-01 +734 823 4.16666666666667e-02 +734 733 -8.33333333333333e-02 +734 1186 8.33333333333333e-02 +734 822 -4.16666666666667e-02 +734 1068 4.16666666666667e-02 +734 1099 -4.16666666666667e-02 +734 860 -4.16666666666667e-02 +734 1100 -1.25000000000000e-01 +734 859 4.16666666666667e-02 +734 1189 -8.33333333333333e-02 +734 858 -4.16666666666667e-02 +734 1188 4.16666666666667e-02 +735 735 5.83333333333333e-01 +735 1193 -4.16666666666667e-02 +735 736 -1.66666666666667e-01 +735 1192 8.33333333333333e-02 +735 1135 8.33333333333333e-02 +735 827 4.16666666666667e-02 +735 1073 -8.33333333333333e-02 +735 826 -4.16666666666667e-02 +735 1072 4.16666666666667e-02 +735 825 -4.16666666666667e-02 +735 1191 -1.25000000000000e-01 +735 737 -8.33333333333333e-02 +735 896 4.16666666666667e-02 +735 1136 8.33333333333333e-02 +735 895 -4.16666666666667e-02 +735 1195 4.16666666666667e-02 +735 1196 4.16666666666667e-02 +735 894 -4.16666666666667e-02 +735 1134 -3.75000000000000e-01 +736 736 5.83333333333333e-01 +736 1136 -4.16666666666667e-02 +736 735 -1.66666666666667e-01 +736 1191 8.33333333333333e-02 +736 1134 8.33333333333333e-02 +736 827 4.16666666666667e-02 +736 737 -8.33333333333333e-02 +736 1193 8.33333333333333e-02 +736 826 -4.16666666666667e-02 +736 1192 -3.75000000000000e-01 +736 825 -4.16666666666667e-02 +736 1071 4.16666666666667e-02 +736 896 4.16666666666667e-02 +736 1196 -8.33333333333333e-02 +736 1073 4.16666666666667e-02 +736 895 -4.16666666666667e-02 +736 1135 -1.25000000000000e-01 +736 894 -4.16666666666667e-02 +736 1194 4.16666666666667e-02 +737 737 5.00000000000000e-01 +737 1191 -4.16666666666667e-02 +737 1072 4.16666666666667e-02 +737 1135 -4.16666666666667e-02 +737 827 -1.25000000000000e-01 +737 1193 -1.25000000000000e-01 +737 826 4.16666666666667e-02 +737 736 -8.33333333333333e-02 +737 1192 8.33333333333333e-02 +737 825 4.16666666666667e-02 +737 1071 -8.33333333333333e-02 +737 1194 4.16666666666667e-02 +737 896 -1.25000000000000e-01 +737 1136 -1.25000000000000e-01 +737 895 4.16666666666667e-02 +737 1195 -8.33333333333333e-02 +737 735 -8.33333333333333e-02 +737 894 4.16666666666667e-02 +737 1134 8.33333333333333e-02 +738 738 1.25000000000000e+00 +738 1102 8.33333333333333e-02 +738 1186 -4.16666666666667e-02 +738 1103 -1.66666666666667e-01 +738 830 4.16666666666667e-02 +738 1185 -1.25000000000000e-01 +738 1199 -4.16666666666667e-02 +738 935 4.16666666666667e-02 +738 739 -1.66666666666667e-01 +738 1198 8.33333333333333e-02 +738 1197 -1.25000000000000e-01 +738 1193 -4.16666666666667e-02 +738 1192 8.33333333333333e-02 +738 1076 -8.33333333333333e-02 +738 1139 8.33333333333333e-02 +738 1168 1.66666666666667e-01 +738 1138 -1.66666666666667e-01 +738 829 4.16666666666667e-02 +738 1075 -8.33333333333333e-02 +738 1191 -1.25000000000000e-01 +738 740 -1.66666666666667e-01 +738 1202 8.33333333333333e-02 +738 1169 1.66666666666667e-01 +738 1201 -4.16666666666667e-02 +738 934 4.16666666666667e-02 +738 1187 8.33333333333333e-02 +738 1200 -1.25000000000000e-01 +738 1167 -7.50000000000000e-01 +739 739 1.25000000000000e+00 +739 1185 -4.16666666666667e-02 +739 1103 8.33333333333333e-02 +739 1187 8.33333333333333e-02 +739 1186 -1.25000000000000e-01 +739 1199 8.33333333333333e-02 +739 1198 -3.75000000000000e-01 +739 738 -1.66666666666667e-01 +739 1197 8.33333333333333e-02 +739 1169 -8.33333333333333e-02 +739 740 -1.66666666666667e-01 +739 1076 -8.33333333333333e-02 +739 1139 8.33333333333333e-02 +739 1191 8.33333333333333e-02 +739 1167 1.66666666666667e-01 +739 1137 -1.66666666666667e-01 +739 830 -8.33333333333333e-02 +739 1193 8.33333333333333e-02 +739 1192 -3.75000000000000e-01 +739 828 4.16666666666667e-02 +739 1074 -8.33333333333333e-02 +739 1202 8.33333333333333e-02 +739 935 -8.33333333333333e-02 +739 1101 8.33333333333333e-02 +739 1201 -1.25000000000000e-01 +739 1168 -2.50000000000000e-01 +739 1200 -4.16666666666667e-02 +739 933 4.16666666666667e-02 +740 740 1.25000000000000e+00 +740 1102 8.33333333333333e-02 +740 1101 -1.66666666666667e-01 +740 1187 -3.75000000000000e-01 +740 1186 8.33333333333333e-02 +740 828 4.16666666666667e-02 +740 1199 -1.25000000000000e-01 +740 1198 8.33333333333333e-02 +740 1197 -4.16666666666667e-02 +740 933 4.16666666666667e-02 +740 1168 -8.33333333333333e-02 +740 739 -1.66666666666667e-01 +740 1191 -4.16666666666667e-02 +740 1075 -8.33333333333333e-02 +740 1138 8.33333333333333e-02 +740 1074 -8.33333333333333e-02 +740 1137 8.33333333333333e-02 +740 1193 -1.25000000000000e-01 +740 829 -8.33333333333333e-02 +740 1192 8.33333333333333e-02 +740 1185 8.33333333333333e-02 +740 1202 -3.75000000000000e-01 +740 1169 -2.50000000000000e-01 +740 1201 8.33333333333333e-02 +740 934 -8.33333333333333e-02 +740 738 -1.66666666666667e-01 +740 1200 8.33333333333333e-02 +740 1167 1.66666666666667e-01 +741 741 5.00000000000000e-01 +741 992 -4.16666666666667e-02 +741 1207 4.16666666666667e-02 +741 1204 -4.16666666666667e-02 +741 845 4.16666666666667e-02 +741 1208 -8.33333333333333e-02 +741 844 4.16666666666667e-02 +741 742 -8.33333333333333e-02 +741 991 8.33333333333333e-02 +741 843 -1.25000000000000e-01 +741 990 -1.25000000000000e-01 +741 743 -8.33333333333333e-02 +741 833 4.16666666666667e-02 +741 1205 8.33333333333333e-02 +741 832 4.16666666666667e-02 +741 976 -8.33333333333333e-02 +741 977 4.16666666666667e-02 +741 831 -1.25000000000000e-01 +741 1203 -1.25000000000000e-01 +742 742 5.83333333333333e-01 +742 992 8.33333333333333e-02 +742 1205 8.33333333333333e-02 +742 1206 4.16666666666667e-02 +742 1203 -4.16666666666667e-02 +742 845 -4.16666666666667e-02 +742 1208 4.16666666666667e-02 +742 844 -4.16666666666667e-02 +742 991 -3.75000000000000e-01 +742 843 4.16666666666667e-02 +742 741 -8.33333333333333e-02 +742 990 8.33333333333333e-02 +742 833 -4.16666666666667e-02 +742 977 4.16666666666667e-02 +742 743 -1.66666666666667e-01 +742 832 -4.16666666666667e-02 +742 1204 -1.25000000000000e-01 +742 831 4.16666666666667e-02 +742 975 -8.33333333333333e-02 +743 743 5.83333333333333e-01 +743 990 -4.16666666666667e-02 +743 742 -1.66666666666667e-01 +743 991 8.33333333333333e-02 +743 1204 8.33333333333333e-02 +743 845 -4.16666666666667e-02 +743 992 -1.25000000000000e-01 +743 844 -4.16666666666667e-02 +743 1207 4.16666666666667e-02 +743 843 4.16666666666667e-02 +743 1206 -8.33333333333333e-02 +743 975 4.16666666666667e-02 +743 833 -4.16666666666667e-02 +743 1205 -3.75000000000000e-01 +743 832 -4.16666666666667e-02 +743 976 4.16666666666667e-02 +743 741 -8.33333333333333e-02 +743 831 4.16666666666667e-02 +743 1203 8.33333333333333e-02 +744 744 1.25000000000000e+00 +744 994 8.33333333333333e-02 +744 995 8.33333333333333e-02 +744 1205 8.33333333333333e-02 +744 1203 -1.25000000000000e-01 +744 1217 8.33333333333333e-02 +744 1216 8.33333333333333e-02 +744 745 -1.66666666666667e-01 +744 1215 -3.75000000000000e-01 +744 1046 -8.33333333333333e-02 +744 746 -1.66666666666667e-01 +744 980 -8.33333333333333e-02 +744 1034 8.33333333333333e-02 +744 1210 8.33333333333333e-02 +744 1045 1.66666666666667e-01 +744 1033 -1.66666666666667e-01 +744 1211 8.33333333333333e-02 +744 836 -8.33333333333333e-02 +744 835 4.16666666666667e-02 +744 979 -8.33333333333333e-02 +744 1209 -3.75000000000000e-01 +744 1220 8.33333333333333e-02 +744 914 -8.33333333333333e-02 +744 1219 -4.16666666666667e-02 +744 913 4.16666666666667e-02 +744 1218 -1.25000000000000e-01 +744 1204 -4.16666666666667e-02 +744 1044 -2.50000000000000e-01 +745 745 1.25000000000000e+00 +745 1203 -4.16666666666667e-02 +745 993 8.33333333333333e-02 +745 995 -1.66666666666667e-01 +745 836 4.16666666666667e-02 +745 1204 -1.25000000000000e-01 +745 1217 -4.16666666666667e-02 +745 914 4.16666666666667e-02 +745 1216 -1.25000000000000e-01 +745 1215 8.33333333333333e-02 +745 744 -1.66666666666667e-01 +745 1211 -4.16666666666667e-02 +745 1209 8.33333333333333e-02 +745 980 -8.33333333333333e-02 +745 1034 8.33333333333333e-02 +745 1044 1.66666666666667e-01 +745 1032 -1.66666666666667e-01 +745 1210 -1.25000000000000e-01 +745 834 4.16666666666667e-02 +745 978 -8.33333333333333e-02 +745 1220 8.33333333333333e-02 +745 746 -1.66666666666667e-01 +745 1046 1.66666666666667e-01 +745 1219 -1.25000000000000e-01 +745 1205 8.33333333333333e-02 +745 1045 -7.50000000000000e-01 +745 1218 -4.16666666666667e-02 +745 912 4.16666666666667e-02 +746 746 1.25000000000000e+00 +746 994 -1.66666666666667e-01 +746 993 8.33333333333333e-02 +746 1205 -3.75000000000000e-01 +746 835 4.16666666666667e-02 +746 1203 8.33333333333333e-02 +746 1217 -1.25000000000000e-01 +746 1216 -4.16666666666667e-02 +746 913 4.16666666666667e-02 +746 1215 8.33333333333333e-02 +746 1044 -8.33333333333333e-02 +746 1210 -4.16666666666667e-02 +746 744 -1.66666666666667e-01 +746 978 -8.33333333333333e-02 +746 1032 8.33333333333333e-02 +746 979 -8.33333333333333e-02 +746 1033 8.33333333333333e-02 +746 1211 -1.25000000000000e-01 +746 1209 8.33333333333333e-02 +746 834 -8.33333333333333e-02 +746 1220 -3.75000000000000e-01 +746 1204 8.33333333333333e-02 +746 1046 -2.50000000000000e-01 +746 1219 8.33333333333333e-02 +746 745 -1.66666666666667e-01 +746 1045 1.66666666666667e-01 +746 1218 8.33333333333333e-02 +746 912 -8.33333333333333e-02 +747 747 5.00000000000000e-01 +747 1106 -4.16666666666667e-02 +747 1225 4.16666666666667e-02 +747 1222 -4.16666666666667e-02 +747 863 4.16666666666667e-02 +747 1226 -8.33333333333333e-02 +747 862 4.16666666666667e-02 +747 748 -8.33333333333333e-02 +747 1105 8.33333333333333e-02 +747 861 -1.25000000000000e-01 +747 1104 -1.25000000000000e-01 +747 749 -8.33333333333333e-02 +747 848 4.16666666666667e-02 +747 1223 8.33333333333333e-02 +747 847 4.16666666666667e-02 +747 1087 -8.33333333333333e-02 +747 1088 4.16666666666667e-02 +747 846 -1.25000000000000e-01 +747 1221 -1.25000000000000e-01 +748 748 5.83333333333333e-01 +748 1106 8.33333333333333e-02 +748 1223 8.33333333333333e-02 +748 1224 4.16666666666667e-02 +748 1221 -4.16666666666667e-02 +748 863 -4.16666666666667e-02 +748 1226 4.16666666666667e-02 +748 862 -4.16666666666667e-02 +748 1105 -3.75000000000000e-01 +748 861 4.16666666666667e-02 +748 747 -8.33333333333333e-02 +748 1104 8.33333333333333e-02 +748 848 -4.16666666666667e-02 +748 1088 4.16666666666667e-02 +748 749 -1.66666666666667e-01 +748 847 -4.16666666666667e-02 +748 1222 -1.25000000000000e-01 +748 846 4.16666666666667e-02 +748 1086 -8.33333333333333e-02 +749 749 5.83333333333333e-01 +749 1104 -4.16666666666667e-02 +749 748 -1.66666666666667e-01 +749 1105 8.33333333333333e-02 +749 1222 8.33333333333333e-02 +749 863 -4.16666666666667e-02 +749 1106 -1.25000000000000e-01 +749 862 -4.16666666666667e-02 +749 1225 4.16666666666667e-02 +749 861 4.16666666666667e-02 +749 1224 -8.33333333333333e-02 +749 1086 4.16666666666667e-02 +749 848 -4.16666666666667e-02 +749 1223 -3.75000000000000e-01 +749 847 -4.16666666666667e-02 +749 1087 4.16666666666667e-02 +749 747 -8.33333333333333e-02 +749 846 4.16666666666667e-02 +749 1221 8.33333333333333e-02 +750 750 1.25000000000000e+00 +750 751 -1.66666666666667e-01 +750 1232 -8.33333333333333e-02 +750 916 -4.16666666666667e-02 +750 1231 4.16666666666667e-02 +750 1229 8.33333333333333e-02 +750 850 -4.16666666666667e-02 +750 1227 -3.75000000000000e-01 +750 1207 4.16666666666667e-02 +750 851 8.33333333333333e-02 +750 1208 -8.33333333333333e-02 +750 752 -1.66666666666667e-01 +750 1217 8.33333333333333e-02 +750 917 8.33333333333333e-02 +750 1216 8.33333333333333e-02 +750 1215 -3.75000000000000e-01 +750 997 -8.33333333333333e-02 +750 1090 8.33333333333333e-02 +750 1091 8.33333333333333e-02 +750 998 -8.33333333333333e-02 +750 849 -1.25000000000000e-01 +750 1154 -8.33333333333333e-02 +750 1049 8.33333333333333e-02 +750 1153 1.66666666666667e-01 +750 1048 -1.66666666666667e-01 +750 1152 -2.50000000000000e-01 +750 1228 8.33333333333333e-02 +750 915 -1.25000000000000e-01 +751 751 1.25000000000000e+00 +751 1232 4.16666666666667e-02 +751 1227 8.33333333333333e-02 +751 750 -1.66666666666667e-01 +751 915 -4.16666666666667e-02 +751 1230 4.16666666666667e-02 +751 1228 -1.25000000000000e-01 +751 849 -4.16666666666667e-02 +751 1206 4.16666666666667e-02 +751 1208 4.16666666666667e-02 +751 1217 -4.16666666666667e-02 +751 1216 -1.25000000000000e-01 +751 1215 8.33333333333333e-02 +751 996 -8.33333333333333e-02 +751 1089 8.33333333333333e-02 +751 998 -8.33333333333333e-02 +751 1049 8.33333333333333e-02 +751 1091 -1.66666666666667e-01 +751 851 8.33333333333333e-02 +751 850 -1.25000000000000e-01 +751 1154 1.66666666666667e-01 +751 752 -1.66666666666667e-01 +751 917 8.33333333333333e-02 +751 1153 -7.50000000000000e-01 +751 1229 -4.16666666666667e-02 +751 916 -1.25000000000000e-01 +751 1152 1.66666666666667e-01 +751 1047 -1.66666666666667e-01 +752 752 1.25000000000000e+00 +752 1231 4.16666666666667e-02 +752 1230 -8.33333333333333e-02 +752 1229 -1.25000000000000e-01 +752 1227 8.33333333333333e-02 +752 1207 4.16666666666667e-02 +752 849 8.33333333333333e-02 +752 1206 -8.33333333333333e-02 +752 1217 -1.25000000000000e-01 +752 1216 -4.16666666666667e-02 +752 750 -1.66666666666667e-01 +752 1215 8.33333333333333e-02 +752 915 8.33333333333333e-02 +752 997 -8.33333333333333e-02 +752 1048 8.33333333333333e-02 +752 851 -3.75000000000000e-01 +752 1090 -1.66666666666667e-01 +752 850 8.33333333333333e-02 +752 1089 8.33333333333333e-02 +752 996 -8.33333333333333e-02 +752 1154 -2.50000000000000e-01 +752 1228 -4.16666666666667e-02 +752 917 -3.75000000000000e-01 +752 1153 1.66666666666667e-01 +752 751 -1.66666666666667e-01 +752 916 8.33333333333333e-02 +752 1152 -8.33333333333333e-02 +752 1047 8.33333333333333e-02 +753 753 1.25000000000000e+00 +753 1108 8.33333333333333e-02 +753 1109 8.33333333333333e-02 +753 1223 8.33333333333333e-02 +753 1221 -1.25000000000000e-01 +753 1235 8.33333333333333e-02 +753 1234 8.33333333333333e-02 +753 754 -1.66666666666667e-01 +753 1233 -3.75000000000000e-01 +753 1172 -8.33333333333333e-02 +753 755 -1.66666666666667e-01 +753 1094 -8.33333333333333e-02 +753 1157 8.33333333333333e-02 +753 1228 8.33333333333333e-02 +753 1171 1.66666666666667e-01 +753 1156 -1.66666666666667e-01 +753 1229 8.33333333333333e-02 +753 854 -8.33333333333333e-02 +753 853 4.16666666666667e-02 +753 1093 -8.33333333333333e-02 +753 1227 -3.75000000000000e-01 +753 1238 8.33333333333333e-02 +753 938 -8.33333333333333e-02 +753 1237 -4.16666666666667e-02 +753 937 4.16666666666667e-02 +753 1236 -1.25000000000000e-01 +753 1222 -4.16666666666667e-02 +753 1170 -2.50000000000000e-01 +754 754 1.25000000000000e+00 +754 1221 -4.16666666666667e-02 +754 1107 8.33333333333333e-02 +754 1109 -1.66666666666667e-01 +754 854 4.16666666666667e-02 +754 1222 -1.25000000000000e-01 +754 1235 -4.16666666666667e-02 +754 938 4.16666666666667e-02 +754 1234 -1.25000000000000e-01 +754 1233 8.33333333333333e-02 +754 753 -1.66666666666667e-01 +754 1229 -4.16666666666667e-02 +754 1227 8.33333333333333e-02 +754 1094 -8.33333333333333e-02 +754 1157 8.33333333333333e-02 +754 1170 1.66666666666667e-01 +754 1155 -1.66666666666667e-01 +754 1228 -1.25000000000000e-01 +754 852 4.16666666666667e-02 +754 1092 -8.33333333333333e-02 +754 1238 8.33333333333333e-02 +754 755 -1.66666666666667e-01 +754 1172 1.66666666666667e-01 +754 1237 -1.25000000000000e-01 +754 1223 8.33333333333333e-02 +754 1171 -7.50000000000000e-01 +754 1236 -4.16666666666667e-02 +754 936 4.16666666666667e-02 +755 755 1.25000000000000e+00 +755 1108 -1.66666666666667e-01 +755 1107 8.33333333333333e-02 +755 1223 -3.75000000000000e-01 +755 853 4.16666666666667e-02 +755 1221 8.33333333333333e-02 +755 1235 -1.25000000000000e-01 +755 1234 -4.16666666666667e-02 +755 937 4.16666666666667e-02 +755 1233 8.33333333333333e-02 +755 1170 -8.33333333333333e-02 +755 1228 -4.16666666666667e-02 +755 753 -1.66666666666667e-01 +755 1092 -8.33333333333333e-02 +755 1155 8.33333333333333e-02 +755 1093 -8.33333333333333e-02 +755 1156 8.33333333333333e-02 +755 1229 -1.25000000000000e-01 +755 1227 8.33333333333333e-02 +755 852 -8.33333333333333e-02 +755 1238 -3.75000000000000e-01 +755 1222 8.33333333333333e-02 +755 1172 -2.50000000000000e-01 +755 1237 8.33333333333333e-02 +755 754 -1.66666666666667e-01 +755 1171 1.66666666666667e-01 +755 1236 8.33333333333333e-02 +755 936 -8.33333333333333e-02 +756 756 6.66666666666667e-01 +756 866 4.16666666666667e-02 +756 1226 -8.33333333333333e-02 +756 758 -8.33333333333333e-02 +756 1235 8.33333333333333e-02 +756 941 4.16666666666667e-02 +756 1234 8.33333333333333e-02 +756 1233 -3.75000000000000e-01 +756 1111 -8.33333333333333e-02 +756 1189 4.16666666666667e-02 +756 1190 4.16666666666667e-02 +756 1112 -8.33333333333333e-02 +756 864 -8.33333333333333e-02 +756 1199 -4.16666666666667e-02 +756 1175 8.33333333333333e-02 +756 1198 8.33333333333333e-02 +756 1174 -1.66666666666667e-01 +756 1197 -1.25000000000000e-01 +756 1225 4.16666666666667e-02 +756 939 -8.33333333333333e-02 +757 757 6.66666666666667e-01 +757 1226 4.16666666666667e-02 +757 1235 -4.16666666666667e-02 +757 1234 -1.25000000000000e-01 +757 1233 8.33333333333333e-02 +757 1110 -8.33333333333333e-02 +757 1188 4.16666666666667e-02 +757 1112 -8.33333333333333e-02 +757 1175 8.33333333333333e-02 +757 1190 -8.33333333333333e-02 +757 866 4.16666666666667e-02 +757 865 -8.33333333333333e-02 +757 1199 8.33333333333333e-02 +757 758 -8.33333333333333e-02 +757 941 4.16666666666667e-02 +757 1198 -3.75000000000000e-01 +757 1224 4.16666666666667e-02 +757 940 -8.33333333333333e-02 +757 1197 8.33333333333333e-02 +757 1173 -1.66666666666667e-01 +758 758 7.50000000000000e-01 +758 864 4.16666666666667e-02 +758 1224 -8.33333333333333e-02 +758 1235 -1.25000000000000e-01 +758 1234 -4.16666666666667e-02 +758 756 -8.33333333333333e-02 +758 1233 8.33333333333333e-02 +758 939 4.16666666666667e-02 +758 1111 -8.33333333333333e-02 +758 1174 8.33333333333333e-02 +758 866 -2.50000000000000e-01 +758 1189 -8.33333333333333e-02 +758 865 4.16666666666667e-02 +758 1188 4.16666666666667e-02 +758 1110 -8.33333333333333e-02 +758 1199 -1.25000000000000e-01 +758 1225 4.16666666666667e-02 +758 941 -2.50000000000000e-01 +758 1198 8.33333333333333e-02 +758 757 -8.33333333333333e-02 +758 940 4.16666666666667e-02 +758 1197 -4.16666666666667e-02 +758 1173 8.33333333333333e-02 +759 759 5.00000000000000e-01 +759 1006 4.16666666666667e-02 +759 1244 4.16666666666667e-02 +759 1241 -4.16666666666667e-02 +759 869 4.16666666666667e-02 +759 1007 -8.33333333333333e-02 +759 868 4.16666666666667e-02 +759 760 -8.33333333333333e-02 +759 1240 8.33333333333333e-02 +759 867 -1.25000000000000e-01 +759 1239 -1.25000000000000e-01 +759 761 -8.33333333333333e-02 +759 881 4.16666666666667e-02 +759 1022 8.33333333333333e-02 +759 880 4.16666666666667e-02 +759 1243 -8.33333333333333e-02 +759 1021 -4.16666666666667e-02 +759 879 -1.25000000000000e-01 +759 1020 -1.25000000000000e-01 +760 760 5.83333333333333e-01 +760 1005 4.16666666666667e-02 +760 1022 8.33333333333333e-02 +760 761 -1.66666666666667e-01 +760 1241 8.33333333333333e-02 +760 869 -4.16666666666667e-02 +760 1007 4.16666666666667e-02 +760 868 -4.16666666666667e-02 +760 1240 -3.75000000000000e-01 +760 867 4.16666666666667e-02 +760 759 -8.33333333333333e-02 +760 1239 8.33333333333333e-02 +760 881 -4.16666666666667e-02 +760 1244 4.16666666666667e-02 +760 1020 -4.16666666666667e-02 +760 880 -4.16666666666667e-02 +760 1021 -1.25000000000000e-01 +760 879 4.16666666666667e-02 +760 1242 -8.33333333333333e-02 +761 761 5.83333333333333e-01 +761 760 -1.66666666666667e-01 +761 1240 8.33333333333333e-02 +761 1242 4.16666666666667e-02 +761 1239 -4.16666666666667e-02 +761 869 -4.16666666666667e-02 +761 1241 -1.25000000000000e-01 +761 868 -4.16666666666667e-02 +761 1006 4.16666666666667e-02 +761 867 4.16666666666667e-02 +761 1005 -8.33333333333333e-02 +761 1021 8.33333333333333e-02 +761 881 -4.16666666666667e-02 +761 1022 -3.75000000000000e-01 +761 880 -4.16666666666667e-02 +761 1243 4.16666666666667e-02 +761 759 -8.33333333333333e-02 +761 879 4.16666666666667e-02 +761 1020 8.33333333333333e-02 +762 762 1.25000000000000e+00 +762 1037 -1.66666666666667e-01 +762 1036 8.33333333333333e-02 +762 872 4.16666666666667e-02 +762 1246 8.33333333333333e-02 +762 1245 -3.75000000000000e-01 +762 1256 -4.16666666666667e-02 +762 920 4.16666666666667e-02 +762 1255 8.33333333333333e-02 +762 1254 -1.25000000000000e-01 +762 1010 -8.33333333333333e-02 +762 1009 -8.33333333333333e-02 +762 1025 8.33333333333333e-02 +762 1241 -4.16666666666667e-02 +762 763 -1.66666666666667e-01 +762 1024 8.33333333333333e-02 +762 1051 -8.33333333333333e-02 +762 871 -8.33333333333333e-02 +762 1240 8.33333333333333e-02 +762 1239 -1.25000000000000e-01 +762 764 -1.66666666666667e-01 +762 1253 8.33333333333333e-02 +762 1052 1.66666666666667e-01 +762 1252 8.33333333333333e-02 +762 919 -8.33333333333333e-02 +762 1247 8.33333333333333e-02 +762 1251 -3.75000000000000e-01 +762 1050 -2.50000000000000e-01 +763 763 1.25000000000000e+00 +763 1037 8.33333333333333e-02 +763 1035 8.33333333333333e-02 +763 1246 -1.25000000000000e-01 +763 1245 8.33333333333333e-02 +763 1256 8.33333333333333e-02 +763 764 -1.66666666666667e-01 +763 1255 -3.75000000000000e-01 +763 1254 8.33333333333333e-02 +763 1008 -8.33333333333333e-02 +763 1241 8.33333333333333e-02 +763 762 -1.66666666666667e-01 +763 1025 -1.66666666666667e-01 +763 1052 1.66666666666667e-01 +763 1023 8.33333333333333e-02 +763 1050 -8.33333333333333e-02 +763 872 4.16666666666667e-02 +763 1010 -8.33333333333333e-02 +763 1240 -3.75000000000000e-01 +763 870 -8.33333333333333e-02 +763 1239 8.33333333333333e-02 +763 1253 -4.16666666666667e-02 +763 920 4.16666666666667e-02 +763 1247 -4.16666666666667e-02 +763 1252 -1.25000000000000e-01 +763 1051 -2.50000000000000e-01 +763 1251 8.33333333333333e-02 +763 918 -8.33333333333333e-02 +764 764 1.25000000000000e+00 +764 1036 8.33333333333333e-02 +764 1245 8.33333333333333e-02 +764 1035 -1.66666666666667e-01 +764 1247 -1.25000000000000e-01 +764 870 4.16666666666667e-02 +764 1256 -1.25000000000000e-01 +764 1255 8.33333333333333e-02 +764 763 -1.66666666666667e-01 +764 1254 -4.16666666666667e-02 +764 918 4.16666666666667e-02 +764 1008 -8.33333333333333e-02 +764 1240 8.33333333333333e-02 +764 1023 8.33333333333333e-02 +764 1239 -4.16666666666667e-02 +764 1024 -1.66666666666667e-01 +764 1051 1.66666666666667e-01 +764 1241 -1.25000000000000e-01 +764 871 4.16666666666667e-02 +764 1009 -8.33333333333333e-02 +764 1246 -4.16666666666667e-02 +764 1253 -1.25000000000000e-01 +764 1052 -7.50000000000000e-01 +764 1252 -4.16666666666667e-02 +764 919 4.16666666666667e-02 +764 762 -1.66666666666667e-01 +764 1251 8.33333333333333e-02 +764 1050 1.66666666666667e-01 +765 765 5.00000000000000e-01 +765 1123 4.16666666666667e-02 +765 1262 4.16666666666667e-02 +765 1259 -4.16666666666667e-02 +765 884 4.16666666666667e-02 +765 1124 -8.33333333333333e-02 +765 883 4.16666666666667e-02 +765 766 -8.33333333333333e-02 +765 1258 8.33333333333333e-02 +765 882 -1.25000000000000e-01 +765 1257 -1.25000000000000e-01 +765 767 -8.33333333333333e-02 +765 899 4.16666666666667e-02 +765 1142 8.33333333333333e-02 +765 898 4.16666666666667e-02 +765 1261 -8.33333333333333e-02 +765 1141 -4.16666666666667e-02 +765 897 -1.25000000000000e-01 +765 1140 -1.25000000000000e-01 +766 766 5.83333333333333e-01 +766 1122 4.16666666666667e-02 +766 1142 8.33333333333333e-02 +766 767 -1.66666666666667e-01 +766 1259 8.33333333333333e-02 +766 884 -4.16666666666667e-02 +766 1124 4.16666666666667e-02 +766 883 -4.16666666666667e-02 +766 1258 -3.75000000000000e-01 +766 882 4.16666666666667e-02 +766 765 -8.33333333333333e-02 +766 1257 8.33333333333333e-02 +766 899 -4.16666666666667e-02 +766 1262 4.16666666666667e-02 +766 1140 -4.16666666666667e-02 +766 898 -4.16666666666667e-02 +766 1141 -1.25000000000000e-01 +766 897 4.16666666666667e-02 +766 1260 -8.33333333333333e-02 +767 767 5.83333333333333e-01 +767 766 -1.66666666666667e-01 +767 1258 8.33333333333333e-02 +767 1260 4.16666666666667e-02 +767 1257 -4.16666666666667e-02 +767 884 -4.16666666666667e-02 +767 1259 -1.25000000000000e-01 +767 883 -4.16666666666667e-02 +767 1123 4.16666666666667e-02 +767 882 4.16666666666667e-02 +767 1122 -8.33333333333333e-02 +767 1141 8.33333333333333e-02 +767 899 -4.16666666666667e-02 +767 1142 -3.75000000000000e-01 +767 898 -4.16666666666667e-02 +767 1261 4.16666666666667e-02 +767 765 -8.33333333333333e-02 +767 897 4.16666666666667e-02 +767 1140 8.33333333333333e-02 +768 768 1.25000000000000e+00 +768 1265 8.33333333333333e-02 +768 923 -4.16666666666667e-02 +768 1268 4.16666666666667e-02 +768 1267 -8.33333333333333e-02 +768 887 -4.16666666666667e-02 +768 1264 8.33333333333333e-02 +768 1263 -3.75000000000000e-01 +768 1127 8.33333333333333e-02 +768 1126 8.33333333333333e-02 +768 1160 1.66666666666667e-01 +768 1159 -8.33333333333333e-02 +768 1158 -2.50000000000000e-01 +768 1028 -8.33333333333333e-02 +768 1244 4.16666666666667e-02 +768 1027 -8.33333333333333e-02 +768 1054 8.33333333333333e-02 +768 1243 -8.33333333333333e-02 +768 886 8.33333333333333e-02 +768 885 -1.25000000000000e-01 +768 1253 8.33333333333333e-02 +768 1055 -1.66666666666667e-01 +768 1252 8.33333333333333e-02 +768 769 -1.66666666666667e-01 +768 922 8.33333333333333e-02 +768 1251 -3.75000000000000e-01 +768 770 -1.66666666666667e-01 +768 921 -1.25000000000000e-01 +769 769 1.25000000000000e+00 +769 1265 -4.16666666666667e-02 +769 1266 -8.33333333333333e-02 +769 1264 -1.25000000000000e-01 +769 1263 8.33333333333333e-02 +769 1127 -1.66666666666667e-01 +769 887 8.33333333333333e-02 +769 1125 8.33333333333333e-02 +769 1160 1.66666666666667e-01 +769 770 -1.66666666666667e-01 +769 923 8.33333333333333e-02 +769 1159 -2.50000000000000e-01 +769 1158 -8.33333333333333e-02 +769 1026 -8.33333333333333e-02 +769 1053 8.33333333333333e-02 +769 1244 4.16666666666667e-02 +769 1028 -8.33333333333333e-02 +769 886 -3.75000000000000e-01 +769 1242 -8.33333333333333e-02 +769 885 8.33333333333333e-02 +769 1253 -4.16666666666667e-02 +769 1055 8.33333333333333e-02 +769 1252 -1.25000000000000e-01 +769 1268 4.16666666666667e-02 +769 922 -3.75000000000000e-01 +769 1251 8.33333333333333e-02 +769 768 -1.66666666666667e-01 +769 921 8.33333333333333e-02 +770 770 1.25000000000000e+00 +770 1264 -4.16666666666667e-02 +770 768 -1.66666666666667e-01 +770 1263 8.33333333333333e-02 +770 921 -4.16666666666667e-02 +770 1266 4.16666666666667e-02 +770 1265 -1.25000000000000e-01 +770 885 -4.16666666666667e-02 +770 1125 8.33333333333333e-02 +770 1126 -1.66666666666667e-01 +770 886 8.33333333333333e-02 +770 1160 -7.50000000000000e-01 +770 1159 1.66666666666667e-01 +770 769 -1.66666666666667e-01 +770 922 8.33333333333333e-02 +770 1158 1.66666666666667e-01 +770 1026 -8.33333333333333e-02 +770 1242 4.16666666666667e-02 +770 887 -1.25000000000000e-01 +770 1243 4.16666666666667e-02 +770 1027 -8.33333333333333e-02 +770 1253 -1.25000000000000e-01 +770 1267 4.16666666666667e-02 +770 923 -1.25000000000000e-01 +770 1252 -4.16666666666667e-02 +770 1054 8.33333333333333e-02 +770 1251 8.33333333333333e-02 +770 1053 -1.66666666666667e-01 +771 771 1.25000000000000e+00 +771 1163 -1.66666666666667e-01 +771 1162 8.33333333333333e-02 +771 890 4.16666666666667e-02 +771 1264 8.33333333333333e-02 +771 1263 -3.75000000000000e-01 +771 1274 -4.16666666666667e-02 +771 944 4.16666666666667e-02 +771 1273 8.33333333333333e-02 +771 1272 -1.25000000000000e-01 +771 1130 -8.33333333333333e-02 +771 1129 -8.33333333333333e-02 +771 1145 8.33333333333333e-02 +771 1259 -4.16666666666667e-02 +771 772 -1.66666666666667e-01 +771 1144 8.33333333333333e-02 +771 1177 -8.33333333333333e-02 +771 889 -8.33333333333333e-02 +771 1258 8.33333333333333e-02 +771 1257 -1.25000000000000e-01 +771 773 -1.66666666666667e-01 +771 1271 8.33333333333333e-02 +771 1178 1.66666666666667e-01 +771 1270 8.33333333333333e-02 +771 943 -8.33333333333333e-02 +771 1265 8.33333333333333e-02 +771 1269 -3.75000000000000e-01 +771 1176 -2.50000000000000e-01 +772 772 1.25000000000000e+00 +772 1163 8.33333333333333e-02 +772 1161 8.33333333333333e-02 +772 1264 -1.25000000000000e-01 +772 1263 8.33333333333333e-02 +772 1274 8.33333333333333e-02 +772 773 -1.66666666666667e-01 +772 1273 -3.75000000000000e-01 +772 1272 8.33333333333333e-02 +772 1128 -8.33333333333333e-02 +772 1259 8.33333333333333e-02 +772 771 -1.66666666666667e-01 +772 1145 -1.66666666666667e-01 +772 1178 1.66666666666667e-01 +772 1143 8.33333333333333e-02 +772 1176 -8.33333333333333e-02 +772 890 4.16666666666667e-02 +772 1130 -8.33333333333333e-02 +772 1258 -3.75000000000000e-01 +772 888 -8.33333333333333e-02 +772 1257 8.33333333333333e-02 +772 1271 -4.16666666666667e-02 +772 944 4.16666666666667e-02 +772 1265 -4.16666666666667e-02 +772 1270 -1.25000000000000e-01 +772 1177 -2.50000000000000e-01 +772 1269 8.33333333333333e-02 +772 942 -8.33333333333333e-02 +773 773 1.25000000000000e+00 +773 1162 8.33333333333333e-02 +773 1263 8.33333333333333e-02 +773 1161 -1.66666666666667e-01 +773 1265 -1.25000000000000e-01 +773 888 4.16666666666667e-02 +773 1274 -1.25000000000000e-01 +773 1273 8.33333333333333e-02 +773 772 -1.66666666666667e-01 +773 1272 -4.16666666666667e-02 +773 942 4.16666666666667e-02 +773 1128 -8.33333333333333e-02 +773 1258 8.33333333333333e-02 +773 1143 8.33333333333333e-02 +773 1257 -4.16666666666667e-02 +773 1144 -1.66666666666667e-01 +773 1177 1.66666666666667e-01 +773 1259 -1.25000000000000e-01 +773 889 4.16666666666667e-02 +773 1129 -8.33333333333333e-02 +773 1264 -4.16666666666667e-02 +773 1271 -1.25000000000000e-01 +773 1178 -7.50000000000000e-01 +773 1270 -4.16666666666667e-02 +773 943 4.16666666666667e-02 +773 771 -1.66666666666667e-01 +773 1269 8.33333333333333e-02 +773 1176 1.66666666666667e-01 +774 774 6.66666666666667e-01 +774 1195 4.16666666666667e-02 +774 1202 8.33333333333333e-02 +774 1201 -4.16666666666667e-02 +774 1200 -1.25000000000000e-01 +774 1148 -8.33333333333333e-02 +774 1262 4.16666666666667e-02 +774 1147 -8.33333333333333e-02 +774 1180 8.33333333333333e-02 +774 1261 -8.33333333333333e-02 +774 901 4.16666666666667e-02 +774 900 -8.33333333333333e-02 +774 1271 8.33333333333333e-02 +774 1181 -1.66666666666667e-01 +774 1270 8.33333333333333e-02 +774 775 -8.33333333333333e-02 +774 946 4.16666666666667e-02 +774 1269 -3.75000000000000e-01 +774 1196 4.16666666666667e-02 +774 945 -8.33333333333333e-02 +775 775 7.50000000000000e-01 +775 902 4.16666666666667e-02 +775 1194 4.16666666666667e-02 +775 1202 8.33333333333333e-02 +775 776 -8.33333333333333e-02 +775 947 4.16666666666667e-02 +775 1201 -1.25000000000000e-01 +775 1200 -4.16666666666667e-02 +775 1146 -8.33333333333333e-02 +775 1179 8.33333333333333e-02 +775 1262 4.16666666666667e-02 +775 1148 -8.33333333333333e-02 +775 901 -2.50000000000000e-01 +775 1260 -8.33333333333333e-02 +775 900 4.16666666666667e-02 +775 1271 -4.16666666666667e-02 +775 1181 8.33333333333333e-02 +775 1270 -1.25000000000000e-01 +775 1196 -8.33333333333333e-02 +775 946 -2.50000000000000e-01 +775 1269 8.33333333333333e-02 +775 774 -8.33333333333333e-02 +775 945 4.16666666666667e-02 +776 776 6.66666666666667e-01 +776 1195 -8.33333333333333e-02 +776 901 4.16666666666667e-02 +776 1202 -3.75000000000000e-01 +776 1201 8.33333333333333e-02 +776 775 -8.33333333333333e-02 +776 946 4.16666666666667e-02 +776 1200 8.33333333333333e-02 +776 1146 -8.33333333333333e-02 +776 1260 4.16666666666667e-02 +776 902 -8.33333333333333e-02 +776 1261 4.16666666666667e-02 +776 1147 -8.33333333333333e-02 +776 1271 -1.25000000000000e-01 +776 1194 4.16666666666667e-02 +776 947 -8.33333333333333e-02 +776 1270 -4.16666666666667e-02 +776 1180 8.33333333333333e-02 +776 1269 8.33333333333333e-02 +776 1179 -1.66666666666667e-01 +777 777 7.50000000000000e-01 +777 1214 -8.33333333333333e-02 +777 1213 4.16666666666667e-02 +777 779 -8.33333333333333e-02 +777 1220 8.33333333333333e-02 +777 926 4.16666666666667e-02 +777 1219 -4.16666666666667e-02 +777 1218 -1.25000000000000e-01 +777 1039 -8.33333333333333e-02 +777 1057 8.33333333333333e-02 +777 1250 4.16666666666667e-02 +777 1040 -8.33333333333333e-02 +777 904 4.16666666666667e-02 +777 1249 -8.33333333333333e-02 +777 903 -2.50000000000000e-01 +777 1256 -4.16666666666667e-02 +777 1058 8.33333333333333e-02 +777 778 -8.33333333333333e-02 +777 1255 8.33333333333333e-02 +777 925 4.16666666666667e-02 +777 905 4.16666666666667e-02 +777 1254 -1.25000000000000e-01 +777 924 -2.50000000000000e-01 +778 778 6.66666666666667e-01 +778 1212 4.16666666666667e-02 +778 1220 8.33333333333333e-02 +778 1219 -1.25000000000000e-01 +778 1218 -4.16666666666667e-02 +778 1250 4.16666666666667e-02 +778 1040 -8.33333333333333e-02 +778 1038 -8.33333333333333e-02 +778 1056 8.33333333333333e-02 +778 904 -8.33333333333333e-02 +778 903 4.16666666666667e-02 +778 1248 -8.33333333333333e-02 +778 1256 8.33333333333333e-02 +778 1058 -1.66666666666667e-01 +778 1214 4.16666666666667e-02 +778 1255 -3.75000000000000e-01 +778 925 -8.33333333333333e-02 +778 777 -8.33333333333333e-02 +778 1254 8.33333333333333e-02 +778 924 4.16666666666667e-02 +779 779 6.66666666666667e-01 +779 903 4.16666666666667e-02 +779 1212 -8.33333333333333e-02 +779 1220 -3.75000000000000e-01 +779 1219 8.33333333333333e-02 +779 777 -8.33333333333333e-02 +779 1218 8.33333333333333e-02 +779 924 4.16666666666667e-02 +779 1249 4.16666666666667e-02 +779 1039 -8.33333333333333e-02 +779 905 -8.33333333333333e-02 +779 1248 4.16666666666667e-02 +779 1038 -8.33333333333333e-02 +779 1213 4.16666666666667e-02 +779 1256 -1.25000000000000e-01 +779 926 -8.33333333333333e-02 +779 1255 8.33333333333333e-02 +779 1057 -1.66666666666667e-01 +779 1254 -4.16666666666667e-02 +779 1056 8.33333333333333e-02 +780 780 7.50000000000000e-01 +780 1232 -8.33333333333333e-02 +780 1231 4.16666666666667e-02 +780 782 -8.33333333333333e-02 +780 1238 8.33333333333333e-02 +780 950 4.16666666666667e-02 +780 1237 -4.16666666666667e-02 +780 1236 -1.25000000000000e-01 +780 1165 -8.33333333333333e-02 +780 1183 8.33333333333333e-02 +780 1268 4.16666666666667e-02 +780 1166 -8.33333333333333e-02 +780 928 4.16666666666667e-02 +780 1267 -8.33333333333333e-02 +780 927 -2.50000000000000e-01 +780 1274 -4.16666666666667e-02 +780 1184 8.33333333333333e-02 +780 781 -8.33333333333333e-02 +780 1273 8.33333333333333e-02 +780 949 4.16666666666667e-02 +780 929 4.16666666666667e-02 +780 1272 -1.25000000000000e-01 +780 948 -2.50000000000000e-01 +781 781 6.66666666666667e-01 +781 1230 4.16666666666667e-02 +781 1238 8.33333333333333e-02 +781 1237 -1.25000000000000e-01 +781 1236 -4.16666666666667e-02 +781 1268 4.16666666666667e-02 +781 1166 -8.33333333333333e-02 +781 1164 -8.33333333333333e-02 +781 1182 8.33333333333333e-02 +781 928 -8.33333333333333e-02 +781 927 4.16666666666667e-02 +781 1266 -8.33333333333333e-02 +781 1274 8.33333333333333e-02 +781 1184 -1.66666666666667e-01 +781 1232 4.16666666666667e-02 +781 1273 -3.75000000000000e-01 +781 949 -8.33333333333333e-02 +781 780 -8.33333333333333e-02 +781 1272 8.33333333333333e-02 +781 948 4.16666666666667e-02 +782 782 6.66666666666667e-01 +782 927 4.16666666666667e-02 +782 1230 -8.33333333333333e-02 +782 1238 -3.75000000000000e-01 +782 1237 8.33333333333333e-02 +782 780 -8.33333333333333e-02 +782 1236 8.33333333333333e-02 +782 948 4.16666666666667e-02 +782 1267 4.16666666666667e-02 +782 1165 -8.33333333333333e-02 +782 929 -8.33333333333333e-02 +782 1266 4.16666666666667e-02 +782 1164 -8.33333333333333e-02 +782 1231 4.16666666666667e-02 +782 1274 -1.25000000000000e-01 +782 950 -8.33333333333333e-02 +782 1273 8.33333333333333e-02 +782 1183 -1.66666666666667e-01 +782 1272 -4.16666666666667e-02 +782 1182 8.33333333333333e-02 +783 783 7.50000000000000e-01 +783 700 4.16666666666667e-02 +783 952 -8.33333333333333e-02 +783 788 -4.16666666666667e-02 +783 784 -8.33333333333333e-02 +783 787 8.33333333333333e-02 +783 786 -1.25000000000000e-01 +783 959 -8.33333333333333e-02 +783 794 8.33333333333333e-02 +783 701 4.16666666666667e-02 +783 956 -8.33333333333333e-02 +783 955 4.16666666666667e-02 +783 958 -8.33333333333333e-02 +783 699 -2.50000000000000e-01 +783 785 -8.33333333333333e-02 +783 791 8.33333333333333e-02 +783 790 -4.16666666666667e-02 +783 793 8.33333333333333e-02 +783 953 4.16666666666667e-02 +783 789 -1.25000000000000e-01 +783 7 4.16666666666667e-02 +783 8 4.16666666666667e-02 +783 6 -2.50000000000000e-01 +784 784 6.66666666666667e-01 +784 699 4.16666666666667e-02 +784 951 -8.33333333333333e-02 +784 788 8.33333333333333e-02 +784 787 -3.75000000000000e-01 +784 783 -8.33333333333333e-02 +784 786 8.33333333333333e-02 +784 956 4.16666666666667e-02 +784 959 -8.33333333333333e-02 +784 700 -8.33333333333333e-02 +784 954 4.16666666666667e-02 +784 957 -8.33333333333333e-02 +784 791 8.33333333333333e-02 +784 794 -1.66666666666667e-01 +784 953 4.16666666666667e-02 +784 790 -1.25000000000000e-01 +784 789 -4.16666666666667e-02 +784 792 8.33333333333333e-02 +784 6 4.16666666666667e-02 +784 7 -8.33333333333333e-02 +785 785 6.66666666666667e-01 +785 951 4.16666666666667e-02 +785 788 -1.25000000000000e-01 +785 787 8.33333333333333e-02 +785 786 -4.16666666666667e-02 +785 955 4.16666666666667e-02 +785 958 -8.33333333333333e-02 +785 957 -8.33333333333333e-02 +785 792 8.33333333333333e-02 +785 701 -8.33333333333333e-02 +785 699 4.16666666666667e-02 +785 954 -8.33333333333333e-02 +785 952 4.16666666666667e-02 +785 791 -3.75000000000000e-01 +785 790 8.33333333333333e-02 +785 793 -1.66666666666667e-01 +785 783 -8.33333333333333e-02 +785 789 8.33333333333333e-02 +785 8 -8.33333333333333e-02 +785 6 4.16666666666667e-02 +786 786 1.25000000000000e+00 +786 973 8.33333333333333e-02 +786 974 8.33333333333333e-02 +786 970 8.33333333333333e-02 +786 969 -1.25000000000000e-01 +786 788 -1.66666666666667e-01 +786 793 -8.33333333333333e-02 +786 787 -1.66666666666667e-01 +786 953 8.33333333333333e-02 +786 982 -8.33333333333333e-02 +786 958 8.33333333333333e-02 +786 794 1.66666666666667e-01 +786 959 -1.66666666666667e-01 +786 704 4.16666666666667e-02 +786 983 -8.33333333333333e-02 +786 952 8.33333333333333e-02 +786 703 -8.33333333333333e-02 +786 951 -3.75000000000000e-01 +786 785 -4.16666666666667e-02 +786 784 8.33333333333333e-02 +786 783 -1.25000000000000e-01 +786 971 -4.16666666666667e-02 +786 792 -2.50000000000000e-01 +786 185 8.33333333333333e-02 +786 184 8.33333333333333e-02 +786 183 -3.75000000000000e-01 +786 8 4.16666666666667e-02 +786 7 -8.33333333333333e-02 +787 787 1.25000000000000e+00 +787 972 8.33333333333333e-02 +787 974 -1.66666666666667e-01 +787 704 4.16666666666667e-02 +787 970 -3.75000000000000e-01 +787 969 8.33333333333333e-02 +787 792 -8.33333333333333e-02 +787 953 -4.16666666666667e-02 +787 786 -1.66666666666667e-01 +787 981 -8.33333333333333e-02 +787 957 8.33333333333333e-02 +787 983 -8.33333333333333e-02 +787 959 8.33333333333333e-02 +787 952 -1.25000000000000e-01 +787 951 8.33333333333333e-02 +787 702 -8.33333333333333e-02 +787 785 8.33333333333333e-02 +787 788 -1.66666666666667e-01 +787 794 1.66666666666667e-01 +787 784 -3.75000000000000e-01 +787 971 8.33333333333333e-02 +787 793 -2.50000000000000e-01 +787 783 8.33333333333333e-02 +787 185 -4.16666666666667e-02 +787 8 4.16666666666667e-02 +787 184 -1.25000000000000e-01 +787 183 8.33333333333333e-02 +787 6 -8.33333333333333e-02 +788 788 1.25000000000000e+00 +788 970 8.33333333333333e-02 +788 973 -1.66666666666667e-01 +788 972 8.33333333333333e-02 +788 971 -1.25000000000000e-01 +788 703 4.16666666666667e-02 +788 786 -1.66666666666667e-01 +788 952 -4.16666666666667e-02 +788 951 8.33333333333333e-02 +788 982 -8.33333333333333e-02 +788 958 8.33333333333333e-02 +788 792 1.66666666666667e-01 +788 957 -1.66666666666667e-01 +788 953 -1.25000000000000e-01 +788 702 4.16666666666667e-02 +788 981 -8.33333333333333e-02 +788 785 -1.25000000000000e-01 +788 969 -4.16666666666667e-02 +788 794 -7.50000000000000e-01 +788 784 8.33333333333333e-02 +788 787 -1.66666666666667e-01 +788 793 1.66666666666667e-01 +788 783 -4.16666666666667e-02 +788 185 -1.25000000000000e-01 +788 184 -4.16666666666667e-02 +788 7 4.16666666666667e-02 +788 183 8.33333333333333e-02 +788 6 4.16666666666667e-02 +789 789 1.25000000000000e+00 +789 959 8.33333333333333e-02 +789 958 -1.66666666666667e-01 +789 956 8.33333333333333e-02 +789 706 4.16666666666667e-02 +789 954 -3.75000000000000e-01 +789 785 8.33333333333333e-02 +789 784 -4.16666666666667e-02 +789 783 -1.25000000000000e-01 +789 794 -8.33333333333333e-02 +789 791 -1.66666666666667e-01 +789 1000 -4.16666666666667e-02 +789 1013 -8.33333333333333e-02 +789 1004 8.33333333333333e-02 +789 1012 -8.33333333333333e-02 +789 1003 8.33333333333333e-02 +789 1001 8.33333333333333e-02 +789 707 -8.33333333333333e-02 +789 999 -1.25000000000000e-01 +789 790 -1.66666666666667e-01 +789 793 1.66666666666667e-01 +789 955 8.33333333333333e-02 +789 792 -2.50000000000000e-01 +789 7 4.16666666666667e-02 +789 188 8.33333333333333e-02 +789 8 -8.33333333333333e-02 +789 187 8.33333333333333e-02 +789 186 -3.75000000000000e-01 +790 790 1.25000000000000e+00 +790 959 8.33333333333333e-02 +790 954 8.33333333333333e-02 +790 957 -1.66666666666667e-01 +790 955 -1.25000000000000e-01 +790 705 4.16666666666667e-02 +790 785 8.33333333333333e-02 +790 791 -1.66666666666667e-01 +790 784 -1.25000000000000e-01 +790 783 -4.16666666666667e-02 +790 999 -4.16666666666667e-02 +790 1001 8.33333333333333e-02 +790 794 1.66666666666667e-01 +790 1004 -1.66666666666667e-01 +790 1011 -8.33333333333333e-02 +790 1002 8.33333333333333e-02 +790 707 4.16666666666667e-02 +790 1013 -8.33333333333333e-02 +790 1000 -1.25000000000000e-01 +790 956 -4.16666666666667e-02 +790 793 -7.50000000000000e-01 +790 789 -1.66666666666667e-01 +790 792 1.66666666666667e-01 +790 6 4.16666666666667e-02 +790 188 -4.16666666666667e-02 +790 8 4.16666666666667e-02 +790 187 -1.25000000000000e-01 +790 186 8.33333333333333e-02 +791 791 1.25000000000000e+00 +791 958 8.33333333333333e-02 +791 957 8.33333333333333e-02 +791 956 -1.25000000000000e-01 +791 954 8.33333333333333e-02 +791 785 -3.75000000000000e-01 +791 784 8.33333333333333e-02 +791 790 -1.66666666666667e-01 +791 783 8.33333333333333e-02 +791 792 -8.33333333333333e-02 +791 789 -1.66666666666667e-01 +791 1000 8.33333333333333e-02 +791 1011 -8.33333333333333e-02 +791 1002 8.33333333333333e-02 +791 793 1.66666666666667e-01 +791 1003 -1.66666666666667e-01 +791 1001 -3.75000000000000e-01 +791 706 4.16666666666667e-02 +791 1012 -8.33333333333333e-02 +791 999 8.33333333333333e-02 +791 705 -8.33333333333333e-02 +791 955 -4.16666666666667e-02 +791 794 -2.50000000000000e-01 +791 188 -1.25000000000000e-01 +791 187 -4.16666666666667e-02 +791 7 4.16666666666667e-02 +791 186 8.33333333333333e-02 +791 6 -8.33333333333333e-02 +792 792 2.50000000000000e+00 +792 973 1.66666666666667e-01 +792 972 -2.50000000000000e-01 +792 1030 8.33333333333333e-02 +792 1031 8.33333333333333e-02 +792 787 -8.33333333333333e-02 +792 788 1.66666666666667e-01 +792 794 -3.33333333333333e-01 +792 786 -2.50000000000000e-01 +792 983 8.33333333333333e-02 +792 710 -8.33333333333333e-02 +792 982 -1.66666666666667e-01 +792 785 8.33333333333333e-02 +792 958 1.66666666666667e-01 +792 793 -3.33333333333333e-01 +792 959 1.66666666666667e-01 +792 709 -8.33333333333333e-02 +792 957 -7.50000000000000e-01 +792 784 8.33333333333333e-02 +792 791 -8.33333333333333e-02 +792 1012 8.33333333333333e-02 +792 1003 -8.33333333333333e-02 +792 790 1.66666666666667e-01 +792 789 -2.50000000000000e-01 +792 1004 1.66666666666667e-01 +792 1013 -1.66666666666667e-01 +792 1002 -2.50000000000000e-01 +792 974 -8.33333333333333e-02 +792 185 -1.66666666666667e-01 +792 184 8.33333333333333e-02 +792 191 1.66666666666667e-01 +792 190 1.66666666666667e-01 +792 189 -7.50000000000000e-01 +792 8 -8.33333333333333e-02 +792 7 -8.33333333333333e-02 +792 188 8.33333333333333e-02 +792 187 -1.66666666666667e-01 +793 793 2.50000000000000e+00 +793 972 1.66666666666667e-01 +793 974 1.66666666666667e-01 +793 973 -7.50000000000000e-01 +793 1029 8.33333333333333e-02 +793 1031 -1.66666666666667e-01 +793 786 -8.33333333333333e-02 +793 983 8.33333333333333e-02 +793 788 1.66666666666667e-01 +793 787 -2.50000000000000e-01 +793 981 -1.66666666666667e-01 +793 959 -8.33333333333333e-02 +793 957 1.66666666666667e-01 +793 792 -3.33333333333333e-01 +793 958 -2.50000000000000e-01 +793 708 -8.33333333333333e-02 +793 785 -1.66666666666667e-01 +793 783 8.33333333333333e-02 +793 791 1.66666666666667e-01 +793 794 -3.33333333333333e-01 +793 1004 1.66666666666667e-01 +793 1011 8.33333333333333e-02 +793 1002 -8.33333333333333e-02 +793 790 -7.50000000000000e-01 +793 789 1.66666666666667e-01 +793 1013 8.33333333333333e-02 +793 710 -8.33333333333333e-02 +793 1003 -2.50000000000000e-01 +793 183 8.33333333333333e-02 +793 191 -8.33333333333333e-02 +793 190 -2.50000000000000e-01 +793 189 1.66666666666667e-01 +793 6 -8.33333333333333e-02 +793 188 8.33333333333333e-02 +793 8 -8.33333333333333e-02 +793 186 -1.66666666666667e-01 +793 185 8.33333333333333e-02 +794 794 2.50000000000000e+00 +794 974 -2.50000000000000e-01 +794 973 1.66666666666667e-01 +794 1030 -1.66666666666667e-01 +794 1029 8.33333333333333e-02 +794 982 8.33333333333333e-02 +794 786 1.66666666666667e-01 +794 792 -3.33333333333333e-01 +794 788 -7.50000000000000e-01 +794 787 1.66666666666667e-01 +794 981 8.33333333333333e-02 +794 708 -8.33333333333333e-02 +794 958 -8.33333333333333e-02 +794 783 8.33333333333333e-02 +794 959 -2.50000000000000e-01 +794 957 1.66666666666667e-01 +794 784 -1.66666666666667e-01 +794 789 -8.33333333333333e-02 +794 790 1.66666666666667e-01 +794 793 -3.33333333333333e-01 +794 1003 1.66666666666667e-01 +794 791 -2.50000000000000e-01 +794 1004 -7.50000000000000e-01 +794 972 -8.33333333333333e-02 +794 1012 8.33333333333333e-02 +794 709 -8.33333333333333e-02 +794 1002 1.66666666666667e-01 +794 1011 -1.66666666666667e-01 +794 184 8.33333333333333e-02 +794 183 -1.66666666666667e-01 +794 190 -8.33333333333333e-02 +794 189 1.66666666666667e-01 +794 191 -2.50000000000000e-01 +794 6 -8.33333333333333e-02 +794 186 8.33333333333333e-02 +794 187 8.33333333333333e-02 +794 7 -8.33333333333333e-02 +795 795 7.50000000000000e-01 +795 676 4.16666666666667e-02 +795 802 -8.33333333333333e-02 +795 962 -4.16666666666667e-02 +795 796 -8.33333333333333e-02 +795 961 8.33333333333333e-02 +795 700 4.16666666666667e-02 +795 960 -1.25000000000000e-01 +795 815 -8.33333333333333e-02 +795 968 8.33333333333333e-02 +795 677 4.16666666666667e-02 +795 809 -8.33333333333333e-02 +795 808 4.16666666666667e-02 +795 814 -8.33333333333333e-02 +795 675 -2.50000000000000e-01 +795 797 -8.33333333333333e-02 +795 965 8.33333333333333e-02 +795 701 4.16666666666667e-02 +795 964 -4.16666666666667e-02 +795 967 8.33333333333333e-02 +795 803 4.16666666666667e-02 +795 963 -1.25000000000000e-01 +795 699 -2.50000000000000e-01 +796 796 6.66666666666667e-01 +796 675 4.16666666666667e-02 +796 801 -8.33333333333333e-02 +796 962 8.33333333333333e-02 +796 961 -3.75000000000000e-01 +796 795 -8.33333333333333e-02 +796 960 8.33333333333333e-02 +796 699 4.16666666666667e-02 +796 809 4.16666666666667e-02 +796 815 -8.33333333333333e-02 +796 676 -8.33333333333333e-02 +796 807 4.16666666666667e-02 +796 813 -8.33333333333333e-02 +796 965 8.33333333333333e-02 +796 968 -1.66666666666667e-01 +796 803 4.16666666666667e-02 +796 964 -1.25000000000000e-01 +796 700 -8.33333333333333e-02 +796 963 -4.16666666666667e-02 +796 966 8.33333333333333e-02 +797 797 6.66666666666667e-01 +797 801 4.16666666666667e-02 +797 962 -1.25000000000000e-01 +797 961 8.33333333333333e-02 +797 960 -4.16666666666667e-02 +797 808 4.16666666666667e-02 +797 814 -8.33333333333333e-02 +797 813 -8.33333333333333e-02 +797 966 8.33333333333333e-02 +797 677 -8.33333333333333e-02 +797 675 4.16666666666667e-02 +797 807 -8.33333333333333e-02 +797 802 4.16666666666667e-02 +797 965 -3.75000000000000e-01 +797 701 -8.33333333333333e-02 +797 964 8.33333333333333e-02 +797 967 -1.66666666666667e-01 +797 795 -8.33333333333333e-02 +797 963 8.33333333333333e-02 +797 699 4.16666666666667e-02 +798 798 7.50000000000000e-01 +798 712 4.16666666666667e-02 +798 1060 -8.33333333333333e-02 +798 806 -4.16666666666667e-02 +798 799 -8.33333333333333e-02 +798 805 8.33333333333333e-02 +798 676 4.16666666666667e-02 +798 804 -1.25000000000000e-01 +798 1067 -8.33333333333333e-02 +798 818 8.33333333333333e-02 +798 713 4.16666666666667e-02 +798 1064 -8.33333333333333e-02 +798 1063 4.16666666666667e-02 +798 1066 -8.33333333333333e-02 +798 711 -2.50000000000000e-01 +798 800 -8.33333333333333e-02 +798 812 8.33333333333333e-02 +798 677 4.16666666666667e-02 +798 811 -4.16666666666667e-02 +798 817 8.33333333333333e-02 +798 1061 4.16666666666667e-02 +798 810 -1.25000000000000e-01 +798 675 -2.50000000000000e-01 +799 799 6.66666666666667e-01 +799 711 4.16666666666667e-02 +799 1059 -8.33333333333333e-02 +799 806 8.33333333333333e-02 +799 805 -3.75000000000000e-01 +799 798 -8.33333333333333e-02 +799 804 8.33333333333333e-02 +799 675 4.16666666666667e-02 +799 1064 4.16666666666667e-02 +799 1067 -8.33333333333333e-02 +799 712 -8.33333333333333e-02 +799 1062 4.16666666666667e-02 +799 1065 -8.33333333333333e-02 +799 812 8.33333333333333e-02 +799 818 -1.66666666666667e-01 +799 1061 4.16666666666667e-02 +799 811 -1.25000000000000e-01 +799 676 -8.33333333333333e-02 +799 810 -4.16666666666667e-02 +799 816 8.33333333333333e-02 +800 800 6.66666666666667e-01 +800 1059 4.16666666666667e-02 +800 806 -1.25000000000000e-01 +800 805 8.33333333333333e-02 +800 804 -4.16666666666667e-02 +800 1063 4.16666666666667e-02 +800 1066 -8.33333333333333e-02 +800 1065 -8.33333333333333e-02 +800 816 8.33333333333333e-02 +800 713 -8.33333333333333e-02 +800 711 4.16666666666667e-02 +800 1062 -8.33333333333333e-02 +800 1060 4.16666666666667e-02 +800 812 -3.75000000000000e-01 +800 677 -8.33333333333333e-02 +800 811 8.33333333333333e-02 +800 817 -1.66666666666667e-01 +800 798 -8.33333333333333e-02 +800 810 8.33333333333333e-02 +800 675 4.16666666666667e-02 +801 801 1.25000000000000e+00 +801 1078 -8.33333333333333e-02 +801 806 8.33333333333333e-02 +801 805 8.33333333333333e-02 +801 804 -3.75000000000000e-01 +801 1085 -8.33333333333333e-02 +801 1084 -8.33333333333333e-02 +801 818 -1.66666666666667e-01 +801 817 8.33333333333333e-02 +801 962 8.33333333333333e-02 +801 803 -1.66666666666667e-01 +801 815 1.66666666666667e-01 +801 1081 8.33333333333333e-02 +801 814 -8.33333333333333e-02 +801 677 -4.16666666666667e-02 +801 797 4.16666666666667e-02 +801 676 8.33333333333333e-02 +801 796 -8.33333333333333e-02 +801 675 -1.25000000000000e-01 +801 813 -2.50000000000000e-01 +801 716 -4.16666666666667e-02 +801 1082 8.33333333333333e-02 +801 802 -1.66666666666667e-01 +801 715 8.33333333333333e-02 +801 961 8.33333333333333e-02 +801 1079 4.16666666666667e-02 +801 714 -1.25000000000000e-01 +801 960 -3.75000000000000e-01 +802 802 1.25000000000000e+00 +802 1077 -8.33333333333333e-02 +802 806 -4.16666666666667e-02 +802 805 -1.25000000000000e-01 +802 804 8.33333333333333e-02 +802 1085 -8.33333333333333e-02 +802 818 8.33333333333333e-02 +802 1083 -8.33333333333333e-02 +802 816 8.33333333333333e-02 +802 962 -4.16666666666667e-02 +802 797 4.16666666666667e-02 +802 1080 8.33333333333333e-02 +802 813 -8.33333333333333e-02 +802 677 8.33333333333333e-02 +802 803 -1.66666666666667e-01 +802 815 1.66666666666667e-01 +802 676 -3.75000000000000e-01 +802 814 -2.50000000000000e-01 +802 675 8.33333333333333e-02 +802 795 -8.33333333333333e-02 +802 716 8.33333333333333e-02 +802 1082 -1.66666666666667e-01 +802 1079 4.16666666666667e-02 +802 715 -3.75000000000000e-01 +802 961 -1.25000000000000e-01 +802 801 -1.66666666666667e-01 +802 714 8.33333333333333e-02 +802 960 8.33333333333333e-02 +803 803 1.25000000000000e+00 +803 1078 4.16666666666667e-02 +803 806 -1.25000000000000e-01 +803 805 -4.16666666666667e-02 +803 804 8.33333333333333e-02 +803 1083 -8.33333333333333e-02 +803 1084 -8.33333333333333e-02 +803 817 8.33333333333333e-02 +803 816 -1.66666666666667e-01 +803 961 -4.16666666666667e-02 +803 796 4.16666666666667e-02 +803 960 8.33333333333333e-02 +803 801 -1.66666666666667e-01 +803 813 1.66666666666667e-01 +803 677 -1.25000000000000e-01 +803 815 -7.50000000000000e-01 +803 676 8.33333333333333e-02 +803 802 -1.66666666666667e-01 +803 814 1.66666666666667e-01 +803 675 -4.16666666666667e-02 +803 795 4.16666666666667e-02 +803 1077 4.16666666666667e-02 +803 716 -1.25000000000000e-01 +803 962 -1.25000000000000e-01 +803 715 8.33333333333333e-02 +803 1081 -1.66666666666667e-01 +803 714 -4.16666666666667e-02 +803 1080 8.33333333333333e-02 +804 804 1.25000000000000e+00 +804 1084 8.33333333333333e-02 +804 1085 8.33333333333333e-02 +804 1078 8.33333333333333e-02 +804 1077 -1.25000000000000e-01 +804 806 -1.66666666666667e-01 +804 803 8.33333333333333e-02 +804 802 8.33333333333333e-02 +804 801 -3.75000000000000e-01 +804 817 -8.33333333333333e-02 +804 805 -1.66666666666667e-01 +804 1061 8.33333333333333e-02 +804 1096 -8.33333333333333e-02 +804 1066 8.33333333333333e-02 +804 818 1.66666666666667e-01 +804 1067 -1.66666666666667e-01 +804 719 4.16666666666667e-02 +804 1097 -8.33333333333333e-02 +804 1060 8.33333333333333e-02 +804 718 -8.33333333333333e-02 +804 1059 -3.75000000000000e-01 +804 800 -4.16666666666667e-02 +804 677 4.16666666666667e-02 +804 799 8.33333333333333e-02 +804 676 -8.33333333333333e-02 +804 798 -1.25000000000000e-01 +804 1079 -4.16666666666667e-02 +804 816 -2.50000000000000e-01 +805 805 1.25000000000000e+00 +805 1083 8.33333333333333e-02 +805 1085 -1.66666666666667e-01 +805 719 4.16666666666667e-02 +805 1078 -3.75000000000000e-01 +805 1077 8.33333333333333e-02 +805 803 -4.16666666666667e-02 +805 677 4.16666666666667e-02 +805 802 -1.25000000000000e-01 +805 801 8.33333333333333e-02 +805 816 -8.33333333333333e-02 +805 1061 -4.16666666666667e-02 +805 804 -1.66666666666667e-01 +805 1095 -8.33333333333333e-02 +805 1065 8.33333333333333e-02 +805 1097 -8.33333333333333e-02 +805 1067 8.33333333333333e-02 +805 1060 -1.25000000000000e-01 +805 1059 8.33333333333333e-02 +805 717 -8.33333333333333e-02 +805 800 8.33333333333333e-02 +805 806 -1.66666666666667e-01 +805 818 1.66666666666667e-01 +805 799 -3.75000000000000e-01 +805 1079 8.33333333333333e-02 +805 817 -2.50000000000000e-01 +805 798 8.33333333333333e-02 +805 675 -8.33333333333333e-02 +806 806 1.25000000000000e+00 +806 1078 8.33333333333333e-02 +806 1084 -1.66666666666667e-01 +806 1083 8.33333333333333e-02 +806 1079 -1.25000000000000e-01 +806 718 4.16666666666667e-02 +806 803 -1.25000000000000e-01 +806 802 -4.16666666666667e-02 +806 676 4.16666666666667e-02 +806 804 -1.66666666666667e-01 +806 801 8.33333333333333e-02 +806 1060 -4.16666666666667e-02 +806 1059 8.33333333333333e-02 +806 1096 -8.33333333333333e-02 +806 1066 8.33333333333333e-02 +806 816 1.66666666666667e-01 +806 1065 -1.66666666666667e-01 +806 1061 -1.25000000000000e-01 +806 717 4.16666666666667e-02 +806 1095 -8.33333333333333e-02 +806 800 -1.25000000000000e-01 +806 1077 -4.16666666666667e-02 +806 818 -7.50000000000000e-01 +806 799 8.33333333333333e-02 +806 805 -1.66666666666667e-01 +806 817 1.66666666666667e-01 +806 798 -4.16666666666667e-02 +806 675 4.16666666666667e-02 +807 807 1.25000000000000e+00 +807 1121 -8.33333333333333e-02 +807 1114 4.16666666666667e-02 +807 1120 -8.33333333333333e-02 +807 1115 -8.33333333333333e-02 +807 812 8.33333333333333e-02 +807 811 8.33333333333333e-02 +807 817 -1.66666666666667e-01 +807 810 -3.75000000000000e-01 +807 1118 8.33333333333333e-02 +807 815 -8.33333333333333e-02 +807 808 -1.66666666666667e-01 +807 814 1.66666666666667e-01 +807 964 8.33333333333333e-02 +807 677 8.33333333333333e-02 +807 797 -8.33333333333333e-02 +807 676 -4.16666666666667e-02 +807 796 4.16666666666667e-02 +807 675 -1.25000000000000e-01 +807 813 -2.50000000000000e-01 +807 809 -1.66666666666667e-01 +807 722 8.33333333333333e-02 +807 965 8.33333333333333e-02 +807 721 -4.16666666666667e-02 +807 1117 8.33333333333333e-02 +807 818 8.33333333333333e-02 +807 720 -1.25000000000000e-01 +807 963 -3.75000000000000e-01 +808 808 1.25000000000000e+00 +808 1119 -8.33333333333333e-02 +808 1115 4.16666666666667e-02 +808 1121 -8.33333333333333e-02 +808 812 -4.16666666666667e-02 +808 818 8.33333333333333e-02 +808 811 -1.25000000000000e-01 +808 810 8.33333333333333e-02 +808 816 -1.66666666666667e-01 +808 797 4.16666666666667e-02 +808 965 -4.16666666666667e-02 +808 807 -1.66666666666667e-01 +808 813 1.66666666666667e-01 +808 963 8.33333333333333e-02 +808 677 8.33333333333333e-02 +808 809 -1.66666666666667e-01 +808 815 1.66666666666667e-01 +808 676 -1.25000000000000e-01 +808 814 -7.50000000000000e-01 +808 675 -4.16666666666667e-02 +808 795 4.16666666666667e-02 +808 722 8.33333333333333e-02 +808 1118 -1.66666666666667e-01 +808 1113 4.16666666666667e-02 +808 721 -1.25000000000000e-01 +808 964 -1.25000000000000e-01 +808 720 -4.16666666666667e-02 +808 1116 8.33333333333333e-02 +809 809 1.25000000000000e+00 +809 1119 -8.33333333333333e-02 +809 1114 4.16666666666667e-02 +809 1120 -8.33333333333333e-02 +809 1113 -8.33333333333333e-02 +809 812 -1.25000000000000e-01 +809 811 -4.16666666666667e-02 +809 817 8.33333333333333e-02 +809 810 8.33333333333333e-02 +809 1116 8.33333333333333e-02 +809 813 -8.33333333333333e-02 +809 796 4.16666666666667e-02 +809 964 -4.16666666666667e-02 +809 677 -3.75000000000000e-01 +809 815 -2.50000000000000e-01 +809 676 8.33333333333333e-02 +809 808 -1.66666666666667e-01 +809 814 1.66666666666667e-01 +809 675 8.33333333333333e-02 +809 795 -8.33333333333333e-02 +809 816 8.33333333333333e-02 +809 722 -3.75000000000000e-01 +809 965 -1.25000000000000e-01 +809 721 8.33333333333333e-02 +809 1117 -1.66666666666667e-01 +809 807 -1.66666666666667e-01 +809 720 8.33333333333333e-02 +809 963 8.33333333333333e-02 +810 810 1.25000000000000e+00 +810 1067 8.33333333333333e-02 +810 1066 -1.66666666666667e-01 +810 1064 8.33333333333333e-02 +810 724 4.16666666666667e-02 +810 1062 -3.75000000000000e-01 +810 800 8.33333333333333e-02 +810 799 -4.16666666666667e-02 +810 676 4.16666666666667e-02 +810 798 -1.25000000000000e-01 +810 818 -8.33333333333333e-02 +810 812 -1.66666666666667e-01 +810 1114 -4.16666666666667e-02 +810 1133 -8.33333333333333e-02 +810 1121 8.33333333333333e-02 +810 1132 -8.33333333333333e-02 +810 1120 8.33333333333333e-02 +810 1115 8.33333333333333e-02 +810 725 -8.33333333333333e-02 +810 1113 -1.25000000000000e-01 +810 809 8.33333333333333e-02 +810 677 -8.33333333333333e-02 +810 808 8.33333333333333e-02 +810 811 -1.66666666666667e-01 +810 817 1.66666666666667e-01 +810 807 -3.75000000000000e-01 +810 1063 8.33333333333333e-02 +810 816 -2.50000000000000e-01 +811 811 1.25000000000000e+00 +811 1067 8.33333333333333e-02 +811 1062 8.33333333333333e-02 +811 1065 -1.66666666666667e-01 +811 1063 -1.25000000000000e-01 +811 723 4.16666666666667e-02 +811 800 8.33333333333333e-02 +811 812 -1.66666666666667e-01 +811 799 -1.25000000000000e-01 +811 798 -4.16666666666667e-02 +811 675 4.16666666666667e-02 +811 1113 -4.16666666666667e-02 +811 1115 8.33333333333333e-02 +811 818 1.66666666666667e-01 +811 1121 -1.66666666666667e-01 +811 1131 -8.33333333333333e-02 +811 1119 8.33333333333333e-02 +811 725 4.16666666666667e-02 +811 1133 -8.33333333333333e-02 +811 1114 -1.25000000000000e-01 +811 809 -4.16666666666667e-02 +811 677 4.16666666666667e-02 +811 808 -1.25000000000000e-01 +811 1064 -4.16666666666667e-02 +811 817 -7.50000000000000e-01 +811 807 8.33333333333333e-02 +811 810 -1.66666666666667e-01 +811 816 1.66666666666667e-01 +812 812 1.25000000000000e+00 +812 1066 8.33333333333333e-02 +812 1065 8.33333333333333e-02 +812 1064 -1.25000000000000e-01 +812 1062 8.33333333333333e-02 +812 800 -3.75000000000000e-01 +812 799 8.33333333333333e-02 +812 811 -1.66666666666667e-01 +812 798 8.33333333333333e-02 +812 816 -8.33333333333333e-02 +812 810 -1.66666666666667e-01 +812 1114 8.33333333333333e-02 +812 1131 -8.33333333333333e-02 +812 1119 8.33333333333333e-02 +812 817 1.66666666666667e-01 +812 1120 -1.66666666666667e-01 +812 1115 -3.75000000000000e-01 +812 724 4.16666666666667e-02 +812 1132 -8.33333333333333e-02 +812 1113 8.33333333333333e-02 +812 723 -8.33333333333333e-02 +812 809 -1.25000000000000e-01 +812 1063 -4.16666666666667e-02 +812 818 -2.50000000000000e-01 +812 808 -4.16666666666667e-02 +812 676 4.16666666666667e-02 +812 807 8.33333333333333e-02 +812 675 -8.33333333333333e-02 +813 813 2.50000000000000e+00 +813 1084 -1.66666666666667e-01 +813 818 1.66666666666667e-01 +813 1121 -1.66666666666667e-01 +813 1150 -8.33333333333333e-02 +813 1120 8.33333333333333e-02 +813 1151 -8.33333333333333e-02 +813 817 1.66666666666667e-01 +813 816 -7.50000000000000e-01 +813 803 1.66666666666667e-01 +813 961 8.33333333333333e-02 +813 802 -8.33333333333333e-02 +813 962 -1.66666666666667e-01 +813 677 8.33333333333333e-02 +813 801 -2.50000000000000e-01 +813 1082 -8.33333333333333e-02 +813 728 8.33333333333333e-02 +813 814 -3.33333333333333e-01 +813 1081 1.66666666666667e-01 +813 1080 -2.50000000000000e-01 +813 809 -8.33333333333333e-02 +813 808 1.66666666666667e-01 +813 797 -8.33333333333333e-02 +813 965 8.33333333333333e-02 +813 967 1.66666666666667e-01 +813 964 -1.66666666666667e-01 +813 676 8.33333333333333e-02 +813 796 -8.33333333333333e-02 +813 807 -2.50000000000000e-01 +813 815 -3.33333333333333e-01 +813 1118 1.66666666666667e-01 +813 968 1.66666666666667e-01 +813 1117 -8.33333333333333e-02 +813 727 8.33333333333333e-02 +813 1085 8.33333333333333e-02 +813 1116 -2.50000000000000e-01 +813 966 -7.50000000000000e-01 +814 814 2.50000000000000e+00 +814 1083 -1.66666666666667e-01 +814 818 -8.33333333333333e-02 +814 1151 -8.33333333333333e-02 +814 1121 8.33333333333333e-02 +814 1149 -8.33333333333333e-02 +814 1119 8.33333333333333e-02 +814 817 -2.50000000000000e-01 +814 816 1.66666666666667e-01 +814 960 8.33333333333333e-02 +814 801 -8.33333333333333e-02 +814 962 8.33333333333333e-02 +814 803 1.66666666666667e-01 +814 802 -2.50000000000000e-01 +814 1082 1.66666666666667e-01 +814 1081 -7.50000000000000e-01 +814 813 -3.33333333333333e-01 +814 1080 1.66666666666667e-01 +814 968 -8.33333333333333e-02 +814 815 -3.33333333333333e-01 +814 797 -8.33333333333333e-02 +814 965 8.33333333333333e-02 +814 807 1.66666666666667e-01 +814 966 1.66666666666667e-01 +814 963 -1.66666666666667e-01 +814 677 -1.66666666666667e-01 +814 809 1.66666666666667e-01 +814 808 -7.50000000000000e-01 +814 675 8.33333333333333e-02 +814 795 -8.33333333333333e-02 +814 1118 1.66666666666667e-01 +814 728 -1.66666666666667e-01 +814 1085 8.33333333333333e-02 +814 1117 -2.50000000000000e-01 +814 967 -2.50000000000000e-01 +814 1116 -8.33333333333333e-02 +814 726 8.33333333333333e-02 +815 815 2.50000000000000e+00 +815 1084 8.33333333333333e-02 +815 817 -8.33333333333333e-02 +815 1150 -8.33333333333333e-02 +815 1120 8.33333333333333e-02 +815 816 1.66666666666667e-01 +815 1119 -1.66666666666667e-01 +815 1149 -8.33333333333333e-02 +815 818 -2.50000000000000e-01 +815 801 1.66666666666667e-01 +815 961 8.33333333333333e-02 +815 960 -1.66666666666667e-01 +815 803 -7.50000000000000e-01 +815 802 1.66666666666667e-01 +815 675 8.33333333333333e-02 +815 1082 -2.50000000000000e-01 +815 1081 1.66666666666667e-01 +815 1080 -8.33333333333333e-02 +815 726 8.33333333333333e-02 +815 967 -8.33333333333333e-02 +815 814 -3.33333333333333e-01 +815 807 -8.33333333333333e-02 +815 796 -8.33333333333333e-02 +815 964 8.33333333333333e-02 +815 795 -8.33333333333333e-02 +815 963 8.33333333333333e-02 +815 809 -2.50000000000000e-01 +815 676 -1.66666666666667e-01 +815 808 1.66666666666667e-01 +815 1083 8.33333333333333e-02 +815 1118 -7.50000000000000e-01 +815 968 -2.50000000000000e-01 +815 1117 1.66666666666667e-01 +815 727 -1.66666666666667e-01 +815 813 -3.33333333333333e-01 +815 1116 1.66666666666667e-01 +815 966 1.66666666666667e-01 +816 816 2.50000000000000e+00 +816 1084 1.66666666666667e-01 +816 1083 -2.50000000000000e-01 +816 803 -1.66666666666667e-01 +816 802 8.33333333333333e-02 +816 815 1.66666666666667e-01 +816 1150 8.33333333333333e-02 +816 814 1.66666666666667e-01 +816 813 -7.50000000000000e-01 +816 1151 8.33333333333333e-02 +816 805 -8.33333333333333e-02 +816 806 1.66666666666667e-01 +816 818 -3.33333333333333e-01 +816 677 -8.33333333333333e-02 +816 804 -2.50000000000000e-01 +816 1097 8.33333333333333e-02 +816 731 -8.33333333333333e-02 +816 1096 -1.66666666666667e-01 +816 800 8.33333333333333e-02 +816 1066 1.66666666666667e-01 +816 817 -3.33333333333333e-01 +816 1067 1.66666666666667e-01 +816 730 -8.33333333333333e-02 +816 1065 -7.50000000000000e-01 +816 799 8.33333333333333e-02 +816 676 -8.33333333333333e-02 +816 812 -8.33333333333333e-02 +816 809 8.33333333333333e-02 +816 1132 8.33333333333333e-02 +816 1120 -8.33333333333333e-02 +816 808 -1.66666666666667e-01 +816 811 1.66666666666667e-01 +816 810 -2.50000000000000e-01 +816 1121 1.66666666666667e-01 +816 1133 -1.66666666666667e-01 +816 1119 -2.50000000000000e-01 +816 1085 -8.33333333333333e-02 +817 817 2.50000000000000e+00 +817 1083 1.66666666666667e-01 +817 1085 1.66666666666667e-01 +817 1084 -7.50000000000000e-01 +817 801 8.33333333333333e-02 +817 815 -8.33333333333333e-02 +817 1149 8.33333333333333e-02 +817 814 -2.50000000000000e-01 +817 813 1.66666666666667e-01 +817 1151 -1.66666666666667e-01 +817 804 -8.33333333333333e-02 +817 1097 8.33333333333333e-02 +817 806 1.66666666666667e-01 +817 805 -2.50000000000000e-01 +817 1095 -1.66666666666667e-01 +817 1067 -8.33333333333333e-02 +817 1065 1.66666666666667e-01 +817 816 -3.33333333333333e-01 +817 1066 -2.50000000000000e-01 +817 729 -8.33333333333333e-02 +817 800 -1.66666666666667e-01 +817 798 8.33333333333333e-02 +817 675 -8.33333333333333e-02 +817 812 1.66666666666667e-01 +817 818 -3.33333333333333e-01 +817 1121 1.66666666666667e-01 +817 1131 8.33333333333333e-02 +817 1119 -8.33333333333333e-02 +817 809 8.33333333333333e-02 +817 677 -8.33333333333333e-02 +817 811 -7.50000000000000e-01 +817 807 -1.66666666666667e-01 +817 810 1.66666666666667e-01 +817 1133 8.33333333333333e-02 +817 731 -8.33333333333333e-02 +817 1120 -2.50000000000000e-01 +817 803 8.33333333333333e-02 +818 818 2.50000000000000e+00 +818 802 8.33333333333333e-02 +818 1085 -2.50000000000000e-01 +818 1084 1.66666666666667e-01 +818 801 -1.66666666666667e-01 +818 814 -8.33333333333333e-02 +818 813 1.66666666666667e-01 +818 815 -2.50000000000000e-01 +818 1150 -1.66666666666667e-01 +818 1149 8.33333333333333e-02 +818 1096 8.33333333333333e-02 +818 804 1.66666666666667e-01 +818 816 -3.33333333333333e-01 +818 806 -7.50000000000000e-01 +818 805 1.66666666666667e-01 +818 675 -8.33333333333333e-02 +818 1095 8.33333333333333e-02 +818 729 -8.33333333333333e-02 +818 1066 -8.33333333333333e-02 +818 798 8.33333333333333e-02 +818 1067 -2.50000000000000e-01 +818 1065 1.66666666666667e-01 +818 799 -1.66666666666667e-01 +818 810 -8.33333333333333e-02 +818 807 8.33333333333333e-02 +818 811 1.66666666666667e-01 +818 817 -3.33333333333333e-01 +818 1120 1.66666666666667e-01 +818 812 -2.50000000000000e-01 +818 808 8.33333333333333e-02 +818 676 -8.33333333333333e-02 +818 1121 -7.50000000000000e-01 +818 1083 -8.33333333333333e-02 +818 1132 8.33333333333333e-02 +818 730 -8.33333333333333e-02 +818 1119 1.66666666666667e-01 +818 1131 -1.66666666666667e-01 +819 819 7.50000000000000e-01 +819 679 4.16666666666667e-02 +819 823 -8.33333333333333e-02 +819 1070 -4.16666666666667e-02 +819 820 -8.33333333333333e-02 +819 1069 8.33333333333333e-02 +819 712 4.16666666666667e-02 +819 1068 -1.25000000000000e-01 +819 830 -8.33333333333333e-02 +819 1076 8.33333333333333e-02 +819 680 4.16666666666667e-02 +819 827 -8.33333333333333e-02 +819 826 4.16666666666667e-02 +819 829 -8.33333333333333e-02 +819 678 -2.50000000000000e-01 +819 821 -8.33333333333333e-02 +819 1073 8.33333333333333e-02 +819 713 4.16666666666667e-02 +819 1072 -4.16666666666667e-02 +819 1075 8.33333333333333e-02 +819 824 4.16666666666667e-02 +819 1071 -1.25000000000000e-01 +819 711 -2.50000000000000e-01 +820 820 6.66666666666667e-01 +820 678 4.16666666666667e-02 +820 822 -8.33333333333333e-02 +820 1070 8.33333333333333e-02 +820 1069 -3.75000000000000e-01 +820 819 -8.33333333333333e-02 +820 1068 8.33333333333333e-02 +820 711 4.16666666666667e-02 +820 827 4.16666666666667e-02 +820 830 -8.33333333333333e-02 +820 679 -8.33333333333333e-02 +820 825 4.16666666666667e-02 +820 828 -8.33333333333333e-02 +820 1073 8.33333333333333e-02 +820 1076 -1.66666666666667e-01 +820 824 4.16666666666667e-02 +820 1072 -1.25000000000000e-01 +820 712 -8.33333333333333e-02 +820 1071 -4.16666666666667e-02 +820 1074 8.33333333333333e-02 +821 821 6.66666666666667e-01 +821 822 4.16666666666667e-02 +821 1070 -1.25000000000000e-01 +821 1069 8.33333333333333e-02 +821 1068 -4.16666666666667e-02 +821 826 4.16666666666667e-02 +821 829 -8.33333333333333e-02 +821 828 -8.33333333333333e-02 +821 1074 8.33333333333333e-02 +821 680 -8.33333333333333e-02 +821 678 4.16666666666667e-02 +821 825 -8.33333333333333e-02 +821 823 4.16666666666667e-02 +821 1073 -3.75000000000000e-01 +821 713 -8.33333333333333e-02 +821 1072 8.33333333333333e-02 +821 1075 -1.66666666666667e-01 +821 819 -8.33333333333333e-02 +821 1071 8.33333333333333e-02 +821 711 4.16666666666667e-02 +822 822 5.83333333333333e-01 +822 824 -1.66666666666667e-01 +822 830 8.33333333333333e-02 +822 1186 4.16666666666667e-02 +822 829 -4.16666666666667e-02 +822 680 -4.16666666666667e-02 +822 821 4.16666666666667e-02 +822 679 4.16666666666667e-02 +822 820 -8.33333333333333e-02 +822 678 -4.16666666666667e-02 +822 828 -1.25000000000000e-01 +822 734 -4.16666666666667e-02 +822 1187 4.16666666666667e-02 +822 823 -8.33333333333333e-02 +822 733 4.16666666666667e-02 +822 1069 8.33333333333333e-02 +822 1070 8.33333333333333e-02 +822 732 -4.16666666666667e-02 +822 1068 -3.75000000000000e-01 +823 823 5.00000000000000e-01 +823 821 4.16666666666667e-02 +823 1185 4.16666666666667e-02 +823 828 -4.16666666666667e-02 +823 680 4.16666666666667e-02 +823 824 -8.33333333333333e-02 +823 830 8.33333333333333e-02 +823 679 -1.25000000000000e-01 +823 829 -1.25000000000000e-01 +823 678 4.16666666666667e-02 +823 819 -8.33333333333333e-02 +823 734 4.16666666666667e-02 +823 1187 -8.33333333333333e-02 +823 1070 -4.16666666666667e-02 +823 733 -1.25000000000000e-01 +823 1069 -1.25000000000000e-01 +823 822 -8.33333333333333e-02 +823 732 4.16666666666667e-02 +823 1068 8.33333333333333e-02 +824 824 5.83333333333333e-01 +824 820 4.16666666666667e-02 +824 1068 8.33333333333333e-02 +824 822 -1.66666666666667e-01 +824 828 8.33333333333333e-02 +824 680 -4.16666666666667e-02 +824 830 -3.75000000000000e-01 +824 679 4.16666666666667e-02 +824 823 -8.33333333333333e-02 +824 829 8.33333333333333e-02 +824 678 -4.16666666666667e-02 +824 819 4.16666666666667e-02 +824 1069 -4.16666666666667e-02 +824 734 -4.16666666666667e-02 +824 1070 -1.25000000000000e-01 +824 733 4.16666666666667e-02 +824 1186 -8.33333333333333e-02 +824 732 -4.16666666666667e-02 +824 1185 4.16666666666667e-02 +825 825 5.83333333333333e-01 +825 830 -4.16666666666667e-02 +825 826 -1.66666666666667e-01 +825 829 8.33333333333333e-02 +825 1072 8.33333333333333e-02 +825 680 4.16666666666667e-02 +825 821 -8.33333333333333e-02 +825 679 -4.16666666666667e-02 +825 820 4.16666666666667e-02 +825 678 -4.16666666666667e-02 +825 828 -1.25000000000000e-01 +825 827 -8.33333333333333e-02 +825 737 4.16666666666667e-02 +825 1073 8.33333333333333e-02 +825 736 -4.16666666666667e-02 +825 1192 4.16666666666667e-02 +825 1193 4.16666666666667e-02 +825 735 -4.16666666666667e-02 +825 1071 -3.75000000000000e-01 +826 826 5.83333333333333e-01 +826 1073 -4.16666666666667e-02 +826 825 -1.66666666666667e-01 +826 828 8.33333333333333e-02 +826 1071 8.33333333333333e-02 +826 680 4.16666666666667e-02 +826 827 -8.33333333333333e-02 +826 830 8.33333333333333e-02 +826 679 -4.16666666666667e-02 +826 829 -3.75000000000000e-01 +826 678 -4.16666666666667e-02 +826 819 4.16666666666667e-02 +826 737 4.16666666666667e-02 +826 1193 -8.33333333333333e-02 +826 821 4.16666666666667e-02 +826 736 -4.16666666666667e-02 +826 1072 -1.25000000000000e-01 +826 735 -4.16666666666667e-02 +826 1191 4.16666666666667e-02 +827 827 5.00000000000000e-01 +827 828 -4.16666666666667e-02 +827 820 4.16666666666667e-02 +827 1072 -4.16666666666667e-02 +827 680 -1.25000000000000e-01 +827 830 -1.25000000000000e-01 +827 679 4.16666666666667e-02 +827 826 -8.33333333333333e-02 +827 829 8.33333333333333e-02 +827 678 4.16666666666667e-02 +827 819 -8.33333333333333e-02 +827 1191 4.16666666666667e-02 +827 737 -1.25000000000000e-01 +827 1073 -1.25000000000000e-01 +827 736 4.16666666666667e-02 +827 1192 -8.33333333333333e-02 +827 825 -8.33333333333333e-02 +827 735 4.16666666666667e-02 +827 1071 8.33333333333333e-02 +828 828 1.25000000000000e+00 +828 1069 8.33333333333333e-02 +828 823 -4.16666666666667e-02 +828 1070 -1.66666666666667e-01 +828 680 4.16666666666667e-02 +828 822 -1.25000000000000e-01 +828 1187 -4.16666666666667e-02 +828 740 4.16666666666667e-02 +828 829 -1.66666666666667e-01 +828 1186 8.33333333333333e-02 +828 1185 -1.25000000000000e-01 +828 827 -4.16666666666667e-02 +828 826 8.33333333333333e-02 +828 821 -8.33333333333333e-02 +828 1073 8.33333333333333e-02 +828 1075 1.66666666666667e-01 +828 1072 -1.66666666666667e-01 +828 679 4.16666666666667e-02 +828 820 -8.33333333333333e-02 +828 825 -1.25000000000000e-01 +828 830 -1.66666666666667e-01 +828 1193 8.33333333333333e-02 +828 1076 1.66666666666667e-01 +828 1192 -4.16666666666667e-02 +828 739 4.16666666666667e-02 +828 824 8.33333333333333e-02 +828 1191 -1.25000000000000e-01 +828 1074 -7.50000000000000e-01 +829 829 1.25000000000000e+00 +829 822 -4.16666666666667e-02 +829 1070 8.33333333333333e-02 +829 824 8.33333333333333e-02 +829 823 -1.25000000000000e-01 +829 1187 8.33333333333333e-02 +829 1186 -3.75000000000000e-01 +829 828 -1.66666666666667e-01 +829 1185 8.33333333333333e-02 +829 1076 -8.33333333333333e-02 +829 830 -1.66666666666667e-01 +829 821 -8.33333333333333e-02 +829 1073 8.33333333333333e-02 +829 825 8.33333333333333e-02 +829 1074 1.66666666666667e-01 +829 1071 -1.66666666666667e-01 +829 680 -8.33333333333333e-02 +829 827 8.33333333333333e-02 +829 826 -3.75000000000000e-01 +829 678 4.16666666666667e-02 +829 819 -8.33333333333333e-02 +829 1193 8.33333333333333e-02 +829 740 -8.33333333333333e-02 +829 1068 8.33333333333333e-02 +829 1192 -1.25000000000000e-01 +829 1075 -2.50000000000000e-01 +829 1191 -4.16666666666667e-02 +829 738 4.16666666666667e-02 +830 830 1.25000000000000e+00 +830 1069 8.33333333333333e-02 +830 1068 -1.66666666666667e-01 +830 824 -3.75000000000000e-01 +830 823 8.33333333333333e-02 +830 678 4.16666666666667e-02 +830 1187 -1.25000000000000e-01 +830 1186 8.33333333333333e-02 +830 1185 -4.16666666666667e-02 +830 738 4.16666666666667e-02 +830 1075 -8.33333333333333e-02 +830 829 -1.66666666666667e-01 +830 825 -4.16666666666667e-02 +830 820 -8.33333333333333e-02 +830 1072 8.33333333333333e-02 +830 819 -8.33333333333333e-02 +830 1071 8.33333333333333e-02 +830 827 -1.25000000000000e-01 +830 679 -8.33333333333333e-02 +830 826 8.33333333333333e-02 +830 822 8.33333333333333e-02 +830 1193 -3.75000000000000e-01 +830 1076 -2.50000000000000e-01 +830 1192 8.33333333333333e-02 +830 739 -8.33333333333333e-02 +830 828 -1.66666666666667e-01 +830 1191 8.33333333333333e-02 +830 1074 1.66666666666667e-01 +831 831 5.00000000000000e-01 +831 977 -4.16666666666667e-02 +831 1204 4.16666666666667e-02 +831 835 -4.16666666666667e-02 +831 743 4.16666666666667e-02 +831 1205 -8.33333333333333e-02 +831 742 4.16666666666667e-02 +831 832 -8.33333333333333e-02 +831 976 8.33333333333333e-02 +831 741 -1.25000000000000e-01 +831 975 -1.25000000000000e-01 +831 833 -8.33333333333333e-02 +831 836 8.33333333333333e-02 +831 834 -1.25000000000000e-01 +831 17 4.16666666666667e-02 +831 16 4.16666666666667e-02 +831 226 -8.33333333333333e-02 +831 227 4.16666666666667e-02 +831 15 -1.25000000000000e-01 +832 832 5.83333333333333e-01 +832 977 8.33333333333333e-02 +832 836 8.33333333333333e-02 +832 1203 4.16666666666667e-02 +832 834 -4.16666666666667e-02 +832 743 -4.16666666666667e-02 +832 1205 4.16666666666667e-02 +832 742 -4.16666666666667e-02 +832 976 -3.75000000000000e-01 +832 741 4.16666666666667e-02 +832 831 -8.33333333333333e-02 +832 975 8.33333333333333e-02 +832 833 -1.66666666666667e-01 +832 835 -1.25000000000000e-01 +832 17 -4.16666666666667e-02 +832 227 4.16666666666667e-02 +832 16 -4.16666666666667e-02 +832 15 4.16666666666667e-02 +832 225 -8.33333333333333e-02 +833 833 5.83333333333333e-01 +833 975 -4.16666666666667e-02 +833 832 -1.66666666666667e-01 +833 976 8.33333333333333e-02 +833 835 8.33333333333333e-02 +833 743 -4.16666666666667e-02 +833 977 -1.25000000000000e-01 +833 742 -4.16666666666667e-02 +833 1204 4.16666666666667e-02 +833 741 4.16666666666667e-02 +833 1203 -8.33333333333333e-02 +833 836 -3.75000000000000e-01 +833 831 -8.33333333333333e-02 +833 834 8.33333333333333e-02 +833 225 4.16666666666667e-02 +833 17 -4.16666666666667e-02 +833 16 -4.16666666666667e-02 +833 226 4.16666666666667e-02 +833 15 4.16666666666667e-02 +834 834 1.25000000000000e+00 +834 976 8.33333333333333e-02 +834 977 8.33333333333333e-02 +834 833 8.33333333333333e-02 +834 831 -1.25000000000000e-01 +834 1205 8.33333333333333e-02 +834 1204 8.33333333333333e-02 +834 835 -1.66666666666667e-01 +834 1203 -3.75000000000000e-01 +834 980 -8.33333333333333e-02 +834 836 -1.66666666666667e-01 +834 979 1.66666666666667e-01 +834 1211 8.33333333333333e-02 +834 746 -8.33333333333333e-02 +834 1210 -4.16666666666667e-02 +834 745 4.16666666666667e-02 +834 1209 -1.25000000000000e-01 +834 832 -4.16666666666667e-02 +834 978 -2.50000000000000e-01 +834 227 -8.33333333333333e-02 +834 590 8.33333333333333e-02 +834 232 8.33333333333333e-02 +834 589 -1.66666666666667e-01 +834 233 8.33333333333333e-02 +834 17 -8.33333333333333e-02 +834 16 4.16666666666667e-02 +834 226 -8.33333333333333e-02 +834 231 -3.75000000000000e-01 +835 835 1.25000000000000e+00 +835 831 -4.16666666666667e-02 +835 975 8.33333333333333e-02 +835 977 -1.66666666666667e-01 +835 832 -1.25000000000000e-01 +835 1205 -4.16666666666667e-02 +835 746 4.16666666666667e-02 +835 1204 -1.25000000000000e-01 +835 1203 8.33333333333333e-02 +835 834 -1.66666666666667e-01 +835 978 1.66666666666667e-01 +835 1211 8.33333333333333e-02 +835 836 -1.66666666666667e-01 +835 980 1.66666666666667e-01 +835 1210 -1.25000000000000e-01 +835 833 8.33333333333333e-02 +835 979 -7.50000000000000e-01 +835 1209 -4.16666666666667e-02 +835 744 4.16666666666667e-02 +835 17 4.16666666666667e-02 +835 233 -4.16666666666667e-02 +835 231 8.33333333333333e-02 +835 227 -8.33333333333333e-02 +835 590 8.33333333333333e-02 +835 588 -1.66666666666667e-01 +835 232 -1.25000000000000e-01 +835 15 4.16666666666667e-02 +835 225 -8.33333333333333e-02 +836 836 1.25000000000000e+00 +836 976 -1.66666666666667e-01 +836 975 8.33333333333333e-02 +836 833 -3.75000000000000e-01 +836 831 8.33333333333333e-02 +836 1205 -1.25000000000000e-01 +836 1204 -4.16666666666667e-02 +836 745 4.16666666666667e-02 +836 1203 8.33333333333333e-02 +836 978 -8.33333333333333e-02 +836 834 -1.66666666666667e-01 +836 1211 -3.75000000000000e-01 +836 832 8.33333333333333e-02 +836 980 -2.50000000000000e-01 +836 1210 8.33333333333333e-02 +836 835 -1.66666666666667e-01 +836 979 1.66666666666667e-01 +836 1209 8.33333333333333e-02 +836 744 -8.33333333333333e-02 +836 16 4.16666666666667e-02 +836 232 -4.16666666666667e-02 +836 225 -8.33333333333333e-02 +836 588 8.33333333333333e-02 +836 226 -8.33333333333333e-02 +836 589 8.33333333333333e-02 +836 233 -1.25000000000000e-01 +836 231 8.33333333333333e-02 +836 15 -8.33333333333333e-02 +837 837 1.25000000000000e+00 +837 1207 8.33333333333333e-02 +837 1208 8.33333333333333e-02 +837 844 8.33333333333333e-02 +837 843 -1.25000000000000e-01 +837 839 -1.66666666666667e-01 +837 992 8.33333333333333e-02 +837 991 8.33333333333333e-02 +837 990 -3.75000000000000e-01 +837 997 -8.33333333333333e-02 +837 838 -1.66666666666667e-01 +837 842 8.33333333333333e-02 +837 850 -8.33333333333333e-02 +837 1090 8.33333333333333e-02 +837 998 1.66666666666667e-01 +837 1091 -1.66666666666667e-01 +837 683 4.16666666666667e-02 +837 851 -8.33333333333333e-02 +837 841 8.33333333333333e-02 +837 682 -8.33333333333333e-02 +837 840 -3.75000000000000e-01 +837 986 -4.16666666666667e-02 +837 704 4.16666666666667e-02 +837 985 8.33333333333333e-02 +837 703 -8.33333333333333e-02 +837 984 -1.25000000000000e-01 +837 845 -4.16666666666667e-02 +837 996 -2.50000000000000e-01 +838 838 1.25000000000000e+00 +838 1206 8.33333333333333e-02 +838 1208 -1.66666666666667e-01 +838 683 4.16666666666667e-02 +838 844 -3.75000000000000e-01 +838 843 8.33333333333333e-02 +838 992 -4.16666666666667e-02 +838 704 4.16666666666667e-02 +838 991 -1.25000000000000e-01 +838 990 8.33333333333333e-02 +838 996 -8.33333333333333e-02 +838 842 -4.16666666666667e-02 +838 837 -1.66666666666667e-01 +838 849 -8.33333333333333e-02 +838 1089 8.33333333333333e-02 +838 851 -8.33333333333333e-02 +838 1091 8.33333333333333e-02 +838 841 -1.25000000000000e-01 +838 840 8.33333333333333e-02 +838 681 -8.33333333333333e-02 +838 986 8.33333333333333e-02 +838 839 -1.66666666666667e-01 +838 998 1.66666666666667e-01 +838 985 -3.75000000000000e-01 +838 845 8.33333333333333e-02 +838 997 -2.50000000000000e-01 +838 984 8.33333333333333e-02 +838 702 -8.33333333333333e-02 +839 839 1.25000000000000e+00 +839 844 8.33333333333333e-02 +839 1207 -1.66666666666667e-01 +839 1206 8.33333333333333e-02 +839 845 -1.25000000000000e-01 +839 682 4.16666666666667e-02 +839 992 -1.25000000000000e-01 +839 991 -4.16666666666667e-02 +839 703 4.16666666666667e-02 +839 837 -1.66666666666667e-01 +839 990 8.33333333333333e-02 +839 841 -4.16666666666667e-02 +839 840 8.33333333333333e-02 +839 850 -8.33333333333333e-02 +839 1090 8.33333333333333e-02 +839 996 1.66666666666667e-01 +839 1089 -1.66666666666667e-01 +839 842 -1.25000000000000e-01 +839 681 4.16666666666667e-02 +839 849 -8.33333333333333e-02 +839 986 -1.25000000000000e-01 +839 843 -4.16666666666667e-02 +839 998 -7.50000000000000e-01 +839 985 8.33333333333333e-02 +839 838 -1.66666666666667e-01 +839 997 1.66666666666667e-01 +839 984 -4.16666666666667e-02 +839 702 4.16666666666667e-02 +840 840 1.25000000000000e+00 +840 847 -8.33333333333333e-02 +840 1088 8.33333333333333e-02 +840 1087 8.33333333333333e-02 +840 1086 -3.75000000000000e-01 +840 854 -8.33333333333333e-02 +840 853 -8.33333333333333e-02 +840 1094 -1.66666666666667e-01 +840 1093 8.33333333333333e-02 +840 839 8.33333333333333e-02 +840 842 -1.66666666666667e-01 +840 1091 1.66666666666667e-01 +840 850 8.33333333333333e-02 +840 1090 -8.33333333333333e-02 +840 716 -4.16666666666667e-02 +840 986 4.16666666666667e-02 +840 715 8.33333333333333e-02 +840 985 -8.33333333333333e-02 +840 714 -1.25000000000000e-01 +840 1089 -2.50000000000000e-01 +840 683 -4.16666666666667e-02 +840 851 8.33333333333333e-02 +840 841 -1.66666666666667e-01 +840 682 8.33333333333333e-02 +840 838 8.33333333333333e-02 +840 848 4.16666666666667e-02 +840 681 -1.25000000000000e-01 +840 837 -3.75000000000000e-01 +841 841 1.25000000000000e+00 +841 846 -8.33333333333333e-02 +841 1088 -4.16666666666667e-02 +841 1087 -1.25000000000000e-01 +841 1086 8.33333333333333e-02 +841 854 -8.33333333333333e-02 +841 1094 8.33333333333333e-02 +841 852 -8.33333333333333e-02 +841 1092 8.33333333333333e-02 +841 839 -4.16666666666667e-02 +841 986 4.16666666666667e-02 +841 849 8.33333333333333e-02 +841 1089 -8.33333333333333e-02 +841 716 8.33333333333333e-02 +841 842 -1.66666666666667e-01 +841 1091 1.66666666666667e-01 +841 715 -3.75000000000000e-01 +841 1090 -2.50000000000000e-01 +841 714 8.33333333333333e-02 +841 984 -8.33333333333333e-02 +841 683 8.33333333333333e-02 +841 851 -1.66666666666667e-01 +841 848 4.16666666666667e-02 +841 682 -3.75000000000000e-01 +841 838 -1.25000000000000e-01 +841 840 -1.66666666666667e-01 +841 681 8.33333333333333e-02 +841 837 8.33333333333333e-02 +842 842 1.25000000000000e+00 +842 847 4.16666666666667e-02 +842 1088 -1.25000000000000e-01 +842 1087 -4.16666666666667e-02 +842 1086 8.33333333333333e-02 +842 852 -8.33333333333333e-02 +842 853 -8.33333333333333e-02 +842 1093 8.33333333333333e-02 +842 1092 -1.66666666666667e-01 +842 838 -4.16666666666667e-02 +842 985 4.16666666666667e-02 +842 837 8.33333333333333e-02 +842 840 -1.66666666666667e-01 +842 1089 1.66666666666667e-01 +842 716 -1.25000000000000e-01 +842 1091 -7.50000000000000e-01 +842 715 8.33333333333333e-02 +842 841 -1.66666666666667e-01 +842 1090 1.66666666666667e-01 +842 714 -4.16666666666667e-02 +842 984 4.16666666666667e-02 +842 846 4.16666666666667e-02 +842 683 -1.25000000000000e-01 +842 839 -1.25000000000000e-01 +842 682 8.33333333333333e-02 +842 850 -1.66666666666667e-01 +842 681 -4.16666666666667e-02 +842 849 8.33333333333333e-02 +843 843 5.00000000000000e-01 +843 839 -4.16666666666667e-02 +843 850 4.16666666666667e-02 +843 1207 -4.16666666666667e-02 +843 683 4.16666666666667e-02 +843 851 -8.33333333333333e-02 +843 682 4.16666666666667e-02 +843 844 -8.33333333333333e-02 +843 838 8.33333333333333e-02 +843 681 -1.25000000000000e-01 +843 837 -1.25000000000000e-01 +843 845 -8.33333333333333e-02 +843 743 4.16666666666667e-02 +843 1208 8.33333333333333e-02 +843 742 4.16666666666667e-02 +843 991 -8.33333333333333e-02 +843 992 4.16666666666667e-02 +843 741 -1.25000000000000e-01 +843 1206 -1.25000000000000e-01 +844 844 5.83333333333333e-01 +844 839 8.33333333333333e-02 +844 1208 8.33333333333333e-02 +844 849 4.16666666666667e-02 +844 1206 -4.16666666666667e-02 +844 683 -4.16666666666667e-02 +844 851 4.16666666666667e-02 +844 682 -4.16666666666667e-02 +844 838 -3.75000000000000e-01 +844 681 4.16666666666667e-02 +844 843 -8.33333333333333e-02 +844 837 8.33333333333333e-02 +844 743 -4.16666666666667e-02 +844 992 4.16666666666667e-02 +844 845 -1.66666666666667e-01 +844 742 -4.16666666666667e-02 +844 1207 -1.25000000000000e-01 +844 741 4.16666666666667e-02 +844 990 -8.33333333333333e-02 +845 845 5.83333333333333e-01 +845 837 -4.16666666666667e-02 +845 844 -1.66666666666667e-01 +845 838 8.33333333333333e-02 +845 1207 8.33333333333333e-02 +845 683 -4.16666666666667e-02 +845 839 -1.25000000000000e-01 +845 682 -4.16666666666667e-02 +845 850 4.16666666666667e-02 +845 681 4.16666666666667e-02 +845 849 -8.33333333333333e-02 +845 990 4.16666666666667e-02 +845 743 -4.16666666666667e-02 +845 1208 -3.75000000000000e-01 +845 742 -4.16666666666667e-02 +845 991 4.16666666666667e-02 +845 843 -8.33333333333333e-02 +845 741 4.16666666666667e-02 +845 1206 8.33333333333333e-02 +846 846 5.00000000000000e-01 +846 1088 -4.16666666666667e-02 +846 1222 4.16666666666667e-02 +846 853 -4.16666666666667e-02 +846 749 4.16666666666667e-02 +846 1223 -8.33333333333333e-02 +846 748 4.16666666666667e-02 +846 847 -8.33333333333333e-02 +846 1087 8.33333333333333e-02 +846 747 -1.25000000000000e-01 +846 1086 -1.25000000000000e-01 +846 848 -8.33333333333333e-02 +846 683 4.16666666666667e-02 +846 854 8.33333333333333e-02 +846 682 4.16666666666667e-02 +846 841 -8.33333333333333e-02 +846 842 4.16666666666667e-02 +846 681 -1.25000000000000e-01 +846 852 -1.25000000000000e-01 +847 847 5.83333333333333e-01 +847 1088 8.33333333333333e-02 +847 854 8.33333333333333e-02 +847 1221 4.16666666666667e-02 +847 852 -4.16666666666667e-02 +847 749 -4.16666666666667e-02 +847 1223 4.16666666666667e-02 +847 748 -4.16666666666667e-02 +847 1087 -3.75000000000000e-01 +847 747 4.16666666666667e-02 +847 846 -8.33333333333333e-02 +847 1086 8.33333333333333e-02 +847 683 -4.16666666666667e-02 +847 842 4.16666666666667e-02 +847 848 -1.66666666666667e-01 +847 682 -4.16666666666667e-02 +847 853 -1.25000000000000e-01 +847 681 4.16666666666667e-02 +847 840 -8.33333333333333e-02 +848 848 5.83333333333333e-01 +848 1086 -4.16666666666667e-02 +848 847 -1.66666666666667e-01 +848 1087 8.33333333333333e-02 +848 853 8.33333333333333e-02 +848 749 -4.16666666666667e-02 +848 1088 -1.25000000000000e-01 +848 748 -4.16666666666667e-02 +848 1222 4.16666666666667e-02 +848 747 4.16666666666667e-02 +848 1221 -8.33333333333333e-02 +848 840 4.16666666666667e-02 +848 683 -4.16666666666667e-02 +848 854 -3.75000000000000e-01 +848 682 -4.16666666666667e-02 +848 841 4.16666666666667e-02 +848 846 -8.33333333333333e-02 +848 681 4.16666666666667e-02 +848 852 8.33333333333333e-02 +849 849 1.25000000000000e+00 +849 850 -1.66666666666667e-01 +849 1229 -8.33333333333333e-02 +849 751 -4.16666666666667e-02 +849 1228 4.16666666666667e-02 +849 854 8.33333333333333e-02 +849 682 -4.16666666666667e-02 +849 852 -3.75000000000000e-01 +849 844 4.16666666666667e-02 +849 683 8.33333333333333e-02 +849 845 -8.33333333333333e-02 +849 851 -1.66666666666667e-01 +849 1208 8.33333333333333e-02 +849 752 8.33333333333333e-02 +849 1207 8.33333333333333e-02 +849 1206 -3.75000000000000e-01 +849 838 -8.33333333333333e-02 +849 841 8.33333333333333e-02 +849 842 8.33333333333333e-02 +849 839 -8.33333333333333e-02 +849 681 -1.25000000000000e-01 +849 1091 -8.33333333333333e-02 +849 998 8.33333333333333e-02 +849 1090 1.66666666666667e-01 +849 997 -1.66666666666667e-01 +849 1089 -2.50000000000000e-01 +849 853 8.33333333333333e-02 +849 750 -1.25000000000000e-01 +850 850 1.25000000000000e+00 +850 1229 4.16666666666667e-02 +850 852 8.33333333333333e-02 +850 849 -1.66666666666667e-01 +850 750 -4.16666666666667e-02 +850 1227 4.16666666666667e-02 +850 853 -1.25000000000000e-01 +850 681 -4.16666666666667e-02 +850 843 4.16666666666667e-02 +850 845 4.16666666666667e-02 +850 1208 -4.16666666666667e-02 +850 1207 -1.25000000000000e-01 +850 1206 8.33333333333333e-02 +850 837 -8.33333333333333e-02 +850 840 8.33333333333333e-02 +850 839 -8.33333333333333e-02 +850 998 8.33333333333333e-02 +850 842 -1.66666666666667e-01 +850 683 8.33333333333333e-02 +850 682 -1.25000000000000e-01 +850 1091 1.66666666666667e-01 +850 851 -1.66666666666667e-01 +850 752 8.33333333333333e-02 +850 1090 -7.50000000000000e-01 +850 854 -4.16666666666667e-02 +850 751 -1.25000000000000e-01 +850 1089 1.66666666666667e-01 +850 996 -1.66666666666667e-01 +851 851 1.25000000000000e+00 +851 1228 4.16666666666667e-02 +851 1227 -8.33333333333333e-02 +851 854 -1.25000000000000e-01 +851 852 8.33333333333333e-02 +851 844 4.16666666666667e-02 +851 681 8.33333333333333e-02 +851 843 -8.33333333333333e-02 +851 1208 -1.25000000000000e-01 +851 1207 -4.16666666666667e-02 +851 849 -1.66666666666667e-01 +851 1206 8.33333333333333e-02 +851 750 8.33333333333333e-02 +851 838 -8.33333333333333e-02 +851 997 8.33333333333333e-02 +851 683 -3.75000000000000e-01 +851 841 -1.66666666666667e-01 +851 682 8.33333333333333e-02 +851 840 8.33333333333333e-02 +851 837 -8.33333333333333e-02 +851 1091 -2.50000000000000e-01 +851 853 -4.16666666666667e-02 +851 752 -3.75000000000000e-01 +851 1090 1.66666666666667e-01 +851 850 -1.66666666666667e-01 +851 751 8.33333333333333e-02 +851 1089 -8.33333333333333e-02 +851 996 8.33333333333333e-02 +852 852 1.25000000000000e+00 +852 1087 8.33333333333333e-02 +852 1088 8.33333333333333e-02 +852 848 8.33333333333333e-02 +852 846 -1.25000000000000e-01 +852 1223 8.33333333333333e-02 +852 1222 8.33333333333333e-02 +852 853 -1.66666666666667e-01 +852 1221 -3.75000000000000e-01 +852 1094 -8.33333333333333e-02 +852 854 -1.66666666666667e-01 +852 842 -8.33333333333333e-02 +852 1091 8.33333333333333e-02 +852 850 8.33333333333333e-02 +852 1093 1.66666666666667e-01 +852 1090 -1.66666666666667e-01 +852 851 8.33333333333333e-02 +852 683 -8.33333333333333e-02 +852 682 4.16666666666667e-02 +852 841 -8.33333333333333e-02 +852 849 -3.75000000000000e-01 +852 1229 8.33333333333333e-02 +852 755 -8.33333333333333e-02 +852 1228 -4.16666666666667e-02 +852 754 4.16666666666667e-02 +852 1227 -1.25000000000000e-01 +852 847 -4.16666666666667e-02 +852 1092 -2.50000000000000e-01 +853 853 1.25000000000000e+00 +853 846 -4.16666666666667e-02 +853 1086 8.33333333333333e-02 +853 1088 -1.66666666666667e-01 +853 683 4.16666666666667e-02 +853 847 -1.25000000000000e-01 +853 1223 -4.16666666666667e-02 +853 755 4.16666666666667e-02 +853 1222 -1.25000000000000e-01 +853 1221 8.33333333333333e-02 +853 852 -1.66666666666667e-01 +853 851 -4.16666666666667e-02 +853 849 8.33333333333333e-02 +853 842 -8.33333333333333e-02 +853 1091 8.33333333333333e-02 +853 1092 1.66666666666667e-01 +853 1089 -1.66666666666667e-01 +853 850 -1.25000000000000e-01 +853 681 4.16666666666667e-02 +853 840 -8.33333333333333e-02 +853 1229 8.33333333333333e-02 +853 854 -1.66666666666667e-01 +853 1094 1.66666666666667e-01 +853 1228 -1.25000000000000e-01 +853 848 8.33333333333333e-02 +853 1093 -7.50000000000000e-01 +853 1227 -4.16666666666667e-02 +853 753 4.16666666666667e-02 +854 854 1.25000000000000e+00 +854 1087 -1.66666666666667e-01 +854 1086 8.33333333333333e-02 +854 848 -3.75000000000000e-01 +854 682 4.16666666666667e-02 +854 846 8.33333333333333e-02 +854 1223 -1.25000000000000e-01 +854 1222 -4.16666666666667e-02 +854 754 4.16666666666667e-02 +854 1221 8.33333333333333e-02 +854 1092 -8.33333333333333e-02 +854 850 -4.16666666666667e-02 +854 852 -1.66666666666667e-01 +854 840 -8.33333333333333e-02 +854 1089 8.33333333333333e-02 +854 841 -8.33333333333333e-02 +854 1090 8.33333333333333e-02 +854 851 -1.25000000000000e-01 +854 849 8.33333333333333e-02 +854 681 -8.33333333333333e-02 +854 1229 -3.75000000000000e-01 +854 847 8.33333333333333e-02 +854 1094 -2.50000000000000e-01 +854 1228 8.33333333333333e-02 +854 853 -1.66666666666667e-01 +854 1093 1.66666666666667e-01 +854 1227 8.33333333333333e-02 +854 753 -8.33333333333333e-02 +855 855 1.25000000000000e+00 +855 1225 8.33333333333333e-02 +855 1226 8.33333333333333e-02 +855 862 8.33333333333333e-02 +855 861 -1.25000000000000e-01 +855 857 -1.66666666666667e-01 +855 1106 8.33333333333333e-02 +855 1105 8.33333333333333e-02 +855 1104 -3.75000000000000e-01 +855 1111 -8.33333333333333e-02 +855 856 -1.66666666666667e-01 +855 860 8.33333333333333e-02 +855 865 -8.33333333333333e-02 +855 1189 8.33333333333333e-02 +855 1112 1.66666666666667e-01 +855 1190 -1.66666666666667e-01 +855 686 4.16666666666667e-02 +855 866 -8.33333333333333e-02 +855 859 8.33333333333333e-02 +855 685 -8.33333333333333e-02 +855 858 -3.75000000000000e-01 +855 1100 -4.16666666666667e-02 +855 719 4.16666666666667e-02 +855 1099 8.33333333333333e-02 +855 718 -8.33333333333333e-02 +855 1098 -1.25000000000000e-01 +855 863 -4.16666666666667e-02 +855 1110 -2.50000000000000e-01 +856 856 1.25000000000000e+00 +856 1224 8.33333333333333e-02 +856 1226 -1.66666666666667e-01 +856 686 4.16666666666667e-02 +856 862 -3.75000000000000e-01 +856 861 8.33333333333333e-02 +856 1106 -4.16666666666667e-02 +856 719 4.16666666666667e-02 +856 1105 -1.25000000000000e-01 +856 1104 8.33333333333333e-02 +856 1110 -8.33333333333333e-02 +856 860 -4.16666666666667e-02 +856 855 -1.66666666666667e-01 +856 864 -8.33333333333333e-02 +856 1188 8.33333333333333e-02 +856 866 -8.33333333333333e-02 +856 1190 8.33333333333333e-02 +856 859 -1.25000000000000e-01 +856 858 8.33333333333333e-02 +856 684 -8.33333333333333e-02 +856 1100 8.33333333333333e-02 +856 857 -1.66666666666667e-01 +856 1112 1.66666666666667e-01 +856 1099 -3.75000000000000e-01 +856 863 8.33333333333333e-02 +856 1111 -2.50000000000000e-01 +856 1098 8.33333333333333e-02 +856 717 -8.33333333333333e-02 +857 857 1.25000000000000e+00 +857 862 8.33333333333333e-02 +857 1225 -1.66666666666667e-01 +857 1224 8.33333333333333e-02 +857 863 -1.25000000000000e-01 +857 685 4.16666666666667e-02 +857 1106 -1.25000000000000e-01 +857 1105 -4.16666666666667e-02 +857 718 4.16666666666667e-02 +857 855 -1.66666666666667e-01 +857 1104 8.33333333333333e-02 +857 859 -4.16666666666667e-02 +857 858 8.33333333333333e-02 +857 865 -8.33333333333333e-02 +857 1189 8.33333333333333e-02 +857 1110 1.66666666666667e-01 +857 1188 -1.66666666666667e-01 +857 860 -1.25000000000000e-01 +857 684 4.16666666666667e-02 +857 864 -8.33333333333333e-02 +857 1100 -1.25000000000000e-01 +857 861 -4.16666666666667e-02 +857 1112 -7.50000000000000e-01 +857 1099 8.33333333333333e-02 +857 856 -1.66666666666667e-01 +857 1111 1.66666666666667e-01 +857 1098 -4.16666666666667e-02 +857 717 4.16666666666667e-02 +858 858 5.83333333333333e-01 +858 860 -1.66666666666667e-01 +858 1190 8.33333333333333e-02 +858 865 4.16666666666667e-02 +858 1189 -4.16666666666667e-02 +858 734 -4.16666666666667e-02 +858 1100 4.16666666666667e-02 +858 733 4.16666666666667e-02 +858 1099 -8.33333333333333e-02 +858 732 -4.16666666666667e-02 +858 1188 -1.25000000000000e-01 +858 686 -4.16666666666667e-02 +858 866 4.16666666666667e-02 +858 859 -8.33333333333333e-02 +858 685 4.16666666666667e-02 +858 856 8.33333333333333e-02 +858 857 8.33333333333333e-02 +858 684 -4.16666666666667e-02 +858 855 -3.75000000000000e-01 +859 859 5.00000000000000e-01 +859 1100 4.16666666666667e-02 +859 864 4.16666666666667e-02 +859 1188 -4.16666666666667e-02 +859 734 4.16666666666667e-02 +859 860 -8.33333333333333e-02 +859 1190 8.33333333333333e-02 +859 733 -1.25000000000000e-01 +859 1189 -1.25000000000000e-01 +859 732 4.16666666666667e-02 +859 1098 -8.33333333333333e-02 +859 686 4.16666666666667e-02 +859 866 -8.33333333333333e-02 +859 857 -4.16666666666667e-02 +859 685 -1.25000000000000e-01 +859 856 -1.25000000000000e-01 +859 858 -8.33333333333333e-02 +859 684 4.16666666666667e-02 +859 855 8.33333333333333e-02 +860 860 5.83333333333333e-01 +860 1099 4.16666666666667e-02 +860 855 8.33333333333333e-02 +860 858 -1.66666666666667e-01 +860 1188 8.33333333333333e-02 +860 734 -4.16666666666667e-02 +860 1190 -3.75000000000000e-01 +860 733 4.16666666666667e-02 +860 859 -8.33333333333333e-02 +860 1189 8.33333333333333e-02 +860 732 -4.16666666666667e-02 +860 1098 4.16666666666667e-02 +860 856 -4.16666666666667e-02 +860 686 -4.16666666666667e-02 +860 857 -1.25000000000000e-01 +860 685 4.16666666666667e-02 +860 865 -8.33333333333333e-02 +860 684 -4.16666666666667e-02 +860 864 4.16666666666667e-02 +861 861 5.00000000000000e-01 +861 857 -4.16666666666667e-02 +861 865 4.16666666666667e-02 +861 1225 -4.16666666666667e-02 +861 686 4.16666666666667e-02 +861 866 -8.33333333333333e-02 +861 685 4.16666666666667e-02 +861 862 -8.33333333333333e-02 +861 856 8.33333333333333e-02 +861 684 -1.25000000000000e-01 +861 855 -1.25000000000000e-01 +861 863 -8.33333333333333e-02 +861 749 4.16666666666667e-02 +861 1226 8.33333333333333e-02 +861 748 4.16666666666667e-02 +861 1105 -8.33333333333333e-02 +861 1106 4.16666666666667e-02 +861 747 -1.25000000000000e-01 +861 1224 -1.25000000000000e-01 +862 862 5.83333333333333e-01 +862 857 8.33333333333333e-02 +862 1226 8.33333333333333e-02 +862 864 4.16666666666667e-02 +862 1224 -4.16666666666667e-02 +862 686 -4.16666666666667e-02 +862 866 4.16666666666667e-02 +862 685 -4.16666666666667e-02 +862 856 -3.75000000000000e-01 +862 684 4.16666666666667e-02 +862 861 -8.33333333333333e-02 +862 855 8.33333333333333e-02 +862 749 -4.16666666666667e-02 +862 1106 4.16666666666667e-02 +862 863 -1.66666666666667e-01 +862 748 -4.16666666666667e-02 +862 1225 -1.25000000000000e-01 +862 747 4.16666666666667e-02 +862 1104 -8.33333333333333e-02 +863 863 5.83333333333333e-01 +863 855 -4.16666666666667e-02 +863 862 -1.66666666666667e-01 +863 856 8.33333333333333e-02 +863 1225 8.33333333333333e-02 +863 686 -4.16666666666667e-02 +863 857 -1.25000000000000e-01 +863 685 -4.16666666666667e-02 +863 865 4.16666666666667e-02 +863 684 4.16666666666667e-02 +863 864 -8.33333333333333e-02 +863 1104 4.16666666666667e-02 +863 749 -4.16666666666667e-02 +863 1226 -3.75000000000000e-01 +863 748 -4.16666666666667e-02 +863 1105 4.16666666666667e-02 +863 861 -8.33333333333333e-02 +863 747 4.16666666666667e-02 +863 1224 8.33333333333333e-02 +864 864 6.66666666666667e-01 +864 686 4.16666666666667e-02 +864 863 -8.33333333333333e-02 +864 866 -8.33333333333333e-02 +864 1226 8.33333333333333e-02 +864 758 4.16666666666667e-02 +864 1225 8.33333333333333e-02 +864 1224 -3.75000000000000e-01 +864 856 -8.33333333333333e-02 +864 859 4.16666666666667e-02 +864 860 4.16666666666667e-02 +864 857 -8.33333333333333e-02 +864 684 -8.33333333333333e-02 +864 1190 -4.16666666666667e-02 +864 1112 8.33333333333333e-02 +864 1189 8.33333333333333e-02 +864 1111 -1.66666666666667e-01 +864 1188 -1.25000000000000e-01 +864 862 4.16666666666667e-02 +864 756 -8.33333333333333e-02 +865 865 6.66666666666667e-01 +865 863 4.16666666666667e-02 +865 1226 -4.16666666666667e-02 +865 1225 -1.25000000000000e-01 +865 1224 8.33333333333333e-02 +865 855 -8.33333333333333e-02 +865 858 4.16666666666667e-02 +865 857 -8.33333333333333e-02 +865 1112 8.33333333333333e-02 +865 860 -8.33333333333333e-02 +865 686 4.16666666666667e-02 +865 685 -8.33333333333333e-02 +865 1190 8.33333333333333e-02 +865 866 -8.33333333333333e-02 +865 758 4.16666666666667e-02 +865 1189 -3.75000000000000e-01 +865 861 4.16666666666667e-02 +865 757 -8.33333333333333e-02 +865 1188 8.33333333333333e-02 +865 1110 -1.66666666666667e-01 +866 866 7.50000000000000e-01 +866 684 4.16666666666667e-02 +866 861 -8.33333333333333e-02 +866 1226 -1.25000000000000e-01 +866 1225 -4.16666666666667e-02 +866 864 -8.33333333333333e-02 +866 1224 8.33333333333333e-02 +866 756 4.16666666666667e-02 +866 856 -8.33333333333333e-02 +866 1111 8.33333333333333e-02 +866 686 -2.50000000000000e-01 +866 859 -8.33333333333333e-02 +866 685 4.16666666666667e-02 +866 858 4.16666666666667e-02 +866 855 -8.33333333333333e-02 +866 1190 -1.25000000000000e-01 +866 862 4.16666666666667e-02 +866 758 -2.50000000000000e-01 +866 1189 8.33333333333333e-02 +866 865 -8.33333333333333e-02 +866 757 4.16666666666667e-02 +866 1188 -4.16666666666667e-02 +866 1110 8.33333333333333e-02 +867 867 5.00000000000000e-01 +867 1241 4.16666666666667e-02 +867 872 -4.16666666666667e-02 +867 868 -8.33333333333333e-02 +867 871 8.33333333333333e-02 +867 870 -1.25000000000000e-01 +867 869 -8.33333333333333e-02 +867 761 4.16666666666667e-02 +867 1007 8.33333333333333e-02 +867 760 4.16666666666667e-02 +867 1240 -8.33333333333333e-02 +867 1006 -4.16666666666667e-02 +867 759 -1.25000000000000e-01 +867 1005 -1.25000000000000e-01 +867 268 4.16666666666667e-02 +867 26 4.16666666666667e-02 +867 269 -8.33333333333333e-02 +867 25 4.16666666666667e-02 +867 24 -1.25000000000000e-01 +868 868 5.83333333333333e-01 +868 1007 8.33333333333333e-02 +868 869 -1.66666666666667e-01 +868 872 8.33333333333333e-02 +868 871 -3.75000000000000e-01 +868 867 -8.33333333333333e-02 +868 870 8.33333333333333e-02 +868 761 -4.16666666666667e-02 +868 1241 4.16666666666667e-02 +868 1005 -4.16666666666667e-02 +868 760 -4.16666666666667e-02 +868 1006 -1.25000000000000e-01 +868 759 4.16666666666667e-02 +868 1239 -8.33333333333333e-02 +868 267 4.16666666666667e-02 +868 26 -4.16666666666667e-02 +868 269 4.16666666666667e-02 +868 25 -4.16666666666667e-02 +868 24 4.16666666666667e-02 +869 869 5.83333333333333e-01 +869 868 -1.66666666666667e-01 +869 871 8.33333333333333e-02 +869 1239 4.16666666666667e-02 +869 870 -4.16666666666667e-02 +869 872 -1.25000000000000e-01 +869 1006 8.33333333333333e-02 +869 761 -4.16666666666667e-02 +869 1007 -3.75000000000000e-01 +869 760 -4.16666666666667e-02 +869 1240 4.16666666666667e-02 +869 867 -8.33333333333333e-02 +869 759 4.16666666666667e-02 +869 1005 8.33333333333333e-02 +869 26 -4.16666666666667e-02 +869 25 -4.16666666666667e-02 +869 268 4.16666666666667e-02 +869 24 4.16666666666667e-02 +869 267 -8.33333333333333e-02 +870 870 1.25000000000000e+00 +870 1247 -4.16666666666667e-02 +870 764 4.16666666666667e-02 +870 1246 8.33333333333333e-02 +870 1245 -1.25000000000000e-01 +870 1007 8.33333333333333e-02 +870 869 -4.16666666666667e-02 +870 871 -1.66666666666667e-01 +870 1006 8.33333333333333e-02 +870 1009 -8.33333333333333e-02 +870 868 8.33333333333333e-02 +870 867 -1.25000000000000e-01 +870 872 -1.66666666666667e-01 +870 1241 8.33333333333333e-02 +870 1010 1.66666666666667e-01 +870 1240 8.33333333333333e-02 +870 763 -8.33333333333333e-02 +870 1239 -3.75000000000000e-01 +870 1008 -2.50000000000000e-01 +870 596 -1.66666666666667e-01 +870 595 8.33333333333333e-02 +870 26 4.16666666666667e-02 +870 274 8.33333333333333e-02 +870 273 -3.75000000000000e-01 +870 269 -8.33333333333333e-02 +870 268 -8.33333333333333e-02 +870 25 -8.33333333333333e-02 +870 275 8.33333333333333e-02 +871 871 1.25000000000000e+00 +871 1247 8.33333333333333e-02 +871 872 -1.66666666666667e-01 +871 1246 -3.75000000000000e-01 +871 1245 8.33333333333333e-02 +871 869 8.33333333333333e-02 +871 870 -1.66666666666667e-01 +871 1007 -1.66666666666667e-01 +871 1010 1.66666666666667e-01 +871 1005 8.33333333333333e-02 +871 1008 -8.33333333333333e-02 +871 868 -3.75000000000000e-01 +871 867 8.33333333333333e-02 +871 1241 -4.16666666666667e-02 +871 764 4.16666666666667e-02 +871 1240 -1.25000000000000e-01 +871 1009 -2.50000000000000e-01 +871 1239 8.33333333333333e-02 +871 762 -8.33333333333333e-02 +871 596 8.33333333333333e-02 +871 594 8.33333333333333e-02 +871 274 -1.25000000000000e-01 +871 273 8.33333333333333e-02 +871 267 -8.33333333333333e-02 +871 26 4.16666666666667e-02 +871 269 -8.33333333333333e-02 +871 24 -8.33333333333333e-02 +871 275 -4.16666666666667e-02 +872 872 1.25000000000000e+00 +872 1247 -1.25000000000000e-01 +872 1246 8.33333333333333e-02 +872 871 -1.66666666666667e-01 +872 1245 -4.16666666666667e-02 +872 762 4.16666666666667e-02 +872 868 8.33333333333333e-02 +872 1005 8.33333333333333e-02 +872 867 -4.16666666666667e-02 +872 1006 -1.66666666666667e-01 +872 1009 1.66666666666667e-01 +872 869 -1.25000000000000e-01 +872 1241 -1.25000000000000e-01 +872 1010 -7.50000000000000e-01 +872 1240 -4.16666666666667e-02 +872 763 4.16666666666667e-02 +872 870 -1.66666666666667e-01 +872 1239 8.33333333333333e-02 +872 1008 1.66666666666667e-01 +872 595 8.33333333333333e-02 +872 273 8.33333333333333e-02 +872 594 -1.66666666666667e-01 +872 275 -1.25000000000000e-01 +872 24 4.16666666666667e-02 +872 267 -8.33333333333333e-02 +872 25 4.16666666666667e-02 +872 268 -8.33333333333333e-02 +872 274 -4.16666666666667e-02 +873 873 1.25000000000000e+00 +873 1127 8.33333333333333e-02 +873 1126 -1.66666666666667e-01 +873 878 8.33333333333333e-02 +873 688 4.16666666666667e-02 +873 876 -3.75000000000000e-01 +873 1016 8.33333333333333e-02 +873 1015 -4.16666666666667e-02 +873 706 4.16666666666667e-02 +873 1014 -1.25000000000000e-01 +873 1028 -8.33333333333333e-02 +873 875 -1.66666666666667e-01 +873 880 -4.16666666666667e-02 +873 887 -8.33333333333333e-02 +873 1244 8.33333333333333e-02 +873 886 -8.33333333333333e-02 +873 1243 8.33333333333333e-02 +873 881 8.33333333333333e-02 +873 689 -8.33333333333333e-02 +873 879 -1.25000000000000e-01 +873 1022 8.33333333333333e-02 +873 707 -8.33333333333333e-02 +873 1021 8.33333333333333e-02 +873 874 -1.66666666666667e-01 +873 1027 1.66666666666667e-01 +873 1020 -3.75000000000000e-01 +873 877 8.33333333333333e-02 +873 1026 -2.50000000000000e-01 +874 874 1.25000000000000e+00 +874 1127 8.33333333333333e-02 +874 876 8.33333333333333e-02 +874 1125 -1.66666666666667e-01 +874 877 -1.25000000000000e-01 +874 687 4.16666666666667e-02 +874 1016 8.33333333333333e-02 +874 875 -1.66666666666667e-01 +874 1015 -1.25000000000000e-01 +874 1014 -4.16666666666667e-02 +874 705 4.16666666666667e-02 +874 879 -4.16666666666667e-02 +874 881 8.33333333333333e-02 +874 1028 1.66666666666667e-01 +874 1244 -1.66666666666667e-01 +874 885 -8.33333333333333e-02 +874 1242 8.33333333333333e-02 +874 689 4.16666666666667e-02 +874 887 -8.33333333333333e-02 +874 880 -1.25000000000000e-01 +874 1022 -4.16666666666667e-02 +874 707 4.16666666666667e-02 +874 1021 -1.25000000000000e-01 +874 878 -4.16666666666667e-02 +874 1027 -7.50000000000000e-01 +874 1020 8.33333333333333e-02 +874 873 -1.66666666666667e-01 +874 1026 1.66666666666667e-01 +875 875 1.25000000000000e+00 +875 1126 8.33333333333333e-02 +875 1125 8.33333333333333e-02 +875 878 -1.25000000000000e-01 +875 876 8.33333333333333e-02 +875 1016 -3.75000000000000e-01 +875 1015 8.33333333333333e-02 +875 874 -1.66666666666667e-01 +875 1014 8.33333333333333e-02 +875 1026 -8.33333333333333e-02 +875 873 -1.66666666666667e-01 +875 880 8.33333333333333e-02 +875 885 -8.33333333333333e-02 +875 1242 8.33333333333333e-02 +875 1027 1.66666666666667e-01 +875 1243 -1.66666666666667e-01 +875 881 -3.75000000000000e-01 +875 688 4.16666666666667e-02 +875 886 -8.33333333333333e-02 +875 879 8.33333333333333e-02 +875 687 -8.33333333333333e-02 +875 1022 -1.25000000000000e-01 +875 877 -4.16666666666667e-02 +875 1028 -2.50000000000000e-01 +875 1021 -4.16666666666667e-02 +875 706 4.16666666666667e-02 +875 1020 8.33333333333333e-02 +875 705 -8.33333333333333e-02 +876 876 1.25000000000000e+00 +876 890 -8.33333333333333e-02 +876 883 4.16666666666667e-02 +876 889 -8.33333333333333e-02 +876 884 -8.33333333333333e-02 +876 1124 8.33333333333333e-02 +876 1123 8.33333333333333e-02 +876 1129 -1.66666666666667e-01 +876 1122 -3.75000000000000e-01 +876 887 8.33333333333333e-02 +876 1127 -8.33333333333333e-02 +876 877 -1.66666666666667e-01 +876 1126 1.66666666666667e-01 +876 874 8.33333333333333e-02 +876 722 8.33333333333333e-02 +876 1016 -8.33333333333333e-02 +876 721 -4.16666666666667e-02 +876 1015 4.16666666666667e-02 +876 720 -1.25000000000000e-01 +876 1125 -2.50000000000000e-01 +876 878 -1.66666666666667e-01 +876 689 8.33333333333333e-02 +876 875 8.33333333333333e-02 +876 688 -4.16666666666667e-02 +876 886 8.33333333333333e-02 +876 1130 8.33333333333333e-02 +876 687 -1.25000000000000e-01 +876 873 -3.75000000000000e-01 +877 877 1.25000000000000e+00 +877 888 -8.33333333333333e-02 +877 884 4.16666666666667e-02 +877 890 -8.33333333333333e-02 +877 1124 -4.16666666666667e-02 +877 1130 8.33333333333333e-02 +877 1123 -1.25000000000000e-01 +877 1122 8.33333333333333e-02 +877 1128 -1.66666666666667e-01 +877 1016 4.16666666666667e-02 +877 875 -4.16666666666667e-02 +877 876 -1.66666666666667e-01 +877 1125 1.66666666666667e-01 +877 873 8.33333333333333e-02 +877 722 8.33333333333333e-02 +877 878 -1.66666666666667e-01 +877 1127 1.66666666666667e-01 +877 721 -1.25000000000000e-01 +877 1126 -7.50000000000000e-01 +877 720 -4.16666666666667e-02 +877 1014 4.16666666666667e-02 +877 689 8.33333333333333e-02 +877 887 -1.66666666666667e-01 +877 882 4.16666666666667e-02 +877 688 -1.25000000000000e-01 +877 874 -1.25000000000000e-01 +877 687 -4.16666666666667e-02 +877 885 8.33333333333333e-02 +878 878 1.25000000000000e+00 +878 888 -8.33333333333333e-02 +878 883 4.16666666666667e-02 +878 889 -8.33333333333333e-02 +878 882 -8.33333333333333e-02 +878 1124 -1.25000000000000e-01 +878 1123 -4.16666666666667e-02 +878 1129 8.33333333333333e-02 +878 1122 8.33333333333333e-02 +878 885 8.33333333333333e-02 +878 1125 -8.33333333333333e-02 +878 1015 4.16666666666667e-02 +878 874 -4.16666666666667e-02 +878 722 -3.75000000000000e-01 +878 1127 -2.50000000000000e-01 +878 721 8.33333333333333e-02 +878 877 -1.66666666666667e-01 +878 1126 1.66666666666667e-01 +878 720 8.33333333333333e-02 +878 1014 -8.33333333333333e-02 +878 1128 8.33333333333333e-02 +878 689 -3.75000000000000e-01 +878 875 -1.25000000000000e-01 +878 688 8.33333333333333e-02 +878 886 -1.66666666666667e-01 +878 876 -1.66666666666667e-01 +878 687 8.33333333333333e-02 +878 873 8.33333333333333e-02 +879 879 5.00000000000000e-01 +879 1021 4.16666666666667e-02 +879 887 4.16666666666667e-02 +879 1244 -4.16666666666667e-02 +879 761 4.16666666666667e-02 +879 1022 -8.33333333333333e-02 +879 760 4.16666666666667e-02 +879 880 -8.33333333333333e-02 +879 1243 8.33333333333333e-02 +879 759 -1.25000000000000e-01 +879 1242 -1.25000000000000e-01 +879 881 -8.33333333333333e-02 +879 689 4.16666666666667e-02 +879 875 8.33333333333333e-02 +879 688 4.16666666666667e-02 +879 886 -8.33333333333333e-02 +879 874 -4.16666666666667e-02 +879 687 -1.25000000000000e-01 +879 873 -1.25000000000000e-01 +880 880 5.83333333333333e-01 +880 1020 4.16666666666667e-02 +880 875 8.33333333333333e-02 +880 881 -1.66666666666667e-01 +880 1244 8.33333333333333e-02 +880 761 -4.16666666666667e-02 +880 1022 4.16666666666667e-02 +880 760 -4.16666666666667e-02 +880 1243 -3.75000000000000e-01 +880 759 4.16666666666667e-02 +880 879 -8.33333333333333e-02 +880 1242 8.33333333333333e-02 +880 689 -4.16666666666667e-02 +880 887 4.16666666666667e-02 +880 873 -4.16666666666667e-02 +880 688 -4.16666666666667e-02 +880 874 -1.25000000000000e-01 +880 687 4.16666666666667e-02 +880 885 -8.33333333333333e-02 +881 881 5.83333333333333e-01 +881 880 -1.66666666666667e-01 +881 1243 8.33333333333333e-02 +881 885 4.16666666666667e-02 +881 1242 -4.16666666666667e-02 +881 761 -4.16666666666667e-02 +881 1244 -1.25000000000000e-01 +881 760 -4.16666666666667e-02 +881 1021 4.16666666666667e-02 +881 759 4.16666666666667e-02 +881 1020 -8.33333333333333e-02 +881 874 8.33333333333333e-02 +881 689 -4.16666666666667e-02 +881 875 -3.75000000000000e-01 +881 688 -4.16666666666667e-02 +881 886 4.16666666666667e-02 +881 879 -8.33333333333333e-02 +881 687 4.16666666666667e-02 +881 873 8.33333333333333e-02 +882 882 5.00000000000000e-01 +882 877 4.16666666666667e-02 +882 1259 4.16666666666667e-02 +882 890 -4.16666666666667e-02 +882 689 4.16666666666667e-02 +882 878 -8.33333333333333e-02 +882 688 4.16666666666667e-02 +882 883 -8.33333333333333e-02 +882 889 8.33333333333333e-02 +882 687 -1.25000000000000e-01 +882 888 -1.25000000000000e-01 +882 884 -8.33333333333333e-02 +882 767 4.16666666666667e-02 +882 1124 8.33333333333333e-02 +882 766 4.16666666666667e-02 +882 1258 -8.33333333333333e-02 +882 1123 -4.16666666666667e-02 +882 765 -1.25000000000000e-01 +882 1122 -1.25000000000000e-01 +883 883 5.83333333333333e-01 +883 876 4.16666666666667e-02 +883 1124 8.33333333333333e-02 +883 884 -1.66666666666667e-01 +883 890 8.33333333333333e-02 +883 689 -4.16666666666667e-02 +883 878 4.16666666666667e-02 +883 688 -4.16666666666667e-02 +883 889 -3.75000000000000e-01 +883 687 4.16666666666667e-02 +883 882 -8.33333333333333e-02 +883 888 8.33333333333333e-02 +883 767 -4.16666666666667e-02 +883 1259 4.16666666666667e-02 +883 1122 -4.16666666666667e-02 +883 766 -4.16666666666667e-02 +883 1123 -1.25000000000000e-01 +883 765 4.16666666666667e-02 +883 1257 -8.33333333333333e-02 +884 884 5.83333333333333e-01 +884 883 -1.66666666666667e-01 +884 889 8.33333333333333e-02 +884 1257 4.16666666666667e-02 +884 888 -4.16666666666667e-02 +884 689 -4.16666666666667e-02 +884 890 -1.25000000000000e-01 +884 688 -4.16666666666667e-02 +884 877 4.16666666666667e-02 +884 687 4.16666666666667e-02 +884 876 -8.33333333333333e-02 +884 1123 8.33333333333333e-02 +884 767 -4.16666666666667e-02 +884 1124 -3.75000000000000e-01 +884 766 -4.16666666666667e-02 +884 1258 4.16666666666667e-02 +884 882 -8.33333333333333e-02 +884 765 4.16666666666667e-02 +884 1122 8.33333333333333e-02 +885 885 1.25000000000000e+00 +885 890 8.33333333333333e-02 +885 770 -4.16666666666667e-02 +885 1265 4.16666666666667e-02 +885 1264 -8.33333333333333e-02 +885 689 -4.16666666666667e-02 +885 889 8.33333333333333e-02 +885 888 -3.75000000000000e-01 +885 878 8.33333333333333e-02 +885 877 8.33333333333333e-02 +885 1127 1.66666666666667e-01 +885 1126 -8.33333333333333e-02 +885 1125 -2.50000000000000e-01 +885 875 -8.33333333333333e-02 +885 881 4.16666666666667e-02 +885 874 -8.33333333333333e-02 +885 1027 8.33333333333333e-02 +885 880 -8.33333333333333e-02 +885 688 8.33333333333333e-02 +885 687 -1.25000000000000e-01 +885 1244 8.33333333333333e-02 +885 1028 -1.66666666666667e-01 +885 1243 8.33333333333333e-02 +885 886 -1.66666666666667e-01 +885 769 8.33333333333333e-02 +885 1242 -3.75000000000000e-01 +885 887 -1.66666666666667e-01 +885 768 -1.25000000000000e-01 +886 886 1.25000000000000e+00 +886 890 -4.16666666666667e-02 +886 1263 -8.33333333333333e-02 +886 889 -1.25000000000000e-01 +886 888 8.33333333333333e-02 +886 878 -1.66666666666667e-01 +886 689 8.33333333333333e-02 +886 876 8.33333333333333e-02 +886 1127 1.66666666666667e-01 +886 887 -1.66666666666667e-01 +886 770 8.33333333333333e-02 +886 1126 -2.50000000000000e-01 +886 1125 -8.33333333333333e-02 +886 873 -8.33333333333333e-02 +886 1026 8.33333333333333e-02 +886 881 4.16666666666667e-02 +886 875 -8.33333333333333e-02 +886 688 -3.75000000000000e-01 +886 879 -8.33333333333333e-02 +886 687 8.33333333333333e-02 +886 1244 -4.16666666666667e-02 +886 1028 8.33333333333333e-02 +886 1243 -1.25000000000000e-01 +886 1265 4.16666666666667e-02 +886 769 -3.75000000000000e-01 +886 1242 8.33333333333333e-02 +886 885 -1.66666666666667e-01 +886 768 8.33333333333333e-02 +887 887 1.25000000000000e+00 +887 889 -4.16666666666667e-02 +887 885 -1.66666666666667e-01 +887 888 8.33333333333333e-02 +887 768 -4.16666666666667e-02 +887 1263 4.16666666666667e-02 +887 890 -1.25000000000000e-01 +887 687 -4.16666666666667e-02 +887 876 8.33333333333333e-02 +887 877 -1.66666666666667e-01 +887 688 8.33333333333333e-02 +887 1127 -7.50000000000000e-01 +887 1126 1.66666666666667e-01 +887 886 -1.66666666666667e-01 +887 769 8.33333333333333e-02 +887 1125 1.66666666666667e-01 +887 873 -8.33333333333333e-02 +887 879 4.16666666666667e-02 +887 689 -1.25000000000000e-01 +887 880 4.16666666666667e-02 +887 874 -8.33333333333333e-02 +887 1244 -1.25000000000000e-01 +887 1264 4.16666666666667e-02 +887 770 -1.25000000000000e-01 +887 1243 -4.16666666666667e-02 +887 1027 8.33333333333333e-02 +887 1242 8.33333333333333e-02 +887 1026 -1.66666666666667e-01 +888 888 1.25000000000000e+00 +888 1127 -1.66666666666667e-01 +888 1126 8.33333333333333e-02 +888 689 4.16666666666667e-02 +888 886 8.33333333333333e-02 +888 885 -3.75000000000000e-01 +888 1265 -4.16666666666667e-02 +888 773 4.16666666666667e-02 +888 1264 8.33333333333333e-02 +888 1263 -1.25000000000000e-01 +888 878 -8.33333333333333e-02 +888 877 -8.33333333333333e-02 +888 1124 8.33333333333333e-02 +888 884 -4.16666666666667e-02 +888 889 -1.66666666666667e-01 +888 1123 8.33333333333333e-02 +888 1129 -8.33333333333333e-02 +888 688 -8.33333333333333e-02 +888 883 8.33333333333333e-02 +888 882 -1.25000000000000e-01 +888 890 -1.66666666666667e-01 +888 1259 8.33333333333333e-02 +888 1130 1.66666666666667e-01 +888 1258 8.33333333333333e-02 +888 772 -8.33333333333333e-02 +888 887 8.33333333333333e-02 +888 1257 -3.75000000000000e-01 +888 1128 -2.50000000000000e-01 +889 889 1.25000000000000e+00 +889 1127 8.33333333333333e-02 +889 1125 8.33333333333333e-02 +889 886 -1.25000000000000e-01 +889 885 8.33333333333333e-02 +889 1265 8.33333333333333e-02 +889 890 -1.66666666666667e-01 +889 1264 -3.75000000000000e-01 +889 1263 8.33333333333333e-02 +889 876 -8.33333333333333e-02 +889 884 8.33333333333333e-02 +889 888 -1.66666666666667e-01 +889 1124 -1.66666666666667e-01 +889 1130 1.66666666666667e-01 +889 1122 8.33333333333333e-02 +889 1128 -8.33333333333333e-02 +889 689 4.16666666666667e-02 +889 878 -8.33333333333333e-02 +889 883 -3.75000000000000e-01 +889 687 -8.33333333333333e-02 +889 882 8.33333333333333e-02 +889 1259 -4.16666666666667e-02 +889 773 4.16666666666667e-02 +889 887 -4.16666666666667e-02 +889 1258 -1.25000000000000e-01 +889 1129 -2.50000000000000e-01 +889 1257 8.33333333333333e-02 +889 771 -8.33333333333333e-02 +890 890 1.25000000000000e+00 +890 1126 8.33333333333333e-02 +890 885 8.33333333333333e-02 +890 1125 -1.66666666666667e-01 +890 887 -1.25000000000000e-01 +890 687 4.16666666666667e-02 +890 1265 -1.25000000000000e-01 +890 1264 8.33333333333333e-02 +890 889 -1.66666666666667e-01 +890 1263 -4.16666666666667e-02 +890 771 4.16666666666667e-02 +890 876 -8.33333333333333e-02 +890 883 8.33333333333333e-02 +890 1122 8.33333333333333e-02 +890 882 -4.16666666666667e-02 +890 1123 -1.66666666666667e-01 +890 1129 1.66666666666667e-01 +890 884 -1.25000000000000e-01 +890 688 4.16666666666667e-02 +890 877 -8.33333333333333e-02 +890 886 -4.16666666666667e-02 +890 1259 -1.25000000000000e-01 +890 1130 -7.50000000000000e-01 +890 1258 -4.16666666666667e-02 +890 772 4.16666666666667e-02 +890 888 -1.66666666666667e-01 +890 1257 8.33333333333333e-02 +890 1128 1.66666666666667e-01 +891 891 1.25000000000000e+00 +891 1196 8.33333333333333e-02 +891 1195 -1.66666666666667e-01 +891 896 8.33333333333333e-02 +891 691 4.16666666666667e-02 +891 894 -3.75000000000000e-01 +891 1136 8.33333333333333e-02 +891 1135 -4.16666666666667e-02 +891 724 4.16666666666667e-02 +891 1134 -1.25000000000000e-01 +891 1148 -8.33333333333333e-02 +891 893 -1.66666666666667e-01 +891 898 -4.16666666666667e-02 +891 902 -8.33333333333333e-02 +891 1262 8.33333333333333e-02 +891 901 -8.33333333333333e-02 +891 1261 8.33333333333333e-02 +891 899 8.33333333333333e-02 +891 692 -8.33333333333333e-02 +891 897 -1.25000000000000e-01 +891 1142 8.33333333333333e-02 +891 725 -8.33333333333333e-02 +891 1141 8.33333333333333e-02 +891 892 -1.66666666666667e-01 +891 1147 1.66666666666667e-01 +891 1140 -3.75000000000000e-01 +891 895 8.33333333333333e-02 +891 1146 -2.50000000000000e-01 +892 892 1.25000000000000e+00 +892 1196 8.33333333333333e-02 +892 894 8.33333333333333e-02 +892 1194 -1.66666666666667e-01 +892 895 -1.25000000000000e-01 +892 690 4.16666666666667e-02 +892 1136 8.33333333333333e-02 +892 893 -1.66666666666667e-01 +892 1135 -1.25000000000000e-01 +892 1134 -4.16666666666667e-02 +892 723 4.16666666666667e-02 +892 897 -4.16666666666667e-02 +892 899 8.33333333333333e-02 +892 1148 1.66666666666667e-01 +892 1262 -1.66666666666667e-01 +892 900 -8.33333333333333e-02 +892 1260 8.33333333333333e-02 +892 692 4.16666666666667e-02 +892 902 -8.33333333333333e-02 +892 898 -1.25000000000000e-01 +892 1142 -4.16666666666667e-02 +892 725 4.16666666666667e-02 +892 1141 -1.25000000000000e-01 +892 896 -4.16666666666667e-02 +892 1147 -7.50000000000000e-01 +892 1140 8.33333333333333e-02 +892 891 -1.66666666666667e-01 +892 1146 1.66666666666667e-01 +893 893 1.25000000000000e+00 +893 1195 8.33333333333333e-02 +893 1194 8.33333333333333e-02 +893 896 -1.25000000000000e-01 +893 894 8.33333333333333e-02 +893 1136 -3.75000000000000e-01 +893 1135 8.33333333333333e-02 +893 892 -1.66666666666667e-01 +893 1134 8.33333333333333e-02 +893 1146 -8.33333333333333e-02 +893 891 -1.66666666666667e-01 +893 898 8.33333333333333e-02 +893 900 -8.33333333333333e-02 +893 1260 8.33333333333333e-02 +893 1147 1.66666666666667e-01 +893 1261 -1.66666666666667e-01 +893 899 -3.75000000000000e-01 +893 691 4.16666666666667e-02 +893 901 -8.33333333333333e-02 +893 897 8.33333333333333e-02 +893 690 -8.33333333333333e-02 +893 1142 -1.25000000000000e-01 +893 895 -4.16666666666667e-02 +893 1148 -2.50000000000000e-01 +893 1141 -4.16666666666667e-02 +893 724 4.16666666666667e-02 +893 1140 8.33333333333333e-02 +893 723 -8.33333333333333e-02 +894 894 5.83333333333333e-01 +894 1196 -4.16666666666667e-02 +894 895 -1.66666666666667e-01 +894 1195 8.33333333333333e-02 +894 892 8.33333333333333e-02 +894 737 4.16666666666667e-02 +894 1136 -8.33333333333333e-02 +894 736 -4.16666666666667e-02 +894 1135 4.16666666666667e-02 +894 735 -4.16666666666667e-02 +894 1194 -1.25000000000000e-01 +894 896 -8.33333333333333e-02 +894 692 4.16666666666667e-02 +894 893 8.33333333333333e-02 +894 691 -4.16666666666667e-02 +894 901 4.16666666666667e-02 +894 902 4.16666666666667e-02 +894 690 -4.16666666666667e-02 +894 891 -3.75000000000000e-01 +895 895 5.83333333333333e-01 +895 893 -4.16666666666667e-02 +895 894 -1.66666666666667e-01 +895 1194 8.33333333333333e-02 +895 891 8.33333333333333e-02 +895 737 4.16666666666667e-02 +895 896 -8.33333333333333e-02 +895 1196 8.33333333333333e-02 +895 736 -4.16666666666667e-02 +895 1195 -3.75000000000000e-01 +895 735 -4.16666666666667e-02 +895 1134 4.16666666666667e-02 +895 692 4.16666666666667e-02 +895 902 -8.33333333333333e-02 +895 1136 4.16666666666667e-02 +895 691 -4.16666666666667e-02 +895 892 -1.25000000000000e-01 +895 690 -4.16666666666667e-02 +895 900 4.16666666666667e-02 +896 896 5.00000000000000e-01 +896 1194 -4.16666666666667e-02 +896 1135 4.16666666666667e-02 +896 892 -4.16666666666667e-02 +896 737 -1.25000000000000e-01 +896 1196 -1.25000000000000e-01 +896 736 4.16666666666667e-02 +896 895 -8.33333333333333e-02 +896 1195 8.33333333333333e-02 +896 735 4.16666666666667e-02 +896 1134 -8.33333333333333e-02 +896 900 4.16666666666667e-02 +896 692 -1.25000000000000e-01 +896 893 -1.25000000000000e-01 +896 691 4.16666666666667e-02 +896 901 -8.33333333333333e-02 +896 894 -8.33333333333333e-02 +896 690 4.16666666666667e-02 +896 891 8.33333333333333e-02 +897 897 5.00000000000000e-01 +897 1141 4.16666666666667e-02 +897 902 4.16666666666667e-02 +897 1262 -4.16666666666667e-02 +897 767 4.16666666666667e-02 +897 1142 -8.33333333333333e-02 +897 766 4.16666666666667e-02 +897 898 -8.33333333333333e-02 +897 1261 8.33333333333333e-02 +897 765 -1.25000000000000e-01 +897 1260 -1.25000000000000e-01 +897 899 -8.33333333333333e-02 +897 692 4.16666666666667e-02 +897 893 8.33333333333333e-02 +897 691 4.16666666666667e-02 +897 901 -8.33333333333333e-02 +897 892 -4.16666666666667e-02 +897 690 -1.25000000000000e-01 +897 891 -1.25000000000000e-01 +898 898 5.83333333333333e-01 +898 1140 4.16666666666667e-02 +898 893 8.33333333333333e-02 +898 899 -1.66666666666667e-01 +898 1262 8.33333333333333e-02 +898 767 -4.16666666666667e-02 +898 1142 4.16666666666667e-02 +898 766 -4.16666666666667e-02 +898 1261 -3.75000000000000e-01 +898 765 4.16666666666667e-02 +898 897 -8.33333333333333e-02 +898 1260 8.33333333333333e-02 +898 692 -4.16666666666667e-02 +898 902 4.16666666666667e-02 +898 891 -4.16666666666667e-02 +898 691 -4.16666666666667e-02 +898 892 -1.25000000000000e-01 +898 690 4.16666666666667e-02 +898 900 -8.33333333333333e-02 +899 899 5.83333333333333e-01 +899 898 -1.66666666666667e-01 +899 1261 8.33333333333333e-02 +899 900 4.16666666666667e-02 +899 1260 -4.16666666666667e-02 +899 767 -4.16666666666667e-02 +899 1262 -1.25000000000000e-01 +899 766 -4.16666666666667e-02 +899 1141 4.16666666666667e-02 +899 765 4.16666666666667e-02 +899 1140 -8.33333333333333e-02 +899 892 8.33333333333333e-02 +899 692 -4.16666666666667e-02 +899 893 -3.75000000000000e-01 +899 691 -4.16666666666667e-02 +899 901 4.16666666666667e-02 +899 897 -8.33333333333333e-02 +899 690 4.16666666666667e-02 +899 891 8.33333333333333e-02 +900 900 6.66666666666667e-01 +900 895 4.16666666666667e-02 +900 1196 8.33333333333333e-02 +900 1195 -4.16666666666667e-02 +900 1194 -1.25000000000000e-01 +900 893 -8.33333333333333e-02 +900 899 4.16666666666667e-02 +900 892 -8.33333333333333e-02 +900 1147 8.33333333333333e-02 +900 898 -8.33333333333333e-02 +900 691 4.16666666666667e-02 +900 690 -8.33333333333333e-02 +900 1262 8.33333333333333e-02 +900 1148 -1.66666666666667e-01 +900 1261 8.33333333333333e-02 +900 901 -8.33333333333333e-02 +900 775 4.16666666666667e-02 +900 1260 -3.75000000000000e-01 +900 896 4.16666666666667e-02 +900 774 -8.33333333333333e-02 +901 901 7.50000000000000e-01 +901 692 4.16666666666667e-02 +901 894 4.16666666666667e-02 +901 1196 8.33333333333333e-02 +901 902 -8.33333333333333e-02 +901 776 4.16666666666667e-02 +901 1195 -1.25000000000000e-01 +901 1194 -4.16666666666667e-02 +901 891 -8.33333333333333e-02 +901 1146 8.33333333333333e-02 +901 899 4.16666666666667e-02 +901 893 -8.33333333333333e-02 +901 691 -2.50000000000000e-01 +901 897 -8.33333333333333e-02 +901 690 4.16666666666667e-02 +901 1262 -4.16666666666667e-02 +901 1148 8.33333333333333e-02 +901 1261 -1.25000000000000e-01 +901 896 -8.33333333333333e-02 +901 775 -2.50000000000000e-01 +901 1260 8.33333333333333e-02 +901 900 -8.33333333333333e-02 +901 774 4.16666666666667e-02 +902 902 6.66666666666667e-01 +902 895 -8.33333333333333e-02 +902 691 4.16666666666667e-02 +902 1196 -3.75000000000000e-01 +902 1195 8.33333333333333e-02 +902 901 -8.33333333333333e-02 +902 775 4.16666666666667e-02 +902 1194 8.33333333333333e-02 +902 891 -8.33333333333333e-02 +902 897 4.16666666666667e-02 +902 692 -8.33333333333333e-02 +902 898 4.16666666666667e-02 +902 892 -8.33333333333333e-02 +902 1262 -1.25000000000000e-01 +902 894 4.16666666666667e-02 +902 776 -8.33333333333333e-02 +902 1261 -4.16666666666667e-02 +902 1147 8.33333333333333e-02 +902 1260 8.33333333333333e-02 +902 1146 -1.66666666666667e-01 +903 903 7.50000000000000e-01 +903 905 -8.33333333333333e-02 +903 1214 8.33333333333333e-02 +903 779 4.16666666666667e-02 +903 1213 -4.16666666666667e-02 +903 1212 -1.25000000000000e-01 +903 1039 8.33333333333333e-02 +903 1250 -4.16666666666667e-02 +903 1040 8.33333333333333e-02 +903 904 -8.33333333333333e-02 +903 1249 8.33333333333333e-02 +903 778 4.16666666666667e-02 +903 1248 -1.25000000000000e-01 +903 777 -2.50000000000000e-01 +903 323 -8.33333333333333e-02 +903 322 4.16666666666667e-02 +903 316 -8.33333333333333e-02 +903 329 4.16666666666667e-02 +903 317 -8.33333333333333e-02 +903 34 4.16666666666667e-02 +903 328 -8.33333333333333e-02 +903 33 -2.50000000000000e-01 +903 35 4.16666666666667e-02 +904 904 6.66666666666667e-01 +904 1214 8.33333333333333e-02 +904 1213 -1.25000000000000e-01 +904 1212 -4.16666666666667e-02 +904 1038 8.33333333333333e-02 +904 1250 8.33333333333333e-02 +904 1040 -1.66666666666667e-01 +904 1249 -3.75000000000000e-01 +904 778 -8.33333333333333e-02 +904 903 -8.33333333333333e-02 +904 1248 8.33333333333333e-02 +904 777 4.16666666666667e-02 +904 321 4.16666666666667e-02 +904 329 4.16666666666667e-02 +904 317 -8.33333333333333e-02 +904 315 -8.33333333333333e-02 +904 34 -8.33333333333333e-02 +904 33 4.16666666666667e-02 +904 327 -8.33333333333333e-02 +904 323 4.16666666666667e-02 +905 905 6.66666666666667e-01 +905 1214 -3.75000000000000e-01 +905 1213 8.33333333333333e-02 +905 903 -8.33333333333333e-02 +905 1212 8.33333333333333e-02 +905 777 4.16666666666667e-02 +905 1250 -1.25000000000000e-01 +905 779 -8.33333333333333e-02 +905 1249 8.33333333333333e-02 +905 1039 -1.66666666666667e-01 +905 1248 -4.16666666666667e-02 +905 1038 8.33333333333333e-02 +905 33 4.16666666666667e-02 +905 321 -8.33333333333333e-02 +905 328 4.16666666666667e-02 +905 316 -8.33333333333333e-02 +905 35 -8.33333333333333e-02 +905 327 4.16666666666667e-02 +905 315 -8.33333333333333e-02 +905 322 4.16666666666667e-02 +906 906 2.50000000000000e+00 +906 913 1.66666666666667e-01 +906 912 -2.50000000000000e-01 +906 1046 -1.66666666666667e-01 +906 1045 8.33333333333333e-02 +906 1058 1.66666666666667e-01 +906 925 8.33333333333333e-02 +906 1057 1.66666666666667e-01 +906 1056 -7.50000000000000e-01 +906 926 8.33333333333333e-02 +906 1048 -8.33333333333333e-02 +906 1049 1.66666666666667e-01 +906 908 -3.33333333333333e-01 +906 710 -8.33333333333333e-02 +906 1047 -2.50000000000000e-01 +906 917 8.33333333333333e-02 +906 695 -8.33333333333333e-02 +906 916 -1.66666666666667e-01 +906 1043 8.33333333333333e-02 +906 910 1.66666666666667e-01 +906 907 -3.33333333333333e-01 +906 911 1.66666666666667e-01 +906 694 -8.33333333333333e-02 +906 909 -7.50000000000000e-01 +906 1042 8.33333333333333e-02 +906 709 -8.33333333333333e-02 +906 1055 -8.33333333333333e-02 +906 1052 8.33333333333333e-02 +906 922 8.33333333333333e-02 +906 919 -8.33333333333333e-02 +906 1051 -1.66666666666667e-01 +906 1054 1.66666666666667e-01 +906 1053 -2.50000000000000e-01 +906 920 1.66666666666667e-01 +906 923 -1.66666666666667e-01 +906 918 -2.50000000000000e-01 +906 914 -8.33333333333333e-02 +907 907 2.50000000000000e+00 +907 912 1.66666666666667e-01 +907 914 1.66666666666667e-01 +907 913 -7.50000000000000e-01 +907 1044 8.33333333333333e-02 +907 1058 -8.33333333333333e-02 +907 924 8.33333333333333e-02 +907 1057 -2.50000000000000e-01 +907 1056 1.66666666666667e-01 +907 926 -1.66666666666667e-01 +907 1047 -8.33333333333333e-02 +907 917 8.33333333333333e-02 +907 1049 1.66666666666667e-01 +907 1048 -2.50000000000000e-01 +907 915 -1.66666666666667e-01 +907 911 -8.33333333333333e-02 +907 909 1.66666666666667e-01 +907 906 -3.33333333333333e-01 +907 910 -2.50000000000000e-01 +907 693 -8.33333333333333e-02 +907 1043 -1.66666666666667e-01 +907 1041 8.33333333333333e-02 +907 708 -8.33333333333333e-02 +907 1055 1.66666666666667e-01 +907 908 -3.33333333333333e-01 +907 920 1.66666666666667e-01 +907 921 8.33333333333333e-02 +907 918 -8.33333333333333e-02 +907 1052 8.33333333333333e-02 +907 710 -8.33333333333333e-02 +907 1054 -7.50000000000000e-01 +907 1050 -1.66666666666667e-01 +907 1053 1.66666666666667e-01 +907 923 8.33333333333333e-02 +907 695 -8.33333333333333e-02 +907 919 -2.50000000000000e-01 +907 1046 8.33333333333333e-02 +908 908 2.50000000000000e+00 +908 1045 8.33333333333333e-02 +908 914 -2.50000000000000e-01 +908 913 1.66666666666667e-01 +908 1044 -1.66666666666667e-01 +908 1057 -8.33333333333333e-02 +908 1056 1.66666666666667e-01 +908 1058 -2.50000000000000e-01 +908 925 -1.66666666666667e-01 +908 924 8.33333333333333e-02 +908 916 8.33333333333333e-02 +908 1047 1.66666666666667e-01 +908 906 -3.33333333333333e-01 +908 1049 -7.50000000000000e-01 +908 1048 1.66666666666667e-01 +908 708 -8.33333333333333e-02 +908 915 8.33333333333333e-02 +908 693 -8.33333333333333e-02 +908 910 -8.33333333333333e-02 +908 1041 8.33333333333333e-02 +908 911 -2.50000000000000e-01 +908 909 1.66666666666667e-01 +908 1042 -1.66666666666667e-01 +908 1053 -8.33333333333333e-02 +908 1050 8.33333333333333e-02 +908 1054 1.66666666666667e-01 +908 907 -3.33333333333333e-01 +908 919 1.66666666666667e-01 +908 1055 -2.50000000000000e-01 +908 1051 8.33333333333333e-02 +908 709 -8.33333333333333e-02 +908 920 -7.50000000000000e-01 +908 912 -8.33333333333333e-02 +908 922 8.33333333333333e-02 +908 694 -8.33333333333333e-02 +908 918 1.66666666666667e-01 +908 921 -1.66666666666667e-01 +909 909 2.50000000000000e+00 +909 1231 -1.66666666666667e-01 +909 1166 1.66666666666667e-01 +909 1268 -1.66666666666667e-01 +909 928 -8.33333333333333e-02 +909 1267 8.33333333333333e-02 +909 929 -8.33333333333333e-02 +909 1165 1.66666666666667e-01 +909 1164 -7.50000000000000e-01 +909 1154 1.66666666666667e-01 +909 1048 8.33333333333333e-02 +909 1153 -8.33333333333333e-02 +909 1049 -1.66666666666667e-01 +909 728 8.33333333333333e-02 +909 1152 -2.50000000000000e-01 +909 917 -8.33333333333333e-02 +909 695 8.33333333333333e-02 +909 910 -3.33333333333333e-01 +909 916 1.66666666666667e-01 +909 915 -2.50000000000000e-01 +909 1160 -8.33333333333333e-02 +909 1159 1.66666666666667e-01 +909 1043 -8.33333333333333e-02 +909 1055 8.33333333333333e-02 +909 907 1.66666666666667e-01 +909 1054 -1.66666666666667e-01 +909 727 8.33333333333333e-02 +909 1042 -8.33333333333333e-02 +909 1158 -2.50000000000000e-01 +909 911 -3.33333333333333e-01 +909 923 1.66666666666667e-01 +909 908 1.66666666666667e-01 +909 922 -8.33333333333333e-02 +909 694 8.33333333333333e-02 +909 1232 8.33333333333333e-02 +909 921 -2.50000000000000e-01 +909 906 -7.50000000000000e-01 +910 910 2.50000000000000e+00 +910 1230 -1.66666666666667e-01 +910 1166 -8.33333333333333e-02 +910 929 -8.33333333333333e-02 +910 1268 8.33333333333333e-02 +910 927 -8.33333333333333e-02 +910 1266 8.33333333333333e-02 +910 1165 -2.50000000000000e-01 +910 1164 1.66666666666667e-01 +910 1047 8.33333333333333e-02 +910 1152 -8.33333333333333e-02 +910 1049 8.33333333333333e-02 +910 1154 1.66666666666667e-01 +910 1153 -2.50000000000000e-01 +910 917 1.66666666666667e-01 +910 916 -7.50000000000000e-01 +910 909 -3.33333333333333e-01 +910 915 1.66666666666667e-01 +910 908 -8.33333333333333e-02 +910 911 -3.33333333333333e-01 +910 1043 -8.33333333333333e-02 +910 1055 8.33333333333333e-02 +910 1158 1.66666666666667e-01 +910 906 1.66666666666667e-01 +910 1053 -1.66666666666667e-01 +910 728 -1.66666666666667e-01 +910 1160 1.66666666666667e-01 +910 1159 -7.50000000000000e-01 +910 726 8.33333333333333e-02 +910 1041 -8.33333333333333e-02 +910 923 1.66666666666667e-01 +910 695 -1.66666666666667e-01 +910 1232 8.33333333333333e-02 +910 922 -2.50000000000000e-01 +910 907 -2.50000000000000e-01 +910 921 -8.33333333333333e-02 +910 693 8.33333333333333e-02 +911 911 2.50000000000000e+00 +911 1231 8.33333333333333e-02 +911 1165 -8.33333333333333e-02 +911 928 -8.33333333333333e-02 +911 1267 8.33333333333333e-02 +911 1164 1.66666666666667e-01 +911 1266 -1.66666666666667e-01 +911 927 -8.33333333333333e-02 +911 1166 -2.50000000000000e-01 +911 1152 1.66666666666667e-01 +911 1048 8.33333333333333e-02 +911 1047 -1.66666666666667e-01 +911 1154 -7.50000000000000e-01 +911 1153 1.66666666666667e-01 +911 726 8.33333333333333e-02 +911 917 -2.50000000000000e-01 +911 916 1.66666666666667e-01 +911 915 -8.33333333333333e-02 +911 693 8.33333333333333e-02 +911 907 -8.33333333333333e-02 +911 910 -3.33333333333333e-01 +911 1158 -8.33333333333333e-02 +911 1042 -8.33333333333333e-02 +911 1054 8.33333333333333e-02 +911 1041 -8.33333333333333e-02 +911 1053 8.33333333333333e-02 +911 1160 -2.50000000000000e-01 +911 727 -1.66666666666667e-01 +911 1159 1.66666666666667e-01 +911 1230 8.33333333333333e-02 +911 923 -7.50000000000000e-01 +911 908 -2.50000000000000e-01 +911 922 1.66666666666667e-01 +911 694 -1.66666666666667e-01 +911 909 -3.33333333333333e-01 +911 921 1.66666666666667e-01 +911 906 1.66666666666667e-01 +912 912 1.25000000000000e+00 +912 1048 8.33333333333333e-02 +912 1049 8.33333333333333e-02 +912 1217 8.33333333333333e-02 +912 1215 -1.25000000000000e-01 +912 917 8.33333333333333e-02 +912 916 8.33333333333333e-02 +912 913 -1.66666666666667e-01 +912 915 -3.75000000000000e-01 +912 908 -8.33333333333333e-02 +912 914 -1.66666666666667e-01 +912 1046 -8.33333333333333e-02 +912 1058 8.33333333333333e-02 +912 1219 8.33333333333333e-02 +912 907 1.66666666666667e-01 +912 1057 -1.66666666666667e-01 +912 1220 8.33333333333333e-02 +912 746 -8.33333333333333e-02 +912 745 4.16666666666667e-02 +912 1045 -8.33333333333333e-02 +912 1218 -3.75000000000000e-01 +912 926 8.33333333333333e-02 +912 695 -8.33333333333333e-02 +912 925 -4.16666666666667e-02 +912 694 4.16666666666667e-02 +912 924 -1.25000000000000e-01 +912 1216 -4.16666666666667e-02 +912 906 -2.50000000000000e-01 +913 913 1.25000000000000e+00 +913 1215 -4.16666666666667e-02 +913 1047 8.33333333333333e-02 +913 1049 -1.66666666666667e-01 +913 746 4.16666666666667e-02 +913 1216 -1.25000000000000e-01 +913 917 -4.16666666666667e-02 +913 695 4.16666666666667e-02 +913 916 -1.25000000000000e-01 +913 915 8.33333333333333e-02 +913 912 -1.66666666666667e-01 +913 1220 -4.16666666666667e-02 +913 1218 8.33333333333333e-02 +913 1046 -8.33333333333333e-02 +913 1058 8.33333333333333e-02 +913 906 1.66666666666667e-01 +913 1056 -1.66666666666667e-01 +913 1219 -1.25000000000000e-01 +913 744 4.16666666666667e-02 +913 1044 -8.33333333333333e-02 +913 926 8.33333333333333e-02 +913 914 -1.66666666666667e-01 +913 908 1.66666666666667e-01 +913 925 -1.25000000000000e-01 +913 1217 8.33333333333333e-02 +913 907 -7.50000000000000e-01 +913 924 -4.16666666666667e-02 +913 693 4.16666666666667e-02 +914 914 1.25000000000000e+00 +914 1048 -1.66666666666667e-01 +914 1047 8.33333333333333e-02 +914 1217 -3.75000000000000e-01 +914 745 4.16666666666667e-02 +914 1215 8.33333333333333e-02 +914 917 -1.25000000000000e-01 +914 916 -4.16666666666667e-02 +914 694 4.16666666666667e-02 +914 915 8.33333333333333e-02 +914 906 -8.33333333333333e-02 +914 1219 -4.16666666666667e-02 +914 912 -1.66666666666667e-01 +914 1044 -8.33333333333333e-02 +914 1056 8.33333333333333e-02 +914 1045 -8.33333333333333e-02 +914 1057 8.33333333333333e-02 +914 1220 -1.25000000000000e-01 +914 1218 8.33333333333333e-02 +914 744 -8.33333333333333e-02 +914 926 -3.75000000000000e-01 +914 1216 8.33333333333333e-02 +914 908 -2.50000000000000e-01 +914 925 8.33333333333333e-02 +914 913 -1.66666666666667e-01 +914 907 1.66666666666667e-01 +914 924 8.33333333333333e-02 +914 693 -8.33333333333333e-02 +915 915 1.25000000000000e+00 +915 916 -1.66666666666667e-01 +915 929 -8.33333333333333e-02 +915 694 -4.16666666666667e-02 +915 928 4.16666666666667e-02 +915 1232 8.33333333333333e-02 +915 751 -4.16666666666667e-02 +915 1230 -3.75000000000000e-01 +915 1216 4.16666666666667e-02 +915 752 8.33333333333333e-02 +915 1217 -8.33333333333333e-02 +915 917 -1.66666666666667e-01 +915 914 8.33333333333333e-02 +915 695 8.33333333333333e-02 +915 913 8.33333333333333e-02 +915 912 -3.75000000000000e-01 +915 1048 -8.33333333333333e-02 +915 1153 8.33333333333333e-02 +915 1154 8.33333333333333e-02 +915 1049 -8.33333333333333e-02 +915 750 -1.25000000000000e-01 +915 911 -8.33333333333333e-02 +915 908 8.33333333333333e-02 +915 910 1.66666666666667e-01 +915 907 -1.66666666666667e-01 +915 909 -2.50000000000000e-01 +915 1231 8.33333333333333e-02 +915 693 -1.25000000000000e-01 +916 916 1.25000000000000e+00 +916 929 4.16666666666667e-02 +916 1230 8.33333333333333e-02 +916 915 -1.66666666666667e-01 +916 693 -4.16666666666667e-02 +916 927 4.16666666666667e-02 +916 1231 -1.25000000000000e-01 +916 750 -4.16666666666667e-02 +916 1215 4.16666666666667e-02 +916 1217 4.16666666666667e-02 +916 914 -4.16666666666667e-02 +916 913 -1.25000000000000e-01 +916 912 8.33333333333333e-02 +916 1047 -8.33333333333333e-02 +916 1152 8.33333333333333e-02 +916 1049 -8.33333333333333e-02 +916 908 8.33333333333333e-02 +916 1154 -1.66666666666667e-01 +916 752 8.33333333333333e-02 +916 751 -1.25000000000000e-01 +916 911 1.66666666666667e-01 +916 917 -1.66666666666667e-01 +916 695 8.33333333333333e-02 +916 910 -7.50000000000000e-01 +916 1232 -4.16666666666667e-02 +916 694 -1.25000000000000e-01 +916 909 1.66666666666667e-01 +916 906 -1.66666666666667e-01 +917 917 1.25000000000000e+00 +917 928 4.16666666666667e-02 +917 927 -8.33333333333333e-02 +917 1232 -1.25000000000000e-01 +917 1230 8.33333333333333e-02 +917 1216 4.16666666666667e-02 +917 750 8.33333333333333e-02 +917 1215 -8.33333333333333e-02 +917 914 -1.25000000000000e-01 +917 913 -4.16666666666667e-02 +917 915 -1.66666666666667e-01 +917 912 8.33333333333333e-02 +917 693 8.33333333333333e-02 +917 1048 -8.33333333333333e-02 +917 907 8.33333333333333e-02 +917 752 -3.75000000000000e-01 +917 1153 -1.66666666666667e-01 +917 751 8.33333333333333e-02 +917 1152 8.33333333333333e-02 +917 1047 -8.33333333333333e-02 +917 911 -2.50000000000000e-01 +917 1231 -4.16666666666667e-02 +917 695 -3.75000000000000e-01 +917 910 1.66666666666667e-01 +917 916 -1.66666666666667e-01 +917 694 8.33333333333333e-02 +917 909 -8.33333333333333e-02 +917 906 8.33333333333333e-02 +918 918 1.25000000000000e+00 +918 1058 -1.66666666666667e-01 +918 1057 8.33333333333333e-02 +918 764 4.16666666666667e-02 +918 1255 8.33333333333333e-02 +918 1254 -3.75000000000000e-01 +918 926 -4.16666666666667e-02 +918 695 4.16666666666667e-02 +918 925 8.33333333333333e-02 +918 924 -1.25000000000000e-01 +918 1052 -8.33333333333333e-02 +918 1051 -8.33333333333333e-02 +918 1055 8.33333333333333e-02 +918 1253 -4.16666666666667e-02 +918 919 -1.66666666666667e-01 +918 1054 8.33333333333333e-02 +918 907 -8.33333333333333e-02 +918 763 -8.33333333333333e-02 +918 1252 8.33333333333333e-02 +918 1251 -1.25000000000000e-01 +918 920 -1.66666666666667e-01 +918 923 8.33333333333333e-02 +918 908 1.66666666666667e-01 +918 922 8.33333333333333e-02 +918 694 -8.33333333333333e-02 +918 1256 8.33333333333333e-02 +918 921 -3.75000000000000e-01 +918 906 -2.50000000000000e-01 +919 919 1.25000000000000e+00 +919 1058 8.33333333333333e-02 +919 1056 8.33333333333333e-02 +919 1255 -1.25000000000000e-01 +919 1254 8.33333333333333e-02 +919 926 8.33333333333333e-02 +919 920 -1.66666666666667e-01 +919 925 -3.75000000000000e-01 +919 924 8.33333333333333e-02 +919 1050 -8.33333333333333e-02 +919 1253 8.33333333333333e-02 +919 918 -1.66666666666667e-01 +919 1055 -1.66666666666667e-01 +919 908 1.66666666666667e-01 +919 1053 8.33333333333333e-02 +919 906 -8.33333333333333e-02 +919 764 4.16666666666667e-02 +919 1052 -8.33333333333333e-02 +919 1252 -3.75000000000000e-01 +919 762 -8.33333333333333e-02 +919 1251 8.33333333333333e-02 +919 923 -4.16666666666667e-02 +919 695 4.16666666666667e-02 +919 1256 -4.16666666666667e-02 +919 922 -1.25000000000000e-01 +919 907 -2.50000000000000e-01 +919 921 8.33333333333333e-02 +919 693 -8.33333333333333e-02 +920 920 1.25000000000000e+00 +920 1057 8.33333333333333e-02 +920 1254 8.33333333333333e-02 +920 1056 -1.66666666666667e-01 +920 1256 -1.25000000000000e-01 +920 762 4.16666666666667e-02 +920 926 -1.25000000000000e-01 +920 925 8.33333333333333e-02 +920 919 -1.66666666666667e-01 +920 924 -4.16666666666667e-02 +920 693 4.16666666666667e-02 +920 1050 -8.33333333333333e-02 +920 1252 8.33333333333333e-02 +920 1053 8.33333333333333e-02 +920 1251 -4.16666666666667e-02 +920 1054 -1.66666666666667e-01 +920 907 1.66666666666667e-01 +920 1253 -1.25000000000000e-01 +920 763 4.16666666666667e-02 +920 1051 -8.33333333333333e-02 +920 1255 -4.16666666666667e-02 +920 923 -1.25000000000000e-01 +920 908 -7.50000000000000e-01 +920 922 -4.16666666666667e-02 +920 694 4.16666666666667e-02 +920 918 -1.66666666666667e-01 +920 921 8.33333333333333e-02 +920 906 1.66666666666667e-01 +921 921 1.25000000000000e+00 +921 1268 8.33333333333333e-02 +921 695 -4.16666666666667e-02 +921 929 4.16666666666667e-02 +921 928 -8.33333333333333e-02 +921 770 -4.16666666666667e-02 +921 1267 8.33333333333333e-02 +921 1266 -3.75000000000000e-01 +921 1160 8.33333333333333e-02 +921 1159 8.33333333333333e-02 +921 911 1.66666666666667e-01 +921 910 -8.33333333333333e-02 +921 909 -2.50000000000000e-01 +921 1055 -8.33333333333333e-02 +921 1253 4.16666666666667e-02 +921 1054 -8.33333333333333e-02 +921 907 8.33333333333333e-02 +921 1252 -8.33333333333333e-02 +921 769 8.33333333333333e-02 +921 768 -1.25000000000000e-01 +921 920 8.33333333333333e-02 +921 908 -1.66666666666667e-01 +921 919 8.33333333333333e-02 +921 922 -1.66666666666667e-01 +921 694 8.33333333333333e-02 +921 918 -3.75000000000000e-01 +921 923 -1.66666666666667e-01 +921 693 -1.25000000000000e-01 +922 922 1.25000000000000e+00 +922 1268 -4.16666666666667e-02 +922 927 -8.33333333333333e-02 +922 1267 -1.25000000000000e-01 +922 1266 8.33333333333333e-02 +922 1160 -1.66666666666667e-01 +922 770 8.33333333333333e-02 +922 1158 8.33333333333333e-02 +922 911 1.66666666666667e-01 +922 923 -1.66666666666667e-01 +922 695 8.33333333333333e-02 +922 910 -2.50000000000000e-01 +922 909 -8.33333333333333e-02 +922 1053 -8.33333333333333e-02 +922 906 8.33333333333333e-02 +922 1253 4.16666666666667e-02 +922 1055 -8.33333333333333e-02 +922 769 -3.75000000000000e-01 +922 1251 -8.33333333333333e-02 +922 768 8.33333333333333e-02 +922 920 -4.16666666666667e-02 +922 908 8.33333333333333e-02 +922 919 -1.25000000000000e-01 +922 929 4.16666666666667e-02 +922 694 -3.75000000000000e-01 +922 918 8.33333333333333e-02 +922 921 -1.66666666666667e-01 +922 693 8.33333333333333e-02 +923 923 1.25000000000000e+00 +923 1267 -4.16666666666667e-02 +923 921 -1.66666666666667e-01 +923 1266 8.33333333333333e-02 +923 693 -4.16666666666667e-02 +923 927 4.16666666666667e-02 +923 1268 -1.25000000000000e-01 +923 768 -4.16666666666667e-02 +923 1158 8.33333333333333e-02 +923 1159 -1.66666666666667e-01 +923 769 8.33333333333333e-02 +923 911 -7.50000000000000e-01 +923 910 1.66666666666667e-01 +923 922 -1.66666666666667e-01 +923 694 8.33333333333333e-02 +923 909 1.66666666666667e-01 +923 1053 -8.33333333333333e-02 +923 1251 4.16666666666667e-02 +923 770 -1.25000000000000e-01 +923 1252 4.16666666666667e-02 +923 1054 -8.33333333333333e-02 +923 920 -1.25000000000000e-01 +923 928 4.16666666666667e-02 +923 695 -1.25000000000000e-01 +923 919 -4.16666666666667e-02 +923 907 8.33333333333333e-02 +923 918 8.33333333333333e-02 +923 906 -1.66666666666667e-01 +924 924 7.50000000000000e-01 +924 1220 -8.33333333333333e-02 +924 1219 4.16666666666667e-02 +924 926 -8.33333333333333e-02 +924 914 8.33333333333333e-02 +924 695 4.16666666666667e-02 +924 913 -4.16666666666667e-02 +924 912 -1.25000000000000e-01 +924 1057 -8.33333333333333e-02 +924 907 8.33333333333333e-02 +924 1256 4.16666666666667e-02 +924 1058 -8.33333333333333e-02 +924 778 4.16666666666667e-02 +924 1255 -8.33333333333333e-02 +924 777 -2.50000000000000e-01 +924 920 -4.16666666666667e-02 +924 908 8.33333333333333e-02 +924 925 -8.33333333333333e-02 +924 919 8.33333333333333e-02 +924 694 4.16666666666667e-02 +924 779 4.16666666666667e-02 +924 918 -1.25000000000000e-01 +924 693 -2.50000000000000e-01 +925 925 6.66666666666667e-01 +925 1218 4.16666666666667e-02 +925 914 8.33333333333333e-02 +925 913 -1.25000000000000e-01 +925 912 -4.16666666666667e-02 +925 1256 4.16666666666667e-02 +925 1058 -8.33333333333333e-02 +925 1056 -8.33333333333333e-02 +925 906 8.33333333333333e-02 +925 778 -8.33333333333333e-02 +925 777 4.16666666666667e-02 +925 1254 -8.33333333333333e-02 +925 920 8.33333333333333e-02 +925 908 -1.66666666666667e-01 +925 1220 4.16666666666667e-02 +925 919 -3.75000000000000e-01 +925 694 -8.33333333333333e-02 +925 924 -8.33333333333333e-02 +925 918 8.33333333333333e-02 +925 693 4.16666666666667e-02 +926 926 6.66666666666667e-01 +926 777 4.16666666666667e-02 +926 1218 -8.33333333333333e-02 +926 914 -3.75000000000000e-01 +926 913 8.33333333333333e-02 +926 924 -8.33333333333333e-02 +926 912 8.33333333333333e-02 +926 693 4.16666666666667e-02 +926 1255 4.16666666666667e-02 +926 1057 -8.33333333333333e-02 +926 779 -8.33333333333333e-02 +926 1254 4.16666666666667e-02 +926 1056 -8.33333333333333e-02 +926 1219 4.16666666666667e-02 +926 920 -1.25000000000000e-01 +926 695 -8.33333333333333e-02 +926 919 8.33333333333333e-02 +926 907 -1.66666666666667e-01 +926 918 -4.16666666666667e-02 +926 906 8.33333333333333e-02 +927 927 7.50000000000000e-01 +927 917 -8.33333333333333e-02 +927 916 4.16666666666667e-02 +927 929 -8.33333333333333e-02 +927 1232 8.33333333333333e-02 +927 782 4.16666666666667e-02 +927 1231 -4.16666666666667e-02 +927 1230 -1.25000000000000e-01 +927 910 -8.33333333333333e-02 +927 1165 8.33333333333333e-02 +927 923 4.16666666666667e-02 +927 911 -8.33333333333333e-02 +927 694 4.16666666666667e-02 +927 922 -8.33333333333333e-02 +927 693 -2.50000000000000e-01 +927 1268 -4.16666666666667e-02 +927 1166 8.33333333333333e-02 +927 928 -8.33333333333333e-02 +927 1267 8.33333333333333e-02 +927 781 4.16666666666667e-02 +927 695 4.16666666666667e-02 +927 1266 -1.25000000000000e-01 +927 780 -2.50000000000000e-01 +928 928 6.66666666666667e-01 +928 915 4.16666666666667e-02 +928 1232 8.33333333333333e-02 +928 1231 -1.25000000000000e-01 +928 1230 -4.16666666666667e-02 +928 923 4.16666666666667e-02 +928 911 -8.33333333333333e-02 +928 909 -8.33333333333333e-02 +928 1164 8.33333333333333e-02 +928 694 -8.33333333333333e-02 +928 693 4.16666666666667e-02 +928 921 -8.33333333333333e-02 +928 1268 8.33333333333333e-02 +928 1166 -1.66666666666667e-01 +928 917 4.16666666666667e-02 +928 1267 -3.75000000000000e-01 +928 781 -8.33333333333333e-02 +928 927 -8.33333333333333e-02 +928 1266 8.33333333333333e-02 +928 780 4.16666666666667e-02 +929 929 6.66666666666667e-01 +929 693 4.16666666666667e-02 +929 915 -8.33333333333333e-02 +929 1232 -3.75000000000000e-01 +929 1231 8.33333333333333e-02 +929 927 -8.33333333333333e-02 +929 1230 8.33333333333333e-02 +929 780 4.16666666666667e-02 +929 922 4.16666666666667e-02 +929 910 -8.33333333333333e-02 +929 695 -8.33333333333333e-02 +929 921 4.16666666666667e-02 +929 909 -8.33333333333333e-02 +929 916 4.16666666666667e-02 +929 1268 -1.25000000000000e-01 +929 782 -8.33333333333333e-02 +929 1267 8.33333333333333e-02 +929 1165 -1.66666666666667e-01 +929 1266 -4.16666666666667e-02 +929 1164 8.33333333333333e-02 +930 930 2.50000000000000e+00 +930 937 1.66666666666667e-01 +930 936 -2.50000000000000e-01 +930 1172 -1.66666666666667e-01 +930 1171 8.33333333333333e-02 +930 1184 1.66666666666667e-01 +930 949 8.33333333333333e-02 +930 1183 1.66666666666667e-01 +930 1182 -7.50000000000000e-01 +930 950 8.33333333333333e-02 +930 1174 -8.33333333333333e-02 +930 1175 1.66666666666667e-01 +930 932 -3.33333333333333e-01 +930 731 -8.33333333333333e-02 +930 1173 -2.50000000000000e-01 +930 941 8.33333333333333e-02 +930 698 -8.33333333333333e-02 +930 940 -1.66666666666667e-01 +930 1169 8.33333333333333e-02 +930 934 1.66666666666667e-01 +930 931 -3.33333333333333e-01 +930 935 1.66666666666667e-01 +930 697 -8.33333333333333e-02 +930 933 -7.50000000000000e-01 +930 1168 8.33333333333333e-02 +930 730 -8.33333333333333e-02 +930 1181 -8.33333333333333e-02 +930 1178 8.33333333333333e-02 +930 946 8.33333333333333e-02 +930 943 -8.33333333333333e-02 +930 1177 -1.66666666666667e-01 +930 1180 1.66666666666667e-01 +930 1179 -2.50000000000000e-01 +930 944 1.66666666666667e-01 +930 947 -1.66666666666667e-01 +930 942 -2.50000000000000e-01 +930 938 -8.33333333333333e-02 +931 931 2.50000000000000e+00 +931 936 1.66666666666667e-01 +931 938 1.66666666666667e-01 +931 937 -7.50000000000000e-01 +931 1170 8.33333333333333e-02 +931 1184 -8.33333333333333e-02 +931 948 8.33333333333333e-02 +931 1183 -2.50000000000000e-01 +931 1182 1.66666666666667e-01 +931 950 -1.66666666666667e-01 +931 1173 -8.33333333333333e-02 +931 941 8.33333333333333e-02 +931 1175 1.66666666666667e-01 +931 1174 -2.50000000000000e-01 +931 939 -1.66666666666667e-01 +931 935 -8.33333333333333e-02 +931 933 1.66666666666667e-01 +931 930 -3.33333333333333e-01 +931 934 -2.50000000000000e-01 +931 696 -8.33333333333333e-02 +931 1169 -1.66666666666667e-01 +931 1167 8.33333333333333e-02 +931 729 -8.33333333333333e-02 +931 1181 1.66666666666667e-01 +931 932 -3.33333333333333e-01 +931 944 1.66666666666667e-01 +931 945 8.33333333333333e-02 +931 942 -8.33333333333333e-02 +931 1178 8.33333333333333e-02 +931 731 -8.33333333333333e-02 +931 1180 -7.50000000000000e-01 +931 1176 -1.66666666666667e-01 +931 1179 1.66666666666667e-01 +931 947 8.33333333333333e-02 +931 698 -8.33333333333333e-02 +931 943 -2.50000000000000e-01 +931 1172 8.33333333333333e-02 +932 932 2.50000000000000e+00 +932 1171 8.33333333333333e-02 +932 938 -2.50000000000000e-01 +932 937 1.66666666666667e-01 +932 1170 -1.66666666666667e-01 +932 1183 -8.33333333333333e-02 +932 1182 1.66666666666667e-01 +932 1184 -2.50000000000000e-01 +932 949 -1.66666666666667e-01 +932 948 8.33333333333333e-02 +932 940 8.33333333333333e-02 +932 1173 1.66666666666667e-01 +932 930 -3.33333333333333e-01 +932 1175 -7.50000000000000e-01 +932 1174 1.66666666666667e-01 +932 729 -8.33333333333333e-02 +932 939 8.33333333333333e-02 +932 696 -8.33333333333333e-02 +932 934 -8.33333333333333e-02 +932 1167 8.33333333333333e-02 +932 935 -2.50000000000000e-01 +932 933 1.66666666666667e-01 +932 1168 -1.66666666666667e-01 +932 1179 -8.33333333333333e-02 +932 1176 8.33333333333333e-02 +932 1180 1.66666666666667e-01 +932 931 -3.33333333333333e-01 +932 943 1.66666666666667e-01 +932 1181 -2.50000000000000e-01 +932 1177 8.33333333333333e-02 +932 730 -8.33333333333333e-02 +932 944 -7.50000000000000e-01 +932 936 -8.33333333333333e-02 +932 946 8.33333333333333e-02 +932 697 -8.33333333333333e-02 +932 942 1.66666666666667e-01 +932 945 -1.66666666666667e-01 +933 933 1.25000000000000e+00 +933 1174 8.33333333333333e-02 +933 1198 -4.16666666666667e-02 +933 1175 -1.66666666666667e-01 +933 740 4.16666666666667e-02 +933 1197 -1.25000000000000e-01 +933 941 -4.16666666666667e-02 +933 698 4.16666666666667e-02 +933 934 -1.66666666666667e-01 +933 940 8.33333333333333e-02 +933 939 -1.25000000000000e-01 +933 1202 -4.16666666666667e-02 +933 1201 8.33333333333333e-02 +933 1169 -8.33333333333333e-02 +933 1181 8.33333333333333e-02 +933 931 1.66666666666667e-01 +933 1180 -1.66666666666667e-01 +933 739 4.16666666666667e-02 +933 1168 -8.33333333333333e-02 +933 1200 -1.25000000000000e-01 +933 935 -1.66666666666667e-01 +933 947 8.33333333333333e-02 +933 932 1.66666666666667e-01 +933 946 -4.16666666666667e-02 +933 697 4.16666666666667e-02 +933 1199 8.33333333333333e-02 +933 945 -1.25000000000000e-01 +933 930 -7.50000000000000e-01 +934 934 1.25000000000000e+00 +934 1197 -4.16666666666667e-02 +934 1175 8.33333333333333e-02 +934 1199 8.33333333333333e-02 +934 1198 -1.25000000000000e-01 +934 941 8.33333333333333e-02 +934 940 -3.75000000000000e-01 +934 933 -1.66666666666667e-01 +934 939 8.33333333333333e-02 +934 932 -8.33333333333333e-02 +934 935 -1.66666666666667e-01 +934 1169 -8.33333333333333e-02 +934 1181 8.33333333333333e-02 +934 1200 8.33333333333333e-02 +934 930 1.66666666666667e-01 +934 1179 -1.66666666666667e-01 +934 740 -8.33333333333333e-02 +934 1202 8.33333333333333e-02 +934 1201 -3.75000000000000e-01 +934 738 4.16666666666667e-02 +934 1167 -8.33333333333333e-02 +934 947 8.33333333333333e-02 +934 698 -8.33333333333333e-02 +934 1173 8.33333333333333e-02 +934 946 -1.25000000000000e-01 +934 931 -2.50000000000000e-01 +934 945 -4.16666666666667e-02 +934 696 4.16666666666667e-02 +935 935 1.25000000000000e+00 +935 1174 8.33333333333333e-02 +935 1173 -1.66666666666667e-01 +935 1199 -3.75000000000000e-01 +935 1198 8.33333333333333e-02 +935 738 4.16666666666667e-02 +935 941 -1.25000000000000e-01 +935 940 8.33333333333333e-02 +935 939 -4.16666666666667e-02 +935 696 4.16666666666667e-02 +935 931 -8.33333333333333e-02 +935 934 -1.66666666666667e-01 +935 1200 -4.16666666666667e-02 +935 1168 -8.33333333333333e-02 +935 1180 8.33333333333333e-02 +935 1167 -8.33333333333333e-02 +935 1179 8.33333333333333e-02 +935 1202 -1.25000000000000e-01 +935 739 -8.33333333333333e-02 +935 1201 8.33333333333333e-02 +935 1197 8.33333333333333e-02 +935 947 -3.75000000000000e-01 +935 932 -2.50000000000000e-01 +935 946 8.33333333333333e-02 +935 697 -8.33333333333333e-02 +935 933 -1.66666666666667e-01 +935 945 8.33333333333333e-02 +935 930 1.66666666666667e-01 +936 936 1.25000000000000e+00 +936 1174 8.33333333333333e-02 +936 1175 8.33333333333333e-02 +936 1235 8.33333333333333e-02 +936 1233 -1.25000000000000e-01 +936 941 8.33333333333333e-02 +936 940 8.33333333333333e-02 +936 937 -1.66666666666667e-01 +936 939 -3.75000000000000e-01 +936 932 -8.33333333333333e-02 +936 938 -1.66666666666667e-01 +936 1172 -8.33333333333333e-02 +936 1184 8.33333333333333e-02 +936 1237 8.33333333333333e-02 +936 931 1.66666666666667e-01 +936 1183 -1.66666666666667e-01 +936 1238 8.33333333333333e-02 +936 755 -8.33333333333333e-02 +936 754 4.16666666666667e-02 +936 1171 -8.33333333333333e-02 +936 1236 -3.75000000000000e-01 +936 950 8.33333333333333e-02 +936 698 -8.33333333333333e-02 +936 949 -4.16666666666667e-02 +936 697 4.16666666666667e-02 +936 948 -1.25000000000000e-01 +936 1234 -4.16666666666667e-02 +936 930 -2.50000000000000e-01 +937 937 1.25000000000000e+00 +937 1233 -4.16666666666667e-02 +937 1173 8.33333333333333e-02 +937 1175 -1.66666666666667e-01 +937 755 4.16666666666667e-02 +937 1234 -1.25000000000000e-01 +937 941 -4.16666666666667e-02 +937 698 4.16666666666667e-02 +937 940 -1.25000000000000e-01 +937 939 8.33333333333333e-02 +937 936 -1.66666666666667e-01 +937 1238 -4.16666666666667e-02 +937 1236 8.33333333333333e-02 +937 1172 -8.33333333333333e-02 +937 1184 8.33333333333333e-02 +937 930 1.66666666666667e-01 +937 1182 -1.66666666666667e-01 +937 1237 -1.25000000000000e-01 +937 753 4.16666666666667e-02 +937 1170 -8.33333333333333e-02 +937 950 8.33333333333333e-02 +937 938 -1.66666666666667e-01 +937 932 1.66666666666667e-01 +937 949 -1.25000000000000e-01 +937 1235 8.33333333333333e-02 +937 931 -7.50000000000000e-01 +937 948 -4.16666666666667e-02 +937 696 4.16666666666667e-02 +938 938 1.25000000000000e+00 +938 1174 -1.66666666666667e-01 +938 1173 8.33333333333333e-02 +938 1235 -3.75000000000000e-01 +938 754 4.16666666666667e-02 +938 1233 8.33333333333333e-02 +938 941 -1.25000000000000e-01 +938 940 -4.16666666666667e-02 +938 697 4.16666666666667e-02 +938 939 8.33333333333333e-02 +938 930 -8.33333333333333e-02 +938 1237 -4.16666666666667e-02 +938 936 -1.66666666666667e-01 +938 1170 -8.33333333333333e-02 +938 1182 8.33333333333333e-02 +938 1171 -8.33333333333333e-02 +938 1183 8.33333333333333e-02 +938 1238 -1.25000000000000e-01 +938 1236 8.33333333333333e-02 +938 753 -8.33333333333333e-02 +938 950 -3.75000000000000e-01 +938 1234 8.33333333333333e-02 +938 932 -2.50000000000000e-01 +938 949 8.33333333333333e-02 +938 937 -1.66666666666667e-01 +938 931 1.66666666666667e-01 +938 948 8.33333333333333e-02 +938 696 -8.33333333333333e-02 +939 939 6.66666666666667e-01 +939 758 4.16666666666667e-02 +939 1235 -8.33333333333333e-02 +939 941 -8.33333333333333e-02 +939 938 8.33333333333333e-02 +939 698 4.16666666666667e-02 +939 937 8.33333333333333e-02 +939 936 -3.75000000000000e-01 +939 1174 -8.33333333333333e-02 +939 1198 4.16666666666667e-02 +939 1199 4.16666666666667e-02 +939 1175 -8.33333333333333e-02 +939 756 -8.33333333333333e-02 +939 935 -4.16666666666667e-02 +939 932 8.33333333333333e-02 +939 934 8.33333333333333e-02 +939 931 -1.66666666666667e-01 +939 933 -1.25000000000000e-01 +939 1234 4.16666666666667e-02 +939 696 -8.33333333333333e-02 +940 940 6.66666666666667e-01 +940 1235 4.16666666666667e-02 +940 938 -4.16666666666667e-02 +940 937 -1.25000000000000e-01 +940 936 8.33333333333333e-02 +940 1173 -8.33333333333333e-02 +940 1197 4.16666666666667e-02 +940 1175 -8.33333333333333e-02 +940 932 8.33333333333333e-02 +940 1199 -8.33333333333333e-02 +940 758 4.16666666666667e-02 +940 757 -8.33333333333333e-02 +940 935 8.33333333333333e-02 +940 941 -8.33333333333333e-02 +940 698 4.16666666666667e-02 +940 934 -3.75000000000000e-01 +940 1233 4.16666666666667e-02 +940 697 -8.33333333333333e-02 +940 933 8.33333333333333e-02 +940 930 -1.66666666666667e-01 +941 941 7.50000000000000e-01 +941 756 4.16666666666667e-02 +941 1233 -8.33333333333333e-02 +941 938 -1.25000000000000e-01 +941 937 -4.16666666666667e-02 +941 939 -8.33333333333333e-02 +941 936 8.33333333333333e-02 +941 696 4.16666666666667e-02 +941 1174 -8.33333333333333e-02 +941 931 8.33333333333333e-02 +941 758 -2.50000000000000e-01 +941 1198 -8.33333333333333e-02 +941 757 4.16666666666667e-02 +941 1197 4.16666666666667e-02 +941 1173 -8.33333333333333e-02 +941 935 -1.25000000000000e-01 +941 1234 4.16666666666667e-02 +941 698 -2.50000000000000e-01 +941 934 8.33333333333333e-02 +941 940 -8.33333333333333e-02 +941 697 4.16666666666667e-02 +941 933 -4.16666666666667e-02 +941 930 8.33333333333333e-02 +942 942 1.25000000000000e+00 +942 1184 -1.66666666666667e-01 +942 1183 8.33333333333333e-02 +942 773 4.16666666666667e-02 +942 1273 8.33333333333333e-02 +942 1272 -3.75000000000000e-01 +942 950 -4.16666666666667e-02 +942 698 4.16666666666667e-02 +942 949 8.33333333333333e-02 +942 948 -1.25000000000000e-01 +942 1178 -8.33333333333333e-02 +942 1177 -8.33333333333333e-02 +942 1181 8.33333333333333e-02 +942 1271 -4.16666666666667e-02 +942 943 -1.66666666666667e-01 +942 1180 8.33333333333333e-02 +942 931 -8.33333333333333e-02 +942 772 -8.33333333333333e-02 +942 1270 8.33333333333333e-02 +942 1269 -1.25000000000000e-01 +942 944 -1.66666666666667e-01 +942 947 8.33333333333333e-02 +942 932 1.66666666666667e-01 +942 946 8.33333333333333e-02 +942 697 -8.33333333333333e-02 +942 1274 8.33333333333333e-02 +942 945 -3.75000000000000e-01 +942 930 -2.50000000000000e-01 +943 943 1.25000000000000e+00 +943 1184 8.33333333333333e-02 +943 1182 8.33333333333333e-02 +943 1273 -1.25000000000000e-01 +943 1272 8.33333333333333e-02 +943 950 8.33333333333333e-02 +943 944 -1.66666666666667e-01 +943 949 -3.75000000000000e-01 +943 948 8.33333333333333e-02 +943 1176 -8.33333333333333e-02 +943 1271 8.33333333333333e-02 +943 942 -1.66666666666667e-01 +943 1181 -1.66666666666667e-01 +943 932 1.66666666666667e-01 +943 1179 8.33333333333333e-02 +943 930 -8.33333333333333e-02 +943 773 4.16666666666667e-02 +943 1178 -8.33333333333333e-02 +943 1270 -3.75000000000000e-01 +943 771 -8.33333333333333e-02 +943 1269 8.33333333333333e-02 +943 947 -4.16666666666667e-02 +943 698 4.16666666666667e-02 +943 1274 -4.16666666666667e-02 +943 946 -1.25000000000000e-01 +943 931 -2.50000000000000e-01 +943 945 8.33333333333333e-02 +943 696 -8.33333333333333e-02 +944 944 1.25000000000000e+00 +944 1183 8.33333333333333e-02 +944 1272 8.33333333333333e-02 +944 1182 -1.66666666666667e-01 +944 1274 -1.25000000000000e-01 +944 771 4.16666666666667e-02 +944 950 -1.25000000000000e-01 +944 949 8.33333333333333e-02 +944 943 -1.66666666666667e-01 +944 948 -4.16666666666667e-02 +944 696 4.16666666666667e-02 +944 1176 -8.33333333333333e-02 +944 1270 8.33333333333333e-02 +944 1179 8.33333333333333e-02 +944 1269 -4.16666666666667e-02 +944 1180 -1.66666666666667e-01 +944 931 1.66666666666667e-01 +944 1271 -1.25000000000000e-01 +944 772 4.16666666666667e-02 +944 1177 -8.33333333333333e-02 +944 1273 -4.16666666666667e-02 +944 947 -1.25000000000000e-01 +944 932 -7.50000000000000e-01 +944 946 -4.16666666666667e-02 +944 697 4.16666666666667e-02 +944 942 -1.66666666666667e-01 +944 945 8.33333333333333e-02 +944 930 1.66666666666667e-01 +945 945 6.66666666666667e-01 +945 1201 4.16666666666667e-02 +945 935 8.33333333333333e-02 +945 934 -4.16666666666667e-02 +945 933 -1.25000000000000e-01 +945 1181 -8.33333333333333e-02 +945 1271 4.16666666666667e-02 +945 1180 -8.33333333333333e-02 +945 931 8.33333333333333e-02 +945 1270 -8.33333333333333e-02 +945 775 4.16666666666667e-02 +945 774 -8.33333333333333e-02 +945 944 8.33333333333333e-02 +945 932 -1.66666666666667e-01 +945 943 8.33333333333333e-02 +945 946 -8.33333333333333e-02 +945 697 4.16666666666667e-02 +945 942 -3.75000000000000e-01 +945 1202 4.16666666666667e-02 +945 696 -8.33333333333333e-02 +946 946 7.50000000000000e-01 +946 776 4.16666666666667e-02 +946 1200 4.16666666666667e-02 +946 935 8.33333333333333e-02 +946 947 -8.33333333333333e-02 +946 698 4.16666666666667e-02 +946 934 -1.25000000000000e-01 +946 933 -4.16666666666667e-02 +946 1179 -8.33333333333333e-02 +946 930 8.33333333333333e-02 +946 1271 4.16666666666667e-02 +946 1181 -8.33333333333333e-02 +946 775 -2.50000000000000e-01 +946 1269 -8.33333333333333e-02 +946 774 4.16666666666667e-02 +946 944 -4.16666666666667e-02 +946 932 8.33333333333333e-02 +946 943 -1.25000000000000e-01 +946 1202 -8.33333333333333e-02 +946 697 -2.50000000000000e-01 +946 942 8.33333333333333e-02 +946 945 -8.33333333333333e-02 +946 696 4.16666666666667e-02 +947 947 6.66666666666667e-01 +947 1201 -8.33333333333333e-02 +947 775 4.16666666666667e-02 +947 935 -3.75000000000000e-01 +947 934 8.33333333333333e-02 +947 946 -8.33333333333333e-02 +947 697 4.16666666666667e-02 +947 933 8.33333333333333e-02 +947 1179 -8.33333333333333e-02 +947 1269 4.16666666666667e-02 +947 776 -8.33333333333333e-02 +947 1270 4.16666666666667e-02 +947 1180 -8.33333333333333e-02 +947 944 -1.25000000000000e-01 +947 1200 4.16666666666667e-02 +947 698 -8.33333333333333e-02 +947 943 -4.16666666666667e-02 +947 931 8.33333333333333e-02 +947 942 8.33333333333333e-02 +947 930 -1.66666666666667e-01 +948 948 7.50000000000000e-01 +948 1238 -8.33333333333333e-02 +948 1237 4.16666666666667e-02 +948 950 -8.33333333333333e-02 +948 938 8.33333333333333e-02 +948 698 4.16666666666667e-02 +948 937 -4.16666666666667e-02 +948 936 -1.25000000000000e-01 +948 1183 -8.33333333333333e-02 +948 931 8.33333333333333e-02 +948 1274 4.16666666666667e-02 +948 1184 -8.33333333333333e-02 +948 781 4.16666666666667e-02 +948 1273 -8.33333333333333e-02 +948 780 -2.50000000000000e-01 +948 944 -4.16666666666667e-02 +948 932 8.33333333333333e-02 +948 949 -8.33333333333333e-02 +948 943 8.33333333333333e-02 +948 697 4.16666666666667e-02 +948 782 4.16666666666667e-02 +948 942 -1.25000000000000e-01 +948 696 -2.50000000000000e-01 +949 949 6.66666666666667e-01 +949 1236 4.16666666666667e-02 +949 938 8.33333333333333e-02 +949 937 -1.25000000000000e-01 +949 936 -4.16666666666667e-02 +949 1274 4.16666666666667e-02 +949 1184 -8.33333333333333e-02 +949 1182 -8.33333333333333e-02 +949 930 8.33333333333333e-02 +949 781 -8.33333333333333e-02 +949 780 4.16666666666667e-02 +949 1272 -8.33333333333333e-02 +949 944 8.33333333333333e-02 +949 932 -1.66666666666667e-01 +949 1238 4.16666666666667e-02 +949 943 -3.75000000000000e-01 +949 697 -8.33333333333333e-02 +949 948 -8.33333333333333e-02 +949 942 8.33333333333333e-02 +949 696 4.16666666666667e-02 +950 950 6.66666666666667e-01 +950 780 4.16666666666667e-02 +950 1236 -8.33333333333333e-02 +950 938 -3.75000000000000e-01 +950 937 8.33333333333333e-02 +950 948 -8.33333333333333e-02 +950 936 8.33333333333333e-02 +950 696 4.16666666666667e-02 +950 1273 4.16666666666667e-02 +950 1183 -8.33333333333333e-02 +950 782 -8.33333333333333e-02 +950 1272 4.16666666666667e-02 +950 1182 -8.33333333333333e-02 +950 1237 4.16666666666667e-02 +950 944 -1.25000000000000e-01 +950 698 -8.33333333333333e-02 +950 943 8.33333333333333e-02 +950 931 -1.66666666666667e-01 +950 942 -4.16666666666667e-02 +950 930 8.33333333333333e-02 +951 951 1.25000000000000e+00 +951 989 -8.33333333333333e-02 +951 967 8.33333333333333e-02 +951 988 -8.33333333333333e-02 +951 985 -8.33333333333333e-02 +951 962 8.33333333333333e-02 +951 968 -1.66666666666667e-01 +951 961 8.33333333333333e-02 +951 960 -3.75000000000000e-01 +951 788 8.33333333333333e-02 +951 953 -1.66666666666667e-01 +951 959 1.66666666666667e-01 +951 982 8.33333333333333e-02 +951 958 -8.33333333333333e-02 +951 701 -4.16666666666667e-02 +951 785 4.16666666666667e-02 +951 700 8.33333333333333e-02 +951 784 -8.33333333333333e-02 +951 699 -1.25000000000000e-01 +951 957 -2.50000000000000e-01 +951 704 -4.16666666666667e-02 +951 983 8.33333333333333e-02 +951 952 -1.66666666666667e-01 +951 703 8.33333333333333e-02 +951 787 8.33333333333333e-02 +951 986 4.16666666666667e-02 +951 702 -1.25000000000000e-01 +951 786 -3.75000000000000e-01 +952 952 1.25000000000000e+00 +952 987 -8.33333333333333e-02 +952 986 4.16666666666667e-02 +952 989 -8.33333333333333e-02 +952 984 -8.33333333333333e-02 +952 962 -4.16666666666667e-02 +952 968 8.33333333333333e-02 +952 961 -1.25000000000000e-01 +952 960 8.33333333333333e-02 +952 788 -4.16666666666667e-02 +952 785 4.16666666666667e-02 +952 981 8.33333333333333e-02 +952 957 -8.33333333333333e-02 +952 701 8.33333333333333e-02 +952 953 -1.66666666666667e-01 +952 959 1.66666666666667e-01 +952 700 -3.75000000000000e-01 +952 958 -2.50000000000000e-01 +952 699 8.33333333333333e-02 +952 783 -8.33333333333333e-02 +952 704 8.33333333333333e-02 +952 983 -1.66666666666667e-01 +952 966 8.33333333333333e-02 +952 703 -3.75000000000000e-01 +952 787 -1.25000000000000e-01 +952 951 -1.66666666666667e-01 +952 702 8.33333333333333e-02 +952 786 8.33333333333333e-02 +953 953 1.25000000000000e+00 +953 987 -8.33333333333333e-02 +953 985 4.16666666666667e-02 +953 988 -8.33333333333333e-02 +953 962 -1.25000000000000e-01 +953 961 -4.16666666666667e-02 +953 967 8.33333333333333e-02 +953 960 8.33333333333333e-02 +953 966 -1.66666666666667e-01 +953 787 -4.16666666666667e-02 +953 784 4.16666666666667e-02 +953 786 8.33333333333333e-02 +953 951 -1.66666666666667e-01 +953 957 1.66666666666667e-01 +953 701 -1.25000000000000e-01 +953 959 -7.50000000000000e-01 +953 700 8.33333333333333e-02 +953 952 -1.66666666666667e-01 +953 958 1.66666666666667e-01 +953 699 -4.16666666666667e-02 +953 783 4.16666666666667e-02 +953 984 4.16666666666667e-02 +953 704 -1.25000000000000e-01 +953 788 -1.25000000000000e-01 +953 703 8.33333333333333e-02 +953 982 -1.66666666666667e-01 +953 702 -4.16666666666667e-02 +953 981 8.33333333333333e-02 +954 954 1.25000000000000e+00 +954 965 8.33333333333333e-02 +954 964 8.33333333333333e-02 +954 963 -3.75000000000000e-01 +954 1016 -8.33333333333333e-02 +954 1018 -8.33333333333333e-02 +954 968 8.33333333333333e-02 +954 967 -1.66666666666667e-01 +954 1019 -8.33333333333333e-02 +954 1013 8.33333333333333e-02 +954 959 -8.33333333333333e-02 +954 955 -1.66666666666667e-01 +954 958 1.66666666666667e-01 +954 790 8.33333333333333e-02 +954 701 8.33333333333333e-02 +954 785 -8.33333333333333e-02 +954 700 -4.16666666666667e-02 +954 784 4.16666666666667e-02 +954 699 -1.25000000000000e-01 +954 957 -2.50000000000000e-01 +954 956 -1.66666666666667e-01 +954 707 8.33333333333333e-02 +954 791 8.33333333333333e-02 +954 706 -4.16666666666667e-02 +954 1012 8.33333333333333e-02 +954 1015 4.16666666666667e-02 +954 705 -1.25000000000000e-01 +954 789 -3.75000000000000e-01 +955 955 1.25000000000000e+00 +955 965 -4.16666666666667e-02 +955 964 -1.25000000000000e-01 +955 963 8.33333333333333e-02 +955 1016 4.16666666666667e-02 +955 968 8.33333333333333e-02 +955 1019 -8.33333333333333e-02 +955 1017 -8.33333333333333e-02 +955 966 -1.66666666666667e-01 +955 785 4.16666666666667e-02 +955 791 -4.16666666666667e-02 +955 954 -1.66666666666667e-01 +955 957 1.66666666666667e-01 +955 789 8.33333333333333e-02 +955 701 8.33333333333333e-02 +955 956 -1.66666666666667e-01 +955 959 1.66666666666667e-01 +955 700 -1.25000000000000e-01 +955 958 -7.50000000000000e-01 +955 699 -4.16666666666667e-02 +955 783 4.16666666666667e-02 +955 707 8.33333333333333e-02 +955 1013 -1.66666666666667e-01 +955 1014 4.16666666666667e-02 +955 706 -1.25000000000000e-01 +955 790 -1.25000000000000e-01 +955 705 -4.16666666666667e-02 +955 1011 8.33333333333333e-02 +956 956 1.25000000000000e+00 +956 964 -4.16666666666667e-02 +956 963 8.33333333333333e-02 +956 1015 4.16666666666667e-02 +956 1014 -8.33333333333333e-02 +956 967 8.33333333333333e-02 +956 1018 -8.33333333333333e-02 +956 966 8.33333333333333e-02 +956 1017 -8.33333333333333e-02 +956 1011 8.33333333333333e-02 +956 957 -8.33333333333333e-02 +956 784 4.16666666666667e-02 +956 790 -4.16666666666667e-02 +956 701 -3.75000000000000e-01 +956 959 -2.50000000000000e-01 +956 700 8.33333333333333e-02 +956 955 -1.66666666666667e-01 +956 958 1.66666666666667e-01 +956 699 8.33333333333333e-02 +956 783 -8.33333333333333e-02 +956 965 -1.25000000000000e-01 +956 707 -3.75000000000000e-01 +956 791 -1.25000000000000e-01 +956 706 8.33333333333333e-02 +956 1012 -1.66666666666667e-01 +956 954 -1.66666666666667e-01 +956 705 8.33333333333333e-02 +956 789 8.33333333333333e-02 +957 957 2.50000000000000e+00 +957 988 -1.66666666666667e-01 +957 953 1.66666666666667e-01 +957 787 8.33333333333333e-02 +957 952 -8.33333333333333e-02 +957 788 -1.66666666666667e-01 +957 951 -2.50000000000000e-01 +957 983 -8.33333333333333e-02 +957 982 1.66666666666667e-01 +957 981 -2.50000000000000e-01 +957 1042 -8.33333333333333e-02 +957 968 1.66666666666667e-01 +957 1019 -1.66666666666667e-01 +957 1018 8.33333333333333e-02 +957 701 8.33333333333333e-02 +957 967 1.66666666666667e-01 +957 958 -3.33333333333333e-01 +957 966 -7.50000000000000e-01 +957 1043 -8.33333333333333e-02 +957 710 8.33333333333333e-02 +957 956 -8.33333333333333e-02 +957 955 1.66666666666667e-01 +957 785 -8.33333333333333e-02 +957 791 8.33333333333333e-02 +957 793 1.66666666666667e-01 +957 790 -1.66666666666667e-01 +957 700 8.33333333333333e-02 +957 784 -8.33333333333333e-02 +957 954 -2.50000000000000e-01 +957 959 -3.33333333333333e-01 +957 1013 1.66666666666667e-01 +957 794 1.66666666666667e-01 +957 1012 -8.33333333333333e-02 +957 709 8.33333333333333e-02 +957 989 8.33333333333333e-02 +957 1011 -2.50000000000000e-01 +957 792 -7.50000000000000e-01 +958 958 2.50000000000000e+00 +958 987 -1.66666666666667e-01 +958 786 8.33333333333333e-02 +958 951 -8.33333333333333e-02 +958 788 8.33333333333333e-02 +958 953 1.66666666666667e-01 +958 952 -2.50000000000000e-01 +958 983 1.66666666666667e-01 +958 982 -7.50000000000000e-01 +958 981 1.66666666666667e-01 +958 1043 -8.33333333333333e-02 +958 1041 -8.33333333333333e-02 +958 968 -8.33333333333333e-02 +958 1019 8.33333333333333e-02 +958 1017 8.33333333333333e-02 +958 967 -2.50000000000000e-01 +958 966 1.66666666666667e-01 +958 957 -3.33333333333333e-01 +958 794 -8.33333333333333e-02 +958 959 -3.33333333333333e-01 +958 785 -8.33333333333333e-02 +958 791 8.33333333333333e-02 +958 954 1.66666666666667e-01 +958 792 1.66666666666667e-01 +958 789 -1.66666666666667e-01 +958 701 -1.66666666666667e-01 +958 956 1.66666666666667e-01 +958 955 -7.50000000000000e-01 +958 699 8.33333333333333e-02 +958 783 -8.33333333333333e-02 +958 1013 1.66666666666667e-01 +958 710 -1.66666666666667e-01 +958 989 8.33333333333333e-02 +958 1012 -2.50000000000000e-01 +958 793 -2.50000000000000e-01 +958 1011 -8.33333333333333e-02 +958 708 8.33333333333333e-02 +959 959 2.50000000000000e+00 +959 987 8.33333333333333e-02 +959 951 1.66666666666667e-01 +959 787 8.33333333333333e-02 +959 786 -1.66666666666667e-01 +959 953 -7.50000000000000e-01 +959 952 1.66666666666667e-01 +959 983 -2.50000000000000e-01 +959 982 1.66666666666667e-01 +959 981 -8.33333333333333e-02 +959 1042 -8.33333333333333e-02 +959 967 -8.33333333333333e-02 +959 1018 8.33333333333333e-02 +959 966 1.66666666666667e-01 +959 1017 -1.66666666666667e-01 +959 968 -2.50000000000000e-01 +959 699 8.33333333333333e-02 +959 1041 -8.33333333333333e-02 +959 708 8.33333333333333e-02 +959 793 -8.33333333333333e-02 +959 958 -3.33333333333333e-01 +959 954 -8.33333333333333e-02 +959 784 -8.33333333333333e-02 +959 790 8.33333333333333e-02 +959 783 -8.33333333333333e-02 +959 789 8.33333333333333e-02 +959 956 -2.50000000000000e-01 +959 700 -1.66666666666667e-01 +959 955 1.66666666666667e-01 +959 988 8.33333333333333e-02 +959 1013 -7.50000000000000e-01 +959 794 -2.50000000000000e-01 +959 1012 1.66666666666667e-01 +959 709 -1.66666666666667e-01 +959 957 -3.33333333333333e-01 +959 1011 1.66666666666667e-01 +959 792 1.66666666666667e-01 +960 960 1.25000000000000e+00 +960 988 8.33333333333333e-02 +960 989 8.33333333333333e-02 +960 953 8.33333333333333e-02 +960 962 -1.66666666666667e-01 +960 952 8.33333333333333e-02 +960 951 -3.75000000000000e-01 +960 985 8.33333333333333e-02 +960 984 -1.25000000000000e-01 +960 967 -8.33333333333333e-02 +960 961 -1.66666666666667e-01 +960 803 8.33333333333333e-02 +960 1081 -8.33333333333333e-02 +960 814 8.33333333333333e-02 +960 968 1.66666666666667e-01 +960 815 -1.66666666666667e-01 +960 716 4.16666666666667e-02 +960 1082 -8.33333333333333e-02 +960 802 8.33333333333333e-02 +960 715 -8.33333333333333e-02 +960 801 -3.75000000000000e-01 +960 797 -4.16666666666667e-02 +960 701 4.16666666666667e-02 +960 796 8.33333333333333e-02 +960 700 -8.33333333333333e-02 +960 795 -1.25000000000000e-01 +960 986 -4.16666666666667e-02 +960 966 -2.50000000000000e-01 +961 961 1.25000000000000e+00 +961 987 8.33333333333333e-02 +961 989 -1.66666666666667e-01 +961 953 -4.16666666666667e-02 +961 701 4.16666666666667e-02 +961 952 -1.25000000000000e-01 +961 951 8.33333333333333e-02 +961 716 4.16666666666667e-02 +961 985 -3.75000000000000e-01 +961 984 8.33333333333333e-02 +961 966 -8.33333333333333e-02 +961 803 -4.16666666666667e-02 +961 960 -1.66666666666667e-01 +961 1080 -8.33333333333333e-02 +961 813 8.33333333333333e-02 +961 1082 -8.33333333333333e-02 +961 815 8.33333333333333e-02 +961 802 -1.25000000000000e-01 +961 801 8.33333333333333e-02 +961 714 -8.33333333333333e-02 +961 797 8.33333333333333e-02 +961 962 -1.66666666666667e-01 +961 968 1.66666666666667e-01 +961 796 -3.75000000000000e-01 +961 986 8.33333333333333e-02 +961 967 -2.50000000000000e-01 +961 795 8.33333333333333e-02 +961 699 -8.33333333333333e-02 +962 962 1.25000000000000e+00 +962 984 -4.16666666666667e-02 +962 988 -1.66666666666667e-01 +962 987 8.33333333333333e-02 +962 953 -1.25000000000000e-01 +962 952 -4.16666666666667e-02 +962 700 4.16666666666667e-02 +962 951 8.33333333333333e-02 +962 960 -1.66666666666667e-01 +962 986 -1.25000000000000e-01 +962 715 4.16666666666667e-02 +962 802 -4.16666666666667e-02 +962 801 8.33333333333333e-02 +962 1081 -8.33333333333333e-02 +962 814 8.33333333333333e-02 +962 966 1.66666666666667e-01 +962 813 -1.66666666666667e-01 +962 803 -1.25000000000000e-01 +962 714 4.16666666666667e-02 +962 1080 -8.33333333333333e-02 +962 797 -1.25000000000000e-01 +962 985 8.33333333333333e-02 +962 968 -7.50000000000000e-01 +962 796 8.33333333333333e-02 +962 961 -1.66666666666667e-01 +962 967 1.66666666666667e-01 +962 795 -4.16666666666667e-02 +962 699 4.16666666666667e-02 +963 963 1.25000000000000e+00 +963 1015 -4.16666666666667e-02 +963 1018 8.33333333333333e-02 +963 1016 8.33333333333333e-02 +963 1014 -1.25000000000000e-01 +963 956 8.33333333333333e-02 +963 964 -1.66666666666667e-01 +963 955 8.33333333333333e-02 +963 954 -3.75000000000000e-01 +963 1118 -8.33333333333333e-02 +963 965 -1.66666666666667e-01 +963 808 8.33333333333333e-02 +963 815 8.33333333333333e-02 +963 968 -8.33333333333333e-02 +963 814 -1.66666666666667e-01 +963 967 1.66666666666667e-01 +963 809 8.33333333333333e-02 +963 722 -8.33333333333333e-02 +963 721 4.16666666666667e-02 +963 1117 -8.33333333333333e-02 +963 807 -3.75000000000000e-01 +963 797 8.33333333333333e-02 +963 701 -8.33333333333333e-02 +963 796 -4.16666666666667e-02 +963 700 4.16666666666667e-02 +963 795 -1.25000000000000e-01 +963 1019 8.33333333333333e-02 +963 966 -2.50000000000000e-01 +964 964 1.25000000000000e+00 +964 1019 -1.66666666666667e-01 +964 1014 -4.16666666666667e-02 +964 1017 8.33333333333333e-02 +964 722 4.16666666666667e-02 +964 1015 -1.25000000000000e-01 +964 701 4.16666666666667e-02 +964 956 -4.16666666666667e-02 +964 955 -1.25000000000000e-01 +964 963 -1.66666666666667e-01 +964 954 8.33333333333333e-02 +964 1118 -8.33333333333333e-02 +964 809 -4.16666666666667e-02 +964 815 8.33333333333333e-02 +964 807 8.33333333333333e-02 +964 813 -1.66666666666667e-01 +964 966 1.66666666666667e-01 +964 808 -1.25000000000000e-01 +964 720 4.16666666666667e-02 +964 1116 -8.33333333333333e-02 +964 797 8.33333333333333e-02 +964 965 -1.66666666666667e-01 +964 968 1.66666666666667e-01 +964 796 -1.25000000000000e-01 +964 1016 8.33333333333333e-02 +964 967 -7.50000000000000e-01 +964 795 -4.16666666666667e-02 +964 699 4.16666666666667e-02 +965 965 1.25000000000000e+00 +965 1015 8.33333333333333e-02 +965 1018 -1.66666666666667e-01 +965 1016 -3.75000000000000e-01 +965 721 4.16666666666667e-02 +965 1014 8.33333333333333e-02 +965 956 -1.25000000000000e-01 +965 700 4.16666666666667e-02 +965 955 -4.16666666666667e-02 +965 954 8.33333333333333e-02 +965 1117 -8.33333333333333e-02 +965 1116 -8.33333333333333e-02 +965 808 -4.16666666666667e-02 +965 814 8.33333333333333e-02 +965 963 -1.66666666666667e-01 +965 813 8.33333333333333e-02 +965 966 -8.33333333333333e-02 +965 809 -1.25000000000000e-01 +965 807 8.33333333333333e-02 +965 720 -8.33333333333333e-02 +965 797 -3.75000000000000e-01 +965 1017 8.33333333333333e-02 +965 968 -2.50000000000000e-01 +965 796 8.33333333333333e-02 +965 964 -1.66666666666667e-01 +965 967 1.66666666666667e-01 +965 795 8.33333333333333e-02 +965 699 -8.33333333333333e-02 +966 966 2.50000000000000e+00 +966 989 -8.33333333333333e-02 +966 953 -1.66666666666667e-01 +966 988 1.66666666666667e-01 +966 987 -2.50000000000000e-01 +966 961 -8.33333333333333e-02 +966 962 1.66666666666667e-01 +966 960 -2.50000000000000e-01 +966 1082 8.33333333333333e-02 +966 1081 -1.66666666666667e-01 +966 1042 8.33333333333333e-02 +966 1018 -8.33333333333333e-02 +966 968 -3.33333333333333e-01 +966 959 1.66666666666667e-01 +966 1019 1.66666666666667e-01 +966 701 -8.33333333333333e-02 +966 956 8.33333333333333e-02 +966 958 1.66666666666667e-01 +966 955 -1.66666666666667e-01 +966 957 -7.50000000000000e-01 +966 728 -8.33333333333333e-02 +966 1043 8.33333333333333e-02 +966 1017 -2.50000000000000e-01 +966 797 8.33333333333333e-02 +966 965 -8.33333333333333e-02 +966 814 1.66666666666667e-01 +966 967 -3.33333333333333e-01 +966 964 1.66666666666667e-01 +966 815 1.66666666666667e-01 +966 1118 -1.66666666666667e-01 +966 1117 8.33333333333333e-02 +966 727 -8.33333333333333e-02 +966 813 -7.50000000000000e-01 +966 796 8.33333333333333e-02 +966 700 -8.33333333333333e-02 +966 963 -2.50000000000000e-01 +966 952 8.33333333333333e-02 +967 967 2.50000000000000e+00 +967 989 1.66666666666667e-01 +967 953 8.33333333333333e-02 +967 988 -7.50000000000000e-01 +967 987 1.66666666666667e-01 +967 960 -8.33333333333333e-02 +967 1082 8.33333333333333e-02 +967 962 1.66666666666667e-01 +967 961 -2.50000000000000e-01 +967 1080 -1.66666666666667e-01 +967 968 -3.33333333333333e-01 +967 728 -8.33333333333333e-02 +967 701 -8.33333333333333e-02 +967 1041 8.33333333333333e-02 +967 1017 -8.33333333333333e-02 +967 959 -8.33333333333333e-02 +967 956 8.33333333333333e-02 +967 958 -2.50000000000000e-01 +967 957 1.66666666666667e-01 +967 954 -1.66666666666667e-01 +967 1043 -1.66666666666667e-01 +967 1019 1.66666666666667e-01 +967 1018 -2.50000000000000e-01 +967 815 -8.33333333333333e-02 +967 1118 8.33333333333333e-02 +967 813 1.66666666666667e-01 +967 966 -3.33333333333333e-01 +967 963 1.66666666666667e-01 +967 814 -2.50000000000000e-01 +967 1116 8.33333333333333e-02 +967 726 -8.33333333333333e-02 +967 797 -1.66666666666667e-01 +967 965 1.66666666666667e-01 +967 964 -7.50000000000000e-01 +967 951 8.33333333333333e-02 +967 795 8.33333333333333e-02 +967 699 -8.33333333333333e-02 +968 968 2.50000000000000e+00 +968 987 -8.33333333333333e-02 +968 952 8.33333333333333e-02 +968 951 -1.66666666666667e-01 +968 989 -2.50000000000000e-01 +968 1081 8.33333333333333e-02 +968 960 1.66666666666667e-01 +968 962 -7.50000000000000e-01 +968 961 1.66666666666667e-01 +968 1080 8.33333333333333e-02 +968 967 -3.33333333333333e-01 +968 727 -8.33333333333333e-02 +968 700 -8.33333333333333e-02 +968 958 -8.33333333333333e-02 +968 955 8.33333333333333e-02 +968 966 -3.33333333333333e-01 +968 957 1.66666666666667e-01 +968 1017 1.66666666666667e-01 +968 959 -2.50000000000000e-01 +968 699 -8.33333333333333e-02 +968 954 8.33333333333333e-02 +968 1019 -7.50000000000000e-01 +968 1042 -1.66666666666667e-01 +968 1018 1.66666666666667e-01 +968 726 -8.33333333333333e-02 +968 1041 8.33333333333333e-02 +968 814 -8.33333333333333e-02 +968 1117 8.33333333333333e-02 +968 795 8.33333333333333e-02 +968 963 -8.33333333333333e-02 +968 815 -2.50000000000000e-01 +968 813 1.66666666666667e-01 +968 1116 -1.66666666666667e-01 +968 965 -2.50000000000000e-01 +968 988 1.66666666666667e-01 +968 796 -1.66666666666667e-01 +968 964 1.66666666666667e-01 +969 969 1.25000000000000e+00 +969 994 -8.33333333333333e-02 +969 977 -4.16666666666667e-02 +969 980 8.33333333333333e-02 +969 976 8.33333333333333e-02 +969 975 -1.25000000000000e-01 +969 992 4.16666666666667e-02 +969 995 -8.33333333333333e-02 +969 991 -8.33333333333333e-02 +969 788 -4.16666666666667e-02 +969 982 8.33333333333333e-02 +969 973 -8.33333333333333e-02 +969 704 8.33333333333333e-02 +969 983 -1.66666666666667e-01 +969 703 8.33333333333333e-02 +969 970 -1.66666666666667e-01 +969 787 8.33333333333333e-02 +969 702 -3.75000000000000e-01 +969 786 -1.25000000000000e-01 +969 971 -1.66666666666667e-01 +969 974 1.66666666666667e-01 +969 979 8.33333333333333e-02 +969 972 -2.50000000000000e-01 +969 185 4.16666666666667e-02 +969 80 8.33333333333333e-02 +969 79 8.33333333333333e-02 +969 184 -8.33333333333333e-02 +969 78 -3.75000000000000e-01 +970 970 1.25000000000000e+00 +970 995 -8.33333333333333e-02 +970 978 8.33333333333333e-02 +970 993 -8.33333333333333e-02 +970 977 8.33333333333333e-02 +970 980 -1.66666666666667e-01 +970 976 -3.75000000000000e-01 +970 975 8.33333333333333e-02 +970 990 -8.33333333333333e-02 +970 971 -1.66666666666667e-01 +970 788 8.33333333333333e-02 +970 974 1.66666666666667e-01 +970 981 8.33333333333333e-02 +970 972 -8.33333333333333e-02 +970 704 -4.16666666666667e-02 +970 983 8.33333333333333e-02 +970 703 -1.25000000000000e-01 +970 787 -3.75000000000000e-01 +970 702 8.33333333333333e-02 +970 969 -1.66666666666667e-01 +970 786 8.33333333333333e-02 +970 992 4.16666666666667e-02 +970 973 -2.50000000000000e-01 +970 80 -4.16666666666667e-02 +970 185 4.16666666666667e-02 +970 79 -1.25000000000000e-01 +970 78 8.33333333333333e-02 +970 183 -8.33333333333333e-02 +971 971 1.25000000000000e+00 +971 994 -8.33333333333333e-02 +971 977 -1.25000000000000e-01 +971 976 8.33333333333333e-02 +971 979 -1.66666666666667e-01 +971 975 -4.16666666666667e-02 +971 978 8.33333333333333e-02 +971 990 4.16666666666667e-02 +971 993 -8.33333333333333e-02 +971 786 -4.16666666666667e-02 +971 970 -1.66666666666667e-01 +971 787 8.33333333333333e-02 +971 973 1.66666666666667e-01 +971 704 -1.25000000000000e-01 +971 788 -1.25000000000000e-01 +971 703 -4.16666666666667e-02 +971 982 8.33333333333333e-02 +971 702 8.33333333333333e-02 +971 981 -1.66666666666667e-01 +971 991 4.16666666666667e-02 +971 974 -7.50000000000000e-01 +971 969 -1.66666666666667e-01 +971 972 1.66666666666667e-01 +971 183 4.16666666666667e-02 +971 80 -1.25000000000000e-01 +971 79 -4.16666666666667e-02 +971 184 4.16666666666667e-02 +971 78 8.33333333333333e-02 +972 972 2.50000000000000e+00 +972 994 -1.66666666666667e-01 +972 970 -8.33333333333333e-02 +972 787 8.33333333333333e-02 +972 788 8.33333333333333e-02 +972 971 1.66666666666667e-01 +972 969 -2.50000000000000e-01 +972 983 1.66666666666667e-01 +972 982 1.66666666666667e-01 +972 981 -7.50000000000000e-01 +972 1046 -8.33333333333333e-02 +972 1045 -8.33333333333333e-02 +972 980 -8.33333333333333e-02 +972 1034 8.33333333333333e-02 +972 1033 8.33333333333333e-02 +972 979 1.66666666666667e-01 +972 973 -3.33333333333333e-01 +972 978 -2.50000000000000e-01 +972 794 -8.33333333333333e-02 +972 974 -3.33333333333333e-01 +972 793 1.66666666666667e-01 +972 1031 1.66666666666667e-01 +972 710 -1.66666666666667e-01 +972 1030 -8.33333333333333e-02 +972 709 8.33333333333333e-02 +972 1029 -2.50000000000000e-01 +972 995 8.33333333333333e-02 +972 792 -2.50000000000000e-01 +972 185 -8.33333333333333e-02 +972 191 8.33333333333333e-02 +972 586 1.66666666666667e-01 +972 190 -1.66666666666667e-01 +972 587 1.66666666666667e-01 +972 80 -1.66666666666667e-01 +972 79 8.33333333333333e-02 +972 184 -8.33333333333333e-02 +972 585 -7.50000000000000e-01 +973 973 2.50000000000000e+00 +973 993 -1.66666666666667e-01 +973 971 1.66666666666667e-01 +973 969 -8.33333333333333e-02 +973 786 8.33333333333333e-02 +973 788 -1.66666666666667e-01 +973 970 -2.50000000000000e-01 +973 983 -8.33333333333333e-02 +973 982 -2.50000000000000e-01 +973 981 1.66666666666667e-01 +973 1044 -8.33333333333333e-02 +973 980 1.66666666666667e-01 +973 1034 -1.66666666666667e-01 +973 1032 8.33333333333333e-02 +973 979 -7.50000000000000e-01 +973 978 1.66666666666667e-01 +973 972 -3.33333333333333e-01 +973 1046 -8.33333333333333e-02 +973 710 8.33333333333333e-02 +973 792 1.66666666666667e-01 +973 1031 1.66666666666667e-01 +973 974 -3.33333333333333e-01 +973 794 1.66666666666667e-01 +973 1030 -2.50000000000000e-01 +973 995 8.33333333333333e-02 +973 793 -7.50000000000000e-01 +973 1029 -8.33333333333333e-02 +973 708 8.33333333333333e-02 +973 80 8.33333333333333e-02 +973 587 -8.33333333333333e-02 +973 585 1.66666666666667e-01 +973 185 -8.33333333333333e-02 +973 191 8.33333333333333e-02 +973 189 -1.66666666666667e-01 +973 586 -2.50000000000000e-01 +973 78 8.33333333333333e-02 +973 183 -8.33333333333333e-02 +974 974 2.50000000000000e+00 +974 994 8.33333333333333e-02 +974 970 1.66666666666667e-01 +974 787 -1.66666666666667e-01 +974 786 8.33333333333333e-02 +974 971 -7.50000000000000e-01 +974 969 1.66666666666667e-01 +974 983 -2.50000000000000e-01 +974 982 -8.33333333333333e-02 +974 981 1.66666666666667e-01 +974 1044 -8.33333333333333e-02 +974 979 1.66666666666667e-01 +974 978 -8.33333333333333e-02 +974 1032 8.33333333333333e-02 +974 1033 -1.66666666666667e-01 +974 980 -2.50000000000000e-01 +974 1045 -8.33333333333333e-02 +974 709 8.33333333333333e-02 +974 792 -8.33333333333333e-02 +974 972 -3.33333333333333e-01 +974 1031 -7.50000000000000e-01 +974 993 8.33333333333333e-02 +974 794 -2.50000000000000e-01 +974 1030 1.66666666666667e-01 +974 973 -3.33333333333333e-01 +974 793 1.66666666666667e-01 +974 1029 1.66666666666667e-01 +974 708 -1.66666666666667e-01 +974 79 8.33333333333333e-02 +974 586 -8.33333333333333e-02 +974 183 -8.33333333333333e-02 +974 189 8.33333333333333e-02 +974 184 -8.33333333333333e-02 +974 190 8.33333333333333e-02 +974 587 -2.50000000000000e-01 +974 585 1.66666666666667e-01 +974 78 -1.66666666666667e-01 +975 975 1.25000000000000e+00 +975 994 8.33333333333333e-02 +975 995 -1.66666666666667e-01 +975 971 -4.16666666666667e-02 +975 970 8.33333333333333e-02 +975 969 -1.25000000000000e-01 +975 743 4.16666666666667e-02 +975 991 8.33333333333333e-02 +975 990 -3.75000000000000e-01 +975 979 -8.33333333333333e-02 +975 833 -4.16666666666667e-02 +975 976 -1.66666666666667e-01 +975 1204 -8.33333333333333e-02 +975 835 8.33333333333333e-02 +975 1205 -8.33333333333333e-02 +975 836 8.33333333333333e-02 +975 742 -8.33333333333333e-02 +975 832 8.33333333333333e-02 +975 831 -1.25000000000000e-01 +975 977 -1.66666666666667e-01 +975 980 1.66666666666667e-01 +975 992 8.33333333333333e-02 +975 978 -2.50000000000000e-01 +975 80 4.16666666666667e-02 +975 227 8.33333333333333e-02 +975 226 8.33333333333333e-02 +975 79 -8.33333333333333e-02 +975 225 -3.75000000000000e-01 +976 976 1.25000000000000e+00 +976 993 8.33333333333333e-02 +976 995 8.33333333333333e-02 +976 971 8.33333333333333e-02 +976 977 -1.66666666666667e-01 +976 970 -3.75000000000000e-01 +976 969 8.33333333333333e-02 +976 991 -1.25000000000000e-01 +976 990 8.33333333333333e-02 +976 978 -8.33333333333333e-02 +976 975 -1.66666666666667e-01 +976 833 8.33333333333333e-02 +976 1203 -8.33333333333333e-02 +976 834 8.33333333333333e-02 +976 980 1.66666666666667e-01 +976 836 -1.66666666666667e-01 +976 743 4.16666666666667e-02 +976 1205 -8.33333333333333e-02 +976 832 -3.75000000000000e-01 +976 741 -8.33333333333333e-02 +976 831 8.33333333333333e-02 +976 992 -4.16666666666667e-02 +976 979 -2.50000000000000e-01 +976 227 -4.16666666666667e-02 +976 80 4.16666666666667e-02 +976 226 -1.25000000000000e-01 +976 225 8.33333333333333e-02 +976 78 -8.33333333333333e-02 +977 977 1.25000000000000e+00 +977 990 8.33333333333333e-02 +977 994 8.33333333333333e-02 +977 993 -1.66666666666667e-01 +977 971 -1.25000000000000e-01 +977 970 8.33333333333333e-02 +977 976 -1.66666666666667e-01 +977 969 -4.16666666666667e-02 +977 992 -1.25000000000000e-01 +977 741 4.16666666666667e-02 +977 831 -4.16666666666667e-02 +977 832 8.33333333333333e-02 +977 979 1.66666666666667e-01 +977 835 -1.66666666666667e-01 +977 1203 -8.33333333333333e-02 +977 834 8.33333333333333e-02 +977 833 -1.25000000000000e-01 +977 742 4.16666666666667e-02 +977 1204 -8.33333333333333e-02 +977 991 -4.16666666666667e-02 +977 980 -7.50000000000000e-01 +977 975 -1.66666666666667e-01 +977 978 1.66666666666667e-01 +977 78 4.16666666666667e-02 +977 227 -1.25000000000000e-01 +977 226 -4.16666666666667e-02 +977 79 4.16666666666667e-02 +977 225 8.33333333333333e-02 +978 978 2.50000000000000e+00 +978 995 1.66666666666667e-01 +978 971 8.33333333333333e-02 +978 994 1.66666666666667e-01 +978 993 -7.50000000000000e-01 +978 976 -8.33333333333333e-02 +978 1205 8.33333333333333e-02 +978 977 1.66666666666667e-01 +978 975 -2.50000000000000e-01 +978 1204 -1.66666666666667e-01 +978 980 -3.33333333333333e-01 +978 746 -8.33333333333333e-02 +978 1045 8.33333333333333e-02 +978 1033 -8.33333333333333e-02 +978 974 -8.33333333333333e-02 +978 1046 -1.66666666666667e-01 +978 1034 1.66666666666667e-01 +978 1032 -2.50000000000000e-01 +978 973 1.66666666666667e-01 +978 972 -2.50000000000000e-01 +978 836 -8.33333333333333e-02 +978 1211 8.33333333333333e-02 +978 835 1.66666666666667e-01 +978 979 -3.33333333333333e-01 +978 1210 8.33333333333333e-02 +978 745 -8.33333333333333e-02 +978 834 -2.50000000000000e-01 +978 970 8.33333333333333e-02 +978 80 -8.33333333333333e-02 +978 587 8.33333333333333e-02 +978 586 -1.66666666666667e-01 +978 589 1.66666666666667e-01 +978 590 1.66666666666667e-01 +978 227 -1.66666666666667e-01 +978 226 8.33333333333333e-02 +978 79 -8.33333333333333e-02 +978 588 -7.50000000000000e-01 +979 979 2.50000000000000e+00 +979 995 -8.33333333333333e-02 +979 971 -1.66666666666667e-01 +979 994 -2.50000000000000e-01 +979 993 1.66666666666667e-01 +979 975 -8.33333333333333e-02 +979 977 1.66666666666667e-01 +979 976 -2.50000000000000e-01 +979 1205 8.33333333333333e-02 +979 1203 -1.66666666666667e-01 +979 1044 8.33333333333333e-02 +979 1032 -8.33333333333333e-02 +979 974 1.66666666666667e-01 +979 980 -3.33333333333333e-01 +979 1034 1.66666666666667e-01 +979 746 -8.33333333333333e-02 +979 1046 8.33333333333333e-02 +979 1033 -2.50000000000000e-01 +979 973 -7.50000000000000e-01 +979 972 1.66666666666667e-01 +979 834 1.66666666666667e-01 +979 978 -3.33333333333333e-01 +979 1211 -1.66666666666667e-01 +979 836 1.66666666666667e-01 +979 835 -7.50000000000000e-01 +979 1209 8.33333333333333e-02 +979 744 -8.33333333333333e-02 +979 969 8.33333333333333e-02 +979 80 -8.33333333333333e-02 +979 587 8.33333333333333e-02 +979 585 -1.66666666666667e-01 +979 227 8.33333333333333e-02 +979 590 -8.33333333333333e-02 +979 588 1.66666666666667e-01 +979 589 -2.50000000000000e-01 +979 225 8.33333333333333e-02 +979 78 -8.33333333333333e-02 +980 980 2.50000000000000e+00 +980 993 1.66666666666667e-01 +980 970 -1.66666666666667e-01 +980 969 8.33333333333333e-02 +980 995 -2.50000000000000e-01 +980 976 1.66666666666667e-01 +980 1203 8.33333333333333e-02 +980 977 -7.50000000000000e-01 +980 975 1.66666666666667e-01 +980 1204 8.33333333333333e-02 +980 978 -3.33333333333333e-01 +980 744 -8.33333333333333e-02 +980 973 1.66666666666667e-01 +980 979 -3.33333333333333e-01 +980 1033 1.66666666666667e-01 +980 972 -8.33333333333333e-02 +980 1034 -7.50000000000000e-01 +980 745 -8.33333333333333e-02 +980 1045 8.33333333333333e-02 +980 1044 -1.66666666666667e-01 +980 1032 1.66666666666667e-01 +980 974 -2.50000000000000e-01 +980 834 -8.33333333333333e-02 +980 1209 8.33333333333333e-02 +980 836 -2.50000000000000e-01 +980 1210 -1.66666666666667e-01 +980 835 1.66666666666667e-01 +980 994 -8.33333333333333e-02 +980 78 -8.33333333333333e-02 +980 585 8.33333333333333e-02 +980 79 -8.33333333333333e-02 +980 586 8.33333333333333e-02 +980 226 8.33333333333333e-02 +980 589 -8.33333333333333e-02 +980 590 -2.50000000000000e-01 +980 588 1.66666666666667e-01 +980 225 -1.66666666666667e-01 +981 981 2.50000000000000e+00 +981 995 -8.33333333333333e-02 +981 994 1.66666666666667e-01 +981 993 -2.50000000000000e-01 +981 1046 8.33333333333333e-02 +981 970 8.33333333333333e-02 +981 971 -1.66666666666667e-01 +981 974 1.66666666666667e-01 +981 973 1.66666666666667e-01 +981 972 -7.50000000000000e-01 +981 982 -3.33333333333333e-01 +981 703 -8.33333333333333e-02 +981 709 -8.33333333333333e-02 +981 1048 -8.33333333333333e-02 +981 1042 8.33333333333333e-02 +981 1049 -8.33333333333333e-02 +981 998 8.33333333333333e-02 +981 704 1.66666666666667e-01 +981 983 -3.33333333333333e-01 +981 989 1.66666666666667e-01 +981 997 -1.66666666666667e-01 +981 988 1.66666666666667e-01 +981 987 -7.50000000000000e-01 +981 710 1.66666666666667e-01 +981 1043 -1.66666666666667e-01 +981 787 -8.33333333333333e-02 +981 952 8.33333333333333e-02 +981 953 8.33333333333333e-02 +981 788 -8.33333333333333e-02 +981 702 -2.50000000000000e-01 +981 959 -8.33333333333333e-02 +981 794 8.33333333333333e-02 +981 958 1.66666666666667e-01 +981 793 -1.66666666666667e-01 +981 957 -2.50000000000000e-01 +981 1045 8.33333333333333e-02 +981 708 -2.50000000000000e-01 +982 982 2.50000000000000e+00 +982 995 1.66666666666667e-01 +982 994 -7.50000000000000e-01 +982 993 1.66666666666667e-01 +982 1046 -1.66666666666667e-01 +982 969 8.33333333333333e-02 +982 971 8.33333333333333e-02 +982 974 -8.33333333333333e-02 +982 973 -2.50000000000000e-01 +982 972 1.66666666666667e-01 +982 981 -3.33333333333333e-01 +982 702 -8.33333333333333e-02 +982 708 -8.33333333333333e-02 +982 1047 -8.33333333333333e-02 +982 1041 8.33333333333333e-02 +982 998 8.33333333333333e-02 +982 989 -8.33333333333333e-02 +982 988 -2.50000000000000e-01 +982 996 -1.66666666666667e-01 +982 987 1.66666666666667e-01 +982 1049 -8.33333333333333e-02 +982 1043 8.33333333333333e-02 +982 786 -8.33333333333333e-02 +982 951 8.33333333333333e-02 +982 788 -8.33333333333333e-02 +982 794 8.33333333333333e-02 +982 953 -1.66666666666667e-01 +982 704 1.66666666666667e-01 +982 703 -2.50000000000000e-01 +982 959 1.66666666666667e-01 +982 983 -3.33333333333333e-01 +982 710 1.66666666666667e-01 +982 958 -7.50000000000000e-01 +982 1044 8.33333333333333e-02 +982 709 -2.50000000000000e-01 +982 957 1.66666666666667e-01 +982 792 -1.66666666666667e-01 +983 983 2.50000000000000e+00 +983 994 1.66666666666667e-01 +983 993 -8.33333333333333e-02 +983 1045 -1.66666666666667e-01 +983 1044 8.33333333333333e-02 +983 970 8.33333333333333e-02 +983 969 -1.66666666666667e-01 +983 974 -2.50000000000000e-01 +983 973 -8.33333333333333e-02 +983 972 1.66666666666667e-01 +983 1047 -8.33333333333333e-02 +983 996 8.33333333333333e-02 +983 989 -2.50000000000000e-01 +983 997 8.33333333333333e-02 +983 988 -8.33333333333333e-02 +983 702 1.66666666666667e-01 +983 981 -3.33333333333333e-01 +983 987 1.66666666666667e-01 +983 1048 -8.33333333333333e-02 +983 1042 8.33333333333333e-02 +983 708 1.66666666666667e-01 +983 1041 -1.66666666666667e-01 +983 787 -8.33333333333333e-02 +983 793 8.33333333333333e-02 +983 704 -7.50000000000000e-01 +983 952 -1.66666666666667e-01 +983 703 1.66666666666667e-01 +983 951 8.33333333333333e-02 +983 786 -8.33333333333333e-02 +983 959 -2.50000000000000e-01 +983 995 -2.50000000000000e-01 +983 710 -7.50000000000000e-01 +983 958 1.66666666666667e-01 +983 982 -3.33333333333333e-01 +983 709 1.66666666666667e-01 +983 957 -8.33333333333333e-02 +983 792 8.33333333333333e-02 +984 984 1.25000000000000e+00 +984 953 4.16666666666667e-02 +984 952 -8.33333333333333e-02 +984 961 8.33333333333333e-02 +984 960 -1.25000000000000e-01 +984 704 8.33333333333333e-02 +984 986 -1.66666666666667e-01 +984 989 1.66666666666667e-01 +984 988 -8.33333333333333e-02 +984 987 -2.50000000000000e-01 +984 716 8.33333333333333e-02 +984 1082 -1.66666666666667e-01 +984 1081 8.33333333333333e-02 +984 997 8.33333333333333e-02 +984 1090 -8.33333333333333e-02 +984 842 4.16666666666667e-02 +984 1091 -8.33333333333333e-02 +984 715 8.33333333333333e-02 +984 841 -8.33333333333333e-02 +984 714 -3.75000000000000e-01 +984 839 -4.16666666666667e-02 +984 998 8.33333333333333e-02 +984 985 -1.66666666666667e-01 +984 838 8.33333333333333e-02 +984 703 8.33333333333333e-02 +984 962 -4.16666666666667e-02 +984 837 -1.25000000000000e-01 +984 702 -3.75000000000000e-01 +985 985 1.25000000000000e+00 +985 986 -1.66666666666667e-01 +985 704 -4.16666666666667e-02 +985 953 4.16666666666667e-02 +985 951 -8.33333333333333e-02 +985 716 -4.16666666666667e-02 +985 961 -3.75000000000000e-01 +985 960 8.33333333333333e-02 +985 1082 8.33333333333333e-02 +985 989 1.66666666666667e-01 +985 988 -2.50000000000000e-01 +985 987 -8.33333333333333e-02 +985 1080 8.33333333333333e-02 +985 996 8.33333333333333e-02 +985 1089 -8.33333333333333e-02 +985 842 4.16666666666667e-02 +985 1091 -8.33333333333333e-02 +985 715 -1.25000000000000e-01 +985 714 8.33333333333333e-02 +985 840 -8.33333333333333e-02 +985 839 8.33333333333333e-02 +985 998 -1.66666666666667e-01 +985 962 8.33333333333333e-02 +985 838 -3.75000000000000e-01 +985 703 -1.25000000000000e-01 +985 984 -1.66666666666667e-01 +985 837 8.33333333333333e-02 +985 702 8.33333333333333e-02 +986 986 1.25000000000000e+00 +986 985 -1.66666666666667e-01 +986 960 -4.16666666666667e-02 +986 951 4.16666666666667e-02 +986 703 -4.16666666666667e-02 +986 952 4.16666666666667e-02 +986 962 -1.25000000000000e-01 +986 715 -4.16666666666667e-02 +986 1081 8.33333333333333e-02 +986 989 -7.50000000000000e-01 +986 988 1.66666666666667e-01 +986 702 8.33333333333333e-02 +986 984 -1.66666666666667e-01 +986 987 1.66666666666667e-01 +986 714 8.33333333333333e-02 +986 1080 -1.66666666666667e-01 +986 841 4.16666666666667e-02 +986 1090 -8.33333333333333e-02 +986 716 -1.25000000000000e-01 +986 840 4.16666666666667e-02 +986 1089 -8.33333333333333e-02 +986 961 8.33333333333333e-02 +986 839 -1.25000000000000e-01 +986 704 -1.25000000000000e-01 +986 838 8.33333333333333e-02 +986 997 -1.66666666666667e-01 +986 837 -4.16666666666667e-02 +986 996 8.33333333333333e-02 +987 987 2.50000000000000e+00 +987 958 -1.66666666666667e-01 +987 953 -8.33333333333333e-02 +987 961 8.33333333333333e-02 +987 952 -8.33333333333333e-02 +987 962 8.33333333333333e-02 +987 968 -8.33333333333333e-02 +987 967 1.66666666666667e-01 +987 966 -2.50000000000000e-01 +987 1091 8.33333333333333e-02 +987 1090 -1.66666666666667e-01 +987 1081 1.66666666666667e-01 +987 986 1.66666666666667e-01 +987 703 8.33333333333333e-02 +987 985 -8.33333333333333e-02 +987 984 -2.50000000000000e-01 +987 1082 1.66666666666667e-01 +987 727 8.33333333333333e-02 +987 1080 -7.50000000000000e-01 +987 989 -3.33333333333333e-01 +987 1042 -8.33333333333333e-02 +987 998 -8.33333333333333e-02 +987 1048 8.33333333333333e-02 +987 1153 -8.33333333333333e-02 +987 1049 8.33333333333333e-02 +987 1154 -8.33333333333333e-02 +987 704 -1.66666666666667e-01 +987 983 1.66666666666667e-01 +987 997 1.66666666666667e-01 +987 982 1.66666666666667e-01 +987 988 -3.33333333333333e-01 +987 996 -2.50000000000000e-01 +987 981 -7.50000000000000e-01 +987 1043 1.66666666666667e-01 +987 728 -1.66666666666667e-01 +987 959 8.33333333333333e-02 +987 1041 -2.50000000000000e-01 +988 988 2.50000000000000e+00 +988 957 -1.66666666666667e-01 +988 960 8.33333333333333e-02 +988 951 -8.33333333333333e-02 +988 962 -1.66666666666667e-01 +988 968 1.66666666666667e-01 +988 953 -8.33333333333333e-02 +988 967 -7.50000000000000e-01 +988 966 1.66666666666667e-01 +988 1091 8.33333333333333e-02 +988 1082 -8.33333333333333e-02 +988 1089 -1.66666666666667e-01 +988 1080 1.66666666666667e-01 +988 986 1.66666666666667e-01 +988 989 -3.33333333333333e-01 +988 985 -2.50000000000000e-01 +988 702 8.33333333333333e-02 +988 984 -8.33333333333333e-02 +988 1081 -2.50000000000000e-01 +988 726 8.33333333333333e-02 +988 1041 -8.33333333333333e-02 +988 998 1.66666666666667e-01 +988 1047 8.33333333333333e-02 +988 1152 -8.33333333333333e-02 +988 1049 -1.66666666666667e-01 +988 1043 1.66666666666667e-01 +988 704 8.33333333333333e-02 +988 983 -8.33333333333333e-02 +988 997 -7.50000000000000e-01 +988 982 -2.50000000000000e-01 +988 996 1.66666666666667e-01 +988 981 1.66666666666667e-01 +988 987 -3.33333333333333e-01 +988 1154 -8.33333333333333e-02 +988 728 8.33333333333333e-02 +988 959 8.33333333333333e-02 +988 1042 -2.50000000000000e-01 +989 989 2.50000000000000e+00 +989 957 8.33333333333333e-02 +989 951 -8.33333333333333e-02 +989 961 -1.66666666666667e-01 +989 967 1.66666666666667e-01 +989 960 8.33333333333333e-02 +989 966 -8.33333333333333e-02 +989 952 -8.33333333333333e-02 +989 968 -2.50000000000000e-01 +989 1090 8.33333333333333e-02 +989 1081 -8.33333333333333e-02 +989 1089 8.33333333333333e-02 +989 986 -7.50000000000000e-01 +989 985 1.66666666666667e-01 +989 988 -3.33333333333333e-01 +989 984 1.66666666666667e-01 +989 1082 -2.50000000000000e-01 +989 1080 1.66666666666667e-01 +989 987 -3.33333333333333e-01 +989 996 -8.33333333333333e-02 +989 997 1.66666666666667e-01 +989 1048 -1.66666666666667e-01 +989 1042 1.66666666666667e-01 +989 1047 8.33333333333333e-02 +989 1152 -8.33333333333333e-02 +989 998 -2.50000000000000e-01 +989 983 -2.50000000000000e-01 +989 703 8.33333333333333e-02 +989 982 -8.33333333333333e-02 +989 702 -1.66666666666667e-01 +989 981 1.66666666666667e-01 +989 958 8.33333333333333e-02 +989 1043 -7.50000000000000e-01 +989 1153 -8.33333333333333e-02 +989 727 8.33333333333333e-02 +989 1041 1.66666666666667e-01 +989 726 -1.66666666666667e-01 +990 990 1.25000000000000e+00 +990 977 8.33333333333333e-02 +990 971 4.16666666666667e-02 +990 704 -4.16666666666667e-02 +990 970 -8.33333333333333e-02 +990 743 -4.16666666666667e-02 +990 976 8.33333333333333e-02 +990 975 -3.75000000000000e-01 +990 1205 8.33333333333333e-02 +990 1204 8.33333333333333e-02 +990 995 1.66666666666667e-01 +990 994 -8.33333333333333e-02 +990 993 -2.50000000000000e-01 +990 997 8.33333333333333e-02 +990 1207 -8.33333333333333e-02 +990 845 4.16666666666667e-02 +990 1208 -8.33333333333333e-02 +990 844 -8.33333333333333e-02 +990 742 8.33333333333333e-02 +990 741 -1.25000000000000e-01 +990 839 8.33333333333333e-02 +990 998 -1.66666666666667e-01 +990 838 8.33333333333333e-02 +990 991 -1.66666666666667e-01 +990 703 8.33333333333333e-02 +990 837 -3.75000000000000e-01 +990 992 -1.66666666666667e-01 +990 702 -1.25000000000000e-01 +991 991 1.25000000000000e+00 +991 971 4.16666666666667e-02 +991 969 -8.33333333333333e-02 +991 976 -1.25000000000000e-01 +991 975 8.33333333333333e-02 +991 743 8.33333333333333e-02 +991 1205 -1.66666666666667e-01 +991 1203 8.33333333333333e-02 +991 992 -1.66666666666667e-01 +991 704 8.33333333333333e-02 +991 995 1.66666666666667e-01 +991 994 -2.50000000000000e-01 +991 993 -8.33333333333333e-02 +991 996 8.33333333333333e-02 +991 1206 -8.33333333333333e-02 +991 845 4.16666666666667e-02 +991 1208 -8.33333333333333e-02 +991 742 -3.75000000000000e-01 +991 843 -8.33333333333333e-02 +991 741 8.33333333333333e-02 +991 839 -4.16666666666667e-02 +991 998 8.33333333333333e-02 +991 838 -1.25000000000000e-01 +991 977 -4.16666666666667e-02 +991 703 -3.75000000000000e-01 +991 837 8.33333333333333e-02 +991 990 -1.66666666666667e-01 +991 702 8.33333333333333e-02 +992 992 1.25000000000000e+00 +992 970 4.16666666666667e-02 +992 990 -1.66666666666667e-01 +992 975 8.33333333333333e-02 +992 969 4.16666666666667e-02 +992 702 -4.16666666666667e-02 +992 977 -1.25000000000000e-01 +992 741 -4.16666666666667e-02 +992 1203 8.33333333333333e-02 +992 742 8.33333333333333e-02 +992 1204 -1.66666666666667e-01 +992 995 -7.50000000000000e-01 +992 991 -1.66666666666667e-01 +992 703 8.33333333333333e-02 +992 994 1.66666666666667e-01 +992 993 1.66666666666667e-01 +992 843 4.16666666666667e-02 +992 1206 -8.33333333333333e-02 +992 743 -1.25000000000000e-01 +992 844 4.16666666666667e-02 +992 1207 -8.33333333333333e-02 +992 839 -1.25000000000000e-01 +992 976 -4.16666666666667e-02 +992 704 -1.25000000000000e-01 +992 838 -4.16666666666667e-02 +992 997 8.33333333333333e-02 +992 837 8.33333333333333e-02 +992 996 -1.66666666666667e-01 +993 993 2.50000000000000e+00 +993 973 -1.66666666666667e-01 +993 970 -8.33333333333333e-02 +993 976 8.33333333333333e-02 +993 980 1.66666666666667e-01 +993 977 -1.66666666666667e-01 +993 971 -8.33333333333333e-02 +993 979 1.66666666666667e-01 +993 978 -7.50000000000000e-01 +993 1208 8.33333333333333e-02 +993 1205 -8.33333333333333e-02 +993 1204 1.66666666666667e-01 +993 1207 -1.66666666666667e-01 +993 992 1.66666666666667e-01 +993 995 -3.33333333333333e-01 +993 991 -8.33333333333333e-02 +993 703 8.33333333333333e-02 +993 990 -2.50000000000000e-01 +993 745 8.33333333333333e-02 +993 1203 -2.50000000000000e-01 +993 1045 -8.33333333333333e-02 +993 998 1.66666666666667e-01 +993 1048 8.33333333333333e-02 +993 1216 -8.33333333333333e-02 +993 1049 -1.66666666666667e-01 +993 1046 1.66666666666667e-01 +993 704 8.33333333333333e-02 +993 983 -8.33333333333333e-02 +993 997 1.66666666666667e-01 +993 982 1.66666666666667e-01 +993 994 -3.33333333333333e-01 +993 996 -7.50000000000000e-01 +993 981 -2.50000000000000e-01 +993 1217 -8.33333333333333e-02 +993 746 8.33333333333333e-02 +993 974 8.33333333333333e-02 +993 1044 -2.50000000000000e-01 +994 994 2.50000000000000e+00 +994 972 -1.66666666666667e-01 +994 971 -8.33333333333333e-02 +994 969 -8.33333333333333e-02 +994 975 8.33333333333333e-02 +994 980 -8.33333333333333e-02 +994 977 8.33333333333333e-02 +994 979 -2.50000000000000e-01 +994 978 1.66666666666667e-01 +994 1208 8.33333333333333e-02 +994 1203 1.66666666666667e-01 +994 1206 -1.66666666666667e-01 +994 992 1.66666666666667e-01 +994 991 -2.50000000000000e-01 +994 990 -8.33333333333333e-02 +994 702 8.33333333333333e-02 +994 1205 1.66666666666667e-01 +994 1204 -7.50000000000000e-01 +994 744 8.33333333333333e-02 +994 995 -3.33333333333333e-01 +994 1044 -8.33333333333333e-02 +994 998 -8.33333333333333e-02 +994 1047 8.33333333333333e-02 +994 1215 -8.33333333333333e-02 +994 1217 -8.33333333333333e-02 +994 1049 8.33333333333333e-02 +994 704 -1.66666666666667e-01 +994 983 1.66666666666667e-01 +994 997 -2.50000000000000e-01 +994 982 -7.50000000000000e-01 +994 996 1.66666666666667e-01 +994 981 1.66666666666667e-01 +994 993 -3.33333333333333e-01 +994 1046 1.66666666666667e-01 +994 746 -1.66666666666667e-01 +994 974 8.33333333333333e-02 +994 1045 -2.50000000000000e-01 +995 995 2.50000000000000e+00 +995 973 8.33333333333333e-02 +995 970 -8.33333333333333e-02 +995 979 -8.33333333333333e-02 +995 976 8.33333333333333e-02 +995 978 1.66666666666667e-01 +995 975 -1.66666666666667e-01 +995 969 -8.33333333333333e-02 +995 980 -2.50000000000000e-01 +995 1206 8.33333333333333e-02 +995 1203 -8.33333333333333e-02 +995 1207 8.33333333333333e-02 +995 992 -7.50000000000000e-01 +995 991 1.66666666666667e-01 +995 990 1.66666666666667e-01 +995 993 -3.33333333333333e-01 +995 1205 -2.50000000000000e-01 +995 1204 1.66666666666667e-01 +995 994 -3.33333333333333e-01 +995 997 -8.33333333333333e-02 +995 996 1.66666666666667e-01 +995 1216 -8.33333333333333e-02 +995 1048 8.33333333333333e-02 +995 1047 -1.66666666666667e-01 +995 1044 1.66666666666667e-01 +995 998 -2.50000000000000e-01 +995 983 -2.50000000000000e-01 +995 703 -1.66666666666667e-01 +995 982 1.66666666666667e-01 +995 702 8.33333333333333e-02 +995 981 -8.33333333333333e-02 +995 972 8.33333333333333e-02 +995 1046 -7.50000000000000e-01 +995 1045 1.66666666666667e-01 +995 745 -1.66666666666667e-01 +995 1215 -8.33333333333333e-02 +995 744 8.33333333333333e-02 +996 996 2.50000000000000e+00 +996 1216 8.33333333333333e-02 +996 1217 8.33333333333333e-02 +996 994 1.66666666666667e-01 +996 993 -7.50000000000000e-01 +996 991 8.33333333333333e-02 +996 1208 -8.33333333333333e-02 +996 992 -1.66666666666667e-01 +996 1207 1.66666666666667e-01 +996 1206 -2.50000000000000e-01 +996 997 -3.33333333333333e-01 +996 703 -8.33333333333333e-02 +996 751 -8.33333333333333e-02 +996 983 8.33333333333333e-02 +996 989 -8.33333333333333e-02 +996 1048 -8.33333333333333e-02 +996 1153 8.33333333333333e-02 +996 982 -1.66666666666667e-01 +996 988 1.66666666666667e-01 +996 987 -2.50000000000000e-01 +996 1049 1.66666666666667e-01 +996 1154 -1.66666666666667e-01 +996 1047 -2.50000000000000e-01 +996 838 -8.33333333333333e-02 +996 985 8.33333333333333e-02 +996 839 1.66666666666667e-01 +996 998 -3.33333333333333e-01 +996 1091 1.66666666666667e-01 +996 986 8.33333333333333e-02 +996 704 -8.33333333333333e-02 +996 837 -2.50000000000000e-01 +996 851 8.33333333333333e-02 +996 752 -8.33333333333333e-02 +996 1090 1.66666666666667e-01 +996 850 -1.66666666666667e-01 +996 1089 -7.50000000000000e-01 +996 995 1.66666666666667e-01 +997 997 2.50000000000000e+00 +997 1215 8.33333333333333e-02 +997 1217 -1.66666666666667e-01 +997 994 -2.50000000000000e-01 +997 993 1.66666666666667e-01 +997 990 8.33333333333333e-02 +997 1208 1.66666666666667e-01 +997 992 8.33333333333333e-02 +997 1207 -7.50000000000000e-01 +997 1206 1.66666666666667e-01 +997 996 -3.33333333333333e-01 +997 702 -8.33333333333333e-02 +997 750 -8.33333333333333e-02 +997 1049 1.66666666666667e-01 +997 998 -3.33333333333333e-01 +997 989 1.66666666666667e-01 +997 1047 -8.33333333333333e-02 +997 1152 8.33333333333333e-02 +997 704 -8.33333333333333e-02 +997 983 8.33333333333333e-02 +997 988 -7.50000000000000e-01 +997 981 -1.66666666666667e-01 +997 987 1.66666666666667e-01 +997 752 -8.33333333333333e-02 +997 1154 8.33333333333333e-02 +997 1048 -2.50000000000000e-01 +997 837 -8.33333333333333e-02 +997 984 8.33333333333333e-02 +997 851 8.33333333333333e-02 +997 1091 -8.33333333333333e-02 +997 986 -1.66666666666667e-01 +997 839 1.66666666666667e-01 +997 838 -2.50000000000000e-01 +997 1090 -2.50000000000000e-01 +997 995 -8.33333333333333e-02 +997 1089 1.66666666666667e-01 +997 849 -1.66666666666667e-01 +998 998 2.50000000000000e+00 +998 993 1.66666666666667e-01 +998 1216 -1.66666666666667e-01 +998 1215 8.33333333333333e-02 +998 995 -2.50000000000000e-01 +998 1207 1.66666666666667e-01 +998 1206 -8.33333333333333e-02 +998 991 8.33333333333333e-02 +998 990 -1.66666666666667e-01 +998 1208 -2.50000000000000e-01 +998 981 8.33333333333333e-02 +998 987 -8.33333333333333e-02 +998 1048 1.66666666666667e-01 +998 997 -3.33333333333333e-01 +998 988 1.66666666666667e-01 +998 989 -2.50000000000000e-01 +998 703 -8.33333333333333e-02 +998 982 8.33333333333333e-02 +998 1049 -7.50000000000000e-01 +998 751 -8.33333333333333e-02 +998 1153 8.33333333333333e-02 +998 1047 1.66666666666667e-01 +998 1152 -1.66666666666667e-01 +998 850 8.33333333333333e-02 +998 1090 -8.33333333333333e-02 +998 837 1.66666666666667e-01 +998 996 -3.33333333333333e-01 +998 1089 1.66666666666667e-01 +998 839 -7.50000000000000e-01 +998 985 -1.66666666666667e-01 +998 838 1.66666666666667e-01 +998 984 8.33333333333333e-02 +998 702 -8.33333333333333e-02 +998 1091 -2.50000000000000e-01 +998 994 -8.33333333333333e-02 +998 849 8.33333333333333e-02 +998 750 -8.33333333333333e-02 +999 999 1.25000000000000e+00 +999 1025 -8.33333333333333e-02 +999 1022 -8.33333333333333e-02 +999 1021 4.16666666666667e-02 +999 1024 -8.33333333333333e-02 +999 1007 8.33333333333333e-02 +999 1006 -4.16666666666667e-02 +999 1009 8.33333333333333e-02 +999 1005 -1.25000000000000e-01 +999 790 -4.16666666666667e-02 +999 1013 8.33333333333333e-02 +999 1004 -8.33333333333333e-02 +999 1000 -1.66666666666667e-01 +999 1003 1.66666666666667e-01 +999 1002 -2.50000000000000e-01 +999 1001 -1.66666666666667e-01 +999 707 8.33333333333333e-02 +999 791 8.33333333333333e-02 +999 706 8.33333333333333e-02 +999 1012 -1.66666666666667e-01 +999 1010 8.33333333333333e-02 +999 705 -3.75000000000000e-01 +999 789 -1.25000000000000e-01 +999 187 4.16666666666667e-02 +999 83 8.33333333333333e-02 +999 188 -8.33333333333333e-02 +999 82 8.33333333333333e-02 +999 81 -3.75000000000000e-01 +1000 1000 1.25000000000000e+00 +1000 1025 -8.33333333333333e-02 +1000 1020 4.16666666666667e-02 +1000 1023 -8.33333333333333e-02 +1000 1007 8.33333333333333e-02 +1000 1010 -1.66666666666667e-01 +1000 1006 -1.25000000000000e-01 +1000 1005 -4.16666666666667e-02 +1000 1008 8.33333333333333e-02 +1000 789 -4.16666666666667e-02 +1000 791 8.33333333333333e-02 +1000 1001 -1.66666666666667e-01 +1000 1004 1.66666666666667e-01 +1000 1003 -7.50000000000000e-01 +1000 999 -1.66666666666667e-01 +1000 1002 1.66666666666667e-01 +1000 707 -4.16666666666667e-02 +1000 1013 8.33333333333333e-02 +1000 1022 4.16666666666667e-02 +1000 706 -1.25000000000000e-01 +1000 790 -1.25000000000000e-01 +1000 705 8.33333333333333e-02 +1000 1011 -1.66666666666667e-01 +1000 186 4.16666666666667e-02 +1000 83 -4.16666666666667e-02 +1000 188 4.16666666666667e-02 +1000 82 -1.25000000000000e-01 +1000 81 8.33333333333333e-02 +1001 1001 1.25000000000000e+00 +1001 1024 -8.33333333333333e-02 +1001 1008 8.33333333333333e-02 +1001 1023 -8.33333333333333e-02 +1001 1020 -8.33333333333333e-02 +1001 1007 -3.75000000000000e-01 +1001 1006 8.33333333333333e-02 +1001 1009 -1.66666666666667e-01 +1001 1005 8.33333333333333e-02 +1001 790 8.33333333333333e-02 +1001 1000 -1.66666666666667e-01 +1001 1003 1.66666666666667e-01 +1001 1011 8.33333333333333e-02 +1001 1002 -8.33333333333333e-02 +1001 1004 -2.50000000000000e-01 +1001 1021 4.16666666666667e-02 +1001 707 -1.25000000000000e-01 +1001 791 -3.75000000000000e-01 +1001 706 -4.16666666666667e-02 +1001 1012 8.33333333333333e-02 +1001 999 -1.66666666666667e-01 +1001 705 8.33333333333333e-02 +1001 789 8.33333333333333e-02 +1001 83 -1.25000000000000e-01 +1001 82 -4.16666666666667e-02 +1001 187 4.16666666666667e-02 +1001 81 8.33333333333333e-02 +1001 186 -8.33333333333333e-02 +1002 1002 2.50000000000000e+00 +1002 1037 8.33333333333333e-02 +1002 1031 -8.33333333333333e-02 +1002 1030 1.66666666666667e-01 +1002 1029 -2.50000000000000e-01 +1002 1009 -8.33333333333333e-02 +1002 1051 -8.33333333333333e-02 +1002 1024 8.33333333333333e-02 +1002 1010 1.66666666666667e-01 +1002 1025 -1.66666666666667e-01 +1002 710 8.33333333333333e-02 +1002 1052 -8.33333333333333e-02 +1002 1008 -2.50000000000000e-01 +1002 791 8.33333333333333e-02 +1002 1001 -8.33333333333333e-02 +1002 1003 -3.33333333333333e-01 +1002 790 8.33333333333333e-02 +1002 793 -8.33333333333333e-02 +1002 1000 1.66666666666667e-01 +1002 999 -2.50000000000000e-01 +1002 1004 -3.33333333333333e-01 +1002 1013 1.66666666666667e-01 +1002 794 1.66666666666667e-01 +1002 1012 1.66666666666667e-01 +1002 709 -1.66666666666667e-01 +1002 1036 8.33333333333333e-02 +1002 1011 -7.50000000000000e-01 +1002 792 -2.50000000000000e-01 +1002 593 1.66666666666667e-01 +1002 191 -1.66666666666667e-01 +1002 190 8.33333333333333e-02 +1002 592 1.66666666666667e-01 +1002 591 -7.50000000000000e-01 +1002 83 8.33333333333333e-02 +1002 188 -8.33333333333333e-02 +1002 187 -8.33333333333333e-02 +1002 82 -1.66666666666667e-01 +1003 1003 2.50000000000000e+00 +1003 1037 -1.66666666666667e-01 +1003 1031 1.66666666666667e-01 +1003 1030 -7.50000000000000e-01 +1003 1029 1.66666666666667e-01 +1003 1008 -8.33333333333333e-02 +1003 1050 -8.33333333333333e-02 +1003 1023 8.33333333333333e-02 +1003 1052 -8.33333333333333e-02 +1003 1025 8.33333333333333e-02 +1003 1004 -3.33333333333333e-01 +1003 1010 1.66666666666667e-01 +1003 1009 -2.50000000000000e-01 +1003 1001 1.66666666666667e-01 +1003 1002 -3.33333333333333e-01 +1003 791 -1.66666666666667e-01 +1003 794 1.66666666666667e-01 +1003 789 8.33333333333333e-02 +1003 792 -8.33333333333333e-02 +1003 1000 -7.50000000000000e-01 +1003 999 1.66666666666667e-01 +1003 1013 -8.33333333333333e-02 +1003 710 8.33333333333333e-02 +1003 1035 8.33333333333333e-02 +1003 1012 -2.50000000000000e-01 +1003 793 -2.50000000000000e-01 +1003 1011 1.66666666666667e-01 +1003 708 -1.66666666666667e-01 +1003 593 -8.33333333333333e-02 +1003 191 8.33333333333333e-02 +1003 189 8.33333333333333e-02 +1003 592 -2.50000000000000e-01 +1003 591 1.66666666666667e-01 +1003 186 -8.33333333333333e-02 +1003 83 8.33333333333333e-02 +1003 188 -8.33333333333333e-02 +1003 81 -1.66666666666667e-01 +1004 1004 2.50000000000000e+00 +1004 1035 8.33333333333333e-02 +1004 1031 -2.50000000000000e-01 +1004 1030 1.66666666666667e-01 +1004 1029 -8.33333333333333e-02 +1004 1051 -8.33333333333333e-02 +1004 1024 8.33333333333333e-02 +1004 1008 1.66666666666667e-01 +1004 1023 -1.66666666666667e-01 +1004 708 8.33333333333333e-02 +1004 1050 -8.33333333333333e-02 +1004 1010 -7.50000000000000e-01 +1004 1003 -3.33333333333333e-01 +1004 1009 1.66666666666667e-01 +1004 1000 1.66666666666667e-01 +1004 789 8.33333333333333e-02 +1004 999 -8.33333333333333e-02 +1004 790 -1.66666666666667e-01 +1004 793 1.66666666666667e-01 +1004 1001 -2.50000000000000e-01 +1004 1036 -1.66666666666667e-01 +1004 1013 -2.50000000000000e-01 +1004 794 -7.50000000000000e-01 +1004 1012 -8.33333333333333e-02 +1004 709 8.33333333333333e-02 +1004 1002 -3.33333333333333e-01 +1004 1011 1.66666666666667e-01 +1004 792 1.66666666666667e-01 +1004 592 -8.33333333333333e-02 +1004 190 8.33333333333333e-02 +1004 591 1.66666666666667e-01 +1004 189 -1.66666666666667e-01 +1004 593 -2.50000000000000e-01 +1004 81 8.33333333333333e-02 +1004 186 -8.33333333333333e-02 +1004 82 8.33333333333333e-02 +1004 187 -8.33333333333333e-02 +1005 1005 1.25000000000000e+00 +1005 1025 8.33333333333333e-02 +1005 1024 -1.66666666666667e-01 +1005 1001 8.33333333333333e-02 +1005 1000 -4.16666666666667e-02 +1005 999 -1.25000000000000e-01 +1005 1022 8.33333333333333e-02 +1005 760 4.16666666666667e-02 +1005 1020 -3.75000000000000e-01 +1005 1010 -8.33333333333333e-02 +1005 1007 -1.66666666666667e-01 +1005 868 -4.16666666666667e-02 +1005 1241 -8.33333333333333e-02 +1005 872 8.33333333333333e-02 +1005 1240 -8.33333333333333e-02 +1005 871 8.33333333333333e-02 +1005 869 8.33333333333333e-02 +1005 761 -8.33333333333333e-02 +1005 867 -1.25000000000000e-01 +1005 1006 -1.66666666666667e-01 +1005 1009 1.66666666666667e-01 +1005 1021 8.33333333333333e-02 +1005 1008 -2.50000000000000e-01 +1005 82 4.16666666666667e-02 +1005 269 8.33333333333333e-02 +1005 83 -8.33333333333333e-02 +1005 268 8.33333333333333e-02 +1005 267 -3.75000000000000e-01 +1006 1006 1.25000000000000e+00 +1006 1020 8.33333333333333e-02 +1006 1025 8.33333333333333e-02 +1006 1023 -1.66666666666667e-01 +1006 1001 8.33333333333333e-02 +1006 1007 -1.66666666666667e-01 +1006 1000 -1.25000000000000e-01 +1006 999 -4.16666666666667e-02 +1006 1021 -1.25000000000000e-01 +1006 759 4.16666666666667e-02 +1006 867 -4.16666666666667e-02 +1006 869 8.33333333333333e-02 +1006 1010 1.66666666666667e-01 +1006 872 -1.66666666666667e-01 +1006 1239 -8.33333333333333e-02 +1006 870 8.33333333333333e-02 +1006 761 4.16666666666667e-02 +1006 1241 -8.33333333333333e-02 +1006 868 -1.25000000000000e-01 +1006 1022 -4.16666666666667e-02 +1006 1009 -7.50000000000000e-01 +1006 1005 -1.66666666666667e-01 +1006 1008 1.66666666666667e-01 +1006 81 4.16666666666667e-02 +1006 269 -4.16666666666667e-02 +1006 83 4.16666666666667e-02 +1006 268 -1.25000000000000e-01 +1006 267 8.33333333333333e-02 +1007 1007 1.25000000000000e+00 +1007 1023 8.33333333333333e-02 +1007 1024 8.33333333333333e-02 +1007 1001 -3.75000000000000e-01 +1007 1000 8.33333333333333e-02 +1007 1006 -1.66666666666667e-01 +1007 999 8.33333333333333e-02 +1007 1022 -1.25000000000000e-01 +1007 1020 8.33333333333333e-02 +1007 1008 -8.33333333333333e-02 +1007 1005 -1.66666666666667e-01 +1007 868 8.33333333333333e-02 +1007 1239 -8.33333333333333e-02 +1007 870 8.33333333333333e-02 +1007 1009 1.66666666666667e-01 +1007 871 -1.66666666666667e-01 +1007 869 -3.75000000000000e-01 +1007 760 4.16666666666667e-02 +1007 1240 -8.33333333333333e-02 +1007 867 8.33333333333333e-02 +1007 759 -8.33333333333333e-02 +1007 1021 -4.16666666666667e-02 +1007 1010 -2.50000000000000e-01 +1007 269 -1.25000000000000e-01 +1007 268 -4.16666666666667e-02 +1007 82 4.16666666666667e-02 +1007 267 8.33333333333333e-02 +1007 81 -8.33333333333333e-02 +1008 1008 2.50000000000000e+00 +1008 1036 1.66666666666667e-01 +1008 1035 -2.50000000000000e-01 +1008 1246 8.33333333333333e-02 +1008 1247 8.33333333333333e-02 +1008 1003 -8.33333333333333e-02 +1008 1004 1.66666666666667e-01 +1008 1010 -3.33333333333333e-01 +1008 1002 -2.50000000000000e-01 +1008 1052 8.33333333333333e-02 +1008 764 -8.33333333333333e-02 +1008 1051 -1.66666666666667e-01 +1008 1001 8.33333333333333e-02 +1008 1009 -3.33333333333333e-01 +1008 1024 1.66666666666667e-01 +1008 1000 8.33333333333333e-02 +1008 1025 1.66666666666667e-01 +1008 763 -8.33333333333333e-02 +1008 1023 -7.50000000000000e-01 +1008 1007 -8.33333333333333e-02 +1008 1240 8.33333333333333e-02 +1008 871 -8.33333333333333e-02 +1008 1006 1.66666666666667e-01 +1008 1005 -2.50000000000000e-01 +1008 872 1.66666666666667e-01 +1008 1241 -1.66666666666667e-01 +1008 870 -2.50000000000000e-01 +1008 1037 -8.33333333333333e-02 +1008 593 -1.66666666666667e-01 +1008 592 8.33333333333333e-02 +1008 596 1.66666666666667e-01 +1008 595 1.66666666666667e-01 +1008 594 -7.50000000000000e-01 +1008 83 -8.33333333333333e-02 +1008 82 -8.33333333333333e-02 +1008 269 8.33333333333333e-02 +1008 268 -1.66666666666667e-01 +1009 1009 2.50000000000000e+00 +1009 1035 1.66666666666667e-01 +1009 1037 1.66666666666667e-01 +1009 1036 -7.50000000000000e-01 +1009 1245 8.33333333333333e-02 +1009 1247 -1.66666666666667e-01 +1009 1002 -8.33333333333333e-02 +1009 1052 8.33333333333333e-02 +1009 1004 1.66666666666667e-01 +1009 1003 -2.50000000000000e-01 +1009 1050 -1.66666666666667e-01 +1009 1025 -8.33333333333333e-02 +1009 1008 -3.33333333333333e-01 +1009 1023 1.66666666666667e-01 +1009 1001 -1.66666666666667e-01 +1009 999 8.33333333333333e-02 +1009 1024 -2.50000000000000e-01 +1009 762 -8.33333333333333e-02 +1009 1007 1.66666666666667e-01 +1009 1010 -3.33333333333333e-01 +1009 872 1.66666666666667e-01 +1009 1239 8.33333333333333e-02 +1009 870 -8.33333333333333e-02 +1009 1006 -7.50000000000000e-01 +1009 1005 1.66666666666667e-01 +1009 1241 8.33333333333333e-02 +1009 764 -8.33333333333333e-02 +1009 871 -2.50000000000000e-01 +1009 591 8.33333333333333e-02 +1009 596 -8.33333333333333e-02 +1009 595 -2.50000000000000e-01 +1009 594 1.66666666666667e-01 +1009 81 -8.33333333333333e-02 +1009 269 8.33333333333333e-02 +1009 83 -8.33333333333333e-02 +1009 267 -1.66666666666667e-01 +1009 593 8.33333333333333e-02 +1010 1010 2.50000000000000e+00 +1010 1035 -8.33333333333333e-02 +1010 1037 -2.50000000000000e-01 +1010 1036 1.66666666666667e-01 +1010 1246 -1.66666666666667e-01 +1010 1245 8.33333333333333e-02 +1010 1051 8.33333333333333e-02 +1010 1002 1.66666666666667e-01 +1010 1008 -3.33333333333333e-01 +1010 1004 -7.50000000000000e-01 +1010 1003 1.66666666666667e-01 +1010 1050 8.33333333333333e-02 +1010 762 -8.33333333333333e-02 +1010 999 8.33333333333333e-02 +1010 1024 -8.33333333333333e-02 +1010 1000 -1.66666666666667e-01 +1010 1025 -2.50000000000000e-01 +1010 1023 1.66666666666667e-01 +1010 1005 -8.33333333333333e-02 +1010 1006 1.66666666666667e-01 +1010 1009 -3.33333333333333e-01 +1010 871 1.66666666666667e-01 +1010 1007 -2.50000000000000e-01 +1010 872 -7.50000000000000e-01 +1010 1240 8.33333333333333e-02 +1010 763 -8.33333333333333e-02 +1010 870 1.66666666666667e-01 +1010 1239 -1.66666666666667e-01 +1010 591 -1.66666666666667e-01 +1010 595 -8.33333333333333e-02 +1010 594 1.66666666666667e-01 +1010 596 -2.50000000000000e-01 +1010 81 -8.33333333333333e-02 +1010 267 8.33333333333333e-02 +1010 268 8.33333333333333e-02 +1010 82 -8.33333333333333e-02 +1010 592 8.33333333333333e-02 +1011 1011 2.50000000000000e+00 +1011 1043 8.33333333333333e-02 +1011 1042 -1.66666666666667e-01 +1011 1018 1.66666666666667e-01 +1011 1017 -7.50000000000000e-01 +1011 956 8.33333333333333e-02 +1011 955 8.33333333333333e-02 +1011 959 1.66666666666667e-01 +1011 958 -8.33333333333333e-02 +1011 957 -2.50000000000000e-01 +1011 1013 -3.33333333333333e-01 +1011 707 -8.33333333333333e-02 +1011 710 -8.33333333333333e-02 +1011 1055 -8.33333333333333e-02 +1011 1052 8.33333333333333e-02 +1011 1028 -1.66666666666667e-01 +1011 1025 1.66666666666667e-01 +1011 1027 8.33333333333333e-02 +1011 1024 -8.33333333333333e-02 +1011 1023 -2.50000000000000e-01 +1011 1054 -8.33333333333333e-02 +1011 1051 8.33333333333333e-02 +1011 791 -8.33333333333333e-02 +1011 1001 8.33333333333333e-02 +1011 790 -8.33333333333333e-02 +1011 793 8.33333333333333e-02 +1011 1000 -1.66666666666667e-01 +1011 706 1.66666666666667e-01 +1011 705 -2.50000000000000e-01 +1011 1004 1.66666666666667e-01 +1011 794 -1.66666666666667e-01 +1011 1003 1.66666666666667e-01 +1011 1012 -3.33333333333333e-01 +1011 709 1.66666666666667e-01 +1011 1002 -7.50000000000000e-01 +1011 1019 1.66666666666667e-01 +1011 708 -2.50000000000000e-01 +1012 1012 2.50000000000000e+00 +1012 1019 -8.33333333333333e-02 +1012 1041 -1.66666666666667e-01 +1012 1018 -2.50000000000000e-01 +1012 1017 1.66666666666667e-01 +1012 956 -1.66666666666667e-01 +1012 954 8.33333333333333e-02 +1012 959 1.66666666666667e-01 +1012 958 -2.50000000000000e-01 +1012 957 -8.33333333333333e-02 +1012 1055 -8.33333333333333e-02 +1012 1028 8.33333333333333e-02 +1012 707 1.66666666666667e-01 +1012 1013 -3.33333333333333e-01 +1012 1025 1.66666666666667e-01 +1012 1024 -2.50000000000000e-01 +1012 1026 8.33333333333333e-02 +1012 1023 -8.33333333333333e-02 +1012 710 1.66666666666667e-01 +1012 1052 -1.66666666666667e-01 +1012 1053 -8.33333333333333e-02 +1012 1050 8.33333333333333e-02 +1012 789 -8.33333333333333e-02 +1012 792 8.33333333333333e-02 +1012 1001 8.33333333333333e-02 +1012 791 -8.33333333333333e-02 +1012 706 -7.50000000000000e-01 +1012 999 -1.66666666666667e-01 +1012 705 1.66666666666667e-01 +1012 1004 -8.33333333333333e-02 +1012 794 8.33333333333333e-02 +1012 1003 -2.50000000000000e-01 +1012 1043 8.33333333333333e-02 +1012 709 -7.50000000000000e-01 +1012 1002 1.66666666666667e-01 +1012 1011 -3.33333333333333e-01 +1012 708 1.66666666666667e-01 +1013 1013 2.50000000000000e+00 +1013 1018 -8.33333333333333e-02 +1013 1017 1.66666666666667e-01 +1013 1041 8.33333333333333e-02 +1013 1019 -2.50000000000000e-01 +1013 954 8.33333333333333e-02 +1013 955 -1.66666666666667e-01 +1013 959 -7.50000000000000e-01 +1013 958 1.66666666666667e-01 +1013 957 1.66666666666667e-01 +1013 1011 -3.33333333333333e-01 +1013 705 -8.33333333333333e-02 +1013 708 -8.33333333333333e-02 +1013 1053 -8.33333333333333e-02 +1013 1050 8.33333333333333e-02 +1013 1054 -8.33333333333333e-02 +1013 1027 8.33333333333333e-02 +1013 1025 -7.50000000000000e-01 +1013 706 1.66666666666667e-01 +1013 1012 -3.33333333333333e-01 +1013 1024 1.66666666666667e-01 +1013 1026 -1.66666666666667e-01 +1013 1023 1.66666666666667e-01 +1013 709 1.66666666666667e-01 +1013 1051 -1.66666666666667e-01 +1013 789 -8.33333333333333e-02 +1013 999 8.33333333333333e-02 +1013 707 -2.50000000000000e-01 +1013 1000 8.33333333333333e-02 +1013 790 -8.33333333333333e-02 +1013 1004 -2.50000000000000e-01 +1013 1042 8.33333333333333e-02 +1013 710 -2.50000000000000e-01 +1013 1003 -8.33333333333333e-02 +1013 793 8.33333333333333e-02 +1013 1002 1.66666666666667e-01 +1013 792 -1.66666666666667e-01 +1014 1014 1.25000000000000e+00 +1014 1019 -8.33333333333333e-02 +1014 964 -4.16666666666667e-02 +1014 955 4.16666666666667e-02 +1014 965 8.33333333333333e-02 +1014 721 8.33333333333333e-02 +1014 1117 -1.66666666666667e-01 +1014 963 -1.25000000000000e-01 +1014 956 -8.33333333333333e-02 +1014 1015 -1.66666666666667e-01 +1014 1018 1.66666666666667e-01 +1014 706 8.33333333333333e-02 +1014 1017 -2.50000000000000e-01 +1014 1127 -8.33333333333333e-02 +1014 1028 8.33333333333333e-02 +1014 722 8.33333333333333e-02 +1014 878 -8.33333333333333e-02 +1014 877 4.16666666666667e-02 +1014 1126 -8.33333333333333e-02 +1014 720 -3.75000000000000e-01 +1014 1016 -1.66666666666667e-01 +1014 875 8.33333333333333e-02 +1014 707 8.33333333333333e-02 +1014 874 -4.16666666666667e-02 +1014 1027 8.33333333333333e-02 +1014 1118 8.33333333333333e-02 +1014 873 -1.25000000000000e-01 +1014 705 -3.75000000000000e-01 +1015 1015 1.25000000000000e+00 +1015 965 8.33333333333333e-02 +1015 1019 1.66666666666667e-01 +1015 963 -4.16666666666667e-02 +1015 954 4.16666666666667e-02 +1015 722 -4.16666666666667e-02 +1015 1118 8.33333333333333e-02 +1015 964 -1.25000000000000e-01 +1015 720 8.33333333333333e-02 +1015 1116 -1.66666666666667e-01 +1015 956 4.16666666666667e-02 +1015 707 -4.16666666666667e-02 +1015 1018 -7.50000000000000e-01 +1015 1014 -1.66666666666667e-01 +1015 1017 1.66666666666667e-01 +1015 705 8.33333333333333e-02 +1015 878 4.16666666666667e-02 +1015 1127 -8.33333333333333e-02 +1015 721 -1.25000000000000e-01 +1015 876 4.16666666666667e-02 +1015 1125 -8.33333333333333e-02 +1015 875 8.33333333333333e-02 +1015 1028 -1.66666666666667e-01 +1015 1016 -1.66666666666667e-01 +1015 874 -1.25000000000000e-01 +1015 706 -1.25000000000000e-01 +1015 873 -4.16666666666667e-02 +1015 1026 8.33333333333333e-02 +1016 1016 1.25000000000000e+00 +1016 1017 -8.33333333333333e-02 +1016 1015 -1.66666666666667e-01 +1016 964 8.33333333333333e-02 +1016 1018 1.66666666666667e-01 +1016 965 -3.75000000000000e-01 +1016 721 -4.16666666666667e-02 +1016 1117 8.33333333333333e-02 +1016 963 8.33333333333333e-02 +1016 1019 -2.50000000000000e-01 +1016 955 4.16666666666667e-02 +1016 706 -4.16666666666667e-02 +1016 954 -8.33333333333333e-02 +1016 877 4.16666666666667e-02 +1016 1126 -8.33333333333333e-02 +1016 1125 -8.33333333333333e-02 +1016 1026 8.33333333333333e-02 +1016 722 -1.25000000000000e-01 +1016 720 8.33333333333333e-02 +1016 876 -8.33333333333333e-02 +1016 1116 8.33333333333333e-02 +1016 875 -3.75000000000000e-01 +1016 707 -1.25000000000000e-01 +1016 874 8.33333333333333e-02 +1016 1027 -1.66666666666667e-01 +1016 1014 -1.66666666666667e-01 +1016 873 8.33333333333333e-02 +1016 705 8.33333333333333e-02 +1017 1017 2.50000000000000e+00 +1017 1054 8.33333333333333e-02 +1017 1159 -8.33333333333333e-02 +1017 1028 1.66666666666667e-01 +1017 1127 -1.66666666666667e-01 +1017 1027 -8.33333333333333e-02 +1017 1126 8.33333333333333e-02 +1017 1160 -8.33333333333333e-02 +1017 1026 -2.50000000000000e-01 +1017 965 8.33333333333333e-02 +1017 1016 -8.33333333333333e-02 +1017 964 8.33333333333333e-02 +1017 1118 1.66666666666667e-01 +1017 1019 -3.33333333333333e-01 +1017 1117 1.66666666666667e-01 +1017 1116 -7.50000000000000e-01 +1017 1015 1.66666666666667e-01 +1017 1014 -2.50000000000000e-01 +1017 1018 -3.33333333333333e-01 +1017 967 -8.33333333333333e-02 +1017 968 1.66666666666667e-01 +1017 959 -1.66666666666667e-01 +1017 1013 1.66666666666667e-01 +1017 955 -8.33333333333333e-02 +1017 958 8.33333333333333e-02 +1017 728 8.33333333333333e-02 +1017 1043 -8.33333333333333e-02 +1017 727 -1.66666666666667e-01 +1017 1042 1.66666666666667e-01 +1017 966 -2.50000000000000e-01 +1017 1041 -2.50000000000000e-01 +1017 956 -8.33333333333333e-02 +1017 707 8.33333333333333e-02 +1017 1012 1.66666666666667e-01 +1017 706 -1.66666666666667e-01 +1017 1055 8.33333333333333e-02 +1017 1011 -7.50000000000000e-01 +1018 1018 2.50000000000000e+00 +1018 1053 8.33333333333333e-02 +1018 1158 -8.33333333333333e-02 +1018 1160 -8.33333333333333e-02 +1018 1127 8.33333333333333e-02 +1018 1026 -8.33333333333333e-02 +1018 1125 8.33333333333333e-02 +1018 1028 1.66666666666667e-01 +1018 1027 -2.50000000000000e-01 +1018 1016 1.66666666666667e-01 +1018 965 -1.66666666666667e-01 +1018 963 8.33333333333333e-02 +1018 1118 -8.33333333333333e-02 +1018 728 8.33333333333333e-02 +1018 1117 -2.50000000000000e-01 +1018 1116 1.66666666666667e-01 +1018 707 8.33333333333333e-02 +1018 1015 -7.50000000000000e-01 +1018 1014 1.66666666666667e-01 +1018 1013 -8.33333333333333e-02 +1018 1017 -3.33333333333333e-01 +1018 966 -8.33333333333333e-02 +1018 959 8.33333333333333e-02 +1018 956 -8.33333333333333e-02 +1018 954 -8.33333333333333e-02 +1018 957 8.33333333333333e-02 +1018 968 1.66666666666667e-01 +1018 1043 1.66666666666667e-01 +1018 1019 -3.33333333333333e-01 +1018 967 -2.50000000000000e-01 +1018 1042 -7.50000000000000e-01 +1018 726 -1.66666666666667e-01 +1018 1041 1.66666666666667e-01 +1018 1055 -1.66666666666667e-01 +1018 1012 -2.50000000000000e-01 +1018 1011 1.66666666666667e-01 +1018 705 -1.66666666666667e-01 +1019 1019 2.50000000000000e+00 +1019 1054 -1.66666666666667e-01 +1019 1159 -8.33333333333333e-02 +1019 1126 8.33333333333333e-02 +1019 1026 1.66666666666667e-01 +1019 1125 -1.66666666666667e-01 +1019 1158 -8.33333333333333e-02 +1019 1028 -7.50000000000000e-01 +1019 1027 1.66666666666667e-01 +1019 963 8.33333333333333e-02 +1019 1014 -8.33333333333333e-02 +1019 1015 1.66666666666667e-01 +1019 964 -1.66666666666667e-01 +1019 1118 -2.50000000000000e-01 +1019 1117 -8.33333333333333e-02 +1019 727 8.33333333333333e-02 +1019 1116 1.66666666666667e-01 +1019 1017 -3.33333333333333e-01 +1019 1016 -2.50000000000000e-01 +1019 706 8.33333333333333e-02 +1019 1012 -8.33333333333333e-02 +1019 958 8.33333333333333e-02 +1019 955 -8.33333333333333e-02 +1019 966 1.66666666666667e-01 +1019 957 -1.66666666666667e-01 +1019 1011 1.66666666666667e-01 +1019 968 -7.50000000000000e-01 +1019 1043 -2.50000000000000e-01 +1019 967 1.66666666666667e-01 +1019 1042 1.66666666666667e-01 +1019 1018 -3.33333333333333e-01 +1019 726 8.33333333333333e-02 +1019 1041 -8.33333333333333e-02 +1019 1053 8.33333333333333e-02 +1019 1013 -2.50000000000000e-01 +1019 954 -8.33333333333333e-02 +1019 705 8.33333333333333e-02 +1020 1020 1.25000000000000e+00 +1020 1021 -1.66666666666667e-01 +1020 1001 -8.33333333333333e-02 +1020 706 -4.16666666666667e-02 +1020 1000 4.16666666666667e-02 +1020 1007 8.33333333333333e-02 +1020 760 -4.16666666666667e-02 +1020 1005 -3.75000000000000e-01 +1020 1240 8.33333333333333e-02 +1020 1025 -8.33333333333333e-02 +1020 1024 1.66666666666667e-01 +1020 1023 -2.50000000000000e-01 +1020 1241 8.33333333333333e-02 +1020 1028 8.33333333333333e-02 +1020 1244 -8.33333333333333e-02 +1020 880 4.16666666666667e-02 +1020 1243 -8.33333333333333e-02 +1020 761 8.33333333333333e-02 +1020 881 -8.33333333333333e-02 +1020 759 -1.25000000000000e-01 +1020 1022 -1.66666666666667e-01 +1020 875 8.33333333333333e-02 +1020 707 8.33333333333333e-02 +1020 874 8.33333333333333e-02 +1020 1027 -1.66666666666667e-01 +1020 1006 8.33333333333333e-02 +1020 873 -3.75000000000000e-01 +1020 705 -1.25000000000000e-01 +1021 1021 1.25000000000000e+00 +1021 1001 4.16666666666667e-02 +1021 1005 8.33333333333333e-02 +1021 1020 -1.66666666666667e-01 +1021 705 -4.16666666666667e-02 +1021 999 4.16666666666667e-02 +1021 1006 -1.25000000000000e-01 +1021 759 -4.16666666666667e-02 +1021 1239 8.33333333333333e-02 +1021 707 8.33333333333333e-02 +1021 1022 -1.66666666666667e-01 +1021 1025 1.66666666666667e-01 +1021 1024 -7.50000000000000e-01 +1021 1023 1.66666666666667e-01 +1021 761 8.33333333333333e-02 +1021 1241 -1.66666666666667e-01 +1021 879 4.16666666666667e-02 +1021 1242 -8.33333333333333e-02 +1021 881 4.16666666666667e-02 +1021 1244 -8.33333333333333e-02 +1021 760 -1.25000000000000e-01 +1021 875 -4.16666666666667e-02 +1021 1028 8.33333333333333e-02 +1021 1007 -4.16666666666667e-02 +1021 874 -1.25000000000000e-01 +1021 706 -1.25000000000000e-01 +1021 873 8.33333333333333e-02 +1021 1026 -1.66666666666667e-01 +1022 1022 1.25000000000000e+00 +1022 1000 4.16666666666667e-02 +1022 999 -8.33333333333333e-02 +1022 1007 -1.25000000000000e-01 +1022 1005 8.33333333333333e-02 +1022 1025 -2.50000000000000e-01 +1022 706 8.33333333333333e-02 +1022 1021 -1.66666666666667e-01 +1022 1024 1.66666666666667e-01 +1022 1023 -8.33333333333333e-02 +1022 760 8.33333333333333e-02 +1022 1240 -1.66666666666667e-01 +1022 1239 8.33333333333333e-02 +1022 1026 8.33333333333333e-02 +1022 1242 -8.33333333333333e-02 +1022 761 -3.75000000000000e-01 +1022 880 4.16666666666667e-02 +1022 1243 -8.33333333333333e-02 +1022 759 8.33333333333333e-02 +1022 879 -8.33333333333333e-02 +1022 1006 -4.16666666666667e-02 +1022 875 -1.25000000000000e-01 +1022 707 -3.75000000000000e-01 +1022 874 -4.16666666666667e-02 +1022 1027 8.33333333333333e-02 +1022 1020 -1.66666666666667e-01 +1022 873 8.33333333333333e-02 +1022 705 8.33333333333333e-02 +1023 1023 2.50000000000000e+00 +1023 1004 -1.66666666666667e-01 +1023 1007 8.33333333333333e-02 +1023 1001 -8.33333333333333e-02 +1023 1006 -1.66666666666667e-01 +1023 1009 1.66666666666667e-01 +1023 1000 -8.33333333333333e-02 +1023 1010 1.66666666666667e-01 +1023 1008 -7.50000000000000e-01 +1023 1243 8.33333333333333e-02 +1023 1240 -8.33333333333333e-02 +1023 1244 -1.66666666666667e-01 +1023 1241 1.66666666666667e-01 +1023 707 8.33333333333333e-02 +1023 1022 -8.33333333333333e-02 +1023 1021 1.66666666666667e-01 +1023 1024 -3.33333333333333e-01 +1023 1020 -2.50000000000000e-01 +1023 764 8.33333333333333e-02 +1023 1239 -2.50000000000000e-01 +1023 1052 -8.33333333333333e-02 +1023 1055 8.33333333333333e-02 +1023 1253 -8.33333333333333e-02 +1023 1027 1.66666666666667e-01 +1023 1054 -1.66666666666667e-01 +1023 1051 1.66666666666667e-01 +1023 1028 1.66666666666667e-01 +1023 1013 1.66666666666667e-01 +1023 1025 -3.33333333333333e-01 +1023 706 8.33333333333333e-02 +1023 1012 -8.33333333333333e-02 +1023 1026 -7.50000000000000e-01 +1023 1011 -2.50000000000000e-01 +1023 1252 -8.33333333333333e-02 +1023 763 8.33333333333333e-02 +1023 1003 8.33333333333333e-02 +1023 1050 -2.50000000000000e-01 +1024 1024 2.50000000000000e+00 +1024 1004 8.33333333333333e-02 +1024 1001 -8.33333333333333e-02 +1024 1007 8.33333333333333e-02 +1024 1010 -8.33333333333333e-02 +1024 1005 -1.66666666666667e-01 +1024 1008 1.66666666666667e-01 +1024 999 -8.33333333333333e-02 +1024 1009 -2.50000000000000e-01 +1024 1242 8.33333333333333e-02 +1024 1239 -8.33333333333333e-02 +1024 1244 8.33333333333333e-02 +1024 1022 1.66666666666667e-01 +1024 1021 -7.50000000000000e-01 +1024 1020 1.66666666666667e-01 +1024 1023 -3.33333333333333e-01 +1024 1241 1.66666666666667e-01 +1024 1240 -2.50000000000000e-01 +1024 1025 -3.33333333333333e-01 +1024 1028 -8.33333333333333e-02 +1024 1026 1.66666666666667e-01 +1024 1055 8.33333333333333e-02 +1024 1253 -8.33333333333333e-02 +1024 1053 -1.66666666666667e-01 +1024 1050 1.66666666666667e-01 +1024 707 -1.66666666666667e-01 +1024 1013 1.66666666666667e-01 +1024 1027 -2.50000000000000e-01 +1024 1012 -2.50000000000000e-01 +1024 705 8.33333333333333e-02 +1024 1011 -8.33333333333333e-02 +1024 1052 1.66666666666667e-01 +1024 764 -1.66666666666667e-01 +1024 1002 8.33333333333333e-02 +1024 1051 -7.50000000000000e-01 +1024 1251 -8.33333333333333e-02 +1024 762 8.33333333333333e-02 +1025 1025 2.50000000000000e+00 +1025 1002 -1.66666666666667e-01 +1025 1000 -8.33333333333333e-02 +1025 1005 8.33333333333333e-02 +1025 999 -8.33333333333333e-02 +1025 1006 8.33333333333333e-02 +1025 1009 -8.33333333333333e-02 +1025 1010 -2.50000000000000e-01 +1025 1008 1.66666666666667e-01 +1025 1243 8.33333333333333e-02 +1025 1242 -1.66666666666667e-01 +1025 1239 1.66666666666667e-01 +1025 1022 -2.50000000000000e-01 +1025 1021 1.66666666666667e-01 +1025 705 8.33333333333333e-02 +1025 1020 -8.33333333333333e-02 +1025 1241 -7.50000000000000e-01 +1025 1240 1.66666666666667e-01 +1025 762 8.33333333333333e-02 +1025 1024 -3.33333333333333e-01 +1025 1050 -8.33333333333333e-02 +1025 1027 -8.33333333333333e-02 +1025 1053 8.33333333333333e-02 +1025 1251 -8.33333333333333e-02 +1025 1054 8.33333333333333e-02 +1025 1252 -8.33333333333333e-02 +1025 1028 -2.50000000000000e-01 +1025 1013 -7.50000000000000e-01 +1025 706 -1.66666666666667e-01 +1025 1012 1.66666666666667e-01 +1025 1026 1.66666666666667e-01 +1025 1011 1.66666666666667e-01 +1025 1023 -3.33333333333333e-01 +1025 1003 8.33333333333333e-02 +1025 1052 -2.50000000000000e-01 +1025 1051 1.66666666666667e-01 +1025 763 -1.66666666666667e-01 +1026 1026 2.50000000000000e+00 +1026 1018 -8.33333333333333e-02 +1026 1160 8.33333333333333e-02 +1026 1159 -1.66666666666667e-01 +1026 1017 -2.50000000000000e-01 +1026 1016 8.33333333333333e-02 +1026 1126 1.66666666666667e-01 +1026 1127 1.66666666666667e-01 +1026 1125 -7.50000000000000e-01 +1026 1015 8.33333333333333e-02 +1026 1028 -3.33333333333333e-01 +1026 707 -8.33333333333333e-02 +1026 770 -8.33333333333333e-02 +1026 1055 -8.33333333333333e-02 +1026 1253 8.33333333333333e-02 +1026 1054 1.66666666666667e-01 +1026 1027 -3.33333333333333e-01 +1026 1024 1.66666666666667e-01 +1026 1013 -1.66666666666667e-01 +1026 1025 1.66666666666667e-01 +1026 706 -8.33333333333333e-02 +1026 1012 8.33333333333333e-02 +1026 1023 -7.50000000000000e-01 +1026 769 -8.33333333333333e-02 +1026 1252 8.33333333333333e-02 +1026 1053 -2.50000000000000e-01 +1026 875 -8.33333333333333e-02 +1026 1022 8.33333333333333e-02 +1026 886 8.33333333333333e-02 +1026 1243 -8.33333333333333e-02 +1026 1021 -1.66666666666667e-01 +1026 874 1.66666666666667e-01 +1026 873 -2.50000000000000e-01 +1026 1244 1.66666666666667e-01 +1026 887 -1.66666666666667e-01 +1026 1242 -2.50000000000000e-01 +1026 1019 1.66666666666667e-01 +1027 1027 2.50000000000000e+00 +1027 1017 -8.33333333333333e-02 +1027 1158 -1.66666666666667e-01 +1027 1019 1.66666666666667e-01 +1027 1018 -2.50000000000000e-01 +1027 1127 -8.33333333333333e-02 +1027 1125 1.66666666666667e-01 +1027 1126 -2.50000000000000e-01 +1027 1016 -1.66666666666667e-01 +1027 1014 8.33333333333333e-02 +1027 1013 8.33333333333333e-02 +1027 1025 -8.33333333333333e-02 +1027 1053 1.66666666666667e-01 +1027 1026 -3.33333333333333e-01 +1027 1023 1.66666666666667e-01 +1027 1024 -2.50000000000000e-01 +1027 705 -8.33333333333333e-02 +1027 1011 8.33333333333333e-02 +1027 1055 1.66666666666667e-01 +1027 1253 -1.66666666666667e-01 +1027 1054 -7.50000000000000e-01 +1027 768 -8.33333333333333e-02 +1027 1251 8.33333333333333e-02 +1027 875 1.66666666666667e-01 +1027 1028 -3.33333333333333e-01 +1027 1244 1.66666666666667e-01 +1027 885 8.33333333333333e-02 +1027 1242 -8.33333333333333e-02 +1027 1022 8.33333333333333e-02 +1027 707 -8.33333333333333e-02 +1027 874 -7.50000000000000e-01 +1027 1020 -1.66666666666667e-01 +1027 873 1.66666666666667e-01 +1027 887 8.33333333333333e-02 +1027 770 -8.33333333333333e-02 +1027 1243 -2.50000000000000e-01 +1027 1160 8.33333333333333e-02 +1028 1028 2.50000000000000e+00 +1028 1017 1.66666666666667e-01 +1028 1158 8.33333333333333e-02 +1028 1019 -7.50000000000000e-01 +1028 1018 1.66666666666667e-01 +1028 1126 -8.33333333333333e-02 +1028 1014 8.33333333333333e-02 +1028 1127 -2.50000000000000e-01 +1028 1125 1.66666666666667e-01 +1028 1015 -1.66666666666667e-01 +1028 1026 -3.33333333333333e-01 +1028 705 -8.33333333333333e-02 +1028 768 -8.33333333333333e-02 +1028 1012 8.33333333333333e-02 +1028 1024 -8.33333333333333e-02 +1028 1053 -8.33333333333333e-02 +1028 1251 8.33333333333333e-02 +1028 1025 -2.50000000000000e-01 +1028 1011 -1.66666666666667e-01 +1028 1023 1.66666666666667e-01 +1028 1055 -2.50000000000000e-01 +1028 1054 1.66666666666667e-01 +1028 1252 -1.66666666666667e-01 +1028 873 -8.33333333333333e-02 +1028 1020 8.33333333333333e-02 +1028 874 1.66666666666667e-01 +1028 1027 -3.33333333333333e-01 +1028 1243 1.66666666666667e-01 +1028 875 -2.50000000000000e-01 +1028 1021 8.33333333333333e-02 +1028 706 -8.33333333333333e-02 +1028 1244 -7.50000000000000e-01 +1028 1159 8.33333333333333e-02 +1028 886 8.33333333333333e-02 +1028 769 -8.33333333333333e-02 +1028 1242 1.66666666666667e-01 +1028 885 -1.66666666666667e-01 +1029 1029 2.50000000000000e+00 +1029 1034 -8.33333333333333e-02 +1029 1045 -1.66666666666667e-01 +1029 1033 1.66666666666667e-01 +1029 1032 -2.50000000000000e-01 +1029 974 1.66666666666667e-01 +1029 973 -8.33333333333333e-02 +1029 972 -2.50000000000000e-01 +1029 1058 -8.33333333333333e-02 +1029 1040 8.33333333333333e-02 +1029 1031 -3.33333333333333e-01 +1029 1037 1.66666666666667e-01 +1029 1039 8.33333333333333e-02 +1029 1036 -8.33333333333333e-02 +1029 1035 -2.50000000000000e-01 +1029 710 1.66666666666667e-01 +1029 1052 -1.66666666666667e-01 +1029 1057 -8.33333333333333e-02 +1029 1051 8.33333333333333e-02 +1029 793 8.33333333333333e-02 +1029 1004 -8.33333333333333e-02 +1029 794 8.33333333333333e-02 +1029 1030 -3.33333333333333e-01 +1029 1003 1.66666666666667e-01 +1029 709 1.66666666666667e-01 +1029 1046 8.33333333333333e-02 +1029 1002 -2.50000000000000e-01 +1029 708 -7.50000000000000e-01 +1029 587 -1.66666666666667e-01 +1029 586 8.33333333333333e-02 +1029 86 1.66666666666667e-01 +1029 190 -8.33333333333333e-02 +1029 593 8.33333333333333e-02 +1029 191 -8.33333333333333e-02 +1029 85 1.66666666666667e-01 +1029 592 -1.66666666666667e-01 +1029 84 -7.50000000000000e-01 +1030 1030 2.50000000000000e+00 +1030 1046 8.33333333333333e-02 +1030 1044 -1.66666666666667e-01 +1030 1033 -7.50000000000000e-01 +1030 1032 1.66666666666667e-01 +1030 974 1.66666666666667e-01 +1030 973 -2.50000000000000e-01 +1030 972 -8.33333333333333e-02 +1030 1031 -3.33333333333333e-01 +1030 710 -8.33333333333333e-02 +1030 1052 8.33333333333333e-02 +1030 1058 -8.33333333333333e-02 +1030 1040 -1.66666666666667e-01 +1030 1037 1.66666666666667e-01 +1030 1036 -2.50000000000000e-01 +1030 1038 8.33333333333333e-02 +1030 1035 -8.33333333333333e-02 +1030 1056 -8.33333333333333e-02 +1030 1050 8.33333333333333e-02 +1030 792 8.33333333333333e-02 +1030 1004 1.66666666666667e-01 +1030 794 -1.66666666666667e-01 +1030 1034 1.66666666666667e-01 +1030 1003 -7.50000000000000e-01 +1030 709 -2.50000000000000e-01 +1030 1029 -3.33333333333333e-01 +1030 1002 1.66666666666667e-01 +1030 708 1.66666666666667e-01 +1030 587 8.33333333333333e-02 +1030 585 8.33333333333333e-02 +1030 86 -8.33333333333333e-02 +1030 593 8.33333333333333e-02 +1030 191 -8.33333333333333e-02 +1030 189 -8.33333333333333e-02 +1030 85 -2.50000000000000e-01 +1030 84 1.66666666666667e-01 +1030 591 -1.66666666666667e-01 +1031 1031 2.50000000000000e+00 +1031 1032 -8.33333333333333e-02 +1031 1033 1.66666666666667e-01 +1031 1045 8.33333333333333e-02 +1031 1034 -2.50000000000000e-01 +1031 974 -7.50000000000000e-01 +1031 973 1.66666666666667e-01 +1031 972 1.66666666666667e-01 +1031 1030 -3.33333333333333e-01 +1031 709 -8.33333333333333e-02 +1031 1051 8.33333333333333e-02 +1031 1057 -8.33333333333333e-02 +1031 1056 -8.33333333333333e-02 +1031 1038 8.33333333333333e-02 +1031 1037 -7.50000000000000e-01 +1031 1039 -1.66666666666667e-01 +1031 1036 1.66666666666667e-01 +1031 1029 -3.33333333333333e-01 +1031 1035 1.66666666666667e-01 +1031 708 1.66666666666667e-01 +1031 1050 -1.66666666666667e-01 +1031 1044 8.33333333333333e-02 +1031 1004 -2.50000000000000e-01 +1031 710 -2.50000000000000e-01 +1031 1003 1.66666666666667e-01 +1031 793 -1.66666666666667e-01 +1031 1002 -8.33333333333333e-02 +1031 792 8.33333333333333e-02 +1031 586 8.33333333333333e-02 +1031 585 -1.66666666666667e-01 +1031 85 -8.33333333333333e-02 +1031 84 1.66666666666667e-01 +1031 592 8.33333333333333e-02 +1031 190 -8.33333333333333e-02 +1031 86 -2.50000000000000e-01 +1031 591 8.33333333333333e-02 +1031 189 -8.33333333333333e-02 +1032 1032 2.50000000000000e+00 +1032 1057 8.33333333333333e-02 +1032 1219 -8.33333333333333e-02 +1032 1214 8.33333333333333e-02 +1032 1220 -8.33333333333333e-02 +1032 1213 8.33333333333333e-02 +1032 1039 -8.33333333333333e-02 +1032 1040 1.66666666666667e-01 +1032 1038 -2.50000000000000e-01 +1032 746 8.33333333333333e-02 +1032 1211 -8.33333333333333e-02 +1032 1210 1.66666666666667e-01 +1032 1209 -2.50000000000000e-01 +1032 1031 -8.33333333333333e-02 +1032 1033 -3.33333333333333e-01 +1032 979 -8.33333333333333e-02 +1032 974 8.33333333333333e-02 +1032 973 8.33333333333333e-02 +1032 980 1.66666666666667e-01 +1032 1046 1.66666666666667e-01 +1032 1034 -3.33333333333333e-01 +1032 745 -1.66666666666667e-01 +1032 1045 1.66666666666667e-01 +1032 978 -2.50000000000000e-01 +1032 1044 -7.50000000000000e-01 +1032 1030 1.66666666666667e-01 +1032 1058 -1.66666666666667e-01 +1032 1029 -2.50000000000000e-01 +1032 590 -1.66666666666667e-01 +1032 599 1.66666666666667e-01 +1032 589 8.33333333333333e-02 +1032 86 8.33333333333333e-02 +1032 598 1.66666666666667e-01 +1032 597 -7.50000000000000e-01 +1032 587 -8.33333333333333e-02 +1032 586 -8.33333333333333e-02 +1032 85 -1.66666666666667e-01 +1033 1033 2.50000000000000e+00 +1033 1056 8.33333333333333e-02 +1033 1218 -8.33333333333333e-02 +1033 1214 -1.66666666666667e-01 +1033 1040 1.66666666666667e-01 +1033 1212 8.33333333333333e-02 +1033 1038 -8.33333333333333e-02 +1033 1220 -8.33333333333333e-02 +1033 1039 -2.50000000000000e-01 +1033 1211 1.66666666666667e-01 +1033 1034 -3.33333333333333e-01 +1033 1210 -7.50000000000000e-01 +1033 1209 1.66666666666667e-01 +1033 1032 -3.33333333333333e-01 +1033 978 -8.33333333333333e-02 +1033 980 1.66666666666667e-01 +1033 974 -1.66666666666667e-01 +1033 1031 1.66666666666667e-01 +1033 972 8.33333333333333e-02 +1033 746 8.33333333333333e-02 +1033 1046 -8.33333333333333e-02 +1033 979 -2.50000000000000e-01 +1033 1045 -2.50000000000000e-01 +1033 744 -1.66666666666667e-01 +1033 1044 1.66666666666667e-01 +1033 1058 8.33333333333333e-02 +1033 1030 -7.50000000000000e-01 +1033 1029 1.66666666666667e-01 +1033 590 8.33333333333333e-02 +1033 599 -8.33333333333333e-02 +1033 588 8.33333333333333e-02 +1033 598 -2.50000000000000e-01 +1033 597 1.66666666666667e-01 +1033 585 -8.33333333333333e-02 +1033 587 -8.33333333333333e-02 +1033 86 8.33333333333333e-02 +1033 84 -1.66666666666667e-01 +1034 1034 2.50000000000000e+00 +1034 1056 -1.66666666666667e-01 +1034 1212 8.33333333333333e-02 +1034 1218 -8.33333333333333e-02 +1034 1213 -1.66666666666667e-01 +1034 1039 1.66666666666667e-01 +1034 1219 -8.33333333333333e-02 +1034 1040 -7.50000000000000e-01 +1034 1038 1.66666666666667e-01 +1034 1211 -2.50000000000000e-01 +1034 1210 1.66666666666667e-01 +1034 1033 -3.33333333333333e-01 +1034 744 8.33333333333333e-02 +1034 1209 -8.33333333333333e-02 +1034 1029 -8.33333333333333e-02 +1034 979 1.66666666666667e-01 +1034 972 8.33333333333333e-02 +1034 973 -1.66666666666667e-01 +1034 1030 1.66666666666667e-01 +1034 980 -7.50000000000000e-01 +1034 1046 -2.50000000000000e-01 +1034 745 8.33333333333333e-02 +1034 1045 -8.33333333333333e-02 +1034 978 1.66666666666667e-01 +1034 1044 1.66666666666667e-01 +1034 1032 -3.33333333333333e-01 +1034 1057 8.33333333333333e-02 +1034 1031 -2.50000000000000e-01 +1034 589 8.33333333333333e-02 +1034 598 -8.33333333333333e-02 +1034 588 -1.66666666666667e-01 +1034 597 1.66666666666667e-01 +1034 599 -2.50000000000000e-01 +1034 84 8.33333333333333e-02 +1034 585 -8.33333333333333e-02 +1034 586 -8.33333333333333e-02 +1034 85 8.33333333333333e-02 +1035 1035 2.50000000000000e+00 +1035 1004 8.33333333333333e-02 +1035 1010 -8.33333333333333e-02 +1035 1009 1.66666666666667e-01 +1035 1008 -2.50000000000000e-01 +1035 1249 8.33333333333333e-02 +1035 1246 -8.33333333333333e-02 +1035 1250 8.33333333333333e-02 +1035 1036 -3.33333333333333e-01 +1035 1247 1.66666666666667e-01 +1035 1245 -2.50000000000000e-01 +1035 1037 -3.33333333333333e-01 +1035 1040 -8.33333333333333e-02 +1035 1039 1.66666666666667e-01 +1035 1256 -8.33333333333333e-02 +1035 1058 8.33333333333333e-02 +1035 1057 -1.66666666666667e-01 +1035 1051 1.66666666666667e-01 +1035 1031 1.66666666666667e-01 +1035 1030 -8.33333333333333e-02 +1035 1038 -2.50000000000000e-01 +1035 1029 -2.50000000000000e-01 +1035 1052 1.66666666666667e-01 +1035 764 -1.66666666666667e-01 +1035 1255 -8.33333333333333e-02 +1035 763 8.33333333333333e-02 +1035 1003 8.33333333333333e-02 +1035 1050 -7.50000000000000e-01 +1035 593 -8.33333333333333e-02 +1035 596 8.33333333333333e-02 +1035 595 -1.66666666666667e-01 +1035 592 -8.33333333333333e-02 +1035 602 1.66666666666667e-01 +1035 601 1.66666666666667e-01 +1035 600 -7.50000000000000e-01 +1035 86 -1.66666666666667e-01 +1035 85 8.33333333333333e-02 +1036 1036 2.50000000000000e+00 +1036 1004 -1.66666666666667e-01 +1036 1008 1.66666666666667e-01 +1036 1010 1.66666666666667e-01 +1036 1009 -7.50000000000000e-01 +1036 1248 8.33333333333333e-02 +1036 1245 -8.33333333333333e-02 +1036 1247 1.66666666666667e-01 +1036 1250 -1.66666666666667e-01 +1036 1035 -3.33333333333333e-01 +1036 764 8.33333333333333e-02 +1036 1246 -2.50000000000000e-01 +1036 1052 -8.33333333333333e-02 +1036 1058 8.33333333333333e-02 +1036 1256 -8.33333333333333e-02 +1036 1038 1.66666666666667e-01 +1036 1056 -1.66666666666667e-01 +1036 1050 1.66666666666667e-01 +1036 1040 1.66666666666667e-01 +1036 1031 1.66666666666667e-01 +1036 1037 -3.33333333333333e-01 +1036 1039 -7.50000000000000e-01 +1036 1030 -2.50000000000000e-01 +1036 1029 -8.33333333333333e-02 +1036 1002 8.33333333333333e-02 +1036 1051 -2.50000000000000e-01 +1036 1254 -8.33333333333333e-02 +1036 762 8.33333333333333e-02 +1036 593 -8.33333333333333e-02 +1036 596 8.33333333333333e-02 +1036 594 -1.66666666666667e-01 +1036 591 -8.33333333333333e-02 +1036 602 -8.33333333333333e-02 +1036 86 8.33333333333333e-02 +1036 601 -2.50000000000000e-01 +1036 600 1.66666666666667e-01 +1036 84 8.33333333333333e-02 +1037 1037 2.50000000000000e+00 +1037 1002 8.33333333333333e-02 +1037 1008 -8.33333333333333e-02 +1037 1010 -2.50000000000000e-01 +1037 1009 1.66666666666667e-01 +1037 1246 1.66666666666667e-01 +1037 1249 -1.66666666666667e-01 +1037 1248 8.33333333333333e-02 +1037 1247 -7.50000000000000e-01 +1037 763 8.33333333333333e-02 +1037 1245 1.66666666666667e-01 +1037 1051 -8.33333333333333e-02 +1037 1035 -3.33333333333333e-01 +1037 1038 -8.33333333333333e-02 +1037 1057 8.33333333333333e-02 +1037 1255 -8.33333333333333e-02 +1037 1254 -8.33333333333333e-02 +1037 1056 8.33333333333333e-02 +1037 1040 -2.50000000000000e-01 +1037 1031 -7.50000000000000e-01 +1037 1039 1.66666666666667e-01 +1037 1030 1.66666666666667e-01 +1037 1036 -3.33333333333333e-01 +1037 1029 1.66666666666667e-01 +1037 1003 -1.66666666666667e-01 +1037 1052 -2.50000000000000e-01 +1037 1050 1.66666666666667e-01 +1037 762 -1.66666666666667e-01 +1037 591 -8.33333333333333e-02 +1037 592 -8.33333333333333e-02 +1037 595 8.33333333333333e-02 +1037 594 8.33333333333333e-02 +1037 602 -2.50000000000000e-01 +1037 601 -8.33333333333333e-02 +1037 85 8.33333333333333e-02 +1037 600 1.66666666666667e-01 +1037 84 -1.66666666666667e-01 +1038 1038 2.50000000000000e+00 +1038 1033 -8.33333333333333e-02 +1038 1219 -1.66666666666667e-01 +1038 1034 1.66666666666667e-01 +1038 1032 -2.50000000000000e-01 +1038 1214 -8.33333333333333e-02 +1038 1213 1.66666666666667e-01 +1038 1212 -2.50000000000000e-01 +1038 1031 8.33333333333333e-02 +1038 1037 -8.33333333333333e-02 +1038 1039 -3.33333333333333e-01 +1038 1057 1.66666666666667e-01 +1038 1036 1.66666666666667e-01 +1038 1058 1.66666666666667e-01 +1038 1256 -1.66666666666667e-01 +1038 778 -8.33333333333333e-02 +1038 1255 8.33333333333333e-02 +1038 1056 -7.50000000000000e-01 +1038 1030 8.33333333333333e-02 +1038 1035 -2.50000000000000e-01 +1038 1040 -3.33333333333333e-01 +1038 1250 1.66666666666667e-01 +1038 904 8.33333333333333e-02 +1038 1249 -8.33333333333333e-02 +1038 905 8.33333333333333e-02 +1038 779 -8.33333333333333e-02 +1038 1248 -2.50000000000000e-01 +1038 1220 8.33333333333333e-02 +1038 599 -1.66666666666667e-01 +1038 598 8.33333333333333e-02 +1038 85 -8.33333333333333e-02 +1038 317 1.66666666666667e-01 +1038 602 8.33333333333333e-02 +1038 86 -8.33333333333333e-02 +1038 316 1.66666666666667e-01 +1038 601 -1.66666666666667e-01 +1038 315 -7.50000000000000e-01 +1039 1039 2.50000000000000e+00 +1039 1032 -8.33333333333333e-02 +1039 1220 8.33333333333333e-02 +1039 1218 -1.66666666666667e-01 +1039 1033 -2.50000000000000e-01 +1039 1212 1.66666666666667e-01 +1039 1214 1.66666666666667e-01 +1039 1213 -7.50000000000000e-01 +1039 1040 -3.33333333333333e-01 +1039 779 -8.33333333333333e-02 +1039 1058 -8.33333333333333e-02 +1039 1256 8.33333333333333e-02 +1039 1038 -3.33333333333333e-01 +1039 1056 1.66666666666667e-01 +1039 1035 1.66666666666667e-01 +1039 1057 -2.50000000000000e-01 +1039 777 -8.33333333333333e-02 +1039 1254 8.33333333333333e-02 +1039 1031 -1.66666666666667e-01 +1039 1037 1.66666666666667e-01 +1039 1036 -7.50000000000000e-01 +1039 1029 8.33333333333333e-02 +1039 903 8.33333333333333e-02 +1039 1248 -8.33333333333333e-02 +1039 905 -1.66666666666667e-01 +1039 1250 1.66666666666667e-01 +1039 1249 -2.50000000000000e-01 +1039 1034 1.66666666666667e-01 +1039 599 8.33333333333333e-02 +1039 597 8.33333333333333e-02 +1039 86 -8.33333333333333e-02 +1039 84 -8.33333333333333e-02 +1039 317 -8.33333333333333e-02 +1039 602 8.33333333333333e-02 +1039 316 -2.50000000000000e-01 +1039 315 1.66666666666667e-01 +1039 600 -1.66666666666667e-01 +1040 1040 2.50000000000000e+00 +1040 1033 1.66666666666667e-01 +1040 1219 8.33333333333333e-02 +1040 1034 -7.50000000000000e-01 +1040 1032 1.66666666666667e-01 +1040 1212 -8.33333333333333e-02 +1040 1214 -2.50000000000000e-01 +1040 1213 1.66666666666667e-01 +1040 1039 -3.33333333333333e-01 +1040 778 -8.33333333333333e-02 +1040 1029 8.33333333333333e-02 +1040 1035 -8.33333333333333e-02 +1040 1057 -8.33333333333333e-02 +1040 1255 8.33333333333333e-02 +1040 1058 -2.50000000000000e-01 +1040 1056 1.66666666666667e-01 +1040 1254 -1.66666666666667e-01 +1040 1037 -2.50000000000000e-01 +1040 1030 -1.66666666666667e-01 +1040 1036 1.66666666666667e-01 +1040 1038 -3.33333333333333e-01 +1040 1248 1.66666666666667e-01 +1040 1250 -7.50000000000000e-01 +1040 1218 8.33333333333333e-02 +1040 904 -1.66666666666667e-01 +1040 1249 1.66666666666667e-01 +1040 903 8.33333333333333e-02 +1040 777 -8.33333333333333e-02 +1040 598 8.33333333333333e-02 +1040 597 -1.66666666666667e-01 +1040 85 -8.33333333333333e-02 +1040 316 -8.33333333333333e-02 +1040 601 8.33333333333333e-02 +1040 315 1.66666666666667e-01 +1040 317 -2.50000000000000e-01 +1040 600 8.33333333333333e-02 +1040 84 -8.33333333333333e-02 +1041 1041 2.50000000000000e+00 +1041 988 -8.33333333333333e-02 +1041 983 -1.66666666666667e-01 +1041 989 1.66666666666667e-01 +1041 987 -2.50000000000000e-01 +1041 1154 8.33333333333333e-02 +1041 1153 -1.66666666666667e-01 +1041 1049 -8.33333333333333e-02 +1041 1048 1.66666666666667e-01 +1041 1047 -2.50000000000000e-01 +1041 958 -8.33333333333333e-02 +1041 967 8.33333333333333e-02 +1041 968 8.33333333333333e-02 +1041 1019 -8.33333333333333e-02 +1041 727 1.66666666666667e-01 +1041 1042 -3.33333333333333e-01 +1041 1018 1.66666666666667e-01 +1041 1017 -2.50000000000000e-01 +1041 959 -8.33333333333333e-02 +1041 1013 8.33333333333333e-02 +1041 709 1.66666666666667e-01 +1041 1012 -1.66666666666667e-01 +1041 911 -8.33333333333333e-02 +1041 908 8.33333333333333e-02 +1041 728 1.66666666666667e-01 +1041 1160 -1.66666666666667e-01 +1041 1159 8.33333333333333e-02 +1041 910 -8.33333333333333e-02 +1041 726 -7.50000000000000e-01 +1041 1043 -3.33333333333333e-01 +1041 1055 1.66666666666667e-01 +1041 710 1.66666666666667e-01 +1041 1054 -8.33333333333333e-02 +1041 907 8.33333333333333e-02 +1041 982 8.33333333333333e-02 +1041 1053 -2.50000000000000e-01 +1041 708 -7.50000000000000e-01 +1042 1042 2.50000000000000e+00 +1042 987 -8.33333333333333e-02 +1042 989 1.66666666666667e-01 +1042 983 8.33333333333333e-02 +1042 988 -2.50000000000000e-01 +1042 1154 8.33333333333333e-02 +1042 1152 -1.66666666666667e-01 +1042 1049 1.66666666666667e-01 +1042 1048 -7.50000000000000e-01 +1042 1047 1.66666666666667e-01 +1042 1043 -3.33333333333333e-01 +1042 710 -8.33333333333333e-02 +1042 728 -8.33333333333333e-02 +1042 1013 8.33333333333333e-02 +1042 959 -8.33333333333333e-02 +1042 957 -8.33333333333333e-02 +1042 966 8.33333333333333e-02 +1042 968 -1.66666666666667e-01 +1042 1019 1.66666666666667e-01 +1042 1018 -7.50000000000000e-01 +1042 726 1.66666666666667e-01 +1042 1041 -3.33333333333333e-01 +1042 1017 1.66666666666667e-01 +1042 708 1.66666666666667e-01 +1042 1011 -1.66666666666667e-01 +1042 1160 8.33333333333333e-02 +1042 911 -8.33333333333333e-02 +1042 727 -2.50000000000000e-01 +1042 1158 8.33333333333333e-02 +1042 909 -8.33333333333333e-02 +1042 1055 1.66666666666667e-01 +1042 908 -1.66666666666667e-01 +1042 981 8.33333333333333e-02 +1042 1054 -2.50000000000000e-01 +1042 709 -2.50000000000000e-01 +1042 1053 -8.33333333333333e-02 +1042 906 8.33333333333333e-02 +1043 1043 2.50000000000000e+00 +1043 982 8.33333333333333e-02 +1043 981 -1.66666666666667e-01 +1043 989 -7.50000000000000e-01 +1043 987 1.66666666666667e-01 +1043 1153 8.33333333333333e-02 +1043 1152 8.33333333333333e-02 +1043 1049 -2.50000000000000e-01 +1043 1048 1.66666666666667e-01 +1043 1047 -8.33333333333333e-02 +1043 1042 -3.33333333333333e-01 +1043 709 -8.33333333333333e-02 +1043 727 -8.33333333333333e-02 +1043 1012 8.33333333333333e-02 +1043 958 -8.33333333333333e-02 +1043 1019 -2.50000000000000e-01 +1043 967 -1.66666666666667e-01 +1043 1018 1.66666666666667e-01 +1043 966 8.33333333333333e-02 +1043 1017 -8.33333333333333e-02 +1043 957 -8.33333333333333e-02 +1043 1011 8.33333333333333e-02 +1043 1159 8.33333333333333e-02 +1043 910 -8.33333333333333e-02 +1043 909 -8.33333333333333e-02 +1043 906 8.33333333333333e-02 +1043 728 -2.50000000000000e-01 +1043 726 1.66666666666667e-01 +1043 1158 -1.66666666666667e-01 +1043 988 1.66666666666667e-01 +1043 1055 -7.50000000000000e-01 +1043 710 -2.50000000000000e-01 +1043 1054 1.66666666666667e-01 +1043 907 -1.66666666666667e-01 +1043 1041 -3.33333333333333e-01 +1043 1053 1.66666666666667e-01 +1043 708 1.66666666666667e-01 +1044 1044 2.50000000000000e+00 +1044 994 -8.33333333333333e-02 +1044 995 1.66666666666667e-01 +1044 983 8.33333333333333e-02 +1044 993 -2.50000000000000e-01 +1044 1217 8.33333333333333e-02 +1044 1216 -1.66666666666667e-01 +1044 1049 1.66666666666667e-01 +1044 1048 1.66666666666667e-01 +1044 1047 -7.50000000000000e-01 +1044 1046 -3.33333333333333e-01 +1044 746 -8.33333333333333e-02 +1044 710 -8.33333333333333e-02 +1044 974 -8.33333333333333e-02 +1044 1031 8.33333333333333e-02 +1044 973 -8.33333333333333e-02 +1044 979 8.33333333333333e-02 +1044 980 -1.66666666666667e-01 +1044 1034 1.66666666666667e-01 +1044 745 1.66666666666667e-01 +1044 1045 -3.33333333333333e-01 +1044 1033 1.66666666666667e-01 +1044 1032 -7.50000000000000e-01 +1044 709 1.66666666666667e-01 +1044 1030 -1.66666666666667e-01 +1044 914 -8.33333333333333e-02 +1044 1220 8.33333333333333e-02 +1044 1219 8.33333333333333e-02 +1044 913 -8.33333333333333e-02 +1044 744 -2.50000000000000e-01 +1044 1058 1.66666666666667e-01 +1044 908 -1.66666666666667e-01 +1044 1057 -8.33333333333333e-02 +1044 907 8.33333333333333e-02 +1044 1056 -2.50000000000000e-01 +1044 982 8.33333333333333e-02 +1044 708 -2.50000000000000e-01 +1045 1045 2.50000000000000e+00 +1045 993 -8.33333333333333e-02 +1045 983 -1.66666666666667e-01 +1045 995 1.66666666666667e-01 +1045 994 -2.50000000000000e-01 +1045 1217 8.33333333333333e-02 +1045 1215 -1.66666666666667e-01 +1045 1049 -8.33333333333333e-02 +1045 1048 -2.50000000000000e-01 +1045 1047 1.66666666666667e-01 +1045 972 -8.33333333333333e-02 +1045 978 8.33333333333333e-02 +1045 980 8.33333333333333e-02 +1045 1034 -8.33333333333333e-02 +1045 1033 -2.50000000000000e-01 +1045 744 1.66666666666667e-01 +1045 1044 -3.33333333333333e-01 +1045 1032 1.66666666666667e-01 +1045 974 -8.33333333333333e-02 +1045 1031 8.33333333333333e-02 +1045 708 1.66666666666667e-01 +1045 1029 -1.66666666666667e-01 +1045 914 -8.33333333333333e-02 +1045 908 8.33333333333333e-02 +1045 1220 -1.66666666666667e-01 +1045 746 1.66666666666667e-01 +1045 745 -7.50000000000000e-01 +1045 1218 8.33333333333333e-02 +1045 912 -8.33333333333333e-02 +1045 1058 1.66666666666667e-01 +1045 1046 -3.33333333333333e-01 +1045 710 1.66666666666667e-01 +1045 1057 -2.50000000000000e-01 +1045 981 8.33333333333333e-02 +1045 709 -7.50000000000000e-01 +1045 1056 -8.33333333333333e-02 +1045 906 8.33333333333333e-02 +1046 1046 2.50000000000000e+00 +1046 982 -1.66666666666667e-01 +1046 981 8.33333333333333e-02 +1046 995 -7.50000000000000e-01 +1046 994 1.66666666666667e-01 +1046 1215 8.33333333333333e-02 +1046 1216 8.33333333333333e-02 +1046 1049 -2.50000000000000e-01 +1046 1048 -8.33333333333333e-02 +1046 1047 1.66666666666667e-01 +1046 1044 -3.33333333333333e-01 +1046 744 -8.33333333333333e-02 +1046 708 -8.33333333333333e-02 +1046 972 -8.33333333333333e-02 +1046 1029 8.33333333333333e-02 +1046 1034 -2.50000000000000e-01 +1046 979 8.33333333333333e-02 +1046 1033 -8.33333333333333e-02 +1046 978 -1.66666666666667e-01 +1046 1032 1.66666666666667e-01 +1046 973 -8.33333333333333e-02 +1046 1030 8.33333333333333e-02 +1046 912 -8.33333333333333e-02 +1046 1218 8.33333333333333e-02 +1046 913 -8.33333333333333e-02 +1046 907 8.33333333333333e-02 +1046 746 -2.50000000000000e-01 +1046 1219 -1.66666666666667e-01 +1046 745 1.66666666666667e-01 +1046 1058 -7.50000000000000e-01 +1046 993 1.66666666666667e-01 +1046 710 -2.50000000000000e-01 +1046 1057 1.66666666666667e-01 +1046 1045 -3.33333333333333e-01 +1046 709 1.66666666666667e-01 +1046 1056 1.66666666666667e-01 +1046 906 -1.66666666666667e-01 +1047 1047 2.50000000000000e+00 +1047 995 -1.66666666666667e-01 +1047 1217 -8.33333333333333e-02 +1047 913 8.33333333333333e-02 +1047 914 8.33333333333333e-02 +1047 1216 1.66666666666667e-01 +1047 1215 -2.50000000000000e-01 +1047 1046 1.66666666666667e-01 +1047 1045 1.66666666666667e-01 +1047 1044 -7.50000000000000e-01 +1047 982 -8.33333333333333e-02 +1047 983 -8.33333333333333e-02 +1047 997 -8.33333333333333e-02 +1047 988 8.33333333333333e-02 +1047 989 8.33333333333333e-02 +1047 998 1.66666666666667e-01 +1047 1049 -3.33333333333333e-01 +1047 996 -2.50000000000000e-01 +1047 907 -8.33333333333333e-02 +1047 1048 -3.33333333333333e-01 +1047 1154 1.66666666666667e-01 +1047 916 -8.33333333333333e-02 +1047 910 8.33333333333333e-02 +1047 908 1.66666666666667e-01 +1047 911 -1.66666666666667e-01 +1047 752 8.33333333333333e-02 +1047 917 -8.33333333333333e-02 +1047 1153 1.66666666666667e-01 +1047 751 -1.66666666666667e-01 +1047 1152 -7.50000000000000e-01 +1047 1043 -8.33333333333333e-02 +1047 710 8.33333333333333e-02 +1047 1042 1.66666666666667e-01 +1047 709 -1.66666666666667e-01 +1047 1041 -2.50000000000000e-01 +1047 994 8.33333333333333e-02 +1047 906 -2.50000000000000e-01 +1048 1048 2.50000000000000e+00 +1048 995 8.33333333333333e-02 +1048 1217 1.66666666666667e-01 +1048 912 8.33333333333333e-02 +1048 914 -1.66666666666667e-01 +1048 1216 -7.50000000000000e-01 +1048 1215 1.66666666666667e-01 +1048 1046 -8.33333333333333e-02 +1048 1045 -2.50000000000000e-01 +1048 1044 1.66666666666667e-01 +1048 981 -8.33333333333333e-02 +1048 998 1.66666666666667e-01 +1048 996 -8.33333333333333e-02 +1048 987 8.33333333333333e-02 +1048 989 -1.66666666666667e-01 +1048 752 8.33333333333333e-02 +1048 997 -2.50000000000000e-01 +1048 983 -8.33333333333333e-02 +1048 710 8.33333333333333e-02 +1048 906 -8.33333333333333e-02 +1048 1154 -8.33333333333333e-02 +1048 1047 -3.33333333333333e-01 +1048 915 -8.33333333333333e-02 +1048 909 8.33333333333333e-02 +1048 917 -8.33333333333333e-02 +1048 911 8.33333333333333e-02 +1048 1153 -2.50000000000000e-01 +1048 1152 1.66666666666667e-01 +1048 750 -1.66666666666667e-01 +1048 1043 1.66666666666667e-01 +1048 1049 -3.33333333333333e-01 +1048 908 1.66666666666667e-01 +1048 1042 -7.50000000000000e-01 +1048 993 8.33333333333333e-02 +1048 907 -2.50000000000000e-01 +1048 1041 1.66666666666667e-01 +1048 708 -1.66666666666667e-01 +1049 1049 2.50000000000000e+00 +1049 993 -1.66666666666667e-01 +1049 1215 -8.33333333333333e-02 +1049 1216 1.66666666666667e-01 +1049 913 -1.66666666666667e-01 +1049 912 8.33333333333333e-02 +1049 1217 -2.50000000000000e-01 +1049 1046 -2.50000000000000e-01 +1049 1045 -8.33333333333333e-02 +1049 1044 1.66666666666667e-01 +1049 981 -8.33333333333333e-02 +1049 997 1.66666666666667e-01 +1049 988 -1.66666666666667e-01 +1049 987 8.33333333333333e-02 +1049 998 -7.50000000000000e-01 +1049 751 8.33333333333333e-02 +1049 996 1.66666666666667e-01 +1049 1047 -3.33333333333333e-01 +1049 982 -8.33333333333333e-02 +1049 709 8.33333333333333e-02 +1049 1153 -8.33333333333333e-02 +1049 1152 1.66666666666667e-01 +1049 916 -8.33333333333333e-02 +1049 910 8.33333333333333e-02 +1049 906 1.66666666666667e-01 +1049 909 -1.66666666666667e-01 +1049 1154 -2.50000000000000e-01 +1049 750 8.33333333333333e-02 +1049 915 -8.33333333333333e-02 +1049 1043 -2.50000000000000e-01 +1049 994 8.33333333333333e-02 +1049 908 -7.50000000000000e-01 +1049 1042 1.66666666666667e-01 +1049 1048 -3.33333333333333e-01 +1049 907 1.66666666666667e-01 +1049 1041 -8.33333333333333e-02 +1049 708 8.33333333333333e-02 +1050 1050 2.50000000000000e+00 +1050 1031 -1.66666666666667e-01 +1050 1030 8.33333333333333e-02 +1050 1037 1.66666666666667e-01 +1050 1035 -7.50000000000000e-01 +1050 1255 8.33333333333333e-02 +1050 1256 8.33333333333333e-02 +1050 1058 -8.33333333333333e-02 +1050 1057 1.66666666666667e-01 +1050 1056 -2.50000000000000e-01 +1050 1003 -8.33333333333333e-02 +1050 1004 -8.33333333333333e-02 +1050 1010 8.33333333333333e-02 +1050 1009 -1.66666666666667e-01 +1050 1013 8.33333333333333e-02 +1050 1025 -8.33333333333333e-02 +1050 1051 -3.33333333333333e-01 +1050 1024 1.66666666666667e-01 +1050 1012 8.33333333333333e-02 +1050 709 -8.33333333333333e-02 +1050 763 -8.33333333333333e-02 +1050 1023 -2.50000000000000e-01 +1050 908 8.33333333333333e-02 +1050 920 -8.33333333333333e-02 +1050 1252 8.33333333333333e-02 +1050 919 -8.33333333333333e-02 +1050 764 1.66666666666667e-01 +1050 1253 -1.66666666666667e-01 +1050 762 -2.50000000000000e-01 +1050 1052 -3.33333333333333e-01 +1050 1055 1.66666666666667e-01 +1050 710 1.66666666666667e-01 +1050 1054 1.66666666666667e-01 +1050 907 -1.66666666666667e-01 +1050 1036 1.66666666666667e-01 +1050 1053 -7.50000000000000e-01 +1050 708 -2.50000000000000e-01 +1051 1051 2.50000000000000e+00 +1051 1037 -8.33333333333333e-02 +1051 1035 1.66666666666667e-01 +1051 1029 8.33333333333333e-02 +1051 1036 -2.50000000000000e-01 +1051 1254 8.33333333333333e-02 +1051 1256 -1.66666666666667e-01 +1051 1058 1.66666666666667e-01 +1051 1057 -7.50000000000000e-01 +1051 1056 1.66666666666667e-01 +1051 1002 -8.33333333333333e-02 +1051 1004 -8.33333333333333e-02 +1051 1010 8.33333333333333e-02 +1051 1008 -1.66666666666667e-01 +1051 1050 -3.33333333333333e-01 +1051 1023 1.66666666666667e-01 +1051 1013 -1.66666666666667e-01 +1051 710 1.66666666666667e-01 +1051 1011 8.33333333333333e-02 +1051 708 -8.33333333333333e-02 +1051 1025 1.66666666666667e-01 +1051 1052 -3.33333333333333e-01 +1051 764 1.66666666666667e-01 +1051 1024 -7.50000000000000e-01 +1051 762 -8.33333333333333e-02 +1051 1251 8.33333333333333e-02 +1051 918 -8.33333333333333e-02 +1051 1253 8.33333333333333e-02 +1051 920 -8.33333333333333e-02 +1051 763 -2.50000000000000e-01 +1051 1055 -8.33333333333333e-02 +1051 908 8.33333333333333e-02 +1051 1031 8.33333333333333e-02 +1051 1054 -2.50000000000000e-01 +1051 709 -2.50000000000000e-01 +1051 1053 1.66666666666667e-01 +1051 906 -1.66666666666667e-01 +1052 1052 2.50000000000000e+00 +1052 1036 -8.33333333333333e-02 +1052 1029 -1.66666666666667e-01 +1052 1037 -2.50000000000000e-01 +1052 1035 1.66666666666667e-01 +1052 1255 -1.66666666666667e-01 +1052 1254 8.33333333333333e-02 +1052 1058 -2.50000000000000e-01 +1052 1057 1.66666666666667e-01 +1052 1056 -8.33333333333333e-02 +1052 1003 -8.33333333333333e-02 +1052 1009 8.33333333333333e-02 +1052 1002 -8.33333333333333e-02 +1052 1008 8.33333333333333e-02 +1052 1011 8.33333333333333e-02 +1052 1023 -8.33333333333333e-02 +1052 1012 -1.66666666666667e-01 +1052 709 1.66666666666667e-01 +1052 1025 -2.50000000000000e-01 +1052 1024 1.66666666666667e-01 +1052 1051 -3.33333333333333e-01 +1052 763 1.66666666666667e-01 +1052 906 8.33333333333333e-02 +1052 918 -8.33333333333333e-02 +1052 764 -7.50000000000000e-01 +1052 1252 8.33333333333333e-02 +1052 919 -8.33333333333333e-02 +1052 762 1.66666666666667e-01 +1052 1251 -1.66666666666667e-01 +1052 1030 8.33333333333333e-02 +1052 1055 -2.50000000000000e-01 +1052 710 -7.50000000000000e-01 +1052 1054 -8.33333333333333e-02 +1052 907 8.33333333333333e-02 +1052 1050 -3.33333333333333e-01 +1052 1053 1.66666666666667e-01 +1052 708 1.66666666666667e-01 +1053 1053 2.50000000000000e+00 +1053 1018 8.33333333333333e-02 +1053 1159 1.66666666666667e-01 +1053 911 8.33333333333333e-02 +1053 910 -1.66666666666667e-01 +1053 1160 1.66666666666667e-01 +1053 1158 -7.50000000000000e-01 +1053 1043 1.66666666666667e-01 +1053 1042 -8.33333333333333e-02 +1053 1041 -2.50000000000000e-01 +1053 1013 -8.33333333333333e-02 +1053 1028 -8.33333333333333e-02 +1053 1025 8.33333333333333e-02 +1053 1027 1.66666666666667e-01 +1053 1024 -1.66666666666667e-01 +1053 769 8.33333333333333e-02 +1053 1026 -2.50000000000000e-01 +1053 1012 -8.33333333333333e-02 +1053 709 8.33333333333333e-02 +1053 908 -8.33333333333333e-02 +1053 1055 -3.33333333333333e-01 +1053 1252 -8.33333333333333e-02 +1053 923 -8.33333333333333e-02 +1053 920 8.33333333333333e-02 +1053 922 -8.33333333333333e-02 +1053 919 8.33333333333333e-02 +1053 1253 1.66666666666667e-01 +1053 770 -1.66666666666667e-01 +1053 1251 -2.50000000000000e-01 +1053 1052 1.66666666666667e-01 +1053 710 -1.66666666666667e-01 +1053 1051 1.66666666666667e-01 +1053 1054 -3.33333333333333e-01 +1053 907 1.66666666666667e-01 +1053 1050 -7.50000000000000e-01 +1053 1019 8.33333333333333e-02 +1053 906 -2.50000000000000e-01 +1054 1054 2.50000000000000e+00 +1054 1017 8.33333333333333e-02 +1054 1160 -8.33333333333333e-02 +1054 911 8.33333333333333e-02 +1054 1158 1.66666666666667e-01 +1054 909 -1.66666666666667e-01 +1054 1159 -2.50000000000000e-01 +1054 1043 1.66666666666667e-01 +1054 1042 -2.50000000000000e-01 +1054 1041 -8.33333333333333e-02 +1054 1013 -8.33333333333333e-02 +1054 1026 1.66666666666667e-01 +1054 1025 8.33333333333333e-02 +1054 1023 -1.66666666666667e-01 +1054 1028 1.66666666666667e-01 +1054 1055 -3.33333333333333e-01 +1054 1027 -7.50000000000000e-01 +1054 768 8.33333333333333e-02 +1054 1011 -8.33333333333333e-02 +1054 708 8.33333333333333e-02 +1054 1251 -8.33333333333333e-02 +1054 1253 1.66666666666667e-01 +1054 908 1.66666666666667e-01 +1054 920 -1.66666666666667e-01 +1054 921 -8.33333333333333e-02 +1054 918 8.33333333333333e-02 +1054 770 8.33333333333333e-02 +1054 923 -8.33333333333333e-02 +1054 1252 -2.50000000000000e-01 +1054 1052 -8.33333333333333e-02 +1054 710 8.33333333333333e-02 +1054 1051 -2.50000000000000e-01 +1054 1019 -1.66666666666667e-01 +1054 907 -7.50000000000000e-01 +1054 1050 1.66666666666667e-01 +1054 1053 -3.33333333333333e-01 +1054 906 1.66666666666667e-01 +1055 1055 2.50000000000000e+00 +1055 1018 -1.66666666666667e-01 +1055 1159 -8.33333333333333e-02 +1055 910 8.33333333333333e-02 +1055 909 8.33333333333333e-02 +1055 1160 -2.50000000000000e-01 +1055 1158 1.66666666666667e-01 +1055 1043 -7.50000000000000e-01 +1055 1042 1.66666666666667e-01 +1055 1041 1.66666666666667e-01 +1055 1011 -8.33333333333333e-02 +1055 1012 -8.33333333333333e-02 +1055 1026 -8.33333333333333e-02 +1055 1023 8.33333333333333e-02 +1055 1024 8.33333333333333e-02 +1055 1028 -2.50000000000000e-01 +1055 1027 1.66666666666667e-01 +1055 1054 -3.33333333333333e-01 +1055 906 -8.33333333333333e-02 +1055 1053 -3.33333333333333e-01 +1055 1252 1.66666666666667e-01 +1055 921 -8.33333333333333e-02 +1055 918 8.33333333333333e-02 +1055 907 1.66666666666667e-01 +1055 919 -1.66666666666667e-01 +1055 1253 -7.50000000000000e-01 +1055 769 8.33333333333333e-02 +1055 922 -8.33333333333333e-02 +1055 1251 1.66666666666667e-01 +1055 768 -1.66666666666667e-01 +1055 1052 -2.50000000000000e-01 +1055 1017 8.33333333333333e-02 +1055 908 -2.50000000000000e-01 +1055 1051 -8.33333333333333e-02 +1055 709 8.33333333333333e-02 +1055 1050 1.66666666666667e-01 +1055 708 -1.66666666666667e-01 +1056 1056 2.50000000000000e+00 +1056 1033 8.33333333333333e-02 +1056 914 8.33333333333333e-02 +1056 1220 -8.33333333333333e-02 +1056 1219 1.66666666666667e-01 +1056 913 -1.66666666666667e-01 +1056 1218 -2.50000000000000e-01 +1056 1046 1.66666666666667e-01 +1056 1045 -8.33333333333333e-02 +1056 1044 -2.50000000000000e-01 +1056 1031 -8.33333333333333e-02 +1056 1039 1.66666666666667e-01 +1056 1037 8.33333333333333e-02 +1056 1036 -1.66666666666667e-01 +1056 1040 1.66666666666667e-01 +1056 1058 -3.33333333333333e-01 +1056 778 8.33333333333333e-02 +1056 1038 -7.50000000000000e-01 +1056 1030 -8.33333333333333e-02 +1056 709 8.33333333333333e-02 +1056 1255 -8.33333333333333e-02 +1056 1256 1.66666666666667e-01 +1056 908 1.66666666666667e-01 +1056 920 -1.66666666666667e-01 +1056 925 -8.33333333333333e-02 +1056 919 8.33333333333333e-02 +1056 779 8.33333333333333e-02 +1056 926 -8.33333333333333e-02 +1056 1254 -2.50000000000000e-01 +1056 1052 -8.33333333333333e-02 +1056 710 8.33333333333333e-02 +1056 1057 -3.33333333333333e-01 +1056 1051 1.66666666666667e-01 +1056 907 1.66666666666667e-01 +1056 1034 -1.66666666666667e-01 +1056 1050 -2.50000000000000e-01 +1056 906 -7.50000000000000e-01 +1057 1057 2.50000000000000e+00 +1057 1032 8.33333333333333e-02 +1057 1218 1.66666666666667e-01 +1057 914 8.33333333333333e-02 +1057 912 -1.66666666666667e-01 +1057 1220 1.66666666666667e-01 +1057 1219 -7.50000000000000e-01 +1057 1046 1.66666666666667e-01 +1057 1045 -2.50000000000000e-01 +1057 1044 -8.33333333333333e-02 +1057 1031 -8.33333333333333e-02 +1057 1040 -8.33333333333333e-02 +1057 1037 8.33333333333333e-02 +1057 1038 1.66666666666667e-01 +1057 1035 -1.66666666666667e-01 +1057 1039 -2.50000000000000e-01 +1057 777 8.33333333333333e-02 +1057 1029 -8.33333333333333e-02 +1057 708 8.33333333333333e-02 +1057 908 -8.33333333333333e-02 +1057 1058 -3.33333333333333e-01 +1057 1254 -8.33333333333333e-02 +1057 926 -8.33333333333333e-02 +1057 920 8.33333333333333e-02 +1057 924 -8.33333333333333e-02 +1057 918 8.33333333333333e-02 +1057 779 -1.66666666666667e-01 +1057 1256 1.66666666666667e-01 +1057 1255 -2.50000000000000e-01 +1057 1052 1.66666666666667e-01 +1057 710 -1.66666666666667e-01 +1057 1034 8.33333333333333e-02 +1057 1051 -7.50000000000000e-01 +1057 907 -2.50000000000000e-01 +1057 1056 -3.33333333333333e-01 +1057 1050 1.66666666666667e-01 +1057 906 1.66666666666667e-01 +1058 1058 2.50000000000000e+00 +1058 1032 -1.66666666666667e-01 +1058 912 8.33333333333333e-02 +1058 1218 -8.33333333333333e-02 +1058 913 8.33333333333333e-02 +1058 1220 -2.50000000000000e-01 +1058 1219 1.66666666666667e-01 +1058 1046 -7.50000000000000e-01 +1058 1045 1.66666666666667e-01 +1058 1044 1.66666666666667e-01 +1058 1030 -8.33333333333333e-02 +1058 1029 -8.33333333333333e-02 +1058 1039 -8.33333333333333e-02 +1058 1036 8.33333333333333e-02 +1058 1035 8.33333333333333e-02 +1058 1040 -2.50000000000000e-01 +1058 1038 1.66666666666667e-01 +1058 1056 -3.33333333333333e-01 +1058 907 -8.33333333333333e-02 +1058 1057 -3.33333333333333e-01 +1058 925 -8.33333333333333e-02 +1058 919 8.33333333333333e-02 +1058 1254 1.66666666666667e-01 +1058 906 1.66666666666667e-01 +1058 918 -1.66666666666667e-01 +1058 1256 -7.50000000000000e-01 +1058 778 -1.66666666666667e-01 +1058 1255 1.66666666666667e-01 +1058 777 8.33333333333333e-02 +1058 924 -8.33333333333333e-02 +1058 1033 8.33333333333333e-02 +1058 1052 -2.50000000000000e-01 +1058 908 -2.50000000000000e-01 +1058 1051 1.66666666666667e-01 +1058 709 -1.66666666666667e-01 +1058 1050 -8.33333333333333e-02 +1058 708 8.33333333333333e-02 +1059 1059 1.25000000000000e+00 +1059 1103 -8.33333333333333e-02 +1059 1075 8.33333333333333e-02 +1059 1102 -8.33333333333333e-02 +1059 1099 -8.33333333333333e-02 +1059 1070 8.33333333333333e-02 +1059 1076 -1.66666666666667e-01 +1059 1069 8.33333333333333e-02 +1059 1068 -3.75000000000000e-01 +1059 806 8.33333333333333e-02 +1059 1061 -1.66666666666667e-01 +1059 1067 1.66666666666667e-01 +1059 1096 8.33333333333333e-02 +1059 1066 -8.33333333333333e-02 +1059 713 -4.16666666666667e-02 +1059 800 4.16666666666667e-02 +1059 712 8.33333333333333e-02 +1059 799 -8.33333333333333e-02 +1059 711 -1.25000000000000e-01 +1059 1065 -2.50000000000000e-01 +1059 719 -4.16666666666667e-02 +1059 1097 8.33333333333333e-02 +1059 1060 -1.66666666666667e-01 +1059 718 8.33333333333333e-02 +1059 805 8.33333333333333e-02 +1059 1100 4.16666666666667e-02 +1059 717 -1.25000000000000e-01 +1059 804 -3.75000000000000e-01 +1060 1060 1.25000000000000e+00 +1060 1101 -8.33333333333333e-02 +1060 1100 4.16666666666667e-02 +1060 1103 -8.33333333333333e-02 +1060 1098 -8.33333333333333e-02 +1060 1070 -4.16666666666667e-02 +1060 1076 8.33333333333333e-02 +1060 1069 -1.25000000000000e-01 +1060 1068 8.33333333333333e-02 +1060 806 -4.16666666666667e-02 +1060 800 4.16666666666667e-02 +1060 1095 8.33333333333333e-02 +1060 1065 -8.33333333333333e-02 +1060 713 8.33333333333333e-02 +1060 1061 -1.66666666666667e-01 +1060 1067 1.66666666666667e-01 +1060 712 -3.75000000000000e-01 +1060 1066 -2.50000000000000e-01 +1060 711 8.33333333333333e-02 +1060 798 -8.33333333333333e-02 +1060 719 8.33333333333333e-02 +1060 1097 -1.66666666666667e-01 +1060 1074 8.33333333333333e-02 +1060 718 -3.75000000000000e-01 +1060 805 -1.25000000000000e-01 +1060 1059 -1.66666666666667e-01 +1060 717 8.33333333333333e-02 +1060 804 8.33333333333333e-02 +1061 1061 1.25000000000000e+00 +1061 1101 -8.33333333333333e-02 +1061 1099 4.16666666666667e-02 +1061 1102 -8.33333333333333e-02 +1061 1070 -1.25000000000000e-01 +1061 1069 -4.16666666666667e-02 +1061 1075 8.33333333333333e-02 +1061 1068 8.33333333333333e-02 +1061 1074 -1.66666666666667e-01 +1061 805 -4.16666666666667e-02 +1061 799 4.16666666666667e-02 +1061 804 8.33333333333333e-02 +1061 1059 -1.66666666666667e-01 +1061 1065 1.66666666666667e-01 +1061 713 -1.25000000000000e-01 +1061 1067 -7.50000000000000e-01 +1061 712 8.33333333333333e-02 +1061 1060 -1.66666666666667e-01 +1061 1066 1.66666666666667e-01 +1061 711 -4.16666666666667e-02 +1061 798 4.16666666666667e-02 +1061 1098 4.16666666666667e-02 +1061 719 -1.25000000000000e-01 +1061 806 -1.25000000000000e-01 +1061 718 8.33333333333333e-02 +1061 1096 -1.66666666666667e-01 +1061 717 -4.16666666666667e-02 +1061 1095 8.33333333333333e-02 +1062 1062 1.25000000000000e+00 +1062 1073 8.33333333333333e-02 +1062 1072 8.33333333333333e-02 +1062 1071 -3.75000000000000e-01 +1062 1136 -8.33333333333333e-02 +1062 1138 -8.33333333333333e-02 +1062 1076 8.33333333333333e-02 +1062 1075 -1.66666666666667e-01 +1062 1139 -8.33333333333333e-02 +1062 1133 8.33333333333333e-02 +1062 1067 -8.33333333333333e-02 +1062 1063 -1.66666666666667e-01 +1062 1066 1.66666666666667e-01 +1062 811 8.33333333333333e-02 +1062 713 8.33333333333333e-02 +1062 800 -8.33333333333333e-02 +1062 712 -4.16666666666667e-02 +1062 799 4.16666666666667e-02 +1062 711 -1.25000000000000e-01 +1062 1065 -2.50000000000000e-01 +1062 1064 -1.66666666666667e-01 +1062 725 8.33333333333333e-02 +1062 812 8.33333333333333e-02 +1062 724 -4.16666666666667e-02 +1062 1132 8.33333333333333e-02 +1062 1135 4.16666666666667e-02 +1062 723 -1.25000000000000e-01 +1062 810 -3.75000000000000e-01 +1063 1063 1.25000000000000e+00 +1063 1073 -4.16666666666667e-02 +1063 1072 -1.25000000000000e-01 +1063 1071 8.33333333333333e-02 +1063 1136 4.16666666666667e-02 +1063 1076 8.33333333333333e-02 +1063 1139 -8.33333333333333e-02 +1063 1137 -8.33333333333333e-02 +1063 1074 -1.66666666666667e-01 +1063 800 4.16666666666667e-02 +1063 812 -4.16666666666667e-02 +1063 1062 -1.66666666666667e-01 +1063 1065 1.66666666666667e-01 +1063 810 8.33333333333333e-02 +1063 713 8.33333333333333e-02 +1063 1064 -1.66666666666667e-01 +1063 1067 1.66666666666667e-01 +1063 712 -1.25000000000000e-01 +1063 1066 -7.50000000000000e-01 +1063 711 -4.16666666666667e-02 +1063 798 4.16666666666667e-02 +1063 725 8.33333333333333e-02 +1063 1133 -1.66666666666667e-01 +1063 1134 4.16666666666667e-02 +1063 724 -1.25000000000000e-01 +1063 811 -1.25000000000000e-01 +1063 723 -4.16666666666667e-02 +1063 1131 8.33333333333333e-02 +1064 1064 1.25000000000000e+00 +1064 1072 -4.16666666666667e-02 +1064 1071 8.33333333333333e-02 +1064 1135 4.16666666666667e-02 +1064 1134 -8.33333333333333e-02 +1064 1075 8.33333333333333e-02 +1064 1138 -8.33333333333333e-02 +1064 1074 8.33333333333333e-02 +1064 1137 -8.33333333333333e-02 +1064 1131 8.33333333333333e-02 +1064 1065 -8.33333333333333e-02 +1064 799 4.16666666666667e-02 +1064 811 -4.16666666666667e-02 +1064 713 -3.75000000000000e-01 +1064 1067 -2.50000000000000e-01 +1064 712 8.33333333333333e-02 +1064 1063 -1.66666666666667e-01 +1064 1066 1.66666666666667e-01 +1064 711 8.33333333333333e-02 +1064 798 -8.33333333333333e-02 +1064 1073 -1.25000000000000e-01 +1064 725 -3.75000000000000e-01 +1064 812 -1.25000000000000e-01 +1064 724 8.33333333333333e-02 +1064 1132 -1.66666666666667e-01 +1064 1062 -1.66666666666667e-01 +1064 723 8.33333333333333e-02 +1064 810 8.33333333333333e-02 +1065 1065 2.50000000000000e+00 +1065 1102 -1.66666666666667e-01 +1065 1061 1.66666666666667e-01 +1065 805 8.33333333333333e-02 +1065 1060 -8.33333333333333e-02 +1065 806 -1.66666666666667e-01 +1065 1059 -2.50000000000000e-01 +1065 1097 -8.33333333333333e-02 +1065 1096 1.66666666666667e-01 +1065 1095 -2.50000000000000e-01 +1065 1168 -8.33333333333333e-02 +1065 1076 1.66666666666667e-01 +1065 1139 -1.66666666666667e-01 +1065 1138 8.33333333333333e-02 +1065 713 8.33333333333333e-02 +1065 1075 1.66666666666667e-01 +1065 1066 -3.33333333333333e-01 +1065 1074 -7.50000000000000e-01 +1065 1169 -8.33333333333333e-02 +1065 731 8.33333333333333e-02 +1065 1064 -8.33333333333333e-02 +1065 1063 1.66666666666667e-01 +1065 800 -8.33333333333333e-02 +1065 812 8.33333333333333e-02 +1065 817 1.66666666666667e-01 +1065 811 -1.66666666666667e-01 +1065 712 8.33333333333333e-02 +1065 799 -8.33333333333333e-02 +1065 1062 -2.50000000000000e-01 +1065 1067 -3.33333333333333e-01 +1065 1133 1.66666666666667e-01 +1065 818 1.66666666666667e-01 +1065 1132 -8.33333333333333e-02 +1065 730 8.33333333333333e-02 +1065 1103 8.33333333333333e-02 +1065 1131 -2.50000000000000e-01 +1065 816 -7.50000000000000e-01 +1066 1066 2.50000000000000e+00 +1066 1101 -1.66666666666667e-01 +1066 804 8.33333333333333e-02 +1066 1059 -8.33333333333333e-02 +1066 806 8.33333333333333e-02 +1066 1061 1.66666666666667e-01 +1066 1060 -2.50000000000000e-01 +1066 1097 1.66666666666667e-01 +1066 1096 -7.50000000000000e-01 +1066 1095 1.66666666666667e-01 +1066 1169 -8.33333333333333e-02 +1066 1167 -8.33333333333333e-02 +1066 1076 -8.33333333333333e-02 +1066 1139 8.33333333333333e-02 +1066 1137 8.33333333333333e-02 +1066 1075 -2.50000000000000e-01 +1066 1074 1.66666666666667e-01 +1066 1065 -3.33333333333333e-01 +1066 818 -8.33333333333333e-02 +1066 1067 -3.33333333333333e-01 +1066 800 -8.33333333333333e-02 +1066 812 8.33333333333333e-02 +1066 1062 1.66666666666667e-01 +1066 816 1.66666666666667e-01 +1066 810 -1.66666666666667e-01 +1066 713 -1.66666666666667e-01 +1066 1064 1.66666666666667e-01 +1066 1063 -7.50000000000000e-01 +1066 711 8.33333333333333e-02 +1066 798 -8.33333333333333e-02 +1066 1133 1.66666666666667e-01 +1066 731 -1.66666666666667e-01 +1066 1103 8.33333333333333e-02 +1066 1132 -2.50000000000000e-01 +1066 817 -2.50000000000000e-01 +1066 1131 -8.33333333333333e-02 +1066 729 8.33333333333333e-02 +1067 1067 2.50000000000000e+00 +1067 1101 8.33333333333333e-02 +1067 1059 1.66666666666667e-01 +1067 805 8.33333333333333e-02 +1067 804 -1.66666666666667e-01 +1067 1061 -7.50000000000000e-01 +1067 1060 1.66666666666667e-01 +1067 1097 -2.50000000000000e-01 +1067 1096 1.66666666666667e-01 +1067 1095 -8.33333333333333e-02 +1067 1168 -8.33333333333333e-02 +1067 1075 -8.33333333333333e-02 +1067 1138 8.33333333333333e-02 +1067 1074 1.66666666666667e-01 +1067 1137 -1.66666666666667e-01 +1067 1076 -2.50000000000000e-01 +1067 711 8.33333333333333e-02 +1067 1167 -8.33333333333333e-02 +1067 729 8.33333333333333e-02 +1067 817 -8.33333333333333e-02 +1067 1066 -3.33333333333333e-01 +1067 1062 -8.33333333333333e-02 +1067 799 -8.33333333333333e-02 +1067 811 8.33333333333333e-02 +1067 798 -8.33333333333333e-02 +1067 810 8.33333333333333e-02 +1067 1064 -2.50000000000000e-01 +1067 712 -1.66666666666667e-01 +1067 1063 1.66666666666667e-01 +1067 1102 8.33333333333333e-02 +1067 1133 -7.50000000000000e-01 +1067 818 -2.50000000000000e-01 +1067 1132 1.66666666666667e-01 +1067 730 -1.66666666666667e-01 +1067 1065 -3.33333333333333e-01 +1067 1131 1.66666666666667e-01 +1067 816 1.66666666666667e-01 +1068 1068 1.25000000000000e+00 +1068 1102 8.33333333333333e-02 +1068 1103 8.33333333333333e-02 +1068 1061 8.33333333333333e-02 +1068 1070 -1.66666666666667e-01 +1068 1060 8.33333333333333e-02 +1068 1059 -3.75000000000000e-01 +1068 1099 8.33333333333333e-02 +1068 1098 -1.25000000000000e-01 +1068 1075 -8.33333333333333e-02 +1068 1069 -1.66666666666667e-01 +1068 824 8.33333333333333e-02 +1068 1186 -8.33333333333333e-02 +1068 829 8.33333333333333e-02 +1068 1076 1.66666666666667e-01 +1068 830 -1.66666666666667e-01 +1068 734 4.16666666666667e-02 +1068 1187 -8.33333333333333e-02 +1068 823 8.33333333333333e-02 +1068 733 -8.33333333333333e-02 +1068 822 -3.75000000000000e-01 +1068 821 -4.16666666666667e-02 +1068 713 4.16666666666667e-02 +1068 820 8.33333333333333e-02 +1068 712 -8.33333333333333e-02 +1068 819 -1.25000000000000e-01 +1068 1100 -4.16666666666667e-02 +1068 1074 -2.50000000000000e-01 +1069 1069 1.25000000000000e+00 +1069 1101 8.33333333333333e-02 +1069 1103 -1.66666666666667e-01 +1069 1061 -4.16666666666667e-02 +1069 713 4.16666666666667e-02 +1069 1060 -1.25000000000000e-01 +1069 1059 8.33333333333333e-02 +1069 734 4.16666666666667e-02 +1069 1099 -3.75000000000000e-01 +1069 1098 8.33333333333333e-02 +1069 1074 -8.33333333333333e-02 +1069 824 -4.16666666666667e-02 +1069 1068 -1.66666666666667e-01 +1069 1185 -8.33333333333333e-02 +1069 828 8.33333333333333e-02 +1069 1187 -8.33333333333333e-02 +1069 830 8.33333333333333e-02 +1069 823 -1.25000000000000e-01 +1069 822 8.33333333333333e-02 +1069 732 -8.33333333333333e-02 +1069 821 8.33333333333333e-02 +1069 1070 -1.66666666666667e-01 +1069 1076 1.66666666666667e-01 +1069 820 -3.75000000000000e-01 +1069 1100 8.33333333333333e-02 +1069 1075 -2.50000000000000e-01 +1069 819 8.33333333333333e-02 +1069 711 -8.33333333333333e-02 +1070 1070 1.25000000000000e+00 +1070 1098 -4.16666666666667e-02 +1070 1102 -1.66666666666667e-01 +1070 1101 8.33333333333333e-02 +1070 1061 -1.25000000000000e-01 +1070 1060 -4.16666666666667e-02 +1070 712 4.16666666666667e-02 +1070 1059 8.33333333333333e-02 +1070 1068 -1.66666666666667e-01 +1070 1100 -1.25000000000000e-01 +1070 733 4.16666666666667e-02 +1070 823 -4.16666666666667e-02 +1070 822 8.33333333333333e-02 +1070 1186 -8.33333333333333e-02 +1070 829 8.33333333333333e-02 +1070 1074 1.66666666666667e-01 +1070 828 -1.66666666666667e-01 +1070 824 -1.25000000000000e-01 +1070 732 4.16666666666667e-02 +1070 1185 -8.33333333333333e-02 +1070 821 -1.25000000000000e-01 +1070 1099 8.33333333333333e-02 +1070 1076 -7.50000000000000e-01 +1070 820 8.33333333333333e-02 +1070 1069 -1.66666666666667e-01 +1070 1075 1.66666666666667e-01 +1070 819 -4.16666666666667e-02 +1070 711 4.16666666666667e-02 +1071 1071 1.25000000000000e+00 +1071 1135 -4.16666666666667e-02 +1071 1138 8.33333333333333e-02 +1071 1136 8.33333333333333e-02 +1071 1134 -1.25000000000000e-01 +1071 1064 8.33333333333333e-02 +1071 1072 -1.66666666666667e-01 +1071 1063 8.33333333333333e-02 +1071 1062 -3.75000000000000e-01 +1071 1193 -8.33333333333333e-02 +1071 1073 -1.66666666666667e-01 +1071 826 8.33333333333333e-02 +1071 830 8.33333333333333e-02 +1071 1076 -8.33333333333333e-02 +1071 829 -1.66666666666667e-01 +1071 1075 1.66666666666667e-01 +1071 827 8.33333333333333e-02 +1071 737 -8.33333333333333e-02 +1071 736 4.16666666666667e-02 +1071 1192 -8.33333333333333e-02 +1071 825 -3.75000000000000e-01 +1071 821 8.33333333333333e-02 +1071 713 -8.33333333333333e-02 +1071 820 -4.16666666666667e-02 +1071 712 4.16666666666667e-02 +1071 819 -1.25000000000000e-01 +1071 1139 8.33333333333333e-02 +1071 1074 -2.50000000000000e-01 +1072 1072 1.25000000000000e+00 +1072 1139 -1.66666666666667e-01 +1072 1134 -4.16666666666667e-02 +1072 1137 8.33333333333333e-02 +1072 737 4.16666666666667e-02 +1072 1135 -1.25000000000000e-01 +1072 713 4.16666666666667e-02 +1072 1064 -4.16666666666667e-02 +1072 1063 -1.25000000000000e-01 +1072 1071 -1.66666666666667e-01 +1072 1062 8.33333333333333e-02 +1072 1193 -8.33333333333333e-02 +1072 827 -4.16666666666667e-02 +1072 830 8.33333333333333e-02 +1072 825 8.33333333333333e-02 +1072 828 -1.66666666666667e-01 +1072 1074 1.66666666666667e-01 +1072 826 -1.25000000000000e-01 +1072 735 4.16666666666667e-02 +1072 1191 -8.33333333333333e-02 +1072 821 8.33333333333333e-02 +1072 1073 -1.66666666666667e-01 +1072 1076 1.66666666666667e-01 +1072 820 -1.25000000000000e-01 +1072 1136 8.33333333333333e-02 +1072 1075 -7.50000000000000e-01 +1072 819 -4.16666666666667e-02 +1072 711 4.16666666666667e-02 +1073 1073 1.25000000000000e+00 +1073 1135 8.33333333333333e-02 +1073 1138 -1.66666666666667e-01 +1073 1136 -3.75000000000000e-01 +1073 736 4.16666666666667e-02 +1073 1134 8.33333333333333e-02 +1073 1064 -1.25000000000000e-01 +1073 712 4.16666666666667e-02 +1073 1063 -4.16666666666667e-02 +1073 1062 8.33333333333333e-02 +1073 1192 -8.33333333333333e-02 +1073 1191 -8.33333333333333e-02 +1073 826 -4.16666666666667e-02 +1073 829 8.33333333333333e-02 +1073 1071 -1.66666666666667e-01 +1073 828 8.33333333333333e-02 +1073 1074 -8.33333333333333e-02 +1073 827 -1.25000000000000e-01 +1073 825 8.33333333333333e-02 +1073 735 -8.33333333333333e-02 +1073 821 -3.75000000000000e-01 +1073 1137 8.33333333333333e-02 +1073 1076 -2.50000000000000e-01 +1073 820 8.33333333333333e-02 +1073 1072 -1.66666666666667e-01 +1073 1075 1.66666666666667e-01 +1073 819 8.33333333333333e-02 +1073 711 -8.33333333333333e-02 +1074 1074 2.50000000000000e+00 +1074 1103 -8.33333333333333e-02 +1074 1061 -1.66666666666667e-01 +1074 1102 1.66666666666667e-01 +1074 1101 -2.50000000000000e-01 +1074 1069 -8.33333333333333e-02 +1074 1070 1.66666666666667e-01 +1074 1068 -2.50000000000000e-01 +1074 1187 8.33333333333333e-02 +1074 1186 -1.66666666666667e-01 +1074 1168 8.33333333333333e-02 +1074 1138 -8.33333333333333e-02 +1074 1076 -3.33333333333333e-01 +1074 1067 1.66666666666667e-01 +1074 1139 1.66666666666667e-01 +1074 713 -8.33333333333333e-02 +1074 1064 8.33333333333333e-02 +1074 1066 1.66666666666667e-01 +1074 1063 -1.66666666666667e-01 +1074 1065 -7.50000000000000e-01 +1074 740 -8.33333333333333e-02 +1074 1169 8.33333333333333e-02 +1074 1137 -2.50000000000000e-01 +1074 821 8.33333333333333e-02 +1074 1073 -8.33333333333333e-02 +1074 829 1.66666666666667e-01 +1074 1075 -3.33333333333333e-01 +1074 1072 1.66666666666667e-01 +1074 830 1.66666666666667e-01 +1074 1193 -1.66666666666667e-01 +1074 1192 8.33333333333333e-02 +1074 739 -8.33333333333333e-02 +1074 828 -7.50000000000000e-01 +1074 820 8.33333333333333e-02 +1074 712 -8.33333333333333e-02 +1074 1071 -2.50000000000000e-01 +1074 1060 8.33333333333333e-02 +1075 1075 2.50000000000000e+00 +1075 1103 1.66666666666667e-01 +1075 1061 8.33333333333333e-02 +1075 1102 -7.50000000000000e-01 +1075 1101 1.66666666666667e-01 +1075 1068 -8.33333333333333e-02 +1075 1187 8.33333333333333e-02 +1075 1070 1.66666666666667e-01 +1075 1069 -2.50000000000000e-01 +1075 1185 -1.66666666666667e-01 +1075 1076 -3.33333333333333e-01 +1075 740 -8.33333333333333e-02 +1075 713 -8.33333333333333e-02 +1075 1167 8.33333333333333e-02 +1075 1137 -8.33333333333333e-02 +1075 1067 -8.33333333333333e-02 +1075 1064 8.33333333333333e-02 +1075 1066 -2.50000000000000e-01 +1075 1065 1.66666666666667e-01 +1075 1062 -1.66666666666667e-01 +1075 1169 -1.66666666666667e-01 +1075 1139 1.66666666666667e-01 +1075 1138 -2.50000000000000e-01 +1075 830 -8.33333333333333e-02 +1075 1193 8.33333333333333e-02 +1075 828 1.66666666666667e-01 +1075 1074 -3.33333333333333e-01 +1075 1071 1.66666666666667e-01 +1075 829 -2.50000000000000e-01 +1075 1191 8.33333333333333e-02 +1075 738 -8.33333333333333e-02 +1075 821 -1.66666666666667e-01 +1075 1073 1.66666666666667e-01 +1075 1072 -7.50000000000000e-01 +1075 1059 8.33333333333333e-02 +1075 819 8.33333333333333e-02 +1075 711 -8.33333333333333e-02 +1076 1076 2.50000000000000e+00 +1076 1101 -8.33333333333333e-02 +1076 1060 8.33333333333333e-02 +1076 1059 -1.66666666666667e-01 +1076 1103 -2.50000000000000e-01 +1076 1186 8.33333333333333e-02 +1076 1068 1.66666666666667e-01 +1076 1070 -7.50000000000000e-01 +1076 1069 1.66666666666667e-01 +1076 1185 8.33333333333333e-02 +1076 1075 -3.33333333333333e-01 +1076 739 -8.33333333333333e-02 +1076 712 -8.33333333333333e-02 +1076 1066 -8.33333333333333e-02 +1076 1063 8.33333333333333e-02 +1076 1074 -3.33333333333333e-01 +1076 1065 1.66666666666667e-01 +1076 1137 1.66666666666667e-01 +1076 1067 -2.50000000000000e-01 +1076 711 -8.33333333333333e-02 +1076 1062 8.33333333333333e-02 +1076 1139 -7.50000000000000e-01 +1076 1168 -1.66666666666667e-01 +1076 1138 1.66666666666667e-01 +1076 738 -8.33333333333333e-02 +1076 1167 8.33333333333333e-02 +1076 829 -8.33333333333333e-02 +1076 1192 8.33333333333333e-02 +1076 819 8.33333333333333e-02 +1076 1071 -8.33333333333333e-02 +1076 830 -2.50000000000000e-01 +1076 828 1.66666666666667e-01 +1076 1191 -1.66666666666667e-01 +1076 1073 -2.50000000000000e-01 +1076 1102 1.66666666666667e-01 +1076 820 -1.66666666666667e-01 +1076 1072 1.66666666666667e-01 +1077 1077 1.25000000000000e+00 +1077 1108 -8.33333333333333e-02 +1077 1088 -4.16666666666667e-02 +1077 1094 8.33333333333333e-02 +1077 1087 8.33333333333333e-02 +1077 1086 -1.25000000000000e-01 +1077 1106 4.16666666666667e-02 +1077 1109 -8.33333333333333e-02 +1077 1105 -8.33333333333333e-02 +1077 803 4.16666666666667e-02 +1077 806 -4.16666666666667e-02 +1077 1096 8.33333333333333e-02 +1077 1084 -8.33333333333333e-02 +1077 719 8.33333333333333e-02 +1077 1097 -1.66666666666667e-01 +1077 718 8.33333333333333e-02 +1077 1078 -1.66666666666667e-01 +1077 805 8.33333333333333e-02 +1077 717 -3.75000000000000e-01 +1077 804 -1.25000000000000e-01 +1077 1079 -1.66666666666667e-01 +1077 716 8.33333333333333e-02 +1077 1085 1.66666666666667e-01 +1077 715 8.33333333333333e-02 +1077 802 -8.33333333333333e-02 +1077 1093 8.33333333333333e-02 +1077 714 -3.75000000000000e-01 +1077 1083 -2.50000000000000e-01 +1078 1078 1.25000000000000e+00 +1078 1109 -8.33333333333333e-02 +1078 1092 8.33333333333333e-02 +1078 1107 -8.33333333333333e-02 +1078 1088 8.33333333333333e-02 +1078 1094 -1.66666666666667e-01 +1078 1087 -3.75000000000000e-01 +1078 1086 8.33333333333333e-02 +1078 1104 -8.33333333333333e-02 +1078 1079 -1.66666666666667e-01 +1078 806 8.33333333333333e-02 +1078 1085 1.66666666666667e-01 +1078 1095 8.33333333333333e-02 +1078 1083 -8.33333333333333e-02 +1078 719 -4.16666666666667e-02 +1078 1097 8.33333333333333e-02 +1078 718 -1.25000000000000e-01 +1078 805 -3.75000000000000e-01 +1078 717 8.33333333333333e-02 +1078 1077 -1.66666666666667e-01 +1078 804 8.33333333333333e-02 +1078 716 -4.16666666666667e-02 +1078 803 4.16666666666667e-02 +1078 1106 4.16666666666667e-02 +1078 715 -1.25000000000000e-01 +1078 1084 -2.50000000000000e-01 +1078 714 8.33333333333333e-02 +1078 801 -8.33333333333333e-02 +1079 1079 1.25000000000000e+00 +1079 1108 -8.33333333333333e-02 +1079 1088 -1.25000000000000e-01 +1079 1087 8.33333333333333e-02 +1079 1093 -1.66666666666667e-01 +1079 1086 -4.16666666666667e-02 +1079 1092 8.33333333333333e-02 +1079 1104 4.16666666666667e-02 +1079 1107 -8.33333333333333e-02 +1079 801 4.16666666666667e-02 +1079 804 -4.16666666666667e-02 +1079 1078 -1.66666666666667e-01 +1079 805 8.33333333333333e-02 +1079 1084 1.66666666666667e-01 +1079 719 -1.25000000000000e-01 +1079 806 -1.25000000000000e-01 +1079 718 -4.16666666666667e-02 +1079 1096 8.33333333333333e-02 +1079 717 8.33333333333333e-02 +1079 1095 -1.66666666666667e-01 +1079 1105 4.16666666666667e-02 +1079 716 -1.25000000000000e-01 +1079 1085 -7.50000000000000e-01 +1079 715 -4.16666666666667e-02 +1079 802 4.16666666666667e-02 +1079 1077 -1.66666666666667e-01 +1079 714 8.33333333333333e-02 +1079 1083 1.66666666666667e-01 +1080 1080 2.50000000000000e+00 +1080 1157 -8.33333333333333e-02 +1080 1156 -8.33333333333333e-02 +1080 1093 -1.66666666666667e-01 +1080 1084 1.66666666666667e-01 +1080 1151 -1.66666666666667e-01 +1080 1150 8.33333333333333e-02 +1080 1085 1.66666666666667e-01 +1080 1083 -7.50000000000000e-01 +1080 1091 -8.33333333333333e-02 +1080 1154 8.33333333333333e-02 +1080 1090 1.66666666666667e-01 +1080 1081 -3.33333333333333e-01 +1080 988 1.66666666666667e-01 +1080 986 -1.66666666666667e-01 +1080 716 1.66666666666667e-01 +1080 985 8.33333333333333e-02 +1080 715 -8.33333333333333e-02 +1080 1089 -2.50000000000000e-01 +1080 989 1.66666666666667e-01 +1080 1082 -3.33333333333333e-01 +1080 728 1.66666666666667e-01 +1080 1153 8.33333333333333e-02 +1080 727 -8.33333333333333e-02 +1080 987 -7.50000000000000e-01 +1080 961 -8.33333333333333e-02 +1080 802 8.33333333333333e-02 +1080 803 8.33333333333333e-02 +1080 962 -8.33333333333333e-02 +1080 714 -2.50000000000000e-01 +1080 815 -8.33333333333333e-02 +1080 968 8.33333333333333e-02 +1080 814 1.66666666666667e-01 +1080 967 -1.66666666666667e-01 +1080 813 -2.50000000000000e-01 +1080 1094 8.33333333333333e-02 +1080 726 -2.50000000000000e-01 +1081 1081 2.50000000000000e+00 +1081 1094 8.33333333333333e-02 +1081 1092 -1.66666666666667e-01 +1081 1157 -8.33333333333333e-02 +1081 1085 -8.33333333333333e-02 +1081 1151 8.33333333333333e-02 +1081 1083 1.66666666666667e-01 +1081 1149 8.33333333333333e-02 +1081 1084 -2.50000000000000e-01 +1081 986 8.33333333333333e-02 +1081 989 -8.33333333333333e-02 +1081 1089 1.66666666666667e-01 +1081 1080 -3.33333333333333e-01 +1081 987 1.66666666666667e-01 +1081 1091 1.66666666666667e-01 +1081 1090 -7.50000000000000e-01 +1081 984 8.33333333333333e-02 +1081 714 -8.33333333333333e-02 +1081 1154 -1.66666666666667e-01 +1081 988 -2.50000000000000e-01 +1081 1152 8.33333333333333e-02 +1081 726 -8.33333333333333e-02 +1081 960 -8.33333333333333e-02 +1081 801 8.33333333333333e-02 +1081 962 -8.33333333333333e-02 +1081 968 8.33333333333333e-02 +1081 803 -1.66666666666667e-01 +1081 716 1.66666666666667e-01 +1081 715 -2.50000000000000e-01 +1081 815 1.66666666666667e-01 +1081 1082 -3.33333333333333e-01 +1081 728 1.66666666666667e-01 +1081 814 -7.50000000000000e-01 +1081 1155 -8.33333333333333e-02 +1081 727 -2.50000000000000e-01 +1081 813 1.66666666666667e-01 +1081 966 -1.66666666666667e-01 +1082 1082 2.50000000000000e+00 +1082 1155 -8.33333333333333e-02 +1082 1093 8.33333333333333e-02 +1082 1156 -8.33333333333333e-02 +1082 1084 -8.33333333333333e-02 +1082 1150 8.33333333333333e-02 +1082 1149 -1.66666666666667e-01 +1082 1085 -2.50000000000000e-01 +1082 1083 1.66666666666667e-01 +1082 985 8.33333333333333e-02 +1082 988 -8.33333333333333e-02 +1082 1089 -8.33333333333333e-02 +1082 1152 8.33333333333333e-02 +1082 1091 -2.50000000000000e-01 +1082 1090 1.66666666666667e-01 +1082 984 -1.66666666666667e-01 +1082 714 1.66666666666667e-01 +1082 989 -2.50000000000000e-01 +1082 1153 -1.66666666666667e-01 +1082 987 1.66666666666667e-01 +1082 1080 -3.33333333333333e-01 +1082 726 1.66666666666667e-01 +1082 961 -8.33333333333333e-02 +1082 967 8.33333333333333e-02 +1082 716 -7.50000000000000e-01 +1082 802 -1.66666666666667e-01 +1082 715 1.66666666666667e-01 +1082 801 8.33333333333333e-02 +1082 960 -8.33333333333333e-02 +1082 815 -2.50000000000000e-01 +1082 1092 8.33333333333333e-02 +1082 728 -7.50000000000000e-01 +1082 814 1.66666666666667e-01 +1082 1081 -3.33333333333333e-01 +1082 727 1.66666666666667e-01 +1082 813 -8.33333333333333e-02 +1082 966 8.33333333333333e-02 +1083 1083 2.50000000000000e+00 +1083 1108 -1.66666666666667e-01 +1083 1078 -8.33333333333333e-02 +1083 805 8.33333333333333e-02 +1083 806 8.33333333333333e-02 +1083 1079 1.66666666666667e-01 +1083 1077 -2.50000000000000e-01 +1083 1097 1.66666666666667e-01 +1083 1096 1.66666666666667e-01 +1083 1095 -7.50000000000000e-01 +1083 1172 -8.33333333333333e-02 +1083 1171 -8.33333333333333e-02 +1083 1094 -8.33333333333333e-02 +1083 1157 8.33333333333333e-02 +1083 1156 8.33333333333333e-02 +1083 1093 1.66666666666667e-01 +1083 1084 -3.33333333333333e-01 +1083 1092 -2.50000000000000e-01 +1083 818 -8.33333333333333e-02 +1083 1085 -3.33333333333333e-01 +1083 803 -8.33333333333333e-02 +1083 815 8.33333333333333e-02 +1083 1081 1.66666666666667e-01 +1083 817 1.66666666666667e-01 +1083 814 -1.66666666666667e-01 +1083 1082 1.66666666666667e-01 +1083 716 -1.66666666666667e-01 +1083 715 8.33333333333333e-02 +1083 802 -8.33333333333333e-02 +1083 1080 -7.50000000000000e-01 +1083 1151 1.66666666666667e-01 +1083 731 -1.66666666666667e-01 +1083 1150 -8.33333333333333e-02 +1083 730 8.33333333333333e-02 +1083 1149 -2.50000000000000e-01 +1083 1109 8.33333333333333e-02 +1083 816 -2.50000000000000e-01 +1084 1084 2.50000000000000e+00 +1084 1107 -1.66666666666667e-01 +1084 1079 1.66666666666667e-01 +1084 1077 -8.33333333333333e-02 +1084 804 8.33333333333333e-02 +1084 806 -1.66666666666667e-01 +1084 1078 -2.50000000000000e-01 +1084 1097 -8.33333333333333e-02 +1084 1096 -2.50000000000000e-01 +1084 1095 1.66666666666667e-01 +1084 1170 -8.33333333333333e-02 +1084 1094 1.66666666666667e-01 +1084 1157 -1.66666666666667e-01 +1084 1155 8.33333333333333e-02 +1084 716 8.33333333333333e-02 +1084 1093 -7.50000000000000e-01 +1084 1092 1.66666666666667e-01 +1084 1083 -3.33333333333333e-01 +1084 1172 -8.33333333333333e-02 +1084 731 8.33333333333333e-02 +1084 1082 -8.33333333333333e-02 +1084 1080 1.66666666666667e-01 +1084 803 -8.33333333333333e-02 +1084 815 8.33333333333333e-02 +1084 816 1.66666666666667e-01 +1084 813 -1.66666666666667e-01 +1084 1081 -2.50000000000000e-01 +1084 714 8.33333333333333e-02 +1084 801 -8.33333333333333e-02 +1084 1151 1.66666666666667e-01 +1084 1085 -3.33333333333333e-01 +1084 818 1.66666666666667e-01 +1084 1150 -2.50000000000000e-01 +1084 1109 8.33333333333333e-02 +1084 817 -7.50000000000000e-01 +1084 1149 -8.33333333333333e-02 +1084 729 8.33333333333333e-02 +1085 1085 2.50000000000000e+00 +1085 1108 8.33333333333333e-02 +1085 1078 1.66666666666667e-01 +1085 805 -1.66666666666667e-01 +1085 804 8.33333333333333e-02 +1085 1079 -7.50000000000000e-01 +1085 1077 1.66666666666667e-01 +1085 1097 -2.50000000000000e-01 +1085 1096 -8.33333333333333e-02 +1085 1095 1.66666666666667e-01 +1085 1170 -8.33333333333333e-02 +1085 1093 1.66666666666667e-01 +1085 1092 -8.33333333333333e-02 +1085 1155 8.33333333333333e-02 +1085 1156 -1.66666666666667e-01 +1085 1094 -2.50000000000000e-01 +1085 715 8.33333333333333e-02 +1085 1171 -8.33333333333333e-02 +1085 730 8.33333333333333e-02 +1085 816 -8.33333333333333e-02 +1085 1081 -8.33333333333333e-02 +1085 1083 -3.33333333333333e-01 +1085 801 -8.33333333333333e-02 +1085 813 8.33333333333333e-02 +1085 802 -8.33333333333333e-02 +1085 814 8.33333333333333e-02 +1085 1082 -2.50000000000000e-01 +1085 1080 1.66666666666667e-01 +1085 714 -1.66666666666667e-01 +1085 1151 -7.50000000000000e-01 +1085 1107 8.33333333333333e-02 +1085 818 -2.50000000000000e-01 +1085 1150 1.66666666666667e-01 +1085 1084 -3.33333333333333e-01 +1085 817 1.66666666666667e-01 +1085 1149 1.66666666666667e-01 +1085 729 -1.66666666666667e-01 +1086 1086 1.25000000000000e+00 +1086 1108 8.33333333333333e-02 +1086 1109 -1.66666666666667e-01 +1086 716 4.16666666666667e-02 +1086 1079 -4.16666666666667e-02 +1086 1078 8.33333333333333e-02 +1086 1077 -1.25000000000000e-01 +1086 749 4.16666666666667e-02 +1086 1105 8.33333333333333e-02 +1086 1104 -3.75000000000000e-01 +1086 1093 -8.33333333333333e-02 +1086 848 -4.16666666666667e-02 +1086 1087 -1.66666666666667e-01 +1086 1222 -8.33333333333333e-02 +1086 853 8.33333333333333e-02 +1086 1223 -8.33333333333333e-02 +1086 854 8.33333333333333e-02 +1086 748 -8.33333333333333e-02 +1086 847 8.33333333333333e-02 +1086 846 -1.25000000000000e-01 +1086 1088 -1.66666666666667e-01 +1086 842 8.33333333333333e-02 +1086 1094 1.66666666666667e-01 +1086 841 8.33333333333333e-02 +1086 715 -8.33333333333333e-02 +1086 1106 8.33333333333333e-02 +1086 840 -3.75000000000000e-01 +1086 1092 -2.50000000000000e-01 +1087 1087 1.25000000000000e+00 +1087 1107 8.33333333333333e-02 +1087 1109 8.33333333333333e-02 +1087 1079 8.33333333333333e-02 +1087 1088 -1.66666666666667e-01 +1087 1078 -3.75000000000000e-01 +1087 1077 8.33333333333333e-02 +1087 1105 -1.25000000000000e-01 +1087 1104 8.33333333333333e-02 +1087 1092 -8.33333333333333e-02 +1087 1086 -1.66666666666667e-01 +1087 848 8.33333333333333e-02 +1087 1221 -8.33333333333333e-02 +1087 852 8.33333333333333e-02 +1087 1094 1.66666666666667e-01 +1087 854 -1.66666666666667e-01 +1087 749 4.16666666666667e-02 +1087 1223 -8.33333333333333e-02 +1087 847 -3.75000000000000e-01 +1087 747 -8.33333333333333e-02 +1087 846 8.33333333333333e-02 +1087 842 -4.16666666666667e-02 +1087 716 4.16666666666667e-02 +1087 1106 -4.16666666666667e-02 +1087 841 -1.25000000000000e-01 +1087 1093 -2.50000000000000e-01 +1087 840 8.33333333333333e-02 +1087 714 -8.33333333333333e-02 +1088 1088 1.25000000000000e+00 +1088 1104 8.33333333333333e-02 +1088 1108 8.33333333333333e-02 +1088 1107 -1.66666666666667e-01 +1088 1079 -1.25000000000000e-01 +1088 1078 8.33333333333333e-02 +1088 1087 -1.66666666666667e-01 +1088 714 4.16666666666667e-02 +1088 1077 -4.16666666666667e-02 +1088 1106 -1.25000000000000e-01 +1088 747 4.16666666666667e-02 +1088 846 -4.16666666666667e-02 +1088 847 8.33333333333333e-02 +1088 1093 1.66666666666667e-01 +1088 853 -1.66666666666667e-01 +1088 1221 -8.33333333333333e-02 +1088 852 8.33333333333333e-02 +1088 848 -1.25000000000000e-01 +1088 748 4.16666666666667e-02 +1088 1222 -8.33333333333333e-02 +1088 1105 -4.16666666666667e-02 +1088 842 -1.25000000000000e-01 +1088 1094 -7.50000000000000e-01 +1088 841 -4.16666666666667e-02 +1088 715 4.16666666666667e-02 +1088 1086 -1.66666666666667e-01 +1088 840 8.33333333333333e-02 +1088 1092 1.66666666666667e-01 +1089 1089 2.50000000000000e+00 +1089 1156 8.33333333333333e-02 +1089 1229 -8.33333333333333e-02 +1089 854 8.33333333333333e-02 +1089 853 -1.66666666666667e-01 +1089 1093 1.66666666666667e-01 +1089 1228 -8.33333333333333e-02 +1089 1094 1.66666666666667e-01 +1089 1092 -7.50000000000000e-01 +1089 1082 -8.33333333333333e-02 +1089 989 8.33333333333333e-02 +1089 1081 1.66666666666667e-01 +1089 988 -1.66666666666667e-01 +1089 715 8.33333333333333e-02 +1089 1080 -2.50000000000000e-01 +1089 1091 -3.33333333333333e-01 +1089 1154 1.66666666666667e-01 +1089 751 8.33333333333333e-02 +1089 1153 -8.33333333333333e-02 +1089 1152 -2.50000000000000e-01 +1089 985 -8.33333333333333e-02 +1089 842 1.66666666666667e-01 +1089 838 8.33333333333333e-02 +1089 841 -8.33333333333333e-02 +1089 839 -1.66666666666667e-01 +1089 998 1.66666666666667e-01 +1089 716 8.33333333333333e-02 +1089 986 -8.33333333333333e-02 +1089 840 -2.50000000000000e-01 +1089 851 -8.33333333333333e-02 +1089 752 8.33333333333333e-02 +1089 1090 -3.33333333333333e-01 +1089 850 1.66666666666667e-01 +1089 997 1.66666666666667e-01 +1089 1157 -1.66666666666667e-01 +1089 849 -2.50000000000000e-01 +1089 996 -7.50000000000000e-01 +1090 1090 2.50000000000000e+00 +1090 1155 8.33333333333333e-02 +1090 1229 -8.33333333333333e-02 +1090 854 8.33333333333333e-02 +1090 1094 -8.33333333333333e-02 +1090 852 -1.66666666666667e-01 +1090 1092 1.66666666666667e-01 +1090 1227 -8.33333333333333e-02 +1090 1093 -2.50000000000000e-01 +1090 989 8.33333333333333e-02 +1090 1080 1.66666666666667e-01 +1090 987 -1.66666666666667e-01 +1090 1082 1.66666666666667e-01 +1090 1081 -7.50000000000000e-01 +1090 714 8.33333333333333e-02 +1090 1154 1.66666666666667e-01 +1090 1153 -2.50000000000000e-01 +1090 750 8.33333333333333e-02 +1090 1152 -8.33333333333333e-02 +1090 984 -8.33333333333333e-02 +1090 986 -8.33333333333333e-02 +1090 1091 -3.33333333333333e-01 +1090 837 8.33333333333333e-02 +1090 840 -8.33333333333333e-02 +1090 839 8.33333333333333e-02 +1090 998 -8.33333333333333e-02 +1090 716 -1.66666666666667e-01 +1090 842 1.66666666666667e-01 +1090 841 -2.50000000000000e-01 +1090 851 1.66666666666667e-01 +1090 752 -1.66666666666667e-01 +1090 1157 8.33333333333333e-02 +1090 850 -7.50000000000000e-01 +1090 997 -2.50000000000000e-01 +1090 1089 -3.33333333333333e-01 +1090 849 1.66666666666667e-01 +1090 996 1.66666666666667e-01 +1091 1091 2.50000000000000e+00 +1091 1155 -1.66666666666667e-01 +1091 1227 -8.33333333333333e-02 +1091 1228 -8.33333333333333e-02 +1091 852 8.33333333333333e-02 +1091 853 8.33333333333333e-02 +1091 1093 -8.33333333333333e-02 +1091 1094 -2.50000000000000e-01 +1091 1092 1.66666666666667e-01 +1091 988 8.33333333333333e-02 +1091 1080 -8.33333333333333e-02 +1091 987 8.33333333333333e-02 +1091 1082 -2.50000000000000e-01 +1091 1081 1.66666666666667e-01 +1091 1154 -7.50000000000000e-01 +1091 1153 1.66666666666667e-01 +1091 1089 -3.33333333333333e-01 +1091 1152 1.66666666666667e-01 +1091 985 -8.33333333333333e-02 +1091 1090 -3.33333333333333e-01 +1091 840 1.66666666666667e-01 +1091 838 8.33333333333333e-02 +1091 997 -8.33333333333333e-02 +1091 837 -1.66666666666667e-01 +1091 996 1.66666666666667e-01 +1091 842 -7.50000000000000e-01 +1091 715 -1.66666666666667e-01 +1091 841 1.66666666666667e-01 +1091 714 8.33333333333333e-02 +1091 984 -8.33333333333333e-02 +1091 1156 8.33333333333333e-02 +1091 851 -2.50000000000000e-01 +1091 998 -2.50000000000000e-01 +1091 850 1.66666666666667e-01 +1091 751 -1.66666666666667e-01 +1091 849 -8.33333333333333e-02 +1091 750 8.33333333333333e-02 +1092 1092 2.50000000000000e+00 +1092 1109 1.66666666666667e-01 +1092 1079 8.33333333333333e-02 +1092 1108 1.66666666666667e-01 +1092 1107 -7.50000000000000e-01 +1092 1087 -8.33333333333333e-02 +1092 1223 8.33333333333333e-02 +1092 1088 1.66666666666667e-01 +1092 1086 -2.50000000000000e-01 +1092 1222 -1.66666666666667e-01 +1092 1094 -3.33333333333333e-01 +1092 755 -8.33333333333333e-02 +1092 716 -8.33333333333333e-02 +1092 1171 8.33333333333333e-02 +1092 1156 -8.33333333333333e-02 +1092 1085 -8.33333333333333e-02 +1092 1082 8.33333333333333e-02 +1092 1172 -1.66666666666667e-01 +1092 1157 1.66666666666667e-01 +1092 1155 -2.50000000000000e-01 +1092 1084 1.66666666666667e-01 +1092 1081 -1.66666666666667e-01 +1092 1083 -2.50000000000000e-01 +1092 854 -8.33333333333333e-02 +1092 1229 8.33333333333333e-02 +1092 853 1.66666666666667e-01 +1092 1093 -3.33333333333333e-01 +1092 1090 1.66666666666667e-01 +1092 1228 8.33333333333333e-02 +1092 754 -8.33333333333333e-02 +1092 852 -2.50000000000000e-01 +1092 1091 1.66666666666667e-01 +1092 842 -1.66666666666667e-01 +1092 841 8.33333333333333e-02 +1092 715 -8.33333333333333e-02 +1092 1089 -7.50000000000000e-01 +1092 1078 8.33333333333333e-02 +1093 1093 2.50000000000000e+00 +1093 1109 -8.33333333333333e-02 +1093 1079 -1.66666666666667e-01 +1093 1108 -2.50000000000000e-01 +1093 1107 1.66666666666667e-01 +1093 1086 -8.33333333333333e-02 +1093 1088 1.66666666666667e-01 +1093 1087 -2.50000000000000e-01 +1093 1223 8.33333333333333e-02 +1093 1221 -1.66666666666667e-01 +1093 1170 8.33333333333333e-02 +1093 1155 -8.33333333333333e-02 +1093 1085 1.66666666666667e-01 +1093 1094 -3.33333333333333e-01 +1093 1157 1.66666666666667e-01 +1093 755 -8.33333333333333e-02 +1093 1172 8.33333333333333e-02 +1093 1156 -2.50000000000000e-01 +1093 716 -8.33333333333333e-02 +1093 1082 8.33333333333333e-02 +1093 1084 -7.50000000000000e-01 +1093 1083 1.66666666666667e-01 +1093 1080 -1.66666666666667e-01 +1093 842 8.33333333333333e-02 +1093 1091 -8.33333333333333e-02 +1093 852 1.66666666666667e-01 +1093 1092 -3.33333333333333e-01 +1093 1089 1.66666666666667e-01 +1093 1229 -1.66666666666667e-01 +1093 854 1.66666666666667e-01 +1093 853 -7.50000000000000e-01 +1093 1227 8.33333333333333e-02 +1093 753 -8.33333333333333e-02 +1093 1090 -2.50000000000000e-01 +1093 1077 8.33333333333333e-02 +1093 840 8.33333333333333e-02 +1093 714 -8.33333333333333e-02 +1094 1094 2.50000000000000e+00 +1094 1107 1.66666666666667e-01 +1094 1078 -1.66666666666667e-01 +1094 1077 8.33333333333333e-02 +1094 1109 -2.50000000000000e-01 +1094 1087 1.66666666666667e-01 +1094 1221 8.33333333333333e-02 +1094 1088 -7.50000000000000e-01 +1094 1086 1.66666666666667e-01 +1094 1222 8.33333333333333e-02 +1094 1092 -3.33333333333333e-01 +1094 753 -8.33333333333333e-02 +1094 714 -8.33333333333333e-02 +1094 1084 1.66666666666667e-01 +1094 1093 -3.33333333333333e-01 +1094 1156 1.66666666666667e-01 +1094 1083 -8.33333333333333e-02 +1094 1080 8.33333333333333e-02 +1094 1157 -7.50000000000000e-01 +1094 754 -8.33333333333333e-02 +1094 1171 8.33333333333333e-02 +1094 1170 -1.66666666666667e-01 +1094 1155 1.66666666666667e-01 +1094 1085 -2.50000000000000e-01 +1094 715 -8.33333333333333e-02 +1094 1081 8.33333333333333e-02 +1094 852 -8.33333333333333e-02 +1094 1227 8.33333333333333e-02 +1094 841 8.33333333333333e-02 +1094 1090 -8.33333333333333e-02 +1094 854 -2.50000000000000e-01 +1094 1228 -1.66666666666667e-01 +1094 853 1.66666666666667e-01 +1094 1091 -2.50000000000000e-01 +1094 1108 -8.33333333333333e-02 +1094 1089 1.66666666666667e-01 +1094 840 -1.66666666666667e-01 +1095 1095 2.50000000000000e+00 +1095 1109 -8.33333333333333e-02 +1095 1108 1.66666666666667e-01 +1095 1107 -2.50000000000000e-01 +1095 1172 8.33333333333333e-02 +1095 1078 8.33333333333333e-02 +1095 1079 -1.66666666666667e-01 +1095 1085 1.66666666666667e-01 +1095 1084 1.66666666666667e-01 +1095 1083 -7.50000000000000e-01 +1095 1096 -3.33333333333333e-01 +1095 718 -8.33333333333333e-02 +1095 730 -8.33333333333333e-02 +1095 1174 -8.33333333333333e-02 +1095 1168 8.33333333333333e-02 +1095 1175 -8.33333333333333e-02 +1095 1112 8.33333333333333e-02 +1095 719 1.66666666666667e-01 +1095 1097 -3.33333333333333e-01 +1095 1103 1.66666666666667e-01 +1095 1111 -1.66666666666667e-01 +1095 1102 1.66666666666667e-01 +1095 1101 -7.50000000000000e-01 +1095 731 1.66666666666667e-01 +1095 1169 -1.66666666666667e-01 +1095 805 -8.33333333333333e-02 +1095 1060 8.33333333333333e-02 +1095 1061 8.33333333333333e-02 +1095 806 -8.33333333333333e-02 +1095 717 -2.50000000000000e-01 +1095 1067 -8.33333333333333e-02 +1095 818 8.33333333333333e-02 +1095 1066 1.66666666666667e-01 +1095 817 -1.66666666666667e-01 +1095 1065 -2.50000000000000e-01 +1095 1171 8.33333333333333e-02 +1095 729 -2.50000000000000e-01 +1096 1096 2.50000000000000e+00 +1096 1109 1.66666666666667e-01 +1096 1108 -7.50000000000000e-01 +1096 1107 1.66666666666667e-01 +1096 1172 -1.66666666666667e-01 +1096 1077 8.33333333333333e-02 +1096 1079 8.33333333333333e-02 +1096 1085 -8.33333333333333e-02 +1096 1084 -2.50000000000000e-01 +1096 1083 1.66666666666667e-01 +1096 1095 -3.33333333333333e-01 +1096 717 -8.33333333333333e-02 +1096 729 -8.33333333333333e-02 +1096 1173 -8.33333333333333e-02 +1096 1167 8.33333333333333e-02 +1096 1112 8.33333333333333e-02 +1096 1103 -8.33333333333333e-02 +1096 1102 -2.50000000000000e-01 +1096 1110 -1.66666666666667e-01 +1096 1101 1.66666666666667e-01 +1096 1175 -8.33333333333333e-02 +1096 1169 8.33333333333333e-02 +1096 804 -8.33333333333333e-02 +1096 1059 8.33333333333333e-02 +1096 806 -8.33333333333333e-02 +1096 818 8.33333333333333e-02 +1096 1061 -1.66666666666667e-01 +1096 719 1.66666666666667e-01 +1096 718 -2.50000000000000e-01 +1096 1067 1.66666666666667e-01 +1096 1097 -3.33333333333333e-01 +1096 731 1.66666666666667e-01 +1096 1066 -7.50000000000000e-01 +1096 1170 8.33333333333333e-02 +1096 730 -2.50000000000000e-01 +1096 1065 1.66666666666667e-01 +1096 816 -1.66666666666667e-01 +1097 1097 2.50000000000000e+00 +1097 1108 1.66666666666667e-01 +1097 1107 -8.33333333333333e-02 +1097 1171 -1.66666666666667e-01 +1097 1170 8.33333333333333e-02 +1097 1078 8.33333333333333e-02 +1097 1077 -1.66666666666667e-01 +1097 1085 -2.50000000000000e-01 +1097 1084 -8.33333333333333e-02 +1097 1083 1.66666666666667e-01 +1097 1173 -8.33333333333333e-02 +1097 1110 8.33333333333333e-02 +1097 1103 -2.50000000000000e-01 +1097 1111 8.33333333333333e-02 +1097 1102 -8.33333333333333e-02 +1097 717 1.66666666666667e-01 +1097 1095 -3.33333333333333e-01 +1097 1101 1.66666666666667e-01 +1097 1174 -8.33333333333333e-02 +1097 1168 8.33333333333333e-02 +1097 729 1.66666666666667e-01 +1097 1167 -1.66666666666667e-01 +1097 805 -8.33333333333333e-02 +1097 817 8.33333333333333e-02 +1097 719 -7.50000000000000e-01 +1097 1060 -1.66666666666667e-01 +1097 718 1.66666666666667e-01 +1097 1059 8.33333333333333e-02 +1097 804 -8.33333333333333e-02 +1097 1067 -2.50000000000000e-01 +1097 1109 -2.50000000000000e-01 +1097 731 -7.50000000000000e-01 +1097 1066 1.66666666666667e-01 +1097 1096 -3.33333333333333e-01 +1097 730 1.66666666666667e-01 +1097 1065 -8.33333333333333e-02 +1097 816 8.33333333333333e-02 +1098 1098 1.25000000000000e+00 +1098 1061 4.16666666666667e-02 +1098 1060 -8.33333333333333e-02 +1098 1069 8.33333333333333e-02 +1098 1068 -1.25000000000000e-01 +1098 719 8.33333333333333e-02 +1098 1100 -1.66666666666667e-01 +1098 1103 1.66666666666667e-01 +1098 1102 -8.33333333333333e-02 +1098 1101 -2.50000000000000e-01 +1098 734 8.33333333333333e-02 +1098 1187 -1.66666666666667e-01 +1098 1186 8.33333333333333e-02 +1098 1111 8.33333333333333e-02 +1098 1189 -8.33333333333333e-02 +1098 860 4.16666666666667e-02 +1098 1190 -8.33333333333333e-02 +1098 733 8.33333333333333e-02 +1098 859 -8.33333333333333e-02 +1098 732 -3.75000000000000e-01 +1098 857 -4.16666666666667e-02 +1098 1112 8.33333333333333e-02 +1098 1099 -1.66666666666667e-01 +1098 856 8.33333333333333e-02 +1098 718 8.33333333333333e-02 +1098 1070 -4.16666666666667e-02 +1098 855 -1.25000000000000e-01 +1098 717 -3.75000000000000e-01 +1099 1099 1.25000000000000e+00 +1099 1100 -1.66666666666667e-01 +1099 719 -4.16666666666667e-02 +1099 1061 4.16666666666667e-02 +1099 1059 -8.33333333333333e-02 +1099 734 -4.16666666666667e-02 +1099 1069 -3.75000000000000e-01 +1099 1068 8.33333333333333e-02 +1099 1187 8.33333333333333e-02 +1099 1103 1.66666666666667e-01 +1099 1102 -2.50000000000000e-01 +1099 1101 -8.33333333333333e-02 +1099 1185 8.33333333333333e-02 +1099 1110 8.33333333333333e-02 +1099 1188 -8.33333333333333e-02 +1099 860 4.16666666666667e-02 +1099 1190 -8.33333333333333e-02 +1099 733 -1.25000000000000e-01 +1099 732 8.33333333333333e-02 +1099 858 -8.33333333333333e-02 +1099 857 8.33333333333333e-02 +1099 1112 -1.66666666666667e-01 +1099 1070 8.33333333333333e-02 +1099 856 -3.75000000000000e-01 +1099 718 -1.25000000000000e-01 +1099 1098 -1.66666666666667e-01 +1099 855 8.33333333333333e-02 +1099 717 8.33333333333333e-02 +1100 1100 1.25000000000000e+00 +1100 1099 -1.66666666666667e-01 +1100 1068 -4.16666666666667e-02 +1100 1059 4.16666666666667e-02 +1100 718 -4.16666666666667e-02 +1100 1060 4.16666666666667e-02 +1100 1070 -1.25000000000000e-01 +1100 733 -4.16666666666667e-02 +1100 1186 8.33333333333333e-02 +1100 1103 -7.50000000000000e-01 +1100 1102 1.66666666666667e-01 +1100 717 8.33333333333333e-02 +1100 1098 -1.66666666666667e-01 +1100 1101 1.66666666666667e-01 +1100 732 8.33333333333333e-02 +1100 1185 -1.66666666666667e-01 +1100 859 4.16666666666667e-02 +1100 1189 -8.33333333333333e-02 +1100 734 -1.25000000000000e-01 +1100 858 4.16666666666667e-02 +1100 1188 -8.33333333333333e-02 +1100 1069 8.33333333333333e-02 +1100 857 -1.25000000000000e-01 +1100 719 -1.25000000000000e-01 +1100 856 8.33333333333333e-02 +1100 1111 -1.66666666666667e-01 +1100 855 -4.16666666666667e-02 +1100 1110 8.33333333333333e-02 +1101 1101 2.50000000000000e+00 +1101 1066 -1.66666666666667e-01 +1101 1061 -8.33333333333333e-02 +1101 1069 8.33333333333333e-02 +1101 1060 -8.33333333333333e-02 +1101 1070 8.33333333333333e-02 +1101 1076 -8.33333333333333e-02 +1101 1075 1.66666666666667e-01 +1101 1074 -2.50000000000000e-01 +1101 1190 8.33333333333333e-02 +1101 1189 -1.66666666666667e-01 +1101 1186 1.66666666666667e-01 +1101 1100 1.66666666666667e-01 +1101 718 8.33333333333333e-02 +1101 1099 -8.33333333333333e-02 +1101 1098 -2.50000000000000e-01 +1101 1187 1.66666666666667e-01 +1101 739 8.33333333333333e-02 +1101 1185 -7.50000000000000e-01 +1101 1103 -3.33333333333333e-01 +1101 1168 -8.33333333333333e-02 +1101 1112 -8.33333333333333e-02 +1101 1174 8.33333333333333e-02 +1101 1198 -8.33333333333333e-02 +1101 1175 8.33333333333333e-02 +1101 1199 -8.33333333333333e-02 +1101 719 -1.66666666666667e-01 +1101 1097 1.66666666666667e-01 +1101 1111 1.66666666666667e-01 +1101 1096 1.66666666666667e-01 +1101 1102 -3.33333333333333e-01 +1101 1110 -2.50000000000000e-01 +1101 1095 -7.50000000000000e-01 +1101 1169 1.66666666666667e-01 +1101 740 -1.66666666666667e-01 +1101 1067 8.33333333333333e-02 +1101 1167 -2.50000000000000e-01 +1102 1102 2.50000000000000e+00 +1102 1065 -1.66666666666667e-01 +1102 1068 8.33333333333333e-02 +1102 1059 -8.33333333333333e-02 +1102 1070 -1.66666666666667e-01 +1102 1076 1.66666666666667e-01 +1102 1061 -8.33333333333333e-02 +1102 1075 -7.50000000000000e-01 +1102 1074 1.66666666666667e-01 +1102 1190 8.33333333333333e-02 +1102 1187 -8.33333333333333e-02 +1102 1188 -1.66666666666667e-01 +1102 1185 1.66666666666667e-01 +1102 1100 1.66666666666667e-01 +1102 1103 -3.33333333333333e-01 +1102 1099 -2.50000000000000e-01 +1102 717 8.33333333333333e-02 +1102 1098 -8.33333333333333e-02 +1102 1186 -2.50000000000000e-01 +1102 738 8.33333333333333e-02 +1102 1167 -8.33333333333333e-02 +1102 1112 1.66666666666667e-01 +1102 1173 8.33333333333333e-02 +1102 1197 -8.33333333333333e-02 +1102 1175 -1.66666666666667e-01 +1102 1169 1.66666666666667e-01 +1102 719 8.33333333333333e-02 +1102 1097 -8.33333333333333e-02 +1102 1111 -7.50000000000000e-01 +1102 1096 -2.50000000000000e-01 +1102 1110 1.66666666666667e-01 +1102 1095 1.66666666666667e-01 +1102 1101 -3.33333333333333e-01 +1102 1199 -8.33333333333333e-02 +1102 740 8.33333333333333e-02 +1102 1067 8.33333333333333e-02 +1102 1168 -2.50000000000000e-01 +1103 1103 2.50000000000000e+00 +1103 1065 8.33333333333333e-02 +1103 1059 -8.33333333333333e-02 +1103 1069 -1.66666666666667e-01 +1103 1075 1.66666666666667e-01 +1103 1068 8.33333333333333e-02 +1103 1074 -8.33333333333333e-02 +1103 1060 -8.33333333333333e-02 +1103 1076 -2.50000000000000e-01 +1103 1189 8.33333333333333e-02 +1103 1186 -8.33333333333333e-02 +1103 1188 8.33333333333333e-02 +1103 1100 -7.50000000000000e-01 +1103 1099 1.66666666666667e-01 +1103 1102 -3.33333333333333e-01 +1103 1098 1.66666666666667e-01 +1103 1187 -2.50000000000000e-01 +1103 1185 1.66666666666667e-01 +1103 1101 -3.33333333333333e-01 +1103 1110 -8.33333333333333e-02 +1103 1111 1.66666666666667e-01 +1103 1174 -1.66666666666667e-01 +1103 1168 1.66666666666667e-01 +1103 1173 8.33333333333333e-02 +1103 1197 -8.33333333333333e-02 +1103 1112 -2.50000000000000e-01 +1103 1097 -2.50000000000000e-01 +1103 718 8.33333333333333e-02 +1103 1096 -8.33333333333333e-02 +1103 717 -1.66666666666667e-01 +1103 1095 1.66666666666667e-01 +1103 1066 8.33333333333333e-02 +1103 1169 -7.50000000000000e-01 +1103 1198 -8.33333333333333e-02 +1103 739 8.33333333333333e-02 +1103 1167 1.66666666666667e-01 +1103 738 -1.66666666666667e-01 +1104 1104 1.25000000000000e+00 +1104 1088 8.33333333333333e-02 +1104 1079 4.16666666666667e-02 +1104 719 -4.16666666666667e-02 +1104 1078 -8.33333333333333e-02 +1104 749 -4.16666666666667e-02 +1104 1087 8.33333333333333e-02 +1104 1086 -3.75000000000000e-01 +1104 1223 8.33333333333333e-02 +1104 1222 8.33333333333333e-02 +1104 1109 1.66666666666667e-01 +1104 1108 -8.33333333333333e-02 +1104 1107 -2.50000000000000e-01 +1104 1111 8.33333333333333e-02 +1104 1225 -8.33333333333333e-02 +1104 863 4.16666666666667e-02 +1104 1226 -8.33333333333333e-02 +1104 862 -8.33333333333333e-02 +1104 748 8.33333333333333e-02 +1104 747 -1.25000000000000e-01 +1104 857 8.33333333333333e-02 +1104 1112 -1.66666666666667e-01 +1104 856 8.33333333333333e-02 +1104 1105 -1.66666666666667e-01 +1104 718 8.33333333333333e-02 +1104 855 -3.75000000000000e-01 +1104 1106 -1.66666666666667e-01 +1104 717 -1.25000000000000e-01 +1105 1105 1.25000000000000e+00 +1105 1079 4.16666666666667e-02 +1105 1077 -8.33333333333333e-02 +1105 1087 -1.25000000000000e-01 +1105 1086 8.33333333333333e-02 +1105 749 8.33333333333333e-02 +1105 1223 -1.66666666666667e-01 +1105 1221 8.33333333333333e-02 +1105 1106 -1.66666666666667e-01 +1105 719 8.33333333333333e-02 +1105 1109 1.66666666666667e-01 +1105 1108 -2.50000000000000e-01 +1105 1107 -8.33333333333333e-02 +1105 1110 8.33333333333333e-02 +1105 1224 -8.33333333333333e-02 +1105 863 4.16666666666667e-02 +1105 1226 -8.33333333333333e-02 +1105 748 -3.75000000000000e-01 +1105 861 -8.33333333333333e-02 +1105 747 8.33333333333333e-02 +1105 857 -4.16666666666667e-02 +1105 1112 8.33333333333333e-02 +1105 856 -1.25000000000000e-01 +1105 1088 -4.16666666666667e-02 +1105 718 -3.75000000000000e-01 +1105 855 8.33333333333333e-02 +1105 1104 -1.66666666666667e-01 +1105 717 8.33333333333333e-02 +1106 1106 1.25000000000000e+00 +1106 1078 4.16666666666667e-02 +1106 1104 -1.66666666666667e-01 +1106 1086 8.33333333333333e-02 +1106 1077 4.16666666666667e-02 +1106 717 -4.16666666666667e-02 +1106 1088 -1.25000000000000e-01 +1106 747 -4.16666666666667e-02 +1106 1221 8.33333333333333e-02 +1106 748 8.33333333333333e-02 +1106 1222 -1.66666666666667e-01 +1106 1109 -7.50000000000000e-01 +1106 1105 -1.66666666666667e-01 +1106 718 8.33333333333333e-02 +1106 1108 1.66666666666667e-01 +1106 1107 1.66666666666667e-01 +1106 861 4.16666666666667e-02 +1106 1224 -8.33333333333333e-02 +1106 749 -1.25000000000000e-01 +1106 862 4.16666666666667e-02 +1106 1225 -8.33333333333333e-02 +1106 857 -1.25000000000000e-01 +1106 1087 -4.16666666666667e-02 +1106 719 -1.25000000000000e-01 +1106 856 -4.16666666666667e-02 +1106 1111 8.33333333333333e-02 +1106 855 8.33333333333333e-02 +1106 1110 -1.66666666666667e-01 +1107 1107 2.50000000000000e+00 +1107 1084 -1.66666666666667e-01 +1107 1078 -8.33333333333333e-02 +1107 1087 8.33333333333333e-02 +1107 1094 1.66666666666667e-01 +1107 1088 -1.66666666666667e-01 +1107 1079 -8.33333333333333e-02 +1107 1093 1.66666666666667e-01 +1107 1092 -7.50000000000000e-01 +1107 1226 8.33333333333333e-02 +1107 1223 -8.33333333333333e-02 +1107 1222 1.66666666666667e-01 +1107 1225 -1.66666666666667e-01 +1107 1106 1.66666666666667e-01 +1107 1109 -3.33333333333333e-01 +1107 1105 -8.33333333333333e-02 +1107 718 8.33333333333333e-02 +1107 1104 -2.50000000000000e-01 +1107 754 8.33333333333333e-02 +1107 1221 -2.50000000000000e-01 +1107 1171 -8.33333333333333e-02 +1107 1112 1.66666666666667e-01 +1107 1174 8.33333333333333e-02 +1107 1234 -8.33333333333333e-02 +1107 1175 -1.66666666666667e-01 +1107 1172 1.66666666666667e-01 +1107 719 8.33333333333333e-02 +1107 1097 -8.33333333333333e-02 +1107 1111 1.66666666666667e-01 +1107 1096 1.66666666666667e-01 +1107 1108 -3.33333333333333e-01 +1107 1110 -7.50000000000000e-01 +1107 1095 -2.50000000000000e-01 +1107 1235 -8.33333333333333e-02 +1107 755 8.33333333333333e-02 +1107 1085 8.33333333333333e-02 +1107 1170 -2.50000000000000e-01 +1108 1108 2.50000000000000e+00 +1108 1083 -1.66666666666667e-01 +1108 1079 -8.33333333333333e-02 +1108 1077 -8.33333333333333e-02 +1108 1086 8.33333333333333e-02 +1108 1094 -8.33333333333333e-02 +1108 1088 8.33333333333333e-02 +1108 1093 -2.50000000000000e-01 +1108 1092 1.66666666666667e-01 +1108 1226 8.33333333333333e-02 +1108 1221 1.66666666666667e-01 +1108 1224 -1.66666666666667e-01 +1108 1106 1.66666666666667e-01 +1108 1105 -2.50000000000000e-01 +1108 1104 -8.33333333333333e-02 +1108 717 8.33333333333333e-02 +1108 1223 1.66666666666667e-01 +1108 1222 -7.50000000000000e-01 +1108 753 8.33333333333333e-02 +1108 1109 -3.33333333333333e-01 +1108 1170 -8.33333333333333e-02 +1108 1112 -8.33333333333333e-02 +1108 1173 8.33333333333333e-02 +1108 1233 -8.33333333333333e-02 +1108 1235 -8.33333333333333e-02 +1108 1175 8.33333333333333e-02 +1108 719 -1.66666666666667e-01 +1108 1097 1.66666666666667e-01 +1108 1111 -2.50000000000000e-01 +1108 1096 -7.50000000000000e-01 +1108 1110 1.66666666666667e-01 +1108 1095 1.66666666666667e-01 +1108 1107 -3.33333333333333e-01 +1108 1172 1.66666666666667e-01 +1108 755 -1.66666666666667e-01 +1108 1085 8.33333333333333e-02 +1108 1171 -2.50000000000000e-01 +1109 1109 2.50000000000000e+00 +1109 1084 8.33333333333333e-02 +1109 1078 -8.33333333333333e-02 +1109 1093 -8.33333333333333e-02 +1109 1087 8.33333333333333e-02 +1109 1092 1.66666666666667e-01 +1109 1086 -1.66666666666667e-01 +1109 1077 -8.33333333333333e-02 +1109 1094 -2.50000000000000e-01 +1109 1224 8.33333333333333e-02 +1109 1221 -8.33333333333333e-02 +1109 1225 8.33333333333333e-02 +1109 1106 -7.50000000000000e-01 +1109 1105 1.66666666666667e-01 +1109 1104 1.66666666666667e-01 +1109 1107 -3.33333333333333e-01 +1109 1223 -2.50000000000000e-01 +1109 1222 1.66666666666667e-01 +1109 1108 -3.33333333333333e-01 +1109 1111 -8.33333333333333e-02 +1109 1110 1.66666666666667e-01 +1109 1234 -8.33333333333333e-02 +1109 1174 8.33333333333333e-02 +1109 1173 -1.66666666666667e-01 +1109 1170 1.66666666666667e-01 +1109 1112 -2.50000000000000e-01 +1109 1097 -2.50000000000000e-01 +1109 718 -1.66666666666667e-01 +1109 1096 1.66666666666667e-01 +1109 717 8.33333333333333e-02 +1109 1095 -8.33333333333333e-02 +1109 1083 8.33333333333333e-02 +1109 1172 -7.50000000000000e-01 +1109 1171 1.66666666666667e-01 +1109 754 -1.66666666666667e-01 +1109 1233 -8.33333333333333e-02 +1109 753 8.33333333333333e-02 +1110 1110 2.50000000000000e+00 +1110 1234 8.33333333333333e-02 +1110 1235 8.33333333333333e-02 +1110 1108 1.66666666666667e-01 +1110 1107 -7.50000000000000e-01 +1110 1105 8.33333333333333e-02 +1110 1226 -8.33333333333333e-02 +1110 1106 -1.66666666666667e-01 +1110 1225 1.66666666666667e-01 +1110 1224 -2.50000000000000e-01 +1110 1111 -3.33333333333333e-01 +1110 718 -8.33333333333333e-02 +1110 757 -8.33333333333333e-02 +1110 1097 8.33333333333333e-02 +1110 1103 -8.33333333333333e-02 +1110 1174 -8.33333333333333e-02 +1110 1198 8.33333333333333e-02 +1110 1096 -1.66666666666667e-01 +1110 1102 1.66666666666667e-01 +1110 1101 -2.50000000000000e-01 +1110 1175 1.66666666666667e-01 +1110 1199 -1.66666666666667e-01 +1110 1173 -2.50000000000000e-01 +1110 856 -8.33333333333333e-02 +1110 1099 8.33333333333333e-02 +1110 857 1.66666666666667e-01 +1110 1112 -3.33333333333333e-01 +1110 1190 1.66666666666667e-01 +1110 1100 8.33333333333333e-02 +1110 719 -8.33333333333333e-02 +1110 855 -2.50000000000000e-01 +1110 866 8.33333333333333e-02 +1110 758 -8.33333333333333e-02 +1110 1189 1.66666666666667e-01 +1110 865 -1.66666666666667e-01 +1110 1188 -7.50000000000000e-01 +1110 1109 1.66666666666667e-01 +1111 1111 2.50000000000000e+00 +1111 1233 8.33333333333333e-02 +1111 1235 -1.66666666666667e-01 +1111 1108 -2.50000000000000e-01 +1111 1107 1.66666666666667e-01 +1111 1104 8.33333333333333e-02 +1111 1226 1.66666666666667e-01 +1111 1106 8.33333333333333e-02 +1111 1225 -7.50000000000000e-01 +1111 1224 1.66666666666667e-01 +1111 1110 -3.33333333333333e-01 +1111 717 -8.33333333333333e-02 +1111 756 -8.33333333333333e-02 +1111 1175 1.66666666666667e-01 +1111 1112 -3.33333333333333e-01 +1111 1103 1.66666666666667e-01 +1111 1173 -8.33333333333333e-02 +1111 1197 8.33333333333333e-02 +1111 719 -8.33333333333333e-02 +1111 1097 8.33333333333333e-02 +1111 1102 -7.50000000000000e-01 +1111 1095 -1.66666666666667e-01 +1111 1101 1.66666666666667e-01 +1111 758 -8.33333333333333e-02 +1111 1199 8.33333333333333e-02 +1111 1174 -2.50000000000000e-01 +1111 855 -8.33333333333333e-02 +1111 1098 8.33333333333333e-02 +1111 866 8.33333333333333e-02 +1111 1190 -8.33333333333333e-02 +1111 1100 -1.66666666666667e-01 +1111 857 1.66666666666667e-01 +1111 856 -2.50000000000000e-01 +1111 1189 -2.50000000000000e-01 +1111 1109 -8.33333333333333e-02 +1111 1188 1.66666666666667e-01 +1111 864 -1.66666666666667e-01 +1112 1112 2.50000000000000e+00 +1112 1107 1.66666666666667e-01 +1112 1234 -1.66666666666667e-01 +1112 1233 8.33333333333333e-02 +1112 1109 -2.50000000000000e-01 +1112 1225 1.66666666666667e-01 +1112 1224 -8.33333333333333e-02 +1112 1105 8.33333333333333e-02 +1112 1104 -1.66666666666667e-01 +1112 1226 -2.50000000000000e-01 +1112 1095 8.33333333333333e-02 +1112 1101 -8.33333333333333e-02 +1112 1174 1.66666666666667e-01 +1112 1111 -3.33333333333333e-01 +1112 1102 1.66666666666667e-01 +1112 1103 -2.50000000000000e-01 +1112 718 -8.33333333333333e-02 +1112 1096 8.33333333333333e-02 +1112 1175 -7.50000000000000e-01 +1112 757 -8.33333333333333e-02 +1112 1198 8.33333333333333e-02 +1112 1173 1.66666666666667e-01 +1112 1197 -1.66666666666667e-01 +1112 865 8.33333333333333e-02 +1112 1189 -8.33333333333333e-02 +1112 855 1.66666666666667e-01 +1112 1110 -3.33333333333333e-01 +1112 1188 1.66666666666667e-01 +1112 857 -7.50000000000000e-01 +1112 1099 -1.66666666666667e-01 +1112 856 1.66666666666667e-01 +1112 1098 8.33333333333333e-02 +1112 717 -8.33333333333333e-02 +1112 1190 -2.50000000000000e-01 +1112 1108 -8.33333333333333e-02 +1112 864 8.33333333333333e-02 +1112 756 -8.33333333333333e-02 +1113 1113 1.25000000000000e+00 +1113 1145 -8.33333333333333e-02 +1113 1142 -8.33333333333333e-02 +1113 1141 4.16666666666667e-02 +1113 1144 -8.33333333333333e-02 +1113 1124 8.33333333333333e-02 +1113 1123 -4.16666666666667e-02 +1113 1129 8.33333333333333e-02 +1113 1122 -1.25000000000000e-01 +1113 811 -4.16666666666667e-02 +1113 808 4.16666666666667e-02 +1113 1133 8.33333333333333e-02 +1113 1121 -8.33333333333333e-02 +1113 722 8.33333333333333e-02 +1113 809 -8.33333333333333e-02 +1113 721 8.33333333333333e-02 +1113 1114 -1.66666666666667e-01 +1113 1120 1.66666666666667e-01 +1113 720 -3.75000000000000e-01 +1113 1119 -2.50000000000000e-01 +1113 1115 -1.66666666666667e-01 +1113 725 8.33333333333333e-02 +1113 812 8.33333333333333e-02 +1113 724 8.33333333333333e-02 +1113 1132 -1.66666666666667e-01 +1113 1130 8.33333333333333e-02 +1113 723 -3.75000000000000e-01 +1113 810 -1.25000000000000e-01 +1114 1114 1.25000000000000e+00 +1114 1145 -8.33333333333333e-02 +1114 1140 4.16666666666667e-02 +1114 1143 -8.33333333333333e-02 +1114 1124 8.33333333333333e-02 +1114 1130 -1.66666666666667e-01 +1114 1123 -1.25000000000000e-01 +1114 1122 -4.16666666666667e-02 +1114 1128 8.33333333333333e-02 +1114 810 -4.16666666666667e-02 +1114 807 4.16666666666667e-02 +1114 812 8.33333333333333e-02 +1114 1115 -1.66666666666667e-01 +1114 1121 1.66666666666667e-01 +1114 722 -4.16666666666667e-02 +1114 809 4.16666666666667e-02 +1114 721 -1.25000000000000e-01 +1114 1120 -7.50000000000000e-01 +1114 720 8.33333333333333e-02 +1114 1113 -1.66666666666667e-01 +1114 1119 1.66666666666667e-01 +1114 725 -4.16666666666667e-02 +1114 1133 8.33333333333333e-02 +1114 1142 4.16666666666667e-02 +1114 724 -1.25000000000000e-01 +1114 811 -1.25000000000000e-01 +1114 723 8.33333333333333e-02 +1114 1131 -1.66666666666667e-01 +1115 1115 1.25000000000000e+00 +1115 1144 -8.33333333333333e-02 +1115 1128 8.33333333333333e-02 +1115 1143 -8.33333333333333e-02 +1115 1140 -8.33333333333333e-02 +1115 1124 -3.75000000000000e-01 +1115 1123 8.33333333333333e-02 +1115 1129 -1.66666666666667e-01 +1115 1122 8.33333333333333e-02 +1115 811 8.33333333333333e-02 +1115 1114 -1.66666666666667e-01 +1115 1120 1.66666666666667e-01 +1115 1131 8.33333333333333e-02 +1115 1119 -8.33333333333333e-02 +1115 722 -1.25000000000000e-01 +1115 1121 -2.50000000000000e-01 +1115 721 -4.16666666666667e-02 +1115 808 4.16666666666667e-02 +1115 720 8.33333333333333e-02 +1115 807 -8.33333333333333e-02 +1115 1141 4.16666666666667e-02 +1115 725 -1.25000000000000e-01 +1115 812 -3.75000000000000e-01 +1115 724 -4.16666666666667e-02 +1115 1132 8.33333333333333e-02 +1115 1113 -1.66666666666667e-01 +1115 723 8.33333333333333e-02 +1115 810 8.33333333333333e-02 +1116 1116 2.50000000000000e+00 +1116 1130 -1.66666666666667e-01 +1116 1129 8.33333333333333e-02 +1116 1162 -8.33333333333333e-02 +1116 1121 1.66666666666667e-01 +1116 1151 8.33333333333333e-02 +1116 1150 -1.66666666666667e-01 +1116 1120 1.66666666666667e-01 +1116 1119 -7.50000000000000e-01 +1116 1118 -3.33333333333333e-01 +1116 1127 1.66666666666667e-01 +1116 1126 -8.33333333333333e-02 +1116 1159 8.33333333333333e-02 +1116 1160 8.33333333333333e-02 +1116 728 -8.33333333333333e-02 +1116 722 -8.33333333333333e-02 +1116 1125 -2.50000000000000e-01 +1116 1016 8.33333333333333e-02 +1116 721 1.66666666666667e-01 +1116 1015 -1.66666666666667e-01 +1116 1019 1.66666666666667e-01 +1116 1117 -3.33333333333333e-01 +1116 727 1.66666666666667e-01 +1116 1018 1.66666666666667e-01 +1116 1017 -7.50000000000000e-01 +1116 809 8.33333333333333e-02 +1116 965 -8.33333333333333e-02 +1116 808 8.33333333333333e-02 +1116 964 -8.33333333333333e-02 +1116 720 -2.50000000000000e-01 +1116 815 1.66666666666667e-01 +1116 968 -1.66666666666667e-01 +1116 814 -8.33333333333333e-02 +1116 967 8.33333333333333e-02 +1116 813 -2.50000000000000e-01 +1116 1163 -8.33333333333333e-02 +1116 726 -2.50000000000000e-01 +1117 1117 2.50000000000000e+00 +1117 1163 -8.33333333333333e-02 +1117 1128 8.33333333333333e-02 +1117 1161 -8.33333333333333e-02 +1117 1151 8.33333333333333e-02 +1117 1121 -8.33333333333333e-02 +1117 1149 -1.66666666666667e-01 +1117 1120 -2.50000000000000e-01 +1117 1119 1.66666666666667e-01 +1117 1125 -8.33333333333333e-02 +1117 1158 8.33333333333333e-02 +1117 1160 -1.66666666666667e-01 +1117 1127 1.66666666666667e-01 +1117 1126 -2.50000000000000e-01 +1117 1016 8.33333333333333e-02 +1117 720 1.66666666666667e-01 +1117 1014 -1.66666666666667e-01 +1117 1019 -8.33333333333333e-02 +1117 1018 -2.50000000000000e-01 +1117 1116 -3.33333333333333e-01 +1117 726 1.66666666666667e-01 +1117 1017 1.66666666666667e-01 +1117 968 8.33333333333333e-02 +1117 965 -8.33333333333333e-02 +1117 809 -1.66666666666667e-01 +1117 722 1.66666666666667e-01 +1117 721 -7.50000000000000e-01 +1117 807 8.33333333333333e-02 +1117 963 -8.33333333333333e-02 +1117 815 1.66666666666667e-01 +1117 1118 -3.33333333333333e-01 +1117 728 1.66666666666667e-01 +1117 814 -2.50000000000000e-01 +1117 1130 8.33333333333333e-02 +1117 727 -7.50000000000000e-01 +1117 813 -8.33333333333333e-02 +1117 966 8.33333333333333e-02 +1118 1118 2.50000000000000e+00 +1118 1129 8.33333333333333e-02 +1118 1162 -8.33333333333333e-02 +1118 1128 -1.66666666666667e-01 +1118 1150 8.33333333333333e-02 +1118 1120 -8.33333333333333e-02 +1118 1119 1.66666666666667e-01 +1118 1149 8.33333333333333e-02 +1118 1121 -2.50000000000000e-01 +1118 1116 -3.33333333333333e-01 +1118 1125 1.66666666666667e-01 +1118 1159 -1.66666666666667e-01 +1118 1158 8.33333333333333e-02 +1118 726 -8.33333333333333e-02 +1118 1127 -7.50000000000000e-01 +1118 1126 1.66666666666667e-01 +1118 720 -8.33333333333333e-02 +1118 1014 8.33333333333333e-02 +1118 1015 8.33333333333333e-02 +1118 1019 -2.50000000000000e-01 +1118 1018 -8.33333333333333e-02 +1118 1017 1.66666666666667e-01 +1118 967 8.33333333333333e-02 +1118 964 -8.33333333333333e-02 +1118 807 8.33333333333333e-02 +1118 963 -8.33333333333333e-02 +1118 722 -2.50000000000000e-01 +1118 808 -1.66666666666667e-01 +1118 721 1.66666666666667e-01 +1118 815 -7.50000000000000e-01 +1118 1161 -8.33333333333333e-02 +1118 728 -2.50000000000000e-01 +1118 814 1.66666666666667e-01 +1118 1117 -3.33333333333333e-01 +1118 727 1.66666666666667e-01 +1118 813 1.66666666666667e-01 +1118 966 -1.66666666666667e-01 +1119 1119 2.50000000000000e+00 +1119 1163 8.33333333333333e-02 +1119 1118 1.66666666666667e-01 +1119 815 -1.66666666666667e-01 +1119 814 8.33333333333333e-02 +1119 1117 1.66666666666667e-01 +1119 1116 -7.50000000000000e-01 +1119 1151 -8.33333333333333e-02 +1119 1150 1.66666666666667e-01 +1119 1149 -2.50000000000000e-01 +1119 1129 -8.33333333333333e-02 +1119 1177 -8.33333333333333e-02 +1119 1144 8.33333333333333e-02 +1119 1130 1.66666666666667e-01 +1119 1145 -1.66666666666667e-01 +1119 731 8.33333333333333e-02 +1119 1178 -8.33333333333333e-02 +1119 722 8.33333333333333e-02 +1119 1128 -2.50000000000000e-01 +1119 809 -8.33333333333333e-02 +1119 808 -8.33333333333333e-02 +1119 812 8.33333333333333e-02 +1119 1115 -8.33333333333333e-02 +1119 1120 -3.33333333333333e-01 +1119 811 8.33333333333333e-02 +1119 817 -8.33333333333333e-02 +1119 721 -1.66666666666667e-01 +1119 1114 1.66666666666667e-01 +1119 1113 -2.50000000000000e-01 +1119 1121 -3.33333333333333e-01 +1119 1133 1.66666666666667e-01 +1119 818 1.66666666666667e-01 +1119 1132 1.66666666666667e-01 +1119 730 -1.66666666666667e-01 +1119 1162 8.33333333333333e-02 +1119 1131 -7.50000000000000e-01 +1119 816 -2.50000000000000e-01 +1120 1120 2.50000000000000e+00 +1120 1163 -1.66666666666667e-01 +1120 1118 -8.33333333333333e-02 +1120 815 8.33333333333333e-02 +1120 813 8.33333333333333e-02 +1120 1117 -2.50000000000000e-01 +1120 1116 1.66666666666667e-01 +1120 1151 1.66666666666667e-01 +1120 1150 -7.50000000000000e-01 +1120 1149 1.66666666666667e-01 +1120 1128 -8.33333333333333e-02 +1120 1176 -8.33333333333333e-02 +1120 1143 8.33333333333333e-02 +1120 1178 -8.33333333333333e-02 +1120 1145 8.33333333333333e-02 +1120 1121 -3.33333333333333e-01 +1120 1130 1.66666666666667e-01 +1120 1129 -2.50000000000000e-01 +1120 807 -8.33333333333333e-02 +1120 1115 1.66666666666667e-01 +1120 1119 -3.33333333333333e-01 +1120 812 -1.66666666666667e-01 +1120 818 1.66666666666667e-01 +1120 810 8.33333333333333e-02 +1120 816 -8.33333333333333e-02 +1120 722 8.33333333333333e-02 +1120 809 -8.33333333333333e-02 +1120 1114 -7.50000000000000e-01 +1120 720 -1.66666666666667e-01 +1120 1113 1.66666666666667e-01 +1120 1133 -8.33333333333333e-02 +1120 731 8.33333333333333e-02 +1120 1161 8.33333333333333e-02 +1120 1132 -2.50000000000000e-01 +1120 817 -2.50000000000000e-01 +1120 1131 1.66666666666667e-01 +1120 729 -1.66666666666667e-01 +1121 1121 2.50000000000000e+00 +1121 1161 8.33333333333333e-02 +1121 1117 -8.33333333333333e-02 +1121 814 8.33333333333333e-02 +1121 1116 1.66666666666667e-01 +1121 813 -1.66666666666667e-01 +1121 1118 -2.50000000000000e-01 +1121 1151 -2.50000000000000e-01 +1121 1150 1.66666666666667e-01 +1121 1149 -8.33333333333333e-02 +1121 1177 -8.33333333333333e-02 +1121 1144 8.33333333333333e-02 +1121 1128 1.66666666666667e-01 +1121 1143 -1.66666666666667e-01 +1121 729 8.33333333333333e-02 +1121 1176 -8.33333333333333e-02 +1121 1130 -7.50000000000000e-01 +1121 1120 -3.33333333333333e-01 +1121 1129 1.66666666666667e-01 +1121 720 8.33333333333333e-02 +1121 807 -8.33333333333333e-02 +1121 1114 1.66666666666667e-01 +1121 810 8.33333333333333e-02 +1121 1113 -8.33333333333333e-02 +1121 811 -1.66666666666667e-01 +1121 817 1.66666666666667e-01 +1121 1115 -2.50000000000000e-01 +1121 721 8.33333333333333e-02 +1121 808 -8.33333333333333e-02 +1121 1162 -1.66666666666667e-01 +1121 1133 -2.50000000000000e-01 +1121 818 -7.50000000000000e-01 +1121 1132 -8.33333333333333e-02 +1121 730 8.33333333333333e-02 +1121 1119 -3.33333333333333e-01 +1121 1131 1.66666666666667e-01 +1121 816 1.66666666666667e-01 +1122 1122 1.25000000000000e+00 +1122 1145 8.33333333333333e-02 +1122 1144 -1.66666666666667e-01 +1122 1115 8.33333333333333e-02 +1122 1114 -4.16666666666667e-02 +1122 721 4.16666666666667e-02 +1122 1113 -1.25000000000000e-01 +1122 1142 8.33333333333333e-02 +1122 766 4.16666666666667e-02 +1122 1140 -3.75000000000000e-01 +1122 1130 -8.33333333333333e-02 +1122 1124 -1.66666666666667e-01 +1122 883 -4.16666666666667e-02 +1122 1259 -8.33333333333333e-02 +1122 890 8.33333333333333e-02 +1122 1258 -8.33333333333333e-02 +1122 889 8.33333333333333e-02 +1122 884 8.33333333333333e-02 +1122 767 -8.33333333333333e-02 +1122 882 -1.25000000000000e-01 +1122 878 8.33333333333333e-02 +1122 722 -8.33333333333333e-02 +1122 877 8.33333333333333e-02 +1122 1123 -1.66666666666667e-01 +1122 1129 1.66666666666667e-01 +1122 876 -3.75000000000000e-01 +1122 1141 8.33333333333333e-02 +1122 1128 -2.50000000000000e-01 +1123 1123 1.25000000000000e+00 +1123 1140 8.33333333333333e-02 +1123 1145 8.33333333333333e-02 +1123 1143 -1.66666666666667e-01 +1123 1115 8.33333333333333e-02 +1123 1124 -1.66666666666667e-01 +1123 1114 -1.25000000000000e-01 +1123 1113 -4.16666666666667e-02 +1123 720 4.16666666666667e-02 +1123 1141 -1.25000000000000e-01 +1123 765 4.16666666666667e-02 +1123 882 -4.16666666666667e-02 +1123 884 8.33333333333333e-02 +1123 1130 1.66666666666667e-01 +1123 890 -1.66666666666667e-01 +1123 1257 -8.33333333333333e-02 +1123 888 8.33333333333333e-02 +1123 767 4.16666666666667e-02 +1123 1259 -8.33333333333333e-02 +1123 883 -1.25000000000000e-01 +1123 878 -4.16666666666667e-02 +1123 722 4.16666666666667e-02 +1123 877 -1.25000000000000e-01 +1123 1142 -4.16666666666667e-02 +1123 1129 -7.50000000000000e-01 +1123 876 8.33333333333333e-02 +1123 1122 -1.66666666666667e-01 +1123 1128 1.66666666666667e-01 +1124 1124 1.25000000000000e+00 +1124 1143 8.33333333333333e-02 +1124 1144 8.33333333333333e-02 +1124 1115 -3.75000000000000e-01 +1124 1114 8.33333333333333e-02 +1124 1123 -1.66666666666667e-01 +1124 1113 8.33333333333333e-02 +1124 1142 -1.25000000000000e-01 +1124 1140 8.33333333333333e-02 +1124 1128 -8.33333333333333e-02 +1124 1122 -1.66666666666667e-01 +1124 883 8.33333333333333e-02 +1124 1257 -8.33333333333333e-02 +1124 888 8.33333333333333e-02 +1124 1129 1.66666666666667e-01 +1124 889 -1.66666666666667e-01 +1124 884 -3.75000000000000e-01 +1124 766 4.16666666666667e-02 +1124 1258 -8.33333333333333e-02 +1124 882 8.33333333333333e-02 +1124 765 -8.33333333333333e-02 +1124 878 -1.25000000000000e-01 +1124 1141 -4.16666666666667e-02 +1124 1130 -2.50000000000000e-01 +1124 877 -4.16666666666667e-02 +1124 721 4.16666666666667e-02 +1124 876 8.33333333333333e-02 +1124 720 -8.33333333333333e-02 +1125 1125 2.50000000000000e+00 +1125 1162 -1.66666666666667e-01 +1125 1130 1.66666666666667e-01 +1125 890 -1.66666666666667e-01 +1125 1264 -8.33333333333333e-02 +1125 889 8.33333333333333e-02 +1125 1265 -8.33333333333333e-02 +1125 1129 1.66666666666667e-01 +1125 1128 -7.50000000000000e-01 +1125 1118 1.66666666666667e-01 +1125 1117 -8.33333333333333e-02 +1125 1019 -1.66666666666667e-01 +1125 1018 8.33333333333333e-02 +1125 770 8.33333333333333e-02 +1125 1160 -8.33333333333333e-02 +1125 1159 1.66666666666667e-01 +1125 1126 -3.33333333333333e-01 +1125 1158 -2.50000000000000e-01 +1125 722 8.33333333333333e-02 +1125 1116 -2.50000000000000e-01 +1125 878 -8.33333333333333e-02 +1125 877 1.66666666666667e-01 +1125 1016 -8.33333333333333e-02 +1125 875 8.33333333333333e-02 +1125 1027 1.66666666666667e-01 +1125 874 -1.66666666666667e-01 +1125 721 8.33333333333333e-02 +1125 1015 -8.33333333333333e-02 +1125 876 -2.50000000000000e-01 +1125 1127 -3.33333333333333e-01 +1125 887 1.66666666666667e-01 +1125 1028 1.66666666666667e-01 +1125 886 -8.33333333333333e-02 +1125 769 8.33333333333333e-02 +1125 1163 8.33333333333333e-02 +1125 885 -2.50000000000000e-01 +1125 1026 -7.50000000000000e-01 +1126 1126 2.50000000000000e+00 +1126 1161 -1.66666666666667e-01 +1126 1130 -8.33333333333333e-02 +1126 1265 -8.33333333333333e-02 +1126 890 8.33333333333333e-02 +1126 1263 -8.33333333333333e-02 +1126 888 8.33333333333333e-02 +1126 1129 -2.50000000000000e-01 +1126 1128 1.66666666666667e-01 +1126 1116 -8.33333333333333e-02 +1126 1019 8.33333333333333e-02 +1126 1017 8.33333333333333e-02 +1126 1160 1.66666666666667e-01 +1126 1159 -7.50000000000000e-01 +1126 1158 1.66666666666667e-01 +1126 1125 -3.33333333333333e-01 +1126 1118 1.66666666666667e-01 +1126 1117 -2.50000000000000e-01 +1126 1028 -8.33333333333333e-02 +1126 1127 -3.33333333333333e-01 +1126 1016 -8.33333333333333e-02 +1126 875 8.33333333333333e-02 +1126 876 1.66666666666667e-01 +1126 1026 1.66666666666667e-01 +1126 873 -1.66666666666667e-01 +1126 722 -1.66666666666667e-01 +1126 878 1.66666666666667e-01 +1126 877 -7.50000000000000e-01 +1126 720 8.33333333333333e-02 +1126 1014 -8.33333333333333e-02 +1126 887 1.66666666666667e-01 +1126 770 -1.66666666666667e-01 +1126 1163 8.33333333333333e-02 +1126 886 -2.50000000000000e-01 +1126 1027 -2.50000000000000e-01 +1126 885 -8.33333333333333e-02 +1126 768 8.33333333333333e-02 +1127 1127 2.50000000000000e+00 +1127 1161 8.33333333333333e-02 +1127 1129 -8.33333333333333e-02 +1127 1264 -8.33333333333333e-02 +1127 889 8.33333333333333e-02 +1127 1128 1.66666666666667e-01 +1127 888 -1.66666666666667e-01 +1127 1263 -8.33333333333333e-02 +1127 1130 -2.50000000000000e-01 +1127 1116 1.66666666666667e-01 +1127 1018 8.33333333333333e-02 +1127 1017 -1.66666666666667e-01 +1127 1160 -2.50000000000000e-01 +1127 1159 1.66666666666667e-01 +1127 768 8.33333333333333e-02 +1127 1158 -8.33333333333333e-02 +1127 1118 -7.50000000000000e-01 +1127 1117 1.66666666666667e-01 +1127 720 8.33333333333333e-02 +1127 1027 -8.33333333333333e-02 +1127 1126 -3.33333333333333e-01 +1127 876 -8.33333333333333e-02 +1127 1015 -8.33333333333333e-02 +1127 874 8.33333333333333e-02 +1127 1014 -8.33333333333333e-02 +1127 873 8.33333333333333e-02 +1127 878 -2.50000000000000e-01 +1127 721 -1.66666666666667e-01 +1127 877 1.66666666666667e-01 +1127 1162 8.33333333333333e-02 +1127 887 -7.50000000000000e-01 +1127 1028 -2.50000000000000e-01 +1127 886 1.66666666666667e-01 +1127 769 -1.66666666666667e-01 +1127 1125 -3.33333333333333e-01 +1127 885 1.66666666666667e-01 +1127 1026 1.66666666666667e-01 +1128 1128 2.50000000000000e+00 +1128 1162 1.66666666666667e-01 +1128 1118 -1.66666666666667e-01 +1128 1117 8.33333333333333e-02 +1128 1161 -2.50000000000000e-01 +1128 1127 1.66666666666667e-01 +1128 1264 8.33333333333333e-02 +1128 1126 1.66666666666667e-01 +1128 1125 -7.50000000000000e-01 +1128 1265 8.33333333333333e-02 +1128 1120 -8.33333333333333e-02 +1128 1121 1.66666666666667e-01 +1128 1130 -3.33333333333333e-01 +1128 722 -8.33333333333333e-02 +1128 1119 -2.50000000000000e-01 +1128 1178 8.33333333333333e-02 +1128 773 -8.33333333333333e-02 +1128 1177 -1.66666666666667e-01 +1128 1115 8.33333333333333e-02 +1128 1129 -3.33333333333333e-01 +1128 1144 1.66666666666667e-01 +1128 1114 8.33333333333333e-02 +1128 721 -8.33333333333333e-02 +1128 1145 1.66666666666667e-01 +1128 772 -8.33333333333333e-02 +1128 1143 -7.50000000000000e-01 +1128 1124 -8.33333333333333e-02 +1128 878 8.33333333333333e-02 +1128 1258 8.33333333333333e-02 +1128 889 -8.33333333333333e-02 +1128 877 -1.66666666666667e-01 +1128 1123 1.66666666666667e-01 +1128 1122 -2.50000000000000e-01 +1128 890 1.66666666666667e-01 +1128 1259 -1.66666666666667e-01 +1128 888 -2.50000000000000e-01 +1128 1163 -8.33333333333333e-02 +1129 1129 2.50000000000000e+00 +1129 1161 1.66666666666667e-01 +1129 1116 8.33333333333333e-02 +1129 1163 1.66666666666667e-01 +1129 1162 -7.50000000000000e-01 +1129 1127 -8.33333333333333e-02 +1129 1263 8.33333333333333e-02 +1129 1126 -2.50000000000000e-01 +1129 1125 1.66666666666667e-01 +1129 1265 -1.66666666666667e-01 +1129 1119 -8.33333333333333e-02 +1129 1178 8.33333333333333e-02 +1129 1121 1.66666666666667e-01 +1129 1120 -2.50000000000000e-01 +1129 1176 -1.66666666666667e-01 +1129 1145 -8.33333333333333e-02 +1129 1128 -3.33333333333333e-01 +1129 1143 1.66666666666667e-01 +1129 1115 -1.66666666666667e-01 +1129 1113 8.33333333333333e-02 +1129 720 -8.33333333333333e-02 +1129 1144 -2.50000000000000e-01 +1129 771 -8.33333333333333e-02 +1129 1124 1.66666666666667e-01 +1129 1130 -3.33333333333333e-01 +1129 890 1.66666666666667e-01 +1129 1257 8.33333333333333e-02 +1129 888 -8.33333333333333e-02 +1129 878 8.33333333333333e-02 +1129 722 -8.33333333333333e-02 +1129 1123 -7.50000000000000e-01 +1129 876 -1.66666666666667e-01 +1129 1122 1.66666666666667e-01 +1129 1259 8.33333333333333e-02 +1129 773 -8.33333333333333e-02 +1129 889 -2.50000000000000e-01 +1129 1118 8.33333333333333e-02 +1130 1130 2.50000000000000e+00 +1130 1161 -8.33333333333333e-02 +1130 1116 -1.66666666666667e-01 +1130 1163 -2.50000000000000e-01 +1130 1162 1.66666666666667e-01 +1130 1126 -8.33333333333333e-02 +1130 1125 1.66666666666667e-01 +1130 1127 -2.50000000000000e-01 +1130 1264 -1.66666666666667e-01 +1130 1263 8.33333333333333e-02 +1130 1177 8.33333333333333e-02 +1130 1119 1.66666666666667e-01 +1130 1128 -3.33333333333333e-01 +1130 1121 -7.50000000000000e-01 +1130 1120 1.66666666666667e-01 +1130 720 -8.33333333333333e-02 +1130 1176 8.33333333333333e-02 +1130 771 -8.33333333333333e-02 +1130 1113 8.33333333333333e-02 +1130 1144 -8.33333333333333e-02 +1130 1114 -1.66666666666667e-01 +1130 1145 -2.50000000000000e-01 +1130 1143 1.66666666666667e-01 +1130 1122 -8.33333333333333e-02 +1130 876 8.33333333333333e-02 +1130 1123 1.66666666666667e-01 +1130 1129 -3.33333333333333e-01 +1130 889 1.66666666666667e-01 +1130 1124 -2.50000000000000e-01 +1130 877 8.33333333333333e-02 +1130 721 -8.33333333333333e-02 +1130 890 -7.50000000000000e-01 +1130 1117 8.33333333333333e-02 +1130 1258 8.33333333333333e-02 +1130 772 -8.33333333333333e-02 +1130 888 1.66666666666667e-01 +1130 1257 -1.66666666666667e-01 +1131 1131 2.50000000000000e+00 +1131 1169 8.33333333333333e-02 +1131 1168 -1.66666666666667e-01 +1131 1138 1.66666666666667e-01 +1131 1137 -7.50000000000000e-01 +1131 1064 8.33333333333333e-02 +1131 1063 8.33333333333333e-02 +1131 1067 1.66666666666667e-01 +1131 1066 -8.33333333333333e-02 +1131 1065 -2.50000000000000e-01 +1131 1133 -3.33333333333333e-01 +1131 725 -8.33333333333333e-02 +1131 731 -8.33333333333333e-02 +1131 1181 -8.33333333333333e-02 +1131 1178 8.33333333333333e-02 +1131 1148 -1.66666666666667e-01 +1131 1145 1.66666666666667e-01 +1131 1147 8.33333333333333e-02 +1131 1144 -8.33333333333333e-02 +1131 1143 -2.50000000000000e-01 +1131 1180 -8.33333333333333e-02 +1131 1177 8.33333333333333e-02 +1131 812 -8.33333333333333e-02 +1131 1115 8.33333333333333e-02 +1131 811 -8.33333333333333e-02 +1131 817 8.33333333333333e-02 +1131 1114 -1.66666666666667e-01 +1131 724 1.66666666666667e-01 +1131 723 -2.50000000000000e-01 +1131 1121 1.66666666666667e-01 +1131 818 -1.66666666666667e-01 +1131 1120 1.66666666666667e-01 +1131 1132 -3.33333333333333e-01 +1131 730 1.66666666666667e-01 +1131 1119 -7.50000000000000e-01 +1131 1139 1.66666666666667e-01 +1131 729 -2.50000000000000e-01 +1132 1132 2.50000000000000e+00 +1132 1139 -8.33333333333333e-02 +1132 1167 -1.66666666666667e-01 +1132 1138 -2.50000000000000e-01 +1132 1137 1.66666666666667e-01 +1132 1064 -1.66666666666667e-01 +1132 1062 8.33333333333333e-02 +1132 1067 1.66666666666667e-01 +1132 1066 -2.50000000000000e-01 +1132 1065 -8.33333333333333e-02 +1132 1181 -8.33333333333333e-02 +1132 1148 8.33333333333333e-02 +1132 725 1.66666666666667e-01 +1132 1133 -3.33333333333333e-01 +1132 1145 1.66666666666667e-01 +1132 1144 -2.50000000000000e-01 +1132 1146 8.33333333333333e-02 +1132 1143 -8.33333333333333e-02 +1132 731 1.66666666666667e-01 +1132 1178 -1.66666666666667e-01 +1132 1179 -8.33333333333333e-02 +1132 1176 8.33333333333333e-02 +1132 810 -8.33333333333333e-02 +1132 816 8.33333333333333e-02 +1132 1115 8.33333333333333e-02 +1132 812 -8.33333333333333e-02 +1132 724 -7.50000000000000e-01 +1132 1113 -1.66666666666667e-01 +1132 723 1.66666666666667e-01 +1132 1121 -8.33333333333333e-02 +1132 818 8.33333333333333e-02 +1132 1120 -2.50000000000000e-01 +1132 1169 8.33333333333333e-02 +1132 730 -7.50000000000000e-01 +1132 1119 1.66666666666667e-01 +1132 1131 -3.33333333333333e-01 +1132 729 1.66666666666667e-01 +1133 1133 2.50000000000000e+00 +1133 1138 -8.33333333333333e-02 +1133 1137 1.66666666666667e-01 +1133 1167 8.33333333333333e-02 +1133 1139 -2.50000000000000e-01 +1133 1062 8.33333333333333e-02 +1133 1063 -1.66666666666667e-01 +1133 1067 -7.50000000000000e-01 +1133 1066 1.66666666666667e-01 +1133 1065 1.66666666666667e-01 +1133 1131 -3.33333333333333e-01 +1133 723 -8.33333333333333e-02 +1133 729 -8.33333333333333e-02 +1133 1179 -8.33333333333333e-02 +1133 1176 8.33333333333333e-02 +1133 1180 -8.33333333333333e-02 +1133 1147 8.33333333333333e-02 +1133 1145 -7.50000000000000e-01 +1133 724 1.66666666666667e-01 +1133 1132 -3.33333333333333e-01 +1133 1144 1.66666666666667e-01 +1133 1146 -1.66666666666667e-01 +1133 1143 1.66666666666667e-01 +1133 730 1.66666666666667e-01 +1133 1177 -1.66666666666667e-01 +1133 810 -8.33333333333333e-02 +1133 1113 8.33333333333333e-02 +1133 725 -2.50000000000000e-01 +1133 1114 8.33333333333333e-02 +1133 811 -8.33333333333333e-02 +1133 1121 -2.50000000000000e-01 +1133 1168 8.33333333333333e-02 +1133 731 -2.50000000000000e-01 +1133 1120 -8.33333333333333e-02 +1133 817 8.33333333333333e-02 +1133 1119 1.66666666666667e-01 +1133 816 -1.66666666666667e-01 +1134 1134 1.25000000000000e+00 +1134 1139 -8.33333333333333e-02 +1134 1072 -4.16666666666667e-02 +1134 1063 4.16666666666667e-02 +1134 1073 8.33333333333333e-02 +1134 736 8.33333333333333e-02 +1134 1192 -1.66666666666667e-01 +1134 1071 -1.25000000000000e-01 +1134 1064 -8.33333333333333e-02 +1134 1135 -1.66666666666667e-01 +1134 1138 1.66666666666667e-01 +1134 724 8.33333333333333e-02 +1134 1137 -2.50000000000000e-01 +1134 1196 -8.33333333333333e-02 +1134 1148 8.33333333333333e-02 +1134 737 8.33333333333333e-02 +1134 896 -8.33333333333333e-02 +1134 895 4.16666666666667e-02 +1134 1195 -8.33333333333333e-02 +1134 735 -3.75000000000000e-01 +1134 1136 -1.66666666666667e-01 +1134 893 8.33333333333333e-02 +1134 725 8.33333333333333e-02 +1134 892 -4.16666666666667e-02 +1134 1147 8.33333333333333e-02 +1134 1193 8.33333333333333e-02 +1134 891 -1.25000000000000e-01 +1134 723 -3.75000000000000e-01 +1135 1135 1.25000000000000e+00 +1135 1073 8.33333333333333e-02 +1135 1139 1.66666666666667e-01 +1135 1071 -4.16666666666667e-02 +1135 1062 4.16666666666667e-02 +1135 737 -4.16666666666667e-02 +1135 1193 8.33333333333333e-02 +1135 1072 -1.25000000000000e-01 +1135 735 8.33333333333333e-02 +1135 1191 -1.66666666666667e-01 +1135 1064 4.16666666666667e-02 +1135 725 -4.16666666666667e-02 +1135 1138 -7.50000000000000e-01 +1135 1134 -1.66666666666667e-01 +1135 1137 1.66666666666667e-01 +1135 723 8.33333333333333e-02 +1135 896 4.16666666666667e-02 +1135 1196 -8.33333333333333e-02 +1135 736 -1.25000000000000e-01 +1135 894 4.16666666666667e-02 +1135 1194 -8.33333333333333e-02 +1135 893 8.33333333333333e-02 +1135 1148 -1.66666666666667e-01 +1135 1136 -1.66666666666667e-01 +1135 892 -1.25000000000000e-01 +1135 724 -1.25000000000000e-01 +1135 891 -4.16666666666667e-02 +1135 1146 8.33333333333333e-02 +1136 1136 1.25000000000000e+00 +1136 1137 -8.33333333333333e-02 +1136 1135 -1.66666666666667e-01 +1136 1072 8.33333333333333e-02 +1136 1138 1.66666666666667e-01 +1136 1073 -3.75000000000000e-01 +1136 736 -4.16666666666667e-02 +1136 1192 8.33333333333333e-02 +1136 1071 8.33333333333333e-02 +1136 1139 -2.50000000000000e-01 +1136 1063 4.16666666666667e-02 +1136 724 -4.16666666666667e-02 +1136 1062 -8.33333333333333e-02 +1136 895 4.16666666666667e-02 +1136 1195 -8.33333333333333e-02 +1136 1194 -8.33333333333333e-02 +1136 1146 8.33333333333333e-02 +1136 737 -1.25000000000000e-01 +1136 735 8.33333333333333e-02 +1136 894 -8.33333333333333e-02 +1136 1191 8.33333333333333e-02 +1136 893 -3.75000000000000e-01 +1136 725 -1.25000000000000e-01 +1136 892 8.33333333333333e-02 +1136 1147 -1.66666666666667e-01 +1136 1134 -1.66666666666667e-01 +1136 891 8.33333333333333e-02 +1136 723 8.33333333333333e-02 +1137 1137 2.50000000000000e+00 +1137 1180 8.33333333333333e-02 +1137 1201 -8.33333333333333e-02 +1137 1148 1.66666666666667e-01 +1137 1196 -1.66666666666667e-01 +1137 1147 -8.33333333333333e-02 +1137 1195 8.33333333333333e-02 +1137 1202 -8.33333333333333e-02 +1137 1146 -2.50000000000000e-01 +1137 1073 8.33333333333333e-02 +1137 1136 -8.33333333333333e-02 +1137 1072 8.33333333333333e-02 +1137 1193 1.66666666666667e-01 +1137 1139 -3.33333333333333e-01 +1137 1192 1.66666666666667e-01 +1137 1191 -7.50000000000000e-01 +1137 1135 1.66666666666667e-01 +1137 1134 -2.50000000000000e-01 +1137 1138 -3.33333333333333e-01 +1137 1075 -8.33333333333333e-02 +1137 1076 1.66666666666667e-01 +1137 1067 -1.66666666666667e-01 +1137 1133 1.66666666666667e-01 +1137 1063 -8.33333333333333e-02 +1137 1066 8.33333333333333e-02 +1137 740 8.33333333333333e-02 +1137 1169 -8.33333333333333e-02 +1137 739 -1.66666666666667e-01 +1137 1168 1.66666666666667e-01 +1137 1074 -2.50000000000000e-01 +1137 1167 -2.50000000000000e-01 +1137 1064 -8.33333333333333e-02 +1137 725 8.33333333333333e-02 +1137 1132 1.66666666666667e-01 +1137 724 -1.66666666666667e-01 +1137 1181 8.33333333333333e-02 +1137 1131 -7.50000000000000e-01 +1138 1138 2.50000000000000e+00 +1138 1179 8.33333333333333e-02 +1138 1200 -8.33333333333333e-02 +1138 1202 -8.33333333333333e-02 +1138 1196 8.33333333333333e-02 +1138 1146 -8.33333333333333e-02 +1138 1194 8.33333333333333e-02 +1138 1148 1.66666666666667e-01 +1138 1147 -2.50000000000000e-01 +1138 1136 1.66666666666667e-01 +1138 1073 -1.66666666666667e-01 +1138 1071 8.33333333333333e-02 +1138 1193 -8.33333333333333e-02 +1138 740 8.33333333333333e-02 +1138 1192 -2.50000000000000e-01 +1138 1191 1.66666666666667e-01 +1138 725 8.33333333333333e-02 +1138 1135 -7.50000000000000e-01 +1138 1134 1.66666666666667e-01 +1138 1133 -8.33333333333333e-02 +1138 1137 -3.33333333333333e-01 +1138 1074 -8.33333333333333e-02 +1138 1067 8.33333333333333e-02 +1138 1064 -8.33333333333333e-02 +1138 1062 -8.33333333333333e-02 +1138 1065 8.33333333333333e-02 +1138 1076 1.66666666666667e-01 +1138 1169 1.66666666666667e-01 +1138 1139 -3.33333333333333e-01 +1138 1075 -2.50000000000000e-01 +1138 1168 -7.50000000000000e-01 +1138 738 -1.66666666666667e-01 +1138 1167 1.66666666666667e-01 +1138 1181 -1.66666666666667e-01 +1138 1132 -2.50000000000000e-01 +1138 1131 1.66666666666667e-01 +1138 723 -1.66666666666667e-01 +1139 1139 2.50000000000000e+00 +1139 1180 -1.66666666666667e-01 +1139 1201 -8.33333333333333e-02 +1139 1195 8.33333333333333e-02 +1139 1146 1.66666666666667e-01 +1139 1194 -1.66666666666667e-01 +1139 1200 -8.33333333333333e-02 +1139 1148 -7.50000000000000e-01 +1139 1147 1.66666666666667e-01 +1139 1071 8.33333333333333e-02 +1139 1134 -8.33333333333333e-02 +1139 1135 1.66666666666667e-01 +1139 1072 -1.66666666666667e-01 +1139 1193 -2.50000000000000e-01 +1139 1192 -8.33333333333333e-02 +1139 739 8.33333333333333e-02 +1139 1191 1.66666666666667e-01 +1139 1137 -3.33333333333333e-01 +1139 1136 -2.50000000000000e-01 +1139 724 8.33333333333333e-02 +1139 1132 -8.33333333333333e-02 +1139 1066 8.33333333333333e-02 +1139 1063 -8.33333333333333e-02 +1139 1074 1.66666666666667e-01 +1139 1065 -1.66666666666667e-01 +1139 1131 1.66666666666667e-01 +1139 1076 -7.50000000000000e-01 +1139 1169 -2.50000000000000e-01 +1139 1075 1.66666666666667e-01 +1139 1168 1.66666666666667e-01 +1139 1138 -3.33333333333333e-01 +1139 738 8.33333333333333e-02 +1139 1167 -8.33333333333333e-02 +1139 1179 8.33333333333333e-02 +1139 1133 -2.50000000000000e-01 +1139 1062 -8.33333333333333e-02 +1139 723 8.33333333333333e-02 +1140 1140 1.25000000000000e+00 +1140 1141 -1.66666666666667e-01 +1140 1115 -8.33333333333333e-02 +1140 724 -4.16666666666667e-02 +1140 1114 4.16666666666667e-02 +1140 1124 8.33333333333333e-02 +1140 766 -4.16666666666667e-02 +1140 1122 -3.75000000000000e-01 +1140 1258 8.33333333333333e-02 +1140 1145 -8.33333333333333e-02 +1140 1144 1.66666666666667e-01 +1140 1143 -2.50000000000000e-01 +1140 1259 8.33333333333333e-02 +1140 1148 8.33333333333333e-02 +1140 1262 -8.33333333333333e-02 +1140 898 4.16666666666667e-02 +1140 1261 -8.33333333333333e-02 +1140 767 8.33333333333333e-02 +1140 899 -8.33333333333333e-02 +1140 765 -1.25000000000000e-01 +1140 1142 -1.66666666666667e-01 +1140 893 8.33333333333333e-02 +1140 725 8.33333333333333e-02 +1140 892 8.33333333333333e-02 +1140 1147 -1.66666666666667e-01 +1140 1123 8.33333333333333e-02 +1140 891 -3.75000000000000e-01 +1140 723 -1.25000000000000e-01 +1141 1141 1.25000000000000e+00 +1141 1115 4.16666666666667e-02 +1141 1122 8.33333333333333e-02 +1141 1140 -1.66666666666667e-01 +1141 723 -4.16666666666667e-02 +1141 1113 4.16666666666667e-02 +1141 1123 -1.25000000000000e-01 +1141 765 -4.16666666666667e-02 +1141 1257 8.33333333333333e-02 +1141 725 8.33333333333333e-02 +1141 1142 -1.66666666666667e-01 +1141 1145 1.66666666666667e-01 +1141 1144 -7.50000000000000e-01 +1141 1143 1.66666666666667e-01 +1141 767 8.33333333333333e-02 +1141 1259 -1.66666666666667e-01 +1141 897 4.16666666666667e-02 +1141 1260 -8.33333333333333e-02 +1141 899 4.16666666666667e-02 +1141 1262 -8.33333333333333e-02 +1141 766 -1.25000000000000e-01 +1141 893 -4.16666666666667e-02 +1141 1148 8.33333333333333e-02 +1141 1124 -4.16666666666667e-02 +1141 892 -1.25000000000000e-01 +1141 724 -1.25000000000000e-01 +1141 891 8.33333333333333e-02 +1141 1146 -1.66666666666667e-01 +1142 1142 1.25000000000000e+00 +1142 1114 4.16666666666667e-02 +1142 1113 -8.33333333333333e-02 +1142 1124 -1.25000000000000e-01 +1142 1122 8.33333333333333e-02 +1142 1145 -2.50000000000000e-01 +1142 724 8.33333333333333e-02 +1142 1141 -1.66666666666667e-01 +1142 1144 1.66666666666667e-01 +1142 1143 -8.33333333333333e-02 +1142 766 8.33333333333333e-02 +1142 1258 -1.66666666666667e-01 +1142 1257 8.33333333333333e-02 +1142 1146 8.33333333333333e-02 +1142 1260 -8.33333333333333e-02 +1142 767 -3.75000000000000e-01 +1142 898 4.16666666666667e-02 +1142 1261 -8.33333333333333e-02 +1142 765 8.33333333333333e-02 +1142 897 -8.33333333333333e-02 +1142 1123 -4.16666666666667e-02 +1142 893 -1.25000000000000e-01 +1142 725 -3.75000000000000e-01 +1142 892 -4.16666666666667e-02 +1142 1147 8.33333333333333e-02 +1142 1140 -1.66666666666667e-01 +1142 891 8.33333333333333e-02 +1142 723 8.33333333333333e-02 +1143 1143 2.50000000000000e+00 +1143 1121 -1.66666666666667e-01 +1143 1124 8.33333333333333e-02 +1143 1115 -8.33333333333333e-02 +1143 1123 -1.66666666666667e-01 +1143 1129 1.66666666666667e-01 +1143 1114 -8.33333333333333e-02 +1143 1130 1.66666666666667e-01 +1143 1128 -7.50000000000000e-01 +1143 1261 8.33333333333333e-02 +1143 1258 -8.33333333333333e-02 +1143 1262 -1.66666666666667e-01 +1143 1259 1.66666666666667e-01 +1143 725 8.33333333333333e-02 +1143 1142 -8.33333333333333e-02 +1143 1141 1.66666666666667e-01 +1143 1144 -3.33333333333333e-01 +1143 1140 -2.50000000000000e-01 +1143 773 8.33333333333333e-02 +1143 1257 -2.50000000000000e-01 +1143 1178 -8.33333333333333e-02 +1143 1181 8.33333333333333e-02 +1143 1271 -8.33333333333333e-02 +1143 1147 1.66666666666667e-01 +1143 1180 -1.66666666666667e-01 +1143 1177 1.66666666666667e-01 +1143 1148 1.66666666666667e-01 +1143 1133 1.66666666666667e-01 +1143 1145 -3.33333333333333e-01 +1143 724 8.33333333333333e-02 +1143 1132 -8.33333333333333e-02 +1143 1146 -7.50000000000000e-01 +1143 1131 -2.50000000000000e-01 +1143 1270 -8.33333333333333e-02 +1143 772 8.33333333333333e-02 +1143 1120 8.33333333333333e-02 +1143 1176 -2.50000000000000e-01 +1144 1144 2.50000000000000e+00 +1144 1121 8.33333333333333e-02 +1144 1115 -8.33333333333333e-02 +1144 1124 8.33333333333333e-02 +1144 1130 -8.33333333333333e-02 +1144 1122 -1.66666666666667e-01 +1144 1128 1.66666666666667e-01 +1144 1113 -8.33333333333333e-02 +1144 1129 -2.50000000000000e-01 +1144 1260 8.33333333333333e-02 +1144 1257 -8.33333333333333e-02 +1144 1262 8.33333333333333e-02 +1144 1142 1.66666666666667e-01 +1144 1141 -7.50000000000000e-01 +1144 1140 1.66666666666667e-01 +1144 1143 -3.33333333333333e-01 +1144 1259 1.66666666666667e-01 +1144 1258 -2.50000000000000e-01 +1144 1145 -3.33333333333333e-01 +1144 1148 -8.33333333333333e-02 +1144 1146 1.66666666666667e-01 +1144 1181 8.33333333333333e-02 +1144 1271 -8.33333333333333e-02 +1144 1179 -1.66666666666667e-01 +1144 1176 1.66666666666667e-01 +1144 725 -1.66666666666667e-01 +1144 1133 1.66666666666667e-01 +1144 1147 -2.50000000000000e-01 +1144 1132 -2.50000000000000e-01 +1144 723 8.33333333333333e-02 +1144 1131 -8.33333333333333e-02 +1144 1178 1.66666666666667e-01 +1144 773 -1.66666666666667e-01 +1144 1119 8.33333333333333e-02 +1144 1177 -7.50000000000000e-01 +1144 1269 -8.33333333333333e-02 +1144 771 8.33333333333333e-02 +1145 1145 2.50000000000000e+00 +1145 1119 -1.66666666666667e-01 +1145 1114 -8.33333333333333e-02 +1145 1122 8.33333333333333e-02 +1145 1113 -8.33333333333333e-02 +1145 1123 8.33333333333333e-02 +1145 1129 -8.33333333333333e-02 +1145 1130 -2.50000000000000e-01 +1145 1128 1.66666666666667e-01 +1145 1261 8.33333333333333e-02 +1145 1260 -1.66666666666667e-01 +1145 1257 1.66666666666667e-01 +1145 1142 -2.50000000000000e-01 +1145 1141 1.66666666666667e-01 +1145 723 8.33333333333333e-02 +1145 1140 -8.33333333333333e-02 +1145 1259 -7.50000000000000e-01 +1145 1258 1.66666666666667e-01 +1145 771 8.33333333333333e-02 +1145 1144 -3.33333333333333e-01 +1145 1176 -8.33333333333333e-02 +1145 1147 -8.33333333333333e-02 +1145 1179 8.33333333333333e-02 +1145 1269 -8.33333333333333e-02 +1145 1180 8.33333333333333e-02 +1145 1270 -8.33333333333333e-02 +1145 1148 -2.50000000000000e-01 +1145 1133 -7.50000000000000e-01 +1145 724 -1.66666666666667e-01 +1145 1132 1.66666666666667e-01 +1145 1146 1.66666666666667e-01 +1145 1131 1.66666666666667e-01 +1145 1143 -3.33333333333333e-01 +1145 1120 8.33333333333333e-02 +1145 1178 -2.50000000000000e-01 +1145 1177 1.66666666666667e-01 +1145 772 -1.66666666666667e-01 +1146 1146 2.50000000000000e+00 +1146 1138 -8.33333333333333e-02 +1146 1202 8.33333333333333e-02 +1146 1201 -1.66666666666667e-01 +1146 1137 -2.50000000000000e-01 +1146 1136 8.33333333333333e-02 +1146 1195 1.66666666666667e-01 +1146 1196 1.66666666666667e-01 +1146 1194 -7.50000000000000e-01 +1146 1135 8.33333333333333e-02 +1146 1148 -3.33333333333333e-01 +1146 725 -8.33333333333333e-02 +1146 776 -8.33333333333333e-02 +1146 1181 -8.33333333333333e-02 +1146 1271 8.33333333333333e-02 +1146 1180 1.66666666666667e-01 +1146 1147 -3.33333333333333e-01 +1146 1144 1.66666666666667e-01 +1146 1133 -1.66666666666667e-01 +1146 1145 1.66666666666667e-01 +1146 724 -8.33333333333333e-02 +1146 1132 8.33333333333333e-02 +1146 1143 -7.50000000000000e-01 +1146 775 -8.33333333333333e-02 +1146 1270 8.33333333333333e-02 +1146 1179 -2.50000000000000e-01 +1146 893 -8.33333333333333e-02 +1146 1142 8.33333333333333e-02 +1146 901 8.33333333333333e-02 +1146 1261 -8.33333333333333e-02 +1146 1141 -1.66666666666667e-01 +1146 892 1.66666666666667e-01 +1146 891 -2.50000000000000e-01 +1146 1262 1.66666666666667e-01 +1146 902 -1.66666666666667e-01 +1146 1260 -2.50000000000000e-01 +1146 1139 1.66666666666667e-01 +1147 1147 2.50000000000000e+00 +1147 1137 -8.33333333333333e-02 +1147 1200 -1.66666666666667e-01 +1147 1139 1.66666666666667e-01 +1147 1138 -2.50000000000000e-01 +1147 1196 -8.33333333333333e-02 +1147 1194 1.66666666666667e-01 +1147 1195 -2.50000000000000e-01 +1147 1136 -1.66666666666667e-01 +1147 1134 8.33333333333333e-02 +1147 1133 8.33333333333333e-02 +1147 1145 -8.33333333333333e-02 +1147 1179 1.66666666666667e-01 +1147 1146 -3.33333333333333e-01 +1147 1143 1.66666666666667e-01 +1147 1144 -2.50000000000000e-01 +1147 723 -8.33333333333333e-02 +1147 1131 8.33333333333333e-02 +1147 1181 1.66666666666667e-01 +1147 1271 -1.66666666666667e-01 +1147 1180 -7.50000000000000e-01 +1147 774 -8.33333333333333e-02 +1147 1269 8.33333333333333e-02 +1147 893 1.66666666666667e-01 +1147 1148 -3.33333333333333e-01 +1147 1262 1.66666666666667e-01 +1147 900 8.33333333333333e-02 +1147 1260 -8.33333333333333e-02 +1147 1142 8.33333333333333e-02 +1147 725 -8.33333333333333e-02 +1147 892 -7.50000000000000e-01 +1147 1140 -1.66666666666667e-01 +1147 891 1.66666666666667e-01 +1147 902 8.33333333333333e-02 +1147 776 -8.33333333333333e-02 +1147 1261 -2.50000000000000e-01 +1147 1202 8.33333333333333e-02 +1148 1148 2.50000000000000e+00 +1148 1137 1.66666666666667e-01 +1148 1200 8.33333333333333e-02 +1148 1139 -7.50000000000000e-01 +1148 1138 1.66666666666667e-01 +1148 1195 -8.33333333333333e-02 +1148 1134 8.33333333333333e-02 +1148 1196 -2.50000000000000e-01 +1148 1194 1.66666666666667e-01 +1148 1135 -1.66666666666667e-01 +1148 1146 -3.33333333333333e-01 +1148 723 -8.33333333333333e-02 +1148 774 -8.33333333333333e-02 +1148 1132 8.33333333333333e-02 +1148 1144 -8.33333333333333e-02 +1148 1179 -8.33333333333333e-02 +1148 1269 8.33333333333333e-02 +1148 1145 -2.50000000000000e-01 +1148 1131 -1.66666666666667e-01 +1148 1143 1.66666666666667e-01 +1148 1181 -2.50000000000000e-01 +1148 1180 1.66666666666667e-01 +1148 1270 -1.66666666666667e-01 +1148 891 -8.33333333333333e-02 +1148 1140 8.33333333333333e-02 +1148 892 1.66666666666667e-01 +1148 1147 -3.33333333333333e-01 +1148 1261 1.66666666666667e-01 +1148 893 -2.50000000000000e-01 +1148 1141 8.33333333333333e-02 +1148 724 -8.33333333333333e-02 +1148 1262 -7.50000000000000e-01 +1148 1201 8.33333333333333e-02 +1148 901 8.33333333333333e-02 +1148 775 -8.33333333333333e-02 +1148 1260 1.66666666666667e-01 +1148 900 -1.66666666666667e-01 +1149 1149 2.50000000000000e+00 +1149 1157 -8.33333333333333e-02 +1149 1171 -1.66666666666667e-01 +1149 1156 1.66666666666667e-01 +1149 1155 -2.50000000000000e-01 +1149 1082 -1.66666666666667e-01 +1149 1081 8.33333333333333e-02 +1149 1085 1.66666666666667e-01 +1149 1084 -8.33333333333333e-02 +1149 1083 -2.50000000000000e-01 +1149 1184 -8.33333333333333e-02 +1149 1166 8.33333333333333e-02 +1149 728 1.66666666666667e-01 +1149 1151 -3.33333333333333e-01 +1149 1163 1.66666666666667e-01 +1149 1165 8.33333333333333e-02 +1149 1162 -8.33333333333333e-02 +1149 1161 -2.50000000000000e-01 +1149 731 1.66666666666667e-01 +1149 1178 -1.66666666666667e-01 +1149 1183 -8.33333333333333e-02 +1149 1177 8.33333333333333e-02 +1149 814 -8.33333333333333e-02 +1149 817 8.33333333333333e-02 +1149 1118 8.33333333333333e-02 +1149 815 -8.33333333333333e-02 +1149 727 1.66666666666667e-01 +1149 1117 -1.66666666666667e-01 +1149 726 -7.50000000000000e-01 +1149 1121 -8.33333333333333e-02 +1149 818 8.33333333333333e-02 +1149 1150 -3.33333333333333e-01 +1149 1120 1.66666666666667e-01 +1149 730 1.66666666666667e-01 +1149 1172 8.33333333333333e-02 +1149 1119 -2.50000000000000e-01 +1149 729 -7.50000000000000e-01 +1150 1150 2.50000000000000e+00 +1150 1172 8.33333333333333e-02 +1150 1170 -1.66666666666667e-01 +1150 1156 -7.50000000000000e-01 +1150 1155 1.66666666666667e-01 +1150 1082 8.33333333333333e-02 +1150 1080 8.33333333333333e-02 +1150 1085 1.66666666666667e-01 +1150 1084 -2.50000000000000e-01 +1150 1083 -8.33333333333333e-02 +1150 1151 -3.33333333333333e-01 +1150 731 -8.33333333333333e-02 +1150 728 -8.33333333333333e-02 +1150 1178 8.33333333333333e-02 +1150 1184 -8.33333333333333e-02 +1150 1166 -1.66666666666667e-01 +1150 1163 1.66666666666667e-01 +1150 1162 -2.50000000000000e-01 +1150 1164 8.33333333333333e-02 +1150 1161 -8.33333333333333e-02 +1150 1182 -8.33333333333333e-02 +1150 1176 8.33333333333333e-02 +1150 1118 8.33333333333333e-02 +1150 815 -8.33333333333333e-02 +1150 813 -8.33333333333333e-02 +1150 816 8.33333333333333e-02 +1150 727 -2.50000000000000e-01 +1150 726 1.66666666666667e-01 +1150 1116 -1.66666666666667e-01 +1150 1121 1.66666666666667e-01 +1150 818 -1.66666666666667e-01 +1150 1157 1.66666666666667e-01 +1150 1120 -7.50000000000000e-01 +1150 730 -2.50000000000000e-01 +1150 1149 -3.33333333333333e-01 +1150 1119 1.66666666666667e-01 +1150 729 1.66666666666667e-01 +1151 1151 2.50000000000000e+00 +1151 1155 -8.33333333333333e-02 +1151 1156 1.66666666666667e-01 +1151 1171 8.33333333333333e-02 +1151 1157 -2.50000000000000e-01 +1151 1081 8.33333333333333e-02 +1151 1080 -1.66666666666667e-01 +1151 1085 -7.50000000000000e-01 +1151 1084 1.66666666666667e-01 +1151 1083 1.66666666666667e-01 +1151 1150 -3.33333333333333e-01 +1151 730 -8.33333333333333e-02 +1151 727 -8.33333333333333e-02 +1151 1177 8.33333333333333e-02 +1151 1183 -8.33333333333333e-02 +1151 1182 -8.33333333333333e-02 +1151 1164 8.33333333333333e-02 +1151 1163 -7.50000000000000e-01 +1151 1165 -1.66666666666667e-01 +1151 1162 1.66666666666667e-01 +1151 726 1.66666666666667e-01 +1151 1149 -3.33333333333333e-01 +1151 1161 1.66666666666667e-01 +1151 729 1.66666666666667e-01 +1151 1176 -1.66666666666667e-01 +1151 1117 8.33333333333333e-02 +1151 814 -8.33333333333333e-02 +1151 728 -2.50000000000000e-01 +1151 1116 8.33333333333333e-02 +1151 813 -8.33333333333333e-02 +1151 1170 8.33333333333333e-02 +1151 1121 -2.50000000000000e-01 +1151 731 -2.50000000000000e-01 +1151 1120 1.66666666666667e-01 +1151 817 -1.66666666666667e-01 +1151 1119 -8.33333333333333e-02 +1151 816 8.33333333333333e-02 +1152 1152 2.50000000000000e+00 +1152 1229 8.33333333333333e-02 +1152 1228 -1.66666666666667e-01 +1152 1156 1.66666666666667e-01 +1152 1155 -7.50000000000000e-01 +1152 1232 -8.33333333333333e-02 +1152 1231 -8.33333333333333e-02 +1152 1166 -1.66666666666667e-01 +1152 1165 8.33333333333333e-02 +1152 1082 8.33333333333333e-02 +1152 1091 1.66666666666667e-01 +1152 1090 -8.33333333333333e-02 +1152 1089 -2.50000000000000e-01 +1152 1081 8.33333333333333e-02 +1152 997 8.33333333333333e-02 +1152 988 -8.33333333333333e-02 +1152 989 -8.33333333333333e-02 +1152 998 -1.66666666666667e-01 +1152 1049 1.66666666666667e-01 +1152 1154 -3.33333333333333e-01 +1152 911 1.66666666666667e-01 +1152 916 8.33333333333333e-02 +1152 910 -8.33333333333333e-02 +1152 728 -8.33333333333333e-02 +1152 1043 8.33333333333333e-02 +1152 727 1.66666666666667e-01 +1152 1042 -1.66666666666667e-01 +1152 726 -2.50000000000000e-01 +1152 909 -2.50000000000000e-01 +1152 752 -8.33333333333333e-02 +1152 917 8.33333333333333e-02 +1152 1153 -3.33333333333333e-01 +1152 751 1.66666666666667e-01 +1152 1048 1.66666666666667e-01 +1152 1157 1.66666666666667e-01 +1152 750 -2.50000000000000e-01 +1152 1047 -7.50000000000000e-01 +1153 1153 2.50000000000000e+00 +1153 1157 -8.33333333333333e-02 +1153 1227 -1.66666666666667e-01 +1153 1156 -2.50000000000000e-01 +1153 1155 1.66666666666667e-01 +1153 1232 -8.33333333333333e-02 +1153 1166 8.33333333333333e-02 +1153 1230 -8.33333333333333e-02 +1153 1164 8.33333333333333e-02 +1153 1091 1.66666666666667e-01 +1153 1090 -2.50000000000000e-01 +1153 1089 -8.33333333333333e-02 +1153 1082 -1.66666666666667e-01 +1153 1080 8.33333333333333e-02 +1153 996 8.33333333333333e-02 +1153 987 -8.33333333333333e-02 +1153 998 8.33333333333333e-02 +1153 989 -8.33333333333333e-02 +1153 1049 -8.33333333333333e-02 +1153 1043 8.33333333333333e-02 +1153 915 8.33333333333333e-02 +1153 909 -8.33333333333333e-02 +1153 728 1.66666666666667e-01 +1153 1154 -3.33333333333333e-01 +1153 911 1.66666666666667e-01 +1153 727 -7.50000000000000e-01 +1153 910 -2.50000000000000e-01 +1153 726 1.66666666666667e-01 +1153 1041 -1.66666666666667e-01 +1153 752 1.66666666666667e-01 +1153 917 -1.66666666666667e-01 +1153 1229 8.33333333333333e-02 +1153 751 -7.50000000000000e-01 +1153 1048 -2.50000000000000e-01 +1153 1152 -3.33333333333333e-01 +1153 750 1.66666666666667e-01 +1153 1047 1.66666666666667e-01 +1154 1154 2.50000000000000e+00 +1154 1156 -8.33333333333333e-02 +1154 1155 1.66666666666667e-01 +1154 1227 8.33333333333333e-02 +1154 1157 -2.50000000000000e-01 +1154 1230 -8.33333333333333e-02 +1154 1231 -8.33333333333333e-02 +1154 1165 8.33333333333333e-02 +1154 1164 -1.66666666666667e-01 +1154 1080 8.33333333333333e-02 +1154 1091 -7.50000000000000e-01 +1154 1090 1.66666666666667e-01 +1154 1089 1.66666666666667e-01 +1154 1081 -1.66666666666667e-01 +1154 987 -8.33333333333333e-02 +1154 997 8.33333333333333e-02 +1154 996 -1.66666666666667e-01 +1154 988 -8.33333333333333e-02 +1154 1048 -8.33333333333333e-02 +1154 1042 8.33333333333333e-02 +1154 1047 1.66666666666667e-01 +1154 1152 -3.33333333333333e-01 +1154 909 1.66666666666667e-01 +1154 728 -2.50000000000000e-01 +1154 911 -7.50000000000000e-01 +1154 727 1.66666666666667e-01 +1154 1153 -3.33333333333333e-01 +1154 910 1.66666666666667e-01 +1154 726 -8.33333333333333e-02 +1154 1041 8.33333333333333e-02 +1154 1228 8.33333333333333e-02 +1154 752 -2.50000000000000e-01 +1154 1049 -2.50000000000000e-01 +1154 751 1.66666666666667e-01 +1154 916 -1.66666666666667e-01 +1154 750 -8.33333333333333e-02 +1154 915 8.33333333333333e-02 +1155 1155 2.50000000000000e+00 +1155 1183 8.33333333333333e-02 +1155 1237 -8.33333333333333e-02 +1155 1232 8.33333333333333e-02 +1155 1238 -8.33333333333333e-02 +1155 1231 8.33333333333333e-02 +1155 1165 -8.33333333333333e-02 +1155 1166 1.66666666666667e-01 +1155 1164 -2.50000000000000e-01 +1155 1091 -1.66666666666667e-01 +1155 1154 1.66666666666667e-01 +1155 1090 8.33333333333333e-02 +1155 755 8.33333333333333e-02 +1155 1229 -8.33333333333333e-02 +1155 1228 1.66666666666667e-01 +1155 1227 -2.50000000000000e-01 +1155 728 8.33333333333333e-02 +1155 1153 1.66666666666667e-01 +1155 1152 -7.50000000000000e-01 +1155 1151 -8.33333333333333e-02 +1155 1156 -3.33333333333333e-01 +1155 1093 -8.33333333333333e-02 +1155 1085 8.33333333333333e-02 +1155 1082 -8.33333333333333e-02 +1155 1084 8.33333333333333e-02 +1155 1081 -8.33333333333333e-02 +1155 1094 1.66666666666667e-01 +1155 1172 1.66666666666667e-01 +1155 1157 -3.33333333333333e-01 +1155 754 -1.66666666666667e-01 +1155 1171 1.66666666666667e-01 +1155 1092 -2.50000000000000e-01 +1155 1170 -7.50000000000000e-01 +1155 1150 1.66666666666667e-01 +1155 727 -1.66666666666667e-01 +1155 1184 -1.66666666666667e-01 +1155 1149 -2.50000000000000e-01 +1156 1156 2.50000000000000e+00 +1156 1182 8.33333333333333e-02 +1156 1236 -8.33333333333333e-02 +1156 1232 -1.66666666666667e-01 +1156 1166 1.66666666666667e-01 +1156 1230 8.33333333333333e-02 +1156 1164 -8.33333333333333e-02 +1156 1238 -8.33333333333333e-02 +1156 1165 -2.50000000000000e-01 +1156 1091 8.33333333333333e-02 +1156 1154 -8.33333333333333e-02 +1156 1089 8.33333333333333e-02 +1156 1229 1.66666666666667e-01 +1156 1157 -3.33333333333333e-01 +1156 1228 -7.50000000000000e-01 +1156 1227 1.66666666666667e-01 +1156 1153 -2.50000000000000e-01 +1156 1152 1.66666666666667e-01 +1156 1155 -3.33333333333333e-01 +1156 1092 -8.33333333333333e-02 +1156 1094 1.66666666666667e-01 +1156 1085 -1.66666666666667e-01 +1156 1151 1.66666666666667e-01 +1156 1083 8.33333333333333e-02 +1156 1080 -8.33333333333333e-02 +1156 755 8.33333333333333e-02 +1156 1172 -8.33333333333333e-02 +1156 1093 -2.50000000000000e-01 +1156 1171 -2.50000000000000e-01 +1156 753 -1.66666666666667e-01 +1156 1170 1.66666666666667e-01 +1156 1082 -8.33333333333333e-02 +1156 728 8.33333333333333e-02 +1156 1184 8.33333333333333e-02 +1156 1150 -7.50000000000000e-01 +1156 1149 1.66666666666667e-01 +1156 726 -1.66666666666667e-01 +1157 1157 2.50000000000000e+00 +1157 1182 -1.66666666666667e-01 +1157 1230 8.33333333333333e-02 +1157 1236 -8.33333333333333e-02 +1157 1231 -1.66666666666667e-01 +1157 1165 1.66666666666667e-01 +1157 1237 -8.33333333333333e-02 +1157 1166 -7.50000000000000e-01 +1157 1164 1.66666666666667e-01 +1157 1090 8.33333333333333e-02 +1157 1153 -8.33333333333333e-02 +1157 1089 -1.66666666666667e-01 +1157 1152 1.66666666666667e-01 +1157 1229 -2.50000000000000e-01 +1157 1228 1.66666666666667e-01 +1157 1156 -3.33333333333333e-01 +1157 753 8.33333333333333e-02 +1157 1227 -8.33333333333333e-02 +1157 1154 -2.50000000000000e-01 +1157 726 8.33333333333333e-02 +1157 1149 -8.33333333333333e-02 +1157 1093 1.66666666666667e-01 +1157 1083 8.33333333333333e-02 +1157 1080 -8.33333333333333e-02 +1157 1084 -1.66666666666667e-01 +1157 1150 1.66666666666667e-01 +1157 1094 -7.50000000000000e-01 +1157 1172 -2.50000000000000e-01 +1157 754 8.33333333333333e-02 +1157 1171 -8.33333333333333e-02 +1157 1092 1.66666666666667e-01 +1157 1170 1.66666666666667e-01 +1157 1155 -3.33333333333333e-01 +1157 1183 8.33333333333333e-02 +1157 1151 -2.50000000000000e-01 +1157 1081 -8.33333333333333e-02 +1157 727 8.33333333333333e-02 +1158 1158 2.50000000000000e+00 +1158 1265 -1.66666666666667e-01 +1158 1163 1.66666666666667e-01 +1158 1162 1.66666666666667e-01 +1158 1161 -7.50000000000000e-01 +1158 1267 -8.33333333333333e-02 +1158 1268 -8.33333333333333e-02 +1158 1166 8.33333333333333e-02 +1158 1165 -1.66666666666667e-01 +1158 1117 8.33333333333333e-02 +1158 1018 -8.33333333333333e-02 +1158 1127 -8.33333333333333e-02 +1158 1028 8.33333333333333e-02 +1158 1126 1.66666666666667e-01 +1158 1027 -1.66666666666667e-01 +1158 1125 -2.50000000000000e-01 +1158 1118 8.33333333333333e-02 +1158 1019 -8.33333333333333e-02 +1158 923 8.33333333333333e-02 +1158 911 -8.33333333333333e-02 +1158 1159 -3.33333333333333e-01 +1158 910 1.66666666666667e-01 +1158 1054 1.66666666666667e-01 +1158 728 1.66666666666667e-01 +1158 1043 -1.66666666666667e-01 +1158 727 -8.33333333333333e-02 +1158 1042 8.33333333333333e-02 +1158 726 -2.50000000000000e-01 +1158 909 -2.50000000000000e-01 +1158 1160 -3.33333333333333e-01 +1158 770 1.66666666666667e-01 +1158 1055 1.66666666666667e-01 +1158 769 -8.33333333333333e-02 +1158 922 8.33333333333333e-02 +1158 1264 8.33333333333333e-02 +1158 768 -2.50000000000000e-01 +1158 1053 -7.50000000000000e-01 +1159 1159 2.50000000000000e+00 +1159 1265 8.33333333333333e-02 +1159 1163 -8.33333333333333e-02 +1159 1162 -2.50000000000000e-01 +1159 1161 1.66666666666667e-01 +1159 1166 8.33333333333333e-02 +1159 1268 -8.33333333333333e-02 +1159 1266 -8.33333333333333e-02 +1159 1164 -1.66666666666667e-01 +1159 1116 8.33333333333333e-02 +1159 1017 -8.33333333333333e-02 +1159 1028 8.33333333333333e-02 +1159 1019 -8.33333333333333e-02 +1159 1127 1.66666666666667e-01 +1159 1126 -7.50000000000000e-01 +1159 1125 1.66666666666667e-01 +1159 1026 -1.66666666666667e-01 +1159 1118 -1.66666666666667e-01 +1159 1043 8.33333333333333e-02 +1159 1055 -8.33333333333333e-02 +1159 1158 -3.33333333333333e-01 +1159 909 1.66666666666667e-01 +1159 1053 1.66666666666667e-01 +1159 728 1.66666666666667e-01 +1159 1160 -3.33333333333333e-01 +1159 911 1.66666666666667e-01 +1159 727 -2.50000000000000e-01 +1159 910 -7.50000000000000e-01 +1159 726 -8.33333333333333e-02 +1159 1041 8.33333333333333e-02 +1159 770 1.66666666666667e-01 +1159 923 -1.66666666666667e-01 +1159 1263 8.33333333333333e-02 +1159 769 -2.50000000000000e-01 +1159 1054 -2.50000000000000e-01 +1159 768 -8.33333333333333e-02 +1159 921 8.33333333333333e-02 +1160 1160 2.50000000000000e+00 +1160 1263 -1.66666666666667e-01 +1160 1163 -2.50000000000000e-01 +1160 1162 -8.33333333333333e-02 +1160 1161 1.66666666666667e-01 +1160 1165 8.33333333333333e-02 +1160 1267 -8.33333333333333e-02 +1160 1266 -8.33333333333333e-02 +1160 1164 8.33333333333333e-02 +1160 1027 8.33333333333333e-02 +1160 1018 -8.33333333333333e-02 +1160 1127 -2.50000000000000e-01 +1160 1126 1.66666666666667e-01 +1160 1125 -8.33333333333333e-02 +1160 1026 8.33333333333333e-02 +1160 1117 -1.66666666666667e-01 +1160 1116 8.33333333333333e-02 +1160 1017 -8.33333333333333e-02 +1160 921 8.33333333333333e-02 +1160 909 -8.33333333333333e-02 +1160 1042 8.33333333333333e-02 +1160 1054 -8.33333333333333e-02 +1160 728 -7.50000000000000e-01 +1160 911 -2.50000000000000e-01 +1160 727 1.66666666666667e-01 +1160 1159 -3.33333333333333e-01 +1160 910 1.66666666666667e-01 +1160 726 1.66666666666667e-01 +1160 1041 -1.66666666666667e-01 +1160 1264 8.33333333333333e-02 +1160 770 -7.50000000000000e-01 +1160 1055 -2.50000000000000e-01 +1160 769 1.66666666666667e-01 +1160 922 -1.66666666666667e-01 +1160 1158 -3.33333333333333e-01 +1160 768 1.66666666666667e-01 +1160 1053 1.66666666666667e-01 +1161 1161 2.50000000000000e+00 +1161 1121 8.33333333333333e-02 +1161 1118 -8.33333333333333e-02 +1161 1130 -8.33333333333333e-02 +1161 1127 8.33333333333333e-02 +1161 1129 1.66666666666667e-01 +1161 1126 -1.66666666666667e-01 +1161 1117 -8.33333333333333e-02 +1161 1128 -2.50000000000000e-01 +1161 1267 8.33333333333333e-02 +1161 1264 -8.33333333333333e-02 +1161 1268 8.33333333333333e-02 +1161 1160 1.66666666666667e-01 +1161 1159 1.66666666666667e-01 +1161 1162 -3.33333333333333e-01 +1161 1158 -7.50000000000000e-01 +1161 1265 1.66666666666667e-01 +1161 1263 -2.50000000000000e-01 +1161 1163 -3.33333333333333e-01 +1161 1166 -8.33333333333333e-02 +1161 1165 1.66666666666667e-01 +1161 1274 -8.33333333333333e-02 +1161 1184 8.33333333333333e-02 +1161 1183 -1.66666666666667e-01 +1161 1177 1.66666666666667e-01 +1161 728 -1.66666666666667e-01 +1161 1151 1.66666666666667e-01 +1161 727 8.33333333333333e-02 +1161 1150 -8.33333333333333e-02 +1161 1164 -2.50000000000000e-01 +1161 1149 -2.50000000000000e-01 +1161 1178 1.66666666666667e-01 +1161 773 -1.66666666666667e-01 +1161 1273 -8.33333333333333e-02 +1161 772 8.33333333333333e-02 +1161 1120 8.33333333333333e-02 +1161 1176 -7.50000000000000e-01 +1162 1162 2.50000000000000e+00 +1162 1121 -1.66666666666667e-01 +1162 1118 -8.33333333333333e-02 +1162 1127 8.33333333333333e-02 +1162 1128 1.66666666666667e-01 +1162 1125 -1.66666666666667e-01 +1162 1116 -8.33333333333333e-02 +1162 1130 1.66666666666667e-01 +1162 1129 -7.50000000000000e-01 +1162 1266 8.33333333333333e-02 +1162 1263 -8.33333333333333e-02 +1162 1265 1.66666666666667e-01 +1162 1268 -1.66666666666667e-01 +1162 1160 -8.33333333333333e-02 +1162 728 8.33333333333333e-02 +1162 1159 -2.50000000000000e-01 +1162 1158 1.66666666666667e-01 +1162 1161 -3.33333333333333e-01 +1162 773 8.33333333333333e-02 +1162 1264 -2.50000000000000e-01 +1162 1178 -8.33333333333333e-02 +1162 1184 8.33333333333333e-02 +1162 1274 -8.33333333333333e-02 +1162 1164 1.66666666666667e-01 +1162 1182 -1.66666666666667e-01 +1162 1176 1.66666666666667e-01 +1162 1166 1.66666666666667e-01 +1162 1151 1.66666666666667e-01 +1162 1163 -3.33333333333333e-01 +1162 1165 -7.50000000000000e-01 +1162 1150 -2.50000000000000e-01 +1162 726 8.33333333333333e-02 +1162 1149 -8.33333333333333e-02 +1162 1119 8.33333333333333e-02 +1162 1177 -2.50000000000000e-01 +1162 1272 -8.33333333333333e-02 +1162 771 8.33333333333333e-02 +1163 1163 2.50000000000000e+00 +1163 1119 8.33333333333333e-02 +1163 1116 -8.33333333333333e-02 +1163 1117 -8.33333333333333e-02 +1163 1126 8.33333333333333e-02 +1163 1128 -8.33333333333333e-02 +1163 1125 8.33333333333333e-02 +1163 1130 -2.50000000000000e-01 +1163 1129 1.66666666666667e-01 +1163 1264 1.66666666666667e-01 +1163 1267 -1.66666666666667e-01 +1163 1266 8.33333333333333e-02 +1163 1160 -2.50000000000000e-01 +1163 1159 -8.33333333333333e-02 +1163 727 8.33333333333333e-02 +1163 1158 1.66666666666667e-01 +1163 1265 -7.50000000000000e-01 +1163 772 8.33333333333333e-02 +1163 1263 1.66666666666667e-01 +1163 1177 -8.33333333333333e-02 +1163 1161 -3.33333333333333e-01 +1163 1164 -8.33333333333333e-02 +1163 1183 8.33333333333333e-02 +1163 1273 -8.33333333333333e-02 +1163 1272 -8.33333333333333e-02 +1163 1182 8.33333333333333e-02 +1163 1166 -2.50000000000000e-01 +1163 1151 -7.50000000000000e-01 +1163 1165 1.66666666666667e-01 +1163 1150 1.66666666666667e-01 +1163 1162 -3.33333333333333e-01 +1163 726 -1.66666666666667e-01 +1163 1149 1.66666666666667e-01 +1163 1120 -1.66666666666667e-01 +1163 1178 -2.50000000000000e-01 +1163 1176 1.66666666666667e-01 +1163 771 -1.66666666666667e-01 +1164 1164 2.50000000000000e+00 +1164 1156 -8.33333333333333e-02 +1164 1237 -1.66666666666667e-01 +1164 1157 1.66666666666667e-01 +1164 1155 -2.50000000000000e-01 +1164 1232 -8.33333333333333e-02 +1164 1231 1.66666666666667e-01 +1164 1230 -2.50000000000000e-01 +1164 1154 -1.66666666666667e-01 +1164 1153 8.33333333333333e-02 +1164 1151 8.33333333333333e-02 +1164 1163 -8.33333333333333e-02 +1164 1165 -3.33333333333333e-01 +1164 1183 1.66666666666667e-01 +1164 1162 1.66666666666667e-01 +1164 1184 1.66666666666667e-01 +1164 1274 -1.66666666666667e-01 +1164 781 -8.33333333333333e-02 +1164 1273 8.33333333333333e-02 +1164 1182 -7.50000000000000e-01 +1164 727 -8.33333333333333e-02 +1164 1150 8.33333333333333e-02 +1164 1161 -2.50000000000000e-01 +1164 911 1.66666666666667e-01 +1164 1166 -3.33333333333333e-01 +1164 1268 1.66666666666667e-01 +1164 928 8.33333333333333e-02 +1164 1267 -8.33333333333333e-02 +1164 1160 8.33333333333333e-02 +1164 728 -8.33333333333333e-02 +1164 910 1.66666666666667e-01 +1164 1159 -1.66666666666667e-01 +1164 909 -7.50000000000000e-01 +1164 929 8.33333333333333e-02 +1164 782 -8.33333333333333e-02 +1164 1266 -2.50000000000000e-01 +1164 1238 8.33333333333333e-02 +1165 1165 2.50000000000000e+00 +1165 1155 -8.33333333333333e-02 +1165 1238 8.33333333333333e-02 +1165 1236 -1.66666666666667e-01 +1165 1156 -2.50000000000000e-01 +1165 1154 8.33333333333333e-02 +1165 1230 1.66666666666667e-01 +1165 1232 1.66666666666667e-01 +1165 1231 -7.50000000000000e-01 +1165 1152 8.33333333333333e-02 +1165 1166 -3.33333333333333e-01 +1165 728 -8.33333333333333e-02 +1165 782 -8.33333333333333e-02 +1165 1184 -8.33333333333333e-02 +1165 1274 8.33333333333333e-02 +1165 1164 -3.33333333333333e-01 +1165 1182 1.66666666666667e-01 +1165 1161 1.66666666666667e-01 +1165 1183 -2.50000000000000e-01 +1165 780 -8.33333333333333e-02 +1165 1272 8.33333333333333e-02 +1165 1151 -1.66666666666667e-01 +1165 1163 1.66666666666667e-01 +1165 1162 -7.50000000000000e-01 +1165 726 -8.33333333333333e-02 +1165 1149 8.33333333333333e-02 +1165 911 -8.33333333333333e-02 +1165 1160 8.33333333333333e-02 +1165 927 8.33333333333333e-02 +1165 1266 -8.33333333333333e-02 +1165 910 -2.50000000000000e-01 +1165 909 1.66666666666667e-01 +1165 1158 -1.66666666666667e-01 +1165 929 -1.66666666666667e-01 +1165 1268 1.66666666666667e-01 +1165 1267 -2.50000000000000e-01 +1165 1157 1.66666666666667e-01 +1166 1166 2.50000000000000e+00 +1166 1156 1.66666666666667e-01 +1166 1237 8.33333333333333e-02 +1166 1157 -7.50000000000000e-01 +1166 1155 1.66666666666667e-01 +1166 1230 -8.33333333333333e-02 +1166 1153 8.33333333333333e-02 +1166 1232 -2.50000000000000e-01 +1166 1231 1.66666666666667e-01 +1166 1152 -1.66666666666667e-01 +1166 1165 -3.33333333333333e-01 +1166 727 -8.33333333333333e-02 +1166 781 -8.33333333333333e-02 +1166 1149 8.33333333333333e-02 +1166 1161 -8.33333333333333e-02 +1166 1183 -8.33333333333333e-02 +1166 1273 8.33333333333333e-02 +1166 1184 -2.50000000000000e-01 +1166 1182 1.66666666666667e-01 +1166 1272 -1.66666666666667e-01 +1166 1163 -2.50000000000000e-01 +1166 1150 -1.66666666666667e-01 +1166 1162 1.66666666666667e-01 +1166 910 -8.33333333333333e-02 +1166 1159 8.33333333333333e-02 +1166 909 1.66666666666667e-01 +1166 1164 -3.33333333333333e-01 +1166 1266 1.66666666666667e-01 +1166 911 -2.50000000000000e-01 +1166 1158 8.33333333333333e-02 +1166 726 -8.33333333333333e-02 +1166 1268 -7.50000000000000e-01 +1166 1236 8.33333333333333e-02 +1166 928 -1.66666666666667e-01 +1166 1267 1.66666666666667e-01 +1166 927 8.33333333333333e-02 +1166 780 -8.33333333333333e-02 +1167 1167 2.50000000000000e+00 +1167 1102 -8.33333333333333e-02 +1167 1097 -1.66666666666667e-01 +1167 1103 1.66666666666667e-01 +1167 1101 -2.50000000000000e-01 +1167 1199 8.33333333333333e-02 +1167 1198 -1.66666666666667e-01 +1167 1175 -8.33333333333333e-02 +1167 1174 1.66666666666667e-01 +1167 1173 -2.50000000000000e-01 +1167 1066 -8.33333333333333e-02 +1167 1075 8.33333333333333e-02 +1167 1076 8.33333333333333e-02 +1167 1139 -8.33333333333333e-02 +1167 739 1.66666666666667e-01 +1167 1168 -3.33333333333333e-01 +1167 1138 1.66666666666667e-01 +1167 1137 -2.50000000000000e-01 +1167 1067 -8.33333333333333e-02 +1167 1133 8.33333333333333e-02 +1167 730 1.66666666666667e-01 +1167 1132 -1.66666666666667e-01 +1167 935 -8.33333333333333e-02 +1167 932 8.33333333333333e-02 +1167 740 1.66666666666667e-01 +1167 1202 -1.66666666666667e-01 +1167 1201 8.33333333333333e-02 +1167 934 -8.33333333333333e-02 +1167 738 -7.50000000000000e-01 +1167 1169 -3.33333333333333e-01 +1167 1181 1.66666666666667e-01 +1167 731 1.66666666666667e-01 +1167 1180 -8.33333333333333e-02 +1167 931 8.33333333333333e-02 +1167 1096 8.33333333333333e-02 +1167 1179 -2.50000000000000e-01 +1167 729 -7.50000000000000e-01 +1168 1168 2.50000000000000e+00 +1168 1101 -8.33333333333333e-02 +1168 1103 1.66666666666667e-01 +1168 1097 8.33333333333333e-02 +1168 1102 -2.50000000000000e-01 +1168 1199 8.33333333333333e-02 +1168 1197 -1.66666666666667e-01 +1168 1175 1.66666666666667e-01 +1168 1174 -7.50000000000000e-01 +1168 1173 1.66666666666667e-01 +1168 1169 -3.33333333333333e-01 +1168 731 -8.33333333333333e-02 +1168 740 -8.33333333333333e-02 +1168 1133 8.33333333333333e-02 +1168 1067 -8.33333333333333e-02 +1168 1065 -8.33333333333333e-02 +1168 1074 8.33333333333333e-02 +1168 1076 -1.66666666666667e-01 +1168 1139 1.66666666666667e-01 +1168 1138 -7.50000000000000e-01 +1168 738 1.66666666666667e-01 +1168 1167 -3.33333333333333e-01 +1168 1137 1.66666666666667e-01 +1168 729 1.66666666666667e-01 +1168 1131 -1.66666666666667e-01 +1168 1202 8.33333333333333e-02 +1168 935 -8.33333333333333e-02 +1168 739 -2.50000000000000e-01 +1168 1200 8.33333333333333e-02 +1168 933 -8.33333333333333e-02 +1168 1181 1.66666666666667e-01 +1168 932 -1.66666666666667e-01 +1168 1095 8.33333333333333e-02 +1168 1180 -2.50000000000000e-01 +1168 730 -2.50000000000000e-01 +1168 1179 -8.33333333333333e-02 +1168 930 8.33333333333333e-02 +1169 1169 2.50000000000000e+00 +1169 1096 8.33333333333333e-02 +1169 1095 -1.66666666666667e-01 +1169 1103 -7.50000000000000e-01 +1169 1101 1.66666666666667e-01 +1169 1198 8.33333333333333e-02 +1169 1197 8.33333333333333e-02 +1169 1175 -2.50000000000000e-01 +1169 1174 1.66666666666667e-01 +1169 1173 -8.33333333333333e-02 +1169 1168 -3.33333333333333e-01 +1169 730 -8.33333333333333e-02 +1169 739 -8.33333333333333e-02 +1169 1132 8.33333333333333e-02 +1169 1066 -8.33333333333333e-02 +1169 1139 -2.50000000000000e-01 +1169 1075 -1.66666666666667e-01 +1169 1138 1.66666666666667e-01 +1169 1074 8.33333333333333e-02 +1169 1137 -8.33333333333333e-02 +1169 1065 -8.33333333333333e-02 +1169 1131 8.33333333333333e-02 +1169 1201 8.33333333333333e-02 +1169 934 -8.33333333333333e-02 +1169 933 -8.33333333333333e-02 +1169 930 8.33333333333333e-02 +1169 740 -2.50000000000000e-01 +1169 738 1.66666666666667e-01 +1169 1200 -1.66666666666667e-01 +1169 1102 1.66666666666667e-01 +1169 1181 -7.50000000000000e-01 +1169 731 -2.50000000000000e-01 +1169 1180 1.66666666666667e-01 +1169 931 -1.66666666666667e-01 +1169 1167 -3.33333333333333e-01 +1169 1179 1.66666666666667e-01 +1169 729 1.66666666666667e-01 +1170 1170 2.50000000000000e+00 +1170 1108 -8.33333333333333e-02 +1170 1109 1.66666666666667e-01 +1170 1097 8.33333333333333e-02 +1170 1107 -2.50000000000000e-01 +1170 1235 8.33333333333333e-02 +1170 1234 -1.66666666666667e-01 +1170 1175 1.66666666666667e-01 +1170 1174 1.66666666666667e-01 +1170 1173 -7.50000000000000e-01 +1170 1172 -3.33333333333333e-01 +1170 755 -8.33333333333333e-02 +1170 731 -8.33333333333333e-02 +1170 1085 -8.33333333333333e-02 +1170 1151 8.33333333333333e-02 +1170 1084 -8.33333333333333e-02 +1170 1093 8.33333333333333e-02 +1170 1094 -1.66666666666667e-01 +1170 1157 1.66666666666667e-01 +1170 754 1.66666666666667e-01 +1170 1171 -3.33333333333333e-01 +1170 1156 1.66666666666667e-01 +1170 1155 -7.50000000000000e-01 +1170 730 1.66666666666667e-01 +1170 1150 -1.66666666666667e-01 +1170 938 -8.33333333333333e-02 +1170 1238 8.33333333333333e-02 +1170 1237 8.33333333333333e-02 +1170 937 -8.33333333333333e-02 +1170 753 -2.50000000000000e-01 +1170 1184 1.66666666666667e-01 +1170 932 -1.66666666666667e-01 +1170 1183 -8.33333333333333e-02 +1170 931 8.33333333333333e-02 +1170 1182 -2.50000000000000e-01 +1170 1096 8.33333333333333e-02 +1170 729 -2.50000000000000e-01 +1171 1171 2.50000000000000e+00 +1171 1107 -8.33333333333333e-02 +1171 1097 -1.66666666666667e-01 +1171 1109 1.66666666666667e-01 +1171 1108 -2.50000000000000e-01 +1171 1235 8.33333333333333e-02 +1171 1233 -1.66666666666667e-01 +1171 1175 -8.33333333333333e-02 +1171 1174 -2.50000000000000e-01 +1171 1173 1.66666666666667e-01 +1171 1083 -8.33333333333333e-02 +1171 1092 8.33333333333333e-02 +1171 1094 8.33333333333333e-02 +1171 1157 -8.33333333333333e-02 +1171 1156 -2.50000000000000e-01 +1171 753 1.66666666666667e-01 +1171 1170 -3.33333333333333e-01 +1171 1155 1.66666666666667e-01 +1171 1085 -8.33333333333333e-02 +1171 1151 8.33333333333333e-02 +1171 729 1.66666666666667e-01 +1171 1149 -1.66666666666667e-01 +1171 938 -8.33333333333333e-02 +1171 932 8.33333333333333e-02 +1171 1238 -1.66666666666667e-01 +1171 755 1.66666666666667e-01 +1171 754 -7.50000000000000e-01 +1171 1236 8.33333333333333e-02 +1171 936 -8.33333333333333e-02 +1171 1184 1.66666666666667e-01 +1171 1172 -3.33333333333333e-01 +1171 731 1.66666666666667e-01 +1171 1183 -2.50000000000000e-01 +1171 1095 8.33333333333333e-02 +1171 730 -7.50000000000000e-01 +1171 1182 -8.33333333333333e-02 +1171 930 8.33333333333333e-02 +1172 1172 2.50000000000000e+00 +1172 1096 -1.66666666666667e-01 +1172 1095 8.33333333333333e-02 +1172 1109 -7.50000000000000e-01 +1172 1108 1.66666666666667e-01 +1172 1233 8.33333333333333e-02 +1172 1234 8.33333333333333e-02 +1172 1175 -2.50000000000000e-01 +1172 1174 -8.33333333333333e-02 +1172 1173 1.66666666666667e-01 +1172 1170 -3.33333333333333e-01 +1172 753 -8.33333333333333e-02 +1172 729 -8.33333333333333e-02 +1172 1083 -8.33333333333333e-02 +1172 1149 8.33333333333333e-02 +1172 1157 -2.50000000000000e-01 +1172 1093 8.33333333333333e-02 +1172 1156 -8.33333333333333e-02 +1172 1092 -1.66666666666667e-01 +1172 1155 1.66666666666667e-01 +1172 1084 -8.33333333333333e-02 +1172 1150 8.33333333333333e-02 +1172 936 -8.33333333333333e-02 +1172 1236 8.33333333333333e-02 +1172 937 -8.33333333333333e-02 +1172 931 8.33333333333333e-02 +1172 755 -2.50000000000000e-01 +1172 1237 -1.66666666666667e-01 +1172 754 1.66666666666667e-01 +1172 1184 -7.50000000000000e-01 +1172 1107 1.66666666666667e-01 +1172 731 -2.50000000000000e-01 +1172 1183 1.66666666666667e-01 +1172 1171 -3.33333333333333e-01 +1172 730 1.66666666666667e-01 +1172 1182 1.66666666666667e-01 +1172 930 -1.66666666666667e-01 +1173 1173 2.50000000000000e+00 +1173 1109 -1.66666666666667e-01 +1173 1235 -8.33333333333333e-02 +1173 937 8.33333333333333e-02 +1173 938 8.33333333333333e-02 +1173 1234 1.66666666666667e-01 +1173 1233 -2.50000000000000e-01 +1173 1172 1.66666666666667e-01 +1173 1171 1.66666666666667e-01 +1173 1170 -7.50000000000000e-01 +1173 1096 -8.33333333333333e-02 +1173 1097 -8.33333333333333e-02 +1173 1111 -8.33333333333333e-02 +1173 1102 8.33333333333333e-02 +1173 1103 8.33333333333333e-02 +1173 1112 1.66666666666667e-01 +1173 1175 -3.33333333333333e-01 +1173 1110 -2.50000000000000e-01 +1173 931 -8.33333333333333e-02 +1173 1174 -3.33333333333333e-01 +1173 1199 1.66666666666667e-01 +1173 940 -8.33333333333333e-02 +1173 934 8.33333333333333e-02 +1173 932 1.66666666666667e-01 +1173 935 -1.66666666666667e-01 +1173 758 8.33333333333333e-02 +1173 941 -8.33333333333333e-02 +1173 1198 1.66666666666667e-01 +1173 757 -1.66666666666667e-01 +1173 1197 -7.50000000000000e-01 +1173 1169 -8.33333333333333e-02 +1173 731 8.33333333333333e-02 +1173 1168 1.66666666666667e-01 +1173 730 -1.66666666666667e-01 +1173 1167 -2.50000000000000e-01 +1173 1108 8.33333333333333e-02 +1173 930 -2.50000000000000e-01 +1174 1174 2.50000000000000e+00 +1174 1109 8.33333333333333e-02 +1174 1235 1.66666666666667e-01 +1174 936 8.33333333333333e-02 +1174 938 -1.66666666666667e-01 +1174 1234 -7.50000000000000e-01 +1174 1233 1.66666666666667e-01 +1174 1172 -8.33333333333333e-02 +1174 1171 -2.50000000000000e-01 +1174 1170 1.66666666666667e-01 +1174 1095 -8.33333333333333e-02 +1174 1112 1.66666666666667e-01 +1174 1110 -8.33333333333333e-02 +1174 1101 8.33333333333333e-02 +1174 1103 -1.66666666666667e-01 +1174 758 8.33333333333333e-02 +1174 1111 -2.50000000000000e-01 +1174 1097 -8.33333333333333e-02 +1174 731 8.33333333333333e-02 +1174 930 -8.33333333333333e-02 +1174 1199 -8.33333333333333e-02 +1174 1173 -3.33333333333333e-01 +1174 939 -8.33333333333333e-02 +1174 933 8.33333333333333e-02 +1174 941 -8.33333333333333e-02 +1174 935 8.33333333333333e-02 +1174 1198 -2.50000000000000e-01 +1174 1197 1.66666666666667e-01 +1174 756 -1.66666666666667e-01 +1174 1169 1.66666666666667e-01 +1174 1175 -3.33333333333333e-01 +1174 932 1.66666666666667e-01 +1174 1168 -7.50000000000000e-01 +1174 1107 8.33333333333333e-02 +1174 931 -2.50000000000000e-01 +1174 1167 1.66666666666667e-01 +1174 729 -1.66666666666667e-01 +1175 1175 2.50000000000000e+00 +1175 1107 -1.66666666666667e-01 +1175 1233 -8.33333333333333e-02 +1175 1234 1.66666666666667e-01 +1175 937 -1.66666666666667e-01 +1175 936 8.33333333333333e-02 +1175 1235 -2.50000000000000e-01 +1175 1172 -2.50000000000000e-01 +1175 1171 -8.33333333333333e-02 +1175 1170 1.66666666666667e-01 +1175 1095 -8.33333333333333e-02 +1175 1111 1.66666666666667e-01 +1175 1102 -1.66666666666667e-01 +1175 1101 8.33333333333333e-02 +1175 1112 -7.50000000000000e-01 +1175 757 8.33333333333333e-02 +1175 1110 1.66666666666667e-01 +1175 1173 -3.33333333333333e-01 +1175 1096 -8.33333333333333e-02 +1175 730 8.33333333333333e-02 +1175 1198 -8.33333333333333e-02 +1175 1197 1.66666666666667e-01 +1175 940 -8.33333333333333e-02 +1175 934 8.33333333333333e-02 +1175 930 1.66666666666667e-01 +1175 933 -1.66666666666667e-01 +1175 1199 -2.50000000000000e-01 +1175 756 8.33333333333333e-02 +1175 939 -8.33333333333333e-02 +1175 1169 -2.50000000000000e-01 +1175 1108 8.33333333333333e-02 +1175 932 -7.50000000000000e-01 +1175 1168 1.66666666666667e-01 +1175 1174 -3.33333333333333e-01 +1175 931 1.66666666666667e-01 +1175 1167 -8.33333333333333e-02 +1175 729 8.33333333333333e-02 +1176 1176 2.50000000000000e+00 +1176 1151 -1.66666666666667e-01 +1176 1150 8.33333333333333e-02 +1176 1163 1.66666666666667e-01 +1176 1161 -7.50000000000000e-01 +1176 1273 8.33333333333333e-02 +1176 1274 8.33333333333333e-02 +1176 1184 -8.33333333333333e-02 +1176 1183 1.66666666666667e-01 +1176 1182 -2.50000000000000e-01 +1176 1120 -8.33333333333333e-02 +1176 1121 -8.33333333333333e-02 +1176 1130 8.33333333333333e-02 +1176 1129 -1.66666666666667e-01 +1176 1133 8.33333333333333e-02 +1176 1145 -8.33333333333333e-02 +1176 1177 -3.33333333333333e-01 +1176 1144 1.66666666666667e-01 +1176 1132 8.33333333333333e-02 +1176 730 -8.33333333333333e-02 +1176 772 -8.33333333333333e-02 +1176 1143 -2.50000000000000e-01 +1176 932 8.33333333333333e-02 +1176 944 -8.33333333333333e-02 +1176 1270 8.33333333333333e-02 +1176 943 -8.33333333333333e-02 +1176 773 1.66666666666667e-01 +1176 1271 -1.66666666666667e-01 +1176 771 -2.50000000000000e-01 +1176 1178 -3.33333333333333e-01 +1176 1181 1.66666666666667e-01 +1176 731 1.66666666666667e-01 +1176 1180 1.66666666666667e-01 +1176 931 -1.66666666666667e-01 +1176 1162 1.66666666666667e-01 +1176 1179 -7.50000000000000e-01 +1176 729 -2.50000000000000e-01 +1177 1177 2.50000000000000e+00 +1177 1163 -8.33333333333333e-02 +1177 1161 1.66666666666667e-01 +1177 1149 8.33333333333333e-02 +1177 1162 -2.50000000000000e-01 +1177 1272 8.33333333333333e-02 +1177 1274 -1.66666666666667e-01 +1177 1184 1.66666666666667e-01 +1177 1183 -7.50000000000000e-01 +1177 1182 1.66666666666667e-01 +1177 1119 -8.33333333333333e-02 +1177 1121 -8.33333333333333e-02 +1177 1130 8.33333333333333e-02 +1177 1128 -1.66666666666667e-01 +1177 1176 -3.33333333333333e-01 +1177 1143 1.66666666666667e-01 +1177 1133 -1.66666666666667e-01 +1177 731 1.66666666666667e-01 +1177 1131 8.33333333333333e-02 +1177 729 -8.33333333333333e-02 +1177 1145 1.66666666666667e-01 +1177 1178 -3.33333333333333e-01 +1177 773 1.66666666666667e-01 +1177 1144 -7.50000000000000e-01 +1177 771 -8.33333333333333e-02 +1177 1269 8.33333333333333e-02 +1177 942 -8.33333333333333e-02 +1177 1271 8.33333333333333e-02 +1177 944 -8.33333333333333e-02 +1177 772 -2.50000000000000e-01 +1177 1181 -8.33333333333333e-02 +1177 932 8.33333333333333e-02 +1177 1151 8.33333333333333e-02 +1177 1180 -2.50000000000000e-01 +1177 730 -2.50000000000000e-01 +1177 1179 1.66666666666667e-01 +1177 930 -1.66666666666667e-01 +1178 1178 2.50000000000000e+00 +1178 1162 -8.33333333333333e-02 +1178 1149 -1.66666666666667e-01 +1178 1163 -2.50000000000000e-01 +1178 1161 1.66666666666667e-01 +1178 1273 -1.66666666666667e-01 +1178 1272 8.33333333333333e-02 +1178 1184 -2.50000000000000e-01 +1178 1183 1.66666666666667e-01 +1178 1182 -8.33333333333333e-02 +1178 1120 -8.33333333333333e-02 +1178 1129 8.33333333333333e-02 +1178 1119 -8.33333333333333e-02 +1178 1128 8.33333333333333e-02 +1178 1131 8.33333333333333e-02 +1178 1143 -8.33333333333333e-02 +1178 1132 -1.66666666666667e-01 +1178 730 1.66666666666667e-01 +1178 1145 -2.50000000000000e-01 +1178 1144 1.66666666666667e-01 +1178 1177 -3.33333333333333e-01 +1178 772 1.66666666666667e-01 +1178 930 8.33333333333333e-02 +1178 942 -8.33333333333333e-02 +1178 773 -7.50000000000000e-01 +1178 1270 8.33333333333333e-02 +1178 943 -8.33333333333333e-02 +1178 771 1.66666666666667e-01 +1178 1269 -1.66666666666667e-01 +1178 1150 8.33333333333333e-02 +1178 1181 -2.50000000000000e-01 +1178 731 -7.50000000000000e-01 +1178 1180 -8.33333333333333e-02 +1178 931 8.33333333333333e-02 +1178 1176 -3.33333333333333e-01 +1178 1179 1.66666666666667e-01 +1178 729 1.66666666666667e-01 +1179 1179 2.50000000000000e+00 +1179 1138 8.33333333333333e-02 +1179 1201 1.66666666666667e-01 +1179 935 8.33333333333333e-02 +1179 934 -1.66666666666667e-01 +1179 1202 1.66666666666667e-01 +1179 1200 -7.50000000000000e-01 +1179 1169 1.66666666666667e-01 +1179 1168 -8.33333333333333e-02 +1179 1167 -2.50000000000000e-01 +1179 1133 -8.33333333333333e-02 +1179 1148 -8.33333333333333e-02 +1179 1145 8.33333333333333e-02 +1179 1147 1.66666666666667e-01 +1179 1144 -1.66666666666667e-01 +1179 775 8.33333333333333e-02 +1179 1146 -2.50000000000000e-01 +1179 1132 -8.33333333333333e-02 +1179 730 8.33333333333333e-02 +1179 932 -8.33333333333333e-02 +1179 1181 -3.33333333333333e-01 +1179 1270 -8.33333333333333e-02 +1179 947 -8.33333333333333e-02 +1179 944 8.33333333333333e-02 +1179 946 -8.33333333333333e-02 +1179 943 8.33333333333333e-02 +1179 1271 1.66666666666667e-01 +1179 776 -1.66666666666667e-01 +1179 1269 -2.50000000000000e-01 +1179 1178 1.66666666666667e-01 +1179 731 -1.66666666666667e-01 +1179 1177 1.66666666666667e-01 +1179 1180 -3.33333333333333e-01 +1179 931 1.66666666666667e-01 +1179 1176 -7.50000000000000e-01 +1179 1139 8.33333333333333e-02 +1179 930 -2.50000000000000e-01 +1180 1180 2.50000000000000e+00 +1180 1137 8.33333333333333e-02 +1180 1202 -8.33333333333333e-02 +1180 935 8.33333333333333e-02 +1180 1200 1.66666666666667e-01 +1180 933 -1.66666666666667e-01 +1180 1201 -2.50000000000000e-01 +1180 1169 1.66666666666667e-01 +1180 1168 -2.50000000000000e-01 +1180 1167 -8.33333333333333e-02 +1180 1133 -8.33333333333333e-02 +1180 1146 1.66666666666667e-01 +1180 1145 8.33333333333333e-02 +1180 1143 -1.66666666666667e-01 +1180 1148 1.66666666666667e-01 +1180 1181 -3.33333333333333e-01 +1180 1147 -7.50000000000000e-01 +1180 774 8.33333333333333e-02 +1180 1131 -8.33333333333333e-02 +1180 729 8.33333333333333e-02 +1180 1269 -8.33333333333333e-02 +1180 1271 1.66666666666667e-01 +1180 932 1.66666666666667e-01 +1180 944 -1.66666666666667e-01 +1180 945 -8.33333333333333e-02 +1180 942 8.33333333333333e-02 +1180 776 8.33333333333333e-02 +1180 947 -8.33333333333333e-02 +1180 1270 -2.50000000000000e-01 +1180 1178 -8.33333333333333e-02 +1180 731 8.33333333333333e-02 +1180 1177 -2.50000000000000e-01 +1180 1139 -1.66666666666667e-01 +1180 931 -7.50000000000000e-01 +1180 1176 1.66666666666667e-01 +1180 1179 -3.33333333333333e-01 +1180 930 1.66666666666667e-01 +1181 1181 2.50000000000000e+00 +1181 1138 -1.66666666666667e-01 +1181 1201 -8.33333333333333e-02 +1181 934 8.33333333333333e-02 +1181 933 8.33333333333333e-02 +1181 1202 -2.50000000000000e-01 +1181 1200 1.66666666666667e-01 +1181 1169 -7.50000000000000e-01 +1181 1168 1.66666666666667e-01 +1181 1167 1.66666666666667e-01 +1181 1131 -8.33333333333333e-02 +1181 1132 -8.33333333333333e-02 +1181 1146 -8.33333333333333e-02 +1181 1143 8.33333333333333e-02 +1181 1144 8.33333333333333e-02 +1181 1148 -2.50000000000000e-01 +1181 1147 1.66666666666667e-01 +1181 1180 -3.33333333333333e-01 +1181 930 -8.33333333333333e-02 +1181 1179 -3.33333333333333e-01 +1181 1270 1.66666666666667e-01 +1181 945 -8.33333333333333e-02 +1181 942 8.33333333333333e-02 +1181 931 1.66666666666667e-01 +1181 943 -1.66666666666667e-01 +1181 1271 -7.50000000000000e-01 +1181 775 8.33333333333333e-02 +1181 946 -8.33333333333333e-02 +1181 1269 1.66666666666667e-01 +1181 774 -1.66666666666667e-01 +1181 1178 -2.50000000000000e-01 +1181 1137 8.33333333333333e-02 +1181 932 -2.50000000000000e-01 +1181 1177 -8.33333333333333e-02 +1181 730 8.33333333333333e-02 +1181 1176 1.66666666666667e-01 +1181 729 -1.66666666666667e-01 +1182 1182 2.50000000000000e+00 +1182 1156 8.33333333333333e-02 +1182 938 8.33333333333333e-02 +1182 1238 -8.33333333333333e-02 +1182 1237 1.66666666666667e-01 +1182 937 -1.66666666666667e-01 +1182 1236 -2.50000000000000e-01 +1182 1172 1.66666666666667e-01 +1182 1171 -8.33333333333333e-02 +1182 1170 -2.50000000000000e-01 +1182 1151 -8.33333333333333e-02 +1182 1165 1.66666666666667e-01 +1182 1163 8.33333333333333e-02 +1182 1162 -1.66666666666667e-01 +1182 1166 1.66666666666667e-01 +1182 1184 -3.33333333333333e-01 +1182 781 8.33333333333333e-02 +1182 1164 -7.50000000000000e-01 +1182 1150 -8.33333333333333e-02 +1182 730 8.33333333333333e-02 +1182 1273 -8.33333333333333e-02 +1182 1274 1.66666666666667e-01 +1182 932 1.66666666666667e-01 +1182 944 -1.66666666666667e-01 +1182 949 -8.33333333333333e-02 +1182 943 8.33333333333333e-02 +1182 782 8.33333333333333e-02 +1182 950 -8.33333333333333e-02 +1182 1272 -2.50000000000000e-01 +1182 1178 -8.33333333333333e-02 +1182 731 8.33333333333333e-02 +1182 1183 -3.33333333333333e-01 +1182 1177 1.66666666666667e-01 +1182 931 1.66666666666667e-01 +1182 1157 -1.66666666666667e-01 +1182 1176 -2.50000000000000e-01 +1182 930 -7.50000000000000e-01 +1183 1183 2.50000000000000e+00 +1183 1155 8.33333333333333e-02 +1183 1236 1.66666666666667e-01 +1183 938 8.33333333333333e-02 +1183 936 -1.66666666666667e-01 +1183 1238 1.66666666666667e-01 +1183 1237 -7.50000000000000e-01 +1183 1172 1.66666666666667e-01 +1183 1171 -2.50000000000000e-01 +1183 1170 -8.33333333333333e-02 +1183 1151 -8.33333333333333e-02 +1183 1166 -8.33333333333333e-02 +1183 1163 8.33333333333333e-02 +1183 1164 1.66666666666667e-01 +1183 1161 -1.66666666666667e-01 +1183 1165 -2.50000000000000e-01 +1183 780 8.33333333333333e-02 +1183 1149 -8.33333333333333e-02 +1183 729 8.33333333333333e-02 +1183 932 -8.33333333333333e-02 +1183 1184 -3.33333333333333e-01 +1183 1272 -8.33333333333333e-02 +1183 950 -8.33333333333333e-02 +1183 944 8.33333333333333e-02 +1183 948 -8.33333333333333e-02 +1183 942 8.33333333333333e-02 +1183 782 -1.66666666666667e-01 +1183 1274 1.66666666666667e-01 +1183 1273 -2.50000000000000e-01 +1183 1178 1.66666666666667e-01 +1183 731 -1.66666666666667e-01 +1183 1157 8.33333333333333e-02 +1183 1177 -7.50000000000000e-01 +1183 931 -2.50000000000000e-01 +1183 1182 -3.33333333333333e-01 +1183 1176 1.66666666666667e-01 +1183 930 1.66666666666667e-01 +1184 1184 2.50000000000000e+00 +1184 1155 -1.66666666666667e-01 +1184 936 8.33333333333333e-02 +1184 1236 -8.33333333333333e-02 +1184 937 8.33333333333333e-02 +1184 1238 -2.50000000000000e-01 +1184 1237 1.66666666666667e-01 +1184 1172 -7.50000000000000e-01 +1184 1171 1.66666666666667e-01 +1184 1170 1.66666666666667e-01 +1184 1150 -8.33333333333333e-02 +1184 1149 -8.33333333333333e-02 +1184 1165 -8.33333333333333e-02 +1184 1162 8.33333333333333e-02 +1184 1161 8.33333333333333e-02 +1184 1166 -2.50000000000000e-01 +1184 1164 1.66666666666667e-01 +1184 1182 -3.33333333333333e-01 +1184 931 -8.33333333333333e-02 +1184 1183 -3.33333333333333e-01 +1184 949 -8.33333333333333e-02 +1184 943 8.33333333333333e-02 +1184 1272 1.66666666666667e-01 +1184 930 1.66666666666667e-01 +1184 942 -1.66666666666667e-01 +1184 1274 -7.50000000000000e-01 +1184 781 -1.66666666666667e-01 +1184 1273 1.66666666666667e-01 +1184 780 8.33333333333333e-02 +1184 948 -8.33333333333333e-02 +1184 1156 8.33333333333333e-02 +1184 1178 -2.50000000000000e-01 +1184 932 -2.50000000000000e-01 +1184 1177 1.66666666666667e-01 +1184 730 -1.66666666666667e-01 +1184 1176 -8.33333333333333e-02 +1184 729 8.33333333333333e-02 +1185 1185 1.25000000000000e+00 +1185 1199 4.16666666666667e-02 +1185 1189 8.33333333333333e-02 +1185 1186 -1.66666666666667e-01 +1185 1102 1.66666666666667e-01 +1185 1100 -1.66666666666667e-01 +1185 734 8.33333333333333e-02 +1185 1099 8.33333333333333e-02 +1185 733 -4.16666666666667e-02 +1185 1188 -1.25000000000000e-01 +1185 1103 1.66666666666667e-01 +1185 1187 -1.66666666666667e-01 +1185 740 8.33333333333333e-02 +1185 1198 4.16666666666667e-02 +1185 739 -4.16666666666667e-02 +1185 1101 -7.50000000000000e-01 +1185 1069 -8.33333333333333e-02 +1185 823 4.16666666666667e-02 +1185 824 4.16666666666667e-02 +1185 1070 -8.33333333333333e-02 +1185 732 -1.25000000000000e-01 +1185 830 -4.16666666666667e-02 +1185 1076 8.33333333333333e-02 +1185 829 8.33333333333333e-02 +1185 1075 -1.66666666666667e-01 +1185 828 -1.25000000000000e-01 +1185 1190 -4.16666666666667e-02 +1185 738 -1.25000000000000e-01 +1186 1186 1.25000000000000e+00 +1186 1103 -8.33333333333333e-02 +1186 1188 8.33333333333333e-02 +1186 1185 -1.66666666666667e-01 +1186 1101 1.66666666666667e-01 +1186 1190 8.33333333333333e-02 +1186 1189 -3.75000000000000e-01 +1186 1098 8.33333333333333e-02 +1186 732 -4.16666666666667e-02 +1186 1199 -8.33333333333333e-02 +1186 1102 -2.50000000000000e-01 +1186 1197 4.16666666666667e-02 +1186 738 -4.16666666666667e-02 +1186 1068 -8.33333333333333e-02 +1186 822 4.16666666666667e-02 +1186 1070 -8.33333333333333e-02 +1186 1076 8.33333333333333e-02 +1186 824 -8.33333333333333e-02 +1186 734 8.33333333333333e-02 +1186 733 -1.25000000000000e-01 +1186 830 8.33333333333333e-02 +1186 1187 -1.66666666666667e-01 +1186 740 8.33333333333333e-02 +1186 829 -3.75000000000000e-01 +1186 1100 8.33333333333333e-02 +1186 739 -1.25000000000000e-01 +1186 828 8.33333333333333e-02 +1186 1074 -1.66666666666667e-01 +1187 1187 1.25000000000000e+00 +1187 1102 -8.33333333333333e-02 +1187 1188 -4.16666666666667e-02 +1187 1197 4.16666666666667e-02 +1187 1190 -1.25000000000000e-01 +1187 1189 8.33333333333333e-02 +1187 1098 -1.66666666666667e-01 +1187 732 8.33333333333333e-02 +1187 1103 -2.50000000000000e-01 +1187 1198 -8.33333333333333e-02 +1187 1101 1.66666666666667e-01 +1187 1185 -1.66666666666667e-01 +1187 738 8.33333333333333e-02 +1187 1069 -8.33333333333333e-02 +1187 1075 8.33333333333333e-02 +1187 734 -3.75000000000000e-01 +1187 823 -8.33333333333333e-02 +1187 733 8.33333333333333e-02 +1187 822 4.16666666666667e-02 +1187 1068 -8.33333333333333e-02 +1187 830 -1.25000000000000e-01 +1187 1099 8.33333333333333e-02 +1187 740 -3.75000000000000e-01 +1187 829 8.33333333333333e-02 +1187 1186 -1.66666666666667e-01 +1187 739 8.33333333333333e-02 +1187 828 -4.16666666666667e-02 +1187 1074 8.33333333333333e-02 +1188 1188 1.25000000000000e+00 +1188 1103 8.33333333333333e-02 +1188 1186 8.33333333333333e-02 +1188 1102 -1.66666666666667e-01 +1188 733 4.16666666666667e-02 +1188 1185 -1.25000000000000e-01 +1188 1190 -1.66666666666667e-01 +1188 1199 8.33333333333333e-02 +1188 757 4.16666666666667e-02 +1188 1198 -4.16666666666667e-02 +1188 1197 -1.25000000000000e-01 +1188 1099 -8.33333333333333e-02 +1188 860 8.33333333333333e-02 +1188 856 8.33333333333333e-02 +1188 859 -4.16666666666667e-02 +1188 857 -1.66666666666667e-01 +1188 1112 1.66666666666667e-01 +1188 734 4.16666666666667e-02 +1188 1100 -8.33333333333333e-02 +1188 858 -1.25000000000000e-01 +1188 866 -4.16666666666667e-02 +1188 758 4.16666666666667e-02 +1188 1189 -1.66666666666667e-01 +1188 865 8.33333333333333e-02 +1188 1111 1.66666666666667e-01 +1188 1187 -4.16666666666667e-02 +1188 864 -1.25000000000000e-01 +1188 1110 -7.50000000000000e-01 +1189 1189 1.25000000000000e+00 +1189 1185 8.33333333333333e-02 +1189 1101 -1.66666666666667e-01 +1189 1187 8.33333333333333e-02 +1189 1186 -3.75000000000000e-01 +1189 732 4.16666666666667e-02 +1189 1199 8.33333333333333e-02 +1189 1198 -1.25000000000000e-01 +1189 756 4.16666666666667e-02 +1189 1197 -4.16666666666667e-02 +1189 1098 -8.33333333333333e-02 +1189 1100 -8.33333333333333e-02 +1189 1190 -1.66666666666667e-01 +1189 855 8.33333333333333e-02 +1189 858 -4.16666666666667e-02 +1189 857 8.33333333333333e-02 +1189 1112 -8.33333333333333e-02 +1189 734 -8.33333333333333e-02 +1189 860 8.33333333333333e-02 +1189 859 -1.25000000000000e-01 +1189 866 8.33333333333333e-02 +1189 758 -8.33333333333333e-02 +1189 1103 8.33333333333333e-02 +1189 865 -3.75000000000000e-01 +1189 1111 -2.50000000000000e-01 +1189 1188 -1.66666666666667e-01 +1189 864 8.33333333333333e-02 +1189 1110 1.66666666666667e-01 +1190 1190 1.25000000000000e+00 +1190 1185 -4.16666666666667e-02 +1190 1101 8.33333333333333e-02 +1190 1187 -1.25000000000000e-01 +1190 1186 8.33333333333333e-02 +1190 1199 -3.75000000000000e-01 +1190 1198 8.33333333333333e-02 +1190 1188 -1.66666666666667e-01 +1190 1197 8.33333333333333e-02 +1190 1099 -8.33333333333333e-02 +1190 1189 -1.66666666666667e-01 +1190 858 8.33333333333333e-02 +1190 856 8.33333333333333e-02 +1190 1111 -8.33333333333333e-02 +1190 855 -1.66666666666667e-01 +1190 1110 1.66666666666667e-01 +1190 860 -3.75000000000000e-01 +1190 733 -8.33333333333333e-02 +1190 859 8.33333333333333e-02 +1190 732 4.16666666666667e-02 +1190 1098 -8.33333333333333e-02 +1190 1102 8.33333333333333e-02 +1190 866 -1.25000000000000e-01 +1190 1112 -2.50000000000000e-01 +1190 865 8.33333333333333e-02 +1190 757 -8.33333333333333e-02 +1190 864 -4.16666666666667e-02 +1190 756 4.16666666666667e-02 +1191 1191 1.25000000000000e+00 +1191 1196 8.33333333333333e-02 +1191 1195 -4.16666666666667e-02 +1191 1201 4.16666666666667e-02 +1191 1202 4.16666666666667e-02 +1191 740 -4.16666666666667e-02 +1191 737 -4.16666666666667e-02 +1191 1194 -1.25000000000000e-01 +1191 1136 8.33333333333333e-02 +1191 736 8.33333333333333e-02 +1191 1135 -1.66666666666667e-01 +1191 1139 1.66666666666667e-01 +1191 1192 -1.66666666666667e-01 +1191 739 8.33333333333333e-02 +1191 1138 1.66666666666667e-01 +1191 1137 -7.50000000000000e-01 +1191 827 4.16666666666667e-02 +1191 1073 -8.33333333333333e-02 +1191 826 4.16666666666667e-02 +1191 1072 -8.33333333333333e-02 +1191 735 -1.25000000000000e-01 +1191 830 8.33333333333333e-02 +1191 1076 -1.66666666666667e-01 +1191 829 -4.16666666666667e-02 +1191 1075 8.33333333333333e-02 +1191 828 -1.25000000000000e-01 +1191 1193 -1.66666666666667e-01 +1191 738 -1.25000000000000e-01 +1192 1192 1.25000000000000e+00 +1192 1200 4.16666666666667e-02 +1192 1202 -8.33333333333333e-02 +1192 1196 8.33333333333333e-02 +1192 1195 -1.25000000000000e-01 +1192 1136 8.33333333333333e-02 +1192 735 8.33333333333333e-02 +1192 1134 -1.66666666666667e-01 +1192 1139 -8.33333333333333e-02 +1192 1138 -2.50000000000000e-01 +1192 1191 -1.66666666666667e-01 +1192 738 8.33333333333333e-02 +1192 1137 1.66666666666667e-01 +1192 1076 8.33333333333333e-02 +1192 1073 -8.33333333333333e-02 +1192 827 -8.33333333333333e-02 +1192 737 8.33333333333333e-02 +1192 736 -3.75000000000000e-01 +1192 825 4.16666666666667e-02 +1192 1071 -8.33333333333333e-02 +1192 830 8.33333333333333e-02 +1192 1193 -1.66666666666667e-01 +1192 740 8.33333333333333e-02 +1192 829 -1.25000000000000e-01 +1192 1194 -4.16666666666667e-02 +1192 739 -3.75000000000000e-01 +1192 828 -4.16666666666667e-02 +1192 1074 8.33333333333333e-02 +1193 1193 1.25000000000000e+00 +1193 1194 8.33333333333333e-02 +1193 1201 -8.33333333333333e-02 +1193 1200 4.16666666666667e-02 +1193 738 -4.16666666666667e-02 +1193 1196 -3.75000000000000e-01 +1193 1195 8.33333333333333e-02 +1193 735 -4.16666666666667e-02 +1193 1134 8.33333333333333e-02 +1193 1135 8.33333333333333e-02 +1193 1139 -2.50000000000000e-01 +1193 1138 -8.33333333333333e-02 +1193 1137 1.66666666666667e-01 +1193 1075 8.33333333333333e-02 +1193 1072 -8.33333333333333e-02 +1193 825 4.16666666666667e-02 +1193 1071 -8.33333333333333e-02 +1193 737 -1.25000000000000e-01 +1193 826 -8.33333333333333e-02 +1193 736 8.33333333333333e-02 +1193 830 -3.75000000000000e-01 +1193 1191 -1.66666666666667e-01 +1193 740 -1.25000000000000e-01 +1193 829 8.33333333333333e-02 +1193 1192 -1.66666666666667e-01 +1193 739 8.33333333333333e-02 +1193 828 8.33333333333333e-02 +1193 1074 -1.66666666666667e-01 +1194 1194 1.25000000000000e+00 +1194 1192 -4.16666666666667e-02 +1194 1139 -1.66666666666667e-01 +1194 1138 8.33333333333333e-02 +1194 776 4.16666666666667e-02 +1194 1202 -4.16666666666667e-02 +1194 1201 8.33333333333333e-02 +1194 1195 -1.66666666666667e-01 +1194 1200 -1.25000000000000e-01 +1194 737 4.16666666666667e-02 +1194 1191 -1.25000000000000e-01 +1194 896 -4.16666666666667e-02 +1194 895 8.33333333333333e-02 +1194 1136 -8.33333333333333e-02 +1194 893 8.33333333333333e-02 +1194 1147 1.66666666666667e-01 +1194 892 -1.66666666666667e-01 +1194 736 4.16666666666667e-02 +1194 1135 -8.33333333333333e-02 +1194 894 -1.25000000000000e-01 +1194 1196 -1.66666666666667e-01 +1194 902 8.33333333333333e-02 +1194 1148 1.66666666666667e-01 +1194 901 -4.16666666666667e-02 +1194 775 4.16666666666667e-02 +1194 1193 8.33333333333333e-02 +1194 900 -1.25000000000000e-01 +1194 1146 -7.50000000000000e-01 +1195 1195 1.25000000000000e+00 +1195 1139 8.33333333333333e-02 +1195 1137 8.33333333333333e-02 +1195 1202 8.33333333333333e-02 +1195 1201 -3.75000000000000e-01 +1195 1200 8.33333333333333e-02 +1195 1194 -1.66666666666667e-01 +1195 1193 8.33333333333333e-02 +1195 1192 -1.25000000000000e-01 +1195 1148 -8.33333333333333e-02 +1195 1196 -1.66666666666667e-01 +1195 1136 -8.33333333333333e-02 +1195 893 8.33333333333333e-02 +1195 894 8.33333333333333e-02 +1195 1146 1.66666666666667e-01 +1195 891 -1.66666666666667e-01 +1195 737 -8.33333333333333e-02 +1195 896 8.33333333333333e-02 +1195 895 -3.75000000000000e-01 +1195 735 4.16666666666667e-02 +1195 1134 -8.33333333333333e-02 +1195 902 8.33333333333333e-02 +1195 776 -8.33333333333333e-02 +1195 1191 -4.16666666666667e-02 +1195 901 -1.25000000000000e-01 +1195 1147 -2.50000000000000e-01 +1195 900 -4.16666666666667e-02 +1195 774 4.16666666666667e-02 +1196 1196 1.25000000000000e+00 +1196 1138 8.33333333333333e-02 +1196 1137 -1.66666666666667e-01 +1196 1202 -1.25000000000000e-01 +1196 1201 8.33333333333333e-02 +1196 774 4.16666666666667e-02 +1196 1200 -4.16666666666667e-02 +1196 1193 -3.75000000000000e-01 +1196 1192 8.33333333333333e-02 +1196 735 4.16666666666667e-02 +1196 1147 -8.33333333333333e-02 +1196 1195 -1.66666666666667e-01 +1196 894 -4.16666666666667e-02 +1196 1135 -8.33333333333333e-02 +1196 892 8.33333333333333e-02 +1196 1134 -8.33333333333333e-02 +1196 891 8.33333333333333e-02 +1196 896 -1.25000000000000e-01 +1196 736 -8.33333333333333e-02 +1196 895 8.33333333333333e-02 +1196 1191 8.33333333333333e-02 +1196 902 -3.75000000000000e-01 +1196 1148 -2.50000000000000e-01 +1196 901 8.33333333333333e-02 +1196 775 -8.33333333333333e-02 +1196 1194 -1.66666666666667e-01 +1196 900 8.33333333333333e-02 +1196 1146 1.66666666666667e-01 +1197 1197 1.25000000000000e+00 +1197 1190 8.33333333333333e-02 +1197 1189 -4.16666666666667e-02 +1197 1188 -1.25000000000000e-01 +1197 1186 4.16666666666667e-02 +1197 1111 8.33333333333333e-02 +1197 1102 -8.33333333333333e-02 +1197 1103 -8.33333333333333e-02 +1197 1112 -1.66666666666667e-01 +1197 1175 1.66666666666667e-01 +1197 1199 -1.66666666666667e-01 +1197 935 8.33333333333333e-02 +1197 940 4.16666666666667e-02 +1197 934 -4.16666666666667e-02 +1197 740 -4.16666666666667e-02 +1197 1169 8.33333333333333e-02 +1197 739 8.33333333333333e-02 +1197 1168 -1.66666666666667e-01 +1197 738 -1.25000000000000e-01 +1197 933 -1.25000000000000e-01 +1197 758 -4.16666666666667e-02 +1197 941 4.16666666666667e-02 +1197 1198 -1.66666666666667e-01 +1197 757 8.33333333333333e-02 +1197 1174 1.66666666666667e-01 +1197 1187 4.16666666666667e-02 +1197 756 -1.25000000000000e-01 +1197 1173 -7.50000000000000e-01 +1198 1198 1.25000000000000e+00 +1198 1189 -1.25000000000000e-01 +1198 1188 -4.16666666666667e-02 +1198 1187 -8.33333333333333e-02 +1198 1185 4.16666666666667e-02 +1198 1110 8.33333333333333e-02 +1198 1101 -8.33333333333333e-02 +1198 1112 8.33333333333333e-02 +1198 1103 -8.33333333333333e-02 +1198 1175 -8.33333333333333e-02 +1198 1169 8.33333333333333e-02 +1198 939 4.16666666666667e-02 +1198 933 -4.16666666666667e-02 +1198 740 8.33333333333333e-02 +1198 1199 -1.66666666666667e-01 +1198 935 8.33333333333333e-02 +1198 739 -3.75000000000000e-01 +1198 934 -1.25000000000000e-01 +1198 738 8.33333333333333e-02 +1198 1167 -1.66666666666667e-01 +1198 758 8.33333333333333e-02 +1198 941 -8.33333333333333e-02 +1198 1190 8.33333333333333e-02 +1198 757 -3.75000000000000e-01 +1198 1174 -2.50000000000000e-01 +1198 1197 -1.66666666666667e-01 +1198 756 8.33333333333333e-02 +1198 1173 1.66666666666667e-01 +1199 1199 1.25000000000000e+00 +1199 1190 -3.75000000000000e-01 +1199 1189 8.33333333333333e-02 +1199 1188 8.33333333333333e-02 +1199 1186 -8.33333333333333e-02 +1199 1101 -8.33333333333333e-02 +1199 1111 8.33333333333333e-02 +1199 1110 -1.66666666666667e-01 +1199 1102 -8.33333333333333e-02 +1199 1174 -8.33333333333333e-02 +1199 1168 8.33333333333333e-02 +1199 1173 1.66666666666667e-01 +1199 1197 -1.66666666666667e-01 +1199 933 8.33333333333333e-02 +1199 740 -1.25000000000000e-01 +1199 935 -3.75000000000000e-01 +1199 739 8.33333333333333e-02 +1199 1198 -1.66666666666667e-01 +1199 934 8.33333333333333e-02 +1199 738 -4.16666666666667e-02 +1199 1167 8.33333333333333e-02 +1199 1185 4.16666666666667e-02 +1199 758 -1.25000000000000e-01 +1199 1175 -2.50000000000000e-01 +1199 757 8.33333333333333e-02 +1199 940 -8.33333333333333e-02 +1199 756 -4.16666666666667e-02 +1199 939 4.16666666666667e-02 +1200 1200 1.25000000000000e+00 +1200 1138 -8.33333333333333e-02 +1200 1196 -4.16666666666667e-02 +1200 1148 8.33333333333333e-02 +1200 1195 8.33333333333333e-02 +1200 1147 -1.66666666666667e-01 +1200 1194 -1.25000000000000e-01 +1200 1193 4.16666666666667e-02 +1200 1139 -8.33333333333333e-02 +1200 947 4.16666666666667e-02 +1200 935 -4.16666666666667e-02 +1200 1201 -1.66666666666667e-01 +1200 934 8.33333333333333e-02 +1200 1180 1.66666666666667e-01 +1200 740 8.33333333333333e-02 +1200 1169 -1.66666666666667e-01 +1200 739 -4.16666666666667e-02 +1200 1168 8.33333333333333e-02 +1200 738 -1.25000000000000e-01 +1200 933 -1.25000000000000e-01 +1200 1202 -1.66666666666667e-01 +1200 776 8.33333333333333e-02 +1200 1181 1.66666666666667e-01 +1200 775 -4.16666666666667e-02 +1200 946 4.16666666666667e-02 +1200 1192 4.16666666666667e-02 +1200 774 -1.25000000000000e-01 +1200 1179 -7.50000000000000e-01 +1201 1201 1.25000000000000e+00 +1201 1137 -8.33333333333333e-02 +1201 1148 8.33333333333333e-02 +1201 1139 -8.33333333333333e-02 +1201 1196 8.33333333333333e-02 +1201 1195 -3.75000000000000e-01 +1201 1194 8.33333333333333e-02 +1201 1146 -1.66666666666667e-01 +1201 1193 -8.33333333333333e-02 +1201 1169 8.33333333333333e-02 +1201 1181 -8.33333333333333e-02 +1201 1200 -1.66666666666667e-01 +1201 933 8.33333333333333e-02 +1201 1179 1.66666666666667e-01 +1201 740 8.33333333333333e-02 +1201 1202 -1.66666666666667e-01 +1201 935 8.33333333333333e-02 +1201 739 -1.25000000000000e-01 +1201 934 -3.75000000000000e-01 +1201 738 -4.16666666666667e-02 +1201 1167 8.33333333333333e-02 +1201 776 8.33333333333333e-02 +1201 947 -8.33333333333333e-02 +1201 1191 4.16666666666667e-02 +1201 775 -1.25000000000000e-01 +1201 1180 -2.50000000000000e-01 +1201 774 -4.16666666666667e-02 +1201 945 4.16666666666667e-02 +1202 1202 1.25000000000000e+00 +1202 1138 -8.33333333333333e-02 +1202 1196 -1.25000000000000e-01 +1202 1195 8.33333333333333e-02 +1202 1194 -4.16666666666667e-02 +1202 1146 8.33333333333333e-02 +1202 1192 -8.33333333333333e-02 +1202 1191 4.16666666666667e-02 +1202 1137 -8.33333333333333e-02 +1202 945 4.16666666666667e-02 +1202 933 -4.16666666666667e-02 +1202 1168 8.33333333333333e-02 +1202 1180 -8.33333333333333e-02 +1202 740 -3.75000000000000e-01 +1202 935 -1.25000000000000e-01 +1202 739 8.33333333333333e-02 +1202 1201 -1.66666666666667e-01 +1202 934 8.33333333333333e-02 +1202 738 8.33333333333333e-02 +1202 1167 -1.66666666666667e-01 +1202 1147 8.33333333333333e-02 +1202 776 -3.75000000000000e-01 +1202 1181 -2.50000000000000e-01 +1202 775 8.33333333333333e-02 +1202 946 -8.33333333333333e-02 +1202 1200 -1.66666666666667e-01 +1202 774 8.33333333333333e-02 +1202 1179 1.66666666666667e-01 +1203 1203 1.25000000000000e+00 +1203 995 -8.33333333333333e-02 +1203 1204 -1.66666666666667e-01 +1203 1207 8.33333333333333e-02 +1203 994 1.66666666666667e-01 +1203 1208 8.33333333333333e-02 +1203 742 -4.16666666666667e-02 +1203 991 8.33333333333333e-02 +1203 1206 -3.75000000000000e-01 +1203 1217 -8.33333333333333e-02 +1203 1216 4.16666666666667e-02 +1203 745 -4.16666666666667e-02 +1203 993 -2.50000000000000e-01 +1203 832 4.16666666666667e-02 +1203 976 -8.33333333333333e-02 +1203 977 -8.33333333333333e-02 +1203 980 8.33333333333333e-02 +1203 743 8.33333333333333e-02 +1203 833 -8.33333333333333e-02 +1203 741 -1.25000000000000e-01 +1203 1205 -1.66666666666667e-01 +1203 836 8.33333333333333e-02 +1203 746 8.33333333333333e-02 +1203 835 8.33333333333333e-02 +1203 979 -1.66666666666667e-01 +1203 992 8.33333333333333e-02 +1203 834 -3.75000000000000e-01 +1203 744 -1.25000000000000e-01 +1204 1204 1.25000000000000e+00 +1204 1217 4.16666666666667e-02 +1204 1203 -1.66666666666667e-01 +1204 1206 8.33333333333333e-02 +1204 993 1.66666666666667e-01 +1204 743 8.33333333333333e-02 +1204 992 -1.66666666666667e-01 +1204 1207 -1.25000000000000e-01 +1204 741 -4.16666666666667e-02 +1204 990 8.33333333333333e-02 +1204 1205 -1.66666666666667e-01 +1204 995 1.66666666666667e-01 +1204 746 8.33333333333333e-02 +1204 994 -7.50000000000000e-01 +1204 1215 4.16666666666667e-02 +1204 744 -4.16666666666667e-02 +1204 831 4.16666666666667e-02 +1204 975 -8.33333333333333e-02 +1204 833 4.16666666666667e-02 +1204 977 -8.33333333333333e-02 +1204 742 -1.25000000000000e-01 +1204 836 -4.16666666666667e-02 +1204 980 8.33333333333333e-02 +1204 1208 -4.16666666666667e-02 +1204 835 -1.25000000000000e-01 +1204 745 -1.25000000000000e-01 +1204 834 8.33333333333333e-02 +1204 978 -1.66666666666667e-01 +1205 1205 1.25000000000000e+00 +1205 993 -8.33333333333333e-02 +1205 1207 -4.16666666666667e-02 +1205 1216 4.16666666666667e-02 +1205 1208 -1.25000000000000e-01 +1205 742 8.33333333333333e-02 +1205 991 -1.66666666666667e-01 +1205 1206 8.33333333333333e-02 +1205 995 -2.50000000000000e-01 +1205 1204 -1.66666666666667e-01 +1205 994 1.66666666666667e-01 +1205 745 8.33333333333333e-02 +1205 1215 -8.33333333333333e-02 +1205 975 -8.33333333333333e-02 +1205 978 8.33333333333333e-02 +1205 743 -3.75000000000000e-01 +1205 832 4.16666666666667e-02 +1205 976 -8.33333333333333e-02 +1205 741 8.33333333333333e-02 +1205 831 -8.33333333333333e-02 +1205 990 8.33333333333333e-02 +1205 836 -1.25000000000000e-01 +1205 746 -3.75000000000000e-01 +1205 835 -4.16666666666667e-02 +1205 979 8.33333333333333e-02 +1205 1203 -1.66666666666667e-01 +1205 834 8.33333333333333e-02 +1205 744 8.33333333333333e-02 +1206 1206 1.25000000000000e+00 +1206 1204 8.33333333333333e-02 +1206 994 -1.66666666666667e-01 +1206 1205 8.33333333333333e-02 +1206 742 4.16666666666667e-02 +1206 1203 -3.75000000000000e-01 +1206 1217 8.33333333333333e-02 +1206 751 4.16666666666667e-02 +1206 1216 -4.16666666666667e-02 +1206 1215 -1.25000000000000e-01 +1206 991 -8.33333333333333e-02 +1206 992 -8.33333333333333e-02 +1206 1208 -1.66666666666667e-01 +1206 844 -4.16666666666667e-02 +1206 838 8.33333333333333e-02 +1206 839 8.33333333333333e-02 +1206 998 -8.33333333333333e-02 +1206 845 8.33333333333333e-02 +1206 743 -8.33333333333333e-02 +1206 843 -1.25000000000000e-01 +1206 851 8.33333333333333e-02 +1206 752 -8.33333333333333e-02 +1206 850 8.33333333333333e-02 +1206 1207 -1.66666666666667e-01 +1206 997 1.66666666666667e-01 +1206 849 -3.75000000000000e-01 +1206 995 8.33333333333333e-02 +1206 996 -2.50000000000000e-01 +1207 1207 1.25000000000000e+00 +1207 995 8.33333333333333e-02 +1207 1203 8.33333333333333e-02 +1207 993 -1.66666666666667e-01 +1207 1204 -1.25000000000000e-01 +1207 741 4.16666666666667e-02 +1207 1208 -1.66666666666667e-01 +1207 1217 8.33333333333333e-02 +1207 1216 -1.25000000000000e-01 +1207 750 4.16666666666667e-02 +1207 1215 -4.16666666666667e-02 +1207 990 -8.33333333333333e-02 +1207 845 8.33333333333333e-02 +1207 843 -4.16666666666667e-02 +1207 837 8.33333333333333e-02 +1207 839 -1.66666666666667e-01 +1207 998 1.66666666666667e-01 +1207 743 4.16666666666667e-02 +1207 992 -8.33333333333333e-02 +1207 844 -1.25000000000000e-01 +1207 851 -4.16666666666667e-02 +1207 752 4.16666666666667e-02 +1207 850 -1.25000000000000e-01 +1207 1205 -4.16666666666667e-02 +1207 997 -7.50000000000000e-01 +1207 849 8.33333333333333e-02 +1207 1206 -1.66666666666667e-01 +1207 996 1.66666666666667e-01 +1208 1208 1.25000000000000e+00 +1208 1204 -4.16666666666667e-02 +1208 994 8.33333333333333e-02 +1208 1205 -1.25000000000000e-01 +1208 1203 8.33333333333333e-02 +1208 1217 -3.75000000000000e-01 +1208 1207 -1.66666666666667e-01 +1208 1216 8.33333333333333e-02 +1208 1215 8.33333333333333e-02 +1208 990 -8.33333333333333e-02 +1208 844 8.33333333333333e-02 +1208 1206 -1.66666666666667e-01 +1208 838 -1.66666666666667e-01 +1208 997 1.66666666666667e-01 +1208 837 8.33333333333333e-02 +1208 996 -8.33333333333333e-02 +1208 845 -3.75000000000000e-01 +1208 742 4.16666666666667e-02 +1208 991 -8.33333333333333e-02 +1208 843 8.33333333333333e-02 +1208 741 -8.33333333333333e-02 +1208 851 -1.25000000000000e-01 +1208 993 8.33333333333333e-02 +1208 998 -2.50000000000000e-01 +1208 850 -4.16666666666667e-02 +1208 751 4.16666666666667e-02 +1208 849 8.33333333333333e-02 +1208 750 -8.33333333333333e-02 +1209 1209 1.25000000000000e+00 +1209 1219 4.16666666666667e-02 +1209 1220 -8.33333333333333e-02 +1209 1214 8.33333333333333e-02 +1209 1212 -1.25000000000000e-01 +1209 1034 -8.33333333333333e-02 +1209 745 8.33333333333333e-02 +1209 1210 -1.66666666666667e-01 +1209 1033 1.66666666666667e-01 +1209 1032 -2.50000000000000e-01 +1209 980 8.33333333333333e-02 +1209 1211 -1.66666666666667e-01 +1209 836 8.33333333333333e-02 +1209 746 8.33333333333333e-02 +1209 835 -4.16666666666667e-02 +1209 979 8.33333333333333e-02 +1209 1213 -4.16666666666667e-02 +1209 834 -1.25000000000000e-01 +1209 744 -3.75000000000000e-01 +1209 599 8.33333333333333e-02 +1209 106 8.33333333333333e-02 +1209 598 -1.66666666666667e-01 +1209 590 -8.33333333333333e-02 +1209 107 8.33333333333333e-02 +1209 233 -8.33333333333333e-02 +1209 232 4.16666666666667e-02 +1209 589 -8.33333333333333e-02 +1209 105 -3.75000000000000e-01 +1210 1210 1.25000000000000e+00 +1210 1211 -1.66666666666667e-01 +1210 1212 -4.16666666666667e-02 +1210 1218 4.16666666666667e-02 +1210 746 -4.16666666666667e-02 +1210 1220 4.16666666666667e-02 +1210 1213 -1.25000000000000e-01 +1210 1034 1.66666666666667e-01 +1210 1033 -7.50000000000000e-01 +1210 744 8.33333333333333e-02 +1210 1209 -1.66666666666667e-01 +1210 1032 1.66666666666667e-01 +1210 836 8.33333333333333e-02 +1210 980 -1.66666666666667e-01 +1210 1214 8.33333333333333e-02 +1210 835 -1.25000000000000e-01 +1210 745 -1.25000000000000e-01 +1210 834 -4.16666666666667e-02 +1210 978 8.33333333333333e-02 +1210 107 -4.16666666666667e-02 +1210 599 8.33333333333333e-02 +1210 105 8.33333333333333e-02 +1210 597 -1.66666666666667e-01 +1210 233 4.16666666666667e-02 +1210 590 -8.33333333333333e-02 +1210 106 -1.25000000000000e-01 +1210 231 4.16666666666667e-02 +1210 588 -8.33333333333333e-02 +1211 1211 1.25000000000000e+00 +1211 1210 -1.66666666666667e-01 +1211 745 -4.16666666666667e-02 +1211 1219 4.16666666666667e-02 +1211 1218 -8.33333333333333e-02 +1211 1214 -3.75000000000000e-01 +1211 1212 8.33333333333333e-02 +1211 1034 -2.50000000000000e-01 +1211 1033 1.66666666666667e-01 +1211 1032 -8.33333333333333e-02 +1211 978 8.33333333333333e-02 +1211 1213 8.33333333333333e-02 +1211 836 -3.75000000000000e-01 +1211 746 -1.25000000000000e-01 +1211 835 8.33333333333333e-02 +1211 979 -1.66666666666667e-01 +1211 1209 -1.66666666666667e-01 +1211 834 8.33333333333333e-02 +1211 744 8.33333333333333e-02 +1211 106 -4.16666666666667e-02 +1211 598 8.33333333333333e-02 +1211 597 8.33333333333333e-02 +1211 588 -8.33333333333333e-02 +1211 232 4.16666666666667e-02 +1211 589 -8.33333333333333e-02 +1211 107 -1.25000000000000e-01 +1211 105 8.33333333333333e-02 +1211 231 -8.33333333333333e-02 +1212 1212 1.25000000000000e+00 +1212 1034 8.33333333333333e-02 +1212 1033 8.33333333333333e-02 +1212 1220 8.33333333333333e-02 +1212 1219 8.33333333333333e-02 +1212 1213 -1.66666666666667e-01 +1212 1218 -3.75000000000000e-01 +1212 1211 8.33333333333333e-02 +1212 1209 -1.25000000000000e-01 +1212 1040 -8.33333333333333e-02 +1212 1214 -1.66666666666667e-01 +1212 1039 1.66666666666667e-01 +1212 905 8.33333333333333e-02 +1212 779 -8.33333333333333e-02 +1212 904 -4.16666666666667e-02 +1212 778 4.16666666666667e-02 +1212 903 -1.25000000000000e-01 +1212 1210 -4.16666666666667e-02 +1212 1038 -2.50000000000000e-01 +1212 599 -8.33333333333333e-02 +1212 317 8.33333333333333e-02 +1212 322 8.33333333333333e-02 +1212 316 -1.66666666666667e-01 +1212 323 8.33333333333333e-02 +1212 107 -8.33333333333333e-02 +1212 106 4.16666666666667e-02 +1212 598 -8.33333333333333e-02 +1212 321 -3.75000000000000e-01 +1213 1213 1.25000000000000e+00 +1213 1209 -4.16666666666667e-02 +1213 1034 -1.66666666666667e-01 +1213 1032 8.33333333333333e-02 +1213 1220 -4.16666666666667e-02 +1213 779 4.16666666666667e-02 +1213 1219 -1.25000000000000e-01 +1213 1218 8.33333333333333e-02 +1213 1212 -1.66666666666667e-01 +1213 1210 -1.25000000000000e-01 +1213 1038 1.66666666666667e-01 +1213 905 8.33333333333333e-02 +1213 1214 -1.66666666666667e-01 +1213 1040 1.66666666666667e-01 +1213 904 -1.25000000000000e-01 +1213 1211 8.33333333333333e-02 +1213 1039 -7.50000000000000e-01 +1213 903 -4.16666666666667e-02 +1213 777 4.16666666666667e-02 +1213 107 4.16666666666667e-02 +1213 323 -4.16666666666667e-02 +1213 321 8.33333333333333e-02 +1213 599 -8.33333333333333e-02 +1213 317 8.33333333333333e-02 +1213 315 -1.66666666666667e-01 +1213 322 -1.25000000000000e-01 +1213 105 4.16666666666667e-02 +1213 597 -8.33333333333333e-02 +1214 1214 1.25000000000000e+00 +1214 1032 8.33333333333333e-02 +1214 1033 -1.66666666666667e-01 +1214 1220 -1.25000000000000e-01 +1214 1219 -4.16666666666667e-02 +1214 778 4.16666666666667e-02 +1214 1218 8.33333333333333e-02 +1214 1211 -3.75000000000000e-01 +1214 1209 8.33333333333333e-02 +1214 1038 -8.33333333333333e-02 +1214 1212 -1.66666666666667e-01 +1214 905 -3.75000000000000e-01 +1214 1210 8.33333333333333e-02 +1214 1040 -2.50000000000000e-01 +1214 904 8.33333333333333e-02 +1214 1213 -1.66666666666667e-01 +1214 1039 1.66666666666667e-01 +1214 903 8.33333333333333e-02 +1214 777 -8.33333333333333e-02 +1214 106 4.16666666666667e-02 +1214 322 -4.16666666666667e-02 +1214 597 -8.33333333333333e-02 +1214 315 8.33333333333333e-02 +1214 598 -8.33333333333333e-02 +1214 316 8.33333333333333e-02 +1214 323 -1.25000000000000e-01 +1214 321 8.33333333333333e-02 +1214 105 -8.33333333333333e-02 +1215 1215 1.25000000000000e+00 +1215 1207 -4.16666666666667e-02 +1215 1206 -1.25000000000000e-01 +1215 1205 -8.33333333333333e-02 +1215 1204 4.16666666666667e-02 +1215 997 8.33333333333333e-02 +1215 994 -8.33333333333333e-02 +1215 998 8.33333333333333e-02 +1215 995 -8.33333333333333e-02 +1215 1046 8.33333333333333e-02 +1215 1049 -8.33333333333333e-02 +1215 916 4.16666666666667e-02 +1215 913 -4.16666666666667e-02 +1215 752 8.33333333333333e-02 +1215 917 -8.33333333333333e-02 +1215 751 8.33333333333333e-02 +1215 1216 -1.66666666666667e-01 +1215 1048 1.66666666666667e-01 +1215 750 -3.75000000000000e-01 +1215 1047 -2.50000000000000e-01 +1215 1217 -1.66666666666667e-01 +1215 746 8.33333333333333e-02 +1215 914 8.33333333333333e-02 +1215 745 8.33333333333333e-02 +1215 1045 -1.66666666666667e-01 +1215 1208 8.33333333333333e-02 +1215 744 -3.75000000000000e-01 +1215 912 -1.25000000000000e-01 +1216 1216 1.25000000000000e+00 +1216 1208 8.33333333333333e-02 +1216 1207 -1.25000000000000e-01 +1216 1206 -4.16666666666667e-02 +1216 1203 4.16666666666667e-02 +1216 996 8.33333333333333e-02 +1216 993 -8.33333333333333e-02 +1216 995 -8.33333333333333e-02 +1216 998 -1.66666666666667e-01 +1216 1217 -1.66666666666667e-01 +1216 1049 1.66666666666667e-01 +1216 914 8.33333333333333e-02 +1216 915 4.16666666666667e-02 +1216 912 -4.16666666666667e-02 +1216 752 -4.16666666666667e-02 +1216 917 4.16666666666667e-02 +1216 751 -1.25000000000000e-01 +1216 1048 -7.50000000000000e-01 +1216 750 8.33333333333333e-02 +1216 1215 -1.66666666666667e-01 +1216 1047 1.66666666666667e-01 +1216 746 -4.16666666666667e-02 +1216 1046 8.33333333333333e-02 +1216 1205 4.16666666666667e-02 +1216 745 -1.25000000000000e-01 +1216 913 -1.25000000000000e-01 +1216 744 8.33333333333333e-02 +1216 1044 -1.66666666666667e-01 +1217 1217 1.25000000000000e+00 +1217 1208 -3.75000000000000e-01 +1217 1207 8.33333333333333e-02 +1217 1206 8.33333333333333e-02 +1217 1203 -8.33333333333333e-02 +1217 994 -8.33333333333333e-02 +1217 997 -1.66666666666667e-01 +1217 996 8.33333333333333e-02 +1217 993 -8.33333333333333e-02 +1217 1044 8.33333333333333e-02 +1217 1047 -8.33333333333333e-02 +1217 1216 -1.66666666666667e-01 +1217 1048 1.66666666666667e-01 +1217 913 8.33333333333333e-02 +1217 752 -1.25000000000000e-01 +1217 1049 -2.50000000000000e-01 +1217 751 -4.16666666666667e-02 +1217 916 4.16666666666667e-02 +1217 750 8.33333333333333e-02 +1217 915 -8.33333333333333e-02 +1217 1204 4.16666666666667e-02 +1217 746 -1.25000000000000e-01 +1217 914 -3.75000000000000e-01 +1217 745 -4.16666666666667e-02 +1217 1045 8.33333333333333e-02 +1217 1215 -1.66666666666667e-01 +1217 744 8.33333333333333e-02 +1217 912 8.33333333333333e-02 +1218 1218 1.25000000000000e+00 +1218 1033 -8.33333333333333e-02 +1218 1040 8.33333333333333e-02 +1218 1034 -8.33333333333333e-02 +1218 1211 -8.33333333333333e-02 +1218 1214 8.33333333333333e-02 +1218 1213 8.33333333333333e-02 +1218 1039 -1.66666666666667e-01 +1218 1212 -3.75000000000000e-01 +1218 1046 8.33333333333333e-02 +1218 1058 -8.33333333333333e-02 +1218 913 8.33333333333333e-02 +1218 1219 -1.66666666666667e-01 +1218 1057 1.66666666666667e-01 +1218 779 8.33333333333333e-02 +1218 926 -8.33333333333333e-02 +1218 778 -4.16666666666667e-02 +1218 925 4.16666666666667e-02 +1218 777 -1.25000000000000e-01 +1218 1056 -2.50000000000000e-01 +1218 1220 -1.66666666666667e-01 +1218 746 8.33333333333333e-02 +1218 914 8.33333333333333e-02 +1218 745 -4.16666666666667e-02 +1218 1045 8.33333333333333e-02 +1218 1210 4.16666666666667e-02 +1218 744 -1.25000000000000e-01 +1218 912 -3.75000000000000e-01 +1219 1219 1.25000000000000e+00 +1219 1032 -8.33333333333333e-02 +1219 1211 4.16666666666667e-02 +1219 1034 -8.33333333333333e-02 +1219 1214 -4.16666666666667e-02 +1219 1040 8.33333333333333e-02 +1219 1213 -1.25000000000000e-01 +1219 1212 8.33333333333333e-02 +1219 1038 -1.66666666666667e-01 +1219 914 -4.16666666666667e-02 +1219 926 4.16666666666667e-02 +1219 912 8.33333333333333e-02 +1219 1218 -1.66666666666667e-01 +1219 1056 1.66666666666667e-01 +1219 779 8.33333333333333e-02 +1219 1220 -1.66666666666667e-01 +1219 1058 1.66666666666667e-01 +1219 778 -1.25000000000000e-01 +1219 1057 -7.50000000000000e-01 +1219 777 -4.16666666666667e-02 +1219 924 4.16666666666667e-02 +1219 746 8.33333333333333e-02 +1219 1046 -1.66666666666667e-01 +1219 1209 4.16666666666667e-02 +1219 745 -1.25000000000000e-01 +1219 913 -1.25000000000000e-01 +1219 744 -4.16666666666667e-02 +1219 1044 8.33333333333333e-02 +1220 1220 1.25000000000000e+00 +1220 1032 -8.33333333333333e-02 +1220 1210 4.16666666666667e-02 +1220 1033 -8.33333333333333e-02 +1220 1209 -8.33333333333333e-02 +1220 1214 -1.25000000000000e-01 +1220 1213 -4.16666666666667e-02 +1220 1039 8.33333333333333e-02 +1220 1212 8.33333333333333e-02 +1220 913 -4.16666666666667e-02 +1220 925 4.16666666666667e-02 +1220 1044 8.33333333333333e-02 +1220 1056 -8.33333333333333e-02 +1220 779 -3.75000000000000e-01 +1220 1058 -2.50000000000000e-01 +1220 778 8.33333333333333e-02 +1220 1219 -1.66666666666667e-01 +1220 1057 1.66666666666667e-01 +1220 777 8.33333333333333e-02 +1220 924 -8.33333333333333e-02 +1220 1038 8.33333333333333e-02 +1220 746 -3.75000000000000e-01 +1220 914 -1.25000000000000e-01 +1220 745 8.33333333333333e-02 +1220 1045 -1.66666666666667e-01 +1220 1218 -1.66666666666667e-01 +1220 744 8.33333333333333e-02 +1220 912 8.33333333333333e-02 +1221 1221 1.25000000000000e+00 +1221 1109 -8.33333333333333e-02 +1221 1222 -1.66666666666667e-01 +1221 1225 8.33333333333333e-02 +1221 1108 1.66666666666667e-01 +1221 1226 8.33333333333333e-02 +1221 748 -4.16666666666667e-02 +1221 1105 8.33333333333333e-02 +1221 1224 -3.75000000000000e-01 +1221 1235 -8.33333333333333e-02 +1221 1234 4.16666666666667e-02 +1221 754 -4.16666666666667e-02 +1221 1107 -2.50000000000000e-01 +1221 847 4.16666666666667e-02 +1221 1087 -8.33333333333333e-02 +1221 1088 -8.33333333333333e-02 +1221 1094 8.33333333333333e-02 +1221 749 8.33333333333333e-02 +1221 848 -8.33333333333333e-02 +1221 747 -1.25000000000000e-01 +1221 1223 -1.66666666666667e-01 +1221 854 8.33333333333333e-02 +1221 755 8.33333333333333e-02 +1221 853 8.33333333333333e-02 +1221 1093 -1.66666666666667e-01 +1221 1106 8.33333333333333e-02 +1221 852 -3.75000000000000e-01 +1221 753 -1.25000000000000e-01 +1222 1222 1.25000000000000e+00 +1222 1235 4.16666666666667e-02 +1222 1221 -1.66666666666667e-01 +1222 1224 8.33333333333333e-02 +1222 1107 1.66666666666667e-01 +1222 749 8.33333333333333e-02 +1222 1106 -1.66666666666667e-01 +1222 1225 -1.25000000000000e-01 +1222 747 -4.16666666666667e-02 +1222 1104 8.33333333333333e-02 +1222 1223 -1.66666666666667e-01 +1222 1109 1.66666666666667e-01 +1222 755 8.33333333333333e-02 +1222 1108 -7.50000000000000e-01 +1222 1233 4.16666666666667e-02 +1222 753 -4.16666666666667e-02 +1222 846 4.16666666666667e-02 +1222 1086 -8.33333333333333e-02 +1222 848 4.16666666666667e-02 +1222 1088 -8.33333333333333e-02 +1222 748 -1.25000000000000e-01 +1222 854 -4.16666666666667e-02 +1222 1094 8.33333333333333e-02 +1222 1226 -4.16666666666667e-02 +1222 853 -1.25000000000000e-01 +1222 754 -1.25000000000000e-01 +1222 852 8.33333333333333e-02 +1222 1092 -1.66666666666667e-01 +1223 1223 1.25000000000000e+00 +1223 1107 -8.33333333333333e-02 +1223 1225 -4.16666666666667e-02 +1223 1234 4.16666666666667e-02 +1223 1226 -1.25000000000000e-01 +1223 748 8.33333333333333e-02 +1223 1105 -1.66666666666667e-01 +1223 1224 8.33333333333333e-02 +1223 1109 -2.50000000000000e-01 +1223 1222 -1.66666666666667e-01 +1223 1108 1.66666666666667e-01 +1223 754 8.33333333333333e-02 +1223 1233 -8.33333333333333e-02 +1223 1086 -8.33333333333333e-02 +1223 1092 8.33333333333333e-02 +1223 749 -3.75000000000000e-01 +1223 847 4.16666666666667e-02 +1223 1087 -8.33333333333333e-02 +1223 747 8.33333333333333e-02 +1223 846 -8.33333333333333e-02 +1223 1104 8.33333333333333e-02 +1223 854 -1.25000000000000e-01 +1223 755 -3.75000000000000e-01 +1223 853 -4.16666666666667e-02 +1223 1093 8.33333333333333e-02 +1223 1221 -1.66666666666667e-01 +1223 852 8.33333333333333e-02 +1223 753 8.33333333333333e-02 +1224 1224 1.25000000000000e+00 +1224 1222 8.33333333333333e-02 +1224 1108 -1.66666666666667e-01 +1224 1223 8.33333333333333e-02 +1224 748 4.16666666666667e-02 +1224 1221 -3.75000000000000e-01 +1224 1235 8.33333333333333e-02 +1224 757 4.16666666666667e-02 +1224 1234 -4.16666666666667e-02 +1224 1233 -1.25000000000000e-01 +1224 1105 -8.33333333333333e-02 +1224 1106 -8.33333333333333e-02 +1224 1226 -1.66666666666667e-01 +1224 862 -4.16666666666667e-02 +1224 856 8.33333333333333e-02 +1224 857 8.33333333333333e-02 +1224 1112 -8.33333333333333e-02 +1224 863 8.33333333333333e-02 +1224 749 -8.33333333333333e-02 +1224 861 -1.25000000000000e-01 +1224 866 8.33333333333333e-02 +1224 758 -8.33333333333333e-02 +1224 865 8.33333333333333e-02 +1224 1225 -1.66666666666667e-01 +1224 1111 1.66666666666667e-01 +1224 864 -3.75000000000000e-01 +1224 1109 8.33333333333333e-02 +1224 1110 -2.50000000000000e-01 +1225 1225 1.25000000000000e+00 +1225 1109 8.33333333333333e-02 +1225 1221 8.33333333333333e-02 +1225 1107 -1.66666666666667e-01 +1225 1222 -1.25000000000000e-01 +1225 747 4.16666666666667e-02 +1225 1226 -1.66666666666667e-01 +1225 1235 8.33333333333333e-02 +1225 1234 -1.25000000000000e-01 +1225 756 4.16666666666667e-02 +1225 1233 -4.16666666666667e-02 +1225 1104 -8.33333333333333e-02 +1225 863 8.33333333333333e-02 +1225 861 -4.16666666666667e-02 +1225 855 8.33333333333333e-02 +1225 857 -1.66666666666667e-01 +1225 1112 1.66666666666667e-01 +1225 749 4.16666666666667e-02 +1225 1106 -8.33333333333333e-02 +1225 862 -1.25000000000000e-01 +1225 866 -4.16666666666667e-02 +1225 758 4.16666666666667e-02 +1225 865 -1.25000000000000e-01 +1225 1223 -4.16666666666667e-02 +1225 1111 -7.50000000000000e-01 +1225 864 8.33333333333333e-02 +1225 1224 -1.66666666666667e-01 +1225 1110 1.66666666666667e-01 +1226 1226 1.25000000000000e+00 +1226 1222 -4.16666666666667e-02 +1226 1108 8.33333333333333e-02 +1226 1223 -1.25000000000000e-01 +1226 1221 8.33333333333333e-02 +1226 1235 -3.75000000000000e-01 +1226 1225 -1.66666666666667e-01 +1226 1234 8.33333333333333e-02 +1226 1233 8.33333333333333e-02 +1226 1104 -8.33333333333333e-02 +1226 862 8.33333333333333e-02 +1226 1224 -1.66666666666667e-01 +1226 856 -1.66666666666667e-01 +1226 1111 1.66666666666667e-01 +1226 855 8.33333333333333e-02 +1226 1110 -8.33333333333333e-02 +1226 863 -3.75000000000000e-01 +1226 748 4.16666666666667e-02 +1226 1105 -8.33333333333333e-02 +1226 861 8.33333333333333e-02 +1226 747 -8.33333333333333e-02 +1226 866 -1.25000000000000e-01 +1226 1107 8.33333333333333e-02 +1226 1112 -2.50000000000000e-01 +1226 865 -4.16666666666667e-02 +1226 757 4.16666666666667e-02 +1226 864 8.33333333333333e-02 +1226 756 -8.33333333333333e-02 +1227 1227 1.25000000000000e+00 +1227 1237 4.16666666666667e-02 +1227 1238 -8.33333333333333e-02 +1227 1232 8.33333333333333e-02 +1227 1230 -1.25000000000000e-01 +1227 1157 -8.33333333333333e-02 +1227 754 8.33333333333333e-02 +1227 1228 -1.66666666666667e-01 +1227 1156 1.66666666666667e-01 +1227 1155 -2.50000000000000e-01 +1227 1154 8.33333333333333e-02 +1227 751 8.33333333333333e-02 +1227 1153 -1.66666666666667e-01 +1227 1094 8.33333333333333e-02 +1227 1091 -8.33333333333333e-02 +1227 752 8.33333333333333e-02 +1227 851 -8.33333333333333e-02 +1227 850 4.16666666666667e-02 +1227 1090 -8.33333333333333e-02 +1227 750 -3.75000000000000e-01 +1227 1229 -1.66666666666667e-01 +1227 854 8.33333333333333e-02 +1227 755 8.33333333333333e-02 +1227 853 -4.16666666666667e-02 +1227 1093 8.33333333333333e-02 +1227 1231 -4.16666666666667e-02 +1227 852 -1.25000000000000e-01 +1227 753 -3.75000000000000e-01 +1228 1228 1.25000000000000e+00 +1228 1229 -1.66666666666667e-01 +1228 1230 -4.16666666666667e-02 +1228 1236 4.16666666666667e-02 +1228 755 -4.16666666666667e-02 +1228 1238 4.16666666666667e-02 +1228 752 -4.16666666666667e-02 +1228 1231 -1.25000000000000e-01 +1228 1154 8.33333333333333e-02 +1228 1157 1.66666666666667e-01 +1228 1156 -7.50000000000000e-01 +1228 753 8.33333333333333e-02 +1228 1227 -1.66666666666667e-01 +1228 1155 1.66666666666667e-01 +1228 750 8.33333333333333e-02 +1228 1152 -1.66666666666667e-01 +1228 851 4.16666666666667e-02 +1228 1091 -8.33333333333333e-02 +1228 751 -1.25000000000000e-01 +1228 849 4.16666666666667e-02 +1228 1089 -8.33333333333333e-02 +1228 854 8.33333333333333e-02 +1228 1094 -1.66666666666667e-01 +1228 1232 8.33333333333333e-02 +1228 853 -1.25000000000000e-01 +1228 754 -1.25000000000000e-01 +1228 852 -4.16666666666667e-02 +1228 1092 8.33333333333333e-02 +1229 1229 1.25000000000000e+00 +1229 1228 -1.66666666666667e-01 +1229 754 -4.16666666666667e-02 +1229 1237 4.16666666666667e-02 +1229 1236 -8.33333333333333e-02 +1229 1232 -3.75000000000000e-01 +1229 751 -4.16666666666667e-02 +1229 1230 8.33333333333333e-02 +1229 1153 8.33333333333333e-02 +1229 1157 -2.50000000000000e-01 +1229 1156 1.66666666666667e-01 +1229 1155 -8.33333333333333e-02 +1229 1152 8.33333333333333e-02 +1229 1092 8.33333333333333e-02 +1229 1089 -8.33333333333333e-02 +1229 850 4.16666666666667e-02 +1229 1090 -8.33333333333333e-02 +1229 752 -1.25000000000000e-01 +1229 750 8.33333333333333e-02 +1229 849 -8.33333333333333e-02 +1229 1231 8.33333333333333e-02 +1229 854 -3.75000000000000e-01 +1229 755 -1.25000000000000e-01 +1229 853 8.33333333333333e-02 +1229 1093 -1.66666666666667e-01 +1229 1227 -1.66666666666667e-01 +1229 852 8.33333333333333e-02 +1229 753 8.33333333333333e-02 +1230 1230 1.25000000000000e+00 +1230 1157 8.33333333333333e-02 +1230 1156 8.33333333333333e-02 +1230 1238 8.33333333333333e-02 +1230 1237 8.33333333333333e-02 +1230 1231 -1.66666666666667e-01 +1230 1236 -3.75000000000000e-01 +1230 1229 8.33333333333333e-02 +1230 1227 -1.25000000000000e-01 +1230 1166 -8.33333333333333e-02 +1230 1232 -1.66666666666667e-01 +1230 1154 -8.33333333333333e-02 +1230 911 8.33333333333333e-02 +1230 916 8.33333333333333e-02 +1230 1165 1.66666666666667e-01 +1230 910 -1.66666666666667e-01 +1230 917 8.33333333333333e-02 +1230 752 -8.33333333333333e-02 +1230 751 4.16666666666667e-02 +1230 1153 -8.33333333333333e-02 +1230 915 -3.75000000000000e-01 +1230 929 8.33333333333333e-02 +1230 782 -8.33333333333333e-02 +1230 928 -4.16666666666667e-02 +1230 781 4.16666666666667e-02 +1230 927 -1.25000000000000e-01 +1230 1228 -4.16666666666667e-02 +1230 1164 -2.50000000000000e-01 +1231 1231 1.25000000000000e+00 +1231 1227 -4.16666666666667e-02 +1231 1157 -1.66666666666667e-01 +1231 1155 8.33333333333333e-02 +1231 1238 -4.16666666666667e-02 +1231 782 4.16666666666667e-02 +1231 1237 -1.25000000000000e-01 +1231 1236 8.33333333333333e-02 +1231 1230 -1.66666666666667e-01 +1231 752 4.16666666666667e-02 +1231 1228 -1.25000000000000e-01 +1231 917 -4.16666666666667e-02 +1231 915 8.33333333333333e-02 +1231 1154 -8.33333333333333e-02 +1231 911 8.33333333333333e-02 +1231 1164 1.66666666666667e-01 +1231 909 -1.66666666666667e-01 +1231 916 -1.25000000000000e-01 +1231 750 4.16666666666667e-02 +1231 1152 -8.33333333333333e-02 +1231 929 8.33333333333333e-02 +1231 1232 -1.66666666666667e-01 +1231 1166 1.66666666666667e-01 +1231 928 -1.25000000000000e-01 +1231 1229 8.33333333333333e-02 +1231 1165 -7.50000000000000e-01 +1231 927 -4.16666666666667e-02 +1231 780 4.16666666666667e-02 +1232 1232 1.25000000000000e+00 +1232 1155 8.33333333333333e-02 +1232 1156 -1.66666666666667e-01 +1232 1238 -1.25000000000000e-01 +1232 1237 -4.16666666666667e-02 +1232 781 4.16666666666667e-02 +1232 1236 8.33333333333333e-02 +1232 1229 -3.75000000000000e-01 +1232 751 4.16666666666667e-02 +1232 1227 8.33333333333333e-02 +1232 1164 -8.33333333333333e-02 +1232 916 -4.16666666666667e-02 +1232 1230 -1.66666666666667e-01 +1232 1152 -8.33333333333333e-02 +1232 909 8.33333333333333e-02 +1232 1153 -8.33333333333333e-02 +1232 910 8.33333333333333e-02 +1232 917 -1.25000000000000e-01 +1232 915 8.33333333333333e-02 +1232 750 -8.33333333333333e-02 +1232 929 -3.75000000000000e-01 +1232 1228 8.33333333333333e-02 +1232 1166 -2.50000000000000e-01 +1232 928 8.33333333333333e-02 +1232 1231 -1.66666666666667e-01 +1232 1165 1.66666666666667e-01 +1232 927 8.33333333333333e-02 +1232 780 -8.33333333333333e-02 +1233 1233 1.25000000000000e+00 +1233 1225 -4.16666666666667e-02 +1233 1224 -1.25000000000000e-01 +1233 1223 -8.33333333333333e-02 +1233 1222 4.16666666666667e-02 +1233 1111 8.33333333333333e-02 +1233 1108 -8.33333333333333e-02 +1233 1112 8.33333333333333e-02 +1233 1109 -8.33333333333333e-02 +1233 1172 8.33333333333333e-02 +1233 1175 -8.33333333333333e-02 +1233 940 4.16666666666667e-02 +1233 937 -4.16666666666667e-02 +1233 758 8.33333333333333e-02 +1233 941 -8.33333333333333e-02 +1233 757 8.33333333333333e-02 +1233 1234 -1.66666666666667e-01 +1233 1174 1.66666666666667e-01 +1233 756 -3.75000000000000e-01 +1233 1173 -2.50000000000000e-01 +1233 1235 -1.66666666666667e-01 +1233 755 8.33333333333333e-02 +1233 938 8.33333333333333e-02 +1233 754 8.33333333333333e-02 +1233 1171 -1.66666666666667e-01 +1233 1226 8.33333333333333e-02 +1233 753 -3.75000000000000e-01 +1233 936 -1.25000000000000e-01 +1234 1234 1.25000000000000e+00 +1234 1226 8.33333333333333e-02 +1234 1225 -1.25000000000000e-01 +1234 1224 -4.16666666666667e-02 +1234 1221 4.16666666666667e-02 +1234 1110 8.33333333333333e-02 +1234 1107 -8.33333333333333e-02 +1234 1109 -8.33333333333333e-02 +1234 1112 -1.66666666666667e-01 +1234 1235 -1.66666666666667e-01 +1234 1175 1.66666666666667e-01 +1234 938 8.33333333333333e-02 +1234 939 4.16666666666667e-02 +1234 936 -4.16666666666667e-02 +1234 758 -4.16666666666667e-02 +1234 941 4.16666666666667e-02 +1234 757 -1.25000000000000e-01 +1234 1174 -7.50000000000000e-01 +1234 756 8.33333333333333e-02 +1234 1233 -1.66666666666667e-01 +1234 1173 1.66666666666667e-01 +1234 755 -4.16666666666667e-02 +1234 1172 8.33333333333333e-02 +1234 1223 4.16666666666667e-02 +1234 754 -1.25000000000000e-01 +1234 937 -1.25000000000000e-01 +1234 753 8.33333333333333e-02 +1234 1170 -1.66666666666667e-01 +1235 1235 1.25000000000000e+00 +1235 1226 -3.75000000000000e-01 +1235 1225 8.33333333333333e-02 +1235 1224 8.33333333333333e-02 +1235 1221 -8.33333333333333e-02 +1235 1108 -8.33333333333333e-02 +1235 1111 -1.66666666666667e-01 +1235 1110 8.33333333333333e-02 +1235 1107 -8.33333333333333e-02 +1235 1170 8.33333333333333e-02 +1235 1173 -8.33333333333333e-02 +1235 1234 -1.66666666666667e-01 +1235 1174 1.66666666666667e-01 +1235 937 8.33333333333333e-02 +1235 758 -1.25000000000000e-01 +1235 1175 -2.50000000000000e-01 +1235 757 -4.16666666666667e-02 +1235 940 4.16666666666667e-02 +1235 756 8.33333333333333e-02 +1235 939 -8.33333333333333e-02 +1235 1222 4.16666666666667e-02 +1235 755 -1.25000000000000e-01 +1235 938 -3.75000000000000e-01 +1235 754 -4.16666666666667e-02 +1235 1171 8.33333333333333e-02 +1235 1233 -1.66666666666667e-01 +1235 753 8.33333333333333e-02 +1235 936 8.33333333333333e-02 +1236 1236 1.25000000000000e+00 +1236 1156 -8.33333333333333e-02 +1236 1166 8.33333333333333e-02 +1236 1157 -8.33333333333333e-02 +1236 1229 -8.33333333333333e-02 +1236 1232 8.33333333333333e-02 +1236 1231 8.33333333333333e-02 +1236 1165 -1.66666666666667e-01 +1236 1230 -3.75000000000000e-01 +1236 1172 8.33333333333333e-02 +1236 1184 -8.33333333333333e-02 +1236 937 8.33333333333333e-02 +1236 1237 -1.66666666666667e-01 +1236 1183 1.66666666666667e-01 +1236 782 8.33333333333333e-02 +1236 950 -8.33333333333333e-02 +1236 781 -4.16666666666667e-02 +1236 949 4.16666666666667e-02 +1236 780 -1.25000000000000e-01 +1236 1182 -2.50000000000000e-01 +1236 1238 -1.66666666666667e-01 +1236 755 8.33333333333333e-02 +1236 938 8.33333333333333e-02 +1236 754 -4.16666666666667e-02 +1236 1171 8.33333333333333e-02 +1236 1228 4.16666666666667e-02 +1236 753 -1.25000000000000e-01 +1236 936 -3.75000000000000e-01 +1237 1237 1.25000000000000e+00 +1237 1155 -8.33333333333333e-02 +1237 1229 4.16666666666667e-02 +1237 1157 -8.33333333333333e-02 +1237 1232 -4.16666666666667e-02 +1237 1166 8.33333333333333e-02 +1237 1231 -1.25000000000000e-01 +1237 1230 8.33333333333333e-02 +1237 1164 -1.66666666666667e-01 +1237 938 -4.16666666666667e-02 +1237 950 4.16666666666667e-02 +1237 936 8.33333333333333e-02 +1237 1236 -1.66666666666667e-01 +1237 1182 1.66666666666667e-01 +1237 782 8.33333333333333e-02 +1237 1238 -1.66666666666667e-01 +1237 1184 1.66666666666667e-01 +1237 781 -1.25000000000000e-01 +1237 1183 -7.50000000000000e-01 +1237 780 -4.16666666666667e-02 +1237 948 4.16666666666667e-02 +1237 755 8.33333333333333e-02 +1237 1172 -1.66666666666667e-01 +1237 1227 4.16666666666667e-02 +1237 754 -1.25000000000000e-01 +1237 937 -1.25000000000000e-01 +1237 753 -4.16666666666667e-02 +1237 1170 8.33333333333333e-02 +1238 1238 1.25000000000000e+00 +1238 1155 -8.33333333333333e-02 +1238 1228 4.16666666666667e-02 +1238 1156 -8.33333333333333e-02 +1238 1227 -8.33333333333333e-02 +1238 1232 -1.25000000000000e-01 +1238 1231 -4.16666666666667e-02 +1238 1165 8.33333333333333e-02 +1238 1230 8.33333333333333e-02 +1238 937 -4.16666666666667e-02 +1238 949 4.16666666666667e-02 +1238 1170 8.33333333333333e-02 +1238 1182 -8.33333333333333e-02 +1238 782 -3.75000000000000e-01 +1238 1184 -2.50000000000000e-01 +1238 781 8.33333333333333e-02 +1238 1237 -1.66666666666667e-01 +1238 1183 1.66666666666667e-01 +1238 780 8.33333333333333e-02 +1238 948 -8.33333333333333e-02 +1238 1164 8.33333333333333e-02 +1238 755 -3.75000000000000e-01 +1238 938 -1.25000000000000e-01 +1238 754 8.33333333333333e-02 +1238 1171 -1.66666666666667e-01 +1238 1236 -1.66666666666667e-01 +1238 753 8.33333333333333e-02 +1238 936 8.33333333333333e-02 +1239 1239 1.25000000000000e+00 +1239 1024 -8.33333333333333e-02 +1239 1244 8.33333333333333e-02 +1239 1241 -1.66666666666667e-01 +1239 1025 1.66666666666667e-01 +1239 1022 8.33333333333333e-02 +1239 761 -4.16666666666667e-02 +1239 1243 8.33333333333333e-02 +1239 1242 -3.75000000000000e-01 +1239 1253 4.16666666666667e-02 +1239 764 -4.16666666666667e-02 +1239 1252 -8.33333333333333e-02 +1239 1023 -2.50000000000000e-01 +1239 1007 -8.33333333333333e-02 +1239 869 4.16666666666667e-02 +1239 1006 -8.33333333333333e-02 +1239 1009 8.33333333333333e-02 +1239 868 -8.33333333333333e-02 +1239 760 8.33333333333333e-02 +1239 759 -1.25000000000000e-01 +1239 872 8.33333333333333e-02 +1239 1010 -1.66666666666667e-01 +1239 871 8.33333333333333e-02 +1239 1240 -1.66666666666667e-01 +1239 763 8.33333333333333e-02 +1239 870 -3.75000000000000e-01 +1239 1021 8.33333333333333e-02 +1239 762 -1.25000000000000e-01 +1240 1240 1.25000000000000e+00 +1240 1023 -8.33333333333333e-02 +1240 1244 -4.16666666666667e-02 +1240 1253 4.16666666666667e-02 +1240 1022 -1.66666666666667e-01 +1240 761 8.33333333333333e-02 +1240 1243 -1.25000000000000e-01 +1240 1242 8.33333333333333e-02 +1240 1025 1.66666666666667e-01 +1240 1241 -1.66666666666667e-01 +1240 764 8.33333333333333e-02 +1240 1024 -2.50000000000000e-01 +1240 1251 -8.33333333333333e-02 +1240 1005 -8.33333333333333e-02 +1240 1008 8.33333333333333e-02 +1240 869 4.16666666666667e-02 +1240 1007 -8.33333333333333e-02 +1240 760 -3.75000000000000e-01 +1240 867 -8.33333333333333e-02 +1240 759 8.33333333333333e-02 +1240 872 -4.16666666666667e-02 +1240 1010 8.33333333333333e-02 +1240 871 -1.25000000000000e-01 +1240 1020 8.33333333333333e-02 +1240 763 -3.75000000000000e-01 +1240 870 8.33333333333333e-02 +1240 1239 -1.66666666666667e-01 +1240 762 8.33333333333333e-02 +1241 1241 1.25000000000000e+00 +1241 1252 4.16666666666667e-02 +1241 1242 8.33333333333333e-02 +1241 1239 -1.66666666666667e-01 +1241 1023 1.66666666666667e-01 +1241 1244 -1.25000000000000e-01 +1241 1021 -1.66666666666667e-01 +1241 760 8.33333333333333e-02 +1241 1020 8.33333333333333e-02 +1241 759 -4.16666666666667e-02 +1241 1025 -7.50000000000000e-01 +1241 1024 1.66666666666667e-01 +1241 1240 -1.66666666666667e-01 +1241 763 8.33333333333333e-02 +1241 1251 4.16666666666667e-02 +1241 762 -4.16666666666667e-02 +1241 1005 -8.33333333333333e-02 +1241 867 4.16666666666667e-02 +1241 761 -1.25000000000000e-01 +1241 868 4.16666666666667e-02 +1241 1006 -8.33333333333333e-02 +1241 872 -1.25000000000000e-01 +1241 1243 -4.16666666666667e-02 +1241 764 -1.25000000000000e-01 +1241 871 -4.16666666666667e-02 +1241 1009 8.33333333333333e-02 +1241 870 8.33333333333333e-02 +1241 1008 -1.66666666666667e-01 +1242 1242 1.25000000000000e+00 +1242 1241 8.33333333333333e-02 +1242 1025 -1.66666666666667e-01 +1242 761 4.16666666666667e-02 +1242 1240 8.33333333333333e-02 +1242 1239 -3.75000000000000e-01 +1242 770 4.16666666666667e-02 +1242 1253 -4.16666666666667e-02 +1242 1252 8.33333333333333e-02 +1242 1251 -1.25000000000000e-01 +1242 1022 -8.33333333333333e-02 +1242 1021 -8.33333333333333e-02 +1242 875 8.33333333333333e-02 +1242 881 -4.16666666666667e-02 +1242 1243 -1.66666666666667e-01 +1242 874 8.33333333333333e-02 +1242 1027 -8.33333333333333e-02 +1242 760 -8.33333333333333e-02 +1242 880 8.33333333333333e-02 +1242 879 -1.25000000000000e-01 +1242 1244 -1.66666666666667e-01 +1242 887 8.33333333333333e-02 +1242 1028 1.66666666666667e-01 +1242 886 8.33333333333333e-02 +1242 769 -8.33333333333333e-02 +1242 1024 8.33333333333333e-02 +1242 885 -3.75000000000000e-01 +1242 1026 -2.50000000000000e-01 +1243 1243 1.25000000000000e+00 +1243 1241 -4.16666666666667e-02 +1243 1025 8.33333333333333e-02 +1243 1240 -1.25000000000000e-01 +1243 1239 8.33333333333333e-02 +1243 1244 -1.66666666666667e-01 +1243 1253 8.33333333333333e-02 +1243 1252 -3.75000000000000e-01 +1243 1251 8.33333333333333e-02 +1243 1020 -8.33333333333333e-02 +1243 881 8.33333333333333e-02 +1243 1242 -1.66666666666667e-01 +1243 875 -1.66666666666667e-01 +1243 1028 1.66666666666667e-01 +1243 873 8.33333333333333e-02 +1243 1026 -8.33333333333333e-02 +1243 761 4.16666666666667e-02 +1243 1022 -8.33333333333333e-02 +1243 880 -3.75000000000000e-01 +1243 759 -8.33333333333333e-02 +1243 879 8.33333333333333e-02 +1243 887 -4.16666666666667e-02 +1243 770 4.16666666666667e-02 +1243 1023 8.33333333333333e-02 +1243 886 -1.25000000000000e-01 +1243 1027 -2.50000000000000e-01 +1243 885 8.33333333333333e-02 +1243 768 -8.33333333333333e-02 +1244 1244 1.25000000000000e+00 +1244 1024 8.33333333333333e-02 +1244 1239 8.33333333333333e-02 +1244 1023 -1.66666666666667e-01 +1244 1241 -1.25000000000000e-01 +1244 759 4.16666666666667e-02 +1244 1253 -1.25000000000000e-01 +1244 1243 -1.66666666666667e-01 +1244 1252 8.33333333333333e-02 +1244 768 4.16666666666667e-02 +1244 1251 -4.16666666666667e-02 +1244 1020 -8.33333333333333e-02 +1244 880 8.33333333333333e-02 +1244 873 8.33333333333333e-02 +1244 879 -4.16666666666667e-02 +1244 874 -1.66666666666667e-01 +1244 1027 1.66666666666667e-01 +1244 881 -1.25000000000000e-01 +1244 760 4.16666666666667e-02 +1244 1021 -8.33333333333333e-02 +1244 1240 -4.16666666666667e-02 +1244 887 -1.25000000000000e-01 +1244 1028 -7.50000000000000e-01 +1244 886 -4.16666666666667e-02 +1244 769 4.16666666666667e-02 +1244 1242 -1.66666666666667e-01 +1244 885 8.33333333333333e-02 +1244 1026 1.66666666666667e-01 +1245 1245 1.25000000000000e+00 +1245 1036 -8.33333333333333e-02 +1245 1250 -4.16666666666667e-02 +1245 1256 4.16666666666667e-02 +1245 1249 8.33333333333333e-02 +1245 1248 -1.25000000000000e-01 +1245 1247 -1.66666666666667e-01 +1245 1037 1.66666666666667e-01 +1245 764 8.33333333333333e-02 +1245 1255 -8.33333333333333e-02 +1245 1035 -2.50000000000000e-01 +1245 1009 8.33333333333333e-02 +1245 872 -4.16666666666667e-02 +1245 1010 8.33333333333333e-02 +1245 1246 -1.66666666666667e-01 +1245 871 8.33333333333333e-02 +1245 763 8.33333333333333e-02 +1245 870 -1.25000000000000e-01 +1245 762 -3.75000000000000e-01 +1245 128 8.33333333333333e-02 +1245 602 -1.66666666666667e-01 +1245 595 -8.33333333333333e-02 +1245 275 4.16666666666667e-02 +1245 596 -8.33333333333333e-02 +1245 127 8.33333333333333e-02 +1245 274 -8.33333333333333e-02 +1245 126 -3.75000000000000e-01 +1245 601 8.33333333333333e-02 +1246 1246 1.25000000000000e+00 +1246 1035 -8.33333333333333e-02 +1246 1247 -1.66666666666667e-01 +1246 1250 8.33333333333333e-02 +1246 1037 1.66666666666667e-01 +1246 1249 -3.75000000000000e-01 +1246 1248 8.33333333333333e-02 +1246 1256 4.16666666666667e-02 +1246 764 -4.16666666666667e-02 +1246 1036 -2.50000000000000e-01 +1246 1254 -8.33333333333333e-02 +1246 1008 8.33333333333333e-02 +1246 872 8.33333333333333e-02 +1246 1010 -1.66666666666667e-01 +1246 871 -3.75000000000000e-01 +1246 763 -1.25000000000000e-01 +1246 1245 -1.66666666666667e-01 +1246 870 8.33333333333333e-02 +1246 762 8.33333333333333e-02 +1246 128 -4.16666666666667e-02 +1246 602 8.33333333333333e-02 +1246 275 4.16666666666667e-02 +1246 596 -8.33333333333333e-02 +1246 594 -8.33333333333333e-02 +1246 127 -1.25000000000000e-01 +1246 126 8.33333333333333e-02 +1246 273 -8.33333333333333e-02 +1246 600 8.33333333333333e-02 +1247 1247 1.25000000000000e+00 +1247 1249 8.33333333333333e-02 +1247 1036 1.66666666666667e-01 +1247 1248 -4.16666666666667e-02 +1247 1254 4.16666666666667e-02 +1247 1250 -1.25000000000000e-01 +1247 1037 -7.50000000000000e-01 +1247 1255 4.16666666666667e-02 +1247 763 -4.16666666666667e-02 +1247 1245 -1.66666666666667e-01 +1247 1035 1.66666666666667e-01 +1247 762 8.33333333333333e-02 +1247 1246 -1.66666666666667e-01 +1247 872 -1.25000000000000e-01 +1247 764 -1.25000000000000e-01 +1247 871 8.33333333333333e-02 +1247 1009 -1.66666666666667e-01 +1247 870 -4.16666666666667e-02 +1247 1008 8.33333333333333e-02 +1247 127 -4.16666666666667e-02 +1247 601 8.33333333333333e-02 +1247 126 8.33333333333333e-02 +1247 600 -1.66666666666667e-01 +1247 274 4.16666666666667e-02 +1247 595 -8.33333333333333e-02 +1247 128 -1.25000000000000e-01 +1247 273 4.16666666666667e-02 +1247 594 -8.33333333333333e-02 +1248 1248 1.25000000000000e+00 +1248 1247 -4.16666666666667e-02 +1248 1037 8.33333333333333e-02 +1248 1246 8.33333333333333e-02 +1248 1245 -1.25000000000000e-01 +1248 1250 -1.66666666666667e-01 +1248 1256 8.33333333333333e-02 +1248 1255 8.33333333333333e-02 +1248 1254 -3.75000000000000e-01 +1248 1249 -1.66666666666667e-01 +1248 1040 1.66666666666667e-01 +1248 1039 -8.33333333333333e-02 +1248 905 -4.16666666666667e-02 +1248 779 4.16666666666667e-02 +1248 904 8.33333333333333e-02 +1248 778 -8.33333333333333e-02 +1248 903 -1.25000000000000e-01 +1248 1036 8.33333333333333e-02 +1248 1038 -2.50000000000000e-01 +1248 601 -8.33333333333333e-02 +1248 329 8.33333333333333e-02 +1248 317 -1.66666666666667e-01 +1248 316 8.33333333333333e-02 +1248 128 4.16666666666667e-02 +1248 602 -8.33333333333333e-02 +1248 328 8.33333333333333e-02 +1248 127 -8.33333333333333e-02 +1248 327 -3.75000000000000e-01 +1249 1249 1.25000000000000e+00 +1249 1247 8.33333333333333e-02 +1249 1037 -1.66666666666667e-01 +1249 1246 -3.75000000000000e-01 +1249 1245 8.33333333333333e-02 +1249 779 4.16666666666667e-02 +1249 1256 -4.16666666666667e-02 +1249 1255 -1.25000000000000e-01 +1249 1254 8.33333333333333e-02 +1249 1248 -1.66666666666667e-01 +1249 1038 -8.33333333333333e-02 +1249 905 8.33333333333333e-02 +1249 1250 -1.66666666666667e-01 +1249 1040 1.66666666666667e-01 +1249 904 -3.75000000000000e-01 +1249 1035 8.33333333333333e-02 +1249 1039 -2.50000000000000e-01 +1249 903 8.33333333333333e-02 +1249 777 -8.33333333333333e-02 +1249 128 4.16666666666667e-02 +1249 602 -8.33333333333333e-02 +1249 600 -8.33333333333333e-02 +1249 329 -4.16666666666667e-02 +1249 317 8.33333333333333e-02 +1249 315 8.33333333333333e-02 +1249 328 -1.25000000000000e-01 +1249 327 8.33333333333333e-02 +1249 126 -8.33333333333333e-02 +1250 1250 1.25000000000000e+00 +1250 1036 -1.66666666666667e-01 +1250 1245 -4.16666666666667e-02 +1250 1035 8.33333333333333e-02 +1250 1247 -1.25000000000000e-01 +1250 1256 -1.25000000000000e-01 +1250 778 4.16666666666667e-02 +1250 1255 -4.16666666666667e-02 +1250 1248 -1.66666666666667e-01 +1250 1254 8.33333333333333e-02 +1250 1038 1.66666666666667e-01 +1250 905 -1.25000000000000e-01 +1250 1246 8.33333333333333e-02 +1250 1040 -7.50000000000000e-01 +1250 904 8.33333333333333e-02 +1250 1249 -1.66666666666667e-01 +1250 1039 1.66666666666667e-01 +1250 903 -4.16666666666667e-02 +1250 777 4.16666666666667e-02 +1250 127 4.16666666666667e-02 +1250 601 -8.33333333333333e-02 +1250 328 -4.16666666666667e-02 +1250 316 8.33333333333333e-02 +1250 327 8.33333333333333e-02 +1250 315 -1.66666666666667e-01 +1250 329 -1.25000000000000e-01 +1250 126 4.16666666666667e-02 +1250 600 -8.33333333333333e-02 +1251 1251 1.25000000000000e+00 +1251 1243 8.33333333333333e-02 +1251 1242 -1.25000000000000e-01 +1251 1241 4.16666666666667e-02 +1251 1240 -8.33333333333333e-02 +1251 1028 8.33333333333333e-02 +1251 1025 -8.33333333333333e-02 +1251 1027 8.33333333333333e-02 +1251 1024 -8.33333333333333e-02 +1251 1054 -8.33333333333333e-02 +1251 1051 8.33333333333333e-02 +1251 923 4.16666666666667e-02 +1251 920 -4.16666666666667e-02 +1251 764 8.33333333333333e-02 +1251 1052 -1.66666666666667e-01 +1251 763 8.33333333333333e-02 +1251 1252 -1.66666666666667e-01 +1251 919 8.33333333333333e-02 +1251 762 -3.75000000000000e-01 +1251 918 -1.25000000000000e-01 +1251 1253 -1.66666666666667e-01 +1251 770 8.33333333333333e-02 +1251 1055 1.66666666666667e-01 +1251 769 8.33333333333333e-02 +1251 922 -8.33333333333333e-02 +1251 1244 -4.16666666666667e-02 +1251 768 -3.75000000000000e-01 +1251 1053 -2.50000000000000e-01 +1252 1252 1.25000000000000e+00 +1252 1244 8.33333333333333e-02 +1252 1243 -3.75000000000000e-01 +1252 1242 8.33333333333333e-02 +1252 1239 -8.33333333333333e-02 +1252 1025 -8.33333333333333e-02 +1252 1028 -1.66666666666667e-01 +1252 1026 8.33333333333333e-02 +1252 1023 -8.33333333333333e-02 +1252 1053 -8.33333333333333e-02 +1252 1050 8.33333333333333e-02 +1252 1055 1.66666666666667e-01 +1252 1253 -1.66666666666667e-01 +1252 920 8.33333333333333e-02 +1252 764 -4.16666666666667e-02 +1252 1052 8.33333333333333e-02 +1252 763 -1.25000000000000e-01 +1252 919 -3.75000000000000e-01 +1252 762 8.33333333333333e-02 +1252 1251 -1.66666666666667e-01 +1252 918 8.33333333333333e-02 +1252 770 -4.16666666666667e-02 +1252 923 4.16666666666667e-02 +1252 1241 4.16666666666667e-02 +1252 769 -1.25000000000000e-01 +1252 1054 -2.50000000000000e-01 +1252 768 8.33333333333333e-02 +1252 921 -8.33333333333333e-02 +1253 1253 1.25000000000000e+00 +1253 1244 -1.25000000000000e-01 +1253 1243 8.33333333333333e-02 +1253 1242 -4.16666666666667e-02 +1253 1239 4.16666666666667e-02 +1253 1026 8.33333333333333e-02 +1253 1023 -8.33333333333333e-02 +1253 1024 -8.33333333333333e-02 +1253 1027 -1.66666666666667e-01 +1253 1054 1.66666666666667e-01 +1253 1252 -1.66666666666667e-01 +1253 919 8.33333333333333e-02 +1253 921 4.16666666666667e-02 +1253 918 -4.16666666666667e-02 +1253 764 -1.25000000000000e-01 +1253 920 -1.25000000000000e-01 +1253 763 -4.16666666666667e-02 +1253 1051 8.33333333333333e-02 +1253 762 8.33333333333333e-02 +1253 1050 -1.66666666666667e-01 +1253 1240 4.16666666666667e-02 +1253 770 -1.25000000000000e-01 +1253 1055 -7.50000000000000e-01 +1253 769 -4.16666666666667e-02 +1253 922 4.16666666666667e-02 +1253 1251 -1.66666666666667e-01 +1253 768 8.33333333333333e-02 +1253 1053 1.66666666666667e-01 +1254 1254 1.25000000000000e+00 +1254 1250 8.33333333333333e-02 +1254 1249 8.33333333333333e-02 +1254 1248 -3.75000000000000e-01 +1254 1246 -8.33333333333333e-02 +1254 1037 -8.33333333333333e-02 +1254 1040 -1.66666666666667e-01 +1254 1039 8.33333333333333e-02 +1254 1036 -8.33333333333333e-02 +1254 1051 8.33333333333333e-02 +1254 1057 -8.33333333333333e-02 +1254 1256 -1.66666666666667e-01 +1254 1058 1.66666666666667e-01 +1254 920 8.33333333333333e-02 +1254 779 -4.16666666666667e-02 +1254 926 4.16666666666667e-02 +1254 778 8.33333333333333e-02 +1254 925 -8.33333333333333e-02 +1254 777 -1.25000000000000e-01 +1254 1056 -2.50000000000000e-01 +1254 764 -4.16666666666667e-02 +1254 1052 8.33333333333333e-02 +1254 1255 -1.66666666666667e-01 +1254 763 8.33333333333333e-02 +1254 919 8.33333333333333e-02 +1254 1247 4.16666666666667e-02 +1254 762 -1.25000000000000e-01 +1254 918 -3.75000000000000e-01 +1255 1255 1.25000000000000e+00 +1255 1249 -1.25000000000000e-01 +1255 1248 8.33333333333333e-02 +1255 1247 4.16666666666667e-02 +1255 1245 -8.33333333333333e-02 +1255 1040 8.33333333333333e-02 +1255 1037 -8.33333333333333e-02 +1255 1038 8.33333333333333e-02 +1255 1035 -8.33333333333333e-02 +1255 1050 8.33333333333333e-02 +1255 1056 -8.33333333333333e-02 +1255 926 4.16666666666667e-02 +1255 920 -4.16666666666667e-02 +1255 779 8.33333333333333e-02 +1255 1256 -1.66666666666667e-01 +1255 1058 1.66666666666667e-01 +1255 778 -3.75000000000000e-01 +1255 1057 -2.50000000000000e-01 +1255 777 8.33333333333333e-02 +1255 924 -8.33333333333333e-02 +1255 764 8.33333333333333e-02 +1255 1052 -1.66666666666667e-01 +1255 1250 -4.16666666666667e-02 +1255 763 -3.75000000000000e-01 +1255 919 -1.25000000000000e-01 +1255 1254 -1.66666666666667e-01 +1255 762 8.33333333333333e-02 +1255 918 8.33333333333333e-02 +1256 1256 1.25000000000000e+00 +1256 1250 -1.25000000000000e-01 +1256 1249 -4.16666666666667e-02 +1256 1248 8.33333333333333e-02 +1256 1246 4.16666666666667e-02 +1256 1039 8.33333333333333e-02 +1256 1036 -8.33333333333333e-02 +1256 1035 -8.33333333333333e-02 +1256 1038 -1.66666666666667e-01 +1256 925 4.16666666666667e-02 +1256 919 -4.16666666666667e-02 +1256 1254 -1.66666666666667e-01 +1256 1056 1.66666666666667e-01 +1256 918 8.33333333333333e-02 +1256 779 -1.25000000000000e-01 +1256 1058 -7.50000000000000e-01 +1256 778 8.33333333333333e-02 +1256 1255 -1.66666666666667e-01 +1256 1057 1.66666666666667e-01 +1256 777 -4.16666666666667e-02 +1256 924 4.16666666666667e-02 +1256 1245 4.16666666666667e-02 +1256 764 -1.25000000000000e-01 +1256 920 -1.25000000000000e-01 +1256 763 8.33333333333333e-02 +1256 1051 -1.66666666666667e-01 +1256 762 -4.16666666666667e-02 +1256 1050 8.33333333333333e-02 +1257 1257 1.25000000000000e+00 +1257 1144 -8.33333333333333e-02 +1257 1262 8.33333333333333e-02 +1257 1259 -1.66666666666667e-01 +1257 1145 1.66666666666667e-01 +1257 1142 8.33333333333333e-02 +1257 767 -4.16666666666667e-02 +1257 1261 8.33333333333333e-02 +1257 1260 -3.75000000000000e-01 +1257 1271 4.16666666666667e-02 +1257 773 -4.16666666666667e-02 +1257 1270 -8.33333333333333e-02 +1257 1143 -2.50000000000000e-01 +1257 1124 -8.33333333333333e-02 +1257 884 4.16666666666667e-02 +1257 1123 -8.33333333333333e-02 +1257 1129 8.33333333333333e-02 +1257 883 -8.33333333333333e-02 +1257 766 8.33333333333333e-02 +1257 765 -1.25000000000000e-01 +1257 890 8.33333333333333e-02 +1257 1130 -1.66666666666667e-01 +1257 889 8.33333333333333e-02 +1257 1258 -1.66666666666667e-01 +1257 772 8.33333333333333e-02 +1257 888 -3.75000000000000e-01 +1257 1141 8.33333333333333e-02 +1257 771 -1.25000000000000e-01 +1258 1258 1.25000000000000e+00 +1258 1143 -8.33333333333333e-02 +1258 1262 -4.16666666666667e-02 +1258 1271 4.16666666666667e-02 +1258 1142 -1.66666666666667e-01 +1258 767 8.33333333333333e-02 +1258 1261 -1.25000000000000e-01 +1258 1260 8.33333333333333e-02 +1258 1145 1.66666666666667e-01 +1258 1259 -1.66666666666667e-01 +1258 773 8.33333333333333e-02 +1258 1144 -2.50000000000000e-01 +1258 1269 -8.33333333333333e-02 +1258 1122 -8.33333333333333e-02 +1258 1128 8.33333333333333e-02 +1258 884 4.16666666666667e-02 +1258 1124 -8.33333333333333e-02 +1258 766 -3.75000000000000e-01 +1258 882 -8.33333333333333e-02 +1258 765 8.33333333333333e-02 +1258 890 -4.16666666666667e-02 +1258 1130 8.33333333333333e-02 +1258 889 -1.25000000000000e-01 +1258 1140 8.33333333333333e-02 +1258 772 -3.75000000000000e-01 +1258 888 8.33333333333333e-02 +1258 1257 -1.66666666666667e-01 +1258 771 8.33333333333333e-02 +1259 1259 1.25000000000000e+00 +1259 1270 4.16666666666667e-02 +1259 1260 8.33333333333333e-02 +1259 1257 -1.66666666666667e-01 +1259 1143 1.66666666666667e-01 +1259 1262 -1.25000000000000e-01 +1259 1141 -1.66666666666667e-01 +1259 766 8.33333333333333e-02 +1259 1140 8.33333333333333e-02 +1259 765 -4.16666666666667e-02 +1259 1145 -7.50000000000000e-01 +1259 1144 1.66666666666667e-01 +1259 1258 -1.66666666666667e-01 +1259 772 8.33333333333333e-02 +1259 1269 4.16666666666667e-02 +1259 771 -4.16666666666667e-02 +1259 1122 -8.33333333333333e-02 +1259 882 4.16666666666667e-02 +1259 767 -1.25000000000000e-01 +1259 883 4.16666666666667e-02 +1259 1123 -8.33333333333333e-02 +1259 890 -1.25000000000000e-01 +1259 1261 -4.16666666666667e-02 +1259 773 -1.25000000000000e-01 +1259 889 -4.16666666666667e-02 +1259 1129 8.33333333333333e-02 +1259 888 8.33333333333333e-02 +1259 1128 -1.66666666666667e-01 +1260 1260 1.25000000000000e+00 +1260 1259 8.33333333333333e-02 +1260 1145 -1.66666666666667e-01 +1260 767 4.16666666666667e-02 +1260 1258 8.33333333333333e-02 +1260 1257 -3.75000000000000e-01 +1260 776 4.16666666666667e-02 +1260 1271 -4.16666666666667e-02 +1260 1270 8.33333333333333e-02 +1260 1269 -1.25000000000000e-01 +1260 1142 -8.33333333333333e-02 +1260 1141 -8.33333333333333e-02 +1260 893 8.33333333333333e-02 +1260 899 -4.16666666666667e-02 +1260 1261 -1.66666666666667e-01 +1260 892 8.33333333333333e-02 +1260 1147 -8.33333333333333e-02 +1260 766 -8.33333333333333e-02 +1260 898 8.33333333333333e-02 +1260 897 -1.25000000000000e-01 +1260 1262 -1.66666666666667e-01 +1260 902 8.33333333333333e-02 +1260 1148 1.66666666666667e-01 +1260 901 8.33333333333333e-02 +1260 775 -8.33333333333333e-02 +1260 1144 8.33333333333333e-02 +1260 900 -3.75000000000000e-01 +1260 1146 -2.50000000000000e-01 +1261 1261 1.25000000000000e+00 +1261 1259 -4.16666666666667e-02 +1261 1145 8.33333333333333e-02 +1261 1258 -1.25000000000000e-01 +1261 1257 8.33333333333333e-02 +1261 1262 -1.66666666666667e-01 +1261 1271 8.33333333333333e-02 +1261 1270 -3.75000000000000e-01 +1261 1269 8.33333333333333e-02 +1261 1140 -8.33333333333333e-02 +1261 899 8.33333333333333e-02 +1261 1260 -1.66666666666667e-01 +1261 893 -1.66666666666667e-01 +1261 1148 1.66666666666667e-01 +1261 891 8.33333333333333e-02 +1261 1146 -8.33333333333333e-02 +1261 767 4.16666666666667e-02 +1261 1142 -8.33333333333333e-02 +1261 898 -3.75000000000000e-01 +1261 765 -8.33333333333333e-02 +1261 897 8.33333333333333e-02 +1261 902 -4.16666666666667e-02 +1261 776 4.16666666666667e-02 +1261 1143 8.33333333333333e-02 +1261 901 -1.25000000000000e-01 +1261 1147 -2.50000000000000e-01 +1261 900 8.33333333333333e-02 +1261 774 -8.33333333333333e-02 +1262 1262 1.25000000000000e+00 +1262 1144 8.33333333333333e-02 +1262 1257 8.33333333333333e-02 +1262 1143 -1.66666666666667e-01 +1262 1259 -1.25000000000000e-01 +1262 765 4.16666666666667e-02 +1262 1271 -1.25000000000000e-01 +1262 1261 -1.66666666666667e-01 +1262 1270 8.33333333333333e-02 +1262 774 4.16666666666667e-02 +1262 1269 -4.16666666666667e-02 +1262 1140 -8.33333333333333e-02 +1262 898 8.33333333333333e-02 +1262 891 8.33333333333333e-02 +1262 897 -4.16666666666667e-02 +1262 892 -1.66666666666667e-01 +1262 1147 1.66666666666667e-01 +1262 899 -1.25000000000000e-01 +1262 766 4.16666666666667e-02 +1262 1141 -8.33333333333333e-02 +1262 1258 -4.16666666666667e-02 +1262 902 -1.25000000000000e-01 +1262 1148 -7.50000000000000e-01 +1262 901 -4.16666666666667e-02 +1262 775 4.16666666666667e-02 +1262 1260 -1.66666666666667e-01 +1262 900 8.33333333333333e-02 +1262 1146 1.66666666666667e-01 +1263 1263 1.25000000000000e+00 +1263 1162 -8.33333333333333e-02 +1263 1268 -4.16666666666667e-02 +1263 1274 4.16666666666667e-02 +1263 770 8.33333333333333e-02 +1263 1160 -1.66666666666667e-01 +1263 1267 8.33333333333333e-02 +1263 1266 -1.25000000000000e-01 +1263 1265 -1.66666666666667e-01 +1263 1163 1.66666666666667e-01 +1263 773 8.33333333333333e-02 +1263 1273 -8.33333333333333e-02 +1263 1161 -2.50000000000000e-01 +1263 1126 -8.33333333333333e-02 +1263 1129 8.33333333333333e-02 +1263 887 4.16666666666667e-02 +1263 1127 -8.33333333333333e-02 +1263 769 8.33333333333333e-02 +1263 886 -8.33333333333333e-02 +1263 768 -3.75000000000000e-01 +1263 890 -4.16666666666667e-02 +1263 1130 8.33333333333333e-02 +1263 1264 -1.66666666666667e-01 +1263 889 8.33333333333333e-02 +1263 772 8.33333333333333e-02 +1263 1159 8.33333333333333e-02 +1263 888 -1.25000000000000e-01 +1263 771 -3.75000000000000e-01 +1264 1264 1.25000000000000e+00 +1264 1161 -8.33333333333333e-02 +1264 1265 -1.66666666666667e-01 +1264 1268 8.33333333333333e-02 +1264 1163 1.66666666666667e-01 +1264 770 -4.16666666666667e-02 +1264 1160 8.33333333333333e-02 +1264 1267 -3.75000000000000e-01 +1264 1266 8.33333333333333e-02 +1264 1274 4.16666666666667e-02 +1264 773 -4.16666666666667e-02 +1264 1162 -2.50000000000000e-01 +1264 1272 -8.33333333333333e-02 +1264 887 4.16666666666667e-02 +1264 1127 -8.33333333333333e-02 +1264 1125 -8.33333333333333e-02 +1264 1128 8.33333333333333e-02 +1264 769 -1.25000000000000e-01 +1264 768 8.33333333333333e-02 +1264 885 -8.33333333333333e-02 +1264 890 8.33333333333333e-02 +1264 1130 -1.66666666666667e-01 +1264 1158 8.33333333333333e-02 +1264 889 -3.75000000000000e-01 +1264 772 -1.25000000000000e-01 +1264 1263 -1.66666666666667e-01 +1264 888 8.33333333333333e-02 +1264 771 8.33333333333333e-02 +1265 1265 1.25000000000000e+00 +1265 1267 8.33333333333333e-02 +1265 1162 1.66666666666667e-01 +1265 1266 -4.16666666666667e-02 +1265 1272 4.16666666666667e-02 +1265 1268 -1.25000000000000e-01 +1265 769 -4.16666666666667e-02 +1265 1159 8.33333333333333e-02 +1265 768 8.33333333333333e-02 +1265 1158 -1.66666666666667e-01 +1265 1163 -7.50000000000000e-01 +1265 1273 4.16666666666667e-02 +1265 772 -4.16666666666667e-02 +1265 1263 -1.66666666666667e-01 +1265 1161 1.66666666666667e-01 +1265 771 8.33333333333333e-02 +1265 886 4.16666666666667e-02 +1265 1126 -8.33333333333333e-02 +1265 770 -1.25000000000000e-01 +1265 885 4.16666666666667e-02 +1265 1125 -8.33333333333333e-02 +1265 1264 -1.66666666666667e-01 +1265 890 -1.25000000000000e-01 +1265 773 -1.25000000000000e-01 +1265 889 8.33333333333333e-02 +1265 1129 -1.66666666666667e-01 +1265 888 -4.16666666666667e-02 +1265 1128 8.33333333333333e-02 +1266 1266 1.25000000000000e+00 +1266 1265 -4.16666666666667e-02 +1266 1163 8.33333333333333e-02 +1266 1264 8.33333333333333e-02 +1266 1263 -1.25000000000000e-01 +1266 1268 -1.66666666666667e-01 +1266 1274 8.33333333333333e-02 +1266 1273 8.33333333333333e-02 +1266 1272 -3.75000000000000e-01 +1266 1159 -8.33333333333333e-02 +1266 923 8.33333333333333e-02 +1266 1267 -1.66666666666667e-01 +1266 911 -1.66666666666667e-01 +1266 1166 1.66666666666667e-01 +1266 910 8.33333333333333e-02 +1266 1165 -8.33333333333333e-02 +1266 770 4.16666666666667e-02 +1266 1160 -8.33333333333333e-02 +1266 922 8.33333333333333e-02 +1266 769 -8.33333333333333e-02 +1266 921 -3.75000000000000e-01 +1266 929 -4.16666666666667e-02 +1266 782 4.16666666666667e-02 +1266 928 8.33333333333333e-02 +1266 781 -8.33333333333333e-02 +1266 927 -1.25000000000000e-01 +1266 1162 8.33333333333333e-02 +1266 1164 -2.50000000000000e-01 +1267 1267 1.25000000000000e+00 +1267 1265 8.33333333333333e-02 +1267 1163 -1.66666666666667e-01 +1267 770 4.16666666666667e-02 +1267 1264 -3.75000000000000e-01 +1267 1263 8.33333333333333e-02 +1267 782 4.16666666666667e-02 +1267 1274 -4.16666666666667e-02 +1267 1273 -1.25000000000000e-01 +1267 1272 8.33333333333333e-02 +1267 1160 -8.33333333333333e-02 +1267 1158 -8.33333333333333e-02 +1267 923 -4.16666666666667e-02 +1267 911 8.33333333333333e-02 +1267 1266 -1.66666666666667e-01 +1267 909 8.33333333333333e-02 +1267 1164 -8.33333333333333e-02 +1267 922 -1.25000000000000e-01 +1267 921 8.33333333333333e-02 +1267 768 -8.33333333333333e-02 +1267 929 8.33333333333333e-02 +1267 1268 -1.66666666666667e-01 +1267 1166 1.66666666666667e-01 +1267 928 -3.75000000000000e-01 +1267 1161 8.33333333333333e-02 +1267 1165 -2.50000000000000e-01 +1267 927 8.33333333333333e-02 +1267 780 -8.33333333333333e-02 +1268 1268 1.25000000000000e+00 +1268 1162 -1.66666666666667e-01 +1268 1263 -4.16666666666667e-02 +1268 1161 8.33333333333333e-02 +1268 1265 -1.25000000000000e-01 +1268 769 4.16666666666667e-02 +1268 1274 -1.25000000000000e-01 +1268 781 4.16666666666667e-02 +1268 1273 -4.16666666666667e-02 +1268 1266 -1.66666666666667e-01 +1268 1272 8.33333333333333e-02 +1268 1159 -8.33333333333333e-02 +1268 922 -4.16666666666667e-02 +1268 910 8.33333333333333e-02 +1268 921 8.33333333333333e-02 +1268 909 -1.66666666666667e-01 +1268 1164 1.66666666666667e-01 +1268 923 -1.25000000000000e-01 +1268 768 4.16666666666667e-02 +1268 1158 -8.33333333333333e-02 +1268 929 -1.25000000000000e-01 +1268 1264 8.33333333333333e-02 +1268 1166 -7.50000000000000e-01 +1268 928 8.33333333333333e-02 +1268 1267 -1.66666666666667e-01 +1268 1165 1.66666666666667e-01 +1268 927 -4.16666666666667e-02 +1268 780 4.16666666666667e-02 +1269 1269 1.25000000000000e+00 +1269 1261 8.33333333333333e-02 +1269 1260 -1.25000000000000e-01 +1269 1259 4.16666666666667e-02 +1269 1258 -8.33333333333333e-02 +1269 1148 8.33333333333333e-02 +1269 1145 -8.33333333333333e-02 +1269 1147 8.33333333333333e-02 +1269 1144 -8.33333333333333e-02 +1269 1180 -8.33333333333333e-02 +1269 1177 8.33333333333333e-02 +1269 947 4.16666666666667e-02 +1269 944 -4.16666666666667e-02 +1269 773 8.33333333333333e-02 +1269 1178 -1.66666666666667e-01 +1269 772 8.33333333333333e-02 +1269 1270 -1.66666666666667e-01 +1269 943 8.33333333333333e-02 +1269 771 -3.75000000000000e-01 +1269 942 -1.25000000000000e-01 +1269 1271 -1.66666666666667e-01 +1269 776 8.33333333333333e-02 +1269 1181 1.66666666666667e-01 +1269 775 8.33333333333333e-02 +1269 946 -8.33333333333333e-02 +1269 1262 -4.16666666666667e-02 +1269 774 -3.75000000000000e-01 +1269 1179 -2.50000000000000e-01 +1270 1270 1.25000000000000e+00 +1270 1262 8.33333333333333e-02 +1270 1261 -3.75000000000000e-01 +1270 1260 8.33333333333333e-02 +1270 1257 -8.33333333333333e-02 +1270 1145 -8.33333333333333e-02 +1270 1148 -1.66666666666667e-01 +1270 1146 8.33333333333333e-02 +1270 1143 -8.33333333333333e-02 +1270 1179 -8.33333333333333e-02 +1270 1176 8.33333333333333e-02 +1270 1181 1.66666666666667e-01 +1270 1271 -1.66666666666667e-01 +1270 944 8.33333333333333e-02 +1270 773 -4.16666666666667e-02 +1270 1178 8.33333333333333e-02 +1270 772 -1.25000000000000e-01 +1270 943 -3.75000000000000e-01 +1270 771 8.33333333333333e-02 +1270 1269 -1.66666666666667e-01 +1270 942 8.33333333333333e-02 +1270 776 -4.16666666666667e-02 +1270 947 4.16666666666667e-02 +1270 1259 4.16666666666667e-02 +1270 775 -1.25000000000000e-01 +1270 1180 -2.50000000000000e-01 +1270 774 8.33333333333333e-02 +1270 945 -8.33333333333333e-02 +1271 1271 1.25000000000000e+00 +1271 1262 -1.25000000000000e-01 +1271 1261 8.33333333333333e-02 +1271 1260 -4.16666666666667e-02 +1271 1257 4.16666666666667e-02 +1271 1146 8.33333333333333e-02 +1271 1143 -8.33333333333333e-02 +1271 1144 -8.33333333333333e-02 +1271 1147 -1.66666666666667e-01 +1271 1180 1.66666666666667e-01 +1271 1270 -1.66666666666667e-01 +1271 943 8.33333333333333e-02 +1271 945 4.16666666666667e-02 +1271 942 -4.16666666666667e-02 +1271 773 -1.25000000000000e-01 +1271 944 -1.25000000000000e-01 +1271 772 -4.16666666666667e-02 +1271 1177 8.33333333333333e-02 +1271 771 8.33333333333333e-02 +1271 1176 -1.66666666666667e-01 +1271 1258 4.16666666666667e-02 +1271 776 -1.25000000000000e-01 +1271 1181 -7.50000000000000e-01 +1271 775 -4.16666666666667e-02 +1271 946 4.16666666666667e-02 +1271 1269 -1.66666666666667e-01 +1271 774 8.33333333333333e-02 +1271 1179 1.66666666666667e-01 +1272 1272 1.25000000000000e+00 +1272 1268 8.33333333333333e-02 +1272 1267 8.33333333333333e-02 +1272 1266 -3.75000000000000e-01 +1272 1264 -8.33333333333333e-02 +1272 1163 -8.33333333333333e-02 +1272 1166 -1.66666666666667e-01 +1272 1165 8.33333333333333e-02 +1272 1162 -8.33333333333333e-02 +1272 1177 8.33333333333333e-02 +1272 1183 -8.33333333333333e-02 +1272 1274 -1.66666666666667e-01 +1272 1184 1.66666666666667e-01 +1272 944 8.33333333333333e-02 +1272 782 -4.16666666666667e-02 +1272 950 4.16666666666667e-02 +1272 781 8.33333333333333e-02 +1272 949 -8.33333333333333e-02 +1272 780 -1.25000000000000e-01 +1272 1182 -2.50000000000000e-01 +1272 773 -4.16666666666667e-02 +1272 1178 8.33333333333333e-02 +1272 1273 -1.66666666666667e-01 +1272 772 8.33333333333333e-02 +1272 943 8.33333333333333e-02 +1272 1265 4.16666666666667e-02 +1272 771 -1.25000000000000e-01 +1272 942 -3.75000000000000e-01 +1273 1273 1.25000000000000e+00 +1273 1267 -1.25000000000000e-01 +1273 1266 8.33333333333333e-02 +1273 1265 4.16666666666667e-02 +1273 1263 -8.33333333333333e-02 +1273 1166 8.33333333333333e-02 +1273 1163 -8.33333333333333e-02 +1273 1164 8.33333333333333e-02 +1273 1161 -8.33333333333333e-02 +1273 1176 8.33333333333333e-02 +1273 1182 -8.33333333333333e-02 +1273 950 4.16666666666667e-02 +1273 944 -4.16666666666667e-02 +1273 782 8.33333333333333e-02 +1273 1274 -1.66666666666667e-01 +1273 1184 1.66666666666667e-01 +1273 781 -3.75000000000000e-01 +1273 1183 -2.50000000000000e-01 +1273 780 8.33333333333333e-02 +1273 948 -8.33333333333333e-02 +1273 773 8.33333333333333e-02 +1273 1178 -1.66666666666667e-01 +1273 1268 -4.16666666666667e-02 +1273 772 -3.75000000000000e-01 +1273 943 -1.25000000000000e-01 +1273 1272 -1.66666666666667e-01 +1273 771 8.33333333333333e-02 +1273 942 8.33333333333333e-02 +1274 1274 1.25000000000000e+00 +1274 1268 -1.25000000000000e-01 +1274 1267 -4.16666666666667e-02 +1274 1266 8.33333333333333e-02 +1274 1264 4.16666666666667e-02 +1274 1165 8.33333333333333e-02 +1274 1162 -8.33333333333333e-02 +1274 1161 -8.33333333333333e-02 +1274 1164 -1.66666666666667e-01 +1274 949 4.16666666666667e-02 +1274 943 -4.16666666666667e-02 +1274 1272 -1.66666666666667e-01 +1274 1182 1.66666666666667e-01 +1274 942 8.33333333333333e-02 +1274 782 -1.25000000000000e-01 +1274 1184 -7.50000000000000e-01 +1274 781 8.33333333333333e-02 +1274 1273 -1.66666666666667e-01 +1274 1183 1.66666666666667e-01 +1274 780 -4.16666666666667e-02 +1274 948 4.16666666666667e-02 +1274 1263 4.16666666666667e-02 +1274 773 -1.25000000000000e-01 +1274 944 -1.25000000000000e-01 +1274 772 8.33333333333333e-02 +1274 1177 -1.66666666666667e-01 +1274 771 -4.16666666666667e-02 +1274 1176 8.33333333333333e-02 diff --git a/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/A.IJ.00002 b/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/A.IJ.00002 new file mode 100644 index 00000000..286eb339 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/A.IJ.00002 @@ -0,0 +1,17977 @@ +1275 1874 1275 1874 +1275 1275 3.75000000000000e+01 +1275 1400 4.16666666666667e+00 +1275 1276 -4.16666666666667e+00 +1275 1387 4.16666666666667e+00 +1275 1386 -6.25000000000000e+00 +1275 1277 -4.16666666666667e+00 +1275 1394 4.16666666666667e+00 +1275 1393 -2.08333333333333e+00 +1275 1399 4.16666666666667e+00 +1275 1388 -2.08333333333333e+00 +1275 1392 -6.25000000000000e+00 +1275 1391 2.08333333333333e+00 +1275 1403 -4.16666666666667e+00 +1275 1384 2.08333333333333e+00 +1275 1390 -4.16666666666667e+00 +1275 1385 2.08333333333333e+00 +1275 1396 2.08333333333333e+00 +1275 1402 -4.16666666666667e+00 +1275 1383 -1.25000000000000e+01 +1275 1397 -4.16666666666667e+00 +1275 2029 2.08333333333333e+00 +1275 2030 2.08333333333333e+00 +1275 2028 -1.25000000000000e+01 +1276 1276 3.33333333333333e+01 +1276 1387 -1.87500000000000e+01 +1276 1275 -4.16666666666667e+00 +1276 1386 4.16666666666667e+00 +1276 1394 4.16666666666667e+00 +1276 1400 -8.33333333333333e+00 +1276 1388 4.16666666666667e+00 +1276 1393 -6.25000000000000e+00 +1276 1392 -2.08333333333333e+00 +1276 1398 4.16666666666667e+00 +1276 1383 2.08333333333333e+00 +1276 1389 -4.16666666666667e+00 +1276 1384 -4.16666666666667e+00 +1276 1395 2.08333333333333e+00 +1276 1401 -4.16666666666667e+00 +1276 1397 2.08333333333333e+00 +1276 1403 -4.16666666666667e+00 +1276 1391 2.08333333333333e+00 +1276 2028 2.08333333333333e+00 +1276 2029 -4.16666666666667e+00 +1277 1277 3.33333333333333e+01 +1277 1387 4.16666666666667e+00 +1277 1386 -2.08333333333333e+00 +1277 1398 4.16666666666667e+00 +1277 1388 -6.25000000000000e+00 +1277 1394 -1.87500000000000e+01 +1277 1393 4.16666666666667e+00 +1277 1399 -8.33333333333333e+00 +1277 1275 -4.16666666666667e+00 +1277 1392 4.16666666666667e+00 +1277 1389 2.08333333333333e+00 +1277 1401 -4.16666666666667e+00 +1277 1385 -4.16666666666667e+00 +1277 1383 2.08333333333333e+00 +1277 1390 2.08333333333333e+00 +1277 1396 2.08333333333333e+00 +1277 1402 -4.16666666666667e+00 +1277 1395 -4.16666666666667e+00 +1277 2030 -4.16666666666667e+00 +1277 2028 2.08333333333333e+00 +1278 1278 3.75000000000000e+01 +1278 1427 -4.16666666666667e+00 +1278 1408 2.08333333333333e+00 +1278 1414 -4.16666666666667e+00 +1278 1409 2.08333333333333e+00 +1278 1420 2.08333333333333e+00 +1278 1426 -4.16666666666667e+00 +1278 1407 -1.25000000000000e+01 +1278 1421 -4.16666666666667e+00 +1278 1412 -2.08333333333333e+00 +1278 1424 4.16666666666667e+00 +1278 1279 -4.16666666666667e+00 +1278 1411 4.16666666666667e+00 +1278 1405 2.08333333333333e+00 +1278 1410 -6.25000000000000e+00 +1278 1280 -4.16666666666667e+00 +1278 1418 4.16666666666667e+00 +1278 1406 2.08333333333333e+00 +1278 1417 -2.08333333333333e+00 +1278 1423 4.16666666666667e+00 +1278 1415 2.08333333333333e+00 +1278 1416 -6.25000000000000e+00 +1278 1404 -1.25000000000000e+01 +1279 1279 3.33333333333333e+01 +1279 1407 2.08333333333333e+00 +1279 1413 -4.16666666666667e+00 +1279 1408 -4.16666666666667e+00 +1279 1419 2.08333333333333e+00 +1279 1425 -4.16666666666667e+00 +1279 1421 2.08333333333333e+00 +1279 1427 -4.16666666666667e+00 +1279 1412 4.16666666666667e+00 +1279 1411 -1.87500000000000e+01 +1279 1278 -4.16666666666667e+00 +1279 1410 4.16666666666667e+00 +1279 1404 2.08333333333333e+00 +1279 1418 4.16666666666667e+00 +1279 1424 -8.33333333333333e+00 +1279 1415 2.08333333333333e+00 +1279 1417 -6.25000000000000e+00 +1279 1405 -4.16666666666667e+00 +1279 1416 -2.08333333333333e+00 +1279 1422 4.16666666666667e+00 +1280 1280 3.33333333333333e+01 +1280 1413 2.08333333333333e+00 +1280 1425 -4.16666666666667e+00 +1280 1409 -4.16666666666667e+00 +1280 1407 2.08333333333333e+00 +1280 1420 2.08333333333333e+00 +1280 1426 -4.16666666666667e+00 +1280 1419 -4.16666666666667e+00 +1280 1412 -6.25000000000000e+00 +1280 1411 4.16666666666667e+00 +1280 1410 -2.08333333333333e+00 +1280 1422 4.16666666666667e+00 +1280 1414 2.08333333333333e+00 +1280 1418 -1.87500000000000e+01 +1280 1406 -4.16666666666667e+00 +1280 1417 4.16666666666667e+00 +1280 1423 -8.33333333333333e+00 +1280 1278 -4.16666666666667e+00 +1280 1416 4.16666666666667e+00 +1280 1404 2.08333333333333e+00 +1281 1281 2.50000000000000e+01 +1281 1439 4.16666666666667e+00 +1281 1433 -2.08333333333333e+00 +1281 1432 4.16666666666667e+00 +1281 1431 -6.25000000000000e+00 +1281 1283 -4.16666666666667e+00 +1281 1437 -6.25000000000000e+00 +1281 1435 2.08333333333333e+00 +1281 1282 -4.16666666666667e+00 +1281 1434 -6.25000000000000e+00 +1281 1442 -4.16666666666667e+00 +1281 1438 -2.08333333333333e+00 +1281 1441 2.08333333333333e+00 +1281 1436 2.08333333333333e+00 +1281 2066 2.08333333333333e+00 +1281 2065 2.08333333333333e+00 +1281 2064 -6.25000000000000e+00 +1281 2063 2.08333333333333e+00 +1281 2062 -4.16666666666667e+00 +1282 1282 2.91666666666667e+01 +1282 1433 4.16666666666667e+00 +1282 1283 -8.33333333333333e+00 +1282 1439 4.16666666666667e+00 +1282 1432 -1.87500000000000e+01 +1282 1438 -6.25000000000000e+00 +1282 1431 4.16666666666667e+00 +1282 1442 2.08333333333333e+00 +1282 1435 -2.08333333333333e+00 +1282 1434 2.08333333333333e+00 +1282 1281 -4.16666666666667e+00 +1282 1436 -2.08333333333333e+00 +1282 1437 -2.08333333333333e+00 +1282 1440 2.08333333333333e+00 +1282 2063 2.08333333333333e+00 +1282 2065 -2.08333333333333e+00 +1282 2064 2.08333333333333e+00 +1282 2066 -2.08333333333333e+00 +1282 2061 -4.16666666666667e+00 +1283 1283 2.91666666666667e+01 +1283 1281 -4.16666666666667e+00 +1283 1437 4.16666666666667e+00 +1283 1433 -6.25000000000000e+00 +1283 1439 -1.87500000000000e+01 +1283 1432 4.16666666666667e+00 +1283 1282 -8.33333333333333e+00 +1283 1438 4.16666666666667e+00 +1283 1431 -2.08333333333333e+00 +1283 1435 -2.08333333333333e+00 +1283 1441 2.08333333333333e+00 +1283 1434 2.08333333333333e+00 +1283 1436 -2.08333333333333e+00 +1283 1440 -4.16666666666667e+00 +1283 2065 -2.08333333333333e+00 +1283 2062 2.08333333333333e+00 +1283 2064 2.08333333333333e+00 +1283 2066 -2.08333333333333e+00 +1283 2061 2.08333333333333e+00 +1284 1284 2.50000000000000e+01 +1284 1453 2.08333333333333e+00 +1284 1285 -4.16666666666667e+00 +1284 1452 -6.25000000000000e+00 +1284 1460 -4.16666666666667e+00 +1284 1456 -2.08333333333333e+00 +1284 1459 2.08333333333333e+00 +1284 1286 -4.16666666666667e+00 +1284 1451 2.08333333333333e+00 +1284 1457 4.16666666666667e+00 +1284 1450 2.08333333333333e+00 +1284 1449 -6.25000000000000e+00 +1284 1448 -2.08333333333333e+00 +1284 1445 2.08333333333333e+00 +1284 1447 4.16666666666667e+00 +1284 1444 -4.16666666666667e+00 +1284 1446 -6.25000000000000e+00 +1284 1454 2.08333333333333e+00 +1284 1455 -6.25000000000000e+00 +1285 1285 2.91666666666667e+01 +1285 1460 2.08333333333333e+00 +1285 1453 -2.08333333333333e+00 +1285 1452 2.08333333333333e+00 +1285 1284 -4.16666666666667e+00 +1285 1455 -2.08333333333333e+00 +1285 1458 2.08333333333333e+00 +1285 1451 -2.08333333333333e+00 +1285 1445 2.08333333333333e+00 +1285 1450 -2.08333333333333e+00 +1285 1449 2.08333333333333e+00 +1285 1448 4.16666666666667e+00 +1285 1286 -8.33333333333333e+00 +1285 1457 4.16666666666667e+00 +1285 1447 -1.87500000000000e+01 +1285 1454 -2.08333333333333e+00 +1285 1456 -6.25000000000000e+00 +1285 1446 4.16666666666667e+00 +1285 1443 -4.16666666666667e+00 +1286 1286 2.91666666666667e+01 +1286 1453 -2.08333333333333e+00 +1286 1459 2.08333333333333e+00 +1286 1452 2.08333333333333e+00 +1286 1458 -4.16666666666667e+00 +1286 1451 -2.08333333333333e+00 +1286 1450 -2.08333333333333e+00 +1286 1444 2.08333333333333e+00 +1286 1284 -4.16666666666667e+00 +1286 1449 2.08333333333333e+00 +1286 1455 4.16666666666667e+00 +1286 1448 -6.25000000000000e+00 +1286 1454 -2.08333333333333e+00 +1286 1457 -1.87500000000000e+01 +1286 1447 4.16666666666667e+00 +1286 1285 -8.33333333333333e+00 +1286 1456 4.16666666666667e+00 +1286 1446 -2.08333333333333e+00 +1286 1443 2.08333333333333e+00 +1287 1287 2.50000000000000e+01 +1287 1468 -2.08333333333333e+00 +1287 1467 -6.25000000000000e+00 +1287 1288 -4.16666666666667e+00 +1287 1474 4.16666666666667e+00 +1287 1469 4.16666666666667e+00 +1287 1473 -6.25000000000000e+00 +1287 1478 2.08333333333333e+00 +1287 1289 -4.16666666666667e+00 +1287 1472 2.08333333333333e+00 +1287 1471 2.08333333333333e+00 +1287 1477 -4.16666666666667e+00 +1287 1475 -2.08333333333333e+00 +1287 1470 -6.25000000000000e+00 +1287 2098 2.08333333333333e+00 +1287 2102 2.08333333333333e+00 +1287 2099 -4.16666666666667e+00 +1287 2101 2.08333333333333e+00 +1287 2100 -6.25000000000000e+00 +1288 1288 2.91666666666667e+01 +1288 1289 -8.33333333333333e+00 +1288 1475 4.16666666666667e+00 +1288 1468 -6.25000000000000e+00 +1288 1467 -2.08333333333333e+00 +1288 1469 4.16666666666667e+00 +1288 1474 -1.87500000000000e+01 +1288 1287 -4.16666666666667e+00 +1288 1473 4.16666666666667e+00 +1288 1472 -2.08333333333333e+00 +1288 1478 2.08333333333333e+00 +1288 1471 -2.08333333333333e+00 +1288 1470 2.08333333333333e+00 +1288 1476 -4.16666666666667e+00 +1288 2097 2.08333333333333e+00 +1288 2102 -2.08333333333333e+00 +1288 2099 2.08333333333333e+00 +1288 2101 -2.08333333333333e+00 +1288 2100 2.08333333333333e+00 +1289 1289 2.91666666666667e+01 +1289 1468 4.16666666666667e+00 +1289 1288 -8.33333333333333e+00 +1289 1474 4.16666666666667e+00 +1289 1467 4.16666666666667e+00 +1289 1469 -1.87500000000000e+01 +1289 1475 -6.25000000000000e+00 +1289 1473 -2.08333333333333e+00 +1289 1476 2.08333333333333e+00 +1289 1472 -2.08333333333333e+00 +1289 1471 -2.08333333333333e+00 +1289 1477 2.08333333333333e+00 +1289 1287 -4.16666666666667e+00 +1289 1470 2.08333333333333e+00 +1289 2102 -2.08333333333333e+00 +1289 2101 -2.08333333333333e+00 +1289 2098 2.08333333333333e+00 +1289 2100 2.08333333333333e+00 +1289 2097 -4.16666666666667e+00 +1290 1290 2.50000000000000e+01 +1290 1496 2.08333333333333e+00 +1290 1292 -4.16666666666667e+00 +1290 1490 2.08333333333333e+00 +1290 1489 2.08333333333333e+00 +1290 1495 -4.16666666666667e+00 +1290 1488 -6.25000000000000e+00 +1290 1484 4.16666666666667e+00 +1290 1483 -2.08333333333333e+00 +1290 1480 2.08333333333333e+00 +1290 1482 -6.25000000000000e+00 +1290 1487 2.08333333333333e+00 +1290 1481 -4.16666666666667e+00 +1290 1486 2.08333333333333e+00 +1290 1291 -4.16666666666667e+00 +1290 1492 4.16666666666667e+00 +1290 1485 -6.25000000000000e+00 +1290 1493 -2.08333333333333e+00 +1290 1491 -6.25000000000000e+00 +1291 1291 2.91666666666667e+01 +1291 1496 2.08333333333333e+00 +1291 1489 -2.08333333333333e+00 +1291 1488 2.08333333333333e+00 +1291 1494 -4.16666666666667e+00 +1291 1484 4.16666666666667e+00 +1291 1292 -8.33333333333333e+00 +1291 1493 4.16666666666667e+00 +1291 1483 -6.25000000000000e+00 +1291 1482 -2.08333333333333e+00 +1291 1479 2.08333333333333e+00 +1291 1487 -2.08333333333333e+00 +1291 1481 2.08333333333333e+00 +1291 1486 -2.08333333333333e+00 +1291 1490 -2.08333333333333e+00 +1291 1492 -1.87500000000000e+01 +1291 1485 2.08333333333333e+00 +1291 1290 -4.16666666666667e+00 +1291 1491 4.16666666666667e+00 +1292 1292 2.91666666666667e+01 +1292 1494 2.08333333333333e+00 +1292 1490 -2.08333333333333e+00 +1292 1489 -2.08333333333333e+00 +1292 1495 2.08333333333333e+00 +1292 1290 -4.16666666666667e+00 +1292 1488 2.08333333333333e+00 +1292 1484 -1.87500000000000e+01 +1292 1483 4.16666666666667e+00 +1292 1291 -8.33333333333333e+00 +1292 1492 4.16666666666667e+00 +1292 1482 4.16666666666667e+00 +1292 1487 -2.08333333333333e+00 +1292 1491 -2.08333333333333e+00 +1292 1493 -6.25000000000000e+00 +1292 1486 -2.08333333333333e+00 +1292 1480 2.08333333333333e+00 +1292 1485 2.08333333333333e+00 +1292 1479 -4.16666666666667e+00 +1293 1293 3.75000000000000e+01 +1293 1505 4.16666666666667e+00 +1293 1506 -6.25000000000000e+00 +1293 1504 4.16666666666667e+00 +1293 1510 4.16666666666667e+00 +1293 1509 -6.25000000000000e+00 +1293 1508 4.16666666666667e+00 +1293 1514 2.08333333333333e+00 +1293 1507 -2.08333333333333e+00 +1293 1511 -2.08333333333333e+00 +1293 1294 -4.16666666666667e+00 +1293 1513 2.08333333333333e+00 +1293 1295 -4.16666666666667e+00 +1293 1512 -1.25000000000000e+01 +1293 2150 2.08333333333333e+00 +1293 2144 -4.16666666666667e+00 +1293 2143 2.08333333333333e+00 +1293 2147 2.08333333333333e+00 +1293 2149 2.08333333333333e+00 +1293 2148 -1.25000000000000e+01 +1293 2141 -4.16666666666667e+00 +1293 2140 -4.16666666666667e+00 +1293 2146 -4.16666666666667e+00 +1294 1294 3.33333333333333e+01 +1294 1508 4.16666666666667e+00 +1294 1507 -6.25000000000000e+00 +1294 1505 -8.33333333333333e+00 +1294 1511 4.16666666666667e+00 +1294 1503 4.16666666666667e+00 +1294 1510 -1.87500000000000e+01 +1294 1509 4.16666666666667e+00 +1294 1506 -2.08333333333333e+00 +1294 1513 -4.16666666666667e+00 +1294 1293 -4.16666666666667e+00 +1294 1512 2.08333333333333e+00 +1294 2142 2.08333333333333e+00 +1294 2149 -4.16666666666667e+00 +1294 2148 2.08333333333333e+00 +1294 2139 -4.16666666666667e+00 +1294 2147 2.08333333333333e+00 +1294 2141 -4.16666666666667e+00 +1294 2144 2.08333333333333e+00 +1294 2145 -4.16666666666667e+00 +1295 1295 3.33333333333333e+01 +1295 1506 4.16666666666667e+00 +1295 1508 -1.87500000000000e+01 +1295 1507 4.16666666666667e+00 +1295 1503 4.16666666666667e+00 +1295 1504 -8.33333333333333e+00 +1295 1510 4.16666666666667e+00 +1295 1511 -6.25000000000000e+00 +1295 1293 -4.16666666666667e+00 +1295 1512 2.08333333333333e+00 +1295 1514 -4.16666666666667e+00 +1295 1509 -2.08333333333333e+00 +1295 2148 2.08333333333333e+00 +1295 2142 -4.16666666666667e+00 +1295 2150 -4.16666666666667e+00 +1295 2145 2.08333333333333e+00 +1295 2139 -4.16666666666667e+00 +1295 2143 2.08333333333333e+00 +1295 2146 2.08333333333333e+00 +1295 2140 -4.16666666666667e+00 +1296 1296 3.75000000000000e+01 +1296 1538 2.08333333333333e+00 +1296 1525 -2.08333333333333e+00 +1296 1532 -2.08333333333333e+00 +1296 1297 -4.16666666666667e+00 +1296 1537 2.08333333333333e+00 +1296 1536 -1.25000000000000e+01 +1296 1526 4.16666666666667e+00 +1296 1535 2.08333333333333e+00 +1296 1523 -4.16666666666667e+00 +1296 1522 2.08333333333333e+00 +1296 1529 2.08333333333333e+00 +1296 1534 2.08333333333333e+00 +1296 1533 -1.25000000000000e+01 +1296 1520 4.16666666666667e+00 +1296 1517 -4.16666666666667e+00 +1296 1524 -6.25000000000000e+00 +1296 1519 4.16666666666667e+00 +1296 1516 -4.16666666666667e+00 +1296 1528 -4.16666666666667e+00 +1296 1531 4.16666666666667e+00 +1296 1530 -6.25000000000000e+00 +1296 1298 -4.16666666666667e+00 +1297 1297 3.33333333333333e+01 +1297 1537 -4.16666666666667e+00 +1297 1296 -4.16666666666667e+00 +1297 1536 2.08333333333333e+00 +1297 1523 2.08333333333333e+00 +1297 1521 2.08333333333333e+00 +1297 1534 -4.16666666666667e+00 +1297 1533 2.08333333333333e+00 +1297 1526 4.16666666666667e+00 +1297 1525 -6.25000000000000e+00 +1297 1520 -8.33333333333333e+00 +1297 1532 4.16666666666667e+00 +1297 1518 4.16666666666667e+00 +1297 1515 -4.16666666666667e+00 +1297 1529 2.08333333333333e+00 +1297 1517 -4.16666666666667e+00 +1297 1531 -1.87500000000000e+01 +1297 1524 -2.08333333333333e+00 +1297 1527 -4.16666666666667e+00 +1297 1530 4.16666666666667e+00 +1298 1298 3.33333333333333e+01 +1298 1536 2.08333333333333e+00 +1298 1538 -4.16666666666667e+00 +1298 1530 -2.08333333333333e+00 +1298 1522 2.08333333333333e+00 +1298 1524 4.16666666666667e+00 +1298 1533 2.08333333333333e+00 +1298 1521 -4.16666666666667e+00 +1298 1535 -4.16666666666667e+00 +1298 1527 2.08333333333333e+00 +1298 1526 -1.87500000000000e+01 +1298 1525 4.16666666666667e+00 +1298 1518 4.16666666666667e+00 +1298 1515 -4.16666666666667e+00 +1298 1519 -8.33333333333333e+00 +1298 1531 4.16666666666667e+00 +1298 1532 -6.25000000000000e+00 +1298 1296 -4.16666666666667e+00 +1298 1528 2.08333333333333e+00 +1298 1516 -4.16666666666667e+00 +1299 1299 3.75000000000000e+01 +1299 1405 2.08333333333333e+00 +1299 1561 -4.16666666666667e+00 +1299 1553 -2.08333333333333e+00 +1299 1300 -4.16666666666667e+00 +1299 1552 4.16666666666667e+00 +1299 1384 2.08333333333333e+00 +1299 1551 -6.25000000000000e+00 +1299 1568 -4.16666666666667e+00 +1299 1559 4.16666666666667e+00 +1299 1406 2.08333333333333e+00 +1299 1565 -4.16666666666667e+00 +1299 1564 2.08333333333333e+00 +1299 1567 -4.16666666666667e+00 +1299 1404 -1.25000000000000e+01 +1299 1301 -4.16666666666667e+00 +1299 1556 4.16666666666667e+00 +1299 1385 2.08333333333333e+00 +1299 1555 -2.08333333333333e+00 +1299 1558 4.16666666666667e+00 +1299 1562 2.08333333333333e+00 +1299 1554 -6.25000000000000e+00 +1299 1383 -1.25000000000000e+01 +1300 1300 3.33333333333333e+01 +1300 1404 2.08333333333333e+00 +1300 1560 -4.16666666666667e+00 +1300 1553 4.16666666666667e+00 +1300 1552 -1.87500000000000e+01 +1300 1299 -4.16666666666667e+00 +1300 1551 4.16666666666667e+00 +1300 1383 2.08333333333333e+00 +1300 1565 2.08333333333333e+00 +1300 1568 -4.16666666666667e+00 +1300 1405 -4.16666666666667e+00 +1300 1563 2.08333333333333e+00 +1300 1566 -4.16666666666667e+00 +1300 1556 4.16666666666667e+00 +1300 1559 -8.33333333333333e+00 +1300 1562 2.08333333333333e+00 +1300 1555 -6.25000000000000e+00 +1300 1384 -4.16666666666667e+00 +1300 1554 -2.08333333333333e+00 +1300 1557 4.16666666666667e+00 +1301 1301 3.33333333333333e+01 +1301 1560 2.08333333333333e+00 +1301 1553 -6.25000000000000e+00 +1301 1552 4.16666666666667e+00 +1301 1551 -2.08333333333333e+00 +1301 1564 2.08333333333333e+00 +1301 1567 -4.16666666666667e+00 +1301 1566 -4.16666666666667e+00 +1301 1557 4.16666666666667e+00 +1301 1406 -4.16666666666667e+00 +1301 1404 2.08333333333333e+00 +1301 1563 -4.16666666666667e+00 +1301 1561 2.08333333333333e+00 +1301 1556 -1.87500000000000e+01 +1301 1385 -4.16666666666667e+00 +1301 1555 4.16666666666667e+00 +1301 1558 -8.33333333333333e+00 +1301 1299 -4.16666666666667e+00 +1301 1554 4.16666666666667e+00 +1301 1383 2.08333333333333e+00 +1302 1302 6.25000000000000e+01 +1302 1304 -8.33333333333333e+00 +1302 1574 8.33333333333333e+00 +1302 1582 4.16666666666667e+00 +1302 1573 -4.16666666666667e+00 +1302 1388 -2.08333333333333e+00 +1302 1387 4.16666666666667e+00 +1302 1386 -6.25000000000000e+00 +1302 1572 -1.25000000000000e+01 +1302 1433 -2.08333333333333e+00 +1302 1583 4.16666666666667e+00 +1302 1303 -8.33333333333333e+00 +1302 1432 4.16666666666667e+00 +1302 1431 -6.25000000000000e+00 +1302 1579 -4.16666666666667e+00 +1302 1571 4.16666666666667e+00 +1302 1570 4.16666666666667e+00 +1302 1569 -1.87500000000000e+01 +1302 1586 -4.16666666666667e+00 +1302 1585 -4.16666666666667e+00 +1302 1577 -8.33333333333333e+00 +1302 1576 4.16666666666667e+00 +1302 1580 2.08333333333333e+00 +1302 2288 2.08333333333333e+00 +1302 2287 -4.16666666666667e+00 +1302 2317 4.16666666666667e+00 +1302 2318 4.16666666666667e+00 +1302 2316 -1.87500000000000e+01 +1303 1303 6.25000000000000e+01 +1303 1581 4.16666666666667e+00 +1303 1572 -4.16666666666667e+00 +1303 1388 4.16666666666667e+00 +1303 1304 -8.33333333333333e+00 +1303 1574 8.33333333333333e+00 +1303 1387 -1.87500000000000e+01 +1303 1573 -1.25000000000000e+01 +1303 1386 4.16666666666667e+00 +1303 1433 4.16666666666667e+00 +1303 1583 -8.33333333333333e+00 +1303 1432 -1.87500000000000e+01 +1303 1302 -8.33333333333333e+00 +1303 1431 4.16666666666667e+00 +1303 1578 -4.16666666666667e+00 +1303 1571 -2.08333333333333e+00 +1303 1570 -6.25000000000000e+00 +1303 1569 4.16666666666667e+00 +1303 1586 -4.16666666666667e+00 +1303 1577 4.16666666666667e+00 +1303 1584 -4.16666666666667e+00 +1303 1580 2.08333333333333e+00 +1303 1575 4.16666666666667e+00 +1303 2288 2.08333333333333e+00 +1303 2286 -4.16666666666667e+00 +1303 2318 -2.08333333333333e+00 +1303 2317 -6.25000000000000e+00 +1303 2316 4.16666666666667e+00 +1304 1304 6.25000000000000e+01 +1304 1302 -8.33333333333333e+00 +1304 1572 8.33333333333333e+00 +1304 1388 -6.25000000000000e+00 +1304 1574 -3.75000000000000e+01 +1304 1387 4.16666666666667e+00 +1304 1303 -8.33333333333333e+00 +1304 1573 8.33333333333333e+00 +1304 1386 -2.08333333333333e+00 +1304 1433 -6.25000000000000e+00 +1304 1432 4.16666666666667e+00 +1304 1582 -8.33333333333333e+00 +1304 1431 -2.08333333333333e+00 +1304 1581 4.16666666666667e+00 +1304 1579 2.08333333333333e+00 +1304 1571 -6.25000000000000e+00 +1304 1570 -2.08333333333333e+00 +1304 1569 4.16666666666667e+00 +1304 1584 -4.16666666666667e+00 +1304 1585 -4.16666666666667e+00 +1304 1576 4.16666666666667e+00 +1304 1578 2.08333333333333e+00 +1304 1575 -8.33333333333333e+00 +1304 2287 2.08333333333333e+00 +1304 2316 4.16666666666667e+00 +1304 2286 2.08333333333333e+00 +1304 2317 -2.08333333333333e+00 +1304 2318 -6.25000000000000e+00 +1305 1305 6.25000000000000e+01 +1305 1600 4.16666666666667e+00 +1305 1601 4.16666666666667e+00 +1305 1597 4.16666666666667e+00 +1305 1596 -6.25000000000000e+00 +1305 1307 -8.33333333333333e+00 +1305 1571 4.16666666666667e+00 +1305 1570 4.16666666666667e+00 +1305 1569 -1.87500000000000e+01 +1305 1588 -4.16666666666667e+00 +1305 1306 -8.33333333333333e+00 +1305 1592 4.16666666666667e+00 +1305 1603 -4.16666666666667e+00 +1305 1594 4.16666666666667e+00 +1305 1589 8.33333333333333e+00 +1305 1595 -8.33333333333333e+00 +1305 1445 2.08333333333333e+00 +1305 1604 -4.16666666666667e+00 +1305 1591 4.16666666666667e+00 +1305 1444 -4.16666666666667e+00 +1305 1590 -1.87500000000000e+01 +1305 1553 -2.08333333333333e+00 +1305 1391 2.08333333333333e+00 +1305 1552 4.16666666666667e+00 +1305 1390 -4.16666666666667e+00 +1305 1551 -6.25000000000000e+00 +1305 1598 -2.08333333333333e+00 +1305 1587 -1.25000000000000e+01 +1306 1306 6.25000000000000e+01 +1306 1599 4.16666666666667e+00 +1306 1601 -8.33333333333333e+00 +1306 1445 2.08333333333333e+00 +1306 1597 -1.87500000000000e+01 +1306 1596 4.16666666666667e+00 +1306 1571 -2.08333333333333e+00 +1306 1391 2.08333333333333e+00 +1306 1570 -6.25000000000000e+00 +1306 1569 4.16666666666667e+00 +1306 1587 -4.16666666666667e+00 +1306 1592 -2.08333333333333e+00 +1306 1305 -8.33333333333333e+00 +1306 1602 -4.16666666666667e+00 +1306 1593 4.16666666666667e+00 +1306 1604 -4.16666666666667e+00 +1306 1595 4.16666666666667e+00 +1306 1591 -6.25000000000000e+00 +1306 1590 4.16666666666667e+00 +1306 1443 -4.16666666666667e+00 +1306 1553 4.16666666666667e+00 +1306 1307 -8.33333333333333e+00 +1306 1589 8.33333333333333e+00 +1306 1552 -1.87500000000000e+01 +1306 1598 4.16666666666667e+00 +1306 1588 -1.25000000000000e+01 +1306 1551 4.16666666666667e+00 +1306 1389 -4.16666666666667e+00 +1307 1307 6.25000000000000e+01 +1307 1597 4.16666666666667e+00 +1307 1600 -8.33333333333333e+00 +1307 1599 4.16666666666667e+00 +1307 1598 -6.25000000000000e+00 +1307 1444 2.08333333333333e+00 +1307 1571 -6.25000000000000e+00 +1307 1570 -2.08333333333333e+00 +1307 1390 2.08333333333333e+00 +1307 1305 -8.33333333333333e+00 +1307 1569 4.16666666666667e+00 +1307 1591 -2.08333333333333e+00 +1307 1590 4.16666666666667e+00 +1307 1603 -4.16666666666667e+00 +1307 1594 4.16666666666667e+00 +1307 1587 8.33333333333333e+00 +1307 1593 -8.33333333333333e+00 +1307 1592 -6.25000000000000e+00 +1307 1443 2.08333333333333e+00 +1307 1602 -4.16666666666667e+00 +1307 1553 -6.25000000000000e+00 +1307 1596 -2.08333333333333e+00 +1307 1589 -3.75000000000000e+01 +1307 1552 4.16666666666667e+00 +1307 1306 -8.33333333333333e+00 +1307 1588 8.33333333333333e+00 +1307 1551 -2.08333333333333e+00 +1307 1389 2.08333333333333e+00 +1308 1308 6.25000000000000e+01 +1308 1610 -4.16666666666667e+00 +1308 1309 -8.33333333333333e+00 +1308 1609 8.33333333333333e+00 +1308 1394 4.16666666666667e+00 +1308 1393 -2.08333333333333e+00 +1308 1392 -6.25000000000000e+00 +1308 1608 -1.25000000000000e+01 +1308 1310 -8.33333333333333e+00 +1308 1469 4.16666666666667e+00 +1308 1468 -2.08333333333333e+00 +1308 1618 4.16666666666667e+00 +1308 1619 4.16666666666667e+00 +1308 1467 -6.25000000000000e+00 +1308 1613 4.16666666666667e+00 +1308 1622 -4.16666666666667e+00 +1308 1615 2.08333333333333e+00 +1308 1621 -4.16666666666667e+00 +1308 1616 -4.16666666666667e+00 +1308 1607 4.16666666666667e+00 +1308 1606 4.16666666666667e+00 +1308 1612 -8.33333333333333e+00 +1308 1605 -1.87500000000000e+01 +1308 2353 4.16666666666667e+00 +1308 2291 -4.16666666666667e+00 +1308 2290 2.08333333333333e+00 +1308 2354 4.16666666666667e+00 +1308 2352 -1.87500000000000e+01 +1309 1309 6.25000000000000e+01 +1309 1308 -8.33333333333333e+00 +1309 1608 8.33333333333333e+00 +1309 1394 4.16666666666667e+00 +1309 1310 -8.33333333333333e+00 +1309 1610 8.33333333333333e+00 +1309 1393 -6.25000000000000e+00 +1309 1609 -3.75000000000000e+01 +1309 1392 -2.08333333333333e+00 +1309 1469 4.16666666666667e+00 +1309 1619 -8.33333333333333e+00 +1309 1468 -6.25000000000000e+00 +1309 1467 -2.08333333333333e+00 +1309 1617 4.16666666666667e+00 +1309 1614 2.08333333333333e+00 +1309 1620 -4.16666666666667e+00 +1309 1616 2.08333333333333e+00 +1309 1622 -4.16666666666667e+00 +1309 1607 -2.08333333333333e+00 +1309 1613 4.16666666666667e+00 +1309 1606 -6.25000000000000e+00 +1309 1605 4.16666666666667e+00 +1309 1611 -8.33333333333333e+00 +1309 2354 -2.08333333333333e+00 +1309 2352 4.16666666666667e+00 +1309 2289 2.08333333333333e+00 +1309 2291 2.08333333333333e+00 +1309 2353 -6.25000000000000e+00 +1310 1310 6.25000000000000e+01 +1310 1608 -4.16666666666667e+00 +1310 1394 -1.87500000000000e+01 +1310 1610 -1.25000000000000e+01 +1310 1393 4.16666666666667e+00 +1310 1309 -8.33333333333333e+00 +1310 1609 8.33333333333333e+00 +1310 1392 4.16666666666667e+00 +1310 1617 4.16666666666667e+00 +1310 1469 -1.87500000000000e+01 +1310 1468 4.16666666666667e+00 +1310 1618 -8.33333333333333e+00 +1310 1308 -8.33333333333333e+00 +1310 1467 4.16666666666667e+00 +1310 1611 4.16666666666667e+00 +1310 1620 -4.16666666666667e+00 +1310 1615 2.08333333333333e+00 +1310 1621 -4.16666666666667e+00 +1310 1614 -4.16666666666667e+00 +1310 1607 -6.25000000000000e+00 +1310 1606 -2.08333333333333e+00 +1310 1612 4.16666666666667e+00 +1310 1605 4.16666666666667e+00 +1310 2290 2.08333333333333e+00 +1310 2353 -2.08333333333333e+00 +1310 2289 -4.16666666666667e+00 +1310 2354 -6.25000000000000e+00 +1310 2352 4.16666666666667e+00 +1311 1311 6.25000000000000e+01 +1311 1631 4.16666666666667e+00 +1311 1630 -8.33333333333333e+00 +1311 1628 4.16666666666667e+00 +1311 1480 2.08333333333333e+00 +1311 1626 -1.87500000000000e+01 +1311 1556 4.16666666666667e+00 +1311 1555 -2.08333333333333e+00 +1311 1396 2.08333333333333e+00 +1311 1554 -6.25000000000000e+00 +1311 1625 -4.16666666666667e+00 +1311 1313 -8.33333333333333e+00 +1311 1633 -2.08333333333333e+00 +1311 1640 -4.16666666666667e+00 +1311 1637 4.16666666666667e+00 +1311 1639 -4.16666666666667e+00 +1311 1636 4.16666666666667e+00 +1311 1634 4.16666666666667e+00 +1311 1481 -4.16666666666667e+00 +1311 1632 -6.25000000000000e+00 +1311 1607 4.16666666666667e+00 +1311 1397 -4.16666666666667e+00 +1311 1606 4.16666666666667e+00 +1311 1312 -8.33333333333333e+00 +1311 1624 8.33333333333333e+00 +1311 1605 -1.87500000000000e+01 +1311 1627 4.16666666666667e+00 +1311 1623 -1.25000000000000e+01 +1312 1312 6.25000000000000e+01 +1312 1631 4.16666666666667e+00 +1312 1626 4.16666666666667e+00 +1312 1629 -8.33333333333333e+00 +1312 1627 -6.25000000000000e+00 +1312 1479 2.08333333333333e+00 +1312 1556 4.16666666666667e+00 +1312 1313 -8.33333333333333e+00 +1312 1555 -6.25000000000000e+00 +1312 1554 -2.08333333333333e+00 +1312 1395 2.08333333333333e+00 +1312 1632 -2.08333333333333e+00 +1312 1634 4.16666666666667e+00 +1312 1625 8.33333333333333e+00 +1312 1637 -8.33333333333333e+00 +1312 1638 -4.16666666666667e+00 +1312 1635 4.16666666666667e+00 +1312 1481 2.08333333333333e+00 +1312 1640 -4.16666666666667e+00 +1312 1633 -6.25000000000000e+00 +1312 1607 -2.08333333333333e+00 +1312 1397 2.08333333333333e+00 +1312 1606 -6.25000000000000e+00 +1312 1628 -2.08333333333333e+00 +1312 1624 -3.75000000000000e+01 +1312 1605 4.16666666666667e+00 +1312 1311 -8.33333333333333e+00 +1312 1623 8.33333333333333e+00 +1313 1313 6.25000000000000e+01 +1313 1630 4.16666666666667e+00 +1313 1629 4.16666666666667e+00 +1313 1628 -6.25000000000000e+00 +1313 1626 4.16666666666667e+00 +1313 1556 -1.87500000000000e+01 +1313 1555 4.16666666666667e+00 +1313 1312 -8.33333333333333e+00 +1313 1554 4.16666666666667e+00 +1313 1623 -4.16666666666667e+00 +1313 1311 -8.33333333333333e+00 +1313 1633 4.16666666666667e+00 +1313 1638 -4.16666666666667e+00 +1313 1635 4.16666666666667e+00 +1313 1624 8.33333333333333e+00 +1313 1636 -8.33333333333333e+00 +1313 1634 -1.87500000000000e+01 +1313 1480 2.08333333333333e+00 +1313 1639 -4.16666666666667e+00 +1313 1632 4.16666666666667e+00 +1313 1479 -4.16666666666667e+00 +1313 1607 -6.25000000000000e+00 +1313 1627 -2.08333333333333e+00 +1313 1625 -1.25000000000000e+01 +1313 1606 -2.08333333333333e+00 +1313 1396 2.08333333333333e+00 +1313 1605 4.16666666666667e+00 +1313 1395 -4.16666666666667e+00 +1314 1314 1.25000000000000e+02 +1314 1573 -4.16666666666667e+00 +1314 1400 4.16666666666667e+00 +1314 1572 -1.25000000000000e+01 +1314 1646 -4.16666666666667e+00 +1314 1505 4.16666666666667e+00 +1314 1315 -1.66666666666667e+01 +1314 1645 8.33333333333333e+00 +1314 1644 -1.25000000000000e+01 +1314 1610 -4.16666666666667e+00 +1314 1609 8.33333333333333e+00 +1314 1399 4.16666666666667e+00 +1314 1608 -1.25000000000000e+01 +1314 1316 -1.66666666666667e+01 +1314 1652 8.33333333333333e+00 +1314 1651 -4.16666666666667e+00 +1314 1504 4.16666666666667e+00 +1314 1574 8.33333333333333e+00 +1314 1650 -1.25000000000000e+01 +1314 1648 -8.33333333333333e+00 +1314 1643 8.33333333333333e+00 +1314 1655 -8.33333333333333e+00 +1314 1657 -4.16666666666667e+00 +1314 1654 4.16666666666667e+00 +1314 1658 -4.16666666666667e+00 +1314 1642 8.33333333333333e+00 +1314 1649 4.16666666666667e+00 +1314 1641 -3.75000000000000e+01 +1314 2320 4.16666666666667e+00 +1314 2321 -8.33333333333333e+00 +1314 2294 -4.16666666666667e+00 +1314 2357 4.16666666666667e+00 +1314 2386 8.33333333333333e+00 +1314 2356 -8.33333333333333e+00 +1314 2293 -4.16666666666667e+00 +1314 2387 8.33333333333333e+00 +1314 2385 -3.75000000000000e+01 +1315 1315 1.25000000000000e+02 +1315 1572 -4.16666666666667e+00 +1315 1574 8.33333333333333e+00 +1315 1573 -1.25000000000000e+01 +1315 1646 8.33333333333333e+00 +1315 1645 -3.75000000000000e+01 +1315 1314 -1.66666666666667e+01 +1315 1644 8.33333333333333e+00 +1315 1316 -1.66666666666667e+01 +1315 1608 8.33333333333333e+00 +1315 1400 -8.33333333333333e+00 +1315 1610 8.33333333333333e+00 +1315 1609 -3.75000000000000e+01 +1315 1398 4.16666666666667e+00 +1315 1652 8.33333333333333e+00 +1315 1505 -8.33333333333333e+00 +1315 1651 -1.25000000000000e+01 +1315 1650 -4.16666666666667e+00 +1315 1503 4.16666666666667e+00 +1315 1649 4.16666666666667e+00 +1315 1647 -8.33333333333333e+00 +1315 1643 -4.16666666666667e+00 +1315 1658 -4.16666666666667e+00 +1315 1655 4.16666666666667e+00 +1315 1656 -4.16666666666667e+00 +1315 1653 4.16666666666667e+00 +1315 1642 -1.25000000000000e+01 +1315 1641 8.33333333333333e+00 +1315 2321 4.16666666666667e+00 +1315 2387 -4.16666666666667e+00 +1315 2294 -4.16666666666667e+00 +1315 2357 4.16666666666667e+00 +1315 2385 8.33333333333333e+00 +1315 2355 -8.33333333333333e+00 +1315 2292 -4.16666666666667e+00 +1315 2319 4.16666666666667e+00 +1315 2386 -1.25000000000000e+01 +1316 1316 1.25000000000000e+02 +1316 1574 -3.75000000000000e+01 +1316 1573 8.33333333333333e+00 +1316 1398 4.16666666666667e+00 +1316 1646 -1.25000000000000e+01 +1316 1645 8.33333333333333e+00 +1316 1644 -4.16666666666667e+00 +1316 1503 4.16666666666667e+00 +1316 1315 -1.66666666666667e+01 +1316 1608 -4.16666666666667e+00 +1316 1610 -1.25000000000000e+01 +1316 1399 -8.33333333333333e+00 +1316 1609 8.33333333333333e+00 +1316 1572 8.33333333333333e+00 +1316 1652 -3.75000000000000e+01 +1316 1651 8.33333333333333e+00 +1316 1504 -8.33333333333333e+00 +1316 1314 -1.66666666666667e+01 +1316 1650 8.33333333333333e+00 +1316 1648 4.16666666666667e+00 +1316 1642 -4.16666666666667e+00 +1316 1657 -4.16666666666667e+00 +1316 1654 4.16666666666667e+00 +1316 1641 8.33333333333333e+00 +1316 1653 -8.33333333333333e+00 +1316 1656 -4.16666666666667e+00 +1316 1647 4.16666666666667e+00 +1316 1643 -1.25000000000000e+01 +1316 2320 4.16666666666667e+00 +1316 2319 -8.33333333333333e+00 +1316 2386 -4.16666666666667e+00 +1316 2293 -4.16666666666667e+00 +1316 2356 4.16666666666667e+00 +1316 2292 -4.16666666666667e+00 +1316 2355 4.16666666666667e+00 +1316 2387 -1.25000000000000e+01 +1316 2385 8.33333333333333e+00 +1317 1317 1.25000000000000e+02 +1317 1663 8.33333333333333e+00 +1317 1662 -1.25000000000000e+01 +1317 1577 -8.33333333333333e+00 +1317 1576 4.16666666666667e+00 +1317 1643 8.33333333333333e+00 +1317 1675 4.16666666666667e+00 +1317 1642 8.33333333333333e+00 +1317 1641 -3.75000000000000e+01 +1317 1676 4.16666666666667e+00 +1317 1588 -4.16666666666667e+00 +1317 1589 8.33333333333333e+00 +1317 1319 -1.66666666666667e+01 +1317 1403 -4.16666666666667e+00 +1317 1587 -1.25000000000000e+01 +1317 1667 4.16666666666667e+00 +1317 1517 -4.16666666666667e+00 +1317 1666 -8.33333333333333e+00 +1317 1559 4.16666666666667e+00 +1317 1660 8.33333333333333e+00 +1317 1318 -1.66666666666667e+01 +1317 1661 8.33333333333333e+00 +1317 1516 -4.16666666666667e+00 +1317 1659 -3.75000000000000e+01 +1317 1558 4.16666666666667e+00 +1317 1402 -4.16666666666667e+00 +1317 1625 -4.16666666666667e+00 +1317 1613 4.16666666666667e+00 +1317 1672 4.16666666666667e+00 +1317 1669 -4.16666666666667e+00 +1317 1612 -8.33333333333333e+00 +1317 1624 8.33333333333333e+00 +1317 1623 -1.25000000000000e+01 +1317 1670 8.33333333333333e+00 +1317 1673 -8.33333333333333e+00 +1317 1668 -1.25000000000000e+01 +1317 1664 -4.16666666666667e+00 +1318 1318 1.25000000000000e+02 +1318 1662 8.33333333333333e+00 +1318 1664 8.33333333333333e+00 +1318 1663 -3.75000000000000e+01 +1318 1575 4.16666666666667e+00 +1318 1643 -4.16666666666667e+00 +1318 1674 4.16666666666667e+00 +1318 1642 -1.25000000000000e+01 +1318 1641 8.33333333333333e+00 +1318 1676 -8.33333333333333e+00 +1318 1587 -4.16666666666667e+00 +1318 1667 4.16666666666667e+00 +1318 1589 8.33333333333333e+00 +1318 1588 -1.25000000000000e+01 +1318 1665 -8.33333333333333e+00 +1318 1661 -4.16666666666667e+00 +1318 1659 8.33333333333333e+00 +1318 1317 -1.66666666666667e+01 +1318 1660 -1.25000000000000e+01 +1318 1515 -4.16666666666667e+00 +1318 1559 -8.33333333333333e+00 +1318 1557 4.16666666666667e+00 +1318 1401 -4.16666666666667e+00 +1318 1625 8.33333333333333e+00 +1318 1319 -1.66666666666667e+01 +1318 1670 8.33333333333333e+00 +1318 1671 4.16666666666667e+00 +1318 1668 -4.16666666666667e+00 +1318 1613 4.16666666666667e+00 +1318 1403 -4.16666666666667e+00 +1318 1624 -3.75000000000000e+01 +1318 1611 -8.33333333333333e+00 +1318 1623 8.33333333333333e+00 +1318 1673 4.16666666666667e+00 +1318 1517 -4.16666666666667e+00 +1318 1669 -1.25000000000000e+01 +1318 1577 4.16666666666667e+00 +1319 1319 1.25000000000000e+02 +1319 1576 4.16666666666667e+00 +1319 1664 -1.25000000000000e+01 +1319 1663 8.33333333333333e+00 +1319 1575 -8.33333333333333e+00 +1319 1642 -4.16666666666667e+00 +1319 1641 8.33333333333333e+00 +1319 1643 -1.25000000000000e+01 +1319 1675 -8.33333333333333e+00 +1319 1674 4.16666666666667e+00 +1319 1666 4.16666666666667e+00 +1319 1587 8.33333333333333e+00 +1319 1317 -1.66666666666667e+01 +1319 1589 -3.75000000000000e+01 +1319 1588 8.33333333333333e+00 +1319 1401 -4.16666666666667e+00 +1319 1665 4.16666666666667e+00 +1319 1515 -4.16666666666667e+00 +1319 1660 -4.16666666666667e+00 +1319 1557 4.16666666666667e+00 +1319 1661 -1.25000000000000e+01 +1319 1659 8.33333333333333e+00 +1319 1558 -8.33333333333333e+00 +1319 1623 -4.16666666666667e+00 +1319 1611 4.16666666666667e+00 +1319 1624 8.33333333333333e+00 +1319 1318 -1.66666666666667e+01 +1319 1669 8.33333333333333e+00 +1319 1625 -1.25000000000000e+01 +1319 1612 4.16666666666667e+00 +1319 1402 -4.16666666666667e+00 +1319 1670 -3.75000000000000e+01 +1319 1662 -4.16666666666667e+00 +1319 1672 4.16666666666667e+00 +1319 1516 -4.16666666666667e+00 +1319 1668 8.33333333333333e+00 +1319 1671 -8.33333333333333e+00 +1320 1320 3.75000000000000e+01 +1320 1429 2.08333333333333e+00 +1320 1687 -4.16666666666667e+00 +1320 1679 -2.08333333333333e+00 +1320 1321 -4.16666666666667e+00 +1320 1678 4.16666666666667e+00 +1320 1408 2.08333333333333e+00 +1320 1677 -6.25000000000000e+00 +1320 1694 -4.16666666666667e+00 +1320 1685 4.16666666666667e+00 +1320 1430 2.08333333333333e+00 +1320 1691 -4.16666666666667e+00 +1320 1690 2.08333333333333e+00 +1320 1693 -4.16666666666667e+00 +1320 1428 -1.25000000000000e+01 +1320 1322 -4.16666666666667e+00 +1320 1682 4.16666666666667e+00 +1320 1409 2.08333333333333e+00 +1320 1681 -2.08333333333333e+00 +1320 1684 4.16666666666667e+00 +1320 1688 2.08333333333333e+00 +1320 1680 -6.25000000000000e+00 +1320 1407 -1.25000000000000e+01 +1321 1321 3.33333333333333e+01 +1321 1428 2.08333333333333e+00 +1321 1686 -4.16666666666667e+00 +1321 1679 4.16666666666667e+00 +1321 1678 -1.87500000000000e+01 +1321 1320 -4.16666666666667e+00 +1321 1677 4.16666666666667e+00 +1321 1407 2.08333333333333e+00 +1321 1691 2.08333333333333e+00 +1321 1694 -4.16666666666667e+00 +1321 1429 -4.16666666666667e+00 +1321 1689 2.08333333333333e+00 +1321 1692 -4.16666666666667e+00 +1321 1682 4.16666666666667e+00 +1321 1685 -8.33333333333333e+00 +1321 1688 2.08333333333333e+00 +1321 1681 -6.25000000000000e+00 +1321 1408 -4.16666666666667e+00 +1321 1680 -2.08333333333333e+00 +1321 1683 4.16666666666667e+00 +1322 1322 3.33333333333333e+01 +1322 1686 2.08333333333333e+00 +1322 1679 -6.25000000000000e+00 +1322 1678 4.16666666666667e+00 +1322 1677 -2.08333333333333e+00 +1322 1690 2.08333333333333e+00 +1322 1693 -4.16666666666667e+00 +1322 1692 -4.16666666666667e+00 +1322 1683 4.16666666666667e+00 +1322 1430 -4.16666666666667e+00 +1322 1428 2.08333333333333e+00 +1322 1689 -4.16666666666667e+00 +1322 1687 2.08333333333333e+00 +1322 1682 -1.87500000000000e+01 +1322 1409 -4.16666666666667e+00 +1322 1681 4.16666666666667e+00 +1322 1684 -8.33333333333333e+00 +1322 1320 -4.16666666666667e+00 +1322 1680 4.16666666666667e+00 +1322 1407 2.08333333333333e+00 +1323 1323 6.25000000000000e+01 +1323 1705 -4.16666666666667e+00 +1323 1697 4.16666666666667e+00 +1323 1696 4.16666666666667e+00 +1323 1695 -1.87500000000000e+01 +1323 1712 -4.16666666666667e+00 +1323 1711 -4.16666666666667e+00 +1323 1703 -8.33333333333333e+00 +1323 1702 4.16666666666667e+00 +1323 1592 4.16666666666667e+00 +1323 1325 -8.33333333333333e+00 +1323 1700 8.33333333333333e+00 +1323 1708 4.16666666666667e+00 +1323 1699 -4.16666666666667e+00 +1323 1412 -2.08333333333333e+00 +1323 1562 2.08333333333333e+00 +1323 1411 4.16666666666667e+00 +1323 1561 -4.16666666666667e+00 +1323 1410 -6.25000000000000e+00 +1323 1698 -1.25000000000000e+01 +1323 1448 -2.08333333333333e+00 +1323 1709 4.16666666666667e+00 +1323 1324 -8.33333333333333e+00 +1323 1447 4.16666666666667e+00 +1323 1591 4.16666666666667e+00 +1323 1706 2.08333333333333e+00 +1323 1446 -6.25000000000000e+00 +1323 1590 -1.87500000000000e+01 +1324 1324 6.25000000000000e+01 +1324 1704 -4.16666666666667e+00 +1324 1697 -2.08333333333333e+00 +1324 1696 -6.25000000000000e+00 +1324 1695 4.16666666666667e+00 +1324 1712 -4.16666666666667e+00 +1324 1703 4.16666666666667e+00 +1324 1710 -4.16666666666667e+00 +1324 1701 4.16666666666667e+00 +1324 1592 -2.08333333333333e+00 +1324 1562 2.08333333333333e+00 +1324 1707 4.16666666666667e+00 +1324 1698 -4.16666666666667e+00 +1324 1412 4.16666666666667e+00 +1324 1325 -8.33333333333333e+00 +1324 1700 8.33333333333333e+00 +1324 1411 -1.87500000000000e+01 +1324 1699 -1.25000000000000e+01 +1324 1410 4.16666666666667e+00 +1324 1560 -4.16666666666667e+00 +1324 1448 4.16666666666667e+00 +1324 1709 -8.33333333333333e+00 +1324 1706 2.08333333333333e+00 +1324 1447 -1.87500000000000e+01 +1324 1591 -6.25000000000000e+00 +1324 1323 -8.33333333333333e+00 +1324 1446 4.16666666666667e+00 +1324 1590 4.16666666666667e+00 +1325 1325 6.25000000000000e+01 +1325 1705 2.08333333333333e+00 +1325 1697 -6.25000000000000e+00 +1325 1696 -2.08333333333333e+00 +1325 1695 4.16666666666667e+00 +1325 1710 -4.16666666666667e+00 +1325 1711 -4.16666666666667e+00 +1325 1702 4.16666666666667e+00 +1325 1701 -8.33333333333333e+00 +1325 1591 -2.08333333333333e+00 +1325 1561 2.08333333333333e+00 +1325 1590 4.16666666666667e+00 +1325 1323 -8.33333333333333e+00 +1325 1698 8.33333333333333e+00 +1325 1412 -6.25000000000000e+00 +1325 1700 -3.75000000000000e+01 +1325 1411 4.16666666666667e+00 +1325 1324 -8.33333333333333e+00 +1325 1699 8.33333333333333e+00 +1325 1410 -2.08333333333333e+00 +1325 1560 2.08333333333333e+00 +1325 1704 2.08333333333333e+00 +1325 1448 -6.25000000000000e+00 +1325 1592 -6.25000000000000e+00 +1325 1447 4.16666666666667e+00 +1325 1708 -8.33333333333333e+00 +1325 1446 -2.08333333333333e+00 +1325 1707 4.16666666666667e+00 +1326 1326 6.25000000000000e+01 +1326 1726 4.16666666666667e+00 +1326 1727 4.16666666666667e+00 +1326 1723 4.16666666666667e+00 +1326 1722 -6.25000000000000e+00 +1326 1328 -8.33333333333333e+00 +1326 1697 4.16666666666667e+00 +1326 1696 4.16666666666667e+00 +1326 1695 -1.87500000000000e+01 +1326 1714 -4.16666666666667e+00 +1326 1327 -8.33333333333333e+00 +1326 1718 4.16666666666667e+00 +1326 1729 -4.16666666666667e+00 +1326 1720 4.16666666666667e+00 +1326 1715 8.33333333333333e+00 +1326 1721 -8.33333333333333e+00 +1326 1463 2.08333333333333e+00 +1326 1730 -4.16666666666667e+00 +1326 1717 4.16666666666667e+00 +1326 1462 -4.16666666666667e+00 +1326 1716 -1.87500000000000e+01 +1326 1679 -2.08333333333333e+00 +1326 1415 2.08333333333333e+00 +1326 1678 4.16666666666667e+00 +1326 1414 -4.16666666666667e+00 +1326 1677 -6.25000000000000e+00 +1326 1724 -2.08333333333333e+00 +1326 1713 -1.25000000000000e+01 +1327 1327 6.25000000000000e+01 +1327 1725 4.16666666666667e+00 +1327 1727 -8.33333333333333e+00 +1327 1463 2.08333333333333e+00 +1327 1723 -1.87500000000000e+01 +1327 1722 4.16666666666667e+00 +1327 1697 -2.08333333333333e+00 +1327 1415 2.08333333333333e+00 +1327 1696 -6.25000000000000e+00 +1327 1695 4.16666666666667e+00 +1327 1713 -4.16666666666667e+00 +1327 1718 -2.08333333333333e+00 +1327 1326 -8.33333333333333e+00 +1327 1728 -4.16666666666667e+00 +1327 1719 4.16666666666667e+00 +1327 1730 -4.16666666666667e+00 +1327 1721 4.16666666666667e+00 +1327 1717 -6.25000000000000e+00 +1327 1716 4.16666666666667e+00 +1327 1461 -4.16666666666667e+00 +1327 1679 4.16666666666667e+00 +1327 1328 -8.33333333333333e+00 +1327 1715 8.33333333333333e+00 +1327 1678 -1.87500000000000e+01 +1327 1724 4.16666666666667e+00 +1327 1714 -1.25000000000000e+01 +1327 1677 4.16666666666667e+00 +1327 1413 -4.16666666666667e+00 +1328 1328 6.25000000000000e+01 +1328 1723 4.16666666666667e+00 +1328 1726 -8.33333333333333e+00 +1328 1725 4.16666666666667e+00 +1328 1724 -6.25000000000000e+00 +1328 1462 2.08333333333333e+00 +1328 1697 -6.25000000000000e+00 +1328 1696 -2.08333333333333e+00 +1328 1414 2.08333333333333e+00 +1328 1326 -8.33333333333333e+00 +1328 1695 4.16666666666667e+00 +1328 1717 -2.08333333333333e+00 +1328 1716 4.16666666666667e+00 +1328 1729 -4.16666666666667e+00 +1328 1720 4.16666666666667e+00 +1328 1713 8.33333333333333e+00 +1328 1719 -8.33333333333333e+00 +1328 1718 -6.25000000000000e+00 +1328 1461 2.08333333333333e+00 +1328 1728 -4.16666666666667e+00 +1328 1679 -6.25000000000000e+00 +1328 1722 -2.08333333333333e+00 +1328 1715 -3.75000000000000e+01 +1328 1678 4.16666666666667e+00 +1328 1327 -8.33333333333333e+00 +1328 1714 8.33333333333333e+00 +1328 1677 -2.08333333333333e+00 +1328 1413 2.08333333333333e+00 +1329 1329 6.25000000000000e+01 +1329 1748 -4.16666666666667e+00 +1329 1741 2.08333333333333e+00 +1329 1747 -4.16666666666667e+00 +1329 1742 -4.16666666666667e+00 +1329 1733 4.16666666666667e+00 +1329 1732 4.16666666666667e+00 +1329 1738 -8.33333333333333e+00 +1329 1731 -1.87500000000000e+01 +1329 1745 4.16666666666667e+00 +1329 1736 -4.16666666666667e+00 +1329 1330 -8.33333333333333e+00 +1329 1735 8.33333333333333e+00 +1329 1627 4.16666666666667e+00 +1329 1418 4.16666666666667e+00 +1329 1565 -4.16666666666667e+00 +1329 1417 -2.08333333333333e+00 +1329 1564 2.08333333333333e+00 +1329 1416 -6.25000000000000e+00 +1329 1734 -1.25000000000000e+01 +1329 1331 -8.33333333333333e+00 +1329 1484 4.16666666666667e+00 +1329 1628 4.16666666666667e+00 +1329 1483 -2.08333333333333e+00 +1329 1744 4.16666666666667e+00 +1329 1739 4.16666666666667e+00 +1329 1482 -6.25000000000000e+00 +1329 1626 -1.87500000000000e+01 +1330 1330 6.25000000000000e+01 +1330 1746 -4.16666666666667e+00 +1330 1742 2.08333333333333e+00 +1330 1748 -4.16666666666667e+00 +1330 1733 -2.08333333333333e+00 +1330 1739 4.16666666666667e+00 +1330 1732 -6.25000000000000e+00 +1330 1731 4.16666666666667e+00 +1330 1737 -8.33333333333333e+00 +1330 1565 2.08333333333333e+00 +1330 1628 -2.08333333333333e+00 +1330 1329 -8.33333333333333e+00 +1330 1734 8.33333333333333e+00 +1330 1626 4.16666666666667e+00 +1330 1418 4.16666666666667e+00 +1330 1331 -8.33333333333333e+00 +1330 1736 8.33333333333333e+00 +1330 1417 -6.25000000000000e+00 +1330 1735 -3.75000000000000e+01 +1330 1416 -2.08333333333333e+00 +1330 1563 2.08333333333333e+00 +1330 1484 4.16666666666667e+00 +1330 1745 -8.33333333333333e+00 +1330 1740 2.08333333333333e+00 +1330 1483 -6.25000000000000e+00 +1330 1627 -6.25000000000000e+00 +1330 1482 -2.08333333333333e+00 +1330 1743 4.16666666666667e+00 +1331 1331 6.25000000000000e+01 +1331 1746 -4.16666666666667e+00 +1331 1741 2.08333333333333e+00 +1331 1747 -4.16666666666667e+00 +1331 1740 -4.16666666666667e+00 +1331 1733 -6.25000000000000e+00 +1331 1732 -2.08333333333333e+00 +1331 1738 4.16666666666667e+00 +1331 1731 4.16666666666667e+00 +1331 1743 4.16666666666667e+00 +1331 1734 -4.16666666666667e+00 +1331 1564 2.08333333333333e+00 +1331 1627 -2.08333333333333e+00 +1331 1418 -1.87500000000000e+01 +1331 1736 -1.25000000000000e+01 +1331 1417 4.16666666666667e+00 +1331 1330 -8.33333333333333e+00 +1331 1735 8.33333333333333e+00 +1331 1416 4.16666666666667e+00 +1331 1563 -4.16666666666667e+00 +1331 1737 4.16666666666667e+00 +1331 1484 -1.87500000000000e+01 +1331 1628 -6.25000000000000e+00 +1331 1483 4.16666666666667e+00 +1331 1744 -8.33333333333333e+00 +1331 1329 -8.33333333333333e+00 +1331 1482 4.16666666666667e+00 +1331 1626 4.16666666666667e+00 +1332 1332 6.25000000000000e+01 +1332 1757 4.16666666666667e+00 +1332 1756 -8.33333333333333e+00 +1332 1754 4.16666666666667e+00 +1332 1498 2.08333333333333e+00 +1332 1752 -1.87500000000000e+01 +1332 1682 4.16666666666667e+00 +1332 1681 -2.08333333333333e+00 +1332 1420 2.08333333333333e+00 +1332 1680 -6.25000000000000e+00 +1332 1751 -4.16666666666667e+00 +1332 1334 -8.33333333333333e+00 +1332 1759 -2.08333333333333e+00 +1332 1766 -4.16666666666667e+00 +1332 1763 4.16666666666667e+00 +1332 1765 -4.16666666666667e+00 +1332 1762 4.16666666666667e+00 +1332 1760 4.16666666666667e+00 +1332 1499 -4.16666666666667e+00 +1332 1758 -6.25000000000000e+00 +1332 1733 4.16666666666667e+00 +1332 1421 -4.16666666666667e+00 +1332 1732 4.16666666666667e+00 +1332 1333 -8.33333333333333e+00 +1332 1750 8.33333333333333e+00 +1332 1731 -1.87500000000000e+01 +1332 1753 4.16666666666667e+00 +1332 1749 -1.25000000000000e+01 +1333 1333 6.25000000000000e+01 +1333 1757 4.16666666666667e+00 +1333 1752 4.16666666666667e+00 +1333 1755 -8.33333333333333e+00 +1333 1753 -6.25000000000000e+00 +1333 1497 2.08333333333333e+00 +1333 1682 4.16666666666667e+00 +1333 1334 -8.33333333333333e+00 +1333 1681 -6.25000000000000e+00 +1333 1680 -2.08333333333333e+00 +1333 1419 2.08333333333333e+00 +1333 1758 -2.08333333333333e+00 +1333 1760 4.16666666666667e+00 +1333 1751 8.33333333333333e+00 +1333 1763 -8.33333333333333e+00 +1333 1764 -4.16666666666667e+00 +1333 1761 4.16666666666667e+00 +1333 1499 2.08333333333333e+00 +1333 1766 -4.16666666666667e+00 +1333 1759 -6.25000000000000e+00 +1333 1733 -2.08333333333333e+00 +1333 1421 2.08333333333333e+00 +1333 1732 -6.25000000000000e+00 +1333 1754 -2.08333333333333e+00 +1333 1750 -3.75000000000000e+01 +1333 1731 4.16666666666667e+00 +1333 1332 -8.33333333333333e+00 +1333 1749 8.33333333333333e+00 +1334 1334 6.25000000000000e+01 +1334 1756 4.16666666666667e+00 +1334 1755 4.16666666666667e+00 +1334 1754 -6.25000000000000e+00 +1334 1752 4.16666666666667e+00 +1334 1682 -1.87500000000000e+01 +1334 1681 4.16666666666667e+00 +1334 1333 -8.33333333333333e+00 +1334 1680 4.16666666666667e+00 +1334 1749 -4.16666666666667e+00 +1334 1332 -8.33333333333333e+00 +1334 1759 4.16666666666667e+00 +1334 1764 -4.16666666666667e+00 +1334 1761 4.16666666666667e+00 +1334 1750 8.33333333333333e+00 +1334 1762 -8.33333333333333e+00 +1334 1760 -1.87500000000000e+01 +1334 1498 2.08333333333333e+00 +1334 1765 -4.16666666666667e+00 +1334 1758 4.16666666666667e+00 +1334 1497 -4.16666666666667e+00 +1334 1733 -6.25000000000000e+00 +1334 1753 -2.08333333333333e+00 +1334 1751 -1.25000000000000e+01 +1334 1732 -2.08333333333333e+00 +1334 1420 2.08333333333333e+00 +1334 1731 4.16666666666667e+00 +1334 1419 -4.16666666666667e+00 +1335 1335 1.25000000000000e+02 +1335 1774 -8.33333333333333e+00 +1335 1769 8.33333333333333e+00 +1335 1781 -8.33333333333333e+00 +1335 1783 -4.16666666666667e+00 +1335 1780 4.16666666666667e+00 +1335 1784 -4.16666666666667e+00 +1335 1768 8.33333333333333e+00 +1335 1767 -3.75000000000000e+01 +1335 1700 8.33333333333333e+00 +1335 1594 4.16666666666667e+00 +1335 1699 -4.16666666666667e+00 +1335 1595 -8.33333333333333e+00 +1335 1424 4.16666666666667e+00 +1335 1698 -1.25000000000000e+01 +1335 1772 -4.16666666666667e+00 +1335 1520 4.16666666666667e+00 +1335 1336 -1.66666666666667e+01 +1335 1771 8.33333333333333e+00 +1335 1770 -1.25000000000000e+01 +1335 1736 -4.16666666666667e+00 +1335 1735 8.33333333333333e+00 +1335 1568 -4.16666666666667e+00 +1335 1631 4.16666666666667e+00 +1335 1660 8.33333333333333e+00 +1335 1630 -8.33333333333333e+00 +1335 1423 4.16666666666667e+00 +1335 1567 -4.16666666666667e+00 +1335 1734 -1.25000000000000e+01 +1335 1337 -1.66666666666667e+01 +1335 1778 8.33333333333333e+00 +1335 1661 8.33333333333333e+00 +1335 1777 -4.16666666666667e+00 +1335 1519 4.16666666666667e+00 +1335 1775 4.16666666666667e+00 +1335 1776 -1.25000000000000e+01 +1335 1659 -3.75000000000000e+01 +1336 1336 1.25000000000000e+02 +1336 1773 -8.33333333333333e+00 +1336 1769 -4.16666666666667e+00 +1336 1784 -4.16666666666667e+00 +1336 1781 4.16666666666667e+00 +1336 1782 -4.16666666666667e+00 +1336 1779 4.16666666666667e+00 +1336 1768 -1.25000000000000e+01 +1336 1767 8.33333333333333e+00 +1336 1593 4.16666666666667e+00 +1336 1698 -4.16666666666667e+00 +1336 1595 4.16666666666667e+00 +1336 1700 8.33333333333333e+00 +1336 1699 -1.25000000000000e+01 +1336 1772 8.33333333333333e+00 +1336 1771 -3.75000000000000e+01 +1336 1335 -1.66666666666667e+01 +1336 1770 8.33333333333333e+00 +1336 1661 -4.16666666666667e+00 +1336 1337 -1.66666666666667e+01 +1336 1568 -4.16666666666667e+00 +1336 1631 4.16666666666667e+00 +1336 1734 8.33333333333333e+00 +1336 1659 8.33333333333333e+00 +1336 1629 -8.33333333333333e+00 +1336 1424 -8.33333333333333e+00 +1336 1736 8.33333333333333e+00 +1336 1735 -3.75000000000000e+01 +1336 1422 4.16666666666667e+00 +1336 1566 -4.16666666666667e+00 +1336 1778 8.33333333333333e+00 +1336 1520 -8.33333333333333e+00 +1336 1775 4.16666666666667e+00 +1336 1777 -1.25000000000000e+01 +1336 1660 -1.25000000000000e+01 +1336 1776 -4.16666666666667e+00 +1336 1518 4.16666666666667e+00 +1337 1337 1.25000000000000e+02 +1337 1774 4.16666666666667e+00 +1337 1768 -4.16666666666667e+00 +1337 1783 -4.16666666666667e+00 +1337 1780 4.16666666666667e+00 +1337 1767 8.33333333333333e+00 +1337 1779 -8.33333333333333e+00 +1337 1782 -4.16666666666667e+00 +1337 1769 -1.25000000000000e+01 +1337 1698 8.33333333333333e+00 +1337 1594 4.16666666666667e+00 +1337 1593 -8.33333333333333e+00 +1337 1700 -3.75000000000000e+01 +1337 1699 8.33333333333333e+00 +1337 1422 4.16666666666667e+00 +1337 1772 -1.25000000000000e+01 +1337 1771 8.33333333333333e+00 +1337 1770 -4.16666666666667e+00 +1337 1518 4.16666666666667e+00 +1337 1660 -4.16666666666667e+00 +1337 1336 -1.66666666666667e+01 +1337 1734 -4.16666666666667e+00 +1337 1567 -4.16666666666667e+00 +1337 1630 4.16666666666667e+00 +1337 1566 -4.16666666666667e+00 +1337 1629 4.16666666666667e+00 +1337 1736 -1.25000000000000e+01 +1337 1423 -8.33333333333333e+00 +1337 1735 8.33333333333333e+00 +1337 1773 4.16666666666667e+00 +1337 1778 -3.75000000000000e+01 +1337 1661 -1.25000000000000e+01 +1337 1777 8.33333333333333e+00 +1337 1519 -8.33333333333333e+00 +1337 1335 -1.66666666666667e+01 +1337 1776 8.33333333333333e+00 +1337 1659 8.33333333333333e+00 +1338 1338 1.25000000000000e+02 +1338 1789 8.33333333333333e+00 +1338 1788 -1.25000000000000e+01 +1338 1703 -8.33333333333333e+00 +1338 1702 4.16666666666667e+00 +1338 1769 8.33333333333333e+00 +1338 1801 4.16666666666667e+00 +1338 1768 8.33333333333333e+00 +1338 1767 -3.75000000000000e+01 +1338 1802 4.16666666666667e+00 +1338 1714 -4.16666666666667e+00 +1338 1715 8.33333333333333e+00 +1338 1340 -1.66666666666667e+01 +1338 1427 -4.16666666666667e+00 +1338 1713 -1.25000000000000e+01 +1338 1793 4.16666666666667e+00 +1338 1541 -4.16666666666667e+00 +1338 1792 -8.33333333333333e+00 +1338 1685 4.16666666666667e+00 +1338 1786 8.33333333333333e+00 +1338 1339 -1.66666666666667e+01 +1338 1787 8.33333333333333e+00 +1338 1540 -4.16666666666667e+00 +1338 1785 -3.75000000000000e+01 +1338 1684 4.16666666666667e+00 +1338 1426 -4.16666666666667e+00 +1338 1751 -4.16666666666667e+00 +1338 1739 4.16666666666667e+00 +1338 1798 4.16666666666667e+00 +1338 1795 -4.16666666666667e+00 +1338 1738 -8.33333333333333e+00 +1338 1750 8.33333333333333e+00 +1338 1749 -1.25000000000000e+01 +1338 1796 8.33333333333333e+00 +1338 1799 -8.33333333333333e+00 +1338 1794 -1.25000000000000e+01 +1338 1790 -4.16666666666667e+00 +1339 1339 1.25000000000000e+02 +1339 1788 8.33333333333333e+00 +1339 1790 8.33333333333333e+00 +1339 1789 -3.75000000000000e+01 +1339 1701 4.16666666666667e+00 +1339 1769 -4.16666666666667e+00 +1339 1800 4.16666666666667e+00 +1339 1768 -1.25000000000000e+01 +1339 1767 8.33333333333333e+00 +1339 1802 -8.33333333333333e+00 +1339 1713 -4.16666666666667e+00 +1339 1793 4.16666666666667e+00 +1339 1715 8.33333333333333e+00 +1339 1714 -1.25000000000000e+01 +1339 1791 -8.33333333333333e+00 +1339 1787 -4.16666666666667e+00 +1339 1785 8.33333333333333e+00 +1339 1338 -1.66666666666667e+01 +1339 1786 -1.25000000000000e+01 +1339 1539 -4.16666666666667e+00 +1339 1685 -8.33333333333333e+00 +1339 1683 4.16666666666667e+00 +1339 1425 -4.16666666666667e+00 +1339 1751 8.33333333333333e+00 +1339 1340 -1.66666666666667e+01 +1339 1796 8.33333333333333e+00 +1339 1797 4.16666666666667e+00 +1339 1794 -4.16666666666667e+00 +1339 1739 4.16666666666667e+00 +1339 1427 -4.16666666666667e+00 +1339 1750 -3.75000000000000e+01 +1339 1737 -8.33333333333333e+00 +1339 1749 8.33333333333333e+00 +1339 1799 4.16666666666667e+00 +1339 1541 -4.16666666666667e+00 +1339 1795 -1.25000000000000e+01 +1339 1703 4.16666666666667e+00 +1340 1340 1.25000000000000e+02 +1340 1702 4.16666666666667e+00 +1340 1790 -1.25000000000000e+01 +1340 1789 8.33333333333333e+00 +1340 1701 -8.33333333333333e+00 +1340 1768 -4.16666666666667e+00 +1340 1767 8.33333333333333e+00 +1340 1769 -1.25000000000000e+01 +1340 1801 -8.33333333333333e+00 +1340 1800 4.16666666666667e+00 +1340 1792 4.16666666666667e+00 +1340 1713 8.33333333333333e+00 +1340 1338 -1.66666666666667e+01 +1340 1715 -3.75000000000000e+01 +1340 1714 8.33333333333333e+00 +1340 1425 -4.16666666666667e+00 +1340 1791 4.16666666666667e+00 +1340 1539 -4.16666666666667e+00 +1340 1786 -4.16666666666667e+00 +1340 1683 4.16666666666667e+00 +1340 1787 -1.25000000000000e+01 +1340 1785 8.33333333333333e+00 +1340 1684 -8.33333333333333e+00 +1340 1749 -4.16666666666667e+00 +1340 1737 4.16666666666667e+00 +1340 1750 8.33333333333333e+00 +1340 1339 -1.66666666666667e+01 +1340 1795 8.33333333333333e+00 +1340 1751 -1.25000000000000e+01 +1340 1738 4.16666666666667e+00 +1340 1426 -4.16666666666667e+00 +1340 1796 -3.75000000000000e+01 +1340 1788 -4.16666666666667e+00 +1340 1798 4.16666666666667e+00 +1340 1540 -4.16666666666667e+00 +1340 1794 8.33333333333333e+00 +1340 1797 -8.33333333333333e+00 +1341 1341 2.50000000000000e+01 +1341 1598 -2.08333333333333e+00 +1341 1807 2.08333333333333e+00 +1341 1804 -2.08333333333333e+00 +1341 1451 2.08333333333333e+00 +1341 1808 -4.16666666666667e+00 +1341 1450 2.08333333333333e+00 +1341 1342 -4.16666666666667e+00 +1341 1597 4.16666666666667e+00 +1341 1449 -6.25000000000000e+00 +1341 1596 -6.25000000000000e+00 +1341 1343 -4.16666666666667e+00 +1341 1436 2.08333333333333e+00 +1341 1805 4.16666666666667e+00 +1341 1435 2.08333333333333e+00 +1341 1579 -4.16666666666667e+00 +1341 1580 2.08333333333333e+00 +1341 1434 -6.25000000000000e+00 +1341 1803 -6.25000000000000e+00 +1342 1342 2.91666666666667e+01 +1342 1598 4.16666666666667e+00 +1342 1805 4.16666666666667e+00 +1342 1806 2.08333333333333e+00 +1342 1803 -2.08333333333333e+00 +1342 1451 -2.08333333333333e+00 +1342 1808 2.08333333333333e+00 +1342 1450 -2.08333333333333e+00 +1342 1597 -1.87500000000000e+01 +1342 1449 2.08333333333333e+00 +1342 1341 -4.16666666666667e+00 +1342 1596 4.16666666666667e+00 +1342 1436 -2.08333333333333e+00 +1342 1580 2.08333333333333e+00 +1342 1343 -8.33333333333333e+00 +1342 1435 -2.08333333333333e+00 +1342 1804 -6.25000000000000e+00 +1342 1434 2.08333333333333e+00 +1342 1578 -4.16666666666667e+00 +1343 1343 2.91666666666667e+01 +1343 1596 -2.08333333333333e+00 +1343 1342 -8.33333333333333e+00 +1343 1597 4.16666666666667e+00 +1343 1804 4.16666666666667e+00 +1343 1451 -2.08333333333333e+00 +1343 1598 -6.25000000000000e+00 +1343 1450 -2.08333333333333e+00 +1343 1807 2.08333333333333e+00 +1343 1449 2.08333333333333e+00 +1343 1806 -4.16666666666667e+00 +1343 1578 2.08333333333333e+00 +1343 1436 -2.08333333333333e+00 +1343 1805 -1.87500000000000e+01 +1343 1435 -2.08333333333333e+00 +1343 1579 2.08333333333333e+00 +1343 1341 -4.16666666666667e+00 +1343 1434 2.08333333333333e+00 +1343 1803 4.16666666666667e+00 +1344 1344 6.25000000000000e+01 +1344 1439 4.16666666666667e+00 +1344 1346 -8.33333333333333e+00 +1344 1508 4.16666666666667e+00 +1344 1582 4.16666666666667e+00 +1344 1583 4.16666666666667e+00 +1344 1437 -6.25000000000000e+00 +1344 1646 -4.16666666666667e+00 +1344 1645 8.33333333333333e+00 +1344 1644 -1.25000000000000e+01 +1344 1506 -6.25000000000000e+00 +1344 1810 4.16666666666667e+00 +1344 1345 -8.33333333333333e+00 +1344 1814 -4.16666666666667e+00 +1344 1507 -2.08333333333333e+00 +1344 1813 2.08333333333333e+00 +1344 1811 4.16666666666667e+00 +1344 1438 -2.08333333333333e+00 +1344 1809 -1.87500000000000e+01 +1344 2426 -4.16666666666667e+00 +1344 2435 4.16666666666667e+00 +1344 2434 4.16666666666667e+00 +1344 2433 -1.87500000000000e+01 +1344 2329 -4.16666666666667e+00 +1344 2330 -4.16666666666667e+00 +1344 2393 4.16666666666667e+00 +1344 2392 -8.33333333333333e+00 +1344 2425 2.08333333333333e+00 +1345 1345 6.25000000000000e+01 +1345 1581 4.16666666666667e+00 +1345 1583 -8.33333333333333e+00 +1345 1439 4.16666666666667e+00 +1345 1438 -6.25000000000000e+00 +1345 1646 8.33333333333333e+00 +1345 1346 -8.33333333333333e+00 +1345 1508 4.16666666666667e+00 +1345 1645 -3.75000000000000e+01 +1345 1507 -6.25000000000000e+00 +1345 1644 8.33333333333333e+00 +1345 1814 2.08333333333333e+00 +1345 1809 4.16666666666667e+00 +1345 1344 -8.33333333333333e+00 +1345 1506 -2.08333333333333e+00 +1345 1812 2.08333333333333e+00 +1345 1811 -2.08333333333333e+00 +1345 1810 -6.25000000000000e+00 +1345 1437 -2.08333333333333e+00 +1345 2426 2.08333333333333e+00 +1345 2435 -2.08333333333333e+00 +1345 2434 -6.25000000000000e+00 +1345 2433 4.16666666666667e+00 +1345 2328 -4.16666666666667e+00 +1345 2330 -4.16666666666667e+00 +1345 2393 4.16666666666667e+00 +1345 2424 2.08333333333333e+00 +1345 2391 -8.33333333333333e+00 +1346 1346 6.25000000000000e+01 +1346 1437 4.16666666666667e+00 +1346 1344 -8.33333333333333e+00 +1346 1506 4.16666666666667e+00 +1346 1439 -1.87500000000000e+01 +1346 1582 -8.33333333333333e+00 +1346 1438 4.16666666666667e+00 +1346 1581 4.16666666666667e+00 +1346 1646 -1.25000000000000e+01 +1346 1508 -1.87500000000000e+01 +1346 1645 8.33333333333333e+00 +1346 1345 -8.33333333333333e+00 +1346 1507 4.16666666666667e+00 +1346 1644 -4.16666666666667e+00 +1346 1813 2.08333333333333e+00 +1346 1812 -4.16666666666667e+00 +1346 1810 -2.08333333333333e+00 +1346 1811 -6.25000000000000e+00 +1346 1809 4.16666666666667e+00 +1346 2424 -4.16666666666667e+00 +1346 2435 -6.25000000000000e+00 +1346 2434 -2.08333333333333e+00 +1346 2433 4.16666666666667e+00 +1346 2329 -4.16666666666667e+00 +1346 2392 4.16666666666667e+00 +1346 2328 -4.16666666666667e+00 +1346 2425 2.08333333333333e+00 +1346 2391 4.16666666666667e+00 +1347 1347 6.25000000000000e+01 +1347 1600 4.16666666666667e+00 +1347 1601 4.16666666666667e+00 +1347 1805 4.16666666666667e+00 +1347 1803 -6.25000000000000e+00 +1347 1817 4.16666666666667e+00 +1347 1816 4.16666666666667e+00 +1347 1348 -8.33333333333333e+00 +1347 1815 -1.87500000000000e+01 +1347 1664 -4.16666666666667e+00 +1347 1349 -8.33333333333333e+00 +1347 1586 -4.16666666666667e+00 +1347 1649 4.16666666666667e+00 +1347 1810 4.16666666666667e+00 +1347 1663 8.33333333333333e+00 +1347 1648 -8.33333333333333e+00 +1347 1811 4.16666666666667e+00 +1347 1442 -4.16666666666667e+00 +1347 1441 2.08333333333333e+00 +1347 1585 -4.16666666666667e+00 +1347 1809 -1.87500000000000e+01 +1347 1820 4.16666666666667e+00 +1347 1523 -4.16666666666667e+00 +1347 1819 -2.08333333333333e+00 +1347 1522 2.08333333333333e+00 +1347 1818 -6.25000000000000e+00 +1347 1804 -2.08333333333333e+00 +1347 1662 -1.25000000000000e+01 +1348 1348 6.25000000000000e+01 +1348 1803 -2.08333333333333e+00 +1348 1599 4.16666666666667e+00 +1348 1601 -8.33333333333333e+00 +1348 1442 2.08333333333333e+00 +1348 1804 -6.25000000000000e+00 +1348 1817 -2.08333333333333e+00 +1348 1523 2.08333333333333e+00 +1348 1816 -6.25000000000000e+00 +1348 1815 4.16666666666667e+00 +1348 1347 -8.33333333333333e+00 +1348 1811 -2.08333333333333e+00 +1348 1809 4.16666666666667e+00 +1348 1586 -4.16666666666667e+00 +1348 1649 4.16666666666667e+00 +1348 1662 8.33333333333333e+00 +1348 1647 -8.33333333333333e+00 +1348 1810 -6.25000000000000e+00 +1348 1440 2.08333333333333e+00 +1348 1584 -4.16666666666667e+00 +1348 1820 4.16666666666667e+00 +1348 1349 -8.33333333333333e+00 +1348 1664 8.33333333333333e+00 +1348 1819 -6.25000000000000e+00 +1348 1805 4.16666666666667e+00 +1348 1663 -3.75000000000000e+01 +1348 1818 -2.08333333333333e+00 +1348 1521 2.08333333333333e+00 +1349 1349 6.25000000000000e+01 +1349 1600 -8.33333333333333e+00 +1349 1599 4.16666666666667e+00 +1349 1805 -1.87500000000000e+01 +1349 1441 2.08333333333333e+00 +1349 1803 4.16666666666667e+00 +1349 1817 -6.25000000000000e+00 +1349 1816 -2.08333333333333e+00 +1349 1522 2.08333333333333e+00 +1349 1815 4.16666666666667e+00 +1349 1662 -4.16666666666667e+00 +1349 1810 -2.08333333333333e+00 +1349 1347 -8.33333333333333e+00 +1349 1584 -4.16666666666667e+00 +1349 1647 4.16666666666667e+00 +1349 1585 -4.16666666666667e+00 +1349 1648 4.16666666666667e+00 +1349 1811 -6.25000000000000e+00 +1349 1809 4.16666666666667e+00 +1349 1440 -4.16666666666667e+00 +1349 1820 -1.87500000000000e+01 +1349 1804 4.16666666666667e+00 +1349 1664 -1.25000000000000e+01 +1349 1819 4.16666666666667e+00 +1349 1348 -8.33333333333333e+00 +1349 1663 8.33333333333333e+00 +1349 1818 4.16666666666667e+00 +1349 1521 -4.16666666666667e+00 +1350 1350 2.50000000000000e+01 +1350 1724 -2.08333333333333e+00 +1350 1825 2.08333333333333e+00 +1350 1822 -2.08333333333333e+00 +1350 1466 2.08333333333333e+00 +1350 1826 -4.16666666666667e+00 +1350 1465 2.08333333333333e+00 +1350 1351 -4.16666666666667e+00 +1350 1723 4.16666666666667e+00 +1350 1464 -6.25000000000000e+00 +1350 1722 -6.25000000000000e+00 +1350 1352 -4.16666666666667e+00 +1350 1454 2.08333333333333e+00 +1350 1823 4.16666666666667e+00 +1350 1453 2.08333333333333e+00 +1350 1705 -4.16666666666667e+00 +1350 1706 2.08333333333333e+00 +1350 1452 -6.25000000000000e+00 +1350 1821 -6.25000000000000e+00 +1351 1351 2.91666666666667e+01 +1351 1724 4.16666666666667e+00 +1351 1823 4.16666666666667e+00 +1351 1824 2.08333333333333e+00 +1351 1821 -2.08333333333333e+00 +1351 1466 -2.08333333333333e+00 +1351 1826 2.08333333333333e+00 +1351 1465 -2.08333333333333e+00 +1351 1723 -1.87500000000000e+01 +1351 1464 2.08333333333333e+00 +1351 1350 -4.16666666666667e+00 +1351 1722 4.16666666666667e+00 +1351 1454 -2.08333333333333e+00 +1351 1706 2.08333333333333e+00 +1351 1352 -8.33333333333333e+00 +1351 1453 -2.08333333333333e+00 +1351 1822 -6.25000000000000e+00 +1351 1452 2.08333333333333e+00 +1351 1704 -4.16666666666667e+00 +1352 1352 2.91666666666667e+01 +1352 1722 -2.08333333333333e+00 +1352 1351 -8.33333333333333e+00 +1352 1723 4.16666666666667e+00 +1352 1822 4.16666666666667e+00 +1352 1466 -2.08333333333333e+00 +1352 1724 -6.25000000000000e+00 +1352 1465 -2.08333333333333e+00 +1352 1825 2.08333333333333e+00 +1352 1464 2.08333333333333e+00 +1352 1824 -4.16666666666667e+00 +1352 1704 2.08333333333333e+00 +1352 1454 -2.08333333333333e+00 +1352 1823 -1.87500000000000e+01 +1352 1453 -2.08333333333333e+00 +1352 1705 2.08333333333333e+00 +1352 1350 -4.16666666666667e+00 +1352 1452 2.08333333333333e+00 +1352 1821 4.16666666666667e+00 +1353 1353 6.25000000000000e+01 +1353 1354 -8.33333333333333e+00 +1353 1832 -4.16666666666667e+00 +1353 1525 -2.08333333333333e+00 +1353 1831 2.08333333333333e+00 +1353 1829 4.16666666666667e+00 +1353 1456 -2.08333333333333e+00 +1353 1827 -1.87500000000000e+01 +1353 1807 2.08333333333333e+00 +1353 1457 4.16666666666667e+00 +1353 1808 -4.16666666666667e+00 +1353 1355 -8.33333333333333e+00 +1353 1817 4.16666666666667e+00 +1353 1526 4.16666666666667e+00 +1353 1816 4.16666666666667e+00 +1353 1815 -1.87500000000000e+01 +1353 1603 -4.16666666666667e+00 +1353 1708 4.16666666666667e+00 +1353 1709 4.16666666666667e+00 +1353 1604 -4.16666666666667e+00 +1353 1455 -6.25000000000000e+00 +1353 1772 -4.16666666666667e+00 +1353 1667 4.16666666666667e+00 +1353 1771 8.33333333333333e+00 +1353 1666 -8.33333333333333e+00 +1353 1770 -1.25000000000000e+01 +1353 1828 4.16666666666667e+00 +1353 1524 -6.25000000000000e+00 +1354 1354 6.25000000000000e+01 +1354 1832 2.08333333333333e+00 +1354 1827 4.16666666666667e+00 +1354 1353 -8.33333333333333e+00 +1354 1524 -2.08333333333333e+00 +1354 1830 2.08333333333333e+00 +1354 1828 -6.25000000000000e+00 +1354 1455 -2.08333333333333e+00 +1354 1806 2.08333333333333e+00 +1354 1808 2.08333333333333e+00 +1354 1817 -2.08333333333333e+00 +1354 1816 -6.25000000000000e+00 +1354 1815 4.16666666666667e+00 +1354 1602 -4.16666666666667e+00 +1354 1707 4.16666666666667e+00 +1354 1604 -4.16666666666667e+00 +1354 1667 4.16666666666667e+00 +1354 1709 -8.33333333333333e+00 +1354 1457 4.16666666666667e+00 +1354 1456 -6.25000000000000e+00 +1354 1772 8.33333333333333e+00 +1354 1355 -8.33333333333333e+00 +1354 1526 4.16666666666667e+00 +1354 1771 -3.75000000000000e+01 +1354 1829 -2.08333333333333e+00 +1354 1525 -6.25000000000000e+00 +1354 1770 8.33333333333333e+00 +1354 1665 -8.33333333333333e+00 +1355 1355 6.25000000000000e+01 +1355 1831 2.08333333333333e+00 +1355 1830 -4.16666666666667e+00 +1355 1829 -6.25000000000000e+00 +1355 1827 4.16666666666667e+00 +1355 1807 2.08333333333333e+00 +1355 1455 4.16666666666667e+00 +1355 1806 -4.16666666666667e+00 +1355 1817 -6.25000000000000e+00 +1355 1816 -2.08333333333333e+00 +1355 1353 -8.33333333333333e+00 +1355 1815 4.16666666666667e+00 +1355 1524 4.16666666666667e+00 +1355 1603 -4.16666666666667e+00 +1355 1666 4.16666666666667e+00 +1355 1457 -1.87500000000000e+01 +1355 1708 -8.33333333333333e+00 +1355 1456 4.16666666666667e+00 +1355 1707 4.16666666666667e+00 +1355 1602 -4.16666666666667e+00 +1355 1772 -1.25000000000000e+01 +1355 1828 -2.08333333333333e+00 +1355 1526 -1.87500000000000e+01 +1355 1771 8.33333333333333e+00 +1355 1354 -8.33333333333333e+00 +1355 1525 4.16666666666667e+00 +1355 1770 -4.16666666666667e+00 +1355 1665 4.16666666666667e+00 +1356 1356 6.25000000000000e+01 +1356 1726 4.16666666666667e+00 +1356 1727 4.16666666666667e+00 +1356 1823 4.16666666666667e+00 +1356 1821 -6.25000000000000e+00 +1356 1835 4.16666666666667e+00 +1356 1834 4.16666666666667e+00 +1356 1357 -8.33333333333333e+00 +1356 1833 -1.87500000000000e+01 +1356 1790 -4.16666666666667e+00 +1356 1358 -8.33333333333333e+00 +1356 1712 -4.16666666666667e+00 +1356 1775 4.16666666666667e+00 +1356 1828 4.16666666666667e+00 +1356 1789 8.33333333333333e+00 +1356 1774 -8.33333333333333e+00 +1356 1829 4.16666666666667e+00 +1356 1460 -4.16666666666667e+00 +1356 1459 2.08333333333333e+00 +1356 1711 -4.16666666666667e+00 +1356 1827 -1.87500000000000e+01 +1356 1838 4.16666666666667e+00 +1356 1544 -4.16666666666667e+00 +1356 1837 -2.08333333333333e+00 +1356 1543 2.08333333333333e+00 +1356 1836 -6.25000000000000e+00 +1356 1822 -2.08333333333333e+00 +1356 1788 -1.25000000000000e+01 +1357 1357 6.25000000000000e+01 +1357 1821 -2.08333333333333e+00 +1357 1725 4.16666666666667e+00 +1357 1727 -8.33333333333333e+00 +1357 1460 2.08333333333333e+00 +1357 1822 -6.25000000000000e+00 +1357 1835 -2.08333333333333e+00 +1357 1544 2.08333333333333e+00 +1357 1834 -6.25000000000000e+00 +1357 1833 4.16666666666667e+00 +1357 1356 -8.33333333333333e+00 +1357 1829 -2.08333333333333e+00 +1357 1827 4.16666666666667e+00 +1357 1712 -4.16666666666667e+00 +1357 1775 4.16666666666667e+00 +1357 1788 8.33333333333333e+00 +1357 1773 -8.33333333333333e+00 +1357 1828 -6.25000000000000e+00 +1357 1458 2.08333333333333e+00 +1357 1710 -4.16666666666667e+00 +1357 1838 4.16666666666667e+00 +1357 1358 -8.33333333333333e+00 +1357 1790 8.33333333333333e+00 +1357 1837 -6.25000000000000e+00 +1357 1823 4.16666666666667e+00 +1357 1789 -3.75000000000000e+01 +1357 1836 -2.08333333333333e+00 +1357 1542 2.08333333333333e+00 +1358 1358 6.25000000000000e+01 +1358 1726 -8.33333333333333e+00 +1358 1725 4.16666666666667e+00 +1358 1823 -1.87500000000000e+01 +1358 1459 2.08333333333333e+00 +1358 1821 4.16666666666667e+00 +1358 1835 -6.25000000000000e+00 +1358 1834 -2.08333333333333e+00 +1358 1543 2.08333333333333e+00 +1358 1833 4.16666666666667e+00 +1358 1788 -4.16666666666667e+00 +1358 1828 -2.08333333333333e+00 +1358 1356 -8.33333333333333e+00 +1358 1710 -4.16666666666667e+00 +1358 1773 4.16666666666667e+00 +1358 1711 -4.16666666666667e+00 +1358 1774 4.16666666666667e+00 +1358 1829 -6.25000000000000e+00 +1358 1827 4.16666666666667e+00 +1358 1458 -4.16666666666667e+00 +1358 1838 -1.87500000000000e+01 +1358 1822 4.16666666666667e+00 +1358 1790 -1.25000000000000e+01 +1358 1837 4.16666666666667e+00 +1358 1357 -8.33333333333333e+00 +1358 1789 8.33333333333333e+00 +1358 1836 4.16666666666667e+00 +1358 1542 -4.16666666666667e+00 +1359 1359 2.50000000000000e+01 +1359 1615 2.08333333333333e+00 +1359 1844 2.08333333333333e+00 +1359 1841 -2.08333333333333e+00 +1359 1472 2.08333333333333e+00 +1359 1616 -4.16666666666667e+00 +1359 1471 2.08333333333333e+00 +1359 1360 -4.16666666666667e+00 +1359 1840 4.16666666666667e+00 +1359 1470 -6.25000000000000e+00 +1359 1839 -6.25000000000000e+00 +1359 1361 -4.16666666666667e+00 +1359 1487 2.08333333333333e+00 +1359 1634 4.16666666666667e+00 +1359 1486 2.08333333333333e+00 +1359 1843 -4.16666666666667e+00 +1359 1633 -2.08333333333333e+00 +1359 1485 -6.25000000000000e+00 +1359 1632 -6.25000000000000e+00 +1360 1360 2.91666666666667e+01 +1360 1614 2.08333333333333e+00 +1360 1634 4.16666666666667e+00 +1360 1361 -8.33333333333333e+00 +1360 1841 4.16666666666667e+00 +1360 1472 -2.08333333333333e+00 +1360 1616 2.08333333333333e+00 +1360 1471 -2.08333333333333e+00 +1360 1840 -1.87500000000000e+01 +1360 1470 2.08333333333333e+00 +1360 1359 -4.16666666666667e+00 +1360 1839 4.16666666666667e+00 +1360 1487 -2.08333333333333e+00 +1360 1844 2.08333333333333e+00 +1360 1632 -2.08333333333333e+00 +1360 1486 -2.08333333333333e+00 +1360 1633 -6.25000000000000e+00 +1360 1485 2.08333333333333e+00 +1360 1842 -4.16666666666667e+00 +1361 1361 2.91666666666667e+01 +1361 1360 -8.33333333333333e+00 +1361 1840 4.16666666666667e+00 +1361 1842 2.08333333333333e+00 +1361 1839 -2.08333333333333e+00 +1361 1472 -2.08333333333333e+00 +1361 1841 -6.25000000000000e+00 +1361 1471 -2.08333333333333e+00 +1361 1615 2.08333333333333e+00 +1361 1470 2.08333333333333e+00 +1361 1614 -4.16666666666667e+00 +1361 1633 4.16666666666667e+00 +1361 1487 -2.08333333333333e+00 +1361 1634 -1.87500000000000e+01 +1361 1486 -2.08333333333333e+00 +1361 1843 2.08333333333333e+00 +1361 1359 -4.16666666666667e+00 +1361 1485 2.08333333333333e+00 +1361 1632 4.16666666666667e+00 +1362 1362 6.25000000000000e+01 +1362 1618 4.16666666666667e+00 +1362 1652 8.33333333333333e+00 +1362 1651 -4.16666666666667e+00 +1362 1650 -1.25000000000000e+01 +1362 1474 4.16666666666667e+00 +1362 1473 -6.25000000000000e+00 +1362 1363 -8.33333333333333e+00 +1362 1510 4.16666666666667e+00 +1362 1619 4.16666666666667e+00 +1362 1509 -6.25000000000000e+00 +1362 1364 -8.33333333333333e+00 +1362 1847 4.16666666666667e+00 +1362 1511 -2.08333333333333e+00 +1362 1850 2.08333333333333e+00 +1362 1849 -4.16666666666667e+00 +1362 1475 -2.08333333333333e+00 +1362 1846 4.16666666666667e+00 +1362 1845 -1.87500000000000e+01 +1362 2366 -4.16666666666667e+00 +1362 2462 2.08333333333333e+00 +1362 2365 -4.16666666666667e+00 +1362 2398 4.16666666666667e+00 +1362 2461 -4.16666666666667e+00 +1362 2471 4.16666666666667e+00 +1362 2399 -8.33333333333333e+00 +1362 2470 4.16666666666667e+00 +1362 2469 -1.87500000000000e+01 +1363 1363 6.25000000000000e+01 +1363 1475 4.16666666666667e+00 +1363 1617 4.16666666666667e+00 +1363 1652 8.33333333333333e+00 +1363 1364 -8.33333333333333e+00 +1363 1511 4.16666666666667e+00 +1363 1651 -1.25000000000000e+01 +1363 1650 -4.16666666666667e+00 +1363 1474 -1.87500000000000e+01 +1363 1473 4.16666666666667e+00 +1363 1619 -8.33333333333333e+00 +1363 1510 -1.87500000000000e+01 +1363 1362 -8.33333333333333e+00 +1363 1509 4.16666666666667e+00 +1363 1850 2.08333333333333e+00 +1363 1847 -2.08333333333333e+00 +1363 1848 -4.16666666666667e+00 +1363 1846 -6.25000000000000e+00 +1363 1845 4.16666666666667e+00 +1363 2364 -4.16666666666667e+00 +1363 2397 4.16666666666667e+00 +1363 2462 2.08333333333333e+00 +1363 2366 -4.16666666666667e+00 +1363 2460 -4.16666666666667e+00 +1363 2471 -2.08333333333333e+00 +1363 2399 4.16666666666667e+00 +1363 2470 -6.25000000000000e+00 +1363 2469 4.16666666666667e+00 +1364 1364 6.25000000000000e+01 +1364 1618 -8.33333333333333e+00 +1364 1474 4.16666666666667e+00 +1364 1652 -3.75000000000000e+01 +1364 1651 8.33333333333333e+00 +1364 1363 -8.33333333333333e+00 +1364 1510 4.16666666666667e+00 +1364 1650 8.33333333333333e+00 +1364 1475 -6.25000000000000e+00 +1364 1617 4.16666666666667e+00 +1364 1511 -6.25000000000000e+00 +1364 1846 -2.08333333333333e+00 +1364 1362 -8.33333333333333e+00 +1364 1845 4.16666666666667e+00 +1364 1509 -2.08333333333333e+00 +1364 1848 2.08333333333333e+00 +1364 1849 2.08333333333333e+00 +1364 1847 -6.25000000000000e+00 +1364 1473 -2.08333333333333e+00 +1364 2364 -4.16666666666667e+00 +1364 2460 2.08333333333333e+00 +1364 2461 2.08333333333333e+00 +1364 2365 -4.16666666666667e+00 +1364 2471 -6.25000000000000e+00 +1364 2470 -2.08333333333333e+00 +1364 2398 4.16666666666667e+00 +1364 2469 4.16666666666667e+00 +1364 2397 -8.33333333333333e+00 +1365 1365 6.25000000000000e+01 +1365 1655 -8.33333333333333e+00 +1365 1654 4.16666666666667e+00 +1365 1478 2.08333333333333e+00 +1365 1846 4.16666666666667e+00 +1365 1845 -1.87500000000000e+01 +1365 1856 -2.08333333333333e+00 +1365 1529 2.08333333333333e+00 +1365 1855 4.16666666666667e+00 +1365 1854 -6.25000000000000e+00 +1365 1622 -4.16666666666667e+00 +1365 1621 -4.16666666666667e+00 +1365 1637 4.16666666666667e+00 +1365 1841 -2.08333333333333e+00 +1365 1366 -8.33333333333333e+00 +1365 1636 4.16666666666667e+00 +1365 1669 -4.16666666666667e+00 +1365 1477 -4.16666666666667e+00 +1365 1840 4.16666666666667e+00 +1365 1839 -6.25000000000000e+00 +1365 1367 -8.33333333333333e+00 +1365 1853 4.16666666666667e+00 +1365 1670 8.33333333333333e+00 +1365 1852 4.16666666666667e+00 +1365 1528 -4.16666666666667e+00 +1365 1847 4.16666666666667e+00 +1365 1851 -1.87500000000000e+01 +1365 1668 -1.25000000000000e+01 +1366 1366 6.25000000000000e+01 +1366 1655 4.16666666666667e+00 +1366 1653 4.16666666666667e+00 +1366 1846 -6.25000000000000e+00 +1366 1845 4.16666666666667e+00 +1366 1856 4.16666666666667e+00 +1366 1367 -8.33333333333333e+00 +1366 1855 -1.87500000000000e+01 +1366 1854 4.16666666666667e+00 +1366 1620 -4.16666666666667e+00 +1366 1841 4.16666666666667e+00 +1366 1365 -8.33333333333333e+00 +1366 1637 -8.33333333333333e+00 +1366 1670 8.33333333333333e+00 +1366 1635 4.16666666666667e+00 +1366 1668 -4.16666666666667e+00 +1366 1478 2.08333333333333e+00 +1366 1622 -4.16666666666667e+00 +1366 1840 -1.87500000000000e+01 +1366 1476 -4.16666666666667e+00 +1366 1839 4.16666666666667e+00 +1366 1853 -2.08333333333333e+00 +1366 1529 2.08333333333333e+00 +1366 1847 -2.08333333333333e+00 +1366 1852 -6.25000000000000e+00 +1366 1669 -1.25000000000000e+01 +1366 1851 4.16666666666667e+00 +1366 1527 -4.16666666666667e+00 +1367 1367 6.25000000000000e+01 +1367 1654 4.16666666666667e+00 +1367 1845 4.16666666666667e+00 +1367 1653 -8.33333333333333e+00 +1367 1847 -6.25000000000000e+00 +1367 1476 2.08333333333333e+00 +1367 1856 -6.25000000000000e+00 +1367 1855 4.16666666666667e+00 +1367 1366 -8.33333333333333e+00 +1367 1854 -2.08333333333333e+00 +1367 1527 2.08333333333333e+00 +1367 1620 -4.16666666666667e+00 +1367 1840 4.16666666666667e+00 +1367 1635 4.16666666666667e+00 +1367 1839 -2.08333333333333e+00 +1367 1636 -8.33333333333333e+00 +1367 1669 8.33333333333333e+00 +1367 1841 -6.25000000000000e+00 +1367 1477 2.08333333333333e+00 +1367 1621 -4.16666666666667e+00 +1367 1846 -2.08333333333333e+00 +1367 1853 -6.25000000000000e+00 +1367 1670 -3.75000000000000e+01 +1367 1852 -2.08333333333333e+00 +1367 1528 2.08333333333333e+00 +1367 1365 -8.33333333333333e+00 +1367 1851 4.16666666666667e+00 +1367 1668 8.33333333333333e+00 +1368 1368 2.50000000000000e+01 +1368 1741 2.08333333333333e+00 +1368 1862 2.08333333333333e+00 +1368 1859 -2.08333333333333e+00 +1368 1490 2.08333333333333e+00 +1368 1742 -4.16666666666667e+00 +1368 1489 2.08333333333333e+00 +1368 1369 -4.16666666666667e+00 +1368 1858 4.16666666666667e+00 +1368 1488 -6.25000000000000e+00 +1368 1857 -6.25000000000000e+00 +1368 1370 -4.16666666666667e+00 +1368 1502 2.08333333333333e+00 +1368 1760 4.16666666666667e+00 +1368 1501 2.08333333333333e+00 +1368 1861 -4.16666666666667e+00 +1368 1759 -2.08333333333333e+00 +1368 1500 -6.25000000000000e+00 +1368 1758 -6.25000000000000e+00 +1369 1369 2.91666666666667e+01 +1369 1740 2.08333333333333e+00 +1369 1760 4.16666666666667e+00 +1369 1370 -8.33333333333333e+00 +1369 1859 4.16666666666667e+00 +1369 1490 -2.08333333333333e+00 +1369 1742 2.08333333333333e+00 +1369 1489 -2.08333333333333e+00 +1369 1858 -1.87500000000000e+01 +1369 1488 2.08333333333333e+00 +1369 1368 -4.16666666666667e+00 +1369 1857 4.16666666666667e+00 +1369 1502 -2.08333333333333e+00 +1369 1862 2.08333333333333e+00 +1369 1758 -2.08333333333333e+00 +1369 1501 -2.08333333333333e+00 +1369 1759 -6.25000000000000e+00 +1369 1500 2.08333333333333e+00 +1369 1860 -4.16666666666667e+00 +1370 1370 2.91666666666667e+01 +1370 1369 -8.33333333333333e+00 +1370 1858 4.16666666666667e+00 +1370 1860 2.08333333333333e+00 +1370 1857 -2.08333333333333e+00 +1370 1490 -2.08333333333333e+00 +1370 1859 -6.25000000000000e+00 +1370 1489 -2.08333333333333e+00 +1370 1741 2.08333333333333e+00 +1370 1488 2.08333333333333e+00 +1370 1740 -4.16666666666667e+00 +1370 1759 4.16666666666667e+00 +1370 1502 -2.08333333333333e+00 +1370 1760 -1.87500000000000e+01 +1370 1501 -2.08333333333333e+00 +1370 1861 2.08333333333333e+00 +1370 1368 -4.16666666666667e+00 +1370 1500 2.08333333333333e+00 +1370 1758 4.16666666666667e+00 +1371 1371 6.25000000000000e+01 +1371 1865 4.16666666666667e+00 +1371 1532 -2.08333333333333e+00 +1371 1868 2.08333333333333e+00 +1371 1867 -4.16666666666667e+00 +1371 1493 -2.08333333333333e+00 +1371 1864 4.16666666666667e+00 +1371 1863 -1.87500000000000e+01 +1371 1745 4.16666666666667e+00 +1371 1744 4.16666666666667e+00 +1371 1778 8.33333333333333e+00 +1371 1777 -4.16666666666667e+00 +1371 1776 -1.25000000000000e+01 +1371 1640 -4.16666666666667e+00 +1371 1844 2.08333333333333e+00 +1371 1639 -4.16666666666667e+00 +1371 1672 4.16666666666667e+00 +1371 1843 -4.16666666666667e+00 +1371 1492 4.16666666666667e+00 +1371 1491 -6.25000000000000e+00 +1371 1853 4.16666666666667e+00 +1371 1673 -8.33333333333333e+00 +1371 1852 4.16666666666667e+00 +1371 1372 -8.33333333333333e+00 +1371 1531 4.16666666666667e+00 +1371 1851 -1.87500000000000e+01 +1371 1373 -8.33333333333333e+00 +1371 1530 -6.25000000000000e+00 +1372 1372 6.25000000000000e+01 +1372 1865 -2.08333333333333e+00 +1372 1866 -4.16666666666667e+00 +1372 1864 -6.25000000000000e+00 +1372 1863 4.16666666666667e+00 +1372 1745 -8.33333333333333e+00 +1372 1493 4.16666666666667e+00 +1372 1743 4.16666666666667e+00 +1372 1778 8.33333333333333e+00 +1372 1373 -8.33333333333333e+00 +1372 1532 4.16666666666667e+00 +1372 1777 -1.25000000000000e+01 +1372 1776 -4.16666666666667e+00 +1372 1638 -4.16666666666667e+00 +1372 1671 4.16666666666667e+00 +1372 1844 2.08333333333333e+00 +1372 1640 -4.16666666666667e+00 +1372 1492 -1.87500000000000e+01 +1372 1842 -4.16666666666667e+00 +1372 1491 4.16666666666667e+00 +1372 1853 -2.08333333333333e+00 +1372 1673 4.16666666666667e+00 +1372 1852 -6.25000000000000e+00 +1372 1868 2.08333333333333e+00 +1372 1531 -1.87500000000000e+01 +1372 1851 4.16666666666667e+00 +1372 1371 -8.33333333333333e+00 +1372 1530 4.16666666666667e+00 +1373 1373 6.25000000000000e+01 +1373 1864 -2.08333333333333e+00 +1373 1371 -8.33333333333333e+00 +1373 1863 4.16666666666667e+00 +1373 1530 -2.08333333333333e+00 +1373 1866 2.08333333333333e+00 +1373 1865 -6.25000000000000e+00 +1373 1491 -2.08333333333333e+00 +1373 1743 4.16666666666667e+00 +1373 1744 -8.33333333333333e+00 +1373 1492 4.16666666666667e+00 +1373 1778 -3.75000000000000e+01 +1373 1777 8.33333333333333e+00 +1373 1372 -8.33333333333333e+00 +1373 1531 4.16666666666667e+00 +1373 1776 8.33333333333333e+00 +1373 1638 -4.16666666666667e+00 +1373 1842 2.08333333333333e+00 +1373 1493 -6.25000000000000e+00 +1373 1843 2.08333333333333e+00 +1373 1639 -4.16666666666667e+00 +1373 1853 -6.25000000000000e+00 +1373 1867 2.08333333333333e+00 +1373 1532 -6.25000000000000e+00 +1373 1852 -2.08333333333333e+00 +1373 1672 4.16666666666667e+00 +1373 1851 4.16666666666667e+00 +1373 1671 -8.33333333333333e+00 +1374 1374 6.25000000000000e+01 +1374 1781 -8.33333333333333e+00 +1374 1780 4.16666666666667e+00 +1374 1496 2.08333333333333e+00 +1374 1864 4.16666666666667e+00 +1374 1863 -1.87500000000000e+01 +1374 1874 -2.08333333333333e+00 +1374 1547 2.08333333333333e+00 +1374 1873 4.16666666666667e+00 +1374 1872 -6.25000000000000e+00 +1374 1748 -4.16666666666667e+00 +1374 1747 -4.16666666666667e+00 +1374 1763 4.16666666666667e+00 +1374 1859 -2.08333333333333e+00 +1374 1375 -8.33333333333333e+00 +1374 1762 4.16666666666667e+00 +1374 1795 -4.16666666666667e+00 +1374 1495 -4.16666666666667e+00 +1374 1858 4.16666666666667e+00 +1374 1857 -6.25000000000000e+00 +1374 1376 -8.33333333333333e+00 +1374 1871 4.16666666666667e+00 +1374 1796 8.33333333333333e+00 +1374 1870 4.16666666666667e+00 +1374 1546 -4.16666666666667e+00 +1374 1865 4.16666666666667e+00 +1374 1869 -1.87500000000000e+01 +1374 1794 -1.25000000000000e+01 +1375 1375 6.25000000000000e+01 +1375 1781 4.16666666666667e+00 +1375 1779 4.16666666666667e+00 +1375 1864 -6.25000000000000e+00 +1375 1863 4.16666666666667e+00 +1375 1874 4.16666666666667e+00 +1375 1376 -8.33333333333333e+00 +1375 1873 -1.87500000000000e+01 +1375 1872 4.16666666666667e+00 +1375 1746 -4.16666666666667e+00 +1375 1859 4.16666666666667e+00 +1375 1374 -8.33333333333333e+00 +1375 1763 -8.33333333333333e+00 +1375 1796 8.33333333333333e+00 +1375 1761 4.16666666666667e+00 +1375 1794 -4.16666666666667e+00 +1375 1496 2.08333333333333e+00 +1375 1748 -4.16666666666667e+00 +1375 1858 -1.87500000000000e+01 +1375 1494 -4.16666666666667e+00 +1375 1857 4.16666666666667e+00 +1375 1871 -2.08333333333333e+00 +1375 1547 2.08333333333333e+00 +1375 1865 -2.08333333333333e+00 +1375 1870 -6.25000000000000e+00 +1375 1795 -1.25000000000000e+01 +1375 1869 4.16666666666667e+00 +1375 1545 -4.16666666666667e+00 +1376 1376 6.25000000000000e+01 +1376 1780 4.16666666666667e+00 +1376 1863 4.16666666666667e+00 +1376 1779 -8.33333333333333e+00 +1376 1865 -6.25000000000000e+00 +1376 1494 2.08333333333333e+00 +1376 1874 -6.25000000000000e+00 +1376 1873 4.16666666666667e+00 +1376 1375 -8.33333333333333e+00 +1376 1872 -2.08333333333333e+00 +1376 1545 2.08333333333333e+00 +1376 1746 -4.16666666666667e+00 +1376 1858 4.16666666666667e+00 +1376 1761 4.16666666666667e+00 +1376 1857 -2.08333333333333e+00 +1376 1762 -8.33333333333333e+00 +1376 1795 8.33333333333333e+00 +1376 1859 -6.25000000000000e+00 +1376 1495 2.08333333333333e+00 +1376 1747 -4.16666666666667e+00 +1376 1864 -2.08333333333333e+00 +1376 1871 -6.25000000000000e+00 +1376 1796 -3.75000000000000e+01 +1376 1870 -2.08333333333333e+00 +1376 1546 2.08333333333333e+00 +1376 1374 -8.33333333333333e+00 +1376 1869 4.16666666666667e+00 +1376 1794 8.33333333333333e+00 +1377 1377 3.75000000000000e+01 +1377 1814 -4.16666666666667e+00 +1377 1813 2.08333333333333e+00 +1377 1379 -4.16666666666667e+00 +1377 1820 4.16666666666667e+00 +1377 1535 2.08333333333333e+00 +1377 1819 -2.08333333333333e+00 +1377 1818 -6.25000000000000e+00 +1377 1657 -4.16666666666667e+00 +1377 1675 4.16666666666667e+00 +1377 1850 2.08333333333333e+00 +1377 1658 -4.16666666666667e+00 +1377 1513 2.08333333333333e+00 +1377 1849 -4.16666666666667e+00 +1377 1512 -1.25000000000000e+01 +1377 1856 -2.08333333333333e+00 +1377 1676 4.16666666666667e+00 +1377 1378 -4.16666666666667e+00 +1377 1855 4.16666666666667e+00 +1377 1534 2.08333333333333e+00 +1377 1514 2.08333333333333e+00 +1377 1854 -6.25000000000000e+00 +1377 1533 -1.25000000000000e+01 +1378 1378 3.33333333333333e+01 +1378 1812 2.08333333333333e+00 +1378 1820 4.16666666666667e+00 +1378 1819 -6.25000000000000e+00 +1378 1818 -2.08333333333333e+00 +1378 1850 2.08333333333333e+00 +1378 1658 -4.16666666666667e+00 +1378 1656 -4.16666666666667e+00 +1378 1674 4.16666666666667e+00 +1378 1513 -4.16666666666667e+00 +1378 1512 2.08333333333333e+00 +1378 1848 -4.16666666666667e+00 +1378 1856 4.16666666666667e+00 +1378 1676 -8.33333333333333e+00 +1378 1814 2.08333333333333e+00 +1378 1855 -1.87500000000000e+01 +1378 1534 -4.16666666666667e+00 +1378 1377 -4.16666666666667e+00 +1378 1854 4.16666666666667e+00 +1378 1533 2.08333333333333e+00 +1379 1379 3.33333333333333e+01 +1379 1512 2.08333333333333e+00 +1379 1812 -4.16666666666667e+00 +1379 1820 -1.87500000000000e+01 +1379 1819 4.16666666666667e+00 +1379 1377 -4.16666666666667e+00 +1379 1818 4.16666666666667e+00 +1379 1533 2.08333333333333e+00 +1379 1849 2.08333333333333e+00 +1379 1657 -4.16666666666667e+00 +1379 1514 -4.16666666666667e+00 +1379 1848 2.08333333333333e+00 +1379 1656 -4.16666666666667e+00 +1379 1813 2.08333333333333e+00 +1379 1856 -6.25000000000000e+00 +1379 1535 -4.16666666666667e+00 +1379 1855 4.16666666666667e+00 +1379 1675 -8.33333333333333e+00 +1379 1854 -2.08333333333333e+00 +1379 1674 4.16666666666667e+00 +1380 1380 3.75000000000000e+01 +1380 1832 -4.16666666666667e+00 +1380 1831 2.08333333333333e+00 +1380 1382 -4.16666666666667e+00 +1380 1838 4.16666666666667e+00 +1380 1550 2.08333333333333e+00 +1380 1837 -2.08333333333333e+00 +1380 1836 -6.25000000000000e+00 +1380 1783 -4.16666666666667e+00 +1380 1801 4.16666666666667e+00 +1380 1868 2.08333333333333e+00 +1380 1784 -4.16666666666667e+00 +1380 1537 2.08333333333333e+00 +1380 1867 -4.16666666666667e+00 +1380 1536 -1.25000000000000e+01 +1380 1874 -2.08333333333333e+00 +1380 1802 4.16666666666667e+00 +1380 1381 -4.16666666666667e+00 +1380 1873 4.16666666666667e+00 +1380 1549 2.08333333333333e+00 +1380 1538 2.08333333333333e+00 +1380 1872 -6.25000000000000e+00 +1380 1548 -1.25000000000000e+01 +1381 1381 3.33333333333333e+01 +1381 1830 2.08333333333333e+00 +1381 1838 4.16666666666667e+00 +1381 1837 -6.25000000000000e+00 +1381 1836 -2.08333333333333e+00 +1381 1868 2.08333333333333e+00 +1381 1784 -4.16666666666667e+00 +1381 1782 -4.16666666666667e+00 +1381 1800 4.16666666666667e+00 +1381 1537 -4.16666666666667e+00 +1381 1536 2.08333333333333e+00 +1381 1866 -4.16666666666667e+00 +1381 1874 4.16666666666667e+00 +1381 1802 -8.33333333333333e+00 +1381 1832 2.08333333333333e+00 +1381 1873 -1.87500000000000e+01 +1381 1549 -4.16666666666667e+00 +1381 1380 -4.16666666666667e+00 +1381 1872 4.16666666666667e+00 +1381 1548 2.08333333333333e+00 +1382 1382 3.33333333333333e+01 +1382 1536 2.08333333333333e+00 +1382 1830 -4.16666666666667e+00 +1382 1838 -1.87500000000000e+01 +1382 1837 4.16666666666667e+00 +1382 1380 -4.16666666666667e+00 +1382 1836 4.16666666666667e+00 +1382 1548 2.08333333333333e+00 +1382 1867 2.08333333333333e+00 +1382 1783 -4.16666666666667e+00 +1382 1538 -4.16666666666667e+00 +1382 1866 2.08333333333333e+00 +1382 1782 -4.16666666666667e+00 +1382 1831 2.08333333333333e+00 +1382 1874 -6.25000000000000e+00 +1382 1550 -4.16666666666667e+00 +1382 1873 4.16666666666667e+00 +1382 1801 -8.33333333333333e+00 +1382 1872 -2.08333333333333e+00 +1382 1800 4.16666666666667e+00 +1383 1383 3.75000000000000e+01 +1383 1300 2.08333333333333e+00 +1383 1552 -4.16666666666667e+00 +1383 1391 -2.08333333333333e+00 +1383 1384 -4.16666666666667e+00 +1383 1390 4.16666666666667e+00 +1383 1276 2.08333333333333e+00 +1383 1389 -6.25000000000000e+00 +1383 1559 -4.16666666666667e+00 +1383 1403 4.16666666666667e+00 +1383 1301 2.08333333333333e+00 +1383 1556 -4.16666666666667e+00 +1383 1555 2.08333333333333e+00 +1383 1558 -4.16666666666667e+00 +1383 1299 -1.25000000000000e+01 +1383 1385 -4.16666666666667e+00 +1383 1397 4.16666666666667e+00 +1383 1277 2.08333333333333e+00 +1383 1396 -2.08333333333333e+00 +1383 1402 4.16666666666667e+00 +1383 1553 2.08333333333333e+00 +1383 1395 -6.25000000000000e+00 +1383 1275 -1.25000000000000e+01 +1384 1384 3.33333333333333e+01 +1384 1299 2.08333333333333e+00 +1384 1551 -4.16666666666667e+00 +1384 1391 4.16666666666667e+00 +1384 1390 -1.87500000000000e+01 +1384 1383 -4.16666666666667e+00 +1384 1389 4.16666666666667e+00 +1384 1275 2.08333333333333e+00 +1384 1556 2.08333333333333e+00 +1384 1559 -4.16666666666667e+00 +1384 1300 -4.16666666666667e+00 +1384 1554 2.08333333333333e+00 +1384 1557 -4.16666666666667e+00 +1384 1397 4.16666666666667e+00 +1384 1403 -8.33333333333333e+00 +1384 1553 2.08333333333333e+00 +1384 1396 -6.25000000000000e+00 +1384 1276 -4.16666666666667e+00 +1384 1395 -2.08333333333333e+00 +1384 1401 4.16666666666667e+00 +1385 1385 3.33333333333333e+01 +1385 1551 2.08333333333333e+00 +1385 1391 -6.25000000000000e+00 +1385 1390 4.16666666666667e+00 +1385 1389 -2.08333333333333e+00 +1385 1555 2.08333333333333e+00 +1385 1558 -4.16666666666667e+00 +1385 1557 -4.16666666666667e+00 +1385 1401 4.16666666666667e+00 +1385 1301 -4.16666666666667e+00 +1385 1299 2.08333333333333e+00 +1385 1554 -4.16666666666667e+00 +1385 1552 2.08333333333333e+00 +1385 1397 -1.87500000000000e+01 +1385 1277 -4.16666666666667e+00 +1385 1396 4.16666666666667e+00 +1385 1402 -8.33333333333333e+00 +1385 1383 -4.16666666666667e+00 +1385 1395 4.16666666666667e+00 +1385 1275 2.08333333333333e+00 +1386 1386 6.25000000000000e+01 +1386 1388 -8.33333333333333e+00 +1386 1400 8.33333333333333e+00 +1386 1573 4.16666666666667e+00 +1386 1399 -4.16666666666667e+00 +1386 1277 -2.08333333333333e+00 +1386 1276 4.16666666666667e+00 +1386 1275 -6.25000000000000e+00 +1386 1398 -1.25000000000000e+01 +1386 1304 -2.08333333333333e+00 +1386 1574 4.16666666666667e+00 +1386 1387 -8.33333333333333e+00 +1386 1303 4.16666666666667e+00 +1386 1302 -6.25000000000000e+00 +1386 1570 -4.16666666666667e+00 +1386 1391 4.16666666666667e+00 +1386 1390 4.16666666666667e+00 +1386 1389 -1.87500000000000e+01 +1386 1577 -4.16666666666667e+00 +1386 1576 -4.16666666666667e+00 +1386 1403 -8.33333333333333e+00 +1386 1402 4.16666666666667e+00 +1386 1571 2.08333333333333e+00 +1386 2030 2.08333333333333e+00 +1386 2029 -4.16666666666667e+00 +1386 2287 4.16666666666667e+00 +1386 2288 4.16666666666667e+00 +1386 2286 -1.87500000000000e+01 +1387 1387 6.25000000000000e+01 +1387 1572 4.16666666666667e+00 +1387 1398 -4.16666666666667e+00 +1387 1277 4.16666666666667e+00 +1387 1388 -8.33333333333333e+00 +1387 1400 8.33333333333333e+00 +1387 1276 -1.87500000000000e+01 +1387 1399 -1.25000000000000e+01 +1387 1275 4.16666666666667e+00 +1387 1304 4.16666666666667e+00 +1387 1574 -8.33333333333333e+00 +1387 1303 -1.87500000000000e+01 +1387 1386 -8.33333333333333e+00 +1387 1302 4.16666666666667e+00 +1387 1569 -4.16666666666667e+00 +1387 1391 -2.08333333333333e+00 +1387 1390 -6.25000000000000e+00 +1387 1389 4.16666666666667e+00 +1387 1577 -4.16666666666667e+00 +1387 1403 4.16666666666667e+00 +1387 1575 -4.16666666666667e+00 +1387 1571 2.08333333333333e+00 +1387 1401 4.16666666666667e+00 +1387 2030 2.08333333333333e+00 +1387 2028 -4.16666666666667e+00 +1387 2288 -2.08333333333333e+00 +1387 2287 -6.25000000000000e+00 +1387 2286 4.16666666666667e+00 +1388 1388 6.25000000000000e+01 +1388 1386 -8.33333333333333e+00 +1388 1398 8.33333333333333e+00 +1388 1277 -6.25000000000000e+00 +1388 1400 -3.75000000000000e+01 +1388 1276 4.16666666666667e+00 +1388 1387 -8.33333333333333e+00 +1388 1399 8.33333333333333e+00 +1388 1275 -2.08333333333333e+00 +1388 1304 -6.25000000000000e+00 +1388 1303 4.16666666666667e+00 +1388 1573 -8.33333333333333e+00 +1388 1302 -2.08333333333333e+00 +1388 1572 4.16666666666667e+00 +1388 1570 2.08333333333333e+00 +1388 1391 -6.25000000000000e+00 +1388 1390 -2.08333333333333e+00 +1388 1389 4.16666666666667e+00 +1388 1575 -4.16666666666667e+00 +1388 1576 -4.16666666666667e+00 +1388 1402 4.16666666666667e+00 +1388 1569 2.08333333333333e+00 +1388 1401 -8.33333333333333e+00 +1388 2029 2.08333333333333e+00 +1388 2286 4.16666666666667e+00 +1388 2028 2.08333333333333e+00 +1388 2287 -2.08333333333333e+00 +1388 2288 -6.25000000000000e+00 +1389 1389 6.25000000000000e+01 +1389 1576 4.16666666666667e+00 +1389 1577 4.16666666666667e+00 +1389 1570 4.16666666666667e+00 +1389 1569 -6.25000000000000e+00 +1389 1391 -8.33333333333333e+00 +1389 1388 4.16666666666667e+00 +1389 1387 4.16666666666667e+00 +1389 1386 -1.87500000000000e+01 +1389 1402 -4.16666666666667e+00 +1389 1390 -8.33333333333333e+00 +1389 1553 4.16666666666667e+00 +1389 1588 -4.16666666666667e+00 +1389 1558 4.16666666666667e+00 +1389 1403 8.33333333333333e+00 +1389 1559 -8.33333333333333e+00 +1389 1307 2.08333333333333e+00 +1389 1589 -4.16666666666667e+00 +1389 1552 4.16666666666667e+00 +1389 1306 -4.16666666666667e+00 +1389 1551 -1.87500000000000e+01 +1389 1385 -2.08333333333333e+00 +1389 1277 2.08333333333333e+00 +1389 1384 4.16666666666667e+00 +1389 1276 -4.16666666666667e+00 +1389 1383 -6.25000000000000e+00 +1389 1571 -2.08333333333333e+00 +1389 1401 -1.25000000000000e+01 +1390 1390 6.25000000000000e+01 +1390 1575 4.16666666666667e+00 +1390 1577 -8.33333333333333e+00 +1390 1307 2.08333333333333e+00 +1390 1570 -1.87500000000000e+01 +1390 1569 4.16666666666667e+00 +1390 1388 -2.08333333333333e+00 +1390 1277 2.08333333333333e+00 +1390 1387 -6.25000000000000e+00 +1390 1386 4.16666666666667e+00 +1390 1401 -4.16666666666667e+00 +1390 1553 -2.08333333333333e+00 +1390 1389 -8.33333333333333e+00 +1390 1587 -4.16666666666667e+00 +1390 1557 4.16666666666667e+00 +1390 1589 -4.16666666666667e+00 +1390 1559 4.16666666666667e+00 +1390 1552 -6.25000000000000e+00 +1390 1551 4.16666666666667e+00 +1390 1305 -4.16666666666667e+00 +1390 1385 4.16666666666667e+00 +1390 1391 -8.33333333333333e+00 +1390 1403 8.33333333333333e+00 +1390 1384 -1.87500000000000e+01 +1390 1571 4.16666666666667e+00 +1390 1402 -1.25000000000000e+01 +1390 1383 4.16666666666667e+00 +1390 1275 -4.16666666666667e+00 +1391 1391 6.25000000000000e+01 +1391 1570 4.16666666666667e+00 +1391 1576 -8.33333333333333e+00 +1391 1575 4.16666666666667e+00 +1391 1571 -6.25000000000000e+00 +1391 1306 2.08333333333333e+00 +1391 1388 -6.25000000000000e+00 +1391 1387 -2.08333333333333e+00 +1391 1276 2.08333333333333e+00 +1391 1389 -8.33333333333333e+00 +1391 1386 4.16666666666667e+00 +1391 1552 -2.08333333333333e+00 +1391 1551 4.16666666666667e+00 +1391 1588 -4.16666666666667e+00 +1391 1558 4.16666666666667e+00 +1391 1401 8.33333333333333e+00 +1391 1557 -8.33333333333333e+00 +1391 1553 -6.25000000000000e+00 +1391 1305 2.08333333333333e+00 +1391 1587 -4.16666666666667e+00 +1391 1385 -6.25000000000000e+00 +1391 1569 -2.08333333333333e+00 +1391 1403 -3.75000000000000e+01 +1391 1384 4.16666666666667e+00 +1391 1390 -8.33333333333333e+00 +1391 1402 8.33333333333333e+00 +1391 1383 -2.08333333333333e+00 +1391 1275 2.08333333333333e+00 +1392 1392 6.25000000000000e+01 +1392 1400 -4.16666666666667e+00 +1392 1393 -8.33333333333333e+00 +1392 1399 8.33333333333333e+00 +1392 1277 4.16666666666667e+00 +1392 1276 -2.08333333333333e+00 +1392 1275 -6.25000000000000e+00 +1392 1398 -1.25000000000000e+01 +1392 1394 -8.33333333333333e+00 +1392 1310 4.16666666666667e+00 +1392 1309 -2.08333333333333e+00 +1392 1609 4.16666666666667e+00 +1392 1610 4.16666666666667e+00 +1392 1308 -6.25000000000000e+00 +1392 1403 4.16666666666667e+00 +1392 1613 -4.16666666666667e+00 +1392 1606 2.08333333333333e+00 +1392 1612 -4.16666666666667e+00 +1392 1607 -4.16666666666667e+00 +1392 1397 4.16666666666667e+00 +1392 1396 4.16666666666667e+00 +1392 1402 -8.33333333333333e+00 +1392 1395 -1.87500000000000e+01 +1392 2290 4.16666666666667e+00 +1392 2030 -4.16666666666667e+00 +1392 2029 2.08333333333333e+00 +1392 2291 4.16666666666667e+00 +1392 2289 -1.87500000000000e+01 +1393 1393 6.25000000000000e+01 +1393 1392 -8.33333333333333e+00 +1393 1398 8.33333333333333e+00 +1393 1277 4.16666666666667e+00 +1393 1394 -8.33333333333333e+00 +1393 1400 8.33333333333333e+00 +1393 1276 -6.25000000000000e+00 +1393 1399 -3.75000000000000e+01 +1393 1275 -2.08333333333333e+00 +1393 1310 4.16666666666667e+00 +1393 1610 -8.33333333333333e+00 +1393 1309 -6.25000000000000e+00 +1393 1308 -2.08333333333333e+00 +1393 1608 4.16666666666667e+00 +1393 1605 2.08333333333333e+00 +1393 1611 -4.16666666666667e+00 +1393 1607 2.08333333333333e+00 +1393 1613 -4.16666666666667e+00 +1393 1397 -2.08333333333333e+00 +1393 1403 4.16666666666667e+00 +1393 1396 -6.25000000000000e+00 +1393 1395 4.16666666666667e+00 +1393 1401 -8.33333333333333e+00 +1393 2291 -2.08333333333333e+00 +1393 2289 4.16666666666667e+00 +1393 2028 2.08333333333333e+00 +1393 2030 2.08333333333333e+00 +1393 2290 -6.25000000000000e+00 +1394 1394 6.25000000000000e+01 +1394 1398 -4.16666666666667e+00 +1394 1277 -1.87500000000000e+01 +1394 1400 -1.25000000000000e+01 +1394 1276 4.16666666666667e+00 +1394 1393 -8.33333333333333e+00 +1394 1399 8.33333333333333e+00 +1394 1275 4.16666666666667e+00 +1394 1608 4.16666666666667e+00 +1394 1310 -1.87500000000000e+01 +1394 1309 4.16666666666667e+00 +1394 1609 -8.33333333333333e+00 +1394 1392 -8.33333333333333e+00 +1394 1308 4.16666666666667e+00 +1394 1401 4.16666666666667e+00 +1394 1611 -4.16666666666667e+00 +1394 1606 2.08333333333333e+00 +1394 1612 -4.16666666666667e+00 +1394 1605 -4.16666666666667e+00 +1394 1397 -6.25000000000000e+00 +1394 1396 -2.08333333333333e+00 +1394 1402 4.16666666666667e+00 +1394 1395 4.16666666666667e+00 +1394 2029 2.08333333333333e+00 +1394 2290 -2.08333333333333e+00 +1394 2028 -4.16666666666667e+00 +1394 2291 -6.25000000000000e+00 +1394 2289 4.16666666666667e+00 +1395 1395 6.25000000000000e+01 +1395 1559 4.16666666666667e+00 +1395 1558 -8.33333333333333e+00 +1395 1556 4.16666666666667e+00 +1395 1312 2.08333333333333e+00 +1395 1554 -1.87500000000000e+01 +1395 1385 4.16666666666667e+00 +1395 1384 -2.08333333333333e+00 +1395 1276 2.08333333333333e+00 +1395 1383 -6.25000000000000e+00 +1395 1403 -4.16666666666667e+00 +1395 1397 -8.33333333333333e+00 +1395 1606 -2.08333333333333e+00 +1395 1625 -4.16666666666667e+00 +1395 1613 4.16666666666667e+00 +1395 1624 -4.16666666666667e+00 +1395 1612 4.16666666666667e+00 +1395 1607 4.16666666666667e+00 +1395 1313 -4.16666666666667e+00 +1395 1605 -6.25000000000000e+00 +1395 1394 4.16666666666667e+00 +1395 1277 -4.16666666666667e+00 +1395 1393 4.16666666666667e+00 +1395 1396 -8.33333333333333e+00 +1395 1402 8.33333333333333e+00 +1395 1392 -1.87500000000000e+01 +1395 1555 4.16666666666667e+00 +1395 1401 -1.25000000000000e+01 +1396 1396 6.25000000000000e+01 +1396 1559 4.16666666666667e+00 +1396 1554 4.16666666666667e+00 +1396 1557 -8.33333333333333e+00 +1396 1555 -6.25000000000000e+00 +1396 1311 2.08333333333333e+00 +1396 1385 4.16666666666667e+00 +1396 1397 -8.33333333333333e+00 +1396 1384 -6.25000000000000e+00 +1396 1383 -2.08333333333333e+00 +1396 1275 2.08333333333333e+00 +1396 1605 -2.08333333333333e+00 +1396 1607 4.16666666666667e+00 +1396 1403 8.33333333333333e+00 +1396 1613 -8.33333333333333e+00 +1396 1623 -4.16666666666667e+00 +1396 1611 4.16666666666667e+00 +1396 1313 2.08333333333333e+00 +1396 1625 -4.16666666666667e+00 +1396 1606 -6.25000000000000e+00 +1396 1394 -2.08333333333333e+00 +1396 1277 2.08333333333333e+00 +1396 1393 -6.25000000000000e+00 +1396 1556 -2.08333333333333e+00 +1396 1402 -3.75000000000000e+01 +1396 1392 4.16666666666667e+00 +1396 1395 -8.33333333333333e+00 +1396 1401 8.33333333333333e+00 +1397 1397 6.25000000000000e+01 +1397 1558 4.16666666666667e+00 +1397 1557 4.16666666666667e+00 +1397 1556 -6.25000000000000e+00 +1397 1554 4.16666666666667e+00 +1397 1385 -1.87500000000000e+01 +1397 1384 4.16666666666667e+00 +1397 1396 -8.33333333333333e+00 +1397 1383 4.16666666666667e+00 +1397 1401 -4.16666666666667e+00 +1397 1395 -8.33333333333333e+00 +1397 1606 4.16666666666667e+00 +1397 1623 -4.16666666666667e+00 +1397 1611 4.16666666666667e+00 +1397 1402 8.33333333333333e+00 +1397 1612 -8.33333333333333e+00 +1397 1607 -1.87500000000000e+01 +1397 1312 2.08333333333333e+00 +1397 1624 -4.16666666666667e+00 +1397 1605 4.16666666666667e+00 +1397 1311 -4.16666666666667e+00 +1397 1394 -6.25000000000000e+00 +1397 1555 -2.08333333333333e+00 +1397 1403 -1.25000000000000e+01 +1397 1393 -2.08333333333333e+00 +1397 1276 2.08333333333333e+00 +1397 1392 4.16666666666667e+00 +1397 1275 -4.16666666666667e+00 +1398 1398 1.25000000000000e+02 +1398 1387 -4.16666666666667e+00 +1398 1277 4.16666666666667e+00 +1398 1386 -1.25000000000000e+01 +1398 1574 -4.16666666666667e+00 +1398 1316 4.16666666666667e+00 +1398 1399 -1.66666666666667e+01 +1398 1573 8.33333333333333e+00 +1398 1572 -1.25000000000000e+01 +1398 1394 -4.16666666666667e+00 +1398 1393 8.33333333333333e+00 +1398 1276 4.16666666666667e+00 +1398 1392 -1.25000000000000e+01 +1398 1400 -1.66666666666667e+01 +1398 1610 8.33333333333333e+00 +1398 1609 -4.16666666666667e+00 +1398 1315 4.16666666666667e+00 +1398 1388 8.33333333333333e+00 +1398 1608 -1.25000000000000e+01 +1398 1576 -8.33333333333333e+00 +1398 1403 8.33333333333333e+00 +1398 1613 -8.33333333333333e+00 +1398 1642 -4.16666666666667e+00 +1398 1612 4.16666666666667e+00 +1398 1643 -4.16666666666667e+00 +1398 1402 8.33333333333333e+00 +1398 1577 4.16666666666667e+00 +1398 1401 -3.75000000000000e+01 +1398 2287 4.16666666666667e+00 +1398 2288 -8.33333333333333e+00 +1398 2030 -4.16666666666667e+00 +1398 2291 4.16666666666667e+00 +1398 2293 8.33333333333333e+00 +1398 2290 -8.33333333333333e+00 +1398 2029 -4.16666666666667e+00 +1398 2294 8.33333333333333e+00 +1398 2292 -3.75000000000000e+01 +1399 1399 1.25000000000000e+02 +1399 1386 -4.16666666666667e+00 +1399 1388 8.33333333333333e+00 +1399 1387 -1.25000000000000e+01 +1399 1574 8.33333333333333e+00 +1399 1573 -3.75000000000000e+01 +1399 1398 -1.66666666666667e+01 +1399 1572 8.33333333333333e+00 +1399 1400 -1.66666666666667e+01 +1399 1392 8.33333333333333e+00 +1399 1277 -8.33333333333333e+00 +1399 1394 8.33333333333333e+00 +1399 1393 -3.75000000000000e+01 +1399 1275 4.16666666666667e+00 +1399 1610 8.33333333333333e+00 +1399 1316 -8.33333333333333e+00 +1399 1609 -1.25000000000000e+01 +1399 1608 -4.16666666666667e+00 +1399 1314 4.16666666666667e+00 +1399 1577 4.16666666666667e+00 +1399 1575 -8.33333333333333e+00 +1399 1403 -4.16666666666667e+00 +1399 1643 -4.16666666666667e+00 +1399 1613 4.16666666666667e+00 +1399 1641 -4.16666666666667e+00 +1399 1611 4.16666666666667e+00 +1399 1402 -1.25000000000000e+01 +1399 1401 8.33333333333333e+00 +1399 2288 4.16666666666667e+00 +1399 2294 -4.16666666666667e+00 +1399 2030 -4.16666666666667e+00 +1399 2291 4.16666666666667e+00 +1399 2292 8.33333333333333e+00 +1399 2289 -8.33333333333333e+00 +1399 2028 -4.16666666666667e+00 +1399 2286 4.16666666666667e+00 +1399 2293 -1.25000000000000e+01 +1400 1400 1.25000000000000e+02 +1400 1388 -3.75000000000000e+01 +1400 1387 8.33333333333333e+00 +1400 1275 4.16666666666667e+00 +1400 1574 -1.25000000000000e+01 +1400 1573 8.33333333333333e+00 +1400 1572 -4.16666666666667e+00 +1400 1314 4.16666666666667e+00 +1400 1399 -1.66666666666667e+01 +1400 1392 -4.16666666666667e+00 +1400 1394 -1.25000000000000e+01 +1400 1276 -8.33333333333333e+00 +1400 1393 8.33333333333333e+00 +1400 1386 8.33333333333333e+00 +1400 1610 -3.75000000000000e+01 +1400 1609 8.33333333333333e+00 +1400 1315 -8.33333333333333e+00 +1400 1398 -1.66666666666667e+01 +1400 1608 8.33333333333333e+00 +1400 1576 4.16666666666667e+00 +1400 1402 -4.16666666666667e+00 +1400 1642 -4.16666666666667e+00 +1400 1612 4.16666666666667e+00 +1400 1401 8.33333333333333e+00 +1400 1611 -8.33333333333333e+00 +1400 1641 -4.16666666666667e+00 +1400 1575 4.16666666666667e+00 +1400 1403 -1.25000000000000e+01 +1400 2287 4.16666666666667e+00 +1400 2286 -8.33333333333333e+00 +1400 2293 -4.16666666666667e+00 +1400 2029 -4.16666666666667e+00 +1400 2290 4.16666666666667e+00 +1400 2028 -4.16666666666667e+00 +1400 2289 4.16666666666667e+00 +1400 2294 -1.25000000000000e+01 +1400 2292 8.33333333333333e+00 +1401 1401 1.25000000000000e+02 +1401 1576 8.33333333333333e+00 +1401 1575 -1.25000000000000e+01 +1401 1388 -8.33333333333333e+00 +1401 1387 4.16666666666667e+00 +1401 1400 8.33333333333333e+00 +1401 1642 4.16666666666667e+00 +1401 1399 8.33333333333333e+00 +1401 1398 -3.75000000000000e+01 +1401 1643 4.16666666666667e+00 +1401 1390 -4.16666666666667e+00 +1401 1391 8.33333333333333e+00 +1401 1403 -1.66666666666667e+01 +1401 1277 -4.16666666666667e+00 +1401 1389 -1.25000000000000e+01 +1401 1589 4.16666666666667e+00 +1401 1319 -4.16666666666667e+00 +1401 1588 -8.33333333333333e+00 +1401 1385 4.16666666666667e+00 +1401 1558 8.33333333333333e+00 +1401 1402 -1.66666666666667e+01 +1401 1559 8.33333333333333e+00 +1401 1318 -4.16666666666667e+00 +1401 1557 -3.75000000000000e+01 +1401 1384 4.16666666666667e+00 +1401 1276 -4.16666666666667e+00 +1401 1397 -4.16666666666667e+00 +1401 1394 4.16666666666667e+00 +1401 1624 4.16666666666667e+00 +1401 1612 -4.16666666666667e+00 +1401 1393 -8.33333333333333e+00 +1401 1396 8.33333333333333e+00 +1401 1395 -1.25000000000000e+01 +1401 1613 8.33333333333333e+00 +1401 1625 -8.33333333333333e+00 +1401 1611 -1.25000000000000e+01 +1401 1577 -4.16666666666667e+00 +1402 1402 1.25000000000000e+02 +1402 1575 8.33333333333333e+00 +1402 1577 8.33333333333333e+00 +1402 1576 -3.75000000000000e+01 +1402 1386 4.16666666666667e+00 +1402 1400 -4.16666666666667e+00 +1402 1641 4.16666666666667e+00 +1402 1399 -1.25000000000000e+01 +1402 1398 8.33333333333333e+00 +1402 1643 -8.33333333333333e+00 +1402 1389 -4.16666666666667e+00 +1402 1589 4.16666666666667e+00 +1402 1391 8.33333333333333e+00 +1402 1390 -1.25000000000000e+01 +1402 1587 -8.33333333333333e+00 +1402 1559 -4.16666666666667e+00 +1402 1557 8.33333333333333e+00 +1402 1401 -1.66666666666667e+01 +1402 1558 -1.25000000000000e+01 +1402 1317 -4.16666666666667e+00 +1402 1385 -8.33333333333333e+00 +1402 1383 4.16666666666667e+00 +1402 1275 -4.16666666666667e+00 +1402 1397 8.33333333333333e+00 +1402 1403 -1.66666666666667e+01 +1402 1613 8.33333333333333e+00 +1402 1623 4.16666666666667e+00 +1402 1611 -4.16666666666667e+00 +1402 1394 4.16666666666667e+00 +1402 1277 -4.16666666666667e+00 +1402 1396 -3.75000000000000e+01 +1402 1392 -8.33333333333333e+00 +1402 1395 8.33333333333333e+00 +1402 1625 4.16666666666667e+00 +1402 1319 -4.16666666666667e+00 +1402 1612 -1.25000000000000e+01 +1402 1388 4.16666666666667e+00 +1403 1403 1.25000000000000e+02 +1403 1387 4.16666666666667e+00 +1403 1577 -1.25000000000000e+01 +1403 1576 8.33333333333333e+00 +1403 1386 -8.33333333333333e+00 +1403 1399 -4.16666666666667e+00 +1403 1398 8.33333333333333e+00 +1403 1400 -1.25000000000000e+01 +1403 1642 -8.33333333333333e+00 +1403 1641 4.16666666666667e+00 +1403 1588 4.16666666666667e+00 +1403 1389 8.33333333333333e+00 +1403 1401 -1.66666666666667e+01 +1403 1391 -3.75000000000000e+01 +1403 1390 8.33333333333333e+00 +1403 1275 -4.16666666666667e+00 +1403 1587 4.16666666666667e+00 +1403 1317 -4.16666666666667e+00 +1403 1558 -4.16666666666667e+00 +1403 1383 4.16666666666667e+00 +1403 1559 -1.25000000000000e+01 +1403 1557 8.33333333333333e+00 +1403 1384 -8.33333333333333e+00 +1403 1395 -4.16666666666667e+00 +1403 1392 4.16666666666667e+00 +1403 1396 8.33333333333333e+00 +1403 1402 -1.66666666666667e+01 +1403 1612 8.33333333333333e+00 +1403 1397 -1.25000000000000e+01 +1403 1393 4.16666666666667e+00 +1403 1276 -4.16666666666667e+00 +1403 1613 -3.75000000000000e+01 +1403 1575 -4.16666666666667e+00 +1403 1624 4.16666666666667e+00 +1403 1318 -4.16666666666667e+00 +1403 1611 8.33333333333333e+00 +1403 1623 -8.33333333333333e+00 +1404 1404 3.75000000000000e+01 +1404 1279 2.08333333333333e+00 +1404 1411 -4.16666666666667e+00 +1404 1562 -2.08333333333333e+00 +1404 1405 -4.16666666666667e+00 +1404 1561 4.16666666666667e+00 +1404 1300 2.08333333333333e+00 +1404 1560 -6.25000000000000e+00 +1404 1424 -4.16666666666667e+00 +1404 1568 4.16666666666667e+00 +1404 1280 2.08333333333333e+00 +1404 1418 -4.16666666666667e+00 +1404 1417 2.08333333333333e+00 +1404 1423 -4.16666666666667e+00 +1404 1278 -1.25000000000000e+01 +1404 1406 -4.16666666666667e+00 +1404 1565 4.16666666666667e+00 +1404 1301 2.08333333333333e+00 +1404 1564 -2.08333333333333e+00 +1404 1567 4.16666666666667e+00 +1404 1412 2.08333333333333e+00 +1404 1563 -6.25000000000000e+00 +1404 1299 -1.25000000000000e+01 +1405 1405 3.33333333333333e+01 +1405 1278 2.08333333333333e+00 +1405 1410 -4.16666666666667e+00 +1405 1562 4.16666666666667e+00 +1405 1561 -1.87500000000000e+01 +1405 1404 -4.16666666666667e+00 +1405 1560 4.16666666666667e+00 +1405 1299 2.08333333333333e+00 +1405 1418 2.08333333333333e+00 +1405 1424 -4.16666666666667e+00 +1405 1279 -4.16666666666667e+00 +1405 1416 2.08333333333333e+00 +1405 1422 -4.16666666666667e+00 +1405 1565 4.16666666666667e+00 +1405 1568 -8.33333333333333e+00 +1405 1412 2.08333333333333e+00 +1405 1564 -6.25000000000000e+00 +1405 1300 -4.16666666666667e+00 +1405 1563 -2.08333333333333e+00 +1405 1566 4.16666666666667e+00 +1406 1406 3.33333333333333e+01 +1406 1410 2.08333333333333e+00 +1406 1562 -6.25000000000000e+00 +1406 1561 4.16666666666667e+00 +1406 1560 -2.08333333333333e+00 +1406 1417 2.08333333333333e+00 +1406 1423 -4.16666666666667e+00 +1406 1422 -4.16666666666667e+00 +1406 1566 4.16666666666667e+00 +1406 1280 -4.16666666666667e+00 +1406 1278 2.08333333333333e+00 +1406 1416 -4.16666666666667e+00 +1406 1411 2.08333333333333e+00 +1406 1565 -1.87500000000000e+01 +1406 1301 -4.16666666666667e+00 +1406 1564 4.16666666666667e+00 +1406 1567 -8.33333333333333e+00 +1406 1404 -4.16666666666667e+00 +1406 1563 4.16666666666667e+00 +1406 1299 2.08333333333333e+00 +1407 1407 3.75000000000000e+01 +1407 1321 2.08333333333333e+00 +1407 1678 -4.16666666666667e+00 +1407 1415 -2.08333333333333e+00 +1407 1408 -4.16666666666667e+00 +1407 1414 4.16666666666667e+00 +1407 1279 2.08333333333333e+00 +1407 1413 -6.25000000000000e+00 +1407 1685 -4.16666666666667e+00 +1407 1427 4.16666666666667e+00 +1407 1322 2.08333333333333e+00 +1407 1682 -4.16666666666667e+00 +1407 1681 2.08333333333333e+00 +1407 1684 -4.16666666666667e+00 +1407 1320 -1.25000000000000e+01 +1407 1409 -4.16666666666667e+00 +1407 1421 4.16666666666667e+00 +1407 1280 2.08333333333333e+00 +1407 1420 -2.08333333333333e+00 +1407 1426 4.16666666666667e+00 +1407 1679 2.08333333333333e+00 +1407 1419 -6.25000000000000e+00 +1407 1278 -1.25000000000000e+01 +1408 1408 3.33333333333333e+01 +1408 1320 2.08333333333333e+00 +1408 1677 -4.16666666666667e+00 +1408 1415 4.16666666666667e+00 +1408 1414 -1.87500000000000e+01 +1408 1407 -4.16666666666667e+00 +1408 1413 4.16666666666667e+00 +1408 1278 2.08333333333333e+00 +1408 1682 2.08333333333333e+00 +1408 1685 -4.16666666666667e+00 +1408 1321 -4.16666666666667e+00 +1408 1680 2.08333333333333e+00 +1408 1683 -4.16666666666667e+00 +1408 1421 4.16666666666667e+00 +1408 1427 -8.33333333333333e+00 +1408 1679 2.08333333333333e+00 +1408 1420 -6.25000000000000e+00 +1408 1279 -4.16666666666667e+00 +1408 1419 -2.08333333333333e+00 +1408 1425 4.16666666666667e+00 +1409 1409 3.33333333333333e+01 +1409 1677 2.08333333333333e+00 +1409 1415 -6.25000000000000e+00 +1409 1414 4.16666666666667e+00 +1409 1413 -2.08333333333333e+00 +1409 1681 2.08333333333333e+00 +1409 1684 -4.16666666666667e+00 +1409 1683 -4.16666666666667e+00 +1409 1425 4.16666666666667e+00 +1409 1322 -4.16666666666667e+00 +1409 1320 2.08333333333333e+00 +1409 1680 -4.16666666666667e+00 +1409 1678 2.08333333333333e+00 +1409 1421 -1.87500000000000e+01 +1409 1280 -4.16666666666667e+00 +1409 1420 4.16666666666667e+00 +1409 1426 -8.33333333333333e+00 +1409 1407 -4.16666666666667e+00 +1409 1419 4.16666666666667e+00 +1409 1278 2.08333333333333e+00 +1410 1410 6.25000000000000e+01 +1410 1696 -4.16666666666667e+00 +1410 1415 4.16666666666667e+00 +1410 1414 4.16666666666667e+00 +1410 1413 -1.87500000000000e+01 +1410 1703 -4.16666666666667e+00 +1410 1702 -4.16666666666667e+00 +1410 1427 -8.33333333333333e+00 +1410 1426 4.16666666666667e+00 +1410 1562 4.16666666666667e+00 +1410 1412 -8.33333333333333e+00 +1410 1424 8.33333333333333e+00 +1410 1699 4.16666666666667e+00 +1410 1423 -4.16666666666667e+00 +1410 1280 -2.08333333333333e+00 +1410 1406 2.08333333333333e+00 +1410 1279 4.16666666666667e+00 +1410 1405 -4.16666666666667e+00 +1410 1278 -6.25000000000000e+00 +1410 1422 -1.25000000000000e+01 +1410 1325 -2.08333333333333e+00 +1410 1700 4.16666666666667e+00 +1410 1411 -8.33333333333333e+00 +1410 1324 4.16666666666667e+00 +1410 1561 4.16666666666667e+00 +1410 1697 2.08333333333333e+00 +1410 1323 -6.25000000000000e+00 +1410 1560 -1.87500000000000e+01 +1411 1411 6.25000000000000e+01 +1411 1695 -4.16666666666667e+00 +1411 1415 -2.08333333333333e+00 +1411 1414 -6.25000000000000e+00 +1411 1413 4.16666666666667e+00 +1411 1703 -4.16666666666667e+00 +1411 1427 4.16666666666667e+00 +1411 1701 -4.16666666666667e+00 +1411 1425 4.16666666666667e+00 +1411 1562 -2.08333333333333e+00 +1411 1406 2.08333333333333e+00 +1411 1698 4.16666666666667e+00 +1411 1422 -4.16666666666667e+00 +1411 1280 4.16666666666667e+00 +1411 1412 -8.33333333333333e+00 +1411 1424 8.33333333333333e+00 +1411 1279 -1.87500000000000e+01 +1411 1423 -1.25000000000000e+01 +1411 1278 4.16666666666667e+00 +1411 1404 -4.16666666666667e+00 +1411 1325 4.16666666666667e+00 +1411 1700 -8.33333333333333e+00 +1411 1697 2.08333333333333e+00 +1411 1324 -1.87500000000000e+01 +1411 1561 -6.25000000000000e+00 +1411 1410 -8.33333333333333e+00 +1411 1323 4.16666666666667e+00 +1411 1560 4.16666666666667e+00 +1412 1412 6.25000000000000e+01 +1412 1696 2.08333333333333e+00 +1412 1415 -6.25000000000000e+00 +1412 1414 -2.08333333333333e+00 +1412 1413 4.16666666666667e+00 +1412 1701 -4.16666666666667e+00 +1412 1702 -4.16666666666667e+00 +1412 1426 4.16666666666667e+00 +1412 1425 -8.33333333333333e+00 +1412 1561 -2.08333333333333e+00 +1412 1405 2.08333333333333e+00 +1412 1560 4.16666666666667e+00 +1412 1410 -8.33333333333333e+00 +1412 1422 8.33333333333333e+00 +1412 1280 -6.25000000000000e+00 +1412 1424 -3.75000000000000e+01 +1412 1279 4.16666666666667e+00 +1412 1411 -8.33333333333333e+00 +1412 1423 8.33333333333333e+00 +1412 1278 -2.08333333333333e+00 +1412 1404 2.08333333333333e+00 +1412 1695 2.08333333333333e+00 +1412 1325 -6.25000000000000e+00 +1412 1562 -6.25000000000000e+00 +1412 1324 4.16666666666667e+00 +1412 1699 -8.33333333333333e+00 +1412 1323 -2.08333333333333e+00 +1412 1698 4.16666666666667e+00 +1413 1413 6.25000000000000e+01 +1413 1702 4.16666666666667e+00 +1413 1703 4.16666666666667e+00 +1413 1696 4.16666666666667e+00 +1413 1695 -6.25000000000000e+00 +1413 1415 -8.33333333333333e+00 +1413 1412 4.16666666666667e+00 +1413 1411 4.16666666666667e+00 +1413 1410 -1.87500000000000e+01 +1413 1426 -4.16666666666667e+00 +1413 1414 -8.33333333333333e+00 +1413 1679 4.16666666666667e+00 +1413 1714 -4.16666666666667e+00 +1413 1684 4.16666666666667e+00 +1413 1427 8.33333333333333e+00 +1413 1685 -8.33333333333333e+00 +1413 1328 2.08333333333333e+00 +1413 1715 -4.16666666666667e+00 +1413 1678 4.16666666666667e+00 +1413 1327 -4.16666666666667e+00 +1413 1677 -1.87500000000000e+01 +1413 1409 -2.08333333333333e+00 +1413 1280 2.08333333333333e+00 +1413 1408 4.16666666666667e+00 +1413 1279 -4.16666666666667e+00 +1413 1407 -6.25000000000000e+00 +1413 1697 -2.08333333333333e+00 +1413 1425 -1.25000000000000e+01 +1414 1414 6.25000000000000e+01 +1414 1701 4.16666666666667e+00 +1414 1703 -8.33333333333333e+00 +1414 1328 2.08333333333333e+00 +1414 1696 -1.87500000000000e+01 +1414 1695 4.16666666666667e+00 +1414 1412 -2.08333333333333e+00 +1414 1280 2.08333333333333e+00 +1414 1411 -6.25000000000000e+00 +1414 1410 4.16666666666667e+00 +1414 1425 -4.16666666666667e+00 +1414 1679 -2.08333333333333e+00 +1414 1413 -8.33333333333333e+00 +1414 1713 -4.16666666666667e+00 +1414 1683 4.16666666666667e+00 +1414 1715 -4.16666666666667e+00 +1414 1685 4.16666666666667e+00 +1414 1678 -6.25000000000000e+00 +1414 1677 4.16666666666667e+00 +1414 1326 -4.16666666666667e+00 +1414 1409 4.16666666666667e+00 +1414 1415 -8.33333333333333e+00 +1414 1427 8.33333333333333e+00 +1414 1408 -1.87500000000000e+01 +1414 1697 4.16666666666667e+00 +1414 1426 -1.25000000000000e+01 +1414 1407 4.16666666666667e+00 +1414 1278 -4.16666666666667e+00 +1415 1415 6.25000000000000e+01 +1415 1696 4.16666666666667e+00 +1415 1702 -8.33333333333333e+00 +1415 1701 4.16666666666667e+00 +1415 1697 -6.25000000000000e+00 +1415 1327 2.08333333333333e+00 +1415 1412 -6.25000000000000e+00 +1415 1411 -2.08333333333333e+00 +1415 1279 2.08333333333333e+00 +1415 1413 -8.33333333333333e+00 +1415 1410 4.16666666666667e+00 +1415 1678 -2.08333333333333e+00 +1415 1677 4.16666666666667e+00 +1415 1714 -4.16666666666667e+00 +1415 1684 4.16666666666667e+00 +1415 1425 8.33333333333333e+00 +1415 1683 -8.33333333333333e+00 +1415 1679 -6.25000000000000e+00 +1415 1326 2.08333333333333e+00 +1415 1713 -4.16666666666667e+00 +1415 1409 -6.25000000000000e+00 +1415 1695 -2.08333333333333e+00 +1415 1427 -3.75000000000000e+01 +1415 1408 4.16666666666667e+00 +1415 1414 -8.33333333333333e+00 +1415 1426 8.33333333333333e+00 +1415 1407 -2.08333333333333e+00 +1415 1278 2.08333333333333e+00 +1416 1416 6.25000000000000e+01 +1416 1739 -4.16666666666667e+00 +1416 1732 2.08333333333333e+00 +1416 1738 -4.16666666666667e+00 +1416 1733 -4.16666666666667e+00 +1416 1421 4.16666666666667e+00 +1416 1420 4.16666666666667e+00 +1416 1426 -8.33333333333333e+00 +1416 1419 -1.87500000000000e+01 +1416 1736 4.16666666666667e+00 +1416 1424 -4.16666666666667e+00 +1416 1417 -8.33333333333333e+00 +1416 1423 8.33333333333333e+00 +1416 1564 4.16666666666667e+00 +1416 1280 4.16666666666667e+00 +1416 1406 -4.16666666666667e+00 +1416 1279 -2.08333333333333e+00 +1416 1405 2.08333333333333e+00 +1416 1278 -6.25000000000000e+00 +1416 1422 -1.25000000000000e+01 +1416 1418 -8.33333333333333e+00 +1416 1331 4.16666666666667e+00 +1416 1565 4.16666666666667e+00 +1416 1330 -2.08333333333333e+00 +1416 1735 4.16666666666667e+00 +1416 1427 4.16666666666667e+00 +1416 1329 -6.25000000000000e+00 +1416 1563 -1.87500000000000e+01 +1417 1417 6.25000000000000e+01 +1417 1737 -4.16666666666667e+00 +1417 1733 2.08333333333333e+00 +1417 1739 -4.16666666666667e+00 +1417 1421 -2.08333333333333e+00 +1417 1427 4.16666666666667e+00 +1417 1420 -6.25000000000000e+00 +1417 1419 4.16666666666667e+00 +1417 1425 -8.33333333333333e+00 +1417 1406 2.08333333333333e+00 +1417 1565 -2.08333333333333e+00 +1417 1416 -8.33333333333333e+00 +1417 1422 8.33333333333333e+00 +1417 1563 4.16666666666667e+00 +1417 1280 4.16666666666667e+00 +1417 1418 -8.33333333333333e+00 +1417 1424 8.33333333333333e+00 +1417 1279 -6.25000000000000e+00 +1417 1423 -3.75000000000000e+01 +1417 1278 -2.08333333333333e+00 +1417 1404 2.08333333333333e+00 +1417 1331 4.16666666666667e+00 +1417 1736 -8.33333333333333e+00 +1417 1731 2.08333333333333e+00 +1417 1330 -6.25000000000000e+00 +1417 1564 -6.25000000000000e+00 +1417 1329 -2.08333333333333e+00 +1417 1734 4.16666666666667e+00 +1418 1418 6.25000000000000e+01 +1418 1737 -4.16666666666667e+00 +1418 1732 2.08333333333333e+00 +1418 1738 -4.16666666666667e+00 +1418 1731 -4.16666666666667e+00 +1418 1421 -6.25000000000000e+00 +1418 1420 -2.08333333333333e+00 +1418 1426 4.16666666666667e+00 +1418 1419 4.16666666666667e+00 +1418 1734 4.16666666666667e+00 +1418 1422 -4.16666666666667e+00 +1418 1405 2.08333333333333e+00 +1418 1564 -2.08333333333333e+00 +1418 1280 -1.87500000000000e+01 +1418 1424 -1.25000000000000e+01 +1418 1279 4.16666666666667e+00 +1418 1417 -8.33333333333333e+00 +1418 1423 8.33333333333333e+00 +1418 1278 4.16666666666667e+00 +1418 1404 -4.16666666666667e+00 +1418 1425 4.16666666666667e+00 +1418 1331 -1.87500000000000e+01 +1418 1565 -6.25000000000000e+00 +1418 1330 4.16666666666667e+00 +1418 1735 -8.33333333333333e+00 +1418 1416 -8.33333333333333e+00 +1418 1329 4.16666666666667e+00 +1418 1563 4.16666666666667e+00 +1419 1419 6.25000000000000e+01 +1419 1685 4.16666666666667e+00 +1419 1684 -8.33333333333333e+00 +1419 1682 4.16666666666667e+00 +1419 1333 2.08333333333333e+00 +1419 1680 -1.87500000000000e+01 +1419 1409 4.16666666666667e+00 +1419 1408 -2.08333333333333e+00 +1419 1279 2.08333333333333e+00 +1419 1407 -6.25000000000000e+00 +1419 1427 -4.16666666666667e+00 +1419 1421 -8.33333333333333e+00 +1419 1732 -2.08333333333333e+00 +1419 1751 -4.16666666666667e+00 +1419 1739 4.16666666666667e+00 +1419 1750 -4.16666666666667e+00 +1419 1738 4.16666666666667e+00 +1419 1733 4.16666666666667e+00 +1419 1334 -4.16666666666667e+00 +1419 1731 -6.25000000000000e+00 +1419 1418 4.16666666666667e+00 +1419 1280 -4.16666666666667e+00 +1419 1417 4.16666666666667e+00 +1419 1420 -8.33333333333333e+00 +1419 1426 8.33333333333333e+00 +1419 1416 -1.87500000000000e+01 +1419 1681 4.16666666666667e+00 +1419 1425 -1.25000000000000e+01 +1420 1420 6.25000000000000e+01 +1420 1685 4.16666666666667e+00 +1420 1680 4.16666666666667e+00 +1420 1683 -8.33333333333333e+00 +1420 1681 -6.25000000000000e+00 +1420 1332 2.08333333333333e+00 +1420 1409 4.16666666666667e+00 +1420 1421 -8.33333333333333e+00 +1420 1408 -6.25000000000000e+00 +1420 1407 -2.08333333333333e+00 +1420 1278 2.08333333333333e+00 +1420 1731 -2.08333333333333e+00 +1420 1733 4.16666666666667e+00 +1420 1427 8.33333333333333e+00 +1420 1739 -8.33333333333333e+00 +1420 1749 -4.16666666666667e+00 +1420 1737 4.16666666666667e+00 +1420 1334 2.08333333333333e+00 +1420 1751 -4.16666666666667e+00 +1420 1732 -6.25000000000000e+00 +1420 1418 -2.08333333333333e+00 +1420 1280 2.08333333333333e+00 +1420 1417 -6.25000000000000e+00 +1420 1682 -2.08333333333333e+00 +1420 1426 -3.75000000000000e+01 +1420 1416 4.16666666666667e+00 +1420 1419 -8.33333333333333e+00 +1420 1425 8.33333333333333e+00 +1421 1421 6.25000000000000e+01 +1421 1684 4.16666666666667e+00 +1421 1683 4.16666666666667e+00 +1421 1682 -6.25000000000000e+00 +1421 1680 4.16666666666667e+00 +1421 1409 -1.87500000000000e+01 +1421 1408 4.16666666666667e+00 +1421 1420 -8.33333333333333e+00 +1421 1407 4.16666666666667e+00 +1421 1425 -4.16666666666667e+00 +1421 1419 -8.33333333333333e+00 +1421 1732 4.16666666666667e+00 +1421 1749 -4.16666666666667e+00 +1421 1737 4.16666666666667e+00 +1421 1426 8.33333333333333e+00 +1421 1738 -8.33333333333333e+00 +1421 1733 -1.87500000000000e+01 +1421 1333 2.08333333333333e+00 +1421 1750 -4.16666666666667e+00 +1421 1731 4.16666666666667e+00 +1421 1332 -4.16666666666667e+00 +1421 1418 -6.25000000000000e+00 +1421 1681 -2.08333333333333e+00 +1421 1427 -1.25000000000000e+01 +1421 1417 -2.08333333333333e+00 +1421 1279 2.08333333333333e+00 +1421 1416 4.16666666666667e+00 +1421 1278 -4.16666666666667e+00 +1422 1422 1.25000000000000e+02 +1422 1702 -8.33333333333333e+00 +1422 1427 8.33333333333333e+00 +1422 1739 -8.33333333333333e+00 +1422 1768 -4.16666666666667e+00 +1422 1738 4.16666666666667e+00 +1422 1769 -4.16666666666667e+00 +1422 1426 8.33333333333333e+00 +1422 1425 -3.75000000000000e+01 +1422 1412 8.33333333333333e+00 +1422 1561 4.16666666666667e+00 +1422 1411 -4.16666666666667e+00 +1422 1562 -8.33333333333333e+00 +1422 1280 4.16666666666667e+00 +1422 1410 -1.25000000000000e+01 +1422 1700 -4.16666666666667e+00 +1422 1337 4.16666666666667e+00 +1422 1423 -1.66666666666667e+01 +1422 1699 8.33333333333333e+00 +1422 1698 -1.25000000000000e+01 +1422 1418 -4.16666666666667e+00 +1422 1417 8.33333333333333e+00 +1422 1406 -4.16666666666667e+00 +1422 1565 4.16666666666667e+00 +1422 1567 8.33333333333333e+00 +1422 1564 -8.33333333333333e+00 +1422 1279 4.16666666666667e+00 +1422 1405 -4.16666666666667e+00 +1422 1416 -1.25000000000000e+01 +1422 1424 -1.66666666666667e+01 +1422 1736 8.33333333333333e+00 +1422 1568 8.33333333333333e+00 +1422 1735 -4.16666666666667e+00 +1422 1336 4.16666666666667e+00 +1422 1703 4.16666666666667e+00 +1422 1734 -1.25000000000000e+01 +1422 1566 -3.75000000000000e+01 +1423 1423 1.25000000000000e+02 +1423 1701 -8.33333333333333e+00 +1423 1427 -4.16666666666667e+00 +1423 1769 -4.16666666666667e+00 +1423 1739 4.16666666666667e+00 +1423 1767 -4.16666666666667e+00 +1423 1737 4.16666666666667e+00 +1423 1426 -1.25000000000000e+01 +1423 1425 8.33333333333333e+00 +1423 1560 4.16666666666667e+00 +1423 1410 -4.16666666666667e+00 +1423 1562 4.16666666666667e+00 +1423 1412 8.33333333333333e+00 +1423 1411 -1.25000000000000e+01 +1423 1700 8.33333333333333e+00 +1423 1699 -3.75000000000000e+01 +1423 1422 -1.66666666666667e+01 +1423 1698 8.33333333333333e+00 +1423 1568 -4.16666666666667e+00 +1423 1424 -1.66666666666667e+01 +1423 1406 -4.16666666666667e+00 +1423 1565 4.16666666666667e+00 +1423 1416 8.33333333333333e+00 +1423 1566 8.33333333333333e+00 +1423 1563 -8.33333333333333e+00 +1423 1280 -8.33333333333333e+00 +1423 1418 8.33333333333333e+00 +1423 1417 -3.75000000000000e+01 +1423 1278 4.16666666666667e+00 +1423 1404 -4.16666666666667e+00 +1423 1736 8.33333333333333e+00 +1423 1337 -8.33333333333333e+00 +1423 1703 4.16666666666667e+00 +1423 1735 -1.25000000000000e+01 +1423 1567 -1.25000000000000e+01 +1423 1734 -4.16666666666667e+00 +1423 1335 4.16666666666667e+00 +1424 1424 1.25000000000000e+02 +1424 1702 4.16666666666667e+00 +1424 1426 -4.16666666666667e+00 +1424 1768 -4.16666666666667e+00 +1424 1738 4.16666666666667e+00 +1424 1425 8.33333333333333e+00 +1424 1737 -8.33333333333333e+00 +1424 1767 -4.16666666666667e+00 +1424 1427 -1.25000000000000e+01 +1424 1410 8.33333333333333e+00 +1424 1561 4.16666666666667e+00 +1424 1560 -8.33333333333333e+00 +1424 1412 -3.75000000000000e+01 +1424 1411 8.33333333333333e+00 +1424 1278 4.16666666666667e+00 +1424 1700 -1.25000000000000e+01 +1424 1699 8.33333333333333e+00 +1424 1698 -4.16666666666667e+00 +1424 1335 4.16666666666667e+00 +1424 1567 -4.16666666666667e+00 +1424 1423 -1.66666666666667e+01 +1424 1416 -4.16666666666667e+00 +1424 1405 -4.16666666666667e+00 +1424 1564 4.16666666666667e+00 +1424 1404 -4.16666666666667e+00 +1424 1563 4.16666666666667e+00 +1424 1418 -1.25000000000000e+01 +1424 1279 -8.33333333333333e+00 +1424 1417 8.33333333333333e+00 +1424 1701 4.16666666666667e+00 +1424 1736 -3.75000000000000e+01 +1424 1568 -1.25000000000000e+01 +1424 1735 8.33333333333333e+00 +1424 1336 -8.33333333333333e+00 +1424 1422 -1.66666666666667e+01 +1424 1734 8.33333333333333e+00 +1424 1566 8.33333333333333e+00 +1425 1425 1.25000000000000e+02 +1425 1702 8.33333333333333e+00 +1425 1701 -1.25000000000000e+01 +1425 1412 -8.33333333333333e+00 +1425 1411 4.16666666666667e+00 +1425 1424 8.33333333333333e+00 +1425 1768 4.16666666666667e+00 +1425 1423 8.33333333333333e+00 +1425 1422 -3.75000000000000e+01 +1425 1769 4.16666666666667e+00 +1425 1414 -4.16666666666667e+00 +1425 1415 8.33333333333333e+00 +1425 1427 -1.66666666666667e+01 +1425 1280 -4.16666666666667e+00 +1425 1413 -1.25000000000000e+01 +1425 1715 4.16666666666667e+00 +1425 1340 -4.16666666666667e+00 +1425 1714 -8.33333333333333e+00 +1425 1409 4.16666666666667e+00 +1425 1684 8.33333333333333e+00 +1425 1426 -1.66666666666667e+01 +1425 1685 8.33333333333333e+00 +1425 1339 -4.16666666666667e+00 +1425 1683 -3.75000000000000e+01 +1425 1408 4.16666666666667e+00 +1425 1279 -4.16666666666667e+00 +1425 1421 -4.16666666666667e+00 +1425 1418 4.16666666666667e+00 +1425 1750 4.16666666666667e+00 +1425 1738 -4.16666666666667e+00 +1425 1417 -8.33333333333333e+00 +1425 1420 8.33333333333333e+00 +1425 1419 -1.25000000000000e+01 +1425 1739 8.33333333333333e+00 +1425 1751 -8.33333333333333e+00 +1425 1737 -1.25000000000000e+01 +1425 1703 -4.16666666666667e+00 +1426 1426 1.25000000000000e+02 +1426 1701 8.33333333333333e+00 +1426 1703 8.33333333333333e+00 +1426 1702 -3.75000000000000e+01 +1426 1410 4.16666666666667e+00 +1426 1424 -4.16666666666667e+00 +1426 1767 4.16666666666667e+00 +1426 1423 -1.25000000000000e+01 +1426 1422 8.33333333333333e+00 +1426 1769 -8.33333333333333e+00 +1426 1413 -4.16666666666667e+00 +1426 1715 4.16666666666667e+00 +1426 1415 8.33333333333333e+00 +1426 1414 -1.25000000000000e+01 +1426 1713 -8.33333333333333e+00 +1426 1685 -4.16666666666667e+00 +1426 1683 8.33333333333333e+00 +1426 1425 -1.66666666666667e+01 +1426 1684 -1.25000000000000e+01 +1426 1338 -4.16666666666667e+00 +1426 1409 -8.33333333333333e+00 +1426 1407 4.16666666666667e+00 +1426 1278 -4.16666666666667e+00 +1426 1421 8.33333333333333e+00 +1426 1427 -1.66666666666667e+01 +1426 1739 8.33333333333333e+00 +1426 1749 4.16666666666667e+00 +1426 1737 -4.16666666666667e+00 +1426 1418 4.16666666666667e+00 +1426 1280 -4.16666666666667e+00 +1426 1420 -3.75000000000000e+01 +1426 1416 -8.33333333333333e+00 +1426 1419 8.33333333333333e+00 +1426 1751 4.16666666666667e+00 +1426 1340 -4.16666666666667e+00 +1426 1738 -1.25000000000000e+01 +1426 1412 4.16666666666667e+00 +1427 1427 1.25000000000000e+02 +1427 1411 4.16666666666667e+00 +1427 1703 -1.25000000000000e+01 +1427 1702 8.33333333333333e+00 +1427 1410 -8.33333333333333e+00 +1427 1423 -4.16666666666667e+00 +1427 1422 8.33333333333333e+00 +1427 1424 -1.25000000000000e+01 +1427 1768 -8.33333333333333e+00 +1427 1767 4.16666666666667e+00 +1427 1714 4.16666666666667e+00 +1427 1413 8.33333333333333e+00 +1427 1425 -1.66666666666667e+01 +1427 1415 -3.75000000000000e+01 +1427 1414 8.33333333333333e+00 +1427 1278 -4.16666666666667e+00 +1427 1713 4.16666666666667e+00 +1427 1338 -4.16666666666667e+00 +1427 1684 -4.16666666666667e+00 +1427 1407 4.16666666666667e+00 +1427 1685 -1.25000000000000e+01 +1427 1683 8.33333333333333e+00 +1427 1408 -8.33333333333333e+00 +1427 1419 -4.16666666666667e+00 +1427 1416 4.16666666666667e+00 +1427 1420 8.33333333333333e+00 +1427 1426 -1.66666666666667e+01 +1427 1738 8.33333333333333e+00 +1427 1421 -1.25000000000000e+01 +1427 1417 4.16666666666667e+00 +1427 1279 -4.16666666666667e+00 +1427 1739 -3.75000000000000e+01 +1427 1701 -4.16666666666667e+00 +1427 1750 4.16666666666667e+00 +1427 1339 -4.16666666666667e+00 +1427 1737 8.33333333333333e+00 +1427 1749 -8.33333333333333e+00 +1428 1428 3.75000000000000e+01 +1428 1688 -2.08333333333333e+00 +1428 1429 -4.16666666666667e+00 +1428 1687 4.16666666666667e+00 +1428 1321 2.08333333333333e+00 +1428 1686 -6.25000000000000e+00 +1428 1694 4.16666666666667e+00 +1428 1430 -4.16666666666667e+00 +1428 1691 4.16666666666667e+00 +1428 1322 2.08333333333333e+00 +1428 1690 -2.08333333333333e+00 +1428 1693 4.16666666666667e+00 +1428 1689 -6.25000000000000e+00 +1428 1320 -1.25000000000000e+01 +1428 1 2.08333333333333e+00 +1428 139 -4.16666666666667e+00 +1428 152 -4.16666666666667e+00 +1428 2 2.08333333333333e+00 +1428 146 -4.16666666666667e+00 +1428 145 2.08333333333333e+00 +1428 151 -4.16666666666667e+00 +1428 0 -1.25000000000000e+01 +1428 140 2.08333333333333e+00 +1429 1429 3.33333333333333e+01 +1429 1688 4.16666666666667e+00 +1429 1687 -1.87500000000000e+01 +1429 1428 -4.16666666666667e+00 +1429 1686 4.16666666666667e+00 +1429 1320 2.08333333333333e+00 +1429 1691 4.16666666666667e+00 +1429 1694 -8.33333333333333e+00 +1429 1690 -6.25000000000000e+00 +1429 1321 -4.16666666666667e+00 +1429 1689 -2.08333333333333e+00 +1429 1692 4.16666666666667e+00 +1429 0 2.08333333333333e+00 +1429 138 -4.16666666666667e+00 +1429 146 2.08333333333333e+00 +1429 152 -4.16666666666667e+00 +1429 1 -4.16666666666667e+00 +1429 144 2.08333333333333e+00 +1429 150 -4.16666666666667e+00 +1429 140 2.08333333333333e+00 +1430 1430 3.33333333333333e+01 +1430 1688 -6.25000000000000e+00 +1430 1687 4.16666666666667e+00 +1430 1686 -2.08333333333333e+00 +1430 1692 4.16666666666667e+00 +1430 1691 -1.87500000000000e+01 +1430 1322 -4.16666666666667e+00 +1430 1690 4.16666666666667e+00 +1430 1693 -8.33333333333333e+00 +1430 1428 -4.16666666666667e+00 +1430 1689 4.16666666666667e+00 +1430 1320 2.08333333333333e+00 +1430 138 2.08333333333333e+00 +1430 145 2.08333333333333e+00 +1430 151 -4.16666666666667e+00 +1430 150 -4.16666666666667e+00 +1430 2 -4.16666666666667e+00 +1430 0 2.08333333333333e+00 +1430 144 -4.16666666666667e+00 +1430 139 2.08333333333333e+00 +1431 1431 6.25000000000000e+01 +1431 1433 -8.33333333333333e+00 +1431 1583 8.33333333333333e+00 +1431 1438 4.16666666666667e+00 +1431 1582 -4.16666666666667e+00 +1431 1304 -2.08333333333333e+00 +1431 1303 4.16666666666667e+00 +1431 1302 -6.25000000000000e+00 +1431 1581 -1.25000000000000e+01 +1431 1283 -2.08333333333333e+00 +1431 1439 4.16666666666667e+00 +1431 1432 -8.33333333333333e+00 +1431 1282 4.16666666666667e+00 +1431 1281 -6.25000000000000e+00 +1431 1435 -4.16666666666667e+00 +1431 1580 4.16666666666667e+00 +1431 1579 4.16666666666667e+00 +1431 1578 -1.87500000000000e+01 +1431 1442 -4.16666666666667e+00 +1431 1441 -4.16666666666667e+00 +1431 1586 -8.33333333333333e+00 +1431 1585 4.16666666666667e+00 +1431 1436 2.08333333333333e+00 +1431 2318 2.08333333333333e+00 +1431 2317 -4.16666666666667e+00 +1431 2062 4.16666666666667e+00 +1431 2063 4.16666666666667e+00 +1431 2061 -1.87500000000000e+01 +1432 1432 6.25000000000000e+01 +1432 1437 4.16666666666667e+00 +1432 1581 -4.16666666666667e+00 +1432 1304 4.16666666666667e+00 +1432 1433 -8.33333333333333e+00 +1432 1583 8.33333333333333e+00 +1432 1303 -1.87500000000000e+01 +1432 1582 -1.25000000000000e+01 +1432 1302 4.16666666666667e+00 +1432 1283 4.16666666666667e+00 +1432 1439 -8.33333333333333e+00 +1432 1282 -1.87500000000000e+01 +1432 1431 -8.33333333333333e+00 +1432 1281 4.16666666666667e+00 +1432 1434 -4.16666666666667e+00 +1432 1580 -2.08333333333333e+00 +1432 1579 -6.25000000000000e+00 +1432 1578 4.16666666666667e+00 +1432 1442 -4.16666666666667e+00 +1432 1586 4.16666666666667e+00 +1432 1440 -4.16666666666667e+00 +1432 1436 2.08333333333333e+00 +1432 1584 4.16666666666667e+00 +1432 2318 2.08333333333333e+00 +1432 2316 -4.16666666666667e+00 +1432 2063 -2.08333333333333e+00 +1432 2062 -6.25000000000000e+00 +1432 2061 4.16666666666667e+00 +1433 1433 6.25000000000000e+01 +1433 1431 -8.33333333333333e+00 +1433 1581 8.33333333333333e+00 +1433 1304 -6.25000000000000e+00 +1433 1583 -3.75000000000000e+01 +1433 1303 4.16666666666667e+00 +1433 1432 -8.33333333333333e+00 +1433 1582 8.33333333333333e+00 +1433 1302 -2.08333333333333e+00 +1433 1283 -6.25000000000000e+00 +1433 1282 4.16666666666667e+00 +1433 1438 -8.33333333333333e+00 +1433 1281 -2.08333333333333e+00 +1433 1437 4.16666666666667e+00 +1433 1435 2.08333333333333e+00 +1433 1580 -6.25000000000000e+00 +1433 1579 -2.08333333333333e+00 +1433 1578 4.16666666666667e+00 +1433 1440 -4.16666666666667e+00 +1433 1441 -4.16666666666667e+00 +1433 1585 4.16666666666667e+00 +1433 1434 2.08333333333333e+00 +1433 1584 -8.33333333333333e+00 +1433 2317 2.08333333333333e+00 +1433 2061 4.16666666666667e+00 +1433 2316 2.08333333333333e+00 +1433 2062 -2.08333333333333e+00 +1433 2063 -6.25000000000000e+00 +1434 1434 2.50000000000000e+01 +1434 1580 -2.08333333333333e+00 +1434 1804 2.08333333333333e+00 +1434 1441 -2.08333333333333e+00 +1434 1343 2.08333333333333e+00 +1434 1805 -4.16666666666667e+00 +1434 1342 2.08333333333333e+00 +1434 1435 -4.16666666666667e+00 +1434 1579 4.16666666666667e+00 +1434 1341 -6.25000000000000e+00 +1434 1578 -6.25000000000000e+00 +1434 1436 -4.16666666666667e+00 +1434 1283 2.08333333333333e+00 +1434 1442 4.16666666666667e+00 +1434 1282 2.08333333333333e+00 +1434 1432 -4.16666666666667e+00 +1434 1433 2.08333333333333e+00 +1434 1281 -6.25000000000000e+00 +1434 1440 -6.25000000000000e+00 +1435 1435 2.91666666666667e+01 +1435 1580 4.16666666666667e+00 +1435 1442 4.16666666666667e+00 +1435 1803 2.08333333333333e+00 +1435 1440 -2.08333333333333e+00 +1435 1343 -2.08333333333333e+00 +1435 1805 2.08333333333333e+00 +1435 1342 -2.08333333333333e+00 +1435 1579 -1.87500000000000e+01 +1435 1341 2.08333333333333e+00 +1435 1434 -4.16666666666667e+00 +1435 1578 4.16666666666667e+00 +1435 1283 -2.08333333333333e+00 +1435 1433 2.08333333333333e+00 +1435 1436 -8.33333333333333e+00 +1435 1282 -2.08333333333333e+00 +1435 1441 -6.25000000000000e+00 +1435 1281 2.08333333333333e+00 +1435 1431 -4.16666666666667e+00 +1436 1436 2.91666666666667e+01 +1436 1578 -2.08333333333333e+00 +1436 1435 -8.33333333333333e+00 +1436 1579 4.16666666666667e+00 +1436 1441 4.16666666666667e+00 +1436 1343 -2.08333333333333e+00 +1436 1580 -6.25000000000000e+00 +1436 1342 -2.08333333333333e+00 +1436 1804 2.08333333333333e+00 +1436 1341 2.08333333333333e+00 +1436 1803 -4.16666666666667e+00 +1436 1431 2.08333333333333e+00 +1436 1283 -2.08333333333333e+00 +1436 1442 -1.87500000000000e+01 +1436 1282 -2.08333333333333e+00 +1436 1432 2.08333333333333e+00 +1436 1434 -4.16666666666667e+00 +1436 1281 2.08333333333333e+00 +1436 1440 4.16666666666667e+00 +1437 1437 6.25000000000000e+01 +1437 1283 4.16666666666667e+00 +1437 1439 -8.33333333333333e+00 +1437 1346 4.16666666666667e+00 +1437 1432 4.16666666666667e+00 +1437 1433 4.16666666666667e+00 +1437 1281 -6.25000000000000e+00 +1437 1583 -4.16666666666667e+00 +1437 1582 8.33333333333333e+00 +1437 1581 -1.25000000000000e+01 +1437 1344 -6.25000000000000e+00 +1437 1441 4.16666666666667e+00 +1437 1438 -8.33333333333333e+00 +1437 1811 -4.16666666666667e+00 +1437 1345 -2.08333333333333e+00 +1437 1810 2.08333333333333e+00 +1437 1442 4.16666666666667e+00 +1437 1282 -2.08333333333333e+00 +1437 1440 -1.87500000000000e+01 +1437 2066 -4.16666666666667e+00 +1437 2426 4.16666666666667e+00 +1437 2425 4.16666666666667e+00 +1437 2424 -1.87500000000000e+01 +1437 2062 -4.16666666666667e+00 +1437 2063 -4.16666666666667e+00 +1437 2330 4.16666666666667e+00 +1437 2329 -8.33333333333333e+00 +1437 2065 2.08333333333333e+00 +1438 1438 6.25000000000000e+01 +1438 1431 4.16666666666667e+00 +1438 1433 -8.33333333333333e+00 +1438 1283 4.16666666666667e+00 +1438 1282 -6.25000000000000e+00 +1438 1583 8.33333333333333e+00 +1438 1439 -8.33333333333333e+00 +1438 1346 4.16666666666667e+00 +1438 1582 -3.75000000000000e+01 +1438 1345 -6.25000000000000e+00 +1438 1581 8.33333333333333e+00 +1438 1811 2.08333333333333e+00 +1438 1440 4.16666666666667e+00 +1438 1437 -8.33333333333333e+00 +1438 1344 -2.08333333333333e+00 +1438 1809 2.08333333333333e+00 +1438 1442 -2.08333333333333e+00 +1438 1441 -6.25000000000000e+00 +1438 1281 -2.08333333333333e+00 +1438 2066 2.08333333333333e+00 +1438 2426 -2.08333333333333e+00 +1438 2425 -6.25000000000000e+00 +1438 2424 4.16666666666667e+00 +1438 2061 -4.16666666666667e+00 +1438 2063 -4.16666666666667e+00 +1438 2330 4.16666666666667e+00 +1438 2064 2.08333333333333e+00 +1438 2328 -8.33333333333333e+00 +1439 1439 6.25000000000000e+01 +1439 1281 4.16666666666667e+00 +1439 1437 -8.33333333333333e+00 +1439 1344 4.16666666666667e+00 +1439 1283 -1.87500000000000e+01 +1439 1432 -8.33333333333333e+00 +1439 1282 4.16666666666667e+00 +1439 1431 4.16666666666667e+00 +1439 1583 -1.25000000000000e+01 +1439 1346 -1.87500000000000e+01 +1439 1582 8.33333333333333e+00 +1439 1438 -8.33333333333333e+00 +1439 1345 4.16666666666667e+00 +1439 1581 -4.16666666666667e+00 +1439 1810 2.08333333333333e+00 +1439 1809 -4.16666666666667e+00 +1439 1441 -2.08333333333333e+00 +1439 1442 -6.25000000000000e+00 +1439 1440 4.16666666666667e+00 +1439 2064 -4.16666666666667e+00 +1439 2426 -6.25000000000000e+00 +1439 2425 -2.08333333333333e+00 +1439 2424 4.16666666666667e+00 +1439 2062 -4.16666666666667e+00 +1439 2329 4.16666666666667e+00 +1439 2061 -4.16666666666667e+00 +1439 2065 2.08333333333333e+00 +1439 2328 4.16666666666667e+00 +1440 1440 6.25000000000000e+01 +1440 1579 4.16666666666667e+00 +1440 1580 4.16666666666667e+00 +1440 1436 4.16666666666667e+00 +1440 1434 -6.25000000000000e+00 +1440 1805 4.16666666666667e+00 +1440 1804 4.16666666666667e+00 +1440 1441 -8.33333333333333e+00 +1440 1803 -1.87500000000000e+01 +1440 1586 -4.16666666666667e+00 +1440 1442 -8.33333333333333e+00 +1440 1433 -4.16666666666667e+00 +1440 1583 4.16666666666667e+00 +1440 1438 4.16666666666667e+00 +1440 1585 8.33333333333333e+00 +1440 1582 -8.33333333333333e+00 +1440 1439 4.16666666666667e+00 +1440 1283 -4.16666666666667e+00 +1440 1282 2.08333333333333e+00 +1440 1432 -4.16666666666667e+00 +1440 1437 -1.87500000000000e+01 +1440 1811 4.16666666666667e+00 +1440 1349 -4.16666666666667e+00 +1440 1810 -2.08333333333333e+00 +1440 1348 2.08333333333333e+00 +1440 1809 -6.25000000000000e+00 +1440 1435 -2.08333333333333e+00 +1440 1584 -1.25000000000000e+01 +1441 1441 6.25000000000000e+01 +1441 1434 -2.08333333333333e+00 +1441 1578 4.16666666666667e+00 +1441 1580 -8.33333333333333e+00 +1441 1283 2.08333333333333e+00 +1441 1435 -6.25000000000000e+00 +1441 1805 -2.08333333333333e+00 +1441 1349 2.08333333333333e+00 +1441 1804 -6.25000000000000e+00 +1441 1803 4.16666666666667e+00 +1441 1440 -8.33333333333333e+00 +1441 1439 -2.08333333333333e+00 +1441 1437 4.16666666666667e+00 +1441 1433 -4.16666666666667e+00 +1441 1583 4.16666666666667e+00 +1441 1584 8.33333333333333e+00 +1441 1581 -8.33333333333333e+00 +1441 1438 -6.25000000000000e+00 +1441 1281 2.08333333333333e+00 +1441 1431 -4.16666666666667e+00 +1441 1811 4.16666666666667e+00 +1441 1442 -8.33333333333333e+00 +1441 1586 8.33333333333333e+00 +1441 1810 -6.25000000000000e+00 +1441 1436 4.16666666666667e+00 +1441 1585 -3.75000000000000e+01 +1441 1809 -2.08333333333333e+00 +1441 1347 2.08333333333333e+00 +1442 1442 6.25000000000000e+01 +1442 1579 -8.33333333333333e+00 +1442 1578 4.16666666666667e+00 +1442 1436 -1.87500000000000e+01 +1442 1282 2.08333333333333e+00 +1442 1434 4.16666666666667e+00 +1442 1805 -6.25000000000000e+00 +1442 1804 -2.08333333333333e+00 +1442 1348 2.08333333333333e+00 +1442 1803 4.16666666666667e+00 +1442 1584 -4.16666666666667e+00 +1442 1438 -2.08333333333333e+00 +1442 1440 -8.33333333333333e+00 +1442 1431 -4.16666666666667e+00 +1442 1581 4.16666666666667e+00 +1442 1432 -4.16666666666667e+00 +1442 1582 4.16666666666667e+00 +1442 1439 -6.25000000000000e+00 +1442 1437 4.16666666666667e+00 +1442 1281 -4.16666666666667e+00 +1442 1811 -1.87500000000000e+01 +1442 1435 4.16666666666667e+00 +1442 1586 -1.25000000000000e+01 +1442 1810 4.16666666666667e+00 +1442 1441 -8.33333333333333e+00 +1442 1585 8.33333333333333e+00 +1442 1809 4.16666666666667e+00 +1442 1347 -4.16666666666667e+00 +1443 1443 6.25000000000000e+01 +1443 1807 4.16666666666667e+00 +1443 1808 4.16666666666667e+00 +1443 1450 4.16666666666667e+00 +1443 1449 -6.25000000000000e+00 +1443 1445 -8.33333333333333e+00 +1443 1598 4.16666666666667e+00 +1443 1597 4.16666666666667e+00 +1443 1596 -1.87500000000000e+01 +1443 1603 -4.16666666666667e+00 +1443 1444 -8.33333333333333e+00 +1443 1448 4.16666666666667e+00 +1443 1456 -4.16666666666667e+00 +1443 1708 4.16666666666667e+00 +1443 1604 8.33333333333333e+00 +1443 1709 -8.33333333333333e+00 +1443 1286 2.08333333333333e+00 +1443 1457 -4.16666666666667e+00 +1443 1447 4.16666666666667e+00 +1443 1285 -4.16666666666667e+00 +1443 1446 -1.87500000000000e+01 +1443 1592 -2.08333333333333e+00 +1443 1307 2.08333333333333e+00 +1443 1591 4.16666666666667e+00 +1443 1306 -4.16666666666667e+00 +1443 1590 -6.25000000000000e+00 +1443 1451 -2.08333333333333e+00 +1443 1602 -1.25000000000000e+01 +1444 1444 6.25000000000000e+01 +1444 1806 4.16666666666667e+00 +1444 1808 -8.33333333333333e+00 +1444 1286 2.08333333333333e+00 +1444 1450 -1.87500000000000e+01 +1444 1449 4.16666666666667e+00 +1444 1598 -2.08333333333333e+00 +1444 1307 2.08333333333333e+00 +1444 1597 -6.25000000000000e+00 +1444 1596 4.16666666666667e+00 +1444 1602 -4.16666666666667e+00 +1444 1448 -2.08333333333333e+00 +1444 1443 -8.33333333333333e+00 +1444 1455 -4.16666666666667e+00 +1444 1707 4.16666666666667e+00 +1444 1457 -4.16666666666667e+00 +1444 1709 4.16666666666667e+00 +1444 1447 -6.25000000000000e+00 +1444 1446 4.16666666666667e+00 +1444 1284 -4.16666666666667e+00 +1444 1592 4.16666666666667e+00 +1444 1445 -8.33333333333333e+00 +1444 1604 8.33333333333333e+00 +1444 1591 -1.87500000000000e+01 +1444 1451 4.16666666666667e+00 +1444 1603 -1.25000000000000e+01 +1444 1590 4.16666666666667e+00 +1444 1305 -4.16666666666667e+00 +1445 1445 6.25000000000000e+01 +1445 1450 4.16666666666667e+00 +1445 1807 -8.33333333333333e+00 +1445 1806 4.16666666666667e+00 +1445 1451 -6.25000000000000e+00 +1445 1285 2.08333333333333e+00 +1445 1598 -6.25000000000000e+00 +1445 1597 -2.08333333333333e+00 +1445 1306 2.08333333333333e+00 +1445 1443 -8.33333333333333e+00 +1445 1596 4.16666666666667e+00 +1445 1447 -2.08333333333333e+00 +1445 1446 4.16666666666667e+00 +1445 1456 -4.16666666666667e+00 +1445 1708 4.16666666666667e+00 +1445 1602 8.33333333333333e+00 +1445 1707 -8.33333333333333e+00 +1445 1448 -6.25000000000000e+00 +1445 1284 2.08333333333333e+00 +1445 1455 -4.16666666666667e+00 +1445 1592 -6.25000000000000e+00 +1445 1449 -2.08333333333333e+00 +1445 1604 -3.75000000000000e+01 +1445 1591 4.16666666666667e+00 +1445 1444 -8.33333333333333e+00 +1445 1603 8.33333333333333e+00 +1445 1590 -2.08333333333333e+00 +1445 1305 2.08333333333333e+00 +1446 1446 6.25000000000000e+01 +1446 1453 -4.16666666666667e+00 +1446 1706 4.16666666666667e+00 +1446 1705 4.16666666666667e+00 +1446 1704 -1.87500000000000e+01 +1446 1460 -4.16666666666667e+00 +1446 1459 -4.16666666666667e+00 +1446 1712 -8.33333333333333e+00 +1446 1711 4.16666666666667e+00 +1446 1445 4.16666666666667e+00 +1446 1448 -8.33333333333333e+00 +1446 1709 8.33333333333333e+00 +1446 1456 4.16666666666667e+00 +1446 1708 -4.16666666666667e+00 +1446 1325 -2.08333333333333e+00 +1446 1592 2.08333333333333e+00 +1446 1324 4.16666666666667e+00 +1446 1591 -4.16666666666667e+00 +1446 1323 -6.25000000000000e+00 +1446 1707 -1.25000000000000e+01 +1446 1286 -2.08333333333333e+00 +1446 1457 4.16666666666667e+00 +1446 1447 -8.33333333333333e+00 +1446 1285 4.16666666666667e+00 +1446 1444 4.16666666666667e+00 +1446 1454 2.08333333333333e+00 +1446 1284 -6.25000000000000e+00 +1446 1443 -1.87500000000000e+01 +1447 1447 6.25000000000000e+01 +1447 1452 -4.16666666666667e+00 +1447 1706 -2.08333333333333e+00 +1447 1705 -6.25000000000000e+00 +1447 1704 4.16666666666667e+00 +1447 1460 -4.16666666666667e+00 +1447 1712 4.16666666666667e+00 +1447 1458 -4.16666666666667e+00 +1447 1710 4.16666666666667e+00 +1447 1445 -2.08333333333333e+00 +1447 1592 2.08333333333333e+00 +1447 1455 4.16666666666667e+00 +1447 1707 -4.16666666666667e+00 +1447 1325 4.16666666666667e+00 +1447 1448 -8.33333333333333e+00 +1447 1709 8.33333333333333e+00 +1447 1324 -1.87500000000000e+01 +1447 1708 -1.25000000000000e+01 +1447 1323 4.16666666666667e+00 +1447 1590 -4.16666666666667e+00 +1447 1286 4.16666666666667e+00 +1447 1457 -8.33333333333333e+00 +1447 1454 2.08333333333333e+00 +1447 1285 -1.87500000000000e+01 +1447 1444 -6.25000000000000e+00 +1447 1446 -8.33333333333333e+00 +1447 1284 4.16666666666667e+00 +1447 1443 4.16666666666667e+00 +1448 1448 6.25000000000000e+01 +1448 1453 2.08333333333333e+00 +1448 1706 -6.25000000000000e+00 +1448 1705 -2.08333333333333e+00 +1448 1704 4.16666666666667e+00 +1448 1458 -4.16666666666667e+00 +1448 1459 -4.16666666666667e+00 +1448 1711 4.16666666666667e+00 +1448 1710 -8.33333333333333e+00 +1448 1444 -2.08333333333333e+00 +1448 1591 2.08333333333333e+00 +1448 1443 4.16666666666667e+00 +1448 1446 -8.33333333333333e+00 +1448 1707 8.33333333333333e+00 +1448 1325 -6.25000000000000e+00 +1448 1709 -3.75000000000000e+01 +1448 1324 4.16666666666667e+00 +1448 1447 -8.33333333333333e+00 +1448 1708 8.33333333333333e+00 +1448 1323 -2.08333333333333e+00 +1448 1590 2.08333333333333e+00 +1448 1452 2.08333333333333e+00 +1448 1286 -6.25000000000000e+00 +1448 1445 -6.25000000000000e+00 +1448 1285 4.16666666666667e+00 +1448 1456 -8.33333333333333e+00 +1448 1284 -2.08333333333333e+00 +1448 1455 4.16666666666667e+00 +1449 1449 2.50000000000000e+01 +1449 1445 -2.08333333333333e+00 +1449 1456 2.08333333333333e+00 +1449 1807 -2.08333333333333e+00 +1449 1286 2.08333333333333e+00 +1449 1457 -4.16666666666667e+00 +1449 1285 2.08333333333333e+00 +1449 1450 -4.16666666666667e+00 +1449 1444 4.16666666666667e+00 +1449 1284 -6.25000000000000e+00 +1449 1443 -6.25000000000000e+00 +1449 1451 -4.16666666666667e+00 +1449 1343 2.08333333333333e+00 +1449 1808 4.16666666666667e+00 +1449 1342 2.08333333333333e+00 +1449 1597 -4.16666666666667e+00 +1449 1598 2.08333333333333e+00 +1449 1341 -6.25000000000000e+00 +1449 1806 -6.25000000000000e+00 +1450 1450 2.91666666666667e+01 +1450 1445 4.16666666666667e+00 +1450 1808 4.16666666666667e+00 +1450 1455 2.08333333333333e+00 +1450 1806 -2.08333333333333e+00 +1450 1286 -2.08333333333333e+00 +1450 1457 2.08333333333333e+00 +1450 1285 -2.08333333333333e+00 +1450 1444 -1.87500000000000e+01 +1450 1284 2.08333333333333e+00 +1450 1449 -4.16666666666667e+00 +1450 1443 4.16666666666667e+00 +1450 1343 -2.08333333333333e+00 +1450 1598 2.08333333333333e+00 +1450 1451 -8.33333333333333e+00 +1450 1342 -2.08333333333333e+00 +1450 1807 -6.25000000000000e+00 +1450 1341 2.08333333333333e+00 +1450 1596 -4.16666666666667e+00 +1451 1451 2.91666666666667e+01 +1451 1443 -2.08333333333333e+00 +1451 1450 -8.33333333333333e+00 +1451 1444 4.16666666666667e+00 +1451 1807 4.16666666666667e+00 +1451 1286 -2.08333333333333e+00 +1451 1445 -6.25000000000000e+00 +1451 1285 -2.08333333333333e+00 +1451 1456 2.08333333333333e+00 +1451 1284 2.08333333333333e+00 +1451 1455 -4.16666666666667e+00 +1451 1596 2.08333333333333e+00 +1451 1343 -2.08333333333333e+00 +1451 1808 -1.87500000000000e+01 +1451 1342 -2.08333333333333e+00 +1451 1597 2.08333333333333e+00 +1451 1449 -4.16666666666667e+00 +1451 1341 2.08333333333333e+00 +1451 1806 4.16666666666667e+00 +1452 1452 2.50000000000000e+01 +1452 1706 -2.08333333333333e+00 +1452 1822 2.08333333333333e+00 +1452 1459 -2.08333333333333e+00 +1452 1352 2.08333333333333e+00 +1452 1823 -4.16666666666667e+00 +1452 1351 2.08333333333333e+00 +1452 1453 -4.16666666666667e+00 +1452 1705 4.16666666666667e+00 +1452 1350 -6.25000000000000e+00 +1452 1704 -6.25000000000000e+00 +1452 1454 -4.16666666666667e+00 +1452 1286 2.08333333333333e+00 +1452 1460 4.16666666666667e+00 +1452 1285 2.08333333333333e+00 +1452 1447 -4.16666666666667e+00 +1452 1448 2.08333333333333e+00 +1452 1284 -6.25000000000000e+00 +1452 1458 -6.25000000000000e+00 +1453 1453 2.91666666666667e+01 +1453 1706 4.16666666666667e+00 +1453 1460 4.16666666666667e+00 +1453 1821 2.08333333333333e+00 +1453 1458 -2.08333333333333e+00 +1453 1352 -2.08333333333333e+00 +1453 1823 2.08333333333333e+00 +1453 1351 -2.08333333333333e+00 +1453 1705 -1.87500000000000e+01 +1453 1350 2.08333333333333e+00 +1453 1452 -4.16666666666667e+00 +1453 1704 4.16666666666667e+00 +1453 1286 -2.08333333333333e+00 +1453 1448 2.08333333333333e+00 +1453 1454 -8.33333333333333e+00 +1453 1285 -2.08333333333333e+00 +1453 1459 -6.25000000000000e+00 +1453 1284 2.08333333333333e+00 +1453 1446 -4.16666666666667e+00 +1454 1454 2.91666666666667e+01 +1454 1704 -2.08333333333333e+00 +1454 1453 -8.33333333333333e+00 +1454 1705 4.16666666666667e+00 +1454 1459 4.16666666666667e+00 +1454 1352 -2.08333333333333e+00 +1454 1706 -6.25000000000000e+00 +1454 1351 -2.08333333333333e+00 +1454 1822 2.08333333333333e+00 +1454 1350 2.08333333333333e+00 +1454 1821 -4.16666666666667e+00 +1454 1446 2.08333333333333e+00 +1454 1286 -2.08333333333333e+00 +1454 1460 -1.87500000000000e+01 +1454 1285 -2.08333333333333e+00 +1454 1447 2.08333333333333e+00 +1454 1452 -4.16666666666667e+00 +1454 1284 2.08333333333333e+00 +1454 1458 4.16666666666667e+00 +1455 1455 6.25000000000000e+01 +1455 1456 -8.33333333333333e+00 +1455 1829 -4.16666666666667e+00 +1455 1354 -2.08333333333333e+00 +1455 1828 2.08333333333333e+00 +1455 1460 4.16666666666667e+00 +1455 1285 -2.08333333333333e+00 +1455 1458 -1.87500000000000e+01 +1455 1450 2.08333333333333e+00 +1455 1286 4.16666666666667e+00 +1455 1451 -4.16666666666667e+00 +1455 1457 -8.33333333333333e+00 +1455 1808 4.16666666666667e+00 +1455 1355 4.16666666666667e+00 +1455 1807 4.16666666666667e+00 +1455 1806 -1.87500000000000e+01 +1455 1444 -4.16666666666667e+00 +1455 1447 4.16666666666667e+00 +1455 1448 4.16666666666667e+00 +1455 1445 -4.16666666666667e+00 +1455 1284 -6.25000000000000e+00 +1455 1709 -4.16666666666667e+00 +1455 1604 4.16666666666667e+00 +1455 1708 8.33333333333333e+00 +1455 1603 -8.33333333333333e+00 +1455 1707 -1.25000000000000e+01 +1455 1459 4.16666666666667e+00 +1455 1353 -6.25000000000000e+00 +1456 1456 6.25000000000000e+01 +1456 1829 2.08333333333333e+00 +1456 1458 4.16666666666667e+00 +1456 1455 -8.33333333333333e+00 +1456 1353 -2.08333333333333e+00 +1456 1827 2.08333333333333e+00 +1456 1459 -6.25000000000000e+00 +1456 1284 -2.08333333333333e+00 +1456 1449 2.08333333333333e+00 +1456 1451 2.08333333333333e+00 +1456 1808 -2.08333333333333e+00 +1456 1807 -6.25000000000000e+00 +1456 1806 4.16666666666667e+00 +1456 1443 -4.16666666666667e+00 +1456 1446 4.16666666666667e+00 +1456 1445 -4.16666666666667e+00 +1456 1604 4.16666666666667e+00 +1456 1448 -8.33333333333333e+00 +1456 1286 4.16666666666667e+00 +1456 1285 -6.25000000000000e+00 +1456 1709 8.33333333333333e+00 +1456 1457 -8.33333333333333e+00 +1456 1355 4.16666666666667e+00 +1456 1708 -3.75000000000000e+01 +1456 1460 -2.08333333333333e+00 +1456 1354 -6.25000000000000e+00 +1456 1707 8.33333333333333e+00 +1456 1602 -8.33333333333333e+00 +1457 1457 6.25000000000000e+01 +1457 1828 2.08333333333333e+00 +1457 1827 -4.16666666666667e+00 +1457 1460 -6.25000000000000e+00 +1457 1458 4.16666666666667e+00 +1457 1450 2.08333333333333e+00 +1457 1284 4.16666666666667e+00 +1457 1449 -4.16666666666667e+00 +1457 1808 -6.25000000000000e+00 +1457 1807 -2.08333333333333e+00 +1457 1455 -8.33333333333333e+00 +1457 1806 4.16666666666667e+00 +1457 1353 4.16666666666667e+00 +1457 1444 -4.16666666666667e+00 +1457 1603 4.16666666666667e+00 +1457 1286 -1.87500000000000e+01 +1457 1447 -8.33333333333333e+00 +1457 1285 4.16666666666667e+00 +1457 1446 4.16666666666667e+00 +1457 1443 -4.16666666666667e+00 +1457 1709 -1.25000000000000e+01 +1457 1459 -2.08333333333333e+00 +1457 1355 -1.87500000000000e+01 +1457 1708 8.33333333333333e+00 +1457 1456 -8.33333333333333e+00 +1457 1354 4.16666666666667e+00 +1457 1707 -4.16666666666667e+00 +1457 1602 4.16666666666667e+00 +1458 1458 6.25000000000000e+01 +1458 1705 4.16666666666667e+00 +1458 1706 4.16666666666667e+00 +1458 1454 4.16666666666667e+00 +1458 1452 -6.25000000000000e+00 +1458 1823 4.16666666666667e+00 +1458 1822 4.16666666666667e+00 +1458 1459 -8.33333333333333e+00 +1458 1821 -1.87500000000000e+01 +1458 1712 -4.16666666666667e+00 +1458 1460 -8.33333333333333e+00 +1458 1448 -4.16666666666667e+00 +1458 1709 4.16666666666667e+00 +1458 1456 4.16666666666667e+00 +1458 1711 8.33333333333333e+00 +1458 1708 -8.33333333333333e+00 +1458 1457 4.16666666666667e+00 +1458 1286 -4.16666666666667e+00 +1458 1285 2.08333333333333e+00 +1458 1447 -4.16666666666667e+00 +1458 1455 -1.87500000000000e+01 +1458 1829 4.16666666666667e+00 +1458 1358 -4.16666666666667e+00 +1458 1828 -2.08333333333333e+00 +1458 1357 2.08333333333333e+00 +1458 1827 -6.25000000000000e+00 +1458 1453 -2.08333333333333e+00 +1458 1710 -1.25000000000000e+01 +1459 1459 6.25000000000000e+01 +1459 1452 -2.08333333333333e+00 +1459 1704 4.16666666666667e+00 +1459 1706 -8.33333333333333e+00 +1459 1286 2.08333333333333e+00 +1459 1453 -6.25000000000000e+00 +1459 1823 -2.08333333333333e+00 +1459 1358 2.08333333333333e+00 +1459 1822 -6.25000000000000e+00 +1459 1821 4.16666666666667e+00 +1459 1458 -8.33333333333333e+00 +1459 1457 -2.08333333333333e+00 +1459 1455 4.16666666666667e+00 +1459 1448 -4.16666666666667e+00 +1459 1709 4.16666666666667e+00 +1459 1710 8.33333333333333e+00 +1459 1707 -8.33333333333333e+00 +1459 1456 -6.25000000000000e+00 +1459 1284 2.08333333333333e+00 +1459 1446 -4.16666666666667e+00 +1459 1829 4.16666666666667e+00 +1459 1460 -8.33333333333333e+00 +1459 1712 8.33333333333333e+00 +1459 1828 -6.25000000000000e+00 +1459 1454 4.16666666666667e+00 +1459 1711 -3.75000000000000e+01 +1459 1827 -2.08333333333333e+00 +1459 1356 2.08333333333333e+00 +1460 1460 6.25000000000000e+01 +1460 1705 -8.33333333333333e+00 +1460 1704 4.16666666666667e+00 +1460 1454 -1.87500000000000e+01 +1460 1285 2.08333333333333e+00 +1460 1452 4.16666666666667e+00 +1460 1823 -6.25000000000000e+00 +1460 1822 -2.08333333333333e+00 +1460 1357 2.08333333333333e+00 +1460 1821 4.16666666666667e+00 +1460 1710 -4.16666666666667e+00 +1460 1456 -2.08333333333333e+00 +1460 1458 -8.33333333333333e+00 +1460 1446 -4.16666666666667e+00 +1460 1707 4.16666666666667e+00 +1460 1447 -4.16666666666667e+00 +1460 1708 4.16666666666667e+00 +1460 1457 -6.25000000000000e+00 +1460 1455 4.16666666666667e+00 +1460 1284 -4.16666666666667e+00 +1460 1829 -1.87500000000000e+01 +1460 1453 4.16666666666667e+00 +1460 1712 -1.25000000000000e+01 +1460 1828 4.16666666666667e+00 +1460 1459 -8.33333333333333e+00 +1460 1711 8.33333333333333e+00 +1460 1827 4.16666666666667e+00 +1460 1356 -4.16666666666667e+00 +1461 1461 6.25000000000000e+01 +1461 1825 4.16666666666667e+00 +1461 1826 4.16666666666667e+00 +1461 1465 4.16666666666667e+00 +1461 1464 -6.25000000000000e+00 +1461 1463 -8.33333333333333e+00 +1461 1724 4.16666666666667e+00 +1461 1723 4.16666666666667e+00 +1461 1722 -1.87500000000000e+01 +1461 1729 -4.16666666666667e+00 +1461 1462 -8.33333333333333e+00 +1461 1730 8.33333333333333e+00 +1461 1718 -2.08333333333333e+00 +1461 1328 2.08333333333333e+00 +1461 1717 4.16666666666667e+00 +1461 1327 -4.16666666666667e+00 +1461 1716 -6.25000000000000e+00 +1461 1466 -2.08333333333333e+00 +1461 1728 -1.25000000000000e+01 +1461 194 4.16666666666667e+00 +1461 199 -4.16666666666667e+00 +1461 364 4.16666666666667e+00 +1461 365 -8.33333333333333e+00 +1461 11 2.08333333333333e+00 +1461 200 -4.16666666666667e+00 +1461 193 4.16666666666667e+00 +1461 10 -4.16666666666667e+00 +1461 192 -1.87500000000000e+01 +1462 1462 6.25000000000000e+01 +1462 1824 4.16666666666667e+00 +1462 1826 -8.33333333333333e+00 +1462 1465 -1.87500000000000e+01 +1462 1464 4.16666666666667e+00 +1462 1724 -2.08333333333333e+00 +1462 1328 2.08333333333333e+00 +1462 1723 -6.25000000000000e+00 +1462 1722 4.16666666666667e+00 +1462 1728 -4.16666666666667e+00 +1462 1461 -8.33333333333333e+00 +1462 1718 4.16666666666667e+00 +1462 1463 -8.33333333333333e+00 +1462 1730 8.33333333333333e+00 +1462 1717 -1.87500000000000e+01 +1462 1466 4.16666666666667e+00 +1462 1729 -1.25000000000000e+01 +1462 1716 4.16666666666667e+00 +1462 1326 -4.16666666666667e+00 +1462 11 2.08333333333333e+00 +1462 194 -2.08333333333333e+00 +1462 198 -4.16666666666667e+00 +1462 363 4.16666666666667e+00 +1462 200 -4.16666666666667e+00 +1462 365 4.16666666666667e+00 +1462 193 -6.25000000000000e+00 +1462 192 4.16666666666667e+00 +1462 9 -4.16666666666667e+00 +1463 1463 6.25000000000000e+01 +1463 1465 4.16666666666667e+00 +1463 1825 -8.33333333333333e+00 +1463 1824 4.16666666666667e+00 +1463 1466 -6.25000000000000e+00 +1463 1724 -6.25000000000000e+00 +1463 1723 -2.08333333333333e+00 +1463 1327 2.08333333333333e+00 +1463 1461 -8.33333333333333e+00 +1463 1722 4.16666666666667e+00 +1463 1728 8.33333333333333e+00 +1463 1718 -6.25000000000000e+00 +1463 1464 -2.08333333333333e+00 +1463 1730 -3.75000000000000e+01 +1463 1717 4.16666666666667e+00 +1463 1462 -8.33333333333333e+00 +1463 1729 8.33333333333333e+00 +1463 1716 -2.08333333333333e+00 +1463 1326 2.08333333333333e+00 +1463 10 2.08333333333333e+00 +1463 193 -2.08333333333333e+00 +1463 192 4.16666666666667e+00 +1463 199 -4.16666666666667e+00 +1463 364 4.16666666666667e+00 +1463 363 -8.33333333333333e+00 +1463 194 -6.25000000000000e+00 +1463 9 2.08333333333333e+00 +1463 198 -4.16666666666667e+00 +1464 1464 2.50000000000000e+01 +1464 1463 -2.08333333333333e+00 +1464 1825 -2.08333333333333e+00 +1464 1465 -4.16666666666667e+00 +1464 1462 4.16666666666667e+00 +1464 1461 -6.25000000000000e+00 +1464 1466 -4.16666666666667e+00 +1464 1352 2.08333333333333e+00 +1464 1826 4.16666666666667e+00 +1464 1351 2.08333333333333e+00 +1464 1723 -4.16666666666667e+00 +1464 1724 2.08333333333333e+00 +1464 1350 -6.25000000000000e+00 +1464 1824 -6.25000000000000e+00 +1464 199 2.08333333333333e+00 +1464 11 2.08333333333333e+00 +1464 200 -4.16666666666667e+00 +1464 10 2.08333333333333e+00 +1464 9 -6.25000000000000e+00 +1465 1465 2.91666666666667e+01 +1465 1463 4.16666666666667e+00 +1465 1826 4.16666666666667e+00 +1465 1824 -2.08333333333333e+00 +1465 1462 -1.87500000000000e+01 +1465 1464 -4.16666666666667e+00 +1465 1461 4.16666666666667e+00 +1465 1352 -2.08333333333333e+00 +1465 1724 2.08333333333333e+00 +1465 1466 -8.33333333333333e+00 +1465 1351 -2.08333333333333e+00 +1465 1825 -6.25000000000000e+00 +1465 1350 2.08333333333333e+00 +1465 1722 -4.16666666666667e+00 +1465 198 2.08333333333333e+00 +1465 11 -2.08333333333333e+00 +1465 200 2.08333333333333e+00 +1465 10 -2.08333333333333e+00 +1465 9 2.08333333333333e+00 +1466 1466 2.91666666666667e+01 +1466 1461 -2.08333333333333e+00 +1466 1465 -8.33333333333333e+00 +1466 1462 4.16666666666667e+00 +1466 1825 4.16666666666667e+00 +1466 1463 -6.25000000000000e+00 +1466 1722 2.08333333333333e+00 +1466 1352 -2.08333333333333e+00 +1466 1826 -1.87500000000000e+01 +1466 1351 -2.08333333333333e+00 +1466 1723 2.08333333333333e+00 +1466 1464 -4.16666666666667e+00 +1466 1350 2.08333333333333e+00 +1466 1824 4.16666666666667e+00 +1466 11 -2.08333333333333e+00 +1466 10 -2.08333333333333e+00 +1466 199 2.08333333333333e+00 +1466 9 2.08333333333333e+00 +1466 198 -4.16666666666667e+00 +1467 1467 6.25000000000000e+01 +1467 1619 -4.16666666666667e+00 +1467 1468 -8.33333333333333e+00 +1467 1618 8.33333333333333e+00 +1467 1310 4.16666666666667e+00 +1467 1309 -2.08333333333333e+00 +1467 1308 -6.25000000000000e+00 +1467 1617 -1.25000000000000e+01 +1467 1469 -8.33333333333333e+00 +1467 1289 4.16666666666667e+00 +1467 1288 -2.08333333333333e+00 +1467 1474 4.16666666666667e+00 +1467 1475 4.16666666666667e+00 +1467 1287 -6.25000000000000e+00 +1467 1622 4.16666666666667e+00 +1467 1478 -4.16666666666667e+00 +1467 1471 2.08333333333333e+00 +1467 1477 -4.16666666666667e+00 +1467 1472 -4.16666666666667e+00 +1467 1616 4.16666666666667e+00 +1467 1615 4.16666666666667e+00 +1467 1621 -8.33333333333333e+00 +1467 1614 -1.87500000000000e+01 +1467 2098 4.16666666666667e+00 +1467 2354 -4.16666666666667e+00 +1467 2353 2.08333333333333e+00 +1467 2099 4.16666666666667e+00 +1467 2097 -1.87500000000000e+01 +1468 1468 6.25000000000000e+01 +1468 1467 -8.33333333333333e+00 +1468 1617 8.33333333333333e+00 +1468 1310 4.16666666666667e+00 +1468 1469 -8.33333333333333e+00 +1468 1619 8.33333333333333e+00 +1468 1309 -6.25000000000000e+00 +1468 1618 -3.75000000000000e+01 +1468 1308 -2.08333333333333e+00 +1468 1289 4.16666666666667e+00 +1468 1475 -8.33333333333333e+00 +1468 1288 -6.25000000000000e+00 +1468 1287 -2.08333333333333e+00 +1468 1473 4.16666666666667e+00 +1468 1470 2.08333333333333e+00 +1468 1476 -4.16666666666667e+00 +1468 1472 2.08333333333333e+00 +1468 1478 -4.16666666666667e+00 +1468 1616 -2.08333333333333e+00 +1468 1622 4.16666666666667e+00 +1468 1615 -6.25000000000000e+00 +1468 1614 4.16666666666667e+00 +1468 1620 -8.33333333333333e+00 +1468 2099 -2.08333333333333e+00 +1468 2097 4.16666666666667e+00 +1468 2352 2.08333333333333e+00 +1468 2354 2.08333333333333e+00 +1468 2098 -6.25000000000000e+00 +1469 1469 6.25000000000000e+01 +1469 1617 -4.16666666666667e+00 +1469 1310 -1.87500000000000e+01 +1469 1619 -1.25000000000000e+01 +1469 1309 4.16666666666667e+00 +1469 1468 -8.33333333333333e+00 +1469 1618 8.33333333333333e+00 +1469 1308 4.16666666666667e+00 +1469 1473 4.16666666666667e+00 +1469 1289 -1.87500000000000e+01 +1469 1288 4.16666666666667e+00 +1469 1474 -8.33333333333333e+00 +1469 1467 -8.33333333333333e+00 +1469 1287 4.16666666666667e+00 +1469 1620 4.16666666666667e+00 +1469 1476 -4.16666666666667e+00 +1469 1471 2.08333333333333e+00 +1469 1477 -4.16666666666667e+00 +1469 1470 -4.16666666666667e+00 +1469 1616 -6.25000000000000e+00 +1469 1615 -2.08333333333333e+00 +1469 1621 4.16666666666667e+00 +1469 1614 4.16666666666667e+00 +1469 2353 2.08333333333333e+00 +1469 2098 -2.08333333333333e+00 +1469 2352 -4.16666666666667e+00 +1469 2099 -6.25000000000000e+00 +1469 2097 4.16666666666667e+00 +1470 1470 2.50000000000000e+01 +1470 1468 2.08333333333333e+00 +1470 1841 2.08333333333333e+00 +1470 1478 -2.08333333333333e+00 +1470 1289 2.08333333333333e+00 +1470 1469 -4.16666666666667e+00 +1470 1288 2.08333333333333e+00 +1470 1471 -4.16666666666667e+00 +1470 1477 4.16666666666667e+00 +1470 1287 -6.25000000000000e+00 +1470 1476 -6.25000000000000e+00 +1470 1472 -4.16666666666667e+00 +1470 1361 2.08333333333333e+00 +1470 1616 4.16666666666667e+00 +1470 1360 2.08333333333333e+00 +1470 1840 -4.16666666666667e+00 +1470 1615 -2.08333333333333e+00 +1470 1359 -6.25000000000000e+00 +1470 1614 -6.25000000000000e+00 +1471 1471 2.91666666666667e+01 +1471 1467 2.08333333333333e+00 +1471 1616 4.16666666666667e+00 +1471 1472 -8.33333333333333e+00 +1471 1478 4.16666666666667e+00 +1471 1289 -2.08333333333333e+00 +1471 1469 2.08333333333333e+00 +1471 1288 -2.08333333333333e+00 +1471 1477 -1.87500000000000e+01 +1471 1287 2.08333333333333e+00 +1471 1470 -4.16666666666667e+00 +1471 1476 4.16666666666667e+00 +1471 1361 -2.08333333333333e+00 +1471 1841 2.08333333333333e+00 +1471 1614 -2.08333333333333e+00 +1471 1360 -2.08333333333333e+00 +1471 1615 -6.25000000000000e+00 +1471 1359 2.08333333333333e+00 +1471 1839 -4.16666666666667e+00 +1472 1472 2.91666666666667e+01 +1472 1471 -8.33333333333333e+00 +1472 1477 4.16666666666667e+00 +1472 1839 2.08333333333333e+00 +1472 1476 -2.08333333333333e+00 +1472 1289 -2.08333333333333e+00 +1472 1478 -6.25000000000000e+00 +1472 1288 -2.08333333333333e+00 +1472 1468 2.08333333333333e+00 +1472 1287 2.08333333333333e+00 +1472 1467 -4.16666666666667e+00 +1472 1615 4.16666666666667e+00 +1472 1361 -2.08333333333333e+00 +1472 1616 -1.87500000000000e+01 +1472 1360 -2.08333333333333e+00 +1472 1840 2.08333333333333e+00 +1472 1470 -4.16666666666667e+00 +1472 1359 2.08333333333333e+00 +1472 1614 4.16666666666667e+00 +1473 1473 6.25000000000000e+01 +1473 1468 4.16666666666667e+00 +1473 1619 8.33333333333333e+00 +1473 1618 -4.16666666666667e+00 +1473 1617 -1.25000000000000e+01 +1473 1288 4.16666666666667e+00 +1473 1287 -6.25000000000000e+00 +1473 1474 -8.33333333333333e+00 +1473 1363 4.16666666666667e+00 +1473 1469 4.16666666666667e+00 +1473 1362 -6.25000000000000e+00 +1473 1475 -8.33333333333333e+00 +1473 1478 4.16666666666667e+00 +1473 1364 -2.08333333333333e+00 +1473 1847 2.08333333333333e+00 +1473 1846 -4.16666666666667e+00 +1473 1289 -2.08333333333333e+00 +1473 1477 4.16666666666667e+00 +1473 1476 -1.87500000000000e+01 +1473 2099 -4.16666666666667e+00 +1473 2102 2.08333333333333e+00 +1473 2098 -4.16666666666667e+00 +1473 2365 4.16666666666667e+00 +1473 2101 -4.16666666666667e+00 +1473 2462 4.16666666666667e+00 +1473 2366 -8.33333333333333e+00 +1473 2461 4.16666666666667e+00 +1473 2460 -1.87500000000000e+01 +1474 1474 6.25000000000000e+01 +1474 1289 4.16666666666667e+00 +1474 1467 4.16666666666667e+00 +1474 1619 8.33333333333333e+00 +1474 1475 -8.33333333333333e+00 +1474 1364 4.16666666666667e+00 +1474 1618 -1.25000000000000e+01 +1474 1617 -4.16666666666667e+00 +1474 1288 -1.87500000000000e+01 +1474 1287 4.16666666666667e+00 +1474 1469 -8.33333333333333e+00 +1474 1363 -1.87500000000000e+01 +1474 1473 -8.33333333333333e+00 +1474 1362 4.16666666666667e+00 +1474 1847 2.08333333333333e+00 +1474 1478 -2.08333333333333e+00 +1474 1845 -4.16666666666667e+00 +1474 1477 -6.25000000000000e+00 +1474 1476 4.16666666666667e+00 +1474 2097 -4.16666666666667e+00 +1474 2364 4.16666666666667e+00 +1474 2102 2.08333333333333e+00 +1474 2099 -4.16666666666667e+00 +1474 2100 -4.16666666666667e+00 +1474 2462 -2.08333333333333e+00 +1474 2366 4.16666666666667e+00 +1474 2461 -6.25000000000000e+00 +1474 2460 4.16666666666667e+00 +1475 1475 6.25000000000000e+01 +1475 1468 -8.33333333333333e+00 +1475 1288 4.16666666666667e+00 +1475 1619 -3.75000000000000e+01 +1475 1618 8.33333333333333e+00 +1475 1474 -8.33333333333333e+00 +1475 1363 4.16666666666667e+00 +1475 1617 8.33333333333333e+00 +1475 1289 -6.25000000000000e+00 +1475 1467 4.16666666666667e+00 +1475 1364 -6.25000000000000e+00 +1475 1477 -2.08333333333333e+00 +1475 1473 -8.33333333333333e+00 +1475 1476 4.16666666666667e+00 +1475 1362 -2.08333333333333e+00 +1475 1845 2.08333333333333e+00 +1475 1846 2.08333333333333e+00 +1475 1478 -6.25000000000000e+00 +1475 1287 -2.08333333333333e+00 +1475 2097 -4.16666666666667e+00 +1475 2100 2.08333333333333e+00 +1475 2101 2.08333333333333e+00 +1475 2098 -4.16666666666667e+00 +1475 2462 -6.25000000000000e+00 +1475 2461 -2.08333333333333e+00 +1475 2365 4.16666666666667e+00 +1475 2460 4.16666666666667e+00 +1475 2364 -8.33333333333333e+00 +1476 1476 6.25000000000000e+01 +1476 1619 -8.33333333333333e+00 +1476 1618 4.16666666666667e+00 +1476 1289 2.08333333333333e+00 +1476 1474 4.16666666666667e+00 +1476 1473 -1.87500000000000e+01 +1476 1847 -2.08333333333333e+00 +1476 1367 2.08333333333333e+00 +1476 1846 4.16666666666667e+00 +1476 1845 -6.25000000000000e+00 +1476 1469 -4.16666666666667e+00 +1476 1468 -4.16666666666667e+00 +1476 1616 4.16666666666667e+00 +1476 1472 -2.08333333333333e+00 +1476 1477 -8.33333333333333e+00 +1476 1615 4.16666666666667e+00 +1476 1621 -4.16666666666667e+00 +1476 1288 -4.16666666666667e+00 +1476 1471 4.16666666666667e+00 +1476 1470 -6.25000000000000e+00 +1476 1478 -8.33333333333333e+00 +1476 1841 4.16666666666667e+00 +1476 1622 8.33333333333333e+00 +1476 1840 4.16666666666667e+00 +1476 1366 -4.16666666666667e+00 +1476 1475 4.16666666666667e+00 +1476 1839 -1.87500000000000e+01 +1476 1620 -1.25000000000000e+01 +1477 1477 6.25000000000000e+01 +1477 1619 4.16666666666667e+00 +1477 1617 4.16666666666667e+00 +1477 1474 -6.25000000000000e+00 +1477 1473 4.16666666666667e+00 +1477 1847 4.16666666666667e+00 +1477 1478 -8.33333333333333e+00 +1477 1846 -1.87500000000000e+01 +1477 1845 4.16666666666667e+00 +1477 1467 -4.16666666666667e+00 +1477 1472 4.16666666666667e+00 +1477 1476 -8.33333333333333e+00 +1477 1616 -8.33333333333333e+00 +1477 1622 8.33333333333333e+00 +1477 1614 4.16666666666667e+00 +1477 1620 -4.16666666666667e+00 +1477 1289 2.08333333333333e+00 +1477 1469 -4.16666666666667e+00 +1477 1471 -1.87500000000000e+01 +1477 1287 -4.16666666666667e+00 +1477 1470 4.16666666666667e+00 +1477 1841 -2.08333333333333e+00 +1477 1367 2.08333333333333e+00 +1477 1475 -2.08333333333333e+00 +1477 1840 -6.25000000000000e+00 +1477 1621 -1.25000000000000e+01 +1477 1839 4.16666666666667e+00 +1477 1365 -4.16666666666667e+00 +1478 1478 6.25000000000000e+01 +1478 1618 4.16666666666667e+00 +1478 1473 4.16666666666667e+00 +1478 1617 -8.33333333333333e+00 +1478 1475 -6.25000000000000e+00 +1478 1287 2.08333333333333e+00 +1478 1847 -6.25000000000000e+00 +1478 1846 4.16666666666667e+00 +1478 1477 -8.33333333333333e+00 +1478 1845 -2.08333333333333e+00 +1478 1365 2.08333333333333e+00 +1478 1467 -4.16666666666667e+00 +1478 1471 4.16666666666667e+00 +1478 1614 4.16666666666667e+00 +1478 1470 -2.08333333333333e+00 +1478 1615 -8.33333333333333e+00 +1478 1621 8.33333333333333e+00 +1478 1472 -6.25000000000000e+00 +1478 1288 2.08333333333333e+00 +1478 1468 -4.16666666666667e+00 +1478 1474 -2.08333333333333e+00 +1478 1841 -6.25000000000000e+00 +1478 1622 -3.75000000000000e+01 +1478 1840 -2.08333333333333e+00 +1478 1366 2.08333333333333e+00 +1478 1476 -8.33333333333333e+00 +1478 1839 4.16666666666667e+00 +1478 1620 8.33333333333333e+00 +1479 1479 6.25000000000000e+01 +1479 1745 4.16666666666667e+00 +1479 1744 -8.33333333333333e+00 +1479 1484 4.16666666666667e+00 +1479 1291 2.08333333333333e+00 +1479 1482 -1.87500000000000e+01 +1479 1628 4.16666666666667e+00 +1479 1627 -2.08333333333333e+00 +1479 1312 2.08333333333333e+00 +1479 1626 -6.25000000000000e+00 +1479 1640 -4.16666666666667e+00 +1479 1481 -8.33333333333333e+00 +1479 1486 -2.08333333333333e+00 +1479 1493 -4.16666666666667e+00 +1479 1844 4.16666666666667e+00 +1479 1492 -4.16666666666667e+00 +1479 1843 4.16666666666667e+00 +1479 1487 4.16666666666667e+00 +1479 1292 -4.16666666666667e+00 +1479 1485 -6.25000000000000e+00 +1479 1634 4.16666666666667e+00 +1479 1313 -4.16666666666667e+00 +1479 1633 4.16666666666667e+00 +1479 1480 -8.33333333333333e+00 +1479 1639 8.33333333333333e+00 +1479 1632 -1.87500000000000e+01 +1479 1483 4.16666666666667e+00 +1479 1638 -1.25000000000000e+01 +1480 1480 6.25000000000000e+01 +1480 1745 4.16666666666667e+00 +1480 1482 4.16666666666667e+00 +1480 1743 -8.33333333333333e+00 +1480 1483 -6.25000000000000e+00 +1480 1290 2.08333333333333e+00 +1480 1628 4.16666666666667e+00 +1480 1481 -8.33333333333333e+00 +1480 1627 -6.25000000000000e+00 +1480 1626 -2.08333333333333e+00 +1480 1311 2.08333333333333e+00 +1480 1485 -2.08333333333333e+00 +1480 1487 4.16666666666667e+00 +1480 1640 8.33333333333333e+00 +1480 1844 -8.33333333333333e+00 +1480 1491 -4.16666666666667e+00 +1480 1842 4.16666666666667e+00 +1480 1292 2.08333333333333e+00 +1480 1493 -4.16666666666667e+00 +1480 1486 -6.25000000000000e+00 +1480 1634 -2.08333333333333e+00 +1480 1313 2.08333333333333e+00 +1480 1633 -6.25000000000000e+00 +1480 1484 -2.08333333333333e+00 +1480 1639 -3.75000000000000e+01 +1480 1632 4.16666666666667e+00 +1480 1479 -8.33333333333333e+00 +1480 1638 8.33333333333333e+00 +1481 1481 6.25000000000000e+01 +1481 1744 4.16666666666667e+00 +1481 1743 4.16666666666667e+00 +1481 1484 -6.25000000000000e+00 +1481 1482 4.16666666666667e+00 +1481 1628 -1.87500000000000e+01 +1481 1627 4.16666666666667e+00 +1481 1480 -8.33333333333333e+00 +1481 1626 4.16666666666667e+00 +1481 1638 -4.16666666666667e+00 +1481 1479 -8.33333333333333e+00 +1481 1486 4.16666666666667e+00 +1481 1491 -4.16666666666667e+00 +1481 1842 4.16666666666667e+00 +1481 1639 8.33333333333333e+00 +1481 1843 -8.33333333333333e+00 +1481 1487 -1.87500000000000e+01 +1481 1291 2.08333333333333e+00 +1481 1492 -4.16666666666667e+00 +1481 1485 4.16666666666667e+00 +1481 1290 -4.16666666666667e+00 +1481 1634 -6.25000000000000e+00 +1481 1483 -2.08333333333333e+00 +1481 1640 -1.25000000000000e+01 +1481 1633 -2.08333333333333e+00 +1481 1312 2.08333333333333e+00 +1481 1632 4.16666666666667e+00 +1481 1311 -4.16666666666667e+00 +1482 1482 6.25000000000000e+01 +1482 1496 -4.16666666666667e+00 +1482 1489 2.08333333333333e+00 +1482 1495 -4.16666666666667e+00 +1482 1490 -4.16666666666667e+00 +1482 1742 4.16666666666667e+00 +1482 1741 4.16666666666667e+00 +1482 1747 -8.33333333333333e+00 +1482 1740 -1.87500000000000e+01 +1482 1493 4.16666666666667e+00 +1482 1745 -4.16666666666667e+00 +1482 1483 -8.33333333333333e+00 +1482 1744 8.33333333333333e+00 +1482 1480 4.16666666666667e+00 +1482 1331 4.16666666666667e+00 +1482 1628 -4.16666666666667e+00 +1482 1330 -2.08333333333333e+00 +1482 1627 2.08333333333333e+00 +1482 1329 -6.25000000000000e+00 +1482 1743 -1.25000000000000e+01 +1482 1484 -8.33333333333333e+00 +1482 1292 4.16666666666667e+00 +1482 1481 4.16666666666667e+00 +1482 1291 -2.08333333333333e+00 +1482 1492 4.16666666666667e+00 +1482 1748 4.16666666666667e+00 +1482 1290 -6.25000000000000e+00 +1482 1479 -1.87500000000000e+01 +1483 1483 6.25000000000000e+01 +1483 1494 -4.16666666666667e+00 +1483 1490 2.08333333333333e+00 +1483 1496 -4.16666666666667e+00 +1483 1742 -2.08333333333333e+00 +1483 1748 4.16666666666667e+00 +1483 1741 -6.25000000000000e+00 +1483 1740 4.16666666666667e+00 +1483 1746 -8.33333333333333e+00 +1483 1628 2.08333333333333e+00 +1483 1481 -2.08333333333333e+00 +1483 1482 -8.33333333333333e+00 +1483 1743 8.33333333333333e+00 +1483 1479 4.16666666666667e+00 +1483 1331 4.16666666666667e+00 +1483 1484 -8.33333333333333e+00 +1483 1745 8.33333333333333e+00 +1483 1330 -6.25000000000000e+00 +1483 1744 -3.75000000000000e+01 +1483 1329 -2.08333333333333e+00 +1483 1626 2.08333333333333e+00 +1483 1292 4.16666666666667e+00 +1483 1493 -8.33333333333333e+00 +1483 1488 2.08333333333333e+00 +1483 1291 -6.25000000000000e+00 +1483 1480 -6.25000000000000e+00 +1483 1290 -2.08333333333333e+00 +1483 1491 4.16666666666667e+00 +1484 1484 6.25000000000000e+01 +1484 1494 -4.16666666666667e+00 +1484 1489 2.08333333333333e+00 +1484 1495 -4.16666666666667e+00 +1484 1488 -4.16666666666667e+00 +1484 1742 -6.25000000000000e+00 +1484 1741 -2.08333333333333e+00 +1484 1747 4.16666666666667e+00 +1484 1740 4.16666666666667e+00 +1484 1491 4.16666666666667e+00 +1484 1743 -4.16666666666667e+00 +1484 1627 2.08333333333333e+00 +1484 1480 -2.08333333333333e+00 +1484 1331 -1.87500000000000e+01 +1484 1745 -1.25000000000000e+01 +1484 1330 4.16666666666667e+00 +1484 1483 -8.33333333333333e+00 +1484 1744 8.33333333333333e+00 +1484 1329 4.16666666666667e+00 +1484 1626 -4.16666666666667e+00 +1484 1746 4.16666666666667e+00 +1484 1292 -1.87500000000000e+01 +1484 1481 -6.25000000000000e+00 +1484 1291 4.16666666666667e+00 +1484 1492 -8.33333333333333e+00 +1484 1482 -8.33333333333333e+00 +1484 1290 4.16666666666667e+00 +1484 1479 4.16666666666667e+00 +1485 1485 2.50000000000000e+01 +1485 1633 2.08333333333333e+00 +1485 1493 2.08333333333333e+00 +1485 1844 -2.08333333333333e+00 +1485 1361 2.08333333333333e+00 +1485 1634 -4.16666666666667e+00 +1485 1360 2.08333333333333e+00 +1485 1486 -4.16666666666667e+00 +1485 1843 4.16666666666667e+00 +1485 1359 -6.25000000000000e+00 +1485 1842 -6.25000000000000e+00 +1485 1487 -4.16666666666667e+00 +1485 1292 2.08333333333333e+00 +1485 1481 4.16666666666667e+00 +1485 1291 2.08333333333333e+00 +1485 1492 -4.16666666666667e+00 +1485 1480 -2.08333333333333e+00 +1485 1290 -6.25000000000000e+00 +1485 1479 -6.25000000000000e+00 +1486 1486 2.91666666666667e+01 +1486 1632 2.08333333333333e+00 +1486 1481 4.16666666666667e+00 +1486 1487 -8.33333333333333e+00 +1486 1844 4.16666666666667e+00 +1486 1361 -2.08333333333333e+00 +1486 1634 2.08333333333333e+00 +1486 1360 -2.08333333333333e+00 +1486 1843 -1.87500000000000e+01 +1486 1359 2.08333333333333e+00 +1486 1485 -4.16666666666667e+00 +1486 1842 4.16666666666667e+00 +1486 1292 -2.08333333333333e+00 +1486 1493 2.08333333333333e+00 +1486 1479 -2.08333333333333e+00 +1486 1291 -2.08333333333333e+00 +1486 1480 -6.25000000000000e+00 +1486 1290 2.08333333333333e+00 +1486 1491 -4.16666666666667e+00 +1487 1487 2.91666666666667e+01 +1487 1486 -8.33333333333333e+00 +1487 1843 4.16666666666667e+00 +1487 1491 2.08333333333333e+00 +1487 1842 -2.08333333333333e+00 +1487 1361 -2.08333333333333e+00 +1487 1844 -6.25000000000000e+00 +1487 1360 -2.08333333333333e+00 +1487 1633 2.08333333333333e+00 +1487 1359 2.08333333333333e+00 +1487 1632 -4.16666666666667e+00 +1487 1480 4.16666666666667e+00 +1487 1292 -2.08333333333333e+00 +1487 1481 -1.87500000000000e+01 +1487 1291 -2.08333333333333e+00 +1487 1492 2.08333333333333e+00 +1487 1485 -4.16666666666667e+00 +1487 1290 2.08333333333333e+00 +1487 1479 4.16666666666667e+00 +1488 1488 2.50000000000000e+01 +1488 1483 2.08333333333333e+00 +1488 1859 2.08333333333333e+00 +1488 1496 -2.08333333333333e+00 +1488 1292 2.08333333333333e+00 +1488 1484 -4.16666666666667e+00 +1488 1291 2.08333333333333e+00 +1488 1489 -4.16666666666667e+00 +1488 1495 4.16666666666667e+00 +1488 1290 -6.25000000000000e+00 +1488 1494 -6.25000000000000e+00 +1488 1490 -4.16666666666667e+00 +1488 1370 2.08333333333333e+00 +1488 1742 4.16666666666667e+00 +1488 1369 2.08333333333333e+00 +1488 1858 -4.16666666666667e+00 +1488 1741 -2.08333333333333e+00 +1488 1368 -6.25000000000000e+00 +1488 1740 -6.25000000000000e+00 +1489 1489 2.91666666666667e+01 +1489 1482 2.08333333333333e+00 +1489 1742 4.16666666666667e+00 +1489 1490 -8.33333333333333e+00 +1489 1496 4.16666666666667e+00 +1489 1292 -2.08333333333333e+00 +1489 1484 2.08333333333333e+00 +1489 1291 -2.08333333333333e+00 +1489 1495 -1.87500000000000e+01 +1489 1290 2.08333333333333e+00 +1489 1488 -4.16666666666667e+00 +1489 1494 4.16666666666667e+00 +1489 1370 -2.08333333333333e+00 +1489 1859 2.08333333333333e+00 +1489 1740 -2.08333333333333e+00 +1489 1369 -2.08333333333333e+00 +1489 1741 -6.25000000000000e+00 +1489 1368 2.08333333333333e+00 +1489 1857 -4.16666666666667e+00 +1490 1490 2.91666666666667e+01 +1490 1489 -8.33333333333333e+00 +1490 1495 4.16666666666667e+00 +1490 1857 2.08333333333333e+00 +1490 1494 -2.08333333333333e+00 +1490 1292 -2.08333333333333e+00 +1490 1496 -6.25000000000000e+00 +1490 1291 -2.08333333333333e+00 +1490 1483 2.08333333333333e+00 +1490 1290 2.08333333333333e+00 +1490 1482 -4.16666666666667e+00 +1490 1741 4.16666666666667e+00 +1490 1370 -2.08333333333333e+00 +1490 1742 -1.87500000000000e+01 +1490 1369 -2.08333333333333e+00 +1490 1858 2.08333333333333e+00 +1490 1488 -4.16666666666667e+00 +1490 1368 2.08333333333333e+00 +1490 1740 4.16666666666667e+00 +1491 1491 6.25000000000000e+01 +1491 1496 4.16666666666667e+00 +1491 1373 -2.08333333333333e+00 +1491 1865 2.08333333333333e+00 +1491 1864 -4.16666666666667e+00 +1491 1292 -2.08333333333333e+00 +1491 1495 4.16666666666667e+00 +1491 1494 -1.87500000000000e+01 +1491 1484 4.16666666666667e+00 +1491 1483 4.16666666666667e+00 +1491 1745 8.33333333333333e+00 +1491 1744 -4.16666666666667e+00 +1491 1743 -1.25000000000000e+01 +1491 1481 -4.16666666666667e+00 +1491 1487 2.08333333333333e+00 +1491 1480 -4.16666666666667e+00 +1491 1639 4.16666666666667e+00 +1491 1486 -4.16666666666667e+00 +1491 1291 4.16666666666667e+00 +1491 1290 -6.25000000000000e+00 +1491 1844 4.16666666666667e+00 +1491 1640 -8.33333333333333e+00 +1491 1843 4.16666666666667e+00 +1491 1492 -8.33333333333333e+00 +1491 1372 4.16666666666667e+00 +1491 1842 -1.87500000000000e+01 +1491 1493 -8.33333333333333e+00 +1491 1371 -6.25000000000000e+00 +1492 1492 6.25000000000000e+01 +1492 1496 -2.08333333333333e+00 +1492 1863 -4.16666666666667e+00 +1492 1495 -6.25000000000000e+00 +1492 1494 4.16666666666667e+00 +1492 1484 -8.33333333333333e+00 +1492 1292 4.16666666666667e+00 +1492 1482 4.16666666666667e+00 +1492 1745 8.33333333333333e+00 +1492 1493 -8.33333333333333e+00 +1492 1373 4.16666666666667e+00 +1492 1744 -1.25000000000000e+01 +1492 1743 -4.16666666666667e+00 +1492 1479 -4.16666666666667e+00 +1492 1638 4.16666666666667e+00 +1492 1487 2.08333333333333e+00 +1492 1481 -4.16666666666667e+00 +1492 1291 -1.87500000000000e+01 +1492 1485 -4.16666666666667e+00 +1492 1290 4.16666666666667e+00 +1492 1844 -2.08333333333333e+00 +1492 1640 4.16666666666667e+00 +1492 1843 -6.25000000000000e+00 +1492 1865 2.08333333333333e+00 +1492 1372 -1.87500000000000e+01 +1492 1842 4.16666666666667e+00 +1492 1491 -8.33333333333333e+00 +1492 1371 4.16666666666667e+00 +1493 1493 6.25000000000000e+01 +1493 1495 -2.08333333333333e+00 +1493 1491 -8.33333333333333e+00 +1493 1494 4.16666666666667e+00 +1493 1371 -2.08333333333333e+00 +1493 1863 2.08333333333333e+00 +1493 1496 -6.25000000000000e+00 +1493 1290 -2.08333333333333e+00 +1493 1482 4.16666666666667e+00 +1493 1483 -8.33333333333333e+00 +1493 1291 4.16666666666667e+00 +1493 1745 -3.75000000000000e+01 +1493 1744 8.33333333333333e+00 +1493 1492 -8.33333333333333e+00 +1493 1372 4.16666666666667e+00 +1493 1743 8.33333333333333e+00 +1493 1479 -4.16666666666667e+00 +1493 1485 2.08333333333333e+00 +1493 1292 -6.25000000000000e+00 +1493 1486 2.08333333333333e+00 +1493 1480 -4.16666666666667e+00 +1493 1844 -6.25000000000000e+00 +1493 1864 2.08333333333333e+00 +1493 1373 -6.25000000000000e+00 +1493 1843 -2.08333333333333e+00 +1493 1639 4.16666666666667e+00 +1493 1842 4.16666666666667e+00 +1493 1638 -8.33333333333333e+00 +1494 1494 6.25000000000000e+01 +1494 1745 -8.33333333333333e+00 +1494 1744 4.16666666666667e+00 +1494 1292 2.08333333333333e+00 +1494 1492 4.16666666666667e+00 +1494 1491 -1.87500000000000e+01 +1494 1865 -2.08333333333333e+00 +1494 1376 2.08333333333333e+00 +1494 1864 4.16666666666667e+00 +1494 1863 -6.25000000000000e+00 +1494 1484 -4.16666666666667e+00 +1494 1483 -4.16666666666667e+00 +1494 1742 4.16666666666667e+00 +1494 1490 -2.08333333333333e+00 +1494 1495 -8.33333333333333e+00 +1494 1741 4.16666666666667e+00 +1494 1747 -4.16666666666667e+00 +1494 1291 -4.16666666666667e+00 +1494 1489 4.16666666666667e+00 +1494 1488 -6.25000000000000e+00 +1494 1496 -8.33333333333333e+00 +1494 1859 4.16666666666667e+00 +1494 1748 8.33333333333333e+00 +1494 1858 4.16666666666667e+00 +1494 1375 -4.16666666666667e+00 +1494 1493 4.16666666666667e+00 +1494 1857 -1.87500000000000e+01 +1494 1746 -1.25000000000000e+01 +1495 1495 6.25000000000000e+01 +1495 1745 4.16666666666667e+00 +1495 1743 4.16666666666667e+00 +1495 1492 -6.25000000000000e+00 +1495 1491 4.16666666666667e+00 +1495 1865 4.16666666666667e+00 +1495 1496 -8.33333333333333e+00 +1495 1864 -1.87500000000000e+01 +1495 1863 4.16666666666667e+00 +1495 1482 -4.16666666666667e+00 +1495 1490 4.16666666666667e+00 +1495 1494 -8.33333333333333e+00 +1495 1742 -8.33333333333333e+00 +1495 1748 8.33333333333333e+00 +1495 1740 4.16666666666667e+00 +1495 1746 -4.16666666666667e+00 +1495 1292 2.08333333333333e+00 +1495 1484 -4.16666666666667e+00 +1495 1489 -1.87500000000000e+01 +1495 1290 -4.16666666666667e+00 +1495 1488 4.16666666666667e+00 +1495 1859 -2.08333333333333e+00 +1495 1376 2.08333333333333e+00 +1495 1493 -2.08333333333333e+00 +1495 1858 -6.25000000000000e+00 +1495 1747 -1.25000000000000e+01 +1495 1857 4.16666666666667e+00 +1495 1374 -4.16666666666667e+00 +1496 1496 6.25000000000000e+01 +1496 1744 4.16666666666667e+00 +1496 1491 4.16666666666667e+00 +1496 1743 -8.33333333333333e+00 +1496 1493 -6.25000000000000e+00 +1496 1290 2.08333333333333e+00 +1496 1865 -6.25000000000000e+00 +1496 1864 4.16666666666667e+00 +1496 1495 -8.33333333333333e+00 +1496 1863 -2.08333333333333e+00 +1496 1374 2.08333333333333e+00 +1496 1482 -4.16666666666667e+00 +1496 1489 4.16666666666667e+00 +1496 1740 4.16666666666667e+00 +1496 1488 -2.08333333333333e+00 +1496 1741 -8.33333333333333e+00 +1496 1747 8.33333333333333e+00 +1496 1490 -6.25000000000000e+00 +1496 1291 2.08333333333333e+00 +1496 1483 -4.16666666666667e+00 +1496 1492 -2.08333333333333e+00 +1496 1859 -6.25000000000000e+00 +1496 1748 -3.75000000000000e+01 +1496 1858 -2.08333333333333e+00 +1496 1375 2.08333333333333e+00 +1496 1494 -8.33333333333333e+00 +1496 1857 4.16666666666667e+00 +1496 1746 8.33333333333333e+00 +1497 1497 6.25000000000000e+01 +1497 1754 4.16666666666667e+00 +1497 1753 -2.08333333333333e+00 +1497 1333 2.08333333333333e+00 +1497 1752 -6.25000000000000e+00 +1497 1766 -4.16666666666667e+00 +1497 1499 -8.33333333333333e+00 +1497 1501 -2.08333333333333e+00 +1497 1862 4.16666666666667e+00 +1497 1861 4.16666666666667e+00 +1497 1502 4.16666666666667e+00 +1497 1500 -6.25000000000000e+00 +1497 1760 4.16666666666667e+00 +1497 1334 -4.16666666666667e+00 +1497 1759 4.16666666666667e+00 +1497 1498 -8.33333333333333e+00 +1497 1765 8.33333333333333e+00 +1497 1758 -1.87500000000000e+01 +1497 1764 -1.25000000000000e+01 +1497 401 4.16666666666667e+00 +1497 400 -8.33333333333333e+00 +1497 236 4.16666666666667e+00 +1497 19 2.08333333333333e+00 +1497 234 -1.87500000000000e+01 +1497 242 -4.16666666666667e+00 +1497 241 -4.16666666666667e+00 +1497 20 -4.16666666666667e+00 +1497 235 4.16666666666667e+00 +1498 1498 6.25000000000000e+01 +1498 1754 4.16666666666667e+00 +1498 1499 -8.33333333333333e+00 +1498 1753 -6.25000000000000e+00 +1498 1752 -2.08333333333333e+00 +1498 1332 2.08333333333333e+00 +1498 1500 -2.08333333333333e+00 +1498 1502 4.16666666666667e+00 +1498 1766 8.33333333333333e+00 +1498 1862 -8.33333333333333e+00 +1498 1860 4.16666666666667e+00 +1498 1501 -6.25000000000000e+00 +1498 1760 -2.08333333333333e+00 +1498 1334 2.08333333333333e+00 +1498 1759 -6.25000000000000e+00 +1498 1765 -3.75000000000000e+01 +1498 1758 4.16666666666667e+00 +1498 1497 -8.33333333333333e+00 +1498 1764 8.33333333333333e+00 +1498 401 4.16666666666667e+00 +1498 234 4.16666666666667e+00 +1498 399 -8.33333333333333e+00 +1498 235 -6.25000000000000e+00 +1498 18 2.08333333333333e+00 +1498 240 -4.16666666666667e+00 +1498 20 2.08333333333333e+00 +1498 242 -4.16666666666667e+00 +1498 236 -2.08333333333333e+00 +1499 1499 6.25000000000000e+01 +1499 1754 -1.87500000000000e+01 +1499 1753 4.16666666666667e+00 +1499 1498 -8.33333333333333e+00 +1499 1752 4.16666666666667e+00 +1499 1764 -4.16666666666667e+00 +1499 1497 -8.33333333333333e+00 +1499 1501 4.16666666666667e+00 +1499 1860 4.16666666666667e+00 +1499 1765 8.33333333333333e+00 +1499 1861 -8.33333333333333e+00 +1499 1502 -1.87500000000000e+01 +1499 1500 4.16666666666667e+00 +1499 1760 -6.25000000000000e+00 +1499 1766 -1.25000000000000e+01 +1499 1759 -2.08333333333333e+00 +1499 1333 2.08333333333333e+00 +1499 1758 4.16666666666667e+00 +1499 1332 -4.16666666666667e+00 +1499 400 4.16666666666667e+00 +1499 399 4.16666666666667e+00 +1499 236 -6.25000000000000e+00 +1499 234 4.16666666666667e+00 +1499 240 -4.16666666666667e+00 +1499 19 2.08333333333333e+00 +1499 241 -4.16666666666667e+00 +1499 18 -4.16666666666667e+00 +1499 235 -2.08333333333333e+00 +1500 1500 2.50000000000000e+01 +1500 1759 2.08333333333333e+00 +1500 1862 -2.08333333333333e+00 +1500 1370 2.08333333333333e+00 +1500 1760 -4.16666666666667e+00 +1500 1369 2.08333333333333e+00 +1500 1501 -4.16666666666667e+00 +1500 1861 4.16666666666667e+00 +1500 1368 -6.25000000000000e+00 +1500 1860 -6.25000000000000e+00 +1500 1502 -4.16666666666667e+00 +1500 1499 4.16666666666667e+00 +1500 1498 -2.08333333333333e+00 +1500 1497 -6.25000000000000e+00 +1500 242 2.08333333333333e+00 +1500 20 2.08333333333333e+00 +1500 19 2.08333333333333e+00 +1500 241 -4.16666666666667e+00 +1500 18 -6.25000000000000e+00 +1501 1501 2.91666666666667e+01 +1501 1758 2.08333333333333e+00 +1501 1499 4.16666666666667e+00 +1501 1502 -8.33333333333333e+00 +1501 1862 4.16666666666667e+00 +1501 1370 -2.08333333333333e+00 +1501 1760 2.08333333333333e+00 +1501 1369 -2.08333333333333e+00 +1501 1861 -1.87500000000000e+01 +1501 1368 2.08333333333333e+00 +1501 1500 -4.16666666666667e+00 +1501 1860 4.16666666666667e+00 +1501 1497 -2.08333333333333e+00 +1501 1498 -6.25000000000000e+00 +1501 20 -2.08333333333333e+00 +1501 242 2.08333333333333e+00 +1501 19 -2.08333333333333e+00 +1501 18 2.08333333333333e+00 +1501 240 -4.16666666666667e+00 +1502 1502 2.91666666666667e+01 +1502 1501 -8.33333333333333e+00 +1502 1861 4.16666666666667e+00 +1502 1860 -2.08333333333333e+00 +1502 1370 -2.08333333333333e+00 +1502 1862 -6.25000000000000e+00 +1502 1369 -2.08333333333333e+00 +1502 1759 2.08333333333333e+00 +1502 1368 2.08333333333333e+00 +1502 1758 -4.16666666666667e+00 +1502 1498 4.16666666666667e+00 +1502 1499 -1.87500000000000e+01 +1502 1500 -4.16666666666667e+00 +1502 1497 4.16666666666667e+00 +1502 240 2.08333333333333e+00 +1502 20 -2.08333333333333e+00 +1502 19 -2.08333333333333e+00 +1502 241 2.08333333333333e+00 +1502 18 2.08333333333333e+00 +1503 1503 1.25000000000000e+02 +1503 1645 -4.16666666666667e+00 +1503 1316 4.16666666666667e+00 +1503 1644 -1.25000000000000e+01 +1503 1508 -4.16666666666667e+00 +1503 1295 4.16666666666667e+00 +1503 1504 -1.66666666666667e+01 +1503 1507 8.33333333333333e+00 +1503 1506 -1.25000000000000e+01 +1503 1652 -4.16666666666667e+00 +1503 1651 8.33333333333333e+00 +1503 1315 4.16666666666667e+00 +1503 1650 -1.25000000000000e+01 +1503 1505 -1.66666666666667e+01 +1503 1511 8.33333333333333e+00 +1503 1510 -4.16666666666667e+00 +1503 1294 4.16666666666667e+00 +1503 1646 8.33333333333333e+00 +1503 1509 -1.25000000000000e+01 +1503 1813 -8.33333333333333e+00 +1503 1658 8.33333333333333e+00 +1503 1850 -8.33333333333333e+00 +1503 1513 -4.16666666666667e+00 +1503 1849 4.16666666666667e+00 +1503 1514 -4.16666666666667e+00 +1503 1657 8.33333333333333e+00 +1503 1814 4.16666666666667e+00 +1503 1656 -3.75000000000000e+01 +1503 2392 4.16666666666667e+00 +1503 2393 -8.33333333333333e+00 +1503 2387 -4.16666666666667e+00 +1503 2399 4.16666666666667e+00 +1503 2140 8.33333333333333e+00 +1503 2398 -8.33333333333333e+00 +1503 2386 -4.16666666666667e+00 +1503 2141 8.33333333333333e+00 +1503 2139 -3.75000000000000e+01 +1504 1504 1.25000000000000e+02 +1504 1644 -4.16666666666667e+00 +1504 1646 8.33333333333333e+00 +1504 1645 -1.25000000000000e+01 +1504 1508 8.33333333333333e+00 +1504 1507 -3.75000000000000e+01 +1504 1503 -1.66666666666667e+01 +1504 1506 8.33333333333333e+00 +1504 1505 -1.66666666666667e+01 +1504 1650 8.33333333333333e+00 +1504 1316 -8.33333333333333e+00 +1504 1652 8.33333333333333e+00 +1504 1651 -3.75000000000000e+01 +1504 1314 4.16666666666667e+00 +1504 1511 8.33333333333333e+00 +1504 1295 -8.33333333333333e+00 +1504 1510 -1.25000000000000e+01 +1504 1509 -4.16666666666667e+00 +1504 1293 4.16666666666667e+00 +1504 1814 4.16666666666667e+00 +1504 1812 -8.33333333333333e+00 +1504 1658 -4.16666666666667e+00 +1504 1514 -4.16666666666667e+00 +1504 1850 4.16666666666667e+00 +1504 1512 -4.16666666666667e+00 +1504 1848 4.16666666666667e+00 +1504 1657 -1.25000000000000e+01 +1504 1656 8.33333333333333e+00 +1504 2393 4.16666666666667e+00 +1504 2141 -4.16666666666667e+00 +1504 2387 -4.16666666666667e+00 +1504 2399 4.16666666666667e+00 +1504 2139 8.33333333333333e+00 +1504 2397 -8.33333333333333e+00 +1504 2385 -4.16666666666667e+00 +1504 2391 4.16666666666667e+00 +1504 2140 -1.25000000000000e+01 +1505 1505 1.25000000000000e+02 +1505 1646 -3.75000000000000e+01 +1505 1645 8.33333333333333e+00 +1505 1314 4.16666666666667e+00 +1505 1508 -1.25000000000000e+01 +1505 1507 8.33333333333333e+00 +1505 1506 -4.16666666666667e+00 +1505 1293 4.16666666666667e+00 +1505 1504 -1.66666666666667e+01 +1505 1650 -4.16666666666667e+00 +1505 1652 -1.25000000000000e+01 +1505 1315 -8.33333333333333e+00 +1505 1651 8.33333333333333e+00 +1505 1644 8.33333333333333e+00 +1505 1511 -3.75000000000000e+01 +1505 1510 8.33333333333333e+00 +1505 1294 -8.33333333333333e+00 +1505 1503 -1.66666666666667e+01 +1505 1509 8.33333333333333e+00 +1505 1813 4.16666666666667e+00 +1505 1657 -4.16666666666667e+00 +1505 1513 -4.16666666666667e+00 +1505 1849 4.16666666666667e+00 +1505 1656 8.33333333333333e+00 +1505 1848 -8.33333333333333e+00 +1505 1512 -4.16666666666667e+00 +1505 1812 4.16666666666667e+00 +1505 1658 -1.25000000000000e+01 +1505 2392 4.16666666666667e+00 +1505 2391 -8.33333333333333e+00 +1505 2140 -4.16666666666667e+00 +1505 2386 -4.16666666666667e+00 +1505 2398 4.16666666666667e+00 +1505 2385 -4.16666666666667e+00 +1505 2397 4.16666666666667e+00 +1505 2141 -1.25000000000000e+01 +1505 2139 8.33333333333333e+00 +1506 1506 6.25000000000000e+01 +1506 1346 4.16666666666667e+00 +1506 1508 -8.33333333333333e+00 +1506 1295 4.16666666666667e+00 +1506 1645 4.16666666666667e+00 +1506 1646 4.16666666666667e+00 +1506 1344 -6.25000000000000e+00 +1506 1505 -4.16666666666667e+00 +1506 1504 8.33333333333333e+00 +1506 1503 -1.25000000000000e+01 +1506 1293 -6.25000000000000e+00 +1506 1813 4.16666666666667e+00 +1506 1507 -8.33333333333333e+00 +1506 1514 -4.16666666666667e+00 +1506 1294 -2.08333333333333e+00 +1506 1513 2.08333333333333e+00 +1506 1814 4.16666666666667e+00 +1506 1345 -2.08333333333333e+00 +1506 1812 -1.87500000000000e+01 +1506 2435 -4.16666666666667e+00 +1506 2144 4.16666666666667e+00 +1506 2143 4.16666666666667e+00 +1506 2142 -1.87500000000000e+01 +1506 2392 -4.16666666666667e+00 +1506 2393 -4.16666666666667e+00 +1506 2141 4.16666666666667e+00 +1506 2140 -8.33333333333333e+00 +1506 2434 2.08333333333333e+00 +1507 1507 6.25000000000000e+01 +1507 1644 4.16666666666667e+00 +1507 1646 -8.33333333333333e+00 +1507 1346 4.16666666666667e+00 +1507 1345 -6.25000000000000e+00 +1507 1505 8.33333333333333e+00 +1507 1508 -8.33333333333333e+00 +1507 1295 4.16666666666667e+00 +1507 1504 -3.75000000000000e+01 +1507 1294 -6.25000000000000e+00 +1507 1503 8.33333333333333e+00 +1507 1514 2.08333333333333e+00 +1507 1812 4.16666666666667e+00 +1507 1506 -8.33333333333333e+00 +1507 1293 -2.08333333333333e+00 +1507 1512 2.08333333333333e+00 +1507 1814 -2.08333333333333e+00 +1507 1813 -6.25000000000000e+00 +1507 1344 -2.08333333333333e+00 +1507 2435 2.08333333333333e+00 +1507 2144 -2.08333333333333e+00 +1507 2143 -6.25000000000000e+00 +1507 2142 4.16666666666667e+00 +1507 2391 -4.16666666666667e+00 +1507 2393 -4.16666666666667e+00 +1507 2141 4.16666666666667e+00 +1507 2433 2.08333333333333e+00 +1507 2139 -8.33333333333333e+00 +1508 1508 6.25000000000000e+01 +1508 1344 4.16666666666667e+00 +1508 1506 -8.33333333333333e+00 +1508 1293 4.16666666666667e+00 +1508 1346 -1.87500000000000e+01 +1508 1645 -8.33333333333333e+00 +1508 1345 4.16666666666667e+00 +1508 1644 4.16666666666667e+00 +1508 1505 -1.25000000000000e+01 +1508 1295 -1.87500000000000e+01 +1508 1504 8.33333333333333e+00 +1508 1507 -8.33333333333333e+00 +1508 1294 4.16666666666667e+00 +1508 1503 -4.16666666666667e+00 +1508 1513 2.08333333333333e+00 +1508 1512 -4.16666666666667e+00 +1508 1813 -2.08333333333333e+00 +1508 1814 -6.25000000000000e+00 +1508 1812 4.16666666666667e+00 +1508 2433 -4.16666666666667e+00 +1508 2144 -6.25000000000000e+00 +1508 2143 -2.08333333333333e+00 +1508 2142 4.16666666666667e+00 +1508 2392 -4.16666666666667e+00 +1508 2140 4.16666666666667e+00 +1508 2391 -4.16666666666667e+00 +1508 2434 2.08333333333333e+00 +1508 2139 4.16666666666667e+00 +1509 1509 6.25000000000000e+01 +1509 1651 4.16666666666667e+00 +1509 1505 8.33333333333333e+00 +1509 1504 -4.16666666666667e+00 +1509 1503 -1.25000000000000e+01 +1509 1363 4.16666666666667e+00 +1509 1362 -6.25000000000000e+00 +1509 1510 -8.33333333333333e+00 +1509 1294 4.16666666666667e+00 +1509 1652 4.16666666666667e+00 +1509 1293 -6.25000000000000e+00 +1509 1511 -8.33333333333333e+00 +1509 1850 4.16666666666667e+00 +1509 1295 -2.08333333333333e+00 +1509 1514 2.08333333333333e+00 +1509 1513 -4.16666666666667e+00 +1509 1364 -2.08333333333333e+00 +1509 1849 4.16666666666667e+00 +1509 1848 -1.87500000000000e+01 +1509 2399 -4.16666666666667e+00 +1509 2471 2.08333333333333e+00 +1509 2398 -4.16666666666667e+00 +1509 2140 4.16666666666667e+00 +1509 2470 -4.16666666666667e+00 +1509 2147 4.16666666666667e+00 +1509 2141 -8.33333333333333e+00 +1509 2146 4.16666666666667e+00 +1509 2145 -1.87500000000000e+01 +1510 1510 6.25000000000000e+01 +1510 1364 4.16666666666667e+00 +1510 1650 4.16666666666667e+00 +1510 1505 8.33333333333333e+00 +1510 1511 -8.33333333333333e+00 +1510 1295 4.16666666666667e+00 +1510 1504 -1.25000000000000e+01 +1510 1503 -4.16666666666667e+00 +1510 1363 -1.87500000000000e+01 +1510 1362 4.16666666666667e+00 +1510 1652 -8.33333333333333e+00 +1510 1294 -1.87500000000000e+01 +1510 1509 -8.33333333333333e+00 +1510 1293 4.16666666666667e+00 +1510 1514 2.08333333333333e+00 +1510 1850 -2.08333333333333e+00 +1510 1512 -4.16666666666667e+00 +1510 1849 -6.25000000000000e+00 +1510 1848 4.16666666666667e+00 +1510 2397 -4.16666666666667e+00 +1510 2139 4.16666666666667e+00 +1510 2471 2.08333333333333e+00 +1510 2399 -4.16666666666667e+00 +1510 2469 -4.16666666666667e+00 +1510 2147 -2.08333333333333e+00 +1510 2141 4.16666666666667e+00 +1510 2146 -6.25000000000000e+00 +1510 2145 4.16666666666667e+00 +1511 1511 6.25000000000000e+01 +1511 1651 -8.33333333333333e+00 +1511 1363 4.16666666666667e+00 +1511 1505 -3.75000000000000e+01 +1511 1504 8.33333333333333e+00 +1511 1510 -8.33333333333333e+00 +1511 1294 4.16666666666667e+00 +1511 1503 8.33333333333333e+00 +1511 1364 -6.25000000000000e+00 +1511 1650 4.16666666666667e+00 +1511 1295 -6.25000000000000e+00 +1511 1849 -2.08333333333333e+00 +1511 1509 -8.33333333333333e+00 +1511 1848 4.16666666666667e+00 +1511 1293 -2.08333333333333e+00 +1511 1512 2.08333333333333e+00 +1511 1513 2.08333333333333e+00 +1511 1850 -6.25000000000000e+00 +1511 1362 -2.08333333333333e+00 +1511 2397 -4.16666666666667e+00 +1511 2469 2.08333333333333e+00 +1511 2470 2.08333333333333e+00 +1511 2398 -4.16666666666667e+00 +1511 2147 -6.25000000000000e+00 +1511 2146 -2.08333333333333e+00 +1511 2140 4.16666666666667e+00 +1511 2145 4.16666666666667e+00 +1511 2139 -8.33333333333333e+00 +1512 1512 3.75000000000000e+01 +1512 1508 -4.16666666666667e+00 +1512 1507 2.08333333333333e+00 +1512 1514 -4.16666666666667e+00 +1512 1814 4.16666666666667e+00 +1512 1379 2.08333333333333e+00 +1512 1813 -2.08333333333333e+00 +1512 1812 -6.25000000000000e+00 +1512 1504 -4.16666666666667e+00 +1512 1657 4.16666666666667e+00 +1512 1511 2.08333333333333e+00 +1512 1505 -4.16666666666667e+00 +1512 1294 2.08333333333333e+00 +1512 1510 -4.16666666666667e+00 +1512 1293 -1.25000000000000e+01 +1512 1850 -2.08333333333333e+00 +1512 1658 4.16666666666667e+00 +1512 1513 -4.16666666666667e+00 +1512 1849 4.16666666666667e+00 +1512 1378 2.08333333333333e+00 +1512 1295 2.08333333333333e+00 +1512 1848 -6.25000000000000e+00 +1512 1377 -1.25000000000000e+01 +1513 1513 3.33333333333333e+01 +1513 1506 2.08333333333333e+00 +1513 1814 4.16666666666667e+00 +1513 1813 -6.25000000000000e+00 +1513 1812 -2.08333333333333e+00 +1513 1511 2.08333333333333e+00 +1513 1505 -4.16666666666667e+00 +1513 1503 -4.16666666666667e+00 +1513 1656 4.16666666666667e+00 +1513 1294 -4.16666666666667e+00 +1513 1293 2.08333333333333e+00 +1513 1509 -4.16666666666667e+00 +1513 1850 4.16666666666667e+00 +1513 1658 -8.33333333333333e+00 +1513 1508 2.08333333333333e+00 +1513 1849 -1.87500000000000e+01 +1513 1378 -4.16666666666667e+00 +1513 1512 -4.16666666666667e+00 +1513 1848 4.16666666666667e+00 +1513 1377 2.08333333333333e+00 +1514 1514 3.33333333333333e+01 +1514 1293 2.08333333333333e+00 +1514 1506 -4.16666666666667e+00 +1514 1814 -1.87500000000000e+01 +1514 1813 4.16666666666667e+00 +1514 1512 -4.16666666666667e+00 +1514 1812 4.16666666666667e+00 +1514 1377 2.08333333333333e+00 +1514 1510 2.08333333333333e+00 +1514 1504 -4.16666666666667e+00 +1514 1295 -4.16666666666667e+00 +1514 1509 2.08333333333333e+00 +1514 1503 -4.16666666666667e+00 +1514 1507 2.08333333333333e+00 +1514 1850 -6.25000000000000e+00 +1514 1379 -4.16666666666667e+00 +1514 1849 4.16666666666667e+00 +1514 1657 -8.33333333333333e+00 +1514 1848 -2.08333333333333e+00 +1514 1656 4.16666666666667e+00 +1515 1515 1.25000000000000e+02 +1515 1522 8.33333333333333e+00 +1515 1521 -1.25000000000000e+01 +1515 1664 -8.33333333333333e+00 +1515 1663 4.16666666666667e+00 +1515 1676 8.33333333333333e+00 +1515 1534 4.16666666666667e+00 +1515 1675 8.33333333333333e+00 +1515 1674 -3.75000000000000e+01 +1515 1535 4.16666666666667e+00 +1515 1666 -4.16666666666667e+00 +1515 1667 8.33333333333333e+00 +1515 1517 -1.66666666666667e+01 +1515 1319 -4.16666666666667e+00 +1515 1665 -1.25000000000000e+01 +1515 1526 4.16666666666667e+00 +1515 1298 -4.16666666666667e+00 +1515 1525 -8.33333333333333e+00 +1515 1661 4.16666666666667e+00 +1515 1519 8.33333333333333e+00 +1515 1516 -1.66666666666667e+01 +1515 1520 8.33333333333333e+00 +1515 1297 -4.16666666666667e+00 +1515 1518 -3.75000000000000e+01 +1515 1660 4.16666666666667e+00 +1515 1318 -4.16666666666667e+00 +1515 1673 -4.16666666666667e+00 +1515 1670 4.16666666666667e+00 +1515 1531 4.16666666666667e+00 +1515 1528 -4.16666666666667e+00 +1515 1669 -8.33333333333333e+00 +1515 1672 8.33333333333333e+00 +1515 1671 -1.25000000000000e+01 +1515 1529 8.33333333333333e+00 +1515 1532 -8.33333333333333e+00 +1515 1527 -1.25000000000000e+01 +1515 1523 -4.16666666666667e+00 +1516 1516 1.25000000000000e+02 +1516 1521 8.33333333333333e+00 +1516 1523 8.33333333333333e+00 +1516 1522 -3.75000000000000e+01 +1516 1662 4.16666666666667e+00 +1516 1676 -4.16666666666667e+00 +1516 1533 4.16666666666667e+00 +1516 1675 -1.25000000000000e+01 +1516 1674 8.33333333333333e+00 +1516 1535 -8.33333333333333e+00 +1516 1665 -4.16666666666667e+00 +1516 1526 4.16666666666667e+00 +1516 1667 8.33333333333333e+00 +1516 1666 -1.25000000000000e+01 +1516 1524 -8.33333333333333e+00 +1516 1520 -4.16666666666667e+00 +1516 1518 8.33333333333333e+00 +1516 1515 -1.66666666666667e+01 +1516 1519 -1.25000000000000e+01 +1516 1296 -4.16666666666667e+00 +1516 1661 -8.33333333333333e+00 +1516 1659 4.16666666666667e+00 +1516 1317 -4.16666666666667e+00 +1516 1673 8.33333333333333e+00 +1516 1517 -1.66666666666667e+01 +1516 1529 8.33333333333333e+00 +1516 1530 4.16666666666667e+00 +1516 1527 -4.16666666666667e+00 +1516 1670 4.16666666666667e+00 +1516 1319 -4.16666666666667e+00 +1516 1672 -3.75000000000000e+01 +1516 1668 -8.33333333333333e+00 +1516 1671 8.33333333333333e+00 +1516 1532 4.16666666666667e+00 +1516 1298 -4.16666666666667e+00 +1516 1528 -1.25000000000000e+01 +1516 1664 4.16666666666667e+00 +1517 1517 1.25000000000000e+02 +1517 1663 4.16666666666667e+00 +1517 1523 -1.25000000000000e+01 +1517 1522 8.33333333333333e+00 +1517 1662 -8.33333333333333e+00 +1517 1675 -4.16666666666667e+00 +1517 1674 8.33333333333333e+00 +1517 1676 -1.25000000000000e+01 +1517 1534 -8.33333333333333e+00 +1517 1533 4.16666666666667e+00 +1517 1525 4.16666666666667e+00 +1517 1665 8.33333333333333e+00 +1517 1515 -1.66666666666667e+01 +1517 1667 -3.75000000000000e+01 +1517 1666 8.33333333333333e+00 +1517 1317 -4.16666666666667e+00 +1517 1524 4.16666666666667e+00 +1517 1296 -4.16666666666667e+00 +1517 1519 -4.16666666666667e+00 +1517 1659 4.16666666666667e+00 +1517 1520 -1.25000000000000e+01 +1517 1518 8.33333333333333e+00 +1517 1660 -8.33333333333333e+00 +1517 1671 -4.16666666666667e+00 +1517 1668 4.16666666666667e+00 +1517 1672 8.33333333333333e+00 +1517 1516 -1.66666666666667e+01 +1517 1528 8.33333333333333e+00 +1517 1673 -1.25000000000000e+01 +1517 1669 4.16666666666667e+00 +1517 1318 -4.16666666666667e+00 +1517 1529 -3.75000000000000e+01 +1517 1521 -4.16666666666667e+00 +1517 1531 4.16666666666667e+00 +1517 1297 -4.16666666666667e+00 +1517 1527 8.33333333333333e+00 +1517 1530 -8.33333333333333e+00 +1518 1518 1.25000000000000e+02 +1518 1831 -8.33333333333333e+00 +1518 1784 8.33333333333333e+00 +1518 1868 -8.33333333333333e+00 +1518 1537 -4.16666666666667e+00 +1518 1867 4.16666666666667e+00 +1518 1538 -4.16666666666667e+00 +1518 1783 8.33333333333333e+00 +1518 1782 -3.75000000000000e+01 +1518 1772 8.33333333333333e+00 +1518 1666 4.16666666666667e+00 +1518 1771 -4.16666666666667e+00 +1518 1667 -8.33333333333333e+00 +1518 1337 4.16666666666667e+00 +1518 1770 -1.25000000000000e+01 +1518 1526 -4.16666666666667e+00 +1518 1298 4.16666666666667e+00 +1518 1519 -1.66666666666667e+01 +1518 1525 8.33333333333333e+00 +1518 1524 -1.25000000000000e+01 +1518 1778 -4.16666666666667e+00 +1518 1777 8.33333333333333e+00 +1518 1661 -4.16666666666667e+00 +1518 1673 4.16666666666667e+00 +1518 1516 8.33333333333333e+00 +1518 1672 -8.33333333333333e+00 +1518 1336 4.16666666666667e+00 +1518 1660 -4.16666666666667e+00 +1518 1776 -1.25000000000000e+01 +1518 1520 -1.66666666666667e+01 +1518 1532 8.33333333333333e+00 +1518 1517 8.33333333333333e+00 +1518 1531 -4.16666666666667e+00 +1518 1297 4.16666666666667e+00 +1518 1832 4.16666666666667e+00 +1518 1530 -1.25000000000000e+01 +1518 1515 -3.75000000000000e+01 +1519 1519 1.25000000000000e+02 +1519 1830 -8.33333333333333e+00 +1519 1784 -4.16666666666667e+00 +1519 1538 -4.16666666666667e+00 +1519 1868 4.16666666666667e+00 +1519 1536 -4.16666666666667e+00 +1519 1866 4.16666666666667e+00 +1519 1783 -1.25000000000000e+01 +1519 1782 8.33333333333333e+00 +1519 1665 4.16666666666667e+00 +1519 1770 -4.16666666666667e+00 +1519 1667 4.16666666666667e+00 +1519 1772 8.33333333333333e+00 +1519 1771 -1.25000000000000e+01 +1519 1526 8.33333333333333e+00 +1519 1525 -3.75000000000000e+01 +1519 1518 -1.66666666666667e+01 +1519 1524 8.33333333333333e+00 +1519 1517 -4.16666666666667e+00 +1519 1520 -1.66666666666667e+01 +1519 1661 -4.16666666666667e+00 +1519 1673 4.16666666666667e+00 +1519 1776 8.33333333333333e+00 +1519 1515 8.33333333333333e+00 +1519 1671 -8.33333333333333e+00 +1519 1337 -8.33333333333333e+00 +1519 1778 8.33333333333333e+00 +1519 1777 -3.75000000000000e+01 +1519 1335 4.16666666666667e+00 +1519 1659 -4.16666666666667e+00 +1519 1532 8.33333333333333e+00 +1519 1298 -8.33333333333333e+00 +1519 1832 4.16666666666667e+00 +1519 1531 -1.25000000000000e+01 +1519 1516 -1.25000000000000e+01 +1519 1530 -4.16666666666667e+00 +1519 1296 4.16666666666667e+00 +1520 1520 1.25000000000000e+02 +1520 1831 4.16666666666667e+00 +1520 1783 -4.16666666666667e+00 +1520 1537 -4.16666666666667e+00 +1520 1867 4.16666666666667e+00 +1520 1782 8.33333333333333e+00 +1520 1866 -8.33333333333333e+00 +1520 1536 -4.16666666666667e+00 +1520 1784 -1.25000000000000e+01 +1520 1770 8.33333333333333e+00 +1520 1666 4.16666666666667e+00 +1520 1665 -8.33333333333333e+00 +1520 1772 -3.75000000000000e+01 +1520 1771 8.33333333333333e+00 +1520 1335 4.16666666666667e+00 +1520 1526 -1.25000000000000e+01 +1520 1525 8.33333333333333e+00 +1520 1524 -4.16666666666667e+00 +1520 1296 4.16666666666667e+00 +1520 1516 -4.16666666666667e+00 +1520 1519 -1.66666666666667e+01 +1520 1776 -4.16666666666667e+00 +1520 1660 -4.16666666666667e+00 +1520 1672 4.16666666666667e+00 +1520 1659 -4.16666666666667e+00 +1520 1671 4.16666666666667e+00 +1520 1778 -1.25000000000000e+01 +1520 1336 -8.33333333333333e+00 +1520 1777 8.33333333333333e+00 +1520 1830 4.16666666666667e+00 +1520 1532 -3.75000000000000e+01 +1520 1517 -1.25000000000000e+01 +1520 1531 8.33333333333333e+00 +1520 1297 -8.33333333333333e+00 +1520 1518 -1.66666666666667e+01 +1520 1530 8.33333333333333e+00 +1520 1515 8.33333333333333e+00 +1521 1521 6.25000000000000e+01 +1521 1666 4.16666666666667e+00 +1521 1667 4.16666666666667e+00 +1521 1817 4.16666666666667e+00 +1521 1815 -6.25000000000000e+00 +1521 1526 4.16666666666667e+00 +1521 1525 4.16666666666667e+00 +1521 1522 -8.33333333333333e+00 +1521 1524 -1.87500000000000e+01 +1521 1517 -4.16666666666667e+00 +1521 1523 -8.33333333333333e+00 +1521 1664 -4.16666666666667e+00 +1521 1676 4.16666666666667e+00 +1521 1819 4.16666666666667e+00 +1521 1516 8.33333333333333e+00 +1521 1675 -8.33333333333333e+00 +1521 1820 4.16666666666667e+00 +1521 1349 -4.16666666666667e+00 +1521 1348 2.08333333333333e+00 +1521 1663 -4.16666666666667e+00 +1521 1818 -1.87500000000000e+01 +1521 1535 4.16666666666667e+00 +1521 1298 -4.16666666666667e+00 +1521 1534 -2.08333333333333e+00 +1521 1297 2.08333333333333e+00 +1521 1533 -6.25000000000000e+00 +1521 1816 -2.08333333333333e+00 +1521 1515 -1.25000000000000e+01 +1522 1522 6.25000000000000e+01 +1522 1815 -2.08333333333333e+00 +1522 1665 4.16666666666667e+00 +1522 1667 -8.33333333333333e+00 +1522 1349 2.08333333333333e+00 +1522 1816 -6.25000000000000e+00 +1522 1526 -2.08333333333333e+00 +1522 1298 2.08333333333333e+00 +1522 1525 -6.25000000000000e+00 +1522 1524 4.16666666666667e+00 +1522 1521 -8.33333333333333e+00 +1522 1820 -2.08333333333333e+00 +1522 1818 4.16666666666667e+00 +1522 1664 -4.16666666666667e+00 +1522 1676 4.16666666666667e+00 +1522 1515 8.33333333333333e+00 +1522 1674 -8.33333333333333e+00 +1522 1819 -6.25000000000000e+00 +1522 1347 2.08333333333333e+00 +1522 1662 -4.16666666666667e+00 +1522 1535 4.16666666666667e+00 +1522 1523 -8.33333333333333e+00 +1522 1517 8.33333333333333e+00 +1522 1534 -6.25000000000000e+00 +1522 1817 4.16666666666667e+00 +1522 1516 -3.75000000000000e+01 +1522 1533 -2.08333333333333e+00 +1522 1296 2.08333333333333e+00 +1523 1523 6.25000000000000e+01 +1523 1666 -8.33333333333333e+00 +1523 1665 4.16666666666667e+00 +1523 1817 -1.87500000000000e+01 +1523 1348 2.08333333333333e+00 +1523 1815 4.16666666666667e+00 +1523 1526 -6.25000000000000e+00 +1523 1525 -2.08333333333333e+00 +1523 1297 2.08333333333333e+00 +1523 1524 4.16666666666667e+00 +1523 1515 -4.16666666666667e+00 +1523 1819 -2.08333333333333e+00 +1523 1521 -8.33333333333333e+00 +1523 1662 -4.16666666666667e+00 +1523 1674 4.16666666666667e+00 +1523 1663 -4.16666666666667e+00 +1523 1675 4.16666666666667e+00 +1523 1820 -6.25000000000000e+00 +1523 1818 4.16666666666667e+00 +1523 1347 -4.16666666666667e+00 +1523 1535 -1.87500000000000e+01 +1523 1816 4.16666666666667e+00 +1523 1517 -1.25000000000000e+01 +1523 1534 4.16666666666667e+00 +1523 1522 -8.33333333333333e+00 +1523 1516 8.33333333333333e+00 +1523 1533 4.16666666666667e+00 +1523 1296 -4.16666666666667e+00 +1524 1524 6.25000000000000e+01 +1524 1525 -8.33333333333333e+00 +1524 1538 -4.16666666666667e+00 +1524 1297 -2.08333333333333e+00 +1524 1537 2.08333333333333e+00 +1524 1832 4.16666666666667e+00 +1524 1354 -2.08333333333333e+00 +1524 1830 -1.87500000000000e+01 +1524 1816 2.08333333333333e+00 +1524 1355 4.16666666666667e+00 +1524 1817 -4.16666666666667e+00 +1524 1526 -8.33333333333333e+00 +1524 1523 4.16666666666667e+00 +1524 1298 4.16666666666667e+00 +1524 1522 4.16666666666667e+00 +1524 1521 -1.87500000000000e+01 +1524 1666 -4.16666666666667e+00 +1524 1771 4.16666666666667e+00 +1524 1772 4.16666666666667e+00 +1524 1667 -4.16666666666667e+00 +1524 1353 -6.25000000000000e+00 +1524 1520 -4.16666666666667e+00 +1524 1517 4.16666666666667e+00 +1524 1519 8.33333333333333e+00 +1524 1516 -8.33333333333333e+00 +1524 1518 -1.25000000000000e+01 +1524 1831 4.16666666666667e+00 +1524 1296 -6.25000000000000e+00 +1525 1525 6.25000000000000e+01 +1525 1538 2.08333333333333e+00 +1525 1830 4.16666666666667e+00 +1525 1524 -8.33333333333333e+00 +1525 1296 -2.08333333333333e+00 +1525 1536 2.08333333333333e+00 +1525 1831 -6.25000000000000e+00 +1525 1353 -2.08333333333333e+00 +1525 1815 2.08333333333333e+00 +1525 1817 2.08333333333333e+00 +1525 1523 -2.08333333333333e+00 +1525 1522 -6.25000000000000e+00 +1525 1521 4.16666666666667e+00 +1525 1665 -4.16666666666667e+00 +1525 1770 4.16666666666667e+00 +1525 1667 -4.16666666666667e+00 +1525 1517 4.16666666666667e+00 +1525 1772 -8.33333333333333e+00 +1525 1355 4.16666666666667e+00 +1525 1354 -6.25000000000000e+00 +1525 1520 8.33333333333333e+00 +1525 1526 -8.33333333333333e+00 +1525 1298 4.16666666666667e+00 +1525 1519 -3.75000000000000e+01 +1525 1832 -2.08333333333333e+00 +1525 1297 -6.25000000000000e+00 +1525 1518 8.33333333333333e+00 +1525 1515 -8.33333333333333e+00 +1526 1526 6.25000000000000e+01 +1526 1537 2.08333333333333e+00 +1526 1536 -4.16666666666667e+00 +1526 1832 -6.25000000000000e+00 +1526 1830 4.16666666666667e+00 +1526 1816 2.08333333333333e+00 +1526 1353 4.16666666666667e+00 +1526 1815 -4.16666666666667e+00 +1526 1523 -6.25000000000000e+00 +1526 1522 -2.08333333333333e+00 +1526 1524 -8.33333333333333e+00 +1526 1521 4.16666666666667e+00 +1526 1296 4.16666666666667e+00 +1526 1666 -4.16666666666667e+00 +1526 1516 4.16666666666667e+00 +1526 1355 -1.87500000000000e+01 +1526 1771 -8.33333333333333e+00 +1526 1354 4.16666666666667e+00 +1526 1770 4.16666666666667e+00 +1526 1665 -4.16666666666667e+00 +1526 1520 -1.25000000000000e+01 +1526 1831 -2.08333333333333e+00 +1526 1298 -1.87500000000000e+01 +1526 1519 8.33333333333333e+00 +1526 1525 -8.33333333333333e+00 +1526 1297 4.16666666666667e+00 +1526 1518 -4.16666666666667e+00 +1526 1515 4.16666666666667e+00 +1527 1527 6.25000000000000e+01 +1527 1676 -8.33333333333333e+00 +1527 1675 4.16666666666667e+00 +1527 1367 2.08333333333333e+00 +1527 1855 4.16666666666667e+00 +1527 1854 -1.87500000000000e+01 +1527 1535 -2.08333333333333e+00 +1527 1298 2.08333333333333e+00 +1527 1534 4.16666666666667e+00 +1527 1533 -6.25000000000000e+00 +1527 1670 -4.16666666666667e+00 +1527 1669 -4.16666666666667e+00 +1527 1673 4.16666666666667e+00 +1527 1853 -2.08333333333333e+00 +1527 1528 -8.33333333333333e+00 +1527 1672 4.16666666666667e+00 +1527 1516 -4.16666666666667e+00 +1527 1366 -4.16666666666667e+00 +1527 1852 4.16666666666667e+00 +1527 1851 -6.25000000000000e+00 +1527 1529 -8.33333333333333e+00 +1527 1532 4.16666666666667e+00 +1527 1517 8.33333333333333e+00 +1527 1531 4.16666666666667e+00 +1527 1297 -4.16666666666667e+00 +1527 1856 4.16666666666667e+00 +1527 1530 -1.87500000000000e+01 +1527 1515 -1.25000000000000e+01 +1528 1528 6.25000000000000e+01 +1528 1676 4.16666666666667e+00 +1528 1674 4.16666666666667e+00 +1528 1855 -6.25000000000000e+00 +1528 1854 4.16666666666667e+00 +1528 1535 4.16666666666667e+00 +1528 1529 -8.33333333333333e+00 +1528 1534 -1.87500000000000e+01 +1528 1533 4.16666666666667e+00 +1528 1668 -4.16666666666667e+00 +1528 1853 4.16666666666667e+00 +1528 1527 -8.33333333333333e+00 +1528 1673 -8.33333333333333e+00 +1528 1517 8.33333333333333e+00 +1528 1671 4.16666666666667e+00 +1528 1515 -4.16666666666667e+00 +1528 1367 2.08333333333333e+00 +1528 1670 -4.16666666666667e+00 +1528 1852 -1.87500000000000e+01 +1528 1365 -4.16666666666667e+00 +1528 1851 4.16666666666667e+00 +1528 1532 -2.08333333333333e+00 +1528 1298 2.08333333333333e+00 +1528 1856 -2.08333333333333e+00 +1528 1531 -6.25000000000000e+00 +1528 1516 -1.25000000000000e+01 +1528 1530 4.16666666666667e+00 +1528 1296 -4.16666666666667e+00 +1529 1529 6.25000000000000e+01 +1529 1675 4.16666666666667e+00 +1529 1854 4.16666666666667e+00 +1529 1674 -8.33333333333333e+00 +1529 1856 -6.25000000000000e+00 +1529 1365 2.08333333333333e+00 +1529 1535 -6.25000000000000e+00 +1529 1534 4.16666666666667e+00 +1529 1528 -8.33333333333333e+00 +1529 1533 -2.08333333333333e+00 +1529 1296 2.08333333333333e+00 +1529 1668 -4.16666666666667e+00 +1529 1852 4.16666666666667e+00 +1529 1671 4.16666666666667e+00 +1529 1851 -2.08333333333333e+00 +1529 1672 -8.33333333333333e+00 +1529 1516 8.33333333333333e+00 +1529 1853 -6.25000000000000e+00 +1529 1366 2.08333333333333e+00 +1529 1669 -4.16666666666667e+00 +1529 1855 -2.08333333333333e+00 +1529 1532 -6.25000000000000e+00 +1529 1517 -3.75000000000000e+01 +1529 1531 -2.08333333333333e+00 +1529 1297 2.08333333333333e+00 +1529 1527 -8.33333333333333e+00 +1529 1530 4.16666666666667e+00 +1529 1515 8.33333333333333e+00 +1530 1530 6.25000000000000e+01 +1530 1868 4.16666666666667e+00 +1530 1298 -2.08333333333333e+00 +1530 1538 2.08333333333333e+00 +1530 1537 -4.16666666666667e+00 +1530 1373 -2.08333333333333e+00 +1530 1867 4.16666666666667e+00 +1530 1866 -1.87500000000000e+01 +1530 1778 4.16666666666667e+00 +1530 1777 4.16666666666667e+00 +1530 1520 8.33333333333333e+00 +1530 1519 -4.16666666666667e+00 +1530 1518 -1.25000000000000e+01 +1530 1673 -4.16666666666667e+00 +1530 1853 2.08333333333333e+00 +1530 1672 -4.16666666666667e+00 +1530 1516 4.16666666666667e+00 +1530 1852 -4.16666666666667e+00 +1530 1372 4.16666666666667e+00 +1530 1371 -6.25000000000000e+00 +1530 1529 4.16666666666667e+00 +1530 1517 -8.33333333333333e+00 +1530 1528 4.16666666666667e+00 +1530 1531 -8.33333333333333e+00 +1530 1297 4.16666666666667e+00 +1530 1527 -1.87500000000000e+01 +1530 1532 -8.33333333333333e+00 +1530 1296 -6.25000000000000e+00 +1531 1531 6.25000000000000e+01 +1531 1868 -2.08333333333333e+00 +1531 1536 -4.16666666666667e+00 +1531 1867 -6.25000000000000e+00 +1531 1866 4.16666666666667e+00 +1531 1778 -8.33333333333333e+00 +1531 1373 4.16666666666667e+00 +1531 1776 4.16666666666667e+00 +1531 1520 8.33333333333333e+00 +1531 1532 -8.33333333333333e+00 +1531 1298 4.16666666666667e+00 +1531 1519 -1.25000000000000e+01 +1531 1518 -4.16666666666667e+00 +1531 1671 -4.16666666666667e+00 +1531 1515 4.16666666666667e+00 +1531 1853 2.08333333333333e+00 +1531 1673 -4.16666666666667e+00 +1531 1372 -1.87500000000000e+01 +1531 1851 -4.16666666666667e+00 +1531 1371 4.16666666666667e+00 +1531 1529 -2.08333333333333e+00 +1531 1517 4.16666666666667e+00 +1531 1528 -6.25000000000000e+00 +1531 1538 2.08333333333333e+00 +1531 1297 -1.87500000000000e+01 +1531 1527 4.16666666666667e+00 +1531 1530 -8.33333333333333e+00 +1531 1296 4.16666666666667e+00 +1532 1532 6.25000000000000e+01 +1532 1867 -2.08333333333333e+00 +1532 1530 -8.33333333333333e+00 +1532 1866 4.16666666666667e+00 +1532 1296 -2.08333333333333e+00 +1532 1536 2.08333333333333e+00 +1532 1868 -6.25000000000000e+00 +1532 1371 -2.08333333333333e+00 +1532 1776 4.16666666666667e+00 +1532 1777 -8.33333333333333e+00 +1532 1372 4.16666666666667e+00 +1532 1520 -3.75000000000000e+01 +1532 1519 8.33333333333333e+00 +1532 1531 -8.33333333333333e+00 +1532 1297 4.16666666666667e+00 +1532 1518 8.33333333333333e+00 +1532 1671 -4.16666666666667e+00 +1532 1851 2.08333333333333e+00 +1532 1373 -6.25000000000000e+00 +1532 1852 2.08333333333333e+00 +1532 1672 -4.16666666666667e+00 +1532 1529 -6.25000000000000e+00 +1532 1537 2.08333333333333e+00 +1532 1298 -6.25000000000000e+00 +1532 1528 -2.08333333333333e+00 +1532 1516 4.16666666666667e+00 +1532 1527 4.16666666666667e+00 +1532 1515 -8.33333333333333e+00 +1533 1533 3.75000000000000e+01 +1533 1820 -4.16666666666667e+00 +1533 1819 2.08333333333333e+00 +1533 1535 -4.16666666666667e+00 +1533 1523 4.16666666666667e+00 +1533 1298 2.08333333333333e+00 +1533 1522 -2.08333333333333e+00 +1533 1521 -6.25000000000000e+00 +1533 1675 -4.16666666666667e+00 +1533 1516 4.16666666666667e+00 +1533 1856 2.08333333333333e+00 +1533 1676 -4.16666666666667e+00 +1533 1378 2.08333333333333e+00 +1533 1855 -4.16666666666667e+00 +1533 1377 -1.25000000000000e+01 +1533 1529 -2.08333333333333e+00 +1533 1517 4.16666666666667e+00 +1533 1534 -4.16666666666667e+00 +1533 1528 4.16666666666667e+00 +1533 1297 2.08333333333333e+00 +1533 1379 2.08333333333333e+00 +1533 1527 -6.25000000000000e+00 +1533 1296 -1.25000000000000e+01 +1534 1534 3.33333333333333e+01 +1534 1818 2.08333333333333e+00 +1534 1523 4.16666666666667e+00 +1534 1522 -6.25000000000000e+00 +1534 1521 -2.08333333333333e+00 +1534 1856 2.08333333333333e+00 +1534 1676 -4.16666666666667e+00 +1534 1674 -4.16666666666667e+00 +1534 1515 4.16666666666667e+00 +1534 1378 -4.16666666666667e+00 +1534 1377 2.08333333333333e+00 +1534 1854 -4.16666666666667e+00 +1534 1529 4.16666666666667e+00 +1534 1517 -8.33333333333333e+00 +1534 1820 2.08333333333333e+00 +1534 1528 -1.87500000000000e+01 +1534 1297 -4.16666666666667e+00 +1534 1533 -4.16666666666667e+00 +1534 1527 4.16666666666667e+00 +1534 1296 2.08333333333333e+00 +1535 1535 3.33333333333333e+01 +1535 1377 2.08333333333333e+00 +1535 1818 -4.16666666666667e+00 +1535 1523 -1.87500000000000e+01 +1535 1522 4.16666666666667e+00 +1535 1533 -4.16666666666667e+00 +1535 1521 4.16666666666667e+00 +1535 1296 2.08333333333333e+00 +1535 1855 2.08333333333333e+00 +1535 1675 -4.16666666666667e+00 +1535 1379 -4.16666666666667e+00 +1535 1854 2.08333333333333e+00 +1535 1674 -4.16666666666667e+00 +1535 1819 2.08333333333333e+00 +1535 1529 -6.25000000000000e+00 +1535 1298 -4.16666666666667e+00 +1535 1528 4.16666666666667e+00 +1535 1516 -8.33333333333333e+00 +1535 1527 -2.08333333333333e+00 +1535 1515 4.16666666666667e+00 +1536 1536 3.75000000000000e+01 +1536 1526 -4.16666666666667e+00 +1536 1525 2.08333333333333e+00 +1536 1538 -4.16666666666667e+00 +1536 1832 4.16666666666667e+00 +1536 1382 2.08333333333333e+00 +1536 1831 -2.08333333333333e+00 +1536 1830 -6.25000000000000e+00 +1536 1519 -4.16666666666667e+00 +1536 1783 4.16666666666667e+00 +1536 1532 2.08333333333333e+00 +1536 1520 -4.16666666666667e+00 +1536 1297 2.08333333333333e+00 +1536 1531 -4.16666666666667e+00 +1536 1296 -1.25000000000000e+01 +1536 1868 -2.08333333333333e+00 +1536 1784 4.16666666666667e+00 +1536 1537 -4.16666666666667e+00 +1536 1867 4.16666666666667e+00 +1536 1381 2.08333333333333e+00 +1536 1298 2.08333333333333e+00 +1536 1866 -6.25000000000000e+00 +1536 1380 -1.25000000000000e+01 +1537 1537 3.33333333333333e+01 +1537 1524 2.08333333333333e+00 +1537 1832 4.16666666666667e+00 +1537 1831 -6.25000000000000e+00 +1537 1830 -2.08333333333333e+00 +1537 1532 2.08333333333333e+00 +1537 1520 -4.16666666666667e+00 +1537 1518 -4.16666666666667e+00 +1537 1782 4.16666666666667e+00 +1537 1297 -4.16666666666667e+00 +1537 1296 2.08333333333333e+00 +1537 1530 -4.16666666666667e+00 +1537 1868 4.16666666666667e+00 +1537 1784 -8.33333333333333e+00 +1537 1526 2.08333333333333e+00 +1537 1867 -1.87500000000000e+01 +1537 1381 -4.16666666666667e+00 +1537 1536 -4.16666666666667e+00 +1537 1866 4.16666666666667e+00 +1537 1380 2.08333333333333e+00 +1538 1538 3.33333333333333e+01 +1538 1296 2.08333333333333e+00 +1538 1524 -4.16666666666667e+00 +1538 1832 -1.87500000000000e+01 +1538 1831 4.16666666666667e+00 +1538 1536 -4.16666666666667e+00 +1538 1830 4.16666666666667e+00 +1538 1380 2.08333333333333e+00 +1538 1531 2.08333333333333e+00 +1538 1519 -4.16666666666667e+00 +1538 1298 -4.16666666666667e+00 +1538 1530 2.08333333333333e+00 +1538 1518 -4.16666666666667e+00 +1538 1525 2.08333333333333e+00 +1538 1868 -6.25000000000000e+00 +1538 1382 -4.16666666666667e+00 +1538 1867 4.16666666666667e+00 +1538 1783 -8.33333333333333e+00 +1538 1866 -2.08333333333333e+00 +1538 1782 4.16666666666667e+00 +1539 1539 1.25000000000000e+02 +1539 1543 8.33333333333333e+00 +1539 1542 -1.25000000000000e+01 +1539 1790 -8.33333333333333e+00 +1539 1789 4.16666666666667e+00 +1539 1802 8.33333333333333e+00 +1539 1549 4.16666666666667e+00 +1539 1801 8.33333333333333e+00 +1539 1800 -3.75000000000000e+01 +1539 1550 4.16666666666667e+00 +1539 1792 -4.16666666666667e+00 +1539 1793 8.33333333333333e+00 +1539 1541 -1.66666666666667e+01 +1539 1340 -4.16666666666667e+00 +1539 1791 -1.25000000000000e+01 +1539 1787 4.16666666666667e+00 +1539 1540 -1.66666666666667e+01 +1539 1786 4.16666666666667e+00 +1539 1339 -4.16666666666667e+00 +1539 1799 -4.16666666666667e+00 +1539 1796 4.16666666666667e+00 +1539 1546 -4.16666666666667e+00 +1539 1795 -8.33333333333333e+00 +1539 1798 8.33333333333333e+00 +1539 1797 -1.25000000000000e+01 +1539 1547 8.33333333333333e+00 +1539 1545 -1.25000000000000e+01 +1539 1544 -4.16666666666667e+00 +1539 281 4.16666666666667e+00 +1539 29 -4.16666666666667e+00 +1539 280 -8.33333333333333e+00 +1539 277 8.33333333333333e+00 +1539 278 8.33333333333333e+00 +1539 28 -4.16666666666667e+00 +1539 276 -3.75000000000000e+01 +1539 283 4.16666666666667e+00 +1539 284 -8.33333333333333e+00 +1540 1540 1.25000000000000e+02 +1540 1542 8.33333333333333e+00 +1540 1544 8.33333333333333e+00 +1540 1543 -3.75000000000000e+01 +1540 1788 4.16666666666667e+00 +1540 1802 -4.16666666666667e+00 +1540 1548 4.16666666666667e+00 +1540 1801 -1.25000000000000e+01 +1540 1800 8.33333333333333e+00 +1540 1550 -8.33333333333333e+00 +1540 1791 -4.16666666666667e+00 +1540 1793 8.33333333333333e+00 +1540 1792 -1.25000000000000e+01 +1540 1539 -1.66666666666667e+01 +1540 1787 -8.33333333333333e+00 +1540 1785 4.16666666666667e+00 +1540 1338 -4.16666666666667e+00 +1540 1799 8.33333333333333e+00 +1540 1541 -1.66666666666667e+01 +1540 1547 8.33333333333333e+00 +1540 1545 -4.16666666666667e+00 +1540 1796 4.16666666666667e+00 +1540 1340 -4.16666666666667e+00 +1540 1798 -3.75000000000000e+01 +1540 1794 -8.33333333333333e+00 +1540 1797 8.33333333333333e+00 +1540 1546 -1.25000000000000e+01 +1540 1790 4.16666666666667e+00 +1540 281 4.16666666666667e+00 +1540 279 -8.33333333333333e+00 +1540 278 -4.16666666666667e+00 +1540 276 8.33333333333333e+00 +1540 277 -1.25000000000000e+01 +1540 27 -4.16666666666667e+00 +1540 282 4.16666666666667e+00 +1540 284 4.16666666666667e+00 +1540 29 -4.16666666666667e+00 +1541 1541 1.25000000000000e+02 +1541 1789 4.16666666666667e+00 +1541 1544 -1.25000000000000e+01 +1541 1543 8.33333333333333e+00 +1541 1788 -8.33333333333333e+00 +1541 1801 -4.16666666666667e+00 +1541 1800 8.33333333333333e+00 +1541 1802 -1.25000000000000e+01 +1541 1549 -8.33333333333333e+00 +1541 1548 4.16666666666667e+00 +1541 1791 8.33333333333333e+00 +1541 1539 -1.66666666666667e+01 +1541 1793 -3.75000000000000e+01 +1541 1792 8.33333333333333e+00 +1541 1338 -4.16666666666667e+00 +1541 1785 4.16666666666667e+00 +1541 1786 -8.33333333333333e+00 +1541 1797 -4.16666666666667e+00 +1541 1794 4.16666666666667e+00 +1541 1798 8.33333333333333e+00 +1541 1540 -1.66666666666667e+01 +1541 1546 8.33333333333333e+00 +1541 1799 -1.25000000000000e+01 +1541 1795 4.16666666666667e+00 +1541 1339 -4.16666666666667e+00 +1541 1547 -3.75000000000000e+01 +1541 1542 -4.16666666666667e+00 +1541 1545 8.33333333333333e+00 +1541 280 4.16666666666667e+00 +1541 279 4.16666666666667e+00 +1541 27 -4.16666666666667e+00 +1541 277 -4.16666666666667e+00 +1541 278 -1.25000000000000e+01 +1541 276 8.33333333333333e+00 +1541 283 4.16666666666667e+00 +1541 28 -4.16666666666667e+00 +1541 282 -8.33333333333333e+00 +1542 1542 6.25000000000000e+01 +1542 1792 4.16666666666667e+00 +1542 1793 4.16666666666667e+00 +1542 1835 4.16666666666667e+00 +1542 1833 -6.25000000000000e+00 +1542 1543 -8.33333333333333e+00 +1542 1541 -4.16666666666667e+00 +1542 1544 -8.33333333333333e+00 +1542 1790 -4.16666666666667e+00 +1542 1802 4.16666666666667e+00 +1542 1837 4.16666666666667e+00 +1542 1540 8.33333333333333e+00 +1542 1801 -8.33333333333333e+00 +1542 1838 4.16666666666667e+00 +1542 1358 -4.16666666666667e+00 +1542 1357 2.08333333333333e+00 +1542 1789 -4.16666666666667e+00 +1542 1836 -1.87500000000000e+01 +1542 1550 4.16666666666667e+00 +1542 1549 -2.08333333333333e+00 +1542 1548 -6.25000000000000e+00 +1542 1834 -2.08333333333333e+00 +1542 1539 -1.25000000000000e+01 +1542 281 4.16666666666667e+00 +1542 280 4.16666666666667e+00 +1542 279 -1.87500000000000e+01 +1542 29 -4.16666666666667e+00 +1542 28 2.08333333333333e+00 +1543 1543 6.25000000000000e+01 +1543 1833 -2.08333333333333e+00 +1543 1791 4.16666666666667e+00 +1543 1793 -8.33333333333333e+00 +1543 1358 2.08333333333333e+00 +1543 1834 -6.25000000000000e+00 +1543 1542 -8.33333333333333e+00 +1543 1838 -2.08333333333333e+00 +1543 1836 4.16666666666667e+00 +1543 1790 -4.16666666666667e+00 +1543 1802 4.16666666666667e+00 +1543 1539 8.33333333333333e+00 +1543 1800 -8.33333333333333e+00 +1543 1837 -6.25000000000000e+00 +1543 1356 2.08333333333333e+00 +1543 1788 -4.16666666666667e+00 +1543 1550 4.16666666666667e+00 +1543 1544 -8.33333333333333e+00 +1543 1541 8.33333333333333e+00 +1543 1549 -6.25000000000000e+00 +1543 1835 4.16666666666667e+00 +1543 1540 -3.75000000000000e+01 +1543 1548 -2.08333333333333e+00 +1543 281 -2.08333333333333e+00 +1543 29 2.08333333333333e+00 +1543 280 -6.25000000000000e+00 +1543 279 4.16666666666667e+00 +1543 27 2.08333333333333e+00 +1544 1544 6.25000000000000e+01 +1544 1792 -8.33333333333333e+00 +1544 1791 4.16666666666667e+00 +1544 1835 -1.87500000000000e+01 +1544 1357 2.08333333333333e+00 +1544 1833 4.16666666666667e+00 +1544 1539 -4.16666666666667e+00 +1544 1837 -2.08333333333333e+00 +1544 1542 -8.33333333333333e+00 +1544 1788 -4.16666666666667e+00 +1544 1800 4.16666666666667e+00 +1544 1789 -4.16666666666667e+00 +1544 1801 4.16666666666667e+00 +1544 1838 -6.25000000000000e+00 +1544 1836 4.16666666666667e+00 +1544 1356 -4.16666666666667e+00 +1544 1550 -1.87500000000000e+01 +1544 1834 4.16666666666667e+00 +1544 1541 -1.25000000000000e+01 +1544 1549 4.16666666666667e+00 +1544 1543 -8.33333333333333e+00 +1544 1540 8.33333333333333e+00 +1544 1548 4.16666666666667e+00 +1544 281 -6.25000000000000e+00 +1544 280 -2.08333333333333e+00 +1544 28 2.08333333333333e+00 +1544 279 4.16666666666667e+00 +1544 27 -4.16666666666667e+00 +1545 1545 6.25000000000000e+01 +1545 1802 -8.33333333333333e+00 +1545 1801 4.16666666666667e+00 +1545 1376 2.08333333333333e+00 +1545 1873 4.16666666666667e+00 +1545 1872 -1.87500000000000e+01 +1545 1550 -2.08333333333333e+00 +1545 1549 4.16666666666667e+00 +1545 1548 -6.25000000000000e+00 +1545 1796 -4.16666666666667e+00 +1545 1795 -4.16666666666667e+00 +1545 1799 4.16666666666667e+00 +1545 1871 -2.08333333333333e+00 +1545 1546 -8.33333333333333e+00 +1545 1798 4.16666666666667e+00 +1545 1540 -4.16666666666667e+00 +1545 1375 -4.16666666666667e+00 +1545 1870 4.16666666666667e+00 +1545 1869 -6.25000000000000e+00 +1545 1547 -8.33333333333333e+00 +1545 1541 8.33333333333333e+00 +1545 1874 4.16666666666667e+00 +1545 1539 -1.25000000000000e+01 +1545 29 2.08333333333333e+00 +1545 284 4.16666666666667e+00 +1545 283 4.16666666666667e+00 +1545 28 -4.16666666666667e+00 +1545 282 -1.87500000000000e+01 +1546 1546 6.25000000000000e+01 +1546 1802 4.16666666666667e+00 +1546 1800 4.16666666666667e+00 +1546 1873 -6.25000000000000e+00 +1546 1872 4.16666666666667e+00 +1546 1550 4.16666666666667e+00 +1546 1547 -8.33333333333333e+00 +1546 1549 -1.87500000000000e+01 +1546 1548 4.16666666666667e+00 +1546 1794 -4.16666666666667e+00 +1546 1871 4.16666666666667e+00 +1546 1545 -8.33333333333333e+00 +1546 1799 -8.33333333333333e+00 +1546 1541 8.33333333333333e+00 +1546 1797 4.16666666666667e+00 +1546 1539 -4.16666666666667e+00 +1546 1376 2.08333333333333e+00 +1546 1796 -4.16666666666667e+00 +1546 1870 -1.87500000000000e+01 +1546 1374 -4.16666666666667e+00 +1546 1869 4.16666666666667e+00 +1546 1874 -2.08333333333333e+00 +1546 1540 -1.25000000000000e+01 +1546 284 -2.08333333333333e+00 +1546 29 2.08333333333333e+00 +1546 283 -6.25000000000000e+00 +1546 282 4.16666666666667e+00 +1546 27 -4.16666666666667e+00 +1547 1547 6.25000000000000e+01 +1547 1801 4.16666666666667e+00 +1547 1872 4.16666666666667e+00 +1547 1800 -8.33333333333333e+00 +1547 1874 -6.25000000000000e+00 +1547 1374 2.08333333333333e+00 +1547 1550 -6.25000000000000e+00 +1547 1549 4.16666666666667e+00 +1547 1546 -8.33333333333333e+00 +1547 1548 -2.08333333333333e+00 +1547 1794 -4.16666666666667e+00 +1547 1870 4.16666666666667e+00 +1547 1797 4.16666666666667e+00 +1547 1869 -2.08333333333333e+00 +1547 1798 -8.33333333333333e+00 +1547 1540 8.33333333333333e+00 +1547 1871 -6.25000000000000e+00 +1547 1375 2.08333333333333e+00 +1547 1795 -4.16666666666667e+00 +1547 1873 -2.08333333333333e+00 +1547 1541 -3.75000000000000e+01 +1547 1545 -8.33333333333333e+00 +1547 1539 8.33333333333333e+00 +1547 27 2.08333333333333e+00 +1547 284 -6.25000000000000e+00 +1547 283 -2.08333333333333e+00 +1547 28 2.08333333333333e+00 +1547 282 4.16666666666667e+00 +1548 1548 3.75000000000000e+01 +1548 1838 -4.16666666666667e+00 +1548 1837 2.08333333333333e+00 +1548 1550 -4.16666666666667e+00 +1548 1544 4.16666666666667e+00 +1548 1543 -2.08333333333333e+00 +1548 1542 -6.25000000000000e+00 +1548 1801 -4.16666666666667e+00 +1548 1540 4.16666666666667e+00 +1548 1874 2.08333333333333e+00 +1548 1802 -4.16666666666667e+00 +1548 1381 2.08333333333333e+00 +1548 1873 -4.16666666666667e+00 +1548 1380 -1.25000000000000e+01 +1548 1547 -2.08333333333333e+00 +1548 1541 4.16666666666667e+00 +1548 1549 -4.16666666666667e+00 +1548 1546 4.16666666666667e+00 +1548 1382 2.08333333333333e+00 +1548 1545 -6.25000000000000e+00 +1548 29 2.08333333333333e+00 +1548 28 2.08333333333333e+00 +1548 27 -1.25000000000000e+01 +1549 1549 3.33333333333333e+01 +1549 1836 2.08333333333333e+00 +1549 1544 4.16666666666667e+00 +1549 1543 -6.25000000000000e+00 +1549 1542 -2.08333333333333e+00 +1549 1874 2.08333333333333e+00 +1549 1802 -4.16666666666667e+00 +1549 1800 -4.16666666666667e+00 +1549 1539 4.16666666666667e+00 +1549 1381 -4.16666666666667e+00 +1549 1380 2.08333333333333e+00 +1549 1872 -4.16666666666667e+00 +1549 1547 4.16666666666667e+00 +1549 1541 -8.33333333333333e+00 +1549 1838 2.08333333333333e+00 +1549 1546 -1.87500000000000e+01 +1549 1548 -4.16666666666667e+00 +1549 1545 4.16666666666667e+00 +1549 28 -4.16666666666667e+00 +1549 27 2.08333333333333e+00 +1550 1550 3.33333333333333e+01 +1550 1380 2.08333333333333e+00 +1550 1836 -4.16666666666667e+00 +1550 1544 -1.87500000000000e+01 +1550 1543 4.16666666666667e+00 +1550 1548 -4.16666666666667e+00 +1550 1542 4.16666666666667e+00 +1550 1873 2.08333333333333e+00 +1550 1801 -4.16666666666667e+00 +1550 1382 -4.16666666666667e+00 +1550 1872 2.08333333333333e+00 +1550 1800 -4.16666666666667e+00 +1550 1837 2.08333333333333e+00 +1550 1547 -6.25000000000000e+00 +1550 1546 4.16666666666667e+00 +1550 1540 -8.33333333333333e+00 +1550 1545 -2.08333333333333e+00 +1550 1539 4.16666666666667e+00 +1550 27 2.08333333333333e+00 +1550 29 -4.16666666666667e+00 +1551 1551 6.25000000000000e+01 +1551 1595 -4.16666666666667e+00 +1551 1567 4.16666666666667e+00 +1551 1594 -4.16666666666667e+00 +1551 1591 -4.16666666666667e+00 +1551 1562 4.16666666666667e+00 +1551 1568 -8.33333333333333e+00 +1551 1561 4.16666666666667e+00 +1551 1560 -1.87500000000000e+01 +1551 1391 4.16666666666667e+00 +1551 1553 -8.33333333333333e+00 +1551 1559 8.33333333333333e+00 +1551 1588 4.16666666666667e+00 +1551 1558 -4.16666666666667e+00 +1551 1301 -2.08333333333333e+00 +1551 1385 2.08333333333333e+00 +1551 1300 4.16666666666667e+00 +1551 1384 -4.16666666666667e+00 +1551 1299 -6.25000000000000e+00 +1551 1557 -1.25000000000000e+01 +1551 1307 -2.08333333333333e+00 +1551 1589 4.16666666666667e+00 +1551 1552 -8.33333333333333e+00 +1551 1306 4.16666666666667e+00 +1551 1390 4.16666666666667e+00 +1551 1592 2.08333333333333e+00 +1551 1305 -6.25000000000000e+00 +1551 1389 -1.87500000000000e+01 +1552 1552 6.25000000000000e+01 +1552 1593 -4.16666666666667e+00 +1552 1592 2.08333333333333e+00 +1552 1595 -4.16666666666667e+00 +1552 1590 -4.16666666666667e+00 +1552 1562 -2.08333333333333e+00 +1552 1568 4.16666666666667e+00 +1552 1561 -6.25000000000000e+00 +1552 1560 4.16666666666667e+00 +1552 1391 -2.08333333333333e+00 +1552 1385 2.08333333333333e+00 +1552 1587 4.16666666666667e+00 +1552 1557 -4.16666666666667e+00 +1552 1301 4.16666666666667e+00 +1552 1553 -8.33333333333333e+00 +1552 1559 8.33333333333333e+00 +1552 1300 -1.87500000000000e+01 +1552 1558 -1.25000000000000e+01 +1552 1299 4.16666666666667e+00 +1552 1383 -4.16666666666667e+00 +1552 1307 4.16666666666667e+00 +1552 1589 -8.33333333333333e+00 +1552 1566 4.16666666666667e+00 +1552 1306 -1.87500000000000e+01 +1552 1390 -6.25000000000000e+00 +1552 1551 -8.33333333333333e+00 +1552 1305 4.16666666666667e+00 +1552 1389 4.16666666666667e+00 +1553 1553 6.25000000000000e+01 +1553 1593 -4.16666666666667e+00 +1553 1591 2.08333333333333e+00 +1553 1594 -4.16666666666667e+00 +1553 1562 -6.25000000000000e+00 +1553 1561 -2.08333333333333e+00 +1553 1567 4.16666666666667e+00 +1553 1560 4.16666666666667e+00 +1553 1566 -8.33333333333333e+00 +1553 1390 -2.08333333333333e+00 +1553 1384 2.08333333333333e+00 +1553 1389 4.16666666666667e+00 +1553 1551 -8.33333333333333e+00 +1553 1557 8.33333333333333e+00 +1553 1301 -6.25000000000000e+00 +1553 1559 -3.75000000000000e+01 +1553 1300 4.16666666666667e+00 +1553 1552 -8.33333333333333e+00 +1553 1558 8.33333333333333e+00 +1553 1299 -2.08333333333333e+00 +1553 1383 2.08333333333333e+00 +1553 1590 2.08333333333333e+00 +1553 1307 -6.25000000000000e+00 +1553 1391 -6.25000000000000e+00 +1553 1306 4.16666666666667e+00 +1553 1588 -8.33333333333333e+00 +1553 1305 -2.08333333333333e+00 +1553 1587 4.16666666666667e+00 +1554 1554 6.25000000000000e+01 +1554 1565 4.16666666666667e+00 +1554 1564 4.16666666666667e+00 +1554 1563 -1.87500000000000e+01 +1554 1628 -4.16666666666667e+00 +1554 1630 -4.16666666666667e+00 +1554 1568 4.16666666666667e+00 +1554 1567 -8.33333333333333e+00 +1554 1631 -4.16666666666667e+00 +1554 1625 4.16666666666667e+00 +1554 1559 -4.16666666666667e+00 +1554 1555 -8.33333333333333e+00 +1554 1558 8.33333333333333e+00 +1554 1396 4.16666666666667e+00 +1554 1301 4.16666666666667e+00 +1554 1385 -4.16666666666667e+00 +1554 1300 -2.08333333333333e+00 +1554 1384 2.08333333333333e+00 +1554 1299 -6.25000000000000e+00 +1554 1557 -1.25000000000000e+01 +1554 1556 -8.33333333333333e+00 +1554 1313 4.16666666666667e+00 +1554 1397 4.16666666666667e+00 +1554 1312 -2.08333333333333e+00 +1554 1624 4.16666666666667e+00 +1554 1627 2.08333333333333e+00 +1554 1311 -6.25000000000000e+00 +1554 1395 -1.87500000000000e+01 +1555 1555 6.25000000000000e+01 +1555 1565 -2.08333333333333e+00 +1555 1564 -6.25000000000000e+00 +1555 1563 4.16666666666667e+00 +1555 1628 2.08333333333333e+00 +1555 1568 4.16666666666667e+00 +1555 1631 -4.16666666666667e+00 +1555 1629 -4.16666666666667e+00 +1555 1566 -8.33333333333333e+00 +1555 1385 2.08333333333333e+00 +1555 1397 -2.08333333333333e+00 +1555 1554 -8.33333333333333e+00 +1555 1557 8.33333333333333e+00 +1555 1395 4.16666666666667e+00 +1555 1301 4.16666666666667e+00 +1555 1556 -8.33333333333333e+00 +1555 1559 8.33333333333333e+00 +1555 1300 -6.25000000000000e+00 +1555 1558 -3.75000000000000e+01 +1555 1299 -2.08333333333333e+00 +1555 1383 2.08333333333333e+00 +1555 1313 4.16666666666667e+00 +1555 1625 -8.33333333333333e+00 +1555 1626 2.08333333333333e+00 +1555 1312 -6.25000000000000e+00 +1555 1396 -6.25000000000000e+00 +1555 1311 -2.08333333333333e+00 +1555 1623 4.16666666666667e+00 +1556 1556 6.25000000000000e+01 +1556 1564 -2.08333333333333e+00 +1556 1563 4.16666666666667e+00 +1556 1627 2.08333333333333e+00 +1556 1626 -4.16666666666667e+00 +1556 1567 4.16666666666667e+00 +1556 1630 -4.16666666666667e+00 +1556 1566 4.16666666666667e+00 +1556 1629 -4.16666666666667e+00 +1556 1623 4.16666666666667e+00 +1556 1557 -4.16666666666667e+00 +1556 1384 2.08333333333333e+00 +1556 1396 -2.08333333333333e+00 +1556 1301 -1.87500000000000e+01 +1556 1559 -1.25000000000000e+01 +1556 1300 4.16666666666667e+00 +1556 1555 -8.33333333333333e+00 +1556 1558 8.33333333333333e+00 +1556 1299 4.16666666666667e+00 +1556 1383 -4.16666666666667e+00 +1556 1565 -6.25000000000000e+00 +1556 1313 -1.87500000000000e+01 +1556 1397 -6.25000000000000e+00 +1556 1312 4.16666666666667e+00 +1556 1624 -8.33333333333333e+00 +1556 1554 -8.33333333333333e+00 +1556 1311 4.16666666666667e+00 +1556 1395 4.16666666666667e+00 +1557 1557 1.25000000000000e+02 +1557 1594 -8.33333333333333e+00 +1557 1553 8.33333333333333e+00 +1557 1390 4.16666666666667e+00 +1557 1552 -4.16666666666667e+00 +1557 1391 -8.33333333333333e+00 +1557 1551 -1.25000000000000e+01 +1557 1589 -4.16666666666667e+00 +1557 1588 8.33333333333333e+00 +1557 1587 -1.25000000000000e+01 +1557 1660 -4.16666666666667e+00 +1557 1568 8.33333333333333e+00 +1557 1631 -8.33333333333333e+00 +1557 1630 4.16666666666667e+00 +1557 1301 4.16666666666667e+00 +1557 1567 8.33333333333333e+00 +1557 1558 -1.66666666666667e+01 +1557 1566 -3.75000000000000e+01 +1557 1661 -4.16666666666667e+00 +1557 1319 4.16666666666667e+00 +1557 1556 -4.16666666666667e+00 +1557 1555 8.33333333333333e+00 +1557 1385 -4.16666666666667e+00 +1557 1397 4.16666666666667e+00 +1557 1402 8.33333333333333e+00 +1557 1396 -8.33333333333333e+00 +1557 1300 4.16666666666667e+00 +1557 1384 -4.16666666666667e+00 +1557 1554 -1.25000000000000e+01 +1557 1559 -1.66666666666667e+01 +1557 1625 8.33333333333333e+00 +1557 1403 8.33333333333333e+00 +1557 1624 -4.16666666666667e+00 +1557 1318 4.16666666666667e+00 +1557 1595 4.16666666666667e+00 +1557 1623 -1.25000000000000e+01 +1557 1401 -3.75000000000000e+01 +1558 1558 1.25000000000000e+02 +1558 1593 -8.33333333333333e+00 +1558 1389 4.16666666666667e+00 +1558 1551 -4.16666666666667e+00 +1558 1391 4.16666666666667e+00 +1558 1553 8.33333333333333e+00 +1558 1552 -1.25000000000000e+01 +1558 1589 8.33333333333333e+00 +1558 1588 -3.75000000000000e+01 +1558 1587 8.33333333333333e+00 +1558 1661 -4.16666666666667e+00 +1558 1659 -4.16666666666667e+00 +1558 1568 -4.16666666666667e+00 +1558 1631 4.16666666666667e+00 +1558 1629 4.16666666666667e+00 +1558 1567 -1.25000000000000e+01 +1558 1566 8.33333333333333e+00 +1558 1557 -1.66666666666667e+01 +1558 1403 -4.16666666666667e+00 +1558 1559 -1.66666666666667e+01 +1558 1385 -4.16666666666667e+00 +1558 1397 4.16666666666667e+00 +1558 1554 8.33333333333333e+00 +1558 1401 8.33333333333333e+00 +1558 1395 -8.33333333333333e+00 +1558 1301 -8.33333333333333e+00 +1558 1556 8.33333333333333e+00 +1558 1555 -3.75000000000000e+01 +1558 1299 4.16666666666667e+00 +1558 1383 -4.16666666666667e+00 +1558 1625 8.33333333333333e+00 +1558 1319 -8.33333333333333e+00 +1558 1595 4.16666666666667e+00 +1558 1624 -1.25000000000000e+01 +1558 1402 -1.25000000000000e+01 +1558 1623 -4.16666666666667e+00 +1558 1317 4.16666666666667e+00 +1559 1559 1.25000000000000e+02 +1559 1593 4.16666666666667e+00 +1559 1551 8.33333333333333e+00 +1559 1390 4.16666666666667e+00 +1559 1389 -8.33333333333333e+00 +1559 1553 -3.75000000000000e+01 +1559 1552 8.33333333333333e+00 +1559 1589 -1.25000000000000e+01 +1559 1588 8.33333333333333e+00 +1559 1587 -4.16666666666667e+00 +1559 1660 -4.16666666666667e+00 +1559 1567 -4.16666666666667e+00 +1559 1630 4.16666666666667e+00 +1559 1566 8.33333333333333e+00 +1559 1629 -8.33333333333333e+00 +1559 1568 -1.25000000000000e+01 +1559 1299 4.16666666666667e+00 +1559 1659 -4.16666666666667e+00 +1559 1317 4.16666666666667e+00 +1559 1402 -4.16666666666667e+00 +1559 1558 -1.66666666666667e+01 +1559 1554 -4.16666666666667e+00 +1559 1384 -4.16666666666667e+00 +1559 1396 4.16666666666667e+00 +1559 1383 -4.16666666666667e+00 +1559 1395 4.16666666666667e+00 +1559 1556 -1.25000000000000e+01 +1559 1300 -8.33333333333333e+00 +1559 1555 8.33333333333333e+00 +1559 1594 4.16666666666667e+00 +1559 1625 -3.75000000000000e+01 +1559 1403 -1.25000000000000e+01 +1559 1624 8.33333333333333e+00 +1559 1318 -8.33333333333333e+00 +1559 1557 -1.66666666666667e+01 +1559 1623 8.33333333333333e+00 +1559 1401 8.33333333333333e+00 +1560 1560 6.25000000000000e+01 +1560 1594 4.16666666666667e+00 +1560 1595 4.16666666666667e+00 +1560 1553 4.16666666666667e+00 +1560 1562 -8.33333333333333e+00 +1560 1552 4.16666666666667e+00 +1560 1551 -1.87500000000000e+01 +1560 1591 4.16666666666667e+00 +1560 1590 -6.25000000000000e+00 +1560 1567 -4.16666666666667e+00 +1560 1561 -8.33333333333333e+00 +1560 1412 4.16666666666667e+00 +1560 1699 -4.16666666666667e+00 +1560 1423 4.16666666666667e+00 +1560 1568 8.33333333333333e+00 +1560 1424 -8.33333333333333e+00 +1560 1325 2.08333333333333e+00 +1560 1700 -4.16666666666667e+00 +1560 1411 4.16666666666667e+00 +1560 1324 -4.16666666666667e+00 +1560 1410 -1.87500000000000e+01 +1560 1406 -2.08333333333333e+00 +1560 1301 2.08333333333333e+00 +1560 1405 4.16666666666667e+00 +1560 1300 -4.16666666666667e+00 +1560 1404 -6.25000000000000e+00 +1560 1592 -2.08333333333333e+00 +1560 1566 -1.25000000000000e+01 +1561 1561 6.25000000000000e+01 +1561 1593 4.16666666666667e+00 +1561 1595 -8.33333333333333e+00 +1561 1553 -2.08333333333333e+00 +1561 1301 2.08333333333333e+00 +1561 1552 -6.25000000000000e+00 +1561 1551 4.16666666666667e+00 +1561 1325 2.08333333333333e+00 +1561 1591 -1.87500000000000e+01 +1561 1590 4.16666666666667e+00 +1561 1566 -4.16666666666667e+00 +1561 1412 -2.08333333333333e+00 +1561 1560 -8.33333333333333e+00 +1561 1698 -4.16666666666667e+00 +1561 1422 4.16666666666667e+00 +1561 1700 -4.16666666666667e+00 +1561 1424 4.16666666666667e+00 +1561 1411 -6.25000000000000e+00 +1561 1410 4.16666666666667e+00 +1561 1323 -4.16666666666667e+00 +1561 1406 4.16666666666667e+00 +1561 1562 -8.33333333333333e+00 +1561 1568 8.33333333333333e+00 +1561 1405 -1.87500000000000e+01 +1561 1592 4.16666666666667e+00 +1561 1567 -1.25000000000000e+01 +1561 1404 4.16666666666667e+00 +1561 1299 -4.16666666666667e+00 +1562 1562 6.25000000000000e+01 +1562 1590 -2.08333333333333e+00 +1562 1594 -8.33333333333333e+00 +1562 1593 4.16666666666667e+00 +1562 1553 -6.25000000000000e+00 +1562 1552 -2.08333333333333e+00 +1562 1300 2.08333333333333e+00 +1562 1551 4.16666666666667e+00 +1562 1560 -8.33333333333333e+00 +1562 1592 -6.25000000000000e+00 +1562 1324 2.08333333333333e+00 +1562 1411 -2.08333333333333e+00 +1562 1410 4.16666666666667e+00 +1562 1699 -4.16666666666667e+00 +1562 1423 4.16666666666667e+00 +1562 1566 8.33333333333333e+00 +1562 1422 -8.33333333333333e+00 +1562 1412 -6.25000000000000e+00 +1562 1323 2.08333333333333e+00 +1562 1698 -4.16666666666667e+00 +1562 1406 -6.25000000000000e+00 +1562 1591 4.16666666666667e+00 +1562 1568 -3.75000000000000e+01 +1562 1405 4.16666666666667e+00 +1562 1561 -8.33333333333333e+00 +1562 1567 8.33333333333333e+00 +1562 1404 -2.08333333333333e+00 +1562 1299 2.08333333333333e+00 +1563 1563 6.25000000000000e+01 +1563 1627 -2.08333333333333e+00 +1563 1630 4.16666666666667e+00 +1563 1628 4.16666666666667e+00 +1563 1626 -6.25000000000000e+00 +1563 1556 4.16666666666667e+00 +1563 1564 -8.33333333333333e+00 +1563 1555 4.16666666666667e+00 +1563 1554 -1.87500000000000e+01 +1563 1736 -4.16666666666667e+00 +1563 1565 -8.33333333333333e+00 +1563 1417 4.16666666666667e+00 +1563 1424 4.16666666666667e+00 +1563 1568 -4.16666666666667e+00 +1563 1423 -8.33333333333333e+00 +1563 1567 8.33333333333333e+00 +1563 1418 4.16666666666667e+00 +1563 1331 -4.16666666666667e+00 +1563 1330 2.08333333333333e+00 +1563 1735 -4.16666666666667e+00 +1563 1416 -1.87500000000000e+01 +1563 1406 4.16666666666667e+00 +1563 1301 -4.16666666666667e+00 +1563 1405 -2.08333333333333e+00 +1563 1300 2.08333333333333e+00 +1563 1404 -6.25000000000000e+00 +1563 1631 4.16666666666667e+00 +1563 1566 -1.25000000000000e+01 +1564 1564 6.25000000000000e+01 +1564 1631 -8.33333333333333e+00 +1564 1626 -2.08333333333333e+00 +1564 1629 4.16666666666667e+00 +1564 1331 2.08333333333333e+00 +1564 1627 -6.25000000000000e+00 +1564 1301 2.08333333333333e+00 +1564 1556 -2.08333333333333e+00 +1564 1555 -6.25000000000000e+00 +1564 1563 -8.33333333333333e+00 +1564 1554 4.16666666666667e+00 +1564 1736 -4.16666666666667e+00 +1564 1418 -2.08333333333333e+00 +1564 1424 4.16666666666667e+00 +1564 1416 4.16666666666667e+00 +1564 1422 -8.33333333333333e+00 +1564 1566 8.33333333333333e+00 +1564 1417 -6.25000000000000e+00 +1564 1329 2.08333333333333e+00 +1564 1734 -4.16666666666667e+00 +1564 1406 4.16666666666667e+00 +1564 1565 -8.33333333333333e+00 +1564 1568 8.33333333333333e+00 +1564 1405 -6.25000000000000e+00 +1564 1628 4.16666666666667e+00 +1564 1567 -3.75000000000000e+01 +1564 1404 -2.08333333333333e+00 +1564 1299 2.08333333333333e+00 +1565 1565 6.25000000000000e+01 +1565 1627 4.16666666666667e+00 +1565 1630 -8.33333333333333e+00 +1565 1628 -1.87500000000000e+01 +1565 1330 2.08333333333333e+00 +1565 1626 4.16666666666667e+00 +1565 1556 -6.25000000000000e+00 +1565 1300 2.08333333333333e+00 +1565 1555 -2.08333333333333e+00 +1565 1554 4.16666666666667e+00 +1565 1735 -4.16666666666667e+00 +1565 1734 -4.16666666666667e+00 +1565 1417 -2.08333333333333e+00 +1565 1423 4.16666666666667e+00 +1565 1563 -8.33333333333333e+00 +1565 1422 4.16666666666667e+00 +1565 1566 -4.16666666666667e+00 +1565 1418 -6.25000000000000e+00 +1565 1416 4.16666666666667e+00 +1565 1329 -4.16666666666667e+00 +1565 1406 -1.87500000000000e+01 +1565 1629 4.16666666666667e+00 +1565 1568 -1.25000000000000e+01 +1565 1405 4.16666666666667e+00 +1565 1564 -8.33333333333333e+00 +1565 1567 8.33333333333333e+00 +1565 1404 4.16666666666667e+00 +1565 1299 -4.16666666666667e+00 +1566 1566 1.25000000000000e+02 +1566 1595 -4.16666666666667e+00 +1566 1553 -8.33333333333333e+00 +1566 1594 8.33333333333333e+00 +1566 1593 -1.25000000000000e+01 +1566 1561 -4.16666666666667e+00 +1566 1562 8.33333333333333e+00 +1566 1560 -1.25000000000000e+01 +1566 1700 4.16666666666667e+00 +1566 1699 -8.33333333333333e+00 +1566 1660 4.16666666666667e+00 +1566 1630 -4.16666666666667e+00 +1566 1568 -1.66666666666667e+01 +1566 1559 8.33333333333333e+00 +1566 1631 8.33333333333333e+00 +1566 1301 -4.16666666666667e+00 +1566 1556 4.16666666666667e+00 +1566 1558 8.33333333333333e+00 +1566 1555 -8.33333333333333e+00 +1566 1557 -3.75000000000000e+01 +1566 1337 -4.16666666666667e+00 +1566 1661 4.16666666666667e+00 +1566 1629 -1.25000000000000e+01 +1566 1406 4.16666666666667e+00 +1566 1565 -4.16666666666667e+00 +1566 1423 8.33333333333333e+00 +1566 1567 -1.66666666666667e+01 +1566 1564 8.33333333333333e+00 +1566 1424 8.33333333333333e+00 +1566 1736 -8.33333333333333e+00 +1566 1735 4.16666666666667e+00 +1566 1336 -4.16666666666667e+00 +1566 1422 -3.75000000000000e+01 +1566 1405 4.16666666666667e+00 +1566 1300 -4.16666666666667e+00 +1566 1563 -1.25000000000000e+01 +1566 1552 4.16666666666667e+00 +1567 1567 1.25000000000000e+02 +1567 1595 8.33333333333333e+00 +1567 1553 4.16666666666667e+00 +1567 1594 -3.75000000000000e+01 +1567 1593 8.33333333333333e+00 +1567 1560 -4.16666666666667e+00 +1567 1700 4.16666666666667e+00 +1567 1562 8.33333333333333e+00 +1567 1561 -1.25000000000000e+01 +1567 1698 -8.33333333333333e+00 +1567 1568 -1.66666666666667e+01 +1567 1337 -4.16666666666667e+00 +1567 1301 -4.16666666666667e+00 +1567 1659 4.16666666666667e+00 +1567 1629 -4.16666666666667e+00 +1567 1559 -4.16666666666667e+00 +1567 1556 4.16666666666667e+00 +1567 1558 -1.25000000000000e+01 +1567 1557 8.33333333333333e+00 +1567 1554 -8.33333333333333e+00 +1567 1661 -8.33333333333333e+00 +1567 1631 8.33333333333333e+00 +1567 1630 -1.25000000000000e+01 +1567 1424 -4.16666666666667e+00 +1567 1736 4.16666666666667e+00 +1567 1422 8.33333333333333e+00 +1567 1566 -1.66666666666667e+01 +1567 1563 8.33333333333333e+00 +1567 1423 -1.25000000000000e+01 +1567 1734 4.16666666666667e+00 +1567 1335 -4.16666666666667e+00 +1567 1406 -8.33333333333333e+00 +1567 1565 8.33333333333333e+00 +1567 1564 -3.75000000000000e+01 +1567 1551 4.16666666666667e+00 +1567 1404 4.16666666666667e+00 +1567 1299 -4.16666666666667e+00 +1568 1568 1.25000000000000e+02 +1568 1593 -4.16666666666667e+00 +1568 1552 4.16666666666667e+00 +1568 1551 -8.33333333333333e+00 +1568 1595 -1.25000000000000e+01 +1568 1699 4.16666666666667e+00 +1568 1560 8.33333333333333e+00 +1568 1562 -3.75000000000000e+01 +1568 1561 8.33333333333333e+00 +1568 1698 4.16666666666667e+00 +1568 1567 -1.66666666666667e+01 +1568 1336 -4.16666666666667e+00 +1568 1300 -4.16666666666667e+00 +1568 1558 -4.16666666666667e+00 +1568 1555 4.16666666666667e+00 +1568 1566 -1.66666666666667e+01 +1568 1557 8.33333333333333e+00 +1568 1629 8.33333333333333e+00 +1568 1559 -1.25000000000000e+01 +1568 1299 -4.16666666666667e+00 +1568 1554 4.16666666666667e+00 +1568 1631 -3.75000000000000e+01 +1568 1660 -8.33333333333333e+00 +1568 1630 8.33333333333333e+00 +1568 1335 -4.16666666666667e+00 +1568 1659 4.16666666666667e+00 +1568 1423 -4.16666666666667e+00 +1568 1735 4.16666666666667e+00 +1568 1404 4.16666666666667e+00 +1568 1563 -4.16666666666667e+00 +1568 1424 -1.25000000000000e+01 +1568 1422 8.33333333333333e+00 +1568 1734 -8.33333333333333e+00 +1568 1565 -1.25000000000000e+01 +1568 1594 8.33333333333333e+00 +1568 1405 -8.33333333333333e+00 +1568 1564 8.33333333333333e+00 +1569 1569 6.25000000000000e+01 +1569 1600 -4.16666666666667e+00 +1569 1580 -2.08333333333333e+00 +1569 1586 4.16666666666667e+00 +1569 1579 4.16666666666667e+00 +1569 1578 -6.25000000000000e+00 +1569 1598 2.08333333333333e+00 +1569 1601 -4.16666666666667e+00 +1569 1597 -4.16666666666667e+00 +1569 1388 2.08333333333333e+00 +1569 1391 -2.08333333333333e+00 +1569 1588 4.16666666666667e+00 +1569 1576 -4.16666666666667e+00 +1569 1307 4.16666666666667e+00 +1569 1589 -8.33333333333333e+00 +1569 1306 4.16666666666667e+00 +1569 1570 -8.33333333333333e+00 +1569 1390 4.16666666666667e+00 +1569 1305 -1.87500000000000e+01 +1569 1389 -6.25000000000000e+00 +1569 1571 -8.33333333333333e+00 +1569 1304 4.16666666666667e+00 +1569 1577 8.33333333333333e+00 +1569 1303 4.16666666666667e+00 +1569 1387 -4.16666666666667e+00 +1569 1585 4.16666666666667e+00 +1569 1302 -1.87500000000000e+01 +1569 1575 -1.25000000000000e+01 +1570 1570 6.25000000000000e+01 +1570 1601 -4.16666666666667e+00 +1570 1584 4.16666666666667e+00 +1570 1599 -4.16666666666667e+00 +1570 1580 4.16666666666667e+00 +1570 1586 -8.33333333333333e+00 +1570 1579 -1.87500000000000e+01 +1570 1578 4.16666666666667e+00 +1570 1596 -4.16666666666667e+00 +1570 1571 -8.33333333333333e+00 +1570 1391 4.16666666666667e+00 +1570 1577 8.33333333333333e+00 +1570 1587 4.16666666666667e+00 +1570 1575 -4.16666666666667e+00 +1570 1307 -2.08333333333333e+00 +1570 1589 4.16666666666667e+00 +1570 1306 -6.25000000000000e+00 +1570 1390 -1.87500000000000e+01 +1570 1305 4.16666666666667e+00 +1570 1569 -8.33333333333333e+00 +1570 1389 4.16666666666667e+00 +1570 1304 -2.08333333333333e+00 +1570 1388 2.08333333333333e+00 +1570 1598 2.08333333333333e+00 +1570 1303 -6.25000000000000e+00 +1570 1576 -1.25000000000000e+01 +1570 1302 4.16666666666667e+00 +1570 1386 -4.16666666666667e+00 +1571 1571 6.25000000000000e+01 +1571 1600 -4.16666666666667e+00 +1571 1580 -6.25000000000000e+00 +1571 1579 4.16666666666667e+00 +1571 1585 -8.33333333333333e+00 +1571 1578 -2.08333333333333e+00 +1571 1584 4.16666666666667e+00 +1571 1596 2.08333333333333e+00 +1571 1599 -4.16666666666667e+00 +1571 1386 2.08333333333333e+00 +1571 1389 -2.08333333333333e+00 +1571 1570 -8.33333333333333e+00 +1571 1390 4.16666666666667e+00 +1571 1576 8.33333333333333e+00 +1571 1307 -6.25000000000000e+00 +1571 1391 -6.25000000000000e+00 +1571 1306 -2.08333333333333e+00 +1571 1588 4.16666666666667e+00 +1571 1305 4.16666666666667e+00 +1571 1587 -8.33333333333333e+00 +1571 1597 2.08333333333333e+00 +1571 1304 -6.25000000000000e+00 +1571 1577 -3.75000000000000e+01 +1571 1303 -2.08333333333333e+00 +1571 1387 2.08333333333333e+00 +1571 1569 -8.33333333333333e+00 +1571 1302 4.16666666666667e+00 +1571 1575 8.33333333333333e+00 +1572 1572 1.25000000000000e+02 +1572 1646 4.16666666666667e+00 +1572 1582 8.33333333333333e+00 +1572 1573 -1.66666666666667e+01 +1572 1304 8.33333333333333e+00 +1572 1303 -4.16666666666667e+00 +1572 1581 -1.25000000000000e+01 +1572 1574 -1.66666666666667e+01 +1572 1316 8.33333333333333e+00 +1572 1645 4.16666666666667e+00 +1572 1315 -4.16666666666667e+00 +1572 1387 4.16666666666667e+00 +1572 1388 4.16666666666667e+00 +1572 1302 -1.25000000000000e+01 +1572 1400 -4.16666666666667e+00 +1572 1399 8.33333333333333e+00 +1572 1398 -1.25000000000000e+01 +1572 1583 -4.16666666666667e+00 +1572 1314 -1.25000000000000e+01 +1572 1586 4.16666666666667e+00 +1572 1649 -4.16666666666667e+00 +1572 1648 -4.16666666666667e+00 +1572 1585 -8.33333333333333e+00 +1572 1576 8.33333333333333e+00 +1572 1643 -8.33333333333333e+00 +1572 1642 4.16666666666667e+00 +1572 1577 8.33333333333333e+00 +1572 1575 -3.75000000000000e+01 +1572 2320 8.33333333333333e+00 +1572 2318 -8.33333333333333e+00 +1572 2317 4.16666666666667e+00 +1572 2321 8.33333333333333e+00 +1572 2319 -3.75000000000000e+01 +1572 2287 -4.16666666666667e+00 +1572 2288 -4.16666666666667e+00 +1572 2294 4.16666666666667e+00 +1572 2293 -8.33333333333333e+00 +1573 1573 1.25000000000000e+02 +1573 1581 8.33333333333333e+00 +1573 1572 -1.66666666666667e+01 +1573 1583 8.33333333333333e+00 +1573 1582 -3.75000000000000e+01 +1573 1302 -4.16666666666667e+00 +1573 1646 -8.33333333333333e+00 +1573 1644 4.16666666666667e+00 +1573 1314 -4.16666666666667e+00 +1573 1386 4.16666666666667e+00 +1573 1388 -8.33333333333333e+00 +1573 1304 8.33333333333333e+00 +1573 1303 -1.25000000000000e+01 +1573 1400 8.33333333333333e+00 +1573 1574 -1.66666666666667e+01 +1573 1316 8.33333333333333e+00 +1573 1399 -3.75000000000000e+01 +1573 1315 -1.25000000000000e+01 +1573 1398 8.33333333333333e+00 +1573 1647 -4.16666666666667e+00 +1573 1586 4.16666666666667e+00 +1573 1584 -8.33333333333333e+00 +1573 1649 -4.16666666666667e+00 +1573 1577 -4.16666666666667e+00 +1573 1643 4.16666666666667e+00 +1573 1575 8.33333333333333e+00 +1573 1641 4.16666666666667e+00 +1573 1576 -1.25000000000000e+01 +1573 2321 -4.16666666666667e+00 +1573 2319 8.33333333333333e+00 +1573 2316 4.16666666666667e+00 +1573 2320 -1.25000000000000e+01 +1573 2286 -4.16666666666667e+00 +1573 2288 -4.16666666666667e+00 +1573 2294 4.16666666666667e+00 +1573 2318 4.16666666666667e+00 +1573 2292 -8.33333333333333e+00 +1574 1574 1.25000000000000e+02 +1574 1581 -4.16666666666667e+00 +1574 1644 4.16666666666667e+00 +1574 1583 -1.25000000000000e+01 +1574 1582 8.33333333333333e+00 +1574 1302 8.33333333333333e+00 +1574 1645 -8.33333333333333e+00 +1574 1572 -1.66666666666667e+01 +1574 1314 8.33333333333333e+00 +1574 1304 -3.75000000000000e+01 +1574 1387 -8.33333333333333e+00 +1574 1303 8.33333333333333e+00 +1574 1386 4.16666666666667e+00 +1574 1400 -1.25000000000000e+01 +1574 1316 -3.75000000000000e+01 +1574 1399 8.33333333333333e+00 +1574 1573 -1.66666666666667e+01 +1574 1315 8.33333333333333e+00 +1574 1398 -4.16666666666667e+00 +1574 1584 4.16666666666667e+00 +1574 1647 -4.16666666666667e+00 +1574 1585 4.16666666666667e+00 +1574 1648 -4.16666666666667e+00 +1574 1576 -4.16666666666667e+00 +1574 1642 4.16666666666667e+00 +1574 1641 -8.33333333333333e+00 +1574 1577 -1.25000000000000e+01 +1574 1575 8.33333333333333e+00 +1574 2320 -4.16666666666667e+00 +1574 2316 -8.33333333333333e+00 +1574 2321 -1.25000000000000e+01 +1574 2319 8.33333333333333e+00 +1574 2287 -4.16666666666667e+00 +1574 2293 4.16666666666667e+00 +1574 2286 -4.16666666666667e+00 +1574 2317 4.16666666666667e+00 +1574 2292 4.16666666666667e+00 +1575 1575 1.25000000000000e+02 +1575 1600 -8.33333333333333e+00 +1575 1570 -4.16666666666667e+00 +1575 1390 4.16666666666667e+00 +1575 1391 4.16666666666667e+00 +1575 1571 8.33333333333333e+00 +1575 1569 -1.25000000000000e+01 +1575 1589 8.33333333333333e+00 +1575 1588 8.33333333333333e+00 +1575 1587 -3.75000000000000e+01 +1575 1664 -4.16666666666667e+00 +1575 1663 -4.16666666666667e+00 +1575 1586 -4.16666666666667e+00 +1575 1649 4.16666666666667e+00 +1575 1648 4.16666666666667e+00 +1575 1585 8.33333333333333e+00 +1575 1576 -1.66666666666667e+01 +1575 1584 -1.25000000000000e+01 +1575 1403 -4.16666666666667e+00 +1575 1577 -1.66666666666667e+01 +1575 1388 -4.16666666666667e+00 +1575 1400 4.16666666666667e+00 +1575 1573 8.33333333333333e+00 +1575 1402 8.33333333333333e+00 +1575 1399 -8.33333333333333e+00 +1575 1574 8.33333333333333e+00 +1575 1304 -8.33333333333333e+00 +1575 1303 4.16666666666667e+00 +1575 1387 -4.16666666666667e+00 +1575 1572 -3.75000000000000e+01 +1575 1643 8.33333333333333e+00 +1575 1319 -8.33333333333333e+00 +1575 1642 -4.16666666666667e+00 +1575 1318 4.16666666666667e+00 +1575 1641 -1.25000000000000e+01 +1575 1601 4.16666666666667e+00 +1575 1401 -1.25000000000000e+01 +1576 1576 1.25000000000000e+02 +1576 1599 -8.33333333333333e+00 +1576 1571 8.33333333333333e+00 +1576 1569 -4.16666666666667e+00 +1576 1389 4.16666666666667e+00 +1576 1391 -8.33333333333333e+00 +1576 1570 -1.25000000000000e+01 +1576 1589 -4.16666666666667e+00 +1576 1588 -1.25000000000000e+01 +1576 1587 8.33333333333333e+00 +1576 1662 -4.16666666666667e+00 +1576 1586 8.33333333333333e+00 +1576 1649 -8.33333333333333e+00 +1576 1647 4.16666666666667e+00 +1576 1304 4.16666666666667e+00 +1576 1585 -3.75000000000000e+01 +1576 1584 8.33333333333333e+00 +1576 1575 -1.66666666666667e+01 +1576 1664 -4.16666666666667e+00 +1576 1319 4.16666666666667e+00 +1576 1574 -4.16666666666667e+00 +1576 1572 8.33333333333333e+00 +1576 1388 -4.16666666666667e+00 +1576 1400 4.16666666666667e+00 +1576 1401 8.33333333333333e+00 +1576 1398 -8.33333333333333e+00 +1576 1573 -1.25000000000000e+01 +1576 1302 4.16666666666667e+00 +1576 1386 -4.16666666666667e+00 +1576 1643 8.33333333333333e+00 +1576 1577 -1.66666666666667e+01 +1576 1403 8.33333333333333e+00 +1576 1642 -1.25000000000000e+01 +1576 1601 4.16666666666667e+00 +1576 1402 -3.75000000000000e+01 +1576 1641 -4.16666666666667e+00 +1576 1317 4.16666666666667e+00 +1577 1577 1.25000000000000e+02 +1577 1600 4.16666666666667e+00 +1577 1570 8.33333333333333e+00 +1577 1390 -8.33333333333333e+00 +1577 1389 4.16666666666667e+00 +1577 1571 -3.75000000000000e+01 +1577 1569 8.33333333333333e+00 +1577 1589 -1.25000000000000e+01 +1577 1588 -4.16666666666667e+00 +1577 1587 8.33333333333333e+00 +1577 1662 -4.16666666666667e+00 +1577 1585 8.33333333333333e+00 +1577 1584 -4.16666666666667e+00 +1577 1647 4.16666666666667e+00 +1577 1648 -8.33333333333333e+00 +1577 1586 -1.25000000000000e+01 +1577 1303 4.16666666666667e+00 +1577 1663 -4.16666666666667e+00 +1577 1318 4.16666666666667e+00 +1577 1401 -4.16666666666667e+00 +1577 1573 -4.16666666666667e+00 +1577 1575 -1.66666666666667e+01 +1577 1386 -4.16666666666667e+00 +1577 1398 4.16666666666667e+00 +1577 1387 -4.16666666666667e+00 +1577 1399 4.16666666666667e+00 +1577 1574 -1.25000000000000e+01 +1577 1572 8.33333333333333e+00 +1577 1302 -8.33333333333333e+00 +1577 1643 -3.75000000000000e+01 +1577 1599 4.16666666666667e+00 +1577 1403 -1.25000000000000e+01 +1577 1642 8.33333333333333e+00 +1577 1576 -1.66666666666667e+01 +1577 1402 8.33333333333333e+00 +1577 1641 8.33333333333333e+00 +1577 1317 -8.33333333333333e+00 +1578 1578 6.25000000000000e+01 +1578 1600 4.16666666666667e+00 +1578 1601 -8.33333333333333e+00 +1578 1304 2.08333333333333e+00 +1578 1571 -2.08333333333333e+00 +1578 1570 4.16666666666667e+00 +1578 1569 -6.25000000000000e+00 +1578 1343 2.08333333333333e+00 +1578 1597 4.16666666666667e+00 +1578 1596 -1.87500000000000e+01 +1578 1585 -4.16666666666667e+00 +1578 1436 -2.08333333333333e+00 +1578 1579 -8.33333333333333e+00 +1578 1804 -4.16666666666667e+00 +1578 1441 4.16666666666667e+00 +1578 1805 -4.16666666666667e+00 +1578 1442 4.16666666666667e+00 +1578 1342 -4.16666666666667e+00 +1578 1435 4.16666666666667e+00 +1578 1434 -6.25000000000000e+00 +1578 1580 -8.33333333333333e+00 +1578 1433 4.16666666666667e+00 +1578 1586 8.33333333333333e+00 +1578 1432 4.16666666666667e+00 +1578 1303 -4.16666666666667e+00 +1578 1598 4.16666666666667e+00 +1578 1431 -1.87500000000000e+01 +1578 1584 -1.25000000000000e+01 +1579 1579 6.25000000000000e+01 +1579 1599 4.16666666666667e+00 +1579 1601 4.16666666666667e+00 +1579 1571 4.16666666666667e+00 +1579 1580 -8.33333333333333e+00 +1579 1570 -1.87500000000000e+01 +1579 1569 4.16666666666667e+00 +1579 1597 -6.25000000000000e+00 +1579 1596 4.16666666666667e+00 +1579 1584 -4.16666666666667e+00 +1579 1578 -8.33333333333333e+00 +1579 1436 4.16666666666667e+00 +1579 1803 -4.16666666666667e+00 +1579 1440 4.16666666666667e+00 +1579 1586 8.33333333333333e+00 +1579 1442 -8.33333333333333e+00 +1579 1343 2.08333333333333e+00 +1579 1805 -4.16666666666667e+00 +1579 1435 -1.87500000000000e+01 +1579 1341 -4.16666666666667e+00 +1579 1434 4.16666666666667e+00 +1579 1433 -2.08333333333333e+00 +1579 1304 2.08333333333333e+00 +1579 1598 -2.08333333333333e+00 +1579 1432 -6.25000000000000e+00 +1579 1585 -1.25000000000000e+01 +1579 1431 4.16666666666667e+00 +1579 1302 -4.16666666666667e+00 +1580 1580 6.25000000000000e+01 +1580 1596 4.16666666666667e+00 +1580 1600 4.16666666666667e+00 +1580 1599 -8.33333333333333e+00 +1580 1571 -6.25000000000000e+00 +1580 1570 4.16666666666667e+00 +1580 1579 -8.33333333333333e+00 +1580 1302 2.08333333333333e+00 +1580 1569 -2.08333333333333e+00 +1580 1598 -6.25000000000000e+00 +1580 1341 2.08333333333333e+00 +1580 1434 -2.08333333333333e+00 +1580 1435 4.16666666666667e+00 +1580 1585 8.33333333333333e+00 +1580 1441 -8.33333333333333e+00 +1580 1803 -4.16666666666667e+00 +1580 1440 4.16666666666667e+00 +1580 1436 -6.25000000000000e+00 +1580 1342 2.08333333333333e+00 +1580 1804 -4.16666666666667e+00 +1580 1597 -2.08333333333333e+00 +1580 1433 -6.25000000000000e+00 +1580 1586 -3.75000000000000e+01 +1580 1432 -2.08333333333333e+00 +1580 1303 2.08333333333333e+00 +1580 1578 -8.33333333333333e+00 +1580 1431 4.16666666666667e+00 +1580 1584 8.33333333333333e+00 +1581 1581 1.25000000000000e+02 +1581 1573 8.33333333333333e+00 +1581 1303 4.16666666666667e+00 +1581 1572 -1.25000000000000e+01 +1581 1583 -1.66666666666667e+01 +1581 1646 8.33333333333333e+00 +1581 1345 4.16666666666667e+00 +1581 1645 -4.16666666666667e+00 +1581 1644 -1.25000000000000e+01 +1581 1433 8.33333333333333e+00 +1581 1432 -4.16666666666667e+00 +1581 1304 4.16666666666667e+00 +1581 1431 -1.25000000000000e+01 +1581 1439 -4.16666666666667e+00 +1581 1346 4.16666666666667e+00 +1581 1582 -1.66666666666667e+01 +1581 1438 8.33333333333333e+00 +1581 1574 -4.16666666666667e+00 +1581 1437 -1.25000000000000e+01 +1581 1649 -8.33333333333333e+00 +1581 1648 4.16666666666667e+00 +1581 1811 -4.16666666666667e+00 +1581 1442 4.16666666666667e+00 +1581 1441 -8.33333333333333e+00 +1581 1585 8.33333333333333e+00 +1581 1810 -4.16666666666667e+00 +1581 1586 8.33333333333333e+00 +1581 1584 -3.75000000000000e+01 +1581 2321 4.16666666666667e+00 +1581 2320 -8.33333333333333e+00 +1581 2317 -4.16666666666667e+00 +1581 2062 4.16666666666667e+00 +1581 2063 -8.33333333333333e+00 +1581 2330 8.33333333333333e+00 +1581 2318 -4.16666666666667e+00 +1581 2329 8.33333333333333e+00 +1581 2328 -3.75000000000000e+01 +1582 1582 1.25000000000000e+02 +1582 1572 8.33333333333333e+00 +1582 1574 8.33333333333333e+00 +1582 1573 -3.75000000000000e+01 +1582 1302 4.16666666666667e+00 +1582 1646 8.33333333333333e+00 +1582 1645 -1.25000000000000e+01 +1582 1344 4.16666666666667e+00 +1582 1644 -4.16666666666667e+00 +1582 1583 -1.66666666666667e+01 +1582 1431 -4.16666666666667e+00 +1582 1304 -8.33333333333333e+00 +1582 1433 8.33333333333333e+00 +1582 1432 -1.25000000000000e+01 +1582 1439 8.33333333333333e+00 +1582 1346 -8.33333333333333e+00 +1582 1438 -3.75000000000000e+01 +1582 1581 -1.66666666666667e+01 +1582 1437 8.33333333333333e+00 +1582 1647 4.16666666666667e+00 +1582 1811 -4.16666666666667e+00 +1582 1442 4.16666666666667e+00 +1582 1586 -4.16666666666667e+00 +1582 1440 -8.33333333333333e+00 +1582 1584 8.33333333333333e+00 +1582 1809 -4.16666666666667e+00 +1582 1649 4.16666666666667e+00 +1582 1585 -1.25000000000000e+01 +1582 2319 -8.33333333333333e+00 +1582 2316 -4.16666666666667e+00 +1582 2318 -4.16666666666667e+00 +1582 2061 4.16666666666667e+00 +1582 2063 4.16666666666667e+00 +1582 2330 -4.16666666666667e+00 +1582 2321 4.16666666666667e+00 +1582 2329 -1.25000000000000e+01 +1582 2328 8.33333333333333e+00 +1583 1583 1.25000000000000e+02 +1583 1572 -4.16666666666667e+00 +1583 1574 -1.25000000000000e+01 +1583 1573 8.33333333333333e+00 +1583 1646 -3.75000000000000e+01 +1583 1645 8.33333333333333e+00 +1583 1581 -1.66666666666667e+01 +1583 1644 8.33333333333333e+00 +1583 1582 -1.66666666666667e+01 +1583 1431 8.33333333333333e+00 +1583 1433 -3.75000000000000e+01 +1583 1303 -8.33333333333333e+00 +1583 1432 8.33333333333333e+00 +1583 1302 4.16666666666667e+00 +1583 1439 -1.25000000000000e+01 +1583 1438 8.33333333333333e+00 +1583 1345 -8.33333333333333e+00 +1583 1437 -4.16666666666667e+00 +1583 1344 4.16666666666667e+00 +1583 1647 -8.33333333333333e+00 +1583 1809 -4.16666666666667e+00 +1583 1810 -4.16666666666667e+00 +1583 1440 4.16666666666667e+00 +1583 1441 4.16666666666667e+00 +1583 1585 -4.16666666666667e+00 +1583 1648 4.16666666666667e+00 +1583 1586 -1.25000000000000e+01 +1583 1584 8.33333333333333e+00 +1583 2319 4.16666666666667e+00 +1583 2317 -4.16666666666667e+00 +1583 2062 4.16666666666667e+00 +1583 2329 -4.16666666666667e+00 +1583 2061 -8.33333333333333e+00 +1583 2328 8.33333333333333e+00 +1583 2316 -4.16666666666667e+00 +1583 2320 4.16666666666667e+00 +1583 2330 -1.25000000000000e+01 +1584 1584 1.25000000000000e+02 +1584 1601 8.33333333333333e+00 +1584 1571 4.16666666666667e+00 +1584 1600 8.33333333333333e+00 +1584 1599 -3.75000000000000e+01 +1584 1579 -4.16666666666667e+00 +1584 1805 4.16666666666667e+00 +1584 1580 8.33333333333333e+00 +1584 1578 -1.25000000000000e+01 +1584 1804 -8.33333333333333e+00 +1584 1586 -1.66666666666667e+01 +1584 1349 -4.16666666666667e+00 +1584 1304 -4.16666666666667e+00 +1584 1663 4.16666666666667e+00 +1584 1648 -4.16666666666667e+00 +1584 1577 -4.16666666666667e+00 +1584 1574 4.16666666666667e+00 +1584 1664 -8.33333333333333e+00 +1584 1649 8.33333333333333e+00 +1584 1647 -1.25000000000000e+01 +1584 1576 8.33333333333333e+00 +1584 1573 -8.33333333333333e+00 +1584 1575 -1.25000000000000e+01 +1584 1442 -4.16666666666667e+00 +1584 1811 4.16666666666667e+00 +1584 1441 8.33333333333333e+00 +1584 1585 -1.66666666666667e+01 +1584 1582 8.33333333333333e+00 +1584 1810 4.16666666666667e+00 +1584 1348 -4.16666666666667e+00 +1584 1440 -1.25000000000000e+01 +1584 1583 8.33333333333333e+00 +1584 1433 -8.33333333333333e+00 +1584 1432 4.16666666666667e+00 +1584 1303 -4.16666666666667e+00 +1584 1581 -3.75000000000000e+01 +1584 1570 4.16666666666667e+00 +1585 1585 1.25000000000000e+02 +1585 1601 -4.16666666666667e+00 +1585 1571 -8.33333333333333e+00 +1585 1600 -1.25000000000000e+01 +1585 1599 8.33333333333333e+00 +1585 1578 -4.16666666666667e+00 +1585 1580 8.33333333333333e+00 +1585 1579 -1.25000000000000e+01 +1585 1805 4.16666666666667e+00 +1585 1803 -8.33333333333333e+00 +1585 1662 4.16666666666667e+00 +1585 1647 -4.16666666666667e+00 +1585 1577 8.33333333333333e+00 +1585 1586 -1.66666666666667e+01 +1585 1649 8.33333333333333e+00 +1585 1349 -4.16666666666667e+00 +1585 1664 4.16666666666667e+00 +1585 1648 -1.25000000000000e+01 +1585 1304 -4.16666666666667e+00 +1585 1574 4.16666666666667e+00 +1585 1576 -3.75000000000000e+01 +1585 1575 8.33333333333333e+00 +1585 1572 -8.33333333333333e+00 +1585 1433 4.16666666666667e+00 +1585 1583 -4.16666666666667e+00 +1585 1440 8.33333333333333e+00 +1585 1584 -1.66666666666667e+01 +1585 1581 8.33333333333333e+00 +1585 1811 -8.33333333333333e+00 +1585 1442 8.33333333333333e+00 +1585 1441 -3.75000000000000e+01 +1585 1809 4.16666666666667e+00 +1585 1347 -4.16666666666667e+00 +1585 1582 -1.25000000000000e+01 +1585 1569 4.16666666666667e+00 +1585 1431 4.16666666666667e+00 +1585 1302 -4.16666666666667e+00 +1586 1586 1.25000000000000e+02 +1586 1599 8.33333333333333e+00 +1586 1570 -8.33333333333333e+00 +1586 1569 4.16666666666667e+00 +1586 1601 -1.25000000000000e+01 +1586 1579 8.33333333333333e+00 +1586 1803 4.16666666666667e+00 +1586 1580 -3.75000000000000e+01 +1586 1578 8.33333333333333e+00 +1586 1804 4.16666666666667e+00 +1586 1584 -1.66666666666667e+01 +1586 1347 -4.16666666666667e+00 +1586 1302 -4.16666666666667e+00 +1586 1576 8.33333333333333e+00 +1586 1585 -1.66666666666667e+01 +1586 1648 8.33333333333333e+00 +1586 1575 -4.16666666666667e+00 +1586 1572 4.16666666666667e+00 +1586 1649 -3.75000000000000e+01 +1586 1348 -4.16666666666667e+00 +1586 1663 4.16666666666667e+00 +1586 1662 -8.33333333333333e+00 +1586 1647 8.33333333333333e+00 +1586 1577 -1.25000000000000e+01 +1586 1303 -4.16666666666667e+00 +1586 1573 4.16666666666667e+00 +1586 1440 -4.16666666666667e+00 +1586 1809 4.16666666666667e+00 +1586 1432 4.16666666666667e+00 +1586 1582 -4.16666666666667e+00 +1586 1442 -1.25000000000000e+01 +1586 1810 -8.33333333333333e+00 +1586 1441 8.33333333333333e+00 +1586 1583 -1.25000000000000e+01 +1586 1600 -4.16666666666667e+00 +1586 1581 8.33333333333333e+00 +1586 1431 -8.33333333333333e+00 +1587 1587 1.25000000000000e+02 +1587 1601 -4.16666666666667e+00 +1587 1600 8.33333333333333e+00 +1587 1599 -1.25000000000000e+01 +1587 1664 4.16666666666667e+00 +1587 1570 4.16666666666667e+00 +1587 1571 -8.33333333333333e+00 +1587 1577 8.33333333333333e+00 +1587 1576 8.33333333333333e+00 +1587 1575 -3.75000000000000e+01 +1587 1588 -1.66666666666667e+01 +1587 1306 -4.16666666666667e+00 +1587 1318 -4.16666666666667e+00 +1587 1666 -4.16666666666667e+00 +1587 1660 4.16666666666667e+00 +1587 1667 -4.16666666666667e+00 +1587 1604 4.16666666666667e+00 +1587 1307 8.33333333333333e+00 +1587 1589 -1.66666666666667e+01 +1587 1595 8.33333333333333e+00 +1587 1603 -8.33333333333333e+00 +1587 1594 8.33333333333333e+00 +1587 1593 -3.75000000000000e+01 +1587 1319 8.33333333333333e+00 +1587 1661 -8.33333333333333e+00 +1587 1390 -4.16666666666667e+00 +1587 1552 4.16666666666667e+00 +1587 1553 4.16666666666667e+00 +1587 1391 -4.16666666666667e+00 +1587 1305 -1.25000000000000e+01 +1587 1559 -4.16666666666667e+00 +1587 1403 4.16666666666667e+00 +1587 1558 8.33333333333333e+00 +1587 1402 -8.33333333333333e+00 +1587 1557 -1.25000000000000e+01 +1587 1663 4.16666666666667e+00 +1587 1317 -1.25000000000000e+01 +1588 1588 1.25000000000000e+02 +1588 1601 8.33333333333333e+00 +1588 1600 -3.75000000000000e+01 +1588 1599 8.33333333333333e+00 +1588 1664 -8.33333333333333e+00 +1588 1569 4.16666666666667e+00 +1588 1571 4.16666666666667e+00 +1588 1577 -4.16666666666667e+00 +1588 1576 -1.25000000000000e+01 +1588 1575 8.33333333333333e+00 +1588 1587 -1.66666666666667e+01 +1588 1305 -4.16666666666667e+00 +1588 1317 -4.16666666666667e+00 +1588 1665 -4.16666666666667e+00 +1588 1659 4.16666666666667e+00 +1588 1604 4.16666666666667e+00 +1588 1595 -4.16666666666667e+00 +1588 1594 -1.25000000000000e+01 +1588 1602 -8.33333333333333e+00 +1588 1593 8.33333333333333e+00 +1588 1667 -4.16666666666667e+00 +1588 1661 4.16666666666667e+00 +1588 1389 -4.16666666666667e+00 +1588 1551 4.16666666666667e+00 +1588 1391 -4.16666666666667e+00 +1588 1403 4.16666666666667e+00 +1588 1553 -8.33333333333333e+00 +1588 1307 8.33333333333333e+00 +1588 1306 -1.25000000000000e+01 +1588 1559 8.33333333333333e+00 +1588 1589 -1.66666666666667e+01 +1588 1319 8.33333333333333e+00 +1588 1558 -3.75000000000000e+01 +1588 1662 4.16666666666667e+00 +1588 1318 -1.25000000000000e+01 +1588 1557 8.33333333333333e+00 +1588 1401 -8.33333333333333e+00 +1589 1589 1.25000000000000e+02 +1589 1600 8.33333333333333e+00 +1589 1599 -4.16666666666667e+00 +1589 1663 -8.33333333333333e+00 +1589 1662 4.16666666666667e+00 +1589 1570 4.16666666666667e+00 +1589 1569 -8.33333333333333e+00 +1589 1577 -1.25000000000000e+01 +1589 1576 -4.16666666666667e+00 +1589 1575 8.33333333333333e+00 +1589 1665 -4.16666666666667e+00 +1589 1602 4.16666666666667e+00 +1589 1595 -1.25000000000000e+01 +1589 1603 4.16666666666667e+00 +1589 1594 -4.16666666666667e+00 +1589 1305 8.33333333333333e+00 +1589 1587 -1.66666666666667e+01 +1589 1593 8.33333333333333e+00 +1589 1666 -4.16666666666667e+00 +1589 1660 4.16666666666667e+00 +1589 1317 8.33333333333333e+00 +1589 1659 -8.33333333333333e+00 +1589 1390 -4.16666666666667e+00 +1589 1402 4.16666666666667e+00 +1589 1307 -3.75000000000000e+01 +1589 1552 -8.33333333333333e+00 +1589 1306 8.33333333333333e+00 +1589 1551 4.16666666666667e+00 +1589 1389 -4.16666666666667e+00 +1589 1559 -1.25000000000000e+01 +1589 1601 -1.25000000000000e+01 +1589 1319 -3.75000000000000e+01 +1589 1558 8.33333333333333e+00 +1589 1588 -1.66666666666667e+01 +1589 1318 8.33333333333333e+00 +1589 1557 -4.16666666666667e+00 +1589 1401 4.16666666666667e+00 +1590 1590 6.25000000000000e+01 +1590 1553 2.08333333333333e+00 +1590 1552 -4.16666666666667e+00 +1590 1561 4.16666666666667e+00 +1590 1560 -6.25000000000000e+00 +1590 1307 4.16666666666667e+00 +1590 1592 -8.33333333333333e+00 +1590 1595 8.33333333333333e+00 +1590 1594 -4.16666666666667e+00 +1590 1593 -1.25000000000000e+01 +1590 1325 4.16666666666667e+00 +1590 1700 -8.33333333333333e+00 +1590 1699 4.16666666666667e+00 +1590 1603 4.16666666666667e+00 +1590 1708 -4.16666666666667e+00 +1590 1448 2.08333333333333e+00 +1590 1709 -4.16666666666667e+00 +1590 1324 4.16666666666667e+00 +1590 1447 -4.16666666666667e+00 +1590 1323 -1.87500000000000e+01 +1590 1445 -2.08333333333333e+00 +1590 1604 4.16666666666667e+00 +1590 1591 -8.33333333333333e+00 +1590 1444 4.16666666666667e+00 +1590 1306 4.16666666666667e+00 +1590 1562 -2.08333333333333e+00 +1590 1443 -6.25000000000000e+00 +1590 1305 -1.87500000000000e+01 +1591 1591 6.25000000000000e+01 +1591 1592 -8.33333333333333e+00 +1591 1307 -2.08333333333333e+00 +1591 1553 2.08333333333333e+00 +1591 1551 -4.16666666666667e+00 +1591 1325 -2.08333333333333e+00 +1591 1561 -1.87500000000000e+01 +1591 1560 4.16666666666667e+00 +1591 1700 4.16666666666667e+00 +1591 1595 8.33333333333333e+00 +1591 1594 -1.25000000000000e+01 +1591 1593 -4.16666666666667e+00 +1591 1698 4.16666666666667e+00 +1591 1602 4.16666666666667e+00 +1591 1707 -4.16666666666667e+00 +1591 1448 2.08333333333333e+00 +1591 1709 -4.16666666666667e+00 +1591 1324 -6.25000000000000e+00 +1591 1323 4.16666666666667e+00 +1591 1446 -4.16666666666667e+00 +1591 1445 4.16666666666667e+00 +1591 1604 -8.33333333333333e+00 +1591 1562 4.16666666666667e+00 +1591 1444 -1.87500000000000e+01 +1591 1306 -6.25000000000000e+00 +1591 1590 -8.33333333333333e+00 +1591 1443 4.16666666666667e+00 +1591 1305 4.16666666666667e+00 +1592 1592 6.25000000000000e+01 +1592 1591 -8.33333333333333e+00 +1592 1560 -2.08333333333333e+00 +1592 1551 2.08333333333333e+00 +1592 1306 -2.08333333333333e+00 +1592 1552 2.08333333333333e+00 +1592 1562 -6.25000000000000e+00 +1592 1324 -2.08333333333333e+00 +1592 1699 4.16666666666667e+00 +1592 1595 -3.75000000000000e+01 +1592 1594 8.33333333333333e+00 +1592 1305 4.16666666666667e+00 +1592 1590 -8.33333333333333e+00 +1592 1593 8.33333333333333e+00 +1592 1323 4.16666666666667e+00 +1592 1698 -8.33333333333333e+00 +1592 1447 2.08333333333333e+00 +1592 1708 -4.16666666666667e+00 +1592 1325 -6.25000000000000e+00 +1592 1446 2.08333333333333e+00 +1592 1707 -4.16666666666667e+00 +1592 1561 4.16666666666667e+00 +1592 1445 -6.25000000000000e+00 +1592 1307 -6.25000000000000e+00 +1592 1444 4.16666666666667e+00 +1592 1603 -8.33333333333333e+00 +1592 1443 -2.08333333333333e+00 +1592 1602 4.16666666666667e+00 +1593 1593 1.25000000000000e+02 +1593 1558 -8.33333333333333e+00 +1593 1553 -4.16666666666667e+00 +1593 1561 4.16666666666667e+00 +1593 1552 -4.16666666666667e+00 +1593 1562 4.16666666666667e+00 +1593 1568 -4.16666666666667e+00 +1593 1567 8.33333333333333e+00 +1593 1566 -1.25000000000000e+01 +1593 1709 4.16666666666667e+00 +1593 1708 -8.33333333333333e+00 +1593 1699 8.33333333333333e+00 +1593 1592 8.33333333333333e+00 +1593 1306 4.16666666666667e+00 +1593 1591 -4.16666666666667e+00 +1593 1590 -1.25000000000000e+01 +1593 1700 8.33333333333333e+00 +1593 1336 4.16666666666667e+00 +1593 1698 -3.75000000000000e+01 +1593 1595 -1.66666666666667e+01 +1593 1660 -4.16666666666667e+00 +1593 1604 -4.16666666666667e+00 +1593 1666 4.16666666666667e+00 +1593 1771 -4.16666666666667e+00 +1593 1667 4.16666666666667e+00 +1593 1772 -4.16666666666667e+00 +1593 1307 -8.33333333333333e+00 +1593 1589 8.33333333333333e+00 +1593 1603 8.33333333333333e+00 +1593 1588 8.33333333333333e+00 +1593 1594 -1.66666666666667e+01 +1593 1602 -1.25000000000000e+01 +1593 1587 -3.75000000000000e+01 +1593 1661 8.33333333333333e+00 +1593 1337 -8.33333333333333e+00 +1593 1559 4.16666666666667e+00 +1593 1659 -1.25000000000000e+01 +1594 1594 1.25000000000000e+02 +1594 1557 -8.33333333333333e+00 +1594 1560 4.16666666666667e+00 +1594 1551 -4.16666666666667e+00 +1594 1562 -8.33333333333333e+00 +1594 1568 8.33333333333333e+00 +1594 1553 -4.16666666666667e+00 +1594 1567 -3.75000000000000e+01 +1594 1566 8.33333333333333e+00 +1594 1709 4.16666666666667e+00 +1594 1700 -4.16666666666667e+00 +1594 1707 -8.33333333333333e+00 +1594 1698 8.33333333333333e+00 +1594 1592 8.33333333333333e+00 +1594 1595 -1.66666666666667e+01 +1594 1591 -1.25000000000000e+01 +1594 1305 4.16666666666667e+00 +1594 1590 -4.16666666666667e+00 +1594 1699 -1.25000000000000e+01 +1594 1335 4.16666666666667e+00 +1594 1659 -4.16666666666667e+00 +1594 1604 8.33333333333333e+00 +1594 1665 4.16666666666667e+00 +1594 1770 -4.16666666666667e+00 +1594 1667 -8.33333333333333e+00 +1594 1661 8.33333333333333e+00 +1594 1307 4.16666666666667e+00 +1594 1589 -4.16666666666667e+00 +1594 1603 -3.75000000000000e+01 +1594 1588 -1.25000000000000e+01 +1594 1602 8.33333333333333e+00 +1594 1587 8.33333333333333e+00 +1594 1593 -1.66666666666667e+01 +1594 1772 -4.16666666666667e+00 +1594 1337 4.16666666666667e+00 +1594 1559 4.16666666666667e+00 +1594 1660 -1.25000000000000e+01 +1595 1595 1.25000000000000e+02 +1595 1557 4.16666666666667e+00 +1595 1551 -4.16666666666667e+00 +1595 1561 -8.33333333333333e+00 +1595 1567 8.33333333333333e+00 +1595 1560 4.16666666666667e+00 +1595 1566 -4.16666666666667e+00 +1595 1552 -4.16666666666667e+00 +1595 1568 -1.25000000000000e+01 +1595 1708 4.16666666666667e+00 +1595 1699 -4.16666666666667e+00 +1595 1707 4.16666666666667e+00 +1595 1592 -3.75000000000000e+01 +1595 1591 8.33333333333333e+00 +1595 1594 -1.66666666666667e+01 +1595 1590 8.33333333333333e+00 +1595 1700 -1.25000000000000e+01 +1595 1698 8.33333333333333e+00 +1595 1593 -1.66666666666667e+01 +1595 1602 -4.16666666666667e+00 +1595 1603 8.33333333333333e+00 +1595 1666 -8.33333333333333e+00 +1595 1660 8.33333333333333e+00 +1595 1665 4.16666666666667e+00 +1595 1770 -4.16666666666667e+00 +1595 1604 -1.25000000000000e+01 +1595 1589 -1.25000000000000e+01 +1595 1306 4.16666666666667e+00 +1595 1588 -4.16666666666667e+00 +1595 1305 -8.33333333333333e+00 +1595 1587 8.33333333333333e+00 +1595 1558 4.16666666666667e+00 +1595 1661 -3.75000000000000e+01 +1595 1771 -4.16666666666667e+00 +1595 1336 4.16666666666667e+00 +1595 1659 8.33333333333333e+00 +1595 1335 -8.33333333333333e+00 +1596 1596 6.25000000000000e+01 +1596 1580 4.16666666666667e+00 +1596 1571 2.08333333333333e+00 +1596 1307 -2.08333333333333e+00 +1596 1570 -4.16666666666667e+00 +1596 1343 -2.08333333333333e+00 +1596 1579 4.16666666666667e+00 +1596 1578 -1.87500000000000e+01 +1596 1805 4.16666666666667e+00 +1596 1804 4.16666666666667e+00 +1596 1601 8.33333333333333e+00 +1596 1600 -4.16666666666667e+00 +1596 1599 -1.25000000000000e+01 +1596 1603 4.16666666666667e+00 +1596 1807 -4.16666666666667e+00 +1596 1451 2.08333333333333e+00 +1596 1808 -4.16666666666667e+00 +1596 1450 -4.16666666666667e+00 +1596 1342 4.16666666666667e+00 +1596 1341 -6.25000000000000e+00 +1596 1445 4.16666666666667e+00 +1596 1604 -8.33333333333333e+00 +1596 1444 4.16666666666667e+00 +1596 1597 -8.33333333333333e+00 +1596 1306 4.16666666666667e+00 +1596 1443 -1.87500000000000e+01 +1596 1598 -8.33333333333333e+00 +1596 1305 -6.25000000000000e+00 +1597 1597 6.25000000000000e+01 +1597 1571 2.08333333333333e+00 +1597 1569 -4.16666666666667e+00 +1597 1579 -6.25000000000000e+00 +1597 1578 4.16666666666667e+00 +1597 1343 4.16666666666667e+00 +1597 1805 -8.33333333333333e+00 +1597 1803 4.16666666666667e+00 +1597 1598 -8.33333333333333e+00 +1597 1307 4.16666666666667e+00 +1597 1601 8.33333333333333e+00 +1597 1600 -1.25000000000000e+01 +1597 1599 -4.16666666666667e+00 +1597 1602 4.16666666666667e+00 +1597 1806 -4.16666666666667e+00 +1597 1451 2.08333333333333e+00 +1597 1808 -4.16666666666667e+00 +1597 1342 -1.87500000000000e+01 +1597 1449 -4.16666666666667e+00 +1597 1341 4.16666666666667e+00 +1597 1445 -2.08333333333333e+00 +1597 1604 4.16666666666667e+00 +1597 1444 -6.25000000000000e+00 +1597 1580 -2.08333333333333e+00 +1597 1306 -1.87500000000000e+01 +1597 1443 4.16666666666667e+00 +1597 1596 -8.33333333333333e+00 +1597 1305 4.16666666666667e+00 +1598 1598 6.25000000000000e+01 +1598 1570 2.08333333333333e+00 +1598 1596 -8.33333333333333e+00 +1598 1578 4.16666666666667e+00 +1598 1569 2.08333333333333e+00 +1598 1305 -2.08333333333333e+00 +1598 1580 -6.25000000000000e+00 +1598 1341 -2.08333333333333e+00 +1598 1803 4.16666666666667e+00 +1598 1342 4.16666666666667e+00 +1598 1804 -8.33333333333333e+00 +1598 1601 -3.75000000000000e+01 +1598 1597 -8.33333333333333e+00 +1598 1306 4.16666666666667e+00 +1598 1600 8.33333333333333e+00 +1598 1599 8.33333333333333e+00 +1598 1449 2.08333333333333e+00 +1598 1806 -4.16666666666667e+00 +1598 1343 -6.25000000000000e+00 +1598 1450 2.08333333333333e+00 +1598 1807 -4.16666666666667e+00 +1598 1445 -6.25000000000000e+00 +1598 1579 -2.08333333333333e+00 +1598 1307 -6.25000000000000e+00 +1598 1444 -2.08333333333333e+00 +1598 1603 4.16666666666667e+00 +1598 1443 4.16666666666667e+00 +1598 1602 -8.33333333333333e+00 +1599 1599 1.25000000000000e+02 +1599 1576 -8.33333333333333e+00 +1599 1570 -4.16666666666667e+00 +1599 1579 4.16666666666667e+00 +1599 1586 8.33333333333333e+00 +1599 1580 -8.33333333333333e+00 +1599 1571 -4.16666666666667e+00 +1599 1585 8.33333333333333e+00 +1599 1584 -3.75000000000000e+01 +1599 1808 4.16666666666667e+00 +1599 1805 -4.16666666666667e+00 +1599 1804 8.33333333333333e+00 +1599 1807 -8.33333333333333e+00 +1599 1598 8.33333333333333e+00 +1599 1601 -1.66666666666667e+01 +1599 1597 -4.16666666666667e+00 +1599 1306 4.16666666666667e+00 +1599 1596 -1.25000000000000e+01 +1599 1348 4.16666666666667e+00 +1599 1803 -1.25000000000000e+01 +1599 1663 -4.16666666666667e+00 +1599 1604 8.33333333333333e+00 +1599 1666 4.16666666666667e+00 +1599 1816 -4.16666666666667e+00 +1599 1667 -8.33333333333333e+00 +1599 1664 8.33333333333333e+00 +1599 1307 4.16666666666667e+00 +1599 1589 -4.16666666666667e+00 +1599 1603 8.33333333333333e+00 +1599 1588 8.33333333333333e+00 +1599 1600 -1.66666666666667e+01 +1599 1602 -3.75000000000000e+01 +1599 1587 -1.25000000000000e+01 +1599 1817 -4.16666666666667e+00 +1599 1349 4.16666666666667e+00 +1599 1577 4.16666666666667e+00 +1599 1662 -1.25000000000000e+01 +1600 1600 1.25000000000000e+02 +1600 1575 -8.33333333333333e+00 +1600 1571 -4.16666666666667e+00 +1600 1569 -4.16666666666667e+00 +1600 1578 4.16666666666667e+00 +1600 1586 -4.16666666666667e+00 +1600 1580 4.16666666666667e+00 +1600 1585 -1.25000000000000e+01 +1600 1584 8.33333333333333e+00 +1600 1808 4.16666666666667e+00 +1600 1803 8.33333333333333e+00 +1600 1806 -8.33333333333333e+00 +1600 1598 8.33333333333333e+00 +1600 1597 -1.25000000000000e+01 +1600 1596 -4.16666666666667e+00 +1600 1305 4.16666666666667e+00 +1600 1805 8.33333333333333e+00 +1600 1804 -3.75000000000000e+01 +1600 1347 4.16666666666667e+00 +1600 1601 -1.66666666666667e+01 +1600 1662 -4.16666666666667e+00 +1600 1604 -4.16666666666667e+00 +1600 1665 4.16666666666667e+00 +1600 1815 -4.16666666666667e+00 +1600 1817 -4.16666666666667e+00 +1600 1667 4.16666666666667e+00 +1600 1307 -8.33333333333333e+00 +1600 1589 8.33333333333333e+00 +1600 1603 -1.25000000000000e+01 +1600 1588 -3.75000000000000e+01 +1600 1602 8.33333333333333e+00 +1600 1587 8.33333333333333e+00 +1600 1599 -1.66666666666667e+01 +1600 1664 8.33333333333333e+00 +1600 1349 -8.33333333333333e+00 +1600 1577 4.16666666666667e+00 +1600 1663 -1.25000000000000e+01 +1601 1601 1.25000000000000e+02 +1601 1576 4.16666666666667e+00 +1601 1570 -4.16666666666667e+00 +1601 1585 -4.16666666666667e+00 +1601 1579 4.16666666666667e+00 +1601 1584 8.33333333333333e+00 +1601 1578 -8.33333333333333e+00 +1601 1569 -4.16666666666667e+00 +1601 1586 -1.25000000000000e+01 +1601 1806 4.16666666666667e+00 +1601 1803 -4.16666666666667e+00 +1601 1807 4.16666666666667e+00 +1601 1598 -3.75000000000000e+01 +1601 1597 8.33333333333333e+00 +1601 1596 8.33333333333333e+00 +1601 1599 -1.66666666666667e+01 +1601 1805 -1.25000000000000e+01 +1601 1804 8.33333333333333e+00 +1601 1600 -1.66666666666667e+01 +1601 1603 -4.16666666666667e+00 +1601 1602 8.33333333333333e+00 +1601 1816 -4.16666666666667e+00 +1601 1666 4.16666666666667e+00 +1601 1665 -8.33333333333333e+00 +1601 1662 8.33333333333333e+00 +1601 1604 -1.25000000000000e+01 +1601 1589 -1.25000000000000e+01 +1601 1306 -8.33333333333333e+00 +1601 1588 8.33333333333333e+00 +1601 1305 4.16666666666667e+00 +1601 1587 -4.16666666666667e+00 +1601 1575 4.16666666666667e+00 +1601 1664 -3.75000000000000e+01 +1601 1663 8.33333333333333e+00 +1601 1348 -8.33333333333333e+00 +1601 1815 -4.16666666666667e+00 +1601 1347 4.16666666666667e+00 +1602 1602 1.25000000000000e+02 +1602 1816 4.16666666666667e+00 +1602 1817 4.16666666666667e+00 +1602 1600 8.33333333333333e+00 +1602 1599 -3.75000000000000e+01 +1602 1597 4.16666666666667e+00 +1602 1808 -4.16666666666667e+00 +1602 1598 -8.33333333333333e+00 +1602 1807 8.33333333333333e+00 +1602 1806 -1.25000000000000e+01 +1602 1603 -1.66666666666667e+01 +1602 1306 -4.16666666666667e+00 +1602 1354 -4.16666666666667e+00 +1602 1589 4.16666666666667e+00 +1602 1595 -4.16666666666667e+00 +1602 1666 -4.16666666666667e+00 +1602 1771 4.16666666666667e+00 +1602 1588 -8.33333333333333e+00 +1602 1594 8.33333333333333e+00 +1602 1593 -1.25000000000000e+01 +1602 1667 8.33333333333333e+00 +1602 1772 -8.33333333333333e+00 +1602 1665 -1.25000000000000e+01 +1602 1444 -4.16666666666667e+00 +1602 1591 4.16666666666667e+00 +1602 1445 8.33333333333333e+00 +1602 1604 -1.66666666666667e+01 +1602 1709 8.33333333333333e+00 +1602 1592 4.16666666666667e+00 +1602 1307 -4.16666666666667e+00 +1602 1443 -1.25000000000000e+01 +1602 1457 4.16666666666667e+00 +1602 1355 -4.16666666666667e+00 +1602 1708 8.33333333333333e+00 +1602 1456 -8.33333333333333e+00 +1602 1707 -3.75000000000000e+01 +1602 1601 8.33333333333333e+00 +1603 1603 1.25000000000000e+02 +1603 1815 4.16666666666667e+00 +1603 1817 -8.33333333333333e+00 +1603 1600 -1.25000000000000e+01 +1603 1599 8.33333333333333e+00 +1603 1596 4.16666666666667e+00 +1603 1808 8.33333333333333e+00 +1603 1598 4.16666666666667e+00 +1603 1807 -3.75000000000000e+01 +1603 1806 8.33333333333333e+00 +1603 1602 -1.66666666666667e+01 +1603 1305 -4.16666666666667e+00 +1603 1353 -4.16666666666667e+00 +1603 1667 8.33333333333333e+00 +1603 1604 -1.66666666666667e+01 +1603 1595 8.33333333333333e+00 +1603 1665 -4.16666666666667e+00 +1603 1770 4.16666666666667e+00 +1603 1307 -4.16666666666667e+00 +1603 1589 4.16666666666667e+00 +1603 1594 -3.75000000000000e+01 +1603 1587 -8.33333333333333e+00 +1603 1593 8.33333333333333e+00 +1603 1355 -4.16666666666667e+00 +1603 1772 4.16666666666667e+00 +1603 1666 -1.25000000000000e+01 +1603 1443 -4.16666666666667e+00 +1603 1590 4.16666666666667e+00 +1603 1457 4.16666666666667e+00 +1603 1709 -4.16666666666667e+00 +1603 1592 -8.33333333333333e+00 +1603 1445 8.33333333333333e+00 +1603 1444 -1.25000000000000e+01 +1603 1708 -1.25000000000000e+01 +1603 1601 -4.16666666666667e+00 +1603 1707 8.33333333333333e+00 +1603 1455 -8.33333333333333e+00 +1604 1604 1.25000000000000e+02 +1604 1599 8.33333333333333e+00 +1604 1816 -8.33333333333333e+00 +1604 1815 4.16666666666667e+00 +1604 1601 -1.25000000000000e+01 +1604 1807 8.33333333333333e+00 +1604 1806 -4.16666666666667e+00 +1604 1597 4.16666666666667e+00 +1604 1596 -8.33333333333333e+00 +1604 1808 -1.25000000000000e+01 +1604 1587 4.16666666666667e+00 +1604 1593 -4.16666666666667e+00 +1604 1666 8.33333333333333e+00 +1604 1603 -1.66666666666667e+01 +1604 1594 8.33333333333333e+00 +1604 1595 -1.25000000000000e+01 +1604 1306 -4.16666666666667e+00 +1604 1588 4.16666666666667e+00 +1604 1667 -3.75000000000000e+01 +1604 1354 -4.16666666666667e+00 +1604 1771 4.16666666666667e+00 +1604 1665 8.33333333333333e+00 +1604 1770 -8.33333333333333e+00 +1604 1456 4.16666666666667e+00 +1604 1708 -4.16666666666667e+00 +1604 1443 8.33333333333333e+00 +1604 1602 -1.66666666666667e+01 +1604 1707 8.33333333333333e+00 +1604 1445 -3.75000000000000e+01 +1604 1591 -8.33333333333333e+00 +1604 1444 8.33333333333333e+00 +1604 1590 4.16666666666667e+00 +1604 1305 -4.16666666666667e+00 +1604 1709 -1.25000000000000e+01 +1604 1600 -4.16666666666667e+00 +1604 1455 4.16666666666667e+00 +1604 1353 -4.16666666666667e+00 +1605 1605 6.25000000000000e+01 +1605 1637 -4.16666666666667e+00 +1605 1634 -4.16666666666667e+00 +1605 1633 2.08333333333333e+00 +1605 1636 -4.16666666666667e+00 +1605 1616 4.16666666666667e+00 +1605 1615 -2.08333333333333e+00 +1605 1621 4.16666666666667e+00 +1605 1614 -6.25000000000000e+00 +1605 1396 -2.08333333333333e+00 +1605 1393 2.08333333333333e+00 +1605 1625 4.16666666666667e+00 +1605 1613 -4.16666666666667e+00 +1605 1310 4.16666666666667e+00 +1605 1394 -4.16666666666667e+00 +1605 1309 4.16666666666667e+00 +1605 1606 -8.33333333333333e+00 +1605 1612 8.33333333333333e+00 +1605 1308 -1.87500000000000e+01 +1605 1611 -1.25000000000000e+01 +1605 1607 -8.33333333333333e+00 +1605 1313 4.16666666666667e+00 +1605 1397 4.16666666666667e+00 +1605 1312 4.16666666666667e+00 +1605 1624 -8.33333333333333e+00 +1605 1622 4.16666666666667e+00 +1605 1311 -1.87500000000000e+01 +1605 1395 -6.25000000000000e+00 +1606 1606 6.25000000000000e+01 +1606 1637 -4.16666666666667e+00 +1606 1632 2.08333333333333e+00 +1606 1635 -4.16666666666667e+00 +1606 1616 4.16666666666667e+00 +1606 1622 -8.33333333333333e+00 +1606 1615 -6.25000000000000e+00 +1606 1614 -2.08333333333333e+00 +1606 1620 4.16666666666667e+00 +1606 1395 -2.08333333333333e+00 +1606 1392 2.08333333333333e+00 +1606 1397 4.16666666666667e+00 +1606 1607 -8.33333333333333e+00 +1606 1613 8.33333333333333e+00 +1606 1310 -2.08333333333333e+00 +1606 1394 2.08333333333333e+00 +1606 1309 -6.25000000000000e+00 +1606 1612 -3.75000000000000e+01 +1606 1308 4.16666666666667e+00 +1606 1605 -8.33333333333333e+00 +1606 1611 8.33333333333333e+00 +1606 1313 -2.08333333333333e+00 +1606 1625 4.16666666666667e+00 +1606 1634 2.08333333333333e+00 +1606 1312 -6.25000000000000e+00 +1606 1396 -6.25000000000000e+00 +1606 1311 4.16666666666667e+00 +1606 1623 -8.33333333333333e+00 +1607 1607 6.25000000000000e+01 +1607 1636 -4.16666666666667e+00 +1607 1620 4.16666666666667e+00 +1607 1635 -4.16666666666667e+00 +1607 1632 -4.16666666666667e+00 +1607 1616 -1.87500000000000e+01 +1607 1615 4.16666666666667e+00 +1607 1621 -8.33333333333333e+00 +1607 1614 4.16666666666667e+00 +1607 1396 4.16666666666667e+00 +1607 1606 -8.33333333333333e+00 +1607 1612 8.33333333333333e+00 +1607 1623 4.16666666666667e+00 +1607 1611 -4.16666666666667e+00 +1607 1310 -6.25000000000000e+00 +1607 1613 -1.25000000000000e+01 +1607 1309 -2.08333333333333e+00 +1607 1393 2.08333333333333e+00 +1607 1308 4.16666666666667e+00 +1607 1392 -4.16666666666667e+00 +1607 1633 2.08333333333333e+00 +1607 1313 -6.25000000000000e+00 +1607 1397 -1.87500000000000e+01 +1607 1312 -2.08333333333333e+00 +1607 1624 4.16666666666667e+00 +1607 1605 -8.33333333333333e+00 +1607 1311 4.16666666666667e+00 +1607 1395 4.16666666666667e+00 +1608 1608 1.25000000000000e+02 +1608 1619 8.33333333333333e+00 +1608 1618 -4.16666666666667e+00 +1608 1651 4.16666666666667e+00 +1608 1652 4.16666666666667e+00 +1608 1316 -4.16666666666667e+00 +1608 1310 -4.16666666666667e+00 +1608 1617 -1.25000000000000e+01 +1608 1309 8.33333333333333e+00 +1608 1609 -1.66666666666667e+01 +1608 1315 8.33333333333333e+00 +1608 1394 4.16666666666667e+00 +1608 1393 4.16666666666667e+00 +1608 1308 -1.25000000000000e+01 +1608 1400 8.33333333333333e+00 +1608 1399 -4.16666666666667e+00 +1608 1398 -1.25000000000000e+01 +1608 1610 -1.66666666666667e+01 +1608 1314 -1.25000000000000e+01 +1608 1655 -4.16666666666667e+00 +1608 1622 -8.33333333333333e+00 +1608 1621 4.16666666666667e+00 +1608 1654 -4.16666666666667e+00 +1608 1613 8.33333333333333e+00 +1608 1643 4.16666666666667e+00 +1608 1642 -8.33333333333333e+00 +1608 1612 8.33333333333333e+00 +1608 1611 -3.75000000000000e+01 +1608 2354 4.16666666666667e+00 +1608 2353 -8.33333333333333e+00 +1608 2357 8.33333333333333e+00 +1608 2356 8.33333333333333e+00 +1608 2355 -3.75000000000000e+01 +1608 2291 -4.16666666666667e+00 +1608 2290 -4.16666666666667e+00 +1608 2294 -8.33333333333333e+00 +1608 2293 4.16666666666667e+00 +1609 1609 1.25000000000000e+02 +1609 1650 4.16666666666667e+00 +1609 1652 -8.33333333333333e+00 +1609 1619 8.33333333333333e+00 +1609 1618 -1.25000000000000e+01 +1609 1308 8.33333333333333e+00 +1609 1608 -1.66666666666667e+01 +1609 1314 8.33333333333333e+00 +1609 1394 -8.33333333333333e+00 +1609 1310 8.33333333333333e+00 +1609 1309 -3.75000000000000e+01 +1609 1392 4.16666666666667e+00 +1609 1400 8.33333333333333e+00 +1609 1610 -1.66666666666667e+01 +1609 1316 8.33333333333333e+00 +1609 1399 -1.25000000000000e+01 +1609 1617 -4.16666666666667e+00 +1609 1315 -3.75000000000000e+01 +1609 1398 -4.16666666666667e+00 +1609 1655 -4.16666666666667e+00 +1609 1620 4.16666666666667e+00 +1609 1653 -4.16666666666667e+00 +1609 1643 4.16666666666667e+00 +1609 1613 -4.16666666666667e+00 +1609 1641 -8.33333333333333e+00 +1609 1622 4.16666666666667e+00 +1609 1612 -1.25000000000000e+01 +1609 1611 8.33333333333333e+00 +1609 2354 4.16666666666667e+00 +1609 2352 -8.33333333333333e+00 +1609 2357 -4.16666666666667e+00 +1609 2356 -1.25000000000000e+01 +1609 2355 8.33333333333333e+00 +1609 2294 4.16666666666667e+00 +1609 2291 -4.16666666666667e+00 +1609 2289 -4.16666666666667e+00 +1609 2292 4.16666666666667e+00 +1610 1610 1.25000000000000e+02 +1610 1617 8.33333333333333e+00 +1610 1651 -8.33333333333333e+00 +1610 1650 4.16666666666667e+00 +1610 1314 -4.16666666666667e+00 +1610 1619 -3.75000000000000e+01 +1610 1618 8.33333333333333e+00 +1610 1308 -4.16666666666667e+00 +1610 1392 4.16666666666667e+00 +1610 1310 -1.25000000000000e+01 +1610 1393 -8.33333333333333e+00 +1610 1309 8.33333333333333e+00 +1610 1400 -3.75000000000000e+01 +1610 1608 -1.66666666666667e+01 +1610 1316 -1.25000000000000e+01 +1610 1399 8.33333333333333e+00 +1610 1609 -1.66666666666667e+01 +1610 1315 8.33333333333333e+00 +1610 1398 8.33333333333333e+00 +1610 1653 -4.16666666666667e+00 +1610 1621 4.16666666666667e+00 +1610 1654 -4.16666666666667e+00 +1610 1620 -8.33333333333333e+00 +1610 1642 4.16666666666667e+00 +1610 1612 -4.16666666666667e+00 +1610 1611 8.33333333333333e+00 +1610 1641 4.16666666666667e+00 +1610 1613 -1.25000000000000e+01 +1610 2352 4.16666666666667e+00 +1610 2353 4.16666666666667e+00 +1610 2357 -1.25000000000000e+01 +1610 2356 -4.16666666666667e+00 +1610 2355 8.33333333333333e+00 +1610 2293 4.16666666666667e+00 +1610 2290 -4.16666666666667e+00 +1610 2289 -4.16666666666667e+00 +1610 2292 -8.33333333333333e+00 +1611 1611 1.25000000000000e+02 +1611 1655 4.16666666666667e+00 +1611 1610 8.33333333333333e+00 +1611 1400 -8.33333333333333e+00 +1611 1399 4.16666666666667e+00 +1611 1609 8.33333333333333e+00 +1611 1608 -3.75000000000000e+01 +1611 1643 -4.16666666666667e+00 +1611 1642 8.33333333333333e+00 +1611 1641 -1.25000000000000e+01 +1611 1621 -4.16666666666667e+00 +1611 1669 -4.16666666666667e+00 +1611 1636 4.16666666666667e+00 +1611 1622 8.33333333333333e+00 +1611 1637 -8.33333333333333e+00 +1611 1319 4.16666666666667e+00 +1611 1670 -4.16666666666667e+00 +1611 1310 4.16666666666667e+00 +1611 1620 -1.25000000000000e+01 +1611 1394 -4.16666666666667e+00 +1611 1393 -4.16666666666667e+00 +1611 1397 4.16666666666667e+00 +1611 1607 -4.16666666666667e+00 +1611 1612 -1.66666666666667e+01 +1611 1396 4.16666666666667e+00 +1611 1402 -4.16666666666667e+00 +1611 1309 -8.33333333333333e+00 +1611 1606 8.33333333333333e+00 +1611 1605 -1.25000000000000e+01 +1611 1613 -1.66666666666667e+01 +1611 1625 8.33333333333333e+00 +1611 1403 8.33333333333333e+00 +1611 1624 8.33333333333333e+00 +1611 1318 -8.33333333333333e+00 +1611 1654 4.16666666666667e+00 +1611 1623 -3.75000000000000e+01 +1611 1401 -1.25000000000000e+01 +1612 1612 1.25000000000000e+02 +1612 1655 -8.33333333333333e+00 +1612 1610 -4.16666666666667e+00 +1612 1400 4.16666666666667e+00 +1612 1398 4.16666666666667e+00 +1612 1609 -1.25000000000000e+01 +1612 1608 8.33333333333333e+00 +1612 1643 8.33333333333333e+00 +1612 1642 -3.75000000000000e+01 +1612 1641 8.33333333333333e+00 +1612 1620 -4.16666666666667e+00 +1612 1668 -4.16666666666667e+00 +1612 1635 4.16666666666667e+00 +1612 1670 -4.16666666666667e+00 +1612 1637 4.16666666666667e+00 +1612 1613 -1.66666666666667e+01 +1612 1622 8.33333333333333e+00 +1612 1621 -1.25000000000000e+01 +1612 1392 -4.16666666666667e+00 +1612 1607 8.33333333333333e+00 +1612 1611 -1.66666666666667e+01 +1612 1397 -8.33333333333333e+00 +1612 1403 8.33333333333333e+00 +1612 1395 4.16666666666667e+00 +1612 1401 -4.16666666666667e+00 +1612 1310 4.16666666666667e+00 +1612 1394 -4.16666666666667e+00 +1612 1606 -3.75000000000000e+01 +1612 1308 -8.33333333333333e+00 +1612 1605 8.33333333333333e+00 +1612 1625 -4.16666666666667e+00 +1612 1319 4.16666666666667e+00 +1612 1653 4.16666666666667e+00 +1612 1624 -1.25000000000000e+01 +1612 1402 -1.25000000000000e+01 +1612 1623 8.33333333333333e+00 +1612 1317 -8.33333333333333e+00 +1613 1613 1.25000000000000e+02 +1613 1653 4.16666666666667e+00 +1613 1609 -4.16666666666667e+00 +1613 1399 4.16666666666667e+00 +1613 1608 8.33333333333333e+00 +1613 1398 -8.33333333333333e+00 +1613 1610 -1.25000000000000e+01 +1613 1643 -1.25000000000000e+01 +1613 1642 8.33333333333333e+00 +1613 1641 -4.16666666666667e+00 +1613 1669 -4.16666666666667e+00 +1613 1636 4.16666666666667e+00 +1613 1620 8.33333333333333e+00 +1613 1635 -8.33333333333333e+00 +1613 1317 4.16666666666667e+00 +1613 1668 -4.16666666666667e+00 +1613 1622 -3.75000000000000e+01 +1613 1612 -1.66666666666667e+01 +1613 1621 8.33333333333333e+00 +1613 1308 4.16666666666667e+00 +1613 1392 -4.16666666666667e+00 +1613 1606 8.33333333333333e+00 +1613 1395 4.16666666666667e+00 +1613 1605 -4.16666666666667e+00 +1613 1396 -8.33333333333333e+00 +1613 1402 8.33333333333333e+00 +1613 1607 -1.25000000000000e+01 +1613 1309 4.16666666666667e+00 +1613 1393 -4.16666666666667e+00 +1613 1654 -8.33333333333333e+00 +1613 1625 -1.25000000000000e+01 +1613 1403 -3.75000000000000e+01 +1613 1624 -4.16666666666667e+00 +1613 1318 4.16666666666667e+00 +1613 1611 -1.66666666666667e+01 +1613 1623 8.33333333333333e+00 +1613 1401 8.33333333333333e+00 +1614 1614 6.25000000000000e+01 +1614 1637 4.16666666666667e+00 +1614 1636 -8.33333333333333e+00 +1614 1607 4.16666666666667e+00 +1614 1606 -2.08333333333333e+00 +1614 1309 2.08333333333333e+00 +1614 1605 -6.25000000000000e+00 +1614 1634 4.16666666666667e+00 +1614 1360 2.08333333333333e+00 +1614 1632 -1.87500000000000e+01 +1614 1622 -4.16666666666667e+00 +1614 1616 -8.33333333333333e+00 +1614 1471 -2.08333333333333e+00 +1614 1841 -4.16666666666667e+00 +1614 1478 4.16666666666667e+00 +1614 1840 -4.16666666666667e+00 +1614 1477 4.16666666666667e+00 +1614 1472 4.16666666666667e+00 +1614 1361 -4.16666666666667e+00 +1614 1470 -6.25000000000000e+00 +1614 1469 4.16666666666667e+00 +1614 1310 -4.16666666666667e+00 +1614 1468 4.16666666666667e+00 +1614 1615 -8.33333333333333e+00 +1614 1621 8.33333333333333e+00 +1614 1467 -1.87500000000000e+01 +1614 1633 4.16666666666667e+00 +1614 1620 -1.25000000000000e+01 +1615 1615 6.25000000000000e+01 +1615 1632 4.16666666666667e+00 +1615 1637 4.16666666666667e+00 +1615 1635 -8.33333333333333e+00 +1615 1607 4.16666666666667e+00 +1615 1616 -8.33333333333333e+00 +1615 1606 -6.25000000000000e+00 +1615 1605 -2.08333333333333e+00 +1615 1308 2.08333333333333e+00 +1615 1633 -6.25000000000000e+00 +1615 1359 2.08333333333333e+00 +1615 1470 -2.08333333333333e+00 +1615 1472 4.16666666666667e+00 +1615 1622 8.33333333333333e+00 +1615 1478 -8.33333333333333e+00 +1615 1839 -4.16666666666667e+00 +1615 1476 4.16666666666667e+00 +1615 1361 2.08333333333333e+00 +1615 1841 -4.16666666666667e+00 +1615 1471 -6.25000000000000e+00 +1615 1469 -2.08333333333333e+00 +1615 1310 2.08333333333333e+00 +1615 1468 -6.25000000000000e+00 +1615 1634 -2.08333333333333e+00 +1615 1621 -3.75000000000000e+01 +1615 1467 4.16666666666667e+00 +1615 1614 -8.33333333333333e+00 +1615 1620 8.33333333333333e+00 +1616 1616 6.25000000000000e+01 +1616 1635 4.16666666666667e+00 +1616 1636 4.16666666666667e+00 +1616 1607 -1.87500000000000e+01 +1616 1606 4.16666666666667e+00 +1616 1615 -8.33333333333333e+00 +1616 1605 4.16666666666667e+00 +1616 1634 -6.25000000000000e+00 +1616 1632 4.16666666666667e+00 +1616 1620 -4.16666666666667e+00 +1616 1614 -8.33333333333333e+00 +1616 1471 4.16666666666667e+00 +1616 1839 -4.16666666666667e+00 +1616 1476 4.16666666666667e+00 +1616 1621 8.33333333333333e+00 +1616 1477 -8.33333333333333e+00 +1616 1472 -1.87500000000000e+01 +1616 1360 2.08333333333333e+00 +1616 1840 -4.16666666666667e+00 +1616 1470 4.16666666666667e+00 +1616 1359 -4.16666666666667e+00 +1616 1469 -6.25000000000000e+00 +1616 1633 -2.08333333333333e+00 +1616 1622 -1.25000000000000e+01 +1616 1468 -2.08333333333333e+00 +1616 1309 2.08333333333333e+00 +1616 1467 4.16666666666667e+00 +1616 1308 -4.16666666666667e+00 +1617 1617 1.25000000000000e+02 +1617 1609 -4.16666666666667e+00 +1617 1364 4.16666666666667e+00 +1617 1652 -4.16666666666667e+00 +1617 1651 8.33333333333333e+00 +1617 1618 -1.66666666666667e+01 +1617 1650 -1.25000000000000e+01 +1617 1310 4.16666666666667e+00 +1617 1608 -1.25000000000000e+01 +1617 1469 -4.16666666666667e+00 +1617 1468 8.33333333333333e+00 +1617 1309 4.16666666666667e+00 +1617 1467 -1.25000000000000e+01 +1617 1619 -1.66666666666667e+01 +1617 1475 8.33333333333333e+00 +1617 1474 -4.16666666666667e+00 +1617 1363 4.16666666666667e+00 +1617 1610 8.33333333333333e+00 +1617 1473 -1.25000000000000e+01 +1617 1655 4.16666666666667e+00 +1617 1654 -8.33333333333333e+00 +1617 1622 8.33333333333333e+00 +1617 1478 -8.33333333333333e+00 +1617 1846 -4.16666666666667e+00 +1617 1477 4.16666666666667e+00 +1617 1847 -4.16666666666667e+00 +1617 1621 8.33333333333333e+00 +1617 1620 -3.75000000000000e+01 +1617 2357 -8.33333333333333e+00 +1617 2356 4.16666666666667e+00 +1617 2354 -4.16666666666667e+00 +1617 2099 4.16666666666667e+00 +1617 2365 8.33333333333333e+00 +1617 2098 -8.33333333333333e+00 +1617 2353 -4.16666666666667e+00 +1617 2366 8.33333333333333e+00 +1617 2364 -3.75000000000000e+01 +1618 1618 1.25000000000000e+02 +1618 1652 8.33333333333333e+00 +1618 1651 -3.75000000000000e+01 +1618 1650 8.33333333333333e+00 +1618 1617 -1.66666666666667e+01 +1618 1610 8.33333333333333e+00 +1618 1609 -1.25000000000000e+01 +1618 1619 -1.66666666666667e+01 +1618 1467 8.33333333333333e+00 +1618 1310 -8.33333333333333e+00 +1618 1469 8.33333333333333e+00 +1618 1468 -3.75000000000000e+01 +1618 1308 4.16666666666667e+00 +1618 1475 8.33333333333333e+00 +1618 1364 -8.33333333333333e+00 +1618 1608 -4.16666666666667e+00 +1618 1474 -1.25000000000000e+01 +1618 1473 -4.16666666666667e+00 +1618 1362 4.16666666666667e+00 +1618 1655 4.16666666666667e+00 +1618 1653 -8.33333333333333e+00 +1618 1622 -4.16666666666667e+00 +1618 1847 -4.16666666666667e+00 +1618 1478 4.16666666666667e+00 +1618 1845 -4.16666666666667e+00 +1618 1476 4.16666666666667e+00 +1618 1621 -1.25000000000000e+01 +1618 1620 8.33333333333333e+00 +1618 2357 4.16666666666667e+00 +1618 2355 4.16666666666667e+00 +1618 2366 -4.16666666666667e+00 +1618 2354 -4.16666666666667e+00 +1618 2099 4.16666666666667e+00 +1618 2364 8.33333333333333e+00 +1618 2097 -8.33333333333333e+00 +1618 2352 -4.16666666666667e+00 +1618 2365 -1.25000000000000e+01 +1619 1619 1.25000000000000e+02 +1619 1652 -1.25000000000000e+01 +1619 1651 8.33333333333333e+00 +1619 1362 4.16666666666667e+00 +1619 1650 -4.16666666666667e+00 +1619 1610 -3.75000000000000e+01 +1619 1609 8.33333333333333e+00 +1619 1308 4.16666666666667e+00 +1619 1618 -1.66666666666667e+01 +1619 1467 -4.16666666666667e+00 +1619 1469 -1.25000000000000e+01 +1619 1309 -8.33333333333333e+00 +1619 1468 8.33333333333333e+00 +1619 1608 8.33333333333333e+00 +1619 1475 -3.75000000000000e+01 +1619 1474 8.33333333333333e+00 +1619 1363 -8.33333333333333e+00 +1619 1617 -1.66666666666667e+01 +1619 1473 8.33333333333333e+00 +1619 1654 4.16666666666667e+00 +1619 1653 4.16666666666667e+00 +1619 1621 -4.16666666666667e+00 +1619 1846 -4.16666666666667e+00 +1619 1477 4.16666666666667e+00 +1619 1620 8.33333333333333e+00 +1619 1476 -8.33333333333333e+00 +1619 1845 -4.16666666666667e+00 +1619 1622 -1.25000000000000e+01 +1619 2356 4.16666666666667e+00 +1619 2355 -8.33333333333333e+00 +1619 2365 -4.16666666666667e+00 +1619 2353 -4.16666666666667e+00 +1619 2098 4.16666666666667e+00 +1619 2352 -4.16666666666667e+00 +1619 2097 4.16666666666667e+00 +1619 2366 -1.25000000000000e+01 +1619 2364 8.33333333333333e+00 +1620 1620 1.25000000000000e+02 +1620 1654 8.33333333333333e+00 +1620 1610 -8.33333333333333e+00 +1620 1609 4.16666666666667e+00 +1620 1653 -1.25000000000000e+01 +1620 1619 8.33333333333333e+00 +1620 1846 4.16666666666667e+00 +1620 1618 8.33333333333333e+00 +1620 1617 -3.75000000000000e+01 +1620 1847 4.16666666666667e+00 +1620 1612 -4.16666666666667e+00 +1620 1613 8.33333333333333e+00 +1620 1622 -1.66666666666667e+01 +1620 1310 -4.16666666666667e+00 +1620 1611 -1.25000000000000e+01 +1620 1670 4.16666666666667e+00 +1620 1367 -4.16666666666667e+00 +1620 1669 -8.33333333333333e+00 +1620 1607 4.16666666666667e+00 +1620 1621 -1.66666666666667e+01 +1620 1636 8.33333333333333e+00 +1620 1606 4.16666666666667e+00 +1620 1309 -4.16666666666667e+00 +1620 1637 8.33333333333333e+00 +1620 1366 -4.16666666666667e+00 +1620 1635 -3.75000000000000e+01 +1620 1616 -4.16666666666667e+00 +1620 1469 4.16666666666667e+00 +1620 1840 4.16666666666667e+00 +1620 1477 -4.16666666666667e+00 +1620 1468 -8.33333333333333e+00 +1620 1615 8.33333333333333e+00 +1620 1614 -1.25000000000000e+01 +1620 1478 8.33333333333333e+00 +1620 1841 -8.33333333333333e+00 +1620 1476 -1.25000000000000e+01 +1620 1655 -4.16666666666667e+00 +1621 1621 1.25000000000000e+02 +1621 1653 8.33333333333333e+00 +1621 1608 4.16666666666667e+00 +1621 1655 8.33333333333333e+00 +1621 1654 -3.75000000000000e+01 +1621 1619 -4.16666666666667e+00 +1621 1845 4.16666666666667e+00 +1621 1618 -1.25000000000000e+01 +1621 1617 8.33333333333333e+00 +1621 1847 -8.33333333333333e+00 +1621 1611 -4.16666666666667e+00 +1621 1670 4.16666666666667e+00 +1621 1613 8.33333333333333e+00 +1621 1612 -1.25000000000000e+01 +1621 1668 -8.33333333333333e+00 +1621 1637 -4.16666666666667e+00 +1621 1620 -1.66666666666667e+01 +1621 1635 8.33333333333333e+00 +1621 1607 -8.33333333333333e+00 +1621 1605 4.16666666666667e+00 +1621 1308 -4.16666666666667e+00 +1621 1636 -1.25000000000000e+01 +1621 1365 -4.16666666666667e+00 +1621 1616 8.33333333333333e+00 +1621 1622 -1.66666666666667e+01 +1621 1478 8.33333333333333e+00 +1621 1839 4.16666666666667e+00 +1621 1476 -4.16666666666667e+00 +1621 1469 4.16666666666667e+00 +1621 1310 -4.16666666666667e+00 +1621 1615 -3.75000000000000e+01 +1621 1467 -8.33333333333333e+00 +1621 1614 8.33333333333333e+00 +1621 1841 4.16666666666667e+00 +1621 1367 -4.16666666666667e+00 +1621 1477 -1.25000000000000e+01 +1621 1610 4.16666666666667e+00 +1622 1622 1.25000000000000e+02 +1622 1653 -4.16666666666667e+00 +1622 1608 -8.33333333333333e+00 +1622 1655 -1.25000000000000e+01 +1622 1654 8.33333333333333e+00 +1622 1618 -4.16666666666667e+00 +1622 1617 8.33333333333333e+00 +1622 1619 -1.25000000000000e+01 +1622 1846 -8.33333333333333e+00 +1622 1845 4.16666666666667e+00 +1622 1669 4.16666666666667e+00 +1622 1611 8.33333333333333e+00 +1622 1620 -1.66666666666667e+01 +1622 1613 -3.75000000000000e+01 +1622 1612 8.33333333333333e+00 +1622 1308 -4.16666666666667e+00 +1622 1668 4.16666666666667e+00 +1622 1365 -4.16666666666667e+00 +1622 1605 4.16666666666667e+00 +1622 1636 -4.16666666666667e+00 +1622 1606 -8.33333333333333e+00 +1622 1637 -1.25000000000000e+01 +1622 1635 8.33333333333333e+00 +1622 1614 -4.16666666666667e+00 +1622 1467 4.16666666666667e+00 +1622 1615 8.33333333333333e+00 +1622 1621 -1.66666666666667e+01 +1622 1477 8.33333333333333e+00 +1622 1616 -1.25000000000000e+01 +1622 1468 4.16666666666667e+00 +1622 1309 -4.16666666666667e+00 +1622 1478 -3.75000000000000e+01 +1622 1609 4.16666666666667e+00 +1622 1840 4.16666666666667e+00 +1622 1366 -4.16666666666667e+00 +1622 1476 8.33333333333333e+00 +1622 1839 -8.33333333333333e+00 +1623 1623 1.25000000000000e+02 +1623 1661 4.16666666666667e+00 +1623 1660 -8.33333333333333e+00 +1623 1630 8.33333333333333e+00 +1623 1629 -3.75000000000000e+01 +1623 1556 4.16666666666667e+00 +1623 1555 4.16666666666667e+00 +1623 1559 8.33333333333333e+00 +1623 1558 -4.16666666666667e+00 +1623 1557 -1.25000000000000e+01 +1623 1625 -1.66666666666667e+01 +1623 1313 -4.16666666666667e+00 +1623 1319 -4.16666666666667e+00 +1623 1673 -4.16666666666667e+00 +1623 1670 4.16666666666667e+00 +1623 1640 -8.33333333333333e+00 +1623 1637 8.33333333333333e+00 +1623 1639 4.16666666666667e+00 +1623 1636 -4.16666666666667e+00 +1623 1635 -1.25000000000000e+01 +1623 1672 -4.16666666666667e+00 +1623 1669 4.16666666666667e+00 +1623 1397 -4.16666666666667e+00 +1623 1607 4.16666666666667e+00 +1623 1396 -4.16666666666667e+00 +1623 1402 4.16666666666667e+00 +1623 1606 -8.33333333333333e+00 +1623 1312 8.33333333333333e+00 +1623 1311 -1.25000000000000e+01 +1623 1613 8.33333333333333e+00 +1623 1403 -8.33333333333333e+00 +1623 1612 8.33333333333333e+00 +1623 1624 -1.66666666666667e+01 +1623 1318 8.33333333333333e+00 +1623 1611 -3.75000000000000e+01 +1623 1631 8.33333333333333e+00 +1623 1317 -1.25000000000000e+01 +1624 1624 1.25000000000000e+02 +1624 1631 -4.16666666666667e+00 +1624 1659 -8.33333333333333e+00 +1624 1630 -1.25000000000000e+01 +1624 1629 8.33333333333333e+00 +1624 1556 -8.33333333333333e+00 +1624 1554 4.16666666666667e+00 +1624 1559 8.33333333333333e+00 +1624 1558 -1.25000000000000e+01 +1624 1557 -4.16666666666667e+00 +1624 1673 -4.16666666666667e+00 +1624 1640 4.16666666666667e+00 +1624 1313 8.33333333333333e+00 +1624 1625 -1.66666666666667e+01 +1624 1637 8.33333333333333e+00 +1624 1636 -1.25000000000000e+01 +1624 1638 4.16666666666667e+00 +1624 1635 -4.16666666666667e+00 +1624 1319 8.33333333333333e+00 +1624 1670 -8.33333333333333e+00 +1624 1671 -4.16666666666667e+00 +1624 1668 4.16666666666667e+00 +1624 1395 -4.16666666666667e+00 +1624 1401 4.16666666666667e+00 +1624 1607 4.16666666666667e+00 +1624 1397 -4.16666666666667e+00 +1624 1312 -3.75000000000000e+01 +1624 1605 -8.33333333333333e+00 +1624 1311 8.33333333333333e+00 +1624 1613 -4.16666666666667e+00 +1624 1403 4.16666666666667e+00 +1624 1612 -1.25000000000000e+01 +1624 1661 4.16666666666667e+00 +1624 1318 -3.75000000000000e+01 +1624 1611 8.33333333333333e+00 +1624 1623 -1.66666666666667e+01 +1624 1317 8.33333333333333e+00 +1625 1625 1.25000000000000e+02 +1625 1630 -4.16666666666667e+00 +1625 1629 8.33333333333333e+00 +1625 1659 4.16666666666667e+00 +1625 1631 -1.25000000000000e+01 +1625 1554 4.16666666666667e+00 +1625 1555 -8.33333333333333e+00 +1625 1559 -3.75000000000000e+01 +1625 1558 8.33333333333333e+00 +1625 1557 8.33333333333333e+00 +1625 1623 -1.66666666666667e+01 +1625 1311 -4.16666666666667e+00 +1625 1317 -4.16666666666667e+00 +1625 1671 -4.16666666666667e+00 +1625 1668 4.16666666666667e+00 +1625 1672 -4.16666666666667e+00 +1625 1639 4.16666666666667e+00 +1625 1637 -3.75000000000000e+01 +1625 1312 8.33333333333333e+00 +1625 1624 -1.66666666666667e+01 +1625 1636 8.33333333333333e+00 +1625 1638 -8.33333333333333e+00 +1625 1635 8.33333333333333e+00 +1625 1318 8.33333333333333e+00 +1625 1669 -8.33333333333333e+00 +1625 1395 -4.16666666666667e+00 +1625 1605 4.16666666666667e+00 +1625 1313 -1.25000000000000e+01 +1625 1606 4.16666666666667e+00 +1625 1396 -4.16666666666667e+00 +1625 1613 -1.25000000000000e+01 +1625 1660 4.16666666666667e+00 +1625 1319 -1.25000000000000e+01 +1625 1612 -4.16666666666667e+00 +1625 1402 4.16666666666667e+00 +1625 1611 8.33333333333333e+00 +1625 1401 -8.33333333333333e+00 +1626 1626 6.25000000000000e+01 +1626 1631 -4.16666666666667e+00 +1626 1564 -2.08333333333333e+00 +1626 1555 2.08333333333333e+00 +1626 1565 4.16666666666667e+00 +1626 1330 4.16666666666667e+00 +1626 1735 -8.33333333333333e+00 +1626 1563 -6.25000000000000e+00 +1626 1556 -4.16666666666667e+00 +1626 1627 -8.33333333333333e+00 +1626 1630 8.33333333333333e+00 +1626 1312 4.16666666666667e+00 +1626 1629 -1.25000000000000e+01 +1626 1745 -4.16666666666667e+00 +1626 1640 4.16666666666667e+00 +1626 1331 4.16666666666667e+00 +1626 1484 -4.16666666666667e+00 +1626 1483 2.08333333333333e+00 +1626 1744 -4.16666666666667e+00 +1626 1329 -1.87500000000000e+01 +1626 1628 -8.33333333333333e+00 +1626 1481 4.16666666666667e+00 +1626 1313 4.16666666666667e+00 +1626 1480 -2.08333333333333e+00 +1626 1639 4.16666666666667e+00 +1626 1736 4.16666666666667e+00 +1626 1479 -6.25000000000000e+00 +1626 1311 -1.87500000000000e+01 +1627 1627 6.25000000000000e+01 +1627 1565 4.16666666666667e+00 +1627 1631 8.33333333333333e+00 +1627 1563 -2.08333333333333e+00 +1627 1554 2.08333333333333e+00 +1627 1331 -2.08333333333333e+00 +1627 1736 4.16666666666667e+00 +1627 1564 -6.25000000000000e+00 +1627 1329 4.16666666666667e+00 +1627 1734 -8.33333333333333e+00 +1627 1556 2.08333333333333e+00 +1627 1313 -2.08333333333333e+00 +1627 1630 -3.75000000000000e+01 +1627 1626 -8.33333333333333e+00 +1627 1629 8.33333333333333e+00 +1627 1311 4.16666666666667e+00 +1627 1484 2.08333333333333e+00 +1627 1745 -4.16666666666667e+00 +1627 1330 -6.25000000000000e+00 +1627 1482 2.08333333333333e+00 +1627 1743 -4.16666666666667e+00 +1627 1481 4.16666666666667e+00 +1627 1640 -8.33333333333333e+00 +1627 1628 -8.33333333333333e+00 +1627 1480 -6.25000000000000e+00 +1627 1312 -6.25000000000000e+00 +1627 1479 -2.08333333333333e+00 +1627 1638 4.16666666666667e+00 +1628 1628 6.25000000000000e+01 +1628 1629 -4.16666666666667e+00 +1628 1627 -8.33333333333333e+00 +1628 1564 4.16666666666667e+00 +1628 1630 8.33333333333333e+00 +1628 1565 -1.87500000000000e+01 +1628 1330 -2.08333333333333e+00 +1628 1735 4.16666666666667e+00 +1628 1563 4.16666666666667e+00 +1628 1631 -1.25000000000000e+01 +1628 1555 2.08333333333333e+00 +1628 1312 -2.08333333333333e+00 +1628 1554 -4.16666666666667e+00 +1628 1483 2.08333333333333e+00 +1628 1744 -4.16666666666667e+00 +1628 1743 -4.16666666666667e+00 +1628 1638 4.16666666666667e+00 +1628 1331 -6.25000000000000e+00 +1628 1329 4.16666666666667e+00 +1628 1482 -4.16666666666667e+00 +1628 1734 4.16666666666667e+00 +1628 1481 -1.87500000000000e+01 +1628 1313 -6.25000000000000e+00 +1628 1480 4.16666666666667e+00 +1628 1639 -8.33333333333333e+00 +1628 1626 -8.33333333333333e+00 +1628 1479 4.16666666666667e+00 +1628 1311 4.16666666666667e+00 +1629 1629 1.25000000000000e+02 +1629 1672 4.16666666666667e+00 +1629 1777 -4.16666666666667e+00 +1629 1640 8.33333333333333e+00 +1629 1745 -8.33333333333333e+00 +1629 1639 -4.16666666666667e+00 +1629 1744 4.16666666666667e+00 +1629 1778 -4.16666666666667e+00 +1629 1638 -1.25000000000000e+01 +1629 1565 4.16666666666667e+00 +1629 1628 -4.16666666666667e+00 +1629 1564 4.16666666666667e+00 +1629 1736 8.33333333333333e+00 +1629 1631 -1.66666666666667e+01 +1629 1735 8.33333333333333e+00 +1629 1734 -3.75000000000000e+01 +1629 1627 8.33333333333333e+00 +1629 1626 -1.25000000000000e+01 +1629 1630 -1.66666666666667e+01 +1629 1567 -4.16666666666667e+00 +1629 1568 8.33333333333333e+00 +1629 1559 -8.33333333333333e+00 +1629 1625 8.33333333333333e+00 +1629 1555 -4.16666666666667e+00 +1629 1558 4.16666666666667e+00 +1629 1337 4.16666666666667e+00 +1629 1661 -4.16666666666667e+00 +1629 1336 -8.33333333333333e+00 +1629 1660 8.33333333333333e+00 +1629 1566 -1.25000000000000e+01 +1629 1659 -1.25000000000000e+01 +1629 1556 -4.16666666666667e+00 +1629 1313 4.16666666666667e+00 +1629 1624 8.33333333333333e+00 +1629 1312 -8.33333333333333e+00 +1629 1673 4.16666666666667e+00 +1629 1623 -3.75000000000000e+01 +1630 1630 1.25000000000000e+02 +1630 1671 4.16666666666667e+00 +1630 1776 -4.16666666666667e+00 +1630 1778 -4.16666666666667e+00 +1630 1745 4.16666666666667e+00 +1630 1638 -4.16666666666667e+00 +1630 1743 4.16666666666667e+00 +1630 1640 8.33333333333333e+00 +1630 1639 -1.25000000000000e+01 +1630 1628 8.33333333333333e+00 +1630 1565 -8.33333333333333e+00 +1630 1563 4.16666666666667e+00 +1630 1736 -4.16666666666667e+00 +1630 1337 4.16666666666667e+00 +1630 1735 -1.25000000000000e+01 +1630 1734 8.33333333333333e+00 +1630 1313 4.16666666666667e+00 +1630 1627 -3.75000000000000e+01 +1630 1626 8.33333333333333e+00 +1630 1625 -4.16666666666667e+00 +1630 1629 -1.66666666666667e+01 +1630 1566 -4.16666666666667e+00 +1630 1559 4.16666666666667e+00 +1630 1556 -4.16666666666667e+00 +1630 1554 -4.16666666666667e+00 +1630 1557 4.16666666666667e+00 +1630 1568 8.33333333333333e+00 +1630 1661 8.33333333333333e+00 +1630 1631 -1.66666666666667e+01 +1630 1567 -1.25000000000000e+01 +1630 1660 -3.75000000000000e+01 +1630 1335 -8.33333333333333e+00 +1630 1659 8.33333333333333e+00 +1630 1673 -8.33333333333333e+00 +1630 1624 -1.25000000000000e+01 +1630 1623 8.33333333333333e+00 +1630 1311 -8.33333333333333e+00 +1631 1631 1.25000000000000e+02 +1631 1672 -8.33333333333333e+00 +1631 1777 -4.16666666666667e+00 +1631 1744 4.16666666666667e+00 +1631 1638 8.33333333333333e+00 +1631 1743 -8.33333333333333e+00 +1631 1776 -4.16666666666667e+00 +1631 1640 -3.75000000000000e+01 +1631 1639 8.33333333333333e+00 +1631 1563 4.16666666666667e+00 +1631 1626 -4.16666666666667e+00 +1631 1627 8.33333333333333e+00 +1631 1564 -8.33333333333333e+00 +1631 1736 -1.25000000000000e+01 +1631 1735 -4.16666666666667e+00 +1631 1336 4.16666666666667e+00 +1631 1734 8.33333333333333e+00 +1631 1629 -1.66666666666667e+01 +1631 1628 -1.25000000000000e+01 +1631 1312 4.16666666666667e+00 +1631 1624 -4.16666666666667e+00 +1631 1558 4.16666666666667e+00 +1631 1555 -4.16666666666667e+00 +1631 1566 8.33333333333333e+00 +1631 1557 -8.33333333333333e+00 +1631 1623 8.33333333333333e+00 +1631 1568 -3.75000000000000e+01 +1631 1661 -1.25000000000000e+01 +1631 1567 8.33333333333333e+00 +1631 1660 8.33333333333333e+00 +1631 1630 -1.66666666666667e+01 +1631 1335 4.16666666666667e+00 +1631 1659 -4.16666666666667e+00 +1631 1671 4.16666666666667e+00 +1631 1625 -1.25000000000000e+01 +1631 1554 -4.16666666666667e+00 +1631 1311 4.16666666666667e+00 +1632 1632 6.25000000000000e+01 +1632 1633 -8.33333333333333e+00 +1632 1607 -4.16666666666667e+00 +1632 1312 -2.08333333333333e+00 +1632 1606 2.08333333333333e+00 +1632 1616 4.16666666666667e+00 +1632 1360 -2.08333333333333e+00 +1632 1614 -1.87500000000000e+01 +1632 1840 4.16666666666667e+00 +1632 1637 -4.16666666666667e+00 +1632 1636 8.33333333333333e+00 +1632 1635 -1.25000000000000e+01 +1632 1841 4.16666666666667e+00 +1632 1640 4.16666666666667e+00 +1632 1844 -4.16666666666667e+00 +1632 1486 2.08333333333333e+00 +1632 1843 -4.16666666666667e+00 +1632 1361 4.16666666666667e+00 +1632 1487 -4.16666666666667e+00 +1632 1359 -6.25000000000000e+00 +1632 1634 -8.33333333333333e+00 +1632 1481 4.16666666666667e+00 +1632 1313 4.16666666666667e+00 +1632 1480 4.16666666666667e+00 +1632 1639 -8.33333333333333e+00 +1632 1615 4.16666666666667e+00 +1632 1479 -1.87500000000000e+01 +1632 1311 -6.25000000000000e+00 +1633 1633 6.25000000000000e+01 +1633 1607 2.08333333333333e+00 +1633 1614 4.16666666666667e+00 +1633 1632 -8.33333333333333e+00 +1633 1311 -2.08333333333333e+00 +1633 1605 2.08333333333333e+00 +1633 1615 -6.25000000000000e+00 +1633 1359 -2.08333333333333e+00 +1633 1839 4.16666666666667e+00 +1633 1313 4.16666666666667e+00 +1633 1634 -8.33333333333333e+00 +1633 1637 8.33333333333333e+00 +1633 1636 -3.75000000000000e+01 +1633 1635 8.33333333333333e+00 +1633 1361 4.16666666666667e+00 +1633 1841 -8.33333333333333e+00 +1633 1485 2.08333333333333e+00 +1633 1842 -4.16666666666667e+00 +1633 1487 2.08333333333333e+00 +1633 1844 -4.16666666666667e+00 +1633 1360 -6.25000000000000e+00 +1633 1481 -2.08333333333333e+00 +1633 1640 4.16666666666667e+00 +1633 1616 -2.08333333333333e+00 +1633 1480 -6.25000000000000e+00 +1633 1312 -6.25000000000000e+00 +1633 1479 4.16666666666667e+00 +1633 1638 -8.33333333333333e+00 +1634 1634 6.25000000000000e+01 +1634 1606 2.08333333333333e+00 +1634 1605 -4.16666666666667e+00 +1634 1616 -6.25000000000000e+00 +1634 1614 4.16666666666667e+00 +1634 1637 -1.25000000000000e+01 +1634 1312 4.16666666666667e+00 +1634 1633 -8.33333333333333e+00 +1634 1636 8.33333333333333e+00 +1634 1635 -4.16666666666667e+00 +1634 1360 4.16666666666667e+00 +1634 1840 -8.33333333333333e+00 +1634 1839 4.16666666666667e+00 +1634 1638 4.16666666666667e+00 +1634 1842 -4.16666666666667e+00 +1634 1361 -1.87500000000000e+01 +1634 1486 2.08333333333333e+00 +1634 1843 -4.16666666666667e+00 +1634 1359 4.16666666666667e+00 +1634 1485 -4.16666666666667e+00 +1634 1615 -2.08333333333333e+00 +1634 1481 -6.25000000000000e+00 +1634 1313 -1.87500000000000e+01 +1634 1480 -2.08333333333333e+00 +1634 1639 4.16666666666667e+00 +1634 1632 -8.33333333333333e+00 +1634 1479 4.16666666666667e+00 +1634 1311 4.16666666666667e+00 +1635 1635 1.25000000000000e+02 +1635 1613 -8.33333333333333e+00 +1635 1616 4.16666666666667e+00 +1635 1607 -4.16666666666667e+00 +1635 1615 -8.33333333333333e+00 +1635 1621 8.33333333333333e+00 +1635 1606 -4.16666666666667e+00 +1635 1622 8.33333333333333e+00 +1635 1620 -3.75000000000000e+01 +1635 1843 4.16666666666667e+00 +1635 1840 -4.16666666666667e+00 +1635 1844 -8.33333333333333e+00 +1635 1841 8.33333333333333e+00 +1635 1313 4.16666666666667e+00 +1635 1634 -4.16666666666667e+00 +1635 1633 8.33333333333333e+00 +1635 1636 -1.66666666666667e+01 +1635 1632 -1.25000000000000e+01 +1635 1367 4.16666666666667e+00 +1635 1839 -1.25000000000000e+01 +1635 1670 -4.16666666666667e+00 +1635 1673 4.16666666666667e+00 +1635 1853 -4.16666666666667e+00 +1635 1639 8.33333333333333e+00 +1635 1672 -8.33333333333333e+00 +1635 1669 8.33333333333333e+00 +1635 1640 8.33333333333333e+00 +1635 1625 8.33333333333333e+00 +1635 1637 -1.66666666666667e+01 +1635 1312 4.16666666666667e+00 +1635 1624 -4.16666666666667e+00 +1635 1638 -3.75000000000000e+01 +1635 1623 -1.25000000000000e+01 +1635 1852 -4.16666666666667e+00 +1635 1366 4.16666666666667e+00 +1635 1612 4.16666666666667e+00 +1635 1668 -1.25000000000000e+01 +1636 1636 1.25000000000000e+02 +1636 1613 4.16666666666667e+00 +1636 1607 -4.16666666666667e+00 +1636 1616 4.16666666666667e+00 +1636 1622 -4.16666666666667e+00 +1636 1614 -8.33333333333333e+00 +1636 1620 8.33333333333333e+00 +1636 1605 -4.16666666666667e+00 +1636 1621 -1.25000000000000e+01 +1636 1842 4.16666666666667e+00 +1636 1839 -4.16666666666667e+00 +1636 1844 4.16666666666667e+00 +1636 1634 8.33333333333333e+00 +1636 1633 -3.75000000000000e+01 +1636 1632 8.33333333333333e+00 +1636 1635 -1.66666666666667e+01 +1636 1841 8.33333333333333e+00 +1636 1840 -1.25000000000000e+01 +1636 1637 -1.66666666666667e+01 +1636 1640 -4.16666666666667e+00 +1636 1638 8.33333333333333e+00 +1636 1673 4.16666666666667e+00 +1636 1853 -4.16666666666667e+00 +1636 1671 -8.33333333333333e+00 +1636 1668 8.33333333333333e+00 +1636 1313 -8.33333333333333e+00 +1636 1625 8.33333333333333e+00 +1636 1639 -1.25000000000000e+01 +1636 1624 -1.25000000000000e+01 +1636 1311 4.16666666666667e+00 +1636 1623 -4.16666666666667e+00 +1636 1670 8.33333333333333e+00 +1636 1367 -8.33333333333333e+00 +1636 1611 4.16666666666667e+00 +1636 1669 -3.75000000000000e+01 +1636 1851 -4.16666666666667e+00 +1636 1365 4.16666666666667e+00 +1637 1637 1.25000000000000e+02 +1637 1611 -8.33333333333333e+00 +1637 1606 -4.16666666666667e+00 +1637 1614 4.16666666666667e+00 +1637 1605 -4.16666666666667e+00 +1637 1615 4.16666666666667e+00 +1637 1621 -4.16666666666667e+00 +1637 1622 -1.25000000000000e+01 +1637 1620 8.33333333333333e+00 +1637 1843 4.16666666666667e+00 +1637 1842 -8.33333333333333e+00 +1637 1839 8.33333333333333e+00 +1637 1634 -1.25000000000000e+01 +1637 1633 8.33333333333333e+00 +1637 1311 4.16666666666667e+00 +1637 1632 -4.16666666666667e+00 +1637 1841 -3.75000000000000e+01 +1637 1840 8.33333333333333e+00 +1637 1365 4.16666666666667e+00 +1637 1636 -1.66666666666667e+01 +1637 1668 -4.16666666666667e+00 +1637 1639 -4.16666666666667e+00 +1637 1671 4.16666666666667e+00 +1637 1851 -4.16666666666667e+00 +1637 1672 4.16666666666667e+00 +1637 1852 -4.16666666666667e+00 +1637 1640 -1.25000000000000e+01 +1637 1625 -3.75000000000000e+01 +1637 1312 -8.33333333333333e+00 +1637 1624 8.33333333333333e+00 +1637 1638 8.33333333333333e+00 +1637 1623 8.33333333333333e+00 +1637 1635 -1.66666666666667e+01 +1637 1612 4.16666666666667e+00 +1637 1670 -1.25000000000000e+01 +1637 1669 8.33333333333333e+00 +1637 1366 -8.33333333333333e+00 +1638 1638 1.25000000000000e+02 +1638 1630 -4.16666666666667e+00 +1638 1778 4.16666666666667e+00 +1638 1777 -8.33333333333333e+00 +1638 1629 -1.25000000000000e+01 +1638 1628 4.16666666666667e+00 +1638 1744 8.33333333333333e+00 +1638 1745 8.33333333333333e+00 +1638 1743 -3.75000000000000e+01 +1638 1627 4.16666666666667e+00 +1638 1640 -1.66666666666667e+01 +1638 1313 -4.16666666666667e+00 +1638 1373 -4.16666666666667e+00 +1638 1673 -4.16666666666667e+00 +1638 1853 4.16666666666667e+00 +1638 1672 8.33333333333333e+00 +1638 1639 -1.66666666666667e+01 +1638 1636 8.33333333333333e+00 +1638 1625 -8.33333333333333e+00 +1638 1637 8.33333333333333e+00 +1638 1312 -4.16666666666667e+00 +1638 1624 4.16666666666667e+00 +1638 1635 -3.75000000000000e+01 +1638 1372 -4.16666666666667e+00 +1638 1852 4.16666666666667e+00 +1638 1671 -1.25000000000000e+01 +1638 1481 -4.16666666666667e+00 +1638 1634 4.16666666666667e+00 +1638 1492 4.16666666666667e+00 +1638 1843 -4.16666666666667e+00 +1638 1633 -8.33333333333333e+00 +1638 1480 8.33333333333333e+00 +1638 1479 -1.25000000000000e+01 +1638 1844 8.33333333333333e+00 +1638 1493 -8.33333333333333e+00 +1638 1842 -1.25000000000000e+01 +1638 1631 8.33333333333333e+00 +1639 1639 1.25000000000000e+02 +1639 1629 -4.16666666666667e+00 +1639 1776 -8.33333333333333e+00 +1639 1631 8.33333333333333e+00 +1639 1630 -1.25000000000000e+01 +1639 1745 -4.16666666666667e+00 +1639 1743 8.33333333333333e+00 +1639 1744 -1.25000000000000e+01 +1639 1628 -8.33333333333333e+00 +1639 1626 4.16666666666667e+00 +1639 1625 4.16666666666667e+00 +1639 1637 -4.16666666666667e+00 +1639 1671 8.33333333333333e+00 +1639 1638 -1.66666666666667e+01 +1639 1635 8.33333333333333e+00 +1639 1636 -1.25000000000000e+01 +1639 1311 -4.16666666666667e+00 +1639 1623 4.16666666666667e+00 +1639 1673 8.33333333333333e+00 +1639 1853 -8.33333333333333e+00 +1639 1672 -3.75000000000000e+01 +1639 1371 -4.16666666666667e+00 +1639 1851 4.16666666666667e+00 +1639 1481 8.33333333333333e+00 +1639 1640 -1.66666666666667e+01 +1639 1844 8.33333333333333e+00 +1639 1491 4.16666666666667e+00 +1639 1842 -4.16666666666667e+00 +1639 1634 4.16666666666667e+00 +1639 1313 -4.16666666666667e+00 +1639 1480 -3.75000000000000e+01 +1639 1632 -8.33333333333333e+00 +1639 1479 8.33333333333333e+00 +1639 1493 4.16666666666667e+00 +1639 1373 -4.16666666666667e+00 +1639 1843 -1.25000000000000e+01 +1639 1778 4.16666666666667e+00 +1640 1640 1.25000000000000e+02 +1640 1629 8.33333333333333e+00 +1640 1776 4.16666666666667e+00 +1640 1631 -3.75000000000000e+01 +1640 1630 8.33333333333333e+00 +1640 1744 -4.16666666666667e+00 +1640 1626 4.16666666666667e+00 +1640 1745 -1.25000000000000e+01 +1640 1743 8.33333333333333e+00 +1640 1627 -8.33333333333333e+00 +1640 1638 -1.66666666666667e+01 +1640 1311 -4.16666666666667e+00 +1640 1371 -4.16666666666667e+00 +1640 1624 4.16666666666667e+00 +1640 1636 -4.16666666666667e+00 +1640 1671 -4.16666666666667e+00 +1640 1851 4.16666666666667e+00 +1640 1637 -1.25000000000000e+01 +1640 1623 -8.33333333333333e+00 +1640 1635 8.33333333333333e+00 +1640 1673 -1.25000000000000e+01 +1640 1672 8.33333333333333e+00 +1640 1852 -8.33333333333333e+00 +1640 1479 -4.16666666666667e+00 +1640 1632 4.16666666666667e+00 +1640 1480 8.33333333333333e+00 +1640 1639 -1.66666666666667e+01 +1640 1843 8.33333333333333e+00 +1640 1481 -1.25000000000000e+01 +1640 1633 4.16666666666667e+00 +1640 1312 -4.16666666666667e+00 +1640 1844 -3.75000000000000e+01 +1640 1777 4.16666666666667e+00 +1640 1492 4.16666666666667e+00 +1640 1372 -4.16666666666667e+00 +1640 1842 8.33333333333333e+00 +1640 1491 -8.33333333333333e+00 +1641 1641 1.25000000000000e+02 +1641 1649 -4.16666666666667e+00 +1641 1663 -8.33333333333333e+00 +1641 1648 8.33333333333333e+00 +1641 1647 -1.25000000000000e+01 +1641 1574 -8.33333333333333e+00 +1641 1573 4.16666666666667e+00 +1641 1577 8.33333333333333e+00 +1641 1576 -4.16666666666667e+00 +1641 1575 -1.25000000000000e+01 +1641 1676 -4.16666666666667e+00 +1641 1658 4.16666666666667e+00 +1641 1316 8.33333333333333e+00 +1641 1643 -1.66666666666667e+01 +1641 1655 8.33333333333333e+00 +1641 1657 4.16666666666667e+00 +1641 1654 -4.16666666666667e+00 +1641 1653 -1.25000000000000e+01 +1641 1319 8.33333333333333e+00 +1641 1670 -8.33333333333333e+00 +1641 1675 -4.16666666666667e+00 +1641 1669 4.16666666666667e+00 +1641 1399 -4.16666666666667e+00 +1641 1402 4.16666666666667e+00 +1641 1610 4.16666666666667e+00 +1641 1400 -4.16666666666667e+00 +1641 1315 8.33333333333333e+00 +1641 1609 -8.33333333333333e+00 +1641 1314 -3.75000000000000e+01 +1641 1613 -4.16666666666667e+00 +1641 1403 4.16666666666667e+00 +1641 1642 -1.66666666666667e+01 +1641 1612 8.33333333333333e+00 +1641 1318 8.33333333333333e+00 +1641 1664 4.16666666666667e+00 +1641 1611 -1.25000000000000e+01 +1641 1317 -3.75000000000000e+01 +1642 1642 1.25000000000000e+02 +1642 1664 4.16666666666667e+00 +1642 1662 -8.33333333333333e+00 +1642 1648 -3.75000000000000e+01 +1642 1647 8.33333333333333e+00 +1642 1574 4.16666666666667e+00 +1642 1572 4.16666666666667e+00 +1642 1577 8.33333333333333e+00 +1642 1576 -1.25000000000000e+01 +1642 1575 -4.16666666666667e+00 +1642 1643 -1.66666666666667e+01 +1642 1319 -4.16666666666667e+00 +1642 1316 -4.16666666666667e+00 +1642 1670 4.16666666666667e+00 +1642 1676 -4.16666666666667e+00 +1642 1658 -8.33333333333333e+00 +1642 1655 8.33333333333333e+00 +1642 1654 -1.25000000000000e+01 +1642 1656 4.16666666666667e+00 +1642 1653 -4.16666666666667e+00 +1642 1674 -4.16666666666667e+00 +1642 1668 4.16666666666667e+00 +1642 1610 4.16666666666667e+00 +1642 1400 -4.16666666666667e+00 +1642 1398 -4.16666666666667e+00 +1642 1401 4.16666666666667e+00 +1642 1315 -1.25000000000000e+01 +1642 1314 8.33333333333333e+00 +1642 1608 -8.33333333333333e+00 +1642 1613 8.33333333333333e+00 +1642 1403 -8.33333333333333e+00 +1642 1649 8.33333333333333e+00 +1642 1612 -3.75000000000000e+01 +1642 1318 -1.25000000000000e+01 +1642 1641 -1.66666666666667e+01 +1642 1611 8.33333333333333e+00 +1642 1317 8.33333333333333e+00 +1643 1643 1.25000000000000e+02 +1643 1647 -4.16666666666667e+00 +1643 1648 8.33333333333333e+00 +1643 1663 4.16666666666667e+00 +1643 1649 -1.25000000000000e+01 +1643 1573 4.16666666666667e+00 +1643 1572 -8.33333333333333e+00 +1643 1577 -3.75000000000000e+01 +1643 1576 8.33333333333333e+00 +1643 1575 8.33333333333333e+00 +1643 1642 -1.66666666666667e+01 +1643 1318 -4.16666666666667e+00 +1643 1315 -4.16666666666667e+00 +1643 1669 4.16666666666667e+00 +1643 1675 -4.16666666666667e+00 +1643 1674 -4.16666666666667e+00 +1643 1656 4.16666666666667e+00 +1643 1655 -3.75000000000000e+01 +1643 1657 -8.33333333333333e+00 +1643 1654 8.33333333333333e+00 +1643 1314 8.33333333333333e+00 +1643 1641 -1.66666666666667e+01 +1643 1653 8.33333333333333e+00 +1643 1317 8.33333333333333e+00 +1643 1668 -8.33333333333333e+00 +1643 1609 4.16666666666667e+00 +1643 1399 -4.16666666666667e+00 +1643 1316 -1.25000000000000e+01 +1643 1608 4.16666666666667e+00 +1643 1398 -4.16666666666667e+00 +1643 1662 4.16666666666667e+00 +1643 1613 -1.25000000000000e+01 +1643 1319 -1.25000000000000e+01 +1643 1612 8.33333333333333e+00 +1643 1402 -8.33333333333333e+00 +1643 1611 -4.16666666666667e+00 +1643 1401 4.16666666666667e+00 +1644 1644 1.25000000000000e+02 +1644 1583 8.33333333333333e+00 +1644 1582 -4.16666666666667e+00 +1644 1581 -1.25000000000000e+01 +1644 1573 4.16666666666667e+00 +1644 1646 -1.66666666666667e+01 +1644 1505 8.33333333333333e+00 +1644 1507 4.16666666666667e+00 +1644 1504 -4.16666666666667e+00 +1644 1316 -4.16666666666667e+00 +1644 1315 8.33333333333333e+00 +1644 1314 -1.25000000000000e+01 +1644 1503 -1.25000000000000e+01 +1644 1346 -4.16666666666667e+00 +1644 1508 4.16666666666667e+00 +1644 1645 -1.66666666666667e+01 +1644 1345 8.33333333333333e+00 +1644 1574 4.16666666666667e+00 +1644 1344 -1.25000000000000e+01 +1644 1649 8.33333333333333e+00 +1644 1811 4.16666666666667e+00 +1644 1810 -8.33333333333333e+00 +1644 1648 8.33333333333333e+00 +1644 1647 -3.75000000000000e+01 +1644 1814 -4.16666666666667e+00 +1644 1813 -4.16666666666667e+00 +1644 1658 -8.33333333333333e+00 +1644 1657 4.16666666666667e+00 +1644 2329 4.16666666666667e+00 +1644 2320 -4.16666666666667e+00 +1644 2321 -4.16666666666667e+00 +1644 2330 -8.33333333333333e+00 +1644 2393 8.33333333333333e+00 +1644 2387 4.16666666666667e+00 +1644 2386 -8.33333333333333e+00 +1644 2392 8.33333333333333e+00 +1644 2391 -3.75000000000000e+01 +1645 1645 1.25000000000000e+02 +1645 1582 -1.25000000000000e+01 +1645 1581 -4.16666666666667e+00 +1645 1574 -8.33333333333333e+00 +1645 1572 4.16666666666667e+00 +1645 1506 4.16666666666667e+00 +1645 1503 -4.16666666666667e+00 +1645 1316 8.33333333333333e+00 +1645 1646 -1.66666666666667e+01 +1645 1505 8.33333333333333e+00 +1645 1315 -3.75000000000000e+01 +1645 1504 -1.25000000000000e+01 +1645 1314 8.33333333333333e+00 +1645 1346 8.33333333333333e+00 +1645 1508 -8.33333333333333e+00 +1645 1583 8.33333333333333e+00 +1645 1345 -3.75000000000000e+01 +1645 1644 -1.66666666666667e+01 +1645 1344 8.33333333333333e+00 +1645 1649 -4.16666666666667e+00 +1645 1809 -8.33333333333333e+00 +1645 1648 -1.25000000000000e+01 +1645 1647 8.33333333333333e+00 +1645 1814 -4.16666666666667e+00 +1645 1658 4.16666666666667e+00 +1645 1812 -4.16666666666667e+00 +1645 1811 4.16666666666667e+00 +1645 1656 4.16666666666667e+00 +1645 2328 4.16666666666667e+00 +1645 2319 -4.16666666666667e+00 +1645 2330 4.16666666666667e+00 +1645 2321 -4.16666666666667e+00 +1645 2393 -4.16666666666667e+00 +1645 2387 4.16666666666667e+00 +1645 2385 -8.33333333333333e+00 +1645 2392 -1.25000000000000e+01 +1645 2391 8.33333333333333e+00 +1646 1646 1.25000000000000e+02 +1646 1583 -3.75000000000000e+01 +1646 1582 8.33333333333333e+00 +1646 1581 8.33333333333333e+00 +1646 1573 -8.33333333333333e+00 +1646 1644 -1.66666666666667e+01 +1646 1503 8.33333333333333e+00 +1646 1316 -1.25000000000000e+01 +1646 1505 -3.75000000000000e+01 +1646 1315 8.33333333333333e+00 +1646 1645 -1.66666666666667e+01 +1646 1504 8.33333333333333e+00 +1646 1314 -4.16666666666667e+00 +1646 1572 4.16666666666667e+00 +1646 1346 -1.25000000000000e+01 +1646 1345 8.33333333333333e+00 +1646 1507 -8.33333333333333e+00 +1646 1344 -4.16666666666667e+00 +1646 1506 4.16666666666667e+00 +1646 1648 -4.16666666666667e+00 +1646 1647 8.33333333333333e+00 +1646 1809 4.16666666666667e+00 +1646 1649 -1.25000000000000e+01 +1646 1812 -4.16666666666667e+00 +1646 1813 -4.16666666666667e+00 +1646 1657 4.16666666666667e+00 +1646 1810 4.16666666666667e+00 +1646 1656 -8.33333333333333e+00 +1646 2319 -4.16666666666667e+00 +1646 2329 4.16666666666667e+00 +1646 2328 -8.33333333333333e+00 +1646 2320 -4.16666666666667e+00 +1646 2392 -4.16666666666667e+00 +1646 2386 4.16666666666667e+00 +1646 2391 8.33333333333333e+00 +1646 2385 4.16666666666667e+00 +1646 2393 -1.25000000000000e+01 +1647 1647 1.25000000000000e+02 +1647 1675 4.16666666666667e+00 +1647 1819 -4.16666666666667e+00 +1647 1814 4.16666666666667e+00 +1647 1820 -4.16666666666667e+00 +1647 1813 4.16666666666667e+00 +1647 1657 -4.16666666666667e+00 +1647 1658 8.33333333333333e+00 +1647 1656 -1.25000000000000e+01 +1647 1583 -8.33333333333333e+00 +1647 1646 8.33333333333333e+00 +1647 1582 4.16666666666667e+00 +1647 1349 4.16666666666667e+00 +1647 1811 -4.16666666666667e+00 +1647 1810 8.33333333333333e+00 +1647 1809 -1.25000000000000e+01 +1647 1316 4.16666666666667e+00 +1647 1645 8.33333333333333e+00 +1647 1644 -3.75000000000000e+01 +1647 1643 -4.16666666666667e+00 +1647 1648 -1.66666666666667e+01 +1647 1585 -4.16666666666667e+00 +1647 1577 4.16666666666667e+00 +1647 1574 -4.16666666666667e+00 +1647 1576 4.16666666666667e+00 +1647 1573 -4.16666666666667e+00 +1647 1586 8.33333333333333e+00 +1647 1664 8.33333333333333e+00 +1647 1649 -1.66666666666667e+01 +1647 1348 -8.33333333333333e+00 +1647 1663 8.33333333333333e+00 +1647 1584 -1.25000000000000e+01 +1647 1662 -3.75000000000000e+01 +1647 1642 8.33333333333333e+00 +1647 1315 -8.33333333333333e+00 +1647 1676 -8.33333333333333e+00 +1647 1641 -1.25000000000000e+01 +1648 1648 1.25000000000000e+02 +1648 1674 4.16666666666667e+00 +1648 1818 -4.16666666666667e+00 +1648 1814 -8.33333333333333e+00 +1648 1658 8.33333333333333e+00 +1648 1812 4.16666666666667e+00 +1648 1656 -4.16666666666667e+00 +1648 1820 -4.16666666666667e+00 +1648 1657 -1.25000000000000e+01 +1648 1583 4.16666666666667e+00 +1648 1646 -4.16666666666667e+00 +1648 1581 4.16666666666667e+00 +1648 1811 8.33333333333333e+00 +1648 1649 -1.66666666666667e+01 +1648 1810 -3.75000000000000e+01 +1648 1809 8.33333333333333e+00 +1648 1645 -1.25000000000000e+01 +1648 1644 8.33333333333333e+00 +1648 1647 -1.66666666666667e+01 +1648 1584 -4.16666666666667e+00 +1648 1586 8.33333333333333e+00 +1648 1577 -8.33333333333333e+00 +1648 1643 8.33333333333333e+00 +1648 1575 4.16666666666667e+00 +1648 1572 -4.16666666666667e+00 +1648 1349 4.16666666666667e+00 +1648 1664 -4.16666666666667e+00 +1648 1585 -1.25000000000000e+01 +1648 1663 -1.25000000000000e+01 +1648 1347 -8.33333333333333e+00 +1648 1662 8.33333333333333e+00 +1648 1574 -4.16666666666667e+00 +1648 1316 4.16666666666667e+00 +1648 1676 4.16666666666667e+00 +1648 1642 -3.75000000000000e+01 +1648 1641 8.33333333333333e+00 +1648 1314 -8.33333333333333e+00 +1649 1649 1.25000000000000e+02 +1649 1674 -8.33333333333333e+00 +1649 1812 4.16666666666667e+00 +1649 1818 -4.16666666666667e+00 +1649 1813 -8.33333333333333e+00 +1649 1657 8.33333333333333e+00 +1649 1819 -4.16666666666667e+00 +1649 1658 -3.75000000000000e+01 +1649 1656 8.33333333333333e+00 +1649 1582 4.16666666666667e+00 +1649 1645 -4.16666666666667e+00 +1649 1581 -8.33333333333333e+00 +1649 1644 8.33333333333333e+00 +1649 1811 -1.25000000000000e+01 +1649 1810 8.33333333333333e+00 +1649 1648 -1.66666666666667e+01 +1649 1347 4.16666666666667e+00 +1649 1809 -4.16666666666667e+00 +1649 1646 -1.25000000000000e+01 +1649 1314 4.16666666666667e+00 +1649 1641 -4.16666666666667e+00 +1649 1585 8.33333333333333e+00 +1649 1575 4.16666666666667e+00 +1649 1572 -4.16666666666667e+00 +1649 1576 -8.33333333333333e+00 +1649 1642 8.33333333333333e+00 +1649 1586 -3.75000000000000e+01 +1649 1664 -1.25000000000000e+01 +1649 1348 4.16666666666667e+00 +1649 1663 -4.16666666666667e+00 +1649 1584 8.33333333333333e+00 +1649 1662 8.33333333333333e+00 +1649 1647 -1.66666666666667e+01 +1649 1675 4.16666666666667e+00 +1649 1643 -1.25000000000000e+01 +1649 1573 -4.16666666666667e+00 +1649 1315 4.16666666666667e+00 +1650 1650 1.25000000000000e+02 +1650 1619 -4.16666666666667e+00 +1650 1618 8.33333333333333e+00 +1650 1617 -1.25000000000000e+01 +1650 1610 4.16666666666667e+00 +1650 1511 4.16666666666667e+00 +1650 1505 -4.16666666666667e+00 +1650 1651 -1.66666666666667e+01 +1650 1504 8.33333333333333e+00 +1650 1316 8.33333333333333e+00 +1650 1315 -4.16666666666667e+00 +1650 1314 -1.25000000000000e+01 +1650 1503 -1.25000000000000e+01 +1650 1652 -1.66666666666667e+01 +1650 1364 8.33333333333333e+00 +1650 1363 -4.16666666666667e+00 +1650 1510 4.16666666666667e+00 +1650 1609 4.16666666666667e+00 +1650 1362 -1.25000000000000e+01 +1650 1846 4.16666666666667e+00 +1650 1847 -8.33333333333333e+00 +1650 1655 8.33333333333333e+00 +1650 1654 8.33333333333333e+00 +1650 1653 -3.75000000000000e+01 +1650 1849 -4.16666666666667e+00 +1650 1850 -4.16666666666667e+00 +1650 1658 4.16666666666667e+00 +1650 1657 -8.33333333333333e+00 +1650 2356 -4.16666666666667e+00 +1650 2366 4.16666666666667e+00 +1650 2365 -8.33333333333333e+00 +1650 2357 -4.16666666666667e+00 +1650 2398 8.33333333333333e+00 +1650 2387 -8.33333333333333e+00 +1650 2386 4.16666666666667e+00 +1650 2399 8.33333333333333e+00 +1650 2397 -3.75000000000000e+01 +1651 1651 1.25000000000000e+02 +1651 1619 8.33333333333333e+00 +1651 1618 -3.75000000000000e+01 +1651 1617 8.33333333333333e+00 +1651 1610 -8.33333333333333e+00 +1651 1650 -1.66666666666667e+01 +1651 1503 8.33333333333333e+00 +1651 1316 8.33333333333333e+00 +1651 1652 -1.66666666666667e+01 +1651 1505 8.33333333333333e+00 +1651 1315 -1.25000000000000e+01 +1651 1504 -3.75000000000000e+01 +1651 1314 -4.16666666666667e+00 +1651 1364 8.33333333333333e+00 +1651 1511 -8.33333333333333e+00 +1651 1608 4.16666666666667e+00 +1651 1363 -1.25000000000000e+01 +1651 1362 -4.16666666666667e+00 +1651 1509 4.16666666666667e+00 +1651 1845 4.16666666666667e+00 +1651 1847 4.16666666666667e+00 +1651 1655 -4.16666666666667e+00 +1651 1654 -1.25000000000000e+01 +1651 1653 8.33333333333333e+00 +1651 1658 4.16666666666667e+00 +1651 1850 -4.16666666666667e+00 +1651 1848 -4.16666666666667e+00 +1651 1656 -8.33333333333333e+00 +1651 2355 -4.16666666666667e+00 +1651 2366 4.16666666666667e+00 +1651 2357 -4.16666666666667e+00 +1651 2364 -8.33333333333333e+00 +1651 2387 4.16666666666667e+00 +1651 2399 -4.16666666666667e+00 +1651 2397 8.33333333333333e+00 +1651 2385 4.16666666666667e+00 +1651 2398 -1.25000000000000e+01 +1652 1652 1.25000000000000e+02 +1652 1619 -1.25000000000000e+01 +1652 1618 8.33333333333333e+00 +1652 1617 -4.16666666666667e+00 +1652 1609 -8.33333333333333e+00 +1652 1608 4.16666666666667e+00 +1652 1509 4.16666666666667e+00 +1652 1503 -4.16666666666667e+00 +1652 1316 -3.75000000000000e+01 +1652 1505 -1.25000000000000e+01 +1652 1315 8.33333333333333e+00 +1652 1651 -1.66666666666667e+01 +1652 1504 8.33333333333333e+00 +1652 1314 8.33333333333333e+00 +1652 1364 -3.75000000000000e+01 +1652 1363 8.33333333333333e+00 +1652 1510 -8.33333333333333e+00 +1652 1650 -1.66666666666667e+01 +1652 1362 8.33333333333333e+00 +1652 1846 4.16666666666667e+00 +1652 1845 -8.33333333333333e+00 +1652 1655 -1.25000000000000e+01 +1652 1654 -4.16666666666667e+00 +1652 1653 8.33333333333333e+00 +1652 1657 4.16666666666667e+00 +1652 1849 -4.16666666666667e+00 +1652 1848 -4.16666666666667e+00 +1652 1656 4.16666666666667e+00 +1652 2356 -4.16666666666667e+00 +1652 2364 4.16666666666667e+00 +1652 2355 -4.16666666666667e+00 +1652 2386 4.16666666666667e+00 +1652 2398 -4.16666666666667e+00 +1652 2385 -8.33333333333333e+00 +1652 2365 4.16666666666667e+00 +1652 2399 -1.25000000000000e+01 +1652 2397 8.33333333333333e+00 +1653 1653 1.25000000000000e+02 +1653 1613 4.16666666666667e+00 +1653 1610 -4.16666666666667e+00 +1653 1622 -4.16666666666667e+00 +1653 1619 4.16666666666667e+00 +1653 1621 8.33333333333333e+00 +1653 1618 -8.33333333333333e+00 +1653 1609 -4.16666666666667e+00 +1653 1620 -1.25000000000000e+01 +1653 1849 4.16666666666667e+00 +1653 1846 -4.16666666666667e+00 +1653 1850 4.16666666666667e+00 +1653 1652 8.33333333333333e+00 +1653 1651 8.33333333333333e+00 +1653 1654 -1.66666666666667e+01 +1653 1650 -3.75000000000000e+01 +1653 1847 8.33333333333333e+00 +1653 1845 -1.25000000000000e+01 +1653 1655 -1.66666666666667e+01 +1653 1658 -4.16666666666667e+00 +1653 1657 8.33333333333333e+00 +1653 1856 -4.16666666666667e+00 +1653 1676 4.16666666666667e+00 +1653 1675 -8.33333333333333e+00 +1653 1669 8.33333333333333e+00 +1653 1316 -8.33333333333333e+00 +1653 1643 8.33333333333333e+00 +1653 1315 4.16666666666667e+00 +1653 1642 -4.16666666666667e+00 +1653 1656 -1.25000000000000e+01 +1653 1641 -1.25000000000000e+01 +1653 1670 8.33333333333333e+00 +1653 1367 -8.33333333333333e+00 +1653 1855 -4.16666666666667e+00 +1653 1366 4.16666666666667e+00 +1653 1612 4.16666666666667e+00 +1653 1668 -3.75000000000000e+01 +1654 1654 1.25000000000000e+02 +1654 1613 -8.33333333333333e+00 +1654 1610 -4.16666666666667e+00 +1654 1619 4.16666666666667e+00 +1654 1620 8.33333333333333e+00 +1654 1617 -8.33333333333333e+00 +1654 1608 -4.16666666666667e+00 +1654 1622 8.33333333333333e+00 +1654 1621 -3.75000000000000e+01 +1654 1848 4.16666666666667e+00 +1654 1845 -4.16666666666667e+00 +1654 1847 8.33333333333333e+00 +1654 1850 -8.33333333333333e+00 +1654 1652 -4.16666666666667e+00 +1654 1316 4.16666666666667e+00 +1654 1651 -1.25000000000000e+01 +1654 1650 8.33333333333333e+00 +1654 1653 -1.66666666666667e+01 +1654 1367 4.16666666666667e+00 +1654 1846 -1.25000000000000e+01 +1654 1670 -4.16666666666667e+00 +1654 1676 4.16666666666667e+00 +1654 1856 -4.16666666666667e+00 +1654 1656 8.33333333333333e+00 +1654 1674 -8.33333333333333e+00 +1654 1668 8.33333333333333e+00 +1654 1658 8.33333333333333e+00 +1654 1643 8.33333333333333e+00 +1654 1655 -1.66666666666667e+01 +1654 1657 -3.75000000000000e+01 +1654 1642 -1.25000000000000e+01 +1654 1314 4.16666666666667e+00 +1654 1641 -4.16666666666667e+00 +1654 1611 4.16666666666667e+00 +1654 1669 -1.25000000000000e+01 +1654 1854 -4.16666666666667e+00 +1654 1365 4.16666666666667e+00 +1655 1655 1.25000000000000e+02 +1655 1611 4.16666666666667e+00 +1655 1608 -4.16666666666667e+00 +1655 1609 -4.16666666666667e+00 +1655 1618 4.16666666666667e+00 +1655 1620 -4.16666666666667e+00 +1655 1617 4.16666666666667e+00 +1655 1622 -1.25000000000000e+01 +1655 1621 8.33333333333333e+00 +1655 1846 8.33333333333333e+00 +1655 1849 -8.33333333333333e+00 +1655 1848 4.16666666666667e+00 +1655 1652 -1.25000000000000e+01 +1655 1651 -4.16666666666667e+00 +1655 1315 4.16666666666667e+00 +1655 1650 8.33333333333333e+00 +1655 1847 -3.75000000000000e+01 +1655 1366 4.16666666666667e+00 +1655 1845 8.33333333333333e+00 +1655 1669 -4.16666666666667e+00 +1655 1653 -1.66666666666667e+01 +1655 1656 -4.16666666666667e+00 +1655 1675 4.16666666666667e+00 +1655 1855 -4.16666666666667e+00 +1655 1854 -4.16666666666667e+00 +1655 1674 4.16666666666667e+00 +1655 1658 -1.25000000000000e+01 +1655 1643 -3.75000000000000e+01 +1655 1657 8.33333333333333e+00 +1655 1642 8.33333333333333e+00 +1655 1654 -1.66666666666667e+01 +1655 1314 -8.33333333333333e+00 +1655 1641 8.33333333333333e+00 +1655 1612 -8.33333333333333e+00 +1655 1670 -1.25000000000000e+01 +1655 1668 8.33333333333333e+00 +1655 1365 -8.33333333333333e+00 +1656 1656 1.25000000000000e+02 +1656 1648 -4.16666666666667e+00 +1656 1819 -8.33333333333333e+00 +1656 1649 8.33333333333333e+00 +1656 1647 -1.25000000000000e+01 +1656 1814 -4.16666666666667e+00 +1656 1813 8.33333333333333e+00 +1656 1812 -1.25000000000000e+01 +1656 1646 -8.33333333333333e+00 +1656 1645 4.16666666666667e+00 +1656 1643 4.16666666666667e+00 +1656 1655 -4.16666666666667e+00 +1656 1657 -1.66666666666667e+01 +1656 1675 8.33333333333333e+00 +1656 1654 8.33333333333333e+00 +1656 1676 8.33333333333333e+00 +1656 1856 -8.33333333333333e+00 +1656 1378 -4.16666666666667e+00 +1656 1855 4.16666666666667e+00 +1656 1674 -3.75000000000000e+01 +1656 1315 -4.16666666666667e+00 +1656 1642 4.16666666666667e+00 +1656 1653 -1.25000000000000e+01 +1656 1505 8.33333333333333e+00 +1656 1658 -1.66666666666667e+01 +1656 1850 8.33333333333333e+00 +1656 1513 4.16666666666667e+00 +1656 1849 -4.16666666666667e+00 +1656 1652 4.16666666666667e+00 +1656 1316 -4.16666666666667e+00 +1656 1504 8.33333333333333e+00 +1656 1651 -8.33333333333333e+00 +1656 1503 -3.75000000000000e+01 +1656 1514 4.16666666666667e+00 +1656 1379 -4.16666666666667e+00 +1656 1848 -1.25000000000000e+01 +1656 1820 4.16666666666667e+00 +1657 1657 1.25000000000000e+02 +1657 1647 -4.16666666666667e+00 +1657 1820 4.16666666666667e+00 +1657 1818 -8.33333333333333e+00 +1657 1648 -1.25000000000000e+01 +1657 1646 4.16666666666667e+00 +1657 1812 8.33333333333333e+00 +1657 1814 8.33333333333333e+00 +1657 1813 -3.75000000000000e+01 +1657 1644 4.16666666666667e+00 +1657 1658 -1.66666666666667e+01 +1657 1316 -4.16666666666667e+00 +1657 1379 -4.16666666666667e+00 +1657 1676 -4.16666666666667e+00 +1657 1856 4.16666666666667e+00 +1657 1656 -1.66666666666667e+01 +1657 1674 8.33333333333333e+00 +1657 1653 8.33333333333333e+00 +1657 1675 -1.25000000000000e+01 +1657 1377 -4.16666666666667e+00 +1657 1854 4.16666666666667e+00 +1657 1643 -8.33333333333333e+00 +1657 1655 8.33333333333333e+00 +1657 1654 -3.75000000000000e+01 +1657 1314 -4.16666666666667e+00 +1657 1641 4.16666666666667e+00 +1657 1505 -4.16666666666667e+00 +1657 1652 4.16666666666667e+00 +1657 1512 4.16666666666667e+00 +1657 1848 -4.16666666666667e+00 +1657 1504 -1.25000000000000e+01 +1657 1503 8.33333333333333e+00 +1657 1650 -8.33333333333333e+00 +1657 1514 -8.33333333333333e+00 +1657 1850 8.33333333333333e+00 +1657 1849 -1.25000000000000e+01 +1657 1649 8.33333333333333e+00 +1658 1658 1.25000000000000e+02 +1658 1648 8.33333333333333e+00 +1658 1819 4.16666666666667e+00 +1658 1649 -3.75000000000000e+01 +1658 1647 8.33333333333333e+00 +1658 1812 -4.16666666666667e+00 +1658 1645 4.16666666666667e+00 +1658 1814 -1.25000000000000e+01 +1658 1813 8.33333333333333e+00 +1658 1644 -8.33333333333333e+00 +1658 1657 -1.66666666666667e+01 +1658 1315 -4.16666666666667e+00 +1658 1378 -4.16666666666667e+00 +1658 1641 4.16666666666667e+00 +1658 1653 -4.16666666666667e+00 +1658 1675 -4.16666666666667e+00 +1658 1855 4.16666666666667e+00 +1658 1676 -1.25000000000000e+01 +1658 1674 8.33333333333333e+00 +1658 1854 -8.33333333333333e+00 +1658 1655 -1.25000000000000e+01 +1658 1642 -8.33333333333333e+00 +1658 1654 8.33333333333333e+00 +1658 1504 -4.16666666666667e+00 +1658 1651 4.16666666666667e+00 +1658 1503 8.33333333333333e+00 +1658 1656 -1.66666666666667e+01 +1658 1848 8.33333333333333e+00 +1658 1505 -1.25000000000000e+01 +1658 1650 4.16666666666667e+00 +1658 1314 -4.16666666666667e+00 +1658 1850 -3.75000000000000e+01 +1658 1818 4.16666666666667e+00 +1658 1513 -8.33333333333333e+00 +1658 1849 8.33333333333333e+00 +1658 1512 4.16666666666667e+00 +1658 1377 -4.16666666666667e+00 +1659 1659 1.25000000000000e+02 +1659 1594 -4.16666666666667e+00 +1659 1589 -8.33333333333333e+00 +1659 1595 8.33333333333333e+00 +1659 1593 -1.25000000000000e+01 +1659 1772 4.16666666666667e+00 +1659 1771 -8.33333333333333e+00 +1659 1667 -4.16666666666667e+00 +1659 1666 8.33333333333333e+00 +1659 1665 -1.25000000000000e+01 +1659 1558 -4.16666666666667e+00 +1659 1567 4.16666666666667e+00 +1659 1568 4.16666666666667e+00 +1659 1631 -4.16666666666667e+00 +1659 1336 8.33333333333333e+00 +1659 1660 -1.66666666666667e+01 +1659 1630 8.33333333333333e+00 +1659 1629 -1.25000000000000e+01 +1659 1559 -4.16666666666667e+00 +1659 1625 4.16666666666667e+00 +1659 1318 8.33333333333333e+00 +1659 1624 -8.33333333333333e+00 +1659 1520 -4.16666666666667e+00 +1659 1517 4.16666666666667e+00 +1659 1337 8.33333333333333e+00 +1659 1778 -8.33333333333333e+00 +1659 1777 4.16666666666667e+00 +1659 1519 -4.16666666666667e+00 +1659 1335 -3.75000000000000e+01 +1659 1661 -1.66666666666667e+01 +1659 1673 8.33333333333333e+00 +1659 1319 8.33333333333333e+00 +1659 1672 -4.16666666666667e+00 +1659 1516 4.16666666666667e+00 +1659 1588 4.16666666666667e+00 +1659 1671 -1.25000000000000e+01 +1659 1317 -3.75000000000000e+01 +1660 1660 1.25000000000000e+02 +1660 1593 -4.16666666666667e+00 +1660 1595 8.33333333333333e+00 +1660 1589 4.16666666666667e+00 +1660 1594 -1.25000000000000e+01 +1660 1772 4.16666666666667e+00 +1660 1770 -8.33333333333333e+00 +1660 1667 8.33333333333333e+00 +1660 1666 -3.75000000000000e+01 +1660 1665 8.33333333333333e+00 +1660 1661 -1.66666666666667e+01 +1660 1319 -4.16666666666667e+00 +1660 1337 -4.16666666666667e+00 +1660 1625 4.16666666666667e+00 +1660 1559 -4.16666666666667e+00 +1660 1557 -4.16666666666667e+00 +1660 1566 4.16666666666667e+00 +1660 1568 -8.33333333333333e+00 +1660 1631 8.33333333333333e+00 +1660 1630 -3.75000000000000e+01 +1660 1335 8.33333333333333e+00 +1660 1659 -1.66666666666667e+01 +1660 1629 8.33333333333333e+00 +1660 1317 8.33333333333333e+00 +1660 1623 -8.33333333333333e+00 +1660 1778 4.16666666666667e+00 +1660 1520 -4.16666666666667e+00 +1660 1336 -1.25000000000000e+01 +1660 1776 4.16666666666667e+00 +1660 1518 -4.16666666666667e+00 +1660 1673 8.33333333333333e+00 +1660 1517 -8.33333333333333e+00 +1660 1587 4.16666666666667e+00 +1660 1672 -1.25000000000000e+01 +1660 1318 -1.25000000000000e+01 +1660 1671 -4.16666666666667e+00 +1660 1515 4.16666666666667e+00 +1661 1661 1.25000000000000e+02 +1661 1588 4.16666666666667e+00 +1661 1587 -8.33333333333333e+00 +1661 1595 -3.75000000000000e+01 +1661 1593 8.33333333333333e+00 +1661 1771 4.16666666666667e+00 +1661 1770 4.16666666666667e+00 +1661 1667 -1.25000000000000e+01 +1661 1666 8.33333333333333e+00 +1661 1665 -4.16666666666667e+00 +1661 1660 -1.66666666666667e+01 +1661 1318 -4.16666666666667e+00 +1661 1336 -4.16666666666667e+00 +1661 1624 4.16666666666667e+00 +1661 1558 -4.16666666666667e+00 +1661 1631 -1.25000000000000e+01 +1661 1567 -8.33333333333333e+00 +1661 1630 8.33333333333333e+00 +1661 1566 4.16666666666667e+00 +1661 1629 -4.16666666666667e+00 +1661 1557 -4.16666666666667e+00 +1661 1623 4.16666666666667e+00 +1661 1777 4.16666666666667e+00 +1661 1519 -4.16666666666667e+00 +1661 1518 -4.16666666666667e+00 +1661 1515 4.16666666666667e+00 +1661 1337 -1.25000000000000e+01 +1661 1335 8.33333333333333e+00 +1661 1776 -8.33333333333333e+00 +1661 1594 8.33333333333333e+00 +1661 1673 -3.75000000000000e+01 +1661 1319 -1.25000000000000e+01 +1661 1672 8.33333333333333e+00 +1661 1516 -8.33333333333333e+00 +1661 1659 -1.66666666666667e+01 +1661 1671 8.33333333333333e+00 +1661 1317 8.33333333333333e+00 +1662 1662 1.25000000000000e+02 +1662 1600 -4.16666666666667e+00 +1662 1601 8.33333333333333e+00 +1662 1589 4.16666666666667e+00 +1662 1599 -1.25000000000000e+01 +1662 1817 4.16666666666667e+00 +1662 1816 -8.33333333333333e+00 +1662 1667 8.33333333333333e+00 +1662 1666 8.33333333333333e+00 +1662 1665 -3.75000000000000e+01 +1662 1664 -1.66666666666667e+01 +1662 1349 -4.16666666666667e+00 +1662 1319 -4.16666666666667e+00 +1662 1577 -4.16666666666667e+00 +1662 1643 4.16666666666667e+00 +1662 1576 -4.16666666666667e+00 +1662 1585 4.16666666666667e+00 +1662 1586 -8.33333333333333e+00 +1662 1649 8.33333333333333e+00 +1662 1348 8.33333333333333e+00 +1662 1663 -1.66666666666667e+01 +1662 1648 8.33333333333333e+00 +1662 1647 -3.75000000000000e+01 +1662 1318 8.33333333333333e+00 +1662 1642 -8.33333333333333e+00 +1662 1523 -4.16666666666667e+00 +1662 1820 4.16666666666667e+00 +1662 1819 4.16666666666667e+00 +1662 1522 -4.16666666666667e+00 +1662 1347 -1.25000000000000e+01 +1662 1676 8.33333333333333e+00 +1662 1517 -8.33333333333333e+00 +1662 1675 -4.16666666666667e+00 +1662 1516 4.16666666666667e+00 +1662 1674 -1.25000000000000e+01 +1662 1588 4.16666666666667e+00 +1662 1317 -1.25000000000000e+01 +1663 1663 1.25000000000000e+02 +1663 1599 -4.16666666666667e+00 +1663 1589 -8.33333333333333e+00 +1663 1601 8.33333333333333e+00 +1663 1600 -1.25000000000000e+01 +1663 1817 4.16666666666667e+00 +1663 1815 -8.33333333333333e+00 +1663 1667 -4.16666666666667e+00 +1663 1666 -1.25000000000000e+01 +1663 1665 8.33333333333333e+00 +1663 1575 -4.16666666666667e+00 +1663 1584 4.16666666666667e+00 +1663 1586 4.16666666666667e+00 +1663 1649 -4.16666666666667e+00 +1663 1648 -1.25000000000000e+01 +1663 1347 8.33333333333333e+00 +1663 1662 -1.66666666666667e+01 +1663 1647 8.33333333333333e+00 +1663 1577 -4.16666666666667e+00 +1663 1643 4.16666666666667e+00 +1663 1317 8.33333333333333e+00 +1663 1641 -8.33333333333333e+00 +1663 1523 -4.16666666666667e+00 +1663 1517 4.16666666666667e+00 +1663 1820 -8.33333333333333e+00 +1663 1349 8.33333333333333e+00 +1663 1348 -3.75000000000000e+01 +1663 1818 4.16666666666667e+00 +1663 1521 -4.16666666666667e+00 +1663 1676 8.33333333333333e+00 +1663 1664 -1.66666666666667e+01 +1663 1319 8.33333333333333e+00 +1663 1675 -1.25000000000000e+01 +1663 1587 4.16666666666667e+00 +1663 1318 -3.75000000000000e+01 +1663 1674 -4.16666666666667e+00 +1663 1515 4.16666666666667e+00 +1664 1664 1.25000000000000e+02 +1664 1588 -8.33333333333333e+00 +1664 1587 4.16666666666667e+00 +1664 1601 -3.75000000000000e+01 +1664 1600 8.33333333333333e+00 +1664 1815 4.16666666666667e+00 +1664 1816 4.16666666666667e+00 +1664 1667 -1.25000000000000e+01 +1664 1666 -4.16666666666667e+00 +1664 1665 8.33333333333333e+00 +1664 1662 -1.66666666666667e+01 +1664 1347 -4.16666666666667e+00 +1664 1317 -4.16666666666667e+00 +1664 1575 -4.16666666666667e+00 +1664 1641 4.16666666666667e+00 +1664 1649 -1.25000000000000e+01 +1664 1585 4.16666666666667e+00 +1664 1648 -4.16666666666667e+00 +1664 1584 -8.33333333333333e+00 +1664 1647 8.33333333333333e+00 +1664 1576 -4.16666666666667e+00 +1664 1642 4.16666666666667e+00 +1664 1521 -4.16666666666667e+00 +1664 1818 4.16666666666667e+00 +1664 1522 -4.16666666666667e+00 +1664 1516 4.16666666666667e+00 +1664 1349 -1.25000000000000e+01 +1664 1819 -8.33333333333333e+00 +1664 1348 8.33333333333333e+00 +1664 1676 -3.75000000000000e+01 +1664 1599 8.33333333333333e+00 +1664 1319 -1.25000000000000e+01 +1664 1675 8.33333333333333e+00 +1664 1663 -1.66666666666667e+01 +1664 1318 8.33333333333333e+00 +1664 1674 8.33333333333333e+00 +1664 1515 -8.33333333333333e+00 +1665 1665 1.25000000000000e+02 +1665 1601 -8.33333333333333e+00 +1665 1817 -4.16666666666667e+00 +1665 1522 4.16666666666667e+00 +1665 1523 4.16666666666667e+00 +1665 1816 8.33333333333333e+00 +1665 1815 -1.25000000000000e+01 +1665 1664 8.33333333333333e+00 +1665 1663 8.33333333333333e+00 +1665 1662 -3.75000000000000e+01 +1665 1588 -4.16666666666667e+00 +1665 1589 -4.16666666666667e+00 +1665 1603 -4.16666666666667e+00 +1665 1594 4.16666666666667e+00 +1665 1595 4.16666666666667e+00 +1665 1604 8.33333333333333e+00 +1665 1667 -1.66666666666667e+01 +1665 1602 -1.25000000000000e+01 +1665 1516 -4.16666666666667e+00 +1665 1666 -1.66666666666667e+01 +1665 1772 8.33333333333333e+00 +1665 1525 -4.16666666666667e+00 +1665 1519 4.16666666666667e+00 +1665 1517 8.33333333333333e+00 +1665 1520 -8.33333333333333e+00 +1665 1355 4.16666666666667e+00 +1665 1526 -4.16666666666667e+00 +1665 1771 8.33333333333333e+00 +1665 1354 -8.33333333333333e+00 +1665 1770 -3.75000000000000e+01 +1665 1661 -4.16666666666667e+00 +1665 1319 4.16666666666667e+00 +1665 1660 8.33333333333333e+00 +1665 1318 -8.33333333333333e+00 +1665 1659 -1.25000000000000e+01 +1665 1600 4.16666666666667e+00 +1665 1515 -1.25000000000000e+01 +1666 1666 1.25000000000000e+02 +1666 1601 4.16666666666667e+00 +1666 1817 8.33333333333333e+00 +1666 1521 4.16666666666667e+00 +1666 1523 -8.33333333333333e+00 +1666 1816 -3.75000000000000e+01 +1666 1815 8.33333333333333e+00 +1666 1664 -4.16666666666667e+00 +1666 1663 -1.25000000000000e+01 +1666 1662 8.33333333333333e+00 +1666 1587 -4.16666666666667e+00 +1666 1604 8.33333333333333e+00 +1666 1602 -4.16666666666667e+00 +1666 1593 4.16666666666667e+00 +1666 1595 -8.33333333333333e+00 +1666 1355 4.16666666666667e+00 +1666 1603 -1.25000000000000e+01 +1666 1589 -4.16666666666667e+00 +1666 1319 4.16666666666667e+00 +1666 1515 -4.16666666666667e+00 +1666 1772 -4.16666666666667e+00 +1666 1665 -1.66666666666667e+01 +1666 1524 -4.16666666666667e+00 +1666 1518 4.16666666666667e+00 +1666 1526 -4.16666666666667e+00 +1666 1520 4.16666666666667e+00 +1666 1771 -1.25000000000000e+01 +1666 1770 8.33333333333333e+00 +1666 1353 -8.33333333333333e+00 +1666 1661 8.33333333333333e+00 +1666 1667 -1.66666666666667e+01 +1666 1517 8.33333333333333e+00 +1666 1660 -3.75000000000000e+01 +1666 1599 4.16666666666667e+00 +1666 1516 -1.25000000000000e+01 +1666 1659 8.33333333333333e+00 +1666 1317 -8.33333333333333e+00 +1667 1667 1.25000000000000e+02 +1667 1599 -8.33333333333333e+00 +1667 1815 -4.16666666666667e+00 +1667 1816 8.33333333333333e+00 +1667 1522 -8.33333333333333e+00 +1667 1521 4.16666666666667e+00 +1667 1817 -1.25000000000000e+01 +1667 1664 -1.25000000000000e+01 +1667 1663 -4.16666666666667e+00 +1667 1662 8.33333333333333e+00 +1667 1587 -4.16666666666667e+00 +1667 1603 8.33333333333333e+00 +1667 1594 -8.33333333333333e+00 +1667 1593 4.16666666666667e+00 +1667 1604 -3.75000000000000e+01 +1667 1354 4.16666666666667e+00 +1667 1602 8.33333333333333e+00 +1667 1665 -1.66666666666667e+01 +1667 1588 -4.16666666666667e+00 +1667 1318 4.16666666666667e+00 +1667 1771 -4.16666666666667e+00 +1667 1770 8.33333333333333e+00 +1667 1525 -4.16666666666667e+00 +1667 1519 4.16666666666667e+00 +1667 1515 8.33333333333333e+00 +1667 1518 -8.33333333333333e+00 +1667 1772 -1.25000000000000e+01 +1667 1353 4.16666666666667e+00 +1667 1524 -4.16666666666667e+00 +1667 1661 -1.25000000000000e+01 +1667 1600 4.16666666666667e+00 +1667 1517 -3.75000000000000e+01 +1667 1660 8.33333333333333e+00 +1667 1666 -1.66666666666667e+01 +1667 1516 8.33333333333333e+00 +1667 1659 -4.16666666666667e+00 +1667 1317 4.16666666666667e+00 +1668 1668 1.25000000000000e+02 +1668 1643 -8.33333333333333e+00 +1668 1642 4.16666666666667e+00 +1668 1655 8.33333333333333e+00 +1668 1653 -3.75000000000000e+01 +1668 1855 4.16666666666667e+00 +1668 1856 4.16666666666667e+00 +1668 1676 -4.16666666666667e+00 +1668 1675 8.33333333333333e+00 +1668 1674 -1.25000000000000e+01 +1668 1612 -4.16666666666667e+00 +1668 1613 -4.16666666666667e+00 +1668 1622 4.16666666666667e+00 +1668 1621 -8.33333333333333e+00 +1668 1625 4.16666666666667e+00 +1668 1637 -4.16666666666667e+00 +1668 1669 -1.66666666666667e+01 +1668 1636 8.33333333333333e+00 +1668 1624 4.16666666666667e+00 +1668 1318 -4.16666666666667e+00 +1668 1366 -4.16666666666667e+00 +1668 1635 -1.25000000000000e+01 +1668 1517 4.16666666666667e+00 +1668 1529 -4.16666666666667e+00 +1668 1852 4.16666666666667e+00 +1668 1528 -4.16666666666667e+00 +1668 1367 8.33333333333333e+00 +1668 1853 -8.33333333333333e+00 +1668 1365 -1.25000000000000e+01 +1668 1670 -1.66666666666667e+01 +1668 1673 8.33333333333333e+00 +1668 1319 8.33333333333333e+00 +1668 1672 8.33333333333333e+00 +1668 1516 -8.33333333333333e+00 +1668 1654 8.33333333333333e+00 +1668 1671 -3.75000000000000e+01 +1668 1317 -1.25000000000000e+01 +1669 1669 1.25000000000000e+02 +1669 1655 -4.16666666666667e+00 +1669 1653 8.33333333333333e+00 +1669 1641 4.16666666666667e+00 +1669 1654 -1.25000000000000e+01 +1669 1854 4.16666666666667e+00 +1669 1856 -8.33333333333333e+00 +1669 1676 8.33333333333333e+00 +1669 1675 -3.75000000000000e+01 +1669 1674 8.33333333333333e+00 +1669 1611 -4.16666666666667e+00 +1669 1613 -4.16666666666667e+00 +1669 1622 4.16666666666667e+00 +1669 1620 -8.33333333333333e+00 +1669 1668 -1.66666666666667e+01 +1669 1635 8.33333333333333e+00 +1669 1625 -8.33333333333333e+00 +1669 1319 8.33333333333333e+00 +1669 1623 4.16666666666667e+00 +1669 1317 -4.16666666666667e+00 +1669 1637 8.33333333333333e+00 +1669 1670 -1.66666666666667e+01 +1669 1367 8.33333333333333e+00 +1669 1636 -3.75000000000000e+01 +1669 1365 -4.16666666666667e+00 +1669 1851 4.16666666666667e+00 +1669 1527 -4.16666666666667e+00 +1669 1853 4.16666666666667e+00 +1669 1529 -4.16666666666667e+00 +1669 1366 -1.25000000000000e+01 +1669 1673 -4.16666666666667e+00 +1669 1517 4.16666666666667e+00 +1669 1643 4.16666666666667e+00 +1669 1672 -1.25000000000000e+01 +1669 1318 -1.25000000000000e+01 +1669 1671 8.33333333333333e+00 +1669 1515 -8.33333333333333e+00 +1670 1670 1.25000000000000e+02 +1670 1654 -4.16666666666667e+00 +1670 1641 -8.33333333333333e+00 +1670 1655 -1.25000000000000e+01 +1670 1653 8.33333333333333e+00 +1670 1855 -8.33333333333333e+00 +1670 1854 4.16666666666667e+00 +1670 1676 -1.25000000000000e+01 +1670 1675 8.33333333333333e+00 +1670 1674 -4.16666666666667e+00 +1670 1612 -4.16666666666667e+00 +1670 1621 4.16666666666667e+00 +1670 1611 -4.16666666666667e+00 +1670 1620 4.16666666666667e+00 +1670 1623 4.16666666666667e+00 +1670 1635 -4.16666666666667e+00 +1670 1624 -8.33333333333333e+00 +1670 1318 8.33333333333333e+00 +1670 1637 -1.25000000000000e+01 +1670 1636 8.33333333333333e+00 +1670 1669 -1.66666666666667e+01 +1670 1366 8.33333333333333e+00 +1670 1515 4.16666666666667e+00 +1670 1527 -4.16666666666667e+00 +1670 1367 -3.75000000000000e+01 +1670 1852 4.16666666666667e+00 +1670 1528 -4.16666666666667e+00 +1670 1365 8.33333333333333e+00 +1670 1851 -8.33333333333333e+00 +1670 1642 4.16666666666667e+00 +1670 1673 -1.25000000000000e+01 +1670 1319 -3.75000000000000e+01 +1670 1672 -4.16666666666667e+00 +1670 1516 4.16666666666667e+00 +1670 1668 -1.66666666666667e+01 +1670 1671 8.33333333333333e+00 +1670 1317 8.33333333333333e+00 +1671 1671 1.25000000000000e+02 +1671 1630 4.16666666666667e+00 +1671 1777 8.33333333333333e+00 +1671 1520 4.16666666666667e+00 +1671 1519 -8.33333333333333e+00 +1671 1778 8.33333333333333e+00 +1671 1776 -3.75000000000000e+01 +1671 1661 8.33333333333333e+00 +1671 1660 -4.16666666666667e+00 +1671 1659 -1.25000000000000e+01 +1671 1625 -4.16666666666667e+00 +1671 1640 -4.16666666666667e+00 +1671 1637 4.16666666666667e+00 +1671 1639 8.33333333333333e+00 +1671 1636 -8.33333333333333e+00 +1671 1372 4.16666666666667e+00 +1671 1638 -1.25000000000000e+01 +1671 1624 -4.16666666666667e+00 +1671 1318 4.16666666666667e+00 +1671 1517 -4.16666666666667e+00 +1671 1673 -1.66666666666667e+01 +1671 1852 -4.16666666666667e+00 +1671 1532 -4.16666666666667e+00 +1671 1529 4.16666666666667e+00 +1671 1531 -4.16666666666667e+00 +1671 1528 4.16666666666667e+00 +1671 1853 8.33333333333333e+00 +1671 1373 -8.33333333333333e+00 +1671 1851 -1.25000000000000e+01 +1671 1670 8.33333333333333e+00 +1671 1319 -8.33333333333333e+00 +1671 1669 8.33333333333333e+00 +1671 1672 -1.66666666666667e+01 +1671 1516 8.33333333333333e+00 +1671 1668 -3.75000000000000e+01 +1671 1631 4.16666666666667e+00 +1671 1515 -1.25000000000000e+01 +1672 1672 1.25000000000000e+02 +1672 1629 4.16666666666667e+00 +1672 1778 -4.16666666666667e+00 +1672 1520 4.16666666666667e+00 +1672 1776 8.33333333333333e+00 +1672 1518 -8.33333333333333e+00 +1672 1777 -1.25000000000000e+01 +1672 1661 8.33333333333333e+00 +1672 1660 -1.25000000000000e+01 +1672 1659 -4.16666666666667e+00 +1672 1625 -4.16666666666667e+00 +1672 1638 8.33333333333333e+00 +1672 1637 4.16666666666667e+00 +1672 1635 -8.33333333333333e+00 +1672 1640 8.33333333333333e+00 +1672 1673 -1.66666666666667e+01 +1672 1639 -3.75000000000000e+01 +1672 1371 4.16666666666667e+00 +1672 1623 -4.16666666666667e+00 +1672 1317 4.16666666666667e+00 +1672 1851 -4.16666666666667e+00 +1672 1853 8.33333333333333e+00 +1672 1517 8.33333333333333e+00 +1672 1529 -8.33333333333333e+00 +1672 1530 -4.16666666666667e+00 +1672 1527 4.16666666666667e+00 +1672 1373 4.16666666666667e+00 +1672 1532 -4.16666666666667e+00 +1672 1852 -1.25000000000000e+01 +1672 1670 -4.16666666666667e+00 +1672 1319 4.16666666666667e+00 +1672 1669 -1.25000000000000e+01 +1672 1631 -8.33333333333333e+00 +1672 1516 -3.75000000000000e+01 +1672 1668 8.33333333333333e+00 +1672 1671 -1.66666666666667e+01 +1672 1515 8.33333333333333e+00 +1673 1673 1.25000000000000e+02 +1673 1630 -8.33333333333333e+00 +1673 1777 -4.16666666666667e+00 +1673 1519 4.16666666666667e+00 +1673 1518 4.16666666666667e+00 +1673 1778 -1.25000000000000e+01 +1673 1776 8.33333333333333e+00 +1673 1661 -3.75000000000000e+01 +1673 1660 8.33333333333333e+00 +1673 1659 8.33333333333333e+00 +1673 1623 -4.16666666666667e+00 +1673 1624 -4.16666666666667e+00 +1673 1638 -4.16666666666667e+00 +1673 1635 4.16666666666667e+00 +1673 1636 4.16666666666667e+00 +1673 1640 -1.25000000000000e+01 +1673 1639 8.33333333333333e+00 +1673 1672 -1.66666666666667e+01 +1673 1515 -4.16666666666667e+00 +1673 1671 -1.66666666666667e+01 +1673 1852 8.33333333333333e+00 +1673 1530 -4.16666666666667e+00 +1673 1527 4.16666666666667e+00 +1673 1516 8.33333333333333e+00 +1673 1528 -8.33333333333333e+00 +1673 1853 -3.75000000000000e+01 +1673 1372 4.16666666666667e+00 +1673 1531 -4.16666666666667e+00 +1673 1851 8.33333333333333e+00 +1673 1371 -8.33333333333333e+00 +1673 1670 -1.25000000000000e+01 +1673 1629 4.16666666666667e+00 +1673 1517 -1.25000000000000e+01 +1673 1669 -4.16666666666667e+00 +1673 1318 4.16666666666667e+00 +1673 1668 8.33333333333333e+00 +1673 1317 -8.33333333333333e+00 +1674 1674 1.25000000000000e+02 +1674 1648 4.16666666666667e+00 +1674 1523 4.16666666666667e+00 +1674 1820 -4.16666666666667e+00 +1674 1819 8.33333333333333e+00 +1674 1522 -8.33333333333333e+00 +1674 1818 -1.25000000000000e+01 +1674 1664 8.33333333333333e+00 +1674 1663 -4.16666666666667e+00 +1674 1662 -1.25000000000000e+01 +1674 1643 -4.16666666666667e+00 +1674 1657 8.33333333333333e+00 +1674 1655 4.16666666666667e+00 +1674 1654 -8.33333333333333e+00 +1674 1658 8.33333333333333e+00 +1674 1676 -1.66666666666667e+01 +1674 1378 4.16666666666667e+00 +1674 1656 -3.75000000000000e+01 +1674 1642 -4.16666666666667e+00 +1674 1318 4.16666666666667e+00 +1674 1855 -4.16666666666667e+00 +1674 1856 8.33333333333333e+00 +1674 1517 8.33333333333333e+00 +1674 1529 -8.33333333333333e+00 +1674 1534 -4.16666666666667e+00 +1674 1528 4.16666666666667e+00 +1674 1379 4.16666666666667e+00 +1674 1535 -4.16666666666667e+00 +1674 1854 -1.25000000000000e+01 +1674 1670 -4.16666666666667e+00 +1674 1319 4.16666666666667e+00 +1674 1675 -1.66666666666667e+01 +1674 1669 8.33333333333333e+00 +1674 1516 8.33333333333333e+00 +1674 1649 -8.33333333333333e+00 +1674 1668 -1.25000000000000e+01 +1674 1515 -3.75000000000000e+01 +1675 1675 1.25000000000000e+02 +1675 1647 4.16666666666667e+00 +1675 1818 8.33333333333333e+00 +1675 1523 4.16666666666667e+00 +1675 1521 -8.33333333333333e+00 +1675 1820 8.33333333333333e+00 +1675 1819 -3.75000000000000e+01 +1675 1664 8.33333333333333e+00 +1675 1663 -1.25000000000000e+01 +1675 1662 -4.16666666666667e+00 +1675 1643 -4.16666666666667e+00 +1675 1658 -4.16666666666667e+00 +1675 1655 4.16666666666667e+00 +1675 1656 8.33333333333333e+00 +1675 1653 -8.33333333333333e+00 +1675 1657 -1.25000000000000e+01 +1675 1377 4.16666666666667e+00 +1675 1641 -4.16666666666667e+00 +1675 1317 4.16666666666667e+00 +1675 1517 -4.16666666666667e+00 +1675 1676 -1.66666666666667e+01 +1675 1854 -4.16666666666667e+00 +1675 1535 -4.16666666666667e+00 +1675 1529 4.16666666666667e+00 +1675 1533 -4.16666666666667e+00 +1675 1527 4.16666666666667e+00 +1675 1379 -8.33333333333333e+00 +1675 1856 8.33333333333333e+00 +1675 1855 -1.25000000000000e+01 +1675 1670 8.33333333333333e+00 +1675 1319 -8.33333333333333e+00 +1675 1649 4.16666666666667e+00 +1675 1669 -3.75000000000000e+01 +1675 1516 -1.25000000000000e+01 +1675 1674 -1.66666666666667e+01 +1675 1668 8.33333333333333e+00 +1675 1515 8.33333333333333e+00 +1676 1676 1.25000000000000e+02 +1676 1647 -8.33333333333333e+00 +1676 1521 4.16666666666667e+00 +1676 1818 -4.16666666666667e+00 +1676 1522 4.16666666666667e+00 +1676 1820 -1.25000000000000e+01 +1676 1819 8.33333333333333e+00 +1676 1664 -3.75000000000000e+01 +1676 1663 8.33333333333333e+00 +1676 1662 8.33333333333333e+00 +1676 1642 -4.16666666666667e+00 +1676 1641 -4.16666666666667e+00 +1676 1657 -4.16666666666667e+00 +1676 1654 4.16666666666667e+00 +1676 1653 4.16666666666667e+00 +1676 1658 -1.25000000000000e+01 +1676 1656 8.33333333333333e+00 +1676 1674 -1.66666666666667e+01 +1676 1516 -4.16666666666667e+00 +1676 1675 -1.66666666666667e+01 +1676 1534 -4.16666666666667e+00 +1676 1528 4.16666666666667e+00 +1676 1854 8.33333333333333e+00 +1676 1515 8.33333333333333e+00 +1676 1527 -8.33333333333333e+00 +1676 1856 -3.75000000000000e+01 +1676 1378 -8.33333333333333e+00 +1676 1855 8.33333333333333e+00 +1676 1377 4.16666666666667e+00 +1676 1533 -4.16666666666667e+00 +1676 1648 4.16666666666667e+00 +1676 1670 -1.25000000000000e+01 +1676 1517 -1.25000000000000e+01 +1676 1669 8.33333333333333e+00 +1676 1318 -8.33333333333333e+00 +1676 1668 -4.16666666666667e+00 +1676 1317 4.16666666666667e+00 +1677 1677 6.25000000000000e+01 +1677 1721 -4.16666666666667e+00 +1677 1693 4.16666666666667e+00 +1677 1720 -4.16666666666667e+00 +1677 1717 -4.16666666666667e+00 +1677 1688 4.16666666666667e+00 +1677 1694 -8.33333333333333e+00 +1677 1687 4.16666666666667e+00 +1677 1686 -1.87500000000000e+01 +1677 1415 4.16666666666667e+00 +1677 1679 -8.33333333333333e+00 +1677 1685 8.33333333333333e+00 +1677 1714 4.16666666666667e+00 +1677 1684 -4.16666666666667e+00 +1677 1322 -2.08333333333333e+00 +1677 1409 2.08333333333333e+00 +1677 1321 4.16666666666667e+00 +1677 1408 -4.16666666666667e+00 +1677 1320 -6.25000000000000e+00 +1677 1683 -1.25000000000000e+01 +1677 1328 -2.08333333333333e+00 +1677 1715 4.16666666666667e+00 +1677 1678 -8.33333333333333e+00 +1677 1327 4.16666666666667e+00 +1677 1414 4.16666666666667e+00 +1677 1718 2.08333333333333e+00 +1677 1326 -6.25000000000000e+00 +1677 1413 -1.87500000000000e+01 +1678 1678 6.25000000000000e+01 +1678 1719 -4.16666666666667e+00 +1678 1718 2.08333333333333e+00 +1678 1721 -4.16666666666667e+00 +1678 1716 -4.16666666666667e+00 +1678 1688 -2.08333333333333e+00 +1678 1694 4.16666666666667e+00 +1678 1687 -6.25000000000000e+00 +1678 1686 4.16666666666667e+00 +1678 1415 -2.08333333333333e+00 +1678 1409 2.08333333333333e+00 +1678 1713 4.16666666666667e+00 +1678 1683 -4.16666666666667e+00 +1678 1322 4.16666666666667e+00 +1678 1679 -8.33333333333333e+00 +1678 1685 8.33333333333333e+00 +1678 1321 -1.87500000000000e+01 +1678 1684 -1.25000000000000e+01 +1678 1320 4.16666666666667e+00 +1678 1407 -4.16666666666667e+00 +1678 1328 4.16666666666667e+00 +1678 1715 -8.33333333333333e+00 +1678 1692 4.16666666666667e+00 +1678 1327 -1.87500000000000e+01 +1678 1414 -6.25000000000000e+00 +1678 1677 -8.33333333333333e+00 +1678 1326 4.16666666666667e+00 +1678 1413 4.16666666666667e+00 +1679 1679 6.25000000000000e+01 +1679 1719 -4.16666666666667e+00 +1679 1717 2.08333333333333e+00 +1679 1720 -4.16666666666667e+00 +1679 1688 -6.25000000000000e+00 +1679 1687 -2.08333333333333e+00 +1679 1693 4.16666666666667e+00 +1679 1686 4.16666666666667e+00 +1679 1692 -8.33333333333333e+00 +1679 1414 -2.08333333333333e+00 +1679 1408 2.08333333333333e+00 +1679 1413 4.16666666666667e+00 +1679 1677 -8.33333333333333e+00 +1679 1683 8.33333333333333e+00 +1679 1322 -6.25000000000000e+00 +1679 1685 -3.75000000000000e+01 +1679 1321 4.16666666666667e+00 +1679 1678 -8.33333333333333e+00 +1679 1684 8.33333333333333e+00 +1679 1320 -2.08333333333333e+00 +1679 1407 2.08333333333333e+00 +1679 1716 2.08333333333333e+00 +1679 1328 -6.25000000000000e+00 +1679 1415 -6.25000000000000e+00 +1679 1327 4.16666666666667e+00 +1679 1714 -8.33333333333333e+00 +1679 1326 -2.08333333333333e+00 +1679 1713 4.16666666666667e+00 +1680 1680 6.25000000000000e+01 +1680 1691 4.16666666666667e+00 +1680 1690 4.16666666666667e+00 +1680 1689 -1.87500000000000e+01 +1680 1754 -4.16666666666667e+00 +1680 1756 -4.16666666666667e+00 +1680 1694 4.16666666666667e+00 +1680 1693 -8.33333333333333e+00 +1680 1757 -4.16666666666667e+00 +1680 1751 4.16666666666667e+00 +1680 1685 -4.16666666666667e+00 +1680 1681 -8.33333333333333e+00 +1680 1684 8.33333333333333e+00 +1680 1420 4.16666666666667e+00 +1680 1322 4.16666666666667e+00 +1680 1409 -4.16666666666667e+00 +1680 1321 -2.08333333333333e+00 +1680 1408 2.08333333333333e+00 +1680 1320 -6.25000000000000e+00 +1680 1683 -1.25000000000000e+01 +1680 1682 -8.33333333333333e+00 +1680 1334 4.16666666666667e+00 +1680 1421 4.16666666666667e+00 +1680 1333 -2.08333333333333e+00 +1680 1750 4.16666666666667e+00 +1680 1753 2.08333333333333e+00 +1680 1332 -6.25000000000000e+00 +1680 1419 -1.87500000000000e+01 +1681 1681 6.25000000000000e+01 +1681 1691 -2.08333333333333e+00 +1681 1690 -6.25000000000000e+00 +1681 1689 4.16666666666667e+00 +1681 1754 2.08333333333333e+00 +1681 1694 4.16666666666667e+00 +1681 1757 -4.16666666666667e+00 +1681 1755 -4.16666666666667e+00 +1681 1692 -8.33333333333333e+00 +1681 1409 2.08333333333333e+00 +1681 1421 -2.08333333333333e+00 +1681 1680 -8.33333333333333e+00 +1681 1683 8.33333333333333e+00 +1681 1419 4.16666666666667e+00 +1681 1322 4.16666666666667e+00 +1681 1682 -8.33333333333333e+00 +1681 1685 8.33333333333333e+00 +1681 1321 -6.25000000000000e+00 +1681 1684 -3.75000000000000e+01 +1681 1320 -2.08333333333333e+00 +1681 1407 2.08333333333333e+00 +1681 1334 4.16666666666667e+00 +1681 1751 -8.33333333333333e+00 +1681 1752 2.08333333333333e+00 +1681 1333 -6.25000000000000e+00 +1681 1420 -6.25000000000000e+00 +1681 1332 -2.08333333333333e+00 +1681 1749 4.16666666666667e+00 +1682 1682 6.25000000000000e+01 +1682 1690 -2.08333333333333e+00 +1682 1689 4.16666666666667e+00 +1682 1753 2.08333333333333e+00 +1682 1752 -4.16666666666667e+00 +1682 1693 4.16666666666667e+00 +1682 1756 -4.16666666666667e+00 +1682 1692 4.16666666666667e+00 +1682 1755 -4.16666666666667e+00 +1682 1749 4.16666666666667e+00 +1682 1683 -4.16666666666667e+00 +1682 1408 2.08333333333333e+00 +1682 1420 -2.08333333333333e+00 +1682 1322 -1.87500000000000e+01 +1682 1685 -1.25000000000000e+01 +1682 1321 4.16666666666667e+00 +1682 1681 -8.33333333333333e+00 +1682 1684 8.33333333333333e+00 +1682 1320 4.16666666666667e+00 +1682 1407 -4.16666666666667e+00 +1682 1691 -6.25000000000000e+00 +1682 1334 -1.87500000000000e+01 +1682 1421 -6.25000000000000e+00 +1682 1333 4.16666666666667e+00 +1682 1750 -8.33333333333333e+00 +1682 1680 -8.33333333333333e+00 +1682 1332 4.16666666666667e+00 +1682 1419 4.16666666666667e+00 +1683 1683 1.25000000000000e+02 +1683 1720 -8.33333333333333e+00 +1683 1679 8.33333333333333e+00 +1683 1414 4.16666666666667e+00 +1683 1678 -4.16666666666667e+00 +1683 1415 -8.33333333333333e+00 +1683 1677 -1.25000000000000e+01 +1683 1715 -4.16666666666667e+00 +1683 1714 8.33333333333333e+00 +1683 1713 -1.25000000000000e+01 +1683 1786 -4.16666666666667e+00 +1683 1694 8.33333333333333e+00 +1683 1757 -8.33333333333333e+00 +1683 1756 4.16666666666667e+00 +1683 1322 4.16666666666667e+00 +1683 1693 8.33333333333333e+00 +1683 1684 -1.66666666666667e+01 +1683 1692 -3.75000000000000e+01 +1683 1787 -4.16666666666667e+00 +1683 1340 4.16666666666667e+00 +1683 1682 -4.16666666666667e+00 +1683 1681 8.33333333333333e+00 +1683 1409 -4.16666666666667e+00 +1683 1421 4.16666666666667e+00 +1683 1426 8.33333333333333e+00 +1683 1420 -8.33333333333333e+00 +1683 1321 4.16666666666667e+00 +1683 1408 -4.16666666666667e+00 +1683 1680 -1.25000000000000e+01 +1683 1685 -1.66666666666667e+01 +1683 1751 8.33333333333333e+00 +1683 1427 8.33333333333333e+00 +1683 1750 -4.16666666666667e+00 +1683 1339 4.16666666666667e+00 +1683 1721 4.16666666666667e+00 +1683 1749 -1.25000000000000e+01 +1683 1425 -3.75000000000000e+01 +1684 1684 1.25000000000000e+02 +1684 1719 -8.33333333333333e+00 +1684 1413 4.16666666666667e+00 +1684 1677 -4.16666666666667e+00 +1684 1415 4.16666666666667e+00 +1684 1679 8.33333333333333e+00 +1684 1678 -1.25000000000000e+01 +1684 1715 8.33333333333333e+00 +1684 1714 -3.75000000000000e+01 +1684 1713 8.33333333333333e+00 +1684 1787 -4.16666666666667e+00 +1684 1785 -4.16666666666667e+00 +1684 1694 -4.16666666666667e+00 +1684 1757 4.16666666666667e+00 +1684 1755 4.16666666666667e+00 +1684 1693 -1.25000000000000e+01 +1684 1692 8.33333333333333e+00 +1684 1683 -1.66666666666667e+01 +1684 1427 -4.16666666666667e+00 +1684 1685 -1.66666666666667e+01 +1684 1409 -4.16666666666667e+00 +1684 1421 4.16666666666667e+00 +1684 1680 8.33333333333333e+00 +1684 1425 8.33333333333333e+00 +1684 1419 -8.33333333333333e+00 +1684 1322 -8.33333333333333e+00 +1684 1682 8.33333333333333e+00 +1684 1681 -3.75000000000000e+01 +1684 1320 4.16666666666667e+00 +1684 1407 -4.16666666666667e+00 +1684 1751 8.33333333333333e+00 +1684 1340 -8.33333333333333e+00 +1684 1721 4.16666666666667e+00 +1684 1750 -1.25000000000000e+01 +1684 1426 -1.25000000000000e+01 +1684 1749 -4.16666666666667e+00 +1684 1338 4.16666666666667e+00 +1685 1685 1.25000000000000e+02 +1685 1719 4.16666666666667e+00 +1685 1677 8.33333333333333e+00 +1685 1414 4.16666666666667e+00 +1685 1413 -8.33333333333333e+00 +1685 1679 -3.75000000000000e+01 +1685 1678 8.33333333333333e+00 +1685 1715 -1.25000000000000e+01 +1685 1714 8.33333333333333e+00 +1685 1713 -4.16666666666667e+00 +1685 1786 -4.16666666666667e+00 +1685 1693 -4.16666666666667e+00 +1685 1756 4.16666666666667e+00 +1685 1692 8.33333333333333e+00 +1685 1755 -8.33333333333333e+00 +1685 1694 -1.25000000000000e+01 +1685 1320 4.16666666666667e+00 +1685 1785 -4.16666666666667e+00 +1685 1338 4.16666666666667e+00 +1685 1426 -4.16666666666667e+00 +1685 1684 -1.66666666666667e+01 +1685 1680 -4.16666666666667e+00 +1685 1408 -4.16666666666667e+00 +1685 1420 4.16666666666667e+00 +1685 1407 -4.16666666666667e+00 +1685 1419 4.16666666666667e+00 +1685 1682 -1.25000000000000e+01 +1685 1321 -8.33333333333333e+00 +1685 1681 8.33333333333333e+00 +1685 1720 4.16666666666667e+00 +1685 1751 -3.75000000000000e+01 +1685 1427 -1.25000000000000e+01 +1685 1750 8.33333333333333e+00 +1685 1339 -8.33333333333333e+00 +1685 1683 -1.66666666666667e+01 +1685 1749 8.33333333333333e+00 +1685 1425 8.33333333333333e+00 +1686 1686 6.25000000000000e+01 +1686 1720 4.16666666666667e+00 +1686 1721 4.16666666666667e+00 +1686 1679 4.16666666666667e+00 +1686 1688 -8.33333333333333e+00 +1686 1678 4.16666666666667e+00 +1686 1677 -1.87500000000000e+01 +1686 1717 4.16666666666667e+00 +1686 1716 -6.25000000000000e+00 +1686 1693 -4.16666666666667e+00 +1686 1687 -8.33333333333333e+00 +1686 1694 8.33333333333333e+00 +1686 1430 -2.08333333333333e+00 +1686 1322 2.08333333333333e+00 +1686 1429 4.16666666666667e+00 +1686 1321 -4.16666666666667e+00 +1686 1428 -6.25000000000000e+00 +1686 1718 -2.08333333333333e+00 +1686 1692 -1.25000000000000e+01 +1686 140 4.16666666666667e+00 +1686 355 -4.16666666666667e+00 +1686 151 4.16666666666667e+00 +1686 152 -8.33333333333333e+00 +1686 41 2.08333333333333e+00 +1686 356 -4.16666666666667e+00 +1686 139 4.16666666666667e+00 +1686 40 -4.16666666666667e+00 +1686 138 -1.87500000000000e+01 +1687 1687 6.25000000000000e+01 +1687 1719 4.16666666666667e+00 +1687 1721 -8.33333333333333e+00 +1687 1679 -2.08333333333333e+00 +1687 1322 2.08333333333333e+00 +1687 1678 -6.25000000000000e+00 +1687 1677 4.16666666666667e+00 +1687 1717 -1.87500000000000e+01 +1687 1716 4.16666666666667e+00 +1687 1692 -4.16666666666667e+00 +1687 1686 -8.33333333333333e+00 +1687 1430 4.16666666666667e+00 +1687 1688 -8.33333333333333e+00 +1687 1694 8.33333333333333e+00 +1687 1429 -1.87500000000000e+01 +1687 1718 4.16666666666667e+00 +1687 1693 -1.25000000000000e+01 +1687 1428 4.16666666666667e+00 +1687 1320 -4.16666666666667e+00 +1687 41 2.08333333333333e+00 +1687 140 -2.08333333333333e+00 +1687 354 -4.16666666666667e+00 +1687 150 4.16666666666667e+00 +1687 356 -4.16666666666667e+00 +1687 152 4.16666666666667e+00 +1687 139 -6.25000000000000e+00 +1687 138 4.16666666666667e+00 +1687 39 -4.16666666666667e+00 +1688 1688 6.25000000000000e+01 +1688 1716 -2.08333333333333e+00 +1688 1720 -8.33333333333333e+00 +1688 1719 4.16666666666667e+00 +1688 1679 -6.25000000000000e+00 +1688 1678 -2.08333333333333e+00 +1688 1321 2.08333333333333e+00 +1688 1677 4.16666666666667e+00 +1688 1686 -8.33333333333333e+00 +1688 1718 -6.25000000000000e+00 +1688 1692 8.33333333333333e+00 +1688 1430 -6.25000000000000e+00 +1688 1717 4.16666666666667e+00 +1688 1694 -3.75000000000000e+01 +1688 1429 4.16666666666667e+00 +1688 1687 -8.33333333333333e+00 +1688 1693 8.33333333333333e+00 +1688 1428 -2.08333333333333e+00 +1688 1320 2.08333333333333e+00 +1688 40 2.08333333333333e+00 +1688 139 -2.08333333333333e+00 +1688 138 4.16666666666667e+00 +1688 355 -4.16666666666667e+00 +1688 151 4.16666666666667e+00 +1688 150 -8.33333333333333e+00 +1688 140 -6.25000000000000e+00 +1688 39 2.08333333333333e+00 +1688 354 -4.16666666666667e+00 +1689 1689 6.25000000000000e+01 +1689 1753 -2.08333333333333e+00 +1689 1756 4.16666666666667e+00 +1689 1754 4.16666666666667e+00 +1689 1752 -6.25000000000000e+00 +1689 1682 4.16666666666667e+00 +1689 1690 -8.33333333333333e+00 +1689 1681 4.16666666666667e+00 +1689 1680 -1.87500000000000e+01 +1689 1691 -8.33333333333333e+00 +1689 1694 -4.16666666666667e+00 +1689 1693 8.33333333333333e+00 +1689 1430 4.16666666666667e+00 +1689 1322 -4.16666666666667e+00 +1689 1429 -2.08333333333333e+00 +1689 1321 2.08333333333333e+00 +1689 1428 -6.25000000000000e+00 +1689 1757 4.16666666666667e+00 +1689 1692 -1.25000000000000e+01 +1689 392 -4.16666666666667e+00 +1689 145 4.16666666666667e+00 +1689 152 4.16666666666667e+00 +1689 151 -8.33333333333333e+00 +1689 146 4.16666666666667e+00 +1689 47 -4.16666666666667e+00 +1689 46 2.08333333333333e+00 +1689 391 -4.16666666666667e+00 +1689 144 -1.87500000000000e+01 +1690 1690 6.25000000000000e+01 +1690 1757 -8.33333333333333e+00 +1690 1752 -2.08333333333333e+00 +1690 1755 4.16666666666667e+00 +1690 1753 -6.25000000000000e+00 +1690 1322 2.08333333333333e+00 +1690 1682 -2.08333333333333e+00 +1690 1681 -6.25000000000000e+00 +1690 1689 -8.33333333333333e+00 +1690 1680 4.16666666666667e+00 +1690 1692 8.33333333333333e+00 +1690 1430 4.16666666666667e+00 +1690 1691 -8.33333333333333e+00 +1690 1694 8.33333333333333e+00 +1690 1429 -6.25000000000000e+00 +1690 1754 4.16666666666667e+00 +1690 1693 -3.75000000000000e+01 +1690 1428 -2.08333333333333e+00 +1690 1320 2.08333333333333e+00 +1690 47 2.08333333333333e+00 +1690 392 -4.16666666666667e+00 +1690 146 -2.08333333333333e+00 +1690 152 4.16666666666667e+00 +1690 144 4.16666666666667e+00 +1690 150 -8.33333333333333e+00 +1690 145 -6.25000000000000e+00 +1690 45 2.08333333333333e+00 +1690 390 -4.16666666666667e+00 +1691 1691 6.25000000000000e+01 +1691 1753 4.16666666666667e+00 +1691 1756 -8.33333333333333e+00 +1691 1754 -1.87500000000000e+01 +1691 1752 4.16666666666667e+00 +1691 1682 -6.25000000000000e+00 +1691 1321 2.08333333333333e+00 +1691 1681 -2.08333333333333e+00 +1691 1680 4.16666666666667e+00 +1691 1689 -8.33333333333333e+00 +1691 1692 -4.16666666666667e+00 +1691 1430 -1.87500000000000e+01 +1691 1755 4.16666666666667e+00 +1691 1694 -1.25000000000000e+01 +1691 1429 4.16666666666667e+00 +1691 1690 -8.33333333333333e+00 +1691 1693 8.33333333333333e+00 +1691 1428 4.16666666666667e+00 +1691 1320 -4.16666666666667e+00 +1691 46 2.08333333333333e+00 +1691 391 -4.16666666666667e+00 +1691 390 -4.16666666666667e+00 +1691 145 -2.08333333333333e+00 +1691 151 4.16666666666667e+00 +1691 150 4.16666666666667e+00 +1691 146 -6.25000000000000e+00 +1691 144 4.16666666666667e+00 +1691 45 -4.16666666666667e+00 +1692 1692 1.25000000000000e+02 +1692 1721 -4.16666666666667e+00 +1692 1679 -8.33333333333333e+00 +1692 1720 8.33333333333333e+00 +1692 1719 -1.25000000000000e+01 +1692 1687 -4.16666666666667e+00 +1692 1688 8.33333333333333e+00 +1692 1686 -1.25000000000000e+01 +1692 1786 4.16666666666667e+00 +1692 1756 -4.16666666666667e+00 +1692 1694 -1.66666666666667e+01 +1692 1685 8.33333333333333e+00 +1692 1757 8.33333333333333e+00 +1692 1322 -4.16666666666667e+00 +1692 1682 4.16666666666667e+00 +1692 1684 8.33333333333333e+00 +1692 1681 -8.33333333333333e+00 +1692 1683 -3.75000000000000e+01 +1692 1787 4.16666666666667e+00 +1692 1755 -1.25000000000000e+01 +1692 1430 4.16666666666667e+00 +1692 1691 -4.16666666666667e+00 +1692 1693 -1.66666666666667e+01 +1692 1690 8.33333333333333e+00 +1692 1429 4.16666666666667e+00 +1692 1321 -4.16666666666667e+00 +1692 1689 -1.25000000000000e+01 +1692 1678 4.16666666666667e+00 +1692 356 4.16666666666667e+00 +1692 355 -8.33333333333333e+00 +1692 53 -4.16666666666667e+00 +1692 151 8.33333333333333e+00 +1692 152 8.33333333333333e+00 +1692 392 -8.33333333333333e+00 +1692 391 4.16666666666667e+00 +1692 52 -4.16666666666667e+00 +1692 150 -3.75000000000000e+01 +1693 1693 1.25000000000000e+02 +1693 1721 8.33333333333333e+00 +1693 1679 4.16666666666667e+00 +1693 1720 -3.75000000000000e+01 +1693 1719 8.33333333333333e+00 +1693 1686 -4.16666666666667e+00 +1693 1688 8.33333333333333e+00 +1693 1687 -1.25000000000000e+01 +1693 1694 -1.66666666666667e+01 +1693 1322 -4.16666666666667e+00 +1693 1785 4.16666666666667e+00 +1693 1755 -4.16666666666667e+00 +1693 1685 -4.16666666666667e+00 +1693 1682 4.16666666666667e+00 +1693 1684 -1.25000000000000e+01 +1693 1683 8.33333333333333e+00 +1693 1680 -8.33333333333333e+00 +1693 1787 -8.33333333333333e+00 +1693 1757 8.33333333333333e+00 +1693 1756 -1.25000000000000e+01 +1693 1692 -1.66666666666667e+01 +1693 1689 8.33333333333333e+00 +1693 1430 -8.33333333333333e+00 +1693 1691 8.33333333333333e+00 +1693 1690 -3.75000000000000e+01 +1693 1677 4.16666666666667e+00 +1693 1428 4.16666666666667e+00 +1693 1320 -4.16666666666667e+00 +1693 356 4.16666666666667e+00 +1693 354 -8.33333333333333e+00 +1693 53 -4.16666666666667e+00 +1693 152 -4.16666666666667e+00 +1693 392 4.16666666666667e+00 +1693 150 8.33333333333333e+00 +1693 151 -1.25000000000000e+01 +1693 390 4.16666666666667e+00 +1693 51 -4.16666666666667e+00 +1694 1694 1.25000000000000e+02 +1694 1719 -4.16666666666667e+00 +1694 1678 4.16666666666667e+00 +1694 1677 -8.33333333333333e+00 +1694 1721 -1.25000000000000e+01 +1694 1686 8.33333333333333e+00 +1694 1688 -3.75000000000000e+01 +1694 1687 8.33333333333333e+00 +1694 1693 -1.66666666666667e+01 +1694 1321 -4.16666666666667e+00 +1694 1684 -4.16666666666667e+00 +1694 1681 4.16666666666667e+00 +1694 1692 -1.66666666666667e+01 +1694 1683 8.33333333333333e+00 +1694 1755 8.33333333333333e+00 +1694 1685 -1.25000000000000e+01 +1694 1320 -4.16666666666667e+00 +1694 1680 4.16666666666667e+00 +1694 1757 -3.75000000000000e+01 +1694 1786 -8.33333333333333e+00 +1694 1756 8.33333333333333e+00 +1694 1785 4.16666666666667e+00 +1694 1428 4.16666666666667e+00 +1694 1689 -4.16666666666667e+00 +1694 1691 -1.25000000000000e+01 +1694 1720 8.33333333333333e+00 +1694 1429 -8.33333333333333e+00 +1694 1690 8.33333333333333e+00 +1694 355 4.16666666666667e+00 +1694 354 4.16666666666667e+00 +1694 52 -4.16666666666667e+00 +1694 51 -4.16666666666667e+00 +1694 151 -4.16666666666667e+00 +1694 391 4.16666666666667e+00 +1694 152 -1.25000000000000e+01 +1694 150 8.33333333333333e+00 +1694 390 -8.33333333333333e+00 +1695 1695 6.25000000000000e+01 +1695 1726 -4.16666666666667e+00 +1695 1706 -2.08333333333333e+00 +1695 1712 4.16666666666667e+00 +1695 1705 4.16666666666667e+00 +1695 1704 -6.25000000000000e+00 +1695 1724 2.08333333333333e+00 +1695 1727 -4.16666666666667e+00 +1695 1723 -4.16666666666667e+00 +1695 1412 2.08333333333333e+00 +1695 1415 -2.08333333333333e+00 +1695 1714 4.16666666666667e+00 +1695 1702 -4.16666666666667e+00 +1695 1328 4.16666666666667e+00 +1695 1715 -8.33333333333333e+00 +1695 1327 4.16666666666667e+00 +1695 1696 -8.33333333333333e+00 +1695 1414 4.16666666666667e+00 +1695 1326 -1.87500000000000e+01 +1695 1413 -6.25000000000000e+00 +1695 1697 -8.33333333333333e+00 +1695 1325 4.16666666666667e+00 +1695 1703 8.33333333333333e+00 +1695 1324 4.16666666666667e+00 +1695 1411 -4.16666666666667e+00 +1695 1711 4.16666666666667e+00 +1695 1323 -1.87500000000000e+01 +1695 1701 -1.25000000000000e+01 +1696 1696 6.25000000000000e+01 +1696 1727 -4.16666666666667e+00 +1696 1710 4.16666666666667e+00 +1696 1725 -4.16666666666667e+00 +1696 1706 4.16666666666667e+00 +1696 1712 -8.33333333333333e+00 +1696 1705 -1.87500000000000e+01 +1696 1704 4.16666666666667e+00 +1696 1722 -4.16666666666667e+00 +1696 1697 -8.33333333333333e+00 +1696 1415 4.16666666666667e+00 +1696 1703 8.33333333333333e+00 +1696 1713 4.16666666666667e+00 +1696 1701 -4.16666666666667e+00 +1696 1328 -2.08333333333333e+00 +1696 1715 4.16666666666667e+00 +1696 1327 -6.25000000000000e+00 +1696 1414 -1.87500000000000e+01 +1696 1326 4.16666666666667e+00 +1696 1695 -8.33333333333333e+00 +1696 1413 4.16666666666667e+00 +1696 1325 -2.08333333333333e+00 +1696 1412 2.08333333333333e+00 +1696 1724 2.08333333333333e+00 +1696 1324 -6.25000000000000e+00 +1696 1702 -1.25000000000000e+01 +1696 1323 4.16666666666667e+00 +1696 1410 -4.16666666666667e+00 +1697 1697 6.25000000000000e+01 +1697 1726 -4.16666666666667e+00 +1697 1706 -6.25000000000000e+00 +1697 1705 4.16666666666667e+00 +1697 1711 -8.33333333333333e+00 +1697 1704 -2.08333333333333e+00 +1697 1710 4.16666666666667e+00 +1697 1722 2.08333333333333e+00 +1697 1725 -4.16666666666667e+00 +1697 1410 2.08333333333333e+00 +1697 1413 -2.08333333333333e+00 +1697 1696 -8.33333333333333e+00 +1697 1414 4.16666666666667e+00 +1697 1702 8.33333333333333e+00 +1697 1328 -6.25000000000000e+00 +1697 1415 -6.25000000000000e+00 +1697 1327 -2.08333333333333e+00 +1697 1714 4.16666666666667e+00 +1697 1326 4.16666666666667e+00 +1697 1713 -8.33333333333333e+00 +1697 1723 2.08333333333333e+00 +1697 1325 -6.25000000000000e+00 +1697 1703 -3.75000000000000e+01 +1697 1324 -2.08333333333333e+00 +1697 1411 2.08333333333333e+00 +1697 1695 -8.33333333333333e+00 +1697 1323 4.16666666666667e+00 +1697 1701 8.33333333333333e+00 +1698 1698 1.25000000000000e+02 +1698 1775 -4.16666666666667e+00 +1698 1774 -4.16666666666667e+00 +1698 1711 -8.33333333333333e+00 +1698 1702 8.33333333333333e+00 +1698 1769 -8.33333333333333e+00 +1698 1768 4.16666666666667e+00 +1698 1703 8.33333333333333e+00 +1698 1701 -3.75000000000000e+01 +1698 1709 -4.16666666666667e+00 +1698 1772 4.16666666666667e+00 +1698 1708 8.33333333333333e+00 +1698 1699 -1.66666666666667e+01 +1698 1594 8.33333333333333e+00 +1698 1592 -8.33333333333333e+00 +1698 1325 8.33333333333333e+00 +1698 1591 4.16666666666667e+00 +1698 1324 -4.16666666666667e+00 +1698 1707 -1.25000000000000e+01 +1698 1595 8.33333333333333e+00 +1698 1700 -1.66666666666667e+01 +1698 1337 8.33333333333333e+00 +1698 1771 4.16666666666667e+00 +1698 1336 -4.16666666666667e+00 +1698 1593 -3.75000000000000e+01 +1698 1561 -4.16666666666667e+00 +1698 1411 4.16666666666667e+00 +1698 1412 4.16666666666667e+00 +1698 1562 -4.16666666666667e+00 +1698 1323 -1.25000000000000e+01 +1698 1424 -4.16666666666667e+00 +1698 1568 4.16666666666667e+00 +1698 1423 8.33333333333333e+00 +1698 1567 -8.33333333333333e+00 +1698 1422 -1.25000000000000e+01 +1698 1712 4.16666666666667e+00 +1698 1335 -1.25000000000000e+01 +1699 1699 1.25000000000000e+02 +1699 1712 4.16666666666667e+00 +1699 1710 -8.33333333333333e+00 +1699 1775 -4.16666666666667e+00 +1699 1703 -4.16666666666667e+00 +1699 1769 4.16666666666667e+00 +1699 1701 8.33333333333333e+00 +1699 1767 4.16666666666667e+00 +1699 1702 -1.25000000000000e+01 +1699 1592 4.16666666666667e+00 +1699 1595 -4.16666666666667e+00 +1699 1707 8.33333333333333e+00 +1699 1698 -1.66666666666667e+01 +1699 1593 8.33333333333333e+00 +1699 1709 8.33333333333333e+00 +1699 1708 -3.75000000000000e+01 +1699 1590 4.16666666666667e+00 +1699 1323 -4.16666666666667e+00 +1699 1772 -8.33333333333333e+00 +1699 1594 -1.25000000000000e+01 +1699 1770 4.16666666666667e+00 +1699 1335 -4.16666666666667e+00 +1699 1560 -4.16666666666667e+00 +1699 1410 4.16666666666667e+00 +1699 1562 -4.16666666666667e+00 +1699 1568 4.16666666666667e+00 +1699 1412 -8.33333333333333e+00 +1699 1325 8.33333333333333e+00 +1699 1324 -1.25000000000000e+01 +1699 1424 8.33333333333333e+00 +1699 1700 -1.66666666666667e+01 +1699 1337 8.33333333333333e+00 +1699 1423 -3.75000000000000e+01 +1699 1773 -4.16666666666667e+00 +1699 1336 -1.25000000000000e+01 +1699 1422 8.33333333333333e+00 +1699 1566 -8.33333333333333e+00 +1700 1700 1.25000000000000e+02 +1700 1773 -4.16666666666667e+00 +1700 1711 4.16666666666667e+00 +1700 1774 -4.16666666666667e+00 +1700 1702 -4.16666666666667e+00 +1700 1768 4.16666666666667e+00 +1700 1767 -8.33333333333333e+00 +1700 1703 -1.25000000000000e+01 +1700 1701 8.33333333333333e+00 +1700 1591 4.16666666666667e+00 +1700 1594 -4.16666666666667e+00 +1700 1707 -4.16666666666667e+00 +1700 1770 4.16666666666667e+00 +1700 1709 -1.25000000000000e+01 +1700 1708 8.33333333333333e+00 +1700 1590 -8.33333333333333e+00 +1700 1323 8.33333333333333e+00 +1700 1595 -1.25000000000000e+01 +1700 1771 -8.33333333333333e+00 +1700 1593 8.33333333333333e+00 +1700 1698 -1.66666666666667e+01 +1700 1335 8.33333333333333e+00 +1700 1561 -4.16666666666667e+00 +1700 1567 4.16666666666667e+00 +1700 1325 -3.75000000000000e+01 +1700 1411 -8.33333333333333e+00 +1700 1324 8.33333333333333e+00 +1700 1410 4.16666666666667e+00 +1700 1560 -4.16666666666667e+00 +1700 1424 -1.25000000000000e+01 +1700 1710 4.16666666666667e+00 +1700 1337 -3.75000000000000e+01 +1700 1423 8.33333333333333e+00 +1700 1699 -1.66666666666667e+01 +1700 1336 8.33333333333333e+00 +1700 1422 -4.16666666666667e+00 +1700 1566 4.16666666666667e+00 +1701 1701 1.25000000000000e+02 +1701 1726 -8.33333333333333e+00 +1701 1696 -4.16666666666667e+00 +1701 1414 4.16666666666667e+00 +1701 1415 4.16666666666667e+00 +1701 1697 8.33333333333333e+00 +1701 1695 -1.25000000000000e+01 +1701 1715 8.33333333333333e+00 +1701 1714 8.33333333333333e+00 +1701 1713 -3.75000000000000e+01 +1701 1790 -4.16666666666667e+00 +1701 1789 -4.16666666666667e+00 +1701 1712 -4.16666666666667e+00 +1701 1775 4.16666666666667e+00 +1701 1774 4.16666666666667e+00 +1701 1711 8.33333333333333e+00 +1701 1702 -1.66666666666667e+01 +1701 1710 -1.25000000000000e+01 +1701 1427 -4.16666666666667e+00 +1701 1703 -1.66666666666667e+01 +1701 1412 -4.16666666666667e+00 +1701 1424 4.16666666666667e+00 +1701 1699 8.33333333333333e+00 +1701 1426 8.33333333333333e+00 +1701 1423 -8.33333333333333e+00 +1701 1700 8.33333333333333e+00 +1701 1325 -8.33333333333333e+00 +1701 1324 4.16666666666667e+00 +1701 1411 -4.16666666666667e+00 +1701 1698 -3.75000000000000e+01 +1701 1769 8.33333333333333e+00 +1701 1340 -8.33333333333333e+00 +1701 1768 -4.16666666666667e+00 +1701 1339 4.16666666666667e+00 +1701 1767 -1.25000000000000e+01 +1701 1727 4.16666666666667e+00 +1701 1425 -1.25000000000000e+01 +1702 1702 1.25000000000000e+02 +1702 1725 -8.33333333333333e+00 +1702 1697 8.33333333333333e+00 +1702 1695 -4.16666666666667e+00 +1702 1413 4.16666666666667e+00 +1702 1415 -8.33333333333333e+00 +1702 1696 -1.25000000000000e+01 +1702 1715 -4.16666666666667e+00 +1702 1714 -1.25000000000000e+01 +1702 1713 8.33333333333333e+00 +1702 1788 -4.16666666666667e+00 +1702 1712 8.33333333333333e+00 +1702 1775 -8.33333333333333e+00 +1702 1773 4.16666666666667e+00 +1702 1325 4.16666666666667e+00 +1702 1711 -3.75000000000000e+01 +1702 1710 8.33333333333333e+00 +1702 1701 -1.66666666666667e+01 +1702 1790 -4.16666666666667e+00 +1702 1340 4.16666666666667e+00 +1702 1700 -4.16666666666667e+00 +1702 1698 8.33333333333333e+00 +1702 1412 -4.16666666666667e+00 +1702 1424 4.16666666666667e+00 +1702 1425 8.33333333333333e+00 +1702 1422 -8.33333333333333e+00 +1702 1699 -1.25000000000000e+01 +1702 1323 4.16666666666667e+00 +1702 1410 -4.16666666666667e+00 +1702 1769 8.33333333333333e+00 +1702 1703 -1.66666666666667e+01 +1702 1427 8.33333333333333e+00 +1702 1768 -1.25000000000000e+01 +1702 1727 4.16666666666667e+00 +1702 1426 -3.75000000000000e+01 +1702 1767 -4.16666666666667e+00 +1702 1338 4.16666666666667e+00 +1703 1703 1.25000000000000e+02 +1703 1726 4.16666666666667e+00 +1703 1696 8.33333333333333e+00 +1703 1414 -8.33333333333333e+00 +1703 1413 4.16666666666667e+00 +1703 1697 -3.75000000000000e+01 +1703 1695 8.33333333333333e+00 +1703 1715 -1.25000000000000e+01 +1703 1714 -4.16666666666667e+00 +1703 1713 8.33333333333333e+00 +1703 1788 -4.16666666666667e+00 +1703 1711 8.33333333333333e+00 +1703 1710 -4.16666666666667e+00 +1703 1773 4.16666666666667e+00 +1703 1774 -8.33333333333333e+00 +1703 1712 -1.25000000000000e+01 +1703 1324 4.16666666666667e+00 +1703 1789 -4.16666666666667e+00 +1703 1339 4.16666666666667e+00 +1703 1425 -4.16666666666667e+00 +1703 1699 -4.16666666666667e+00 +1703 1701 -1.66666666666667e+01 +1703 1410 -4.16666666666667e+00 +1703 1422 4.16666666666667e+00 +1703 1411 -4.16666666666667e+00 +1703 1423 4.16666666666667e+00 +1703 1700 -1.25000000000000e+01 +1703 1698 8.33333333333333e+00 +1703 1323 -8.33333333333333e+00 +1703 1769 -3.75000000000000e+01 +1703 1725 4.16666666666667e+00 +1703 1427 -1.25000000000000e+01 +1703 1768 8.33333333333333e+00 +1703 1702 -1.66666666666667e+01 +1703 1426 8.33333333333333e+00 +1703 1767 8.33333333333333e+00 +1703 1338 -8.33333333333333e+00 +1704 1704 6.25000000000000e+01 +1704 1726 4.16666666666667e+00 +1704 1727 -8.33333333333333e+00 +1704 1325 2.08333333333333e+00 +1704 1697 -2.08333333333333e+00 +1704 1696 4.16666666666667e+00 +1704 1695 -6.25000000000000e+00 +1704 1352 2.08333333333333e+00 +1704 1723 4.16666666666667e+00 +1704 1722 -1.87500000000000e+01 +1704 1711 -4.16666666666667e+00 +1704 1454 -2.08333333333333e+00 +1704 1705 -8.33333333333333e+00 +1704 1822 -4.16666666666667e+00 +1704 1459 4.16666666666667e+00 +1704 1823 -4.16666666666667e+00 +1704 1460 4.16666666666667e+00 +1704 1351 -4.16666666666667e+00 +1704 1453 4.16666666666667e+00 +1704 1452 -6.25000000000000e+00 +1704 1706 -8.33333333333333e+00 +1704 1448 4.16666666666667e+00 +1704 1712 8.33333333333333e+00 +1704 1447 4.16666666666667e+00 +1704 1324 -4.16666666666667e+00 +1704 1724 4.16666666666667e+00 +1704 1446 -1.87500000000000e+01 +1704 1710 -1.25000000000000e+01 +1705 1705 6.25000000000000e+01 +1705 1725 4.16666666666667e+00 +1705 1727 4.16666666666667e+00 +1705 1697 4.16666666666667e+00 +1705 1706 -8.33333333333333e+00 +1705 1696 -1.87500000000000e+01 +1705 1695 4.16666666666667e+00 +1705 1723 -6.25000000000000e+00 +1705 1722 4.16666666666667e+00 +1705 1710 -4.16666666666667e+00 +1705 1704 -8.33333333333333e+00 +1705 1454 4.16666666666667e+00 +1705 1821 -4.16666666666667e+00 +1705 1458 4.16666666666667e+00 +1705 1712 8.33333333333333e+00 +1705 1460 -8.33333333333333e+00 +1705 1352 2.08333333333333e+00 +1705 1823 -4.16666666666667e+00 +1705 1453 -1.87500000000000e+01 +1705 1350 -4.16666666666667e+00 +1705 1452 4.16666666666667e+00 +1705 1448 -2.08333333333333e+00 +1705 1325 2.08333333333333e+00 +1705 1724 -2.08333333333333e+00 +1705 1447 -6.25000000000000e+00 +1705 1711 -1.25000000000000e+01 +1705 1446 4.16666666666667e+00 +1705 1323 -4.16666666666667e+00 +1706 1706 6.25000000000000e+01 +1706 1722 4.16666666666667e+00 +1706 1726 4.16666666666667e+00 +1706 1725 -8.33333333333333e+00 +1706 1697 -6.25000000000000e+00 +1706 1696 4.16666666666667e+00 +1706 1705 -8.33333333333333e+00 +1706 1323 2.08333333333333e+00 +1706 1695 -2.08333333333333e+00 +1706 1724 -6.25000000000000e+00 +1706 1350 2.08333333333333e+00 +1706 1452 -2.08333333333333e+00 +1706 1453 4.16666666666667e+00 +1706 1711 8.33333333333333e+00 +1706 1459 -8.33333333333333e+00 +1706 1821 -4.16666666666667e+00 +1706 1458 4.16666666666667e+00 +1706 1454 -6.25000000000000e+00 +1706 1351 2.08333333333333e+00 +1706 1822 -4.16666666666667e+00 +1706 1723 -2.08333333333333e+00 +1706 1448 -6.25000000000000e+00 +1706 1712 -3.75000000000000e+01 +1706 1447 -2.08333333333333e+00 +1706 1324 2.08333333333333e+00 +1706 1704 -8.33333333333333e+00 +1706 1446 4.16666666666667e+00 +1706 1710 8.33333333333333e+00 +1707 1707 1.25000000000000e+02 +1707 1774 4.16666666666667e+00 +1707 1829 -4.16666666666667e+00 +1707 1460 4.16666666666667e+00 +1707 1459 -8.33333333333333e+00 +1707 1711 8.33333333333333e+00 +1707 1828 -4.16666666666667e+00 +1707 1712 8.33333333333333e+00 +1707 1710 -3.75000000000000e+01 +1707 1700 -4.16666666666667e+00 +1707 1595 4.16666666666667e+00 +1707 1699 8.33333333333333e+00 +1707 1594 -8.33333333333333e+00 +1707 1324 4.16666666666667e+00 +1707 1698 -1.25000000000000e+01 +1707 1709 -1.66666666666667e+01 +1707 1772 8.33333333333333e+00 +1707 1354 4.16666666666667e+00 +1707 1771 -4.16666666666667e+00 +1707 1770 -1.25000000000000e+01 +1707 1591 -4.16666666666667e+00 +1707 1448 8.33333333333333e+00 +1707 1444 4.16666666666667e+00 +1707 1447 -4.16666666666667e+00 +1707 1445 -8.33333333333333e+00 +1707 1604 8.33333333333333e+00 +1707 1325 4.16666666666667e+00 +1707 1592 -4.16666666666667e+00 +1707 1446 -1.25000000000000e+01 +1707 1457 -4.16666666666667e+00 +1707 1355 4.16666666666667e+00 +1707 1708 -1.66666666666667e+01 +1707 1456 8.33333333333333e+00 +1707 1603 8.33333333333333e+00 +1707 1775 -8.33333333333333e+00 +1707 1455 -1.25000000000000e+01 +1707 1602 -3.75000000000000e+01 +1708 1708 1.25000000000000e+02 +1708 1773 4.16666666666667e+00 +1708 1829 -4.16666666666667e+00 +1708 1460 4.16666666666667e+00 +1708 1712 -4.16666666666667e+00 +1708 1458 -8.33333333333333e+00 +1708 1710 8.33333333333333e+00 +1708 1827 -4.16666666666667e+00 +1708 1711 -1.25000000000000e+01 +1708 1595 4.16666666666667e+00 +1708 1698 8.33333333333333e+00 +1708 1593 -8.33333333333333e+00 +1708 1700 8.33333333333333e+00 +1708 1699 -3.75000000000000e+01 +1708 1323 4.16666666666667e+00 +1708 1772 8.33333333333333e+00 +1708 1771 -1.25000000000000e+01 +1708 1353 4.16666666666667e+00 +1708 1770 -4.16666666666667e+00 +1708 1590 -4.16666666666667e+00 +1708 1592 -4.16666666666667e+00 +1708 1709 -1.66666666666667e+01 +1708 1443 4.16666666666667e+00 +1708 1446 -4.16666666666667e+00 +1708 1445 4.16666666666667e+00 +1708 1604 -4.16666666666667e+00 +1708 1325 -8.33333333333333e+00 +1708 1448 8.33333333333333e+00 +1708 1447 -1.25000000000000e+01 +1708 1457 8.33333333333333e+00 +1708 1355 -8.33333333333333e+00 +1708 1775 4.16666666666667e+00 +1708 1456 -3.75000000000000e+01 +1708 1603 -1.25000000000000e+01 +1708 1707 -1.66666666666667e+01 +1708 1455 8.33333333333333e+00 +1708 1602 8.33333333333333e+00 +1709 1709 1.25000000000000e+02 +1709 1773 -8.33333333333333e+00 +1709 1827 -4.16666666666667e+00 +1709 1828 -4.16666666666667e+00 +1709 1458 4.16666666666667e+00 +1709 1459 4.16666666666667e+00 +1709 1711 -4.16666666666667e+00 +1709 1712 -1.25000000000000e+01 +1709 1710 8.33333333333333e+00 +1709 1594 4.16666666666667e+00 +1709 1698 -4.16666666666667e+00 +1709 1593 4.16666666666667e+00 +1709 1700 -1.25000000000000e+01 +1709 1699 8.33333333333333e+00 +1709 1772 -3.75000000000000e+01 +1709 1771 8.33333333333333e+00 +1709 1707 -1.66666666666667e+01 +1709 1770 8.33333333333333e+00 +1709 1591 -4.16666666666667e+00 +1709 1708 -1.66666666666667e+01 +1709 1446 8.33333333333333e+00 +1709 1444 4.16666666666667e+00 +1709 1603 -4.16666666666667e+00 +1709 1443 -8.33333333333333e+00 +1709 1602 8.33333333333333e+00 +1709 1448 -3.75000000000000e+01 +1709 1324 -8.33333333333333e+00 +1709 1447 8.33333333333333e+00 +1709 1323 4.16666666666667e+00 +1709 1590 -4.16666666666667e+00 +1709 1774 4.16666666666667e+00 +1709 1457 -1.25000000000000e+01 +1709 1604 -1.25000000000000e+01 +1709 1456 8.33333333333333e+00 +1709 1354 -8.33333333333333e+00 +1709 1455 -4.16666666666667e+00 +1709 1353 4.16666666666667e+00 +1710 1710 1.25000000000000e+02 +1710 1727 8.33333333333333e+00 +1710 1697 4.16666666666667e+00 +1710 1726 8.33333333333333e+00 +1710 1725 -3.75000000000000e+01 +1710 1705 -4.16666666666667e+00 +1710 1823 4.16666666666667e+00 +1710 1706 8.33333333333333e+00 +1710 1704 -1.25000000000000e+01 +1710 1822 -8.33333333333333e+00 +1710 1712 -1.66666666666667e+01 +1710 1358 -4.16666666666667e+00 +1710 1325 -4.16666666666667e+00 +1710 1789 4.16666666666667e+00 +1710 1774 -4.16666666666667e+00 +1710 1703 -4.16666666666667e+00 +1710 1700 4.16666666666667e+00 +1710 1790 -8.33333333333333e+00 +1710 1775 8.33333333333333e+00 +1710 1773 -1.25000000000000e+01 +1710 1702 8.33333333333333e+00 +1710 1699 -8.33333333333333e+00 +1710 1701 -1.25000000000000e+01 +1710 1460 -4.16666666666667e+00 +1710 1829 4.16666666666667e+00 +1710 1459 8.33333333333333e+00 +1710 1711 -1.66666666666667e+01 +1710 1708 8.33333333333333e+00 +1710 1828 4.16666666666667e+00 +1710 1357 -4.16666666666667e+00 +1710 1458 -1.25000000000000e+01 +1710 1709 8.33333333333333e+00 +1710 1448 -8.33333333333333e+00 +1710 1447 4.16666666666667e+00 +1710 1324 -4.16666666666667e+00 +1710 1707 -3.75000000000000e+01 +1710 1696 4.16666666666667e+00 +1711 1711 1.25000000000000e+02 +1711 1727 -4.16666666666667e+00 +1711 1697 -8.33333333333333e+00 +1711 1726 -1.25000000000000e+01 +1711 1725 8.33333333333333e+00 +1711 1704 -4.16666666666667e+00 +1711 1706 8.33333333333333e+00 +1711 1705 -1.25000000000000e+01 +1711 1823 4.16666666666667e+00 +1711 1821 -8.33333333333333e+00 +1711 1788 4.16666666666667e+00 +1711 1773 -4.16666666666667e+00 +1711 1703 8.33333333333333e+00 +1711 1712 -1.66666666666667e+01 +1711 1775 8.33333333333333e+00 +1711 1358 -4.16666666666667e+00 +1711 1790 4.16666666666667e+00 +1711 1774 -1.25000000000000e+01 +1711 1325 -4.16666666666667e+00 +1711 1700 4.16666666666667e+00 +1711 1702 -3.75000000000000e+01 +1711 1701 8.33333333333333e+00 +1711 1698 -8.33333333333333e+00 +1711 1448 4.16666666666667e+00 +1711 1709 -4.16666666666667e+00 +1711 1458 8.33333333333333e+00 +1711 1710 -1.66666666666667e+01 +1711 1707 8.33333333333333e+00 +1711 1829 -8.33333333333333e+00 +1711 1460 8.33333333333333e+00 +1711 1459 -3.75000000000000e+01 +1711 1827 4.16666666666667e+00 +1711 1356 -4.16666666666667e+00 +1711 1708 -1.25000000000000e+01 +1711 1695 4.16666666666667e+00 +1711 1446 4.16666666666667e+00 +1711 1323 -4.16666666666667e+00 +1712 1712 1.25000000000000e+02 +1712 1725 8.33333333333333e+00 +1712 1696 -8.33333333333333e+00 +1712 1695 4.16666666666667e+00 +1712 1727 -1.25000000000000e+01 +1712 1705 8.33333333333333e+00 +1712 1821 4.16666666666667e+00 +1712 1706 -3.75000000000000e+01 +1712 1704 8.33333333333333e+00 +1712 1822 4.16666666666667e+00 +1712 1710 -1.66666666666667e+01 +1712 1356 -4.16666666666667e+00 +1712 1323 -4.16666666666667e+00 +1712 1702 8.33333333333333e+00 +1712 1711 -1.66666666666667e+01 +1712 1774 8.33333333333333e+00 +1712 1701 -4.16666666666667e+00 +1712 1698 4.16666666666667e+00 +1712 1775 -3.75000000000000e+01 +1712 1357 -4.16666666666667e+00 +1712 1789 4.16666666666667e+00 +1712 1788 -8.33333333333333e+00 +1712 1773 8.33333333333333e+00 +1712 1703 -1.25000000000000e+01 +1712 1324 -4.16666666666667e+00 +1712 1699 4.16666666666667e+00 +1712 1458 -4.16666666666667e+00 +1712 1827 4.16666666666667e+00 +1712 1447 4.16666666666667e+00 +1712 1708 -4.16666666666667e+00 +1712 1460 -1.25000000000000e+01 +1712 1828 -8.33333333333333e+00 +1712 1459 8.33333333333333e+00 +1712 1709 -1.25000000000000e+01 +1712 1726 -4.16666666666667e+00 +1712 1707 8.33333333333333e+00 +1712 1446 -8.33333333333333e+00 +1713 1713 1.25000000000000e+02 +1713 1727 -4.16666666666667e+00 +1713 1726 8.33333333333333e+00 +1713 1725 -1.25000000000000e+01 +1713 1790 4.16666666666667e+00 +1713 1696 4.16666666666667e+00 +1713 1697 -8.33333333333333e+00 +1713 1703 8.33333333333333e+00 +1713 1702 8.33333333333333e+00 +1713 1701 -3.75000000000000e+01 +1713 1714 -1.66666666666667e+01 +1713 1327 -4.16666666666667e+00 +1713 1339 -4.16666666666667e+00 +1713 1792 -4.16666666666667e+00 +1713 1786 4.16666666666667e+00 +1713 1793 -4.16666666666667e+00 +1713 1730 4.16666666666667e+00 +1713 1328 8.33333333333333e+00 +1713 1715 -1.66666666666667e+01 +1713 1721 8.33333333333333e+00 +1713 1729 -8.33333333333333e+00 +1713 1720 8.33333333333333e+00 +1713 1719 -3.75000000000000e+01 +1713 1340 8.33333333333333e+00 +1713 1787 -8.33333333333333e+00 +1713 1414 -4.16666666666667e+00 +1713 1678 4.16666666666667e+00 +1713 1679 4.16666666666667e+00 +1713 1415 -4.16666666666667e+00 +1713 1326 -1.25000000000000e+01 +1713 1685 -4.16666666666667e+00 +1713 1427 4.16666666666667e+00 +1713 1684 8.33333333333333e+00 +1713 1426 -8.33333333333333e+00 +1713 1683 -1.25000000000000e+01 +1713 1789 4.16666666666667e+00 +1713 1338 -1.25000000000000e+01 +1714 1714 1.25000000000000e+02 +1714 1727 8.33333333333333e+00 +1714 1726 -3.75000000000000e+01 +1714 1725 8.33333333333333e+00 +1714 1790 -8.33333333333333e+00 +1714 1695 4.16666666666667e+00 +1714 1697 4.16666666666667e+00 +1714 1703 -4.16666666666667e+00 +1714 1702 -1.25000000000000e+01 +1714 1701 8.33333333333333e+00 +1714 1713 -1.66666666666667e+01 +1714 1326 -4.16666666666667e+00 +1714 1338 -4.16666666666667e+00 +1714 1791 -4.16666666666667e+00 +1714 1785 4.16666666666667e+00 +1714 1730 4.16666666666667e+00 +1714 1721 -4.16666666666667e+00 +1714 1720 -1.25000000000000e+01 +1714 1728 -8.33333333333333e+00 +1714 1719 8.33333333333333e+00 +1714 1793 -4.16666666666667e+00 +1714 1787 4.16666666666667e+00 +1714 1413 -4.16666666666667e+00 +1714 1677 4.16666666666667e+00 +1714 1415 -4.16666666666667e+00 +1714 1427 4.16666666666667e+00 +1714 1679 -8.33333333333333e+00 +1714 1328 8.33333333333333e+00 +1714 1327 -1.25000000000000e+01 +1714 1685 8.33333333333333e+00 +1714 1715 -1.66666666666667e+01 +1714 1340 8.33333333333333e+00 +1714 1684 -3.75000000000000e+01 +1714 1788 4.16666666666667e+00 +1714 1339 -1.25000000000000e+01 +1714 1683 8.33333333333333e+00 +1714 1425 -8.33333333333333e+00 +1715 1715 1.25000000000000e+02 +1715 1726 8.33333333333333e+00 +1715 1725 -4.16666666666667e+00 +1715 1789 -8.33333333333333e+00 +1715 1788 4.16666666666667e+00 +1715 1696 4.16666666666667e+00 +1715 1695 -8.33333333333333e+00 +1715 1703 -1.25000000000000e+01 +1715 1702 -4.16666666666667e+00 +1715 1701 8.33333333333333e+00 +1715 1791 -4.16666666666667e+00 +1715 1728 4.16666666666667e+00 +1715 1721 -1.25000000000000e+01 +1715 1729 4.16666666666667e+00 +1715 1720 -4.16666666666667e+00 +1715 1326 8.33333333333333e+00 +1715 1713 -1.66666666666667e+01 +1715 1719 8.33333333333333e+00 +1715 1792 -4.16666666666667e+00 +1715 1786 4.16666666666667e+00 +1715 1338 8.33333333333333e+00 +1715 1785 -8.33333333333333e+00 +1715 1414 -4.16666666666667e+00 +1715 1426 4.16666666666667e+00 +1715 1328 -3.75000000000000e+01 +1715 1678 -8.33333333333333e+00 +1715 1327 8.33333333333333e+00 +1715 1677 4.16666666666667e+00 +1715 1413 -4.16666666666667e+00 +1715 1685 -1.25000000000000e+01 +1715 1727 -1.25000000000000e+01 +1715 1340 -3.75000000000000e+01 +1715 1684 8.33333333333333e+00 +1715 1714 -1.66666666666667e+01 +1715 1339 8.33333333333333e+00 +1715 1683 -4.16666666666667e+00 +1715 1425 4.16666666666667e+00 +1716 1716 6.25000000000000e+01 +1716 1679 2.08333333333333e+00 +1716 1678 -4.16666666666667e+00 +1716 1687 4.16666666666667e+00 +1716 1686 -6.25000000000000e+00 +1716 1328 4.16666666666667e+00 +1716 1718 -8.33333333333333e+00 +1716 1721 8.33333333333333e+00 +1716 1720 -4.16666666666667e+00 +1716 1719 -1.25000000000000e+01 +1716 1729 4.16666666666667e+00 +1716 1463 -2.08333333333333e+00 +1716 1730 4.16666666666667e+00 +1716 1717 -8.33333333333333e+00 +1716 1462 4.16666666666667e+00 +1716 1327 4.16666666666667e+00 +1716 1688 -2.08333333333333e+00 +1716 1461 -6.25000000000000e+00 +1716 1326 -1.87500000000000e+01 +1716 41 4.16666666666667e+00 +1716 356 -8.33333333333333e+00 +1716 355 4.16666666666667e+00 +1716 364 -4.16666666666667e+00 +1716 194 2.08333333333333e+00 +1716 365 -4.16666666666667e+00 +1716 40 4.16666666666667e+00 +1716 193 -4.16666666666667e+00 +1716 39 -1.87500000000000e+01 +1717 1717 6.25000000000000e+01 +1717 1718 -8.33333333333333e+00 +1717 1328 -2.08333333333333e+00 +1717 1679 2.08333333333333e+00 +1717 1677 -4.16666666666667e+00 +1717 1687 -1.87500000000000e+01 +1717 1686 4.16666666666667e+00 +1717 1721 8.33333333333333e+00 +1717 1720 -1.25000000000000e+01 +1717 1719 -4.16666666666667e+00 +1717 1728 4.16666666666667e+00 +1717 1463 4.16666666666667e+00 +1717 1730 -8.33333333333333e+00 +1717 1688 4.16666666666667e+00 +1717 1462 -1.87500000000000e+01 +1717 1327 -6.25000000000000e+00 +1717 1716 -8.33333333333333e+00 +1717 1461 4.16666666666667e+00 +1717 1326 4.16666666666667e+00 +1717 41 -2.08333333333333e+00 +1717 356 4.16666666666667e+00 +1717 354 4.16666666666667e+00 +1717 363 -4.16666666666667e+00 +1717 194 2.08333333333333e+00 +1717 365 -4.16666666666667e+00 +1717 40 -6.25000000000000e+00 +1717 39 4.16666666666667e+00 +1717 192 -4.16666666666667e+00 +1718 1718 6.25000000000000e+01 +1718 1717 -8.33333333333333e+00 +1718 1686 -2.08333333333333e+00 +1718 1677 2.08333333333333e+00 +1718 1327 -2.08333333333333e+00 +1718 1678 2.08333333333333e+00 +1718 1688 -6.25000000000000e+00 +1718 1721 -3.75000000000000e+01 +1718 1720 8.33333333333333e+00 +1718 1326 4.16666666666667e+00 +1718 1716 -8.33333333333333e+00 +1718 1719 8.33333333333333e+00 +1718 1687 4.16666666666667e+00 +1718 1463 -6.25000000000000e+00 +1718 1328 -6.25000000000000e+00 +1718 1462 4.16666666666667e+00 +1718 1729 -8.33333333333333e+00 +1718 1461 -2.08333333333333e+00 +1718 1728 4.16666666666667e+00 +1718 40 -2.08333333333333e+00 +1718 355 4.16666666666667e+00 +1718 39 4.16666666666667e+00 +1718 354 -8.33333333333333e+00 +1718 193 2.08333333333333e+00 +1718 364 -4.16666666666667e+00 +1718 41 -6.25000000000000e+00 +1718 192 2.08333333333333e+00 +1718 363 -4.16666666666667e+00 +1719 1719 1.25000000000000e+02 +1719 1684 -8.33333333333333e+00 +1719 1679 -4.16666666666667e+00 +1719 1687 4.16666666666667e+00 +1719 1678 -4.16666666666667e+00 +1719 1688 4.16666666666667e+00 +1719 1694 -4.16666666666667e+00 +1719 1693 8.33333333333333e+00 +1719 1692 -1.25000000000000e+01 +1719 1718 8.33333333333333e+00 +1719 1327 4.16666666666667e+00 +1719 1717 -4.16666666666667e+00 +1719 1716 -1.25000000000000e+01 +1719 1721 -1.66666666666667e+01 +1719 1786 -4.16666666666667e+00 +1719 1730 -4.16666666666667e+00 +1719 1792 4.16666666666667e+00 +1719 1793 4.16666666666667e+00 +1719 1328 -8.33333333333333e+00 +1719 1715 8.33333333333333e+00 +1719 1729 8.33333333333333e+00 +1719 1714 8.33333333333333e+00 +1719 1720 -1.66666666666667e+01 +1719 1728 -1.25000000000000e+01 +1719 1713 -3.75000000000000e+01 +1719 1787 8.33333333333333e+00 +1719 1685 4.16666666666667e+00 +1719 1785 -1.25000000000000e+01 +1719 365 4.16666666666667e+00 +1719 364 -8.33333333333333e+00 +1719 355 8.33333333333333e+00 +1719 356 8.33333333333333e+00 +1719 52 4.16666666666667e+00 +1719 354 -3.75000000000000e+01 +1719 427 -4.16666666666667e+00 +1719 428 -4.16666666666667e+00 +1719 53 -8.33333333333333e+00 +1720 1720 1.25000000000000e+02 +1720 1683 -8.33333333333333e+00 +1720 1686 4.16666666666667e+00 +1720 1677 -4.16666666666667e+00 +1720 1688 -8.33333333333333e+00 +1720 1694 8.33333333333333e+00 +1720 1679 -4.16666666666667e+00 +1720 1693 -3.75000000000000e+01 +1720 1692 8.33333333333333e+00 +1720 1718 8.33333333333333e+00 +1720 1721 -1.66666666666667e+01 +1720 1717 -1.25000000000000e+01 +1720 1326 4.16666666666667e+00 +1720 1716 -4.16666666666667e+00 +1720 1785 -4.16666666666667e+00 +1720 1730 8.33333333333333e+00 +1720 1791 4.16666666666667e+00 +1720 1793 -8.33333333333333e+00 +1720 1787 8.33333333333333e+00 +1720 1328 4.16666666666667e+00 +1720 1715 -4.16666666666667e+00 +1720 1729 -3.75000000000000e+01 +1720 1714 -1.25000000000000e+01 +1720 1728 8.33333333333333e+00 +1720 1713 8.33333333333333e+00 +1720 1719 -1.66666666666667e+01 +1720 1685 4.16666666666667e+00 +1720 1786 -1.25000000000000e+01 +1720 365 4.16666666666667e+00 +1720 356 -4.16666666666667e+00 +1720 363 -8.33333333333333e+00 +1720 354 8.33333333333333e+00 +1720 355 -1.25000000000000e+01 +1720 51 4.16666666666667e+00 +1720 426 -4.16666666666667e+00 +1720 428 -4.16666666666667e+00 +1720 53 4.16666666666667e+00 +1721 1721 1.25000000000000e+02 +1721 1683 4.16666666666667e+00 +1721 1677 -4.16666666666667e+00 +1721 1687 -8.33333333333333e+00 +1721 1693 8.33333333333333e+00 +1721 1686 4.16666666666667e+00 +1721 1692 -4.16666666666667e+00 +1721 1678 -4.16666666666667e+00 +1721 1694 -1.25000000000000e+01 +1721 1718 -3.75000000000000e+01 +1721 1717 8.33333333333333e+00 +1721 1720 -1.66666666666667e+01 +1721 1716 8.33333333333333e+00 +1721 1719 -1.66666666666667e+01 +1721 1728 -4.16666666666667e+00 +1721 1729 8.33333333333333e+00 +1721 1792 -8.33333333333333e+00 +1721 1786 8.33333333333333e+00 +1721 1791 4.16666666666667e+00 +1721 1730 -1.25000000000000e+01 +1721 1715 -1.25000000000000e+01 +1721 1327 4.16666666666667e+00 +1721 1714 -4.16666666666667e+00 +1721 1326 -8.33333333333333e+00 +1721 1713 8.33333333333333e+00 +1721 1684 4.16666666666667e+00 +1721 1787 -3.75000000000000e+01 +1721 1785 8.33333333333333e+00 +1721 364 4.16666666666667e+00 +1721 355 -4.16666666666667e+00 +1721 363 4.16666666666667e+00 +1721 356 -1.25000000000000e+01 +1721 354 8.33333333333333e+00 +1721 426 -4.16666666666667e+00 +1721 427 -4.16666666666667e+00 +1721 52 4.16666666666667e+00 +1721 51 -8.33333333333333e+00 +1722 1722 6.25000000000000e+01 +1722 1706 4.16666666666667e+00 +1722 1697 2.08333333333333e+00 +1722 1328 -2.08333333333333e+00 +1722 1696 -4.16666666666667e+00 +1722 1352 -2.08333333333333e+00 +1722 1705 4.16666666666667e+00 +1722 1704 -1.87500000000000e+01 +1722 1823 4.16666666666667e+00 +1722 1822 4.16666666666667e+00 +1722 1727 8.33333333333333e+00 +1722 1726 -4.16666666666667e+00 +1722 1725 -1.25000000000000e+01 +1722 1729 4.16666666666667e+00 +1722 1825 -4.16666666666667e+00 +1722 1466 2.08333333333333e+00 +1722 1826 -4.16666666666667e+00 +1722 1465 -4.16666666666667e+00 +1722 1351 4.16666666666667e+00 +1722 1350 -6.25000000000000e+00 +1722 1463 4.16666666666667e+00 +1722 1730 -8.33333333333333e+00 +1722 1462 4.16666666666667e+00 +1722 1723 -8.33333333333333e+00 +1722 1327 4.16666666666667e+00 +1722 1461 -1.87500000000000e+01 +1722 1724 -8.33333333333333e+00 +1722 1326 -6.25000000000000e+00 +1723 1723 6.25000000000000e+01 +1723 1697 2.08333333333333e+00 +1723 1695 -4.16666666666667e+00 +1723 1705 -6.25000000000000e+00 +1723 1704 4.16666666666667e+00 +1723 1352 4.16666666666667e+00 +1723 1823 -8.33333333333333e+00 +1723 1821 4.16666666666667e+00 +1723 1724 -8.33333333333333e+00 +1723 1328 4.16666666666667e+00 +1723 1727 8.33333333333333e+00 +1723 1726 -1.25000000000000e+01 +1723 1725 -4.16666666666667e+00 +1723 1728 4.16666666666667e+00 +1723 1824 -4.16666666666667e+00 +1723 1466 2.08333333333333e+00 +1723 1826 -4.16666666666667e+00 +1723 1351 -1.87500000000000e+01 +1723 1464 -4.16666666666667e+00 +1723 1350 4.16666666666667e+00 +1723 1463 -2.08333333333333e+00 +1723 1730 4.16666666666667e+00 +1723 1462 -6.25000000000000e+00 +1723 1706 -2.08333333333333e+00 +1723 1327 -1.87500000000000e+01 +1723 1461 4.16666666666667e+00 +1723 1722 -8.33333333333333e+00 +1723 1326 4.16666666666667e+00 +1724 1724 6.25000000000000e+01 +1724 1696 2.08333333333333e+00 +1724 1722 -8.33333333333333e+00 +1724 1704 4.16666666666667e+00 +1724 1695 2.08333333333333e+00 +1724 1326 -2.08333333333333e+00 +1724 1706 -6.25000000000000e+00 +1724 1350 -2.08333333333333e+00 +1724 1821 4.16666666666667e+00 +1724 1351 4.16666666666667e+00 +1724 1822 -8.33333333333333e+00 +1724 1727 -3.75000000000000e+01 +1724 1723 -8.33333333333333e+00 +1724 1327 4.16666666666667e+00 +1724 1726 8.33333333333333e+00 +1724 1725 8.33333333333333e+00 +1724 1464 2.08333333333333e+00 +1724 1824 -4.16666666666667e+00 +1724 1352 -6.25000000000000e+00 +1724 1465 2.08333333333333e+00 +1724 1825 -4.16666666666667e+00 +1724 1463 -6.25000000000000e+00 +1724 1705 -2.08333333333333e+00 +1724 1328 -6.25000000000000e+00 +1724 1462 -2.08333333333333e+00 +1724 1729 4.16666666666667e+00 +1724 1461 4.16666666666667e+00 +1724 1728 -8.33333333333333e+00 +1725 1725 1.25000000000000e+02 +1725 1702 -8.33333333333333e+00 +1725 1696 -4.16666666666667e+00 +1725 1705 4.16666666666667e+00 +1725 1712 8.33333333333333e+00 +1725 1706 -8.33333333333333e+00 +1725 1697 -4.16666666666667e+00 +1725 1711 8.33333333333333e+00 +1725 1710 -3.75000000000000e+01 +1725 1826 4.16666666666667e+00 +1725 1823 -4.16666666666667e+00 +1725 1822 8.33333333333333e+00 +1725 1825 -8.33333333333333e+00 +1725 1724 8.33333333333333e+00 +1725 1727 -1.66666666666667e+01 +1725 1723 -4.16666666666667e+00 +1725 1327 4.16666666666667e+00 +1725 1722 -1.25000000000000e+01 +1725 1357 4.16666666666667e+00 +1725 1821 -1.25000000000000e+01 +1725 1789 -4.16666666666667e+00 +1725 1730 8.33333333333333e+00 +1725 1792 4.16666666666667e+00 +1725 1834 -4.16666666666667e+00 +1725 1793 -8.33333333333333e+00 +1725 1790 8.33333333333333e+00 +1725 1328 4.16666666666667e+00 +1725 1715 -4.16666666666667e+00 +1725 1729 8.33333333333333e+00 +1725 1714 8.33333333333333e+00 +1725 1726 -1.66666666666667e+01 +1725 1728 -3.75000000000000e+01 +1725 1713 -1.25000000000000e+01 +1725 1835 -4.16666666666667e+00 +1725 1358 4.16666666666667e+00 +1725 1703 4.16666666666667e+00 +1725 1788 -1.25000000000000e+01 +1726 1726 1.25000000000000e+02 +1726 1701 -8.33333333333333e+00 +1726 1697 -4.16666666666667e+00 +1726 1695 -4.16666666666667e+00 +1726 1704 4.16666666666667e+00 +1726 1712 -4.16666666666667e+00 +1726 1706 4.16666666666667e+00 +1726 1711 -1.25000000000000e+01 +1726 1710 8.33333333333333e+00 +1726 1826 4.16666666666667e+00 +1726 1821 8.33333333333333e+00 +1726 1824 -8.33333333333333e+00 +1726 1724 8.33333333333333e+00 +1726 1723 -1.25000000000000e+01 +1726 1722 -4.16666666666667e+00 +1726 1326 4.16666666666667e+00 +1726 1823 8.33333333333333e+00 +1726 1822 -3.75000000000000e+01 +1726 1356 4.16666666666667e+00 +1726 1727 -1.66666666666667e+01 +1726 1788 -4.16666666666667e+00 +1726 1730 -4.16666666666667e+00 +1726 1791 4.16666666666667e+00 +1726 1833 -4.16666666666667e+00 +1726 1835 -4.16666666666667e+00 +1726 1793 4.16666666666667e+00 +1726 1328 -8.33333333333333e+00 +1726 1715 8.33333333333333e+00 +1726 1729 -1.25000000000000e+01 +1726 1714 -3.75000000000000e+01 +1726 1728 8.33333333333333e+00 +1726 1713 8.33333333333333e+00 +1726 1725 -1.66666666666667e+01 +1726 1790 8.33333333333333e+00 +1726 1358 -8.33333333333333e+00 +1726 1703 4.16666666666667e+00 +1726 1789 -1.25000000000000e+01 +1727 1727 1.25000000000000e+02 +1727 1702 4.16666666666667e+00 +1727 1696 -4.16666666666667e+00 +1727 1711 -4.16666666666667e+00 +1727 1705 4.16666666666667e+00 +1727 1710 8.33333333333333e+00 +1727 1704 -8.33333333333333e+00 +1727 1695 -4.16666666666667e+00 +1727 1712 -1.25000000000000e+01 +1727 1824 4.16666666666667e+00 +1727 1821 -4.16666666666667e+00 +1727 1825 4.16666666666667e+00 +1727 1724 -3.75000000000000e+01 +1727 1723 8.33333333333333e+00 +1727 1722 8.33333333333333e+00 +1727 1725 -1.66666666666667e+01 +1727 1823 -1.25000000000000e+01 +1727 1822 8.33333333333333e+00 +1727 1726 -1.66666666666667e+01 +1727 1729 -4.16666666666667e+00 +1727 1728 8.33333333333333e+00 +1727 1834 -4.16666666666667e+00 +1727 1792 4.16666666666667e+00 +1727 1791 -8.33333333333333e+00 +1727 1788 8.33333333333333e+00 +1727 1730 -1.25000000000000e+01 +1727 1715 -1.25000000000000e+01 +1727 1327 -8.33333333333333e+00 +1727 1714 8.33333333333333e+00 +1727 1326 4.16666666666667e+00 +1727 1713 -4.16666666666667e+00 +1727 1701 4.16666666666667e+00 +1727 1790 -3.75000000000000e+01 +1727 1789 8.33333333333333e+00 +1727 1357 -8.33333333333333e+00 +1727 1833 -4.16666666666667e+00 +1727 1356 4.16666666666667e+00 +1728 1728 1.25000000000000e+02 +1728 1834 4.16666666666667e+00 +1728 1835 4.16666666666667e+00 +1728 1726 8.33333333333333e+00 +1728 1725 -3.75000000000000e+01 +1728 1723 4.16666666666667e+00 +1728 1826 -4.16666666666667e+00 +1728 1724 -8.33333333333333e+00 +1728 1825 8.33333333333333e+00 +1728 1824 -1.25000000000000e+01 +1728 1729 -1.66666666666667e+01 +1728 1327 -4.16666666666667e+00 +1728 1715 4.16666666666667e+00 +1728 1721 -4.16666666666667e+00 +1728 1792 -4.16666666666667e+00 +1728 1714 -8.33333333333333e+00 +1728 1720 8.33333333333333e+00 +1728 1719 -1.25000000000000e+01 +1728 1793 8.33333333333333e+00 +1728 1791 -1.25000000000000e+01 +1728 1462 -4.16666666666667e+00 +1728 1717 4.16666666666667e+00 +1728 1463 8.33333333333333e+00 +1728 1730 -1.66666666666667e+01 +1728 1718 4.16666666666667e+00 +1728 1328 -4.16666666666667e+00 +1728 1461 -1.25000000000000e+01 +1728 1727 8.33333333333333e+00 +1728 91 -4.16666666666667e+00 +1728 427 4.16666666666667e+00 +1728 428 -8.33333333333333e+00 +1728 365 8.33333333333333e+00 +1728 200 4.16666666666667e+00 +1728 92 -4.16666666666667e+00 +1728 364 8.33333333333333e+00 +1728 199 -8.33333333333333e+00 +1728 363 -3.75000000000000e+01 +1729 1729 1.25000000000000e+02 +1729 1833 4.16666666666667e+00 +1729 1835 -8.33333333333333e+00 +1729 1726 -1.25000000000000e+01 +1729 1725 8.33333333333333e+00 +1729 1722 4.16666666666667e+00 +1729 1826 8.33333333333333e+00 +1729 1724 4.16666666666667e+00 +1729 1825 -3.75000000000000e+01 +1729 1824 8.33333333333333e+00 +1729 1728 -1.66666666666667e+01 +1729 1326 -4.16666666666667e+00 +1729 1793 8.33333333333333e+00 +1729 1730 -1.66666666666667e+01 +1729 1721 8.33333333333333e+00 +1729 1791 -4.16666666666667e+00 +1729 1328 -4.16666666666667e+00 +1729 1715 4.16666666666667e+00 +1729 1720 -3.75000000000000e+01 +1729 1713 -8.33333333333333e+00 +1729 1719 8.33333333333333e+00 +1729 1792 -1.25000000000000e+01 +1729 1461 -4.16666666666667e+00 +1729 1716 4.16666666666667e+00 +1729 1718 -8.33333333333333e+00 +1729 1463 8.33333333333333e+00 +1729 1462 -1.25000000000000e+01 +1729 1727 -4.16666666666667e+00 +1729 90 -4.16666666666667e+00 +1729 426 4.16666666666667e+00 +1729 92 -4.16666666666667e+00 +1729 428 4.16666666666667e+00 +1729 200 4.16666666666667e+00 +1729 365 -4.16666666666667e+00 +1729 364 -1.25000000000000e+01 +1729 363 8.33333333333333e+00 +1729 198 -8.33333333333333e+00 +1730 1730 1.25000000000000e+02 +1730 1725 8.33333333333333e+00 +1730 1834 -8.33333333333333e+00 +1730 1833 4.16666666666667e+00 +1730 1727 -1.25000000000000e+01 +1730 1825 8.33333333333333e+00 +1730 1824 -4.16666666666667e+00 +1730 1723 4.16666666666667e+00 +1730 1722 -8.33333333333333e+00 +1730 1826 -1.25000000000000e+01 +1730 1713 4.16666666666667e+00 +1730 1719 -4.16666666666667e+00 +1730 1792 8.33333333333333e+00 +1730 1729 -1.66666666666667e+01 +1730 1720 8.33333333333333e+00 +1730 1721 -1.25000000000000e+01 +1730 1327 -4.16666666666667e+00 +1730 1714 4.16666666666667e+00 +1730 1793 -3.75000000000000e+01 +1730 1791 8.33333333333333e+00 +1730 1461 8.33333333333333e+00 +1730 1728 -1.66666666666667e+01 +1730 1463 -3.75000000000000e+01 +1730 1717 -8.33333333333333e+00 +1730 1462 8.33333333333333e+00 +1730 1716 4.16666666666667e+00 +1730 1326 -4.16666666666667e+00 +1730 1726 -4.16666666666667e+00 +1730 91 -4.16666666666667e+00 +1730 427 4.16666666666667e+00 +1730 426 -8.33333333333333e+00 +1730 199 4.16666666666667e+00 +1730 364 -4.16666666666667e+00 +1730 363 8.33333333333333e+00 +1730 365 -1.25000000000000e+01 +1730 198 4.16666666666667e+00 +1730 90 -4.16666666666667e+00 +1731 1731 6.25000000000000e+01 +1731 1763 -4.16666666666667e+00 +1731 1760 -4.16666666666667e+00 +1731 1759 2.08333333333333e+00 +1731 1762 -4.16666666666667e+00 +1731 1742 4.16666666666667e+00 +1731 1741 -2.08333333333333e+00 +1731 1747 4.16666666666667e+00 +1731 1740 -6.25000000000000e+00 +1731 1420 -2.08333333333333e+00 +1731 1417 2.08333333333333e+00 +1731 1751 4.16666666666667e+00 +1731 1739 -4.16666666666667e+00 +1731 1331 4.16666666666667e+00 +1731 1418 -4.16666666666667e+00 +1731 1330 4.16666666666667e+00 +1731 1732 -8.33333333333333e+00 +1731 1738 8.33333333333333e+00 +1731 1329 -1.87500000000000e+01 +1731 1737 -1.25000000000000e+01 +1731 1733 -8.33333333333333e+00 +1731 1334 4.16666666666667e+00 +1731 1421 4.16666666666667e+00 +1731 1333 4.16666666666667e+00 +1731 1750 -8.33333333333333e+00 +1731 1748 4.16666666666667e+00 +1731 1332 -1.87500000000000e+01 +1731 1419 -6.25000000000000e+00 +1732 1732 6.25000000000000e+01 +1732 1763 -4.16666666666667e+00 +1732 1758 2.08333333333333e+00 +1732 1761 -4.16666666666667e+00 +1732 1742 4.16666666666667e+00 +1732 1748 -8.33333333333333e+00 +1732 1741 -6.25000000000000e+00 +1732 1740 -2.08333333333333e+00 +1732 1746 4.16666666666667e+00 +1732 1419 -2.08333333333333e+00 +1732 1416 2.08333333333333e+00 +1732 1421 4.16666666666667e+00 +1732 1733 -8.33333333333333e+00 +1732 1739 8.33333333333333e+00 +1732 1331 -2.08333333333333e+00 +1732 1418 2.08333333333333e+00 +1732 1330 -6.25000000000000e+00 +1732 1738 -3.75000000000000e+01 +1732 1329 4.16666666666667e+00 +1732 1731 -8.33333333333333e+00 +1732 1737 8.33333333333333e+00 +1732 1334 -2.08333333333333e+00 +1732 1751 4.16666666666667e+00 +1732 1760 2.08333333333333e+00 +1732 1333 -6.25000000000000e+00 +1732 1420 -6.25000000000000e+00 +1732 1332 4.16666666666667e+00 +1732 1749 -8.33333333333333e+00 +1733 1733 6.25000000000000e+01 +1733 1762 -4.16666666666667e+00 +1733 1746 4.16666666666667e+00 +1733 1761 -4.16666666666667e+00 +1733 1758 -4.16666666666667e+00 +1733 1742 -1.87500000000000e+01 +1733 1741 4.16666666666667e+00 +1733 1747 -8.33333333333333e+00 +1733 1740 4.16666666666667e+00 +1733 1420 4.16666666666667e+00 +1733 1732 -8.33333333333333e+00 +1733 1738 8.33333333333333e+00 +1733 1749 4.16666666666667e+00 +1733 1737 -4.16666666666667e+00 +1733 1331 -6.25000000000000e+00 +1733 1739 -1.25000000000000e+01 +1733 1330 -2.08333333333333e+00 +1733 1417 2.08333333333333e+00 +1733 1329 4.16666666666667e+00 +1733 1416 -4.16666666666667e+00 +1733 1759 2.08333333333333e+00 +1733 1334 -6.25000000000000e+00 +1733 1421 -1.87500000000000e+01 +1733 1333 -2.08333333333333e+00 +1733 1750 4.16666666666667e+00 +1733 1731 -8.33333333333333e+00 +1733 1332 4.16666666666667e+00 +1733 1419 4.16666666666667e+00 +1734 1734 1.25000000000000e+02 +1734 1748 -8.33333333333333e+00 +1734 1747 4.16666666666667e+00 +1734 1780 -4.16666666666667e+00 +1734 1739 8.33333333333333e+00 +1734 1769 4.16666666666667e+00 +1734 1768 -8.33333333333333e+00 +1734 1738 8.33333333333333e+00 +1734 1737 -3.75000000000000e+01 +1734 1736 -1.66666666666667e+01 +1734 1745 8.33333333333333e+00 +1734 1744 -4.16666666666667e+00 +1734 1777 4.16666666666667e+00 +1734 1778 4.16666666666667e+00 +1734 1337 -4.16666666666667e+00 +1734 1331 -4.16666666666667e+00 +1734 1743 -1.25000000000000e+01 +1734 1628 4.16666666666667e+00 +1734 1330 8.33333333333333e+00 +1734 1627 -8.33333333333333e+00 +1734 1631 8.33333333333333e+00 +1734 1735 -1.66666666666667e+01 +1734 1336 8.33333333333333e+00 +1734 1630 8.33333333333333e+00 +1734 1629 -3.75000000000000e+01 +1734 1418 4.16666666666667e+00 +1734 1565 -4.16666666666667e+00 +1734 1417 4.16666666666667e+00 +1734 1564 -4.16666666666667e+00 +1734 1329 -1.25000000000000e+01 +1734 1424 8.33333333333333e+00 +1734 1568 -8.33333333333333e+00 +1734 1423 -4.16666666666667e+00 +1734 1567 4.16666666666667e+00 +1734 1422 -1.25000000000000e+01 +1734 1781 -4.16666666666667e+00 +1734 1335 -1.25000000000000e+01 +1735 1735 1.25000000000000e+02 +1735 1781 -4.16666666666667e+00 +1735 1746 4.16666666666667e+00 +1735 1779 -4.16666666666667e+00 +1735 1769 4.16666666666667e+00 +1735 1739 -4.16666666666667e+00 +1735 1767 -8.33333333333333e+00 +1735 1738 -1.25000000000000e+01 +1735 1737 8.33333333333333e+00 +1735 1743 -4.16666666666667e+00 +1735 1776 4.16666666666667e+00 +1735 1778 -8.33333333333333e+00 +1735 1745 8.33333333333333e+00 +1735 1744 -1.25000000000000e+01 +1735 1628 4.16666666666667e+00 +1735 1329 8.33333333333333e+00 +1735 1626 -8.33333333333333e+00 +1735 1631 -4.16666666666667e+00 +1735 1630 -1.25000000000000e+01 +1735 1734 -1.66666666666667e+01 +1735 1335 8.33333333333333e+00 +1735 1629 8.33333333333333e+00 +1735 1568 4.16666666666667e+00 +1735 1565 -4.16666666666667e+00 +1735 1418 -8.33333333333333e+00 +1735 1331 8.33333333333333e+00 +1735 1330 -3.75000000000000e+01 +1735 1416 4.16666666666667e+00 +1735 1563 -4.16666666666667e+00 +1735 1424 8.33333333333333e+00 +1735 1736 -1.66666666666667e+01 +1735 1337 8.33333333333333e+00 +1735 1423 -1.25000000000000e+01 +1735 1748 4.16666666666667e+00 +1735 1336 -3.75000000000000e+01 +1735 1422 -4.16666666666667e+00 +1735 1566 4.16666666666667e+00 +1736 1736 1.25000000000000e+02 +1736 1747 4.16666666666667e+00 +1736 1780 -4.16666666666667e+00 +1736 1746 -8.33333333333333e+00 +1736 1768 4.16666666666667e+00 +1736 1738 -4.16666666666667e+00 +1736 1737 8.33333333333333e+00 +1736 1767 4.16666666666667e+00 +1736 1739 -1.25000000000000e+01 +1736 1734 -1.66666666666667e+01 +1736 1743 8.33333333333333e+00 +1736 1777 -8.33333333333333e+00 +1736 1776 4.16666666666667e+00 +1736 1335 -4.16666666666667e+00 +1736 1745 -3.75000000000000e+01 +1736 1744 8.33333333333333e+00 +1736 1329 -4.16666666666667e+00 +1736 1626 4.16666666666667e+00 +1736 1627 4.16666666666667e+00 +1736 1631 -1.25000000000000e+01 +1736 1630 -4.16666666666667e+00 +1736 1629 8.33333333333333e+00 +1736 1567 4.16666666666667e+00 +1736 1564 -4.16666666666667e+00 +1736 1416 4.16666666666667e+00 +1736 1563 -4.16666666666667e+00 +1736 1331 -1.25000000000000e+01 +1736 1417 -8.33333333333333e+00 +1736 1330 8.33333333333333e+00 +1736 1424 -3.75000000000000e+01 +1736 1779 -4.16666666666667e+00 +1736 1337 -1.25000000000000e+01 +1736 1423 8.33333333333333e+00 +1736 1735 -1.66666666666667e+01 +1736 1336 8.33333333333333e+00 +1736 1422 8.33333333333333e+00 +1736 1566 -8.33333333333333e+00 +1737 1737 1.25000000000000e+02 +1737 1781 4.16666666666667e+00 +1737 1736 8.33333333333333e+00 +1737 1424 -8.33333333333333e+00 +1737 1423 4.16666666666667e+00 +1737 1735 8.33333333333333e+00 +1737 1734 -3.75000000000000e+01 +1737 1769 -4.16666666666667e+00 +1737 1768 8.33333333333333e+00 +1737 1767 -1.25000000000000e+01 +1737 1747 -4.16666666666667e+00 +1737 1795 -4.16666666666667e+00 +1737 1762 4.16666666666667e+00 +1737 1748 8.33333333333333e+00 +1737 1763 -8.33333333333333e+00 +1737 1340 4.16666666666667e+00 +1737 1796 -4.16666666666667e+00 +1737 1331 4.16666666666667e+00 +1737 1746 -1.25000000000000e+01 +1737 1418 -4.16666666666667e+00 +1737 1417 -4.16666666666667e+00 +1737 1421 4.16666666666667e+00 +1737 1733 -4.16666666666667e+00 +1737 1738 -1.66666666666667e+01 +1737 1420 4.16666666666667e+00 +1737 1426 -4.16666666666667e+00 +1737 1330 -8.33333333333333e+00 +1737 1732 8.33333333333333e+00 +1737 1731 -1.25000000000000e+01 +1737 1739 -1.66666666666667e+01 +1737 1751 8.33333333333333e+00 +1737 1427 8.33333333333333e+00 +1737 1750 8.33333333333333e+00 +1737 1339 -8.33333333333333e+00 +1737 1780 4.16666666666667e+00 +1737 1749 -3.75000000000000e+01 +1737 1425 -1.25000000000000e+01 +1738 1738 1.25000000000000e+02 +1738 1781 -8.33333333333333e+00 +1738 1736 -4.16666666666667e+00 +1738 1424 4.16666666666667e+00 +1738 1422 4.16666666666667e+00 +1738 1735 -1.25000000000000e+01 +1738 1734 8.33333333333333e+00 +1738 1769 8.33333333333333e+00 +1738 1768 -3.75000000000000e+01 +1738 1767 8.33333333333333e+00 +1738 1746 -4.16666666666667e+00 +1738 1794 -4.16666666666667e+00 +1738 1761 4.16666666666667e+00 +1738 1796 -4.16666666666667e+00 +1738 1763 4.16666666666667e+00 +1738 1739 -1.66666666666667e+01 +1738 1748 8.33333333333333e+00 +1738 1747 -1.25000000000000e+01 +1738 1416 -4.16666666666667e+00 +1738 1733 8.33333333333333e+00 +1738 1737 -1.66666666666667e+01 +1738 1421 -8.33333333333333e+00 +1738 1427 8.33333333333333e+00 +1738 1419 4.16666666666667e+00 +1738 1425 -4.16666666666667e+00 +1738 1331 4.16666666666667e+00 +1738 1418 -4.16666666666667e+00 +1738 1732 -3.75000000000000e+01 +1738 1329 -8.33333333333333e+00 +1738 1731 8.33333333333333e+00 +1738 1751 -4.16666666666667e+00 +1738 1340 4.16666666666667e+00 +1738 1779 4.16666666666667e+00 +1738 1750 -1.25000000000000e+01 +1738 1426 -1.25000000000000e+01 +1738 1749 8.33333333333333e+00 +1738 1338 -8.33333333333333e+00 +1739 1739 1.25000000000000e+02 +1739 1779 4.16666666666667e+00 +1739 1735 -4.16666666666667e+00 +1739 1423 4.16666666666667e+00 +1739 1734 8.33333333333333e+00 +1739 1422 -8.33333333333333e+00 +1739 1736 -1.25000000000000e+01 +1739 1769 -1.25000000000000e+01 +1739 1768 8.33333333333333e+00 +1739 1767 -4.16666666666667e+00 +1739 1795 -4.16666666666667e+00 +1739 1762 4.16666666666667e+00 +1739 1746 8.33333333333333e+00 +1739 1761 -8.33333333333333e+00 +1739 1338 4.16666666666667e+00 +1739 1794 -4.16666666666667e+00 +1739 1748 -3.75000000000000e+01 +1739 1738 -1.66666666666667e+01 +1739 1747 8.33333333333333e+00 +1739 1329 4.16666666666667e+00 +1739 1416 -4.16666666666667e+00 +1739 1732 8.33333333333333e+00 +1739 1419 4.16666666666667e+00 +1739 1731 -4.16666666666667e+00 +1739 1420 -8.33333333333333e+00 +1739 1426 8.33333333333333e+00 +1739 1733 -1.25000000000000e+01 +1739 1330 4.16666666666667e+00 +1739 1417 -4.16666666666667e+00 +1739 1780 -8.33333333333333e+00 +1739 1751 -1.25000000000000e+01 +1739 1427 -3.75000000000000e+01 +1739 1750 -4.16666666666667e+00 +1739 1339 4.16666666666667e+00 +1739 1737 -1.66666666666667e+01 +1739 1749 8.33333333333333e+00 +1739 1425 8.33333333333333e+00 +1740 1740 6.25000000000000e+01 +1740 1763 4.16666666666667e+00 +1740 1762 -8.33333333333333e+00 +1740 1733 4.16666666666667e+00 +1740 1732 -2.08333333333333e+00 +1740 1330 2.08333333333333e+00 +1740 1731 -6.25000000000000e+00 +1740 1760 4.16666666666667e+00 +1740 1369 2.08333333333333e+00 +1740 1758 -1.87500000000000e+01 +1740 1748 -4.16666666666667e+00 +1740 1742 -8.33333333333333e+00 +1740 1489 -2.08333333333333e+00 +1740 1859 -4.16666666666667e+00 +1740 1496 4.16666666666667e+00 +1740 1858 -4.16666666666667e+00 +1740 1495 4.16666666666667e+00 +1740 1490 4.16666666666667e+00 +1740 1370 -4.16666666666667e+00 +1740 1488 -6.25000000000000e+00 +1740 1484 4.16666666666667e+00 +1740 1331 -4.16666666666667e+00 +1740 1483 4.16666666666667e+00 +1740 1741 -8.33333333333333e+00 +1740 1747 8.33333333333333e+00 +1740 1482 -1.87500000000000e+01 +1740 1759 4.16666666666667e+00 +1740 1746 -1.25000000000000e+01 +1741 1741 6.25000000000000e+01 +1741 1758 4.16666666666667e+00 +1741 1763 4.16666666666667e+00 +1741 1761 -8.33333333333333e+00 +1741 1733 4.16666666666667e+00 +1741 1742 -8.33333333333333e+00 +1741 1732 -6.25000000000000e+00 +1741 1731 -2.08333333333333e+00 +1741 1329 2.08333333333333e+00 +1741 1759 -6.25000000000000e+00 +1741 1368 2.08333333333333e+00 +1741 1488 -2.08333333333333e+00 +1741 1490 4.16666666666667e+00 +1741 1748 8.33333333333333e+00 +1741 1496 -8.33333333333333e+00 +1741 1857 -4.16666666666667e+00 +1741 1494 4.16666666666667e+00 +1741 1370 2.08333333333333e+00 +1741 1859 -4.16666666666667e+00 +1741 1489 -6.25000000000000e+00 +1741 1484 -2.08333333333333e+00 +1741 1331 2.08333333333333e+00 +1741 1483 -6.25000000000000e+00 +1741 1760 -2.08333333333333e+00 +1741 1747 -3.75000000000000e+01 +1741 1482 4.16666666666667e+00 +1741 1740 -8.33333333333333e+00 +1741 1746 8.33333333333333e+00 +1742 1742 6.25000000000000e+01 +1742 1761 4.16666666666667e+00 +1742 1762 4.16666666666667e+00 +1742 1733 -1.87500000000000e+01 +1742 1732 4.16666666666667e+00 +1742 1741 -8.33333333333333e+00 +1742 1731 4.16666666666667e+00 +1742 1760 -6.25000000000000e+00 +1742 1758 4.16666666666667e+00 +1742 1746 -4.16666666666667e+00 +1742 1740 -8.33333333333333e+00 +1742 1489 4.16666666666667e+00 +1742 1857 -4.16666666666667e+00 +1742 1494 4.16666666666667e+00 +1742 1747 8.33333333333333e+00 +1742 1495 -8.33333333333333e+00 +1742 1490 -1.87500000000000e+01 +1742 1369 2.08333333333333e+00 +1742 1858 -4.16666666666667e+00 +1742 1488 4.16666666666667e+00 +1742 1368 -4.16666666666667e+00 +1742 1484 -6.25000000000000e+00 +1742 1759 -2.08333333333333e+00 +1742 1748 -1.25000000000000e+01 +1742 1483 -2.08333333333333e+00 +1742 1330 2.08333333333333e+00 +1742 1482 4.16666666666667e+00 +1742 1329 -4.16666666666667e+00 +1743 1743 1.25000000000000e+02 +1743 1780 -8.33333333333333e+00 +1743 1748 8.33333333333333e+00 +1743 1496 -8.33333333333333e+00 +1743 1864 -4.16666666666667e+00 +1743 1495 4.16666666666667e+00 +1743 1865 -4.16666666666667e+00 +1743 1747 8.33333333333333e+00 +1743 1746 -3.75000000000000e+01 +1743 1736 8.33333333333333e+00 +1743 1735 -4.16666666666667e+00 +1743 1631 -8.33333333333333e+00 +1743 1630 4.16666666666667e+00 +1743 1373 4.16666666666667e+00 +1743 1778 -4.16666666666667e+00 +1743 1777 8.33333333333333e+00 +1743 1744 -1.66666666666667e+01 +1743 1776 -1.25000000000000e+01 +1743 1331 4.16666666666667e+00 +1743 1734 -1.25000000000000e+01 +1743 1484 -4.16666666666667e+00 +1743 1483 8.33333333333333e+00 +1743 1628 -4.16666666666667e+00 +1743 1481 4.16666666666667e+00 +1743 1639 8.33333333333333e+00 +1743 1480 -8.33333333333333e+00 +1743 1330 4.16666666666667e+00 +1743 1627 -4.16666666666667e+00 +1743 1482 -1.25000000000000e+01 +1743 1745 -1.66666666666667e+01 +1743 1493 8.33333333333333e+00 +1743 1640 8.33333333333333e+00 +1743 1492 -4.16666666666667e+00 +1743 1372 4.16666666666667e+00 +1743 1781 4.16666666666667e+00 +1743 1491 -1.25000000000000e+01 +1743 1638 -3.75000000000000e+01 +1744 1744 1.25000000000000e+02 +1744 1779 -8.33333333333333e+00 +1744 1748 -4.16666666666667e+00 +1744 1865 -4.16666666666667e+00 +1744 1496 4.16666666666667e+00 +1744 1863 -4.16666666666667e+00 +1744 1494 4.16666666666667e+00 +1744 1747 -1.25000000000000e+01 +1744 1746 8.33333333333333e+00 +1744 1734 -4.16666666666667e+00 +1744 1631 4.16666666666667e+00 +1744 1629 4.16666666666667e+00 +1744 1778 8.33333333333333e+00 +1744 1777 -3.75000000000000e+01 +1744 1776 8.33333333333333e+00 +1744 1743 -1.66666666666667e+01 +1744 1736 8.33333333333333e+00 +1744 1735 -1.25000000000000e+01 +1744 1640 -4.16666666666667e+00 +1744 1745 -1.66666666666667e+01 +1744 1628 -4.16666666666667e+00 +1744 1481 4.16666666666667e+00 +1744 1482 8.33333333333333e+00 +1744 1638 8.33333333333333e+00 +1744 1479 -8.33333333333333e+00 +1744 1331 -8.33333333333333e+00 +1744 1484 8.33333333333333e+00 +1744 1483 -3.75000000000000e+01 +1744 1329 4.16666666666667e+00 +1744 1626 -4.16666666666667e+00 +1744 1493 8.33333333333333e+00 +1744 1373 -8.33333333333333e+00 +1744 1781 4.16666666666667e+00 +1744 1492 -1.25000000000000e+01 +1744 1639 -1.25000000000000e+01 +1744 1491 -4.16666666666667e+00 +1744 1371 4.16666666666667e+00 +1745 1745 1.25000000000000e+02 +1745 1779 4.16666666666667e+00 +1745 1747 -4.16666666666667e+00 +1745 1864 -4.16666666666667e+00 +1745 1495 4.16666666666667e+00 +1745 1746 8.33333333333333e+00 +1745 1494 -8.33333333333333e+00 +1745 1863 -4.16666666666667e+00 +1745 1748 -1.25000000000000e+01 +1745 1734 8.33333333333333e+00 +1745 1630 4.16666666666667e+00 +1745 1629 -8.33333333333333e+00 +1745 1778 -1.25000000000000e+01 +1745 1777 8.33333333333333e+00 +1745 1371 4.16666666666667e+00 +1745 1776 -4.16666666666667e+00 +1745 1736 -3.75000000000000e+01 +1745 1735 8.33333333333333e+00 +1745 1329 4.16666666666667e+00 +1745 1639 -4.16666666666667e+00 +1745 1744 -1.66666666666667e+01 +1745 1482 -4.16666666666667e+00 +1745 1627 -4.16666666666667e+00 +1745 1480 4.16666666666667e+00 +1745 1626 -4.16666666666667e+00 +1745 1479 4.16666666666667e+00 +1745 1484 -1.25000000000000e+01 +1745 1330 -8.33333333333333e+00 +1745 1483 8.33333333333333e+00 +1745 1780 4.16666666666667e+00 +1745 1493 -3.75000000000000e+01 +1745 1640 -1.25000000000000e+01 +1745 1492 8.33333333333333e+00 +1745 1372 -8.33333333333333e+00 +1745 1743 -1.66666666666667e+01 +1745 1491 8.33333333333333e+00 +1745 1638 8.33333333333333e+00 +1746 1746 1.25000000000000e+02 +1746 1780 8.33333333333333e+00 +1746 1736 -8.33333333333333e+00 +1746 1735 4.16666666666667e+00 +1746 1779 -1.25000000000000e+01 +1746 1745 8.33333333333333e+00 +1746 1864 4.16666666666667e+00 +1746 1744 8.33333333333333e+00 +1746 1743 -3.75000000000000e+01 +1746 1865 4.16666666666667e+00 +1746 1738 -4.16666666666667e+00 +1746 1739 8.33333333333333e+00 +1746 1748 -1.66666666666667e+01 +1746 1331 -4.16666666666667e+00 +1746 1737 -1.25000000000000e+01 +1746 1796 4.16666666666667e+00 +1746 1376 -4.16666666666667e+00 +1746 1795 -8.33333333333333e+00 +1746 1733 4.16666666666667e+00 +1746 1747 -1.66666666666667e+01 +1746 1762 8.33333333333333e+00 +1746 1732 4.16666666666667e+00 +1746 1330 -4.16666666666667e+00 +1746 1763 8.33333333333333e+00 +1746 1375 -4.16666666666667e+00 +1746 1761 -3.75000000000000e+01 +1746 1742 -4.16666666666667e+00 +1746 1484 4.16666666666667e+00 +1746 1858 4.16666666666667e+00 +1746 1495 -4.16666666666667e+00 +1746 1483 -8.33333333333333e+00 +1746 1741 8.33333333333333e+00 +1746 1740 -1.25000000000000e+01 +1746 1496 8.33333333333333e+00 +1746 1859 -8.33333333333333e+00 +1746 1494 -1.25000000000000e+01 +1746 1781 -4.16666666666667e+00 +1747 1747 1.25000000000000e+02 +1747 1779 8.33333333333333e+00 +1747 1734 4.16666666666667e+00 +1747 1781 8.33333333333333e+00 +1747 1780 -3.75000000000000e+01 +1747 1745 -4.16666666666667e+00 +1747 1863 4.16666666666667e+00 +1747 1744 -1.25000000000000e+01 +1747 1743 8.33333333333333e+00 +1747 1865 -8.33333333333333e+00 +1747 1737 -4.16666666666667e+00 +1747 1796 4.16666666666667e+00 +1747 1739 8.33333333333333e+00 +1747 1738 -1.25000000000000e+01 +1747 1794 -8.33333333333333e+00 +1747 1763 -4.16666666666667e+00 +1747 1746 -1.66666666666667e+01 +1747 1761 8.33333333333333e+00 +1747 1733 -8.33333333333333e+00 +1747 1731 4.16666666666667e+00 +1747 1329 -4.16666666666667e+00 +1747 1762 -1.25000000000000e+01 +1747 1374 -4.16666666666667e+00 +1747 1742 8.33333333333333e+00 +1747 1748 -1.66666666666667e+01 +1747 1496 8.33333333333333e+00 +1747 1857 4.16666666666667e+00 +1747 1494 -4.16666666666667e+00 +1747 1484 4.16666666666667e+00 +1747 1331 -4.16666666666667e+00 +1747 1741 -3.75000000000000e+01 +1747 1482 -8.33333333333333e+00 +1747 1740 8.33333333333333e+00 +1747 1859 4.16666666666667e+00 +1747 1376 -4.16666666666667e+00 +1747 1495 -1.25000000000000e+01 +1747 1736 4.16666666666667e+00 +1748 1748 1.25000000000000e+02 +1748 1779 -4.16666666666667e+00 +1748 1734 -8.33333333333333e+00 +1748 1781 -1.25000000000000e+01 +1748 1780 8.33333333333333e+00 +1748 1744 -4.16666666666667e+00 +1748 1743 8.33333333333333e+00 +1748 1745 -1.25000000000000e+01 +1748 1864 -8.33333333333333e+00 +1748 1863 4.16666666666667e+00 +1748 1795 4.16666666666667e+00 +1748 1737 8.33333333333333e+00 +1748 1746 -1.66666666666667e+01 +1748 1739 -3.75000000000000e+01 +1748 1738 8.33333333333333e+00 +1748 1329 -4.16666666666667e+00 +1748 1794 4.16666666666667e+00 +1748 1374 -4.16666666666667e+00 +1748 1731 4.16666666666667e+00 +1748 1762 -4.16666666666667e+00 +1748 1732 -8.33333333333333e+00 +1748 1763 -1.25000000000000e+01 +1748 1761 8.33333333333333e+00 +1748 1740 -4.16666666666667e+00 +1748 1482 4.16666666666667e+00 +1748 1741 8.33333333333333e+00 +1748 1747 -1.66666666666667e+01 +1748 1495 8.33333333333333e+00 +1748 1742 -1.25000000000000e+01 +1748 1483 4.16666666666667e+00 +1748 1330 -4.16666666666667e+00 +1748 1496 -3.75000000000000e+01 +1748 1735 4.16666666666667e+00 +1748 1858 4.16666666666667e+00 +1748 1375 -4.16666666666667e+00 +1748 1494 8.33333333333333e+00 +1748 1857 -8.33333333333333e+00 +1749 1749 1.25000000000000e+02 +1749 1787 4.16666666666667e+00 +1749 1786 -8.33333333333333e+00 +1749 1756 8.33333333333333e+00 +1749 1755 -3.75000000000000e+01 +1749 1682 4.16666666666667e+00 +1749 1681 4.16666666666667e+00 +1749 1685 8.33333333333333e+00 +1749 1684 -4.16666666666667e+00 +1749 1683 -1.25000000000000e+01 +1749 1751 -1.66666666666667e+01 +1749 1334 -4.16666666666667e+00 +1749 1340 -4.16666666666667e+00 +1749 1799 -4.16666666666667e+00 +1749 1796 4.16666666666667e+00 +1749 1766 -8.33333333333333e+00 +1749 1763 8.33333333333333e+00 +1749 1765 4.16666666666667e+00 +1749 1762 -4.16666666666667e+00 +1749 1761 -1.25000000000000e+01 +1749 1798 -4.16666666666667e+00 +1749 1795 4.16666666666667e+00 +1749 1421 -4.16666666666667e+00 +1749 1733 4.16666666666667e+00 +1749 1420 -4.16666666666667e+00 +1749 1426 4.16666666666667e+00 +1749 1732 -8.33333333333333e+00 +1749 1333 8.33333333333333e+00 +1749 1332 -1.25000000000000e+01 +1749 1739 8.33333333333333e+00 +1749 1427 -8.33333333333333e+00 +1749 1738 8.33333333333333e+00 +1749 1750 -1.66666666666667e+01 +1749 1339 8.33333333333333e+00 +1749 1737 -3.75000000000000e+01 +1749 1757 8.33333333333333e+00 +1749 1338 -1.25000000000000e+01 +1750 1750 1.25000000000000e+02 +1750 1757 -4.16666666666667e+00 +1750 1785 -8.33333333333333e+00 +1750 1756 -1.25000000000000e+01 +1750 1755 8.33333333333333e+00 +1750 1682 -8.33333333333333e+00 +1750 1680 4.16666666666667e+00 +1750 1685 8.33333333333333e+00 +1750 1684 -1.25000000000000e+01 +1750 1683 -4.16666666666667e+00 +1750 1799 -4.16666666666667e+00 +1750 1766 4.16666666666667e+00 +1750 1334 8.33333333333333e+00 +1750 1751 -1.66666666666667e+01 +1750 1763 8.33333333333333e+00 +1750 1762 -1.25000000000000e+01 +1750 1764 4.16666666666667e+00 +1750 1761 -4.16666666666667e+00 +1750 1340 8.33333333333333e+00 +1750 1796 -8.33333333333333e+00 +1750 1797 -4.16666666666667e+00 +1750 1794 4.16666666666667e+00 +1750 1419 -4.16666666666667e+00 +1750 1425 4.16666666666667e+00 +1750 1733 4.16666666666667e+00 +1750 1421 -4.16666666666667e+00 +1750 1333 -3.75000000000000e+01 +1750 1731 -8.33333333333333e+00 +1750 1332 8.33333333333333e+00 +1750 1739 -4.16666666666667e+00 +1750 1427 4.16666666666667e+00 +1750 1738 -1.25000000000000e+01 +1750 1787 4.16666666666667e+00 +1750 1339 -3.75000000000000e+01 +1750 1737 8.33333333333333e+00 +1750 1749 -1.66666666666667e+01 +1750 1338 8.33333333333333e+00 +1751 1751 1.25000000000000e+02 +1751 1756 -4.16666666666667e+00 +1751 1755 8.33333333333333e+00 +1751 1785 4.16666666666667e+00 +1751 1757 -1.25000000000000e+01 +1751 1680 4.16666666666667e+00 +1751 1681 -8.33333333333333e+00 +1751 1685 -3.75000000000000e+01 +1751 1684 8.33333333333333e+00 +1751 1683 8.33333333333333e+00 +1751 1749 -1.66666666666667e+01 +1751 1332 -4.16666666666667e+00 +1751 1338 -4.16666666666667e+00 +1751 1797 -4.16666666666667e+00 +1751 1794 4.16666666666667e+00 +1751 1798 -4.16666666666667e+00 +1751 1765 4.16666666666667e+00 +1751 1763 -3.75000000000000e+01 +1751 1333 8.33333333333333e+00 +1751 1750 -1.66666666666667e+01 +1751 1762 8.33333333333333e+00 +1751 1764 -8.33333333333333e+00 +1751 1761 8.33333333333333e+00 +1751 1339 8.33333333333333e+00 +1751 1795 -8.33333333333333e+00 +1751 1419 -4.16666666666667e+00 +1751 1731 4.16666666666667e+00 +1751 1334 -1.25000000000000e+01 +1751 1732 4.16666666666667e+00 +1751 1420 -4.16666666666667e+00 +1751 1739 -1.25000000000000e+01 +1751 1786 4.16666666666667e+00 +1751 1340 -1.25000000000000e+01 +1751 1738 -4.16666666666667e+00 +1751 1426 4.16666666666667e+00 +1751 1737 8.33333333333333e+00 +1751 1425 -8.33333333333333e+00 +1752 1752 6.25000000000000e+01 +1752 1757 -4.16666666666667e+00 +1752 1690 -2.08333333333333e+00 +1752 1681 2.08333333333333e+00 +1752 1691 4.16666666666667e+00 +1752 1689 -6.25000000000000e+00 +1752 1682 -4.16666666666667e+00 +1752 1753 -8.33333333333333e+00 +1752 1756 8.33333333333333e+00 +1752 1333 4.16666666666667e+00 +1752 1755 -1.25000000000000e+01 +1752 1766 4.16666666666667e+00 +1752 1754 -8.33333333333333e+00 +1752 1499 4.16666666666667e+00 +1752 1334 4.16666666666667e+00 +1752 1498 -2.08333333333333e+00 +1752 1765 4.16666666666667e+00 +1752 1497 -6.25000000000000e+00 +1752 1332 -1.87500000000000e+01 +1752 46 4.16666666666667e+00 +1752 391 -8.33333333333333e+00 +1752 401 -4.16666666666667e+00 +1752 47 4.16666666666667e+00 +1752 236 -4.16666666666667e+00 +1752 235 2.08333333333333e+00 +1752 400 -4.16666666666667e+00 +1752 45 -1.87500000000000e+01 +1752 392 4.16666666666667e+00 +1753 1753 6.25000000000000e+01 +1753 1691 4.16666666666667e+00 +1753 1757 8.33333333333333e+00 +1753 1689 -2.08333333333333e+00 +1753 1680 2.08333333333333e+00 +1753 1690 -6.25000000000000e+00 +1753 1682 2.08333333333333e+00 +1753 1334 -2.08333333333333e+00 +1753 1756 -3.75000000000000e+01 +1753 1752 -8.33333333333333e+00 +1753 1755 8.33333333333333e+00 +1753 1332 4.16666666666667e+00 +1753 1499 4.16666666666667e+00 +1753 1766 -8.33333333333333e+00 +1753 1754 -8.33333333333333e+00 +1753 1498 -6.25000000000000e+00 +1753 1333 -6.25000000000000e+00 +1753 1497 -2.08333333333333e+00 +1753 1764 4.16666666666667e+00 +1753 47 -2.08333333333333e+00 +1753 392 4.16666666666667e+00 +1753 45 4.16666666666667e+00 +1753 390 -8.33333333333333e+00 +1753 236 2.08333333333333e+00 +1753 401 -4.16666666666667e+00 +1753 46 -6.25000000000000e+00 +1753 234 2.08333333333333e+00 +1753 399 -4.16666666666667e+00 +1754 1754 6.25000000000000e+01 +1754 1755 -4.16666666666667e+00 +1754 1753 -8.33333333333333e+00 +1754 1690 4.16666666666667e+00 +1754 1756 8.33333333333333e+00 +1754 1691 -1.87500000000000e+01 +1754 1689 4.16666666666667e+00 +1754 1757 -1.25000000000000e+01 +1754 1681 2.08333333333333e+00 +1754 1333 -2.08333333333333e+00 +1754 1680 -4.16666666666667e+00 +1754 1764 4.16666666666667e+00 +1754 1499 -1.87500000000000e+01 +1754 1334 -6.25000000000000e+00 +1754 1498 4.16666666666667e+00 +1754 1765 -8.33333333333333e+00 +1754 1752 -8.33333333333333e+00 +1754 1497 4.16666666666667e+00 +1754 1332 4.16666666666667e+00 +1754 46 -2.08333333333333e+00 +1754 391 4.16666666666667e+00 +1754 235 2.08333333333333e+00 +1754 400 -4.16666666666667e+00 +1754 399 -4.16666666666667e+00 +1754 47 -6.25000000000000e+00 +1754 45 4.16666666666667e+00 +1754 234 -4.16666666666667e+00 +1754 390 4.16666666666667e+00 +1755 1755 1.25000000000000e+02 +1755 1798 4.16666666666667e+00 +1755 1766 8.33333333333333e+00 +1755 1765 -4.16666666666667e+00 +1755 1764 -1.25000000000000e+01 +1755 1691 4.16666666666667e+00 +1755 1754 -4.16666666666667e+00 +1755 1690 4.16666666666667e+00 +1755 1757 -1.66666666666667e+01 +1755 1753 8.33333333333333e+00 +1755 1752 -1.25000000000000e+01 +1755 1756 -1.66666666666667e+01 +1755 1693 -4.16666666666667e+00 +1755 1694 8.33333333333333e+00 +1755 1685 -8.33333333333333e+00 +1755 1751 8.33333333333333e+00 +1755 1681 -4.16666666666667e+00 +1755 1684 4.16666666666667e+00 +1755 1787 -4.16666666666667e+00 +1755 1786 8.33333333333333e+00 +1755 1692 -1.25000000000000e+01 +1755 1785 -1.25000000000000e+01 +1755 1682 -4.16666666666667e+00 +1755 1334 4.16666666666667e+00 +1755 1750 8.33333333333333e+00 +1755 1333 -8.33333333333333e+00 +1755 1799 4.16666666666667e+00 +1755 1749 -3.75000000000000e+01 +1755 433 -4.16666666666667e+00 +1755 401 -8.33333333333333e+00 +1755 400 4.16666666666667e+00 +1755 434 -4.16666666666667e+00 +1755 392 8.33333333333333e+00 +1755 391 8.33333333333333e+00 +1755 390 -3.75000000000000e+01 +1755 53 4.16666666666667e+00 +1755 52 -8.33333333333333e+00 +1756 1756 1.25000000000000e+02 +1756 1797 4.16666666666667e+00 +1756 1764 -4.16666666666667e+00 +1756 1766 8.33333333333333e+00 +1756 1765 -1.25000000000000e+01 +1756 1754 8.33333333333333e+00 +1756 1691 -8.33333333333333e+00 +1756 1689 4.16666666666667e+00 +1756 1334 4.16666666666667e+00 +1756 1753 -3.75000000000000e+01 +1756 1752 8.33333333333333e+00 +1756 1751 -4.16666666666667e+00 +1756 1755 -1.66666666666667e+01 +1756 1692 -4.16666666666667e+00 +1756 1685 4.16666666666667e+00 +1756 1682 -4.16666666666667e+00 +1756 1680 -4.16666666666667e+00 +1756 1683 4.16666666666667e+00 +1756 1694 8.33333333333333e+00 +1756 1787 8.33333333333333e+00 +1756 1757 -1.66666666666667e+01 +1756 1693 -1.25000000000000e+01 +1756 1786 -3.75000000000000e+01 +1756 1785 8.33333333333333e+00 +1756 1799 -8.33333333333333e+00 +1756 1750 -1.25000000000000e+01 +1756 1749 8.33333333333333e+00 +1756 1332 -8.33333333333333e+00 +1756 432 -4.16666666666667e+00 +1756 434 -4.16666666666667e+00 +1756 401 4.16666666666667e+00 +1756 399 4.16666666666667e+00 +1756 392 -4.16666666666667e+00 +1756 53 4.16666666666667e+00 +1756 391 -1.25000000000000e+01 +1756 390 8.33333333333333e+00 +1756 51 -8.33333333333333e+00 +1757 1757 1.25000000000000e+02 +1757 1798 -8.33333333333333e+00 +1757 1764 8.33333333333333e+00 +1757 1766 -3.75000000000000e+01 +1757 1765 8.33333333333333e+00 +1757 1689 4.16666666666667e+00 +1757 1752 -4.16666666666667e+00 +1757 1753 8.33333333333333e+00 +1757 1690 -8.33333333333333e+00 +1757 1755 -1.66666666666667e+01 +1757 1754 -1.25000000000000e+01 +1757 1333 4.16666666666667e+00 +1757 1750 -4.16666666666667e+00 +1757 1684 4.16666666666667e+00 +1757 1681 -4.16666666666667e+00 +1757 1692 8.33333333333333e+00 +1757 1683 -8.33333333333333e+00 +1757 1749 8.33333333333333e+00 +1757 1694 -3.75000000000000e+01 +1757 1787 -1.25000000000000e+01 +1757 1693 8.33333333333333e+00 +1757 1786 8.33333333333333e+00 +1757 1756 -1.66666666666667e+01 +1757 1785 -4.16666666666667e+00 +1757 1797 4.16666666666667e+00 +1757 1751 -1.25000000000000e+01 +1757 1680 -4.16666666666667e+00 +1757 1332 4.16666666666667e+00 +1757 433 -4.16666666666667e+00 +1757 400 4.16666666666667e+00 +1757 399 -8.33333333333333e+00 +1757 432 -4.16666666666667e+00 +1757 392 -1.25000000000000e+01 +1757 391 -4.16666666666667e+00 +1757 52 4.16666666666667e+00 +1757 390 8.33333333333333e+00 +1757 51 4.16666666666667e+00 +1758 1758 6.25000000000000e+01 +1758 1759 -8.33333333333333e+00 +1758 1733 -4.16666666666667e+00 +1758 1333 -2.08333333333333e+00 +1758 1732 2.08333333333333e+00 +1758 1742 4.16666666666667e+00 +1758 1369 -2.08333333333333e+00 +1758 1740 -1.87500000000000e+01 +1758 1858 4.16666666666667e+00 +1758 1763 -4.16666666666667e+00 +1758 1762 8.33333333333333e+00 +1758 1761 -1.25000000000000e+01 +1758 1859 4.16666666666667e+00 +1758 1766 4.16666666666667e+00 +1758 1862 -4.16666666666667e+00 +1758 1501 2.08333333333333e+00 +1758 1861 -4.16666666666667e+00 +1758 1370 4.16666666666667e+00 +1758 1502 -4.16666666666667e+00 +1758 1368 -6.25000000000000e+00 +1758 1760 -8.33333333333333e+00 +1758 1499 4.16666666666667e+00 +1758 1334 4.16666666666667e+00 +1758 1498 4.16666666666667e+00 +1758 1765 -8.33333333333333e+00 +1758 1741 4.16666666666667e+00 +1758 1497 -1.87500000000000e+01 +1758 1332 -6.25000000000000e+00 +1759 1759 6.25000000000000e+01 +1759 1733 2.08333333333333e+00 +1759 1740 4.16666666666667e+00 +1759 1758 -8.33333333333333e+00 +1759 1332 -2.08333333333333e+00 +1759 1731 2.08333333333333e+00 +1759 1741 -6.25000000000000e+00 +1759 1368 -2.08333333333333e+00 +1759 1857 4.16666666666667e+00 +1759 1334 4.16666666666667e+00 +1759 1760 -8.33333333333333e+00 +1759 1763 8.33333333333333e+00 +1759 1762 -3.75000000000000e+01 +1759 1761 8.33333333333333e+00 +1759 1370 4.16666666666667e+00 +1759 1859 -8.33333333333333e+00 +1759 1500 2.08333333333333e+00 +1759 1860 -4.16666666666667e+00 +1759 1502 2.08333333333333e+00 +1759 1862 -4.16666666666667e+00 +1759 1369 -6.25000000000000e+00 +1759 1499 -2.08333333333333e+00 +1759 1766 4.16666666666667e+00 +1759 1742 -2.08333333333333e+00 +1759 1498 -6.25000000000000e+00 +1759 1333 -6.25000000000000e+00 +1759 1497 4.16666666666667e+00 +1759 1764 -8.33333333333333e+00 +1760 1760 6.25000000000000e+01 +1760 1732 2.08333333333333e+00 +1760 1731 -4.16666666666667e+00 +1760 1742 -6.25000000000000e+00 +1760 1740 4.16666666666667e+00 +1760 1763 -1.25000000000000e+01 +1760 1333 4.16666666666667e+00 +1760 1759 -8.33333333333333e+00 +1760 1762 8.33333333333333e+00 +1760 1761 -4.16666666666667e+00 +1760 1369 4.16666666666667e+00 +1760 1858 -8.33333333333333e+00 +1760 1857 4.16666666666667e+00 +1760 1764 4.16666666666667e+00 +1760 1860 -4.16666666666667e+00 +1760 1370 -1.87500000000000e+01 +1760 1501 2.08333333333333e+00 +1760 1861 -4.16666666666667e+00 +1760 1368 4.16666666666667e+00 +1760 1500 -4.16666666666667e+00 +1760 1741 -2.08333333333333e+00 +1760 1499 -6.25000000000000e+00 +1760 1334 -1.87500000000000e+01 +1760 1498 -2.08333333333333e+00 +1760 1765 4.16666666666667e+00 +1760 1758 -8.33333333333333e+00 +1760 1497 4.16666666666667e+00 +1760 1332 4.16666666666667e+00 +1761 1761 1.25000000000000e+02 +1761 1739 -8.33333333333333e+00 +1761 1742 4.16666666666667e+00 +1761 1733 -4.16666666666667e+00 +1761 1741 -8.33333333333333e+00 +1761 1747 8.33333333333333e+00 +1761 1732 -4.16666666666667e+00 +1761 1748 8.33333333333333e+00 +1761 1746 -3.75000000000000e+01 +1761 1861 4.16666666666667e+00 +1761 1858 -4.16666666666667e+00 +1761 1862 -8.33333333333333e+00 +1761 1859 8.33333333333333e+00 +1761 1334 4.16666666666667e+00 +1761 1760 -4.16666666666667e+00 +1761 1759 8.33333333333333e+00 +1761 1762 -1.66666666666667e+01 +1761 1758 -1.25000000000000e+01 +1761 1376 4.16666666666667e+00 +1761 1857 -1.25000000000000e+01 +1761 1796 -4.16666666666667e+00 +1761 1799 4.16666666666667e+00 +1761 1871 -4.16666666666667e+00 +1761 1765 8.33333333333333e+00 +1761 1798 -8.33333333333333e+00 +1761 1795 8.33333333333333e+00 +1761 1766 8.33333333333333e+00 +1761 1751 8.33333333333333e+00 +1761 1763 -1.66666666666667e+01 +1761 1333 4.16666666666667e+00 +1761 1750 -4.16666666666667e+00 +1761 1764 -3.75000000000000e+01 +1761 1749 -1.25000000000000e+01 +1761 1870 -4.16666666666667e+00 +1761 1375 4.16666666666667e+00 +1761 1738 4.16666666666667e+00 +1761 1794 -1.25000000000000e+01 +1762 1762 1.25000000000000e+02 +1762 1739 4.16666666666667e+00 +1762 1733 -4.16666666666667e+00 +1762 1742 4.16666666666667e+00 +1762 1748 -4.16666666666667e+00 +1762 1740 -8.33333333333333e+00 +1762 1746 8.33333333333333e+00 +1762 1731 -4.16666666666667e+00 +1762 1747 -1.25000000000000e+01 +1762 1860 4.16666666666667e+00 +1762 1857 -4.16666666666667e+00 +1762 1862 4.16666666666667e+00 +1762 1760 8.33333333333333e+00 +1762 1759 -3.75000000000000e+01 +1762 1758 8.33333333333333e+00 +1762 1761 -1.66666666666667e+01 +1762 1859 8.33333333333333e+00 +1762 1858 -1.25000000000000e+01 +1762 1763 -1.66666666666667e+01 +1762 1766 -4.16666666666667e+00 +1762 1764 8.33333333333333e+00 +1762 1799 4.16666666666667e+00 +1762 1871 -4.16666666666667e+00 +1762 1797 -8.33333333333333e+00 +1762 1794 8.33333333333333e+00 +1762 1334 -8.33333333333333e+00 +1762 1751 8.33333333333333e+00 +1762 1765 -1.25000000000000e+01 +1762 1750 -1.25000000000000e+01 +1762 1332 4.16666666666667e+00 +1762 1749 -4.16666666666667e+00 +1762 1796 8.33333333333333e+00 +1762 1376 -8.33333333333333e+00 +1762 1737 4.16666666666667e+00 +1762 1795 -3.75000000000000e+01 +1762 1869 -4.16666666666667e+00 +1762 1374 4.16666666666667e+00 +1763 1763 1.25000000000000e+02 +1763 1737 -8.33333333333333e+00 +1763 1732 -4.16666666666667e+00 +1763 1740 4.16666666666667e+00 +1763 1731 -4.16666666666667e+00 +1763 1741 4.16666666666667e+00 +1763 1747 -4.16666666666667e+00 +1763 1748 -1.25000000000000e+01 +1763 1746 8.33333333333333e+00 +1763 1861 4.16666666666667e+00 +1763 1860 -8.33333333333333e+00 +1763 1857 8.33333333333333e+00 +1763 1760 -1.25000000000000e+01 +1763 1759 8.33333333333333e+00 +1763 1332 4.16666666666667e+00 +1763 1758 -4.16666666666667e+00 +1763 1859 -3.75000000000000e+01 +1763 1858 8.33333333333333e+00 +1763 1374 4.16666666666667e+00 +1763 1762 -1.66666666666667e+01 +1763 1794 -4.16666666666667e+00 +1763 1765 -4.16666666666667e+00 +1763 1797 4.16666666666667e+00 +1763 1869 -4.16666666666667e+00 +1763 1798 4.16666666666667e+00 +1763 1870 -4.16666666666667e+00 +1763 1766 -1.25000000000000e+01 +1763 1751 -3.75000000000000e+01 +1763 1333 -8.33333333333333e+00 +1763 1750 8.33333333333333e+00 +1763 1764 8.33333333333333e+00 +1763 1749 8.33333333333333e+00 +1763 1761 -1.66666666666667e+01 +1763 1738 4.16666666666667e+00 +1763 1796 -1.25000000000000e+01 +1763 1795 8.33333333333333e+00 +1763 1375 -8.33333333333333e+00 +1764 1764 1.25000000000000e+02 +1764 1756 -4.16666666666667e+00 +1764 1755 -1.25000000000000e+01 +1764 1754 4.16666666666667e+00 +1764 1753 4.16666666666667e+00 +1764 1766 -1.66666666666667e+01 +1764 1334 -4.16666666666667e+00 +1764 1799 -4.16666666666667e+00 +1764 1871 4.16666666666667e+00 +1764 1798 8.33333333333333e+00 +1764 1765 -1.66666666666667e+01 +1764 1762 8.33333333333333e+00 +1764 1751 -8.33333333333333e+00 +1764 1763 8.33333333333333e+00 +1764 1333 -4.16666666666667e+00 +1764 1750 4.16666666666667e+00 +1764 1761 -3.75000000000000e+01 +1764 1870 4.16666666666667e+00 +1764 1797 -1.25000000000000e+01 +1764 1499 -4.16666666666667e+00 +1764 1760 4.16666666666667e+00 +1764 1861 -4.16666666666667e+00 +1764 1759 -8.33333333333333e+00 +1764 1498 8.33333333333333e+00 +1764 1497 -1.25000000000000e+01 +1764 1862 8.33333333333333e+00 +1764 1860 -1.25000000000000e+01 +1764 1757 8.33333333333333e+00 +1764 434 4.16666666666667e+00 +1764 433 -8.33333333333333e+00 +1764 400 8.33333333333333e+00 +1764 401 8.33333333333333e+00 +1764 399 -3.75000000000000e+01 +1764 113 -4.16666666666667e+00 +1764 112 -4.16666666666667e+00 +1764 241 4.16666666666667e+00 +1764 242 -8.33333333333333e+00 +1765 1765 1.25000000000000e+02 +1765 1755 -4.16666666666667e+00 +1765 1757 8.33333333333333e+00 +1765 1756 -1.25000000000000e+01 +1765 1754 -8.33333333333333e+00 +1765 1752 4.16666666666667e+00 +1765 1751 4.16666666666667e+00 +1765 1763 -4.16666666666667e+00 +1765 1797 8.33333333333333e+00 +1765 1764 -1.66666666666667e+01 +1765 1761 8.33333333333333e+00 +1765 1762 -1.25000000000000e+01 +1765 1332 -4.16666666666667e+00 +1765 1749 4.16666666666667e+00 +1765 1799 8.33333333333333e+00 +1765 1871 -8.33333333333333e+00 +1765 1798 -3.75000000000000e+01 +1765 1869 4.16666666666667e+00 +1765 1499 8.33333333333333e+00 +1765 1766 -1.66666666666667e+01 +1765 1862 8.33333333333333e+00 +1765 1860 -4.16666666666667e+00 +1765 1760 4.16666666666667e+00 +1765 1334 -4.16666666666667e+00 +1765 1498 -3.75000000000000e+01 +1765 1758 -8.33333333333333e+00 +1765 1497 8.33333333333333e+00 +1765 1861 -1.25000000000000e+01 +1765 432 -8.33333333333333e+00 +1765 401 -4.16666666666667e+00 +1765 399 8.33333333333333e+00 +1765 400 -1.25000000000000e+01 +1765 111 -4.16666666666667e+00 +1765 240 4.16666666666667e+00 +1765 242 4.16666666666667e+00 +1765 113 -4.16666666666667e+00 +1765 434 4.16666666666667e+00 +1766 1766 1.25000000000000e+02 +1766 1755 8.33333333333333e+00 +1766 1757 -3.75000000000000e+01 +1766 1756 8.33333333333333e+00 +1766 1752 4.16666666666667e+00 +1766 1753 -8.33333333333333e+00 +1766 1764 -1.66666666666667e+01 +1766 1332 -4.16666666666667e+00 +1766 1750 4.16666666666667e+00 +1766 1762 -4.16666666666667e+00 +1766 1797 -4.16666666666667e+00 +1766 1869 4.16666666666667e+00 +1766 1763 -1.25000000000000e+01 +1766 1749 -8.33333333333333e+00 +1766 1761 8.33333333333333e+00 +1766 1799 -1.25000000000000e+01 +1766 1798 8.33333333333333e+00 +1766 1870 -8.33333333333333e+00 +1766 1497 -4.16666666666667e+00 +1766 1758 4.16666666666667e+00 +1766 1498 8.33333333333333e+00 +1766 1765 -1.66666666666667e+01 +1766 1861 8.33333333333333e+00 +1766 1499 -1.25000000000000e+01 +1766 1759 4.16666666666667e+00 +1766 1333 -4.16666666666667e+00 +1766 1862 -3.75000000000000e+01 +1766 1860 8.33333333333333e+00 +1766 432 4.16666666666667e+00 +1766 400 -4.16666666666667e+00 +1766 401 -1.25000000000000e+01 +1766 399 8.33333333333333e+00 +1766 111 -4.16666666666667e+00 +1766 433 4.16666666666667e+00 +1766 241 4.16666666666667e+00 +1766 112 -4.16666666666667e+00 +1766 240 -8.33333333333333e+00 +1767 1767 1.25000000000000e+02 +1767 1775 -4.16666666666667e+00 +1767 1789 -8.33333333333333e+00 +1767 1774 8.33333333333333e+00 +1767 1773 -1.25000000000000e+01 +1767 1700 -8.33333333333333e+00 +1767 1699 4.16666666666667e+00 +1767 1703 8.33333333333333e+00 +1767 1702 -4.16666666666667e+00 +1767 1701 -1.25000000000000e+01 +1767 1802 -4.16666666666667e+00 +1767 1784 4.16666666666667e+00 +1767 1337 8.33333333333333e+00 +1767 1769 -1.66666666666667e+01 +1767 1781 8.33333333333333e+00 +1767 1783 4.16666666666667e+00 +1767 1780 -4.16666666666667e+00 +1767 1779 -1.25000000000000e+01 +1767 1340 8.33333333333333e+00 +1767 1796 -8.33333333333333e+00 +1767 1801 -4.16666666666667e+00 +1767 1795 4.16666666666667e+00 +1767 1423 -4.16666666666667e+00 +1767 1426 4.16666666666667e+00 +1767 1736 4.16666666666667e+00 +1767 1424 -4.16666666666667e+00 +1767 1336 8.33333333333333e+00 +1767 1735 -8.33333333333333e+00 +1767 1335 -3.75000000000000e+01 +1767 1739 -4.16666666666667e+00 +1767 1427 4.16666666666667e+00 +1767 1768 -1.66666666666667e+01 +1767 1738 8.33333333333333e+00 +1767 1339 8.33333333333333e+00 +1767 1790 4.16666666666667e+00 +1767 1737 -1.25000000000000e+01 +1767 1338 -3.75000000000000e+01 +1768 1768 1.25000000000000e+02 +1768 1790 4.16666666666667e+00 +1768 1788 -8.33333333333333e+00 +1768 1774 -3.75000000000000e+01 +1768 1773 8.33333333333333e+00 +1768 1700 4.16666666666667e+00 +1768 1698 4.16666666666667e+00 +1768 1703 8.33333333333333e+00 +1768 1702 -1.25000000000000e+01 +1768 1701 -4.16666666666667e+00 +1768 1769 -1.66666666666667e+01 +1768 1340 -4.16666666666667e+00 +1768 1337 -4.16666666666667e+00 +1768 1796 4.16666666666667e+00 +1768 1802 -4.16666666666667e+00 +1768 1784 -8.33333333333333e+00 +1768 1781 8.33333333333333e+00 +1768 1780 -1.25000000000000e+01 +1768 1782 4.16666666666667e+00 +1768 1779 -4.16666666666667e+00 +1768 1800 -4.16666666666667e+00 +1768 1794 4.16666666666667e+00 +1768 1736 4.16666666666667e+00 +1768 1424 -4.16666666666667e+00 +1768 1422 -4.16666666666667e+00 +1768 1425 4.16666666666667e+00 +1768 1336 -1.25000000000000e+01 +1768 1335 8.33333333333333e+00 +1768 1734 -8.33333333333333e+00 +1768 1739 8.33333333333333e+00 +1768 1427 -8.33333333333333e+00 +1768 1775 8.33333333333333e+00 +1768 1738 -3.75000000000000e+01 +1768 1339 -1.25000000000000e+01 +1768 1767 -1.66666666666667e+01 +1768 1737 8.33333333333333e+00 +1768 1338 8.33333333333333e+00 +1769 1769 1.25000000000000e+02 +1769 1773 -4.16666666666667e+00 +1769 1774 8.33333333333333e+00 +1769 1789 4.16666666666667e+00 +1769 1775 -1.25000000000000e+01 +1769 1699 4.16666666666667e+00 +1769 1698 -8.33333333333333e+00 +1769 1703 -3.75000000000000e+01 +1769 1702 8.33333333333333e+00 +1769 1701 8.33333333333333e+00 +1769 1768 -1.66666666666667e+01 +1769 1339 -4.16666666666667e+00 +1769 1336 -4.16666666666667e+00 +1769 1795 4.16666666666667e+00 +1769 1801 -4.16666666666667e+00 +1769 1800 -4.16666666666667e+00 +1769 1782 4.16666666666667e+00 +1769 1781 -3.75000000000000e+01 +1769 1783 -8.33333333333333e+00 +1769 1780 8.33333333333333e+00 +1769 1335 8.33333333333333e+00 +1769 1767 -1.66666666666667e+01 +1769 1779 8.33333333333333e+00 +1769 1338 8.33333333333333e+00 +1769 1794 -8.33333333333333e+00 +1769 1735 4.16666666666667e+00 +1769 1423 -4.16666666666667e+00 +1769 1337 -1.25000000000000e+01 +1769 1734 4.16666666666667e+00 +1769 1422 -4.16666666666667e+00 +1769 1788 4.16666666666667e+00 +1769 1739 -1.25000000000000e+01 +1769 1340 -1.25000000000000e+01 +1769 1738 8.33333333333333e+00 +1769 1426 -8.33333333333333e+00 +1769 1737 -4.16666666666667e+00 +1769 1425 4.16666666666667e+00 +1770 1770 1.25000000000000e+02 +1770 1829 4.16666666666667e+00 +1770 1828 -8.33333333333333e+00 +1770 1774 8.33333333333333e+00 +1770 1773 -3.75000000000000e+01 +1770 1832 -4.16666666666667e+00 +1770 1831 -4.16666666666667e+00 +1770 1784 -8.33333333333333e+00 +1770 1783 4.16666666666667e+00 +1770 1700 4.16666666666667e+00 +1770 1709 8.33333333333333e+00 +1770 1708 -4.16666666666667e+00 +1770 1707 -1.25000000000000e+01 +1770 1699 4.16666666666667e+00 +1770 1603 4.16666666666667e+00 +1770 1594 -4.16666666666667e+00 +1770 1595 -4.16666666666667e+00 +1770 1604 -8.33333333333333e+00 +1770 1667 8.33333333333333e+00 +1770 1772 -1.66666666666667e+01 +1770 1520 8.33333333333333e+00 +1770 1525 4.16666666666667e+00 +1770 1519 -4.16666666666667e+00 +1770 1337 -4.16666666666667e+00 +1770 1661 4.16666666666667e+00 +1770 1336 8.33333333333333e+00 +1770 1660 -8.33333333333333e+00 +1770 1335 -1.25000000000000e+01 +1770 1518 -1.25000000000000e+01 +1770 1355 -4.16666666666667e+00 +1770 1526 4.16666666666667e+00 +1770 1771 -1.66666666666667e+01 +1770 1354 8.33333333333333e+00 +1770 1666 8.33333333333333e+00 +1770 1775 8.33333333333333e+00 +1770 1353 -1.25000000000000e+01 +1770 1665 -3.75000000000000e+01 +1771 1771 1.25000000000000e+02 +1771 1775 -4.16666666666667e+00 +1771 1827 -8.33333333333333e+00 +1771 1774 -1.25000000000000e+01 +1771 1773 8.33333333333333e+00 +1771 1832 -4.16666666666667e+00 +1771 1784 4.16666666666667e+00 +1771 1830 -4.16666666666667e+00 +1771 1782 4.16666666666667e+00 +1771 1709 8.33333333333333e+00 +1771 1708 -1.25000000000000e+01 +1771 1707 -4.16666666666667e+00 +1771 1700 -8.33333333333333e+00 +1771 1698 4.16666666666667e+00 +1771 1602 4.16666666666667e+00 +1771 1593 -4.16666666666667e+00 +1771 1604 4.16666666666667e+00 +1771 1595 -4.16666666666667e+00 +1771 1667 -4.16666666666667e+00 +1771 1661 4.16666666666667e+00 +1771 1524 4.16666666666667e+00 +1771 1518 -4.16666666666667e+00 +1771 1337 8.33333333333333e+00 +1771 1772 -1.66666666666667e+01 +1771 1520 8.33333333333333e+00 +1771 1336 -3.75000000000000e+01 +1771 1519 -1.25000000000000e+01 +1771 1335 8.33333333333333e+00 +1771 1659 -8.33333333333333e+00 +1771 1355 8.33333333333333e+00 +1771 1526 -8.33333333333333e+00 +1771 1829 4.16666666666667e+00 +1771 1354 -3.75000000000000e+01 +1771 1666 -1.25000000000000e+01 +1771 1770 -1.66666666666667e+01 +1771 1353 8.33333333333333e+00 +1771 1665 8.33333333333333e+00 +1772 1772 1.25000000000000e+02 +1772 1774 -4.16666666666667e+00 +1772 1773 8.33333333333333e+00 +1772 1827 4.16666666666667e+00 +1772 1775 -1.25000000000000e+01 +1772 1830 -4.16666666666667e+00 +1772 1831 -4.16666666666667e+00 +1772 1783 4.16666666666667e+00 +1772 1782 -8.33333333333333e+00 +1772 1698 4.16666666666667e+00 +1772 1709 -3.75000000000000e+01 +1772 1708 8.33333333333333e+00 +1772 1707 8.33333333333333e+00 +1772 1699 -8.33333333333333e+00 +1772 1593 -4.16666666666667e+00 +1772 1603 4.16666666666667e+00 +1772 1602 -8.33333333333333e+00 +1772 1594 -4.16666666666667e+00 +1772 1666 -4.16666666666667e+00 +1772 1660 4.16666666666667e+00 +1772 1665 8.33333333333333e+00 +1772 1770 -1.66666666666667e+01 +1772 1518 8.33333333333333e+00 +1772 1337 -1.25000000000000e+01 +1772 1520 -3.75000000000000e+01 +1772 1336 8.33333333333333e+00 +1772 1771 -1.66666666666667e+01 +1772 1519 8.33333333333333e+00 +1772 1335 -4.16666666666667e+00 +1772 1659 4.16666666666667e+00 +1772 1828 4.16666666666667e+00 +1772 1355 -1.25000000000000e+01 +1772 1667 -1.25000000000000e+01 +1772 1354 8.33333333333333e+00 +1772 1525 -8.33333333333333e+00 +1772 1353 -4.16666666666667e+00 +1772 1524 4.16666666666667e+00 +1773 1773 1.25000000000000e+02 +1773 1801 4.16666666666667e+00 +1773 1837 -4.16666666666667e+00 +1773 1832 4.16666666666667e+00 +1773 1838 -4.16666666666667e+00 +1773 1831 4.16666666666667e+00 +1773 1783 -4.16666666666667e+00 +1773 1784 8.33333333333333e+00 +1773 1782 -1.25000000000000e+01 +1773 1709 -8.33333333333333e+00 +1773 1772 8.33333333333333e+00 +1773 1708 4.16666666666667e+00 +1773 1358 4.16666666666667e+00 +1773 1829 -4.16666666666667e+00 +1773 1828 8.33333333333333e+00 +1773 1827 -1.25000000000000e+01 +1773 1337 4.16666666666667e+00 +1773 1771 8.33333333333333e+00 +1773 1770 -3.75000000000000e+01 +1773 1769 -4.16666666666667e+00 +1773 1774 -1.66666666666667e+01 +1773 1711 -4.16666666666667e+00 +1773 1703 4.16666666666667e+00 +1773 1700 -4.16666666666667e+00 +1773 1702 4.16666666666667e+00 +1773 1699 -4.16666666666667e+00 +1773 1712 8.33333333333333e+00 +1773 1790 8.33333333333333e+00 +1773 1775 -1.66666666666667e+01 +1773 1357 -8.33333333333333e+00 +1773 1789 8.33333333333333e+00 +1773 1710 -1.25000000000000e+01 +1773 1788 -3.75000000000000e+01 +1773 1768 8.33333333333333e+00 +1773 1336 -8.33333333333333e+00 +1773 1802 -8.33333333333333e+00 +1773 1767 -1.25000000000000e+01 +1774 1774 1.25000000000000e+02 +1774 1800 4.16666666666667e+00 +1774 1836 -4.16666666666667e+00 +1774 1832 -8.33333333333333e+00 +1774 1784 8.33333333333333e+00 +1774 1830 4.16666666666667e+00 +1774 1782 -4.16666666666667e+00 +1774 1838 -4.16666666666667e+00 +1774 1783 -1.25000000000000e+01 +1774 1709 4.16666666666667e+00 +1774 1772 -4.16666666666667e+00 +1774 1707 4.16666666666667e+00 +1774 1829 8.33333333333333e+00 +1774 1775 -1.66666666666667e+01 +1774 1828 -3.75000000000000e+01 +1774 1827 8.33333333333333e+00 +1774 1771 -1.25000000000000e+01 +1774 1770 8.33333333333333e+00 +1774 1773 -1.66666666666667e+01 +1774 1710 -4.16666666666667e+00 +1774 1712 8.33333333333333e+00 +1774 1703 -8.33333333333333e+00 +1774 1769 8.33333333333333e+00 +1774 1701 4.16666666666667e+00 +1774 1698 -4.16666666666667e+00 +1774 1358 4.16666666666667e+00 +1774 1790 -4.16666666666667e+00 +1774 1711 -1.25000000000000e+01 +1774 1789 -1.25000000000000e+01 +1774 1356 -8.33333333333333e+00 +1774 1788 8.33333333333333e+00 +1774 1700 -4.16666666666667e+00 +1774 1337 4.16666666666667e+00 +1774 1802 4.16666666666667e+00 +1774 1768 -3.75000000000000e+01 +1774 1767 8.33333333333333e+00 +1774 1335 -8.33333333333333e+00 +1775 1775 1.25000000000000e+02 +1775 1800 -8.33333333333333e+00 +1775 1830 4.16666666666667e+00 +1775 1836 -4.16666666666667e+00 +1775 1831 -8.33333333333333e+00 +1775 1783 8.33333333333333e+00 +1775 1837 -4.16666666666667e+00 +1775 1784 -3.75000000000000e+01 +1775 1782 8.33333333333333e+00 +1775 1708 4.16666666666667e+00 +1775 1771 -4.16666666666667e+00 +1775 1707 -8.33333333333333e+00 +1775 1770 8.33333333333333e+00 +1775 1829 -1.25000000000000e+01 +1775 1828 8.33333333333333e+00 +1775 1774 -1.66666666666667e+01 +1775 1356 4.16666666666667e+00 +1775 1827 -4.16666666666667e+00 +1775 1772 -1.25000000000000e+01 +1775 1335 4.16666666666667e+00 +1775 1767 -4.16666666666667e+00 +1775 1711 8.33333333333333e+00 +1775 1701 4.16666666666667e+00 +1775 1698 -4.16666666666667e+00 +1775 1702 -8.33333333333333e+00 +1775 1768 8.33333333333333e+00 +1775 1712 -3.75000000000000e+01 +1775 1790 -1.25000000000000e+01 +1775 1357 4.16666666666667e+00 +1775 1789 -4.16666666666667e+00 +1775 1710 8.33333333333333e+00 +1775 1788 8.33333333333333e+00 +1775 1773 -1.66666666666667e+01 +1775 1801 4.16666666666667e+00 +1775 1769 -1.25000000000000e+01 +1775 1699 -4.16666666666667e+00 +1775 1336 4.16666666666667e+00 +1776 1776 1.25000000000000e+02 +1776 1865 -8.33333333333333e+00 +1776 1781 8.33333333333333e+00 +1776 1780 8.33333333333333e+00 +1776 1779 -3.75000000000000e+01 +1776 1867 -4.16666666666667e+00 +1776 1868 -4.16666666666667e+00 +1776 1784 4.16666666666667e+00 +1776 1783 -8.33333333333333e+00 +1776 1735 4.16666666666667e+00 +1776 1630 -4.16666666666667e+00 +1776 1745 -4.16666666666667e+00 +1776 1640 4.16666666666667e+00 +1776 1744 8.33333333333333e+00 +1776 1639 -8.33333333333333e+00 +1776 1743 -1.25000000000000e+01 +1776 1736 4.16666666666667e+00 +1776 1631 -4.16666666666667e+00 +1776 1532 4.16666666666667e+00 +1776 1520 -4.16666666666667e+00 +1776 1777 -1.66666666666667e+01 +1776 1519 8.33333333333333e+00 +1776 1672 8.33333333333333e+00 +1776 1337 8.33333333333333e+00 +1776 1661 -8.33333333333333e+00 +1776 1336 -4.16666666666667e+00 +1776 1660 4.16666666666667e+00 +1776 1335 -1.25000000000000e+01 +1776 1518 -1.25000000000000e+01 +1776 1778 -1.66666666666667e+01 +1776 1373 8.33333333333333e+00 +1776 1673 8.33333333333333e+00 +1776 1372 -4.16666666666667e+00 +1776 1531 4.16666666666667e+00 +1776 1864 4.16666666666667e+00 +1776 1371 -1.25000000000000e+01 +1776 1671 -3.75000000000000e+01 +1777 1777 1.25000000000000e+02 +1777 1865 4.16666666666667e+00 +1777 1781 -4.16666666666667e+00 +1777 1780 -1.25000000000000e+01 +1777 1779 8.33333333333333e+00 +1777 1784 4.16666666666667e+00 +1777 1868 -4.16666666666667e+00 +1777 1866 -4.16666666666667e+00 +1777 1782 -8.33333333333333e+00 +1777 1734 4.16666666666667e+00 +1777 1629 -4.16666666666667e+00 +1777 1640 4.16666666666667e+00 +1777 1631 -4.16666666666667e+00 +1777 1745 8.33333333333333e+00 +1777 1744 -3.75000000000000e+01 +1777 1743 8.33333333333333e+00 +1777 1638 -8.33333333333333e+00 +1777 1736 -8.33333333333333e+00 +1777 1661 4.16666666666667e+00 +1777 1673 -4.16666666666667e+00 +1777 1776 -1.66666666666667e+01 +1777 1518 8.33333333333333e+00 +1777 1671 8.33333333333333e+00 +1777 1337 8.33333333333333e+00 +1777 1778 -1.66666666666667e+01 +1777 1520 8.33333333333333e+00 +1777 1336 -1.25000000000000e+01 +1777 1519 -3.75000000000000e+01 +1777 1335 -4.16666666666667e+00 +1777 1659 4.16666666666667e+00 +1777 1373 8.33333333333333e+00 +1777 1532 -8.33333333333333e+00 +1777 1863 4.16666666666667e+00 +1777 1372 -1.25000000000000e+01 +1777 1672 -1.25000000000000e+01 +1777 1371 -4.16666666666667e+00 +1777 1530 4.16666666666667e+00 +1778 1778 1.25000000000000e+02 +1778 1863 -8.33333333333333e+00 +1778 1781 -1.25000000000000e+01 +1778 1780 -4.16666666666667e+00 +1778 1779 8.33333333333333e+00 +1778 1783 4.16666666666667e+00 +1778 1867 -4.16666666666667e+00 +1778 1866 -4.16666666666667e+00 +1778 1782 4.16666666666667e+00 +1778 1639 4.16666666666667e+00 +1778 1630 -4.16666666666667e+00 +1778 1745 -1.25000000000000e+01 +1778 1744 8.33333333333333e+00 +1778 1743 -4.16666666666667e+00 +1778 1638 4.16666666666667e+00 +1778 1735 -8.33333333333333e+00 +1778 1734 4.16666666666667e+00 +1778 1629 -4.16666666666667e+00 +1778 1530 4.16666666666667e+00 +1778 1518 -4.16666666666667e+00 +1778 1660 4.16666666666667e+00 +1778 1672 -4.16666666666667e+00 +1778 1337 -3.75000000000000e+01 +1778 1520 -1.25000000000000e+01 +1778 1336 8.33333333333333e+00 +1778 1777 -1.66666666666667e+01 +1778 1519 8.33333333333333e+00 +1778 1335 8.33333333333333e+00 +1778 1659 -8.33333333333333e+00 +1778 1864 4.16666666666667e+00 +1778 1373 -3.75000000000000e+01 +1778 1673 -1.25000000000000e+01 +1778 1372 8.33333333333333e+00 +1778 1531 -8.33333333333333e+00 +1778 1776 -1.66666666666667e+01 +1778 1371 8.33333333333333e+00 +1778 1671 8.33333333333333e+00 +1779 1779 1.25000000000000e+02 +1779 1739 4.16666666666667e+00 +1779 1736 -4.16666666666667e+00 +1779 1748 -4.16666666666667e+00 +1779 1745 4.16666666666667e+00 +1779 1747 8.33333333333333e+00 +1779 1744 -8.33333333333333e+00 +1779 1735 -4.16666666666667e+00 +1779 1746 -1.25000000000000e+01 +1779 1867 4.16666666666667e+00 +1779 1864 -4.16666666666667e+00 +1779 1868 4.16666666666667e+00 +1779 1778 8.33333333333333e+00 +1779 1777 8.33333333333333e+00 +1779 1780 -1.66666666666667e+01 +1779 1776 -3.75000000000000e+01 +1779 1865 8.33333333333333e+00 +1779 1863 -1.25000000000000e+01 +1779 1781 -1.66666666666667e+01 +1779 1784 -4.16666666666667e+00 +1779 1783 8.33333333333333e+00 +1779 1874 -4.16666666666667e+00 +1779 1802 4.16666666666667e+00 +1779 1801 -8.33333333333333e+00 +1779 1795 8.33333333333333e+00 +1779 1337 -8.33333333333333e+00 +1779 1769 8.33333333333333e+00 +1779 1336 4.16666666666667e+00 +1779 1768 -4.16666666666667e+00 +1779 1782 -1.25000000000000e+01 +1779 1767 -1.25000000000000e+01 +1779 1796 8.33333333333333e+00 +1779 1376 -8.33333333333333e+00 +1779 1873 -4.16666666666667e+00 +1779 1375 4.16666666666667e+00 +1779 1738 4.16666666666667e+00 +1779 1794 -3.75000000000000e+01 +1780 1780 1.25000000000000e+02 +1780 1739 -8.33333333333333e+00 +1780 1736 -4.16666666666667e+00 +1780 1745 4.16666666666667e+00 +1780 1746 8.33333333333333e+00 +1780 1743 -8.33333333333333e+00 +1780 1734 -4.16666666666667e+00 +1780 1748 8.33333333333333e+00 +1780 1747 -3.75000000000000e+01 +1780 1866 4.16666666666667e+00 +1780 1863 -4.16666666666667e+00 +1780 1865 8.33333333333333e+00 +1780 1868 -8.33333333333333e+00 +1780 1778 -4.16666666666667e+00 +1780 1337 4.16666666666667e+00 +1780 1777 -1.25000000000000e+01 +1780 1776 8.33333333333333e+00 +1780 1779 -1.66666666666667e+01 +1780 1376 4.16666666666667e+00 +1780 1864 -1.25000000000000e+01 +1780 1796 -4.16666666666667e+00 +1780 1802 4.16666666666667e+00 +1780 1874 -4.16666666666667e+00 +1780 1782 8.33333333333333e+00 +1780 1800 -8.33333333333333e+00 +1780 1794 8.33333333333333e+00 +1780 1784 8.33333333333333e+00 +1780 1769 8.33333333333333e+00 +1780 1781 -1.66666666666667e+01 +1780 1783 -3.75000000000000e+01 +1780 1768 -1.25000000000000e+01 +1780 1335 4.16666666666667e+00 +1780 1767 -4.16666666666667e+00 +1780 1737 4.16666666666667e+00 +1780 1795 -1.25000000000000e+01 +1780 1872 -4.16666666666667e+00 +1780 1374 4.16666666666667e+00 +1781 1781 1.25000000000000e+02 +1781 1737 4.16666666666667e+00 +1781 1734 -4.16666666666667e+00 +1781 1735 -4.16666666666667e+00 +1781 1744 4.16666666666667e+00 +1781 1746 -4.16666666666667e+00 +1781 1743 4.16666666666667e+00 +1781 1748 -1.25000000000000e+01 +1781 1747 8.33333333333333e+00 +1781 1864 8.33333333333333e+00 +1781 1867 -8.33333333333333e+00 +1781 1866 4.16666666666667e+00 +1781 1778 -1.25000000000000e+01 +1781 1777 -4.16666666666667e+00 +1781 1336 4.16666666666667e+00 +1781 1776 8.33333333333333e+00 +1781 1865 -3.75000000000000e+01 +1781 1375 4.16666666666667e+00 +1781 1863 8.33333333333333e+00 +1781 1795 -4.16666666666667e+00 +1781 1779 -1.66666666666667e+01 +1781 1782 -4.16666666666667e+00 +1781 1801 4.16666666666667e+00 +1781 1873 -4.16666666666667e+00 +1781 1872 -4.16666666666667e+00 +1781 1800 4.16666666666667e+00 +1781 1784 -1.25000000000000e+01 +1781 1769 -3.75000000000000e+01 +1781 1783 8.33333333333333e+00 +1781 1768 8.33333333333333e+00 +1781 1780 -1.66666666666667e+01 +1781 1335 -8.33333333333333e+00 +1781 1767 8.33333333333333e+00 +1781 1738 -8.33333333333333e+00 +1781 1796 -1.25000000000000e+01 +1781 1794 8.33333333333333e+00 +1781 1374 -8.33333333333333e+00 +1782 1782 1.25000000000000e+02 +1782 1774 -4.16666666666667e+00 +1782 1837 -8.33333333333333e+00 +1782 1775 8.33333333333333e+00 +1782 1773 -1.25000000000000e+01 +1782 1832 -4.16666666666667e+00 +1782 1831 8.33333333333333e+00 +1782 1830 -1.25000000000000e+01 +1782 1772 -8.33333333333333e+00 +1782 1771 4.16666666666667e+00 +1782 1769 4.16666666666667e+00 +1782 1781 -4.16666666666667e+00 +1782 1783 -1.66666666666667e+01 +1782 1801 8.33333333333333e+00 +1782 1780 8.33333333333333e+00 +1782 1802 8.33333333333333e+00 +1782 1874 -8.33333333333333e+00 +1782 1381 -4.16666666666667e+00 +1782 1873 4.16666666666667e+00 +1782 1800 -3.75000000000000e+01 +1782 1336 -4.16666666666667e+00 +1782 1768 4.16666666666667e+00 +1782 1779 -1.25000000000000e+01 +1782 1520 8.33333333333333e+00 +1782 1784 -1.66666666666667e+01 +1782 1868 8.33333333333333e+00 +1782 1537 4.16666666666667e+00 +1782 1867 -4.16666666666667e+00 +1782 1778 4.16666666666667e+00 +1782 1337 -4.16666666666667e+00 +1782 1519 8.33333333333333e+00 +1782 1777 -8.33333333333333e+00 +1782 1518 -3.75000000000000e+01 +1782 1538 4.16666666666667e+00 +1782 1382 -4.16666666666667e+00 +1782 1866 -1.25000000000000e+01 +1782 1838 4.16666666666667e+00 +1783 1783 1.25000000000000e+02 +1783 1773 -4.16666666666667e+00 +1783 1838 4.16666666666667e+00 +1783 1836 -8.33333333333333e+00 +1783 1774 -1.25000000000000e+01 +1783 1772 4.16666666666667e+00 +1783 1830 8.33333333333333e+00 +1783 1832 8.33333333333333e+00 +1783 1831 -3.75000000000000e+01 +1783 1770 4.16666666666667e+00 +1783 1784 -1.66666666666667e+01 +1783 1337 -4.16666666666667e+00 +1783 1382 -4.16666666666667e+00 +1783 1802 -4.16666666666667e+00 +1783 1874 4.16666666666667e+00 +1783 1782 -1.66666666666667e+01 +1783 1800 8.33333333333333e+00 +1783 1779 8.33333333333333e+00 +1783 1801 -1.25000000000000e+01 +1783 1380 -4.16666666666667e+00 +1783 1872 4.16666666666667e+00 +1783 1769 -8.33333333333333e+00 +1783 1781 8.33333333333333e+00 +1783 1780 -3.75000000000000e+01 +1783 1335 -4.16666666666667e+00 +1783 1767 4.16666666666667e+00 +1783 1520 -4.16666666666667e+00 +1783 1778 4.16666666666667e+00 +1783 1536 4.16666666666667e+00 +1783 1866 -4.16666666666667e+00 +1783 1519 -1.25000000000000e+01 +1783 1518 8.33333333333333e+00 +1783 1776 -8.33333333333333e+00 +1783 1538 -8.33333333333333e+00 +1783 1868 8.33333333333333e+00 +1783 1867 -1.25000000000000e+01 +1783 1775 8.33333333333333e+00 +1784 1784 1.25000000000000e+02 +1784 1774 8.33333333333333e+00 +1784 1837 4.16666666666667e+00 +1784 1775 -3.75000000000000e+01 +1784 1773 8.33333333333333e+00 +1784 1830 -4.16666666666667e+00 +1784 1771 4.16666666666667e+00 +1784 1832 -1.25000000000000e+01 +1784 1831 8.33333333333333e+00 +1784 1770 -8.33333333333333e+00 +1784 1783 -1.66666666666667e+01 +1784 1336 -4.16666666666667e+00 +1784 1381 -4.16666666666667e+00 +1784 1767 4.16666666666667e+00 +1784 1779 -4.16666666666667e+00 +1784 1801 -4.16666666666667e+00 +1784 1873 4.16666666666667e+00 +1784 1802 -1.25000000000000e+01 +1784 1800 8.33333333333333e+00 +1784 1872 -8.33333333333333e+00 +1784 1781 -1.25000000000000e+01 +1784 1768 -8.33333333333333e+00 +1784 1780 8.33333333333333e+00 +1784 1519 -4.16666666666667e+00 +1784 1777 4.16666666666667e+00 +1784 1518 8.33333333333333e+00 +1784 1782 -1.66666666666667e+01 +1784 1866 8.33333333333333e+00 +1784 1520 -1.25000000000000e+01 +1784 1776 4.16666666666667e+00 +1784 1335 -4.16666666666667e+00 +1784 1868 -3.75000000000000e+01 +1784 1836 4.16666666666667e+00 +1784 1537 -8.33333333333333e+00 +1784 1867 8.33333333333333e+00 +1784 1536 4.16666666666667e+00 +1784 1380 -4.16666666666667e+00 +1785 1785 1.25000000000000e+02 +1785 1720 -4.16666666666667e+00 +1785 1715 -8.33333333333333e+00 +1785 1721 8.33333333333333e+00 +1785 1719 -1.25000000000000e+01 +1785 1793 -4.16666666666667e+00 +1785 1792 8.33333333333333e+00 +1785 1791 -1.25000000000000e+01 +1785 1684 -4.16666666666667e+00 +1785 1693 4.16666666666667e+00 +1785 1694 4.16666666666667e+00 +1785 1757 -4.16666666666667e+00 +1785 1786 -1.66666666666667e+01 +1785 1756 8.33333333333333e+00 +1785 1755 -1.25000000000000e+01 +1785 1685 -4.16666666666667e+00 +1785 1751 4.16666666666667e+00 +1785 1339 8.33333333333333e+00 +1785 1750 -8.33333333333333e+00 +1785 1541 4.16666666666667e+00 +1785 1787 -1.66666666666667e+01 +1785 1799 8.33333333333333e+00 +1785 1340 8.33333333333333e+00 +1785 1798 -4.16666666666667e+00 +1785 1540 4.16666666666667e+00 +1785 1714 4.16666666666667e+00 +1785 1797 -1.25000000000000e+01 +1785 1338 -3.75000000000000e+01 +1785 428 4.16666666666667e+00 +1785 427 -8.33333333333333e+00 +1785 52 8.33333333333333e+00 +1785 278 -4.16666666666667e+00 +1785 53 8.33333333333333e+00 +1785 434 -8.33333333333333e+00 +1785 433 4.16666666666667e+00 +1785 277 -4.16666666666667e+00 +1785 51 -3.75000000000000e+01 +1786 1786 1.25000000000000e+02 +1786 1719 -4.16666666666667e+00 +1786 1721 8.33333333333333e+00 +1786 1715 4.16666666666667e+00 +1786 1720 -1.25000000000000e+01 +1786 1793 8.33333333333333e+00 +1786 1792 -3.75000000000000e+01 +1786 1791 8.33333333333333e+00 +1786 1787 -1.66666666666667e+01 +1786 1340 -4.16666666666667e+00 +1786 1751 4.16666666666667e+00 +1786 1685 -4.16666666666667e+00 +1786 1683 -4.16666666666667e+00 +1786 1692 4.16666666666667e+00 +1786 1694 -8.33333333333333e+00 +1786 1757 8.33333333333333e+00 +1786 1756 -3.75000000000000e+01 +1786 1785 -1.66666666666667e+01 +1786 1755 8.33333333333333e+00 +1786 1338 8.33333333333333e+00 +1786 1749 -8.33333333333333e+00 +1786 1799 8.33333333333333e+00 +1786 1541 -8.33333333333333e+00 +1786 1713 4.16666666666667e+00 +1786 1798 -1.25000000000000e+01 +1786 1339 -1.25000000000000e+01 +1786 1797 -4.16666666666667e+00 +1786 1539 4.16666666666667e+00 +1786 428 4.16666666666667e+00 +1786 426 -8.33333333333333e+00 +1786 53 -4.16666666666667e+00 +1786 51 8.33333333333333e+00 +1786 434 4.16666666666667e+00 +1786 278 -4.16666666666667e+00 +1786 52 -1.25000000000000e+01 +1786 432 4.16666666666667e+00 +1786 276 -4.16666666666667e+00 +1787 1787 1.25000000000000e+02 +1787 1714 4.16666666666667e+00 +1787 1713 -8.33333333333333e+00 +1787 1721 -3.75000000000000e+01 +1787 1719 8.33333333333333e+00 +1787 1793 -1.25000000000000e+01 +1787 1792 8.33333333333333e+00 +1787 1791 -4.16666666666667e+00 +1787 1786 -1.66666666666667e+01 +1787 1339 -4.16666666666667e+00 +1787 1750 4.16666666666667e+00 +1787 1684 -4.16666666666667e+00 +1787 1757 -1.25000000000000e+01 +1787 1693 -8.33333333333333e+00 +1787 1756 8.33333333333333e+00 +1787 1692 4.16666666666667e+00 +1787 1755 -4.16666666666667e+00 +1787 1683 -4.16666666666667e+00 +1787 1749 4.16666666666667e+00 +1787 1539 4.16666666666667e+00 +1787 1720 8.33333333333333e+00 +1787 1799 -3.75000000000000e+01 +1787 1340 -1.25000000000000e+01 +1787 1798 8.33333333333333e+00 +1787 1540 -8.33333333333333e+00 +1787 1785 -1.66666666666667e+01 +1787 1797 8.33333333333333e+00 +1787 1338 8.33333333333333e+00 +1787 427 4.16666666666667e+00 +1787 426 4.16666666666667e+00 +1787 52 -4.16666666666667e+00 +1787 433 4.16666666666667e+00 +1787 277 -4.16666666666667e+00 +1787 276 -4.16666666666667e+00 +1787 53 -1.25000000000000e+01 +1787 51 8.33333333333333e+00 +1787 432 -8.33333333333333e+00 +1788 1788 1.25000000000000e+02 +1788 1726 -4.16666666666667e+00 +1788 1727 8.33333333333333e+00 +1788 1715 4.16666666666667e+00 +1788 1725 -1.25000000000000e+01 +1788 1835 4.16666666666667e+00 +1788 1834 -8.33333333333333e+00 +1788 1793 8.33333333333333e+00 +1788 1792 8.33333333333333e+00 +1788 1791 -3.75000000000000e+01 +1788 1790 -1.66666666666667e+01 +1788 1358 -4.16666666666667e+00 +1788 1340 -4.16666666666667e+00 +1788 1703 -4.16666666666667e+00 +1788 1769 4.16666666666667e+00 +1788 1702 -4.16666666666667e+00 +1788 1711 4.16666666666667e+00 +1788 1712 -8.33333333333333e+00 +1788 1775 8.33333333333333e+00 +1788 1357 8.33333333333333e+00 +1788 1789 -1.66666666666667e+01 +1788 1774 8.33333333333333e+00 +1788 1773 -3.75000000000000e+01 +1788 1339 8.33333333333333e+00 +1788 1768 -8.33333333333333e+00 +1788 1544 -4.16666666666667e+00 +1788 1838 4.16666666666667e+00 +1788 1837 4.16666666666667e+00 +1788 1543 -4.16666666666667e+00 +1788 1356 -1.25000000000000e+01 +1788 1802 8.33333333333333e+00 +1788 1541 -8.33333333333333e+00 +1788 1801 -4.16666666666667e+00 +1788 1540 4.16666666666667e+00 +1788 1800 -1.25000000000000e+01 +1788 1714 4.16666666666667e+00 +1788 1338 -1.25000000000000e+01 +1789 1789 1.25000000000000e+02 +1789 1725 -4.16666666666667e+00 +1789 1715 -8.33333333333333e+00 +1789 1727 8.33333333333333e+00 +1789 1726 -1.25000000000000e+01 +1789 1835 4.16666666666667e+00 +1789 1833 -8.33333333333333e+00 +1789 1793 -4.16666666666667e+00 +1789 1792 -1.25000000000000e+01 +1789 1791 8.33333333333333e+00 +1789 1701 -4.16666666666667e+00 +1789 1710 4.16666666666667e+00 +1789 1712 4.16666666666667e+00 +1789 1775 -4.16666666666667e+00 +1789 1774 -1.25000000000000e+01 +1789 1356 8.33333333333333e+00 +1789 1788 -1.66666666666667e+01 +1789 1773 8.33333333333333e+00 +1789 1703 -4.16666666666667e+00 +1789 1769 4.16666666666667e+00 +1789 1338 8.33333333333333e+00 +1789 1767 -8.33333333333333e+00 +1789 1544 -4.16666666666667e+00 +1789 1541 4.16666666666667e+00 +1789 1838 -8.33333333333333e+00 +1789 1358 8.33333333333333e+00 +1789 1357 -3.75000000000000e+01 +1789 1836 4.16666666666667e+00 +1789 1542 -4.16666666666667e+00 +1789 1802 8.33333333333333e+00 +1789 1790 -1.66666666666667e+01 +1789 1340 8.33333333333333e+00 +1789 1801 -1.25000000000000e+01 +1789 1713 4.16666666666667e+00 +1789 1339 -3.75000000000000e+01 +1789 1800 -4.16666666666667e+00 +1789 1539 4.16666666666667e+00 +1790 1790 1.25000000000000e+02 +1790 1714 -8.33333333333333e+00 +1790 1713 4.16666666666667e+00 +1790 1727 -3.75000000000000e+01 +1790 1726 8.33333333333333e+00 +1790 1833 4.16666666666667e+00 +1790 1834 4.16666666666667e+00 +1790 1793 -1.25000000000000e+01 +1790 1792 -4.16666666666667e+00 +1790 1791 8.33333333333333e+00 +1790 1788 -1.66666666666667e+01 +1790 1356 -4.16666666666667e+00 +1790 1338 -4.16666666666667e+00 +1790 1701 -4.16666666666667e+00 +1790 1767 4.16666666666667e+00 +1790 1775 -1.25000000000000e+01 +1790 1711 4.16666666666667e+00 +1790 1774 -4.16666666666667e+00 +1790 1710 -8.33333333333333e+00 +1790 1773 8.33333333333333e+00 +1790 1702 -4.16666666666667e+00 +1790 1768 4.16666666666667e+00 +1790 1542 -4.16666666666667e+00 +1790 1836 4.16666666666667e+00 +1790 1543 -4.16666666666667e+00 +1790 1540 4.16666666666667e+00 +1790 1358 -1.25000000000000e+01 +1790 1837 -8.33333333333333e+00 +1790 1357 8.33333333333333e+00 +1790 1802 -3.75000000000000e+01 +1790 1725 8.33333333333333e+00 +1790 1340 -1.25000000000000e+01 +1790 1801 8.33333333333333e+00 +1790 1789 -1.66666666666667e+01 +1790 1339 8.33333333333333e+00 +1790 1800 8.33333333333333e+00 +1790 1539 -8.33333333333333e+00 +1791 1791 1.25000000000000e+02 +1791 1727 -8.33333333333333e+00 +1791 1835 -4.16666666666667e+00 +1791 1543 4.16666666666667e+00 +1791 1544 4.16666666666667e+00 +1791 1834 8.33333333333333e+00 +1791 1833 -1.25000000000000e+01 +1791 1790 8.33333333333333e+00 +1791 1789 8.33333333333333e+00 +1791 1788 -3.75000000000000e+01 +1791 1714 -4.16666666666667e+00 +1791 1715 -4.16666666666667e+00 +1791 1729 -4.16666666666667e+00 +1791 1720 4.16666666666667e+00 +1791 1721 4.16666666666667e+00 +1791 1730 8.33333333333333e+00 +1791 1793 -1.66666666666667e+01 +1791 1728 -1.25000000000000e+01 +1791 1540 -4.16666666666667e+00 +1791 1792 -1.66666666666667e+01 +1791 1541 8.33333333333333e+00 +1791 1787 -4.16666666666667e+00 +1791 1340 4.16666666666667e+00 +1791 1786 8.33333333333333e+00 +1791 1339 -8.33333333333333e+00 +1791 1785 -1.25000000000000e+01 +1791 1726 4.16666666666667e+00 +1791 1539 -1.25000000000000e+01 +1791 428 8.33333333333333e+00 +1791 280 -4.16666666666667e+00 +1791 277 4.16666666666667e+00 +1791 278 -8.33333333333333e+00 +1791 92 4.16666666666667e+00 +1791 281 -4.16666666666667e+00 +1791 427 8.33333333333333e+00 +1791 91 -8.33333333333333e+00 +1791 426 -3.75000000000000e+01 +1792 1792 1.25000000000000e+02 +1792 1727 4.16666666666667e+00 +1792 1835 8.33333333333333e+00 +1792 1542 4.16666666666667e+00 +1792 1544 -8.33333333333333e+00 +1792 1834 -3.75000000000000e+01 +1792 1833 8.33333333333333e+00 +1792 1790 -4.16666666666667e+00 +1792 1789 -1.25000000000000e+01 +1792 1788 8.33333333333333e+00 +1792 1713 -4.16666666666667e+00 +1792 1730 8.33333333333333e+00 +1792 1728 -4.16666666666667e+00 +1792 1719 4.16666666666667e+00 +1792 1721 -8.33333333333333e+00 +1792 1729 -1.25000000000000e+01 +1792 1715 -4.16666666666667e+00 +1792 1340 4.16666666666667e+00 +1792 1539 -4.16666666666667e+00 +1792 1791 -1.66666666666667e+01 +1792 1787 8.33333333333333e+00 +1792 1793 -1.66666666666667e+01 +1792 1541 8.33333333333333e+00 +1792 1786 -3.75000000000000e+01 +1792 1725 4.16666666666667e+00 +1792 1540 -1.25000000000000e+01 +1792 1785 8.33333333333333e+00 +1792 1338 -8.33333333333333e+00 +1792 92 4.16666666666667e+00 +1792 428 -4.16666666666667e+00 +1792 279 -4.16666666666667e+00 +1792 276 4.16666666666667e+00 +1792 281 -4.16666666666667e+00 +1792 278 4.16666666666667e+00 +1792 427 -1.25000000000000e+01 +1792 426 8.33333333333333e+00 +1792 90 -8.33333333333333e+00 +1793 1793 1.25000000000000e+02 +1793 1725 -8.33333333333333e+00 +1793 1833 -4.16666666666667e+00 +1793 1834 8.33333333333333e+00 +1793 1543 -8.33333333333333e+00 +1793 1542 4.16666666666667e+00 +1793 1835 -1.25000000000000e+01 +1793 1790 -1.25000000000000e+01 +1793 1789 -4.16666666666667e+00 +1793 1788 8.33333333333333e+00 +1793 1713 -4.16666666666667e+00 +1793 1729 8.33333333333333e+00 +1793 1720 -8.33333333333333e+00 +1793 1719 4.16666666666667e+00 +1793 1730 -3.75000000000000e+01 +1793 1728 8.33333333333333e+00 +1793 1791 -1.66666666666667e+01 +1793 1714 -4.16666666666667e+00 +1793 1339 4.16666666666667e+00 +1793 1539 8.33333333333333e+00 +1793 1787 -1.25000000000000e+01 +1793 1726 4.16666666666667e+00 +1793 1541 -3.75000000000000e+01 +1793 1786 8.33333333333333e+00 +1793 1792 -1.66666666666667e+01 +1793 1540 8.33333333333333e+00 +1793 1785 -4.16666666666667e+00 +1793 1338 4.16666666666667e+00 +1793 91 4.16666666666667e+00 +1793 427 -4.16666666666667e+00 +1793 426 8.33333333333333e+00 +1793 280 -4.16666666666667e+00 +1793 277 4.16666666666667e+00 +1793 276 -8.33333333333333e+00 +1793 428 -1.25000000000000e+01 +1793 90 4.16666666666667e+00 +1793 279 -4.16666666666667e+00 +1794 1794 1.25000000000000e+02 +1794 1769 -8.33333333333333e+00 +1794 1768 4.16666666666667e+00 +1794 1781 8.33333333333333e+00 +1794 1779 -3.75000000000000e+01 +1794 1873 4.16666666666667e+00 +1794 1874 4.16666666666667e+00 +1794 1802 -4.16666666666667e+00 +1794 1801 8.33333333333333e+00 +1794 1800 -1.25000000000000e+01 +1794 1738 -4.16666666666667e+00 +1794 1739 -4.16666666666667e+00 +1794 1748 4.16666666666667e+00 +1794 1747 -8.33333333333333e+00 +1794 1751 4.16666666666667e+00 +1794 1763 -4.16666666666667e+00 +1794 1795 -1.66666666666667e+01 +1794 1762 8.33333333333333e+00 +1794 1750 4.16666666666667e+00 +1794 1339 -4.16666666666667e+00 +1794 1375 -4.16666666666667e+00 +1794 1761 -1.25000000000000e+01 +1794 1541 4.16666666666667e+00 +1794 1547 -4.16666666666667e+00 +1794 1870 4.16666666666667e+00 +1794 1546 -4.16666666666667e+00 +1794 1376 8.33333333333333e+00 +1794 1871 -8.33333333333333e+00 +1794 1374 -1.25000000000000e+01 +1794 1796 -1.66666666666667e+01 +1794 1799 8.33333333333333e+00 +1794 1340 8.33333333333333e+00 +1794 1798 8.33333333333333e+00 +1794 1540 -8.33333333333333e+00 +1794 1780 8.33333333333333e+00 +1794 1797 -3.75000000000000e+01 +1794 1338 -1.25000000000000e+01 +1795 1795 1.25000000000000e+02 +1795 1781 -4.16666666666667e+00 +1795 1779 8.33333333333333e+00 +1795 1767 4.16666666666667e+00 +1795 1780 -1.25000000000000e+01 +1795 1872 4.16666666666667e+00 +1795 1874 -8.33333333333333e+00 +1795 1802 8.33333333333333e+00 +1795 1801 -3.75000000000000e+01 +1795 1800 8.33333333333333e+00 +1795 1737 -4.16666666666667e+00 +1795 1739 -4.16666666666667e+00 +1795 1748 4.16666666666667e+00 +1795 1746 -8.33333333333333e+00 +1795 1794 -1.66666666666667e+01 +1795 1761 8.33333333333333e+00 +1795 1751 -8.33333333333333e+00 +1795 1340 8.33333333333333e+00 +1795 1749 4.16666666666667e+00 +1795 1338 -4.16666666666667e+00 +1795 1763 8.33333333333333e+00 +1795 1796 -1.66666666666667e+01 +1795 1376 8.33333333333333e+00 +1795 1762 -3.75000000000000e+01 +1795 1374 -4.16666666666667e+00 +1795 1869 4.16666666666667e+00 +1795 1545 -4.16666666666667e+00 +1795 1871 4.16666666666667e+00 +1795 1547 -4.16666666666667e+00 +1795 1375 -1.25000000000000e+01 +1795 1799 -4.16666666666667e+00 +1795 1541 4.16666666666667e+00 +1795 1769 4.16666666666667e+00 +1795 1798 -1.25000000000000e+01 +1795 1339 -1.25000000000000e+01 +1795 1797 8.33333333333333e+00 +1795 1539 -8.33333333333333e+00 +1796 1796 1.25000000000000e+02 +1796 1780 -4.16666666666667e+00 +1796 1767 -8.33333333333333e+00 +1796 1781 -1.25000000000000e+01 +1796 1779 8.33333333333333e+00 +1796 1873 -8.33333333333333e+00 +1796 1872 4.16666666666667e+00 +1796 1802 -1.25000000000000e+01 +1796 1801 8.33333333333333e+00 +1796 1800 -4.16666666666667e+00 +1796 1738 -4.16666666666667e+00 +1796 1747 4.16666666666667e+00 +1796 1737 -4.16666666666667e+00 +1796 1746 4.16666666666667e+00 +1796 1749 4.16666666666667e+00 +1796 1761 -4.16666666666667e+00 +1796 1750 -8.33333333333333e+00 +1796 1339 8.33333333333333e+00 +1796 1763 -1.25000000000000e+01 +1796 1762 8.33333333333333e+00 +1796 1795 -1.66666666666667e+01 +1796 1375 8.33333333333333e+00 +1796 1539 4.16666666666667e+00 +1796 1545 -4.16666666666667e+00 +1796 1376 -3.75000000000000e+01 +1796 1870 4.16666666666667e+00 +1796 1546 -4.16666666666667e+00 +1796 1374 8.33333333333333e+00 +1796 1869 -8.33333333333333e+00 +1796 1768 4.16666666666667e+00 +1796 1799 -1.25000000000000e+01 +1796 1340 -3.75000000000000e+01 +1796 1798 -4.16666666666667e+00 +1796 1540 4.16666666666667e+00 +1796 1794 -1.66666666666667e+01 +1796 1797 8.33333333333333e+00 +1796 1338 8.33333333333333e+00 +1797 1797 1.25000000000000e+02 +1797 1756 4.16666666666667e+00 +1797 1787 8.33333333333333e+00 +1797 1786 -4.16666666666667e+00 +1797 1785 -1.25000000000000e+01 +1797 1751 -4.16666666666667e+00 +1797 1766 -4.16666666666667e+00 +1797 1763 4.16666666666667e+00 +1797 1765 8.33333333333333e+00 +1797 1762 -8.33333333333333e+00 +1797 1764 -1.25000000000000e+01 +1797 1750 -4.16666666666667e+00 +1797 1339 4.16666666666667e+00 +1797 1541 -4.16666666666667e+00 +1797 1799 -1.66666666666667e+01 +1797 1870 -4.16666666666667e+00 +1797 1547 4.16666666666667e+00 +1797 1546 4.16666666666667e+00 +1797 1871 8.33333333333333e+00 +1797 1869 -1.25000000000000e+01 +1797 1796 8.33333333333333e+00 +1797 1340 -8.33333333333333e+00 +1797 1795 8.33333333333333e+00 +1797 1798 -1.66666666666667e+01 +1797 1540 8.33333333333333e+00 +1797 1794 -3.75000000000000e+01 +1797 1757 4.16666666666667e+00 +1797 1539 -1.25000000000000e+01 +1797 433 8.33333333333333e+00 +1797 278 4.16666666666667e+00 +1797 277 -8.33333333333333e+00 +1797 434 8.33333333333333e+00 +1797 432 -3.75000000000000e+01 +1797 112 4.16666666666667e+00 +1797 284 -4.16666666666667e+00 +1797 283 -4.16666666666667e+00 +1797 113 -8.33333333333333e+00 +1798 1798 1.25000000000000e+02 +1798 1755 4.16666666666667e+00 +1798 1787 8.33333333333333e+00 +1798 1786 -1.25000000000000e+01 +1798 1785 -4.16666666666667e+00 +1798 1751 -4.16666666666667e+00 +1798 1764 8.33333333333333e+00 +1798 1763 4.16666666666667e+00 +1798 1761 -8.33333333333333e+00 +1798 1766 8.33333333333333e+00 +1798 1799 -1.66666666666667e+01 +1798 1765 -3.75000000000000e+01 +1798 1749 -4.16666666666667e+00 +1798 1338 4.16666666666667e+00 +1798 1869 -4.16666666666667e+00 +1798 1871 8.33333333333333e+00 +1798 1541 8.33333333333333e+00 +1798 1547 -8.33333333333333e+00 +1798 1545 4.16666666666667e+00 +1798 1870 -1.25000000000000e+01 +1798 1796 -4.16666666666667e+00 +1798 1340 4.16666666666667e+00 +1798 1795 -1.25000000000000e+01 +1798 1757 -8.33333333333333e+00 +1798 1540 -3.75000000000000e+01 +1798 1794 8.33333333333333e+00 +1798 1797 -1.66666666666667e+01 +1798 1539 8.33333333333333e+00 +1798 434 -4.16666666666667e+00 +1798 278 4.16666666666667e+00 +1798 432 8.33333333333333e+00 +1798 276 -8.33333333333333e+00 +1798 433 -1.25000000000000e+01 +1798 111 4.16666666666667e+00 +1798 282 -4.16666666666667e+00 +1798 113 4.16666666666667e+00 +1798 284 -4.16666666666667e+00 +1799 1799 1.25000000000000e+02 +1799 1756 -8.33333333333333e+00 +1799 1787 -3.75000000000000e+01 +1799 1786 8.33333333333333e+00 +1799 1785 8.33333333333333e+00 +1799 1749 -4.16666666666667e+00 +1799 1750 -4.16666666666667e+00 +1799 1764 -4.16666666666667e+00 +1799 1761 4.16666666666667e+00 +1799 1762 4.16666666666667e+00 +1799 1766 -1.25000000000000e+01 +1799 1765 8.33333333333333e+00 +1799 1798 -1.66666666666667e+01 +1799 1539 -4.16666666666667e+00 +1799 1797 -1.66666666666667e+01 +1799 1870 8.33333333333333e+00 +1799 1545 4.16666666666667e+00 +1799 1540 8.33333333333333e+00 +1799 1546 -8.33333333333333e+00 +1799 1871 -3.75000000000000e+01 +1799 1869 8.33333333333333e+00 +1799 1796 -1.25000000000000e+01 +1799 1755 4.16666666666667e+00 +1799 1541 -1.25000000000000e+01 +1799 1795 -4.16666666666667e+00 +1799 1339 4.16666666666667e+00 +1799 1794 8.33333333333333e+00 +1799 1338 -8.33333333333333e+00 +1799 433 -4.16666666666667e+00 +1799 277 4.16666666666667e+00 +1799 276 4.16666666666667e+00 +1799 434 -1.25000000000000e+01 +1799 432 8.33333333333333e+00 +1799 282 -4.16666666666667e+00 +1799 112 4.16666666666667e+00 +1799 283 -4.16666666666667e+00 +1799 111 -8.33333333333333e+00 +1800 1800 1.25000000000000e+02 +1800 1774 4.16666666666667e+00 +1800 1544 4.16666666666667e+00 +1800 1838 -4.16666666666667e+00 +1800 1837 8.33333333333333e+00 +1800 1543 -8.33333333333333e+00 +1800 1836 -1.25000000000000e+01 +1800 1790 8.33333333333333e+00 +1800 1789 -4.16666666666667e+00 +1800 1788 -1.25000000000000e+01 +1800 1769 -4.16666666666667e+00 +1800 1783 8.33333333333333e+00 +1800 1781 4.16666666666667e+00 +1800 1780 -8.33333333333333e+00 +1800 1784 8.33333333333333e+00 +1800 1802 -1.66666666666667e+01 +1800 1381 4.16666666666667e+00 +1800 1782 -3.75000000000000e+01 +1800 1768 -4.16666666666667e+00 +1800 1339 4.16666666666667e+00 +1800 1873 -4.16666666666667e+00 +1800 1874 8.33333333333333e+00 +1800 1541 8.33333333333333e+00 +1800 1547 -8.33333333333333e+00 +1800 1549 -4.16666666666667e+00 +1800 1546 4.16666666666667e+00 +1800 1382 4.16666666666667e+00 +1800 1550 -4.16666666666667e+00 +1800 1872 -1.25000000000000e+01 +1800 1796 -4.16666666666667e+00 +1800 1340 4.16666666666667e+00 +1800 1801 -1.66666666666667e+01 +1800 1795 8.33333333333333e+00 +1800 1540 8.33333333333333e+00 +1800 1775 -8.33333333333333e+00 +1800 1794 -1.25000000000000e+01 +1800 1539 -3.75000000000000e+01 +1801 1801 1.25000000000000e+02 +1801 1773 4.16666666666667e+00 +1801 1836 8.33333333333333e+00 +1801 1544 4.16666666666667e+00 +1801 1542 -8.33333333333333e+00 +1801 1838 8.33333333333333e+00 +1801 1837 -3.75000000000000e+01 +1801 1790 8.33333333333333e+00 +1801 1789 -1.25000000000000e+01 +1801 1788 -4.16666666666667e+00 +1801 1769 -4.16666666666667e+00 +1801 1784 -4.16666666666667e+00 +1801 1781 4.16666666666667e+00 +1801 1782 8.33333333333333e+00 +1801 1779 -8.33333333333333e+00 +1801 1783 -1.25000000000000e+01 +1801 1380 4.16666666666667e+00 +1801 1767 -4.16666666666667e+00 +1801 1338 4.16666666666667e+00 +1801 1541 -4.16666666666667e+00 +1801 1802 -1.66666666666667e+01 +1801 1872 -4.16666666666667e+00 +1801 1550 -4.16666666666667e+00 +1801 1547 4.16666666666667e+00 +1801 1548 -4.16666666666667e+00 +1801 1545 4.16666666666667e+00 +1801 1382 -8.33333333333333e+00 +1801 1874 8.33333333333333e+00 +1801 1873 -1.25000000000000e+01 +1801 1796 8.33333333333333e+00 +1801 1340 -8.33333333333333e+00 +1801 1775 4.16666666666667e+00 +1801 1795 -3.75000000000000e+01 +1801 1540 -1.25000000000000e+01 +1801 1800 -1.66666666666667e+01 +1801 1794 8.33333333333333e+00 +1801 1539 8.33333333333333e+00 +1802 1802 1.25000000000000e+02 +1802 1773 -8.33333333333333e+00 +1802 1542 4.16666666666667e+00 +1802 1836 -4.16666666666667e+00 +1802 1543 4.16666666666667e+00 +1802 1838 -1.25000000000000e+01 +1802 1837 8.33333333333333e+00 +1802 1790 -3.75000000000000e+01 +1802 1789 8.33333333333333e+00 +1802 1788 8.33333333333333e+00 +1802 1768 -4.16666666666667e+00 +1802 1767 -4.16666666666667e+00 +1802 1783 -4.16666666666667e+00 +1802 1780 4.16666666666667e+00 +1802 1779 4.16666666666667e+00 +1802 1784 -1.25000000000000e+01 +1802 1782 8.33333333333333e+00 +1802 1800 -1.66666666666667e+01 +1802 1540 -4.16666666666667e+00 +1802 1801 -1.66666666666667e+01 +1802 1549 -4.16666666666667e+00 +1802 1546 4.16666666666667e+00 +1802 1872 8.33333333333333e+00 +1802 1539 8.33333333333333e+00 +1802 1545 -8.33333333333333e+00 +1802 1874 -3.75000000000000e+01 +1802 1381 -8.33333333333333e+00 +1802 1873 8.33333333333333e+00 +1802 1380 4.16666666666667e+00 +1802 1548 -4.16666666666667e+00 +1802 1774 4.16666666666667e+00 +1802 1796 -1.25000000000000e+01 +1802 1541 -1.25000000000000e+01 +1802 1795 8.33333333333333e+00 +1802 1339 -8.33333333333333e+00 +1802 1794 -4.16666666666667e+00 +1802 1338 4.16666666666667e+00 +1803 1803 6.25000000000000e+01 +1803 1601 -4.16666666666667e+00 +1803 1804 -8.33333333333333e+00 +1803 1807 4.16666666666667e+00 +1803 1600 8.33333333333333e+00 +1803 1808 4.16666666666667e+00 +1803 1342 -2.08333333333333e+00 +1803 1597 4.16666666666667e+00 +1803 1806 -1.87500000000000e+01 +1803 1817 -4.16666666666667e+00 +1803 1816 2.08333333333333e+00 +1803 1348 -2.08333333333333e+00 +1803 1599 -1.25000000000000e+01 +1803 1435 2.08333333333333e+00 +1803 1579 -4.16666666666667e+00 +1803 1580 -4.16666666666667e+00 +1803 1586 4.16666666666667e+00 +1803 1343 4.16666666666667e+00 +1803 1436 -4.16666666666667e+00 +1803 1341 -6.25000000000000e+00 +1803 1805 -8.33333333333333e+00 +1803 1442 4.16666666666667e+00 +1803 1349 4.16666666666667e+00 +1803 1441 4.16666666666667e+00 +1803 1585 -8.33333333333333e+00 +1803 1598 4.16666666666667e+00 +1803 1440 -1.87500000000000e+01 +1803 1347 -6.25000000000000e+00 +1804 1804 6.25000000000000e+01 +1804 1817 2.08333333333333e+00 +1804 1803 -8.33333333333333e+00 +1804 1806 4.16666666666667e+00 +1804 1599 8.33333333333333e+00 +1804 1343 4.16666666666667e+00 +1804 1598 -8.33333333333333e+00 +1804 1807 -6.25000000000000e+00 +1804 1341 -2.08333333333333e+00 +1804 1596 4.16666666666667e+00 +1804 1805 -8.33333333333333e+00 +1804 1601 8.33333333333333e+00 +1804 1349 4.16666666666667e+00 +1804 1600 -3.75000000000000e+01 +1804 1815 2.08333333333333e+00 +1804 1347 -2.08333333333333e+00 +1804 1434 2.08333333333333e+00 +1804 1578 -4.16666666666667e+00 +1804 1436 2.08333333333333e+00 +1804 1580 -4.16666666666667e+00 +1804 1342 -6.25000000000000e+00 +1804 1442 -2.08333333333333e+00 +1804 1586 4.16666666666667e+00 +1804 1808 -2.08333333333333e+00 +1804 1441 -6.25000000000000e+00 +1804 1348 -6.25000000000000e+00 +1804 1440 4.16666666666667e+00 +1804 1584 -8.33333333333333e+00 +1805 1805 6.25000000000000e+01 +1805 1599 -4.16666666666667e+00 +1805 1807 -2.08333333333333e+00 +1805 1816 2.08333333333333e+00 +1805 1808 -6.25000000000000e+00 +1805 1342 4.16666666666667e+00 +1805 1597 -8.33333333333333e+00 +1805 1806 4.16666666666667e+00 +1805 1601 -1.25000000000000e+01 +1805 1804 -8.33333333333333e+00 +1805 1600 8.33333333333333e+00 +1805 1348 4.16666666666667e+00 +1805 1815 -4.16666666666667e+00 +1805 1578 -4.16666666666667e+00 +1805 1584 4.16666666666667e+00 +1805 1343 -1.87500000000000e+01 +1805 1435 2.08333333333333e+00 +1805 1579 -4.16666666666667e+00 +1805 1341 4.16666666666667e+00 +1805 1434 -4.16666666666667e+00 +1805 1596 4.16666666666667e+00 +1805 1442 -6.25000000000000e+00 +1805 1349 -1.87500000000000e+01 +1805 1441 -2.08333333333333e+00 +1805 1585 4.16666666666667e+00 +1805 1803 -8.33333333333333e+00 +1805 1440 4.16666666666667e+00 +1805 1347 4.16666666666667e+00 +1806 1806 6.25000000000000e+01 +1806 1804 4.16666666666667e+00 +1806 1600 -8.33333333333333e+00 +1806 1805 4.16666666666667e+00 +1806 1342 2.08333333333333e+00 +1806 1803 -1.87500000000000e+01 +1806 1817 4.16666666666667e+00 +1806 1354 2.08333333333333e+00 +1806 1816 -2.08333333333333e+00 +1806 1815 -6.25000000000000e+00 +1806 1597 -4.16666666666667e+00 +1806 1598 -4.16666666666667e+00 +1806 1808 -8.33333333333333e+00 +1806 1450 -2.08333333333333e+00 +1806 1444 4.16666666666667e+00 +1806 1445 4.16666666666667e+00 +1806 1604 -4.16666666666667e+00 +1806 1451 4.16666666666667e+00 +1806 1343 -4.16666666666667e+00 +1806 1449 -6.25000000000000e+00 +1806 1457 4.16666666666667e+00 +1806 1355 -4.16666666666667e+00 +1806 1456 4.16666666666667e+00 +1806 1807 -8.33333333333333e+00 +1806 1603 8.33333333333333e+00 +1806 1455 -1.87500000000000e+01 +1806 1601 4.16666666666667e+00 +1806 1602 -1.25000000000000e+01 +1807 1807 6.25000000000000e+01 +1807 1601 4.16666666666667e+00 +1807 1803 4.16666666666667e+00 +1807 1599 -8.33333333333333e+00 +1807 1804 -6.25000000000000e+00 +1807 1341 2.08333333333333e+00 +1807 1808 -8.33333333333333e+00 +1807 1817 4.16666666666667e+00 +1807 1816 -6.25000000000000e+00 +1807 1353 2.08333333333333e+00 +1807 1815 -2.08333333333333e+00 +1807 1596 -4.16666666666667e+00 +1807 1451 4.16666666666667e+00 +1807 1449 -2.08333333333333e+00 +1807 1443 4.16666666666667e+00 +1807 1445 -8.33333333333333e+00 +1807 1604 8.33333333333333e+00 +1807 1343 2.08333333333333e+00 +1807 1598 -4.16666666666667e+00 +1807 1450 -6.25000000000000e+00 +1807 1457 -2.08333333333333e+00 +1807 1355 2.08333333333333e+00 +1807 1456 -6.25000000000000e+00 +1807 1805 -2.08333333333333e+00 +1807 1603 -3.75000000000000e+01 +1807 1455 4.16666666666667e+00 +1807 1806 -8.33333333333333e+00 +1807 1602 8.33333333333333e+00 +1808 1808 6.25000000000000e+01 +1808 1804 -2.08333333333333e+00 +1808 1600 4.16666666666667e+00 +1808 1805 -6.25000000000000e+00 +1808 1803 4.16666666666667e+00 +1808 1817 -1.87500000000000e+01 +1808 1807 -8.33333333333333e+00 +1808 1816 4.16666666666667e+00 +1808 1815 4.16666666666667e+00 +1808 1596 -4.16666666666667e+00 +1808 1450 4.16666666666667e+00 +1808 1806 -8.33333333333333e+00 +1808 1444 -8.33333333333333e+00 +1808 1603 8.33333333333333e+00 +1808 1443 4.16666666666667e+00 +1808 1602 -4.16666666666667e+00 +1808 1451 -1.87500000000000e+01 +1808 1342 2.08333333333333e+00 +1808 1597 -4.16666666666667e+00 +1808 1449 4.16666666666667e+00 +1808 1341 -4.16666666666667e+00 +1808 1457 -6.25000000000000e+00 +1808 1599 4.16666666666667e+00 +1808 1604 -1.25000000000000e+01 +1808 1456 -2.08333333333333e+00 +1808 1354 2.08333333333333e+00 +1808 1455 4.16666666666667e+00 +1808 1353 -4.16666666666667e+00 +1809 1809 6.25000000000000e+01 +1809 1819 2.08333333333333e+00 +1809 1820 -4.16666666666667e+00 +1809 1814 4.16666666666667e+00 +1809 1812 -6.25000000000000e+00 +1809 1649 -4.16666666666667e+00 +1809 1348 4.16666666666667e+00 +1809 1810 -8.33333333333333e+00 +1809 1648 8.33333333333333e+00 +1809 1647 -1.25000000000000e+01 +1809 1646 4.16666666666667e+00 +1809 1345 4.16666666666667e+00 +1809 1645 -8.33333333333333e+00 +1809 1586 4.16666666666667e+00 +1809 1583 -4.16666666666667e+00 +1809 1346 4.16666666666667e+00 +1809 1439 -4.16666666666667e+00 +1809 1438 2.08333333333333e+00 +1809 1582 -4.16666666666667e+00 +1809 1344 -1.87500000000000e+01 +1809 1811 -8.33333333333333e+00 +1809 1442 4.16666666666667e+00 +1809 1349 4.16666666666667e+00 +1809 1441 -2.08333333333333e+00 +1809 1585 4.16666666666667e+00 +1809 1813 -2.08333333333333e+00 +1809 1440 -6.25000000000000e+00 +1809 1347 -1.87500000000000e+01 +1810 1810 6.25000000000000e+01 +1810 1811 -8.33333333333333e+00 +1810 1812 -2.08333333333333e+00 +1810 1818 2.08333333333333e+00 +1810 1349 -2.08333333333333e+00 +1810 1820 2.08333333333333e+00 +1810 1346 -2.08333333333333e+00 +1810 1813 -6.25000000000000e+00 +1810 1646 4.16666666666667e+00 +1810 1649 8.33333333333333e+00 +1810 1648 -3.75000000000000e+01 +1810 1347 4.16666666666667e+00 +1810 1809 -8.33333333333333e+00 +1810 1647 8.33333333333333e+00 +1810 1344 4.16666666666667e+00 +1810 1644 -8.33333333333333e+00 +1810 1439 2.08333333333333e+00 +1810 1583 -4.16666666666667e+00 +1810 1345 -6.25000000000000e+00 +1810 1437 2.08333333333333e+00 +1810 1581 -4.16666666666667e+00 +1810 1442 4.16666666666667e+00 +1810 1586 -8.33333333333333e+00 +1810 1814 4.16666666666667e+00 +1810 1441 -6.25000000000000e+00 +1810 1348 -6.25000000000000e+00 +1810 1440 -2.08333333333333e+00 +1810 1584 4.16666666666667e+00 +1811 1811 6.25000000000000e+01 +1811 1810 -8.33333333333333e+00 +1811 1348 -2.08333333333333e+00 +1811 1819 2.08333333333333e+00 +1811 1818 -4.16666666666667e+00 +1811 1814 -1.87500000000000e+01 +1811 1345 -2.08333333333333e+00 +1811 1812 4.16666666666667e+00 +1811 1645 4.16666666666667e+00 +1811 1649 -1.25000000000000e+01 +1811 1648 8.33333333333333e+00 +1811 1647 -4.16666666666667e+00 +1811 1644 4.16666666666667e+00 +1811 1584 4.16666666666667e+00 +1811 1581 -4.16666666666667e+00 +1811 1438 2.08333333333333e+00 +1811 1582 -4.16666666666667e+00 +1811 1346 -6.25000000000000e+00 +1811 1344 4.16666666666667e+00 +1811 1437 -4.16666666666667e+00 +1811 1813 4.16666666666667e+00 +1811 1442 -1.87500000000000e+01 +1811 1349 -6.25000000000000e+00 +1811 1441 4.16666666666667e+00 +1811 1585 -8.33333333333333e+00 +1811 1809 -8.33333333333333e+00 +1811 1440 4.16666666666667e+00 +1811 1347 4.16666666666667e+00 +1812 1812 6.25000000000000e+01 +1812 1649 4.16666666666667e+00 +1812 1648 4.16666666666667e+00 +1812 1820 4.16666666666667e+00 +1812 1819 4.16666666666667e+00 +1812 1813 -8.33333333333333e+00 +1812 1818 -1.87500000000000e+01 +1812 1811 4.16666666666667e+00 +1812 1809 -6.25000000000000e+00 +1812 1658 -4.16666666666667e+00 +1812 1814 -8.33333333333333e+00 +1812 1646 -4.16666666666667e+00 +1812 1505 4.16666666666667e+00 +1812 1507 4.16666666666667e+00 +1812 1657 8.33333333333333e+00 +1812 1504 -8.33333333333333e+00 +1812 1508 4.16666666666667e+00 +1812 1346 -4.16666666666667e+00 +1812 1345 2.08333333333333e+00 +1812 1645 -4.16666666666667e+00 +1812 1506 -1.87500000000000e+01 +1812 1514 4.16666666666667e+00 +1812 1379 -4.16666666666667e+00 +1812 1513 -2.08333333333333e+00 +1812 1378 2.08333333333333e+00 +1812 1512 -6.25000000000000e+00 +1812 1810 -2.08333333333333e+00 +1812 1656 -1.25000000000000e+01 +1813 1813 6.25000000000000e+01 +1813 1809 -2.08333333333333e+00 +1813 1649 -8.33333333333333e+00 +1813 1647 4.16666666666667e+00 +1813 1820 -2.08333333333333e+00 +1813 1379 2.08333333333333e+00 +1813 1819 -6.25000000000000e+00 +1813 1818 4.16666666666667e+00 +1813 1812 -8.33333333333333e+00 +1813 1346 2.08333333333333e+00 +1813 1810 -6.25000000000000e+00 +1813 1508 -2.08333333333333e+00 +1813 1506 4.16666666666667e+00 +1813 1646 -4.16666666666667e+00 +1813 1505 4.16666666666667e+00 +1813 1656 8.33333333333333e+00 +1813 1503 -8.33333333333333e+00 +1813 1507 -6.25000000000000e+00 +1813 1344 2.08333333333333e+00 +1813 1644 -4.16666666666667e+00 +1813 1514 4.16666666666667e+00 +1813 1814 -8.33333333333333e+00 +1813 1658 8.33333333333333e+00 +1813 1513 -6.25000000000000e+00 +1813 1811 4.16666666666667e+00 +1813 1657 -3.75000000000000e+01 +1813 1512 -2.08333333333333e+00 +1813 1377 2.08333333333333e+00 +1814 1814 6.25000000000000e+01 +1814 1647 4.16666666666667e+00 +1814 1648 -8.33333333333333e+00 +1814 1820 -6.25000000000000e+00 +1814 1819 -2.08333333333333e+00 +1814 1378 2.08333333333333e+00 +1814 1818 4.16666666666667e+00 +1814 1811 -1.87500000000000e+01 +1814 1345 2.08333333333333e+00 +1814 1809 4.16666666666667e+00 +1814 1656 -4.16666666666667e+00 +1814 1507 -2.08333333333333e+00 +1814 1812 -8.33333333333333e+00 +1814 1644 -4.16666666666667e+00 +1814 1503 4.16666666666667e+00 +1814 1645 -4.16666666666667e+00 +1814 1504 4.16666666666667e+00 +1814 1508 -6.25000000000000e+00 +1814 1506 4.16666666666667e+00 +1814 1344 -4.16666666666667e+00 +1814 1514 -1.87500000000000e+01 +1814 1810 4.16666666666667e+00 +1814 1658 -1.25000000000000e+01 +1814 1513 4.16666666666667e+00 +1814 1813 -8.33333333333333e+00 +1814 1657 8.33333333333333e+00 +1814 1512 4.16666666666667e+00 +1814 1377 -4.16666666666667e+00 +1815 1815 6.25000000000000e+01 +1815 1807 -2.08333333333333e+00 +1815 1806 -6.25000000000000e+00 +1815 1805 -4.16666666666667e+00 +1815 1804 2.08333333333333e+00 +1815 1603 4.16666666666667e+00 +1815 1600 -4.16666666666667e+00 +1815 1604 4.16666666666667e+00 +1815 1601 -4.16666666666667e+00 +1815 1664 4.16666666666667e+00 +1815 1667 -4.16666666666667e+00 +1815 1525 2.08333333333333e+00 +1815 1522 -2.08333333333333e+00 +1815 1355 4.16666666666667e+00 +1815 1526 -4.16666666666667e+00 +1815 1354 4.16666666666667e+00 +1815 1816 -8.33333333333333e+00 +1815 1666 8.33333333333333e+00 +1815 1353 -1.87500000000000e+01 +1815 1665 -1.25000000000000e+01 +1815 1817 -8.33333333333333e+00 +1815 1349 4.16666666666667e+00 +1815 1523 4.16666666666667e+00 +1815 1348 4.16666666666667e+00 +1815 1663 -8.33333333333333e+00 +1815 1808 4.16666666666667e+00 +1815 1347 -1.87500000000000e+01 +1815 1521 -6.25000000000000e+00 +1816 1816 6.25000000000000e+01 +1816 1808 4.16666666666667e+00 +1816 1807 -6.25000000000000e+00 +1816 1806 -2.08333333333333e+00 +1816 1803 2.08333333333333e+00 +1816 1602 4.16666666666667e+00 +1816 1599 -4.16666666666667e+00 +1816 1601 -4.16666666666667e+00 +1816 1604 -8.33333333333333e+00 +1816 1817 -8.33333333333333e+00 +1816 1667 8.33333333333333e+00 +1816 1523 4.16666666666667e+00 +1816 1524 2.08333333333333e+00 +1816 1521 -2.08333333333333e+00 +1816 1355 -2.08333333333333e+00 +1816 1526 2.08333333333333e+00 +1816 1354 -6.25000000000000e+00 +1816 1666 -3.75000000000000e+01 +1816 1353 4.16666666666667e+00 +1816 1815 -8.33333333333333e+00 +1816 1665 8.33333333333333e+00 +1816 1349 -2.08333333333333e+00 +1816 1664 4.16666666666667e+00 +1816 1805 2.08333333333333e+00 +1816 1348 -6.25000000000000e+00 +1816 1522 -6.25000000000000e+00 +1816 1347 4.16666666666667e+00 +1816 1662 -8.33333333333333e+00 +1817 1817 6.25000000000000e+01 +1817 1808 -1.87500000000000e+01 +1817 1807 4.16666666666667e+00 +1817 1806 4.16666666666667e+00 +1817 1803 -4.16666666666667e+00 +1817 1600 -4.16666666666667e+00 +1817 1603 -8.33333333333333e+00 +1817 1602 4.16666666666667e+00 +1817 1599 -4.16666666666667e+00 +1817 1662 4.16666666666667e+00 +1817 1665 -4.16666666666667e+00 +1817 1816 -8.33333333333333e+00 +1817 1666 8.33333333333333e+00 +1817 1522 4.16666666666667e+00 +1817 1355 -6.25000000000000e+00 +1817 1667 -1.25000000000000e+01 +1817 1354 -2.08333333333333e+00 +1817 1525 2.08333333333333e+00 +1817 1353 4.16666666666667e+00 +1817 1524 -4.16666666666667e+00 +1817 1804 2.08333333333333e+00 +1817 1349 -6.25000000000000e+00 +1817 1523 -1.87500000000000e+01 +1817 1348 -2.08333333333333e+00 +1817 1663 4.16666666666667e+00 +1817 1815 -8.33333333333333e+00 +1817 1347 4.16666666666667e+00 +1817 1521 4.16666666666667e+00 +1818 1818 6.25000000000000e+01 +1818 1648 -4.16666666666667e+00 +1818 1658 4.16666666666667e+00 +1818 1649 -4.16666666666667e+00 +1818 1811 -4.16666666666667e+00 +1818 1814 4.16666666666667e+00 +1818 1813 4.16666666666667e+00 +1818 1657 -8.33333333333333e+00 +1818 1812 -1.87500000000000e+01 +1818 1664 4.16666666666667e+00 +1818 1676 -4.16666666666667e+00 +1818 1522 4.16666666666667e+00 +1818 1819 -8.33333333333333e+00 +1818 1675 8.33333333333333e+00 +1818 1379 4.16666666666667e+00 +1818 1535 -4.16666666666667e+00 +1818 1378 -2.08333333333333e+00 +1818 1534 2.08333333333333e+00 +1818 1377 -6.25000000000000e+00 +1818 1674 -1.25000000000000e+01 +1818 1820 -8.33333333333333e+00 +1818 1349 4.16666666666667e+00 +1818 1523 4.16666666666667e+00 +1818 1348 -2.08333333333333e+00 +1818 1663 4.16666666666667e+00 +1818 1810 2.08333333333333e+00 +1818 1347 -6.25000000000000e+00 +1818 1521 -1.87500000000000e+01 +1819 1819 6.25000000000000e+01 +1819 1647 -4.16666666666667e+00 +1819 1811 2.08333333333333e+00 +1819 1649 -4.16666666666667e+00 +1819 1814 -2.08333333333333e+00 +1819 1658 4.16666666666667e+00 +1819 1813 -6.25000000000000e+00 +1819 1812 4.16666666666667e+00 +1819 1656 -8.33333333333333e+00 +1819 1523 -2.08333333333333e+00 +1819 1535 2.08333333333333e+00 +1819 1521 4.16666666666667e+00 +1819 1818 -8.33333333333333e+00 +1819 1674 8.33333333333333e+00 +1819 1379 4.16666666666667e+00 +1819 1820 -8.33333333333333e+00 +1819 1676 8.33333333333333e+00 +1819 1378 -6.25000000000000e+00 +1819 1675 -3.75000000000000e+01 +1819 1377 -2.08333333333333e+00 +1819 1533 2.08333333333333e+00 +1819 1349 4.16666666666667e+00 +1819 1664 -8.33333333333333e+00 +1819 1809 2.08333333333333e+00 +1819 1348 -6.25000000000000e+00 +1819 1522 -6.25000000000000e+00 +1819 1347 -2.08333333333333e+00 +1819 1662 4.16666666666667e+00 +1820 1820 6.25000000000000e+01 +1820 1647 -4.16666666666667e+00 +1820 1810 2.08333333333333e+00 +1820 1648 -4.16666666666667e+00 +1820 1809 -4.16666666666667e+00 +1820 1814 -6.25000000000000e+00 +1820 1813 -2.08333333333333e+00 +1820 1657 4.16666666666667e+00 +1820 1812 4.16666666666667e+00 +1820 1522 -2.08333333333333e+00 +1820 1534 2.08333333333333e+00 +1820 1662 4.16666666666667e+00 +1820 1674 -4.16666666666667e+00 +1820 1379 -1.87500000000000e+01 +1820 1676 -1.25000000000000e+01 +1820 1378 4.16666666666667e+00 +1820 1819 -8.33333333333333e+00 +1820 1675 8.33333333333333e+00 +1820 1377 4.16666666666667e+00 +1820 1533 -4.16666666666667e+00 +1820 1656 4.16666666666667e+00 +1820 1349 -1.87500000000000e+01 +1820 1523 -6.25000000000000e+00 +1820 1348 4.16666666666667e+00 +1820 1663 -8.33333333333333e+00 +1820 1818 -8.33333333333333e+00 +1820 1347 4.16666666666667e+00 +1820 1521 4.16666666666667e+00 +1821 1821 6.25000000000000e+01 +1821 1727 -4.16666666666667e+00 +1821 1822 -8.33333333333333e+00 +1821 1825 4.16666666666667e+00 +1821 1726 8.33333333333333e+00 +1821 1826 4.16666666666667e+00 +1821 1351 -2.08333333333333e+00 +1821 1723 4.16666666666667e+00 +1821 1824 -1.87500000000000e+01 +1821 1835 -4.16666666666667e+00 +1821 1834 2.08333333333333e+00 +1821 1357 -2.08333333333333e+00 +1821 1725 -1.25000000000000e+01 +1821 1453 2.08333333333333e+00 +1821 1705 -4.16666666666667e+00 +1821 1706 -4.16666666666667e+00 +1821 1712 4.16666666666667e+00 +1821 1352 4.16666666666667e+00 +1821 1454 -4.16666666666667e+00 +1821 1350 -6.25000000000000e+00 +1821 1823 -8.33333333333333e+00 +1821 1460 4.16666666666667e+00 +1821 1358 4.16666666666667e+00 +1821 1459 4.16666666666667e+00 +1821 1711 -8.33333333333333e+00 +1821 1724 4.16666666666667e+00 +1821 1458 -1.87500000000000e+01 +1821 1356 -6.25000000000000e+00 +1822 1822 6.25000000000000e+01 +1822 1835 2.08333333333333e+00 +1822 1821 -8.33333333333333e+00 +1822 1824 4.16666666666667e+00 +1822 1725 8.33333333333333e+00 +1822 1352 4.16666666666667e+00 +1822 1724 -8.33333333333333e+00 +1822 1825 -6.25000000000000e+00 +1822 1350 -2.08333333333333e+00 +1822 1722 4.16666666666667e+00 +1822 1823 -8.33333333333333e+00 +1822 1727 8.33333333333333e+00 +1822 1358 4.16666666666667e+00 +1822 1726 -3.75000000000000e+01 +1822 1833 2.08333333333333e+00 +1822 1356 -2.08333333333333e+00 +1822 1452 2.08333333333333e+00 +1822 1704 -4.16666666666667e+00 +1822 1454 2.08333333333333e+00 +1822 1706 -4.16666666666667e+00 +1822 1351 -6.25000000000000e+00 +1822 1460 -2.08333333333333e+00 +1822 1712 4.16666666666667e+00 +1822 1826 -2.08333333333333e+00 +1822 1459 -6.25000000000000e+00 +1822 1357 -6.25000000000000e+00 +1822 1458 4.16666666666667e+00 +1822 1710 -8.33333333333333e+00 +1823 1823 6.25000000000000e+01 +1823 1725 -4.16666666666667e+00 +1823 1825 -2.08333333333333e+00 +1823 1834 2.08333333333333e+00 +1823 1826 -6.25000000000000e+00 +1823 1351 4.16666666666667e+00 +1823 1723 -8.33333333333333e+00 +1823 1824 4.16666666666667e+00 +1823 1727 -1.25000000000000e+01 +1823 1822 -8.33333333333333e+00 +1823 1726 8.33333333333333e+00 +1823 1357 4.16666666666667e+00 +1823 1833 -4.16666666666667e+00 +1823 1704 -4.16666666666667e+00 +1823 1710 4.16666666666667e+00 +1823 1352 -1.87500000000000e+01 +1823 1453 2.08333333333333e+00 +1823 1705 -4.16666666666667e+00 +1823 1350 4.16666666666667e+00 +1823 1452 -4.16666666666667e+00 +1823 1722 4.16666666666667e+00 +1823 1460 -6.25000000000000e+00 +1823 1358 -1.87500000000000e+01 +1823 1459 -2.08333333333333e+00 +1823 1711 4.16666666666667e+00 +1823 1821 -8.33333333333333e+00 +1823 1458 4.16666666666667e+00 +1823 1356 4.16666666666667e+00 +1824 1824 6.25000000000000e+01 +1824 1822 4.16666666666667e+00 +1824 1726 -8.33333333333333e+00 +1824 1823 4.16666666666667e+00 +1824 1351 2.08333333333333e+00 +1824 1821 -1.87500000000000e+01 +1824 1835 4.16666666666667e+00 +1824 1834 -2.08333333333333e+00 +1824 1833 -6.25000000000000e+00 +1824 1723 -4.16666666666667e+00 +1824 1724 -4.16666666666667e+00 +1824 1826 -8.33333333333333e+00 +1824 1465 -2.08333333333333e+00 +1824 1462 4.16666666666667e+00 +1824 1463 4.16666666666667e+00 +1824 1730 -4.16666666666667e+00 +1824 1466 4.16666666666667e+00 +1824 1352 -4.16666666666667e+00 +1824 1464 -6.25000000000000e+00 +1824 1825 -8.33333333333333e+00 +1824 1729 8.33333333333333e+00 +1824 1727 4.16666666666667e+00 +1824 1728 -1.25000000000000e+01 +1824 91 2.08333333333333e+00 +1824 200 4.16666666666667e+00 +1824 92 -4.16666666666667e+00 +1824 199 4.16666666666667e+00 +1824 198 -1.87500000000000e+01 +1825 1825 6.25000000000000e+01 +1825 1727 4.16666666666667e+00 +1825 1821 4.16666666666667e+00 +1825 1725 -8.33333333333333e+00 +1825 1822 -6.25000000000000e+00 +1825 1350 2.08333333333333e+00 +1825 1826 -8.33333333333333e+00 +1825 1835 4.16666666666667e+00 +1825 1834 -6.25000000000000e+00 +1825 1833 -2.08333333333333e+00 +1825 1722 -4.16666666666667e+00 +1825 1466 4.16666666666667e+00 +1825 1464 -2.08333333333333e+00 +1825 1461 4.16666666666667e+00 +1825 1463 -8.33333333333333e+00 +1825 1730 8.33333333333333e+00 +1825 1352 2.08333333333333e+00 +1825 1724 -4.16666666666667e+00 +1825 1465 -6.25000000000000e+00 +1825 1823 -2.08333333333333e+00 +1825 1729 -3.75000000000000e+01 +1825 1824 -8.33333333333333e+00 +1825 1728 8.33333333333333e+00 +1825 90 2.08333333333333e+00 +1825 200 -2.08333333333333e+00 +1825 92 2.08333333333333e+00 +1825 199 -6.25000000000000e+00 +1825 198 4.16666666666667e+00 +1826 1826 6.25000000000000e+01 +1826 1822 -2.08333333333333e+00 +1826 1726 4.16666666666667e+00 +1826 1823 -6.25000000000000e+00 +1826 1821 4.16666666666667e+00 +1826 1835 -1.87500000000000e+01 +1826 1825 -8.33333333333333e+00 +1826 1834 4.16666666666667e+00 +1826 1833 4.16666666666667e+00 +1826 1722 -4.16666666666667e+00 +1826 1465 4.16666666666667e+00 +1826 1824 -8.33333333333333e+00 +1826 1462 -8.33333333333333e+00 +1826 1729 8.33333333333333e+00 +1826 1461 4.16666666666667e+00 +1826 1728 -4.16666666666667e+00 +1826 1466 -1.87500000000000e+01 +1826 1351 2.08333333333333e+00 +1826 1723 -4.16666666666667e+00 +1826 1464 4.16666666666667e+00 +1826 1350 -4.16666666666667e+00 +1826 1725 4.16666666666667e+00 +1826 1730 -1.25000000000000e+01 +1826 200 -6.25000000000000e+00 +1826 199 -2.08333333333333e+00 +1826 91 2.08333333333333e+00 +1826 198 4.16666666666667e+00 +1826 90 -4.16666666666667e+00 +1827 1827 6.25000000000000e+01 +1827 1837 2.08333333333333e+00 +1827 1838 -4.16666666666667e+00 +1827 1832 4.16666666666667e+00 +1827 1830 -6.25000000000000e+00 +1827 1775 -4.16666666666667e+00 +1827 1357 4.16666666666667e+00 +1827 1828 -8.33333333333333e+00 +1827 1774 8.33333333333333e+00 +1827 1773 -1.25000000000000e+01 +1827 1772 4.16666666666667e+00 +1827 1354 4.16666666666667e+00 +1827 1771 -8.33333333333333e+00 +1827 1712 4.16666666666667e+00 +1827 1709 -4.16666666666667e+00 +1827 1355 4.16666666666667e+00 +1827 1457 -4.16666666666667e+00 +1827 1456 2.08333333333333e+00 +1827 1708 -4.16666666666667e+00 +1827 1353 -1.87500000000000e+01 +1827 1829 -8.33333333333333e+00 +1827 1460 4.16666666666667e+00 +1827 1358 4.16666666666667e+00 +1827 1459 -2.08333333333333e+00 +1827 1711 4.16666666666667e+00 +1827 1831 -2.08333333333333e+00 +1827 1458 -6.25000000000000e+00 +1827 1356 -1.87500000000000e+01 +1828 1828 6.25000000000000e+01 +1828 1829 -8.33333333333333e+00 +1828 1830 -2.08333333333333e+00 +1828 1836 2.08333333333333e+00 +1828 1358 -2.08333333333333e+00 +1828 1838 2.08333333333333e+00 +1828 1355 -2.08333333333333e+00 +1828 1831 -6.25000000000000e+00 +1828 1772 4.16666666666667e+00 +1828 1775 8.33333333333333e+00 +1828 1774 -3.75000000000000e+01 +1828 1356 4.16666666666667e+00 +1828 1827 -8.33333333333333e+00 +1828 1773 8.33333333333333e+00 +1828 1353 4.16666666666667e+00 +1828 1770 -8.33333333333333e+00 +1828 1457 2.08333333333333e+00 +1828 1709 -4.16666666666667e+00 +1828 1354 -6.25000000000000e+00 +1828 1455 2.08333333333333e+00 +1828 1707 -4.16666666666667e+00 +1828 1460 4.16666666666667e+00 +1828 1712 -8.33333333333333e+00 +1828 1832 4.16666666666667e+00 +1828 1459 -6.25000000000000e+00 +1828 1357 -6.25000000000000e+00 +1828 1458 -2.08333333333333e+00 +1828 1710 4.16666666666667e+00 +1829 1829 6.25000000000000e+01 +1829 1828 -8.33333333333333e+00 +1829 1357 -2.08333333333333e+00 +1829 1837 2.08333333333333e+00 +1829 1836 -4.16666666666667e+00 +1829 1832 -1.87500000000000e+01 +1829 1354 -2.08333333333333e+00 +1829 1830 4.16666666666667e+00 +1829 1771 4.16666666666667e+00 +1829 1775 -1.25000000000000e+01 +1829 1774 8.33333333333333e+00 +1829 1773 -4.16666666666667e+00 +1829 1770 4.16666666666667e+00 +1829 1710 4.16666666666667e+00 +1829 1707 -4.16666666666667e+00 +1829 1456 2.08333333333333e+00 +1829 1708 -4.16666666666667e+00 +1829 1355 -6.25000000000000e+00 +1829 1353 4.16666666666667e+00 +1829 1455 -4.16666666666667e+00 +1829 1831 4.16666666666667e+00 +1829 1460 -1.87500000000000e+01 +1829 1358 -6.25000000000000e+00 +1829 1459 4.16666666666667e+00 +1829 1711 -8.33333333333333e+00 +1829 1827 -8.33333333333333e+00 +1829 1458 4.16666666666667e+00 +1829 1356 4.16666666666667e+00 +1830 1830 6.25000000000000e+01 +1830 1775 4.16666666666667e+00 +1830 1774 4.16666666666667e+00 +1830 1838 4.16666666666667e+00 +1830 1837 4.16666666666667e+00 +1830 1831 -8.33333333333333e+00 +1830 1836 -1.87500000000000e+01 +1830 1829 4.16666666666667e+00 +1830 1827 -6.25000000000000e+00 +1830 1784 -4.16666666666667e+00 +1830 1832 -8.33333333333333e+00 +1830 1772 -4.16666666666667e+00 +1830 1520 4.16666666666667e+00 +1830 1525 4.16666666666667e+00 +1830 1783 8.33333333333333e+00 +1830 1519 -8.33333333333333e+00 +1830 1526 4.16666666666667e+00 +1830 1355 -4.16666666666667e+00 +1830 1354 2.08333333333333e+00 +1830 1771 -4.16666666666667e+00 +1830 1524 -1.87500000000000e+01 +1830 1538 4.16666666666667e+00 +1830 1382 -4.16666666666667e+00 +1830 1537 -2.08333333333333e+00 +1830 1381 2.08333333333333e+00 +1830 1536 -6.25000000000000e+00 +1830 1828 -2.08333333333333e+00 +1830 1782 -1.25000000000000e+01 +1831 1831 6.25000000000000e+01 +1831 1827 -2.08333333333333e+00 +1831 1775 -8.33333333333333e+00 +1831 1773 4.16666666666667e+00 +1831 1838 -2.08333333333333e+00 +1831 1382 2.08333333333333e+00 +1831 1837 -6.25000000000000e+00 +1831 1836 4.16666666666667e+00 +1831 1830 -8.33333333333333e+00 +1831 1355 2.08333333333333e+00 +1831 1828 -6.25000000000000e+00 +1831 1526 -2.08333333333333e+00 +1831 1524 4.16666666666667e+00 +1831 1772 -4.16666666666667e+00 +1831 1520 4.16666666666667e+00 +1831 1782 8.33333333333333e+00 +1831 1518 -8.33333333333333e+00 +1831 1525 -6.25000000000000e+00 +1831 1353 2.08333333333333e+00 +1831 1770 -4.16666666666667e+00 +1831 1538 4.16666666666667e+00 +1831 1832 -8.33333333333333e+00 +1831 1784 8.33333333333333e+00 +1831 1537 -6.25000000000000e+00 +1831 1829 4.16666666666667e+00 +1831 1783 -3.75000000000000e+01 +1831 1536 -2.08333333333333e+00 +1831 1380 2.08333333333333e+00 +1832 1832 6.25000000000000e+01 +1832 1773 4.16666666666667e+00 +1832 1774 -8.33333333333333e+00 +1832 1838 -6.25000000000000e+00 +1832 1837 -2.08333333333333e+00 +1832 1381 2.08333333333333e+00 +1832 1836 4.16666666666667e+00 +1832 1829 -1.87500000000000e+01 +1832 1354 2.08333333333333e+00 +1832 1827 4.16666666666667e+00 +1832 1782 -4.16666666666667e+00 +1832 1525 -2.08333333333333e+00 +1832 1830 -8.33333333333333e+00 +1832 1770 -4.16666666666667e+00 +1832 1518 4.16666666666667e+00 +1832 1771 -4.16666666666667e+00 +1832 1519 4.16666666666667e+00 +1832 1526 -6.25000000000000e+00 +1832 1524 4.16666666666667e+00 +1832 1353 -4.16666666666667e+00 +1832 1538 -1.87500000000000e+01 +1832 1828 4.16666666666667e+00 +1832 1784 -1.25000000000000e+01 +1832 1537 4.16666666666667e+00 +1832 1831 -8.33333333333333e+00 +1832 1783 8.33333333333333e+00 +1832 1536 4.16666666666667e+00 +1832 1380 -4.16666666666667e+00 +1833 1833 6.25000000000000e+01 +1833 1825 -2.08333333333333e+00 +1833 1824 -6.25000000000000e+00 +1833 1823 -4.16666666666667e+00 +1833 1822 2.08333333333333e+00 +1833 1729 4.16666666666667e+00 +1833 1726 -4.16666666666667e+00 +1833 1730 4.16666666666667e+00 +1833 1727 -4.16666666666667e+00 +1833 1790 4.16666666666667e+00 +1833 1793 -4.16666666666667e+00 +1833 1543 -2.08333333333333e+00 +1833 1834 -8.33333333333333e+00 +1833 1792 8.33333333333333e+00 +1833 1791 -1.25000000000000e+01 +1833 1835 -8.33333333333333e+00 +1833 1358 4.16666666666667e+00 +1833 1544 4.16666666666667e+00 +1833 1357 4.16666666666667e+00 +1833 1789 -8.33333333333333e+00 +1833 1826 4.16666666666667e+00 +1833 1356 -1.87500000000000e+01 +1833 1542 -6.25000000000000e+00 +1833 280 2.08333333333333e+00 +1833 92 4.16666666666667e+00 +1833 281 -4.16666666666667e+00 +1833 91 4.16666666666667e+00 +1833 90 -1.87500000000000e+01 +1834 1834 6.25000000000000e+01 +1834 1826 4.16666666666667e+00 +1834 1825 -6.25000000000000e+00 +1834 1824 -2.08333333333333e+00 +1834 1821 2.08333333333333e+00 +1834 1728 4.16666666666667e+00 +1834 1725 -4.16666666666667e+00 +1834 1727 -4.16666666666667e+00 +1834 1730 -8.33333333333333e+00 +1834 1835 -8.33333333333333e+00 +1834 1793 8.33333333333333e+00 +1834 1544 4.16666666666667e+00 +1834 1542 -2.08333333333333e+00 +1834 1792 -3.75000000000000e+01 +1834 1833 -8.33333333333333e+00 +1834 1791 8.33333333333333e+00 +1834 1358 -2.08333333333333e+00 +1834 1790 4.16666666666667e+00 +1834 1823 2.08333333333333e+00 +1834 1357 -6.25000000000000e+00 +1834 1543 -6.25000000000000e+00 +1834 1356 4.16666666666667e+00 +1834 1788 -8.33333333333333e+00 +1834 279 2.08333333333333e+00 +1834 92 -2.08333333333333e+00 +1834 281 2.08333333333333e+00 +1834 91 -6.25000000000000e+00 +1834 90 4.16666666666667e+00 +1835 1835 6.25000000000000e+01 +1835 1826 -1.87500000000000e+01 +1835 1825 4.16666666666667e+00 +1835 1824 4.16666666666667e+00 +1835 1821 -4.16666666666667e+00 +1835 1726 -4.16666666666667e+00 +1835 1729 -8.33333333333333e+00 +1835 1728 4.16666666666667e+00 +1835 1725 -4.16666666666667e+00 +1835 1788 4.16666666666667e+00 +1835 1791 -4.16666666666667e+00 +1835 1834 -8.33333333333333e+00 +1835 1792 8.33333333333333e+00 +1835 1543 4.16666666666667e+00 +1835 1793 -1.25000000000000e+01 +1835 1822 2.08333333333333e+00 +1835 1358 -6.25000000000000e+00 +1835 1544 -1.87500000000000e+01 +1835 1357 -2.08333333333333e+00 +1835 1789 4.16666666666667e+00 +1835 1833 -8.33333333333333e+00 +1835 1356 4.16666666666667e+00 +1835 1542 4.16666666666667e+00 +1835 92 -6.25000000000000e+00 +1835 91 -2.08333333333333e+00 +1835 280 2.08333333333333e+00 +1835 90 4.16666666666667e+00 +1835 279 -4.16666666666667e+00 +1836 1836 6.25000000000000e+01 +1836 1774 -4.16666666666667e+00 +1836 1784 4.16666666666667e+00 +1836 1775 -4.16666666666667e+00 +1836 1829 -4.16666666666667e+00 +1836 1832 4.16666666666667e+00 +1836 1831 4.16666666666667e+00 +1836 1783 -8.33333333333333e+00 +1836 1830 -1.87500000000000e+01 +1836 1790 4.16666666666667e+00 +1836 1802 -4.16666666666667e+00 +1836 1543 4.16666666666667e+00 +1836 1837 -8.33333333333333e+00 +1836 1801 8.33333333333333e+00 +1836 1382 4.16666666666667e+00 +1836 1550 -4.16666666666667e+00 +1836 1381 -2.08333333333333e+00 +1836 1549 2.08333333333333e+00 +1836 1380 -6.25000000000000e+00 +1836 1800 -1.25000000000000e+01 +1836 1838 -8.33333333333333e+00 +1836 1358 4.16666666666667e+00 +1836 1544 4.16666666666667e+00 +1836 1357 -2.08333333333333e+00 +1836 1789 4.16666666666667e+00 +1836 1828 2.08333333333333e+00 +1836 1356 -6.25000000000000e+00 +1836 1542 -1.87500000000000e+01 +1837 1837 6.25000000000000e+01 +1837 1773 -4.16666666666667e+00 +1837 1829 2.08333333333333e+00 +1837 1775 -4.16666666666667e+00 +1837 1832 -2.08333333333333e+00 +1837 1784 4.16666666666667e+00 +1837 1831 -6.25000000000000e+00 +1837 1830 4.16666666666667e+00 +1837 1782 -8.33333333333333e+00 +1837 1544 -2.08333333333333e+00 +1837 1550 2.08333333333333e+00 +1837 1542 4.16666666666667e+00 +1837 1836 -8.33333333333333e+00 +1837 1800 8.33333333333333e+00 +1837 1382 4.16666666666667e+00 +1837 1838 -8.33333333333333e+00 +1837 1802 8.33333333333333e+00 +1837 1381 -6.25000000000000e+00 +1837 1801 -3.75000000000000e+01 +1837 1380 -2.08333333333333e+00 +1837 1548 2.08333333333333e+00 +1837 1358 4.16666666666667e+00 +1837 1790 -8.33333333333333e+00 +1837 1827 2.08333333333333e+00 +1837 1357 -6.25000000000000e+00 +1837 1543 -6.25000000000000e+00 +1837 1356 -2.08333333333333e+00 +1837 1788 4.16666666666667e+00 +1838 1838 6.25000000000000e+01 +1838 1773 -4.16666666666667e+00 +1838 1828 2.08333333333333e+00 +1838 1774 -4.16666666666667e+00 +1838 1827 -4.16666666666667e+00 +1838 1832 -6.25000000000000e+00 +1838 1831 -2.08333333333333e+00 +1838 1783 4.16666666666667e+00 +1838 1830 4.16666666666667e+00 +1838 1543 -2.08333333333333e+00 +1838 1549 2.08333333333333e+00 +1838 1788 4.16666666666667e+00 +1838 1800 -4.16666666666667e+00 +1838 1382 -1.87500000000000e+01 +1838 1802 -1.25000000000000e+01 +1838 1381 4.16666666666667e+00 +1838 1837 -8.33333333333333e+00 +1838 1801 8.33333333333333e+00 +1838 1380 4.16666666666667e+00 +1838 1548 -4.16666666666667e+00 +1838 1782 4.16666666666667e+00 +1838 1358 -1.87500000000000e+01 +1838 1544 -6.25000000000000e+00 +1838 1357 4.16666666666667e+00 +1838 1789 -8.33333333333333e+00 +1838 1836 -8.33333333333333e+00 +1838 1356 4.16666666666667e+00 +1838 1542 4.16666666666667e+00 +1839 1839 6.25000000000000e+01 +1839 1636 -4.16666666666667e+00 +1839 1844 4.16666666666667e+00 +1839 1841 -8.33333333333333e+00 +1839 1637 8.33333333333333e+00 +1839 1634 4.16666666666667e+00 +1839 1361 -2.08333333333333e+00 +1839 1843 4.16666666666667e+00 +1839 1842 -1.87500000000000e+01 +1839 1853 2.08333333333333e+00 +1839 1367 -2.08333333333333e+00 +1839 1852 -4.16666666666667e+00 +1839 1635 -1.25000000000000e+01 +1839 1616 -4.16666666666667e+00 +1839 1472 2.08333333333333e+00 +1839 1615 -4.16666666666667e+00 +1839 1621 4.16666666666667e+00 +1839 1471 -4.16666666666667e+00 +1839 1360 4.16666666666667e+00 +1839 1359 -6.25000000000000e+00 +1839 1478 4.16666666666667e+00 +1839 1622 -8.33333333333333e+00 +1839 1477 4.16666666666667e+00 +1839 1840 -8.33333333333333e+00 +1839 1366 4.16666666666667e+00 +1839 1476 -1.87500000000000e+01 +1839 1633 4.16666666666667e+00 +1839 1365 -6.25000000000000e+00 +1840 1840 6.25000000000000e+01 +1840 1635 -4.16666666666667e+00 +1840 1844 -2.08333333333333e+00 +1840 1853 2.08333333333333e+00 +1840 1634 -8.33333333333333e+00 +1840 1361 4.16666666666667e+00 +1840 1843 -6.25000000000000e+00 +1840 1842 4.16666666666667e+00 +1840 1637 8.33333333333333e+00 +1840 1841 -8.33333333333333e+00 +1840 1367 4.16666666666667e+00 +1840 1636 -1.25000000000000e+01 +1840 1851 -4.16666666666667e+00 +1840 1614 -4.16666666666667e+00 +1840 1620 4.16666666666667e+00 +1840 1472 2.08333333333333e+00 +1840 1616 -4.16666666666667e+00 +1840 1360 -1.87500000000000e+01 +1840 1470 -4.16666666666667e+00 +1840 1359 4.16666666666667e+00 +1840 1478 -2.08333333333333e+00 +1840 1622 4.16666666666667e+00 +1840 1477 -6.25000000000000e+00 +1840 1632 4.16666666666667e+00 +1840 1366 -1.87500000000000e+01 +1840 1476 4.16666666666667e+00 +1840 1839 -8.33333333333333e+00 +1840 1365 4.16666666666667e+00 +1841 1841 6.25000000000000e+01 +1841 1852 2.08333333333333e+00 +1841 1842 4.16666666666667e+00 +1841 1839 -8.33333333333333e+00 +1841 1635 8.33333333333333e+00 +1841 1844 -6.25000000000000e+00 +1841 1633 -8.33333333333333e+00 +1841 1360 4.16666666666667e+00 +1841 1632 4.16666666666667e+00 +1841 1359 -2.08333333333333e+00 +1841 1637 -3.75000000000000e+01 +1841 1636 8.33333333333333e+00 +1841 1840 -8.33333333333333e+00 +1841 1366 4.16666666666667e+00 +1841 1851 2.08333333333333e+00 +1841 1365 -2.08333333333333e+00 +1841 1614 -4.16666666666667e+00 +1841 1470 2.08333333333333e+00 +1841 1361 -6.25000000000000e+00 +1841 1471 2.08333333333333e+00 +1841 1615 -4.16666666666667e+00 +1841 1478 -6.25000000000000e+00 +1841 1843 -2.08333333333333e+00 +1841 1367 -6.25000000000000e+00 +1841 1477 -2.08333333333333e+00 +1841 1621 4.16666666666667e+00 +1841 1476 4.16666666666667e+00 +1841 1620 -8.33333333333333e+00 +1842 1842 6.25000000000000e+01 +1842 1841 4.16666666666667e+00 +1842 1637 -8.33333333333333e+00 +1842 1361 2.08333333333333e+00 +1842 1840 4.16666666666667e+00 +1842 1839 -1.87500000000000e+01 +1842 1373 2.08333333333333e+00 +1842 1853 -2.08333333333333e+00 +1842 1852 4.16666666666667e+00 +1842 1851 -6.25000000000000e+00 +1842 1634 -4.16666666666667e+00 +1842 1633 -4.16666666666667e+00 +1842 1481 4.16666666666667e+00 +1842 1487 -2.08333333333333e+00 +1842 1843 -8.33333333333333e+00 +1842 1480 4.16666666666667e+00 +1842 1639 -4.16666666666667e+00 +1842 1360 -4.16666666666667e+00 +1842 1486 4.16666666666667e+00 +1842 1485 -6.25000000000000e+00 +1842 1844 -8.33333333333333e+00 +1842 1493 4.16666666666667e+00 +1842 1640 8.33333333333333e+00 +1842 1492 4.16666666666667e+00 +1842 1372 -4.16666666666667e+00 +1842 1636 4.16666666666667e+00 +1842 1491 -1.87500000000000e+01 +1842 1638 -1.25000000000000e+01 +1843 1843 6.25000000000000e+01 +1843 1841 -2.08333333333333e+00 +1843 1637 4.16666666666667e+00 +1843 1840 -6.25000000000000e+00 +1843 1839 4.16666666666667e+00 +1843 1844 -8.33333333333333e+00 +1843 1853 4.16666666666667e+00 +1843 1852 -1.87500000000000e+01 +1843 1851 4.16666666666667e+00 +1843 1632 -4.16666666666667e+00 +1843 1487 4.16666666666667e+00 +1843 1842 -8.33333333333333e+00 +1843 1481 -8.33333333333333e+00 +1843 1640 8.33333333333333e+00 +1843 1479 4.16666666666667e+00 +1843 1638 -4.16666666666667e+00 +1843 1361 2.08333333333333e+00 +1843 1634 -4.16666666666667e+00 +1843 1486 -1.87500000000000e+01 +1843 1359 -4.16666666666667e+00 +1843 1485 4.16666666666667e+00 +1843 1493 -2.08333333333333e+00 +1843 1373 2.08333333333333e+00 +1843 1635 4.16666666666667e+00 +1843 1492 -6.25000000000000e+00 +1843 1639 -1.25000000000000e+01 +1843 1491 4.16666666666667e+00 +1843 1371 -4.16666666666667e+00 +1844 1844 6.25000000000000e+01 +1844 1636 4.16666666666667e+00 +1844 1839 4.16666666666667e+00 +1844 1635 -8.33333333333333e+00 +1844 1841 -6.25000000000000e+00 +1844 1359 2.08333333333333e+00 +1844 1853 -6.25000000000000e+00 +1844 1843 -8.33333333333333e+00 +1844 1852 4.16666666666667e+00 +1844 1371 2.08333333333333e+00 +1844 1851 -2.08333333333333e+00 +1844 1632 -4.16666666666667e+00 +1844 1486 4.16666666666667e+00 +1844 1479 4.16666666666667e+00 +1844 1485 -2.08333333333333e+00 +1844 1480 -8.33333333333333e+00 +1844 1639 8.33333333333333e+00 +1844 1487 -6.25000000000000e+00 +1844 1360 2.08333333333333e+00 +1844 1633 -4.16666666666667e+00 +1844 1840 -2.08333333333333e+00 +1844 1493 -6.25000000000000e+00 +1844 1640 -3.75000000000000e+01 +1844 1492 -2.08333333333333e+00 +1844 1372 2.08333333333333e+00 +1844 1842 -8.33333333333333e+00 +1844 1491 4.16666666666667e+00 +1844 1638 8.33333333333333e+00 +1845 1845 6.25000000000000e+01 +1845 1654 -4.16666666666667e+00 +1845 1850 -2.08333333333333e+00 +1845 1856 2.08333333333333e+00 +1845 1364 4.16666666666667e+00 +1845 1652 -8.33333333333333e+00 +1845 1849 4.16666666666667e+00 +1845 1848 -6.25000000000000e+00 +1845 1847 -8.33333333333333e+00 +1845 1655 8.33333333333333e+00 +1845 1367 4.16666666666667e+00 +1845 1855 -4.16666666666667e+00 +1845 1653 -1.25000000000000e+01 +1845 1618 -4.16666666666667e+00 +1845 1621 4.16666666666667e+00 +1845 1475 2.08333333333333e+00 +1845 1619 -4.16666666666667e+00 +1845 1363 4.16666666666667e+00 +1845 1474 -4.16666666666667e+00 +1845 1362 -1.87500000000000e+01 +1845 1478 -2.08333333333333e+00 +1845 1622 4.16666666666667e+00 +1845 1846 -8.33333333333333e+00 +1845 1477 4.16666666666667e+00 +1845 1366 4.16666666666667e+00 +1845 1651 4.16666666666667e+00 +1845 1476 -6.25000000000000e+00 +1845 1365 -1.87500000000000e+01 +1846 1846 6.25000000000000e+01 +1846 1653 -4.16666666666667e+00 +1846 1847 -8.33333333333333e+00 +1846 1850 4.16666666666667e+00 +1846 1655 8.33333333333333e+00 +1846 1364 -2.08333333333333e+00 +1846 1652 4.16666666666667e+00 +1846 1849 -1.87500000000000e+01 +1846 1848 4.16666666666667e+00 +1846 1856 2.08333333333333e+00 +1846 1367 -2.08333333333333e+00 +1846 1654 -1.25000000000000e+01 +1846 1854 -4.16666666666667e+00 +1846 1475 2.08333333333333e+00 +1846 1619 -4.16666666666667e+00 +1846 1617 -4.16666666666667e+00 +1846 1620 4.16666666666667e+00 +1846 1363 -6.25000000000000e+00 +1846 1362 4.16666666666667e+00 +1846 1473 -4.16666666666667e+00 +1846 1478 4.16666666666667e+00 +1846 1622 -8.33333333333333e+00 +1846 1650 4.16666666666667e+00 +1846 1477 -1.87500000000000e+01 +1846 1366 -6.25000000000000e+00 +1846 1845 -8.33333333333333e+00 +1846 1476 4.16666666666667e+00 +1846 1365 4.16666666666667e+00 +1847 1847 6.25000000000000e+01 +1847 1849 4.16666666666667e+00 +1847 1654 8.33333333333333e+00 +1847 1848 -2.08333333333333e+00 +1847 1854 2.08333333333333e+00 +1847 1850 -6.25000000000000e+00 +1847 1363 -2.08333333333333e+00 +1847 1651 4.16666666666667e+00 +1847 1362 4.16666666666667e+00 +1847 1650 -8.33333333333333e+00 +1847 1655 -3.75000000000000e+01 +1847 1855 2.08333333333333e+00 +1847 1366 -2.08333333333333e+00 +1847 1845 -8.33333333333333e+00 +1847 1653 8.33333333333333e+00 +1847 1365 4.16666666666667e+00 +1847 1474 2.08333333333333e+00 +1847 1618 -4.16666666666667e+00 +1847 1364 -6.25000000000000e+00 +1847 1473 2.08333333333333e+00 +1847 1617 -4.16666666666667e+00 +1847 1846 -8.33333333333333e+00 +1847 1478 -6.25000000000000e+00 +1847 1367 -6.25000000000000e+00 +1847 1477 4.16666666666667e+00 +1847 1621 -8.33333333333333e+00 +1847 1476 -2.08333333333333e+00 +1847 1620 4.16666666666667e+00 +1848 1848 6.25000000000000e+01 +1848 1847 -2.08333333333333e+00 +1848 1655 4.16666666666667e+00 +1848 1846 4.16666666666667e+00 +1848 1845 -6.25000000000000e+00 +1848 1850 -8.33333333333333e+00 +1848 1856 4.16666666666667e+00 +1848 1855 4.16666666666667e+00 +1848 1854 -1.87500000000000e+01 +1848 1651 -4.16666666666667e+00 +1848 1511 4.16666666666667e+00 +1848 1849 -8.33333333333333e+00 +1848 1505 -8.33333333333333e+00 +1848 1658 8.33333333333333e+00 +1848 1504 4.16666666666667e+00 +1848 1657 -4.16666666666667e+00 +1848 1364 2.08333333333333e+00 +1848 1652 -4.16666666666667e+00 +1848 1510 4.16666666666667e+00 +1848 1363 -4.16666666666667e+00 +1848 1509 -1.87500000000000e+01 +1848 1514 -2.08333333333333e+00 +1848 1379 2.08333333333333e+00 +1848 1513 4.16666666666667e+00 +1848 1378 -4.16666666666667e+00 +1848 1512 -6.25000000000000e+00 +1848 1654 4.16666666666667e+00 +1848 1656 -1.25000000000000e+01 +1849 1849 6.25000000000000e+01 +1849 1847 4.16666666666667e+00 +1849 1655 -8.33333333333333e+00 +1849 1364 2.08333333333333e+00 +1849 1846 -1.87500000000000e+01 +1849 1845 4.16666666666667e+00 +1849 1379 2.08333333333333e+00 +1849 1856 -2.08333333333333e+00 +1849 1855 -6.25000000000000e+00 +1849 1854 4.16666666666667e+00 +1849 1652 -4.16666666666667e+00 +1849 1650 -4.16666666666667e+00 +1849 1511 -2.08333333333333e+00 +1849 1505 4.16666666666667e+00 +1849 1848 -8.33333333333333e+00 +1849 1503 4.16666666666667e+00 +1849 1656 -4.16666666666667e+00 +1849 1510 -6.25000000000000e+00 +1849 1509 4.16666666666667e+00 +1849 1362 -4.16666666666667e+00 +1849 1514 4.16666666666667e+00 +1849 1850 -8.33333333333333e+00 +1849 1658 8.33333333333333e+00 +1849 1513 -1.87500000000000e+01 +1849 1653 4.16666666666667e+00 +1849 1657 -1.25000000000000e+01 +1849 1512 4.16666666666667e+00 +1849 1377 -4.16666666666667e+00 +1850 1850 6.25000000000000e+01 +1850 1654 -8.33333333333333e+00 +1850 1845 -2.08333333333333e+00 +1850 1653 4.16666666666667e+00 +1850 1847 -6.25000000000000e+00 +1850 1363 2.08333333333333e+00 +1850 1856 -6.25000000000000e+00 +1850 1378 2.08333333333333e+00 +1850 1855 -2.08333333333333e+00 +1850 1848 -8.33333333333333e+00 +1850 1854 4.16666666666667e+00 +1850 1651 -4.16666666666667e+00 +1850 1510 -2.08333333333333e+00 +1850 1504 4.16666666666667e+00 +1850 1509 4.16666666666667e+00 +1850 1503 -8.33333333333333e+00 +1850 1656 8.33333333333333e+00 +1850 1511 -6.25000000000000e+00 +1850 1362 2.08333333333333e+00 +1850 1650 -4.16666666666667e+00 +1850 1514 -6.25000000000000e+00 +1850 1846 4.16666666666667e+00 +1850 1658 -3.75000000000000e+01 +1850 1513 4.16666666666667e+00 +1850 1849 -8.33333333333333e+00 +1850 1657 8.33333333333333e+00 +1850 1512 -2.08333333333333e+00 +1850 1377 2.08333333333333e+00 +1851 1851 6.25000000000000e+01 +1851 1843 4.16666666666667e+00 +1851 1842 -6.25000000000000e+00 +1851 1841 2.08333333333333e+00 +1851 1840 -4.16666666666667e+00 +1851 1640 4.16666666666667e+00 +1851 1637 -4.16666666666667e+00 +1851 1639 4.16666666666667e+00 +1851 1636 -4.16666666666667e+00 +1851 1672 -4.16666666666667e+00 +1851 1669 4.16666666666667e+00 +1851 1532 2.08333333333333e+00 +1851 1529 -2.08333333333333e+00 +1851 1367 4.16666666666667e+00 +1851 1670 -8.33333333333333e+00 +1851 1366 4.16666666666667e+00 +1851 1852 -8.33333333333333e+00 +1851 1528 4.16666666666667e+00 +1851 1365 -1.87500000000000e+01 +1851 1527 -6.25000000000000e+00 +1851 1853 -8.33333333333333e+00 +1851 1373 4.16666666666667e+00 +1851 1673 8.33333333333333e+00 +1851 1372 4.16666666666667e+00 +1851 1531 -4.16666666666667e+00 +1851 1844 -2.08333333333333e+00 +1851 1371 -1.87500000000000e+01 +1851 1671 -1.25000000000000e+01 +1852 1852 6.25000000000000e+01 +1852 1844 4.16666666666667e+00 +1852 1843 -1.87500000000000e+01 +1852 1842 4.16666666666667e+00 +1852 1839 -4.16666666666667e+00 +1852 1637 -4.16666666666667e+00 +1852 1640 -8.33333333333333e+00 +1852 1638 4.16666666666667e+00 +1852 1635 -4.16666666666667e+00 +1852 1671 -4.16666666666667e+00 +1852 1668 4.16666666666667e+00 +1852 1673 8.33333333333333e+00 +1852 1853 -8.33333333333333e+00 +1852 1529 4.16666666666667e+00 +1852 1367 -2.08333333333333e+00 +1852 1670 4.16666666666667e+00 +1852 1366 -6.25000000000000e+00 +1852 1528 -1.87500000000000e+01 +1852 1365 4.16666666666667e+00 +1852 1851 -8.33333333333333e+00 +1852 1527 4.16666666666667e+00 +1852 1373 -2.08333333333333e+00 +1852 1532 2.08333333333333e+00 +1852 1841 2.08333333333333e+00 +1852 1372 -6.25000000000000e+00 +1852 1672 -1.25000000000000e+01 +1852 1371 4.16666666666667e+00 +1852 1530 -4.16666666666667e+00 +1853 1853 6.25000000000000e+01 +1853 1844 -6.25000000000000e+00 +1853 1843 4.16666666666667e+00 +1853 1842 -2.08333333333333e+00 +1853 1839 2.08333333333333e+00 +1853 1638 4.16666666666667e+00 +1853 1635 -4.16666666666667e+00 +1853 1636 -4.16666666666667e+00 +1853 1639 -8.33333333333333e+00 +1853 1672 8.33333333333333e+00 +1853 1852 -8.33333333333333e+00 +1853 1528 4.16666666666667e+00 +1853 1530 2.08333333333333e+00 +1853 1527 -2.08333333333333e+00 +1853 1367 -6.25000000000000e+00 +1853 1529 -6.25000000000000e+00 +1853 1366 -2.08333333333333e+00 +1853 1669 4.16666666666667e+00 +1853 1365 4.16666666666667e+00 +1853 1668 -8.33333333333333e+00 +1853 1840 2.08333333333333e+00 +1853 1373 -6.25000000000000e+00 +1853 1673 -3.75000000000000e+01 +1853 1372 -2.08333333333333e+00 +1853 1531 2.08333333333333e+00 +1853 1851 -8.33333333333333e+00 +1853 1371 4.16666666666667e+00 +1853 1671 8.33333333333333e+00 +1854 1854 6.25000000000000e+01 +1854 1850 4.16666666666667e+00 +1854 1849 4.16666666666667e+00 +1854 1848 -1.87500000000000e+01 +1854 1846 -4.16666666666667e+00 +1854 1655 -4.16666666666667e+00 +1854 1658 -8.33333333333333e+00 +1854 1657 4.16666666666667e+00 +1854 1654 -4.16666666666667e+00 +1854 1669 4.16666666666667e+00 +1854 1675 -4.16666666666667e+00 +1854 1856 -8.33333333333333e+00 +1854 1676 8.33333333333333e+00 +1854 1529 4.16666666666667e+00 +1854 1379 -2.08333333333333e+00 +1854 1535 2.08333333333333e+00 +1854 1378 4.16666666666667e+00 +1854 1534 -4.16666666666667e+00 +1854 1377 -6.25000000000000e+00 +1854 1674 -1.25000000000000e+01 +1854 1367 -2.08333333333333e+00 +1854 1670 4.16666666666667e+00 +1854 1855 -8.33333333333333e+00 +1854 1366 4.16666666666667e+00 +1854 1528 4.16666666666667e+00 +1854 1847 2.08333333333333e+00 +1854 1365 -6.25000000000000e+00 +1854 1527 -1.87500000000000e+01 +1855 1855 6.25000000000000e+01 +1855 1849 -6.25000000000000e+00 +1855 1848 4.16666666666667e+00 +1855 1847 2.08333333333333e+00 +1855 1845 -4.16666666666667e+00 +1855 1658 4.16666666666667e+00 +1855 1655 -4.16666666666667e+00 +1855 1656 4.16666666666667e+00 +1855 1653 -4.16666666666667e+00 +1855 1668 4.16666666666667e+00 +1855 1674 -4.16666666666667e+00 +1855 1535 2.08333333333333e+00 +1855 1529 -2.08333333333333e+00 +1855 1379 4.16666666666667e+00 +1855 1856 -8.33333333333333e+00 +1855 1676 8.33333333333333e+00 +1855 1378 -1.87500000000000e+01 +1855 1675 -1.25000000000000e+01 +1855 1377 4.16666666666667e+00 +1855 1533 -4.16666666666667e+00 +1855 1367 4.16666666666667e+00 +1855 1670 -8.33333333333333e+00 +1855 1850 -2.08333333333333e+00 +1855 1366 -1.87500000000000e+01 +1855 1528 -6.25000000000000e+00 +1855 1854 -8.33333333333333e+00 +1855 1365 4.16666666666667e+00 +1855 1527 4.16666666666667e+00 +1856 1856 6.25000000000000e+01 +1856 1850 -6.25000000000000e+00 +1856 1849 -2.08333333333333e+00 +1856 1848 4.16666666666667e+00 +1856 1846 2.08333333333333e+00 +1856 1657 4.16666666666667e+00 +1856 1654 -4.16666666666667e+00 +1856 1653 -4.16666666666667e+00 +1856 1656 -8.33333333333333e+00 +1856 1534 2.08333333333333e+00 +1856 1528 -2.08333333333333e+00 +1856 1854 -8.33333333333333e+00 +1856 1674 8.33333333333333e+00 +1856 1527 4.16666666666667e+00 +1856 1379 -6.25000000000000e+00 +1856 1676 -3.75000000000000e+01 +1856 1378 4.16666666666667e+00 +1856 1855 -8.33333333333333e+00 +1856 1675 8.33333333333333e+00 +1856 1377 -2.08333333333333e+00 +1856 1533 2.08333333333333e+00 +1856 1845 2.08333333333333e+00 +1856 1367 -6.25000000000000e+00 +1856 1529 -6.25000000000000e+00 +1856 1366 4.16666666666667e+00 +1856 1669 -8.33333333333333e+00 +1856 1365 -2.08333333333333e+00 +1856 1668 4.16666666666667e+00 +1857 1857 6.25000000000000e+01 +1857 1762 -4.16666666666667e+00 +1857 1862 4.16666666666667e+00 +1857 1859 -8.33333333333333e+00 +1857 1763 8.33333333333333e+00 +1857 1760 4.16666666666667e+00 +1857 1370 -2.08333333333333e+00 +1857 1861 4.16666666666667e+00 +1857 1860 -1.87500000000000e+01 +1857 1871 2.08333333333333e+00 +1857 1376 -2.08333333333333e+00 +1857 1870 -4.16666666666667e+00 +1857 1761 -1.25000000000000e+01 +1857 1742 -4.16666666666667e+00 +1857 1490 2.08333333333333e+00 +1857 1741 -4.16666666666667e+00 +1857 1747 4.16666666666667e+00 +1857 1489 -4.16666666666667e+00 +1857 1369 4.16666666666667e+00 +1857 1368 -6.25000000000000e+00 +1857 1496 4.16666666666667e+00 +1857 1748 -8.33333333333333e+00 +1857 1495 4.16666666666667e+00 +1857 1858 -8.33333333333333e+00 +1857 1375 4.16666666666667e+00 +1857 1494 -1.87500000000000e+01 +1857 1759 4.16666666666667e+00 +1857 1374 -6.25000000000000e+00 +1858 1858 6.25000000000000e+01 +1858 1761 -4.16666666666667e+00 +1858 1862 -2.08333333333333e+00 +1858 1871 2.08333333333333e+00 +1858 1760 -8.33333333333333e+00 +1858 1370 4.16666666666667e+00 +1858 1861 -6.25000000000000e+00 +1858 1860 4.16666666666667e+00 +1858 1763 8.33333333333333e+00 +1858 1859 -8.33333333333333e+00 +1858 1376 4.16666666666667e+00 +1858 1762 -1.25000000000000e+01 +1858 1869 -4.16666666666667e+00 +1858 1740 -4.16666666666667e+00 +1858 1746 4.16666666666667e+00 +1858 1490 2.08333333333333e+00 +1858 1742 -4.16666666666667e+00 +1858 1369 -1.87500000000000e+01 +1858 1488 -4.16666666666667e+00 +1858 1368 4.16666666666667e+00 +1858 1496 -2.08333333333333e+00 +1858 1748 4.16666666666667e+00 +1858 1495 -6.25000000000000e+00 +1858 1758 4.16666666666667e+00 +1858 1375 -1.87500000000000e+01 +1858 1494 4.16666666666667e+00 +1858 1857 -8.33333333333333e+00 +1858 1374 4.16666666666667e+00 +1859 1859 6.25000000000000e+01 +1859 1870 2.08333333333333e+00 +1859 1860 4.16666666666667e+00 +1859 1857 -8.33333333333333e+00 +1859 1761 8.33333333333333e+00 +1859 1862 -6.25000000000000e+00 +1859 1759 -8.33333333333333e+00 +1859 1369 4.16666666666667e+00 +1859 1758 4.16666666666667e+00 +1859 1368 -2.08333333333333e+00 +1859 1763 -3.75000000000000e+01 +1859 1762 8.33333333333333e+00 +1859 1858 -8.33333333333333e+00 +1859 1375 4.16666666666667e+00 +1859 1869 2.08333333333333e+00 +1859 1374 -2.08333333333333e+00 +1859 1740 -4.16666666666667e+00 +1859 1488 2.08333333333333e+00 +1859 1370 -6.25000000000000e+00 +1859 1489 2.08333333333333e+00 +1859 1741 -4.16666666666667e+00 +1859 1496 -6.25000000000000e+00 +1859 1861 -2.08333333333333e+00 +1859 1376 -6.25000000000000e+00 +1859 1495 -2.08333333333333e+00 +1859 1747 4.16666666666667e+00 +1859 1494 4.16666666666667e+00 +1859 1746 -8.33333333333333e+00 +1860 1860 6.25000000000000e+01 +1860 1859 4.16666666666667e+00 +1860 1763 -8.33333333333333e+00 +1860 1370 2.08333333333333e+00 +1860 1858 4.16666666666667e+00 +1860 1857 -1.87500000000000e+01 +1860 1871 -2.08333333333333e+00 +1860 1870 4.16666666666667e+00 +1860 1869 -6.25000000000000e+00 +1860 1760 -4.16666666666667e+00 +1860 1759 -4.16666666666667e+00 +1860 1499 4.16666666666667e+00 +1860 1502 -2.08333333333333e+00 +1860 1861 -8.33333333333333e+00 +1860 1498 4.16666666666667e+00 +1860 1765 -4.16666666666667e+00 +1860 1369 -4.16666666666667e+00 +1860 1501 4.16666666666667e+00 +1860 1500 -6.25000000000000e+00 +1860 1862 -8.33333333333333e+00 +1860 1766 8.33333333333333e+00 +1860 1762 4.16666666666667e+00 +1860 1764 -1.25000000000000e+01 +1860 113 2.08333333333333e+00 +1860 242 4.16666666666667e+00 +1860 241 4.16666666666667e+00 +1860 112 -4.16666666666667e+00 +1860 240 -1.87500000000000e+01 +1861 1861 6.25000000000000e+01 +1861 1859 -2.08333333333333e+00 +1861 1763 4.16666666666667e+00 +1861 1858 -6.25000000000000e+00 +1861 1857 4.16666666666667e+00 +1861 1862 -8.33333333333333e+00 +1861 1871 4.16666666666667e+00 +1861 1870 -1.87500000000000e+01 +1861 1869 4.16666666666667e+00 +1861 1758 -4.16666666666667e+00 +1861 1502 4.16666666666667e+00 +1861 1860 -8.33333333333333e+00 +1861 1499 -8.33333333333333e+00 +1861 1766 8.33333333333333e+00 +1861 1497 4.16666666666667e+00 +1861 1764 -4.16666666666667e+00 +1861 1370 2.08333333333333e+00 +1861 1760 -4.16666666666667e+00 +1861 1501 -1.87500000000000e+01 +1861 1368 -4.16666666666667e+00 +1861 1500 4.16666666666667e+00 +1861 1761 4.16666666666667e+00 +1861 1765 -1.25000000000000e+01 +1861 242 -2.08333333333333e+00 +1861 113 2.08333333333333e+00 +1861 241 -6.25000000000000e+00 +1861 240 4.16666666666667e+00 +1861 111 -4.16666666666667e+00 +1862 1862 6.25000000000000e+01 +1862 1762 4.16666666666667e+00 +1862 1857 4.16666666666667e+00 +1862 1761 -8.33333333333333e+00 +1862 1859 -6.25000000000000e+00 +1862 1368 2.08333333333333e+00 +1862 1871 -6.25000000000000e+00 +1862 1861 -8.33333333333333e+00 +1862 1870 4.16666666666667e+00 +1862 1869 -2.08333333333333e+00 +1862 1758 -4.16666666666667e+00 +1862 1501 4.16666666666667e+00 +1862 1497 4.16666666666667e+00 +1862 1500 -2.08333333333333e+00 +1862 1498 -8.33333333333333e+00 +1862 1765 8.33333333333333e+00 +1862 1502 -6.25000000000000e+00 +1862 1369 2.08333333333333e+00 +1862 1759 -4.16666666666667e+00 +1862 1858 -2.08333333333333e+00 +1862 1766 -3.75000000000000e+01 +1862 1860 -8.33333333333333e+00 +1862 1764 8.33333333333333e+00 +1862 111 2.08333333333333e+00 +1862 242 -6.25000000000000e+00 +1862 241 -2.08333333333333e+00 +1862 112 2.08333333333333e+00 +1862 240 4.16666666666667e+00 +1863 1863 6.25000000000000e+01 +1863 1780 -4.16666666666667e+00 +1863 1868 -2.08333333333333e+00 +1863 1874 2.08333333333333e+00 +1863 1373 4.16666666666667e+00 +1863 1778 -8.33333333333333e+00 +1863 1867 4.16666666666667e+00 +1863 1866 -6.25000000000000e+00 +1863 1865 -8.33333333333333e+00 +1863 1781 8.33333333333333e+00 +1863 1376 4.16666666666667e+00 +1863 1873 -4.16666666666667e+00 +1863 1779 -1.25000000000000e+01 +1863 1744 -4.16666666666667e+00 +1863 1747 4.16666666666667e+00 +1863 1493 2.08333333333333e+00 +1863 1745 -4.16666666666667e+00 +1863 1372 4.16666666666667e+00 +1863 1492 -4.16666666666667e+00 +1863 1371 -1.87500000000000e+01 +1863 1496 -2.08333333333333e+00 +1863 1748 4.16666666666667e+00 +1863 1864 -8.33333333333333e+00 +1863 1495 4.16666666666667e+00 +1863 1375 4.16666666666667e+00 +1863 1777 4.16666666666667e+00 +1863 1494 -6.25000000000000e+00 +1863 1374 -1.87500000000000e+01 +1864 1864 6.25000000000000e+01 +1864 1779 -4.16666666666667e+00 +1864 1865 -8.33333333333333e+00 +1864 1868 4.16666666666667e+00 +1864 1781 8.33333333333333e+00 +1864 1373 -2.08333333333333e+00 +1864 1778 4.16666666666667e+00 +1864 1867 -1.87500000000000e+01 +1864 1866 4.16666666666667e+00 +1864 1874 2.08333333333333e+00 +1864 1376 -2.08333333333333e+00 +1864 1780 -1.25000000000000e+01 +1864 1872 -4.16666666666667e+00 +1864 1493 2.08333333333333e+00 +1864 1745 -4.16666666666667e+00 +1864 1743 -4.16666666666667e+00 +1864 1746 4.16666666666667e+00 +1864 1372 -6.25000000000000e+00 +1864 1371 4.16666666666667e+00 +1864 1491 -4.16666666666667e+00 +1864 1496 4.16666666666667e+00 +1864 1748 -8.33333333333333e+00 +1864 1776 4.16666666666667e+00 +1864 1495 -1.87500000000000e+01 +1864 1375 -6.25000000000000e+00 +1864 1863 -8.33333333333333e+00 +1864 1494 4.16666666666667e+00 +1864 1374 4.16666666666667e+00 +1865 1865 6.25000000000000e+01 +1865 1867 4.16666666666667e+00 +1865 1780 8.33333333333333e+00 +1865 1866 -2.08333333333333e+00 +1865 1872 2.08333333333333e+00 +1865 1868 -6.25000000000000e+00 +1865 1372 -2.08333333333333e+00 +1865 1777 4.16666666666667e+00 +1865 1371 4.16666666666667e+00 +1865 1776 -8.33333333333333e+00 +1865 1781 -3.75000000000000e+01 +1865 1873 2.08333333333333e+00 +1865 1375 -2.08333333333333e+00 +1865 1863 -8.33333333333333e+00 +1865 1779 8.33333333333333e+00 +1865 1374 4.16666666666667e+00 +1865 1492 2.08333333333333e+00 +1865 1744 -4.16666666666667e+00 +1865 1373 -6.25000000000000e+00 +1865 1491 2.08333333333333e+00 +1865 1743 -4.16666666666667e+00 +1865 1864 -8.33333333333333e+00 +1865 1496 -6.25000000000000e+00 +1865 1376 -6.25000000000000e+00 +1865 1495 4.16666666666667e+00 +1865 1747 -8.33333333333333e+00 +1865 1494 -2.08333333333333e+00 +1865 1746 4.16666666666667e+00 +1866 1866 6.25000000000000e+01 +1866 1865 -2.08333333333333e+00 +1866 1781 4.16666666666667e+00 +1866 1864 4.16666666666667e+00 +1866 1863 -6.25000000000000e+00 +1866 1868 -8.33333333333333e+00 +1866 1874 4.16666666666667e+00 +1866 1873 4.16666666666667e+00 +1866 1872 -1.87500000000000e+01 +1866 1777 -4.16666666666667e+00 +1866 1532 4.16666666666667e+00 +1866 1867 -8.33333333333333e+00 +1866 1520 -8.33333333333333e+00 +1866 1784 8.33333333333333e+00 +1866 1519 4.16666666666667e+00 +1866 1783 -4.16666666666667e+00 +1866 1373 2.08333333333333e+00 +1866 1778 -4.16666666666667e+00 +1866 1531 4.16666666666667e+00 +1866 1372 -4.16666666666667e+00 +1866 1530 -1.87500000000000e+01 +1866 1538 -2.08333333333333e+00 +1866 1382 2.08333333333333e+00 +1866 1537 4.16666666666667e+00 +1866 1381 -4.16666666666667e+00 +1866 1536 -6.25000000000000e+00 +1866 1780 4.16666666666667e+00 +1866 1782 -1.25000000000000e+01 +1867 1867 6.25000000000000e+01 +1867 1865 4.16666666666667e+00 +1867 1781 -8.33333333333333e+00 +1867 1373 2.08333333333333e+00 +1867 1864 -1.87500000000000e+01 +1867 1863 4.16666666666667e+00 +1867 1382 2.08333333333333e+00 +1867 1874 -2.08333333333333e+00 +1867 1873 -6.25000000000000e+00 +1867 1872 4.16666666666667e+00 +1867 1778 -4.16666666666667e+00 +1867 1776 -4.16666666666667e+00 +1867 1532 -2.08333333333333e+00 +1867 1520 4.16666666666667e+00 +1867 1866 -8.33333333333333e+00 +1867 1518 4.16666666666667e+00 +1867 1782 -4.16666666666667e+00 +1867 1531 -6.25000000000000e+00 +1867 1530 4.16666666666667e+00 +1867 1371 -4.16666666666667e+00 +1867 1538 4.16666666666667e+00 +1867 1868 -8.33333333333333e+00 +1867 1784 8.33333333333333e+00 +1867 1537 -1.87500000000000e+01 +1867 1779 4.16666666666667e+00 +1867 1783 -1.25000000000000e+01 +1867 1536 4.16666666666667e+00 +1867 1380 -4.16666666666667e+00 +1868 1868 6.25000000000000e+01 +1868 1780 -8.33333333333333e+00 +1868 1863 -2.08333333333333e+00 +1868 1779 4.16666666666667e+00 +1868 1865 -6.25000000000000e+00 +1868 1372 2.08333333333333e+00 +1868 1874 -6.25000000000000e+00 +1868 1381 2.08333333333333e+00 +1868 1873 -2.08333333333333e+00 +1868 1866 -8.33333333333333e+00 +1868 1872 4.16666666666667e+00 +1868 1777 -4.16666666666667e+00 +1868 1531 -2.08333333333333e+00 +1868 1519 4.16666666666667e+00 +1868 1530 4.16666666666667e+00 +1868 1518 -8.33333333333333e+00 +1868 1782 8.33333333333333e+00 +1868 1532 -6.25000000000000e+00 +1868 1371 2.08333333333333e+00 +1868 1776 -4.16666666666667e+00 +1868 1538 -6.25000000000000e+00 +1868 1864 4.16666666666667e+00 +1868 1784 -3.75000000000000e+01 +1868 1537 4.16666666666667e+00 +1868 1867 -8.33333333333333e+00 +1868 1783 8.33333333333333e+00 +1868 1536 -2.08333333333333e+00 +1868 1380 2.08333333333333e+00 +1869 1869 6.25000000000000e+01 +1869 1861 4.16666666666667e+00 +1869 1860 -6.25000000000000e+00 +1869 1859 2.08333333333333e+00 +1869 1858 -4.16666666666667e+00 +1869 1766 4.16666666666667e+00 +1869 1763 -4.16666666666667e+00 +1869 1765 4.16666666666667e+00 +1869 1762 -4.16666666666667e+00 +1869 1798 -4.16666666666667e+00 +1869 1795 4.16666666666667e+00 +1869 1547 -2.08333333333333e+00 +1869 1376 4.16666666666667e+00 +1869 1796 -8.33333333333333e+00 +1869 1375 4.16666666666667e+00 +1869 1870 -8.33333333333333e+00 +1869 1546 4.16666666666667e+00 +1869 1374 -1.87500000000000e+01 +1869 1545 -6.25000000000000e+00 +1869 1871 -8.33333333333333e+00 +1869 1799 8.33333333333333e+00 +1869 1862 -2.08333333333333e+00 +1869 1797 -1.25000000000000e+01 +1869 284 2.08333333333333e+00 +1869 113 4.16666666666667e+00 +1869 112 4.16666666666667e+00 +1869 283 -4.16666666666667e+00 +1869 111 -1.87500000000000e+01 +1870 1870 6.25000000000000e+01 +1870 1862 4.16666666666667e+00 +1870 1861 -1.87500000000000e+01 +1870 1860 4.16666666666667e+00 +1870 1857 -4.16666666666667e+00 +1870 1763 -4.16666666666667e+00 +1870 1766 -8.33333333333333e+00 +1870 1764 4.16666666666667e+00 +1870 1761 -4.16666666666667e+00 +1870 1797 -4.16666666666667e+00 +1870 1794 4.16666666666667e+00 +1870 1799 8.33333333333333e+00 +1870 1871 -8.33333333333333e+00 +1870 1547 4.16666666666667e+00 +1870 1376 -2.08333333333333e+00 +1870 1796 4.16666666666667e+00 +1870 1375 -6.25000000000000e+00 +1870 1546 -1.87500000000000e+01 +1870 1374 4.16666666666667e+00 +1870 1869 -8.33333333333333e+00 +1870 1545 4.16666666666667e+00 +1870 1859 2.08333333333333e+00 +1870 1798 -1.25000000000000e+01 +1870 113 -2.08333333333333e+00 +1870 284 2.08333333333333e+00 +1870 112 -6.25000000000000e+00 +1870 111 4.16666666666667e+00 +1870 282 -4.16666666666667e+00 +1871 1871 6.25000000000000e+01 +1871 1862 -6.25000000000000e+00 +1871 1861 4.16666666666667e+00 +1871 1860 -2.08333333333333e+00 +1871 1857 2.08333333333333e+00 +1871 1764 4.16666666666667e+00 +1871 1761 -4.16666666666667e+00 +1871 1762 -4.16666666666667e+00 +1871 1765 -8.33333333333333e+00 +1871 1798 8.33333333333333e+00 +1871 1870 -8.33333333333333e+00 +1871 1546 4.16666666666667e+00 +1871 1545 -2.08333333333333e+00 +1871 1376 -6.25000000000000e+00 +1871 1547 -6.25000000000000e+00 +1871 1375 -2.08333333333333e+00 +1871 1795 4.16666666666667e+00 +1871 1374 4.16666666666667e+00 +1871 1794 -8.33333333333333e+00 +1871 1858 2.08333333333333e+00 +1871 1799 -3.75000000000000e+01 +1871 1869 -8.33333333333333e+00 +1871 1797 8.33333333333333e+00 +1871 282 2.08333333333333e+00 +1871 113 -6.25000000000000e+00 +1871 112 -2.08333333333333e+00 +1871 283 2.08333333333333e+00 +1871 111 4.16666666666667e+00 +1872 1872 6.25000000000000e+01 +1872 1868 4.16666666666667e+00 +1872 1867 4.16666666666667e+00 +1872 1866 -1.87500000000000e+01 +1872 1864 -4.16666666666667e+00 +1872 1781 -4.16666666666667e+00 +1872 1784 -8.33333333333333e+00 +1872 1783 4.16666666666667e+00 +1872 1780 -4.16666666666667e+00 +1872 1795 4.16666666666667e+00 +1872 1801 -4.16666666666667e+00 +1872 1874 -8.33333333333333e+00 +1872 1802 8.33333333333333e+00 +1872 1547 4.16666666666667e+00 +1872 1382 -2.08333333333333e+00 +1872 1550 2.08333333333333e+00 +1872 1381 4.16666666666667e+00 +1872 1549 -4.16666666666667e+00 +1872 1380 -6.25000000000000e+00 +1872 1800 -1.25000000000000e+01 +1872 1376 -2.08333333333333e+00 +1872 1796 4.16666666666667e+00 +1872 1873 -8.33333333333333e+00 +1872 1375 4.16666666666667e+00 +1872 1546 4.16666666666667e+00 +1872 1865 2.08333333333333e+00 +1872 1374 -6.25000000000000e+00 +1872 1545 -1.87500000000000e+01 +1873 1873 6.25000000000000e+01 +1873 1867 -6.25000000000000e+00 +1873 1866 4.16666666666667e+00 +1873 1865 2.08333333333333e+00 +1873 1863 -4.16666666666667e+00 +1873 1784 4.16666666666667e+00 +1873 1781 -4.16666666666667e+00 +1873 1782 4.16666666666667e+00 +1873 1779 -4.16666666666667e+00 +1873 1794 4.16666666666667e+00 +1873 1800 -4.16666666666667e+00 +1873 1550 2.08333333333333e+00 +1873 1547 -2.08333333333333e+00 +1873 1382 4.16666666666667e+00 +1873 1874 -8.33333333333333e+00 +1873 1802 8.33333333333333e+00 +1873 1381 -1.87500000000000e+01 +1873 1801 -1.25000000000000e+01 +1873 1380 4.16666666666667e+00 +1873 1548 -4.16666666666667e+00 +1873 1376 4.16666666666667e+00 +1873 1796 -8.33333333333333e+00 +1873 1868 -2.08333333333333e+00 +1873 1375 -1.87500000000000e+01 +1873 1546 -6.25000000000000e+00 +1873 1872 -8.33333333333333e+00 +1873 1374 4.16666666666667e+00 +1873 1545 4.16666666666667e+00 +1874 1874 6.25000000000000e+01 +1874 1868 -6.25000000000000e+00 +1874 1867 -2.08333333333333e+00 +1874 1866 4.16666666666667e+00 +1874 1864 2.08333333333333e+00 +1874 1783 4.16666666666667e+00 +1874 1780 -4.16666666666667e+00 +1874 1779 -4.16666666666667e+00 +1874 1782 -8.33333333333333e+00 +1874 1549 2.08333333333333e+00 +1874 1546 -2.08333333333333e+00 +1874 1872 -8.33333333333333e+00 +1874 1800 8.33333333333333e+00 +1874 1545 4.16666666666667e+00 +1874 1382 -6.25000000000000e+00 +1874 1802 -3.75000000000000e+01 +1874 1381 4.16666666666667e+00 +1874 1873 -8.33333333333333e+00 +1874 1801 8.33333333333333e+00 +1874 1380 -2.08333333333333e+00 +1874 1548 2.08333333333333e+00 +1874 1863 2.08333333333333e+00 +1874 1376 -6.25000000000000e+00 +1874 1547 -6.25000000000000e+00 +1874 1375 4.16666666666667e+00 +1874 1795 -8.33333333333333e+00 +1874 1374 -2.08333333333333e+00 +1874 1794 4.16666666666667e+00 diff --git a/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/A.IJ.00003 b/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/A.IJ.00003 new file mode 100644 index 00000000..9eaaee24 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/A.IJ.00003 @@ -0,0 +1,17368 @@ +1875 2474 1875 2474 +1875 1875 1.00000000000000e+00 +1875 1999 0.00000000000000e+00 +1875 1986 0.00000000000000e+00 +1875 2000 0.00000000000000e+00 +1875 1991 0.00000000000000e+00 +1875 2003 0.00000000000000e+00 +1875 1984 0.00000000000000e+00 +1875 1990 0.00000000000000e+00 +1875 1985 0.00000000000000e+00 +1875 1996 0.00000000000000e+00 +1875 2002 0.00000000000000e+00 +1875 1983 0.00000000000000e+00 +1875 1994 0.00000000000000e+00 +1875 1997 0.00000000000000e+00 +1875 1992 0.00000000000000e+00 +1875 1987 0.00000000000000e+00 +1876 1876 1.00000000000000e+00 +1876 1986 0.00000000000000e+00 +1876 1988 0.00000000000000e+00 +1876 1987 0.00000000000000e+00 +1876 1998 0.00000000000000e+00 +1876 2000 0.00000000000000e+00 +1876 1994 0.00000000000000e+00 +1876 1983 0.00000000000000e+00 +1876 1989 0.00000000000000e+00 +1876 1984 0.00000000000000e+00 +1876 1995 0.00000000000000e+00 +1876 2001 0.00000000000000e+00 +1876 1997 0.00000000000000e+00 +1876 2003 0.00000000000000e+00 +1876 1993 0.00000000000000e+00 +1876 1991 0.00000000000000e+00 +1877 1877 1.00000000000000e+00 +1877 1988 0.00000000000000e+00 +1877 1987 0.00000000000000e+00 +1877 1999 0.00000000000000e+00 +1877 1993 0.00000000000000e+00 +1877 1998 0.00000000000000e+00 +1877 1989 0.00000000000000e+00 +1877 2001 0.00000000000000e+00 +1877 1985 0.00000000000000e+00 +1877 1983 0.00000000000000e+00 +1877 1994 0.00000000000000e+00 +1877 1990 0.00000000000000e+00 +1877 1996 0.00000000000000e+00 +1877 2002 0.00000000000000e+00 +1877 1992 0.00000000000000e+00 +1877 1995 0.00000000000000e+00 +1878 1878 3.75000000000000e+01 +1878 2027 -4.16666666666667e+00 +1878 2008 2.08333333333333e+00 +1878 2014 -4.16666666666667e+00 +1878 2009 2.08333333333333e+00 +1878 2020 2.08333333333333e+00 +1878 2026 -4.16666666666667e+00 +1878 2007 -1.25000000000000e+01 +1878 2021 -4.16666666666667e+00 +1878 2012 -2.08333333333333e+00 +1878 2024 4.16666666666667e+00 +1878 1879 -4.16666666666667e+00 +1878 2011 4.16666666666667e+00 +1878 2005 2.08333333333333e+00 +1878 2010 -6.25000000000000e+00 +1878 1880 -4.16666666666667e+00 +1878 2018 4.16666666666667e+00 +1878 2006 2.08333333333333e+00 +1878 2017 -2.08333333333333e+00 +1878 2023 4.16666666666667e+00 +1878 2015 2.08333333333333e+00 +1878 2016 -6.25000000000000e+00 +1878 2004 -1.25000000000000e+01 +1879 1879 3.33333333333333e+01 +1879 2007 2.08333333333333e+00 +1879 2013 -4.16666666666667e+00 +1879 2008 -4.16666666666667e+00 +1879 2019 2.08333333333333e+00 +1879 2025 -4.16666666666667e+00 +1879 2021 2.08333333333333e+00 +1879 2027 -4.16666666666667e+00 +1879 2012 4.16666666666667e+00 +1879 2011 -1.87500000000000e+01 +1879 1878 -4.16666666666667e+00 +1879 2010 4.16666666666667e+00 +1879 2004 2.08333333333333e+00 +1879 2018 4.16666666666667e+00 +1879 2024 -8.33333333333333e+00 +1879 2015 2.08333333333333e+00 +1879 2017 -6.25000000000000e+00 +1879 2005 -4.16666666666667e+00 +1879 2016 -2.08333333333333e+00 +1879 2022 4.16666666666667e+00 +1880 1880 3.33333333333333e+01 +1880 2013 2.08333333333333e+00 +1880 2025 -4.16666666666667e+00 +1880 2009 -4.16666666666667e+00 +1880 2007 2.08333333333333e+00 +1880 2020 2.08333333333333e+00 +1880 2026 -4.16666666666667e+00 +1880 2019 -4.16666666666667e+00 +1880 2012 -6.25000000000000e+00 +1880 2011 4.16666666666667e+00 +1880 2010 -2.08333333333333e+00 +1880 2022 4.16666666666667e+00 +1880 2014 2.08333333333333e+00 +1880 2018 -1.87500000000000e+01 +1880 2006 -4.16666666666667e+00 +1880 2017 4.16666666666667e+00 +1880 2023 -8.33333333333333e+00 +1880 1878 -4.16666666666667e+00 +1880 2016 4.16666666666667e+00 +1880 2004 2.08333333333333e+00 +1881 1881 1.00000000000000e+00 +1881 2035 0.00000000000000e+00 +1881 1882 0.00000000000000e+00 +1881 2032 0.00000000000000e+00 +1881 2034 0.00000000000000e+00 +1881 2039 0.00000000000000e+00 +1881 2042 0.00000000000000e+00 +1881 2038 0.00000000000000e+00 +1881 2041 0.00000000000000e+00 +1881 2037 0.00000000000000e+00 +1881 2036 0.00000000000000e+00 +1881 2031 0.00000000000000e+00 +1882 1882 1.00000000000000e+00 +1882 2042 0.00000000000000e+00 +1882 2035 0.00000000000000e+00 +1882 2034 0.00000000000000e+00 +1882 1881 0.00000000000000e+00 +1882 2031 0.00000000000000e+00 +1882 2039 0.00000000000000e+00 +1882 1883 0.00000000000000e+00 +1882 2033 0.00000000000000e+00 +1882 2038 0.00000000000000e+00 +1882 2036 0.00000000000000e+00 +1882 2032 0.00000000000000e+00 +1882 2037 0.00000000000000e+00 +1882 2040 0.00000000000000e+00 +1883 1883 1.00000000000000e+00 +1883 2035 0.00000000000000e+00 +1883 2041 0.00000000000000e+00 +1883 2034 0.00000000000000e+00 +1883 2039 0.00000000000000e+00 +1883 2036 0.00000000000000e+00 +1883 2033 0.00000000000000e+00 +1883 2038 0.00000000000000e+00 +1883 1882 0.00000000000000e+00 +1883 2032 0.00000000000000e+00 +1883 2037 0.00000000000000e+00 +1883 2040 0.00000000000000e+00 +1884 1884 2.50000000000000e+01 +1884 2053 2.08333333333333e+00 +1884 1885 -4.16666666666667e+00 +1884 2052 -6.25000000000000e+00 +1884 2060 -4.16666666666667e+00 +1884 2056 -2.08333333333333e+00 +1884 2059 2.08333333333333e+00 +1884 1886 -4.16666666666667e+00 +1884 2051 2.08333333333333e+00 +1884 2057 4.16666666666667e+00 +1884 2050 2.08333333333333e+00 +1884 2049 -6.25000000000000e+00 +1884 2048 -2.08333333333333e+00 +1884 2045 2.08333333333333e+00 +1884 2047 4.16666666666667e+00 +1884 2044 -4.16666666666667e+00 +1884 2046 -6.25000000000000e+00 +1884 2054 2.08333333333333e+00 +1884 2055 -6.25000000000000e+00 +1885 1885 2.91666666666667e+01 +1885 2060 2.08333333333333e+00 +1885 2053 -2.08333333333333e+00 +1885 2052 2.08333333333333e+00 +1885 1884 -4.16666666666667e+00 +1885 2055 -2.08333333333333e+00 +1885 2058 2.08333333333333e+00 +1885 2051 -2.08333333333333e+00 +1885 2045 2.08333333333333e+00 +1885 2050 -2.08333333333333e+00 +1885 2049 2.08333333333333e+00 +1885 2048 4.16666666666667e+00 +1885 1886 -8.33333333333333e+00 +1885 2057 4.16666666666667e+00 +1885 2047 -1.87500000000000e+01 +1885 2054 -2.08333333333333e+00 +1885 2056 -6.25000000000000e+00 +1885 2046 4.16666666666667e+00 +1885 2043 -4.16666666666667e+00 +1886 1886 2.91666666666667e+01 +1886 2053 -2.08333333333333e+00 +1886 2059 2.08333333333333e+00 +1886 2052 2.08333333333333e+00 +1886 2058 -4.16666666666667e+00 +1886 2051 -2.08333333333333e+00 +1886 2050 -2.08333333333333e+00 +1886 2044 2.08333333333333e+00 +1886 1884 -4.16666666666667e+00 +1886 2049 2.08333333333333e+00 +1886 2055 4.16666666666667e+00 +1886 2048 -6.25000000000000e+00 +1886 2054 -2.08333333333333e+00 +1886 2057 -1.87500000000000e+01 +1886 2047 4.16666666666667e+00 +1886 1885 -8.33333333333333e+00 +1886 2056 4.16666666666667e+00 +1886 2046 -2.08333333333333e+00 +1886 2043 2.08333333333333e+00 +1887 1887 1.00000000000000e+00 +1887 2078 0.00000000000000e+00 +1887 2074 0.00000000000000e+00 +1887 2073 0.00000000000000e+00 +1887 1889 0.00000000000000e+00 +1887 2072 0.00000000000000e+00 +1887 2069 0.00000000000000e+00 +1887 2071 0.00000000000000e+00 +1887 2077 0.00000000000000e+00 +1887 2075 0.00000000000000e+00 +1887 2070 0.00000000000000e+00 +1887 2067 0.00000000000000e+00 +1888 1888 1.00000000000000e+00 +1888 1889 0.00000000000000e+00 +1888 2069 0.00000000000000e+00 +1888 2074 0.00000000000000e+00 +1888 2073 0.00000000000000e+00 +1888 2072 0.00000000000000e+00 +1888 2078 0.00000000000000e+00 +1888 2075 0.00000000000000e+00 +1888 2071 0.00000000000000e+00 +1888 2068 0.00000000000000e+00 +1888 2070 0.00000000000000e+00 +1888 2076 0.00000000000000e+00 +1889 1889 1.00000000000000e+00 +1889 2074 0.00000000000000e+00 +1889 1888 0.00000000000000e+00 +1889 2068 0.00000000000000e+00 +1889 2073 0.00000000000000e+00 +1889 2076 0.00000000000000e+00 +1889 2075 0.00000000000000e+00 +1889 2072 0.00000000000000e+00 +1889 2069 0.00000000000000e+00 +1889 2071 0.00000000000000e+00 +1889 2077 0.00000000000000e+00 +1889 1887 0.00000000000000e+00 +1889 2070 0.00000000000000e+00 +1889 2067 0.00000000000000e+00 +1890 1890 2.50000000000000e+01 +1890 2096 2.08333333333333e+00 +1890 1892 -4.16666666666667e+00 +1890 2090 2.08333333333333e+00 +1890 2089 2.08333333333333e+00 +1890 2095 -4.16666666666667e+00 +1890 2088 -6.25000000000000e+00 +1890 2084 4.16666666666667e+00 +1890 2083 -2.08333333333333e+00 +1890 2080 2.08333333333333e+00 +1890 2082 -6.25000000000000e+00 +1890 2087 2.08333333333333e+00 +1890 2081 -4.16666666666667e+00 +1890 2086 2.08333333333333e+00 +1890 1891 -4.16666666666667e+00 +1890 2092 4.16666666666667e+00 +1890 2085 -6.25000000000000e+00 +1890 2093 -2.08333333333333e+00 +1890 2091 -6.25000000000000e+00 +1891 1891 2.91666666666667e+01 +1891 2096 2.08333333333333e+00 +1891 2089 -2.08333333333333e+00 +1891 2088 2.08333333333333e+00 +1891 2094 -4.16666666666667e+00 +1891 2084 4.16666666666667e+00 +1891 1892 -8.33333333333333e+00 +1891 2093 4.16666666666667e+00 +1891 2083 -6.25000000000000e+00 +1891 2082 -2.08333333333333e+00 +1891 2079 2.08333333333333e+00 +1891 2087 -2.08333333333333e+00 +1891 2081 2.08333333333333e+00 +1891 2086 -2.08333333333333e+00 +1891 2090 -2.08333333333333e+00 +1891 2092 -1.87500000000000e+01 +1891 2085 2.08333333333333e+00 +1891 1890 -4.16666666666667e+00 +1891 2091 4.16666666666667e+00 +1892 1892 2.91666666666667e+01 +1892 2094 2.08333333333333e+00 +1892 2090 -2.08333333333333e+00 +1892 2089 -2.08333333333333e+00 +1892 2095 2.08333333333333e+00 +1892 1890 -4.16666666666667e+00 +1892 2088 2.08333333333333e+00 +1892 2084 -1.87500000000000e+01 +1892 2083 4.16666666666667e+00 +1892 1891 -8.33333333333333e+00 +1892 2092 4.16666666666667e+00 +1892 2082 4.16666666666667e+00 +1892 2087 -2.08333333333333e+00 +1892 2091 -2.08333333333333e+00 +1892 2093 -6.25000000000000e+00 +1892 2086 -2.08333333333333e+00 +1892 2080 2.08333333333333e+00 +1892 2085 2.08333333333333e+00 +1892 2079 -4.16666666666667e+00 +1893 1893 1.00000000000000e+00 +1893 2108 0.00000000000000e+00 +1893 2114 0.00000000000000e+00 +1893 2107 0.00000000000000e+00 +1893 2104 0.00000000000000e+00 +1893 2106 0.00000000000000e+00 +1893 2111 0.00000000000000e+00 +1893 2105 0.00000000000000e+00 +1893 1894 0.00000000000000e+00 +1893 2110 0.00000000000000e+00 +1893 2113 0.00000000000000e+00 +1893 1895 0.00000000000000e+00 +1893 2109 0.00000000000000e+00 +1893 2112 0.00000000000000e+00 +1894 1894 1.00000000000000e+00 +1894 2107 0.00000000000000e+00 +1894 2106 0.00000000000000e+00 +1894 2103 0.00000000000000e+00 +1894 2111 0.00000000000000e+00 +1894 2105 0.00000000000000e+00 +1894 2108 0.00000000000000e+00 +1894 2110 0.00000000000000e+00 +1894 2113 0.00000000000000e+00 +1894 1893 0.00000000000000e+00 +1894 2109 0.00000000000000e+00 +1894 2112 0.00000000000000e+00 +1895 1895 1.00000000000000e+00 +1895 2107 0.00000000000000e+00 +1895 1893 0.00000000000000e+00 +1895 2106 0.00000000000000e+00 +1895 2112 0.00000000000000e+00 +1895 2108 0.00000000000000e+00 +1895 2111 0.00000000000000e+00 +1895 2114 0.00000000000000e+00 +1895 2110 0.00000000000000e+00 +1895 2104 0.00000000000000e+00 +1895 2109 0.00000000000000e+00 +1895 2103 0.00000000000000e+00 +1896 1896 3.75000000000000e+01 +1896 2138 2.08333333333333e+00 +1896 2125 -2.08333333333333e+00 +1896 2132 -2.08333333333333e+00 +1896 1897 -4.16666666666667e+00 +1896 2137 2.08333333333333e+00 +1896 2136 -1.25000000000000e+01 +1896 2126 4.16666666666667e+00 +1896 2135 2.08333333333333e+00 +1896 2123 -4.16666666666667e+00 +1896 2122 2.08333333333333e+00 +1896 2129 2.08333333333333e+00 +1896 2134 2.08333333333333e+00 +1896 2133 -1.25000000000000e+01 +1896 2120 4.16666666666667e+00 +1896 2117 -4.16666666666667e+00 +1896 2124 -6.25000000000000e+00 +1896 2119 4.16666666666667e+00 +1896 2116 -4.16666666666667e+00 +1896 2128 -4.16666666666667e+00 +1896 2131 4.16666666666667e+00 +1896 2130 -6.25000000000000e+00 +1896 1898 -4.16666666666667e+00 +1897 1897 3.33333333333333e+01 +1897 2137 -4.16666666666667e+00 +1897 1896 -4.16666666666667e+00 +1897 2136 2.08333333333333e+00 +1897 2123 2.08333333333333e+00 +1897 2121 2.08333333333333e+00 +1897 2134 -4.16666666666667e+00 +1897 2133 2.08333333333333e+00 +1897 2126 4.16666666666667e+00 +1897 2125 -6.25000000000000e+00 +1897 2120 -8.33333333333333e+00 +1897 2132 4.16666666666667e+00 +1897 2118 4.16666666666667e+00 +1897 2115 -4.16666666666667e+00 +1897 2129 2.08333333333333e+00 +1897 2117 -4.16666666666667e+00 +1897 2131 -1.87500000000000e+01 +1897 2124 -2.08333333333333e+00 +1897 2127 -4.16666666666667e+00 +1897 2130 4.16666666666667e+00 +1898 1898 3.33333333333333e+01 +1898 2136 2.08333333333333e+00 +1898 2138 -4.16666666666667e+00 +1898 2130 -2.08333333333333e+00 +1898 2122 2.08333333333333e+00 +1898 2124 4.16666666666667e+00 +1898 2133 2.08333333333333e+00 +1898 2121 -4.16666666666667e+00 +1898 2135 -4.16666666666667e+00 +1898 2127 2.08333333333333e+00 +1898 2126 -1.87500000000000e+01 +1898 2125 4.16666666666667e+00 +1898 2118 4.16666666666667e+00 +1898 2115 -4.16666666666667e+00 +1898 2119 -8.33333333333333e+00 +1898 2131 4.16666666666667e+00 +1898 2132 -6.25000000000000e+00 +1898 1896 -4.16666666666667e+00 +1898 2128 2.08333333333333e+00 +1898 2116 -4.16666666666667e+00 +1899 1899 3.75000000000000e+01 +1899 2005 2.08333333333333e+00 +1899 2161 -4.16666666666667e+00 +1899 2153 -2.08333333333333e+00 +1899 1900 -4.16666666666667e+00 +1899 2152 4.16666666666667e+00 +1899 1984 2.08333333333333e+00 +1899 2151 -6.25000000000000e+00 +1899 2168 -4.16666666666667e+00 +1899 2159 4.16666666666667e+00 +1899 2006 2.08333333333333e+00 +1899 2165 -4.16666666666667e+00 +1899 2164 2.08333333333333e+00 +1899 2167 -4.16666666666667e+00 +1899 2004 -1.25000000000000e+01 +1899 1901 -4.16666666666667e+00 +1899 2156 4.16666666666667e+00 +1899 1985 2.08333333333333e+00 +1899 2155 -2.08333333333333e+00 +1899 2158 4.16666666666667e+00 +1899 2162 2.08333333333333e+00 +1899 2154 -6.25000000000000e+00 +1899 1983 -1.25000000000000e+01 +1900 1900 3.33333333333333e+01 +1900 2004 2.08333333333333e+00 +1900 2160 -4.16666666666667e+00 +1900 2153 4.16666666666667e+00 +1900 2152 -1.87500000000000e+01 +1900 1899 -4.16666666666667e+00 +1900 2151 4.16666666666667e+00 +1900 1983 2.08333333333333e+00 +1900 2165 2.08333333333333e+00 +1900 2168 -4.16666666666667e+00 +1900 2005 -4.16666666666667e+00 +1900 2163 2.08333333333333e+00 +1900 2166 -4.16666666666667e+00 +1900 2156 4.16666666666667e+00 +1900 2159 -8.33333333333333e+00 +1900 2162 2.08333333333333e+00 +1900 2155 -6.25000000000000e+00 +1900 1984 -4.16666666666667e+00 +1900 2154 -2.08333333333333e+00 +1900 2157 4.16666666666667e+00 +1901 1901 3.33333333333333e+01 +1901 2160 2.08333333333333e+00 +1901 2153 -6.25000000000000e+00 +1901 2152 4.16666666666667e+00 +1901 2151 -2.08333333333333e+00 +1901 2164 2.08333333333333e+00 +1901 2167 -4.16666666666667e+00 +1901 2166 -4.16666666666667e+00 +1901 2157 4.16666666666667e+00 +1901 2006 -4.16666666666667e+00 +1901 2004 2.08333333333333e+00 +1901 2163 -4.16666666666667e+00 +1901 2161 2.08333333333333e+00 +1901 2156 -1.87500000000000e+01 +1901 1985 -4.16666666666667e+00 +1901 2155 4.16666666666667e+00 +1901 2158 -8.33333333333333e+00 +1901 1899 -4.16666666666667e+00 +1901 2154 4.16666666666667e+00 +1901 1983 2.08333333333333e+00 +1902 1902 1.00000000000000e+00 +1902 2179 0.00000000000000e+00 +1902 2032 0.00000000000000e+00 +1902 2171 0.00000000000000e+00 +1902 2170 0.00000000000000e+00 +1902 1903 0.00000000000000e+00 +1902 1987 0.00000000000000e+00 +1902 2169 0.00000000000000e+00 +1902 2186 0.00000000000000e+00 +1902 2183 0.00000000000000e+00 +1902 2182 0.00000000000000e+00 +1902 2185 0.00000000000000e+00 +1902 2031 0.00000000000000e+00 +1902 2174 0.00000000000000e+00 +1902 2177 0.00000000000000e+00 +1902 2173 0.00000000000000e+00 +1902 2176 0.00000000000000e+00 +1902 2172 0.00000000000000e+00 +1902 2180 0.00000000000000e+00 +1902 1986 0.00000000000000e+00 +1903 1903 1.00000000000000e+00 +1903 2178 0.00000000000000e+00 +1903 2031 0.00000000000000e+00 +1903 2171 0.00000000000000e+00 +1903 2170 0.00000000000000e+00 +1903 2169 0.00000000000000e+00 +1903 1902 0.00000000000000e+00 +1903 1986 0.00000000000000e+00 +1903 2186 0.00000000000000e+00 +1903 2177 0.00000000000000e+00 +1903 2183 0.00000000000000e+00 +1903 2033 0.00000000000000e+00 +1903 2032 0.00000000000000e+00 +1903 2181 0.00000000000000e+00 +1903 2184 0.00000000000000e+00 +1903 2174 0.00000000000000e+00 +1903 1904 0.00000000000000e+00 +1903 1988 0.00000000000000e+00 +1903 2173 0.00000000000000e+00 +1903 2180 0.00000000000000e+00 +1903 1987 0.00000000000000e+00 +1903 2172 0.00000000000000e+00 +1903 2175 0.00000000000000e+00 +1904 1904 1.00000000000000e+00 +1904 2179 0.00000000000000e+00 +1904 2171 0.00000000000000e+00 +1904 2170 0.00000000000000e+00 +1904 2169 0.00000000000000e+00 +1904 2184 0.00000000000000e+00 +1904 2181 0.00000000000000e+00 +1904 2185 0.00000000000000e+00 +1904 2176 0.00000000000000e+00 +1904 2033 0.00000000000000e+00 +1904 2182 0.00000000000000e+00 +1904 2032 0.00000000000000e+00 +1904 2174 0.00000000000000e+00 +1904 2178 0.00000000000000e+00 +1904 1988 0.00000000000000e+00 +1904 2173 0.00000000000000e+00 +1904 1903 0.00000000000000e+00 +1904 1987 0.00000000000000e+00 +1904 2172 0.00000000000000e+00 +1904 2175 0.00000000000000e+00 +1905 1905 6.25000000000000e+01 +1905 2200 4.16666666666667e+00 +1905 2201 4.16666666666667e+00 +1905 2197 4.16666666666667e+00 +1905 2196 -6.25000000000000e+00 +1905 1907 -8.33333333333333e+00 +1905 2171 4.16666666666667e+00 +1905 2170 4.16666666666667e+00 +1905 2169 -1.87500000000000e+01 +1905 2188 -4.16666666666667e+00 +1905 1906 -8.33333333333333e+00 +1905 2192 4.16666666666667e+00 +1905 2203 -4.16666666666667e+00 +1905 2194 4.16666666666667e+00 +1905 2189 8.33333333333333e+00 +1905 2195 -8.33333333333333e+00 +1905 2045 2.08333333333333e+00 +1905 2204 -4.16666666666667e+00 +1905 2191 4.16666666666667e+00 +1905 2044 -4.16666666666667e+00 +1905 2190 -1.87500000000000e+01 +1905 2153 -2.08333333333333e+00 +1905 1991 2.08333333333333e+00 +1905 2152 4.16666666666667e+00 +1905 1990 -4.16666666666667e+00 +1905 2151 -6.25000000000000e+00 +1905 2198 -2.08333333333333e+00 +1905 2187 -1.25000000000000e+01 +1906 1906 6.25000000000000e+01 +1906 2199 4.16666666666667e+00 +1906 2201 -8.33333333333333e+00 +1906 2045 2.08333333333333e+00 +1906 2197 -1.87500000000000e+01 +1906 2196 4.16666666666667e+00 +1906 2171 -2.08333333333333e+00 +1906 1991 2.08333333333333e+00 +1906 2170 -6.25000000000000e+00 +1906 2169 4.16666666666667e+00 +1906 2187 -4.16666666666667e+00 +1906 2192 -2.08333333333333e+00 +1906 1905 -8.33333333333333e+00 +1906 2202 -4.16666666666667e+00 +1906 2193 4.16666666666667e+00 +1906 2204 -4.16666666666667e+00 +1906 2195 4.16666666666667e+00 +1906 2191 -6.25000000000000e+00 +1906 2190 4.16666666666667e+00 +1906 2043 -4.16666666666667e+00 +1906 2153 4.16666666666667e+00 +1906 1907 -8.33333333333333e+00 +1906 2189 8.33333333333333e+00 +1906 2152 -1.87500000000000e+01 +1906 2198 4.16666666666667e+00 +1906 2188 -1.25000000000000e+01 +1906 2151 4.16666666666667e+00 +1906 1989 -4.16666666666667e+00 +1907 1907 6.25000000000000e+01 +1907 2197 4.16666666666667e+00 +1907 2200 -8.33333333333333e+00 +1907 2199 4.16666666666667e+00 +1907 2198 -6.25000000000000e+00 +1907 2044 2.08333333333333e+00 +1907 2171 -6.25000000000000e+00 +1907 2170 -2.08333333333333e+00 +1907 1990 2.08333333333333e+00 +1907 1905 -8.33333333333333e+00 +1907 2169 4.16666666666667e+00 +1907 2191 -2.08333333333333e+00 +1907 2190 4.16666666666667e+00 +1907 2203 -4.16666666666667e+00 +1907 2194 4.16666666666667e+00 +1907 2187 8.33333333333333e+00 +1907 2193 -8.33333333333333e+00 +1907 2192 -6.25000000000000e+00 +1907 2043 2.08333333333333e+00 +1907 2202 -4.16666666666667e+00 +1907 2153 -6.25000000000000e+00 +1907 2196 -2.08333333333333e+00 +1907 2189 -3.75000000000000e+01 +1907 2152 4.16666666666667e+00 +1907 1906 -8.33333333333333e+00 +1907 2188 8.33333333333333e+00 +1907 2151 -2.08333333333333e+00 +1907 1989 2.08333333333333e+00 +1908 1908 1.00000000000000e+00 +1908 2219 0.00000000000000e+00 +1908 2210 0.00000000000000e+00 +1908 2209 0.00000000000000e+00 +1908 2208 0.00000000000000e+00 +1908 2213 0.00000000000000e+00 +1908 2222 0.00000000000000e+00 +1908 2215 0.00000000000000e+00 +1908 2221 0.00000000000000e+00 +1908 2069 0.00000000000000e+00 +1908 2216 0.00000000000000e+00 +1908 2067 0.00000000000000e+00 +1908 1910 0.00000000000000e+00 +1908 2207 0.00000000000000e+00 +1908 1994 0.00000000000000e+00 +1908 2206 0.00000000000000e+00 +1908 2212 0.00000000000000e+00 +1908 2218 0.00000000000000e+00 +1908 2205 0.00000000000000e+00 +1908 1992 0.00000000000000e+00 +1909 1909 1.00000000000000e+00 +1909 2219 0.00000000000000e+00 +1909 2069 0.00000000000000e+00 +1909 2210 0.00000000000000e+00 +1909 1910 0.00000000000000e+00 +1909 1994 0.00000000000000e+00 +1909 2209 0.00000000000000e+00 +1909 2208 0.00000000000000e+00 +1909 2214 0.00000000000000e+00 +1909 2220 0.00000000000000e+00 +1909 2216 0.00000000000000e+00 +1909 2222 0.00000000000000e+00 +1909 2068 0.00000000000000e+00 +1909 2207 0.00000000000000e+00 +1909 2213 0.00000000000000e+00 +1909 2217 0.00000000000000e+00 +1909 2206 0.00000000000000e+00 +1909 1993 0.00000000000000e+00 +1909 2205 0.00000000000000e+00 +1909 2211 0.00000000000000e+00 +1910 1910 1.00000000000000e+00 +1910 2068 0.00000000000000e+00 +1910 2217 0.00000000000000e+00 +1910 2210 0.00000000000000e+00 +1910 2209 0.00000000000000e+00 +1910 1909 0.00000000000000e+00 +1910 1993 0.00000000000000e+00 +1910 2208 0.00000000000000e+00 +1910 2211 0.00000000000000e+00 +1910 2220 0.00000000000000e+00 +1910 2069 0.00000000000000e+00 +1910 2215 0.00000000000000e+00 +1910 2221 0.00000000000000e+00 +1910 2067 0.00000000000000e+00 +1910 2214 0.00000000000000e+00 +1910 2218 0.00000000000000e+00 +1910 2207 0.00000000000000e+00 +1910 1994 0.00000000000000e+00 +1910 2206 0.00000000000000e+00 +1910 2212 0.00000000000000e+00 +1910 1908 0.00000000000000e+00 +1910 2205 0.00000000000000e+00 +1910 1992 0.00000000000000e+00 +1911 1911 6.25000000000000e+01 +1911 2231 4.16666666666667e+00 +1911 2230 -8.33333333333333e+00 +1911 2228 4.16666666666667e+00 +1911 2080 2.08333333333333e+00 +1911 2226 -1.87500000000000e+01 +1911 2156 4.16666666666667e+00 +1911 2155 -2.08333333333333e+00 +1911 1996 2.08333333333333e+00 +1911 2154 -6.25000000000000e+00 +1911 2225 -4.16666666666667e+00 +1911 1913 -8.33333333333333e+00 +1911 2233 -2.08333333333333e+00 +1911 2240 -4.16666666666667e+00 +1911 2237 4.16666666666667e+00 +1911 2239 -4.16666666666667e+00 +1911 2236 4.16666666666667e+00 +1911 2234 4.16666666666667e+00 +1911 2081 -4.16666666666667e+00 +1911 2232 -6.25000000000000e+00 +1911 2207 4.16666666666667e+00 +1911 1997 -4.16666666666667e+00 +1911 2206 4.16666666666667e+00 +1911 1912 -8.33333333333333e+00 +1911 2224 8.33333333333333e+00 +1911 2205 -1.87500000000000e+01 +1911 2227 4.16666666666667e+00 +1911 2223 -1.25000000000000e+01 +1912 1912 6.25000000000000e+01 +1912 2231 4.16666666666667e+00 +1912 2226 4.16666666666667e+00 +1912 2229 -8.33333333333333e+00 +1912 2227 -6.25000000000000e+00 +1912 2079 2.08333333333333e+00 +1912 2156 4.16666666666667e+00 +1912 1913 -8.33333333333333e+00 +1912 2155 -6.25000000000000e+00 +1912 2154 -2.08333333333333e+00 +1912 1995 2.08333333333333e+00 +1912 2232 -2.08333333333333e+00 +1912 2234 4.16666666666667e+00 +1912 2225 8.33333333333333e+00 +1912 2237 -8.33333333333333e+00 +1912 2238 -4.16666666666667e+00 +1912 2235 4.16666666666667e+00 +1912 2081 2.08333333333333e+00 +1912 2240 -4.16666666666667e+00 +1912 2233 -6.25000000000000e+00 +1912 2207 -2.08333333333333e+00 +1912 1997 2.08333333333333e+00 +1912 2206 -6.25000000000000e+00 +1912 2228 -2.08333333333333e+00 +1912 2224 -3.75000000000000e+01 +1912 2205 4.16666666666667e+00 +1912 1911 -8.33333333333333e+00 +1912 2223 8.33333333333333e+00 +1913 1913 6.25000000000000e+01 +1913 2230 4.16666666666667e+00 +1913 2229 4.16666666666667e+00 +1913 2228 -6.25000000000000e+00 +1913 2226 4.16666666666667e+00 +1913 2156 -1.87500000000000e+01 +1913 2155 4.16666666666667e+00 +1913 1912 -8.33333333333333e+00 +1913 2154 4.16666666666667e+00 +1913 2223 -4.16666666666667e+00 +1913 1911 -8.33333333333333e+00 +1913 2233 4.16666666666667e+00 +1913 2238 -4.16666666666667e+00 +1913 2235 4.16666666666667e+00 +1913 2224 8.33333333333333e+00 +1913 2236 -8.33333333333333e+00 +1913 2234 -1.87500000000000e+01 +1913 2080 2.08333333333333e+00 +1913 2239 -4.16666666666667e+00 +1913 2232 4.16666666666667e+00 +1913 2079 -4.16666666666667e+00 +1913 2207 -6.25000000000000e+00 +1913 2227 -2.08333333333333e+00 +1913 2225 -1.25000000000000e+01 +1913 2206 -2.08333333333333e+00 +1913 1996 2.08333333333333e+00 +1913 2205 4.16666666666667e+00 +1913 1995 -4.16666666666667e+00 +1914 1914 1.00000000000000e+00 +1914 2246 0.00000000000000e+00 +1914 2245 0.00000000000000e+00 +1914 2248 0.00000000000000e+00 +1914 2104 0.00000000000000e+00 +1914 2244 0.00000000000000e+00 +1914 1916 0.00000000000000e+00 +1914 2174 0.00000000000000e+00 +1914 2173 0.00000000000000e+00 +1914 1999 0.00000000000000e+00 +1914 2172 0.00000000000000e+00 +1914 2251 0.00000000000000e+00 +1914 2252 0.00000000000000e+00 +1914 2243 0.00000000000000e+00 +1914 2255 0.00000000000000e+00 +1914 2257 0.00000000000000e+00 +1914 2254 0.00000000000000e+00 +1914 2105 0.00000000000000e+00 +1914 2258 0.00000000000000e+00 +1914 2250 0.00000000000000e+00 +1914 2210 0.00000000000000e+00 +1914 2000 0.00000000000000e+00 +1914 1915 0.00000000000000e+00 +1914 2209 0.00000000000000e+00 +1914 2242 0.00000000000000e+00 +1914 2249 0.00000000000000e+00 +1914 2208 0.00000000000000e+00 +1914 2241 0.00000000000000e+00 +1915 1915 1.00000000000000e+00 +1915 2249 0.00000000000000e+00 +1915 2247 0.00000000000000e+00 +1915 2246 0.00000000000000e+00 +1915 2245 0.00000000000000e+00 +1915 2103 0.00000000000000e+00 +1915 2174 0.00000000000000e+00 +1915 2173 0.00000000000000e+00 +1915 2172 0.00000000000000e+00 +1915 1998 0.00000000000000e+00 +1915 2243 0.00000000000000e+00 +1915 1916 0.00000000000000e+00 +1915 2250 0.00000000000000e+00 +1915 2258 0.00000000000000e+00 +1915 2255 0.00000000000000e+00 +1915 2256 0.00000000000000e+00 +1915 2253 0.00000000000000e+00 +1915 2105 0.00000000000000e+00 +1915 2252 0.00000000000000e+00 +1915 2251 0.00000000000000e+00 +1915 2210 0.00000000000000e+00 +1915 2000 0.00000000000000e+00 +1915 2244 0.00000000000000e+00 +1915 2209 0.00000000000000e+00 +1915 2242 0.00000000000000e+00 +1915 1914 0.00000000000000e+00 +1915 2208 0.00000000000000e+00 +1915 2241 0.00000000000000e+00 +1916 1916 1.00000000000000e+00 +1916 2244 0.00000000000000e+00 +1916 2248 0.00000000000000e+00 +1916 2246 0.00000000000000e+00 +1916 2245 0.00000000000000e+00 +1916 2174 0.00000000000000e+00 +1916 2173 0.00000000000000e+00 +1916 1914 0.00000000000000e+00 +1916 2172 0.00000000000000e+00 +1916 2242 0.00000000000000e+00 +1916 1915 0.00000000000000e+00 +1916 2257 0.00000000000000e+00 +1916 2254 0.00000000000000e+00 +1916 2250 0.00000000000000e+00 +1916 2241 0.00000000000000e+00 +1916 2253 0.00000000000000e+00 +1916 2252 0.00000000000000e+00 +1916 2104 0.00000000000000e+00 +1916 2251 0.00000000000000e+00 +1916 2103 0.00000000000000e+00 +1916 2256 0.00000000000000e+00 +1916 2247 0.00000000000000e+00 +1916 2210 0.00000000000000e+00 +1916 2243 0.00000000000000e+00 +1916 2209 0.00000000000000e+00 +1916 1999 0.00000000000000e+00 +1916 2208 0.00000000000000e+00 +1916 1998 0.00000000000000e+00 +1917 1917 1.25000000000000e+02 +1917 2263 8.33333333333333e+00 +1917 2262 -1.25000000000000e+01 +1917 2177 -8.33333333333333e+00 +1917 2176 4.16666666666667e+00 +1917 2243 8.33333333333333e+00 +1917 2275 4.16666666666667e+00 +1917 2242 8.33333333333333e+00 +1917 2241 -3.75000000000000e+01 +1917 2276 4.16666666666667e+00 +1917 2188 -4.16666666666667e+00 +1917 2189 8.33333333333333e+00 +1917 1919 -1.66666666666667e+01 +1917 2003 -4.16666666666667e+00 +1917 2187 -1.25000000000000e+01 +1917 2267 4.16666666666667e+00 +1917 2117 -4.16666666666667e+00 +1917 2266 -8.33333333333333e+00 +1917 2159 4.16666666666667e+00 +1917 2260 8.33333333333333e+00 +1917 1918 -1.66666666666667e+01 +1917 2261 8.33333333333333e+00 +1917 2116 -4.16666666666667e+00 +1917 2259 -3.75000000000000e+01 +1917 2158 4.16666666666667e+00 +1917 2002 -4.16666666666667e+00 +1917 2225 -4.16666666666667e+00 +1917 2213 4.16666666666667e+00 +1917 2272 4.16666666666667e+00 +1917 2269 -4.16666666666667e+00 +1917 2212 -8.33333333333333e+00 +1917 2224 8.33333333333333e+00 +1917 2223 -1.25000000000000e+01 +1917 2270 8.33333333333333e+00 +1917 2273 -8.33333333333333e+00 +1917 2268 -1.25000000000000e+01 +1917 2264 -4.16666666666667e+00 +1918 1918 1.25000000000000e+02 +1918 2262 8.33333333333333e+00 +1918 2264 8.33333333333333e+00 +1918 2263 -3.75000000000000e+01 +1918 2175 4.16666666666667e+00 +1918 2243 -4.16666666666667e+00 +1918 2274 4.16666666666667e+00 +1918 2242 -1.25000000000000e+01 +1918 2241 8.33333333333333e+00 +1918 2276 -8.33333333333333e+00 +1918 2187 -4.16666666666667e+00 +1918 2267 4.16666666666667e+00 +1918 2189 8.33333333333333e+00 +1918 2188 -1.25000000000000e+01 +1918 2265 -8.33333333333333e+00 +1918 2261 -4.16666666666667e+00 +1918 2259 8.33333333333333e+00 +1918 1917 -1.66666666666667e+01 +1918 2260 -1.25000000000000e+01 +1918 2115 -4.16666666666667e+00 +1918 2159 -8.33333333333333e+00 +1918 2157 4.16666666666667e+00 +1918 2001 -4.16666666666667e+00 +1918 2225 8.33333333333333e+00 +1918 1919 -1.66666666666667e+01 +1918 2270 8.33333333333333e+00 +1918 2271 4.16666666666667e+00 +1918 2268 -4.16666666666667e+00 +1918 2213 4.16666666666667e+00 +1918 2003 -4.16666666666667e+00 +1918 2224 -3.75000000000000e+01 +1918 2211 -8.33333333333333e+00 +1918 2223 8.33333333333333e+00 +1918 2273 4.16666666666667e+00 +1918 2117 -4.16666666666667e+00 +1918 2269 -1.25000000000000e+01 +1918 2177 4.16666666666667e+00 +1919 1919 1.25000000000000e+02 +1919 2176 4.16666666666667e+00 +1919 2264 -1.25000000000000e+01 +1919 2263 8.33333333333333e+00 +1919 2175 -8.33333333333333e+00 +1919 2242 -4.16666666666667e+00 +1919 2241 8.33333333333333e+00 +1919 2243 -1.25000000000000e+01 +1919 2275 -8.33333333333333e+00 +1919 2274 4.16666666666667e+00 +1919 2266 4.16666666666667e+00 +1919 2187 8.33333333333333e+00 +1919 1917 -1.66666666666667e+01 +1919 2189 -3.75000000000000e+01 +1919 2188 8.33333333333333e+00 +1919 2001 -4.16666666666667e+00 +1919 2265 4.16666666666667e+00 +1919 2115 -4.16666666666667e+00 +1919 2260 -4.16666666666667e+00 +1919 2157 4.16666666666667e+00 +1919 2261 -1.25000000000000e+01 +1919 2259 8.33333333333333e+00 +1919 2158 -8.33333333333333e+00 +1919 2223 -4.16666666666667e+00 +1919 2211 4.16666666666667e+00 +1919 2224 8.33333333333333e+00 +1919 1918 -1.66666666666667e+01 +1919 2269 8.33333333333333e+00 +1919 2225 -1.25000000000000e+01 +1919 2212 4.16666666666667e+00 +1919 2002 -4.16666666666667e+00 +1919 2270 -3.75000000000000e+01 +1919 2262 -4.16666666666667e+00 +1919 2272 4.16666666666667e+00 +1919 2116 -4.16666666666667e+00 +1919 2268 8.33333333333333e+00 +1919 2271 -8.33333333333333e+00 +1920 1920 3.75000000000000e+01 +1920 2029 2.08333333333333e+00 +1920 2287 -4.16666666666667e+00 +1920 2279 -2.08333333333333e+00 +1920 1921 -4.16666666666667e+00 +1920 2278 4.16666666666667e+00 +1920 2008 2.08333333333333e+00 +1920 2277 -6.25000000000000e+00 +1920 2294 -4.16666666666667e+00 +1920 2285 4.16666666666667e+00 +1920 2030 2.08333333333333e+00 +1920 2291 -4.16666666666667e+00 +1920 2290 2.08333333333333e+00 +1920 2293 -4.16666666666667e+00 +1920 2028 -1.25000000000000e+01 +1920 1922 -4.16666666666667e+00 +1920 2282 4.16666666666667e+00 +1920 2009 2.08333333333333e+00 +1920 2281 -2.08333333333333e+00 +1920 2284 4.16666666666667e+00 +1920 2288 2.08333333333333e+00 +1920 2280 -6.25000000000000e+00 +1920 2007 -1.25000000000000e+01 +1921 1921 3.33333333333333e+01 +1921 2028 2.08333333333333e+00 +1921 2286 -4.16666666666667e+00 +1921 2279 4.16666666666667e+00 +1921 2278 -1.87500000000000e+01 +1921 1920 -4.16666666666667e+00 +1921 2277 4.16666666666667e+00 +1921 2007 2.08333333333333e+00 +1921 2291 2.08333333333333e+00 +1921 2294 -4.16666666666667e+00 +1921 2029 -4.16666666666667e+00 +1921 2289 2.08333333333333e+00 +1921 2292 -4.16666666666667e+00 +1921 2282 4.16666666666667e+00 +1921 2285 -8.33333333333333e+00 +1921 2288 2.08333333333333e+00 +1921 2281 -6.25000000000000e+00 +1921 2008 -4.16666666666667e+00 +1921 2280 -2.08333333333333e+00 +1921 2283 4.16666666666667e+00 +1922 1922 3.33333333333333e+01 +1922 2286 2.08333333333333e+00 +1922 2279 -6.25000000000000e+00 +1922 2278 4.16666666666667e+00 +1922 2277 -2.08333333333333e+00 +1922 2290 2.08333333333333e+00 +1922 2293 -4.16666666666667e+00 +1922 2292 -4.16666666666667e+00 +1922 2283 4.16666666666667e+00 +1922 2030 -4.16666666666667e+00 +1922 2028 2.08333333333333e+00 +1922 2289 -4.16666666666667e+00 +1922 2287 2.08333333333333e+00 +1922 2282 -1.87500000000000e+01 +1922 2009 -4.16666666666667e+00 +1922 2281 4.16666666666667e+00 +1922 2284 -8.33333333333333e+00 +1922 1920 -4.16666666666667e+00 +1922 2280 4.16666666666667e+00 +1922 2007 2.08333333333333e+00 +1923 1923 6.25000000000000e+01 +1923 2305 -4.16666666666667e+00 +1923 2297 4.16666666666667e+00 +1923 2296 4.16666666666667e+00 +1923 2295 -1.87500000000000e+01 +1923 2312 -4.16666666666667e+00 +1923 2311 -4.16666666666667e+00 +1923 2303 -8.33333333333333e+00 +1923 2302 4.16666666666667e+00 +1923 2192 4.16666666666667e+00 +1923 1925 -8.33333333333333e+00 +1923 2300 8.33333333333333e+00 +1923 2308 4.16666666666667e+00 +1923 2299 -4.16666666666667e+00 +1923 2012 -2.08333333333333e+00 +1923 2162 2.08333333333333e+00 +1923 2011 4.16666666666667e+00 +1923 2161 -4.16666666666667e+00 +1923 2010 -6.25000000000000e+00 +1923 2298 -1.25000000000000e+01 +1923 2048 -2.08333333333333e+00 +1923 2309 4.16666666666667e+00 +1923 1924 -8.33333333333333e+00 +1923 2047 4.16666666666667e+00 +1923 2191 4.16666666666667e+00 +1923 2306 2.08333333333333e+00 +1923 2046 -6.25000000000000e+00 +1923 2190 -1.87500000000000e+01 +1924 1924 6.25000000000000e+01 +1924 2304 -4.16666666666667e+00 +1924 2297 -2.08333333333333e+00 +1924 2296 -6.25000000000000e+00 +1924 2295 4.16666666666667e+00 +1924 2312 -4.16666666666667e+00 +1924 2303 4.16666666666667e+00 +1924 2310 -4.16666666666667e+00 +1924 2301 4.16666666666667e+00 +1924 2192 -2.08333333333333e+00 +1924 2162 2.08333333333333e+00 +1924 2307 4.16666666666667e+00 +1924 2298 -4.16666666666667e+00 +1924 2012 4.16666666666667e+00 +1924 1925 -8.33333333333333e+00 +1924 2300 8.33333333333333e+00 +1924 2011 -1.87500000000000e+01 +1924 2299 -1.25000000000000e+01 +1924 2010 4.16666666666667e+00 +1924 2160 -4.16666666666667e+00 +1924 2048 4.16666666666667e+00 +1924 2309 -8.33333333333333e+00 +1924 2306 2.08333333333333e+00 +1924 2047 -1.87500000000000e+01 +1924 2191 -6.25000000000000e+00 +1924 1923 -8.33333333333333e+00 +1924 2046 4.16666666666667e+00 +1924 2190 4.16666666666667e+00 +1925 1925 6.25000000000000e+01 +1925 2305 2.08333333333333e+00 +1925 2297 -6.25000000000000e+00 +1925 2296 -2.08333333333333e+00 +1925 2295 4.16666666666667e+00 +1925 2310 -4.16666666666667e+00 +1925 2311 -4.16666666666667e+00 +1925 2302 4.16666666666667e+00 +1925 2301 -8.33333333333333e+00 +1925 2191 -2.08333333333333e+00 +1925 2161 2.08333333333333e+00 +1925 2190 4.16666666666667e+00 +1925 1923 -8.33333333333333e+00 +1925 2298 8.33333333333333e+00 +1925 2012 -6.25000000000000e+00 +1925 2300 -3.75000000000000e+01 +1925 2011 4.16666666666667e+00 +1925 1924 -8.33333333333333e+00 +1925 2299 8.33333333333333e+00 +1925 2010 -2.08333333333333e+00 +1925 2160 2.08333333333333e+00 +1925 2304 2.08333333333333e+00 +1925 2048 -6.25000000000000e+00 +1925 2192 -6.25000000000000e+00 +1925 2047 4.16666666666667e+00 +1925 2308 -8.33333333333333e+00 +1925 2046 -2.08333333333333e+00 +1925 2307 4.16666666666667e+00 +1926 1926 6.25000000000000e+01 +1926 2326 4.16666666666667e+00 +1926 2327 4.16666666666667e+00 +1926 2323 4.16666666666667e+00 +1926 2322 -6.25000000000000e+00 +1926 1928 -8.33333333333333e+00 +1926 2297 4.16666666666667e+00 +1926 2296 4.16666666666667e+00 +1926 2295 -1.87500000000000e+01 +1926 2314 -4.16666666666667e+00 +1926 1927 -8.33333333333333e+00 +1926 2318 4.16666666666667e+00 +1926 2329 -4.16666666666667e+00 +1926 2320 4.16666666666667e+00 +1926 2315 8.33333333333333e+00 +1926 2321 -8.33333333333333e+00 +1926 2063 2.08333333333333e+00 +1926 2330 -4.16666666666667e+00 +1926 2317 4.16666666666667e+00 +1926 2062 -4.16666666666667e+00 +1926 2316 -1.87500000000000e+01 +1926 2279 -2.08333333333333e+00 +1926 2015 2.08333333333333e+00 +1926 2278 4.16666666666667e+00 +1926 2014 -4.16666666666667e+00 +1926 2277 -6.25000000000000e+00 +1926 2324 -2.08333333333333e+00 +1926 2313 -1.25000000000000e+01 +1927 1927 6.25000000000000e+01 +1927 2325 4.16666666666667e+00 +1927 2327 -8.33333333333333e+00 +1927 2063 2.08333333333333e+00 +1927 2323 -1.87500000000000e+01 +1927 2322 4.16666666666667e+00 +1927 2297 -2.08333333333333e+00 +1927 2015 2.08333333333333e+00 +1927 2296 -6.25000000000000e+00 +1927 2295 4.16666666666667e+00 +1927 2313 -4.16666666666667e+00 +1927 2318 -2.08333333333333e+00 +1927 1926 -8.33333333333333e+00 +1927 2328 -4.16666666666667e+00 +1927 2319 4.16666666666667e+00 +1927 2330 -4.16666666666667e+00 +1927 2321 4.16666666666667e+00 +1927 2317 -6.25000000000000e+00 +1927 2316 4.16666666666667e+00 +1927 2061 -4.16666666666667e+00 +1927 2279 4.16666666666667e+00 +1927 1928 -8.33333333333333e+00 +1927 2315 8.33333333333333e+00 +1927 2278 -1.87500000000000e+01 +1927 2324 4.16666666666667e+00 +1927 2314 -1.25000000000000e+01 +1927 2277 4.16666666666667e+00 +1927 2013 -4.16666666666667e+00 +1928 1928 6.25000000000000e+01 +1928 2323 4.16666666666667e+00 +1928 2326 -8.33333333333333e+00 +1928 2325 4.16666666666667e+00 +1928 2324 -6.25000000000000e+00 +1928 2062 2.08333333333333e+00 +1928 2297 -6.25000000000000e+00 +1928 2296 -2.08333333333333e+00 +1928 2014 2.08333333333333e+00 +1928 1926 -8.33333333333333e+00 +1928 2295 4.16666666666667e+00 +1928 2317 -2.08333333333333e+00 +1928 2316 4.16666666666667e+00 +1928 2329 -4.16666666666667e+00 +1928 2320 4.16666666666667e+00 +1928 2313 8.33333333333333e+00 +1928 2319 -8.33333333333333e+00 +1928 2318 -6.25000000000000e+00 +1928 2061 2.08333333333333e+00 +1928 2328 -4.16666666666667e+00 +1928 2279 -6.25000000000000e+00 +1928 2322 -2.08333333333333e+00 +1928 2315 -3.75000000000000e+01 +1928 2278 4.16666666666667e+00 +1928 1927 -8.33333333333333e+00 +1928 2314 8.33333333333333e+00 +1928 2277 -2.08333333333333e+00 +1928 2013 2.08333333333333e+00 +1929 1929 6.25000000000000e+01 +1929 2348 -4.16666666666667e+00 +1929 2341 2.08333333333333e+00 +1929 2347 -4.16666666666667e+00 +1929 2342 -4.16666666666667e+00 +1929 2333 4.16666666666667e+00 +1929 2332 4.16666666666667e+00 +1929 2338 -8.33333333333333e+00 +1929 2331 -1.87500000000000e+01 +1929 2345 4.16666666666667e+00 +1929 2336 -4.16666666666667e+00 +1929 1930 -8.33333333333333e+00 +1929 2335 8.33333333333333e+00 +1929 2227 4.16666666666667e+00 +1929 2018 4.16666666666667e+00 +1929 2165 -4.16666666666667e+00 +1929 2017 -2.08333333333333e+00 +1929 2164 2.08333333333333e+00 +1929 2016 -6.25000000000000e+00 +1929 2334 -1.25000000000000e+01 +1929 1931 -8.33333333333333e+00 +1929 2084 4.16666666666667e+00 +1929 2228 4.16666666666667e+00 +1929 2083 -2.08333333333333e+00 +1929 2344 4.16666666666667e+00 +1929 2339 4.16666666666667e+00 +1929 2082 -6.25000000000000e+00 +1929 2226 -1.87500000000000e+01 +1930 1930 6.25000000000000e+01 +1930 2346 -4.16666666666667e+00 +1930 2342 2.08333333333333e+00 +1930 2348 -4.16666666666667e+00 +1930 2333 -2.08333333333333e+00 +1930 2339 4.16666666666667e+00 +1930 2332 -6.25000000000000e+00 +1930 2331 4.16666666666667e+00 +1930 2337 -8.33333333333333e+00 +1930 2165 2.08333333333333e+00 +1930 2228 -2.08333333333333e+00 +1930 1929 -8.33333333333333e+00 +1930 2334 8.33333333333333e+00 +1930 2226 4.16666666666667e+00 +1930 2018 4.16666666666667e+00 +1930 1931 -8.33333333333333e+00 +1930 2336 8.33333333333333e+00 +1930 2017 -6.25000000000000e+00 +1930 2335 -3.75000000000000e+01 +1930 2016 -2.08333333333333e+00 +1930 2163 2.08333333333333e+00 +1930 2084 4.16666666666667e+00 +1930 2345 -8.33333333333333e+00 +1930 2340 2.08333333333333e+00 +1930 2083 -6.25000000000000e+00 +1930 2227 -6.25000000000000e+00 +1930 2082 -2.08333333333333e+00 +1930 2343 4.16666666666667e+00 +1931 1931 6.25000000000000e+01 +1931 2346 -4.16666666666667e+00 +1931 2341 2.08333333333333e+00 +1931 2347 -4.16666666666667e+00 +1931 2340 -4.16666666666667e+00 +1931 2333 -6.25000000000000e+00 +1931 2332 -2.08333333333333e+00 +1931 2338 4.16666666666667e+00 +1931 2331 4.16666666666667e+00 +1931 2343 4.16666666666667e+00 +1931 2334 -4.16666666666667e+00 +1931 2164 2.08333333333333e+00 +1931 2227 -2.08333333333333e+00 +1931 2018 -1.87500000000000e+01 +1931 2336 -1.25000000000000e+01 +1931 2017 4.16666666666667e+00 +1931 1930 -8.33333333333333e+00 +1931 2335 8.33333333333333e+00 +1931 2016 4.16666666666667e+00 +1931 2163 -4.16666666666667e+00 +1931 2337 4.16666666666667e+00 +1931 2084 -1.87500000000000e+01 +1931 2228 -6.25000000000000e+00 +1931 2083 4.16666666666667e+00 +1931 2344 -8.33333333333333e+00 +1931 1929 -8.33333333333333e+00 +1931 2082 4.16666666666667e+00 +1931 2226 4.16666666666667e+00 +1932 1932 6.25000000000000e+01 +1932 2357 4.16666666666667e+00 +1932 2356 -8.33333333333333e+00 +1932 2354 4.16666666666667e+00 +1932 2098 2.08333333333333e+00 +1932 2352 -1.87500000000000e+01 +1932 2282 4.16666666666667e+00 +1932 2281 -2.08333333333333e+00 +1932 2020 2.08333333333333e+00 +1932 2280 -6.25000000000000e+00 +1932 2351 -4.16666666666667e+00 +1932 1934 -8.33333333333333e+00 +1932 2359 -2.08333333333333e+00 +1932 2366 -4.16666666666667e+00 +1932 2363 4.16666666666667e+00 +1932 2365 -4.16666666666667e+00 +1932 2362 4.16666666666667e+00 +1932 2360 4.16666666666667e+00 +1932 2099 -4.16666666666667e+00 +1932 2358 -6.25000000000000e+00 +1932 2333 4.16666666666667e+00 +1932 2021 -4.16666666666667e+00 +1932 2332 4.16666666666667e+00 +1932 1933 -8.33333333333333e+00 +1932 2350 8.33333333333333e+00 +1932 2331 -1.87500000000000e+01 +1932 2353 4.16666666666667e+00 +1932 2349 -1.25000000000000e+01 +1933 1933 6.25000000000000e+01 +1933 2357 4.16666666666667e+00 +1933 2352 4.16666666666667e+00 +1933 2355 -8.33333333333333e+00 +1933 2353 -6.25000000000000e+00 +1933 2097 2.08333333333333e+00 +1933 2282 4.16666666666667e+00 +1933 1934 -8.33333333333333e+00 +1933 2281 -6.25000000000000e+00 +1933 2280 -2.08333333333333e+00 +1933 2019 2.08333333333333e+00 +1933 2358 -2.08333333333333e+00 +1933 2360 4.16666666666667e+00 +1933 2351 8.33333333333333e+00 +1933 2363 -8.33333333333333e+00 +1933 2364 -4.16666666666667e+00 +1933 2361 4.16666666666667e+00 +1933 2099 2.08333333333333e+00 +1933 2366 -4.16666666666667e+00 +1933 2359 -6.25000000000000e+00 +1933 2333 -2.08333333333333e+00 +1933 2021 2.08333333333333e+00 +1933 2332 -6.25000000000000e+00 +1933 2354 -2.08333333333333e+00 +1933 2350 -3.75000000000000e+01 +1933 2331 4.16666666666667e+00 +1933 1932 -8.33333333333333e+00 +1933 2349 8.33333333333333e+00 +1934 1934 6.25000000000000e+01 +1934 2356 4.16666666666667e+00 +1934 2355 4.16666666666667e+00 +1934 2354 -6.25000000000000e+00 +1934 2352 4.16666666666667e+00 +1934 2282 -1.87500000000000e+01 +1934 2281 4.16666666666667e+00 +1934 1933 -8.33333333333333e+00 +1934 2280 4.16666666666667e+00 +1934 2349 -4.16666666666667e+00 +1934 1932 -8.33333333333333e+00 +1934 2359 4.16666666666667e+00 +1934 2364 -4.16666666666667e+00 +1934 2361 4.16666666666667e+00 +1934 2350 8.33333333333333e+00 +1934 2362 -8.33333333333333e+00 +1934 2360 -1.87500000000000e+01 +1934 2098 2.08333333333333e+00 +1934 2365 -4.16666666666667e+00 +1934 2358 4.16666666666667e+00 +1934 2097 -4.16666666666667e+00 +1934 2333 -6.25000000000000e+00 +1934 2353 -2.08333333333333e+00 +1934 2351 -1.25000000000000e+01 +1934 2332 -2.08333333333333e+00 +1934 2020 2.08333333333333e+00 +1934 2331 4.16666666666667e+00 +1934 2019 -4.16666666666667e+00 +1935 1935 1.25000000000000e+02 +1935 2374 -8.33333333333333e+00 +1935 2369 8.33333333333333e+00 +1935 2381 -8.33333333333333e+00 +1935 2383 -4.16666666666667e+00 +1935 2380 4.16666666666667e+00 +1935 2384 -4.16666666666667e+00 +1935 2368 8.33333333333333e+00 +1935 2367 -3.75000000000000e+01 +1935 2300 8.33333333333333e+00 +1935 2194 4.16666666666667e+00 +1935 2299 -4.16666666666667e+00 +1935 2195 -8.33333333333333e+00 +1935 2024 4.16666666666667e+00 +1935 2298 -1.25000000000000e+01 +1935 2372 -4.16666666666667e+00 +1935 2120 4.16666666666667e+00 +1935 1936 -1.66666666666667e+01 +1935 2371 8.33333333333333e+00 +1935 2370 -1.25000000000000e+01 +1935 2336 -4.16666666666667e+00 +1935 2335 8.33333333333333e+00 +1935 2168 -4.16666666666667e+00 +1935 2231 4.16666666666667e+00 +1935 2260 8.33333333333333e+00 +1935 2230 -8.33333333333333e+00 +1935 2023 4.16666666666667e+00 +1935 2167 -4.16666666666667e+00 +1935 2334 -1.25000000000000e+01 +1935 1937 -1.66666666666667e+01 +1935 2378 8.33333333333333e+00 +1935 2261 8.33333333333333e+00 +1935 2377 -4.16666666666667e+00 +1935 2119 4.16666666666667e+00 +1935 2375 4.16666666666667e+00 +1935 2376 -1.25000000000000e+01 +1935 2259 -3.75000000000000e+01 +1936 1936 1.25000000000000e+02 +1936 2373 -8.33333333333333e+00 +1936 2369 -4.16666666666667e+00 +1936 2384 -4.16666666666667e+00 +1936 2381 4.16666666666667e+00 +1936 2382 -4.16666666666667e+00 +1936 2379 4.16666666666667e+00 +1936 2368 -1.25000000000000e+01 +1936 2367 8.33333333333333e+00 +1936 2193 4.16666666666667e+00 +1936 2298 -4.16666666666667e+00 +1936 2195 4.16666666666667e+00 +1936 2300 8.33333333333333e+00 +1936 2299 -1.25000000000000e+01 +1936 2372 8.33333333333333e+00 +1936 2371 -3.75000000000000e+01 +1936 1935 -1.66666666666667e+01 +1936 2370 8.33333333333333e+00 +1936 2261 -4.16666666666667e+00 +1936 1937 -1.66666666666667e+01 +1936 2168 -4.16666666666667e+00 +1936 2231 4.16666666666667e+00 +1936 2334 8.33333333333333e+00 +1936 2259 8.33333333333333e+00 +1936 2229 -8.33333333333333e+00 +1936 2024 -8.33333333333333e+00 +1936 2336 8.33333333333333e+00 +1936 2335 -3.75000000000000e+01 +1936 2022 4.16666666666667e+00 +1936 2166 -4.16666666666667e+00 +1936 2378 8.33333333333333e+00 +1936 2120 -8.33333333333333e+00 +1936 2375 4.16666666666667e+00 +1936 2377 -1.25000000000000e+01 +1936 2260 -1.25000000000000e+01 +1936 2376 -4.16666666666667e+00 +1936 2118 4.16666666666667e+00 +1937 1937 1.25000000000000e+02 +1937 2374 4.16666666666667e+00 +1937 2368 -4.16666666666667e+00 +1937 2383 -4.16666666666667e+00 +1937 2380 4.16666666666667e+00 +1937 2367 8.33333333333333e+00 +1937 2379 -8.33333333333333e+00 +1937 2382 -4.16666666666667e+00 +1937 2369 -1.25000000000000e+01 +1937 2298 8.33333333333333e+00 +1937 2194 4.16666666666667e+00 +1937 2193 -8.33333333333333e+00 +1937 2300 -3.75000000000000e+01 +1937 2299 8.33333333333333e+00 +1937 2022 4.16666666666667e+00 +1937 2372 -1.25000000000000e+01 +1937 2371 8.33333333333333e+00 +1937 2370 -4.16666666666667e+00 +1937 2118 4.16666666666667e+00 +1937 2260 -4.16666666666667e+00 +1937 1936 -1.66666666666667e+01 +1937 2334 -4.16666666666667e+00 +1937 2167 -4.16666666666667e+00 +1937 2230 4.16666666666667e+00 +1937 2166 -4.16666666666667e+00 +1937 2229 4.16666666666667e+00 +1937 2336 -1.25000000000000e+01 +1937 2023 -8.33333333333333e+00 +1937 2335 8.33333333333333e+00 +1937 2373 4.16666666666667e+00 +1937 2378 -3.75000000000000e+01 +1937 2261 -1.25000000000000e+01 +1937 2377 8.33333333333333e+00 +1937 2119 -8.33333333333333e+00 +1937 1935 -1.66666666666667e+01 +1937 2376 8.33333333333333e+00 +1937 2259 8.33333333333333e+00 +1938 1938 1.25000000000000e+02 +1938 2389 8.33333333333333e+00 +1938 2388 -1.25000000000000e+01 +1938 2303 -8.33333333333333e+00 +1938 2302 4.16666666666667e+00 +1938 2369 8.33333333333333e+00 +1938 2401 4.16666666666667e+00 +1938 2368 8.33333333333333e+00 +1938 2367 -3.75000000000000e+01 +1938 2402 4.16666666666667e+00 +1938 2314 -4.16666666666667e+00 +1938 2315 8.33333333333333e+00 +1938 1940 -1.66666666666667e+01 +1938 2027 -4.16666666666667e+00 +1938 2313 -1.25000000000000e+01 +1938 2393 4.16666666666667e+00 +1938 2141 -4.16666666666667e+00 +1938 2392 -8.33333333333333e+00 +1938 2285 4.16666666666667e+00 +1938 2386 8.33333333333333e+00 +1938 1939 -1.66666666666667e+01 +1938 2387 8.33333333333333e+00 +1938 2140 -4.16666666666667e+00 +1938 2385 -3.75000000000000e+01 +1938 2284 4.16666666666667e+00 +1938 2026 -4.16666666666667e+00 +1938 2351 -4.16666666666667e+00 +1938 2339 4.16666666666667e+00 +1938 2398 4.16666666666667e+00 +1938 2395 -4.16666666666667e+00 +1938 2338 -8.33333333333333e+00 +1938 2350 8.33333333333333e+00 +1938 2349 -1.25000000000000e+01 +1938 2396 8.33333333333333e+00 +1938 2399 -8.33333333333333e+00 +1938 2394 -1.25000000000000e+01 +1938 2390 -4.16666666666667e+00 +1939 1939 1.25000000000000e+02 +1939 2388 8.33333333333333e+00 +1939 2390 8.33333333333333e+00 +1939 2389 -3.75000000000000e+01 +1939 2301 4.16666666666667e+00 +1939 2369 -4.16666666666667e+00 +1939 2400 4.16666666666667e+00 +1939 2368 -1.25000000000000e+01 +1939 2367 8.33333333333333e+00 +1939 2402 -8.33333333333333e+00 +1939 2313 -4.16666666666667e+00 +1939 2393 4.16666666666667e+00 +1939 2315 8.33333333333333e+00 +1939 2314 -1.25000000000000e+01 +1939 2391 -8.33333333333333e+00 +1939 2387 -4.16666666666667e+00 +1939 2385 8.33333333333333e+00 +1939 1938 -1.66666666666667e+01 +1939 2386 -1.25000000000000e+01 +1939 2139 -4.16666666666667e+00 +1939 2285 -8.33333333333333e+00 +1939 2283 4.16666666666667e+00 +1939 2025 -4.16666666666667e+00 +1939 2351 8.33333333333333e+00 +1939 1940 -1.66666666666667e+01 +1939 2396 8.33333333333333e+00 +1939 2397 4.16666666666667e+00 +1939 2394 -4.16666666666667e+00 +1939 2339 4.16666666666667e+00 +1939 2027 -4.16666666666667e+00 +1939 2350 -3.75000000000000e+01 +1939 2337 -8.33333333333333e+00 +1939 2349 8.33333333333333e+00 +1939 2399 4.16666666666667e+00 +1939 2141 -4.16666666666667e+00 +1939 2395 -1.25000000000000e+01 +1939 2303 4.16666666666667e+00 +1940 1940 1.25000000000000e+02 +1940 2302 4.16666666666667e+00 +1940 2390 -1.25000000000000e+01 +1940 2389 8.33333333333333e+00 +1940 2301 -8.33333333333333e+00 +1940 2368 -4.16666666666667e+00 +1940 2367 8.33333333333333e+00 +1940 2369 -1.25000000000000e+01 +1940 2401 -8.33333333333333e+00 +1940 2400 4.16666666666667e+00 +1940 2392 4.16666666666667e+00 +1940 2313 8.33333333333333e+00 +1940 1938 -1.66666666666667e+01 +1940 2315 -3.75000000000000e+01 +1940 2314 8.33333333333333e+00 +1940 2025 -4.16666666666667e+00 +1940 2391 4.16666666666667e+00 +1940 2139 -4.16666666666667e+00 +1940 2386 -4.16666666666667e+00 +1940 2283 4.16666666666667e+00 +1940 2387 -1.25000000000000e+01 +1940 2385 8.33333333333333e+00 +1940 2284 -8.33333333333333e+00 +1940 2349 -4.16666666666667e+00 +1940 2337 4.16666666666667e+00 +1940 2350 8.33333333333333e+00 +1940 1939 -1.66666666666667e+01 +1940 2395 8.33333333333333e+00 +1940 2351 -1.25000000000000e+01 +1940 2338 4.16666666666667e+00 +1940 2026 -4.16666666666667e+00 +1940 2396 -3.75000000000000e+01 +1940 2388 -4.16666666666667e+00 +1940 2398 4.16666666666667e+00 +1940 2140 -4.16666666666667e+00 +1940 2394 8.33333333333333e+00 +1940 2397 -8.33333333333333e+00 +1941 1941 2.50000000000000e+01 +1941 2198 -2.08333333333333e+00 +1941 2407 2.08333333333333e+00 +1941 2404 -2.08333333333333e+00 +1941 2051 2.08333333333333e+00 +1941 2408 -4.16666666666667e+00 +1941 2050 2.08333333333333e+00 +1941 1942 -4.16666666666667e+00 +1941 2197 4.16666666666667e+00 +1941 2049 -6.25000000000000e+00 +1941 2196 -6.25000000000000e+00 +1941 1943 -4.16666666666667e+00 +1941 2036 2.08333333333333e+00 +1941 2405 4.16666666666667e+00 +1941 2035 2.08333333333333e+00 +1941 2179 -4.16666666666667e+00 +1941 2180 2.08333333333333e+00 +1941 2034 -6.25000000000000e+00 +1941 2403 -6.25000000000000e+00 +1942 1942 2.91666666666667e+01 +1942 2198 4.16666666666667e+00 +1942 2405 4.16666666666667e+00 +1942 2406 2.08333333333333e+00 +1942 2403 -2.08333333333333e+00 +1942 2051 -2.08333333333333e+00 +1942 2408 2.08333333333333e+00 +1942 2050 -2.08333333333333e+00 +1942 2197 -1.87500000000000e+01 +1942 2049 2.08333333333333e+00 +1942 1941 -4.16666666666667e+00 +1942 2196 4.16666666666667e+00 +1942 2036 -2.08333333333333e+00 +1942 2180 2.08333333333333e+00 +1942 1943 -8.33333333333333e+00 +1942 2035 -2.08333333333333e+00 +1942 2404 -6.25000000000000e+00 +1942 2034 2.08333333333333e+00 +1942 2178 -4.16666666666667e+00 +1943 1943 2.91666666666667e+01 +1943 2196 -2.08333333333333e+00 +1943 1942 -8.33333333333333e+00 +1943 2197 4.16666666666667e+00 +1943 2404 4.16666666666667e+00 +1943 2051 -2.08333333333333e+00 +1943 2198 -6.25000000000000e+00 +1943 2050 -2.08333333333333e+00 +1943 2407 2.08333333333333e+00 +1943 2049 2.08333333333333e+00 +1943 2406 -4.16666666666667e+00 +1943 2178 2.08333333333333e+00 +1943 2036 -2.08333333333333e+00 +1943 2405 -1.87500000000000e+01 +1943 2035 -2.08333333333333e+00 +1943 2179 2.08333333333333e+00 +1943 1941 -4.16666666666667e+00 +1943 2034 2.08333333333333e+00 +1943 2403 4.16666666666667e+00 +1944 1944 1.00000000000000e+00 +1944 2246 0.00000000000000e+00 +1944 2410 0.00000000000000e+00 +1944 1945 0.00000000000000e+00 +1944 2245 0.00000000000000e+00 +1944 2108 0.00000000000000e+00 +1944 2414 0.00000000000000e+00 +1944 2107 0.00000000000000e+00 +1944 2413 0.00000000000000e+00 +1944 2106 0.00000000000000e+00 +1944 2244 0.00000000000000e+00 +1944 1946 0.00000000000000e+00 +1944 2039 0.00000000000000e+00 +1944 2411 0.00000000000000e+00 +1944 2038 0.00000000000000e+00 +1944 2182 0.00000000000000e+00 +1944 2183 0.00000000000000e+00 +1944 2037 0.00000000000000e+00 +1944 2409 0.00000000000000e+00 +1945 1945 1.00000000000000e+00 +1945 2414 0.00000000000000e+00 +1945 2409 0.00000000000000e+00 +1945 1944 0.00000000000000e+00 +1945 2244 0.00000000000000e+00 +1945 2108 0.00000000000000e+00 +1945 1946 0.00000000000000e+00 +1945 2246 0.00000000000000e+00 +1945 2107 0.00000000000000e+00 +1945 2245 0.00000000000000e+00 +1945 2106 0.00000000000000e+00 +1945 2412 0.00000000000000e+00 +1945 2039 0.00000000000000e+00 +1945 2183 0.00000000000000e+00 +1945 2411 0.00000000000000e+00 +1945 2038 0.00000000000000e+00 +1945 2410 0.00000000000000e+00 +1945 2037 0.00000000000000e+00 +1945 2181 0.00000000000000e+00 +1946 1946 1.00000000000000e+00 +1946 2413 0.00000000000000e+00 +1946 2181 0.00000000000000e+00 +1946 2244 0.00000000000000e+00 +1946 2108 0.00000000000000e+00 +1946 2246 0.00000000000000e+00 +1946 2107 0.00000000000000e+00 +1946 1945 0.00000000000000e+00 +1946 2245 0.00000000000000e+00 +1946 2106 0.00000000000000e+00 +1946 2412 0.00000000000000e+00 +1946 2410 0.00000000000000e+00 +1946 2039 0.00000000000000e+00 +1946 2411 0.00000000000000e+00 +1946 2038 0.00000000000000e+00 +1946 2182 0.00000000000000e+00 +1946 1944 0.00000000000000e+00 +1946 2037 0.00000000000000e+00 +1946 2409 0.00000000000000e+00 +1947 1947 6.25000000000000e+01 +1947 2200 4.16666666666667e+00 +1947 2201 4.16666666666667e+00 +1947 2405 4.16666666666667e+00 +1947 2403 -6.25000000000000e+00 +1947 2417 4.16666666666667e+00 +1947 2416 4.16666666666667e+00 +1947 1948 -8.33333333333333e+00 +1947 2415 -1.87500000000000e+01 +1947 2264 -4.16666666666667e+00 +1947 1949 -8.33333333333333e+00 +1947 2186 -4.16666666666667e+00 +1947 2249 4.16666666666667e+00 +1947 2410 4.16666666666667e+00 +1947 2263 8.33333333333333e+00 +1947 2248 -8.33333333333333e+00 +1947 2411 4.16666666666667e+00 +1947 2042 -4.16666666666667e+00 +1947 2041 2.08333333333333e+00 +1947 2185 -4.16666666666667e+00 +1947 2409 -1.87500000000000e+01 +1947 2420 4.16666666666667e+00 +1947 2123 -4.16666666666667e+00 +1947 2419 -2.08333333333333e+00 +1947 2122 2.08333333333333e+00 +1947 2418 -6.25000000000000e+00 +1947 2404 -2.08333333333333e+00 +1947 2262 -1.25000000000000e+01 +1948 1948 6.25000000000000e+01 +1948 2403 -2.08333333333333e+00 +1948 2199 4.16666666666667e+00 +1948 2201 -8.33333333333333e+00 +1948 2042 2.08333333333333e+00 +1948 2404 -6.25000000000000e+00 +1948 2417 -2.08333333333333e+00 +1948 2123 2.08333333333333e+00 +1948 2416 -6.25000000000000e+00 +1948 2415 4.16666666666667e+00 +1948 1947 -8.33333333333333e+00 +1948 2411 -2.08333333333333e+00 +1948 2409 4.16666666666667e+00 +1948 2186 -4.16666666666667e+00 +1948 2249 4.16666666666667e+00 +1948 2262 8.33333333333333e+00 +1948 2247 -8.33333333333333e+00 +1948 2410 -6.25000000000000e+00 +1948 2040 2.08333333333333e+00 +1948 2184 -4.16666666666667e+00 +1948 2420 4.16666666666667e+00 +1948 1949 -8.33333333333333e+00 +1948 2264 8.33333333333333e+00 +1948 2419 -6.25000000000000e+00 +1948 2405 4.16666666666667e+00 +1948 2263 -3.75000000000000e+01 +1948 2418 -2.08333333333333e+00 +1948 2121 2.08333333333333e+00 +1949 1949 6.25000000000000e+01 +1949 2200 -8.33333333333333e+00 +1949 2199 4.16666666666667e+00 +1949 2405 -1.87500000000000e+01 +1949 2041 2.08333333333333e+00 +1949 2403 4.16666666666667e+00 +1949 2417 -6.25000000000000e+00 +1949 2416 -2.08333333333333e+00 +1949 2122 2.08333333333333e+00 +1949 2415 4.16666666666667e+00 +1949 2262 -4.16666666666667e+00 +1949 2410 -2.08333333333333e+00 +1949 1947 -8.33333333333333e+00 +1949 2184 -4.16666666666667e+00 +1949 2247 4.16666666666667e+00 +1949 2185 -4.16666666666667e+00 +1949 2248 4.16666666666667e+00 +1949 2411 -6.25000000000000e+00 +1949 2409 4.16666666666667e+00 +1949 2040 -4.16666666666667e+00 +1949 2420 -1.87500000000000e+01 +1949 2404 4.16666666666667e+00 +1949 2264 -1.25000000000000e+01 +1949 2419 4.16666666666667e+00 +1949 1948 -8.33333333333333e+00 +1949 2263 8.33333333333333e+00 +1949 2418 4.16666666666667e+00 +1949 2121 -4.16666666666667e+00 +1950 1950 2.50000000000000e+01 +1950 2324 -2.08333333333333e+00 +1950 2425 2.08333333333333e+00 +1950 2422 -2.08333333333333e+00 +1950 2066 2.08333333333333e+00 +1950 2426 -4.16666666666667e+00 +1950 2065 2.08333333333333e+00 +1950 1951 -4.16666666666667e+00 +1950 2323 4.16666666666667e+00 +1950 2064 -6.25000000000000e+00 +1950 2322 -6.25000000000000e+00 +1950 1952 -4.16666666666667e+00 +1950 2054 2.08333333333333e+00 +1950 2423 4.16666666666667e+00 +1950 2053 2.08333333333333e+00 +1950 2305 -4.16666666666667e+00 +1950 2306 2.08333333333333e+00 +1950 2052 -6.25000000000000e+00 +1950 2421 -6.25000000000000e+00 +1951 1951 2.91666666666667e+01 +1951 2324 4.16666666666667e+00 +1951 2423 4.16666666666667e+00 +1951 2424 2.08333333333333e+00 +1951 2421 -2.08333333333333e+00 +1951 2066 -2.08333333333333e+00 +1951 2426 2.08333333333333e+00 +1951 2065 -2.08333333333333e+00 +1951 2323 -1.87500000000000e+01 +1951 2064 2.08333333333333e+00 +1951 1950 -4.16666666666667e+00 +1951 2322 4.16666666666667e+00 +1951 2054 -2.08333333333333e+00 +1951 2306 2.08333333333333e+00 +1951 1952 -8.33333333333333e+00 +1951 2053 -2.08333333333333e+00 +1951 2422 -6.25000000000000e+00 +1951 2052 2.08333333333333e+00 +1951 2304 -4.16666666666667e+00 +1952 1952 2.91666666666667e+01 +1952 2322 -2.08333333333333e+00 +1952 1951 -8.33333333333333e+00 +1952 2323 4.16666666666667e+00 +1952 2422 4.16666666666667e+00 +1952 2066 -2.08333333333333e+00 +1952 2324 -6.25000000000000e+00 +1952 2065 -2.08333333333333e+00 +1952 2425 2.08333333333333e+00 +1952 2064 2.08333333333333e+00 +1952 2424 -4.16666666666667e+00 +1952 2304 2.08333333333333e+00 +1952 2054 -2.08333333333333e+00 +1952 2423 -1.87500000000000e+01 +1952 2053 -2.08333333333333e+00 +1952 2305 2.08333333333333e+00 +1952 1950 -4.16666666666667e+00 +1952 2052 2.08333333333333e+00 +1952 2421 4.16666666666667e+00 +1953 1953 6.25000000000000e+01 +1953 1954 -8.33333333333333e+00 +1953 2432 -4.16666666666667e+00 +1953 2125 -2.08333333333333e+00 +1953 2431 2.08333333333333e+00 +1953 2429 4.16666666666667e+00 +1953 2056 -2.08333333333333e+00 +1953 2427 -1.87500000000000e+01 +1953 2407 2.08333333333333e+00 +1953 2057 4.16666666666667e+00 +1953 2408 -4.16666666666667e+00 +1953 1955 -8.33333333333333e+00 +1953 2417 4.16666666666667e+00 +1953 2126 4.16666666666667e+00 +1953 2416 4.16666666666667e+00 +1953 2415 -1.87500000000000e+01 +1953 2203 -4.16666666666667e+00 +1953 2308 4.16666666666667e+00 +1953 2309 4.16666666666667e+00 +1953 2204 -4.16666666666667e+00 +1953 2055 -6.25000000000000e+00 +1953 2372 -4.16666666666667e+00 +1953 2267 4.16666666666667e+00 +1953 2371 8.33333333333333e+00 +1953 2266 -8.33333333333333e+00 +1953 2370 -1.25000000000000e+01 +1953 2428 4.16666666666667e+00 +1953 2124 -6.25000000000000e+00 +1954 1954 6.25000000000000e+01 +1954 2432 2.08333333333333e+00 +1954 2427 4.16666666666667e+00 +1954 1953 -8.33333333333333e+00 +1954 2124 -2.08333333333333e+00 +1954 2430 2.08333333333333e+00 +1954 2428 -6.25000000000000e+00 +1954 2055 -2.08333333333333e+00 +1954 2406 2.08333333333333e+00 +1954 2408 2.08333333333333e+00 +1954 2417 -2.08333333333333e+00 +1954 2416 -6.25000000000000e+00 +1954 2415 4.16666666666667e+00 +1954 2202 -4.16666666666667e+00 +1954 2307 4.16666666666667e+00 +1954 2204 -4.16666666666667e+00 +1954 2267 4.16666666666667e+00 +1954 2309 -8.33333333333333e+00 +1954 2057 4.16666666666667e+00 +1954 2056 -6.25000000000000e+00 +1954 2372 8.33333333333333e+00 +1954 1955 -8.33333333333333e+00 +1954 2126 4.16666666666667e+00 +1954 2371 -3.75000000000000e+01 +1954 2429 -2.08333333333333e+00 +1954 2125 -6.25000000000000e+00 +1954 2370 8.33333333333333e+00 +1954 2265 -8.33333333333333e+00 +1955 1955 6.25000000000000e+01 +1955 2431 2.08333333333333e+00 +1955 2430 -4.16666666666667e+00 +1955 2429 -6.25000000000000e+00 +1955 2427 4.16666666666667e+00 +1955 2407 2.08333333333333e+00 +1955 2055 4.16666666666667e+00 +1955 2406 -4.16666666666667e+00 +1955 2417 -6.25000000000000e+00 +1955 2416 -2.08333333333333e+00 +1955 1953 -8.33333333333333e+00 +1955 2415 4.16666666666667e+00 +1955 2124 4.16666666666667e+00 +1955 2203 -4.16666666666667e+00 +1955 2266 4.16666666666667e+00 +1955 2057 -1.87500000000000e+01 +1955 2308 -8.33333333333333e+00 +1955 2056 4.16666666666667e+00 +1955 2307 4.16666666666667e+00 +1955 2202 -4.16666666666667e+00 +1955 2372 -1.25000000000000e+01 +1955 2428 -2.08333333333333e+00 +1955 2126 -1.87500000000000e+01 +1955 2371 8.33333333333333e+00 +1955 1954 -8.33333333333333e+00 +1955 2125 4.16666666666667e+00 +1955 2370 -4.16666666666667e+00 +1955 2265 4.16666666666667e+00 +1956 1956 6.25000000000000e+01 +1956 2326 4.16666666666667e+00 +1956 2327 4.16666666666667e+00 +1956 2423 4.16666666666667e+00 +1956 2421 -6.25000000000000e+00 +1956 2435 4.16666666666667e+00 +1956 2434 4.16666666666667e+00 +1956 1957 -8.33333333333333e+00 +1956 2433 -1.87500000000000e+01 +1956 2390 -4.16666666666667e+00 +1956 1958 -8.33333333333333e+00 +1956 2312 -4.16666666666667e+00 +1956 2375 4.16666666666667e+00 +1956 2428 4.16666666666667e+00 +1956 2389 8.33333333333333e+00 +1956 2374 -8.33333333333333e+00 +1956 2429 4.16666666666667e+00 +1956 2060 -4.16666666666667e+00 +1956 2059 2.08333333333333e+00 +1956 2311 -4.16666666666667e+00 +1956 2427 -1.87500000000000e+01 +1956 2438 4.16666666666667e+00 +1956 2144 -4.16666666666667e+00 +1956 2437 -2.08333333333333e+00 +1956 2143 2.08333333333333e+00 +1956 2436 -6.25000000000000e+00 +1956 2422 -2.08333333333333e+00 +1956 2388 -1.25000000000000e+01 +1957 1957 6.25000000000000e+01 +1957 2421 -2.08333333333333e+00 +1957 2325 4.16666666666667e+00 +1957 2327 -8.33333333333333e+00 +1957 2060 2.08333333333333e+00 +1957 2422 -6.25000000000000e+00 +1957 2435 -2.08333333333333e+00 +1957 2144 2.08333333333333e+00 +1957 2434 -6.25000000000000e+00 +1957 2433 4.16666666666667e+00 +1957 1956 -8.33333333333333e+00 +1957 2429 -2.08333333333333e+00 +1957 2427 4.16666666666667e+00 +1957 2312 -4.16666666666667e+00 +1957 2375 4.16666666666667e+00 +1957 2388 8.33333333333333e+00 +1957 2373 -8.33333333333333e+00 +1957 2428 -6.25000000000000e+00 +1957 2058 2.08333333333333e+00 +1957 2310 -4.16666666666667e+00 +1957 2438 4.16666666666667e+00 +1957 1958 -8.33333333333333e+00 +1957 2390 8.33333333333333e+00 +1957 2437 -6.25000000000000e+00 +1957 2423 4.16666666666667e+00 +1957 2389 -3.75000000000000e+01 +1957 2436 -2.08333333333333e+00 +1957 2142 2.08333333333333e+00 +1958 1958 6.25000000000000e+01 +1958 2326 -8.33333333333333e+00 +1958 2325 4.16666666666667e+00 +1958 2423 -1.87500000000000e+01 +1958 2059 2.08333333333333e+00 +1958 2421 4.16666666666667e+00 +1958 2435 -6.25000000000000e+00 +1958 2434 -2.08333333333333e+00 +1958 2143 2.08333333333333e+00 +1958 2433 4.16666666666667e+00 +1958 2388 -4.16666666666667e+00 +1958 2428 -2.08333333333333e+00 +1958 1956 -8.33333333333333e+00 +1958 2310 -4.16666666666667e+00 +1958 2373 4.16666666666667e+00 +1958 2311 -4.16666666666667e+00 +1958 2374 4.16666666666667e+00 +1958 2429 -6.25000000000000e+00 +1958 2427 4.16666666666667e+00 +1958 2058 -4.16666666666667e+00 +1958 2438 -1.87500000000000e+01 +1958 2422 4.16666666666667e+00 +1958 2390 -1.25000000000000e+01 +1958 2437 4.16666666666667e+00 +1958 1957 -8.33333333333333e+00 +1958 2389 8.33333333333333e+00 +1958 2436 4.16666666666667e+00 +1958 2142 -4.16666666666667e+00 +1959 1959 2.50000000000000e+01 +1959 2215 2.08333333333333e+00 +1959 2444 2.08333333333333e+00 +1959 2441 -2.08333333333333e+00 +1959 2072 2.08333333333333e+00 +1959 2216 -4.16666666666667e+00 +1959 2071 2.08333333333333e+00 +1959 1960 -4.16666666666667e+00 +1959 2440 4.16666666666667e+00 +1959 2070 -6.25000000000000e+00 +1959 2439 -6.25000000000000e+00 +1959 1961 -4.16666666666667e+00 +1959 2087 2.08333333333333e+00 +1959 2234 4.16666666666667e+00 +1959 2086 2.08333333333333e+00 +1959 2443 -4.16666666666667e+00 +1959 2233 -2.08333333333333e+00 +1959 2085 -6.25000000000000e+00 +1959 2232 -6.25000000000000e+00 +1960 1960 2.91666666666667e+01 +1960 2214 2.08333333333333e+00 +1960 2234 4.16666666666667e+00 +1960 1961 -8.33333333333333e+00 +1960 2441 4.16666666666667e+00 +1960 2072 -2.08333333333333e+00 +1960 2216 2.08333333333333e+00 +1960 2071 -2.08333333333333e+00 +1960 2440 -1.87500000000000e+01 +1960 2070 2.08333333333333e+00 +1960 1959 -4.16666666666667e+00 +1960 2439 4.16666666666667e+00 +1960 2087 -2.08333333333333e+00 +1960 2444 2.08333333333333e+00 +1960 2232 -2.08333333333333e+00 +1960 2086 -2.08333333333333e+00 +1960 2233 -6.25000000000000e+00 +1960 2085 2.08333333333333e+00 +1960 2442 -4.16666666666667e+00 +1961 1961 2.91666666666667e+01 +1961 1960 -8.33333333333333e+00 +1961 2440 4.16666666666667e+00 +1961 2442 2.08333333333333e+00 +1961 2439 -2.08333333333333e+00 +1961 2072 -2.08333333333333e+00 +1961 2441 -6.25000000000000e+00 +1961 2071 -2.08333333333333e+00 +1961 2215 2.08333333333333e+00 +1961 2070 2.08333333333333e+00 +1961 2214 -4.16666666666667e+00 +1961 2233 4.16666666666667e+00 +1961 2087 -2.08333333333333e+00 +1961 2234 -1.87500000000000e+01 +1961 2086 -2.08333333333333e+00 +1961 2443 2.08333333333333e+00 +1961 1959 -4.16666666666667e+00 +1961 2085 2.08333333333333e+00 +1961 2232 4.16666666666667e+00 +1962 1962 1.00000000000000e+00 +1962 2251 0.00000000000000e+00 +1962 1964 0.00000000000000e+00 +1962 2252 0.00000000000000e+00 +1962 2447 0.00000000000000e+00 +1962 2111 0.00000000000000e+00 +1962 2450 0.00000000000000e+00 +1962 2110 0.00000000000000e+00 +1962 2449 0.00000000000000e+00 +1962 2109 0.00000000000000e+00 +1962 2250 0.00000000000000e+00 +1962 2075 0.00000000000000e+00 +1962 2219 0.00000000000000e+00 +1962 1963 0.00000000000000e+00 +1962 2074 0.00000000000000e+00 +1962 2446 0.00000000000000e+00 +1962 2218 0.00000000000000e+00 +1962 2073 0.00000000000000e+00 +1962 2445 0.00000000000000e+00 +1963 1963 1.00000000000000e+00 +1963 2250 0.00000000000000e+00 +1963 2450 0.00000000000000e+00 +1963 2447 0.00000000000000e+00 +1963 2111 0.00000000000000e+00 +1963 1964 0.00000000000000e+00 +1963 2252 0.00000000000000e+00 +1963 2110 0.00000000000000e+00 +1963 2251 0.00000000000000e+00 +1963 2109 0.00000000000000e+00 +1963 2448 0.00000000000000e+00 +1963 2075 0.00000000000000e+00 +1963 2219 0.00000000000000e+00 +1963 2217 0.00000000000000e+00 +1963 2074 0.00000000000000e+00 +1963 2446 0.00000000000000e+00 +1963 1962 0.00000000000000e+00 +1963 2073 0.00000000000000e+00 +1963 2445 0.00000000000000e+00 +1964 1964 1.00000000000000e+00 +1964 2446 0.00000000000000e+00 +1964 1962 0.00000000000000e+00 +1964 2250 0.00000000000000e+00 +1964 2445 0.00000000000000e+00 +1964 2111 0.00000000000000e+00 +1964 2252 0.00000000000000e+00 +1964 2110 0.00000000000000e+00 +1964 1963 0.00000000000000e+00 +1964 2251 0.00000000000000e+00 +1964 2109 0.00000000000000e+00 +1964 2448 0.00000000000000e+00 +1964 2449 0.00000000000000e+00 +1964 2075 0.00000000000000e+00 +1964 2447 0.00000000000000e+00 +1964 2074 0.00000000000000e+00 +1964 2218 0.00000000000000e+00 +1964 2073 0.00000000000000e+00 +1964 2217 0.00000000000000e+00 +1965 1965 6.25000000000000e+01 +1965 2255 -8.33333333333333e+00 +1965 2254 4.16666666666667e+00 +1965 2078 2.08333333333333e+00 +1965 2446 4.16666666666667e+00 +1965 2445 -1.87500000000000e+01 +1965 2456 -2.08333333333333e+00 +1965 2129 2.08333333333333e+00 +1965 2455 4.16666666666667e+00 +1965 2454 -6.25000000000000e+00 +1965 2222 -4.16666666666667e+00 +1965 2221 -4.16666666666667e+00 +1965 2237 4.16666666666667e+00 +1965 2441 -2.08333333333333e+00 +1965 1966 -8.33333333333333e+00 +1965 2236 4.16666666666667e+00 +1965 2269 -4.16666666666667e+00 +1965 2077 -4.16666666666667e+00 +1965 2440 4.16666666666667e+00 +1965 2439 -6.25000000000000e+00 +1965 1967 -8.33333333333333e+00 +1965 2453 4.16666666666667e+00 +1965 2270 8.33333333333333e+00 +1965 2452 4.16666666666667e+00 +1965 2128 -4.16666666666667e+00 +1965 2447 4.16666666666667e+00 +1965 2451 -1.87500000000000e+01 +1965 2268 -1.25000000000000e+01 +1966 1966 6.25000000000000e+01 +1966 2255 4.16666666666667e+00 +1966 2253 4.16666666666667e+00 +1966 2446 -6.25000000000000e+00 +1966 2445 4.16666666666667e+00 +1966 2456 4.16666666666667e+00 +1966 1967 -8.33333333333333e+00 +1966 2455 -1.87500000000000e+01 +1966 2454 4.16666666666667e+00 +1966 2220 -4.16666666666667e+00 +1966 2441 4.16666666666667e+00 +1966 1965 -8.33333333333333e+00 +1966 2237 -8.33333333333333e+00 +1966 2270 8.33333333333333e+00 +1966 2235 4.16666666666667e+00 +1966 2268 -4.16666666666667e+00 +1966 2078 2.08333333333333e+00 +1966 2222 -4.16666666666667e+00 +1966 2440 -1.87500000000000e+01 +1966 2076 -4.16666666666667e+00 +1966 2439 4.16666666666667e+00 +1966 2453 -2.08333333333333e+00 +1966 2129 2.08333333333333e+00 +1966 2447 -2.08333333333333e+00 +1966 2452 -6.25000000000000e+00 +1966 2269 -1.25000000000000e+01 +1966 2451 4.16666666666667e+00 +1966 2127 -4.16666666666667e+00 +1967 1967 6.25000000000000e+01 +1967 2254 4.16666666666667e+00 +1967 2445 4.16666666666667e+00 +1967 2253 -8.33333333333333e+00 +1967 2447 -6.25000000000000e+00 +1967 2076 2.08333333333333e+00 +1967 2456 -6.25000000000000e+00 +1967 2455 4.16666666666667e+00 +1967 1966 -8.33333333333333e+00 +1967 2454 -2.08333333333333e+00 +1967 2127 2.08333333333333e+00 +1967 2220 -4.16666666666667e+00 +1967 2440 4.16666666666667e+00 +1967 2235 4.16666666666667e+00 +1967 2439 -2.08333333333333e+00 +1967 2236 -8.33333333333333e+00 +1967 2269 8.33333333333333e+00 +1967 2441 -6.25000000000000e+00 +1967 2077 2.08333333333333e+00 +1967 2221 -4.16666666666667e+00 +1967 2446 -2.08333333333333e+00 +1967 2453 -6.25000000000000e+00 +1967 2270 -3.75000000000000e+01 +1967 2452 -2.08333333333333e+00 +1967 2128 2.08333333333333e+00 +1967 1965 -8.33333333333333e+00 +1967 2451 4.16666666666667e+00 +1967 2268 8.33333333333333e+00 +1968 1968 2.50000000000000e+01 +1968 2341 2.08333333333333e+00 +1968 2462 2.08333333333333e+00 +1968 2459 -2.08333333333333e+00 +1968 2090 2.08333333333333e+00 +1968 2342 -4.16666666666667e+00 +1968 2089 2.08333333333333e+00 +1968 1969 -4.16666666666667e+00 +1968 2458 4.16666666666667e+00 +1968 2088 -6.25000000000000e+00 +1968 2457 -6.25000000000000e+00 +1968 1970 -4.16666666666667e+00 +1968 2102 2.08333333333333e+00 +1968 2360 4.16666666666667e+00 +1968 2101 2.08333333333333e+00 +1968 2461 -4.16666666666667e+00 +1968 2359 -2.08333333333333e+00 +1968 2100 -6.25000000000000e+00 +1968 2358 -6.25000000000000e+00 +1969 1969 2.91666666666667e+01 +1969 2340 2.08333333333333e+00 +1969 2360 4.16666666666667e+00 +1969 1970 -8.33333333333333e+00 +1969 2459 4.16666666666667e+00 +1969 2090 -2.08333333333333e+00 +1969 2342 2.08333333333333e+00 +1969 2089 -2.08333333333333e+00 +1969 2458 -1.87500000000000e+01 +1969 2088 2.08333333333333e+00 +1969 1968 -4.16666666666667e+00 +1969 2457 4.16666666666667e+00 +1969 2102 -2.08333333333333e+00 +1969 2462 2.08333333333333e+00 +1969 2358 -2.08333333333333e+00 +1969 2101 -2.08333333333333e+00 +1969 2359 -6.25000000000000e+00 +1969 2100 2.08333333333333e+00 +1969 2460 -4.16666666666667e+00 +1970 1970 2.91666666666667e+01 +1970 1969 -8.33333333333333e+00 +1970 2458 4.16666666666667e+00 +1970 2460 2.08333333333333e+00 +1970 2457 -2.08333333333333e+00 +1970 2090 -2.08333333333333e+00 +1970 2459 -6.25000000000000e+00 +1970 2089 -2.08333333333333e+00 +1970 2341 2.08333333333333e+00 +1970 2088 2.08333333333333e+00 +1970 2340 -4.16666666666667e+00 +1970 2359 4.16666666666667e+00 +1970 2102 -2.08333333333333e+00 +1970 2360 -1.87500000000000e+01 +1970 2101 -2.08333333333333e+00 +1970 2461 2.08333333333333e+00 +1970 1968 -4.16666666666667e+00 +1970 2100 2.08333333333333e+00 +1970 2358 4.16666666666667e+00 +1971 1971 6.25000000000000e+01 +1971 2465 4.16666666666667e+00 +1971 2132 -2.08333333333333e+00 +1971 2468 2.08333333333333e+00 +1971 2467 -4.16666666666667e+00 +1971 2093 -2.08333333333333e+00 +1971 2464 4.16666666666667e+00 +1971 2463 -1.87500000000000e+01 +1971 2345 4.16666666666667e+00 +1971 2344 4.16666666666667e+00 +1971 2378 8.33333333333333e+00 +1971 2377 -4.16666666666667e+00 +1971 2376 -1.25000000000000e+01 +1971 2240 -4.16666666666667e+00 +1971 2444 2.08333333333333e+00 +1971 2239 -4.16666666666667e+00 +1971 2272 4.16666666666667e+00 +1971 2443 -4.16666666666667e+00 +1971 2092 4.16666666666667e+00 +1971 2091 -6.25000000000000e+00 +1971 2453 4.16666666666667e+00 +1971 2273 -8.33333333333333e+00 +1971 2452 4.16666666666667e+00 +1971 1972 -8.33333333333333e+00 +1971 2131 4.16666666666667e+00 +1971 2451 -1.87500000000000e+01 +1971 1973 -8.33333333333333e+00 +1971 2130 -6.25000000000000e+00 +1972 1972 6.25000000000000e+01 +1972 2465 -2.08333333333333e+00 +1972 2466 -4.16666666666667e+00 +1972 2464 -6.25000000000000e+00 +1972 2463 4.16666666666667e+00 +1972 2345 -8.33333333333333e+00 +1972 2093 4.16666666666667e+00 +1972 2343 4.16666666666667e+00 +1972 2378 8.33333333333333e+00 +1972 1973 -8.33333333333333e+00 +1972 2132 4.16666666666667e+00 +1972 2377 -1.25000000000000e+01 +1972 2376 -4.16666666666667e+00 +1972 2238 -4.16666666666667e+00 +1972 2271 4.16666666666667e+00 +1972 2444 2.08333333333333e+00 +1972 2240 -4.16666666666667e+00 +1972 2092 -1.87500000000000e+01 +1972 2442 -4.16666666666667e+00 +1972 2091 4.16666666666667e+00 +1972 2453 -2.08333333333333e+00 +1972 2273 4.16666666666667e+00 +1972 2452 -6.25000000000000e+00 +1972 2468 2.08333333333333e+00 +1972 2131 -1.87500000000000e+01 +1972 2451 4.16666666666667e+00 +1972 1971 -8.33333333333333e+00 +1972 2130 4.16666666666667e+00 +1973 1973 6.25000000000000e+01 +1973 2464 -2.08333333333333e+00 +1973 1971 -8.33333333333333e+00 +1973 2463 4.16666666666667e+00 +1973 2130 -2.08333333333333e+00 +1973 2466 2.08333333333333e+00 +1973 2465 -6.25000000000000e+00 +1973 2091 -2.08333333333333e+00 +1973 2343 4.16666666666667e+00 +1973 2344 -8.33333333333333e+00 +1973 2092 4.16666666666667e+00 +1973 2378 -3.75000000000000e+01 +1973 2377 8.33333333333333e+00 +1973 1972 -8.33333333333333e+00 +1973 2131 4.16666666666667e+00 +1973 2376 8.33333333333333e+00 +1973 2238 -4.16666666666667e+00 +1973 2442 2.08333333333333e+00 +1973 2093 -6.25000000000000e+00 +1973 2443 2.08333333333333e+00 +1973 2239 -4.16666666666667e+00 +1973 2453 -6.25000000000000e+00 +1973 2467 2.08333333333333e+00 +1973 2132 -6.25000000000000e+00 +1973 2452 -2.08333333333333e+00 +1973 2272 4.16666666666667e+00 +1973 2451 4.16666666666667e+00 +1973 2271 -8.33333333333333e+00 +1974 1974 6.25000000000000e+01 +1974 2381 -8.33333333333333e+00 +1974 2380 4.16666666666667e+00 +1974 2096 2.08333333333333e+00 +1974 2464 4.16666666666667e+00 +1974 2463 -1.87500000000000e+01 +1974 2474 -2.08333333333333e+00 +1974 2147 2.08333333333333e+00 +1974 2473 4.16666666666667e+00 +1974 2472 -6.25000000000000e+00 +1974 2348 -4.16666666666667e+00 +1974 2347 -4.16666666666667e+00 +1974 2363 4.16666666666667e+00 +1974 2459 -2.08333333333333e+00 +1974 1975 -8.33333333333333e+00 +1974 2362 4.16666666666667e+00 +1974 2395 -4.16666666666667e+00 +1974 2095 -4.16666666666667e+00 +1974 2458 4.16666666666667e+00 +1974 2457 -6.25000000000000e+00 +1974 1976 -8.33333333333333e+00 +1974 2471 4.16666666666667e+00 +1974 2396 8.33333333333333e+00 +1974 2470 4.16666666666667e+00 +1974 2146 -4.16666666666667e+00 +1974 2465 4.16666666666667e+00 +1974 2469 -1.87500000000000e+01 +1974 2394 -1.25000000000000e+01 +1975 1975 6.25000000000000e+01 +1975 2381 4.16666666666667e+00 +1975 2379 4.16666666666667e+00 +1975 2464 -6.25000000000000e+00 +1975 2463 4.16666666666667e+00 +1975 2474 4.16666666666667e+00 +1975 1976 -8.33333333333333e+00 +1975 2473 -1.87500000000000e+01 +1975 2472 4.16666666666667e+00 +1975 2346 -4.16666666666667e+00 +1975 2459 4.16666666666667e+00 +1975 1974 -8.33333333333333e+00 +1975 2363 -8.33333333333333e+00 +1975 2396 8.33333333333333e+00 +1975 2361 4.16666666666667e+00 +1975 2394 -4.16666666666667e+00 +1975 2096 2.08333333333333e+00 +1975 2348 -4.16666666666667e+00 +1975 2458 -1.87500000000000e+01 +1975 2094 -4.16666666666667e+00 +1975 2457 4.16666666666667e+00 +1975 2471 -2.08333333333333e+00 +1975 2147 2.08333333333333e+00 +1975 2465 -2.08333333333333e+00 +1975 2470 -6.25000000000000e+00 +1975 2395 -1.25000000000000e+01 +1975 2469 4.16666666666667e+00 +1975 2145 -4.16666666666667e+00 +1976 1976 6.25000000000000e+01 +1976 2380 4.16666666666667e+00 +1976 2463 4.16666666666667e+00 +1976 2379 -8.33333333333333e+00 +1976 2465 -6.25000000000000e+00 +1976 2094 2.08333333333333e+00 +1976 2474 -6.25000000000000e+00 +1976 2473 4.16666666666667e+00 +1976 1975 -8.33333333333333e+00 +1976 2472 -2.08333333333333e+00 +1976 2145 2.08333333333333e+00 +1976 2346 -4.16666666666667e+00 +1976 2458 4.16666666666667e+00 +1976 2361 4.16666666666667e+00 +1976 2457 -2.08333333333333e+00 +1976 2362 -8.33333333333333e+00 +1976 2395 8.33333333333333e+00 +1976 2459 -6.25000000000000e+00 +1976 2095 2.08333333333333e+00 +1976 2347 -4.16666666666667e+00 +1976 2464 -2.08333333333333e+00 +1976 2471 -6.25000000000000e+00 +1976 2396 -3.75000000000000e+01 +1976 2470 -2.08333333333333e+00 +1976 2146 2.08333333333333e+00 +1976 1974 -8.33333333333333e+00 +1976 2469 4.16666666666667e+00 +1976 2394 8.33333333333333e+00 +1977 1977 3.75000000000000e+01 +1977 2414 -4.16666666666667e+00 +1977 2413 2.08333333333333e+00 +1977 1979 -4.16666666666667e+00 +1977 2420 4.16666666666667e+00 +1977 2135 2.08333333333333e+00 +1977 2419 -2.08333333333333e+00 +1977 2418 -6.25000000000000e+00 +1977 2257 -4.16666666666667e+00 +1977 2275 4.16666666666667e+00 +1977 2450 2.08333333333333e+00 +1977 2258 -4.16666666666667e+00 +1977 2113 2.08333333333333e+00 +1977 2449 -4.16666666666667e+00 +1977 2112 -1.25000000000000e+01 +1977 2456 -2.08333333333333e+00 +1977 2276 4.16666666666667e+00 +1977 1978 -4.16666666666667e+00 +1977 2455 4.16666666666667e+00 +1977 2134 2.08333333333333e+00 +1977 2114 2.08333333333333e+00 +1977 2454 -6.25000000000000e+00 +1977 2133 -1.25000000000000e+01 +1978 1978 3.33333333333333e+01 +1978 2412 2.08333333333333e+00 +1978 2420 4.16666666666667e+00 +1978 2419 -6.25000000000000e+00 +1978 2418 -2.08333333333333e+00 +1978 2450 2.08333333333333e+00 +1978 2258 -4.16666666666667e+00 +1978 2256 -4.16666666666667e+00 +1978 2274 4.16666666666667e+00 +1978 2113 -4.16666666666667e+00 +1978 2112 2.08333333333333e+00 +1978 2448 -4.16666666666667e+00 +1978 2456 4.16666666666667e+00 +1978 2276 -8.33333333333333e+00 +1978 2414 2.08333333333333e+00 +1978 2455 -1.87500000000000e+01 +1978 2134 -4.16666666666667e+00 +1978 1977 -4.16666666666667e+00 +1978 2454 4.16666666666667e+00 +1978 2133 2.08333333333333e+00 +1979 1979 3.33333333333333e+01 +1979 2112 2.08333333333333e+00 +1979 2412 -4.16666666666667e+00 +1979 2420 -1.87500000000000e+01 +1979 2419 4.16666666666667e+00 +1979 1977 -4.16666666666667e+00 +1979 2418 4.16666666666667e+00 +1979 2133 2.08333333333333e+00 +1979 2449 2.08333333333333e+00 +1979 2257 -4.16666666666667e+00 +1979 2114 -4.16666666666667e+00 +1979 2448 2.08333333333333e+00 +1979 2256 -4.16666666666667e+00 +1979 2413 2.08333333333333e+00 +1979 2456 -6.25000000000000e+00 +1979 2135 -4.16666666666667e+00 +1979 2455 4.16666666666667e+00 +1979 2275 -8.33333333333333e+00 +1979 2454 -2.08333333333333e+00 +1979 2274 4.16666666666667e+00 +1980 1980 3.75000000000000e+01 +1980 2432 -4.16666666666667e+00 +1980 2431 2.08333333333333e+00 +1980 1982 -4.16666666666667e+00 +1980 2438 4.16666666666667e+00 +1980 2150 2.08333333333333e+00 +1980 2437 -2.08333333333333e+00 +1980 2436 -6.25000000000000e+00 +1980 2383 -4.16666666666667e+00 +1980 2401 4.16666666666667e+00 +1980 2468 2.08333333333333e+00 +1980 2384 -4.16666666666667e+00 +1980 2137 2.08333333333333e+00 +1980 2467 -4.16666666666667e+00 +1980 2136 -1.25000000000000e+01 +1980 2474 -2.08333333333333e+00 +1980 2402 4.16666666666667e+00 +1980 1981 -4.16666666666667e+00 +1980 2473 4.16666666666667e+00 +1980 2149 2.08333333333333e+00 +1980 2138 2.08333333333333e+00 +1980 2472 -6.25000000000000e+00 +1980 2148 -1.25000000000000e+01 +1981 1981 3.33333333333333e+01 +1981 2430 2.08333333333333e+00 +1981 2438 4.16666666666667e+00 +1981 2437 -6.25000000000000e+00 +1981 2436 -2.08333333333333e+00 +1981 2468 2.08333333333333e+00 +1981 2384 -4.16666666666667e+00 +1981 2382 -4.16666666666667e+00 +1981 2400 4.16666666666667e+00 +1981 2137 -4.16666666666667e+00 +1981 2136 2.08333333333333e+00 +1981 2466 -4.16666666666667e+00 +1981 2474 4.16666666666667e+00 +1981 2402 -8.33333333333333e+00 +1981 2432 2.08333333333333e+00 +1981 2473 -1.87500000000000e+01 +1981 2149 -4.16666666666667e+00 +1981 1980 -4.16666666666667e+00 +1981 2472 4.16666666666667e+00 +1981 2148 2.08333333333333e+00 +1982 1982 3.33333333333333e+01 +1982 2136 2.08333333333333e+00 +1982 2430 -4.16666666666667e+00 +1982 2438 -1.87500000000000e+01 +1982 2437 4.16666666666667e+00 +1982 1980 -4.16666666666667e+00 +1982 2436 4.16666666666667e+00 +1982 2148 2.08333333333333e+00 +1982 2467 2.08333333333333e+00 +1982 2383 -4.16666666666667e+00 +1982 2138 -4.16666666666667e+00 +1982 2466 2.08333333333333e+00 +1982 2382 -4.16666666666667e+00 +1982 2431 2.08333333333333e+00 +1982 2474 -6.25000000000000e+00 +1982 2150 -4.16666666666667e+00 +1982 2473 4.16666666666667e+00 +1982 2401 -8.33333333333333e+00 +1982 2472 -2.08333333333333e+00 +1982 2400 4.16666666666667e+00 +1983 1983 3.75000000000000e+01 +1983 1900 2.08333333333333e+00 +1983 2152 -4.16666666666667e+00 +1983 1991 -2.08333333333333e+00 +1983 1984 -4.16666666666667e+00 +1983 1990 4.16666666666667e+00 +1983 1876 0.00000000000000e+00 +1983 1989 -6.25000000000000e+00 +1983 2159 -4.16666666666667e+00 +1983 2003 4.16666666666667e+00 +1983 1901 2.08333333333333e+00 +1983 2156 -4.16666666666667e+00 +1983 2155 2.08333333333333e+00 +1983 2158 -4.16666666666667e+00 +1983 1899 -1.25000000000000e+01 +1983 1985 -4.16666666666667e+00 +1983 1997 4.16666666666667e+00 +1983 1877 0.00000000000000e+00 +1983 1996 -2.08333333333333e+00 +1983 2002 4.16666666666667e+00 +1983 2153 2.08333333333333e+00 +1983 1995 -6.25000000000000e+00 +1983 1875 0.00000000000000e+00 +1984 1984 3.33333333333333e+01 +1984 1899 2.08333333333333e+00 +1984 2151 -4.16666666666667e+00 +1984 1991 4.16666666666667e+00 +1984 1990 -1.87500000000000e+01 +1984 1983 -4.16666666666667e+00 +1984 1989 4.16666666666667e+00 +1984 1875 0.00000000000000e+00 +1984 2156 2.08333333333333e+00 +1984 2159 -4.16666666666667e+00 +1984 1900 -4.16666666666667e+00 +1984 2154 2.08333333333333e+00 +1984 2157 -4.16666666666667e+00 +1984 1997 4.16666666666667e+00 +1984 2003 -8.33333333333333e+00 +1984 2153 2.08333333333333e+00 +1984 1996 -6.25000000000000e+00 +1984 1876 0.00000000000000e+00 +1984 1995 -2.08333333333333e+00 +1984 2001 4.16666666666667e+00 +1985 1985 3.33333333333333e+01 +1985 2151 2.08333333333333e+00 +1985 1991 -6.25000000000000e+00 +1985 1990 4.16666666666667e+00 +1985 1989 -2.08333333333333e+00 +1985 2155 2.08333333333333e+00 +1985 2158 -4.16666666666667e+00 +1985 2157 -4.16666666666667e+00 +1985 2001 4.16666666666667e+00 +1985 1901 -4.16666666666667e+00 +1985 1899 2.08333333333333e+00 +1985 2154 -4.16666666666667e+00 +1985 2152 2.08333333333333e+00 +1985 1997 -1.87500000000000e+01 +1985 1877 0.00000000000000e+00 +1985 1996 4.16666666666667e+00 +1985 2002 -8.33333333333333e+00 +1985 1983 -4.16666666666667e+00 +1985 1995 4.16666666666667e+00 +1985 1875 0.00000000000000e+00 +1986 1986 1.00000000000000e+00 +1986 2170 0.00000000000000e+00 +1986 1903 0.00000000000000e+00 +1986 1991 0.00000000000000e+00 +1986 1990 0.00000000000000e+00 +1986 1987 0.00000000000000e+00 +1986 1876 0.00000000000000e+00 +1986 1989 0.00000000000000e+00 +1986 2177 0.00000000000000e+00 +1986 2174 0.00000000000000e+00 +1986 2173 0.00000000000000e+00 +1986 2176 0.00000000000000e+00 +1986 1902 0.00000000000000e+00 +1986 2000 0.00000000000000e+00 +1986 2003 0.00000000000000e+00 +1986 1999 0.00000000000000e+00 +1986 2002 0.00000000000000e+00 +1986 1998 0.00000000000000e+00 +1986 2171 0.00000000000000e+00 +1986 1875 0.00000000000000e+00 +1987 1987 1.00000000000000e+00 +1987 2169 0.00000000000000e+00 +1987 1902 0.00000000000000e+00 +1987 1991 0.00000000000000e+00 +1987 1990 0.00000000000000e+00 +1987 1989 0.00000000000000e+00 +1987 1986 0.00000000000000e+00 +1987 1875 0.00000000000000e+00 +1987 2177 0.00000000000000e+00 +1987 2003 0.00000000000000e+00 +1987 2174 0.00000000000000e+00 +1987 1904 0.00000000000000e+00 +1987 1903 0.00000000000000e+00 +1987 2172 0.00000000000000e+00 +1987 2175 0.00000000000000e+00 +1987 2000 0.00000000000000e+00 +1987 1988 0.00000000000000e+00 +1987 1877 0.00000000000000e+00 +1987 1999 0.00000000000000e+00 +1987 2171 0.00000000000000e+00 +1987 1876 0.00000000000000e+00 +1987 1998 0.00000000000000e+00 +1987 2001 0.00000000000000e+00 +1988 1988 1.00000000000000e+00 +1988 2170 0.00000000000000e+00 +1988 1991 0.00000000000000e+00 +1988 1990 0.00000000000000e+00 +1988 1989 0.00000000000000e+00 +1988 2175 0.00000000000000e+00 +1988 2172 0.00000000000000e+00 +1988 2176 0.00000000000000e+00 +1988 2002 0.00000000000000e+00 +1988 1904 0.00000000000000e+00 +1988 2173 0.00000000000000e+00 +1988 1903 0.00000000000000e+00 +1988 2000 0.00000000000000e+00 +1988 2169 0.00000000000000e+00 +1988 1877 0.00000000000000e+00 +1988 1999 0.00000000000000e+00 +1988 1987 0.00000000000000e+00 +1988 1876 0.00000000000000e+00 +1988 1998 0.00000000000000e+00 +1988 2001 0.00000000000000e+00 +1989 1989 6.25000000000000e+01 +1989 2176 4.16666666666667e+00 +1989 2177 4.16666666666667e+00 +1989 2170 4.16666666666667e+00 +1989 2169 -6.25000000000000e+00 +1989 1991 -8.33333333333333e+00 +1989 1988 0.00000000000000e+00 +1989 1987 0.00000000000000e+00 +1989 1986 0.00000000000000e+00 +1989 2002 -4.16666666666667e+00 +1989 1990 -8.33333333333333e+00 +1989 2153 4.16666666666667e+00 +1989 2188 -4.16666666666667e+00 +1989 2158 4.16666666666667e+00 +1989 2003 8.33333333333333e+00 +1989 2159 -8.33333333333333e+00 +1989 1907 2.08333333333333e+00 +1989 2189 -4.16666666666667e+00 +1989 2152 4.16666666666667e+00 +1989 1906 -4.16666666666667e+00 +1989 2151 -1.87500000000000e+01 +1989 1985 -2.08333333333333e+00 +1989 1877 0.00000000000000e+00 +1989 1984 4.16666666666667e+00 +1989 1876 0.00000000000000e+00 +1989 1983 -6.25000000000000e+00 +1989 2171 -2.08333333333333e+00 +1989 2001 -1.25000000000000e+01 +1990 1990 6.25000000000000e+01 +1990 2175 4.16666666666667e+00 +1990 2177 -8.33333333333333e+00 +1990 1907 2.08333333333333e+00 +1990 2170 -1.87500000000000e+01 +1990 2169 4.16666666666667e+00 +1990 1988 0.00000000000000e+00 +1990 1877 0.00000000000000e+00 +1990 1987 0.00000000000000e+00 +1990 1986 0.00000000000000e+00 +1990 2001 -4.16666666666667e+00 +1990 2153 -2.08333333333333e+00 +1990 1989 -8.33333333333333e+00 +1990 2187 -4.16666666666667e+00 +1990 2157 4.16666666666667e+00 +1990 2189 -4.16666666666667e+00 +1990 2159 4.16666666666667e+00 +1990 2152 -6.25000000000000e+00 +1990 2151 4.16666666666667e+00 +1990 1905 -4.16666666666667e+00 +1990 1985 4.16666666666667e+00 +1990 1991 -8.33333333333333e+00 +1990 2003 8.33333333333333e+00 +1990 1984 -1.87500000000000e+01 +1990 2171 4.16666666666667e+00 +1990 2002 -1.25000000000000e+01 +1990 1983 4.16666666666667e+00 +1990 1875 0.00000000000000e+00 +1991 1991 6.25000000000000e+01 +1991 2170 4.16666666666667e+00 +1991 2176 -8.33333333333333e+00 +1991 2175 4.16666666666667e+00 +1991 2171 -6.25000000000000e+00 +1991 1906 2.08333333333333e+00 +1991 1988 0.00000000000000e+00 +1991 1987 0.00000000000000e+00 +1991 1876 0.00000000000000e+00 +1991 1989 -8.33333333333333e+00 +1991 1986 0.00000000000000e+00 +1991 2152 -2.08333333333333e+00 +1991 2151 4.16666666666667e+00 +1991 2188 -4.16666666666667e+00 +1991 2158 4.16666666666667e+00 +1991 2001 8.33333333333333e+00 +1991 2157 -8.33333333333333e+00 +1991 2153 -6.25000000000000e+00 +1991 1905 2.08333333333333e+00 +1991 2187 -4.16666666666667e+00 +1991 1985 -6.25000000000000e+00 +1991 2169 -2.08333333333333e+00 +1991 2003 -3.75000000000000e+01 +1991 1984 4.16666666666667e+00 +1991 1990 -8.33333333333333e+00 +1991 2002 8.33333333333333e+00 +1991 1983 -2.08333333333333e+00 +1991 1875 0.00000000000000e+00 +1992 1992 1.00000000000000e+00 +1992 2210 0.00000000000000e+00 +1992 2000 0.00000000000000e+00 +1992 1999 0.00000000000000e+00 +1992 1998 0.00000000000000e+00 +1992 2003 0.00000000000000e+00 +1992 2213 0.00000000000000e+00 +1992 2206 0.00000000000000e+00 +1992 2212 0.00000000000000e+00 +1992 1910 0.00000000000000e+00 +1992 2207 0.00000000000000e+00 +1992 1908 0.00000000000000e+00 +1992 1994 0.00000000000000e+00 +1992 1997 0.00000000000000e+00 +1992 1877 0.00000000000000e+00 +1992 1996 0.00000000000000e+00 +1992 2002 0.00000000000000e+00 +1992 2209 0.00000000000000e+00 +1992 1995 0.00000000000000e+00 +1992 1875 0.00000000000000e+00 +1993 1993 1.00000000000000e+00 +1993 2210 0.00000000000000e+00 +1993 1910 0.00000000000000e+00 +1993 2000 0.00000000000000e+00 +1993 1994 0.00000000000000e+00 +1993 1877 0.00000000000000e+00 +1993 1999 0.00000000000000e+00 +1993 1998 0.00000000000000e+00 +1993 2205 0.00000000000000e+00 +1993 2211 0.00000000000000e+00 +1993 2207 0.00000000000000e+00 +1993 2213 0.00000000000000e+00 +1993 1909 0.00000000000000e+00 +1993 1997 0.00000000000000e+00 +1993 2003 0.00000000000000e+00 +1993 2208 0.00000000000000e+00 +1993 1996 0.00000000000000e+00 +1993 1876 0.00000000000000e+00 +1993 1995 0.00000000000000e+00 +1993 2001 0.00000000000000e+00 +1994 1994 1.00000000000000e+00 +1994 1909 0.00000000000000e+00 +1994 2208 0.00000000000000e+00 +1994 2000 0.00000000000000e+00 +1994 1999 0.00000000000000e+00 +1994 1993 0.00000000000000e+00 +1994 1876 0.00000000000000e+00 +1994 1998 0.00000000000000e+00 +1994 2001 0.00000000000000e+00 +1994 2211 0.00000000000000e+00 +1994 1910 0.00000000000000e+00 +1994 2206 0.00000000000000e+00 +1994 2212 0.00000000000000e+00 +1994 1908 0.00000000000000e+00 +1994 2205 0.00000000000000e+00 +1994 2209 0.00000000000000e+00 +1994 1997 0.00000000000000e+00 +1994 1877 0.00000000000000e+00 +1994 1996 0.00000000000000e+00 +1994 2002 0.00000000000000e+00 +1994 1992 0.00000000000000e+00 +1994 1995 0.00000000000000e+00 +1994 1875 0.00000000000000e+00 +1995 1995 6.25000000000000e+01 +1995 2159 4.16666666666667e+00 +1995 2158 -8.33333333333333e+00 +1995 2156 4.16666666666667e+00 +1995 1912 2.08333333333333e+00 +1995 2154 -1.87500000000000e+01 +1995 1985 4.16666666666667e+00 +1995 1984 -2.08333333333333e+00 +1995 1876 0.00000000000000e+00 +1995 1983 -6.25000000000000e+00 +1995 2003 -4.16666666666667e+00 +1995 1997 -8.33333333333333e+00 +1995 2206 -2.08333333333333e+00 +1995 2225 -4.16666666666667e+00 +1995 2213 4.16666666666667e+00 +1995 2224 -4.16666666666667e+00 +1995 2212 4.16666666666667e+00 +1995 2207 4.16666666666667e+00 +1995 1913 -4.16666666666667e+00 +1995 2205 -6.25000000000000e+00 +1995 1994 0.00000000000000e+00 +1995 1877 0.00000000000000e+00 +1995 1993 0.00000000000000e+00 +1995 1996 -8.33333333333333e+00 +1995 2002 8.33333333333333e+00 +1995 1992 0.00000000000000e+00 +1995 2155 4.16666666666667e+00 +1995 2001 -1.25000000000000e+01 +1996 1996 6.25000000000000e+01 +1996 2159 4.16666666666667e+00 +1996 2154 4.16666666666667e+00 +1996 2157 -8.33333333333333e+00 +1996 2155 -6.25000000000000e+00 +1996 1911 2.08333333333333e+00 +1996 1985 4.16666666666667e+00 +1996 1997 -8.33333333333333e+00 +1996 1984 -6.25000000000000e+00 +1996 1983 -2.08333333333333e+00 +1996 1875 0.00000000000000e+00 +1996 2205 -2.08333333333333e+00 +1996 2207 4.16666666666667e+00 +1996 2003 8.33333333333333e+00 +1996 2213 -8.33333333333333e+00 +1996 2223 -4.16666666666667e+00 +1996 2211 4.16666666666667e+00 +1996 1913 2.08333333333333e+00 +1996 2225 -4.16666666666667e+00 +1996 2206 -6.25000000000000e+00 +1996 1994 0.00000000000000e+00 +1996 1877 0.00000000000000e+00 +1996 1993 0.00000000000000e+00 +1996 2156 -2.08333333333333e+00 +1996 2002 -3.75000000000000e+01 +1996 1992 0.00000000000000e+00 +1996 1995 -8.33333333333333e+00 +1996 2001 8.33333333333333e+00 +1997 1997 6.25000000000000e+01 +1997 2158 4.16666666666667e+00 +1997 2157 4.16666666666667e+00 +1997 2156 -6.25000000000000e+00 +1997 2154 4.16666666666667e+00 +1997 1985 -1.87500000000000e+01 +1997 1984 4.16666666666667e+00 +1997 1996 -8.33333333333333e+00 +1997 1983 4.16666666666667e+00 +1997 2001 -4.16666666666667e+00 +1997 1995 -8.33333333333333e+00 +1997 2206 4.16666666666667e+00 +1997 2223 -4.16666666666667e+00 +1997 2211 4.16666666666667e+00 +1997 2002 8.33333333333333e+00 +1997 2212 -8.33333333333333e+00 +1997 2207 -1.87500000000000e+01 +1997 1912 2.08333333333333e+00 +1997 2224 -4.16666666666667e+00 +1997 2205 4.16666666666667e+00 +1997 1911 -4.16666666666667e+00 +1997 1994 0.00000000000000e+00 +1997 2155 -2.08333333333333e+00 +1997 2003 -1.25000000000000e+01 +1997 1993 0.00000000000000e+00 +1997 1876 0.00000000000000e+00 +1997 1992 0.00000000000000e+00 +1997 1875 0.00000000000000e+00 +1998 1998 1.00000000000000e+00 +1998 2174 0.00000000000000e+00 +1998 2173 0.00000000000000e+00 +1998 2176 0.00000000000000e+00 +1998 1915 0.00000000000000e+00 +1998 2172 0.00000000000000e+00 +1998 2000 0.00000000000000e+00 +1998 1988 0.00000000000000e+00 +1998 1987 0.00000000000000e+00 +1998 1876 0.00000000000000e+00 +1998 1986 0.00000000000000e+00 +1998 2209 0.00000000000000e+00 +1998 2210 0.00000000000000e+00 +1998 2003 0.00000000000000e+00 +1998 2213 0.00000000000000e+00 +1998 2242 0.00000000000000e+00 +1998 2212 0.00000000000000e+00 +1998 1916 0.00000000000000e+00 +1998 2243 0.00000000000000e+00 +1998 2208 0.00000000000000e+00 +1998 1994 0.00000000000000e+00 +1998 1877 0.00000000000000e+00 +1998 1999 0.00000000000000e+00 +1998 1993 0.00000000000000e+00 +1998 2002 0.00000000000000e+00 +1998 2177 0.00000000000000e+00 +1998 1992 0.00000000000000e+00 +1998 2001 0.00000000000000e+00 +1999 1999 1.00000000000000e+00 +1999 2177 0.00000000000000e+00 +1999 2175 0.00000000000000e+00 +1999 2174 0.00000000000000e+00 +1999 2173 0.00000000000000e+00 +1999 1914 0.00000000000000e+00 +1999 1988 0.00000000000000e+00 +1999 1987 0.00000000000000e+00 +1999 1986 0.00000000000000e+00 +1999 1875 0.00000000000000e+00 +1999 2003 0.00000000000000e+00 +1999 2000 0.00000000000000e+00 +1999 2208 0.00000000000000e+00 +1999 2243 0.00000000000000e+00 +1999 2213 0.00000000000000e+00 +1999 2241 0.00000000000000e+00 +1999 2211 0.00000000000000e+00 +1999 1916 0.00000000000000e+00 +1999 2210 0.00000000000000e+00 +1999 2209 0.00000000000000e+00 +1999 1994 0.00000000000000e+00 +1999 1877 0.00000000000000e+00 +1999 2172 0.00000000000000e+00 +1999 1993 0.00000000000000e+00 +1999 2002 0.00000000000000e+00 +1999 1998 0.00000000000000e+00 +1999 1992 0.00000000000000e+00 +1999 2001 0.00000000000000e+00 +2000 2000 1.00000000000000e+00 +2000 2172 0.00000000000000e+00 +2000 2176 0.00000000000000e+00 +2000 2174 0.00000000000000e+00 +2000 2173 0.00000000000000e+00 +2000 1988 0.00000000000000e+00 +2000 1987 0.00000000000000e+00 +2000 1998 0.00000000000000e+00 +2000 1986 0.00000000000000e+00 +2000 2002 0.00000000000000e+00 +2000 1999 0.00000000000000e+00 +2000 2242 0.00000000000000e+00 +2000 2212 0.00000000000000e+00 +2000 2208 0.00000000000000e+00 +2000 2001 0.00000000000000e+00 +2000 2211 0.00000000000000e+00 +2000 2210 0.00000000000000e+00 +2000 1915 0.00000000000000e+00 +2000 2209 0.00000000000000e+00 +2000 1914 0.00000000000000e+00 +2000 2241 0.00000000000000e+00 +2000 2175 0.00000000000000e+00 +2000 1994 0.00000000000000e+00 +2000 2003 0.00000000000000e+00 +2000 1993 0.00000000000000e+00 +2000 1876 0.00000000000000e+00 +2000 1992 0.00000000000000e+00 +2000 1875 0.00000000000000e+00 +2001 2001 1.25000000000000e+02 +2001 2176 8.33333333333333e+00 +2001 2175 -1.25000000000000e+01 +2001 1988 0.00000000000000e+00 +2001 1987 0.00000000000000e+00 +2001 2000 0.00000000000000e+00 +2001 2242 4.16666666666667e+00 +2001 1999 0.00000000000000e+00 +2001 1998 0.00000000000000e+00 +2001 2243 4.16666666666667e+00 +2001 1990 -4.16666666666667e+00 +2001 1991 8.33333333333333e+00 +2001 2003 -1.66666666666667e+01 +2001 1877 0.00000000000000e+00 +2001 1989 -1.25000000000000e+01 +2001 2189 4.16666666666667e+00 +2001 1919 -4.16666666666667e+00 +2001 2188 -8.33333333333333e+00 +2001 1985 4.16666666666667e+00 +2001 2158 8.33333333333333e+00 +2001 2002 -1.66666666666667e+01 +2001 2159 8.33333333333333e+00 +2001 1918 -4.16666666666667e+00 +2001 2157 -3.75000000000000e+01 +2001 1984 4.16666666666667e+00 +2001 1876 0.00000000000000e+00 +2001 1997 -4.16666666666667e+00 +2001 1994 0.00000000000000e+00 +2001 2224 4.16666666666667e+00 +2001 2212 -4.16666666666667e+00 +2001 1993 0.00000000000000e+00 +2001 1996 8.33333333333333e+00 +2001 1995 -1.25000000000000e+01 +2001 2213 8.33333333333333e+00 +2001 2225 -8.33333333333333e+00 +2001 2211 -1.25000000000000e+01 +2001 2177 -4.16666666666667e+00 +2002 2002 1.25000000000000e+02 +2002 2175 8.33333333333333e+00 +2002 2177 8.33333333333333e+00 +2002 2176 -3.75000000000000e+01 +2002 1986 0.00000000000000e+00 +2002 2000 0.00000000000000e+00 +2002 2241 4.16666666666667e+00 +2002 1999 0.00000000000000e+00 +2002 1998 0.00000000000000e+00 +2002 2243 -8.33333333333333e+00 +2002 1989 -4.16666666666667e+00 +2002 2189 4.16666666666667e+00 +2002 1991 8.33333333333333e+00 +2002 1990 -1.25000000000000e+01 +2002 2187 -8.33333333333333e+00 +2002 2159 -4.16666666666667e+00 +2002 2157 8.33333333333333e+00 +2002 2001 -1.66666666666667e+01 +2002 2158 -1.25000000000000e+01 +2002 1917 -4.16666666666667e+00 +2002 1985 -8.33333333333333e+00 +2002 1983 4.16666666666667e+00 +2002 1875 0.00000000000000e+00 +2002 1997 8.33333333333333e+00 +2002 2003 -1.66666666666667e+01 +2002 2213 8.33333333333333e+00 +2002 2223 4.16666666666667e+00 +2002 2211 -4.16666666666667e+00 +2002 1994 0.00000000000000e+00 +2002 1877 0.00000000000000e+00 +2002 1996 -3.75000000000000e+01 +2002 1992 0.00000000000000e+00 +2002 1995 8.33333333333333e+00 +2002 2225 4.16666666666667e+00 +2002 1919 -4.16666666666667e+00 +2002 2212 -1.25000000000000e+01 +2002 1988 0.00000000000000e+00 +2003 2003 1.25000000000000e+02 +2003 1987 0.00000000000000e+00 +2003 2177 -1.25000000000000e+01 +2003 2176 8.33333333333333e+00 +2003 1986 0.00000000000000e+00 +2003 1999 0.00000000000000e+00 +2003 1998 0.00000000000000e+00 +2003 2000 0.00000000000000e+00 +2003 2242 -8.33333333333333e+00 +2003 2241 4.16666666666667e+00 +2003 2188 4.16666666666667e+00 +2003 1989 8.33333333333333e+00 +2003 2001 -1.66666666666667e+01 +2003 1991 -3.75000000000000e+01 +2003 1990 8.33333333333333e+00 +2003 1875 0.00000000000000e+00 +2003 2187 4.16666666666667e+00 +2003 1917 -4.16666666666667e+00 +2003 2158 -4.16666666666667e+00 +2003 1983 4.16666666666667e+00 +2003 2159 -1.25000000000000e+01 +2003 2157 8.33333333333333e+00 +2003 1984 -8.33333333333333e+00 +2003 1995 -4.16666666666667e+00 +2003 1992 0.00000000000000e+00 +2003 1996 8.33333333333333e+00 +2003 2002 -1.66666666666667e+01 +2003 2212 8.33333333333333e+00 +2003 1997 -1.25000000000000e+01 +2003 1993 0.00000000000000e+00 +2003 1876 0.00000000000000e+00 +2003 2213 -3.75000000000000e+01 +2003 2175 -4.16666666666667e+00 +2003 2224 4.16666666666667e+00 +2003 1918 -4.16666666666667e+00 +2003 2211 8.33333333333333e+00 +2003 2223 -8.33333333333333e+00 +2004 2004 3.75000000000000e+01 +2004 1879 2.08333333333333e+00 +2004 2011 -4.16666666666667e+00 +2004 2162 -2.08333333333333e+00 +2004 2005 -4.16666666666667e+00 +2004 2161 4.16666666666667e+00 +2004 1900 2.08333333333333e+00 +2004 2160 -6.25000000000000e+00 +2004 2024 -4.16666666666667e+00 +2004 2168 4.16666666666667e+00 +2004 1880 2.08333333333333e+00 +2004 2018 -4.16666666666667e+00 +2004 2017 2.08333333333333e+00 +2004 2023 -4.16666666666667e+00 +2004 1878 -1.25000000000000e+01 +2004 2006 -4.16666666666667e+00 +2004 2165 4.16666666666667e+00 +2004 1901 2.08333333333333e+00 +2004 2164 -2.08333333333333e+00 +2004 2167 4.16666666666667e+00 +2004 2012 2.08333333333333e+00 +2004 2163 -6.25000000000000e+00 +2004 1899 -1.25000000000000e+01 +2005 2005 3.33333333333333e+01 +2005 1878 2.08333333333333e+00 +2005 2010 -4.16666666666667e+00 +2005 2162 4.16666666666667e+00 +2005 2161 -1.87500000000000e+01 +2005 2004 -4.16666666666667e+00 +2005 2160 4.16666666666667e+00 +2005 1899 2.08333333333333e+00 +2005 2018 2.08333333333333e+00 +2005 2024 -4.16666666666667e+00 +2005 1879 -4.16666666666667e+00 +2005 2016 2.08333333333333e+00 +2005 2022 -4.16666666666667e+00 +2005 2165 4.16666666666667e+00 +2005 2168 -8.33333333333333e+00 +2005 2012 2.08333333333333e+00 +2005 2164 -6.25000000000000e+00 +2005 1900 -4.16666666666667e+00 +2005 2163 -2.08333333333333e+00 +2005 2166 4.16666666666667e+00 +2006 2006 3.33333333333333e+01 +2006 2010 2.08333333333333e+00 +2006 2162 -6.25000000000000e+00 +2006 2161 4.16666666666667e+00 +2006 2160 -2.08333333333333e+00 +2006 2017 2.08333333333333e+00 +2006 2023 -4.16666666666667e+00 +2006 2022 -4.16666666666667e+00 +2006 2166 4.16666666666667e+00 +2006 1880 -4.16666666666667e+00 +2006 1878 2.08333333333333e+00 +2006 2016 -4.16666666666667e+00 +2006 2011 2.08333333333333e+00 +2006 2165 -1.87500000000000e+01 +2006 1901 -4.16666666666667e+00 +2006 2164 4.16666666666667e+00 +2006 2167 -8.33333333333333e+00 +2006 2004 -4.16666666666667e+00 +2006 2163 4.16666666666667e+00 +2006 1899 2.08333333333333e+00 +2007 2007 3.75000000000000e+01 +2007 1921 2.08333333333333e+00 +2007 2278 -4.16666666666667e+00 +2007 2015 -2.08333333333333e+00 +2007 2008 -4.16666666666667e+00 +2007 2014 4.16666666666667e+00 +2007 1879 2.08333333333333e+00 +2007 2013 -6.25000000000000e+00 +2007 2285 -4.16666666666667e+00 +2007 2027 4.16666666666667e+00 +2007 1922 2.08333333333333e+00 +2007 2282 -4.16666666666667e+00 +2007 2281 2.08333333333333e+00 +2007 2284 -4.16666666666667e+00 +2007 1920 -1.25000000000000e+01 +2007 2009 -4.16666666666667e+00 +2007 2021 4.16666666666667e+00 +2007 1880 2.08333333333333e+00 +2007 2020 -2.08333333333333e+00 +2007 2026 4.16666666666667e+00 +2007 2279 2.08333333333333e+00 +2007 2019 -6.25000000000000e+00 +2007 1878 -1.25000000000000e+01 +2008 2008 3.33333333333333e+01 +2008 1920 2.08333333333333e+00 +2008 2277 -4.16666666666667e+00 +2008 2015 4.16666666666667e+00 +2008 2014 -1.87500000000000e+01 +2008 2007 -4.16666666666667e+00 +2008 2013 4.16666666666667e+00 +2008 1878 2.08333333333333e+00 +2008 2282 2.08333333333333e+00 +2008 2285 -4.16666666666667e+00 +2008 1921 -4.16666666666667e+00 +2008 2280 2.08333333333333e+00 +2008 2283 -4.16666666666667e+00 +2008 2021 4.16666666666667e+00 +2008 2027 -8.33333333333333e+00 +2008 2279 2.08333333333333e+00 +2008 2020 -6.25000000000000e+00 +2008 1879 -4.16666666666667e+00 +2008 2019 -2.08333333333333e+00 +2008 2025 4.16666666666667e+00 +2009 2009 3.33333333333333e+01 +2009 2277 2.08333333333333e+00 +2009 2015 -6.25000000000000e+00 +2009 2014 4.16666666666667e+00 +2009 2013 -2.08333333333333e+00 +2009 2281 2.08333333333333e+00 +2009 2284 -4.16666666666667e+00 +2009 2283 -4.16666666666667e+00 +2009 2025 4.16666666666667e+00 +2009 1922 -4.16666666666667e+00 +2009 1920 2.08333333333333e+00 +2009 2280 -4.16666666666667e+00 +2009 2278 2.08333333333333e+00 +2009 2021 -1.87500000000000e+01 +2009 1880 -4.16666666666667e+00 +2009 2020 4.16666666666667e+00 +2009 2026 -8.33333333333333e+00 +2009 2007 -4.16666666666667e+00 +2009 2019 4.16666666666667e+00 +2009 1878 2.08333333333333e+00 +2010 2010 6.25000000000000e+01 +2010 2296 -4.16666666666667e+00 +2010 2015 4.16666666666667e+00 +2010 2014 4.16666666666667e+00 +2010 2013 -1.87500000000000e+01 +2010 2303 -4.16666666666667e+00 +2010 2302 -4.16666666666667e+00 +2010 2027 -8.33333333333333e+00 +2010 2026 4.16666666666667e+00 +2010 2162 4.16666666666667e+00 +2010 2012 -8.33333333333333e+00 +2010 2024 8.33333333333333e+00 +2010 2299 4.16666666666667e+00 +2010 2023 -4.16666666666667e+00 +2010 1880 -2.08333333333333e+00 +2010 2006 2.08333333333333e+00 +2010 1879 4.16666666666667e+00 +2010 2005 -4.16666666666667e+00 +2010 1878 -6.25000000000000e+00 +2010 2022 -1.25000000000000e+01 +2010 1925 -2.08333333333333e+00 +2010 2300 4.16666666666667e+00 +2010 2011 -8.33333333333333e+00 +2010 1924 4.16666666666667e+00 +2010 2161 4.16666666666667e+00 +2010 2297 2.08333333333333e+00 +2010 1923 -6.25000000000000e+00 +2010 2160 -1.87500000000000e+01 +2011 2011 6.25000000000000e+01 +2011 2295 -4.16666666666667e+00 +2011 2015 -2.08333333333333e+00 +2011 2014 -6.25000000000000e+00 +2011 2013 4.16666666666667e+00 +2011 2303 -4.16666666666667e+00 +2011 2027 4.16666666666667e+00 +2011 2301 -4.16666666666667e+00 +2011 2025 4.16666666666667e+00 +2011 2162 -2.08333333333333e+00 +2011 2006 2.08333333333333e+00 +2011 2298 4.16666666666667e+00 +2011 2022 -4.16666666666667e+00 +2011 1880 4.16666666666667e+00 +2011 2012 -8.33333333333333e+00 +2011 2024 8.33333333333333e+00 +2011 1879 -1.87500000000000e+01 +2011 2023 -1.25000000000000e+01 +2011 1878 4.16666666666667e+00 +2011 2004 -4.16666666666667e+00 +2011 1925 4.16666666666667e+00 +2011 2300 -8.33333333333333e+00 +2011 2297 2.08333333333333e+00 +2011 1924 -1.87500000000000e+01 +2011 2161 -6.25000000000000e+00 +2011 2010 -8.33333333333333e+00 +2011 1923 4.16666666666667e+00 +2011 2160 4.16666666666667e+00 +2012 2012 6.25000000000000e+01 +2012 2296 2.08333333333333e+00 +2012 2015 -6.25000000000000e+00 +2012 2014 -2.08333333333333e+00 +2012 2013 4.16666666666667e+00 +2012 2301 -4.16666666666667e+00 +2012 2302 -4.16666666666667e+00 +2012 2026 4.16666666666667e+00 +2012 2025 -8.33333333333333e+00 +2012 2161 -2.08333333333333e+00 +2012 2005 2.08333333333333e+00 +2012 2160 4.16666666666667e+00 +2012 2010 -8.33333333333333e+00 +2012 2022 8.33333333333333e+00 +2012 1880 -6.25000000000000e+00 +2012 2024 -3.75000000000000e+01 +2012 1879 4.16666666666667e+00 +2012 2011 -8.33333333333333e+00 +2012 2023 8.33333333333333e+00 +2012 1878 -2.08333333333333e+00 +2012 2004 2.08333333333333e+00 +2012 2295 2.08333333333333e+00 +2012 1925 -6.25000000000000e+00 +2012 2162 -6.25000000000000e+00 +2012 1924 4.16666666666667e+00 +2012 2299 -8.33333333333333e+00 +2012 1923 -2.08333333333333e+00 +2012 2298 4.16666666666667e+00 +2013 2013 6.25000000000000e+01 +2013 2302 4.16666666666667e+00 +2013 2303 4.16666666666667e+00 +2013 2296 4.16666666666667e+00 +2013 2295 -6.25000000000000e+00 +2013 2015 -8.33333333333333e+00 +2013 2012 4.16666666666667e+00 +2013 2011 4.16666666666667e+00 +2013 2010 -1.87500000000000e+01 +2013 2026 -4.16666666666667e+00 +2013 2014 -8.33333333333333e+00 +2013 2279 4.16666666666667e+00 +2013 2314 -4.16666666666667e+00 +2013 2284 4.16666666666667e+00 +2013 2027 8.33333333333333e+00 +2013 2285 -8.33333333333333e+00 +2013 1928 2.08333333333333e+00 +2013 2315 -4.16666666666667e+00 +2013 2278 4.16666666666667e+00 +2013 1927 -4.16666666666667e+00 +2013 2277 -1.87500000000000e+01 +2013 2009 -2.08333333333333e+00 +2013 1880 2.08333333333333e+00 +2013 2008 4.16666666666667e+00 +2013 1879 -4.16666666666667e+00 +2013 2007 -6.25000000000000e+00 +2013 2297 -2.08333333333333e+00 +2013 2025 -1.25000000000000e+01 +2014 2014 6.25000000000000e+01 +2014 2301 4.16666666666667e+00 +2014 2303 -8.33333333333333e+00 +2014 1928 2.08333333333333e+00 +2014 2296 -1.87500000000000e+01 +2014 2295 4.16666666666667e+00 +2014 2012 -2.08333333333333e+00 +2014 1880 2.08333333333333e+00 +2014 2011 -6.25000000000000e+00 +2014 2010 4.16666666666667e+00 +2014 2025 -4.16666666666667e+00 +2014 2279 -2.08333333333333e+00 +2014 2013 -8.33333333333333e+00 +2014 2313 -4.16666666666667e+00 +2014 2283 4.16666666666667e+00 +2014 2315 -4.16666666666667e+00 +2014 2285 4.16666666666667e+00 +2014 2278 -6.25000000000000e+00 +2014 2277 4.16666666666667e+00 +2014 1926 -4.16666666666667e+00 +2014 2009 4.16666666666667e+00 +2014 2015 -8.33333333333333e+00 +2014 2027 8.33333333333333e+00 +2014 2008 -1.87500000000000e+01 +2014 2297 4.16666666666667e+00 +2014 2026 -1.25000000000000e+01 +2014 2007 4.16666666666667e+00 +2014 1878 -4.16666666666667e+00 +2015 2015 6.25000000000000e+01 +2015 2296 4.16666666666667e+00 +2015 2302 -8.33333333333333e+00 +2015 2301 4.16666666666667e+00 +2015 2297 -6.25000000000000e+00 +2015 1927 2.08333333333333e+00 +2015 2012 -6.25000000000000e+00 +2015 2011 -2.08333333333333e+00 +2015 1879 2.08333333333333e+00 +2015 2013 -8.33333333333333e+00 +2015 2010 4.16666666666667e+00 +2015 2278 -2.08333333333333e+00 +2015 2277 4.16666666666667e+00 +2015 2314 -4.16666666666667e+00 +2015 2284 4.16666666666667e+00 +2015 2025 8.33333333333333e+00 +2015 2283 -8.33333333333333e+00 +2015 2279 -6.25000000000000e+00 +2015 1926 2.08333333333333e+00 +2015 2313 -4.16666666666667e+00 +2015 2009 -6.25000000000000e+00 +2015 2295 -2.08333333333333e+00 +2015 2027 -3.75000000000000e+01 +2015 2008 4.16666666666667e+00 +2015 2014 -8.33333333333333e+00 +2015 2026 8.33333333333333e+00 +2015 2007 -2.08333333333333e+00 +2015 1878 2.08333333333333e+00 +2016 2016 6.25000000000000e+01 +2016 2339 -4.16666666666667e+00 +2016 2332 2.08333333333333e+00 +2016 2338 -4.16666666666667e+00 +2016 2333 -4.16666666666667e+00 +2016 2021 4.16666666666667e+00 +2016 2020 4.16666666666667e+00 +2016 2026 -8.33333333333333e+00 +2016 2019 -1.87500000000000e+01 +2016 2336 4.16666666666667e+00 +2016 2024 -4.16666666666667e+00 +2016 2017 -8.33333333333333e+00 +2016 2023 8.33333333333333e+00 +2016 2164 4.16666666666667e+00 +2016 1880 4.16666666666667e+00 +2016 2006 -4.16666666666667e+00 +2016 1879 -2.08333333333333e+00 +2016 2005 2.08333333333333e+00 +2016 1878 -6.25000000000000e+00 +2016 2022 -1.25000000000000e+01 +2016 2018 -8.33333333333333e+00 +2016 1931 4.16666666666667e+00 +2016 2165 4.16666666666667e+00 +2016 1930 -2.08333333333333e+00 +2016 2335 4.16666666666667e+00 +2016 2027 4.16666666666667e+00 +2016 1929 -6.25000000000000e+00 +2016 2163 -1.87500000000000e+01 +2017 2017 6.25000000000000e+01 +2017 2337 -4.16666666666667e+00 +2017 2333 2.08333333333333e+00 +2017 2339 -4.16666666666667e+00 +2017 2021 -2.08333333333333e+00 +2017 2027 4.16666666666667e+00 +2017 2020 -6.25000000000000e+00 +2017 2019 4.16666666666667e+00 +2017 2025 -8.33333333333333e+00 +2017 2006 2.08333333333333e+00 +2017 2165 -2.08333333333333e+00 +2017 2016 -8.33333333333333e+00 +2017 2022 8.33333333333333e+00 +2017 2163 4.16666666666667e+00 +2017 1880 4.16666666666667e+00 +2017 2018 -8.33333333333333e+00 +2017 2024 8.33333333333333e+00 +2017 1879 -6.25000000000000e+00 +2017 2023 -3.75000000000000e+01 +2017 1878 -2.08333333333333e+00 +2017 2004 2.08333333333333e+00 +2017 1931 4.16666666666667e+00 +2017 2336 -8.33333333333333e+00 +2017 2331 2.08333333333333e+00 +2017 1930 -6.25000000000000e+00 +2017 2164 -6.25000000000000e+00 +2017 1929 -2.08333333333333e+00 +2017 2334 4.16666666666667e+00 +2018 2018 6.25000000000000e+01 +2018 2337 -4.16666666666667e+00 +2018 2332 2.08333333333333e+00 +2018 2338 -4.16666666666667e+00 +2018 2331 -4.16666666666667e+00 +2018 2021 -6.25000000000000e+00 +2018 2020 -2.08333333333333e+00 +2018 2026 4.16666666666667e+00 +2018 2019 4.16666666666667e+00 +2018 2334 4.16666666666667e+00 +2018 2022 -4.16666666666667e+00 +2018 2005 2.08333333333333e+00 +2018 2164 -2.08333333333333e+00 +2018 1880 -1.87500000000000e+01 +2018 2024 -1.25000000000000e+01 +2018 1879 4.16666666666667e+00 +2018 2017 -8.33333333333333e+00 +2018 2023 8.33333333333333e+00 +2018 1878 4.16666666666667e+00 +2018 2004 -4.16666666666667e+00 +2018 2025 4.16666666666667e+00 +2018 1931 -1.87500000000000e+01 +2018 2165 -6.25000000000000e+00 +2018 1930 4.16666666666667e+00 +2018 2335 -8.33333333333333e+00 +2018 2016 -8.33333333333333e+00 +2018 1929 4.16666666666667e+00 +2018 2163 4.16666666666667e+00 +2019 2019 6.25000000000000e+01 +2019 2285 4.16666666666667e+00 +2019 2284 -8.33333333333333e+00 +2019 2282 4.16666666666667e+00 +2019 1933 2.08333333333333e+00 +2019 2280 -1.87500000000000e+01 +2019 2009 4.16666666666667e+00 +2019 2008 -2.08333333333333e+00 +2019 1879 2.08333333333333e+00 +2019 2007 -6.25000000000000e+00 +2019 2027 -4.16666666666667e+00 +2019 2021 -8.33333333333333e+00 +2019 2332 -2.08333333333333e+00 +2019 2351 -4.16666666666667e+00 +2019 2339 4.16666666666667e+00 +2019 2350 -4.16666666666667e+00 +2019 2338 4.16666666666667e+00 +2019 2333 4.16666666666667e+00 +2019 1934 -4.16666666666667e+00 +2019 2331 -6.25000000000000e+00 +2019 2018 4.16666666666667e+00 +2019 1880 -4.16666666666667e+00 +2019 2017 4.16666666666667e+00 +2019 2020 -8.33333333333333e+00 +2019 2026 8.33333333333333e+00 +2019 2016 -1.87500000000000e+01 +2019 2281 4.16666666666667e+00 +2019 2025 -1.25000000000000e+01 +2020 2020 6.25000000000000e+01 +2020 2285 4.16666666666667e+00 +2020 2280 4.16666666666667e+00 +2020 2283 -8.33333333333333e+00 +2020 2281 -6.25000000000000e+00 +2020 1932 2.08333333333333e+00 +2020 2009 4.16666666666667e+00 +2020 2021 -8.33333333333333e+00 +2020 2008 -6.25000000000000e+00 +2020 2007 -2.08333333333333e+00 +2020 1878 2.08333333333333e+00 +2020 2331 -2.08333333333333e+00 +2020 2333 4.16666666666667e+00 +2020 2027 8.33333333333333e+00 +2020 2339 -8.33333333333333e+00 +2020 2349 -4.16666666666667e+00 +2020 2337 4.16666666666667e+00 +2020 1934 2.08333333333333e+00 +2020 2351 -4.16666666666667e+00 +2020 2332 -6.25000000000000e+00 +2020 2018 -2.08333333333333e+00 +2020 1880 2.08333333333333e+00 +2020 2017 -6.25000000000000e+00 +2020 2282 -2.08333333333333e+00 +2020 2026 -3.75000000000000e+01 +2020 2016 4.16666666666667e+00 +2020 2019 -8.33333333333333e+00 +2020 2025 8.33333333333333e+00 +2021 2021 6.25000000000000e+01 +2021 2284 4.16666666666667e+00 +2021 2283 4.16666666666667e+00 +2021 2282 -6.25000000000000e+00 +2021 2280 4.16666666666667e+00 +2021 2009 -1.87500000000000e+01 +2021 2008 4.16666666666667e+00 +2021 2020 -8.33333333333333e+00 +2021 2007 4.16666666666667e+00 +2021 2025 -4.16666666666667e+00 +2021 2019 -8.33333333333333e+00 +2021 2332 4.16666666666667e+00 +2021 2349 -4.16666666666667e+00 +2021 2337 4.16666666666667e+00 +2021 2026 8.33333333333333e+00 +2021 2338 -8.33333333333333e+00 +2021 2333 -1.87500000000000e+01 +2021 1933 2.08333333333333e+00 +2021 2350 -4.16666666666667e+00 +2021 2331 4.16666666666667e+00 +2021 1932 -4.16666666666667e+00 +2021 2018 -6.25000000000000e+00 +2021 2281 -2.08333333333333e+00 +2021 2027 -1.25000000000000e+01 +2021 2017 -2.08333333333333e+00 +2021 1879 2.08333333333333e+00 +2021 2016 4.16666666666667e+00 +2021 1878 -4.16666666666667e+00 +2022 2022 1.25000000000000e+02 +2022 2302 -8.33333333333333e+00 +2022 2027 8.33333333333333e+00 +2022 2339 -8.33333333333333e+00 +2022 2368 -4.16666666666667e+00 +2022 2338 4.16666666666667e+00 +2022 2369 -4.16666666666667e+00 +2022 2026 8.33333333333333e+00 +2022 2025 -3.75000000000000e+01 +2022 2012 8.33333333333333e+00 +2022 2161 4.16666666666667e+00 +2022 2011 -4.16666666666667e+00 +2022 2162 -8.33333333333333e+00 +2022 1880 4.16666666666667e+00 +2022 2010 -1.25000000000000e+01 +2022 2300 -4.16666666666667e+00 +2022 1937 4.16666666666667e+00 +2022 2023 -1.66666666666667e+01 +2022 2299 8.33333333333333e+00 +2022 2298 -1.25000000000000e+01 +2022 2018 -4.16666666666667e+00 +2022 2017 8.33333333333333e+00 +2022 2006 -4.16666666666667e+00 +2022 2165 4.16666666666667e+00 +2022 2167 8.33333333333333e+00 +2022 2164 -8.33333333333333e+00 +2022 1879 4.16666666666667e+00 +2022 2005 -4.16666666666667e+00 +2022 2016 -1.25000000000000e+01 +2022 2024 -1.66666666666667e+01 +2022 2336 8.33333333333333e+00 +2022 2168 8.33333333333333e+00 +2022 2335 -4.16666666666667e+00 +2022 1936 4.16666666666667e+00 +2022 2303 4.16666666666667e+00 +2022 2334 -1.25000000000000e+01 +2022 2166 -3.75000000000000e+01 +2023 2023 1.25000000000000e+02 +2023 2301 -8.33333333333333e+00 +2023 2027 -4.16666666666667e+00 +2023 2369 -4.16666666666667e+00 +2023 2339 4.16666666666667e+00 +2023 2367 -4.16666666666667e+00 +2023 2337 4.16666666666667e+00 +2023 2026 -1.25000000000000e+01 +2023 2025 8.33333333333333e+00 +2023 2160 4.16666666666667e+00 +2023 2010 -4.16666666666667e+00 +2023 2162 4.16666666666667e+00 +2023 2012 8.33333333333333e+00 +2023 2011 -1.25000000000000e+01 +2023 2300 8.33333333333333e+00 +2023 2299 -3.75000000000000e+01 +2023 2022 -1.66666666666667e+01 +2023 2298 8.33333333333333e+00 +2023 2168 -4.16666666666667e+00 +2023 2024 -1.66666666666667e+01 +2023 2006 -4.16666666666667e+00 +2023 2165 4.16666666666667e+00 +2023 2016 8.33333333333333e+00 +2023 2166 8.33333333333333e+00 +2023 2163 -8.33333333333333e+00 +2023 1880 -8.33333333333333e+00 +2023 2018 8.33333333333333e+00 +2023 2017 -3.75000000000000e+01 +2023 1878 4.16666666666667e+00 +2023 2004 -4.16666666666667e+00 +2023 2336 8.33333333333333e+00 +2023 1937 -8.33333333333333e+00 +2023 2303 4.16666666666667e+00 +2023 2335 -1.25000000000000e+01 +2023 2167 -1.25000000000000e+01 +2023 2334 -4.16666666666667e+00 +2023 1935 4.16666666666667e+00 +2024 2024 1.25000000000000e+02 +2024 2302 4.16666666666667e+00 +2024 2026 -4.16666666666667e+00 +2024 2368 -4.16666666666667e+00 +2024 2338 4.16666666666667e+00 +2024 2025 8.33333333333333e+00 +2024 2337 -8.33333333333333e+00 +2024 2367 -4.16666666666667e+00 +2024 2027 -1.25000000000000e+01 +2024 2010 8.33333333333333e+00 +2024 2161 4.16666666666667e+00 +2024 2160 -8.33333333333333e+00 +2024 2012 -3.75000000000000e+01 +2024 2011 8.33333333333333e+00 +2024 1878 4.16666666666667e+00 +2024 2300 -1.25000000000000e+01 +2024 2299 8.33333333333333e+00 +2024 2298 -4.16666666666667e+00 +2024 1935 4.16666666666667e+00 +2024 2167 -4.16666666666667e+00 +2024 2023 -1.66666666666667e+01 +2024 2016 -4.16666666666667e+00 +2024 2005 -4.16666666666667e+00 +2024 2164 4.16666666666667e+00 +2024 2004 -4.16666666666667e+00 +2024 2163 4.16666666666667e+00 +2024 2018 -1.25000000000000e+01 +2024 1879 -8.33333333333333e+00 +2024 2017 8.33333333333333e+00 +2024 2301 4.16666666666667e+00 +2024 2336 -3.75000000000000e+01 +2024 2168 -1.25000000000000e+01 +2024 2335 8.33333333333333e+00 +2024 1936 -8.33333333333333e+00 +2024 2022 -1.66666666666667e+01 +2024 2334 8.33333333333333e+00 +2024 2166 8.33333333333333e+00 +2025 2025 1.25000000000000e+02 +2025 2302 8.33333333333333e+00 +2025 2301 -1.25000000000000e+01 +2025 2012 -8.33333333333333e+00 +2025 2011 4.16666666666667e+00 +2025 2024 8.33333333333333e+00 +2025 2368 4.16666666666667e+00 +2025 2023 8.33333333333333e+00 +2025 2022 -3.75000000000000e+01 +2025 2369 4.16666666666667e+00 +2025 2014 -4.16666666666667e+00 +2025 2015 8.33333333333333e+00 +2025 2027 -1.66666666666667e+01 +2025 1880 -4.16666666666667e+00 +2025 2013 -1.25000000000000e+01 +2025 2315 4.16666666666667e+00 +2025 1940 -4.16666666666667e+00 +2025 2314 -8.33333333333333e+00 +2025 2009 4.16666666666667e+00 +2025 2284 8.33333333333333e+00 +2025 2026 -1.66666666666667e+01 +2025 2285 8.33333333333333e+00 +2025 1939 -4.16666666666667e+00 +2025 2283 -3.75000000000000e+01 +2025 2008 4.16666666666667e+00 +2025 1879 -4.16666666666667e+00 +2025 2021 -4.16666666666667e+00 +2025 2018 4.16666666666667e+00 +2025 2350 4.16666666666667e+00 +2025 2338 -4.16666666666667e+00 +2025 2017 -8.33333333333333e+00 +2025 2020 8.33333333333333e+00 +2025 2019 -1.25000000000000e+01 +2025 2339 8.33333333333333e+00 +2025 2351 -8.33333333333333e+00 +2025 2337 -1.25000000000000e+01 +2025 2303 -4.16666666666667e+00 +2026 2026 1.25000000000000e+02 +2026 2301 8.33333333333333e+00 +2026 2303 8.33333333333333e+00 +2026 2302 -3.75000000000000e+01 +2026 2010 4.16666666666667e+00 +2026 2024 -4.16666666666667e+00 +2026 2367 4.16666666666667e+00 +2026 2023 -1.25000000000000e+01 +2026 2022 8.33333333333333e+00 +2026 2369 -8.33333333333333e+00 +2026 2013 -4.16666666666667e+00 +2026 2315 4.16666666666667e+00 +2026 2015 8.33333333333333e+00 +2026 2014 -1.25000000000000e+01 +2026 2313 -8.33333333333333e+00 +2026 2285 -4.16666666666667e+00 +2026 2283 8.33333333333333e+00 +2026 2025 -1.66666666666667e+01 +2026 2284 -1.25000000000000e+01 +2026 1938 -4.16666666666667e+00 +2026 2009 -8.33333333333333e+00 +2026 2007 4.16666666666667e+00 +2026 1878 -4.16666666666667e+00 +2026 2021 8.33333333333333e+00 +2026 2027 -1.66666666666667e+01 +2026 2339 8.33333333333333e+00 +2026 2349 4.16666666666667e+00 +2026 2337 -4.16666666666667e+00 +2026 2018 4.16666666666667e+00 +2026 1880 -4.16666666666667e+00 +2026 2020 -3.75000000000000e+01 +2026 2016 -8.33333333333333e+00 +2026 2019 8.33333333333333e+00 +2026 2351 4.16666666666667e+00 +2026 1940 -4.16666666666667e+00 +2026 2338 -1.25000000000000e+01 +2026 2012 4.16666666666667e+00 +2027 2027 1.25000000000000e+02 +2027 2011 4.16666666666667e+00 +2027 2303 -1.25000000000000e+01 +2027 2302 8.33333333333333e+00 +2027 2010 -8.33333333333333e+00 +2027 2023 -4.16666666666667e+00 +2027 2022 8.33333333333333e+00 +2027 2024 -1.25000000000000e+01 +2027 2368 -8.33333333333333e+00 +2027 2367 4.16666666666667e+00 +2027 2314 4.16666666666667e+00 +2027 2013 8.33333333333333e+00 +2027 2025 -1.66666666666667e+01 +2027 2015 -3.75000000000000e+01 +2027 2014 8.33333333333333e+00 +2027 1878 -4.16666666666667e+00 +2027 2313 4.16666666666667e+00 +2027 1938 -4.16666666666667e+00 +2027 2284 -4.16666666666667e+00 +2027 2007 4.16666666666667e+00 +2027 2285 -1.25000000000000e+01 +2027 2283 8.33333333333333e+00 +2027 2008 -8.33333333333333e+00 +2027 2019 -4.16666666666667e+00 +2027 2016 4.16666666666667e+00 +2027 2020 8.33333333333333e+00 +2027 2026 -1.66666666666667e+01 +2027 2338 8.33333333333333e+00 +2027 2021 -1.25000000000000e+01 +2027 2017 4.16666666666667e+00 +2027 1879 -4.16666666666667e+00 +2027 2339 -3.75000000000000e+01 +2027 2301 -4.16666666666667e+00 +2027 2350 4.16666666666667e+00 +2027 1939 -4.16666666666667e+00 +2027 2337 8.33333333333333e+00 +2027 2349 -8.33333333333333e+00 +2028 2028 3.75000000000000e+01 +2028 2288 -2.08333333333333e+00 +2028 2029 -4.16666666666667e+00 +2028 2287 4.16666666666667e+00 +2028 1921 2.08333333333333e+00 +2028 2286 -6.25000000000000e+00 +2028 2294 4.16666666666667e+00 +2028 2030 -4.16666666666667e+00 +2028 2291 4.16666666666667e+00 +2028 1922 2.08333333333333e+00 +2028 2290 -2.08333333333333e+00 +2028 2293 4.16666666666667e+00 +2028 2289 -6.25000000000000e+00 +2028 1920 -1.25000000000000e+01 +2028 1276 2.08333333333333e+00 +2028 1387 -4.16666666666667e+00 +2028 1400 -4.16666666666667e+00 +2028 1277 2.08333333333333e+00 +2028 1394 -4.16666666666667e+00 +2028 1393 2.08333333333333e+00 +2028 1399 -4.16666666666667e+00 +2028 1275 -1.25000000000000e+01 +2028 1388 2.08333333333333e+00 +2029 2029 3.33333333333333e+01 +2029 2288 4.16666666666667e+00 +2029 2287 -1.87500000000000e+01 +2029 2028 -4.16666666666667e+00 +2029 2286 4.16666666666667e+00 +2029 1920 2.08333333333333e+00 +2029 2291 4.16666666666667e+00 +2029 2294 -8.33333333333333e+00 +2029 2290 -6.25000000000000e+00 +2029 1921 -4.16666666666667e+00 +2029 2289 -2.08333333333333e+00 +2029 2292 4.16666666666667e+00 +2029 1275 2.08333333333333e+00 +2029 1386 -4.16666666666667e+00 +2029 1394 2.08333333333333e+00 +2029 1400 -4.16666666666667e+00 +2029 1276 -4.16666666666667e+00 +2029 1392 2.08333333333333e+00 +2029 1398 -4.16666666666667e+00 +2029 1388 2.08333333333333e+00 +2030 2030 3.33333333333333e+01 +2030 2288 -6.25000000000000e+00 +2030 2287 4.16666666666667e+00 +2030 2286 -2.08333333333333e+00 +2030 2292 4.16666666666667e+00 +2030 2291 -1.87500000000000e+01 +2030 1922 -4.16666666666667e+00 +2030 2290 4.16666666666667e+00 +2030 2293 -8.33333333333333e+00 +2030 2028 -4.16666666666667e+00 +2030 2289 4.16666666666667e+00 +2030 1920 2.08333333333333e+00 +2030 1386 2.08333333333333e+00 +2030 1393 2.08333333333333e+00 +2030 1399 -4.16666666666667e+00 +2030 1398 -4.16666666666667e+00 +2030 1277 -4.16666666666667e+00 +2030 1275 2.08333333333333e+00 +2030 1392 -4.16666666666667e+00 +2030 1387 2.08333333333333e+00 +2031 2031 1.00000000000000e+00 +2031 2035 0.00000000000000e+00 +2031 1882 0.00000000000000e+00 +2031 2180 0.00000000000000e+00 +2031 2179 0.00000000000000e+00 +2031 2032 0.00000000000000e+00 +2031 1903 0.00000000000000e+00 +2031 2178 0.00000000000000e+00 +2031 2042 0.00000000000000e+00 +2031 2039 0.00000000000000e+00 +2031 2038 0.00000000000000e+00 +2031 2041 0.00000000000000e+00 +2031 1881 0.00000000000000e+00 +2031 2183 0.00000000000000e+00 +2031 2186 0.00000000000000e+00 +2031 2182 0.00000000000000e+00 +2031 2185 0.00000000000000e+00 +2031 2181 0.00000000000000e+00 +2031 2036 0.00000000000000e+00 +2031 1902 0.00000000000000e+00 +2032 2032 1.00000000000000e+00 +2032 2034 0.00000000000000e+00 +2032 1881 0.00000000000000e+00 +2032 2180 0.00000000000000e+00 +2032 2179 0.00000000000000e+00 +2032 2178 0.00000000000000e+00 +2032 2031 0.00000000000000e+00 +2032 1902 0.00000000000000e+00 +2032 2042 0.00000000000000e+00 +2032 2186 0.00000000000000e+00 +2032 2039 0.00000000000000e+00 +2032 1883 0.00000000000000e+00 +2032 1882 0.00000000000000e+00 +2032 2037 0.00000000000000e+00 +2032 2040 0.00000000000000e+00 +2032 2183 0.00000000000000e+00 +2032 2033 0.00000000000000e+00 +2032 1904 0.00000000000000e+00 +2032 2182 0.00000000000000e+00 +2032 2036 0.00000000000000e+00 +2032 1903 0.00000000000000e+00 +2032 2181 0.00000000000000e+00 +2032 2184 0.00000000000000e+00 +2033 2033 1.00000000000000e+00 +2033 2035 0.00000000000000e+00 +2033 2180 0.00000000000000e+00 +2033 2179 0.00000000000000e+00 +2033 2178 0.00000000000000e+00 +2033 2040 0.00000000000000e+00 +2033 2037 0.00000000000000e+00 +2033 2041 0.00000000000000e+00 +2033 2185 0.00000000000000e+00 +2033 1883 0.00000000000000e+00 +2033 2038 0.00000000000000e+00 +2033 1882 0.00000000000000e+00 +2033 2183 0.00000000000000e+00 +2033 2034 0.00000000000000e+00 +2033 1904 0.00000000000000e+00 +2033 2182 0.00000000000000e+00 +2033 2032 0.00000000000000e+00 +2033 1903 0.00000000000000e+00 +2033 2181 0.00000000000000e+00 +2033 2184 0.00000000000000e+00 +2034 2034 2.50000000000000e+01 +2034 2180 -2.08333333333333e+00 +2034 2404 2.08333333333333e+00 +2034 2041 -2.08333333333333e+00 +2034 1943 2.08333333333333e+00 +2034 2405 -4.16666666666667e+00 +2034 1942 2.08333333333333e+00 +2034 2035 -4.16666666666667e+00 +2034 2179 4.16666666666667e+00 +2034 1941 -6.25000000000000e+00 +2034 2178 -6.25000000000000e+00 +2034 2036 -4.16666666666667e+00 +2034 1883 0.00000000000000e+00 +2034 2042 4.16666666666667e+00 +2034 1882 0.00000000000000e+00 +2034 2032 0.00000000000000e+00 +2034 2033 0.00000000000000e+00 +2034 1881 0.00000000000000e+00 +2034 2040 -6.25000000000000e+00 +2035 2035 2.91666666666667e+01 +2035 2180 4.16666666666667e+00 +2035 2042 4.16666666666667e+00 +2035 2403 2.08333333333333e+00 +2035 2040 -2.08333333333333e+00 +2035 1943 -2.08333333333333e+00 +2035 2405 2.08333333333333e+00 +2035 1942 -2.08333333333333e+00 +2035 2179 -1.87500000000000e+01 +2035 1941 2.08333333333333e+00 +2035 2034 -4.16666666666667e+00 +2035 2178 4.16666666666667e+00 +2035 1883 0.00000000000000e+00 +2035 2033 0.00000000000000e+00 +2035 2036 -8.33333333333333e+00 +2035 1882 0.00000000000000e+00 +2035 2041 -6.25000000000000e+00 +2035 1881 0.00000000000000e+00 +2035 2031 0.00000000000000e+00 +2036 2036 2.91666666666667e+01 +2036 2178 -2.08333333333333e+00 +2036 2035 -8.33333333333333e+00 +2036 2179 4.16666666666667e+00 +2036 2041 4.16666666666667e+00 +2036 1943 -2.08333333333333e+00 +2036 2180 -6.25000000000000e+00 +2036 1942 -2.08333333333333e+00 +2036 2404 2.08333333333333e+00 +2036 1941 2.08333333333333e+00 +2036 2403 -4.16666666666667e+00 +2036 2031 0.00000000000000e+00 +2036 1883 0.00000000000000e+00 +2036 2042 -1.87500000000000e+01 +2036 1882 0.00000000000000e+00 +2036 2032 0.00000000000000e+00 +2036 2034 -4.16666666666667e+00 +2036 1881 0.00000000000000e+00 +2036 2040 4.16666666666667e+00 +2037 2037 1.00000000000000e+00 +2037 2183 0.00000000000000e+00 +2037 2041 0.00000000000000e+00 +2037 2038 0.00000000000000e+00 +2037 2182 0.00000000000000e+00 +2037 1946 0.00000000000000e+00 +2037 2411 0.00000000000000e+00 +2037 1945 0.00000000000000e+00 +2037 2410 0.00000000000000e+00 +2037 1944 0.00000000000000e+00 +2037 2181 0.00000000000000e+00 +2037 2039 0.00000000000000e+00 +2037 1883 0.00000000000000e+00 +2037 2042 0.00000000000000e+00 +2037 1882 0.00000000000000e+00 +2037 2032 0.00000000000000e+00 +2037 2033 0.00000000000000e+00 +2037 1881 0.00000000000000e+00 +2037 2040 0.00000000000000e+00 +2038 2038 1.00000000000000e+00 +2038 2411 0.00000000000000e+00 +2038 2040 0.00000000000000e+00 +2038 2037 0.00000000000000e+00 +2038 2181 0.00000000000000e+00 +2038 1946 0.00000000000000e+00 +2038 2039 0.00000000000000e+00 +2038 2183 0.00000000000000e+00 +2038 1945 0.00000000000000e+00 +2038 2182 0.00000000000000e+00 +2038 1944 0.00000000000000e+00 +2038 2409 0.00000000000000e+00 +2038 1883 0.00000000000000e+00 +2038 2033 0.00000000000000e+00 +2038 2042 0.00000000000000e+00 +2038 1882 0.00000000000000e+00 +2038 2041 0.00000000000000e+00 +2038 1881 0.00000000000000e+00 +2038 2031 0.00000000000000e+00 +2039 2039 1.00000000000000e+00 +2039 2410 0.00000000000000e+00 +2039 2031 0.00000000000000e+00 +2039 2181 0.00000000000000e+00 +2039 1946 0.00000000000000e+00 +2039 2183 0.00000000000000e+00 +2039 1945 0.00000000000000e+00 +2039 2038 0.00000000000000e+00 +2039 2182 0.00000000000000e+00 +2039 1944 0.00000000000000e+00 +2039 2409 0.00000000000000e+00 +2039 2041 0.00000000000000e+00 +2039 1883 0.00000000000000e+00 +2039 2042 0.00000000000000e+00 +2039 1882 0.00000000000000e+00 +2039 2032 0.00000000000000e+00 +2039 2037 0.00000000000000e+00 +2039 1881 0.00000000000000e+00 +2039 2040 0.00000000000000e+00 +2040 2040 6.25000000000000e+01 +2040 2179 4.16666666666667e+00 +2040 2180 4.16666666666667e+00 +2040 2036 4.16666666666667e+00 +2040 2034 -6.25000000000000e+00 +2040 2405 4.16666666666667e+00 +2040 2404 4.16666666666667e+00 +2040 2041 -8.33333333333333e+00 +2040 2403 -1.87500000000000e+01 +2040 2186 -4.16666666666667e+00 +2040 2042 -8.33333333333333e+00 +2040 2033 0.00000000000000e+00 +2040 2183 0.00000000000000e+00 +2040 2038 0.00000000000000e+00 +2040 2185 8.33333333333333e+00 +2040 2182 0.00000000000000e+00 +2040 2039 0.00000000000000e+00 +2040 1883 0.00000000000000e+00 +2040 1882 0.00000000000000e+00 +2040 2032 0.00000000000000e+00 +2040 2037 0.00000000000000e+00 +2040 2411 4.16666666666667e+00 +2040 1949 -4.16666666666667e+00 +2040 2410 -2.08333333333333e+00 +2040 1948 2.08333333333333e+00 +2040 2409 -6.25000000000000e+00 +2040 2035 -2.08333333333333e+00 +2040 2184 -1.25000000000000e+01 +2041 2041 6.25000000000000e+01 +2041 2034 -2.08333333333333e+00 +2041 2178 4.16666666666667e+00 +2041 2180 -8.33333333333333e+00 +2041 1883 0.00000000000000e+00 +2041 2035 -6.25000000000000e+00 +2041 2405 -2.08333333333333e+00 +2041 1949 2.08333333333333e+00 +2041 2404 -6.25000000000000e+00 +2041 2403 4.16666666666667e+00 +2041 2040 -8.33333333333333e+00 +2041 2039 0.00000000000000e+00 +2041 2037 0.00000000000000e+00 +2041 2033 0.00000000000000e+00 +2041 2183 0.00000000000000e+00 +2041 2184 8.33333333333333e+00 +2041 2181 0.00000000000000e+00 +2041 2038 0.00000000000000e+00 +2041 1881 0.00000000000000e+00 +2041 2031 0.00000000000000e+00 +2041 2411 4.16666666666667e+00 +2041 2042 -8.33333333333333e+00 +2041 2186 8.33333333333333e+00 +2041 2410 -6.25000000000000e+00 +2041 2036 4.16666666666667e+00 +2041 2185 -3.75000000000000e+01 +2041 2409 -2.08333333333333e+00 +2041 1947 2.08333333333333e+00 +2042 2042 6.25000000000000e+01 +2042 2179 -8.33333333333333e+00 +2042 2178 4.16666666666667e+00 +2042 2036 -1.87500000000000e+01 +2042 1882 0.00000000000000e+00 +2042 2034 4.16666666666667e+00 +2042 2405 -6.25000000000000e+00 +2042 2404 -2.08333333333333e+00 +2042 1948 2.08333333333333e+00 +2042 2403 4.16666666666667e+00 +2042 2184 -4.16666666666667e+00 +2042 2038 0.00000000000000e+00 +2042 2040 -8.33333333333333e+00 +2042 2031 0.00000000000000e+00 +2042 2181 0.00000000000000e+00 +2042 2032 0.00000000000000e+00 +2042 2182 0.00000000000000e+00 +2042 2039 0.00000000000000e+00 +2042 2037 0.00000000000000e+00 +2042 1881 0.00000000000000e+00 +2042 2411 -1.87500000000000e+01 +2042 2035 4.16666666666667e+00 +2042 2186 -1.25000000000000e+01 +2042 2410 4.16666666666667e+00 +2042 2041 -8.33333333333333e+00 +2042 2185 8.33333333333333e+00 +2042 2409 4.16666666666667e+00 +2042 1947 -4.16666666666667e+00 +2043 2043 6.25000000000000e+01 +2043 2407 4.16666666666667e+00 +2043 2408 4.16666666666667e+00 +2043 2050 4.16666666666667e+00 +2043 2049 -6.25000000000000e+00 +2043 2045 -8.33333333333333e+00 +2043 2198 4.16666666666667e+00 +2043 2197 4.16666666666667e+00 +2043 2196 -1.87500000000000e+01 +2043 2203 -4.16666666666667e+00 +2043 2044 -8.33333333333333e+00 +2043 2048 4.16666666666667e+00 +2043 2056 -4.16666666666667e+00 +2043 2308 4.16666666666667e+00 +2043 2204 8.33333333333333e+00 +2043 2309 -8.33333333333333e+00 +2043 1886 2.08333333333333e+00 +2043 2057 -4.16666666666667e+00 +2043 2047 4.16666666666667e+00 +2043 1885 -4.16666666666667e+00 +2043 2046 -1.87500000000000e+01 +2043 2192 -2.08333333333333e+00 +2043 1907 2.08333333333333e+00 +2043 2191 4.16666666666667e+00 +2043 1906 -4.16666666666667e+00 +2043 2190 -6.25000000000000e+00 +2043 2051 -2.08333333333333e+00 +2043 2202 -1.25000000000000e+01 +2044 2044 6.25000000000000e+01 +2044 2406 4.16666666666667e+00 +2044 2408 -8.33333333333333e+00 +2044 1886 2.08333333333333e+00 +2044 2050 -1.87500000000000e+01 +2044 2049 4.16666666666667e+00 +2044 2198 -2.08333333333333e+00 +2044 1907 2.08333333333333e+00 +2044 2197 -6.25000000000000e+00 +2044 2196 4.16666666666667e+00 +2044 2202 -4.16666666666667e+00 +2044 2048 -2.08333333333333e+00 +2044 2043 -8.33333333333333e+00 +2044 2055 -4.16666666666667e+00 +2044 2307 4.16666666666667e+00 +2044 2057 -4.16666666666667e+00 +2044 2309 4.16666666666667e+00 +2044 2047 -6.25000000000000e+00 +2044 2046 4.16666666666667e+00 +2044 1884 -4.16666666666667e+00 +2044 2192 4.16666666666667e+00 +2044 2045 -8.33333333333333e+00 +2044 2204 8.33333333333333e+00 +2044 2191 -1.87500000000000e+01 +2044 2051 4.16666666666667e+00 +2044 2203 -1.25000000000000e+01 +2044 2190 4.16666666666667e+00 +2044 1905 -4.16666666666667e+00 +2045 2045 6.25000000000000e+01 +2045 2050 4.16666666666667e+00 +2045 2407 -8.33333333333333e+00 +2045 2406 4.16666666666667e+00 +2045 2051 -6.25000000000000e+00 +2045 1885 2.08333333333333e+00 +2045 2198 -6.25000000000000e+00 +2045 2197 -2.08333333333333e+00 +2045 1906 2.08333333333333e+00 +2045 2043 -8.33333333333333e+00 +2045 2196 4.16666666666667e+00 +2045 2047 -2.08333333333333e+00 +2045 2046 4.16666666666667e+00 +2045 2056 -4.16666666666667e+00 +2045 2308 4.16666666666667e+00 +2045 2202 8.33333333333333e+00 +2045 2307 -8.33333333333333e+00 +2045 2048 -6.25000000000000e+00 +2045 1884 2.08333333333333e+00 +2045 2055 -4.16666666666667e+00 +2045 2192 -6.25000000000000e+00 +2045 2049 -2.08333333333333e+00 +2045 2204 -3.75000000000000e+01 +2045 2191 4.16666666666667e+00 +2045 2044 -8.33333333333333e+00 +2045 2203 8.33333333333333e+00 +2045 2190 -2.08333333333333e+00 +2045 1905 2.08333333333333e+00 +2046 2046 6.25000000000000e+01 +2046 2053 -4.16666666666667e+00 +2046 2306 4.16666666666667e+00 +2046 2305 4.16666666666667e+00 +2046 2304 -1.87500000000000e+01 +2046 2060 -4.16666666666667e+00 +2046 2059 -4.16666666666667e+00 +2046 2312 -8.33333333333333e+00 +2046 2311 4.16666666666667e+00 +2046 2045 4.16666666666667e+00 +2046 2048 -8.33333333333333e+00 +2046 2309 8.33333333333333e+00 +2046 2056 4.16666666666667e+00 +2046 2308 -4.16666666666667e+00 +2046 1925 -2.08333333333333e+00 +2046 2192 2.08333333333333e+00 +2046 1924 4.16666666666667e+00 +2046 2191 -4.16666666666667e+00 +2046 1923 -6.25000000000000e+00 +2046 2307 -1.25000000000000e+01 +2046 1886 -2.08333333333333e+00 +2046 2057 4.16666666666667e+00 +2046 2047 -8.33333333333333e+00 +2046 1885 4.16666666666667e+00 +2046 2044 4.16666666666667e+00 +2046 2054 2.08333333333333e+00 +2046 1884 -6.25000000000000e+00 +2046 2043 -1.87500000000000e+01 +2047 2047 6.25000000000000e+01 +2047 2052 -4.16666666666667e+00 +2047 2306 -2.08333333333333e+00 +2047 2305 -6.25000000000000e+00 +2047 2304 4.16666666666667e+00 +2047 2060 -4.16666666666667e+00 +2047 2312 4.16666666666667e+00 +2047 2058 -4.16666666666667e+00 +2047 2310 4.16666666666667e+00 +2047 2045 -2.08333333333333e+00 +2047 2192 2.08333333333333e+00 +2047 2055 4.16666666666667e+00 +2047 2307 -4.16666666666667e+00 +2047 1925 4.16666666666667e+00 +2047 2048 -8.33333333333333e+00 +2047 2309 8.33333333333333e+00 +2047 1924 -1.87500000000000e+01 +2047 2308 -1.25000000000000e+01 +2047 1923 4.16666666666667e+00 +2047 2190 -4.16666666666667e+00 +2047 1886 4.16666666666667e+00 +2047 2057 -8.33333333333333e+00 +2047 2054 2.08333333333333e+00 +2047 1885 -1.87500000000000e+01 +2047 2044 -6.25000000000000e+00 +2047 2046 -8.33333333333333e+00 +2047 1884 4.16666666666667e+00 +2047 2043 4.16666666666667e+00 +2048 2048 6.25000000000000e+01 +2048 2053 2.08333333333333e+00 +2048 2306 -6.25000000000000e+00 +2048 2305 -2.08333333333333e+00 +2048 2304 4.16666666666667e+00 +2048 2058 -4.16666666666667e+00 +2048 2059 -4.16666666666667e+00 +2048 2311 4.16666666666667e+00 +2048 2310 -8.33333333333333e+00 +2048 2044 -2.08333333333333e+00 +2048 2191 2.08333333333333e+00 +2048 2043 4.16666666666667e+00 +2048 2046 -8.33333333333333e+00 +2048 2307 8.33333333333333e+00 +2048 1925 -6.25000000000000e+00 +2048 2309 -3.75000000000000e+01 +2048 1924 4.16666666666667e+00 +2048 2047 -8.33333333333333e+00 +2048 2308 8.33333333333333e+00 +2048 1923 -2.08333333333333e+00 +2048 2190 2.08333333333333e+00 +2048 2052 2.08333333333333e+00 +2048 1886 -6.25000000000000e+00 +2048 2045 -6.25000000000000e+00 +2048 1885 4.16666666666667e+00 +2048 2056 -8.33333333333333e+00 +2048 1884 -2.08333333333333e+00 +2048 2055 4.16666666666667e+00 +2049 2049 2.50000000000000e+01 +2049 2045 -2.08333333333333e+00 +2049 2056 2.08333333333333e+00 +2049 2407 -2.08333333333333e+00 +2049 1886 2.08333333333333e+00 +2049 2057 -4.16666666666667e+00 +2049 1885 2.08333333333333e+00 +2049 2050 -4.16666666666667e+00 +2049 2044 4.16666666666667e+00 +2049 1884 -6.25000000000000e+00 +2049 2043 -6.25000000000000e+00 +2049 2051 -4.16666666666667e+00 +2049 1943 2.08333333333333e+00 +2049 2408 4.16666666666667e+00 +2049 1942 2.08333333333333e+00 +2049 2197 -4.16666666666667e+00 +2049 2198 2.08333333333333e+00 +2049 1941 -6.25000000000000e+00 +2049 2406 -6.25000000000000e+00 +2050 2050 2.91666666666667e+01 +2050 2045 4.16666666666667e+00 +2050 2408 4.16666666666667e+00 +2050 2055 2.08333333333333e+00 +2050 2406 -2.08333333333333e+00 +2050 1886 -2.08333333333333e+00 +2050 2057 2.08333333333333e+00 +2050 1885 -2.08333333333333e+00 +2050 2044 -1.87500000000000e+01 +2050 1884 2.08333333333333e+00 +2050 2049 -4.16666666666667e+00 +2050 2043 4.16666666666667e+00 +2050 1943 -2.08333333333333e+00 +2050 2198 2.08333333333333e+00 +2050 2051 -8.33333333333333e+00 +2050 1942 -2.08333333333333e+00 +2050 2407 -6.25000000000000e+00 +2050 1941 2.08333333333333e+00 +2050 2196 -4.16666666666667e+00 +2051 2051 2.91666666666667e+01 +2051 2043 -2.08333333333333e+00 +2051 2050 -8.33333333333333e+00 +2051 2044 4.16666666666667e+00 +2051 2407 4.16666666666667e+00 +2051 1886 -2.08333333333333e+00 +2051 2045 -6.25000000000000e+00 +2051 1885 -2.08333333333333e+00 +2051 2056 2.08333333333333e+00 +2051 1884 2.08333333333333e+00 +2051 2055 -4.16666666666667e+00 +2051 2196 2.08333333333333e+00 +2051 1943 -2.08333333333333e+00 +2051 2408 -1.87500000000000e+01 +2051 1942 -2.08333333333333e+00 +2051 2197 2.08333333333333e+00 +2051 2049 -4.16666666666667e+00 +2051 1941 2.08333333333333e+00 +2051 2406 4.16666666666667e+00 +2052 2052 2.50000000000000e+01 +2052 2306 -2.08333333333333e+00 +2052 2422 2.08333333333333e+00 +2052 2059 -2.08333333333333e+00 +2052 1952 2.08333333333333e+00 +2052 2423 -4.16666666666667e+00 +2052 1951 2.08333333333333e+00 +2052 2053 -4.16666666666667e+00 +2052 2305 4.16666666666667e+00 +2052 1950 -6.25000000000000e+00 +2052 2304 -6.25000000000000e+00 +2052 2054 -4.16666666666667e+00 +2052 1886 2.08333333333333e+00 +2052 2060 4.16666666666667e+00 +2052 1885 2.08333333333333e+00 +2052 2047 -4.16666666666667e+00 +2052 2048 2.08333333333333e+00 +2052 1884 -6.25000000000000e+00 +2052 2058 -6.25000000000000e+00 +2053 2053 2.91666666666667e+01 +2053 2306 4.16666666666667e+00 +2053 2060 4.16666666666667e+00 +2053 2421 2.08333333333333e+00 +2053 2058 -2.08333333333333e+00 +2053 1952 -2.08333333333333e+00 +2053 2423 2.08333333333333e+00 +2053 1951 -2.08333333333333e+00 +2053 2305 -1.87500000000000e+01 +2053 1950 2.08333333333333e+00 +2053 2052 -4.16666666666667e+00 +2053 2304 4.16666666666667e+00 +2053 1886 -2.08333333333333e+00 +2053 2048 2.08333333333333e+00 +2053 2054 -8.33333333333333e+00 +2053 1885 -2.08333333333333e+00 +2053 2059 -6.25000000000000e+00 +2053 1884 2.08333333333333e+00 +2053 2046 -4.16666666666667e+00 +2054 2054 2.91666666666667e+01 +2054 2304 -2.08333333333333e+00 +2054 2053 -8.33333333333333e+00 +2054 2305 4.16666666666667e+00 +2054 2059 4.16666666666667e+00 +2054 1952 -2.08333333333333e+00 +2054 2306 -6.25000000000000e+00 +2054 1951 -2.08333333333333e+00 +2054 2422 2.08333333333333e+00 +2054 1950 2.08333333333333e+00 +2054 2421 -4.16666666666667e+00 +2054 2046 2.08333333333333e+00 +2054 1886 -2.08333333333333e+00 +2054 2060 -1.87500000000000e+01 +2054 1885 -2.08333333333333e+00 +2054 2047 2.08333333333333e+00 +2054 2052 -4.16666666666667e+00 +2054 1884 2.08333333333333e+00 +2054 2058 4.16666666666667e+00 +2055 2055 6.25000000000000e+01 +2055 2056 -8.33333333333333e+00 +2055 2429 -4.16666666666667e+00 +2055 1954 -2.08333333333333e+00 +2055 2428 2.08333333333333e+00 +2055 2060 4.16666666666667e+00 +2055 1885 -2.08333333333333e+00 +2055 2058 -1.87500000000000e+01 +2055 2050 2.08333333333333e+00 +2055 1886 4.16666666666667e+00 +2055 2051 -4.16666666666667e+00 +2055 2057 -8.33333333333333e+00 +2055 2408 4.16666666666667e+00 +2055 1955 4.16666666666667e+00 +2055 2407 4.16666666666667e+00 +2055 2406 -1.87500000000000e+01 +2055 2044 -4.16666666666667e+00 +2055 2047 4.16666666666667e+00 +2055 2048 4.16666666666667e+00 +2055 2045 -4.16666666666667e+00 +2055 1884 -6.25000000000000e+00 +2055 2309 -4.16666666666667e+00 +2055 2204 4.16666666666667e+00 +2055 2308 8.33333333333333e+00 +2055 2203 -8.33333333333333e+00 +2055 2307 -1.25000000000000e+01 +2055 2059 4.16666666666667e+00 +2055 1953 -6.25000000000000e+00 +2056 2056 6.25000000000000e+01 +2056 2429 2.08333333333333e+00 +2056 2058 4.16666666666667e+00 +2056 2055 -8.33333333333333e+00 +2056 1953 -2.08333333333333e+00 +2056 2427 2.08333333333333e+00 +2056 2059 -6.25000000000000e+00 +2056 1884 -2.08333333333333e+00 +2056 2049 2.08333333333333e+00 +2056 2051 2.08333333333333e+00 +2056 2408 -2.08333333333333e+00 +2056 2407 -6.25000000000000e+00 +2056 2406 4.16666666666667e+00 +2056 2043 -4.16666666666667e+00 +2056 2046 4.16666666666667e+00 +2056 2045 -4.16666666666667e+00 +2056 2204 4.16666666666667e+00 +2056 2048 -8.33333333333333e+00 +2056 1886 4.16666666666667e+00 +2056 1885 -6.25000000000000e+00 +2056 2309 8.33333333333333e+00 +2056 2057 -8.33333333333333e+00 +2056 1955 4.16666666666667e+00 +2056 2308 -3.75000000000000e+01 +2056 2060 -2.08333333333333e+00 +2056 1954 -6.25000000000000e+00 +2056 2307 8.33333333333333e+00 +2056 2202 -8.33333333333333e+00 +2057 2057 6.25000000000000e+01 +2057 2428 2.08333333333333e+00 +2057 2427 -4.16666666666667e+00 +2057 2060 -6.25000000000000e+00 +2057 2058 4.16666666666667e+00 +2057 2050 2.08333333333333e+00 +2057 1884 4.16666666666667e+00 +2057 2049 -4.16666666666667e+00 +2057 2408 -6.25000000000000e+00 +2057 2407 -2.08333333333333e+00 +2057 2055 -8.33333333333333e+00 +2057 2406 4.16666666666667e+00 +2057 1953 4.16666666666667e+00 +2057 2044 -4.16666666666667e+00 +2057 2203 4.16666666666667e+00 +2057 1886 -1.87500000000000e+01 +2057 2047 -8.33333333333333e+00 +2057 1885 4.16666666666667e+00 +2057 2046 4.16666666666667e+00 +2057 2043 -4.16666666666667e+00 +2057 2309 -1.25000000000000e+01 +2057 2059 -2.08333333333333e+00 +2057 1955 -1.87500000000000e+01 +2057 2308 8.33333333333333e+00 +2057 2056 -8.33333333333333e+00 +2057 1954 4.16666666666667e+00 +2057 2307 -4.16666666666667e+00 +2057 2202 4.16666666666667e+00 +2058 2058 6.25000000000000e+01 +2058 2305 4.16666666666667e+00 +2058 2306 4.16666666666667e+00 +2058 2054 4.16666666666667e+00 +2058 2052 -6.25000000000000e+00 +2058 2423 4.16666666666667e+00 +2058 2422 4.16666666666667e+00 +2058 2059 -8.33333333333333e+00 +2058 2421 -1.87500000000000e+01 +2058 2312 -4.16666666666667e+00 +2058 2060 -8.33333333333333e+00 +2058 2048 -4.16666666666667e+00 +2058 2309 4.16666666666667e+00 +2058 2056 4.16666666666667e+00 +2058 2311 8.33333333333333e+00 +2058 2308 -8.33333333333333e+00 +2058 2057 4.16666666666667e+00 +2058 1886 -4.16666666666667e+00 +2058 1885 2.08333333333333e+00 +2058 2047 -4.16666666666667e+00 +2058 2055 -1.87500000000000e+01 +2058 2429 4.16666666666667e+00 +2058 1958 -4.16666666666667e+00 +2058 2428 -2.08333333333333e+00 +2058 1957 2.08333333333333e+00 +2058 2427 -6.25000000000000e+00 +2058 2053 -2.08333333333333e+00 +2058 2310 -1.25000000000000e+01 +2059 2059 6.25000000000000e+01 +2059 2052 -2.08333333333333e+00 +2059 2304 4.16666666666667e+00 +2059 2306 -8.33333333333333e+00 +2059 1886 2.08333333333333e+00 +2059 2053 -6.25000000000000e+00 +2059 2423 -2.08333333333333e+00 +2059 1958 2.08333333333333e+00 +2059 2422 -6.25000000000000e+00 +2059 2421 4.16666666666667e+00 +2059 2058 -8.33333333333333e+00 +2059 2057 -2.08333333333333e+00 +2059 2055 4.16666666666667e+00 +2059 2048 -4.16666666666667e+00 +2059 2309 4.16666666666667e+00 +2059 2310 8.33333333333333e+00 +2059 2307 -8.33333333333333e+00 +2059 2056 -6.25000000000000e+00 +2059 1884 2.08333333333333e+00 +2059 2046 -4.16666666666667e+00 +2059 2429 4.16666666666667e+00 +2059 2060 -8.33333333333333e+00 +2059 2312 8.33333333333333e+00 +2059 2428 -6.25000000000000e+00 +2059 2054 4.16666666666667e+00 +2059 2311 -3.75000000000000e+01 +2059 2427 -2.08333333333333e+00 +2059 1956 2.08333333333333e+00 +2060 2060 6.25000000000000e+01 +2060 2305 -8.33333333333333e+00 +2060 2304 4.16666666666667e+00 +2060 2054 -1.87500000000000e+01 +2060 1885 2.08333333333333e+00 +2060 2052 4.16666666666667e+00 +2060 2423 -6.25000000000000e+00 +2060 2422 -2.08333333333333e+00 +2060 1957 2.08333333333333e+00 +2060 2421 4.16666666666667e+00 +2060 2310 -4.16666666666667e+00 +2060 2056 -2.08333333333333e+00 +2060 2058 -8.33333333333333e+00 +2060 2046 -4.16666666666667e+00 +2060 2307 4.16666666666667e+00 +2060 2047 -4.16666666666667e+00 +2060 2308 4.16666666666667e+00 +2060 2057 -6.25000000000000e+00 +2060 2055 4.16666666666667e+00 +2060 1884 -4.16666666666667e+00 +2060 2429 -1.87500000000000e+01 +2060 2053 4.16666666666667e+00 +2060 2312 -1.25000000000000e+01 +2060 2428 4.16666666666667e+00 +2060 2059 -8.33333333333333e+00 +2060 2311 8.33333333333333e+00 +2060 2427 4.16666666666667e+00 +2060 1956 -4.16666666666667e+00 +2061 2061 6.25000000000000e+01 +2061 2425 4.16666666666667e+00 +2061 2426 4.16666666666667e+00 +2061 2065 4.16666666666667e+00 +2061 2064 -6.25000000000000e+00 +2061 2063 -8.33333333333333e+00 +2061 2324 4.16666666666667e+00 +2061 2323 4.16666666666667e+00 +2061 2322 -1.87500000000000e+01 +2061 2329 -4.16666666666667e+00 +2061 2062 -8.33333333333333e+00 +2061 2330 8.33333333333333e+00 +2061 2318 -2.08333333333333e+00 +2061 1928 2.08333333333333e+00 +2061 2317 4.16666666666667e+00 +2061 1927 -4.16666666666667e+00 +2061 2316 -6.25000000000000e+00 +2061 2066 -2.08333333333333e+00 +2061 2328 -1.25000000000000e+01 +2061 1433 4.16666666666667e+00 +2061 1438 -4.16666666666667e+00 +2061 1582 4.16666666666667e+00 +2061 1583 -8.33333333333333e+00 +2061 1283 2.08333333333333e+00 +2061 1439 -4.16666666666667e+00 +2061 1432 4.16666666666667e+00 +2061 1282 -4.16666666666667e+00 +2061 1431 -1.87500000000000e+01 +2062 2062 6.25000000000000e+01 +2062 2424 4.16666666666667e+00 +2062 2426 -8.33333333333333e+00 +2062 2065 -1.87500000000000e+01 +2062 2064 4.16666666666667e+00 +2062 2324 -2.08333333333333e+00 +2062 1928 2.08333333333333e+00 +2062 2323 -6.25000000000000e+00 +2062 2322 4.16666666666667e+00 +2062 2328 -4.16666666666667e+00 +2062 2061 -8.33333333333333e+00 +2062 2318 4.16666666666667e+00 +2062 2063 -8.33333333333333e+00 +2062 2330 8.33333333333333e+00 +2062 2317 -1.87500000000000e+01 +2062 2066 4.16666666666667e+00 +2062 2329 -1.25000000000000e+01 +2062 2316 4.16666666666667e+00 +2062 1926 -4.16666666666667e+00 +2062 1283 2.08333333333333e+00 +2062 1433 -2.08333333333333e+00 +2062 1437 -4.16666666666667e+00 +2062 1581 4.16666666666667e+00 +2062 1439 -4.16666666666667e+00 +2062 1583 4.16666666666667e+00 +2062 1432 -6.25000000000000e+00 +2062 1431 4.16666666666667e+00 +2062 1281 -4.16666666666667e+00 +2063 2063 6.25000000000000e+01 +2063 2065 4.16666666666667e+00 +2063 2425 -8.33333333333333e+00 +2063 2424 4.16666666666667e+00 +2063 2066 -6.25000000000000e+00 +2063 2324 -6.25000000000000e+00 +2063 2323 -2.08333333333333e+00 +2063 1927 2.08333333333333e+00 +2063 2061 -8.33333333333333e+00 +2063 2322 4.16666666666667e+00 +2063 2328 8.33333333333333e+00 +2063 2318 -6.25000000000000e+00 +2063 2064 -2.08333333333333e+00 +2063 2330 -3.75000000000000e+01 +2063 2317 4.16666666666667e+00 +2063 2062 -8.33333333333333e+00 +2063 2329 8.33333333333333e+00 +2063 2316 -2.08333333333333e+00 +2063 1926 2.08333333333333e+00 +2063 1282 2.08333333333333e+00 +2063 1432 -2.08333333333333e+00 +2063 1431 4.16666666666667e+00 +2063 1438 -4.16666666666667e+00 +2063 1582 4.16666666666667e+00 +2063 1581 -8.33333333333333e+00 +2063 1433 -6.25000000000000e+00 +2063 1281 2.08333333333333e+00 +2063 1437 -4.16666666666667e+00 +2064 2064 2.50000000000000e+01 +2064 2063 -2.08333333333333e+00 +2064 2425 -2.08333333333333e+00 +2064 2065 -4.16666666666667e+00 +2064 2062 4.16666666666667e+00 +2064 2061 -6.25000000000000e+00 +2064 2066 -4.16666666666667e+00 +2064 1952 2.08333333333333e+00 +2064 2426 4.16666666666667e+00 +2064 1951 2.08333333333333e+00 +2064 2323 -4.16666666666667e+00 +2064 2324 2.08333333333333e+00 +2064 1950 -6.25000000000000e+00 +2064 2424 -6.25000000000000e+00 +2064 1438 2.08333333333333e+00 +2064 1283 2.08333333333333e+00 +2064 1439 -4.16666666666667e+00 +2064 1282 2.08333333333333e+00 +2064 1281 -6.25000000000000e+00 +2065 2065 2.91666666666667e+01 +2065 2063 4.16666666666667e+00 +2065 2426 4.16666666666667e+00 +2065 2424 -2.08333333333333e+00 +2065 2062 -1.87500000000000e+01 +2065 2064 -4.16666666666667e+00 +2065 2061 4.16666666666667e+00 +2065 1952 -2.08333333333333e+00 +2065 2324 2.08333333333333e+00 +2065 2066 -8.33333333333333e+00 +2065 1951 -2.08333333333333e+00 +2065 2425 -6.25000000000000e+00 +2065 1950 2.08333333333333e+00 +2065 2322 -4.16666666666667e+00 +2065 1437 2.08333333333333e+00 +2065 1283 -2.08333333333333e+00 +2065 1439 2.08333333333333e+00 +2065 1282 -2.08333333333333e+00 +2065 1281 2.08333333333333e+00 +2066 2066 2.91666666666667e+01 +2066 2061 -2.08333333333333e+00 +2066 2065 -8.33333333333333e+00 +2066 2062 4.16666666666667e+00 +2066 2425 4.16666666666667e+00 +2066 2063 -6.25000000000000e+00 +2066 2322 2.08333333333333e+00 +2066 1952 -2.08333333333333e+00 +2066 2426 -1.87500000000000e+01 +2066 1951 -2.08333333333333e+00 +2066 2323 2.08333333333333e+00 +2066 2064 -4.16666666666667e+00 +2066 1950 2.08333333333333e+00 +2066 2424 4.16666666666667e+00 +2066 1283 -2.08333333333333e+00 +2066 1282 -2.08333333333333e+00 +2066 1438 2.08333333333333e+00 +2066 1281 2.08333333333333e+00 +2066 1437 -4.16666666666667e+00 +2067 2067 1.00000000000000e+00 +2067 2075 0.00000000000000e+00 +2067 2219 0.00000000000000e+00 +2067 2218 0.00000000000000e+00 +2067 2217 0.00000000000000e+00 +2067 2222 0.00000000000000e+00 +2067 2078 0.00000000000000e+00 +2067 2071 0.00000000000000e+00 +2067 2077 0.00000000000000e+00 +2067 1889 0.00000000000000e+00 +2067 2072 0.00000000000000e+00 +2067 1887 0.00000000000000e+00 +2067 2069 0.00000000000000e+00 +2067 2216 0.00000000000000e+00 +2067 1910 0.00000000000000e+00 +2067 2215 0.00000000000000e+00 +2067 2221 0.00000000000000e+00 +2067 2074 0.00000000000000e+00 +2067 2214 0.00000000000000e+00 +2067 1908 0.00000000000000e+00 +2068 2068 1.00000000000000e+00 +2068 2075 0.00000000000000e+00 +2068 1889 0.00000000000000e+00 +2068 2219 0.00000000000000e+00 +2068 2069 0.00000000000000e+00 +2068 1910 0.00000000000000e+00 +2068 2218 0.00000000000000e+00 +2068 2217 0.00000000000000e+00 +2068 2070 0.00000000000000e+00 +2068 2076 0.00000000000000e+00 +2068 2072 0.00000000000000e+00 +2068 2078 0.00000000000000e+00 +2068 1888 0.00000000000000e+00 +2068 2216 0.00000000000000e+00 +2068 2222 0.00000000000000e+00 +2068 2073 0.00000000000000e+00 +2068 2215 0.00000000000000e+00 +2068 1909 0.00000000000000e+00 +2068 2214 0.00000000000000e+00 +2068 2220 0.00000000000000e+00 +2069 2069 1.00000000000000e+00 +2069 1888 0.00000000000000e+00 +2069 2073 0.00000000000000e+00 +2069 2219 0.00000000000000e+00 +2069 2218 0.00000000000000e+00 +2069 2068 0.00000000000000e+00 +2069 1909 0.00000000000000e+00 +2069 2217 0.00000000000000e+00 +2069 2220 0.00000000000000e+00 +2069 2076 0.00000000000000e+00 +2069 1889 0.00000000000000e+00 +2069 2071 0.00000000000000e+00 +2069 2077 0.00000000000000e+00 +2069 1887 0.00000000000000e+00 +2069 2070 0.00000000000000e+00 +2069 2074 0.00000000000000e+00 +2069 2216 0.00000000000000e+00 +2069 1910 0.00000000000000e+00 +2069 2215 0.00000000000000e+00 +2069 2221 0.00000000000000e+00 +2069 2067 0.00000000000000e+00 +2069 2214 0.00000000000000e+00 +2069 1908 0.00000000000000e+00 +2070 2070 2.50000000000000e+01 +2070 2068 0.00000000000000e+00 +2070 2441 2.08333333333333e+00 +2070 2078 -2.08333333333333e+00 +2070 1889 0.00000000000000e+00 +2070 2069 0.00000000000000e+00 +2070 1888 0.00000000000000e+00 +2070 2071 -4.16666666666667e+00 +2070 2077 4.16666666666667e+00 +2070 1887 0.00000000000000e+00 +2070 2076 -6.25000000000000e+00 +2070 2072 -4.16666666666667e+00 +2070 1961 2.08333333333333e+00 +2070 2216 4.16666666666667e+00 +2070 1960 2.08333333333333e+00 +2070 2440 -4.16666666666667e+00 +2070 2215 -2.08333333333333e+00 +2070 1959 -6.25000000000000e+00 +2070 2214 -6.25000000000000e+00 +2071 2071 2.91666666666667e+01 +2071 2067 0.00000000000000e+00 +2071 2216 4.16666666666667e+00 +2071 2072 -8.33333333333333e+00 +2071 2078 4.16666666666667e+00 +2071 1889 0.00000000000000e+00 +2071 2069 0.00000000000000e+00 +2071 1888 0.00000000000000e+00 +2071 2077 -1.87500000000000e+01 +2071 1887 0.00000000000000e+00 +2071 2070 -4.16666666666667e+00 +2071 2076 4.16666666666667e+00 +2071 1961 -2.08333333333333e+00 +2071 2441 2.08333333333333e+00 +2071 2214 -2.08333333333333e+00 +2071 1960 -2.08333333333333e+00 +2071 2215 -6.25000000000000e+00 +2071 1959 2.08333333333333e+00 +2071 2439 -4.16666666666667e+00 +2072 2072 2.91666666666667e+01 +2072 2071 -8.33333333333333e+00 +2072 2077 4.16666666666667e+00 +2072 2439 2.08333333333333e+00 +2072 2076 -2.08333333333333e+00 +2072 1889 0.00000000000000e+00 +2072 2078 -6.25000000000000e+00 +2072 1888 0.00000000000000e+00 +2072 2068 0.00000000000000e+00 +2072 1887 0.00000000000000e+00 +2072 2067 0.00000000000000e+00 +2072 2215 4.16666666666667e+00 +2072 1961 -2.08333333333333e+00 +2072 2216 -1.87500000000000e+01 +2072 1960 -2.08333333333333e+00 +2072 2440 2.08333333333333e+00 +2072 2070 -4.16666666666667e+00 +2072 1959 2.08333333333333e+00 +2072 2214 4.16666666666667e+00 +2073 2073 1.00000000000000e+00 +2073 2218 0.00000000000000e+00 +2073 2075 0.00000000000000e+00 +2073 2219 0.00000000000000e+00 +2073 2078 0.00000000000000e+00 +2073 1964 0.00000000000000e+00 +2073 2447 0.00000000000000e+00 +2073 1963 0.00000000000000e+00 +2073 2446 0.00000000000000e+00 +2073 1962 0.00000000000000e+00 +2073 2217 0.00000000000000e+00 +2073 1889 0.00000000000000e+00 +2073 2069 0.00000000000000e+00 +2073 2074 0.00000000000000e+00 +2073 1888 0.00000000000000e+00 +2073 2077 0.00000000000000e+00 +2073 2068 0.00000000000000e+00 +2073 1887 0.00000000000000e+00 +2073 2076 0.00000000000000e+00 +2074 2074 1.00000000000000e+00 +2074 2217 0.00000000000000e+00 +2074 2447 0.00000000000000e+00 +2074 2078 0.00000000000000e+00 +2074 1964 0.00000000000000e+00 +2074 2075 0.00000000000000e+00 +2074 2219 0.00000000000000e+00 +2074 1963 0.00000000000000e+00 +2074 2218 0.00000000000000e+00 +2074 1962 0.00000000000000e+00 +2074 2445 0.00000000000000e+00 +2074 1889 0.00000000000000e+00 +2074 2069 0.00000000000000e+00 +2074 2067 0.00000000000000e+00 +2074 1888 0.00000000000000e+00 +2074 2077 0.00000000000000e+00 +2074 2073 0.00000000000000e+00 +2074 1887 0.00000000000000e+00 +2074 2076 0.00000000000000e+00 +2075 2075 1.00000000000000e+00 +2075 2077 0.00000000000000e+00 +2075 2073 0.00000000000000e+00 +2075 2217 0.00000000000000e+00 +2075 2076 0.00000000000000e+00 +2075 1964 0.00000000000000e+00 +2075 2219 0.00000000000000e+00 +2075 1963 0.00000000000000e+00 +2075 2074 0.00000000000000e+00 +2075 2218 0.00000000000000e+00 +2075 1962 0.00000000000000e+00 +2075 2445 0.00000000000000e+00 +2075 2446 0.00000000000000e+00 +2075 1889 0.00000000000000e+00 +2075 2078 0.00000000000000e+00 +2075 1888 0.00000000000000e+00 +2075 2068 0.00000000000000e+00 +2075 1887 0.00000000000000e+00 +2075 2067 0.00000000000000e+00 +2076 2076 6.25000000000000e+01 +2076 2219 0.00000000000000e+00 +2076 2218 0.00000000000000e+00 +2076 1889 0.00000000000000e+00 +2076 2074 0.00000000000000e+00 +2076 2073 0.00000000000000e+00 +2076 2447 -2.08333333333333e+00 +2076 1967 2.08333333333333e+00 +2076 2446 4.16666666666667e+00 +2076 2445 -6.25000000000000e+00 +2076 2069 0.00000000000000e+00 +2076 2068 0.00000000000000e+00 +2076 2216 4.16666666666667e+00 +2076 2072 -2.08333333333333e+00 +2076 2077 -8.33333333333333e+00 +2076 2215 4.16666666666667e+00 +2076 2221 -4.16666666666667e+00 +2076 1888 0.00000000000000e+00 +2076 2071 4.16666666666667e+00 +2076 2070 -6.25000000000000e+00 +2076 2078 -8.33333333333333e+00 +2076 2441 4.16666666666667e+00 +2076 2222 8.33333333333333e+00 +2076 2440 4.16666666666667e+00 +2076 1966 -4.16666666666667e+00 +2076 2075 0.00000000000000e+00 +2076 2439 -1.87500000000000e+01 +2076 2220 -1.25000000000000e+01 +2077 2077 6.25000000000000e+01 +2077 2219 0.00000000000000e+00 +2077 2217 0.00000000000000e+00 +2077 2074 0.00000000000000e+00 +2077 2073 0.00000000000000e+00 +2077 2447 4.16666666666667e+00 +2077 2078 -8.33333333333333e+00 +2077 2446 -1.87500000000000e+01 +2077 2445 4.16666666666667e+00 +2077 2067 0.00000000000000e+00 +2077 2072 4.16666666666667e+00 +2077 2076 -8.33333333333333e+00 +2077 2216 -8.33333333333333e+00 +2077 2222 8.33333333333333e+00 +2077 2214 4.16666666666667e+00 +2077 2220 -4.16666666666667e+00 +2077 1889 0.00000000000000e+00 +2077 2069 0.00000000000000e+00 +2077 2071 -1.87500000000000e+01 +2077 1887 0.00000000000000e+00 +2077 2070 4.16666666666667e+00 +2077 2441 -2.08333333333333e+00 +2077 1967 2.08333333333333e+00 +2077 2075 0.00000000000000e+00 +2077 2440 -6.25000000000000e+00 +2077 2221 -1.25000000000000e+01 +2077 2439 4.16666666666667e+00 +2077 1965 -4.16666666666667e+00 +2078 2078 6.25000000000000e+01 +2078 2218 0.00000000000000e+00 +2078 2073 0.00000000000000e+00 +2078 2217 0.00000000000000e+00 +2078 2075 0.00000000000000e+00 +2078 1887 0.00000000000000e+00 +2078 2447 -6.25000000000000e+00 +2078 2446 4.16666666666667e+00 +2078 2077 -8.33333333333333e+00 +2078 2445 -2.08333333333333e+00 +2078 1965 2.08333333333333e+00 +2078 2067 0.00000000000000e+00 +2078 2071 4.16666666666667e+00 +2078 2214 4.16666666666667e+00 +2078 2070 -2.08333333333333e+00 +2078 2215 -8.33333333333333e+00 +2078 2221 8.33333333333333e+00 +2078 2072 -6.25000000000000e+00 +2078 1888 0.00000000000000e+00 +2078 2068 0.00000000000000e+00 +2078 2074 0.00000000000000e+00 +2078 2441 -6.25000000000000e+00 +2078 2222 -3.75000000000000e+01 +2078 2440 -2.08333333333333e+00 +2078 1966 2.08333333333333e+00 +2078 2076 -8.33333333333333e+00 +2078 2439 4.16666666666667e+00 +2078 2220 8.33333333333333e+00 +2079 2079 6.25000000000000e+01 +2079 2345 4.16666666666667e+00 +2079 2344 -8.33333333333333e+00 +2079 2084 4.16666666666667e+00 +2079 1891 2.08333333333333e+00 +2079 2082 -1.87500000000000e+01 +2079 2228 4.16666666666667e+00 +2079 2227 -2.08333333333333e+00 +2079 1912 2.08333333333333e+00 +2079 2226 -6.25000000000000e+00 +2079 2240 -4.16666666666667e+00 +2079 2081 -8.33333333333333e+00 +2079 2086 -2.08333333333333e+00 +2079 2093 -4.16666666666667e+00 +2079 2444 4.16666666666667e+00 +2079 2092 -4.16666666666667e+00 +2079 2443 4.16666666666667e+00 +2079 2087 4.16666666666667e+00 +2079 1892 -4.16666666666667e+00 +2079 2085 -6.25000000000000e+00 +2079 2234 4.16666666666667e+00 +2079 1913 -4.16666666666667e+00 +2079 2233 4.16666666666667e+00 +2079 2080 -8.33333333333333e+00 +2079 2239 8.33333333333333e+00 +2079 2232 -1.87500000000000e+01 +2079 2083 4.16666666666667e+00 +2079 2238 -1.25000000000000e+01 +2080 2080 6.25000000000000e+01 +2080 2345 4.16666666666667e+00 +2080 2082 4.16666666666667e+00 +2080 2343 -8.33333333333333e+00 +2080 2083 -6.25000000000000e+00 +2080 1890 2.08333333333333e+00 +2080 2228 4.16666666666667e+00 +2080 2081 -8.33333333333333e+00 +2080 2227 -6.25000000000000e+00 +2080 2226 -2.08333333333333e+00 +2080 1911 2.08333333333333e+00 +2080 2085 -2.08333333333333e+00 +2080 2087 4.16666666666667e+00 +2080 2240 8.33333333333333e+00 +2080 2444 -8.33333333333333e+00 +2080 2091 -4.16666666666667e+00 +2080 2442 4.16666666666667e+00 +2080 1892 2.08333333333333e+00 +2080 2093 -4.16666666666667e+00 +2080 2086 -6.25000000000000e+00 +2080 2234 -2.08333333333333e+00 +2080 1913 2.08333333333333e+00 +2080 2233 -6.25000000000000e+00 +2080 2084 -2.08333333333333e+00 +2080 2239 -3.75000000000000e+01 +2080 2232 4.16666666666667e+00 +2080 2079 -8.33333333333333e+00 +2080 2238 8.33333333333333e+00 +2081 2081 6.25000000000000e+01 +2081 2344 4.16666666666667e+00 +2081 2343 4.16666666666667e+00 +2081 2084 -6.25000000000000e+00 +2081 2082 4.16666666666667e+00 +2081 2228 -1.87500000000000e+01 +2081 2227 4.16666666666667e+00 +2081 2080 -8.33333333333333e+00 +2081 2226 4.16666666666667e+00 +2081 2238 -4.16666666666667e+00 +2081 2079 -8.33333333333333e+00 +2081 2086 4.16666666666667e+00 +2081 2091 -4.16666666666667e+00 +2081 2442 4.16666666666667e+00 +2081 2239 8.33333333333333e+00 +2081 2443 -8.33333333333333e+00 +2081 2087 -1.87500000000000e+01 +2081 1891 2.08333333333333e+00 +2081 2092 -4.16666666666667e+00 +2081 2085 4.16666666666667e+00 +2081 1890 -4.16666666666667e+00 +2081 2234 -6.25000000000000e+00 +2081 2083 -2.08333333333333e+00 +2081 2240 -1.25000000000000e+01 +2081 2233 -2.08333333333333e+00 +2081 1912 2.08333333333333e+00 +2081 2232 4.16666666666667e+00 +2081 1911 -4.16666666666667e+00 +2082 2082 6.25000000000000e+01 +2082 2096 -4.16666666666667e+00 +2082 2089 2.08333333333333e+00 +2082 2095 -4.16666666666667e+00 +2082 2090 -4.16666666666667e+00 +2082 2342 4.16666666666667e+00 +2082 2341 4.16666666666667e+00 +2082 2347 -8.33333333333333e+00 +2082 2340 -1.87500000000000e+01 +2082 2093 4.16666666666667e+00 +2082 2345 -4.16666666666667e+00 +2082 2083 -8.33333333333333e+00 +2082 2344 8.33333333333333e+00 +2082 2080 4.16666666666667e+00 +2082 1931 4.16666666666667e+00 +2082 2228 -4.16666666666667e+00 +2082 1930 -2.08333333333333e+00 +2082 2227 2.08333333333333e+00 +2082 1929 -6.25000000000000e+00 +2082 2343 -1.25000000000000e+01 +2082 2084 -8.33333333333333e+00 +2082 1892 4.16666666666667e+00 +2082 2081 4.16666666666667e+00 +2082 1891 -2.08333333333333e+00 +2082 2092 4.16666666666667e+00 +2082 2348 4.16666666666667e+00 +2082 1890 -6.25000000000000e+00 +2082 2079 -1.87500000000000e+01 +2083 2083 6.25000000000000e+01 +2083 2094 -4.16666666666667e+00 +2083 2090 2.08333333333333e+00 +2083 2096 -4.16666666666667e+00 +2083 2342 -2.08333333333333e+00 +2083 2348 4.16666666666667e+00 +2083 2341 -6.25000000000000e+00 +2083 2340 4.16666666666667e+00 +2083 2346 -8.33333333333333e+00 +2083 2228 2.08333333333333e+00 +2083 2081 -2.08333333333333e+00 +2083 2082 -8.33333333333333e+00 +2083 2343 8.33333333333333e+00 +2083 2079 4.16666666666667e+00 +2083 1931 4.16666666666667e+00 +2083 2084 -8.33333333333333e+00 +2083 2345 8.33333333333333e+00 +2083 1930 -6.25000000000000e+00 +2083 2344 -3.75000000000000e+01 +2083 1929 -2.08333333333333e+00 +2083 2226 2.08333333333333e+00 +2083 1892 4.16666666666667e+00 +2083 2093 -8.33333333333333e+00 +2083 2088 2.08333333333333e+00 +2083 1891 -6.25000000000000e+00 +2083 2080 -6.25000000000000e+00 +2083 1890 -2.08333333333333e+00 +2083 2091 4.16666666666667e+00 +2084 2084 6.25000000000000e+01 +2084 2094 -4.16666666666667e+00 +2084 2089 2.08333333333333e+00 +2084 2095 -4.16666666666667e+00 +2084 2088 -4.16666666666667e+00 +2084 2342 -6.25000000000000e+00 +2084 2341 -2.08333333333333e+00 +2084 2347 4.16666666666667e+00 +2084 2340 4.16666666666667e+00 +2084 2091 4.16666666666667e+00 +2084 2343 -4.16666666666667e+00 +2084 2227 2.08333333333333e+00 +2084 2080 -2.08333333333333e+00 +2084 1931 -1.87500000000000e+01 +2084 2345 -1.25000000000000e+01 +2084 1930 4.16666666666667e+00 +2084 2083 -8.33333333333333e+00 +2084 2344 8.33333333333333e+00 +2084 1929 4.16666666666667e+00 +2084 2226 -4.16666666666667e+00 +2084 2346 4.16666666666667e+00 +2084 1892 -1.87500000000000e+01 +2084 2081 -6.25000000000000e+00 +2084 1891 4.16666666666667e+00 +2084 2092 -8.33333333333333e+00 +2084 2082 -8.33333333333333e+00 +2084 1890 4.16666666666667e+00 +2084 2079 4.16666666666667e+00 +2085 2085 2.50000000000000e+01 +2085 2233 2.08333333333333e+00 +2085 2093 2.08333333333333e+00 +2085 2444 -2.08333333333333e+00 +2085 1961 2.08333333333333e+00 +2085 2234 -4.16666666666667e+00 +2085 1960 2.08333333333333e+00 +2085 2086 -4.16666666666667e+00 +2085 2443 4.16666666666667e+00 +2085 1959 -6.25000000000000e+00 +2085 2442 -6.25000000000000e+00 +2085 2087 -4.16666666666667e+00 +2085 1892 2.08333333333333e+00 +2085 2081 4.16666666666667e+00 +2085 1891 2.08333333333333e+00 +2085 2092 -4.16666666666667e+00 +2085 2080 -2.08333333333333e+00 +2085 1890 -6.25000000000000e+00 +2085 2079 -6.25000000000000e+00 +2086 2086 2.91666666666667e+01 +2086 2232 2.08333333333333e+00 +2086 2081 4.16666666666667e+00 +2086 2087 -8.33333333333333e+00 +2086 2444 4.16666666666667e+00 +2086 1961 -2.08333333333333e+00 +2086 2234 2.08333333333333e+00 +2086 1960 -2.08333333333333e+00 +2086 2443 -1.87500000000000e+01 +2086 1959 2.08333333333333e+00 +2086 2085 -4.16666666666667e+00 +2086 2442 4.16666666666667e+00 +2086 1892 -2.08333333333333e+00 +2086 2093 2.08333333333333e+00 +2086 2079 -2.08333333333333e+00 +2086 1891 -2.08333333333333e+00 +2086 2080 -6.25000000000000e+00 +2086 1890 2.08333333333333e+00 +2086 2091 -4.16666666666667e+00 +2087 2087 2.91666666666667e+01 +2087 2086 -8.33333333333333e+00 +2087 2443 4.16666666666667e+00 +2087 2091 2.08333333333333e+00 +2087 2442 -2.08333333333333e+00 +2087 1961 -2.08333333333333e+00 +2087 2444 -6.25000000000000e+00 +2087 1960 -2.08333333333333e+00 +2087 2233 2.08333333333333e+00 +2087 1959 2.08333333333333e+00 +2087 2232 -4.16666666666667e+00 +2087 2080 4.16666666666667e+00 +2087 1892 -2.08333333333333e+00 +2087 2081 -1.87500000000000e+01 +2087 1891 -2.08333333333333e+00 +2087 2092 2.08333333333333e+00 +2087 2085 -4.16666666666667e+00 +2087 1890 2.08333333333333e+00 +2087 2079 4.16666666666667e+00 +2088 2088 2.50000000000000e+01 +2088 2083 2.08333333333333e+00 +2088 2459 2.08333333333333e+00 +2088 2096 -2.08333333333333e+00 +2088 1892 2.08333333333333e+00 +2088 2084 -4.16666666666667e+00 +2088 1891 2.08333333333333e+00 +2088 2089 -4.16666666666667e+00 +2088 2095 4.16666666666667e+00 +2088 1890 -6.25000000000000e+00 +2088 2094 -6.25000000000000e+00 +2088 2090 -4.16666666666667e+00 +2088 1970 2.08333333333333e+00 +2088 2342 4.16666666666667e+00 +2088 1969 2.08333333333333e+00 +2088 2458 -4.16666666666667e+00 +2088 2341 -2.08333333333333e+00 +2088 1968 -6.25000000000000e+00 +2088 2340 -6.25000000000000e+00 +2089 2089 2.91666666666667e+01 +2089 2082 2.08333333333333e+00 +2089 2342 4.16666666666667e+00 +2089 2090 -8.33333333333333e+00 +2089 2096 4.16666666666667e+00 +2089 1892 -2.08333333333333e+00 +2089 2084 2.08333333333333e+00 +2089 1891 -2.08333333333333e+00 +2089 2095 -1.87500000000000e+01 +2089 1890 2.08333333333333e+00 +2089 2088 -4.16666666666667e+00 +2089 2094 4.16666666666667e+00 +2089 1970 -2.08333333333333e+00 +2089 2459 2.08333333333333e+00 +2089 2340 -2.08333333333333e+00 +2089 1969 -2.08333333333333e+00 +2089 2341 -6.25000000000000e+00 +2089 1968 2.08333333333333e+00 +2089 2457 -4.16666666666667e+00 +2090 2090 2.91666666666667e+01 +2090 2089 -8.33333333333333e+00 +2090 2095 4.16666666666667e+00 +2090 2457 2.08333333333333e+00 +2090 2094 -2.08333333333333e+00 +2090 1892 -2.08333333333333e+00 +2090 2096 -6.25000000000000e+00 +2090 1891 -2.08333333333333e+00 +2090 2083 2.08333333333333e+00 +2090 1890 2.08333333333333e+00 +2090 2082 -4.16666666666667e+00 +2090 2341 4.16666666666667e+00 +2090 1970 -2.08333333333333e+00 +2090 2342 -1.87500000000000e+01 +2090 1969 -2.08333333333333e+00 +2090 2458 2.08333333333333e+00 +2090 2088 -4.16666666666667e+00 +2090 1968 2.08333333333333e+00 +2090 2340 4.16666666666667e+00 +2091 2091 6.25000000000000e+01 +2091 2096 4.16666666666667e+00 +2091 1973 -2.08333333333333e+00 +2091 2465 2.08333333333333e+00 +2091 2464 -4.16666666666667e+00 +2091 1892 -2.08333333333333e+00 +2091 2095 4.16666666666667e+00 +2091 2094 -1.87500000000000e+01 +2091 2084 4.16666666666667e+00 +2091 2083 4.16666666666667e+00 +2091 2345 8.33333333333333e+00 +2091 2344 -4.16666666666667e+00 +2091 2343 -1.25000000000000e+01 +2091 2081 -4.16666666666667e+00 +2091 2087 2.08333333333333e+00 +2091 2080 -4.16666666666667e+00 +2091 2239 4.16666666666667e+00 +2091 2086 -4.16666666666667e+00 +2091 1891 4.16666666666667e+00 +2091 1890 -6.25000000000000e+00 +2091 2444 4.16666666666667e+00 +2091 2240 -8.33333333333333e+00 +2091 2443 4.16666666666667e+00 +2091 2092 -8.33333333333333e+00 +2091 1972 4.16666666666667e+00 +2091 2442 -1.87500000000000e+01 +2091 2093 -8.33333333333333e+00 +2091 1971 -6.25000000000000e+00 +2092 2092 6.25000000000000e+01 +2092 2096 -2.08333333333333e+00 +2092 2463 -4.16666666666667e+00 +2092 2095 -6.25000000000000e+00 +2092 2094 4.16666666666667e+00 +2092 2084 -8.33333333333333e+00 +2092 1892 4.16666666666667e+00 +2092 2082 4.16666666666667e+00 +2092 2345 8.33333333333333e+00 +2092 2093 -8.33333333333333e+00 +2092 1973 4.16666666666667e+00 +2092 2344 -1.25000000000000e+01 +2092 2343 -4.16666666666667e+00 +2092 2079 -4.16666666666667e+00 +2092 2238 4.16666666666667e+00 +2092 2087 2.08333333333333e+00 +2092 2081 -4.16666666666667e+00 +2092 1891 -1.87500000000000e+01 +2092 2085 -4.16666666666667e+00 +2092 1890 4.16666666666667e+00 +2092 2444 -2.08333333333333e+00 +2092 2240 4.16666666666667e+00 +2092 2443 -6.25000000000000e+00 +2092 2465 2.08333333333333e+00 +2092 1972 -1.87500000000000e+01 +2092 2442 4.16666666666667e+00 +2092 2091 -8.33333333333333e+00 +2092 1971 4.16666666666667e+00 +2093 2093 6.25000000000000e+01 +2093 2095 -2.08333333333333e+00 +2093 2091 -8.33333333333333e+00 +2093 2094 4.16666666666667e+00 +2093 1971 -2.08333333333333e+00 +2093 2463 2.08333333333333e+00 +2093 2096 -6.25000000000000e+00 +2093 1890 -2.08333333333333e+00 +2093 2082 4.16666666666667e+00 +2093 2083 -8.33333333333333e+00 +2093 1891 4.16666666666667e+00 +2093 2345 -3.75000000000000e+01 +2093 2344 8.33333333333333e+00 +2093 2092 -8.33333333333333e+00 +2093 1972 4.16666666666667e+00 +2093 2343 8.33333333333333e+00 +2093 2079 -4.16666666666667e+00 +2093 2085 2.08333333333333e+00 +2093 1892 -6.25000000000000e+00 +2093 2086 2.08333333333333e+00 +2093 2080 -4.16666666666667e+00 +2093 2444 -6.25000000000000e+00 +2093 2464 2.08333333333333e+00 +2093 1973 -6.25000000000000e+00 +2093 2443 -2.08333333333333e+00 +2093 2239 4.16666666666667e+00 +2093 2442 4.16666666666667e+00 +2093 2238 -8.33333333333333e+00 +2094 2094 6.25000000000000e+01 +2094 2345 -8.33333333333333e+00 +2094 2344 4.16666666666667e+00 +2094 1892 2.08333333333333e+00 +2094 2092 4.16666666666667e+00 +2094 2091 -1.87500000000000e+01 +2094 2465 -2.08333333333333e+00 +2094 1976 2.08333333333333e+00 +2094 2464 4.16666666666667e+00 +2094 2463 -6.25000000000000e+00 +2094 2084 -4.16666666666667e+00 +2094 2083 -4.16666666666667e+00 +2094 2342 4.16666666666667e+00 +2094 2090 -2.08333333333333e+00 +2094 2095 -8.33333333333333e+00 +2094 2341 4.16666666666667e+00 +2094 2347 -4.16666666666667e+00 +2094 1891 -4.16666666666667e+00 +2094 2089 4.16666666666667e+00 +2094 2088 -6.25000000000000e+00 +2094 2096 -8.33333333333333e+00 +2094 2459 4.16666666666667e+00 +2094 2348 8.33333333333333e+00 +2094 2458 4.16666666666667e+00 +2094 1975 -4.16666666666667e+00 +2094 2093 4.16666666666667e+00 +2094 2457 -1.87500000000000e+01 +2094 2346 -1.25000000000000e+01 +2095 2095 6.25000000000000e+01 +2095 2345 4.16666666666667e+00 +2095 2343 4.16666666666667e+00 +2095 2092 -6.25000000000000e+00 +2095 2091 4.16666666666667e+00 +2095 2465 4.16666666666667e+00 +2095 2096 -8.33333333333333e+00 +2095 2464 -1.87500000000000e+01 +2095 2463 4.16666666666667e+00 +2095 2082 -4.16666666666667e+00 +2095 2090 4.16666666666667e+00 +2095 2094 -8.33333333333333e+00 +2095 2342 -8.33333333333333e+00 +2095 2348 8.33333333333333e+00 +2095 2340 4.16666666666667e+00 +2095 2346 -4.16666666666667e+00 +2095 1892 2.08333333333333e+00 +2095 2084 -4.16666666666667e+00 +2095 2089 -1.87500000000000e+01 +2095 1890 -4.16666666666667e+00 +2095 2088 4.16666666666667e+00 +2095 2459 -2.08333333333333e+00 +2095 1976 2.08333333333333e+00 +2095 2093 -2.08333333333333e+00 +2095 2458 -6.25000000000000e+00 +2095 2347 -1.25000000000000e+01 +2095 2457 4.16666666666667e+00 +2095 1974 -4.16666666666667e+00 +2096 2096 6.25000000000000e+01 +2096 2344 4.16666666666667e+00 +2096 2091 4.16666666666667e+00 +2096 2343 -8.33333333333333e+00 +2096 2093 -6.25000000000000e+00 +2096 1890 2.08333333333333e+00 +2096 2465 -6.25000000000000e+00 +2096 2464 4.16666666666667e+00 +2096 2095 -8.33333333333333e+00 +2096 2463 -2.08333333333333e+00 +2096 1974 2.08333333333333e+00 +2096 2082 -4.16666666666667e+00 +2096 2089 4.16666666666667e+00 +2096 2340 4.16666666666667e+00 +2096 2088 -2.08333333333333e+00 +2096 2341 -8.33333333333333e+00 +2096 2347 8.33333333333333e+00 +2096 2090 -6.25000000000000e+00 +2096 1891 2.08333333333333e+00 +2096 2083 -4.16666666666667e+00 +2096 2092 -2.08333333333333e+00 +2096 2459 -6.25000000000000e+00 +2096 2348 -3.75000000000000e+01 +2096 2458 -2.08333333333333e+00 +2096 1975 2.08333333333333e+00 +2096 2094 -8.33333333333333e+00 +2096 2457 4.16666666666667e+00 +2096 2346 8.33333333333333e+00 +2097 2097 6.25000000000000e+01 +2097 2354 4.16666666666667e+00 +2097 2353 -2.08333333333333e+00 +2097 1933 2.08333333333333e+00 +2097 2352 -6.25000000000000e+00 +2097 2366 -4.16666666666667e+00 +2097 2099 -8.33333333333333e+00 +2097 2101 -2.08333333333333e+00 +2097 2462 4.16666666666667e+00 +2097 2461 4.16666666666667e+00 +2097 2102 4.16666666666667e+00 +2097 2100 -6.25000000000000e+00 +2097 2360 4.16666666666667e+00 +2097 1934 -4.16666666666667e+00 +2097 2359 4.16666666666667e+00 +2097 2098 -8.33333333333333e+00 +2097 2365 8.33333333333333e+00 +2097 2358 -1.87500000000000e+01 +2097 2364 -1.25000000000000e+01 +2097 1619 4.16666666666667e+00 +2097 1618 -8.33333333333333e+00 +2097 1469 4.16666666666667e+00 +2097 1288 2.08333333333333e+00 +2097 1467 -1.87500000000000e+01 +2097 1475 -4.16666666666667e+00 +2097 1474 -4.16666666666667e+00 +2097 1289 -4.16666666666667e+00 +2097 1468 4.16666666666667e+00 +2098 2098 6.25000000000000e+01 +2098 2354 4.16666666666667e+00 +2098 2099 -8.33333333333333e+00 +2098 2353 -6.25000000000000e+00 +2098 2352 -2.08333333333333e+00 +2098 1932 2.08333333333333e+00 +2098 2100 -2.08333333333333e+00 +2098 2102 4.16666666666667e+00 +2098 2366 8.33333333333333e+00 +2098 2462 -8.33333333333333e+00 +2098 2460 4.16666666666667e+00 +2098 2101 -6.25000000000000e+00 +2098 2360 -2.08333333333333e+00 +2098 1934 2.08333333333333e+00 +2098 2359 -6.25000000000000e+00 +2098 2365 -3.75000000000000e+01 +2098 2358 4.16666666666667e+00 +2098 2097 -8.33333333333333e+00 +2098 2364 8.33333333333333e+00 +2098 1619 4.16666666666667e+00 +2098 1467 4.16666666666667e+00 +2098 1617 -8.33333333333333e+00 +2098 1468 -6.25000000000000e+00 +2098 1287 2.08333333333333e+00 +2098 1473 -4.16666666666667e+00 +2098 1289 2.08333333333333e+00 +2098 1475 -4.16666666666667e+00 +2098 1469 -2.08333333333333e+00 +2099 2099 6.25000000000000e+01 +2099 2354 -1.87500000000000e+01 +2099 2353 4.16666666666667e+00 +2099 2098 -8.33333333333333e+00 +2099 2352 4.16666666666667e+00 +2099 2364 -4.16666666666667e+00 +2099 2097 -8.33333333333333e+00 +2099 2101 4.16666666666667e+00 +2099 2460 4.16666666666667e+00 +2099 2365 8.33333333333333e+00 +2099 2461 -8.33333333333333e+00 +2099 2102 -1.87500000000000e+01 +2099 2100 4.16666666666667e+00 +2099 2360 -6.25000000000000e+00 +2099 2366 -1.25000000000000e+01 +2099 2359 -2.08333333333333e+00 +2099 1933 2.08333333333333e+00 +2099 2358 4.16666666666667e+00 +2099 1932 -4.16666666666667e+00 +2099 1618 4.16666666666667e+00 +2099 1617 4.16666666666667e+00 +2099 1469 -6.25000000000000e+00 +2099 1467 4.16666666666667e+00 +2099 1473 -4.16666666666667e+00 +2099 1288 2.08333333333333e+00 +2099 1474 -4.16666666666667e+00 +2099 1287 -4.16666666666667e+00 +2099 1468 -2.08333333333333e+00 +2100 2100 2.50000000000000e+01 +2100 2359 2.08333333333333e+00 +2100 2462 -2.08333333333333e+00 +2100 1970 2.08333333333333e+00 +2100 2360 -4.16666666666667e+00 +2100 1969 2.08333333333333e+00 +2100 2101 -4.16666666666667e+00 +2100 2461 4.16666666666667e+00 +2100 1968 -6.25000000000000e+00 +2100 2460 -6.25000000000000e+00 +2100 2102 -4.16666666666667e+00 +2100 2099 4.16666666666667e+00 +2100 2098 -2.08333333333333e+00 +2100 2097 -6.25000000000000e+00 +2100 1475 2.08333333333333e+00 +2100 1289 2.08333333333333e+00 +2100 1288 2.08333333333333e+00 +2100 1474 -4.16666666666667e+00 +2100 1287 -6.25000000000000e+00 +2101 2101 2.91666666666667e+01 +2101 2358 2.08333333333333e+00 +2101 2099 4.16666666666667e+00 +2101 2102 -8.33333333333333e+00 +2101 2462 4.16666666666667e+00 +2101 1970 -2.08333333333333e+00 +2101 2360 2.08333333333333e+00 +2101 1969 -2.08333333333333e+00 +2101 2461 -1.87500000000000e+01 +2101 1968 2.08333333333333e+00 +2101 2100 -4.16666666666667e+00 +2101 2460 4.16666666666667e+00 +2101 2097 -2.08333333333333e+00 +2101 2098 -6.25000000000000e+00 +2101 1289 -2.08333333333333e+00 +2101 1475 2.08333333333333e+00 +2101 1288 -2.08333333333333e+00 +2101 1287 2.08333333333333e+00 +2101 1473 -4.16666666666667e+00 +2102 2102 2.91666666666667e+01 +2102 2101 -8.33333333333333e+00 +2102 2461 4.16666666666667e+00 +2102 2460 -2.08333333333333e+00 +2102 1970 -2.08333333333333e+00 +2102 2462 -6.25000000000000e+00 +2102 1969 -2.08333333333333e+00 +2102 2359 2.08333333333333e+00 +2102 1968 2.08333333333333e+00 +2102 2358 -4.16666666666667e+00 +2102 2098 4.16666666666667e+00 +2102 2099 -1.87500000000000e+01 +2102 2100 -4.16666666666667e+00 +2102 2097 4.16666666666667e+00 +2102 1473 2.08333333333333e+00 +2102 1289 -2.08333333333333e+00 +2102 1288 -2.08333333333333e+00 +2102 1474 2.08333333333333e+00 +2102 1287 2.08333333333333e+00 +2103 2103 1.00000000000000e+00 +2103 2108 0.00000000000000e+00 +2103 2107 0.00000000000000e+00 +2103 2413 0.00000000000000e+00 +2103 1894 0.00000000000000e+00 +2103 2106 0.00000000000000e+00 +2103 2105 0.00000000000000e+00 +2103 2246 0.00000000000000e+00 +2103 2245 0.00000000000000e+00 +2103 1915 0.00000000000000e+00 +2103 2244 0.00000000000000e+00 +2103 2110 0.00000000000000e+00 +2103 2111 0.00000000000000e+00 +2103 2258 0.00000000000000e+00 +2103 2450 0.00000000000000e+00 +2103 2113 0.00000000000000e+00 +2103 2449 0.00000000000000e+00 +2103 1895 0.00000000000000e+00 +2103 2114 0.00000000000000e+00 +2103 2109 0.00000000000000e+00 +2103 2252 0.00000000000000e+00 +2103 1916 0.00000000000000e+00 +2103 2104 0.00000000000000e+00 +2103 2251 0.00000000000000e+00 +2103 2257 0.00000000000000e+00 +2103 2414 0.00000000000000e+00 +2103 2250 0.00000000000000e+00 +2103 2256 0.00000000000000e+00 +2104 2104 1.00000000000000e+00 +2104 2414 0.00000000000000e+00 +2104 2412 0.00000000000000e+00 +2104 2108 0.00000000000000e+00 +2104 2107 0.00000000000000e+00 +2104 1893 0.00000000000000e+00 +2104 2246 0.00000000000000e+00 +2104 2245 0.00000000000000e+00 +2104 2244 0.00000000000000e+00 +2104 1914 0.00000000000000e+00 +2104 2258 0.00000000000000e+00 +2104 2105 0.00000000000000e+00 +2104 2109 0.00000000000000e+00 +2104 2114 0.00000000000000e+00 +2104 2450 0.00000000000000e+00 +2104 2112 0.00000000000000e+00 +2104 2448 0.00000000000000e+00 +2104 1895 0.00000000000000e+00 +2104 2111 0.00000000000000e+00 +2104 2110 0.00000000000000e+00 +2104 2252 0.00000000000000e+00 +2104 1916 0.00000000000000e+00 +2104 2106 0.00000000000000e+00 +2104 2251 0.00000000000000e+00 +2104 2257 0.00000000000000e+00 +2104 2103 0.00000000000000e+00 +2104 2250 0.00000000000000e+00 +2104 2256 0.00000000000000e+00 +2105 2105 1.00000000000000e+00 +2105 2106 0.00000000000000e+00 +2105 2413 0.00000000000000e+00 +2105 2108 0.00000000000000e+00 +2105 2107 0.00000000000000e+00 +2105 2246 0.00000000000000e+00 +2105 2245 0.00000000000000e+00 +2105 2103 0.00000000000000e+00 +2105 2244 0.00000000000000e+00 +2105 2257 0.00000000000000e+00 +2105 2104 0.00000000000000e+00 +2105 2113 0.00000000000000e+00 +2105 2449 0.00000000000000e+00 +2105 2109 0.00000000000000e+00 +2105 2256 0.00000000000000e+00 +2105 2448 0.00000000000000e+00 +2105 2111 0.00000000000000e+00 +2105 1894 0.00000000000000e+00 +2105 2110 0.00000000000000e+00 +2105 1893 0.00000000000000e+00 +2105 2112 0.00000000000000e+00 +2105 2412 0.00000000000000e+00 +2105 2252 0.00000000000000e+00 +2105 2258 0.00000000000000e+00 +2105 2251 0.00000000000000e+00 +2105 1915 0.00000000000000e+00 +2105 2250 0.00000000000000e+00 +2105 1914 0.00000000000000e+00 +2106 2106 1.00000000000000e+00 +2106 2105 0.00000000000000e+00 +2106 2413 0.00000000000000e+00 +2106 2107 0.00000000000000e+00 +2106 2104 0.00000000000000e+00 +2106 1895 0.00000000000000e+00 +2106 2114 0.00000000000000e+00 +2106 1894 0.00000000000000e+00 +2106 2113 0.00000000000000e+00 +2106 1893 0.00000000000000e+00 +2106 2103 0.00000000000000e+00 +2106 2108 0.00000000000000e+00 +2106 1946 0.00000000000000e+00 +2106 2414 0.00000000000000e+00 +2106 1945 0.00000000000000e+00 +2106 2245 0.00000000000000e+00 +2106 2246 0.00000000000000e+00 +2106 1944 0.00000000000000e+00 +2106 2412 0.00000000000000e+00 +2107 2107 1.00000000000000e+00 +2107 2114 0.00000000000000e+00 +2107 2412 0.00000000000000e+00 +2107 2106 0.00000000000000e+00 +2107 2103 0.00000000000000e+00 +2107 1895 0.00000000000000e+00 +2107 2108 0.00000000000000e+00 +2107 2105 0.00000000000000e+00 +2107 1894 0.00000000000000e+00 +2107 2104 0.00000000000000e+00 +2107 1893 0.00000000000000e+00 +2107 2112 0.00000000000000e+00 +2107 1946 0.00000000000000e+00 +2107 2246 0.00000000000000e+00 +2107 2414 0.00000000000000e+00 +2107 1945 0.00000000000000e+00 +2107 2413 0.00000000000000e+00 +2107 1944 0.00000000000000e+00 +2107 2244 0.00000000000000e+00 +2108 2108 1.00000000000000e+00 +2108 2113 0.00000000000000e+00 +2108 2244 0.00000000000000e+00 +2108 2103 0.00000000000000e+00 +2108 1895 0.00000000000000e+00 +2108 2105 0.00000000000000e+00 +2108 1894 0.00000000000000e+00 +2108 2107 0.00000000000000e+00 +2108 2104 0.00000000000000e+00 +2108 1893 0.00000000000000e+00 +2108 2112 0.00000000000000e+00 +2108 2413 0.00000000000000e+00 +2108 1946 0.00000000000000e+00 +2108 2414 0.00000000000000e+00 +2108 1945 0.00000000000000e+00 +2108 2245 0.00000000000000e+00 +2108 2106 0.00000000000000e+00 +2108 1944 0.00000000000000e+00 +2108 2412 0.00000000000000e+00 +2109 2109 1.00000000000000e+00 +2109 2104 0.00000000000000e+00 +2109 2111 0.00000000000000e+00 +2109 2105 0.00000000000000e+00 +2109 2450 0.00000000000000e+00 +2109 1895 0.00000000000000e+00 +2109 2114 0.00000000000000e+00 +2109 1894 0.00000000000000e+00 +2109 2113 0.00000000000000e+00 +2109 1893 0.00000000000000e+00 +2109 2103 0.00000000000000e+00 +2109 1964 0.00000000000000e+00 +2109 2252 0.00000000000000e+00 +2109 2110 0.00000000000000e+00 +2109 1963 0.00000000000000e+00 +2109 2449 0.00000000000000e+00 +2109 2251 0.00000000000000e+00 +2109 1962 0.00000000000000e+00 +2109 2448 0.00000000000000e+00 +2110 2110 1.00000000000000e+00 +2110 2103 0.00000000000000e+00 +2110 2114 0.00000000000000e+00 +2110 2450 0.00000000000000e+00 +2110 1895 0.00000000000000e+00 +2110 2111 0.00000000000000e+00 +2110 2105 0.00000000000000e+00 +2110 1894 0.00000000000000e+00 +2110 2104 0.00000000000000e+00 +2110 1893 0.00000000000000e+00 +2110 2112 0.00000000000000e+00 +2110 1964 0.00000000000000e+00 +2110 2252 0.00000000000000e+00 +2110 2250 0.00000000000000e+00 +2110 1963 0.00000000000000e+00 +2110 2449 0.00000000000000e+00 +2110 2109 0.00000000000000e+00 +2110 1962 0.00000000000000e+00 +2110 2448 0.00000000000000e+00 +2111 2111 1.00000000000000e+00 +2111 2449 0.00000000000000e+00 +2111 2109 0.00000000000000e+00 +2111 2103 0.00000000000000e+00 +2111 2448 0.00000000000000e+00 +2111 1895 0.00000000000000e+00 +2111 2105 0.00000000000000e+00 +2111 1894 0.00000000000000e+00 +2111 2110 0.00000000000000e+00 +2111 2104 0.00000000000000e+00 +2111 1893 0.00000000000000e+00 +2111 2112 0.00000000000000e+00 +2111 2113 0.00000000000000e+00 +2111 1964 0.00000000000000e+00 +2111 2450 0.00000000000000e+00 +2111 1963 0.00000000000000e+00 +2111 2251 0.00000000000000e+00 +2111 1962 0.00000000000000e+00 +2111 2250 0.00000000000000e+00 +2112 2112 3.75000000000000e+01 +2112 2108 0.00000000000000e+00 +2112 2107 0.00000000000000e+00 +2112 2114 -4.16666666666667e+00 +2112 2414 4.16666666666667e+00 +2112 1979 2.08333333333333e+00 +2112 2413 -2.08333333333333e+00 +2112 2412 -6.25000000000000e+00 +2112 2104 0.00000000000000e+00 +2112 2257 4.16666666666667e+00 +2112 2111 0.00000000000000e+00 +2112 2105 0.00000000000000e+00 +2112 1894 0.00000000000000e+00 +2112 2110 0.00000000000000e+00 +2112 1893 0.00000000000000e+00 +2112 2450 -2.08333333333333e+00 +2112 2258 4.16666666666667e+00 +2112 2113 -4.16666666666667e+00 +2112 2449 4.16666666666667e+00 +2112 1978 2.08333333333333e+00 +2112 1895 0.00000000000000e+00 +2112 2448 -6.25000000000000e+00 +2112 1977 -1.25000000000000e+01 +2113 2113 3.33333333333333e+01 +2113 2106 0.00000000000000e+00 +2113 2414 4.16666666666667e+00 +2113 2413 -6.25000000000000e+00 +2113 2412 -2.08333333333333e+00 +2113 2111 0.00000000000000e+00 +2113 2105 0.00000000000000e+00 +2113 2103 0.00000000000000e+00 +2113 2256 4.16666666666667e+00 +2113 1894 0.00000000000000e+00 +2113 1893 0.00000000000000e+00 +2113 2109 0.00000000000000e+00 +2113 2450 4.16666666666667e+00 +2113 2258 -8.33333333333333e+00 +2113 2108 0.00000000000000e+00 +2113 2449 -1.87500000000000e+01 +2113 1978 -4.16666666666667e+00 +2113 2112 -4.16666666666667e+00 +2113 2448 4.16666666666667e+00 +2113 1977 2.08333333333333e+00 +2114 2114 3.33333333333333e+01 +2114 1893 0.00000000000000e+00 +2114 2106 0.00000000000000e+00 +2114 2414 -1.87500000000000e+01 +2114 2413 4.16666666666667e+00 +2114 2112 -4.16666666666667e+00 +2114 2412 4.16666666666667e+00 +2114 1977 2.08333333333333e+00 +2114 2110 0.00000000000000e+00 +2114 2104 0.00000000000000e+00 +2114 1895 0.00000000000000e+00 +2114 2109 0.00000000000000e+00 +2114 2103 0.00000000000000e+00 +2114 2107 0.00000000000000e+00 +2114 2450 -6.25000000000000e+00 +2114 1979 -4.16666666666667e+00 +2114 2449 4.16666666666667e+00 +2114 2257 -8.33333333333333e+00 +2114 2448 -2.08333333333333e+00 +2114 2256 4.16666666666667e+00 +2115 2115 1.25000000000000e+02 +2115 2122 8.33333333333333e+00 +2115 2121 -1.25000000000000e+01 +2115 2264 -8.33333333333333e+00 +2115 2263 4.16666666666667e+00 +2115 2276 8.33333333333333e+00 +2115 2134 4.16666666666667e+00 +2115 2275 8.33333333333333e+00 +2115 2274 -3.75000000000000e+01 +2115 2135 4.16666666666667e+00 +2115 2266 -4.16666666666667e+00 +2115 2267 8.33333333333333e+00 +2115 2117 -1.66666666666667e+01 +2115 1919 -4.16666666666667e+00 +2115 2265 -1.25000000000000e+01 +2115 2126 4.16666666666667e+00 +2115 1898 -4.16666666666667e+00 +2115 2125 -8.33333333333333e+00 +2115 2261 4.16666666666667e+00 +2115 2119 8.33333333333333e+00 +2115 2116 -1.66666666666667e+01 +2115 2120 8.33333333333333e+00 +2115 1897 -4.16666666666667e+00 +2115 2118 -3.75000000000000e+01 +2115 2260 4.16666666666667e+00 +2115 1918 -4.16666666666667e+00 +2115 2273 -4.16666666666667e+00 +2115 2270 4.16666666666667e+00 +2115 2131 4.16666666666667e+00 +2115 2128 -4.16666666666667e+00 +2115 2269 -8.33333333333333e+00 +2115 2272 8.33333333333333e+00 +2115 2271 -1.25000000000000e+01 +2115 2129 8.33333333333333e+00 +2115 2132 -8.33333333333333e+00 +2115 2127 -1.25000000000000e+01 +2115 2123 -4.16666666666667e+00 +2116 2116 1.25000000000000e+02 +2116 2121 8.33333333333333e+00 +2116 2123 8.33333333333333e+00 +2116 2122 -3.75000000000000e+01 +2116 2262 4.16666666666667e+00 +2116 2276 -4.16666666666667e+00 +2116 2133 4.16666666666667e+00 +2116 2275 -1.25000000000000e+01 +2116 2274 8.33333333333333e+00 +2116 2135 -8.33333333333333e+00 +2116 2265 -4.16666666666667e+00 +2116 2126 4.16666666666667e+00 +2116 2267 8.33333333333333e+00 +2116 2266 -1.25000000000000e+01 +2116 2124 -8.33333333333333e+00 +2116 2120 -4.16666666666667e+00 +2116 2118 8.33333333333333e+00 +2116 2115 -1.66666666666667e+01 +2116 2119 -1.25000000000000e+01 +2116 1896 -4.16666666666667e+00 +2116 2261 -8.33333333333333e+00 +2116 2259 4.16666666666667e+00 +2116 1917 -4.16666666666667e+00 +2116 2273 8.33333333333333e+00 +2116 2117 -1.66666666666667e+01 +2116 2129 8.33333333333333e+00 +2116 2130 4.16666666666667e+00 +2116 2127 -4.16666666666667e+00 +2116 2270 4.16666666666667e+00 +2116 1919 -4.16666666666667e+00 +2116 2272 -3.75000000000000e+01 +2116 2268 -8.33333333333333e+00 +2116 2271 8.33333333333333e+00 +2116 2132 4.16666666666667e+00 +2116 1898 -4.16666666666667e+00 +2116 2128 -1.25000000000000e+01 +2116 2264 4.16666666666667e+00 +2117 2117 1.25000000000000e+02 +2117 2263 4.16666666666667e+00 +2117 2123 -1.25000000000000e+01 +2117 2122 8.33333333333333e+00 +2117 2262 -8.33333333333333e+00 +2117 2275 -4.16666666666667e+00 +2117 2274 8.33333333333333e+00 +2117 2276 -1.25000000000000e+01 +2117 2134 -8.33333333333333e+00 +2117 2133 4.16666666666667e+00 +2117 2125 4.16666666666667e+00 +2117 2265 8.33333333333333e+00 +2117 2115 -1.66666666666667e+01 +2117 2267 -3.75000000000000e+01 +2117 2266 8.33333333333333e+00 +2117 1917 -4.16666666666667e+00 +2117 2124 4.16666666666667e+00 +2117 1896 -4.16666666666667e+00 +2117 2119 -4.16666666666667e+00 +2117 2259 4.16666666666667e+00 +2117 2120 -1.25000000000000e+01 +2117 2118 8.33333333333333e+00 +2117 2260 -8.33333333333333e+00 +2117 2271 -4.16666666666667e+00 +2117 2268 4.16666666666667e+00 +2117 2272 8.33333333333333e+00 +2117 2116 -1.66666666666667e+01 +2117 2128 8.33333333333333e+00 +2117 2273 -1.25000000000000e+01 +2117 2269 4.16666666666667e+00 +2117 1918 -4.16666666666667e+00 +2117 2129 -3.75000000000000e+01 +2117 2121 -4.16666666666667e+00 +2117 2131 4.16666666666667e+00 +2117 1897 -4.16666666666667e+00 +2117 2127 8.33333333333333e+00 +2117 2130 -8.33333333333333e+00 +2118 2118 1.25000000000000e+02 +2118 2431 -8.33333333333333e+00 +2118 2384 8.33333333333333e+00 +2118 2468 -8.33333333333333e+00 +2118 2137 -4.16666666666667e+00 +2118 2467 4.16666666666667e+00 +2118 2138 -4.16666666666667e+00 +2118 2383 8.33333333333333e+00 +2118 2382 -3.75000000000000e+01 +2118 2372 8.33333333333333e+00 +2118 2266 4.16666666666667e+00 +2118 2371 -4.16666666666667e+00 +2118 2267 -8.33333333333333e+00 +2118 1937 4.16666666666667e+00 +2118 2370 -1.25000000000000e+01 +2118 2126 -4.16666666666667e+00 +2118 1898 4.16666666666667e+00 +2118 2119 -1.66666666666667e+01 +2118 2125 8.33333333333333e+00 +2118 2124 -1.25000000000000e+01 +2118 2378 -4.16666666666667e+00 +2118 2377 8.33333333333333e+00 +2118 2261 -4.16666666666667e+00 +2118 2273 4.16666666666667e+00 +2118 2116 8.33333333333333e+00 +2118 2272 -8.33333333333333e+00 +2118 1936 4.16666666666667e+00 +2118 2260 -4.16666666666667e+00 +2118 2376 -1.25000000000000e+01 +2118 2120 -1.66666666666667e+01 +2118 2132 8.33333333333333e+00 +2118 2117 8.33333333333333e+00 +2118 2131 -4.16666666666667e+00 +2118 1897 4.16666666666667e+00 +2118 2432 4.16666666666667e+00 +2118 2130 -1.25000000000000e+01 +2118 2115 -3.75000000000000e+01 +2119 2119 1.25000000000000e+02 +2119 2430 -8.33333333333333e+00 +2119 2384 -4.16666666666667e+00 +2119 2138 -4.16666666666667e+00 +2119 2468 4.16666666666667e+00 +2119 2136 -4.16666666666667e+00 +2119 2466 4.16666666666667e+00 +2119 2383 -1.25000000000000e+01 +2119 2382 8.33333333333333e+00 +2119 2265 4.16666666666667e+00 +2119 2370 -4.16666666666667e+00 +2119 2267 4.16666666666667e+00 +2119 2372 8.33333333333333e+00 +2119 2371 -1.25000000000000e+01 +2119 2126 8.33333333333333e+00 +2119 2125 -3.75000000000000e+01 +2119 2118 -1.66666666666667e+01 +2119 2124 8.33333333333333e+00 +2119 2117 -4.16666666666667e+00 +2119 2120 -1.66666666666667e+01 +2119 2261 -4.16666666666667e+00 +2119 2273 4.16666666666667e+00 +2119 2376 8.33333333333333e+00 +2119 2115 8.33333333333333e+00 +2119 2271 -8.33333333333333e+00 +2119 1937 -8.33333333333333e+00 +2119 2378 8.33333333333333e+00 +2119 2377 -3.75000000000000e+01 +2119 1935 4.16666666666667e+00 +2119 2259 -4.16666666666667e+00 +2119 2132 8.33333333333333e+00 +2119 1898 -8.33333333333333e+00 +2119 2432 4.16666666666667e+00 +2119 2131 -1.25000000000000e+01 +2119 2116 -1.25000000000000e+01 +2119 2130 -4.16666666666667e+00 +2119 1896 4.16666666666667e+00 +2120 2120 1.25000000000000e+02 +2120 2431 4.16666666666667e+00 +2120 2383 -4.16666666666667e+00 +2120 2137 -4.16666666666667e+00 +2120 2467 4.16666666666667e+00 +2120 2382 8.33333333333333e+00 +2120 2466 -8.33333333333333e+00 +2120 2136 -4.16666666666667e+00 +2120 2384 -1.25000000000000e+01 +2120 2370 8.33333333333333e+00 +2120 2266 4.16666666666667e+00 +2120 2265 -8.33333333333333e+00 +2120 2372 -3.75000000000000e+01 +2120 2371 8.33333333333333e+00 +2120 1935 4.16666666666667e+00 +2120 2126 -1.25000000000000e+01 +2120 2125 8.33333333333333e+00 +2120 2124 -4.16666666666667e+00 +2120 1896 4.16666666666667e+00 +2120 2116 -4.16666666666667e+00 +2120 2119 -1.66666666666667e+01 +2120 2376 -4.16666666666667e+00 +2120 2260 -4.16666666666667e+00 +2120 2272 4.16666666666667e+00 +2120 2259 -4.16666666666667e+00 +2120 2271 4.16666666666667e+00 +2120 2378 -1.25000000000000e+01 +2120 1936 -8.33333333333333e+00 +2120 2377 8.33333333333333e+00 +2120 2430 4.16666666666667e+00 +2120 2132 -3.75000000000000e+01 +2120 2117 -1.25000000000000e+01 +2120 2131 8.33333333333333e+00 +2120 1897 -8.33333333333333e+00 +2120 2118 -1.66666666666667e+01 +2120 2130 8.33333333333333e+00 +2120 2115 8.33333333333333e+00 +2121 2121 6.25000000000000e+01 +2121 2266 4.16666666666667e+00 +2121 2267 4.16666666666667e+00 +2121 2417 4.16666666666667e+00 +2121 2415 -6.25000000000000e+00 +2121 2126 4.16666666666667e+00 +2121 2125 4.16666666666667e+00 +2121 2122 -8.33333333333333e+00 +2121 2124 -1.87500000000000e+01 +2121 2117 -4.16666666666667e+00 +2121 2123 -8.33333333333333e+00 +2121 2264 -4.16666666666667e+00 +2121 2276 4.16666666666667e+00 +2121 2419 4.16666666666667e+00 +2121 2116 8.33333333333333e+00 +2121 2275 -8.33333333333333e+00 +2121 2420 4.16666666666667e+00 +2121 1949 -4.16666666666667e+00 +2121 1948 2.08333333333333e+00 +2121 2263 -4.16666666666667e+00 +2121 2418 -1.87500000000000e+01 +2121 2135 4.16666666666667e+00 +2121 1898 -4.16666666666667e+00 +2121 2134 -2.08333333333333e+00 +2121 1897 2.08333333333333e+00 +2121 2133 -6.25000000000000e+00 +2121 2416 -2.08333333333333e+00 +2121 2115 -1.25000000000000e+01 +2122 2122 6.25000000000000e+01 +2122 2415 -2.08333333333333e+00 +2122 2265 4.16666666666667e+00 +2122 2267 -8.33333333333333e+00 +2122 1949 2.08333333333333e+00 +2122 2416 -6.25000000000000e+00 +2122 2126 -2.08333333333333e+00 +2122 1898 2.08333333333333e+00 +2122 2125 -6.25000000000000e+00 +2122 2124 4.16666666666667e+00 +2122 2121 -8.33333333333333e+00 +2122 2420 -2.08333333333333e+00 +2122 2418 4.16666666666667e+00 +2122 2264 -4.16666666666667e+00 +2122 2276 4.16666666666667e+00 +2122 2115 8.33333333333333e+00 +2122 2274 -8.33333333333333e+00 +2122 2419 -6.25000000000000e+00 +2122 1947 2.08333333333333e+00 +2122 2262 -4.16666666666667e+00 +2122 2135 4.16666666666667e+00 +2122 2123 -8.33333333333333e+00 +2122 2117 8.33333333333333e+00 +2122 2134 -6.25000000000000e+00 +2122 2417 4.16666666666667e+00 +2122 2116 -3.75000000000000e+01 +2122 2133 -2.08333333333333e+00 +2122 1896 2.08333333333333e+00 +2123 2123 6.25000000000000e+01 +2123 2266 -8.33333333333333e+00 +2123 2265 4.16666666666667e+00 +2123 2417 -1.87500000000000e+01 +2123 1948 2.08333333333333e+00 +2123 2415 4.16666666666667e+00 +2123 2126 -6.25000000000000e+00 +2123 2125 -2.08333333333333e+00 +2123 1897 2.08333333333333e+00 +2123 2124 4.16666666666667e+00 +2123 2115 -4.16666666666667e+00 +2123 2419 -2.08333333333333e+00 +2123 2121 -8.33333333333333e+00 +2123 2262 -4.16666666666667e+00 +2123 2274 4.16666666666667e+00 +2123 2263 -4.16666666666667e+00 +2123 2275 4.16666666666667e+00 +2123 2420 -6.25000000000000e+00 +2123 2418 4.16666666666667e+00 +2123 1947 -4.16666666666667e+00 +2123 2135 -1.87500000000000e+01 +2123 2416 4.16666666666667e+00 +2123 2117 -1.25000000000000e+01 +2123 2134 4.16666666666667e+00 +2123 2122 -8.33333333333333e+00 +2123 2116 8.33333333333333e+00 +2123 2133 4.16666666666667e+00 +2123 1896 -4.16666666666667e+00 +2124 2124 6.25000000000000e+01 +2124 2125 -8.33333333333333e+00 +2124 2138 -4.16666666666667e+00 +2124 1897 -2.08333333333333e+00 +2124 2137 2.08333333333333e+00 +2124 2432 4.16666666666667e+00 +2124 1954 -2.08333333333333e+00 +2124 2430 -1.87500000000000e+01 +2124 2416 2.08333333333333e+00 +2124 1955 4.16666666666667e+00 +2124 2417 -4.16666666666667e+00 +2124 2126 -8.33333333333333e+00 +2124 2123 4.16666666666667e+00 +2124 1898 4.16666666666667e+00 +2124 2122 4.16666666666667e+00 +2124 2121 -1.87500000000000e+01 +2124 2266 -4.16666666666667e+00 +2124 2371 4.16666666666667e+00 +2124 2372 4.16666666666667e+00 +2124 2267 -4.16666666666667e+00 +2124 1953 -6.25000000000000e+00 +2124 2120 -4.16666666666667e+00 +2124 2117 4.16666666666667e+00 +2124 2119 8.33333333333333e+00 +2124 2116 -8.33333333333333e+00 +2124 2118 -1.25000000000000e+01 +2124 2431 4.16666666666667e+00 +2124 1896 -6.25000000000000e+00 +2125 2125 6.25000000000000e+01 +2125 2138 2.08333333333333e+00 +2125 2430 4.16666666666667e+00 +2125 2124 -8.33333333333333e+00 +2125 1896 -2.08333333333333e+00 +2125 2136 2.08333333333333e+00 +2125 2431 -6.25000000000000e+00 +2125 1953 -2.08333333333333e+00 +2125 2415 2.08333333333333e+00 +2125 2417 2.08333333333333e+00 +2125 2123 -2.08333333333333e+00 +2125 2122 -6.25000000000000e+00 +2125 2121 4.16666666666667e+00 +2125 2265 -4.16666666666667e+00 +2125 2370 4.16666666666667e+00 +2125 2267 -4.16666666666667e+00 +2125 2117 4.16666666666667e+00 +2125 2372 -8.33333333333333e+00 +2125 1955 4.16666666666667e+00 +2125 1954 -6.25000000000000e+00 +2125 2120 8.33333333333333e+00 +2125 2126 -8.33333333333333e+00 +2125 1898 4.16666666666667e+00 +2125 2119 -3.75000000000000e+01 +2125 2432 -2.08333333333333e+00 +2125 1897 -6.25000000000000e+00 +2125 2118 8.33333333333333e+00 +2125 2115 -8.33333333333333e+00 +2126 2126 6.25000000000000e+01 +2126 2137 2.08333333333333e+00 +2126 2136 -4.16666666666667e+00 +2126 2432 -6.25000000000000e+00 +2126 2430 4.16666666666667e+00 +2126 2416 2.08333333333333e+00 +2126 1953 4.16666666666667e+00 +2126 2415 -4.16666666666667e+00 +2126 2123 -6.25000000000000e+00 +2126 2122 -2.08333333333333e+00 +2126 2124 -8.33333333333333e+00 +2126 2121 4.16666666666667e+00 +2126 1896 4.16666666666667e+00 +2126 2266 -4.16666666666667e+00 +2126 2116 4.16666666666667e+00 +2126 1955 -1.87500000000000e+01 +2126 2371 -8.33333333333333e+00 +2126 1954 4.16666666666667e+00 +2126 2370 4.16666666666667e+00 +2126 2265 -4.16666666666667e+00 +2126 2120 -1.25000000000000e+01 +2126 2431 -2.08333333333333e+00 +2126 1898 -1.87500000000000e+01 +2126 2119 8.33333333333333e+00 +2126 2125 -8.33333333333333e+00 +2126 1897 4.16666666666667e+00 +2126 2118 -4.16666666666667e+00 +2126 2115 4.16666666666667e+00 +2127 2127 6.25000000000000e+01 +2127 2276 -8.33333333333333e+00 +2127 2275 4.16666666666667e+00 +2127 1967 2.08333333333333e+00 +2127 2455 4.16666666666667e+00 +2127 2454 -1.87500000000000e+01 +2127 2135 -2.08333333333333e+00 +2127 1898 2.08333333333333e+00 +2127 2134 4.16666666666667e+00 +2127 2133 -6.25000000000000e+00 +2127 2270 -4.16666666666667e+00 +2127 2269 -4.16666666666667e+00 +2127 2273 4.16666666666667e+00 +2127 2453 -2.08333333333333e+00 +2127 2128 -8.33333333333333e+00 +2127 2272 4.16666666666667e+00 +2127 2116 -4.16666666666667e+00 +2127 1966 -4.16666666666667e+00 +2127 2452 4.16666666666667e+00 +2127 2451 -6.25000000000000e+00 +2127 2129 -8.33333333333333e+00 +2127 2132 4.16666666666667e+00 +2127 2117 8.33333333333333e+00 +2127 2131 4.16666666666667e+00 +2127 1897 -4.16666666666667e+00 +2127 2456 4.16666666666667e+00 +2127 2130 -1.87500000000000e+01 +2127 2115 -1.25000000000000e+01 +2128 2128 6.25000000000000e+01 +2128 2276 4.16666666666667e+00 +2128 2274 4.16666666666667e+00 +2128 2455 -6.25000000000000e+00 +2128 2454 4.16666666666667e+00 +2128 2135 4.16666666666667e+00 +2128 2129 -8.33333333333333e+00 +2128 2134 -1.87500000000000e+01 +2128 2133 4.16666666666667e+00 +2128 2268 -4.16666666666667e+00 +2128 2453 4.16666666666667e+00 +2128 2127 -8.33333333333333e+00 +2128 2273 -8.33333333333333e+00 +2128 2117 8.33333333333333e+00 +2128 2271 4.16666666666667e+00 +2128 2115 -4.16666666666667e+00 +2128 1967 2.08333333333333e+00 +2128 2270 -4.16666666666667e+00 +2128 2452 -1.87500000000000e+01 +2128 1965 -4.16666666666667e+00 +2128 2451 4.16666666666667e+00 +2128 2132 -2.08333333333333e+00 +2128 1898 2.08333333333333e+00 +2128 2456 -2.08333333333333e+00 +2128 2131 -6.25000000000000e+00 +2128 2116 -1.25000000000000e+01 +2128 2130 4.16666666666667e+00 +2128 1896 -4.16666666666667e+00 +2129 2129 6.25000000000000e+01 +2129 2275 4.16666666666667e+00 +2129 2454 4.16666666666667e+00 +2129 2274 -8.33333333333333e+00 +2129 2456 -6.25000000000000e+00 +2129 1965 2.08333333333333e+00 +2129 2135 -6.25000000000000e+00 +2129 2134 4.16666666666667e+00 +2129 2128 -8.33333333333333e+00 +2129 2133 -2.08333333333333e+00 +2129 1896 2.08333333333333e+00 +2129 2268 -4.16666666666667e+00 +2129 2452 4.16666666666667e+00 +2129 2271 4.16666666666667e+00 +2129 2451 -2.08333333333333e+00 +2129 2272 -8.33333333333333e+00 +2129 2116 8.33333333333333e+00 +2129 2453 -6.25000000000000e+00 +2129 1966 2.08333333333333e+00 +2129 2269 -4.16666666666667e+00 +2129 2455 -2.08333333333333e+00 +2129 2132 -6.25000000000000e+00 +2129 2117 -3.75000000000000e+01 +2129 2131 -2.08333333333333e+00 +2129 1897 2.08333333333333e+00 +2129 2127 -8.33333333333333e+00 +2129 2130 4.16666666666667e+00 +2129 2115 8.33333333333333e+00 +2130 2130 6.25000000000000e+01 +2130 2468 4.16666666666667e+00 +2130 1898 -2.08333333333333e+00 +2130 2138 2.08333333333333e+00 +2130 2137 -4.16666666666667e+00 +2130 1973 -2.08333333333333e+00 +2130 2467 4.16666666666667e+00 +2130 2466 -1.87500000000000e+01 +2130 2378 4.16666666666667e+00 +2130 2377 4.16666666666667e+00 +2130 2120 8.33333333333333e+00 +2130 2119 -4.16666666666667e+00 +2130 2118 -1.25000000000000e+01 +2130 2273 -4.16666666666667e+00 +2130 2453 2.08333333333333e+00 +2130 2272 -4.16666666666667e+00 +2130 2116 4.16666666666667e+00 +2130 2452 -4.16666666666667e+00 +2130 1972 4.16666666666667e+00 +2130 1971 -6.25000000000000e+00 +2130 2129 4.16666666666667e+00 +2130 2117 -8.33333333333333e+00 +2130 2128 4.16666666666667e+00 +2130 2131 -8.33333333333333e+00 +2130 1897 4.16666666666667e+00 +2130 2127 -1.87500000000000e+01 +2130 2132 -8.33333333333333e+00 +2130 1896 -6.25000000000000e+00 +2131 2131 6.25000000000000e+01 +2131 2468 -2.08333333333333e+00 +2131 2136 -4.16666666666667e+00 +2131 2467 -6.25000000000000e+00 +2131 2466 4.16666666666667e+00 +2131 2378 -8.33333333333333e+00 +2131 1973 4.16666666666667e+00 +2131 2376 4.16666666666667e+00 +2131 2120 8.33333333333333e+00 +2131 2132 -8.33333333333333e+00 +2131 1898 4.16666666666667e+00 +2131 2119 -1.25000000000000e+01 +2131 2118 -4.16666666666667e+00 +2131 2271 -4.16666666666667e+00 +2131 2115 4.16666666666667e+00 +2131 2453 2.08333333333333e+00 +2131 2273 -4.16666666666667e+00 +2131 1972 -1.87500000000000e+01 +2131 2451 -4.16666666666667e+00 +2131 1971 4.16666666666667e+00 +2131 2129 -2.08333333333333e+00 +2131 2117 4.16666666666667e+00 +2131 2128 -6.25000000000000e+00 +2131 2138 2.08333333333333e+00 +2131 1897 -1.87500000000000e+01 +2131 2127 4.16666666666667e+00 +2131 2130 -8.33333333333333e+00 +2131 1896 4.16666666666667e+00 +2132 2132 6.25000000000000e+01 +2132 2467 -2.08333333333333e+00 +2132 2130 -8.33333333333333e+00 +2132 2466 4.16666666666667e+00 +2132 1896 -2.08333333333333e+00 +2132 2136 2.08333333333333e+00 +2132 2468 -6.25000000000000e+00 +2132 1971 -2.08333333333333e+00 +2132 2376 4.16666666666667e+00 +2132 2377 -8.33333333333333e+00 +2132 1972 4.16666666666667e+00 +2132 2120 -3.75000000000000e+01 +2132 2119 8.33333333333333e+00 +2132 2131 -8.33333333333333e+00 +2132 1897 4.16666666666667e+00 +2132 2118 8.33333333333333e+00 +2132 2271 -4.16666666666667e+00 +2132 2451 2.08333333333333e+00 +2132 1973 -6.25000000000000e+00 +2132 2452 2.08333333333333e+00 +2132 2272 -4.16666666666667e+00 +2132 2129 -6.25000000000000e+00 +2132 2137 2.08333333333333e+00 +2132 1898 -6.25000000000000e+00 +2132 2128 -2.08333333333333e+00 +2132 2116 4.16666666666667e+00 +2132 2127 4.16666666666667e+00 +2132 2115 -8.33333333333333e+00 +2133 2133 3.75000000000000e+01 +2133 2420 -4.16666666666667e+00 +2133 2419 2.08333333333333e+00 +2133 2135 -4.16666666666667e+00 +2133 2123 4.16666666666667e+00 +2133 1898 2.08333333333333e+00 +2133 2122 -2.08333333333333e+00 +2133 2121 -6.25000000000000e+00 +2133 2275 -4.16666666666667e+00 +2133 2116 4.16666666666667e+00 +2133 2456 2.08333333333333e+00 +2133 2276 -4.16666666666667e+00 +2133 1978 2.08333333333333e+00 +2133 2455 -4.16666666666667e+00 +2133 1977 -1.25000000000000e+01 +2133 2129 -2.08333333333333e+00 +2133 2117 4.16666666666667e+00 +2133 2134 -4.16666666666667e+00 +2133 2128 4.16666666666667e+00 +2133 1897 2.08333333333333e+00 +2133 1979 2.08333333333333e+00 +2133 2127 -6.25000000000000e+00 +2133 1896 -1.25000000000000e+01 +2134 2134 3.33333333333333e+01 +2134 2418 2.08333333333333e+00 +2134 2123 4.16666666666667e+00 +2134 2122 -6.25000000000000e+00 +2134 2121 -2.08333333333333e+00 +2134 2456 2.08333333333333e+00 +2134 2276 -4.16666666666667e+00 +2134 2274 -4.16666666666667e+00 +2134 2115 4.16666666666667e+00 +2134 1978 -4.16666666666667e+00 +2134 1977 2.08333333333333e+00 +2134 2454 -4.16666666666667e+00 +2134 2129 4.16666666666667e+00 +2134 2117 -8.33333333333333e+00 +2134 2420 2.08333333333333e+00 +2134 2128 -1.87500000000000e+01 +2134 1897 -4.16666666666667e+00 +2134 2133 -4.16666666666667e+00 +2134 2127 4.16666666666667e+00 +2134 1896 2.08333333333333e+00 +2135 2135 3.33333333333333e+01 +2135 1977 2.08333333333333e+00 +2135 2418 -4.16666666666667e+00 +2135 2123 -1.87500000000000e+01 +2135 2122 4.16666666666667e+00 +2135 2133 -4.16666666666667e+00 +2135 2121 4.16666666666667e+00 +2135 1896 2.08333333333333e+00 +2135 2455 2.08333333333333e+00 +2135 2275 -4.16666666666667e+00 +2135 1979 -4.16666666666667e+00 +2135 2454 2.08333333333333e+00 +2135 2274 -4.16666666666667e+00 +2135 2419 2.08333333333333e+00 +2135 2129 -6.25000000000000e+00 +2135 1898 -4.16666666666667e+00 +2135 2128 4.16666666666667e+00 +2135 2116 -8.33333333333333e+00 +2135 2127 -2.08333333333333e+00 +2135 2115 4.16666666666667e+00 +2136 2136 3.75000000000000e+01 +2136 2126 -4.16666666666667e+00 +2136 2125 2.08333333333333e+00 +2136 2138 -4.16666666666667e+00 +2136 2432 4.16666666666667e+00 +2136 1982 2.08333333333333e+00 +2136 2431 -2.08333333333333e+00 +2136 2430 -6.25000000000000e+00 +2136 2119 -4.16666666666667e+00 +2136 2383 4.16666666666667e+00 +2136 2132 2.08333333333333e+00 +2136 2120 -4.16666666666667e+00 +2136 1897 2.08333333333333e+00 +2136 2131 -4.16666666666667e+00 +2136 1896 -1.25000000000000e+01 +2136 2468 -2.08333333333333e+00 +2136 2384 4.16666666666667e+00 +2136 2137 -4.16666666666667e+00 +2136 2467 4.16666666666667e+00 +2136 1981 2.08333333333333e+00 +2136 1898 2.08333333333333e+00 +2136 2466 -6.25000000000000e+00 +2136 1980 -1.25000000000000e+01 +2137 2137 3.33333333333333e+01 +2137 2124 2.08333333333333e+00 +2137 2432 4.16666666666667e+00 +2137 2431 -6.25000000000000e+00 +2137 2430 -2.08333333333333e+00 +2137 2132 2.08333333333333e+00 +2137 2120 -4.16666666666667e+00 +2137 2118 -4.16666666666667e+00 +2137 2382 4.16666666666667e+00 +2137 1897 -4.16666666666667e+00 +2137 1896 2.08333333333333e+00 +2137 2130 -4.16666666666667e+00 +2137 2468 4.16666666666667e+00 +2137 2384 -8.33333333333333e+00 +2137 2126 2.08333333333333e+00 +2137 2467 -1.87500000000000e+01 +2137 1981 -4.16666666666667e+00 +2137 2136 -4.16666666666667e+00 +2137 2466 4.16666666666667e+00 +2137 1980 2.08333333333333e+00 +2138 2138 3.33333333333333e+01 +2138 1896 2.08333333333333e+00 +2138 2124 -4.16666666666667e+00 +2138 2432 -1.87500000000000e+01 +2138 2431 4.16666666666667e+00 +2138 2136 -4.16666666666667e+00 +2138 2430 4.16666666666667e+00 +2138 1980 2.08333333333333e+00 +2138 2131 2.08333333333333e+00 +2138 2119 -4.16666666666667e+00 +2138 1898 -4.16666666666667e+00 +2138 2130 2.08333333333333e+00 +2138 2118 -4.16666666666667e+00 +2138 2125 2.08333333333333e+00 +2138 2468 -6.25000000000000e+00 +2138 1982 -4.16666666666667e+00 +2138 2467 4.16666666666667e+00 +2138 2383 -8.33333333333333e+00 +2138 2466 -2.08333333333333e+00 +2138 2382 4.16666666666667e+00 +2139 2139 1.25000000000000e+02 +2139 2143 8.33333333333333e+00 +2139 2142 -1.25000000000000e+01 +2139 2390 -8.33333333333333e+00 +2139 2389 4.16666666666667e+00 +2139 2402 8.33333333333333e+00 +2139 2149 4.16666666666667e+00 +2139 2401 8.33333333333333e+00 +2139 2400 -3.75000000000000e+01 +2139 2150 4.16666666666667e+00 +2139 2392 -4.16666666666667e+00 +2139 2393 8.33333333333333e+00 +2139 2141 -1.66666666666667e+01 +2139 1940 -4.16666666666667e+00 +2139 2391 -1.25000000000000e+01 +2139 2387 4.16666666666667e+00 +2139 2140 -1.66666666666667e+01 +2139 2386 4.16666666666667e+00 +2139 1939 -4.16666666666667e+00 +2139 2399 -4.16666666666667e+00 +2139 2396 4.16666666666667e+00 +2139 2146 -4.16666666666667e+00 +2139 2395 -8.33333333333333e+00 +2139 2398 8.33333333333333e+00 +2139 2397 -1.25000000000000e+01 +2139 2147 8.33333333333333e+00 +2139 2145 -1.25000000000000e+01 +2139 2144 -4.16666666666667e+00 +2139 1508 4.16666666666667e+00 +2139 1295 -4.16666666666667e+00 +2139 1507 -8.33333333333333e+00 +2139 1504 8.33333333333333e+00 +2139 1505 8.33333333333333e+00 +2139 1294 -4.16666666666667e+00 +2139 1503 -3.75000000000000e+01 +2139 1510 4.16666666666667e+00 +2139 1511 -8.33333333333333e+00 +2140 2140 1.25000000000000e+02 +2140 2142 8.33333333333333e+00 +2140 2144 8.33333333333333e+00 +2140 2143 -3.75000000000000e+01 +2140 2388 4.16666666666667e+00 +2140 2402 -4.16666666666667e+00 +2140 2148 4.16666666666667e+00 +2140 2401 -1.25000000000000e+01 +2140 2400 8.33333333333333e+00 +2140 2150 -8.33333333333333e+00 +2140 2391 -4.16666666666667e+00 +2140 2393 8.33333333333333e+00 +2140 2392 -1.25000000000000e+01 +2140 2139 -1.66666666666667e+01 +2140 2387 -8.33333333333333e+00 +2140 2385 4.16666666666667e+00 +2140 1938 -4.16666666666667e+00 +2140 2399 8.33333333333333e+00 +2140 2141 -1.66666666666667e+01 +2140 2147 8.33333333333333e+00 +2140 2145 -4.16666666666667e+00 +2140 2396 4.16666666666667e+00 +2140 1940 -4.16666666666667e+00 +2140 2398 -3.75000000000000e+01 +2140 2394 -8.33333333333333e+00 +2140 2397 8.33333333333333e+00 +2140 2146 -1.25000000000000e+01 +2140 2390 4.16666666666667e+00 +2140 1508 4.16666666666667e+00 +2140 1506 -8.33333333333333e+00 +2140 1505 -4.16666666666667e+00 +2140 1503 8.33333333333333e+00 +2140 1504 -1.25000000000000e+01 +2140 1293 -4.16666666666667e+00 +2140 1509 4.16666666666667e+00 +2140 1511 4.16666666666667e+00 +2140 1295 -4.16666666666667e+00 +2141 2141 1.25000000000000e+02 +2141 2389 4.16666666666667e+00 +2141 2144 -1.25000000000000e+01 +2141 2143 8.33333333333333e+00 +2141 2388 -8.33333333333333e+00 +2141 2401 -4.16666666666667e+00 +2141 2400 8.33333333333333e+00 +2141 2402 -1.25000000000000e+01 +2141 2149 -8.33333333333333e+00 +2141 2148 4.16666666666667e+00 +2141 2391 8.33333333333333e+00 +2141 2139 -1.66666666666667e+01 +2141 2393 -3.75000000000000e+01 +2141 2392 8.33333333333333e+00 +2141 1938 -4.16666666666667e+00 +2141 2385 4.16666666666667e+00 +2141 2386 -8.33333333333333e+00 +2141 2397 -4.16666666666667e+00 +2141 2394 4.16666666666667e+00 +2141 2398 8.33333333333333e+00 +2141 2140 -1.66666666666667e+01 +2141 2146 8.33333333333333e+00 +2141 2399 -1.25000000000000e+01 +2141 2395 4.16666666666667e+00 +2141 1939 -4.16666666666667e+00 +2141 2147 -3.75000000000000e+01 +2141 2142 -4.16666666666667e+00 +2141 2145 8.33333333333333e+00 +2141 1507 4.16666666666667e+00 +2141 1506 4.16666666666667e+00 +2141 1293 -4.16666666666667e+00 +2141 1504 -4.16666666666667e+00 +2141 1505 -1.25000000000000e+01 +2141 1503 8.33333333333333e+00 +2141 1510 4.16666666666667e+00 +2141 1294 -4.16666666666667e+00 +2141 1509 -8.33333333333333e+00 +2142 2142 6.25000000000000e+01 +2142 2392 4.16666666666667e+00 +2142 2393 4.16666666666667e+00 +2142 2435 4.16666666666667e+00 +2142 2433 -6.25000000000000e+00 +2142 2143 -8.33333333333333e+00 +2142 2141 -4.16666666666667e+00 +2142 2144 -8.33333333333333e+00 +2142 2390 -4.16666666666667e+00 +2142 2402 4.16666666666667e+00 +2142 2437 4.16666666666667e+00 +2142 2140 8.33333333333333e+00 +2142 2401 -8.33333333333333e+00 +2142 2438 4.16666666666667e+00 +2142 1958 -4.16666666666667e+00 +2142 1957 2.08333333333333e+00 +2142 2389 -4.16666666666667e+00 +2142 2436 -1.87500000000000e+01 +2142 2150 4.16666666666667e+00 +2142 2149 -2.08333333333333e+00 +2142 2148 -6.25000000000000e+00 +2142 2434 -2.08333333333333e+00 +2142 2139 -1.25000000000000e+01 +2142 1508 4.16666666666667e+00 +2142 1507 4.16666666666667e+00 +2142 1506 -1.87500000000000e+01 +2142 1295 -4.16666666666667e+00 +2142 1294 2.08333333333333e+00 +2143 2143 6.25000000000000e+01 +2143 2433 -2.08333333333333e+00 +2143 2391 4.16666666666667e+00 +2143 2393 -8.33333333333333e+00 +2143 1958 2.08333333333333e+00 +2143 2434 -6.25000000000000e+00 +2143 2142 -8.33333333333333e+00 +2143 2438 -2.08333333333333e+00 +2143 2436 4.16666666666667e+00 +2143 2390 -4.16666666666667e+00 +2143 2402 4.16666666666667e+00 +2143 2139 8.33333333333333e+00 +2143 2400 -8.33333333333333e+00 +2143 2437 -6.25000000000000e+00 +2143 1956 2.08333333333333e+00 +2143 2388 -4.16666666666667e+00 +2143 2150 4.16666666666667e+00 +2143 2144 -8.33333333333333e+00 +2143 2141 8.33333333333333e+00 +2143 2149 -6.25000000000000e+00 +2143 2435 4.16666666666667e+00 +2143 2140 -3.75000000000000e+01 +2143 2148 -2.08333333333333e+00 +2143 1508 -2.08333333333333e+00 +2143 1295 2.08333333333333e+00 +2143 1507 -6.25000000000000e+00 +2143 1506 4.16666666666667e+00 +2143 1293 2.08333333333333e+00 +2144 2144 6.25000000000000e+01 +2144 2392 -8.33333333333333e+00 +2144 2391 4.16666666666667e+00 +2144 2435 -1.87500000000000e+01 +2144 1957 2.08333333333333e+00 +2144 2433 4.16666666666667e+00 +2144 2139 -4.16666666666667e+00 +2144 2437 -2.08333333333333e+00 +2144 2142 -8.33333333333333e+00 +2144 2388 -4.16666666666667e+00 +2144 2400 4.16666666666667e+00 +2144 2389 -4.16666666666667e+00 +2144 2401 4.16666666666667e+00 +2144 2438 -6.25000000000000e+00 +2144 2436 4.16666666666667e+00 +2144 1956 -4.16666666666667e+00 +2144 2150 -1.87500000000000e+01 +2144 2434 4.16666666666667e+00 +2144 2141 -1.25000000000000e+01 +2144 2149 4.16666666666667e+00 +2144 2143 -8.33333333333333e+00 +2144 2140 8.33333333333333e+00 +2144 2148 4.16666666666667e+00 +2144 1508 -6.25000000000000e+00 +2144 1507 -2.08333333333333e+00 +2144 1294 2.08333333333333e+00 +2144 1506 4.16666666666667e+00 +2144 1293 -4.16666666666667e+00 +2145 2145 6.25000000000000e+01 +2145 2402 -8.33333333333333e+00 +2145 2401 4.16666666666667e+00 +2145 1976 2.08333333333333e+00 +2145 2473 4.16666666666667e+00 +2145 2472 -1.87500000000000e+01 +2145 2150 -2.08333333333333e+00 +2145 2149 4.16666666666667e+00 +2145 2148 -6.25000000000000e+00 +2145 2396 -4.16666666666667e+00 +2145 2395 -4.16666666666667e+00 +2145 2399 4.16666666666667e+00 +2145 2471 -2.08333333333333e+00 +2145 2146 -8.33333333333333e+00 +2145 2398 4.16666666666667e+00 +2145 2140 -4.16666666666667e+00 +2145 1975 -4.16666666666667e+00 +2145 2470 4.16666666666667e+00 +2145 2469 -6.25000000000000e+00 +2145 2147 -8.33333333333333e+00 +2145 2141 8.33333333333333e+00 +2145 2474 4.16666666666667e+00 +2145 2139 -1.25000000000000e+01 +2145 1295 2.08333333333333e+00 +2145 1511 4.16666666666667e+00 +2145 1510 4.16666666666667e+00 +2145 1294 -4.16666666666667e+00 +2145 1509 -1.87500000000000e+01 +2146 2146 6.25000000000000e+01 +2146 2402 4.16666666666667e+00 +2146 2400 4.16666666666667e+00 +2146 2473 -6.25000000000000e+00 +2146 2472 4.16666666666667e+00 +2146 2150 4.16666666666667e+00 +2146 2147 -8.33333333333333e+00 +2146 2149 -1.87500000000000e+01 +2146 2148 4.16666666666667e+00 +2146 2394 -4.16666666666667e+00 +2146 2471 4.16666666666667e+00 +2146 2145 -8.33333333333333e+00 +2146 2399 -8.33333333333333e+00 +2146 2141 8.33333333333333e+00 +2146 2397 4.16666666666667e+00 +2146 2139 -4.16666666666667e+00 +2146 1976 2.08333333333333e+00 +2146 2396 -4.16666666666667e+00 +2146 2470 -1.87500000000000e+01 +2146 1974 -4.16666666666667e+00 +2146 2469 4.16666666666667e+00 +2146 2474 -2.08333333333333e+00 +2146 2140 -1.25000000000000e+01 +2146 1511 -2.08333333333333e+00 +2146 1295 2.08333333333333e+00 +2146 1510 -6.25000000000000e+00 +2146 1509 4.16666666666667e+00 +2146 1293 -4.16666666666667e+00 +2147 2147 6.25000000000000e+01 +2147 2401 4.16666666666667e+00 +2147 2472 4.16666666666667e+00 +2147 2400 -8.33333333333333e+00 +2147 2474 -6.25000000000000e+00 +2147 1974 2.08333333333333e+00 +2147 2150 -6.25000000000000e+00 +2147 2149 4.16666666666667e+00 +2147 2146 -8.33333333333333e+00 +2147 2148 -2.08333333333333e+00 +2147 2394 -4.16666666666667e+00 +2147 2470 4.16666666666667e+00 +2147 2397 4.16666666666667e+00 +2147 2469 -2.08333333333333e+00 +2147 2398 -8.33333333333333e+00 +2147 2140 8.33333333333333e+00 +2147 2471 -6.25000000000000e+00 +2147 1975 2.08333333333333e+00 +2147 2395 -4.16666666666667e+00 +2147 2473 -2.08333333333333e+00 +2147 2141 -3.75000000000000e+01 +2147 2145 -8.33333333333333e+00 +2147 2139 8.33333333333333e+00 +2147 1293 2.08333333333333e+00 +2147 1511 -6.25000000000000e+00 +2147 1510 -2.08333333333333e+00 +2147 1294 2.08333333333333e+00 +2147 1509 4.16666666666667e+00 +2148 2148 3.75000000000000e+01 +2148 2438 -4.16666666666667e+00 +2148 2437 2.08333333333333e+00 +2148 2150 -4.16666666666667e+00 +2148 2144 4.16666666666667e+00 +2148 2143 -2.08333333333333e+00 +2148 2142 -6.25000000000000e+00 +2148 2401 -4.16666666666667e+00 +2148 2140 4.16666666666667e+00 +2148 2474 2.08333333333333e+00 +2148 2402 -4.16666666666667e+00 +2148 1981 2.08333333333333e+00 +2148 2473 -4.16666666666667e+00 +2148 1980 -1.25000000000000e+01 +2148 2147 -2.08333333333333e+00 +2148 2141 4.16666666666667e+00 +2148 2149 -4.16666666666667e+00 +2148 2146 4.16666666666667e+00 +2148 1982 2.08333333333333e+00 +2148 2145 -6.25000000000000e+00 +2148 1295 2.08333333333333e+00 +2148 1294 2.08333333333333e+00 +2148 1293 -1.25000000000000e+01 +2149 2149 3.33333333333333e+01 +2149 2436 2.08333333333333e+00 +2149 2144 4.16666666666667e+00 +2149 2143 -6.25000000000000e+00 +2149 2142 -2.08333333333333e+00 +2149 2474 2.08333333333333e+00 +2149 2402 -4.16666666666667e+00 +2149 2400 -4.16666666666667e+00 +2149 2139 4.16666666666667e+00 +2149 1981 -4.16666666666667e+00 +2149 1980 2.08333333333333e+00 +2149 2472 -4.16666666666667e+00 +2149 2147 4.16666666666667e+00 +2149 2141 -8.33333333333333e+00 +2149 2438 2.08333333333333e+00 +2149 2146 -1.87500000000000e+01 +2149 2148 -4.16666666666667e+00 +2149 2145 4.16666666666667e+00 +2149 1294 -4.16666666666667e+00 +2149 1293 2.08333333333333e+00 +2150 2150 3.33333333333333e+01 +2150 1980 2.08333333333333e+00 +2150 2436 -4.16666666666667e+00 +2150 2144 -1.87500000000000e+01 +2150 2143 4.16666666666667e+00 +2150 2148 -4.16666666666667e+00 +2150 2142 4.16666666666667e+00 +2150 2473 2.08333333333333e+00 +2150 2401 -4.16666666666667e+00 +2150 1982 -4.16666666666667e+00 +2150 2472 2.08333333333333e+00 +2150 2400 -4.16666666666667e+00 +2150 2437 2.08333333333333e+00 +2150 2147 -6.25000000000000e+00 +2150 2146 4.16666666666667e+00 +2150 2140 -8.33333333333333e+00 +2150 2145 -2.08333333333333e+00 +2150 2139 4.16666666666667e+00 +2150 1293 2.08333333333333e+00 +2150 1295 -4.16666666666667e+00 +2151 2151 6.25000000000000e+01 +2151 2195 -4.16666666666667e+00 +2151 2167 4.16666666666667e+00 +2151 2194 -4.16666666666667e+00 +2151 2191 -4.16666666666667e+00 +2151 2162 4.16666666666667e+00 +2151 2168 -8.33333333333333e+00 +2151 2161 4.16666666666667e+00 +2151 2160 -1.87500000000000e+01 +2151 1991 4.16666666666667e+00 +2151 2153 -8.33333333333333e+00 +2151 2159 8.33333333333333e+00 +2151 2188 4.16666666666667e+00 +2151 2158 -4.16666666666667e+00 +2151 1901 -2.08333333333333e+00 +2151 1985 2.08333333333333e+00 +2151 1900 4.16666666666667e+00 +2151 1984 -4.16666666666667e+00 +2151 1899 -6.25000000000000e+00 +2151 2157 -1.25000000000000e+01 +2151 1907 -2.08333333333333e+00 +2151 2189 4.16666666666667e+00 +2151 2152 -8.33333333333333e+00 +2151 1906 4.16666666666667e+00 +2151 1990 4.16666666666667e+00 +2151 2192 2.08333333333333e+00 +2151 1905 -6.25000000000000e+00 +2151 1989 -1.87500000000000e+01 +2152 2152 6.25000000000000e+01 +2152 2193 -4.16666666666667e+00 +2152 2192 2.08333333333333e+00 +2152 2195 -4.16666666666667e+00 +2152 2190 -4.16666666666667e+00 +2152 2162 -2.08333333333333e+00 +2152 2168 4.16666666666667e+00 +2152 2161 -6.25000000000000e+00 +2152 2160 4.16666666666667e+00 +2152 1991 -2.08333333333333e+00 +2152 1985 2.08333333333333e+00 +2152 2187 4.16666666666667e+00 +2152 2157 -4.16666666666667e+00 +2152 1901 4.16666666666667e+00 +2152 2153 -8.33333333333333e+00 +2152 2159 8.33333333333333e+00 +2152 1900 -1.87500000000000e+01 +2152 2158 -1.25000000000000e+01 +2152 1899 4.16666666666667e+00 +2152 1983 -4.16666666666667e+00 +2152 1907 4.16666666666667e+00 +2152 2189 -8.33333333333333e+00 +2152 2166 4.16666666666667e+00 +2152 1906 -1.87500000000000e+01 +2152 1990 -6.25000000000000e+00 +2152 2151 -8.33333333333333e+00 +2152 1905 4.16666666666667e+00 +2152 1989 4.16666666666667e+00 +2153 2153 6.25000000000000e+01 +2153 2193 -4.16666666666667e+00 +2153 2191 2.08333333333333e+00 +2153 2194 -4.16666666666667e+00 +2153 2162 -6.25000000000000e+00 +2153 2161 -2.08333333333333e+00 +2153 2167 4.16666666666667e+00 +2153 2160 4.16666666666667e+00 +2153 2166 -8.33333333333333e+00 +2153 1990 -2.08333333333333e+00 +2153 1984 2.08333333333333e+00 +2153 1989 4.16666666666667e+00 +2153 2151 -8.33333333333333e+00 +2153 2157 8.33333333333333e+00 +2153 1901 -6.25000000000000e+00 +2153 2159 -3.75000000000000e+01 +2153 1900 4.16666666666667e+00 +2153 2152 -8.33333333333333e+00 +2153 2158 8.33333333333333e+00 +2153 1899 -2.08333333333333e+00 +2153 1983 2.08333333333333e+00 +2153 2190 2.08333333333333e+00 +2153 1907 -6.25000000000000e+00 +2153 1991 -6.25000000000000e+00 +2153 1906 4.16666666666667e+00 +2153 2188 -8.33333333333333e+00 +2153 1905 -2.08333333333333e+00 +2153 2187 4.16666666666667e+00 +2154 2154 6.25000000000000e+01 +2154 2165 4.16666666666667e+00 +2154 2164 4.16666666666667e+00 +2154 2163 -1.87500000000000e+01 +2154 2228 -4.16666666666667e+00 +2154 2230 -4.16666666666667e+00 +2154 2168 4.16666666666667e+00 +2154 2167 -8.33333333333333e+00 +2154 2231 -4.16666666666667e+00 +2154 2225 4.16666666666667e+00 +2154 2159 -4.16666666666667e+00 +2154 2155 -8.33333333333333e+00 +2154 2158 8.33333333333333e+00 +2154 1996 4.16666666666667e+00 +2154 1901 4.16666666666667e+00 +2154 1985 -4.16666666666667e+00 +2154 1900 -2.08333333333333e+00 +2154 1984 2.08333333333333e+00 +2154 1899 -6.25000000000000e+00 +2154 2157 -1.25000000000000e+01 +2154 2156 -8.33333333333333e+00 +2154 1913 4.16666666666667e+00 +2154 1997 4.16666666666667e+00 +2154 1912 -2.08333333333333e+00 +2154 2224 4.16666666666667e+00 +2154 2227 2.08333333333333e+00 +2154 1911 -6.25000000000000e+00 +2154 1995 -1.87500000000000e+01 +2155 2155 6.25000000000000e+01 +2155 2165 -2.08333333333333e+00 +2155 2164 -6.25000000000000e+00 +2155 2163 4.16666666666667e+00 +2155 2228 2.08333333333333e+00 +2155 2168 4.16666666666667e+00 +2155 2231 -4.16666666666667e+00 +2155 2229 -4.16666666666667e+00 +2155 2166 -8.33333333333333e+00 +2155 1985 2.08333333333333e+00 +2155 1997 -2.08333333333333e+00 +2155 2154 -8.33333333333333e+00 +2155 2157 8.33333333333333e+00 +2155 1995 4.16666666666667e+00 +2155 1901 4.16666666666667e+00 +2155 2156 -8.33333333333333e+00 +2155 2159 8.33333333333333e+00 +2155 1900 -6.25000000000000e+00 +2155 2158 -3.75000000000000e+01 +2155 1899 -2.08333333333333e+00 +2155 1983 2.08333333333333e+00 +2155 1913 4.16666666666667e+00 +2155 2225 -8.33333333333333e+00 +2155 2226 2.08333333333333e+00 +2155 1912 -6.25000000000000e+00 +2155 1996 -6.25000000000000e+00 +2155 1911 -2.08333333333333e+00 +2155 2223 4.16666666666667e+00 +2156 2156 6.25000000000000e+01 +2156 2164 -2.08333333333333e+00 +2156 2163 4.16666666666667e+00 +2156 2227 2.08333333333333e+00 +2156 2226 -4.16666666666667e+00 +2156 2167 4.16666666666667e+00 +2156 2230 -4.16666666666667e+00 +2156 2166 4.16666666666667e+00 +2156 2229 -4.16666666666667e+00 +2156 2223 4.16666666666667e+00 +2156 2157 -4.16666666666667e+00 +2156 1984 2.08333333333333e+00 +2156 1996 -2.08333333333333e+00 +2156 1901 -1.87500000000000e+01 +2156 2159 -1.25000000000000e+01 +2156 1900 4.16666666666667e+00 +2156 2155 -8.33333333333333e+00 +2156 2158 8.33333333333333e+00 +2156 1899 4.16666666666667e+00 +2156 1983 -4.16666666666667e+00 +2156 2165 -6.25000000000000e+00 +2156 1913 -1.87500000000000e+01 +2156 1997 -6.25000000000000e+00 +2156 1912 4.16666666666667e+00 +2156 2224 -8.33333333333333e+00 +2156 2154 -8.33333333333333e+00 +2156 1911 4.16666666666667e+00 +2156 1995 4.16666666666667e+00 +2157 2157 1.25000000000000e+02 +2157 2194 -8.33333333333333e+00 +2157 2153 8.33333333333333e+00 +2157 1990 4.16666666666667e+00 +2157 2152 -4.16666666666667e+00 +2157 1991 -8.33333333333333e+00 +2157 2151 -1.25000000000000e+01 +2157 2189 -4.16666666666667e+00 +2157 2188 8.33333333333333e+00 +2157 2187 -1.25000000000000e+01 +2157 2260 -4.16666666666667e+00 +2157 2168 8.33333333333333e+00 +2157 2231 -8.33333333333333e+00 +2157 2230 4.16666666666667e+00 +2157 1901 4.16666666666667e+00 +2157 2167 8.33333333333333e+00 +2157 2158 -1.66666666666667e+01 +2157 2166 -3.75000000000000e+01 +2157 2261 -4.16666666666667e+00 +2157 1919 4.16666666666667e+00 +2157 2156 -4.16666666666667e+00 +2157 2155 8.33333333333333e+00 +2157 1985 -4.16666666666667e+00 +2157 1997 4.16666666666667e+00 +2157 2002 8.33333333333333e+00 +2157 1996 -8.33333333333333e+00 +2157 1900 4.16666666666667e+00 +2157 1984 -4.16666666666667e+00 +2157 2154 -1.25000000000000e+01 +2157 2159 -1.66666666666667e+01 +2157 2225 8.33333333333333e+00 +2157 2003 8.33333333333333e+00 +2157 2224 -4.16666666666667e+00 +2157 1918 4.16666666666667e+00 +2157 2195 4.16666666666667e+00 +2157 2223 -1.25000000000000e+01 +2157 2001 -3.75000000000000e+01 +2158 2158 1.25000000000000e+02 +2158 2193 -8.33333333333333e+00 +2158 1989 4.16666666666667e+00 +2158 2151 -4.16666666666667e+00 +2158 1991 4.16666666666667e+00 +2158 2153 8.33333333333333e+00 +2158 2152 -1.25000000000000e+01 +2158 2189 8.33333333333333e+00 +2158 2188 -3.75000000000000e+01 +2158 2187 8.33333333333333e+00 +2158 2261 -4.16666666666667e+00 +2158 2259 -4.16666666666667e+00 +2158 2168 -4.16666666666667e+00 +2158 2231 4.16666666666667e+00 +2158 2229 4.16666666666667e+00 +2158 2167 -1.25000000000000e+01 +2158 2166 8.33333333333333e+00 +2158 2157 -1.66666666666667e+01 +2158 2003 -4.16666666666667e+00 +2158 2159 -1.66666666666667e+01 +2158 1985 -4.16666666666667e+00 +2158 1997 4.16666666666667e+00 +2158 2154 8.33333333333333e+00 +2158 2001 8.33333333333333e+00 +2158 1995 -8.33333333333333e+00 +2158 1901 -8.33333333333333e+00 +2158 2156 8.33333333333333e+00 +2158 2155 -3.75000000000000e+01 +2158 1899 4.16666666666667e+00 +2158 1983 -4.16666666666667e+00 +2158 2225 8.33333333333333e+00 +2158 1919 -8.33333333333333e+00 +2158 2195 4.16666666666667e+00 +2158 2224 -1.25000000000000e+01 +2158 2002 -1.25000000000000e+01 +2158 2223 -4.16666666666667e+00 +2158 1917 4.16666666666667e+00 +2159 2159 1.25000000000000e+02 +2159 2193 4.16666666666667e+00 +2159 2151 8.33333333333333e+00 +2159 1990 4.16666666666667e+00 +2159 1989 -8.33333333333333e+00 +2159 2153 -3.75000000000000e+01 +2159 2152 8.33333333333333e+00 +2159 2189 -1.25000000000000e+01 +2159 2188 8.33333333333333e+00 +2159 2187 -4.16666666666667e+00 +2159 2260 -4.16666666666667e+00 +2159 2167 -4.16666666666667e+00 +2159 2230 4.16666666666667e+00 +2159 2166 8.33333333333333e+00 +2159 2229 -8.33333333333333e+00 +2159 2168 -1.25000000000000e+01 +2159 1899 4.16666666666667e+00 +2159 2259 -4.16666666666667e+00 +2159 1917 4.16666666666667e+00 +2159 2002 -4.16666666666667e+00 +2159 2158 -1.66666666666667e+01 +2159 2154 -4.16666666666667e+00 +2159 1984 -4.16666666666667e+00 +2159 1996 4.16666666666667e+00 +2159 1983 -4.16666666666667e+00 +2159 1995 4.16666666666667e+00 +2159 2156 -1.25000000000000e+01 +2159 1900 -8.33333333333333e+00 +2159 2155 8.33333333333333e+00 +2159 2194 4.16666666666667e+00 +2159 2225 -3.75000000000000e+01 +2159 2003 -1.25000000000000e+01 +2159 2224 8.33333333333333e+00 +2159 1918 -8.33333333333333e+00 +2159 2157 -1.66666666666667e+01 +2159 2223 8.33333333333333e+00 +2159 2001 8.33333333333333e+00 +2160 2160 6.25000000000000e+01 +2160 2194 4.16666666666667e+00 +2160 2195 4.16666666666667e+00 +2160 2153 4.16666666666667e+00 +2160 2162 -8.33333333333333e+00 +2160 2152 4.16666666666667e+00 +2160 2151 -1.87500000000000e+01 +2160 2191 4.16666666666667e+00 +2160 2190 -6.25000000000000e+00 +2160 2167 -4.16666666666667e+00 +2160 2161 -8.33333333333333e+00 +2160 2012 4.16666666666667e+00 +2160 2299 -4.16666666666667e+00 +2160 2023 4.16666666666667e+00 +2160 2168 8.33333333333333e+00 +2160 2024 -8.33333333333333e+00 +2160 1925 2.08333333333333e+00 +2160 2300 -4.16666666666667e+00 +2160 2011 4.16666666666667e+00 +2160 1924 -4.16666666666667e+00 +2160 2010 -1.87500000000000e+01 +2160 2006 -2.08333333333333e+00 +2160 1901 2.08333333333333e+00 +2160 2005 4.16666666666667e+00 +2160 1900 -4.16666666666667e+00 +2160 2004 -6.25000000000000e+00 +2160 2192 -2.08333333333333e+00 +2160 2166 -1.25000000000000e+01 +2161 2161 6.25000000000000e+01 +2161 2193 4.16666666666667e+00 +2161 2195 -8.33333333333333e+00 +2161 2153 -2.08333333333333e+00 +2161 1901 2.08333333333333e+00 +2161 2152 -6.25000000000000e+00 +2161 2151 4.16666666666667e+00 +2161 1925 2.08333333333333e+00 +2161 2191 -1.87500000000000e+01 +2161 2190 4.16666666666667e+00 +2161 2166 -4.16666666666667e+00 +2161 2012 -2.08333333333333e+00 +2161 2160 -8.33333333333333e+00 +2161 2298 -4.16666666666667e+00 +2161 2022 4.16666666666667e+00 +2161 2300 -4.16666666666667e+00 +2161 2024 4.16666666666667e+00 +2161 2011 -6.25000000000000e+00 +2161 2010 4.16666666666667e+00 +2161 1923 -4.16666666666667e+00 +2161 2006 4.16666666666667e+00 +2161 2162 -8.33333333333333e+00 +2161 2168 8.33333333333333e+00 +2161 2005 -1.87500000000000e+01 +2161 2192 4.16666666666667e+00 +2161 2167 -1.25000000000000e+01 +2161 2004 4.16666666666667e+00 +2161 1899 -4.16666666666667e+00 +2162 2162 6.25000000000000e+01 +2162 2190 -2.08333333333333e+00 +2162 2194 -8.33333333333333e+00 +2162 2193 4.16666666666667e+00 +2162 2153 -6.25000000000000e+00 +2162 2152 -2.08333333333333e+00 +2162 1900 2.08333333333333e+00 +2162 2151 4.16666666666667e+00 +2162 2160 -8.33333333333333e+00 +2162 2192 -6.25000000000000e+00 +2162 1924 2.08333333333333e+00 +2162 2011 -2.08333333333333e+00 +2162 2010 4.16666666666667e+00 +2162 2299 -4.16666666666667e+00 +2162 2023 4.16666666666667e+00 +2162 2166 8.33333333333333e+00 +2162 2022 -8.33333333333333e+00 +2162 2012 -6.25000000000000e+00 +2162 1923 2.08333333333333e+00 +2162 2298 -4.16666666666667e+00 +2162 2006 -6.25000000000000e+00 +2162 2191 4.16666666666667e+00 +2162 2168 -3.75000000000000e+01 +2162 2005 4.16666666666667e+00 +2162 2161 -8.33333333333333e+00 +2162 2167 8.33333333333333e+00 +2162 2004 -2.08333333333333e+00 +2162 1899 2.08333333333333e+00 +2163 2163 6.25000000000000e+01 +2163 2227 -2.08333333333333e+00 +2163 2230 4.16666666666667e+00 +2163 2228 4.16666666666667e+00 +2163 2226 -6.25000000000000e+00 +2163 2156 4.16666666666667e+00 +2163 2164 -8.33333333333333e+00 +2163 2155 4.16666666666667e+00 +2163 2154 -1.87500000000000e+01 +2163 2336 -4.16666666666667e+00 +2163 2165 -8.33333333333333e+00 +2163 2017 4.16666666666667e+00 +2163 2024 4.16666666666667e+00 +2163 2168 -4.16666666666667e+00 +2163 2023 -8.33333333333333e+00 +2163 2167 8.33333333333333e+00 +2163 2018 4.16666666666667e+00 +2163 1931 -4.16666666666667e+00 +2163 1930 2.08333333333333e+00 +2163 2335 -4.16666666666667e+00 +2163 2016 -1.87500000000000e+01 +2163 2006 4.16666666666667e+00 +2163 1901 -4.16666666666667e+00 +2163 2005 -2.08333333333333e+00 +2163 1900 2.08333333333333e+00 +2163 2004 -6.25000000000000e+00 +2163 2231 4.16666666666667e+00 +2163 2166 -1.25000000000000e+01 +2164 2164 6.25000000000000e+01 +2164 2231 -8.33333333333333e+00 +2164 2226 -2.08333333333333e+00 +2164 2229 4.16666666666667e+00 +2164 1931 2.08333333333333e+00 +2164 2227 -6.25000000000000e+00 +2164 1901 2.08333333333333e+00 +2164 2156 -2.08333333333333e+00 +2164 2155 -6.25000000000000e+00 +2164 2163 -8.33333333333333e+00 +2164 2154 4.16666666666667e+00 +2164 2336 -4.16666666666667e+00 +2164 2018 -2.08333333333333e+00 +2164 2024 4.16666666666667e+00 +2164 2016 4.16666666666667e+00 +2164 2022 -8.33333333333333e+00 +2164 2166 8.33333333333333e+00 +2164 2017 -6.25000000000000e+00 +2164 1929 2.08333333333333e+00 +2164 2334 -4.16666666666667e+00 +2164 2006 4.16666666666667e+00 +2164 2165 -8.33333333333333e+00 +2164 2168 8.33333333333333e+00 +2164 2005 -6.25000000000000e+00 +2164 2228 4.16666666666667e+00 +2164 2167 -3.75000000000000e+01 +2164 2004 -2.08333333333333e+00 +2164 1899 2.08333333333333e+00 +2165 2165 6.25000000000000e+01 +2165 2227 4.16666666666667e+00 +2165 2230 -8.33333333333333e+00 +2165 2228 -1.87500000000000e+01 +2165 1930 2.08333333333333e+00 +2165 2226 4.16666666666667e+00 +2165 2156 -6.25000000000000e+00 +2165 1900 2.08333333333333e+00 +2165 2155 -2.08333333333333e+00 +2165 2154 4.16666666666667e+00 +2165 2335 -4.16666666666667e+00 +2165 2334 -4.16666666666667e+00 +2165 2017 -2.08333333333333e+00 +2165 2023 4.16666666666667e+00 +2165 2163 -8.33333333333333e+00 +2165 2022 4.16666666666667e+00 +2165 2166 -4.16666666666667e+00 +2165 2018 -6.25000000000000e+00 +2165 2016 4.16666666666667e+00 +2165 1929 -4.16666666666667e+00 +2165 2006 -1.87500000000000e+01 +2165 2229 4.16666666666667e+00 +2165 2168 -1.25000000000000e+01 +2165 2005 4.16666666666667e+00 +2165 2164 -8.33333333333333e+00 +2165 2167 8.33333333333333e+00 +2165 2004 4.16666666666667e+00 +2165 1899 -4.16666666666667e+00 +2166 2166 1.25000000000000e+02 +2166 2195 -4.16666666666667e+00 +2166 2153 -8.33333333333333e+00 +2166 2194 8.33333333333333e+00 +2166 2193 -1.25000000000000e+01 +2166 2161 -4.16666666666667e+00 +2166 2162 8.33333333333333e+00 +2166 2160 -1.25000000000000e+01 +2166 2300 4.16666666666667e+00 +2166 2299 -8.33333333333333e+00 +2166 2260 4.16666666666667e+00 +2166 2230 -4.16666666666667e+00 +2166 2168 -1.66666666666667e+01 +2166 2159 8.33333333333333e+00 +2166 2231 8.33333333333333e+00 +2166 1901 -4.16666666666667e+00 +2166 2156 4.16666666666667e+00 +2166 2158 8.33333333333333e+00 +2166 2155 -8.33333333333333e+00 +2166 2157 -3.75000000000000e+01 +2166 1937 -4.16666666666667e+00 +2166 2261 4.16666666666667e+00 +2166 2229 -1.25000000000000e+01 +2166 2006 4.16666666666667e+00 +2166 2165 -4.16666666666667e+00 +2166 2023 8.33333333333333e+00 +2166 2167 -1.66666666666667e+01 +2166 2164 8.33333333333333e+00 +2166 2024 8.33333333333333e+00 +2166 2336 -8.33333333333333e+00 +2166 2335 4.16666666666667e+00 +2166 1936 -4.16666666666667e+00 +2166 2022 -3.75000000000000e+01 +2166 2005 4.16666666666667e+00 +2166 1900 -4.16666666666667e+00 +2166 2163 -1.25000000000000e+01 +2166 2152 4.16666666666667e+00 +2167 2167 1.25000000000000e+02 +2167 2195 8.33333333333333e+00 +2167 2153 4.16666666666667e+00 +2167 2194 -3.75000000000000e+01 +2167 2193 8.33333333333333e+00 +2167 2160 -4.16666666666667e+00 +2167 2300 4.16666666666667e+00 +2167 2162 8.33333333333333e+00 +2167 2161 -1.25000000000000e+01 +2167 2298 -8.33333333333333e+00 +2167 2168 -1.66666666666667e+01 +2167 1937 -4.16666666666667e+00 +2167 1901 -4.16666666666667e+00 +2167 2259 4.16666666666667e+00 +2167 2229 -4.16666666666667e+00 +2167 2159 -4.16666666666667e+00 +2167 2156 4.16666666666667e+00 +2167 2158 -1.25000000000000e+01 +2167 2157 8.33333333333333e+00 +2167 2154 -8.33333333333333e+00 +2167 2261 -8.33333333333333e+00 +2167 2231 8.33333333333333e+00 +2167 2230 -1.25000000000000e+01 +2167 2024 -4.16666666666667e+00 +2167 2336 4.16666666666667e+00 +2167 2022 8.33333333333333e+00 +2167 2166 -1.66666666666667e+01 +2167 2163 8.33333333333333e+00 +2167 2023 -1.25000000000000e+01 +2167 2334 4.16666666666667e+00 +2167 1935 -4.16666666666667e+00 +2167 2006 -8.33333333333333e+00 +2167 2165 8.33333333333333e+00 +2167 2164 -3.75000000000000e+01 +2167 2151 4.16666666666667e+00 +2167 2004 4.16666666666667e+00 +2167 1899 -4.16666666666667e+00 +2168 2168 1.25000000000000e+02 +2168 2193 -4.16666666666667e+00 +2168 2152 4.16666666666667e+00 +2168 2151 -8.33333333333333e+00 +2168 2195 -1.25000000000000e+01 +2168 2299 4.16666666666667e+00 +2168 2160 8.33333333333333e+00 +2168 2162 -3.75000000000000e+01 +2168 2161 8.33333333333333e+00 +2168 2298 4.16666666666667e+00 +2168 2167 -1.66666666666667e+01 +2168 1936 -4.16666666666667e+00 +2168 1900 -4.16666666666667e+00 +2168 2158 -4.16666666666667e+00 +2168 2155 4.16666666666667e+00 +2168 2166 -1.66666666666667e+01 +2168 2157 8.33333333333333e+00 +2168 2229 8.33333333333333e+00 +2168 2159 -1.25000000000000e+01 +2168 1899 -4.16666666666667e+00 +2168 2154 4.16666666666667e+00 +2168 2231 -3.75000000000000e+01 +2168 2260 -8.33333333333333e+00 +2168 2230 8.33333333333333e+00 +2168 1935 -4.16666666666667e+00 +2168 2259 4.16666666666667e+00 +2168 2023 -4.16666666666667e+00 +2168 2335 4.16666666666667e+00 +2168 2004 4.16666666666667e+00 +2168 2163 -4.16666666666667e+00 +2168 2024 -1.25000000000000e+01 +2168 2022 8.33333333333333e+00 +2168 2334 -8.33333333333333e+00 +2168 2165 -1.25000000000000e+01 +2168 2194 8.33333333333333e+00 +2168 2005 -8.33333333333333e+00 +2168 2164 8.33333333333333e+00 +2169 2169 6.25000000000000e+01 +2169 2200 -4.16666666666667e+00 +2169 2180 -2.08333333333333e+00 +2169 2186 4.16666666666667e+00 +2169 2179 4.16666666666667e+00 +2169 2178 -6.25000000000000e+00 +2169 2198 2.08333333333333e+00 +2169 2201 -4.16666666666667e+00 +2169 2197 -4.16666666666667e+00 +2169 1988 0.00000000000000e+00 +2169 1991 -2.08333333333333e+00 +2169 2188 4.16666666666667e+00 +2169 2176 -4.16666666666667e+00 +2169 1907 4.16666666666667e+00 +2169 2189 -8.33333333333333e+00 +2169 1906 4.16666666666667e+00 +2169 2170 -8.33333333333333e+00 +2169 1990 4.16666666666667e+00 +2169 1905 -1.87500000000000e+01 +2169 1989 -6.25000000000000e+00 +2169 2171 -8.33333333333333e+00 +2169 1904 0.00000000000000e+00 +2169 2177 8.33333333333333e+00 +2169 1903 0.00000000000000e+00 +2169 1987 0.00000000000000e+00 +2169 2185 4.16666666666667e+00 +2169 1902 0.00000000000000e+00 +2169 2175 -1.25000000000000e+01 +2170 2170 6.25000000000000e+01 +2170 2201 -4.16666666666667e+00 +2170 2184 4.16666666666667e+00 +2170 2199 -4.16666666666667e+00 +2170 2180 4.16666666666667e+00 +2170 2186 -8.33333333333333e+00 +2170 2179 -1.87500000000000e+01 +2170 2178 4.16666666666667e+00 +2170 2196 -4.16666666666667e+00 +2170 2171 -8.33333333333333e+00 +2170 1991 4.16666666666667e+00 +2170 2177 8.33333333333333e+00 +2170 2187 4.16666666666667e+00 +2170 2175 -4.16666666666667e+00 +2170 1907 -2.08333333333333e+00 +2170 2189 4.16666666666667e+00 +2170 1906 -6.25000000000000e+00 +2170 1990 -1.87500000000000e+01 +2170 1905 4.16666666666667e+00 +2170 2169 -8.33333333333333e+00 +2170 1989 4.16666666666667e+00 +2170 1904 0.00000000000000e+00 +2170 1988 0.00000000000000e+00 +2170 2198 2.08333333333333e+00 +2170 1903 0.00000000000000e+00 +2170 2176 -1.25000000000000e+01 +2170 1902 0.00000000000000e+00 +2170 1986 0.00000000000000e+00 +2171 2171 6.25000000000000e+01 +2171 2200 -4.16666666666667e+00 +2171 2180 -6.25000000000000e+00 +2171 2179 4.16666666666667e+00 +2171 2185 -8.33333333333333e+00 +2171 2178 -2.08333333333333e+00 +2171 2184 4.16666666666667e+00 +2171 2196 2.08333333333333e+00 +2171 2199 -4.16666666666667e+00 +2171 1986 0.00000000000000e+00 +2171 1989 -2.08333333333333e+00 +2171 2170 -8.33333333333333e+00 +2171 1990 4.16666666666667e+00 +2171 2176 8.33333333333333e+00 +2171 1907 -6.25000000000000e+00 +2171 1991 -6.25000000000000e+00 +2171 1906 -2.08333333333333e+00 +2171 2188 4.16666666666667e+00 +2171 1905 4.16666666666667e+00 +2171 2187 -8.33333333333333e+00 +2171 2197 2.08333333333333e+00 +2171 1904 0.00000000000000e+00 +2171 2177 -3.75000000000000e+01 +2171 1903 0.00000000000000e+00 +2171 1987 0.00000000000000e+00 +2171 2169 -8.33333333333333e+00 +2171 1902 0.00000000000000e+00 +2171 2175 8.33333333333333e+00 +2172 2172 1.00000000000000e+00 +2172 2183 0.00000000000000e+00 +2172 2182 0.00000000000000e+00 +2172 2181 0.00000000000000e+00 +2172 2246 0.00000000000000e+00 +2172 2186 0.00000000000000e+00 +2172 2249 0.00000000000000e+00 +2172 2248 0.00000000000000e+00 +2172 2185 0.00000000000000e+00 +2172 1988 0.00000000000000e+00 +2172 2000 0.00000000000000e+00 +2172 2176 0.00000000000000e+00 +2172 2173 0.00000000000000e+00 +2172 1999 0.00000000000000e+00 +2172 1916 0.00000000000000e+00 +2172 2243 0.00000000000000e+00 +2172 1915 0.00000000000000e+00 +2172 2242 0.00000000000000e+00 +2172 1914 0.00000000000000e+00 +2172 1998 0.00000000000000e+00 +2172 2174 0.00000000000000e+00 +2172 1904 0.00000000000000e+00 +2172 2177 0.00000000000000e+00 +2172 1903 0.00000000000000e+00 +2172 1987 0.00000000000000e+00 +2172 2245 0.00000000000000e+00 +2172 1902 0.00000000000000e+00 +2172 2175 0.00000000000000e+00 +2173 2173 1.00000000000000e+00 +2173 2183 0.00000000000000e+00 +2173 2182 0.00000000000000e+00 +2173 2181 0.00000000000000e+00 +2173 2246 0.00000000000000e+00 +2173 2247 0.00000000000000e+00 +2173 2186 0.00000000000000e+00 +2173 2184 0.00000000000000e+00 +2173 2249 0.00000000000000e+00 +2173 2177 0.00000000000000e+00 +2173 2243 0.00000000000000e+00 +2173 2175 0.00000000000000e+00 +2173 2172 0.00000000000000e+00 +2173 1998 0.00000000000000e+00 +2173 1916 0.00000000000000e+00 +2173 2174 0.00000000000000e+00 +2173 2000 0.00000000000000e+00 +2173 1915 0.00000000000000e+00 +2173 1999 0.00000000000000e+00 +2173 1914 0.00000000000000e+00 +2173 2241 0.00000000000000e+00 +2173 1904 0.00000000000000e+00 +2173 1988 0.00000000000000e+00 +2173 2244 0.00000000000000e+00 +2173 1903 0.00000000000000e+00 +2173 2176 0.00000000000000e+00 +2173 1902 0.00000000000000e+00 +2173 1986 0.00000000000000e+00 +2174 2174 1.00000000000000e+00 +2174 2182 0.00000000000000e+00 +2174 2181 0.00000000000000e+00 +2174 2245 0.00000000000000e+00 +2174 2244 0.00000000000000e+00 +2174 2184 0.00000000000000e+00 +2174 2247 0.00000000000000e+00 +2174 2185 0.00000000000000e+00 +2174 2248 0.00000000000000e+00 +2174 2176 0.00000000000000e+00 +2174 2242 0.00000000000000e+00 +2174 1986 0.00000000000000e+00 +2174 1998 0.00000000000000e+00 +2174 1916 0.00000000000000e+00 +2174 2000 0.00000000000000e+00 +2174 1915 0.00000000000000e+00 +2174 2173 0.00000000000000e+00 +2174 1999 0.00000000000000e+00 +2174 1914 0.00000000000000e+00 +2174 2241 0.00000000000000e+00 +2174 2183 0.00000000000000e+00 +2174 1904 0.00000000000000e+00 +2174 2177 0.00000000000000e+00 +2174 1903 0.00000000000000e+00 +2174 1987 0.00000000000000e+00 +2174 2172 0.00000000000000e+00 +2174 1902 0.00000000000000e+00 +2174 2175 0.00000000000000e+00 +2175 2175 1.25000000000000e+02 +2175 2200 -8.33333333333333e+00 +2175 2170 -4.16666666666667e+00 +2175 1990 4.16666666666667e+00 +2175 1991 4.16666666666667e+00 +2175 2171 8.33333333333333e+00 +2175 2169 -1.25000000000000e+01 +2175 2189 8.33333333333333e+00 +2175 2188 8.33333333333333e+00 +2175 2187 -3.75000000000000e+01 +2175 2264 -4.16666666666667e+00 +2175 2263 -4.16666666666667e+00 +2175 2186 -4.16666666666667e+00 +2175 2249 4.16666666666667e+00 +2175 2248 4.16666666666667e+00 +2175 2185 8.33333333333333e+00 +2175 2176 -1.66666666666667e+01 +2175 2184 -1.25000000000000e+01 +2175 2003 -4.16666666666667e+00 +2175 2177 -1.66666666666667e+01 +2175 1988 0.00000000000000e+00 +2175 2000 0.00000000000000e+00 +2175 2173 0.00000000000000e+00 +2175 2002 8.33333333333333e+00 +2175 1999 0.00000000000000e+00 +2175 2174 0.00000000000000e+00 +2175 1904 0.00000000000000e+00 +2175 1903 0.00000000000000e+00 +2175 1987 0.00000000000000e+00 +2175 2172 0.00000000000000e+00 +2175 2243 8.33333333333333e+00 +2175 1919 -8.33333333333333e+00 +2175 2242 -4.16666666666667e+00 +2175 1918 4.16666666666667e+00 +2175 2241 -1.25000000000000e+01 +2175 2201 4.16666666666667e+00 +2175 2001 -1.25000000000000e+01 +2176 2176 1.25000000000000e+02 +2176 2199 -8.33333333333333e+00 +2176 2171 8.33333333333333e+00 +2176 2169 -4.16666666666667e+00 +2176 1989 4.16666666666667e+00 +2176 1991 -8.33333333333333e+00 +2176 2170 -1.25000000000000e+01 +2176 2189 -4.16666666666667e+00 +2176 2188 -1.25000000000000e+01 +2176 2187 8.33333333333333e+00 +2176 2262 -4.16666666666667e+00 +2176 2186 8.33333333333333e+00 +2176 2249 -8.33333333333333e+00 +2176 2247 4.16666666666667e+00 +2176 1904 0.00000000000000e+00 +2176 2185 -3.75000000000000e+01 +2176 2184 8.33333333333333e+00 +2176 2175 -1.66666666666667e+01 +2176 2264 -4.16666666666667e+00 +2176 1919 4.16666666666667e+00 +2176 2174 0.00000000000000e+00 +2176 2172 0.00000000000000e+00 +2176 1988 0.00000000000000e+00 +2176 2000 0.00000000000000e+00 +2176 2001 8.33333333333333e+00 +2176 1998 0.00000000000000e+00 +2176 2173 0.00000000000000e+00 +2176 1902 0.00000000000000e+00 +2176 1986 0.00000000000000e+00 +2176 2243 8.33333333333333e+00 +2176 2177 -1.66666666666667e+01 +2176 2003 8.33333333333333e+00 +2176 2242 -1.25000000000000e+01 +2176 2201 4.16666666666667e+00 +2176 2002 -3.75000000000000e+01 +2176 2241 -4.16666666666667e+00 +2176 1917 4.16666666666667e+00 +2177 2177 1.25000000000000e+02 +2177 2200 4.16666666666667e+00 +2177 2170 8.33333333333333e+00 +2177 1990 -8.33333333333333e+00 +2177 1989 4.16666666666667e+00 +2177 2171 -3.75000000000000e+01 +2177 2169 8.33333333333333e+00 +2177 2189 -1.25000000000000e+01 +2177 2188 -4.16666666666667e+00 +2177 2187 8.33333333333333e+00 +2177 2262 -4.16666666666667e+00 +2177 2185 8.33333333333333e+00 +2177 2184 -4.16666666666667e+00 +2177 2247 4.16666666666667e+00 +2177 2248 -8.33333333333333e+00 +2177 2186 -1.25000000000000e+01 +2177 1903 0.00000000000000e+00 +2177 2263 -4.16666666666667e+00 +2177 1918 4.16666666666667e+00 +2177 2001 -4.16666666666667e+00 +2177 2173 0.00000000000000e+00 +2177 2175 -1.66666666666667e+01 +2177 1986 0.00000000000000e+00 +2177 1998 0.00000000000000e+00 +2177 1987 0.00000000000000e+00 +2177 1999 0.00000000000000e+00 +2177 2174 0.00000000000000e+00 +2177 2172 0.00000000000000e+00 +2177 1902 0.00000000000000e+00 +2177 2243 -3.75000000000000e+01 +2177 2199 4.16666666666667e+00 +2177 2003 -1.25000000000000e+01 +2177 2242 8.33333333333333e+00 +2177 2176 -1.66666666666667e+01 +2177 2002 8.33333333333333e+00 +2177 2241 8.33333333333333e+00 +2177 1917 -8.33333333333333e+00 +2178 2178 6.25000000000000e+01 +2178 2200 4.16666666666667e+00 +2178 2201 -8.33333333333333e+00 +2178 1904 0.00000000000000e+00 +2178 2171 -2.08333333333333e+00 +2178 2170 4.16666666666667e+00 +2178 2169 -6.25000000000000e+00 +2178 1943 2.08333333333333e+00 +2178 2197 4.16666666666667e+00 +2178 2196 -1.87500000000000e+01 +2178 2185 -4.16666666666667e+00 +2178 2036 -2.08333333333333e+00 +2178 2179 -8.33333333333333e+00 +2178 2404 -4.16666666666667e+00 +2178 2041 4.16666666666667e+00 +2178 2405 -4.16666666666667e+00 +2178 2042 4.16666666666667e+00 +2178 1942 -4.16666666666667e+00 +2178 2035 4.16666666666667e+00 +2178 2034 -6.25000000000000e+00 +2178 2180 -8.33333333333333e+00 +2178 2033 0.00000000000000e+00 +2178 2186 8.33333333333333e+00 +2178 2032 0.00000000000000e+00 +2178 1903 0.00000000000000e+00 +2178 2198 4.16666666666667e+00 +2178 2031 0.00000000000000e+00 +2178 2184 -1.25000000000000e+01 +2179 2179 6.25000000000000e+01 +2179 2199 4.16666666666667e+00 +2179 2201 4.16666666666667e+00 +2179 2171 4.16666666666667e+00 +2179 2180 -8.33333333333333e+00 +2179 2170 -1.87500000000000e+01 +2179 2169 4.16666666666667e+00 +2179 2197 -6.25000000000000e+00 +2179 2196 4.16666666666667e+00 +2179 2184 -4.16666666666667e+00 +2179 2178 -8.33333333333333e+00 +2179 2036 4.16666666666667e+00 +2179 2403 -4.16666666666667e+00 +2179 2040 4.16666666666667e+00 +2179 2186 8.33333333333333e+00 +2179 2042 -8.33333333333333e+00 +2179 1943 2.08333333333333e+00 +2179 2405 -4.16666666666667e+00 +2179 2035 -1.87500000000000e+01 +2179 1941 -4.16666666666667e+00 +2179 2034 4.16666666666667e+00 +2179 2033 0.00000000000000e+00 +2179 1904 0.00000000000000e+00 +2179 2198 -2.08333333333333e+00 +2179 2032 0.00000000000000e+00 +2179 2185 -1.25000000000000e+01 +2179 2031 0.00000000000000e+00 +2179 1902 0.00000000000000e+00 +2180 2180 6.25000000000000e+01 +2180 2196 4.16666666666667e+00 +2180 2200 4.16666666666667e+00 +2180 2199 -8.33333333333333e+00 +2180 2171 -6.25000000000000e+00 +2180 2170 4.16666666666667e+00 +2180 2179 -8.33333333333333e+00 +2180 1902 0.00000000000000e+00 +2180 2169 -2.08333333333333e+00 +2180 2198 -6.25000000000000e+00 +2180 1941 2.08333333333333e+00 +2180 2034 -2.08333333333333e+00 +2180 2035 4.16666666666667e+00 +2180 2185 8.33333333333333e+00 +2180 2041 -8.33333333333333e+00 +2180 2403 -4.16666666666667e+00 +2180 2040 4.16666666666667e+00 +2180 2036 -6.25000000000000e+00 +2180 1942 2.08333333333333e+00 +2180 2404 -4.16666666666667e+00 +2180 2197 -2.08333333333333e+00 +2180 2033 0.00000000000000e+00 +2180 2186 -3.75000000000000e+01 +2180 2032 0.00000000000000e+00 +2180 1903 0.00000000000000e+00 +2180 2178 -8.33333333333333e+00 +2180 2031 0.00000000000000e+00 +2180 2184 8.33333333333333e+00 +2181 2181 1.00000000000000e+00 +2181 2249 0.00000000000000e+00 +2181 2245 0.00000000000000e+00 +2181 2248 0.00000000000000e+00 +2181 1946 0.00000000000000e+00 +2181 2244 0.00000000000000e+00 +2181 1904 0.00000000000000e+00 +2181 2174 0.00000000000000e+00 +2181 2182 0.00000000000000e+00 +2181 2173 0.00000000000000e+00 +2181 2172 0.00000000000000e+00 +2181 2411 0.00000000000000e+00 +2181 2042 0.00000000000000e+00 +2181 2039 0.00000000000000e+00 +2181 2038 0.00000000000000e+00 +2181 2041 0.00000000000000e+00 +2181 2185 0.00000000000000e+00 +2181 1945 0.00000000000000e+00 +2181 2410 0.00000000000000e+00 +2181 2037 0.00000000000000e+00 +2181 2183 0.00000000000000e+00 +2181 2033 0.00000000000000e+00 +2181 2186 0.00000000000000e+00 +2181 2032 0.00000000000000e+00 +2181 1903 0.00000000000000e+00 +2181 2246 0.00000000000000e+00 +2181 2031 0.00000000000000e+00 +2181 2184 0.00000000000000e+00 +2182 2182 1.00000000000000e+00 +2182 2244 0.00000000000000e+00 +2182 2247 0.00000000000000e+00 +2182 2246 0.00000000000000e+00 +2182 2245 0.00000000000000e+00 +2182 2174 0.00000000000000e+00 +2182 2173 0.00000000000000e+00 +2182 2181 0.00000000000000e+00 +2182 2172 0.00000000000000e+00 +2182 2411 0.00000000000000e+00 +2182 2183 0.00000000000000e+00 +2182 2037 0.00000000000000e+00 +2182 2042 0.00000000000000e+00 +2182 2186 0.00000000000000e+00 +2182 2040 0.00000000000000e+00 +2182 2184 0.00000000000000e+00 +2182 1946 0.00000000000000e+00 +2182 2039 0.00000000000000e+00 +2182 2038 0.00000000000000e+00 +2182 1944 0.00000000000000e+00 +2182 2409 0.00000000000000e+00 +2182 2033 0.00000000000000e+00 +2182 1904 0.00000000000000e+00 +2182 2249 0.00000000000000e+00 +2182 2032 0.00000000000000e+00 +2182 2185 0.00000000000000e+00 +2182 2031 0.00000000000000e+00 +2182 1902 0.00000000000000e+00 +2183 2183 1.00000000000000e+00 +2183 2244 0.00000000000000e+00 +2183 2247 0.00000000000000e+00 +2183 2246 0.00000000000000e+00 +2183 2245 0.00000000000000e+00 +2183 1944 0.00000000000000e+00 +2183 2174 0.00000000000000e+00 +2183 2173 0.00000000000000e+00 +2183 1902 0.00000000000000e+00 +2183 2172 0.00000000000000e+00 +2183 2409 0.00000000000000e+00 +2183 2410 0.00000000000000e+00 +2183 2182 0.00000000000000e+00 +2183 2040 0.00000000000000e+00 +2183 2037 0.00000000000000e+00 +2183 2041 0.00000000000000e+00 +2183 2185 0.00000000000000e+00 +2183 2039 0.00000000000000e+00 +2183 1945 0.00000000000000e+00 +2183 2038 0.00000000000000e+00 +2183 2248 0.00000000000000e+00 +2183 2033 0.00000000000000e+00 +2183 2186 0.00000000000000e+00 +2183 2032 0.00000000000000e+00 +2183 1903 0.00000000000000e+00 +2183 2181 0.00000000000000e+00 +2183 2031 0.00000000000000e+00 +2183 2184 0.00000000000000e+00 +2184 2184 1.25000000000000e+02 +2184 2201 8.33333333333333e+00 +2184 2171 4.16666666666667e+00 +2184 2200 8.33333333333333e+00 +2184 2199 -3.75000000000000e+01 +2184 2179 -4.16666666666667e+00 +2184 2405 4.16666666666667e+00 +2184 2180 8.33333333333333e+00 +2184 2178 -1.25000000000000e+01 +2184 2404 -8.33333333333333e+00 +2184 2186 -1.66666666666667e+01 +2184 1949 -4.16666666666667e+00 +2184 1904 0.00000000000000e+00 +2184 2263 4.16666666666667e+00 +2184 2248 -4.16666666666667e+00 +2184 2177 -4.16666666666667e+00 +2184 2174 0.00000000000000e+00 +2184 2264 -8.33333333333333e+00 +2184 2249 8.33333333333333e+00 +2184 2247 -1.25000000000000e+01 +2184 2176 8.33333333333333e+00 +2184 2173 0.00000000000000e+00 +2184 2175 -1.25000000000000e+01 +2184 2042 -4.16666666666667e+00 +2184 2411 4.16666666666667e+00 +2184 2041 8.33333333333333e+00 +2184 2185 -1.66666666666667e+01 +2184 2182 0.00000000000000e+00 +2184 2410 4.16666666666667e+00 +2184 1948 -4.16666666666667e+00 +2184 2040 -1.25000000000000e+01 +2184 2183 0.00000000000000e+00 +2184 2033 0.00000000000000e+00 +2184 2032 0.00000000000000e+00 +2184 1903 0.00000000000000e+00 +2184 2181 0.00000000000000e+00 +2184 2170 4.16666666666667e+00 +2185 2185 1.25000000000000e+02 +2185 2201 -4.16666666666667e+00 +2185 2171 -8.33333333333333e+00 +2185 2200 -1.25000000000000e+01 +2185 2199 8.33333333333333e+00 +2185 2178 -4.16666666666667e+00 +2185 2180 8.33333333333333e+00 +2185 2179 -1.25000000000000e+01 +2185 2405 4.16666666666667e+00 +2185 2403 -8.33333333333333e+00 +2185 2262 4.16666666666667e+00 +2185 2247 -4.16666666666667e+00 +2185 2177 8.33333333333333e+00 +2185 2186 -1.66666666666667e+01 +2185 2249 8.33333333333333e+00 +2185 1949 -4.16666666666667e+00 +2185 2264 4.16666666666667e+00 +2185 2248 -1.25000000000000e+01 +2185 1904 0.00000000000000e+00 +2185 2174 0.00000000000000e+00 +2185 2176 -3.75000000000000e+01 +2185 2175 8.33333333333333e+00 +2185 2172 0.00000000000000e+00 +2185 2033 0.00000000000000e+00 +2185 2183 0.00000000000000e+00 +2185 2040 8.33333333333333e+00 +2185 2184 -1.66666666666667e+01 +2185 2181 0.00000000000000e+00 +2185 2411 -8.33333333333333e+00 +2185 2042 8.33333333333333e+00 +2185 2041 -3.75000000000000e+01 +2185 2409 4.16666666666667e+00 +2185 1947 -4.16666666666667e+00 +2185 2182 0.00000000000000e+00 +2185 2169 4.16666666666667e+00 +2185 2031 0.00000000000000e+00 +2185 1902 0.00000000000000e+00 +2186 2186 1.25000000000000e+02 +2186 2199 8.33333333333333e+00 +2186 2170 -8.33333333333333e+00 +2186 2169 4.16666666666667e+00 +2186 2201 -1.25000000000000e+01 +2186 2179 8.33333333333333e+00 +2186 2403 4.16666666666667e+00 +2186 2180 -3.75000000000000e+01 +2186 2178 8.33333333333333e+00 +2186 2404 4.16666666666667e+00 +2186 2184 -1.66666666666667e+01 +2186 1947 -4.16666666666667e+00 +2186 1902 0.00000000000000e+00 +2186 2176 8.33333333333333e+00 +2186 2185 -1.66666666666667e+01 +2186 2248 8.33333333333333e+00 +2186 2175 -4.16666666666667e+00 +2186 2172 0.00000000000000e+00 +2186 2249 -3.75000000000000e+01 +2186 1948 -4.16666666666667e+00 +2186 2263 4.16666666666667e+00 +2186 2262 -8.33333333333333e+00 +2186 2247 8.33333333333333e+00 +2186 2177 -1.25000000000000e+01 +2186 1903 0.00000000000000e+00 +2186 2173 0.00000000000000e+00 +2186 2040 -4.16666666666667e+00 +2186 2409 4.16666666666667e+00 +2186 2032 0.00000000000000e+00 +2186 2182 0.00000000000000e+00 +2186 2042 -1.25000000000000e+01 +2186 2410 -8.33333333333333e+00 +2186 2041 8.33333333333333e+00 +2186 2183 0.00000000000000e+00 +2186 2200 -4.16666666666667e+00 +2186 2181 0.00000000000000e+00 +2186 2031 0.00000000000000e+00 +2187 2187 1.25000000000000e+02 +2187 2201 -4.16666666666667e+00 +2187 2200 8.33333333333333e+00 +2187 2199 -1.25000000000000e+01 +2187 2264 4.16666666666667e+00 +2187 2170 4.16666666666667e+00 +2187 2171 -8.33333333333333e+00 +2187 2177 8.33333333333333e+00 +2187 2176 8.33333333333333e+00 +2187 2175 -3.75000000000000e+01 +2187 2188 -1.66666666666667e+01 +2187 1906 -4.16666666666667e+00 +2187 1918 -4.16666666666667e+00 +2187 2266 -4.16666666666667e+00 +2187 2260 4.16666666666667e+00 +2187 2267 -4.16666666666667e+00 +2187 2204 4.16666666666667e+00 +2187 1907 8.33333333333333e+00 +2187 2189 -1.66666666666667e+01 +2187 2195 8.33333333333333e+00 +2187 2203 -8.33333333333333e+00 +2187 2194 8.33333333333333e+00 +2187 2193 -3.75000000000000e+01 +2187 1919 8.33333333333333e+00 +2187 2261 -8.33333333333333e+00 +2187 1990 -4.16666666666667e+00 +2187 2152 4.16666666666667e+00 +2187 2153 4.16666666666667e+00 +2187 1991 -4.16666666666667e+00 +2187 1905 -1.25000000000000e+01 +2187 2159 -4.16666666666667e+00 +2187 2003 4.16666666666667e+00 +2187 2158 8.33333333333333e+00 +2187 2002 -8.33333333333333e+00 +2187 2157 -1.25000000000000e+01 +2187 2263 4.16666666666667e+00 +2187 1917 -1.25000000000000e+01 +2188 2188 1.25000000000000e+02 +2188 2201 8.33333333333333e+00 +2188 2200 -3.75000000000000e+01 +2188 2199 8.33333333333333e+00 +2188 2264 -8.33333333333333e+00 +2188 2169 4.16666666666667e+00 +2188 2171 4.16666666666667e+00 +2188 2177 -4.16666666666667e+00 +2188 2176 -1.25000000000000e+01 +2188 2175 8.33333333333333e+00 +2188 2187 -1.66666666666667e+01 +2188 1905 -4.16666666666667e+00 +2188 1917 -4.16666666666667e+00 +2188 2265 -4.16666666666667e+00 +2188 2259 4.16666666666667e+00 +2188 2204 4.16666666666667e+00 +2188 2195 -4.16666666666667e+00 +2188 2194 -1.25000000000000e+01 +2188 2202 -8.33333333333333e+00 +2188 2193 8.33333333333333e+00 +2188 2267 -4.16666666666667e+00 +2188 2261 4.16666666666667e+00 +2188 1989 -4.16666666666667e+00 +2188 2151 4.16666666666667e+00 +2188 1991 -4.16666666666667e+00 +2188 2003 4.16666666666667e+00 +2188 2153 -8.33333333333333e+00 +2188 1907 8.33333333333333e+00 +2188 1906 -1.25000000000000e+01 +2188 2159 8.33333333333333e+00 +2188 2189 -1.66666666666667e+01 +2188 1919 8.33333333333333e+00 +2188 2158 -3.75000000000000e+01 +2188 2262 4.16666666666667e+00 +2188 1918 -1.25000000000000e+01 +2188 2157 8.33333333333333e+00 +2188 2001 -8.33333333333333e+00 +2189 2189 1.25000000000000e+02 +2189 2200 8.33333333333333e+00 +2189 2199 -4.16666666666667e+00 +2189 2263 -8.33333333333333e+00 +2189 2262 4.16666666666667e+00 +2189 2170 4.16666666666667e+00 +2189 2169 -8.33333333333333e+00 +2189 2177 -1.25000000000000e+01 +2189 2176 -4.16666666666667e+00 +2189 2175 8.33333333333333e+00 +2189 2265 -4.16666666666667e+00 +2189 2202 4.16666666666667e+00 +2189 2195 -1.25000000000000e+01 +2189 2203 4.16666666666667e+00 +2189 2194 -4.16666666666667e+00 +2189 1905 8.33333333333333e+00 +2189 2187 -1.66666666666667e+01 +2189 2193 8.33333333333333e+00 +2189 2266 -4.16666666666667e+00 +2189 2260 4.16666666666667e+00 +2189 1917 8.33333333333333e+00 +2189 2259 -8.33333333333333e+00 +2189 1990 -4.16666666666667e+00 +2189 2002 4.16666666666667e+00 +2189 1907 -3.75000000000000e+01 +2189 2152 -8.33333333333333e+00 +2189 1906 8.33333333333333e+00 +2189 2151 4.16666666666667e+00 +2189 1989 -4.16666666666667e+00 +2189 2159 -1.25000000000000e+01 +2189 2201 -1.25000000000000e+01 +2189 1919 -3.75000000000000e+01 +2189 2158 8.33333333333333e+00 +2189 2188 -1.66666666666667e+01 +2189 1918 8.33333333333333e+00 +2189 2157 -4.16666666666667e+00 +2189 2001 4.16666666666667e+00 +2190 2190 6.25000000000000e+01 +2190 2153 2.08333333333333e+00 +2190 2152 -4.16666666666667e+00 +2190 2161 4.16666666666667e+00 +2190 2160 -6.25000000000000e+00 +2190 1907 4.16666666666667e+00 +2190 2192 -8.33333333333333e+00 +2190 2195 8.33333333333333e+00 +2190 2194 -4.16666666666667e+00 +2190 2193 -1.25000000000000e+01 +2190 1925 4.16666666666667e+00 +2190 2300 -8.33333333333333e+00 +2190 2299 4.16666666666667e+00 +2190 2203 4.16666666666667e+00 +2190 2308 -4.16666666666667e+00 +2190 2048 2.08333333333333e+00 +2190 2309 -4.16666666666667e+00 +2190 1924 4.16666666666667e+00 +2190 2047 -4.16666666666667e+00 +2190 1923 -1.87500000000000e+01 +2190 2045 -2.08333333333333e+00 +2190 2204 4.16666666666667e+00 +2190 2191 -8.33333333333333e+00 +2190 2044 4.16666666666667e+00 +2190 1906 4.16666666666667e+00 +2190 2162 -2.08333333333333e+00 +2190 2043 -6.25000000000000e+00 +2190 1905 -1.87500000000000e+01 +2191 2191 6.25000000000000e+01 +2191 2192 -8.33333333333333e+00 +2191 1907 -2.08333333333333e+00 +2191 2153 2.08333333333333e+00 +2191 2151 -4.16666666666667e+00 +2191 1925 -2.08333333333333e+00 +2191 2161 -1.87500000000000e+01 +2191 2160 4.16666666666667e+00 +2191 2300 4.16666666666667e+00 +2191 2195 8.33333333333333e+00 +2191 2194 -1.25000000000000e+01 +2191 2193 -4.16666666666667e+00 +2191 2298 4.16666666666667e+00 +2191 2202 4.16666666666667e+00 +2191 2307 -4.16666666666667e+00 +2191 2048 2.08333333333333e+00 +2191 2309 -4.16666666666667e+00 +2191 1924 -6.25000000000000e+00 +2191 1923 4.16666666666667e+00 +2191 2046 -4.16666666666667e+00 +2191 2045 4.16666666666667e+00 +2191 2204 -8.33333333333333e+00 +2191 2162 4.16666666666667e+00 +2191 2044 -1.87500000000000e+01 +2191 1906 -6.25000000000000e+00 +2191 2190 -8.33333333333333e+00 +2191 2043 4.16666666666667e+00 +2191 1905 4.16666666666667e+00 +2192 2192 6.25000000000000e+01 +2192 2191 -8.33333333333333e+00 +2192 2160 -2.08333333333333e+00 +2192 2151 2.08333333333333e+00 +2192 1906 -2.08333333333333e+00 +2192 2152 2.08333333333333e+00 +2192 2162 -6.25000000000000e+00 +2192 1924 -2.08333333333333e+00 +2192 2299 4.16666666666667e+00 +2192 2195 -3.75000000000000e+01 +2192 2194 8.33333333333333e+00 +2192 1905 4.16666666666667e+00 +2192 2190 -8.33333333333333e+00 +2192 2193 8.33333333333333e+00 +2192 1923 4.16666666666667e+00 +2192 2298 -8.33333333333333e+00 +2192 2047 2.08333333333333e+00 +2192 2308 -4.16666666666667e+00 +2192 1925 -6.25000000000000e+00 +2192 2046 2.08333333333333e+00 +2192 2307 -4.16666666666667e+00 +2192 2161 4.16666666666667e+00 +2192 2045 -6.25000000000000e+00 +2192 1907 -6.25000000000000e+00 +2192 2044 4.16666666666667e+00 +2192 2203 -8.33333333333333e+00 +2192 2043 -2.08333333333333e+00 +2192 2202 4.16666666666667e+00 +2193 2193 1.25000000000000e+02 +2193 2158 -8.33333333333333e+00 +2193 2153 -4.16666666666667e+00 +2193 2161 4.16666666666667e+00 +2193 2152 -4.16666666666667e+00 +2193 2162 4.16666666666667e+00 +2193 2168 -4.16666666666667e+00 +2193 2167 8.33333333333333e+00 +2193 2166 -1.25000000000000e+01 +2193 2309 4.16666666666667e+00 +2193 2308 -8.33333333333333e+00 +2193 2299 8.33333333333333e+00 +2193 2192 8.33333333333333e+00 +2193 1906 4.16666666666667e+00 +2193 2191 -4.16666666666667e+00 +2193 2190 -1.25000000000000e+01 +2193 2300 8.33333333333333e+00 +2193 1936 4.16666666666667e+00 +2193 2298 -3.75000000000000e+01 +2193 2195 -1.66666666666667e+01 +2193 2260 -4.16666666666667e+00 +2193 2204 -4.16666666666667e+00 +2193 2266 4.16666666666667e+00 +2193 2371 -4.16666666666667e+00 +2193 2267 4.16666666666667e+00 +2193 2372 -4.16666666666667e+00 +2193 1907 -8.33333333333333e+00 +2193 2189 8.33333333333333e+00 +2193 2203 8.33333333333333e+00 +2193 2188 8.33333333333333e+00 +2193 2194 -1.66666666666667e+01 +2193 2202 -1.25000000000000e+01 +2193 2187 -3.75000000000000e+01 +2193 2261 8.33333333333333e+00 +2193 1937 -8.33333333333333e+00 +2193 2159 4.16666666666667e+00 +2193 2259 -1.25000000000000e+01 +2194 2194 1.25000000000000e+02 +2194 2157 -8.33333333333333e+00 +2194 2160 4.16666666666667e+00 +2194 2151 -4.16666666666667e+00 +2194 2162 -8.33333333333333e+00 +2194 2168 8.33333333333333e+00 +2194 2153 -4.16666666666667e+00 +2194 2167 -3.75000000000000e+01 +2194 2166 8.33333333333333e+00 +2194 2309 4.16666666666667e+00 +2194 2300 -4.16666666666667e+00 +2194 2307 -8.33333333333333e+00 +2194 2298 8.33333333333333e+00 +2194 2192 8.33333333333333e+00 +2194 2195 -1.66666666666667e+01 +2194 2191 -1.25000000000000e+01 +2194 1905 4.16666666666667e+00 +2194 2190 -4.16666666666667e+00 +2194 2299 -1.25000000000000e+01 +2194 1935 4.16666666666667e+00 +2194 2259 -4.16666666666667e+00 +2194 2204 8.33333333333333e+00 +2194 2265 4.16666666666667e+00 +2194 2370 -4.16666666666667e+00 +2194 2267 -8.33333333333333e+00 +2194 2261 8.33333333333333e+00 +2194 1907 4.16666666666667e+00 +2194 2189 -4.16666666666667e+00 +2194 2203 -3.75000000000000e+01 +2194 2188 -1.25000000000000e+01 +2194 2202 8.33333333333333e+00 +2194 2187 8.33333333333333e+00 +2194 2193 -1.66666666666667e+01 +2194 2372 -4.16666666666667e+00 +2194 1937 4.16666666666667e+00 +2194 2159 4.16666666666667e+00 +2194 2260 -1.25000000000000e+01 +2195 2195 1.25000000000000e+02 +2195 2157 4.16666666666667e+00 +2195 2151 -4.16666666666667e+00 +2195 2161 -8.33333333333333e+00 +2195 2167 8.33333333333333e+00 +2195 2160 4.16666666666667e+00 +2195 2166 -4.16666666666667e+00 +2195 2152 -4.16666666666667e+00 +2195 2168 -1.25000000000000e+01 +2195 2308 4.16666666666667e+00 +2195 2299 -4.16666666666667e+00 +2195 2307 4.16666666666667e+00 +2195 2192 -3.75000000000000e+01 +2195 2191 8.33333333333333e+00 +2195 2194 -1.66666666666667e+01 +2195 2190 8.33333333333333e+00 +2195 2300 -1.25000000000000e+01 +2195 2298 8.33333333333333e+00 +2195 2193 -1.66666666666667e+01 +2195 2202 -4.16666666666667e+00 +2195 2203 8.33333333333333e+00 +2195 2266 -8.33333333333333e+00 +2195 2260 8.33333333333333e+00 +2195 2265 4.16666666666667e+00 +2195 2370 -4.16666666666667e+00 +2195 2204 -1.25000000000000e+01 +2195 2189 -1.25000000000000e+01 +2195 1906 4.16666666666667e+00 +2195 2188 -4.16666666666667e+00 +2195 1905 -8.33333333333333e+00 +2195 2187 8.33333333333333e+00 +2195 2158 4.16666666666667e+00 +2195 2261 -3.75000000000000e+01 +2195 2371 -4.16666666666667e+00 +2195 1936 4.16666666666667e+00 +2195 2259 8.33333333333333e+00 +2195 1935 -8.33333333333333e+00 +2196 2196 6.25000000000000e+01 +2196 2180 4.16666666666667e+00 +2196 2171 2.08333333333333e+00 +2196 1907 -2.08333333333333e+00 +2196 2170 -4.16666666666667e+00 +2196 1943 -2.08333333333333e+00 +2196 2179 4.16666666666667e+00 +2196 2178 -1.87500000000000e+01 +2196 2405 4.16666666666667e+00 +2196 2404 4.16666666666667e+00 +2196 2201 8.33333333333333e+00 +2196 2200 -4.16666666666667e+00 +2196 2199 -1.25000000000000e+01 +2196 2203 4.16666666666667e+00 +2196 2407 -4.16666666666667e+00 +2196 2051 2.08333333333333e+00 +2196 2408 -4.16666666666667e+00 +2196 2050 -4.16666666666667e+00 +2196 1942 4.16666666666667e+00 +2196 1941 -6.25000000000000e+00 +2196 2045 4.16666666666667e+00 +2196 2204 -8.33333333333333e+00 +2196 2044 4.16666666666667e+00 +2196 2197 -8.33333333333333e+00 +2196 1906 4.16666666666667e+00 +2196 2043 -1.87500000000000e+01 +2196 2198 -8.33333333333333e+00 +2196 1905 -6.25000000000000e+00 +2197 2197 6.25000000000000e+01 +2197 2171 2.08333333333333e+00 +2197 2169 -4.16666666666667e+00 +2197 2179 -6.25000000000000e+00 +2197 2178 4.16666666666667e+00 +2197 1943 4.16666666666667e+00 +2197 2405 -8.33333333333333e+00 +2197 2403 4.16666666666667e+00 +2197 2198 -8.33333333333333e+00 +2197 1907 4.16666666666667e+00 +2197 2201 8.33333333333333e+00 +2197 2200 -1.25000000000000e+01 +2197 2199 -4.16666666666667e+00 +2197 2202 4.16666666666667e+00 +2197 2406 -4.16666666666667e+00 +2197 2051 2.08333333333333e+00 +2197 2408 -4.16666666666667e+00 +2197 1942 -1.87500000000000e+01 +2197 2049 -4.16666666666667e+00 +2197 1941 4.16666666666667e+00 +2197 2045 -2.08333333333333e+00 +2197 2204 4.16666666666667e+00 +2197 2044 -6.25000000000000e+00 +2197 2180 -2.08333333333333e+00 +2197 1906 -1.87500000000000e+01 +2197 2043 4.16666666666667e+00 +2197 2196 -8.33333333333333e+00 +2197 1905 4.16666666666667e+00 +2198 2198 6.25000000000000e+01 +2198 2170 2.08333333333333e+00 +2198 2196 -8.33333333333333e+00 +2198 2178 4.16666666666667e+00 +2198 2169 2.08333333333333e+00 +2198 1905 -2.08333333333333e+00 +2198 2180 -6.25000000000000e+00 +2198 1941 -2.08333333333333e+00 +2198 2403 4.16666666666667e+00 +2198 1942 4.16666666666667e+00 +2198 2404 -8.33333333333333e+00 +2198 2201 -3.75000000000000e+01 +2198 2197 -8.33333333333333e+00 +2198 1906 4.16666666666667e+00 +2198 2200 8.33333333333333e+00 +2198 2199 8.33333333333333e+00 +2198 2049 2.08333333333333e+00 +2198 2406 -4.16666666666667e+00 +2198 1943 -6.25000000000000e+00 +2198 2050 2.08333333333333e+00 +2198 2407 -4.16666666666667e+00 +2198 2045 -6.25000000000000e+00 +2198 2179 -2.08333333333333e+00 +2198 1907 -6.25000000000000e+00 +2198 2044 -2.08333333333333e+00 +2198 2203 4.16666666666667e+00 +2198 2043 4.16666666666667e+00 +2198 2202 -8.33333333333333e+00 +2199 2199 1.25000000000000e+02 +2199 2176 -8.33333333333333e+00 +2199 2170 -4.16666666666667e+00 +2199 2179 4.16666666666667e+00 +2199 2186 8.33333333333333e+00 +2199 2180 -8.33333333333333e+00 +2199 2171 -4.16666666666667e+00 +2199 2185 8.33333333333333e+00 +2199 2184 -3.75000000000000e+01 +2199 2408 4.16666666666667e+00 +2199 2405 -4.16666666666667e+00 +2199 2404 8.33333333333333e+00 +2199 2407 -8.33333333333333e+00 +2199 2198 8.33333333333333e+00 +2199 2201 -1.66666666666667e+01 +2199 2197 -4.16666666666667e+00 +2199 1906 4.16666666666667e+00 +2199 2196 -1.25000000000000e+01 +2199 1948 4.16666666666667e+00 +2199 2403 -1.25000000000000e+01 +2199 2263 -4.16666666666667e+00 +2199 2204 8.33333333333333e+00 +2199 2266 4.16666666666667e+00 +2199 2416 -4.16666666666667e+00 +2199 2267 -8.33333333333333e+00 +2199 2264 8.33333333333333e+00 +2199 1907 4.16666666666667e+00 +2199 2189 -4.16666666666667e+00 +2199 2203 8.33333333333333e+00 +2199 2188 8.33333333333333e+00 +2199 2200 -1.66666666666667e+01 +2199 2202 -3.75000000000000e+01 +2199 2187 -1.25000000000000e+01 +2199 2417 -4.16666666666667e+00 +2199 1949 4.16666666666667e+00 +2199 2177 4.16666666666667e+00 +2199 2262 -1.25000000000000e+01 +2200 2200 1.25000000000000e+02 +2200 2175 -8.33333333333333e+00 +2200 2171 -4.16666666666667e+00 +2200 2169 -4.16666666666667e+00 +2200 2178 4.16666666666667e+00 +2200 2186 -4.16666666666667e+00 +2200 2180 4.16666666666667e+00 +2200 2185 -1.25000000000000e+01 +2200 2184 8.33333333333333e+00 +2200 2408 4.16666666666667e+00 +2200 2403 8.33333333333333e+00 +2200 2406 -8.33333333333333e+00 +2200 2198 8.33333333333333e+00 +2200 2197 -1.25000000000000e+01 +2200 2196 -4.16666666666667e+00 +2200 1905 4.16666666666667e+00 +2200 2405 8.33333333333333e+00 +2200 2404 -3.75000000000000e+01 +2200 1947 4.16666666666667e+00 +2200 2201 -1.66666666666667e+01 +2200 2262 -4.16666666666667e+00 +2200 2204 -4.16666666666667e+00 +2200 2265 4.16666666666667e+00 +2200 2415 -4.16666666666667e+00 +2200 2417 -4.16666666666667e+00 +2200 2267 4.16666666666667e+00 +2200 1907 -8.33333333333333e+00 +2200 2189 8.33333333333333e+00 +2200 2203 -1.25000000000000e+01 +2200 2188 -3.75000000000000e+01 +2200 2202 8.33333333333333e+00 +2200 2187 8.33333333333333e+00 +2200 2199 -1.66666666666667e+01 +2200 2264 8.33333333333333e+00 +2200 1949 -8.33333333333333e+00 +2200 2177 4.16666666666667e+00 +2200 2263 -1.25000000000000e+01 +2201 2201 1.25000000000000e+02 +2201 2176 4.16666666666667e+00 +2201 2170 -4.16666666666667e+00 +2201 2185 -4.16666666666667e+00 +2201 2179 4.16666666666667e+00 +2201 2184 8.33333333333333e+00 +2201 2178 -8.33333333333333e+00 +2201 2169 -4.16666666666667e+00 +2201 2186 -1.25000000000000e+01 +2201 2406 4.16666666666667e+00 +2201 2403 -4.16666666666667e+00 +2201 2407 4.16666666666667e+00 +2201 2198 -3.75000000000000e+01 +2201 2197 8.33333333333333e+00 +2201 2196 8.33333333333333e+00 +2201 2199 -1.66666666666667e+01 +2201 2405 -1.25000000000000e+01 +2201 2404 8.33333333333333e+00 +2201 2200 -1.66666666666667e+01 +2201 2203 -4.16666666666667e+00 +2201 2202 8.33333333333333e+00 +2201 2416 -4.16666666666667e+00 +2201 2266 4.16666666666667e+00 +2201 2265 -8.33333333333333e+00 +2201 2262 8.33333333333333e+00 +2201 2204 -1.25000000000000e+01 +2201 2189 -1.25000000000000e+01 +2201 1906 -8.33333333333333e+00 +2201 2188 8.33333333333333e+00 +2201 1905 4.16666666666667e+00 +2201 2187 -4.16666666666667e+00 +2201 2175 4.16666666666667e+00 +2201 2264 -3.75000000000000e+01 +2201 2263 8.33333333333333e+00 +2201 1948 -8.33333333333333e+00 +2201 2415 -4.16666666666667e+00 +2201 1947 4.16666666666667e+00 +2202 2202 1.25000000000000e+02 +2202 2416 4.16666666666667e+00 +2202 2417 4.16666666666667e+00 +2202 2200 8.33333333333333e+00 +2202 2199 -3.75000000000000e+01 +2202 2197 4.16666666666667e+00 +2202 2408 -4.16666666666667e+00 +2202 2198 -8.33333333333333e+00 +2202 2407 8.33333333333333e+00 +2202 2406 -1.25000000000000e+01 +2202 2203 -1.66666666666667e+01 +2202 1906 -4.16666666666667e+00 +2202 1954 -4.16666666666667e+00 +2202 2189 4.16666666666667e+00 +2202 2195 -4.16666666666667e+00 +2202 2266 -4.16666666666667e+00 +2202 2371 4.16666666666667e+00 +2202 2188 -8.33333333333333e+00 +2202 2194 8.33333333333333e+00 +2202 2193 -1.25000000000000e+01 +2202 2267 8.33333333333333e+00 +2202 2372 -8.33333333333333e+00 +2202 2265 -1.25000000000000e+01 +2202 2044 -4.16666666666667e+00 +2202 2191 4.16666666666667e+00 +2202 2045 8.33333333333333e+00 +2202 2204 -1.66666666666667e+01 +2202 2309 8.33333333333333e+00 +2202 2192 4.16666666666667e+00 +2202 1907 -4.16666666666667e+00 +2202 2043 -1.25000000000000e+01 +2202 2057 4.16666666666667e+00 +2202 1955 -4.16666666666667e+00 +2202 2308 8.33333333333333e+00 +2202 2056 -8.33333333333333e+00 +2202 2307 -3.75000000000000e+01 +2202 2201 8.33333333333333e+00 +2203 2203 1.25000000000000e+02 +2203 2415 4.16666666666667e+00 +2203 2417 -8.33333333333333e+00 +2203 2200 -1.25000000000000e+01 +2203 2199 8.33333333333333e+00 +2203 2196 4.16666666666667e+00 +2203 2408 8.33333333333333e+00 +2203 2198 4.16666666666667e+00 +2203 2407 -3.75000000000000e+01 +2203 2406 8.33333333333333e+00 +2203 2202 -1.66666666666667e+01 +2203 1905 -4.16666666666667e+00 +2203 1953 -4.16666666666667e+00 +2203 2267 8.33333333333333e+00 +2203 2204 -1.66666666666667e+01 +2203 2195 8.33333333333333e+00 +2203 2265 -4.16666666666667e+00 +2203 2370 4.16666666666667e+00 +2203 1907 -4.16666666666667e+00 +2203 2189 4.16666666666667e+00 +2203 2194 -3.75000000000000e+01 +2203 2187 -8.33333333333333e+00 +2203 2193 8.33333333333333e+00 +2203 1955 -4.16666666666667e+00 +2203 2372 4.16666666666667e+00 +2203 2266 -1.25000000000000e+01 +2203 2043 -4.16666666666667e+00 +2203 2190 4.16666666666667e+00 +2203 2057 4.16666666666667e+00 +2203 2309 -4.16666666666667e+00 +2203 2192 -8.33333333333333e+00 +2203 2045 8.33333333333333e+00 +2203 2044 -1.25000000000000e+01 +2203 2308 -1.25000000000000e+01 +2203 2201 -4.16666666666667e+00 +2203 2307 8.33333333333333e+00 +2203 2055 -8.33333333333333e+00 +2204 2204 1.25000000000000e+02 +2204 2199 8.33333333333333e+00 +2204 2416 -8.33333333333333e+00 +2204 2415 4.16666666666667e+00 +2204 2201 -1.25000000000000e+01 +2204 2407 8.33333333333333e+00 +2204 2406 -4.16666666666667e+00 +2204 2197 4.16666666666667e+00 +2204 2196 -8.33333333333333e+00 +2204 2408 -1.25000000000000e+01 +2204 2187 4.16666666666667e+00 +2204 2193 -4.16666666666667e+00 +2204 2266 8.33333333333333e+00 +2204 2203 -1.66666666666667e+01 +2204 2194 8.33333333333333e+00 +2204 2195 -1.25000000000000e+01 +2204 1906 -4.16666666666667e+00 +2204 2188 4.16666666666667e+00 +2204 2267 -3.75000000000000e+01 +2204 1954 -4.16666666666667e+00 +2204 2371 4.16666666666667e+00 +2204 2265 8.33333333333333e+00 +2204 2370 -8.33333333333333e+00 +2204 2056 4.16666666666667e+00 +2204 2308 -4.16666666666667e+00 +2204 2043 8.33333333333333e+00 +2204 2202 -1.66666666666667e+01 +2204 2307 8.33333333333333e+00 +2204 2045 -3.75000000000000e+01 +2204 2191 -8.33333333333333e+00 +2204 2044 8.33333333333333e+00 +2204 2190 4.16666666666667e+00 +2204 1905 -4.16666666666667e+00 +2204 2309 -1.25000000000000e+01 +2204 2200 -4.16666666666667e+00 +2204 2055 4.16666666666667e+00 +2204 1953 -4.16666666666667e+00 +2205 2205 6.25000000000000e+01 +2205 2237 -4.16666666666667e+00 +2205 2234 -4.16666666666667e+00 +2205 2233 2.08333333333333e+00 +2205 2236 -4.16666666666667e+00 +2205 2216 4.16666666666667e+00 +2205 2215 -2.08333333333333e+00 +2205 2221 4.16666666666667e+00 +2205 2214 -6.25000000000000e+00 +2205 1996 -2.08333333333333e+00 +2205 1993 0.00000000000000e+00 +2205 2225 4.16666666666667e+00 +2205 2213 -4.16666666666667e+00 +2205 1910 0.00000000000000e+00 +2205 1994 0.00000000000000e+00 +2205 1909 0.00000000000000e+00 +2205 2206 -8.33333333333333e+00 +2205 2212 8.33333333333333e+00 +2205 1908 0.00000000000000e+00 +2205 2211 -1.25000000000000e+01 +2205 2207 -8.33333333333333e+00 +2205 1913 4.16666666666667e+00 +2205 1997 4.16666666666667e+00 +2205 1912 4.16666666666667e+00 +2205 2224 -8.33333333333333e+00 +2205 2222 4.16666666666667e+00 +2205 1911 -1.87500000000000e+01 +2205 1995 -6.25000000000000e+00 +2206 2206 6.25000000000000e+01 +2206 2237 -4.16666666666667e+00 +2206 2232 2.08333333333333e+00 +2206 2235 -4.16666666666667e+00 +2206 2216 4.16666666666667e+00 +2206 2222 -8.33333333333333e+00 +2206 2215 -6.25000000000000e+00 +2206 2214 -2.08333333333333e+00 +2206 2220 4.16666666666667e+00 +2206 1995 -2.08333333333333e+00 +2206 1992 0.00000000000000e+00 +2206 1997 4.16666666666667e+00 +2206 2207 -8.33333333333333e+00 +2206 2213 8.33333333333333e+00 +2206 1910 0.00000000000000e+00 +2206 1994 0.00000000000000e+00 +2206 1909 0.00000000000000e+00 +2206 2212 -3.75000000000000e+01 +2206 1908 0.00000000000000e+00 +2206 2205 -8.33333333333333e+00 +2206 2211 8.33333333333333e+00 +2206 1913 -2.08333333333333e+00 +2206 2225 4.16666666666667e+00 +2206 2234 2.08333333333333e+00 +2206 1912 -6.25000000000000e+00 +2206 1996 -6.25000000000000e+00 +2206 1911 4.16666666666667e+00 +2206 2223 -8.33333333333333e+00 +2207 2207 6.25000000000000e+01 +2207 2236 -4.16666666666667e+00 +2207 2220 4.16666666666667e+00 +2207 2235 -4.16666666666667e+00 +2207 2232 -4.16666666666667e+00 +2207 2216 -1.87500000000000e+01 +2207 2215 4.16666666666667e+00 +2207 2221 -8.33333333333333e+00 +2207 2214 4.16666666666667e+00 +2207 1996 4.16666666666667e+00 +2207 2206 -8.33333333333333e+00 +2207 2212 8.33333333333333e+00 +2207 2223 4.16666666666667e+00 +2207 2211 -4.16666666666667e+00 +2207 1910 0.00000000000000e+00 +2207 2213 -1.25000000000000e+01 +2207 1909 0.00000000000000e+00 +2207 1993 0.00000000000000e+00 +2207 1908 0.00000000000000e+00 +2207 1992 0.00000000000000e+00 +2207 2233 2.08333333333333e+00 +2207 1913 -6.25000000000000e+00 +2207 1997 -1.87500000000000e+01 +2207 1912 -2.08333333333333e+00 +2207 2224 4.16666666666667e+00 +2207 2205 -8.33333333333333e+00 +2207 1911 4.16666666666667e+00 +2207 1995 4.16666666666667e+00 +2208 2208 1.00000000000000e+00 +2208 2255 0.00000000000000e+00 +2208 2219 0.00000000000000e+00 +2208 2222 0.00000000000000e+00 +2208 2218 0.00000000000000e+00 +2208 2221 0.00000000000000e+00 +2208 2217 0.00000000000000e+00 +2208 2251 0.00000000000000e+00 +2208 2254 0.00000000000000e+00 +2208 1993 0.00000000000000e+00 +2208 1999 0.00000000000000e+00 +2208 2210 0.00000000000000e+00 +2208 2000 0.00000000000000e+00 +2208 2213 0.00000000000000e+00 +2208 1916 0.00000000000000e+00 +2208 2243 0.00000000000000e+00 +2208 1915 0.00000000000000e+00 +2208 2242 0.00000000000000e+00 +2208 1914 0.00000000000000e+00 +2208 1998 0.00000000000000e+00 +2208 1910 0.00000000000000e+00 +2208 1994 0.00000000000000e+00 +2208 2209 0.00000000000000e+00 +2208 1909 0.00000000000000e+00 +2208 2212 0.00000000000000e+00 +2208 2252 0.00000000000000e+00 +2208 1908 0.00000000000000e+00 +2208 2211 0.00000000000000e+00 +2209 2209 1.00000000000000e+00 +2209 2255 0.00000000000000e+00 +2209 2219 0.00000000000000e+00 +2209 2218 0.00000000000000e+00 +2209 2217 0.00000000000000e+00 +2209 2220 0.00000000000000e+00 +2209 2252 0.00000000000000e+00 +2209 2250 0.00000000000000e+00 +2209 2253 0.00000000000000e+00 +2209 1992 0.00000000000000e+00 +2209 1998 0.00000000000000e+00 +2209 2243 0.00000000000000e+00 +2209 2213 0.00000000000000e+00 +2209 1916 0.00000000000000e+00 +2209 2210 0.00000000000000e+00 +2209 2000 0.00000000000000e+00 +2209 1915 0.00000000000000e+00 +2209 1999 0.00000000000000e+00 +2209 1914 0.00000000000000e+00 +2209 2241 0.00000000000000e+00 +2209 1910 0.00000000000000e+00 +2209 1994 0.00000000000000e+00 +2209 2222 0.00000000000000e+00 +2209 1909 0.00000000000000e+00 +2209 2212 0.00000000000000e+00 +2209 2208 0.00000000000000e+00 +2209 1908 0.00000000000000e+00 +2209 2211 0.00000000000000e+00 +2210 2210 1.00000000000000e+00 +2210 2253 0.00000000000000e+00 +2210 2221 0.00000000000000e+00 +2210 2254 0.00000000000000e+00 +2210 2219 0.00000000000000e+00 +2210 2218 0.00000000000000e+00 +2210 2217 0.00000000000000e+00 +2210 2220 0.00000000000000e+00 +2210 2251 0.00000000000000e+00 +2210 2242 0.00000000000000e+00 +2210 2212 0.00000000000000e+00 +2210 2208 0.00000000000000e+00 +2210 1998 0.00000000000000e+00 +2210 2211 0.00000000000000e+00 +2210 1916 0.00000000000000e+00 +2210 2000 0.00000000000000e+00 +2210 1915 0.00000000000000e+00 +2210 2209 0.00000000000000e+00 +2210 1999 0.00000000000000e+00 +2210 1914 0.00000000000000e+00 +2210 2241 0.00000000000000e+00 +2210 2250 0.00000000000000e+00 +2210 1910 0.00000000000000e+00 +2210 2213 0.00000000000000e+00 +2210 1909 0.00000000000000e+00 +2210 1993 0.00000000000000e+00 +2210 1908 0.00000000000000e+00 +2210 1992 0.00000000000000e+00 +2211 2211 1.25000000000000e+02 +2211 2255 4.16666666666667e+00 +2211 2210 0.00000000000000e+00 +2211 2000 0.00000000000000e+00 +2211 1999 0.00000000000000e+00 +2211 2209 0.00000000000000e+00 +2211 2208 0.00000000000000e+00 +2211 2243 -4.16666666666667e+00 +2211 2242 8.33333333333333e+00 +2211 2241 -1.25000000000000e+01 +2211 2221 -4.16666666666667e+00 +2211 2269 -4.16666666666667e+00 +2211 2236 4.16666666666667e+00 +2211 2222 8.33333333333333e+00 +2211 2237 -8.33333333333333e+00 +2211 1919 4.16666666666667e+00 +2211 2270 -4.16666666666667e+00 +2211 1910 0.00000000000000e+00 +2211 2220 -1.25000000000000e+01 +2211 1994 0.00000000000000e+00 +2211 1993 0.00000000000000e+00 +2211 1997 4.16666666666667e+00 +2211 2207 -4.16666666666667e+00 +2211 2212 -1.66666666666667e+01 +2211 1996 4.16666666666667e+00 +2211 2002 -4.16666666666667e+00 +2211 1909 0.00000000000000e+00 +2211 2206 8.33333333333333e+00 +2211 2205 -1.25000000000000e+01 +2211 2213 -1.66666666666667e+01 +2211 2225 8.33333333333333e+00 +2211 2003 8.33333333333333e+00 +2211 2224 8.33333333333333e+00 +2211 1918 -8.33333333333333e+00 +2211 2254 4.16666666666667e+00 +2211 2223 -3.75000000000000e+01 +2211 2001 -1.25000000000000e+01 +2212 2212 1.25000000000000e+02 +2212 2255 -8.33333333333333e+00 +2212 2210 0.00000000000000e+00 +2212 2000 0.00000000000000e+00 +2212 1998 0.00000000000000e+00 +2212 2209 0.00000000000000e+00 +2212 2208 0.00000000000000e+00 +2212 2243 8.33333333333333e+00 +2212 2242 -3.75000000000000e+01 +2212 2241 8.33333333333333e+00 +2212 2220 -4.16666666666667e+00 +2212 2268 -4.16666666666667e+00 +2212 2235 4.16666666666667e+00 +2212 2270 -4.16666666666667e+00 +2212 2237 4.16666666666667e+00 +2212 2213 -1.66666666666667e+01 +2212 2222 8.33333333333333e+00 +2212 2221 -1.25000000000000e+01 +2212 1992 0.00000000000000e+00 +2212 2207 8.33333333333333e+00 +2212 2211 -1.66666666666667e+01 +2212 1997 -8.33333333333333e+00 +2212 2003 8.33333333333333e+00 +2212 1995 4.16666666666667e+00 +2212 2001 -4.16666666666667e+00 +2212 1910 0.00000000000000e+00 +2212 1994 0.00000000000000e+00 +2212 2206 -3.75000000000000e+01 +2212 1908 0.00000000000000e+00 +2212 2205 8.33333333333333e+00 +2212 2225 -4.16666666666667e+00 +2212 1919 4.16666666666667e+00 +2212 2253 4.16666666666667e+00 +2212 2224 -1.25000000000000e+01 +2212 2002 -1.25000000000000e+01 +2212 2223 8.33333333333333e+00 +2212 1917 -8.33333333333333e+00 +2213 2213 1.25000000000000e+02 +2213 2253 4.16666666666667e+00 +2213 2209 0.00000000000000e+00 +2213 1999 0.00000000000000e+00 +2213 2208 0.00000000000000e+00 +2213 1998 0.00000000000000e+00 +2213 2210 0.00000000000000e+00 +2213 2243 -1.25000000000000e+01 +2213 2242 8.33333333333333e+00 +2213 2241 -4.16666666666667e+00 +2213 2269 -4.16666666666667e+00 +2213 2236 4.16666666666667e+00 +2213 2220 8.33333333333333e+00 +2213 2235 -8.33333333333333e+00 +2213 1917 4.16666666666667e+00 +2213 2268 -4.16666666666667e+00 +2213 2222 -3.75000000000000e+01 +2213 2212 -1.66666666666667e+01 +2213 2221 8.33333333333333e+00 +2213 1908 0.00000000000000e+00 +2213 1992 0.00000000000000e+00 +2213 2206 8.33333333333333e+00 +2213 1995 4.16666666666667e+00 +2213 2205 -4.16666666666667e+00 +2213 1996 -8.33333333333333e+00 +2213 2002 8.33333333333333e+00 +2213 2207 -1.25000000000000e+01 +2213 1909 0.00000000000000e+00 +2213 1993 0.00000000000000e+00 +2213 2254 -8.33333333333333e+00 +2213 2225 -1.25000000000000e+01 +2213 2003 -3.75000000000000e+01 +2213 2224 -4.16666666666667e+00 +2213 1918 4.16666666666667e+00 +2213 2211 -1.66666666666667e+01 +2213 2223 8.33333333333333e+00 +2213 2001 8.33333333333333e+00 +2214 2214 6.25000000000000e+01 +2214 2237 4.16666666666667e+00 +2214 2236 -8.33333333333333e+00 +2214 2207 4.16666666666667e+00 +2214 2206 -2.08333333333333e+00 +2214 1909 0.00000000000000e+00 +2214 2205 -6.25000000000000e+00 +2214 2234 4.16666666666667e+00 +2214 1960 2.08333333333333e+00 +2214 2232 -1.87500000000000e+01 +2214 2222 -4.16666666666667e+00 +2214 2216 -8.33333333333333e+00 +2214 2071 -2.08333333333333e+00 +2214 2441 -4.16666666666667e+00 +2214 2078 4.16666666666667e+00 +2214 2440 -4.16666666666667e+00 +2214 2077 4.16666666666667e+00 +2214 2072 4.16666666666667e+00 +2214 1961 -4.16666666666667e+00 +2214 2070 -6.25000000000000e+00 +2214 2069 0.00000000000000e+00 +2214 1910 0.00000000000000e+00 +2214 2068 0.00000000000000e+00 +2214 2215 -8.33333333333333e+00 +2214 2221 8.33333333333333e+00 +2214 2067 0.00000000000000e+00 +2214 2233 4.16666666666667e+00 +2214 2220 -1.25000000000000e+01 +2215 2215 6.25000000000000e+01 +2215 2232 4.16666666666667e+00 +2215 2237 4.16666666666667e+00 +2215 2235 -8.33333333333333e+00 +2215 2207 4.16666666666667e+00 +2215 2216 -8.33333333333333e+00 +2215 2206 -6.25000000000000e+00 +2215 2205 -2.08333333333333e+00 +2215 1908 0.00000000000000e+00 +2215 2233 -6.25000000000000e+00 +2215 1959 2.08333333333333e+00 +2215 2070 -2.08333333333333e+00 +2215 2072 4.16666666666667e+00 +2215 2222 8.33333333333333e+00 +2215 2078 -8.33333333333333e+00 +2215 2439 -4.16666666666667e+00 +2215 2076 4.16666666666667e+00 +2215 1961 2.08333333333333e+00 +2215 2441 -4.16666666666667e+00 +2215 2071 -6.25000000000000e+00 +2215 2069 0.00000000000000e+00 +2215 1910 0.00000000000000e+00 +2215 2068 0.00000000000000e+00 +2215 2234 -2.08333333333333e+00 +2215 2221 -3.75000000000000e+01 +2215 2067 0.00000000000000e+00 +2215 2214 -8.33333333333333e+00 +2215 2220 8.33333333333333e+00 +2216 2216 6.25000000000000e+01 +2216 2235 4.16666666666667e+00 +2216 2236 4.16666666666667e+00 +2216 2207 -1.87500000000000e+01 +2216 2206 4.16666666666667e+00 +2216 2215 -8.33333333333333e+00 +2216 2205 4.16666666666667e+00 +2216 2234 -6.25000000000000e+00 +2216 2232 4.16666666666667e+00 +2216 2220 -4.16666666666667e+00 +2216 2214 -8.33333333333333e+00 +2216 2071 4.16666666666667e+00 +2216 2439 -4.16666666666667e+00 +2216 2076 4.16666666666667e+00 +2216 2221 8.33333333333333e+00 +2216 2077 -8.33333333333333e+00 +2216 2072 -1.87500000000000e+01 +2216 1960 2.08333333333333e+00 +2216 2440 -4.16666666666667e+00 +2216 2070 4.16666666666667e+00 +2216 1959 -4.16666666666667e+00 +2216 2069 0.00000000000000e+00 +2216 2233 -2.08333333333333e+00 +2216 2222 -1.25000000000000e+01 +2216 2068 0.00000000000000e+00 +2216 1909 0.00000000000000e+00 +2216 2067 0.00000000000000e+00 +2216 1908 0.00000000000000e+00 +2217 2217 1.00000000000000e+00 +2217 2251 0.00000000000000e+00 +2217 2255 0.00000000000000e+00 +2217 2254 0.00000000000000e+00 +2217 2210 0.00000000000000e+00 +2217 2219 0.00000000000000e+00 +2217 1909 0.00000000000000e+00 +2217 2209 0.00000000000000e+00 +2217 2208 0.00000000000000e+00 +2217 1963 0.00000000000000e+00 +2217 2250 0.00000000000000e+00 +2217 2074 0.00000000000000e+00 +2217 2075 0.00000000000000e+00 +2217 2222 0.00000000000000e+00 +2217 2078 0.00000000000000e+00 +2217 2446 0.00000000000000e+00 +2217 2077 0.00000000000000e+00 +2217 1964 0.00000000000000e+00 +2217 2447 0.00000000000000e+00 +2217 2073 0.00000000000000e+00 +2217 2069 0.00000000000000e+00 +2217 1910 0.00000000000000e+00 +2217 2218 0.00000000000000e+00 +2217 2068 0.00000000000000e+00 +2217 2221 0.00000000000000e+00 +2217 2252 0.00000000000000e+00 +2217 2067 0.00000000000000e+00 +2217 2220 0.00000000000000e+00 +2218 2218 1.00000000000000e+00 +2218 2255 0.00000000000000e+00 +2218 2253 0.00000000000000e+00 +2218 2210 0.00000000000000e+00 +2218 2209 0.00000000000000e+00 +2218 1908 0.00000000000000e+00 +2218 2208 0.00000000000000e+00 +2218 2252 0.00000000000000e+00 +2218 2251 0.00000000000000e+00 +2218 1962 0.00000000000000e+00 +2218 2222 0.00000000000000e+00 +2218 2219 0.00000000000000e+00 +2218 2073 0.00000000000000e+00 +2218 2447 0.00000000000000e+00 +2218 2078 0.00000000000000e+00 +2218 2445 0.00000000000000e+00 +2218 2076 0.00000000000000e+00 +2218 1964 0.00000000000000e+00 +2218 2075 0.00000000000000e+00 +2218 2074 0.00000000000000e+00 +2218 2069 0.00000000000000e+00 +2218 1910 0.00000000000000e+00 +2218 2250 0.00000000000000e+00 +2218 2068 0.00000000000000e+00 +2218 2221 0.00000000000000e+00 +2218 2217 0.00000000000000e+00 +2218 2067 0.00000000000000e+00 +2218 2220 0.00000000000000e+00 +2219 2219 1.00000000000000e+00 +2219 2254 0.00000000000000e+00 +2219 2253 0.00000000000000e+00 +2219 2210 0.00000000000000e+00 +2219 2209 0.00000000000000e+00 +2219 2208 0.00000000000000e+00 +2219 2217 0.00000000000000e+00 +2219 2252 0.00000000000000e+00 +2219 2251 0.00000000000000e+00 +2219 2221 0.00000000000000e+00 +2219 2218 0.00000000000000e+00 +2219 2446 0.00000000000000e+00 +2219 2077 0.00000000000000e+00 +2219 2073 0.00000000000000e+00 +2219 2220 0.00000000000000e+00 +2219 2076 0.00000000000000e+00 +2219 2075 0.00000000000000e+00 +2219 1963 0.00000000000000e+00 +2219 2074 0.00000000000000e+00 +2219 1962 0.00000000000000e+00 +2219 2445 0.00000000000000e+00 +2219 2250 0.00000000000000e+00 +2219 2069 0.00000000000000e+00 +2219 2222 0.00000000000000e+00 +2219 2068 0.00000000000000e+00 +2219 1909 0.00000000000000e+00 +2219 2067 0.00000000000000e+00 +2219 1908 0.00000000000000e+00 +2220 2220 1.25000000000000e+02 +2220 2254 8.33333333333333e+00 +2220 2210 0.00000000000000e+00 +2220 2209 0.00000000000000e+00 +2220 2253 -1.25000000000000e+01 +2220 2219 0.00000000000000e+00 +2220 2446 4.16666666666667e+00 +2220 2218 0.00000000000000e+00 +2220 2217 0.00000000000000e+00 +2220 2447 4.16666666666667e+00 +2220 2212 -4.16666666666667e+00 +2220 2213 8.33333333333333e+00 +2220 2222 -1.66666666666667e+01 +2220 1910 0.00000000000000e+00 +2220 2211 -1.25000000000000e+01 +2220 2270 4.16666666666667e+00 +2220 1967 -4.16666666666667e+00 +2220 2269 -8.33333333333333e+00 +2220 2207 4.16666666666667e+00 +2220 2221 -1.66666666666667e+01 +2220 2236 8.33333333333333e+00 +2220 2206 4.16666666666667e+00 +2220 1909 0.00000000000000e+00 +2220 2237 8.33333333333333e+00 +2220 1966 -4.16666666666667e+00 +2220 2235 -3.75000000000000e+01 +2220 2216 -4.16666666666667e+00 +2220 2069 0.00000000000000e+00 +2220 2440 4.16666666666667e+00 +2220 2077 -4.16666666666667e+00 +2220 2068 0.00000000000000e+00 +2220 2215 8.33333333333333e+00 +2220 2214 -1.25000000000000e+01 +2220 2078 8.33333333333333e+00 +2220 2441 -8.33333333333333e+00 +2220 2076 -1.25000000000000e+01 +2220 2255 -4.16666666666667e+00 +2221 2221 1.25000000000000e+02 +2221 2253 8.33333333333333e+00 +2221 2208 0.00000000000000e+00 +2221 2255 8.33333333333333e+00 +2221 2254 -3.75000000000000e+01 +2221 2219 0.00000000000000e+00 +2221 2445 4.16666666666667e+00 +2221 2218 0.00000000000000e+00 +2221 2217 0.00000000000000e+00 +2221 2447 -8.33333333333333e+00 +2221 2211 -4.16666666666667e+00 +2221 2270 4.16666666666667e+00 +2221 2213 8.33333333333333e+00 +2221 2212 -1.25000000000000e+01 +2221 2268 -8.33333333333333e+00 +2221 2237 -4.16666666666667e+00 +2221 2220 -1.66666666666667e+01 +2221 2235 8.33333333333333e+00 +2221 2207 -8.33333333333333e+00 +2221 2205 4.16666666666667e+00 +2221 1908 0.00000000000000e+00 +2221 2236 -1.25000000000000e+01 +2221 1965 -4.16666666666667e+00 +2221 2216 8.33333333333333e+00 +2221 2222 -1.66666666666667e+01 +2221 2078 8.33333333333333e+00 +2221 2439 4.16666666666667e+00 +2221 2076 -4.16666666666667e+00 +2221 2069 0.00000000000000e+00 +2221 1910 0.00000000000000e+00 +2221 2215 -3.75000000000000e+01 +2221 2067 0.00000000000000e+00 +2221 2214 8.33333333333333e+00 +2221 2441 4.16666666666667e+00 +2221 1967 -4.16666666666667e+00 +2221 2077 -1.25000000000000e+01 +2221 2210 0.00000000000000e+00 +2222 2222 1.25000000000000e+02 +2222 2253 -4.16666666666667e+00 +2222 2208 0.00000000000000e+00 +2222 2255 -1.25000000000000e+01 +2222 2254 8.33333333333333e+00 +2222 2218 0.00000000000000e+00 +2222 2217 0.00000000000000e+00 +2222 2219 0.00000000000000e+00 +2222 2446 -8.33333333333333e+00 +2222 2445 4.16666666666667e+00 +2222 2269 4.16666666666667e+00 +2222 2211 8.33333333333333e+00 +2222 2220 -1.66666666666667e+01 +2222 2213 -3.75000000000000e+01 +2222 2212 8.33333333333333e+00 +2222 1908 0.00000000000000e+00 +2222 2268 4.16666666666667e+00 +2222 1965 -4.16666666666667e+00 +2222 2205 4.16666666666667e+00 +2222 2236 -4.16666666666667e+00 +2222 2206 -8.33333333333333e+00 +2222 2237 -1.25000000000000e+01 +2222 2235 8.33333333333333e+00 +2222 2214 -4.16666666666667e+00 +2222 2067 0.00000000000000e+00 +2222 2215 8.33333333333333e+00 +2222 2221 -1.66666666666667e+01 +2222 2077 8.33333333333333e+00 +2222 2216 -1.25000000000000e+01 +2222 2068 0.00000000000000e+00 +2222 1909 0.00000000000000e+00 +2222 2078 -3.75000000000000e+01 +2222 2209 0.00000000000000e+00 +2222 2440 4.16666666666667e+00 +2222 1966 -4.16666666666667e+00 +2222 2076 8.33333333333333e+00 +2222 2439 -8.33333333333333e+00 +2223 2223 1.25000000000000e+02 +2223 2261 4.16666666666667e+00 +2223 2260 -8.33333333333333e+00 +2223 2230 8.33333333333333e+00 +2223 2229 -3.75000000000000e+01 +2223 2156 4.16666666666667e+00 +2223 2155 4.16666666666667e+00 +2223 2159 8.33333333333333e+00 +2223 2158 -4.16666666666667e+00 +2223 2157 -1.25000000000000e+01 +2223 2225 -1.66666666666667e+01 +2223 1913 -4.16666666666667e+00 +2223 1919 -4.16666666666667e+00 +2223 2273 -4.16666666666667e+00 +2223 2270 4.16666666666667e+00 +2223 2240 -8.33333333333333e+00 +2223 2237 8.33333333333333e+00 +2223 2239 4.16666666666667e+00 +2223 2236 -4.16666666666667e+00 +2223 2235 -1.25000000000000e+01 +2223 2272 -4.16666666666667e+00 +2223 2269 4.16666666666667e+00 +2223 1997 -4.16666666666667e+00 +2223 2207 4.16666666666667e+00 +2223 1996 -4.16666666666667e+00 +2223 2002 4.16666666666667e+00 +2223 2206 -8.33333333333333e+00 +2223 1912 8.33333333333333e+00 +2223 1911 -1.25000000000000e+01 +2223 2213 8.33333333333333e+00 +2223 2003 -8.33333333333333e+00 +2223 2212 8.33333333333333e+00 +2223 2224 -1.66666666666667e+01 +2223 1918 8.33333333333333e+00 +2223 2211 -3.75000000000000e+01 +2223 2231 8.33333333333333e+00 +2223 1917 -1.25000000000000e+01 +2224 2224 1.25000000000000e+02 +2224 2231 -4.16666666666667e+00 +2224 2259 -8.33333333333333e+00 +2224 2230 -1.25000000000000e+01 +2224 2229 8.33333333333333e+00 +2224 2156 -8.33333333333333e+00 +2224 2154 4.16666666666667e+00 +2224 2159 8.33333333333333e+00 +2224 2158 -1.25000000000000e+01 +2224 2157 -4.16666666666667e+00 +2224 2273 -4.16666666666667e+00 +2224 2240 4.16666666666667e+00 +2224 1913 8.33333333333333e+00 +2224 2225 -1.66666666666667e+01 +2224 2237 8.33333333333333e+00 +2224 2236 -1.25000000000000e+01 +2224 2238 4.16666666666667e+00 +2224 2235 -4.16666666666667e+00 +2224 1919 8.33333333333333e+00 +2224 2270 -8.33333333333333e+00 +2224 2271 -4.16666666666667e+00 +2224 2268 4.16666666666667e+00 +2224 1995 -4.16666666666667e+00 +2224 2001 4.16666666666667e+00 +2224 2207 4.16666666666667e+00 +2224 1997 -4.16666666666667e+00 +2224 1912 -3.75000000000000e+01 +2224 2205 -8.33333333333333e+00 +2224 1911 8.33333333333333e+00 +2224 2213 -4.16666666666667e+00 +2224 2003 4.16666666666667e+00 +2224 2212 -1.25000000000000e+01 +2224 2261 4.16666666666667e+00 +2224 1918 -3.75000000000000e+01 +2224 2211 8.33333333333333e+00 +2224 2223 -1.66666666666667e+01 +2224 1917 8.33333333333333e+00 +2225 2225 1.25000000000000e+02 +2225 2230 -4.16666666666667e+00 +2225 2229 8.33333333333333e+00 +2225 2259 4.16666666666667e+00 +2225 2231 -1.25000000000000e+01 +2225 2154 4.16666666666667e+00 +2225 2155 -8.33333333333333e+00 +2225 2159 -3.75000000000000e+01 +2225 2158 8.33333333333333e+00 +2225 2157 8.33333333333333e+00 +2225 2223 -1.66666666666667e+01 +2225 1911 -4.16666666666667e+00 +2225 1917 -4.16666666666667e+00 +2225 2271 -4.16666666666667e+00 +2225 2268 4.16666666666667e+00 +2225 2272 -4.16666666666667e+00 +2225 2239 4.16666666666667e+00 +2225 2237 -3.75000000000000e+01 +2225 1912 8.33333333333333e+00 +2225 2224 -1.66666666666667e+01 +2225 2236 8.33333333333333e+00 +2225 2238 -8.33333333333333e+00 +2225 2235 8.33333333333333e+00 +2225 1918 8.33333333333333e+00 +2225 2269 -8.33333333333333e+00 +2225 1995 -4.16666666666667e+00 +2225 2205 4.16666666666667e+00 +2225 1913 -1.25000000000000e+01 +2225 2206 4.16666666666667e+00 +2225 1996 -4.16666666666667e+00 +2225 2213 -1.25000000000000e+01 +2225 2260 4.16666666666667e+00 +2225 1919 -1.25000000000000e+01 +2225 2212 -4.16666666666667e+00 +2225 2002 4.16666666666667e+00 +2225 2211 8.33333333333333e+00 +2225 2001 -8.33333333333333e+00 +2226 2226 6.25000000000000e+01 +2226 2231 -4.16666666666667e+00 +2226 2164 -2.08333333333333e+00 +2226 2155 2.08333333333333e+00 +2226 2165 4.16666666666667e+00 +2226 1930 4.16666666666667e+00 +2226 2335 -8.33333333333333e+00 +2226 2163 -6.25000000000000e+00 +2226 2156 -4.16666666666667e+00 +2226 2227 -8.33333333333333e+00 +2226 2230 8.33333333333333e+00 +2226 1912 4.16666666666667e+00 +2226 2229 -1.25000000000000e+01 +2226 2345 -4.16666666666667e+00 +2226 2240 4.16666666666667e+00 +2226 1931 4.16666666666667e+00 +2226 2084 -4.16666666666667e+00 +2226 2083 2.08333333333333e+00 +2226 2344 -4.16666666666667e+00 +2226 1929 -1.87500000000000e+01 +2226 2228 -8.33333333333333e+00 +2226 2081 4.16666666666667e+00 +2226 1913 4.16666666666667e+00 +2226 2080 -2.08333333333333e+00 +2226 2239 4.16666666666667e+00 +2226 2336 4.16666666666667e+00 +2226 2079 -6.25000000000000e+00 +2226 1911 -1.87500000000000e+01 +2227 2227 6.25000000000000e+01 +2227 2165 4.16666666666667e+00 +2227 2231 8.33333333333333e+00 +2227 2163 -2.08333333333333e+00 +2227 2154 2.08333333333333e+00 +2227 1931 -2.08333333333333e+00 +2227 2336 4.16666666666667e+00 +2227 2164 -6.25000000000000e+00 +2227 1929 4.16666666666667e+00 +2227 2334 -8.33333333333333e+00 +2227 2156 2.08333333333333e+00 +2227 1913 -2.08333333333333e+00 +2227 2230 -3.75000000000000e+01 +2227 2226 -8.33333333333333e+00 +2227 2229 8.33333333333333e+00 +2227 1911 4.16666666666667e+00 +2227 2084 2.08333333333333e+00 +2227 2345 -4.16666666666667e+00 +2227 1930 -6.25000000000000e+00 +2227 2082 2.08333333333333e+00 +2227 2343 -4.16666666666667e+00 +2227 2081 4.16666666666667e+00 +2227 2240 -8.33333333333333e+00 +2227 2228 -8.33333333333333e+00 +2227 2080 -6.25000000000000e+00 +2227 1912 -6.25000000000000e+00 +2227 2079 -2.08333333333333e+00 +2227 2238 4.16666666666667e+00 +2228 2228 6.25000000000000e+01 +2228 2229 -4.16666666666667e+00 +2228 2227 -8.33333333333333e+00 +2228 2164 4.16666666666667e+00 +2228 2230 8.33333333333333e+00 +2228 2165 -1.87500000000000e+01 +2228 1930 -2.08333333333333e+00 +2228 2335 4.16666666666667e+00 +2228 2163 4.16666666666667e+00 +2228 2231 -1.25000000000000e+01 +2228 2155 2.08333333333333e+00 +2228 1912 -2.08333333333333e+00 +2228 2154 -4.16666666666667e+00 +2228 2083 2.08333333333333e+00 +2228 2344 -4.16666666666667e+00 +2228 2343 -4.16666666666667e+00 +2228 2238 4.16666666666667e+00 +2228 1931 -6.25000000000000e+00 +2228 1929 4.16666666666667e+00 +2228 2082 -4.16666666666667e+00 +2228 2334 4.16666666666667e+00 +2228 2081 -1.87500000000000e+01 +2228 1913 -6.25000000000000e+00 +2228 2080 4.16666666666667e+00 +2228 2239 -8.33333333333333e+00 +2228 2226 -8.33333333333333e+00 +2228 2079 4.16666666666667e+00 +2228 1911 4.16666666666667e+00 +2229 2229 1.25000000000000e+02 +2229 2272 4.16666666666667e+00 +2229 2377 -4.16666666666667e+00 +2229 2240 8.33333333333333e+00 +2229 2345 -8.33333333333333e+00 +2229 2239 -4.16666666666667e+00 +2229 2344 4.16666666666667e+00 +2229 2378 -4.16666666666667e+00 +2229 2238 -1.25000000000000e+01 +2229 2165 4.16666666666667e+00 +2229 2228 -4.16666666666667e+00 +2229 2164 4.16666666666667e+00 +2229 2336 8.33333333333333e+00 +2229 2231 -1.66666666666667e+01 +2229 2335 8.33333333333333e+00 +2229 2334 -3.75000000000000e+01 +2229 2227 8.33333333333333e+00 +2229 2226 -1.25000000000000e+01 +2229 2230 -1.66666666666667e+01 +2229 2167 -4.16666666666667e+00 +2229 2168 8.33333333333333e+00 +2229 2159 -8.33333333333333e+00 +2229 2225 8.33333333333333e+00 +2229 2155 -4.16666666666667e+00 +2229 2158 4.16666666666667e+00 +2229 1937 4.16666666666667e+00 +2229 2261 -4.16666666666667e+00 +2229 1936 -8.33333333333333e+00 +2229 2260 8.33333333333333e+00 +2229 2166 -1.25000000000000e+01 +2229 2259 -1.25000000000000e+01 +2229 2156 -4.16666666666667e+00 +2229 1913 4.16666666666667e+00 +2229 2224 8.33333333333333e+00 +2229 1912 -8.33333333333333e+00 +2229 2273 4.16666666666667e+00 +2229 2223 -3.75000000000000e+01 +2230 2230 1.25000000000000e+02 +2230 2271 4.16666666666667e+00 +2230 2376 -4.16666666666667e+00 +2230 2378 -4.16666666666667e+00 +2230 2345 4.16666666666667e+00 +2230 2238 -4.16666666666667e+00 +2230 2343 4.16666666666667e+00 +2230 2240 8.33333333333333e+00 +2230 2239 -1.25000000000000e+01 +2230 2228 8.33333333333333e+00 +2230 2165 -8.33333333333333e+00 +2230 2163 4.16666666666667e+00 +2230 2336 -4.16666666666667e+00 +2230 1937 4.16666666666667e+00 +2230 2335 -1.25000000000000e+01 +2230 2334 8.33333333333333e+00 +2230 1913 4.16666666666667e+00 +2230 2227 -3.75000000000000e+01 +2230 2226 8.33333333333333e+00 +2230 2225 -4.16666666666667e+00 +2230 2229 -1.66666666666667e+01 +2230 2166 -4.16666666666667e+00 +2230 2159 4.16666666666667e+00 +2230 2156 -4.16666666666667e+00 +2230 2154 -4.16666666666667e+00 +2230 2157 4.16666666666667e+00 +2230 2168 8.33333333333333e+00 +2230 2261 8.33333333333333e+00 +2230 2231 -1.66666666666667e+01 +2230 2167 -1.25000000000000e+01 +2230 2260 -3.75000000000000e+01 +2230 1935 -8.33333333333333e+00 +2230 2259 8.33333333333333e+00 +2230 2273 -8.33333333333333e+00 +2230 2224 -1.25000000000000e+01 +2230 2223 8.33333333333333e+00 +2230 1911 -8.33333333333333e+00 +2231 2231 1.25000000000000e+02 +2231 2272 -8.33333333333333e+00 +2231 2377 -4.16666666666667e+00 +2231 2344 4.16666666666667e+00 +2231 2238 8.33333333333333e+00 +2231 2343 -8.33333333333333e+00 +2231 2376 -4.16666666666667e+00 +2231 2240 -3.75000000000000e+01 +2231 2239 8.33333333333333e+00 +2231 2163 4.16666666666667e+00 +2231 2226 -4.16666666666667e+00 +2231 2227 8.33333333333333e+00 +2231 2164 -8.33333333333333e+00 +2231 2336 -1.25000000000000e+01 +2231 2335 -4.16666666666667e+00 +2231 1936 4.16666666666667e+00 +2231 2334 8.33333333333333e+00 +2231 2229 -1.66666666666667e+01 +2231 2228 -1.25000000000000e+01 +2231 1912 4.16666666666667e+00 +2231 2224 -4.16666666666667e+00 +2231 2158 4.16666666666667e+00 +2231 2155 -4.16666666666667e+00 +2231 2166 8.33333333333333e+00 +2231 2157 -8.33333333333333e+00 +2231 2223 8.33333333333333e+00 +2231 2168 -3.75000000000000e+01 +2231 2261 -1.25000000000000e+01 +2231 2167 8.33333333333333e+00 +2231 2260 8.33333333333333e+00 +2231 2230 -1.66666666666667e+01 +2231 1935 4.16666666666667e+00 +2231 2259 -4.16666666666667e+00 +2231 2271 4.16666666666667e+00 +2231 2225 -1.25000000000000e+01 +2231 2154 -4.16666666666667e+00 +2231 1911 4.16666666666667e+00 +2232 2232 6.25000000000000e+01 +2232 2233 -8.33333333333333e+00 +2232 2207 -4.16666666666667e+00 +2232 1912 -2.08333333333333e+00 +2232 2206 2.08333333333333e+00 +2232 2216 4.16666666666667e+00 +2232 1960 -2.08333333333333e+00 +2232 2214 -1.87500000000000e+01 +2232 2440 4.16666666666667e+00 +2232 2237 -4.16666666666667e+00 +2232 2236 8.33333333333333e+00 +2232 2235 -1.25000000000000e+01 +2232 2441 4.16666666666667e+00 +2232 2240 4.16666666666667e+00 +2232 2444 -4.16666666666667e+00 +2232 2086 2.08333333333333e+00 +2232 2443 -4.16666666666667e+00 +2232 1961 4.16666666666667e+00 +2232 2087 -4.16666666666667e+00 +2232 1959 -6.25000000000000e+00 +2232 2234 -8.33333333333333e+00 +2232 2081 4.16666666666667e+00 +2232 1913 4.16666666666667e+00 +2232 2080 4.16666666666667e+00 +2232 2239 -8.33333333333333e+00 +2232 2215 4.16666666666667e+00 +2232 2079 -1.87500000000000e+01 +2232 1911 -6.25000000000000e+00 +2233 2233 6.25000000000000e+01 +2233 2207 2.08333333333333e+00 +2233 2214 4.16666666666667e+00 +2233 2232 -8.33333333333333e+00 +2233 1911 -2.08333333333333e+00 +2233 2205 2.08333333333333e+00 +2233 2215 -6.25000000000000e+00 +2233 1959 -2.08333333333333e+00 +2233 2439 4.16666666666667e+00 +2233 1913 4.16666666666667e+00 +2233 2234 -8.33333333333333e+00 +2233 2237 8.33333333333333e+00 +2233 2236 -3.75000000000000e+01 +2233 2235 8.33333333333333e+00 +2233 1961 4.16666666666667e+00 +2233 2441 -8.33333333333333e+00 +2233 2085 2.08333333333333e+00 +2233 2442 -4.16666666666667e+00 +2233 2087 2.08333333333333e+00 +2233 2444 -4.16666666666667e+00 +2233 1960 -6.25000000000000e+00 +2233 2081 -2.08333333333333e+00 +2233 2240 4.16666666666667e+00 +2233 2216 -2.08333333333333e+00 +2233 2080 -6.25000000000000e+00 +2233 1912 -6.25000000000000e+00 +2233 2079 4.16666666666667e+00 +2233 2238 -8.33333333333333e+00 +2234 2234 6.25000000000000e+01 +2234 2206 2.08333333333333e+00 +2234 2205 -4.16666666666667e+00 +2234 2216 -6.25000000000000e+00 +2234 2214 4.16666666666667e+00 +2234 2237 -1.25000000000000e+01 +2234 1912 4.16666666666667e+00 +2234 2233 -8.33333333333333e+00 +2234 2236 8.33333333333333e+00 +2234 2235 -4.16666666666667e+00 +2234 1960 4.16666666666667e+00 +2234 2440 -8.33333333333333e+00 +2234 2439 4.16666666666667e+00 +2234 2238 4.16666666666667e+00 +2234 2442 -4.16666666666667e+00 +2234 1961 -1.87500000000000e+01 +2234 2086 2.08333333333333e+00 +2234 2443 -4.16666666666667e+00 +2234 1959 4.16666666666667e+00 +2234 2085 -4.16666666666667e+00 +2234 2215 -2.08333333333333e+00 +2234 2081 -6.25000000000000e+00 +2234 1913 -1.87500000000000e+01 +2234 2080 -2.08333333333333e+00 +2234 2239 4.16666666666667e+00 +2234 2232 -8.33333333333333e+00 +2234 2079 4.16666666666667e+00 +2234 1911 4.16666666666667e+00 +2235 2235 1.25000000000000e+02 +2235 2213 -8.33333333333333e+00 +2235 2216 4.16666666666667e+00 +2235 2207 -4.16666666666667e+00 +2235 2215 -8.33333333333333e+00 +2235 2221 8.33333333333333e+00 +2235 2206 -4.16666666666667e+00 +2235 2222 8.33333333333333e+00 +2235 2220 -3.75000000000000e+01 +2235 2443 4.16666666666667e+00 +2235 2440 -4.16666666666667e+00 +2235 2444 -8.33333333333333e+00 +2235 2441 8.33333333333333e+00 +2235 1913 4.16666666666667e+00 +2235 2234 -4.16666666666667e+00 +2235 2233 8.33333333333333e+00 +2235 2236 -1.66666666666667e+01 +2235 2232 -1.25000000000000e+01 +2235 1967 4.16666666666667e+00 +2235 2439 -1.25000000000000e+01 +2235 2270 -4.16666666666667e+00 +2235 2273 4.16666666666667e+00 +2235 2453 -4.16666666666667e+00 +2235 2239 8.33333333333333e+00 +2235 2272 -8.33333333333333e+00 +2235 2269 8.33333333333333e+00 +2235 2240 8.33333333333333e+00 +2235 2225 8.33333333333333e+00 +2235 2237 -1.66666666666667e+01 +2235 1912 4.16666666666667e+00 +2235 2224 -4.16666666666667e+00 +2235 2238 -3.75000000000000e+01 +2235 2223 -1.25000000000000e+01 +2235 2452 -4.16666666666667e+00 +2235 1966 4.16666666666667e+00 +2235 2212 4.16666666666667e+00 +2235 2268 -1.25000000000000e+01 +2236 2236 1.25000000000000e+02 +2236 2213 4.16666666666667e+00 +2236 2207 -4.16666666666667e+00 +2236 2216 4.16666666666667e+00 +2236 2222 -4.16666666666667e+00 +2236 2214 -8.33333333333333e+00 +2236 2220 8.33333333333333e+00 +2236 2205 -4.16666666666667e+00 +2236 2221 -1.25000000000000e+01 +2236 2442 4.16666666666667e+00 +2236 2439 -4.16666666666667e+00 +2236 2444 4.16666666666667e+00 +2236 2234 8.33333333333333e+00 +2236 2233 -3.75000000000000e+01 +2236 2232 8.33333333333333e+00 +2236 2235 -1.66666666666667e+01 +2236 2441 8.33333333333333e+00 +2236 2440 -1.25000000000000e+01 +2236 2237 -1.66666666666667e+01 +2236 2240 -4.16666666666667e+00 +2236 2238 8.33333333333333e+00 +2236 2273 4.16666666666667e+00 +2236 2453 -4.16666666666667e+00 +2236 2271 -8.33333333333333e+00 +2236 2268 8.33333333333333e+00 +2236 1913 -8.33333333333333e+00 +2236 2225 8.33333333333333e+00 +2236 2239 -1.25000000000000e+01 +2236 2224 -1.25000000000000e+01 +2236 1911 4.16666666666667e+00 +2236 2223 -4.16666666666667e+00 +2236 2270 8.33333333333333e+00 +2236 1967 -8.33333333333333e+00 +2236 2211 4.16666666666667e+00 +2236 2269 -3.75000000000000e+01 +2236 2451 -4.16666666666667e+00 +2236 1965 4.16666666666667e+00 +2237 2237 1.25000000000000e+02 +2237 2211 -8.33333333333333e+00 +2237 2206 -4.16666666666667e+00 +2237 2214 4.16666666666667e+00 +2237 2205 -4.16666666666667e+00 +2237 2215 4.16666666666667e+00 +2237 2221 -4.16666666666667e+00 +2237 2222 -1.25000000000000e+01 +2237 2220 8.33333333333333e+00 +2237 2443 4.16666666666667e+00 +2237 2442 -8.33333333333333e+00 +2237 2439 8.33333333333333e+00 +2237 2234 -1.25000000000000e+01 +2237 2233 8.33333333333333e+00 +2237 1911 4.16666666666667e+00 +2237 2232 -4.16666666666667e+00 +2237 2441 -3.75000000000000e+01 +2237 2440 8.33333333333333e+00 +2237 1965 4.16666666666667e+00 +2237 2236 -1.66666666666667e+01 +2237 2268 -4.16666666666667e+00 +2237 2239 -4.16666666666667e+00 +2237 2271 4.16666666666667e+00 +2237 2451 -4.16666666666667e+00 +2237 2272 4.16666666666667e+00 +2237 2452 -4.16666666666667e+00 +2237 2240 -1.25000000000000e+01 +2237 2225 -3.75000000000000e+01 +2237 1912 -8.33333333333333e+00 +2237 2224 8.33333333333333e+00 +2237 2238 8.33333333333333e+00 +2237 2223 8.33333333333333e+00 +2237 2235 -1.66666666666667e+01 +2237 2212 4.16666666666667e+00 +2237 2270 -1.25000000000000e+01 +2237 2269 8.33333333333333e+00 +2237 1966 -8.33333333333333e+00 +2238 2238 1.25000000000000e+02 +2238 2230 -4.16666666666667e+00 +2238 2378 4.16666666666667e+00 +2238 2377 -8.33333333333333e+00 +2238 2229 -1.25000000000000e+01 +2238 2228 4.16666666666667e+00 +2238 2344 8.33333333333333e+00 +2238 2345 8.33333333333333e+00 +2238 2343 -3.75000000000000e+01 +2238 2227 4.16666666666667e+00 +2238 2240 -1.66666666666667e+01 +2238 1913 -4.16666666666667e+00 +2238 1973 -4.16666666666667e+00 +2238 2273 -4.16666666666667e+00 +2238 2453 4.16666666666667e+00 +2238 2272 8.33333333333333e+00 +2238 2239 -1.66666666666667e+01 +2238 2236 8.33333333333333e+00 +2238 2225 -8.33333333333333e+00 +2238 2237 8.33333333333333e+00 +2238 1912 -4.16666666666667e+00 +2238 2224 4.16666666666667e+00 +2238 2235 -3.75000000000000e+01 +2238 1972 -4.16666666666667e+00 +2238 2452 4.16666666666667e+00 +2238 2271 -1.25000000000000e+01 +2238 2081 -4.16666666666667e+00 +2238 2234 4.16666666666667e+00 +2238 2092 4.16666666666667e+00 +2238 2443 -4.16666666666667e+00 +2238 2233 -8.33333333333333e+00 +2238 2080 8.33333333333333e+00 +2238 2079 -1.25000000000000e+01 +2238 2444 8.33333333333333e+00 +2238 2093 -8.33333333333333e+00 +2238 2442 -1.25000000000000e+01 +2238 2231 8.33333333333333e+00 +2239 2239 1.25000000000000e+02 +2239 2229 -4.16666666666667e+00 +2239 2376 -8.33333333333333e+00 +2239 2231 8.33333333333333e+00 +2239 2230 -1.25000000000000e+01 +2239 2345 -4.16666666666667e+00 +2239 2343 8.33333333333333e+00 +2239 2344 -1.25000000000000e+01 +2239 2228 -8.33333333333333e+00 +2239 2226 4.16666666666667e+00 +2239 2225 4.16666666666667e+00 +2239 2237 -4.16666666666667e+00 +2239 2271 8.33333333333333e+00 +2239 2238 -1.66666666666667e+01 +2239 2235 8.33333333333333e+00 +2239 2236 -1.25000000000000e+01 +2239 1911 -4.16666666666667e+00 +2239 2223 4.16666666666667e+00 +2239 2273 8.33333333333333e+00 +2239 2453 -8.33333333333333e+00 +2239 2272 -3.75000000000000e+01 +2239 1971 -4.16666666666667e+00 +2239 2451 4.16666666666667e+00 +2239 2081 8.33333333333333e+00 +2239 2240 -1.66666666666667e+01 +2239 2444 8.33333333333333e+00 +2239 2091 4.16666666666667e+00 +2239 2442 -4.16666666666667e+00 +2239 2234 4.16666666666667e+00 +2239 1913 -4.16666666666667e+00 +2239 2080 -3.75000000000000e+01 +2239 2232 -8.33333333333333e+00 +2239 2079 8.33333333333333e+00 +2239 2093 4.16666666666667e+00 +2239 1973 -4.16666666666667e+00 +2239 2443 -1.25000000000000e+01 +2239 2378 4.16666666666667e+00 +2240 2240 1.25000000000000e+02 +2240 2229 8.33333333333333e+00 +2240 2376 4.16666666666667e+00 +2240 2231 -3.75000000000000e+01 +2240 2230 8.33333333333333e+00 +2240 2344 -4.16666666666667e+00 +2240 2226 4.16666666666667e+00 +2240 2345 -1.25000000000000e+01 +2240 2343 8.33333333333333e+00 +2240 2227 -8.33333333333333e+00 +2240 2238 -1.66666666666667e+01 +2240 1911 -4.16666666666667e+00 +2240 1971 -4.16666666666667e+00 +2240 2224 4.16666666666667e+00 +2240 2236 -4.16666666666667e+00 +2240 2271 -4.16666666666667e+00 +2240 2451 4.16666666666667e+00 +2240 2237 -1.25000000000000e+01 +2240 2223 -8.33333333333333e+00 +2240 2235 8.33333333333333e+00 +2240 2273 -1.25000000000000e+01 +2240 2272 8.33333333333333e+00 +2240 2452 -8.33333333333333e+00 +2240 2079 -4.16666666666667e+00 +2240 2232 4.16666666666667e+00 +2240 2080 8.33333333333333e+00 +2240 2239 -1.66666666666667e+01 +2240 2443 8.33333333333333e+00 +2240 2081 -1.25000000000000e+01 +2240 2233 4.16666666666667e+00 +2240 1912 -4.16666666666667e+00 +2240 2444 -3.75000000000000e+01 +2240 2377 4.16666666666667e+00 +2240 2092 4.16666666666667e+00 +2240 1972 -4.16666666666667e+00 +2240 2442 8.33333333333333e+00 +2240 2091 -8.33333333333333e+00 +2241 2241 1.25000000000000e+02 +2241 2249 -4.16666666666667e+00 +2241 2263 -8.33333333333333e+00 +2241 2248 8.33333333333333e+00 +2241 2247 -1.25000000000000e+01 +2241 2174 0.00000000000000e+00 +2241 2173 0.00000000000000e+00 +2241 2177 8.33333333333333e+00 +2241 2176 -4.16666666666667e+00 +2241 2175 -1.25000000000000e+01 +2241 2276 -4.16666666666667e+00 +2241 2258 4.16666666666667e+00 +2241 1916 0.00000000000000e+00 +2241 2243 -1.66666666666667e+01 +2241 2255 8.33333333333333e+00 +2241 2257 4.16666666666667e+00 +2241 2254 -4.16666666666667e+00 +2241 2253 -1.25000000000000e+01 +2241 1919 8.33333333333333e+00 +2241 2270 -8.33333333333333e+00 +2241 2275 -4.16666666666667e+00 +2241 2269 4.16666666666667e+00 +2241 1999 0.00000000000000e+00 +2241 2002 4.16666666666667e+00 +2241 2210 0.00000000000000e+00 +2241 2000 0.00000000000000e+00 +2241 1915 0.00000000000000e+00 +2241 2209 0.00000000000000e+00 +2241 1914 0.00000000000000e+00 +2241 2213 -4.16666666666667e+00 +2241 2003 4.16666666666667e+00 +2241 2242 -1.66666666666667e+01 +2241 2212 8.33333333333333e+00 +2241 1918 8.33333333333333e+00 +2241 2264 4.16666666666667e+00 +2241 2211 -1.25000000000000e+01 +2241 1917 -3.75000000000000e+01 +2242 2242 1.25000000000000e+02 +2242 2264 4.16666666666667e+00 +2242 2262 -8.33333333333333e+00 +2242 2248 -3.75000000000000e+01 +2242 2247 8.33333333333333e+00 +2242 2174 0.00000000000000e+00 +2242 2172 0.00000000000000e+00 +2242 2177 8.33333333333333e+00 +2242 2176 -1.25000000000000e+01 +2242 2175 -4.16666666666667e+00 +2242 2243 -1.66666666666667e+01 +2242 1919 -4.16666666666667e+00 +2242 1916 0.00000000000000e+00 +2242 2270 4.16666666666667e+00 +2242 2276 -4.16666666666667e+00 +2242 2258 -8.33333333333333e+00 +2242 2255 8.33333333333333e+00 +2242 2254 -1.25000000000000e+01 +2242 2256 4.16666666666667e+00 +2242 2253 -4.16666666666667e+00 +2242 2274 -4.16666666666667e+00 +2242 2268 4.16666666666667e+00 +2242 2210 0.00000000000000e+00 +2242 2000 0.00000000000000e+00 +2242 1998 0.00000000000000e+00 +2242 2001 4.16666666666667e+00 +2242 1915 0.00000000000000e+00 +2242 1914 0.00000000000000e+00 +2242 2208 0.00000000000000e+00 +2242 2213 8.33333333333333e+00 +2242 2003 -8.33333333333333e+00 +2242 2249 8.33333333333333e+00 +2242 2212 -3.75000000000000e+01 +2242 1918 -1.25000000000000e+01 +2242 2241 -1.66666666666667e+01 +2242 2211 8.33333333333333e+00 +2242 1917 8.33333333333333e+00 +2243 2243 1.25000000000000e+02 +2243 2247 -4.16666666666667e+00 +2243 2248 8.33333333333333e+00 +2243 2263 4.16666666666667e+00 +2243 2249 -1.25000000000000e+01 +2243 2173 0.00000000000000e+00 +2243 2172 0.00000000000000e+00 +2243 2177 -3.75000000000000e+01 +2243 2176 8.33333333333333e+00 +2243 2175 8.33333333333333e+00 +2243 2242 -1.66666666666667e+01 +2243 1918 -4.16666666666667e+00 +2243 1915 0.00000000000000e+00 +2243 2269 4.16666666666667e+00 +2243 2275 -4.16666666666667e+00 +2243 2274 -4.16666666666667e+00 +2243 2256 4.16666666666667e+00 +2243 2255 -3.75000000000000e+01 +2243 2257 -8.33333333333333e+00 +2243 2254 8.33333333333333e+00 +2243 1914 0.00000000000000e+00 +2243 2241 -1.66666666666667e+01 +2243 2253 8.33333333333333e+00 +2243 1917 8.33333333333333e+00 +2243 2268 -8.33333333333333e+00 +2243 2209 0.00000000000000e+00 +2243 1999 0.00000000000000e+00 +2243 1916 0.00000000000000e+00 +2243 2208 0.00000000000000e+00 +2243 1998 0.00000000000000e+00 +2243 2262 4.16666666666667e+00 +2243 2213 -1.25000000000000e+01 +2243 1919 -1.25000000000000e+01 +2243 2212 8.33333333333333e+00 +2243 2002 -8.33333333333333e+00 +2243 2211 -4.16666666666667e+00 +2243 2001 4.16666666666667e+00 +2244 2244 1.00000000000000e+00 +2244 2246 0.00000000000000e+00 +2244 2249 0.00000000000000e+00 +2244 2182 0.00000000000000e+00 +2244 2173 0.00000000000000e+00 +2244 2411 0.00000000000000e+00 +2244 1946 0.00000000000000e+00 +2244 2410 0.00000000000000e+00 +2244 1945 0.00000000000000e+00 +2244 2181 0.00000000000000e+00 +2244 2174 0.00000000000000e+00 +2244 1916 0.00000000000000e+00 +2244 2248 0.00000000000000e+00 +2244 2245 0.00000000000000e+00 +2244 1915 0.00000000000000e+00 +2244 2247 0.00000000000000e+00 +2244 2414 0.00000000000000e+00 +2244 2108 0.00000000000000e+00 +2244 2107 0.00000000000000e+00 +2244 2413 0.00000000000000e+00 +2244 1944 0.00000000000000e+00 +2244 2105 0.00000000000000e+00 +2244 2258 0.00000000000000e+00 +2244 2104 0.00000000000000e+00 +2244 2257 0.00000000000000e+00 +2244 2103 0.00000000000000e+00 +2244 2183 0.00000000000000e+00 +2244 1914 0.00000000000000e+00 +2245 2245 1.00000000000000e+00 +2245 2249 0.00000000000000e+00 +2245 2181 0.00000000000000e+00 +2245 2172 0.00000000000000e+00 +2245 2183 0.00000000000000e+00 +2245 2182 0.00000000000000e+00 +2245 2409 0.00000000000000e+00 +2245 1944 0.00000000000000e+00 +2245 2174 0.00000000000000e+00 +2245 2248 0.00000000000000e+00 +2245 2247 0.00000000000000e+00 +2245 2244 0.00000000000000e+00 +2245 1914 0.00000000000000e+00 +2245 2414 0.00000000000000e+00 +2245 2258 0.00000000000000e+00 +2245 2108 0.00000000000000e+00 +2245 1946 0.00000000000000e+00 +2245 1945 0.00000000000000e+00 +2245 2106 0.00000000000000e+00 +2245 2412 0.00000000000000e+00 +2245 2105 0.00000000000000e+00 +2245 2246 0.00000000000000e+00 +2245 1916 0.00000000000000e+00 +2245 2104 0.00000000000000e+00 +2245 2411 0.00000000000000e+00 +2245 1915 0.00000000000000e+00 +2245 2103 0.00000000000000e+00 +2245 2256 0.00000000000000e+00 +2246 2246 1.00000000000000e+00 +2246 2248 0.00000000000000e+00 +2246 2181 0.00000000000000e+00 +2246 2244 0.00000000000000e+00 +2246 2247 0.00000000000000e+00 +2246 2183 0.00000000000000e+00 +2246 2182 0.00000000000000e+00 +2246 2409 0.00000000000000e+00 +2246 1944 0.00000000000000e+00 +2246 2249 0.00000000000000e+00 +2246 2173 0.00000000000000e+00 +2246 2172 0.00000000000000e+00 +2246 1914 0.00000000000000e+00 +2246 2412 0.00000000000000e+00 +2246 2106 0.00000000000000e+00 +2246 2413 0.00000000000000e+00 +2246 2257 0.00000000000000e+00 +2246 1946 0.00000000000000e+00 +2246 2107 0.00000000000000e+00 +2246 1945 0.00000000000000e+00 +2246 2105 0.00000000000000e+00 +2246 2410 0.00000000000000e+00 +2246 1916 0.00000000000000e+00 +2246 2104 0.00000000000000e+00 +2246 2245 0.00000000000000e+00 +2246 1915 0.00000000000000e+00 +2246 2103 0.00000000000000e+00 +2246 2256 0.00000000000000e+00 +2247 2247 1.25000000000000e+02 +2247 2275 4.16666666666667e+00 +2247 2419 -4.16666666666667e+00 +2247 2414 4.16666666666667e+00 +2247 2420 -4.16666666666667e+00 +2247 2413 4.16666666666667e+00 +2247 2257 -4.16666666666667e+00 +2247 2258 8.33333333333333e+00 +2247 2256 -1.25000000000000e+01 +2247 2183 0.00000000000000e+00 +2247 2246 0.00000000000000e+00 +2247 2182 0.00000000000000e+00 +2247 1949 4.16666666666667e+00 +2247 2411 -4.16666666666667e+00 +2247 2410 8.33333333333333e+00 +2247 2409 -1.25000000000000e+01 +2247 1916 0.00000000000000e+00 +2247 2245 0.00000000000000e+00 +2247 2244 0.00000000000000e+00 +2247 2243 -4.16666666666667e+00 +2247 2248 -1.66666666666667e+01 +2247 2185 -4.16666666666667e+00 +2247 2177 4.16666666666667e+00 +2247 2174 0.00000000000000e+00 +2247 2176 4.16666666666667e+00 +2247 2173 0.00000000000000e+00 +2247 2186 8.33333333333333e+00 +2247 2264 8.33333333333333e+00 +2247 2249 -1.66666666666667e+01 +2247 1948 -8.33333333333333e+00 +2247 2263 8.33333333333333e+00 +2247 2184 -1.25000000000000e+01 +2247 2262 -3.75000000000000e+01 +2247 2242 8.33333333333333e+00 +2247 1915 0.00000000000000e+00 +2247 2276 -8.33333333333333e+00 +2247 2241 -1.25000000000000e+01 +2248 2248 1.25000000000000e+02 +2248 2274 4.16666666666667e+00 +2248 2418 -4.16666666666667e+00 +2248 2414 -8.33333333333333e+00 +2248 2258 8.33333333333333e+00 +2248 2412 4.16666666666667e+00 +2248 2256 -4.16666666666667e+00 +2248 2420 -4.16666666666667e+00 +2248 2257 -1.25000000000000e+01 +2248 2183 0.00000000000000e+00 +2248 2246 0.00000000000000e+00 +2248 2181 0.00000000000000e+00 +2248 2411 8.33333333333333e+00 +2248 2249 -1.66666666666667e+01 +2248 2410 -3.75000000000000e+01 +2248 2409 8.33333333333333e+00 +2248 2245 0.00000000000000e+00 +2248 2244 0.00000000000000e+00 +2248 2247 -1.66666666666667e+01 +2248 2184 -4.16666666666667e+00 +2248 2186 8.33333333333333e+00 +2248 2177 -8.33333333333333e+00 +2248 2243 8.33333333333333e+00 +2248 2175 4.16666666666667e+00 +2248 2172 0.00000000000000e+00 +2248 1949 4.16666666666667e+00 +2248 2264 -4.16666666666667e+00 +2248 2185 -1.25000000000000e+01 +2248 2263 -1.25000000000000e+01 +2248 1947 -8.33333333333333e+00 +2248 2262 8.33333333333333e+00 +2248 2174 0.00000000000000e+00 +2248 1916 0.00000000000000e+00 +2248 2276 4.16666666666667e+00 +2248 2242 -3.75000000000000e+01 +2248 2241 8.33333333333333e+00 +2248 1914 0.00000000000000e+00 +2249 2249 1.25000000000000e+02 +2249 2274 -8.33333333333333e+00 +2249 2412 4.16666666666667e+00 +2249 2418 -4.16666666666667e+00 +2249 2413 -8.33333333333333e+00 +2249 2257 8.33333333333333e+00 +2249 2419 -4.16666666666667e+00 +2249 2258 -3.75000000000000e+01 +2249 2256 8.33333333333333e+00 +2249 2182 0.00000000000000e+00 +2249 2245 0.00000000000000e+00 +2249 2181 0.00000000000000e+00 +2249 2244 0.00000000000000e+00 +2249 2411 -1.25000000000000e+01 +2249 2410 8.33333333333333e+00 +2249 2248 -1.66666666666667e+01 +2249 1947 4.16666666666667e+00 +2249 2409 -4.16666666666667e+00 +2249 2246 0.00000000000000e+00 +2249 1914 0.00000000000000e+00 +2249 2241 -4.16666666666667e+00 +2249 2185 8.33333333333333e+00 +2249 2175 4.16666666666667e+00 +2249 2172 0.00000000000000e+00 +2249 2176 -8.33333333333333e+00 +2249 2242 8.33333333333333e+00 +2249 2186 -3.75000000000000e+01 +2249 2264 -1.25000000000000e+01 +2249 1948 4.16666666666667e+00 +2249 2263 -4.16666666666667e+00 +2249 2184 8.33333333333333e+00 +2249 2262 8.33333333333333e+00 +2249 2247 -1.66666666666667e+01 +2249 2275 4.16666666666667e+00 +2249 2243 -1.25000000000000e+01 +2249 2173 0.00000000000000e+00 +2249 1915 0.00000000000000e+00 +2250 2250 1.00000000000000e+00 +2250 2210 0.00000000000000e+00 +2250 2251 0.00000000000000e+00 +2250 2218 0.00000000000000e+00 +2250 2209 0.00000000000000e+00 +2250 1915 0.00000000000000e+00 +2250 1963 0.00000000000000e+00 +2250 2217 0.00000000000000e+00 +2250 2446 0.00000000000000e+00 +2250 1964 0.00000000000000e+00 +2250 2447 0.00000000000000e+00 +2250 2252 0.00000000000000e+00 +2250 1916 0.00000000000000e+00 +2250 2255 0.00000000000000e+00 +2250 2254 0.00000000000000e+00 +2250 2253 0.00000000000000e+00 +2250 2110 0.00000000000000e+00 +2250 2449 0.00000000000000e+00 +2250 2111 0.00000000000000e+00 +2250 2450 0.00000000000000e+00 +2250 1962 0.00000000000000e+00 +2250 2105 0.00000000000000e+00 +2250 2258 0.00000000000000e+00 +2250 2104 0.00000000000000e+00 +2250 2257 0.00000000000000e+00 +2250 2103 0.00000000000000e+00 +2250 2219 0.00000000000000e+00 +2250 1914 0.00000000000000e+00 +2251 2251 1.00000000000000e+00 +2251 2217 0.00000000000000e+00 +2251 2210 0.00000000000000e+00 +2251 2208 0.00000000000000e+00 +2251 1914 0.00000000000000e+00 +2251 2219 0.00000000000000e+00 +2251 2218 0.00000000000000e+00 +2251 1962 0.00000000000000e+00 +2251 2445 0.00000000000000e+00 +2251 2447 0.00000000000000e+00 +2251 2255 0.00000000000000e+00 +2251 2254 0.00000000000000e+00 +2251 2253 0.00000000000000e+00 +2251 2258 0.00000000000000e+00 +2251 2450 0.00000000000000e+00 +2251 2109 0.00000000000000e+00 +2251 2448 0.00000000000000e+00 +2251 2111 0.00000000000000e+00 +2251 1964 0.00000000000000e+00 +2251 1963 0.00000000000000e+00 +2251 2105 0.00000000000000e+00 +2251 2252 0.00000000000000e+00 +2251 1916 0.00000000000000e+00 +2251 2104 0.00000000000000e+00 +2251 2250 0.00000000000000e+00 +2251 1915 0.00000000000000e+00 +2251 2103 0.00000000000000e+00 +2251 2256 0.00000000000000e+00 +2252 2252 1.00000000000000e+00 +2252 2208 0.00000000000000e+00 +2252 2209 0.00000000000000e+00 +2252 2219 0.00000000000000e+00 +2252 2218 0.00000000000000e+00 +2252 2446 0.00000000000000e+00 +2252 1962 0.00000000000000e+00 +2252 2445 0.00000000000000e+00 +2252 2255 0.00000000000000e+00 +2252 2254 0.00000000000000e+00 +2252 2250 0.00000000000000e+00 +2252 1914 0.00000000000000e+00 +2252 2253 0.00000000000000e+00 +2252 2257 0.00000000000000e+00 +2252 2449 0.00000000000000e+00 +2252 1964 0.00000000000000e+00 +2252 2110 0.00000000000000e+00 +2252 1963 0.00000000000000e+00 +2252 2109 0.00000000000000e+00 +2252 2448 0.00000000000000e+00 +2252 2105 0.00000000000000e+00 +2252 2217 0.00000000000000e+00 +2252 1916 0.00000000000000e+00 +2252 2104 0.00000000000000e+00 +2252 2251 0.00000000000000e+00 +2252 1915 0.00000000000000e+00 +2252 2103 0.00000000000000e+00 +2252 2256 0.00000000000000e+00 +2253 2253 1.25000000000000e+02 +2253 2213 4.16666666666667e+00 +2253 2210 0.00000000000000e+00 +2253 2222 -4.16666666666667e+00 +2253 2219 0.00000000000000e+00 +2253 2221 8.33333333333333e+00 +2253 2218 0.00000000000000e+00 +2253 2209 0.00000000000000e+00 +2253 2220 -1.25000000000000e+01 +2253 2449 4.16666666666667e+00 +2253 2446 -4.16666666666667e+00 +2253 2450 4.16666666666667e+00 +2253 2252 0.00000000000000e+00 +2253 2251 0.00000000000000e+00 +2253 2254 -1.66666666666667e+01 +2253 2250 0.00000000000000e+00 +2253 2447 8.33333333333333e+00 +2253 2445 -1.25000000000000e+01 +2253 2255 -1.66666666666667e+01 +2253 2258 -4.16666666666667e+00 +2253 2257 8.33333333333333e+00 +2253 2456 -4.16666666666667e+00 +2253 2276 4.16666666666667e+00 +2253 2275 -8.33333333333333e+00 +2253 2269 8.33333333333333e+00 +2253 1916 0.00000000000000e+00 +2253 2243 8.33333333333333e+00 +2253 1915 0.00000000000000e+00 +2253 2242 -4.16666666666667e+00 +2253 2256 -1.25000000000000e+01 +2253 2241 -1.25000000000000e+01 +2253 2270 8.33333333333333e+00 +2253 1967 -8.33333333333333e+00 +2253 2455 -4.16666666666667e+00 +2253 1966 4.16666666666667e+00 +2253 2212 4.16666666666667e+00 +2253 2268 -3.75000000000000e+01 +2254 2254 1.25000000000000e+02 +2254 2213 -8.33333333333333e+00 +2254 2210 0.00000000000000e+00 +2254 2219 0.00000000000000e+00 +2254 2220 8.33333333333333e+00 +2254 2217 0.00000000000000e+00 +2254 2208 0.00000000000000e+00 +2254 2222 8.33333333333333e+00 +2254 2221 -3.75000000000000e+01 +2254 2448 4.16666666666667e+00 +2254 2445 -4.16666666666667e+00 +2254 2447 8.33333333333333e+00 +2254 2450 -8.33333333333333e+00 +2254 2252 0.00000000000000e+00 +2254 1916 0.00000000000000e+00 +2254 2251 0.00000000000000e+00 +2254 2250 0.00000000000000e+00 +2254 2253 -1.66666666666667e+01 +2254 1967 4.16666666666667e+00 +2254 2446 -1.25000000000000e+01 +2254 2270 -4.16666666666667e+00 +2254 2276 4.16666666666667e+00 +2254 2456 -4.16666666666667e+00 +2254 2256 8.33333333333333e+00 +2254 2274 -8.33333333333333e+00 +2254 2268 8.33333333333333e+00 +2254 2258 8.33333333333333e+00 +2254 2243 8.33333333333333e+00 +2254 2255 -1.66666666666667e+01 +2254 2257 -3.75000000000000e+01 +2254 2242 -1.25000000000000e+01 +2254 1914 0.00000000000000e+00 +2254 2241 -4.16666666666667e+00 +2254 2211 4.16666666666667e+00 +2254 2269 -1.25000000000000e+01 +2254 2454 -4.16666666666667e+00 +2254 1965 4.16666666666667e+00 +2255 2255 1.25000000000000e+02 +2255 2211 4.16666666666667e+00 +2255 2208 0.00000000000000e+00 +2255 2209 0.00000000000000e+00 +2255 2218 0.00000000000000e+00 +2255 2220 -4.16666666666667e+00 +2255 2217 0.00000000000000e+00 +2255 2222 -1.25000000000000e+01 +2255 2221 8.33333333333333e+00 +2255 2446 8.33333333333333e+00 +2255 2449 -8.33333333333333e+00 +2255 2448 4.16666666666667e+00 +2255 2252 0.00000000000000e+00 +2255 2251 0.00000000000000e+00 +2255 1915 0.00000000000000e+00 +2255 2250 0.00000000000000e+00 +2255 2447 -3.75000000000000e+01 +2255 1966 4.16666666666667e+00 +2255 2445 8.33333333333333e+00 +2255 2269 -4.16666666666667e+00 +2255 2253 -1.66666666666667e+01 +2255 2256 -4.16666666666667e+00 +2255 2275 4.16666666666667e+00 +2255 2455 -4.16666666666667e+00 +2255 2454 -4.16666666666667e+00 +2255 2274 4.16666666666667e+00 +2255 2258 -1.25000000000000e+01 +2255 2243 -3.75000000000000e+01 +2255 2257 8.33333333333333e+00 +2255 2242 8.33333333333333e+00 +2255 2254 -1.66666666666667e+01 +2255 1914 0.00000000000000e+00 +2255 2241 8.33333333333333e+00 +2255 2212 -8.33333333333333e+00 +2255 2270 -1.25000000000000e+01 +2255 2268 8.33333333333333e+00 +2255 1965 -8.33333333333333e+00 +2256 2256 1.25000000000000e+02 +2256 2248 -4.16666666666667e+00 +2256 2419 -8.33333333333333e+00 +2256 2249 8.33333333333333e+00 +2256 2247 -1.25000000000000e+01 +2256 2414 -4.16666666666667e+00 +2256 2413 8.33333333333333e+00 +2256 2412 -1.25000000000000e+01 +2256 2246 0.00000000000000e+00 +2256 2245 0.00000000000000e+00 +2256 2243 4.16666666666667e+00 +2256 2255 -4.16666666666667e+00 +2256 2257 -1.66666666666667e+01 +2256 2275 8.33333333333333e+00 +2256 2254 8.33333333333333e+00 +2256 2276 8.33333333333333e+00 +2256 2456 -8.33333333333333e+00 +2256 1978 -4.16666666666667e+00 +2256 2455 4.16666666666667e+00 +2256 2274 -3.75000000000000e+01 +2256 1915 0.00000000000000e+00 +2256 2242 4.16666666666667e+00 +2256 2253 -1.25000000000000e+01 +2256 2105 0.00000000000000e+00 +2256 2258 -1.66666666666667e+01 +2256 2450 8.33333333333333e+00 +2256 2113 4.16666666666667e+00 +2256 2449 -4.16666666666667e+00 +2256 2252 0.00000000000000e+00 +2256 1916 0.00000000000000e+00 +2256 2104 0.00000000000000e+00 +2256 2251 0.00000000000000e+00 +2256 2103 0.00000000000000e+00 +2256 2114 4.16666666666667e+00 +2256 1979 -4.16666666666667e+00 +2256 2448 -1.25000000000000e+01 +2256 2420 4.16666666666667e+00 +2257 2257 1.25000000000000e+02 +2257 2247 -4.16666666666667e+00 +2257 2420 4.16666666666667e+00 +2257 2418 -8.33333333333333e+00 +2257 2248 -1.25000000000000e+01 +2257 2246 0.00000000000000e+00 +2257 2412 8.33333333333333e+00 +2257 2414 8.33333333333333e+00 +2257 2413 -3.75000000000000e+01 +2257 2244 0.00000000000000e+00 +2257 2258 -1.66666666666667e+01 +2257 1916 0.00000000000000e+00 +2257 1979 -4.16666666666667e+00 +2257 2276 -4.16666666666667e+00 +2257 2456 4.16666666666667e+00 +2257 2256 -1.66666666666667e+01 +2257 2274 8.33333333333333e+00 +2257 2253 8.33333333333333e+00 +2257 2275 -1.25000000000000e+01 +2257 1977 -4.16666666666667e+00 +2257 2454 4.16666666666667e+00 +2257 2243 -8.33333333333333e+00 +2257 2255 8.33333333333333e+00 +2257 2254 -3.75000000000000e+01 +2257 1914 0.00000000000000e+00 +2257 2241 4.16666666666667e+00 +2257 2105 0.00000000000000e+00 +2257 2252 0.00000000000000e+00 +2257 2112 4.16666666666667e+00 +2257 2448 -4.16666666666667e+00 +2257 2104 0.00000000000000e+00 +2257 2103 0.00000000000000e+00 +2257 2250 0.00000000000000e+00 +2257 2114 -8.33333333333333e+00 +2257 2450 8.33333333333333e+00 +2257 2449 -1.25000000000000e+01 +2257 2249 8.33333333333333e+00 +2258 2258 1.25000000000000e+02 +2258 2248 8.33333333333333e+00 +2258 2419 4.16666666666667e+00 +2258 2249 -3.75000000000000e+01 +2258 2247 8.33333333333333e+00 +2258 2412 -4.16666666666667e+00 +2258 2245 0.00000000000000e+00 +2258 2414 -1.25000000000000e+01 +2258 2413 8.33333333333333e+00 +2258 2244 0.00000000000000e+00 +2258 2257 -1.66666666666667e+01 +2258 1915 0.00000000000000e+00 +2258 1978 -4.16666666666667e+00 +2258 2241 4.16666666666667e+00 +2258 2253 -4.16666666666667e+00 +2258 2275 -4.16666666666667e+00 +2258 2455 4.16666666666667e+00 +2258 2276 -1.25000000000000e+01 +2258 2274 8.33333333333333e+00 +2258 2454 -8.33333333333333e+00 +2258 2255 -1.25000000000000e+01 +2258 2242 -8.33333333333333e+00 +2258 2254 8.33333333333333e+00 +2258 2104 0.00000000000000e+00 +2258 2251 0.00000000000000e+00 +2258 2103 0.00000000000000e+00 +2258 2256 -1.66666666666667e+01 +2258 2448 8.33333333333333e+00 +2258 2105 0.00000000000000e+00 +2258 2250 0.00000000000000e+00 +2258 1914 0.00000000000000e+00 +2258 2450 -3.75000000000000e+01 +2258 2418 4.16666666666667e+00 +2258 2113 -8.33333333333333e+00 +2258 2449 8.33333333333333e+00 +2258 2112 4.16666666666667e+00 +2258 1977 -4.16666666666667e+00 +2259 2259 1.25000000000000e+02 +2259 2194 -4.16666666666667e+00 +2259 2189 -8.33333333333333e+00 +2259 2195 8.33333333333333e+00 +2259 2193 -1.25000000000000e+01 +2259 2372 4.16666666666667e+00 +2259 2371 -8.33333333333333e+00 +2259 2267 -4.16666666666667e+00 +2259 2266 8.33333333333333e+00 +2259 2265 -1.25000000000000e+01 +2259 2158 -4.16666666666667e+00 +2259 2167 4.16666666666667e+00 +2259 2168 4.16666666666667e+00 +2259 2231 -4.16666666666667e+00 +2259 1936 8.33333333333333e+00 +2259 2260 -1.66666666666667e+01 +2259 2230 8.33333333333333e+00 +2259 2229 -1.25000000000000e+01 +2259 2159 -4.16666666666667e+00 +2259 2225 4.16666666666667e+00 +2259 1918 8.33333333333333e+00 +2259 2224 -8.33333333333333e+00 +2259 2120 -4.16666666666667e+00 +2259 2117 4.16666666666667e+00 +2259 1937 8.33333333333333e+00 +2259 2378 -8.33333333333333e+00 +2259 2377 4.16666666666667e+00 +2259 2119 -4.16666666666667e+00 +2259 1935 -3.75000000000000e+01 +2259 2261 -1.66666666666667e+01 +2259 2273 8.33333333333333e+00 +2259 1919 8.33333333333333e+00 +2259 2272 -4.16666666666667e+00 +2259 2116 4.16666666666667e+00 +2259 2188 4.16666666666667e+00 +2259 2271 -1.25000000000000e+01 +2259 1917 -3.75000000000000e+01 +2260 2260 1.25000000000000e+02 +2260 2193 -4.16666666666667e+00 +2260 2195 8.33333333333333e+00 +2260 2189 4.16666666666667e+00 +2260 2194 -1.25000000000000e+01 +2260 2372 4.16666666666667e+00 +2260 2370 -8.33333333333333e+00 +2260 2267 8.33333333333333e+00 +2260 2266 -3.75000000000000e+01 +2260 2265 8.33333333333333e+00 +2260 2261 -1.66666666666667e+01 +2260 1919 -4.16666666666667e+00 +2260 1937 -4.16666666666667e+00 +2260 2225 4.16666666666667e+00 +2260 2159 -4.16666666666667e+00 +2260 2157 -4.16666666666667e+00 +2260 2166 4.16666666666667e+00 +2260 2168 -8.33333333333333e+00 +2260 2231 8.33333333333333e+00 +2260 2230 -3.75000000000000e+01 +2260 1935 8.33333333333333e+00 +2260 2259 -1.66666666666667e+01 +2260 2229 8.33333333333333e+00 +2260 1917 8.33333333333333e+00 +2260 2223 -8.33333333333333e+00 +2260 2378 4.16666666666667e+00 +2260 2120 -4.16666666666667e+00 +2260 1936 -1.25000000000000e+01 +2260 2376 4.16666666666667e+00 +2260 2118 -4.16666666666667e+00 +2260 2273 8.33333333333333e+00 +2260 2117 -8.33333333333333e+00 +2260 2187 4.16666666666667e+00 +2260 2272 -1.25000000000000e+01 +2260 1918 -1.25000000000000e+01 +2260 2271 -4.16666666666667e+00 +2260 2115 4.16666666666667e+00 +2261 2261 1.25000000000000e+02 +2261 2188 4.16666666666667e+00 +2261 2187 -8.33333333333333e+00 +2261 2195 -3.75000000000000e+01 +2261 2193 8.33333333333333e+00 +2261 2371 4.16666666666667e+00 +2261 2370 4.16666666666667e+00 +2261 2267 -1.25000000000000e+01 +2261 2266 8.33333333333333e+00 +2261 2265 -4.16666666666667e+00 +2261 2260 -1.66666666666667e+01 +2261 1918 -4.16666666666667e+00 +2261 1936 -4.16666666666667e+00 +2261 2224 4.16666666666667e+00 +2261 2158 -4.16666666666667e+00 +2261 2231 -1.25000000000000e+01 +2261 2167 -8.33333333333333e+00 +2261 2230 8.33333333333333e+00 +2261 2166 4.16666666666667e+00 +2261 2229 -4.16666666666667e+00 +2261 2157 -4.16666666666667e+00 +2261 2223 4.16666666666667e+00 +2261 2377 4.16666666666667e+00 +2261 2119 -4.16666666666667e+00 +2261 2118 -4.16666666666667e+00 +2261 2115 4.16666666666667e+00 +2261 1937 -1.25000000000000e+01 +2261 1935 8.33333333333333e+00 +2261 2376 -8.33333333333333e+00 +2261 2194 8.33333333333333e+00 +2261 2273 -3.75000000000000e+01 +2261 1919 -1.25000000000000e+01 +2261 2272 8.33333333333333e+00 +2261 2116 -8.33333333333333e+00 +2261 2259 -1.66666666666667e+01 +2261 2271 8.33333333333333e+00 +2261 1917 8.33333333333333e+00 +2262 2262 1.25000000000000e+02 +2262 2200 -4.16666666666667e+00 +2262 2201 8.33333333333333e+00 +2262 2189 4.16666666666667e+00 +2262 2199 -1.25000000000000e+01 +2262 2417 4.16666666666667e+00 +2262 2416 -8.33333333333333e+00 +2262 2267 8.33333333333333e+00 +2262 2266 8.33333333333333e+00 +2262 2265 -3.75000000000000e+01 +2262 2264 -1.66666666666667e+01 +2262 1949 -4.16666666666667e+00 +2262 1919 -4.16666666666667e+00 +2262 2177 -4.16666666666667e+00 +2262 2243 4.16666666666667e+00 +2262 2176 -4.16666666666667e+00 +2262 2185 4.16666666666667e+00 +2262 2186 -8.33333333333333e+00 +2262 2249 8.33333333333333e+00 +2262 1948 8.33333333333333e+00 +2262 2263 -1.66666666666667e+01 +2262 2248 8.33333333333333e+00 +2262 2247 -3.75000000000000e+01 +2262 1918 8.33333333333333e+00 +2262 2242 -8.33333333333333e+00 +2262 2123 -4.16666666666667e+00 +2262 2420 4.16666666666667e+00 +2262 2419 4.16666666666667e+00 +2262 2122 -4.16666666666667e+00 +2262 1947 -1.25000000000000e+01 +2262 2276 8.33333333333333e+00 +2262 2117 -8.33333333333333e+00 +2262 2275 -4.16666666666667e+00 +2262 2116 4.16666666666667e+00 +2262 2274 -1.25000000000000e+01 +2262 2188 4.16666666666667e+00 +2262 1917 -1.25000000000000e+01 +2263 2263 1.25000000000000e+02 +2263 2199 -4.16666666666667e+00 +2263 2189 -8.33333333333333e+00 +2263 2201 8.33333333333333e+00 +2263 2200 -1.25000000000000e+01 +2263 2417 4.16666666666667e+00 +2263 2415 -8.33333333333333e+00 +2263 2267 -4.16666666666667e+00 +2263 2266 -1.25000000000000e+01 +2263 2265 8.33333333333333e+00 +2263 2175 -4.16666666666667e+00 +2263 2184 4.16666666666667e+00 +2263 2186 4.16666666666667e+00 +2263 2249 -4.16666666666667e+00 +2263 2248 -1.25000000000000e+01 +2263 1947 8.33333333333333e+00 +2263 2262 -1.66666666666667e+01 +2263 2247 8.33333333333333e+00 +2263 2177 -4.16666666666667e+00 +2263 2243 4.16666666666667e+00 +2263 1917 8.33333333333333e+00 +2263 2241 -8.33333333333333e+00 +2263 2123 -4.16666666666667e+00 +2263 2117 4.16666666666667e+00 +2263 2420 -8.33333333333333e+00 +2263 1949 8.33333333333333e+00 +2263 1948 -3.75000000000000e+01 +2263 2418 4.16666666666667e+00 +2263 2121 -4.16666666666667e+00 +2263 2276 8.33333333333333e+00 +2263 2264 -1.66666666666667e+01 +2263 1919 8.33333333333333e+00 +2263 2275 -1.25000000000000e+01 +2263 2187 4.16666666666667e+00 +2263 1918 -3.75000000000000e+01 +2263 2274 -4.16666666666667e+00 +2263 2115 4.16666666666667e+00 +2264 2264 1.25000000000000e+02 +2264 2188 -8.33333333333333e+00 +2264 2187 4.16666666666667e+00 +2264 2201 -3.75000000000000e+01 +2264 2200 8.33333333333333e+00 +2264 2415 4.16666666666667e+00 +2264 2416 4.16666666666667e+00 +2264 2267 -1.25000000000000e+01 +2264 2266 -4.16666666666667e+00 +2264 2265 8.33333333333333e+00 +2264 2262 -1.66666666666667e+01 +2264 1947 -4.16666666666667e+00 +2264 1917 -4.16666666666667e+00 +2264 2175 -4.16666666666667e+00 +2264 2241 4.16666666666667e+00 +2264 2249 -1.25000000000000e+01 +2264 2185 4.16666666666667e+00 +2264 2248 -4.16666666666667e+00 +2264 2184 -8.33333333333333e+00 +2264 2247 8.33333333333333e+00 +2264 2176 -4.16666666666667e+00 +2264 2242 4.16666666666667e+00 +2264 2121 -4.16666666666667e+00 +2264 2418 4.16666666666667e+00 +2264 2122 -4.16666666666667e+00 +2264 2116 4.16666666666667e+00 +2264 1949 -1.25000000000000e+01 +2264 2419 -8.33333333333333e+00 +2264 1948 8.33333333333333e+00 +2264 2276 -3.75000000000000e+01 +2264 2199 8.33333333333333e+00 +2264 1919 -1.25000000000000e+01 +2264 2275 8.33333333333333e+00 +2264 2263 -1.66666666666667e+01 +2264 1918 8.33333333333333e+00 +2264 2274 8.33333333333333e+00 +2264 2115 -8.33333333333333e+00 +2265 2265 1.25000000000000e+02 +2265 2201 -8.33333333333333e+00 +2265 2417 -4.16666666666667e+00 +2265 2122 4.16666666666667e+00 +2265 2123 4.16666666666667e+00 +2265 2416 8.33333333333333e+00 +2265 2415 -1.25000000000000e+01 +2265 2264 8.33333333333333e+00 +2265 2263 8.33333333333333e+00 +2265 2262 -3.75000000000000e+01 +2265 2188 -4.16666666666667e+00 +2265 2189 -4.16666666666667e+00 +2265 2203 -4.16666666666667e+00 +2265 2194 4.16666666666667e+00 +2265 2195 4.16666666666667e+00 +2265 2204 8.33333333333333e+00 +2265 2267 -1.66666666666667e+01 +2265 2202 -1.25000000000000e+01 +2265 2116 -4.16666666666667e+00 +2265 2266 -1.66666666666667e+01 +2265 2372 8.33333333333333e+00 +2265 2125 -4.16666666666667e+00 +2265 2119 4.16666666666667e+00 +2265 2117 8.33333333333333e+00 +2265 2120 -8.33333333333333e+00 +2265 1955 4.16666666666667e+00 +2265 2126 -4.16666666666667e+00 +2265 2371 8.33333333333333e+00 +2265 1954 -8.33333333333333e+00 +2265 2370 -3.75000000000000e+01 +2265 2261 -4.16666666666667e+00 +2265 1919 4.16666666666667e+00 +2265 2260 8.33333333333333e+00 +2265 1918 -8.33333333333333e+00 +2265 2259 -1.25000000000000e+01 +2265 2200 4.16666666666667e+00 +2265 2115 -1.25000000000000e+01 +2266 2266 1.25000000000000e+02 +2266 2201 4.16666666666667e+00 +2266 2417 8.33333333333333e+00 +2266 2121 4.16666666666667e+00 +2266 2123 -8.33333333333333e+00 +2266 2416 -3.75000000000000e+01 +2266 2415 8.33333333333333e+00 +2266 2264 -4.16666666666667e+00 +2266 2263 -1.25000000000000e+01 +2266 2262 8.33333333333333e+00 +2266 2187 -4.16666666666667e+00 +2266 2204 8.33333333333333e+00 +2266 2202 -4.16666666666667e+00 +2266 2193 4.16666666666667e+00 +2266 2195 -8.33333333333333e+00 +2266 1955 4.16666666666667e+00 +2266 2203 -1.25000000000000e+01 +2266 2189 -4.16666666666667e+00 +2266 1919 4.16666666666667e+00 +2266 2115 -4.16666666666667e+00 +2266 2372 -4.16666666666667e+00 +2266 2265 -1.66666666666667e+01 +2266 2124 -4.16666666666667e+00 +2266 2118 4.16666666666667e+00 +2266 2126 -4.16666666666667e+00 +2266 2120 4.16666666666667e+00 +2266 2371 -1.25000000000000e+01 +2266 2370 8.33333333333333e+00 +2266 1953 -8.33333333333333e+00 +2266 2261 8.33333333333333e+00 +2266 2267 -1.66666666666667e+01 +2266 2117 8.33333333333333e+00 +2266 2260 -3.75000000000000e+01 +2266 2199 4.16666666666667e+00 +2266 2116 -1.25000000000000e+01 +2266 2259 8.33333333333333e+00 +2266 1917 -8.33333333333333e+00 +2267 2267 1.25000000000000e+02 +2267 2199 -8.33333333333333e+00 +2267 2415 -4.16666666666667e+00 +2267 2416 8.33333333333333e+00 +2267 2122 -8.33333333333333e+00 +2267 2121 4.16666666666667e+00 +2267 2417 -1.25000000000000e+01 +2267 2264 -1.25000000000000e+01 +2267 2263 -4.16666666666667e+00 +2267 2262 8.33333333333333e+00 +2267 2187 -4.16666666666667e+00 +2267 2203 8.33333333333333e+00 +2267 2194 -8.33333333333333e+00 +2267 2193 4.16666666666667e+00 +2267 2204 -3.75000000000000e+01 +2267 1954 4.16666666666667e+00 +2267 2202 8.33333333333333e+00 +2267 2265 -1.66666666666667e+01 +2267 2188 -4.16666666666667e+00 +2267 1918 4.16666666666667e+00 +2267 2371 -4.16666666666667e+00 +2267 2370 8.33333333333333e+00 +2267 2125 -4.16666666666667e+00 +2267 2119 4.16666666666667e+00 +2267 2115 8.33333333333333e+00 +2267 2118 -8.33333333333333e+00 +2267 2372 -1.25000000000000e+01 +2267 1953 4.16666666666667e+00 +2267 2124 -4.16666666666667e+00 +2267 2261 -1.25000000000000e+01 +2267 2200 4.16666666666667e+00 +2267 2117 -3.75000000000000e+01 +2267 2260 8.33333333333333e+00 +2267 2266 -1.66666666666667e+01 +2267 2116 8.33333333333333e+00 +2267 2259 -4.16666666666667e+00 +2267 1917 4.16666666666667e+00 +2268 2268 1.25000000000000e+02 +2268 2243 -8.33333333333333e+00 +2268 2242 4.16666666666667e+00 +2268 2255 8.33333333333333e+00 +2268 2253 -3.75000000000000e+01 +2268 2455 4.16666666666667e+00 +2268 2456 4.16666666666667e+00 +2268 2276 -4.16666666666667e+00 +2268 2275 8.33333333333333e+00 +2268 2274 -1.25000000000000e+01 +2268 2212 -4.16666666666667e+00 +2268 2213 -4.16666666666667e+00 +2268 2222 4.16666666666667e+00 +2268 2221 -8.33333333333333e+00 +2268 2225 4.16666666666667e+00 +2268 2237 -4.16666666666667e+00 +2268 2269 -1.66666666666667e+01 +2268 2236 8.33333333333333e+00 +2268 2224 4.16666666666667e+00 +2268 1918 -4.16666666666667e+00 +2268 1966 -4.16666666666667e+00 +2268 2235 -1.25000000000000e+01 +2268 2117 4.16666666666667e+00 +2268 2129 -4.16666666666667e+00 +2268 2452 4.16666666666667e+00 +2268 2128 -4.16666666666667e+00 +2268 1967 8.33333333333333e+00 +2268 2453 -8.33333333333333e+00 +2268 1965 -1.25000000000000e+01 +2268 2270 -1.66666666666667e+01 +2268 2273 8.33333333333333e+00 +2268 1919 8.33333333333333e+00 +2268 2272 8.33333333333333e+00 +2268 2116 -8.33333333333333e+00 +2268 2254 8.33333333333333e+00 +2268 2271 -3.75000000000000e+01 +2268 1917 -1.25000000000000e+01 +2269 2269 1.25000000000000e+02 +2269 2255 -4.16666666666667e+00 +2269 2253 8.33333333333333e+00 +2269 2241 4.16666666666667e+00 +2269 2254 -1.25000000000000e+01 +2269 2454 4.16666666666667e+00 +2269 2456 -8.33333333333333e+00 +2269 2276 8.33333333333333e+00 +2269 2275 -3.75000000000000e+01 +2269 2274 8.33333333333333e+00 +2269 2211 -4.16666666666667e+00 +2269 2213 -4.16666666666667e+00 +2269 2222 4.16666666666667e+00 +2269 2220 -8.33333333333333e+00 +2269 2268 -1.66666666666667e+01 +2269 2235 8.33333333333333e+00 +2269 2225 -8.33333333333333e+00 +2269 1919 8.33333333333333e+00 +2269 2223 4.16666666666667e+00 +2269 1917 -4.16666666666667e+00 +2269 2237 8.33333333333333e+00 +2269 2270 -1.66666666666667e+01 +2269 1967 8.33333333333333e+00 +2269 2236 -3.75000000000000e+01 +2269 1965 -4.16666666666667e+00 +2269 2451 4.16666666666667e+00 +2269 2127 -4.16666666666667e+00 +2269 2453 4.16666666666667e+00 +2269 2129 -4.16666666666667e+00 +2269 1966 -1.25000000000000e+01 +2269 2273 -4.16666666666667e+00 +2269 2117 4.16666666666667e+00 +2269 2243 4.16666666666667e+00 +2269 2272 -1.25000000000000e+01 +2269 1918 -1.25000000000000e+01 +2269 2271 8.33333333333333e+00 +2269 2115 -8.33333333333333e+00 +2270 2270 1.25000000000000e+02 +2270 2254 -4.16666666666667e+00 +2270 2241 -8.33333333333333e+00 +2270 2255 -1.25000000000000e+01 +2270 2253 8.33333333333333e+00 +2270 2455 -8.33333333333333e+00 +2270 2454 4.16666666666667e+00 +2270 2276 -1.25000000000000e+01 +2270 2275 8.33333333333333e+00 +2270 2274 -4.16666666666667e+00 +2270 2212 -4.16666666666667e+00 +2270 2221 4.16666666666667e+00 +2270 2211 -4.16666666666667e+00 +2270 2220 4.16666666666667e+00 +2270 2223 4.16666666666667e+00 +2270 2235 -4.16666666666667e+00 +2270 2224 -8.33333333333333e+00 +2270 1918 8.33333333333333e+00 +2270 2237 -1.25000000000000e+01 +2270 2236 8.33333333333333e+00 +2270 2269 -1.66666666666667e+01 +2270 1966 8.33333333333333e+00 +2270 2115 4.16666666666667e+00 +2270 2127 -4.16666666666667e+00 +2270 1967 -3.75000000000000e+01 +2270 2452 4.16666666666667e+00 +2270 2128 -4.16666666666667e+00 +2270 1965 8.33333333333333e+00 +2270 2451 -8.33333333333333e+00 +2270 2242 4.16666666666667e+00 +2270 2273 -1.25000000000000e+01 +2270 1919 -3.75000000000000e+01 +2270 2272 -4.16666666666667e+00 +2270 2116 4.16666666666667e+00 +2270 2268 -1.66666666666667e+01 +2270 2271 8.33333333333333e+00 +2270 1917 8.33333333333333e+00 +2271 2271 1.25000000000000e+02 +2271 2230 4.16666666666667e+00 +2271 2377 8.33333333333333e+00 +2271 2120 4.16666666666667e+00 +2271 2119 -8.33333333333333e+00 +2271 2378 8.33333333333333e+00 +2271 2376 -3.75000000000000e+01 +2271 2261 8.33333333333333e+00 +2271 2260 -4.16666666666667e+00 +2271 2259 -1.25000000000000e+01 +2271 2225 -4.16666666666667e+00 +2271 2240 -4.16666666666667e+00 +2271 2237 4.16666666666667e+00 +2271 2239 8.33333333333333e+00 +2271 2236 -8.33333333333333e+00 +2271 1972 4.16666666666667e+00 +2271 2238 -1.25000000000000e+01 +2271 2224 -4.16666666666667e+00 +2271 1918 4.16666666666667e+00 +2271 2117 -4.16666666666667e+00 +2271 2273 -1.66666666666667e+01 +2271 2452 -4.16666666666667e+00 +2271 2132 -4.16666666666667e+00 +2271 2129 4.16666666666667e+00 +2271 2131 -4.16666666666667e+00 +2271 2128 4.16666666666667e+00 +2271 2453 8.33333333333333e+00 +2271 1973 -8.33333333333333e+00 +2271 2451 -1.25000000000000e+01 +2271 2270 8.33333333333333e+00 +2271 1919 -8.33333333333333e+00 +2271 2269 8.33333333333333e+00 +2271 2272 -1.66666666666667e+01 +2271 2116 8.33333333333333e+00 +2271 2268 -3.75000000000000e+01 +2271 2231 4.16666666666667e+00 +2271 2115 -1.25000000000000e+01 +2272 2272 1.25000000000000e+02 +2272 2229 4.16666666666667e+00 +2272 2378 -4.16666666666667e+00 +2272 2120 4.16666666666667e+00 +2272 2376 8.33333333333333e+00 +2272 2118 -8.33333333333333e+00 +2272 2377 -1.25000000000000e+01 +2272 2261 8.33333333333333e+00 +2272 2260 -1.25000000000000e+01 +2272 2259 -4.16666666666667e+00 +2272 2225 -4.16666666666667e+00 +2272 2238 8.33333333333333e+00 +2272 2237 4.16666666666667e+00 +2272 2235 -8.33333333333333e+00 +2272 2240 8.33333333333333e+00 +2272 2273 -1.66666666666667e+01 +2272 2239 -3.75000000000000e+01 +2272 1971 4.16666666666667e+00 +2272 2223 -4.16666666666667e+00 +2272 1917 4.16666666666667e+00 +2272 2451 -4.16666666666667e+00 +2272 2453 8.33333333333333e+00 +2272 2117 8.33333333333333e+00 +2272 2129 -8.33333333333333e+00 +2272 2130 -4.16666666666667e+00 +2272 2127 4.16666666666667e+00 +2272 1973 4.16666666666667e+00 +2272 2132 -4.16666666666667e+00 +2272 2452 -1.25000000000000e+01 +2272 2270 -4.16666666666667e+00 +2272 1919 4.16666666666667e+00 +2272 2269 -1.25000000000000e+01 +2272 2231 -8.33333333333333e+00 +2272 2116 -3.75000000000000e+01 +2272 2268 8.33333333333333e+00 +2272 2271 -1.66666666666667e+01 +2272 2115 8.33333333333333e+00 +2273 2273 1.25000000000000e+02 +2273 2230 -8.33333333333333e+00 +2273 2377 -4.16666666666667e+00 +2273 2119 4.16666666666667e+00 +2273 2118 4.16666666666667e+00 +2273 2378 -1.25000000000000e+01 +2273 2376 8.33333333333333e+00 +2273 2261 -3.75000000000000e+01 +2273 2260 8.33333333333333e+00 +2273 2259 8.33333333333333e+00 +2273 2223 -4.16666666666667e+00 +2273 2224 -4.16666666666667e+00 +2273 2238 -4.16666666666667e+00 +2273 2235 4.16666666666667e+00 +2273 2236 4.16666666666667e+00 +2273 2240 -1.25000000000000e+01 +2273 2239 8.33333333333333e+00 +2273 2272 -1.66666666666667e+01 +2273 2115 -4.16666666666667e+00 +2273 2271 -1.66666666666667e+01 +2273 2452 8.33333333333333e+00 +2273 2130 -4.16666666666667e+00 +2273 2127 4.16666666666667e+00 +2273 2116 8.33333333333333e+00 +2273 2128 -8.33333333333333e+00 +2273 2453 -3.75000000000000e+01 +2273 1972 4.16666666666667e+00 +2273 2131 -4.16666666666667e+00 +2273 2451 8.33333333333333e+00 +2273 1971 -8.33333333333333e+00 +2273 2270 -1.25000000000000e+01 +2273 2229 4.16666666666667e+00 +2273 2117 -1.25000000000000e+01 +2273 2269 -4.16666666666667e+00 +2273 1918 4.16666666666667e+00 +2273 2268 8.33333333333333e+00 +2273 1917 -8.33333333333333e+00 +2274 2274 1.25000000000000e+02 +2274 2248 4.16666666666667e+00 +2274 2123 4.16666666666667e+00 +2274 2420 -4.16666666666667e+00 +2274 2419 8.33333333333333e+00 +2274 2122 -8.33333333333333e+00 +2274 2418 -1.25000000000000e+01 +2274 2264 8.33333333333333e+00 +2274 2263 -4.16666666666667e+00 +2274 2262 -1.25000000000000e+01 +2274 2243 -4.16666666666667e+00 +2274 2257 8.33333333333333e+00 +2274 2255 4.16666666666667e+00 +2274 2254 -8.33333333333333e+00 +2274 2258 8.33333333333333e+00 +2274 2276 -1.66666666666667e+01 +2274 1978 4.16666666666667e+00 +2274 2256 -3.75000000000000e+01 +2274 2242 -4.16666666666667e+00 +2274 1918 4.16666666666667e+00 +2274 2455 -4.16666666666667e+00 +2274 2456 8.33333333333333e+00 +2274 2117 8.33333333333333e+00 +2274 2129 -8.33333333333333e+00 +2274 2134 -4.16666666666667e+00 +2274 2128 4.16666666666667e+00 +2274 1979 4.16666666666667e+00 +2274 2135 -4.16666666666667e+00 +2274 2454 -1.25000000000000e+01 +2274 2270 -4.16666666666667e+00 +2274 1919 4.16666666666667e+00 +2274 2275 -1.66666666666667e+01 +2274 2269 8.33333333333333e+00 +2274 2116 8.33333333333333e+00 +2274 2249 -8.33333333333333e+00 +2274 2268 -1.25000000000000e+01 +2274 2115 -3.75000000000000e+01 +2275 2275 1.25000000000000e+02 +2275 2247 4.16666666666667e+00 +2275 2418 8.33333333333333e+00 +2275 2123 4.16666666666667e+00 +2275 2121 -8.33333333333333e+00 +2275 2420 8.33333333333333e+00 +2275 2419 -3.75000000000000e+01 +2275 2264 8.33333333333333e+00 +2275 2263 -1.25000000000000e+01 +2275 2262 -4.16666666666667e+00 +2275 2243 -4.16666666666667e+00 +2275 2258 -4.16666666666667e+00 +2275 2255 4.16666666666667e+00 +2275 2256 8.33333333333333e+00 +2275 2253 -8.33333333333333e+00 +2275 2257 -1.25000000000000e+01 +2275 1977 4.16666666666667e+00 +2275 2241 -4.16666666666667e+00 +2275 1917 4.16666666666667e+00 +2275 2117 -4.16666666666667e+00 +2275 2276 -1.66666666666667e+01 +2275 2454 -4.16666666666667e+00 +2275 2135 -4.16666666666667e+00 +2275 2129 4.16666666666667e+00 +2275 2133 -4.16666666666667e+00 +2275 2127 4.16666666666667e+00 +2275 1979 -8.33333333333333e+00 +2275 2456 8.33333333333333e+00 +2275 2455 -1.25000000000000e+01 +2275 2270 8.33333333333333e+00 +2275 1919 -8.33333333333333e+00 +2275 2249 4.16666666666667e+00 +2275 2269 -3.75000000000000e+01 +2275 2116 -1.25000000000000e+01 +2275 2274 -1.66666666666667e+01 +2275 2268 8.33333333333333e+00 +2275 2115 8.33333333333333e+00 +2276 2276 1.25000000000000e+02 +2276 2247 -8.33333333333333e+00 +2276 2121 4.16666666666667e+00 +2276 2418 -4.16666666666667e+00 +2276 2122 4.16666666666667e+00 +2276 2420 -1.25000000000000e+01 +2276 2419 8.33333333333333e+00 +2276 2264 -3.75000000000000e+01 +2276 2263 8.33333333333333e+00 +2276 2262 8.33333333333333e+00 +2276 2242 -4.16666666666667e+00 +2276 2241 -4.16666666666667e+00 +2276 2257 -4.16666666666667e+00 +2276 2254 4.16666666666667e+00 +2276 2253 4.16666666666667e+00 +2276 2258 -1.25000000000000e+01 +2276 2256 8.33333333333333e+00 +2276 2274 -1.66666666666667e+01 +2276 2116 -4.16666666666667e+00 +2276 2275 -1.66666666666667e+01 +2276 2134 -4.16666666666667e+00 +2276 2128 4.16666666666667e+00 +2276 2454 8.33333333333333e+00 +2276 2115 8.33333333333333e+00 +2276 2127 -8.33333333333333e+00 +2276 2456 -3.75000000000000e+01 +2276 1978 -8.33333333333333e+00 +2276 2455 8.33333333333333e+00 +2276 1977 4.16666666666667e+00 +2276 2133 -4.16666666666667e+00 +2276 2248 4.16666666666667e+00 +2276 2270 -1.25000000000000e+01 +2276 2117 -1.25000000000000e+01 +2276 2269 8.33333333333333e+00 +2276 1918 -8.33333333333333e+00 +2276 2268 -4.16666666666667e+00 +2276 1917 4.16666666666667e+00 +2277 2277 6.25000000000000e+01 +2277 2321 -4.16666666666667e+00 +2277 2293 4.16666666666667e+00 +2277 2320 -4.16666666666667e+00 +2277 2317 -4.16666666666667e+00 +2277 2288 4.16666666666667e+00 +2277 2294 -8.33333333333333e+00 +2277 2287 4.16666666666667e+00 +2277 2286 -1.87500000000000e+01 +2277 2015 4.16666666666667e+00 +2277 2279 -8.33333333333333e+00 +2277 2285 8.33333333333333e+00 +2277 2314 4.16666666666667e+00 +2277 2284 -4.16666666666667e+00 +2277 1922 -2.08333333333333e+00 +2277 2009 2.08333333333333e+00 +2277 1921 4.16666666666667e+00 +2277 2008 -4.16666666666667e+00 +2277 1920 -6.25000000000000e+00 +2277 2283 -1.25000000000000e+01 +2277 1928 -2.08333333333333e+00 +2277 2315 4.16666666666667e+00 +2277 2278 -8.33333333333333e+00 +2277 1927 4.16666666666667e+00 +2277 2014 4.16666666666667e+00 +2277 2318 2.08333333333333e+00 +2277 1926 -6.25000000000000e+00 +2277 2013 -1.87500000000000e+01 +2278 2278 6.25000000000000e+01 +2278 2319 -4.16666666666667e+00 +2278 2318 2.08333333333333e+00 +2278 2321 -4.16666666666667e+00 +2278 2316 -4.16666666666667e+00 +2278 2288 -2.08333333333333e+00 +2278 2294 4.16666666666667e+00 +2278 2287 -6.25000000000000e+00 +2278 2286 4.16666666666667e+00 +2278 2015 -2.08333333333333e+00 +2278 2009 2.08333333333333e+00 +2278 2313 4.16666666666667e+00 +2278 2283 -4.16666666666667e+00 +2278 1922 4.16666666666667e+00 +2278 2279 -8.33333333333333e+00 +2278 2285 8.33333333333333e+00 +2278 1921 -1.87500000000000e+01 +2278 2284 -1.25000000000000e+01 +2278 1920 4.16666666666667e+00 +2278 2007 -4.16666666666667e+00 +2278 1928 4.16666666666667e+00 +2278 2315 -8.33333333333333e+00 +2278 2292 4.16666666666667e+00 +2278 1927 -1.87500000000000e+01 +2278 2014 -6.25000000000000e+00 +2278 2277 -8.33333333333333e+00 +2278 1926 4.16666666666667e+00 +2278 2013 4.16666666666667e+00 +2279 2279 6.25000000000000e+01 +2279 2319 -4.16666666666667e+00 +2279 2317 2.08333333333333e+00 +2279 2320 -4.16666666666667e+00 +2279 2288 -6.25000000000000e+00 +2279 2287 -2.08333333333333e+00 +2279 2293 4.16666666666667e+00 +2279 2286 4.16666666666667e+00 +2279 2292 -8.33333333333333e+00 +2279 2014 -2.08333333333333e+00 +2279 2008 2.08333333333333e+00 +2279 2013 4.16666666666667e+00 +2279 2277 -8.33333333333333e+00 +2279 2283 8.33333333333333e+00 +2279 1922 -6.25000000000000e+00 +2279 2285 -3.75000000000000e+01 +2279 1921 4.16666666666667e+00 +2279 2278 -8.33333333333333e+00 +2279 2284 8.33333333333333e+00 +2279 1920 -2.08333333333333e+00 +2279 2007 2.08333333333333e+00 +2279 2316 2.08333333333333e+00 +2279 1928 -6.25000000000000e+00 +2279 2015 -6.25000000000000e+00 +2279 1927 4.16666666666667e+00 +2279 2314 -8.33333333333333e+00 +2279 1926 -2.08333333333333e+00 +2279 2313 4.16666666666667e+00 +2280 2280 6.25000000000000e+01 +2280 2291 4.16666666666667e+00 +2280 2290 4.16666666666667e+00 +2280 2289 -1.87500000000000e+01 +2280 2354 -4.16666666666667e+00 +2280 2356 -4.16666666666667e+00 +2280 2294 4.16666666666667e+00 +2280 2293 -8.33333333333333e+00 +2280 2357 -4.16666666666667e+00 +2280 2351 4.16666666666667e+00 +2280 2285 -4.16666666666667e+00 +2280 2281 -8.33333333333333e+00 +2280 2284 8.33333333333333e+00 +2280 2020 4.16666666666667e+00 +2280 1922 4.16666666666667e+00 +2280 2009 -4.16666666666667e+00 +2280 1921 -2.08333333333333e+00 +2280 2008 2.08333333333333e+00 +2280 1920 -6.25000000000000e+00 +2280 2283 -1.25000000000000e+01 +2280 2282 -8.33333333333333e+00 +2280 1934 4.16666666666667e+00 +2280 2021 4.16666666666667e+00 +2280 1933 -2.08333333333333e+00 +2280 2350 4.16666666666667e+00 +2280 2353 2.08333333333333e+00 +2280 1932 -6.25000000000000e+00 +2280 2019 -1.87500000000000e+01 +2281 2281 6.25000000000000e+01 +2281 2291 -2.08333333333333e+00 +2281 2290 -6.25000000000000e+00 +2281 2289 4.16666666666667e+00 +2281 2354 2.08333333333333e+00 +2281 2294 4.16666666666667e+00 +2281 2357 -4.16666666666667e+00 +2281 2355 -4.16666666666667e+00 +2281 2292 -8.33333333333333e+00 +2281 2009 2.08333333333333e+00 +2281 2021 -2.08333333333333e+00 +2281 2280 -8.33333333333333e+00 +2281 2283 8.33333333333333e+00 +2281 2019 4.16666666666667e+00 +2281 1922 4.16666666666667e+00 +2281 2282 -8.33333333333333e+00 +2281 2285 8.33333333333333e+00 +2281 1921 -6.25000000000000e+00 +2281 2284 -3.75000000000000e+01 +2281 1920 -2.08333333333333e+00 +2281 2007 2.08333333333333e+00 +2281 1934 4.16666666666667e+00 +2281 2351 -8.33333333333333e+00 +2281 2352 2.08333333333333e+00 +2281 1933 -6.25000000000000e+00 +2281 2020 -6.25000000000000e+00 +2281 1932 -2.08333333333333e+00 +2281 2349 4.16666666666667e+00 +2282 2282 6.25000000000000e+01 +2282 2290 -2.08333333333333e+00 +2282 2289 4.16666666666667e+00 +2282 2353 2.08333333333333e+00 +2282 2352 -4.16666666666667e+00 +2282 2293 4.16666666666667e+00 +2282 2356 -4.16666666666667e+00 +2282 2292 4.16666666666667e+00 +2282 2355 -4.16666666666667e+00 +2282 2349 4.16666666666667e+00 +2282 2283 -4.16666666666667e+00 +2282 2008 2.08333333333333e+00 +2282 2020 -2.08333333333333e+00 +2282 1922 -1.87500000000000e+01 +2282 2285 -1.25000000000000e+01 +2282 1921 4.16666666666667e+00 +2282 2281 -8.33333333333333e+00 +2282 2284 8.33333333333333e+00 +2282 1920 4.16666666666667e+00 +2282 2007 -4.16666666666667e+00 +2282 2291 -6.25000000000000e+00 +2282 1934 -1.87500000000000e+01 +2282 2021 -6.25000000000000e+00 +2282 1933 4.16666666666667e+00 +2282 2350 -8.33333333333333e+00 +2282 2280 -8.33333333333333e+00 +2282 1932 4.16666666666667e+00 +2282 2019 4.16666666666667e+00 +2283 2283 1.25000000000000e+02 +2283 2320 -8.33333333333333e+00 +2283 2279 8.33333333333333e+00 +2283 2014 4.16666666666667e+00 +2283 2278 -4.16666666666667e+00 +2283 2015 -8.33333333333333e+00 +2283 2277 -1.25000000000000e+01 +2283 2315 -4.16666666666667e+00 +2283 2314 8.33333333333333e+00 +2283 2313 -1.25000000000000e+01 +2283 2386 -4.16666666666667e+00 +2283 2294 8.33333333333333e+00 +2283 2357 -8.33333333333333e+00 +2283 2356 4.16666666666667e+00 +2283 1922 4.16666666666667e+00 +2283 2293 8.33333333333333e+00 +2283 2284 -1.66666666666667e+01 +2283 2292 -3.75000000000000e+01 +2283 2387 -4.16666666666667e+00 +2283 1940 4.16666666666667e+00 +2283 2282 -4.16666666666667e+00 +2283 2281 8.33333333333333e+00 +2283 2009 -4.16666666666667e+00 +2283 2021 4.16666666666667e+00 +2283 2026 8.33333333333333e+00 +2283 2020 -8.33333333333333e+00 +2283 1921 4.16666666666667e+00 +2283 2008 -4.16666666666667e+00 +2283 2280 -1.25000000000000e+01 +2283 2285 -1.66666666666667e+01 +2283 2351 8.33333333333333e+00 +2283 2027 8.33333333333333e+00 +2283 2350 -4.16666666666667e+00 +2283 1939 4.16666666666667e+00 +2283 2321 4.16666666666667e+00 +2283 2349 -1.25000000000000e+01 +2283 2025 -3.75000000000000e+01 +2284 2284 1.25000000000000e+02 +2284 2319 -8.33333333333333e+00 +2284 2013 4.16666666666667e+00 +2284 2277 -4.16666666666667e+00 +2284 2015 4.16666666666667e+00 +2284 2279 8.33333333333333e+00 +2284 2278 -1.25000000000000e+01 +2284 2315 8.33333333333333e+00 +2284 2314 -3.75000000000000e+01 +2284 2313 8.33333333333333e+00 +2284 2387 -4.16666666666667e+00 +2284 2385 -4.16666666666667e+00 +2284 2294 -4.16666666666667e+00 +2284 2357 4.16666666666667e+00 +2284 2355 4.16666666666667e+00 +2284 2293 -1.25000000000000e+01 +2284 2292 8.33333333333333e+00 +2284 2283 -1.66666666666667e+01 +2284 2027 -4.16666666666667e+00 +2284 2285 -1.66666666666667e+01 +2284 2009 -4.16666666666667e+00 +2284 2021 4.16666666666667e+00 +2284 2280 8.33333333333333e+00 +2284 2025 8.33333333333333e+00 +2284 2019 -8.33333333333333e+00 +2284 1922 -8.33333333333333e+00 +2284 2282 8.33333333333333e+00 +2284 2281 -3.75000000000000e+01 +2284 1920 4.16666666666667e+00 +2284 2007 -4.16666666666667e+00 +2284 2351 8.33333333333333e+00 +2284 1940 -8.33333333333333e+00 +2284 2321 4.16666666666667e+00 +2284 2350 -1.25000000000000e+01 +2284 2026 -1.25000000000000e+01 +2284 2349 -4.16666666666667e+00 +2284 1938 4.16666666666667e+00 +2285 2285 1.25000000000000e+02 +2285 2319 4.16666666666667e+00 +2285 2277 8.33333333333333e+00 +2285 2014 4.16666666666667e+00 +2285 2013 -8.33333333333333e+00 +2285 2279 -3.75000000000000e+01 +2285 2278 8.33333333333333e+00 +2285 2315 -1.25000000000000e+01 +2285 2314 8.33333333333333e+00 +2285 2313 -4.16666666666667e+00 +2285 2386 -4.16666666666667e+00 +2285 2293 -4.16666666666667e+00 +2285 2356 4.16666666666667e+00 +2285 2292 8.33333333333333e+00 +2285 2355 -8.33333333333333e+00 +2285 2294 -1.25000000000000e+01 +2285 1920 4.16666666666667e+00 +2285 2385 -4.16666666666667e+00 +2285 1938 4.16666666666667e+00 +2285 2026 -4.16666666666667e+00 +2285 2284 -1.66666666666667e+01 +2285 2280 -4.16666666666667e+00 +2285 2008 -4.16666666666667e+00 +2285 2020 4.16666666666667e+00 +2285 2007 -4.16666666666667e+00 +2285 2019 4.16666666666667e+00 +2285 2282 -1.25000000000000e+01 +2285 1921 -8.33333333333333e+00 +2285 2281 8.33333333333333e+00 +2285 2320 4.16666666666667e+00 +2285 2351 -3.75000000000000e+01 +2285 2027 -1.25000000000000e+01 +2285 2350 8.33333333333333e+00 +2285 1939 -8.33333333333333e+00 +2285 2283 -1.66666666666667e+01 +2285 2349 8.33333333333333e+00 +2285 2025 8.33333333333333e+00 +2286 2286 6.25000000000000e+01 +2286 2320 4.16666666666667e+00 +2286 2321 4.16666666666667e+00 +2286 2279 4.16666666666667e+00 +2286 2288 -8.33333333333333e+00 +2286 2278 4.16666666666667e+00 +2286 2277 -1.87500000000000e+01 +2286 2317 4.16666666666667e+00 +2286 2316 -6.25000000000000e+00 +2286 2293 -4.16666666666667e+00 +2286 2287 -8.33333333333333e+00 +2286 2294 8.33333333333333e+00 +2286 2030 -2.08333333333333e+00 +2286 1922 2.08333333333333e+00 +2286 2029 4.16666666666667e+00 +2286 1921 -4.16666666666667e+00 +2286 2028 -6.25000000000000e+00 +2286 2318 -2.08333333333333e+00 +2286 2292 -1.25000000000000e+01 +2286 1388 4.16666666666667e+00 +2286 1573 -4.16666666666667e+00 +2286 1399 4.16666666666667e+00 +2286 1400 -8.33333333333333e+00 +2286 1304 2.08333333333333e+00 +2286 1574 -4.16666666666667e+00 +2286 1387 4.16666666666667e+00 +2286 1303 -4.16666666666667e+00 +2286 1386 -1.87500000000000e+01 +2287 2287 6.25000000000000e+01 +2287 2319 4.16666666666667e+00 +2287 2321 -8.33333333333333e+00 +2287 2279 -2.08333333333333e+00 +2287 1922 2.08333333333333e+00 +2287 2278 -6.25000000000000e+00 +2287 2277 4.16666666666667e+00 +2287 2317 -1.87500000000000e+01 +2287 2316 4.16666666666667e+00 +2287 2292 -4.16666666666667e+00 +2287 2286 -8.33333333333333e+00 +2287 2030 4.16666666666667e+00 +2287 2288 -8.33333333333333e+00 +2287 2294 8.33333333333333e+00 +2287 2029 -1.87500000000000e+01 +2287 2318 4.16666666666667e+00 +2287 2293 -1.25000000000000e+01 +2287 2028 4.16666666666667e+00 +2287 1920 -4.16666666666667e+00 +2287 1304 2.08333333333333e+00 +2287 1388 -2.08333333333333e+00 +2287 1572 -4.16666666666667e+00 +2287 1398 4.16666666666667e+00 +2287 1574 -4.16666666666667e+00 +2287 1400 4.16666666666667e+00 +2287 1387 -6.25000000000000e+00 +2287 1386 4.16666666666667e+00 +2287 1302 -4.16666666666667e+00 +2288 2288 6.25000000000000e+01 +2288 2316 -2.08333333333333e+00 +2288 2320 -8.33333333333333e+00 +2288 2319 4.16666666666667e+00 +2288 2279 -6.25000000000000e+00 +2288 2278 -2.08333333333333e+00 +2288 1921 2.08333333333333e+00 +2288 2277 4.16666666666667e+00 +2288 2286 -8.33333333333333e+00 +2288 2318 -6.25000000000000e+00 +2288 2292 8.33333333333333e+00 +2288 2030 -6.25000000000000e+00 +2288 2317 4.16666666666667e+00 +2288 2294 -3.75000000000000e+01 +2288 2029 4.16666666666667e+00 +2288 2287 -8.33333333333333e+00 +2288 2293 8.33333333333333e+00 +2288 2028 -2.08333333333333e+00 +2288 1920 2.08333333333333e+00 +2288 1303 2.08333333333333e+00 +2288 1387 -2.08333333333333e+00 +2288 1386 4.16666666666667e+00 +2288 1573 -4.16666666666667e+00 +2288 1399 4.16666666666667e+00 +2288 1398 -8.33333333333333e+00 +2288 1388 -6.25000000000000e+00 +2288 1302 2.08333333333333e+00 +2288 1572 -4.16666666666667e+00 +2289 2289 6.25000000000000e+01 +2289 2353 -2.08333333333333e+00 +2289 2356 4.16666666666667e+00 +2289 2354 4.16666666666667e+00 +2289 2352 -6.25000000000000e+00 +2289 2282 4.16666666666667e+00 +2289 2290 -8.33333333333333e+00 +2289 2281 4.16666666666667e+00 +2289 2280 -1.87500000000000e+01 +2289 2291 -8.33333333333333e+00 +2289 2294 -4.16666666666667e+00 +2289 2293 8.33333333333333e+00 +2289 2030 4.16666666666667e+00 +2289 1922 -4.16666666666667e+00 +2289 2029 -2.08333333333333e+00 +2289 1921 2.08333333333333e+00 +2289 2028 -6.25000000000000e+00 +2289 2357 4.16666666666667e+00 +2289 2292 -1.25000000000000e+01 +2289 1610 -4.16666666666667e+00 +2289 1393 4.16666666666667e+00 +2289 1400 4.16666666666667e+00 +2289 1399 -8.33333333333333e+00 +2289 1394 4.16666666666667e+00 +2289 1310 -4.16666666666667e+00 +2289 1309 2.08333333333333e+00 +2289 1609 -4.16666666666667e+00 +2289 1392 -1.87500000000000e+01 +2290 2290 6.25000000000000e+01 +2290 2357 -8.33333333333333e+00 +2290 2352 -2.08333333333333e+00 +2290 2355 4.16666666666667e+00 +2290 2353 -6.25000000000000e+00 +2290 1922 2.08333333333333e+00 +2290 2282 -2.08333333333333e+00 +2290 2281 -6.25000000000000e+00 +2290 2289 -8.33333333333333e+00 +2290 2280 4.16666666666667e+00 +2290 2292 8.33333333333333e+00 +2290 2030 4.16666666666667e+00 +2290 2291 -8.33333333333333e+00 +2290 2294 8.33333333333333e+00 +2290 2029 -6.25000000000000e+00 +2290 2354 4.16666666666667e+00 +2290 2293 -3.75000000000000e+01 +2290 2028 -2.08333333333333e+00 +2290 1920 2.08333333333333e+00 +2290 1310 2.08333333333333e+00 +2290 1610 -4.16666666666667e+00 +2290 1394 -2.08333333333333e+00 +2290 1400 4.16666666666667e+00 +2290 1392 4.16666666666667e+00 +2290 1398 -8.33333333333333e+00 +2290 1393 -6.25000000000000e+00 +2290 1308 2.08333333333333e+00 +2290 1608 -4.16666666666667e+00 +2291 2291 6.25000000000000e+01 +2291 2353 4.16666666666667e+00 +2291 2356 -8.33333333333333e+00 +2291 2354 -1.87500000000000e+01 +2291 2352 4.16666666666667e+00 +2291 2282 -6.25000000000000e+00 +2291 1921 2.08333333333333e+00 +2291 2281 -2.08333333333333e+00 +2291 2280 4.16666666666667e+00 +2291 2289 -8.33333333333333e+00 +2291 2292 -4.16666666666667e+00 +2291 2030 -1.87500000000000e+01 +2291 2355 4.16666666666667e+00 +2291 2294 -1.25000000000000e+01 +2291 2029 4.16666666666667e+00 +2291 2290 -8.33333333333333e+00 +2291 2293 8.33333333333333e+00 +2291 2028 4.16666666666667e+00 +2291 1920 -4.16666666666667e+00 +2291 1309 2.08333333333333e+00 +2291 1609 -4.16666666666667e+00 +2291 1608 -4.16666666666667e+00 +2291 1393 -2.08333333333333e+00 +2291 1399 4.16666666666667e+00 +2291 1398 4.16666666666667e+00 +2291 1394 -6.25000000000000e+00 +2291 1392 4.16666666666667e+00 +2291 1308 -4.16666666666667e+00 +2292 2292 1.25000000000000e+02 +2292 2321 -4.16666666666667e+00 +2292 2279 -8.33333333333333e+00 +2292 2320 8.33333333333333e+00 +2292 2319 -1.25000000000000e+01 +2292 2287 -4.16666666666667e+00 +2292 2288 8.33333333333333e+00 +2292 2286 -1.25000000000000e+01 +2292 2386 4.16666666666667e+00 +2292 2356 -4.16666666666667e+00 +2292 2294 -1.66666666666667e+01 +2292 2285 8.33333333333333e+00 +2292 2357 8.33333333333333e+00 +2292 1922 -4.16666666666667e+00 +2292 2282 4.16666666666667e+00 +2292 2284 8.33333333333333e+00 +2292 2281 -8.33333333333333e+00 +2292 2283 -3.75000000000000e+01 +2292 2387 4.16666666666667e+00 +2292 2355 -1.25000000000000e+01 +2292 2030 4.16666666666667e+00 +2292 2291 -4.16666666666667e+00 +2292 2293 -1.66666666666667e+01 +2292 2290 8.33333333333333e+00 +2292 2029 4.16666666666667e+00 +2292 1921 -4.16666666666667e+00 +2292 2289 -1.25000000000000e+01 +2292 2278 4.16666666666667e+00 +2292 1574 4.16666666666667e+00 +2292 1573 -8.33333333333333e+00 +2292 1316 -4.16666666666667e+00 +2292 1399 8.33333333333333e+00 +2292 1400 8.33333333333333e+00 +2292 1610 -8.33333333333333e+00 +2292 1609 4.16666666666667e+00 +2292 1315 -4.16666666666667e+00 +2292 1398 -3.75000000000000e+01 +2293 2293 1.25000000000000e+02 +2293 2321 8.33333333333333e+00 +2293 2279 4.16666666666667e+00 +2293 2320 -3.75000000000000e+01 +2293 2319 8.33333333333333e+00 +2293 2286 -4.16666666666667e+00 +2293 2288 8.33333333333333e+00 +2293 2287 -1.25000000000000e+01 +2293 2294 -1.66666666666667e+01 +2293 1922 -4.16666666666667e+00 +2293 2385 4.16666666666667e+00 +2293 2355 -4.16666666666667e+00 +2293 2285 -4.16666666666667e+00 +2293 2282 4.16666666666667e+00 +2293 2284 -1.25000000000000e+01 +2293 2283 8.33333333333333e+00 +2293 2280 -8.33333333333333e+00 +2293 2387 -8.33333333333333e+00 +2293 2357 8.33333333333333e+00 +2293 2356 -1.25000000000000e+01 +2293 2292 -1.66666666666667e+01 +2293 2289 8.33333333333333e+00 +2293 2030 -8.33333333333333e+00 +2293 2291 8.33333333333333e+00 +2293 2290 -3.75000000000000e+01 +2293 2277 4.16666666666667e+00 +2293 2028 4.16666666666667e+00 +2293 1920 -4.16666666666667e+00 +2293 1574 4.16666666666667e+00 +2293 1572 -8.33333333333333e+00 +2293 1316 -4.16666666666667e+00 +2293 1400 -4.16666666666667e+00 +2293 1610 4.16666666666667e+00 +2293 1398 8.33333333333333e+00 +2293 1399 -1.25000000000000e+01 +2293 1608 4.16666666666667e+00 +2293 1314 -4.16666666666667e+00 +2294 2294 1.25000000000000e+02 +2294 2319 -4.16666666666667e+00 +2294 2278 4.16666666666667e+00 +2294 2277 -8.33333333333333e+00 +2294 2321 -1.25000000000000e+01 +2294 2286 8.33333333333333e+00 +2294 2288 -3.75000000000000e+01 +2294 2287 8.33333333333333e+00 +2294 2293 -1.66666666666667e+01 +2294 1921 -4.16666666666667e+00 +2294 2284 -4.16666666666667e+00 +2294 2281 4.16666666666667e+00 +2294 2292 -1.66666666666667e+01 +2294 2283 8.33333333333333e+00 +2294 2355 8.33333333333333e+00 +2294 2285 -1.25000000000000e+01 +2294 1920 -4.16666666666667e+00 +2294 2280 4.16666666666667e+00 +2294 2357 -3.75000000000000e+01 +2294 2386 -8.33333333333333e+00 +2294 2356 8.33333333333333e+00 +2294 2385 4.16666666666667e+00 +2294 2028 4.16666666666667e+00 +2294 2289 -4.16666666666667e+00 +2294 2291 -1.25000000000000e+01 +2294 2320 8.33333333333333e+00 +2294 2029 -8.33333333333333e+00 +2294 2290 8.33333333333333e+00 +2294 1573 4.16666666666667e+00 +2294 1572 4.16666666666667e+00 +2294 1315 -4.16666666666667e+00 +2294 1314 -4.16666666666667e+00 +2294 1399 -4.16666666666667e+00 +2294 1609 4.16666666666667e+00 +2294 1400 -1.25000000000000e+01 +2294 1398 8.33333333333333e+00 +2294 1608 -8.33333333333333e+00 +2295 2295 6.25000000000000e+01 +2295 2326 -4.16666666666667e+00 +2295 2306 -2.08333333333333e+00 +2295 2312 4.16666666666667e+00 +2295 2305 4.16666666666667e+00 +2295 2304 -6.25000000000000e+00 +2295 2324 2.08333333333333e+00 +2295 2327 -4.16666666666667e+00 +2295 2323 -4.16666666666667e+00 +2295 2012 2.08333333333333e+00 +2295 2015 -2.08333333333333e+00 +2295 2314 4.16666666666667e+00 +2295 2302 -4.16666666666667e+00 +2295 1928 4.16666666666667e+00 +2295 2315 -8.33333333333333e+00 +2295 1927 4.16666666666667e+00 +2295 2296 -8.33333333333333e+00 +2295 2014 4.16666666666667e+00 +2295 1926 -1.87500000000000e+01 +2295 2013 -6.25000000000000e+00 +2295 2297 -8.33333333333333e+00 +2295 1925 4.16666666666667e+00 +2295 2303 8.33333333333333e+00 +2295 1924 4.16666666666667e+00 +2295 2011 -4.16666666666667e+00 +2295 2311 4.16666666666667e+00 +2295 1923 -1.87500000000000e+01 +2295 2301 -1.25000000000000e+01 +2296 2296 6.25000000000000e+01 +2296 2327 -4.16666666666667e+00 +2296 2310 4.16666666666667e+00 +2296 2325 -4.16666666666667e+00 +2296 2306 4.16666666666667e+00 +2296 2312 -8.33333333333333e+00 +2296 2305 -1.87500000000000e+01 +2296 2304 4.16666666666667e+00 +2296 2322 -4.16666666666667e+00 +2296 2297 -8.33333333333333e+00 +2296 2015 4.16666666666667e+00 +2296 2303 8.33333333333333e+00 +2296 2313 4.16666666666667e+00 +2296 2301 -4.16666666666667e+00 +2296 1928 -2.08333333333333e+00 +2296 2315 4.16666666666667e+00 +2296 1927 -6.25000000000000e+00 +2296 2014 -1.87500000000000e+01 +2296 1926 4.16666666666667e+00 +2296 2295 -8.33333333333333e+00 +2296 2013 4.16666666666667e+00 +2296 1925 -2.08333333333333e+00 +2296 2012 2.08333333333333e+00 +2296 2324 2.08333333333333e+00 +2296 1924 -6.25000000000000e+00 +2296 2302 -1.25000000000000e+01 +2296 1923 4.16666666666667e+00 +2296 2010 -4.16666666666667e+00 +2297 2297 6.25000000000000e+01 +2297 2326 -4.16666666666667e+00 +2297 2306 -6.25000000000000e+00 +2297 2305 4.16666666666667e+00 +2297 2311 -8.33333333333333e+00 +2297 2304 -2.08333333333333e+00 +2297 2310 4.16666666666667e+00 +2297 2322 2.08333333333333e+00 +2297 2325 -4.16666666666667e+00 +2297 2010 2.08333333333333e+00 +2297 2013 -2.08333333333333e+00 +2297 2296 -8.33333333333333e+00 +2297 2014 4.16666666666667e+00 +2297 2302 8.33333333333333e+00 +2297 1928 -6.25000000000000e+00 +2297 2015 -6.25000000000000e+00 +2297 1927 -2.08333333333333e+00 +2297 2314 4.16666666666667e+00 +2297 1926 4.16666666666667e+00 +2297 2313 -8.33333333333333e+00 +2297 2323 2.08333333333333e+00 +2297 1925 -6.25000000000000e+00 +2297 2303 -3.75000000000000e+01 +2297 1924 -2.08333333333333e+00 +2297 2011 2.08333333333333e+00 +2297 2295 -8.33333333333333e+00 +2297 1923 4.16666666666667e+00 +2297 2301 8.33333333333333e+00 +2298 2298 1.25000000000000e+02 +2298 2375 -4.16666666666667e+00 +2298 2374 -4.16666666666667e+00 +2298 2311 -8.33333333333333e+00 +2298 2302 8.33333333333333e+00 +2298 2369 -8.33333333333333e+00 +2298 2368 4.16666666666667e+00 +2298 2303 8.33333333333333e+00 +2298 2301 -3.75000000000000e+01 +2298 2309 -4.16666666666667e+00 +2298 2372 4.16666666666667e+00 +2298 2308 8.33333333333333e+00 +2298 2299 -1.66666666666667e+01 +2298 2194 8.33333333333333e+00 +2298 2192 -8.33333333333333e+00 +2298 1925 8.33333333333333e+00 +2298 2191 4.16666666666667e+00 +2298 1924 -4.16666666666667e+00 +2298 2307 -1.25000000000000e+01 +2298 2195 8.33333333333333e+00 +2298 2300 -1.66666666666667e+01 +2298 1937 8.33333333333333e+00 +2298 2371 4.16666666666667e+00 +2298 1936 -4.16666666666667e+00 +2298 2193 -3.75000000000000e+01 +2298 2161 -4.16666666666667e+00 +2298 2011 4.16666666666667e+00 +2298 2012 4.16666666666667e+00 +2298 2162 -4.16666666666667e+00 +2298 1923 -1.25000000000000e+01 +2298 2024 -4.16666666666667e+00 +2298 2168 4.16666666666667e+00 +2298 2023 8.33333333333333e+00 +2298 2167 -8.33333333333333e+00 +2298 2022 -1.25000000000000e+01 +2298 2312 4.16666666666667e+00 +2298 1935 -1.25000000000000e+01 +2299 2299 1.25000000000000e+02 +2299 2312 4.16666666666667e+00 +2299 2310 -8.33333333333333e+00 +2299 2375 -4.16666666666667e+00 +2299 2303 -4.16666666666667e+00 +2299 2369 4.16666666666667e+00 +2299 2301 8.33333333333333e+00 +2299 2367 4.16666666666667e+00 +2299 2302 -1.25000000000000e+01 +2299 2192 4.16666666666667e+00 +2299 2195 -4.16666666666667e+00 +2299 2307 8.33333333333333e+00 +2299 2298 -1.66666666666667e+01 +2299 2193 8.33333333333333e+00 +2299 2309 8.33333333333333e+00 +2299 2308 -3.75000000000000e+01 +2299 2190 4.16666666666667e+00 +2299 1923 -4.16666666666667e+00 +2299 2372 -8.33333333333333e+00 +2299 2194 -1.25000000000000e+01 +2299 2370 4.16666666666667e+00 +2299 1935 -4.16666666666667e+00 +2299 2160 -4.16666666666667e+00 +2299 2010 4.16666666666667e+00 +2299 2162 -4.16666666666667e+00 +2299 2168 4.16666666666667e+00 +2299 2012 -8.33333333333333e+00 +2299 1925 8.33333333333333e+00 +2299 1924 -1.25000000000000e+01 +2299 2024 8.33333333333333e+00 +2299 2300 -1.66666666666667e+01 +2299 1937 8.33333333333333e+00 +2299 2023 -3.75000000000000e+01 +2299 2373 -4.16666666666667e+00 +2299 1936 -1.25000000000000e+01 +2299 2022 8.33333333333333e+00 +2299 2166 -8.33333333333333e+00 +2300 2300 1.25000000000000e+02 +2300 2373 -4.16666666666667e+00 +2300 2311 4.16666666666667e+00 +2300 2374 -4.16666666666667e+00 +2300 2302 -4.16666666666667e+00 +2300 2368 4.16666666666667e+00 +2300 2367 -8.33333333333333e+00 +2300 2303 -1.25000000000000e+01 +2300 2301 8.33333333333333e+00 +2300 2191 4.16666666666667e+00 +2300 2194 -4.16666666666667e+00 +2300 2307 -4.16666666666667e+00 +2300 2370 4.16666666666667e+00 +2300 2309 -1.25000000000000e+01 +2300 2308 8.33333333333333e+00 +2300 2190 -8.33333333333333e+00 +2300 1923 8.33333333333333e+00 +2300 2195 -1.25000000000000e+01 +2300 2371 -8.33333333333333e+00 +2300 2193 8.33333333333333e+00 +2300 2298 -1.66666666666667e+01 +2300 1935 8.33333333333333e+00 +2300 2161 -4.16666666666667e+00 +2300 2167 4.16666666666667e+00 +2300 1925 -3.75000000000000e+01 +2300 2011 -8.33333333333333e+00 +2300 1924 8.33333333333333e+00 +2300 2010 4.16666666666667e+00 +2300 2160 -4.16666666666667e+00 +2300 2024 -1.25000000000000e+01 +2300 2310 4.16666666666667e+00 +2300 1937 -3.75000000000000e+01 +2300 2023 8.33333333333333e+00 +2300 2299 -1.66666666666667e+01 +2300 1936 8.33333333333333e+00 +2300 2022 -4.16666666666667e+00 +2300 2166 4.16666666666667e+00 +2301 2301 1.25000000000000e+02 +2301 2326 -8.33333333333333e+00 +2301 2296 -4.16666666666667e+00 +2301 2014 4.16666666666667e+00 +2301 2015 4.16666666666667e+00 +2301 2297 8.33333333333333e+00 +2301 2295 -1.25000000000000e+01 +2301 2315 8.33333333333333e+00 +2301 2314 8.33333333333333e+00 +2301 2313 -3.75000000000000e+01 +2301 2390 -4.16666666666667e+00 +2301 2389 -4.16666666666667e+00 +2301 2312 -4.16666666666667e+00 +2301 2375 4.16666666666667e+00 +2301 2374 4.16666666666667e+00 +2301 2311 8.33333333333333e+00 +2301 2302 -1.66666666666667e+01 +2301 2310 -1.25000000000000e+01 +2301 2027 -4.16666666666667e+00 +2301 2303 -1.66666666666667e+01 +2301 2012 -4.16666666666667e+00 +2301 2024 4.16666666666667e+00 +2301 2299 8.33333333333333e+00 +2301 2026 8.33333333333333e+00 +2301 2023 -8.33333333333333e+00 +2301 2300 8.33333333333333e+00 +2301 1925 -8.33333333333333e+00 +2301 1924 4.16666666666667e+00 +2301 2011 -4.16666666666667e+00 +2301 2298 -3.75000000000000e+01 +2301 2369 8.33333333333333e+00 +2301 1940 -8.33333333333333e+00 +2301 2368 -4.16666666666667e+00 +2301 1939 4.16666666666667e+00 +2301 2367 -1.25000000000000e+01 +2301 2327 4.16666666666667e+00 +2301 2025 -1.25000000000000e+01 +2302 2302 1.25000000000000e+02 +2302 2325 -8.33333333333333e+00 +2302 2297 8.33333333333333e+00 +2302 2295 -4.16666666666667e+00 +2302 2013 4.16666666666667e+00 +2302 2015 -8.33333333333333e+00 +2302 2296 -1.25000000000000e+01 +2302 2315 -4.16666666666667e+00 +2302 2314 -1.25000000000000e+01 +2302 2313 8.33333333333333e+00 +2302 2388 -4.16666666666667e+00 +2302 2312 8.33333333333333e+00 +2302 2375 -8.33333333333333e+00 +2302 2373 4.16666666666667e+00 +2302 1925 4.16666666666667e+00 +2302 2311 -3.75000000000000e+01 +2302 2310 8.33333333333333e+00 +2302 2301 -1.66666666666667e+01 +2302 2390 -4.16666666666667e+00 +2302 1940 4.16666666666667e+00 +2302 2300 -4.16666666666667e+00 +2302 2298 8.33333333333333e+00 +2302 2012 -4.16666666666667e+00 +2302 2024 4.16666666666667e+00 +2302 2025 8.33333333333333e+00 +2302 2022 -8.33333333333333e+00 +2302 2299 -1.25000000000000e+01 +2302 1923 4.16666666666667e+00 +2302 2010 -4.16666666666667e+00 +2302 2369 8.33333333333333e+00 +2302 2303 -1.66666666666667e+01 +2302 2027 8.33333333333333e+00 +2302 2368 -1.25000000000000e+01 +2302 2327 4.16666666666667e+00 +2302 2026 -3.75000000000000e+01 +2302 2367 -4.16666666666667e+00 +2302 1938 4.16666666666667e+00 +2303 2303 1.25000000000000e+02 +2303 2326 4.16666666666667e+00 +2303 2296 8.33333333333333e+00 +2303 2014 -8.33333333333333e+00 +2303 2013 4.16666666666667e+00 +2303 2297 -3.75000000000000e+01 +2303 2295 8.33333333333333e+00 +2303 2315 -1.25000000000000e+01 +2303 2314 -4.16666666666667e+00 +2303 2313 8.33333333333333e+00 +2303 2388 -4.16666666666667e+00 +2303 2311 8.33333333333333e+00 +2303 2310 -4.16666666666667e+00 +2303 2373 4.16666666666667e+00 +2303 2374 -8.33333333333333e+00 +2303 2312 -1.25000000000000e+01 +2303 1924 4.16666666666667e+00 +2303 2389 -4.16666666666667e+00 +2303 1939 4.16666666666667e+00 +2303 2025 -4.16666666666667e+00 +2303 2299 -4.16666666666667e+00 +2303 2301 -1.66666666666667e+01 +2303 2010 -4.16666666666667e+00 +2303 2022 4.16666666666667e+00 +2303 2011 -4.16666666666667e+00 +2303 2023 4.16666666666667e+00 +2303 2300 -1.25000000000000e+01 +2303 2298 8.33333333333333e+00 +2303 1923 -8.33333333333333e+00 +2303 2369 -3.75000000000000e+01 +2303 2325 4.16666666666667e+00 +2303 2027 -1.25000000000000e+01 +2303 2368 8.33333333333333e+00 +2303 2302 -1.66666666666667e+01 +2303 2026 8.33333333333333e+00 +2303 2367 8.33333333333333e+00 +2303 1938 -8.33333333333333e+00 +2304 2304 6.25000000000000e+01 +2304 2326 4.16666666666667e+00 +2304 2327 -8.33333333333333e+00 +2304 1925 2.08333333333333e+00 +2304 2297 -2.08333333333333e+00 +2304 2296 4.16666666666667e+00 +2304 2295 -6.25000000000000e+00 +2304 1952 2.08333333333333e+00 +2304 2323 4.16666666666667e+00 +2304 2322 -1.87500000000000e+01 +2304 2311 -4.16666666666667e+00 +2304 2054 -2.08333333333333e+00 +2304 2305 -8.33333333333333e+00 +2304 2422 -4.16666666666667e+00 +2304 2059 4.16666666666667e+00 +2304 2423 -4.16666666666667e+00 +2304 2060 4.16666666666667e+00 +2304 1951 -4.16666666666667e+00 +2304 2053 4.16666666666667e+00 +2304 2052 -6.25000000000000e+00 +2304 2306 -8.33333333333333e+00 +2304 2048 4.16666666666667e+00 +2304 2312 8.33333333333333e+00 +2304 2047 4.16666666666667e+00 +2304 1924 -4.16666666666667e+00 +2304 2324 4.16666666666667e+00 +2304 2046 -1.87500000000000e+01 +2304 2310 -1.25000000000000e+01 +2305 2305 6.25000000000000e+01 +2305 2325 4.16666666666667e+00 +2305 2327 4.16666666666667e+00 +2305 2297 4.16666666666667e+00 +2305 2306 -8.33333333333333e+00 +2305 2296 -1.87500000000000e+01 +2305 2295 4.16666666666667e+00 +2305 2323 -6.25000000000000e+00 +2305 2322 4.16666666666667e+00 +2305 2310 -4.16666666666667e+00 +2305 2304 -8.33333333333333e+00 +2305 2054 4.16666666666667e+00 +2305 2421 -4.16666666666667e+00 +2305 2058 4.16666666666667e+00 +2305 2312 8.33333333333333e+00 +2305 2060 -8.33333333333333e+00 +2305 1952 2.08333333333333e+00 +2305 2423 -4.16666666666667e+00 +2305 2053 -1.87500000000000e+01 +2305 1950 -4.16666666666667e+00 +2305 2052 4.16666666666667e+00 +2305 2048 -2.08333333333333e+00 +2305 1925 2.08333333333333e+00 +2305 2324 -2.08333333333333e+00 +2305 2047 -6.25000000000000e+00 +2305 2311 -1.25000000000000e+01 +2305 2046 4.16666666666667e+00 +2305 1923 -4.16666666666667e+00 +2306 2306 6.25000000000000e+01 +2306 2322 4.16666666666667e+00 +2306 2326 4.16666666666667e+00 +2306 2325 -8.33333333333333e+00 +2306 2297 -6.25000000000000e+00 +2306 2296 4.16666666666667e+00 +2306 2305 -8.33333333333333e+00 +2306 1923 2.08333333333333e+00 +2306 2295 -2.08333333333333e+00 +2306 2324 -6.25000000000000e+00 +2306 1950 2.08333333333333e+00 +2306 2052 -2.08333333333333e+00 +2306 2053 4.16666666666667e+00 +2306 2311 8.33333333333333e+00 +2306 2059 -8.33333333333333e+00 +2306 2421 -4.16666666666667e+00 +2306 2058 4.16666666666667e+00 +2306 2054 -6.25000000000000e+00 +2306 1951 2.08333333333333e+00 +2306 2422 -4.16666666666667e+00 +2306 2323 -2.08333333333333e+00 +2306 2048 -6.25000000000000e+00 +2306 2312 -3.75000000000000e+01 +2306 2047 -2.08333333333333e+00 +2306 1924 2.08333333333333e+00 +2306 2304 -8.33333333333333e+00 +2306 2046 4.16666666666667e+00 +2306 2310 8.33333333333333e+00 +2307 2307 1.25000000000000e+02 +2307 2374 4.16666666666667e+00 +2307 2429 -4.16666666666667e+00 +2307 2060 4.16666666666667e+00 +2307 2059 -8.33333333333333e+00 +2307 2311 8.33333333333333e+00 +2307 2428 -4.16666666666667e+00 +2307 2312 8.33333333333333e+00 +2307 2310 -3.75000000000000e+01 +2307 2300 -4.16666666666667e+00 +2307 2195 4.16666666666667e+00 +2307 2299 8.33333333333333e+00 +2307 2194 -8.33333333333333e+00 +2307 1924 4.16666666666667e+00 +2307 2298 -1.25000000000000e+01 +2307 2309 -1.66666666666667e+01 +2307 2372 8.33333333333333e+00 +2307 1954 4.16666666666667e+00 +2307 2371 -4.16666666666667e+00 +2307 2370 -1.25000000000000e+01 +2307 2191 -4.16666666666667e+00 +2307 2048 8.33333333333333e+00 +2307 2044 4.16666666666667e+00 +2307 2047 -4.16666666666667e+00 +2307 2045 -8.33333333333333e+00 +2307 2204 8.33333333333333e+00 +2307 1925 4.16666666666667e+00 +2307 2192 -4.16666666666667e+00 +2307 2046 -1.25000000000000e+01 +2307 2057 -4.16666666666667e+00 +2307 1955 4.16666666666667e+00 +2307 2308 -1.66666666666667e+01 +2307 2056 8.33333333333333e+00 +2307 2203 8.33333333333333e+00 +2307 2375 -8.33333333333333e+00 +2307 2055 -1.25000000000000e+01 +2307 2202 -3.75000000000000e+01 +2308 2308 1.25000000000000e+02 +2308 2373 4.16666666666667e+00 +2308 2429 -4.16666666666667e+00 +2308 2060 4.16666666666667e+00 +2308 2312 -4.16666666666667e+00 +2308 2058 -8.33333333333333e+00 +2308 2310 8.33333333333333e+00 +2308 2427 -4.16666666666667e+00 +2308 2311 -1.25000000000000e+01 +2308 2195 4.16666666666667e+00 +2308 2298 8.33333333333333e+00 +2308 2193 -8.33333333333333e+00 +2308 2300 8.33333333333333e+00 +2308 2299 -3.75000000000000e+01 +2308 1923 4.16666666666667e+00 +2308 2372 8.33333333333333e+00 +2308 2371 -1.25000000000000e+01 +2308 1953 4.16666666666667e+00 +2308 2370 -4.16666666666667e+00 +2308 2190 -4.16666666666667e+00 +2308 2192 -4.16666666666667e+00 +2308 2309 -1.66666666666667e+01 +2308 2043 4.16666666666667e+00 +2308 2046 -4.16666666666667e+00 +2308 2045 4.16666666666667e+00 +2308 2204 -4.16666666666667e+00 +2308 1925 -8.33333333333333e+00 +2308 2048 8.33333333333333e+00 +2308 2047 -1.25000000000000e+01 +2308 2057 8.33333333333333e+00 +2308 1955 -8.33333333333333e+00 +2308 2375 4.16666666666667e+00 +2308 2056 -3.75000000000000e+01 +2308 2203 -1.25000000000000e+01 +2308 2307 -1.66666666666667e+01 +2308 2055 8.33333333333333e+00 +2308 2202 8.33333333333333e+00 +2309 2309 1.25000000000000e+02 +2309 2373 -8.33333333333333e+00 +2309 2427 -4.16666666666667e+00 +2309 2428 -4.16666666666667e+00 +2309 2058 4.16666666666667e+00 +2309 2059 4.16666666666667e+00 +2309 2311 -4.16666666666667e+00 +2309 2312 -1.25000000000000e+01 +2309 2310 8.33333333333333e+00 +2309 2194 4.16666666666667e+00 +2309 2298 -4.16666666666667e+00 +2309 2193 4.16666666666667e+00 +2309 2300 -1.25000000000000e+01 +2309 2299 8.33333333333333e+00 +2309 2372 -3.75000000000000e+01 +2309 2371 8.33333333333333e+00 +2309 2307 -1.66666666666667e+01 +2309 2370 8.33333333333333e+00 +2309 2191 -4.16666666666667e+00 +2309 2308 -1.66666666666667e+01 +2309 2046 8.33333333333333e+00 +2309 2044 4.16666666666667e+00 +2309 2203 -4.16666666666667e+00 +2309 2043 -8.33333333333333e+00 +2309 2202 8.33333333333333e+00 +2309 2048 -3.75000000000000e+01 +2309 1924 -8.33333333333333e+00 +2309 2047 8.33333333333333e+00 +2309 1923 4.16666666666667e+00 +2309 2190 -4.16666666666667e+00 +2309 2374 4.16666666666667e+00 +2309 2057 -1.25000000000000e+01 +2309 2204 -1.25000000000000e+01 +2309 2056 8.33333333333333e+00 +2309 1954 -8.33333333333333e+00 +2309 2055 -4.16666666666667e+00 +2309 1953 4.16666666666667e+00 +2310 2310 1.25000000000000e+02 +2310 2327 8.33333333333333e+00 +2310 2297 4.16666666666667e+00 +2310 2326 8.33333333333333e+00 +2310 2325 -3.75000000000000e+01 +2310 2305 -4.16666666666667e+00 +2310 2423 4.16666666666667e+00 +2310 2306 8.33333333333333e+00 +2310 2304 -1.25000000000000e+01 +2310 2422 -8.33333333333333e+00 +2310 2312 -1.66666666666667e+01 +2310 1958 -4.16666666666667e+00 +2310 1925 -4.16666666666667e+00 +2310 2389 4.16666666666667e+00 +2310 2374 -4.16666666666667e+00 +2310 2303 -4.16666666666667e+00 +2310 2300 4.16666666666667e+00 +2310 2390 -8.33333333333333e+00 +2310 2375 8.33333333333333e+00 +2310 2373 -1.25000000000000e+01 +2310 2302 8.33333333333333e+00 +2310 2299 -8.33333333333333e+00 +2310 2301 -1.25000000000000e+01 +2310 2060 -4.16666666666667e+00 +2310 2429 4.16666666666667e+00 +2310 2059 8.33333333333333e+00 +2310 2311 -1.66666666666667e+01 +2310 2308 8.33333333333333e+00 +2310 2428 4.16666666666667e+00 +2310 1957 -4.16666666666667e+00 +2310 2058 -1.25000000000000e+01 +2310 2309 8.33333333333333e+00 +2310 2048 -8.33333333333333e+00 +2310 2047 4.16666666666667e+00 +2310 1924 -4.16666666666667e+00 +2310 2307 -3.75000000000000e+01 +2310 2296 4.16666666666667e+00 +2311 2311 1.25000000000000e+02 +2311 2327 -4.16666666666667e+00 +2311 2297 -8.33333333333333e+00 +2311 2326 -1.25000000000000e+01 +2311 2325 8.33333333333333e+00 +2311 2304 -4.16666666666667e+00 +2311 2306 8.33333333333333e+00 +2311 2305 -1.25000000000000e+01 +2311 2423 4.16666666666667e+00 +2311 2421 -8.33333333333333e+00 +2311 2388 4.16666666666667e+00 +2311 2373 -4.16666666666667e+00 +2311 2303 8.33333333333333e+00 +2311 2312 -1.66666666666667e+01 +2311 2375 8.33333333333333e+00 +2311 1958 -4.16666666666667e+00 +2311 2390 4.16666666666667e+00 +2311 2374 -1.25000000000000e+01 +2311 1925 -4.16666666666667e+00 +2311 2300 4.16666666666667e+00 +2311 2302 -3.75000000000000e+01 +2311 2301 8.33333333333333e+00 +2311 2298 -8.33333333333333e+00 +2311 2048 4.16666666666667e+00 +2311 2309 -4.16666666666667e+00 +2311 2058 8.33333333333333e+00 +2311 2310 -1.66666666666667e+01 +2311 2307 8.33333333333333e+00 +2311 2429 -8.33333333333333e+00 +2311 2060 8.33333333333333e+00 +2311 2059 -3.75000000000000e+01 +2311 2427 4.16666666666667e+00 +2311 1956 -4.16666666666667e+00 +2311 2308 -1.25000000000000e+01 +2311 2295 4.16666666666667e+00 +2311 2046 4.16666666666667e+00 +2311 1923 -4.16666666666667e+00 +2312 2312 1.25000000000000e+02 +2312 2325 8.33333333333333e+00 +2312 2296 -8.33333333333333e+00 +2312 2295 4.16666666666667e+00 +2312 2327 -1.25000000000000e+01 +2312 2305 8.33333333333333e+00 +2312 2421 4.16666666666667e+00 +2312 2306 -3.75000000000000e+01 +2312 2304 8.33333333333333e+00 +2312 2422 4.16666666666667e+00 +2312 2310 -1.66666666666667e+01 +2312 1956 -4.16666666666667e+00 +2312 1923 -4.16666666666667e+00 +2312 2302 8.33333333333333e+00 +2312 2311 -1.66666666666667e+01 +2312 2374 8.33333333333333e+00 +2312 2301 -4.16666666666667e+00 +2312 2298 4.16666666666667e+00 +2312 2375 -3.75000000000000e+01 +2312 1957 -4.16666666666667e+00 +2312 2389 4.16666666666667e+00 +2312 2388 -8.33333333333333e+00 +2312 2373 8.33333333333333e+00 +2312 2303 -1.25000000000000e+01 +2312 1924 -4.16666666666667e+00 +2312 2299 4.16666666666667e+00 +2312 2058 -4.16666666666667e+00 +2312 2427 4.16666666666667e+00 +2312 2047 4.16666666666667e+00 +2312 2308 -4.16666666666667e+00 +2312 2060 -1.25000000000000e+01 +2312 2428 -8.33333333333333e+00 +2312 2059 8.33333333333333e+00 +2312 2309 -1.25000000000000e+01 +2312 2326 -4.16666666666667e+00 +2312 2307 8.33333333333333e+00 +2312 2046 -8.33333333333333e+00 +2313 2313 1.25000000000000e+02 +2313 2327 -4.16666666666667e+00 +2313 2326 8.33333333333333e+00 +2313 2325 -1.25000000000000e+01 +2313 2390 4.16666666666667e+00 +2313 2296 4.16666666666667e+00 +2313 2297 -8.33333333333333e+00 +2313 2303 8.33333333333333e+00 +2313 2302 8.33333333333333e+00 +2313 2301 -3.75000000000000e+01 +2313 2314 -1.66666666666667e+01 +2313 1927 -4.16666666666667e+00 +2313 1939 -4.16666666666667e+00 +2313 2392 -4.16666666666667e+00 +2313 2386 4.16666666666667e+00 +2313 2393 -4.16666666666667e+00 +2313 2330 4.16666666666667e+00 +2313 1928 8.33333333333333e+00 +2313 2315 -1.66666666666667e+01 +2313 2321 8.33333333333333e+00 +2313 2329 -8.33333333333333e+00 +2313 2320 8.33333333333333e+00 +2313 2319 -3.75000000000000e+01 +2313 1940 8.33333333333333e+00 +2313 2387 -8.33333333333333e+00 +2313 2014 -4.16666666666667e+00 +2313 2278 4.16666666666667e+00 +2313 2279 4.16666666666667e+00 +2313 2015 -4.16666666666667e+00 +2313 1926 -1.25000000000000e+01 +2313 2285 -4.16666666666667e+00 +2313 2027 4.16666666666667e+00 +2313 2284 8.33333333333333e+00 +2313 2026 -8.33333333333333e+00 +2313 2283 -1.25000000000000e+01 +2313 2389 4.16666666666667e+00 +2313 1938 -1.25000000000000e+01 +2314 2314 1.25000000000000e+02 +2314 2327 8.33333333333333e+00 +2314 2326 -3.75000000000000e+01 +2314 2325 8.33333333333333e+00 +2314 2390 -8.33333333333333e+00 +2314 2295 4.16666666666667e+00 +2314 2297 4.16666666666667e+00 +2314 2303 -4.16666666666667e+00 +2314 2302 -1.25000000000000e+01 +2314 2301 8.33333333333333e+00 +2314 2313 -1.66666666666667e+01 +2314 1926 -4.16666666666667e+00 +2314 1938 -4.16666666666667e+00 +2314 2391 -4.16666666666667e+00 +2314 2385 4.16666666666667e+00 +2314 2330 4.16666666666667e+00 +2314 2321 -4.16666666666667e+00 +2314 2320 -1.25000000000000e+01 +2314 2328 -8.33333333333333e+00 +2314 2319 8.33333333333333e+00 +2314 2393 -4.16666666666667e+00 +2314 2387 4.16666666666667e+00 +2314 2013 -4.16666666666667e+00 +2314 2277 4.16666666666667e+00 +2314 2015 -4.16666666666667e+00 +2314 2027 4.16666666666667e+00 +2314 2279 -8.33333333333333e+00 +2314 1928 8.33333333333333e+00 +2314 1927 -1.25000000000000e+01 +2314 2285 8.33333333333333e+00 +2314 2315 -1.66666666666667e+01 +2314 1940 8.33333333333333e+00 +2314 2284 -3.75000000000000e+01 +2314 2388 4.16666666666667e+00 +2314 1939 -1.25000000000000e+01 +2314 2283 8.33333333333333e+00 +2314 2025 -8.33333333333333e+00 +2315 2315 1.25000000000000e+02 +2315 2326 8.33333333333333e+00 +2315 2325 -4.16666666666667e+00 +2315 2389 -8.33333333333333e+00 +2315 2388 4.16666666666667e+00 +2315 2296 4.16666666666667e+00 +2315 2295 -8.33333333333333e+00 +2315 2303 -1.25000000000000e+01 +2315 2302 -4.16666666666667e+00 +2315 2301 8.33333333333333e+00 +2315 2391 -4.16666666666667e+00 +2315 2328 4.16666666666667e+00 +2315 2321 -1.25000000000000e+01 +2315 2329 4.16666666666667e+00 +2315 2320 -4.16666666666667e+00 +2315 1926 8.33333333333333e+00 +2315 2313 -1.66666666666667e+01 +2315 2319 8.33333333333333e+00 +2315 2392 -4.16666666666667e+00 +2315 2386 4.16666666666667e+00 +2315 1938 8.33333333333333e+00 +2315 2385 -8.33333333333333e+00 +2315 2014 -4.16666666666667e+00 +2315 2026 4.16666666666667e+00 +2315 1928 -3.75000000000000e+01 +2315 2278 -8.33333333333333e+00 +2315 1927 8.33333333333333e+00 +2315 2277 4.16666666666667e+00 +2315 2013 -4.16666666666667e+00 +2315 2285 -1.25000000000000e+01 +2315 2327 -1.25000000000000e+01 +2315 1940 -3.75000000000000e+01 +2315 2284 8.33333333333333e+00 +2315 2314 -1.66666666666667e+01 +2315 1939 8.33333333333333e+00 +2315 2283 -4.16666666666667e+00 +2315 2025 4.16666666666667e+00 +2316 2316 6.25000000000000e+01 +2316 2279 2.08333333333333e+00 +2316 2278 -4.16666666666667e+00 +2316 2287 4.16666666666667e+00 +2316 2286 -6.25000000000000e+00 +2316 1928 4.16666666666667e+00 +2316 2318 -8.33333333333333e+00 +2316 2321 8.33333333333333e+00 +2316 2320 -4.16666666666667e+00 +2316 2319 -1.25000000000000e+01 +2316 2329 4.16666666666667e+00 +2316 2063 -2.08333333333333e+00 +2316 2330 4.16666666666667e+00 +2316 2317 -8.33333333333333e+00 +2316 2062 4.16666666666667e+00 +2316 1927 4.16666666666667e+00 +2316 2288 -2.08333333333333e+00 +2316 2061 -6.25000000000000e+00 +2316 1926 -1.87500000000000e+01 +2316 1304 4.16666666666667e+00 +2316 1574 -8.33333333333333e+00 +2316 1573 4.16666666666667e+00 +2316 1582 -4.16666666666667e+00 +2316 1433 2.08333333333333e+00 +2316 1583 -4.16666666666667e+00 +2316 1303 4.16666666666667e+00 +2316 1432 -4.16666666666667e+00 +2316 1302 -1.87500000000000e+01 +2317 2317 6.25000000000000e+01 +2317 2318 -8.33333333333333e+00 +2317 1928 -2.08333333333333e+00 +2317 2279 2.08333333333333e+00 +2317 2277 -4.16666666666667e+00 +2317 2287 -1.87500000000000e+01 +2317 2286 4.16666666666667e+00 +2317 2321 8.33333333333333e+00 +2317 2320 -1.25000000000000e+01 +2317 2319 -4.16666666666667e+00 +2317 2328 4.16666666666667e+00 +2317 2063 4.16666666666667e+00 +2317 2330 -8.33333333333333e+00 +2317 2288 4.16666666666667e+00 +2317 2062 -1.87500000000000e+01 +2317 1927 -6.25000000000000e+00 +2317 2316 -8.33333333333333e+00 +2317 2061 4.16666666666667e+00 +2317 1926 4.16666666666667e+00 +2317 1304 -2.08333333333333e+00 +2317 1574 4.16666666666667e+00 +2317 1572 4.16666666666667e+00 +2317 1581 -4.16666666666667e+00 +2317 1433 2.08333333333333e+00 +2317 1583 -4.16666666666667e+00 +2317 1303 -6.25000000000000e+00 +2317 1302 4.16666666666667e+00 +2317 1431 -4.16666666666667e+00 +2318 2318 6.25000000000000e+01 +2318 2317 -8.33333333333333e+00 +2318 2286 -2.08333333333333e+00 +2318 2277 2.08333333333333e+00 +2318 1927 -2.08333333333333e+00 +2318 2278 2.08333333333333e+00 +2318 2288 -6.25000000000000e+00 +2318 2321 -3.75000000000000e+01 +2318 2320 8.33333333333333e+00 +2318 1926 4.16666666666667e+00 +2318 2316 -8.33333333333333e+00 +2318 2319 8.33333333333333e+00 +2318 2287 4.16666666666667e+00 +2318 2063 -6.25000000000000e+00 +2318 1928 -6.25000000000000e+00 +2318 2062 4.16666666666667e+00 +2318 2329 -8.33333333333333e+00 +2318 2061 -2.08333333333333e+00 +2318 2328 4.16666666666667e+00 +2318 1303 -2.08333333333333e+00 +2318 1573 4.16666666666667e+00 +2318 1302 4.16666666666667e+00 +2318 1572 -8.33333333333333e+00 +2318 1432 2.08333333333333e+00 +2318 1582 -4.16666666666667e+00 +2318 1304 -6.25000000000000e+00 +2318 1431 2.08333333333333e+00 +2318 1581 -4.16666666666667e+00 +2319 2319 1.25000000000000e+02 +2319 2284 -8.33333333333333e+00 +2319 2279 -4.16666666666667e+00 +2319 2287 4.16666666666667e+00 +2319 2278 -4.16666666666667e+00 +2319 2288 4.16666666666667e+00 +2319 2294 -4.16666666666667e+00 +2319 2293 8.33333333333333e+00 +2319 2292 -1.25000000000000e+01 +2319 2318 8.33333333333333e+00 +2319 1927 4.16666666666667e+00 +2319 2317 -4.16666666666667e+00 +2319 2316 -1.25000000000000e+01 +2319 2321 -1.66666666666667e+01 +2319 2386 -4.16666666666667e+00 +2319 2330 -4.16666666666667e+00 +2319 2392 4.16666666666667e+00 +2319 2393 4.16666666666667e+00 +2319 1928 -8.33333333333333e+00 +2319 2315 8.33333333333333e+00 +2319 2329 8.33333333333333e+00 +2319 2314 8.33333333333333e+00 +2319 2320 -1.66666666666667e+01 +2319 2328 -1.25000000000000e+01 +2319 2313 -3.75000000000000e+01 +2319 2387 8.33333333333333e+00 +2319 2285 4.16666666666667e+00 +2319 2385 -1.25000000000000e+01 +2319 1583 4.16666666666667e+00 +2319 1582 -8.33333333333333e+00 +2319 1573 8.33333333333333e+00 +2319 1574 8.33333333333333e+00 +2319 1315 4.16666666666667e+00 +2319 1572 -3.75000000000000e+01 +2319 1645 -4.16666666666667e+00 +2319 1646 -4.16666666666667e+00 +2319 1316 -8.33333333333333e+00 +2320 2320 1.25000000000000e+02 +2320 2283 -8.33333333333333e+00 +2320 2286 4.16666666666667e+00 +2320 2277 -4.16666666666667e+00 +2320 2288 -8.33333333333333e+00 +2320 2294 8.33333333333333e+00 +2320 2279 -4.16666666666667e+00 +2320 2293 -3.75000000000000e+01 +2320 2292 8.33333333333333e+00 +2320 2318 8.33333333333333e+00 +2320 2321 -1.66666666666667e+01 +2320 2317 -1.25000000000000e+01 +2320 1926 4.16666666666667e+00 +2320 2316 -4.16666666666667e+00 +2320 2385 -4.16666666666667e+00 +2320 2330 8.33333333333333e+00 +2320 2391 4.16666666666667e+00 +2320 2393 -8.33333333333333e+00 +2320 2387 8.33333333333333e+00 +2320 1928 4.16666666666667e+00 +2320 2315 -4.16666666666667e+00 +2320 2329 -3.75000000000000e+01 +2320 2314 -1.25000000000000e+01 +2320 2328 8.33333333333333e+00 +2320 2313 8.33333333333333e+00 +2320 2319 -1.66666666666667e+01 +2320 2285 4.16666666666667e+00 +2320 2386 -1.25000000000000e+01 +2320 1583 4.16666666666667e+00 +2320 1574 -4.16666666666667e+00 +2320 1581 -8.33333333333333e+00 +2320 1572 8.33333333333333e+00 +2320 1573 -1.25000000000000e+01 +2320 1314 4.16666666666667e+00 +2320 1644 -4.16666666666667e+00 +2320 1646 -4.16666666666667e+00 +2320 1316 4.16666666666667e+00 +2321 2321 1.25000000000000e+02 +2321 2283 4.16666666666667e+00 +2321 2277 -4.16666666666667e+00 +2321 2287 -8.33333333333333e+00 +2321 2293 8.33333333333333e+00 +2321 2286 4.16666666666667e+00 +2321 2292 -4.16666666666667e+00 +2321 2278 -4.16666666666667e+00 +2321 2294 -1.25000000000000e+01 +2321 2318 -3.75000000000000e+01 +2321 2317 8.33333333333333e+00 +2321 2320 -1.66666666666667e+01 +2321 2316 8.33333333333333e+00 +2321 2319 -1.66666666666667e+01 +2321 2328 -4.16666666666667e+00 +2321 2329 8.33333333333333e+00 +2321 2392 -8.33333333333333e+00 +2321 2386 8.33333333333333e+00 +2321 2391 4.16666666666667e+00 +2321 2330 -1.25000000000000e+01 +2321 2315 -1.25000000000000e+01 +2321 1927 4.16666666666667e+00 +2321 2314 -4.16666666666667e+00 +2321 1926 -8.33333333333333e+00 +2321 2313 8.33333333333333e+00 +2321 2284 4.16666666666667e+00 +2321 2387 -3.75000000000000e+01 +2321 2385 8.33333333333333e+00 +2321 1582 4.16666666666667e+00 +2321 1573 -4.16666666666667e+00 +2321 1581 4.16666666666667e+00 +2321 1574 -1.25000000000000e+01 +2321 1572 8.33333333333333e+00 +2321 1644 -4.16666666666667e+00 +2321 1645 -4.16666666666667e+00 +2321 1315 4.16666666666667e+00 +2321 1314 -8.33333333333333e+00 +2322 2322 6.25000000000000e+01 +2322 2306 4.16666666666667e+00 +2322 2297 2.08333333333333e+00 +2322 1928 -2.08333333333333e+00 +2322 2296 -4.16666666666667e+00 +2322 1952 -2.08333333333333e+00 +2322 2305 4.16666666666667e+00 +2322 2304 -1.87500000000000e+01 +2322 2423 4.16666666666667e+00 +2322 2422 4.16666666666667e+00 +2322 2327 8.33333333333333e+00 +2322 2326 -4.16666666666667e+00 +2322 2325 -1.25000000000000e+01 +2322 2329 4.16666666666667e+00 +2322 2425 -4.16666666666667e+00 +2322 2066 2.08333333333333e+00 +2322 2426 -4.16666666666667e+00 +2322 2065 -4.16666666666667e+00 +2322 1951 4.16666666666667e+00 +2322 1950 -6.25000000000000e+00 +2322 2063 4.16666666666667e+00 +2322 2330 -8.33333333333333e+00 +2322 2062 4.16666666666667e+00 +2322 2323 -8.33333333333333e+00 +2322 1927 4.16666666666667e+00 +2322 2061 -1.87500000000000e+01 +2322 2324 -8.33333333333333e+00 +2322 1926 -6.25000000000000e+00 +2323 2323 6.25000000000000e+01 +2323 2297 2.08333333333333e+00 +2323 2295 -4.16666666666667e+00 +2323 2305 -6.25000000000000e+00 +2323 2304 4.16666666666667e+00 +2323 1952 4.16666666666667e+00 +2323 2423 -8.33333333333333e+00 +2323 2421 4.16666666666667e+00 +2323 2324 -8.33333333333333e+00 +2323 1928 4.16666666666667e+00 +2323 2327 8.33333333333333e+00 +2323 2326 -1.25000000000000e+01 +2323 2325 -4.16666666666667e+00 +2323 2328 4.16666666666667e+00 +2323 2424 -4.16666666666667e+00 +2323 2066 2.08333333333333e+00 +2323 2426 -4.16666666666667e+00 +2323 1951 -1.87500000000000e+01 +2323 2064 -4.16666666666667e+00 +2323 1950 4.16666666666667e+00 +2323 2063 -2.08333333333333e+00 +2323 2330 4.16666666666667e+00 +2323 2062 -6.25000000000000e+00 +2323 2306 -2.08333333333333e+00 +2323 1927 -1.87500000000000e+01 +2323 2061 4.16666666666667e+00 +2323 2322 -8.33333333333333e+00 +2323 1926 4.16666666666667e+00 +2324 2324 6.25000000000000e+01 +2324 2296 2.08333333333333e+00 +2324 2322 -8.33333333333333e+00 +2324 2304 4.16666666666667e+00 +2324 2295 2.08333333333333e+00 +2324 1926 -2.08333333333333e+00 +2324 2306 -6.25000000000000e+00 +2324 1950 -2.08333333333333e+00 +2324 2421 4.16666666666667e+00 +2324 1951 4.16666666666667e+00 +2324 2422 -8.33333333333333e+00 +2324 2327 -3.75000000000000e+01 +2324 2323 -8.33333333333333e+00 +2324 1927 4.16666666666667e+00 +2324 2326 8.33333333333333e+00 +2324 2325 8.33333333333333e+00 +2324 2064 2.08333333333333e+00 +2324 2424 -4.16666666666667e+00 +2324 1952 -6.25000000000000e+00 +2324 2065 2.08333333333333e+00 +2324 2425 -4.16666666666667e+00 +2324 2063 -6.25000000000000e+00 +2324 2305 -2.08333333333333e+00 +2324 1928 -6.25000000000000e+00 +2324 2062 -2.08333333333333e+00 +2324 2329 4.16666666666667e+00 +2324 2061 4.16666666666667e+00 +2324 2328 -8.33333333333333e+00 +2325 2325 1.25000000000000e+02 +2325 2302 -8.33333333333333e+00 +2325 2296 -4.16666666666667e+00 +2325 2305 4.16666666666667e+00 +2325 2312 8.33333333333333e+00 +2325 2306 -8.33333333333333e+00 +2325 2297 -4.16666666666667e+00 +2325 2311 8.33333333333333e+00 +2325 2310 -3.75000000000000e+01 +2325 2426 4.16666666666667e+00 +2325 2423 -4.16666666666667e+00 +2325 2422 8.33333333333333e+00 +2325 2425 -8.33333333333333e+00 +2325 2324 8.33333333333333e+00 +2325 2327 -1.66666666666667e+01 +2325 2323 -4.16666666666667e+00 +2325 1927 4.16666666666667e+00 +2325 2322 -1.25000000000000e+01 +2325 1957 4.16666666666667e+00 +2325 2421 -1.25000000000000e+01 +2325 2389 -4.16666666666667e+00 +2325 2330 8.33333333333333e+00 +2325 2392 4.16666666666667e+00 +2325 2434 -4.16666666666667e+00 +2325 2393 -8.33333333333333e+00 +2325 2390 8.33333333333333e+00 +2325 1928 4.16666666666667e+00 +2325 2315 -4.16666666666667e+00 +2325 2329 8.33333333333333e+00 +2325 2314 8.33333333333333e+00 +2325 2326 -1.66666666666667e+01 +2325 2328 -3.75000000000000e+01 +2325 2313 -1.25000000000000e+01 +2325 2435 -4.16666666666667e+00 +2325 1958 4.16666666666667e+00 +2325 2303 4.16666666666667e+00 +2325 2388 -1.25000000000000e+01 +2326 2326 1.25000000000000e+02 +2326 2301 -8.33333333333333e+00 +2326 2297 -4.16666666666667e+00 +2326 2295 -4.16666666666667e+00 +2326 2304 4.16666666666667e+00 +2326 2312 -4.16666666666667e+00 +2326 2306 4.16666666666667e+00 +2326 2311 -1.25000000000000e+01 +2326 2310 8.33333333333333e+00 +2326 2426 4.16666666666667e+00 +2326 2421 8.33333333333333e+00 +2326 2424 -8.33333333333333e+00 +2326 2324 8.33333333333333e+00 +2326 2323 -1.25000000000000e+01 +2326 2322 -4.16666666666667e+00 +2326 1926 4.16666666666667e+00 +2326 2423 8.33333333333333e+00 +2326 2422 -3.75000000000000e+01 +2326 1956 4.16666666666667e+00 +2326 2327 -1.66666666666667e+01 +2326 2388 -4.16666666666667e+00 +2326 2330 -4.16666666666667e+00 +2326 2391 4.16666666666667e+00 +2326 2433 -4.16666666666667e+00 +2326 2435 -4.16666666666667e+00 +2326 2393 4.16666666666667e+00 +2326 1928 -8.33333333333333e+00 +2326 2315 8.33333333333333e+00 +2326 2329 -1.25000000000000e+01 +2326 2314 -3.75000000000000e+01 +2326 2328 8.33333333333333e+00 +2326 2313 8.33333333333333e+00 +2326 2325 -1.66666666666667e+01 +2326 2390 8.33333333333333e+00 +2326 1958 -8.33333333333333e+00 +2326 2303 4.16666666666667e+00 +2326 2389 -1.25000000000000e+01 +2327 2327 1.25000000000000e+02 +2327 2302 4.16666666666667e+00 +2327 2296 -4.16666666666667e+00 +2327 2311 -4.16666666666667e+00 +2327 2305 4.16666666666667e+00 +2327 2310 8.33333333333333e+00 +2327 2304 -8.33333333333333e+00 +2327 2295 -4.16666666666667e+00 +2327 2312 -1.25000000000000e+01 +2327 2424 4.16666666666667e+00 +2327 2421 -4.16666666666667e+00 +2327 2425 4.16666666666667e+00 +2327 2324 -3.75000000000000e+01 +2327 2323 8.33333333333333e+00 +2327 2322 8.33333333333333e+00 +2327 2325 -1.66666666666667e+01 +2327 2423 -1.25000000000000e+01 +2327 2422 8.33333333333333e+00 +2327 2326 -1.66666666666667e+01 +2327 2329 -4.16666666666667e+00 +2327 2328 8.33333333333333e+00 +2327 2434 -4.16666666666667e+00 +2327 2392 4.16666666666667e+00 +2327 2391 -8.33333333333333e+00 +2327 2388 8.33333333333333e+00 +2327 2330 -1.25000000000000e+01 +2327 2315 -1.25000000000000e+01 +2327 1927 -8.33333333333333e+00 +2327 2314 8.33333333333333e+00 +2327 1926 4.16666666666667e+00 +2327 2313 -4.16666666666667e+00 +2327 2301 4.16666666666667e+00 +2327 2390 -3.75000000000000e+01 +2327 2389 8.33333333333333e+00 +2327 1957 -8.33333333333333e+00 +2327 2433 -4.16666666666667e+00 +2327 1956 4.16666666666667e+00 +2328 2328 1.25000000000000e+02 +2328 2434 4.16666666666667e+00 +2328 2435 4.16666666666667e+00 +2328 2326 8.33333333333333e+00 +2328 2325 -3.75000000000000e+01 +2328 2323 4.16666666666667e+00 +2328 2426 -4.16666666666667e+00 +2328 2324 -8.33333333333333e+00 +2328 2425 8.33333333333333e+00 +2328 2424 -1.25000000000000e+01 +2328 2329 -1.66666666666667e+01 +2328 1927 -4.16666666666667e+00 +2328 2315 4.16666666666667e+00 +2328 2321 -4.16666666666667e+00 +2328 2392 -4.16666666666667e+00 +2328 2314 -8.33333333333333e+00 +2328 2320 8.33333333333333e+00 +2328 2319 -1.25000000000000e+01 +2328 2393 8.33333333333333e+00 +2328 2391 -1.25000000000000e+01 +2328 2062 -4.16666666666667e+00 +2328 2317 4.16666666666667e+00 +2328 2063 8.33333333333333e+00 +2328 2330 -1.66666666666667e+01 +2328 2318 4.16666666666667e+00 +2328 1928 -4.16666666666667e+00 +2328 2061 -1.25000000000000e+01 +2328 2327 8.33333333333333e+00 +2328 1345 -4.16666666666667e+00 +2328 1645 4.16666666666667e+00 +2328 1646 -8.33333333333333e+00 +2328 1583 8.33333333333333e+00 +2328 1439 4.16666666666667e+00 +2328 1346 -4.16666666666667e+00 +2328 1582 8.33333333333333e+00 +2328 1438 -8.33333333333333e+00 +2328 1581 -3.75000000000000e+01 +2329 2329 1.25000000000000e+02 +2329 2433 4.16666666666667e+00 +2329 2435 -8.33333333333333e+00 +2329 2326 -1.25000000000000e+01 +2329 2325 8.33333333333333e+00 +2329 2322 4.16666666666667e+00 +2329 2426 8.33333333333333e+00 +2329 2324 4.16666666666667e+00 +2329 2425 -3.75000000000000e+01 +2329 2424 8.33333333333333e+00 +2329 2328 -1.66666666666667e+01 +2329 1926 -4.16666666666667e+00 +2329 2393 8.33333333333333e+00 +2329 2330 -1.66666666666667e+01 +2329 2321 8.33333333333333e+00 +2329 2391 -4.16666666666667e+00 +2329 1928 -4.16666666666667e+00 +2329 2315 4.16666666666667e+00 +2329 2320 -3.75000000000000e+01 +2329 2313 -8.33333333333333e+00 +2329 2319 8.33333333333333e+00 +2329 2392 -1.25000000000000e+01 +2329 2061 -4.16666666666667e+00 +2329 2316 4.16666666666667e+00 +2329 2318 -8.33333333333333e+00 +2329 2063 8.33333333333333e+00 +2329 2062 -1.25000000000000e+01 +2329 2327 -4.16666666666667e+00 +2329 1344 -4.16666666666667e+00 +2329 1644 4.16666666666667e+00 +2329 1346 -4.16666666666667e+00 +2329 1646 4.16666666666667e+00 +2329 1439 4.16666666666667e+00 +2329 1583 -4.16666666666667e+00 +2329 1582 -1.25000000000000e+01 +2329 1581 8.33333333333333e+00 +2329 1437 -8.33333333333333e+00 +2330 2330 1.25000000000000e+02 +2330 2325 8.33333333333333e+00 +2330 2434 -8.33333333333333e+00 +2330 2433 4.16666666666667e+00 +2330 2327 -1.25000000000000e+01 +2330 2425 8.33333333333333e+00 +2330 2424 -4.16666666666667e+00 +2330 2323 4.16666666666667e+00 +2330 2322 -8.33333333333333e+00 +2330 2426 -1.25000000000000e+01 +2330 2313 4.16666666666667e+00 +2330 2319 -4.16666666666667e+00 +2330 2392 8.33333333333333e+00 +2330 2329 -1.66666666666667e+01 +2330 2320 8.33333333333333e+00 +2330 2321 -1.25000000000000e+01 +2330 1927 -4.16666666666667e+00 +2330 2314 4.16666666666667e+00 +2330 2393 -3.75000000000000e+01 +2330 2391 8.33333333333333e+00 +2330 2061 8.33333333333333e+00 +2330 2328 -1.66666666666667e+01 +2330 2063 -3.75000000000000e+01 +2330 2317 -8.33333333333333e+00 +2330 2062 8.33333333333333e+00 +2330 2316 4.16666666666667e+00 +2330 1926 -4.16666666666667e+00 +2330 2326 -4.16666666666667e+00 +2330 1345 -4.16666666666667e+00 +2330 1645 4.16666666666667e+00 +2330 1644 -8.33333333333333e+00 +2330 1438 4.16666666666667e+00 +2330 1582 -4.16666666666667e+00 +2330 1581 8.33333333333333e+00 +2330 1583 -1.25000000000000e+01 +2330 1437 4.16666666666667e+00 +2330 1344 -4.16666666666667e+00 +2331 2331 6.25000000000000e+01 +2331 2363 -4.16666666666667e+00 +2331 2360 -4.16666666666667e+00 +2331 2359 2.08333333333333e+00 +2331 2362 -4.16666666666667e+00 +2331 2342 4.16666666666667e+00 +2331 2341 -2.08333333333333e+00 +2331 2347 4.16666666666667e+00 +2331 2340 -6.25000000000000e+00 +2331 2020 -2.08333333333333e+00 +2331 2017 2.08333333333333e+00 +2331 2351 4.16666666666667e+00 +2331 2339 -4.16666666666667e+00 +2331 1931 4.16666666666667e+00 +2331 2018 -4.16666666666667e+00 +2331 1930 4.16666666666667e+00 +2331 2332 -8.33333333333333e+00 +2331 2338 8.33333333333333e+00 +2331 1929 -1.87500000000000e+01 +2331 2337 -1.25000000000000e+01 +2331 2333 -8.33333333333333e+00 +2331 1934 4.16666666666667e+00 +2331 2021 4.16666666666667e+00 +2331 1933 4.16666666666667e+00 +2331 2350 -8.33333333333333e+00 +2331 2348 4.16666666666667e+00 +2331 1932 -1.87500000000000e+01 +2331 2019 -6.25000000000000e+00 +2332 2332 6.25000000000000e+01 +2332 2363 -4.16666666666667e+00 +2332 2358 2.08333333333333e+00 +2332 2361 -4.16666666666667e+00 +2332 2342 4.16666666666667e+00 +2332 2348 -8.33333333333333e+00 +2332 2341 -6.25000000000000e+00 +2332 2340 -2.08333333333333e+00 +2332 2346 4.16666666666667e+00 +2332 2019 -2.08333333333333e+00 +2332 2016 2.08333333333333e+00 +2332 2021 4.16666666666667e+00 +2332 2333 -8.33333333333333e+00 +2332 2339 8.33333333333333e+00 +2332 1931 -2.08333333333333e+00 +2332 2018 2.08333333333333e+00 +2332 1930 -6.25000000000000e+00 +2332 2338 -3.75000000000000e+01 +2332 1929 4.16666666666667e+00 +2332 2331 -8.33333333333333e+00 +2332 2337 8.33333333333333e+00 +2332 1934 -2.08333333333333e+00 +2332 2351 4.16666666666667e+00 +2332 2360 2.08333333333333e+00 +2332 1933 -6.25000000000000e+00 +2332 2020 -6.25000000000000e+00 +2332 1932 4.16666666666667e+00 +2332 2349 -8.33333333333333e+00 +2333 2333 6.25000000000000e+01 +2333 2362 -4.16666666666667e+00 +2333 2346 4.16666666666667e+00 +2333 2361 -4.16666666666667e+00 +2333 2358 -4.16666666666667e+00 +2333 2342 -1.87500000000000e+01 +2333 2341 4.16666666666667e+00 +2333 2347 -8.33333333333333e+00 +2333 2340 4.16666666666667e+00 +2333 2020 4.16666666666667e+00 +2333 2332 -8.33333333333333e+00 +2333 2338 8.33333333333333e+00 +2333 2349 4.16666666666667e+00 +2333 2337 -4.16666666666667e+00 +2333 1931 -6.25000000000000e+00 +2333 2339 -1.25000000000000e+01 +2333 1930 -2.08333333333333e+00 +2333 2017 2.08333333333333e+00 +2333 1929 4.16666666666667e+00 +2333 2016 -4.16666666666667e+00 +2333 2359 2.08333333333333e+00 +2333 1934 -6.25000000000000e+00 +2333 2021 -1.87500000000000e+01 +2333 1933 -2.08333333333333e+00 +2333 2350 4.16666666666667e+00 +2333 2331 -8.33333333333333e+00 +2333 1932 4.16666666666667e+00 +2333 2019 4.16666666666667e+00 +2334 2334 1.25000000000000e+02 +2334 2348 -8.33333333333333e+00 +2334 2347 4.16666666666667e+00 +2334 2380 -4.16666666666667e+00 +2334 2339 8.33333333333333e+00 +2334 2369 4.16666666666667e+00 +2334 2368 -8.33333333333333e+00 +2334 2338 8.33333333333333e+00 +2334 2337 -3.75000000000000e+01 +2334 2336 -1.66666666666667e+01 +2334 2345 8.33333333333333e+00 +2334 2344 -4.16666666666667e+00 +2334 2377 4.16666666666667e+00 +2334 2378 4.16666666666667e+00 +2334 1937 -4.16666666666667e+00 +2334 1931 -4.16666666666667e+00 +2334 2343 -1.25000000000000e+01 +2334 2228 4.16666666666667e+00 +2334 1930 8.33333333333333e+00 +2334 2227 -8.33333333333333e+00 +2334 2231 8.33333333333333e+00 +2334 2335 -1.66666666666667e+01 +2334 1936 8.33333333333333e+00 +2334 2230 8.33333333333333e+00 +2334 2229 -3.75000000000000e+01 +2334 2018 4.16666666666667e+00 +2334 2165 -4.16666666666667e+00 +2334 2017 4.16666666666667e+00 +2334 2164 -4.16666666666667e+00 +2334 1929 -1.25000000000000e+01 +2334 2024 8.33333333333333e+00 +2334 2168 -8.33333333333333e+00 +2334 2023 -4.16666666666667e+00 +2334 2167 4.16666666666667e+00 +2334 2022 -1.25000000000000e+01 +2334 2381 -4.16666666666667e+00 +2334 1935 -1.25000000000000e+01 +2335 2335 1.25000000000000e+02 +2335 2381 -4.16666666666667e+00 +2335 2346 4.16666666666667e+00 +2335 2379 -4.16666666666667e+00 +2335 2369 4.16666666666667e+00 +2335 2339 -4.16666666666667e+00 +2335 2367 -8.33333333333333e+00 +2335 2338 -1.25000000000000e+01 +2335 2337 8.33333333333333e+00 +2335 2343 -4.16666666666667e+00 +2335 2376 4.16666666666667e+00 +2335 2378 -8.33333333333333e+00 +2335 2345 8.33333333333333e+00 +2335 2344 -1.25000000000000e+01 +2335 2228 4.16666666666667e+00 +2335 1929 8.33333333333333e+00 +2335 2226 -8.33333333333333e+00 +2335 2231 -4.16666666666667e+00 +2335 2230 -1.25000000000000e+01 +2335 2334 -1.66666666666667e+01 +2335 1935 8.33333333333333e+00 +2335 2229 8.33333333333333e+00 +2335 2168 4.16666666666667e+00 +2335 2165 -4.16666666666667e+00 +2335 2018 -8.33333333333333e+00 +2335 1931 8.33333333333333e+00 +2335 1930 -3.75000000000000e+01 +2335 2016 4.16666666666667e+00 +2335 2163 -4.16666666666667e+00 +2335 2024 8.33333333333333e+00 +2335 2336 -1.66666666666667e+01 +2335 1937 8.33333333333333e+00 +2335 2023 -1.25000000000000e+01 +2335 2348 4.16666666666667e+00 +2335 1936 -3.75000000000000e+01 +2335 2022 -4.16666666666667e+00 +2335 2166 4.16666666666667e+00 +2336 2336 1.25000000000000e+02 +2336 2347 4.16666666666667e+00 +2336 2380 -4.16666666666667e+00 +2336 2346 -8.33333333333333e+00 +2336 2368 4.16666666666667e+00 +2336 2338 -4.16666666666667e+00 +2336 2337 8.33333333333333e+00 +2336 2367 4.16666666666667e+00 +2336 2339 -1.25000000000000e+01 +2336 2334 -1.66666666666667e+01 +2336 2343 8.33333333333333e+00 +2336 2377 -8.33333333333333e+00 +2336 2376 4.16666666666667e+00 +2336 1935 -4.16666666666667e+00 +2336 2345 -3.75000000000000e+01 +2336 2344 8.33333333333333e+00 +2336 1929 -4.16666666666667e+00 +2336 2226 4.16666666666667e+00 +2336 2227 4.16666666666667e+00 +2336 2231 -1.25000000000000e+01 +2336 2230 -4.16666666666667e+00 +2336 2229 8.33333333333333e+00 +2336 2167 4.16666666666667e+00 +2336 2164 -4.16666666666667e+00 +2336 2016 4.16666666666667e+00 +2336 2163 -4.16666666666667e+00 +2336 1931 -1.25000000000000e+01 +2336 2017 -8.33333333333333e+00 +2336 1930 8.33333333333333e+00 +2336 2024 -3.75000000000000e+01 +2336 2379 -4.16666666666667e+00 +2336 1937 -1.25000000000000e+01 +2336 2023 8.33333333333333e+00 +2336 2335 -1.66666666666667e+01 +2336 1936 8.33333333333333e+00 +2336 2022 8.33333333333333e+00 +2336 2166 -8.33333333333333e+00 +2337 2337 1.25000000000000e+02 +2337 2381 4.16666666666667e+00 +2337 2336 8.33333333333333e+00 +2337 2024 -8.33333333333333e+00 +2337 2023 4.16666666666667e+00 +2337 2335 8.33333333333333e+00 +2337 2334 -3.75000000000000e+01 +2337 2369 -4.16666666666667e+00 +2337 2368 8.33333333333333e+00 +2337 2367 -1.25000000000000e+01 +2337 2347 -4.16666666666667e+00 +2337 2395 -4.16666666666667e+00 +2337 2362 4.16666666666667e+00 +2337 2348 8.33333333333333e+00 +2337 2363 -8.33333333333333e+00 +2337 1940 4.16666666666667e+00 +2337 2396 -4.16666666666667e+00 +2337 1931 4.16666666666667e+00 +2337 2346 -1.25000000000000e+01 +2337 2018 -4.16666666666667e+00 +2337 2017 -4.16666666666667e+00 +2337 2021 4.16666666666667e+00 +2337 2333 -4.16666666666667e+00 +2337 2338 -1.66666666666667e+01 +2337 2020 4.16666666666667e+00 +2337 2026 -4.16666666666667e+00 +2337 1930 -8.33333333333333e+00 +2337 2332 8.33333333333333e+00 +2337 2331 -1.25000000000000e+01 +2337 2339 -1.66666666666667e+01 +2337 2351 8.33333333333333e+00 +2337 2027 8.33333333333333e+00 +2337 2350 8.33333333333333e+00 +2337 1939 -8.33333333333333e+00 +2337 2380 4.16666666666667e+00 +2337 2349 -3.75000000000000e+01 +2337 2025 -1.25000000000000e+01 +2338 2338 1.25000000000000e+02 +2338 2381 -8.33333333333333e+00 +2338 2336 -4.16666666666667e+00 +2338 2024 4.16666666666667e+00 +2338 2022 4.16666666666667e+00 +2338 2335 -1.25000000000000e+01 +2338 2334 8.33333333333333e+00 +2338 2369 8.33333333333333e+00 +2338 2368 -3.75000000000000e+01 +2338 2367 8.33333333333333e+00 +2338 2346 -4.16666666666667e+00 +2338 2394 -4.16666666666667e+00 +2338 2361 4.16666666666667e+00 +2338 2396 -4.16666666666667e+00 +2338 2363 4.16666666666667e+00 +2338 2339 -1.66666666666667e+01 +2338 2348 8.33333333333333e+00 +2338 2347 -1.25000000000000e+01 +2338 2016 -4.16666666666667e+00 +2338 2333 8.33333333333333e+00 +2338 2337 -1.66666666666667e+01 +2338 2021 -8.33333333333333e+00 +2338 2027 8.33333333333333e+00 +2338 2019 4.16666666666667e+00 +2338 2025 -4.16666666666667e+00 +2338 1931 4.16666666666667e+00 +2338 2018 -4.16666666666667e+00 +2338 2332 -3.75000000000000e+01 +2338 1929 -8.33333333333333e+00 +2338 2331 8.33333333333333e+00 +2338 2351 -4.16666666666667e+00 +2338 1940 4.16666666666667e+00 +2338 2379 4.16666666666667e+00 +2338 2350 -1.25000000000000e+01 +2338 2026 -1.25000000000000e+01 +2338 2349 8.33333333333333e+00 +2338 1938 -8.33333333333333e+00 +2339 2339 1.25000000000000e+02 +2339 2379 4.16666666666667e+00 +2339 2335 -4.16666666666667e+00 +2339 2023 4.16666666666667e+00 +2339 2334 8.33333333333333e+00 +2339 2022 -8.33333333333333e+00 +2339 2336 -1.25000000000000e+01 +2339 2369 -1.25000000000000e+01 +2339 2368 8.33333333333333e+00 +2339 2367 -4.16666666666667e+00 +2339 2395 -4.16666666666667e+00 +2339 2362 4.16666666666667e+00 +2339 2346 8.33333333333333e+00 +2339 2361 -8.33333333333333e+00 +2339 1938 4.16666666666667e+00 +2339 2394 -4.16666666666667e+00 +2339 2348 -3.75000000000000e+01 +2339 2338 -1.66666666666667e+01 +2339 2347 8.33333333333333e+00 +2339 1929 4.16666666666667e+00 +2339 2016 -4.16666666666667e+00 +2339 2332 8.33333333333333e+00 +2339 2019 4.16666666666667e+00 +2339 2331 -4.16666666666667e+00 +2339 2020 -8.33333333333333e+00 +2339 2026 8.33333333333333e+00 +2339 2333 -1.25000000000000e+01 +2339 1930 4.16666666666667e+00 +2339 2017 -4.16666666666667e+00 +2339 2380 -8.33333333333333e+00 +2339 2351 -1.25000000000000e+01 +2339 2027 -3.75000000000000e+01 +2339 2350 -4.16666666666667e+00 +2339 1939 4.16666666666667e+00 +2339 2337 -1.66666666666667e+01 +2339 2349 8.33333333333333e+00 +2339 2025 8.33333333333333e+00 +2340 2340 6.25000000000000e+01 +2340 2363 4.16666666666667e+00 +2340 2362 -8.33333333333333e+00 +2340 2333 4.16666666666667e+00 +2340 2332 -2.08333333333333e+00 +2340 1930 2.08333333333333e+00 +2340 2331 -6.25000000000000e+00 +2340 2360 4.16666666666667e+00 +2340 1969 2.08333333333333e+00 +2340 2358 -1.87500000000000e+01 +2340 2348 -4.16666666666667e+00 +2340 2342 -8.33333333333333e+00 +2340 2089 -2.08333333333333e+00 +2340 2459 -4.16666666666667e+00 +2340 2096 4.16666666666667e+00 +2340 2458 -4.16666666666667e+00 +2340 2095 4.16666666666667e+00 +2340 2090 4.16666666666667e+00 +2340 1970 -4.16666666666667e+00 +2340 2088 -6.25000000000000e+00 +2340 2084 4.16666666666667e+00 +2340 1931 -4.16666666666667e+00 +2340 2083 4.16666666666667e+00 +2340 2341 -8.33333333333333e+00 +2340 2347 8.33333333333333e+00 +2340 2082 -1.87500000000000e+01 +2340 2359 4.16666666666667e+00 +2340 2346 -1.25000000000000e+01 +2341 2341 6.25000000000000e+01 +2341 2358 4.16666666666667e+00 +2341 2363 4.16666666666667e+00 +2341 2361 -8.33333333333333e+00 +2341 2333 4.16666666666667e+00 +2341 2342 -8.33333333333333e+00 +2341 2332 -6.25000000000000e+00 +2341 2331 -2.08333333333333e+00 +2341 1929 2.08333333333333e+00 +2341 2359 -6.25000000000000e+00 +2341 1968 2.08333333333333e+00 +2341 2088 -2.08333333333333e+00 +2341 2090 4.16666666666667e+00 +2341 2348 8.33333333333333e+00 +2341 2096 -8.33333333333333e+00 +2341 2457 -4.16666666666667e+00 +2341 2094 4.16666666666667e+00 +2341 1970 2.08333333333333e+00 +2341 2459 -4.16666666666667e+00 +2341 2089 -6.25000000000000e+00 +2341 2084 -2.08333333333333e+00 +2341 1931 2.08333333333333e+00 +2341 2083 -6.25000000000000e+00 +2341 2360 -2.08333333333333e+00 +2341 2347 -3.75000000000000e+01 +2341 2082 4.16666666666667e+00 +2341 2340 -8.33333333333333e+00 +2341 2346 8.33333333333333e+00 +2342 2342 6.25000000000000e+01 +2342 2361 4.16666666666667e+00 +2342 2362 4.16666666666667e+00 +2342 2333 -1.87500000000000e+01 +2342 2332 4.16666666666667e+00 +2342 2341 -8.33333333333333e+00 +2342 2331 4.16666666666667e+00 +2342 2360 -6.25000000000000e+00 +2342 2358 4.16666666666667e+00 +2342 2346 -4.16666666666667e+00 +2342 2340 -8.33333333333333e+00 +2342 2089 4.16666666666667e+00 +2342 2457 -4.16666666666667e+00 +2342 2094 4.16666666666667e+00 +2342 2347 8.33333333333333e+00 +2342 2095 -8.33333333333333e+00 +2342 2090 -1.87500000000000e+01 +2342 1969 2.08333333333333e+00 +2342 2458 -4.16666666666667e+00 +2342 2088 4.16666666666667e+00 +2342 1968 -4.16666666666667e+00 +2342 2084 -6.25000000000000e+00 +2342 2359 -2.08333333333333e+00 +2342 2348 -1.25000000000000e+01 +2342 2083 -2.08333333333333e+00 +2342 1930 2.08333333333333e+00 +2342 2082 4.16666666666667e+00 +2342 1929 -4.16666666666667e+00 +2343 2343 1.25000000000000e+02 +2343 2380 -8.33333333333333e+00 +2343 2348 8.33333333333333e+00 +2343 2096 -8.33333333333333e+00 +2343 2464 -4.16666666666667e+00 +2343 2095 4.16666666666667e+00 +2343 2465 -4.16666666666667e+00 +2343 2347 8.33333333333333e+00 +2343 2346 -3.75000000000000e+01 +2343 2336 8.33333333333333e+00 +2343 2335 -4.16666666666667e+00 +2343 2231 -8.33333333333333e+00 +2343 2230 4.16666666666667e+00 +2343 1973 4.16666666666667e+00 +2343 2378 -4.16666666666667e+00 +2343 2377 8.33333333333333e+00 +2343 2344 -1.66666666666667e+01 +2343 2376 -1.25000000000000e+01 +2343 1931 4.16666666666667e+00 +2343 2334 -1.25000000000000e+01 +2343 2084 -4.16666666666667e+00 +2343 2083 8.33333333333333e+00 +2343 2228 -4.16666666666667e+00 +2343 2081 4.16666666666667e+00 +2343 2239 8.33333333333333e+00 +2343 2080 -8.33333333333333e+00 +2343 1930 4.16666666666667e+00 +2343 2227 -4.16666666666667e+00 +2343 2082 -1.25000000000000e+01 +2343 2345 -1.66666666666667e+01 +2343 2093 8.33333333333333e+00 +2343 2240 8.33333333333333e+00 +2343 2092 -4.16666666666667e+00 +2343 1972 4.16666666666667e+00 +2343 2381 4.16666666666667e+00 +2343 2091 -1.25000000000000e+01 +2343 2238 -3.75000000000000e+01 +2344 2344 1.25000000000000e+02 +2344 2379 -8.33333333333333e+00 +2344 2348 -4.16666666666667e+00 +2344 2465 -4.16666666666667e+00 +2344 2096 4.16666666666667e+00 +2344 2463 -4.16666666666667e+00 +2344 2094 4.16666666666667e+00 +2344 2347 -1.25000000000000e+01 +2344 2346 8.33333333333333e+00 +2344 2334 -4.16666666666667e+00 +2344 2231 4.16666666666667e+00 +2344 2229 4.16666666666667e+00 +2344 2378 8.33333333333333e+00 +2344 2377 -3.75000000000000e+01 +2344 2376 8.33333333333333e+00 +2344 2343 -1.66666666666667e+01 +2344 2336 8.33333333333333e+00 +2344 2335 -1.25000000000000e+01 +2344 2240 -4.16666666666667e+00 +2344 2345 -1.66666666666667e+01 +2344 2228 -4.16666666666667e+00 +2344 2081 4.16666666666667e+00 +2344 2082 8.33333333333333e+00 +2344 2238 8.33333333333333e+00 +2344 2079 -8.33333333333333e+00 +2344 1931 -8.33333333333333e+00 +2344 2084 8.33333333333333e+00 +2344 2083 -3.75000000000000e+01 +2344 1929 4.16666666666667e+00 +2344 2226 -4.16666666666667e+00 +2344 2093 8.33333333333333e+00 +2344 1973 -8.33333333333333e+00 +2344 2381 4.16666666666667e+00 +2344 2092 -1.25000000000000e+01 +2344 2239 -1.25000000000000e+01 +2344 2091 -4.16666666666667e+00 +2344 1971 4.16666666666667e+00 +2345 2345 1.25000000000000e+02 +2345 2379 4.16666666666667e+00 +2345 2347 -4.16666666666667e+00 +2345 2464 -4.16666666666667e+00 +2345 2095 4.16666666666667e+00 +2345 2346 8.33333333333333e+00 +2345 2094 -8.33333333333333e+00 +2345 2463 -4.16666666666667e+00 +2345 2348 -1.25000000000000e+01 +2345 2334 8.33333333333333e+00 +2345 2230 4.16666666666667e+00 +2345 2229 -8.33333333333333e+00 +2345 2378 -1.25000000000000e+01 +2345 2377 8.33333333333333e+00 +2345 1971 4.16666666666667e+00 +2345 2376 -4.16666666666667e+00 +2345 2336 -3.75000000000000e+01 +2345 2335 8.33333333333333e+00 +2345 1929 4.16666666666667e+00 +2345 2239 -4.16666666666667e+00 +2345 2344 -1.66666666666667e+01 +2345 2082 -4.16666666666667e+00 +2345 2227 -4.16666666666667e+00 +2345 2080 4.16666666666667e+00 +2345 2226 -4.16666666666667e+00 +2345 2079 4.16666666666667e+00 +2345 2084 -1.25000000000000e+01 +2345 1930 -8.33333333333333e+00 +2345 2083 8.33333333333333e+00 +2345 2380 4.16666666666667e+00 +2345 2093 -3.75000000000000e+01 +2345 2240 -1.25000000000000e+01 +2345 2092 8.33333333333333e+00 +2345 1972 -8.33333333333333e+00 +2345 2343 -1.66666666666667e+01 +2345 2091 8.33333333333333e+00 +2345 2238 8.33333333333333e+00 +2346 2346 1.25000000000000e+02 +2346 2380 8.33333333333333e+00 +2346 2336 -8.33333333333333e+00 +2346 2335 4.16666666666667e+00 +2346 2379 -1.25000000000000e+01 +2346 2345 8.33333333333333e+00 +2346 2464 4.16666666666667e+00 +2346 2344 8.33333333333333e+00 +2346 2343 -3.75000000000000e+01 +2346 2465 4.16666666666667e+00 +2346 2338 -4.16666666666667e+00 +2346 2339 8.33333333333333e+00 +2346 2348 -1.66666666666667e+01 +2346 1931 -4.16666666666667e+00 +2346 2337 -1.25000000000000e+01 +2346 2396 4.16666666666667e+00 +2346 1976 -4.16666666666667e+00 +2346 2395 -8.33333333333333e+00 +2346 2333 4.16666666666667e+00 +2346 2347 -1.66666666666667e+01 +2346 2362 8.33333333333333e+00 +2346 2332 4.16666666666667e+00 +2346 1930 -4.16666666666667e+00 +2346 2363 8.33333333333333e+00 +2346 1975 -4.16666666666667e+00 +2346 2361 -3.75000000000000e+01 +2346 2342 -4.16666666666667e+00 +2346 2084 4.16666666666667e+00 +2346 2458 4.16666666666667e+00 +2346 2095 -4.16666666666667e+00 +2346 2083 -8.33333333333333e+00 +2346 2341 8.33333333333333e+00 +2346 2340 -1.25000000000000e+01 +2346 2096 8.33333333333333e+00 +2346 2459 -8.33333333333333e+00 +2346 2094 -1.25000000000000e+01 +2346 2381 -4.16666666666667e+00 +2347 2347 1.25000000000000e+02 +2347 2379 8.33333333333333e+00 +2347 2334 4.16666666666667e+00 +2347 2381 8.33333333333333e+00 +2347 2380 -3.75000000000000e+01 +2347 2345 -4.16666666666667e+00 +2347 2463 4.16666666666667e+00 +2347 2344 -1.25000000000000e+01 +2347 2343 8.33333333333333e+00 +2347 2465 -8.33333333333333e+00 +2347 2337 -4.16666666666667e+00 +2347 2396 4.16666666666667e+00 +2347 2339 8.33333333333333e+00 +2347 2338 -1.25000000000000e+01 +2347 2394 -8.33333333333333e+00 +2347 2363 -4.16666666666667e+00 +2347 2346 -1.66666666666667e+01 +2347 2361 8.33333333333333e+00 +2347 2333 -8.33333333333333e+00 +2347 2331 4.16666666666667e+00 +2347 1929 -4.16666666666667e+00 +2347 2362 -1.25000000000000e+01 +2347 1974 -4.16666666666667e+00 +2347 2342 8.33333333333333e+00 +2347 2348 -1.66666666666667e+01 +2347 2096 8.33333333333333e+00 +2347 2457 4.16666666666667e+00 +2347 2094 -4.16666666666667e+00 +2347 2084 4.16666666666667e+00 +2347 1931 -4.16666666666667e+00 +2347 2341 -3.75000000000000e+01 +2347 2082 -8.33333333333333e+00 +2347 2340 8.33333333333333e+00 +2347 2459 4.16666666666667e+00 +2347 1976 -4.16666666666667e+00 +2347 2095 -1.25000000000000e+01 +2347 2336 4.16666666666667e+00 +2348 2348 1.25000000000000e+02 +2348 2379 -4.16666666666667e+00 +2348 2334 -8.33333333333333e+00 +2348 2381 -1.25000000000000e+01 +2348 2380 8.33333333333333e+00 +2348 2344 -4.16666666666667e+00 +2348 2343 8.33333333333333e+00 +2348 2345 -1.25000000000000e+01 +2348 2464 -8.33333333333333e+00 +2348 2463 4.16666666666667e+00 +2348 2395 4.16666666666667e+00 +2348 2337 8.33333333333333e+00 +2348 2346 -1.66666666666667e+01 +2348 2339 -3.75000000000000e+01 +2348 2338 8.33333333333333e+00 +2348 1929 -4.16666666666667e+00 +2348 2394 4.16666666666667e+00 +2348 1974 -4.16666666666667e+00 +2348 2331 4.16666666666667e+00 +2348 2362 -4.16666666666667e+00 +2348 2332 -8.33333333333333e+00 +2348 2363 -1.25000000000000e+01 +2348 2361 8.33333333333333e+00 +2348 2340 -4.16666666666667e+00 +2348 2082 4.16666666666667e+00 +2348 2341 8.33333333333333e+00 +2348 2347 -1.66666666666667e+01 +2348 2095 8.33333333333333e+00 +2348 2342 -1.25000000000000e+01 +2348 2083 4.16666666666667e+00 +2348 1930 -4.16666666666667e+00 +2348 2096 -3.75000000000000e+01 +2348 2335 4.16666666666667e+00 +2348 2458 4.16666666666667e+00 +2348 1975 -4.16666666666667e+00 +2348 2094 8.33333333333333e+00 +2348 2457 -8.33333333333333e+00 +2349 2349 1.25000000000000e+02 +2349 2387 4.16666666666667e+00 +2349 2386 -8.33333333333333e+00 +2349 2356 8.33333333333333e+00 +2349 2355 -3.75000000000000e+01 +2349 2282 4.16666666666667e+00 +2349 2281 4.16666666666667e+00 +2349 2285 8.33333333333333e+00 +2349 2284 -4.16666666666667e+00 +2349 2283 -1.25000000000000e+01 +2349 2351 -1.66666666666667e+01 +2349 1934 -4.16666666666667e+00 +2349 1940 -4.16666666666667e+00 +2349 2399 -4.16666666666667e+00 +2349 2396 4.16666666666667e+00 +2349 2366 -8.33333333333333e+00 +2349 2363 8.33333333333333e+00 +2349 2365 4.16666666666667e+00 +2349 2362 -4.16666666666667e+00 +2349 2361 -1.25000000000000e+01 +2349 2398 -4.16666666666667e+00 +2349 2395 4.16666666666667e+00 +2349 2021 -4.16666666666667e+00 +2349 2333 4.16666666666667e+00 +2349 2020 -4.16666666666667e+00 +2349 2026 4.16666666666667e+00 +2349 2332 -8.33333333333333e+00 +2349 1933 8.33333333333333e+00 +2349 1932 -1.25000000000000e+01 +2349 2339 8.33333333333333e+00 +2349 2027 -8.33333333333333e+00 +2349 2338 8.33333333333333e+00 +2349 2350 -1.66666666666667e+01 +2349 1939 8.33333333333333e+00 +2349 2337 -3.75000000000000e+01 +2349 2357 8.33333333333333e+00 +2349 1938 -1.25000000000000e+01 +2350 2350 1.25000000000000e+02 +2350 2357 -4.16666666666667e+00 +2350 2385 -8.33333333333333e+00 +2350 2356 -1.25000000000000e+01 +2350 2355 8.33333333333333e+00 +2350 2282 -8.33333333333333e+00 +2350 2280 4.16666666666667e+00 +2350 2285 8.33333333333333e+00 +2350 2284 -1.25000000000000e+01 +2350 2283 -4.16666666666667e+00 +2350 2399 -4.16666666666667e+00 +2350 2366 4.16666666666667e+00 +2350 1934 8.33333333333333e+00 +2350 2351 -1.66666666666667e+01 +2350 2363 8.33333333333333e+00 +2350 2362 -1.25000000000000e+01 +2350 2364 4.16666666666667e+00 +2350 2361 -4.16666666666667e+00 +2350 1940 8.33333333333333e+00 +2350 2396 -8.33333333333333e+00 +2350 2397 -4.16666666666667e+00 +2350 2394 4.16666666666667e+00 +2350 2019 -4.16666666666667e+00 +2350 2025 4.16666666666667e+00 +2350 2333 4.16666666666667e+00 +2350 2021 -4.16666666666667e+00 +2350 1933 -3.75000000000000e+01 +2350 2331 -8.33333333333333e+00 +2350 1932 8.33333333333333e+00 +2350 2339 -4.16666666666667e+00 +2350 2027 4.16666666666667e+00 +2350 2338 -1.25000000000000e+01 +2350 2387 4.16666666666667e+00 +2350 1939 -3.75000000000000e+01 +2350 2337 8.33333333333333e+00 +2350 2349 -1.66666666666667e+01 +2350 1938 8.33333333333333e+00 +2351 2351 1.25000000000000e+02 +2351 2356 -4.16666666666667e+00 +2351 2355 8.33333333333333e+00 +2351 2385 4.16666666666667e+00 +2351 2357 -1.25000000000000e+01 +2351 2280 4.16666666666667e+00 +2351 2281 -8.33333333333333e+00 +2351 2285 -3.75000000000000e+01 +2351 2284 8.33333333333333e+00 +2351 2283 8.33333333333333e+00 +2351 2349 -1.66666666666667e+01 +2351 1932 -4.16666666666667e+00 +2351 1938 -4.16666666666667e+00 +2351 2397 -4.16666666666667e+00 +2351 2394 4.16666666666667e+00 +2351 2398 -4.16666666666667e+00 +2351 2365 4.16666666666667e+00 +2351 2363 -3.75000000000000e+01 +2351 1933 8.33333333333333e+00 +2351 2350 -1.66666666666667e+01 +2351 2362 8.33333333333333e+00 +2351 2364 -8.33333333333333e+00 +2351 2361 8.33333333333333e+00 +2351 1939 8.33333333333333e+00 +2351 2395 -8.33333333333333e+00 +2351 2019 -4.16666666666667e+00 +2351 2331 4.16666666666667e+00 +2351 1934 -1.25000000000000e+01 +2351 2332 4.16666666666667e+00 +2351 2020 -4.16666666666667e+00 +2351 2339 -1.25000000000000e+01 +2351 2386 4.16666666666667e+00 +2351 1940 -1.25000000000000e+01 +2351 2338 -4.16666666666667e+00 +2351 2026 4.16666666666667e+00 +2351 2337 8.33333333333333e+00 +2351 2025 -8.33333333333333e+00 +2352 2352 6.25000000000000e+01 +2352 2357 -4.16666666666667e+00 +2352 2290 -2.08333333333333e+00 +2352 2281 2.08333333333333e+00 +2352 2291 4.16666666666667e+00 +2352 2289 -6.25000000000000e+00 +2352 2282 -4.16666666666667e+00 +2352 2353 -8.33333333333333e+00 +2352 2356 8.33333333333333e+00 +2352 1933 4.16666666666667e+00 +2352 2355 -1.25000000000000e+01 +2352 2366 4.16666666666667e+00 +2352 2354 -8.33333333333333e+00 +2352 2099 4.16666666666667e+00 +2352 1934 4.16666666666667e+00 +2352 2098 -2.08333333333333e+00 +2352 2365 4.16666666666667e+00 +2352 2097 -6.25000000000000e+00 +2352 1932 -1.87500000000000e+01 +2352 1309 4.16666666666667e+00 +2352 1609 -8.33333333333333e+00 +2352 1619 -4.16666666666667e+00 +2352 1310 4.16666666666667e+00 +2352 1469 -4.16666666666667e+00 +2352 1468 2.08333333333333e+00 +2352 1618 -4.16666666666667e+00 +2352 1308 -1.87500000000000e+01 +2352 1610 4.16666666666667e+00 +2353 2353 6.25000000000000e+01 +2353 2291 4.16666666666667e+00 +2353 2357 8.33333333333333e+00 +2353 2289 -2.08333333333333e+00 +2353 2280 2.08333333333333e+00 +2353 2290 -6.25000000000000e+00 +2353 2282 2.08333333333333e+00 +2353 1934 -2.08333333333333e+00 +2353 2356 -3.75000000000000e+01 +2353 2352 -8.33333333333333e+00 +2353 2355 8.33333333333333e+00 +2353 1932 4.16666666666667e+00 +2353 2099 4.16666666666667e+00 +2353 2366 -8.33333333333333e+00 +2353 2354 -8.33333333333333e+00 +2353 2098 -6.25000000000000e+00 +2353 1933 -6.25000000000000e+00 +2353 2097 -2.08333333333333e+00 +2353 2364 4.16666666666667e+00 +2353 1310 -2.08333333333333e+00 +2353 1610 4.16666666666667e+00 +2353 1308 4.16666666666667e+00 +2353 1608 -8.33333333333333e+00 +2353 1469 2.08333333333333e+00 +2353 1619 -4.16666666666667e+00 +2353 1309 -6.25000000000000e+00 +2353 1467 2.08333333333333e+00 +2353 1617 -4.16666666666667e+00 +2354 2354 6.25000000000000e+01 +2354 2355 -4.16666666666667e+00 +2354 2353 -8.33333333333333e+00 +2354 2290 4.16666666666667e+00 +2354 2356 8.33333333333333e+00 +2354 2291 -1.87500000000000e+01 +2354 2289 4.16666666666667e+00 +2354 2357 -1.25000000000000e+01 +2354 2281 2.08333333333333e+00 +2354 1933 -2.08333333333333e+00 +2354 2280 -4.16666666666667e+00 +2354 2364 4.16666666666667e+00 +2354 2099 -1.87500000000000e+01 +2354 1934 -6.25000000000000e+00 +2354 2098 4.16666666666667e+00 +2354 2365 -8.33333333333333e+00 +2354 2352 -8.33333333333333e+00 +2354 2097 4.16666666666667e+00 +2354 1932 4.16666666666667e+00 +2354 1309 -2.08333333333333e+00 +2354 1609 4.16666666666667e+00 +2354 1468 2.08333333333333e+00 +2354 1618 -4.16666666666667e+00 +2354 1617 -4.16666666666667e+00 +2354 1310 -6.25000000000000e+00 +2354 1308 4.16666666666667e+00 +2354 1467 -4.16666666666667e+00 +2354 1608 4.16666666666667e+00 +2355 2355 1.25000000000000e+02 +2355 2398 4.16666666666667e+00 +2355 2366 8.33333333333333e+00 +2355 2365 -4.16666666666667e+00 +2355 2364 -1.25000000000000e+01 +2355 2291 4.16666666666667e+00 +2355 2354 -4.16666666666667e+00 +2355 2290 4.16666666666667e+00 +2355 2357 -1.66666666666667e+01 +2355 2353 8.33333333333333e+00 +2355 2352 -1.25000000000000e+01 +2355 2356 -1.66666666666667e+01 +2355 2293 -4.16666666666667e+00 +2355 2294 8.33333333333333e+00 +2355 2285 -8.33333333333333e+00 +2355 2351 8.33333333333333e+00 +2355 2281 -4.16666666666667e+00 +2355 2284 4.16666666666667e+00 +2355 2387 -4.16666666666667e+00 +2355 2386 8.33333333333333e+00 +2355 2292 -1.25000000000000e+01 +2355 2385 -1.25000000000000e+01 +2355 2282 -4.16666666666667e+00 +2355 1934 4.16666666666667e+00 +2355 2350 8.33333333333333e+00 +2355 1933 -8.33333333333333e+00 +2355 2399 4.16666666666667e+00 +2355 2349 -3.75000000000000e+01 +2355 1651 -4.16666666666667e+00 +2355 1619 -8.33333333333333e+00 +2355 1618 4.16666666666667e+00 +2355 1652 -4.16666666666667e+00 +2355 1610 8.33333333333333e+00 +2355 1609 8.33333333333333e+00 +2355 1608 -3.75000000000000e+01 +2355 1316 4.16666666666667e+00 +2355 1315 -8.33333333333333e+00 +2356 2356 1.25000000000000e+02 +2356 2397 4.16666666666667e+00 +2356 2364 -4.16666666666667e+00 +2356 2366 8.33333333333333e+00 +2356 2365 -1.25000000000000e+01 +2356 2354 8.33333333333333e+00 +2356 2291 -8.33333333333333e+00 +2356 2289 4.16666666666667e+00 +2356 1934 4.16666666666667e+00 +2356 2353 -3.75000000000000e+01 +2356 2352 8.33333333333333e+00 +2356 2351 -4.16666666666667e+00 +2356 2355 -1.66666666666667e+01 +2356 2292 -4.16666666666667e+00 +2356 2285 4.16666666666667e+00 +2356 2282 -4.16666666666667e+00 +2356 2280 -4.16666666666667e+00 +2356 2283 4.16666666666667e+00 +2356 2294 8.33333333333333e+00 +2356 2387 8.33333333333333e+00 +2356 2357 -1.66666666666667e+01 +2356 2293 -1.25000000000000e+01 +2356 2386 -3.75000000000000e+01 +2356 2385 8.33333333333333e+00 +2356 2399 -8.33333333333333e+00 +2356 2350 -1.25000000000000e+01 +2356 2349 8.33333333333333e+00 +2356 1932 -8.33333333333333e+00 +2356 1650 -4.16666666666667e+00 +2356 1652 -4.16666666666667e+00 +2356 1619 4.16666666666667e+00 +2356 1617 4.16666666666667e+00 +2356 1610 -4.16666666666667e+00 +2356 1316 4.16666666666667e+00 +2356 1609 -1.25000000000000e+01 +2356 1608 8.33333333333333e+00 +2356 1314 -8.33333333333333e+00 +2357 2357 1.25000000000000e+02 +2357 2398 -8.33333333333333e+00 +2357 2364 8.33333333333333e+00 +2357 2366 -3.75000000000000e+01 +2357 2365 8.33333333333333e+00 +2357 2289 4.16666666666667e+00 +2357 2352 -4.16666666666667e+00 +2357 2353 8.33333333333333e+00 +2357 2290 -8.33333333333333e+00 +2357 2355 -1.66666666666667e+01 +2357 2354 -1.25000000000000e+01 +2357 1933 4.16666666666667e+00 +2357 2350 -4.16666666666667e+00 +2357 2284 4.16666666666667e+00 +2357 2281 -4.16666666666667e+00 +2357 2292 8.33333333333333e+00 +2357 2283 -8.33333333333333e+00 +2357 2349 8.33333333333333e+00 +2357 2294 -3.75000000000000e+01 +2357 2387 -1.25000000000000e+01 +2357 2293 8.33333333333333e+00 +2357 2386 8.33333333333333e+00 +2357 2356 -1.66666666666667e+01 +2357 2385 -4.16666666666667e+00 +2357 2397 4.16666666666667e+00 +2357 2351 -1.25000000000000e+01 +2357 2280 -4.16666666666667e+00 +2357 1932 4.16666666666667e+00 +2357 1651 -4.16666666666667e+00 +2357 1618 4.16666666666667e+00 +2357 1617 -8.33333333333333e+00 +2357 1650 -4.16666666666667e+00 +2357 1610 -1.25000000000000e+01 +2357 1609 -4.16666666666667e+00 +2357 1315 4.16666666666667e+00 +2357 1608 8.33333333333333e+00 +2357 1314 4.16666666666667e+00 +2358 2358 6.25000000000000e+01 +2358 2359 -8.33333333333333e+00 +2358 2333 -4.16666666666667e+00 +2358 1933 -2.08333333333333e+00 +2358 2332 2.08333333333333e+00 +2358 2342 4.16666666666667e+00 +2358 1969 -2.08333333333333e+00 +2358 2340 -1.87500000000000e+01 +2358 2458 4.16666666666667e+00 +2358 2363 -4.16666666666667e+00 +2358 2362 8.33333333333333e+00 +2358 2361 -1.25000000000000e+01 +2358 2459 4.16666666666667e+00 +2358 2366 4.16666666666667e+00 +2358 2462 -4.16666666666667e+00 +2358 2101 2.08333333333333e+00 +2358 2461 -4.16666666666667e+00 +2358 1970 4.16666666666667e+00 +2358 2102 -4.16666666666667e+00 +2358 1968 -6.25000000000000e+00 +2358 2360 -8.33333333333333e+00 +2358 2099 4.16666666666667e+00 +2358 1934 4.16666666666667e+00 +2358 2098 4.16666666666667e+00 +2358 2365 -8.33333333333333e+00 +2358 2341 4.16666666666667e+00 +2358 2097 -1.87500000000000e+01 +2358 1932 -6.25000000000000e+00 +2359 2359 6.25000000000000e+01 +2359 2333 2.08333333333333e+00 +2359 2340 4.16666666666667e+00 +2359 2358 -8.33333333333333e+00 +2359 1932 -2.08333333333333e+00 +2359 2331 2.08333333333333e+00 +2359 2341 -6.25000000000000e+00 +2359 1968 -2.08333333333333e+00 +2359 2457 4.16666666666667e+00 +2359 1934 4.16666666666667e+00 +2359 2360 -8.33333333333333e+00 +2359 2363 8.33333333333333e+00 +2359 2362 -3.75000000000000e+01 +2359 2361 8.33333333333333e+00 +2359 1970 4.16666666666667e+00 +2359 2459 -8.33333333333333e+00 +2359 2100 2.08333333333333e+00 +2359 2460 -4.16666666666667e+00 +2359 2102 2.08333333333333e+00 +2359 2462 -4.16666666666667e+00 +2359 1969 -6.25000000000000e+00 +2359 2099 -2.08333333333333e+00 +2359 2366 4.16666666666667e+00 +2359 2342 -2.08333333333333e+00 +2359 2098 -6.25000000000000e+00 +2359 1933 -6.25000000000000e+00 +2359 2097 4.16666666666667e+00 +2359 2364 -8.33333333333333e+00 +2360 2360 6.25000000000000e+01 +2360 2332 2.08333333333333e+00 +2360 2331 -4.16666666666667e+00 +2360 2342 -6.25000000000000e+00 +2360 2340 4.16666666666667e+00 +2360 2363 -1.25000000000000e+01 +2360 1933 4.16666666666667e+00 +2360 2359 -8.33333333333333e+00 +2360 2362 8.33333333333333e+00 +2360 2361 -4.16666666666667e+00 +2360 1969 4.16666666666667e+00 +2360 2458 -8.33333333333333e+00 +2360 2457 4.16666666666667e+00 +2360 2364 4.16666666666667e+00 +2360 2460 -4.16666666666667e+00 +2360 1970 -1.87500000000000e+01 +2360 2101 2.08333333333333e+00 +2360 2461 -4.16666666666667e+00 +2360 1968 4.16666666666667e+00 +2360 2100 -4.16666666666667e+00 +2360 2341 -2.08333333333333e+00 +2360 2099 -6.25000000000000e+00 +2360 1934 -1.87500000000000e+01 +2360 2098 -2.08333333333333e+00 +2360 2365 4.16666666666667e+00 +2360 2358 -8.33333333333333e+00 +2360 2097 4.16666666666667e+00 +2360 1932 4.16666666666667e+00 +2361 2361 1.25000000000000e+02 +2361 2339 -8.33333333333333e+00 +2361 2342 4.16666666666667e+00 +2361 2333 -4.16666666666667e+00 +2361 2341 -8.33333333333333e+00 +2361 2347 8.33333333333333e+00 +2361 2332 -4.16666666666667e+00 +2361 2348 8.33333333333333e+00 +2361 2346 -3.75000000000000e+01 +2361 2461 4.16666666666667e+00 +2361 2458 -4.16666666666667e+00 +2361 2462 -8.33333333333333e+00 +2361 2459 8.33333333333333e+00 +2361 1934 4.16666666666667e+00 +2361 2360 -4.16666666666667e+00 +2361 2359 8.33333333333333e+00 +2361 2362 -1.66666666666667e+01 +2361 2358 -1.25000000000000e+01 +2361 1976 4.16666666666667e+00 +2361 2457 -1.25000000000000e+01 +2361 2396 -4.16666666666667e+00 +2361 2399 4.16666666666667e+00 +2361 2471 -4.16666666666667e+00 +2361 2365 8.33333333333333e+00 +2361 2398 -8.33333333333333e+00 +2361 2395 8.33333333333333e+00 +2361 2366 8.33333333333333e+00 +2361 2351 8.33333333333333e+00 +2361 2363 -1.66666666666667e+01 +2361 1933 4.16666666666667e+00 +2361 2350 -4.16666666666667e+00 +2361 2364 -3.75000000000000e+01 +2361 2349 -1.25000000000000e+01 +2361 2470 -4.16666666666667e+00 +2361 1975 4.16666666666667e+00 +2361 2338 4.16666666666667e+00 +2361 2394 -1.25000000000000e+01 +2362 2362 1.25000000000000e+02 +2362 2339 4.16666666666667e+00 +2362 2333 -4.16666666666667e+00 +2362 2342 4.16666666666667e+00 +2362 2348 -4.16666666666667e+00 +2362 2340 -8.33333333333333e+00 +2362 2346 8.33333333333333e+00 +2362 2331 -4.16666666666667e+00 +2362 2347 -1.25000000000000e+01 +2362 2460 4.16666666666667e+00 +2362 2457 -4.16666666666667e+00 +2362 2462 4.16666666666667e+00 +2362 2360 8.33333333333333e+00 +2362 2359 -3.75000000000000e+01 +2362 2358 8.33333333333333e+00 +2362 2361 -1.66666666666667e+01 +2362 2459 8.33333333333333e+00 +2362 2458 -1.25000000000000e+01 +2362 2363 -1.66666666666667e+01 +2362 2366 -4.16666666666667e+00 +2362 2364 8.33333333333333e+00 +2362 2399 4.16666666666667e+00 +2362 2471 -4.16666666666667e+00 +2362 2397 -8.33333333333333e+00 +2362 2394 8.33333333333333e+00 +2362 1934 -8.33333333333333e+00 +2362 2351 8.33333333333333e+00 +2362 2365 -1.25000000000000e+01 +2362 2350 -1.25000000000000e+01 +2362 1932 4.16666666666667e+00 +2362 2349 -4.16666666666667e+00 +2362 2396 8.33333333333333e+00 +2362 1976 -8.33333333333333e+00 +2362 2337 4.16666666666667e+00 +2362 2395 -3.75000000000000e+01 +2362 2469 -4.16666666666667e+00 +2362 1974 4.16666666666667e+00 +2363 2363 1.25000000000000e+02 +2363 2337 -8.33333333333333e+00 +2363 2332 -4.16666666666667e+00 +2363 2340 4.16666666666667e+00 +2363 2331 -4.16666666666667e+00 +2363 2341 4.16666666666667e+00 +2363 2347 -4.16666666666667e+00 +2363 2348 -1.25000000000000e+01 +2363 2346 8.33333333333333e+00 +2363 2461 4.16666666666667e+00 +2363 2460 -8.33333333333333e+00 +2363 2457 8.33333333333333e+00 +2363 2360 -1.25000000000000e+01 +2363 2359 8.33333333333333e+00 +2363 1932 4.16666666666667e+00 +2363 2358 -4.16666666666667e+00 +2363 2459 -3.75000000000000e+01 +2363 2458 8.33333333333333e+00 +2363 1974 4.16666666666667e+00 +2363 2362 -1.66666666666667e+01 +2363 2394 -4.16666666666667e+00 +2363 2365 -4.16666666666667e+00 +2363 2397 4.16666666666667e+00 +2363 2469 -4.16666666666667e+00 +2363 2398 4.16666666666667e+00 +2363 2470 -4.16666666666667e+00 +2363 2366 -1.25000000000000e+01 +2363 2351 -3.75000000000000e+01 +2363 1933 -8.33333333333333e+00 +2363 2350 8.33333333333333e+00 +2363 2364 8.33333333333333e+00 +2363 2349 8.33333333333333e+00 +2363 2361 -1.66666666666667e+01 +2363 2338 4.16666666666667e+00 +2363 2396 -1.25000000000000e+01 +2363 2395 8.33333333333333e+00 +2363 1975 -8.33333333333333e+00 +2364 2364 1.25000000000000e+02 +2364 2356 -4.16666666666667e+00 +2364 2355 -1.25000000000000e+01 +2364 2354 4.16666666666667e+00 +2364 2353 4.16666666666667e+00 +2364 2366 -1.66666666666667e+01 +2364 1934 -4.16666666666667e+00 +2364 2399 -4.16666666666667e+00 +2364 2471 4.16666666666667e+00 +2364 2398 8.33333333333333e+00 +2364 2365 -1.66666666666667e+01 +2364 2362 8.33333333333333e+00 +2364 2351 -8.33333333333333e+00 +2364 2363 8.33333333333333e+00 +2364 1933 -4.16666666666667e+00 +2364 2350 4.16666666666667e+00 +2364 2361 -3.75000000000000e+01 +2364 2470 4.16666666666667e+00 +2364 2397 -1.25000000000000e+01 +2364 2099 -4.16666666666667e+00 +2364 2360 4.16666666666667e+00 +2364 2461 -4.16666666666667e+00 +2364 2359 -8.33333333333333e+00 +2364 2098 8.33333333333333e+00 +2364 2097 -1.25000000000000e+01 +2364 2462 8.33333333333333e+00 +2364 2460 -1.25000000000000e+01 +2364 2357 8.33333333333333e+00 +2364 1652 4.16666666666667e+00 +2364 1651 -8.33333333333333e+00 +2364 1618 8.33333333333333e+00 +2364 1619 8.33333333333333e+00 +2364 1617 -3.75000000000000e+01 +2364 1364 -4.16666666666667e+00 +2364 1363 -4.16666666666667e+00 +2364 1474 4.16666666666667e+00 +2364 1475 -8.33333333333333e+00 +2365 2365 1.25000000000000e+02 +2365 2355 -4.16666666666667e+00 +2365 2357 8.33333333333333e+00 +2365 2356 -1.25000000000000e+01 +2365 2354 -8.33333333333333e+00 +2365 2352 4.16666666666667e+00 +2365 2351 4.16666666666667e+00 +2365 2363 -4.16666666666667e+00 +2365 2397 8.33333333333333e+00 +2365 2364 -1.66666666666667e+01 +2365 2361 8.33333333333333e+00 +2365 2362 -1.25000000000000e+01 +2365 1932 -4.16666666666667e+00 +2365 2349 4.16666666666667e+00 +2365 2399 8.33333333333333e+00 +2365 2471 -8.33333333333333e+00 +2365 2398 -3.75000000000000e+01 +2365 2469 4.16666666666667e+00 +2365 2099 8.33333333333333e+00 +2365 2366 -1.66666666666667e+01 +2365 2462 8.33333333333333e+00 +2365 2460 -4.16666666666667e+00 +2365 2360 4.16666666666667e+00 +2365 1934 -4.16666666666667e+00 +2365 2098 -3.75000000000000e+01 +2365 2358 -8.33333333333333e+00 +2365 2097 8.33333333333333e+00 +2365 2461 -1.25000000000000e+01 +2365 1650 -8.33333333333333e+00 +2365 1619 -4.16666666666667e+00 +2365 1617 8.33333333333333e+00 +2365 1618 -1.25000000000000e+01 +2365 1362 -4.16666666666667e+00 +2365 1473 4.16666666666667e+00 +2365 1475 4.16666666666667e+00 +2365 1364 -4.16666666666667e+00 +2365 1652 4.16666666666667e+00 +2366 2366 1.25000000000000e+02 +2366 2355 8.33333333333333e+00 +2366 2357 -3.75000000000000e+01 +2366 2356 8.33333333333333e+00 +2366 2352 4.16666666666667e+00 +2366 2353 -8.33333333333333e+00 +2366 2364 -1.66666666666667e+01 +2366 1932 -4.16666666666667e+00 +2366 2350 4.16666666666667e+00 +2366 2362 -4.16666666666667e+00 +2366 2397 -4.16666666666667e+00 +2366 2469 4.16666666666667e+00 +2366 2363 -1.25000000000000e+01 +2366 2349 -8.33333333333333e+00 +2366 2361 8.33333333333333e+00 +2366 2399 -1.25000000000000e+01 +2366 2398 8.33333333333333e+00 +2366 2470 -8.33333333333333e+00 +2366 2097 -4.16666666666667e+00 +2366 2358 4.16666666666667e+00 +2366 2098 8.33333333333333e+00 +2366 2365 -1.66666666666667e+01 +2366 2461 8.33333333333333e+00 +2366 2099 -1.25000000000000e+01 +2366 2359 4.16666666666667e+00 +2366 1933 -4.16666666666667e+00 +2366 2462 -3.75000000000000e+01 +2366 2460 8.33333333333333e+00 +2366 1650 4.16666666666667e+00 +2366 1618 -4.16666666666667e+00 +2366 1619 -1.25000000000000e+01 +2366 1617 8.33333333333333e+00 +2366 1362 -4.16666666666667e+00 +2366 1651 4.16666666666667e+00 +2366 1474 4.16666666666667e+00 +2366 1363 -4.16666666666667e+00 +2366 1473 -8.33333333333333e+00 +2367 2367 1.25000000000000e+02 +2367 2375 -4.16666666666667e+00 +2367 2389 -8.33333333333333e+00 +2367 2374 8.33333333333333e+00 +2367 2373 -1.25000000000000e+01 +2367 2300 -8.33333333333333e+00 +2367 2299 4.16666666666667e+00 +2367 2303 8.33333333333333e+00 +2367 2302 -4.16666666666667e+00 +2367 2301 -1.25000000000000e+01 +2367 2402 -4.16666666666667e+00 +2367 2384 4.16666666666667e+00 +2367 1937 8.33333333333333e+00 +2367 2369 -1.66666666666667e+01 +2367 2381 8.33333333333333e+00 +2367 2383 4.16666666666667e+00 +2367 2380 -4.16666666666667e+00 +2367 2379 -1.25000000000000e+01 +2367 1940 8.33333333333333e+00 +2367 2396 -8.33333333333333e+00 +2367 2401 -4.16666666666667e+00 +2367 2395 4.16666666666667e+00 +2367 2023 -4.16666666666667e+00 +2367 2026 4.16666666666667e+00 +2367 2336 4.16666666666667e+00 +2367 2024 -4.16666666666667e+00 +2367 1936 8.33333333333333e+00 +2367 2335 -8.33333333333333e+00 +2367 1935 -3.75000000000000e+01 +2367 2339 -4.16666666666667e+00 +2367 2027 4.16666666666667e+00 +2367 2368 -1.66666666666667e+01 +2367 2338 8.33333333333333e+00 +2367 1939 8.33333333333333e+00 +2367 2390 4.16666666666667e+00 +2367 2337 -1.25000000000000e+01 +2367 1938 -3.75000000000000e+01 +2368 2368 1.25000000000000e+02 +2368 2390 4.16666666666667e+00 +2368 2388 -8.33333333333333e+00 +2368 2374 -3.75000000000000e+01 +2368 2373 8.33333333333333e+00 +2368 2300 4.16666666666667e+00 +2368 2298 4.16666666666667e+00 +2368 2303 8.33333333333333e+00 +2368 2302 -1.25000000000000e+01 +2368 2301 -4.16666666666667e+00 +2368 2369 -1.66666666666667e+01 +2368 1940 -4.16666666666667e+00 +2368 1937 -4.16666666666667e+00 +2368 2396 4.16666666666667e+00 +2368 2402 -4.16666666666667e+00 +2368 2384 -8.33333333333333e+00 +2368 2381 8.33333333333333e+00 +2368 2380 -1.25000000000000e+01 +2368 2382 4.16666666666667e+00 +2368 2379 -4.16666666666667e+00 +2368 2400 -4.16666666666667e+00 +2368 2394 4.16666666666667e+00 +2368 2336 4.16666666666667e+00 +2368 2024 -4.16666666666667e+00 +2368 2022 -4.16666666666667e+00 +2368 2025 4.16666666666667e+00 +2368 1936 -1.25000000000000e+01 +2368 1935 8.33333333333333e+00 +2368 2334 -8.33333333333333e+00 +2368 2339 8.33333333333333e+00 +2368 2027 -8.33333333333333e+00 +2368 2375 8.33333333333333e+00 +2368 2338 -3.75000000000000e+01 +2368 1939 -1.25000000000000e+01 +2368 2367 -1.66666666666667e+01 +2368 2337 8.33333333333333e+00 +2368 1938 8.33333333333333e+00 +2369 2369 1.25000000000000e+02 +2369 2373 -4.16666666666667e+00 +2369 2374 8.33333333333333e+00 +2369 2389 4.16666666666667e+00 +2369 2375 -1.25000000000000e+01 +2369 2299 4.16666666666667e+00 +2369 2298 -8.33333333333333e+00 +2369 2303 -3.75000000000000e+01 +2369 2302 8.33333333333333e+00 +2369 2301 8.33333333333333e+00 +2369 2368 -1.66666666666667e+01 +2369 1939 -4.16666666666667e+00 +2369 1936 -4.16666666666667e+00 +2369 2395 4.16666666666667e+00 +2369 2401 -4.16666666666667e+00 +2369 2400 -4.16666666666667e+00 +2369 2382 4.16666666666667e+00 +2369 2381 -3.75000000000000e+01 +2369 2383 -8.33333333333333e+00 +2369 2380 8.33333333333333e+00 +2369 1935 8.33333333333333e+00 +2369 2367 -1.66666666666667e+01 +2369 2379 8.33333333333333e+00 +2369 1938 8.33333333333333e+00 +2369 2394 -8.33333333333333e+00 +2369 2335 4.16666666666667e+00 +2369 2023 -4.16666666666667e+00 +2369 1937 -1.25000000000000e+01 +2369 2334 4.16666666666667e+00 +2369 2022 -4.16666666666667e+00 +2369 2388 4.16666666666667e+00 +2369 2339 -1.25000000000000e+01 +2369 1940 -1.25000000000000e+01 +2369 2338 8.33333333333333e+00 +2369 2026 -8.33333333333333e+00 +2369 2337 -4.16666666666667e+00 +2369 2025 4.16666666666667e+00 +2370 2370 1.25000000000000e+02 +2370 2429 4.16666666666667e+00 +2370 2428 -8.33333333333333e+00 +2370 2374 8.33333333333333e+00 +2370 2373 -3.75000000000000e+01 +2370 2432 -4.16666666666667e+00 +2370 2431 -4.16666666666667e+00 +2370 2384 -8.33333333333333e+00 +2370 2383 4.16666666666667e+00 +2370 2300 4.16666666666667e+00 +2370 2309 8.33333333333333e+00 +2370 2308 -4.16666666666667e+00 +2370 2307 -1.25000000000000e+01 +2370 2299 4.16666666666667e+00 +2370 2203 4.16666666666667e+00 +2370 2194 -4.16666666666667e+00 +2370 2195 -4.16666666666667e+00 +2370 2204 -8.33333333333333e+00 +2370 2267 8.33333333333333e+00 +2370 2372 -1.66666666666667e+01 +2370 2120 8.33333333333333e+00 +2370 2125 4.16666666666667e+00 +2370 2119 -4.16666666666667e+00 +2370 1937 -4.16666666666667e+00 +2370 2261 4.16666666666667e+00 +2370 1936 8.33333333333333e+00 +2370 2260 -8.33333333333333e+00 +2370 1935 -1.25000000000000e+01 +2370 2118 -1.25000000000000e+01 +2370 1955 -4.16666666666667e+00 +2370 2126 4.16666666666667e+00 +2370 2371 -1.66666666666667e+01 +2370 1954 8.33333333333333e+00 +2370 2266 8.33333333333333e+00 +2370 2375 8.33333333333333e+00 +2370 1953 -1.25000000000000e+01 +2370 2265 -3.75000000000000e+01 +2371 2371 1.25000000000000e+02 +2371 2375 -4.16666666666667e+00 +2371 2427 -8.33333333333333e+00 +2371 2374 -1.25000000000000e+01 +2371 2373 8.33333333333333e+00 +2371 2432 -4.16666666666667e+00 +2371 2384 4.16666666666667e+00 +2371 2430 -4.16666666666667e+00 +2371 2382 4.16666666666667e+00 +2371 2309 8.33333333333333e+00 +2371 2308 -1.25000000000000e+01 +2371 2307 -4.16666666666667e+00 +2371 2300 -8.33333333333333e+00 +2371 2298 4.16666666666667e+00 +2371 2202 4.16666666666667e+00 +2371 2193 -4.16666666666667e+00 +2371 2204 4.16666666666667e+00 +2371 2195 -4.16666666666667e+00 +2371 2267 -4.16666666666667e+00 +2371 2261 4.16666666666667e+00 +2371 2124 4.16666666666667e+00 +2371 2118 -4.16666666666667e+00 +2371 1937 8.33333333333333e+00 +2371 2372 -1.66666666666667e+01 +2371 2120 8.33333333333333e+00 +2371 1936 -3.75000000000000e+01 +2371 2119 -1.25000000000000e+01 +2371 1935 8.33333333333333e+00 +2371 2259 -8.33333333333333e+00 +2371 1955 8.33333333333333e+00 +2371 2126 -8.33333333333333e+00 +2371 2429 4.16666666666667e+00 +2371 1954 -3.75000000000000e+01 +2371 2266 -1.25000000000000e+01 +2371 2370 -1.66666666666667e+01 +2371 1953 8.33333333333333e+00 +2371 2265 8.33333333333333e+00 +2372 2372 1.25000000000000e+02 +2372 2374 -4.16666666666667e+00 +2372 2373 8.33333333333333e+00 +2372 2427 4.16666666666667e+00 +2372 2375 -1.25000000000000e+01 +2372 2430 -4.16666666666667e+00 +2372 2431 -4.16666666666667e+00 +2372 2383 4.16666666666667e+00 +2372 2382 -8.33333333333333e+00 +2372 2298 4.16666666666667e+00 +2372 2309 -3.75000000000000e+01 +2372 2308 8.33333333333333e+00 +2372 2307 8.33333333333333e+00 +2372 2299 -8.33333333333333e+00 +2372 2193 -4.16666666666667e+00 +2372 2203 4.16666666666667e+00 +2372 2202 -8.33333333333333e+00 +2372 2194 -4.16666666666667e+00 +2372 2266 -4.16666666666667e+00 +2372 2260 4.16666666666667e+00 +2372 2265 8.33333333333333e+00 +2372 2370 -1.66666666666667e+01 +2372 2118 8.33333333333333e+00 +2372 1937 -1.25000000000000e+01 +2372 2120 -3.75000000000000e+01 +2372 1936 8.33333333333333e+00 +2372 2371 -1.66666666666667e+01 +2372 2119 8.33333333333333e+00 +2372 1935 -4.16666666666667e+00 +2372 2259 4.16666666666667e+00 +2372 2428 4.16666666666667e+00 +2372 1955 -1.25000000000000e+01 +2372 2267 -1.25000000000000e+01 +2372 1954 8.33333333333333e+00 +2372 2125 -8.33333333333333e+00 +2372 1953 -4.16666666666667e+00 +2372 2124 4.16666666666667e+00 +2373 2373 1.25000000000000e+02 +2373 2401 4.16666666666667e+00 +2373 2437 -4.16666666666667e+00 +2373 2432 4.16666666666667e+00 +2373 2438 -4.16666666666667e+00 +2373 2431 4.16666666666667e+00 +2373 2383 -4.16666666666667e+00 +2373 2384 8.33333333333333e+00 +2373 2382 -1.25000000000000e+01 +2373 2309 -8.33333333333333e+00 +2373 2372 8.33333333333333e+00 +2373 2308 4.16666666666667e+00 +2373 1958 4.16666666666667e+00 +2373 2429 -4.16666666666667e+00 +2373 2428 8.33333333333333e+00 +2373 2427 -1.25000000000000e+01 +2373 1937 4.16666666666667e+00 +2373 2371 8.33333333333333e+00 +2373 2370 -3.75000000000000e+01 +2373 2369 -4.16666666666667e+00 +2373 2374 -1.66666666666667e+01 +2373 2311 -4.16666666666667e+00 +2373 2303 4.16666666666667e+00 +2373 2300 -4.16666666666667e+00 +2373 2302 4.16666666666667e+00 +2373 2299 -4.16666666666667e+00 +2373 2312 8.33333333333333e+00 +2373 2390 8.33333333333333e+00 +2373 2375 -1.66666666666667e+01 +2373 1957 -8.33333333333333e+00 +2373 2389 8.33333333333333e+00 +2373 2310 -1.25000000000000e+01 +2373 2388 -3.75000000000000e+01 +2373 2368 8.33333333333333e+00 +2373 1936 -8.33333333333333e+00 +2373 2402 -8.33333333333333e+00 +2373 2367 -1.25000000000000e+01 +2374 2374 1.25000000000000e+02 +2374 2400 4.16666666666667e+00 +2374 2436 -4.16666666666667e+00 +2374 2432 -8.33333333333333e+00 +2374 2384 8.33333333333333e+00 +2374 2430 4.16666666666667e+00 +2374 2382 -4.16666666666667e+00 +2374 2438 -4.16666666666667e+00 +2374 2383 -1.25000000000000e+01 +2374 2309 4.16666666666667e+00 +2374 2372 -4.16666666666667e+00 +2374 2307 4.16666666666667e+00 +2374 2429 8.33333333333333e+00 +2374 2375 -1.66666666666667e+01 +2374 2428 -3.75000000000000e+01 +2374 2427 8.33333333333333e+00 +2374 2371 -1.25000000000000e+01 +2374 2370 8.33333333333333e+00 +2374 2373 -1.66666666666667e+01 +2374 2310 -4.16666666666667e+00 +2374 2312 8.33333333333333e+00 +2374 2303 -8.33333333333333e+00 +2374 2369 8.33333333333333e+00 +2374 2301 4.16666666666667e+00 +2374 2298 -4.16666666666667e+00 +2374 1958 4.16666666666667e+00 +2374 2390 -4.16666666666667e+00 +2374 2311 -1.25000000000000e+01 +2374 2389 -1.25000000000000e+01 +2374 1956 -8.33333333333333e+00 +2374 2388 8.33333333333333e+00 +2374 2300 -4.16666666666667e+00 +2374 1937 4.16666666666667e+00 +2374 2402 4.16666666666667e+00 +2374 2368 -3.75000000000000e+01 +2374 2367 8.33333333333333e+00 +2374 1935 -8.33333333333333e+00 +2375 2375 1.25000000000000e+02 +2375 2400 -8.33333333333333e+00 +2375 2430 4.16666666666667e+00 +2375 2436 -4.16666666666667e+00 +2375 2431 -8.33333333333333e+00 +2375 2383 8.33333333333333e+00 +2375 2437 -4.16666666666667e+00 +2375 2384 -3.75000000000000e+01 +2375 2382 8.33333333333333e+00 +2375 2308 4.16666666666667e+00 +2375 2371 -4.16666666666667e+00 +2375 2307 -8.33333333333333e+00 +2375 2370 8.33333333333333e+00 +2375 2429 -1.25000000000000e+01 +2375 2428 8.33333333333333e+00 +2375 2374 -1.66666666666667e+01 +2375 1956 4.16666666666667e+00 +2375 2427 -4.16666666666667e+00 +2375 2372 -1.25000000000000e+01 +2375 1935 4.16666666666667e+00 +2375 2367 -4.16666666666667e+00 +2375 2311 8.33333333333333e+00 +2375 2301 4.16666666666667e+00 +2375 2298 -4.16666666666667e+00 +2375 2302 -8.33333333333333e+00 +2375 2368 8.33333333333333e+00 +2375 2312 -3.75000000000000e+01 +2375 2390 -1.25000000000000e+01 +2375 1957 4.16666666666667e+00 +2375 2389 -4.16666666666667e+00 +2375 2310 8.33333333333333e+00 +2375 2388 8.33333333333333e+00 +2375 2373 -1.66666666666667e+01 +2375 2401 4.16666666666667e+00 +2375 2369 -1.25000000000000e+01 +2375 2299 -4.16666666666667e+00 +2375 1936 4.16666666666667e+00 +2376 2376 1.25000000000000e+02 +2376 2465 -8.33333333333333e+00 +2376 2381 8.33333333333333e+00 +2376 2380 8.33333333333333e+00 +2376 2379 -3.75000000000000e+01 +2376 2467 -4.16666666666667e+00 +2376 2468 -4.16666666666667e+00 +2376 2384 4.16666666666667e+00 +2376 2383 -8.33333333333333e+00 +2376 2335 4.16666666666667e+00 +2376 2230 -4.16666666666667e+00 +2376 2345 -4.16666666666667e+00 +2376 2240 4.16666666666667e+00 +2376 2344 8.33333333333333e+00 +2376 2239 -8.33333333333333e+00 +2376 2343 -1.25000000000000e+01 +2376 2336 4.16666666666667e+00 +2376 2231 -4.16666666666667e+00 +2376 2132 4.16666666666667e+00 +2376 2120 -4.16666666666667e+00 +2376 2377 -1.66666666666667e+01 +2376 2119 8.33333333333333e+00 +2376 2272 8.33333333333333e+00 +2376 1937 8.33333333333333e+00 +2376 2261 -8.33333333333333e+00 +2376 1936 -4.16666666666667e+00 +2376 2260 4.16666666666667e+00 +2376 1935 -1.25000000000000e+01 +2376 2118 -1.25000000000000e+01 +2376 2378 -1.66666666666667e+01 +2376 1973 8.33333333333333e+00 +2376 2273 8.33333333333333e+00 +2376 1972 -4.16666666666667e+00 +2376 2131 4.16666666666667e+00 +2376 2464 4.16666666666667e+00 +2376 1971 -1.25000000000000e+01 +2376 2271 -3.75000000000000e+01 +2377 2377 1.25000000000000e+02 +2377 2465 4.16666666666667e+00 +2377 2381 -4.16666666666667e+00 +2377 2380 -1.25000000000000e+01 +2377 2379 8.33333333333333e+00 +2377 2384 4.16666666666667e+00 +2377 2468 -4.16666666666667e+00 +2377 2466 -4.16666666666667e+00 +2377 2382 -8.33333333333333e+00 +2377 2334 4.16666666666667e+00 +2377 2229 -4.16666666666667e+00 +2377 2240 4.16666666666667e+00 +2377 2231 -4.16666666666667e+00 +2377 2345 8.33333333333333e+00 +2377 2344 -3.75000000000000e+01 +2377 2343 8.33333333333333e+00 +2377 2238 -8.33333333333333e+00 +2377 2336 -8.33333333333333e+00 +2377 2261 4.16666666666667e+00 +2377 2273 -4.16666666666667e+00 +2377 2376 -1.66666666666667e+01 +2377 2118 8.33333333333333e+00 +2377 2271 8.33333333333333e+00 +2377 1937 8.33333333333333e+00 +2377 2378 -1.66666666666667e+01 +2377 2120 8.33333333333333e+00 +2377 1936 -1.25000000000000e+01 +2377 2119 -3.75000000000000e+01 +2377 1935 -4.16666666666667e+00 +2377 2259 4.16666666666667e+00 +2377 1973 8.33333333333333e+00 +2377 2132 -8.33333333333333e+00 +2377 2463 4.16666666666667e+00 +2377 1972 -1.25000000000000e+01 +2377 2272 -1.25000000000000e+01 +2377 1971 -4.16666666666667e+00 +2377 2130 4.16666666666667e+00 +2378 2378 1.25000000000000e+02 +2378 2463 -8.33333333333333e+00 +2378 2381 -1.25000000000000e+01 +2378 2380 -4.16666666666667e+00 +2378 2379 8.33333333333333e+00 +2378 2383 4.16666666666667e+00 +2378 2467 -4.16666666666667e+00 +2378 2466 -4.16666666666667e+00 +2378 2382 4.16666666666667e+00 +2378 2239 4.16666666666667e+00 +2378 2230 -4.16666666666667e+00 +2378 2345 -1.25000000000000e+01 +2378 2344 8.33333333333333e+00 +2378 2343 -4.16666666666667e+00 +2378 2238 4.16666666666667e+00 +2378 2335 -8.33333333333333e+00 +2378 2334 4.16666666666667e+00 +2378 2229 -4.16666666666667e+00 +2378 2130 4.16666666666667e+00 +2378 2118 -4.16666666666667e+00 +2378 2260 4.16666666666667e+00 +2378 2272 -4.16666666666667e+00 +2378 1937 -3.75000000000000e+01 +2378 2120 -1.25000000000000e+01 +2378 1936 8.33333333333333e+00 +2378 2377 -1.66666666666667e+01 +2378 2119 8.33333333333333e+00 +2378 1935 8.33333333333333e+00 +2378 2259 -8.33333333333333e+00 +2378 2464 4.16666666666667e+00 +2378 1973 -3.75000000000000e+01 +2378 2273 -1.25000000000000e+01 +2378 1972 8.33333333333333e+00 +2378 2131 -8.33333333333333e+00 +2378 2376 -1.66666666666667e+01 +2378 1971 8.33333333333333e+00 +2378 2271 8.33333333333333e+00 +2379 2379 1.25000000000000e+02 +2379 2339 4.16666666666667e+00 +2379 2336 -4.16666666666667e+00 +2379 2348 -4.16666666666667e+00 +2379 2345 4.16666666666667e+00 +2379 2347 8.33333333333333e+00 +2379 2344 -8.33333333333333e+00 +2379 2335 -4.16666666666667e+00 +2379 2346 -1.25000000000000e+01 +2379 2467 4.16666666666667e+00 +2379 2464 -4.16666666666667e+00 +2379 2468 4.16666666666667e+00 +2379 2378 8.33333333333333e+00 +2379 2377 8.33333333333333e+00 +2379 2380 -1.66666666666667e+01 +2379 2376 -3.75000000000000e+01 +2379 2465 8.33333333333333e+00 +2379 2463 -1.25000000000000e+01 +2379 2381 -1.66666666666667e+01 +2379 2384 -4.16666666666667e+00 +2379 2383 8.33333333333333e+00 +2379 2474 -4.16666666666667e+00 +2379 2402 4.16666666666667e+00 +2379 2401 -8.33333333333333e+00 +2379 2395 8.33333333333333e+00 +2379 1937 -8.33333333333333e+00 +2379 2369 8.33333333333333e+00 +2379 1936 4.16666666666667e+00 +2379 2368 -4.16666666666667e+00 +2379 2382 -1.25000000000000e+01 +2379 2367 -1.25000000000000e+01 +2379 2396 8.33333333333333e+00 +2379 1976 -8.33333333333333e+00 +2379 2473 -4.16666666666667e+00 +2379 1975 4.16666666666667e+00 +2379 2338 4.16666666666667e+00 +2379 2394 -3.75000000000000e+01 +2380 2380 1.25000000000000e+02 +2380 2339 -8.33333333333333e+00 +2380 2336 -4.16666666666667e+00 +2380 2345 4.16666666666667e+00 +2380 2346 8.33333333333333e+00 +2380 2343 -8.33333333333333e+00 +2380 2334 -4.16666666666667e+00 +2380 2348 8.33333333333333e+00 +2380 2347 -3.75000000000000e+01 +2380 2466 4.16666666666667e+00 +2380 2463 -4.16666666666667e+00 +2380 2465 8.33333333333333e+00 +2380 2468 -8.33333333333333e+00 +2380 2378 -4.16666666666667e+00 +2380 1937 4.16666666666667e+00 +2380 2377 -1.25000000000000e+01 +2380 2376 8.33333333333333e+00 +2380 2379 -1.66666666666667e+01 +2380 1976 4.16666666666667e+00 +2380 2464 -1.25000000000000e+01 +2380 2396 -4.16666666666667e+00 +2380 2402 4.16666666666667e+00 +2380 2474 -4.16666666666667e+00 +2380 2382 8.33333333333333e+00 +2380 2400 -8.33333333333333e+00 +2380 2394 8.33333333333333e+00 +2380 2384 8.33333333333333e+00 +2380 2369 8.33333333333333e+00 +2380 2381 -1.66666666666667e+01 +2380 2383 -3.75000000000000e+01 +2380 2368 -1.25000000000000e+01 +2380 1935 4.16666666666667e+00 +2380 2367 -4.16666666666667e+00 +2380 2337 4.16666666666667e+00 +2380 2395 -1.25000000000000e+01 +2380 2472 -4.16666666666667e+00 +2380 1974 4.16666666666667e+00 +2381 2381 1.25000000000000e+02 +2381 2337 4.16666666666667e+00 +2381 2334 -4.16666666666667e+00 +2381 2335 -4.16666666666667e+00 +2381 2344 4.16666666666667e+00 +2381 2346 -4.16666666666667e+00 +2381 2343 4.16666666666667e+00 +2381 2348 -1.25000000000000e+01 +2381 2347 8.33333333333333e+00 +2381 2464 8.33333333333333e+00 +2381 2467 -8.33333333333333e+00 +2381 2466 4.16666666666667e+00 +2381 2378 -1.25000000000000e+01 +2381 2377 -4.16666666666667e+00 +2381 1936 4.16666666666667e+00 +2381 2376 8.33333333333333e+00 +2381 2465 -3.75000000000000e+01 +2381 1975 4.16666666666667e+00 +2381 2463 8.33333333333333e+00 +2381 2395 -4.16666666666667e+00 +2381 2379 -1.66666666666667e+01 +2381 2382 -4.16666666666667e+00 +2381 2401 4.16666666666667e+00 +2381 2473 -4.16666666666667e+00 +2381 2472 -4.16666666666667e+00 +2381 2400 4.16666666666667e+00 +2381 2384 -1.25000000000000e+01 +2381 2369 -3.75000000000000e+01 +2381 2383 8.33333333333333e+00 +2381 2368 8.33333333333333e+00 +2381 2380 -1.66666666666667e+01 +2381 1935 -8.33333333333333e+00 +2381 2367 8.33333333333333e+00 +2381 2338 -8.33333333333333e+00 +2381 2396 -1.25000000000000e+01 +2381 2394 8.33333333333333e+00 +2381 1974 -8.33333333333333e+00 +2382 2382 1.25000000000000e+02 +2382 2374 -4.16666666666667e+00 +2382 2437 -8.33333333333333e+00 +2382 2375 8.33333333333333e+00 +2382 2373 -1.25000000000000e+01 +2382 2432 -4.16666666666667e+00 +2382 2431 8.33333333333333e+00 +2382 2430 -1.25000000000000e+01 +2382 2372 -8.33333333333333e+00 +2382 2371 4.16666666666667e+00 +2382 2369 4.16666666666667e+00 +2382 2381 -4.16666666666667e+00 +2382 2383 -1.66666666666667e+01 +2382 2401 8.33333333333333e+00 +2382 2380 8.33333333333333e+00 +2382 2402 8.33333333333333e+00 +2382 2474 -8.33333333333333e+00 +2382 1981 -4.16666666666667e+00 +2382 2473 4.16666666666667e+00 +2382 2400 -3.75000000000000e+01 +2382 1936 -4.16666666666667e+00 +2382 2368 4.16666666666667e+00 +2382 2379 -1.25000000000000e+01 +2382 2120 8.33333333333333e+00 +2382 2384 -1.66666666666667e+01 +2382 2468 8.33333333333333e+00 +2382 2137 4.16666666666667e+00 +2382 2467 -4.16666666666667e+00 +2382 2378 4.16666666666667e+00 +2382 1937 -4.16666666666667e+00 +2382 2119 8.33333333333333e+00 +2382 2377 -8.33333333333333e+00 +2382 2118 -3.75000000000000e+01 +2382 2138 4.16666666666667e+00 +2382 1982 -4.16666666666667e+00 +2382 2466 -1.25000000000000e+01 +2382 2438 4.16666666666667e+00 +2383 2383 1.25000000000000e+02 +2383 2373 -4.16666666666667e+00 +2383 2438 4.16666666666667e+00 +2383 2436 -8.33333333333333e+00 +2383 2374 -1.25000000000000e+01 +2383 2372 4.16666666666667e+00 +2383 2430 8.33333333333333e+00 +2383 2432 8.33333333333333e+00 +2383 2431 -3.75000000000000e+01 +2383 2370 4.16666666666667e+00 +2383 2384 -1.66666666666667e+01 +2383 1937 -4.16666666666667e+00 +2383 1982 -4.16666666666667e+00 +2383 2402 -4.16666666666667e+00 +2383 2474 4.16666666666667e+00 +2383 2382 -1.66666666666667e+01 +2383 2400 8.33333333333333e+00 +2383 2379 8.33333333333333e+00 +2383 2401 -1.25000000000000e+01 +2383 1980 -4.16666666666667e+00 +2383 2472 4.16666666666667e+00 +2383 2369 -8.33333333333333e+00 +2383 2381 8.33333333333333e+00 +2383 2380 -3.75000000000000e+01 +2383 1935 -4.16666666666667e+00 +2383 2367 4.16666666666667e+00 +2383 2120 -4.16666666666667e+00 +2383 2378 4.16666666666667e+00 +2383 2136 4.16666666666667e+00 +2383 2466 -4.16666666666667e+00 +2383 2119 -1.25000000000000e+01 +2383 2118 8.33333333333333e+00 +2383 2376 -8.33333333333333e+00 +2383 2138 -8.33333333333333e+00 +2383 2468 8.33333333333333e+00 +2383 2467 -1.25000000000000e+01 +2383 2375 8.33333333333333e+00 +2384 2384 1.25000000000000e+02 +2384 2374 8.33333333333333e+00 +2384 2437 4.16666666666667e+00 +2384 2375 -3.75000000000000e+01 +2384 2373 8.33333333333333e+00 +2384 2430 -4.16666666666667e+00 +2384 2371 4.16666666666667e+00 +2384 2432 -1.25000000000000e+01 +2384 2431 8.33333333333333e+00 +2384 2370 -8.33333333333333e+00 +2384 2383 -1.66666666666667e+01 +2384 1936 -4.16666666666667e+00 +2384 1981 -4.16666666666667e+00 +2384 2367 4.16666666666667e+00 +2384 2379 -4.16666666666667e+00 +2384 2401 -4.16666666666667e+00 +2384 2473 4.16666666666667e+00 +2384 2402 -1.25000000000000e+01 +2384 2400 8.33333333333333e+00 +2384 2472 -8.33333333333333e+00 +2384 2381 -1.25000000000000e+01 +2384 2368 -8.33333333333333e+00 +2384 2380 8.33333333333333e+00 +2384 2119 -4.16666666666667e+00 +2384 2377 4.16666666666667e+00 +2384 2118 8.33333333333333e+00 +2384 2382 -1.66666666666667e+01 +2384 2466 8.33333333333333e+00 +2384 2120 -1.25000000000000e+01 +2384 2376 4.16666666666667e+00 +2384 1935 -4.16666666666667e+00 +2384 2468 -3.75000000000000e+01 +2384 2436 4.16666666666667e+00 +2384 2137 -8.33333333333333e+00 +2384 2467 8.33333333333333e+00 +2384 2136 4.16666666666667e+00 +2384 1980 -4.16666666666667e+00 +2385 2385 1.25000000000000e+02 +2385 2320 -4.16666666666667e+00 +2385 2315 -8.33333333333333e+00 +2385 2321 8.33333333333333e+00 +2385 2319 -1.25000000000000e+01 +2385 2393 -4.16666666666667e+00 +2385 2392 8.33333333333333e+00 +2385 2391 -1.25000000000000e+01 +2385 2284 -4.16666666666667e+00 +2385 2293 4.16666666666667e+00 +2385 2294 4.16666666666667e+00 +2385 2357 -4.16666666666667e+00 +2385 2386 -1.66666666666667e+01 +2385 2356 8.33333333333333e+00 +2385 2355 -1.25000000000000e+01 +2385 2285 -4.16666666666667e+00 +2385 2351 4.16666666666667e+00 +2385 1939 8.33333333333333e+00 +2385 2350 -8.33333333333333e+00 +2385 2141 4.16666666666667e+00 +2385 2387 -1.66666666666667e+01 +2385 2399 8.33333333333333e+00 +2385 1940 8.33333333333333e+00 +2385 2398 -4.16666666666667e+00 +2385 2140 4.16666666666667e+00 +2385 2314 4.16666666666667e+00 +2385 2397 -1.25000000000000e+01 +2385 1938 -3.75000000000000e+01 +2385 1646 4.16666666666667e+00 +2385 1645 -8.33333333333333e+00 +2385 1315 8.33333333333333e+00 +2385 1505 -4.16666666666667e+00 +2385 1316 8.33333333333333e+00 +2385 1652 -8.33333333333333e+00 +2385 1651 4.16666666666667e+00 +2385 1504 -4.16666666666667e+00 +2385 1314 -3.75000000000000e+01 +2386 2386 1.25000000000000e+02 +2386 2319 -4.16666666666667e+00 +2386 2321 8.33333333333333e+00 +2386 2315 4.16666666666667e+00 +2386 2320 -1.25000000000000e+01 +2386 2393 8.33333333333333e+00 +2386 2392 -3.75000000000000e+01 +2386 2391 8.33333333333333e+00 +2386 2387 -1.66666666666667e+01 +2386 1940 -4.16666666666667e+00 +2386 2351 4.16666666666667e+00 +2386 2285 -4.16666666666667e+00 +2386 2283 -4.16666666666667e+00 +2386 2292 4.16666666666667e+00 +2386 2294 -8.33333333333333e+00 +2386 2357 8.33333333333333e+00 +2386 2356 -3.75000000000000e+01 +2386 2385 -1.66666666666667e+01 +2386 2355 8.33333333333333e+00 +2386 1938 8.33333333333333e+00 +2386 2349 -8.33333333333333e+00 +2386 2399 8.33333333333333e+00 +2386 2141 -8.33333333333333e+00 +2386 2313 4.16666666666667e+00 +2386 2398 -1.25000000000000e+01 +2386 1939 -1.25000000000000e+01 +2386 2397 -4.16666666666667e+00 +2386 2139 4.16666666666667e+00 +2386 1646 4.16666666666667e+00 +2386 1644 -8.33333333333333e+00 +2386 1316 -4.16666666666667e+00 +2386 1314 8.33333333333333e+00 +2386 1652 4.16666666666667e+00 +2386 1505 -4.16666666666667e+00 +2386 1315 -1.25000000000000e+01 +2386 1650 4.16666666666667e+00 +2386 1503 -4.16666666666667e+00 +2387 2387 1.25000000000000e+02 +2387 2314 4.16666666666667e+00 +2387 2313 -8.33333333333333e+00 +2387 2321 -3.75000000000000e+01 +2387 2319 8.33333333333333e+00 +2387 2393 -1.25000000000000e+01 +2387 2392 8.33333333333333e+00 +2387 2391 -4.16666666666667e+00 +2387 2386 -1.66666666666667e+01 +2387 1939 -4.16666666666667e+00 +2387 2350 4.16666666666667e+00 +2387 2284 -4.16666666666667e+00 +2387 2357 -1.25000000000000e+01 +2387 2293 -8.33333333333333e+00 +2387 2356 8.33333333333333e+00 +2387 2292 4.16666666666667e+00 +2387 2355 -4.16666666666667e+00 +2387 2283 -4.16666666666667e+00 +2387 2349 4.16666666666667e+00 +2387 2139 4.16666666666667e+00 +2387 2320 8.33333333333333e+00 +2387 2399 -3.75000000000000e+01 +2387 1940 -1.25000000000000e+01 +2387 2398 8.33333333333333e+00 +2387 2140 -8.33333333333333e+00 +2387 2385 -1.66666666666667e+01 +2387 2397 8.33333333333333e+00 +2387 1938 8.33333333333333e+00 +2387 1645 4.16666666666667e+00 +2387 1644 4.16666666666667e+00 +2387 1315 -4.16666666666667e+00 +2387 1651 4.16666666666667e+00 +2387 1504 -4.16666666666667e+00 +2387 1503 -4.16666666666667e+00 +2387 1316 -1.25000000000000e+01 +2387 1314 8.33333333333333e+00 +2387 1650 -8.33333333333333e+00 +2388 2388 1.25000000000000e+02 +2388 2326 -4.16666666666667e+00 +2388 2327 8.33333333333333e+00 +2388 2315 4.16666666666667e+00 +2388 2325 -1.25000000000000e+01 +2388 2435 4.16666666666667e+00 +2388 2434 -8.33333333333333e+00 +2388 2393 8.33333333333333e+00 +2388 2392 8.33333333333333e+00 +2388 2391 -3.75000000000000e+01 +2388 2390 -1.66666666666667e+01 +2388 1958 -4.16666666666667e+00 +2388 1940 -4.16666666666667e+00 +2388 2303 -4.16666666666667e+00 +2388 2369 4.16666666666667e+00 +2388 2302 -4.16666666666667e+00 +2388 2311 4.16666666666667e+00 +2388 2312 -8.33333333333333e+00 +2388 2375 8.33333333333333e+00 +2388 1957 8.33333333333333e+00 +2388 2389 -1.66666666666667e+01 +2388 2374 8.33333333333333e+00 +2388 2373 -3.75000000000000e+01 +2388 1939 8.33333333333333e+00 +2388 2368 -8.33333333333333e+00 +2388 2144 -4.16666666666667e+00 +2388 2438 4.16666666666667e+00 +2388 2437 4.16666666666667e+00 +2388 2143 -4.16666666666667e+00 +2388 1956 -1.25000000000000e+01 +2388 2402 8.33333333333333e+00 +2388 2141 -8.33333333333333e+00 +2388 2401 -4.16666666666667e+00 +2388 2140 4.16666666666667e+00 +2388 2400 -1.25000000000000e+01 +2388 2314 4.16666666666667e+00 +2388 1938 -1.25000000000000e+01 +2389 2389 1.25000000000000e+02 +2389 2325 -4.16666666666667e+00 +2389 2315 -8.33333333333333e+00 +2389 2327 8.33333333333333e+00 +2389 2326 -1.25000000000000e+01 +2389 2435 4.16666666666667e+00 +2389 2433 -8.33333333333333e+00 +2389 2393 -4.16666666666667e+00 +2389 2392 -1.25000000000000e+01 +2389 2391 8.33333333333333e+00 +2389 2301 -4.16666666666667e+00 +2389 2310 4.16666666666667e+00 +2389 2312 4.16666666666667e+00 +2389 2375 -4.16666666666667e+00 +2389 2374 -1.25000000000000e+01 +2389 1956 8.33333333333333e+00 +2389 2388 -1.66666666666667e+01 +2389 2373 8.33333333333333e+00 +2389 2303 -4.16666666666667e+00 +2389 2369 4.16666666666667e+00 +2389 1938 8.33333333333333e+00 +2389 2367 -8.33333333333333e+00 +2389 2144 -4.16666666666667e+00 +2389 2141 4.16666666666667e+00 +2389 2438 -8.33333333333333e+00 +2389 1958 8.33333333333333e+00 +2389 1957 -3.75000000000000e+01 +2389 2436 4.16666666666667e+00 +2389 2142 -4.16666666666667e+00 +2389 2402 8.33333333333333e+00 +2389 2390 -1.66666666666667e+01 +2389 1940 8.33333333333333e+00 +2389 2401 -1.25000000000000e+01 +2389 2313 4.16666666666667e+00 +2389 1939 -3.75000000000000e+01 +2389 2400 -4.16666666666667e+00 +2389 2139 4.16666666666667e+00 +2390 2390 1.25000000000000e+02 +2390 2314 -8.33333333333333e+00 +2390 2313 4.16666666666667e+00 +2390 2327 -3.75000000000000e+01 +2390 2326 8.33333333333333e+00 +2390 2433 4.16666666666667e+00 +2390 2434 4.16666666666667e+00 +2390 2393 -1.25000000000000e+01 +2390 2392 -4.16666666666667e+00 +2390 2391 8.33333333333333e+00 +2390 2388 -1.66666666666667e+01 +2390 1956 -4.16666666666667e+00 +2390 1938 -4.16666666666667e+00 +2390 2301 -4.16666666666667e+00 +2390 2367 4.16666666666667e+00 +2390 2375 -1.25000000000000e+01 +2390 2311 4.16666666666667e+00 +2390 2374 -4.16666666666667e+00 +2390 2310 -8.33333333333333e+00 +2390 2373 8.33333333333333e+00 +2390 2302 -4.16666666666667e+00 +2390 2368 4.16666666666667e+00 +2390 2142 -4.16666666666667e+00 +2390 2436 4.16666666666667e+00 +2390 2143 -4.16666666666667e+00 +2390 2140 4.16666666666667e+00 +2390 1958 -1.25000000000000e+01 +2390 2437 -8.33333333333333e+00 +2390 1957 8.33333333333333e+00 +2390 2402 -3.75000000000000e+01 +2390 2325 8.33333333333333e+00 +2390 1940 -1.25000000000000e+01 +2390 2401 8.33333333333333e+00 +2390 2389 -1.66666666666667e+01 +2390 1939 8.33333333333333e+00 +2390 2400 8.33333333333333e+00 +2390 2139 -8.33333333333333e+00 +2391 2391 1.25000000000000e+02 +2391 2327 -8.33333333333333e+00 +2391 2435 -4.16666666666667e+00 +2391 2143 4.16666666666667e+00 +2391 2144 4.16666666666667e+00 +2391 2434 8.33333333333333e+00 +2391 2433 -1.25000000000000e+01 +2391 2390 8.33333333333333e+00 +2391 2389 8.33333333333333e+00 +2391 2388 -3.75000000000000e+01 +2391 2314 -4.16666666666667e+00 +2391 2315 -4.16666666666667e+00 +2391 2329 -4.16666666666667e+00 +2391 2320 4.16666666666667e+00 +2391 2321 4.16666666666667e+00 +2391 2330 8.33333333333333e+00 +2391 2393 -1.66666666666667e+01 +2391 2328 -1.25000000000000e+01 +2391 2140 -4.16666666666667e+00 +2391 2392 -1.66666666666667e+01 +2391 2141 8.33333333333333e+00 +2391 2387 -4.16666666666667e+00 +2391 1940 4.16666666666667e+00 +2391 2386 8.33333333333333e+00 +2391 1939 -8.33333333333333e+00 +2391 2385 -1.25000000000000e+01 +2391 2326 4.16666666666667e+00 +2391 2139 -1.25000000000000e+01 +2391 1646 8.33333333333333e+00 +2391 1507 -4.16666666666667e+00 +2391 1504 4.16666666666667e+00 +2391 1505 -8.33333333333333e+00 +2391 1346 4.16666666666667e+00 +2391 1508 -4.16666666666667e+00 +2391 1645 8.33333333333333e+00 +2391 1345 -8.33333333333333e+00 +2391 1644 -3.75000000000000e+01 +2392 2392 1.25000000000000e+02 +2392 2327 4.16666666666667e+00 +2392 2435 8.33333333333333e+00 +2392 2142 4.16666666666667e+00 +2392 2144 -8.33333333333333e+00 +2392 2434 -3.75000000000000e+01 +2392 2433 8.33333333333333e+00 +2392 2390 -4.16666666666667e+00 +2392 2389 -1.25000000000000e+01 +2392 2388 8.33333333333333e+00 +2392 2313 -4.16666666666667e+00 +2392 2330 8.33333333333333e+00 +2392 2328 -4.16666666666667e+00 +2392 2319 4.16666666666667e+00 +2392 2321 -8.33333333333333e+00 +2392 2329 -1.25000000000000e+01 +2392 2315 -4.16666666666667e+00 +2392 1940 4.16666666666667e+00 +2392 2139 -4.16666666666667e+00 +2392 2391 -1.66666666666667e+01 +2392 2387 8.33333333333333e+00 +2392 2393 -1.66666666666667e+01 +2392 2141 8.33333333333333e+00 +2392 2386 -3.75000000000000e+01 +2392 2325 4.16666666666667e+00 +2392 2140 -1.25000000000000e+01 +2392 2385 8.33333333333333e+00 +2392 1938 -8.33333333333333e+00 +2392 1346 4.16666666666667e+00 +2392 1646 -4.16666666666667e+00 +2392 1506 -4.16666666666667e+00 +2392 1503 4.16666666666667e+00 +2392 1508 -4.16666666666667e+00 +2392 1505 4.16666666666667e+00 +2392 1645 -1.25000000000000e+01 +2392 1644 8.33333333333333e+00 +2392 1344 -8.33333333333333e+00 +2393 2393 1.25000000000000e+02 +2393 2325 -8.33333333333333e+00 +2393 2433 -4.16666666666667e+00 +2393 2434 8.33333333333333e+00 +2393 2143 -8.33333333333333e+00 +2393 2142 4.16666666666667e+00 +2393 2435 -1.25000000000000e+01 +2393 2390 -1.25000000000000e+01 +2393 2389 -4.16666666666667e+00 +2393 2388 8.33333333333333e+00 +2393 2313 -4.16666666666667e+00 +2393 2329 8.33333333333333e+00 +2393 2320 -8.33333333333333e+00 +2393 2319 4.16666666666667e+00 +2393 2330 -3.75000000000000e+01 +2393 2328 8.33333333333333e+00 +2393 2391 -1.66666666666667e+01 +2393 2314 -4.16666666666667e+00 +2393 1939 4.16666666666667e+00 +2393 2139 8.33333333333333e+00 +2393 2387 -1.25000000000000e+01 +2393 2326 4.16666666666667e+00 +2393 2141 -3.75000000000000e+01 +2393 2386 8.33333333333333e+00 +2393 2392 -1.66666666666667e+01 +2393 2140 8.33333333333333e+00 +2393 2385 -4.16666666666667e+00 +2393 1938 4.16666666666667e+00 +2393 1345 4.16666666666667e+00 +2393 1645 -4.16666666666667e+00 +2393 1644 8.33333333333333e+00 +2393 1507 -4.16666666666667e+00 +2393 1504 4.16666666666667e+00 +2393 1503 -8.33333333333333e+00 +2393 1646 -1.25000000000000e+01 +2393 1344 4.16666666666667e+00 +2393 1506 -4.16666666666667e+00 +2394 2394 1.25000000000000e+02 +2394 2369 -8.33333333333333e+00 +2394 2368 4.16666666666667e+00 +2394 2381 8.33333333333333e+00 +2394 2379 -3.75000000000000e+01 +2394 2473 4.16666666666667e+00 +2394 2474 4.16666666666667e+00 +2394 2402 -4.16666666666667e+00 +2394 2401 8.33333333333333e+00 +2394 2400 -1.25000000000000e+01 +2394 2338 -4.16666666666667e+00 +2394 2339 -4.16666666666667e+00 +2394 2348 4.16666666666667e+00 +2394 2347 -8.33333333333333e+00 +2394 2351 4.16666666666667e+00 +2394 2363 -4.16666666666667e+00 +2394 2395 -1.66666666666667e+01 +2394 2362 8.33333333333333e+00 +2394 2350 4.16666666666667e+00 +2394 1939 -4.16666666666667e+00 +2394 1975 -4.16666666666667e+00 +2394 2361 -1.25000000000000e+01 +2394 2141 4.16666666666667e+00 +2394 2147 -4.16666666666667e+00 +2394 2470 4.16666666666667e+00 +2394 2146 -4.16666666666667e+00 +2394 1976 8.33333333333333e+00 +2394 2471 -8.33333333333333e+00 +2394 1974 -1.25000000000000e+01 +2394 2396 -1.66666666666667e+01 +2394 2399 8.33333333333333e+00 +2394 1940 8.33333333333333e+00 +2394 2398 8.33333333333333e+00 +2394 2140 -8.33333333333333e+00 +2394 2380 8.33333333333333e+00 +2394 2397 -3.75000000000000e+01 +2394 1938 -1.25000000000000e+01 +2395 2395 1.25000000000000e+02 +2395 2381 -4.16666666666667e+00 +2395 2379 8.33333333333333e+00 +2395 2367 4.16666666666667e+00 +2395 2380 -1.25000000000000e+01 +2395 2472 4.16666666666667e+00 +2395 2474 -8.33333333333333e+00 +2395 2402 8.33333333333333e+00 +2395 2401 -3.75000000000000e+01 +2395 2400 8.33333333333333e+00 +2395 2337 -4.16666666666667e+00 +2395 2339 -4.16666666666667e+00 +2395 2348 4.16666666666667e+00 +2395 2346 -8.33333333333333e+00 +2395 2394 -1.66666666666667e+01 +2395 2361 8.33333333333333e+00 +2395 2351 -8.33333333333333e+00 +2395 1940 8.33333333333333e+00 +2395 2349 4.16666666666667e+00 +2395 1938 -4.16666666666667e+00 +2395 2363 8.33333333333333e+00 +2395 2396 -1.66666666666667e+01 +2395 1976 8.33333333333333e+00 +2395 2362 -3.75000000000000e+01 +2395 1974 -4.16666666666667e+00 +2395 2469 4.16666666666667e+00 +2395 2145 -4.16666666666667e+00 +2395 2471 4.16666666666667e+00 +2395 2147 -4.16666666666667e+00 +2395 1975 -1.25000000000000e+01 +2395 2399 -4.16666666666667e+00 +2395 2141 4.16666666666667e+00 +2395 2369 4.16666666666667e+00 +2395 2398 -1.25000000000000e+01 +2395 1939 -1.25000000000000e+01 +2395 2397 8.33333333333333e+00 +2395 2139 -8.33333333333333e+00 +2396 2396 1.25000000000000e+02 +2396 2380 -4.16666666666667e+00 +2396 2367 -8.33333333333333e+00 +2396 2381 -1.25000000000000e+01 +2396 2379 8.33333333333333e+00 +2396 2473 -8.33333333333333e+00 +2396 2472 4.16666666666667e+00 +2396 2402 -1.25000000000000e+01 +2396 2401 8.33333333333333e+00 +2396 2400 -4.16666666666667e+00 +2396 2338 -4.16666666666667e+00 +2396 2347 4.16666666666667e+00 +2396 2337 -4.16666666666667e+00 +2396 2346 4.16666666666667e+00 +2396 2349 4.16666666666667e+00 +2396 2361 -4.16666666666667e+00 +2396 2350 -8.33333333333333e+00 +2396 1939 8.33333333333333e+00 +2396 2363 -1.25000000000000e+01 +2396 2362 8.33333333333333e+00 +2396 2395 -1.66666666666667e+01 +2396 1975 8.33333333333333e+00 +2396 2139 4.16666666666667e+00 +2396 2145 -4.16666666666667e+00 +2396 1976 -3.75000000000000e+01 +2396 2470 4.16666666666667e+00 +2396 2146 -4.16666666666667e+00 +2396 1974 8.33333333333333e+00 +2396 2469 -8.33333333333333e+00 +2396 2368 4.16666666666667e+00 +2396 2399 -1.25000000000000e+01 +2396 1940 -3.75000000000000e+01 +2396 2398 -4.16666666666667e+00 +2396 2140 4.16666666666667e+00 +2396 2394 -1.66666666666667e+01 +2396 2397 8.33333333333333e+00 +2396 1938 8.33333333333333e+00 +2397 2397 1.25000000000000e+02 +2397 2356 4.16666666666667e+00 +2397 2387 8.33333333333333e+00 +2397 2386 -4.16666666666667e+00 +2397 2385 -1.25000000000000e+01 +2397 2351 -4.16666666666667e+00 +2397 2366 -4.16666666666667e+00 +2397 2363 4.16666666666667e+00 +2397 2365 8.33333333333333e+00 +2397 2362 -8.33333333333333e+00 +2397 2364 -1.25000000000000e+01 +2397 2350 -4.16666666666667e+00 +2397 1939 4.16666666666667e+00 +2397 2141 -4.16666666666667e+00 +2397 2399 -1.66666666666667e+01 +2397 2470 -4.16666666666667e+00 +2397 2147 4.16666666666667e+00 +2397 2146 4.16666666666667e+00 +2397 2471 8.33333333333333e+00 +2397 2469 -1.25000000000000e+01 +2397 2396 8.33333333333333e+00 +2397 1940 -8.33333333333333e+00 +2397 2395 8.33333333333333e+00 +2397 2398 -1.66666666666667e+01 +2397 2140 8.33333333333333e+00 +2397 2394 -3.75000000000000e+01 +2397 2357 4.16666666666667e+00 +2397 2139 -1.25000000000000e+01 +2397 1651 8.33333333333333e+00 +2397 1505 4.16666666666667e+00 +2397 1504 -8.33333333333333e+00 +2397 1652 8.33333333333333e+00 +2397 1650 -3.75000000000000e+01 +2397 1363 4.16666666666667e+00 +2397 1511 -4.16666666666667e+00 +2397 1510 -4.16666666666667e+00 +2397 1364 -8.33333333333333e+00 +2398 2398 1.25000000000000e+02 +2398 2355 4.16666666666667e+00 +2398 2387 8.33333333333333e+00 +2398 2386 -1.25000000000000e+01 +2398 2385 -4.16666666666667e+00 +2398 2351 -4.16666666666667e+00 +2398 2364 8.33333333333333e+00 +2398 2363 4.16666666666667e+00 +2398 2361 -8.33333333333333e+00 +2398 2366 8.33333333333333e+00 +2398 2399 -1.66666666666667e+01 +2398 2365 -3.75000000000000e+01 +2398 2349 -4.16666666666667e+00 +2398 1938 4.16666666666667e+00 +2398 2469 -4.16666666666667e+00 +2398 2471 8.33333333333333e+00 +2398 2141 8.33333333333333e+00 +2398 2147 -8.33333333333333e+00 +2398 2145 4.16666666666667e+00 +2398 2470 -1.25000000000000e+01 +2398 2396 -4.16666666666667e+00 +2398 1940 4.16666666666667e+00 +2398 2395 -1.25000000000000e+01 +2398 2357 -8.33333333333333e+00 +2398 2140 -3.75000000000000e+01 +2398 2394 8.33333333333333e+00 +2398 2397 -1.66666666666667e+01 +2398 2139 8.33333333333333e+00 +2398 1652 -4.16666666666667e+00 +2398 1505 4.16666666666667e+00 +2398 1650 8.33333333333333e+00 +2398 1503 -8.33333333333333e+00 +2398 1651 -1.25000000000000e+01 +2398 1362 4.16666666666667e+00 +2398 1509 -4.16666666666667e+00 +2398 1364 4.16666666666667e+00 +2398 1511 -4.16666666666667e+00 +2399 2399 1.25000000000000e+02 +2399 2356 -8.33333333333333e+00 +2399 2387 -3.75000000000000e+01 +2399 2386 8.33333333333333e+00 +2399 2385 8.33333333333333e+00 +2399 2349 -4.16666666666667e+00 +2399 2350 -4.16666666666667e+00 +2399 2364 -4.16666666666667e+00 +2399 2361 4.16666666666667e+00 +2399 2362 4.16666666666667e+00 +2399 2366 -1.25000000000000e+01 +2399 2365 8.33333333333333e+00 +2399 2398 -1.66666666666667e+01 +2399 2139 -4.16666666666667e+00 +2399 2397 -1.66666666666667e+01 +2399 2470 8.33333333333333e+00 +2399 2145 4.16666666666667e+00 +2399 2140 8.33333333333333e+00 +2399 2146 -8.33333333333333e+00 +2399 2471 -3.75000000000000e+01 +2399 2469 8.33333333333333e+00 +2399 2396 -1.25000000000000e+01 +2399 2355 4.16666666666667e+00 +2399 2141 -1.25000000000000e+01 +2399 2395 -4.16666666666667e+00 +2399 1939 4.16666666666667e+00 +2399 2394 8.33333333333333e+00 +2399 1938 -8.33333333333333e+00 +2399 1651 -4.16666666666667e+00 +2399 1504 4.16666666666667e+00 +2399 1503 4.16666666666667e+00 +2399 1652 -1.25000000000000e+01 +2399 1650 8.33333333333333e+00 +2399 1509 -4.16666666666667e+00 +2399 1363 4.16666666666667e+00 +2399 1510 -4.16666666666667e+00 +2399 1362 -8.33333333333333e+00 +2400 2400 1.25000000000000e+02 +2400 2374 4.16666666666667e+00 +2400 2144 4.16666666666667e+00 +2400 2438 -4.16666666666667e+00 +2400 2437 8.33333333333333e+00 +2400 2143 -8.33333333333333e+00 +2400 2436 -1.25000000000000e+01 +2400 2390 8.33333333333333e+00 +2400 2389 -4.16666666666667e+00 +2400 2388 -1.25000000000000e+01 +2400 2369 -4.16666666666667e+00 +2400 2383 8.33333333333333e+00 +2400 2381 4.16666666666667e+00 +2400 2380 -8.33333333333333e+00 +2400 2384 8.33333333333333e+00 +2400 2402 -1.66666666666667e+01 +2400 1981 4.16666666666667e+00 +2400 2382 -3.75000000000000e+01 +2400 2368 -4.16666666666667e+00 +2400 1939 4.16666666666667e+00 +2400 2473 -4.16666666666667e+00 +2400 2474 8.33333333333333e+00 +2400 2141 8.33333333333333e+00 +2400 2147 -8.33333333333333e+00 +2400 2149 -4.16666666666667e+00 +2400 2146 4.16666666666667e+00 +2400 1982 4.16666666666667e+00 +2400 2150 -4.16666666666667e+00 +2400 2472 -1.25000000000000e+01 +2400 2396 -4.16666666666667e+00 +2400 1940 4.16666666666667e+00 +2400 2401 -1.66666666666667e+01 +2400 2395 8.33333333333333e+00 +2400 2140 8.33333333333333e+00 +2400 2375 -8.33333333333333e+00 +2400 2394 -1.25000000000000e+01 +2400 2139 -3.75000000000000e+01 +2401 2401 1.25000000000000e+02 +2401 2373 4.16666666666667e+00 +2401 2436 8.33333333333333e+00 +2401 2144 4.16666666666667e+00 +2401 2142 -8.33333333333333e+00 +2401 2438 8.33333333333333e+00 +2401 2437 -3.75000000000000e+01 +2401 2390 8.33333333333333e+00 +2401 2389 -1.25000000000000e+01 +2401 2388 -4.16666666666667e+00 +2401 2369 -4.16666666666667e+00 +2401 2384 -4.16666666666667e+00 +2401 2381 4.16666666666667e+00 +2401 2382 8.33333333333333e+00 +2401 2379 -8.33333333333333e+00 +2401 2383 -1.25000000000000e+01 +2401 1980 4.16666666666667e+00 +2401 2367 -4.16666666666667e+00 +2401 1938 4.16666666666667e+00 +2401 2141 -4.16666666666667e+00 +2401 2402 -1.66666666666667e+01 +2401 2472 -4.16666666666667e+00 +2401 2150 -4.16666666666667e+00 +2401 2147 4.16666666666667e+00 +2401 2148 -4.16666666666667e+00 +2401 2145 4.16666666666667e+00 +2401 1982 -8.33333333333333e+00 +2401 2474 8.33333333333333e+00 +2401 2473 -1.25000000000000e+01 +2401 2396 8.33333333333333e+00 +2401 1940 -8.33333333333333e+00 +2401 2375 4.16666666666667e+00 +2401 2395 -3.75000000000000e+01 +2401 2140 -1.25000000000000e+01 +2401 2400 -1.66666666666667e+01 +2401 2394 8.33333333333333e+00 +2401 2139 8.33333333333333e+00 +2402 2402 1.25000000000000e+02 +2402 2373 -8.33333333333333e+00 +2402 2142 4.16666666666667e+00 +2402 2436 -4.16666666666667e+00 +2402 2143 4.16666666666667e+00 +2402 2438 -1.25000000000000e+01 +2402 2437 8.33333333333333e+00 +2402 2390 -3.75000000000000e+01 +2402 2389 8.33333333333333e+00 +2402 2388 8.33333333333333e+00 +2402 2368 -4.16666666666667e+00 +2402 2367 -4.16666666666667e+00 +2402 2383 -4.16666666666667e+00 +2402 2380 4.16666666666667e+00 +2402 2379 4.16666666666667e+00 +2402 2384 -1.25000000000000e+01 +2402 2382 8.33333333333333e+00 +2402 2400 -1.66666666666667e+01 +2402 2140 -4.16666666666667e+00 +2402 2401 -1.66666666666667e+01 +2402 2149 -4.16666666666667e+00 +2402 2146 4.16666666666667e+00 +2402 2472 8.33333333333333e+00 +2402 2139 8.33333333333333e+00 +2402 2145 -8.33333333333333e+00 +2402 2474 -3.75000000000000e+01 +2402 1981 -8.33333333333333e+00 +2402 2473 8.33333333333333e+00 +2402 1980 4.16666666666667e+00 +2402 2148 -4.16666666666667e+00 +2402 2374 4.16666666666667e+00 +2402 2396 -1.25000000000000e+01 +2402 2141 -1.25000000000000e+01 +2402 2395 8.33333333333333e+00 +2402 1939 -8.33333333333333e+00 +2402 2394 -4.16666666666667e+00 +2402 1938 4.16666666666667e+00 +2403 2403 6.25000000000000e+01 +2403 2201 -4.16666666666667e+00 +2403 2404 -8.33333333333333e+00 +2403 2407 4.16666666666667e+00 +2403 2200 8.33333333333333e+00 +2403 2408 4.16666666666667e+00 +2403 1942 -2.08333333333333e+00 +2403 2197 4.16666666666667e+00 +2403 2406 -1.87500000000000e+01 +2403 2417 -4.16666666666667e+00 +2403 2416 2.08333333333333e+00 +2403 1948 -2.08333333333333e+00 +2403 2199 -1.25000000000000e+01 +2403 2035 2.08333333333333e+00 +2403 2179 -4.16666666666667e+00 +2403 2180 -4.16666666666667e+00 +2403 2186 4.16666666666667e+00 +2403 1943 4.16666666666667e+00 +2403 2036 -4.16666666666667e+00 +2403 1941 -6.25000000000000e+00 +2403 2405 -8.33333333333333e+00 +2403 2042 4.16666666666667e+00 +2403 1949 4.16666666666667e+00 +2403 2041 4.16666666666667e+00 +2403 2185 -8.33333333333333e+00 +2403 2198 4.16666666666667e+00 +2403 2040 -1.87500000000000e+01 +2403 1947 -6.25000000000000e+00 +2404 2404 6.25000000000000e+01 +2404 2417 2.08333333333333e+00 +2404 2403 -8.33333333333333e+00 +2404 2406 4.16666666666667e+00 +2404 2199 8.33333333333333e+00 +2404 1943 4.16666666666667e+00 +2404 2198 -8.33333333333333e+00 +2404 2407 -6.25000000000000e+00 +2404 1941 -2.08333333333333e+00 +2404 2196 4.16666666666667e+00 +2404 2405 -8.33333333333333e+00 +2404 2201 8.33333333333333e+00 +2404 1949 4.16666666666667e+00 +2404 2200 -3.75000000000000e+01 +2404 2415 2.08333333333333e+00 +2404 1947 -2.08333333333333e+00 +2404 2034 2.08333333333333e+00 +2404 2178 -4.16666666666667e+00 +2404 2036 2.08333333333333e+00 +2404 2180 -4.16666666666667e+00 +2404 1942 -6.25000000000000e+00 +2404 2042 -2.08333333333333e+00 +2404 2186 4.16666666666667e+00 +2404 2408 -2.08333333333333e+00 +2404 2041 -6.25000000000000e+00 +2404 1948 -6.25000000000000e+00 +2404 2040 4.16666666666667e+00 +2404 2184 -8.33333333333333e+00 +2405 2405 6.25000000000000e+01 +2405 2199 -4.16666666666667e+00 +2405 2407 -2.08333333333333e+00 +2405 2416 2.08333333333333e+00 +2405 2408 -6.25000000000000e+00 +2405 1942 4.16666666666667e+00 +2405 2197 -8.33333333333333e+00 +2405 2406 4.16666666666667e+00 +2405 2201 -1.25000000000000e+01 +2405 2404 -8.33333333333333e+00 +2405 2200 8.33333333333333e+00 +2405 1948 4.16666666666667e+00 +2405 2415 -4.16666666666667e+00 +2405 2178 -4.16666666666667e+00 +2405 2184 4.16666666666667e+00 +2405 1943 -1.87500000000000e+01 +2405 2035 2.08333333333333e+00 +2405 2179 -4.16666666666667e+00 +2405 1941 4.16666666666667e+00 +2405 2034 -4.16666666666667e+00 +2405 2196 4.16666666666667e+00 +2405 2042 -6.25000000000000e+00 +2405 1949 -1.87500000000000e+01 +2405 2041 -2.08333333333333e+00 +2405 2185 4.16666666666667e+00 +2405 2403 -8.33333333333333e+00 +2405 2040 4.16666666666667e+00 +2405 1947 4.16666666666667e+00 +2406 2406 6.25000000000000e+01 +2406 2404 4.16666666666667e+00 +2406 2200 -8.33333333333333e+00 +2406 2405 4.16666666666667e+00 +2406 1942 2.08333333333333e+00 +2406 2403 -1.87500000000000e+01 +2406 2417 4.16666666666667e+00 +2406 1954 2.08333333333333e+00 +2406 2416 -2.08333333333333e+00 +2406 2415 -6.25000000000000e+00 +2406 2197 -4.16666666666667e+00 +2406 2198 -4.16666666666667e+00 +2406 2408 -8.33333333333333e+00 +2406 2050 -2.08333333333333e+00 +2406 2044 4.16666666666667e+00 +2406 2045 4.16666666666667e+00 +2406 2204 -4.16666666666667e+00 +2406 2051 4.16666666666667e+00 +2406 1943 -4.16666666666667e+00 +2406 2049 -6.25000000000000e+00 +2406 2057 4.16666666666667e+00 +2406 1955 -4.16666666666667e+00 +2406 2056 4.16666666666667e+00 +2406 2407 -8.33333333333333e+00 +2406 2203 8.33333333333333e+00 +2406 2055 -1.87500000000000e+01 +2406 2201 4.16666666666667e+00 +2406 2202 -1.25000000000000e+01 +2407 2407 6.25000000000000e+01 +2407 2201 4.16666666666667e+00 +2407 2403 4.16666666666667e+00 +2407 2199 -8.33333333333333e+00 +2407 2404 -6.25000000000000e+00 +2407 1941 2.08333333333333e+00 +2407 2408 -8.33333333333333e+00 +2407 2417 4.16666666666667e+00 +2407 2416 -6.25000000000000e+00 +2407 1953 2.08333333333333e+00 +2407 2415 -2.08333333333333e+00 +2407 2196 -4.16666666666667e+00 +2407 2051 4.16666666666667e+00 +2407 2049 -2.08333333333333e+00 +2407 2043 4.16666666666667e+00 +2407 2045 -8.33333333333333e+00 +2407 2204 8.33333333333333e+00 +2407 1943 2.08333333333333e+00 +2407 2198 -4.16666666666667e+00 +2407 2050 -6.25000000000000e+00 +2407 2057 -2.08333333333333e+00 +2407 1955 2.08333333333333e+00 +2407 2056 -6.25000000000000e+00 +2407 2405 -2.08333333333333e+00 +2407 2203 -3.75000000000000e+01 +2407 2055 4.16666666666667e+00 +2407 2406 -8.33333333333333e+00 +2407 2202 8.33333333333333e+00 +2408 2408 6.25000000000000e+01 +2408 2404 -2.08333333333333e+00 +2408 2200 4.16666666666667e+00 +2408 2405 -6.25000000000000e+00 +2408 2403 4.16666666666667e+00 +2408 2417 -1.87500000000000e+01 +2408 2407 -8.33333333333333e+00 +2408 2416 4.16666666666667e+00 +2408 2415 4.16666666666667e+00 +2408 2196 -4.16666666666667e+00 +2408 2050 4.16666666666667e+00 +2408 2406 -8.33333333333333e+00 +2408 2044 -8.33333333333333e+00 +2408 2203 8.33333333333333e+00 +2408 2043 4.16666666666667e+00 +2408 2202 -4.16666666666667e+00 +2408 2051 -1.87500000000000e+01 +2408 1942 2.08333333333333e+00 +2408 2197 -4.16666666666667e+00 +2408 2049 4.16666666666667e+00 +2408 1941 -4.16666666666667e+00 +2408 2057 -6.25000000000000e+00 +2408 2199 4.16666666666667e+00 +2408 2204 -1.25000000000000e+01 +2408 2056 -2.08333333333333e+00 +2408 1954 2.08333333333333e+00 +2408 2055 4.16666666666667e+00 +2408 1953 -4.16666666666667e+00 +2409 2409 6.25000000000000e+01 +2409 2419 2.08333333333333e+00 +2409 2420 -4.16666666666667e+00 +2409 2414 4.16666666666667e+00 +2409 2412 -6.25000000000000e+00 +2409 2249 -4.16666666666667e+00 +2409 1948 4.16666666666667e+00 +2409 2410 -8.33333333333333e+00 +2409 2248 8.33333333333333e+00 +2409 2247 -1.25000000000000e+01 +2409 2246 0.00000000000000e+00 +2409 1945 0.00000000000000e+00 +2409 2245 0.00000000000000e+00 +2409 2186 4.16666666666667e+00 +2409 2183 0.00000000000000e+00 +2409 1946 0.00000000000000e+00 +2409 2039 0.00000000000000e+00 +2409 2038 0.00000000000000e+00 +2409 2182 0.00000000000000e+00 +2409 1944 0.00000000000000e+00 +2409 2411 -8.33333333333333e+00 +2409 2042 4.16666666666667e+00 +2409 1949 4.16666666666667e+00 +2409 2041 -2.08333333333333e+00 +2409 2185 4.16666666666667e+00 +2409 2413 -2.08333333333333e+00 +2409 2040 -6.25000000000000e+00 +2409 1947 -1.87500000000000e+01 +2410 2410 6.25000000000000e+01 +2410 2411 -8.33333333333333e+00 +2410 2412 -2.08333333333333e+00 +2410 2418 2.08333333333333e+00 +2410 1949 -2.08333333333333e+00 +2410 2420 2.08333333333333e+00 +2410 1946 0.00000000000000e+00 +2410 2413 -6.25000000000000e+00 +2410 2246 0.00000000000000e+00 +2410 2249 8.33333333333333e+00 +2410 2248 -3.75000000000000e+01 +2410 1947 4.16666666666667e+00 +2410 2409 -8.33333333333333e+00 +2410 2247 8.33333333333333e+00 +2410 1944 0.00000000000000e+00 +2410 2244 0.00000000000000e+00 +2410 2039 0.00000000000000e+00 +2410 2183 0.00000000000000e+00 +2410 1945 0.00000000000000e+00 +2410 2037 0.00000000000000e+00 +2410 2181 0.00000000000000e+00 +2410 2042 4.16666666666667e+00 +2410 2186 -8.33333333333333e+00 +2410 2414 4.16666666666667e+00 +2410 2041 -6.25000000000000e+00 +2410 1948 -6.25000000000000e+00 +2410 2040 -2.08333333333333e+00 +2410 2184 4.16666666666667e+00 +2411 2411 6.25000000000000e+01 +2411 2410 -8.33333333333333e+00 +2411 1948 -2.08333333333333e+00 +2411 2419 2.08333333333333e+00 +2411 2418 -4.16666666666667e+00 +2411 2414 -1.87500000000000e+01 +2411 1945 0.00000000000000e+00 +2411 2412 4.16666666666667e+00 +2411 2245 0.00000000000000e+00 +2411 2249 -1.25000000000000e+01 +2411 2248 8.33333333333333e+00 +2411 2247 -4.16666666666667e+00 +2411 2244 0.00000000000000e+00 +2411 2184 4.16666666666667e+00 +2411 2181 0.00000000000000e+00 +2411 2038 0.00000000000000e+00 +2411 2182 0.00000000000000e+00 +2411 1946 0.00000000000000e+00 +2411 1944 0.00000000000000e+00 +2411 2037 0.00000000000000e+00 +2411 2413 4.16666666666667e+00 +2411 2042 -1.87500000000000e+01 +2411 1949 -6.25000000000000e+00 +2411 2041 4.16666666666667e+00 +2411 2185 -8.33333333333333e+00 +2411 2409 -8.33333333333333e+00 +2411 2040 4.16666666666667e+00 +2411 1947 4.16666666666667e+00 +2412 2412 6.25000000000000e+01 +2412 2249 4.16666666666667e+00 +2412 2248 4.16666666666667e+00 +2412 2420 4.16666666666667e+00 +2412 2419 4.16666666666667e+00 +2412 2413 -8.33333333333333e+00 +2412 2418 -1.87500000000000e+01 +2412 2411 4.16666666666667e+00 +2412 2409 -6.25000000000000e+00 +2412 2258 -4.16666666666667e+00 +2412 2414 -8.33333333333333e+00 +2412 2246 0.00000000000000e+00 +2412 2105 0.00000000000000e+00 +2412 2107 0.00000000000000e+00 +2412 2257 8.33333333333333e+00 +2412 2104 0.00000000000000e+00 +2412 2108 0.00000000000000e+00 +2412 1946 0.00000000000000e+00 +2412 1945 0.00000000000000e+00 +2412 2245 0.00000000000000e+00 +2412 2106 0.00000000000000e+00 +2412 2114 4.16666666666667e+00 +2412 1979 -4.16666666666667e+00 +2412 2113 -2.08333333333333e+00 +2412 1978 2.08333333333333e+00 +2412 2112 -6.25000000000000e+00 +2412 2410 -2.08333333333333e+00 +2412 2256 -1.25000000000000e+01 +2413 2413 6.25000000000000e+01 +2413 2409 -2.08333333333333e+00 +2413 2249 -8.33333333333333e+00 +2413 2247 4.16666666666667e+00 +2413 2420 -2.08333333333333e+00 +2413 1979 2.08333333333333e+00 +2413 2419 -6.25000000000000e+00 +2413 2418 4.16666666666667e+00 +2413 2412 -8.33333333333333e+00 +2413 1946 0.00000000000000e+00 +2413 2410 -6.25000000000000e+00 +2413 2108 0.00000000000000e+00 +2413 2106 0.00000000000000e+00 +2413 2246 0.00000000000000e+00 +2413 2105 0.00000000000000e+00 +2413 2256 8.33333333333333e+00 +2413 2103 0.00000000000000e+00 +2413 2107 0.00000000000000e+00 +2413 1944 0.00000000000000e+00 +2413 2244 0.00000000000000e+00 +2413 2114 4.16666666666667e+00 +2413 2414 -8.33333333333333e+00 +2413 2258 8.33333333333333e+00 +2413 2113 -6.25000000000000e+00 +2413 2411 4.16666666666667e+00 +2413 2257 -3.75000000000000e+01 +2413 2112 -2.08333333333333e+00 +2413 1977 2.08333333333333e+00 +2414 2414 6.25000000000000e+01 +2414 2247 4.16666666666667e+00 +2414 2248 -8.33333333333333e+00 +2414 2420 -6.25000000000000e+00 +2414 2419 -2.08333333333333e+00 +2414 1978 2.08333333333333e+00 +2414 2418 4.16666666666667e+00 +2414 2411 -1.87500000000000e+01 +2414 1945 0.00000000000000e+00 +2414 2409 4.16666666666667e+00 +2414 2256 -4.16666666666667e+00 +2414 2107 0.00000000000000e+00 +2414 2412 -8.33333333333333e+00 +2414 2244 0.00000000000000e+00 +2414 2103 0.00000000000000e+00 +2414 2245 0.00000000000000e+00 +2414 2104 0.00000000000000e+00 +2414 2108 0.00000000000000e+00 +2414 2106 0.00000000000000e+00 +2414 1944 0.00000000000000e+00 +2414 2114 -1.87500000000000e+01 +2414 2410 4.16666666666667e+00 +2414 2258 -1.25000000000000e+01 +2414 2113 4.16666666666667e+00 +2414 2413 -8.33333333333333e+00 +2414 2257 8.33333333333333e+00 +2414 2112 4.16666666666667e+00 +2414 1977 -4.16666666666667e+00 +2415 2415 6.25000000000000e+01 +2415 2407 -2.08333333333333e+00 +2415 2406 -6.25000000000000e+00 +2415 2405 -4.16666666666667e+00 +2415 2404 2.08333333333333e+00 +2415 2203 4.16666666666667e+00 +2415 2200 -4.16666666666667e+00 +2415 2204 4.16666666666667e+00 +2415 2201 -4.16666666666667e+00 +2415 2264 4.16666666666667e+00 +2415 2267 -4.16666666666667e+00 +2415 2125 2.08333333333333e+00 +2415 2122 -2.08333333333333e+00 +2415 1955 4.16666666666667e+00 +2415 2126 -4.16666666666667e+00 +2415 1954 4.16666666666667e+00 +2415 2416 -8.33333333333333e+00 +2415 2266 8.33333333333333e+00 +2415 1953 -1.87500000000000e+01 +2415 2265 -1.25000000000000e+01 +2415 2417 -8.33333333333333e+00 +2415 1949 4.16666666666667e+00 +2415 2123 4.16666666666667e+00 +2415 1948 4.16666666666667e+00 +2415 2263 -8.33333333333333e+00 +2415 2408 4.16666666666667e+00 +2415 1947 -1.87500000000000e+01 +2415 2121 -6.25000000000000e+00 +2416 2416 6.25000000000000e+01 +2416 2408 4.16666666666667e+00 +2416 2407 -6.25000000000000e+00 +2416 2406 -2.08333333333333e+00 +2416 2403 2.08333333333333e+00 +2416 2202 4.16666666666667e+00 +2416 2199 -4.16666666666667e+00 +2416 2201 -4.16666666666667e+00 +2416 2204 -8.33333333333333e+00 +2416 2417 -8.33333333333333e+00 +2416 2267 8.33333333333333e+00 +2416 2123 4.16666666666667e+00 +2416 2124 2.08333333333333e+00 +2416 2121 -2.08333333333333e+00 +2416 1955 -2.08333333333333e+00 +2416 2126 2.08333333333333e+00 +2416 1954 -6.25000000000000e+00 +2416 2266 -3.75000000000000e+01 +2416 1953 4.16666666666667e+00 +2416 2415 -8.33333333333333e+00 +2416 2265 8.33333333333333e+00 +2416 1949 -2.08333333333333e+00 +2416 2264 4.16666666666667e+00 +2416 2405 2.08333333333333e+00 +2416 1948 -6.25000000000000e+00 +2416 2122 -6.25000000000000e+00 +2416 1947 4.16666666666667e+00 +2416 2262 -8.33333333333333e+00 +2417 2417 6.25000000000000e+01 +2417 2408 -1.87500000000000e+01 +2417 2407 4.16666666666667e+00 +2417 2406 4.16666666666667e+00 +2417 2403 -4.16666666666667e+00 +2417 2200 -4.16666666666667e+00 +2417 2203 -8.33333333333333e+00 +2417 2202 4.16666666666667e+00 +2417 2199 -4.16666666666667e+00 +2417 2262 4.16666666666667e+00 +2417 2265 -4.16666666666667e+00 +2417 2416 -8.33333333333333e+00 +2417 2266 8.33333333333333e+00 +2417 2122 4.16666666666667e+00 +2417 1955 -6.25000000000000e+00 +2417 2267 -1.25000000000000e+01 +2417 1954 -2.08333333333333e+00 +2417 2125 2.08333333333333e+00 +2417 1953 4.16666666666667e+00 +2417 2124 -4.16666666666667e+00 +2417 2404 2.08333333333333e+00 +2417 1949 -6.25000000000000e+00 +2417 2123 -1.87500000000000e+01 +2417 1948 -2.08333333333333e+00 +2417 2263 4.16666666666667e+00 +2417 2415 -8.33333333333333e+00 +2417 1947 4.16666666666667e+00 +2417 2121 4.16666666666667e+00 +2418 2418 6.25000000000000e+01 +2418 2248 -4.16666666666667e+00 +2418 2258 4.16666666666667e+00 +2418 2249 -4.16666666666667e+00 +2418 2411 -4.16666666666667e+00 +2418 2414 4.16666666666667e+00 +2418 2413 4.16666666666667e+00 +2418 2257 -8.33333333333333e+00 +2418 2412 -1.87500000000000e+01 +2418 2264 4.16666666666667e+00 +2418 2276 -4.16666666666667e+00 +2418 2122 4.16666666666667e+00 +2418 2419 -8.33333333333333e+00 +2418 2275 8.33333333333333e+00 +2418 1979 4.16666666666667e+00 +2418 2135 -4.16666666666667e+00 +2418 1978 -2.08333333333333e+00 +2418 2134 2.08333333333333e+00 +2418 1977 -6.25000000000000e+00 +2418 2274 -1.25000000000000e+01 +2418 2420 -8.33333333333333e+00 +2418 1949 4.16666666666667e+00 +2418 2123 4.16666666666667e+00 +2418 1948 -2.08333333333333e+00 +2418 2263 4.16666666666667e+00 +2418 2410 2.08333333333333e+00 +2418 1947 -6.25000000000000e+00 +2418 2121 -1.87500000000000e+01 +2419 2419 6.25000000000000e+01 +2419 2247 -4.16666666666667e+00 +2419 2411 2.08333333333333e+00 +2419 2249 -4.16666666666667e+00 +2419 2414 -2.08333333333333e+00 +2419 2258 4.16666666666667e+00 +2419 2413 -6.25000000000000e+00 +2419 2412 4.16666666666667e+00 +2419 2256 -8.33333333333333e+00 +2419 2123 -2.08333333333333e+00 +2419 2135 2.08333333333333e+00 +2419 2121 4.16666666666667e+00 +2419 2418 -8.33333333333333e+00 +2419 2274 8.33333333333333e+00 +2419 1979 4.16666666666667e+00 +2419 2420 -8.33333333333333e+00 +2419 2276 8.33333333333333e+00 +2419 1978 -6.25000000000000e+00 +2419 2275 -3.75000000000000e+01 +2419 1977 -2.08333333333333e+00 +2419 2133 2.08333333333333e+00 +2419 1949 4.16666666666667e+00 +2419 2264 -8.33333333333333e+00 +2419 2409 2.08333333333333e+00 +2419 1948 -6.25000000000000e+00 +2419 2122 -6.25000000000000e+00 +2419 1947 -2.08333333333333e+00 +2419 2262 4.16666666666667e+00 +2420 2420 6.25000000000000e+01 +2420 2247 -4.16666666666667e+00 +2420 2410 2.08333333333333e+00 +2420 2248 -4.16666666666667e+00 +2420 2409 -4.16666666666667e+00 +2420 2414 -6.25000000000000e+00 +2420 2413 -2.08333333333333e+00 +2420 2257 4.16666666666667e+00 +2420 2412 4.16666666666667e+00 +2420 2122 -2.08333333333333e+00 +2420 2134 2.08333333333333e+00 +2420 2262 4.16666666666667e+00 +2420 2274 -4.16666666666667e+00 +2420 1979 -1.87500000000000e+01 +2420 2276 -1.25000000000000e+01 +2420 1978 4.16666666666667e+00 +2420 2419 -8.33333333333333e+00 +2420 2275 8.33333333333333e+00 +2420 1977 4.16666666666667e+00 +2420 2133 -4.16666666666667e+00 +2420 2256 4.16666666666667e+00 +2420 1949 -1.87500000000000e+01 +2420 2123 -6.25000000000000e+00 +2420 1948 4.16666666666667e+00 +2420 2263 -8.33333333333333e+00 +2420 2418 -8.33333333333333e+00 +2420 1947 4.16666666666667e+00 +2420 2121 4.16666666666667e+00 +2421 2421 6.25000000000000e+01 +2421 2327 -4.16666666666667e+00 +2421 2422 -8.33333333333333e+00 +2421 2425 4.16666666666667e+00 +2421 2326 8.33333333333333e+00 +2421 2426 4.16666666666667e+00 +2421 1951 -2.08333333333333e+00 +2421 2323 4.16666666666667e+00 +2421 2424 -1.87500000000000e+01 +2421 2435 -4.16666666666667e+00 +2421 2434 2.08333333333333e+00 +2421 1957 -2.08333333333333e+00 +2421 2325 -1.25000000000000e+01 +2421 2053 2.08333333333333e+00 +2421 2305 -4.16666666666667e+00 +2421 2306 -4.16666666666667e+00 +2421 2312 4.16666666666667e+00 +2421 1952 4.16666666666667e+00 +2421 2054 -4.16666666666667e+00 +2421 1950 -6.25000000000000e+00 +2421 2423 -8.33333333333333e+00 +2421 2060 4.16666666666667e+00 +2421 1958 4.16666666666667e+00 +2421 2059 4.16666666666667e+00 +2421 2311 -8.33333333333333e+00 +2421 2324 4.16666666666667e+00 +2421 2058 -1.87500000000000e+01 +2421 1956 -6.25000000000000e+00 +2422 2422 6.25000000000000e+01 +2422 2435 2.08333333333333e+00 +2422 2421 -8.33333333333333e+00 +2422 2424 4.16666666666667e+00 +2422 2325 8.33333333333333e+00 +2422 1952 4.16666666666667e+00 +2422 2324 -8.33333333333333e+00 +2422 2425 -6.25000000000000e+00 +2422 1950 -2.08333333333333e+00 +2422 2322 4.16666666666667e+00 +2422 2423 -8.33333333333333e+00 +2422 2327 8.33333333333333e+00 +2422 1958 4.16666666666667e+00 +2422 2326 -3.75000000000000e+01 +2422 2433 2.08333333333333e+00 +2422 1956 -2.08333333333333e+00 +2422 2052 2.08333333333333e+00 +2422 2304 -4.16666666666667e+00 +2422 2054 2.08333333333333e+00 +2422 2306 -4.16666666666667e+00 +2422 1951 -6.25000000000000e+00 +2422 2060 -2.08333333333333e+00 +2422 2312 4.16666666666667e+00 +2422 2426 -2.08333333333333e+00 +2422 2059 -6.25000000000000e+00 +2422 1957 -6.25000000000000e+00 +2422 2058 4.16666666666667e+00 +2422 2310 -8.33333333333333e+00 +2423 2423 6.25000000000000e+01 +2423 2325 -4.16666666666667e+00 +2423 2425 -2.08333333333333e+00 +2423 2434 2.08333333333333e+00 +2423 2426 -6.25000000000000e+00 +2423 1951 4.16666666666667e+00 +2423 2323 -8.33333333333333e+00 +2423 2424 4.16666666666667e+00 +2423 2327 -1.25000000000000e+01 +2423 2422 -8.33333333333333e+00 +2423 2326 8.33333333333333e+00 +2423 1957 4.16666666666667e+00 +2423 2433 -4.16666666666667e+00 +2423 2304 -4.16666666666667e+00 +2423 2310 4.16666666666667e+00 +2423 1952 -1.87500000000000e+01 +2423 2053 2.08333333333333e+00 +2423 2305 -4.16666666666667e+00 +2423 1950 4.16666666666667e+00 +2423 2052 -4.16666666666667e+00 +2423 2322 4.16666666666667e+00 +2423 2060 -6.25000000000000e+00 +2423 1958 -1.87500000000000e+01 +2423 2059 -2.08333333333333e+00 +2423 2311 4.16666666666667e+00 +2423 2421 -8.33333333333333e+00 +2423 2058 4.16666666666667e+00 +2423 1956 4.16666666666667e+00 +2424 2424 6.25000000000000e+01 +2424 2422 4.16666666666667e+00 +2424 2326 -8.33333333333333e+00 +2424 2423 4.16666666666667e+00 +2424 1951 2.08333333333333e+00 +2424 2421 -1.87500000000000e+01 +2424 2435 4.16666666666667e+00 +2424 2434 -2.08333333333333e+00 +2424 2433 -6.25000000000000e+00 +2424 2323 -4.16666666666667e+00 +2424 2324 -4.16666666666667e+00 +2424 2426 -8.33333333333333e+00 +2424 2065 -2.08333333333333e+00 +2424 2062 4.16666666666667e+00 +2424 2063 4.16666666666667e+00 +2424 2330 -4.16666666666667e+00 +2424 2066 4.16666666666667e+00 +2424 1952 -4.16666666666667e+00 +2424 2064 -6.25000000000000e+00 +2424 2425 -8.33333333333333e+00 +2424 2329 8.33333333333333e+00 +2424 2327 4.16666666666667e+00 +2424 2328 -1.25000000000000e+01 +2424 1345 2.08333333333333e+00 +2424 1439 4.16666666666667e+00 +2424 1346 -4.16666666666667e+00 +2424 1438 4.16666666666667e+00 +2424 1437 -1.87500000000000e+01 +2425 2425 6.25000000000000e+01 +2425 2327 4.16666666666667e+00 +2425 2421 4.16666666666667e+00 +2425 2325 -8.33333333333333e+00 +2425 2422 -6.25000000000000e+00 +2425 1950 2.08333333333333e+00 +2425 2426 -8.33333333333333e+00 +2425 2435 4.16666666666667e+00 +2425 2434 -6.25000000000000e+00 +2425 2433 -2.08333333333333e+00 +2425 2322 -4.16666666666667e+00 +2425 2066 4.16666666666667e+00 +2425 2064 -2.08333333333333e+00 +2425 2061 4.16666666666667e+00 +2425 2063 -8.33333333333333e+00 +2425 2330 8.33333333333333e+00 +2425 1952 2.08333333333333e+00 +2425 2324 -4.16666666666667e+00 +2425 2065 -6.25000000000000e+00 +2425 2423 -2.08333333333333e+00 +2425 2329 -3.75000000000000e+01 +2425 2424 -8.33333333333333e+00 +2425 2328 8.33333333333333e+00 +2425 1344 2.08333333333333e+00 +2425 1439 -2.08333333333333e+00 +2425 1346 2.08333333333333e+00 +2425 1438 -6.25000000000000e+00 +2425 1437 4.16666666666667e+00 +2426 2426 6.25000000000000e+01 +2426 2422 -2.08333333333333e+00 +2426 2326 4.16666666666667e+00 +2426 2423 -6.25000000000000e+00 +2426 2421 4.16666666666667e+00 +2426 2435 -1.87500000000000e+01 +2426 2425 -8.33333333333333e+00 +2426 2434 4.16666666666667e+00 +2426 2433 4.16666666666667e+00 +2426 2322 -4.16666666666667e+00 +2426 2065 4.16666666666667e+00 +2426 2424 -8.33333333333333e+00 +2426 2062 -8.33333333333333e+00 +2426 2329 8.33333333333333e+00 +2426 2061 4.16666666666667e+00 +2426 2328 -4.16666666666667e+00 +2426 2066 -1.87500000000000e+01 +2426 1951 2.08333333333333e+00 +2426 2323 -4.16666666666667e+00 +2426 2064 4.16666666666667e+00 +2426 1950 -4.16666666666667e+00 +2426 2325 4.16666666666667e+00 +2426 2330 -1.25000000000000e+01 +2426 1439 -6.25000000000000e+00 +2426 1438 -2.08333333333333e+00 +2426 1345 2.08333333333333e+00 +2426 1437 4.16666666666667e+00 +2426 1344 -4.16666666666667e+00 +2427 2427 6.25000000000000e+01 +2427 2437 2.08333333333333e+00 +2427 2438 -4.16666666666667e+00 +2427 2432 4.16666666666667e+00 +2427 2430 -6.25000000000000e+00 +2427 2375 -4.16666666666667e+00 +2427 1957 4.16666666666667e+00 +2427 2428 -8.33333333333333e+00 +2427 2374 8.33333333333333e+00 +2427 2373 -1.25000000000000e+01 +2427 2372 4.16666666666667e+00 +2427 1954 4.16666666666667e+00 +2427 2371 -8.33333333333333e+00 +2427 2312 4.16666666666667e+00 +2427 2309 -4.16666666666667e+00 +2427 1955 4.16666666666667e+00 +2427 2057 -4.16666666666667e+00 +2427 2056 2.08333333333333e+00 +2427 2308 -4.16666666666667e+00 +2427 1953 -1.87500000000000e+01 +2427 2429 -8.33333333333333e+00 +2427 2060 4.16666666666667e+00 +2427 1958 4.16666666666667e+00 +2427 2059 -2.08333333333333e+00 +2427 2311 4.16666666666667e+00 +2427 2431 -2.08333333333333e+00 +2427 2058 -6.25000000000000e+00 +2427 1956 -1.87500000000000e+01 +2428 2428 6.25000000000000e+01 +2428 2429 -8.33333333333333e+00 +2428 2430 -2.08333333333333e+00 +2428 2436 2.08333333333333e+00 +2428 1958 -2.08333333333333e+00 +2428 2438 2.08333333333333e+00 +2428 1955 -2.08333333333333e+00 +2428 2431 -6.25000000000000e+00 +2428 2372 4.16666666666667e+00 +2428 2375 8.33333333333333e+00 +2428 2374 -3.75000000000000e+01 +2428 1956 4.16666666666667e+00 +2428 2427 -8.33333333333333e+00 +2428 2373 8.33333333333333e+00 +2428 1953 4.16666666666667e+00 +2428 2370 -8.33333333333333e+00 +2428 2057 2.08333333333333e+00 +2428 2309 -4.16666666666667e+00 +2428 1954 -6.25000000000000e+00 +2428 2055 2.08333333333333e+00 +2428 2307 -4.16666666666667e+00 +2428 2060 4.16666666666667e+00 +2428 2312 -8.33333333333333e+00 +2428 2432 4.16666666666667e+00 +2428 2059 -6.25000000000000e+00 +2428 1957 -6.25000000000000e+00 +2428 2058 -2.08333333333333e+00 +2428 2310 4.16666666666667e+00 +2429 2429 6.25000000000000e+01 +2429 2428 -8.33333333333333e+00 +2429 1957 -2.08333333333333e+00 +2429 2437 2.08333333333333e+00 +2429 2436 -4.16666666666667e+00 +2429 2432 -1.87500000000000e+01 +2429 1954 -2.08333333333333e+00 +2429 2430 4.16666666666667e+00 +2429 2371 4.16666666666667e+00 +2429 2375 -1.25000000000000e+01 +2429 2374 8.33333333333333e+00 +2429 2373 -4.16666666666667e+00 +2429 2370 4.16666666666667e+00 +2429 2310 4.16666666666667e+00 +2429 2307 -4.16666666666667e+00 +2429 2056 2.08333333333333e+00 +2429 2308 -4.16666666666667e+00 +2429 1955 -6.25000000000000e+00 +2429 1953 4.16666666666667e+00 +2429 2055 -4.16666666666667e+00 +2429 2431 4.16666666666667e+00 +2429 2060 -1.87500000000000e+01 +2429 1958 -6.25000000000000e+00 +2429 2059 4.16666666666667e+00 +2429 2311 -8.33333333333333e+00 +2429 2427 -8.33333333333333e+00 +2429 2058 4.16666666666667e+00 +2429 1956 4.16666666666667e+00 +2430 2430 6.25000000000000e+01 +2430 2375 4.16666666666667e+00 +2430 2374 4.16666666666667e+00 +2430 2438 4.16666666666667e+00 +2430 2437 4.16666666666667e+00 +2430 2431 -8.33333333333333e+00 +2430 2436 -1.87500000000000e+01 +2430 2429 4.16666666666667e+00 +2430 2427 -6.25000000000000e+00 +2430 2384 -4.16666666666667e+00 +2430 2432 -8.33333333333333e+00 +2430 2372 -4.16666666666667e+00 +2430 2120 4.16666666666667e+00 +2430 2125 4.16666666666667e+00 +2430 2383 8.33333333333333e+00 +2430 2119 -8.33333333333333e+00 +2430 2126 4.16666666666667e+00 +2430 1955 -4.16666666666667e+00 +2430 1954 2.08333333333333e+00 +2430 2371 -4.16666666666667e+00 +2430 2124 -1.87500000000000e+01 +2430 2138 4.16666666666667e+00 +2430 1982 -4.16666666666667e+00 +2430 2137 -2.08333333333333e+00 +2430 1981 2.08333333333333e+00 +2430 2136 -6.25000000000000e+00 +2430 2428 -2.08333333333333e+00 +2430 2382 -1.25000000000000e+01 +2431 2431 6.25000000000000e+01 +2431 2427 -2.08333333333333e+00 +2431 2375 -8.33333333333333e+00 +2431 2373 4.16666666666667e+00 +2431 2438 -2.08333333333333e+00 +2431 1982 2.08333333333333e+00 +2431 2437 -6.25000000000000e+00 +2431 2436 4.16666666666667e+00 +2431 2430 -8.33333333333333e+00 +2431 1955 2.08333333333333e+00 +2431 2428 -6.25000000000000e+00 +2431 2126 -2.08333333333333e+00 +2431 2124 4.16666666666667e+00 +2431 2372 -4.16666666666667e+00 +2431 2120 4.16666666666667e+00 +2431 2382 8.33333333333333e+00 +2431 2118 -8.33333333333333e+00 +2431 2125 -6.25000000000000e+00 +2431 1953 2.08333333333333e+00 +2431 2370 -4.16666666666667e+00 +2431 2138 4.16666666666667e+00 +2431 2432 -8.33333333333333e+00 +2431 2384 8.33333333333333e+00 +2431 2137 -6.25000000000000e+00 +2431 2429 4.16666666666667e+00 +2431 2383 -3.75000000000000e+01 +2431 2136 -2.08333333333333e+00 +2431 1980 2.08333333333333e+00 +2432 2432 6.25000000000000e+01 +2432 2373 4.16666666666667e+00 +2432 2374 -8.33333333333333e+00 +2432 2438 -6.25000000000000e+00 +2432 2437 -2.08333333333333e+00 +2432 1981 2.08333333333333e+00 +2432 2436 4.16666666666667e+00 +2432 2429 -1.87500000000000e+01 +2432 1954 2.08333333333333e+00 +2432 2427 4.16666666666667e+00 +2432 2382 -4.16666666666667e+00 +2432 2125 -2.08333333333333e+00 +2432 2430 -8.33333333333333e+00 +2432 2370 -4.16666666666667e+00 +2432 2118 4.16666666666667e+00 +2432 2371 -4.16666666666667e+00 +2432 2119 4.16666666666667e+00 +2432 2126 -6.25000000000000e+00 +2432 2124 4.16666666666667e+00 +2432 1953 -4.16666666666667e+00 +2432 2138 -1.87500000000000e+01 +2432 2428 4.16666666666667e+00 +2432 2384 -1.25000000000000e+01 +2432 2137 4.16666666666667e+00 +2432 2431 -8.33333333333333e+00 +2432 2383 8.33333333333333e+00 +2432 2136 4.16666666666667e+00 +2432 1980 -4.16666666666667e+00 +2433 2433 6.25000000000000e+01 +2433 2425 -2.08333333333333e+00 +2433 2424 -6.25000000000000e+00 +2433 2423 -4.16666666666667e+00 +2433 2422 2.08333333333333e+00 +2433 2329 4.16666666666667e+00 +2433 2326 -4.16666666666667e+00 +2433 2330 4.16666666666667e+00 +2433 2327 -4.16666666666667e+00 +2433 2390 4.16666666666667e+00 +2433 2393 -4.16666666666667e+00 +2433 2143 -2.08333333333333e+00 +2433 2434 -8.33333333333333e+00 +2433 2392 8.33333333333333e+00 +2433 2391 -1.25000000000000e+01 +2433 2435 -8.33333333333333e+00 +2433 1958 4.16666666666667e+00 +2433 2144 4.16666666666667e+00 +2433 1957 4.16666666666667e+00 +2433 2389 -8.33333333333333e+00 +2433 2426 4.16666666666667e+00 +2433 1956 -1.87500000000000e+01 +2433 2142 -6.25000000000000e+00 +2433 1507 2.08333333333333e+00 +2433 1346 4.16666666666667e+00 +2433 1508 -4.16666666666667e+00 +2433 1345 4.16666666666667e+00 +2433 1344 -1.87500000000000e+01 +2434 2434 6.25000000000000e+01 +2434 2426 4.16666666666667e+00 +2434 2425 -6.25000000000000e+00 +2434 2424 -2.08333333333333e+00 +2434 2421 2.08333333333333e+00 +2434 2328 4.16666666666667e+00 +2434 2325 -4.16666666666667e+00 +2434 2327 -4.16666666666667e+00 +2434 2330 -8.33333333333333e+00 +2434 2435 -8.33333333333333e+00 +2434 2393 8.33333333333333e+00 +2434 2144 4.16666666666667e+00 +2434 2142 -2.08333333333333e+00 +2434 2392 -3.75000000000000e+01 +2434 2433 -8.33333333333333e+00 +2434 2391 8.33333333333333e+00 +2434 1958 -2.08333333333333e+00 +2434 2390 4.16666666666667e+00 +2434 2423 2.08333333333333e+00 +2434 1957 -6.25000000000000e+00 +2434 2143 -6.25000000000000e+00 +2434 1956 4.16666666666667e+00 +2434 2388 -8.33333333333333e+00 +2434 1506 2.08333333333333e+00 +2434 1346 -2.08333333333333e+00 +2434 1508 2.08333333333333e+00 +2434 1345 -6.25000000000000e+00 +2434 1344 4.16666666666667e+00 +2435 2435 6.25000000000000e+01 +2435 2426 -1.87500000000000e+01 +2435 2425 4.16666666666667e+00 +2435 2424 4.16666666666667e+00 +2435 2421 -4.16666666666667e+00 +2435 2326 -4.16666666666667e+00 +2435 2329 -8.33333333333333e+00 +2435 2328 4.16666666666667e+00 +2435 2325 -4.16666666666667e+00 +2435 2388 4.16666666666667e+00 +2435 2391 -4.16666666666667e+00 +2435 2434 -8.33333333333333e+00 +2435 2392 8.33333333333333e+00 +2435 2143 4.16666666666667e+00 +2435 2393 -1.25000000000000e+01 +2435 2422 2.08333333333333e+00 +2435 1958 -6.25000000000000e+00 +2435 2144 -1.87500000000000e+01 +2435 1957 -2.08333333333333e+00 +2435 2389 4.16666666666667e+00 +2435 2433 -8.33333333333333e+00 +2435 1956 4.16666666666667e+00 +2435 2142 4.16666666666667e+00 +2435 1346 -6.25000000000000e+00 +2435 1345 -2.08333333333333e+00 +2435 1507 2.08333333333333e+00 +2435 1344 4.16666666666667e+00 +2435 1506 -4.16666666666667e+00 +2436 2436 6.25000000000000e+01 +2436 2374 -4.16666666666667e+00 +2436 2384 4.16666666666667e+00 +2436 2375 -4.16666666666667e+00 +2436 2429 -4.16666666666667e+00 +2436 2432 4.16666666666667e+00 +2436 2431 4.16666666666667e+00 +2436 2383 -8.33333333333333e+00 +2436 2430 -1.87500000000000e+01 +2436 2390 4.16666666666667e+00 +2436 2402 -4.16666666666667e+00 +2436 2143 4.16666666666667e+00 +2436 2437 -8.33333333333333e+00 +2436 2401 8.33333333333333e+00 +2436 1982 4.16666666666667e+00 +2436 2150 -4.16666666666667e+00 +2436 1981 -2.08333333333333e+00 +2436 2149 2.08333333333333e+00 +2436 1980 -6.25000000000000e+00 +2436 2400 -1.25000000000000e+01 +2436 2438 -8.33333333333333e+00 +2436 1958 4.16666666666667e+00 +2436 2144 4.16666666666667e+00 +2436 1957 -2.08333333333333e+00 +2436 2389 4.16666666666667e+00 +2436 2428 2.08333333333333e+00 +2436 1956 -6.25000000000000e+00 +2436 2142 -1.87500000000000e+01 +2437 2437 6.25000000000000e+01 +2437 2373 -4.16666666666667e+00 +2437 2429 2.08333333333333e+00 +2437 2375 -4.16666666666667e+00 +2437 2432 -2.08333333333333e+00 +2437 2384 4.16666666666667e+00 +2437 2431 -6.25000000000000e+00 +2437 2430 4.16666666666667e+00 +2437 2382 -8.33333333333333e+00 +2437 2144 -2.08333333333333e+00 +2437 2150 2.08333333333333e+00 +2437 2142 4.16666666666667e+00 +2437 2436 -8.33333333333333e+00 +2437 2400 8.33333333333333e+00 +2437 1982 4.16666666666667e+00 +2437 2438 -8.33333333333333e+00 +2437 2402 8.33333333333333e+00 +2437 1981 -6.25000000000000e+00 +2437 2401 -3.75000000000000e+01 +2437 1980 -2.08333333333333e+00 +2437 2148 2.08333333333333e+00 +2437 1958 4.16666666666667e+00 +2437 2390 -8.33333333333333e+00 +2437 2427 2.08333333333333e+00 +2437 1957 -6.25000000000000e+00 +2437 2143 -6.25000000000000e+00 +2437 1956 -2.08333333333333e+00 +2437 2388 4.16666666666667e+00 +2438 2438 6.25000000000000e+01 +2438 2373 -4.16666666666667e+00 +2438 2428 2.08333333333333e+00 +2438 2374 -4.16666666666667e+00 +2438 2427 -4.16666666666667e+00 +2438 2432 -6.25000000000000e+00 +2438 2431 -2.08333333333333e+00 +2438 2383 4.16666666666667e+00 +2438 2430 4.16666666666667e+00 +2438 2143 -2.08333333333333e+00 +2438 2149 2.08333333333333e+00 +2438 2388 4.16666666666667e+00 +2438 2400 -4.16666666666667e+00 +2438 1982 -1.87500000000000e+01 +2438 2402 -1.25000000000000e+01 +2438 1981 4.16666666666667e+00 +2438 2437 -8.33333333333333e+00 +2438 2401 8.33333333333333e+00 +2438 1980 4.16666666666667e+00 +2438 2148 -4.16666666666667e+00 +2438 2382 4.16666666666667e+00 +2438 1958 -1.87500000000000e+01 +2438 2144 -6.25000000000000e+00 +2438 1957 4.16666666666667e+00 +2438 2389 -8.33333333333333e+00 +2438 2436 -8.33333333333333e+00 +2438 1956 4.16666666666667e+00 +2438 2142 4.16666666666667e+00 +2439 2439 6.25000000000000e+01 +2439 2236 -4.16666666666667e+00 +2439 2444 4.16666666666667e+00 +2439 2441 -8.33333333333333e+00 +2439 2237 8.33333333333333e+00 +2439 2234 4.16666666666667e+00 +2439 1961 -2.08333333333333e+00 +2439 2443 4.16666666666667e+00 +2439 2442 -1.87500000000000e+01 +2439 2453 2.08333333333333e+00 +2439 1967 -2.08333333333333e+00 +2439 2452 -4.16666666666667e+00 +2439 2235 -1.25000000000000e+01 +2439 2216 -4.16666666666667e+00 +2439 2072 2.08333333333333e+00 +2439 2215 -4.16666666666667e+00 +2439 2221 4.16666666666667e+00 +2439 2071 -4.16666666666667e+00 +2439 1960 4.16666666666667e+00 +2439 1959 -6.25000000000000e+00 +2439 2078 4.16666666666667e+00 +2439 2222 -8.33333333333333e+00 +2439 2077 4.16666666666667e+00 +2439 2440 -8.33333333333333e+00 +2439 1966 4.16666666666667e+00 +2439 2076 -1.87500000000000e+01 +2439 2233 4.16666666666667e+00 +2439 1965 -6.25000000000000e+00 +2440 2440 6.25000000000000e+01 +2440 2235 -4.16666666666667e+00 +2440 2444 -2.08333333333333e+00 +2440 2453 2.08333333333333e+00 +2440 2234 -8.33333333333333e+00 +2440 1961 4.16666666666667e+00 +2440 2443 -6.25000000000000e+00 +2440 2442 4.16666666666667e+00 +2440 2237 8.33333333333333e+00 +2440 2441 -8.33333333333333e+00 +2440 1967 4.16666666666667e+00 +2440 2236 -1.25000000000000e+01 +2440 2451 -4.16666666666667e+00 +2440 2214 -4.16666666666667e+00 +2440 2220 4.16666666666667e+00 +2440 2072 2.08333333333333e+00 +2440 2216 -4.16666666666667e+00 +2440 1960 -1.87500000000000e+01 +2440 2070 -4.16666666666667e+00 +2440 1959 4.16666666666667e+00 +2440 2078 -2.08333333333333e+00 +2440 2222 4.16666666666667e+00 +2440 2077 -6.25000000000000e+00 +2440 2232 4.16666666666667e+00 +2440 1966 -1.87500000000000e+01 +2440 2076 4.16666666666667e+00 +2440 2439 -8.33333333333333e+00 +2440 1965 4.16666666666667e+00 +2441 2441 6.25000000000000e+01 +2441 2452 2.08333333333333e+00 +2441 2442 4.16666666666667e+00 +2441 2439 -8.33333333333333e+00 +2441 2235 8.33333333333333e+00 +2441 2444 -6.25000000000000e+00 +2441 2233 -8.33333333333333e+00 +2441 1960 4.16666666666667e+00 +2441 2232 4.16666666666667e+00 +2441 1959 -2.08333333333333e+00 +2441 2237 -3.75000000000000e+01 +2441 2236 8.33333333333333e+00 +2441 2440 -8.33333333333333e+00 +2441 1966 4.16666666666667e+00 +2441 2451 2.08333333333333e+00 +2441 1965 -2.08333333333333e+00 +2441 2214 -4.16666666666667e+00 +2441 2070 2.08333333333333e+00 +2441 1961 -6.25000000000000e+00 +2441 2071 2.08333333333333e+00 +2441 2215 -4.16666666666667e+00 +2441 2078 -6.25000000000000e+00 +2441 2443 -2.08333333333333e+00 +2441 1967 -6.25000000000000e+00 +2441 2077 -2.08333333333333e+00 +2441 2221 4.16666666666667e+00 +2441 2076 4.16666666666667e+00 +2441 2220 -8.33333333333333e+00 +2442 2442 6.25000000000000e+01 +2442 2441 4.16666666666667e+00 +2442 2237 -8.33333333333333e+00 +2442 1961 2.08333333333333e+00 +2442 2440 4.16666666666667e+00 +2442 2439 -1.87500000000000e+01 +2442 1973 2.08333333333333e+00 +2442 2453 -2.08333333333333e+00 +2442 2452 4.16666666666667e+00 +2442 2451 -6.25000000000000e+00 +2442 2234 -4.16666666666667e+00 +2442 2233 -4.16666666666667e+00 +2442 2081 4.16666666666667e+00 +2442 2087 -2.08333333333333e+00 +2442 2443 -8.33333333333333e+00 +2442 2080 4.16666666666667e+00 +2442 2239 -4.16666666666667e+00 +2442 1960 -4.16666666666667e+00 +2442 2086 4.16666666666667e+00 +2442 2085 -6.25000000000000e+00 +2442 2444 -8.33333333333333e+00 +2442 2093 4.16666666666667e+00 +2442 2240 8.33333333333333e+00 +2442 2092 4.16666666666667e+00 +2442 1972 -4.16666666666667e+00 +2442 2236 4.16666666666667e+00 +2442 2091 -1.87500000000000e+01 +2442 2238 -1.25000000000000e+01 +2443 2443 6.25000000000000e+01 +2443 2441 -2.08333333333333e+00 +2443 2237 4.16666666666667e+00 +2443 2440 -6.25000000000000e+00 +2443 2439 4.16666666666667e+00 +2443 2444 -8.33333333333333e+00 +2443 2453 4.16666666666667e+00 +2443 2452 -1.87500000000000e+01 +2443 2451 4.16666666666667e+00 +2443 2232 -4.16666666666667e+00 +2443 2087 4.16666666666667e+00 +2443 2442 -8.33333333333333e+00 +2443 2081 -8.33333333333333e+00 +2443 2240 8.33333333333333e+00 +2443 2079 4.16666666666667e+00 +2443 2238 -4.16666666666667e+00 +2443 1961 2.08333333333333e+00 +2443 2234 -4.16666666666667e+00 +2443 2086 -1.87500000000000e+01 +2443 1959 -4.16666666666667e+00 +2443 2085 4.16666666666667e+00 +2443 2093 -2.08333333333333e+00 +2443 1973 2.08333333333333e+00 +2443 2235 4.16666666666667e+00 +2443 2092 -6.25000000000000e+00 +2443 2239 -1.25000000000000e+01 +2443 2091 4.16666666666667e+00 +2443 1971 -4.16666666666667e+00 +2444 2444 6.25000000000000e+01 +2444 2236 4.16666666666667e+00 +2444 2439 4.16666666666667e+00 +2444 2235 -8.33333333333333e+00 +2444 2441 -6.25000000000000e+00 +2444 1959 2.08333333333333e+00 +2444 2453 -6.25000000000000e+00 +2444 2443 -8.33333333333333e+00 +2444 2452 4.16666666666667e+00 +2444 1971 2.08333333333333e+00 +2444 2451 -2.08333333333333e+00 +2444 2232 -4.16666666666667e+00 +2444 2086 4.16666666666667e+00 +2444 2079 4.16666666666667e+00 +2444 2085 -2.08333333333333e+00 +2444 2080 -8.33333333333333e+00 +2444 2239 8.33333333333333e+00 +2444 2087 -6.25000000000000e+00 +2444 1960 2.08333333333333e+00 +2444 2233 -4.16666666666667e+00 +2444 2440 -2.08333333333333e+00 +2444 2093 -6.25000000000000e+00 +2444 2240 -3.75000000000000e+01 +2444 2092 -2.08333333333333e+00 +2444 1972 2.08333333333333e+00 +2444 2442 -8.33333333333333e+00 +2444 2091 4.16666666666667e+00 +2444 2238 8.33333333333333e+00 +2445 2445 6.25000000000000e+01 +2445 2254 -4.16666666666667e+00 +2445 2450 -2.08333333333333e+00 +2445 2456 2.08333333333333e+00 +2445 1964 0.00000000000000e+00 +2445 2252 0.00000000000000e+00 +2445 2449 4.16666666666667e+00 +2445 2448 -6.25000000000000e+00 +2445 2447 -8.33333333333333e+00 +2445 2255 8.33333333333333e+00 +2445 1967 4.16666666666667e+00 +2445 2455 -4.16666666666667e+00 +2445 2253 -1.25000000000000e+01 +2445 2218 0.00000000000000e+00 +2445 2221 4.16666666666667e+00 +2445 2075 0.00000000000000e+00 +2445 2219 0.00000000000000e+00 +2445 1963 0.00000000000000e+00 +2445 2074 0.00000000000000e+00 +2445 1962 0.00000000000000e+00 +2445 2078 -2.08333333333333e+00 +2445 2222 4.16666666666667e+00 +2445 2446 -8.33333333333333e+00 +2445 2077 4.16666666666667e+00 +2445 1966 4.16666666666667e+00 +2445 2251 0.00000000000000e+00 +2445 2076 -6.25000000000000e+00 +2445 1965 -1.87500000000000e+01 +2446 2446 6.25000000000000e+01 +2446 2253 -4.16666666666667e+00 +2446 2447 -8.33333333333333e+00 +2446 2450 4.16666666666667e+00 +2446 2255 8.33333333333333e+00 +2446 1964 0.00000000000000e+00 +2446 2252 0.00000000000000e+00 +2446 2449 -1.87500000000000e+01 +2446 2448 4.16666666666667e+00 +2446 2456 2.08333333333333e+00 +2446 1967 -2.08333333333333e+00 +2446 2254 -1.25000000000000e+01 +2446 2454 -4.16666666666667e+00 +2446 2075 0.00000000000000e+00 +2446 2219 0.00000000000000e+00 +2446 2217 0.00000000000000e+00 +2446 2220 4.16666666666667e+00 +2446 1963 0.00000000000000e+00 +2446 1962 0.00000000000000e+00 +2446 2073 0.00000000000000e+00 +2446 2078 4.16666666666667e+00 +2446 2222 -8.33333333333333e+00 +2446 2250 0.00000000000000e+00 +2446 2077 -1.87500000000000e+01 +2446 1966 -6.25000000000000e+00 +2446 2445 -8.33333333333333e+00 +2446 2076 4.16666666666667e+00 +2446 1965 4.16666666666667e+00 +2447 2447 6.25000000000000e+01 +2447 2449 4.16666666666667e+00 +2447 2254 8.33333333333333e+00 +2447 2448 -2.08333333333333e+00 +2447 2454 2.08333333333333e+00 +2447 2450 -6.25000000000000e+00 +2447 1963 0.00000000000000e+00 +2447 2251 0.00000000000000e+00 +2447 1962 0.00000000000000e+00 +2447 2250 0.00000000000000e+00 +2447 2255 -3.75000000000000e+01 +2447 2455 2.08333333333333e+00 +2447 1966 -2.08333333333333e+00 +2447 2445 -8.33333333333333e+00 +2447 2253 8.33333333333333e+00 +2447 1965 4.16666666666667e+00 +2447 2074 0.00000000000000e+00 +2447 2218 0.00000000000000e+00 +2447 1964 0.00000000000000e+00 +2447 2073 0.00000000000000e+00 +2447 2217 0.00000000000000e+00 +2447 2446 -8.33333333333333e+00 +2447 2078 -6.25000000000000e+00 +2447 1967 -6.25000000000000e+00 +2447 2077 4.16666666666667e+00 +2447 2221 -8.33333333333333e+00 +2447 2076 -2.08333333333333e+00 +2447 2220 4.16666666666667e+00 +2448 2448 6.25000000000000e+01 +2448 2447 -2.08333333333333e+00 +2448 2255 4.16666666666667e+00 +2448 2446 4.16666666666667e+00 +2448 2445 -6.25000000000000e+00 +2448 2450 -8.33333333333333e+00 +2448 2456 4.16666666666667e+00 +2448 2455 4.16666666666667e+00 +2448 2454 -1.87500000000000e+01 +2448 2251 0.00000000000000e+00 +2448 2111 0.00000000000000e+00 +2448 2449 -8.33333333333333e+00 +2448 2105 0.00000000000000e+00 +2448 2258 8.33333333333333e+00 +2448 2104 0.00000000000000e+00 +2448 2257 -4.16666666666667e+00 +2448 1964 0.00000000000000e+00 +2448 2252 0.00000000000000e+00 +2448 2110 0.00000000000000e+00 +2448 1963 0.00000000000000e+00 +2448 2109 0.00000000000000e+00 +2448 2114 -2.08333333333333e+00 +2448 1979 2.08333333333333e+00 +2448 2113 4.16666666666667e+00 +2448 1978 -4.16666666666667e+00 +2448 2112 -6.25000000000000e+00 +2448 2254 4.16666666666667e+00 +2448 2256 -1.25000000000000e+01 +2449 2449 6.25000000000000e+01 +2449 2447 4.16666666666667e+00 +2449 2255 -8.33333333333333e+00 +2449 1964 0.00000000000000e+00 +2449 2446 -1.87500000000000e+01 +2449 2445 4.16666666666667e+00 +2449 1979 2.08333333333333e+00 +2449 2456 -2.08333333333333e+00 +2449 2455 -6.25000000000000e+00 +2449 2454 4.16666666666667e+00 +2449 2252 0.00000000000000e+00 +2449 2250 0.00000000000000e+00 +2449 2111 0.00000000000000e+00 +2449 2105 0.00000000000000e+00 +2449 2448 -8.33333333333333e+00 +2449 2103 0.00000000000000e+00 +2449 2256 -4.16666666666667e+00 +2449 2110 0.00000000000000e+00 +2449 2109 0.00000000000000e+00 +2449 1962 0.00000000000000e+00 +2449 2114 4.16666666666667e+00 +2449 2450 -8.33333333333333e+00 +2449 2258 8.33333333333333e+00 +2449 2113 -1.87500000000000e+01 +2449 2253 4.16666666666667e+00 +2449 2257 -1.25000000000000e+01 +2449 2112 4.16666666666667e+00 +2449 1977 -4.16666666666667e+00 +2450 2450 6.25000000000000e+01 +2450 2254 -8.33333333333333e+00 +2450 2445 -2.08333333333333e+00 +2450 2253 4.16666666666667e+00 +2450 2447 -6.25000000000000e+00 +2450 1963 0.00000000000000e+00 +2450 2456 -6.25000000000000e+00 +2450 1978 2.08333333333333e+00 +2450 2455 -2.08333333333333e+00 +2450 2448 -8.33333333333333e+00 +2450 2454 4.16666666666667e+00 +2450 2251 0.00000000000000e+00 +2450 2110 0.00000000000000e+00 +2450 2104 0.00000000000000e+00 +2450 2109 0.00000000000000e+00 +2450 2103 0.00000000000000e+00 +2450 2256 8.33333333333333e+00 +2450 2111 0.00000000000000e+00 +2450 1962 0.00000000000000e+00 +2450 2250 0.00000000000000e+00 +2450 2114 -6.25000000000000e+00 +2450 2446 4.16666666666667e+00 +2450 2258 -3.75000000000000e+01 +2450 2113 4.16666666666667e+00 +2450 2449 -8.33333333333333e+00 +2450 2257 8.33333333333333e+00 +2450 2112 -2.08333333333333e+00 +2450 1977 2.08333333333333e+00 +2451 2451 6.25000000000000e+01 +2451 2443 4.16666666666667e+00 +2451 2442 -6.25000000000000e+00 +2451 2441 2.08333333333333e+00 +2451 2440 -4.16666666666667e+00 +2451 2240 4.16666666666667e+00 +2451 2237 -4.16666666666667e+00 +2451 2239 4.16666666666667e+00 +2451 2236 -4.16666666666667e+00 +2451 2272 -4.16666666666667e+00 +2451 2269 4.16666666666667e+00 +2451 2132 2.08333333333333e+00 +2451 2129 -2.08333333333333e+00 +2451 1967 4.16666666666667e+00 +2451 2270 -8.33333333333333e+00 +2451 1966 4.16666666666667e+00 +2451 2452 -8.33333333333333e+00 +2451 2128 4.16666666666667e+00 +2451 1965 -1.87500000000000e+01 +2451 2127 -6.25000000000000e+00 +2451 2453 -8.33333333333333e+00 +2451 1973 4.16666666666667e+00 +2451 2273 8.33333333333333e+00 +2451 1972 4.16666666666667e+00 +2451 2131 -4.16666666666667e+00 +2451 2444 -2.08333333333333e+00 +2451 1971 -1.87500000000000e+01 +2451 2271 -1.25000000000000e+01 +2452 2452 6.25000000000000e+01 +2452 2444 4.16666666666667e+00 +2452 2443 -1.87500000000000e+01 +2452 2442 4.16666666666667e+00 +2452 2439 -4.16666666666667e+00 +2452 2237 -4.16666666666667e+00 +2452 2240 -8.33333333333333e+00 +2452 2238 4.16666666666667e+00 +2452 2235 -4.16666666666667e+00 +2452 2271 -4.16666666666667e+00 +2452 2268 4.16666666666667e+00 +2452 2273 8.33333333333333e+00 +2452 2453 -8.33333333333333e+00 +2452 2129 4.16666666666667e+00 +2452 1967 -2.08333333333333e+00 +2452 2270 4.16666666666667e+00 +2452 1966 -6.25000000000000e+00 +2452 2128 -1.87500000000000e+01 +2452 1965 4.16666666666667e+00 +2452 2451 -8.33333333333333e+00 +2452 2127 4.16666666666667e+00 +2452 1973 -2.08333333333333e+00 +2452 2132 2.08333333333333e+00 +2452 2441 2.08333333333333e+00 +2452 1972 -6.25000000000000e+00 +2452 2272 -1.25000000000000e+01 +2452 1971 4.16666666666667e+00 +2452 2130 -4.16666666666667e+00 +2453 2453 6.25000000000000e+01 +2453 2444 -6.25000000000000e+00 +2453 2443 4.16666666666667e+00 +2453 2442 -2.08333333333333e+00 +2453 2439 2.08333333333333e+00 +2453 2238 4.16666666666667e+00 +2453 2235 -4.16666666666667e+00 +2453 2236 -4.16666666666667e+00 +2453 2239 -8.33333333333333e+00 +2453 2272 8.33333333333333e+00 +2453 2452 -8.33333333333333e+00 +2453 2128 4.16666666666667e+00 +2453 2130 2.08333333333333e+00 +2453 2127 -2.08333333333333e+00 +2453 1967 -6.25000000000000e+00 +2453 2129 -6.25000000000000e+00 +2453 1966 -2.08333333333333e+00 +2453 2269 4.16666666666667e+00 +2453 1965 4.16666666666667e+00 +2453 2268 -8.33333333333333e+00 +2453 2440 2.08333333333333e+00 +2453 1973 -6.25000000000000e+00 +2453 2273 -3.75000000000000e+01 +2453 1972 -2.08333333333333e+00 +2453 2131 2.08333333333333e+00 +2453 2451 -8.33333333333333e+00 +2453 1971 4.16666666666667e+00 +2453 2271 8.33333333333333e+00 +2454 2454 6.25000000000000e+01 +2454 2450 4.16666666666667e+00 +2454 2449 4.16666666666667e+00 +2454 2448 -1.87500000000000e+01 +2454 2446 -4.16666666666667e+00 +2454 2255 -4.16666666666667e+00 +2454 2258 -8.33333333333333e+00 +2454 2257 4.16666666666667e+00 +2454 2254 -4.16666666666667e+00 +2454 2269 4.16666666666667e+00 +2454 2275 -4.16666666666667e+00 +2454 2456 -8.33333333333333e+00 +2454 2276 8.33333333333333e+00 +2454 2129 4.16666666666667e+00 +2454 1979 -2.08333333333333e+00 +2454 2135 2.08333333333333e+00 +2454 1978 4.16666666666667e+00 +2454 2134 -4.16666666666667e+00 +2454 1977 -6.25000000000000e+00 +2454 2274 -1.25000000000000e+01 +2454 1967 -2.08333333333333e+00 +2454 2270 4.16666666666667e+00 +2454 2455 -8.33333333333333e+00 +2454 1966 4.16666666666667e+00 +2454 2128 4.16666666666667e+00 +2454 2447 2.08333333333333e+00 +2454 1965 -6.25000000000000e+00 +2454 2127 -1.87500000000000e+01 +2455 2455 6.25000000000000e+01 +2455 2449 -6.25000000000000e+00 +2455 2448 4.16666666666667e+00 +2455 2447 2.08333333333333e+00 +2455 2445 -4.16666666666667e+00 +2455 2258 4.16666666666667e+00 +2455 2255 -4.16666666666667e+00 +2455 2256 4.16666666666667e+00 +2455 2253 -4.16666666666667e+00 +2455 2268 4.16666666666667e+00 +2455 2274 -4.16666666666667e+00 +2455 2135 2.08333333333333e+00 +2455 2129 -2.08333333333333e+00 +2455 1979 4.16666666666667e+00 +2455 2456 -8.33333333333333e+00 +2455 2276 8.33333333333333e+00 +2455 1978 -1.87500000000000e+01 +2455 2275 -1.25000000000000e+01 +2455 1977 4.16666666666667e+00 +2455 2133 -4.16666666666667e+00 +2455 1967 4.16666666666667e+00 +2455 2270 -8.33333333333333e+00 +2455 2450 -2.08333333333333e+00 +2455 1966 -1.87500000000000e+01 +2455 2128 -6.25000000000000e+00 +2455 2454 -8.33333333333333e+00 +2455 1965 4.16666666666667e+00 +2455 2127 4.16666666666667e+00 +2456 2456 6.25000000000000e+01 +2456 2450 -6.25000000000000e+00 +2456 2449 -2.08333333333333e+00 +2456 2448 4.16666666666667e+00 +2456 2446 2.08333333333333e+00 +2456 2257 4.16666666666667e+00 +2456 2254 -4.16666666666667e+00 +2456 2253 -4.16666666666667e+00 +2456 2256 -8.33333333333333e+00 +2456 2134 2.08333333333333e+00 +2456 2128 -2.08333333333333e+00 +2456 2454 -8.33333333333333e+00 +2456 2274 8.33333333333333e+00 +2456 2127 4.16666666666667e+00 +2456 1979 -6.25000000000000e+00 +2456 2276 -3.75000000000000e+01 +2456 1978 4.16666666666667e+00 +2456 2455 -8.33333333333333e+00 +2456 2275 8.33333333333333e+00 +2456 1977 -2.08333333333333e+00 +2456 2133 2.08333333333333e+00 +2456 2445 2.08333333333333e+00 +2456 1967 -6.25000000000000e+00 +2456 2129 -6.25000000000000e+00 +2456 1966 4.16666666666667e+00 +2456 2269 -8.33333333333333e+00 +2456 1965 -2.08333333333333e+00 +2456 2268 4.16666666666667e+00 +2457 2457 6.25000000000000e+01 +2457 2362 -4.16666666666667e+00 +2457 2462 4.16666666666667e+00 +2457 2459 -8.33333333333333e+00 +2457 2363 8.33333333333333e+00 +2457 2360 4.16666666666667e+00 +2457 1970 -2.08333333333333e+00 +2457 2461 4.16666666666667e+00 +2457 2460 -1.87500000000000e+01 +2457 2471 2.08333333333333e+00 +2457 1976 -2.08333333333333e+00 +2457 2470 -4.16666666666667e+00 +2457 2361 -1.25000000000000e+01 +2457 2342 -4.16666666666667e+00 +2457 2090 2.08333333333333e+00 +2457 2341 -4.16666666666667e+00 +2457 2347 4.16666666666667e+00 +2457 2089 -4.16666666666667e+00 +2457 1969 4.16666666666667e+00 +2457 1968 -6.25000000000000e+00 +2457 2096 4.16666666666667e+00 +2457 2348 -8.33333333333333e+00 +2457 2095 4.16666666666667e+00 +2457 2458 -8.33333333333333e+00 +2457 1975 4.16666666666667e+00 +2457 2094 -1.87500000000000e+01 +2457 2359 4.16666666666667e+00 +2457 1974 -6.25000000000000e+00 +2458 2458 6.25000000000000e+01 +2458 2361 -4.16666666666667e+00 +2458 2462 -2.08333333333333e+00 +2458 2471 2.08333333333333e+00 +2458 2360 -8.33333333333333e+00 +2458 1970 4.16666666666667e+00 +2458 2461 -6.25000000000000e+00 +2458 2460 4.16666666666667e+00 +2458 2363 8.33333333333333e+00 +2458 2459 -8.33333333333333e+00 +2458 1976 4.16666666666667e+00 +2458 2362 -1.25000000000000e+01 +2458 2469 -4.16666666666667e+00 +2458 2340 -4.16666666666667e+00 +2458 2346 4.16666666666667e+00 +2458 2090 2.08333333333333e+00 +2458 2342 -4.16666666666667e+00 +2458 1969 -1.87500000000000e+01 +2458 2088 -4.16666666666667e+00 +2458 1968 4.16666666666667e+00 +2458 2096 -2.08333333333333e+00 +2458 2348 4.16666666666667e+00 +2458 2095 -6.25000000000000e+00 +2458 2358 4.16666666666667e+00 +2458 1975 -1.87500000000000e+01 +2458 2094 4.16666666666667e+00 +2458 2457 -8.33333333333333e+00 +2458 1974 4.16666666666667e+00 +2459 2459 6.25000000000000e+01 +2459 2470 2.08333333333333e+00 +2459 2460 4.16666666666667e+00 +2459 2457 -8.33333333333333e+00 +2459 2361 8.33333333333333e+00 +2459 2462 -6.25000000000000e+00 +2459 2359 -8.33333333333333e+00 +2459 1969 4.16666666666667e+00 +2459 2358 4.16666666666667e+00 +2459 1968 -2.08333333333333e+00 +2459 2363 -3.75000000000000e+01 +2459 2362 8.33333333333333e+00 +2459 2458 -8.33333333333333e+00 +2459 1975 4.16666666666667e+00 +2459 2469 2.08333333333333e+00 +2459 1974 -2.08333333333333e+00 +2459 2340 -4.16666666666667e+00 +2459 2088 2.08333333333333e+00 +2459 1970 -6.25000000000000e+00 +2459 2089 2.08333333333333e+00 +2459 2341 -4.16666666666667e+00 +2459 2096 -6.25000000000000e+00 +2459 2461 -2.08333333333333e+00 +2459 1976 -6.25000000000000e+00 +2459 2095 -2.08333333333333e+00 +2459 2347 4.16666666666667e+00 +2459 2094 4.16666666666667e+00 +2459 2346 -8.33333333333333e+00 +2460 2460 6.25000000000000e+01 +2460 2459 4.16666666666667e+00 +2460 2363 -8.33333333333333e+00 +2460 1970 2.08333333333333e+00 +2460 2458 4.16666666666667e+00 +2460 2457 -1.87500000000000e+01 +2460 2471 -2.08333333333333e+00 +2460 2470 4.16666666666667e+00 +2460 2469 -6.25000000000000e+00 +2460 2360 -4.16666666666667e+00 +2460 2359 -4.16666666666667e+00 +2460 2099 4.16666666666667e+00 +2460 2102 -2.08333333333333e+00 +2460 2461 -8.33333333333333e+00 +2460 2098 4.16666666666667e+00 +2460 2365 -4.16666666666667e+00 +2460 1969 -4.16666666666667e+00 +2460 2101 4.16666666666667e+00 +2460 2100 -6.25000000000000e+00 +2460 2462 -8.33333333333333e+00 +2460 2366 8.33333333333333e+00 +2460 2362 4.16666666666667e+00 +2460 2364 -1.25000000000000e+01 +2460 1364 2.08333333333333e+00 +2460 1475 4.16666666666667e+00 +2460 1474 4.16666666666667e+00 +2460 1363 -4.16666666666667e+00 +2460 1473 -1.87500000000000e+01 +2461 2461 6.25000000000000e+01 +2461 2459 -2.08333333333333e+00 +2461 2363 4.16666666666667e+00 +2461 2458 -6.25000000000000e+00 +2461 2457 4.16666666666667e+00 +2461 2462 -8.33333333333333e+00 +2461 2471 4.16666666666667e+00 +2461 2470 -1.87500000000000e+01 +2461 2469 4.16666666666667e+00 +2461 2358 -4.16666666666667e+00 +2461 2102 4.16666666666667e+00 +2461 2460 -8.33333333333333e+00 +2461 2099 -8.33333333333333e+00 +2461 2366 8.33333333333333e+00 +2461 2097 4.16666666666667e+00 +2461 2364 -4.16666666666667e+00 +2461 1970 2.08333333333333e+00 +2461 2360 -4.16666666666667e+00 +2461 2101 -1.87500000000000e+01 +2461 1968 -4.16666666666667e+00 +2461 2100 4.16666666666667e+00 +2461 2361 4.16666666666667e+00 +2461 2365 -1.25000000000000e+01 +2461 1475 -2.08333333333333e+00 +2461 1364 2.08333333333333e+00 +2461 1474 -6.25000000000000e+00 +2461 1473 4.16666666666667e+00 +2461 1362 -4.16666666666667e+00 +2462 2462 6.25000000000000e+01 +2462 2362 4.16666666666667e+00 +2462 2457 4.16666666666667e+00 +2462 2361 -8.33333333333333e+00 +2462 2459 -6.25000000000000e+00 +2462 1968 2.08333333333333e+00 +2462 2471 -6.25000000000000e+00 +2462 2461 -8.33333333333333e+00 +2462 2470 4.16666666666667e+00 +2462 2469 -2.08333333333333e+00 +2462 2358 -4.16666666666667e+00 +2462 2101 4.16666666666667e+00 +2462 2097 4.16666666666667e+00 +2462 2100 -2.08333333333333e+00 +2462 2098 -8.33333333333333e+00 +2462 2365 8.33333333333333e+00 +2462 2102 -6.25000000000000e+00 +2462 1969 2.08333333333333e+00 +2462 2359 -4.16666666666667e+00 +2462 2458 -2.08333333333333e+00 +2462 2366 -3.75000000000000e+01 +2462 2460 -8.33333333333333e+00 +2462 2364 8.33333333333333e+00 +2462 1362 2.08333333333333e+00 +2462 1475 -6.25000000000000e+00 +2462 1474 -2.08333333333333e+00 +2462 1363 2.08333333333333e+00 +2462 1473 4.16666666666667e+00 +2463 2463 6.25000000000000e+01 +2463 2380 -4.16666666666667e+00 +2463 2468 -2.08333333333333e+00 +2463 2474 2.08333333333333e+00 +2463 1973 4.16666666666667e+00 +2463 2378 -8.33333333333333e+00 +2463 2467 4.16666666666667e+00 +2463 2466 -6.25000000000000e+00 +2463 2465 -8.33333333333333e+00 +2463 2381 8.33333333333333e+00 +2463 1976 4.16666666666667e+00 +2463 2473 -4.16666666666667e+00 +2463 2379 -1.25000000000000e+01 +2463 2344 -4.16666666666667e+00 +2463 2347 4.16666666666667e+00 +2463 2093 2.08333333333333e+00 +2463 2345 -4.16666666666667e+00 +2463 1972 4.16666666666667e+00 +2463 2092 -4.16666666666667e+00 +2463 1971 -1.87500000000000e+01 +2463 2096 -2.08333333333333e+00 +2463 2348 4.16666666666667e+00 +2463 2464 -8.33333333333333e+00 +2463 2095 4.16666666666667e+00 +2463 1975 4.16666666666667e+00 +2463 2377 4.16666666666667e+00 +2463 2094 -6.25000000000000e+00 +2463 1974 -1.87500000000000e+01 +2464 2464 6.25000000000000e+01 +2464 2379 -4.16666666666667e+00 +2464 2465 -8.33333333333333e+00 +2464 2468 4.16666666666667e+00 +2464 2381 8.33333333333333e+00 +2464 1973 -2.08333333333333e+00 +2464 2378 4.16666666666667e+00 +2464 2467 -1.87500000000000e+01 +2464 2466 4.16666666666667e+00 +2464 2474 2.08333333333333e+00 +2464 1976 -2.08333333333333e+00 +2464 2380 -1.25000000000000e+01 +2464 2472 -4.16666666666667e+00 +2464 2093 2.08333333333333e+00 +2464 2345 -4.16666666666667e+00 +2464 2343 -4.16666666666667e+00 +2464 2346 4.16666666666667e+00 +2464 1972 -6.25000000000000e+00 +2464 1971 4.16666666666667e+00 +2464 2091 -4.16666666666667e+00 +2464 2096 4.16666666666667e+00 +2464 2348 -8.33333333333333e+00 +2464 2376 4.16666666666667e+00 +2464 2095 -1.87500000000000e+01 +2464 1975 -6.25000000000000e+00 +2464 2463 -8.33333333333333e+00 +2464 2094 4.16666666666667e+00 +2464 1974 4.16666666666667e+00 +2465 2465 6.25000000000000e+01 +2465 2467 4.16666666666667e+00 +2465 2380 8.33333333333333e+00 +2465 2466 -2.08333333333333e+00 +2465 2472 2.08333333333333e+00 +2465 2468 -6.25000000000000e+00 +2465 1972 -2.08333333333333e+00 +2465 2377 4.16666666666667e+00 +2465 1971 4.16666666666667e+00 +2465 2376 -8.33333333333333e+00 +2465 2381 -3.75000000000000e+01 +2465 2473 2.08333333333333e+00 +2465 1975 -2.08333333333333e+00 +2465 2463 -8.33333333333333e+00 +2465 2379 8.33333333333333e+00 +2465 1974 4.16666666666667e+00 +2465 2092 2.08333333333333e+00 +2465 2344 -4.16666666666667e+00 +2465 1973 -6.25000000000000e+00 +2465 2091 2.08333333333333e+00 +2465 2343 -4.16666666666667e+00 +2465 2464 -8.33333333333333e+00 +2465 2096 -6.25000000000000e+00 +2465 1976 -6.25000000000000e+00 +2465 2095 4.16666666666667e+00 +2465 2347 -8.33333333333333e+00 +2465 2094 -2.08333333333333e+00 +2465 2346 4.16666666666667e+00 +2466 2466 6.25000000000000e+01 +2466 2465 -2.08333333333333e+00 +2466 2381 4.16666666666667e+00 +2466 2464 4.16666666666667e+00 +2466 2463 -6.25000000000000e+00 +2466 2468 -8.33333333333333e+00 +2466 2474 4.16666666666667e+00 +2466 2473 4.16666666666667e+00 +2466 2472 -1.87500000000000e+01 +2466 2377 -4.16666666666667e+00 +2466 2132 4.16666666666667e+00 +2466 2467 -8.33333333333333e+00 +2466 2120 -8.33333333333333e+00 +2466 2384 8.33333333333333e+00 +2466 2119 4.16666666666667e+00 +2466 2383 -4.16666666666667e+00 +2466 1973 2.08333333333333e+00 +2466 2378 -4.16666666666667e+00 +2466 2131 4.16666666666667e+00 +2466 1972 -4.16666666666667e+00 +2466 2130 -1.87500000000000e+01 +2466 2138 -2.08333333333333e+00 +2466 1982 2.08333333333333e+00 +2466 2137 4.16666666666667e+00 +2466 1981 -4.16666666666667e+00 +2466 2136 -6.25000000000000e+00 +2466 2380 4.16666666666667e+00 +2466 2382 -1.25000000000000e+01 +2467 2467 6.25000000000000e+01 +2467 2465 4.16666666666667e+00 +2467 2381 -8.33333333333333e+00 +2467 1973 2.08333333333333e+00 +2467 2464 -1.87500000000000e+01 +2467 2463 4.16666666666667e+00 +2467 1982 2.08333333333333e+00 +2467 2474 -2.08333333333333e+00 +2467 2473 -6.25000000000000e+00 +2467 2472 4.16666666666667e+00 +2467 2378 -4.16666666666667e+00 +2467 2376 -4.16666666666667e+00 +2467 2132 -2.08333333333333e+00 +2467 2120 4.16666666666667e+00 +2467 2466 -8.33333333333333e+00 +2467 2118 4.16666666666667e+00 +2467 2382 -4.16666666666667e+00 +2467 2131 -6.25000000000000e+00 +2467 2130 4.16666666666667e+00 +2467 1971 -4.16666666666667e+00 +2467 2138 4.16666666666667e+00 +2467 2468 -8.33333333333333e+00 +2467 2384 8.33333333333333e+00 +2467 2137 -1.87500000000000e+01 +2467 2379 4.16666666666667e+00 +2467 2383 -1.25000000000000e+01 +2467 2136 4.16666666666667e+00 +2467 1980 -4.16666666666667e+00 +2468 2468 6.25000000000000e+01 +2468 2380 -8.33333333333333e+00 +2468 2463 -2.08333333333333e+00 +2468 2379 4.16666666666667e+00 +2468 2465 -6.25000000000000e+00 +2468 1972 2.08333333333333e+00 +2468 2474 -6.25000000000000e+00 +2468 1981 2.08333333333333e+00 +2468 2473 -2.08333333333333e+00 +2468 2466 -8.33333333333333e+00 +2468 2472 4.16666666666667e+00 +2468 2377 -4.16666666666667e+00 +2468 2131 -2.08333333333333e+00 +2468 2119 4.16666666666667e+00 +2468 2130 4.16666666666667e+00 +2468 2118 -8.33333333333333e+00 +2468 2382 8.33333333333333e+00 +2468 2132 -6.25000000000000e+00 +2468 1971 2.08333333333333e+00 +2468 2376 -4.16666666666667e+00 +2468 2138 -6.25000000000000e+00 +2468 2464 4.16666666666667e+00 +2468 2384 -3.75000000000000e+01 +2468 2137 4.16666666666667e+00 +2468 2467 -8.33333333333333e+00 +2468 2383 8.33333333333333e+00 +2468 2136 -2.08333333333333e+00 +2468 1980 2.08333333333333e+00 +2469 2469 6.25000000000000e+01 +2469 2461 4.16666666666667e+00 +2469 2460 -6.25000000000000e+00 +2469 2459 2.08333333333333e+00 +2469 2458 -4.16666666666667e+00 +2469 2366 4.16666666666667e+00 +2469 2363 -4.16666666666667e+00 +2469 2365 4.16666666666667e+00 +2469 2362 -4.16666666666667e+00 +2469 2398 -4.16666666666667e+00 +2469 2395 4.16666666666667e+00 +2469 2147 -2.08333333333333e+00 +2469 1976 4.16666666666667e+00 +2469 2396 -8.33333333333333e+00 +2469 1975 4.16666666666667e+00 +2469 2470 -8.33333333333333e+00 +2469 2146 4.16666666666667e+00 +2469 1974 -1.87500000000000e+01 +2469 2145 -6.25000000000000e+00 +2469 2471 -8.33333333333333e+00 +2469 2399 8.33333333333333e+00 +2469 2462 -2.08333333333333e+00 +2469 2397 -1.25000000000000e+01 +2469 1511 2.08333333333333e+00 +2469 1364 4.16666666666667e+00 +2469 1363 4.16666666666667e+00 +2469 1510 -4.16666666666667e+00 +2469 1362 -1.87500000000000e+01 +2470 2470 6.25000000000000e+01 +2470 2462 4.16666666666667e+00 +2470 2461 -1.87500000000000e+01 +2470 2460 4.16666666666667e+00 +2470 2457 -4.16666666666667e+00 +2470 2363 -4.16666666666667e+00 +2470 2366 -8.33333333333333e+00 +2470 2364 4.16666666666667e+00 +2470 2361 -4.16666666666667e+00 +2470 2397 -4.16666666666667e+00 +2470 2394 4.16666666666667e+00 +2470 2399 8.33333333333333e+00 +2470 2471 -8.33333333333333e+00 +2470 2147 4.16666666666667e+00 +2470 1976 -2.08333333333333e+00 +2470 2396 4.16666666666667e+00 +2470 1975 -6.25000000000000e+00 +2470 2146 -1.87500000000000e+01 +2470 1974 4.16666666666667e+00 +2470 2469 -8.33333333333333e+00 +2470 2145 4.16666666666667e+00 +2470 2459 2.08333333333333e+00 +2470 2398 -1.25000000000000e+01 +2470 1364 -2.08333333333333e+00 +2470 1511 2.08333333333333e+00 +2470 1363 -6.25000000000000e+00 +2470 1362 4.16666666666667e+00 +2470 1509 -4.16666666666667e+00 +2471 2471 6.25000000000000e+01 +2471 2462 -6.25000000000000e+00 +2471 2461 4.16666666666667e+00 +2471 2460 -2.08333333333333e+00 +2471 2457 2.08333333333333e+00 +2471 2364 4.16666666666667e+00 +2471 2361 -4.16666666666667e+00 +2471 2362 -4.16666666666667e+00 +2471 2365 -8.33333333333333e+00 +2471 2398 8.33333333333333e+00 +2471 2470 -8.33333333333333e+00 +2471 2146 4.16666666666667e+00 +2471 2145 -2.08333333333333e+00 +2471 1976 -6.25000000000000e+00 +2471 2147 -6.25000000000000e+00 +2471 1975 -2.08333333333333e+00 +2471 2395 4.16666666666667e+00 +2471 1974 4.16666666666667e+00 +2471 2394 -8.33333333333333e+00 +2471 2458 2.08333333333333e+00 +2471 2399 -3.75000000000000e+01 +2471 2469 -8.33333333333333e+00 +2471 2397 8.33333333333333e+00 +2471 1509 2.08333333333333e+00 +2471 1364 -6.25000000000000e+00 +2471 1363 -2.08333333333333e+00 +2471 1510 2.08333333333333e+00 +2471 1362 4.16666666666667e+00 +2472 2472 6.25000000000000e+01 +2472 2468 4.16666666666667e+00 +2472 2467 4.16666666666667e+00 +2472 2466 -1.87500000000000e+01 +2472 2464 -4.16666666666667e+00 +2472 2381 -4.16666666666667e+00 +2472 2384 -8.33333333333333e+00 +2472 2383 4.16666666666667e+00 +2472 2380 -4.16666666666667e+00 +2472 2395 4.16666666666667e+00 +2472 2401 -4.16666666666667e+00 +2472 2474 -8.33333333333333e+00 +2472 2402 8.33333333333333e+00 +2472 2147 4.16666666666667e+00 +2472 1982 -2.08333333333333e+00 +2472 2150 2.08333333333333e+00 +2472 1981 4.16666666666667e+00 +2472 2149 -4.16666666666667e+00 +2472 1980 -6.25000000000000e+00 +2472 2400 -1.25000000000000e+01 +2472 1976 -2.08333333333333e+00 +2472 2396 4.16666666666667e+00 +2472 2473 -8.33333333333333e+00 +2472 1975 4.16666666666667e+00 +2472 2146 4.16666666666667e+00 +2472 2465 2.08333333333333e+00 +2472 1974 -6.25000000000000e+00 +2472 2145 -1.87500000000000e+01 +2473 2473 6.25000000000000e+01 +2473 2467 -6.25000000000000e+00 +2473 2466 4.16666666666667e+00 +2473 2465 2.08333333333333e+00 +2473 2463 -4.16666666666667e+00 +2473 2384 4.16666666666667e+00 +2473 2381 -4.16666666666667e+00 +2473 2382 4.16666666666667e+00 +2473 2379 -4.16666666666667e+00 +2473 2394 4.16666666666667e+00 +2473 2400 -4.16666666666667e+00 +2473 2150 2.08333333333333e+00 +2473 2147 -2.08333333333333e+00 +2473 1982 4.16666666666667e+00 +2473 2474 -8.33333333333333e+00 +2473 2402 8.33333333333333e+00 +2473 1981 -1.87500000000000e+01 +2473 2401 -1.25000000000000e+01 +2473 1980 4.16666666666667e+00 +2473 2148 -4.16666666666667e+00 +2473 1976 4.16666666666667e+00 +2473 2396 -8.33333333333333e+00 +2473 2468 -2.08333333333333e+00 +2473 1975 -1.87500000000000e+01 +2473 2146 -6.25000000000000e+00 +2473 2472 -8.33333333333333e+00 +2473 1974 4.16666666666667e+00 +2473 2145 4.16666666666667e+00 +2474 2474 6.25000000000000e+01 +2474 2468 -6.25000000000000e+00 +2474 2467 -2.08333333333333e+00 +2474 2466 4.16666666666667e+00 +2474 2464 2.08333333333333e+00 +2474 2383 4.16666666666667e+00 +2474 2380 -4.16666666666667e+00 +2474 2379 -4.16666666666667e+00 +2474 2382 -8.33333333333333e+00 +2474 2149 2.08333333333333e+00 +2474 2146 -2.08333333333333e+00 +2474 2472 -8.33333333333333e+00 +2474 2400 8.33333333333333e+00 +2474 2145 4.16666666666667e+00 +2474 1982 -6.25000000000000e+00 +2474 2402 -3.75000000000000e+01 +2474 1981 4.16666666666667e+00 +2474 2473 -8.33333333333333e+00 +2474 2401 8.33333333333333e+00 +2474 1980 -2.08333333333333e+00 +2474 2148 2.08333333333333e+00 +2474 2463 2.08333333333333e+00 +2474 1976 -6.25000000000000e+00 +2474 2147 -6.25000000000000e+00 +2474 1975 4.16666666666667e+00 +2474 2395 -8.33333333333333e+00 +2474 1974 -2.08333333333333e+00 +2474 2394 4.16666666666667e+00 diff --git a/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/b.IJ.00000 b/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/b.IJ.00000 new file mode 100644 index 00000000..e29c4d6a --- /dev/null +++ b/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/b.IJ.00000 @@ -0,0 +1,676 @@ +0 674 +0 0.00000000000000e+00 +1 0.00000000000000e+00 +2 0.00000000000000e+00 +3 0.00000000000000e+00 +4 0.00000000000000e+00 +5 0.00000000000000e+00 +6 0.00000000000000e+00 +7 0.00000000000000e+00 +8 0.00000000000000e+00 +9 0.00000000000000e+00 +10 0.00000000000000e+00 +11 0.00000000000000e+00 +12 0.00000000000000e+00 +13 0.00000000000000e+00 +14 0.00000000000000e+00 +15 0.00000000000000e+00 +16 0.00000000000000e+00 +17 0.00000000000000e+00 +18 0.00000000000000e+00 +19 0.00000000000000e+00 +20 0.00000000000000e+00 +21 0.00000000000000e+00 +22 0.00000000000000e+00 +23 0.00000000000000e+00 +24 0.00000000000000e+00 +25 0.00000000000000e+00 +26 0.00000000000000e+00 +27 0.00000000000000e+00 +28 0.00000000000000e+00 +29 0.00000000000000e+00 +30 0.00000000000000e+00 +31 0.00000000000000e+00 +32 0.00000000000000e+00 +33 0.00000000000000e+00 +34 0.00000000000000e+00 +35 0.00000000000000e+00 +36 0.00000000000000e+00 +37 0.00000000000000e+00 +38 0.00000000000000e+00 +39 0.00000000000000e+00 +40 0.00000000000000e+00 +41 0.00000000000000e+00 +42 0.00000000000000e+00 +43 0.00000000000000e+00 +44 0.00000000000000e+00 +45 0.00000000000000e+00 +46 0.00000000000000e+00 +47 0.00000000000000e+00 +48 0.00000000000000e+00 +49 0.00000000000000e+00 +50 0.00000000000000e+00 +51 0.00000000000000e+00 +52 0.00000000000000e+00 +53 0.00000000000000e+00 +54 0.00000000000000e+00 +55 0.00000000000000e+00 +56 0.00000000000000e+00 +57 0.00000000000000e+00 +58 0.00000000000000e+00 +59 0.00000000000000e+00 +60 0.00000000000000e+00 +61 0.00000000000000e+00 +62 0.00000000000000e+00 +63 0.00000000000000e+00 +64 0.00000000000000e+00 +65 0.00000000000000e+00 +66 0.00000000000000e+00 +67 0.00000000000000e+00 +68 0.00000000000000e+00 +69 0.00000000000000e+00 +70 0.00000000000000e+00 +71 0.00000000000000e+00 +72 0.00000000000000e+00 +73 0.00000000000000e+00 +74 0.00000000000000e+00 +75 0.00000000000000e+00 +76 0.00000000000000e+00 +77 0.00000000000000e+00 +78 0.00000000000000e+00 +79 0.00000000000000e+00 +80 0.00000000000000e+00 +81 0.00000000000000e+00 +82 0.00000000000000e+00 +83 0.00000000000000e+00 +84 0.00000000000000e+00 +85 0.00000000000000e+00 +86 0.00000000000000e+00 +87 0.00000000000000e+00 +88 0.00000000000000e+00 +89 0.00000000000000e+00 +90 0.00000000000000e+00 +91 0.00000000000000e+00 +92 0.00000000000000e+00 +93 0.00000000000000e+00 +94 0.00000000000000e+00 +95 0.00000000000000e+00 +96 0.00000000000000e+00 +97 0.00000000000000e+00 +98 0.00000000000000e+00 +99 0.00000000000000e+00 +100 0.00000000000000e+00 +101 0.00000000000000e+00 +102 0.00000000000000e+00 +103 0.00000000000000e+00 +104 0.00000000000000e+00 +105 0.00000000000000e+00 +106 0.00000000000000e+00 +107 0.00000000000000e+00 +108 0.00000000000000e+00 +109 0.00000000000000e+00 +110 0.00000000000000e+00 +111 0.00000000000000e+00 +112 0.00000000000000e+00 +113 0.00000000000000e+00 +114 0.00000000000000e+00 +115 0.00000000000000e+00 +116 0.00000000000000e+00 +117 0.00000000000000e+00 +118 0.00000000000000e+00 +119 0.00000000000000e+00 +120 0.00000000000000e+00 +121 0.00000000000000e+00 +122 0.00000000000000e+00 +123 0.00000000000000e+00 +124 0.00000000000000e+00 +125 0.00000000000000e+00 +126 0.00000000000000e+00 +127 0.00000000000000e+00 +128 0.00000000000000e+00 +129 0.00000000000000e+00 +130 0.00000000000000e+00 +131 0.00000000000000e+00 +132 0.00000000000000e+00 +133 0.00000000000000e+00 +134 0.00000000000000e+00 +135 0.00000000000000e+00 +136 0.00000000000000e+00 +137 0.00000000000000e+00 +138 0.00000000000000e+00 +139 0.00000000000000e+00 +140 0.00000000000000e+00 +141 0.00000000000000e+00 +142 0.00000000000000e+00 +143 0.00000000000000e+00 +144 0.00000000000000e+00 +145 0.00000000000000e+00 +146 0.00000000000000e+00 +147 0.00000000000000e+00 +148 0.00000000000000e+00 +149 0.00000000000000e+00 +150 0.00000000000000e+00 +151 0.00000000000000e+00 +152 0.00000000000000e+00 +153 0.00000000000000e+00 +154 0.00000000000000e+00 +155 0.00000000000000e+00 +156 0.00000000000000e+00 +157 0.00000000000000e+00 +158 0.00000000000000e+00 +159 0.00000000000000e+00 +160 0.00000000000000e+00 +161 0.00000000000000e+00 +162 0.00000000000000e+00 +163 0.00000000000000e+00 +164 0.00000000000000e+00 +165 0.00000000000000e+00 +166 0.00000000000000e+00 +167 0.00000000000000e+00 +168 0.00000000000000e+00 +169 0.00000000000000e+00 +170 0.00000000000000e+00 +171 0.00000000000000e+00 +172 0.00000000000000e+00 +173 0.00000000000000e+00 +174 0.00000000000000e+00 +175 0.00000000000000e+00 +176 0.00000000000000e+00 +177 0.00000000000000e+00 +178 0.00000000000000e+00 +179 0.00000000000000e+00 +180 0.00000000000000e+00 +181 0.00000000000000e+00 +182 0.00000000000000e+00 +183 0.00000000000000e+00 +184 0.00000000000000e+00 +185 0.00000000000000e+00 +186 0.00000000000000e+00 +187 0.00000000000000e+00 +188 0.00000000000000e+00 +189 0.00000000000000e+00 +190 0.00000000000000e+00 +191 0.00000000000000e+00 +192 0.00000000000000e+00 +193 0.00000000000000e+00 +194 0.00000000000000e+00 +195 0.00000000000000e+00 +196 0.00000000000000e+00 +197 0.00000000000000e+00 +198 0.00000000000000e+00 +199 0.00000000000000e+00 +200 0.00000000000000e+00 +201 0.00000000000000e+00 +202 0.00000000000000e+00 +203 0.00000000000000e+00 +204 0.00000000000000e+00 +205 0.00000000000000e+00 +206 0.00000000000000e+00 +207 0.00000000000000e+00 +208 0.00000000000000e+00 +209 0.00000000000000e+00 +210 0.00000000000000e+00 +211 0.00000000000000e+00 +212 0.00000000000000e+00 +213 0.00000000000000e+00 +214 0.00000000000000e+00 +215 0.00000000000000e+00 +216 0.00000000000000e+00 +217 0.00000000000000e+00 +218 0.00000000000000e+00 +219 0.00000000000000e+00 +220 0.00000000000000e+00 +221 0.00000000000000e+00 +222 0.00000000000000e+00 +223 0.00000000000000e+00 +224 0.00000000000000e+00 +225 0.00000000000000e+00 +226 0.00000000000000e+00 +227 0.00000000000000e+00 +228 0.00000000000000e+00 +229 0.00000000000000e+00 +230 0.00000000000000e+00 +231 0.00000000000000e+00 +232 0.00000000000000e+00 +233 0.00000000000000e+00 +234 0.00000000000000e+00 +235 0.00000000000000e+00 +236 0.00000000000000e+00 +237 0.00000000000000e+00 +238 0.00000000000000e+00 +239 0.00000000000000e+00 +240 0.00000000000000e+00 +241 0.00000000000000e+00 +242 0.00000000000000e+00 +243 0.00000000000000e+00 +244 0.00000000000000e+00 +245 0.00000000000000e+00 +246 0.00000000000000e+00 +247 0.00000000000000e+00 +248 0.00000000000000e+00 +249 0.00000000000000e+00 +250 0.00000000000000e+00 +251 0.00000000000000e+00 +252 0.00000000000000e+00 +253 0.00000000000000e+00 +254 0.00000000000000e+00 +255 0.00000000000000e+00 +256 0.00000000000000e+00 +257 0.00000000000000e+00 +258 0.00000000000000e+00 +259 0.00000000000000e+00 +260 0.00000000000000e+00 +261 0.00000000000000e+00 +262 0.00000000000000e+00 +263 0.00000000000000e+00 +264 0.00000000000000e+00 +265 0.00000000000000e+00 +266 0.00000000000000e+00 +267 0.00000000000000e+00 +268 0.00000000000000e+00 +269 0.00000000000000e+00 +270 0.00000000000000e+00 +271 0.00000000000000e+00 +272 0.00000000000000e+00 +273 0.00000000000000e+00 +274 0.00000000000000e+00 +275 0.00000000000000e+00 +276 0.00000000000000e+00 +277 0.00000000000000e+00 +278 0.00000000000000e+00 +279 0.00000000000000e+00 +280 0.00000000000000e+00 +281 0.00000000000000e+00 +282 0.00000000000000e+00 +283 0.00000000000000e+00 +284 0.00000000000000e+00 +285 0.00000000000000e+00 +286 0.00000000000000e+00 +287 0.00000000000000e+00 +288 0.00000000000000e+00 +289 0.00000000000000e+00 +290 0.00000000000000e+00 +291 0.00000000000000e+00 +292 0.00000000000000e+00 +293 0.00000000000000e+00 +294 0.00000000000000e+00 +295 0.00000000000000e+00 +296 0.00000000000000e+00 +297 0.00000000000000e+00 +298 0.00000000000000e+00 +299 0.00000000000000e+00 +300 0.00000000000000e+00 +301 0.00000000000000e+00 +302 0.00000000000000e+00 +303 0.00000000000000e+00 +304 0.00000000000000e+00 +305 0.00000000000000e+00 +306 0.00000000000000e+00 +307 0.00000000000000e+00 +308 0.00000000000000e+00 +309 0.00000000000000e+00 +310 0.00000000000000e+00 +311 0.00000000000000e+00 +312 0.00000000000000e+00 +313 0.00000000000000e+00 +314 0.00000000000000e+00 +315 0.00000000000000e+00 +316 0.00000000000000e+00 +317 0.00000000000000e+00 +318 0.00000000000000e+00 +319 0.00000000000000e+00 +320 0.00000000000000e+00 +321 0.00000000000000e+00 +322 0.00000000000000e+00 +323 0.00000000000000e+00 +324 0.00000000000000e+00 +325 0.00000000000000e+00 +326 0.00000000000000e+00 +327 0.00000000000000e+00 +328 0.00000000000000e+00 +329 0.00000000000000e+00 +330 0.00000000000000e+00 +331 0.00000000000000e+00 +332 0.00000000000000e+00 +333 0.00000000000000e+00 +334 0.00000000000000e+00 +335 0.00000000000000e+00 +336 0.00000000000000e+00 +337 0.00000000000000e+00 +338 0.00000000000000e+00 +339 0.00000000000000e+00 +340 0.00000000000000e+00 +341 0.00000000000000e+00 +342 0.00000000000000e+00 +343 0.00000000000000e+00 +344 0.00000000000000e+00 +345 0.00000000000000e+00 +346 0.00000000000000e+00 +347 0.00000000000000e+00 +348 0.00000000000000e+00 +349 0.00000000000000e+00 +350 0.00000000000000e+00 +351 0.00000000000000e+00 +352 0.00000000000000e+00 +353 0.00000000000000e+00 +354 0.00000000000000e+00 +355 0.00000000000000e+00 +356 0.00000000000000e+00 +357 0.00000000000000e+00 +358 0.00000000000000e+00 +359 0.00000000000000e+00 +360 0.00000000000000e+00 +361 0.00000000000000e+00 +362 0.00000000000000e+00 +363 0.00000000000000e+00 +364 0.00000000000000e+00 +365 0.00000000000000e+00 +366 0.00000000000000e+00 +367 0.00000000000000e+00 +368 0.00000000000000e+00 +369 0.00000000000000e+00 +370 0.00000000000000e+00 +371 0.00000000000000e+00 +372 0.00000000000000e+00 +373 0.00000000000000e+00 +374 0.00000000000000e+00 +375 0.00000000000000e+00 +376 0.00000000000000e+00 +377 0.00000000000000e+00 +378 0.00000000000000e+00 +379 0.00000000000000e+00 +380 0.00000000000000e+00 +381 0.00000000000000e+00 +382 0.00000000000000e+00 +383 0.00000000000000e+00 +384 0.00000000000000e+00 +385 0.00000000000000e+00 +386 0.00000000000000e+00 +387 0.00000000000000e+00 +388 0.00000000000000e+00 +389 0.00000000000000e+00 +390 0.00000000000000e+00 +391 0.00000000000000e+00 +392 0.00000000000000e+00 +393 0.00000000000000e+00 +394 0.00000000000000e+00 +395 0.00000000000000e+00 +396 0.00000000000000e+00 +397 0.00000000000000e+00 +398 0.00000000000000e+00 +399 0.00000000000000e+00 +400 0.00000000000000e+00 +401 0.00000000000000e+00 +402 0.00000000000000e+00 +403 0.00000000000000e+00 +404 0.00000000000000e+00 +405 0.00000000000000e+00 +406 0.00000000000000e+00 +407 0.00000000000000e+00 +408 0.00000000000000e+00 +409 0.00000000000000e+00 +410 0.00000000000000e+00 +411 0.00000000000000e+00 +412 0.00000000000000e+00 +413 0.00000000000000e+00 +414 0.00000000000000e+00 +415 0.00000000000000e+00 +416 0.00000000000000e+00 +417 0.00000000000000e+00 +418 0.00000000000000e+00 +419 0.00000000000000e+00 +420 0.00000000000000e+00 +421 0.00000000000000e+00 +422 0.00000000000000e+00 +423 0.00000000000000e+00 +424 0.00000000000000e+00 +425 0.00000000000000e+00 +426 0.00000000000000e+00 +427 0.00000000000000e+00 +428 0.00000000000000e+00 +429 0.00000000000000e+00 +430 0.00000000000000e+00 +431 0.00000000000000e+00 +432 0.00000000000000e+00 +433 0.00000000000000e+00 +434 0.00000000000000e+00 +435 0.00000000000000e+00 +436 0.00000000000000e+00 +437 0.00000000000000e+00 +438 0.00000000000000e+00 +439 0.00000000000000e+00 +440 0.00000000000000e+00 +441 0.00000000000000e+00 +442 0.00000000000000e+00 +443 0.00000000000000e+00 +444 0.00000000000000e+00 +445 0.00000000000000e+00 +446 0.00000000000000e+00 +447 0.00000000000000e+00 +448 0.00000000000000e+00 +449 0.00000000000000e+00 +450 0.00000000000000e+00 +451 0.00000000000000e+00 +452 0.00000000000000e+00 +453 0.00000000000000e+00 +454 0.00000000000000e+00 +455 0.00000000000000e+00 +456 0.00000000000000e+00 +457 0.00000000000000e+00 +458 0.00000000000000e+00 +459 0.00000000000000e+00 +460 0.00000000000000e+00 +461 0.00000000000000e+00 +462 0.00000000000000e+00 +463 0.00000000000000e+00 +464 0.00000000000000e+00 +465 0.00000000000000e+00 +466 0.00000000000000e+00 +467 0.00000000000000e+00 +468 0.00000000000000e+00 +469 0.00000000000000e+00 +470 0.00000000000000e+00 +471 0.00000000000000e+00 +472 0.00000000000000e+00 +473 0.00000000000000e+00 +474 0.00000000000000e+00 +475 0.00000000000000e+00 +476 0.00000000000000e+00 +477 0.00000000000000e+00 +478 0.00000000000000e+00 +479 0.00000000000000e+00 +480 0.00000000000000e+00 +481 0.00000000000000e+00 +482 0.00000000000000e+00 +483 0.00000000000000e+00 +484 0.00000000000000e+00 +485 0.00000000000000e+00 +486 0.00000000000000e+00 +487 0.00000000000000e+00 +488 0.00000000000000e+00 +489 0.00000000000000e+00 +490 0.00000000000000e+00 +491 0.00000000000000e+00 +492 0.00000000000000e+00 +493 0.00000000000000e+00 +494 0.00000000000000e+00 +495 0.00000000000000e+00 +496 0.00000000000000e+00 +497 0.00000000000000e+00 +498 0.00000000000000e+00 +499 0.00000000000000e+00 +500 0.00000000000000e+00 +501 0.00000000000000e+00 +502 0.00000000000000e+00 +503 0.00000000000000e+00 +504 0.00000000000000e+00 +505 0.00000000000000e+00 +506 0.00000000000000e+00 +507 0.00000000000000e+00 +508 0.00000000000000e+00 +509 0.00000000000000e+00 +510 0.00000000000000e+00 +511 0.00000000000000e+00 +512 0.00000000000000e+00 +513 0.00000000000000e+00 +514 0.00000000000000e+00 +515 0.00000000000000e+00 +516 0.00000000000000e+00 +517 0.00000000000000e+00 +518 0.00000000000000e+00 +519 0.00000000000000e+00 +520 0.00000000000000e+00 +521 0.00000000000000e+00 +522 0.00000000000000e+00 +523 0.00000000000000e+00 +524 0.00000000000000e+00 +525 0.00000000000000e+00 +526 0.00000000000000e+00 +527 0.00000000000000e+00 +528 0.00000000000000e+00 +529 0.00000000000000e+00 +530 0.00000000000000e+00 +531 0.00000000000000e+00 +532 0.00000000000000e+00 +533 0.00000000000000e+00 +534 0.00000000000000e+00 +535 0.00000000000000e+00 +536 0.00000000000000e+00 +537 0.00000000000000e+00 +538 0.00000000000000e+00 +539 0.00000000000000e+00 +540 0.00000000000000e+00 +541 0.00000000000000e+00 +542 0.00000000000000e+00 +543 0.00000000000000e+00 +544 0.00000000000000e+00 +545 0.00000000000000e+00 +546 0.00000000000000e+00 +547 0.00000000000000e+00 +548 0.00000000000000e+00 +549 0.00000000000000e+00 +550 0.00000000000000e+00 +551 0.00000000000000e+00 +552 0.00000000000000e+00 +553 0.00000000000000e+00 +554 0.00000000000000e+00 +555 0.00000000000000e+00 +556 0.00000000000000e+00 +557 0.00000000000000e+00 +558 0.00000000000000e+00 +559 0.00000000000000e+00 +560 0.00000000000000e+00 +561 0.00000000000000e+00 +562 0.00000000000000e+00 +563 0.00000000000000e+00 +564 0.00000000000000e+00 +565 0.00000000000000e+00 +566 0.00000000000000e+00 +567 0.00000000000000e+00 +568 0.00000000000000e+00 +569 0.00000000000000e+00 +570 0.00000000000000e+00 +571 0.00000000000000e+00 +572 0.00000000000000e+00 +573 0.00000000000000e+00 +574 0.00000000000000e+00 +575 0.00000000000000e+00 +576 0.00000000000000e+00 +577 0.00000000000000e+00 +578 0.00000000000000e+00 +579 0.00000000000000e+00 +580 0.00000000000000e+00 +581 0.00000000000000e+00 +582 0.00000000000000e+00 +583 0.00000000000000e+00 +584 0.00000000000000e+00 +585 0.00000000000000e+00 +586 0.00000000000000e+00 +587 0.00000000000000e+00 +588 0.00000000000000e+00 +589 0.00000000000000e+00 +590 0.00000000000000e+00 +591 0.00000000000000e+00 +592 0.00000000000000e+00 +593 0.00000000000000e+00 +594 0.00000000000000e+00 +595 0.00000000000000e+00 +596 0.00000000000000e+00 +597 0.00000000000000e+00 +598 0.00000000000000e+00 +599 0.00000000000000e+00 +600 0.00000000000000e+00 +601 0.00000000000000e+00 +602 0.00000000000000e+00 +603 0.00000000000000e+00 +604 0.00000000000000e+00 +605 0.00000000000000e+00 +606 0.00000000000000e+00 +607 0.00000000000000e+00 +608 0.00000000000000e+00 +609 0.00000000000000e+00 +610 0.00000000000000e+00 +611 0.00000000000000e+00 +612 0.00000000000000e+00 +613 0.00000000000000e+00 +614 0.00000000000000e+00 +615 0.00000000000000e+00 +616 0.00000000000000e+00 +617 0.00000000000000e+00 +618 0.00000000000000e+00 +619 0.00000000000000e+00 +620 0.00000000000000e+00 +621 0.00000000000000e+00 +622 0.00000000000000e+00 +623 0.00000000000000e+00 +624 0.00000000000000e+00 +625 0.00000000000000e+00 +626 0.00000000000000e+00 +627 0.00000000000000e+00 +628 0.00000000000000e+00 +629 0.00000000000000e+00 +630 0.00000000000000e+00 +631 0.00000000000000e+00 +632 0.00000000000000e+00 +633 0.00000000000000e+00 +634 0.00000000000000e+00 +635 0.00000000000000e+00 +636 0.00000000000000e+00 +637 0.00000000000000e+00 +638 0.00000000000000e+00 +639 0.00000000000000e+00 +640 0.00000000000000e+00 +641 0.00000000000000e+00 +642 0.00000000000000e+00 +643 0.00000000000000e+00 +644 0.00000000000000e+00 +645 0.00000000000000e+00 +646 0.00000000000000e+00 +647 0.00000000000000e+00 +648 0.00000000000000e+00 +649 0.00000000000000e+00 +650 0.00000000000000e+00 +651 0.00000000000000e+00 +652 0.00000000000000e+00 +653 0.00000000000000e+00 +654 0.00000000000000e+00 +655 0.00000000000000e+00 +656 0.00000000000000e+00 +657 0.00000000000000e+00 +658 0.00000000000000e+00 +659 0.00000000000000e+00 +660 0.00000000000000e+00 +661 0.00000000000000e+00 +662 0.00000000000000e+00 +663 0.00000000000000e+00 +664 0.00000000000000e+00 +665 0.00000000000000e+00 +666 0.00000000000000e+00 +667 0.00000000000000e+00 +668 0.00000000000000e+00 +669 0.00000000000000e+00 +670 0.00000000000000e+00 +671 0.00000000000000e+00 +672 0.00000000000000e+00 +673 0.00000000000000e+00 +674 0.00000000000000e+00 diff --git a/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/b.IJ.00001 b/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/b.IJ.00001 new file mode 100644 index 00000000..83497fab --- /dev/null +++ b/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/b.IJ.00001 @@ -0,0 +1,601 @@ +675 1274 +675 0.00000000000000e+00 +676 0.00000000000000e+00 +677 0.00000000000000e+00 +678 0.00000000000000e+00 +679 0.00000000000000e+00 +680 -2.08333333333333e-04 +681 0.00000000000000e+00 +682 0.00000000000000e+00 +683 0.00000000000000e+00 +684 0.00000000000000e+00 +685 0.00000000000000e+00 +686 -1.04166666666667e-04 +687 0.00000000000000e+00 +688 0.00000000000000e+00 +689 0.00000000000000e+00 +690 0.00000000000000e+00 +691 0.00000000000000e+00 +692 -1.04166666666667e-04 +693 0.00000000000000e+00 +694 0.00000000000000e+00 +695 0.00000000000000e+00 +696 0.00000000000000e+00 +697 0.00000000000000e+00 +698 -2.08333333333333e-04 +699 0.00000000000000e+00 +700 0.00000000000000e+00 +701 0.00000000000000e+00 +702 0.00000000000000e+00 +703 0.00000000000000e+00 +704 0.00000000000000e+00 +705 0.00000000000000e+00 +706 0.00000000000000e+00 +707 0.00000000000000e+00 +708 0.00000000000000e+00 +709 0.00000000000000e+00 +710 0.00000000000000e+00 +711 0.00000000000000e+00 +712 0.00000000000000e+00 +713 0.00000000000000e+00 +714 0.00000000000000e+00 +715 0.00000000000000e+00 +716 0.00000000000000e+00 +717 0.00000000000000e+00 +718 0.00000000000000e+00 +719 0.00000000000000e+00 +720 0.00000000000000e+00 +721 0.00000000000000e+00 +722 0.00000000000000e+00 +723 0.00000000000000e+00 +724 0.00000000000000e+00 +725 0.00000000000000e+00 +726 0.00000000000000e+00 +727 0.00000000000000e+00 +728 0.00000000000000e+00 +729 0.00000000000000e+00 +730 0.00000000000000e+00 +731 0.00000000000000e+00 +732 0.00000000000000e+00 +733 0.00000000000000e+00 +734 -3.12500000000000e-04 +735 0.00000000000000e+00 +736 0.00000000000000e+00 +737 -3.12500000000000e-04 +738 0.00000000000000e+00 +739 0.00000000000000e+00 +740 -6.25000000000000e-04 +741 0.00000000000000e+00 +742 0.00000000000000e+00 +743 0.00000000000000e+00 +744 0.00000000000000e+00 +745 0.00000000000000e+00 +746 0.00000000000000e+00 +747 0.00000000000000e+00 +748 0.00000000000000e+00 +749 0.00000000000000e+00 +750 0.00000000000000e+00 +751 0.00000000000000e+00 +752 0.00000000000000e+00 +753 0.00000000000000e+00 +754 0.00000000000000e+00 +755 0.00000000000000e+00 +756 0.00000000000000e+00 +757 0.00000000000000e+00 +758 -3.12500000000000e-04 +759 0.00000000000000e+00 +760 0.00000000000000e+00 +761 0.00000000000000e+00 +762 0.00000000000000e+00 +763 0.00000000000000e+00 +764 0.00000000000000e+00 +765 0.00000000000000e+00 +766 0.00000000000000e+00 +767 0.00000000000000e+00 +768 0.00000000000000e+00 +769 0.00000000000000e+00 +770 0.00000000000000e+00 +771 0.00000000000000e+00 +772 0.00000000000000e+00 +773 0.00000000000000e+00 +774 0.00000000000000e+00 +775 0.00000000000000e+00 +776 -3.12500000000000e-04 +777 0.00000000000000e+00 +778 0.00000000000000e+00 +779 0.00000000000000e+00 +780 0.00000000000000e+00 +781 0.00000000000000e+00 +782 0.00000000000000e+00 +783 0.00000000000000e+00 +784 0.00000000000000e+00 +785 0.00000000000000e+00 +786 0.00000000000000e+00 +787 0.00000000000000e+00 +788 0.00000000000000e+00 +789 0.00000000000000e+00 +790 0.00000000000000e+00 +791 0.00000000000000e+00 +792 0.00000000000000e+00 +793 0.00000000000000e+00 +794 0.00000000000000e+00 +795 0.00000000000000e+00 +796 0.00000000000000e+00 +797 0.00000000000000e+00 +798 0.00000000000000e+00 +799 0.00000000000000e+00 +800 0.00000000000000e+00 +801 0.00000000000000e+00 +802 0.00000000000000e+00 +803 0.00000000000000e+00 +804 0.00000000000000e+00 +805 0.00000000000000e+00 +806 0.00000000000000e+00 +807 0.00000000000000e+00 +808 0.00000000000000e+00 +809 0.00000000000000e+00 +810 0.00000000000000e+00 +811 0.00000000000000e+00 +812 0.00000000000000e+00 +813 0.00000000000000e+00 +814 0.00000000000000e+00 +815 0.00000000000000e+00 +816 0.00000000000000e+00 +817 0.00000000000000e+00 +818 0.00000000000000e+00 +819 0.00000000000000e+00 +820 0.00000000000000e+00 +821 0.00000000000000e+00 +822 0.00000000000000e+00 +823 0.00000000000000e+00 +824 -3.12500000000000e-04 +825 0.00000000000000e+00 +826 0.00000000000000e+00 +827 -3.12500000000000e-04 +828 0.00000000000000e+00 +829 0.00000000000000e+00 +830 -6.25000000000000e-04 +831 0.00000000000000e+00 +832 0.00000000000000e+00 +833 0.00000000000000e+00 +834 0.00000000000000e+00 +835 0.00000000000000e+00 +836 0.00000000000000e+00 +837 0.00000000000000e+00 +838 0.00000000000000e+00 +839 0.00000000000000e+00 +840 0.00000000000000e+00 +841 0.00000000000000e+00 +842 0.00000000000000e+00 +843 0.00000000000000e+00 +844 0.00000000000000e+00 +845 0.00000000000000e+00 +846 0.00000000000000e+00 +847 0.00000000000000e+00 +848 0.00000000000000e+00 +849 0.00000000000000e+00 +850 0.00000000000000e+00 +851 0.00000000000000e+00 +852 0.00000000000000e+00 +853 0.00000000000000e+00 +854 0.00000000000000e+00 +855 0.00000000000000e+00 +856 0.00000000000000e+00 +857 0.00000000000000e+00 +858 0.00000000000000e+00 +859 0.00000000000000e+00 +860 -3.12500000000000e-04 +861 0.00000000000000e+00 +862 0.00000000000000e+00 +863 0.00000000000000e+00 +864 0.00000000000000e+00 +865 0.00000000000000e+00 +866 -3.12500000000000e-04 +867 0.00000000000000e+00 +868 0.00000000000000e+00 +869 0.00000000000000e+00 +870 0.00000000000000e+00 +871 0.00000000000000e+00 +872 0.00000000000000e+00 +873 0.00000000000000e+00 +874 0.00000000000000e+00 +875 0.00000000000000e+00 +876 0.00000000000000e+00 +877 0.00000000000000e+00 +878 0.00000000000000e+00 +879 0.00000000000000e+00 +880 0.00000000000000e+00 +881 0.00000000000000e+00 +882 0.00000000000000e+00 +883 0.00000000000000e+00 +884 0.00000000000000e+00 +885 0.00000000000000e+00 +886 0.00000000000000e+00 +887 0.00000000000000e+00 +888 0.00000000000000e+00 +889 0.00000000000000e+00 +890 0.00000000000000e+00 +891 0.00000000000000e+00 +892 0.00000000000000e+00 +893 0.00000000000000e+00 +894 0.00000000000000e+00 +895 0.00000000000000e+00 +896 -3.12500000000000e-04 +897 0.00000000000000e+00 +898 0.00000000000000e+00 +899 0.00000000000000e+00 +900 0.00000000000000e+00 +901 0.00000000000000e+00 +902 -3.12500000000000e-04 +903 0.00000000000000e+00 +904 0.00000000000000e+00 +905 0.00000000000000e+00 +906 0.00000000000000e+00 +907 0.00000000000000e+00 +908 0.00000000000000e+00 +909 0.00000000000000e+00 +910 0.00000000000000e+00 +911 0.00000000000000e+00 +912 0.00000000000000e+00 +913 0.00000000000000e+00 +914 0.00000000000000e+00 +915 0.00000000000000e+00 +916 0.00000000000000e+00 +917 0.00000000000000e+00 +918 0.00000000000000e+00 +919 0.00000000000000e+00 +920 0.00000000000000e+00 +921 0.00000000000000e+00 +922 0.00000000000000e+00 +923 0.00000000000000e+00 +924 0.00000000000000e+00 +925 0.00000000000000e+00 +926 0.00000000000000e+00 +927 0.00000000000000e+00 +928 0.00000000000000e+00 +929 0.00000000000000e+00 +930 0.00000000000000e+00 +931 0.00000000000000e+00 +932 0.00000000000000e+00 +933 0.00000000000000e+00 +934 0.00000000000000e+00 +935 -6.25000000000000e-04 +936 0.00000000000000e+00 +937 0.00000000000000e+00 +938 0.00000000000000e+00 +939 0.00000000000000e+00 +940 0.00000000000000e+00 +941 -3.12500000000000e-04 +942 0.00000000000000e+00 +943 0.00000000000000e+00 +944 0.00000000000000e+00 +945 0.00000000000000e+00 +946 0.00000000000000e+00 +947 -3.12500000000000e-04 +948 0.00000000000000e+00 +949 0.00000000000000e+00 +950 0.00000000000000e+00 +951 0.00000000000000e+00 +952 0.00000000000000e+00 +953 0.00000000000000e+00 +954 0.00000000000000e+00 +955 0.00000000000000e+00 +956 0.00000000000000e+00 +957 0.00000000000000e+00 +958 0.00000000000000e+00 +959 0.00000000000000e+00 +960 0.00000000000000e+00 +961 0.00000000000000e+00 +962 0.00000000000000e+00 +963 0.00000000000000e+00 +964 0.00000000000000e+00 +965 0.00000000000000e+00 +966 0.00000000000000e+00 +967 0.00000000000000e+00 +968 0.00000000000000e+00 +969 0.00000000000000e+00 +970 0.00000000000000e+00 +971 0.00000000000000e+00 +972 0.00000000000000e+00 +973 0.00000000000000e+00 +974 0.00000000000000e+00 +975 0.00000000000000e+00 +976 0.00000000000000e+00 +977 0.00000000000000e+00 +978 0.00000000000000e+00 +979 0.00000000000000e+00 +980 0.00000000000000e+00 +981 0.00000000000000e+00 +982 0.00000000000000e+00 +983 0.00000000000000e+00 +984 0.00000000000000e+00 +985 0.00000000000000e+00 +986 0.00000000000000e+00 +987 0.00000000000000e+00 +988 0.00000000000000e+00 +989 0.00000000000000e+00 +990 0.00000000000000e+00 +991 0.00000000000000e+00 +992 0.00000000000000e+00 +993 0.00000000000000e+00 +994 0.00000000000000e+00 +995 0.00000000000000e+00 +996 0.00000000000000e+00 +997 0.00000000000000e+00 +998 0.00000000000000e+00 +999 0.00000000000000e+00 +1000 0.00000000000000e+00 +1001 0.00000000000000e+00 +1002 0.00000000000000e+00 +1003 0.00000000000000e+00 +1004 0.00000000000000e+00 +1005 0.00000000000000e+00 +1006 0.00000000000000e+00 +1007 0.00000000000000e+00 +1008 0.00000000000000e+00 +1009 0.00000000000000e+00 +1010 0.00000000000000e+00 +1011 0.00000000000000e+00 +1012 0.00000000000000e+00 +1013 0.00000000000000e+00 +1014 0.00000000000000e+00 +1015 0.00000000000000e+00 +1016 0.00000000000000e+00 +1017 0.00000000000000e+00 +1018 0.00000000000000e+00 +1019 0.00000000000000e+00 +1020 0.00000000000000e+00 +1021 0.00000000000000e+00 +1022 0.00000000000000e+00 +1023 0.00000000000000e+00 +1024 0.00000000000000e+00 +1025 0.00000000000000e+00 +1026 0.00000000000000e+00 +1027 0.00000000000000e+00 +1028 0.00000000000000e+00 +1029 0.00000000000000e+00 +1030 0.00000000000000e+00 +1031 0.00000000000000e+00 +1032 0.00000000000000e+00 +1033 0.00000000000000e+00 +1034 0.00000000000000e+00 +1035 0.00000000000000e+00 +1036 0.00000000000000e+00 +1037 0.00000000000000e+00 +1038 0.00000000000000e+00 +1039 0.00000000000000e+00 +1040 0.00000000000000e+00 +1041 0.00000000000000e+00 +1042 0.00000000000000e+00 +1043 0.00000000000000e+00 +1044 0.00000000000000e+00 +1045 0.00000000000000e+00 +1046 0.00000000000000e+00 +1047 0.00000000000000e+00 +1048 0.00000000000000e+00 +1049 0.00000000000000e+00 +1050 0.00000000000000e+00 +1051 0.00000000000000e+00 +1052 0.00000000000000e+00 +1053 0.00000000000000e+00 +1054 0.00000000000000e+00 +1055 0.00000000000000e+00 +1056 0.00000000000000e+00 +1057 0.00000000000000e+00 +1058 0.00000000000000e+00 +1059 0.00000000000000e+00 +1060 0.00000000000000e+00 +1061 0.00000000000000e+00 +1062 0.00000000000000e+00 +1063 0.00000000000000e+00 +1064 0.00000000000000e+00 +1065 0.00000000000000e+00 +1066 0.00000000000000e+00 +1067 0.00000000000000e+00 +1068 0.00000000000000e+00 +1069 0.00000000000000e+00 +1070 0.00000000000000e+00 +1071 0.00000000000000e+00 +1072 0.00000000000000e+00 +1073 0.00000000000000e+00 +1074 0.00000000000000e+00 +1075 0.00000000000000e+00 +1076 0.00000000000000e+00 +1077 0.00000000000000e+00 +1078 0.00000000000000e+00 +1079 0.00000000000000e+00 +1080 0.00000000000000e+00 +1081 0.00000000000000e+00 +1082 0.00000000000000e+00 +1083 0.00000000000000e+00 +1084 0.00000000000000e+00 +1085 0.00000000000000e+00 +1086 0.00000000000000e+00 +1087 0.00000000000000e+00 +1088 0.00000000000000e+00 +1089 0.00000000000000e+00 +1090 0.00000000000000e+00 +1091 0.00000000000000e+00 +1092 0.00000000000000e+00 +1093 0.00000000000000e+00 +1094 0.00000000000000e+00 +1095 0.00000000000000e+00 +1096 0.00000000000000e+00 +1097 0.00000000000000e+00 +1098 0.00000000000000e+00 +1099 0.00000000000000e+00 +1100 0.00000000000000e+00 +1101 0.00000000000000e+00 +1102 0.00000000000000e+00 +1103 0.00000000000000e+00 +1104 0.00000000000000e+00 +1105 0.00000000000000e+00 +1106 0.00000000000000e+00 +1107 0.00000000000000e+00 +1108 0.00000000000000e+00 +1109 0.00000000000000e+00 +1110 0.00000000000000e+00 +1111 0.00000000000000e+00 +1112 0.00000000000000e+00 +1113 0.00000000000000e+00 +1114 0.00000000000000e+00 +1115 0.00000000000000e+00 +1116 0.00000000000000e+00 +1117 0.00000000000000e+00 +1118 0.00000000000000e+00 +1119 0.00000000000000e+00 +1120 0.00000000000000e+00 +1121 0.00000000000000e+00 +1122 0.00000000000000e+00 +1123 0.00000000000000e+00 +1124 0.00000000000000e+00 +1125 0.00000000000000e+00 +1126 0.00000000000000e+00 +1127 0.00000000000000e+00 +1128 0.00000000000000e+00 +1129 0.00000000000000e+00 +1130 0.00000000000000e+00 +1131 0.00000000000000e+00 +1132 0.00000000000000e+00 +1133 0.00000000000000e+00 +1134 0.00000000000000e+00 +1135 0.00000000000000e+00 +1136 0.00000000000000e+00 +1137 0.00000000000000e+00 +1138 0.00000000000000e+00 +1139 0.00000000000000e+00 +1140 0.00000000000000e+00 +1141 0.00000000000000e+00 +1142 0.00000000000000e+00 +1143 0.00000000000000e+00 +1144 0.00000000000000e+00 +1145 0.00000000000000e+00 +1146 0.00000000000000e+00 +1147 0.00000000000000e+00 +1148 0.00000000000000e+00 +1149 0.00000000000000e+00 +1150 0.00000000000000e+00 +1151 0.00000000000000e+00 +1152 0.00000000000000e+00 +1153 0.00000000000000e+00 +1154 0.00000000000000e+00 +1155 0.00000000000000e+00 +1156 0.00000000000000e+00 +1157 0.00000000000000e+00 +1158 0.00000000000000e+00 +1159 0.00000000000000e+00 +1160 0.00000000000000e+00 +1161 0.00000000000000e+00 +1162 0.00000000000000e+00 +1163 0.00000000000000e+00 +1164 0.00000000000000e+00 +1165 0.00000000000000e+00 +1166 0.00000000000000e+00 +1167 0.00000000000000e+00 +1168 0.00000000000000e+00 +1169 0.00000000000000e+00 +1170 0.00000000000000e+00 +1171 0.00000000000000e+00 +1172 0.00000000000000e+00 +1173 0.00000000000000e+00 +1174 0.00000000000000e+00 +1175 0.00000000000000e+00 +1176 0.00000000000000e+00 +1177 0.00000000000000e+00 +1178 0.00000000000000e+00 +1179 0.00000000000000e+00 +1180 0.00000000000000e+00 +1181 0.00000000000000e+00 +1182 0.00000000000000e+00 +1183 0.00000000000000e+00 +1184 0.00000000000000e+00 +1185 0.00000000000000e+00 +1186 0.00000000000000e+00 +1187 -6.25000000000000e-04 +1188 0.00000000000000e+00 +1189 0.00000000000000e+00 +1190 -6.25000000000000e-04 +1191 0.00000000000000e+00 +1192 0.00000000000000e+00 +1193 -6.25000000000000e-04 +1194 0.00000000000000e+00 +1195 0.00000000000000e+00 +1196 -6.25000000000000e-04 +1197 0.00000000000000e+00 +1198 0.00000000000000e+00 +1199 -6.25000000000000e-04 +1200 0.00000000000000e+00 +1201 0.00000000000000e+00 +1202 -6.25000000000000e-04 +1203 0.00000000000000e+00 +1204 0.00000000000000e+00 +1205 0.00000000000000e+00 +1206 0.00000000000000e+00 +1207 0.00000000000000e+00 +1208 0.00000000000000e+00 +1209 0.00000000000000e+00 +1210 0.00000000000000e+00 +1211 0.00000000000000e+00 +1212 0.00000000000000e+00 +1213 0.00000000000000e+00 +1214 0.00000000000000e+00 +1215 0.00000000000000e+00 +1216 0.00000000000000e+00 +1217 0.00000000000000e+00 +1218 0.00000000000000e+00 +1219 0.00000000000000e+00 +1220 0.00000000000000e+00 +1221 0.00000000000000e+00 +1222 0.00000000000000e+00 +1223 0.00000000000000e+00 +1224 0.00000000000000e+00 +1225 0.00000000000000e+00 +1226 0.00000000000000e+00 +1227 0.00000000000000e+00 +1228 0.00000000000000e+00 +1229 0.00000000000000e+00 +1230 0.00000000000000e+00 +1231 0.00000000000000e+00 +1232 0.00000000000000e+00 +1233 0.00000000000000e+00 +1234 0.00000000000000e+00 +1235 0.00000000000000e+00 +1236 0.00000000000000e+00 +1237 0.00000000000000e+00 +1238 0.00000000000000e+00 +1239 0.00000000000000e+00 +1240 0.00000000000000e+00 +1241 0.00000000000000e+00 +1242 0.00000000000000e+00 +1243 0.00000000000000e+00 +1244 0.00000000000000e+00 +1245 0.00000000000000e+00 +1246 0.00000000000000e+00 +1247 0.00000000000000e+00 +1248 0.00000000000000e+00 +1249 0.00000000000000e+00 +1250 0.00000000000000e+00 +1251 0.00000000000000e+00 +1252 0.00000000000000e+00 +1253 0.00000000000000e+00 +1254 0.00000000000000e+00 +1255 0.00000000000000e+00 +1256 0.00000000000000e+00 +1257 0.00000000000000e+00 +1258 0.00000000000000e+00 +1259 0.00000000000000e+00 +1260 0.00000000000000e+00 +1261 0.00000000000000e+00 +1262 0.00000000000000e+00 +1263 0.00000000000000e+00 +1264 0.00000000000000e+00 +1265 0.00000000000000e+00 +1266 0.00000000000000e+00 +1267 0.00000000000000e+00 +1268 0.00000000000000e+00 +1269 0.00000000000000e+00 +1270 0.00000000000000e+00 +1271 0.00000000000000e+00 +1272 0.00000000000000e+00 +1273 0.00000000000000e+00 +1274 0.00000000000000e+00 diff --git a/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/b.IJ.00002 b/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/b.IJ.00002 new file mode 100644 index 00000000..3c64a019 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/b.IJ.00002 @@ -0,0 +1,601 @@ +1275 1874 +1275 0.00000000000000e+00 +1276 0.00000000000000e+00 +1277 0.00000000000000e+00 +1278 0.00000000000000e+00 +1279 0.00000000000000e+00 +1280 0.00000000000000e+00 +1281 0.00000000000000e+00 +1282 0.00000000000000e+00 +1283 0.00000000000000e+00 +1284 0.00000000000000e+00 +1285 0.00000000000000e+00 +1286 0.00000000000000e+00 +1287 0.00000000000000e+00 +1288 0.00000000000000e+00 +1289 0.00000000000000e+00 +1290 0.00000000000000e+00 +1291 0.00000000000000e+00 +1292 0.00000000000000e+00 +1293 0.00000000000000e+00 +1294 0.00000000000000e+00 +1295 0.00000000000000e+00 +1296 0.00000000000000e+00 +1297 0.00000000000000e+00 +1298 0.00000000000000e+00 +1299 0.00000000000000e+00 +1300 0.00000000000000e+00 +1301 0.00000000000000e+00 +1302 0.00000000000000e+00 +1303 0.00000000000000e+00 +1304 0.00000000000000e+00 +1305 0.00000000000000e+00 +1306 0.00000000000000e+00 +1307 0.00000000000000e+00 +1308 0.00000000000000e+00 +1309 0.00000000000000e+00 +1310 0.00000000000000e+00 +1311 0.00000000000000e+00 +1312 0.00000000000000e+00 +1313 0.00000000000000e+00 +1314 0.00000000000000e+00 +1315 0.00000000000000e+00 +1316 0.00000000000000e+00 +1317 0.00000000000000e+00 +1318 0.00000000000000e+00 +1319 0.00000000000000e+00 +1320 0.00000000000000e+00 +1321 0.00000000000000e+00 +1322 0.00000000000000e+00 +1323 0.00000000000000e+00 +1324 0.00000000000000e+00 +1325 0.00000000000000e+00 +1326 0.00000000000000e+00 +1327 0.00000000000000e+00 +1328 0.00000000000000e+00 +1329 0.00000000000000e+00 +1330 0.00000000000000e+00 +1331 0.00000000000000e+00 +1332 0.00000000000000e+00 +1333 0.00000000000000e+00 +1334 0.00000000000000e+00 +1335 0.00000000000000e+00 +1336 0.00000000000000e+00 +1337 0.00000000000000e+00 +1338 0.00000000000000e+00 +1339 0.00000000000000e+00 +1340 0.00000000000000e+00 +1341 0.00000000000000e+00 +1342 0.00000000000000e+00 +1343 0.00000000000000e+00 +1344 0.00000000000000e+00 +1345 0.00000000000000e+00 +1346 0.00000000000000e+00 +1347 0.00000000000000e+00 +1348 0.00000000000000e+00 +1349 0.00000000000000e+00 +1350 0.00000000000000e+00 +1351 0.00000000000000e+00 +1352 0.00000000000000e+00 +1353 0.00000000000000e+00 +1354 0.00000000000000e+00 +1355 0.00000000000000e+00 +1356 0.00000000000000e+00 +1357 0.00000000000000e+00 +1358 0.00000000000000e+00 +1359 0.00000000000000e+00 +1360 0.00000000000000e+00 +1361 0.00000000000000e+00 +1362 0.00000000000000e+00 +1363 0.00000000000000e+00 +1364 0.00000000000000e+00 +1365 0.00000000000000e+00 +1366 0.00000000000000e+00 +1367 0.00000000000000e+00 +1368 0.00000000000000e+00 +1369 0.00000000000000e+00 +1370 0.00000000000000e+00 +1371 0.00000000000000e+00 +1372 0.00000000000000e+00 +1373 0.00000000000000e+00 +1374 0.00000000000000e+00 +1375 0.00000000000000e+00 +1376 0.00000000000000e+00 +1377 0.00000000000000e+00 +1378 0.00000000000000e+00 +1379 0.00000000000000e+00 +1380 0.00000000000000e+00 +1381 0.00000000000000e+00 +1382 0.00000000000000e+00 +1383 0.00000000000000e+00 +1384 0.00000000000000e+00 +1385 0.00000000000000e+00 +1386 0.00000000000000e+00 +1387 0.00000000000000e+00 +1388 0.00000000000000e+00 +1389 0.00000000000000e+00 +1390 0.00000000000000e+00 +1391 0.00000000000000e+00 +1392 0.00000000000000e+00 +1393 0.00000000000000e+00 +1394 0.00000000000000e+00 +1395 0.00000000000000e+00 +1396 0.00000000000000e+00 +1397 0.00000000000000e+00 +1398 0.00000000000000e+00 +1399 0.00000000000000e+00 +1400 0.00000000000000e+00 +1401 0.00000000000000e+00 +1402 0.00000000000000e+00 +1403 0.00000000000000e+00 +1404 0.00000000000000e+00 +1405 0.00000000000000e+00 +1406 0.00000000000000e+00 +1407 0.00000000000000e+00 +1408 0.00000000000000e+00 +1409 0.00000000000000e+00 +1410 0.00000000000000e+00 +1411 0.00000000000000e+00 +1412 0.00000000000000e+00 +1413 0.00000000000000e+00 +1414 0.00000000000000e+00 +1415 0.00000000000000e+00 +1416 0.00000000000000e+00 +1417 0.00000000000000e+00 +1418 0.00000000000000e+00 +1419 0.00000000000000e+00 +1420 0.00000000000000e+00 +1421 0.00000000000000e+00 +1422 0.00000000000000e+00 +1423 0.00000000000000e+00 +1424 0.00000000000000e+00 +1425 0.00000000000000e+00 +1426 0.00000000000000e+00 +1427 0.00000000000000e+00 +1428 0.00000000000000e+00 +1429 0.00000000000000e+00 +1430 0.00000000000000e+00 +1431 0.00000000000000e+00 +1432 0.00000000000000e+00 +1433 0.00000000000000e+00 +1434 0.00000000000000e+00 +1435 0.00000000000000e+00 +1436 0.00000000000000e+00 +1437 0.00000000000000e+00 +1438 0.00000000000000e+00 +1439 0.00000000000000e+00 +1440 0.00000000000000e+00 +1441 0.00000000000000e+00 +1442 0.00000000000000e+00 +1443 0.00000000000000e+00 +1444 0.00000000000000e+00 +1445 0.00000000000000e+00 +1446 0.00000000000000e+00 +1447 0.00000000000000e+00 +1448 0.00000000000000e+00 +1449 0.00000000000000e+00 +1450 0.00000000000000e+00 +1451 0.00000000000000e+00 +1452 0.00000000000000e+00 +1453 0.00000000000000e+00 +1454 0.00000000000000e+00 +1455 0.00000000000000e+00 +1456 0.00000000000000e+00 +1457 0.00000000000000e+00 +1458 0.00000000000000e+00 +1459 0.00000000000000e+00 +1460 0.00000000000000e+00 +1461 0.00000000000000e+00 +1462 0.00000000000000e+00 +1463 0.00000000000000e+00 +1464 0.00000000000000e+00 +1465 0.00000000000000e+00 +1466 0.00000000000000e+00 +1467 0.00000000000000e+00 +1468 0.00000000000000e+00 +1469 0.00000000000000e+00 +1470 0.00000000000000e+00 +1471 0.00000000000000e+00 +1472 0.00000000000000e+00 +1473 0.00000000000000e+00 +1474 0.00000000000000e+00 +1475 0.00000000000000e+00 +1476 0.00000000000000e+00 +1477 0.00000000000000e+00 +1478 0.00000000000000e+00 +1479 0.00000000000000e+00 +1480 0.00000000000000e+00 +1481 0.00000000000000e+00 +1482 0.00000000000000e+00 +1483 0.00000000000000e+00 +1484 0.00000000000000e+00 +1485 0.00000000000000e+00 +1486 0.00000000000000e+00 +1487 0.00000000000000e+00 +1488 0.00000000000000e+00 +1489 0.00000000000000e+00 +1490 0.00000000000000e+00 +1491 0.00000000000000e+00 +1492 0.00000000000000e+00 +1493 0.00000000000000e+00 +1494 0.00000000000000e+00 +1495 0.00000000000000e+00 +1496 0.00000000000000e+00 +1497 0.00000000000000e+00 +1498 0.00000000000000e+00 +1499 0.00000000000000e+00 +1500 0.00000000000000e+00 +1501 0.00000000000000e+00 +1502 0.00000000000000e+00 +1503 0.00000000000000e+00 +1504 0.00000000000000e+00 +1505 0.00000000000000e+00 +1506 0.00000000000000e+00 +1507 0.00000000000000e+00 +1508 0.00000000000000e+00 +1509 0.00000000000000e+00 +1510 0.00000000000000e+00 +1511 0.00000000000000e+00 +1512 0.00000000000000e+00 +1513 0.00000000000000e+00 +1514 0.00000000000000e+00 +1515 0.00000000000000e+00 +1516 0.00000000000000e+00 +1517 0.00000000000000e+00 +1518 0.00000000000000e+00 +1519 0.00000000000000e+00 +1520 0.00000000000000e+00 +1521 0.00000000000000e+00 +1522 0.00000000000000e+00 +1523 0.00000000000000e+00 +1524 0.00000000000000e+00 +1525 0.00000000000000e+00 +1526 0.00000000000000e+00 +1527 0.00000000000000e+00 +1528 0.00000000000000e+00 +1529 0.00000000000000e+00 +1530 0.00000000000000e+00 +1531 0.00000000000000e+00 +1532 0.00000000000000e+00 +1533 0.00000000000000e+00 +1534 0.00000000000000e+00 +1535 0.00000000000000e+00 +1536 0.00000000000000e+00 +1537 0.00000000000000e+00 +1538 0.00000000000000e+00 +1539 0.00000000000000e+00 +1540 0.00000000000000e+00 +1541 0.00000000000000e+00 +1542 0.00000000000000e+00 +1543 0.00000000000000e+00 +1544 0.00000000000000e+00 +1545 0.00000000000000e+00 +1546 0.00000000000000e+00 +1547 0.00000000000000e+00 +1548 0.00000000000000e+00 +1549 0.00000000000000e+00 +1550 0.00000000000000e+00 +1551 0.00000000000000e+00 +1552 0.00000000000000e+00 +1553 0.00000000000000e+00 +1554 0.00000000000000e+00 +1555 0.00000000000000e+00 +1556 0.00000000000000e+00 +1557 0.00000000000000e+00 +1558 0.00000000000000e+00 +1559 0.00000000000000e+00 +1560 0.00000000000000e+00 +1561 0.00000000000000e+00 +1562 0.00000000000000e+00 +1563 0.00000000000000e+00 +1564 0.00000000000000e+00 +1565 0.00000000000000e+00 +1566 0.00000000000000e+00 +1567 0.00000000000000e+00 +1568 0.00000000000000e+00 +1569 0.00000000000000e+00 +1570 0.00000000000000e+00 +1571 0.00000000000000e+00 +1572 0.00000000000000e+00 +1573 0.00000000000000e+00 +1574 0.00000000000000e+00 +1575 0.00000000000000e+00 +1576 0.00000000000000e+00 +1577 0.00000000000000e+00 +1578 0.00000000000000e+00 +1579 0.00000000000000e+00 +1580 0.00000000000000e+00 +1581 0.00000000000000e+00 +1582 0.00000000000000e+00 +1583 0.00000000000000e+00 +1584 0.00000000000000e+00 +1585 0.00000000000000e+00 +1586 0.00000000000000e+00 +1587 0.00000000000000e+00 +1588 0.00000000000000e+00 +1589 0.00000000000000e+00 +1590 0.00000000000000e+00 +1591 0.00000000000000e+00 +1592 0.00000000000000e+00 +1593 0.00000000000000e+00 +1594 0.00000000000000e+00 +1595 0.00000000000000e+00 +1596 0.00000000000000e+00 +1597 0.00000000000000e+00 +1598 0.00000000000000e+00 +1599 0.00000000000000e+00 +1600 0.00000000000000e+00 +1601 0.00000000000000e+00 +1602 0.00000000000000e+00 +1603 0.00000000000000e+00 +1604 0.00000000000000e+00 +1605 0.00000000000000e+00 +1606 0.00000000000000e+00 +1607 0.00000000000000e+00 +1608 0.00000000000000e+00 +1609 0.00000000000000e+00 +1610 0.00000000000000e+00 +1611 0.00000000000000e+00 +1612 0.00000000000000e+00 +1613 0.00000000000000e+00 +1614 0.00000000000000e+00 +1615 0.00000000000000e+00 +1616 0.00000000000000e+00 +1617 0.00000000000000e+00 +1618 0.00000000000000e+00 +1619 0.00000000000000e+00 +1620 0.00000000000000e+00 +1621 0.00000000000000e+00 +1622 0.00000000000000e+00 +1623 0.00000000000000e+00 +1624 0.00000000000000e+00 +1625 0.00000000000000e+00 +1626 0.00000000000000e+00 +1627 0.00000000000000e+00 +1628 0.00000000000000e+00 +1629 0.00000000000000e+00 +1630 0.00000000000000e+00 +1631 0.00000000000000e+00 +1632 0.00000000000000e+00 +1633 0.00000000000000e+00 +1634 0.00000000000000e+00 +1635 0.00000000000000e+00 +1636 0.00000000000000e+00 +1637 0.00000000000000e+00 +1638 0.00000000000000e+00 +1639 0.00000000000000e+00 +1640 0.00000000000000e+00 +1641 0.00000000000000e+00 +1642 0.00000000000000e+00 +1643 0.00000000000000e+00 +1644 0.00000000000000e+00 +1645 0.00000000000000e+00 +1646 0.00000000000000e+00 +1647 0.00000000000000e+00 +1648 0.00000000000000e+00 +1649 0.00000000000000e+00 +1650 0.00000000000000e+00 +1651 0.00000000000000e+00 +1652 0.00000000000000e+00 +1653 0.00000000000000e+00 +1654 0.00000000000000e+00 +1655 0.00000000000000e+00 +1656 0.00000000000000e+00 +1657 0.00000000000000e+00 +1658 0.00000000000000e+00 +1659 0.00000000000000e+00 +1660 0.00000000000000e+00 +1661 0.00000000000000e+00 +1662 0.00000000000000e+00 +1663 0.00000000000000e+00 +1664 0.00000000000000e+00 +1665 0.00000000000000e+00 +1666 0.00000000000000e+00 +1667 0.00000000000000e+00 +1668 0.00000000000000e+00 +1669 0.00000000000000e+00 +1670 0.00000000000000e+00 +1671 0.00000000000000e+00 +1672 0.00000000000000e+00 +1673 0.00000000000000e+00 +1674 0.00000000000000e+00 +1675 0.00000000000000e+00 +1676 0.00000000000000e+00 +1677 0.00000000000000e+00 +1678 0.00000000000000e+00 +1679 0.00000000000000e+00 +1680 0.00000000000000e+00 +1681 0.00000000000000e+00 +1682 0.00000000000000e+00 +1683 0.00000000000000e+00 +1684 0.00000000000000e+00 +1685 0.00000000000000e+00 +1686 0.00000000000000e+00 +1687 0.00000000000000e+00 +1688 0.00000000000000e+00 +1689 0.00000000000000e+00 +1690 0.00000000000000e+00 +1691 0.00000000000000e+00 +1692 0.00000000000000e+00 +1693 0.00000000000000e+00 +1694 0.00000000000000e+00 +1695 0.00000000000000e+00 +1696 0.00000000000000e+00 +1697 0.00000000000000e+00 +1698 0.00000000000000e+00 +1699 0.00000000000000e+00 +1700 0.00000000000000e+00 +1701 0.00000000000000e+00 +1702 0.00000000000000e+00 +1703 0.00000000000000e+00 +1704 0.00000000000000e+00 +1705 0.00000000000000e+00 +1706 0.00000000000000e+00 +1707 0.00000000000000e+00 +1708 0.00000000000000e+00 +1709 0.00000000000000e+00 +1710 0.00000000000000e+00 +1711 0.00000000000000e+00 +1712 0.00000000000000e+00 +1713 0.00000000000000e+00 +1714 0.00000000000000e+00 +1715 0.00000000000000e+00 +1716 0.00000000000000e+00 +1717 0.00000000000000e+00 +1718 0.00000000000000e+00 +1719 0.00000000000000e+00 +1720 0.00000000000000e+00 +1721 0.00000000000000e+00 +1722 0.00000000000000e+00 +1723 0.00000000000000e+00 +1724 0.00000000000000e+00 +1725 0.00000000000000e+00 +1726 0.00000000000000e+00 +1727 0.00000000000000e+00 +1728 0.00000000000000e+00 +1729 0.00000000000000e+00 +1730 0.00000000000000e+00 +1731 0.00000000000000e+00 +1732 0.00000000000000e+00 +1733 0.00000000000000e+00 +1734 0.00000000000000e+00 +1735 0.00000000000000e+00 +1736 0.00000000000000e+00 +1737 0.00000000000000e+00 +1738 0.00000000000000e+00 +1739 0.00000000000000e+00 +1740 0.00000000000000e+00 +1741 0.00000000000000e+00 +1742 0.00000000000000e+00 +1743 0.00000000000000e+00 +1744 0.00000000000000e+00 +1745 0.00000000000000e+00 +1746 0.00000000000000e+00 +1747 0.00000000000000e+00 +1748 0.00000000000000e+00 +1749 0.00000000000000e+00 +1750 0.00000000000000e+00 +1751 0.00000000000000e+00 +1752 0.00000000000000e+00 +1753 0.00000000000000e+00 +1754 0.00000000000000e+00 +1755 0.00000000000000e+00 +1756 0.00000000000000e+00 +1757 0.00000000000000e+00 +1758 0.00000000000000e+00 +1759 0.00000000000000e+00 +1760 0.00000000000000e+00 +1761 0.00000000000000e+00 +1762 0.00000000000000e+00 +1763 0.00000000000000e+00 +1764 0.00000000000000e+00 +1765 0.00000000000000e+00 +1766 0.00000000000000e+00 +1767 0.00000000000000e+00 +1768 0.00000000000000e+00 +1769 0.00000000000000e+00 +1770 0.00000000000000e+00 +1771 0.00000000000000e+00 +1772 0.00000000000000e+00 +1773 0.00000000000000e+00 +1774 0.00000000000000e+00 +1775 0.00000000000000e+00 +1776 0.00000000000000e+00 +1777 0.00000000000000e+00 +1778 0.00000000000000e+00 +1779 0.00000000000000e+00 +1780 0.00000000000000e+00 +1781 0.00000000000000e+00 +1782 0.00000000000000e+00 +1783 0.00000000000000e+00 +1784 0.00000000000000e+00 +1785 0.00000000000000e+00 +1786 0.00000000000000e+00 +1787 0.00000000000000e+00 +1788 0.00000000000000e+00 +1789 0.00000000000000e+00 +1790 0.00000000000000e+00 +1791 0.00000000000000e+00 +1792 0.00000000000000e+00 +1793 0.00000000000000e+00 +1794 0.00000000000000e+00 +1795 0.00000000000000e+00 +1796 0.00000000000000e+00 +1797 0.00000000000000e+00 +1798 0.00000000000000e+00 +1799 0.00000000000000e+00 +1800 0.00000000000000e+00 +1801 0.00000000000000e+00 +1802 0.00000000000000e+00 +1803 0.00000000000000e+00 +1804 0.00000000000000e+00 +1805 0.00000000000000e+00 +1806 0.00000000000000e+00 +1807 0.00000000000000e+00 +1808 0.00000000000000e+00 +1809 0.00000000000000e+00 +1810 0.00000000000000e+00 +1811 0.00000000000000e+00 +1812 0.00000000000000e+00 +1813 0.00000000000000e+00 +1814 0.00000000000000e+00 +1815 0.00000000000000e+00 +1816 0.00000000000000e+00 +1817 0.00000000000000e+00 +1818 0.00000000000000e+00 +1819 0.00000000000000e+00 +1820 0.00000000000000e+00 +1821 0.00000000000000e+00 +1822 0.00000000000000e+00 +1823 0.00000000000000e+00 +1824 0.00000000000000e+00 +1825 0.00000000000000e+00 +1826 0.00000000000000e+00 +1827 0.00000000000000e+00 +1828 0.00000000000000e+00 +1829 0.00000000000000e+00 +1830 0.00000000000000e+00 +1831 0.00000000000000e+00 +1832 0.00000000000000e+00 +1833 0.00000000000000e+00 +1834 0.00000000000000e+00 +1835 0.00000000000000e+00 +1836 0.00000000000000e+00 +1837 0.00000000000000e+00 +1838 0.00000000000000e+00 +1839 0.00000000000000e+00 +1840 0.00000000000000e+00 +1841 0.00000000000000e+00 +1842 0.00000000000000e+00 +1843 0.00000000000000e+00 +1844 0.00000000000000e+00 +1845 0.00000000000000e+00 +1846 0.00000000000000e+00 +1847 0.00000000000000e+00 +1848 0.00000000000000e+00 +1849 0.00000000000000e+00 +1850 0.00000000000000e+00 +1851 0.00000000000000e+00 +1852 0.00000000000000e+00 +1853 0.00000000000000e+00 +1854 0.00000000000000e+00 +1855 0.00000000000000e+00 +1856 0.00000000000000e+00 +1857 0.00000000000000e+00 +1858 0.00000000000000e+00 +1859 0.00000000000000e+00 +1860 0.00000000000000e+00 +1861 0.00000000000000e+00 +1862 0.00000000000000e+00 +1863 0.00000000000000e+00 +1864 0.00000000000000e+00 +1865 0.00000000000000e+00 +1866 0.00000000000000e+00 +1867 0.00000000000000e+00 +1868 0.00000000000000e+00 +1869 0.00000000000000e+00 +1870 0.00000000000000e+00 +1871 0.00000000000000e+00 +1872 0.00000000000000e+00 +1873 0.00000000000000e+00 +1874 0.00000000000000e+00 diff --git a/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/b.IJ.00003 b/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/b.IJ.00003 new file mode 100644 index 00000000..7f5ab5cb --- /dev/null +++ b/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/b.IJ.00003 @@ -0,0 +1,601 @@ +1875 2474 +1875 0.00000000000000e+00 +1876 0.00000000000000e+00 +1877 0.00000000000000e+00 +1878 0.00000000000000e+00 +1879 0.00000000000000e+00 +1880 0.00000000000000e+00 +1881 0.00000000000000e+00 +1882 0.00000000000000e+00 +1883 0.00000000000000e+00 +1884 0.00000000000000e+00 +1885 0.00000000000000e+00 +1886 0.00000000000000e+00 +1887 0.00000000000000e+00 +1888 0.00000000000000e+00 +1889 0.00000000000000e+00 +1890 0.00000000000000e+00 +1891 0.00000000000000e+00 +1892 0.00000000000000e+00 +1893 0.00000000000000e+00 +1894 0.00000000000000e+00 +1895 0.00000000000000e+00 +1896 0.00000000000000e+00 +1897 0.00000000000000e+00 +1898 0.00000000000000e+00 +1899 0.00000000000000e+00 +1900 0.00000000000000e+00 +1901 0.00000000000000e+00 +1902 0.00000000000000e+00 +1903 0.00000000000000e+00 +1904 0.00000000000000e+00 +1905 0.00000000000000e+00 +1906 0.00000000000000e+00 +1907 0.00000000000000e+00 +1908 0.00000000000000e+00 +1909 0.00000000000000e+00 +1910 0.00000000000000e+00 +1911 0.00000000000000e+00 +1912 0.00000000000000e+00 +1913 0.00000000000000e+00 +1914 0.00000000000000e+00 +1915 0.00000000000000e+00 +1916 0.00000000000000e+00 +1917 0.00000000000000e+00 +1918 0.00000000000000e+00 +1919 0.00000000000000e+00 +1920 0.00000000000000e+00 +1921 0.00000000000000e+00 +1922 0.00000000000000e+00 +1923 0.00000000000000e+00 +1924 0.00000000000000e+00 +1925 0.00000000000000e+00 +1926 0.00000000000000e+00 +1927 0.00000000000000e+00 +1928 0.00000000000000e+00 +1929 0.00000000000000e+00 +1930 0.00000000000000e+00 +1931 0.00000000000000e+00 +1932 0.00000000000000e+00 +1933 0.00000000000000e+00 +1934 0.00000000000000e+00 +1935 0.00000000000000e+00 +1936 0.00000000000000e+00 +1937 0.00000000000000e+00 +1938 0.00000000000000e+00 +1939 0.00000000000000e+00 +1940 0.00000000000000e+00 +1941 0.00000000000000e+00 +1942 0.00000000000000e+00 +1943 0.00000000000000e+00 +1944 0.00000000000000e+00 +1945 0.00000000000000e+00 +1946 0.00000000000000e+00 +1947 0.00000000000000e+00 +1948 0.00000000000000e+00 +1949 0.00000000000000e+00 +1950 0.00000000000000e+00 +1951 0.00000000000000e+00 +1952 0.00000000000000e+00 +1953 0.00000000000000e+00 +1954 0.00000000000000e+00 +1955 0.00000000000000e+00 +1956 0.00000000000000e+00 +1957 0.00000000000000e+00 +1958 0.00000000000000e+00 +1959 0.00000000000000e+00 +1960 0.00000000000000e+00 +1961 0.00000000000000e+00 +1962 0.00000000000000e+00 +1963 0.00000000000000e+00 +1964 0.00000000000000e+00 +1965 0.00000000000000e+00 +1966 0.00000000000000e+00 +1967 0.00000000000000e+00 +1968 0.00000000000000e+00 +1969 0.00000000000000e+00 +1970 0.00000000000000e+00 +1971 0.00000000000000e+00 +1972 0.00000000000000e+00 +1973 0.00000000000000e+00 +1974 0.00000000000000e+00 +1975 0.00000000000000e+00 +1976 0.00000000000000e+00 +1977 0.00000000000000e+00 +1978 0.00000000000000e+00 +1979 0.00000000000000e+00 +1980 0.00000000000000e+00 +1981 0.00000000000000e+00 +1982 0.00000000000000e+00 +1983 0.00000000000000e+00 +1984 0.00000000000000e+00 +1985 0.00000000000000e+00 +1986 0.00000000000000e+00 +1987 0.00000000000000e+00 +1988 0.00000000000000e+00 +1989 0.00000000000000e+00 +1990 0.00000000000000e+00 +1991 0.00000000000000e+00 +1992 0.00000000000000e+00 +1993 0.00000000000000e+00 +1994 0.00000000000000e+00 +1995 0.00000000000000e+00 +1996 0.00000000000000e+00 +1997 0.00000000000000e+00 +1998 0.00000000000000e+00 +1999 0.00000000000000e+00 +2000 0.00000000000000e+00 +2001 0.00000000000000e+00 +2002 0.00000000000000e+00 +2003 0.00000000000000e+00 +2004 0.00000000000000e+00 +2005 0.00000000000000e+00 +2006 0.00000000000000e+00 +2007 0.00000000000000e+00 +2008 0.00000000000000e+00 +2009 0.00000000000000e+00 +2010 0.00000000000000e+00 +2011 0.00000000000000e+00 +2012 0.00000000000000e+00 +2013 0.00000000000000e+00 +2014 0.00000000000000e+00 +2015 0.00000000000000e+00 +2016 0.00000000000000e+00 +2017 0.00000000000000e+00 +2018 0.00000000000000e+00 +2019 0.00000000000000e+00 +2020 0.00000000000000e+00 +2021 0.00000000000000e+00 +2022 0.00000000000000e+00 +2023 0.00000000000000e+00 +2024 0.00000000000000e+00 +2025 0.00000000000000e+00 +2026 0.00000000000000e+00 +2027 0.00000000000000e+00 +2028 0.00000000000000e+00 +2029 0.00000000000000e+00 +2030 0.00000000000000e+00 +2031 0.00000000000000e+00 +2032 0.00000000000000e+00 +2033 0.00000000000000e+00 +2034 0.00000000000000e+00 +2035 0.00000000000000e+00 +2036 0.00000000000000e+00 +2037 0.00000000000000e+00 +2038 0.00000000000000e+00 +2039 0.00000000000000e+00 +2040 0.00000000000000e+00 +2041 0.00000000000000e+00 +2042 0.00000000000000e+00 +2043 0.00000000000000e+00 +2044 0.00000000000000e+00 +2045 0.00000000000000e+00 +2046 0.00000000000000e+00 +2047 0.00000000000000e+00 +2048 0.00000000000000e+00 +2049 0.00000000000000e+00 +2050 0.00000000000000e+00 +2051 0.00000000000000e+00 +2052 0.00000000000000e+00 +2053 0.00000000000000e+00 +2054 0.00000000000000e+00 +2055 0.00000000000000e+00 +2056 0.00000000000000e+00 +2057 0.00000000000000e+00 +2058 0.00000000000000e+00 +2059 0.00000000000000e+00 +2060 0.00000000000000e+00 +2061 0.00000000000000e+00 +2062 0.00000000000000e+00 +2063 0.00000000000000e+00 +2064 0.00000000000000e+00 +2065 0.00000000000000e+00 +2066 0.00000000000000e+00 +2067 0.00000000000000e+00 +2068 0.00000000000000e+00 +2069 0.00000000000000e+00 +2070 0.00000000000000e+00 +2071 0.00000000000000e+00 +2072 0.00000000000000e+00 +2073 0.00000000000000e+00 +2074 0.00000000000000e+00 +2075 0.00000000000000e+00 +2076 0.00000000000000e+00 +2077 0.00000000000000e+00 +2078 0.00000000000000e+00 +2079 0.00000000000000e+00 +2080 0.00000000000000e+00 +2081 0.00000000000000e+00 +2082 0.00000000000000e+00 +2083 0.00000000000000e+00 +2084 0.00000000000000e+00 +2085 0.00000000000000e+00 +2086 0.00000000000000e+00 +2087 0.00000000000000e+00 +2088 0.00000000000000e+00 +2089 0.00000000000000e+00 +2090 0.00000000000000e+00 +2091 0.00000000000000e+00 +2092 0.00000000000000e+00 +2093 0.00000000000000e+00 +2094 0.00000000000000e+00 +2095 0.00000000000000e+00 +2096 0.00000000000000e+00 +2097 0.00000000000000e+00 +2098 0.00000000000000e+00 +2099 0.00000000000000e+00 +2100 0.00000000000000e+00 +2101 0.00000000000000e+00 +2102 0.00000000000000e+00 +2103 0.00000000000000e+00 +2104 0.00000000000000e+00 +2105 0.00000000000000e+00 +2106 0.00000000000000e+00 +2107 0.00000000000000e+00 +2108 0.00000000000000e+00 +2109 0.00000000000000e+00 +2110 0.00000000000000e+00 +2111 0.00000000000000e+00 +2112 0.00000000000000e+00 +2113 0.00000000000000e+00 +2114 0.00000000000000e+00 +2115 0.00000000000000e+00 +2116 0.00000000000000e+00 +2117 0.00000000000000e+00 +2118 0.00000000000000e+00 +2119 0.00000000000000e+00 +2120 0.00000000000000e+00 +2121 0.00000000000000e+00 +2122 0.00000000000000e+00 +2123 0.00000000000000e+00 +2124 0.00000000000000e+00 +2125 0.00000000000000e+00 +2126 0.00000000000000e+00 +2127 0.00000000000000e+00 +2128 0.00000000000000e+00 +2129 0.00000000000000e+00 +2130 0.00000000000000e+00 +2131 0.00000000000000e+00 +2132 0.00000000000000e+00 +2133 0.00000000000000e+00 +2134 0.00000000000000e+00 +2135 0.00000000000000e+00 +2136 0.00000000000000e+00 +2137 0.00000000000000e+00 +2138 0.00000000000000e+00 +2139 0.00000000000000e+00 +2140 0.00000000000000e+00 +2141 0.00000000000000e+00 +2142 0.00000000000000e+00 +2143 0.00000000000000e+00 +2144 0.00000000000000e+00 +2145 0.00000000000000e+00 +2146 0.00000000000000e+00 +2147 0.00000000000000e+00 +2148 0.00000000000000e+00 +2149 0.00000000000000e+00 +2150 0.00000000000000e+00 +2151 0.00000000000000e+00 +2152 0.00000000000000e+00 +2153 0.00000000000000e+00 +2154 0.00000000000000e+00 +2155 0.00000000000000e+00 +2156 0.00000000000000e+00 +2157 0.00000000000000e+00 +2158 0.00000000000000e+00 +2159 0.00000000000000e+00 +2160 0.00000000000000e+00 +2161 0.00000000000000e+00 +2162 0.00000000000000e+00 +2163 0.00000000000000e+00 +2164 0.00000000000000e+00 +2165 0.00000000000000e+00 +2166 0.00000000000000e+00 +2167 0.00000000000000e+00 +2168 0.00000000000000e+00 +2169 0.00000000000000e+00 +2170 0.00000000000000e+00 +2171 0.00000000000000e+00 +2172 0.00000000000000e+00 +2173 0.00000000000000e+00 +2174 0.00000000000000e+00 +2175 0.00000000000000e+00 +2176 0.00000000000000e+00 +2177 0.00000000000000e+00 +2178 0.00000000000000e+00 +2179 0.00000000000000e+00 +2180 0.00000000000000e+00 +2181 0.00000000000000e+00 +2182 0.00000000000000e+00 +2183 0.00000000000000e+00 +2184 0.00000000000000e+00 +2185 0.00000000000000e+00 +2186 0.00000000000000e+00 +2187 0.00000000000000e+00 +2188 0.00000000000000e+00 +2189 0.00000000000000e+00 +2190 0.00000000000000e+00 +2191 0.00000000000000e+00 +2192 0.00000000000000e+00 +2193 0.00000000000000e+00 +2194 0.00000000000000e+00 +2195 0.00000000000000e+00 +2196 0.00000000000000e+00 +2197 0.00000000000000e+00 +2198 0.00000000000000e+00 +2199 0.00000000000000e+00 +2200 0.00000000000000e+00 +2201 0.00000000000000e+00 +2202 0.00000000000000e+00 +2203 0.00000000000000e+00 +2204 0.00000000000000e+00 +2205 0.00000000000000e+00 +2206 0.00000000000000e+00 +2207 0.00000000000000e+00 +2208 0.00000000000000e+00 +2209 0.00000000000000e+00 +2210 0.00000000000000e+00 +2211 0.00000000000000e+00 +2212 0.00000000000000e+00 +2213 0.00000000000000e+00 +2214 0.00000000000000e+00 +2215 0.00000000000000e+00 +2216 0.00000000000000e+00 +2217 0.00000000000000e+00 +2218 0.00000000000000e+00 +2219 0.00000000000000e+00 +2220 0.00000000000000e+00 +2221 0.00000000000000e+00 +2222 0.00000000000000e+00 +2223 0.00000000000000e+00 +2224 0.00000000000000e+00 +2225 0.00000000000000e+00 +2226 0.00000000000000e+00 +2227 0.00000000000000e+00 +2228 0.00000000000000e+00 +2229 0.00000000000000e+00 +2230 0.00000000000000e+00 +2231 0.00000000000000e+00 +2232 0.00000000000000e+00 +2233 0.00000000000000e+00 +2234 0.00000000000000e+00 +2235 0.00000000000000e+00 +2236 0.00000000000000e+00 +2237 0.00000000000000e+00 +2238 0.00000000000000e+00 +2239 0.00000000000000e+00 +2240 0.00000000000000e+00 +2241 0.00000000000000e+00 +2242 0.00000000000000e+00 +2243 0.00000000000000e+00 +2244 0.00000000000000e+00 +2245 0.00000000000000e+00 +2246 0.00000000000000e+00 +2247 0.00000000000000e+00 +2248 0.00000000000000e+00 +2249 0.00000000000000e+00 +2250 0.00000000000000e+00 +2251 0.00000000000000e+00 +2252 0.00000000000000e+00 +2253 0.00000000000000e+00 +2254 0.00000000000000e+00 +2255 0.00000000000000e+00 +2256 0.00000000000000e+00 +2257 0.00000000000000e+00 +2258 0.00000000000000e+00 +2259 0.00000000000000e+00 +2260 0.00000000000000e+00 +2261 0.00000000000000e+00 +2262 0.00000000000000e+00 +2263 0.00000000000000e+00 +2264 0.00000000000000e+00 +2265 0.00000000000000e+00 +2266 0.00000000000000e+00 +2267 0.00000000000000e+00 +2268 0.00000000000000e+00 +2269 0.00000000000000e+00 +2270 0.00000000000000e+00 +2271 0.00000000000000e+00 +2272 0.00000000000000e+00 +2273 0.00000000000000e+00 +2274 0.00000000000000e+00 +2275 0.00000000000000e+00 +2276 0.00000000000000e+00 +2277 0.00000000000000e+00 +2278 0.00000000000000e+00 +2279 0.00000000000000e+00 +2280 0.00000000000000e+00 +2281 0.00000000000000e+00 +2282 0.00000000000000e+00 +2283 0.00000000000000e+00 +2284 0.00000000000000e+00 +2285 0.00000000000000e+00 +2286 0.00000000000000e+00 +2287 0.00000000000000e+00 +2288 0.00000000000000e+00 +2289 0.00000000000000e+00 +2290 0.00000000000000e+00 +2291 0.00000000000000e+00 +2292 0.00000000000000e+00 +2293 0.00000000000000e+00 +2294 0.00000000000000e+00 +2295 0.00000000000000e+00 +2296 0.00000000000000e+00 +2297 0.00000000000000e+00 +2298 0.00000000000000e+00 +2299 0.00000000000000e+00 +2300 0.00000000000000e+00 +2301 0.00000000000000e+00 +2302 0.00000000000000e+00 +2303 0.00000000000000e+00 +2304 0.00000000000000e+00 +2305 0.00000000000000e+00 +2306 0.00000000000000e+00 +2307 0.00000000000000e+00 +2308 0.00000000000000e+00 +2309 0.00000000000000e+00 +2310 0.00000000000000e+00 +2311 0.00000000000000e+00 +2312 0.00000000000000e+00 +2313 0.00000000000000e+00 +2314 0.00000000000000e+00 +2315 0.00000000000000e+00 +2316 0.00000000000000e+00 +2317 0.00000000000000e+00 +2318 0.00000000000000e+00 +2319 0.00000000000000e+00 +2320 0.00000000000000e+00 +2321 0.00000000000000e+00 +2322 0.00000000000000e+00 +2323 0.00000000000000e+00 +2324 0.00000000000000e+00 +2325 0.00000000000000e+00 +2326 0.00000000000000e+00 +2327 0.00000000000000e+00 +2328 0.00000000000000e+00 +2329 0.00000000000000e+00 +2330 0.00000000000000e+00 +2331 0.00000000000000e+00 +2332 0.00000000000000e+00 +2333 0.00000000000000e+00 +2334 0.00000000000000e+00 +2335 0.00000000000000e+00 +2336 0.00000000000000e+00 +2337 0.00000000000000e+00 +2338 0.00000000000000e+00 +2339 0.00000000000000e+00 +2340 0.00000000000000e+00 +2341 0.00000000000000e+00 +2342 0.00000000000000e+00 +2343 0.00000000000000e+00 +2344 0.00000000000000e+00 +2345 0.00000000000000e+00 +2346 0.00000000000000e+00 +2347 0.00000000000000e+00 +2348 0.00000000000000e+00 +2349 0.00000000000000e+00 +2350 0.00000000000000e+00 +2351 0.00000000000000e+00 +2352 0.00000000000000e+00 +2353 0.00000000000000e+00 +2354 0.00000000000000e+00 +2355 0.00000000000000e+00 +2356 0.00000000000000e+00 +2357 0.00000000000000e+00 +2358 0.00000000000000e+00 +2359 0.00000000000000e+00 +2360 0.00000000000000e+00 +2361 0.00000000000000e+00 +2362 0.00000000000000e+00 +2363 0.00000000000000e+00 +2364 0.00000000000000e+00 +2365 0.00000000000000e+00 +2366 0.00000000000000e+00 +2367 0.00000000000000e+00 +2368 0.00000000000000e+00 +2369 0.00000000000000e+00 +2370 0.00000000000000e+00 +2371 0.00000000000000e+00 +2372 0.00000000000000e+00 +2373 0.00000000000000e+00 +2374 0.00000000000000e+00 +2375 0.00000000000000e+00 +2376 0.00000000000000e+00 +2377 0.00000000000000e+00 +2378 0.00000000000000e+00 +2379 0.00000000000000e+00 +2380 0.00000000000000e+00 +2381 0.00000000000000e+00 +2382 0.00000000000000e+00 +2383 0.00000000000000e+00 +2384 0.00000000000000e+00 +2385 0.00000000000000e+00 +2386 0.00000000000000e+00 +2387 0.00000000000000e+00 +2388 0.00000000000000e+00 +2389 0.00000000000000e+00 +2390 0.00000000000000e+00 +2391 0.00000000000000e+00 +2392 0.00000000000000e+00 +2393 0.00000000000000e+00 +2394 0.00000000000000e+00 +2395 0.00000000000000e+00 +2396 0.00000000000000e+00 +2397 0.00000000000000e+00 +2398 0.00000000000000e+00 +2399 0.00000000000000e+00 +2400 0.00000000000000e+00 +2401 0.00000000000000e+00 +2402 0.00000000000000e+00 +2403 0.00000000000000e+00 +2404 0.00000000000000e+00 +2405 0.00000000000000e+00 +2406 0.00000000000000e+00 +2407 0.00000000000000e+00 +2408 0.00000000000000e+00 +2409 0.00000000000000e+00 +2410 0.00000000000000e+00 +2411 0.00000000000000e+00 +2412 0.00000000000000e+00 +2413 0.00000000000000e+00 +2414 0.00000000000000e+00 +2415 0.00000000000000e+00 +2416 0.00000000000000e+00 +2417 0.00000000000000e+00 +2418 0.00000000000000e+00 +2419 0.00000000000000e+00 +2420 0.00000000000000e+00 +2421 0.00000000000000e+00 +2422 0.00000000000000e+00 +2423 0.00000000000000e+00 +2424 0.00000000000000e+00 +2425 0.00000000000000e+00 +2426 0.00000000000000e+00 +2427 0.00000000000000e+00 +2428 0.00000000000000e+00 +2429 0.00000000000000e+00 +2430 0.00000000000000e+00 +2431 0.00000000000000e+00 +2432 0.00000000000000e+00 +2433 0.00000000000000e+00 +2434 0.00000000000000e+00 +2435 0.00000000000000e+00 +2436 0.00000000000000e+00 +2437 0.00000000000000e+00 +2438 0.00000000000000e+00 +2439 0.00000000000000e+00 +2440 0.00000000000000e+00 +2441 0.00000000000000e+00 +2442 0.00000000000000e+00 +2443 0.00000000000000e+00 +2444 0.00000000000000e+00 +2445 0.00000000000000e+00 +2446 0.00000000000000e+00 +2447 0.00000000000000e+00 +2448 0.00000000000000e+00 +2449 0.00000000000000e+00 +2450 0.00000000000000e+00 +2451 0.00000000000000e+00 +2452 0.00000000000000e+00 +2453 0.00000000000000e+00 +2454 0.00000000000000e+00 +2455 0.00000000000000e+00 +2456 0.00000000000000e+00 +2457 0.00000000000000e+00 +2458 0.00000000000000e+00 +2459 0.00000000000000e+00 +2460 0.00000000000000e+00 +2461 0.00000000000000e+00 +2462 0.00000000000000e+00 +2463 0.00000000000000e+00 +2464 0.00000000000000e+00 +2465 0.00000000000000e+00 +2466 0.00000000000000e+00 +2467 0.00000000000000e+00 +2468 0.00000000000000e+00 +2469 0.00000000000000e+00 +2470 0.00000000000000e+00 +2471 0.00000000000000e+00 +2472 0.00000000000000e+00 +2473 0.00000000000000e+00 +2474 0.00000000000000e+00 diff --git a/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/mfem.txt b/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/mfem.txt new file mode 100644 index 00000000..317665f2 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/mfem.txt @@ -0,0 +1,19 @@ +$ mpirun -np 4 ./ex2p -m ../beam-tet.mesh -sr 0 -sp 2 -no-vis + +Produced with mfem-4.4 (https://github.com/mfem/mfem/archive/refs/tags/v4.4.tar.gz) + +Options used: + --mesh ../beam-tet.mesh + --order 1 + --serial_ref 0 + --parallel_ref 2 + --amg-for-systems + --no-static-condensation + --no-visualization + --by-vdim + --device cpu +Device configuration: cpu +Memory configuration: host-std +Number of finite element unknowns: 2475 +Assembling: r.h.s. ... matrix ... done. +Size of linear system: 2475 \ No newline at end of file diff --git a/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.0.00000 b/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.0.00000 new file mode 100644 index 00000000..dc6a3cd9 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.0.00000 @@ -0,0 +1,676 @@ +0 675 +0 0.00000000000000e+00 +1 -4.00000000000000e+00 +2 0.00000000000000e+00 +3 0.00000000000000e+00 +4 -5.00000000000000e+00 +5 0.00000000000000e+00 +6 0.00000000000000e+00 +7 -6.00000000000000e+00 +8 0.00000000000000e+00 +9 1.00000000000000e+00 +10 -4.00000000000000e+00 +11 0.00000000000000e+00 +12 1.00000000000000e+00 +13 -5.00000000000000e+00 +14 0.00000000000000e+00 +15 1.00000000000000e+00 +16 -6.00000000000000e+00 +17 0.00000000000000e+00 +18 0.00000000000000e+00 +19 -4.00000000000000e+00 +20 0.00000000000000e+00 +21 0.00000000000000e+00 +22 -5.00000000000000e+00 +23 0.00000000000000e+00 +24 0.00000000000000e+00 +25 -6.00000000000000e+00 +26 0.00000000000000e+00 +27 1.00000000000000e+00 +28 -4.00000000000000e+00 +29 0.00000000000000e+00 +30 1.00000000000000e+00 +31 -5.00000000000000e+00 +32 0.00000000000000e+00 +33 1.00000000000000e+00 +34 -6.00000000000000e+00 +35 0.00000000000000e+00 +36 0.00000000000000e+00 +37 -4.50000000000000e+00 +38 0.00000000000000e+00 +39 5.00000000000000e-01 +40 -4.00000000000000e+00 +41 0.00000000000000e+00 +42 5.00000000000000e-01 +43 -4.50000000000000e+00 +44 0.00000000000000e+00 +45 0.00000000000000e+00 +46 -4.00000000000000e+00 +47 0.00000000000000e+00 +48 0.00000000000000e+00 +49 -4.50000000000000e+00 +50 0.00000000000000e+00 +51 5.00000000000000e-01 +52 -4.00000000000000e+00 +53 0.00000000000000e+00 +54 5.00000000000000e-01 +55 -4.50000000000000e+00 +56 0.00000000000000e+00 +57 0.00000000000000e+00 +58 -5.50000000000000e+00 +59 0.00000000000000e+00 +60 5.00000000000000e-01 +61 -5.00000000000000e+00 +62 0.00000000000000e+00 +63 5.00000000000000e-01 +64 -5.50000000000000e+00 +65 0.00000000000000e+00 +66 0.00000000000000e+00 +67 -5.00000000000000e+00 +68 0.00000000000000e+00 +69 0.00000000000000e+00 +70 -5.50000000000000e+00 +71 0.00000000000000e+00 +72 5.00000000000000e-01 +73 -5.00000000000000e+00 +74 0.00000000000000e+00 +75 5.00000000000000e-01 +76 -5.50000000000000e+00 +77 0.00000000000000e+00 +78 5.00000000000000e-01 +79 -6.00000000000000e+00 +80 0.00000000000000e+00 +81 0.00000000000000e+00 +82 -6.00000000000000e+00 +83 0.00000000000000e+00 +84 5.00000000000000e-01 +85 -6.00000000000000e+00 +86 0.00000000000000e+00 +87 1.00000000000000e+00 +88 -4.50000000000000e+00 +89 0.00000000000000e+00 +90 1.00000000000000e+00 +91 -4.00000000000000e+00 +92 0.00000000000000e+00 +93 1.00000000000000e+00 +94 -4.50000000000000e+00 +95 0.00000000000000e+00 +96 1.00000000000000e+00 +97 -5.50000000000000e+00 +98 0.00000000000000e+00 +99 1.00000000000000e+00 +100 -5.00000000000000e+00 +101 0.00000000000000e+00 +102 1.00000000000000e+00 +103 -5.50000000000000e+00 +104 0.00000000000000e+00 +105 1.00000000000000e+00 +106 -6.00000000000000e+00 +107 0.00000000000000e+00 +108 0.00000000000000e+00 +109 -4.50000000000000e+00 +110 0.00000000000000e+00 +111 5.00000000000000e-01 +112 -4.00000000000000e+00 +113 0.00000000000000e+00 +114 5.00000000000000e-01 +115 -4.50000000000000e+00 +116 0.00000000000000e+00 +117 0.00000000000000e+00 +118 -5.50000000000000e+00 +119 0.00000000000000e+00 +120 5.00000000000000e-01 +121 -5.00000000000000e+00 +122 0.00000000000000e+00 +123 5.00000000000000e-01 +124 -5.50000000000000e+00 +125 0.00000000000000e+00 +126 5.00000000000000e-01 +127 -6.00000000000000e+00 +128 0.00000000000000e+00 +129 1.00000000000000e+00 +130 -4.50000000000000e+00 +131 0.00000000000000e+00 +132 1.00000000000000e+00 +133 -5.50000000000000e+00 +134 0.00000000000000e+00 +135 0.00000000000000e+00 +136 -4.25000000000000e+00 +137 0.00000000000000e+00 +138 2.50000000000000e-01 +139 -4.00000000000000e+00 +140 0.00000000000000e+00 +141 2.50000000000000e-01 +142 -4.25000000000000e+00 +143 0.00000000000000e+00 +144 0.00000000000000e+00 +145 -4.00000000000000e+00 +146 0.00000000000000e+00 +147 0.00000000000000e+00 +148 -4.25000000000000e+00 +149 0.00000000000000e+00 +150 2.50000000000000e-01 +151 -4.00000000000000e+00 +152 0.00000000000000e+00 +153 2.50000000000000e-01 +154 -4.25000000000000e+00 +155 0.00000000000000e+00 +156 0.00000000000000e+00 +157 -4.75000000000000e+00 +158 0.00000000000000e+00 +159 0.00000000000000e+00 +160 -5.25000000000000e+00 +161 0.00000000000000e+00 +162 2.50000000000000e-01 +163 -5.00000000000000e+00 +164 0.00000000000000e+00 +165 2.50000000000000e-01 +166 -5.25000000000000e+00 +167 0.00000000000000e+00 +168 0.00000000000000e+00 +169 -5.00000000000000e+00 +170 0.00000000000000e+00 +171 0.00000000000000e+00 +172 -5.25000000000000e+00 +173 0.00000000000000e+00 +174 2.50000000000000e-01 +175 -5.00000000000000e+00 +176 0.00000000000000e+00 +177 2.50000000000000e-01 +178 -5.25000000000000e+00 +179 0.00000000000000e+00 +180 0.00000000000000e+00 +181 -5.75000000000000e+00 +182 0.00000000000000e+00 +183 2.50000000000000e-01 +184 -6.00000000000000e+00 +185 0.00000000000000e+00 +186 0.00000000000000e+00 +187 -6.00000000000000e+00 +188 0.00000000000000e+00 +189 2.50000000000000e-01 +190 -6.00000000000000e+00 +191 0.00000000000000e+00 +192 7.50000000000000e-01 +193 -4.00000000000000e+00 +194 0.00000000000000e+00 +195 1.00000000000000e+00 +196 -4.25000000000000e+00 +197 0.00000000000000e+00 +198 1.00000000000000e+00 +199 -4.00000000000000e+00 +200 0.00000000000000e+00 +201 1.00000000000000e+00 +202 -4.25000000000000e+00 +203 0.00000000000000e+00 +204 7.50000000000000e-01 +205 -4.75000000000000e+00 +206 0.00000000000000e+00 +207 7.50000000000000e-01 +208 -5.00000000000000e+00 +209 0.00000000000000e+00 +210 1.00000000000000e+00 +211 -4.75000000000000e+00 +212 0.00000000000000e+00 +213 1.00000000000000e+00 +214 -5.25000000000000e+00 +215 0.00000000000000e+00 +216 1.00000000000000e+00 +217 -5.00000000000000e+00 +218 0.00000000000000e+00 +219 1.00000000000000e+00 +220 -5.25000000000000e+00 +221 0.00000000000000e+00 +222 7.50000000000000e-01 +223 -5.75000000000000e+00 +224 0.00000000000000e+00 +225 7.50000000000000e-01 +226 -6.00000000000000e+00 +227 0.00000000000000e+00 +228 1.00000000000000e+00 +229 -5.75000000000000e+00 +230 0.00000000000000e+00 +231 1.00000000000000e+00 +232 -6.00000000000000e+00 +233 0.00000000000000e+00 +234 0.00000000000000e+00 +235 -4.00000000000000e+00 +236 0.00000000000000e+00 +237 0.00000000000000e+00 +238 -4.25000000000000e+00 +239 0.00000000000000e+00 +240 2.50000000000000e-01 +241 -4.00000000000000e+00 +242 0.00000000000000e+00 +243 2.50000000000000e-01 +244 -4.25000000000000e+00 +245 0.00000000000000e+00 +246 0.00000000000000e+00 +247 -4.75000000000000e+00 +248 0.00000000000000e+00 +249 0.00000000000000e+00 +250 -5.00000000000000e+00 +251 0.00000000000000e+00 +252 0.00000000000000e+00 +253 -4.75000000000000e+00 +254 0.00000000000000e+00 +255 0.00000000000000e+00 +256 -5.25000000000000e+00 +257 0.00000000000000e+00 +258 2.50000000000000e-01 +259 -5.00000000000000e+00 +260 0.00000000000000e+00 +261 2.50000000000000e-01 +262 -5.25000000000000e+00 +263 0.00000000000000e+00 +264 0.00000000000000e+00 +265 -5.75000000000000e+00 +266 0.00000000000000e+00 +267 0.00000000000000e+00 +268 -6.00000000000000e+00 +269 0.00000000000000e+00 +270 0.00000000000000e+00 +271 -5.75000000000000e+00 +272 0.00000000000000e+00 +273 2.50000000000000e-01 +274 -6.00000000000000e+00 +275 0.00000000000000e+00 +276 7.50000000000000e-01 +277 -4.00000000000000e+00 +278 0.00000000000000e+00 +279 1.00000000000000e+00 +280 -4.00000000000000e+00 +281 0.00000000000000e+00 +282 7.50000000000000e-01 +283 -4.00000000000000e+00 +284 0.00000000000000e+00 +285 1.00000000000000e+00 +286 -4.25000000000000e+00 +287 0.00000000000000e+00 +288 7.50000000000000e-01 +289 -4.75000000000000e+00 +290 0.00000000000000e+00 +291 7.50000000000000e-01 +292 -5.00000000000000e+00 +293 0.00000000000000e+00 +294 1.00000000000000e+00 +295 -4.75000000000000e+00 +296 0.00000000000000e+00 +297 1.00000000000000e+00 +298 -5.00000000000000e+00 +299 0.00000000000000e+00 +300 7.50000000000000e-01 +301 -4.75000000000000e+00 +302 0.00000000000000e+00 +303 7.50000000000000e-01 +304 -5.00000000000000e+00 +305 0.00000000000000e+00 +306 1.00000000000000e+00 +307 -4.75000000000000e+00 +308 0.00000000000000e+00 +309 1.00000000000000e+00 +310 -5.25000000000000e+00 +311 0.00000000000000e+00 +312 7.50000000000000e-01 +313 -5.75000000000000e+00 +314 0.00000000000000e+00 +315 7.50000000000000e-01 +316 -6.00000000000000e+00 +317 0.00000000000000e+00 +318 1.00000000000000e+00 +319 -5.75000000000000e+00 +320 0.00000000000000e+00 +321 1.00000000000000e+00 +322 -6.00000000000000e+00 +323 0.00000000000000e+00 +324 7.50000000000000e-01 +325 -5.75000000000000e+00 +326 0.00000000000000e+00 +327 7.50000000000000e-01 +328 -6.00000000000000e+00 +329 0.00000000000000e+00 +330 1.00000000000000e+00 +331 -5.75000000000000e+00 +332 0.00000000000000e+00 +333 2.50000000000000e-01 +334 -4.50000000000000e+00 +335 0.00000000000000e+00 +336 0.00000000000000e+00 +337 -4.50000000000000e+00 +338 0.00000000000000e+00 +339 2.50000000000000e-01 +340 -4.50000000000000e+00 +341 0.00000000000000e+00 +342 2.50000000000000e-01 +343 -4.75000000000000e+00 +344 0.00000000000000e+00 +345 0.00000000000000e+00 +346 -4.75000000000000e+00 +347 0.00000000000000e+00 +348 2.50000000000000e-01 +349 -4.75000000000000e+00 +350 0.00000000000000e+00 +351 5.00000000000000e-01 +352 -4.25000000000000e+00 +353 0.00000000000000e+00 +354 5.00000000000000e-01 +355 -4.00000000000000e+00 +356 0.00000000000000e+00 +357 5.00000000000000e-01 +358 -4.25000000000000e+00 +359 0.00000000000000e+00 +360 7.50000000000000e-01 +361 -4.25000000000000e+00 +362 0.00000000000000e+00 +363 7.50000000000000e-01 +364 -4.00000000000000e+00 +365 0.00000000000000e+00 +366 7.50000000000000e-01 +367 -4.25000000000000e+00 +368 0.00000000000000e+00 +369 5.00000000000000e-01 +370 -4.50000000000000e+00 +371 0.00000000000000e+00 +372 5.00000000000000e-01 +373 -4.75000000000000e+00 +374 0.00000000000000e+00 +375 5.00000000000000e-01 +376 -4.75000000000000e+00 +377 0.00000000000000e+00 +378 7.50000000000000e-01 +379 -4.50000000000000e+00 +380 0.00000000000000e+00 +381 7.50000000000000e-01 +382 -4.50000000000000e+00 +383 0.00000000000000e+00 +384 7.50000000000000e-01 +385 -4.75000000000000e+00 +386 0.00000000000000e+00 +387 0.00000000000000e+00 +388 -4.25000000000000e+00 +389 0.00000000000000e+00 +390 2.50000000000000e-01 +391 -4.00000000000000e+00 +392 0.00000000000000e+00 +393 2.50000000000000e-01 +394 -4.25000000000000e+00 +395 0.00000000000000e+00 +396 0.00000000000000e+00 +397 -4.25000000000000e+00 +398 0.00000000000000e+00 +399 2.50000000000000e-01 +400 -4.00000000000000e+00 +401 0.00000000000000e+00 +402 2.50000000000000e-01 +403 -4.25000000000000e+00 +404 0.00000000000000e+00 +405 2.50000000000000e-01 +406 -4.50000000000000e+00 +407 0.00000000000000e+00 +408 0.00000000000000e+00 +409 -4.75000000000000e+00 +410 0.00000000000000e+00 +411 2.50000000000000e-01 +412 -4.75000000000000e+00 +413 0.00000000000000e+00 +414 0.00000000000000e+00 +415 -4.50000000000000e+00 +416 0.00000000000000e+00 +417 2.50000000000000e-01 +418 -4.50000000000000e+00 +419 0.00000000000000e+00 +420 2.50000000000000e-01 +421 -4.75000000000000e+00 +422 0.00000000000000e+00 +423 5.00000000000000e-01 +424 -4.25000000000000e+00 +425 0.00000000000000e+00 +426 7.50000000000000e-01 +427 -4.00000000000000e+00 +428 0.00000000000000e+00 +429 7.50000000000000e-01 +430 -4.25000000000000e+00 +431 0.00000000000000e+00 +432 5.00000000000000e-01 +433 -4.00000000000000e+00 +434 0.00000000000000e+00 +435 5.00000000000000e-01 +436 -4.25000000000000e+00 +437 0.00000000000000e+00 +438 7.50000000000000e-01 +439 -4.25000000000000e+00 +440 0.00000000000000e+00 +441 5.00000000000000e-01 +442 -4.75000000000000e+00 +443 0.00000000000000e+00 +444 7.50000000000000e-01 +445 -4.50000000000000e+00 +446 0.00000000000000e+00 +447 7.50000000000000e-01 +448 -4.75000000000000e+00 +449 0.00000000000000e+00 +450 5.00000000000000e-01 +451 -4.50000000000000e+00 +452 0.00000000000000e+00 +453 5.00000000000000e-01 +454 -4.75000000000000e+00 +455 0.00000000000000e+00 +456 7.50000000000000e-01 +457 -4.50000000000000e+00 +458 0.00000000000000e+00 +459 2.50000000000000e-01 +460 -5.50000000000000e+00 +461 0.00000000000000e+00 +462 0.00000000000000e+00 +463 -5.50000000000000e+00 +464 0.00000000000000e+00 +465 2.50000000000000e-01 +466 -5.50000000000000e+00 +467 0.00000000000000e+00 +468 2.50000000000000e-01 +469 -5.75000000000000e+00 +470 0.00000000000000e+00 +471 0.00000000000000e+00 +472 -5.75000000000000e+00 +473 0.00000000000000e+00 +474 2.50000000000000e-01 +475 -5.75000000000000e+00 +476 0.00000000000000e+00 +477 5.00000000000000e-01 +478 -5.25000000000000e+00 +479 0.00000000000000e+00 +480 5.00000000000000e-01 +481 -5.00000000000000e+00 +482 0.00000000000000e+00 +483 5.00000000000000e-01 +484 -5.25000000000000e+00 +485 0.00000000000000e+00 +486 7.50000000000000e-01 +487 -5.25000000000000e+00 +488 0.00000000000000e+00 +489 7.50000000000000e-01 +490 -5.00000000000000e+00 +491 0.00000000000000e+00 +492 7.50000000000000e-01 +493 -5.25000000000000e+00 +494 0.00000000000000e+00 +495 5.00000000000000e-01 +496 -5.50000000000000e+00 +497 0.00000000000000e+00 +498 5.00000000000000e-01 +499 -5.75000000000000e+00 +500 0.00000000000000e+00 +501 5.00000000000000e-01 +502 -5.75000000000000e+00 +503 0.00000000000000e+00 +504 7.50000000000000e-01 +505 -5.50000000000000e+00 +506 0.00000000000000e+00 +507 7.50000000000000e-01 +508 -5.50000000000000e+00 +509 0.00000000000000e+00 +510 7.50000000000000e-01 +511 -5.75000000000000e+00 +512 0.00000000000000e+00 +513 0.00000000000000e+00 +514 -5.25000000000000e+00 +515 0.00000000000000e+00 +516 2.50000000000000e-01 +517 -5.00000000000000e+00 +518 0.00000000000000e+00 +519 2.50000000000000e-01 +520 -5.25000000000000e+00 +521 0.00000000000000e+00 +522 0.00000000000000e+00 +523 -5.25000000000000e+00 +524 0.00000000000000e+00 +525 2.50000000000000e-01 +526 -5.00000000000000e+00 +527 0.00000000000000e+00 +528 2.50000000000000e-01 +529 -5.25000000000000e+00 +530 0.00000000000000e+00 +531 2.50000000000000e-01 +532 -5.50000000000000e+00 +533 0.00000000000000e+00 +534 0.00000000000000e+00 +535 -5.75000000000000e+00 +536 0.00000000000000e+00 +537 2.50000000000000e-01 +538 -5.75000000000000e+00 +539 0.00000000000000e+00 +540 0.00000000000000e+00 +541 -5.50000000000000e+00 +542 0.00000000000000e+00 +543 2.50000000000000e-01 +544 -5.50000000000000e+00 +545 0.00000000000000e+00 +546 2.50000000000000e-01 +547 -5.75000000000000e+00 +548 0.00000000000000e+00 +549 5.00000000000000e-01 +550 -5.25000000000000e+00 +551 0.00000000000000e+00 +552 7.50000000000000e-01 +553 -5.00000000000000e+00 +554 0.00000000000000e+00 +555 7.50000000000000e-01 +556 -5.25000000000000e+00 +557 0.00000000000000e+00 +558 5.00000000000000e-01 +559 -5.00000000000000e+00 +560 0.00000000000000e+00 +561 5.00000000000000e-01 +562 -5.25000000000000e+00 +563 0.00000000000000e+00 +564 7.50000000000000e-01 +565 -5.25000000000000e+00 +566 0.00000000000000e+00 +567 5.00000000000000e-01 +568 -5.75000000000000e+00 +569 0.00000000000000e+00 +570 7.50000000000000e-01 +571 -5.50000000000000e+00 +572 0.00000000000000e+00 +573 7.50000000000000e-01 +574 -5.75000000000000e+00 +575 0.00000000000000e+00 +576 5.00000000000000e-01 +577 -5.50000000000000e+00 +578 0.00000000000000e+00 +579 5.00000000000000e-01 +580 -5.75000000000000e+00 +581 0.00000000000000e+00 +582 7.50000000000000e-01 +583 -5.50000000000000e+00 +584 0.00000000000000e+00 +585 5.00000000000000e-01 +586 -6.00000000000000e+00 +587 0.00000000000000e+00 +588 7.50000000000000e-01 +589 -6.00000000000000e+00 +590 0.00000000000000e+00 +591 2.50000000000000e-01 +592 -6.00000000000000e+00 +593 0.00000000000000e+00 +594 2.50000000000000e-01 +595 -6.00000000000000e+00 +596 0.00000000000000e+00 +597 7.50000000000000e-01 +598 -6.00000000000000e+00 +599 0.00000000000000e+00 +600 5.00000000000000e-01 +601 -6.00000000000000e+00 +602 0.00000000000000e+00 +603 1.00000000000000e+00 +604 -4.50000000000000e+00 +605 0.00000000000000e+00 +606 1.00000000000000e+00 +607 -4.75000000000000e+00 +608 0.00000000000000e+00 +609 1.00000000000000e+00 +610 -4.25000000000000e+00 +611 0.00000000000000e+00 +612 1.00000000000000e+00 +613 -4.25000000000000e+00 +614 0.00000000000000e+00 +615 1.00000000000000e+00 +616 -4.75000000000000e+00 +617 0.00000000000000e+00 +618 1.00000000000000e+00 +619 -4.50000000000000e+00 +620 0.00000000000000e+00 +621 1.00000000000000e+00 +622 -5.50000000000000e+00 +623 0.00000000000000e+00 +624 1.00000000000000e+00 +625 -5.75000000000000e+00 +626 0.00000000000000e+00 +627 1.00000000000000e+00 +628 -5.25000000000000e+00 +629 0.00000000000000e+00 +630 1.00000000000000e+00 +631 -5.25000000000000e+00 +632 0.00000000000000e+00 +633 1.00000000000000e+00 +634 -5.75000000000000e+00 +635 0.00000000000000e+00 +636 1.00000000000000e+00 +637 -5.50000000000000e+00 +638 0.00000000000000e+00 +639 2.50000000000000e-01 +640 -4.50000000000000e+00 +641 0.00000000000000e+00 +642 2.50000000000000e-01 +643 -4.75000000000000e+00 +644 0.00000000000000e+00 +645 5.00000000000000e-01 +646 -4.25000000000000e+00 +647 0.00000000000000e+00 +648 7.50000000000000e-01 +649 -4.25000000000000e+00 +650 0.00000000000000e+00 +651 5.00000000000000e-01 +652 -4.75000000000000e+00 +653 0.00000000000000e+00 +654 7.50000000000000e-01 +655 -4.50000000000000e+00 +656 0.00000000000000e+00 +657 2.50000000000000e-01 +658 -5.50000000000000e+00 +659 0.00000000000000e+00 +660 2.50000000000000e-01 +661 -5.75000000000000e+00 +662 0.00000000000000e+00 +663 5.00000000000000e-01 +664 -5.25000000000000e+00 +665 0.00000000000000e+00 +666 7.50000000000000e-01 +667 -5.25000000000000e+00 +668 0.00000000000000e+00 +669 5.00000000000000e-01 +670 -5.75000000000000e+00 +671 0.00000000000000e+00 +672 7.50000000000000e-01 +673 -5.50000000000000e+00 +674 0.00000000000000e+00 diff --git a/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.0.00001 b/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.0.00001 new file mode 100644 index 00000000..cf919916 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.0.00001 @@ -0,0 +1,601 @@ +675 1275 +675 0.00000000000000e+00 +676 -7.00000000000000e+00 +677 0.00000000000000e+00 +678 0.00000000000000e+00 +679 -8.00000000000000e+00 +680 0.00000000000000e+00 +681 1.00000000000000e+00 +682 -7.00000000000000e+00 +683 0.00000000000000e+00 +684 1.00000000000000e+00 +685 -8.00000000000000e+00 +686 0.00000000000000e+00 +687 0.00000000000000e+00 +688 -7.00000000000000e+00 +689 0.00000000000000e+00 +690 0.00000000000000e+00 +691 -8.00000000000000e+00 +692 0.00000000000000e+00 +693 1.00000000000000e+00 +694 -7.00000000000000e+00 +695 0.00000000000000e+00 +696 1.00000000000000e+00 +697 -8.00000000000000e+00 +698 0.00000000000000e+00 +699 0.00000000000000e+00 +700 -6.50000000000000e+00 +701 0.00000000000000e+00 +702 5.00000000000000e-01 +703 -6.50000000000000e+00 +704 0.00000000000000e+00 +705 0.00000000000000e+00 +706 -6.50000000000000e+00 +707 0.00000000000000e+00 +708 5.00000000000000e-01 +709 -6.50000000000000e+00 +710 0.00000000000000e+00 +711 0.00000000000000e+00 +712 -7.50000000000000e+00 +713 0.00000000000000e+00 +714 5.00000000000000e-01 +715 -7.00000000000000e+00 +716 0.00000000000000e+00 +717 5.00000000000000e-01 +718 -7.50000000000000e+00 +719 0.00000000000000e+00 +720 0.00000000000000e+00 +721 -7.00000000000000e+00 +722 0.00000000000000e+00 +723 0.00000000000000e+00 +724 -7.50000000000000e+00 +725 0.00000000000000e+00 +726 5.00000000000000e-01 +727 -7.00000000000000e+00 +728 0.00000000000000e+00 +729 5.00000000000000e-01 +730 -7.50000000000000e+00 +731 0.00000000000000e+00 +732 5.00000000000000e-01 +733 -8.00000000000000e+00 +734 0.00000000000000e+00 +735 0.00000000000000e+00 +736 -8.00000000000000e+00 +737 0.00000000000000e+00 +738 5.00000000000000e-01 +739 -8.00000000000000e+00 +740 0.00000000000000e+00 +741 1.00000000000000e+00 +742 -6.50000000000000e+00 +743 0.00000000000000e+00 +744 1.00000000000000e+00 +745 -6.50000000000000e+00 +746 0.00000000000000e+00 +747 1.00000000000000e+00 +748 -7.50000000000000e+00 +749 0.00000000000000e+00 +750 1.00000000000000e+00 +751 -7.00000000000000e+00 +752 0.00000000000000e+00 +753 1.00000000000000e+00 +754 -7.50000000000000e+00 +755 0.00000000000000e+00 +756 1.00000000000000e+00 +757 -8.00000000000000e+00 +758 0.00000000000000e+00 +759 0.00000000000000e+00 +760 -6.50000000000000e+00 +761 0.00000000000000e+00 +762 5.00000000000000e-01 +763 -6.50000000000000e+00 +764 0.00000000000000e+00 +765 0.00000000000000e+00 +766 -7.50000000000000e+00 +767 0.00000000000000e+00 +768 5.00000000000000e-01 +769 -7.00000000000000e+00 +770 0.00000000000000e+00 +771 5.00000000000000e-01 +772 -7.50000000000000e+00 +773 0.00000000000000e+00 +774 5.00000000000000e-01 +775 -8.00000000000000e+00 +776 0.00000000000000e+00 +777 1.00000000000000e+00 +778 -6.50000000000000e+00 +779 0.00000000000000e+00 +780 1.00000000000000e+00 +781 -7.50000000000000e+00 +782 0.00000000000000e+00 +783 0.00000000000000e+00 +784 -6.25000000000000e+00 +785 0.00000000000000e+00 +786 2.50000000000000e-01 +787 -6.25000000000000e+00 +788 0.00000000000000e+00 +789 0.00000000000000e+00 +790 -6.25000000000000e+00 +791 0.00000000000000e+00 +792 2.50000000000000e-01 +793 -6.25000000000000e+00 +794 0.00000000000000e+00 +795 0.00000000000000e+00 +796 -6.75000000000000e+00 +797 0.00000000000000e+00 +798 0.00000000000000e+00 +799 -7.25000000000000e+00 +800 0.00000000000000e+00 +801 2.50000000000000e-01 +802 -7.00000000000000e+00 +803 0.00000000000000e+00 +804 2.50000000000000e-01 +805 -7.25000000000000e+00 +806 0.00000000000000e+00 +807 0.00000000000000e+00 +808 -7.00000000000000e+00 +809 0.00000000000000e+00 +810 0.00000000000000e+00 +811 -7.25000000000000e+00 +812 0.00000000000000e+00 +813 2.50000000000000e-01 +814 -7.00000000000000e+00 +815 0.00000000000000e+00 +816 2.50000000000000e-01 +817 -7.25000000000000e+00 +818 0.00000000000000e+00 +819 0.00000000000000e+00 +820 -7.75000000000000e+00 +821 0.00000000000000e+00 +822 2.50000000000000e-01 +823 -8.00000000000000e+00 +824 0.00000000000000e+00 +825 0.00000000000000e+00 +826 -8.00000000000000e+00 +827 0.00000000000000e+00 +828 2.50000000000000e-01 +829 -8.00000000000000e+00 +830 0.00000000000000e+00 +831 1.00000000000000e+00 +832 -6.25000000000000e+00 +833 0.00000000000000e+00 +834 1.00000000000000e+00 +835 -6.25000000000000e+00 +836 0.00000000000000e+00 +837 7.50000000000000e-01 +838 -6.75000000000000e+00 +839 0.00000000000000e+00 +840 7.50000000000000e-01 +841 -7.00000000000000e+00 +842 0.00000000000000e+00 +843 1.00000000000000e+00 +844 -6.75000000000000e+00 +845 0.00000000000000e+00 +846 1.00000000000000e+00 +847 -7.25000000000000e+00 +848 0.00000000000000e+00 +849 1.00000000000000e+00 +850 -7.00000000000000e+00 +851 0.00000000000000e+00 +852 1.00000000000000e+00 +853 -7.25000000000000e+00 +854 0.00000000000000e+00 +855 7.50000000000000e-01 +856 -7.75000000000000e+00 +857 0.00000000000000e+00 +858 7.50000000000000e-01 +859 -8.00000000000000e+00 +860 0.00000000000000e+00 +861 1.00000000000000e+00 +862 -7.75000000000000e+00 +863 0.00000000000000e+00 +864 1.00000000000000e+00 +865 -8.00000000000000e+00 +866 0.00000000000000e+00 +867 0.00000000000000e+00 +868 -6.25000000000000e+00 +869 0.00000000000000e+00 +870 2.50000000000000e-01 +871 -6.25000000000000e+00 +872 0.00000000000000e+00 +873 0.00000000000000e+00 +874 -6.75000000000000e+00 +875 0.00000000000000e+00 +876 0.00000000000000e+00 +877 -7.00000000000000e+00 +878 0.00000000000000e+00 +879 0.00000000000000e+00 +880 -6.75000000000000e+00 +881 0.00000000000000e+00 +882 0.00000000000000e+00 +883 -7.25000000000000e+00 +884 0.00000000000000e+00 +885 2.50000000000000e-01 +886 -7.00000000000000e+00 +887 0.00000000000000e+00 +888 2.50000000000000e-01 +889 -7.25000000000000e+00 +890 0.00000000000000e+00 +891 0.00000000000000e+00 +892 -7.75000000000000e+00 +893 0.00000000000000e+00 +894 0.00000000000000e+00 +895 -8.00000000000000e+00 +896 0.00000000000000e+00 +897 0.00000000000000e+00 +898 -7.75000000000000e+00 +899 0.00000000000000e+00 +900 2.50000000000000e-01 +901 -8.00000000000000e+00 +902 0.00000000000000e+00 +903 1.00000000000000e+00 +904 -6.25000000000000e+00 +905 0.00000000000000e+00 +906 7.50000000000000e-01 +907 -6.75000000000000e+00 +908 0.00000000000000e+00 +909 7.50000000000000e-01 +910 -7.00000000000000e+00 +911 0.00000000000000e+00 +912 1.00000000000000e+00 +913 -6.75000000000000e+00 +914 0.00000000000000e+00 +915 1.00000000000000e+00 +916 -7.00000000000000e+00 +917 0.00000000000000e+00 +918 7.50000000000000e-01 +919 -6.75000000000000e+00 +920 0.00000000000000e+00 +921 7.50000000000000e-01 +922 -7.00000000000000e+00 +923 0.00000000000000e+00 +924 1.00000000000000e+00 +925 -6.75000000000000e+00 +926 0.00000000000000e+00 +927 1.00000000000000e+00 +928 -7.25000000000000e+00 +929 0.00000000000000e+00 +930 7.50000000000000e-01 +931 -7.75000000000000e+00 +932 0.00000000000000e+00 +933 7.50000000000000e-01 +934 -8.00000000000000e+00 +935 0.00000000000000e+00 +936 1.00000000000000e+00 +937 -7.75000000000000e+00 +938 0.00000000000000e+00 +939 1.00000000000000e+00 +940 -8.00000000000000e+00 +941 0.00000000000000e+00 +942 7.50000000000000e-01 +943 -7.75000000000000e+00 +944 0.00000000000000e+00 +945 7.50000000000000e-01 +946 -8.00000000000000e+00 +947 0.00000000000000e+00 +948 1.00000000000000e+00 +949 -7.75000000000000e+00 +950 0.00000000000000e+00 +951 2.50000000000000e-01 +952 -6.50000000000000e+00 +953 0.00000000000000e+00 +954 0.00000000000000e+00 +955 -6.50000000000000e+00 +956 0.00000000000000e+00 +957 2.50000000000000e-01 +958 -6.50000000000000e+00 +959 0.00000000000000e+00 +960 2.50000000000000e-01 +961 -6.75000000000000e+00 +962 0.00000000000000e+00 +963 0.00000000000000e+00 +964 -6.75000000000000e+00 +965 0.00000000000000e+00 +966 2.50000000000000e-01 +967 -6.75000000000000e+00 +968 0.00000000000000e+00 +969 5.00000000000000e-01 +970 -6.25000000000000e+00 +971 0.00000000000000e+00 +972 5.00000000000000e-01 +973 -6.25000000000000e+00 +974 0.00000000000000e+00 +975 7.50000000000000e-01 +976 -6.25000000000000e+00 +977 0.00000000000000e+00 +978 7.50000000000000e-01 +979 -6.25000000000000e+00 +980 0.00000000000000e+00 +981 5.00000000000000e-01 +982 -6.50000000000000e+00 +983 0.00000000000000e+00 +984 5.00000000000000e-01 +985 -6.75000000000000e+00 +986 0.00000000000000e+00 +987 5.00000000000000e-01 +988 -6.75000000000000e+00 +989 0.00000000000000e+00 +990 7.50000000000000e-01 +991 -6.50000000000000e+00 +992 0.00000000000000e+00 +993 7.50000000000000e-01 +994 -6.50000000000000e+00 +995 0.00000000000000e+00 +996 7.50000000000000e-01 +997 -6.75000000000000e+00 +998 0.00000000000000e+00 +999 0.00000000000000e+00 +1000 -6.25000000000000e+00 +1001 0.00000000000000e+00 +1002 2.50000000000000e-01 +1003 -6.25000000000000e+00 +1004 0.00000000000000e+00 +1005 0.00000000000000e+00 +1006 -6.25000000000000e+00 +1007 0.00000000000000e+00 +1008 2.50000000000000e-01 +1009 -6.25000000000000e+00 +1010 0.00000000000000e+00 +1011 2.50000000000000e-01 +1012 -6.50000000000000e+00 +1013 0.00000000000000e+00 +1014 0.00000000000000e+00 +1015 -6.75000000000000e+00 +1016 0.00000000000000e+00 +1017 2.50000000000000e-01 +1018 -6.75000000000000e+00 +1019 0.00000000000000e+00 +1020 0.00000000000000e+00 +1021 -6.50000000000000e+00 +1022 0.00000000000000e+00 +1023 2.50000000000000e-01 +1024 -6.50000000000000e+00 +1025 0.00000000000000e+00 +1026 2.50000000000000e-01 +1027 -6.75000000000000e+00 +1028 0.00000000000000e+00 +1029 5.00000000000000e-01 +1030 -6.25000000000000e+00 +1031 0.00000000000000e+00 +1032 7.50000000000000e-01 +1033 -6.25000000000000e+00 +1034 0.00000000000000e+00 +1035 5.00000000000000e-01 +1036 -6.25000000000000e+00 +1037 0.00000000000000e+00 +1038 7.50000000000000e-01 +1039 -6.25000000000000e+00 +1040 0.00000000000000e+00 +1041 5.00000000000000e-01 +1042 -6.75000000000000e+00 +1043 0.00000000000000e+00 +1044 7.50000000000000e-01 +1045 -6.50000000000000e+00 +1046 0.00000000000000e+00 +1047 7.50000000000000e-01 +1048 -6.75000000000000e+00 +1049 0.00000000000000e+00 +1050 5.00000000000000e-01 +1051 -6.50000000000000e+00 +1052 0.00000000000000e+00 +1053 5.00000000000000e-01 +1054 -6.75000000000000e+00 +1055 0.00000000000000e+00 +1056 7.50000000000000e-01 +1057 -6.50000000000000e+00 +1058 0.00000000000000e+00 +1059 2.50000000000000e-01 +1060 -7.50000000000000e+00 +1061 0.00000000000000e+00 +1062 0.00000000000000e+00 +1063 -7.50000000000000e+00 +1064 0.00000000000000e+00 +1065 2.50000000000000e-01 +1066 -7.50000000000000e+00 +1067 0.00000000000000e+00 +1068 2.50000000000000e-01 +1069 -7.75000000000000e+00 +1070 0.00000000000000e+00 +1071 0.00000000000000e+00 +1072 -7.75000000000000e+00 +1073 0.00000000000000e+00 +1074 2.50000000000000e-01 +1075 -7.75000000000000e+00 +1076 0.00000000000000e+00 +1077 5.00000000000000e-01 +1078 -7.25000000000000e+00 +1079 0.00000000000000e+00 +1080 5.00000000000000e-01 +1081 -7.00000000000000e+00 +1082 0.00000000000000e+00 +1083 5.00000000000000e-01 +1084 -7.25000000000000e+00 +1085 0.00000000000000e+00 +1086 7.50000000000000e-01 +1087 -7.25000000000000e+00 +1088 0.00000000000000e+00 +1089 7.50000000000000e-01 +1090 -7.00000000000000e+00 +1091 0.00000000000000e+00 +1092 7.50000000000000e-01 +1093 -7.25000000000000e+00 +1094 0.00000000000000e+00 +1095 5.00000000000000e-01 +1096 -7.50000000000000e+00 +1097 0.00000000000000e+00 +1098 5.00000000000000e-01 +1099 -7.75000000000000e+00 +1100 0.00000000000000e+00 +1101 5.00000000000000e-01 +1102 -7.75000000000000e+00 +1103 0.00000000000000e+00 +1104 7.50000000000000e-01 +1105 -7.50000000000000e+00 +1106 0.00000000000000e+00 +1107 7.50000000000000e-01 +1108 -7.50000000000000e+00 +1109 0.00000000000000e+00 +1110 7.50000000000000e-01 +1111 -7.75000000000000e+00 +1112 0.00000000000000e+00 +1113 0.00000000000000e+00 +1114 -7.25000000000000e+00 +1115 0.00000000000000e+00 +1116 2.50000000000000e-01 +1117 -7.00000000000000e+00 +1118 0.00000000000000e+00 +1119 2.50000000000000e-01 +1120 -7.25000000000000e+00 +1121 0.00000000000000e+00 +1122 0.00000000000000e+00 +1123 -7.25000000000000e+00 +1124 0.00000000000000e+00 +1125 2.50000000000000e-01 +1126 -7.00000000000000e+00 +1127 0.00000000000000e+00 +1128 2.50000000000000e-01 +1129 -7.25000000000000e+00 +1130 0.00000000000000e+00 +1131 2.50000000000000e-01 +1132 -7.50000000000000e+00 +1133 0.00000000000000e+00 +1134 0.00000000000000e+00 +1135 -7.75000000000000e+00 +1136 0.00000000000000e+00 +1137 2.50000000000000e-01 +1138 -7.75000000000000e+00 +1139 0.00000000000000e+00 +1140 0.00000000000000e+00 +1141 -7.50000000000000e+00 +1142 0.00000000000000e+00 +1143 2.50000000000000e-01 +1144 -7.50000000000000e+00 +1145 0.00000000000000e+00 +1146 2.50000000000000e-01 +1147 -7.75000000000000e+00 +1148 0.00000000000000e+00 +1149 5.00000000000000e-01 +1150 -7.25000000000000e+00 +1151 0.00000000000000e+00 +1152 7.50000000000000e-01 +1153 -7.00000000000000e+00 +1154 0.00000000000000e+00 +1155 7.50000000000000e-01 +1156 -7.25000000000000e+00 +1157 0.00000000000000e+00 +1158 5.00000000000000e-01 +1159 -7.00000000000000e+00 +1160 0.00000000000000e+00 +1161 5.00000000000000e-01 +1162 -7.25000000000000e+00 +1163 0.00000000000000e+00 +1164 7.50000000000000e-01 +1165 -7.25000000000000e+00 +1166 0.00000000000000e+00 +1167 5.00000000000000e-01 +1168 -7.75000000000000e+00 +1169 0.00000000000000e+00 +1170 7.50000000000000e-01 +1171 -7.50000000000000e+00 +1172 0.00000000000000e+00 +1173 7.50000000000000e-01 +1174 -7.75000000000000e+00 +1175 0.00000000000000e+00 +1176 5.00000000000000e-01 +1177 -7.50000000000000e+00 +1178 0.00000000000000e+00 +1179 5.00000000000000e-01 +1180 -7.75000000000000e+00 +1181 0.00000000000000e+00 +1182 7.50000000000000e-01 +1183 -7.50000000000000e+00 +1184 0.00000000000000e+00 +1185 5.00000000000000e-01 +1186 -8.00000000000000e+00 +1187 0.00000000000000e+00 +1188 7.50000000000000e-01 +1189 -8.00000000000000e+00 +1190 0.00000000000000e+00 +1191 2.50000000000000e-01 +1192 -8.00000000000000e+00 +1193 0.00000000000000e+00 +1194 2.50000000000000e-01 +1195 -8.00000000000000e+00 +1196 0.00000000000000e+00 +1197 7.50000000000000e-01 +1198 -8.00000000000000e+00 +1199 0.00000000000000e+00 +1200 5.00000000000000e-01 +1201 -8.00000000000000e+00 +1202 0.00000000000000e+00 +1203 1.00000000000000e+00 +1204 -6.50000000000000e+00 +1205 0.00000000000000e+00 +1206 1.00000000000000e+00 +1207 -6.75000000000000e+00 +1208 0.00000000000000e+00 +1209 1.00000000000000e+00 +1210 -6.25000000000000e+00 +1211 0.00000000000000e+00 +1212 1.00000000000000e+00 +1213 -6.25000000000000e+00 +1214 0.00000000000000e+00 +1215 1.00000000000000e+00 +1216 -6.75000000000000e+00 +1217 0.00000000000000e+00 +1218 1.00000000000000e+00 +1219 -6.50000000000000e+00 +1220 0.00000000000000e+00 +1221 1.00000000000000e+00 +1222 -7.50000000000000e+00 +1223 0.00000000000000e+00 +1224 1.00000000000000e+00 +1225 -7.75000000000000e+00 +1226 0.00000000000000e+00 +1227 1.00000000000000e+00 +1228 -7.25000000000000e+00 +1229 0.00000000000000e+00 +1230 1.00000000000000e+00 +1231 -7.25000000000000e+00 +1232 0.00000000000000e+00 +1233 1.00000000000000e+00 +1234 -7.75000000000000e+00 +1235 0.00000000000000e+00 +1236 1.00000000000000e+00 +1237 -7.50000000000000e+00 +1238 0.00000000000000e+00 +1239 2.50000000000000e-01 +1240 -6.50000000000000e+00 +1241 0.00000000000000e+00 +1242 2.50000000000000e-01 +1243 -6.75000000000000e+00 +1244 0.00000000000000e+00 +1245 5.00000000000000e-01 +1246 -6.25000000000000e+00 +1247 0.00000000000000e+00 +1248 7.50000000000000e-01 +1249 -6.25000000000000e+00 +1250 0.00000000000000e+00 +1251 5.00000000000000e-01 +1252 -6.75000000000000e+00 +1253 0.00000000000000e+00 +1254 7.50000000000000e-01 +1255 -6.50000000000000e+00 +1256 0.00000000000000e+00 +1257 2.50000000000000e-01 +1258 -7.50000000000000e+00 +1259 0.00000000000000e+00 +1260 2.50000000000000e-01 +1261 -7.75000000000000e+00 +1262 0.00000000000000e+00 +1263 5.00000000000000e-01 +1264 -7.25000000000000e+00 +1265 0.00000000000000e+00 +1266 7.50000000000000e-01 +1267 -7.25000000000000e+00 +1268 0.00000000000000e+00 +1269 5.00000000000000e-01 +1270 -7.75000000000000e+00 +1271 0.00000000000000e+00 +1272 7.50000000000000e-01 +1273 -7.50000000000000e+00 +1274 0.00000000000000e+00 diff --git a/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.0.00002 b/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.0.00002 new file mode 100644 index 00000000..03e6a0a5 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.0.00002 @@ -0,0 +1,601 @@ +1275 1875 +1275 0.00000000000000e+00 +1276 -2.00000000000000e+00 +1277 0.00000000000000e+00 +1278 0.00000000000000e+00 +1279 -3.00000000000000e+00 +1280 0.00000000000000e+00 +1281 1.00000000000000e+00 +1282 -2.00000000000000e+00 +1283 0.00000000000000e+00 +1284 1.00000000000000e+00 +1285 -3.00000000000000e+00 +1286 0.00000000000000e+00 +1287 0.00000000000000e+00 +1288 -2.00000000000000e+00 +1289 0.00000000000000e+00 +1290 0.00000000000000e+00 +1291 -3.00000000000000e+00 +1292 0.00000000000000e+00 +1293 1.00000000000000e+00 +1294 -2.00000000000000e+00 +1295 0.00000000000000e+00 +1296 1.00000000000000e+00 +1297 -3.00000000000000e+00 +1298 0.00000000000000e+00 +1299 0.00000000000000e+00 +1300 -2.50000000000000e+00 +1301 0.00000000000000e+00 +1302 5.00000000000000e-01 +1303 -2.00000000000000e+00 +1304 0.00000000000000e+00 +1305 5.00000000000000e-01 +1306 -2.50000000000000e+00 +1307 0.00000000000000e+00 +1308 0.00000000000000e+00 +1309 -2.00000000000000e+00 +1310 0.00000000000000e+00 +1311 0.00000000000000e+00 +1312 -2.50000000000000e+00 +1313 0.00000000000000e+00 +1314 5.00000000000000e-01 +1315 -2.00000000000000e+00 +1316 0.00000000000000e+00 +1317 5.00000000000000e-01 +1318 -2.50000000000000e+00 +1319 0.00000000000000e+00 +1320 0.00000000000000e+00 +1321 -3.50000000000000e+00 +1322 0.00000000000000e+00 +1323 5.00000000000000e-01 +1324 -3.00000000000000e+00 +1325 0.00000000000000e+00 +1326 5.00000000000000e-01 +1327 -3.50000000000000e+00 +1328 0.00000000000000e+00 +1329 0.00000000000000e+00 +1330 -3.00000000000000e+00 +1331 0.00000000000000e+00 +1332 0.00000000000000e+00 +1333 -3.50000000000000e+00 +1334 0.00000000000000e+00 +1335 5.00000000000000e-01 +1336 -3.00000000000000e+00 +1337 0.00000000000000e+00 +1338 5.00000000000000e-01 +1339 -3.50000000000000e+00 +1340 0.00000000000000e+00 +1341 1.00000000000000e+00 +1342 -2.50000000000000e+00 +1343 0.00000000000000e+00 +1344 1.00000000000000e+00 +1345 -2.00000000000000e+00 +1346 0.00000000000000e+00 +1347 1.00000000000000e+00 +1348 -2.50000000000000e+00 +1349 0.00000000000000e+00 +1350 1.00000000000000e+00 +1351 -3.50000000000000e+00 +1352 0.00000000000000e+00 +1353 1.00000000000000e+00 +1354 -3.00000000000000e+00 +1355 0.00000000000000e+00 +1356 1.00000000000000e+00 +1357 -3.50000000000000e+00 +1358 0.00000000000000e+00 +1359 0.00000000000000e+00 +1360 -2.50000000000000e+00 +1361 0.00000000000000e+00 +1362 5.00000000000000e-01 +1363 -2.00000000000000e+00 +1364 0.00000000000000e+00 +1365 5.00000000000000e-01 +1366 -2.50000000000000e+00 +1367 0.00000000000000e+00 +1368 0.00000000000000e+00 +1369 -3.50000000000000e+00 +1370 0.00000000000000e+00 +1371 5.00000000000000e-01 +1372 -3.00000000000000e+00 +1373 0.00000000000000e+00 +1374 5.00000000000000e-01 +1375 -3.50000000000000e+00 +1376 0.00000000000000e+00 +1377 1.00000000000000e+00 +1378 -2.50000000000000e+00 +1379 0.00000000000000e+00 +1380 1.00000000000000e+00 +1381 -3.50000000000000e+00 +1382 0.00000000000000e+00 +1383 0.00000000000000e+00 +1384 -2.25000000000000e+00 +1385 0.00000000000000e+00 +1386 2.50000000000000e-01 +1387 -2.00000000000000e+00 +1388 0.00000000000000e+00 +1389 2.50000000000000e-01 +1390 -2.25000000000000e+00 +1391 0.00000000000000e+00 +1392 0.00000000000000e+00 +1393 -2.00000000000000e+00 +1394 0.00000000000000e+00 +1395 0.00000000000000e+00 +1396 -2.25000000000000e+00 +1397 0.00000000000000e+00 +1398 2.50000000000000e-01 +1399 -2.00000000000000e+00 +1400 0.00000000000000e+00 +1401 2.50000000000000e-01 +1402 -2.25000000000000e+00 +1403 0.00000000000000e+00 +1404 0.00000000000000e+00 +1405 -2.75000000000000e+00 +1406 0.00000000000000e+00 +1407 0.00000000000000e+00 +1408 -3.25000000000000e+00 +1409 0.00000000000000e+00 +1410 2.50000000000000e-01 +1411 -3.00000000000000e+00 +1412 0.00000000000000e+00 +1413 2.50000000000000e-01 +1414 -3.25000000000000e+00 +1415 0.00000000000000e+00 +1416 0.00000000000000e+00 +1417 -3.00000000000000e+00 +1418 0.00000000000000e+00 +1419 0.00000000000000e+00 +1420 -3.25000000000000e+00 +1421 0.00000000000000e+00 +1422 2.50000000000000e-01 +1423 -3.00000000000000e+00 +1424 0.00000000000000e+00 +1425 2.50000000000000e-01 +1426 -3.25000000000000e+00 +1427 0.00000000000000e+00 +1428 0.00000000000000e+00 +1429 -3.75000000000000e+00 +1430 0.00000000000000e+00 +1431 7.50000000000000e-01 +1432 -2.00000000000000e+00 +1433 0.00000000000000e+00 +1434 1.00000000000000e+00 +1435 -2.25000000000000e+00 +1436 0.00000000000000e+00 +1437 1.00000000000000e+00 +1438 -2.00000000000000e+00 +1439 0.00000000000000e+00 +1440 1.00000000000000e+00 +1441 -2.25000000000000e+00 +1442 0.00000000000000e+00 +1443 7.50000000000000e-01 +1444 -2.75000000000000e+00 +1445 0.00000000000000e+00 +1446 7.50000000000000e-01 +1447 -3.00000000000000e+00 +1448 0.00000000000000e+00 +1449 1.00000000000000e+00 +1450 -2.75000000000000e+00 +1451 0.00000000000000e+00 +1452 1.00000000000000e+00 +1453 -3.25000000000000e+00 +1454 0.00000000000000e+00 +1455 1.00000000000000e+00 +1456 -3.00000000000000e+00 +1457 0.00000000000000e+00 +1458 1.00000000000000e+00 +1459 -3.25000000000000e+00 +1460 0.00000000000000e+00 +1461 7.50000000000000e-01 +1462 -3.75000000000000e+00 +1463 0.00000000000000e+00 +1464 1.00000000000000e+00 +1465 -3.75000000000000e+00 +1466 0.00000000000000e+00 +1467 0.00000000000000e+00 +1468 -2.00000000000000e+00 +1469 0.00000000000000e+00 +1470 0.00000000000000e+00 +1471 -2.25000000000000e+00 +1472 0.00000000000000e+00 +1473 2.50000000000000e-01 +1474 -2.00000000000000e+00 +1475 0.00000000000000e+00 +1476 2.50000000000000e-01 +1477 -2.25000000000000e+00 +1478 0.00000000000000e+00 +1479 0.00000000000000e+00 +1480 -2.75000000000000e+00 +1481 0.00000000000000e+00 +1482 0.00000000000000e+00 +1483 -3.00000000000000e+00 +1484 0.00000000000000e+00 +1485 0.00000000000000e+00 +1486 -2.75000000000000e+00 +1487 0.00000000000000e+00 +1488 0.00000000000000e+00 +1489 -3.25000000000000e+00 +1490 0.00000000000000e+00 +1491 2.50000000000000e-01 +1492 -3.00000000000000e+00 +1493 0.00000000000000e+00 +1494 2.50000000000000e-01 +1495 -3.25000000000000e+00 +1496 0.00000000000000e+00 +1497 0.00000000000000e+00 +1498 -3.75000000000000e+00 +1499 0.00000000000000e+00 +1500 0.00000000000000e+00 +1501 -3.75000000000000e+00 +1502 0.00000000000000e+00 +1503 7.50000000000000e-01 +1504 -2.00000000000000e+00 +1505 0.00000000000000e+00 +1506 1.00000000000000e+00 +1507 -2.00000000000000e+00 +1508 0.00000000000000e+00 +1509 7.50000000000000e-01 +1510 -2.00000000000000e+00 +1511 0.00000000000000e+00 +1512 1.00000000000000e+00 +1513 -2.25000000000000e+00 +1514 0.00000000000000e+00 +1515 7.50000000000000e-01 +1516 -2.75000000000000e+00 +1517 0.00000000000000e+00 +1518 7.50000000000000e-01 +1519 -3.00000000000000e+00 +1520 0.00000000000000e+00 +1521 1.00000000000000e+00 +1522 -2.75000000000000e+00 +1523 0.00000000000000e+00 +1524 1.00000000000000e+00 +1525 -3.00000000000000e+00 +1526 0.00000000000000e+00 +1527 7.50000000000000e-01 +1528 -2.75000000000000e+00 +1529 0.00000000000000e+00 +1530 7.50000000000000e-01 +1531 -3.00000000000000e+00 +1532 0.00000000000000e+00 +1533 1.00000000000000e+00 +1534 -2.75000000000000e+00 +1535 0.00000000000000e+00 +1536 1.00000000000000e+00 +1537 -3.25000000000000e+00 +1538 0.00000000000000e+00 +1539 7.50000000000000e-01 +1540 -3.75000000000000e+00 +1541 0.00000000000000e+00 +1542 1.00000000000000e+00 +1543 -3.75000000000000e+00 +1544 0.00000000000000e+00 +1545 7.50000000000000e-01 +1546 -3.75000000000000e+00 +1547 0.00000000000000e+00 +1548 1.00000000000000e+00 +1549 -3.75000000000000e+00 +1550 0.00000000000000e+00 +1551 2.50000000000000e-01 +1552 -2.50000000000000e+00 +1553 0.00000000000000e+00 +1554 0.00000000000000e+00 +1555 -2.50000000000000e+00 +1556 0.00000000000000e+00 +1557 2.50000000000000e-01 +1558 -2.50000000000000e+00 +1559 0.00000000000000e+00 +1560 2.50000000000000e-01 +1561 -2.75000000000000e+00 +1562 0.00000000000000e+00 +1563 0.00000000000000e+00 +1564 -2.75000000000000e+00 +1565 0.00000000000000e+00 +1566 2.50000000000000e-01 +1567 -2.75000000000000e+00 +1568 0.00000000000000e+00 +1569 5.00000000000000e-01 +1570 -2.25000000000000e+00 +1571 0.00000000000000e+00 +1572 5.00000000000000e-01 +1573 -2.00000000000000e+00 +1574 0.00000000000000e+00 +1575 5.00000000000000e-01 +1576 -2.25000000000000e+00 +1577 0.00000000000000e+00 +1578 7.50000000000000e-01 +1579 -2.25000000000000e+00 +1580 0.00000000000000e+00 +1581 7.50000000000000e-01 +1582 -2.00000000000000e+00 +1583 0.00000000000000e+00 +1584 7.50000000000000e-01 +1585 -2.25000000000000e+00 +1586 0.00000000000000e+00 +1587 5.00000000000000e-01 +1588 -2.50000000000000e+00 +1589 0.00000000000000e+00 +1590 5.00000000000000e-01 +1591 -2.75000000000000e+00 +1592 0.00000000000000e+00 +1593 5.00000000000000e-01 +1594 -2.75000000000000e+00 +1595 0.00000000000000e+00 +1596 7.50000000000000e-01 +1597 -2.50000000000000e+00 +1598 0.00000000000000e+00 +1599 7.50000000000000e-01 +1600 -2.50000000000000e+00 +1601 0.00000000000000e+00 +1602 7.50000000000000e-01 +1603 -2.75000000000000e+00 +1604 0.00000000000000e+00 +1605 0.00000000000000e+00 +1606 -2.25000000000000e+00 +1607 0.00000000000000e+00 +1608 2.50000000000000e-01 +1609 -2.00000000000000e+00 +1610 0.00000000000000e+00 +1611 2.50000000000000e-01 +1612 -2.25000000000000e+00 +1613 0.00000000000000e+00 +1614 0.00000000000000e+00 +1615 -2.25000000000000e+00 +1616 0.00000000000000e+00 +1617 2.50000000000000e-01 +1618 -2.00000000000000e+00 +1619 0.00000000000000e+00 +1620 2.50000000000000e-01 +1621 -2.25000000000000e+00 +1622 0.00000000000000e+00 +1623 2.50000000000000e-01 +1624 -2.50000000000000e+00 +1625 0.00000000000000e+00 +1626 0.00000000000000e+00 +1627 -2.75000000000000e+00 +1628 0.00000000000000e+00 +1629 2.50000000000000e-01 +1630 -2.75000000000000e+00 +1631 0.00000000000000e+00 +1632 0.00000000000000e+00 +1633 -2.50000000000000e+00 +1634 0.00000000000000e+00 +1635 2.50000000000000e-01 +1636 -2.50000000000000e+00 +1637 0.00000000000000e+00 +1638 2.50000000000000e-01 +1639 -2.75000000000000e+00 +1640 0.00000000000000e+00 +1641 5.00000000000000e-01 +1642 -2.25000000000000e+00 +1643 0.00000000000000e+00 +1644 7.50000000000000e-01 +1645 -2.00000000000000e+00 +1646 0.00000000000000e+00 +1647 7.50000000000000e-01 +1648 -2.25000000000000e+00 +1649 0.00000000000000e+00 +1650 5.00000000000000e-01 +1651 -2.00000000000000e+00 +1652 0.00000000000000e+00 +1653 5.00000000000000e-01 +1654 -2.25000000000000e+00 +1655 0.00000000000000e+00 +1656 7.50000000000000e-01 +1657 -2.25000000000000e+00 +1658 0.00000000000000e+00 +1659 5.00000000000000e-01 +1660 -2.75000000000000e+00 +1661 0.00000000000000e+00 +1662 7.50000000000000e-01 +1663 -2.50000000000000e+00 +1664 0.00000000000000e+00 +1665 7.50000000000000e-01 +1666 -2.75000000000000e+00 +1667 0.00000000000000e+00 +1668 5.00000000000000e-01 +1669 -2.50000000000000e+00 +1670 0.00000000000000e+00 +1671 5.00000000000000e-01 +1672 -2.75000000000000e+00 +1673 0.00000000000000e+00 +1674 7.50000000000000e-01 +1675 -2.50000000000000e+00 +1676 0.00000000000000e+00 +1677 2.50000000000000e-01 +1678 -3.50000000000000e+00 +1679 0.00000000000000e+00 +1680 0.00000000000000e+00 +1681 -3.50000000000000e+00 +1682 0.00000000000000e+00 +1683 2.50000000000000e-01 +1684 -3.50000000000000e+00 +1685 0.00000000000000e+00 +1686 2.50000000000000e-01 +1687 -3.75000000000000e+00 +1688 0.00000000000000e+00 +1689 0.00000000000000e+00 +1690 -3.75000000000000e+00 +1691 0.00000000000000e+00 +1692 2.50000000000000e-01 +1693 -3.75000000000000e+00 +1694 0.00000000000000e+00 +1695 5.00000000000000e-01 +1696 -3.25000000000000e+00 +1697 0.00000000000000e+00 +1698 5.00000000000000e-01 +1699 -3.00000000000000e+00 +1700 0.00000000000000e+00 +1701 5.00000000000000e-01 +1702 -3.25000000000000e+00 +1703 0.00000000000000e+00 +1704 7.50000000000000e-01 +1705 -3.25000000000000e+00 +1706 0.00000000000000e+00 +1707 7.50000000000000e-01 +1708 -3.00000000000000e+00 +1709 0.00000000000000e+00 +1710 7.50000000000000e-01 +1711 -3.25000000000000e+00 +1712 0.00000000000000e+00 +1713 5.00000000000000e-01 +1714 -3.50000000000000e+00 +1715 0.00000000000000e+00 +1716 5.00000000000000e-01 +1717 -3.75000000000000e+00 +1718 0.00000000000000e+00 +1719 5.00000000000000e-01 +1720 -3.75000000000000e+00 +1721 0.00000000000000e+00 +1722 7.50000000000000e-01 +1723 -3.50000000000000e+00 +1724 0.00000000000000e+00 +1725 7.50000000000000e-01 +1726 -3.50000000000000e+00 +1727 0.00000000000000e+00 +1728 7.50000000000000e-01 +1729 -3.75000000000000e+00 +1730 0.00000000000000e+00 +1731 0.00000000000000e+00 +1732 -3.25000000000000e+00 +1733 0.00000000000000e+00 +1734 2.50000000000000e-01 +1735 -3.00000000000000e+00 +1736 0.00000000000000e+00 +1737 2.50000000000000e-01 +1738 -3.25000000000000e+00 +1739 0.00000000000000e+00 +1740 0.00000000000000e+00 +1741 -3.25000000000000e+00 +1742 0.00000000000000e+00 +1743 2.50000000000000e-01 +1744 -3.00000000000000e+00 +1745 0.00000000000000e+00 +1746 2.50000000000000e-01 +1747 -3.25000000000000e+00 +1748 0.00000000000000e+00 +1749 2.50000000000000e-01 +1750 -3.50000000000000e+00 +1751 0.00000000000000e+00 +1752 0.00000000000000e+00 +1753 -3.75000000000000e+00 +1754 0.00000000000000e+00 +1755 2.50000000000000e-01 +1756 -3.75000000000000e+00 +1757 0.00000000000000e+00 +1758 0.00000000000000e+00 +1759 -3.50000000000000e+00 +1760 0.00000000000000e+00 +1761 2.50000000000000e-01 +1762 -3.50000000000000e+00 +1763 0.00000000000000e+00 +1764 2.50000000000000e-01 +1765 -3.75000000000000e+00 +1766 0.00000000000000e+00 +1767 5.00000000000000e-01 +1768 -3.25000000000000e+00 +1769 0.00000000000000e+00 +1770 7.50000000000000e-01 +1771 -3.00000000000000e+00 +1772 0.00000000000000e+00 +1773 7.50000000000000e-01 +1774 -3.25000000000000e+00 +1775 0.00000000000000e+00 +1776 5.00000000000000e-01 +1777 -3.00000000000000e+00 +1778 0.00000000000000e+00 +1779 5.00000000000000e-01 +1780 -3.25000000000000e+00 +1781 0.00000000000000e+00 +1782 7.50000000000000e-01 +1783 -3.25000000000000e+00 +1784 0.00000000000000e+00 +1785 5.00000000000000e-01 +1786 -3.75000000000000e+00 +1787 0.00000000000000e+00 +1788 7.50000000000000e-01 +1789 -3.50000000000000e+00 +1790 0.00000000000000e+00 +1791 7.50000000000000e-01 +1792 -3.75000000000000e+00 +1793 0.00000000000000e+00 +1794 5.00000000000000e-01 +1795 -3.50000000000000e+00 +1796 0.00000000000000e+00 +1797 5.00000000000000e-01 +1798 -3.75000000000000e+00 +1799 0.00000000000000e+00 +1800 7.50000000000000e-01 +1801 -3.50000000000000e+00 +1802 0.00000000000000e+00 +1803 1.00000000000000e+00 +1804 -2.50000000000000e+00 +1805 0.00000000000000e+00 +1806 1.00000000000000e+00 +1807 -2.75000000000000e+00 +1808 0.00000000000000e+00 +1809 1.00000000000000e+00 +1810 -2.25000000000000e+00 +1811 0.00000000000000e+00 +1812 1.00000000000000e+00 +1813 -2.25000000000000e+00 +1814 0.00000000000000e+00 +1815 1.00000000000000e+00 +1816 -2.75000000000000e+00 +1817 0.00000000000000e+00 +1818 1.00000000000000e+00 +1819 -2.50000000000000e+00 +1820 0.00000000000000e+00 +1821 1.00000000000000e+00 +1822 -3.50000000000000e+00 +1823 0.00000000000000e+00 +1824 1.00000000000000e+00 +1825 -3.75000000000000e+00 +1826 0.00000000000000e+00 +1827 1.00000000000000e+00 +1828 -3.25000000000000e+00 +1829 0.00000000000000e+00 +1830 1.00000000000000e+00 +1831 -3.25000000000000e+00 +1832 0.00000000000000e+00 +1833 1.00000000000000e+00 +1834 -3.75000000000000e+00 +1835 0.00000000000000e+00 +1836 1.00000000000000e+00 +1837 -3.50000000000000e+00 +1838 0.00000000000000e+00 +1839 2.50000000000000e-01 +1840 -2.50000000000000e+00 +1841 0.00000000000000e+00 +1842 2.50000000000000e-01 +1843 -2.75000000000000e+00 +1844 0.00000000000000e+00 +1845 5.00000000000000e-01 +1846 -2.25000000000000e+00 +1847 0.00000000000000e+00 +1848 7.50000000000000e-01 +1849 -2.25000000000000e+00 +1850 0.00000000000000e+00 +1851 5.00000000000000e-01 +1852 -2.75000000000000e+00 +1853 0.00000000000000e+00 +1854 7.50000000000000e-01 +1855 -2.50000000000000e+00 +1856 0.00000000000000e+00 +1857 2.50000000000000e-01 +1858 -3.50000000000000e+00 +1859 0.00000000000000e+00 +1860 2.50000000000000e-01 +1861 -3.75000000000000e+00 +1862 0.00000000000000e+00 +1863 5.00000000000000e-01 +1864 -3.25000000000000e+00 +1865 0.00000000000000e+00 +1866 7.50000000000000e-01 +1867 -3.25000000000000e+00 +1868 0.00000000000000e+00 +1869 5.00000000000000e-01 +1870 -3.75000000000000e+00 +1871 0.00000000000000e+00 +1872 7.50000000000000e-01 +1873 -3.50000000000000e+00 +1874 0.00000000000000e+00 diff --git a/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.0.00003 b/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.0.00003 new file mode 100644 index 00000000..295fa5b2 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.0.00003 @@ -0,0 +1,601 @@ +1875 2475 +1875 0.00000000000000e+00 +1876 0.00000000000000e+00 +1877 0.00000000000000e+00 +1878 0.00000000000000e+00 +1879 -1.00000000000000e+00 +1880 0.00000000000000e+00 +1881 1.00000000000000e+00 +1882 0.00000000000000e+00 +1883 0.00000000000000e+00 +1884 1.00000000000000e+00 +1885 -1.00000000000000e+00 +1886 0.00000000000000e+00 +1887 0.00000000000000e+00 +1888 0.00000000000000e+00 +1889 0.00000000000000e+00 +1890 0.00000000000000e+00 +1891 -1.00000000000000e+00 +1892 0.00000000000000e+00 +1893 1.00000000000000e+00 +1894 0.00000000000000e+00 +1895 0.00000000000000e+00 +1896 1.00000000000000e+00 +1897 -1.00000000000000e+00 +1898 0.00000000000000e+00 +1899 0.00000000000000e+00 +1900 -5.00000000000000e-01 +1901 0.00000000000000e+00 +1902 5.00000000000000e-01 +1903 0.00000000000000e+00 +1904 0.00000000000000e+00 +1905 5.00000000000000e-01 +1906 -5.00000000000000e-01 +1907 0.00000000000000e+00 +1908 0.00000000000000e+00 +1909 0.00000000000000e+00 +1910 0.00000000000000e+00 +1911 0.00000000000000e+00 +1912 -5.00000000000000e-01 +1913 0.00000000000000e+00 +1914 5.00000000000000e-01 +1915 0.00000000000000e+00 +1916 0.00000000000000e+00 +1917 5.00000000000000e-01 +1918 -5.00000000000000e-01 +1919 0.00000000000000e+00 +1920 0.00000000000000e+00 +1921 -1.50000000000000e+00 +1922 0.00000000000000e+00 +1923 5.00000000000000e-01 +1924 -1.00000000000000e+00 +1925 0.00000000000000e+00 +1926 5.00000000000000e-01 +1927 -1.50000000000000e+00 +1928 0.00000000000000e+00 +1929 0.00000000000000e+00 +1930 -1.00000000000000e+00 +1931 0.00000000000000e+00 +1932 0.00000000000000e+00 +1933 -1.50000000000000e+00 +1934 0.00000000000000e+00 +1935 5.00000000000000e-01 +1936 -1.00000000000000e+00 +1937 0.00000000000000e+00 +1938 5.00000000000000e-01 +1939 -1.50000000000000e+00 +1940 0.00000000000000e+00 +1941 1.00000000000000e+00 +1942 -5.00000000000000e-01 +1943 0.00000000000000e+00 +1944 1.00000000000000e+00 +1945 0.00000000000000e+00 +1946 0.00000000000000e+00 +1947 1.00000000000000e+00 +1948 -5.00000000000000e-01 +1949 0.00000000000000e+00 +1950 1.00000000000000e+00 +1951 -1.50000000000000e+00 +1952 0.00000000000000e+00 +1953 1.00000000000000e+00 +1954 -1.00000000000000e+00 +1955 0.00000000000000e+00 +1956 1.00000000000000e+00 +1957 -1.50000000000000e+00 +1958 0.00000000000000e+00 +1959 0.00000000000000e+00 +1960 -5.00000000000000e-01 +1961 0.00000000000000e+00 +1962 5.00000000000000e-01 +1963 0.00000000000000e+00 +1964 0.00000000000000e+00 +1965 5.00000000000000e-01 +1966 -5.00000000000000e-01 +1967 0.00000000000000e+00 +1968 0.00000000000000e+00 +1969 -1.50000000000000e+00 +1970 0.00000000000000e+00 +1971 5.00000000000000e-01 +1972 -1.00000000000000e+00 +1973 0.00000000000000e+00 +1974 5.00000000000000e-01 +1975 -1.50000000000000e+00 +1976 0.00000000000000e+00 +1977 1.00000000000000e+00 +1978 -5.00000000000000e-01 +1979 0.00000000000000e+00 +1980 1.00000000000000e+00 +1981 -1.50000000000000e+00 +1982 0.00000000000000e+00 +1983 0.00000000000000e+00 +1984 -2.50000000000000e-01 +1985 0.00000000000000e+00 +1986 2.50000000000000e-01 +1987 0.00000000000000e+00 +1988 0.00000000000000e+00 +1989 2.50000000000000e-01 +1990 -2.50000000000000e-01 +1991 0.00000000000000e+00 +1992 0.00000000000000e+00 +1993 0.00000000000000e+00 +1994 0.00000000000000e+00 +1995 0.00000000000000e+00 +1996 -2.50000000000000e-01 +1997 0.00000000000000e+00 +1998 2.50000000000000e-01 +1999 0.00000000000000e+00 +2000 0.00000000000000e+00 +2001 2.50000000000000e-01 +2002 -2.50000000000000e-01 +2003 0.00000000000000e+00 +2004 0.00000000000000e+00 +2005 -7.50000000000000e-01 +2006 0.00000000000000e+00 +2007 0.00000000000000e+00 +2008 -1.25000000000000e+00 +2009 0.00000000000000e+00 +2010 2.50000000000000e-01 +2011 -1.00000000000000e+00 +2012 0.00000000000000e+00 +2013 2.50000000000000e-01 +2014 -1.25000000000000e+00 +2015 0.00000000000000e+00 +2016 0.00000000000000e+00 +2017 -1.00000000000000e+00 +2018 0.00000000000000e+00 +2019 0.00000000000000e+00 +2020 -1.25000000000000e+00 +2021 0.00000000000000e+00 +2022 2.50000000000000e-01 +2023 -1.00000000000000e+00 +2024 0.00000000000000e+00 +2025 2.50000000000000e-01 +2026 -1.25000000000000e+00 +2027 0.00000000000000e+00 +2028 0.00000000000000e+00 +2029 -1.75000000000000e+00 +2030 0.00000000000000e+00 +2031 7.50000000000000e-01 +2032 0.00000000000000e+00 +2033 0.00000000000000e+00 +2034 1.00000000000000e+00 +2035 -2.50000000000000e-01 +2036 0.00000000000000e+00 +2037 1.00000000000000e+00 +2038 0.00000000000000e+00 +2039 0.00000000000000e+00 +2040 1.00000000000000e+00 +2041 -2.50000000000000e-01 +2042 0.00000000000000e+00 +2043 7.50000000000000e-01 +2044 -7.50000000000000e-01 +2045 0.00000000000000e+00 +2046 7.50000000000000e-01 +2047 -1.00000000000000e+00 +2048 0.00000000000000e+00 +2049 1.00000000000000e+00 +2050 -7.50000000000000e-01 +2051 0.00000000000000e+00 +2052 1.00000000000000e+00 +2053 -1.25000000000000e+00 +2054 0.00000000000000e+00 +2055 1.00000000000000e+00 +2056 -1.00000000000000e+00 +2057 0.00000000000000e+00 +2058 1.00000000000000e+00 +2059 -1.25000000000000e+00 +2060 0.00000000000000e+00 +2061 7.50000000000000e-01 +2062 -1.75000000000000e+00 +2063 0.00000000000000e+00 +2064 1.00000000000000e+00 +2065 -1.75000000000000e+00 +2066 0.00000000000000e+00 +2067 0.00000000000000e+00 +2068 0.00000000000000e+00 +2069 0.00000000000000e+00 +2070 0.00000000000000e+00 +2071 -2.50000000000000e-01 +2072 0.00000000000000e+00 +2073 2.50000000000000e-01 +2074 0.00000000000000e+00 +2075 0.00000000000000e+00 +2076 2.50000000000000e-01 +2077 -2.50000000000000e-01 +2078 0.00000000000000e+00 +2079 0.00000000000000e+00 +2080 -7.50000000000000e-01 +2081 0.00000000000000e+00 +2082 0.00000000000000e+00 +2083 -1.00000000000000e+00 +2084 0.00000000000000e+00 +2085 0.00000000000000e+00 +2086 -7.50000000000000e-01 +2087 0.00000000000000e+00 +2088 0.00000000000000e+00 +2089 -1.25000000000000e+00 +2090 0.00000000000000e+00 +2091 2.50000000000000e-01 +2092 -1.00000000000000e+00 +2093 0.00000000000000e+00 +2094 2.50000000000000e-01 +2095 -1.25000000000000e+00 +2096 0.00000000000000e+00 +2097 0.00000000000000e+00 +2098 -1.75000000000000e+00 +2099 0.00000000000000e+00 +2100 0.00000000000000e+00 +2101 -1.75000000000000e+00 +2102 0.00000000000000e+00 +2103 7.50000000000000e-01 +2104 0.00000000000000e+00 +2105 0.00000000000000e+00 +2106 1.00000000000000e+00 +2107 0.00000000000000e+00 +2108 0.00000000000000e+00 +2109 7.50000000000000e-01 +2110 0.00000000000000e+00 +2111 0.00000000000000e+00 +2112 1.00000000000000e+00 +2113 -2.50000000000000e-01 +2114 0.00000000000000e+00 +2115 7.50000000000000e-01 +2116 -7.50000000000000e-01 +2117 0.00000000000000e+00 +2118 7.50000000000000e-01 +2119 -1.00000000000000e+00 +2120 0.00000000000000e+00 +2121 1.00000000000000e+00 +2122 -7.50000000000000e-01 +2123 0.00000000000000e+00 +2124 1.00000000000000e+00 +2125 -1.00000000000000e+00 +2126 0.00000000000000e+00 +2127 7.50000000000000e-01 +2128 -7.50000000000000e-01 +2129 0.00000000000000e+00 +2130 7.50000000000000e-01 +2131 -1.00000000000000e+00 +2132 0.00000000000000e+00 +2133 1.00000000000000e+00 +2134 -7.50000000000000e-01 +2135 0.00000000000000e+00 +2136 1.00000000000000e+00 +2137 -1.25000000000000e+00 +2138 0.00000000000000e+00 +2139 7.50000000000000e-01 +2140 -1.75000000000000e+00 +2141 0.00000000000000e+00 +2142 1.00000000000000e+00 +2143 -1.75000000000000e+00 +2144 0.00000000000000e+00 +2145 7.50000000000000e-01 +2146 -1.75000000000000e+00 +2147 0.00000000000000e+00 +2148 1.00000000000000e+00 +2149 -1.75000000000000e+00 +2150 0.00000000000000e+00 +2151 2.50000000000000e-01 +2152 -5.00000000000000e-01 +2153 0.00000000000000e+00 +2154 0.00000000000000e+00 +2155 -5.00000000000000e-01 +2156 0.00000000000000e+00 +2157 2.50000000000000e-01 +2158 -5.00000000000000e-01 +2159 0.00000000000000e+00 +2160 2.50000000000000e-01 +2161 -7.50000000000000e-01 +2162 0.00000000000000e+00 +2163 0.00000000000000e+00 +2164 -7.50000000000000e-01 +2165 0.00000000000000e+00 +2166 2.50000000000000e-01 +2167 -7.50000000000000e-01 +2168 0.00000000000000e+00 +2169 5.00000000000000e-01 +2170 -2.50000000000000e-01 +2171 0.00000000000000e+00 +2172 5.00000000000000e-01 +2173 0.00000000000000e+00 +2174 0.00000000000000e+00 +2175 5.00000000000000e-01 +2176 -2.50000000000000e-01 +2177 0.00000000000000e+00 +2178 7.50000000000000e-01 +2179 -2.50000000000000e-01 +2180 0.00000000000000e+00 +2181 7.50000000000000e-01 +2182 0.00000000000000e+00 +2183 0.00000000000000e+00 +2184 7.50000000000000e-01 +2185 -2.50000000000000e-01 +2186 0.00000000000000e+00 +2187 5.00000000000000e-01 +2188 -5.00000000000000e-01 +2189 0.00000000000000e+00 +2190 5.00000000000000e-01 +2191 -7.50000000000000e-01 +2192 0.00000000000000e+00 +2193 5.00000000000000e-01 +2194 -7.50000000000000e-01 +2195 0.00000000000000e+00 +2196 7.50000000000000e-01 +2197 -5.00000000000000e-01 +2198 0.00000000000000e+00 +2199 7.50000000000000e-01 +2200 -5.00000000000000e-01 +2201 0.00000000000000e+00 +2202 7.50000000000000e-01 +2203 -7.50000000000000e-01 +2204 0.00000000000000e+00 +2205 0.00000000000000e+00 +2206 -2.50000000000000e-01 +2207 0.00000000000000e+00 +2208 2.50000000000000e-01 +2209 0.00000000000000e+00 +2210 0.00000000000000e+00 +2211 2.50000000000000e-01 +2212 -2.50000000000000e-01 +2213 0.00000000000000e+00 +2214 0.00000000000000e+00 +2215 -2.50000000000000e-01 +2216 0.00000000000000e+00 +2217 2.50000000000000e-01 +2218 0.00000000000000e+00 +2219 0.00000000000000e+00 +2220 2.50000000000000e-01 +2221 -2.50000000000000e-01 +2222 0.00000000000000e+00 +2223 2.50000000000000e-01 +2224 -5.00000000000000e-01 +2225 0.00000000000000e+00 +2226 0.00000000000000e+00 +2227 -7.50000000000000e-01 +2228 0.00000000000000e+00 +2229 2.50000000000000e-01 +2230 -7.50000000000000e-01 +2231 0.00000000000000e+00 +2232 0.00000000000000e+00 +2233 -5.00000000000000e-01 +2234 0.00000000000000e+00 +2235 2.50000000000000e-01 +2236 -5.00000000000000e-01 +2237 0.00000000000000e+00 +2238 2.50000000000000e-01 +2239 -7.50000000000000e-01 +2240 0.00000000000000e+00 +2241 5.00000000000000e-01 +2242 -2.50000000000000e-01 +2243 0.00000000000000e+00 +2244 7.50000000000000e-01 +2245 0.00000000000000e+00 +2246 0.00000000000000e+00 +2247 7.50000000000000e-01 +2248 -2.50000000000000e-01 +2249 0.00000000000000e+00 +2250 5.00000000000000e-01 +2251 0.00000000000000e+00 +2252 0.00000000000000e+00 +2253 5.00000000000000e-01 +2254 -2.50000000000000e-01 +2255 0.00000000000000e+00 +2256 7.50000000000000e-01 +2257 -2.50000000000000e-01 +2258 0.00000000000000e+00 +2259 5.00000000000000e-01 +2260 -7.50000000000000e-01 +2261 0.00000000000000e+00 +2262 7.50000000000000e-01 +2263 -5.00000000000000e-01 +2264 0.00000000000000e+00 +2265 7.50000000000000e-01 +2266 -7.50000000000000e-01 +2267 0.00000000000000e+00 +2268 5.00000000000000e-01 +2269 -5.00000000000000e-01 +2270 0.00000000000000e+00 +2271 5.00000000000000e-01 +2272 -7.50000000000000e-01 +2273 0.00000000000000e+00 +2274 7.50000000000000e-01 +2275 -5.00000000000000e-01 +2276 0.00000000000000e+00 +2277 2.50000000000000e-01 +2278 -1.50000000000000e+00 +2279 0.00000000000000e+00 +2280 0.00000000000000e+00 +2281 -1.50000000000000e+00 +2282 0.00000000000000e+00 +2283 2.50000000000000e-01 +2284 -1.50000000000000e+00 +2285 0.00000000000000e+00 +2286 2.50000000000000e-01 +2287 -1.75000000000000e+00 +2288 0.00000000000000e+00 +2289 0.00000000000000e+00 +2290 -1.75000000000000e+00 +2291 0.00000000000000e+00 +2292 2.50000000000000e-01 +2293 -1.75000000000000e+00 +2294 0.00000000000000e+00 +2295 5.00000000000000e-01 +2296 -1.25000000000000e+00 +2297 0.00000000000000e+00 +2298 5.00000000000000e-01 +2299 -1.00000000000000e+00 +2300 0.00000000000000e+00 +2301 5.00000000000000e-01 +2302 -1.25000000000000e+00 +2303 0.00000000000000e+00 +2304 7.50000000000000e-01 +2305 -1.25000000000000e+00 +2306 0.00000000000000e+00 +2307 7.50000000000000e-01 +2308 -1.00000000000000e+00 +2309 0.00000000000000e+00 +2310 7.50000000000000e-01 +2311 -1.25000000000000e+00 +2312 0.00000000000000e+00 +2313 5.00000000000000e-01 +2314 -1.50000000000000e+00 +2315 0.00000000000000e+00 +2316 5.00000000000000e-01 +2317 -1.75000000000000e+00 +2318 0.00000000000000e+00 +2319 5.00000000000000e-01 +2320 -1.75000000000000e+00 +2321 0.00000000000000e+00 +2322 7.50000000000000e-01 +2323 -1.50000000000000e+00 +2324 0.00000000000000e+00 +2325 7.50000000000000e-01 +2326 -1.50000000000000e+00 +2327 0.00000000000000e+00 +2328 7.50000000000000e-01 +2329 -1.75000000000000e+00 +2330 0.00000000000000e+00 +2331 0.00000000000000e+00 +2332 -1.25000000000000e+00 +2333 0.00000000000000e+00 +2334 2.50000000000000e-01 +2335 -1.00000000000000e+00 +2336 0.00000000000000e+00 +2337 2.50000000000000e-01 +2338 -1.25000000000000e+00 +2339 0.00000000000000e+00 +2340 0.00000000000000e+00 +2341 -1.25000000000000e+00 +2342 0.00000000000000e+00 +2343 2.50000000000000e-01 +2344 -1.00000000000000e+00 +2345 0.00000000000000e+00 +2346 2.50000000000000e-01 +2347 -1.25000000000000e+00 +2348 0.00000000000000e+00 +2349 2.50000000000000e-01 +2350 -1.50000000000000e+00 +2351 0.00000000000000e+00 +2352 0.00000000000000e+00 +2353 -1.75000000000000e+00 +2354 0.00000000000000e+00 +2355 2.50000000000000e-01 +2356 -1.75000000000000e+00 +2357 0.00000000000000e+00 +2358 0.00000000000000e+00 +2359 -1.50000000000000e+00 +2360 0.00000000000000e+00 +2361 2.50000000000000e-01 +2362 -1.50000000000000e+00 +2363 0.00000000000000e+00 +2364 2.50000000000000e-01 +2365 -1.75000000000000e+00 +2366 0.00000000000000e+00 +2367 5.00000000000000e-01 +2368 -1.25000000000000e+00 +2369 0.00000000000000e+00 +2370 7.50000000000000e-01 +2371 -1.00000000000000e+00 +2372 0.00000000000000e+00 +2373 7.50000000000000e-01 +2374 -1.25000000000000e+00 +2375 0.00000000000000e+00 +2376 5.00000000000000e-01 +2377 -1.00000000000000e+00 +2378 0.00000000000000e+00 +2379 5.00000000000000e-01 +2380 -1.25000000000000e+00 +2381 0.00000000000000e+00 +2382 7.50000000000000e-01 +2383 -1.25000000000000e+00 +2384 0.00000000000000e+00 +2385 5.00000000000000e-01 +2386 -1.75000000000000e+00 +2387 0.00000000000000e+00 +2388 7.50000000000000e-01 +2389 -1.50000000000000e+00 +2390 0.00000000000000e+00 +2391 7.50000000000000e-01 +2392 -1.75000000000000e+00 +2393 0.00000000000000e+00 +2394 5.00000000000000e-01 +2395 -1.50000000000000e+00 +2396 0.00000000000000e+00 +2397 5.00000000000000e-01 +2398 -1.75000000000000e+00 +2399 0.00000000000000e+00 +2400 7.50000000000000e-01 +2401 -1.50000000000000e+00 +2402 0.00000000000000e+00 +2403 1.00000000000000e+00 +2404 -5.00000000000000e-01 +2405 0.00000000000000e+00 +2406 1.00000000000000e+00 +2407 -7.50000000000000e-01 +2408 0.00000000000000e+00 +2409 1.00000000000000e+00 +2410 -2.50000000000000e-01 +2411 0.00000000000000e+00 +2412 1.00000000000000e+00 +2413 -2.50000000000000e-01 +2414 0.00000000000000e+00 +2415 1.00000000000000e+00 +2416 -7.50000000000000e-01 +2417 0.00000000000000e+00 +2418 1.00000000000000e+00 +2419 -5.00000000000000e-01 +2420 0.00000000000000e+00 +2421 1.00000000000000e+00 +2422 -1.50000000000000e+00 +2423 0.00000000000000e+00 +2424 1.00000000000000e+00 +2425 -1.75000000000000e+00 +2426 0.00000000000000e+00 +2427 1.00000000000000e+00 +2428 -1.25000000000000e+00 +2429 0.00000000000000e+00 +2430 1.00000000000000e+00 +2431 -1.25000000000000e+00 +2432 0.00000000000000e+00 +2433 1.00000000000000e+00 +2434 -1.75000000000000e+00 +2435 0.00000000000000e+00 +2436 1.00000000000000e+00 +2437 -1.50000000000000e+00 +2438 0.00000000000000e+00 +2439 2.50000000000000e-01 +2440 -5.00000000000000e-01 +2441 0.00000000000000e+00 +2442 2.50000000000000e-01 +2443 -7.50000000000000e-01 +2444 0.00000000000000e+00 +2445 5.00000000000000e-01 +2446 -2.50000000000000e-01 +2447 0.00000000000000e+00 +2448 7.50000000000000e-01 +2449 -2.50000000000000e-01 +2450 0.00000000000000e+00 +2451 5.00000000000000e-01 +2452 -7.50000000000000e-01 +2453 0.00000000000000e+00 +2454 7.50000000000000e-01 +2455 -5.00000000000000e-01 +2456 0.00000000000000e+00 +2457 2.50000000000000e-01 +2458 -1.50000000000000e+00 +2459 0.00000000000000e+00 +2460 2.50000000000000e-01 +2461 -1.75000000000000e+00 +2462 0.00000000000000e+00 +2463 5.00000000000000e-01 +2464 -1.25000000000000e+00 +2465 0.00000000000000e+00 +2466 7.50000000000000e-01 +2467 -1.25000000000000e+00 +2468 0.00000000000000e+00 +2469 5.00000000000000e-01 +2470 -1.75000000000000e+00 +2471 0.00000000000000e+00 +2472 7.50000000000000e-01 +2473 -1.50000000000000e+00 +2474 0.00000000000000e+00 diff --git a/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.1.00000 b/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.1.00000 new file mode 100644 index 00000000..f346afb4 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.1.00000 @@ -0,0 +1,676 @@ +0 675 +0 0.00000000000000e+00 +1 0.00000000000000e+00 +2 0.00000000000000e+00 +3 0.00000000000000e+00 +4 0.00000000000000e+00 +5 0.00000000000000e+00 +6 0.00000000000000e+00 +7 0.00000000000000e+00 +8 0.00000000000000e+00 +9 0.00000000000000e+00 +10 0.00000000000000e+00 +11 -1.00000000000000e+00 +12 0.00000000000000e+00 +13 0.00000000000000e+00 +14 -1.00000000000000e+00 +15 0.00000000000000e+00 +16 0.00000000000000e+00 +17 -1.00000000000000e+00 +18 0.00000000000000e+00 +19 1.00000000000000e+00 +20 0.00000000000000e+00 +21 0.00000000000000e+00 +22 1.00000000000000e+00 +23 0.00000000000000e+00 +24 0.00000000000000e+00 +25 1.00000000000000e+00 +26 0.00000000000000e+00 +27 0.00000000000000e+00 +28 1.00000000000000e+00 +29 -1.00000000000000e+00 +30 0.00000000000000e+00 +31 1.00000000000000e+00 +32 -1.00000000000000e+00 +33 0.00000000000000e+00 +34 1.00000000000000e+00 +35 -1.00000000000000e+00 +36 0.00000000000000e+00 +37 0.00000000000000e+00 +38 0.00000000000000e+00 +39 0.00000000000000e+00 +40 0.00000000000000e+00 +41 -5.00000000000000e-01 +42 0.00000000000000e+00 +43 0.00000000000000e+00 +44 -5.00000000000000e-01 +45 0.00000000000000e+00 +46 5.00000000000000e-01 +47 0.00000000000000e+00 +48 0.00000000000000e+00 +49 5.00000000000000e-01 +50 0.00000000000000e+00 +51 0.00000000000000e+00 +52 5.00000000000000e-01 +53 -5.00000000000000e-01 +54 0.00000000000000e+00 +55 5.00000000000000e-01 +56 -5.00000000000000e-01 +57 0.00000000000000e+00 +58 0.00000000000000e+00 +59 0.00000000000000e+00 +60 0.00000000000000e+00 +61 0.00000000000000e+00 +62 -5.00000000000000e-01 +63 0.00000000000000e+00 +64 0.00000000000000e+00 +65 -5.00000000000000e-01 +66 0.00000000000000e+00 +67 5.00000000000000e-01 +68 0.00000000000000e+00 +69 0.00000000000000e+00 +70 5.00000000000000e-01 +71 0.00000000000000e+00 +72 0.00000000000000e+00 +73 5.00000000000000e-01 +74 -5.00000000000000e-01 +75 0.00000000000000e+00 +76 5.00000000000000e-01 +77 -5.00000000000000e-01 +78 0.00000000000000e+00 +79 0.00000000000000e+00 +80 -5.00000000000000e-01 +81 0.00000000000000e+00 +82 5.00000000000000e-01 +83 0.00000000000000e+00 +84 0.00000000000000e+00 +85 5.00000000000000e-01 +86 -5.00000000000000e-01 +87 0.00000000000000e+00 +88 0.00000000000000e+00 +89 -1.00000000000000e+00 +90 0.00000000000000e+00 +91 5.00000000000000e-01 +92 -1.00000000000000e+00 +93 0.00000000000000e+00 +94 5.00000000000000e-01 +95 -1.00000000000000e+00 +96 0.00000000000000e+00 +97 0.00000000000000e+00 +98 -1.00000000000000e+00 +99 0.00000000000000e+00 +100 5.00000000000000e-01 +101 -1.00000000000000e+00 +102 0.00000000000000e+00 +103 5.00000000000000e-01 +104 -1.00000000000000e+00 +105 0.00000000000000e+00 +106 5.00000000000000e-01 +107 -1.00000000000000e+00 +108 0.00000000000000e+00 +109 1.00000000000000e+00 +110 0.00000000000000e+00 +111 0.00000000000000e+00 +112 1.00000000000000e+00 +113 -5.00000000000000e-01 +114 0.00000000000000e+00 +115 1.00000000000000e+00 +116 -5.00000000000000e-01 +117 0.00000000000000e+00 +118 1.00000000000000e+00 +119 0.00000000000000e+00 +120 0.00000000000000e+00 +121 1.00000000000000e+00 +122 -5.00000000000000e-01 +123 0.00000000000000e+00 +124 1.00000000000000e+00 +125 -5.00000000000000e-01 +126 0.00000000000000e+00 +127 1.00000000000000e+00 +128 -5.00000000000000e-01 +129 0.00000000000000e+00 +130 1.00000000000000e+00 +131 -1.00000000000000e+00 +132 0.00000000000000e+00 +133 1.00000000000000e+00 +134 -1.00000000000000e+00 +135 0.00000000000000e+00 +136 0.00000000000000e+00 +137 0.00000000000000e+00 +138 0.00000000000000e+00 +139 0.00000000000000e+00 +140 -2.50000000000000e-01 +141 0.00000000000000e+00 +142 0.00000000000000e+00 +143 -2.50000000000000e-01 +144 0.00000000000000e+00 +145 2.50000000000000e-01 +146 0.00000000000000e+00 +147 0.00000000000000e+00 +148 2.50000000000000e-01 +149 0.00000000000000e+00 +150 0.00000000000000e+00 +151 2.50000000000000e-01 +152 -2.50000000000000e-01 +153 0.00000000000000e+00 +154 2.50000000000000e-01 +155 -2.50000000000000e-01 +156 0.00000000000000e+00 +157 0.00000000000000e+00 +158 0.00000000000000e+00 +159 0.00000000000000e+00 +160 0.00000000000000e+00 +161 0.00000000000000e+00 +162 0.00000000000000e+00 +163 0.00000000000000e+00 +164 -2.50000000000000e-01 +165 0.00000000000000e+00 +166 0.00000000000000e+00 +167 -2.50000000000000e-01 +168 0.00000000000000e+00 +169 2.50000000000000e-01 +170 0.00000000000000e+00 +171 0.00000000000000e+00 +172 2.50000000000000e-01 +173 0.00000000000000e+00 +174 0.00000000000000e+00 +175 2.50000000000000e-01 +176 -2.50000000000000e-01 +177 0.00000000000000e+00 +178 2.50000000000000e-01 +179 -2.50000000000000e-01 +180 0.00000000000000e+00 +181 0.00000000000000e+00 +182 0.00000000000000e+00 +183 0.00000000000000e+00 +184 0.00000000000000e+00 +185 -2.50000000000000e-01 +186 0.00000000000000e+00 +187 2.50000000000000e-01 +188 0.00000000000000e+00 +189 0.00000000000000e+00 +190 2.50000000000000e-01 +191 -2.50000000000000e-01 +192 0.00000000000000e+00 +193 0.00000000000000e+00 +194 -7.50000000000000e-01 +195 0.00000000000000e+00 +196 0.00000000000000e+00 +197 -1.00000000000000e+00 +198 0.00000000000000e+00 +199 2.50000000000000e-01 +200 -1.00000000000000e+00 +201 0.00000000000000e+00 +202 2.50000000000000e-01 +203 -1.00000000000000e+00 +204 0.00000000000000e+00 +205 0.00000000000000e+00 +206 -7.50000000000000e-01 +207 0.00000000000000e+00 +208 0.00000000000000e+00 +209 -7.50000000000000e-01 +210 0.00000000000000e+00 +211 0.00000000000000e+00 +212 -1.00000000000000e+00 +213 0.00000000000000e+00 +214 0.00000000000000e+00 +215 -1.00000000000000e+00 +216 0.00000000000000e+00 +217 2.50000000000000e-01 +218 -1.00000000000000e+00 +219 0.00000000000000e+00 +220 2.50000000000000e-01 +221 -1.00000000000000e+00 +222 0.00000000000000e+00 +223 0.00000000000000e+00 +224 -7.50000000000000e-01 +225 0.00000000000000e+00 +226 0.00000000000000e+00 +227 -7.50000000000000e-01 +228 0.00000000000000e+00 +229 0.00000000000000e+00 +230 -1.00000000000000e+00 +231 0.00000000000000e+00 +232 2.50000000000000e-01 +233 -1.00000000000000e+00 +234 0.00000000000000e+00 +235 7.50000000000000e-01 +236 0.00000000000000e+00 +237 0.00000000000000e+00 +238 1.00000000000000e+00 +239 0.00000000000000e+00 +240 0.00000000000000e+00 +241 1.00000000000000e+00 +242 -2.50000000000000e-01 +243 0.00000000000000e+00 +244 1.00000000000000e+00 +245 -2.50000000000000e-01 +246 0.00000000000000e+00 +247 7.50000000000000e-01 +248 0.00000000000000e+00 +249 0.00000000000000e+00 +250 7.50000000000000e-01 +251 0.00000000000000e+00 +252 0.00000000000000e+00 +253 1.00000000000000e+00 +254 0.00000000000000e+00 +255 0.00000000000000e+00 +256 1.00000000000000e+00 +257 0.00000000000000e+00 +258 0.00000000000000e+00 +259 1.00000000000000e+00 +260 -2.50000000000000e-01 +261 0.00000000000000e+00 +262 1.00000000000000e+00 +263 -2.50000000000000e-01 +264 0.00000000000000e+00 +265 7.50000000000000e-01 +266 0.00000000000000e+00 +267 0.00000000000000e+00 +268 7.50000000000000e-01 +269 0.00000000000000e+00 +270 0.00000000000000e+00 +271 1.00000000000000e+00 +272 0.00000000000000e+00 +273 0.00000000000000e+00 +274 1.00000000000000e+00 +275 -2.50000000000000e-01 +276 0.00000000000000e+00 +277 7.50000000000000e-01 +278 -7.50000000000000e-01 +279 0.00000000000000e+00 +280 7.50000000000000e-01 +281 -1.00000000000000e+00 +282 0.00000000000000e+00 +283 1.00000000000000e+00 +284 -7.50000000000000e-01 +285 0.00000000000000e+00 +286 1.00000000000000e+00 +287 -1.00000000000000e+00 +288 0.00000000000000e+00 +289 7.50000000000000e-01 +290 -7.50000000000000e-01 +291 0.00000000000000e+00 +292 7.50000000000000e-01 +293 -7.50000000000000e-01 +294 0.00000000000000e+00 +295 7.50000000000000e-01 +296 -1.00000000000000e+00 +297 0.00000000000000e+00 +298 7.50000000000000e-01 +299 -1.00000000000000e+00 +300 0.00000000000000e+00 +301 1.00000000000000e+00 +302 -7.50000000000000e-01 +303 0.00000000000000e+00 +304 1.00000000000000e+00 +305 -7.50000000000000e-01 +306 0.00000000000000e+00 +307 1.00000000000000e+00 +308 -1.00000000000000e+00 +309 0.00000000000000e+00 +310 1.00000000000000e+00 +311 -1.00000000000000e+00 +312 0.00000000000000e+00 +313 7.50000000000000e-01 +314 -7.50000000000000e-01 +315 0.00000000000000e+00 +316 7.50000000000000e-01 +317 -7.50000000000000e-01 +318 0.00000000000000e+00 +319 7.50000000000000e-01 +320 -1.00000000000000e+00 +321 0.00000000000000e+00 +322 7.50000000000000e-01 +323 -1.00000000000000e+00 +324 0.00000000000000e+00 +325 1.00000000000000e+00 +326 -7.50000000000000e-01 +327 0.00000000000000e+00 +328 1.00000000000000e+00 +329 -7.50000000000000e-01 +330 0.00000000000000e+00 +331 1.00000000000000e+00 +332 -1.00000000000000e+00 +333 0.00000000000000e+00 +334 0.00000000000000e+00 +335 -2.50000000000000e-01 +336 0.00000000000000e+00 +337 2.50000000000000e-01 +338 0.00000000000000e+00 +339 0.00000000000000e+00 +340 2.50000000000000e-01 +341 -2.50000000000000e-01 +342 0.00000000000000e+00 +343 0.00000000000000e+00 +344 -2.50000000000000e-01 +345 0.00000000000000e+00 +346 2.50000000000000e-01 +347 0.00000000000000e+00 +348 0.00000000000000e+00 +349 2.50000000000000e-01 +350 -2.50000000000000e-01 +351 0.00000000000000e+00 +352 0.00000000000000e+00 +353 -5.00000000000000e-01 +354 0.00000000000000e+00 +355 2.50000000000000e-01 +356 -5.00000000000000e-01 +357 0.00000000000000e+00 +358 2.50000000000000e-01 +359 -5.00000000000000e-01 +360 0.00000000000000e+00 +361 0.00000000000000e+00 +362 -7.50000000000000e-01 +363 0.00000000000000e+00 +364 2.50000000000000e-01 +365 -7.50000000000000e-01 +366 0.00000000000000e+00 +367 2.50000000000000e-01 +368 -7.50000000000000e-01 +369 0.00000000000000e+00 +370 2.50000000000000e-01 +371 -5.00000000000000e-01 +372 0.00000000000000e+00 +373 0.00000000000000e+00 +374 -5.00000000000000e-01 +375 0.00000000000000e+00 +376 2.50000000000000e-01 +377 -5.00000000000000e-01 +378 0.00000000000000e+00 +379 0.00000000000000e+00 +380 -7.50000000000000e-01 +381 0.00000000000000e+00 +382 2.50000000000000e-01 +383 -7.50000000000000e-01 +384 0.00000000000000e+00 +385 2.50000000000000e-01 +386 -7.50000000000000e-01 +387 0.00000000000000e+00 +388 5.00000000000000e-01 +389 0.00000000000000e+00 +390 0.00000000000000e+00 +391 5.00000000000000e-01 +392 -2.50000000000000e-01 +393 0.00000000000000e+00 +394 5.00000000000000e-01 +395 -2.50000000000000e-01 +396 0.00000000000000e+00 +397 7.50000000000000e-01 +398 0.00000000000000e+00 +399 0.00000000000000e+00 +400 7.50000000000000e-01 +401 -2.50000000000000e-01 +402 0.00000000000000e+00 +403 7.50000000000000e-01 +404 -2.50000000000000e-01 +405 0.00000000000000e+00 +406 5.00000000000000e-01 +407 -2.50000000000000e-01 +408 0.00000000000000e+00 +409 5.00000000000000e-01 +410 0.00000000000000e+00 +411 0.00000000000000e+00 +412 5.00000000000000e-01 +413 -2.50000000000000e-01 +414 0.00000000000000e+00 +415 7.50000000000000e-01 +416 0.00000000000000e+00 +417 0.00000000000000e+00 +418 7.50000000000000e-01 +419 -2.50000000000000e-01 +420 0.00000000000000e+00 +421 7.50000000000000e-01 +422 -2.50000000000000e-01 +423 0.00000000000000e+00 +424 5.00000000000000e-01 +425 -5.00000000000000e-01 +426 0.00000000000000e+00 +427 5.00000000000000e-01 +428 -7.50000000000000e-01 +429 0.00000000000000e+00 +430 5.00000000000000e-01 +431 -7.50000000000000e-01 +432 0.00000000000000e+00 +433 7.50000000000000e-01 +434 -5.00000000000000e-01 +435 0.00000000000000e+00 +436 7.50000000000000e-01 +437 -5.00000000000000e-01 +438 0.00000000000000e+00 +439 7.50000000000000e-01 +440 -7.50000000000000e-01 +441 0.00000000000000e+00 +442 5.00000000000000e-01 +443 -5.00000000000000e-01 +444 0.00000000000000e+00 +445 5.00000000000000e-01 +446 -7.50000000000000e-01 +447 0.00000000000000e+00 +448 5.00000000000000e-01 +449 -7.50000000000000e-01 +450 0.00000000000000e+00 +451 7.50000000000000e-01 +452 -5.00000000000000e-01 +453 0.00000000000000e+00 +454 7.50000000000000e-01 +455 -5.00000000000000e-01 +456 0.00000000000000e+00 +457 7.50000000000000e-01 +458 -7.50000000000000e-01 +459 0.00000000000000e+00 +460 0.00000000000000e+00 +461 -2.50000000000000e-01 +462 0.00000000000000e+00 +463 2.50000000000000e-01 +464 0.00000000000000e+00 +465 0.00000000000000e+00 +466 2.50000000000000e-01 +467 -2.50000000000000e-01 +468 0.00000000000000e+00 +469 0.00000000000000e+00 +470 -2.50000000000000e-01 +471 0.00000000000000e+00 +472 2.50000000000000e-01 +473 0.00000000000000e+00 +474 0.00000000000000e+00 +475 2.50000000000000e-01 +476 -2.50000000000000e-01 +477 0.00000000000000e+00 +478 0.00000000000000e+00 +479 -5.00000000000000e-01 +480 0.00000000000000e+00 +481 2.50000000000000e-01 +482 -5.00000000000000e-01 +483 0.00000000000000e+00 +484 2.50000000000000e-01 +485 -5.00000000000000e-01 +486 0.00000000000000e+00 +487 0.00000000000000e+00 +488 -7.50000000000000e-01 +489 0.00000000000000e+00 +490 2.50000000000000e-01 +491 -7.50000000000000e-01 +492 0.00000000000000e+00 +493 2.50000000000000e-01 +494 -7.50000000000000e-01 +495 0.00000000000000e+00 +496 2.50000000000000e-01 +497 -5.00000000000000e-01 +498 0.00000000000000e+00 +499 0.00000000000000e+00 +500 -5.00000000000000e-01 +501 0.00000000000000e+00 +502 2.50000000000000e-01 +503 -5.00000000000000e-01 +504 0.00000000000000e+00 +505 0.00000000000000e+00 +506 -7.50000000000000e-01 +507 0.00000000000000e+00 +508 2.50000000000000e-01 +509 -7.50000000000000e-01 +510 0.00000000000000e+00 +511 2.50000000000000e-01 +512 -7.50000000000000e-01 +513 0.00000000000000e+00 +514 5.00000000000000e-01 +515 0.00000000000000e+00 +516 0.00000000000000e+00 +517 5.00000000000000e-01 +518 -2.50000000000000e-01 +519 0.00000000000000e+00 +520 5.00000000000000e-01 +521 -2.50000000000000e-01 +522 0.00000000000000e+00 +523 7.50000000000000e-01 +524 0.00000000000000e+00 +525 0.00000000000000e+00 +526 7.50000000000000e-01 +527 -2.50000000000000e-01 +528 0.00000000000000e+00 +529 7.50000000000000e-01 +530 -2.50000000000000e-01 +531 0.00000000000000e+00 +532 5.00000000000000e-01 +533 -2.50000000000000e-01 +534 0.00000000000000e+00 +535 5.00000000000000e-01 +536 0.00000000000000e+00 +537 0.00000000000000e+00 +538 5.00000000000000e-01 +539 -2.50000000000000e-01 +540 0.00000000000000e+00 +541 7.50000000000000e-01 +542 0.00000000000000e+00 +543 0.00000000000000e+00 +544 7.50000000000000e-01 +545 -2.50000000000000e-01 +546 0.00000000000000e+00 +547 7.50000000000000e-01 +548 -2.50000000000000e-01 +549 0.00000000000000e+00 +550 5.00000000000000e-01 +551 -5.00000000000000e-01 +552 0.00000000000000e+00 +553 5.00000000000000e-01 +554 -7.50000000000000e-01 +555 0.00000000000000e+00 +556 5.00000000000000e-01 +557 -7.50000000000000e-01 +558 0.00000000000000e+00 +559 7.50000000000000e-01 +560 -5.00000000000000e-01 +561 0.00000000000000e+00 +562 7.50000000000000e-01 +563 -5.00000000000000e-01 +564 0.00000000000000e+00 +565 7.50000000000000e-01 +566 -7.50000000000000e-01 +567 0.00000000000000e+00 +568 5.00000000000000e-01 +569 -5.00000000000000e-01 +570 0.00000000000000e+00 +571 5.00000000000000e-01 +572 -7.50000000000000e-01 +573 0.00000000000000e+00 +574 5.00000000000000e-01 +575 -7.50000000000000e-01 +576 0.00000000000000e+00 +577 7.50000000000000e-01 +578 -5.00000000000000e-01 +579 0.00000000000000e+00 +580 7.50000000000000e-01 +581 -5.00000000000000e-01 +582 0.00000000000000e+00 +583 7.50000000000000e-01 +584 -7.50000000000000e-01 +585 0.00000000000000e+00 +586 2.50000000000000e-01 +587 -5.00000000000000e-01 +588 0.00000000000000e+00 +589 2.50000000000000e-01 +590 -7.50000000000000e-01 +591 0.00000000000000e+00 +592 5.00000000000000e-01 +593 -2.50000000000000e-01 +594 0.00000000000000e+00 +595 7.50000000000000e-01 +596 -2.50000000000000e-01 +597 0.00000000000000e+00 +598 5.00000000000000e-01 +599 -7.50000000000000e-01 +600 0.00000000000000e+00 +601 7.50000000000000e-01 +602 -5.00000000000000e-01 +603 0.00000000000000e+00 +604 2.50000000000000e-01 +605 -1.00000000000000e+00 +606 0.00000000000000e+00 +607 2.50000000000000e-01 +608 -1.00000000000000e+00 +609 0.00000000000000e+00 +610 5.00000000000000e-01 +611 -1.00000000000000e+00 +612 0.00000000000000e+00 +613 7.50000000000000e-01 +614 -1.00000000000000e+00 +615 0.00000000000000e+00 +616 5.00000000000000e-01 +617 -1.00000000000000e+00 +618 0.00000000000000e+00 +619 7.50000000000000e-01 +620 -1.00000000000000e+00 +621 0.00000000000000e+00 +622 2.50000000000000e-01 +623 -1.00000000000000e+00 +624 0.00000000000000e+00 +625 2.50000000000000e-01 +626 -1.00000000000000e+00 +627 0.00000000000000e+00 +628 5.00000000000000e-01 +629 -1.00000000000000e+00 +630 0.00000000000000e+00 +631 7.50000000000000e-01 +632 -1.00000000000000e+00 +633 0.00000000000000e+00 +634 5.00000000000000e-01 +635 -1.00000000000000e+00 +636 0.00000000000000e+00 +637 7.50000000000000e-01 +638 -1.00000000000000e+00 +639 0.00000000000000e+00 +640 1.00000000000000e+00 +641 -2.50000000000000e-01 +642 0.00000000000000e+00 +643 1.00000000000000e+00 +644 -2.50000000000000e-01 +645 0.00000000000000e+00 +646 1.00000000000000e+00 +647 -5.00000000000000e-01 +648 0.00000000000000e+00 +649 1.00000000000000e+00 +650 -7.50000000000000e-01 +651 0.00000000000000e+00 +652 1.00000000000000e+00 +653 -5.00000000000000e-01 +654 0.00000000000000e+00 +655 1.00000000000000e+00 +656 -7.50000000000000e-01 +657 0.00000000000000e+00 +658 1.00000000000000e+00 +659 -2.50000000000000e-01 +660 0.00000000000000e+00 +661 1.00000000000000e+00 +662 -2.50000000000000e-01 +663 0.00000000000000e+00 +664 1.00000000000000e+00 +665 -5.00000000000000e-01 +666 0.00000000000000e+00 +667 1.00000000000000e+00 +668 -7.50000000000000e-01 +669 0.00000000000000e+00 +670 1.00000000000000e+00 +671 -5.00000000000000e-01 +672 0.00000000000000e+00 +673 1.00000000000000e+00 +674 -7.50000000000000e-01 diff --git a/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.1.00001 b/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.1.00001 new file mode 100644 index 00000000..54ad9eaf --- /dev/null +++ b/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.1.00001 @@ -0,0 +1,601 @@ +675 1275 +675 0.00000000000000e+00 +676 0.00000000000000e+00 +677 0.00000000000000e+00 +678 0.00000000000000e+00 +679 0.00000000000000e+00 +680 0.00000000000000e+00 +681 0.00000000000000e+00 +682 0.00000000000000e+00 +683 -1.00000000000000e+00 +684 0.00000000000000e+00 +685 0.00000000000000e+00 +686 -1.00000000000000e+00 +687 0.00000000000000e+00 +688 1.00000000000000e+00 +689 0.00000000000000e+00 +690 0.00000000000000e+00 +691 1.00000000000000e+00 +692 0.00000000000000e+00 +693 0.00000000000000e+00 +694 1.00000000000000e+00 +695 -1.00000000000000e+00 +696 0.00000000000000e+00 +697 1.00000000000000e+00 +698 -1.00000000000000e+00 +699 0.00000000000000e+00 +700 0.00000000000000e+00 +701 0.00000000000000e+00 +702 0.00000000000000e+00 +703 0.00000000000000e+00 +704 -5.00000000000000e-01 +705 0.00000000000000e+00 +706 5.00000000000000e-01 +707 0.00000000000000e+00 +708 0.00000000000000e+00 +709 5.00000000000000e-01 +710 -5.00000000000000e-01 +711 0.00000000000000e+00 +712 0.00000000000000e+00 +713 0.00000000000000e+00 +714 0.00000000000000e+00 +715 0.00000000000000e+00 +716 -5.00000000000000e-01 +717 0.00000000000000e+00 +718 0.00000000000000e+00 +719 -5.00000000000000e-01 +720 0.00000000000000e+00 +721 5.00000000000000e-01 +722 0.00000000000000e+00 +723 0.00000000000000e+00 +724 5.00000000000000e-01 +725 0.00000000000000e+00 +726 0.00000000000000e+00 +727 5.00000000000000e-01 +728 -5.00000000000000e-01 +729 0.00000000000000e+00 +730 5.00000000000000e-01 +731 -5.00000000000000e-01 +732 0.00000000000000e+00 +733 0.00000000000000e+00 +734 -5.00000000000000e-01 +735 0.00000000000000e+00 +736 5.00000000000000e-01 +737 0.00000000000000e+00 +738 0.00000000000000e+00 +739 5.00000000000000e-01 +740 -5.00000000000000e-01 +741 0.00000000000000e+00 +742 0.00000000000000e+00 +743 -1.00000000000000e+00 +744 0.00000000000000e+00 +745 5.00000000000000e-01 +746 -1.00000000000000e+00 +747 0.00000000000000e+00 +748 0.00000000000000e+00 +749 -1.00000000000000e+00 +750 0.00000000000000e+00 +751 5.00000000000000e-01 +752 -1.00000000000000e+00 +753 0.00000000000000e+00 +754 5.00000000000000e-01 +755 -1.00000000000000e+00 +756 0.00000000000000e+00 +757 5.00000000000000e-01 +758 -1.00000000000000e+00 +759 0.00000000000000e+00 +760 1.00000000000000e+00 +761 0.00000000000000e+00 +762 0.00000000000000e+00 +763 1.00000000000000e+00 +764 -5.00000000000000e-01 +765 0.00000000000000e+00 +766 1.00000000000000e+00 +767 0.00000000000000e+00 +768 0.00000000000000e+00 +769 1.00000000000000e+00 +770 -5.00000000000000e-01 +771 0.00000000000000e+00 +772 1.00000000000000e+00 +773 -5.00000000000000e-01 +774 0.00000000000000e+00 +775 1.00000000000000e+00 +776 -5.00000000000000e-01 +777 0.00000000000000e+00 +778 1.00000000000000e+00 +779 -1.00000000000000e+00 +780 0.00000000000000e+00 +781 1.00000000000000e+00 +782 -1.00000000000000e+00 +783 0.00000000000000e+00 +784 0.00000000000000e+00 +785 0.00000000000000e+00 +786 0.00000000000000e+00 +787 0.00000000000000e+00 +788 -2.50000000000000e-01 +789 0.00000000000000e+00 +790 2.50000000000000e-01 +791 0.00000000000000e+00 +792 0.00000000000000e+00 +793 2.50000000000000e-01 +794 -2.50000000000000e-01 +795 0.00000000000000e+00 +796 0.00000000000000e+00 +797 0.00000000000000e+00 +798 0.00000000000000e+00 +799 0.00000000000000e+00 +800 0.00000000000000e+00 +801 0.00000000000000e+00 +802 0.00000000000000e+00 +803 -2.50000000000000e-01 +804 0.00000000000000e+00 +805 0.00000000000000e+00 +806 -2.50000000000000e-01 +807 0.00000000000000e+00 +808 2.50000000000000e-01 +809 0.00000000000000e+00 +810 0.00000000000000e+00 +811 2.50000000000000e-01 +812 0.00000000000000e+00 +813 0.00000000000000e+00 +814 2.50000000000000e-01 +815 -2.50000000000000e-01 +816 0.00000000000000e+00 +817 2.50000000000000e-01 +818 -2.50000000000000e-01 +819 0.00000000000000e+00 +820 0.00000000000000e+00 +821 0.00000000000000e+00 +822 0.00000000000000e+00 +823 0.00000000000000e+00 +824 -2.50000000000000e-01 +825 0.00000000000000e+00 +826 2.50000000000000e-01 +827 0.00000000000000e+00 +828 0.00000000000000e+00 +829 2.50000000000000e-01 +830 -2.50000000000000e-01 +831 0.00000000000000e+00 +832 0.00000000000000e+00 +833 -1.00000000000000e+00 +834 0.00000000000000e+00 +835 2.50000000000000e-01 +836 -1.00000000000000e+00 +837 0.00000000000000e+00 +838 0.00000000000000e+00 +839 -7.50000000000000e-01 +840 0.00000000000000e+00 +841 0.00000000000000e+00 +842 -7.50000000000000e-01 +843 0.00000000000000e+00 +844 0.00000000000000e+00 +845 -1.00000000000000e+00 +846 0.00000000000000e+00 +847 0.00000000000000e+00 +848 -1.00000000000000e+00 +849 0.00000000000000e+00 +850 2.50000000000000e-01 +851 -1.00000000000000e+00 +852 0.00000000000000e+00 +853 2.50000000000000e-01 +854 -1.00000000000000e+00 +855 0.00000000000000e+00 +856 0.00000000000000e+00 +857 -7.50000000000000e-01 +858 0.00000000000000e+00 +859 0.00000000000000e+00 +860 -7.50000000000000e-01 +861 0.00000000000000e+00 +862 0.00000000000000e+00 +863 -1.00000000000000e+00 +864 0.00000000000000e+00 +865 2.50000000000000e-01 +866 -1.00000000000000e+00 +867 0.00000000000000e+00 +868 1.00000000000000e+00 +869 0.00000000000000e+00 +870 0.00000000000000e+00 +871 1.00000000000000e+00 +872 -2.50000000000000e-01 +873 0.00000000000000e+00 +874 7.50000000000000e-01 +875 0.00000000000000e+00 +876 0.00000000000000e+00 +877 7.50000000000000e-01 +878 0.00000000000000e+00 +879 0.00000000000000e+00 +880 1.00000000000000e+00 +881 0.00000000000000e+00 +882 0.00000000000000e+00 +883 1.00000000000000e+00 +884 0.00000000000000e+00 +885 0.00000000000000e+00 +886 1.00000000000000e+00 +887 -2.50000000000000e-01 +888 0.00000000000000e+00 +889 1.00000000000000e+00 +890 -2.50000000000000e-01 +891 0.00000000000000e+00 +892 7.50000000000000e-01 +893 0.00000000000000e+00 +894 0.00000000000000e+00 +895 7.50000000000000e-01 +896 0.00000000000000e+00 +897 0.00000000000000e+00 +898 1.00000000000000e+00 +899 0.00000000000000e+00 +900 0.00000000000000e+00 +901 1.00000000000000e+00 +902 -2.50000000000000e-01 +903 0.00000000000000e+00 +904 1.00000000000000e+00 +905 -1.00000000000000e+00 +906 0.00000000000000e+00 +907 7.50000000000000e-01 +908 -7.50000000000000e-01 +909 0.00000000000000e+00 +910 7.50000000000000e-01 +911 -7.50000000000000e-01 +912 0.00000000000000e+00 +913 7.50000000000000e-01 +914 -1.00000000000000e+00 +915 0.00000000000000e+00 +916 7.50000000000000e-01 +917 -1.00000000000000e+00 +918 0.00000000000000e+00 +919 1.00000000000000e+00 +920 -7.50000000000000e-01 +921 0.00000000000000e+00 +922 1.00000000000000e+00 +923 -7.50000000000000e-01 +924 0.00000000000000e+00 +925 1.00000000000000e+00 +926 -1.00000000000000e+00 +927 0.00000000000000e+00 +928 1.00000000000000e+00 +929 -1.00000000000000e+00 +930 0.00000000000000e+00 +931 7.50000000000000e-01 +932 -7.50000000000000e-01 +933 0.00000000000000e+00 +934 7.50000000000000e-01 +935 -7.50000000000000e-01 +936 0.00000000000000e+00 +937 7.50000000000000e-01 +938 -1.00000000000000e+00 +939 0.00000000000000e+00 +940 7.50000000000000e-01 +941 -1.00000000000000e+00 +942 0.00000000000000e+00 +943 1.00000000000000e+00 +944 -7.50000000000000e-01 +945 0.00000000000000e+00 +946 1.00000000000000e+00 +947 -7.50000000000000e-01 +948 0.00000000000000e+00 +949 1.00000000000000e+00 +950 -1.00000000000000e+00 +951 0.00000000000000e+00 +952 0.00000000000000e+00 +953 -2.50000000000000e-01 +954 0.00000000000000e+00 +955 2.50000000000000e-01 +956 0.00000000000000e+00 +957 0.00000000000000e+00 +958 2.50000000000000e-01 +959 -2.50000000000000e-01 +960 0.00000000000000e+00 +961 0.00000000000000e+00 +962 -2.50000000000000e-01 +963 0.00000000000000e+00 +964 2.50000000000000e-01 +965 0.00000000000000e+00 +966 0.00000000000000e+00 +967 2.50000000000000e-01 +968 -2.50000000000000e-01 +969 0.00000000000000e+00 +970 0.00000000000000e+00 +971 -5.00000000000000e-01 +972 0.00000000000000e+00 +973 2.50000000000000e-01 +974 -5.00000000000000e-01 +975 0.00000000000000e+00 +976 0.00000000000000e+00 +977 -7.50000000000000e-01 +978 0.00000000000000e+00 +979 2.50000000000000e-01 +980 -7.50000000000000e-01 +981 0.00000000000000e+00 +982 2.50000000000000e-01 +983 -5.00000000000000e-01 +984 0.00000000000000e+00 +985 0.00000000000000e+00 +986 -5.00000000000000e-01 +987 0.00000000000000e+00 +988 2.50000000000000e-01 +989 -5.00000000000000e-01 +990 0.00000000000000e+00 +991 0.00000000000000e+00 +992 -7.50000000000000e-01 +993 0.00000000000000e+00 +994 2.50000000000000e-01 +995 -7.50000000000000e-01 +996 0.00000000000000e+00 +997 2.50000000000000e-01 +998 -7.50000000000000e-01 +999 0.00000000000000e+00 +1000 5.00000000000000e-01 +1001 0.00000000000000e+00 +1002 0.00000000000000e+00 +1003 5.00000000000000e-01 +1004 -2.50000000000000e-01 +1005 0.00000000000000e+00 +1006 7.50000000000000e-01 +1007 0.00000000000000e+00 +1008 0.00000000000000e+00 +1009 7.50000000000000e-01 +1010 -2.50000000000000e-01 +1011 0.00000000000000e+00 +1012 5.00000000000000e-01 +1013 -2.50000000000000e-01 +1014 0.00000000000000e+00 +1015 5.00000000000000e-01 +1016 0.00000000000000e+00 +1017 0.00000000000000e+00 +1018 5.00000000000000e-01 +1019 -2.50000000000000e-01 +1020 0.00000000000000e+00 +1021 7.50000000000000e-01 +1022 0.00000000000000e+00 +1023 0.00000000000000e+00 +1024 7.50000000000000e-01 +1025 -2.50000000000000e-01 +1026 0.00000000000000e+00 +1027 7.50000000000000e-01 +1028 -2.50000000000000e-01 +1029 0.00000000000000e+00 +1030 5.00000000000000e-01 +1031 -5.00000000000000e-01 +1032 0.00000000000000e+00 +1033 5.00000000000000e-01 +1034 -7.50000000000000e-01 +1035 0.00000000000000e+00 +1036 7.50000000000000e-01 +1037 -5.00000000000000e-01 +1038 0.00000000000000e+00 +1039 7.50000000000000e-01 +1040 -7.50000000000000e-01 +1041 0.00000000000000e+00 +1042 5.00000000000000e-01 +1043 -5.00000000000000e-01 +1044 0.00000000000000e+00 +1045 5.00000000000000e-01 +1046 -7.50000000000000e-01 +1047 0.00000000000000e+00 +1048 5.00000000000000e-01 +1049 -7.50000000000000e-01 +1050 0.00000000000000e+00 +1051 7.50000000000000e-01 +1052 -5.00000000000000e-01 +1053 0.00000000000000e+00 +1054 7.50000000000000e-01 +1055 -5.00000000000000e-01 +1056 0.00000000000000e+00 +1057 7.50000000000000e-01 +1058 -7.50000000000000e-01 +1059 0.00000000000000e+00 +1060 0.00000000000000e+00 +1061 -2.50000000000000e-01 +1062 0.00000000000000e+00 +1063 2.50000000000000e-01 +1064 0.00000000000000e+00 +1065 0.00000000000000e+00 +1066 2.50000000000000e-01 +1067 -2.50000000000000e-01 +1068 0.00000000000000e+00 +1069 0.00000000000000e+00 +1070 -2.50000000000000e-01 +1071 0.00000000000000e+00 +1072 2.50000000000000e-01 +1073 0.00000000000000e+00 +1074 0.00000000000000e+00 +1075 2.50000000000000e-01 +1076 -2.50000000000000e-01 +1077 0.00000000000000e+00 +1078 0.00000000000000e+00 +1079 -5.00000000000000e-01 +1080 0.00000000000000e+00 +1081 2.50000000000000e-01 +1082 -5.00000000000000e-01 +1083 0.00000000000000e+00 +1084 2.50000000000000e-01 +1085 -5.00000000000000e-01 +1086 0.00000000000000e+00 +1087 0.00000000000000e+00 +1088 -7.50000000000000e-01 +1089 0.00000000000000e+00 +1090 2.50000000000000e-01 +1091 -7.50000000000000e-01 +1092 0.00000000000000e+00 +1093 2.50000000000000e-01 +1094 -7.50000000000000e-01 +1095 0.00000000000000e+00 +1096 2.50000000000000e-01 +1097 -5.00000000000000e-01 +1098 0.00000000000000e+00 +1099 0.00000000000000e+00 +1100 -5.00000000000000e-01 +1101 0.00000000000000e+00 +1102 2.50000000000000e-01 +1103 -5.00000000000000e-01 +1104 0.00000000000000e+00 +1105 0.00000000000000e+00 +1106 -7.50000000000000e-01 +1107 0.00000000000000e+00 +1108 2.50000000000000e-01 +1109 -7.50000000000000e-01 +1110 0.00000000000000e+00 +1111 2.50000000000000e-01 +1112 -7.50000000000000e-01 +1113 0.00000000000000e+00 +1114 5.00000000000000e-01 +1115 0.00000000000000e+00 +1116 0.00000000000000e+00 +1117 5.00000000000000e-01 +1118 -2.50000000000000e-01 +1119 0.00000000000000e+00 +1120 5.00000000000000e-01 +1121 -2.50000000000000e-01 +1122 0.00000000000000e+00 +1123 7.50000000000000e-01 +1124 0.00000000000000e+00 +1125 0.00000000000000e+00 +1126 7.50000000000000e-01 +1127 -2.50000000000000e-01 +1128 0.00000000000000e+00 +1129 7.50000000000000e-01 +1130 -2.50000000000000e-01 +1131 0.00000000000000e+00 +1132 5.00000000000000e-01 +1133 -2.50000000000000e-01 +1134 0.00000000000000e+00 +1135 5.00000000000000e-01 +1136 0.00000000000000e+00 +1137 0.00000000000000e+00 +1138 5.00000000000000e-01 +1139 -2.50000000000000e-01 +1140 0.00000000000000e+00 +1141 7.50000000000000e-01 +1142 0.00000000000000e+00 +1143 0.00000000000000e+00 +1144 7.50000000000000e-01 +1145 -2.50000000000000e-01 +1146 0.00000000000000e+00 +1147 7.50000000000000e-01 +1148 -2.50000000000000e-01 +1149 0.00000000000000e+00 +1150 5.00000000000000e-01 +1151 -5.00000000000000e-01 +1152 0.00000000000000e+00 +1153 5.00000000000000e-01 +1154 -7.50000000000000e-01 +1155 0.00000000000000e+00 +1156 5.00000000000000e-01 +1157 -7.50000000000000e-01 +1158 0.00000000000000e+00 +1159 7.50000000000000e-01 +1160 -5.00000000000000e-01 +1161 0.00000000000000e+00 +1162 7.50000000000000e-01 +1163 -5.00000000000000e-01 +1164 0.00000000000000e+00 +1165 7.50000000000000e-01 +1166 -7.50000000000000e-01 +1167 0.00000000000000e+00 +1168 5.00000000000000e-01 +1169 -5.00000000000000e-01 +1170 0.00000000000000e+00 +1171 5.00000000000000e-01 +1172 -7.50000000000000e-01 +1173 0.00000000000000e+00 +1174 5.00000000000000e-01 +1175 -7.50000000000000e-01 +1176 0.00000000000000e+00 +1177 7.50000000000000e-01 +1178 -5.00000000000000e-01 +1179 0.00000000000000e+00 +1180 7.50000000000000e-01 +1181 -5.00000000000000e-01 +1182 0.00000000000000e+00 +1183 7.50000000000000e-01 +1184 -7.50000000000000e-01 +1185 0.00000000000000e+00 +1186 2.50000000000000e-01 +1187 -5.00000000000000e-01 +1188 0.00000000000000e+00 +1189 2.50000000000000e-01 +1190 -7.50000000000000e-01 +1191 0.00000000000000e+00 +1192 5.00000000000000e-01 +1193 -2.50000000000000e-01 +1194 0.00000000000000e+00 +1195 7.50000000000000e-01 +1196 -2.50000000000000e-01 +1197 0.00000000000000e+00 +1198 5.00000000000000e-01 +1199 -7.50000000000000e-01 +1200 0.00000000000000e+00 +1201 7.50000000000000e-01 +1202 -5.00000000000000e-01 +1203 0.00000000000000e+00 +1204 2.50000000000000e-01 +1205 -1.00000000000000e+00 +1206 0.00000000000000e+00 +1207 2.50000000000000e-01 +1208 -1.00000000000000e+00 +1209 0.00000000000000e+00 +1210 5.00000000000000e-01 +1211 -1.00000000000000e+00 +1212 0.00000000000000e+00 +1213 7.50000000000000e-01 +1214 -1.00000000000000e+00 +1215 0.00000000000000e+00 +1216 5.00000000000000e-01 +1217 -1.00000000000000e+00 +1218 0.00000000000000e+00 +1219 7.50000000000000e-01 +1220 -1.00000000000000e+00 +1221 0.00000000000000e+00 +1222 2.50000000000000e-01 +1223 -1.00000000000000e+00 +1224 0.00000000000000e+00 +1225 2.50000000000000e-01 +1226 -1.00000000000000e+00 +1227 0.00000000000000e+00 +1228 5.00000000000000e-01 +1229 -1.00000000000000e+00 +1230 0.00000000000000e+00 +1231 7.50000000000000e-01 +1232 -1.00000000000000e+00 +1233 0.00000000000000e+00 +1234 5.00000000000000e-01 +1235 -1.00000000000000e+00 +1236 0.00000000000000e+00 +1237 7.50000000000000e-01 +1238 -1.00000000000000e+00 +1239 0.00000000000000e+00 +1240 1.00000000000000e+00 +1241 -2.50000000000000e-01 +1242 0.00000000000000e+00 +1243 1.00000000000000e+00 +1244 -2.50000000000000e-01 +1245 0.00000000000000e+00 +1246 1.00000000000000e+00 +1247 -5.00000000000000e-01 +1248 0.00000000000000e+00 +1249 1.00000000000000e+00 +1250 -7.50000000000000e-01 +1251 0.00000000000000e+00 +1252 1.00000000000000e+00 +1253 -5.00000000000000e-01 +1254 0.00000000000000e+00 +1255 1.00000000000000e+00 +1256 -7.50000000000000e-01 +1257 0.00000000000000e+00 +1258 1.00000000000000e+00 +1259 -2.50000000000000e-01 +1260 0.00000000000000e+00 +1261 1.00000000000000e+00 +1262 -2.50000000000000e-01 +1263 0.00000000000000e+00 +1264 1.00000000000000e+00 +1265 -5.00000000000000e-01 +1266 0.00000000000000e+00 +1267 1.00000000000000e+00 +1268 -7.50000000000000e-01 +1269 0.00000000000000e+00 +1270 1.00000000000000e+00 +1271 -5.00000000000000e-01 +1272 0.00000000000000e+00 +1273 1.00000000000000e+00 +1274 -7.50000000000000e-01 diff --git a/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.1.00002 b/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.1.00002 new file mode 100644 index 00000000..d144d25c --- /dev/null +++ b/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.1.00002 @@ -0,0 +1,601 @@ +1275 1875 +1275 0.00000000000000e+00 +1276 0.00000000000000e+00 +1277 0.00000000000000e+00 +1278 0.00000000000000e+00 +1279 0.00000000000000e+00 +1280 0.00000000000000e+00 +1281 0.00000000000000e+00 +1282 0.00000000000000e+00 +1283 -1.00000000000000e+00 +1284 0.00000000000000e+00 +1285 0.00000000000000e+00 +1286 -1.00000000000000e+00 +1287 0.00000000000000e+00 +1288 1.00000000000000e+00 +1289 0.00000000000000e+00 +1290 0.00000000000000e+00 +1291 1.00000000000000e+00 +1292 0.00000000000000e+00 +1293 0.00000000000000e+00 +1294 1.00000000000000e+00 +1295 -1.00000000000000e+00 +1296 0.00000000000000e+00 +1297 1.00000000000000e+00 +1298 -1.00000000000000e+00 +1299 0.00000000000000e+00 +1300 0.00000000000000e+00 +1301 0.00000000000000e+00 +1302 0.00000000000000e+00 +1303 0.00000000000000e+00 +1304 -5.00000000000000e-01 +1305 0.00000000000000e+00 +1306 0.00000000000000e+00 +1307 -5.00000000000000e-01 +1308 0.00000000000000e+00 +1309 5.00000000000000e-01 +1310 0.00000000000000e+00 +1311 0.00000000000000e+00 +1312 5.00000000000000e-01 +1313 0.00000000000000e+00 +1314 0.00000000000000e+00 +1315 5.00000000000000e-01 +1316 -5.00000000000000e-01 +1317 0.00000000000000e+00 +1318 5.00000000000000e-01 +1319 -5.00000000000000e-01 +1320 0.00000000000000e+00 +1321 0.00000000000000e+00 +1322 0.00000000000000e+00 +1323 0.00000000000000e+00 +1324 0.00000000000000e+00 +1325 -5.00000000000000e-01 +1326 0.00000000000000e+00 +1327 0.00000000000000e+00 +1328 -5.00000000000000e-01 +1329 0.00000000000000e+00 +1330 5.00000000000000e-01 +1331 0.00000000000000e+00 +1332 0.00000000000000e+00 +1333 5.00000000000000e-01 +1334 0.00000000000000e+00 +1335 0.00000000000000e+00 +1336 5.00000000000000e-01 +1337 -5.00000000000000e-01 +1338 0.00000000000000e+00 +1339 5.00000000000000e-01 +1340 -5.00000000000000e-01 +1341 0.00000000000000e+00 +1342 0.00000000000000e+00 +1343 -1.00000000000000e+00 +1344 0.00000000000000e+00 +1345 5.00000000000000e-01 +1346 -1.00000000000000e+00 +1347 0.00000000000000e+00 +1348 5.00000000000000e-01 +1349 -1.00000000000000e+00 +1350 0.00000000000000e+00 +1351 0.00000000000000e+00 +1352 -1.00000000000000e+00 +1353 0.00000000000000e+00 +1354 5.00000000000000e-01 +1355 -1.00000000000000e+00 +1356 0.00000000000000e+00 +1357 5.00000000000000e-01 +1358 -1.00000000000000e+00 +1359 0.00000000000000e+00 +1360 1.00000000000000e+00 +1361 0.00000000000000e+00 +1362 0.00000000000000e+00 +1363 1.00000000000000e+00 +1364 -5.00000000000000e-01 +1365 0.00000000000000e+00 +1366 1.00000000000000e+00 +1367 -5.00000000000000e-01 +1368 0.00000000000000e+00 +1369 1.00000000000000e+00 +1370 0.00000000000000e+00 +1371 0.00000000000000e+00 +1372 1.00000000000000e+00 +1373 -5.00000000000000e-01 +1374 0.00000000000000e+00 +1375 1.00000000000000e+00 +1376 -5.00000000000000e-01 +1377 0.00000000000000e+00 +1378 1.00000000000000e+00 +1379 -1.00000000000000e+00 +1380 0.00000000000000e+00 +1381 1.00000000000000e+00 +1382 -1.00000000000000e+00 +1383 0.00000000000000e+00 +1384 0.00000000000000e+00 +1385 0.00000000000000e+00 +1386 0.00000000000000e+00 +1387 0.00000000000000e+00 +1388 -2.50000000000000e-01 +1389 0.00000000000000e+00 +1390 0.00000000000000e+00 +1391 -2.50000000000000e-01 +1392 0.00000000000000e+00 +1393 2.50000000000000e-01 +1394 0.00000000000000e+00 +1395 0.00000000000000e+00 +1396 2.50000000000000e-01 +1397 0.00000000000000e+00 +1398 0.00000000000000e+00 +1399 2.50000000000000e-01 +1400 -2.50000000000000e-01 +1401 0.00000000000000e+00 +1402 2.50000000000000e-01 +1403 -2.50000000000000e-01 +1404 0.00000000000000e+00 +1405 0.00000000000000e+00 +1406 0.00000000000000e+00 +1407 0.00000000000000e+00 +1408 0.00000000000000e+00 +1409 0.00000000000000e+00 +1410 0.00000000000000e+00 +1411 0.00000000000000e+00 +1412 -2.50000000000000e-01 +1413 0.00000000000000e+00 +1414 0.00000000000000e+00 +1415 -2.50000000000000e-01 +1416 0.00000000000000e+00 +1417 2.50000000000000e-01 +1418 0.00000000000000e+00 +1419 0.00000000000000e+00 +1420 2.50000000000000e-01 +1421 0.00000000000000e+00 +1422 0.00000000000000e+00 +1423 2.50000000000000e-01 +1424 -2.50000000000000e-01 +1425 0.00000000000000e+00 +1426 2.50000000000000e-01 +1427 -2.50000000000000e-01 +1428 0.00000000000000e+00 +1429 0.00000000000000e+00 +1430 0.00000000000000e+00 +1431 0.00000000000000e+00 +1432 0.00000000000000e+00 +1433 -7.50000000000000e-01 +1434 0.00000000000000e+00 +1435 0.00000000000000e+00 +1436 -1.00000000000000e+00 +1437 0.00000000000000e+00 +1438 2.50000000000000e-01 +1439 -1.00000000000000e+00 +1440 0.00000000000000e+00 +1441 2.50000000000000e-01 +1442 -1.00000000000000e+00 +1443 0.00000000000000e+00 +1444 0.00000000000000e+00 +1445 -7.50000000000000e-01 +1446 0.00000000000000e+00 +1447 0.00000000000000e+00 +1448 -7.50000000000000e-01 +1449 0.00000000000000e+00 +1450 0.00000000000000e+00 +1451 -1.00000000000000e+00 +1452 0.00000000000000e+00 +1453 0.00000000000000e+00 +1454 -1.00000000000000e+00 +1455 0.00000000000000e+00 +1456 2.50000000000000e-01 +1457 -1.00000000000000e+00 +1458 0.00000000000000e+00 +1459 2.50000000000000e-01 +1460 -1.00000000000000e+00 +1461 0.00000000000000e+00 +1462 0.00000000000000e+00 +1463 -7.50000000000000e-01 +1464 0.00000000000000e+00 +1465 0.00000000000000e+00 +1466 -1.00000000000000e+00 +1467 0.00000000000000e+00 +1468 7.50000000000000e-01 +1469 0.00000000000000e+00 +1470 0.00000000000000e+00 +1471 1.00000000000000e+00 +1472 0.00000000000000e+00 +1473 0.00000000000000e+00 +1474 1.00000000000000e+00 +1475 -2.50000000000000e-01 +1476 0.00000000000000e+00 +1477 1.00000000000000e+00 +1478 -2.50000000000000e-01 +1479 0.00000000000000e+00 +1480 7.50000000000000e-01 +1481 0.00000000000000e+00 +1482 0.00000000000000e+00 +1483 7.50000000000000e-01 +1484 0.00000000000000e+00 +1485 0.00000000000000e+00 +1486 1.00000000000000e+00 +1487 0.00000000000000e+00 +1488 0.00000000000000e+00 +1489 1.00000000000000e+00 +1490 0.00000000000000e+00 +1491 0.00000000000000e+00 +1492 1.00000000000000e+00 +1493 -2.50000000000000e-01 +1494 0.00000000000000e+00 +1495 1.00000000000000e+00 +1496 -2.50000000000000e-01 +1497 0.00000000000000e+00 +1498 7.50000000000000e-01 +1499 0.00000000000000e+00 +1500 0.00000000000000e+00 +1501 1.00000000000000e+00 +1502 0.00000000000000e+00 +1503 0.00000000000000e+00 +1504 7.50000000000000e-01 +1505 -7.50000000000000e-01 +1506 0.00000000000000e+00 +1507 7.50000000000000e-01 +1508 -1.00000000000000e+00 +1509 0.00000000000000e+00 +1510 1.00000000000000e+00 +1511 -7.50000000000000e-01 +1512 0.00000000000000e+00 +1513 1.00000000000000e+00 +1514 -1.00000000000000e+00 +1515 0.00000000000000e+00 +1516 7.50000000000000e-01 +1517 -7.50000000000000e-01 +1518 0.00000000000000e+00 +1519 7.50000000000000e-01 +1520 -7.50000000000000e-01 +1521 0.00000000000000e+00 +1522 7.50000000000000e-01 +1523 -1.00000000000000e+00 +1524 0.00000000000000e+00 +1525 7.50000000000000e-01 +1526 -1.00000000000000e+00 +1527 0.00000000000000e+00 +1528 1.00000000000000e+00 +1529 -7.50000000000000e-01 +1530 0.00000000000000e+00 +1531 1.00000000000000e+00 +1532 -7.50000000000000e-01 +1533 0.00000000000000e+00 +1534 1.00000000000000e+00 +1535 -1.00000000000000e+00 +1536 0.00000000000000e+00 +1537 1.00000000000000e+00 +1538 -1.00000000000000e+00 +1539 0.00000000000000e+00 +1540 7.50000000000000e-01 +1541 -7.50000000000000e-01 +1542 0.00000000000000e+00 +1543 7.50000000000000e-01 +1544 -1.00000000000000e+00 +1545 0.00000000000000e+00 +1546 1.00000000000000e+00 +1547 -7.50000000000000e-01 +1548 0.00000000000000e+00 +1549 1.00000000000000e+00 +1550 -1.00000000000000e+00 +1551 0.00000000000000e+00 +1552 0.00000000000000e+00 +1553 -2.50000000000000e-01 +1554 0.00000000000000e+00 +1555 2.50000000000000e-01 +1556 0.00000000000000e+00 +1557 0.00000000000000e+00 +1558 2.50000000000000e-01 +1559 -2.50000000000000e-01 +1560 0.00000000000000e+00 +1561 0.00000000000000e+00 +1562 -2.50000000000000e-01 +1563 0.00000000000000e+00 +1564 2.50000000000000e-01 +1565 0.00000000000000e+00 +1566 0.00000000000000e+00 +1567 2.50000000000000e-01 +1568 -2.50000000000000e-01 +1569 0.00000000000000e+00 +1570 0.00000000000000e+00 +1571 -5.00000000000000e-01 +1572 0.00000000000000e+00 +1573 2.50000000000000e-01 +1574 -5.00000000000000e-01 +1575 0.00000000000000e+00 +1576 2.50000000000000e-01 +1577 -5.00000000000000e-01 +1578 0.00000000000000e+00 +1579 0.00000000000000e+00 +1580 -7.50000000000000e-01 +1581 0.00000000000000e+00 +1582 2.50000000000000e-01 +1583 -7.50000000000000e-01 +1584 0.00000000000000e+00 +1585 2.50000000000000e-01 +1586 -7.50000000000000e-01 +1587 0.00000000000000e+00 +1588 2.50000000000000e-01 +1589 -5.00000000000000e-01 +1590 0.00000000000000e+00 +1591 0.00000000000000e+00 +1592 -5.00000000000000e-01 +1593 0.00000000000000e+00 +1594 2.50000000000000e-01 +1595 -5.00000000000000e-01 +1596 0.00000000000000e+00 +1597 0.00000000000000e+00 +1598 -7.50000000000000e-01 +1599 0.00000000000000e+00 +1600 2.50000000000000e-01 +1601 -7.50000000000000e-01 +1602 0.00000000000000e+00 +1603 2.50000000000000e-01 +1604 -7.50000000000000e-01 +1605 0.00000000000000e+00 +1606 5.00000000000000e-01 +1607 0.00000000000000e+00 +1608 0.00000000000000e+00 +1609 5.00000000000000e-01 +1610 -2.50000000000000e-01 +1611 0.00000000000000e+00 +1612 5.00000000000000e-01 +1613 -2.50000000000000e-01 +1614 0.00000000000000e+00 +1615 7.50000000000000e-01 +1616 0.00000000000000e+00 +1617 0.00000000000000e+00 +1618 7.50000000000000e-01 +1619 -2.50000000000000e-01 +1620 0.00000000000000e+00 +1621 7.50000000000000e-01 +1622 -2.50000000000000e-01 +1623 0.00000000000000e+00 +1624 5.00000000000000e-01 +1625 -2.50000000000000e-01 +1626 0.00000000000000e+00 +1627 5.00000000000000e-01 +1628 0.00000000000000e+00 +1629 0.00000000000000e+00 +1630 5.00000000000000e-01 +1631 -2.50000000000000e-01 +1632 0.00000000000000e+00 +1633 7.50000000000000e-01 +1634 0.00000000000000e+00 +1635 0.00000000000000e+00 +1636 7.50000000000000e-01 +1637 -2.50000000000000e-01 +1638 0.00000000000000e+00 +1639 7.50000000000000e-01 +1640 -2.50000000000000e-01 +1641 0.00000000000000e+00 +1642 5.00000000000000e-01 +1643 -5.00000000000000e-01 +1644 0.00000000000000e+00 +1645 5.00000000000000e-01 +1646 -7.50000000000000e-01 +1647 0.00000000000000e+00 +1648 5.00000000000000e-01 +1649 -7.50000000000000e-01 +1650 0.00000000000000e+00 +1651 7.50000000000000e-01 +1652 -5.00000000000000e-01 +1653 0.00000000000000e+00 +1654 7.50000000000000e-01 +1655 -5.00000000000000e-01 +1656 0.00000000000000e+00 +1657 7.50000000000000e-01 +1658 -7.50000000000000e-01 +1659 0.00000000000000e+00 +1660 5.00000000000000e-01 +1661 -5.00000000000000e-01 +1662 0.00000000000000e+00 +1663 5.00000000000000e-01 +1664 -7.50000000000000e-01 +1665 0.00000000000000e+00 +1666 5.00000000000000e-01 +1667 -7.50000000000000e-01 +1668 0.00000000000000e+00 +1669 7.50000000000000e-01 +1670 -5.00000000000000e-01 +1671 0.00000000000000e+00 +1672 7.50000000000000e-01 +1673 -5.00000000000000e-01 +1674 0.00000000000000e+00 +1675 7.50000000000000e-01 +1676 -7.50000000000000e-01 +1677 0.00000000000000e+00 +1678 0.00000000000000e+00 +1679 -2.50000000000000e-01 +1680 0.00000000000000e+00 +1681 2.50000000000000e-01 +1682 0.00000000000000e+00 +1683 0.00000000000000e+00 +1684 2.50000000000000e-01 +1685 -2.50000000000000e-01 +1686 0.00000000000000e+00 +1687 0.00000000000000e+00 +1688 -2.50000000000000e-01 +1689 0.00000000000000e+00 +1690 2.50000000000000e-01 +1691 0.00000000000000e+00 +1692 0.00000000000000e+00 +1693 2.50000000000000e-01 +1694 -2.50000000000000e-01 +1695 0.00000000000000e+00 +1696 0.00000000000000e+00 +1697 -5.00000000000000e-01 +1698 0.00000000000000e+00 +1699 2.50000000000000e-01 +1700 -5.00000000000000e-01 +1701 0.00000000000000e+00 +1702 2.50000000000000e-01 +1703 -5.00000000000000e-01 +1704 0.00000000000000e+00 +1705 0.00000000000000e+00 +1706 -7.50000000000000e-01 +1707 0.00000000000000e+00 +1708 2.50000000000000e-01 +1709 -7.50000000000000e-01 +1710 0.00000000000000e+00 +1711 2.50000000000000e-01 +1712 -7.50000000000000e-01 +1713 0.00000000000000e+00 +1714 2.50000000000000e-01 +1715 -5.00000000000000e-01 +1716 0.00000000000000e+00 +1717 0.00000000000000e+00 +1718 -5.00000000000000e-01 +1719 0.00000000000000e+00 +1720 2.50000000000000e-01 +1721 -5.00000000000000e-01 +1722 0.00000000000000e+00 +1723 0.00000000000000e+00 +1724 -7.50000000000000e-01 +1725 0.00000000000000e+00 +1726 2.50000000000000e-01 +1727 -7.50000000000000e-01 +1728 0.00000000000000e+00 +1729 2.50000000000000e-01 +1730 -7.50000000000000e-01 +1731 0.00000000000000e+00 +1732 5.00000000000000e-01 +1733 0.00000000000000e+00 +1734 0.00000000000000e+00 +1735 5.00000000000000e-01 +1736 -2.50000000000000e-01 +1737 0.00000000000000e+00 +1738 5.00000000000000e-01 +1739 -2.50000000000000e-01 +1740 0.00000000000000e+00 +1741 7.50000000000000e-01 +1742 0.00000000000000e+00 +1743 0.00000000000000e+00 +1744 7.50000000000000e-01 +1745 -2.50000000000000e-01 +1746 0.00000000000000e+00 +1747 7.50000000000000e-01 +1748 -2.50000000000000e-01 +1749 0.00000000000000e+00 +1750 5.00000000000000e-01 +1751 -2.50000000000000e-01 +1752 0.00000000000000e+00 +1753 5.00000000000000e-01 +1754 0.00000000000000e+00 +1755 0.00000000000000e+00 +1756 5.00000000000000e-01 +1757 -2.50000000000000e-01 +1758 0.00000000000000e+00 +1759 7.50000000000000e-01 +1760 0.00000000000000e+00 +1761 0.00000000000000e+00 +1762 7.50000000000000e-01 +1763 -2.50000000000000e-01 +1764 0.00000000000000e+00 +1765 7.50000000000000e-01 +1766 -2.50000000000000e-01 +1767 0.00000000000000e+00 +1768 5.00000000000000e-01 +1769 -5.00000000000000e-01 +1770 0.00000000000000e+00 +1771 5.00000000000000e-01 +1772 -7.50000000000000e-01 +1773 0.00000000000000e+00 +1774 5.00000000000000e-01 +1775 -7.50000000000000e-01 +1776 0.00000000000000e+00 +1777 7.50000000000000e-01 +1778 -5.00000000000000e-01 +1779 0.00000000000000e+00 +1780 7.50000000000000e-01 +1781 -5.00000000000000e-01 +1782 0.00000000000000e+00 +1783 7.50000000000000e-01 +1784 -7.50000000000000e-01 +1785 0.00000000000000e+00 +1786 5.00000000000000e-01 +1787 -5.00000000000000e-01 +1788 0.00000000000000e+00 +1789 5.00000000000000e-01 +1790 -7.50000000000000e-01 +1791 0.00000000000000e+00 +1792 5.00000000000000e-01 +1793 -7.50000000000000e-01 +1794 0.00000000000000e+00 +1795 7.50000000000000e-01 +1796 -5.00000000000000e-01 +1797 0.00000000000000e+00 +1798 7.50000000000000e-01 +1799 -5.00000000000000e-01 +1800 0.00000000000000e+00 +1801 7.50000000000000e-01 +1802 -7.50000000000000e-01 +1803 0.00000000000000e+00 +1804 2.50000000000000e-01 +1805 -1.00000000000000e+00 +1806 0.00000000000000e+00 +1807 2.50000000000000e-01 +1808 -1.00000000000000e+00 +1809 0.00000000000000e+00 +1810 5.00000000000000e-01 +1811 -1.00000000000000e+00 +1812 0.00000000000000e+00 +1813 7.50000000000000e-01 +1814 -1.00000000000000e+00 +1815 0.00000000000000e+00 +1816 5.00000000000000e-01 +1817 -1.00000000000000e+00 +1818 0.00000000000000e+00 +1819 7.50000000000000e-01 +1820 -1.00000000000000e+00 +1821 0.00000000000000e+00 +1822 2.50000000000000e-01 +1823 -1.00000000000000e+00 +1824 0.00000000000000e+00 +1825 2.50000000000000e-01 +1826 -1.00000000000000e+00 +1827 0.00000000000000e+00 +1828 5.00000000000000e-01 +1829 -1.00000000000000e+00 +1830 0.00000000000000e+00 +1831 7.50000000000000e-01 +1832 -1.00000000000000e+00 +1833 0.00000000000000e+00 +1834 5.00000000000000e-01 +1835 -1.00000000000000e+00 +1836 0.00000000000000e+00 +1837 7.50000000000000e-01 +1838 -1.00000000000000e+00 +1839 0.00000000000000e+00 +1840 1.00000000000000e+00 +1841 -2.50000000000000e-01 +1842 0.00000000000000e+00 +1843 1.00000000000000e+00 +1844 -2.50000000000000e-01 +1845 0.00000000000000e+00 +1846 1.00000000000000e+00 +1847 -5.00000000000000e-01 +1848 0.00000000000000e+00 +1849 1.00000000000000e+00 +1850 -7.50000000000000e-01 +1851 0.00000000000000e+00 +1852 1.00000000000000e+00 +1853 -5.00000000000000e-01 +1854 0.00000000000000e+00 +1855 1.00000000000000e+00 +1856 -7.50000000000000e-01 +1857 0.00000000000000e+00 +1858 1.00000000000000e+00 +1859 -2.50000000000000e-01 +1860 0.00000000000000e+00 +1861 1.00000000000000e+00 +1862 -2.50000000000000e-01 +1863 0.00000000000000e+00 +1864 1.00000000000000e+00 +1865 -5.00000000000000e-01 +1866 0.00000000000000e+00 +1867 1.00000000000000e+00 +1868 -7.50000000000000e-01 +1869 0.00000000000000e+00 +1870 1.00000000000000e+00 +1871 -5.00000000000000e-01 +1872 0.00000000000000e+00 +1873 1.00000000000000e+00 +1874 -7.50000000000000e-01 diff --git a/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.1.00003 b/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.1.00003 new file mode 100644 index 00000000..93228d6e --- /dev/null +++ b/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.1.00003 @@ -0,0 +1,601 @@ +1875 2475 +1875 0.00000000000000e+00 +1876 0.00000000000000e+00 +1877 0.00000000000000e+00 +1878 0.00000000000000e+00 +1879 0.00000000000000e+00 +1880 0.00000000000000e+00 +1881 0.00000000000000e+00 +1882 0.00000000000000e+00 +1883 -1.00000000000000e+00 +1884 0.00000000000000e+00 +1885 0.00000000000000e+00 +1886 -1.00000000000000e+00 +1887 0.00000000000000e+00 +1888 1.00000000000000e+00 +1889 0.00000000000000e+00 +1890 0.00000000000000e+00 +1891 1.00000000000000e+00 +1892 0.00000000000000e+00 +1893 0.00000000000000e+00 +1894 1.00000000000000e+00 +1895 -1.00000000000000e+00 +1896 0.00000000000000e+00 +1897 1.00000000000000e+00 +1898 -1.00000000000000e+00 +1899 0.00000000000000e+00 +1900 0.00000000000000e+00 +1901 0.00000000000000e+00 +1902 0.00000000000000e+00 +1903 0.00000000000000e+00 +1904 -5.00000000000000e-01 +1905 0.00000000000000e+00 +1906 0.00000000000000e+00 +1907 -5.00000000000000e-01 +1908 0.00000000000000e+00 +1909 5.00000000000000e-01 +1910 0.00000000000000e+00 +1911 0.00000000000000e+00 +1912 5.00000000000000e-01 +1913 0.00000000000000e+00 +1914 0.00000000000000e+00 +1915 5.00000000000000e-01 +1916 -5.00000000000000e-01 +1917 0.00000000000000e+00 +1918 5.00000000000000e-01 +1919 -5.00000000000000e-01 +1920 0.00000000000000e+00 +1921 0.00000000000000e+00 +1922 0.00000000000000e+00 +1923 0.00000000000000e+00 +1924 0.00000000000000e+00 +1925 -5.00000000000000e-01 +1926 0.00000000000000e+00 +1927 0.00000000000000e+00 +1928 -5.00000000000000e-01 +1929 0.00000000000000e+00 +1930 5.00000000000000e-01 +1931 0.00000000000000e+00 +1932 0.00000000000000e+00 +1933 5.00000000000000e-01 +1934 0.00000000000000e+00 +1935 0.00000000000000e+00 +1936 5.00000000000000e-01 +1937 -5.00000000000000e-01 +1938 0.00000000000000e+00 +1939 5.00000000000000e-01 +1940 -5.00000000000000e-01 +1941 0.00000000000000e+00 +1942 0.00000000000000e+00 +1943 -1.00000000000000e+00 +1944 0.00000000000000e+00 +1945 5.00000000000000e-01 +1946 -1.00000000000000e+00 +1947 0.00000000000000e+00 +1948 5.00000000000000e-01 +1949 -1.00000000000000e+00 +1950 0.00000000000000e+00 +1951 0.00000000000000e+00 +1952 -1.00000000000000e+00 +1953 0.00000000000000e+00 +1954 5.00000000000000e-01 +1955 -1.00000000000000e+00 +1956 0.00000000000000e+00 +1957 5.00000000000000e-01 +1958 -1.00000000000000e+00 +1959 0.00000000000000e+00 +1960 1.00000000000000e+00 +1961 0.00000000000000e+00 +1962 0.00000000000000e+00 +1963 1.00000000000000e+00 +1964 -5.00000000000000e-01 +1965 0.00000000000000e+00 +1966 1.00000000000000e+00 +1967 -5.00000000000000e-01 +1968 0.00000000000000e+00 +1969 1.00000000000000e+00 +1970 0.00000000000000e+00 +1971 0.00000000000000e+00 +1972 1.00000000000000e+00 +1973 -5.00000000000000e-01 +1974 0.00000000000000e+00 +1975 1.00000000000000e+00 +1976 -5.00000000000000e-01 +1977 0.00000000000000e+00 +1978 1.00000000000000e+00 +1979 -1.00000000000000e+00 +1980 0.00000000000000e+00 +1981 1.00000000000000e+00 +1982 -1.00000000000000e+00 +1983 0.00000000000000e+00 +1984 0.00000000000000e+00 +1985 0.00000000000000e+00 +1986 0.00000000000000e+00 +1987 0.00000000000000e+00 +1988 -2.50000000000000e-01 +1989 0.00000000000000e+00 +1990 0.00000000000000e+00 +1991 -2.50000000000000e-01 +1992 0.00000000000000e+00 +1993 2.50000000000000e-01 +1994 0.00000000000000e+00 +1995 0.00000000000000e+00 +1996 2.50000000000000e-01 +1997 0.00000000000000e+00 +1998 0.00000000000000e+00 +1999 2.50000000000000e-01 +2000 -2.50000000000000e-01 +2001 0.00000000000000e+00 +2002 2.50000000000000e-01 +2003 -2.50000000000000e-01 +2004 0.00000000000000e+00 +2005 0.00000000000000e+00 +2006 0.00000000000000e+00 +2007 0.00000000000000e+00 +2008 0.00000000000000e+00 +2009 0.00000000000000e+00 +2010 0.00000000000000e+00 +2011 0.00000000000000e+00 +2012 -2.50000000000000e-01 +2013 0.00000000000000e+00 +2014 0.00000000000000e+00 +2015 -2.50000000000000e-01 +2016 0.00000000000000e+00 +2017 2.50000000000000e-01 +2018 0.00000000000000e+00 +2019 0.00000000000000e+00 +2020 2.50000000000000e-01 +2021 0.00000000000000e+00 +2022 0.00000000000000e+00 +2023 2.50000000000000e-01 +2024 -2.50000000000000e-01 +2025 0.00000000000000e+00 +2026 2.50000000000000e-01 +2027 -2.50000000000000e-01 +2028 0.00000000000000e+00 +2029 0.00000000000000e+00 +2030 0.00000000000000e+00 +2031 0.00000000000000e+00 +2032 0.00000000000000e+00 +2033 -7.50000000000000e-01 +2034 0.00000000000000e+00 +2035 0.00000000000000e+00 +2036 -1.00000000000000e+00 +2037 0.00000000000000e+00 +2038 2.50000000000000e-01 +2039 -1.00000000000000e+00 +2040 0.00000000000000e+00 +2041 2.50000000000000e-01 +2042 -1.00000000000000e+00 +2043 0.00000000000000e+00 +2044 0.00000000000000e+00 +2045 -7.50000000000000e-01 +2046 0.00000000000000e+00 +2047 0.00000000000000e+00 +2048 -7.50000000000000e-01 +2049 0.00000000000000e+00 +2050 0.00000000000000e+00 +2051 -1.00000000000000e+00 +2052 0.00000000000000e+00 +2053 0.00000000000000e+00 +2054 -1.00000000000000e+00 +2055 0.00000000000000e+00 +2056 2.50000000000000e-01 +2057 -1.00000000000000e+00 +2058 0.00000000000000e+00 +2059 2.50000000000000e-01 +2060 -1.00000000000000e+00 +2061 0.00000000000000e+00 +2062 0.00000000000000e+00 +2063 -7.50000000000000e-01 +2064 0.00000000000000e+00 +2065 0.00000000000000e+00 +2066 -1.00000000000000e+00 +2067 0.00000000000000e+00 +2068 7.50000000000000e-01 +2069 0.00000000000000e+00 +2070 0.00000000000000e+00 +2071 1.00000000000000e+00 +2072 0.00000000000000e+00 +2073 0.00000000000000e+00 +2074 1.00000000000000e+00 +2075 -2.50000000000000e-01 +2076 0.00000000000000e+00 +2077 1.00000000000000e+00 +2078 -2.50000000000000e-01 +2079 0.00000000000000e+00 +2080 7.50000000000000e-01 +2081 0.00000000000000e+00 +2082 0.00000000000000e+00 +2083 7.50000000000000e-01 +2084 0.00000000000000e+00 +2085 0.00000000000000e+00 +2086 1.00000000000000e+00 +2087 0.00000000000000e+00 +2088 0.00000000000000e+00 +2089 1.00000000000000e+00 +2090 0.00000000000000e+00 +2091 0.00000000000000e+00 +2092 1.00000000000000e+00 +2093 -2.50000000000000e-01 +2094 0.00000000000000e+00 +2095 1.00000000000000e+00 +2096 -2.50000000000000e-01 +2097 0.00000000000000e+00 +2098 7.50000000000000e-01 +2099 0.00000000000000e+00 +2100 0.00000000000000e+00 +2101 1.00000000000000e+00 +2102 0.00000000000000e+00 +2103 0.00000000000000e+00 +2104 7.50000000000000e-01 +2105 -7.50000000000000e-01 +2106 0.00000000000000e+00 +2107 7.50000000000000e-01 +2108 -1.00000000000000e+00 +2109 0.00000000000000e+00 +2110 1.00000000000000e+00 +2111 -7.50000000000000e-01 +2112 0.00000000000000e+00 +2113 1.00000000000000e+00 +2114 -1.00000000000000e+00 +2115 0.00000000000000e+00 +2116 7.50000000000000e-01 +2117 -7.50000000000000e-01 +2118 0.00000000000000e+00 +2119 7.50000000000000e-01 +2120 -7.50000000000000e-01 +2121 0.00000000000000e+00 +2122 7.50000000000000e-01 +2123 -1.00000000000000e+00 +2124 0.00000000000000e+00 +2125 7.50000000000000e-01 +2126 -1.00000000000000e+00 +2127 0.00000000000000e+00 +2128 1.00000000000000e+00 +2129 -7.50000000000000e-01 +2130 0.00000000000000e+00 +2131 1.00000000000000e+00 +2132 -7.50000000000000e-01 +2133 0.00000000000000e+00 +2134 1.00000000000000e+00 +2135 -1.00000000000000e+00 +2136 0.00000000000000e+00 +2137 1.00000000000000e+00 +2138 -1.00000000000000e+00 +2139 0.00000000000000e+00 +2140 7.50000000000000e-01 +2141 -7.50000000000000e-01 +2142 0.00000000000000e+00 +2143 7.50000000000000e-01 +2144 -1.00000000000000e+00 +2145 0.00000000000000e+00 +2146 1.00000000000000e+00 +2147 -7.50000000000000e-01 +2148 0.00000000000000e+00 +2149 1.00000000000000e+00 +2150 -1.00000000000000e+00 +2151 0.00000000000000e+00 +2152 0.00000000000000e+00 +2153 -2.50000000000000e-01 +2154 0.00000000000000e+00 +2155 2.50000000000000e-01 +2156 0.00000000000000e+00 +2157 0.00000000000000e+00 +2158 2.50000000000000e-01 +2159 -2.50000000000000e-01 +2160 0.00000000000000e+00 +2161 0.00000000000000e+00 +2162 -2.50000000000000e-01 +2163 0.00000000000000e+00 +2164 2.50000000000000e-01 +2165 0.00000000000000e+00 +2166 0.00000000000000e+00 +2167 2.50000000000000e-01 +2168 -2.50000000000000e-01 +2169 0.00000000000000e+00 +2170 0.00000000000000e+00 +2171 -5.00000000000000e-01 +2172 0.00000000000000e+00 +2173 2.50000000000000e-01 +2174 -5.00000000000000e-01 +2175 0.00000000000000e+00 +2176 2.50000000000000e-01 +2177 -5.00000000000000e-01 +2178 0.00000000000000e+00 +2179 0.00000000000000e+00 +2180 -7.50000000000000e-01 +2181 0.00000000000000e+00 +2182 2.50000000000000e-01 +2183 -7.50000000000000e-01 +2184 0.00000000000000e+00 +2185 2.50000000000000e-01 +2186 -7.50000000000000e-01 +2187 0.00000000000000e+00 +2188 2.50000000000000e-01 +2189 -5.00000000000000e-01 +2190 0.00000000000000e+00 +2191 0.00000000000000e+00 +2192 -5.00000000000000e-01 +2193 0.00000000000000e+00 +2194 2.50000000000000e-01 +2195 -5.00000000000000e-01 +2196 0.00000000000000e+00 +2197 0.00000000000000e+00 +2198 -7.50000000000000e-01 +2199 0.00000000000000e+00 +2200 2.50000000000000e-01 +2201 -7.50000000000000e-01 +2202 0.00000000000000e+00 +2203 2.50000000000000e-01 +2204 -7.50000000000000e-01 +2205 0.00000000000000e+00 +2206 5.00000000000000e-01 +2207 0.00000000000000e+00 +2208 0.00000000000000e+00 +2209 5.00000000000000e-01 +2210 -2.50000000000000e-01 +2211 0.00000000000000e+00 +2212 5.00000000000000e-01 +2213 -2.50000000000000e-01 +2214 0.00000000000000e+00 +2215 7.50000000000000e-01 +2216 0.00000000000000e+00 +2217 0.00000000000000e+00 +2218 7.50000000000000e-01 +2219 -2.50000000000000e-01 +2220 0.00000000000000e+00 +2221 7.50000000000000e-01 +2222 -2.50000000000000e-01 +2223 0.00000000000000e+00 +2224 5.00000000000000e-01 +2225 -2.50000000000000e-01 +2226 0.00000000000000e+00 +2227 5.00000000000000e-01 +2228 0.00000000000000e+00 +2229 0.00000000000000e+00 +2230 5.00000000000000e-01 +2231 -2.50000000000000e-01 +2232 0.00000000000000e+00 +2233 7.50000000000000e-01 +2234 0.00000000000000e+00 +2235 0.00000000000000e+00 +2236 7.50000000000000e-01 +2237 -2.50000000000000e-01 +2238 0.00000000000000e+00 +2239 7.50000000000000e-01 +2240 -2.50000000000000e-01 +2241 0.00000000000000e+00 +2242 5.00000000000000e-01 +2243 -5.00000000000000e-01 +2244 0.00000000000000e+00 +2245 5.00000000000000e-01 +2246 -7.50000000000000e-01 +2247 0.00000000000000e+00 +2248 5.00000000000000e-01 +2249 -7.50000000000000e-01 +2250 0.00000000000000e+00 +2251 7.50000000000000e-01 +2252 -5.00000000000000e-01 +2253 0.00000000000000e+00 +2254 7.50000000000000e-01 +2255 -5.00000000000000e-01 +2256 0.00000000000000e+00 +2257 7.50000000000000e-01 +2258 -7.50000000000000e-01 +2259 0.00000000000000e+00 +2260 5.00000000000000e-01 +2261 -5.00000000000000e-01 +2262 0.00000000000000e+00 +2263 5.00000000000000e-01 +2264 -7.50000000000000e-01 +2265 0.00000000000000e+00 +2266 5.00000000000000e-01 +2267 -7.50000000000000e-01 +2268 0.00000000000000e+00 +2269 7.50000000000000e-01 +2270 -5.00000000000000e-01 +2271 0.00000000000000e+00 +2272 7.50000000000000e-01 +2273 -5.00000000000000e-01 +2274 0.00000000000000e+00 +2275 7.50000000000000e-01 +2276 -7.50000000000000e-01 +2277 0.00000000000000e+00 +2278 0.00000000000000e+00 +2279 -2.50000000000000e-01 +2280 0.00000000000000e+00 +2281 2.50000000000000e-01 +2282 0.00000000000000e+00 +2283 0.00000000000000e+00 +2284 2.50000000000000e-01 +2285 -2.50000000000000e-01 +2286 0.00000000000000e+00 +2287 0.00000000000000e+00 +2288 -2.50000000000000e-01 +2289 0.00000000000000e+00 +2290 2.50000000000000e-01 +2291 0.00000000000000e+00 +2292 0.00000000000000e+00 +2293 2.50000000000000e-01 +2294 -2.50000000000000e-01 +2295 0.00000000000000e+00 +2296 0.00000000000000e+00 +2297 -5.00000000000000e-01 +2298 0.00000000000000e+00 +2299 2.50000000000000e-01 +2300 -5.00000000000000e-01 +2301 0.00000000000000e+00 +2302 2.50000000000000e-01 +2303 -5.00000000000000e-01 +2304 0.00000000000000e+00 +2305 0.00000000000000e+00 +2306 -7.50000000000000e-01 +2307 0.00000000000000e+00 +2308 2.50000000000000e-01 +2309 -7.50000000000000e-01 +2310 0.00000000000000e+00 +2311 2.50000000000000e-01 +2312 -7.50000000000000e-01 +2313 0.00000000000000e+00 +2314 2.50000000000000e-01 +2315 -5.00000000000000e-01 +2316 0.00000000000000e+00 +2317 0.00000000000000e+00 +2318 -5.00000000000000e-01 +2319 0.00000000000000e+00 +2320 2.50000000000000e-01 +2321 -5.00000000000000e-01 +2322 0.00000000000000e+00 +2323 0.00000000000000e+00 +2324 -7.50000000000000e-01 +2325 0.00000000000000e+00 +2326 2.50000000000000e-01 +2327 -7.50000000000000e-01 +2328 0.00000000000000e+00 +2329 2.50000000000000e-01 +2330 -7.50000000000000e-01 +2331 0.00000000000000e+00 +2332 5.00000000000000e-01 +2333 0.00000000000000e+00 +2334 0.00000000000000e+00 +2335 5.00000000000000e-01 +2336 -2.50000000000000e-01 +2337 0.00000000000000e+00 +2338 5.00000000000000e-01 +2339 -2.50000000000000e-01 +2340 0.00000000000000e+00 +2341 7.50000000000000e-01 +2342 0.00000000000000e+00 +2343 0.00000000000000e+00 +2344 7.50000000000000e-01 +2345 -2.50000000000000e-01 +2346 0.00000000000000e+00 +2347 7.50000000000000e-01 +2348 -2.50000000000000e-01 +2349 0.00000000000000e+00 +2350 5.00000000000000e-01 +2351 -2.50000000000000e-01 +2352 0.00000000000000e+00 +2353 5.00000000000000e-01 +2354 0.00000000000000e+00 +2355 0.00000000000000e+00 +2356 5.00000000000000e-01 +2357 -2.50000000000000e-01 +2358 0.00000000000000e+00 +2359 7.50000000000000e-01 +2360 0.00000000000000e+00 +2361 0.00000000000000e+00 +2362 7.50000000000000e-01 +2363 -2.50000000000000e-01 +2364 0.00000000000000e+00 +2365 7.50000000000000e-01 +2366 -2.50000000000000e-01 +2367 0.00000000000000e+00 +2368 5.00000000000000e-01 +2369 -5.00000000000000e-01 +2370 0.00000000000000e+00 +2371 5.00000000000000e-01 +2372 -7.50000000000000e-01 +2373 0.00000000000000e+00 +2374 5.00000000000000e-01 +2375 -7.50000000000000e-01 +2376 0.00000000000000e+00 +2377 7.50000000000000e-01 +2378 -5.00000000000000e-01 +2379 0.00000000000000e+00 +2380 7.50000000000000e-01 +2381 -5.00000000000000e-01 +2382 0.00000000000000e+00 +2383 7.50000000000000e-01 +2384 -7.50000000000000e-01 +2385 0.00000000000000e+00 +2386 5.00000000000000e-01 +2387 -5.00000000000000e-01 +2388 0.00000000000000e+00 +2389 5.00000000000000e-01 +2390 -7.50000000000000e-01 +2391 0.00000000000000e+00 +2392 5.00000000000000e-01 +2393 -7.50000000000000e-01 +2394 0.00000000000000e+00 +2395 7.50000000000000e-01 +2396 -5.00000000000000e-01 +2397 0.00000000000000e+00 +2398 7.50000000000000e-01 +2399 -5.00000000000000e-01 +2400 0.00000000000000e+00 +2401 7.50000000000000e-01 +2402 -7.50000000000000e-01 +2403 0.00000000000000e+00 +2404 2.50000000000000e-01 +2405 -1.00000000000000e+00 +2406 0.00000000000000e+00 +2407 2.50000000000000e-01 +2408 -1.00000000000000e+00 +2409 0.00000000000000e+00 +2410 5.00000000000000e-01 +2411 -1.00000000000000e+00 +2412 0.00000000000000e+00 +2413 7.50000000000000e-01 +2414 -1.00000000000000e+00 +2415 0.00000000000000e+00 +2416 5.00000000000000e-01 +2417 -1.00000000000000e+00 +2418 0.00000000000000e+00 +2419 7.50000000000000e-01 +2420 -1.00000000000000e+00 +2421 0.00000000000000e+00 +2422 2.50000000000000e-01 +2423 -1.00000000000000e+00 +2424 0.00000000000000e+00 +2425 2.50000000000000e-01 +2426 -1.00000000000000e+00 +2427 0.00000000000000e+00 +2428 5.00000000000000e-01 +2429 -1.00000000000000e+00 +2430 0.00000000000000e+00 +2431 7.50000000000000e-01 +2432 -1.00000000000000e+00 +2433 0.00000000000000e+00 +2434 5.00000000000000e-01 +2435 -1.00000000000000e+00 +2436 0.00000000000000e+00 +2437 7.50000000000000e-01 +2438 -1.00000000000000e+00 +2439 0.00000000000000e+00 +2440 1.00000000000000e+00 +2441 -2.50000000000000e-01 +2442 0.00000000000000e+00 +2443 1.00000000000000e+00 +2444 -2.50000000000000e-01 +2445 0.00000000000000e+00 +2446 1.00000000000000e+00 +2447 -5.00000000000000e-01 +2448 0.00000000000000e+00 +2449 1.00000000000000e+00 +2450 -7.50000000000000e-01 +2451 0.00000000000000e+00 +2452 1.00000000000000e+00 +2453 -5.00000000000000e-01 +2454 0.00000000000000e+00 +2455 1.00000000000000e+00 +2456 -7.50000000000000e-01 +2457 0.00000000000000e+00 +2458 1.00000000000000e+00 +2459 -2.50000000000000e-01 +2460 0.00000000000000e+00 +2461 1.00000000000000e+00 +2462 -2.50000000000000e-01 +2463 0.00000000000000e+00 +2464 1.00000000000000e+00 +2465 -5.00000000000000e-01 +2466 0.00000000000000e+00 +2467 1.00000000000000e+00 +2468 -7.50000000000000e-01 +2469 0.00000000000000e+00 +2470 1.00000000000000e+00 +2471 -5.00000000000000e-01 +2472 0.00000000000000e+00 +2473 1.00000000000000e+00 +2474 -7.50000000000000e-01 diff --git a/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.2.00000 b/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.2.00000 new file mode 100644 index 00000000..22e24e34 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.2.00000 @@ -0,0 +1,676 @@ +0 675 +0 0.00000000000000e+00 +1 0.00000000000000e+00 +2 4.00000000000000e+00 +3 0.00000000000000e+00 +4 0.00000000000000e+00 +5 5.00000000000000e+00 +6 0.00000000000000e+00 +7 0.00000000000000e+00 +8 6.00000000000000e+00 +9 0.00000000000000e+00 +10 0.00000000000000e+00 +11 4.00000000000000e+00 +12 0.00000000000000e+00 +13 0.00000000000000e+00 +14 5.00000000000000e+00 +15 0.00000000000000e+00 +16 0.00000000000000e+00 +17 6.00000000000000e+00 +18 -1.00000000000000e+00 +19 0.00000000000000e+00 +20 4.00000000000000e+00 +21 -1.00000000000000e+00 +22 0.00000000000000e+00 +23 5.00000000000000e+00 +24 -1.00000000000000e+00 +25 0.00000000000000e+00 +26 6.00000000000000e+00 +27 -1.00000000000000e+00 +28 0.00000000000000e+00 +29 4.00000000000000e+00 +30 -1.00000000000000e+00 +31 0.00000000000000e+00 +32 5.00000000000000e+00 +33 -1.00000000000000e+00 +34 0.00000000000000e+00 +35 6.00000000000000e+00 +36 0.00000000000000e+00 +37 0.00000000000000e+00 +38 4.50000000000000e+00 +39 0.00000000000000e+00 +40 0.00000000000000e+00 +41 4.00000000000000e+00 +42 0.00000000000000e+00 +43 0.00000000000000e+00 +44 4.50000000000000e+00 +45 -5.00000000000000e-01 +46 0.00000000000000e+00 +47 4.00000000000000e+00 +48 -5.00000000000000e-01 +49 0.00000000000000e+00 +50 4.50000000000000e+00 +51 -5.00000000000000e-01 +52 0.00000000000000e+00 +53 4.00000000000000e+00 +54 -5.00000000000000e-01 +55 0.00000000000000e+00 +56 4.50000000000000e+00 +57 0.00000000000000e+00 +58 0.00000000000000e+00 +59 5.50000000000000e+00 +60 0.00000000000000e+00 +61 0.00000000000000e+00 +62 5.00000000000000e+00 +63 0.00000000000000e+00 +64 0.00000000000000e+00 +65 5.50000000000000e+00 +66 -5.00000000000000e-01 +67 0.00000000000000e+00 +68 5.00000000000000e+00 +69 -5.00000000000000e-01 +70 0.00000000000000e+00 +71 5.50000000000000e+00 +72 -5.00000000000000e-01 +73 0.00000000000000e+00 +74 5.00000000000000e+00 +75 -5.00000000000000e-01 +76 0.00000000000000e+00 +77 5.50000000000000e+00 +78 0.00000000000000e+00 +79 0.00000000000000e+00 +80 6.00000000000000e+00 +81 -5.00000000000000e-01 +82 0.00000000000000e+00 +83 6.00000000000000e+00 +84 -5.00000000000000e-01 +85 0.00000000000000e+00 +86 6.00000000000000e+00 +87 0.00000000000000e+00 +88 0.00000000000000e+00 +89 4.50000000000000e+00 +90 -5.00000000000000e-01 +91 0.00000000000000e+00 +92 4.00000000000000e+00 +93 -5.00000000000000e-01 +94 0.00000000000000e+00 +95 4.50000000000000e+00 +96 0.00000000000000e+00 +97 0.00000000000000e+00 +98 5.50000000000000e+00 +99 -5.00000000000000e-01 +100 0.00000000000000e+00 +101 5.00000000000000e+00 +102 -5.00000000000000e-01 +103 0.00000000000000e+00 +104 5.50000000000000e+00 +105 -5.00000000000000e-01 +106 0.00000000000000e+00 +107 6.00000000000000e+00 +108 -1.00000000000000e+00 +109 0.00000000000000e+00 +110 4.50000000000000e+00 +111 -1.00000000000000e+00 +112 0.00000000000000e+00 +113 4.00000000000000e+00 +114 -1.00000000000000e+00 +115 0.00000000000000e+00 +116 4.50000000000000e+00 +117 -1.00000000000000e+00 +118 0.00000000000000e+00 +119 5.50000000000000e+00 +120 -1.00000000000000e+00 +121 0.00000000000000e+00 +122 5.00000000000000e+00 +123 -1.00000000000000e+00 +124 0.00000000000000e+00 +125 5.50000000000000e+00 +126 -1.00000000000000e+00 +127 0.00000000000000e+00 +128 6.00000000000000e+00 +129 -1.00000000000000e+00 +130 0.00000000000000e+00 +131 4.50000000000000e+00 +132 -1.00000000000000e+00 +133 0.00000000000000e+00 +134 5.50000000000000e+00 +135 0.00000000000000e+00 +136 0.00000000000000e+00 +137 4.25000000000000e+00 +138 0.00000000000000e+00 +139 0.00000000000000e+00 +140 4.00000000000000e+00 +141 0.00000000000000e+00 +142 0.00000000000000e+00 +143 4.25000000000000e+00 +144 -2.50000000000000e-01 +145 0.00000000000000e+00 +146 4.00000000000000e+00 +147 -2.50000000000000e-01 +148 0.00000000000000e+00 +149 4.25000000000000e+00 +150 -2.50000000000000e-01 +151 0.00000000000000e+00 +152 4.00000000000000e+00 +153 -2.50000000000000e-01 +154 0.00000000000000e+00 +155 4.25000000000000e+00 +156 0.00000000000000e+00 +157 0.00000000000000e+00 +158 4.75000000000000e+00 +159 0.00000000000000e+00 +160 0.00000000000000e+00 +161 5.25000000000000e+00 +162 0.00000000000000e+00 +163 0.00000000000000e+00 +164 5.00000000000000e+00 +165 0.00000000000000e+00 +166 0.00000000000000e+00 +167 5.25000000000000e+00 +168 -2.50000000000000e-01 +169 0.00000000000000e+00 +170 5.00000000000000e+00 +171 -2.50000000000000e-01 +172 0.00000000000000e+00 +173 5.25000000000000e+00 +174 -2.50000000000000e-01 +175 0.00000000000000e+00 +176 5.00000000000000e+00 +177 -2.50000000000000e-01 +178 0.00000000000000e+00 +179 5.25000000000000e+00 +180 0.00000000000000e+00 +181 0.00000000000000e+00 +182 5.75000000000000e+00 +183 0.00000000000000e+00 +184 0.00000000000000e+00 +185 6.00000000000000e+00 +186 -2.50000000000000e-01 +187 0.00000000000000e+00 +188 6.00000000000000e+00 +189 -2.50000000000000e-01 +190 0.00000000000000e+00 +191 6.00000000000000e+00 +192 0.00000000000000e+00 +193 0.00000000000000e+00 +194 4.00000000000000e+00 +195 0.00000000000000e+00 +196 0.00000000000000e+00 +197 4.25000000000000e+00 +198 -2.50000000000000e-01 +199 0.00000000000000e+00 +200 4.00000000000000e+00 +201 -2.50000000000000e-01 +202 0.00000000000000e+00 +203 4.25000000000000e+00 +204 0.00000000000000e+00 +205 0.00000000000000e+00 +206 4.75000000000000e+00 +207 0.00000000000000e+00 +208 0.00000000000000e+00 +209 5.00000000000000e+00 +210 0.00000000000000e+00 +211 0.00000000000000e+00 +212 4.75000000000000e+00 +213 0.00000000000000e+00 +214 0.00000000000000e+00 +215 5.25000000000000e+00 +216 -2.50000000000000e-01 +217 0.00000000000000e+00 +218 5.00000000000000e+00 +219 -2.50000000000000e-01 +220 0.00000000000000e+00 +221 5.25000000000000e+00 +222 0.00000000000000e+00 +223 0.00000000000000e+00 +224 5.75000000000000e+00 +225 0.00000000000000e+00 +226 0.00000000000000e+00 +227 6.00000000000000e+00 +228 0.00000000000000e+00 +229 0.00000000000000e+00 +230 5.75000000000000e+00 +231 -2.50000000000000e-01 +232 0.00000000000000e+00 +233 6.00000000000000e+00 +234 -7.50000000000000e-01 +235 0.00000000000000e+00 +236 4.00000000000000e+00 +237 -1.00000000000000e+00 +238 0.00000000000000e+00 +239 4.25000000000000e+00 +240 -1.00000000000000e+00 +241 0.00000000000000e+00 +242 4.00000000000000e+00 +243 -1.00000000000000e+00 +244 0.00000000000000e+00 +245 4.25000000000000e+00 +246 -7.50000000000000e-01 +247 0.00000000000000e+00 +248 4.75000000000000e+00 +249 -7.50000000000000e-01 +250 0.00000000000000e+00 +251 5.00000000000000e+00 +252 -1.00000000000000e+00 +253 0.00000000000000e+00 +254 4.75000000000000e+00 +255 -1.00000000000000e+00 +256 0.00000000000000e+00 +257 5.25000000000000e+00 +258 -1.00000000000000e+00 +259 0.00000000000000e+00 +260 5.00000000000000e+00 +261 -1.00000000000000e+00 +262 0.00000000000000e+00 +263 5.25000000000000e+00 +264 -7.50000000000000e-01 +265 0.00000000000000e+00 +266 5.75000000000000e+00 +267 -7.50000000000000e-01 +268 0.00000000000000e+00 +269 6.00000000000000e+00 +270 -1.00000000000000e+00 +271 0.00000000000000e+00 +272 5.75000000000000e+00 +273 -1.00000000000000e+00 +274 0.00000000000000e+00 +275 6.00000000000000e+00 +276 -7.50000000000000e-01 +277 0.00000000000000e+00 +278 4.00000000000000e+00 +279 -7.50000000000000e-01 +280 0.00000000000000e+00 +281 4.00000000000000e+00 +282 -1.00000000000000e+00 +283 0.00000000000000e+00 +284 4.00000000000000e+00 +285 -1.00000000000000e+00 +286 0.00000000000000e+00 +287 4.25000000000000e+00 +288 -7.50000000000000e-01 +289 0.00000000000000e+00 +290 4.75000000000000e+00 +291 -7.50000000000000e-01 +292 0.00000000000000e+00 +293 5.00000000000000e+00 +294 -7.50000000000000e-01 +295 0.00000000000000e+00 +296 4.75000000000000e+00 +297 -7.50000000000000e-01 +298 0.00000000000000e+00 +299 5.00000000000000e+00 +300 -1.00000000000000e+00 +301 0.00000000000000e+00 +302 4.75000000000000e+00 +303 -1.00000000000000e+00 +304 0.00000000000000e+00 +305 5.00000000000000e+00 +306 -1.00000000000000e+00 +307 0.00000000000000e+00 +308 4.75000000000000e+00 +309 -1.00000000000000e+00 +310 0.00000000000000e+00 +311 5.25000000000000e+00 +312 -7.50000000000000e-01 +313 0.00000000000000e+00 +314 5.75000000000000e+00 +315 -7.50000000000000e-01 +316 0.00000000000000e+00 +317 6.00000000000000e+00 +318 -7.50000000000000e-01 +319 0.00000000000000e+00 +320 5.75000000000000e+00 +321 -7.50000000000000e-01 +322 0.00000000000000e+00 +323 6.00000000000000e+00 +324 -1.00000000000000e+00 +325 0.00000000000000e+00 +326 5.75000000000000e+00 +327 -1.00000000000000e+00 +328 0.00000000000000e+00 +329 6.00000000000000e+00 +330 -1.00000000000000e+00 +331 0.00000000000000e+00 +332 5.75000000000000e+00 +333 0.00000000000000e+00 +334 0.00000000000000e+00 +335 4.50000000000000e+00 +336 -2.50000000000000e-01 +337 0.00000000000000e+00 +338 4.50000000000000e+00 +339 -2.50000000000000e-01 +340 0.00000000000000e+00 +341 4.50000000000000e+00 +342 0.00000000000000e+00 +343 0.00000000000000e+00 +344 4.75000000000000e+00 +345 -2.50000000000000e-01 +346 0.00000000000000e+00 +347 4.75000000000000e+00 +348 -2.50000000000000e-01 +349 0.00000000000000e+00 +350 4.75000000000000e+00 +351 0.00000000000000e+00 +352 0.00000000000000e+00 +353 4.25000000000000e+00 +354 -2.50000000000000e-01 +355 0.00000000000000e+00 +356 4.00000000000000e+00 +357 -2.50000000000000e-01 +358 0.00000000000000e+00 +359 4.25000000000000e+00 +360 0.00000000000000e+00 +361 0.00000000000000e+00 +362 4.25000000000000e+00 +363 -2.50000000000000e-01 +364 0.00000000000000e+00 +365 4.00000000000000e+00 +366 -2.50000000000000e-01 +367 0.00000000000000e+00 +368 4.25000000000000e+00 +369 -2.50000000000000e-01 +370 0.00000000000000e+00 +371 4.50000000000000e+00 +372 0.00000000000000e+00 +373 0.00000000000000e+00 +374 4.75000000000000e+00 +375 -2.50000000000000e-01 +376 0.00000000000000e+00 +377 4.75000000000000e+00 +378 0.00000000000000e+00 +379 0.00000000000000e+00 +380 4.50000000000000e+00 +381 -2.50000000000000e-01 +382 0.00000000000000e+00 +383 4.50000000000000e+00 +384 -2.50000000000000e-01 +385 0.00000000000000e+00 +386 4.75000000000000e+00 +387 -5.00000000000000e-01 +388 0.00000000000000e+00 +389 4.25000000000000e+00 +390 -5.00000000000000e-01 +391 0.00000000000000e+00 +392 4.00000000000000e+00 +393 -5.00000000000000e-01 +394 0.00000000000000e+00 +395 4.25000000000000e+00 +396 -7.50000000000000e-01 +397 0.00000000000000e+00 +398 4.25000000000000e+00 +399 -7.50000000000000e-01 +400 0.00000000000000e+00 +401 4.00000000000000e+00 +402 -7.50000000000000e-01 +403 0.00000000000000e+00 +404 4.25000000000000e+00 +405 -5.00000000000000e-01 +406 0.00000000000000e+00 +407 4.50000000000000e+00 +408 -5.00000000000000e-01 +409 0.00000000000000e+00 +410 4.75000000000000e+00 +411 -5.00000000000000e-01 +412 0.00000000000000e+00 +413 4.75000000000000e+00 +414 -7.50000000000000e-01 +415 0.00000000000000e+00 +416 4.50000000000000e+00 +417 -7.50000000000000e-01 +418 0.00000000000000e+00 +419 4.50000000000000e+00 +420 -7.50000000000000e-01 +421 0.00000000000000e+00 +422 4.75000000000000e+00 +423 -5.00000000000000e-01 +424 0.00000000000000e+00 +425 4.25000000000000e+00 +426 -5.00000000000000e-01 +427 0.00000000000000e+00 +428 4.00000000000000e+00 +429 -5.00000000000000e-01 +430 0.00000000000000e+00 +431 4.25000000000000e+00 +432 -7.50000000000000e-01 +433 0.00000000000000e+00 +434 4.00000000000000e+00 +435 -7.50000000000000e-01 +436 0.00000000000000e+00 +437 4.25000000000000e+00 +438 -7.50000000000000e-01 +439 0.00000000000000e+00 +440 4.25000000000000e+00 +441 -5.00000000000000e-01 +442 0.00000000000000e+00 +443 4.75000000000000e+00 +444 -5.00000000000000e-01 +445 0.00000000000000e+00 +446 4.50000000000000e+00 +447 -5.00000000000000e-01 +448 0.00000000000000e+00 +449 4.75000000000000e+00 +450 -7.50000000000000e-01 +451 0.00000000000000e+00 +452 4.50000000000000e+00 +453 -7.50000000000000e-01 +454 0.00000000000000e+00 +455 4.75000000000000e+00 +456 -7.50000000000000e-01 +457 0.00000000000000e+00 +458 4.50000000000000e+00 +459 0.00000000000000e+00 +460 0.00000000000000e+00 +461 5.50000000000000e+00 +462 -2.50000000000000e-01 +463 0.00000000000000e+00 +464 5.50000000000000e+00 +465 -2.50000000000000e-01 +466 0.00000000000000e+00 +467 5.50000000000000e+00 +468 0.00000000000000e+00 +469 0.00000000000000e+00 +470 5.75000000000000e+00 +471 -2.50000000000000e-01 +472 0.00000000000000e+00 +473 5.75000000000000e+00 +474 -2.50000000000000e-01 +475 0.00000000000000e+00 +476 5.75000000000000e+00 +477 0.00000000000000e+00 +478 0.00000000000000e+00 +479 5.25000000000000e+00 +480 -2.50000000000000e-01 +481 0.00000000000000e+00 +482 5.00000000000000e+00 +483 -2.50000000000000e-01 +484 0.00000000000000e+00 +485 5.25000000000000e+00 +486 0.00000000000000e+00 +487 0.00000000000000e+00 +488 5.25000000000000e+00 +489 -2.50000000000000e-01 +490 0.00000000000000e+00 +491 5.00000000000000e+00 +492 -2.50000000000000e-01 +493 0.00000000000000e+00 +494 5.25000000000000e+00 +495 -2.50000000000000e-01 +496 0.00000000000000e+00 +497 5.50000000000000e+00 +498 0.00000000000000e+00 +499 0.00000000000000e+00 +500 5.75000000000000e+00 +501 -2.50000000000000e-01 +502 0.00000000000000e+00 +503 5.75000000000000e+00 +504 0.00000000000000e+00 +505 0.00000000000000e+00 +506 5.50000000000000e+00 +507 -2.50000000000000e-01 +508 0.00000000000000e+00 +509 5.50000000000000e+00 +510 -2.50000000000000e-01 +511 0.00000000000000e+00 +512 5.75000000000000e+00 +513 -5.00000000000000e-01 +514 0.00000000000000e+00 +515 5.25000000000000e+00 +516 -5.00000000000000e-01 +517 0.00000000000000e+00 +518 5.00000000000000e+00 +519 -5.00000000000000e-01 +520 0.00000000000000e+00 +521 5.25000000000000e+00 +522 -7.50000000000000e-01 +523 0.00000000000000e+00 +524 5.25000000000000e+00 +525 -7.50000000000000e-01 +526 0.00000000000000e+00 +527 5.00000000000000e+00 +528 -7.50000000000000e-01 +529 0.00000000000000e+00 +530 5.25000000000000e+00 +531 -5.00000000000000e-01 +532 0.00000000000000e+00 +533 5.50000000000000e+00 +534 -5.00000000000000e-01 +535 0.00000000000000e+00 +536 5.75000000000000e+00 +537 -5.00000000000000e-01 +538 0.00000000000000e+00 +539 5.75000000000000e+00 +540 -7.50000000000000e-01 +541 0.00000000000000e+00 +542 5.50000000000000e+00 +543 -7.50000000000000e-01 +544 0.00000000000000e+00 +545 5.50000000000000e+00 +546 -7.50000000000000e-01 +547 0.00000000000000e+00 +548 5.75000000000000e+00 +549 -5.00000000000000e-01 +550 0.00000000000000e+00 +551 5.25000000000000e+00 +552 -5.00000000000000e-01 +553 0.00000000000000e+00 +554 5.00000000000000e+00 +555 -5.00000000000000e-01 +556 0.00000000000000e+00 +557 5.25000000000000e+00 +558 -7.50000000000000e-01 +559 0.00000000000000e+00 +560 5.00000000000000e+00 +561 -7.50000000000000e-01 +562 0.00000000000000e+00 +563 5.25000000000000e+00 +564 -7.50000000000000e-01 +565 0.00000000000000e+00 +566 5.25000000000000e+00 +567 -5.00000000000000e-01 +568 0.00000000000000e+00 +569 5.75000000000000e+00 +570 -5.00000000000000e-01 +571 0.00000000000000e+00 +572 5.50000000000000e+00 +573 -5.00000000000000e-01 +574 0.00000000000000e+00 +575 5.75000000000000e+00 +576 -7.50000000000000e-01 +577 0.00000000000000e+00 +578 5.50000000000000e+00 +579 -7.50000000000000e-01 +580 0.00000000000000e+00 +581 5.75000000000000e+00 +582 -7.50000000000000e-01 +583 0.00000000000000e+00 +584 5.50000000000000e+00 +585 -2.50000000000000e-01 +586 0.00000000000000e+00 +587 6.00000000000000e+00 +588 -2.50000000000000e-01 +589 0.00000000000000e+00 +590 6.00000000000000e+00 +591 -5.00000000000000e-01 +592 0.00000000000000e+00 +593 6.00000000000000e+00 +594 -7.50000000000000e-01 +595 0.00000000000000e+00 +596 6.00000000000000e+00 +597 -5.00000000000000e-01 +598 0.00000000000000e+00 +599 6.00000000000000e+00 +600 -7.50000000000000e-01 +601 0.00000000000000e+00 +602 6.00000000000000e+00 +603 -2.50000000000000e-01 +604 0.00000000000000e+00 +605 4.50000000000000e+00 +606 -2.50000000000000e-01 +607 0.00000000000000e+00 +608 4.75000000000000e+00 +609 -5.00000000000000e-01 +610 0.00000000000000e+00 +611 4.25000000000000e+00 +612 -7.50000000000000e-01 +613 0.00000000000000e+00 +614 4.25000000000000e+00 +615 -5.00000000000000e-01 +616 0.00000000000000e+00 +617 4.75000000000000e+00 +618 -7.50000000000000e-01 +619 0.00000000000000e+00 +620 4.50000000000000e+00 +621 -2.50000000000000e-01 +622 0.00000000000000e+00 +623 5.50000000000000e+00 +624 -2.50000000000000e-01 +625 0.00000000000000e+00 +626 5.75000000000000e+00 +627 -5.00000000000000e-01 +628 0.00000000000000e+00 +629 5.25000000000000e+00 +630 -7.50000000000000e-01 +631 0.00000000000000e+00 +632 5.25000000000000e+00 +633 -5.00000000000000e-01 +634 0.00000000000000e+00 +635 5.75000000000000e+00 +636 -7.50000000000000e-01 +637 0.00000000000000e+00 +638 5.50000000000000e+00 +639 -1.00000000000000e+00 +640 0.00000000000000e+00 +641 4.50000000000000e+00 +642 -1.00000000000000e+00 +643 0.00000000000000e+00 +644 4.75000000000000e+00 +645 -1.00000000000000e+00 +646 0.00000000000000e+00 +647 4.25000000000000e+00 +648 -1.00000000000000e+00 +649 0.00000000000000e+00 +650 4.25000000000000e+00 +651 -1.00000000000000e+00 +652 0.00000000000000e+00 +653 4.75000000000000e+00 +654 -1.00000000000000e+00 +655 0.00000000000000e+00 +656 4.50000000000000e+00 +657 -1.00000000000000e+00 +658 0.00000000000000e+00 +659 5.50000000000000e+00 +660 -1.00000000000000e+00 +661 0.00000000000000e+00 +662 5.75000000000000e+00 +663 -1.00000000000000e+00 +664 0.00000000000000e+00 +665 5.25000000000000e+00 +666 -1.00000000000000e+00 +667 0.00000000000000e+00 +668 5.25000000000000e+00 +669 -1.00000000000000e+00 +670 0.00000000000000e+00 +671 5.75000000000000e+00 +672 -1.00000000000000e+00 +673 0.00000000000000e+00 +674 5.50000000000000e+00 diff --git a/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.2.00001 b/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.2.00001 new file mode 100644 index 00000000..20274656 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.2.00001 @@ -0,0 +1,601 @@ +675 1275 +675 0.00000000000000e+00 +676 0.00000000000000e+00 +677 7.00000000000000e+00 +678 0.00000000000000e+00 +679 0.00000000000000e+00 +680 8.00000000000000e+00 +681 0.00000000000000e+00 +682 0.00000000000000e+00 +683 7.00000000000000e+00 +684 0.00000000000000e+00 +685 0.00000000000000e+00 +686 8.00000000000000e+00 +687 -1.00000000000000e+00 +688 0.00000000000000e+00 +689 7.00000000000000e+00 +690 -1.00000000000000e+00 +691 0.00000000000000e+00 +692 8.00000000000000e+00 +693 -1.00000000000000e+00 +694 0.00000000000000e+00 +695 7.00000000000000e+00 +696 -1.00000000000000e+00 +697 0.00000000000000e+00 +698 8.00000000000000e+00 +699 0.00000000000000e+00 +700 0.00000000000000e+00 +701 6.50000000000000e+00 +702 0.00000000000000e+00 +703 0.00000000000000e+00 +704 6.50000000000000e+00 +705 -5.00000000000000e-01 +706 0.00000000000000e+00 +707 6.50000000000000e+00 +708 -5.00000000000000e-01 +709 0.00000000000000e+00 +710 6.50000000000000e+00 +711 0.00000000000000e+00 +712 0.00000000000000e+00 +713 7.50000000000000e+00 +714 0.00000000000000e+00 +715 0.00000000000000e+00 +716 7.00000000000000e+00 +717 0.00000000000000e+00 +718 0.00000000000000e+00 +719 7.50000000000000e+00 +720 -5.00000000000000e-01 +721 0.00000000000000e+00 +722 7.00000000000000e+00 +723 -5.00000000000000e-01 +724 0.00000000000000e+00 +725 7.50000000000000e+00 +726 -5.00000000000000e-01 +727 0.00000000000000e+00 +728 7.00000000000000e+00 +729 -5.00000000000000e-01 +730 0.00000000000000e+00 +731 7.50000000000000e+00 +732 0.00000000000000e+00 +733 0.00000000000000e+00 +734 8.00000000000000e+00 +735 -5.00000000000000e-01 +736 0.00000000000000e+00 +737 8.00000000000000e+00 +738 -5.00000000000000e-01 +739 0.00000000000000e+00 +740 8.00000000000000e+00 +741 0.00000000000000e+00 +742 0.00000000000000e+00 +743 6.50000000000000e+00 +744 -5.00000000000000e-01 +745 0.00000000000000e+00 +746 6.50000000000000e+00 +747 0.00000000000000e+00 +748 0.00000000000000e+00 +749 7.50000000000000e+00 +750 -5.00000000000000e-01 +751 0.00000000000000e+00 +752 7.00000000000000e+00 +753 -5.00000000000000e-01 +754 0.00000000000000e+00 +755 7.50000000000000e+00 +756 -5.00000000000000e-01 +757 0.00000000000000e+00 +758 8.00000000000000e+00 +759 -1.00000000000000e+00 +760 0.00000000000000e+00 +761 6.50000000000000e+00 +762 -1.00000000000000e+00 +763 0.00000000000000e+00 +764 6.50000000000000e+00 +765 -1.00000000000000e+00 +766 0.00000000000000e+00 +767 7.50000000000000e+00 +768 -1.00000000000000e+00 +769 0.00000000000000e+00 +770 7.00000000000000e+00 +771 -1.00000000000000e+00 +772 0.00000000000000e+00 +773 7.50000000000000e+00 +774 -1.00000000000000e+00 +775 0.00000000000000e+00 +776 8.00000000000000e+00 +777 -1.00000000000000e+00 +778 0.00000000000000e+00 +779 6.50000000000000e+00 +780 -1.00000000000000e+00 +781 0.00000000000000e+00 +782 7.50000000000000e+00 +783 0.00000000000000e+00 +784 0.00000000000000e+00 +785 6.25000000000000e+00 +786 0.00000000000000e+00 +787 0.00000000000000e+00 +788 6.25000000000000e+00 +789 -2.50000000000000e-01 +790 0.00000000000000e+00 +791 6.25000000000000e+00 +792 -2.50000000000000e-01 +793 0.00000000000000e+00 +794 6.25000000000000e+00 +795 0.00000000000000e+00 +796 0.00000000000000e+00 +797 6.75000000000000e+00 +798 0.00000000000000e+00 +799 0.00000000000000e+00 +800 7.25000000000000e+00 +801 0.00000000000000e+00 +802 0.00000000000000e+00 +803 7.00000000000000e+00 +804 0.00000000000000e+00 +805 0.00000000000000e+00 +806 7.25000000000000e+00 +807 -2.50000000000000e-01 +808 0.00000000000000e+00 +809 7.00000000000000e+00 +810 -2.50000000000000e-01 +811 0.00000000000000e+00 +812 7.25000000000000e+00 +813 -2.50000000000000e-01 +814 0.00000000000000e+00 +815 7.00000000000000e+00 +816 -2.50000000000000e-01 +817 0.00000000000000e+00 +818 7.25000000000000e+00 +819 0.00000000000000e+00 +820 0.00000000000000e+00 +821 7.75000000000000e+00 +822 0.00000000000000e+00 +823 0.00000000000000e+00 +824 8.00000000000000e+00 +825 -2.50000000000000e-01 +826 0.00000000000000e+00 +827 8.00000000000000e+00 +828 -2.50000000000000e-01 +829 0.00000000000000e+00 +830 8.00000000000000e+00 +831 0.00000000000000e+00 +832 0.00000000000000e+00 +833 6.25000000000000e+00 +834 -2.50000000000000e-01 +835 0.00000000000000e+00 +836 6.25000000000000e+00 +837 0.00000000000000e+00 +838 0.00000000000000e+00 +839 6.75000000000000e+00 +840 0.00000000000000e+00 +841 0.00000000000000e+00 +842 7.00000000000000e+00 +843 0.00000000000000e+00 +844 0.00000000000000e+00 +845 6.75000000000000e+00 +846 0.00000000000000e+00 +847 0.00000000000000e+00 +848 7.25000000000000e+00 +849 -2.50000000000000e-01 +850 0.00000000000000e+00 +851 7.00000000000000e+00 +852 -2.50000000000000e-01 +853 0.00000000000000e+00 +854 7.25000000000000e+00 +855 0.00000000000000e+00 +856 0.00000000000000e+00 +857 7.75000000000000e+00 +858 0.00000000000000e+00 +859 0.00000000000000e+00 +860 8.00000000000000e+00 +861 0.00000000000000e+00 +862 0.00000000000000e+00 +863 7.75000000000000e+00 +864 -2.50000000000000e-01 +865 0.00000000000000e+00 +866 8.00000000000000e+00 +867 -1.00000000000000e+00 +868 0.00000000000000e+00 +869 6.25000000000000e+00 +870 -1.00000000000000e+00 +871 0.00000000000000e+00 +872 6.25000000000000e+00 +873 -7.50000000000000e-01 +874 0.00000000000000e+00 +875 6.75000000000000e+00 +876 -7.50000000000000e-01 +877 0.00000000000000e+00 +878 7.00000000000000e+00 +879 -1.00000000000000e+00 +880 0.00000000000000e+00 +881 6.75000000000000e+00 +882 -1.00000000000000e+00 +883 0.00000000000000e+00 +884 7.25000000000000e+00 +885 -1.00000000000000e+00 +886 0.00000000000000e+00 +887 7.00000000000000e+00 +888 -1.00000000000000e+00 +889 0.00000000000000e+00 +890 7.25000000000000e+00 +891 -7.50000000000000e-01 +892 0.00000000000000e+00 +893 7.75000000000000e+00 +894 -7.50000000000000e-01 +895 0.00000000000000e+00 +896 8.00000000000000e+00 +897 -1.00000000000000e+00 +898 0.00000000000000e+00 +899 7.75000000000000e+00 +900 -1.00000000000000e+00 +901 0.00000000000000e+00 +902 8.00000000000000e+00 +903 -1.00000000000000e+00 +904 0.00000000000000e+00 +905 6.25000000000000e+00 +906 -7.50000000000000e-01 +907 0.00000000000000e+00 +908 6.75000000000000e+00 +909 -7.50000000000000e-01 +910 0.00000000000000e+00 +911 7.00000000000000e+00 +912 -7.50000000000000e-01 +913 0.00000000000000e+00 +914 6.75000000000000e+00 +915 -7.50000000000000e-01 +916 0.00000000000000e+00 +917 7.00000000000000e+00 +918 -1.00000000000000e+00 +919 0.00000000000000e+00 +920 6.75000000000000e+00 +921 -1.00000000000000e+00 +922 0.00000000000000e+00 +923 7.00000000000000e+00 +924 -1.00000000000000e+00 +925 0.00000000000000e+00 +926 6.75000000000000e+00 +927 -1.00000000000000e+00 +928 0.00000000000000e+00 +929 7.25000000000000e+00 +930 -7.50000000000000e-01 +931 0.00000000000000e+00 +932 7.75000000000000e+00 +933 -7.50000000000000e-01 +934 0.00000000000000e+00 +935 8.00000000000000e+00 +936 -7.50000000000000e-01 +937 0.00000000000000e+00 +938 7.75000000000000e+00 +939 -7.50000000000000e-01 +940 0.00000000000000e+00 +941 8.00000000000000e+00 +942 -1.00000000000000e+00 +943 0.00000000000000e+00 +944 7.75000000000000e+00 +945 -1.00000000000000e+00 +946 0.00000000000000e+00 +947 8.00000000000000e+00 +948 -1.00000000000000e+00 +949 0.00000000000000e+00 +950 7.75000000000000e+00 +951 0.00000000000000e+00 +952 0.00000000000000e+00 +953 6.50000000000000e+00 +954 -2.50000000000000e-01 +955 0.00000000000000e+00 +956 6.50000000000000e+00 +957 -2.50000000000000e-01 +958 0.00000000000000e+00 +959 6.50000000000000e+00 +960 0.00000000000000e+00 +961 0.00000000000000e+00 +962 6.75000000000000e+00 +963 -2.50000000000000e-01 +964 0.00000000000000e+00 +965 6.75000000000000e+00 +966 -2.50000000000000e-01 +967 0.00000000000000e+00 +968 6.75000000000000e+00 +969 0.00000000000000e+00 +970 0.00000000000000e+00 +971 6.25000000000000e+00 +972 -2.50000000000000e-01 +973 0.00000000000000e+00 +974 6.25000000000000e+00 +975 0.00000000000000e+00 +976 0.00000000000000e+00 +977 6.25000000000000e+00 +978 -2.50000000000000e-01 +979 0.00000000000000e+00 +980 6.25000000000000e+00 +981 -2.50000000000000e-01 +982 0.00000000000000e+00 +983 6.50000000000000e+00 +984 0.00000000000000e+00 +985 0.00000000000000e+00 +986 6.75000000000000e+00 +987 -2.50000000000000e-01 +988 0.00000000000000e+00 +989 6.75000000000000e+00 +990 0.00000000000000e+00 +991 0.00000000000000e+00 +992 6.50000000000000e+00 +993 -2.50000000000000e-01 +994 0.00000000000000e+00 +995 6.50000000000000e+00 +996 -2.50000000000000e-01 +997 0.00000000000000e+00 +998 6.75000000000000e+00 +999 -5.00000000000000e-01 +1000 0.00000000000000e+00 +1001 6.25000000000000e+00 +1002 -5.00000000000000e-01 +1003 0.00000000000000e+00 +1004 6.25000000000000e+00 +1005 -7.50000000000000e-01 +1006 0.00000000000000e+00 +1007 6.25000000000000e+00 +1008 -7.50000000000000e-01 +1009 0.00000000000000e+00 +1010 6.25000000000000e+00 +1011 -5.00000000000000e-01 +1012 0.00000000000000e+00 +1013 6.50000000000000e+00 +1014 -5.00000000000000e-01 +1015 0.00000000000000e+00 +1016 6.75000000000000e+00 +1017 -5.00000000000000e-01 +1018 0.00000000000000e+00 +1019 6.75000000000000e+00 +1020 -7.50000000000000e-01 +1021 0.00000000000000e+00 +1022 6.50000000000000e+00 +1023 -7.50000000000000e-01 +1024 0.00000000000000e+00 +1025 6.50000000000000e+00 +1026 -7.50000000000000e-01 +1027 0.00000000000000e+00 +1028 6.75000000000000e+00 +1029 -5.00000000000000e-01 +1030 0.00000000000000e+00 +1031 6.25000000000000e+00 +1032 -5.00000000000000e-01 +1033 0.00000000000000e+00 +1034 6.25000000000000e+00 +1035 -7.50000000000000e-01 +1036 0.00000000000000e+00 +1037 6.25000000000000e+00 +1038 -7.50000000000000e-01 +1039 0.00000000000000e+00 +1040 6.25000000000000e+00 +1041 -5.00000000000000e-01 +1042 0.00000000000000e+00 +1043 6.75000000000000e+00 +1044 -5.00000000000000e-01 +1045 0.00000000000000e+00 +1046 6.50000000000000e+00 +1047 -5.00000000000000e-01 +1048 0.00000000000000e+00 +1049 6.75000000000000e+00 +1050 -7.50000000000000e-01 +1051 0.00000000000000e+00 +1052 6.50000000000000e+00 +1053 -7.50000000000000e-01 +1054 0.00000000000000e+00 +1055 6.75000000000000e+00 +1056 -7.50000000000000e-01 +1057 0.00000000000000e+00 +1058 6.50000000000000e+00 +1059 0.00000000000000e+00 +1060 0.00000000000000e+00 +1061 7.50000000000000e+00 +1062 -2.50000000000000e-01 +1063 0.00000000000000e+00 +1064 7.50000000000000e+00 +1065 -2.50000000000000e-01 +1066 0.00000000000000e+00 +1067 7.50000000000000e+00 +1068 0.00000000000000e+00 +1069 0.00000000000000e+00 +1070 7.75000000000000e+00 +1071 -2.50000000000000e-01 +1072 0.00000000000000e+00 +1073 7.75000000000000e+00 +1074 -2.50000000000000e-01 +1075 0.00000000000000e+00 +1076 7.75000000000000e+00 +1077 0.00000000000000e+00 +1078 0.00000000000000e+00 +1079 7.25000000000000e+00 +1080 -2.50000000000000e-01 +1081 0.00000000000000e+00 +1082 7.00000000000000e+00 +1083 -2.50000000000000e-01 +1084 0.00000000000000e+00 +1085 7.25000000000000e+00 +1086 0.00000000000000e+00 +1087 0.00000000000000e+00 +1088 7.25000000000000e+00 +1089 -2.50000000000000e-01 +1090 0.00000000000000e+00 +1091 7.00000000000000e+00 +1092 -2.50000000000000e-01 +1093 0.00000000000000e+00 +1094 7.25000000000000e+00 +1095 -2.50000000000000e-01 +1096 0.00000000000000e+00 +1097 7.50000000000000e+00 +1098 0.00000000000000e+00 +1099 0.00000000000000e+00 +1100 7.75000000000000e+00 +1101 -2.50000000000000e-01 +1102 0.00000000000000e+00 +1103 7.75000000000000e+00 +1104 0.00000000000000e+00 +1105 0.00000000000000e+00 +1106 7.50000000000000e+00 +1107 -2.50000000000000e-01 +1108 0.00000000000000e+00 +1109 7.50000000000000e+00 +1110 -2.50000000000000e-01 +1111 0.00000000000000e+00 +1112 7.75000000000000e+00 +1113 -5.00000000000000e-01 +1114 0.00000000000000e+00 +1115 7.25000000000000e+00 +1116 -5.00000000000000e-01 +1117 0.00000000000000e+00 +1118 7.00000000000000e+00 +1119 -5.00000000000000e-01 +1120 0.00000000000000e+00 +1121 7.25000000000000e+00 +1122 -7.50000000000000e-01 +1123 0.00000000000000e+00 +1124 7.25000000000000e+00 +1125 -7.50000000000000e-01 +1126 0.00000000000000e+00 +1127 7.00000000000000e+00 +1128 -7.50000000000000e-01 +1129 0.00000000000000e+00 +1130 7.25000000000000e+00 +1131 -5.00000000000000e-01 +1132 0.00000000000000e+00 +1133 7.50000000000000e+00 +1134 -5.00000000000000e-01 +1135 0.00000000000000e+00 +1136 7.75000000000000e+00 +1137 -5.00000000000000e-01 +1138 0.00000000000000e+00 +1139 7.75000000000000e+00 +1140 -7.50000000000000e-01 +1141 0.00000000000000e+00 +1142 7.50000000000000e+00 +1143 -7.50000000000000e-01 +1144 0.00000000000000e+00 +1145 7.50000000000000e+00 +1146 -7.50000000000000e-01 +1147 0.00000000000000e+00 +1148 7.75000000000000e+00 +1149 -5.00000000000000e-01 +1150 0.00000000000000e+00 +1151 7.25000000000000e+00 +1152 -5.00000000000000e-01 +1153 0.00000000000000e+00 +1154 7.00000000000000e+00 +1155 -5.00000000000000e-01 +1156 0.00000000000000e+00 +1157 7.25000000000000e+00 +1158 -7.50000000000000e-01 +1159 0.00000000000000e+00 +1160 7.00000000000000e+00 +1161 -7.50000000000000e-01 +1162 0.00000000000000e+00 +1163 7.25000000000000e+00 +1164 -7.50000000000000e-01 +1165 0.00000000000000e+00 +1166 7.25000000000000e+00 +1167 -5.00000000000000e-01 +1168 0.00000000000000e+00 +1169 7.75000000000000e+00 +1170 -5.00000000000000e-01 +1171 0.00000000000000e+00 +1172 7.50000000000000e+00 +1173 -5.00000000000000e-01 +1174 0.00000000000000e+00 +1175 7.75000000000000e+00 +1176 -7.50000000000000e-01 +1177 0.00000000000000e+00 +1178 7.50000000000000e+00 +1179 -7.50000000000000e-01 +1180 0.00000000000000e+00 +1181 7.75000000000000e+00 +1182 -7.50000000000000e-01 +1183 0.00000000000000e+00 +1184 7.50000000000000e+00 +1185 -2.50000000000000e-01 +1186 0.00000000000000e+00 +1187 8.00000000000000e+00 +1188 -2.50000000000000e-01 +1189 0.00000000000000e+00 +1190 8.00000000000000e+00 +1191 -5.00000000000000e-01 +1192 0.00000000000000e+00 +1193 8.00000000000000e+00 +1194 -7.50000000000000e-01 +1195 0.00000000000000e+00 +1196 8.00000000000000e+00 +1197 -5.00000000000000e-01 +1198 0.00000000000000e+00 +1199 8.00000000000000e+00 +1200 -7.50000000000000e-01 +1201 0.00000000000000e+00 +1202 8.00000000000000e+00 +1203 -2.50000000000000e-01 +1204 0.00000000000000e+00 +1205 6.50000000000000e+00 +1206 -2.50000000000000e-01 +1207 0.00000000000000e+00 +1208 6.75000000000000e+00 +1209 -5.00000000000000e-01 +1210 0.00000000000000e+00 +1211 6.25000000000000e+00 +1212 -7.50000000000000e-01 +1213 0.00000000000000e+00 +1214 6.25000000000000e+00 +1215 -5.00000000000000e-01 +1216 0.00000000000000e+00 +1217 6.75000000000000e+00 +1218 -7.50000000000000e-01 +1219 0.00000000000000e+00 +1220 6.50000000000000e+00 +1221 -2.50000000000000e-01 +1222 0.00000000000000e+00 +1223 7.50000000000000e+00 +1224 -2.50000000000000e-01 +1225 0.00000000000000e+00 +1226 7.75000000000000e+00 +1227 -5.00000000000000e-01 +1228 0.00000000000000e+00 +1229 7.25000000000000e+00 +1230 -7.50000000000000e-01 +1231 0.00000000000000e+00 +1232 7.25000000000000e+00 +1233 -5.00000000000000e-01 +1234 0.00000000000000e+00 +1235 7.75000000000000e+00 +1236 -7.50000000000000e-01 +1237 0.00000000000000e+00 +1238 7.50000000000000e+00 +1239 -1.00000000000000e+00 +1240 0.00000000000000e+00 +1241 6.50000000000000e+00 +1242 -1.00000000000000e+00 +1243 0.00000000000000e+00 +1244 6.75000000000000e+00 +1245 -1.00000000000000e+00 +1246 0.00000000000000e+00 +1247 6.25000000000000e+00 +1248 -1.00000000000000e+00 +1249 0.00000000000000e+00 +1250 6.25000000000000e+00 +1251 -1.00000000000000e+00 +1252 0.00000000000000e+00 +1253 6.75000000000000e+00 +1254 -1.00000000000000e+00 +1255 0.00000000000000e+00 +1256 6.50000000000000e+00 +1257 -1.00000000000000e+00 +1258 0.00000000000000e+00 +1259 7.50000000000000e+00 +1260 -1.00000000000000e+00 +1261 0.00000000000000e+00 +1262 7.75000000000000e+00 +1263 -1.00000000000000e+00 +1264 0.00000000000000e+00 +1265 7.25000000000000e+00 +1266 -1.00000000000000e+00 +1267 0.00000000000000e+00 +1268 7.25000000000000e+00 +1269 -1.00000000000000e+00 +1270 0.00000000000000e+00 +1271 7.75000000000000e+00 +1272 -1.00000000000000e+00 +1273 0.00000000000000e+00 +1274 7.50000000000000e+00 diff --git a/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.2.00002 b/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.2.00002 new file mode 100644 index 00000000..ba6ddd38 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.2.00002 @@ -0,0 +1,601 @@ +1275 1875 +1275 0.00000000000000e+00 +1276 0.00000000000000e+00 +1277 2.00000000000000e+00 +1278 0.00000000000000e+00 +1279 0.00000000000000e+00 +1280 3.00000000000000e+00 +1281 0.00000000000000e+00 +1282 0.00000000000000e+00 +1283 2.00000000000000e+00 +1284 0.00000000000000e+00 +1285 0.00000000000000e+00 +1286 3.00000000000000e+00 +1287 -1.00000000000000e+00 +1288 0.00000000000000e+00 +1289 2.00000000000000e+00 +1290 -1.00000000000000e+00 +1291 0.00000000000000e+00 +1292 3.00000000000000e+00 +1293 -1.00000000000000e+00 +1294 0.00000000000000e+00 +1295 2.00000000000000e+00 +1296 -1.00000000000000e+00 +1297 0.00000000000000e+00 +1298 3.00000000000000e+00 +1299 0.00000000000000e+00 +1300 0.00000000000000e+00 +1301 2.50000000000000e+00 +1302 0.00000000000000e+00 +1303 0.00000000000000e+00 +1304 2.00000000000000e+00 +1305 0.00000000000000e+00 +1306 0.00000000000000e+00 +1307 2.50000000000000e+00 +1308 -5.00000000000000e-01 +1309 0.00000000000000e+00 +1310 2.00000000000000e+00 +1311 -5.00000000000000e-01 +1312 0.00000000000000e+00 +1313 2.50000000000000e+00 +1314 -5.00000000000000e-01 +1315 0.00000000000000e+00 +1316 2.00000000000000e+00 +1317 -5.00000000000000e-01 +1318 0.00000000000000e+00 +1319 2.50000000000000e+00 +1320 0.00000000000000e+00 +1321 0.00000000000000e+00 +1322 3.50000000000000e+00 +1323 0.00000000000000e+00 +1324 0.00000000000000e+00 +1325 3.00000000000000e+00 +1326 0.00000000000000e+00 +1327 0.00000000000000e+00 +1328 3.50000000000000e+00 +1329 -5.00000000000000e-01 +1330 0.00000000000000e+00 +1331 3.00000000000000e+00 +1332 -5.00000000000000e-01 +1333 0.00000000000000e+00 +1334 3.50000000000000e+00 +1335 -5.00000000000000e-01 +1336 0.00000000000000e+00 +1337 3.00000000000000e+00 +1338 -5.00000000000000e-01 +1339 0.00000000000000e+00 +1340 3.50000000000000e+00 +1341 0.00000000000000e+00 +1342 0.00000000000000e+00 +1343 2.50000000000000e+00 +1344 -5.00000000000000e-01 +1345 0.00000000000000e+00 +1346 2.00000000000000e+00 +1347 -5.00000000000000e-01 +1348 0.00000000000000e+00 +1349 2.50000000000000e+00 +1350 0.00000000000000e+00 +1351 0.00000000000000e+00 +1352 3.50000000000000e+00 +1353 -5.00000000000000e-01 +1354 0.00000000000000e+00 +1355 3.00000000000000e+00 +1356 -5.00000000000000e-01 +1357 0.00000000000000e+00 +1358 3.50000000000000e+00 +1359 -1.00000000000000e+00 +1360 0.00000000000000e+00 +1361 2.50000000000000e+00 +1362 -1.00000000000000e+00 +1363 0.00000000000000e+00 +1364 2.00000000000000e+00 +1365 -1.00000000000000e+00 +1366 0.00000000000000e+00 +1367 2.50000000000000e+00 +1368 -1.00000000000000e+00 +1369 0.00000000000000e+00 +1370 3.50000000000000e+00 +1371 -1.00000000000000e+00 +1372 0.00000000000000e+00 +1373 3.00000000000000e+00 +1374 -1.00000000000000e+00 +1375 0.00000000000000e+00 +1376 3.50000000000000e+00 +1377 -1.00000000000000e+00 +1378 0.00000000000000e+00 +1379 2.50000000000000e+00 +1380 -1.00000000000000e+00 +1381 0.00000000000000e+00 +1382 3.50000000000000e+00 +1383 0.00000000000000e+00 +1384 0.00000000000000e+00 +1385 2.25000000000000e+00 +1386 0.00000000000000e+00 +1387 0.00000000000000e+00 +1388 2.00000000000000e+00 +1389 0.00000000000000e+00 +1390 0.00000000000000e+00 +1391 2.25000000000000e+00 +1392 -2.50000000000000e-01 +1393 0.00000000000000e+00 +1394 2.00000000000000e+00 +1395 -2.50000000000000e-01 +1396 0.00000000000000e+00 +1397 2.25000000000000e+00 +1398 -2.50000000000000e-01 +1399 0.00000000000000e+00 +1400 2.00000000000000e+00 +1401 -2.50000000000000e-01 +1402 0.00000000000000e+00 +1403 2.25000000000000e+00 +1404 0.00000000000000e+00 +1405 0.00000000000000e+00 +1406 2.75000000000000e+00 +1407 0.00000000000000e+00 +1408 0.00000000000000e+00 +1409 3.25000000000000e+00 +1410 0.00000000000000e+00 +1411 0.00000000000000e+00 +1412 3.00000000000000e+00 +1413 0.00000000000000e+00 +1414 0.00000000000000e+00 +1415 3.25000000000000e+00 +1416 -2.50000000000000e-01 +1417 0.00000000000000e+00 +1418 3.00000000000000e+00 +1419 -2.50000000000000e-01 +1420 0.00000000000000e+00 +1421 3.25000000000000e+00 +1422 -2.50000000000000e-01 +1423 0.00000000000000e+00 +1424 3.00000000000000e+00 +1425 -2.50000000000000e-01 +1426 0.00000000000000e+00 +1427 3.25000000000000e+00 +1428 0.00000000000000e+00 +1429 0.00000000000000e+00 +1430 3.75000000000000e+00 +1431 0.00000000000000e+00 +1432 0.00000000000000e+00 +1433 2.00000000000000e+00 +1434 0.00000000000000e+00 +1435 0.00000000000000e+00 +1436 2.25000000000000e+00 +1437 -2.50000000000000e-01 +1438 0.00000000000000e+00 +1439 2.00000000000000e+00 +1440 -2.50000000000000e-01 +1441 0.00000000000000e+00 +1442 2.25000000000000e+00 +1443 0.00000000000000e+00 +1444 0.00000000000000e+00 +1445 2.75000000000000e+00 +1446 0.00000000000000e+00 +1447 0.00000000000000e+00 +1448 3.00000000000000e+00 +1449 0.00000000000000e+00 +1450 0.00000000000000e+00 +1451 2.75000000000000e+00 +1452 0.00000000000000e+00 +1453 0.00000000000000e+00 +1454 3.25000000000000e+00 +1455 -2.50000000000000e-01 +1456 0.00000000000000e+00 +1457 3.00000000000000e+00 +1458 -2.50000000000000e-01 +1459 0.00000000000000e+00 +1460 3.25000000000000e+00 +1461 0.00000000000000e+00 +1462 0.00000000000000e+00 +1463 3.75000000000000e+00 +1464 0.00000000000000e+00 +1465 0.00000000000000e+00 +1466 3.75000000000000e+00 +1467 -7.50000000000000e-01 +1468 0.00000000000000e+00 +1469 2.00000000000000e+00 +1470 -1.00000000000000e+00 +1471 0.00000000000000e+00 +1472 2.25000000000000e+00 +1473 -1.00000000000000e+00 +1474 0.00000000000000e+00 +1475 2.00000000000000e+00 +1476 -1.00000000000000e+00 +1477 0.00000000000000e+00 +1478 2.25000000000000e+00 +1479 -7.50000000000000e-01 +1480 0.00000000000000e+00 +1481 2.75000000000000e+00 +1482 -7.50000000000000e-01 +1483 0.00000000000000e+00 +1484 3.00000000000000e+00 +1485 -1.00000000000000e+00 +1486 0.00000000000000e+00 +1487 2.75000000000000e+00 +1488 -1.00000000000000e+00 +1489 0.00000000000000e+00 +1490 3.25000000000000e+00 +1491 -1.00000000000000e+00 +1492 0.00000000000000e+00 +1493 3.00000000000000e+00 +1494 -1.00000000000000e+00 +1495 0.00000000000000e+00 +1496 3.25000000000000e+00 +1497 -7.50000000000000e-01 +1498 0.00000000000000e+00 +1499 3.75000000000000e+00 +1500 -1.00000000000000e+00 +1501 0.00000000000000e+00 +1502 3.75000000000000e+00 +1503 -7.50000000000000e-01 +1504 0.00000000000000e+00 +1505 2.00000000000000e+00 +1506 -7.50000000000000e-01 +1507 0.00000000000000e+00 +1508 2.00000000000000e+00 +1509 -1.00000000000000e+00 +1510 0.00000000000000e+00 +1511 2.00000000000000e+00 +1512 -1.00000000000000e+00 +1513 0.00000000000000e+00 +1514 2.25000000000000e+00 +1515 -7.50000000000000e-01 +1516 0.00000000000000e+00 +1517 2.75000000000000e+00 +1518 -7.50000000000000e-01 +1519 0.00000000000000e+00 +1520 3.00000000000000e+00 +1521 -7.50000000000000e-01 +1522 0.00000000000000e+00 +1523 2.75000000000000e+00 +1524 -7.50000000000000e-01 +1525 0.00000000000000e+00 +1526 3.00000000000000e+00 +1527 -1.00000000000000e+00 +1528 0.00000000000000e+00 +1529 2.75000000000000e+00 +1530 -1.00000000000000e+00 +1531 0.00000000000000e+00 +1532 3.00000000000000e+00 +1533 -1.00000000000000e+00 +1534 0.00000000000000e+00 +1535 2.75000000000000e+00 +1536 -1.00000000000000e+00 +1537 0.00000000000000e+00 +1538 3.25000000000000e+00 +1539 -7.50000000000000e-01 +1540 0.00000000000000e+00 +1541 3.75000000000000e+00 +1542 -7.50000000000000e-01 +1543 0.00000000000000e+00 +1544 3.75000000000000e+00 +1545 -1.00000000000000e+00 +1546 0.00000000000000e+00 +1547 3.75000000000000e+00 +1548 -1.00000000000000e+00 +1549 0.00000000000000e+00 +1550 3.75000000000000e+00 +1551 0.00000000000000e+00 +1552 0.00000000000000e+00 +1553 2.50000000000000e+00 +1554 -2.50000000000000e-01 +1555 0.00000000000000e+00 +1556 2.50000000000000e+00 +1557 -2.50000000000000e-01 +1558 0.00000000000000e+00 +1559 2.50000000000000e+00 +1560 0.00000000000000e+00 +1561 0.00000000000000e+00 +1562 2.75000000000000e+00 +1563 -2.50000000000000e-01 +1564 0.00000000000000e+00 +1565 2.75000000000000e+00 +1566 -2.50000000000000e-01 +1567 0.00000000000000e+00 +1568 2.75000000000000e+00 +1569 0.00000000000000e+00 +1570 0.00000000000000e+00 +1571 2.25000000000000e+00 +1572 -2.50000000000000e-01 +1573 0.00000000000000e+00 +1574 2.00000000000000e+00 +1575 -2.50000000000000e-01 +1576 0.00000000000000e+00 +1577 2.25000000000000e+00 +1578 0.00000000000000e+00 +1579 0.00000000000000e+00 +1580 2.25000000000000e+00 +1581 -2.50000000000000e-01 +1582 0.00000000000000e+00 +1583 2.00000000000000e+00 +1584 -2.50000000000000e-01 +1585 0.00000000000000e+00 +1586 2.25000000000000e+00 +1587 -2.50000000000000e-01 +1588 0.00000000000000e+00 +1589 2.50000000000000e+00 +1590 0.00000000000000e+00 +1591 0.00000000000000e+00 +1592 2.75000000000000e+00 +1593 -2.50000000000000e-01 +1594 0.00000000000000e+00 +1595 2.75000000000000e+00 +1596 0.00000000000000e+00 +1597 0.00000000000000e+00 +1598 2.50000000000000e+00 +1599 -2.50000000000000e-01 +1600 0.00000000000000e+00 +1601 2.50000000000000e+00 +1602 -2.50000000000000e-01 +1603 0.00000000000000e+00 +1604 2.75000000000000e+00 +1605 -5.00000000000000e-01 +1606 0.00000000000000e+00 +1607 2.25000000000000e+00 +1608 -5.00000000000000e-01 +1609 0.00000000000000e+00 +1610 2.00000000000000e+00 +1611 -5.00000000000000e-01 +1612 0.00000000000000e+00 +1613 2.25000000000000e+00 +1614 -7.50000000000000e-01 +1615 0.00000000000000e+00 +1616 2.25000000000000e+00 +1617 -7.50000000000000e-01 +1618 0.00000000000000e+00 +1619 2.00000000000000e+00 +1620 -7.50000000000000e-01 +1621 0.00000000000000e+00 +1622 2.25000000000000e+00 +1623 -5.00000000000000e-01 +1624 0.00000000000000e+00 +1625 2.50000000000000e+00 +1626 -5.00000000000000e-01 +1627 0.00000000000000e+00 +1628 2.75000000000000e+00 +1629 -5.00000000000000e-01 +1630 0.00000000000000e+00 +1631 2.75000000000000e+00 +1632 -7.50000000000000e-01 +1633 0.00000000000000e+00 +1634 2.50000000000000e+00 +1635 -7.50000000000000e-01 +1636 0.00000000000000e+00 +1637 2.50000000000000e+00 +1638 -7.50000000000000e-01 +1639 0.00000000000000e+00 +1640 2.75000000000000e+00 +1641 -5.00000000000000e-01 +1642 0.00000000000000e+00 +1643 2.25000000000000e+00 +1644 -5.00000000000000e-01 +1645 0.00000000000000e+00 +1646 2.00000000000000e+00 +1647 -5.00000000000000e-01 +1648 0.00000000000000e+00 +1649 2.25000000000000e+00 +1650 -7.50000000000000e-01 +1651 0.00000000000000e+00 +1652 2.00000000000000e+00 +1653 -7.50000000000000e-01 +1654 0.00000000000000e+00 +1655 2.25000000000000e+00 +1656 -7.50000000000000e-01 +1657 0.00000000000000e+00 +1658 2.25000000000000e+00 +1659 -5.00000000000000e-01 +1660 0.00000000000000e+00 +1661 2.75000000000000e+00 +1662 -5.00000000000000e-01 +1663 0.00000000000000e+00 +1664 2.50000000000000e+00 +1665 -5.00000000000000e-01 +1666 0.00000000000000e+00 +1667 2.75000000000000e+00 +1668 -7.50000000000000e-01 +1669 0.00000000000000e+00 +1670 2.50000000000000e+00 +1671 -7.50000000000000e-01 +1672 0.00000000000000e+00 +1673 2.75000000000000e+00 +1674 -7.50000000000000e-01 +1675 0.00000000000000e+00 +1676 2.50000000000000e+00 +1677 0.00000000000000e+00 +1678 0.00000000000000e+00 +1679 3.50000000000000e+00 +1680 -2.50000000000000e-01 +1681 0.00000000000000e+00 +1682 3.50000000000000e+00 +1683 -2.50000000000000e-01 +1684 0.00000000000000e+00 +1685 3.50000000000000e+00 +1686 0.00000000000000e+00 +1687 0.00000000000000e+00 +1688 3.75000000000000e+00 +1689 -2.50000000000000e-01 +1690 0.00000000000000e+00 +1691 3.75000000000000e+00 +1692 -2.50000000000000e-01 +1693 0.00000000000000e+00 +1694 3.75000000000000e+00 +1695 0.00000000000000e+00 +1696 0.00000000000000e+00 +1697 3.25000000000000e+00 +1698 -2.50000000000000e-01 +1699 0.00000000000000e+00 +1700 3.00000000000000e+00 +1701 -2.50000000000000e-01 +1702 0.00000000000000e+00 +1703 3.25000000000000e+00 +1704 0.00000000000000e+00 +1705 0.00000000000000e+00 +1706 3.25000000000000e+00 +1707 -2.50000000000000e-01 +1708 0.00000000000000e+00 +1709 3.00000000000000e+00 +1710 -2.50000000000000e-01 +1711 0.00000000000000e+00 +1712 3.25000000000000e+00 +1713 -2.50000000000000e-01 +1714 0.00000000000000e+00 +1715 3.50000000000000e+00 +1716 0.00000000000000e+00 +1717 0.00000000000000e+00 +1718 3.75000000000000e+00 +1719 -2.50000000000000e-01 +1720 0.00000000000000e+00 +1721 3.75000000000000e+00 +1722 0.00000000000000e+00 +1723 0.00000000000000e+00 +1724 3.50000000000000e+00 +1725 -2.50000000000000e-01 +1726 0.00000000000000e+00 +1727 3.50000000000000e+00 +1728 -2.50000000000000e-01 +1729 0.00000000000000e+00 +1730 3.75000000000000e+00 +1731 -5.00000000000000e-01 +1732 0.00000000000000e+00 +1733 3.25000000000000e+00 +1734 -5.00000000000000e-01 +1735 0.00000000000000e+00 +1736 3.00000000000000e+00 +1737 -5.00000000000000e-01 +1738 0.00000000000000e+00 +1739 3.25000000000000e+00 +1740 -7.50000000000000e-01 +1741 0.00000000000000e+00 +1742 3.25000000000000e+00 +1743 -7.50000000000000e-01 +1744 0.00000000000000e+00 +1745 3.00000000000000e+00 +1746 -7.50000000000000e-01 +1747 0.00000000000000e+00 +1748 3.25000000000000e+00 +1749 -5.00000000000000e-01 +1750 0.00000000000000e+00 +1751 3.50000000000000e+00 +1752 -5.00000000000000e-01 +1753 0.00000000000000e+00 +1754 3.75000000000000e+00 +1755 -5.00000000000000e-01 +1756 0.00000000000000e+00 +1757 3.75000000000000e+00 +1758 -7.50000000000000e-01 +1759 0.00000000000000e+00 +1760 3.50000000000000e+00 +1761 -7.50000000000000e-01 +1762 0.00000000000000e+00 +1763 3.50000000000000e+00 +1764 -7.50000000000000e-01 +1765 0.00000000000000e+00 +1766 3.75000000000000e+00 +1767 -5.00000000000000e-01 +1768 0.00000000000000e+00 +1769 3.25000000000000e+00 +1770 -5.00000000000000e-01 +1771 0.00000000000000e+00 +1772 3.00000000000000e+00 +1773 -5.00000000000000e-01 +1774 0.00000000000000e+00 +1775 3.25000000000000e+00 +1776 -7.50000000000000e-01 +1777 0.00000000000000e+00 +1778 3.00000000000000e+00 +1779 -7.50000000000000e-01 +1780 0.00000000000000e+00 +1781 3.25000000000000e+00 +1782 -7.50000000000000e-01 +1783 0.00000000000000e+00 +1784 3.25000000000000e+00 +1785 -5.00000000000000e-01 +1786 0.00000000000000e+00 +1787 3.75000000000000e+00 +1788 -5.00000000000000e-01 +1789 0.00000000000000e+00 +1790 3.50000000000000e+00 +1791 -5.00000000000000e-01 +1792 0.00000000000000e+00 +1793 3.75000000000000e+00 +1794 -7.50000000000000e-01 +1795 0.00000000000000e+00 +1796 3.50000000000000e+00 +1797 -7.50000000000000e-01 +1798 0.00000000000000e+00 +1799 3.75000000000000e+00 +1800 -7.50000000000000e-01 +1801 0.00000000000000e+00 +1802 3.50000000000000e+00 +1803 -2.50000000000000e-01 +1804 0.00000000000000e+00 +1805 2.50000000000000e+00 +1806 -2.50000000000000e-01 +1807 0.00000000000000e+00 +1808 2.75000000000000e+00 +1809 -5.00000000000000e-01 +1810 0.00000000000000e+00 +1811 2.25000000000000e+00 +1812 -7.50000000000000e-01 +1813 0.00000000000000e+00 +1814 2.25000000000000e+00 +1815 -5.00000000000000e-01 +1816 0.00000000000000e+00 +1817 2.75000000000000e+00 +1818 -7.50000000000000e-01 +1819 0.00000000000000e+00 +1820 2.50000000000000e+00 +1821 -2.50000000000000e-01 +1822 0.00000000000000e+00 +1823 3.50000000000000e+00 +1824 -2.50000000000000e-01 +1825 0.00000000000000e+00 +1826 3.75000000000000e+00 +1827 -5.00000000000000e-01 +1828 0.00000000000000e+00 +1829 3.25000000000000e+00 +1830 -7.50000000000000e-01 +1831 0.00000000000000e+00 +1832 3.25000000000000e+00 +1833 -5.00000000000000e-01 +1834 0.00000000000000e+00 +1835 3.75000000000000e+00 +1836 -7.50000000000000e-01 +1837 0.00000000000000e+00 +1838 3.50000000000000e+00 +1839 -1.00000000000000e+00 +1840 0.00000000000000e+00 +1841 2.50000000000000e+00 +1842 -1.00000000000000e+00 +1843 0.00000000000000e+00 +1844 2.75000000000000e+00 +1845 -1.00000000000000e+00 +1846 0.00000000000000e+00 +1847 2.25000000000000e+00 +1848 -1.00000000000000e+00 +1849 0.00000000000000e+00 +1850 2.25000000000000e+00 +1851 -1.00000000000000e+00 +1852 0.00000000000000e+00 +1853 2.75000000000000e+00 +1854 -1.00000000000000e+00 +1855 0.00000000000000e+00 +1856 2.50000000000000e+00 +1857 -1.00000000000000e+00 +1858 0.00000000000000e+00 +1859 3.50000000000000e+00 +1860 -1.00000000000000e+00 +1861 0.00000000000000e+00 +1862 3.75000000000000e+00 +1863 -1.00000000000000e+00 +1864 0.00000000000000e+00 +1865 3.25000000000000e+00 +1866 -1.00000000000000e+00 +1867 0.00000000000000e+00 +1868 3.25000000000000e+00 +1869 -1.00000000000000e+00 +1870 0.00000000000000e+00 +1871 3.75000000000000e+00 +1872 -1.00000000000000e+00 +1873 0.00000000000000e+00 +1874 3.50000000000000e+00 diff --git a/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.2.00003 b/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.2.00003 new file mode 100644 index 00000000..e64deda3 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/data/beam_tet_dof2475_np4/rbms.2.00003 @@ -0,0 +1,601 @@ +1875 2475 +1875 0.00000000000000e+00 +1876 0.00000000000000e+00 +1877 0.00000000000000e+00 +1878 0.00000000000000e+00 +1879 0.00000000000000e+00 +1880 1.00000000000000e+00 +1881 0.00000000000000e+00 +1882 0.00000000000000e+00 +1883 0.00000000000000e+00 +1884 0.00000000000000e+00 +1885 0.00000000000000e+00 +1886 1.00000000000000e+00 +1887 -1.00000000000000e+00 +1888 0.00000000000000e+00 +1889 0.00000000000000e+00 +1890 -1.00000000000000e+00 +1891 0.00000000000000e+00 +1892 1.00000000000000e+00 +1893 -1.00000000000000e+00 +1894 0.00000000000000e+00 +1895 0.00000000000000e+00 +1896 -1.00000000000000e+00 +1897 0.00000000000000e+00 +1898 1.00000000000000e+00 +1899 0.00000000000000e+00 +1900 0.00000000000000e+00 +1901 5.00000000000000e-01 +1902 0.00000000000000e+00 +1903 0.00000000000000e+00 +1904 0.00000000000000e+00 +1905 0.00000000000000e+00 +1906 0.00000000000000e+00 +1907 5.00000000000000e-01 +1908 -5.00000000000000e-01 +1909 0.00000000000000e+00 +1910 0.00000000000000e+00 +1911 -5.00000000000000e-01 +1912 0.00000000000000e+00 +1913 5.00000000000000e-01 +1914 -5.00000000000000e-01 +1915 0.00000000000000e+00 +1916 0.00000000000000e+00 +1917 -5.00000000000000e-01 +1918 0.00000000000000e+00 +1919 5.00000000000000e-01 +1920 0.00000000000000e+00 +1921 0.00000000000000e+00 +1922 1.50000000000000e+00 +1923 0.00000000000000e+00 +1924 0.00000000000000e+00 +1925 1.00000000000000e+00 +1926 0.00000000000000e+00 +1927 0.00000000000000e+00 +1928 1.50000000000000e+00 +1929 -5.00000000000000e-01 +1930 0.00000000000000e+00 +1931 1.00000000000000e+00 +1932 -5.00000000000000e-01 +1933 0.00000000000000e+00 +1934 1.50000000000000e+00 +1935 -5.00000000000000e-01 +1936 0.00000000000000e+00 +1937 1.00000000000000e+00 +1938 -5.00000000000000e-01 +1939 0.00000000000000e+00 +1940 1.50000000000000e+00 +1941 0.00000000000000e+00 +1942 0.00000000000000e+00 +1943 5.00000000000000e-01 +1944 -5.00000000000000e-01 +1945 0.00000000000000e+00 +1946 0.00000000000000e+00 +1947 -5.00000000000000e-01 +1948 0.00000000000000e+00 +1949 5.00000000000000e-01 +1950 0.00000000000000e+00 +1951 0.00000000000000e+00 +1952 1.50000000000000e+00 +1953 -5.00000000000000e-01 +1954 0.00000000000000e+00 +1955 1.00000000000000e+00 +1956 -5.00000000000000e-01 +1957 0.00000000000000e+00 +1958 1.50000000000000e+00 +1959 -1.00000000000000e+00 +1960 0.00000000000000e+00 +1961 5.00000000000000e-01 +1962 -1.00000000000000e+00 +1963 0.00000000000000e+00 +1964 0.00000000000000e+00 +1965 -1.00000000000000e+00 +1966 0.00000000000000e+00 +1967 5.00000000000000e-01 +1968 -1.00000000000000e+00 +1969 0.00000000000000e+00 +1970 1.50000000000000e+00 +1971 -1.00000000000000e+00 +1972 0.00000000000000e+00 +1973 1.00000000000000e+00 +1974 -1.00000000000000e+00 +1975 0.00000000000000e+00 +1976 1.50000000000000e+00 +1977 -1.00000000000000e+00 +1978 0.00000000000000e+00 +1979 5.00000000000000e-01 +1980 -1.00000000000000e+00 +1981 0.00000000000000e+00 +1982 1.50000000000000e+00 +1983 0.00000000000000e+00 +1984 0.00000000000000e+00 +1985 2.50000000000000e-01 +1986 0.00000000000000e+00 +1987 0.00000000000000e+00 +1988 0.00000000000000e+00 +1989 0.00000000000000e+00 +1990 0.00000000000000e+00 +1991 2.50000000000000e-01 +1992 -2.50000000000000e-01 +1993 0.00000000000000e+00 +1994 0.00000000000000e+00 +1995 -2.50000000000000e-01 +1996 0.00000000000000e+00 +1997 2.50000000000000e-01 +1998 -2.50000000000000e-01 +1999 0.00000000000000e+00 +2000 0.00000000000000e+00 +2001 -2.50000000000000e-01 +2002 0.00000000000000e+00 +2003 2.50000000000000e-01 +2004 0.00000000000000e+00 +2005 0.00000000000000e+00 +2006 7.50000000000000e-01 +2007 0.00000000000000e+00 +2008 0.00000000000000e+00 +2009 1.25000000000000e+00 +2010 0.00000000000000e+00 +2011 0.00000000000000e+00 +2012 1.00000000000000e+00 +2013 0.00000000000000e+00 +2014 0.00000000000000e+00 +2015 1.25000000000000e+00 +2016 -2.50000000000000e-01 +2017 0.00000000000000e+00 +2018 1.00000000000000e+00 +2019 -2.50000000000000e-01 +2020 0.00000000000000e+00 +2021 1.25000000000000e+00 +2022 -2.50000000000000e-01 +2023 0.00000000000000e+00 +2024 1.00000000000000e+00 +2025 -2.50000000000000e-01 +2026 0.00000000000000e+00 +2027 1.25000000000000e+00 +2028 0.00000000000000e+00 +2029 0.00000000000000e+00 +2030 1.75000000000000e+00 +2031 0.00000000000000e+00 +2032 0.00000000000000e+00 +2033 0.00000000000000e+00 +2034 0.00000000000000e+00 +2035 0.00000000000000e+00 +2036 2.50000000000000e-01 +2037 -2.50000000000000e-01 +2038 0.00000000000000e+00 +2039 0.00000000000000e+00 +2040 -2.50000000000000e-01 +2041 0.00000000000000e+00 +2042 2.50000000000000e-01 +2043 0.00000000000000e+00 +2044 0.00000000000000e+00 +2045 7.50000000000000e-01 +2046 0.00000000000000e+00 +2047 0.00000000000000e+00 +2048 1.00000000000000e+00 +2049 0.00000000000000e+00 +2050 0.00000000000000e+00 +2051 7.50000000000000e-01 +2052 0.00000000000000e+00 +2053 0.00000000000000e+00 +2054 1.25000000000000e+00 +2055 -2.50000000000000e-01 +2056 0.00000000000000e+00 +2057 1.00000000000000e+00 +2058 -2.50000000000000e-01 +2059 0.00000000000000e+00 +2060 1.25000000000000e+00 +2061 0.00000000000000e+00 +2062 0.00000000000000e+00 +2063 1.75000000000000e+00 +2064 0.00000000000000e+00 +2065 0.00000000000000e+00 +2066 1.75000000000000e+00 +2067 -7.50000000000000e-01 +2068 0.00000000000000e+00 +2069 0.00000000000000e+00 +2070 -1.00000000000000e+00 +2071 0.00000000000000e+00 +2072 2.50000000000000e-01 +2073 -1.00000000000000e+00 +2074 0.00000000000000e+00 +2075 0.00000000000000e+00 +2076 -1.00000000000000e+00 +2077 0.00000000000000e+00 +2078 2.50000000000000e-01 +2079 -7.50000000000000e-01 +2080 0.00000000000000e+00 +2081 7.50000000000000e-01 +2082 -7.50000000000000e-01 +2083 0.00000000000000e+00 +2084 1.00000000000000e+00 +2085 -1.00000000000000e+00 +2086 0.00000000000000e+00 +2087 7.50000000000000e-01 +2088 -1.00000000000000e+00 +2089 0.00000000000000e+00 +2090 1.25000000000000e+00 +2091 -1.00000000000000e+00 +2092 0.00000000000000e+00 +2093 1.00000000000000e+00 +2094 -1.00000000000000e+00 +2095 0.00000000000000e+00 +2096 1.25000000000000e+00 +2097 -7.50000000000000e-01 +2098 0.00000000000000e+00 +2099 1.75000000000000e+00 +2100 -1.00000000000000e+00 +2101 0.00000000000000e+00 +2102 1.75000000000000e+00 +2103 -7.50000000000000e-01 +2104 0.00000000000000e+00 +2105 0.00000000000000e+00 +2106 -7.50000000000000e-01 +2107 0.00000000000000e+00 +2108 0.00000000000000e+00 +2109 -1.00000000000000e+00 +2110 0.00000000000000e+00 +2111 0.00000000000000e+00 +2112 -1.00000000000000e+00 +2113 0.00000000000000e+00 +2114 2.50000000000000e-01 +2115 -7.50000000000000e-01 +2116 0.00000000000000e+00 +2117 7.50000000000000e-01 +2118 -7.50000000000000e-01 +2119 0.00000000000000e+00 +2120 1.00000000000000e+00 +2121 -7.50000000000000e-01 +2122 0.00000000000000e+00 +2123 7.50000000000000e-01 +2124 -7.50000000000000e-01 +2125 0.00000000000000e+00 +2126 1.00000000000000e+00 +2127 -1.00000000000000e+00 +2128 0.00000000000000e+00 +2129 7.50000000000000e-01 +2130 -1.00000000000000e+00 +2131 0.00000000000000e+00 +2132 1.00000000000000e+00 +2133 -1.00000000000000e+00 +2134 0.00000000000000e+00 +2135 7.50000000000000e-01 +2136 -1.00000000000000e+00 +2137 0.00000000000000e+00 +2138 1.25000000000000e+00 +2139 -7.50000000000000e-01 +2140 0.00000000000000e+00 +2141 1.75000000000000e+00 +2142 -7.50000000000000e-01 +2143 0.00000000000000e+00 +2144 1.75000000000000e+00 +2145 -1.00000000000000e+00 +2146 0.00000000000000e+00 +2147 1.75000000000000e+00 +2148 -1.00000000000000e+00 +2149 0.00000000000000e+00 +2150 1.75000000000000e+00 +2151 0.00000000000000e+00 +2152 0.00000000000000e+00 +2153 5.00000000000000e-01 +2154 -2.50000000000000e-01 +2155 0.00000000000000e+00 +2156 5.00000000000000e-01 +2157 -2.50000000000000e-01 +2158 0.00000000000000e+00 +2159 5.00000000000000e-01 +2160 0.00000000000000e+00 +2161 0.00000000000000e+00 +2162 7.50000000000000e-01 +2163 -2.50000000000000e-01 +2164 0.00000000000000e+00 +2165 7.50000000000000e-01 +2166 -2.50000000000000e-01 +2167 0.00000000000000e+00 +2168 7.50000000000000e-01 +2169 0.00000000000000e+00 +2170 0.00000000000000e+00 +2171 2.50000000000000e-01 +2172 -2.50000000000000e-01 +2173 0.00000000000000e+00 +2174 0.00000000000000e+00 +2175 -2.50000000000000e-01 +2176 0.00000000000000e+00 +2177 2.50000000000000e-01 +2178 0.00000000000000e+00 +2179 0.00000000000000e+00 +2180 2.50000000000000e-01 +2181 -2.50000000000000e-01 +2182 0.00000000000000e+00 +2183 0.00000000000000e+00 +2184 -2.50000000000000e-01 +2185 0.00000000000000e+00 +2186 2.50000000000000e-01 +2187 -2.50000000000000e-01 +2188 0.00000000000000e+00 +2189 5.00000000000000e-01 +2190 0.00000000000000e+00 +2191 0.00000000000000e+00 +2192 7.50000000000000e-01 +2193 -2.50000000000000e-01 +2194 0.00000000000000e+00 +2195 7.50000000000000e-01 +2196 0.00000000000000e+00 +2197 0.00000000000000e+00 +2198 5.00000000000000e-01 +2199 -2.50000000000000e-01 +2200 0.00000000000000e+00 +2201 5.00000000000000e-01 +2202 -2.50000000000000e-01 +2203 0.00000000000000e+00 +2204 7.50000000000000e-01 +2205 -5.00000000000000e-01 +2206 0.00000000000000e+00 +2207 2.50000000000000e-01 +2208 -5.00000000000000e-01 +2209 0.00000000000000e+00 +2210 0.00000000000000e+00 +2211 -5.00000000000000e-01 +2212 0.00000000000000e+00 +2213 2.50000000000000e-01 +2214 -7.50000000000000e-01 +2215 0.00000000000000e+00 +2216 2.50000000000000e-01 +2217 -7.50000000000000e-01 +2218 0.00000000000000e+00 +2219 0.00000000000000e+00 +2220 -7.50000000000000e-01 +2221 0.00000000000000e+00 +2222 2.50000000000000e-01 +2223 -5.00000000000000e-01 +2224 0.00000000000000e+00 +2225 5.00000000000000e-01 +2226 -5.00000000000000e-01 +2227 0.00000000000000e+00 +2228 7.50000000000000e-01 +2229 -5.00000000000000e-01 +2230 0.00000000000000e+00 +2231 7.50000000000000e-01 +2232 -7.50000000000000e-01 +2233 0.00000000000000e+00 +2234 5.00000000000000e-01 +2235 -7.50000000000000e-01 +2236 0.00000000000000e+00 +2237 5.00000000000000e-01 +2238 -7.50000000000000e-01 +2239 0.00000000000000e+00 +2240 7.50000000000000e-01 +2241 -5.00000000000000e-01 +2242 0.00000000000000e+00 +2243 2.50000000000000e-01 +2244 -5.00000000000000e-01 +2245 0.00000000000000e+00 +2246 0.00000000000000e+00 +2247 -5.00000000000000e-01 +2248 0.00000000000000e+00 +2249 2.50000000000000e-01 +2250 -7.50000000000000e-01 +2251 0.00000000000000e+00 +2252 0.00000000000000e+00 +2253 -7.50000000000000e-01 +2254 0.00000000000000e+00 +2255 2.50000000000000e-01 +2256 -7.50000000000000e-01 +2257 0.00000000000000e+00 +2258 2.50000000000000e-01 +2259 -5.00000000000000e-01 +2260 0.00000000000000e+00 +2261 7.50000000000000e-01 +2262 -5.00000000000000e-01 +2263 0.00000000000000e+00 +2264 5.00000000000000e-01 +2265 -5.00000000000000e-01 +2266 0.00000000000000e+00 +2267 7.50000000000000e-01 +2268 -7.50000000000000e-01 +2269 0.00000000000000e+00 +2270 5.00000000000000e-01 +2271 -7.50000000000000e-01 +2272 0.00000000000000e+00 +2273 7.50000000000000e-01 +2274 -7.50000000000000e-01 +2275 0.00000000000000e+00 +2276 5.00000000000000e-01 +2277 0.00000000000000e+00 +2278 0.00000000000000e+00 +2279 1.50000000000000e+00 +2280 -2.50000000000000e-01 +2281 0.00000000000000e+00 +2282 1.50000000000000e+00 +2283 -2.50000000000000e-01 +2284 0.00000000000000e+00 +2285 1.50000000000000e+00 +2286 0.00000000000000e+00 +2287 0.00000000000000e+00 +2288 1.75000000000000e+00 +2289 -2.50000000000000e-01 +2290 0.00000000000000e+00 +2291 1.75000000000000e+00 +2292 -2.50000000000000e-01 +2293 0.00000000000000e+00 +2294 1.75000000000000e+00 +2295 0.00000000000000e+00 +2296 0.00000000000000e+00 +2297 1.25000000000000e+00 +2298 -2.50000000000000e-01 +2299 0.00000000000000e+00 +2300 1.00000000000000e+00 +2301 -2.50000000000000e-01 +2302 0.00000000000000e+00 +2303 1.25000000000000e+00 +2304 0.00000000000000e+00 +2305 0.00000000000000e+00 +2306 1.25000000000000e+00 +2307 -2.50000000000000e-01 +2308 0.00000000000000e+00 +2309 1.00000000000000e+00 +2310 -2.50000000000000e-01 +2311 0.00000000000000e+00 +2312 1.25000000000000e+00 +2313 -2.50000000000000e-01 +2314 0.00000000000000e+00 +2315 1.50000000000000e+00 +2316 0.00000000000000e+00 +2317 0.00000000000000e+00 +2318 1.75000000000000e+00 +2319 -2.50000000000000e-01 +2320 0.00000000000000e+00 +2321 1.75000000000000e+00 +2322 0.00000000000000e+00 +2323 0.00000000000000e+00 +2324 1.50000000000000e+00 +2325 -2.50000000000000e-01 +2326 0.00000000000000e+00 +2327 1.50000000000000e+00 +2328 -2.50000000000000e-01 +2329 0.00000000000000e+00 +2330 1.75000000000000e+00 +2331 -5.00000000000000e-01 +2332 0.00000000000000e+00 +2333 1.25000000000000e+00 +2334 -5.00000000000000e-01 +2335 0.00000000000000e+00 +2336 1.00000000000000e+00 +2337 -5.00000000000000e-01 +2338 0.00000000000000e+00 +2339 1.25000000000000e+00 +2340 -7.50000000000000e-01 +2341 0.00000000000000e+00 +2342 1.25000000000000e+00 +2343 -7.50000000000000e-01 +2344 0.00000000000000e+00 +2345 1.00000000000000e+00 +2346 -7.50000000000000e-01 +2347 0.00000000000000e+00 +2348 1.25000000000000e+00 +2349 -5.00000000000000e-01 +2350 0.00000000000000e+00 +2351 1.50000000000000e+00 +2352 -5.00000000000000e-01 +2353 0.00000000000000e+00 +2354 1.75000000000000e+00 +2355 -5.00000000000000e-01 +2356 0.00000000000000e+00 +2357 1.75000000000000e+00 +2358 -7.50000000000000e-01 +2359 0.00000000000000e+00 +2360 1.50000000000000e+00 +2361 -7.50000000000000e-01 +2362 0.00000000000000e+00 +2363 1.50000000000000e+00 +2364 -7.50000000000000e-01 +2365 0.00000000000000e+00 +2366 1.75000000000000e+00 +2367 -5.00000000000000e-01 +2368 0.00000000000000e+00 +2369 1.25000000000000e+00 +2370 -5.00000000000000e-01 +2371 0.00000000000000e+00 +2372 1.00000000000000e+00 +2373 -5.00000000000000e-01 +2374 0.00000000000000e+00 +2375 1.25000000000000e+00 +2376 -7.50000000000000e-01 +2377 0.00000000000000e+00 +2378 1.00000000000000e+00 +2379 -7.50000000000000e-01 +2380 0.00000000000000e+00 +2381 1.25000000000000e+00 +2382 -7.50000000000000e-01 +2383 0.00000000000000e+00 +2384 1.25000000000000e+00 +2385 -5.00000000000000e-01 +2386 0.00000000000000e+00 +2387 1.75000000000000e+00 +2388 -5.00000000000000e-01 +2389 0.00000000000000e+00 +2390 1.50000000000000e+00 +2391 -5.00000000000000e-01 +2392 0.00000000000000e+00 +2393 1.75000000000000e+00 +2394 -7.50000000000000e-01 +2395 0.00000000000000e+00 +2396 1.50000000000000e+00 +2397 -7.50000000000000e-01 +2398 0.00000000000000e+00 +2399 1.75000000000000e+00 +2400 -7.50000000000000e-01 +2401 0.00000000000000e+00 +2402 1.50000000000000e+00 +2403 -2.50000000000000e-01 +2404 0.00000000000000e+00 +2405 5.00000000000000e-01 +2406 -2.50000000000000e-01 +2407 0.00000000000000e+00 +2408 7.50000000000000e-01 +2409 -5.00000000000000e-01 +2410 0.00000000000000e+00 +2411 2.50000000000000e-01 +2412 -7.50000000000000e-01 +2413 0.00000000000000e+00 +2414 2.50000000000000e-01 +2415 -5.00000000000000e-01 +2416 0.00000000000000e+00 +2417 7.50000000000000e-01 +2418 -7.50000000000000e-01 +2419 0.00000000000000e+00 +2420 5.00000000000000e-01 +2421 -2.50000000000000e-01 +2422 0.00000000000000e+00 +2423 1.50000000000000e+00 +2424 -2.50000000000000e-01 +2425 0.00000000000000e+00 +2426 1.75000000000000e+00 +2427 -5.00000000000000e-01 +2428 0.00000000000000e+00 +2429 1.25000000000000e+00 +2430 -7.50000000000000e-01 +2431 0.00000000000000e+00 +2432 1.25000000000000e+00 +2433 -5.00000000000000e-01 +2434 0.00000000000000e+00 +2435 1.75000000000000e+00 +2436 -7.50000000000000e-01 +2437 0.00000000000000e+00 +2438 1.50000000000000e+00 +2439 -1.00000000000000e+00 +2440 0.00000000000000e+00 +2441 5.00000000000000e-01 +2442 -1.00000000000000e+00 +2443 0.00000000000000e+00 +2444 7.50000000000000e-01 +2445 -1.00000000000000e+00 +2446 0.00000000000000e+00 +2447 2.50000000000000e-01 +2448 -1.00000000000000e+00 +2449 0.00000000000000e+00 +2450 2.50000000000000e-01 +2451 -1.00000000000000e+00 +2452 0.00000000000000e+00 +2453 7.50000000000000e-01 +2454 -1.00000000000000e+00 +2455 0.00000000000000e+00 +2456 5.00000000000000e-01 +2457 -1.00000000000000e+00 +2458 0.00000000000000e+00 +2459 1.50000000000000e+00 +2460 -1.00000000000000e+00 +2461 0.00000000000000e+00 +2462 1.75000000000000e+00 +2463 -1.00000000000000e+00 +2464 0.00000000000000e+00 +2465 1.25000000000000e+00 +2466 -1.00000000000000e+00 +2467 0.00000000000000e+00 +2468 1.25000000000000e+00 +2469 -1.00000000000000e+00 +2470 0.00000000000000e+00 +2471 1.75000000000000e+00 +2472 -1.00000000000000e+00 +2473 0.00000000000000e+00 +2474 1.50000000000000e+00 diff --git a/external/hypre/src/test/TEST_ij/data/beam_tet_dof459_np1/A.IJ.00000 b/external/hypre/src/test/TEST_ij/data/beam_tet_dof459_np1/A.IJ.00000 new file mode 100644 index 00000000..0120a14d --- /dev/null +++ b/external/hypre/src/test/TEST_ij/data/beam_tet_dof459_np1/A.IJ.00000 @@ -0,0 +1,11278 @@ +0 458 0 458 +0 0 1.00000000000000e+00 +0 124 0.00000000000000e+00 +0 111 0.00000000000000e+00 +0 125 0.00000000000000e+00 +0 116 0.00000000000000e+00 +0 128 0.00000000000000e+00 +0 109 0.00000000000000e+00 +0 115 0.00000000000000e+00 +0 110 0.00000000000000e+00 +0 121 0.00000000000000e+00 +0 127 0.00000000000000e+00 +0 108 0.00000000000000e+00 +0 119 0.00000000000000e+00 +0 122 0.00000000000000e+00 +0 117 0.00000000000000e+00 +0 112 0.00000000000000e+00 +1 1 1.00000000000000e+00 +1 111 0.00000000000000e+00 +1 113 0.00000000000000e+00 +1 112 0.00000000000000e+00 +1 123 0.00000000000000e+00 +1 125 0.00000000000000e+00 +1 119 0.00000000000000e+00 +1 108 0.00000000000000e+00 +1 114 0.00000000000000e+00 +1 109 0.00000000000000e+00 +1 120 0.00000000000000e+00 +1 126 0.00000000000000e+00 +1 122 0.00000000000000e+00 +1 128 0.00000000000000e+00 +1 118 0.00000000000000e+00 +1 116 0.00000000000000e+00 +2 2 1.00000000000000e+00 +2 113 0.00000000000000e+00 +2 112 0.00000000000000e+00 +2 124 0.00000000000000e+00 +2 118 0.00000000000000e+00 +2 123 0.00000000000000e+00 +2 114 0.00000000000000e+00 +2 126 0.00000000000000e+00 +2 110 0.00000000000000e+00 +2 108 0.00000000000000e+00 +2 119 0.00000000000000e+00 +2 115 0.00000000000000e+00 +2 121 0.00000000000000e+00 +2 127 0.00000000000000e+00 +2 117 0.00000000000000e+00 +2 120 0.00000000000000e+00 +3 3 7.50000000000000e+01 +3 149 -8.33333333333333e+00 +3 130 4.16666666666667e+00 +3 136 -8.33333333333333e+00 +3 131 4.16666666666667e+00 +3 142 4.16666666666667e+00 +3 148 -8.33333333333333e+00 +3 129 -2.50000000000000e+01 +3 143 -8.33333333333333e+00 +3 134 -4.16666666666667e+00 +3 146 8.33333333333333e+00 +3 4 -8.33333333333333e+00 +3 133 8.33333333333333e+00 +3 109 4.16666666666667e+00 +3 132 -1.25000000000000e+01 +3 5 -8.33333333333333e+00 +3 140 8.33333333333333e+00 +3 110 4.16666666666667e+00 +3 139 -4.16666666666667e+00 +3 145 8.33333333333333e+00 +3 137 4.16666666666667e+00 +3 138 -1.25000000000000e+01 +3 108 -2.50000000000000e+01 +4 4 6.66666666666667e+01 +4 129 4.16666666666667e+00 +4 135 -8.33333333333333e+00 +4 130 -8.33333333333333e+00 +4 141 4.16666666666667e+00 +4 147 -8.33333333333333e+00 +4 143 4.16666666666667e+00 +4 149 -8.33333333333333e+00 +4 134 8.33333333333333e+00 +4 133 -3.75000000000000e+01 +4 3 -8.33333333333333e+00 +4 132 8.33333333333333e+00 +4 108 4.16666666666667e+00 +4 140 8.33333333333333e+00 +4 146 -1.66666666666667e+01 +4 137 4.16666666666667e+00 +4 139 -1.25000000000000e+01 +4 109 -8.33333333333333e+00 +4 138 -4.16666666666667e+00 +4 144 8.33333333333333e+00 +5 5 6.66666666666667e+01 +5 135 4.16666666666667e+00 +5 147 -8.33333333333333e+00 +5 131 -8.33333333333333e+00 +5 129 4.16666666666667e+00 +5 142 4.16666666666667e+00 +5 148 -8.33333333333333e+00 +5 141 -8.33333333333333e+00 +5 134 -1.25000000000000e+01 +5 133 8.33333333333333e+00 +5 132 -4.16666666666667e+00 +5 144 8.33333333333333e+00 +5 136 4.16666666666667e+00 +5 140 -3.75000000000000e+01 +5 110 -8.33333333333333e+00 +5 139 8.33333333333333e+00 +5 145 -1.66666666666667e+01 +5 3 -8.33333333333333e+00 +5 138 8.33333333333333e+00 +5 108 4.16666666666667e+00 +6 6 7.50000000000000e+01 +6 170 -8.33333333333333e+00 +6 151 4.16666666666667e+00 +6 157 -8.33333333333333e+00 +6 152 4.16666666666667e+00 +6 163 4.16666666666667e+00 +6 169 -8.33333333333333e+00 +6 150 -2.50000000000000e+01 +6 164 -8.33333333333333e+00 +6 155 -4.16666666666667e+00 +6 167 8.33333333333333e+00 +6 7 -8.33333333333333e+00 +6 154 8.33333333333333e+00 +6 130 4.16666666666667e+00 +6 153 -1.25000000000000e+01 +6 8 -8.33333333333333e+00 +6 161 8.33333333333333e+00 +6 131 4.16666666666667e+00 +6 160 -4.16666666666667e+00 +6 166 8.33333333333333e+00 +6 158 4.16666666666667e+00 +6 159 -1.25000000000000e+01 +6 129 -2.50000000000000e+01 +7 7 6.66666666666667e+01 +7 150 4.16666666666667e+00 +7 156 -8.33333333333333e+00 +7 151 -8.33333333333333e+00 +7 162 4.16666666666667e+00 +7 168 -8.33333333333333e+00 +7 164 4.16666666666667e+00 +7 170 -8.33333333333333e+00 +7 155 8.33333333333333e+00 +7 154 -3.75000000000000e+01 +7 6 -8.33333333333333e+00 +7 153 8.33333333333333e+00 +7 129 4.16666666666667e+00 +7 161 8.33333333333333e+00 +7 167 -1.66666666666667e+01 +7 158 4.16666666666667e+00 +7 160 -1.25000000000000e+01 +7 130 -8.33333333333333e+00 +7 159 -4.16666666666667e+00 +7 165 8.33333333333333e+00 +8 8 6.66666666666667e+01 +8 156 4.16666666666667e+00 +8 168 -8.33333333333333e+00 +8 152 -8.33333333333333e+00 +8 150 4.16666666666667e+00 +8 163 4.16666666666667e+00 +8 169 -8.33333333333333e+00 +8 162 -8.33333333333333e+00 +8 155 -1.25000000000000e+01 +8 154 8.33333333333333e+00 +8 153 -4.16666666666667e+00 +8 165 8.33333333333333e+00 +8 157 4.16666666666667e+00 +8 161 -3.75000000000000e+01 +8 131 -8.33333333333333e+00 +8 160 8.33333333333333e+00 +8 166 -1.66666666666667e+01 +8 6 -8.33333333333333e+00 +8 159 8.33333333333333e+00 +8 129 4.16666666666667e+00 +9 9 7.50000000000000e+01 +9 191 -8.33333333333333e+00 +9 172 4.16666666666667e+00 +9 178 -8.33333333333333e+00 +9 173 4.16666666666667e+00 +9 184 4.16666666666667e+00 +9 190 -8.33333333333333e+00 +9 171 -2.50000000000000e+01 +9 185 -8.33333333333333e+00 +9 176 -4.16666666666667e+00 +9 188 8.33333333333333e+00 +9 10 -8.33333333333333e+00 +9 175 8.33333333333333e+00 +9 151 4.16666666666667e+00 +9 174 -1.25000000000000e+01 +9 11 -8.33333333333333e+00 +9 182 8.33333333333333e+00 +9 152 4.16666666666667e+00 +9 181 -4.16666666666667e+00 +9 187 8.33333333333333e+00 +9 179 4.16666666666667e+00 +9 180 -1.25000000000000e+01 +9 150 -2.50000000000000e+01 +10 10 6.66666666666667e+01 +10 171 4.16666666666667e+00 +10 177 -8.33333333333333e+00 +10 172 -8.33333333333333e+00 +10 183 4.16666666666667e+00 +10 189 -8.33333333333333e+00 +10 185 4.16666666666667e+00 +10 191 -8.33333333333333e+00 +10 176 8.33333333333333e+00 +10 175 -3.75000000000000e+01 +10 9 -8.33333333333333e+00 +10 174 8.33333333333333e+00 +10 150 4.16666666666667e+00 +10 182 8.33333333333333e+00 +10 188 -1.66666666666667e+01 +10 179 4.16666666666667e+00 +10 181 -1.25000000000000e+01 +10 151 -8.33333333333333e+00 +10 180 -4.16666666666667e+00 +10 186 8.33333333333333e+00 +11 11 6.66666666666667e+01 +11 177 4.16666666666667e+00 +11 189 -8.33333333333333e+00 +11 173 -8.33333333333333e+00 +11 171 4.16666666666667e+00 +11 184 4.16666666666667e+00 +11 190 -8.33333333333333e+00 +11 183 -8.33333333333333e+00 +11 176 -1.25000000000000e+01 +11 175 8.33333333333333e+00 +11 174 -4.16666666666667e+00 +11 186 8.33333333333333e+00 +11 178 4.16666666666667e+00 +11 182 -3.75000000000000e+01 +11 152 -8.33333333333333e+00 +11 181 8.33333333333333e+00 +11 187 -1.66666666666667e+01 +11 9 -8.33333333333333e+00 +11 180 8.33333333333333e+00 +11 150 4.16666666666667e+00 +12 12 3.41666666666667e+01 +12 212 -1.66666666666667e-01 +12 193 8.33333333333333e-02 +12 199 -1.66666666666667e-01 +12 194 8.33333333333333e-02 +12 205 8.33333333333333e-02 +12 211 -1.66666666666667e-01 +12 192 -5.00000000000000e-01 +12 206 -1.66666666666667e-01 +12 197 -4.16666666666667e+00 +12 209 4.25000000000000e+00 +12 13 -8.33333333333333e+00 +12 196 4.25000000000000e+00 +12 172 4.16666666666667e+00 +12 195 -4.33333333333333e+00 +12 14 -8.33333333333333e+00 +12 203 4.25000000000000e+00 +12 173 4.16666666666667e+00 +12 202 -4.16666666666667e+00 +12 208 4.25000000000000e+00 +12 200 8.33333333333333e-02 +12 201 -4.33333333333333e+00 +12 171 -2.50000000000000e+01 +13 13 2.58333333333333e+01 +13 192 8.33333333333333e-02 +13 198 -1.66666666666667e-01 +13 193 -1.66666666666667e-01 +13 204 8.33333333333333e-02 +13 210 -1.66666666666667e-01 +13 206 8.33333333333333e-02 +13 212 -1.66666666666667e-01 +13 197 4.25000000000000e+00 +13 196 -1.30000000000000e+01 +13 12 -8.33333333333333e+00 +13 195 4.25000000000000e+00 +13 171 4.16666666666667e+00 +13 203 4.25000000000000e+00 +13 209 -8.50000000000000e+00 +13 200 8.33333333333333e-02 +13 202 -4.33333333333333e+00 +13 172 -8.33333333333333e+00 +13 201 -4.16666666666667e+00 +13 207 4.25000000000000e+00 +14 14 2.58333333333333e+01 +14 198 8.33333333333333e-02 +14 210 -1.66666666666667e-01 +14 194 -1.66666666666667e-01 +14 192 8.33333333333333e-02 +14 205 8.33333333333333e-02 +14 211 -1.66666666666667e-01 +14 204 -1.66666666666667e-01 +14 197 -4.33333333333333e+00 +14 196 4.25000000000000e+00 +14 195 -4.16666666666667e+00 +14 207 4.25000000000000e+00 +14 199 8.33333333333333e-02 +14 203 -1.30000000000000e+01 +14 173 -8.33333333333333e+00 +14 202 4.25000000000000e+00 +14 208 -8.50000000000000e+00 +14 12 -8.33333333333333e+00 +14 201 4.25000000000000e+00 +14 171 4.16666666666667e+00 +15 15 1.50000000000000e+00 +15 233 -1.66666666666667e-01 +15 214 8.33333333333333e-02 +15 220 -1.66666666666667e-01 +15 215 8.33333333333333e-02 +15 226 8.33333333333333e-02 +15 232 -1.66666666666667e-01 +15 213 -5.00000000000000e-01 +15 227 -1.66666666666667e-01 +15 218 -8.33333333333333e-02 +15 230 1.66666666666667e-01 +15 16 -1.66666666666667e-01 +15 217 1.66666666666667e-01 +15 193 8.33333333333333e-02 +15 216 -2.50000000000000e-01 +15 17 -1.66666666666667e-01 +15 224 1.66666666666667e-01 +15 194 8.33333333333333e-02 +15 223 -8.33333333333333e-02 +15 229 1.66666666666667e-01 +15 221 8.33333333333333e-02 +15 222 -2.50000000000000e-01 +15 192 -5.00000000000000e-01 +16 16 1.33333333333333e+00 +16 213 8.33333333333333e-02 +16 219 -1.66666666666667e-01 +16 214 -1.66666666666667e-01 +16 225 8.33333333333333e-02 +16 231 -1.66666666666667e-01 +16 227 8.33333333333333e-02 +16 233 -1.66666666666667e-01 +16 218 1.66666666666667e-01 +16 217 -7.50000000000000e-01 +16 15 -1.66666666666667e-01 +16 216 1.66666666666667e-01 +16 192 8.33333333333333e-02 +16 224 1.66666666666667e-01 +16 230 -3.33333333333333e-01 +16 221 8.33333333333333e-02 +16 223 -2.50000000000000e-01 +16 193 -1.66666666666667e-01 +16 222 -8.33333333333333e-02 +16 228 1.66666666666667e-01 +17 17 1.33333333333333e+00 +17 219 8.33333333333333e-02 +17 231 -1.66666666666667e-01 +17 215 -1.66666666666667e-01 +17 213 8.33333333333333e-02 +17 226 8.33333333333333e-02 +17 232 -1.66666666666667e-01 +17 225 -1.66666666666667e-01 +17 218 -2.50000000000000e-01 +17 217 1.66666666666667e-01 +17 216 -8.33333333333333e-02 +17 228 1.66666666666667e-01 +17 220 8.33333333333333e-02 +17 224 -7.50000000000000e-01 +17 194 -1.66666666666667e-01 +17 223 1.66666666666667e-01 +17 229 -3.33333333333333e-01 +17 15 -1.66666666666667e-01 +17 222 1.66666666666667e-01 +17 192 8.33333333333333e-02 +18 18 1.50000000000000e+00 +18 254 -1.66666666666667e-01 +18 235 8.33333333333333e-02 +18 241 -1.66666666666667e-01 +18 236 8.33333333333333e-02 +18 247 8.33333333333333e-02 +18 253 -1.66666666666667e-01 +18 234 -5.00000000000000e-01 +18 248 -1.66666666666667e-01 +18 239 -8.33333333333333e-02 +18 251 1.66666666666667e-01 +18 19 -1.66666666666667e-01 +18 238 1.66666666666667e-01 +18 214 8.33333333333333e-02 +18 237 -2.50000000000000e-01 +18 20 -1.66666666666667e-01 +18 245 1.66666666666667e-01 +18 215 8.33333333333333e-02 +18 244 -8.33333333333333e-02 +18 250 1.66666666666667e-01 +18 242 8.33333333333333e-02 +18 243 -2.50000000000000e-01 +18 213 -5.00000000000000e-01 +19 19 1.33333333333333e+00 +19 234 8.33333333333333e-02 +19 240 -1.66666666666667e-01 +19 235 -1.66666666666667e-01 +19 246 8.33333333333333e-02 +19 252 -1.66666666666667e-01 +19 248 8.33333333333333e-02 +19 254 -1.66666666666667e-01 +19 239 1.66666666666667e-01 +19 238 -7.50000000000000e-01 +19 18 -1.66666666666667e-01 +19 237 1.66666666666667e-01 +19 213 8.33333333333333e-02 +19 245 1.66666666666667e-01 +19 251 -3.33333333333333e-01 +19 242 8.33333333333333e-02 +19 244 -2.50000000000000e-01 +19 214 -1.66666666666667e-01 +19 243 -8.33333333333333e-02 +19 249 1.66666666666667e-01 +20 20 1.33333333333333e+00 +20 240 8.33333333333333e-02 +20 252 -1.66666666666667e-01 +20 236 -1.66666666666667e-01 +20 234 8.33333333333333e-02 +20 247 8.33333333333333e-02 +20 253 -1.66666666666667e-01 +20 246 -1.66666666666667e-01 +20 239 -2.50000000000000e-01 +20 238 1.66666666666667e-01 +20 237 -8.33333333333333e-02 +20 249 1.66666666666667e-01 +20 241 8.33333333333333e-02 +20 245 -7.50000000000000e-01 +20 215 -1.66666666666667e-01 +20 244 1.66666666666667e-01 +20 250 -3.33333333333333e-01 +20 18 -1.66666666666667e-01 +20 243 1.66666666666667e-01 +20 213 8.33333333333333e-02 +21 21 1.50000000000000e+00 +21 275 -1.66666666666667e-01 +21 256 8.33333333333333e-02 +21 262 -1.66666666666667e-01 +21 257 8.33333333333333e-02 +21 268 8.33333333333333e-02 +21 274 -1.66666666666667e-01 +21 255 -5.00000000000000e-01 +21 269 -1.66666666666667e-01 +21 260 -8.33333333333333e-02 +21 272 1.66666666666667e-01 +21 22 -1.66666666666667e-01 +21 259 1.66666666666667e-01 +21 235 8.33333333333333e-02 +21 258 -2.50000000000000e-01 +21 23 -1.66666666666667e-01 +21 266 1.66666666666667e-01 +21 236 8.33333333333333e-02 +21 265 -8.33333333333333e-02 +21 271 1.66666666666667e-01 +21 263 8.33333333333333e-02 +21 264 -2.50000000000000e-01 +21 234 -5.00000000000000e-01 +22 22 1.33333333333333e+00 +22 255 8.33333333333333e-02 +22 261 -1.66666666666667e-01 +22 256 -1.66666666666667e-01 +22 267 8.33333333333333e-02 +22 273 -1.66666666666667e-01 +22 269 8.33333333333333e-02 +22 275 -1.66666666666667e-01 +22 260 1.66666666666667e-01 +22 259 -7.50000000000000e-01 +22 21 -1.66666666666667e-01 +22 258 1.66666666666667e-01 +22 234 8.33333333333333e-02 +22 266 1.66666666666667e-01 +22 272 -3.33333333333333e-01 +22 263 8.33333333333333e-02 +22 265 -2.50000000000000e-01 +22 235 -1.66666666666667e-01 +22 264 -8.33333333333333e-02 +22 270 1.66666666666667e-01 +23 23 1.33333333333333e+00 +23 261 8.33333333333333e-02 +23 273 -1.66666666666667e-01 +23 257 -1.66666666666667e-01 +23 255 8.33333333333333e-02 +23 268 8.33333333333333e-02 +23 274 -1.66666666666667e-01 +23 267 -1.66666666666667e-01 +23 260 -2.50000000000000e-01 +23 259 1.66666666666667e-01 +23 258 -8.33333333333333e-02 +23 270 1.66666666666667e-01 +23 262 8.33333333333333e-02 +23 266 -7.50000000000000e-01 +23 236 -1.66666666666667e-01 +23 265 1.66666666666667e-01 +23 271 -3.33333333333333e-01 +23 21 -1.66666666666667e-01 +23 264 1.66666666666667e-01 +23 234 8.33333333333333e-02 +24 24 6.66666666666667e-01 +24 284 8.33333333333333e-02 +24 25 -1.66666666666667e-01 +24 277 8.33333333333333e-02 +24 256 8.33333333333333e-02 +24 276 -8.33333333333333e-02 +24 26 -1.66666666666667e-01 +24 281 8.33333333333333e-02 +24 257 8.33333333333333e-02 +24 280 -8.33333333333333e-02 +24 283 8.33333333333333e-02 +24 278 -8.33333333333333e-02 +24 279 -8.33333333333333e-02 +24 255 -5.00000000000000e-01 +25 25 5.00000000000000e-01 +25 277 -2.50000000000000e-01 +25 24 -1.66666666666667e-01 +25 276 8.33333333333333e-02 +25 255 8.33333333333333e-02 +25 281 8.33333333333333e-02 +25 284 -1.66666666666667e-01 +25 278 8.33333333333333e-02 +25 280 -8.33333333333333e-02 +25 256 -1.66666666666667e-01 +25 279 -8.33333333333333e-02 +25 282 8.33333333333333e-02 +26 26 5.00000000000000e-01 +26 277 8.33333333333333e-02 +26 276 -8.33333333333333e-02 +26 282 8.33333333333333e-02 +26 278 -8.33333333333333e-02 +26 281 -2.50000000000000e-01 +26 257 -1.66666666666667e-01 +26 280 8.33333333333333e-02 +26 283 -1.66666666666667e-01 +26 24 -1.66666666666667e-01 +26 279 8.33333333333333e-02 +26 255 8.33333333333333e-02 +27 27 1.00000000000000e+00 +27 286 0.00000000000000e+00 +27 28 0.00000000000000e+00 +27 112 0.00000000000000e+00 +27 285 0.00000000000000e+00 +27 290 0.00000000000000e+00 +27 293 0.00000000000000e+00 +27 289 0.00000000000000e+00 +27 292 0.00000000000000e+00 +27 288 0.00000000000000e+00 +27 287 0.00000000000000e+00 +27 111 0.00000000000000e+00 +28 28 1.00000000000000e+00 +28 293 0.00000000000000e+00 +28 286 0.00000000000000e+00 +28 285 0.00000000000000e+00 +28 27 0.00000000000000e+00 +28 111 0.00000000000000e+00 +28 290 0.00000000000000e+00 +28 29 0.00000000000000e+00 +28 113 0.00000000000000e+00 +28 289 0.00000000000000e+00 +28 287 0.00000000000000e+00 +28 112 0.00000000000000e+00 +28 288 0.00000000000000e+00 +28 291 0.00000000000000e+00 +29 29 1.00000000000000e+00 +29 286 0.00000000000000e+00 +29 292 0.00000000000000e+00 +29 285 0.00000000000000e+00 +29 290 0.00000000000000e+00 +29 287 0.00000000000000e+00 +29 113 0.00000000000000e+00 +29 289 0.00000000000000e+00 +29 28 0.00000000000000e+00 +29 112 0.00000000000000e+00 +29 288 0.00000000000000e+00 +29 291 0.00000000000000e+00 +30 30 5.00000000000000e+01 +30 295 4.16666666666667e+00 +30 31 -8.33333333333333e+00 +30 294 -1.25000000000000e+01 +30 302 -8.33333333333333e+00 +30 298 -4.16666666666667e+00 +30 301 4.16666666666667e+00 +30 32 -8.33333333333333e+00 +30 287 4.16666666666667e+00 +30 299 8.33333333333333e+00 +30 286 4.16666666666667e+00 +30 285 -1.25000000000000e+01 +30 134 -4.16666666666667e+00 +30 116 4.16666666666667e+00 +30 133 8.33333333333333e+00 +30 115 -8.33333333333333e+00 +30 132 -1.25000000000000e+01 +30 296 4.16666666666667e+00 +30 297 -1.25000000000000e+01 +31 31 5.83333333333333e+01 +31 302 4.16666666666667e+00 +31 295 -4.16666666666667e+00 +31 294 4.16666666666667e+00 +31 30 -8.33333333333333e+00 +31 297 -4.16666666666667e+00 +31 300 4.16666666666667e+00 +31 287 -4.16666666666667e+00 +31 116 4.16666666666667e+00 +31 286 -4.16666666666667e+00 +31 285 4.16666666666667e+00 +31 134 8.33333333333333e+00 +31 32 -1.66666666666667e+01 +31 299 8.33333333333333e+00 +31 133 -3.75000000000000e+01 +31 296 -4.16666666666667e+00 +31 298 -1.25000000000000e+01 +31 132 8.33333333333333e+00 +31 114 -8.33333333333333e+00 +32 32 5.83333333333333e+01 +32 295 -4.16666666666667e+00 +32 301 4.16666666666667e+00 +32 294 4.16666666666667e+00 +32 300 -8.33333333333333e+00 +32 287 -4.16666666666667e+00 +32 286 -4.16666666666667e+00 +32 115 4.16666666666667e+00 +32 30 -8.33333333333333e+00 +32 285 4.16666666666667e+00 +32 297 8.33333333333333e+00 +32 134 -1.25000000000000e+01 +32 296 -4.16666666666667e+00 +32 299 -3.75000000000000e+01 +32 133 8.33333333333333e+00 +32 31 -1.66666666666667e+01 +32 298 8.33333333333333e+00 +32 132 -4.16666666666667e+00 +32 114 4.16666666666667e+00 +33 33 5.00000000000000e+01 +33 304 4.16666666666667e+00 +33 34 -8.33333333333333e+00 +33 303 -1.25000000000000e+01 +33 311 -8.33333333333333e+00 +33 307 -4.16666666666667e+00 +33 310 4.16666666666667e+00 +33 35 -8.33333333333333e+00 +33 296 4.16666666666667e+00 +33 308 8.33333333333333e+00 +33 295 4.16666666666667e+00 +33 294 -1.25000000000000e+01 +33 155 -4.16666666666667e+00 +33 137 4.16666666666667e+00 +33 154 8.33333333333333e+00 +33 136 -8.33333333333333e+00 +33 153 -1.25000000000000e+01 +33 305 4.16666666666667e+00 +33 306 -1.25000000000000e+01 +34 34 5.83333333333333e+01 +34 311 4.16666666666667e+00 +34 304 -4.16666666666667e+00 +34 303 4.16666666666667e+00 +34 33 -8.33333333333333e+00 +34 306 -4.16666666666667e+00 +34 309 4.16666666666667e+00 +34 296 -4.16666666666667e+00 +34 137 4.16666666666667e+00 +34 295 -4.16666666666667e+00 +34 294 4.16666666666667e+00 +34 155 8.33333333333333e+00 +34 35 -1.66666666666667e+01 +34 308 8.33333333333333e+00 +34 154 -3.75000000000000e+01 +34 305 -4.16666666666667e+00 +34 307 -1.25000000000000e+01 +34 153 8.33333333333333e+00 +34 135 -8.33333333333333e+00 +35 35 5.83333333333333e+01 +35 304 -4.16666666666667e+00 +35 310 4.16666666666667e+00 +35 303 4.16666666666667e+00 +35 309 -8.33333333333333e+00 +35 296 -4.16666666666667e+00 +35 295 -4.16666666666667e+00 +35 136 4.16666666666667e+00 +35 33 -8.33333333333333e+00 +35 294 4.16666666666667e+00 +35 306 8.33333333333333e+00 +35 155 -1.25000000000000e+01 +35 305 -4.16666666666667e+00 +35 308 -3.75000000000000e+01 +35 154 8.33333333333333e+00 +35 34 -1.66666666666667e+01 +35 307 8.33333333333333e+00 +35 153 -4.16666666666667e+00 +35 135 4.16666666666667e+00 +36 36 5.00000000000000e+01 +36 313 4.16666666666667e+00 +36 37 -8.33333333333333e+00 +36 312 -1.25000000000000e+01 +36 320 -8.33333333333333e+00 +36 316 -4.16666666666667e+00 +36 319 4.16666666666667e+00 +36 38 -8.33333333333333e+00 +36 305 4.16666666666667e+00 +36 317 8.33333333333333e+00 +36 304 4.16666666666667e+00 +36 303 -1.25000000000000e+01 +36 176 -4.16666666666667e+00 +36 158 4.16666666666667e+00 +36 175 8.33333333333333e+00 +36 157 -8.33333333333333e+00 +36 174 -1.25000000000000e+01 +36 314 4.16666666666667e+00 +36 315 -1.25000000000000e+01 +37 37 5.83333333333333e+01 +37 320 4.16666666666667e+00 +37 313 -4.16666666666667e+00 +37 312 4.16666666666667e+00 +37 36 -8.33333333333333e+00 +37 315 -4.16666666666667e+00 +37 318 4.16666666666667e+00 +37 305 -4.16666666666667e+00 +37 158 4.16666666666667e+00 +37 304 -4.16666666666667e+00 +37 303 4.16666666666667e+00 +37 176 8.33333333333333e+00 +37 38 -1.66666666666667e+01 +37 317 8.33333333333333e+00 +37 175 -3.75000000000000e+01 +37 314 -4.16666666666667e+00 +37 316 -1.25000000000000e+01 +37 174 8.33333333333333e+00 +37 156 -8.33333333333333e+00 +38 38 5.83333333333333e+01 +38 313 -4.16666666666667e+00 +38 319 4.16666666666667e+00 +38 312 4.16666666666667e+00 +38 318 -8.33333333333333e+00 +38 305 -4.16666666666667e+00 +38 304 -4.16666666666667e+00 +38 157 4.16666666666667e+00 +38 36 -8.33333333333333e+00 +38 303 4.16666666666667e+00 +38 315 8.33333333333333e+00 +38 176 -1.25000000000000e+01 +38 314 -4.16666666666667e+00 +38 317 -3.75000000000000e+01 +38 175 8.33333333333333e+00 +38 37 -1.66666666666667e+01 +38 316 8.33333333333333e+00 +38 174 -4.16666666666667e+00 +38 156 4.16666666666667e+00 +39 39 2.55000000000000e+01 +39 322 8.33333333333333e-02 +39 40 -1.66666666666667e-01 +39 321 -2.50000000000000e-01 +39 329 -1.66666666666667e-01 +39 325 -8.33333333333333e-02 +39 328 8.33333333333333e-02 +39 41 -8.33333333333333e+00 +39 314 4.16666666666667e+00 +39 326 4.25000000000000e+00 +39 313 4.16666666666667e+00 +39 312 -1.25000000000000e+01 +39 197 -4.16666666666667e+00 +39 179 4.16666666666667e+00 +39 196 4.25000000000000e+00 +39 178 -8.33333333333333e+00 +39 195 -4.33333333333333e+00 +39 323 8.33333333333333e-02 +39 324 -8.41666666666667e+00 +40 40 2.56666666666667e+01 +40 329 8.33333333333333e-02 +40 322 -8.33333333333333e-02 +40 321 8.33333333333333e-02 +40 39 -1.66666666666667e-01 +40 324 -8.33333333333333e-02 +40 327 8.33333333333333e-02 +40 314 -4.16666666666667e+00 +40 179 4.16666666666667e+00 +40 313 -4.16666666666667e+00 +40 312 4.16666666666667e+00 +40 197 4.25000000000000e+00 +40 41 -8.50000000000000e+00 +40 326 4.25000000000000e+00 +40 196 -1.30000000000000e+01 +40 323 -8.33333333333333e-02 +40 325 -8.41666666666667e+00 +40 195 4.25000000000000e+00 +40 177 -8.33333333333333e+00 +41 41 3.38333333333333e+01 +41 322 -8.33333333333333e-02 +41 328 8.33333333333333e-02 +41 321 8.33333333333333e-02 +41 327 -1.66666666666667e-01 +41 314 -4.16666666666667e+00 +41 313 -4.16666666666667e+00 +41 178 4.16666666666667e+00 +41 39 -8.33333333333333e+00 +41 312 4.16666666666667e+00 +41 324 4.25000000000000e+00 +41 197 -4.33333333333333e+00 +41 323 -8.33333333333333e-02 +41 326 -2.52500000000000e+01 +41 196 4.25000000000000e+00 +41 40 -8.50000000000000e+00 +41 325 4.25000000000000e+00 +41 195 -4.16666666666667e+00 +41 177 4.16666666666667e+00 +42 42 1.00000000000000e+00 +42 331 8.33333333333333e-02 +42 43 -1.66666666666667e-01 +42 330 -2.50000000000000e-01 +42 338 -1.66666666666667e-01 +42 334 -8.33333333333333e-02 +42 337 8.33333333333333e-02 +42 44 -1.66666666666667e-01 +42 323 8.33333333333333e-02 +42 335 1.66666666666667e-01 +42 322 8.33333333333333e-02 +42 321 -2.50000000000000e-01 +42 218 -8.33333333333333e-02 +42 200 8.33333333333333e-02 +42 217 1.66666666666667e-01 +42 199 -1.66666666666667e-01 +42 216 -2.50000000000000e-01 +42 332 8.33333333333333e-02 +42 333 -2.50000000000000e-01 +43 43 1.16666666666667e+00 +43 338 8.33333333333333e-02 +43 331 -8.33333333333333e-02 +43 330 8.33333333333333e-02 +43 42 -1.66666666666667e-01 +43 333 -8.33333333333333e-02 +43 336 8.33333333333333e-02 +43 323 -8.33333333333333e-02 +43 200 8.33333333333333e-02 +43 322 -8.33333333333333e-02 +43 321 8.33333333333333e-02 +43 218 1.66666666666667e-01 +43 44 -3.33333333333333e-01 +43 335 1.66666666666667e-01 +43 217 -7.50000000000000e-01 +43 332 -8.33333333333333e-02 +43 334 -2.50000000000000e-01 +43 216 1.66666666666667e-01 +43 198 -1.66666666666667e-01 +44 44 1.16666666666667e+00 +44 331 -8.33333333333333e-02 +44 337 8.33333333333333e-02 +44 330 8.33333333333333e-02 +44 336 -1.66666666666667e-01 +44 323 -8.33333333333333e-02 +44 322 -8.33333333333333e-02 +44 199 8.33333333333333e-02 +44 42 -1.66666666666667e-01 +44 321 8.33333333333333e-02 +44 333 1.66666666666667e-01 +44 218 -2.50000000000000e-01 +44 332 -8.33333333333333e-02 +44 335 -7.50000000000000e-01 +44 217 1.66666666666667e-01 +44 43 -3.33333333333333e-01 +44 334 1.66666666666667e-01 +44 216 -8.33333333333333e-02 +44 198 8.33333333333333e-02 +45 45 1.00000000000000e+00 +45 340 8.33333333333333e-02 +45 46 -1.66666666666667e-01 +45 339 -2.50000000000000e-01 +45 347 -1.66666666666667e-01 +45 343 -8.33333333333333e-02 +45 346 8.33333333333333e-02 +45 47 -1.66666666666667e-01 +45 332 8.33333333333333e-02 +45 344 1.66666666666667e-01 +45 331 8.33333333333333e-02 +45 330 -2.50000000000000e-01 +45 239 -8.33333333333333e-02 +45 221 8.33333333333333e-02 +45 238 1.66666666666667e-01 +45 220 -1.66666666666667e-01 +45 237 -2.50000000000000e-01 +45 341 8.33333333333333e-02 +45 342 -2.50000000000000e-01 +46 46 1.16666666666667e+00 +46 347 8.33333333333333e-02 +46 340 -8.33333333333333e-02 +46 339 8.33333333333333e-02 +46 45 -1.66666666666667e-01 +46 342 -8.33333333333333e-02 +46 345 8.33333333333333e-02 +46 332 -8.33333333333333e-02 +46 221 8.33333333333333e-02 +46 331 -8.33333333333333e-02 +46 330 8.33333333333333e-02 +46 239 1.66666666666667e-01 +46 47 -3.33333333333333e-01 +46 344 1.66666666666667e-01 +46 238 -7.50000000000000e-01 +46 341 -8.33333333333333e-02 +46 343 -2.50000000000000e-01 +46 237 1.66666666666667e-01 +46 219 -1.66666666666667e-01 +47 47 1.16666666666667e+00 +47 340 -8.33333333333333e-02 +47 346 8.33333333333333e-02 +47 339 8.33333333333333e-02 +47 345 -1.66666666666667e-01 +47 332 -8.33333333333333e-02 +47 331 -8.33333333333333e-02 +47 220 8.33333333333333e-02 +47 45 -1.66666666666667e-01 +47 330 8.33333333333333e-02 +47 342 1.66666666666667e-01 +47 239 -2.50000000000000e-01 +47 341 -8.33333333333333e-02 +47 344 -7.50000000000000e-01 +47 238 1.66666666666667e-01 +47 46 -3.33333333333333e-01 +47 343 1.66666666666667e-01 +47 237 -8.33333333333333e-02 +47 219 8.33333333333333e-02 +48 48 1.00000000000000e+00 +48 349 8.33333333333333e-02 +48 49 -1.66666666666667e-01 +48 348 -2.50000000000000e-01 +48 356 -1.66666666666667e-01 +48 352 -8.33333333333333e-02 +48 355 8.33333333333333e-02 +48 50 -1.66666666666667e-01 +48 341 8.33333333333333e-02 +48 353 1.66666666666667e-01 +48 340 8.33333333333333e-02 +48 339 -2.50000000000000e-01 +48 260 -8.33333333333333e-02 +48 242 8.33333333333333e-02 +48 259 1.66666666666667e-01 +48 241 -1.66666666666667e-01 +48 258 -2.50000000000000e-01 +48 350 8.33333333333333e-02 +48 351 -2.50000000000000e-01 +49 49 1.16666666666667e+00 +49 356 8.33333333333333e-02 +49 349 -8.33333333333333e-02 +49 348 8.33333333333333e-02 +49 48 -1.66666666666667e-01 +49 351 -8.33333333333333e-02 +49 354 8.33333333333333e-02 +49 341 -8.33333333333333e-02 +49 242 8.33333333333333e-02 +49 340 -8.33333333333333e-02 +49 339 8.33333333333333e-02 +49 260 1.66666666666667e-01 +49 50 -3.33333333333333e-01 +49 353 1.66666666666667e-01 +49 259 -7.50000000000000e-01 +49 350 -8.33333333333333e-02 +49 352 -2.50000000000000e-01 +49 258 1.66666666666667e-01 +49 240 -1.66666666666667e-01 +50 50 1.16666666666667e+00 +50 349 -8.33333333333333e-02 +50 355 8.33333333333333e-02 +50 348 8.33333333333333e-02 +50 354 -1.66666666666667e-01 +50 341 -8.33333333333333e-02 +50 340 -8.33333333333333e-02 +50 241 8.33333333333333e-02 +50 48 -1.66666666666667e-01 +50 339 8.33333333333333e-02 +50 351 1.66666666666667e-01 +50 260 -2.50000000000000e-01 +50 350 -8.33333333333333e-02 +50 353 -7.50000000000000e-01 +50 259 1.66666666666667e-01 +50 49 -3.33333333333333e-01 +50 352 1.66666666666667e-01 +50 258 -8.33333333333333e-02 +50 240 8.33333333333333e-02 +51 51 5.00000000000000e-01 +51 350 8.33333333333333e-02 +51 359 8.33333333333333e-02 +51 349 8.33333333333333e-02 +51 348 -2.50000000000000e-01 +51 278 -8.33333333333333e-02 +51 263 8.33333333333333e-02 +51 277 8.33333333333333e-02 +51 262 -1.66666666666667e-01 +51 276 -8.33333333333333e-02 +51 53 -1.66666666666667e-01 +51 357 -1.66666666666667e-01 +52 52 5.00000000000000e-01 +52 263 8.33333333333333e-02 +52 349 -8.33333333333333e-02 +52 348 8.33333333333333e-02 +52 278 8.33333333333333e-02 +52 53 -1.66666666666667e-01 +52 359 8.33333333333333e-02 +52 277 -2.50000000000000e-01 +52 350 -8.33333333333333e-02 +52 358 -1.66666666666667e-01 +52 276 8.33333333333333e-02 +52 261 -1.66666666666667e-01 +53 53 6.66666666666667e-01 +53 349 -8.33333333333333e-02 +53 262 8.33333333333333e-02 +53 51 -1.66666666666667e-01 +53 348 8.33333333333333e-02 +53 357 8.33333333333333e-02 +53 278 -8.33333333333333e-02 +53 350 -8.33333333333333e-02 +53 359 -5.00000000000000e-01 +53 277 8.33333333333333e-02 +53 52 -1.66666666666667e-01 +53 358 8.33333333333333e-02 +53 276 -8.33333333333333e-02 +53 261 8.33333333333333e-02 +54 54 1.00000000000000e+00 +54 368 0.00000000000000e+00 +54 364 0.00000000000000e+00 +54 363 0.00000000000000e+00 +54 56 0.00000000000000e+00 +54 362 0.00000000000000e+00 +54 119 0.00000000000000e+00 +54 361 0.00000000000000e+00 +54 367 0.00000000000000e+00 +54 365 0.00000000000000e+00 +54 360 0.00000000000000e+00 +54 117 0.00000000000000e+00 +55 55 1.00000000000000e+00 +55 56 0.00000000000000e+00 +55 119 0.00000000000000e+00 +55 364 0.00000000000000e+00 +55 363 0.00000000000000e+00 +55 362 0.00000000000000e+00 +55 368 0.00000000000000e+00 +55 365 0.00000000000000e+00 +55 361 0.00000000000000e+00 +55 118 0.00000000000000e+00 +55 360 0.00000000000000e+00 +55 366 0.00000000000000e+00 +56 56 1.00000000000000e+00 +56 364 0.00000000000000e+00 +56 55 0.00000000000000e+00 +56 118 0.00000000000000e+00 +56 363 0.00000000000000e+00 +56 366 0.00000000000000e+00 +56 365 0.00000000000000e+00 +56 362 0.00000000000000e+00 +56 119 0.00000000000000e+00 +56 361 0.00000000000000e+00 +56 367 0.00000000000000e+00 +56 54 0.00000000000000e+00 +56 360 0.00000000000000e+00 +56 117 0.00000000000000e+00 +57 57 5.00000000000000e+01 +57 377 4.16666666666667e+00 +57 59 -8.33333333333333e+00 +57 371 4.16666666666667e+00 +57 370 4.16666666666667e+00 +57 376 -8.33333333333333e+00 +57 369 -1.25000000000000e+01 +57 140 8.33333333333333e+00 +57 139 -4.16666666666667e+00 +57 121 4.16666666666667e+00 +57 138 -1.25000000000000e+01 +57 362 4.16666666666667e+00 +57 122 -8.33333333333333e+00 +57 361 4.16666666666667e+00 +57 58 -8.33333333333333e+00 +57 373 8.33333333333333e+00 +57 360 -1.25000000000000e+01 +57 374 -4.16666666666667e+00 +57 372 -1.25000000000000e+01 +58 58 5.83333333333333e+01 +58 377 4.16666666666667e+00 +58 370 -4.16666666666667e+00 +58 369 4.16666666666667e+00 +58 375 -8.33333333333333e+00 +58 140 8.33333333333333e+00 +58 59 -1.66666666666667e+01 +58 374 8.33333333333333e+00 +58 139 -1.25000000000000e+01 +58 138 -4.16666666666667e+00 +58 120 4.16666666666667e+00 +58 362 -4.16666666666667e+00 +58 122 4.16666666666667e+00 +58 361 -4.16666666666667e+00 +58 371 -4.16666666666667e+00 +58 373 -3.75000000000000e+01 +58 360 4.16666666666667e+00 +58 57 -8.33333333333333e+00 +58 372 8.33333333333333e+00 +59 59 5.83333333333333e+01 +59 375 4.16666666666667e+00 +59 371 -4.16666666666667e+00 +59 370 -4.16666666666667e+00 +59 376 4.16666666666667e+00 +59 57 -8.33333333333333e+00 +59 369 4.16666666666667e+00 +59 140 -3.75000000000000e+01 +59 139 8.33333333333333e+00 +59 58 -1.66666666666667e+01 +59 373 8.33333333333333e+00 +59 138 8.33333333333333e+00 +59 362 -4.16666666666667e+00 +59 372 -4.16666666666667e+00 +59 374 -1.25000000000000e+01 +59 361 -4.16666666666667e+00 +59 121 4.16666666666667e+00 +59 360 4.16666666666667e+00 +59 120 -8.33333333333333e+00 +60 60 5.00000000000000e+01 +60 386 4.16666666666667e+00 +60 62 -8.33333333333333e+00 +60 380 4.16666666666667e+00 +60 379 4.16666666666667e+00 +60 385 -8.33333333333333e+00 +60 378 -1.25000000000000e+01 +60 161 8.33333333333333e+00 +60 160 -4.16666666666667e+00 +60 142 4.16666666666667e+00 +60 159 -1.25000000000000e+01 +60 371 4.16666666666667e+00 +60 143 -8.33333333333333e+00 +60 370 4.16666666666667e+00 +60 61 -8.33333333333333e+00 +60 382 8.33333333333333e+00 +60 369 -1.25000000000000e+01 +60 383 -4.16666666666667e+00 +60 381 -1.25000000000000e+01 +61 61 5.83333333333333e+01 +61 386 4.16666666666667e+00 +61 379 -4.16666666666667e+00 +61 378 4.16666666666667e+00 +61 384 -8.33333333333333e+00 +61 161 8.33333333333333e+00 +61 62 -1.66666666666667e+01 +61 383 8.33333333333333e+00 +61 160 -1.25000000000000e+01 +61 159 -4.16666666666667e+00 +61 141 4.16666666666667e+00 +61 371 -4.16666666666667e+00 +61 143 4.16666666666667e+00 +61 370 -4.16666666666667e+00 +61 380 -4.16666666666667e+00 +61 382 -3.75000000000000e+01 +61 369 4.16666666666667e+00 +61 60 -8.33333333333333e+00 +61 381 8.33333333333333e+00 +62 62 5.83333333333333e+01 +62 384 4.16666666666667e+00 +62 380 -4.16666666666667e+00 +62 379 -4.16666666666667e+00 +62 385 4.16666666666667e+00 +62 60 -8.33333333333333e+00 +62 378 4.16666666666667e+00 +62 161 -3.75000000000000e+01 +62 160 8.33333333333333e+00 +62 61 -1.66666666666667e+01 +62 382 8.33333333333333e+00 +62 159 8.33333333333333e+00 +62 371 -4.16666666666667e+00 +62 381 -4.16666666666667e+00 +62 383 -1.25000000000000e+01 +62 370 -4.16666666666667e+00 +62 142 4.16666666666667e+00 +62 369 4.16666666666667e+00 +62 141 -8.33333333333333e+00 +63 63 5.00000000000000e+01 +63 395 4.16666666666667e+00 +63 65 -8.33333333333333e+00 +63 389 4.16666666666667e+00 +63 388 4.16666666666667e+00 +63 394 -8.33333333333333e+00 +63 387 -1.25000000000000e+01 +63 182 8.33333333333333e+00 +63 181 -4.16666666666667e+00 +63 163 4.16666666666667e+00 +63 180 -1.25000000000000e+01 +63 380 4.16666666666667e+00 +63 164 -8.33333333333333e+00 +63 379 4.16666666666667e+00 +63 64 -8.33333333333333e+00 +63 391 8.33333333333333e+00 +63 378 -1.25000000000000e+01 +63 392 -4.16666666666667e+00 +63 390 -1.25000000000000e+01 +64 64 5.83333333333333e+01 +64 395 4.16666666666667e+00 +64 388 -4.16666666666667e+00 +64 387 4.16666666666667e+00 +64 393 -8.33333333333333e+00 +64 182 8.33333333333333e+00 +64 65 -1.66666666666667e+01 +64 392 8.33333333333333e+00 +64 181 -1.25000000000000e+01 +64 180 -4.16666666666667e+00 +64 162 4.16666666666667e+00 +64 380 -4.16666666666667e+00 +64 164 4.16666666666667e+00 +64 379 -4.16666666666667e+00 +64 389 -4.16666666666667e+00 +64 391 -3.75000000000000e+01 +64 378 4.16666666666667e+00 +64 63 -8.33333333333333e+00 +64 390 8.33333333333333e+00 +65 65 5.83333333333333e+01 +65 393 4.16666666666667e+00 +65 389 -4.16666666666667e+00 +65 388 -4.16666666666667e+00 +65 394 4.16666666666667e+00 +65 63 -8.33333333333333e+00 +65 387 4.16666666666667e+00 +65 182 -3.75000000000000e+01 +65 181 8.33333333333333e+00 +65 64 -1.66666666666667e+01 +65 391 8.33333333333333e+00 +65 180 8.33333333333333e+00 +65 380 -4.16666666666667e+00 +65 390 -4.16666666666667e+00 +65 392 -1.25000000000000e+01 +65 379 -4.16666666666667e+00 +65 163 4.16666666666667e+00 +65 378 4.16666666666667e+00 +65 162 -8.33333333333333e+00 +66 66 2.55000000000000e+01 +66 404 8.33333333333333e-02 +66 68 -1.66666666666667e-01 +66 398 8.33333333333333e-02 +66 397 8.33333333333333e-02 +66 403 -1.66666666666667e-01 +66 396 -2.50000000000000e-01 +66 203 4.25000000000000e+00 +66 202 -4.16666666666667e+00 +66 184 4.16666666666667e+00 +66 201 -4.33333333333333e+00 +66 389 4.16666666666667e+00 +66 185 -8.33333333333333e+00 +66 388 4.16666666666667e+00 +66 67 -8.33333333333333e+00 +66 400 4.25000000000000e+00 +66 387 -1.25000000000000e+01 +66 401 -8.33333333333333e-02 +66 399 -8.41666666666667e+00 +67 67 3.38333333333333e+01 +67 404 8.33333333333333e-02 +67 397 -8.33333333333333e-02 +67 396 8.33333333333333e-02 +67 402 -1.66666666666667e-01 +67 203 4.25000000000000e+00 +67 68 -8.50000000000000e+00 +67 401 4.25000000000000e+00 +67 202 -4.33333333333333e+00 +67 201 -4.16666666666667e+00 +67 183 4.16666666666667e+00 +67 389 -4.16666666666667e+00 +67 185 4.16666666666667e+00 +67 388 -4.16666666666667e+00 +67 398 -8.33333333333333e-02 +67 400 -2.52500000000000e+01 +67 387 4.16666666666667e+00 +67 66 -8.33333333333333e+00 +67 399 4.25000000000000e+00 +68 68 2.56666666666667e+01 +68 402 8.33333333333333e-02 +68 398 -8.33333333333333e-02 +68 397 -8.33333333333333e-02 +68 403 8.33333333333333e-02 +68 66 -1.66666666666667e-01 +68 396 8.33333333333333e-02 +68 203 -1.30000000000000e+01 +68 202 4.25000000000000e+00 +68 67 -8.50000000000000e+00 +68 400 4.25000000000000e+00 +68 201 4.25000000000000e+00 +68 389 -4.16666666666667e+00 +68 399 -8.33333333333333e-02 +68 401 -8.41666666666667e+00 +68 388 -4.16666666666667e+00 +68 184 4.16666666666667e+00 +68 387 4.16666666666667e+00 +68 183 -8.33333333333333e+00 +69 69 1.00000000000000e+00 +69 413 8.33333333333333e-02 +69 71 -1.66666666666667e-01 +69 407 8.33333333333333e-02 +69 406 8.33333333333333e-02 +69 412 -1.66666666666667e-01 +69 405 -2.50000000000000e-01 +69 224 1.66666666666667e-01 +69 223 -8.33333333333333e-02 +69 205 8.33333333333333e-02 +69 222 -2.50000000000000e-01 +69 398 8.33333333333333e-02 +69 206 -1.66666666666667e-01 +69 397 8.33333333333333e-02 +69 70 -1.66666666666667e-01 +69 409 1.66666666666667e-01 +69 396 -2.50000000000000e-01 +69 410 -8.33333333333333e-02 +69 408 -2.50000000000000e-01 +70 70 1.16666666666667e+00 +70 413 8.33333333333333e-02 +70 406 -8.33333333333333e-02 +70 405 8.33333333333333e-02 +70 411 -1.66666666666667e-01 +70 224 1.66666666666667e-01 +70 71 -3.33333333333333e-01 +70 410 1.66666666666667e-01 +70 223 -2.50000000000000e-01 +70 222 -8.33333333333333e-02 +70 204 8.33333333333333e-02 +70 398 -8.33333333333333e-02 +70 206 8.33333333333333e-02 +70 397 -8.33333333333333e-02 +70 407 -8.33333333333333e-02 +70 409 -7.50000000000000e-01 +70 396 8.33333333333333e-02 +70 69 -1.66666666666667e-01 +70 408 1.66666666666667e-01 +71 71 1.16666666666667e+00 +71 411 8.33333333333333e-02 +71 407 -8.33333333333333e-02 +71 406 -8.33333333333333e-02 +71 412 8.33333333333333e-02 +71 69 -1.66666666666667e-01 +71 405 8.33333333333333e-02 +71 224 -7.50000000000000e-01 +71 223 1.66666666666667e-01 +71 70 -3.33333333333333e-01 +71 409 1.66666666666667e-01 +71 222 1.66666666666667e-01 +71 398 -8.33333333333333e-02 +71 408 -8.33333333333333e-02 +71 410 -2.50000000000000e-01 +71 397 -8.33333333333333e-02 +71 205 8.33333333333333e-02 +71 396 8.33333333333333e-02 +71 204 -1.66666666666667e-01 +72 72 1.00000000000000e+00 +72 422 8.33333333333333e-02 +72 74 -1.66666666666667e-01 +72 416 8.33333333333333e-02 +72 415 8.33333333333333e-02 +72 421 -1.66666666666667e-01 +72 414 -2.50000000000000e-01 +72 245 1.66666666666667e-01 +72 244 -8.33333333333333e-02 +72 226 8.33333333333333e-02 +72 243 -2.50000000000000e-01 +72 407 8.33333333333333e-02 +72 227 -1.66666666666667e-01 +72 406 8.33333333333333e-02 +72 73 -1.66666666666667e-01 +72 418 1.66666666666667e-01 +72 405 -2.50000000000000e-01 +72 419 -8.33333333333333e-02 +72 417 -2.50000000000000e-01 +73 73 1.16666666666667e+00 +73 422 8.33333333333333e-02 +73 415 -8.33333333333333e-02 +73 414 8.33333333333333e-02 +73 420 -1.66666666666667e-01 +73 245 1.66666666666667e-01 +73 74 -3.33333333333333e-01 +73 419 1.66666666666667e-01 +73 244 -2.50000000000000e-01 +73 243 -8.33333333333333e-02 +73 225 8.33333333333333e-02 +73 407 -8.33333333333333e-02 +73 227 8.33333333333333e-02 +73 406 -8.33333333333333e-02 +73 416 -8.33333333333333e-02 +73 418 -7.50000000000000e-01 +73 405 8.33333333333333e-02 +73 72 -1.66666666666667e-01 +73 417 1.66666666666667e-01 +74 74 1.16666666666667e+00 +74 420 8.33333333333333e-02 +74 416 -8.33333333333333e-02 +74 415 -8.33333333333333e-02 +74 421 8.33333333333333e-02 +74 72 -1.66666666666667e-01 +74 414 8.33333333333333e-02 +74 245 -7.50000000000000e-01 +74 244 1.66666666666667e-01 +74 73 -3.33333333333333e-01 +74 418 1.66666666666667e-01 +74 243 1.66666666666667e-01 +74 407 -8.33333333333333e-02 +74 417 -8.33333333333333e-02 +74 419 -2.50000000000000e-01 +74 406 -8.33333333333333e-02 +74 226 8.33333333333333e-02 +74 405 8.33333333333333e-02 +74 225 -1.66666666666667e-01 +75 75 1.00000000000000e+00 +75 431 8.33333333333333e-02 +75 77 -1.66666666666667e-01 +75 425 8.33333333333333e-02 +75 424 8.33333333333333e-02 +75 430 -1.66666666666667e-01 +75 423 -2.50000000000000e-01 +75 266 1.66666666666667e-01 +75 265 -8.33333333333333e-02 +75 247 8.33333333333333e-02 +75 264 -2.50000000000000e-01 +75 416 8.33333333333333e-02 +75 248 -1.66666666666667e-01 +75 415 8.33333333333333e-02 +75 76 -1.66666666666667e-01 +75 427 1.66666666666667e-01 +75 414 -2.50000000000000e-01 +75 428 -8.33333333333333e-02 +75 426 -2.50000000000000e-01 +76 76 1.16666666666667e+00 +76 431 8.33333333333333e-02 +76 424 -8.33333333333333e-02 +76 423 8.33333333333333e-02 +76 429 -1.66666666666667e-01 +76 266 1.66666666666667e-01 +76 77 -3.33333333333333e-01 +76 428 1.66666666666667e-01 +76 265 -2.50000000000000e-01 +76 264 -8.33333333333333e-02 +76 246 8.33333333333333e-02 +76 416 -8.33333333333333e-02 +76 248 8.33333333333333e-02 +76 415 -8.33333333333333e-02 +76 425 -8.33333333333333e-02 +76 427 -7.50000000000000e-01 +76 414 8.33333333333333e-02 +76 75 -1.66666666666667e-01 +76 426 1.66666666666667e-01 +77 77 1.16666666666667e+00 +77 429 8.33333333333333e-02 +77 425 -8.33333333333333e-02 +77 424 -8.33333333333333e-02 +77 430 8.33333333333333e-02 +77 75 -1.66666666666667e-01 +77 423 8.33333333333333e-02 +77 266 -7.50000000000000e-01 +77 265 1.66666666666667e-01 +77 76 -3.33333333333333e-01 +77 427 1.66666666666667e-01 +77 264 1.66666666666667e-01 +77 416 -8.33333333333333e-02 +77 426 -8.33333333333333e-02 +77 428 -2.50000000000000e-01 +77 415 -8.33333333333333e-02 +77 247 8.33333333333333e-02 +77 414 8.33333333333333e-02 +77 246 -1.66666666666667e-01 +78 78 5.00000000000000e-01 +78 280 -8.33333333333333e-02 +78 268 8.33333333333333e-02 +78 279 -8.33333333333333e-02 +78 425 8.33333333333333e-02 +78 269 -1.66666666666667e-01 +78 424 8.33333333333333e-02 +78 79 -1.66666666666667e-01 +78 433 8.33333333333333e-02 +78 423 -2.50000000000000e-01 +78 281 8.33333333333333e-02 +78 432 -1.66666666666667e-01 +79 79 6.66666666666667e-01 +79 80 -1.66666666666667e-01 +79 434 8.33333333333333e-02 +79 280 -8.33333333333333e-02 +79 279 -8.33333333333333e-02 +79 267 8.33333333333333e-02 +79 425 -8.33333333333333e-02 +79 269 8.33333333333333e-02 +79 424 -8.33333333333333e-02 +79 281 8.33333333333333e-02 +79 433 -5.00000000000000e-01 +79 423 8.33333333333333e-02 +79 78 -1.66666666666667e-01 +79 432 8.33333333333333e-02 +80 80 5.00000000000000e-01 +80 280 8.33333333333333e-02 +80 79 -1.66666666666667e-01 +80 433 8.33333333333333e-02 +80 279 8.33333333333333e-02 +80 425 -8.33333333333333e-02 +80 281 -2.50000000000000e-01 +80 434 -1.66666666666667e-01 +80 424 -8.33333333333333e-02 +80 268 8.33333333333333e-02 +80 423 8.33333333333333e-02 +80 267 -1.66666666666667e-01 +81 81 1.00000000000000e+00 +81 290 0.00000000000000e+00 +81 437 0.00000000000000e+00 +81 289 0.00000000000000e+00 +81 124 0.00000000000000e+00 +81 288 0.00000000000000e+00 +81 365 0.00000000000000e+00 +81 125 0.00000000000000e+00 +81 82 0.00000000000000e+00 +81 364 0.00000000000000e+00 +81 436 0.00000000000000e+00 +81 83 0.00000000000000e+00 +81 363 0.00000000000000e+00 +81 435 0.00000000000000e+00 +82 82 1.00000000000000e+00 +82 289 0.00000000000000e+00 +82 288 0.00000000000000e+00 +82 123 0.00000000000000e+00 +82 365 0.00000000000000e+00 +82 125 0.00000000000000e+00 +82 290 0.00000000000000e+00 +82 364 0.00000000000000e+00 +82 436 0.00000000000000e+00 +82 81 0.00000000000000e+00 +82 363 0.00000000000000e+00 +82 435 0.00000000000000e+00 +83 83 1.00000000000000e+00 +83 289 0.00000000000000e+00 +83 81 0.00000000000000e+00 +83 288 0.00000000000000e+00 +83 435 0.00000000000000e+00 +83 290 0.00000000000000e+00 +83 365 0.00000000000000e+00 +83 437 0.00000000000000e+00 +83 364 0.00000000000000e+00 +83 124 0.00000000000000e+00 +83 363 0.00000000000000e+00 +83 123 0.00000000000000e+00 +84 84 7.50000000000000e+01 +84 440 4.16666666666667e+00 +84 298 -4.16666666666667e+00 +84 374 -4.16666666666667e+00 +84 85 -8.33333333333333e+00 +84 439 4.16666666666667e+00 +84 438 -2.50000000000000e+01 +84 299 8.33333333333333e+00 +84 437 4.16666666666667e+00 +84 293 -8.33333333333333e+00 +84 292 4.16666666666667e+00 +84 368 4.16666666666667e+00 +84 436 4.16666666666667e+00 +84 435 -2.50000000000000e+01 +84 146 8.33333333333333e+00 +84 128 -8.33333333333333e+00 +84 297 -1.25000000000000e+01 +84 145 8.33333333333333e+00 +84 127 -8.33333333333333e+00 +84 367 -8.33333333333333e+00 +84 373 8.33333333333333e+00 +84 372 -1.25000000000000e+01 +84 86 -8.33333333333333e+00 +85 85 6.66666666666667e+01 +85 439 -8.33333333333333e+00 +85 84 -8.33333333333333e+00 +85 438 4.16666666666667e+00 +85 293 4.16666666666667e+00 +85 291 4.16666666666667e+00 +85 436 -8.33333333333333e+00 +85 435 4.16666666666667e+00 +85 299 8.33333333333333e+00 +85 298 -1.25000000000000e+01 +85 146 -1.66666666666667e+01 +85 374 8.33333333333333e+00 +85 144 8.33333333333333e+00 +85 126 -8.33333333333333e+00 +85 368 4.16666666666667e+00 +85 128 -8.33333333333333e+00 +85 373 -3.75000000000000e+01 +85 297 -4.16666666666667e+00 +85 366 -8.33333333333333e+00 +85 372 8.33333333333333e+00 +86 86 6.66666666666667e+01 +86 438 4.16666666666667e+00 +86 440 -8.33333333333333e+00 +86 372 -4.16666666666667e+00 +86 292 4.16666666666667e+00 +86 297 8.33333333333333e+00 +86 435 4.16666666666667e+00 +86 291 -8.33333333333333e+00 +86 437 -8.33333333333333e+00 +86 366 4.16666666666667e+00 +86 299 -3.75000000000000e+01 +86 298 8.33333333333333e+00 +86 144 8.33333333333333e+00 +86 126 -8.33333333333333e+00 +86 145 -1.66666666666667e+01 +86 373 8.33333333333333e+00 +86 374 -1.25000000000000e+01 +86 84 -8.33333333333333e+00 +86 367 4.16666666666667e+00 +86 127 -8.33333333333333e+00 +87 87 7.50000000000000e+01 +87 443 4.16666666666667e+00 +87 307 -4.16666666666667e+00 +87 383 -4.16666666666667e+00 +87 88 -8.33333333333333e+00 +87 442 4.16666666666667e+00 +87 441 -2.50000000000000e+01 +87 308 8.33333333333333e+00 +87 440 4.16666666666667e+00 +87 302 -8.33333333333333e+00 +87 301 4.16666666666667e+00 +87 377 4.16666666666667e+00 +87 439 4.16666666666667e+00 +87 438 -2.50000000000000e+01 +87 167 8.33333333333333e+00 +87 149 -8.33333333333333e+00 +87 306 -1.25000000000000e+01 +87 166 8.33333333333333e+00 +87 148 -8.33333333333333e+00 +87 376 -8.33333333333333e+00 +87 382 8.33333333333333e+00 +87 381 -1.25000000000000e+01 +87 89 -8.33333333333333e+00 +88 88 6.66666666666667e+01 +88 442 -8.33333333333333e+00 +88 87 -8.33333333333333e+00 +88 441 4.16666666666667e+00 +88 302 4.16666666666667e+00 +88 300 4.16666666666667e+00 +88 439 -8.33333333333333e+00 +88 438 4.16666666666667e+00 +88 308 8.33333333333333e+00 +88 307 -1.25000000000000e+01 +88 167 -1.66666666666667e+01 +88 383 8.33333333333333e+00 +88 165 8.33333333333333e+00 +88 147 -8.33333333333333e+00 +88 377 4.16666666666667e+00 +88 149 -8.33333333333333e+00 +88 382 -3.75000000000000e+01 +88 306 -4.16666666666667e+00 +88 375 -8.33333333333333e+00 +88 381 8.33333333333333e+00 +89 89 6.66666666666667e+01 +89 441 4.16666666666667e+00 +89 443 -8.33333333333333e+00 +89 381 -4.16666666666667e+00 +89 301 4.16666666666667e+00 +89 306 8.33333333333333e+00 +89 438 4.16666666666667e+00 +89 300 -8.33333333333333e+00 +89 440 -8.33333333333333e+00 +89 375 4.16666666666667e+00 +89 308 -3.75000000000000e+01 +89 307 8.33333333333333e+00 +89 165 8.33333333333333e+00 +89 147 -8.33333333333333e+00 +89 166 -1.66666666666667e+01 +89 382 8.33333333333333e+00 +89 383 -1.25000000000000e+01 +89 87 -8.33333333333333e+00 +89 376 4.16666666666667e+00 +89 148 -8.33333333333333e+00 +90 90 7.50000000000000e+01 +90 446 4.16666666666667e+00 +90 316 -4.16666666666667e+00 +90 392 -4.16666666666667e+00 +90 91 -8.33333333333333e+00 +90 445 4.16666666666667e+00 +90 444 -2.50000000000000e+01 +90 317 8.33333333333333e+00 +90 443 4.16666666666667e+00 +90 311 -8.33333333333333e+00 +90 310 4.16666666666667e+00 +90 386 4.16666666666667e+00 +90 442 4.16666666666667e+00 +90 441 -2.50000000000000e+01 +90 188 8.33333333333333e+00 +90 170 -8.33333333333333e+00 +90 315 -1.25000000000000e+01 +90 187 8.33333333333333e+00 +90 169 -8.33333333333333e+00 +90 385 -8.33333333333333e+00 +90 391 8.33333333333333e+00 +90 390 -1.25000000000000e+01 +90 92 -8.33333333333333e+00 +91 91 6.66666666666667e+01 +91 445 -8.33333333333333e+00 +91 90 -8.33333333333333e+00 +91 444 4.16666666666667e+00 +91 311 4.16666666666667e+00 +91 309 4.16666666666667e+00 +91 442 -8.33333333333333e+00 +91 441 4.16666666666667e+00 +91 317 8.33333333333333e+00 +91 316 -1.25000000000000e+01 +91 188 -1.66666666666667e+01 +91 392 8.33333333333333e+00 +91 186 8.33333333333333e+00 +91 168 -8.33333333333333e+00 +91 386 4.16666666666667e+00 +91 170 -8.33333333333333e+00 +91 391 -3.75000000000000e+01 +91 315 -4.16666666666667e+00 +91 384 -8.33333333333333e+00 +91 390 8.33333333333333e+00 +92 92 6.66666666666667e+01 +92 444 4.16666666666667e+00 +92 446 -8.33333333333333e+00 +92 390 -4.16666666666667e+00 +92 310 4.16666666666667e+00 +92 315 8.33333333333333e+00 +92 441 4.16666666666667e+00 +92 309 -8.33333333333333e+00 +92 443 -8.33333333333333e+00 +92 384 4.16666666666667e+00 +92 317 -3.75000000000000e+01 +92 316 8.33333333333333e+00 +92 186 8.33333333333333e+00 +92 168 -8.33333333333333e+00 +92 187 -1.66666666666667e+01 +92 391 8.33333333333333e+00 +92 392 -1.25000000000000e+01 +92 90 -8.33333333333333e+00 +92 385 4.16666666666667e+00 +92 169 -8.33333333333333e+00 +93 93 4.23333333333333e+01 +93 449 8.33333333333333e-02 +93 325 -8.33333333333333e-02 +93 401 -8.33333333333333e-02 +93 94 -1.66666666666667e-01 +93 448 8.33333333333333e-02 +93 447 -5.00000000000000e-01 +93 326 4.25000000000000e+00 +93 446 4.16666666666667e+00 +93 320 -8.33333333333333e+00 +93 319 4.16666666666667e+00 +93 395 4.16666666666667e+00 +93 445 4.16666666666667e+00 +93 444 -2.50000000000000e+01 +93 209 4.25000000000000e+00 +93 191 -8.33333333333333e+00 +93 324 -8.41666666666667e+00 +93 208 4.25000000000000e+00 +93 190 -8.33333333333333e+00 +93 394 -8.33333333333333e+00 +93 400 4.25000000000000e+00 +93 399 -8.41666666666667e+00 +93 95 -1.66666666666667e-01 +94 94 4.21666666666667e+01 +94 448 -1.66666666666667e-01 +94 93 -1.66666666666667e-01 +94 447 8.33333333333333e-02 +94 320 4.16666666666667e+00 +94 318 4.16666666666667e+00 +94 445 -8.33333333333333e+00 +94 444 4.16666666666667e+00 +94 326 4.25000000000000e+00 +94 325 -8.41666666666667e+00 +94 209 -8.50000000000000e+00 +94 401 4.25000000000000e+00 +94 207 4.25000000000000e+00 +94 189 -8.33333333333333e+00 +94 395 4.16666666666667e+00 +94 191 -8.33333333333333e+00 +94 400 -2.52500000000000e+01 +94 324 -8.33333333333333e-02 +94 393 -8.33333333333333e+00 +94 399 4.25000000000000e+00 +95 95 4.21666666666667e+01 +95 447 8.33333333333333e-02 +95 449 -1.66666666666667e-01 +95 399 -8.33333333333333e-02 +95 319 4.16666666666667e+00 +95 324 4.25000000000000e+00 +95 444 4.16666666666667e+00 +95 318 -8.33333333333333e+00 +95 446 -8.33333333333333e+00 +95 393 4.16666666666667e+00 +95 326 -2.52500000000000e+01 +95 325 4.25000000000000e+00 +95 207 4.25000000000000e+00 +95 189 -8.33333333333333e+00 +95 208 -8.50000000000000e+00 +95 400 4.25000000000000e+00 +95 401 -8.41666666666667e+00 +95 93 -1.66666666666667e-01 +95 394 4.16666666666667e+00 +95 190 -8.33333333333333e+00 +96 96 1.50000000000000e+00 +96 452 8.33333333333333e-02 +96 334 -8.33333333333333e-02 +96 410 -8.33333333333333e-02 +96 97 -1.66666666666667e-01 +96 451 8.33333333333333e-02 +96 450 -5.00000000000000e-01 +96 335 1.66666666666667e-01 +96 449 8.33333333333333e-02 +96 329 -1.66666666666667e-01 +96 328 8.33333333333333e-02 +96 404 8.33333333333333e-02 +96 448 8.33333333333333e-02 +96 447 -5.00000000000000e-01 +96 230 1.66666666666667e-01 +96 212 -1.66666666666667e-01 +96 333 -2.50000000000000e-01 +96 229 1.66666666666667e-01 +96 211 -1.66666666666667e-01 +96 403 -1.66666666666667e-01 +96 409 1.66666666666667e-01 +96 408 -2.50000000000000e-01 +96 98 -1.66666666666667e-01 +97 97 1.33333333333333e+00 +97 451 -1.66666666666667e-01 +97 96 -1.66666666666667e-01 +97 450 8.33333333333333e-02 +97 329 8.33333333333333e-02 +97 327 8.33333333333333e-02 +97 448 -1.66666666666667e-01 +97 447 8.33333333333333e-02 +97 335 1.66666666666667e-01 +97 334 -2.50000000000000e-01 +97 230 -3.33333333333333e-01 +97 410 1.66666666666667e-01 +97 228 1.66666666666667e-01 +97 210 -1.66666666666667e-01 +97 404 8.33333333333333e-02 +97 212 -1.66666666666667e-01 +97 409 -7.50000000000000e-01 +97 333 -8.33333333333333e-02 +97 402 -1.66666666666667e-01 +97 408 1.66666666666667e-01 +98 98 1.33333333333333e+00 +98 450 8.33333333333333e-02 +98 452 -1.66666666666667e-01 +98 408 -8.33333333333333e-02 +98 328 8.33333333333333e-02 +98 333 1.66666666666667e-01 +98 447 8.33333333333333e-02 +98 327 -1.66666666666667e-01 +98 449 -1.66666666666667e-01 +98 402 8.33333333333333e-02 +98 335 -7.50000000000000e-01 +98 334 1.66666666666667e-01 +98 228 1.66666666666667e-01 +98 210 -1.66666666666667e-01 +98 229 -3.33333333333333e-01 +98 409 1.66666666666667e-01 +98 410 -2.50000000000000e-01 +98 96 -1.66666666666667e-01 +98 403 8.33333333333333e-02 +98 211 -1.66666666666667e-01 +99 99 1.50000000000000e+00 +99 455 8.33333333333333e-02 +99 343 -8.33333333333333e-02 +99 419 -8.33333333333333e-02 +99 100 -1.66666666666667e-01 +99 454 8.33333333333333e-02 +99 453 -5.00000000000000e-01 +99 344 1.66666666666667e-01 +99 452 8.33333333333333e-02 +99 338 -1.66666666666667e-01 +99 337 8.33333333333333e-02 +99 413 8.33333333333333e-02 +99 451 8.33333333333333e-02 +99 450 -5.00000000000000e-01 +99 251 1.66666666666667e-01 +99 233 -1.66666666666667e-01 +99 342 -2.50000000000000e-01 +99 250 1.66666666666667e-01 +99 232 -1.66666666666667e-01 +99 412 -1.66666666666667e-01 +99 418 1.66666666666667e-01 +99 417 -2.50000000000000e-01 +99 101 -1.66666666666667e-01 +100 100 1.33333333333333e+00 +100 454 -1.66666666666667e-01 +100 99 -1.66666666666667e-01 +100 453 8.33333333333333e-02 +100 338 8.33333333333333e-02 +100 336 8.33333333333333e-02 +100 451 -1.66666666666667e-01 +100 450 8.33333333333333e-02 +100 344 1.66666666666667e-01 +100 343 -2.50000000000000e-01 +100 251 -3.33333333333333e-01 +100 419 1.66666666666667e-01 +100 249 1.66666666666667e-01 +100 231 -1.66666666666667e-01 +100 413 8.33333333333333e-02 +100 233 -1.66666666666667e-01 +100 418 -7.50000000000000e-01 +100 342 -8.33333333333333e-02 +100 411 -1.66666666666667e-01 +100 417 1.66666666666667e-01 +101 101 1.33333333333333e+00 +101 453 8.33333333333333e-02 +101 455 -1.66666666666667e-01 +101 417 -8.33333333333333e-02 +101 337 8.33333333333333e-02 +101 342 1.66666666666667e-01 +101 450 8.33333333333333e-02 +101 336 -1.66666666666667e-01 +101 452 -1.66666666666667e-01 +101 411 8.33333333333333e-02 +101 344 -7.50000000000000e-01 +101 343 1.66666666666667e-01 +101 249 1.66666666666667e-01 +101 231 -1.66666666666667e-01 +101 250 -3.33333333333333e-01 +101 418 1.66666666666667e-01 +101 419 -2.50000000000000e-01 +101 99 -1.66666666666667e-01 +101 412 8.33333333333333e-02 +101 232 -1.66666666666667e-01 +102 102 1.50000000000000e+00 +102 458 8.33333333333333e-02 +102 352 -8.33333333333333e-02 +102 428 -8.33333333333333e-02 +102 103 -1.66666666666667e-01 +102 457 8.33333333333333e-02 +102 456 -5.00000000000000e-01 +102 353 1.66666666666667e-01 +102 455 8.33333333333333e-02 +102 347 -1.66666666666667e-01 +102 346 8.33333333333333e-02 +102 422 8.33333333333333e-02 +102 454 8.33333333333333e-02 +102 453 -5.00000000000000e-01 +102 272 1.66666666666667e-01 +102 254 -1.66666666666667e-01 +102 351 -2.50000000000000e-01 +102 271 1.66666666666667e-01 +102 253 -1.66666666666667e-01 +102 421 -1.66666666666667e-01 +102 427 1.66666666666667e-01 +102 426 -2.50000000000000e-01 +102 104 -1.66666666666667e-01 +103 103 1.33333333333333e+00 +103 457 -1.66666666666667e-01 +103 102 -1.66666666666667e-01 +103 456 8.33333333333333e-02 +103 347 8.33333333333333e-02 +103 345 8.33333333333333e-02 +103 454 -1.66666666666667e-01 +103 453 8.33333333333333e-02 +103 353 1.66666666666667e-01 +103 352 -2.50000000000000e-01 +103 272 -3.33333333333333e-01 +103 428 1.66666666666667e-01 +103 270 1.66666666666667e-01 +103 252 -1.66666666666667e-01 +103 422 8.33333333333333e-02 +103 254 -1.66666666666667e-01 +103 427 -7.50000000000000e-01 +103 351 -8.33333333333333e-02 +103 420 -1.66666666666667e-01 +103 426 1.66666666666667e-01 +104 104 1.33333333333333e+00 +104 456 8.33333333333333e-02 +104 458 -1.66666666666667e-01 +104 426 -8.33333333333333e-02 +104 346 8.33333333333333e-02 +104 351 1.66666666666667e-01 +104 453 8.33333333333333e-02 +104 345 -1.66666666666667e-01 +104 455 -1.66666666666667e-01 +104 420 8.33333333333333e-02 +104 353 -7.50000000000000e-01 +104 352 1.66666666666667e-01 +104 270 1.66666666666667e-01 +104 252 -1.66666666666667e-01 +104 271 -3.33333333333333e-01 +104 427 1.66666666666667e-01 +104 428 -2.50000000000000e-01 +104 102 -1.66666666666667e-01 +104 421 8.33333333333333e-02 +104 253 -1.66666666666667e-01 +105 105 8.33333333333333e-01 +105 458 8.33333333333333e-02 +105 356 -1.66666666666667e-01 +105 355 8.33333333333333e-02 +105 431 8.33333333333333e-02 +105 457 8.33333333333333e-02 +105 456 -5.00000000000000e-01 +105 284 8.33333333333333e-02 +105 275 -1.66666666666667e-01 +105 357 -1.66666666666667e-01 +105 283 8.33333333333333e-02 +105 274 -1.66666666666667e-01 +105 430 -1.66666666666667e-01 +105 433 8.33333333333333e-02 +105 432 -1.66666666666667e-01 +105 359 8.33333333333333e-02 +106 106 8.33333333333333e-01 +106 354 8.33333333333333e-02 +106 457 -1.66666666666667e-01 +106 456 8.33333333333333e-02 +106 359 8.33333333333333e-02 +106 358 -1.66666666666667e-01 +106 284 -1.66666666666667e-01 +106 434 8.33333333333333e-02 +106 282 8.33333333333333e-02 +106 273 -1.66666666666667e-01 +106 431 8.33333333333333e-02 +106 275 -1.66666666666667e-01 +106 433 -5.00000000000000e-01 +106 356 8.33333333333333e-02 +106 429 -1.66666666666667e-01 +106 432 8.33333333333333e-02 +107 107 8.33333333333333e-01 +107 357 8.33333333333333e-02 +107 456 8.33333333333333e-02 +107 354 -1.66666666666667e-01 +107 458 -1.66666666666667e-01 +107 429 8.33333333333333e-02 +107 359 -5.00000000000000e-01 +107 358 8.33333333333333e-02 +107 282 8.33333333333333e-02 +107 273 -1.66666666666667e-01 +107 283 -1.66666666666667e-01 +107 433 8.33333333333333e-02 +107 434 -1.66666666666667e-01 +107 355 8.33333333333333e-02 +107 430 8.33333333333333e-02 +107 274 -1.66666666666667e-01 +108 108 7.50000000000000e+01 +108 4 4.16666666666667e+00 +108 133 -8.33333333333333e+00 +108 116 -4.16666666666667e+00 +108 109 -8.33333333333333e+00 +108 115 8.33333333333333e+00 +108 1 0.00000000000000e+00 +108 114 -1.25000000000000e+01 +108 146 -8.33333333333333e+00 +108 128 8.33333333333333e+00 +108 5 4.16666666666667e+00 +108 140 -8.33333333333333e+00 +108 139 4.16666666666667e+00 +108 145 -8.33333333333333e+00 +108 3 -2.50000000000000e+01 +108 110 -8.33333333333333e+00 +108 122 8.33333333333333e+00 +108 2 0.00000000000000e+00 +108 121 -4.16666666666667e+00 +108 127 8.33333333333333e+00 +108 134 4.16666666666667e+00 +108 120 -1.25000000000000e+01 +108 0 0.00000000000000e+00 +109 109 6.66666666666667e+01 +109 3 4.16666666666667e+00 +109 132 -8.33333333333333e+00 +109 116 8.33333333333333e+00 +109 115 -3.75000000000000e+01 +109 108 -8.33333333333333e+00 +109 114 8.33333333333333e+00 +109 0 0.00000000000000e+00 +109 140 4.16666666666667e+00 +109 146 -8.33333333333333e+00 +109 4 -8.33333333333333e+00 +109 138 4.16666666666667e+00 +109 144 -8.33333333333333e+00 +109 122 8.33333333333333e+00 +109 128 -1.66666666666667e+01 +109 134 4.16666666666667e+00 +109 121 -1.25000000000000e+01 +109 1 0.00000000000000e+00 +109 120 -4.16666666666667e+00 +109 126 8.33333333333333e+00 +110 110 6.66666666666667e+01 +110 132 4.16666666666667e+00 +110 116 -1.25000000000000e+01 +110 115 8.33333333333333e+00 +110 114 -4.16666666666667e+00 +110 139 4.16666666666667e+00 +110 145 -8.33333333333333e+00 +110 144 -8.33333333333333e+00 +110 126 8.33333333333333e+00 +110 5 -8.33333333333333e+00 +110 3 4.16666666666667e+00 +110 138 -8.33333333333333e+00 +110 133 4.16666666666667e+00 +110 122 -3.75000000000000e+01 +110 2 0.00000000000000e+00 +110 121 8.33333333333333e+00 +110 127 -1.66666666666667e+01 +110 108 -8.33333333333333e+00 +110 120 8.33333333333333e+00 +110 0 0.00000000000000e+00 +111 111 1.00000000000000e+00 +111 286 0.00000000000000e+00 +111 28 0.00000000000000e+00 +111 116 0.00000000000000e+00 +111 115 0.00000000000000e+00 +111 112 0.00000000000000e+00 +111 1 0.00000000000000e+00 +111 114 0.00000000000000e+00 +111 293 0.00000000000000e+00 +111 290 0.00000000000000e+00 +111 289 0.00000000000000e+00 +111 292 0.00000000000000e+00 +111 27 0.00000000000000e+00 +111 125 0.00000000000000e+00 +111 128 0.00000000000000e+00 +111 124 0.00000000000000e+00 +111 127 0.00000000000000e+00 +111 123 0.00000000000000e+00 +111 287 0.00000000000000e+00 +111 0 0.00000000000000e+00 +112 112 1.00000000000000e+00 +112 285 0.00000000000000e+00 +112 27 0.00000000000000e+00 +112 116 0.00000000000000e+00 +112 115 0.00000000000000e+00 +112 114 0.00000000000000e+00 +112 111 0.00000000000000e+00 +112 0 0.00000000000000e+00 +112 293 0.00000000000000e+00 +112 128 0.00000000000000e+00 +112 290 0.00000000000000e+00 +112 29 0.00000000000000e+00 +112 28 0.00000000000000e+00 +112 288 0.00000000000000e+00 +112 291 0.00000000000000e+00 +112 125 0.00000000000000e+00 +112 113 0.00000000000000e+00 +112 2 0.00000000000000e+00 +112 124 0.00000000000000e+00 +112 287 0.00000000000000e+00 +112 1 0.00000000000000e+00 +112 123 0.00000000000000e+00 +112 126 0.00000000000000e+00 +113 113 1.00000000000000e+00 +113 286 0.00000000000000e+00 +113 116 0.00000000000000e+00 +113 115 0.00000000000000e+00 +113 114 0.00000000000000e+00 +113 291 0.00000000000000e+00 +113 288 0.00000000000000e+00 +113 292 0.00000000000000e+00 +113 127 0.00000000000000e+00 +113 29 0.00000000000000e+00 +113 289 0.00000000000000e+00 +113 28 0.00000000000000e+00 +113 125 0.00000000000000e+00 +113 285 0.00000000000000e+00 +113 2 0.00000000000000e+00 +113 124 0.00000000000000e+00 +113 112 0.00000000000000e+00 +113 1 0.00000000000000e+00 +113 123 0.00000000000000e+00 +113 126 0.00000000000000e+00 +114 114 1.25000000000000e+02 +114 292 8.33333333333333e+00 +114 293 8.33333333333333e+00 +114 286 8.33333333333333e+00 +114 285 -1.25000000000000e+01 +114 116 -1.66666666666667e+01 +114 113 0.00000000000000e+00 +114 112 0.00000000000000e+00 +114 111 0.00000000000000e+00 +114 127 -8.33333333333333e+00 +114 115 -1.66666666666667e+01 +114 134 8.33333333333333e+00 +114 298 -8.33333333333333e+00 +114 145 8.33333333333333e+00 +114 128 1.66666666666667e+01 +114 146 -1.66666666666667e+01 +114 32 4.16666666666667e+00 +114 299 -8.33333333333333e+00 +114 133 8.33333333333333e+00 +114 31 -8.33333333333333e+00 +114 132 -3.75000000000000e+01 +114 110 -4.16666666666667e+00 +114 2 0.00000000000000e+00 +114 109 8.33333333333333e+00 +114 1 0.00000000000000e+00 +114 108 -1.25000000000000e+01 +114 287 -4.16666666666667e+00 +114 126 -2.50000000000000e+01 +115 115 1.25000000000000e+02 +115 291 8.33333333333333e+00 +115 293 -1.66666666666667e+01 +115 32 4.16666666666667e+00 +115 286 -3.75000000000000e+01 +115 285 8.33333333333333e+00 +115 113 0.00000000000000e+00 +115 2 0.00000000000000e+00 +115 112 0.00000000000000e+00 +115 111 0.00000000000000e+00 +115 126 -8.33333333333333e+00 +115 134 -4.16666666666667e+00 +115 114 -1.66666666666667e+01 +115 297 -8.33333333333333e+00 +115 144 8.33333333333333e+00 +115 299 -8.33333333333333e+00 +115 146 8.33333333333333e+00 +115 133 -1.25000000000000e+01 +115 132 8.33333333333333e+00 +115 30 -8.33333333333333e+00 +115 110 8.33333333333333e+00 +115 116 -1.66666666666667e+01 +115 128 1.66666666666667e+01 +115 109 -3.75000000000000e+01 +115 287 8.33333333333333e+00 +115 127 -2.50000000000000e+01 +115 108 8.33333333333333e+00 +115 0 0.00000000000000e+00 +116 116 1.25000000000000e+02 +116 286 8.33333333333333e+00 +116 292 -1.66666666666667e+01 +116 291 8.33333333333333e+00 +116 287 -1.25000000000000e+01 +116 31 4.16666666666667e+00 +116 113 0.00000000000000e+00 +116 112 0.00000000000000e+00 +116 1 0.00000000000000e+00 +116 114 -1.66666666666667e+01 +116 111 0.00000000000000e+00 +116 133 -4.16666666666667e+00 +116 132 8.33333333333333e+00 +116 298 -8.33333333333333e+00 +116 145 8.33333333333333e+00 +116 126 1.66666666666667e+01 +116 144 -1.66666666666667e+01 +116 134 -1.25000000000000e+01 +116 30 4.16666666666667e+00 +116 297 -8.33333333333333e+00 +116 110 -1.25000000000000e+01 +116 285 -4.16666666666667e+00 +116 128 -7.50000000000000e+01 +116 109 8.33333333333333e+00 +116 115 -1.66666666666667e+01 +116 127 1.66666666666667e+01 +116 108 -4.16666666666667e+00 +116 0 0.00000000000000e+00 +117 117 1.00000000000000e+00 +117 365 0.00000000000000e+00 +117 125 0.00000000000000e+00 +117 124 0.00000000000000e+00 +117 123 0.00000000000000e+00 +117 128 0.00000000000000e+00 +117 368 0.00000000000000e+00 +117 361 0.00000000000000e+00 +117 367 0.00000000000000e+00 +117 56 0.00000000000000e+00 +117 362 0.00000000000000e+00 +117 54 0.00000000000000e+00 +117 119 0.00000000000000e+00 +117 122 0.00000000000000e+00 +117 2 0.00000000000000e+00 +117 121 0.00000000000000e+00 +117 127 0.00000000000000e+00 +117 364 0.00000000000000e+00 +117 120 0.00000000000000e+00 +117 0 0.00000000000000e+00 +118 118 1.00000000000000e+00 +118 365 0.00000000000000e+00 +118 56 0.00000000000000e+00 +118 125 0.00000000000000e+00 +118 119 0.00000000000000e+00 +118 2 0.00000000000000e+00 +118 124 0.00000000000000e+00 +118 123 0.00000000000000e+00 +118 360 0.00000000000000e+00 +118 366 0.00000000000000e+00 +118 362 0.00000000000000e+00 +118 368 0.00000000000000e+00 +118 55 0.00000000000000e+00 +118 122 0.00000000000000e+00 +118 128 0.00000000000000e+00 +118 363 0.00000000000000e+00 +118 121 0.00000000000000e+00 +118 1 0.00000000000000e+00 +118 120 0.00000000000000e+00 +118 126 0.00000000000000e+00 +119 119 1.00000000000000e+00 +119 55 0.00000000000000e+00 +119 363 0.00000000000000e+00 +119 125 0.00000000000000e+00 +119 124 0.00000000000000e+00 +119 118 0.00000000000000e+00 +119 1 0.00000000000000e+00 +119 123 0.00000000000000e+00 +119 126 0.00000000000000e+00 +119 366 0.00000000000000e+00 +119 56 0.00000000000000e+00 +119 361 0.00000000000000e+00 +119 367 0.00000000000000e+00 +119 54 0.00000000000000e+00 +119 360 0.00000000000000e+00 +119 364 0.00000000000000e+00 +119 122 0.00000000000000e+00 +119 2 0.00000000000000e+00 +119 121 0.00000000000000e+00 +119 127 0.00000000000000e+00 +119 117 0.00000000000000e+00 +119 120 0.00000000000000e+00 +119 0 0.00000000000000e+00 +120 120 1.25000000000000e+02 +120 146 8.33333333333333e+00 +120 145 -1.66666666666667e+01 +120 140 8.33333333333333e+00 +120 58 4.16666666666667e+00 +120 138 -3.75000000000000e+01 +120 110 8.33333333333333e+00 +120 109 -4.16666666666667e+00 +120 1 0.00000000000000e+00 +120 108 -1.25000000000000e+01 +120 128 -8.33333333333333e+00 +120 122 -1.66666666666667e+01 +120 361 -4.16666666666667e+00 +120 374 -8.33333333333333e+00 +120 368 8.33333333333333e+00 +120 373 -8.33333333333333e+00 +120 367 8.33333333333333e+00 +120 362 8.33333333333333e+00 +120 59 -8.33333333333333e+00 +120 360 -1.25000000000000e+01 +120 119 0.00000000000000e+00 +120 2 0.00000000000000e+00 +120 118 0.00000000000000e+00 +120 121 -1.66666666666667e+01 +120 127 1.66666666666667e+01 +120 117 0.00000000000000e+00 +120 139 8.33333333333333e+00 +120 126 -2.50000000000000e+01 +121 121 1.25000000000000e+02 +121 146 8.33333333333333e+00 +121 138 8.33333333333333e+00 +121 144 -1.66666666666667e+01 +121 139 -1.25000000000000e+01 +121 57 4.16666666666667e+00 +121 110 8.33333333333333e+00 +121 122 -1.66666666666667e+01 +121 109 -1.25000000000000e+01 +121 108 -4.16666666666667e+00 +121 0 0.00000000000000e+00 +121 360 -4.16666666666667e+00 +121 362 8.33333333333333e+00 +121 128 1.66666666666667e+01 +121 368 -1.66666666666667e+01 +121 372 -8.33333333333333e+00 +121 366 8.33333333333333e+00 +121 59 4.16666666666667e+00 +121 374 -8.33333333333333e+00 +121 361 -1.25000000000000e+01 +121 119 0.00000000000000e+00 +121 2 0.00000000000000e+00 +121 118 0.00000000000000e+00 +121 140 -4.16666666666667e+00 +121 127 -7.50000000000000e+01 +121 117 0.00000000000000e+00 +121 120 -1.66666666666667e+01 +121 126 1.66666666666667e+01 +122 122 1.25000000000000e+02 +122 145 8.33333333333333e+00 +122 144 8.33333333333333e+00 +122 140 -1.25000000000000e+01 +122 138 8.33333333333333e+00 +122 110 -3.75000000000000e+01 +122 109 8.33333333333333e+00 +122 121 -1.66666666666667e+01 +122 108 8.33333333333333e+00 +122 126 -8.33333333333333e+00 +122 120 -1.66666666666667e+01 +122 361 8.33333333333333e+00 +122 372 -8.33333333333333e+00 +122 366 8.33333333333333e+00 +122 127 1.66666666666667e+01 +122 367 -1.66666666666667e+01 +122 362 -3.75000000000000e+01 +122 58 4.16666666666667e+00 +122 373 -8.33333333333333e+00 +122 360 8.33333333333333e+00 +122 57 -8.33333333333333e+00 +122 119 0.00000000000000e+00 +122 139 -4.16666666666667e+00 +122 128 -2.50000000000000e+01 +122 118 0.00000000000000e+00 +122 1 0.00000000000000e+00 +122 117 0.00000000000000e+00 +122 0 0.00000000000000e+00 +123 123 1.00000000000000e+00 +123 290 0.00000000000000e+00 +123 289 0.00000000000000e+00 +123 292 0.00000000000000e+00 +123 82 0.00000000000000e+00 +123 288 0.00000000000000e+00 +123 125 0.00000000000000e+00 +123 113 0.00000000000000e+00 +123 112 0.00000000000000e+00 +123 1 0.00000000000000e+00 +123 111 0.00000000000000e+00 +123 364 0.00000000000000e+00 +123 365 0.00000000000000e+00 +123 128 0.00000000000000e+00 +123 368 0.00000000000000e+00 +123 436 0.00000000000000e+00 +123 367 0.00000000000000e+00 +123 83 0.00000000000000e+00 +123 437 0.00000000000000e+00 +123 363 0.00000000000000e+00 +123 119 0.00000000000000e+00 +123 2 0.00000000000000e+00 +123 124 0.00000000000000e+00 +123 118 0.00000000000000e+00 +123 127 0.00000000000000e+00 +123 293 0.00000000000000e+00 +123 117 0.00000000000000e+00 +123 126 0.00000000000000e+00 +124 124 1.00000000000000e+00 +124 293 0.00000000000000e+00 +124 291 0.00000000000000e+00 +124 290 0.00000000000000e+00 +124 289 0.00000000000000e+00 +124 81 0.00000000000000e+00 +124 113 0.00000000000000e+00 +124 112 0.00000000000000e+00 +124 111 0.00000000000000e+00 +124 0 0.00000000000000e+00 +124 128 0.00000000000000e+00 +124 125 0.00000000000000e+00 +124 363 0.00000000000000e+00 +124 437 0.00000000000000e+00 +124 368 0.00000000000000e+00 +124 435 0.00000000000000e+00 +124 366 0.00000000000000e+00 +124 83 0.00000000000000e+00 +124 365 0.00000000000000e+00 +124 364 0.00000000000000e+00 +124 119 0.00000000000000e+00 +124 2 0.00000000000000e+00 +124 288 0.00000000000000e+00 +124 118 0.00000000000000e+00 +124 127 0.00000000000000e+00 +124 123 0.00000000000000e+00 +124 117 0.00000000000000e+00 +124 126 0.00000000000000e+00 +125 125 1.00000000000000e+00 +125 288 0.00000000000000e+00 +125 292 0.00000000000000e+00 +125 290 0.00000000000000e+00 +125 289 0.00000000000000e+00 +125 113 0.00000000000000e+00 +125 112 0.00000000000000e+00 +125 123 0.00000000000000e+00 +125 111 0.00000000000000e+00 +125 127 0.00000000000000e+00 +125 124 0.00000000000000e+00 +125 436 0.00000000000000e+00 +125 367 0.00000000000000e+00 +125 363 0.00000000000000e+00 +125 126 0.00000000000000e+00 +125 366 0.00000000000000e+00 +125 365 0.00000000000000e+00 +125 82 0.00000000000000e+00 +125 364 0.00000000000000e+00 +125 81 0.00000000000000e+00 +125 435 0.00000000000000e+00 +125 291 0.00000000000000e+00 +125 119 0.00000000000000e+00 +125 128 0.00000000000000e+00 +125 118 0.00000000000000e+00 +125 1 0.00000000000000e+00 +125 117 0.00000000000000e+00 +125 0 0.00000000000000e+00 +126 126 2.50000000000000e+02 +126 292 1.66666666666667e+01 +126 291 -2.50000000000000e+01 +126 113 0.00000000000000e+00 +126 112 0.00000000000000e+00 +126 125 0.00000000000000e+00 +126 436 8.33333333333333e+00 +126 124 0.00000000000000e+00 +126 123 0.00000000000000e+00 +126 437 8.33333333333333e+00 +126 115 -8.33333333333333e+00 +126 116 1.66666666666667e+01 +126 128 -3.33333333333333e+01 +126 2 0.00000000000000e+00 +126 114 -2.50000000000000e+01 +126 299 8.33333333333333e+00 +126 86 -8.33333333333333e+00 +126 298 -1.66666666666667e+01 +126 110 8.33333333333333e+00 +126 145 1.66666666666667e+01 +126 127 -3.33333333333333e+01 +126 146 1.66666666666667e+01 +126 85 -8.33333333333333e+00 +126 144 -7.50000000000000e+01 +126 109 8.33333333333333e+00 +126 1 0.00000000000000e+00 +126 122 -8.33333333333333e+00 +126 119 0.00000000000000e+00 +126 373 8.33333333333333e+00 +126 367 -8.33333333333333e+00 +126 118 0.00000000000000e+00 +126 121 1.66666666666667e+01 +126 120 -2.50000000000000e+01 +126 368 1.66666666666667e+01 +126 374 -1.66666666666667e+01 +126 366 -2.50000000000000e+01 +126 293 -8.33333333333333e+00 +127 127 2.50000000000000e+02 +127 291 1.66666666666667e+01 +127 293 1.66666666666667e+01 +127 292 -7.50000000000000e+01 +127 111 0.00000000000000e+00 +127 125 0.00000000000000e+00 +127 435 8.33333333333333e+00 +127 124 0.00000000000000e+00 +127 123 0.00000000000000e+00 +127 437 -1.66666666666667e+01 +127 114 -8.33333333333333e+00 +127 299 8.33333333333333e+00 +127 116 1.66666666666667e+01 +127 115 -2.50000000000000e+01 +127 297 -1.66666666666667e+01 +127 146 -8.33333333333333e+00 +127 144 1.66666666666667e+01 +127 126 -3.33333333333333e+01 +127 145 -2.50000000000000e+01 +127 84 -8.33333333333333e+00 +127 110 -1.66666666666667e+01 +127 108 8.33333333333333e+00 +127 0 0.00000000000000e+00 +127 122 1.66666666666667e+01 +127 128 -3.33333333333333e+01 +127 368 1.66666666666667e+01 +127 372 8.33333333333333e+00 +127 366 -8.33333333333333e+00 +127 119 0.00000000000000e+00 +127 2 0.00000000000000e+00 +127 121 -7.50000000000000e+01 +127 117 0.00000000000000e+00 +127 120 1.66666666666667e+01 +127 374 8.33333333333333e+00 +127 86 -8.33333333333333e+00 +127 367 -2.50000000000000e+01 +127 113 0.00000000000000e+00 +128 128 2.50000000000000e+02 +128 112 0.00000000000000e+00 +128 293 -2.50000000000000e+01 +128 292 1.66666666666667e+01 +128 111 0.00000000000000e+00 +128 124 0.00000000000000e+00 +128 123 0.00000000000000e+00 +128 125 0.00000000000000e+00 +128 436 -1.66666666666667e+01 +128 435 8.33333333333333e+00 +128 298 8.33333333333333e+00 +128 114 1.66666666666667e+01 +128 126 -3.33333333333333e+01 +128 116 -7.50000000000000e+01 +128 115 1.66666666666667e+01 +128 0 0.00000000000000e+00 +128 297 8.33333333333333e+00 +128 84 -8.33333333333333e+00 +128 145 -8.33333333333333e+00 +128 108 8.33333333333333e+00 +128 146 -2.50000000000000e+01 +128 144 1.66666666666667e+01 +128 109 -1.66666666666667e+01 +128 120 -8.33333333333333e+00 +128 117 0.00000000000000e+00 +128 121 1.66666666666667e+01 +128 127 -3.33333333333333e+01 +128 367 1.66666666666667e+01 +128 122 -2.50000000000000e+01 +128 118 0.00000000000000e+00 +128 1 0.00000000000000e+00 +128 368 -7.50000000000000e+01 +128 291 -8.33333333333333e+00 +128 373 8.33333333333333e+00 +128 85 -8.33333333333333e+00 +128 366 1.66666666666667e+01 +128 372 -1.66666666666667e+01 +129 129 7.50000000000000e+01 +129 7 4.16666666666667e+00 +129 154 -8.33333333333333e+00 +129 137 -4.16666666666667e+00 +129 130 -8.33333333333333e+00 +129 136 8.33333333333333e+00 +129 4 4.16666666666667e+00 +129 135 -1.25000000000000e+01 +129 167 -8.33333333333333e+00 +129 149 8.33333333333333e+00 +129 8 4.16666666666667e+00 +129 161 -8.33333333333333e+00 +129 160 4.16666666666667e+00 +129 166 -8.33333333333333e+00 +129 6 -2.50000000000000e+01 +129 131 -8.33333333333333e+00 +129 143 8.33333333333333e+00 +129 5 4.16666666666667e+00 +129 142 -4.16666666666667e+00 +129 148 8.33333333333333e+00 +129 155 4.16666666666667e+00 +129 141 -1.25000000000000e+01 +129 3 -2.50000000000000e+01 +130 130 6.66666666666667e+01 +130 6 4.16666666666667e+00 +130 153 -8.33333333333333e+00 +130 137 8.33333333333333e+00 +130 136 -3.75000000000000e+01 +130 129 -8.33333333333333e+00 +130 135 8.33333333333333e+00 +130 3 4.16666666666667e+00 +130 161 4.16666666666667e+00 +130 167 -8.33333333333333e+00 +130 7 -8.33333333333333e+00 +130 159 4.16666666666667e+00 +130 165 -8.33333333333333e+00 +130 143 8.33333333333333e+00 +130 149 -1.66666666666667e+01 +130 155 4.16666666666667e+00 +130 142 -1.25000000000000e+01 +130 4 -8.33333333333333e+00 +130 141 -4.16666666666667e+00 +130 147 8.33333333333333e+00 +131 131 6.66666666666667e+01 +131 153 4.16666666666667e+00 +131 137 -1.25000000000000e+01 +131 136 8.33333333333333e+00 +131 135 -4.16666666666667e+00 +131 160 4.16666666666667e+00 +131 166 -8.33333333333333e+00 +131 165 -8.33333333333333e+00 +131 147 8.33333333333333e+00 +131 8 -8.33333333333333e+00 +131 6 4.16666666666667e+00 +131 159 -8.33333333333333e+00 +131 154 4.16666666666667e+00 +131 143 -3.75000000000000e+01 +131 5 -8.33333333333333e+00 +131 142 8.33333333333333e+00 +131 148 -1.66666666666667e+01 +131 129 -8.33333333333333e+00 +131 141 8.33333333333333e+00 +131 3 4.16666666666667e+00 +132 132 1.25000000000000e+02 +132 295 -8.33333333333333e+00 +132 137 8.33333333333333e+00 +132 136 8.33333333333333e+00 +132 135 -3.75000000000000e+01 +132 302 -8.33333333333333e+00 +132 301 -8.33333333333333e+00 +132 149 -1.66666666666667e+01 +132 148 8.33333333333333e+00 +132 116 8.33333333333333e+00 +132 134 -1.66666666666667e+01 +132 146 1.66666666666667e+01 +132 298 8.33333333333333e+00 +132 145 -8.33333333333333e+00 +132 5 -4.16666666666667e+00 +132 110 4.16666666666667e+00 +132 4 8.33333333333333e+00 +132 109 -8.33333333333333e+00 +132 3 -1.25000000000000e+01 +132 144 -2.50000000000000e+01 +132 32 -4.16666666666667e+00 +132 299 8.33333333333333e+00 +132 133 -1.66666666666667e+01 +132 31 8.33333333333333e+00 +132 115 8.33333333333333e+00 +132 296 4.16666666666667e+00 +132 30 -1.25000000000000e+01 +132 114 -3.75000000000000e+01 +133 133 1.25000000000000e+02 +133 294 -8.33333333333333e+00 +133 137 -4.16666666666667e+00 +133 136 -1.25000000000000e+01 +133 135 8.33333333333333e+00 +133 302 -8.33333333333333e+00 +133 149 8.33333333333333e+00 +133 300 -8.33333333333333e+00 +133 147 8.33333333333333e+00 +133 116 -4.16666666666667e+00 +133 110 4.16666666666667e+00 +133 297 8.33333333333333e+00 +133 144 -8.33333333333333e+00 +133 5 8.33333333333333e+00 +133 134 -1.66666666666667e+01 +133 146 1.66666666666667e+01 +133 4 -3.75000000000000e+01 +133 145 -2.50000000000000e+01 +133 3 8.33333333333333e+00 +133 108 -8.33333333333333e+00 +133 32 8.33333333333333e+00 +133 299 -1.66666666666667e+01 +133 296 4.16666666666667e+00 +133 31 -3.75000000000000e+01 +133 115 -1.25000000000000e+01 +133 132 -1.66666666666667e+01 +133 30 8.33333333333333e+00 +133 114 8.33333333333333e+00 +134 134 1.25000000000000e+02 +134 295 4.16666666666667e+00 +134 137 -1.25000000000000e+01 +134 136 -4.16666666666667e+00 +134 135 8.33333333333333e+00 +134 300 -8.33333333333333e+00 +134 301 -8.33333333333333e+00 +134 148 8.33333333333333e+00 +134 147 -1.66666666666667e+01 +134 115 -4.16666666666667e+00 +134 109 4.16666666666667e+00 +134 114 8.33333333333333e+00 +134 132 -1.66666666666667e+01 +134 144 1.66666666666667e+01 +134 5 -1.25000000000000e+01 +134 146 -7.50000000000000e+01 +134 4 8.33333333333333e+00 +134 133 -1.66666666666667e+01 +134 145 1.66666666666667e+01 +134 3 -4.16666666666667e+00 +134 108 4.16666666666667e+00 +134 294 4.16666666666667e+00 +134 32 -1.25000000000000e+01 +134 116 -1.25000000000000e+01 +134 31 8.33333333333333e+00 +134 298 -1.66666666666667e+01 +134 30 -4.16666666666667e+00 +134 297 8.33333333333333e+00 +135 135 1.25000000000000e+02 +135 301 8.33333333333333e+00 +135 302 8.33333333333333e+00 +135 295 8.33333333333333e+00 +135 294 -1.25000000000000e+01 +135 137 -1.66666666666667e+01 +135 134 8.33333333333333e+00 +135 133 8.33333333333333e+00 +135 132 -3.75000000000000e+01 +135 148 -8.33333333333333e+00 +135 136 -1.66666666666667e+01 +135 155 8.33333333333333e+00 +135 307 -8.33333333333333e+00 +135 166 8.33333333333333e+00 +135 149 1.66666666666667e+01 +135 167 -1.66666666666667e+01 +135 35 4.16666666666667e+00 +135 308 -8.33333333333333e+00 +135 154 8.33333333333333e+00 +135 34 -8.33333333333333e+00 +135 153 -3.75000000000000e+01 +135 131 -4.16666666666667e+00 +135 5 4.16666666666667e+00 +135 130 8.33333333333333e+00 +135 4 -8.33333333333333e+00 +135 129 -1.25000000000000e+01 +135 296 -4.16666666666667e+00 +135 147 -2.50000000000000e+01 +136 136 1.25000000000000e+02 +136 300 8.33333333333333e+00 +136 302 -1.66666666666667e+01 +136 35 4.16666666666667e+00 +136 295 -3.75000000000000e+01 +136 294 8.33333333333333e+00 +136 134 -4.16666666666667e+00 +136 5 4.16666666666667e+00 +136 133 -1.25000000000000e+01 +136 132 8.33333333333333e+00 +136 147 -8.33333333333333e+00 +136 155 -4.16666666666667e+00 +136 135 -1.66666666666667e+01 +136 306 -8.33333333333333e+00 +136 165 8.33333333333333e+00 +136 308 -8.33333333333333e+00 +136 167 8.33333333333333e+00 +136 154 -1.25000000000000e+01 +136 153 8.33333333333333e+00 +136 33 -8.33333333333333e+00 +136 131 8.33333333333333e+00 +136 137 -1.66666666666667e+01 +136 149 1.66666666666667e+01 +136 130 -3.75000000000000e+01 +136 296 8.33333333333333e+00 +136 148 -2.50000000000000e+01 +136 129 8.33333333333333e+00 +136 3 -8.33333333333333e+00 +137 137 1.25000000000000e+02 +137 295 8.33333333333333e+00 +137 301 -1.66666666666667e+01 +137 300 8.33333333333333e+00 +137 296 -1.25000000000000e+01 +137 34 4.16666666666667e+00 +137 134 -1.25000000000000e+01 +137 133 -4.16666666666667e+00 +137 4 4.16666666666667e+00 +137 135 -1.66666666666667e+01 +137 132 8.33333333333333e+00 +137 154 -4.16666666666667e+00 +137 153 8.33333333333333e+00 +137 307 -8.33333333333333e+00 +137 166 8.33333333333333e+00 +137 147 1.66666666666667e+01 +137 165 -1.66666666666667e+01 +137 155 -1.25000000000000e+01 +137 33 4.16666666666667e+00 +137 306 -8.33333333333333e+00 +137 131 -1.25000000000000e+01 +137 294 -4.16666666666667e+00 +137 149 -7.50000000000000e+01 +137 130 8.33333333333333e+00 +137 136 -1.66666666666667e+01 +137 148 1.66666666666667e+01 +137 129 -4.16666666666667e+00 +137 3 4.16666666666667e+00 +138 138 1.25000000000000e+02 +138 377 -8.33333333333333e+00 +138 370 4.16666666666667e+00 +138 376 -8.33333333333333e+00 +138 371 -8.33333333333333e+00 +138 143 8.33333333333333e+00 +138 142 8.33333333333333e+00 +138 148 -1.66666666666667e+01 +138 141 -3.75000000000000e+01 +138 374 8.33333333333333e+00 +138 146 -8.33333333333333e+00 +138 139 -1.66666666666667e+01 +138 145 1.66666666666667e+01 +138 121 8.33333333333333e+00 +138 5 8.33333333333333e+00 +138 110 -8.33333333333333e+00 +138 4 -4.16666666666667e+00 +138 109 4.16666666666667e+00 +138 3 -1.25000000000000e+01 +138 144 -2.50000000000000e+01 +138 140 -1.66666666666667e+01 +138 59 8.33333333333333e+00 +138 122 8.33333333333333e+00 +138 58 -4.16666666666667e+00 +138 373 8.33333333333333e+00 +138 149 8.33333333333333e+00 +138 57 -1.25000000000000e+01 +138 120 -3.75000000000000e+01 +139 139 1.25000000000000e+02 +139 375 -8.33333333333333e+00 +139 371 4.16666666666667e+00 +139 377 -8.33333333333333e+00 +139 143 -4.16666666666667e+00 +139 149 8.33333333333333e+00 +139 142 -1.25000000000000e+01 +139 141 8.33333333333333e+00 +139 147 -1.66666666666667e+01 +139 110 4.16666666666667e+00 +139 122 -4.16666666666667e+00 +139 138 -1.66666666666667e+01 +139 144 1.66666666666667e+01 +139 120 8.33333333333333e+00 +139 5 8.33333333333333e+00 +139 140 -1.66666666666667e+01 +139 146 1.66666666666667e+01 +139 4 -1.25000000000000e+01 +139 145 -7.50000000000000e+01 +139 3 -4.16666666666667e+00 +139 108 4.16666666666667e+00 +139 59 8.33333333333333e+00 +139 374 -1.66666666666667e+01 +139 369 4.16666666666667e+00 +139 58 -1.25000000000000e+01 +139 121 -1.25000000000000e+01 +139 57 -4.16666666666667e+00 +139 372 8.33333333333333e+00 +140 140 1.25000000000000e+02 +140 375 -8.33333333333333e+00 +140 370 4.16666666666667e+00 +140 376 -8.33333333333333e+00 +140 369 -8.33333333333333e+00 +140 143 -1.25000000000000e+01 +140 142 -4.16666666666667e+00 +140 148 8.33333333333333e+00 +140 141 8.33333333333333e+00 +140 372 8.33333333333333e+00 +140 144 -8.33333333333333e+00 +140 109 4.16666666666667e+00 +140 121 -4.16666666666667e+00 +140 5 -3.75000000000000e+01 +140 146 -2.50000000000000e+01 +140 4 8.33333333333333e+00 +140 139 -1.66666666666667e+01 +140 145 1.66666666666667e+01 +140 3 8.33333333333333e+00 +140 108 -8.33333333333333e+00 +140 147 8.33333333333333e+00 +140 59 -3.75000000000000e+01 +140 122 -1.25000000000000e+01 +140 58 8.33333333333333e+00 +140 373 -1.66666666666667e+01 +140 138 -1.66666666666667e+01 +140 57 8.33333333333333e+00 +140 120 8.33333333333333e+00 +141 141 1.25000000000000e+02 +141 167 8.33333333333333e+00 +141 166 -1.66666666666667e+01 +141 161 8.33333333333333e+00 +141 61 4.16666666666667e+00 +141 159 -3.75000000000000e+01 +141 131 8.33333333333333e+00 +141 130 -4.16666666666667e+00 +141 4 4.16666666666667e+00 +141 129 -1.25000000000000e+01 +141 149 -8.33333333333333e+00 +141 143 -1.66666666666667e+01 +141 370 -4.16666666666667e+00 +141 383 -8.33333333333333e+00 +141 377 8.33333333333333e+00 +141 382 -8.33333333333333e+00 +141 376 8.33333333333333e+00 +141 371 8.33333333333333e+00 +141 62 -8.33333333333333e+00 +141 369 -1.25000000000000e+01 +141 140 8.33333333333333e+00 +141 5 -8.33333333333333e+00 +141 139 8.33333333333333e+00 +141 142 -1.66666666666667e+01 +141 148 1.66666666666667e+01 +141 138 -3.75000000000000e+01 +141 160 8.33333333333333e+00 +141 147 -2.50000000000000e+01 +142 142 1.25000000000000e+02 +142 167 8.33333333333333e+00 +142 159 8.33333333333333e+00 +142 165 -1.66666666666667e+01 +142 160 -1.25000000000000e+01 +142 60 4.16666666666667e+00 +142 131 8.33333333333333e+00 +142 143 -1.66666666666667e+01 +142 130 -1.25000000000000e+01 +142 129 -4.16666666666667e+00 +142 3 4.16666666666667e+00 +142 369 -4.16666666666667e+00 +142 371 8.33333333333333e+00 +142 149 1.66666666666667e+01 +142 377 -1.66666666666667e+01 +142 381 -8.33333333333333e+00 +142 375 8.33333333333333e+00 +142 62 4.16666666666667e+00 +142 383 -8.33333333333333e+00 +142 370 -1.25000000000000e+01 +142 140 -4.16666666666667e+00 +142 5 4.16666666666667e+00 +142 139 -1.25000000000000e+01 +142 161 -4.16666666666667e+00 +142 148 -7.50000000000000e+01 +142 138 8.33333333333333e+00 +142 141 -1.66666666666667e+01 +142 147 1.66666666666667e+01 +143 143 1.25000000000000e+02 +143 166 8.33333333333333e+00 +143 165 8.33333333333333e+00 +143 161 -1.25000000000000e+01 +143 159 8.33333333333333e+00 +143 131 -3.75000000000000e+01 +143 130 8.33333333333333e+00 +143 142 -1.66666666666667e+01 +143 129 8.33333333333333e+00 +143 147 -8.33333333333333e+00 +143 141 -1.66666666666667e+01 +143 370 8.33333333333333e+00 +143 381 -8.33333333333333e+00 +143 375 8.33333333333333e+00 +143 148 1.66666666666667e+01 +143 376 -1.66666666666667e+01 +143 371 -3.75000000000000e+01 +143 61 4.16666666666667e+00 +143 382 -8.33333333333333e+00 +143 369 8.33333333333333e+00 +143 60 -8.33333333333333e+00 +143 140 -1.25000000000000e+01 +143 160 -4.16666666666667e+00 +143 149 -2.50000000000000e+01 +143 139 -4.16666666666667e+00 +143 4 4.16666666666667e+00 +143 138 8.33333333333333e+00 +143 3 -8.33333333333333e+00 +144 144 2.50000000000000e+02 +144 301 -1.66666666666667e+01 +144 149 1.66666666666667e+01 +144 377 -1.66666666666667e+01 +144 439 -8.33333333333333e+00 +144 376 8.33333333333333e+00 +144 440 -8.33333333333333e+00 +144 148 1.66666666666667e+01 +144 147 -7.50000000000000e+01 +144 134 1.66666666666667e+01 +144 115 8.33333333333333e+00 +144 133 -8.33333333333333e+00 +144 116 -1.66666666666667e+01 +144 5 8.33333333333333e+00 +144 132 -2.50000000000000e+01 +144 299 -8.33333333333333e+00 +144 86 8.33333333333333e+00 +144 145 -3.33333333333333e+01 +144 298 1.66666666666667e+01 +144 297 -2.50000000000000e+01 +144 140 -8.33333333333333e+00 +144 139 1.66666666666667e+01 +144 110 -8.33333333333333e+00 +144 122 8.33333333333333e+00 +144 127 1.66666666666667e+01 +144 121 -1.66666666666667e+01 +144 4 8.33333333333333e+00 +144 109 -8.33333333333333e+00 +144 138 -2.50000000000000e+01 +144 146 -3.33333333333333e+01 +144 374 1.66666666666667e+01 +144 128 1.66666666666667e+01 +144 373 -8.33333333333333e+00 +144 85 8.33333333333333e+00 +144 302 8.33333333333333e+00 +144 372 -2.50000000000000e+01 +144 126 -7.50000000000000e+01 +145 145 2.50000000000000e+02 +145 300 -1.66666666666667e+01 +145 149 -8.33333333333333e+00 +145 440 -8.33333333333333e+00 +145 377 8.33333333333333e+00 +145 438 -8.33333333333333e+00 +145 375 8.33333333333333e+00 +145 148 -2.50000000000000e+01 +145 147 1.66666666666667e+01 +145 114 8.33333333333333e+00 +145 132 -8.33333333333333e+00 +145 116 8.33333333333333e+00 +145 134 1.66666666666667e+01 +145 133 -2.50000000000000e+01 +145 299 1.66666666666667e+01 +145 298 -7.50000000000000e+01 +145 144 -3.33333333333333e+01 +145 297 1.66666666666667e+01 +145 128 -8.33333333333333e+00 +145 146 -3.33333333333333e+01 +145 110 -8.33333333333333e+00 +145 122 8.33333333333333e+00 +145 138 1.66666666666667e+01 +145 126 1.66666666666667e+01 +145 120 -1.66666666666667e+01 +145 5 -1.66666666666667e+01 +145 140 1.66666666666667e+01 +145 139 -7.50000000000000e+01 +145 3 8.33333333333333e+00 +145 108 -8.33333333333333e+00 +145 374 1.66666666666667e+01 +145 86 -1.66666666666667e+01 +145 302 8.33333333333333e+00 +145 373 -2.50000000000000e+01 +145 127 -2.50000000000000e+01 +145 372 -8.33333333333333e+00 +145 84 8.33333333333333e+00 +146 146 2.50000000000000e+02 +146 301 8.33333333333333e+00 +146 148 -8.33333333333333e+00 +146 439 -8.33333333333333e+00 +146 376 8.33333333333333e+00 +146 147 1.66666666666667e+01 +146 375 -1.66666666666667e+01 +146 438 -8.33333333333333e+00 +146 149 -2.50000000000000e+01 +146 132 1.66666666666667e+01 +146 115 8.33333333333333e+00 +146 114 -1.66666666666667e+01 +146 134 -7.50000000000000e+01 +146 133 1.66666666666667e+01 +146 3 8.33333333333333e+00 +146 299 -2.50000000000000e+01 +146 298 1.66666666666667e+01 +146 297 -8.33333333333333e+00 +146 84 8.33333333333333e+00 +146 127 -8.33333333333333e+00 +146 145 -3.33333333333333e+01 +146 138 -8.33333333333333e+00 +146 109 -8.33333333333333e+00 +146 121 8.33333333333333e+00 +146 108 -8.33333333333333e+00 +146 120 8.33333333333333e+00 +146 140 -2.50000000000000e+01 +146 4 -1.66666666666667e+01 +146 139 1.66666666666667e+01 +146 300 8.33333333333333e+00 +146 374 -7.50000000000000e+01 +146 128 -2.50000000000000e+01 +146 373 1.66666666666667e+01 +146 85 -1.66666666666667e+01 +146 144 -3.33333333333333e+01 +146 372 1.66666666666667e+01 +146 126 1.66666666666667e+01 +147 147 2.50000000000000e+02 +147 301 1.66666666666667e+01 +147 300 -2.50000000000000e+01 +147 134 -1.66666666666667e+01 +147 133 8.33333333333333e+00 +147 146 1.66666666666667e+01 +147 439 8.33333333333333e+00 +147 145 1.66666666666667e+01 +147 144 -7.50000000000000e+01 +147 440 8.33333333333333e+00 +147 136 -8.33333333333333e+00 +147 137 1.66666666666667e+01 +147 149 -3.33333333333333e+01 +147 5 -8.33333333333333e+00 +147 135 -2.50000000000000e+01 +147 308 8.33333333333333e+00 +147 89 -8.33333333333333e+00 +147 307 -1.66666666666667e+01 +147 131 8.33333333333333e+00 +147 166 1.66666666666667e+01 +147 148 -3.33333333333333e+01 +147 167 1.66666666666667e+01 +147 88 -8.33333333333333e+00 +147 165 -7.50000000000000e+01 +147 130 8.33333333333333e+00 +147 4 -8.33333333333333e+00 +147 143 -8.33333333333333e+00 +147 140 8.33333333333333e+00 +147 382 8.33333333333333e+00 +147 376 -8.33333333333333e+00 +147 139 -1.66666666666667e+01 +147 142 1.66666666666667e+01 +147 141 -2.50000000000000e+01 +147 377 1.66666666666667e+01 +147 383 -1.66666666666667e+01 +147 375 -2.50000000000000e+01 +147 302 -8.33333333333333e+00 +148 148 2.50000000000000e+02 +148 300 1.66666666666667e+01 +148 302 1.66666666666667e+01 +148 301 -7.50000000000000e+01 +148 132 8.33333333333333e+00 +148 146 -8.33333333333333e+00 +148 438 8.33333333333333e+00 +148 145 -2.50000000000000e+01 +148 144 1.66666666666667e+01 +148 440 -1.66666666666667e+01 +148 135 -8.33333333333333e+00 +148 308 8.33333333333333e+00 +148 137 1.66666666666667e+01 +148 136 -2.50000000000000e+01 +148 306 -1.66666666666667e+01 +148 167 -8.33333333333333e+00 +148 165 1.66666666666667e+01 +148 147 -3.33333333333333e+01 +148 166 -2.50000000000000e+01 +148 87 -8.33333333333333e+00 +148 131 -1.66666666666667e+01 +148 129 8.33333333333333e+00 +148 3 -8.33333333333333e+00 +148 143 1.66666666666667e+01 +148 149 -3.33333333333333e+01 +148 377 1.66666666666667e+01 +148 381 8.33333333333333e+00 +148 375 -8.33333333333333e+00 +148 140 8.33333333333333e+00 +148 5 -8.33333333333333e+00 +148 142 -7.50000000000000e+01 +148 138 -1.66666666666667e+01 +148 141 1.66666666666667e+01 +148 383 8.33333333333333e+00 +148 89 -8.33333333333333e+00 +148 376 -2.50000000000000e+01 +148 134 8.33333333333333e+00 +149 149 2.50000000000000e+02 +149 133 8.33333333333333e+00 +149 302 -2.50000000000000e+01 +149 301 1.66666666666667e+01 +149 132 -1.66666666666667e+01 +149 145 -8.33333333333333e+00 +149 144 1.66666666666667e+01 +149 146 -2.50000000000000e+01 +149 439 -1.66666666666667e+01 +149 438 8.33333333333333e+00 +149 307 8.33333333333333e+00 +149 135 1.66666666666667e+01 +149 147 -3.33333333333333e+01 +149 137 -7.50000000000000e+01 +149 136 1.66666666666667e+01 +149 3 -8.33333333333333e+00 +149 306 8.33333333333333e+00 +149 87 -8.33333333333333e+00 +149 166 -8.33333333333333e+00 +149 129 8.33333333333333e+00 +149 167 -2.50000000000000e+01 +149 165 1.66666666666667e+01 +149 130 -1.66666666666667e+01 +149 141 -8.33333333333333e+00 +149 138 8.33333333333333e+00 +149 142 1.66666666666667e+01 +149 148 -3.33333333333333e+01 +149 376 1.66666666666667e+01 +149 143 -2.50000000000000e+01 +149 139 8.33333333333333e+00 +149 4 -8.33333333333333e+00 +149 377 -7.50000000000000e+01 +149 300 -8.33333333333333e+00 +149 382 8.33333333333333e+00 +149 88 -8.33333333333333e+00 +149 375 1.66666666666667e+01 +149 381 -1.66666666666667e+01 +150 150 7.50000000000000e+01 +150 10 4.16666666666667e+00 +150 175 -8.33333333333333e+00 +150 158 -4.16666666666667e+00 +150 151 -8.33333333333333e+00 +150 157 8.33333333333333e+00 +150 7 4.16666666666667e+00 +150 156 -1.25000000000000e+01 +150 188 -8.33333333333333e+00 +150 170 8.33333333333333e+00 +150 11 4.16666666666667e+00 +150 182 -8.33333333333333e+00 +150 181 4.16666666666667e+00 +150 187 -8.33333333333333e+00 +150 9 -2.50000000000000e+01 +150 152 -8.33333333333333e+00 +150 164 8.33333333333333e+00 +150 8 4.16666666666667e+00 +150 163 -4.16666666666667e+00 +150 169 8.33333333333333e+00 +150 176 4.16666666666667e+00 +150 162 -1.25000000000000e+01 +150 6 -2.50000000000000e+01 +151 151 6.66666666666667e+01 +151 9 4.16666666666667e+00 +151 174 -8.33333333333333e+00 +151 158 8.33333333333333e+00 +151 157 -3.75000000000000e+01 +151 150 -8.33333333333333e+00 +151 156 8.33333333333333e+00 +151 6 4.16666666666667e+00 +151 182 4.16666666666667e+00 +151 188 -8.33333333333333e+00 +151 10 -8.33333333333333e+00 +151 180 4.16666666666667e+00 +151 186 -8.33333333333333e+00 +151 164 8.33333333333333e+00 +151 170 -1.66666666666667e+01 +151 176 4.16666666666667e+00 +151 163 -1.25000000000000e+01 +151 7 -8.33333333333333e+00 +151 162 -4.16666666666667e+00 +151 168 8.33333333333333e+00 +152 152 6.66666666666667e+01 +152 174 4.16666666666667e+00 +152 158 -1.25000000000000e+01 +152 157 8.33333333333333e+00 +152 156 -4.16666666666667e+00 +152 181 4.16666666666667e+00 +152 187 -8.33333333333333e+00 +152 186 -8.33333333333333e+00 +152 168 8.33333333333333e+00 +152 11 -8.33333333333333e+00 +152 9 4.16666666666667e+00 +152 180 -8.33333333333333e+00 +152 175 4.16666666666667e+00 +152 164 -3.75000000000000e+01 +152 8 -8.33333333333333e+00 +152 163 8.33333333333333e+00 +152 169 -1.66666666666667e+01 +152 150 -8.33333333333333e+00 +152 162 8.33333333333333e+00 +152 6 4.16666666666667e+00 +153 153 1.25000000000000e+02 +153 304 -8.33333333333333e+00 +153 158 8.33333333333333e+00 +153 157 8.33333333333333e+00 +153 156 -3.75000000000000e+01 +153 311 -8.33333333333333e+00 +153 310 -8.33333333333333e+00 +153 170 -1.66666666666667e+01 +153 169 8.33333333333333e+00 +153 137 8.33333333333333e+00 +153 155 -1.66666666666667e+01 +153 167 1.66666666666667e+01 +153 307 8.33333333333333e+00 +153 166 -8.33333333333333e+00 +153 8 -4.16666666666667e+00 +153 131 4.16666666666667e+00 +153 7 8.33333333333333e+00 +153 130 -8.33333333333333e+00 +153 6 -1.25000000000000e+01 +153 165 -2.50000000000000e+01 +153 35 -4.16666666666667e+00 +153 308 8.33333333333333e+00 +153 154 -1.66666666666667e+01 +153 34 8.33333333333333e+00 +153 136 8.33333333333333e+00 +153 305 4.16666666666667e+00 +153 33 -1.25000000000000e+01 +153 135 -3.75000000000000e+01 +154 154 1.25000000000000e+02 +154 303 -8.33333333333333e+00 +154 158 -4.16666666666667e+00 +154 157 -1.25000000000000e+01 +154 156 8.33333333333333e+00 +154 311 -8.33333333333333e+00 +154 170 8.33333333333333e+00 +154 309 -8.33333333333333e+00 +154 168 8.33333333333333e+00 +154 137 -4.16666666666667e+00 +154 131 4.16666666666667e+00 +154 306 8.33333333333333e+00 +154 165 -8.33333333333333e+00 +154 8 8.33333333333333e+00 +154 155 -1.66666666666667e+01 +154 167 1.66666666666667e+01 +154 7 -3.75000000000000e+01 +154 166 -2.50000000000000e+01 +154 6 8.33333333333333e+00 +154 129 -8.33333333333333e+00 +154 35 8.33333333333333e+00 +154 308 -1.66666666666667e+01 +154 305 4.16666666666667e+00 +154 34 -3.75000000000000e+01 +154 136 -1.25000000000000e+01 +154 153 -1.66666666666667e+01 +154 33 8.33333333333333e+00 +154 135 8.33333333333333e+00 +155 155 1.25000000000000e+02 +155 304 4.16666666666667e+00 +155 158 -1.25000000000000e+01 +155 157 -4.16666666666667e+00 +155 156 8.33333333333333e+00 +155 309 -8.33333333333333e+00 +155 310 -8.33333333333333e+00 +155 169 8.33333333333333e+00 +155 168 -1.66666666666667e+01 +155 136 -4.16666666666667e+00 +155 130 4.16666666666667e+00 +155 135 8.33333333333333e+00 +155 153 -1.66666666666667e+01 +155 165 1.66666666666667e+01 +155 8 -1.25000000000000e+01 +155 167 -7.50000000000000e+01 +155 7 8.33333333333333e+00 +155 154 -1.66666666666667e+01 +155 166 1.66666666666667e+01 +155 6 -4.16666666666667e+00 +155 129 4.16666666666667e+00 +155 303 4.16666666666667e+00 +155 35 -1.25000000000000e+01 +155 137 -1.25000000000000e+01 +155 34 8.33333333333333e+00 +155 307 -1.66666666666667e+01 +155 33 -4.16666666666667e+00 +155 306 8.33333333333333e+00 +156 156 1.25000000000000e+02 +156 310 8.33333333333333e+00 +156 311 8.33333333333333e+00 +156 304 8.33333333333333e+00 +156 303 -1.25000000000000e+01 +156 158 -1.66666666666667e+01 +156 155 8.33333333333333e+00 +156 154 8.33333333333333e+00 +156 153 -3.75000000000000e+01 +156 169 -8.33333333333333e+00 +156 157 -1.66666666666667e+01 +156 176 8.33333333333333e+00 +156 316 -8.33333333333333e+00 +156 187 8.33333333333333e+00 +156 170 1.66666666666667e+01 +156 188 -1.66666666666667e+01 +156 38 4.16666666666667e+00 +156 317 -8.33333333333333e+00 +156 175 8.33333333333333e+00 +156 37 -8.33333333333333e+00 +156 174 -3.75000000000000e+01 +156 152 -4.16666666666667e+00 +156 8 4.16666666666667e+00 +156 151 8.33333333333333e+00 +156 7 -8.33333333333333e+00 +156 150 -1.25000000000000e+01 +156 305 -4.16666666666667e+00 +156 168 -2.50000000000000e+01 +157 157 1.25000000000000e+02 +157 309 8.33333333333333e+00 +157 311 -1.66666666666667e+01 +157 38 4.16666666666667e+00 +157 304 -3.75000000000000e+01 +157 303 8.33333333333333e+00 +157 155 -4.16666666666667e+00 +157 8 4.16666666666667e+00 +157 154 -1.25000000000000e+01 +157 153 8.33333333333333e+00 +157 168 -8.33333333333333e+00 +157 176 -4.16666666666667e+00 +157 156 -1.66666666666667e+01 +157 315 -8.33333333333333e+00 +157 186 8.33333333333333e+00 +157 317 -8.33333333333333e+00 +157 188 8.33333333333333e+00 +157 175 -1.25000000000000e+01 +157 174 8.33333333333333e+00 +157 36 -8.33333333333333e+00 +157 152 8.33333333333333e+00 +157 158 -1.66666666666667e+01 +157 170 1.66666666666667e+01 +157 151 -3.75000000000000e+01 +157 305 8.33333333333333e+00 +157 169 -2.50000000000000e+01 +157 150 8.33333333333333e+00 +157 6 -8.33333333333333e+00 +158 158 1.25000000000000e+02 +158 304 8.33333333333333e+00 +158 310 -1.66666666666667e+01 +158 309 8.33333333333333e+00 +158 305 -1.25000000000000e+01 +158 37 4.16666666666667e+00 +158 155 -1.25000000000000e+01 +158 154 -4.16666666666667e+00 +158 7 4.16666666666667e+00 +158 156 -1.66666666666667e+01 +158 153 8.33333333333333e+00 +158 175 -4.16666666666667e+00 +158 174 8.33333333333333e+00 +158 316 -8.33333333333333e+00 +158 187 8.33333333333333e+00 +158 168 1.66666666666667e+01 +158 186 -1.66666666666667e+01 +158 176 -1.25000000000000e+01 +158 36 4.16666666666667e+00 +158 315 -8.33333333333333e+00 +158 152 -1.25000000000000e+01 +158 303 -4.16666666666667e+00 +158 170 -7.50000000000000e+01 +158 151 8.33333333333333e+00 +158 157 -1.66666666666667e+01 +158 169 1.66666666666667e+01 +158 150 -4.16666666666667e+00 +158 6 4.16666666666667e+00 +159 159 1.25000000000000e+02 +159 386 -8.33333333333333e+00 +159 379 4.16666666666667e+00 +159 385 -8.33333333333333e+00 +159 380 -8.33333333333333e+00 +159 164 8.33333333333333e+00 +159 163 8.33333333333333e+00 +159 169 -1.66666666666667e+01 +159 162 -3.75000000000000e+01 +159 383 8.33333333333333e+00 +159 167 -8.33333333333333e+00 +159 160 -1.66666666666667e+01 +159 166 1.66666666666667e+01 +159 142 8.33333333333333e+00 +159 8 8.33333333333333e+00 +159 131 -8.33333333333333e+00 +159 7 -4.16666666666667e+00 +159 130 4.16666666666667e+00 +159 6 -1.25000000000000e+01 +159 165 -2.50000000000000e+01 +159 161 -1.66666666666667e+01 +159 62 8.33333333333333e+00 +159 143 8.33333333333333e+00 +159 61 -4.16666666666667e+00 +159 382 8.33333333333333e+00 +159 170 8.33333333333333e+00 +159 60 -1.25000000000000e+01 +159 141 -3.75000000000000e+01 +160 160 1.25000000000000e+02 +160 384 -8.33333333333333e+00 +160 380 4.16666666666667e+00 +160 386 -8.33333333333333e+00 +160 164 -4.16666666666667e+00 +160 170 8.33333333333333e+00 +160 163 -1.25000000000000e+01 +160 162 8.33333333333333e+00 +160 168 -1.66666666666667e+01 +160 131 4.16666666666667e+00 +160 143 -4.16666666666667e+00 +160 159 -1.66666666666667e+01 +160 165 1.66666666666667e+01 +160 141 8.33333333333333e+00 +160 8 8.33333333333333e+00 +160 161 -1.66666666666667e+01 +160 167 1.66666666666667e+01 +160 7 -1.25000000000000e+01 +160 166 -7.50000000000000e+01 +160 6 -4.16666666666667e+00 +160 129 4.16666666666667e+00 +160 62 8.33333333333333e+00 +160 383 -1.66666666666667e+01 +160 378 4.16666666666667e+00 +160 61 -1.25000000000000e+01 +160 142 -1.25000000000000e+01 +160 60 -4.16666666666667e+00 +160 381 8.33333333333333e+00 +161 161 1.25000000000000e+02 +161 384 -8.33333333333333e+00 +161 379 4.16666666666667e+00 +161 385 -8.33333333333333e+00 +161 378 -8.33333333333333e+00 +161 164 -1.25000000000000e+01 +161 163 -4.16666666666667e+00 +161 169 8.33333333333333e+00 +161 162 8.33333333333333e+00 +161 381 8.33333333333333e+00 +161 165 -8.33333333333333e+00 +161 130 4.16666666666667e+00 +161 142 -4.16666666666667e+00 +161 8 -3.75000000000000e+01 +161 167 -2.50000000000000e+01 +161 7 8.33333333333333e+00 +161 160 -1.66666666666667e+01 +161 166 1.66666666666667e+01 +161 6 8.33333333333333e+00 +161 129 -8.33333333333333e+00 +161 168 8.33333333333333e+00 +161 62 -3.75000000000000e+01 +161 143 -1.25000000000000e+01 +161 61 8.33333333333333e+00 +161 382 -1.66666666666667e+01 +161 159 -1.66666666666667e+01 +161 60 8.33333333333333e+00 +161 141 8.33333333333333e+00 +162 162 1.25000000000000e+02 +162 188 8.33333333333333e+00 +162 187 -1.66666666666667e+01 +162 182 8.33333333333333e+00 +162 64 4.16666666666667e+00 +162 180 -3.75000000000000e+01 +162 152 8.33333333333333e+00 +162 151 -4.16666666666667e+00 +162 7 4.16666666666667e+00 +162 150 -1.25000000000000e+01 +162 170 -8.33333333333333e+00 +162 164 -1.66666666666667e+01 +162 379 -4.16666666666667e+00 +162 392 -8.33333333333333e+00 +162 386 8.33333333333333e+00 +162 391 -8.33333333333333e+00 +162 385 8.33333333333333e+00 +162 380 8.33333333333333e+00 +162 65 -8.33333333333333e+00 +162 378 -1.25000000000000e+01 +162 161 8.33333333333333e+00 +162 8 -8.33333333333333e+00 +162 160 8.33333333333333e+00 +162 163 -1.66666666666667e+01 +162 169 1.66666666666667e+01 +162 159 -3.75000000000000e+01 +162 181 8.33333333333333e+00 +162 168 -2.50000000000000e+01 +163 163 1.25000000000000e+02 +163 188 8.33333333333333e+00 +163 180 8.33333333333333e+00 +163 186 -1.66666666666667e+01 +163 181 -1.25000000000000e+01 +163 63 4.16666666666667e+00 +163 152 8.33333333333333e+00 +163 164 -1.66666666666667e+01 +163 151 -1.25000000000000e+01 +163 150 -4.16666666666667e+00 +163 6 4.16666666666667e+00 +163 378 -4.16666666666667e+00 +163 380 8.33333333333333e+00 +163 170 1.66666666666667e+01 +163 386 -1.66666666666667e+01 +163 390 -8.33333333333333e+00 +163 384 8.33333333333333e+00 +163 65 4.16666666666667e+00 +163 392 -8.33333333333333e+00 +163 379 -1.25000000000000e+01 +163 161 -4.16666666666667e+00 +163 8 4.16666666666667e+00 +163 160 -1.25000000000000e+01 +163 182 -4.16666666666667e+00 +163 169 -7.50000000000000e+01 +163 159 8.33333333333333e+00 +163 162 -1.66666666666667e+01 +163 168 1.66666666666667e+01 +164 164 1.25000000000000e+02 +164 187 8.33333333333333e+00 +164 186 8.33333333333333e+00 +164 182 -1.25000000000000e+01 +164 180 8.33333333333333e+00 +164 152 -3.75000000000000e+01 +164 151 8.33333333333333e+00 +164 163 -1.66666666666667e+01 +164 150 8.33333333333333e+00 +164 168 -8.33333333333333e+00 +164 162 -1.66666666666667e+01 +164 379 8.33333333333333e+00 +164 390 -8.33333333333333e+00 +164 384 8.33333333333333e+00 +164 169 1.66666666666667e+01 +164 385 -1.66666666666667e+01 +164 380 -3.75000000000000e+01 +164 64 4.16666666666667e+00 +164 391 -8.33333333333333e+00 +164 378 8.33333333333333e+00 +164 63 -8.33333333333333e+00 +164 161 -1.25000000000000e+01 +164 181 -4.16666666666667e+00 +164 170 -2.50000000000000e+01 +164 160 -4.16666666666667e+00 +164 7 4.16666666666667e+00 +164 159 8.33333333333333e+00 +164 6 -8.33333333333333e+00 +165 165 2.50000000000000e+02 +165 310 -1.66666666666667e+01 +165 170 1.66666666666667e+01 +165 386 -1.66666666666667e+01 +165 442 -8.33333333333333e+00 +165 385 8.33333333333333e+00 +165 443 -8.33333333333333e+00 +165 169 1.66666666666667e+01 +165 168 -7.50000000000000e+01 +165 155 1.66666666666667e+01 +165 136 8.33333333333333e+00 +165 154 -8.33333333333333e+00 +165 137 -1.66666666666667e+01 +165 8 8.33333333333333e+00 +165 153 -2.50000000000000e+01 +165 308 -8.33333333333333e+00 +165 89 8.33333333333333e+00 +165 166 -3.33333333333333e+01 +165 307 1.66666666666667e+01 +165 306 -2.50000000000000e+01 +165 161 -8.33333333333333e+00 +165 160 1.66666666666667e+01 +165 131 -8.33333333333333e+00 +165 143 8.33333333333333e+00 +165 148 1.66666666666667e+01 +165 142 -1.66666666666667e+01 +165 7 8.33333333333333e+00 +165 130 -8.33333333333333e+00 +165 159 -2.50000000000000e+01 +165 167 -3.33333333333333e+01 +165 383 1.66666666666667e+01 +165 149 1.66666666666667e+01 +165 382 -8.33333333333333e+00 +165 88 8.33333333333333e+00 +165 311 8.33333333333333e+00 +165 381 -2.50000000000000e+01 +165 147 -7.50000000000000e+01 +166 166 2.50000000000000e+02 +166 309 -1.66666666666667e+01 +166 170 -8.33333333333333e+00 +166 443 -8.33333333333333e+00 +166 386 8.33333333333333e+00 +166 441 -8.33333333333333e+00 +166 384 8.33333333333333e+00 +166 169 -2.50000000000000e+01 +166 168 1.66666666666667e+01 +166 135 8.33333333333333e+00 +166 153 -8.33333333333333e+00 +166 137 8.33333333333333e+00 +166 155 1.66666666666667e+01 +166 154 -2.50000000000000e+01 +166 308 1.66666666666667e+01 +166 307 -7.50000000000000e+01 +166 165 -3.33333333333333e+01 +166 306 1.66666666666667e+01 +166 149 -8.33333333333333e+00 +166 167 -3.33333333333333e+01 +166 131 -8.33333333333333e+00 +166 143 8.33333333333333e+00 +166 159 1.66666666666667e+01 +166 147 1.66666666666667e+01 +166 141 -1.66666666666667e+01 +166 8 -1.66666666666667e+01 +166 161 1.66666666666667e+01 +166 160 -7.50000000000000e+01 +166 6 8.33333333333333e+00 +166 129 -8.33333333333333e+00 +166 383 1.66666666666667e+01 +166 89 -1.66666666666667e+01 +166 311 8.33333333333333e+00 +166 382 -2.50000000000000e+01 +166 148 -2.50000000000000e+01 +166 381 -8.33333333333333e+00 +166 87 8.33333333333333e+00 +167 167 2.50000000000000e+02 +167 310 8.33333333333333e+00 +167 169 -8.33333333333333e+00 +167 442 -8.33333333333333e+00 +167 385 8.33333333333333e+00 +167 168 1.66666666666667e+01 +167 384 -1.66666666666667e+01 +167 441 -8.33333333333333e+00 +167 170 -2.50000000000000e+01 +167 153 1.66666666666667e+01 +167 136 8.33333333333333e+00 +167 135 -1.66666666666667e+01 +167 155 -7.50000000000000e+01 +167 154 1.66666666666667e+01 +167 6 8.33333333333333e+00 +167 308 -2.50000000000000e+01 +167 307 1.66666666666667e+01 +167 306 -8.33333333333333e+00 +167 87 8.33333333333333e+00 +167 148 -8.33333333333333e+00 +167 166 -3.33333333333333e+01 +167 159 -8.33333333333333e+00 +167 130 -8.33333333333333e+00 +167 142 8.33333333333333e+00 +167 129 -8.33333333333333e+00 +167 141 8.33333333333333e+00 +167 161 -2.50000000000000e+01 +167 7 -1.66666666666667e+01 +167 160 1.66666666666667e+01 +167 309 8.33333333333333e+00 +167 383 -7.50000000000000e+01 +167 149 -2.50000000000000e+01 +167 382 1.66666666666667e+01 +167 88 -1.66666666666667e+01 +167 165 -3.33333333333333e+01 +167 381 1.66666666666667e+01 +167 147 1.66666666666667e+01 +168 168 2.50000000000000e+02 +168 310 1.66666666666667e+01 +168 309 -2.50000000000000e+01 +168 155 -1.66666666666667e+01 +168 154 8.33333333333333e+00 +168 167 1.66666666666667e+01 +168 442 8.33333333333333e+00 +168 166 1.66666666666667e+01 +168 165 -7.50000000000000e+01 +168 443 8.33333333333333e+00 +168 157 -8.33333333333333e+00 +168 158 1.66666666666667e+01 +168 170 -3.33333333333333e+01 +168 8 -8.33333333333333e+00 +168 156 -2.50000000000000e+01 +168 317 8.33333333333333e+00 +168 92 -8.33333333333333e+00 +168 316 -1.66666666666667e+01 +168 152 8.33333333333333e+00 +168 187 1.66666666666667e+01 +168 169 -3.33333333333333e+01 +168 188 1.66666666666667e+01 +168 91 -8.33333333333333e+00 +168 186 -7.50000000000000e+01 +168 151 8.33333333333333e+00 +168 7 -8.33333333333333e+00 +168 164 -8.33333333333333e+00 +168 161 8.33333333333333e+00 +168 391 8.33333333333333e+00 +168 385 -8.33333333333333e+00 +168 160 -1.66666666666667e+01 +168 163 1.66666666666667e+01 +168 162 -2.50000000000000e+01 +168 386 1.66666666666667e+01 +168 392 -1.66666666666667e+01 +168 384 -2.50000000000000e+01 +168 311 -8.33333333333333e+00 +169 169 2.50000000000000e+02 +169 309 1.66666666666667e+01 +169 311 1.66666666666667e+01 +169 310 -7.50000000000000e+01 +169 153 8.33333333333333e+00 +169 167 -8.33333333333333e+00 +169 441 8.33333333333333e+00 +169 166 -2.50000000000000e+01 +169 165 1.66666666666667e+01 +169 443 -1.66666666666667e+01 +169 156 -8.33333333333333e+00 +169 317 8.33333333333333e+00 +169 158 1.66666666666667e+01 +169 157 -2.50000000000000e+01 +169 315 -1.66666666666667e+01 +169 188 -8.33333333333333e+00 +169 186 1.66666666666667e+01 +169 168 -3.33333333333333e+01 +169 187 -2.50000000000000e+01 +169 90 -8.33333333333333e+00 +169 152 -1.66666666666667e+01 +169 150 8.33333333333333e+00 +169 6 -8.33333333333333e+00 +169 164 1.66666666666667e+01 +169 170 -3.33333333333333e+01 +169 386 1.66666666666667e+01 +169 390 8.33333333333333e+00 +169 384 -8.33333333333333e+00 +169 161 8.33333333333333e+00 +169 8 -8.33333333333333e+00 +169 163 -7.50000000000000e+01 +169 159 -1.66666666666667e+01 +169 162 1.66666666666667e+01 +169 392 8.33333333333333e+00 +169 92 -8.33333333333333e+00 +169 385 -2.50000000000000e+01 +169 155 8.33333333333333e+00 +170 170 2.50000000000000e+02 +170 154 8.33333333333333e+00 +170 311 -2.50000000000000e+01 +170 310 1.66666666666667e+01 +170 153 -1.66666666666667e+01 +170 166 -8.33333333333333e+00 +170 165 1.66666666666667e+01 +170 167 -2.50000000000000e+01 +170 442 -1.66666666666667e+01 +170 441 8.33333333333333e+00 +170 316 8.33333333333333e+00 +170 156 1.66666666666667e+01 +170 168 -3.33333333333333e+01 +170 158 -7.50000000000000e+01 +170 157 1.66666666666667e+01 +170 6 -8.33333333333333e+00 +170 315 8.33333333333333e+00 +170 90 -8.33333333333333e+00 +170 187 -8.33333333333333e+00 +170 150 8.33333333333333e+00 +170 188 -2.50000000000000e+01 +170 186 1.66666666666667e+01 +170 151 -1.66666666666667e+01 +170 162 -8.33333333333333e+00 +170 159 8.33333333333333e+00 +170 163 1.66666666666667e+01 +170 169 -3.33333333333333e+01 +170 385 1.66666666666667e+01 +170 164 -2.50000000000000e+01 +170 160 8.33333333333333e+00 +170 7 -8.33333333333333e+00 +170 386 -7.50000000000000e+01 +170 309 -8.33333333333333e+00 +170 391 8.33333333333333e+00 +170 91 -8.33333333333333e+00 +170 384 1.66666666666667e+01 +170 390 -1.66666666666667e+01 +171 171 7.50000000000000e+01 +171 13 4.16666666666667e+00 +171 196 -8.33333333333333e+00 +171 179 -4.16666666666667e+00 +171 172 -8.33333333333333e+00 +171 178 8.33333333333333e+00 +171 10 4.16666666666667e+00 +171 177 -1.25000000000000e+01 +171 209 -8.33333333333333e+00 +171 191 8.33333333333333e+00 +171 14 4.16666666666667e+00 +171 203 -8.33333333333333e+00 +171 202 4.16666666666667e+00 +171 208 -8.33333333333333e+00 +171 12 -2.50000000000000e+01 +171 173 -8.33333333333333e+00 +171 185 8.33333333333333e+00 +171 11 4.16666666666667e+00 +171 184 -4.16666666666667e+00 +171 190 8.33333333333333e+00 +171 197 4.16666666666667e+00 +171 183 -1.25000000000000e+01 +171 9 -2.50000000000000e+01 +172 172 6.66666666666667e+01 +172 12 4.16666666666667e+00 +172 195 -8.33333333333333e+00 +172 179 8.33333333333333e+00 +172 178 -3.75000000000000e+01 +172 171 -8.33333333333333e+00 +172 177 8.33333333333333e+00 +172 9 4.16666666666667e+00 +172 203 4.16666666666667e+00 +172 209 -8.33333333333333e+00 +172 13 -8.33333333333333e+00 +172 201 4.16666666666667e+00 +172 207 -8.33333333333333e+00 +172 185 8.33333333333333e+00 +172 191 -1.66666666666667e+01 +172 197 4.16666666666667e+00 +172 184 -1.25000000000000e+01 +172 10 -8.33333333333333e+00 +172 183 -4.16666666666667e+00 +172 189 8.33333333333333e+00 +173 173 6.66666666666667e+01 +173 195 4.16666666666667e+00 +173 179 -1.25000000000000e+01 +173 178 8.33333333333333e+00 +173 177 -4.16666666666667e+00 +173 202 4.16666666666667e+00 +173 208 -8.33333333333333e+00 +173 207 -8.33333333333333e+00 +173 189 8.33333333333333e+00 +173 14 -8.33333333333333e+00 +173 12 4.16666666666667e+00 +173 201 -8.33333333333333e+00 +173 196 4.16666666666667e+00 +173 185 -3.75000000000000e+01 +173 11 -8.33333333333333e+00 +173 184 8.33333333333333e+00 +173 190 -1.66666666666667e+01 +173 171 -8.33333333333333e+00 +173 183 8.33333333333333e+00 +173 9 4.16666666666667e+00 +174 174 1.25000000000000e+02 +174 313 -8.33333333333333e+00 +174 179 8.33333333333333e+00 +174 178 8.33333333333333e+00 +174 177 -3.75000000000000e+01 +174 320 -8.33333333333333e+00 +174 319 -8.33333333333333e+00 +174 191 -1.66666666666667e+01 +174 190 8.33333333333333e+00 +174 158 8.33333333333333e+00 +174 176 -1.66666666666667e+01 +174 188 1.66666666666667e+01 +174 316 8.33333333333333e+00 +174 187 -8.33333333333333e+00 +174 11 -4.16666666666667e+00 +174 152 4.16666666666667e+00 +174 10 8.33333333333333e+00 +174 151 -8.33333333333333e+00 +174 9 -1.25000000000000e+01 +174 186 -2.50000000000000e+01 +174 38 -4.16666666666667e+00 +174 317 8.33333333333333e+00 +174 175 -1.66666666666667e+01 +174 37 8.33333333333333e+00 +174 157 8.33333333333333e+00 +174 314 4.16666666666667e+00 +174 36 -1.25000000000000e+01 +174 156 -3.75000000000000e+01 +175 175 1.25000000000000e+02 +175 312 -8.33333333333333e+00 +175 179 -4.16666666666667e+00 +175 178 -1.25000000000000e+01 +175 177 8.33333333333333e+00 +175 320 -8.33333333333333e+00 +175 191 8.33333333333333e+00 +175 318 -8.33333333333333e+00 +175 189 8.33333333333333e+00 +175 158 -4.16666666666667e+00 +175 152 4.16666666666667e+00 +175 315 8.33333333333333e+00 +175 186 -8.33333333333333e+00 +175 11 8.33333333333333e+00 +175 176 -1.66666666666667e+01 +175 188 1.66666666666667e+01 +175 10 -3.75000000000000e+01 +175 187 -2.50000000000000e+01 +175 9 8.33333333333333e+00 +175 150 -8.33333333333333e+00 +175 38 8.33333333333333e+00 +175 317 -1.66666666666667e+01 +175 314 4.16666666666667e+00 +175 37 -3.75000000000000e+01 +175 157 -1.25000000000000e+01 +175 174 -1.66666666666667e+01 +175 36 8.33333333333333e+00 +175 156 8.33333333333333e+00 +176 176 1.25000000000000e+02 +176 313 4.16666666666667e+00 +176 179 -1.25000000000000e+01 +176 178 -4.16666666666667e+00 +176 177 8.33333333333333e+00 +176 318 -8.33333333333333e+00 +176 319 -8.33333333333333e+00 +176 190 8.33333333333333e+00 +176 189 -1.66666666666667e+01 +176 157 -4.16666666666667e+00 +176 151 4.16666666666667e+00 +176 156 8.33333333333333e+00 +176 174 -1.66666666666667e+01 +176 186 1.66666666666667e+01 +176 11 -1.25000000000000e+01 +176 188 -7.50000000000000e+01 +176 10 8.33333333333333e+00 +176 175 -1.66666666666667e+01 +176 187 1.66666666666667e+01 +176 9 -4.16666666666667e+00 +176 150 4.16666666666667e+00 +176 312 4.16666666666667e+00 +176 38 -1.25000000000000e+01 +176 158 -1.25000000000000e+01 +176 37 8.33333333333333e+00 +176 316 -1.66666666666667e+01 +176 36 -4.16666666666667e+00 +176 315 8.33333333333333e+00 +177 177 1.25000000000000e+02 +177 319 8.33333333333333e+00 +177 320 8.33333333333333e+00 +177 313 8.33333333333333e+00 +177 312 -1.25000000000000e+01 +177 179 -1.66666666666667e+01 +177 176 8.33333333333333e+00 +177 175 8.33333333333333e+00 +177 174 -3.75000000000000e+01 +177 190 -8.33333333333333e+00 +177 178 -1.66666666666667e+01 +177 197 8.33333333333333e+00 +177 325 -8.33333333333333e+00 +177 208 8.33333333333333e+00 +177 191 1.66666666666667e+01 +177 209 -1.66666666666667e+01 +177 41 4.16666666666667e+00 +177 326 -8.33333333333333e+00 +177 196 8.33333333333333e+00 +177 40 -8.33333333333333e+00 +177 195 -3.75000000000000e+01 +177 173 -4.16666666666667e+00 +177 11 4.16666666666667e+00 +177 172 8.33333333333333e+00 +177 10 -8.33333333333333e+00 +177 171 -1.25000000000000e+01 +177 314 -4.16666666666667e+00 +177 189 -2.50000000000000e+01 +178 178 1.25000000000000e+02 +178 318 8.33333333333333e+00 +178 320 -1.66666666666667e+01 +178 41 4.16666666666667e+00 +178 313 -3.75000000000000e+01 +178 312 8.33333333333333e+00 +178 176 -4.16666666666667e+00 +178 11 4.16666666666667e+00 +178 175 -1.25000000000000e+01 +178 174 8.33333333333333e+00 +178 189 -8.33333333333333e+00 +178 197 -4.16666666666667e+00 +178 177 -1.66666666666667e+01 +178 324 -8.33333333333333e+00 +178 207 8.33333333333333e+00 +178 326 -8.33333333333333e+00 +178 209 8.33333333333333e+00 +178 196 -1.25000000000000e+01 +178 195 8.33333333333333e+00 +178 39 -8.33333333333333e+00 +178 173 8.33333333333333e+00 +178 179 -1.66666666666667e+01 +178 191 1.66666666666667e+01 +178 172 -3.75000000000000e+01 +178 314 8.33333333333333e+00 +178 190 -2.50000000000000e+01 +178 171 8.33333333333333e+00 +178 9 -8.33333333333333e+00 +179 179 1.25000000000000e+02 +179 313 8.33333333333333e+00 +179 319 -1.66666666666667e+01 +179 318 8.33333333333333e+00 +179 314 -1.25000000000000e+01 +179 40 4.16666666666667e+00 +179 176 -1.25000000000000e+01 +179 175 -4.16666666666667e+00 +179 10 4.16666666666667e+00 +179 177 -1.66666666666667e+01 +179 174 8.33333333333333e+00 +179 196 -4.16666666666667e+00 +179 195 8.33333333333333e+00 +179 325 -8.33333333333333e+00 +179 208 8.33333333333333e+00 +179 189 1.66666666666667e+01 +179 207 -1.66666666666667e+01 +179 197 -1.25000000000000e+01 +179 39 4.16666666666667e+00 +179 324 -8.33333333333333e+00 +179 173 -1.25000000000000e+01 +179 312 -4.16666666666667e+00 +179 191 -7.50000000000000e+01 +179 172 8.33333333333333e+00 +179 178 -1.66666666666667e+01 +179 190 1.66666666666667e+01 +179 171 -4.16666666666667e+00 +179 9 4.16666666666667e+00 +180 180 1.25000000000000e+02 +180 395 -8.33333333333333e+00 +180 388 4.16666666666667e+00 +180 394 -8.33333333333333e+00 +180 389 -8.33333333333333e+00 +180 185 8.33333333333333e+00 +180 184 8.33333333333333e+00 +180 190 -1.66666666666667e+01 +180 183 -3.75000000000000e+01 +180 392 8.33333333333333e+00 +180 188 -8.33333333333333e+00 +180 181 -1.66666666666667e+01 +180 187 1.66666666666667e+01 +180 163 8.33333333333333e+00 +180 11 8.33333333333333e+00 +180 152 -8.33333333333333e+00 +180 10 -4.16666666666667e+00 +180 151 4.16666666666667e+00 +180 9 -1.25000000000000e+01 +180 186 -2.50000000000000e+01 +180 182 -1.66666666666667e+01 +180 65 8.33333333333333e+00 +180 164 8.33333333333333e+00 +180 64 -4.16666666666667e+00 +180 391 8.33333333333333e+00 +180 191 8.33333333333333e+00 +180 63 -1.25000000000000e+01 +180 162 -3.75000000000000e+01 +181 181 1.25000000000000e+02 +181 393 -8.33333333333333e+00 +181 389 4.16666666666667e+00 +181 395 -8.33333333333333e+00 +181 185 -4.16666666666667e+00 +181 191 8.33333333333333e+00 +181 184 -1.25000000000000e+01 +181 183 8.33333333333333e+00 +181 189 -1.66666666666667e+01 +181 152 4.16666666666667e+00 +181 164 -4.16666666666667e+00 +181 180 -1.66666666666667e+01 +181 186 1.66666666666667e+01 +181 162 8.33333333333333e+00 +181 11 8.33333333333333e+00 +181 182 -1.66666666666667e+01 +181 188 1.66666666666667e+01 +181 10 -1.25000000000000e+01 +181 187 -7.50000000000000e+01 +181 9 -4.16666666666667e+00 +181 150 4.16666666666667e+00 +181 65 8.33333333333333e+00 +181 392 -1.66666666666667e+01 +181 387 4.16666666666667e+00 +181 64 -1.25000000000000e+01 +181 163 -1.25000000000000e+01 +181 63 -4.16666666666667e+00 +181 390 8.33333333333333e+00 +182 182 1.25000000000000e+02 +182 393 -8.33333333333333e+00 +182 388 4.16666666666667e+00 +182 394 -8.33333333333333e+00 +182 387 -8.33333333333333e+00 +182 185 -1.25000000000000e+01 +182 184 -4.16666666666667e+00 +182 190 8.33333333333333e+00 +182 183 8.33333333333333e+00 +182 390 8.33333333333333e+00 +182 186 -8.33333333333333e+00 +182 151 4.16666666666667e+00 +182 163 -4.16666666666667e+00 +182 11 -3.75000000000000e+01 +182 188 -2.50000000000000e+01 +182 10 8.33333333333333e+00 +182 181 -1.66666666666667e+01 +182 187 1.66666666666667e+01 +182 9 8.33333333333333e+00 +182 150 -8.33333333333333e+00 +182 189 8.33333333333333e+00 +182 65 -3.75000000000000e+01 +182 164 -1.25000000000000e+01 +182 64 8.33333333333333e+00 +182 391 -1.66666666666667e+01 +182 180 -1.66666666666667e+01 +182 63 8.33333333333333e+00 +182 162 8.33333333333333e+00 +183 183 1.25000000000000e+02 +183 209 8.33333333333333e+00 +183 208 -1.66666666666667e+01 +183 203 8.33333333333333e+00 +183 67 4.16666666666667e+00 +183 201 -3.75000000000000e+01 +183 173 8.33333333333333e+00 +183 172 -4.16666666666667e+00 +183 10 4.16666666666667e+00 +183 171 -1.25000000000000e+01 +183 191 -8.33333333333333e+00 +183 185 -1.66666666666667e+01 +183 388 -4.16666666666667e+00 +183 401 -8.33333333333333e+00 +183 395 8.33333333333333e+00 +183 400 -8.33333333333333e+00 +183 394 8.33333333333333e+00 +183 389 8.33333333333333e+00 +183 68 -8.33333333333333e+00 +183 387 -1.25000000000000e+01 +183 182 8.33333333333333e+00 +183 11 -8.33333333333333e+00 +183 181 8.33333333333333e+00 +183 184 -1.66666666666667e+01 +183 190 1.66666666666667e+01 +183 180 -3.75000000000000e+01 +183 202 8.33333333333333e+00 +183 189 -2.50000000000000e+01 +184 184 1.25000000000000e+02 +184 209 8.33333333333333e+00 +184 201 8.33333333333333e+00 +184 207 -1.66666666666667e+01 +184 202 -1.25000000000000e+01 +184 66 4.16666666666667e+00 +184 173 8.33333333333333e+00 +184 185 -1.66666666666667e+01 +184 172 -1.25000000000000e+01 +184 171 -4.16666666666667e+00 +184 9 4.16666666666667e+00 +184 387 -4.16666666666667e+00 +184 389 8.33333333333333e+00 +184 191 1.66666666666667e+01 +184 395 -1.66666666666667e+01 +184 399 -8.33333333333333e+00 +184 393 8.33333333333333e+00 +184 68 4.16666666666667e+00 +184 401 -8.33333333333333e+00 +184 388 -1.25000000000000e+01 +184 182 -4.16666666666667e+00 +184 11 4.16666666666667e+00 +184 181 -1.25000000000000e+01 +184 203 -4.16666666666667e+00 +184 190 -7.50000000000000e+01 +184 180 8.33333333333333e+00 +184 183 -1.66666666666667e+01 +184 189 1.66666666666667e+01 +185 185 1.25000000000000e+02 +185 208 8.33333333333333e+00 +185 207 8.33333333333333e+00 +185 203 -1.25000000000000e+01 +185 201 8.33333333333333e+00 +185 173 -3.75000000000000e+01 +185 172 8.33333333333333e+00 +185 184 -1.66666666666667e+01 +185 171 8.33333333333333e+00 +185 189 -8.33333333333333e+00 +185 183 -1.66666666666667e+01 +185 388 8.33333333333333e+00 +185 399 -8.33333333333333e+00 +185 393 8.33333333333333e+00 +185 190 1.66666666666667e+01 +185 394 -1.66666666666667e+01 +185 389 -3.75000000000000e+01 +185 67 4.16666666666667e+00 +185 400 -8.33333333333333e+00 +185 387 8.33333333333333e+00 +185 66 -8.33333333333333e+00 +185 182 -1.25000000000000e+01 +185 202 -4.16666666666667e+00 +185 191 -2.50000000000000e+01 +185 181 -4.16666666666667e+00 +185 10 4.16666666666667e+00 +185 180 8.33333333333333e+00 +185 9 -8.33333333333333e+00 +186 186 2.50000000000000e+02 +186 319 -1.66666666666667e+01 +186 191 1.66666666666667e+01 +186 395 -1.66666666666667e+01 +186 445 -8.33333333333333e+00 +186 394 8.33333333333333e+00 +186 446 -8.33333333333333e+00 +186 190 1.66666666666667e+01 +186 189 -7.50000000000000e+01 +186 176 1.66666666666667e+01 +186 157 8.33333333333333e+00 +186 175 -8.33333333333333e+00 +186 158 -1.66666666666667e+01 +186 11 8.33333333333333e+00 +186 174 -2.50000000000000e+01 +186 317 -8.33333333333333e+00 +186 92 8.33333333333333e+00 +186 187 -3.33333333333333e+01 +186 316 1.66666666666667e+01 +186 315 -2.50000000000000e+01 +186 182 -8.33333333333333e+00 +186 181 1.66666666666667e+01 +186 152 -8.33333333333333e+00 +186 164 8.33333333333333e+00 +186 169 1.66666666666667e+01 +186 163 -1.66666666666667e+01 +186 10 8.33333333333333e+00 +186 151 -8.33333333333333e+00 +186 180 -2.50000000000000e+01 +186 188 -3.33333333333333e+01 +186 392 1.66666666666667e+01 +186 170 1.66666666666667e+01 +186 391 -8.33333333333333e+00 +186 91 8.33333333333333e+00 +186 320 8.33333333333333e+00 +186 390 -2.50000000000000e+01 +186 168 -7.50000000000000e+01 +187 187 2.50000000000000e+02 +187 318 -1.66666666666667e+01 +187 191 -8.33333333333333e+00 +187 446 -8.33333333333333e+00 +187 395 8.33333333333333e+00 +187 444 -8.33333333333333e+00 +187 393 8.33333333333333e+00 +187 190 -2.50000000000000e+01 +187 189 1.66666666666667e+01 +187 156 8.33333333333333e+00 +187 174 -8.33333333333333e+00 +187 158 8.33333333333333e+00 +187 176 1.66666666666667e+01 +187 175 -2.50000000000000e+01 +187 317 1.66666666666667e+01 +187 316 -7.50000000000000e+01 +187 186 -3.33333333333333e+01 +187 315 1.66666666666667e+01 +187 170 -8.33333333333333e+00 +187 188 -3.33333333333333e+01 +187 152 -8.33333333333333e+00 +187 164 8.33333333333333e+00 +187 180 1.66666666666667e+01 +187 168 1.66666666666667e+01 +187 162 -1.66666666666667e+01 +187 11 -1.66666666666667e+01 +187 182 1.66666666666667e+01 +187 181 -7.50000000000000e+01 +187 9 8.33333333333333e+00 +187 150 -8.33333333333333e+00 +187 392 1.66666666666667e+01 +187 92 -1.66666666666667e+01 +187 320 8.33333333333333e+00 +187 391 -2.50000000000000e+01 +187 169 -2.50000000000000e+01 +187 390 -8.33333333333333e+00 +187 90 8.33333333333333e+00 +188 188 2.50000000000000e+02 +188 319 8.33333333333333e+00 +188 190 -8.33333333333333e+00 +188 445 -8.33333333333333e+00 +188 394 8.33333333333333e+00 +188 189 1.66666666666667e+01 +188 393 -1.66666666666667e+01 +188 444 -8.33333333333333e+00 +188 191 -2.50000000000000e+01 +188 174 1.66666666666667e+01 +188 157 8.33333333333333e+00 +188 156 -1.66666666666667e+01 +188 176 -7.50000000000000e+01 +188 175 1.66666666666667e+01 +188 9 8.33333333333333e+00 +188 317 -2.50000000000000e+01 +188 316 1.66666666666667e+01 +188 315 -8.33333333333333e+00 +188 90 8.33333333333333e+00 +188 169 -8.33333333333333e+00 +188 187 -3.33333333333333e+01 +188 180 -8.33333333333333e+00 +188 151 -8.33333333333333e+00 +188 163 8.33333333333333e+00 +188 150 -8.33333333333333e+00 +188 162 8.33333333333333e+00 +188 182 -2.50000000000000e+01 +188 10 -1.66666666666667e+01 +188 181 1.66666666666667e+01 +188 318 8.33333333333333e+00 +188 392 -7.50000000000000e+01 +188 170 -2.50000000000000e+01 +188 391 1.66666666666667e+01 +188 91 -1.66666666666667e+01 +188 186 -3.33333333333333e+01 +188 390 1.66666666666667e+01 +188 168 1.66666666666667e+01 +189 189 2.50000000000000e+02 +189 319 1.66666666666667e+01 +189 318 -2.50000000000000e+01 +189 176 -1.66666666666667e+01 +189 175 8.33333333333333e+00 +189 188 1.66666666666667e+01 +189 445 8.33333333333333e+00 +189 187 1.66666666666667e+01 +189 186 -7.50000000000000e+01 +189 446 8.33333333333333e+00 +189 178 -8.33333333333333e+00 +189 179 1.66666666666667e+01 +189 191 -3.33333333333333e+01 +189 11 -8.33333333333333e+00 +189 177 -2.50000000000000e+01 +189 326 8.33333333333333e+00 +189 95 -8.33333333333333e+00 +189 325 -1.66666666666667e+01 +189 173 8.33333333333333e+00 +189 208 1.66666666666667e+01 +189 190 -3.33333333333333e+01 +189 209 1.66666666666667e+01 +189 94 -8.33333333333333e+00 +189 207 -7.50000000000000e+01 +189 172 8.33333333333333e+00 +189 10 -8.33333333333333e+00 +189 185 -8.33333333333333e+00 +189 182 8.33333333333333e+00 +189 400 8.33333333333333e+00 +189 394 -8.33333333333333e+00 +189 181 -1.66666666666667e+01 +189 184 1.66666666666667e+01 +189 183 -2.50000000000000e+01 +189 395 1.66666666666667e+01 +189 401 -1.66666666666667e+01 +189 393 -2.50000000000000e+01 +189 320 -8.33333333333333e+00 +190 190 2.50000000000000e+02 +190 318 1.66666666666667e+01 +190 320 1.66666666666667e+01 +190 319 -7.50000000000000e+01 +190 174 8.33333333333333e+00 +190 188 -8.33333333333333e+00 +190 444 8.33333333333333e+00 +190 187 -2.50000000000000e+01 +190 186 1.66666666666667e+01 +190 446 -1.66666666666667e+01 +190 177 -8.33333333333333e+00 +190 326 8.33333333333333e+00 +190 179 1.66666666666667e+01 +190 178 -2.50000000000000e+01 +190 324 -1.66666666666667e+01 +190 209 -8.33333333333333e+00 +190 207 1.66666666666667e+01 +190 189 -3.33333333333333e+01 +190 208 -2.50000000000000e+01 +190 93 -8.33333333333333e+00 +190 173 -1.66666666666667e+01 +190 171 8.33333333333333e+00 +190 9 -8.33333333333333e+00 +190 185 1.66666666666667e+01 +190 191 -3.33333333333333e+01 +190 395 1.66666666666667e+01 +190 399 8.33333333333333e+00 +190 393 -8.33333333333333e+00 +190 182 8.33333333333333e+00 +190 11 -8.33333333333333e+00 +190 184 -7.50000000000000e+01 +190 180 -1.66666666666667e+01 +190 183 1.66666666666667e+01 +190 401 8.33333333333333e+00 +190 95 -8.33333333333333e+00 +190 394 -2.50000000000000e+01 +190 176 8.33333333333333e+00 +191 191 2.50000000000000e+02 +191 175 8.33333333333333e+00 +191 320 -2.50000000000000e+01 +191 319 1.66666666666667e+01 +191 174 -1.66666666666667e+01 +191 187 -8.33333333333333e+00 +191 186 1.66666666666667e+01 +191 188 -2.50000000000000e+01 +191 445 -1.66666666666667e+01 +191 444 8.33333333333333e+00 +191 325 8.33333333333333e+00 +191 177 1.66666666666667e+01 +191 189 -3.33333333333333e+01 +191 179 -7.50000000000000e+01 +191 178 1.66666666666667e+01 +191 9 -8.33333333333333e+00 +191 324 8.33333333333333e+00 +191 93 -8.33333333333333e+00 +191 208 -8.33333333333333e+00 +191 171 8.33333333333333e+00 +191 209 -2.50000000000000e+01 +191 207 1.66666666666667e+01 +191 172 -1.66666666666667e+01 +191 183 -8.33333333333333e+00 +191 180 8.33333333333333e+00 +191 184 1.66666666666667e+01 +191 190 -3.33333333333333e+01 +191 394 1.66666666666667e+01 +191 185 -2.50000000000000e+01 +191 181 8.33333333333333e+00 +191 10 -8.33333333333333e+00 +191 395 -7.50000000000000e+01 +191 318 -8.33333333333333e+00 +191 400 8.33333333333333e+00 +191 94 -8.33333333333333e+00 +191 393 1.66666666666667e+01 +191 399 -1.66666666666667e+01 +192 192 1.50000000000000e+00 +192 16 8.33333333333333e-02 +192 217 -1.66666666666667e-01 +192 200 -8.33333333333333e-02 +192 193 -1.66666666666667e-01 +192 199 1.66666666666667e-01 +192 13 8.33333333333333e-02 +192 198 -2.50000000000000e-01 +192 230 -1.66666666666667e-01 +192 212 1.66666666666667e-01 +192 17 8.33333333333333e-02 +192 224 -1.66666666666667e-01 +192 223 8.33333333333333e-02 +192 229 -1.66666666666667e-01 +192 15 -5.00000000000000e-01 +192 194 -1.66666666666667e-01 +192 206 1.66666666666667e-01 +192 14 8.33333333333333e-02 +192 205 -8.33333333333333e-02 +192 211 1.66666666666667e-01 +192 218 8.33333333333333e-02 +192 204 -2.50000000000000e-01 +192 12 -5.00000000000000e-01 +193 193 1.33333333333333e+00 +193 15 8.33333333333333e-02 +193 216 -1.66666666666667e-01 +193 200 1.66666666666667e-01 +193 199 -7.50000000000000e-01 +193 192 -1.66666666666667e-01 +193 198 1.66666666666667e-01 +193 12 8.33333333333333e-02 +193 224 8.33333333333333e-02 +193 230 -1.66666666666667e-01 +193 16 -1.66666666666667e-01 +193 222 8.33333333333333e-02 +193 228 -1.66666666666667e-01 +193 206 1.66666666666667e-01 +193 212 -3.33333333333333e-01 +193 218 8.33333333333333e-02 +193 205 -2.50000000000000e-01 +193 13 -1.66666666666667e-01 +193 204 -8.33333333333333e-02 +193 210 1.66666666666667e-01 +194 194 1.33333333333333e+00 +194 216 8.33333333333333e-02 +194 200 -2.50000000000000e-01 +194 199 1.66666666666667e-01 +194 198 -8.33333333333333e-02 +194 223 8.33333333333333e-02 +194 229 -1.66666666666667e-01 +194 228 -1.66666666666667e-01 +194 210 1.66666666666667e-01 +194 17 -1.66666666666667e-01 +194 15 8.33333333333333e-02 +194 222 -1.66666666666667e-01 +194 217 8.33333333333333e-02 +194 206 -7.50000000000000e-01 +194 14 -1.66666666666667e-01 +194 205 1.66666666666667e-01 +194 211 -3.33333333333333e-01 +194 192 -1.66666666666667e-01 +194 204 1.66666666666667e-01 +194 12 8.33333333333333e-02 +195 195 5.96666666666667e+01 +195 322 -1.66666666666667e-01 +195 200 1.66666666666667e-01 +195 199 1.66666666666667e-01 +195 198 -7.50000000000000e-01 +195 329 -1.66666666666667e-01 +195 328 -1.66666666666667e-01 +195 212 -3.33333333333333e-01 +195 211 1.66666666666667e-01 +195 179 8.33333333333333e+00 +195 197 -1.66666666666667e+01 +195 209 8.50000000000000e+00 +195 325 4.25000000000000e+00 +195 208 -4.25000000000000e+00 +195 14 -4.16666666666667e+00 +195 173 4.16666666666667e+00 +195 13 4.25000000000000e+00 +195 172 -8.33333333333333e+00 +195 12 -4.33333333333333e+00 +195 207 -1.27500000000000e+01 +195 41 -4.16666666666667e+00 +195 326 4.25000000000000e+00 +195 196 -8.50000000000000e+00 +195 40 4.25000000000000e+00 +195 178 8.33333333333333e+00 +195 323 8.33333333333333e-02 +195 39 -4.33333333333333e+00 +195 177 -3.75000000000000e+01 +196 196 5.15000000000000e+01 +196 321 -1.66666666666667e-01 +196 200 -8.33333333333333e-02 +196 199 -2.50000000000000e-01 +196 198 1.66666666666667e-01 +196 329 -1.66666666666667e-01 +196 212 1.66666666666667e-01 +196 327 -1.66666666666667e-01 +196 210 1.66666666666667e-01 +196 179 -4.16666666666667e+00 +196 173 4.16666666666667e+00 +196 324 4.25000000000000e+00 +196 207 -4.25000000000000e+00 +196 14 4.25000000000000e+00 +196 197 -8.50000000000000e+00 +196 209 8.50000000000000e+00 +196 13 -1.30000000000000e+01 +196 208 -1.27500000000000e+01 +196 12 4.25000000000000e+00 +196 171 -8.33333333333333e+00 +196 41 4.25000000000000e+00 +196 326 -8.50000000000000e+00 +196 323 8.33333333333333e-02 +196 40 -1.30000000000000e+01 +196 178 -1.25000000000000e+01 +196 195 -8.50000000000000e+00 +196 39 4.25000000000000e+00 +196 177 8.33333333333333e+00 +197 197 5.96666666666667e+01 +197 322 8.33333333333333e-02 +197 200 -2.50000000000000e-01 +197 199 -8.33333333333333e-02 +197 198 1.66666666666667e-01 +197 327 -1.66666666666667e-01 +197 328 -1.66666666666667e-01 +197 211 1.66666666666667e-01 +197 210 -3.33333333333333e-01 +197 178 -4.16666666666667e+00 +197 172 4.16666666666667e+00 +197 177 8.33333333333333e+00 +197 195 -1.66666666666667e+01 +197 207 8.50000000000000e+00 +197 14 -4.33333333333333e+00 +197 209 -3.82500000000000e+01 +197 13 4.25000000000000e+00 +197 196 -8.50000000000000e+00 +197 208 8.50000000000000e+00 +197 12 -4.16666666666667e+00 +197 171 4.16666666666667e+00 +197 321 8.33333333333333e-02 +197 41 -4.33333333333333e+00 +197 179 -1.25000000000000e+01 +197 40 4.25000000000000e+00 +197 325 -8.50000000000000e+00 +197 39 -4.16666666666667e+00 +197 324 4.25000000000000e+00 +198 198 2.50000000000000e+00 +198 328 1.66666666666667e-01 +198 329 1.66666666666667e-01 +198 322 1.66666666666667e-01 +198 321 -2.50000000000000e-01 +198 200 -3.33333333333333e-01 +198 197 1.66666666666667e-01 +198 196 1.66666666666667e-01 +198 195 -7.50000000000000e-01 +198 211 -1.66666666666667e-01 +198 199 -3.33333333333333e-01 +198 218 1.66666666666667e-01 +198 334 -1.66666666666667e-01 +198 229 1.66666666666667e-01 +198 212 3.33333333333333e-01 +198 230 -3.33333333333333e-01 +198 44 8.33333333333333e-02 +198 335 -1.66666666666667e-01 +198 217 1.66666666666667e-01 +198 43 -1.66666666666667e-01 +198 216 -7.50000000000000e-01 +198 194 -8.33333333333333e-02 +198 14 8.33333333333333e-02 +198 193 1.66666666666667e-01 +198 13 -1.66666666666667e-01 +198 192 -2.50000000000000e-01 +198 323 -8.33333333333333e-02 +198 210 -5.00000000000000e-01 +199 199 2.50000000000000e+00 +199 327 1.66666666666667e-01 +199 329 -3.33333333333333e-01 +199 44 8.33333333333333e-02 +199 322 -7.50000000000000e-01 +199 321 1.66666666666667e-01 +199 197 -8.33333333333333e-02 +199 14 8.33333333333333e-02 +199 196 -2.50000000000000e-01 +199 195 1.66666666666667e-01 +199 210 -1.66666666666667e-01 +199 218 -8.33333333333333e-02 +199 198 -3.33333333333333e-01 +199 333 -1.66666666666667e-01 +199 228 1.66666666666667e-01 +199 335 -1.66666666666667e-01 +199 230 1.66666666666667e-01 +199 217 -2.50000000000000e-01 +199 216 1.66666666666667e-01 +199 42 -1.66666666666667e-01 +199 194 1.66666666666667e-01 +199 200 -3.33333333333333e-01 +199 212 3.33333333333333e-01 +199 193 -7.50000000000000e-01 +199 323 1.66666666666667e-01 +199 211 -5.00000000000000e-01 +199 192 1.66666666666667e-01 +199 12 -1.66666666666667e-01 +200 200 2.50000000000000e+00 +200 322 1.66666666666667e-01 +200 328 -3.33333333333333e-01 +200 327 1.66666666666667e-01 +200 323 -2.50000000000000e-01 +200 43 8.33333333333333e-02 +200 197 -2.50000000000000e-01 +200 196 -8.33333333333333e-02 +200 13 8.33333333333333e-02 +200 198 -3.33333333333333e-01 +200 195 1.66666666666667e-01 +200 217 -8.33333333333333e-02 +200 216 1.66666666666667e-01 +200 334 -1.66666666666667e-01 +200 229 1.66666666666667e-01 +200 210 3.33333333333333e-01 +200 228 -3.33333333333333e-01 +200 218 -2.50000000000000e-01 +200 42 8.33333333333333e-02 +200 333 -1.66666666666667e-01 +200 194 -2.50000000000000e-01 +200 321 -8.33333333333333e-02 +200 212 -1.50000000000000e+00 +200 193 1.66666666666667e-01 +200 199 -3.33333333333333e-01 +200 211 3.33333333333333e-01 +200 192 -8.33333333333333e-02 +200 12 8.33333333333333e-02 +201 201 5.96666666666667e+01 +201 404 -1.66666666666667e-01 +201 397 8.33333333333333e-02 +201 403 -1.66666666666667e-01 +201 398 -1.66666666666667e-01 +201 206 1.66666666666667e-01 +201 205 1.66666666666667e-01 +201 211 -3.33333333333333e-01 +201 204 -7.50000000000000e-01 +201 401 4.25000000000000e+00 +201 209 -4.25000000000000e+00 +201 202 -1.66666666666667e+01 +201 208 8.50000000000000e+00 +201 184 8.33333333333333e+00 +201 14 4.25000000000000e+00 +201 173 -8.33333333333333e+00 +201 13 -4.16666666666667e+00 +201 172 4.16666666666667e+00 +201 12 -4.33333333333333e+00 +201 207 -1.27500000000000e+01 +201 203 -8.50000000000000e+00 +201 68 4.25000000000000e+00 +201 185 8.33333333333333e+00 +201 67 -4.16666666666667e+00 +201 400 4.25000000000000e+00 +201 212 1.66666666666667e-01 +201 66 -4.33333333333333e+00 +201 183 -3.75000000000000e+01 +202 202 5.96666666666667e+01 +202 402 -1.66666666666667e-01 +202 398 8.33333333333333e-02 +202 404 -1.66666666666667e-01 +202 206 -8.33333333333333e-02 +202 212 1.66666666666667e-01 +202 205 -2.50000000000000e-01 +202 204 1.66666666666667e-01 +202 210 -3.33333333333333e-01 +202 173 4.16666666666667e+00 +202 185 -4.16666666666667e+00 +202 201 -1.66666666666667e+01 +202 207 8.50000000000000e+00 +202 183 8.33333333333333e+00 +202 14 4.25000000000000e+00 +202 203 -8.50000000000000e+00 +202 209 8.50000000000000e+00 +202 13 -4.33333333333333e+00 +202 208 -3.82500000000000e+01 +202 12 -4.16666666666667e+00 +202 171 4.16666666666667e+00 +202 68 4.25000000000000e+00 +202 401 -8.50000000000000e+00 +202 396 8.33333333333333e-02 +202 67 -4.33333333333333e+00 +202 184 -1.25000000000000e+01 +202 66 -4.16666666666667e+00 +202 399 4.25000000000000e+00 +203 203 5.15000000000000e+01 +203 402 -1.66666666666667e-01 +203 397 8.33333333333333e-02 +203 403 -1.66666666666667e-01 +203 396 -1.66666666666667e-01 +203 206 -2.50000000000000e-01 +203 205 -8.33333333333333e-02 +203 211 1.66666666666667e-01 +203 204 1.66666666666667e-01 +203 399 4.25000000000000e+00 +203 207 -4.25000000000000e+00 +203 172 4.16666666666667e+00 +203 184 -4.16666666666667e+00 +203 14 -1.30000000000000e+01 +203 209 -1.27500000000000e+01 +203 13 4.25000000000000e+00 +203 202 -8.50000000000000e+00 +203 208 8.50000000000000e+00 +203 12 4.25000000000000e+00 +203 171 -8.33333333333333e+00 +203 210 1.66666666666667e-01 +203 68 -1.30000000000000e+01 +203 185 -1.25000000000000e+01 +203 67 4.25000000000000e+00 +203 400 -8.50000000000000e+00 +203 201 -8.50000000000000e+00 +203 66 4.25000000000000e+00 +203 183 8.33333333333333e+00 +204 204 2.50000000000000e+00 +204 230 1.66666666666667e-01 +204 229 -3.33333333333333e-01 +204 224 1.66666666666667e-01 +204 70 8.33333333333333e-02 +204 222 -7.50000000000000e-01 +204 194 1.66666666666667e-01 +204 193 -8.33333333333333e-02 +204 13 8.33333333333333e-02 +204 192 -2.50000000000000e-01 +204 212 -1.66666666666667e-01 +204 206 -3.33333333333333e-01 +204 397 -8.33333333333333e-02 +204 410 -1.66666666666667e-01 +204 404 1.66666666666667e-01 +204 409 -1.66666666666667e-01 +204 403 1.66666666666667e-01 +204 398 1.66666666666667e-01 +204 71 -1.66666666666667e-01 +204 396 -2.50000000000000e-01 +204 203 1.66666666666667e-01 +204 14 -1.66666666666667e-01 +204 202 1.66666666666667e-01 +204 205 -3.33333333333333e-01 +204 211 3.33333333333333e-01 +204 201 -7.50000000000000e-01 +204 223 1.66666666666667e-01 +204 210 -5.00000000000000e-01 +205 205 2.50000000000000e+00 +205 230 1.66666666666667e-01 +205 222 1.66666666666667e-01 +205 228 -3.33333333333333e-01 +205 223 -2.50000000000000e-01 +205 69 8.33333333333333e-02 +205 194 1.66666666666667e-01 +205 206 -3.33333333333333e-01 +205 193 -2.50000000000000e-01 +205 192 -8.33333333333333e-02 +205 12 8.33333333333333e-02 +205 396 -8.33333333333333e-02 +205 398 1.66666666666667e-01 +205 212 3.33333333333333e-01 +205 404 -3.33333333333333e-01 +205 408 -1.66666666666667e-01 +205 402 1.66666666666667e-01 +205 71 8.33333333333333e-02 +205 410 -1.66666666666667e-01 +205 397 -2.50000000000000e-01 +205 203 -8.33333333333333e-02 +205 14 8.33333333333333e-02 +205 202 -2.50000000000000e-01 +205 224 -8.33333333333333e-02 +205 211 -1.50000000000000e+00 +205 201 1.66666666666667e-01 +205 204 -3.33333333333333e-01 +205 210 3.33333333333333e-01 +206 206 2.50000000000000e+00 +206 229 1.66666666666667e-01 +206 228 1.66666666666667e-01 +206 224 -2.50000000000000e-01 +206 222 1.66666666666667e-01 +206 194 -7.50000000000000e-01 +206 193 1.66666666666667e-01 +206 205 -3.33333333333333e-01 +206 192 1.66666666666667e-01 +206 210 -1.66666666666667e-01 +206 204 -3.33333333333333e-01 +206 397 1.66666666666667e-01 +206 408 -1.66666666666667e-01 +206 402 1.66666666666667e-01 +206 211 3.33333333333333e-01 +206 403 -3.33333333333333e-01 +206 398 -7.50000000000000e-01 +206 70 8.33333333333333e-02 +206 409 -1.66666666666667e-01 +206 396 1.66666666666667e-01 +206 69 -1.66666666666667e-01 +206 203 -2.50000000000000e-01 +206 223 -8.33333333333333e-02 +206 212 -5.00000000000000e-01 +206 202 -8.33333333333333e-02 +206 13 8.33333333333333e-02 +206 201 1.66666666666667e-01 +206 12 -1.66666666666667e-01 +207 207 1.27500000000000e+02 +207 328 -3.33333333333333e-01 +207 212 3.33333333333333e-01 +207 404 -3.33333333333333e-01 +207 448 -1.66666666666667e-01 +207 403 1.66666666666667e-01 +207 449 -1.66666666666667e-01 +207 211 3.33333333333333e-01 +207 210 -1.50000000000000e+00 +207 197 8.50000000000000e+00 +207 178 8.33333333333333e+00 +207 196 -4.25000000000000e+00 +207 179 -1.66666666666667e+01 +207 14 4.25000000000000e+00 +207 195 -1.27500000000000e+01 +207 326 -4.25000000000000e+00 +207 95 4.25000000000000e+00 +207 208 -1.70000000000000e+01 +207 325 8.50000000000000e+00 +207 324 -1.27500000000000e+01 +207 203 -4.25000000000000e+00 +207 202 8.50000000000000e+00 +207 173 -8.33333333333333e+00 +207 185 8.33333333333333e+00 +207 190 1.66666666666667e+01 +207 184 -1.66666666666667e+01 +207 13 4.25000000000000e+00 +207 172 -8.33333333333333e+00 +207 201 -1.27500000000000e+01 +207 209 -1.70000000000000e+01 +207 401 8.50000000000000e+00 +207 191 1.66666666666667e+01 +207 400 -4.25000000000000e+00 +207 94 4.25000000000000e+00 +207 329 1.66666666666667e-01 +207 399 -1.27500000000000e+01 +207 189 -7.50000000000000e+01 +208 208 1.27500000000000e+02 +208 327 -3.33333333333333e-01 +208 212 -1.66666666666667e-01 +208 449 -1.66666666666667e-01 +208 404 1.66666666666667e-01 +208 447 -1.66666666666667e-01 +208 402 1.66666666666667e-01 +208 211 -5.00000000000000e-01 +208 210 3.33333333333333e-01 +208 177 8.33333333333333e+00 +208 195 -4.25000000000000e+00 +208 179 8.33333333333333e+00 +208 197 8.50000000000000e+00 +208 196 -1.27500000000000e+01 +208 326 8.50000000000000e+00 +208 325 -3.82500000000000e+01 +208 207 -1.70000000000000e+01 +208 324 8.50000000000000e+00 +208 191 -8.33333333333333e+00 +208 209 -1.70000000000000e+01 +208 173 -8.33333333333333e+00 +208 185 8.33333333333333e+00 +208 201 8.50000000000000e+00 +208 189 1.66666666666667e+01 +208 183 -1.66666666666667e+01 +208 14 -8.50000000000000e+00 +208 203 8.50000000000000e+00 +208 202 -3.82500000000000e+01 +208 12 4.25000000000000e+00 +208 171 -8.33333333333333e+00 +208 401 8.50000000000000e+00 +208 95 -8.50000000000000e+00 +208 329 1.66666666666667e-01 +208 400 -1.27500000000000e+01 +208 190 -2.50000000000000e+01 +208 399 -4.25000000000000e+00 +208 93 4.25000000000000e+00 +209 209 1.27500000000000e+02 +209 328 1.66666666666667e-01 +209 211 -1.66666666666667e-01 +209 448 -1.66666666666667e-01 +209 403 1.66666666666667e-01 +209 210 3.33333333333333e-01 +209 402 -3.33333333333333e-01 +209 447 -1.66666666666667e-01 +209 212 -5.00000000000000e-01 +209 195 8.50000000000000e+00 +209 178 8.33333333333333e+00 +209 177 -1.66666666666667e+01 +209 197 -3.82500000000000e+01 +209 196 8.50000000000000e+00 +209 12 4.25000000000000e+00 +209 326 -1.27500000000000e+01 +209 325 8.50000000000000e+00 +209 324 -4.25000000000000e+00 +209 93 4.25000000000000e+00 +209 190 -8.33333333333333e+00 +209 208 -1.70000000000000e+01 +209 201 -4.25000000000000e+00 +209 172 -8.33333333333333e+00 +209 184 8.33333333333333e+00 +209 171 -8.33333333333333e+00 +209 183 8.33333333333333e+00 +209 203 -1.27500000000000e+01 +209 13 -8.50000000000000e+00 +209 202 8.50000000000000e+00 +209 327 1.66666666666667e-01 +209 401 -3.82500000000000e+01 +209 191 -2.50000000000000e+01 +209 400 8.50000000000000e+00 +209 94 -8.50000000000000e+00 +209 207 -1.70000000000000e+01 +209 399 8.50000000000000e+00 +209 189 1.66666666666667e+01 +210 210 5.00000000000000e+00 +210 328 3.33333333333333e-01 +210 327 -5.00000000000000e-01 +210 197 -3.33333333333333e-01 +210 196 1.66666666666667e-01 +210 209 3.33333333333333e-01 +210 448 1.66666666666667e-01 +210 208 3.33333333333333e-01 +210 207 -1.50000000000000e+00 +210 449 1.66666666666667e-01 +210 199 -1.66666666666667e-01 +210 200 3.33333333333333e-01 +210 212 -6.66666666666667e-01 +210 14 -1.66666666666667e-01 +210 198 -5.00000000000000e-01 +210 335 1.66666666666667e-01 +210 98 -1.66666666666667e-01 +210 334 -3.33333333333333e-01 +210 194 1.66666666666667e-01 +210 229 3.33333333333333e-01 +210 211 -6.66666666666667e-01 +210 230 3.33333333333333e-01 +210 97 -1.66666666666667e-01 +210 228 -1.50000000000000e+00 +210 193 1.66666666666667e-01 +210 13 -1.66666666666667e-01 +210 206 -1.66666666666667e-01 +210 203 1.66666666666667e-01 +210 409 1.66666666666667e-01 +210 403 -1.66666666666667e-01 +210 202 -3.33333333333333e-01 +210 205 3.33333333333333e-01 +210 204 -5.00000000000000e-01 +210 404 3.33333333333333e-01 +210 410 -3.33333333333333e-01 +210 402 -5.00000000000000e-01 +210 329 -1.66666666666667e-01 +211 211 5.00000000000000e+00 +211 327 3.33333333333333e-01 +211 329 3.33333333333333e-01 +211 328 -1.50000000000000e+00 +211 195 1.66666666666667e-01 +211 209 -1.66666666666667e-01 +211 447 1.66666666666667e-01 +211 208 -5.00000000000000e-01 +211 207 3.33333333333333e-01 +211 449 -3.33333333333333e-01 +211 198 -1.66666666666667e-01 +211 335 1.66666666666667e-01 +211 200 3.33333333333333e-01 +211 199 -5.00000000000000e-01 +211 333 -3.33333333333333e-01 +211 230 -1.66666666666667e-01 +211 228 3.33333333333333e-01 +211 210 -6.66666666666667e-01 +211 229 -5.00000000000000e-01 +211 96 -1.66666666666667e-01 +211 194 -3.33333333333333e-01 +211 192 1.66666666666667e-01 +211 12 -1.66666666666667e-01 +211 206 3.33333333333333e-01 +211 212 -6.66666666666667e-01 +211 404 3.33333333333333e-01 +211 408 1.66666666666667e-01 +211 402 -1.66666666666667e-01 +211 203 1.66666666666667e-01 +211 14 -1.66666666666667e-01 +211 205 -1.50000000000000e+00 +211 201 -3.33333333333333e-01 +211 204 3.33333333333333e-01 +211 410 1.66666666666667e-01 +211 98 -1.66666666666667e-01 +211 403 -5.00000000000000e-01 +211 197 1.66666666666667e-01 +212 212 5.00000000000000e+00 +212 196 1.66666666666667e-01 +212 329 -5.00000000000000e-01 +212 328 3.33333333333333e-01 +212 195 -3.33333333333333e-01 +212 208 -1.66666666666667e-01 +212 207 3.33333333333333e-01 +212 209 -5.00000000000000e-01 +212 448 -3.33333333333333e-01 +212 447 1.66666666666667e-01 +212 334 1.66666666666667e-01 +212 198 3.33333333333333e-01 +212 210 -6.66666666666667e-01 +212 200 -1.50000000000000e+00 +212 199 3.33333333333333e-01 +212 12 -1.66666666666667e-01 +212 333 1.66666666666667e-01 +212 96 -1.66666666666667e-01 +212 229 -1.66666666666667e-01 +212 192 1.66666666666667e-01 +212 230 -5.00000000000000e-01 +212 228 3.33333333333333e-01 +212 193 -3.33333333333333e-01 +212 204 -1.66666666666667e-01 +212 201 1.66666666666667e-01 +212 205 3.33333333333333e-01 +212 211 -6.66666666666667e-01 +212 403 3.33333333333333e-01 +212 206 -5.00000000000000e-01 +212 202 1.66666666666667e-01 +212 13 -1.66666666666667e-01 +212 404 -1.50000000000000e+00 +212 327 -1.66666666666667e-01 +212 409 1.66666666666667e-01 +212 97 -1.66666666666667e-01 +212 402 3.33333333333333e-01 +212 408 -3.33333333333333e-01 +213 213 1.50000000000000e+00 +213 19 8.33333333333333e-02 +213 238 -1.66666666666667e-01 +213 221 -8.33333333333333e-02 +213 214 -1.66666666666667e-01 +213 220 1.66666666666667e-01 +213 16 8.33333333333333e-02 +213 219 -2.50000000000000e-01 +213 251 -1.66666666666667e-01 +213 233 1.66666666666667e-01 +213 20 8.33333333333333e-02 +213 245 -1.66666666666667e-01 +213 244 8.33333333333333e-02 +213 250 -1.66666666666667e-01 +213 18 -5.00000000000000e-01 +213 215 -1.66666666666667e-01 +213 227 1.66666666666667e-01 +213 17 8.33333333333333e-02 +213 226 -8.33333333333333e-02 +213 232 1.66666666666667e-01 +213 239 8.33333333333333e-02 +213 225 -2.50000000000000e-01 +213 15 -5.00000000000000e-01 +214 214 1.33333333333333e+00 +214 18 8.33333333333333e-02 +214 237 -1.66666666666667e-01 +214 221 1.66666666666667e-01 +214 220 -7.50000000000000e-01 +214 213 -1.66666666666667e-01 +214 219 1.66666666666667e-01 +214 15 8.33333333333333e-02 +214 245 8.33333333333333e-02 +214 251 -1.66666666666667e-01 +214 19 -1.66666666666667e-01 +214 243 8.33333333333333e-02 +214 249 -1.66666666666667e-01 +214 227 1.66666666666667e-01 +214 233 -3.33333333333333e-01 +214 239 8.33333333333333e-02 +214 226 -2.50000000000000e-01 +214 16 -1.66666666666667e-01 +214 225 -8.33333333333333e-02 +214 231 1.66666666666667e-01 +215 215 1.33333333333333e+00 +215 237 8.33333333333333e-02 +215 221 -2.50000000000000e-01 +215 220 1.66666666666667e-01 +215 219 -8.33333333333333e-02 +215 244 8.33333333333333e-02 +215 250 -1.66666666666667e-01 +215 249 -1.66666666666667e-01 +215 231 1.66666666666667e-01 +215 20 -1.66666666666667e-01 +215 18 8.33333333333333e-02 +215 243 -1.66666666666667e-01 +215 238 8.33333333333333e-02 +215 227 -7.50000000000000e-01 +215 17 -1.66666666666667e-01 +215 226 1.66666666666667e-01 +215 232 -3.33333333333333e-01 +215 213 -1.66666666666667e-01 +215 225 1.66666666666667e-01 +215 15 8.33333333333333e-02 +216 216 2.50000000000000e+00 +216 331 -1.66666666666667e-01 +216 221 1.66666666666667e-01 +216 220 1.66666666666667e-01 +216 219 -7.50000000000000e-01 +216 338 -1.66666666666667e-01 +216 337 -1.66666666666667e-01 +216 233 -3.33333333333333e-01 +216 232 1.66666666666667e-01 +216 200 1.66666666666667e-01 +216 218 -3.33333333333333e-01 +216 230 3.33333333333333e-01 +216 334 1.66666666666667e-01 +216 229 -1.66666666666667e-01 +216 17 -8.33333333333333e-02 +216 194 8.33333333333333e-02 +216 16 1.66666666666667e-01 +216 193 -1.66666666666667e-01 +216 15 -2.50000000000000e-01 +216 228 -5.00000000000000e-01 +216 44 -8.33333333333333e-02 +216 335 1.66666666666667e-01 +216 217 -3.33333333333333e-01 +216 43 1.66666666666667e-01 +216 199 1.66666666666667e-01 +216 332 8.33333333333333e-02 +216 42 -2.50000000000000e-01 +216 198 -7.50000000000000e-01 +217 217 2.50000000000000e+00 +217 330 -1.66666666666667e-01 +217 221 -8.33333333333333e-02 +217 220 -2.50000000000000e-01 +217 219 1.66666666666667e-01 +217 338 -1.66666666666667e-01 +217 233 1.66666666666667e-01 +217 336 -1.66666666666667e-01 +217 231 1.66666666666667e-01 +217 200 -8.33333333333333e-02 +217 194 8.33333333333333e-02 +217 333 1.66666666666667e-01 +217 228 -1.66666666666667e-01 +217 17 1.66666666666667e-01 +217 218 -3.33333333333333e-01 +217 230 3.33333333333333e-01 +217 16 -7.50000000000000e-01 +217 229 -5.00000000000000e-01 +217 15 1.66666666666667e-01 +217 192 -1.66666666666667e-01 +217 44 1.66666666666667e-01 +217 335 -3.33333333333333e-01 +217 332 8.33333333333333e-02 +217 43 -7.50000000000000e-01 +217 199 -2.50000000000000e-01 +217 216 -3.33333333333333e-01 +217 42 1.66666666666667e-01 +217 198 1.66666666666667e-01 +218 218 2.50000000000000e+00 +218 331 8.33333333333333e-02 +218 221 -2.50000000000000e-01 +218 220 -8.33333333333333e-02 +218 219 1.66666666666667e-01 +218 336 -1.66666666666667e-01 +218 337 -1.66666666666667e-01 +218 232 1.66666666666667e-01 +218 231 -3.33333333333333e-01 +218 199 -8.33333333333333e-02 +218 193 8.33333333333333e-02 +218 198 1.66666666666667e-01 +218 216 -3.33333333333333e-01 +218 228 3.33333333333333e-01 +218 17 -2.50000000000000e-01 +218 230 -1.50000000000000e+00 +218 16 1.66666666666667e-01 +218 217 -3.33333333333333e-01 +218 229 3.33333333333333e-01 +218 15 -8.33333333333333e-02 +218 192 8.33333333333333e-02 +218 330 8.33333333333333e-02 +218 44 -2.50000000000000e-01 +218 200 -2.50000000000000e-01 +218 43 1.66666666666667e-01 +218 334 -3.33333333333333e-01 +218 42 -8.33333333333333e-02 +218 333 1.66666666666667e-01 +219 219 2.50000000000000e+00 +219 337 1.66666666666667e-01 +219 338 1.66666666666667e-01 +219 331 1.66666666666667e-01 +219 330 -2.50000000000000e-01 +219 221 -3.33333333333333e-01 +219 218 1.66666666666667e-01 +219 217 1.66666666666667e-01 +219 216 -7.50000000000000e-01 +219 232 -1.66666666666667e-01 +219 220 -3.33333333333333e-01 +219 239 1.66666666666667e-01 +219 343 -1.66666666666667e-01 +219 250 1.66666666666667e-01 +219 233 3.33333333333333e-01 +219 251 -3.33333333333333e-01 +219 47 8.33333333333333e-02 +219 344 -1.66666666666667e-01 +219 238 1.66666666666667e-01 +219 46 -1.66666666666667e-01 +219 237 -7.50000000000000e-01 +219 215 -8.33333333333333e-02 +219 17 8.33333333333333e-02 +219 214 1.66666666666667e-01 +219 16 -1.66666666666667e-01 +219 213 -2.50000000000000e-01 +219 332 -8.33333333333333e-02 +219 231 -5.00000000000000e-01 +220 220 2.50000000000000e+00 +220 336 1.66666666666667e-01 +220 338 -3.33333333333333e-01 +220 47 8.33333333333333e-02 +220 331 -7.50000000000000e-01 +220 330 1.66666666666667e-01 +220 218 -8.33333333333333e-02 +220 17 8.33333333333333e-02 +220 217 -2.50000000000000e-01 +220 216 1.66666666666667e-01 +220 231 -1.66666666666667e-01 +220 239 -8.33333333333333e-02 +220 219 -3.33333333333333e-01 +220 342 -1.66666666666667e-01 +220 249 1.66666666666667e-01 +220 344 -1.66666666666667e-01 +220 251 1.66666666666667e-01 +220 238 -2.50000000000000e-01 +220 237 1.66666666666667e-01 +220 45 -1.66666666666667e-01 +220 215 1.66666666666667e-01 +220 221 -3.33333333333333e-01 +220 233 3.33333333333333e-01 +220 214 -7.50000000000000e-01 +220 332 1.66666666666667e-01 +220 232 -5.00000000000000e-01 +220 213 1.66666666666667e-01 +220 15 -1.66666666666667e-01 +221 221 2.50000000000000e+00 +221 331 1.66666666666667e-01 +221 337 -3.33333333333333e-01 +221 336 1.66666666666667e-01 +221 332 -2.50000000000000e-01 +221 46 8.33333333333333e-02 +221 218 -2.50000000000000e-01 +221 217 -8.33333333333333e-02 +221 16 8.33333333333333e-02 +221 219 -3.33333333333333e-01 +221 216 1.66666666666667e-01 +221 238 -8.33333333333333e-02 +221 237 1.66666666666667e-01 +221 343 -1.66666666666667e-01 +221 250 1.66666666666667e-01 +221 231 3.33333333333333e-01 +221 249 -3.33333333333333e-01 +221 239 -2.50000000000000e-01 +221 45 8.33333333333333e-02 +221 342 -1.66666666666667e-01 +221 215 -2.50000000000000e-01 +221 330 -8.33333333333333e-02 +221 233 -1.50000000000000e+00 +221 214 1.66666666666667e-01 +221 220 -3.33333333333333e-01 +221 232 3.33333333333333e-01 +221 213 -8.33333333333333e-02 +221 15 8.33333333333333e-02 +222 222 2.50000000000000e+00 +222 413 -1.66666666666667e-01 +222 406 8.33333333333333e-02 +222 412 -1.66666666666667e-01 +222 407 -1.66666666666667e-01 +222 227 1.66666666666667e-01 +222 226 1.66666666666667e-01 +222 232 -3.33333333333333e-01 +222 225 -7.50000000000000e-01 +222 410 1.66666666666667e-01 +222 230 -1.66666666666667e-01 +222 223 -3.33333333333333e-01 +222 229 3.33333333333333e-01 +222 205 1.66666666666667e-01 +222 17 1.66666666666667e-01 +222 194 -1.66666666666667e-01 +222 16 -8.33333333333333e-02 +222 193 8.33333333333333e-02 +222 15 -2.50000000000000e-01 +222 228 -5.00000000000000e-01 +222 224 -3.33333333333333e-01 +222 71 1.66666666666667e-01 +222 206 1.66666666666667e-01 +222 70 -8.33333333333333e-02 +222 409 1.66666666666667e-01 +222 233 1.66666666666667e-01 +222 69 -2.50000000000000e-01 +222 204 -7.50000000000000e-01 +223 223 2.50000000000000e+00 +223 411 -1.66666666666667e-01 +223 407 8.33333333333333e-02 +223 413 -1.66666666666667e-01 +223 227 -8.33333333333333e-02 +223 233 1.66666666666667e-01 +223 226 -2.50000000000000e-01 +223 225 1.66666666666667e-01 +223 231 -3.33333333333333e-01 +223 194 8.33333333333333e-02 +223 206 -8.33333333333333e-02 +223 222 -3.33333333333333e-01 +223 228 3.33333333333333e-01 +223 204 1.66666666666667e-01 +223 17 1.66666666666667e-01 +223 224 -3.33333333333333e-01 +223 230 3.33333333333333e-01 +223 16 -2.50000000000000e-01 +223 229 -1.50000000000000e+00 +223 15 -8.33333333333333e-02 +223 192 8.33333333333333e-02 +223 71 1.66666666666667e-01 +223 410 -3.33333333333333e-01 +223 405 8.33333333333333e-02 +223 70 -2.50000000000000e-01 +223 205 -2.50000000000000e-01 +223 69 -8.33333333333333e-02 +223 408 1.66666666666667e-01 +224 224 2.50000000000000e+00 +224 411 -1.66666666666667e-01 +224 406 8.33333333333333e-02 +224 412 -1.66666666666667e-01 +224 405 -1.66666666666667e-01 +224 227 -2.50000000000000e-01 +224 226 -8.33333333333333e-02 +224 232 1.66666666666667e-01 +224 225 1.66666666666667e-01 +224 408 1.66666666666667e-01 +224 228 -1.66666666666667e-01 +224 193 8.33333333333333e-02 +224 205 -8.33333333333333e-02 +224 17 -7.50000000000000e-01 +224 230 -5.00000000000000e-01 +224 16 1.66666666666667e-01 +224 223 -3.33333333333333e-01 +224 229 3.33333333333333e-01 +224 15 1.66666666666667e-01 +224 192 -1.66666666666667e-01 +224 231 1.66666666666667e-01 +224 71 -7.50000000000000e-01 +224 206 -2.50000000000000e-01 +224 70 1.66666666666667e-01 +224 409 -3.33333333333333e-01 +224 222 -3.33333333333333e-01 +224 69 1.66666666666667e-01 +224 204 1.66666666666667e-01 +225 225 2.50000000000000e+00 +225 251 1.66666666666667e-01 +225 250 -3.33333333333333e-01 +225 245 1.66666666666667e-01 +225 73 8.33333333333333e-02 +225 243 -7.50000000000000e-01 +225 215 1.66666666666667e-01 +225 214 -8.33333333333333e-02 +225 16 8.33333333333333e-02 +225 213 -2.50000000000000e-01 +225 233 -1.66666666666667e-01 +225 227 -3.33333333333333e-01 +225 406 -8.33333333333333e-02 +225 419 -1.66666666666667e-01 +225 413 1.66666666666667e-01 +225 418 -1.66666666666667e-01 +225 412 1.66666666666667e-01 +225 407 1.66666666666667e-01 +225 74 -1.66666666666667e-01 +225 405 -2.50000000000000e-01 +225 224 1.66666666666667e-01 +225 17 -1.66666666666667e-01 +225 223 1.66666666666667e-01 +225 226 -3.33333333333333e-01 +225 232 3.33333333333333e-01 +225 222 -7.50000000000000e-01 +225 244 1.66666666666667e-01 +225 231 -5.00000000000000e-01 +226 226 2.50000000000000e+00 +226 251 1.66666666666667e-01 +226 243 1.66666666666667e-01 +226 249 -3.33333333333333e-01 +226 244 -2.50000000000000e-01 +226 72 8.33333333333333e-02 +226 215 1.66666666666667e-01 +226 227 -3.33333333333333e-01 +226 214 -2.50000000000000e-01 +226 213 -8.33333333333333e-02 +226 15 8.33333333333333e-02 +226 405 -8.33333333333333e-02 +226 407 1.66666666666667e-01 +226 233 3.33333333333333e-01 +226 413 -3.33333333333333e-01 +226 417 -1.66666666666667e-01 +226 411 1.66666666666667e-01 +226 74 8.33333333333333e-02 +226 419 -1.66666666666667e-01 +226 406 -2.50000000000000e-01 +226 224 -8.33333333333333e-02 +226 17 8.33333333333333e-02 +226 223 -2.50000000000000e-01 +226 245 -8.33333333333333e-02 +226 232 -1.50000000000000e+00 +226 222 1.66666666666667e-01 +226 225 -3.33333333333333e-01 +226 231 3.33333333333333e-01 +227 227 2.50000000000000e+00 +227 250 1.66666666666667e-01 +227 249 1.66666666666667e-01 +227 245 -2.50000000000000e-01 +227 243 1.66666666666667e-01 +227 215 -7.50000000000000e-01 +227 214 1.66666666666667e-01 +227 226 -3.33333333333333e-01 +227 213 1.66666666666667e-01 +227 231 -1.66666666666667e-01 +227 225 -3.33333333333333e-01 +227 406 1.66666666666667e-01 +227 417 -1.66666666666667e-01 +227 411 1.66666666666667e-01 +227 232 3.33333333333333e-01 +227 412 -3.33333333333333e-01 +227 407 -7.50000000000000e-01 +227 73 8.33333333333333e-02 +227 418 -1.66666666666667e-01 +227 405 1.66666666666667e-01 +227 72 -1.66666666666667e-01 +227 224 -2.50000000000000e-01 +227 244 -8.33333333333333e-02 +227 233 -5.00000000000000e-01 +227 223 -8.33333333333333e-02 +227 16 8.33333333333333e-02 +227 222 1.66666666666667e-01 +227 15 -1.66666666666667e-01 +228 228 5.00000000000000e+00 +228 337 -3.33333333333333e-01 +228 233 3.33333333333333e-01 +228 413 -3.33333333333333e-01 +228 451 -1.66666666666667e-01 +228 412 1.66666666666667e-01 +228 452 -1.66666666666667e-01 +228 232 3.33333333333333e-01 +228 231 -1.50000000000000e+00 +228 218 3.33333333333333e-01 +228 199 1.66666666666667e-01 +228 217 -1.66666666666667e-01 +228 200 -3.33333333333333e-01 +228 17 1.66666666666667e-01 +228 216 -5.00000000000000e-01 +228 335 -1.66666666666667e-01 +228 98 1.66666666666667e-01 +228 229 -6.66666666666667e-01 +228 334 3.33333333333333e-01 +228 333 -5.00000000000000e-01 +228 224 -1.66666666666667e-01 +228 223 3.33333333333333e-01 +228 194 -1.66666666666667e-01 +228 206 1.66666666666667e-01 +228 211 3.33333333333333e-01 +228 205 -3.33333333333333e-01 +228 16 1.66666666666667e-01 +228 193 -1.66666666666667e-01 +228 222 -5.00000000000000e-01 +228 230 -6.66666666666667e-01 +228 410 3.33333333333333e-01 +228 212 3.33333333333333e-01 +228 409 -1.66666666666667e-01 +228 97 1.66666666666667e-01 +228 338 1.66666666666667e-01 +228 408 -5.00000000000000e-01 +228 210 -1.50000000000000e+00 +229 229 5.00000000000000e+00 +229 336 -3.33333333333333e-01 +229 233 -1.66666666666667e-01 +229 452 -1.66666666666667e-01 +229 413 1.66666666666667e-01 +229 450 -1.66666666666667e-01 +229 411 1.66666666666667e-01 +229 232 -5.00000000000000e-01 +229 231 3.33333333333333e-01 +229 198 1.66666666666667e-01 +229 216 -1.66666666666667e-01 +229 200 1.66666666666667e-01 +229 218 3.33333333333333e-01 +229 217 -5.00000000000000e-01 +229 335 3.33333333333333e-01 +229 334 -1.50000000000000e+00 +229 228 -6.66666666666667e-01 +229 333 3.33333333333333e-01 +229 212 -1.66666666666667e-01 +229 230 -6.66666666666667e-01 +229 194 -1.66666666666667e-01 +229 206 1.66666666666667e-01 +229 222 3.33333333333333e-01 +229 210 3.33333333333333e-01 +229 204 -3.33333333333333e-01 +229 17 -3.33333333333333e-01 +229 224 3.33333333333333e-01 +229 223 -1.50000000000000e+00 +229 15 1.66666666666667e-01 +229 192 -1.66666666666667e-01 +229 410 3.33333333333333e-01 +229 98 -3.33333333333333e-01 +229 338 1.66666666666667e-01 +229 409 -5.00000000000000e-01 +229 211 -5.00000000000000e-01 +229 408 -1.66666666666667e-01 +229 96 1.66666666666667e-01 +230 230 5.00000000000000e+00 +230 337 1.66666666666667e-01 +230 232 -1.66666666666667e-01 +230 451 -1.66666666666667e-01 +230 412 1.66666666666667e-01 +230 231 3.33333333333333e-01 +230 411 -3.33333333333333e-01 +230 450 -1.66666666666667e-01 +230 233 -5.00000000000000e-01 +230 216 3.33333333333333e-01 +230 199 1.66666666666667e-01 +230 198 -3.33333333333333e-01 +230 218 -1.50000000000000e+00 +230 217 3.33333333333333e-01 +230 15 1.66666666666667e-01 +230 335 -5.00000000000000e-01 +230 334 3.33333333333333e-01 +230 333 -1.66666666666667e-01 +230 96 1.66666666666667e-01 +230 211 -1.66666666666667e-01 +230 229 -6.66666666666667e-01 +230 222 -1.66666666666667e-01 +230 193 -1.66666666666667e-01 +230 205 1.66666666666667e-01 +230 192 -1.66666666666667e-01 +230 204 1.66666666666667e-01 +230 224 -5.00000000000000e-01 +230 16 -3.33333333333333e-01 +230 223 3.33333333333333e-01 +230 336 1.66666666666667e-01 +230 410 -1.50000000000000e+00 +230 212 -5.00000000000000e-01 +230 409 3.33333333333333e-01 +230 97 -3.33333333333333e-01 +230 228 -6.66666666666667e-01 +230 408 3.33333333333333e-01 +230 210 3.33333333333333e-01 +231 231 5.00000000000000e+00 +231 337 3.33333333333333e-01 +231 336 -5.00000000000000e-01 +231 218 -3.33333333333333e-01 +231 217 1.66666666666667e-01 +231 230 3.33333333333333e-01 +231 451 1.66666666666667e-01 +231 229 3.33333333333333e-01 +231 228 -1.50000000000000e+00 +231 452 1.66666666666667e-01 +231 220 -1.66666666666667e-01 +231 221 3.33333333333333e-01 +231 233 -6.66666666666667e-01 +231 17 -1.66666666666667e-01 +231 219 -5.00000000000000e-01 +231 344 1.66666666666667e-01 +231 101 -1.66666666666667e-01 +231 343 -3.33333333333333e-01 +231 215 1.66666666666667e-01 +231 250 3.33333333333333e-01 +231 232 -6.66666666666667e-01 +231 251 3.33333333333333e-01 +231 100 -1.66666666666667e-01 +231 249 -1.50000000000000e+00 +231 214 1.66666666666667e-01 +231 16 -1.66666666666667e-01 +231 227 -1.66666666666667e-01 +231 224 1.66666666666667e-01 +231 418 1.66666666666667e-01 +231 412 -1.66666666666667e-01 +231 223 -3.33333333333333e-01 +231 226 3.33333333333333e-01 +231 225 -5.00000000000000e-01 +231 413 3.33333333333333e-01 +231 419 -3.33333333333333e-01 +231 411 -5.00000000000000e-01 +231 338 -1.66666666666667e-01 +232 232 5.00000000000000e+00 +232 336 3.33333333333333e-01 +232 338 3.33333333333333e-01 +232 337 -1.50000000000000e+00 +232 216 1.66666666666667e-01 +232 230 -1.66666666666667e-01 +232 450 1.66666666666667e-01 +232 229 -5.00000000000000e-01 +232 228 3.33333333333333e-01 +232 452 -3.33333333333333e-01 +232 219 -1.66666666666667e-01 +232 344 1.66666666666667e-01 +232 221 3.33333333333333e-01 +232 220 -5.00000000000000e-01 +232 342 -3.33333333333333e-01 +232 251 -1.66666666666667e-01 +232 249 3.33333333333333e-01 +232 231 -6.66666666666667e-01 +232 250 -5.00000000000000e-01 +232 99 -1.66666666666667e-01 +232 215 -3.33333333333333e-01 +232 213 1.66666666666667e-01 +232 15 -1.66666666666667e-01 +232 227 3.33333333333333e-01 +232 233 -6.66666666666667e-01 +232 413 3.33333333333333e-01 +232 417 1.66666666666667e-01 +232 411 -1.66666666666667e-01 +232 224 1.66666666666667e-01 +232 17 -1.66666666666667e-01 +232 226 -1.50000000000000e+00 +232 222 -3.33333333333333e-01 +232 225 3.33333333333333e-01 +232 419 1.66666666666667e-01 +232 101 -1.66666666666667e-01 +232 412 -5.00000000000000e-01 +232 218 1.66666666666667e-01 +233 233 5.00000000000000e+00 +233 217 1.66666666666667e-01 +233 338 -5.00000000000000e-01 +233 337 3.33333333333333e-01 +233 216 -3.33333333333333e-01 +233 229 -1.66666666666667e-01 +233 228 3.33333333333333e-01 +233 230 -5.00000000000000e-01 +233 451 -3.33333333333333e-01 +233 450 1.66666666666667e-01 +233 343 1.66666666666667e-01 +233 219 3.33333333333333e-01 +233 231 -6.66666666666667e-01 +233 221 -1.50000000000000e+00 +233 220 3.33333333333333e-01 +233 15 -1.66666666666667e-01 +233 342 1.66666666666667e-01 +233 99 -1.66666666666667e-01 +233 250 -1.66666666666667e-01 +233 213 1.66666666666667e-01 +233 251 -5.00000000000000e-01 +233 249 3.33333333333333e-01 +233 214 -3.33333333333333e-01 +233 225 -1.66666666666667e-01 +233 222 1.66666666666667e-01 +233 226 3.33333333333333e-01 +233 232 -6.66666666666667e-01 +233 412 3.33333333333333e-01 +233 227 -5.00000000000000e-01 +233 223 1.66666666666667e-01 +233 16 -1.66666666666667e-01 +233 413 -1.50000000000000e+00 +233 336 -1.66666666666667e-01 +233 418 1.66666666666667e-01 +233 100 -1.66666666666667e-01 +233 411 3.33333333333333e-01 +233 417 -3.33333333333333e-01 +234 234 1.50000000000000e+00 +234 22 8.33333333333333e-02 +234 259 -1.66666666666667e-01 +234 242 -8.33333333333333e-02 +234 235 -1.66666666666667e-01 +234 241 1.66666666666667e-01 +234 19 8.33333333333333e-02 +234 240 -2.50000000000000e-01 +234 272 -1.66666666666667e-01 +234 254 1.66666666666667e-01 +234 23 8.33333333333333e-02 +234 266 -1.66666666666667e-01 +234 265 8.33333333333333e-02 +234 271 -1.66666666666667e-01 +234 21 -5.00000000000000e-01 +234 236 -1.66666666666667e-01 +234 248 1.66666666666667e-01 +234 20 8.33333333333333e-02 +234 247 -8.33333333333333e-02 +234 253 1.66666666666667e-01 +234 260 8.33333333333333e-02 +234 246 -2.50000000000000e-01 +234 18 -5.00000000000000e-01 +235 235 1.33333333333333e+00 +235 21 8.33333333333333e-02 +235 258 -1.66666666666667e-01 +235 242 1.66666666666667e-01 +235 241 -7.50000000000000e-01 +235 234 -1.66666666666667e-01 +235 240 1.66666666666667e-01 +235 18 8.33333333333333e-02 +235 266 8.33333333333333e-02 +235 272 -1.66666666666667e-01 +235 22 -1.66666666666667e-01 +235 264 8.33333333333333e-02 +235 270 -1.66666666666667e-01 +235 248 1.66666666666667e-01 +235 254 -3.33333333333333e-01 +235 260 8.33333333333333e-02 +235 247 -2.50000000000000e-01 +235 19 -1.66666666666667e-01 +235 246 -8.33333333333333e-02 +235 252 1.66666666666667e-01 +236 236 1.33333333333333e+00 +236 258 8.33333333333333e-02 +236 242 -2.50000000000000e-01 +236 241 1.66666666666667e-01 +236 240 -8.33333333333333e-02 +236 265 8.33333333333333e-02 +236 271 -1.66666666666667e-01 +236 270 -1.66666666666667e-01 +236 252 1.66666666666667e-01 +236 23 -1.66666666666667e-01 +236 21 8.33333333333333e-02 +236 264 -1.66666666666667e-01 +236 259 8.33333333333333e-02 +236 248 -7.50000000000000e-01 +236 20 -1.66666666666667e-01 +236 247 1.66666666666667e-01 +236 253 -3.33333333333333e-01 +236 234 -1.66666666666667e-01 +236 246 1.66666666666667e-01 +236 18 8.33333333333333e-02 +237 237 2.50000000000000e+00 +237 340 -1.66666666666667e-01 +237 242 1.66666666666667e-01 +237 241 1.66666666666667e-01 +237 240 -7.50000000000000e-01 +237 347 -1.66666666666667e-01 +237 346 -1.66666666666667e-01 +237 254 -3.33333333333333e-01 +237 253 1.66666666666667e-01 +237 221 1.66666666666667e-01 +237 239 -3.33333333333333e-01 +237 251 3.33333333333333e-01 +237 343 1.66666666666667e-01 +237 250 -1.66666666666667e-01 +237 20 -8.33333333333333e-02 +237 215 8.33333333333333e-02 +237 19 1.66666666666667e-01 +237 214 -1.66666666666667e-01 +237 18 -2.50000000000000e-01 +237 249 -5.00000000000000e-01 +237 47 -8.33333333333333e-02 +237 344 1.66666666666667e-01 +237 238 -3.33333333333333e-01 +237 46 1.66666666666667e-01 +237 220 1.66666666666667e-01 +237 341 8.33333333333333e-02 +237 45 -2.50000000000000e-01 +237 219 -7.50000000000000e-01 +238 238 2.50000000000000e+00 +238 339 -1.66666666666667e-01 +238 242 -8.33333333333333e-02 +238 241 -2.50000000000000e-01 +238 240 1.66666666666667e-01 +238 347 -1.66666666666667e-01 +238 254 1.66666666666667e-01 +238 345 -1.66666666666667e-01 +238 252 1.66666666666667e-01 +238 221 -8.33333333333333e-02 +238 215 8.33333333333333e-02 +238 342 1.66666666666667e-01 +238 249 -1.66666666666667e-01 +238 20 1.66666666666667e-01 +238 239 -3.33333333333333e-01 +238 251 3.33333333333333e-01 +238 19 -7.50000000000000e-01 +238 250 -5.00000000000000e-01 +238 18 1.66666666666667e-01 +238 213 -1.66666666666667e-01 +238 47 1.66666666666667e-01 +238 344 -3.33333333333333e-01 +238 341 8.33333333333333e-02 +238 46 -7.50000000000000e-01 +238 220 -2.50000000000000e-01 +238 237 -3.33333333333333e-01 +238 45 1.66666666666667e-01 +238 219 1.66666666666667e-01 +239 239 2.50000000000000e+00 +239 340 8.33333333333333e-02 +239 242 -2.50000000000000e-01 +239 241 -8.33333333333333e-02 +239 240 1.66666666666667e-01 +239 345 -1.66666666666667e-01 +239 346 -1.66666666666667e-01 +239 253 1.66666666666667e-01 +239 252 -3.33333333333333e-01 +239 220 -8.33333333333333e-02 +239 214 8.33333333333333e-02 +239 219 1.66666666666667e-01 +239 237 -3.33333333333333e-01 +239 249 3.33333333333333e-01 +239 20 -2.50000000000000e-01 +239 251 -1.50000000000000e+00 +239 19 1.66666666666667e-01 +239 238 -3.33333333333333e-01 +239 250 3.33333333333333e-01 +239 18 -8.33333333333333e-02 +239 213 8.33333333333333e-02 +239 339 8.33333333333333e-02 +239 47 -2.50000000000000e-01 +239 221 -2.50000000000000e-01 +239 46 1.66666666666667e-01 +239 343 -3.33333333333333e-01 +239 45 -8.33333333333333e-02 +239 342 1.66666666666667e-01 +240 240 2.50000000000000e+00 +240 346 1.66666666666667e-01 +240 347 1.66666666666667e-01 +240 340 1.66666666666667e-01 +240 339 -2.50000000000000e-01 +240 242 -3.33333333333333e-01 +240 239 1.66666666666667e-01 +240 238 1.66666666666667e-01 +240 237 -7.50000000000000e-01 +240 253 -1.66666666666667e-01 +240 241 -3.33333333333333e-01 +240 260 1.66666666666667e-01 +240 352 -1.66666666666667e-01 +240 271 1.66666666666667e-01 +240 254 3.33333333333333e-01 +240 272 -3.33333333333333e-01 +240 50 8.33333333333333e-02 +240 353 -1.66666666666667e-01 +240 259 1.66666666666667e-01 +240 49 -1.66666666666667e-01 +240 258 -7.50000000000000e-01 +240 236 -8.33333333333333e-02 +240 20 8.33333333333333e-02 +240 235 1.66666666666667e-01 +240 19 -1.66666666666667e-01 +240 234 -2.50000000000000e-01 +240 341 -8.33333333333333e-02 +240 252 -5.00000000000000e-01 +241 241 2.50000000000000e+00 +241 345 1.66666666666667e-01 +241 347 -3.33333333333333e-01 +241 50 8.33333333333333e-02 +241 340 -7.50000000000000e-01 +241 339 1.66666666666667e-01 +241 239 -8.33333333333333e-02 +241 20 8.33333333333333e-02 +241 238 -2.50000000000000e-01 +241 237 1.66666666666667e-01 +241 252 -1.66666666666667e-01 +241 260 -8.33333333333333e-02 +241 240 -3.33333333333333e-01 +241 351 -1.66666666666667e-01 +241 270 1.66666666666667e-01 +241 353 -1.66666666666667e-01 +241 272 1.66666666666667e-01 +241 259 -2.50000000000000e-01 +241 258 1.66666666666667e-01 +241 48 -1.66666666666667e-01 +241 236 1.66666666666667e-01 +241 242 -3.33333333333333e-01 +241 254 3.33333333333333e-01 +241 235 -7.50000000000000e-01 +241 341 1.66666666666667e-01 +241 253 -5.00000000000000e-01 +241 234 1.66666666666667e-01 +241 18 -1.66666666666667e-01 +242 242 2.50000000000000e+00 +242 340 1.66666666666667e-01 +242 346 -3.33333333333333e-01 +242 345 1.66666666666667e-01 +242 341 -2.50000000000000e-01 +242 49 8.33333333333333e-02 +242 239 -2.50000000000000e-01 +242 238 -8.33333333333333e-02 +242 19 8.33333333333333e-02 +242 240 -3.33333333333333e-01 +242 237 1.66666666666667e-01 +242 259 -8.33333333333333e-02 +242 258 1.66666666666667e-01 +242 352 -1.66666666666667e-01 +242 271 1.66666666666667e-01 +242 252 3.33333333333333e-01 +242 270 -3.33333333333333e-01 +242 260 -2.50000000000000e-01 +242 48 8.33333333333333e-02 +242 351 -1.66666666666667e-01 +242 236 -2.50000000000000e-01 +242 339 -8.33333333333333e-02 +242 254 -1.50000000000000e+00 +242 235 1.66666666666667e-01 +242 241 -3.33333333333333e-01 +242 253 3.33333333333333e-01 +242 234 -8.33333333333333e-02 +242 18 8.33333333333333e-02 +243 243 2.50000000000000e+00 +243 422 -1.66666666666667e-01 +243 415 8.33333333333333e-02 +243 421 -1.66666666666667e-01 +243 416 -1.66666666666667e-01 +243 248 1.66666666666667e-01 +243 247 1.66666666666667e-01 +243 253 -3.33333333333333e-01 +243 246 -7.50000000000000e-01 +243 419 1.66666666666667e-01 +243 251 -1.66666666666667e-01 +243 244 -3.33333333333333e-01 +243 250 3.33333333333333e-01 +243 226 1.66666666666667e-01 +243 20 1.66666666666667e-01 +243 215 -1.66666666666667e-01 +243 19 -8.33333333333333e-02 +243 214 8.33333333333333e-02 +243 18 -2.50000000000000e-01 +243 249 -5.00000000000000e-01 +243 245 -3.33333333333333e-01 +243 74 1.66666666666667e-01 +243 227 1.66666666666667e-01 +243 73 -8.33333333333333e-02 +243 418 1.66666666666667e-01 +243 254 1.66666666666667e-01 +243 72 -2.50000000000000e-01 +243 225 -7.50000000000000e-01 +244 244 2.50000000000000e+00 +244 420 -1.66666666666667e-01 +244 416 8.33333333333333e-02 +244 422 -1.66666666666667e-01 +244 248 -8.33333333333333e-02 +244 254 1.66666666666667e-01 +244 247 -2.50000000000000e-01 +244 246 1.66666666666667e-01 +244 252 -3.33333333333333e-01 +244 215 8.33333333333333e-02 +244 227 -8.33333333333333e-02 +244 243 -3.33333333333333e-01 +244 249 3.33333333333333e-01 +244 225 1.66666666666667e-01 +244 20 1.66666666666667e-01 +244 245 -3.33333333333333e-01 +244 251 3.33333333333333e-01 +244 19 -2.50000000000000e-01 +244 250 -1.50000000000000e+00 +244 18 -8.33333333333333e-02 +244 213 8.33333333333333e-02 +244 74 1.66666666666667e-01 +244 419 -3.33333333333333e-01 +244 414 8.33333333333333e-02 +244 73 -2.50000000000000e-01 +244 226 -2.50000000000000e-01 +244 72 -8.33333333333333e-02 +244 417 1.66666666666667e-01 +245 245 2.50000000000000e+00 +245 420 -1.66666666666667e-01 +245 415 8.33333333333333e-02 +245 421 -1.66666666666667e-01 +245 414 -1.66666666666667e-01 +245 248 -2.50000000000000e-01 +245 247 -8.33333333333333e-02 +245 253 1.66666666666667e-01 +245 246 1.66666666666667e-01 +245 417 1.66666666666667e-01 +245 249 -1.66666666666667e-01 +245 214 8.33333333333333e-02 +245 226 -8.33333333333333e-02 +245 20 -7.50000000000000e-01 +245 251 -5.00000000000000e-01 +245 19 1.66666666666667e-01 +245 244 -3.33333333333333e-01 +245 250 3.33333333333333e-01 +245 18 1.66666666666667e-01 +245 213 -1.66666666666667e-01 +245 252 1.66666666666667e-01 +245 74 -7.50000000000000e-01 +245 227 -2.50000000000000e-01 +245 73 1.66666666666667e-01 +245 418 -3.33333333333333e-01 +245 243 -3.33333333333333e-01 +245 72 1.66666666666667e-01 +245 225 1.66666666666667e-01 +246 246 2.50000000000000e+00 +246 272 1.66666666666667e-01 +246 271 -3.33333333333333e-01 +246 266 1.66666666666667e-01 +246 76 8.33333333333333e-02 +246 264 -7.50000000000000e-01 +246 236 1.66666666666667e-01 +246 235 -8.33333333333333e-02 +246 19 8.33333333333333e-02 +246 234 -2.50000000000000e-01 +246 254 -1.66666666666667e-01 +246 248 -3.33333333333333e-01 +246 415 -8.33333333333333e-02 +246 428 -1.66666666666667e-01 +246 422 1.66666666666667e-01 +246 427 -1.66666666666667e-01 +246 421 1.66666666666667e-01 +246 416 1.66666666666667e-01 +246 77 -1.66666666666667e-01 +246 414 -2.50000000000000e-01 +246 245 1.66666666666667e-01 +246 20 -1.66666666666667e-01 +246 244 1.66666666666667e-01 +246 247 -3.33333333333333e-01 +246 253 3.33333333333333e-01 +246 243 -7.50000000000000e-01 +246 265 1.66666666666667e-01 +246 252 -5.00000000000000e-01 +247 247 2.50000000000000e+00 +247 272 1.66666666666667e-01 +247 264 1.66666666666667e-01 +247 270 -3.33333333333333e-01 +247 265 -2.50000000000000e-01 +247 75 8.33333333333333e-02 +247 236 1.66666666666667e-01 +247 248 -3.33333333333333e-01 +247 235 -2.50000000000000e-01 +247 234 -8.33333333333333e-02 +247 18 8.33333333333333e-02 +247 414 -8.33333333333333e-02 +247 416 1.66666666666667e-01 +247 254 3.33333333333333e-01 +247 422 -3.33333333333333e-01 +247 426 -1.66666666666667e-01 +247 420 1.66666666666667e-01 +247 77 8.33333333333333e-02 +247 428 -1.66666666666667e-01 +247 415 -2.50000000000000e-01 +247 245 -8.33333333333333e-02 +247 20 8.33333333333333e-02 +247 244 -2.50000000000000e-01 +247 266 -8.33333333333333e-02 +247 253 -1.50000000000000e+00 +247 243 1.66666666666667e-01 +247 246 -3.33333333333333e-01 +247 252 3.33333333333333e-01 +248 248 2.50000000000000e+00 +248 271 1.66666666666667e-01 +248 270 1.66666666666667e-01 +248 266 -2.50000000000000e-01 +248 264 1.66666666666667e-01 +248 236 -7.50000000000000e-01 +248 235 1.66666666666667e-01 +248 247 -3.33333333333333e-01 +248 234 1.66666666666667e-01 +248 252 -1.66666666666667e-01 +248 246 -3.33333333333333e-01 +248 415 1.66666666666667e-01 +248 426 -1.66666666666667e-01 +248 420 1.66666666666667e-01 +248 253 3.33333333333333e-01 +248 421 -3.33333333333333e-01 +248 416 -7.50000000000000e-01 +248 76 8.33333333333333e-02 +248 427 -1.66666666666667e-01 +248 414 1.66666666666667e-01 +248 75 -1.66666666666667e-01 +248 245 -2.50000000000000e-01 +248 265 -8.33333333333333e-02 +248 254 -5.00000000000000e-01 +248 244 -8.33333333333333e-02 +248 19 8.33333333333333e-02 +248 243 1.66666666666667e-01 +248 18 -1.66666666666667e-01 +249 249 5.00000000000000e+00 +249 346 -3.33333333333333e-01 +249 254 3.33333333333333e-01 +249 422 -3.33333333333333e-01 +249 454 -1.66666666666667e-01 +249 421 1.66666666666667e-01 +249 455 -1.66666666666667e-01 +249 253 3.33333333333333e-01 +249 252 -1.50000000000000e+00 +249 239 3.33333333333333e-01 +249 220 1.66666666666667e-01 +249 238 -1.66666666666667e-01 +249 221 -3.33333333333333e-01 +249 20 1.66666666666667e-01 +249 237 -5.00000000000000e-01 +249 344 -1.66666666666667e-01 +249 101 1.66666666666667e-01 +249 250 -6.66666666666667e-01 +249 343 3.33333333333333e-01 +249 342 -5.00000000000000e-01 +249 245 -1.66666666666667e-01 +249 244 3.33333333333333e-01 +249 215 -1.66666666666667e-01 +249 227 1.66666666666667e-01 +249 232 3.33333333333333e-01 +249 226 -3.33333333333333e-01 +249 19 1.66666666666667e-01 +249 214 -1.66666666666667e-01 +249 243 -5.00000000000000e-01 +249 251 -6.66666666666667e-01 +249 419 3.33333333333333e-01 +249 233 3.33333333333333e-01 +249 418 -1.66666666666667e-01 +249 100 1.66666666666667e-01 +249 347 1.66666666666667e-01 +249 417 -5.00000000000000e-01 +249 231 -1.50000000000000e+00 +250 250 5.00000000000000e+00 +250 345 -3.33333333333333e-01 +250 254 -1.66666666666667e-01 +250 455 -1.66666666666667e-01 +250 422 1.66666666666667e-01 +250 453 -1.66666666666667e-01 +250 420 1.66666666666667e-01 +250 253 -5.00000000000000e-01 +250 252 3.33333333333333e-01 +250 219 1.66666666666667e-01 +250 237 -1.66666666666667e-01 +250 221 1.66666666666667e-01 +250 239 3.33333333333333e-01 +250 238 -5.00000000000000e-01 +250 344 3.33333333333333e-01 +250 343 -1.50000000000000e+00 +250 249 -6.66666666666667e-01 +250 342 3.33333333333333e-01 +250 233 -1.66666666666667e-01 +250 251 -6.66666666666667e-01 +250 215 -1.66666666666667e-01 +250 227 1.66666666666667e-01 +250 243 3.33333333333333e-01 +250 231 3.33333333333333e-01 +250 225 -3.33333333333333e-01 +250 20 -3.33333333333333e-01 +250 245 3.33333333333333e-01 +250 244 -1.50000000000000e+00 +250 18 1.66666666666667e-01 +250 213 -1.66666666666667e-01 +250 419 3.33333333333333e-01 +250 101 -3.33333333333333e-01 +250 347 1.66666666666667e-01 +250 418 -5.00000000000000e-01 +250 232 -5.00000000000000e-01 +250 417 -1.66666666666667e-01 +250 99 1.66666666666667e-01 +251 251 5.00000000000000e+00 +251 346 1.66666666666667e-01 +251 253 -1.66666666666667e-01 +251 454 -1.66666666666667e-01 +251 421 1.66666666666667e-01 +251 252 3.33333333333333e-01 +251 420 -3.33333333333333e-01 +251 453 -1.66666666666667e-01 +251 254 -5.00000000000000e-01 +251 237 3.33333333333333e-01 +251 220 1.66666666666667e-01 +251 219 -3.33333333333333e-01 +251 239 -1.50000000000000e+00 +251 238 3.33333333333333e-01 +251 18 1.66666666666667e-01 +251 344 -5.00000000000000e-01 +251 343 3.33333333333333e-01 +251 342 -1.66666666666667e-01 +251 99 1.66666666666667e-01 +251 232 -1.66666666666667e-01 +251 250 -6.66666666666667e-01 +251 243 -1.66666666666667e-01 +251 214 -1.66666666666667e-01 +251 226 1.66666666666667e-01 +251 213 -1.66666666666667e-01 +251 225 1.66666666666667e-01 +251 245 -5.00000000000000e-01 +251 19 -3.33333333333333e-01 +251 244 3.33333333333333e-01 +251 345 1.66666666666667e-01 +251 419 -1.50000000000000e+00 +251 233 -5.00000000000000e-01 +251 418 3.33333333333333e-01 +251 100 -3.33333333333333e-01 +251 249 -6.66666666666667e-01 +251 417 3.33333333333333e-01 +251 231 3.33333333333333e-01 +252 252 5.00000000000000e+00 +252 346 3.33333333333333e-01 +252 345 -5.00000000000000e-01 +252 239 -3.33333333333333e-01 +252 238 1.66666666666667e-01 +252 251 3.33333333333333e-01 +252 454 1.66666666666667e-01 +252 250 3.33333333333333e-01 +252 249 -1.50000000000000e+00 +252 455 1.66666666666667e-01 +252 241 -1.66666666666667e-01 +252 242 3.33333333333333e-01 +252 254 -6.66666666666667e-01 +252 20 -1.66666666666667e-01 +252 240 -5.00000000000000e-01 +252 353 1.66666666666667e-01 +252 104 -1.66666666666667e-01 +252 352 -3.33333333333333e-01 +252 236 1.66666666666667e-01 +252 271 3.33333333333333e-01 +252 253 -6.66666666666667e-01 +252 272 3.33333333333333e-01 +252 103 -1.66666666666667e-01 +252 270 -1.50000000000000e+00 +252 235 1.66666666666667e-01 +252 19 -1.66666666666667e-01 +252 248 -1.66666666666667e-01 +252 245 1.66666666666667e-01 +252 427 1.66666666666667e-01 +252 421 -1.66666666666667e-01 +252 244 -3.33333333333333e-01 +252 247 3.33333333333333e-01 +252 246 -5.00000000000000e-01 +252 422 3.33333333333333e-01 +252 428 -3.33333333333333e-01 +252 420 -5.00000000000000e-01 +252 347 -1.66666666666667e-01 +253 253 5.00000000000000e+00 +253 345 3.33333333333333e-01 +253 347 3.33333333333333e-01 +253 346 -1.50000000000000e+00 +253 237 1.66666666666667e-01 +253 251 -1.66666666666667e-01 +253 453 1.66666666666667e-01 +253 250 -5.00000000000000e-01 +253 249 3.33333333333333e-01 +253 455 -3.33333333333333e-01 +253 240 -1.66666666666667e-01 +253 353 1.66666666666667e-01 +253 242 3.33333333333333e-01 +253 241 -5.00000000000000e-01 +253 351 -3.33333333333333e-01 +253 272 -1.66666666666667e-01 +253 270 3.33333333333333e-01 +253 252 -6.66666666666667e-01 +253 271 -5.00000000000000e-01 +253 102 -1.66666666666667e-01 +253 236 -3.33333333333333e-01 +253 234 1.66666666666667e-01 +253 18 -1.66666666666667e-01 +253 248 3.33333333333333e-01 +253 254 -6.66666666666667e-01 +253 422 3.33333333333333e-01 +253 426 1.66666666666667e-01 +253 420 -1.66666666666667e-01 +253 245 1.66666666666667e-01 +253 20 -1.66666666666667e-01 +253 247 -1.50000000000000e+00 +253 243 -3.33333333333333e-01 +253 246 3.33333333333333e-01 +253 428 1.66666666666667e-01 +253 104 -1.66666666666667e-01 +253 421 -5.00000000000000e-01 +253 239 1.66666666666667e-01 +254 254 5.00000000000000e+00 +254 238 1.66666666666667e-01 +254 347 -5.00000000000000e-01 +254 346 3.33333333333333e-01 +254 237 -3.33333333333333e-01 +254 250 -1.66666666666667e-01 +254 249 3.33333333333333e-01 +254 251 -5.00000000000000e-01 +254 454 -3.33333333333333e-01 +254 453 1.66666666666667e-01 +254 352 1.66666666666667e-01 +254 240 3.33333333333333e-01 +254 252 -6.66666666666667e-01 +254 242 -1.50000000000000e+00 +254 241 3.33333333333333e-01 +254 18 -1.66666666666667e-01 +254 351 1.66666666666667e-01 +254 102 -1.66666666666667e-01 +254 271 -1.66666666666667e-01 +254 234 1.66666666666667e-01 +254 272 -5.00000000000000e-01 +254 270 3.33333333333333e-01 +254 235 -3.33333333333333e-01 +254 246 -1.66666666666667e-01 +254 243 1.66666666666667e-01 +254 247 3.33333333333333e-01 +254 253 -6.66666666666667e-01 +254 421 3.33333333333333e-01 +254 248 -5.00000000000000e-01 +254 244 1.66666666666667e-01 +254 19 -1.66666666666667e-01 +254 422 -1.50000000000000e+00 +254 345 -1.66666666666667e-01 +254 427 1.66666666666667e-01 +254 103 -1.66666666666667e-01 +254 420 3.33333333333333e-01 +254 426 -3.33333333333333e-01 +255 255 1.50000000000000e+00 +255 25 8.33333333333333e-02 +255 277 -1.66666666666667e-01 +255 263 -8.33333333333333e-02 +255 256 -1.66666666666667e-01 +255 262 1.66666666666667e-01 +255 22 8.33333333333333e-02 +255 261 -2.50000000000000e-01 +255 284 -1.66666666666667e-01 +255 275 1.66666666666667e-01 +255 26 8.33333333333333e-02 +255 281 -1.66666666666667e-01 +255 280 8.33333333333333e-02 +255 283 -1.66666666666667e-01 +255 24 -5.00000000000000e-01 +255 257 -1.66666666666667e-01 +255 269 1.66666666666667e-01 +255 23 8.33333333333333e-02 +255 268 -8.33333333333333e-02 +255 274 1.66666666666667e-01 +255 278 8.33333333333333e-02 +255 267 -2.50000000000000e-01 +255 21 -5.00000000000000e-01 +256 256 1.33333333333333e+00 +256 24 8.33333333333333e-02 +256 276 -1.66666666666667e-01 +256 263 1.66666666666667e-01 +256 262 -7.50000000000000e-01 +256 255 -1.66666666666667e-01 +256 261 1.66666666666667e-01 +256 21 8.33333333333333e-02 +256 281 8.33333333333333e-02 +256 284 -1.66666666666667e-01 +256 25 -1.66666666666667e-01 +256 279 8.33333333333333e-02 +256 282 -1.66666666666667e-01 +256 269 1.66666666666667e-01 +256 275 -3.33333333333333e-01 +256 278 8.33333333333333e-02 +256 268 -2.50000000000000e-01 +256 22 -1.66666666666667e-01 +256 267 -8.33333333333333e-02 +256 273 1.66666666666667e-01 +257 257 1.33333333333333e+00 +257 276 8.33333333333333e-02 +257 263 -2.50000000000000e-01 +257 262 1.66666666666667e-01 +257 261 -8.33333333333333e-02 +257 280 8.33333333333333e-02 +257 283 -1.66666666666667e-01 +257 282 -1.66666666666667e-01 +257 273 1.66666666666667e-01 +257 26 -1.66666666666667e-01 +257 24 8.33333333333333e-02 +257 279 -1.66666666666667e-01 +257 277 8.33333333333333e-02 +257 269 -7.50000000000000e-01 +257 23 -1.66666666666667e-01 +257 268 1.66666666666667e-01 +257 274 -3.33333333333333e-01 +257 255 -1.66666666666667e-01 +257 267 1.66666666666667e-01 +257 21 8.33333333333333e-02 +258 258 2.50000000000000e+00 +258 349 -1.66666666666667e-01 +258 263 1.66666666666667e-01 +258 262 1.66666666666667e-01 +258 261 -7.50000000000000e-01 +258 356 -1.66666666666667e-01 +258 355 -1.66666666666667e-01 +258 275 -3.33333333333333e-01 +258 274 1.66666666666667e-01 +258 242 1.66666666666667e-01 +258 260 -3.33333333333333e-01 +258 272 3.33333333333333e-01 +258 352 1.66666666666667e-01 +258 271 -1.66666666666667e-01 +258 23 -8.33333333333333e-02 +258 236 8.33333333333333e-02 +258 22 1.66666666666667e-01 +258 235 -1.66666666666667e-01 +258 21 -2.50000000000000e-01 +258 270 -5.00000000000000e-01 +258 50 -8.33333333333333e-02 +258 353 1.66666666666667e-01 +258 259 -3.33333333333333e-01 +258 49 1.66666666666667e-01 +258 241 1.66666666666667e-01 +258 350 8.33333333333333e-02 +258 48 -2.50000000000000e-01 +258 240 -7.50000000000000e-01 +259 259 2.50000000000000e+00 +259 348 -1.66666666666667e-01 +259 263 -8.33333333333333e-02 +259 262 -2.50000000000000e-01 +259 261 1.66666666666667e-01 +259 356 -1.66666666666667e-01 +259 275 1.66666666666667e-01 +259 354 -1.66666666666667e-01 +259 273 1.66666666666667e-01 +259 242 -8.33333333333333e-02 +259 236 8.33333333333333e-02 +259 351 1.66666666666667e-01 +259 270 -1.66666666666667e-01 +259 23 1.66666666666667e-01 +259 260 -3.33333333333333e-01 +259 272 3.33333333333333e-01 +259 22 -7.50000000000000e-01 +259 271 -5.00000000000000e-01 +259 21 1.66666666666667e-01 +259 234 -1.66666666666667e-01 +259 50 1.66666666666667e-01 +259 353 -3.33333333333333e-01 +259 350 8.33333333333333e-02 +259 49 -7.50000000000000e-01 +259 241 -2.50000000000000e-01 +259 258 -3.33333333333333e-01 +259 48 1.66666666666667e-01 +259 240 1.66666666666667e-01 +260 260 2.50000000000000e+00 +260 349 8.33333333333333e-02 +260 263 -2.50000000000000e-01 +260 262 -8.33333333333333e-02 +260 261 1.66666666666667e-01 +260 354 -1.66666666666667e-01 +260 355 -1.66666666666667e-01 +260 274 1.66666666666667e-01 +260 273 -3.33333333333333e-01 +260 241 -8.33333333333333e-02 +260 235 8.33333333333333e-02 +260 240 1.66666666666667e-01 +260 258 -3.33333333333333e-01 +260 270 3.33333333333333e-01 +260 23 -2.50000000000000e-01 +260 272 -1.50000000000000e+00 +260 22 1.66666666666667e-01 +260 259 -3.33333333333333e-01 +260 271 3.33333333333333e-01 +260 21 -8.33333333333333e-02 +260 234 8.33333333333333e-02 +260 348 8.33333333333333e-02 +260 50 -2.50000000000000e-01 +260 242 -2.50000000000000e-01 +260 49 1.66666666666667e-01 +260 352 -3.33333333333333e-01 +260 48 -8.33333333333333e-02 +260 351 1.66666666666667e-01 +261 261 2.50000000000000e+00 +261 355 1.66666666666667e-01 +261 356 1.66666666666667e-01 +261 349 1.66666666666667e-01 +261 348 -2.50000000000000e-01 +261 263 -3.33333333333333e-01 +261 260 1.66666666666667e-01 +261 259 1.66666666666667e-01 +261 258 -7.50000000000000e-01 +261 274 -1.66666666666667e-01 +261 262 -3.33333333333333e-01 +261 278 1.66666666666667e-01 +261 358 -1.66666666666667e-01 +261 283 1.66666666666667e-01 +261 275 3.33333333333333e-01 +261 284 -3.33333333333333e-01 +261 53 8.33333333333333e-02 +261 359 -1.66666666666667e-01 +261 277 1.66666666666667e-01 +261 52 -1.66666666666667e-01 +261 276 -7.50000000000000e-01 +261 257 -8.33333333333333e-02 +261 23 8.33333333333333e-02 +261 256 1.66666666666667e-01 +261 22 -1.66666666666667e-01 +261 255 -2.50000000000000e-01 +261 350 -8.33333333333333e-02 +261 273 -5.00000000000000e-01 +262 262 2.50000000000000e+00 +262 354 1.66666666666667e-01 +262 356 -3.33333333333333e-01 +262 53 8.33333333333333e-02 +262 349 -7.50000000000000e-01 +262 348 1.66666666666667e-01 +262 260 -8.33333333333333e-02 +262 23 8.33333333333333e-02 +262 259 -2.50000000000000e-01 +262 258 1.66666666666667e-01 +262 273 -1.66666666666667e-01 +262 278 -8.33333333333333e-02 +262 261 -3.33333333333333e-01 +262 357 -1.66666666666667e-01 +262 282 1.66666666666667e-01 +262 359 -1.66666666666667e-01 +262 284 1.66666666666667e-01 +262 277 -2.50000000000000e-01 +262 276 1.66666666666667e-01 +262 51 -1.66666666666667e-01 +262 257 1.66666666666667e-01 +262 263 -3.33333333333333e-01 +262 275 3.33333333333333e-01 +262 256 -7.50000000000000e-01 +262 350 1.66666666666667e-01 +262 274 -5.00000000000000e-01 +262 255 1.66666666666667e-01 +262 21 -1.66666666666667e-01 +263 263 2.50000000000000e+00 +263 349 1.66666666666667e-01 +263 355 -3.33333333333333e-01 +263 354 1.66666666666667e-01 +263 350 -2.50000000000000e-01 +263 52 8.33333333333333e-02 +263 260 -2.50000000000000e-01 +263 259 -8.33333333333333e-02 +263 22 8.33333333333333e-02 +263 261 -3.33333333333333e-01 +263 258 1.66666666666667e-01 +263 277 -8.33333333333333e-02 +263 276 1.66666666666667e-01 +263 358 -1.66666666666667e-01 +263 283 1.66666666666667e-01 +263 273 3.33333333333333e-01 +263 282 -3.33333333333333e-01 +263 278 -2.50000000000000e-01 +263 51 8.33333333333333e-02 +263 357 -1.66666666666667e-01 +263 257 -2.50000000000000e-01 +263 348 -8.33333333333333e-02 +263 275 -1.50000000000000e+00 +263 256 1.66666666666667e-01 +263 262 -3.33333333333333e-01 +263 274 3.33333333333333e-01 +263 255 -8.33333333333333e-02 +263 21 8.33333333333333e-02 +264 264 2.50000000000000e+00 +264 431 -1.66666666666667e-01 +264 424 8.33333333333333e-02 +264 430 -1.66666666666667e-01 +264 425 -1.66666666666667e-01 +264 269 1.66666666666667e-01 +264 268 1.66666666666667e-01 +264 274 -3.33333333333333e-01 +264 267 -7.50000000000000e-01 +264 428 1.66666666666667e-01 +264 272 -1.66666666666667e-01 +264 265 -3.33333333333333e-01 +264 271 3.33333333333333e-01 +264 247 1.66666666666667e-01 +264 23 1.66666666666667e-01 +264 236 -1.66666666666667e-01 +264 22 -8.33333333333333e-02 +264 235 8.33333333333333e-02 +264 21 -2.50000000000000e-01 +264 270 -5.00000000000000e-01 +264 266 -3.33333333333333e-01 +264 77 1.66666666666667e-01 +264 248 1.66666666666667e-01 +264 76 -8.33333333333333e-02 +264 427 1.66666666666667e-01 +264 275 1.66666666666667e-01 +264 75 -2.50000000000000e-01 +264 246 -7.50000000000000e-01 +265 265 2.50000000000000e+00 +265 429 -1.66666666666667e-01 +265 425 8.33333333333333e-02 +265 431 -1.66666666666667e-01 +265 269 -8.33333333333333e-02 +265 275 1.66666666666667e-01 +265 268 -2.50000000000000e-01 +265 267 1.66666666666667e-01 +265 273 -3.33333333333333e-01 +265 236 8.33333333333333e-02 +265 248 -8.33333333333333e-02 +265 264 -3.33333333333333e-01 +265 270 3.33333333333333e-01 +265 246 1.66666666666667e-01 +265 23 1.66666666666667e-01 +265 266 -3.33333333333333e-01 +265 272 3.33333333333333e-01 +265 22 -2.50000000000000e-01 +265 271 -1.50000000000000e+00 +265 21 -8.33333333333333e-02 +265 234 8.33333333333333e-02 +265 77 1.66666666666667e-01 +265 428 -3.33333333333333e-01 +265 423 8.33333333333333e-02 +265 76 -2.50000000000000e-01 +265 247 -2.50000000000000e-01 +265 75 -8.33333333333333e-02 +265 426 1.66666666666667e-01 +266 266 2.50000000000000e+00 +266 429 -1.66666666666667e-01 +266 424 8.33333333333333e-02 +266 430 -1.66666666666667e-01 +266 423 -1.66666666666667e-01 +266 269 -2.50000000000000e-01 +266 268 -8.33333333333333e-02 +266 274 1.66666666666667e-01 +266 267 1.66666666666667e-01 +266 426 1.66666666666667e-01 +266 270 -1.66666666666667e-01 +266 235 8.33333333333333e-02 +266 247 -8.33333333333333e-02 +266 23 -7.50000000000000e-01 +266 272 -5.00000000000000e-01 +266 22 1.66666666666667e-01 +266 265 -3.33333333333333e-01 +266 271 3.33333333333333e-01 +266 21 1.66666666666667e-01 +266 234 -1.66666666666667e-01 +266 273 1.66666666666667e-01 +266 77 -7.50000000000000e-01 +266 248 -2.50000000000000e-01 +266 76 1.66666666666667e-01 +266 427 -3.33333333333333e-01 +266 264 -3.33333333333333e-01 +266 75 1.66666666666667e-01 +266 246 1.66666666666667e-01 +267 267 2.50000000000000e+00 +267 284 1.66666666666667e-01 +267 283 -3.33333333333333e-01 +267 281 1.66666666666667e-01 +267 79 8.33333333333333e-02 +267 279 -7.50000000000000e-01 +267 257 1.66666666666667e-01 +267 256 -8.33333333333333e-02 +267 22 8.33333333333333e-02 +267 255 -2.50000000000000e-01 +267 275 -1.66666666666667e-01 +267 269 -3.33333333333333e-01 +267 424 -8.33333333333333e-02 +267 434 -1.66666666666667e-01 +267 431 1.66666666666667e-01 +267 433 -1.66666666666667e-01 +267 430 1.66666666666667e-01 +267 425 1.66666666666667e-01 +267 80 -1.66666666666667e-01 +267 423 -2.50000000000000e-01 +267 266 1.66666666666667e-01 +267 23 -1.66666666666667e-01 +267 265 1.66666666666667e-01 +267 268 -3.33333333333333e-01 +267 274 3.33333333333333e-01 +267 264 -7.50000000000000e-01 +267 280 1.66666666666667e-01 +267 273 -5.00000000000000e-01 +268 268 2.50000000000000e+00 +268 284 1.66666666666667e-01 +268 279 1.66666666666667e-01 +268 282 -3.33333333333333e-01 +268 280 -2.50000000000000e-01 +268 78 8.33333333333333e-02 +268 257 1.66666666666667e-01 +268 269 -3.33333333333333e-01 +268 256 -2.50000000000000e-01 +268 255 -8.33333333333333e-02 +268 21 8.33333333333333e-02 +268 423 -8.33333333333333e-02 +268 425 1.66666666666667e-01 +268 275 3.33333333333333e-01 +268 431 -3.33333333333333e-01 +268 432 -1.66666666666667e-01 +268 429 1.66666666666667e-01 +268 80 8.33333333333333e-02 +268 434 -1.66666666666667e-01 +268 424 -2.50000000000000e-01 +268 266 -8.33333333333333e-02 +268 23 8.33333333333333e-02 +268 265 -2.50000000000000e-01 +268 281 -8.33333333333333e-02 +268 274 -1.50000000000000e+00 +268 264 1.66666666666667e-01 +268 267 -3.33333333333333e-01 +268 273 3.33333333333333e-01 +269 269 2.50000000000000e+00 +269 283 1.66666666666667e-01 +269 282 1.66666666666667e-01 +269 281 -2.50000000000000e-01 +269 279 1.66666666666667e-01 +269 257 -7.50000000000000e-01 +269 256 1.66666666666667e-01 +269 268 -3.33333333333333e-01 +269 255 1.66666666666667e-01 +269 273 -1.66666666666667e-01 +269 267 -3.33333333333333e-01 +269 424 1.66666666666667e-01 +269 432 -1.66666666666667e-01 +269 429 1.66666666666667e-01 +269 274 3.33333333333333e-01 +269 430 -3.33333333333333e-01 +269 425 -7.50000000000000e-01 +269 79 8.33333333333333e-02 +269 433 -1.66666666666667e-01 +269 423 1.66666666666667e-01 +269 78 -1.66666666666667e-01 +269 266 -2.50000000000000e-01 +269 280 -8.33333333333333e-02 +269 275 -5.00000000000000e-01 +269 265 -8.33333333333333e-02 +269 22 8.33333333333333e-02 +269 264 1.66666666666667e-01 +269 21 -1.66666666666667e-01 +270 270 5.00000000000000e+00 +270 355 -3.33333333333333e-01 +270 275 3.33333333333333e-01 +270 431 -3.33333333333333e-01 +270 457 -1.66666666666667e-01 +270 430 1.66666666666667e-01 +270 458 -1.66666666666667e-01 +270 274 3.33333333333333e-01 +270 273 -1.50000000000000e+00 +270 260 3.33333333333333e-01 +270 241 1.66666666666667e-01 +270 259 -1.66666666666667e-01 +270 242 -3.33333333333333e-01 +270 23 1.66666666666667e-01 +270 258 -5.00000000000000e-01 +270 353 -1.66666666666667e-01 +270 104 1.66666666666667e-01 +270 271 -6.66666666666667e-01 +270 352 3.33333333333333e-01 +270 351 -5.00000000000000e-01 +270 266 -1.66666666666667e-01 +270 265 3.33333333333333e-01 +270 236 -1.66666666666667e-01 +270 248 1.66666666666667e-01 +270 253 3.33333333333333e-01 +270 247 -3.33333333333333e-01 +270 22 1.66666666666667e-01 +270 235 -1.66666666666667e-01 +270 264 -5.00000000000000e-01 +270 272 -6.66666666666667e-01 +270 428 3.33333333333333e-01 +270 254 3.33333333333333e-01 +270 427 -1.66666666666667e-01 +270 103 1.66666666666667e-01 +270 356 1.66666666666667e-01 +270 426 -5.00000000000000e-01 +270 252 -1.50000000000000e+00 +271 271 5.00000000000000e+00 +271 354 -3.33333333333333e-01 +271 275 -1.66666666666667e-01 +271 458 -1.66666666666667e-01 +271 431 1.66666666666667e-01 +271 456 -1.66666666666667e-01 +271 429 1.66666666666667e-01 +271 274 -5.00000000000000e-01 +271 273 3.33333333333333e-01 +271 240 1.66666666666667e-01 +271 258 -1.66666666666667e-01 +271 242 1.66666666666667e-01 +271 260 3.33333333333333e-01 +271 259 -5.00000000000000e-01 +271 353 3.33333333333333e-01 +271 352 -1.50000000000000e+00 +271 270 -6.66666666666667e-01 +271 351 3.33333333333333e-01 +271 254 -1.66666666666667e-01 +271 272 -6.66666666666667e-01 +271 236 -1.66666666666667e-01 +271 248 1.66666666666667e-01 +271 264 3.33333333333333e-01 +271 252 3.33333333333333e-01 +271 246 -3.33333333333333e-01 +271 23 -3.33333333333333e-01 +271 266 3.33333333333333e-01 +271 265 -1.50000000000000e+00 +271 21 1.66666666666667e-01 +271 234 -1.66666666666667e-01 +271 428 3.33333333333333e-01 +271 104 -3.33333333333333e-01 +271 356 1.66666666666667e-01 +271 427 -5.00000000000000e-01 +271 253 -5.00000000000000e-01 +271 426 -1.66666666666667e-01 +271 102 1.66666666666667e-01 +272 272 5.00000000000000e+00 +272 355 1.66666666666667e-01 +272 274 -1.66666666666667e-01 +272 457 -1.66666666666667e-01 +272 430 1.66666666666667e-01 +272 273 3.33333333333333e-01 +272 429 -3.33333333333333e-01 +272 456 -1.66666666666667e-01 +272 275 -5.00000000000000e-01 +272 258 3.33333333333333e-01 +272 241 1.66666666666667e-01 +272 240 -3.33333333333333e-01 +272 260 -1.50000000000000e+00 +272 259 3.33333333333333e-01 +272 21 1.66666666666667e-01 +272 353 -5.00000000000000e-01 +272 352 3.33333333333333e-01 +272 351 -1.66666666666667e-01 +272 102 1.66666666666667e-01 +272 253 -1.66666666666667e-01 +272 271 -6.66666666666667e-01 +272 264 -1.66666666666667e-01 +272 235 -1.66666666666667e-01 +272 247 1.66666666666667e-01 +272 234 -1.66666666666667e-01 +272 246 1.66666666666667e-01 +272 266 -5.00000000000000e-01 +272 22 -3.33333333333333e-01 +272 265 3.33333333333333e-01 +272 354 1.66666666666667e-01 +272 428 -1.50000000000000e+00 +272 254 -5.00000000000000e-01 +272 427 3.33333333333333e-01 +272 103 -3.33333333333333e-01 +272 270 -6.66666666666667e-01 +272 426 3.33333333333333e-01 +272 252 3.33333333333333e-01 +273 273 5.00000000000000e+00 +273 355 3.33333333333333e-01 +273 354 -5.00000000000000e-01 +273 260 -3.33333333333333e-01 +273 259 1.66666666666667e-01 +273 272 3.33333333333333e-01 +273 457 1.66666666666667e-01 +273 271 3.33333333333333e-01 +273 270 -1.50000000000000e+00 +273 458 1.66666666666667e-01 +273 262 -1.66666666666667e-01 +273 263 3.33333333333333e-01 +273 275 -6.66666666666667e-01 +273 23 -1.66666666666667e-01 +273 261 -5.00000000000000e-01 +273 359 1.66666666666667e-01 +273 107 -1.66666666666667e-01 +273 358 -3.33333333333333e-01 +273 257 1.66666666666667e-01 +273 283 3.33333333333333e-01 +273 274 -6.66666666666667e-01 +273 284 3.33333333333333e-01 +273 106 -1.66666666666667e-01 +273 282 -1.50000000000000e+00 +273 256 1.66666666666667e-01 +273 22 -1.66666666666667e-01 +273 269 -1.66666666666667e-01 +273 266 1.66666666666667e-01 +273 433 1.66666666666667e-01 +273 430 -1.66666666666667e-01 +273 265 -3.33333333333333e-01 +273 268 3.33333333333333e-01 +273 267 -5.00000000000000e-01 +273 431 3.33333333333333e-01 +273 434 -3.33333333333333e-01 +273 429 -5.00000000000000e-01 +273 356 -1.66666666666667e-01 +274 274 5.00000000000000e+00 +274 354 3.33333333333333e-01 +274 356 3.33333333333333e-01 +274 355 -1.50000000000000e+00 +274 258 1.66666666666667e-01 +274 272 -1.66666666666667e-01 +274 456 1.66666666666667e-01 +274 271 -5.00000000000000e-01 +274 270 3.33333333333333e-01 +274 458 -3.33333333333333e-01 +274 261 -1.66666666666667e-01 +274 359 1.66666666666667e-01 +274 263 3.33333333333333e-01 +274 262 -5.00000000000000e-01 +274 357 -3.33333333333333e-01 +274 284 -1.66666666666667e-01 +274 282 3.33333333333333e-01 +274 273 -6.66666666666667e-01 +274 283 -5.00000000000000e-01 +274 105 -1.66666666666667e-01 +274 257 -3.33333333333333e-01 +274 255 1.66666666666667e-01 +274 21 -1.66666666666667e-01 +274 269 3.33333333333333e-01 +274 275 -6.66666666666667e-01 +274 431 3.33333333333333e-01 +274 432 1.66666666666667e-01 +274 429 -1.66666666666667e-01 +274 266 1.66666666666667e-01 +274 23 -1.66666666666667e-01 +274 268 -1.50000000000000e+00 +274 264 -3.33333333333333e-01 +274 267 3.33333333333333e-01 +274 434 1.66666666666667e-01 +274 107 -1.66666666666667e-01 +274 430 -5.00000000000000e-01 +274 260 1.66666666666667e-01 +275 275 5.00000000000000e+00 +275 259 1.66666666666667e-01 +275 356 -5.00000000000000e-01 +275 355 3.33333333333333e-01 +275 258 -3.33333333333333e-01 +275 271 -1.66666666666667e-01 +275 270 3.33333333333333e-01 +275 272 -5.00000000000000e-01 +275 457 -3.33333333333333e-01 +275 456 1.66666666666667e-01 +275 358 1.66666666666667e-01 +275 261 3.33333333333333e-01 +275 273 -6.66666666666667e-01 +275 263 -1.50000000000000e+00 +275 262 3.33333333333333e-01 +275 21 -1.66666666666667e-01 +275 357 1.66666666666667e-01 +275 105 -1.66666666666667e-01 +275 283 -1.66666666666667e-01 +275 255 1.66666666666667e-01 +275 284 -5.00000000000000e-01 +275 282 3.33333333333333e-01 +275 256 -3.33333333333333e-01 +275 267 -1.66666666666667e-01 +275 264 1.66666666666667e-01 +275 268 3.33333333333333e-01 +275 274 -6.66666666666667e-01 +275 430 3.33333333333333e-01 +275 269 -5.00000000000000e-01 +275 265 1.66666666666667e-01 +275 22 -1.66666666666667e-01 +275 431 -1.50000000000000e+00 +275 354 -1.66666666666667e-01 +275 433 1.66666666666667e-01 +275 106 -1.66666666666667e-01 +275 429 3.33333333333333e-01 +275 432 -3.33333333333333e-01 +276 276 1.16666666666667e+00 +276 278 -3.33333333333333e-01 +276 284 1.66666666666667e-01 +276 358 8.33333333333333e-02 +276 283 -8.33333333333333e-02 +276 26 -8.33333333333333e-02 +276 257 8.33333333333333e-02 +276 25 8.33333333333333e-02 +276 256 -1.66666666666667e-01 +276 24 -8.33333333333333e-02 +276 282 -2.50000000000000e-01 +276 53 -8.33333333333333e-02 +276 359 8.33333333333333e-02 +276 277 -1.66666666666667e-01 +276 52 8.33333333333333e-02 +276 262 1.66666666666667e-01 +276 263 1.66666666666667e-01 +276 51 -8.33333333333333e-02 +276 261 -7.50000000000000e-01 +277 277 1.00000000000000e+00 +277 257 8.33333333333333e-02 +277 357 8.33333333333333e-02 +277 282 -8.33333333333333e-02 +277 26 8.33333333333333e-02 +277 278 -1.66666666666667e-01 +277 284 1.66666666666667e-01 +277 25 -2.50000000000000e-01 +277 283 -2.50000000000000e-01 +277 24 8.33333333333333e-02 +277 255 -1.66666666666667e-01 +277 53 8.33333333333333e-02 +277 359 -1.66666666666667e-01 +277 263 -8.33333333333333e-02 +277 52 -2.50000000000000e-01 +277 262 -2.50000000000000e-01 +277 276 -1.66666666666667e-01 +277 51 8.33333333333333e-02 +277 261 1.66666666666667e-01 +278 278 1.16666666666667e+00 +278 256 8.33333333333333e-02 +278 261 1.66666666666667e-01 +278 276 -3.33333333333333e-01 +278 282 1.66666666666667e-01 +278 26 -8.33333333333333e-02 +278 284 -7.50000000000000e-01 +278 25 8.33333333333333e-02 +278 277 -1.66666666666667e-01 +278 283 1.66666666666667e-01 +278 24 -8.33333333333333e-02 +278 255 8.33333333333333e-02 +278 262 -8.33333333333333e-02 +278 53 -8.33333333333333e-02 +278 263 -2.50000000000000e-01 +278 52 8.33333333333333e-02 +278 358 -1.66666666666667e-01 +278 51 -8.33333333333333e-02 +278 357 8.33333333333333e-02 +279 279 1.16666666666667e+00 +279 284 -8.33333333333333e-02 +279 280 -3.33333333333333e-01 +279 283 1.66666666666667e-01 +279 268 1.66666666666667e-01 +279 26 8.33333333333333e-02 +279 257 -1.66666666666667e-01 +279 25 -8.33333333333333e-02 +279 256 8.33333333333333e-02 +279 24 -8.33333333333333e-02 +279 282 -2.50000000000000e-01 +279 281 -1.66666666666667e-01 +279 80 8.33333333333333e-02 +279 269 1.66666666666667e-01 +279 79 -8.33333333333333e-02 +279 433 8.33333333333333e-02 +279 434 8.33333333333333e-02 +279 78 -8.33333333333333e-02 +279 267 -7.50000000000000e-01 +280 280 1.16666666666667e+00 +280 269 -8.33333333333333e-02 +280 279 -3.33333333333333e-01 +280 282 1.66666666666667e-01 +280 267 1.66666666666667e-01 +280 26 8.33333333333333e-02 +280 281 -1.66666666666667e-01 +280 284 1.66666666666667e-01 +280 25 -8.33333333333333e-02 +280 283 -7.50000000000000e-01 +280 24 -8.33333333333333e-02 +280 255 8.33333333333333e-02 +280 80 8.33333333333333e-02 +280 434 -1.66666666666667e-01 +280 257 8.33333333333333e-02 +280 79 -8.33333333333333e-02 +280 268 -2.50000000000000e-01 +280 78 -8.33333333333333e-02 +280 432 8.33333333333333e-02 +281 281 1.00000000000000e+00 +281 282 -8.33333333333333e-02 +281 256 8.33333333333333e-02 +281 268 -8.33333333333333e-02 +281 26 -2.50000000000000e-01 +281 284 -2.50000000000000e-01 +281 25 8.33333333333333e-02 +281 280 -1.66666666666667e-01 +281 283 1.66666666666667e-01 +281 24 8.33333333333333e-02 +281 255 -1.66666666666667e-01 +281 432 8.33333333333333e-02 +281 80 -2.50000000000000e-01 +281 269 -2.50000000000000e-01 +281 79 8.33333333333333e-02 +281 433 -1.66666666666667e-01 +281 279 -1.66666666666667e-01 +281 78 8.33333333333333e-02 +281 267 1.66666666666667e-01 +282 282 2.50000000000000e+00 +282 262 1.66666666666667e-01 +282 277 -8.33333333333333e-02 +282 263 -3.33333333333333e-01 +282 26 8.33333333333333e-02 +282 276 -2.50000000000000e-01 +282 359 -8.33333333333333e-02 +282 107 8.33333333333333e-02 +282 283 -3.33333333333333e-01 +282 358 1.66666666666667e-01 +282 357 -2.50000000000000e-01 +282 281 -8.33333333333333e-02 +282 280 1.66666666666667e-01 +282 257 -1.66666666666667e-01 +282 269 1.66666666666667e-01 +282 274 3.33333333333333e-01 +282 268 -3.33333333333333e-01 +282 25 8.33333333333333e-02 +282 256 -1.66666666666667e-01 +282 279 -2.50000000000000e-01 +282 284 -3.33333333333333e-01 +282 434 1.66666666666667e-01 +282 275 3.33333333333333e-01 +282 433 -8.33333333333333e-02 +282 106 8.33333333333333e-02 +282 278 1.66666666666667e-01 +282 432 -2.50000000000000e-01 +282 273 -1.50000000000000e+00 +283 283 2.50000000000000e+00 +283 276 -8.33333333333333e-02 +283 263 1.66666666666667e-01 +283 278 1.66666666666667e-01 +283 277 -2.50000000000000e-01 +283 359 1.66666666666667e-01 +283 358 -7.50000000000000e-01 +283 282 -3.33333333333333e-01 +283 357 1.66666666666667e-01 +283 275 -1.66666666666667e-01 +283 284 -3.33333333333333e-01 +283 257 -1.66666666666667e-01 +283 269 1.66666666666667e-01 +283 279 1.66666666666667e-01 +283 273 3.33333333333333e-01 +283 267 -3.33333333333333e-01 +283 26 -1.66666666666667e-01 +283 281 1.66666666666667e-01 +283 280 -7.50000000000000e-01 +283 24 8.33333333333333e-02 +283 255 -1.66666666666667e-01 +283 434 1.66666666666667e-01 +283 107 -1.66666666666667e-01 +283 261 1.66666666666667e-01 +283 433 -2.50000000000000e-01 +283 274 -5.00000000000000e-01 +283 432 -8.33333333333333e-02 +283 105 8.33333333333333e-02 +284 284 2.50000000000000e+00 +284 262 1.66666666666667e-01 +284 261 -3.33333333333333e-01 +284 278 -7.50000000000000e-01 +284 277 1.66666666666667e-01 +284 24 8.33333333333333e-02 +284 359 -2.50000000000000e-01 +284 358 1.66666666666667e-01 +284 357 -8.33333333333333e-02 +284 105 8.33333333333333e-02 +284 274 -1.66666666666667e-01 +284 283 -3.33333333333333e-01 +284 279 -8.33333333333333e-02 +284 256 -1.66666666666667e-01 +284 268 1.66666666666667e-01 +284 255 -1.66666666666667e-01 +284 267 1.66666666666667e-01 +284 281 -2.50000000000000e-01 +284 25 -1.66666666666667e-01 +284 280 1.66666666666667e-01 +284 276 1.66666666666667e-01 +284 434 -7.50000000000000e-01 +284 275 -5.00000000000000e-01 +284 433 1.66666666666667e-01 +284 106 -1.66666666666667e-01 +284 282 -3.33333333333333e-01 +284 432 1.66666666666667e-01 +284 273 3.33333333333333e-01 +285 285 5.00000000000000e+01 +285 116 -4.16666666666667e+00 +285 298 4.16666666666667e+00 +285 292 -4.16666666666667e+00 +285 32 4.16666666666667e+00 +285 299 -8.33333333333333e+00 +285 31 4.16666666666667e+00 +285 286 -8.33333333333333e+00 +285 115 8.33333333333333e+00 +285 30 -1.25000000000000e+01 +285 114 -1.25000000000000e+01 +285 287 -8.33333333333333e+00 +285 29 0.00000000000000e+00 +285 293 8.33333333333333e+00 +285 28 0.00000000000000e+00 +285 112 0.00000000000000e+00 +285 113 0.00000000000000e+00 +285 27 0.00000000000000e+00 +285 291 -1.25000000000000e+01 +286 286 5.83333333333333e+01 +286 116 8.33333333333333e+00 +286 293 8.33333333333333e+00 +286 297 4.16666666666667e+00 +286 291 -4.16666666666667e+00 +286 32 -4.16666666666667e+00 +286 299 4.16666666666667e+00 +286 31 -4.16666666666667e+00 +286 115 -3.75000000000000e+01 +286 30 4.16666666666667e+00 +286 285 -8.33333333333333e+00 +286 114 8.33333333333333e+00 +286 29 0.00000000000000e+00 +286 113 0.00000000000000e+00 +286 287 -1.66666666666667e+01 +286 28 0.00000000000000e+00 +286 292 -1.25000000000000e+01 +286 27 0.00000000000000e+00 +286 111 0.00000000000000e+00 +287 287 5.83333333333333e+01 +287 114 -4.16666666666667e+00 +287 286 -1.66666666666667e+01 +287 115 8.33333333333333e+00 +287 292 8.33333333333333e+00 +287 32 -4.16666666666667e+00 +287 116 -1.25000000000000e+01 +287 31 -4.16666666666667e+00 +287 298 4.16666666666667e+00 +287 30 4.16666666666667e+00 +287 297 -8.33333333333333e+00 +287 111 0.00000000000000e+00 +287 29 0.00000000000000e+00 +287 293 -3.75000000000000e+01 +287 28 0.00000000000000e+00 +287 112 0.00000000000000e+00 +287 285 -8.33333333333333e+00 +287 27 0.00000000000000e+00 +287 291 8.33333333333333e+00 +288 288 1.00000000000000e+00 +288 125 0.00000000000000e+00 +288 292 0.00000000000000e+00 +288 289 0.00000000000000e+00 +288 124 0.00000000000000e+00 +288 83 0.00000000000000e+00 +288 437 0.00000000000000e+00 +288 82 0.00000000000000e+00 +288 436 0.00000000000000e+00 +288 81 0.00000000000000e+00 +288 123 0.00000000000000e+00 +288 290 0.00000000000000e+00 +288 29 0.00000000000000e+00 +288 293 0.00000000000000e+00 +288 28 0.00000000000000e+00 +288 112 0.00000000000000e+00 +288 113 0.00000000000000e+00 +288 27 0.00000000000000e+00 +288 291 0.00000000000000e+00 +289 289 1.00000000000000e+00 +289 437 0.00000000000000e+00 +289 291 0.00000000000000e+00 +289 288 0.00000000000000e+00 +289 123 0.00000000000000e+00 +289 83 0.00000000000000e+00 +289 290 0.00000000000000e+00 +289 125 0.00000000000000e+00 +289 82 0.00000000000000e+00 +289 124 0.00000000000000e+00 +289 81 0.00000000000000e+00 +289 435 0.00000000000000e+00 +289 29 0.00000000000000e+00 +289 113 0.00000000000000e+00 +289 293 0.00000000000000e+00 +289 28 0.00000000000000e+00 +289 292 0.00000000000000e+00 +289 27 0.00000000000000e+00 +289 111 0.00000000000000e+00 +290 290 1.00000000000000e+00 +290 436 0.00000000000000e+00 +290 111 0.00000000000000e+00 +290 123 0.00000000000000e+00 +290 83 0.00000000000000e+00 +290 125 0.00000000000000e+00 +290 82 0.00000000000000e+00 +290 289 0.00000000000000e+00 +290 124 0.00000000000000e+00 +290 81 0.00000000000000e+00 +290 435 0.00000000000000e+00 +290 292 0.00000000000000e+00 +290 29 0.00000000000000e+00 +290 293 0.00000000000000e+00 +290 28 0.00000000000000e+00 +290 112 0.00000000000000e+00 +290 288 0.00000000000000e+00 +290 27 0.00000000000000e+00 +290 291 0.00000000000000e+00 +291 291 1.25000000000000e+02 +291 115 8.33333333333333e+00 +291 116 8.33333333333333e+00 +291 287 8.33333333333333e+00 +291 285 -1.25000000000000e+01 +291 299 8.33333333333333e+00 +291 298 8.33333333333333e+00 +291 292 -1.66666666666667e+01 +291 297 -3.75000000000000e+01 +291 128 -8.33333333333333e+00 +291 293 -1.66666666666667e+01 +291 113 0.00000000000000e+00 +291 125 0.00000000000000e+00 +291 289 0.00000000000000e+00 +291 127 1.66666666666667e+01 +291 124 0.00000000000000e+00 +291 290 0.00000000000000e+00 +291 29 0.00000000000000e+00 +291 28 0.00000000000000e+00 +291 112 0.00000000000000e+00 +291 288 0.00000000000000e+00 +291 437 8.33333333333333e+00 +291 86 -8.33333333333333e+00 +291 436 -4.16666666666667e+00 +291 85 4.16666666666667e+00 +291 435 -1.25000000000000e+01 +291 286 -4.16666666666667e+00 +291 126 -2.50000000000000e+01 +292 292 1.25000000000000e+02 +292 285 -4.16666666666667e+00 +292 114 8.33333333333333e+00 +292 116 -1.66666666666667e+01 +292 29 0.00000000000000e+00 +292 286 -1.25000000000000e+01 +292 299 -4.16666666666667e+00 +292 86 4.16666666666667e+00 +292 298 -1.25000000000000e+01 +292 297 8.33333333333333e+00 +292 291 -1.66666666666667e+01 +292 290 0.00000000000000e+00 +292 288 0.00000000000000e+00 +292 113 0.00000000000000e+00 +292 125 0.00000000000000e+00 +292 126 1.66666666666667e+01 +292 123 0.00000000000000e+00 +292 289 0.00000000000000e+00 +292 27 0.00000000000000e+00 +292 111 0.00000000000000e+00 +292 437 8.33333333333333e+00 +292 293 -1.66666666666667e+01 +292 128 1.66666666666667e+01 +292 436 -1.25000000000000e+01 +292 287 8.33333333333333e+00 +292 127 -7.50000000000000e+01 +292 435 -4.16666666666667e+00 +292 84 4.16666666666667e+00 +293 293 1.25000000000000e+02 +293 115 -1.66666666666667e+01 +293 114 8.33333333333333e+00 +293 287 -3.75000000000000e+01 +293 28 0.00000000000000e+00 +293 285 8.33333333333333e+00 +293 299 -1.25000000000000e+01 +293 298 -4.16666666666667e+00 +293 85 4.16666666666667e+00 +293 297 8.33333333333333e+00 +293 126 -8.33333333333333e+00 +293 289 0.00000000000000e+00 +293 291 -1.66666666666667e+01 +293 111 0.00000000000000e+00 +293 123 0.00000000000000e+00 +293 112 0.00000000000000e+00 +293 124 0.00000000000000e+00 +293 290 0.00000000000000e+00 +293 288 0.00000000000000e+00 +293 27 0.00000000000000e+00 +293 437 -3.75000000000000e+01 +293 286 8.33333333333333e+00 +293 128 -2.50000000000000e+01 +293 436 8.33333333333333e+00 +293 292 -1.66666666666667e+01 +293 127 1.66666666666667e+01 +293 435 8.33333333333333e+00 +293 84 -8.33333333333333e+00 +294 294 5.00000000000000e+01 +294 137 -4.16666666666667e+00 +294 307 4.16666666666667e+00 +294 301 -4.16666666666667e+00 +294 35 4.16666666666667e+00 +294 308 -8.33333333333333e+00 +294 34 4.16666666666667e+00 +294 295 -8.33333333333333e+00 +294 136 8.33333333333333e+00 +294 33 -1.25000000000000e+01 +294 135 -1.25000000000000e+01 +294 296 -8.33333333333333e+00 +294 32 4.16666666666667e+00 +294 302 8.33333333333333e+00 +294 31 4.16666666666667e+00 +294 133 -8.33333333333333e+00 +294 134 4.16666666666667e+00 +294 30 -1.25000000000000e+01 +294 300 -1.25000000000000e+01 +295 295 5.83333333333333e+01 +295 137 8.33333333333333e+00 +295 302 8.33333333333333e+00 +295 306 4.16666666666667e+00 +295 300 -4.16666666666667e+00 +295 35 -4.16666666666667e+00 +295 308 4.16666666666667e+00 +295 34 -4.16666666666667e+00 +295 136 -3.75000000000000e+01 +295 33 4.16666666666667e+00 +295 294 -8.33333333333333e+00 +295 135 8.33333333333333e+00 +295 32 -4.16666666666667e+00 +295 134 4.16666666666667e+00 +295 296 -1.66666666666667e+01 +295 31 -4.16666666666667e+00 +295 301 -1.25000000000000e+01 +295 30 4.16666666666667e+00 +295 132 -8.33333333333333e+00 +296 296 5.83333333333333e+01 +296 135 -4.16666666666667e+00 +296 295 -1.66666666666667e+01 +296 136 8.33333333333333e+00 +296 301 8.33333333333333e+00 +296 35 -4.16666666666667e+00 +296 137 -1.25000000000000e+01 +296 34 -4.16666666666667e+00 +296 307 4.16666666666667e+00 +296 33 4.16666666666667e+00 +296 306 -8.33333333333333e+00 +296 132 4.16666666666667e+00 +296 32 -4.16666666666667e+00 +296 302 -3.75000000000000e+01 +296 31 -4.16666666666667e+00 +296 133 4.16666666666667e+00 +296 294 -8.33333333333333e+00 +296 30 4.16666666666667e+00 +296 300 8.33333333333333e+00 +297 297 1.25000000000000e+02 +297 298 -1.66666666666667e+01 +297 440 -8.33333333333333e+00 +297 85 -4.16666666666667e+00 +297 439 4.16666666666667e+00 +297 302 8.33333333333333e+00 +297 31 -4.16666666666667e+00 +297 300 -3.75000000000000e+01 +297 286 4.16666666666667e+00 +297 32 8.33333333333333e+00 +297 287 -8.33333333333333e+00 +297 299 -1.66666666666667e+01 +297 293 8.33333333333333e+00 +297 86 8.33333333333333e+00 +297 292 8.33333333333333e+00 +297 291 -3.75000000000000e+01 +297 115 -8.33333333333333e+00 +297 133 8.33333333333333e+00 +297 134 8.33333333333333e+00 +297 116 -8.33333333333333e+00 +297 30 -1.25000000000000e+01 +297 146 -8.33333333333333e+00 +297 128 8.33333333333333e+00 +297 145 1.66666666666667e+01 +297 127 -1.66666666666667e+01 +297 144 -2.50000000000000e+01 +297 301 8.33333333333333e+00 +297 84 -1.25000000000000e+01 +298 298 1.25000000000000e+02 +298 440 4.16666666666667e+00 +298 300 8.33333333333333e+00 +298 297 -1.66666666666667e+01 +298 84 -4.16666666666667e+00 +298 438 4.16666666666667e+00 +298 301 -1.25000000000000e+01 +298 30 -4.16666666666667e+00 +298 285 4.16666666666667e+00 +298 287 4.16666666666667e+00 +298 293 -4.16666666666667e+00 +298 292 -1.25000000000000e+01 +298 291 8.33333333333333e+00 +298 114 -8.33333333333333e+00 +298 132 8.33333333333333e+00 +298 116 -8.33333333333333e+00 +298 128 8.33333333333333e+00 +298 134 -1.66666666666667e+01 +298 32 8.33333333333333e+00 +298 31 -1.25000000000000e+01 +298 146 1.66666666666667e+01 +298 299 -1.66666666666667e+01 +298 86 8.33333333333333e+00 +298 145 -7.50000000000000e+01 +298 302 -4.16666666666667e+00 +298 85 -1.25000000000000e+01 +298 144 1.66666666666667e+01 +298 126 -1.66666666666667e+01 +299 299 1.25000000000000e+02 +299 439 4.16666666666667e+00 +299 438 -8.33333333333333e+00 +299 302 -1.25000000000000e+01 +299 300 8.33333333333333e+00 +299 286 4.16666666666667e+00 +299 30 8.33333333333333e+00 +299 285 -8.33333333333333e+00 +299 293 -1.25000000000000e+01 +299 292 -4.16666666666667e+00 +299 297 -1.66666666666667e+01 +299 291 8.33333333333333e+00 +299 84 8.33333333333333e+00 +299 115 -8.33333333333333e+00 +299 127 8.33333333333333e+00 +299 32 -3.75000000000000e+01 +299 133 -1.66666666666667e+01 +299 31 8.33333333333333e+00 +299 132 8.33333333333333e+00 +299 114 -8.33333333333333e+00 +299 146 -2.50000000000000e+01 +299 301 -4.16666666666667e+00 +299 86 -3.75000000000000e+01 +299 145 1.66666666666667e+01 +299 298 -1.66666666666667e+01 +299 85 8.33333333333333e+00 +299 144 -8.33333333333333e+00 +299 126 8.33333333333333e+00 +300 300 1.25000000000000e+02 +300 136 8.33333333333333e+00 +300 137 8.33333333333333e+00 +300 296 8.33333333333333e+00 +300 294 -1.25000000000000e+01 +300 308 8.33333333333333e+00 +300 307 8.33333333333333e+00 +300 301 -1.66666666666667e+01 +300 306 -3.75000000000000e+01 +300 149 -8.33333333333333e+00 +300 302 -1.66666666666667e+01 +300 134 -8.33333333333333e+00 +300 146 8.33333333333333e+00 +300 298 8.33333333333333e+00 +300 148 1.66666666666667e+01 +300 145 -1.66666666666667e+01 +300 299 8.33333333333333e+00 +300 32 -8.33333333333333e+00 +300 31 4.16666666666667e+00 +300 133 -8.33333333333333e+00 +300 297 -3.75000000000000e+01 +300 440 8.33333333333333e+00 +300 89 -8.33333333333333e+00 +300 439 -4.16666666666667e+00 +300 88 4.16666666666667e+00 +300 438 -1.25000000000000e+01 +300 295 -4.16666666666667e+00 +300 147 -2.50000000000000e+01 +301 301 1.25000000000000e+02 +301 294 -4.16666666666667e+00 +301 135 8.33333333333333e+00 +301 137 -1.66666666666667e+01 +301 32 4.16666666666667e+00 +301 295 -1.25000000000000e+01 +301 308 -4.16666666666667e+00 +301 89 4.16666666666667e+00 +301 307 -1.25000000000000e+01 +301 306 8.33333333333333e+00 +301 300 -1.66666666666667e+01 +301 299 -4.16666666666667e+00 +301 297 8.33333333333333e+00 +301 134 -8.33333333333333e+00 +301 146 8.33333333333333e+00 +301 147 1.66666666666667e+01 +301 144 -1.66666666666667e+01 +301 298 -1.25000000000000e+01 +301 30 4.16666666666667e+00 +301 132 -8.33333333333333e+00 +301 440 8.33333333333333e+00 +301 302 -1.66666666666667e+01 +301 149 1.66666666666667e+01 +301 439 -1.25000000000000e+01 +301 296 8.33333333333333e+00 +301 148 -7.50000000000000e+01 +301 438 -4.16666666666667e+00 +301 87 4.16666666666667e+00 +302 302 1.25000000000000e+02 +302 136 -1.66666666666667e+01 +302 135 8.33333333333333e+00 +302 296 -3.75000000000000e+01 +302 31 4.16666666666667e+00 +302 294 8.33333333333333e+00 +302 308 -1.25000000000000e+01 +302 307 -4.16666666666667e+00 +302 88 4.16666666666667e+00 +302 306 8.33333333333333e+00 +302 147 -8.33333333333333e+00 +302 298 -4.16666666666667e+00 +302 300 -1.66666666666667e+01 +302 132 -8.33333333333333e+00 +302 144 8.33333333333333e+00 +302 133 -8.33333333333333e+00 +302 145 8.33333333333333e+00 +302 299 -1.25000000000000e+01 +302 297 8.33333333333333e+00 +302 30 -8.33333333333333e+00 +302 440 -3.75000000000000e+01 +302 295 8.33333333333333e+00 +302 149 -2.50000000000000e+01 +302 439 8.33333333333333e+00 +302 301 -1.66666666666667e+01 +302 148 1.66666666666667e+01 +302 438 8.33333333333333e+00 +302 87 -8.33333333333333e+00 +303 303 5.00000000000000e+01 +303 158 -4.16666666666667e+00 +303 316 4.16666666666667e+00 +303 310 -4.16666666666667e+00 +303 38 4.16666666666667e+00 +303 317 -8.33333333333333e+00 +303 37 4.16666666666667e+00 +303 304 -8.33333333333333e+00 +303 157 8.33333333333333e+00 +303 36 -1.25000000000000e+01 +303 156 -1.25000000000000e+01 +303 305 -8.33333333333333e+00 +303 35 4.16666666666667e+00 +303 311 8.33333333333333e+00 +303 34 4.16666666666667e+00 +303 154 -8.33333333333333e+00 +303 155 4.16666666666667e+00 +303 33 -1.25000000000000e+01 +303 309 -1.25000000000000e+01 +304 304 5.83333333333333e+01 +304 158 8.33333333333333e+00 +304 311 8.33333333333333e+00 +304 315 4.16666666666667e+00 +304 309 -4.16666666666667e+00 +304 38 -4.16666666666667e+00 +304 317 4.16666666666667e+00 +304 37 -4.16666666666667e+00 +304 157 -3.75000000000000e+01 +304 36 4.16666666666667e+00 +304 303 -8.33333333333333e+00 +304 156 8.33333333333333e+00 +304 35 -4.16666666666667e+00 +304 155 4.16666666666667e+00 +304 305 -1.66666666666667e+01 +304 34 -4.16666666666667e+00 +304 310 -1.25000000000000e+01 +304 33 4.16666666666667e+00 +304 153 -8.33333333333333e+00 +305 305 5.83333333333333e+01 +305 156 -4.16666666666667e+00 +305 304 -1.66666666666667e+01 +305 157 8.33333333333333e+00 +305 310 8.33333333333333e+00 +305 38 -4.16666666666667e+00 +305 158 -1.25000000000000e+01 +305 37 -4.16666666666667e+00 +305 316 4.16666666666667e+00 +305 36 4.16666666666667e+00 +305 315 -8.33333333333333e+00 +305 153 4.16666666666667e+00 +305 35 -4.16666666666667e+00 +305 311 -3.75000000000000e+01 +305 34 -4.16666666666667e+00 +305 154 4.16666666666667e+00 +305 303 -8.33333333333333e+00 +305 33 4.16666666666667e+00 +305 309 8.33333333333333e+00 +306 306 1.25000000000000e+02 +306 307 -1.66666666666667e+01 +306 443 -8.33333333333333e+00 +306 88 -4.16666666666667e+00 +306 442 4.16666666666667e+00 +306 311 8.33333333333333e+00 +306 34 -4.16666666666667e+00 +306 309 -3.75000000000000e+01 +306 295 4.16666666666667e+00 +306 35 8.33333333333333e+00 +306 296 -8.33333333333333e+00 +306 308 -1.66666666666667e+01 +306 302 8.33333333333333e+00 +306 89 8.33333333333333e+00 +306 301 8.33333333333333e+00 +306 300 -3.75000000000000e+01 +306 136 -8.33333333333333e+00 +306 154 8.33333333333333e+00 +306 155 8.33333333333333e+00 +306 137 -8.33333333333333e+00 +306 33 -1.25000000000000e+01 +306 167 -8.33333333333333e+00 +306 149 8.33333333333333e+00 +306 166 1.66666666666667e+01 +306 148 -1.66666666666667e+01 +306 165 -2.50000000000000e+01 +306 310 8.33333333333333e+00 +306 87 -1.25000000000000e+01 +307 307 1.25000000000000e+02 +307 443 4.16666666666667e+00 +307 309 8.33333333333333e+00 +307 306 -1.66666666666667e+01 +307 87 -4.16666666666667e+00 +307 441 4.16666666666667e+00 +307 310 -1.25000000000000e+01 +307 33 -4.16666666666667e+00 +307 294 4.16666666666667e+00 +307 296 4.16666666666667e+00 +307 302 -4.16666666666667e+00 +307 301 -1.25000000000000e+01 +307 300 8.33333333333333e+00 +307 135 -8.33333333333333e+00 +307 153 8.33333333333333e+00 +307 137 -8.33333333333333e+00 +307 149 8.33333333333333e+00 +307 155 -1.66666666666667e+01 +307 35 8.33333333333333e+00 +307 34 -1.25000000000000e+01 +307 167 1.66666666666667e+01 +307 308 -1.66666666666667e+01 +307 89 8.33333333333333e+00 +307 166 -7.50000000000000e+01 +307 311 -4.16666666666667e+00 +307 88 -1.25000000000000e+01 +307 165 1.66666666666667e+01 +307 147 -1.66666666666667e+01 +308 308 1.25000000000000e+02 +308 442 4.16666666666667e+00 +308 441 -8.33333333333333e+00 +308 311 -1.25000000000000e+01 +308 309 8.33333333333333e+00 +308 295 4.16666666666667e+00 +308 33 8.33333333333333e+00 +308 294 -8.33333333333333e+00 +308 302 -1.25000000000000e+01 +308 301 -4.16666666666667e+00 +308 306 -1.66666666666667e+01 +308 300 8.33333333333333e+00 +308 87 8.33333333333333e+00 +308 136 -8.33333333333333e+00 +308 148 8.33333333333333e+00 +308 35 -3.75000000000000e+01 +308 154 -1.66666666666667e+01 +308 34 8.33333333333333e+00 +308 153 8.33333333333333e+00 +308 135 -8.33333333333333e+00 +308 167 -2.50000000000000e+01 +308 310 -4.16666666666667e+00 +308 89 -3.75000000000000e+01 +308 166 1.66666666666667e+01 +308 307 -1.66666666666667e+01 +308 88 8.33333333333333e+00 +308 165 -8.33333333333333e+00 +308 147 8.33333333333333e+00 +309 309 1.25000000000000e+02 +309 157 8.33333333333333e+00 +309 158 8.33333333333333e+00 +309 305 8.33333333333333e+00 +309 303 -1.25000000000000e+01 +309 317 8.33333333333333e+00 +309 316 8.33333333333333e+00 +309 310 -1.66666666666667e+01 +309 315 -3.75000000000000e+01 +309 170 -8.33333333333333e+00 +309 311 -1.66666666666667e+01 +309 155 -8.33333333333333e+00 +309 167 8.33333333333333e+00 +309 307 8.33333333333333e+00 +309 169 1.66666666666667e+01 +309 166 -1.66666666666667e+01 +309 308 8.33333333333333e+00 +309 35 -8.33333333333333e+00 +309 34 4.16666666666667e+00 +309 154 -8.33333333333333e+00 +309 306 -3.75000000000000e+01 +309 443 8.33333333333333e+00 +309 92 -8.33333333333333e+00 +309 442 -4.16666666666667e+00 +309 91 4.16666666666667e+00 +309 441 -1.25000000000000e+01 +309 304 -4.16666666666667e+00 +309 168 -2.50000000000000e+01 +310 310 1.25000000000000e+02 +310 303 -4.16666666666667e+00 +310 156 8.33333333333333e+00 +310 158 -1.66666666666667e+01 +310 35 4.16666666666667e+00 +310 304 -1.25000000000000e+01 +310 317 -4.16666666666667e+00 +310 92 4.16666666666667e+00 +310 316 -1.25000000000000e+01 +310 315 8.33333333333333e+00 +310 309 -1.66666666666667e+01 +310 308 -4.16666666666667e+00 +310 306 8.33333333333333e+00 +310 155 -8.33333333333333e+00 +310 167 8.33333333333333e+00 +310 168 1.66666666666667e+01 +310 165 -1.66666666666667e+01 +310 307 -1.25000000000000e+01 +310 33 4.16666666666667e+00 +310 153 -8.33333333333333e+00 +310 443 8.33333333333333e+00 +310 311 -1.66666666666667e+01 +310 170 1.66666666666667e+01 +310 442 -1.25000000000000e+01 +310 305 8.33333333333333e+00 +310 169 -7.50000000000000e+01 +310 441 -4.16666666666667e+00 +310 90 4.16666666666667e+00 +311 311 1.25000000000000e+02 +311 157 -1.66666666666667e+01 +311 156 8.33333333333333e+00 +311 305 -3.75000000000000e+01 +311 34 4.16666666666667e+00 +311 303 8.33333333333333e+00 +311 317 -1.25000000000000e+01 +311 316 -4.16666666666667e+00 +311 91 4.16666666666667e+00 +311 315 8.33333333333333e+00 +311 168 -8.33333333333333e+00 +311 307 -4.16666666666667e+00 +311 309 -1.66666666666667e+01 +311 153 -8.33333333333333e+00 +311 165 8.33333333333333e+00 +311 154 -8.33333333333333e+00 +311 166 8.33333333333333e+00 +311 308 -1.25000000000000e+01 +311 306 8.33333333333333e+00 +311 33 -8.33333333333333e+00 +311 443 -3.75000000000000e+01 +311 304 8.33333333333333e+00 +311 170 -2.50000000000000e+01 +311 442 8.33333333333333e+00 +311 310 -1.66666666666667e+01 +311 169 1.66666666666667e+01 +311 441 8.33333333333333e+00 +311 90 -8.33333333333333e+00 +312 312 5.00000000000000e+01 +312 179 -4.16666666666667e+00 +312 325 4.16666666666667e+00 +312 319 -4.16666666666667e+00 +312 41 4.16666666666667e+00 +312 326 -8.33333333333333e+00 +312 40 4.16666666666667e+00 +312 313 -8.33333333333333e+00 +312 178 8.33333333333333e+00 +312 39 -1.25000000000000e+01 +312 177 -1.25000000000000e+01 +312 314 -8.33333333333333e+00 +312 38 4.16666666666667e+00 +312 320 8.33333333333333e+00 +312 37 4.16666666666667e+00 +312 175 -8.33333333333333e+00 +312 176 4.16666666666667e+00 +312 36 -1.25000000000000e+01 +312 318 -1.25000000000000e+01 +313 313 5.83333333333333e+01 +313 179 8.33333333333333e+00 +313 320 8.33333333333333e+00 +313 324 4.16666666666667e+00 +313 318 -4.16666666666667e+00 +313 41 -4.16666666666667e+00 +313 326 4.16666666666667e+00 +313 40 -4.16666666666667e+00 +313 178 -3.75000000000000e+01 +313 39 4.16666666666667e+00 +313 312 -8.33333333333333e+00 +313 177 8.33333333333333e+00 +313 38 -4.16666666666667e+00 +313 176 4.16666666666667e+00 +313 314 -1.66666666666667e+01 +313 37 -4.16666666666667e+00 +313 319 -1.25000000000000e+01 +313 36 4.16666666666667e+00 +313 174 -8.33333333333333e+00 +314 314 5.83333333333333e+01 +314 177 -4.16666666666667e+00 +314 313 -1.66666666666667e+01 +314 178 8.33333333333333e+00 +314 319 8.33333333333333e+00 +314 41 -4.16666666666667e+00 +314 179 -1.25000000000000e+01 +314 40 -4.16666666666667e+00 +314 325 4.16666666666667e+00 +314 39 4.16666666666667e+00 +314 324 -8.33333333333333e+00 +314 174 4.16666666666667e+00 +314 38 -4.16666666666667e+00 +314 320 -3.75000000000000e+01 +314 37 -4.16666666666667e+00 +314 175 4.16666666666667e+00 +314 312 -8.33333333333333e+00 +314 36 4.16666666666667e+00 +314 318 8.33333333333333e+00 +315 315 1.25000000000000e+02 +315 316 -1.66666666666667e+01 +315 446 -8.33333333333333e+00 +315 91 -4.16666666666667e+00 +315 445 4.16666666666667e+00 +315 320 8.33333333333333e+00 +315 37 -4.16666666666667e+00 +315 318 -3.75000000000000e+01 +315 304 4.16666666666667e+00 +315 38 8.33333333333333e+00 +315 305 -8.33333333333333e+00 +315 317 -1.66666666666667e+01 +315 311 8.33333333333333e+00 +315 92 8.33333333333333e+00 +315 310 8.33333333333333e+00 +315 309 -3.75000000000000e+01 +315 157 -8.33333333333333e+00 +315 175 8.33333333333333e+00 +315 176 8.33333333333333e+00 +315 158 -8.33333333333333e+00 +315 36 -1.25000000000000e+01 +315 188 -8.33333333333333e+00 +315 170 8.33333333333333e+00 +315 187 1.66666666666667e+01 +315 169 -1.66666666666667e+01 +315 186 -2.50000000000000e+01 +315 319 8.33333333333333e+00 +315 90 -1.25000000000000e+01 +316 316 1.25000000000000e+02 +316 446 4.16666666666667e+00 +316 318 8.33333333333333e+00 +316 315 -1.66666666666667e+01 +316 90 -4.16666666666667e+00 +316 444 4.16666666666667e+00 +316 319 -1.25000000000000e+01 +316 36 -4.16666666666667e+00 +316 303 4.16666666666667e+00 +316 305 4.16666666666667e+00 +316 311 -4.16666666666667e+00 +316 310 -1.25000000000000e+01 +316 309 8.33333333333333e+00 +316 156 -8.33333333333333e+00 +316 174 8.33333333333333e+00 +316 158 -8.33333333333333e+00 +316 170 8.33333333333333e+00 +316 176 -1.66666666666667e+01 +316 38 8.33333333333333e+00 +316 37 -1.25000000000000e+01 +316 188 1.66666666666667e+01 +316 317 -1.66666666666667e+01 +316 92 8.33333333333333e+00 +316 187 -7.50000000000000e+01 +316 320 -4.16666666666667e+00 +316 91 -1.25000000000000e+01 +316 186 1.66666666666667e+01 +316 168 -1.66666666666667e+01 +317 317 1.25000000000000e+02 +317 445 4.16666666666667e+00 +317 444 -8.33333333333333e+00 +317 320 -1.25000000000000e+01 +317 318 8.33333333333333e+00 +317 304 4.16666666666667e+00 +317 36 8.33333333333333e+00 +317 303 -8.33333333333333e+00 +317 311 -1.25000000000000e+01 +317 310 -4.16666666666667e+00 +317 315 -1.66666666666667e+01 +317 309 8.33333333333333e+00 +317 90 8.33333333333333e+00 +317 157 -8.33333333333333e+00 +317 169 8.33333333333333e+00 +317 38 -3.75000000000000e+01 +317 175 -1.66666666666667e+01 +317 37 8.33333333333333e+00 +317 174 8.33333333333333e+00 +317 156 -8.33333333333333e+00 +317 188 -2.50000000000000e+01 +317 319 -4.16666666666667e+00 +317 92 -3.75000000000000e+01 +317 187 1.66666666666667e+01 +317 316 -1.66666666666667e+01 +317 91 8.33333333333333e+00 +317 186 -8.33333333333333e+00 +317 168 8.33333333333333e+00 +318 318 1.25000000000000e+02 +318 178 8.33333333333333e+00 +318 179 8.33333333333333e+00 +318 314 8.33333333333333e+00 +318 312 -1.25000000000000e+01 +318 326 8.33333333333333e+00 +318 325 8.33333333333333e+00 +318 319 -1.66666666666667e+01 +318 324 -3.75000000000000e+01 +318 191 -8.33333333333333e+00 +318 320 -1.66666666666667e+01 +318 176 -8.33333333333333e+00 +318 188 8.33333333333333e+00 +318 316 8.33333333333333e+00 +318 190 1.66666666666667e+01 +318 187 -1.66666666666667e+01 +318 317 8.33333333333333e+00 +318 38 -8.33333333333333e+00 +318 37 4.16666666666667e+00 +318 175 -8.33333333333333e+00 +318 315 -3.75000000000000e+01 +318 446 8.33333333333333e+00 +318 95 -8.33333333333333e+00 +318 445 -4.16666666666667e+00 +318 94 4.16666666666667e+00 +318 444 -1.25000000000000e+01 +318 313 -4.16666666666667e+00 +318 189 -2.50000000000000e+01 +319 319 1.25000000000000e+02 +319 312 -4.16666666666667e+00 +319 177 8.33333333333333e+00 +319 179 -1.66666666666667e+01 +319 38 4.16666666666667e+00 +319 313 -1.25000000000000e+01 +319 326 -4.16666666666667e+00 +319 95 4.16666666666667e+00 +319 325 -1.25000000000000e+01 +319 324 8.33333333333333e+00 +319 318 -1.66666666666667e+01 +319 317 -4.16666666666667e+00 +319 315 8.33333333333333e+00 +319 176 -8.33333333333333e+00 +319 188 8.33333333333333e+00 +319 189 1.66666666666667e+01 +319 186 -1.66666666666667e+01 +319 316 -1.25000000000000e+01 +319 36 4.16666666666667e+00 +319 174 -8.33333333333333e+00 +319 446 8.33333333333333e+00 +319 320 -1.66666666666667e+01 +319 191 1.66666666666667e+01 +319 445 -1.25000000000000e+01 +319 314 8.33333333333333e+00 +319 190 -7.50000000000000e+01 +319 444 -4.16666666666667e+00 +319 93 4.16666666666667e+00 +320 320 1.25000000000000e+02 +320 178 -1.66666666666667e+01 +320 177 8.33333333333333e+00 +320 314 -3.75000000000000e+01 +320 37 4.16666666666667e+00 +320 312 8.33333333333333e+00 +320 326 -1.25000000000000e+01 +320 325 -4.16666666666667e+00 +320 94 4.16666666666667e+00 +320 324 8.33333333333333e+00 +320 189 -8.33333333333333e+00 +320 316 -4.16666666666667e+00 +320 318 -1.66666666666667e+01 +320 174 -8.33333333333333e+00 +320 186 8.33333333333333e+00 +320 175 -8.33333333333333e+00 +320 187 8.33333333333333e+00 +320 317 -1.25000000000000e+01 +320 315 8.33333333333333e+00 +320 36 -8.33333333333333e+00 +320 446 -3.75000000000000e+01 +320 313 8.33333333333333e+00 +320 191 -2.50000000000000e+01 +320 445 8.33333333333333e+00 +320 319 -1.66666666666667e+01 +320 190 1.66666666666667e+01 +320 444 8.33333333333333e+00 +320 93 -8.33333333333333e+00 +321 321 1.00000000000000e+00 +321 200 -8.33333333333333e-02 +321 334 8.33333333333333e-02 +321 328 -8.33333333333333e-02 +321 44 8.33333333333333e-02 +321 335 -1.66666666666667e-01 +321 43 8.33333333333333e-02 +321 322 -1.66666666666667e-01 +321 199 1.66666666666667e-01 +321 42 -2.50000000000000e-01 +321 198 -2.50000000000000e-01 +321 323 -1.66666666666667e-01 +321 41 8.33333333333333e-02 +321 329 1.66666666666667e-01 +321 40 8.33333333333333e-02 +321 196 -1.66666666666667e-01 +321 197 8.33333333333333e-02 +321 39 -2.50000000000000e-01 +321 327 -2.50000000000000e-01 +322 322 1.16666666666667e+00 +322 200 1.66666666666667e-01 +322 329 1.66666666666667e-01 +322 333 8.33333333333333e-02 +322 327 -8.33333333333333e-02 +322 44 -8.33333333333333e-02 +322 335 8.33333333333333e-02 +322 43 -8.33333333333333e-02 +322 199 -7.50000000000000e-01 +322 42 8.33333333333333e-02 +322 321 -1.66666666666667e-01 +322 198 1.66666666666667e-01 +322 41 -8.33333333333333e-02 +322 197 8.33333333333333e-02 +322 323 -3.33333333333333e-01 +322 40 -8.33333333333333e-02 +322 328 -2.50000000000000e-01 +322 39 8.33333333333333e-02 +322 195 -1.66666666666667e-01 +323 323 1.16666666666667e+00 +323 198 -8.33333333333333e-02 +323 322 -3.33333333333333e-01 +323 199 1.66666666666667e-01 +323 328 1.66666666666667e-01 +323 44 -8.33333333333333e-02 +323 200 -2.50000000000000e-01 +323 43 -8.33333333333333e-02 +323 334 8.33333333333333e-02 +323 42 8.33333333333333e-02 +323 333 -1.66666666666667e-01 +323 195 8.33333333333333e-02 +323 41 -8.33333333333333e-02 +323 329 -7.50000000000000e-01 +323 40 -8.33333333333333e-02 +323 196 8.33333333333333e-02 +323 321 -1.66666666666667e-01 +323 39 8.33333333333333e-02 +323 327 1.66666666666667e-01 +324 324 6.78333333333333e+01 +324 325 -3.33333333333333e-01 +324 449 -1.66666666666667e-01 +324 94 -8.33333333333333e-02 +324 448 8.33333333333333e-02 +324 329 1.66666666666667e-01 +324 40 -8.33333333333333e-02 +324 327 -7.50000000000000e-01 +324 313 4.16666666666667e+00 +324 41 4.25000000000000e+00 +324 314 -8.33333333333333e+00 +324 326 -8.50000000000000e+00 +324 320 8.33333333333333e+00 +324 95 4.25000000000000e+00 +324 319 8.33333333333333e+00 +324 318 -3.75000000000000e+01 +324 178 -8.33333333333333e+00 +324 196 4.25000000000000e+00 +324 197 4.25000000000000e+00 +324 179 -8.33333333333333e+00 +324 39 -8.41666666666667e+00 +324 209 -4.25000000000000e+00 +324 191 8.33333333333333e+00 +324 208 8.50000000000000e+00 +324 190 -1.66666666666667e+01 +324 207 -1.27500000000000e+01 +324 328 1.66666666666667e-01 +324 93 -8.41666666666667e+00 +325 325 6.78333333333333e+01 +325 449 8.33333333333333e-02 +325 327 1.66666666666667e-01 +325 324 -3.33333333333333e-01 +325 93 -8.33333333333333e-02 +325 447 8.33333333333333e-02 +325 328 -2.50000000000000e-01 +325 39 -8.33333333333333e-02 +325 312 4.16666666666667e+00 +325 314 4.16666666666667e+00 +325 320 -4.16666666666667e+00 +325 319 -1.25000000000000e+01 +325 318 8.33333333333333e+00 +325 177 -8.33333333333333e+00 +325 195 4.25000000000000e+00 +325 179 -8.33333333333333e+00 +325 191 8.33333333333333e+00 +325 197 -8.50000000000000e+00 +325 41 4.25000000000000e+00 +325 40 -8.41666666666667e+00 +325 209 8.50000000000000e+00 +325 326 -8.50000000000000e+00 +325 95 4.25000000000000e+00 +325 208 -3.82500000000000e+01 +325 329 -8.33333333333333e-02 +325 94 -8.41666666666667e+00 +325 207 8.50000000000000e+00 +325 189 -1.66666666666667e+01 +326 326 7.60000000000000e+01 +326 448 8.33333333333333e-02 +326 447 -1.66666666666667e-01 +326 329 -2.50000000000000e-01 +326 327 1.66666666666667e-01 +326 313 4.16666666666667e+00 +326 39 4.25000000000000e+00 +326 312 -8.33333333333333e+00 +326 320 -1.25000000000000e+01 +326 319 -4.16666666666667e+00 +326 324 -8.50000000000000e+00 +326 318 8.33333333333333e+00 +326 93 4.25000000000000e+00 +326 178 -8.33333333333333e+00 +326 190 8.33333333333333e+00 +326 41 -2.52500000000000e+01 +326 196 -8.50000000000000e+00 +326 40 4.25000000000000e+00 +326 195 4.25000000000000e+00 +326 177 -8.33333333333333e+00 +326 209 -1.27500000000000e+01 +326 328 -8.33333333333333e-02 +326 95 -2.52500000000000e+01 +326 208 8.50000000000000e+00 +326 325 -8.50000000000000e+00 +326 94 4.25000000000000e+00 +326 207 -4.25000000000000e+00 +326 189 8.33333333333333e+00 +327 327 2.50000000000000e+00 +327 199 1.66666666666667e-01 +327 200 1.66666666666667e-01 +327 323 1.66666666666667e-01 +327 321 -2.50000000000000e-01 +327 335 1.66666666666667e-01 +327 334 1.66666666666667e-01 +327 328 -3.33333333333333e-01 +327 333 -7.50000000000000e-01 +327 212 -1.66666666666667e-01 +327 329 -3.33333333333333e-01 +327 197 -1.66666666666667e-01 +327 209 1.66666666666667e-01 +327 325 1.66666666666667e-01 +327 211 3.33333333333333e-01 +327 208 -3.33333333333333e-01 +327 326 1.66666666666667e-01 +327 41 -1.66666666666667e-01 +327 40 8.33333333333333e-02 +327 196 -1.66666666666667e-01 +327 324 -7.50000000000000e-01 +327 449 1.66666666666667e-01 +327 98 -1.66666666666667e-01 +327 448 -8.33333333333333e-02 +327 97 8.33333333333333e-02 +327 447 -2.50000000000000e-01 +327 322 -8.33333333333333e-02 +327 210 -5.00000000000000e-01 +328 328 2.50000000000000e+00 +328 321 -8.33333333333333e-02 +328 198 1.66666666666667e-01 +328 200 -3.33333333333333e-01 +328 41 8.33333333333333e-02 +328 322 -2.50000000000000e-01 +328 335 -8.33333333333333e-02 +328 98 8.33333333333333e-02 +328 334 -2.50000000000000e-01 +328 333 1.66666666666667e-01 +328 327 -3.33333333333333e-01 +328 326 -8.33333333333333e-02 +328 324 1.66666666666667e-01 +328 197 -1.66666666666667e-01 +328 209 1.66666666666667e-01 +328 210 3.33333333333333e-01 +328 207 -3.33333333333333e-01 +328 325 -2.50000000000000e-01 +328 39 8.33333333333333e-02 +328 195 -1.66666666666667e-01 +328 449 1.66666666666667e-01 +328 329 -3.33333333333333e-01 +328 212 3.33333333333333e-01 +328 448 -2.50000000000000e-01 +328 323 1.66666666666667e-01 +328 211 -1.50000000000000e+00 +328 447 -8.33333333333333e-02 +328 96 8.33333333333333e-02 +329 329 2.50000000000000e+00 +329 199 -3.33333333333333e-01 +329 198 1.66666666666667e-01 +329 323 -7.50000000000000e-01 +329 40 8.33333333333333e-02 +329 321 1.66666666666667e-01 +329 335 -2.50000000000000e-01 +329 334 -8.33333333333333e-02 +329 97 8.33333333333333e-02 +329 333 1.66666666666667e-01 +329 210 -1.66666666666667e-01 +329 325 -8.33333333333333e-02 +329 327 -3.33333333333333e-01 +329 195 -1.66666666666667e-01 +329 207 1.66666666666667e-01 +329 196 -1.66666666666667e-01 +329 208 1.66666666666667e-01 +329 326 -2.50000000000000e-01 +329 324 1.66666666666667e-01 +329 39 -1.66666666666667e-01 +329 449 -7.50000000000000e-01 +329 322 1.66666666666667e-01 +329 212 -5.00000000000000e-01 +329 448 1.66666666666667e-01 +329 328 -3.33333333333333e-01 +329 211 3.33333333333333e-01 +329 447 1.66666666666667e-01 +329 96 -1.66666666666667e-01 +330 330 1.00000000000000e+00 +330 221 -8.33333333333333e-02 +330 343 8.33333333333333e-02 +330 337 -8.33333333333333e-02 +330 47 8.33333333333333e-02 +330 344 -1.66666666666667e-01 +330 46 8.33333333333333e-02 +330 331 -1.66666666666667e-01 +330 220 1.66666666666667e-01 +330 45 -2.50000000000000e-01 +330 219 -2.50000000000000e-01 +330 332 -1.66666666666667e-01 +330 44 8.33333333333333e-02 +330 338 1.66666666666667e-01 +330 43 8.33333333333333e-02 +330 217 -1.66666666666667e-01 +330 218 8.33333333333333e-02 +330 42 -2.50000000000000e-01 +330 336 -2.50000000000000e-01 +331 331 1.16666666666667e+00 +331 221 1.66666666666667e-01 +331 338 1.66666666666667e-01 +331 342 8.33333333333333e-02 +331 336 -8.33333333333333e-02 +331 47 -8.33333333333333e-02 +331 344 8.33333333333333e-02 +331 46 -8.33333333333333e-02 +331 220 -7.50000000000000e-01 +331 45 8.33333333333333e-02 +331 330 -1.66666666666667e-01 +331 219 1.66666666666667e-01 +331 44 -8.33333333333333e-02 +331 218 8.33333333333333e-02 +331 332 -3.33333333333333e-01 +331 43 -8.33333333333333e-02 +331 337 -2.50000000000000e-01 +331 42 8.33333333333333e-02 +331 216 -1.66666666666667e-01 +332 332 1.16666666666667e+00 +332 219 -8.33333333333333e-02 +332 331 -3.33333333333333e-01 +332 220 1.66666666666667e-01 +332 337 1.66666666666667e-01 +332 47 -8.33333333333333e-02 +332 221 -2.50000000000000e-01 +332 46 -8.33333333333333e-02 +332 343 8.33333333333333e-02 +332 45 8.33333333333333e-02 +332 342 -1.66666666666667e-01 +332 216 8.33333333333333e-02 +332 44 -8.33333333333333e-02 +332 338 -7.50000000000000e-01 +332 43 -8.33333333333333e-02 +332 217 8.33333333333333e-02 +332 330 -1.66666666666667e-01 +332 42 8.33333333333333e-02 +332 336 1.66666666666667e-01 +333 333 2.50000000000000e+00 +333 334 -3.33333333333333e-01 +333 452 -1.66666666666667e-01 +333 97 -8.33333333333333e-02 +333 451 8.33333333333333e-02 +333 338 1.66666666666667e-01 +333 43 -8.33333333333333e-02 +333 336 -7.50000000000000e-01 +333 322 8.33333333333333e-02 +333 44 1.66666666666667e-01 +333 323 -1.66666666666667e-01 +333 335 -3.33333333333333e-01 +333 329 1.66666666666667e-01 +333 98 1.66666666666667e-01 +333 328 1.66666666666667e-01 +333 327 -7.50000000000000e-01 +333 199 -1.66666666666667e-01 +333 217 1.66666666666667e-01 +333 218 1.66666666666667e-01 +333 200 -1.66666666666667e-01 +333 42 -2.50000000000000e-01 +333 230 -1.66666666666667e-01 +333 212 1.66666666666667e-01 +333 229 3.33333333333333e-01 +333 211 -3.33333333333333e-01 +333 228 -5.00000000000000e-01 +333 337 1.66666666666667e-01 +333 96 -2.50000000000000e-01 +334 334 2.50000000000000e+00 +334 452 8.33333333333333e-02 +334 336 1.66666666666667e-01 +334 333 -3.33333333333333e-01 +334 96 -8.33333333333333e-02 +334 450 8.33333333333333e-02 +334 337 -2.50000000000000e-01 +334 42 -8.33333333333333e-02 +334 321 8.33333333333333e-02 +334 323 8.33333333333333e-02 +334 329 -8.33333333333333e-02 +334 328 -2.50000000000000e-01 +334 327 1.66666666666667e-01 +334 198 -1.66666666666667e-01 +334 216 1.66666666666667e-01 +334 200 -1.66666666666667e-01 +334 212 1.66666666666667e-01 +334 218 -3.33333333333333e-01 +334 44 1.66666666666667e-01 +334 43 -2.50000000000000e-01 +334 230 3.33333333333333e-01 +334 335 -3.33333333333333e-01 +334 98 1.66666666666667e-01 +334 229 -1.50000000000000e+00 +334 338 -8.33333333333333e-02 +334 97 -2.50000000000000e-01 +334 228 3.33333333333333e-01 +334 210 -3.33333333333333e-01 +335 335 2.50000000000000e+00 +335 451 8.33333333333333e-02 +335 450 -1.66666666666667e-01 +335 338 -2.50000000000000e-01 +335 336 1.66666666666667e-01 +335 322 8.33333333333333e-02 +335 42 1.66666666666667e-01 +335 321 -1.66666666666667e-01 +335 329 -2.50000000000000e-01 +335 328 -8.33333333333333e-02 +335 333 -3.33333333333333e-01 +335 327 1.66666666666667e-01 +335 96 1.66666666666667e-01 +335 199 -1.66666666666667e-01 +335 211 1.66666666666667e-01 +335 44 -7.50000000000000e-01 +335 217 -3.33333333333333e-01 +335 43 1.66666666666667e-01 +335 216 1.66666666666667e-01 +335 198 -1.66666666666667e-01 +335 230 -5.00000000000000e-01 +335 337 -8.33333333333333e-02 +335 98 -7.50000000000000e-01 +335 229 3.33333333333333e-01 +335 334 -3.33333333333333e-01 +335 97 1.66666666666667e-01 +335 228 -1.66666666666667e-01 +335 210 1.66666666666667e-01 +336 336 2.50000000000000e+00 +336 220 1.66666666666667e-01 +336 221 1.66666666666667e-01 +336 332 1.66666666666667e-01 +336 330 -2.50000000000000e-01 +336 344 1.66666666666667e-01 +336 343 1.66666666666667e-01 +336 337 -3.33333333333333e-01 +336 342 -7.50000000000000e-01 +336 233 -1.66666666666667e-01 +336 338 -3.33333333333333e-01 +336 218 -1.66666666666667e-01 +336 230 1.66666666666667e-01 +336 334 1.66666666666667e-01 +336 232 3.33333333333333e-01 +336 229 -3.33333333333333e-01 +336 335 1.66666666666667e-01 +336 44 -1.66666666666667e-01 +336 43 8.33333333333333e-02 +336 217 -1.66666666666667e-01 +336 333 -7.50000000000000e-01 +336 452 1.66666666666667e-01 +336 101 -1.66666666666667e-01 +336 451 -8.33333333333333e-02 +336 100 8.33333333333333e-02 +336 450 -2.50000000000000e-01 +336 331 -8.33333333333333e-02 +336 231 -5.00000000000000e-01 +337 337 2.50000000000000e+00 +337 330 -8.33333333333333e-02 +337 219 1.66666666666667e-01 +337 221 -3.33333333333333e-01 +337 44 8.33333333333333e-02 +337 331 -2.50000000000000e-01 +337 344 -8.33333333333333e-02 +337 101 8.33333333333333e-02 +337 343 -2.50000000000000e-01 +337 342 1.66666666666667e-01 +337 336 -3.33333333333333e-01 +337 335 -8.33333333333333e-02 +337 333 1.66666666666667e-01 +337 218 -1.66666666666667e-01 +337 230 1.66666666666667e-01 +337 231 3.33333333333333e-01 +337 228 -3.33333333333333e-01 +337 334 -2.50000000000000e-01 +337 42 8.33333333333333e-02 +337 216 -1.66666666666667e-01 +337 452 1.66666666666667e-01 +337 338 -3.33333333333333e-01 +337 233 3.33333333333333e-01 +337 451 -2.50000000000000e-01 +337 332 1.66666666666667e-01 +337 232 -1.50000000000000e+00 +337 450 -8.33333333333333e-02 +337 99 8.33333333333333e-02 +338 338 2.50000000000000e+00 +338 220 -3.33333333333333e-01 +338 219 1.66666666666667e-01 +338 332 -7.50000000000000e-01 +338 43 8.33333333333333e-02 +338 330 1.66666666666667e-01 +338 344 -2.50000000000000e-01 +338 343 -8.33333333333333e-02 +338 100 8.33333333333333e-02 +338 342 1.66666666666667e-01 +338 231 -1.66666666666667e-01 +338 334 -8.33333333333333e-02 +338 336 -3.33333333333333e-01 +338 216 -1.66666666666667e-01 +338 228 1.66666666666667e-01 +338 217 -1.66666666666667e-01 +338 229 1.66666666666667e-01 +338 335 -2.50000000000000e-01 +338 333 1.66666666666667e-01 +338 42 -1.66666666666667e-01 +338 452 -7.50000000000000e-01 +338 331 1.66666666666667e-01 +338 233 -5.00000000000000e-01 +338 451 1.66666666666667e-01 +338 337 -3.33333333333333e-01 +338 232 3.33333333333333e-01 +338 450 1.66666666666667e-01 +338 99 -1.66666666666667e-01 +339 339 1.00000000000000e+00 +339 242 -8.33333333333333e-02 +339 352 8.33333333333333e-02 +339 346 -8.33333333333333e-02 +339 50 8.33333333333333e-02 +339 353 -1.66666666666667e-01 +339 49 8.33333333333333e-02 +339 340 -1.66666666666667e-01 +339 241 1.66666666666667e-01 +339 48 -2.50000000000000e-01 +339 240 -2.50000000000000e-01 +339 341 -1.66666666666667e-01 +339 47 8.33333333333333e-02 +339 347 1.66666666666667e-01 +339 46 8.33333333333333e-02 +339 238 -1.66666666666667e-01 +339 239 8.33333333333333e-02 +339 45 -2.50000000000000e-01 +339 345 -2.50000000000000e-01 +340 340 1.16666666666667e+00 +340 242 1.66666666666667e-01 +340 347 1.66666666666667e-01 +340 351 8.33333333333333e-02 +340 345 -8.33333333333333e-02 +340 50 -8.33333333333333e-02 +340 353 8.33333333333333e-02 +340 49 -8.33333333333333e-02 +340 241 -7.50000000000000e-01 +340 48 8.33333333333333e-02 +340 339 -1.66666666666667e-01 +340 240 1.66666666666667e-01 +340 47 -8.33333333333333e-02 +340 239 8.33333333333333e-02 +340 341 -3.33333333333333e-01 +340 46 -8.33333333333333e-02 +340 346 -2.50000000000000e-01 +340 45 8.33333333333333e-02 +340 237 -1.66666666666667e-01 +341 341 1.16666666666667e+00 +341 240 -8.33333333333333e-02 +341 340 -3.33333333333333e-01 +341 241 1.66666666666667e-01 +341 346 1.66666666666667e-01 +341 50 -8.33333333333333e-02 +341 242 -2.50000000000000e-01 +341 49 -8.33333333333333e-02 +341 352 8.33333333333333e-02 +341 48 8.33333333333333e-02 +341 351 -1.66666666666667e-01 +341 237 8.33333333333333e-02 +341 47 -8.33333333333333e-02 +341 347 -7.50000000000000e-01 +341 46 -8.33333333333333e-02 +341 238 8.33333333333333e-02 +341 339 -1.66666666666667e-01 +341 45 8.33333333333333e-02 +341 345 1.66666666666667e-01 +342 342 2.50000000000000e+00 +342 343 -3.33333333333333e-01 +342 455 -1.66666666666667e-01 +342 100 -8.33333333333333e-02 +342 454 8.33333333333333e-02 +342 347 1.66666666666667e-01 +342 46 -8.33333333333333e-02 +342 345 -7.50000000000000e-01 +342 331 8.33333333333333e-02 +342 47 1.66666666666667e-01 +342 332 -1.66666666666667e-01 +342 344 -3.33333333333333e-01 +342 338 1.66666666666667e-01 +342 101 1.66666666666667e-01 +342 337 1.66666666666667e-01 +342 336 -7.50000000000000e-01 +342 220 -1.66666666666667e-01 +342 238 1.66666666666667e-01 +342 239 1.66666666666667e-01 +342 221 -1.66666666666667e-01 +342 45 -2.50000000000000e-01 +342 251 -1.66666666666667e-01 +342 233 1.66666666666667e-01 +342 250 3.33333333333333e-01 +342 232 -3.33333333333333e-01 +342 249 -5.00000000000000e-01 +342 346 1.66666666666667e-01 +342 99 -2.50000000000000e-01 +343 343 2.50000000000000e+00 +343 455 8.33333333333333e-02 +343 345 1.66666666666667e-01 +343 342 -3.33333333333333e-01 +343 99 -8.33333333333333e-02 +343 453 8.33333333333333e-02 +343 346 -2.50000000000000e-01 +343 45 -8.33333333333333e-02 +343 330 8.33333333333333e-02 +343 332 8.33333333333333e-02 +343 338 -8.33333333333333e-02 +343 337 -2.50000000000000e-01 +343 336 1.66666666666667e-01 +343 219 -1.66666666666667e-01 +343 237 1.66666666666667e-01 +343 221 -1.66666666666667e-01 +343 233 1.66666666666667e-01 +343 239 -3.33333333333333e-01 +343 47 1.66666666666667e-01 +343 46 -2.50000000000000e-01 +343 251 3.33333333333333e-01 +343 344 -3.33333333333333e-01 +343 101 1.66666666666667e-01 +343 250 -1.50000000000000e+00 +343 347 -8.33333333333333e-02 +343 100 -2.50000000000000e-01 +343 249 3.33333333333333e-01 +343 231 -3.33333333333333e-01 +344 344 2.50000000000000e+00 +344 454 8.33333333333333e-02 +344 453 -1.66666666666667e-01 +344 347 -2.50000000000000e-01 +344 345 1.66666666666667e-01 +344 331 8.33333333333333e-02 +344 45 1.66666666666667e-01 +344 330 -1.66666666666667e-01 +344 338 -2.50000000000000e-01 +344 337 -8.33333333333333e-02 +344 342 -3.33333333333333e-01 +344 336 1.66666666666667e-01 +344 99 1.66666666666667e-01 +344 220 -1.66666666666667e-01 +344 232 1.66666666666667e-01 +344 47 -7.50000000000000e-01 +344 238 -3.33333333333333e-01 +344 46 1.66666666666667e-01 +344 237 1.66666666666667e-01 +344 219 -1.66666666666667e-01 +344 251 -5.00000000000000e-01 +344 346 -8.33333333333333e-02 +344 101 -7.50000000000000e-01 +344 250 3.33333333333333e-01 +344 343 -3.33333333333333e-01 +344 100 1.66666666666667e-01 +344 249 -1.66666666666667e-01 +344 231 1.66666666666667e-01 +345 345 2.50000000000000e+00 +345 241 1.66666666666667e-01 +345 242 1.66666666666667e-01 +345 341 1.66666666666667e-01 +345 339 -2.50000000000000e-01 +345 353 1.66666666666667e-01 +345 352 1.66666666666667e-01 +345 346 -3.33333333333333e-01 +345 351 -7.50000000000000e-01 +345 254 -1.66666666666667e-01 +345 347 -3.33333333333333e-01 +345 239 -1.66666666666667e-01 +345 251 1.66666666666667e-01 +345 343 1.66666666666667e-01 +345 253 3.33333333333333e-01 +345 250 -3.33333333333333e-01 +345 344 1.66666666666667e-01 +345 47 -1.66666666666667e-01 +345 46 8.33333333333333e-02 +345 238 -1.66666666666667e-01 +345 342 -7.50000000000000e-01 +345 455 1.66666666666667e-01 +345 104 -1.66666666666667e-01 +345 454 -8.33333333333333e-02 +345 103 8.33333333333333e-02 +345 453 -2.50000000000000e-01 +345 340 -8.33333333333333e-02 +345 252 -5.00000000000000e-01 +346 346 2.50000000000000e+00 +346 339 -8.33333333333333e-02 +346 240 1.66666666666667e-01 +346 242 -3.33333333333333e-01 +346 47 8.33333333333333e-02 +346 340 -2.50000000000000e-01 +346 353 -8.33333333333333e-02 +346 104 8.33333333333333e-02 +346 352 -2.50000000000000e-01 +346 351 1.66666666666667e-01 +346 345 -3.33333333333333e-01 +346 344 -8.33333333333333e-02 +346 342 1.66666666666667e-01 +346 239 -1.66666666666667e-01 +346 251 1.66666666666667e-01 +346 252 3.33333333333333e-01 +346 249 -3.33333333333333e-01 +346 343 -2.50000000000000e-01 +346 45 8.33333333333333e-02 +346 237 -1.66666666666667e-01 +346 455 1.66666666666667e-01 +346 347 -3.33333333333333e-01 +346 254 3.33333333333333e-01 +346 454 -2.50000000000000e-01 +346 341 1.66666666666667e-01 +346 253 -1.50000000000000e+00 +346 453 -8.33333333333333e-02 +346 102 8.33333333333333e-02 +347 347 2.50000000000000e+00 +347 241 -3.33333333333333e-01 +347 240 1.66666666666667e-01 +347 341 -7.50000000000000e-01 +347 46 8.33333333333333e-02 +347 339 1.66666666666667e-01 +347 353 -2.50000000000000e-01 +347 352 -8.33333333333333e-02 +347 103 8.33333333333333e-02 +347 351 1.66666666666667e-01 +347 252 -1.66666666666667e-01 +347 343 -8.33333333333333e-02 +347 345 -3.33333333333333e-01 +347 237 -1.66666666666667e-01 +347 249 1.66666666666667e-01 +347 238 -1.66666666666667e-01 +347 250 1.66666666666667e-01 +347 344 -2.50000000000000e-01 +347 342 1.66666666666667e-01 +347 45 -1.66666666666667e-01 +347 455 -7.50000000000000e-01 +347 340 1.66666666666667e-01 +347 254 -5.00000000000000e-01 +347 454 1.66666666666667e-01 +347 346 -3.33333333333333e-01 +347 253 3.33333333333333e-01 +347 453 1.66666666666667e-01 +347 102 -1.66666666666667e-01 +348 348 1.00000000000000e+00 +348 263 -8.33333333333333e-02 +348 358 8.33333333333333e-02 +348 355 -8.33333333333333e-02 +348 53 8.33333333333333e-02 +348 359 -1.66666666666667e-01 +348 52 8.33333333333333e-02 +348 349 -1.66666666666667e-01 +348 262 1.66666666666667e-01 +348 51 -2.50000000000000e-01 +348 261 -2.50000000000000e-01 +348 350 -1.66666666666667e-01 +348 50 8.33333333333333e-02 +348 356 1.66666666666667e-01 +348 49 8.33333333333333e-02 +348 259 -1.66666666666667e-01 +348 260 8.33333333333333e-02 +348 48 -2.50000000000000e-01 +348 354 -2.50000000000000e-01 +349 349 1.16666666666667e+00 +349 263 1.66666666666667e-01 +349 356 1.66666666666667e-01 +349 357 8.33333333333333e-02 +349 354 -8.33333333333333e-02 +349 53 -8.33333333333333e-02 +349 359 8.33333333333333e-02 +349 52 -8.33333333333333e-02 +349 262 -7.50000000000000e-01 +349 51 8.33333333333333e-02 +349 348 -1.66666666666667e-01 +349 261 1.66666666666667e-01 +349 50 -8.33333333333333e-02 +349 260 8.33333333333333e-02 +349 350 -3.33333333333333e-01 +349 49 -8.33333333333333e-02 +349 355 -2.50000000000000e-01 +349 48 8.33333333333333e-02 +349 258 -1.66666666666667e-01 +350 350 1.16666666666667e+00 +350 261 -8.33333333333333e-02 +350 349 -3.33333333333333e-01 +350 262 1.66666666666667e-01 +350 355 1.66666666666667e-01 +350 53 -8.33333333333333e-02 +350 263 -2.50000000000000e-01 +350 52 -8.33333333333333e-02 +350 358 8.33333333333333e-02 +350 51 8.33333333333333e-02 +350 357 -1.66666666666667e-01 +350 258 8.33333333333333e-02 +350 50 -8.33333333333333e-02 +350 356 -7.50000000000000e-01 +350 49 -8.33333333333333e-02 +350 259 8.33333333333333e-02 +350 348 -1.66666666666667e-01 +350 48 8.33333333333333e-02 +350 354 1.66666666666667e-01 +351 351 2.50000000000000e+00 +351 352 -3.33333333333333e-01 +351 458 -1.66666666666667e-01 +351 103 -8.33333333333333e-02 +351 457 8.33333333333333e-02 +351 356 1.66666666666667e-01 +351 49 -8.33333333333333e-02 +351 354 -7.50000000000000e-01 +351 340 8.33333333333333e-02 +351 50 1.66666666666667e-01 +351 341 -1.66666666666667e-01 +351 353 -3.33333333333333e-01 +351 347 1.66666666666667e-01 +351 104 1.66666666666667e-01 +351 346 1.66666666666667e-01 +351 345 -7.50000000000000e-01 +351 241 -1.66666666666667e-01 +351 259 1.66666666666667e-01 +351 260 1.66666666666667e-01 +351 242 -1.66666666666667e-01 +351 48 -2.50000000000000e-01 +351 272 -1.66666666666667e-01 +351 254 1.66666666666667e-01 +351 271 3.33333333333333e-01 +351 253 -3.33333333333333e-01 +351 270 -5.00000000000000e-01 +351 355 1.66666666666667e-01 +351 102 -2.50000000000000e-01 +352 352 2.50000000000000e+00 +352 458 8.33333333333333e-02 +352 354 1.66666666666667e-01 +352 351 -3.33333333333333e-01 +352 102 -8.33333333333333e-02 +352 456 8.33333333333333e-02 +352 355 -2.50000000000000e-01 +352 48 -8.33333333333333e-02 +352 339 8.33333333333333e-02 +352 341 8.33333333333333e-02 +352 347 -8.33333333333333e-02 +352 346 -2.50000000000000e-01 +352 345 1.66666666666667e-01 +352 240 -1.66666666666667e-01 +352 258 1.66666666666667e-01 +352 242 -1.66666666666667e-01 +352 254 1.66666666666667e-01 +352 260 -3.33333333333333e-01 +352 50 1.66666666666667e-01 +352 49 -2.50000000000000e-01 +352 272 3.33333333333333e-01 +352 353 -3.33333333333333e-01 +352 104 1.66666666666667e-01 +352 271 -1.50000000000000e+00 +352 356 -8.33333333333333e-02 +352 103 -2.50000000000000e-01 +352 270 3.33333333333333e-01 +352 252 -3.33333333333333e-01 +353 353 2.50000000000000e+00 +353 457 8.33333333333333e-02 +353 456 -1.66666666666667e-01 +353 356 -2.50000000000000e-01 +353 354 1.66666666666667e-01 +353 340 8.33333333333333e-02 +353 48 1.66666666666667e-01 +353 339 -1.66666666666667e-01 +353 347 -2.50000000000000e-01 +353 346 -8.33333333333333e-02 +353 351 -3.33333333333333e-01 +353 345 1.66666666666667e-01 +353 102 1.66666666666667e-01 +353 241 -1.66666666666667e-01 +353 253 1.66666666666667e-01 +353 50 -7.50000000000000e-01 +353 259 -3.33333333333333e-01 +353 49 1.66666666666667e-01 +353 258 1.66666666666667e-01 +353 240 -1.66666666666667e-01 +353 272 -5.00000000000000e-01 +353 355 -8.33333333333333e-02 +353 104 -7.50000000000000e-01 +353 271 3.33333333333333e-01 +353 352 -3.33333333333333e-01 +353 103 1.66666666666667e-01 +353 270 -1.66666666666667e-01 +353 252 1.66666666666667e-01 +354 354 2.50000000000000e+00 +354 262 1.66666666666667e-01 +354 263 1.66666666666667e-01 +354 350 1.66666666666667e-01 +354 348 -2.50000000000000e-01 +354 359 1.66666666666667e-01 +354 358 1.66666666666667e-01 +354 355 -3.33333333333333e-01 +354 357 -7.50000000000000e-01 +354 275 -1.66666666666667e-01 +354 356 -3.33333333333333e-01 +354 260 -1.66666666666667e-01 +354 272 1.66666666666667e-01 +354 352 1.66666666666667e-01 +354 274 3.33333333333333e-01 +354 271 -3.33333333333333e-01 +354 353 1.66666666666667e-01 +354 50 -1.66666666666667e-01 +354 49 8.33333333333333e-02 +354 259 -1.66666666666667e-01 +354 351 -7.50000000000000e-01 +354 458 1.66666666666667e-01 +354 107 -1.66666666666667e-01 +354 457 -8.33333333333333e-02 +354 106 8.33333333333333e-02 +354 456 -2.50000000000000e-01 +354 349 -8.33333333333333e-02 +354 273 -5.00000000000000e-01 +355 355 2.50000000000000e+00 +355 348 -8.33333333333333e-02 +355 261 1.66666666666667e-01 +355 263 -3.33333333333333e-01 +355 50 8.33333333333333e-02 +355 349 -2.50000000000000e-01 +355 359 -8.33333333333333e-02 +355 107 8.33333333333333e-02 +355 358 -2.50000000000000e-01 +355 357 1.66666666666667e-01 +355 354 -3.33333333333333e-01 +355 353 -8.33333333333333e-02 +355 351 1.66666666666667e-01 +355 260 -1.66666666666667e-01 +355 272 1.66666666666667e-01 +355 273 3.33333333333333e-01 +355 270 -3.33333333333333e-01 +355 352 -2.50000000000000e-01 +355 48 8.33333333333333e-02 +355 258 -1.66666666666667e-01 +355 458 1.66666666666667e-01 +355 356 -3.33333333333333e-01 +355 275 3.33333333333333e-01 +355 457 -2.50000000000000e-01 +355 350 1.66666666666667e-01 +355 274 -1.50000000000000e+00 +355 456 -8.33333333333333e-02 +355 105 8.33333333333333e-02 +356 356 2.50000000000000e+00 +356 262 -3.33333333333333e-01 +356 261 1.66666666666667e-01 +356 350 -7.50000000000000e-01 +356 49 8.33333333333333e-02 +356 348 1.66666666666667e-01 +356 359 -2.50000000000000e-01 +356 358 -8.33333333333333e-02 +356 106 8.33333333333333e-02 +356 357 1.66666666666667e-01 +356 273 -1.66666666666667e-01 +356 352 -8.33333333333333e-02 +356 354 -3.33333333333333e-01 +356 258 -1.66666666666667e-01 +356 270 1.66666666666667e-01 +356 259 -1.66666666666667e-01 +356 271 1.66666666666667e-01 +356 353 -2.50000000000000e-01 +356 351 1.66666666666667e-01 +356 48 -1.66666666666667e-01 +356 458 -7.50000000000000e-01 +356 349 1.66666666666667e-01 +356 275 -5.00000000000000e-01 +356 457 1.66666666666667e-01 +356 355 -3.33333333333333e-01 +356 274 3.33333333333333e-01 +356 456 1.66666666666667e-01 +356 105 -1.66666666666667e-01 +357 357 1.33333333333333e+00 +357 53 8.33333333333333e-02 +357 350 -1.66666666666667e-01 +357 359 -1.66666666666667e-01 +357 356 1.66666666666667e-01 +357 107 8.33333333333333e-02 +357 355 1.66666666666667e-01 +357 354 -7.50000000000000e-01 +357 262 -1.66666666666667e-01 +357 277 8.33333333333333e-02 +357 278 8.33333333333333e-02 +357 263 -1.66666666666667e-01 +357 51 -1.66666666666667e-01 +357 284 -8.33333333333333e-02 +357 275 1.66666666666667e-01 +357 283 1.66666666666667e-01 +357 274 -3.33333333333333e-01 +357 282 -2.50000000000000e-01 +357 349 8.33333333333333e-02 +357 105 -1.66666666666667e-01 +358 358 1.33333333333333e+00 +358 350 8.33333333333333e-02 +358 356 -8.33333333333333e-02 +358 355 -2.50000000000000e-01 +358 354 1.66666666666667e-01 +358 261 -1.66666666666667e-01 +358 276 8.33333333333333e-02 +358 263 -1.66666666666667e-01 +358 275 1.66666666666667e-01 +358 278 -1.66666666666667e-01 +358 53 8.33333333333333e-02 +358 52 -1.66666666666667e-01 +358 284 1.66666666666667e-01 +358 359 -1.66666666666667e-01 +358 107 8.33333333333333e-02 +358 283 -7.50000000000000e-01 +358 348 8.33333333333333e-02 +358 106 -1.66666666666667e-01 +358 282 1.66666666666667e-01 +358 273 -3.33333333333333e-01 +359 359 1.50000000000000e+00 +359 51 8.33333333333333e-02 +359 348 -1.66666666666667e-01 +359 356 -2.50000000000000e-01 +359 355 -8.33333333333333e-02 +359 357 -1.66666666666667e-01 +359 354 1.66666666666667e-01 +359 105 8.33333333333333e-02 +359 262 -1.66666666666667e-01 +359 274 1.66666666666667e-01 +359 53 -5.00000000000000e-01 +359 277 -1.66666666666667e-01 +359 52 8.33333333333333e-02 +359 276 8.33333333333333e-02 +359 261 -1.66666666666667e-01 +359 284 -2.50000000000000e-01 +359 349 8.33333333333333e-02 +359 107 -5.00000000000000e-01 +359 283 1.66666666666667e-01 +359 358 -1.66666666666667e-01 +359 106 8.33333333333333e-02 +359 282 -8.33333333333333e-02 +359 273 1.66666666666667e-01 +360 360 5.00000000000000e+01 +360 118 0.00000000000000e+00 +360 374 4.16666666666667e+00 +360 368 -4.16666666666667e+00 +360 56 0.00000000000000e+00 +360 119 0.00000000000000e+00 +360 55 0.00000000000000e+00 +360 361 -8.33333333333333e+00 +360 367 8.33333333333333e+00 +360 54 0.00000000000000e+00 +360 366 -1.25000000000000e+01 +360 362 -8.33333333333333e+00 +360 59 4.16666666666667e+00 +360 122 8.33333333333333e+00 +360 58 4.16666666666667e+00 +360 373 -8.33333333333333e+00 +360 121 -4.16666666666667e+00 +360 57 -1.25000000000000e+01 +360 120 -1.25000000000000e+01 +361 361 5.83333333333333e+01 +361 117 0.00000000000000e+00 +361 122 8.33333333333333e+00 +361 362 -1.66666666666667e+01 +361 368 8.33333333333333e+00 +361 56 0.00000000000000e+00 +361 119 0.00000000000000e+00 +361 55 0.00000000000000e+00 +361 367 -3.75000000000000e+01 +361 54 0.00000000000000e+00 +361 360 -8.33333333333333e+00 +361 366 8.33333333333333e+00 +361 59 -4.16666666666667e+00 +361 374 4.16666666666667e+00 +361 120 -4.16666666666667e+00 +361 58 -4.16666666666667e+00 +361 121 -1.25000000000000e+01 +361 57 4.16666666666667e+00 +361 372 -8.33333333333333e+00 +362 362 5.83333333333333e+01 +362 361 -1.66666666666667e+01 +362 367 8.33333333333333e+00 +362 372 4.16666666666667e+00 +362 366 -4.16666666666667e+00 +362 56 0.00000000000000e+00 +362 368 -1.25000000000000e+01 +362 55 0.00000000000000e+00 +362 118 0.00000000000000e+00 +362 54 0.00000000000000e+00 +362 117 0.00000000000000e+00 +362 121 8.33333333333333e+00 +362 59 -4.16666666666667e+00 +362 122 -3.75000000000000e+01 +362 58 -4.16666666666667e+00 +362 373 4.16666666666667e+00 +362 360 -8.33333333333333e+00 +362 57 4.16666666666667e+00 +362 120 8.33333333333333e+00 +363 363 1.00000000000000e+00 +363 124 0.00000000000000e+00 +363 365 0.00000000000000e+00 +363 125 0.00000000000000e+00 +363 368 0.00000000000000e+00 +363 83 0.00000000000000e+00 +363 437 0.00000000000000e+00 +363 82 0.00000000000000e+00 +363 436 0.00000000000000e+00 +363 81 0.00000000000000e+00 +363 123 0.00000000000000e+00 +363 56 0.00000000000000e+00 +363 119 0.00000000000000e+00 +363 364 0.00000000000000e+00 +363 55 0.00000000000000e+00 +363 367 0.00000000000000e+00 +363 118 0.00000000000000e+00 +363 54 0.00000000000000e+00 +363 366 0.00000000000000e+00 +364 364 1.00000000000000e+00 +364 123 0.00000000000000e+00 +364 437 0.00000000000000e+00 +364 368 0.00000000000000e+00 +364 83 0.00000000000000e+00 +364 365 0.00000000000000e+00 +364 125 0.00000000000000e+00 +364 82 0.00000000000000e+00 +364 124 0.00000000000000e+00 +364 81 0.00000000000000e+00 +364 435 0.00000000000000e+00 +364 56 0.00000000000000e+00 +364 119 0.00000000000000e+00 +364 117 0.00000000000000e+00 +364 55 0.00000000000000e+00 +364 367 0.00000000000000e+00 +364 363 0.00000000000000e+00 +364 54 0.00000000000000e+00 +364 366 0.00000000000000e+00 +365 365 1.00000000000000e+00 +365 367 0.00000000000000e+00 +365 363 0.00000000000000e+00 +365 123 0.00000000000000e+00 +365 366 0.00000000000000e+00 +365 83 0.00000000000000e+00 +365 125 0.00000000000000e+00 +365 82 0.00000000000000e+00 +365 364 0.00000000000000e+00 +365 124 0.00000000000000e+00 +365 81 0.00000000000000e+00 +365 435 0.00000000000000e+00 +365 436 0.00000000000000e+00 +365 56 0.00000000000000e+00 +365 368 0.00000000000000e+00 +365 55 0.00000000000000e+00 +365 118 0.00000000000000e+00 +365 54 0.00000000000000e+00 +365 117 0.00000000000000e+00 +366 366 1.25000000000000e+02 +366 125 0.00000000000000e+00 +366 124 0.00000000000000e+00 +366 56 0.00000000000000e+00 +366 364 0.00000000000000e+00 +366 363 0.00000000000000e+00 +366 437 -4.16666666666667e+00 +366 86 4.16666666666667e+00 +366 436 8.33333333333333e+00 +366 435 -1.25000000000000e+01 +366 119 0.00000000000000e+00 +366 118 0.00000000000000e+00 +366 122 8.33333333333333e+00 +366 362 -4.16666666666667e+00 +366 367 -1.66666666666667e+01 +366 121 8.33333333333333e+00 +366 127 -8.33333333333333e+00 +366 55 0.00000000000000e+00 +366 361 8.33333333333333e+00 +366 360 -1.25000000000000e+01 +366 368 -1.66666666666667e+01 +366 374 8.33333333333333e+00 +366 128 1.66666666666667e+01 +366 373 8.33333333333333e+00 +366 85 -8.33333333333333e+00 +366 365 0.00000000000000e+00 +366 372 -3.75000000000000e+01 +366 126 -2.50000000000000e+01 +367 367 1.25000000000000e+02 +367 125 0.00000000000000e+00 +367 123 0.00000000000000e+00 +367 364 0.00000000000000e+00 +367 363 0.00000000000000e+00 +367 437 8.33333333333333e+00 +367 368 -1.66666666666667e+01 +367 436 -3.75000000000000e+01 +367 435 8.33333333333333e+00 +367 117 0.00000000000000e+00 +367 362 8.33333333333333e+00 +367 366 -1.66666666666667e+01 +367 122 -1.66666666666667e+01 +367 128 1.66666666666667e+01 +367 120 8.33333333333333e+00 +367 126 -8.33333333333333e+00 +367 56 0.00000000000000e+00 +367 119 0.00000000000000e+00 +367 361 -3.75000000000000e+01 +367 54 0.00000000000000e+00 +367 360 8.33333333333333e+00 +367 374 -4.16666666666667e+00 +367 86 4.16666666666667e+00 +367 365 0.00000000000000e+00 +367 373 -1.25000000000000e+01 +367 127 -2.50000000000000e+01 +367 372 8.33333333333333e+00 +367 84 -8.33333333333333e+00 +368 368 1.25000000000000e+02 +368 124 0.00000000000000e+00 +368 363 0.00000000000000e+00 +368 123 0.00000000000000e+00 +368 365 0.00000000000000e+00 +368 54 0.00000000000000e+00 +368 437 -1.25000000000000e+01 +368 436 8.33333333333333e+00 +368 367 -1.66666666666667e+01 +368 435 -4.16666666666667e+00 +368 84 4.16666666666667e+00 +368 117 0.00000000000000e+00 +368 361 8.33333333333333e+00 +368 120 8.33333333333333e+00 +368 360 -4.16666666666667e+00 +368 121 -1.66666666666667e+01 +368 127 1.66666666666667e+01 +368 362 -1.25000000000000e+01 +368 55 0.00000000000000e+00 +368 118 0.00000000000000e+00 +368 364 0.00000000000000e+00 +368 374 -1.25000000000000e+01 +368 128 -7.50000000000000e+01 +368 373 -4.16666666666667e+00 +368 85 4.16666666666667e+00 +368 366 -1.66666666666667e+01 +368 372 8.33333333333333e+00 +368 126 1.66666666666667e+01 +369 369 5.00000000000000e+01 +369 139 4.16666666666667e+00 +369 383 4.16666666666667e+00 +369 377 -4.16666666666667e+00 +369 59 4.16666666666667e+00 +369 140 -8.33333333333333e+00 +369 58 4.16666666666667e+00 +369 370 -8.33333333333333e+00 +369 376 8.33333333333333e+00 +369 57 -1.25000000000000e+01 +369 375 -1.25000000000000e+01 +369 371 -8.33333333333333e+00 +369 62 4.16666666666667e+00 +369 143 8.33333333333333e+00 +369 61 4.16666666666667e+00 +369 382 -8.33333333333333e+00 +369 142 -4.16666666666667e+00 +369 60 -1.25000000000000e+01 +369 141 -1.25000000000000e+01 +370 370 5.83333333333333e+01 +370 138 4.16666666666667e+00 +370 143 8.33333333333333e+00 +370 371 -1.66666666666667e+01 +370 377 8.33333333333333e+00 +370 59 -4.16666666666667e+00 +370 140 4.16666666666667e+00 +370 58 -4.16666666666667e+00 +370 376 -3.75000000000000e+01 +370 57 4.16666666666667e+00 +370 369 -8.33333333333333e+00 +370 375 8.33333333333333e+00 +370 62 -4.16666666666667e+00 +370 383 4.16666666666667e+00 +370 141 -4.16666666666667e+00 +370 61 -4.16666666666667e+00 +370 142 -1.25000000000000e+01 +370 60 4.16666666666667e+00 +370 381 -8.33333333333333e+00 +371 371 5.83333333333333e+01 +371 370 -1.66666666666667e+01 +371 376 8.33333333333333e+00 +371 381 4.16666666666667e+00 +371 375 -4.16666666666667e+00 +371 59 -4.16666666666667e+00 +371 377 -1.25000000000000e+01 +371 58 -4.16666666666667e+00 +371 139 4.16666666666667e+00 +371 57 4.16666666666667e+00 +371 138 -8.33333333333333e+00 +371 142 8.33333333333333e+00 +371 62 -4.16666666666667e+00 +371 143 -3.75000000000000e+01 +371 61 -4.16666666666667e+00 +371 382 4.16666666666667e+00 +371 369 -8.33333333333333e+00 +371 60 4.16666666666667e+00 +371 141 8.33333333333333e+00 +372 372 1.25000000000000e+02 +372 377 8.33333333333333e+00 +372 86 -4.16666666666667e+00 +372 440 4.16666666666667e+00 +372 439 -8.33333333333333e+00 +372 59 -4.16666666666667e+00 +372 376 8.33333333333333e+00 +372 375 -3.75000000000000e+01 +372 140 8.33333333333333e+00 +372 139 8.33333333333333e+00 +372 146 1.66666666666667e+01 +372 145 -8.33333333333333e+00 +372 144 -2.50000000000000e+01 +372 122 -8.33333333333333e+00 +372 362 4.16666666666667e+00 +372 121 -8.33333333333333e+00 +372 127 8.33333333333333e+00 +372 361 -8.33333333333333e+00 +372 58 8.33333333333333e+00 +372 57 -1.25000000000000e+01 +372 368 8.33333333333333e+00 +372 128 -1.66666666666667e+01 +372 367 8.33333333333333e+00 +372 373 -1.66666666666667e+01 +372 85 8.33333333333333e+00 +372 366 -3.75000000000000e+01 +372 374 -1.66666666666667e+01 +372 84 -1.25000000000000e+01 +373 373 1.25000000000000e+02 +373 377 -4.16666666666667e+00 +373 438 -8.33333333333333e+00 +373 376 -1.25000000000000e+01 +373 375 8.33333333333333e+00 +373 140 -1.66666666666667e+01 +373 59 8.33333333333333e+00 +373 138 8.33333333333333e+00 +373 146 1.66666666666667e+01 +373 374 -1.66666666666667e+01 +373 86 8.33333333333333e+00 +373 145 -2.50000000000000e+01 +373 144 -8.33333333333333e+00 +373 120 -8.33333333333333e+00 +373 126 8.33333333333333e+00 +373 362 4.16666666666667e+00 +373 122 -8.33333333333333e+00 +373 58 -3.75000000000000e+01 +373 360 -8.33333333333333e+00 +373 57 8.33333333333333e+00 +373 368 -4.16666666666667e+00 +373 128 8.33333333333333e+00 +373 367 -1.25000000000000e+01 +373 440 4.16666666666667e+00 +373 85 -3.75000000000000e+01 +373 366 8.33333333333333e+00 +373 372 -1.66666666666667e+01 +373 84 8.33333333333333e+00 +374 374 1.25000000000000e+02 +374 376 -4.16666666666667e+00 +374 372 -1.66666666666667e+01 +374 375 8.33333333333333e+00 +374 84 -4.16666666666667e+00 +374 438 4.16666666666667e+00 +374 377 -1.25000000000000e+01 +374 57 -4.16666666666667e+00 +374 138 8.33333333333333e+00 +374 139 -1.66666666666667e+01 +374 58 8.33333333333333e+00 +374 146 -7.50000000000000e+01 +374 145 1.66666666666667e+01 +374 373 -1.66666666666667e+01 +374 85 8.33333333333333e+00 +374 144 1.66666666666667e+01 +374 120 -8.33333333333333e+00 +374 360 4.16666666666667e+00 +374 59 -1.25000000000000e+01 +374 361 4.16666666666667e+00 +374 121 -8.33333333333333e+00 +374 368 -1.25000000000000e+01 +374 439 4.16666666666667e+00 +374 86 -1.25000000000000e+01 +374 367 -4.16666666666667e+00 +374 127 8.33333333333333e+00 +374 366 8.33333333333333e+00 +374 126 -1.66666666666667e+01 +375 375 1.25000000000000e+02 +375 146 -1.66666666666667e+01 +375 145 8.33333333333333e+00 +375 59 4.16666666666667e+00 +375 373 8.33333333333333e+00 +375 372 -3.75000000000000e+01 +375 440 -4.16666666666667e+00 +375 89 4.16666666666667e+00 +375 439 8.33333333333333e+00 +375 438 -1.25000000000000e+01 +375 140 -8.33333333333333e+00 +375 139 -8.33333333333333e+00 +375 143 8.33333333333333e+00 +375 371 -4.16666666666667e+00 +375 376 -1.66666666666667e+01 +375 142 8.33333333333333e+00 +375 148 -8.33333333333333e+00 +375 58 -8.33333333333333e+00 +375 370 8.33333333333333e+00 +375 369 -1.25000000000000e+01 +375 377 -1.66666666666667e+01 +375 383 8.33333333333333e+00 +375 149 1.66666666666667e+01 +375 382 8.33333333333333e+00 +375 88 -8.33333333333333e+00 +375 374 8.33333333333333e+00 +375 381 -3.75000000000000e+01 +375 147 -2.50000000000000e+01 +376 376 1.25000000000000e+02 +376 146 8.33333333333333e+00 +376 144 8.33333333333333e+00 +376 373 -1.25000000000000e+01 +376 372 8.33333333333333e+00 +376 440 8.33333333333333e+00 +376 377 -1.66666666666667e+01 +376 439 -3.75000000000000e+01 +376 438 8.33333333333333e+00 +376 138 -8.33333333333333e+00 +376 371 8.33333333333333e+00 +376 375 -1.66666666666667e+01 +376 143 -1.66666666666667e+01 +376 149 1.66666666666667e+01 +376 141 8.33333333333333e+00 +376 147 -8.33333333333333e+00 +376 59 4.16666666666667e+00 +376 140 -8.33333333333333e+00 +376 370 -3.75000000000000e+01 +376 57 -8.33333333333333e+00 +376 369 8.33333333333333e+00 +376 383 -4.16666666666667e+00 +376 89 4.16666666666667e+00 +376 374 -4.16666666666667e+00 +376 382 -1.25000000000000e+01 +376 148 -2.50000000000000e+01 +376 381 8.33333333333333e+00 +376 87 -8.33333333333333e+00 +377 377 1.25000000000000e+02 +377 145 8.33333333333333e+00 +377 372 8.33333333333333e+00 +377 144 -1.66666666666667e+01 +377 374 -1.25000000000000e+01 +377 57 4.16666666666667e+00 +377 440 -1.25000000000000e+01 +377 439 8.33333333333333e+00 +377 376 -1.66666666666667e+01 +377 438 -4.16666666666667e+00 +377 87 4.16666666666667e+00 +377 138 -8.33333333333333e+00 +377 370 8.33333333333333e+00 +377 141 8.33333333333333e+00 +377 369 -4.16666666666667e+00 +377 142 -1.66666666666667e+01 +377 148 1.66666666666667e+01 +377 371 -1.25000000000000e+01 +377 58 4.16666666666667e+00 +377 139 -8.33333333333333e+00 +377 373 -4.16666666666667e+00 +377 383 -1.25000000000000e+01 +377 149 -7.50000000000000e+01 +377 382 -4.16666666666667e+00 +377 88 4.16666666666667e+00 +377 375 -1.66666666666667e+01 +377 381 8.33333333333333e+00 +377 147 1.66666666666667e+01 +378 378 5.00000000000000e+01 +378 160 4.16666666666667e+00 +378 392 4.16666666666667e+00 +378 386 -4.16666666666667e+00 +378 62 4.16666666666667e+00 +378 161 -8.33333333333333e+00 +378 61 4.16666666666667e+00 +378 379 -8.33333333333333e+00 +378 385 8.33333333333333e+00 +378 60 -1.25000000000000e+01 +378 384 -1.25000000000000e+01 +378 380 -8.33333333333333e+00 +378 65 4.16666666666667e+00 +378 164 8.33333333333333e+00 +378 64 4.16666666666667e+00 +378 391 -8.33333333333333e+00 +378 163 -4.16666666666667e+00 +378 63 -1.25000000000000e+01 +378 162 -1.25000000000000e+01 +379 379 5.83333333333333e+01 +379 159 4.16666666666667e+00 +379 164 8.33333333333333e+00 +379 380 -1.66666666666667e+01 +379 386 8.33333333333333e+00 +379 62 -4.16666666666667e+00 +379 161 4.16666666666667e+00 +379 61 -4.16666666666667e+00 +379 385 -3.75000000000000e+01 +379 60 4.16666666666667e+00 +379 378 -8.33333333333333e+00 +379 384 8.33333333333333e+00 +379 65 -4.16666666666667e+00 +379 392 4.16666666666667e+00 +379 162 -4.16666666666667e+00 +379 64 -4.16666666666667e+00 +379 163 -1.25000000000000e+01 +379 63 4.16666666666667e+00 +379 390 -8.33333333333333e+00 +380 380 5.83333333333333e+01 +380 379 -1.66666666666667e+01 +380 385 8.33333333333333e+00 +380 390 4.16666666666667e+00 +380 384 -4.16666666666667e+00 +380 62 -4.16666666666667e+00 +380 386 -1.25000000000000e+01 +380 61 -4.16666666666667e+00 +380 160 4.16666666666667e+00 +380 60 4.16666666666667e+00 +380 159 -8.33333333333333e+00 +380 163 8.33333333333333e+00 +380 65 -4.16666666666667e+00 +380 164 -3.75000000000000e+01 +380 64 -4.16666666666667e+00 +380 391 4.16666666666667e+00 +380 378 -8.33333333333333e+00 +380 63 4.16666666666667e+00 +380 162 8.33333333333333e+00 +381 381 1.25000000000000e+02 +381 386 8.33333333333333e+00 +381 89 -4.16666666666667e+00 +381 443 4.16666666666667e+00 +381 442 -8.33333333333333e+00 +381 62 -4.16666666666667e+00 +381 385 8.33333333333333e+00 +381 384 -3.75000000000000e+01 +381 161 8.33333333333333e+00 +381 160 8.33333333333333e+00 +381 167 1.66666666666667e+01 +381 166 -8.33333333333333e+00 +381 165 -2.50000000000000e+01 +381 143 -8.33333333333333e+00 +381 371 4.16666666666667e+00 +381 142 -8.33333333333333e+00 +381 148 8.33333333333333e+00 +381 370 -8.33333333333333e+00 +381 61 8.33333333333333e+00 +381 60 -1.25000000000000e+01 +381 377 8.33333333333333e+00 +381 149 -1.66666666666667e+01 +381 376 8.33333333333333e+00 +381 382 -1.66666666666667e+01 +381 88 8.33333333333333e+00 +381 375 -3.75000000000000e+01 +381 383 -1.66666666666667e+01 +381 87 -1.25000000000000e+01 +382 382 1.25000000000000e+02 +382 386 -4.16666666666667e+00 +382 441 -8.33333333333333e+00 +382 385 -1.25000000000000e+01 +382 384 8.33333333333333e+00 +382 161 -1.66666666666667e+01 +382 62 8.33333333333333e+00 +382 159 8.33333333333333e+00 +382 167 1.66666666666667e+01 +382 383 -1.66666666666667e+01 +382 89 8.33333333333333e+00 +382 166 -2.50000000000000e+01 +382 165 -8.33333333333333e+00 +382 141 -8.33333333333333e+00 +382 147 8.33333333333333e+00 +382 371 4.16666666666667e+00 +382 143 -8.33333333333333e+00 +382 61 -3.75000000000000e+01 +382 369 -8.33333333333333e+00 +382 60 8.33333333333333e+00 +382 377 -4.16666666666667e+00 +382 149 8.33333333333333e+00 +382 376 -1.25000000000000e+01 +382 443 4.16666666666667e+00 +382 88 -3.75000000000000e+01 +382 375 8.33333333333333e+00 +382 381 -1.66666666666667e+01 +382 87 8.33333333333333e+00 +383 383 1.25000000000000e+02 +383 385 -4.16666666666667e+00 +383 381 -1.66666666666667e+01 +383 384 8.33333333333333e+00 +383 87 -4.16666666666667e+00 +383 441 4.16666666666667e+00 +383 386 -1.25000000000000e+01 +383 60 -4.16666666666667e+00 +383 159 8.33333333333333e+00 +383 160 -1.66666666666667e+01 +383 61 8.33333333333333e+00 +383 167 -7.50000000000000e+01 +383 166 1.66666666666667e+01 +383 382 -1.66666666666667e+01 +383 88 8.33333333333333e+00 +383 165 1.66666666666667e+01 +383 141 -8.33333333333333e+00 +383 369 4.16666666666667e+00 +383 62 -1.25000000000000e+01 +383 370 4.16666666666667e+00 +383 142 -8.33333333333333e+00 +383 377 -1.25000000000000e+01 +383 442 4.16666666666667e+00 +383 89 -1.25000000000000e+01 +383 376 -4.16666666666667e+00 +383 148 8.33333333333333e+00 +383 375 8.33333333333333e+00 +383 147 -1.66666666666667e+01 +384 384 1.25000000000000e+02 +384 167 -1.66666666666667e+01 +384 166 8.33333333333333e+00 +384 62 4.16666666666667e+00 +384 382 8.33333333333333e+00 +384 381 -3.75000000000000e+01 +384 443 -4.16666666666667e+00 +384 92 4.16666666666667e+00 +384 442 8.33333333333333e+00 +384 441 -1.25000000000000e+01 +384 161 -8.33333333333333e+00 +384 160 -8.33333333333333e+00 +384 164 8.33333333333333e+00 +384 380 -4.16666666666667e+00 +384 385 -1.66666666666667e+01 +384 163 8.33333333333333e+00 +384 169 -8.33333333333333e+00 +384 61 -8.33333333333333e+00 +384 379 8.33333333333333e+00 +384 378 -1.25000000000000e+01 +384 386 -1.66666666666667e+01 +384 392 8.33333333333333e+00 +384 170 1.66666666666667e+01 +384 391 8.33333333333333e+00 +384 91 -8.33333333333333e+00 +384 383 8.33333333333333e+00 +384 390 -3.75000000000000e+01 +384 168 -2.50000000000000e+01 +385 385 1.25000000000000e+02 +385 167 8.33333333333333e+00 +385 165 8.33333333333333e+00 +385 382 -1.25000000000000e+01 +385 381 8.33333333333333e+00 +385 443 8.33333333333333e+00 +385 386 -1.66666666666667e+01 +385 442 -3.75000000000000e+01 +385 441 8.33333333333333e+00 +385 159 -8.33333333333333e+00 +385 380 8.33333333333333e+00 +385 384 -1.66666666666667e+01 +385 164 -1.66666666666667e+01 +385 170 1.66666666666667e+01 +385 162 8.33333333333333e+00 +385 168 -8.33333333333333e+00 +385 62 4.16666666666667e+00 +385 161 -8.33333333333333e+00 +385 379 -3.75000000000000e+01 +385 60 -8.33333333333333e+00 +385 378 8.33333333333333e+00 +385 392 -4.16666666666667e+00 +385 92 4.16666666666667e+00 +385 383 -4.16666666666667e+00 +385 391 -1.25000000000000e+01 +385 169 -2.50000000000000e+01 +385 390 8.33333333333333e+00 +385 90 -8.33333333333333e+00 +386 386 1.25000000000000e+02 +386 166 8.33333333333333e+00 +386 381 8.33333333333333e+00 +386 165 -1.66666666666667e+01 +386 383 -1.25000000000000e+01 +386 60 4.16666666666667e+00 +386 443 -1.25000000000000e+01 +386 442 8.33333333333333e+00 +386 385 -1.66666666666667e+01 +386 441 -4.16666666666667e+00 +386 90 4.16666666666667e+00 +386 159 -8.33333333333333e+00 +386 379 8.33333333333333e+00 +386 162 8.33333333333333e+00 +386 378 -4.16666666666667e+00 +386 163 -1.66666666666667e+01 +386 169 1.66666666666667e+01 +386 380 -1.25000000000000e+01 +386 61 4.16666666666667e+00 +386 160 -8.33333333333333e+00 +386 382 -4.16666666666667e+00 +386 392 -1.25000000000000e+01 +386 170 -7.50000000000000e+01 +386 391 -4.16666666666667e+00 +386 91 4.16666666666667e+00 +386 384 -1.66666666666667e+01 +386 390 8.33333333333333e+00 +386 168 1.66666666666667e+01 +387 387 5.00000000000000e+01 +387 181 4.16666666666667e+00 +387 401 4.16666666666667e+00 +387 395 -4.16666666666667e+00 +387 65 4.16666666666667e+00 +387 182 -8.33333333333333e+00 +387 64 4.16666666666667e+00 +387 388 -8.33333333333333e+00 +387 394 8.33333333333333e+00 +387 63 -1.25000000000000e+01 +387 393 -1.25000000000000e+01 +387 389 -8.33333333333333e+00 +387 68 4.16666666666667e+00 +387 185 8.33333333333333e+00 +387 67 4.16666666666667e+00 +387 400 -8.33333333333333e+00 +387 184 -4.16666666666667e+00 +387 66 -1.25000000000000e+01 +387 183 -1.25000000000000e+01 +388 388 5.83333333333333e+01 +388 180 4.16666666666667e+00 +388 185 8.33333333333333e+00 +388 389 -1.66666666666667e+01 +388 395 8.33333333333333e+00 +388 65 -4.16666666666667e+00 +388 182 4.16666666666667e+00 +388 64 -4.16666666666667e+00 +388 394 -3.75000000000000e+01 +388 63 4.16666666666667e+00 +388 387 -8.33333333333333e+00 +388 393 8.33333333333333e+00 +388 68 -4.16666666666667e+00 +388 401 4.16666666666667e+00 +388 183 -4.16666666666667e+00 +388 67 -4.16666666666667e+00 +388 184 -1.25000000000000e+01 +388 66 4.16666666666667e+00 +388 399 -8.33333333333333e+00 +389 389 5.83333333333333e+01 +389 388 -1.66666666666667e+01 +389 394 8.33333333333333e+00 +389 399 4.16666666666667e+00 +389 393 -4.16666666666667e+00 +389 65 -4.16666666666667e+00 +389 395 -1.25000000000000e+01 +389 64 -4.16666666666667e+00 +389 181 4.16666666666667e+00 +389 63 4.16666666666667e+00 +389 180 -8.33333333333333e+00 +389 184 8.33333333333333e+00 +389 68 -4.16666666666667e+00 +389 185 -3.75000000000000e+01 +389 67 -4.16666666666667e+00 +389 400 4.16666666666667e+00 +389 387 -8.33333333333333e+00 +389 66 4.16666666666667e+00 +389 183 8.33333333333333e+00 +390 390 1.25000000000000e+02 +390 395 8.33333333333333e+00 +390 92 -4.16666666666667e+00 +390 446 4.16666666666667e+00 +390 445 -8.33333333333333e+00 +390 65 -4.16666666666667e+00 +390 394 8.33333333333333e+00 +390 393 -3.75000000000000e+01 +390 182 8.33333333333333e+00 +390 181 8.33333333333333e+00 +390 188 1.66666666666667e+01 +390 187 -8.33333333333333e+00 +390 186 -2.50000000000000e+01 +390 164 -8.33333333333333e+00 +390 380 4.16666666666667e+00 +390 163 -8.33333333333333e+00 +390 169 8.33333333333333e+00 +390 379 -8.33333333333333e+00 +390 64 8.33333333333333e+00 +390 63 -1.25000000000000e+01 +390 386 8.33333333333333e+00 +390 170 -1.66666666666667e+01 +390 385 8.33333333333333e+00 +390 391 -1.66666666666667e+01 +390 91 8.33333333333333e+00 +390 384 -3.75000000000000e+01 +390 392 -1.66666666666667e+01 +390 90 -1.25000000000000e+01 +391 391 1.25000000000000e+02 +391 395 -4.16666666666667e+00 +391 444 -8.33333333333333e+00 +391 394 -1.25000000000000e+01 +391 393 8.33333333333333e+00 +391 182 -1.66666666666667e+01 +391 65 8.33333333333333e+00 +391 180 8.33333333333333e+00 +391 188 1.66666666666667e+01 +391 392 -1.66666666666667e+01 +391 92 8.33333333333333e+00 +391 187 -2.50000000000000e+01 +391 186 -8.33333333333333e+00 +391 162 -8.33333333333333e+00 +391 168 8.33333333333333e+00 +391 380 4.16666666666667e+00 +391 164 -8.33333333333333e+00 +391 64 -3.75000000000000e+01 +391 378 -8.33333333333333e+00 +391 63 8.33333333333333e+00 +391 386 -4.16666666666667e+00 +391 170 8.33333333333333e+00 +391 385 -1.25000000000000e+01 +391 446 4.16666666666667e+00 +391 91 -3.75000000000000e+01 +391 384 8.33333333333333e+00 +391 390 -1.66666666666667e+01 +391 90 8.33333333333333e+00 +392 392 1.25000000000000e+02 +392 394 -4.16666666666667e+00 +392 390 -1.66666666666667e+01 +392 393 8.33333333333333e+00 +392 90 -4.16666666666667e+00 +392 444 4.16666666666667e+00 +392 395 -1.25000000000000e+01 +392 63 -4.16666666666667e+00 +392 180 8.33333333333333e+00 +392 181 -1.66666666666667e+01 +392 64 8.33333333333333e+00 +392 188 -7.50000000000000e+01 +392 187 1.66666666666667e+01 +392 391 -1.66666666666667e+01 +392 91 8.33333333333333e+00 +392 186 1.66666666666667e+01 +392 162 -8.33333333333333e+00 +392 378 4.16666666666667e+00 +392 65 -1.25000000000000e+01 +392 379 4.16666666666667e+00 +392 163 -8.33333333333333e+00 +392 386 -1.25000000000000e+01 +392 445 4.16666666666667e+00 +392 92 -1.25000000000000e+01 +392 385 -4.16666666666667e+00 +392 169 8.33333333333333e+00 +392 384 8.33333333333333e+00 +392 168 -1.66666666666667e+01 +393 393 1.25000000000000e+02 +393 188 -1.66666666666667e+01 +393 187 8.33333333333333e+00 +393 65 4.16666666666667e+00 +393 391 8.33333333333333e+00 +393 390 -3.75000000000000e+01 +393 446 -4.16666666666667e+00 +393 95 4.16666666666667e+00 +393 445 8.33333333333333e+00 +393 444 -1.25000000000000e+01 +393 182 -8.33333333333333e+00 +393 181 -8.33333333333333e+00 +393 185 8.33333333333333e+00 +393 389 -4.16666666666667e+00 +393 394 -1.66666666666667e+01 +393 184 8.33333333333333e+00 +393 190 -8.33333333333333e+00 +393 64 -8.33333333333333e+00 +393 388 8.33333333333333e+00 +393 387 -1.25000000000000e+01 +393 395 -1.66666666666667e+01 +393 401 8.33333333333333e+00 +393 191 1.66666666666667e+01 +393 400 8.33333333333333e+00 +393 94 -8.33333333333333e+00 +393 392 8.33333333333333e+00 +393 399 -3.75000000000000e+01 +393 189 -2.50000000000000e+01 +394 394 1.25000000000000e+02 +394 188 8.33333333333333e+00 +394 186 8.33333333333333e+00 +394 391 -1.25000000000000e+01 +394 390 8.33333333333333e+00 +394 446 8.33333333333333e+00 +394 395 -1.66666666666667e+01 +394 445 -3.75000000000000e+01 +394 444 8.33333333333333e+00 +394 180 -8.33333333333333e+00 +394 389 8.33333333333333e+00 +394 393 -1.66666666666667e+01 +394 185 -1.66666666666667e+01 +394 191 1.66666666666667e+01 +394 183 8.33333333333333e+00 +394 189 -8.33333333333333e+00 +394 65 4.16666666666667e+00 +394 182 -8.33333333333333e+00 +394 388 -3.75000000000000e+01 +394 63 -8.33333333333333e+00 +394 387 8.33333333333333e+00 +394 401 -4.16666666666667e+00 +394 95 4.16666666666667e+00 +394 392 -4.16666666666667e+00 +394 400 -1.25000000000000e+01 +394 190 -2.50000000000000e+01 +394 399 8.33333333333333e+00 +394 93 -8.33333333333333e+00 +395 395 1.25000000000000e+02 +395 187 8.33333333333333e+00 +395 390 8.33333333333333e+00 +395 186 -1.66666666666667e+01 +395 392 -1.25000000000000e+01 +395 63 4.16666666666667e+00 +395 446 -1.25000000000000e+01 +395 445 8.33333333333333e+00 +395 394 -1.66666666666667e+01 +395 444 -4.16666666666667e+00 +395 93 4.16666666666667e+00 +395 180 -8.33333333333333e+00 +395 388 8.33333333333333e+00 +395 183 8.33333333333333e+00 +395 387 -4.16666666666667e+00 +395 184 -1.66666666666667e+01 +395 190 1.66666666666667e+01 +395 389 -1.25000000000000e+01 +395 64 4.16666666666667e+00 +395 181 -8.33333333333333e+00 +395 391 -4.16666666666667e+00 +395 401 -1.25000000000000e+01 +395 191 -7.50000000000000e+01 +395 400 -4.16666666666667e+00 +395 94 4.16666666666667e+00 +395 393 -1.66666666666667e+01 +395 399 8.33333333333333e+00 +395 189 1.66666666666667e+01 +396 396 1.00000000000000e+00 +396 202 8.33333333333333e-02 +396 410 8.33333333333333e-02 +396 404 -8.33333333333333e-02 +396 68 8.33333333333333e-02 +396 203 -1.66666666666667e-01 +396 67 8.33333333333333e-02 +396 397 -1.66666666666667e-01 +396 403 1.66666666666667e-01 +396 66 -2.50000000000000e-01 +396 402 -2.50000000000000e-01 +396 398 -1.66666666666667e-01 +396 71 8.33333333333333e-02 +396 206 1.66666666666667e-01 +396 70 8.33333333333333e-02 +396 409 -1.66666666666667e-01 +396 205 -8.33333333333333e-02 +396 69 -2.50000000000000e-01 +396 204 -2.50000000000000e-01 +397 397 1.16666666666667e+00 +397 201 8.33333333333333e-02 +397 206 1.66666666666667e-01 +397 398 -3.33333333333333e-01 +397 404 1.66666666666667e-01 +397 68 -8.33333333333333e-02 +397 203 8.33333333333333e-02 +397 67 -8.33333333333333e-02 +397 403 -7.50000000000000e-01 +397 66 8.33333333333333e-02 +397 396 -1.66666666666667e-01 +397 402 1.66666666666667e-01 +397 71 -8.33333333333333e-02 +397 410 8.33333333333333e-02 +397 204 -8.33333333333333e-02 +397 70 -8.33333333333333e-02 +397 205 -2.50000000000000e-01 +397 69 8.33333333333333e-02 +397 408 -1.66666666666667e-01 +398 398 1.16666666666667e+00 +398 397 -3.33333333333333e-01 +398 403 1.66666666666667e-01 +398 408 8.33333333333333e-02 +398 402 -8.33333333333333e-02 +398 68 -8.33333333333333e-02 +398 404 -2.50000000000000e-01 +398 67 -8.33333333333333e-02 +398 202 8.33333333333333e-02 +398 66 8.33333333333333e-02 +398 201 -1.66666666666667e-01 +398 205 1.66666666666667e-01 +398 71 -8.33333333333333e-02 +398 206 -7.50000000000000e-01 +398 70 -8.33333333333333e-02 +398 409 8.33333333333333e-02 +398 396 -1.66666666666667e-01 +398 69 8.33333333333333e-02 +398 204 1.66666666666667e-01 +399 399 6.78333333333333e+01 +399 404 1.66666666666667e-01 +399 95 -8.33333333333333e-02 +399 449 8.33333333333333e-02 +399 448 -1.66666666666667e-01 +399 68 -8.33333333333333e-02 +399 403 1.66666666666667e-01 +399 402 -7.50000000000000e-01 +399 203 4.25000000000000e+00 +399 202 4.25000000000000e+00 +399 209 8.50000000000000e+00 +399 208 -4.25000000000000e+00 +399 207 -1.27500000000000e+01 +399 185 -8.33333333333333e+00 +399 389 4.16666666666667e+00 +399 184 -8.33333333333333e+00 +399 190 8.33333333333333e+00 +399 388 -8.33333333333333e+00 +399 67 4.25000000000000e+00 +399 66 -8.41666666666667e+00 +399 395 8.33333333333333e+00 +399 191 -1.66666666666667e+01 +399 394 8.33333333333333e+00 +399 400 -8.50000000000000e+00 +399 94 4.25000000000000e+00 +399 393 -3.75000000000000e+01 +399 401 -3.33333333333333e-01 +399 93 -8.41666666666667e+00 +400 400 7.60000000000000e+01 +400 404 -8.33333333333333e-02 +400 447 -1.66666666666667e-01 +400 403 -2.50000000000000e-01 +400 402 1.66666666666667e-01 +400 203 -8.50000000000000e+00 +400 68 4.25000000000000e+00 +400 201 4.25000000000000e+00 +400 209 8.50000000000000e+00 +400 401 -8.50000000000000e+00 +400 95 4.25000000000000e+00 +400 208 -1.27500000000000e+01 +400 207 -4.25000000000000e+00 +400 183 -8.33333333333333e+00 +400 189 8.33333333333333e+00 +400 389 4.16666666666667e+00 +400 185 -8.33333333333333e+00 +400 67 -2.52500000000000e+01 +400 387 -8.33333333333333e+00 +400 66 4.25000000000000e+00 +400 395 -4.16666666666667e+00 +400 191 8.33333333333333e+00 +400 394 -1.25000000000000e+01 +400 449 8.33333333333333e-02 +400 94 -2.52500000000000e+01 +400 393 8.33333333333333e+00 +400 399 -8.50000000000000e+00 +400 93 4.25000000000000e+00 +401 401 6.78333333333333e+01 +401 403 -8.33333333333333e-02 +401 399 -3.33333333333333e-01 +401 402 1.66666666666667e-01 +401 93 -8.33333333333333e-02 +401 447 8.33333333333333e-02 +401 404 -2.50000000000000e-01 +401 66 -8.33333333333333e-02 +401 201 4.25000000000000e+00 +401 202 -8.50000000000000e+00 +401 67 4.25000000000000e+00 +401 209 -3.82500000000000e+01 +401 208 8.50000000000000e+00 +401 400 -8.50000000000000e+00 +401 94 4.25000000000000e+00 +401 207 8.50000000000000e+00 +401 183 -8.33333333333333e+00 +401 387 4.16666666666667e+00 +401 68 -8.41666666666667e+00 +401 388 4.16666666666667e+00 +401 184 -8.33333333333333e+00 +401 395 -1.25000000000000e+01 +401 448 8.33333333333333e-02 +401 95 -8.41666666666667e+00 +401 394 -4.16666666666667e+00 +401 190 8.33333333333333e+00 +401 393 8.33333333333333e+00 +401 189 -1.66666666666667e+01 +402 402 2.50000000000000e+00 +402 209 -3.33333333333333e-01 +402 208 1.66666666666667e-01 +402 68 8.33333333333333e-02 +402 400 1.66666666666667e-01 +402 399 -7.50000000000000e-01 +402 449 -8.33333333333333e-02 +402 98 8.33333333333333e-02 +402 448 1.66666666666667e-01 +402 447 -2.50000000000000e-01 +402 203 -1.66666666666667e-01 +402 202 -1.66666666666667e-01 +402 206 1.66666666666667e-01 +402 398 -8.33333333333333e-02 +402 403 -3.33333333333333e-01 +402 205 1.66666666666667e-01 +402 211 -1.66666666666667e-01 +402 67 -1.66666666666667e-01 +402 397 1.66666666666667e-01 +402 396 -2.50000000000000e-01 +402 404 -3.33333333333333e-01 +402 410 1.66666666666667e-01 +402 212 3.33333333333333e-01 +402 409 1.66666666666667e-01 +402 97 -1.66666666666667e-01 +402 401 1.66666666666667e-01 +402 408 -7.50000000000000e-01 +402 210 -5.00000000000000e-01 +403 403 2.50000000000000e+00 +403 209 1.66666666666667e-01 +403 207 1.66666666666667e-01 +403 400 -2.50000000000000e-01 +403 399 1.66666666666667e-01 +403 449 1.66666666666667e-01 +403 404 -3.33333333333333e-01 +403 448 -7.50000000000000e-01 +403 447 1.66666666666667e-01 +403 201 -1.66666666666667e-01 +403 398 1.66666666666667e-01 +403 402 -3.33333333333333e-01 +403 206 -3.33333333333333e-01 +403 212 3.33333333333333e-01 +403 204 1.66666666666667e-01 +403 210 -1.66666666666667e-01 +403 68 8.33333333333333e-02 +403 203 -1.66666666666667e-01 +403 397 -7.50000000000000e-01 +403 66 -1.66666666666667e-01 +403 396 1.66666666666667e-01 +403 410 -8.33333333333333e-02 +403 98 8.33333333333333e-02 +403 401 -8.33333333333333e-02 +403 409 -2.50000000000000e-01 +403 211 -5.00000000000000e-01 +403 408 1.66666666666667e-01 +403 96 -1.66666666666667e-01 +404 404 2.50000000000000e+00 +404 208 1.66666666666667e-01 +404 399 1.66666666666667e-01 +404 207 -3.33333333333333e-01 +404 401 -2.50000000000000e-01 +404 66 8.33333333333333e-02 +404 449 -2.50000000000000e-01 +404 448 1.66666666666667e-01 +404 403 -3.33333333333333e-01 +404 447 -8.33333333333333e-02 +404 96 8.33333333333333e-02 +404 201 -1.66666666666667e-01 +404 397 1.66666666666667e-01 +404 204 1.66666666666667e-01 +404 396 -8.33333333333333e-02 +404 205 -3.33333333333333e-01 +404 211 3.33333333333333e-01 +404 398 -2.50000000000000e-01 +404 67 8.33333333333333e-02 +404 202 -1.66666666666667e-01 +404 400 -8.33333333333333e-02 +404 410 -2.50000000000000e-01 +404 212 -1.50000000000000e+00 +404 409 -8.33333333333333e-02 +404 97 8.33333333333333e-02 +404 402 -3.33333333333333e-01 +404 408 1.66666666666667e-01 +404 210 3.33333333333333e-01 +405 405 1.00000000000000e+00 +405 223 8.33333333333333e-02 +405 419 8.33333333333333e-02 +405 413 -8.33333333333333e-02 +405 71 8.33333333333333e-02 +405 224 -1.66666666666667e-01 +405 70 8.33333333333333e-02 +405 406 -1.66666666666667e-01 +405 412 1.66666666666667e-01 +405 69 -2.50000000000000e-01 +405 411 -2.50000000000000e-01 +405 407 -1.66666666666667e-01 +405 74 8.33333333333333e-02 +405 227 1.66666666666667e-01 +405 73 8.33333333333333e-02 +405 418 -1.66666666666667e-01 +405 226 -8.33333333333333e-02 +405 72 -2.50000000000000e-01 +405 225 -2.50000000000000e-01 +406 406 1.16666666666667e+00 +406 222 8.33333333333333e-02 +406 227 1.66666666666667e-01 +406 407 -3.33333333333333e-01 +406 413 1.66666666666667e-01 +406 71 -8.33333333333333e-02 +406 224 8.33333333333333e-02 +406 70 -8.33333333333333e-02 +406 412 -7.50000000000000e-01 +406 69 8.33333333333333e-02 +406 405 -1.66666666666667e-01 +406 411 1.66666666666667e-01 +406 74 -8.33333333333333e-02 +406 419 8.33333333333333e-02 +406 225 -8.33333333333333e-02 +406 73 -8.33333333333333e-02 +406 226 -2.50000000000000e-01 +406 72 8.33333333333333e-02 +406 417 -1.66666666666667e-01 +407 407 1.16666666666667e+00 +407 406 -3.33333333333333e-01 +407 412 1.66666666666667e-01 +407 417 8.33333333333333e-02 +407 411 -8.33333333333333e-02 +407 71 -8.33333333333333e-02 +407 413 -2.50000000000000e-01 +407 70 -8.33333333333333e-02 +407 223 8.33333333333333e-02 +407 69 8.33333333333333e-02 +407 222 -1.66666666666667e-01 +407 226 1.66666666666667e-01 +407 74 -8.33333333333333e-02 +407 227 -7.50000000000000e-01 +407 73 -8.33333333333333e-02 +407 418 8.33333333333333e-02 +407 405 -1.66666666666667e-01 +407 72 8.33333333333333e-02 +407 225 1.66666666666667e-01 +408 408 2.50000000000000e+00 +408 413 1.66666666666667e-01 +408 98 -8.33333333333333e-02 +408 452 8.33333333333333e-02 +408 451 -1.66666666666667e-01 +408 71 -8.33333333333333e-02 +408 412 1.66666666666667e-01 +408 411 -7.50000000000000e-01 +408 224 1.66666666666667e-01 +408 223 1.66666666666667e-01 +408 230 3.33333333333333e-01 +408 229 -1.66666666666667e-01 +408 228 -5.00000000000000e-01 +408 206 -1.66666666666667e-01 +408 398 8.33333333333333e-02 +408 205 -1.66666666666667e-01 +408 211 1.66666666666667e-01 +408 397 -1.66666666666667e-01 +408 70 1.66666666666667e-01 +408 69 -2.50000000000000e-01 +408 404 1.66666666666667e-01 +408 212 -3.33333333333333e-01 +408 403 1.66666666666667e-01 +408 409 -3.33333333333333e-01 +408 97 1.66666666666667e-01 +408 402 -7.50000000000000e-01 +408 410 -3.33333333333333e-01 +408 96 -2.50000000000000e-01 +409 409 2.50000000000000e+00 +409 413 -8.33333333333333e-02 +409 450 -1.66666666666667e-01 +409 412 -2.50000000000000e-01 +409 411 1.66666666666667e-01 +409 224 -3.33333333333333e-01 +409 71 1.66666666666667e-01 +409 222 1.66666666666667e-01 +409 230 3.33333333333333e-01 +409 410 -3.33333333333333e-01 +409 98 1.66666666666667e-01 +409 229 -5.00000000000000e-01 +409 228 -1.66666666666667e-01 +409 204 -1.66666666666667e-01 +409 210 1.66666666666667e-01 +409 398 8.33333333333333e-02 +409 206 -1.66666666666667e-01 +409 70 -7.50000000000000e-01 +409 396 -1.66666666666667e-01 +409 69 1.66666666666667e-01 +409 404 -8.33333333333333e-02 +409 212 1.66666666666667e-01 +409 403 -2.50000000000000e-01 +409 452 8.33333333333333e-02 +409 97 -7.50000000000000e-01 +409 402 1.66666666666667e-01 +409 408 -3.33333333333333e-01 +409 96 1.66666666666667e-01 +410 410 2.50000000000000e+00 +410 412 -8.33333333333333e-02 +410 408 -3.33333333333333e-01 +410 411 1.66666666666667e-01 +410 96 -8.33333333333333e-02 +410 450 8.33333333333333e-02 +410 413 -2.50000000000000e-01 +410 69 -8.33333333333333e-02 +410 222 1.66666666666667e-01 +410 223 -3.33333333333333e-01 +410 70 1.66666666666667e-01 +410 230 -1.50000000000000e+00 +410 229 3.33333333333333e-01 +410 409 -3.33333333333333e-01 +410 97 1.66666666666667e-01 +410 228 3.33333333333333e-01 +410 204 -1.66666666666667e-01 +410 396 8.33333333333333e-02 +410 71 -2.50000000000000e-01 +410 397 8.33333333333333e-02 +410 205 -1.66666666666667e-01 +410 404 -2.50000000000000e-01 +410 451 8.33333333333333e-02 +410 98 -2.50000000000000e-01 +410 403 -8.33333333333333e-02 +410 211 1.66666666666667e-01 +410 402 1.66666666666667e-01 +410 210 -3.33333333333333e-01 +411 411 2.50000000000000e+00 +411 230 -3.33333333333333e-01 +411 229 1.66666666666667e-01 +411 71 8.33333333333333e-02 +411 409 1.66666666666667e-01 +411 408 -7.50000000000000e-01 +411 452 -8.33333333333333e-02 +411 101 8.33333333333333e-02 +411 451 1.66666666666667e-01 +411 450 -2.50000000000000e-01 +411 224 -1.66666666666667e-01 +411 223 -1.66666666666667e-01 +411 227 1.66666666666667e-01 +411 407 -8.33333333333333e-02 +411 412 -3.33333333333333e-01 +411 226 1.66666666666667e-01 +411 232 -1.66666666666667e-01 +411 70 -1.66666666666667e-01 +411 406 1.66666666666667e-01 +411 405 -2.50000000000000e-01 +411 413 -3.33333333333333e-01 +411 419 1.66666666666667e-01 +411 233 3.33333333333333e-01 +411 418 1.66666666666667e-01 +411 100 -1.66666666666667e-01 +411 410 1.66666666666667e-01 +411 417 -7.50000000000000e-01 +411 231 -5.00000000000000e-01 +412 412 2.50000000000000e+00 +412 230 1.66666666666667e-01 +412 228 1.66666666666667e-01 +412 409 -2.50000000000000e-01 +412 408 1.66666666666667e-01 +412 452 1.66666666666667e-01 +412 413 -3.33333333333333e-01 +412 451 -7.50000000000000e-01 +412 450 1.66666666666667e-01 +412 222 -1.66666666666667e-01 +412 407 1.66666666666667e-01 +412 411 -3.33333333333333e-01 +412 227 -3.33333333333333e-01 +412 233 3.33333333333333e-01 +412 225 1.66666666666667e-01 +412 231 -1.66666666666667e-01 +412 71 8.33333333333333e-02 +412 224 -1.66666666666667e-01 +412 406 -7.50000000000000e-01 +412 69 -1.66666666666667e-01 +412 405 1.66666666666667e-01 +412 419 -8.33333333333333e-02 +412 101 8.33333333333333e-02 +412 410 -8.33333333333333e-02 +412 418 -2.50000000000000e-01 +412 232 -5.00000000000000e-01 +412 417 1.66666666666667e-01 +412 99 -1.66666666666667e-01 +413 413 2.50000000000000e+00 +413 229 1.66666666666667e-01 +413 408 1.66666666666667e-01 +413 228 -3.33333333333333e-01 +413 410 -2.50000000000000e-01 +413 69 8.33333333333333e-02 +413 452 -2.50000000000000e-01 +413 451 1.66666666666667e-01 +413 412 -3.33333333333333e-01 +413 450 -8.33333333333333e-02 +413 99 8.33333333333333e-02 +413 222 -1.66666666666667e-01 +413 406 1.66666666666667e-01 +413 225 1.66666666666667e-01 +413 405 -8.33333333333333e-02 +413 226 -3.33333333333333e-01 +413 232 3.33333333333333e-01 +413 407 -2.50000000000000e-01 +413 70 8.33333333333333e-02 +413 223 -1.66666666666667e-01 +413 409 -8.33333333333333e-02 +413 419 -2.50000000000000e-01 +413 233 -1.50000000000000e+00 +413 418 -8.33333333333333e-02 +413 100 8.33333333333333e-02 +413 411 -3.33333333333333e-01 +413 417 1.66666666666667e-01 +413 231 3.33333333333333e-01 +414 414 1.00000000000000e+00 +414 244 8.33333333333333e-02 +414 428 8.33333333333333e-02 +414 422 -8.33333333333333e-02 +414 74 8.33333333333333e-02 +414 245 -1.66666666666667e-01 +414 73 8.33333333333333e-02 +414 415 -1.66666666666667e-01 +414 421 1.66666666666667e-01 +414 72 -2.50000000000000e-01 +414 420 -2.50000000000000e-01 +414 416 -1.66666666666667e-01 +414 77 8.33333333333333e-02 +414 248 1.66666666666667e-01 +414 76 8.33333333333333e-02 +414 427 -1.66666666666667e-01 +414 247 -8.33333333333333e-02 +414 75 -2.50000000000000e-01 +414 246 -2.50000000000000e-01 +415 415 1.16666666666667e+00 +415 243 8.33333333333333e-02 +415 248 1.66666666666667e-01 +415 416 -3.33333333333333e-01 +415 422 1.66666666666667e-01 +415 74 -8.33333333333333e-02 +415 245 8.33333333333333e-02 +415 73 -8.33333333333333e-02 +415 421 -7.50000000000000e-01 +415 72 8.33333333333333e-02 +415 414 -1.66666666666667e-01 +415 420 1.66666666666667e-01 +415 77 -8.33333333333333e-02 +415 428 8.33333333333333e-02 +415 246 -8.33333333333333e-02 +415 76 -8.33333333333333e-02 +415 247 -2.50000000000000e-01 +415 75 8.33333333333333e-02 +415 426 -1.66666666666667e-01 +416 416 1.16666666666667e+00 +416 415 -3.33333333333333e-01 +416 421 1.66666666666667e-01 +416 426 8.33333333333333e-02 +416 420 -8.33333333333333e-02 +416 74 -8.33333333333333e-02 +416 422 -2.50000000000000e-01 +416 73 -8.33333333333333e-02 +416 244 8.33333333333333e-02 +416 72 8.33333333333333e-02 +416 243 -1.66666666666667e-01 +416 247 1.66666666666667e-01 +416 77 -8.33333333333333e-02 +416 248 -7.50000000000000e-01 +416 76 -8.33333333333333e-02 +416 427 8.33333333333333e-02 +416 414 -1.66666666666667e-01 +416 75 8.33333333333333e-02 +416 246 1.66666666666667e-01 +417 417 2.50000000000000e+00 +417 422 1.66666666666667e-01 +417 101 -8.33333333333333e-02 +417 455 8.33333333333333e-02 +417 454 -1.66666666666667e-01 +417 74 -8.33333333333333e-02 +417 421 1.66666666666667e-01 +417 420 -7.50000000000000e-01 +417 245 1.66666666666667e-01 +417 244 1.66666666666667e-01 +417 251 3.33333333333333e-01 +417 250 -1.66666666666667e-01 +417 249 -5.00000000000000e-01 +417 227 -1.66666666666667e-01 +417 407 8.33333333333333e-02 +417 226 -1.66666666666667e-01 +417 232 1.66666666666667e-01 +417 406 -1.66666666666667e-01 +417 73 1.66666666666667e-01 +417 72 -2.50000000000000e-01 +417 413 1.66666666666667e-01 +417 233 -3.33333333333333e-01 +417 412 1.66666666666667e-01 +417 418 -3.33333333333333e-01 +417 100 1.66666666666667e-01 +417 411 -7.50000000000000e-01 +417 419 -3.33333333333333e-01 +417 99 -2.50000000000000e-01 +418 418 2.50000000000000e+00 +418 422 -8.33333333333333e-02 +418 453 -1.66666666666667e-01 +418 421 -2.50000000000000e-01 +418 420 1.66666666666667e-01 +418 245 -3.33333333333333e-01 +418 74 1.66666666666667e-01 +418 243 1.66666666666667e-01 +418 251 3.33333333333333e-01 +418 419 -3.33333333333333e-01 +418 101 1.66666666666667e-01 +418 250 -5.00000000000000e-01 +418 249 -1.66666666666667e-01 +418 225 -1.66666666666667e-01 +418 231 1.66666666666667e-01 +418 407 8.33333333333333e-02 +418 227 -1.66666666666667e-01 +418 73 -7.50000000000000e-01 +418 405 -1.66666666666667e-01 +418 72 1.66666666666667e-01 +418 413 -8.33333333333333e-02 +418 233 1.66666666666667e-01 +418 412 -2.50000000000000e-01 +418 455 8.33333333333333e-02 +418 100 -7.50000000000000e-01 +418 411 1.66666666666667e-01 +418 417 -3.33333333333333e-01 +418 99 1.66666666666667e-01 +419 419 2.50000000000000e+00 +419 421 -8.33333333333333e-02 +419 417 -3.33333333333333e-01 +419 420 1.66666666666667e-01 +419 99 -8.33333333333333e-02 +419 453 8.33333333333333e-02 +419 422 -2.50000000000000e-01 +419 72 -8.33333333333333e-02 +419 243 1.66666666666667e-01 +419 244 -3.33333333333333e-01 +419 73 1.66666666666667e-01 +419 251 -1.50000000000000e+00 +419 250 3.33333333333333e-01 +419 418 -3.33333333333333e-01 +419 100 1.66666666666667e-01 +419 249 3.33333333333333e-01 +419 225 -1.66666666666667e-01 +419 405 8.33333333333333e-02 +419 74 -2.50000000000000e-01 +419 406 8.33333333333333e-02 +419 226 -1.66666666666667e-01 +419 413 -2.50000000000000e-01 +419 454 8.33333333333333e-02 +419 101 -2.50000000000000e-01 +419 412 -8.33333333333333e-02 +419 232 1.66666666666667e-01 +419 411 1.66666666666667e-01 +419 231 -3.33333333333333e-01 +420 420 2.50000000000000e+00 +420 251 -3.33333333333333e-01 +420 250 1.66666666666667e-01 +420 74 8.33333333333333e-02 +420 418 1.66666666666667e-01 +420 417 -7.50000000000000e-01 +420 455 -8.33333333333333e-02 +420 104 8.33333333333333e-02 +420 454 1.66666666666667e-01 +420 453 -2.50000000000000e-01 +420 245 -1.66666666666667e-01 +420 244 -1.66666666666667e-01 +420 248 1.66666666666667e-01 +420 416 -8.33333333333333e-02 +420 421 -3.33333333333333e-01 +420 247 1.66666666666667e-01 +420 253 -1.66666666666667e-01 +420 73 -1.66666666666667e-01 +420 415 1.66666666666667e-01 +420 414 -2.50000000000000e-01 +420 422 -3.33333333333333e-01 +420 428 1.66666666666667e-01 +420 254 3.33333333333333e-01 +420 427 1.66666666666667e-01 +420 103 -1.66666666666667e-01 +420 419 1.66666666666667e-01 +420 426 -7.50000000000000e-01 +420 252 -5.00000000000000e-01 +421 421 2.50000000000000e+00 +421 251 1.66666666666667e-01 +421 249 1.66666666666667e-01 +421 418 -2.50000000000000e-01 +421 417 1.66666666666667e-01 +421 455 1.66666666666667e-01 +421 422 -3.33333333333333e-01 +421 454 -7.50000000000000e-01 +421 453 1.66666666666667e-01 +421 243 -1.66666666666667e-01 +421 416 1.66666666666667e-01 +421 420 -3.33333333333333e-01 +421 248 -3.33333333333333e-01 +421 254 3.33333333333333e-01 +421 246 1.66666666666667e-01 +421 252 -1.66666666666667e-01 +421 74 8.33333333333333e-02 +421 245 -1.66666666666667e-01 +421 415 -7.50000000000000e-01 +421 72 -1.66666666666667e-01 +421 414 1.66666666666667e-01 +421 428 -8.33333333333333e-02 +421 104 8.33333333333333e-02 +421 419 -8.33333333333333e-02 +421 427 -2.50000000000000e-01 +421 253 -5.00000000000000e-01 +421 426 1.66666666666667e-01 +421 102 -1.66666666666667e-01 +422 422 2.50000000000000e+00 +422 250 1.66666666666667e-01 +422 417 1.66666666666667e-01 +422 249 -3.33333333333333e-01 +422 419 -2.50000000000000e-01 +422 72 8.33333333333333e-02 +422 455 -2.50000000000000e-01 +422 454 1.66666666666667e-01 +422 421 -3.33333333333333e-01 +422 453 -8.33333333333333e-02 +422 102 8.33333333333333e-02 +422 243 -1.66666666666667e-01 +422 415 1.66666666666667e-01 +422 246 1.66666666666667e-01 +422 414 -8.33333333333333e-02 +422 247 -3.33333333333333e-01 +422 253 3.33333333333333e-01 +422 416 -2.50000000000000e-01 +422 73 8.33333333333333e-02 +422 244 -1.66666666666667e-01 +422 418 -8.33333333333333e-02 +422 428 -2.50000000000000e-01 +422 254 -1.50000000000000e+00 +422 427 -8.33333333333333e-02 +422 103 8.33333333333333e-02 +422 420 -3.33333333333333e-01 +422 426 1.66666666666667e-01 +422 252 3.33333333333333e-01 +423 423 1.00000000000000e+00 +423 265 8.33333333333333e-02 +423 434 8.33333333333333e-02 +423 431 -8.33333333333333e-02 +423 77 8.33333333333333e-02 +423 266 -1.66666666666667e-01 +423 76 8.33333333333333e-02 +423 424 -1.66666666666667e-01 +423 430 1.66666666666667e-01 +423 75 -2.50000000000000e-01 +423 429 -2.50000000000000e-01 +423 425 -1.66666666666667e-01 +423 80 8.33333333333333e-02 +423 269 1.66666666666667e-01 +423 79 8.33333333333333e-02 +423 433 -1.66666666666667e-01 +423 268 -8.33333333333333e-02 +423 78 -2.50000000000000e-01 +423 267 -2.50000000000000e-01 +424 424 1.16666666666667e+00 +424 264 8.33333333333333e-02 +424 269 1.66666666666667e-01 +424 425 -3.33333333333333e-01 +424 431 1.66666666666667e-01 +424 77 -8.33333333333333e-02 +424 266 8.33333333333333e-02 +424 76 -8.33333333333333e-02 +424 430 -7.50000000000000e-01 +424 75 8.33333333333333e-02 +424 423 -1.66666666666667e-01 +424 429 1.66666666666667e-01 +424 80 -8.33333333333333e-02 +424 434 8.33333333333333e-02 +424 267 -8.33333333333333e-02 +424 79 -8.33333333333333e-02 +424 268 -2.50000000000000e-01 +424 78 8.33333333333333e-02 +424 432 -1.66666666666667e-01 +425 425 1.16666666666667e+00 +425 424 -3.33333333333333e-01 +425 430 1.66666666666667e-01 +425 432 8.33333333333333e-02 +425 429 -8.33333333333333e-02 +425 77 -8.33333333333333e-02 +425 431 -2.50000000000000e-01 +425 76 -8.33333333333333e-02 +425 265 8.33333333333333e-02 +425 75 8.33333333333333e-02 +425 264 -1.66666666666667e-01 +425 268 1.66666666666667e-01 +425 80 -8.33333333333333e-02 +425 269 -7.50000000000000e-01 +425 79 -8.33333333333333e-02 +425 433 8.33333333333333e-02 +425 423 -1.66666666666667e-01 +425 78 8.33333333333333e-02 +425 267 1.66666666666667e-01 +426 426 2.50000000000000e+00 +426 431 1.66666666666667e-01 +426 104 -8.33333333333333e-02 +426 458 8.33333333333333e-02 +426 457 -1.66666666666667e-01 +426 77 -8.33333333333333e-02 +426 430 1.66666666666667e-01 +426 429 -7.50000000000000e-01 +426 266 1.66666666666667e-01 +426 265 1.66666666666667e-01 +426 272 3.33333333333333e-01 +426 271 -1.66666666666667e-01 +426 270 -5.00000000000000e-01 +426 248 -1.66666666666667e-01 +426 416 8.33333333333333e-02 +426 247 -1.66666666666667e-01 +426 253 1.66666666666667e-01 +426 415 -1.66666666666667e-01 +426 76 1.66666666666667e-01 +426 75 -2.50000000000000e-01 +426 422 1.66666666666667e-01 +426 254 -3.33333333333333e-01 +426 421 1.66666666666667e-01 +426 427 -3.33333333333333e-01 +426 103 1.66666666666667e-01 +426 420 -7.50000000000000e-01 +426 428 -3.33333333333333e-01 +426 102 -2.50000000000000e-01 +427 427 2.50000000000000e+00 +427 431 -8.33333333333333e-02 +427 456 -1.66666666666667e-01 +427 430 -2.50000000000000e-01 +427 429 1.66666666666667e-01 +427 266 -3.33333333333333e-01 +427 77 1.66666666666667e-01 +427 264 1.66666666666667e-01 +427 272 3.33333333333333e-01 +427 428 -3.33333333333333e-01 +427 104 1.66666666666667e-01 +427 271 -5.00000000000000e-01 +427 270 -1.66666666666667e-01 +427 246 -1.66666666666667e-01 +427 252 1.66666666666667e-01 +427 416 8.33333333333333e-02 +427 248 -1.66666666666667e-01 +427 76 -7.50000000000000e-01 +427 414 -1.66666666666667e-01 +427 75 1.66666666666667e-01 +427 422 -8.33333333333333e-02 +427 254 1.66666666666667e-01 +427 421 -2.50000000000000e-01 +427 458 8.33333333333333e-02 +427 103 -7.50000000000000e-01 +427 420 1.66666666666667e-01 +427 426 -3.33333333333333e-01 +427 102 1.66666666666667e-01 +428 428 2.50000000000000e+00 +428 430 -8.33333333333333e-02 +428 426 -3.33333333333333e-01 +428 429 1.66666666666667e-01 +428 102 -8.33333333333333e-02 +428 456 8.33333333333333e-02 +428 431 -2.50000000000000e-01 +428 75 -8.33333333333333e-02 +428 264 1.66666666666667e-01 +428 265 -3.33333333333333e-01 +428 76 1.66666666666667e-01 +428 272 -1.50000000000000e+00 +428 271 3.33333333333333e-01 +428 427 -3.33333333333333e-01 +428 103 1.66666666666667e-01 +428 270 3.33333333333333e-01 +428 246 -1.66666666666667e-01 +428 414 8.33333333333333e-02 +428 77 -2.50000000000000e-01 +428 415 8.33333333333333e-02 +428 247 -1.66666666666667e-01 +428 422 -2.50000000000000e-01 +428 457 8.33333333333333e-02 +428 104 -2.50000000000000e-01 +428 421 -8.33333333333333e-02 +428 253 1.66666666666667e-01 +428 420 1.66666666666667e-01 +428 252 -3.33333333333333e-01 +429 429 2.50000000000000e+00 +429 272 -3.33333333333333e-01 +429 271 1.66666666666667e-01 +429 77 8.33333333333333e-02 +429 427 1.66666666666667e-01 +429 426 -7.50000000000000e-01 +429 458 -8.33333333333333e-02 +429 107 8.33333333333333e-02 +429 457 1.66666666666667e-01 +429 456 -2.50000000000000e-01 +429 266 -1.66666666666667e-01 +429 265 -1.66666666666667e-01 +429 269 1.66666666666667e-01 +429 425 -8.33333333333333e-02 +429 430 -3.33333333333333e-01 +429 268 1.66666666666667e-01 +429 274 -1.66666666666667e-01 +429 76 -1.66666666666667e-01 +429 424 1.66666666666667e-01 +429 423 -2.50000000000000e-01 +429 431 -3.33333333333333e-01 +429 434 1.66666666666667e-01 +429 275 3.33333333333333e-01 +429 433 1.66666666666667e-01 +429 106 -1.66666666666667e-01 +429 428 1.66666666666667e-01 +429 432 -7.50000000000000e-01 +429 273 -5.00000000000000e-01 +430 430 2.50000000000000e+00 +430 272 1.66666666666667e-01 +430 270 1.66666666666667e-01 +430 427 -2.50000000000000e-01 +430 426 1.66666666666667e-01 +430 458 1.66666666666667e-01 +430 431 -3.33333333333333e-01 +430 457 -7.50000000000000e-01 +430 456 1.66666666666667e-01 +430 264 -1.66666666666667e-01 +430 425 1.66666666666667e-01 +430 429 -3.33333333333333e-01 +430 269 -3.33333333333333e-01 +430 275 3.33333333333333e-01 +430 267 1.66666666666667e-01 +430 273 -1.66666666666667e-01 +430 77 8.33333333333333e-02 +430 266 -1.66666666666667e-01 +430 424 -7.50000000000000e-01 +430 75 -1.66666666666667e-01 +430 423 1.66666666666667e-01 +430 434 -8.33333333333333e-02 +430 107 8.33333333333333e-02 +430 428 -8.33333333333333e-02 +430 433 -2.50000000000000e-01 +430 274 -5.00000000000000e-01 +430 432 1.66666666666667e-01 +430 105 -1.66666666666667e-01 +431 431 2.50000000000000e+00 +431 271 1.66666666666667e-01 +431 426 1.66666666666667e-01 +431 270 -3.33333333333333e-01 +431 428 -2.50000000000000e-01 +431 75 8.33333333333333e-02 +431 458 -2.50000000000000e-01 +431 457 1.66666666666667e-01 +431 430 -3.33333333333333e-01 +431 456 -8.33333333333333e-02 +431 105 8.33333333333333e-02 +431 264 -1.66666666666667e-01 +431 424 1.66666666666667e-01 +431 267 1.66666666666667e-01 +431 423 -8.33333333333333e-02 +431 268 -3.33333333333333e-01 +431 274 3.33333333333333e-01 +431 425 -2.50000000000000e-01 +431 76 8.33333333333333e-02 +431 265 -1.66666666666667e-01 +431 427 -8.33333333333333e-02 +431 434 -2.50000000000000e-01 +431 275 -1.50000000000000e+00 +431 433 -8.33333333333333e-02 +431 106 8.33333333333333e-02 +431 429 -3.33333333333333e-01 +431 432 1.66666666666667e-01 +431 273 3.33333333333333e-01 +432 432 1.33333333333333e+00 +432 280 8.33333333333333e-02 +432 284 1.66666666666667e-01 +432 283 -8.33333333333333e-02 +432 282 -2.50000000000000e-01 +432 269 -1.66666666666667e-01 +432 425 8.33333333333333e-02 +432 268 -1.66666666666667e-01 +432 274 1.66666666666667e-01 +432 424 -1.66666666666667e-01 +432 79 8.33333333333333e-02 +432 78 -1.66666666666667e-01 +432 431 1.66666666666667e-01 +432 275 -3.33333333333333e-01 +432 430 1.66666666666667e-01 +432 433 -1.66666666666667e-01 +432 106 8.33333333333333e-02 +432 429 -7.50000000000000e-01 +432 281 8.33333333333333e-02 +432 105 -1.66666666666667e-01 +433 433 1.50000000000000e+00 +433 80 8.33333333333333e-02 +433 279 8.33333333333333e-02 +433 284 1.66666666666667e-01 +433 434 -1.66666666666667e-01 +433 107 8.33333333333333e-02 +433 283 -2.50000000000000e-01 +433 282 -8.33333333333333e-02 +433 267 -1.66666666666667e-01 +433 273 1.66666666666667e-01 +433 425 8.33333333333333e-02 +433 269 -1.66666666666667e-01 +433 79 -5.00000000000000e-01 +433 423 -1.66666666666667e-01 +433 78 8.33333333333333e-02 +433 431 -8.33333333333333e-02 +433 275 1.66666666666667e-01 +433 430 -2.50000000000000e-01 +433 281 -1.66666666666667e-01 +433 106 -5.00000000000000e-01 +433 429 1.66666666666667e-01 +433 432 -1.66666666666667e-01 +433 105 8.33333333333333e-02 +434 434 1.33333333333333e+00 +434 280 -1.66666666666667e-01 +434 79 8.33333333333333e-02 +434 284 -7.50000000000000e-01 +434 283 1.66666666666667e-01 +434 433 -1.66666666666667e-01 +434 106 8.33333333333333e-02 +434 282 1.66666666666667e-01 +434 267 -1.66666666666667e-01 +434 423 8.33333333333333e-02 +434 80 -1.66666666666667e-01 +434 424 8.33333333333333e-02 +434 268 -1.66666666666667e-01 +434 431 -2.50000000000000e-01 +434 279 8.33333333333333e-02 +434 107 -1.66666666666667e-01 +434 430 -8.33333333333333e-02 +434 274 1.66666666666667e-01 +434 429 1.66666666666667e-01 +434 273 -3.33333333333333e-01 +435 435 7.50000000000000e+01 +435 290 0.00000000000000e+00 +435 289 0.00000000000000e+00 +435 437 -8.33333333333333e+00 +435 293 8.33333333333333e+00 +435 86 4.16666666666667e+00 +435 292 -4.16666666666667e+00 +435 291 -1.25000000000000e+01 +435 124 0.00000000000000e+00 +435 127 8.33333333333333e+00 +435 365 0.00000000000000e+00 +435 125 0.00000000000000e+00 +435 82 0.00000000000000e+00 +435 364 0.00000000000000e+00 +435 81 0.00000000000000e+00 +435 368 -4.16666666666667e+00 +435 128 8.33333333333333e+00 +435 436 -8.33333333333333e+00 +435 367 8.33333333333333e+00 +435 85 4.16666666666667e+00 +435 83 0.00000000000000e+00 +435 366 -1.25000000000000e+01 +435 84 -2.50000000000000e+01 +436 436 6.66666666666667e+01 +436 288 0.00000000000000e+00 +436 293 8.33333333333333e+00 +436 292 -1.25000000000000e+01 +436 291 -4.16666666666667e+00 +436 365 0.00000000000000e+00 +436 125 0.00000000000000e+00 +436 123 0.00000000000000e+00 +436 126 8.33333333333333e+00 +436 82 0.00000000000000e+00 +436 81 0.00000000000000e+00 +436 363 0.00000000000000e+00 +436 368 8.33333333333333e+00 +436 128 -1.66666666666667e+01 +436 290 0.00000000000000e+00 +436 367 -3.75000000000000e+01 +436 85 -8.33333333333333e+00 +436 435 -8.33333333333333e+00 +436 366 8.33333333333333e+00 +436 84 4.16666666666667e+00 +437 437 6.66666666666667e+01 +437 81 0.00000000000000e+00 +437 288 0.00000000000000e+00 +437 293 -3.75000000000000e+01 +437 292 8.33333333333333e+00 +437 435 -8.33333333333333e+00 +437 291 8.33333333333333e+00 +437 84 4.16666666666667e+00 +437 364 0.00000000000000e+00 +437 124 0.00000000000000e+00 +437 83 0.00000000000000e+00 +437 363 0.00000000000000e+00 +437 123 0.00000000000000e+00 +437 289 0.00000000000000e+00 +437 368 -1.25000000000000e+01 +437 86 -8.33333333333333e+00 +437 367 8.33333333333333e+00 +437 127 -1.66666666666667e+01 +437 366 -4.16666666666667e+00 +437 126 8.33333333333333e+00 +438 438 7.50000000000000e+01 +438 299 -8.33333333333333e+00 +438 298 4.16666666666667e+00 +438 440 -8.33333333333333e+00 +438 302 8.33333333333333e+00 +438 89 4.16666666666667e+00 +438 301 -4.16666666666667e+00 +438 300 -1.25000000000000e+01 +438 145 -8.33333333333333e+00 +438 148 8.33333333333333e+00 +438 374 4.16666666666667e+00 +438 146 -8.33333333333333e+00 +438 85 4.16666666666667e+00 +438 373 -8.33333333333333e+00 +438 84 -2.50000000000000e+01 +438 377 -4.16666666666667e+00 +438 149 8.33333333333333e+00 +438 439 -8.33333333333333e+00 +438 376 8.33333333333333e+00 +438 88 4.16666666666667e+00 +438 86 4.16666666666667e+00 +438 375 -1.25000000000000e+01 +438 87 -2.50000000000000e+01 +439 439 6.66666666666667e+01 +439 297 4.16666666666667e+00 +439 302 8.33333333333333e+00 +439 301 -1.25000000000000e+01 +439 300 -4.16666666666667e+00 +439 374 4.16666666666667e+00 +439 146 -8.33333333333333e+00 +439 144 -8.33333333333333e+00 +439 147 8.33333333333333e+00 +439 85 -8.33333333333333e+00 +439 84 4.16666666666667e+00 +439 372 -8.33333333333333e+00 +439 377 8.33333333333333e+00 +439 149 -1.66666666666667e+01 +439 299 4.16666666666667e+00 +439 376 -3.75000000000000e+01 +439 88 -8.33333333333333e+00 +439 438 -8.33333333333333e+00 +439 375 8.33333333333333e+00 +439 87 4.16666666666667e+00 +440 440 6.66666666666667e+01 +440 84 4.16666666666667e+00 +440 297 -8.33333333333333e+00 +440 302 -3.75000000000000e+01 +440 301 8.33333333333333e+00 +440 438 -8.33333333333333e+00 +440 300 8.33333333333333e+00 +440 87 4.16666666666667e+00 +440 373 4.16666666666667e+00 +440 145 -8.33333333333333e+00 +440 86 -8.33333333333333e+00 +440 372 4.16666666666667e+00 +440 144 -8.33333333333333e+00 +440 298 4.16666666666667e+00 +440 377 -1.25000000000000e+01 +440 89 -8.33333333333333e+00 +440 376 8.33333333333333e+00 +440 148 -1.66666666666667e+01 +440 375 -4.16666666666667e+00 +440 147 8.33333333333333e+00 +441 441 7.50000000000000e+01 +441 308 -8.33333333333333e+00 +441 307 4.16666666666667e+00 +441 443 -8.33333333333333e+00 +441 311 8.33333333333333e+00 +441 92 4.16666666666667e+00 +441 310 -4.16666666666667e+00 +441 309 -1.25000000000000e+01 +441 166 -8.33333333333333e+00 +441 169 8.33333333333333e+00 +441 383 4.16666666666667e+00 +441 167 -8.33333333333333e+00 +441 88 4.16666666666667e+00 +441 382 -8.33333333333333e+00 +441 87 -2.50000000000000e+01 +441 386 -4.16666666666667e+00 +441 170 8.33333333333333e+00 +441 442 -8.33333333333333e+00 +441 385 8.33333333333333e+00 +441 91 4.16666666666667e+00 +441 89 4.16666666666667e+00 +441 384 -1.25000000000000e+01 +441 90 -2.50000000000000e+01 +442 442 6.66666666666667e+01 +442 306 4.16666666666667e+00 +442 311 8.33333333333333e+00 +442 310 -1.25000000000000e+01 +442 309 -4.16666666666667e+00 +442 383 4.16666666666667e+00 +442 167 -8.33333333333333e+00 +442 165 -8.33333333333333e+00 +442 168 8.33333333333333e+00 +442 88 -8.33333333333333e+00 +442 87 4.16666666666667e+00 +442 381 -8.33333333333333e+00 +442 386 8.33333333333333e+00 +442 170 -1.66666666666667e+01 +442 308 4.16666666666667e+00 +442 385 -3.75000000000000e+01 +442 91 -8.33333333333333e+00 +442 441 -8.33333333333333e+00 +442 384 8.33333333333333e+00 +442 90 4.16666666666667e+00 +443 443 6.66666666666667e+01 +443 87 4.16666666666667e+00 +443 306 -8.33333333333333e+00 +443 311 -3.75000000000000e+01 +443 310 8.33333333333333e+00 +443 441 -8.33333333333333e+00 +443 309 8.33333333333333e+00 +443 90 4.16666666666667e+00 +443 382 4.16666666666667e+00 +443 166 -8.33333333333333e+00 +443 89 -8.33333333333333e+00 +443 381 4.16666666666667e+00 +443 165 -8.33333333333333e+00 +443 307 4.16666666666667e+00 +443 386 -1.25000000000000e+01 +443 92 -8.33333333333333e+00 +443 385 8.33333333333333e+00 +443 169 -1.66666666666667e+01 +443 384 -4.16666666666667e+00 +443 168 8.33333333333333e+00 +444 444 7.50000000000000e+01 +444 317 -8.33333333333333e+00 +444 316 4.16666666666667e+00 +444 446 -8.33333333333333e+00 +444 320 8.33333333333333e+00 +444 95 4.16666666666667e+00 +444 319 -4.16666666666667e+00 +444 318 -1.25000000000000e+01 +444 187 -8.33333333333333e+00 +444 190 8.33333333333333e+00 +444 392 4.16666666666667e+00 +444 188 -8.33333333333333e+00 +444 91 4.16666666666667e+00 +444 391 -8.33333333333333e+00 +444 90 -2.50000000000000e+01 +444 395 -4.16666666666667e+00 +444 191 8.33333333333333e+00 +444 445 -8.33333333333333e+00 +444 394 8.33333333333333e+00 +444 94 4.16666666666667e+00 +444 92 4.16666666666667e+00 +444 393 -1.25000000000000e+01 +444 93 -2.50000000000000e+01 +445 445 6.66666666666667e+01 +445 315 4.16666666666667e+00 +445 320 8.33333333333333e+00 +445 319 -1.25000000000000e+01 +445 318 -4.16666666666667e+00 +445 392 4.16666666666667e+00 +445 188 -8.33333333333333e+00 +445 186 -8.33333333333333e+00 +445 189 8.33333333333333e+00 +445 91 -8.33333333333333e+00 +445 90 4.16666666666667e+00 +445 390 -8.33333333333333e+00 +445 395 8.33333333333333e+00 +445 191 -1.66666666666667e+01 +445 317 4.16666666666667e+00 +445 394 -3.75000000000000e+01 +445 94 -8.33333333333333e+00 +445 444 -8.33333333333333e+00 +445 393 8.33333333333333e+00 +445 93 4.16666666666667e+00 +446 446 6.66666666666667e+01 +446 90 4.16666666666667e+00 +446 315 -8.33333333333333e+00 +446 320 -3.75000000000000e+01 +446 319 8.33333333333333e+00 +446 444 -8.33333333333333e+00 +446 318 8.33333333333333e+00 +446 93 4.16666666666667e+00 +446 391 4.16666666666667e+00 +446 187 -8.33333333333333e+00 +446 92 -8.33333333333333e+00 +446 390 4.16666666666667e+00 +446 186 -8.33333333333333e+00 +446 316 4.16666666666667e+00 +446 395 -1.25000000000000e+01 +446 95 -8.33333333333333e+00 +446 394 8.33333333333333e+00 +446 190 -1.66666666666667e+01 +446 393 -4.16666666666667e+00 +446 189 8.33333333333333e+00 +447 447 1.50000000000000e+00 +447 326 -1.66666666666667e-01 +447 325 8.33333333333333e-02 +447 449 -1.66666666666667e-01 +447 329 1.66666666666667e-01 +447 98 8.33333333333333e-02 +447 328 -8.33333333333333e-02 +447 327 -2.50000000000000e-01 +447 208 -1.66666666666667e-01 +447 211 1.66666666666667e-01 +447 401 8.33333333333333e-02 +447 209 -1.66666666666667e-01 +447 94 8.33333333333333e-02 +447 400 -1.66666666666667e-01 +447 93 -5.00000000000000e-01 +447 404 -8.33333333333333e-02 +447 212 1.66666666666667e-01 +447 448 -1.66666666666667e-01 +447 403 1.66666666666667e-01 +447 97 8.33333333333333e-02 +447 95 8.33333333333333e-02 +447 402 -2.50000000000000e-01 +447 96 -5.00000000000000e-01 +448 448 1.33333333333333e+00 +448 324 8.33333333333333e-02 +448 329 1.66666666666667e-01 +448 328 -2.50000000000000e-01 +448 327 -8.33333333333333e-02 +448 401 8.33333333333333e-02 +448 209 -1.66666666666667e-01 +448 207 -1.66666666666667e-01 +448 210 1.66666666666667e-01 +448 94 -1.66666666666667e-01 +448 93 8.33333333333333e-02 +448 399 -1.66666666666667e-01 +448 404 1.66666666666667e-01 +448 212 -3.33333333333333e-01 +448 326 8.33333333333333e-02 +448 403 -7.50000000000000e-01 +448 97 -1.66666666666667e-01 +448 447 -1.66666666666667e-01 +448 402 1.66666666666667e-01 +448 96 8.33333333333333e-02 +449 449 1.33333333333333e+00 +449 93 8.33333333333333e-02 +449 324 -1.66666666666667e-01 +449 329 -7.50000000000000e-01 +449 328 1.66666666666667e-01 +449 447 -1.66666666666667e-01 +449 327 1.66666666666667e-01 +449 96 8.33333333333333e-02 +449 400 8.33333333333333e-02 +449 208 -1.66666666666667e-01 +449 95 -1.66666666666667e-01 +449 399 8.33333333333333e-02 +449 207 -1.66666666666667e-01 +449 325 8.33333333333333e-02 +449 404 -2.50000000000000e-01 +449 98 -1.66666666666667e-01 +449 403 1.66666666666667e-01 +449 211 -3.33333333333333e-01 +449 402 -8.33333333333333e-02 +449 210 1.66666666666667e-01 +450 450 1.50000000000000e+00 +450 335 -1.66666666666667e-01 +450 334 8.33333333333333e-02 +450 452 -1.66666666666667e-01 +450 338 1.66666666666667e-01 +450 101 8.33333333333333e-02 +450 337 -8.33333333333333e-02 +450 336 -2.50000000000000e-01 +450 229 -1.66666666666667e-01 +450 232 1.66666666666667e-01 +450 410 8.33333333333333e-02 +450 230 -1.66666666666667e-01 +450 97 8.33333333333333e-02 +450 409 -1.66666666666667e-01 +450 96 -5.00000000000000e-01 +450 413 -8.33333333333333e-02 +450 233 1.66666666666667e-01 +450 451 -1.66666666666667e-01 +450 412 1.66666666666667e-01 +450 100 8.33333333333333e-02 +450 98 8.33333333333333e-02 +450 411 -2.50000000000000e-01 +450 99 -5.00000000000000e-01 +451 451 1.33333333333333e+00 +451 333 8.33333333333333e-02 +451 338 1.66666666666667e-01 +451 337 -2.50000000000000e-01 +451 336 -8.33333333333333e-02 +451 410 8.33333333333333e-02 +451 230 -1.66666666666667e-01 +451 228 -1.66666666666667e-01 +451 231 1.66666666666667e-01 +451 97 -1.66666666666667e-01 +451 96 8.33333333333333e-02 +451 408 -1.66666666666667e-01 +451 413 1.66666666666667e-01 +451 233 -3.33333333333333e-01 +451 335 8.33333333333333e-02 +451 412 -7.50000000000000e-01 +451 100 -1.66666666666667e-01 +451 450 -1.66666666666667e-01 +451 411 1.66666666666667e-01 +451 99 8.33333333333333e-02 +452 452 1.33333333333333e+00 +452 96 8.33333333333333e-02 +452 333 -1.66666666666667e-01 +452 338 -7.50000000000000e-01 +452 337 1.66666666666667e-01 +452 450 -1.66666666666667e-01 +452 336 1.66666666666667e-01 +452 99 8.33333333333333e-02 +452 409 8.33333333333333e-02 +452 229 -1.66666666666667e-01 +452 98 -1.66666666666667e-01 +452 408 8.33333333333333e-02 +452 228 -1.66666666666667e-01 +452 334 8.33333333333333e-02 +452 413 -2.50000000000000e-01 +452 101 -1.66666666666667e-01 +452 412 1.66666666666667e-01 +452 232 -3.33333333333333e-01 +452 411 -8.33333333333333e-02 +452 231 1.66666666666667e-01 +453 453 1.50000000000000e+00 +453 344 -1.66666666666667e-01 +453 343 8.33333333333333e-02 +453 455 -1.66666666666667e-01 +453 347 1.66666666666667e-01 +453 104 8.33333333333333e-02 +453 346 -8.33333333333333e-02 +453 345 -2.50000000000000e-01 +453 250 -1.66666666666667e-01 +453 253 1.66666666666667e-01 +453 419 8.33333333333333e-02 +453 251 -1.66666666666667e-01 +453 100 8.33333333333333e-02 +453 418 -1.66666666666667e-01 +453 99 -5.00000000000000e-01 +453 422 -8.33333333333333e-02 +453 254 1.66666666666667e-01 +453 454 -1.66666666666667e-01 +453 421 1.66666666666667e-01 +453 103 8.33333333333333e-02 +453 101 8.33333333333333e-02 +453 420 -2.50000000000000e-01 +453 102 -5.00000000000000e-01 +454 454 1.33333333333333e+00 +454 342 8.33333333333333e-02 +454 347 1.66666666666667e-01 +454 346 -2.50000000000000e-01 +454 345 -8.33333333333333e-02 +454 419 8.33333333333333e-02 +454 251 -1.66666666666667e-01 +454 249 -1.66666666666667e-01 +454 252 1.66666666666667e-01 +454 100 -1.66666666666667e-01 +454 99 8.33333333333333e-02 +454 417 -1.66666666666667e-01 +454 422 1.66666666666667e-01 +454 254 -3.33333333333333e-01 +454 344 8.33333333333333e-02 +454 421 -7.50000000000000e-01 +454 103 -1.66666666666667e-01 +454 453 -1.66666666666667e-01 +454 420 1.66666666666667e-01 +454 102 8.33333333333333e-02 +455 455 1.33333333333333e+00 +455 99 8.33333333333333e-02 +455 342 -1.66666666666667e-01 +455 347 -7.50000000000000e-01 +455 346 1.66666666666667e-01 +455 453 -1.66666666666667e-01 +455 345 1.66666666666667e-01 +455 102 8.33333333333333e-02 +455 418 8.33333333333333e-02 +455 250 -1.66666666666667e-01 +455 101 -1.66666666666667e-01 +455 417 8.33333333333333e-02 +455 249 -1.66666666666667e-01 +455 343 8.33333333333333e-02 +455 422 -2.50000000000000e-01 +455 104 -1.66666666666667e-01 +455 421 1.66666666666667e-01 +455 253 -3.33333333333333e-01 +455 420 -8.33333333333333e-02 +455 252 1.66666666666667e-01 +456 456 1.50000000000000e+00 +456 353 -1.66666666666667e-01 +456 352 8.33333333333333e-02 +456 458 -1.66666666666667e-01 +456 356 1.66666666666667e-01 +456 107 8.33333333333333e-02 +456 355 -8.33333333333333e-02 +456 354 -2.50000000000000e-01 +456 271 -1.66666666666667e-01 +456 274 1.66666666666667e-01 +456 428 8.33333333333333e-02 +456 272 -1.66666666666667e-01 +456 103 8.33333333333333e-02 +456 427 -1.66666666666667e-01 +456 102 -5.00000000000000e-01 +456 431 -8.33333333333333e-02 +456 275 1.66666666666667e-01 +456 457 -1.66666666666667e-01 +456 430 1.66666666666667e-01 +456 106 8.33333333333333e-02 +456 104 8.33333333333333e-02 +456 429 -2.50000000000000e-01 +456 105 -5.00000000000000e-01 +457 457 1.33333333333333e+00 +457 351 8.33333333333333e-02 +457 356 1.66666666666667e-01 +457 355 -2.50000000000000e-01 +457 354 -8.33333333333333e-02 +457 428 8.33333333333333e-02 +457 272 -1.66666666666667e-01 +457 270 -1.66666666666667e-01 +457 273 1.66666666666667e-01 +457 103 -1.66666666666667e-01 +457 102 8.33333333333333e-02 +457 426 -1.66666666666667e-01 +457 431 1.66666666666667e-01 +457 275 -3.33333333333333e-01 +457 353 8.33333333333333e-02 +457 430 -7.50000000000000e-01 +457 106 -1.66666666666667e-01 +457 456 -1.66666666666667e-01 +457 429 1.66666666666667e-01 +457 105 8.33333333333333e-02 +458 458 1.33333333333333e+00 +458 102 8.33333333333333e-02 +458 351 -1.66666666666667e-01 +458 356 -7.50000000000000e-01 +458 355 1.66666666666667e-01 +458 456 -1.66666666666667e-01 +458 354 1.66666666666667e-01 +458 105 8.33333333333333e-02 +458 427 8.33333333333333e-02 +458 271 -1.66666666666667e-01 +458 104 -1.66666666666667e-01 +458 426 8.33333333333333e-02 +458 270 -1.66666666666667e-01 +458 352 8.33333333333333e-02 +458 431 -2.50000000000000e-01 +458 107 -1.66666666666667e-01 +458 430 1.66666666666667e-01 +458 274 -3.33333333333333e-01 +458 429 -8.33333333333333e-02 +458 273 1.66666666666667e-01 diff --git a/external/hypre/src/test/TEST_ij/data/beam_tet_dof459_np1/b.IJ.00000 b/external/hypre/src/test/TEST_ij/data/beam_tet_dof459_np1/b.IJ.00000 new file mode 100644 index 00000000..91a76905 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/data/beam_tet_dof459_np1/b.IJ.00000 @@ -0,0 +1,460 @@ +0 458 +0 0.00000000000000e+00 +1 0.00000000000000e+00 +2 0.00000000000000e+00 +3 0.00000000000000e+00 +4 0.00000000000000e+00 +5 0.00000000000000e+00 +6 0.00000000000000e+00 +7 0.00000000000000e+00 +8 0.00000000000000e+00 +9 0.00000000000000e+00 +10 0.00000000000000e+00 +11 0.00000000000000e+00 +12 0.00000000000000e+00 +13 0.00000000000000e+00 +14 0.00000000000000e+00 +15 0.00000000000000e+00 +16 0.00000000000000e+00 +17 0.00000000000000e+00 +18 0.00000000000000e+00 +19 0.00000000000000e+00 +20 0.00000000000000e+00 +21 0.00000000000000e+00 +22 0.00000000000000e+00 +23 0.00000000000000e+00 +24 0.00000000000000e+00 +25 0.00000000000000e+00 +26 -8.33333333333333e-04 +27 0.00000000000000e+00 +28 0.00000000000000e+00 +29 0.00000000000000e+00 +30 0.00000000000000e+00 +31 0.00000000000000e+00 +32 0.00000000000000e+00 +33 0.00000000000000e+00 +34 0.00000000000000e+00 +35 0.00000000000000e+00 +36 0.00000000000000e+00 +37 0.00000000000000e+00 +38 0.00000000000000e+00 +39 0.00000000000000e+00 +40 0.00000000000000e+00 +41 0.00000000000000e+00 +42 0.00000000000000e+00 +43 0.00000000000000e+00 +44 0.00000000000000e+00 +45 0.00000000000000e+00 +46 0.00000000000000e+00 +47 0.00000000000000e+00 +48 0.00000000000000e+00 +49 0.00000000000000e+00 +50 0.00000000000000e+00 +51 0.00000000000000e+00 +52 0.00000000000000e+00 +53 -4.16666666666667e-04 +54 0.00000000000000e+00 +55 0.00000000000000e+00 +56 0.00000000000000e+00 +57 0.00000000000000e+00 +58 0.00000000000000e+00 +59 0.00000000000000e+00 +60 0.00000000000000e+00 +61 0.00000000000000e+00 +62 0.00000000000000e+00 +63 0.00000000000000e+00 +64 0.00000000000000e+00 +65 0.00000000000000e+00 +66 0.00000000000000e+00 +67 0.00000000000000e+00 +68 0.00000000000000e+00 +69 0.00000000000000e+00 +70 0.00000000000000e+00 +71 0.00000000000000e+00 +72 0.00000000000000e+00 +73 0.00000000000000e+00 +74 0.00000000000000e+00 +75 0.00000000000000e+00 +76 0.00000000000000e+00 +77 0.00000000000000e+00 +78 0.00000000000000e+00 +79 0.00000000000000e+00 +80 -4.16666666666667e-04 +81 0.00000000000000e+00 +82 0.00000000000000e+00 +83 0.00000000000000e+00 +84 0.00000000000000e+00 +85 0.00000000000000e+00 +86 0.00000000000000e+00 +87 0.00000000000000e+00 +88 0.00000000000000e+00 +89 0.00000000000000e+00 +90 0.00000000000000e+00 +91 0.00000000000000e+00 +92 0.00000000000000e+00 +93 0.00000000000000e+00 +94 0.00000000000000e+00 +95 0.00000000000000e+00 +96 0.00000000000000e+00 +97 0.00000000000000e+00 +98 0.00000000000000e+00 +99 0.00000000000000e+00 +100 0.00000000000000e+00 +101 0.00000000000000e+00 +102 0.00000000000000e+00 +103 0.00000000000000e+00 +104 0.00000000000000e+00 +105 0.00000000000000e+00 +106 0.00000000000000e+00 +107 -8.33333333333333e-04 +108 0.00000000000000e+00 +109 0.00000000000000e+00 +110 0.00000000000000e+00 +111 0.00000000000000e+00 +112 0.00000000000000e+00 +113 0.00000000000000e+00 +114 0.00000000000000e+00 +115 0.00000000000000e+00 +116 0.00000000000000e+00 +117 0.00000000000000e+00 +118 0.00000000000000e+00 +119 0.00000000000000e+00 +120 0.00000000000000e+00 +121 0.00000000000000e+00 +122 0.00000000000000e+00 +123 0.00000000000000e+00 +124 0.00000000000000e+00 +125 0.00000000000000e+00 +126 0.00000000000000e+00 +127 0.00000000000000e+00 +128 0.00000000000000e+00 +129 0.00000000000000e+00 +130 0.00000000000000e+00 +131 0.00000000000000e+00 +132 0.00000000000000e+00 +133 0.00000000000000e+00 +134 0.00000000000000e+00 +135 0.00000000000000e+00 +136 0.00000000000000e+00 +137 0.00000000000000e+00 +138 0.00000000000000e+00 +139 0.00000000000000e+00 +140 0.00000000000000e+00 +141 0.00000000000000e+00 +142 0.00000000000000e+00 +143 0.00000000000000e+00 +144 0.00000000000000e+00 +145 0.00000000000000e+00 +146 0.00000000000000e+00 +147 0.00000000000000e+00 +148 0.00000000000000e+00 +149 0.00000000000000e+00 +150 0.00000000000000e+00 +151 0.00000000000000e+00 +152 0.00000000000000e+00 +153 0.00000000000000e+00 +154 0.00000000000000e+00 +155 0.00000000000000e+00 +156 0.00000000000000e+00 +157 0.00000000000000e+00 +158 0.00000000000000e+00 +159 0.00000000000000e+00 +160 0.00000000000000e+00 +161 0.00000000000000e+00 +162 0.00000000000000e+00 +163 0.00000000000000e+00 +164 0.00000000000000e+00 +165 0.00000000000000e+00 +166 0.00000000000000e+00 +167 0.00000000000000e+00 +168 0.00000000000000e+00 +169 0.00000000000000e+00 +170 0.00000000000000e+00 +171 0.00000000000000e+00 +172 0.00000000000000e+00 +173 0.00000000000000e+00 +174 0.00000000000000e+00 +175 0.00000000000000e+00 +176 0.00000000000000e+00 +177 0.00000000000000e+00 +178 0.00000000000000e+00 +179 0.00000000000000e+00 +180 0.00000000000000e+00 +181 0.00000000000000e+00 +182 0.00000000000000e+00 +183 0.00000000000000e+00 +184 0.00000000000000e+00 +185 0.00000000000000e+00 +186 0.00000000000000e+00 +187 0.00000000000000e+00 +188 0.00000000000000e+00 +189 0.00000000000000e+00 +190 0.00000000000000e+00 +191 0.00000000000000e+00 +192 0.00000000000000e+00 +193 0.00000000000000e+00 +194 0.00000000000000e+00 +195 0.00000000000000e+00 +196 0.00000000000000e+00 +197 0.00000000000000e+00 +198 0.00000000000000e+00 +199 0.00000000000000e+00 +200 0.00000000000000e+00 +201 0.00000000000000e+00 +202 0.00000000000000e+00 +203 0.00000000000000e+00 +204 0.00000000000000e+00 +205 0.00000000000000e+00 +206 0.00000000000000e+00 +207 0.00000000000000e+00 +208 0.00000000000000e+00 +209 0.00000000000000e+00 +210 0.00000000000000e+00 +211 0.00000000000000e+00 +212 0.00000000000000e+00 +213 0.00000000000000e+00 +214 0.00000000000000e+00 +215 0.00000000000000e+00 +216 0.00000000000000e+00 +217 0.00000000000000e+00 +218 0.00000000000000e+00 +219 0.00000000000000e+00 +220 0.00000000000000e+00 +221 0.00000000000000e+00 +222 0.00000000000000e+00 +223 0.00000000000000e+00 +224 0.00000000000000e+00 +225 0.00000000000000e+00 +226 0.00000000000000e+00 +227 0.00000000000000e+00 +228 0.00000000000000e+00 +229 0.00000000000000e+00 +230 0.00000000000000e+00 +231 0.00000000000000e+00 +232 0.00000000000000e+00 +233 0.00000000000000e+00 +234 0.00000000000000e+00 +235 0.00000000000000e+00 +236 0.00000000000000e+00 +237 0.00000000000000e+00 +238 0.00000000000000e+00 +239 0.00000000000000e+00 +240 0.00000000000000e+00 +241 0.00000000000000e+00 +242 0.00000000000000e+00 +243 0.00000000000000e+00 +244 0.00000000000000e+00 +245 0.00000000000000e+00 +246 0.00000000000000e+00 +247 0.00000000000000e+00 +248 0.00000000000000e+00 +249 0.00000000000000e+00 +250 0.00000000000000e+00 +251 0.00000000000000e+00 +252 0.00000000000000e+00 +253 0.00000000000000e+00 +254 0.00000000000000e+00 +255 0.00000000000000e+00 +256 0.00000000000000e+00 +257 0.00000000000000e+00 +258 0.00000000000000e+00 +259 0.00000000000000e+00 +260 0.00000000000000e+00 +261 0.00000000000000e+00 +262 0.00000000000000e+00 +263 0.00000000000000e+00 +264 0.00000000000000e+00 +265 0.00000000000000e+00 +266 0.00000000000000e+00 +267 0.00000000000000e+00 +268 0.00000000000000e+00 +269 0.00000000000000e+00 +270 0.00000000000000e+00 +271 0.00000000000000e+00 +272 0.00000000000000e+00 +273 0.00000000000000e+00 +274 0.00000000000000e+00 +275 0.00000000000000e+00 +276 0.00000000000000e+00 +277 0.00000000000000e+00 +278 -1.25000000000000e-03 +279 0.00000000000000e+00 +280 0.00000000000000e+00 +281 -1.25000000000000e-03 +282 0.00000000000000e+00 +283 0.00000000000000e+00 +284 -2.50000000000000e-03 +285 0.00000000000000e+00 +286 0.00000000000000e+00 +287 0.00000000000000e+00 +288 0.00000000000000e+00 +289 0.00000000000000e+00 +290 0.00000000000000e+00 +291 0.00000000000000e+00 +292 0.00000000000000e+00 +293 0.00000000000000e+00 +294 0.00000000000000e+00 +295 0.00000000000000e+00 +296 0.00000000000000e+00 +297 0.00000000000000e+00 +298 0.00000000000000e+00 +299 0.00000000000000e+00 +300 0.00000000000000e+00 +301 0.00000000000000e+00 +302 0.00000000000000e+00 +303 0.00000000000000e+00 +304 0.00000000000000e+00 +305 0.00000000000000e+00 +306 0.00000000000000e+00 +307 0.00000000000000e+00 +308 0.00000000000000e+00 +309 0.00000000000000e+00 +310 0.00000000000000e+00 +311 0.00000000000000e+00 +312 0.00000000000000e+00 +313 0.00000000000000e+00 +314 0.00000000000000e+00 +315 0.00000000000000e+00 +316 0.00000000000000e+00 +317 0.00000000000000e+00 +318 0.00000000000000e+00 +319 0.00000000000000e+00 +320 0.00000000000000e+00 +321 0.00000000000000e+00 +322 0.00000000000000e+00 +323 0.00000000000000e+00 +324 0.00000000000000e+00 +325 0.00000000000000e+00 +326 0.00000000000000e+00 +327 0.00000000000000e+00 +328 0.00000000000000e+00 +329 0.00000000000000e+00 +330 0.00000000000000e+00 +331 0.00000000000000e+00 +332 0.00000000000000e+00 +333 0.00000000000000e+00 +334 0.00000000000000e+00 +335 0.00000000000000e+00 +336 0.00000000000000e+00 +337 0.00000000000000e+00 +338 0.00000000000000e+00 +339 0.00000000000000e+00 +340 0.00000000000000e+00 +341 0.00000000000000e+00 +342 0.00000000000000e+00 +343 0.00000000000000e+00 +344 0.00000000000000e+00 +345 0.00000000000000e+00 +346 0.00000000000000e+00 +347 0.00000000000000e+00 +348 0.00000000000000e+00 +349 0.00000000000000e+00 +350 0.00000000000000e+00 +351 0.00000000000000e+00 +352 0.00000000000000e+00 +353 0.00000000000000e+00 +354 0.00000000000000e+00 +355 0.00000000000000e+00 +356 0.00000000000000e+00 +357 0.00000000000000e+00 +358 0.00000000000000e+00 +359 -1.25000000000000e-03 +360 0.00000000000000e+00 +361 0.00000000000000e+00 +362 0.00000000000000e+00 +363 0.00000000000000e+00 +364 0.00000000000000e+00 +365 0.00000000000000e+00 +366 0.00000000000000e+00 +367 0.00000000000000e+00 +368 0.00000000000000e+00 +369 0.00000000000000e+00 +370 0.00000000000000e+00 +371 0.00000000000000e+00 +372 0.00000000000000e+00 +373 0.00000000000000e+00 +374 0.00000000000000e+00 +375 0.00000000000000e+00 +376 0.00000000000000e+00 +377 0.00000000000000e+00 +378 0.00000000000000e+00 +379 0.00000000000000e+00 +380 0.00000000000000e+00 +381 0.00000000000000e+00 +382 0.00000000000000e+00 +383 0.00000000000000e+00 +384 0.00000000000000e+00 +385 0.00000000000000e+00 +386 0.00000000000000e+00 +387 0.00000000000000e+00 +388 0.00000000000000e+00 +389 0.00000000000000e+00 +390 0.00000000000000e+00 +391 0.00000000000000e+00 +392 0.00000000000000e+00 +393 0.00000000000000e+00 +394 0.00000000000000e+00 +395 0.00000000000000e+00 +396 0.00000000000000e+00 +397 0.00000000000000e+00 +398 0.00000000000000e+00 +399 0.00000000000000e+00 +400 0.00000000000000e+00 +401 0.00000000000000e+00 +402 0.00000000000000e+00 +403 0.00000000000000e+00 +404 0.00000000000000e+00 +405 0.00000000000000e+00 +406 0.00000000000000e+00 +407 0.00000000000000e+00 +408 0.00000000000000e+00 +409 0.00000000000000e+00 +410 0.00000000000000e+00 +411 0.00000000000000e+00 +412 0.00000000000000e+00 +413 0.00000000000000e+00 +414 0.00000000000000e+00 +415 0.00000000000000e+00 +416 0.00000000000000e+00 +417 0.00000000000000e+00 +418 0.00000000000000e+00 +419 0.00000000000000e+00 +420 0.00000000000000e+00 +421 0.00000000000000e+00 +422 0.00000000000000e+00 +423 0.00000000000000e+00 +424 0.00000000000000e+00 +425 0.00000000000000e+00 +426 0.00000000000000e+00 +427 0.00000000000000e+00 +428 0.00000000000000e+00 +429 0.00000000000000e+00 +430 0.00000000000000e+00 +431 0.00000000000000e+00 +432 0.00000000000000e+00 +433 0.00000000000000e+00 +434 -1.25000000000000e-03 +435 0.00000000000000e+00 +436 0.00000000000000e+00 +437 0.00000000000000e+00 +438 0.00000000000000e+00 +439 0.00000000000000e+00 +440 0.00000000000000e+00 +441 0.00000000000000e+00 +442 0.00000000000000e+00 +443 0.00000000000000e+00 +444 0.00000000000000e+00 +445 0.00000000000000e+00 +446 0.00000000000000e+00 +447 0.00000000000000e+00 +448 0.00000000000000e+00 +449 0.00000000000000e+00 +450 0.00000000000000e+00 +451 0.00000000000000e+00 +452 0.00000000000000e+00 +453 0.00000000000000e+00 +454 0.00000000000000e+00 +455 0.00000000000000e+00 +456 0.00000000000000e+00 +457 0.00000000000000e+00 +458 0.00000000000000e+00 diff --git a/external/hypre/src/test/TEST_ij/data/beam_tet_dof459_np1/mfem.txt b/external/hypre/src/test/TEST_ij/data/beam_tet_dof459_np1/mfem.txt new file mode 100644 index 00000000..c8f947d7 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/data/beam_tet_dof459_np1/mfem.txt @@ -0,0 +1,19 @@ +$ mpirun -np 1 ./ex2p -m ../beam-tet.mesh -sr 1 -sp 0 -no-vis + +Produced with mfem-4.4 (https://github.com/mfem/mfem/archive/refs/tags/v4.4.tar.gz) + +Options used: + --mesh ../beam-tet.mesh + --order 1 + --serial_ref 1 + --parallel_ref 0 + --amg-for-systems + --no-static-condensation + --no-visualization + --by-vdim + --device cpu +Device configuration: cpu +Memory configuration: host-std +Number of finite element unknowns: 459 +Assembling: r.h.s. ... matrix ... done. +Size of linear system: 459 \ No newline at end of file diff --git a/external/hypre/src/test/TEST_ij/data/beam_tet_dof459_np1/rbms.0.00000 b/external/hypre/src/test/TEST_ij/data/beam_tet_dof459_np1/rbms.0.00000 new file mode 100644 index 00000000..c9c08061 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/data/beam_tet_dof459_np1/rbms.0.00000 @@ -0,0 +1,460 @@ +0 459 +0 0.00000000000000e+00 +1 -0.00000000000000e+00 +2 0.00000000000000e+00 +3 0.00000000000000e+00 +4 -1.00000000000000e+00 +5 0.00000000000000e+00 +6 0.00000000000000e+00 +7 -2.00000000000000e+00 +8 0.00000000000000e+00 +9 0.00000000000000e+00 +10 -3.00000000000000e+00 +11 0.00000000000000e+00 +12 0.00000000000000e+00 +13 -4.00000000000000e+00 +14 0.00000000000000e+00 +15 0.00000000000000e+00 +16 -5.00000000000000e+00 +17 0.00000000000000e+00 +18 0.00000000000000e+00 +19 -6.00000000000000e+00 +20 0.00000000000000e+00 +21 0.00000000000000e+00 +22 -7.00000000000000e+00 +23 0.00000000000000e+00 +24 0.00000000000000e+00 +25 -8.00000000000000e+00 +26 0.00000000000000e+00 +27 1.00000000000000e+00 +28 -0.00000000000000e+00 +29 0.00000000000000e+00 +30 1.00000000000000e+00 +31 -1.00000000000000e+00 +32 0.00000000000000e+00 +33 1.00000000000000e+00 +34 -2.00000000000000e+00 +35 0.00000000000000e+00 +36 1.00000000000000e+00 +37 -3.00000000000000e+00 +38 0.00000000000000e+00 +39 1.00000000000000e+00 +40 -4.00000000000000e+00 +41 0.00000000000000e+00 +42 1.00000000000000e+00 +43 -5.00000000000000e+00 +44 0.00000000000000e+00 +45 1.00000000000000e+00 +46 -6.00000000000000e+00 +47 0.00000000000000e+00 +48 1.00000000000000e+00 +49 -7.00000000000000e+00 +50 0.00000000000000e+00 +51 1.00000000000000e+00 +52 -8.00000000000000e+00 +53 0.00000000000000e+00 +54 0.00000000000000e+00 +55 -0.00000000000000e+00 +56 0.00000000000000e+00 +57 0.00000000000000e+00 +58 -1.00000000000000e+00 +59 0.00000000000000e+00 +60 0.00000000000000e+00 +61 -2.00000000000000e+00 +62 0.00000000000000e+00 +63 0.00000000000000e+00 +64 -3.00000000000000e+00 +65 0.00000000000000e+00 +66 0.00000000000000e+00 +67 -4.00000000000000e+00 +68 0.00000000000000e+00 +69 0.00000000000000e+00 +70 -5.00000000000000e+00 +71 0.00000000000000e+00 +72 0.00000000000000e+00 +73 -6.00000000000000e+00 +74 0.00000000000000e+00 +75 0.00000000000000e+00 +76 -7.00000000000000e+00 +77 0.00000000000000e+00 +78 0.00000000000000e+00 +79 -8.00000000000000e+00 +80 0.00000000000000e+00 +81 1.00000000000000e+00 +82 -0.00000000000000e+00 +83 0.00000000000000e+00 +84 1.00000000000000e+00 +85 -1.00000000000000e+00 +86 0.00000000000000e+00 +87 1.00000000000000e+00 +88 -2.00000000000000e+00 +89 0.00000000000000e+00 +90 1.00000000000000e+00 +91 -3.00000000000000e+00 +92 0.00000000000000e+00 +93 1.00000000000000e+00 +94 -4.00000000000000e+00 +95 0.00000000000000e+00 +96 1.00000000000000e+00 +97 -5.00000000000000e+00 +98 0.00000000000000e+00 +99 1.00000000000000e+00 +100 -6.00000000000000e+00 +101 0.00000000000000e+00 +102 1.00000000000000e+00 +103 -7.00000000000000e+00 +104 0.00000000000000e+00 +105 1.00000000000000e+00 +106 -8.00000000000000e+00 +107 0.00000000000000e+00 +108 0.00000000000000e+00 +109 -5.00000000000000e-01 +110 0.00000000000000e+00 +111 5.00000000000000e-01 +112 -0.00000000000000e+00 +113 0.00000000000000e+00 +114 5.00000000000000e-01 +115 -5.00000000000000e-01 +116 0.00000000000000e+00 +117 0.00000000000000e+00 +118 -0.00000000000000e+00 +119 0.00000000000000e+00 +120 0.00000000000000e+00 +121 -5.00000000000000e-01 +122 0.00000000000000e+00 +123 5.00000000000000e-01 +124 -0.00000000000000e+00 +125 0.00000000000000e+00 +126 5.00000000000000e-01 +127 -5.00000000000000e-01 +128 0.00000000000000e+00 +129 0.00000000000000e+00 +130 -1.50000000000000e+00 +131 0.00000000000000e+00 +132 5.00000000000000e-01 +133 -1.00000000000000e+00 +134 0.00000000000000e+00 +135 5.00000000000000e-01 +136 -1.50000000000000e+00 +137 0.00000000000000e+00 +138 0.00000000000000e+00 +139 -1.00000000000000e+00 +140 0.00000000000000e+00 +141 0.00000000000000e+00 +142 -1.50000000000000e+00 +143 0.00000000000000e+00 +144 5.00000000000000e-01 +145 -1.00000000000000e+00 +146 0.00000000000000e+00 +147 5.00000000000000e-01 +148 -1.50000000000000e+00 +149 0.00000000000000e+00 +150 0.00000000000000e+00 +151 -2.50000000000000e+00 +152 0.00000000000000e+00 +153 5.00000000000000e-01 +154 -2.00000000000000e+00 +155 0.00000000000000e+00 +156 5.00000000000000e-01 +157 -2.50000000000000e+00 +158 0.00000000000000e+00 +159 0.00000000000000e+00 +160 -2.00000000000000e+00 +161 0.00000000000000e+00 +162 0.00000000000000e+00 +163 -2.50000000000000e+00 +164 0.00000000000000e+00 +165 5.00000000000000e-01 +166 -2.00000000000000e+00 +167 0.00000000000000e+00 +168 5.00000000000000e-01 +169 -2.50000000000000e+00 +170 0.00000000000000e+00 +171 0.00000000000000e+00 +172 -3.50000000000000e+00 +173 0.00000000000000e+00 +174 5.00000000000000e-01 +175 -3.00000000000000e+00 +176 0.00000000000000e+00 +177 5.00000000000000e-01 +178 -3.50000000000000e+00 +179 0.00000000000000e+00 +180 0.00000000000000e+00 +181 -3.00000000000000e+00 +182 0.00000000000000e+00 +183 0.00000000000000e+00 +184 -3.50000000000000e+00 +185 0.00000000000000e+00 +186 5.00000000000000e-01 +187 -3.00000000000000e+00 +188 0.00000000000000e+00 +189 5.00000000000000e-01 +190 -3.50000000000000e+00 +191 0.00000000000000e+00 +192 0.00000000000000e+00 +193 -4.50000000000000e+00 +194 0.00000000000000e+00 +195 5.00000000000000e-01 +196 -4.00000000000000e+00 +197 0.00000000000000e+00 +198 5.00000000000000e-01 +199 -4.50000000000000e+00 +200 0.00000000000000e+00 +201 0.00000000000000e+00 +202 -4.00000000000000e+00 +203 0.00000000000000e+00 +204 0.00000000000000e+00 +205 -4.50000000000000e+00 +206 0.00000000000000e+00 +207 5.00000000000000e-01 +208 -4.00000000000000e+00 +209 0.00000000000000e+00 +210 5.00000000000000e-01 +211 -4.50000000000000e+00 +212 0.00000000000000e+00 +213 0.00000000000000e+00 +214 -5.50000000000000e+00 +215 0.00000000000000e+00 +216 5.00000000000000e-01 +217 -5.00000000000000e+00 +218 0.00000000000000e+00 +219 5.00000000000000e-01 +220 -5.50000000000000e+00 +221 0.00000000000000e+00 +222 0.00000000000000e+00 +223 -5.00000000000000e+00 +224 0.00000000000000e+00 +225 0.00000000000000e+00 +226 -5.50000000000000e+00 +227 0.00000000000000e+00 +228 5.00000000000000e-01 +229 -5.00000000000000e+00 +230 0.00000000000000e+00 +231 5.00000000000000e-01 +232 -5.50000000000000e+00 +233 0.00000000000000e+00 +234 0.00000000000000e+00 +235 -6.50000000000000e+00 +236 0.00000000000000e+00 +237 5.00000000000000e-01 +238 -6.00000000000000e+00 +239 0.00000000000000e+00 +240 5.00000000000000e-01 +241 -6.50000000000000e+00 +242 0.00000000000000e+00 +243 0.00000000000000e+00 +244 -6.00000000000000e+00 +245 0.00000000000000e+00 +246 0.00000000000000e+00 +247 -6.50000000000000e+00 +248 0.00000000000000e+00 +249 5.00000000000000e-01 +250 -6.00000000000000e+00 +251 0.00000000000000e+00 +252 5.00000000000000e-01 +253 -6.50000000000000e+00 +254 0.00000000000000e+00 +255 0.00000000000000e+00 +256 -7.50000000000000e+00 +257 0.00000000000000e+00 +258 5.00000000000000e-01 +259 -7.00000000000000e+00 +260 0.00000000000000e+00 +261 5.00000000000000e-01 +262 -7.50000000000000e+00 +263 0.00000000000000e+00 +264 0.00000000000000e+00 +265 -7.00000000000000e+00 +266 0.00000000000000e+00 +267 0.00000000000000e+00 +268 -7.50000000000000e+00 +269 0.00000000000000e+00 +270 5.00000000000000e-01 +271 -7.00000000000000e+00 +272 0.00000000000000e+00 +273 5.00000000000000e-01 +274 -7.50000000000000e+00 +275 0.00000000000000e+00 +276 5.00000000000000e-01 +277 -8.00000000000000e+00 +278 0.00000000000000e+00 +279 0.00000000000000e+00 +280 -8.00000000000000e+00 +281 0.00000000000000e+00 +282 5.00000000000000e-01 +283 -8.00000000000000e+00 +284 0.00000000000000e+00 +285 1.00000000000000e+00 +286 -5.00000000000000e-01 +287 0.00000000000000e+00 +288 1.00000000000000e+00 +289 -0.00000000000000e+00 +290 0.00000000000000e+00 +291 1.00000000000000e+00 +292 -5.00000000000000e-01 +293 0.00000000000000e+00 +294 1.00000000000000e+00 +295 -1.50000000000000e+00 +296 0.00000000000000e+00 +297 1.00000000000000e+00 +298 -1.00000000000000e+00 +299 0.00000000000000e+00 +300 1.00000000000000e+00 +301 -1.50000000000000e+00 +302 0.00000000000000e+00 +303 1.00000000000000e+00 +304 -2.50000000000000e+00 +305 0.00000000000000e+00 +306 1.00000000000000e+00 +307 -2.00000000000000e+00 +308 0.00000000000000e+00 +309 1.00000000000000e+00 +310 -2.50000000000000e+00 +311 0.00000000000000e+00 +312 1.00000000000000e+00 +313 -3.50000000000000e+00 +314 0.00000000000000e+00 +315 1.00000000000000e+00 +316 -3.00000000000000e+00 +317 0.00000000000000e+00 +318 1.00000000000000e+00 +319 -3.50000000000000e+00 +320 0.00000000000000e+00 +321 1.00000000000000e+00 +322 -4.50000000000000e+00 +323 0.00000000000000e+00 +324 1.00000000000000e+00 +325 -4.00000000000000e+00 +326 0.00000000000000e+00 +327 1.00000000000000e+00 +328 -4.50000000000000e+00 +329 0.00000000000000e+00 +330 1.00000000000000e+00 +331 -5.50000000000000e+00 +332 0.00000000000000e+00 +333 1.00000000000000e+00 +334 -5.00000000000000e+00 +335 0.00000000000000e+00 +336 1.00000000000000e+00 +337 -5.50000000000000e+00 +338 0.00000000000000e+00 +339 1.00000000000000e+00 +340 -6.50000000000000e+00 +341 0.00000000000000e+00 +342 1.00000000000000e+00 +343 -6.00000000000000e+00 +344 0.00000000000000e+00 +345 1.00000000000000e+00 +346 -6.50000000000000e+00 +347 0.00000000000000e+00 +348 1.00000000000000e+00 +349 -7.50000000000000e+00 +350 0.00000000000000e+00 +351 1.00000000000000e+00 +352 -7.00000000000000e+00 +353 0.00000000000000e+00 +354 1.00000000000000e+00 +355 -7.50000000000000e+00 +356 0.00000000000000e+00 +357 1.00000000000000e+00 +358 -8.00000000000000e+00 +359 0.00000000000000e+00 +360 0.00000000000000e+00 +361 -5.00000000000000e-01 +362 0.00000000000000e+00 +363 5.00000000000000e-01 +364 -0.00000000000000e+00 +365 0.00000000000000e+00 +366 5.00000000000000e-01 +367 -5.00000000000000e-01 +368 0.00000000000000e+00 +369 0.00000000000000e+00 +370 -1.50000000000000e+00 +371 0.00000000000000e+00 +372 5.00000000000000e-01 +373 -1.00000000000000e+00 +374 0.00000000000000e+00 +375 5.00000000000000e-01 +376 -1.50000000000000e+00 +377 0.00000000000000e+00 +378 0.00000000000000e+00 +379 -2.50000000000000e+00 +380 0.00000000000000e+00 +381 5.00000000000000e-01 +382 -2.00000000000000e+00 +383 0.00000000000000e+00 +384 5.00000000000000e-01 +385 -2.50000000000000e+00 +386 0.00000000000000e+00 +387 0.00000000000000e+00 +388 -3.50000000000000e+00 +389 0.00000000000000e+00 +390 5.00000000000000e-01 +391 -3.00000000000000e+00 +392 0.00000000000000e+00 +393 5.00000000000000e-01 +394 -3.50000000000000e+00 +395 0.00000000000000e+00 +396 0.00000000000000e+00 +397 -4.50000000000000e+00 +398 0.00000000000000e+00 +399 5.00000000000000e-01 +400 -4.00000000000000e+00 +401 0.00000000000000e+00 +402 5.00000000000000e-01 +403 -4.50000000000000e+00 +404 0.00000000000000e+00 +405 0.00000000000000e+00 +406 -5.50000000000000e+00 +407 0.00000000000000e+00 +408 5.00000000000000e-01 +409 -5.00000000000000e+00 +410 0.00000000000000e+00 +411 5.00000000000000e-01 +412 -5.50000000000000e+00 +413 0.00000000000000e+00 +414 0.00000000000000e+00 +415 -6.50000000000000e+00 +416 0.00000000000000e+00 +417 5.00000000000000e-01 +418 -6.00000000000000e+00 +419 0.00000000000000e+00 +420 5.00000000000000e-01 +421 -6.50000000000000e+00 +422 0.00000000000000e+00 +423 0.00000000000000e+00 +424 -7.50000000000000e+00 +425 0.00000000000000e+00 +426 5.00000000000000e-01 +427 -7.00000000000000e+00 +428 0.00000000000000e+00 +429 5.00000000000000e-01 +430 -7.50000000000000e+00 +431 0.00000000000000e+00 +432 5.00000000000000e-01 +433 -8.00000000000000e+00 +434 0.00000000000000e+00 +435 1.00000000000000e+00 +436 -5.00000000000000e-01 +437 0.00000000000000e+00 +438 1.00000000000000e+00 +439 -1.50000000000000e+00 +440 0.00000000000000e+00 +441 1.00000000000000e+00 +442 -2.50000000000000e+00 +443 0.00000000000000e+00 +444 1.00000000000000e+00 +445 -3.50000000000000e+00 +446 0.00000000000000e+00 +447 1.00000000000000e+00 +448 -4.50000000000000e+00 +449 0.00000000000000e+00 +450 1.00000000000000e+00 +451 -5.50000000000000e+00 +452 0.00000000000000e+00 +453 1.00000000000000e+00 +454 -6.50000000000000e+00 +455 0.00000000000000e+00 +456 1.00000000000000e+00 +457 -7.50000000000000e+00 +458 0.00000000000000e+00 diff --git a/external/hypre/src/test/TEST_ij/data/beam_tet_dof459_np1/rbms.1.00000 b/external/hypre/src/test/TEST_ij/data/beam_tet_dof459_np1/rbms.1.00000 new file mode 100644 index 00000000..0206146d --- /dev/null +++ b/external/hypre/src/test/TEST_ij/data/beam_tet_dof459_np1/rbms.1.00000 @@ -0,0 +1,460 @@ +0 459 +0 0.00000000000000e+00 +1 0.00000000000000e+00 +2 -0.00000000000000e+00 +3 0.00000000000000e+00 +4 0.00000000000000e+00 +5 -0.00000000000000e+00 +6 0.00000000000000e+00 +7 0.00000000000000e+00 +8 -0.00000000000000e+00 +9 0.00000000000000e+00 +10 0.00000000000000e+00 +11 -0.00000000000000e+00 +12 0.00000000000000e+00 +13 0.00000000000000e+00 +14 -0.00000000000000e+00 +15 0.00000000000000e+00 +16 0.00000000000000e+00 +17 -0.00000000000000e+00 +18 0.00000000000000e+00 +19 0.00000000000000e+00 +20 -0.00000000000000e+00 +21 0.00000000000000e+00 +22 0.00000000000000e+00 +23 -0.00000000000000e+00 +24 0.00000000000000e+00 +25 0.00000000000000e+00 +26 -0.00000000000000e+00 +27 0.00000000000000e+00 +28 0.00000000000000e+00 +29 -1.00000000000000e+00 +30 0.00000000000000e+00 +31 0.00000000000000e+00 +32 -1.00000000000000e+00 +33 0.00000000000000e+00 +34 0.00000000000000e+00 +35 -1.00000000000000e+00 +36 0.00000000000000e+00 +37 0.00000000000000e+00 +38 -1.00000000000000e+00 +39 0.00000000000000e+00 +40 0.00000000000000e+00 +41 -1.00000000000000e+00 +42 0.00000000000000e+00 +43 0.00000000000000e+00 +44 -1.00000000000000e+00 +45 0.00000000000000e+00 +46 0.00000000000000e+00 +47 -1.00000000000000e+00 +48 0.00000000000000e+00 +49 0.00000000000000e+00 +50 -1.00000000000000e+00 +51 0.00000000000000e+00 +52 0.00000000000000e+00 +53 -1.00000000000000e+00 +54 0.00000000000000e+00 +55 1.00000000000000e+00 +56 -0.00000000000000e+00 +57 0.00000000000000e+00 +58 1.00000000000000e+00 +59 -0.00000000000000e+00 +60 0.00000000000000e+00 +61 1.00000000000000e+00 +62 -0.00000000000000e+00 +63 0.00000000000000e+00 +64 1.00000000000000e+00 +65 -0.00000000000000e+00 +66 0.00000000000000e+00 +67 1.00000000000000e+00 +68 -0.00000000000000e+00 +69 0.00000000000000e+00 +70 1.00000000000000e+00 +71 -0.00000000000000e+00 +72 0.00000000000000e+00 +73 1.00000000000000e+00 +74 -0.00000000000000e+00 +75 0.00000000000000e+00 +76 1.00000000000000e+00 +77 -0.00000000000000e+00 +78 0.00000000000000e+00 +79 1.00000000000000e+00 +80 -0.00000000000000e+00 +81 0.00000000000000e+00 +82 1.00000000000000e+00 +83 -1.00000000000000e+00 +84 0.00000000000000e+00 +85 1.00000000000000e+00 +86 -1.00000000000000e+00 +87 0.00000000000000e+00 +88 1.00000000000000e+00 +89 -1.00000000000000e+00 +90 0.00000000000000e+00 +91 1.00000000000000e+00 +92 -1.00000000000000e+00 +93 0.00000000000000e+00 +94 1.00000000000000e+00 +95 -1.00000000000000e+00 +96 0.00000000000000e+00 +97 1.00000000000000e+00 +98 -1.00000000000000e+00 +99 0.00000000000000e+00 +100 1.00000000000000e+00 +101 -1.00000000000000e+00 +102 0.00000000000000e+00 +103 1.00000000000000e+00 +104 -1.00000000000000e+00 +105 0.00000000000000e+00 +106 1.00000000000000e+00 +107 -1.00000000000000e+00 +108 0.00000000000000e+00 +109 0.00000000000000e+00 +110 -0.00000000000000e+00 +111 0.00000000000000e+00 +112 0.00000000000000e+00 +113 -5.00000000000000e-01 +114 0.00000000000000e+00 +115 0.00000000000000e+00 +116 -5.00000000000000e-01 +117 0.00000000000000e+00 +118 5.00000000000000e-01 +119 -0.00000000000000e+00 +120 0.00000000000000e+00 +121 5.00000000000000e-01 +122 -0.00000000000000e+00 +123 0.00000000000000e+00 +124 5.00000000000000e-01 +125 -5.00000000000000e-01 +126 0.00000000000000e+00 +127 5.00000000000000e-01 +128 -5.00000000000000e-01 +129 0.00000000000000e+00 +130 0.00000000000000e+00 +131 -0.00000000000000e+00 +132 0.00000000000000e+00 +133 0.00000000000000e+00 +134 -5.00000000000000e-01 +135 0.00000000000000e+00 +136 0.00000000000000e+00 +137 -5.00000000000000e-01 +138 0.00000000000000e+00 +139 5.00000000000000e-01 +140 -0.00000000000000e+00 +141 0.00000000000000e+00 +142 5.00000000000000e-01 +143 -0.00000000000000e+00 +144 0.00000000000000e+00 +145 5.00000000000000e-01 +146 -5.00000000000000e-01 +147 0.00000000000000e+00 +148 5.00000000000000e-01 +149 -5.00000000000000e-01 +150 0.00000000000000e+00 +151 0.00000000000000e+00 +152 -0.00000000000000e+00 +153 0.00000000000000e+00 +154 0.00000000000000e+00 +155 -5.00000000000000e-01 +156 0.00000000000000e+00 +157 0.00000000000000e+00 +158 -5.00000000000000e-01 +159 0.00000000000000e+00 +160 5.00000000000000e-01 +161 -0.00000000000000e+00 +162 0.00000000000000e+00 +163 5.00000000000000e-01 +164 -0.00000000000000e+00 +165 0.00000000000000e+00 +166 5.00000000000000e-01 +167 -5.00000000000000e-01 +168 0.00000000000000e+00 +169 5.00000000000000e-01 +170 -5.00000000000000e-01 +171 0.00000000000000e+00 +172 0.00000000000000e+00 +173 -0.00000000000000e+00 +174 0.00000000000000e+00 +175 0.00000000000000e+00 +176 -5.00000000000000e-01 +177 0.00000000000000e+00 +178 0.00000000000000e+00 +179 -5.00000000000000e-01 +180 0.00000000000000e+00 +181 5.00000000000000e-01 +182 -0.00000000000000e+00 +183 0.00000000000000e+00 +184 5.00000000000000e-01 +185 -0.00000000000000e+00 +186 0.00000000000000e+00 +187 5.00000000000000e-01 +188 -5.00000000000000e-01 +189 0.00000000000000e+00 +190 5.00000000000000e-01 +191 -5.00000000000000e-01 +192 0.00000000000000e+00 +193 0.00000000000000e+00 +194 -0.00000000000000e+00 +195 0.00000000000000e+00 +196 0.00000000000000e+00 +197 -5.00000000000000e-01 +198 0.00000000000000e+00 +199 0.00000000000000e+00 +200 -5.00000000000000e-01 +201 0.00000000000000e+00 +202 5.00000000000000e-01 +203 -0.00000000000000e+00 +204 0.00000000000000e+00 +205 5.00000000000000e-01 +206 -0.00000000000000e+00 +207 0.00000000000000e+00 +208 5.00000000000000e-01 +209 -5.00000000000000e-01 +210 0.00000000000000e+00 +211 5.00000000000000e-01 +212 -5.00000000000000e-01 +213 0.00000000000000e+00 +214 0.00000000000000e+00 +215 -0.00000000000000e+00 +216 0.00000000000000e+00 +217 0.00000000000000e+00 +218 -5.00000000000000e-01 +219 0.00000000000000e+00 +220 0.00000000000000e+00 +221 -5.00000000000000e-01 +222 0.00000000000000e+00 +223 5.00000000000000e-01 +224 -0.00000000000000e+00 +225 0.00000000000000e+00 +226 5.00000000000000e-01 +227 -0.00000000000000e+00 +228 0.00000000000000e+00 +229 5.00000000000000e-01 +230 -5.00000000000000e-01 +231 0.00000000000000e+00 +232 5.00000000000000e-01 +233 -5.00000000000000e-01 +234 0.00000000000000e+00 +235 0.00000000000000e+00 +236 -0.00000000000000e+00 +237 0.00000000000000e+00 +238 0.00000000000000e+00 +239 -5.00000000000000e-01 +240 0.00000000000000e+00 +241 0.00000000000000e+00 +242 -5.00000000000000e-01 +243 0.00000000000000e+00 +244 5.00000000000000e-01 +245 -0.00000000000000e+00 +246 0.00000000000000e+00 +247 5.00000000000000e-01 +248 -0.00000000000000e+00 +249 0.00000000000000e+00 +250 5.00000000000000e-01 +251 -5.00000000000000e-01 +252 0.00000000000000e+00 +253 5.00000000000000e-01 +254 -5.00000000000000e-01 +255 0.00000000000000e+00 +256 0.00000000000000e+00 +257 -0.00000000000000e+00 +258 0.00000000000000e+00 +259 0.00000000000000e+00 +260 -5.00000000000000e-01 +261 0.00000000000000e+00 +262 0.00000000000000e+00 +263 -5.00000000000000e-01 +264 0.00000000000000e+00 +265 5.00000000000000e-01 +266 -0.00000000000000e+00 +267 0.00000000000000e+00 +268 5.00000000000000e-01 +269 -0.00000000000000e+00 +270 0.00000000000000e+00 +271 5.00000000000000e-01 +272 -5.00000000000000e-01 +273 0.00000000000000e+00 +274 5.00000000000000e-01 +275 -5.00000000000000e-01 +276 0.00000000000000e+00 +277 0.00000000000000e+00 +278 -5.00000000000000e-01 +279 0.00000000000000e+00 +280 5.00000000000000e-01 +281 -0.00000000000000e+00 +282 0.00000000000000e+00 +283 5.00000000000000e-01 +284 -5.00000000000000e-01 +285 0.00000000000000e+00 +286 0.00000000000000e+00 +287 -1.00000000000000e+00 +288 0.00000000000000e+00 +289 5.00000000000000e-01 +290 -1.00000000000000e+00 +291 0.00000000000000e+00 +292 5.00000000000000e-01 +293 -1.00000000000000e+00 +294 0.00000000000000e+00 +295 0.00000000000000e+00 +296 -1.00000000000000e+00 +297 0.00000000000000e+00 +298 5.00000000000000e-01 +299 -1.00000000000000e+00 +300 0.00000000000000e+00 +301 5.00000000000000e-01 +302 -1.00000000000000e+00 +303 0.00000000000000e+00 +304 0.00000000000000e+00 +305 -1.00000000000000e+00 +306 0.00000000000000e+00 +307 5.00000000000000e-01 +308 -1.00000000000000e+00 +309 0.00000000000000e+00 +310 5.00000000000000e-01 +311 -1.00000000000000e+00 +312 0.00000000000000e+00 +313 0.00000000000000e+00 +314 -1.00000000000000e+00 +315 0.00000000000000e+00 +316 5.00000000000000e-01 +317 -1.00000000000000e+00 +318 0.00000000000000e+00 +319 5.00000000000000e-01 +320 -1.00000000000000e+00 +321 0.00000000000000e+00 +322 0.00000000000000e+00 +323 -1.00000000000000e+00 +324 0.00000000000000e+00 +325 5.00000000000000e-01 +326 -1.00000000000000e+00 +327 0.00000000000000e+00 +328 5.00000000000000e-01 +329 -1.00000000000000e+00 +330 0.00000000000000e+00 +331 0.00000000000000e+00 +332 -1.00000000000000e+00 +333 0.00000000000000e+00 +334 5.00000000000000e-01 +335 -1.00000000000000e+00 +336 0.00000000000000e+00 +337 5.00000000000000e-01 +338 -1.00000000000000e+00 +339 0.00000000000000e+00 +340 0.00000000000000e+00 +341 -1.00000000000000e+00 +342 0.00000000000000e+00 +343 5.00000000000000e-01 +344 -1.00000000000000e+00 +345 0.00000000000000e+00 +346 5.00000000000000e-01 +347 -1.00000000000000e+00 +348 0.00000000000000e+00 +349 0.00000000000000e+00 +350 -1.00000000000000e+00 +351 0.00000000000000e+00 +352 5.00000000000000e-01 +353 -1.00000000000000e+00 +354 0.00000000000000e+00 +355 5.00000000000000e-01 +356 -1.00000000000000e+00 +357 0.00000000000000e+00 +358 5.00000000000000e-01 +359 -1.00000000000000e+00 +360 0.00000000000000e+00 +361 1.00000000000000e+00 +362 -0.00000000000000e+00 +363 0.00000000000000e+00 +364 1.00000000000000e+00 +365 -5.00000000000000e-01 +366 0.00000000000000e+00 +367 1.00000000000000e+00 +368 -5.00000000000000e-01 +369 0.00000000000000e+00 +370 1.00000000000000e+00 +371 -0.00000000000000e+00 +372 0.00000000000000e+00 +373 1.00000000000000e+00 +374 -5.00000000000000e-01 +375 0.00000000000000e+00 +376 1.00000000000000e+00 +377 -5.00000000000000e-01 +378 0.00000000000000e+00 +379 1.00000000000000e+00 +380 -0.00000000000000e+00 +381 0.00000000000000e+00 +382 1.00000000000000e+00 +383 -5.00000000000000e-01 +384 0.00000000000000e+00 +385 1.00000000000000e+00 +386 -5.00000000000000e-01 +387 0.00000000000000e+00 +388 1.00000000000000e+00 +389 -0.00000000000000e+00 +390 0.00000000000000e+00 +391 1.00000000000000e+00 +392 -5.00000000000000e-01 +393 0.00000000000000e+00 +394 1.00000000000000e+00 +395 -5.00000000000000e-01 +396 0.00000000000000e+00 +397 1.00000000000000e+00 +398 -0.00000000000000e+00 +399 0.00000000000000e+00 +400 1.00000000000000e+00 +401 -5.00000000000000e-01 +402 0.00000000000000e+00 +403 1.00000000000000e+00 +404 -5.00000000000000e-01 +405 0.00000000000000e+00 +406 1.00000000000000e+00 +407 -0.00000000000000e+00 +408 0.00000000000000e+00 +409 1.00000000000000e+00 +410 -5.00000000000000e-01 +411 0.00000000000000e+00 +412 1.00000000000000e+00 +413 -5.00000000000000e-01 +414 0.00000000000000e+00 +415 1.00000000000000e+00 +416 -0.00000000000000e+00 +417 0.00000000000000e+00 +418 1.00000000000000e+00 +419 -5.00000000000000e-01 +420 0.00000000000000e+00 +421 1.00000000000000e+00 +422 -5.00000000000000e-01 +423 0.00000000000000e+00 +424 1.00000000000000e+00 +425 -0.00000000000000e+00 +426 0.00000000000000e+00 +427 1.00000000000000e+00 +428 -5.00000000000000e-01 +429 0.00000000000000e+00 +430 1.00000000000000e+00 +431 -5.00000000000000e-01 +432 0.00000000000000e+00 +433 1.00000000000000e+00 +434 -5.00000000000000e-01 +435 0.00000000000000e+00 +436 1.00000000000000e+00 +437 -1.00000000000000e+00 +438 0.00000000000000e+00 +439 1.00000000000000e+00 +440 -1.00000000000000e+00 +441 0.00000000000000e+00 +442 1.00000000000000e+00 +443 -1.00000000000000e+00 +444 0.00000000000000e+00 +445 1.00000000000000e+00 +446 -1.00000000000000e+00 +447 0.00000000000000e+00 +448 1.00000000000000e+00 +449 -1.00000000000000e+00 +450 0.00000000000000e+00 +451 1.00000000000000e+00 +452 -1.00000000000000e+00 +453 0.00000000000000e+00 +454 1.00000000000000e+00 +455 -1.00000000000000e+00 +456 0.00000000000000e+00 +457 1.00000000000000e+00 +458 -1.00000000000000e+00 diff --git a/external/hypre/src/test/TEST_ij/data/beam_tet_dof459_np1/rbms.2.00000 b/external/hypre/src/test/TEST_ij/data/beam_tet_dof459_np1/rbms.2.00000 new file mode 100644 index 00000000..e29129bc --- /dev/null +++ b/external/hypre/src/test/TEST_ij/data/beam_tet_dof459_np1/rbms.2.00000 @@ -0,0 +1,460 @@ +0 459 +0 -0.00000000000000e+00 +1 0.00000000000000e+00 +2 0.00000000000000e+00 +3 -0.00000000000000e+00 +4 0.00000000000000e+00 +5 1.00000000000000e+00 +6 -0.00000000000000e+00 +7 0.00000000000000e+00 +8 2.00000000000000e+00 +9 -0.00000000000000e+00 +10 0.00000000000000e+00 +11 3.00000000000000e+00 +12 -0.00000000000000e+00 +13 0.00000000000000e+00 +14 4.00000000000000e+00 +15 -0.00000000000000e+00 +16 0.00000000000000e+00 +17 5.00000000000000e+00 +18 -0.00000000000000e+00 +19 0.00000000000000e+00 +20 6.00000000000000e+00 +21 -0.00000000000000e+00 +22 0.00000000000000e+00 +23 7.00000000000000e+00 +24 -0.00000000000000e+00 +25 0.00000000000000e+00 +26 8.00000000000000e+00 +27 -0.00000000000000e+00 +28 0.00000000000000e+00 +29 0.00000000000000e+00 +30 -0.00000000000000e+00 +31 0.00000000000000e+00 +32 1.00000000000000e+00 +33 -0.00000000000000e+00 +34 0.00000000000000e+00 +35 2.00000000000000e+00 +36 -0.00000000000000e+00 +37 0.00000000000000e+00 +38 3.00000000000000e+00 +39 -0.00000000000000e+00 +40 0.00000000000000e+00 +41 4.00000000000000e+00 +42 -0.00000000000000e+00 +43 0.00000000000000e+00 +44 5.00000000000000e+00 +45 -0.00000000000000e+00 +46 0.00000000000000e+00 +47 6.00000000000000e+00 +48 -0.00000000000000e+00 +49 0.00000000000000e+00 +50 7.00000000000000e+00 +51 -0.00000000000000e+00 +52 0.00000000000000e+00 +53 8.00000000000000e+00 +54 -1.00000000000000e+00 +55 0.00000000000000e+00 +56 0.00000000000000e+00 +57 -1.00000000000000e+00 +58 0.00000000000000e+00 +59 1.00000000000000e+00 +60 -1.00000000000000e+00 +61 0.00000000000000e+00 +62 2.00000000000000e+00 +63 -1.00000000000000e+00 +64 0.00000000000000e+00 +65 3.00000000000000e+00 +66 -1.00000000000000e+00 +67 0.00000000000000e+00 +68 4.00000000000000e+00 +69 -1.00000000000000e+00 +70 0.00000000000000e+00 +71 5.00000000000000e+00 +72 -1.00000000000000e+00 +73 0.00000000000000e+00 +74 6.00000000000000e+00 +75 -1.00000000000000e+00 +76 0.00000000000000e+00 +77 7.00000000000000e+00 +78 -1.00000000000000e+00 +79 0.00000000000000e+00 +80 8.00000000000000e+00 +81 -1.00000000000000e+00 +82 0.00000000000000e+00 +83 0.00000000000000e+00 +84 -1.00000000000000e+00 +85 0.00000000000000e+00 +86 1.00000000000000e+00 +87 -1.00000000000000e+00 +88 0.00000000000000e+00 +89 2.00000000000000e+00 +90 -1.00000000000000e+00 +91 0.00000000000000e+00 +92 3.00000000000000e+00 +93 -1.00000000000000e+00 +94 0.00000000000000e+00 +95 4.00000000000000e+00 +96 -1.00000000000000e+00 +97 0.00000000000000e+00 +98 5.00000000000000e+00 +99 -1.00000000000000e+00 +100 0.00000000000000e+00 +101 6.00000000000000e+00 +102 -1.00000000000000e+00 +103 0.00000000000000e+00 +104 7.00000000000000e+00 +105 -1.00000000000000e+00 +106 0.00000000000000e+00 +107 8.00000000000000e+00 +108 -0.00000000000000e+00 +109 0.00000000000000e+00 +110 5.00000000000000e-01 +111 -0.00000000000000e+00 +112 0.00000000000000e+00 +113 0.00000000000000e+00 +114 -0.00000000000000e+00 +115 0.00000000000000e+00 +116 5.00000000000000e-01 +117 -5.00000000000000e-01 +118 0.00000000000000e+00 +119 0.00000000000000e+00 +120 -5.00000000000000e-01 +121 0.00000000000000e+00 +122 5.00000000000000e-01 +123 -5.00000000000000e-01 +124 0.00000000000000e+00 +125 0.00000000000000e+00 +126 -5.00000000000000e-01 +127 0.00000000000000e+00 +128 5.00000000000000e-01 +129 -0.00000000000000e+00 +130 0.00000000000000e+00 +131 1.50000000000000e+00 +132 -0.00000000000000e+00 +133 0.00000000000000e+00 +134 1.00000000000000e+00 +135 -0.00000000000000e+00 +136 0.00000000000000e+00 +137 1.50000000000000e+00 +138 -5.00000000000000e-01 +139 0.00000000000000e+00 +140 1.00000000000000e+00 +141 -5.00000000000000e-01 +142 0.00000000000000e+00 +143 1.50000000000000e+00 +144 -5.00000000000000e-01 +145 0.00000000000000e+00 +146 1.00000000000000e+00 +147 -5.00000000000000e-01 +148 0.00000000000000e+00 +149 1.50000000000000e+00 +150 -0.00000000000000e+00 +151 0.00000000000000e+00 +152 2.50000000000000e+00 +153 -0.00000000000000e+00 +154 0.00000000000000e+00 +155 2.00000000000000e+00 +156 -0.00000000000000e+00 +157 0.00000000000000e+00 +158 2.50000000000000e+00 +159 -5.00000000000000e-01 +160 0.00000000000000e+00 +161 2.00000000000000e+00 +162 -5.00000000000000e-01 +163 0.00000000000000e+00 +164 2.50000000000000e+00 +165 -5.00000000000000e-01 +166 0.00000000000000e+00 +167 2.00000000000000e+00 +168 -5.00000000000000e-01 +169 0.00000000000000e+00 +170 2.50000000000000e+00 +171 -0.00000000000000e+00 +172 0.00000000000000e+00 +173 3.50000000000000e+00 +174 -0.00000000000000e+00 +175 0.00000000000000e+00 +176 3.00000000000000e+00 +177 -0.00000000000000e+00 +178 0.00000000000000e+00 +179 3.50000000000000e+00 +180 -5.00000000000000e-01 +181 0.00000000000000e+00 +182 3.00000000000000e+00 +183 -5.00000000000000e-01 +184 0.00000000000000e+00 +185 3.50000000000000e+00 +186 -5.00000000000000e-01 +187 0.00000000000000e+00 +188 3.00000000000000e+00 +189 -5.00000000000000e-01 +190 0.00000000000000e+00 +191 3.50000000000000e+00 +192 -0.00000000000000e+00 +193 0.00000000000000e+00 +194 4.50000000000000e+00 +195 -0.00000000000000e+00 +196 0.00000000000000e+00 +197 4.00000000000000e+00 +198 -0.00000000000000e+00 +199 0.00000000000000e+00 +200 4.50000000000000e+00 +201 -5.00000000000000e-01 +202 0.00000000000000e+00 +203 4.00000000000000e+00 +204 -5.00000000000000e-01 +205 0.00000000000000e+00 +206 4.50000000000000e+00 +207 -5.00000000000000e-01 +208 0.00000000000000e+00 +209 4.00000000000000e+00 +210 -5.00000000000000e-01 +211 0.00000000000000e+00 +212 4.50000000000000e+00 +213 -0.00000000000000e+00 +214 0.00000000000000e+00 +215 5.50000000000000e+00 +216 -0.00000000000000e+00 +217 0.00000000000000e+00 +218 5.00000000000000e+00 +219 -0.00000000000000e+00 +220 0.00000000000000e+00 +221 5.50000000000000e+00 +222 -5.00000000000000e-01 +223 0.00000000000000e+00 +224 5.00000000000000e+00 +225 -5.00000000000000e-01 +226 0.00000000000000e+00 +227 5.50000000000000e+00 +228 -5.00000000000000e-01 +229 0.00000000000000e+00 +230 5.00000000000000e+00 +231 -5.00000000000000e-01 +232 0.00000000000000e+00 +233 5.50000000000000e+00 +234 -0.00000000000000e+00 +235 0.00000000000000e+00 +236 6.50000000000000e+00 +237 -0.00000000000000e+00 +238 0.00000000000000e+00 +239 6.00000000000000e+00 +240 -0.00000000000000e+00 +241 0.00000000000000e+00 +242 6.50000000000000e+00 +243 -5.00000000000000e-01 +244 0.00000000000000e+00 +245 6.00000000000000e+00 +246 -5.00000000000000e-01 +247 0.00000000000000e+00 +248 6.50000000000000e+00 +249 -5.00000000000000e-01 +250 0.00000000000000e+00 +251 6.00000000000000e+00 +252 -5.00000000000000e-01 +253 0.00000000000000e+00 +254 6.50000000000000e+00 +255 -0.00000000000000e+00 +256 0.00000000000000e+00 +257 7.50000000000000e+00 +258 -0.00000000000000e+00 +259 0.00000000000000e+00 +260 7.00000000000000e+00 +261 -0.00000000000000e+00 +262 0.00000000000000e+00 +263 7.50000000000000e+00 +264 -5.00000000000000e-01 +265 0.00000000000000e+00 +266 7.00000000000000e+00 +267 -5.00000000000000e-01 +268 0.00000000000000e+00 +269 7.50000000000000e+00 +270 -5.00000000000000e-01 +271 0.00000000000000e+00 +272 7.00000000000000e+00 +273 -5.00000000000000e-01 +274 0.00000000000000e+00 +275 7.50000000000000e+00 +276 -0.00000000000000e+00 +277 0.00000000000000e+00 +278 8.00000000000000e+00 +279 -5.00000000000000e-01 +280 0.00000000000000e+00 +281 8.00000000000000e+00 +282 -5.00000000000000e-01 +283 0.00000000000000e+00 +284 8.00000000000000e+00 +285 -0.00000000000000e+00 +286 0.00000000000000e+00 +287 5.00000000000000e-01 +288 -5.00000000000000e-01 +289 0.00000000000000e+00 +290 0.00000000000000e+00 +291 -5.00000000000000e-01 +292 0.00000000000000e+00 +293 5.00000000000000e-01 +294 -0.00000000000000e+00 +295 0.00000000000000e+00 +296 1.50000000000000e+00 +297 -5.00000000000000e-01 +298 0.00000000000000e+00 +299 1.00000000000000e+00 +300 -5.00000000000000e-01 +301 0.00000000000000e+00 +302 1.50000000000000e+00 +303 -0.00000000000000e+00 +304 0.00000000000000e+00 +305 2.50000000000000e+00 +306 -5.00000000000000e-01 +307 0.00000000000000e+00 +308 2.00000000000000e+00 +309 -5.00000000000000e-01 +310 0.00000000000000e+00 +311 2.50000000000000e+00 +312 -0.00000000000000e+00 +313 0.00000000000000e+00 +314 3.50000000000000e+00 +315 -5.00000000000000e-01 +316 0.00000000000000e+00 +317 3.00000000000000e+00 +318 -5.00000000000000e-01 +319 0.00000000000000e+00 +320 3.50000000000000e+00 +321 -0.00000000000000e+00 +322 0.00000000000000e+00 +323 4.50000000000000e+00 +324 -5.00000000000000e-01 +325 0.00000000000000e+00 +326 4.00000000000000e+00 +327 -5.00000000000000e-01 +328 0.00000000000000e+00 +329 4.50000000000000e+00 +330 -0.00000000000000e+00 +331 0.00000000000000e+00 +332 5.50000000000000e+00 +333 -5.00000000000000e-01 +334 0.00000000000000e+00 +335 5.00000000000000e+00 +336 -5.00000000000000e-01 +337 0.00000000000000e+00 +338 5.50000000000000e+00 +339 -0.00000000000000e+00 +340 0.00000000000000e+00 +341 6.50000000000000e+00 +342 -5.00000000000000e-01 +343 0.00000000000000e+00 +344 6.00000000000000e+00 +345 -5.00000000000000e-01 +346 0.00000000000000e+00 +347 6.50000000000000e+00 +348 -0.00000000000000e+00 +349 0.00000000000000e+00 +350 7.50000000000000e+00 +351 -5.00000000000000e-01 +352 0.00000000000000e+00 +353 7.00000000000000e+00 +354 -5.00000000000000e-01 +355 0.00000000000000e+00 +356 7.50000000000000e+00 +357 -5.00000000000000e-01 +358 0.00000000000000e+00 +359 8.00000000000000e+00 +360 -1.00000000000000e+00 +361 0.00000000000000e+00 +362 5.00000000000000e-01 +363 -1.00000000000000e+00 +364 0.00000000000000e+00 +365 0.00000000000000e+00 +366 -1.00000000000000e+00 +367 0.00000000000000e+00 +368 5.00000000000000e-01 +369 -1.00000000000000e+00 +370 0.00000000000000e+00 +371 1.50000000000000e+00 +372 -1.00000000000000e+00 +373 0.00000000000000e+00 +374 1.00000000000000e+00 +375 -1.00000000000000e+00 +376 0.00000000000000e+00 +377 1.50000000000000e+00 +378 -1.00000000000000e+00 +379 0.00000000000000e+00 +380 2.50000000000000e+00 +381 -1.00000000000000e+00 +382 0.00000000000000e+00 +383 2.00000000000000e+00 +384 -1.00000000000000e+00 +385 0.00000000000000e+00 +386 2.50000000000000e+00 +387 -1.00000000000000e+00 +388 0.00000000000000e+00 +389 3.50000000000000e+00 +390 -1.00000000000000e+00 +391 0.00000000000000e+00 +392 3.00000000000000e+00 +393 -1.00000000000000e+00 +394 0.00000000000000e+00 +395 3.50000000000000e+00 +396 -1.00000000000000e+00 +397 0.00000000000000e+00 +398 4.50000000000000e+00 +399 -1.00000000000000e+00 +400 0.00000000000000e+00 +401 4.00000000000000e+00 +402 -1.00000000000000e+00 +403 0.00000000000000e+00 +404 4.50000000000000e+00 +405 -1.00000000000000e+00 +406 0.00000000000000e+00 +407 5.50000000000000e+00 +408 -1.00000000000000e+00 +409 0.00000000000000e+00 +410 5.00000000000000e+00 +411 -1.00000000000000e+00 +412 0.00000000000000e+00 +413 5.50000000000000e+00 +414 -1.00000000000000e+00 +415 0.00000000000000e+00 +416 6.50000000000000e+00 +417 -1.00000000000000e+00 +418 0.00000000000000e+00 +419 6.00000000000000e+00 +420 -1.00000000000000e+00 +421 0.00000000000000e+00 +422 6.50000000000000e+00 +423 -1.00000000000000e+00 +424 0.00000000000000e+00 +425 7.50000000000000e+00 +426 -1.00000000000000e+00 +427 0.00000000000000e+00 +428 7.00000000000000e+00 +429 -1.00000000000000e+00 +430 0.00000000000000e+00 +431 7.50000000000000e+00 +432 -1.00000000000000e+00 +433 0.00000000000000e+00 +434 8.00000000000000e+00 +435 -1.00000000000000e+00 +436 0.00000000000000e+00 +437 5.00000000000000e-01 +438 -1.00000000000000e+00 +439 0.00000000000000e+00 +440 1.50000000000000e+00 +441 -1.00000000000000e+00 +442 0.00000000000000e+00 +443 2.50000000000000e+00 +444 -1.00000000000000e+00 +445 0.00000000000000e+00 +446 3.50000000000000e+00 +447 -1.00000000000000e+00 +448 0.00000000000000e+00 +449 4.50000000000000e+00 +450 -1.00000000000000e+00 +451 0.00000000000000e+00 +452 5.50000000000000e+00 +453 -1.00000000000000e+00 +454 0.00000000000000e+00 +455 6.50000000000000e+00 +456 -1.00000000000000e+00 +457 0.00000000000000e+00 +458 7.50000000000000e+00 diff --git a/external/hypre/src/test/TEST_ij/data/generate_poisson_10x10x10.sh b/external/hypre/src/test/TEST_ij/data/generate_poisson_10x10x10.sh new file mode 100755 index 00000000..88347fd7 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/data/generate_poisson_10x10x10.sh @@ -0,0 +1,54 @@ +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +#################################################################### +# This bash script is intended to regenerate the binary files under +# the folders poisson_10x10x10_np1 and poisson_10x10x10_np4 if the +# binary input/output functions from the IJ interface get changed. +#################################################################### + +function movefiles() { + mv -v IJ.out.A.${SUFFIX} ${DEST_DIR}/IJ.A.${PREC}.${SUFFIX} + mv -v IJ.out.b.${SUFFIX} ${DEST_DIR}/IJ.b.${PREC}.${SUFFIX} + mv -v IJ.out.x0.${SUFFIX} ${DEST_DIR}/IJ.x0.${PREC}.${SUFFIX} +} + +CWD=$(pwd) +HYPRE_SRC=$(dirname "$(readlink -f "${CWD}/../../")") +PREC_ARRAY=("i4f4" "i4f8" "i8f4" "i8f8") +CONFOPTS_ARRAY=("--disable-mixedint --enable-single" + "--disable-mixedint --disable-single" + "--enable-mixedint --enable-single" + "--enable-mixedint --disable-single") +IJOPTS="-n 10 10 10 -printbin -tol 1 -solver 2" + +for I in {0..3}; do + PREC=${PREC_ARRAY[${I}]} + CONFOPTS=${CONFOPTS_ARRAY[${I}]} + + cd ${HYPRE_SRC} + ./configure --enable-debug ${CONFOPTS} + make clean + make -j + cd test + make clean ij + + # Sequential case + DEST_DIR=${HYPRE_SRC}/test/TEST_ij/data/poisson_10x10x10_np1 + mpirun -np 1 ./ij ${IJOPTS} + SUFFIX=00000.bin + movefiles + + # Parallel case + DEST_DIR=${HYPRE_SRC}/test/TEST_ij/data/poisson_10x10x10_np4 + mpirun -np 4 ./ij ${IJOPTS} -P 2 2 1 + for J in {0..3}; do + SUFFIX=0000${J}.bin + movefiles + done + + rm -rf IJ.out.x.* +done diff --git a/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np1/IJ.A.i4f4.00000.bin b/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np1/IJ.A.i4f4.00000.bin new file mode 100644 index 0000000000000000000000000000000000000000..bb397ea07a5513f2f18dfe68dee5125e724940a9 GIT binary patch literal 76888 zcmeI*1DkqqfnBW`+0~kfU9Fkf{n0G^Tx(W#C9| zRoR!U#=c~A_9bhuueBz-T5GW@S(|;yI_yi`S(1U$O)H zk{#KX?8LrgXZE#rVOMKcb|t&9FWH@a$sX)W_GDkO7yFXE*_Z6YzGPqawf1B8NBi@0 ztpnKAI*?thgV@zNm|d-A>}nmtuGXRKY8}SzkDBvytrqM`TCy)`#lEC9`;s>7OWLw8 zX~({#J^PXl>}z#oSJH`nrZZWl3t6TsS*9CVraM`t2U(^kS*90RNpJQgeb{IEl4bgl zW%`q429RY2l4S;wWd@UFhLDvEWnVIkeP%dW=5Vsi5oDPo$udWgWsWAx97C2lmaODB z_9e%&&zwM(Igu=L5?SVCvdk%DnN!I!r;%k&Co4IFeaQ&+nKQ{UXOU&jCd-^dmN}O! za~@gde6q|1WF;fnmyBYcxsWV#5n1M9vdkr9nM=tsmyu;IC(B$xR&pi#lF{rlW5_aB zk!7wX%Una2xt1(*9a-jjvdj%+B{#A!xru$|X0psJWSLvZGPjXsZYRs!L6*6bEOQrG z$=&R0-NUYAEc=pi>`U%tUveM&lKa`0Jixx>LG~r%+1HxDuGT~BN*-ok@(BBqN7|Q3%qwIiud*+B zjeX{IvdkM~nTceXH_0+@k!9W{%e+IDd6%r@J@zHrf_=%C>@#1HWxgiMd_$J`mMrrfS>}7P%nxLlAIVC7Vqfwz`^+z7nP15= zzma8rC(Hb=|3k*qe7G_-&&)JrnQ6&Nrej|+J^RcIWSJSsGBc57W+uzbLYA48EHfKf zW_GfYIoOxX$v!g|S!Qms%sgb7dC4;Kk!9v5%Pc^aS&*z`A@(H;v(GF-mRXc6vlv-s zak9)3WSJ$&G7ZQwOOcf<&AwJcb|sD2mn_4+WLfql%dsz6o_)y*>`PW;U$PSWS}U`w zwF%noFk z9mz5~k!5x!%j`my*_AA_8(C&|vXVX6m+Z+tvlm%rZ?eojWSM=*GW(Hb_9x36K$ba> ztmGi}B?q(5G$YF#LY6s{EOQuHra4)r1zDygS*8_PNo)2cZP;hpl4aVFW!jTvI*?^L zl4UxPWjd2(x{#H0Wna>beWp8ErUzN3Ct0Q!S*ABxrVm-BFIlD^SxJBPB?H)J29jk4 zk!1#xWrmPthLUB5k!6OHWez7RIf8wyBiWT4#lGZd_9e%#FFBTd$#LvUj%QzT0{fB^ z+1EOWU9FSZm7K!9`O+lFFBKa$yw}coz1S~9QK)W$uj4WWzHwd zTtJo?NtPK!mbs8Da}im|#q3KiVV}8_EOQxI=5n&k6=az!$ugtKGGoXxSCN%m&A#Ls z_L*zRGS`u1t|!afK$f|YEOQfC=4P_YEo3FPvM;%fedczu%pGKzJIOM4k!9{C%iKej z8B3NKM^JVTawmMrreS;_P4OI~1~d66vh5?SVDvdk-FnODg&uaRY5C(FD+Rx*)& z$(!smZ;@r*Cd<4-mU)*f^B!5|eX`64WSI}iNtl8$pRh0alzqu(>`OjpU-AX} zk}uhpe8s-xYxcFiVOQ&0b|v4jFZrH*$q(#Heq>+r6Z?{%*_ZsnzT{W-wSHq)@;m#? z|N4J=nTG%SQDthLnQ6!}(~@PTBg;%rmYIPpGb35aOzcZ$W}lgbEHf)vW;U|S>|~ia z$TD-1W#%Hw%uQA@5BrjN*=Ob>%gj%fS%56FAX#Q1vdqF{nMKGli;|Tr#=c~6_L(Kf zGE0(W8jxj{BFijImT5?qX+)M;hOA^+_9e@)&n!=tS%ECGB3Wi7vdqe4nN`R#tCD3_ zBP&^*eaRZ^Gi#D%)*{QSO_o`QEVC|IW<9dZ`ed06$VxV3U$PPV%*JGyO~^8vl4Uj{ z%QPm-Y)+PGLYCQrtYk~}C0nu2Y)zKghAh*REVC_HW;?RX_GFnI$TB;UmF&d6*3Rro zc41$#EBlh&*q7|izGM&fC3~_j*^7P2-t24b!>-o8>`L}yU$Q^@k^|V69LT=pAoe8( zvoC4JzT^=0wGL%hav1webFxeevP?^|Oe?ZXYqCrmvP@gDOgplY_UubKu+MZP%XA{k zbSBGmAy~zN8oXOmDJGAF@nevP?g+On0J6+Lvdkc|lELgt zhOo~JCCdyW%M2&W98Q)wf-G|+S>`CR%+X{e$FMIsmVM?pvdr;hnG?t|Cz54OBFmgi zmN|tib1GTMY3xf*XP-HPEHi>Eb0%5lEV9hmWSMiwGUt+I&Lb;1pMA*%>@y?DGNZ^c z7m{TzBFkJ%mbrv1b17NoGP07(*_T|wK652mW;9u53|ZzXvdq0*OFzfBP+R{ zeXSeVmE6d_`QKAUvfM9k~`Sfx|3b4yV#Z7&A#Lw_9bK4myBay zaxeRm``DM<&%WdV_O%{lS2CV`W&&B}A+pTFWSK|EGLMpF9wW; zJWZB)hAi_eS>`#i%=2WK7sxU%l4V{ZD|wlH$t&zLuaae6Bg?!_mU)9LGm$LwCRye! zvdr6LCGW5=d6#|WJ+jREWSI}hG9Qv`LU z%-3X@Z^$y=l4ZUl%Y08(@&o&lAK7PqBFp?tmidJ&^D9~AH?qv{WSRfGYeT}R}##au4EhtB_?@CCjWvmRX%F zvj$maO|r~dWF>2}FIk6uW?iz(dSsdP$ub*|Wi}+sY($pXm@KmiS;?mCOEzPlX-t;c zoGjCXEVBh!W=pcnR%Ds2$uirJl{95vvMu|}c4V3D$uc{TWp*UX>_nE?nJlvlS!P$V zlHJ&s?9M*32U%uMvdms&nZ3y}`;cY!CCltbmf4@IC4Je~>c_66Kl_pa>`Ml+FB!zXWH9@ZA?!kvM(9M zzSf28YF)&x`N|ZUvdTek}KJljAmbJ47*xau`9WneaSWKORi;K zavl4U>)Dswz`o>0_9Zv5uXQuKTDPz(xs`p%ZR|^KXJ2v$`;t4^m)ym^`LxsUveM&lKa`0Jixx>LG~r%*_TXUU-A(9S`V|U^$5F?N7`Pu{U-BCJTCcPF zqc`}u)@PScD3GRSL;1?wccmk2%n~n*GcSm=kTP+0V>~xzM(n{me|5 z8||vu&&-T@(7u}e%)ID;S>S)oiuus7nxoTf{5(H8!8v;QJ1>CFaE@;N-V34&oTHz= z`$Fgn=jiC~zc9MNIeOY*5p;)hbhXE#=mF>GYoEo?6VB0japqpIn_ca)1bSC<^tQ{A z=mY2IZI=e<3+L!`>pVe^;oTK*|%*VoRcD2izIIfzbw_Vo4@o;VcKWmq@aY8jm zZ@a966X6`a?XoUTf^+n?%X&B&&e7X0>*EwSM{m1qfK%Zdz3sChPJ?sw-iY~h*v+nX z*%)V3bM&^$CKv(d=xvuxaVDIjw_P^FS#XZtc4>^W;T*l~vN_IybM&@L6Pyd@=xvuR za2}kaw|%z6`EZWjTQOe%yV=z)TVrH3M{m1qgHdpf-gaq<3*j8S8#8Z%U-w^&e7X0d*eDdM{oP=gX`fO zz4v9l0d}*iUG~F`)f~O;vOjKubM&^$0k|2?(c3Nu;ubhZZ@V0XTj3nN?Q$?~gLCw@ zOEcUK=jd&hLvRP2qqlty#hq}D-iI;Y1-seRE_YYY=xmRB;4}K#VJv(`SAYL;@EJY* z-S36Z=-7<;KKP7&{?7NqXLR%TeE>eAm%s0W@EM)PGdG9-)dC$cp_-@WY1R^*@K7~R z!_&{ULT5Z&&C~Mqv#rquk5uz?JpF7Nbj739JUvf8+ZNsMST)bU)6cd;cRXIrGxGGa z?a>2IRP#(c{cH#H#FN!LGfzL;3s1prv%pUF>5ZqWc~+j$-%fq-44h{}+`wLa@hqHY zN8G_~{qP)|=Rn-Te*N)0oaaQ`!;S;+0-WbU+{B&(@gkh(M%=}&gYXiZ=Rw@Y&V%tX zoaaT{X9)8vu>XAUF7_RYSF3q`o^d1l4#R73UI1|;`wqwJa9$8`Bl{kXH{iSw;zss8 z0u$l9Fycn`JrZxic@e~o?0Xd6g7cz?8x3YY8gIjSF~p7Rd<@=!^Wumb9n1VK?7sxO zi+zv7d)2%o&$y9&kH`CPZh*LveNVs#a9#>=Bm16+58=Et;zss82_M0^A>u~%JsBUv zxe?+<_B{okzgWaU=U)hgr#-w?y2?&evl$ zGUu%jH@bm&cJ}t)8Y5xf8!-oa=WQ?we#X8xVNNpVridHa_h!sR=DaQ9M)ti0bCWr5 zhq#e_Z^b-h&f6nyWZ&B`FPZZWh#T4WcFafSyd&a9_Pqo1lR58%xRIUj!~$f_J0os% z7xRMb?Y|4`Y~Q=F5PRoc5jV2$Jy@8`c{jw3>^l~VkU8&;xRHIwVNo*YJrFmt@4Z-z z%z015jqH0L7AJGw3vna+-j5~7ocBiD$i5F?Niyes5I3^(gJ?kJyf5NLX_?lYFTA$y+(AZ{~`xez#8nG+rs<_yofc~JGX=RlXwYhv3G6{ z^QZ7K)@JYA0p_n@9d>r>2s_#5RjkY2xf7zlonFIwWX_!tH?Y_1Sf9+f3*ruTdjlJg zId?_e!hRF6A(?YG#69fzCN?5-?vA*LJ>SB{WX?Shcd_f+*o4fvC*n4Ceg~V9Irl=` z=UwK_*xSE1yo-I`Lu2;NeGoUY@B7%C%(*Y(M)v&xO~{=4A#OC0`9o|$=G-4~qc@p9 z!j@#t0}wZ|@5k7R%y}TOo`+kRA$efQx+{nJ)V^=cgV-Pp8^AFgK%=uWvjeca_oxS~!gLkp- zPuPRK^YMrq+4pDcN#=Y4;zsuU1$&V>pNP1TeSgK?WX>lcZe-uzun(E@$%q@-_jl|| z=6nj`M)vjHX+Johinx(|eRtX)&Zi-6WM|)<4uJFNh#UFtbRg`12E2=XeRnzt&La>v zvajz>2gCVH#EtAb1N&xhJ_~Up`_9Pz5ICQWxRHH*cRCc#=OAumU*DY$gY&sO;zsuM z-Kja8&m)T)+1Gcc7H~eFEN*0H-Wqy^DQ)cWMpiQS9PI_VwMV z4V*6|iyPV3cc->+zKAStWMAK%+QIo^vbd3beRpaP=S#@qM)vjHsRNuZC5s!`*LSCm zaK6llr=PR0?@pbn`Es(jk)3^a>I~;A$l^x6J9UBmuVn9C?CZNz*J>WkK5k@R-<`U_ zc??K)#T^>W>d~uVQKFB_9V5bw{b3FU#ezD0}lYupv&X=EvCk z*)_2dPOs+2+56eGurbc4<|o+u*|o6=MpW~Y?EUOI*c4}0^Hc2o>}EI%c6*wgo$S*X zXIJwx?4!S(Hpe+|ewHk5V6P@P7tYU-#U1Rn1^JH-g`)!Hy;rs$w+{2Dr;Q~0n zNESD-=hher=arTdUm=V8Y|GCV!TztZ_b&F`4i{JRYwY7j z_T3(r!1;BuxRHH#z@>10gDh@j-yLxooF|gSjqJMj>Hv+quEBm1_%J#hBj zDQ;xvmKY0X-<{${t@wEy?C-micd>74+*{4QJH?Ic+XnZ+*>|V7k$v0ZemMK?6gRSO zJ3Ihq-<{${_HB;`;q1Fp+{nHiFdoiRA#P;fj+g-FsS!7_Zznti=V=f(vU6uV4CiSP zH|oOt2<$%{yo-Ii;?ZiJo@d<1zTNN`oM%AX$iCh2IGkrh+{nH?@C2M^Lfpu{J@F)* zXGYw}zP<1ioM%DY$iBVtG@NHe+{nIt@C=-1L)^&Deeo=uXGh$qAMu_EWaihbT-+=uWf_Jg+5tvxb3-gQ{+4o4i3Fk!+ zH?r?hcni*pB5q{gqwzMJ7en00zQ^DlI4_R4k$sQFyKr6taU=U4hxg#TB;rQ)Js$7F zxdGxvc0K_gzzZe!0+;By(oUF`TNd@hT) ziTyr<&*c#Ju-oVGxjf<)_WA-oS3umsPG7?3iijK7=_~kL3DN&+=9928PR7~zrkYpb zX?6n3uCQm;* z0weKLHLu0f&z^}<__>BRZehR6F%6mXMu>aZ@d`{!=DacDCic7%(~&uE zg1C!aM`L<2=S>l}vGW+rK<2y|;yza~&&b~Xjp1GFdo^Za@4PwUM)ti1Gm|+tLEOl` z*J2hj=PeL7vhQ`6mCSid#EtBGJ!T_w-U@Le``&=r$(*-F+{nH+Vh%FrZ4fuI?@gGK z%(*GzMs~g#bCEf3i@4D(%yYB1|90>$_PrJJuy@`baU=WQhIz@HcR<|8zPDpOGUpu; zH?r>?n4ipfC&Z2HdnXnkbKV(oBm3Tk1<9OuLEOl`cVi(k=UovuvhO`un9O-M#EtAc z7K@NM?~b_9IOav!+kX#u7yI6e#n?OViMWw{@5AC`&U+zlWZ(O-1ex>Rh#T4W0W3-8 zybt0=_I(fy$ei~@+{nJ;u@sr}eux{{cLJ6sbKW0uBl|vthGfnMAZ}#mhtY`4`9Q>t z9${XFz5Ne@cd_rISeCu>!H65#_c1I-=G+W%Bl|v%<;k26LEOl`PhbTy=R*-UvhR~v zk<9rp#EtCx6jma0ZjQK-eV@k4WX>%RH?r?DScS~FCE`YQeio~eIk!UG=sD)q*xSD~ zyo-IG$Lj2z+aPXa-xsh3nR8pjjqLj()+BRohq#e_U&2~s&g~I5vhT}So6NZb;zss; z1?!MGcSPLCzOQ0kGUrZ+8`<|YtVibD8F3>!zmE0EoVy@y^ak?=?Cswb-o?HXu_1fs zZipM%_f2d>=G+}|Bm2IEjmeyQAZ}#ex3LMCb5F#L?E4NjC3EhDxRHI|#b#vAy%9IE z?|W!W=G+HyBm2IO&B>hmB5q{o5730nxgX+2A2M&j-v0gJUF`c2wq)--0C6MxevGZi zoChLqWZzG)HJS4u#EtCxDYhYV9*nq=eLq7}GUp+P8`<}BY)j@m6mcW_eu3@CoQEN9 zWZy5bJ(=@x#EtCy6?PzVJ{)nQubFpbZ~r6UUF^FPJD*1)?qk=T+50>SaT|N?!rtf6 zh`ZQvSN1-SLEOZCyRr9qEaDz^+nv47;}Ey7*B|`I`oeqWb zIf(vt^4;k$IG;-vH?WuQPR-$b9$DPMZoWIUfb;oeaSQwT?$i>_7m&q0?C85wD>#oN zi<{Wfcc<2H9z_;+v8(S+ZQy(%S=`3XzB{#r^F?HFAK#tY!TuMs_b&GJ-KjmCFJTuq zvajz>9pHQ^S=`9JzB_e<^JQdlBm4U9)Cta)lf{kf>$_8DIA1{)H?ptqPF>)9C0X3a zzP>wkh4W~#xRHH*cj^Y`F=TNgJNxd`9nM#g#f^M->H+&-&EC7%*LSC$)qD;6xRHH* zcj^V_Ysun9_VwMVH=M5{iyPV3cc(sZzMd>@WZwqp3+Efi;zsse3jN@GBU#+YzDuJ& zoNpqF8`-xZ2Eh4dvbd3*8(|=vZy}2tEyK@)VE-=3d?#7l$i6FLIGpbyiyPT@B^(atyUF54_FWlA!1*4sxRHHV z!I5wtOBOe>^Qt%s&g019Myv7j(Xju$?7fS9SI05cd>{L`k$u;|v2ebhEN*1qHE|rA zA0Uex*>^1*59bHT;zsse8z;bdJXzexzU$ybI8Pvp8`*bVoCN2G$l^x!T@NS2`C+oS zk)7AaDR6#-EN-*`Kc5QwKg!;_*mpymR?UyGj~m%{Bb*NB$I0SG_T3m~!1)QXxRHG~ z!3a1%NftM<@1{5t&QFoWjqJM_&VuvPWN{<=Hpba-eugY=WZ%tk4xFDQiyPUw3C@M{ zb7XO&E%^C7*#CL<-o?IK;{0lUfqmS_zFXk}IKN01H?r^67zyW>$l^x!-3FuJ{4!bG z$i7W+A)H?!iyPT@TU-R^SIOc=_T3H_!}&F`xRHIg$0cxnoh)u-=N)h#<)DsE)oU2r9weUFM8*>_irhO_TdaU=WghB0vV zeJXBb-`#N)oPDQ?8`*acTn%U6tKvrX-4oZq*>|hBk)8L#wQ%LK7FT*o7nGW`1GAJ?qRoE;L~@?xP`rL zg-_op;|_MZ4L*IRj2qbLcKGz2GWy@a&-=i4tbKVNiaX)#`<2;#I1G1Hv+q{s`=dGT zu4dn>{Okc}fqSaicPc-7AX;K@nkj6%rkCe-(GkM&a)tHWZ&L+8qTvKZe-s+cm~e1A#P;fzIYbSvmk$s2bbvQ4GxRHGi#~W~72yr9(9)XE) zUKnvB`yPom;k*dqMs_|5Z^3y{#Ep(-ejD~*4Bo}Q$Kai6UYuv#$iBzoT{tg+xRHI2 z!+UUE5^*E@9*_6o+yHSS`<{Rg;Jg&#M)o}sAHsQQ#EtBG5=X3ELoL58K=sf1{ zVgJ?PUF>^4eyHX(c*c$FdjWog^O}eo*>@yWZ#SN8=Tie+{nI{;CDE$kGPSYFU3^T{^#9s1LnBVWz18vxBrIlF7~|~ z)3A5m2yr9(UV&-JoHs_?$i7!%Ix^=?5I3^#XiQJ$yeZ;F_8o&6$ecGr+{nIHVMa3N z#)uo)_iD^U=Da!LM)ti1Gm|+tLEOmB*J2hj=PeL7x{i5P_V(Wr-o?JxV>b5ATOn>_ z-y1MHne*0&8`<|p%t7Y74dO=jy$N%YIX6Yz$i6pYE;8qB5jV2$Ets3kc{{|7?0YNb zA#>gyaU=WQhIz@HcR<|8&bMPeGUpu;H@bs)e)jg?3EsuN3$XLKGvYpWU68%cT@bgi z=R)j#?uxjJ9T#Trb2r3I?6(MepSvUOVYfxu``iO@3wtfb-shf(JJ@M)_CEJQ+`vvt zu=lw)qW_ZY?&Rlva2Fm#19r~)!t8F0$5QN__k;O8n1H3(JMRzkv3Lj#**hNq^Kp0> zjo3RM2=jaK2$o^*d=Sj5jU{c(^#3zxdq}5c6$b^kU6(R+`@j(VpTHdR)~Ap@j0wU z=G+=_6MH_7)ybUOAnsz<7qAAIb6do1?EE6uBy(Yq7U~dw3W7zKpfmJ9j|b z$iA;&9Wv*Rh#T4WRjf9Kw+#PWvJHLgE$((y2ZuBfcQWVW5I3^#PuPRZ`FO;Q?E5qJ zBy&CiaU=Wwg1yL`Pek0vzQ1B`GUt;JH?r?<*oVydWW%*L zMcl}Dr~P67)8Jj~>$}qda6TPzBm4U9bReA1K-|c_zB?TR=Mjh-+1GccgW-H8;zsuM z-KiOz&qCbDzP>vh0_U?4H?ptqPKUzz9K?<6>$}roa6XqTZe(ZQotne>JhHfv?@ldX z|MS^<7yJ6|)Dq4Yu!|en*LSB@a2`n(H?ptqPOafQiY#tqU*DbD!1+S5xRHH*cWMjg zi^$?e_VwMV9h@&FiyPV3cc=DnzJx4pWMAK%I>7l-vbd3*eRt{z=gY|AM!q|Bg8eUN z?_KQc`%~v?zJh(+$iBWqb%FDhWN{<=`X1F4&ZEiVM)vhxsvDfgkj0Jc>-$u9IA28; zH?ptqR6XE)HCf!qzP?xWg!46IaU=WsZq*CU*OJAJ?CkqhZ#Z8^7B})8s}JmdJ$vtB z-@euJ26k~DyY_?68`;Ng?AaeaZ(<*JvEu;vyqSI6#C`+e^A`4T54#P5&s*8YE$lTI zK5t_mcd*kC_`IEc+`vvl;qwmm(SH~}H^80jmg2c0hQs+Tc4kXsB^+MOcUPZn$j>X| z2sq!v-p@9|Dmb#5$FetH2CL$zY97bl&n}DAaC9}_%ihl}ht+XRHQ&eH&n}NOaBMZ- z&)(0jfHiSkH9x@K&#r~zVYdg_*~va@UiS=_;H z>)~WLKTH<4u;2PP1 z&QFlVeKz6e5wQQ0?7fS9H^rIN{1p4Rk$pGAS#W-uEN*1q#yA_!&ydB9?7KP6f%CIu zaU=US!MSjLjx26u-z{(+oS!F)8`*bDoDb(0$l^x!-3k}L`9-q0k)5~3NI1Vl7B||4 zpGU#|FSGY9_HBv_tN9i7aU=U~i;Lj=Dp}mfzT4qqIKM^~H?r^cxCG9xlf{kfy8|wT z^BZJwBm3@%%iuhbEN*1qop3pveRql**>`7L0cYQx;zoAf1y{n^cc-|~uKYY2_V?Y% zyV!R(jHzbdo#ICJ-5poK*>|V7k$v~T)o}LRDQ;xnJ#h`3eRql**>^8o3uoV*;zst} z8`r_vcc-|KefPojaQ59PZe-tmaRZ!vcZwU?c|Y6;XWyOTM*H*gO|ZZ3PTs}72jJ#v z_T4FNWZwgE3!Hs-iW}MYAlwRP-<{${_B|N4!P$4GxRHIE;dVIt?i4q&?;*GY&b~Xv zjqH0U?u4`NPH`jq9)`Q%?7LIk$j;4iH=KQUiW{}y=X+p(-<`aReOqE|HT&)qH?nUl zjDxf9PH`jqw#L11_T4FNWZyQp56-?j#f|LS7Wc#1cc-|KecRyyIQ#AtH?nVgJP2ps zo#ICJ?SS!co(gdzJ9oqcI8TkZQ77hyVE<|0UF_Q#4_EWFJmW_8?Se<(JRRaj_U(#C z;XFO!M)vK7$KX5zyo;Z+Z+ARi%`@_h8`-x9o`CaAh#T3rC!U1!%!nJ=w-=s*^DKxP z*||5KhV!h58}(s+2KJu~-o?Is@oY8E&NFUg-+p)w&T}AcWZ(XH9?o+jZe-s9cmd9H zA#P;ffp`(lb0cnK-$8f@&hsE{WZ%Jf8P4+}Ze-sfcm>Y$A#P;np?DR}^CNCFjQKU# ze*t(G`@UX17vvfDvFjV~xe($u_M8Zx3nT7g$2Z|~5yVaG_ZECEinxc}-iFV`5Vx?` zJMg(U;tqCt7e1Fj+`vxn!RL~Q{_isnM*|#=6RPJ@Jl!9G6RYRaJpIg(IH`IzbX2mKXW|JsGckE^fM#i z@4O=Xef?d}tez|Jj86W(XTj&nh+h8AXT#?zh;IJg=fLNxh<^U==fdY|h>rgL=fUUd zh@N&hA3oPWbhXC?@VO?UuYE?s=URx)qnPcrHtcJc3#;ckJfpW=E`rZ>5xwnlF?_Cv z=xvuv;B$RMZ@XLypBo^0+vPI&+z`>*E|B@Rw#!xU*%;B=E?2|n=7`>QxduL)AbQ*7TKL=o(c3Q9!RMBU-gdbjKDR>j zw#yChxizAH4@7Uf+zX$3B6{29KKR@V(c3Qf!{^?J-gbEaKKDWNw#$R?xi6x(UB<)beu&=o znE;>rBYHo?Y_9`gU%Nb9JrCp=z3uV{d>(}8ZI?&k^I$}8yF3P;%@Doq@;H1Rg6M6R zC*bo?L~px137>}{dfVkG_-u~oZJ(#%vjw8}GtBmC3H#dR+3MMfXY{tqbMV<3(c3Q1 z!)F^rZ@atzpKTGn?eZdgwnOx`%S-Ut9?{z_FT-aCL~pyi0-qfbz3uZVe0D_MXB6{0pB7Am3^tQ{J@Yx;F+b(axXAeYgySxpbJrTX_@(z6V zLiD!FyYSf?(c3=n!Dk;t@AsMQ)fe`)i~1ot+e7^keeIwDh_3$r8i?rW@2)|Jj{e>n zjOgd@tRaYQ{=OQD=;iOLVTewA6C3kauLdrbO2SL*ku-(zzB%-6pk_3uah`!VTvpni`(caJIkGv%M~`O@!L z+WnQ^oxkI+Kc#=q$@Tp=Wc7PY`e#A?9`$=n?w{-W_oM#(sDD2u{SMUc@#pR_rGKXU z6Fy)19ZS2v^1JhQ{Pm~w?>V`?|Awr7k4gV5sNbW0kIDUWUH^X6zaRDQ$E4qZ`aS;K zJ*M=}lz+nKOTS}j_g8**{*J%?l>R*@*Z1F$)$cLsp9S@M)bBC5f3EA_kNWqc{{5Kr zJ5ayJpS#DD{+aSm_ ze$>AolYR&4_xN-7n9@H}{t2Hi{f?#GU-{knJO27p`uCh%-+x0^zsID17S!)izsKbM zxvqad>few0_hZuUK>Z$n?jBS6XUad}^QGUhwEHW+JAcPte@g$Jlk59$$m;i)^v{C& zJ?i(E+&|a#???UnQU88S`W>j>W|CZ1FUw@CR z$3JCX@A>Ec+5K<(*SY?$XZ>GKzmtDd`cBlpw|~#SAAIRwi_-4D?O&fM{e5aX)&89Q K_5M3P_x}KQrsg65 literal 0 HcmV?d00001 diff --git a/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np1/IJ.A.i4f8.00000.bin b/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np1/IJ.A.i4f8.00000.bin new file mode 100644 index 0000000000000000000000000000000000000000..1eeb970524cfc4c4240558a88ec7115d01eb8286 GIT binary patch literal 102488 zcmeI51&m!+nsvj>%yF2R*>3&sNKXc(qJ~SIfkBwb-$iN%8)b$@saJ$?-}|fnQ=u{1Q{)mzWyA z#5DLNro}HY9e#=F@oSj@ua+6{O3Z{`VrKjjv*4HTD^y}O{1UU{mzV>;#GLrG%!OCW z+;}D0;Fp*Ozr?)wCFa8~F+YBZ1@KEOh+kqM{8|>qt7Q?q5{u%OSPZ|!;`k+&z%Q{R zeu<^38C04>Ou`+&%Rq#u!ieF+i{90DWt7Q$m z5^Lg@SPQ>ITl^AhQuFJNy#cFCC3eCuu`_-xyWssRyYh1_ zyW!QcJ6`#_)09i&)vW#A283&SO97L9JFj+=#vJ!ppOZ3Ih=tq{( zpDbelS;j!Jj6q}>gUK?6kYx-dD=`ee#3A?@hmvI+MwW3nS;i4$8Ap<397UFKG+D+m zWF?NpFL4}x#_?nsCy-^FNS1LDS;om^8K;nCoJy8)8d-_c@k^Y6pK&Hx##v+;XOm@| zLzZzaS;l!}8RwH_TtHT0IDUx{_!$?HWn4s-aWPrOC1e?wl4V>*mT@^*#ua2GuEZ~K z6@JFmWEt0xWn4>^aUEI4^<)`0kY(IRmT?nViJS3D+=8ERD_O>EWEr=UW!yoQaVJ^E zU1S+|lV#jPR^nd#TJFOuF%rMTDEt!lMincnZJ7)A%Kx!7uSFeu?MsYk3~8#0&TtFOp@vM3(U~S;i}58LyIMyhfJs zI$6dWWF_9jFYy+B#@l2W?~rATCd+u2EaN@0jQ7bhJ|N5ZkgUW<_$5BZ&-jEa<5RMX z&&V=9C(HPPEaOYEjIYQtz9uX24StDl@iV?7%lMuw;|H>gAIUO)BFp%hEaMllj9BussC(D?DEMrEpjG4$XW+p2! z3x0`N@iS&4%b1-kV-B*6Imt5SBFmVYETaus#yn&t=EbjNKD-k1rt7Qqi5=-KjSPH+y()cBo!7s5aeu?GqODvCHVg>wKR>Ui@ z5`MSP&fkY%h%ma!IDiMIG9*2d3Rhb&`VvW)e}GS(-{*nli! zL$ZvG$TBu2E3pZFiB0h{HY3Z}oGfDtvWzXsGPWYi*qSV38?uaT$x3X8Ut)Xwj2*}_ zb|lN#i7aDhvW#8GGIk})*o`b>cd`jP7+HzK@oPB( zuf&n~C62-`aWsC3WAIBHi(le6{1V6GmpB2xmJ{)6ISH@C$@nEs!7p(teu>lYOPr2h z;tc!}XX2MQ3%{1L@k*S7pK&f(#(88J=aXezK$bC_EMo*&#)V`V7m<~?7{A0N_!*ay zWn4y)mT@&%#x-OmuEj5L9e&33WEnS*W!y-XaT8g_&14z3kY(IT zmT?JVuuBI9bLMWF?-&FYy$9#?xdO&yZz2OP28*S;q5Z8847!yhxVu5?P6t z@k_jdpYbYL#%p95uajlGL6-3*S;kvr8E=ziyhB!EG=7P9@iX2d%XptG;{&pc56Ln< zBFp%gEaMZhj8Dl*e1>1k=XfQ)z%TJ7eu=N}OMH!A;v4)D-{P0}4!^|r__h3iSIduh zC4Ry$@iTsjU+_!(ieKV4{1U(8m-qv}#Gm-J{DoKIZ~Tn^^S|^m9{=;Big7tJ#v{uZ zpDbenvWyAIGA1I+n3$}@B={vJ#m|_GEMs!Aj48-6rXG3mWAj_DMEMq3JjG4(YW+BU%l`La6vW(fuO3Z;@Vov;wxyUl+Cd+6;mN5@m#=K-1 z^O0rDPnNL&S&0SlODu$+u`pT2B4inhl4UGLma#Zl#u8*1OOjI{1VIHXDmyW zu^d^(@?;q+kY%h$ma!69#>!+FtB{pg6~Dx4_!+B{WvoG#u_jr@T4Wh*$uia^%UFjj zV_mWm>*1GJA3tLQvWyMMGBzU1*qAJ16S9m=$uc%0%h;T(#1{CqY>8K5EBq2$!+h+oT2c(v?|S7I0Z61(D;*bTqL?)WA4z%Q{Ueu;MYCHBIv zWpBI^``~A^C(GzSmeG+cqZ3(1XR?egWEow_GP;qK=#F2a2Y$xBWEuOBW$aIuaR6CH zPqK_&WElsNWgJ9S;$Zv|z40^pkY)5G%jidz(Vr}109nRBvW!7w8H34648bok6hC7a zS;iq`8HbW(97dLLI9bLKWEn@2WgJCT;%NL5$KYoiOO|mQS;p~X87GisoJf{&5?RK{ zWErQBl{gi@#A)~$r;}xzL6&hQS;kpp8E2DaoI{pzE?LHTWF^kWFL42W#&EKX5o8$` zl4V>(mT@sz#wBDKmy%^%Mpoi-{1R8-XIx2^aTQs{)npmhkY!v;mT?_f#`R2l0KKv3R@k@-t zFL6J9i3jjYJcwW7A^ch%#w+m%e#WC@8IO@=JWiJJ1X;$DWEoG9Wjsxm@eEmsXYors zhoA90S;h-w884D$yhN7qGFiqeWEroLWxPgK;&uEIZ{TOVNtW>zS;pIB8Sju~j3&!? zmn`EwvW)l1N_>D{;zRt5kH|7UCd>GQEaOwMjL*n2J}1lgf-K`pvJzk6m-re#;~TP! zZ^<&gBg^=nEaL~Vj33D|ej>~GnXJSw_$7YD&-jfj<9D)*KgcrvB+K}VEaPvojQ{h0 zcx`WEqo?WlTzzF&SCL#GOhcA2Em_8NWEs%z7QiG}e?EP`LlqIe}1!_QcpEMp0> zj3vo3mLkhonk-`(vW#WPGL|DNu{?f>74S1wB+FQdEMsM|j8(`oRwc_=jVxnzvWzvz zO00=rVlDiPwqzM=lVz+!ma#5b#(HEK>yu?{K$fu~S&5DCOKgmvu?bnmreqnLk!5U7 zmazp{#+GCmTajgKO;%zX{1V&ZXKY87u{~MF4rCcSl4a~fma#Kg#x7(TyONdI4Zpt;g`4>zr-#0wcLtV%WZfiZpSZi2Y!h= z@k`u=U*c~368GSjxEH^~efYJE#H(c#UWxnhOFV#I;z9fp58;=17{A0L_$402FYy?D zEsx{X@&sOqC-F->gAhF|^1|No4RmG+qlU`pszX`h)8rh?9u z_L+%bYUomFpP3k@fv%PInMq(;=vHZ;nG~jj?v?hL>7fTq2L5Mqm;v^!baa}6pJ#;q zKpnmO%rn9MppI^S?wR2LP)9#M`z+8C)X~w;KP&VCb@a5uY;Yi`qpLk;hl4;JeeE*` z91QB{JSVz0*v+nXnG5<Zs-f@=xvua&=1tn+b;7!e^5tnyUYs%Kpnm9G9L^C zb@aB&{4faA(c3Nyz+g~EZ~H6=LqHw97eWsOyV=z)3&XHVNAEWLya*fu>ga8kMd46T zM{m0<28V$q>K^?vAvJ#vG>ga8kmEmMi zM{m2V0;hmFdfR7JI2F{}r>-;L1uzZ@X*_SAjZu+hrTL8r0F-F5AL2pl%E1cG(WDt#tIZ z%l2>`sH3-Cc7W?a9lh zH@Fql(c3P&!)>6B-gemoZU=Srw#%My2dJaBUE0B&ppM>l*$eIhb@aB+-f%alqxU}O zd%$jXwadNL8J+EMA9zMzJB$R+=<4Sm1)kB<&wf96M#pyO2f#D>`I#RC&*Yq}qm>?))2t)x2ai>HJWikO1pC9|l^&ndXFJ0I@I<92;Plxp z&=a1l^n{!~+ZB4jQB%{xzn%KR3!t6?Vgq~igBL+PCBzPP>klu1dMb!5>^A^j2KCesd)RRx zyaMWJAU3h*Ab1tj(?aZG*TL`_sHcP2#?C|Fbx=Z2)F7_P`zg2oU&e+JlBj9&XFAuSieJ_MRK)nLQM)ti3{si@k5F6R|V)zTx zD?w~z-%H?cP_GQJk$o?PamM{;_f?Rwk$o>SB2%vlv5}oGhw;eNt3hmZ1$un^;hd|3 zyNrMOuZ(=M)tiLCL&X>1+kHRuYrll)NLU)vhTGp37L9rh>h%f z9ZX85UI$_$`(6)|k*U{(*vP&&z~p4=^&mE~^NlbCnRP;awvhN)*J(+ql zh>h%fC(J;m-W*~h``!gJlBu_V*vQUz!%SrAEg?3#2R$>s{kH-;+xK3W1z){2#76eL z4`wA(Zv(NBeMiDZy zKfdSg5WCoM0esIrAU3hzg7}_$LhNC;h44MwL2O~Kh4DT2g4n@Mi{N|i4Y7fp7RC46 z2crLCc#raPdw2|YmliAhSfR9he288P-~N5TUF`c2w8dBVh1kfx zAH&*Y>V6O#+4mDzhfLicVx!UMPhnj$^#F*C-bH@~>yfDkLTqH;&tZKs^&p6i?E3|5 zK&BoHv5|ehgbm5mLm)P?^H;DDnR+P1Mqi^h#<%}4a2NZ21DoKh4}sXozTd*8Wa>j9 zHnQ(`uo;>9Fo=!p`#o$eES~@?qc8HU^{&EaS$8X_jlNyOnp4WM)v&! zb|6!q0I`vM|AZaM)F(o0WZ%DFCo=U(5F6R|Z`hekeKN#G_Vwl5n*vP)#o%R9sxg4>PeZ4!i2laVmv5|efJ9Pl{`DC$?oxMAC z1oZ`Ev5|MDPGJAx`0ip~?@paTJpwN_vaffiE}*`UEH<*Qcc-qPzKAR~vaffiZlJ!H zEH<*Qcc<>4zJx3`vaffi9-zLIEH<*Qcc*g+`0ip~?@m1{eHDIeWMA)2y+D06S!`rq?@kAT`Wmv>$iCj44g&SHWU-Nb zy*nKY>g&j2Bl~)H>J94a$zmh>dUxsr>Kn*nBl~)H>I>={$zmfrw}F13zKJY0nunkJ zgZ*#DcNhE43j->B3w~^5-}zu5sBa~UjqE!=3Li3zeE;0*lk@n z57aM{#TNEk56%bmD`c^U9oL5oK>aFNY+}z1U^u8>Ba2<^x*?1J_3LD@jh#1w3qkz` zS?sehKVJm)e-qzb?7InETD?shtDK@h2R&XV#y*tH5_T3t;0=0Li*vQV?z}2Ak?i3qs%g@(< z{k=Q6i+#6)Yb)*DDK@h2_HZ4jy*tH5_T2%l2eo&n*vP&+!VRGI?i3r@cPF?J)ZU$9 zBm3?QH-Xx_Q*314UEpR=dv}VB?7J)60&4G0v5}p3gIhuE-6=NOou6+5`+IkC7yIr3 zw^!P`Q*314J>d>edv}VB?As3R1hsdk*vP(n!Cj#C?i3r@cW<~G)ZU$9Bm3?H_kh~F zQ*314_HZw#y*tH5_U!=of!e!MY-Hz-FcQ?>onoU-{5%Tm@7>8=?Asacue5ik*vP(J z-~mv3cZ!Yd+Z7%JwRfl3$iCg+Ay9jFijC~s9Uca?cc<9MzCGX(P>%z#k$v}tM?pO< z#76er4;};ccn}-ed4G5u)Z;^JbO8DZu>S<$F81vSPgZ(D&e+Jlz2GTOPXw`%eGi1E zK|L|VM)o}jo&ohF5F6R|V0aePlR|7{-`?;Xs3(Ki$i98xc~DOdv5|fI!V93D0%9XO z_k$NfJtf3O{n0Oh{igzVvF`wQxzbZ}#zyuX2(N&88i^C!2I}b` zHnQ&!cpcQ!Lu_Q6P|palk$n$=w?I7;#71^L6y65)%n%zLhJFX^ zKMS~veGiAxm7bL|HnQ&#@GhulgV@NvN5Xrco*iN%`yK`FgL)2#jqH0gd;sb>AvUt_ zG4LU%=YrVCzQ@8xpq?9IBl{i)AA`CL#71^L9zFr}JP;e5fc_NhKQFk8eLt(t`8Z=A zyM7Ly^FwT7&o97p0f=4f_$7EQ2(gL%z5>sMAoj4^*WkG@#1{7Y20Rym*uhTUg6EefAVM7k;YrQk*_}Dx3#DS9)nq zpFIuEhhHka45!bY4i~_$m0p(9XU~A)@LQ#qE$_n_AIy%{;2c{oIZOI z{0Vkj5$t52i{YNOyCvFlYZA(?tjh;8hAHB3aNUJGKMYtR$p+rKTi zi+!(!N$}NcLu_Q<>tIqc^*Rt6+4p*wj7+^Q#76eL0VXF?uLrS_eQ$&*$kgjYY-Hb? zU`jIe1`r$B_hy)iOuZq*M)ti0rY2Kw1hJ8wZ-r^d)Eh%=bQ^kFeEV+#?qc8DVLE*E zrVtz1_YRnzOuZSzM)tiEW*}2<4zZDa?}8c0)LTGoWZ%1CCNlMw5F6R|9+;U-y%oep z_PrNoAyaP+v5|f6gIUSc+dyn&=aDcQnR;7@jYgqo$G87>;4b#PALhVUZx6ANeII~1 z$<#YQY-HaDVJRlih&~7|che-VI_SJ3kKdlc{%y*ysuL0{Hgd1Kh>FPr`!u>OCPgvhP!{5Sh9i#76dg z8Wtu~?**}ueV>6v$kcm7Y-HbOVNo*mJ`fw(_c>UMOx+%0Bl|uNi<7B4Kx|~+7hnl8 zbw`Me?EE4uNv7@uvC&KDrSR?F8QjIbFT>LK>Mjr)+4mJ#hD_ZRVk7&$3d@qIyFqMZ z-`8L{GIe)|jqLk6EKjEH0kM&N-+&d!)cZngWZySoMKbk%5F6R|Em(<6y+6c8c77XH zCQ}~(vC%u|Rq*ZK6WqnVqhVEibuWmG?E5aPMy5UxVk7&$2dk5*4}#dpzVE{tWa@(< zHnQ&ruqK(hH^fHv{Sek7Q}=<`$i5#zTQYTDh>h&~F|19d?gz1voj-wf$khEIHu@C3 zF24N-fVX$O4I6CnEUi1!0Op9nv~U$7IN`Xn&>3I2wi@zp1T`Oh#8-Y%d% z1Bva zcj^ZAzZl&apx`+9fk1L_;dVk7%{cj^o38_8lL`?i68puUML zHnQ(L&>z${lf_2%ofigx`WCX-$iDNzKv3UG78}`lei#Jm+sI<01^9U|*#CBXcd_q+ zFr?CV;KxSxT?mGP`cAUg$i551Fi_t`78}`j5jX_Ycaz0N_FWVX1@%2-v5|cjgTp|5 zFIjA4-^Jl@P~S%u8`*aWI0Doo$zmfrF9}D2dK6h~v=l!d1@^xm-(BpxG#p*&2k>Jf z`z`~=fcinQ*vP)i!m*%!h%7d;?{aV)s2?VajqJNT91rS8$YLY=t^g;1`cbmj$i6GW ziJ*RrEH<+5N^laWA18~A?7T9Z4C*JyVxv{~`4q7Kllbmp-&Nt%N^2C3)Ih(#YXmR3ulA+1+v)4 zzH7rdpnj1oHnQ_Na4x7{B8!dI<>&Lj{x9RZi+$IF^DF%der#ml_2B|gze*Mx*>?jN z4(iv)Vk7%*2qQrKI$3OF-;LlxP`^PI8`*bbxCqp5lEp^$-2^TM^;=}Ik$pFXOF;cL zS!`tI&EQf{ze5%qZO+e^f&EA0yNi9dfXgfG{V6uG@0M@{sJ%nQM)utbt^~FBsMyH9 zTf@Yb8r0sWVk7%*3)g_!J5_9C-|gU9PK=m;Y#?S0B;_kd0?s?y%2e0ERh4EI;s zdz8<%gD&turM*M>>|W3n9;~$YC!g&G4}smhJK4!T-QnR%dv}WdcIp9-fO;H=4eYfq zJPPV@A$G9ae()Hm$Aj3ye*44YpdKG$4?7+JPk?#?h)wL-6P^V1gb=&fwHG`E>WLt> zvGalOG^i(r*ykYhGhqKoz+LQnFg#o7NjYO9`}T(CKs_16M)vIk&x3k$h>h&q7hVAM z6c8KPw;#L+>M0>MvTuKQ3Di?TY-Ha7@G_{UhS_DqrvFc z!2Z*LyV!RKyk6<)Ib$RH4uv;BJp;r>_8kUqf_g@XjqG~}yano+AU3k^q3|}SXNK6w zzK6j(pq>R{Bl{i>qd`3@#76c#0^SAnY!DmS`AB#V)U!iubQJo1u>Tz3F7`bdKB)AZ zoUxI8kAV+CJr~4A_B|Fp0`=Sw8`<|b_!!h}AU3k^@$d<#=YiPBz9+z^pq>|EBm15R zpMiQlh>h%f5_}Ho`5`v4^U3f9s270P=oIvqVE+ZdUF>@*d{ya%IAbIGo(5lodSQr- z?0Y(V1L{Q}HnQ&-@GYnph1kfxXTo=&UJPO*` zmxS2J&ga5Upk4}Mqw~-|gZ-BVcd_sJ@Jpqa;f#&!djb3k>SZA|vhQ&C4b;m)Y-HaN z@H?oNhuFxz7s4N)UIAhw`(6Zpf_g=WjqH0d`~~WjAU3k^CGa<>SBBWg&X>YCNO!Y zvhUR}5t(`|h>h%f4NOd?ZVR!IeXoT{$kb~?Y-Hc-U{W&mIuIM#`Ffa)Oua6|MmL}* z$G87_;4b#P5vIUbuMe@2eQ$y($r z46%`YZ-Z&c)SEzTWZ&CiIx_X95F6R|4w#-yy&1$tcD@s4AX9G+vC&=V8S(AE1-OfS zXTtN`5@H{_&W!K56~s37oCV)=YlvO!I4i#AHV~WGZ#I0-Z6Wrs+wAzB+d*t$uQ~8N zw};rlPIKaW?f|iYo#w*#+!3Px+<15M^GRkgRkBN%Q&AF*0>~hz;!ZJS##h&x(CEY_I(3ZAXD!Pv5|e>gcZru`$24E-?v~TGWGrt8`<}5SeZh&~F04kTJ`iFfJHH33lc^7a*yw%q8u<1<7~I9a zAHbUU>fR6=+4nH!cN+4nP8k4!xfVk7&04(pSt2SIFP=PzIbGWB4HjlM*0h;RQP;4b$43O2%54~5vs zzF)(}Wa?oM8`<|8*n~`d2*gJA{T4PQQy&Vkk$t~|&B)Y;L2P8-?_qN?_2Cd3+4l$7 zf=qn`#76f05w;{#9|^IMoqvL@$kazcZ1gjFYkd134eny!Utk-2^)V0|+4oo2mP~yt z#76f04Yngw9|y6KeSe4T$<)U~Y-Ha*Uh>g5E?F#lk72L(X-ko*>^=S|r+1I<%?w~#$Vk7%{ciIEg zXFzOZU++$Pg8EE|jqK~)sU4`#g4oEu-ktUW_1O>`+1I<%-k?4QVk7%{ciIQk=aR)n zcJ}Vn9@OWN#YWzpI)MGp$9EU|dUxsw>I?8ICZHWU-Nby*qUV^$4=q$iCj4 zx`6sZve?MJ-krLF`XaK}$iCj4x`Fy)ve?MJ-krLG`Vz9($iCj4dVu;;ve?MZ-ktUZ z^<`wSk$0#4!2XxxyNi9jKkZ-XEAV3@`+A2u0Mu8K#YXn^9@P`nSCPd=_Vq5+3)EMW z#YXn^K6N0duOW+#?CYKCAW&aR78}{ud)2|9zK$$5vaffm-k`poEH<*U_p3gjzJV+@ z@{ZLP?0+M^yV$p1b>4&*``EQVc;1X3+t_mec;12^yV!9cc;1R1o7isiHgGrIJe-Tdp`gA8&um^;3=XUG zz16ex@$=$vIH>Q#_u2Vj2{@wCBk|1_fF7#SV5`2~Gm_<7Bag{Z@vPLHz_->|w`M;1p0lNfw*fb5%GM)K8JcE_PiFP6PGR zWU-B%SBKL<{R~;`vj#t(0rr0u-(BpxCY)L6=kQ}A`>q9Nf% zcWpQa)Gw07M)q9?&IR>LWU-Nb*M;*y{W4i>WZ(7Rd{Dna78}`jeYgPBuad<^cHRJn zgZeeH*l0t39s%}$9p7E-yAfPi={N9WBl~U)7lHasve?MJo501Oev2$NvhSvF38>#D zi;e8N8C(kLcgSKR`)&@GfqFDqY-Hap;BruVcZ!YdyCqx!YVS_5k)5}KD?#nuDK^@g zpRWS@dv|gd`)&hQSK7N%Y-HbU;TlkTcZ!YdyB%B$YVS_5k$ty^>p<<@DK@h24sboF zy*tH5_T3R~0JV3g*vP&+!HuBy?i3r@cW1Z>)ZU$9BRlT`H-p-{Q*5*=Ki>lO_wM8_ z_T3F`t+aQi*vP)S!)>7U?i3r@cMrH7)ZU$9Bm3?NcYxZvQ*314c5o-Cy*tH5_T3Ba z0=0Li*vP(n!`-0v?i3r@cOSS1)ZU$9BRjW;dqM5pDK_fB&-a1-y*s&!eLKR)N_%&T zjqKYAMuFP9Q*314&Tv1dy*tH5_U!@>fZDrLY-HcA@F1wYJHTw}9+7JC0*nd257yIrHk5_tp&e+Jl2f!1co&aJa z`}Tw!`}T*IKs^=2M)n;5FN1n&h>h$! z5MBZGG!PrvcM!Y^>S-Z1vhQGc4b;;?Y-Had@H(ichuFxzL*Wfj&j7KJorl4jpq>$8 zqeIYdf&FI!cd_r=)j2a~>|@t=z;hOeZR|N3JZFX2#g6ZS=WGz0*zY~?oE>5hyS)#d zb3kliuMfa;PKX`s^dWf81+jshJ_66VA^LxeJ`~!(VQ_qP&cmsHIGj+O^K$yk5pZI4 z&d2F9N5VRgO7I{A6e0?)-Edij~p2G1oRy7{@!0na5N`uW+<1<$1*I{Nv~ z1J9))dfMT9@LUF>t356N&t)O{+GjX;E(g(h1lnH9gMICCVRf#+8NKat5qPc$(c3N; zgXc;Rz3p-dc&-f5+b)-a=PD4r?Q$7-t_soHE|-JnY7o8cas_y<4$<2_SAypn5WTNL z+iOj*uU)RL&b2tBw_UCQ&$bY~?Q$)6t_{)KF4uwQIuO0>ay@vi3(?yyH-P7Q5WVek zBY3V4(c3OJf#(Jgz3p=|cy0*M`xdmlHUj(F<<{!lm@|6Yr#1fsWHZU@gzA$r^8 z4)ELzqPJb{1kcSOdfVkL@Z18Tw_WZA&n+Q(+vOhc+zO(%eeMO%ts#2fhql)?U|+k8 ztj=vYqqki~f#-G*z3p;8cy15T+b$1)=ME6P?eZXa?g-J_E)Rj{P7uBA@-TSr4AI*z zkAUYc5WVg5D0uD)(fcv9y>5vB?eY$I_Jrtdm(k$a3!=AO-UZJCA$r^8J@7mTqPJb% z2hW2cdfVj#@azrI+b$o1XCH{(_W1}r`$F{o7;Ue9U|+jPe~8ZZkO2^V?H~goy88KL z5JXQuy9|ct=;xLp5dHkjG8CelpI3%K^z!q{ArPIo`SYJy+WzAh=Ntde@9>}6^FQVB zeB-(1?bp(~)%!jg&zIj@>=I{7zo(}Dd-eYP#`BH$=>m=KSNVI;)LokTT;spq$~(s{ zagMD$oBHoI^|`VAc^m)!n7=PgeNRn&uCe!+_a58(H1$0-^|`VAc^m)!n7=PgeNRn& zuCe!+_a58({HOQypYnP?U*q5V_xIh>d(`_r8qfdx`-nYi&;MWEQ+%$bex7(f&c^SR z-*;>6Qt#iX_xZ+qF2CRZm0jw6-}OHKzp_K)bC$oy^}g?VpKt75-u-`NmwMlKz0d!z z?9lj})6{9gI{)Y`k$`@ZXa zzP0-_{$9&|uj+l@^*-NtUoHE-T6@oW-*>&ww|1Y#-)q_LV^iOEQ=e<@`)U09E%RQR zx?@wHYrM}fzn8JS&)9xX&Hen1-y8GyqTct`+&%04JM})_+|Skcy~g*$1>$>U}=md*k>1yYIQV@1frJR`2u8{alUTD}SF_dzX6OcfHTIcAv)IYuWEr zz3;o;=Ns>icf$bIpA}jeoyo-fL5LZ0d83_c`YG zGPd^_+wZBlpTF^YWBy*$``((nXT5)?-shY9xf;LM_wVw#KHu7X8h@{4zmH9Q-%Wk4x$md(@3+i*ZR(CqeXj97$NXN#_C90#JvI09 zH-2x---~+RTXXlU_wUsEd~-inLWcc<+th`|rNz z=Dvq|-&?)UH}`Wjey{v}YVBR>ec$yy-`af|f3Ib~SM|Q{dY^B+uax#qr~#=qY(@3pBrHubs2`yBIo8Qc4e?f2B&&)@jHF@G=WeQ(X(v);c`@AJ+5 zT#esrd_P|P=i|LMe(%5go}2p~>V0qZKHuEW)%d;g_o=ma zsrP-?`+RHnY5cvG{a)4kzUzIy@xEI2eYN(U^}g?VpKt9xjlb8j-^ZrD@1{Q2-1pP? z_gm(@Hg(6QKG%4kV}37Vd!MoWo|^ml8^1T^??t`ut+{*F`*-SnzPX>P@q3N$hYQ5_ zAUhl1$MW~2wRWlZ@6`Kzy!XcM{deDUbKgU~@2%eFoBO#MzgPY~we~LczVCXUZ|y#f zzt^(gt9svez0Wt^SIfSy*50$;_g(Mvt=*^b_geP**wpvk)aRP}ej5LN%e>eBwBvuu z>wSNXfA8PlTTAaz@B3&x|L^Z3_NYBu`aL!E-;2-Dcz(?9X>9G&)PJ|B&o$oXnBU{r z-lwVWsj1J6?a$lz_s9HwY3h4w>T`{~$GrF0-lwVWsj1J6?a$lz_s9HwY3h4w>T`{~ m$GrF0-lwVWsj1J6?a$lz_s9Hw`A_fZKjroA+xYk5ef&Qm(~!>q literal 0 HcmV?d00001 diff --git a/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np1/IJ.A.i8f4.00000.bin b/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np1/IJ.A.i8f4.00000.bin new file mode 100644 index 0000000000000000000000000000000000000000..cb9918e393c1f858c0a66fcd128300c3bc46c0ef GIT binary patch literal 128088 zcmeIb1rXMC+pUY;-A#xnASePVp&*E$AYvdTpwivlAs~WE3n(Bc7=(ZlN(&}nkp|e^ z-QRrkUf2FM4D$T$(HUQz=gjO`-@Wd&ZsEE9I(vR+?{oIZ@t^-^e{^s3gT4OqKd3oQ zV4*U;PmVFi&a?i`x(7xk-IH7<^^cKB{rhFoefZ~Q(tXKg(*4L~QaNPO1Gx7`dLa8u zdJwr(J(zr|9zs4<4<(Luh;wH*0WEl)mGFD0KzE0D{imyt`=isVzZ68TiUoP4TYK|WP0lTXzu*84pQ_i8Pt|M5r|Na&Q?)wzRK1>js@5Q%sx`@H(pu#HNNcmt zq;<$;(i_NS(z@g_X+3h8v_82^dLy|^dK0-!dNa8{(gy4^X+v_U+K7CrHYT5{O~|Ke zQ}U_WjC`s#C!eY<$fs&c@|m<1xm0aUKB{f#MYS!xsJ5dQ)%NtF+JRnFJJO44Cwfus zOfOZtkWbaFNt8)y^CH{$J2}I1bR`ONH3~)(~Igo^rAY6UaC$epQ=;H zNA+HMQJqRJs?+F2^*(x0y`NrGr_+n-40=(0fL^LTNIq2`A|KU<=|y!Wy{OKj7uDJH zqB@6OR3D)i)w%SdI*(qe&L^L$kCKn-WAviBfL>G=(u?XMdQn|WFRG8zi|P~fqPm1$ zsxBp;NtcmJ)#c<O1tJ`YydxeUE&q zzE3`?AJB{HhxDTQ5xuB>OfRaR(2MG)^rHG1y{LXpFIB%FpQ>MykLp+SqWU$xsD48) zs^8L!>UZ>_`aQj<{y;CPKhjIppU9``&*Y=}3%#iRN-wIv(TnQu^rD($4~jwEgM3u? zq!-n_=%wo3cgdMNo+J&b%* z52qK^Bj`o-NP1B{ie6NYrWe&?=tcEddQm-&UaB5XK2=X3AJr4-MfD_lQ9YSnR8OH7 z)l=z3^)z}>%}Fn+x#*>8Zt|Hl54lu5oqVe1C7-HikWbZoUrc-wJ7;iEk-_*7AKdg=aY}>1@xkN zA-$-UpcmDW^rBjdUQ|odi|R%6qIxmCR4qe3Rm+l(>Lv7|T8>^+%hQYMrSzg&fnHQE zqZieR^rBjcUaDSBK2@(EAJxkAqFRMsRIj8L)vENOdKJB>R-+fytLa7c8hWXEE%{Wv zj(k+B(~Ii$^rBjWUQ}z+i)t-;QLRlcs&(i^^#*#WT9{?k7_S^QSD7H zs(t81wJ*J>_M;co{`8_cfL>Gw(o5A_$Y;_)iepQ=O2r|NCwQ*{{m zR2@z}Rc|MsN$((+N$(_=sw2p!>PYgbI*NR%jwYX~W5}oKSn{blj(n=#MLv^`Czq-d z$VYV|y{O(zFRJ&@i|QnLQJqXLs#EAi^KuAeeS}_A=hBPnJbF=`PcN#E(u?Y2^rE_e zUaBr6pQ?+JoZUT}m&i%jiXQIlZW^pqHvE$*1Zn@=<+~UQ}1p zi|QJBQGJSDRG+37)o18M^;vpReU4tLK2JVX*OHIwI(kuEPcN!3(2MGe^rHF_y{NuS zFRHK5i|Ph?sk)JTs%|15)y?#xx`kd;x6+I1tMsD!8oj8#PA{r&(2MFeda1gde5$@l zKB{lgi|X6-qWTWKsJ=@ts_)T@>ihJf`T@PDen>A>KO&z=KPH!|pO8=0Psyk1XXI1$ zbMmSB1^HC{l6aA(u(NC6}t-kx$j{$*1ZMYbx(Rx-HTpS_of%sedtAXUwTp9k6xbc~jT7+Iy z&!ZRBqV%F#j9yfW(~Ii)^rCtJy{KMDFI7vBPt}s-qgskyR7=x~>P7UTdNIAImZ2Bb zvh<>Q3B9P6qnE1X$*1b2PhV-J^h+b41(~D{odQojkFRIPx zMYTD-RBb^%Ra=seYAbqCZA~w#ZRka{Exo9=qZifo^rG5` zgXl$dFukY_p_i(+l26s4IiyK9Z4@$N0Cp} z(d45#hF(<1(u?XidQrWLUR1}^i|Pb=QJqLHs&~^%)qBXN>Ll_}olGyPQ|LwYUV2fT zN-wI@=tcEDdQrWfUR0;kOVt_VQ}qGzQGJkJR3D-j)raXtbtb*2&Y~C9+4Q11hh9`4 zp_i(2$!F4eNtcjI)urT9 zbs70oT~0n#SCCKDmE==(75P+sl6ykW1C4$Vc^QdQp9bUR0l@7uDzJMfG`l zQC&+fs_W=Qbv?aQeSv(czDPc*FVTzY%k-l93caXqpcmDR^rE_nUQ{>Ji|Q77sk)VX zs=i7-s;|+D>g)8P`UbtIZlf2~?ewDhCcUV>MK7vv(@WKN$fxSNZkNl^)vFR`Z@WienBs)U($=}SM;L#HNB{QLoce|(u?YM z^rHGby;S{ye5(FPKB_;_i|WtxqWTNHsQyYXs=v{T>hJWTnqx2i?@I-B5AvzHC;3#} zi+oh~rWe(H=tXs3dQshvUR3v|7u5skMfE^>Q9X!Wsvb-}RSzK_)kEn;^)Px-J)B-t zkDwRTBk4u;D0)#nnqE|op_i)1lFy{akxSL%$*1ZGKWuyH6Qs@J(GN@o<%;B<|mh`1;|IW zAib!bO)sj2=tZ?Ky{Mi;FRJI#i)s;iQ9X}dsum@ms>R4hwK%<~o=-2T7to99h4i9Y zf?iZh(u-;-dQmM+FI6uhpQ;y=k7^luQ7ua^s+Z7Q(fjT8&<+UQIq#uOT1RYw1PxI(kv9 zPA{t0(~D{idQq)OFRHcZMYT4)RINikRc|04)w=YeT8~~->(h(sjr5{=6TPV3OfRYp z=tZ?5y;N;PK2;l&k7^ToQEf^us?F#{wK=`0wxAc)mh__9ie6M((@WJh)pQ?Sx zr)ppFsoIZxs`e+JNe7VoBOS;-liorulMW)6Ne7e5q(jJM(p$-8(xK!s>22gP=`eDC zq{G=~(%Z?U>K)`$^-l7sI)Z$vjwGL|qsXV~X!5B#hJ31yC7(&hk;|lakxSL_V4!>^?vfHI-Pu~&LE$v z50FpQ2g#@EL*z5*!{jpQOme9@i+rliCZDQv$fxQfJ#KsbqV=YT}nPxmyyq;%gJTZ735NNCHYicMLt!Z zB%i9Q$*1ZX@~Qe1`BZ(He5yV}K9fF6E|We-E>)i=pQ>xgr|LTLsk)wgs=h!zRbM2Z zsxOgG)tAX<(pSi3(hcNNbtCyy-9$cBHbXM=q1TPwtPD|5M31`2P(=jsr0op!(+c zKmMHKAdH5nzIpz!ISyvu2-P>gH~t}LV^rV#KKO^CO;COF`{EylHbwQ#?}vXl+6>h< zzd!yFXmeEG`~mn!qAgH;^GD&gME$)P|KIO=G)61b-`n5Up1xJse#lBqflIxA?%f-HY&LGzZ)t9UNeC+$8 za+8l-&Sc*Y)t8ICob1m+`=k1Du`ieWax>dVExe9j?vE2=M7`{%MBipotsaw)?8HdJ3O_T+LN zxnZb&&Yk*lDT+TF)t8HXxfCOJJE|`i`*JBx?haI6F81YeKDj$leYx0|%LU{{p!#yL zFP96+jYRe3VqZQb$c;kvgC zzFh5J%6<|mH~Gk=0{h9RzFh3dDesJ>k6%jJ4XBQ7>dVExThH;HzcF(g^jTDYFJ}8qnA@Vyq569>+i%L;4t*Zg--p?LGv@Z_T2y~u zX8X;VJD}@O{r#Bjw_xswu1EFvXSUyxxfA*Vs(%2p{m#rUqH;TsSx)llg8ve#e-N{r zyd$Ts>|aLp4`!B^_vF=${VS;cAL1B0U+>Ae5BsgC{!z?+C*JFe|0*i~qnYI_ z-+uV7q58)#%hx;d?a%&oRR36J`Fc;j1K7WT>L14}U+>9xAp32o{_)K6^`3lhVZR;K zKY>}k-jnYj_HUy4Co;>|d-5I3{w-AhBxd<~uMhqZ^leoCWM=t#PtLcpe+Sh+h1u_= z5A#s;T~z+3GRs-Mx8c8s>Yv6eU+>6w82k58{hZA5^`3l(v;P3q&&4cX@5%Re_8+49 zxtZnbJ^9|j{v%XB53_u|C*M2Se~jv%&MaT=$#(?%Pf-25%<}b~d`GhX6xBb2xew|+ zIgi5s4Asxa?Dyim(fFUE@;{SV&hj0D{{^al7PEZ4Bj2&?zeM%(Gt1X|@*T(iD^$M# zvwXcL-@DjU+>9xBKz-9{ld)h^`3n1 zX8%2^e-5*Jy(i~;*#Cg)pUdp`;=M`uKcez4!YpU`PR9QU)jy9}zTT1V6!t%(`bC-L z>pl72%l;QszZkQ8y(izP?0-e|i!;mDd-9#e{x?+rd}jH2PrmoD{~gu8fLXrYlkffP z{eOX~e<8kny(i!4?DyE?KmUV%34Hl_PtG&g?@3R;B);E^_a4CCi~MBfQmCBe`yl?_ zGA%Xc!fd>>-oho1gL`119hd>>}NFFpN>@#X71`Oaj&A3gmt`119hd}p!WpPqhM zeEE7$zO&gMKu`Y?eEE7$zH`_gNKd~UzI?qW-$&RVL{GmwzI?qW=eg_;rl)@?zTb=Y z=HVYgUj7yEC!_M6&wMC({mbyDpx%-1qxgr>)31mxU+>BHG4_Yk)31atU+>9x0sAB9 z>0gd7U+>9xA^Rig>0f~_U+>9x5&NU)=~u>=ulMA;nElc8^sC^@*L(7Poc%HM^smI1 zulMBq1p8y@=~u<~d-2{9{Nu>W|0;Yr%XcaM@#OWZ;mg-M@?FOM1bX^c*{2@?FXPWP1A7;mg;1@?FLL6ngsA@#X71`98`1RC@Z? z=#lb(J}e7_g(J%yi(y!>n7%UQm;$vM|1Cs+H+@$-;( zu7fX6@2tQ-oxJl6_;U1)9P^TQu1j8i-jUxK0UrzFQ4Zk>f{nq$$@{XKdXMa9D{WkdW z@}9ijV1EHU{kHgW^Pb$cvA>X>emi{mc~5@Z*_WWF-yUC%-jm~->`T(q?|?5)@5%Em z_ND0Qcf^;g_vHFE`_lCEJK@XMdvbn<{YCWjJLCJEc<){Oi^uz zEZ&U%uO! z<@+)7rS$ZB;mg;1^8JK;1$z3u@#X71`F_g&GJ5)b@a5}0Ie*5!B0c@S_be+&M0 z)O+&%2LDQW`h)P_M7<~9Z}F?r(;tj4U+>BHJN8%6(;tE_U+>BHd-m1n>EDVkU+>BJ z2liLf(;tfO_u{=D@vk8-|J(58EZ?8-uO+WP3}3$9k?+s!ucN0w9ACcPlkYF=tJBlJ z9bdlQlkczWucxPf2flp0C*R-L*Py3=C%$~WC*R-M*QBRE0$;w~ldtbiwdm=Oq$gkR z$=7$M+Vu2C(UY(DG{2Q&v&OA$jg5Wc{$71cc;4K^~aKzuXp6@yHh=S z`s3)y*L(8y-Kjo3{k!PN*L(8y-RVYp`s3-z*L(8y-RUNJ`V;8M*L(8y-RWj}`V;BN z*L(8y-KhaR{k!SO*L(8y-Kilx{d?%i*L!mI-Kh~h{YmuvUcBeKQ)BY-pG;oP^7Y-R z33>e~*^yKS3`TFkEjGq2fdh+$2e0_InPEUUtJ^6Z1zP>xPpr?Ny zJ^6Z1zP>xPq^EyBJ^6Z1zP>xPqNhKdo_xJ0U*DZt)6<_pPrlxhv+quA=;=Q|&+o;1 zzB{!gFaHP0%UQm@JGCRP{}6fkdPly#JGG~$|1drIdQZN-J9VI^Ka-w(y(eGaojTIf zpG8l;-jlEIPMzrK&!#6|@5$G9r_S{B=g^a{_vGulQx|&rkI<8^_vGulQ&)QWbLq*~ zdveZ6z8k7PkDlL)_i~Zzj>>;Nc{$5BH@P0D{-fmO>mB*#A>R|#e~g}dy(iz($@fC_ z7toWh_vD+Gd~Z~LAwBtePrhf6?}O?uq9wvw-Adkh6?wUNM{YyOJ3mQYUfz+{ZRDL-lb4fsOVuyULp49qj#eE&+c@$F#8M85vcxi zNtFUr0&Iu_M` zfxP`<>@Pycq53b9w|_DFyHL5kL{3ifDMM~Ns{b;1IeSM=Wyw!K^B-l7@~uk#0aV|2C;56$ zzE_cd5Y_kHNxt5bZ#D7{q58f%$=7>wzMA~QsJ`z`elOm;hTKe4{=PfOS-#hjn}zE8 z?j&FD$oD$(vr&EDo#g91`Bo=C2i5o8Nxt5b@Ac##LG^uilCSsVTZ8;uRNr?e`Fc;j zHObFI^?i4eulM9zi~M|4-*+eZdQZN!$v=wf`|c!P@5#9i`NvRw-<|wkymte+1*rUe zcapPw>ylfD>ig~_U+>7b9{EM6zVA-*^`3m|lV6PL`|c!P@5%Q@@{gnXzB|d+d-A=B z{1d3Y?@sddo_ud6zXa9y-ATUQlWzm^OHqB_o#g91`8FiK4AuADNxt5bb0hN0QGMT? z{9e4*nA{3f{=PfOS-wrktwi;GcapDnkOM zsJ`z`^7Wp4TaaIa>ig~_U+>AcCHbdN{T$5l^`3lNv40xX--B7c-ji=@_RpaDdos({ zdvb2W{#jIiFJ`|N@3qB$4we7j%yO1*JN)NS{e76_>mB*FXTKKJ-CN)BdUKGvwXcH-=6F@q56k2 z%h!AI?ZtjGs(%Ete7z^%-t4!a`bRR$*L(8q!+tBOe-yKPy(izk>|aIok7kyy_vG7; z{cEWHG0gJyo_zbWe;w67mRY{ulk))fZ=m|eG5fuEZy^3QRQ|^^%UQm+;BQCuPhgg> zcjP;W{hO%%iOll#o_q(he+$(=iCMnhlkX7rZ=?DrGt1X|^1YS)JE;CC%<}b~e221s z7u7$NS-#$r?``bgL-kK%maq5ZJBgQtid-2}w_#dM3&&@1n z`F@1&oQGMi_T~C9d*{=c<>?)He!|{4FS8uIBgaqKJD^E1oGJ97Gpy>kI(IeX`8{5#Ns=$+_z^qZahvzhIU zV4i?}i|Q9*_U=gLiRgEzeqm<&qnPhTzen}YVYWY-`5yEKRR3IN`(v0Vp+BPfMVRf6 zWuA=wgzBHiY=0c{6!d3QzbLc)yO{4qe?j$&G25TY{3|NA;>>cA&ounsQ2q0n<>VbX z-N*iSRR02Id3jG>_p{Hj=YJl6^e@DhoA=~4o&6s4^h@B&&wKKl!G2GA`X%w@=sh_; zzOHwW#C{)o`WNBL*L!k)nEk%=^e@KuJMrF3{Qbzw zzYM;d>(d5Iz0!`119h zeCM)1n4bQn`119heCM%0gr0r{eEE7$zVq21N>BeXeEE7$zK^m$jGlf)eEE7$&X2J_ zoSuFqe7_g(ExYw_hQ-<9|$lh?lvU%uXv?<)4E(9^Gu zFJJG;_eu7r($l{lU%uXx?`rm^(bKPiFJJG;cMbcT^z>`u%h!AIeTsc9diu5S`PaplvwWY&KZCq} zJ$(6kN4{&>=cA`zA78%SlkYnAXVTNZ5nsOElka-=XVKHY317b6lkW@c^V8G68DGBM zlkbb{3((VVfG=O~$@eAp1?lNG#Fwx48GP4*?}>36`FulMBp7W-24^gH6q z*L(7Pn|*0|`knCQ>pl6t!~Ppl6t%l=||`d#ql>pl6t$G!|b{jT`(^`3m+ zXJ3|{em8vidQZ+Du)l(DUyi)|d*I7iz8~S2C$HZVU%uXv@5k&frKjHu zU%uXx?FM{ym#_Ea`#Jkc^z{4T%h!AI z{eu1F^z{4V%h!AI{gV9^^z;Yd%h!8y{)&BNdin$L{a(EHHGUQH^1lUN&hovIobw=Z zass>8!^q3YJ94^?yz_AK^6`$Gs*`uVoxGgAb3M6l*x!MEi~fezAg6yPzP<05e@APQ z*B^mz|9fWNt7?(gAIaYS56r$()h4e$ioN|GnSGzCLtcM0d;32z`!00@dHpf$?f=Z| zdsJQW`eWJK|ApCisCwk}$FaBnE3@xU^~vks#ooT}PB)U1+jw$vl8^6BH<8z$KweJX zk(2LEH`CLfNKanglb7#K4e06LO;2v#lbi2O4e9CMLr;F*lb`QSjp*r5q9;f1$B-l7a`xS+89n`}^!!e|=etvL^75ZX zUe5CM-Khn6{rkwv*E{m{-Kix#{rl<3*L(8y-KiBl{ps}N>pl7U?$nx|{tSBZ^`3lv zcWOgV{{edP^`3lvcWO&d|3P~4^`3lvcWOsZ{~>zv^`3lvcWO^h|6zLa^`4x4cj`b- zewkrl&uLo_xJ0U*Da&(9?f}o_xJ0 zU*Da&($k+yPrlxhZ%*>vQ2lxIZt^`){YUA^*L(8KL%t`f z{}?^_dQZ-$lkbJpl6NMZQ0({{%hxdQZOj$qzvFm(Y{1_vBlE{6JKHDLwgmPre1o--7Bd zqbFbQ$@gsXgHZkD^yKS3ITs>77}Z}v&+o;1g~<&;<-d}=oaK8Cxm!{FRpjOC9r>P1 zekiK{Bt7|hPrgOS--hb1rYB$T$@e_+!%+P-^yKS3`4%NV9Myk{o_xJ0-(uu%NA;hk zCtvT$w>bGbQ2l4<$=7@GJ)iuYsQ$C`RR0Bf^7Wp4FCsq<)qjzm ze7z^%i^<=G>c2!!zTT5>8S>*%{g>&<*L(6UOMU{X{|Y_%dQZ-mke`U^Z=mP*;=OX@ z?ndRmk-VJcTb|rKsQxDM^7W21@epl5iMt%yazm=YR zy(iy_YxLynJ^5Zvej2L(Iz9P%Prg@>zYo=agPwf7C+EuK z???5w(er!pUKMiFQThAsBxm_vNp1$J@B5Q{y(8bM*+4n{H zct=i)$vgW_DQE9IPOb*(J628Ro6sjvec!L_)nb1$x&+nt-O7G#_6^XbsJ`!2_Uo{3 zh%Q6*eW$X21N%nka#Y{W`o2rqugAU#x)Rm*J<5K4_D#`MsJ`z|_HSh0 z41E&S_x;I!bM~uIx%uuSC;7A>w+7Ys-APW~kyA_ZPoerbnC0a?d9`ByG^)P`v)sHV zx7O^RLG|}!mY?_J*M|MGsQzBea`c`Y+p>QS)!&<0p5BvZJND0``ui};)q8Sn&weec zzb~_Vy(i}m?AM|C`!V~Sc&{V=dQ|@VGs{`No$y~k^$%c{uXp6znf;5X{(;Q$^`3mY zuzv~FKZser-ji=v_AjIQ2Q$mpd-CnZ{uNaJ5N7#$PrlvRZ$R}AWtOk^8BYRR0KOzZdWI#@~X<|43#z%eN2yR#g8eX8C$YzJ1xh zis~QDEMM=*w;%i0Q2k?=mB(HW&bX!e=4(ly(iz>*uRJBpT;a-@5y%<`}a}(oXqm|o_vS1{{Yp`#VlX% z$@g~lAENrXndR#}`QE|)BUC>RvwXcL-#giVjOw4xEMM=*c?A1UQ2o5jelOk|iT^1o z|1+57EZK9;^ulMA87yGYK{esN$^`3mkv;PLwKbu*;-jnYH_TQrVg_z~*JvmQg{~fAd znAz{edw1i1kIMfXW;x6E9{e9r{d1Y+>mB({V*ewmUxZn{-jnZS_CKNe=P}FId-9#a z{%2IbD6@RMC*OP7|AOilW0tS?*`N@_m5)Ui9=!;mg;1 z@_mr~-t_cK*{2@}1580DAhD;LF#0a-PHfKzjP+@OS=>9>G6|y!^}K%UQm2@ed}ie<{9v zy(8aw><^)*Ujbjf-jnZq_J`8bzYJf#-jna6><^=-UlCuv-jnZR><_1>UkP8n-jnYF z_D9guzZ_q_-jnY__D9mwzXD&r-jnYl_D9jvuZ-{a;ypPpW`8t2{VMo=FW!3`{}}S} zzY<^0@;#QEb5(M3wJ+D>$U9#}UY_2O=kes7tC5$ZcjR~idFQLi%g;OVJCVHeHRR>y z9l4!E-uYVc^74+nPA2bs9eFug`zx5AMNcQMe*?b#mCVnf zdCBY7#kaqT`FZpV^7{4g?LW!97R^UqzdpYG)y(VAGs)}Uh;M&A^I7ENb`!pw^FGDam#_EayqSFwdiu@r{Z72M z1^+zq@^67JXZdc$FG^m&CBA&UBi~oq7o(@&3SYk7lkaQni__C@jW1vC$@g{k=hM?~ zgD+q2$@dNR7tqshi!WdA$#)z33+d^%!uzcapky(8au*oW#r}G2Vc(e{S3b%dHufl^7W2FP`Fc;jU$Vb~p8f!Q`Fc;jU$L)DPk$i3e7z^%ui00jr+*8+ ze7z^%Z`fZ+Pk#`;e7z^%Z`oI+r#~29zTT7bckHjCr#}SW@5OuH<5wdu|6B3pEZ-mS zuO_cQ6kopHk?)V}uc4=Z8@_zKC*PmgUrSGa7`}YHC*PmhUq?@WIKF(nC*NP#SEr|c zJHC9qC*NP$Ur$f}4t)7~PrkpguR%}$PJH=#PrkpiuSrjT1ipN|CuiTCYSGglNzd=a zd%io>CNKX{5ru+U+>A+cc*&v z^vBVYulMBZyHkC7`ghTjulMBZyVH&I^vBbaulMBZyVFhd^e51hulMBZyVK3|^e57j zulMBayHf*t`ghawd-0y{P7TS+{~q#kmap$ljmYayA}?R>$k%tL#`N?j)040FB-l7^7Y-R89n`}^yKS3`TFkEoSyzPdh+$2e0_InK~Mia zdh+$2e0_InNl*WNdh+$2oPBp{MNfY^J--+4`R>%3y!>a7m$Q6*e`-Ts{{iyy^^Saf zhiXet|3P~4^`3lvk7`Fx{~>zv^`3lvmugQ>|6zLa^`3lvpXxwQe>;yvH7x{{awT=H_3 zZ#Qzz^T^57zFfPLcb-pPp5BpX5Ax2Bl9!`*NF%ZWZgE*EotbO5Tqgq*$H z> z$Nn7jR#bl#dHZLwKNlT}>OV=|{#opcptqs=tI69xkNq%IZfnTNNj^o%4M+8#A}?p} z$f+3l+fn_e>B-A`@+waL4pjdcdUErg+|DO|C#wG}J^6W0eix7*f$Bd;PmbP`c2uyzTT7XCFCcf z`WxuU*L(6UNB(Y9e^g&Gh8!Jvmn(KN;2ELeKBT zdzX=$g35m@c{$6sBDs4}{a4A$*E{m9M1Cr&{~A5{dQZNWlb?p_zfMoS-jnYY^pJ^5B4KONQg-ATUQlkb(}XQ2ANJIU93@~uk#0aV|2C;56$ z&R3Ct5Y_kH$?wH`)yO@B%HMYylrH>ig~_U+>Ac9{EM6zVA-*^`3m|lV6PL`|c!P@5%Q@@{gnXzB|d+d-A=B z{1d3Y?@sddo_ud6zXa9y-ATUQlXC;|OHqB_o%~+B*O1&YRQ|p@$yvUQ$Sp_peRqkOM zsJ`z`^7Wp4TaaIa>ig~_U+>AcCHbdN{T$5l^`4wtv40xX--Frj#e1#spF!onC$pU8 z+XnwxRDUmK`FcmbZP`DE>hH}gU+>Ac9sB1|{e76_>pl6lXTKKJ-Bj4`qH=z25GRxO{^6kNXBdUKGvwXcL-=6F@q56k2 z%h!AI?ZtjGs(%Ete7z^%-t4!a`bRR$*L(8q!+tBOe-yKPy(izk>|aIok7kyy_vGA< z{cEWHG0c81-s_M5Ix7ETndL0sH}IX0W0tFZxo%_cd_1!}y(7=%wndRdhIlaf;`7~xZ zd*^-p0ccKiAUb@fITy3}TbOT0opbNh8^nAE>YQh%-eBfCQRmZl>J4EYfjZ~isdp>$ zNYwd^oq9u=N1@L7cIw^6JQ{UAbEn=g<}s-ASv&Q{GW$E{XZH8?cO8fCT!49JPX4}k zv3D-WEFbUqJCA4Yd^WS3yyNdZfxUAfW_fwX-+dx`=fcc#^Nzp&-RzyuVV0kFDQ=Jiy+$ z6ti5sBcBJ^JC|mbuXi58m)Awi@{!BK_|6wI%f-H2X0mrK!z>r?$YmCL=d#Rl@s3<( zvv^d<>DQ=EMo6mnOQF0k;`KC z&Q+M@;vKm>&ffV-X1RDrE>Ey`uF5PI@5p5dd*`c|<>DRrEM@Opjak0lS%xpKtC{5^ zm*x1**D%Y)zFbzYcfOWcF5Z#LO7_mzG0Vj}a#_XRxjM64yd#$<**jm)EEn&{Wi@-} z8q9L>j$GETcdp4S7w^dBDfZ5_nC0Rf`8>_uxi+(Wz4Hvdyy`H^M=sCeJKw-87yEK~ zj=ghTX1RDrF3+=fuE#7F@5p5>d*}Mha`BE_*0FcKky$R@k;{7a&Nng3#XE9&fxYw1 z%yRLLTwY}F+<;jw-jUBs?427j%hx+EDQ=Y-R7om(-> z#XItOjlFYgX8C&Ob$ofXVU~|v-oSTm%PbfBa@oe-xgE1yyd#(G?48>)%f&l#d6T_! z2WGi=M=o!%ckak67w^dBZT8NcnC0RfxxB;Pxihm|yd#%)**kY(mWy}f^B#NWuFUfF z&inZC>c%V|xv1UQ%fp^L)E?yIU|$YuPjdeL_Wk|UUgZ4U?fbi{y~+7|+xPcY`;hZ@ zw(sw(_9f@qrb;L z#n1jd|L+_1d)?JfcIEwDf4;x!pS!ES)2_U~>Yw*_-PzUOX;Jm{<*vQJMGH*tNwX^*PWgJPCL(k^ym6-$))}|{^;-VPw{v4_uSo|{olUJ{vJF2 z?}xI#NA~yF-M{nM?<4ztWWSFczk%%U@#lVz=zmlG3He?98F%IVmEX?aaXz z->}R69y|WGAp3h{e~;b$d!7A0vfoGc``Gat$o?LG?)QlPH|3v@-_@USSKeRw?ff10 zqyNm^{eAxpyX^0=<9`dXzeo1>*xkR^+3zF!ePq9n9lwF>@A2n;kLZ6>{t5YA{TX-V z{gvO&-*G?s&)nVL_usI~{vJF2w;=m_WPgv{{d=ALKC<6O_WRiJ8_511fA05){x{{H zkl)pxaaZ17`R)82_oM&J-Ti(44ZG~`vEzRWvcE_6_t@RP*V*qQ`+a1;j~%~(?C`OmoX{72u+e@ia)&+$ipkAI4v{d@ko ze|P`eIA?igdH(M=`Tzf~U40YT@AmKc{~r9VSnSICZ{rjF^X&Y0+Ijw?d;cA|{{hKf B<|Y6D literal 0 HcmV?d00001 diff --git a/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np1/IJ.A.i8f8.00000.bin b/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np1/IJ.A.i8f8.00000.bin new file mode 100644 index 0000000000000000000000000000000000000000..393a8965292dd1d41dde114b9753b0f859cc8894 GIT binary patch literal 153688 zcmeIbWwe%cyRMJj-HibVDk!3apnxKZfPjR6gwoyJAQ*rGDkdeNpo9UUG!_=1QYK(` zckbbMkK;eaVj$1&nqxBG|2xLBzMShiuk*a-!+qR)f4KL0_u3`jfBtLlZS<4f{$r^5 zjv=5jeoT%r-?p>;OCf$`>CiQ1z(%re2N%tU^N%tg|N%ta`Nw?+jZ}UFf`#0T} zeJ0(HT&nI*K2;AOpQ;CvPt}9Sr|QAvQ}qz?sd^~+R6UG*COw>7COv{&svb!`RgWT{ zsz;MgRsXM-R6Umasd^mwR6U-2s-8eTlb%Q}lb%E_Rr8Zi)sxAm>M7(?^;GhydK&pu zEkHh13zAROLgX{)>EtqLVRETjgnX)=K|WQ_B%i8hkx$j4yS^?y5v)}9{E(gntZC(C!a|hkoz}n z$Uc)^LoSmxB9}=Ulgp${$Ys)|_M;co{`8_cfL>Gw(u?XKdQlxrFRDZ6rRq@fsXB~&RIjHO z)#3D_I)YwQZ=e^|8|g*$CVEl5nO;;!(o5A*7rm(7O)skV(2MH5^rCtny{Jy07uAXMqB@CQs!k@K zs#C~E^?rI$ok}mN)96KYI=!gQpcmB#=tcEGdQqK8FI8uePt}LWNA+QPQJqaMs&nW? zbuPWA&Z8IAN9aZMQF>8*j9#ifPCixVlaJ~GdQp9XUQ`#-i|Ui~qWToQs4k)x)y4Fp zx`bY;E+wBymyt`=<>XU!1^HB6Nj_DdCZDR$kWbZT$*1abNi6`b z`UAbF{zxyXKhcZo&-9}D3%#iRN-tG^BcH0jlaJ~j^rHGFy{P_0FRFjji)y}IC-H%>W_oo-t1L&pdf#g&5 zAo5W?m|j#5p%>Ld=|%N0dQm-`UQ~~u7u6%_MfE6psd_Z|R6T}#RF9<>)#K}(w zJ%L_SPox*sljub?KfS1)OfOYWA)iT4C6}tFkx$hEN(_7wK(}yJ(ql{mLQ+1=aJ8(=aWm-lH{XW zie6Mp(~D{udQrWAUR2A{i)uM~QN55}R4<~Js^!V2Y6bF9tw=Ab7t@RCCG?_NiC$DM zr5Dx8^rCthy{KMJFIB6MPt_~PN3|-ws8*vF)#~)3dL_N6)}R;Fn)ISti(XW(qL-?* z$){=^@=>izFRJzEMfGZWQLRrestxExwIRKzUPCXcjp(InWAdrmgnU$+(u?Y~^rCtl zy{I;$7uDwUqS}I9R9n)EYAbrF+M0Z-wjm$Yw)CRfj$TyT(~D{cdQt62FRGpBMYS`% zsCJ>3s$I#aYB%yx?M^SMJ?KTXC%vflq8HWP^rG5_UR3+ii)uf5soI}>stzC@)q(V) zI*49W2h)q{5PDG^N-wIz=tcEMi6`^;YtkbPTynI+k3jjw7F{w~~ zA(yK6l8@?r^rAX}UQ{R2i|QnLQJqXLs#EAi^?rI$ok}lNr;$(9>Exq2gI-i0pcmB# z=|y!Wy{OKj7uAR8MfG8NQJqaMRp*dT)w$%OI*(pdAE6i3N9jfNF?vyboL*Gt(~If? zdQp9XUaBr6pQ=xikLpwOqPmD)R2S2W>JoZUT}m&i%jiXQIlZW^pqHvE$*1bmL>J~`YF9s{fvAj{hVB?enCD}za*ck zUy)DMugRzCH{?_GTk@&;9r;xKo_r?#fm|m2kzA_&L_Sr2CZDRmkWbZL$*1aX(-Hl#Ucc&NCJ?KSsPkK?^i(abk zO+HokAs^L!=|y!vdQshBJoJ%V0T zkE9pXqv%ETXnIjShF(;Ur5DxX=%woMS^?%T7X`v79^jlg~&(sbb3)OOfRZM=tcDmdQm--UR2Mb7uBNlqFRhzs-8_gRnH+G z)#CJ`dM>@FmY^5a^XNtOe0otWNiV9U=tZ?Oy;LnjK2t2)*zp%HOZ%HE%K>)75P-HO+HoYkWbaRxlCH0T&gx8pQ;VX zr|LE2Q?(KKRBcQ?Rhy7c)u!ZA^;+_o^g42>+KhZuo70PG3wlv)NiV9c=tZ?Py{NXK z7uB}(qS}sLsddl8@>rdQlxsFRHiDi|VcPqB@3NRL9bb>Nt8)y^UU~ z-cCMM?;s!5@${m4C%vfNMK7v%(~Igo^rCt%y{O(tFRByhrRqfTsXB>#R43Dm>J)lW zy`NrGr_zh+GKuAeol7sO z^XNtO5qhcmDEUnK7`aq^oP4UzC!eYd$fxQPg)8Px{h8{*VBvY26|E5NH40J=tcDn zda3#*`BZ(2d{p127u9#@MfF{JQQb^0s$1wqbt}E7zDF;r@6$`w56GwLhvcLB5xuB> zOfRaR(2MG)^rHG1y{LXpFREYAi|Uv3QuQnHsrohfsD48)s^8L!>UZ>_`aQj<{y;CP zKhlfpPxPYtGrd&(g?y_1NqMC0v{_|2n-GzLr z?n*vYcOxIw-RVVj4|-AElU`K!q8HV@=|y!PdQsh%UR3v^m#X`dPt^m+NA*B@Q9X!W zR1c;X)kEk-^-y|IJ&ayd52qK^Bj}~-k>oS!QRGtfX!5Cg4Ea<&mVBxnM?O`LC!eY( zkWbYU$*1Z``BXiXe5#&CK2-~lPt}6tQ?(HJR6U)1sum`nNsEw6 z)icOP^-OwEJ&Rsci_(i~F?vxwn_g7Up%>NS^rCt$y;LnhK2^^nAJy~eMYSZosFtD^ z)zb8$T83U!FQ6CIvh<=_j$W!>NIq3BA|KWA^rBjUUQ{d6i|WPnqIwCvs8*sE)l2C` zwKBa_y^MUSUQRx$Rp>?a3VKnkN-wI_=tZ?Uy{KMEFRC@@MYSfqRINomRj(o+)!Ou; zT8Ca#>(YyAJ$g~SnqE}v(~D{YdQojiFIBH0pQ??>N3}7%s5YS&)u!~KdM&-EUPmvg z&FDq7IlZX1pqHvG$){>7@=K)`$bv*f0y_0+KyW^I+uK^&Lf|ykC0E*N6Dw^W8_oyaq_7; zpL`}=KrWL$K`vDnl26qq$*1a5NDh1^;z<%`W*RGeV%-(t|FhRFObiqFOtioFOf^tm&vEAr0ht#b+VlAyL9P?3?{l{A zb3T$>XH?(kZQtj86uB;_zR%sh&;4j}T~U3XzkQ$oG32_T`f{)@hhxcgNA=}lUmnMi z>w)Ua#lC!wC)X3zm#6&`*!M!^CLg(+$i6qKFBf}qIf+~!R9`Ok<&vLVUsPW%_T_Ri zxqhg=T@QK-IL z?8)U^a-&iG{M+>9QUd=LR9`Ok<#HamTTy+v*q6)s_T_RJx%*Llx!5ny{&I9GsxKG& za;ZXY8mccB`*OL0+;mi5F81Y8mD~(eUoQ6LQjOdLsJ>k6%cnZI2T^^w+P{+hOjK_2 zkxLEsvrv7x*po|5au1>UapFP<^@BmrFfzkD&T;u`i#i$vukd%hi5;_K%@*laE{)uzwuYmy12QG$c14 z)t8HXxm-hT0je)o`*LYS?g><1F81ZpnA}2CUoQ6L(uCZTsJ>k6%cUu~r%-*l*q6(- z&Pue_2p{68T%!u+~gydrR<&MVO}1~$T`cwo*b5wbN2b$^ZBnJ=j?O0 z=W}04&e`W}uPOVdQD>jCJ)iS4ZE9TDVi>Ur?%=TL|cR^o5^>=5s--fv>`ZB7&2ebXQ%-zse zQ2jlb?YCp@j;==a_hPo+p1B9Q2G!r2*?tG+p6FUse;;Q1y_jD`<+d-goaECR|20&9 zKV~_3M^1g%zmDqf&nz$R$*V8>b*TOU%yRRd-1@O!kLn-DEI;qbuRr?@sQy9Ba`c`Y z2e99W>L1K3Pw&ZdAp1?I{vphA^`2Y@v3~>AKa^R%-jnlS_HUy4hcWw}cy9>)Td4dG zXO^>khvL7D>L0-@U+>6w82fin{Ue#>>pl5i&;DIh|0rhpdQZN?*>6Vmk7kyy_vAZ* z{T5XJ7-so;Prf&>--_xV%Pe2-$@fO~@1gp~G0WF`gYj=d-$(V2XO^$`){6lVE)PrhT=e}?Lx$}C^+$#*RK&r$u;nC0s|`Ho}%1*%_wS-#$r?``bAMD+_Y z4@SKw=iBkWLiGzV`@VSZ4*aiC`Jc`#XZeoD{|41B%q(B;$oEe6-=g|OnC0s|`QF9; zJ5>J+X8C$gzIU_#9@RgSS-#$r?>+2)K=sdJmaq5ZdoTMRQT?LK^7Wp4?_>WHs$Yy* zzTT7X1ol6p`e!rC*L!lF$o>~p{~TuD7w=8N{}q*gab`KocQXEOsQ$Uk^7W2BHe)fN$`sXpr*L(7v%KlGO|9ocodQZO7*#CvZ&_vAaB{okm5DQ5Y4 zPrftQ`~QHdUm9P&-jnYG?04DaKmUz>8GQMAPtFgr-<6*J1^B)%-kXWP8~Mr1Wl=fH zcNYHc>-ogP#6{`119hd>>}NCq4a(@a5}0`Oap)7d`#*`119heCM#= zo1T6JeEE7$zH`~{Lr=dVzI?qW-+Ao!rKf)}zI?qW-$&T*M^FC}eEE7$&X2O+pPqgt zeBT%EJ%)b(dHG+8KN*$p!k4f2p8hPb2T#2w#rgkz)b!&W*{-&pYxfNZz>#dAWHtoRG7T;b>!va9XS;t@7#>MoV{}fxmE0&qc5PZp=XlQZ-H;`MdsJhv&ieW z#JB$v^E$LBdHq)S_FraRj}{}Z-x}ZkE6f|vv&rkX!MDGfc_VrbdHuHd_SZ0PLW`5v zZ-;MxE%O`bx#acR$@sZ{wd&UcVE*oV+8aci5Mt zr{5W0Ufz?}yX;HR)9->WH}A=9GyBr?^t@TFJ-wWUO#Csp&UqoL1z47HN-;eOi zlh^NqFJJG-_ha@I=;`;xm#_Ea`w9Ds^z{4T%h!8b@IOT_rl;Q@U%uYkivJmU2|fJ* z`10MtEZ@(WE78**h%aC7$@dHPm(tT8gfCz3$@fe4mFejZ#+R@6E^oQfi*L(8)o_#fX z`XlhSpx%@35BSyT>ED3A74@Ecf5g9%p8k#a^7Wp4e_~&Qp8iev^7Wp4e`a5kp8n1F z^7Wpae_>yXp8iOD-xu%wihmV(`H#YvvwVNUuT5TmG`@VjBj4ZI*P*9>3%-24C*MEV z*QKX_E53ZaC*MEW*Q2LD24BA3lkZ>bucoIz7GJ*JlkeZ`>(kR8hc936$=B~r4e06L zMo+%plds>M8q(9hot}KXCuhGqT|-a*4tl;X-t)UtBl7YePhQUQ^}ADJ^7?m@m#=r^ z>vyLn^z`qdCtvT$*Y8eE>FM81Prlxhuiu@nrKf)nJ^6Z1zJ7PQj-LL#^yKS3`TE_d z89n{`=*ic6^7Xq@b9(v{=*ic6^7Xq@3wrt!>B-l7a`wAZOM3c~==r{Q&+ksH$jg5+ zc{$71?@q1B>rWvsU+>7*?@n##>EBOJzTT6s-<{gh)1OLDzTT6s-<{gg)1O99zTT6s z-<{gi)1OXHzTT6s-<>+p)1N_4zTT6s-<>+r(|>@Te7z@MzdLoJr~e>5`Fc;zes}6j zPk$yo-xu%s-Kh(C`OhLRXZiZwsVjN?hsevMx)t zU+>BHH1Y#c{U_+j*L(6UKz^1GS5^V8(z<{i0>B=7tTd3kw9UZco6 zKTBRt-jUO2^3KnZmydVkbPIXs=gG_2JGYWM6J15_EavmkF{u6vc6c2rxuHKVtW%5%{{Ws~!*L!lljQstm{#*2XPrP?Ixv8l9-zG0-`Bot}4b^{# zynMYQ-z&&ZNA=&OCtvT$w<`G=sQzYp^7Wp4tC4>I)!#x-zTT5>b@C6Q`djJA*L(84 zlKf0m-|tTH^`3ldke`L>``t;t-ji=l@(-cA@{ghVes_|u_vG7v{Nt#;-<{;^J^3~yKOfciyOVsqC+BO(FF^JE z?&SO8y+-7oK;`duCppWvF}a1PzTchX>mB(vA^#+*?{_EpdQZMh$v=ha``t;t-jnaO z-xs|BC-<{;^9r?B)|1_%acPIIJPrhx* zKZEM~-ATUQlW#ln&!YN%capF7<_Teeqrw{FhMq@6Ie|`F6#B8P(r|S-#$pZ#VX@ zp!$0<%h!AI?aqERs=pVre7z^%9_-hk`g=3W*L(8q$$l-WzYnu~y(iyZ>|aIo_hpu^ z_vG7~{cEWHe$4Xqo_zbTe;w7|pIN@%lXGA8>rnjzn0;To*AIU^D*pqSpl72 z%>DyZ{{&|FdQZM1*?)-YpU5m<@5y%*`;SollbGe}J^7Ai|1qkcpIN@%lk+X?KSA|R zX7+vY-mUnbqVhk5S*ws9Ph*y+cjWm6d*=eoa`cWIzhv)RkXe4- zk>6MBoeMF`%{y}Yn!WSs%<}S%yuM-YT$ou--jUO{?464+%f~x%`i{Nx8O(C_&iD9Z z&@<7o=soBU+xTZO+Z)GxFZv^@UzFLqw=v&`{)FlmW43=g^91x~RR3&d`*$!;M1Mi` z&tbMdo_P}bE2>|d+5Vl(lhNN${d1Y^-^Dxy{T?H2l9%{gTXb@{XLQv;P~_FU2e`@5yTh`+U3p=L3*_X?(ePPi_ye--Vuj8GQM9 zPks-w-<6*J1^9CGo*ZYg-;JJrS$uhVPoA^b?@mv@9KKw=C)bDA??F%hLVWppPtFgs z-;T3Viu`N4`(8Ka8G! zRebq+PrgsFKb)R^HGKJcPri%TA3;yQI=+0pC*Q^FkEEx6CBA&UC*LLPkD{kv17E)0 zlkZaYN7K`!uNgg-U|HV$jiSrzMSQ|690Je z`gQQ->mB(%&He;>`gQT;>pl5C!~R5i`t|VT>pl5C%l;&K`d8!2*L(7Pj(vW5`t|YU z>pl5C&;De3`VH{q>pl6dVt)!f{f7AR^`3lRV1Ft-{cG^$>peNY$o@2X`i<~?U%dAc zegX3GZ;UTz`M!)_ki32qeEE7uzOS$^L{GmdzI?qW-_`6-r>B1{zI?qW-!<$D)6>5W zU%uXx?^^an=;=4Zm#_Ea`zrf0=;=4dm#_Ea`x^T*>FKw?m#_Ea`#Srx=;^n_m#_Ea zypDZQdit&KeP6t{9={lQ`M1WGvwSz;pG{uB4ZeK6Bj1he&!MN^7GJ*JlkX<>#p&s{ z!*{2@_n2A`SkQV;mg;1 z@_mPWNqYL7@#X71Ils%k6g~Ye_`WaR+l*hDy!^Z3%UQl#@XL_b?}jg5@5py6`wQsl zcgL5n_vHH?`?B=(d*I90d-8pseK~siJ@Mu1J^6mX{z7{Cz3}DhJ^6mf{vvw%z47Ji zJ^6mbzC1nsKKSzWo_s%MUxA)}Uwrv`PtKpPuSie7AHMI4_ddnHn7sV^BHEB2Ss(;tE_ zU+>BHYxbAZ(;td2U+>BH8}?P`=?}w~ulMBpE&D6z>0gg8U+>BJJN8xS=?};EeevG+ z_|?eEe+0gqNZz3;8@5r$xdFPwS%g;OVt3}>< zBzd`cM{ZY@s6D8l6St9yqvvLkK7OJ$Dlu= zf1y{C(;tg(?{ok4W9@Ut<{+;aY|H15cs3zp~?_zKNPiDVAH6^cqH+%bjce<9G z-0mSKC;9l@={oZI_mY>BcjV-Er)Ko@@1rL#@5#&WPR;4*PoO6^@5#;YPA%x^PoyV5 z@5#^aPA%!_PogJB@5#~cPOa$aPo^hN@5$5ePOa(bPoXDQ@5$BgPHpJv-%n4z-jlQ6 zo!ZjVpGwd7#Cv{sYDZrF)5yzNzJ7OVPhNjIdHH%rzJ7P=Ku>=LJ^6Z1zJ7P=NKgL( zdh+$2eEsg!iJtz0^yKS3`TE_dGd=y8^yKS3`TE_d3qAc=^yKS3`TE_dD?R;(=*ic6 z^7Xq@H+uRH)040FBHWb*w`{m1Fa z*L(6kg?xWhe?C3=dQZNmk{^KTFQ6x1@5%Wz@&i%*C+PXUc&`AtL8$x}l9#i53z8d* z>OV3*L(6ko%~Q#e-S9Gtlkb`2N1*!4=*ic6@;!_E4XFNddh+$2oQsmb5!GKo&-cZ9#mL=+ z%6}z!Im`EKayO&;Pm`CgcjS8x`H`spGxX%^J^2B-l7@;#6It*HJgdh+$2e9tF82GxIoo_xJ0-;(6VqWUk=ldt#WT#EcS zRR1Mb9dh+$2 ze9Mu)6V+c!Prlxh?}g;=LiJyzCtvT$_agFlqx!GWldt#WTb}$qsQ&Bp>b zs=tn&e7z^c2%#zTT7X<>aTL`ft;dulM9zh5R&B z{~dbr^`3mMAU_?|f0v$oy(j0Ypl6_BL6U|@AoPBdQZMrk)Ms~ z`<+U@-ji=_@^esqzgNlEd-APAelDu-cPsgNPtJA8&qMY7e&ze(y?W#xLFMmvMmfv( zQF6|HUzDqTxjshT+3$<;^o~3qC-3a{MLBv$j`PVo`+ZS<-jUw|^3Hx=l$&?t_5^un zzc0$mJMvmc-r4Vqa`KLxo+R(=_eJ@5M@~(&sR`wgRZ;mcS_5EID{~Go!&}FE;->K|3V&4*7j_Uh;%6?<^t zWd9zje;l*#i}!BAe;<|q@yv3T@6Grhp!z2;%hx;d9m)PfRR2U~`Fc;jqu76h>Yv0c zU+>9xH2aTH{rt@G^`3lhVgCuLe=@Uty(iyW*?)@apTaC(@5y%z`_EAQQ<>%KJ^7Ah z|2e9E8nb-8C+BhOzd-d1F#EoE?>77|QTZ2Sma}|s$Nvh|FT^Zg@5uKK_Ftp=r!&jf zd-5I6{u@-kFtdEUC*M2Se~aoDVV1A=I z0o6Z?S-#$r@4f7QMD>d@%h!8yzK{J+sD3eK-xu#q!2cPQ|JlrPmhVLTUr_yXnC0so z`A%a0E2>|dS-#$r?_~DBq59`C%h!AIox=WiRKEnXe7z^%``Q12>Yv9fU+>9xD*HcC z{qvdS>pl5SWB(VbUy@nA-jnZi_J5=LrI_XGJvq-{pKmw*^HR*EQQsHuJ%GOpdHI*Y zm$Q5y#NU;?{ss8*^^SaJvfquKep!6^dQZNy*zZnHzZ|}Ny(iy?*zZA4|3ZBEdQZL& zv)_}R{zdrm^`3lZv)_xJetCTPdQZM{*zZkGzXHB|y(izf?DwIkUlCuv-jnk@_WRP) zzZiep_vjJ){m9Gz5_~z!_fh=)$?I3bm#=r^`xyHJ=;>dIFJJG;_i^?I($lYuFJJG; zcRu@r=;>dEFJJG;cLDo@>FHmNFJJG;_X+lg(9^GiFJJG;cOm;j>FHmAFJJG;_eu7L z(bKPr@B89CIX}hzaC-XH@O@vrw+R0T^75~aFK784NzVC7a&omV*Q3Zg*B~!X@5u9L z^3FBM%h5Y>Jchh;E%Ng7j{J@#?|c<`xp_x!$B}ogOu_i`id|ER z-~O}AtI^ZR>tBm+e+_eCa&o&4UrzE_i(iDielvVIc}GsKvOj~Kesg?zc~4%iu|JcZ zehYlLc~5SyvpO{n_;N+u+O9 zdve{#{v3MxZSm#nJvnb;U!0zPJAB_0@4bP4E_wO4$CtBw-^4FLUcUpre7z&zx7eRY zProC+e7z^%x7nXhPrnnse7z^%ci5Mtr{5W0zTT7XyX;HR)9->WU+>9xGyBr?^t*U%uXx??>#*)6?&RFJJG;_ha@I=;`;xm#_Ea`w9Ds^z{4T z%h!AI{gnO1^z{4V%h!AI{fzx3^z;Yd%h!AI{hWOzdin$Lpwzk;6r z_4xAjo_xP!UzMKzaD4fCPrl!?uSQRQ1ipN|C*L2~SEr|c1HOE{C*L30UrA5@Mtu2t zPtHHFuR%}$CVbx)@BNHllf3+I#+S2vf5ERsUVkLMe7z&zU)f(pPk$7?e7z^%-`Llt zr#~8BzTT7X@9gW))4v5@zTT7XAMESW)4vs8zTT7XpX}?=(;tH`U+>BHFZNf{(;tg3 zU+>BHZ}#=+>5s#gulMBacc%vQ^lzi*`{F&nJ2fOP|J%vSS-yUEx`w>|9pvTf9r^m* zsS!Q>@$}^DJ^A|GsWCnMJL$>Sd-C6Au@1`eT@5$HiPS?`Y zzlWZDy(eG4J6%Ul|6Y3X^`3nF?$nH){(bc1>peO9-KjY}{R#AZU%cmcrxxVpKasqg zw_WMMVW4JGfqh`gM=GmKn*bTPS;nTw#;qxwt8**k^(8R&3Sf9W=NPi225Is(;SM&ABu z?9W1PK=qfCw_kvLQS?Sse+7B_1=$xvZ$kA~lDA)o{n_ZvsQ%OB?Vry69CReA{|tHi zh1nNJN1^)9lDB^@`_ZV}o+BqG`II1c3#$J-c{zJWPUn%o71duwPhQ@W*ZJhfp!zS+ zlbiSCR+9W!RR2YK^7EejN|7Ij>c2!!j^2}FY4W$B`Y+Ryr}yMphWzcQ{wwt4>OHw$ zK>iL?e>FY%dQZ+}$&W|%*UYqL-qacBwz2zxdHjdQGLHV z`M!9sA-Vae{Qd4EXZc=3ZUL(AcPIIJN4|~7KY{A|-ATUQlW$}43sHT)JIU93@@+!? zNmSqOPV)7he4CPg3f1?!lYG4=-)qS)LiPRbBwz2z_d4>6QGLHV$=7@GZAN|xs_%Cv z`Fc;z&B-rC_5JST`{KP8AcJ^ANQeZM=& z*L(8qK>m4DKOeJvy(j06>{p@syDhH!ZU+>7b3;UN) z{oR@6>pl5)W&bj&zX!8?y(iyp>|a6k_hgo@_vG81{c2QyFJ}3APrg0auR-(zbZe{O$EVKN)Bft09J0Hg^H}A;p zefG}BGt0|6^7??i^9jsy@{XK7Wbb?;vwXZGr;pe>pTsO@?|h7ZJ(?dKj^47(d@{57 z5zM!u&ZlhCyMcKO>U`=py&IXwqRyvn)4Pdz9O_(Po8HaLx1r7jx9N>!z8!Tgv`udm z^Bt)3>D%;1Gml4|3vbiAliBB7gxTlobG-}S`3&Z5Ir)6=X779^vwXbcbH0bY^I6Pt z@{Z5@UiQvKndRjjpZk66or^Kc%{xB-3GAKEW|p6K!F^Eu3N^o~3xv3D-cEKl#q zXEJ-|bD8DpohkV8D#0vYx!jNMd>*r0?8{{;d*}0+<>DQ=Ok?j{l36a^k;`=U&ZU^; z;vKonVDDU-SuWm@%LDA4%P`BuJ92rDz4Haka`BE_X0mrK%Pbe~$Y&ON=W@*Q_0B{1 z^16^&K5}^&-}xeDx!9M>Z1&FOndRagxy)hjT!C3G-jT~(_RbZV<>DQ=%wz9-F|%B} zBbP_mJ72;q7w^dBQTEQ2nC0Rfxje?+`BG-Nct<{uvv;n{EMM=;$CuY-%<_@T0(|Go zndM?%E>Ey`uEH!A@5p5#d*>^d<>DQ=JjvdR=a`BFQma=!Q$t+**EW?*qEoS-1WjVg{Rm^g+FP9bUooh48 z#XE9Y$=nA$xp+q|tJynW%Pbe~$Yl+C=j)i|;vKoHW$)aKSuWm@%d702n={MBJMwvr zy>km@`FiJde0jBGmXBQ4;XAitmWzG4tY`1snprO1k;?}5&TW|G;vKncWbfRTSuWm@ z%O>{D?U?1_9l5;0-nl)qT)ZQfH`zOPV3vz_p?8`wNK+flH-{-FmB$@!e^`<&GwJSDr)mcW(bZj`EJ?v(J6|&;5VpxkPzK^ZzT)A^SVG{~kwqNAua|zWwL^zw%sC zd8g)b`tQ!(&z<)u^*N^IvOIUpWoJL1oy{qyzdzgC@p}>Fmec1M{X5ZoPJdUnmwi9} zc>=x%|EAgZar^H{UOkuS--+hsp6&g2Ip>r^lv^~P)8CctZU24B>*o^X9nI(UzbE_m za`(N8@{Z=SymFUUUO&$$?`S@+|2^5im%Hy{D(}=>PWfc-=MLA@=a`zy^4u|(o&9`v zHm98a{%mi@??sebPM>G=??m%C{ax8!_Wk(h3HToTn`Ym~?Y}2^^<1KVCz_Xgw)fxV zoKp@_Zqa;Be^<7*{r4%apG%Z?G@sZ1p6uVt-S;ZWJDSh(%3WT0{XC<*qxro4_hkQG z?!J$yyi;>I<&(XiJ6uzrV`?tTbH`kE_Vd}KPB}!mMe{lRUD@9D->1BOE>Ygmd|v;1 zvVSjk->WF^Xg%m_I=#`dy-erCHi-wdAVnM z|6R^GRcRA;jLzG)IpVQx!?QQ>k%IoJ6);v%GSbS6)BQDDP-Kum3&Szn8o3V=C{|Tu%99@8=HJ)aRI*%ktbY zm!185b~dM+{{C!l$L~dyTTY*6^zTITIsIMPUiSU?=Lz^8{F`Rq$L+r-dG%bPep z^mk=@+4tk0C*XVVZ<>7{xBs5x)pLpdooHU}+1`Jbb51!#xkd9i{axAK_TQ(xelAho z(R^P2d$NBoci*ch?`S^DD|dP2_4ADKj^^|F-;@1&x%)n*@=nd=lu!14?r_cY95d~s z{Id7{FSp!&9#J0I{Qu?Q^Vn8%n^WpNe@8aIV@^Bk`J~=W&1HG+nB&fVKB=5ib36O@ zX7BI#eM#k%n#(@#9Y61#{d`h6rRH|_@6F!d@%xg>DK(dU-aCHYJNx;ha!SqZ?BAQc TzvK5M6Q@l3==06qlgIx9Bi4}9 literal 0 HcmV?d00001 diff --git a/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np1/IJ.b.i4f4.00000.bin b/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np1/IJ.b.i4f4.00000.bin new file mode 100644 index 0000000000000000000000000000000000000000..4418372510ebcded6a92c63d785ce41b6422443a GIT binary patch literal 4064 zcmeIw!3_Wq3_#Heds)r6#&9SO7I1lz=J(K(yb}4^?#ZmVy)Eb9cJv724;Wy80R|Xg QfB^;=V1NMz82D*m0Spf8{r~^~ literal 0 HcmV?d00001 diff --git a/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np1/IJ.b.i4f8.00000.bin b/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np1/IJ.b.i4f8.00000.bin new file mode 100644 index 0000000000000000000000000000000000000000..c4253966bbae69ff1aaed18d89af203c1d15e798 GIT binary patch literal 8064 zcmeIyu?+wa5Cu@8v6cNdQ5r$yC|JSMd=k~=-^(dZ-Fc#yxV@Rrhbu>mr!mr!*#>%m4rY literal 0 HcmV?d00001 diff --git a/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np1/IJ.x0.i8f4.00000.bin b/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np1/IJ.x0.i8f4.00000.bin new file mode 100644 index 0000000000000000000000000000000000000000..fc1708b9d18cf505d11a14073809318dca2a24d8 GIT binary patch literal 4064 zcmeIup%nli2t`pjy8oPvK|qQV7%t@ze!8*x&g~?3e{W+3N`L?X0t5&UAV7cs0RjXF Gd?QfN3*#>%m4rY literal 0 HcmV?d00001 diff --git a/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.A.i4f4.00000.bin b/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.A.i4f4.00000.bin new file mode 100644 index 0000000000000000000000000000000000000000..c613d67b1be075b651c779b20bccf6d03f92e872 GIT binary patch literal 19288 zcmeI1Wsuib5=9f@25}c4Lfl;k;_gBe;x5D;h=;g)fDm_Ag2dg4C&b--zwDlqd0p)O z^O~(p4dKhA>eTPjx94@wy!)!QYR4U?`M>cSzMqfRT!`;DGd2IaX~NQ2K7ai0KgVhO zci7`18fizZ5yv*-ZjDSptr1tNF%k6|6H~7-3H2J2Qg383YBeUOUSkUCHQH0J(Sdp+ zQ&Ouj74;fZQ?D@%^%~PsZ)7@ZHKwOtV+QIqW~5%jcr`LJwHmWfuQ4n28naQaF+24d zb5PIdh?mg`FQYSF#+-OH=Axc4H(tg(co|*rGUmmrF(37e`SCIqz{^+=FJmFR8Vgg; zSOhO)QM`=B@G=(1Yh(#(HI}4aV=3x2mZn}~8R|8brJk`IUdHlx87tsrtcX`*CF&U~ z<7KRZm(hfm(G{;oH|iOy;$^Icm$5ot#u|7v)})@X7GB2Mcp2;9Wvq+W$a>UjtWUkh z2Gnb8NWI2J)N5=^J!2ERj7{+}Hp9!<9IwU})HAlk%h(DpqdQ*4)_66xp`NiVUdDEK z8QbG!?0{FJ2lb4eco{q5W$c8Pu`^yHyHKmKEA<+?QLnK(^%{FnudyffjJ@zO_QuQD z2QOn^yc+va&)6R?;{d#jUU(S?;?+2add9(c8HeCy9Ez857+#ITsb?I4mvJOs#!+|~ zN8>ee47D1^Qm@gQdW}BRYxJdF<2dRW$Kz$3fR}M1UdBmyHBP3UaSC3>sdyRv@G?%r zt8qH@j5F{u&cw?&3oqkryc*|F&o~z^<2<~K^YJn+z-#0}YBesRUgKiwH7=oE<5KE1 zE~B1tIbOyUco|pXW%S3ZF@So;K)j5r@G=JBWn7I{;~MH2*WzVdhnI0ZUd9c0HEyJy zaT8v~&3GBN;APy3*T`+uYTQn}#vRma+)2I0UDRvbO+Dityo`JCGVa66xF4^^1JpAf z#LIXHFJmxX#>03uhEUHKikC4AFJm}f#v^z&9;Ke~7+%KXco|RNWju-3$Wzp6JWajE zGt_H5OTET()N4FXJ>vzuj2H1TUc$?G8L!4G)H7bi%XkehV+3Bt>v%QZpq}w2UdCH^ z8E@ldyn|QcUFsR{;bpv!moXAA;{&|^=0pD7$Vb!~`IuTGpHOS$Q)-QTMyiV#j(UynsWNP0;`TuuJz;~vit+j&*VdkR8 z_M$yc&+{gOIf{?xoVsAGP6bZ7WCILEU+w*$;sbnM`{Q^H)JjvYLA zDwrG8v4dw%4fB9Hc9;g;1;*!>agK96cUqXY=-9z?r-S)G9XojL^e{iDV+YTk0Tuvt z>@XvGL70S@&T+2iE(AYQQ^yXTyD zIx=ccNAOOUEjqI5&p5+-U9M>FHgwZ`yY2|~Imf$RxoGb@c5{~Zy$Yzk^VrQhZ-Uv_!?}@b=Xm#BK^?ia$2s1Ax1zoO z*v&a+U{z3?f!NJi=3q5Yn}gWREUXTl*~7V!b?2-BQ?zTI8Ckc-Icq|DJay#VpK;Dw z&;d^!nYYhbYr~Xy>d3x*>p&NFm)1$&%h7Pcum-hzG3F$>!k9dE&(ah6%wuIP9V{)}1J9#&uv=f-<* z&JHk7yXKkk7VL3O59orYHgB<;b9%zOcxv+&yE$t|m=8}K@4>#Epotyk$1{Uw&&-*N zor^YidS=c{>{7Iuu-D9)hh2*{5B8cnv#?vyX2D)_usf{IT<1joJ=+}Y0cvv)yLi4i z*b~(82JCZ&IoPY{cn9`5%N*=ov^j{q%)vge4tqE^-h*?@!M>n2Z?T(m%)x%3HgB<; zbIig1ppLg-pR>%t0Yx|Qjor*aFW8VhoZA)L$2n%3w`^>_juo-(eH{L@J^kJ|H8Bxbuu*W%vLld4l-a-$wbB=(ncxv+& zyE*Gf=!U0`_h8>q(48Gt#WRCu&&-*Nql-2ddS=c{98)H(dN$HK42CuF4~Ot26J!;9LikhME*V799#-&a}c|DzB#xI)aD@e zafUg#9MtBZH`wPab8tn`@gD3m2Uo&T?BU#a56&?M{XrdX!5-(Bg8@ayTd>bL=3rpa z<{)-+mN~cz)bSqt8FMfQ`ml#{<2^XXEL;t0a}c{Z$1Gd}>UazGImawqTeLZd-JE3> zt^>6>h~3P>^>8A4I5*ydb8dhG$cQ@Lf<4Z;5qjaN<1N_doSWc4JaxPU`G(2pGs#xsLv&&-*NTZ=XqdS=c{+*Y)iu-D9)hue$p&DUOYXBO@#x({D_&B2{; z7IU4`7d+py`@>yDNB-^c`~h%x(dI4oamGNn2h`>uc5;?ExEIv%9_%v*_rdw>(VuU; z2j`fB`$26EVmIfQg9ktzZ^1t2n1ct4HV3hrv&_Lmpf(4wn>iQ^m#~L(<2^XXEIbTq z^A@`~$1Ds1b-V@poMRS-79DTFK4+PQVMWJ#@Mp}zaJZ5^oEz`KIgh}p?V4wrx7f`& zk3v5@wRwx(obwo*hNm`fv756Vhtu)Y@gD4Z0tT_e8F*&UY?wK7@nq5FPS4DliKmJ- z6ZV=p^YC=h=D}WbXBM6*+Kk$34xWYUnd_X$zh|3+=Rh6#x5x9%!ShAO8?etA=HP{* z%|YzsEOYQ8sLes_We#3~TiC<7{lQtzF$XUfJ%DfQ<{WeI3aAG{?B<-I@G7X|E!gL* zVenef@gD3O4kO@B_Hb^z2j`fD*FkL#Vz;4av+xF}%|Yzu9JBBysLes_<}9=D7O3Mr z*k=~rhWpsVx$z#H^A23qu6bs>1$&(HE)2p`$6N4cobw)Bji)wmv758rhimZE@gD3O z34__;T0Apo_RO5Q_@HQWr)TEO#D_(jJA2KXdHASk^I)&JGYcOVZ5He`2cN)j<~qk5 zc)n+wgHMY#2eFIin}g3l9dE#&afUhgyy$ob_BqQOd{K0~2Y<#Kdv59J%XImayg2RZ5W9^;{|qm&hjZgSIOi95h>WP?E!g9nUtutw zI^KeP&iM@<##5WO*li^GcNl`FHkYy6ALtS6Fcj|twAuI&%!OYwVcoo$2fyY`&#ajP zzh+I(ta<-_&7_|9{x&l_GqUbk-nrk%xxVLl-+sO8nCqF|wO{W!W_z~x>^HJ*k9Rzh zna+rud#?BEH}b9Tx!$ec$hJM6>%IE*PGbkp_D=nJpRt4Y`3WJQL zOTUq0dpy^B^cxwr$FsddzmZ{kyuUA*>5Ry)=f1{$`ii|1{*8h${ddXk zCa`qPfO2h>Cd(8@y}%}`&(!AmfmSgf39thQCVo|->|iRF1wSlRd4Oz&+|ri zX7+oI?q|k?*S5!~w~_rV##Vhy-1q3t%zn?&{mhu~+V*J6q`4Xs*=p&TZJBJ#WLqXj zWgz|*Eqza|{d3v-99#9){{7n+a literal 0 HcmV?d00001 diff --git a/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.A.i4f4.00001.bin b/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.A.i4f4.00001.bin new file mode 100644 index 0000000000000000000000000000000000000000..3d291d4e7e95b420cb5e499095ec8c979262ffcd GIT binary patch literal 19288 zcmeI1WzZGW7KTAFuv;+^Y_VGm>~2u8yD>1Z6$87)R&2#iz`*VT4D1$L5xswI-{%?j zn(;fcmv{W;V}`l+IP=U|d%gSYcg?ro%{X(~w;TUohlbB@Cmr92&vu>0uX{{B{_}5T z|8MQ{wR?Wg-&r^E4|jOEZWmPgB2 z0jWFRncm6r=PJJTE^;V8Ec?rtcg~m2mOq-&@$FW%UB03V_mcw z>(Q^VKK&XS(66x}{Tdt5Z)9V78JnPGY>Jk#8Cu5XXf?K=pRpxc##U$|Y=@SyJz9<4^fPuq%h(YuV<)tXozZISLchkY^lR)!zsBzLYwSV4kv-{U z?1h%GH(JI%Xc_yW)!2`I#{Os-2cTsfh?a2>T8%#RGY&?}I0P-@P_&H0&}#IhpK&-^ z#t~>4N1|mMg;t{<{TfHpuW=0h8pqPFaUA_dj;EJ#0$Rq2Xc;G=Wt@ywqd)zOQ_wO_ zMawu1E#q{w8UyHOoPm~cCR)Z>Xc=dt)i{TK#<^%2=b>eskCt%(T8#_o*SLs&jf?5m zxP*R>9WjuzK@iFvj6lm6iB@A2 z{fsx!GTuVVcpEL_9kd#w>1Vu)mhm21#`|a)AE4FvkbWZ{(QD*mdX0QSuaQsb{hrTQ z*Z7=%jW6ie_>z8&ujn^2hF*=Y>DTy%evNPG*Z7WpBj3}j@dN!DKhm%96a5-L({E%f zy&AvJuQ85(jbG{4_>F!e{_f##9sWi!GrGU8xVG=_9qs7N0@n8Zy`w$rS;5-AzjsW+ zdN#1OKPmO>;JKdVIUQgQ=vda_>v@wwC$J7*&zv0Q1ncnj>?vR_unzwzspkfL^!3b+ zFb_;u)-i|YP6hLVbzKoHr-!a! z9W!|D46p!L#|)l5BP#KFx%8*$w6?YwuItY0Wc z@6)~B<Ek`GRBG=!X4A*JUKy;t@0d+5?|T)n_ReEA?|fCzH*&3q zci$blF^6mKKIYTM`(F*Lz5kd^A2YBzSet>EO)qn>23VVen9VG#3HnCX_2>c1FvAr5 zChIz~?mm6if+^9gBk%6hXKm<+W*wP#pI+<0RA|0=JI zDz!O?+4M38TZ6SZh}q1+HlT032R+O}PgsvRT*q5*pFU=xSE=JIxKAImux+X1E%+V1 z%))l1j`!eq%)<7dZ@dRRdc(%d(3zaLHg7SXK0CntXx8Q}X47X!=z?Z#-eNYrc7m>G z*6|+Pw=*n2-wc{N^JXq~fi0NBwYgI_b7o@KQkw~NGiM%lE46uWuemb|yO-K5xYr!) z0s2J#J=YxU2|e+3Z4P1{&o>8qfpxqA_vv8{_Aa$Kh?(><2m64vIf%K;!M>nxyazqZ z!G6%2Ib55!m`@*bus>MGTX3H~=HP%*$6IipUgqGyQpbDnJLcdZ&^O+L9%i8r?7|$b z%|Xnkk6Abvtj$5prjJ=T1gy2m~hN3%9>F`HgT!fI&N@gCfF6s%6)44OOhW-j`{e$3(8T&SBlGjVjO z&7HcLGY`j<+B~?|+?j=AOKle1YYvVBeIoy!YYvWwKKQye2QiQ5n}ZX;I^KZ$^e_h} zmO9>n`}8sgCzU$hgWoX+CxgE69`rB={h=>&xHbndpFZZ`6tFf2F`GW-;8d_S2Qiyo z=HN82j`!d`b8tH78}C66voHYqF^B7T3+~g$ESyp5cnj{+$1I##YI6{?>17tq0_%7W ze#b1F4f@7=(Bm99o*A|#C$7y~%%{(}unn4Zyao5^a~||Wvo>!rn_lNbFEs0T5AM4F zwxw?d&7FBO7Z*Z*=5TE;)XkikxTw_TPTkCzhl@*X?%Zqc%)%w5Hlyw}2bY3Ak$=xM z2LoXMzOKzd%;Wjy;4-i_2QiNx=HPO$HU}}2UgqEmu#WfOK67v-=o{}r4|8x8oWmTh z<1M&PA9HYZspBoUPakt|O{vX6%%+z)xE8GAJ@_4Sa2@Cy??DfjOaN2$$(x|uT% zcb3{bxYyj7g}X{^M%`-;?go7#|DJ0O?twx0x{mz2&-2Z}y`_#f;66Rf!F{DR2Qiag z=HPy?j`!eq%)tYoZ@dRR%)x_jGjq5$2Qi;M=HMZ)j0=fi0qb}R?$gICJX&gV5VPrJ79IoZcn^NZEIbbS z#(U6XINZYwr;!ua<}K#a=Lt9+%{tzK`}BDd2B2A+x0p?@r{D}U>v#|Ddm7H9ZwAes zc{3N!z=O=;+T5v|IWzHWsm-0bnKKX1mD)VG*W8(f=Syuy-D?hB0DU6=o@)+Xgkku) zHU}|}=bM9^&^O+L9%f+_Ji{EW%|Xnkk6CyVtm7@X zPam`JR;kTF%%+!FcpI$aJ@_57@DAu3??I2z@FFu@OHN#yx0p|#ci}oT>v#+9)8{=H zgl28tVm7_rhwIU-<2|_V1Gs^{88mn1&0Ks4uQ7*fbD?hL%*02fHh1b~&OCfvYV+V; zb7vMlDYY4OuQ~V>^ojg?t~vM&M&aw)9K<}HZw@{O>v#k1)59EmQEGD#GwEdxz69%d z4}QlSdvTnS*b^I^KidF$dp) zzVROPFbm(qhs@#H9K?M3n1vs}I^Kf&^f3!Rmf9S|Y~XXM;Hp6Olt z={<+HXM4|nM%LZq9qSP}_e}41ES}chZOq}h-mRaJZTEPt_v)v28Z&sdcj{;4+CAQ< z9+7F!^gjQBr?vMOb9k1X8FJ)Y}5`WYE^k7s*_eny7fg*_)m% zGZdL>i@!^DMs^qf&AYYVYtGT~jwklNM>bzu^s_Tso2}MA{94)gvvHv}?`P!nNozdECwf1|>IhvU?JFU&ng!o=Flg&&v zGubi&&A-Q=`+H>nhO|XLJ7YrpTlhz3Hs@%WiHZ5|QJbx`z1sI$laoJl&Y#)aRV{Ck*1#j literal 0 HcmV?d00001 diff --git a/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.A.i4f4.00002.bin b/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.A.i4f4.00002.bin new file mode 100644 index 0000000000000000000000000000000000000000..f8b3beb95ae2e0895b1cd94f65cb11cc842055f6 GIT binary patch literal 19288 zcmeI1Rj{2^5=N8Y5Ih8T4-(uZcyMZ-Z&MVfbElF2jM=h&HO9z9tevJFx$iah$n|fXN3P#@ zsrT0WmLJ$>{763IC-NC1$Y=aazLmd|%lHTRjDM2P_=SANzsR@pZ*m!({H_u@lgsEr zK4T2>t&B-7V=VF+W0TJqhkVAk{}V1Tq_fhYo#l>Rwg8uF%kKSiP0)1L93V) ztzt5?jLFGYbVI9{0w3m>R8O8nlXO(JH1x%b1>g#SCZ_Gon?@gjO*# zS}U`V%b1mX#%$y>W+$I92lEilxw6S(;qNGUPLsC7-bz`HbbsXY?Xp zu>xAfif9!pp;fGmmaz)?idE4nRzs`kjaIQbTE-gWE7nA-SPQLUZM2GY&@$E~U$Guq z#rkL!8=zHeh}OzR_EO^N3@Ea&?QSeisR8LPC#qrL~P@S zjI+sCoP$xh9IfICv{tSp zmvI&OjH}6KTthzNTJjm!k*~NOt>Ol>iUDX9H=P+>VxU2l?$!9!3KI1|184r=Kco?nX z5wwa&(JCH8%Xpl8#S>^1Poh-}MXPuUE#qnO70;kmJd0NG99qTmXc;e%uXquy;w7|- zm(eO-L2Knzav86Y&v>1D#v9}_-X!13TjVm{CZF*R`HXkTXS_$gmG{YId_X>982OCh z+m;;iO5eu-o2W?b@-da#N@k^cdzDe9sVXU3Hd3> zyI1q~h)Ky!MeZ-G_VRqs_BV;i$Qj2Rp6%}vlan`&IXt@)xo%(_b9jDda#MhD%+ZB? zclayV$G)CB2Ky<&IA-wNF<~k&ju||6ESMUMV+PM28>Ru{m|+~^X<-D|$G)CBE=&i; zF@xuh2h)Rb%;34>!wg^?GkEp{Fe4bp3|)z5f?vQs_VwJEn>G4-<}BbEy*+PMaE-p6 zHygM{&)JE)@LQW6@$U45_cjO2$LQ|8KXrZK-OUN}qq+AEtqG0U($87e|1B-#NK8V@uqZbwjWBm}b*-K9>0mk|wX44x>LU-n{ zZ+P84OMz?nT-_c^H*5IZ8qZ&*S;Obndj7J_8eX?{IhdB7dQji#H$AXCtcp+E>p6A( zrU!b#YH05DoHhDQ53B&a(cJ4fYxJBRSP@o7bFVM0(E}^N8sukU4tvL&u$Mkq8I1K? z%x5osunHLKgP6}=`e0Qs)(0`4{q(_VU>tA4I(^U^W@irj#(S`jK3E-$^+C*LAAPU} z7{^<%&OZ8J%_i0dF`K>g!CGLf4`Mcbur~By4*SM?u#a9?2aMw_SYsdkux=B_Td>YP zdSbmMjW(Z(@BJv+0cupeJ+KH{OGNHUw8a7jxNTBXEs3V2$T*+^pe$Ydn9G zW)1&ayD2O}Pd%vb^qU^o47SB5?)8DXe$xY+!**!y^?^0|O%H4VebC(N18el09@rAL zM{}<)tK*n9qLtU^_6@ z2Qi;M=mX0!hkfHc*he31561c}X0wkz*a3{=Em&tCeXwH_$6K(@Uix6CCe{Zrn?BeX zR$>nO#(S`jUf2bU^+L>MAN{Z^7{^<%&OUl#wJy>TyeQ;w}n2AM}GwnZv&E9_*tJ4g+I-5VP4w9~=(G z`YmR&k3Kj8jN>g>XD@wlWE01GuudNw1zRzPed9gYM=u-=#(E)UvyXl_28{JX%w``w zaV!|eTd>Yv`r^1Ij`v`l-Z&omFo%8PJ=o_2aE*7MZjTe2RnNsto_`X!>baQ5^G^oX z@V_;uz|Qp4gZfUt>48(>9DL$lAE@g$J#ZSFi{@U>S)xAH;0-(Ff;)u|9~|?4u7Z0Au|Yv)M}@TnNVT9<0*`7r{Zy zVc&QU_R$L$gK@kCYwV*RE@@)@5VP4wPh1MddLm}Cm%g|RjN?66r#CK#e#~Ltcn|iu z0$k%AsN3VpW{o#sjptw0ta>iy@%*d7HT-YwHEG~Y>jQQDrU$Nr zo6+3s18ek~9=IL`p}E&{*62Asa03iRbFVM0(E|fu2>Iig!`|^G?4=KG1Y>;=^Vv%u z+yut@Am+1|J{Snb`XJ`BpFX%5jN?sMrw<0fDa>Ktcn|i`2ZO;l-hwsu(Fa4CSRce} z_R$BofU!P^+3ckcZUy6b57y~}+u%&*uy4Ev`{;$+!8qQ6HTKaDcQkRl1?%jiC+=)w zJrT3nOJCdt#_=BfjNZ5#`ZI@p<2~5t9&pujF_%5=1=n~3)_DGX%^Lo<#`EuQ*6_cz z55PtA)Pwp?zv+Po;R$@=ULUCIH$CtWJc;IBA6TQ`^uWU~6wSRputv}6fk)seH23<_ z8a?nRJWc*`=CF6X347^-$G|w=gEjWj2ah+gK8X43r4OC}V|@_w*-sxl3C8gztkVZW z;Tq+GWso@ruz5VP4!A3O`j@gDq)K6nlWFo%8P zJ=jMtJP*ctA!f6Wes}?l<1JWcA3gD66USSy&R+WBr6!K|;Aiy4%P@#J>>KaFKCghQ zo{PEc@hZ6LxtPiGUjx_hzcrr!db5WAt$71(qo*F!clu2aya^xR6Zd*fUBBspw_q5W zdwpPye$xYQ!*DeB`oJ1Jrw87F57FG~OKbGNyYLbDyP3n@@h0r058eagcn{XtOCP-7 z#PJ@ivzI>jpo#TC%x6D+Fbs_2P52poFdQCW4*SM?u#Z0Y5RCOf%w`{b@DUitTd>YP z`rzXxj<;Z)z4XB+O&ssR&*+0s;Zf$WZ@dTl=!MU~STDqE_R$ZYgRy>y+3ceyz5wHR z3)b07Uwqlb@gA(x8(+at=CE(P2m5>tuJI1k?eR^s>baQ7^S=dGJs0zM{&(OS{U)k-V{9Q`cwS{ZHhLy?b?i=Dm*~Z>$g1z4M>Ry-ZL0 zg#SI;J9qWIV-C;uzFouf)_Ase?HYc!#`C>r*YLYF-timsv`6^dbG=_z?>1)eT<_M^ zdyN@9*L!shUt8nZ-l=Q&+8XckU3%IhJngyOr)zjw-E+N9SMM@r@LccH)w_%tJlp$p z4G&x6eGaFmJ;J}9E8$r+&y?`0y5~uFRNeC={Hgva=X0aI_^*mb{+ldkO?&3s^XzK& zKSR&#Z~VP;)%P2|%KEjJ_DA*_)!*GQ$FKiRslJQRl^@l;wTD*yo$b+URA+X~(cww` zF)EMz(OQQmJ3QIp$zMGX-^CyO4y%6E`y5^QYR>rHs=3;La}T-A@R zd|U6dt)Hv@&bFS{*3Wg!@vE1s?_zZ2+j^&M{ap2Tw)MQWey(GV4o~Wxw)&?%KG)&N Z(d)_T`)|*Dd!Ai+^v}>U`y1Py`w!`Rv9|yK literal 0 HcmV?d00001 diff --git a/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.A.i4f4.00003.bin b/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.A.i4f4.00003.bin new file mode 100644 index 0000000000000000000000000000000000000000..d5d670a492655b464970b3e77a0fe7783ce6c37c GIT binary patch literal 19288 zcmeI1Rj^)F5=N8YPH=Y(?hb+A?i$=(gF|p9xVr{-w*+_B;0`Y{*!T=HvsUGF6`bkL z6u0iB@^GnIwR?B>zrW`0Z^Ogs*<<)Wqqf#>M;V@owa1jh_kBknzW%Y-@b#OfFWZ}I z^BuX2@5yKUKtAI~@@;-1m+>d^8Gk09@fY$Leahj*9IlU$o#7@u0j1k@@fq?XZ}e8oi6Dki2@F$uMbNvUN_M!sTlY86vZtC*5n#Z=TXrY4^; z4f%{|$!APQK4W_FZDt@>F(b8#nW$CFOs!%TY8kVVub7Qm#q887=Ac$FC$)?|$2jTE&9YDi)%au`v0JMaX9?NhTE$A#Dpsaeu?n?}RmoSZMy+CX zY87ixt5}m-##-bv)+V2^4*86A$!DxbzRmjNDmI{2u_3jJji^;@Of6#*@)es>tJsWM z#pcv1wxE{LpM1rZ)GD^3R)m4TE&jkGIk=Lu`~IMUC3wb zN_x3&Z)zF)kgwR6TE%|UD)y&VaR9Z90pu$Vq*iedwTgqO zRUASs<52Pyhf%9IoLa>Z)GCgomNAfg#!=)mjwYXR4Ec;>$+tOC29d8ggIdLz)GE%RR&h49jC06WoJ+0ZJZcr^Q>(au zTE>OsGcF>ZaWVOfOUP$jO1{lyTE%tLDz2xN zF_?VC4b&=bq*iegwThdmW!yr(;#O)Ew^6IOom#~m)H3cQpK%xYjJwHa+(SO&Uh-}3 zBUf=hwTcI*RXj+o;vs4o50kHWgj&U;)G8jMRxyNH#!&JVk5j97f?CCs)GD5$mhm+C zif5=*JWH+OIcgQpQ_FaPe8!99GhQN}@iO_0SID<{m0ZSa6qU=j7XbL9Wf0 zKW z-kRS!{3bCr`QGH+Tl0IwIOHZGr4Q~3-FOdb=!I2b3FdIG z-(o&>^uuak9B;usb@asQO&o8*KDG448ciJU!QbeOH9_5Y4{EFh%QAzpo{QPkSQ}j9 z4cO!P>ojZl-yY9jw^_sg_O1tdP|xW#J+MA(hDZ9LYfc~7qu=zv2CzAG_j=AA{iX*t zge|DK*9Z3KIX$ou^rz-tU)rMwHij+9s~vAb9euC~tjZkj^+C+2mOj`NjN?7nr`fgRPo4-hzE< z>4UACINpQ5(Ffary73;=&gb8>!8qQ6eQN289hx}a zgME5qM^HE3gBm-*Cd^>0=VCTBb_Q2H7c+VOF5nvex5x8$ZPxI=J-dM()N^`G59|*6 z;gSC6n$rjN=r=vE2kcMXy`Hm2zv+QJ;Q(sx^?^NlP7mw_1E{&z2lnWJz2QLeYR8*U zM<471+cJlHeGoIMr4RN6V|^L(sihD01LJrP_Nk{2_HW{N6ZYwY13=w)4{GRx0k9Ku zxYq|UpE~;BKrq$^F`GL2;2jQiAn;tj;PN(Kx z&)K8r^uUQQh?;wSX^$Q_3CG%$`gVV^!Y9n_8YpoTse1Ou7Fy*`Nf)X@iLfU!P^+0@YoXM(Xlh}qQA2WNq? z9*x=b!P%g0yazS(!Z~mpbGVPUV4phr;oK(H4>6lMdg44V))O(CTKeLAFpl?NpWe6t z)Q$I`#)WV)GZ@D^ut$xHnl;{lJ)VDYv+B8+$MY`%*YLl+mx3PDb9zk=Tn5+TkwNI1 z(+BqGH$8AUTu0r#KCnl>>47WYdTQ?VfjxRo4_pa@skzse_UM7D;0E$)$D2?`A6yOR zFo%165HqT!53T`YeGv1hr4OzJV|@_wsizOF17m#<^XY@@LEU%{YUqQ(a3OQJkGEi- zI{M&-Ce{Zrn>za7MljX~F`HWY;3hDR_h6qsxEa)q_n?MexCJg_4)^gE>{CZS+}gzP z7VJ|;Pu$kTdLm|1OJCd$#_=Bfjo!Ee)Q$I`#+`6AGZ^c+m`#nlz%|~0J)VDevxfie z@%($5HT-Yyy`Ts6oLtA4K7B9*)Q$I`hCUbycQS|jcnkKaqYoZ$;&==8siO~`XkvX3v#F&Io&@7~5B^3U zJO%2;dr(6!JPr3ThkLyc^QogBo&n={3-+m_C!THMcnkKar7xaq;&>1KMsGY1>c)Fe z;{|w_8I1K@%%;YR;Hu|hCeMEfT*LqNc>c@H8veKE70`ovPOs^KSK%EzG8A2Ndd?pG zrUzbwcd5JA2lnVUJ@7ibN6o!Hut(47fj3|nHTU|`9zF0TyiZ>3coXXAgSX&m=5QbH z!9KP0!P`w7@4-H`^uaq#tPf&7_4L8JU>tA4-{^z)K;3u`YUqPu@B(wV*9S45I{M&! zFpjripE~;BgC>r*V4qt0;KL@4_uy~z!AGEOyazS(!pHC`bGX+FF`qj6;S(^{4>6lM zdg4$Me4i z*YLkR-+&&}b9zk=e1|`Vq3K?~S=Vdc|M%34^_q2k=H355-q^dhuFt&pAITf*L+jr8 zPvq1I|9h@?{xO=y-gnI6+1|Hnc-|h*_O4yS@Ai1U_v{*ex5qnHBYf_e-tQM^8hf`f zhv#~?uHI|R;JMzbYxvq8&-PAT!`JqBpK64sJ=6RA7ER;uvOS*beY$#=F@xuNpRV3z z%;4GHr)zlF9`93)@ULh70X^67taZs%|D`MQU3s?u zF4_56uIlZq{K%r2&C$_Z_Pg-U?^*jjwL0R55&fnsY9ssKqnfWX^3@q#@pm54ncZ{z z`u`&%``@FQuQT%186)yfSJb-a==P+(>I!dl^vrHgc6+khlfU*r_uu2U{XMGxhIB^0 zI-{fiz3b@jy65<{Cr0+aM>St(aC9cu6vGdPwJhH`ll;?*X_w}PyRnoRvzh$ bd}o|7qIZ#-Q9tBh`R>}ad#yl#NFM9yZii^Su3wk)o`m% zh4*Gs1uvJXRo~|9{`#DId-oltW=0*Q_0Q<#Id*w|K3c1Y=P1*({=H?)vYH7226V^ZohCZk?sa_WstL9ND=)N4#dy~fnkYZ$LarlnS6I_fp1r(RNRGh zUSlTe8J+PmX2#3tf|oH1UX59)XUv9|F*{yHSGUbGz;5D))wHj+t zudz1u8tYK6u`cx*>ru~GA1`AAyo?R;GB(1iu`%_GP4F@{#mne{m$4aMjm@cNY=M`t zC0@o>co|#c)#yn*V;j7TZSgX;!^_wnuaO<7)!31Gjh(31*qM5bU8vXCm3qc*cp1Cn zW$b~Mu_s=Qy{KpGjhC?xUdFz78T;YY*q?gF0eBe);$<9!mvJy&jYFts9Ez857+%KV zco|3FHF6}i8b?vD(TjSG-qdUKpKVu2WgLr_aU5R8@pv^(pq_CeUdBmy8GZ3G zPR6To3iXUr@iI=s%Qzh`;|#nSXHw5N3oqkryo_`3GS0NPH=o^c6Y#-(@}m*Hjf!>iGsdd2{}jLY#d2I6I0fmh>7>KRwzWn7JyaSdL^wRknI zqn>d+Ud9c088_l(+=SQ2&D3h#LcPYV)N9;Ey~gd-YurIS<4(McyYMpZ#>=<|ug1O9 zGw#F7xF0WL5MIUucr_lRo-r6N;~~6^A$S=Nyc+LP&v*|n<9)o0p?Db|;Qcor^7lqQqSnaA)EfDOS|guQYveO(H9n_a z;|uCFzNB8`E9#AWO|8Z^)N6c8y~cOcYkW_=ksqkl_>p>zpQzXPnR<<1s5kN}wHm)s zukkze8h=o)LHW=By<-fX(-dv36O0Md7CkD@(O@i?u4vbc4r9agMZ0Dkm;wF;?&}}- z8W(0P+Wqw0Z#bt^q&yj1^x~8ac}pX2xcidW^mt$VOCJb z4DLG#%m(V1!M!Ji*+CsMOor|Xqw`_xV_)~39OfuGW^msrU`|lS4DLH6%mwP0!M&$~ zxj`K>OpTrg#-XQu?CZYs!q3#yF@yWg2ft8P#|-W}Km1Bv9W%K10`MDkb3xnG8bglX542u-)dFq>!nPJhQJx|wqmW#n;Y-}IT)86jw zc`jabWYjgC!82W==*X(?*u!&OvS`mXX0n%OyA-HB-Zvc1!iCl`$n$q!ML_VN6? z7w!4SZ1yn&D}dSz#BBC52P=Zw9K>v9VI}Co9QKW@+h=8%pi^tl$hvFnvkFXzr;fb) zj(t{ziSX2sdDq!%HJBJr9ocu?>d=)LCc!gdOsrY7xpS?VGY@MO zZ5~`}?##m4MVkfJnuB#<9{SoR^6%c}U|mp0{$1n#=3u>|JM)Zr>|qYp2ldPlGug`= zYyj#m5OcMlH-rV5!@hAJ?9&Z40=0RI+3eFDHU@Rv1=rcf9Bfi_+y&RQfH~N-Xmb#= znS&m%7<1S+?t^{I!e*e3yWkr8n1#)Yj=SJG`YV#Je*=HM=15a(|+l0 z0=0RI+3aHu_6Bv_1=rcj9PCqc3(uI%9PA70Fo%7+f%DkMEbLcwcb+kueR{(Fpf(3F zn|-!{13+yKVm5o3g#$qy_rY~$;UL(MIqVzvp(pxaSe}fi<1VHCi^A@w&>oDk!r;hvJy2GIdGpvAT2F;$CGZ#k`Z7%f8oS8VXXmjUUGiM%-D%#w+ z*4&weUPYS)*P4UguoZpn6Zv;t90%JmhkfHd*vA|k4{CD|v)RWSoB(Qb5VP6G9GnPha}cxH%N(2p>bMWCGY5TP zXXdbP+z0!Zg_A)YcfmFGF$<>@9e2TX_Av{m7Htk97ZL*f;Kj zea?VQ$%wiq#BBCC6MEpOw}F_=K4-yZc*L`2D5NM(Pp$4n1c)9Ao|)T^6%c};380)gP6tr z&B4W>HU}|}JbMWSV-5yFZ|1OX+z0!Zg)2a94q`U@n1w4r9e2TX_Av`r z6>Sb;HhYSb;HhYPvqad&B3#vj{LjE{msF1 zMaLa*ojuIK^F^D3n8{w|-~~{dgP6-4ya+ckhkg5jz3gKSUMjjj&zQ|V=HO*e4}h4> zK7-*EP{&|+kTF4`Q#Z1yn+-+$&>$Ok)Q3_Dp?xo-u>x`3XJk z5t(*h&(mjQS>JsOO};%Nxy-(zkl`YsCntApDWI@t)H*0>)YFBWO=Xo zeKdb3o4=F%KTBI$a}f7-c%L2hy^i|1;#}MM`P#a^y?sXX_uBeB{L|Kt=;s&n#q;kz zpZ4|{S>9{w_cyY9uJ+E^{63oho^1Ymvia}H`2C1y^LJs`|9;W@KAOLi&ELu9?_~Tw z#N9sT~a^*o#3$FRR6&F`aQe;>npKRU{~_U3tbKmXso|A;b2 Q^K;gJ7ux#0jJ)UhA2Y~QD*ylh literal 0 HcmV?d00001 diff --git a/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.A.i4f8.00001.bin b/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.A.i4f8.00001.bin new file mode 100644 index 0000000000000000000000000000000000000000..2d01c9682dbf2ae420ee113be0f6142013ff26b5 GIT binary patch literal 25688 zcmeI1WzZZ%5+8Yx;`a z@1VY|TB=@cPxtI}XXg!nzMefs{5MMZ>{UL$9(hC%pFJiUvF< z|6tw7Kgl)nFLI6io7}JY59=B|oToxhay3RGUt?tQjf_IB#;D|Lj7Gl3=;UkkBHu`F zay7;vUt>)2HO3-eV{Gz`j6<%*xa4b$N501RCGf>Nzky^$~)N0I3 zK4TVY8M9K$n2lP-?9^(^LB7VE(m z%h-on#=g`t_M=u~fATdBAYbD^@-+@3U*ll%jT}NQ<4|fDf1#Ff7`2SUsns}we8!Q~ zGLE8_aWu7zW2n^_L_XtKY8l5-%Q&7|#tGDFoJc<7Bx)HaQ_DDoTE?l=YMe&C#_8m1 zoI$?EndEDnMZS@<$z_~FE#q8j8Rt>UIG|&NG;Go?49;$Y;DrE#oC> z881`Ic!gSxq2x1OrIzs;wT#!PWxPSH#+&3b-lCTAHnog*sAarMt;T!g8+o5xBOj1! zJGhn89;rh2i9lV+PNj4SphT95c*L{4+Tn@ji9JyPN~2Dr@i4x^8%vbC%fqbiaOh zmvfca`*g3Kc$agR*!y&^cR3H(C;aqW?{i-0%RblMY0TsK-syZ`?7hZ3_V8Zk2V?Ix zX0n%ey8sw_zcH8hyCB#%9JYsdyb#RH2(H6n_u0pLUbw{GbfqlbkdwBQ#U=HSR?cK+G_VNA~2V?I)X0wkDECI$k5VP4!50(UDJ&4(K zVJWb0xNeXBFfTKV&fjERhwJXM&(hF~nsNBKy{Q?8^X{|PvM>fU<8a@7%fXoB zbx`m0O)r**g_y&&URc*Tomip7I$>Ss^kKyk>w|msP8U`xu`ak*4^{^Ig#Vta2dh9o z`nnGP-RJpwuxg3*Am*`$9;^n&dJr?&OAl5DV?Btu^k5CJZ@dS4=)s!MpE+FXLCj|# zJy;8j<1M()K6J@gD545v;-t)8dJ1eT(_*voTCZ%~;=JHv4P> zeW@AiTg+y!O<{U!#_=B9w;9YpUI+C~-}GX0Sd%$i>z#F-(}^ugtP|FCP9L@`u|Bw0 z?{s0S66=C{^s!ocA3fL!jN>i1&pvvvbBW_ExX)gCuuF;KJ@_3x*cI#> z@4+6rFc3Cp4%d1R^Vvrib^~KQh}rC;3%i4{9>i?+(uF<1INpQ%bYV}hZ@dS4>;>B} z!=iZNI^Kf&?6Ws4M$I_hg8S^V5A>sEtZy-!z4nF0sTs$6aNmBg1bH3QJAKoO{b5Ju zaIF{CbxtP^D6!sI*ExMSu*CY{UcJ+WgG#Im?$v{X!9L-?=jy>BFp$2k^&sZ)d_6c6 zjN=Ws&mMa4mlDT2aG$;O;IIO%x51xI1-HYAZD|V z9vlV6dJwbOOAn3)<9HA5(}QEczVROHp$mgxf97x769B;vW_R)poN~{Ml zo4s`5crcFl;CFQ41h8+s2YZ|dhcLrBc;Z^$Vm|wv1nW{Wj{|NiPKB0ch+@IAI>PT-nm!rbm7br>!^G6 z;4H9D`0u%Ta5fC0uWLPsc|2ba&H-aRhh%c(u4EBINpQ%^x%B3Z@dS4 z=)nbWB6GNox8Oee=)r|0jV7LdT>jL;|;ja9(r(V ziS;06vX>s*2FCFo{Ei;n4)%@rU=KaG1FmEa*Lo21*+&oV1mk!M?z4{`+*M*dh}rC= z2X}*Uya&Id2ls$|<2~3z7ly!f%;8!OVm|xm!o6S|Z^3=`(S`d;tOqfhy>#JzFpl@& zcXZ(auy4Evdprm?GsDq%;#%KgKKncb$51nlx8OeeJPd=V8S7ijX0J!!SZc=c9^CgR z97kRU^-kaP;xV{`Ib7?Vb)D0R$4jht)^$!Fo+zrY@40&L zGz_7yYdwg0JYNr<0poZB?z4v;JX>Nth?(rA2hV|Vya&Id2hW3j<2~3z4_<%=nZvan z#C-PAgBQU#-h%t=qX#dQSPx=0d+EW;U>xtk@94oRVBdHT_Rxi)@ECKr)`OVOKDzKK z7{^<1pM7-UwG!(=%w{iLcpZ%6J@_46cmwPk@4+5#!qd!fF`l^Ax0ug9Z^0$hjN>i1 z&pvO%U~0zt7PHyw9k`U5al8ljy$hF-*FnA0H@$cdUSJN_dSPAXbmILI>z#F-(}xdA ztPk$hJ6-s(F;J@^Rh6aIUy9()W#>FZh#Vjj=egHOOX-hlh;p$DIqSPx<*d+EVv zU>xtk@94qjVBdHT_Rxbb;7#Umtp_omee~cO%x526_zsNYEx6Apl7z4!g&*y+c34VfT1{_6UDH^KbNfnL9NO zZ{6d$uaNgMoOO@q4khnr`05_dewDnR;j4RIBRAr|KK)004uAN6e|Fb>zjvQ}pbuk(9!?H#nsJ-0e% z$B(Z0(d_TnUG_ISN2`9d%lA6JN7vp#yWDfDb9Vgbnjg*ne%)n%vvaiSSG#<#^Lupd z9kk0mw>oFXkFNRA?C;lI_BT66tA4f1_d35v*WN+9+;gjQcKqm?AI<)L-DQ8XbF}JL zyL_+ndvxs`w97rWI%mg^uKCgI@7G=SH#fG-3yLA4YzkQ$G?S6j$JpTo3;89Tk literal 0 HcmV?d00001 diff --git a/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.A.i4f8.00002.bin b/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.A.i4f8.00002.bin new file mode 100644 index 0000000000000000000000000000000000000000..907a202b1a10a879b88187d67696a06f1bbe3c15 GIT binary patch literal 25688 zcmeI21Q>2k>c(}ibHWI?ykk%wMcRI;trclcCp=Mcb_N! znS|b)f!^+>>EB+GCuhES=boAWJMXz6Tsn4W`)ACuj$78R$7l;;?J!N-bN8{^*1vab zTYu=3KU?#Ae&o5vPvmR-Ouoi1@yRtZ0l7vdB-hA9@(K2R2 z%jk-hF*8~tvyiJXEBP9;k*_g3`5JSOuQ4b2jJeP<=0?ky2Q6b>v>Nk~&zK)AV*#{` zZfF?`qSaW4e8$3P8H=E0EQ*$~7+Q_R$!9Eqma!yS#!_e*OQSWi47nQ1lCQBG`5McU zudxF88r{iftcaGe5?V$Nw2YO}YOF#&qbFL%s%RO#&@xs-tFb!yj5W|Q)NM>&sY~NV?DHt_0cjmKxh8rzf4*a0nLN3@JSXc;@9)!3PQ#x7_XyP{?6hL*8AS|fXq ztFb5f8heqiu{Ze|`;f1(FZqo9&@%Q%%Qyfn<3O|;2a(S>7%k%vw2Z!J8Hb|PIE;M8 z;b<90pk?$!%QzCP#!=)mjz-Hk1})=Qw2b4>8abX^jT6Y%IFWpf{^V<%M83w!#sz3KE+n6E5n9H@ zXc?EFWn7BZ$YtbeTu#2m736DNNxsHa@w(P}(FKI2KWjHl2t2BBpkjl4y!#@pm;yhFamyX0%U zN4}Bw$<_FPe2ovu*BC;+#z*8E`IuadPsrE!lzffP$k+Isd?R0wtMMiI8efsG@iqAx z-;n=3-}2nZcjOxRo?Ih8kZZ)>J^Zc1-y+m;;iOEkz-e)y`>+m;; zNyv95@3We}b@-daq~xb2@3We}M@&Yp3%S3r+ROdj+utN6CubaUxVOJcOhMi_=5X&0 zQ?m|;TVuJ9Y!$G+}6 zb6KOmd(Hx`(cArI1=r~7ezSpV^qifz6Th|T5zkIfcy4pR{EY6i=cleOJi9qz0W_aI zLu>Sg=QkI0L-W~lv__A3hI7M$Xg+(E)_9Kdz(VB5VGetTXYJ*A&I`ujS!?X&na)?@ z@U3cg$ul&wCLt_RM28&wNpsj5+KZzP68NzZe*M{xO?<^uXd^tPf%~`{;!wz*s-T zZ1&O>>FOU&(h!;K3BKLGGz^)TjT!AmNk5Ct@|%m*6_Nu%foc^ z)Pwp?zv+P$peH`@Sq!&sn42^uUVH3(aReXN{iI11rI5Xg=#pYxF=5 zSe<-V=CF6%347^-mBCoQ#eDYC2djXwK8X43r4M?7u|A0T?57V_1>?9A*6D*@FgtVD zH|~Rd^ucOitPf%~`{;w!!8q=Mb@tH*Ym`_Y#BBD`2Wx_{K8V@$!CEj6bJ#cTgMIYE z+F%@a!5aJMhjmIEcfmUQ=!tbp9CyLb*h^omS7Ln`v+0fXp&N79H|~RdHUL*W7jxNT zLvW2dV2%54RMzmnHSWK0S;POCSO&-y@Jzv+R^U|Tew^?^0| zO%H4iz0rKu2iE90J+K9Ahvu`sv_=nX3EPujiaG2Zcfwx!U@I`z2lleYUix6`632b8 z&R+Upn-c4Tn9qLtU|TTO2Qi;M=ncy=hkfHd*he312gdp>X0wkz*dC1IE?8$DeXv7` z<1ScdFMY6MiS+Gd3 zb}ez-2S1}Xc7tBbVc)n9_Sqd=^<2zlk3GOu&&5pczbCkc|E+QVy~-N?w`Olxi=KK= z-|06!un!!JPkhz~>iSI&>-0fC*pfNy8~4FJdf`Yg z)(bJ4ee}aoV5}cvHv8y_qro`tf_3)N7sr%1?t^uD<5=j;9QKX-V4vf_HSU4BJ&rG{ zo{O2>{{(Q=b1{$mp9rque{1?fAA0IReW%~_z)5f>KJi%}sOvX9a59{Q=Chu&M!)HS zQ(yp^&w9=pJ*Njwg|pFo)(6(;fz#j|^1CsIz2i>UOCOvL#`+-UvzInZv$uAMA4}xW+wDx5s5=jXPkC`(IvGJs0!1{}tdG{tYB z8vE#nJ4+mQ!8-fsiMvXyCt@~x>5IF;IPQa=(Hr-`0Oqi7+z0#I3$A)D=Ca3q;2L+p z8u!1ytl@ua-2Z{HhX1X75YDHk9@KaGO%FT-PvR4w^?|y6(*qB~Q)oWx18ek~9(V)> zq4}&2tkH9N;8A!Q&1ZdSjUIRmo*{n;bJ#oXguV2^<6s>3!5Vw%gC|O?4`M!h>4PW1 zSRcfE_R|MXfpOdk>-51OxRN>S8~4FJ`rv6Wj=Nxuee}UIC62pboqhDdvnAFCF`K>g z!E<07_rcHTgTZhebJ#cTgMIYE^I)tOVmABehZn#&?t*pp(GxG0IPQXV_R<$Gl{oH$ zpV1pH!$9V+Z`=p_yaKLzF6OewtKh2VVkY;04P3+j*0}%cWexvZ^9I~bPd%vb^qU@d z6F$HvKI=Jk{iX-rf)CMr)(6(;H$Ct+3_9_Fxj z+zET>gZIEV?t?Y<(g*LCIPQaW_R1^AA)h*2|uF`hQNc&Vc)n9_R$9) zfw4Y_+3ceaJ_h5s3)b03AAC~cxC_?VOCNk%;aR<389&FMJNhdLd@B zkAC<9jP*mzW*ys=(W*Jqyn&*Y6gdv$&0 zx&K1mSRbl;=D(7AnV$9u|GT$m?&^8R9PaITyN2hjac|GsHT-Uk`+Lr=;dg61<2UGO zkMOzsdcLlnZOq`lo~^6r8Z)@B=js~1w#L0ZQ`hjdHJ<0Y^t4BK+I>Aw*YL8s`+A

WB9| zwU^H|d!Fs(?;74YTkoUwJ=yx6H|-Rj$mpNDtOX3ukY`?QzOwcf|j{~pnLAFc06-$2~oKU+stzl^GXSDa_F ze_ylp!`r95e6ICATHlkc@5$DGhlua1SXvBg-7k`fyn5hxP9p@pbp9G literal 0 HcmV?d00001 diff --git a/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.A.i4f8.00003.bin b/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.A.i4f8.00003.bin new file mode 100644 index 0000000000000000000000000000000000000000..a6e3bd96674d91ac385913b30bb1f791385dfac0 GIT binary patch literal 25688 zcmeI1Ww4x85{8oyTtaYn4ekyR++7pg-GW1q;1JwhgS%UTyK8WVKfBoaF1!0Yb-%76 zU!AVX%q^%psY%sSr%!j!dHc?JPvysS@7D3JXSGgHt>2H+5yaYU`i_0y@jBK&_vl!^ ztNKcNb9H_oSK>$VC4M4b;%D-8ej!)lFXT)7m3)c6kuULg@^$_}uEamdm-rX?68|P& z;y>i;{7SCGf615lANdm9yt@M3$<^sWuFg2*>hvU6XIyf1#v}Jz#%G@~0kwC#D?TcY(&1!#^f?Kp_Z{JwT#WEWo%BZ z#1`Z;wxpJ^6}615sby?Kt;9g`8H1>0Y)dU;J8Bu*Q!B9p`HUT@W$Z*PV`pj^yHG2! zEBO+;kuR}3`4W4OFR>^2I(w1J*qd6$KGZVyrIxWDwG#W2&p3cu#(~r_4x*NEFtrkc z$!8owE#pvX8HZ8JIGkFEBgkhQNiE|jY8gjU%Q%Kwi6P`m9812$apX%JPrk$n4R<4kHLhLO)Wi(1Cn)H2SYmT@k%66cZ6 zIG!@X1Pc7pHY8f|DD>0mW#!b{RZl;!T3$=_}sg<~me8%n6GVY+3aVNEmyQr18n|z6T z$d|a6e2M$Wm$;vNod?KeJV-6$A!->9Q_FaST8T%=XFNtN<8f*kPf*JkL9N6{@)=K3 z%Xo@f#?#a?o}pIaS@IdrQOkIqTE+|1GG3%s;wADWUM64S74jusC12t-@^xM(SKq?9dae!C12t_@+ICUU*ZGubw-gZ@geyVACWKdG5HdokgxM8xe}j| zFY!6~5?_!n@g?~>Uy-ZxHMu(9kgM}8xjNsG`z`+N;qM&&9x*<($-4790hqJqZyo+7 zF#)w+$K;@#;7?`<}i zm%Hm-<-9+8^o4gfJIqJjy?5y6^oI902h2~+z4vI39`O$6gg(^Vdzbcjk8{BSB3*jCZ~;s2jdk!@FMuX5$?9;cNTU z(F2QCad_K4b@akwRjeOkHnsG`;$W;VVm7_81gINcS7S+-n;DG5=k}JZhmjykj=k%H$SPuH)kv`~}({uLdH$AXC^rP-x&)K8j^uP+xpPGAp zV2_^D11rJ+YVP%=J$hgzSe3lm@g~&K2P?xO%;8?Y#f)m{gH^yd-h+K=>4UyitPf&7 z_4GkMFpf9jXY@gTP&eL#8v0-WEXf@1^;^uRjy_lwjN>iXr;a{Yt%~(Q%%+w;SRIV@ zLCmHP)&Ols#u^z0<490pcW>aH*aE&)$kLPbtt>J%rJb%M#4gcG_5$HiZr`Pnr#;_G08Gx=i zePEA%(*v8p*3{kWIeYY*9@rGNq2^v6*rVt4z-BOzntOd|j~>_@29Z}g-h?{(U<+82 zIo#`mm{Bc#uq7DBd$3O}eXvy(>w}n2J$80&+WPakXp>c)FeLmv!;^_auGK8X3$ z(FcRTINpMN>ga=Qt2o|*eQN20?W#E5gP+j{+k?9C9@NkaJHW=w;a)GqeCp_j9l=5HAKINpPOdSe$*H{OF9yTTUCV65k2HZ^twS3MUqdH(L;8veJ( z^Y^IM@V`BKf*#a!dQA`P1qb4hf#{mk2lnVUJ+L<%MBTlfvq!(_fqmd$YVP%cJ$g<>FIhkJbxGpeNz4gh0)8S|;74-N$5cn|ierwDG>4Sqo-FOdb=!3zqD|5Kl2Qi;I`rr^S)(0`0I{M&HFpjripIZ9huquxCV4prX z9Mp~XpoU&J0`_7K_j)1bQ%64>3C8*%W>ZH`90kVuEoM_oUmOj_@gD5c8^?gU@gCF| z0{b(Aal8Y2)Ht?U^<2#4`Nx5)o{M=r|9Ef>|J!o{=s`WF*YvhAS{J^D=#oCIf5bFb&@(Q|s>WEe)xy}qz*vvQZ2I6_P&eL#8hYV87|I;(<1N^yj(#}5iuFUxrjDMt z0F3oS%%+yUxDbrvJ=mu=E&_GqJ*aUpoXQNw@eb@!}0$y5{tOJ^D=#TnRT&cdrlZ(QkU-D!7rFdwpP!p3?(Y!*FWu z^`$*};2OAzyxQ?5)X@jm!g%mwb#C+=MgB!qDAH;n6 z;6_k4-h&$YU^raN9PZ;S*r$#@xT%WuLCmI(KDZf-^+C+0mOi)zjN?7nrw?ugb>ls# zp%-q0E11K5yaoHz(GRy*al8fl)X@`nRI#3j+0@b(cY<-e2S1}X?gDk=J*aUvT+0l` zdM;*D;~sF0H(-zF-&?KWe|tRtzG@Bs+j~FgK|QC}^uPn~I35{}t~q^RkABkw55g1F z-RlE;^qU@d2u4tIuMh0eb9&%m7)i~&KCnj*JOWRWS3BN>I{M&IxQ#j7$9u3(Eq(A< z73+hTPc41$I2h}Lm`^=@@B|pgo3KwGi~x1xJ*c4%M#A09;XdAied_3gC#yK#f_>`f zgQu!kAH-~G>4T@iINpPw(Ff0fy73;=&gb8*t2o|* zeQN287pgekgP+kGFM_)99@KaV9%Tk&Jr}d7@iMsTxtPiGUjf(fzdfG+YPE*{?RgFK zpq|rfdf;_<508vQ*PNcSN5AQTH{gBh?)8B^`b`hK2_H~%uMh0eb9&${7)8y!zO+XV zybT|cS3BN>I{M%pc$PWb$9u3(Eq(BA6~}w9Pc41$UKQ(um`^=@@IDyFoA5LG-~&)M z-h&$YU=+N>9Paf&%%_e%_z;ZaE!d}yKKQ7L<1N^ymOl8nisL=_8GY~xs2lG=4ZZLw zyv`i%^+L?2j(+$IjP*mzrjDNY9E{^F*r%4h_@avAJ=mu=z65pSJ*e>&yu%E}@eb@! z<1F6Qz4Z^1SEZ_jt22lbp@(*r-?k5Op4*KgMKn)m-BHDkSIU7vaP zKan@~?yc)H@BL@;#`@5@cm4}Gb;AFi>z#j!rm^=Ovv{`m?HZo9$Fsd_*YLYNp6@-o zhTrY+j@1aCd#3mM6`IE0ZOq}h-mRI7p;c3tGKEFrP zIJ|6+=X#&6-et_-x!$L%cNsHyw)g289=6B(R3rTBnSVmhH9TwGGbOxg-SZ?oYTffB z{As=8-*kOD)*nZV+1jf8tvYwy%b3nTrhSc`+tvEpf9L4$bxgmHKe}&B^}=7Vj;)^? zTmP_ryIQrs(Yf3AKKi?9e;@7d!*3vbkga3uJ8SgsYSsQm z=MEo?t)ClP|E^~5t^IwB{{KMx`{>;F(dhTrRr(v9quKY?DxYhAADw##t#Z%J&e`@y z=ls#=_t#bW8=a$Bf3?cz+TTa#-a)I}bF*`{{n0spH2VE@mHtNOXx3k?^11f+(Ybff zD)-#%oNa$}&L53_e_f@&(K(v+SF3!k{e5)q9kj|lH#=wBAD#0@qu*aw>2Gw7X8qMF zpKE^~oqGqZa?j1q+4e{0{L$$5*H!wv${fG9Z`*(8=>Gn_zwh7s{Pum0exGCdef)8K F{|Du~V}$?! literal 0 HcmV?d00001 diff --git a/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.A.i8f4.00000.bin b/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.A.i8f4.00000.bin new file mode 100644 index 0000000000000000000000000000000000000000..f7a9a57cebdc949bcabe31f7fc61bebe1affd03b GIT binary patch literal 32088 zcmeI(WwfAW*~Rf;#6YD?Y(S;Nz`&LP#K6Enr9=<|1C#K2YtB*ehLKqUrj z#XtqI0YwozsQ1hJF4p{ivfhz1=ecJM^5wV|YoB{Rdtc|;_ndowbESDp{&$mbyWNuWf*U0WuKNGSc}t&{`uy+XO8qn&&QCWRw(h*yP`=slhW*~z&~;438#i|< z`gfU%t2BQq-ZcGec(Zg<@#g8L;;QMV;%e!q;_B&V!!^=P#WmAU#apDGinmNZ6>pV( zHoSGZsd$_8Q}MRxr{Y@ar($)amS)7;H+L%DA^lXmWBRFhr}R_t&grM(UDA)@+WAIt zoqVIXZoW~xYrd&?xAdcU_k5$cUcOOWKi?>BkZ&q(n0^#D$~TJl$Tx}`=NrX)=9`N5 zN-gmu@QFKmAmEK>De;Y5J-7!1Pn`LFq^F!TCnkQGv6rgoNpALm2WEUl719-%{PkA z&Nqs?(vRZD^Nr#s@{Qt2`9|@R`DVjU zrJIVMPCpetlYT0moPH{PHvLrmT>4S`e7;fqLcUQvCEqB1G2c}DQup%NI!~;^Nr$}`9|@qe53f4d{gnO=|}Nv`9|^U`9|>@`9|@Z`DVj!rJIW1 zPCpgDlYT0moqj5QH~m!nUiwk|e!fxsLB3HuC*LUkFyB=CQTkE*alTPJH{U3pmv0n* zl5Z-WpMDg7nr{?;mTwe)o^KR?k#8#gGW{t2D&HvnI^QT>kZ%+(%r_HW)c4u&H|b`> z-=>=lFHScb{x02Y`1^EI@sjjY@ek>z;-%@Q;vdt`hJQ*o75|)mD*h$?RQzlDsra|_ zv*F*4^?VR*X`PdC3G zZWP`=#M9p({>I@QLOlJ-@iz(Y7~<(yiN90$KcRg)&a>A|BkmmH?Z;=oo29!;h_@%d zJ#U_F?GSHYetWN)Zk-S>C;w`FUpM^UP#$~RclEyCHN@MO&%SGff=Xv_VyS#57@Y(+T{}a(0-sSz$-sc1J;k{G)o3nO0@AN^P@!qQ(=E>o`J~$uVyOqa0xxCwl zOSQ4j^&caJAPO`y!R}RIr4bV56_49uGd~_o;=?5Bl?c_zU47b zF7JD@e0cBN{g~&SFGzo4mM*uiJgdtIy<;=TYfboxkJiO{cO&;^)dThQm^5ONQ`!R3p^y_yIYv$8~dPC3Yi^t`|>kB?Trzakt9~C*<@T7crePDlc?5_`=oDaWtXF1H1LmxaP z9e$n8@|Y)=K6q+6{JNdpi+Ky;w+%PxKIGL0a>=uK`lp3>eISoH@@$d*=^jU>=o<7(<{ifZAy!t>cdGx{#`SAKc9&_Z;3p?h+>jQbr zlSeP?ln<{Dr`SALJPtWOz z=cdQ&34T4NAD)*UuOImJonCl;dc0oX*9W_&+p4_s=mY!PTOYh2A6_5W-yHkvgBRw* z>jOE=lS3c8C?8%Q$YY*d`ryU+@cO{Ln5Pf+NWXRWA+J7=OCEjjl6-i5Adfln=!2K$ z!|MZi%#%kSyeuDHAIM{#T>4O-H&^W@nz{k|byAIM{#TzcW<`SAL{{g|g0_DjEQ_aU#IlWUiBuLw7*NAUVh z9&_Y*WxfUZ@cK<2^W=F|zRmOD^_x8A$@S`dTjay*OZQ{m{^_^x9=6P<2la-Y(-*JF zhu0T;dQMNgHa%WX@asAK@VfMP{lKs9^uogQc)h@{4-QDTb9v>_2lltOJ~%KRULV-s z9Q*5o*XP6Q13Ao-Lm#{$A6_5GW1d|4;Enn4`oO)IrwjQbrlSd!CB_CcN$YY*d`rzPvczxi0%+m*lq~E>!kXIkbC68V>G#_3c z$YYK?df~8qczqy`dGhFm!}H|iQAIM>z9Qxpc`SAK+;ZpPD(gz>vJ6<2S7xVPNQR(;ZKIGL0 za>=6)7Uje119{AmM;{!W53dj0k9qRwgJbgH^?^L*$)yiIoDZ)L+>d$s;MnvBbRY8S z1G(hU3&-Wd>jQbrkw-5apAWAOLQ4ygrb}Jh}A3NAltIf%`E}FPxbEpzcFn zJtvnuA5FjK{3So&^_x8A$n&v$d*#FHH+jsH=i~YI&WG1;@|Y*rC-Uu+53euXk9jAh zKcsuuH=iEV8+uM(d@>(iU-0QUJ@KjZcs;?d=k&v;)8iK|<=1z5;WK^5AFz~PADkS2 zM0w>oFy8+5UKIb?5U&sHZ;t(sPXDjU>= zo<2A&{rkEPdG*1fzRRN*PG5@G2lALBk6t(jQbrlS?n0nGdfI z+>d#B;jHvWbszHTIl1KdO8SH6FZltl-{dhzp0DORBp+VC$zz^8U(0uBKD>UD$2_^d zp6{@Hczx-9%=aY*Ax7DPCtA*JzhWX>pQ*h zo%DFUz^@O^PIqE?<*9YIrht~&km?wum_-)Yo;-{D{^Jm@59BdV zt~1l08{+kW`!VmVbmxU9cOUZV1G(hU3qQ$+*9Y>LvpAhzIKMMqAIM{#JbK}$`SAKc z9`oeV3qQ+;*9Y#$JiYMq^rv(m^6ELcj{26 zryqWk9^5_Hm+gl&}E+1YW*xwxc>x19t!|MY%%#%YO zT#^s359BdVE`9Kae0Y7}Ud+=6m!|(l_aU!7kV_tY@W*_3eISoH^5}y<<-_X(dCZeX zAN)BVULVL~o?QCiFZuBL!2Ot~5B{3|?CwKeeIS=Sdf{*R@cKX=bL7zrf6s?s+*uy; zr5FC04zCZ~k9ilQ`&W2Q_aU#IlS`h<(w|z7;Psn4=E!q-zSHvI z^_x8A$#X@%)AQl=n>^-Skp9Z>jC^=~>3+<+D*bug!{U4w#_NrXI_nE(JwdPE^ngvzK@7?0wsh-+tb=vv+MzbL{C|JA2ReHOJoG zv$Jk~JGHMl_V!Mly-&H#@jfpu zrySm;z3uCLI(v`y<+rbQ>Fgca*BtwLkIvqoea*4Acj)Zh$!(7JcWF80&?EM?@454r zJVa-`VPAgxo|oQPU)a|i`~D=ov!1Z8Irct3z4Hb2gxu!*wR}HKKX2aR1@q=DJmZ@G zmOfwo?Z3gz^m|qme{C67)a;q&%>B-5{;saRBmZ63_cGJJ$85iUd3`hGS>Ace>zmu- zzxOvb(_PQRFYmwU^7`iXxaMzRdGByV`)2w#xxV-no$u;-%bGb;&SiP7i*Iv#T=O<& zx{K?Jzb^j0mo;;yoXhfD7vJXgnERW&`tRzx_}g0EnR9=WbAOX_f0Nhz4Y-TteNQXe zH`DvPzW5cL&wY>PncL$(|7K^p!xep3GyR_Hi(k?C=Kd!C^KWZecRbU-`?5SM^4qoj V{{IHItPI!o`$zRFV#eI>{69h9seJ$d literal 0 HcmV?d00001 diff --git a/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.A.i8f4.00001.bin b/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.A.i8f4.00001.bin new file mode 100644 index 0000000000000000000000000000000000000000..489829cf9c118de2a081caab7274a818cec4721a GIT binary patch literal 32088 zcmeI(chvv&{KxTcN=js8l-(dBBfCXLMm81MWK)rmkr5hXWMo7tGBPrvWoKkWDzeFl zgy!#`-~Jt^`|XeKIbA-l*Y|uor{i}y$9Z%;-;c+$*W=aoy8m~rvEtJIt&^^mp1bCy z|3Fu4bm`CAuYIZhN4`te_~$?KEv5h2o<;g!`4;Ja=Ub%zlW!^g-@cFPitb@l*T_Gr zSIR%CYvy01Yvmi&E9W28weyeaRq~JOI{6pry7@-+s`*ECz5Jtkwfv)c_56!;{d}W( zjr^l}&HST!t^A{U?fi>$gM6cUo&2ME-Tb3^z5Jtk{rrn`!+f*4QMp;YLAhDIVYyko zQMpmQasFAoNx50QX}MXwS-Dx=xZJ32l7Ch=EjO#1m7CR@mz&jFlpEE}^Uvxn%gySo z%FXJn%gyR-%8lw4`A7A(`A7A3`A7Bk`A78*`4{Py`DXQw>w3H>>w7H>%s`pVfPno7H=lo7MZ2 zo7MZ48`T~1kLvyMkLvyNkLm;RkLm;SFVY?J&FX{7&FX{8&FVwS&FVwTjq1bl&+5a= z&FUk{&FUk|&FZ7djp|PMXLaXtv${*US$%Z5S$#~oQQbBFtUk8ftUj*XtUkWntUjUK zs6H|Os6HwGs6ILWs6HkCs6I9SBHbI=)w>Wj+F>WjPyOv>fZTB z^`-eo^=0`-_2v0T^%eOS=|1^p^_Asj^;P9&_0{EO^)=;2b>IB6`r2}{`nqzn`ucLS zx?j0b-9P`V9#C#p4=gvUZzwmbZ!9;e2j!pDH!HY;EqTH+=S#DN8SZ-E7RBlv{%0H_gE;p+mDL1PhEjOzlD>te~=O5LN=O5Ki=+%H>=+*H>=+(H>=+-H>#)RpVc3fo7Eqdo7L0G&FYWJjq2(7XZ4J7vwCK^ zS^aUjS^Y`5Q9UdFtp2pztp2Rrtp2>*tp1|hsQxnlBK=jqMf&S}i}W}77U^&EEv0Ao zeN=y!e^h^;e^mdFe^mdNf03S(Z&d%3e^mdRe^k%SKdOJpzevx^H>!WlKdOJrKdOJv zKdR^FU!)i08`TT*kLpGFNA=?Tqk2jHMe6T8{9T8?qu8LlzccZj-`{tv$akI8oZsJf ztkL)Drsn+qzT--Lzg}w2zh?96r_SqK&a+nEH%!;(|qF=aqNftLDE+YVN%9&bwZ|o2KT@ zEAQM_%XhQXTwnRC_kH73ALn(>_4~d_xJS3+`R7_*6;i)UHT8cJFmR+-m=^U`OTeI-g$48|HAy{&MWWS zx6Xf2esg{0Zu-!=c{-G}eqvp)9e<2~Q4yt#L+kA3=h*LN>x?tSZH zpI+YgR^`mSbN6GPcfNIgeZ6;m^ziPt$-hPS;k$RQkA3=h|J#-~_x|;?9=C7<<}`^j%)hZr_a61 zty|6<-}JFhultm{YB_V9bU*gpH~)J1aS%7~4KH@cf7kBAcf63tIh?p(Idhzl$2oks ze|~d(kjFb*ctC!0T#(0u2jg9nc& zXO0K@*ryjBJhGfQ9=IR-@ZeGT^~D2y^uUFk^6$`n_>Kqq*ryLJ>|EX)5A?B5A6(d_ zoH-uoW1n8Q@aS^pc;J5Q!-dD>*B9UP(PP(qJ9ZB@izmM0n?CmG^VsqmmovvVeeBcc zapg8CXO3_B*r(Uy%WYcD953CEeNV{0S$-VE4Sd6kC+2@x_u)HU$m1MNJgJ;HPRQdN zK0G4OK(?YwxfTmGHu>pLDezkSY+2Tv<+jt6?!rw1N9 zy_`87=wqK=c<_vJ=6K**nRkp2m08j4=(Ic-W(6~u}>dd z*t48D9_VAAUbyi5a^`s8e(b}A7v$F$-}KRAuY9|84_n0(-|GPs;+mtiMH+}5W>&4}^EoY9G?#I5D&uzrf%~x!5BAHiFCOTl2QKWNfA8+YcRbL?K7DZEfb!;eppSj} z;KG6B%<(`U`}D$vHIdgo| z$3A`DTyCdw=J=+MeR{p6+|K39@zVX+_tyNo)X_#lsWxbTkr=C~k_2k*?M4<0zT^WwoF`S-7{?|9(+_BlTuysNx99_V48 z9(eHXa^`rTk9~UK!F$S?!!TZXa4OLFFK3Pi`q-xz9voKA91q-&eR%MJ{QBa7K6>E7;rS2lK77XmeeBZ*7mg@zjtBbK zrw=Y1SZ^6QIl`si^~zC*f)=f)G?@l7B5^!af4=anU zjuY}YhYz2~Z;lW0c!vw0%x{hh@_6v6eEQ&lb2~2{9Fza>`udIs&TpUdG$LH4<5A@Lk7f#53bob#q9_VAAKDcmVd2>9_ z$3A^<;iPirc%YAcdf~zs%bDYW`>_ufzLZ~IeA7pdFXua^dw6|3@g3jvu}`0`l;5wM zIlk#*pFUqLw|_ZveACB1y}nlNfO6(|>3;0{dj13R;~;L}8(y58|Jd%scf63tIh^=L zIdhzl$2olXW`1*gkjFb*_*Q;%T#(0uZ|Bno51iY1@!*vFC)C$>JaB&doF5OqQ{Eg8 z^srA4Jos)ob3D+;KE3eZd*#gWz`fXq2j9=HFCOTl2OgZ7|I6Kn?|7h(efr?R56YY4 zfj;)>g9kq>XO0K@*ryjBoL0^p58RJ^c<`hA`r?5;df>w8`A_aXe8&TQ?9&Gq&M0q= z2m08j4=$Wp&KwW)u}?2t_;ERNJa9ku;lfYy>x*yt=y6uQQ@V%4;)(D0rjLF4{IvWB z%9-PvKKAMJvvP-*Gsic5?9=P#<&G$4j+gGozF*`&GCvOD2EO6NFY}+;efW+S@;HYR zzba>r6Y@BR55LZDjt}y9hYP>SZ;lJ{c<|eN`rv_cJ1-ubo&WUu`i=+AZ=dty!SBkO z468oFK3Pi`q-xz9{i!4IUcwd`|#k8`SryEee}SCbMl|nefW+C`q-xr9{j1i zIUeX^pFVi-=W^zFppSie;la7(%<;he*oOyy$*(US=%WWNoR|NX-G}dZppSj};KE2m08j7cTt0oH-u2ANz3O{QUajn?8D6knim7;kbC>JHF{-pFS6s zKfatfzUgD1J{Ofcp`1Cs>0_T>7neJ+oH<^)ANwxJe^P!N#0`AIi*vdMbDWUFH+=9j zF38~;9{3pt{KYPde+T$JT;r%+Vb9%oQ)YII%bzXa%*Sqzz_v*a%IIs8WXYbT`?Qw4J)X(0h z-u8H(dU%)4>zv-_ztz*+dvsoVoY%Ybvv=sc_BgNi=x6WGdF^p-@6gZQo!<6%e|q4D z^E&6h*YC96sX1;quRYHDqx^ox3+J`Rc~8&pXPj_edz|}>{C>t8z3n+O--;Dq+kVB0 z*L-#5|F6#3W$pUMzwh##U!J>{I{Wg!bLHP5zf-H@UY6Ri)PIXb|L#@IEuUlM|HfDJ z`&jCHt7E>@j#d5LTGib0IhKDXFE8FL|4y#_yY;VnA4@T0bp^6EuUlgck&;p9PB-{-^sKEAyxEV<(UuA8o$ zUb@m1|AQ{M`4!Jwu5yL`#|l^IWh-9&Gv7k`r}m8MpYxCEU-FOY<@rbTulX0#|I9b4 z|CN7K|2zMv{w@Eg{!jkJ^nde>>XLpxqq;)=QC%_rsIHWMF+!vo7J_;jp{o2XZ7agX7v{3W_8_ivwF*Nqk60SvwG`tvwE9yv$|fnS-ow! z#q@UhM)mgjNA(W*M|J)Dqk6~uqk53SQtZr0p zRyQs;tDBS?)lKuy>fOuD>OIQM>SpC;^`7NM^HYGJ z>izSN>I3qR>K6G&^?~_Eb<6y-`k->N`rvZ2x>dPZeMq@ceQ5q!-MZYYZc}bnw=FlT z+m##D?eov-!^+L-!^_R;4&`R`5#>hpk@;u!QRQa!(dA}!$8xj!m~xBhWAlybnBs=W?_9lyal`)cmu$OSxIywcM=kR&G{zFE^@t z$77KdY}UH>(Ggo7LBrTTEY+-z~o7K0L8`ZbvpVdRl&FW$0X7%uLvwB3iQ9UyMtiHY6tiGe% ztR7WvR^M4}RNs|IvmW^~C(M`iXM0`pI&$dQ!Pr z{ZzS8{dE3W{Y<%8{cO2eJ-OVhey-eN`uTjL`i1{c`?U{Ytr6 zJ+<7do>p#Fzgliozm|ViPcJvCXOx@OGt15DS>;Cc?EJI(^>VZNjdHVkPPtkAX1P)Q zR{mN2cDY&oPPth1FvAQ-AN_?>hW_#0|@@amAmFEb*S- z-*xyqi5ul#Gr#w8{;tE{N!&R9TKT<~^LHKoPU0r{*Us;~oWGA)J>NR{{;g-doZq?q zoy1M^nLD?fbNhRVo8>omZh7Zkl5dUF+_~kQe}#N&rsn#}uh{#w(tl6&ac<{bsrPHA z=FThUyesEhCpC9odFQ=OzMH4!&MWWStK_>yYOb&Rs=Z$~y*$;&xt;gAy}xB@?!0o& zd%b+OO3j^D-g&Q|@7Afg^U6E-4f5S4HP=^uwcf9n{w>wVxt;g6z4z>#{LXp1e4d?8 z&iQVi&$DyMIo}=fdDcg6{ob$G-=*P*dxsP5+a2?7*nRch{gcNF_wG*RHY(@6duR`C zxPNypw{bb|-A8+H#67%AxlPJ>?_S#DK5meI)BLOUJ@j@z_0!A!ylZ)L_f#)?^m0${ zR?ggg)yqD;+}91unY*`o*{7d-yHPoF_t*Ea&;8vv|7v{?ecfZd^l^_jDQE6J>tl~T z?(?SQ%-w5!?9<1+zI!=y_gf$P^m4!NQO?{w_kHYh&o|4zdf!7|_gyc2-1~c$Gk5>> zu}2>qxK}xIJkZBJeQ@F4<;?LxAN%yeiTji@#|z)bKHS(m|5|+yeQ`}MeeRpzGp^|& zugCrJd&W2Cx5xSKpWidiIk!E||A73SaZ-PKw#c_`J#i2Z@C^qZn1Abd;yoV7;~Nfa zS#Fzh-s6Ei_=W=yDz|Mp@A1GMoWp?!m)owK_jq6r4s4Zw`~2(mJ@m!{{q(|vhm<$R z1HJ6g3lAPz&KwW)vQIBO*t(oK9_VGCet57=IdeSleeA=7ZS$|+_s|y)^wI|pwkv0j z2m08f4<2k^&KwW)u}>d7cvv}eJkZBJz3|}S<;?NG_puKTcF4a$-$P$K&`Td&ctkmK zT+qiJeemIt<;?LxAN%ydiAR+)#|eGx(+e*iUCtaYd>{L8W5@g(_dWE*JH7OIOn%Qe zr-!^AkInBH=bYaj=YL#&&p7AY_Bj9J^Lxfi{q5N)-)8m1K|H`W9C$+hUE+!Ncp#5& zIPk=ByO#4F5A4A=9C%W>-O7272ln6`4m`Qs?&ZA41AA~_=lpx*-@NakHy-Gx7alyN zyg44|WshEX@YHhVc%YYkdf~w?<;?LwFZ=YvgI&v+)Tjt~0Srw>j%tDHGb=wqK=c=7CV=6K=z*oPZ?<=?jNp)cO)rO$Kn zd&W6EU-#m2YTs) z2m6;Z#{+%r(FYF>C})lb`q-xr9=yDqIUeX^pI&(IigM<7;QQEz2M6Zgx$mJb9_XbH zF1)gwIWFj9k3RVDs&eM|ppSj};KZxTnd5{$_UVNeuPJAa7ru{uxN%Va-TEH-;+nNj|cYP8xFj=+~MWC#{+wC4hP;+?uc^UIi* z(+dyYTHYKF^s+}UJa}6e zUi#p|JIk5lfgAea2XO0j0*ryLpyt|w^PUvHwUU>1Ia^`s9``CvY@6Eqo-$P%# z(@UTC<@bzpddTbX{`{VC&iUoSP|kZium=Z@$$w)0gZdtN zju*a#5n+vEH{$nP01^|$AT`A(`Q4&nj6 z;lPjbpC3=W#{+qM!+{@{yP%x+cwi5{;lNMIU0BY0Jg^7naNwuqE-L3e9@v8e=jFdR z|H*w1z41Ulz3|{?<<0RxFMIUDgP)f(#{<3W(+dyIFK3PidfBHR9$Zk)91naS`|#kx z{HOFi^u+_c^udFR%9-PVKKAH?2N#z!#{+%r(+3ZJQO+C>^s!GbJosffb3E{U?8Adg z@}JiC&=(K%(gzoQRn8n2^sz@DeE4-ab9~UpK7DZFH|5N6LLd9|!i(RQGsg?x$3EP+ zH2;}>4}I}YFMWQO-!snXA+N{p^LxfQ=eNiC|B&A^&N;U|&i}{!p7BzDdoIg&PCaoD z5AY2K{uD>daX=2&-2Xr4H+TQ#@yxydOMY|rULMcf_sjE}yYKSu`Cs#$TTgx5bLV$% z_uRAl?cDOt?S6Z9ubtZ-=XS3>yU)&TkMq0Fp50@;?QxHPSWi9NU*~pS_t&#~>%8*L z>)v{HU!B(;=XGB_yQj`;k8``Hp50Hq?QuWPtEV3BrE@#4`{~)ebY6Mqbw543m(FXC z^SYm&-Am`S$GP24&+et(_PC!H)>98Wac<|O_~D##&Pj2@`Q)9C;)Qd`J0Haxz2q`iE_|Kj#^nLxVuIk@gR`0IKf9vXc zFF(hXOj+n#TwC+2`|q|a-YwK~S^Qg9w{!V9mj5RI{`-fZvHUmr_utOa{(hE4ZuxKW+Wk!~^!=CR Ud|B>Z=r{VW@NZsK$EBbBAIb!=y8r+H literal 0 HcmV?d00001 diff --git a/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.A.i8f4.00003.bin b/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.A.i8f4.00003.bin new file mode 100644 index 0000000000000000000000000000000000000000..055e43ef4855752a73e0cb014a42db5451b0527e GIT binary patch literal 32088 zcmeI(Rn+cPy~XiO2&hP@C}Lm|1_lNOBA{ZoD4}9tV4wmj2G}B{Vqjnc1_lNOQYr=p z22v^pD&Cx9o$!R`oWbDxxxlkup0)Pa+rhyhgfNyk@#lTtEISUMt-!Zjf#k zH%vE+8>Jh?jpNVaCh2DJ+UaKTI_YNdy6Hx7)A+M^y>zp9{dBXqS-M%gLAp`gJpL%& zF#agsDE=tkIQ}T!B>p1YBHk?CG~F!TEZr>LJl!nbBHbw7GX5;yD%~t@nQj)hN;ivJ zryIp>;?Lr()6L>-(#_&+)6L@T(v9M_@n`Y&>1Oc`>1Oec>1Odx=|*w8_@j8|_@j82 z_@j8&_@j8Y_=|A+c(Zu-bhCJmbhCKRbhCJ`bfdUK{8_wrx>?*Y-7MZG-7M~uZWMQp zKa0Dho5lO4o5lO3o5lO58^vAY&*B5p&Ef;o&EkX7&EkX8jp9S%kK#k)kK)7PkK)7Q zkK!ZZFTzL0o5e?^o5e?`o5jbZo5jbb8^zt?&*J0K&En(J&EoFqW^s>nqqt}MS==k# zEIuLKEIu*aEIujSDDEA97N4AM7N3%C7N44K7N3@G6!(cgicgO}iqD8YiqDKciqDF_ z2=|RQi_cCsi_b|ni_c9ri_c3piu=W%#pkD+#TTTT#TTZV#r@Nb;sNnz@xXMm_@Z>P z_~LZ4_>y#^cu@RVd}+E_d|A3#e0jQAd_}rZJUIR+9uj{PUm1TCUlo58UmbrDz9!x* zzBb(~zAoJ?zCPV7z9HQx9vXiZ-TAl)c_F#arlDBUc6INdBBmu?o1PdADu#Gl2Fq?^T$rkll&rJKc%ryIo+ z1OeZ>1Odu z>1OfE=|=IC__O$xbhCJBx>-Ce-7KD-ZWPamKZ|Fko5ioDo5ioCo5ioE8^yEY&*C@I z&EhxH&EmJx&EmJyjpEtyNAWxHNAbJyNAY{{NAdgd7vVYaM)3#nNAZX8NAXATNAbt; z7vZ__M)4={NAbM)qj-M&QM@4jBD^r(C|(qQ6n`3j6n_?f6n`Fn5ndc`6n_za6n`0i z6n_h1(rp;uIi25i_?^Vn<8Kt-Ii25i_?^Tx;%^+^Ii24}Tr=J#@#M0%ef>^i{rG>2 z@7&(>_V#;;Yo#-{H@&_6USfmz=Juwyzu!x27~fo8dcTv{D4sm_wWr@nY#eXRe&68S zzV!C>dx=fbncJ7%zJ4!p?fB;QrMLI8c-INd<)vSv^XrE4*w>zGcD`x2?%)0H!@l(P zT`T_eLUa4_x9{5Vt{;5E-(E$o!=mo$G-O5yz}+TXKqhAd)_d9H@v@_ zrQ154bMKLl9`O!uo^G3T&b>=M-s3Ie-#WhB-ltshc%QdSw`up`+&h(vpIqMQtd%y07pZB|Ue0jZNdF1epw~4=b_u<@omWQ7_-t(=~ zn|s&t@RP^8zD+uF?^_;za(UmkO=s?%yB~hu`R(G%>%Ge(hj+hi{4Kf<=ia|O{N&LC zw@+`b59Hw|k6yS#I&=LX4?nr|#2wR_>kIe8PjB2QzP$QO9yzv)cgyaorQN5AQTd!*YbopXJ_N6+bjd#2ktopXJ_M-SX9{x0$5)(3LQqYrjSw{7>~Tp!5A zPcD6M@AT&SKrViA>4P29nd<|&_{paa?vu`3AGjZW`e3K{^6CS5Jo@0i>CE+kJpAO+2lq>7t`FP~KYeij`10xldF0RwyT;$X`*5xo zKY8@T1Jjx733>R*r7s?o&Rk!(AAWk{!SUtQbMnaXka##=`59$NGrUxDw@A37>&gI3^2YmFK z9(Yvx-P1eQ2YmFK9(Z)RJ<>VX2YmFL9(YW;J<~bY2YmFvW8?1?Uv7OMmpuAlw{*L9 zAI|lGT>RwH2aii{t`FqmCzn2Wd^&S|AQwOR^ug}w%=Ll$;inJwh%c``kVg)EuxI>- zbRW+3fjs==(Fc2_H`fR9@RLU$JRzOAK9Gl>T>9XN>CE+k`{Ab#o)lkReISnjioE$)g{hoZehN$iq(_J@J%u=6XUNesbxHr=~O47w(6j-gsJkdG(w;a_kdt zx9-7Q&&k0@j;E*dt>^5|$NtZV?_1B=n~(jU8Q-_Ql%LPD;^{$spx5-kzVTjAkL+1q zJbl1Nzv+Qzr+;C3=lXz;e$xZbNw9Yo>CN?lT>RwH2QNrxt`FqmC!aoeVLEet;C}e&gZ<;ns}JOn zLmwOvf1mEdxjvAGpFH~D!1U(&KpuYb=z|xfGuH?5@RLg)yf~e?K5#$$^ubHw%c~FM zkwY&W6o23D!?|9Nho3z9;ic)#^@BY8I1!|2VN8J zuzKWx^5W?OKKe}$yf*#e>7DBXKKe}$ye{1l>745WK6*|MyguEL>745WK6>B{@sElx zw?2?d9({0Vx`Vn8=lVb{esbx9H>Nk&2XgU~OCKDT&RieJ#ZNwcaCka%ec*oh>4PKU z%c~FMkwYIG8UNt!!?`|?ho3z9;HdQG`am9j^5}y%r8CzD^6-;OAG|r8xjt||{Pe+F z;>)WKc>PsqbhE`9O#bmscP{qWNp z?}#t2o|8w8W8xj!J(%k`Irzx&&UC)@oc;OO|6TEY>p6S#vH!c{`_`B8^LbA^J*W@# znjSbd-iPavBg>1Y5BTUeJ@DT2$EA0!5BTUeJ@CGC$ES0y5BTUgJ@Ec?C!}+(5BTVT z55)gSe7W_3T=M9H52ic1`*5xgH~S?&M@$>;7{iX-Lkp8sv&h-Hw{iX-LnC|p+&h-HwJ*Nl0lI1!|2hNFiUOjR~dGYiCAN{5WevtnB^v?AGAN{5Wewglpbk6kwA3diB zew6OQbk6kwA3gBn_!q^OTOY_Jk3Kjz-C5m-bA2EeKe_b5Ptu#~1G)Igr4PenKm7E@uj9+B=j4&&l6dEK59WGK4nA`HCY^6RXMaBS|80EVdd}W_ z?Eky?zV)U2d@hZr2lato(*u8~KQ1h%b3H(>*S!BfrZe~c>Ghd+|EKuo-aWlO^WOg) z-`snr_s;(kPaf~w-uCs*FD|FK_ib-J_V&Jgd)M~nV{h-;xA$ysKKA#XeS61p^YM=5 z@P6%UPw)4Va+-U$_T^(=@7A~XYF|F~^upk%ArT>YtMfwpKtwPPkMVoys(v3!?YA=KOL?s5-`0xiR`0R;Z}PIgofZB2Srxj~f0L{KCKvrpF7-FEGUhA8 aFTx9@8^sH!AH|ELAH|K+kK#qsFTzdIjpD`9kK)DCkK!fLkK!fMFTzWu z8^uefAH~b0AH_}6k79MCmi{GPuDPRl`ShcBh4iC%#q^_irSzkC<@B?-S-x4^Jl`yC zk#82Sl5Z5Rntm3qmTwlXo^KYn%r}c$1Xj)`DSsue6zSJ-z;vQZxnY(Ka01{H;cE)H;X&wo5kDa8^znDpT*nfo5efi zo5efko5efjTZDH`H;Q*jKZF}EIv5jEbftS z79Wyt5k55CC_XIxC_X&>DDIhl6d#d(6d##>79W*w79X8&7Wc|Gi;u}SijPe{i;v4U zi;vGYi+ksr#V6z&#V4kp#V6&P#V6;R#eMS4;#2aC;#1Sl;?wfY;?wiZ;xqEi;xqFt z!e^x$#b>7<#eLI{;(qBzasTwA_?+~!_}qN6_`H0x`22jc_=0?+_`>wF_@aEX_~LxC zctE~cd`Z4hJTUz%9+YnuUz%?g56(A>FUvQIFHb*1T0uzF9mm-z=V#Zx%n1Zxlb7eilEKZx%nDZx%n3Zx%nBZxMbj-6(!O{V0AR{V1NC zeiXl$eiXlyeipx+Zx+9jZx&C%q#wm!reB1=N;itXPCtsjNk59eO+SjiOTP$zpKcWYkbV^Z zn0^%hlztS?O1}vIoNg5Vl71Bbntl}jmVOkIuQ*pfoHx8|h^JfG59bRn7vky99e@7t z@*$r7Jn`whHm~<+Jal(p@9O+n3+Imri%h5N}_8dtWBqwL-kS{G0ZD z>u{rT%42W)UOU~N(&6pPXW#3jKPx@nzWnyRZu&o`$J>|R-q%b2m-Kjf`L{{8ak{^T zdZf=Q^o4hM{XXEc{r&$ZqBp$D8>Gj3pZxk`vvfBM@!luDKG{6ojY7Ql$?sj>INc>$ zSRU_FZhL#5H_39WP`SAL{ z{g|g0c1*uT_aU!7lS`i4roYI_r62J6OdfOOxm~`E^WpWHJm$%B`+OJ8hu3fNm?zgA z@@~D_!^}*fq;Wz6nhk0`7gL|aIZ{ArR^W@S8 z_e_W1qO*H3Z&m!x;Wpiey!t>cdA3h~uMn>f^Yp?4$@8G}S6{jG175$$V~#w#<=ZkJUcbp>o;z9Qxo< z`SAKc9`oeV2anE&*9Y#!JbkcN`a5x2FC;q`(2&9T2ecuqdN zK9IvaIrPDE^WpV@Jm$%z51y9~uMgaddHUe_>G$Y9=6?UXl;559BdN9=&j2 zKD<7V$2@uT!a@1)`amA@LCy!n@Iv-vi$YY*ddf~14@cO|0n5P$xN&o!rLtZ^6mppGv z|M-U(J zLQ4ygrb}zax)cSe*~A59BdVF1>JKKD<6~Kj!I$ zlhPm7eaNfl0i8Z=?A=ilgAu+KAG=;e0cpPk9qQZD&I@;;q{w5=E?Qxdr3}z-e=Mu)jb@PPY>!1J*O`|n-8xq`1G8f_*{Ctp5WJW`r-5G@%n*Z-|2-fq{r(8 zetmFqx?{>Kk3O)!z4gHt^WpV@{mrqzKKN2Tygrb_JUR5im-FHEfjs8Pr4PQ653dj0 zi+TFsl=R1TAMzd^FPA*};H!PdAJJJJbL7znUrUESva>wq$+NoeUk~y6KpyktIx+pJ zAzmN2AM;L1cUpK{_aU!7kV_uDaC$zxK9I+p)#>!YH#+0>fjs8PqZhuJ53dj8F;6bN z@U47!ec*n~(+g*$|4{cKubz`jo^Pjr)5@hE@cK<2bL9C>zN7Nt_1o&cn;@auygr#q><^5_Hm+gl&}Bp+TM*xwxc>w}->!|MY%%#%YO{45_{ zAIM{#T>9YW`SAL{y_lyDev$q&-G{vTKrVUo!7uaS^?^L*$fFN_l@G5EEX1h3!ZF-M+1=Q} zo;-ia_wjsq{U(ojXQuyactSqBzH~q4{Vn}z-NWj9-;dWDKj^G4ob?2~e$x-mdVx=` z=>umyz^B)|e`oKW&wD?k9QO3i?Po9V+}ZoKAHV&)Z)fk?p61xoyLR@T?Q4#`y=Q0d zSYC6y<1@=Chxco5`+C35-mQK4?d#n-d$0C2$G+aHvv+D=bL{P%I(wgTo8x`{xSVo$ zm-e==_v!3C+LzzH-lem5XkT;e>pePqfA%%U-rk|JcPF5 zzUXH2oYVB9zlU?$-n08G=lu8H>+F4>-TDpX_qn$BxW4;lfB(z(@t=AB>&iVY|9vd| zzGv@YL({J-f6r^X=j`uuZU3Eh#kYJP|M=en%lEO|lmCAM-tQt@U;kd#*Ia&|v-xKA zYy0o4E57CXSnkQ?o?NkF`5i31gLS31{@Z&l|9vd?whYd}C zPXGPc51!q>pSAsW))n9E{jDpx)^^Vg{XRzXuP?g)*5AqKea-H3cFmpL;cjP1?zzn(c4Yp(aV=G|U%jaC0!?|>wwx>>wgx>?*L-6(Dve-<}OH;bF6o5h=_o5fqC8^tZ+&*Cl9&El=n z&El=o&Ejp+jpCN^NAb4tNAY&?NAdRYNAV8v7s9RL&Eg%?&ElQX&ElQY&Ej3sjpEkv zXYsD-X7O(6W^tQzv$$=#QQR*6EN-7}7I#QDi+4{qi}y%3iaW-i#e1fk#e1cj#e1il z#rvci#hv1h;(gMJ~Q1c zJ}ccU?wxKF_lZA?`=*=4{nE|iv(wGubJC6C{_$t=x#?!{dFf{H`RQiy1?fidfcT^M z!uX^3qWGiu;`pQZlK2bZf$?VXrRiqzW$9+|<>_Ye73oItp!l=+%5<~%s&upX>U6Vs zaJo@EB>pTOnr;>kOE-(JNjHnHO*e{%$DhU5rJKdqr<=t$q?^SzrW?g0;*a8+;*a8+ z1Oembfb7| z{8>CM-7FrTZWiB@ZWiC0ZWK?5Ka1~6H;eC2H;W%gH;W%kH;O05AH@&FAH@&HAH|Qv zAH|QxUkFc%H;W%jH;W%nH;bQ0H;bQ4H;SK%KZ~DEH;bQ1H;X5yo5fSojpC{CXYsUj zv-sI`v-r7mv-tURqj-A!S^Pq}S^Q$US^QGES^RRkQ9L95D1IgWD1J5mD1I&eD1JTu zLU?ApS^P%2S^Q?YS^QSIS^RdoQ9LXDEPf~5EPglLES{Zi7SBmHis#0k#q-k5;`h?c z;`h_d;t$e|;t%7`;*ZkJ;*ZnK;!o1e;!o3!;`#9x!k@)k2!9@LA^b(Wh47d0E)Os0 zeH4Ece-wWme-wWce-wWket}vh9NG z^mD&=iO;V)=7$e=ymkC7+J|@d%#VKjxaYg3S9jO^=*N${zFRtV_sx%fe7Wy!(y6<1 z`_a#xZyTRq_s$O=?tZ)YTec7H?w%k0_;LT+r&o9X{OHGz9M~b9x*Xs~KfdI_-P5Vd z1N+fWF5DwNzjBNpK6Z?^ReM;szjO62&-l@gpL?cXFP*wv<3~S!?v-x+bn5brAN}~c zce<;jQhgde{rHjx z4^F2p59~!hdGL_<{K^A<_>c#?#NV-fc$WwK=*N#dcxZZcdBBf;{K$icrBjy&{OHG* zJlHjzx;(HS{p7)J@%fbp{O}hgde{rHg!k4UF35BSlK zFS+o@bn5cJe)N+IkBZN)eB+0YJ>u=$9&T2ic$aVd=*Q2a({GYaUB2<7A3u*tw`n?c z`Nofad_6YZX6e-BrTyslxcHmLmxFRczR8Qn$KR!Wc$XLSa!yV>A)UIMpqF#<;fe9p zXZ+ps>s=n0UqAE9gQuidmj`_4$A>(4YC3g! zz>j`>$%Ch*QRdT^{hGA3t(o-}LJ8fFJ$%kqi5! zQBK$%W^{=U2Y*!^i&d_G}N^lqcTh8$bH-^W5~?rc;-1{OHHe z^U`gXPF=q7qaR<-Pq%$Kb$Mw&`n@3j4)Nun+>meb;(+*jwGZ#|f?m$ai5I3*mlO1I zPCmRSzPfy%mv?gE#qrhU0=+zVNj!e!fw|2q4-SmKPkz121M}-=etGcH^y>0}5B>O% z2QN#fE)V$8k1u)f@^tF*z+Uu|2d{|FuRP#~4|#A<{QcX9cX_~%e*DOTSEg5&2mI*A zk34u)I(2!#kA8f~gIA|hmk0KvpFB7?KELvSA3o&5A@L7rAKv8wKlj`>$%WUXQD1)}y_}N|Z;r1nAL!+sTzE@-b-6$<58fJ&A9-MI^U8xG;~$b=@AAO>`k7xIye+-D zJm5n=KIFmM)2Yh?e)Qu@9=s!+x;(HK{p7(rDA={KlhghJ-pPfJ#8;OK^zz`N@%WJk<~FZ9I4Sd(lrGd@?@2@_-*cc>y#y_!rc$WwK z=*N#-I4!-pJm5z^e&oVu)2Yh?e)Qu@E_^PXx;(HS{p7;u8|l^M0U!GDArHQpPF)`GqaR=L;9Kd`<$=BECl9_IpI>>v4v3XPp2*q>_D1)`KlD1*LKl<_Yw{)kaQD;?H-MP8U*GH8aF^yar~CYue5$)g^Xg+>cj>n~G_OA9b&r0#KlAEi zZg=RnyW?9Q_s56)Ft0iPHGgM!r|NRUy!x2;ocMmr3-jt@-gD#oEho&YkGao_@3*|+ zTc7X6TV-RT9arI{U;M|oy7ETn;%~X~m+RcKdtdSSf8XJ9-OF;F`-=W3%eJt(!nBCv% z!k?XEvESEn(XH%bX?L(({+$;)=gRl7wC`hff2#|Bc8cXF$W3k`Ya?!2qV`+D=T>hOGJLk&xv9#}Fc7Ll2e|C<= zeqYN)x3Z6=-NADCcV6tAE8oZBzK_wp{j+(a|Gj_K_i{zeb4B%C-S)EL^Y8C-b^G@j HpXYx7j1Ey% literal 0 HcmV?d00001 diff --git a/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.A.i8f8.00002.bin b/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.A.i8f8.00002.bin new file mode 100644 index 0000000000000000000000000000000000000000..a5d2a78f87dbd813574a11760e6c988e3e17fa3b GIT binary patch literal 38488 zcmeI(Wz_FgorduPD4=4KCI$vdDF!Br5-J7;21+Rg1_nwgwql@^VqjoPC9sDxr* zV4#$Z!K_(pM#Y(NX4b58eO@pNc=kRo&f;($-`s2O-+h1G_dd_Q^v!>jB}@Oa=Ks@6 zR$ID3mu#?fz4hu#_1{-ns+X>M)oZ>h)4w)nRR5NLRR5lTR4>avs{hEpkp4%$QT@;S zqxxU@NA;iiNAH9)@-Fyq__3|yGYvo%=ub*#JZ;*dhZ&+?tZ&YqpZ(MFxZ&GelZ<>Er*Dg1! z>y(?-b<54_dgVrS{rt1KLAhDIS-DxgdAV7=MY&PEW&T;cRk>Ncb-7vHu-vTPrrbh$ z+kB&XyZobi`~0K2QT|cAL;g{{WBysaQ@L5abGcdFxZJGXrQE3AHUF$`Qf^i^EjO#1 zm7CSg%Z=(5`DgWR*38 z8`X#9pVfz#o7G2@o7El5&FUk|jq0QF&+4Pg&FW*y&FW6&X7#b<7ShM%8`a0>AJr%1 zAJv`nkLnZikLr{1&+3!Q&FWLi&FU`YX7#D%M)hg=XLZ+dv$|WkS>3(dtnN{6RQJq3 zt4}XCtIsGmt9zB3)n}F))o10O)n}KR)#sF()xFEj>T}C2q|eJYs?X0qsxQbts{7<0 z)feU;)feTT)fbnW)t8i;)qTs&>PyRw>dW%a>VD;Bb^mg+dO*2ZJ+R!U9+ZDpUtVrj zUr}yW4=y*WuPisJugX8GuP!&MuPHaHuPryLuPe8ZzCPcmz9IjpzA^u(9+H1l-;{q; z-<*F|-%@T?-&$@~4=p#VZ!0&dZ_hughn1Vv!^_R;5#?s}$a154RQ_3gN4Z&jXSrED zy4ktvVE$1(Hvg!8DF3K_IRC7E zq};52wA`$ItlX@AyxgdMBLA#@vfQj5S8i61FE^_vlpEC(^Uvz1%FXJh%gyRZsxl#Q_{#pHIxmi8E+^n8aZdT7MH>zjlpVe=bo7HcZo7J<+&FXi`jp}#v z&+7Ne&Fc5d&FVSjX7vZ<7SbQ)8`U4>AJre{AJud7kLpkIFQh-sH>y9&KdL{^KdR^D zAJt#vUr2wMZ&c6EKdKkxAJq%$tS zKdOJoKdP7HAJsqRzcT$(-xtz9=UYhsl5ZisG~Yt%_a1)N;r9{OFTeKEpN%Z>o!{>| z{7&Kq`Pa$syPV&3_?^TJ^RJuVcR9c7@H>ecgB#x8 zoyu)i&Uf$8931fu?_6&4a=v?)=6H`A=ieg#8r_H9-lu+gd7pPFZ{IuB%N)JD)4P_l z@4f0}o?hPTCgtpVw|beUpLe@yIs4wP`!Ub^-7NoF-G{#3v0nOk$D5b4?>*~djy~S= z7Uk@F*ZP>Jk9U2ya`wG%eazF#`@VZQ``)?xG0!{SGXIUc4}HCNz4Y!u^p)Vfjr4KGVvYdTf z(8nBo@ZnMA?Bjzz=IMhIk1l5)C-gB-FT8k6Is16we$2y-o$_ziedvpKdg=4n{MI<9 zhrAw-%WsWy&To$MKR&-T&N;U^&i{n`)_AGEIXmauvYt4I2l$2qPt3n-JnXqPa=zn%IrxSHPcFB6Ip6WX9Gt^}ri=w+T>c(7|Z`*@(2dHUhOZsqLbf%`EJ4|dQ0fbK(IJkU!YJlLb0 zeLT>|9DVR$&vN$hKp*q;!GoulvyTV*n5P#WJfoa_Ja9ke;lW<{x9L9g#RI+c!G&j* zvyTh){z4XC@ z1IyXR1AWZV2M-P^XCDvrF;5>nczHSdc%YAYdf~w<%Gt*Q_hTL&9Grib?n7TZ&`Td& zcx5^JxS)?Y`ryN>%Gt*UeazDbCth97K2GRko?dwInsWB>!u^! z>+)OUoF4Leygt7*&N;t1&i{t|);Q4OLFC}$rJ^f6B_Ja}h0`*`4f%)^7D^Y7bz=!*w> z>4OXJDrX-T^f5;te0X;``}m-bdHUeQd&=3z34P4d3oqVV&OTnaAMEgO8WDj|Y00qZb~0qMUs^(91l%@Zgi>?Bju6=IMtA$Ca~>2kyr_JUBl8A>D_* zc%YX)cyK~F`*@&_Ir`wiiRJ9$fj;Kxg9o1~XCDvrF;6c%_;fk@c;J4_!-JFZAKHEB ziwAn?gA1Q2XCD{zF-ISK_-r}*_@Iw@`ryRp%Gt*WeazDfFFs$+K3=#V^Kj$j{6};j z`r@5l`g|e3HO}cFug4ejTjQMbo8$an%5RNx&TWqKe>uN3Ug~eoDfy1BCl2BPzTv=E z@_#d)_>Kqi_=W>tEq8i3-|@g4e8YjSl{=%H?|5Ji&f&nR<<2bUJ06&W1E=LbEB`Uw zhu(OgpI&(I_44-dKreIj!h>&=vyTUQnWq;Xe6yT=JkZNL{qW%Qa`y4S{g{UbXXHP& z`_LB;^wI|p&Mapi5A-odA3Qj#oP9jd$2@)T;9KSF4gX1E@vMP+>d#9aCZKW zbszfTfnNIH!gtEq#|3@N(FY&CTh2Z{=wqHfIPtx5_HjZV^Yp@t@0YWW7w*SA+&Cxy z@!f~Mc&C>>Kge&5b9%_@@x%PqIOqK4IRB6GTjQK_o8$aH&ToyE`kQlZzLV;SgLr^% zIPjDF=f@M@@jxEmaNwuqE-2?a9+-n~IPkM_7nbuK56r4gX9m$Q!tdYPvm9$Zk)J|4Iq^YGxp z{HJsu`r?6J`ryGu0`a`y4U{g{Uv zm*hXA`_LEf^wQ^#`K@tI4|zTQl;0ZXoZlSh|8st8oO5n-oc}NRt?^QSb1uzyc0F+r z5AY2K{u)Q@U}_wsn=yIrY@XJ9mEP z_Rg)nZ|9bGZtvULyLN7KoZGv$_MV;F9Ow6*t-WKt&GC-Ut*0K|uX8)E_iOFlIR(aMJ$vtqJ+JuheMP&M(eqy2eY1bR{B*P*KfSu=uI}es z-uJk8AD8FW;(aW=kJ)=z+5F48{ol8EAB&v)zZ>v(M`!;oRyO~# z-qVVboBj7(QF<-wIT!C^k&}y@T(V^G9W1_sD|!dZ%GGOnZt=Y=eJ`{3u(J6V-@)a% zx_BRp_iC@3pM`7XLmj|Gxu^_p$UoX76ET^DparTTybe z|DG#KuVp>w;(aV~@{0cd^6cNm%I06z_qL+sX8%1`lwQkv&c*v!`tUqY{fvz7F!Vk6$1m4QZcX&-c$p74a{oH_G+KQC~Gx%R%F!Fg`x_RX6A-fR8bYd`n?^6FZ9tyTZq;P3Pg>#ka$ zYi+*jd&l)w=|8WtN`Ig4vc9b^(mytDR4>Uts(;Eqs(;SENdJ;=RR1OasQzpIQT@04 zqx$dp7wKQ~jp~2oAJzZNKdS$ge^mcF|04ZczES<3{GT!a=t~nUcSrH_1mA-4a&{xRm#okRm;ul)yj?P)$`BlHOkHEhUI4Un&oD7 zqjICVasFA|q};4ttK6(!yWFf^r`)J+ntxWWTW(f2D>ti~mz&k=l^fM9@{j8E^N;Ec z@{j5b^N;F{@-NaY^Udmw%gyRd%FXIc%gyS|%8lw)`DgX!$VJKdZMXH>!8YKdN`kKdN`iKdN`m zKdN`hzew+zZ&vSCZdUJJZdUJ6ZdUJEZd7;3KdbjDH>*3Ao7J7l&FaqOMs=6`v$|`! zS-p3;S-nrWS-o$$QQa;7tlqEOtlq!etUjRJtUj>Zs6HtFs6IIVs6HhBs6I6Rs6H(J zBHcaTtUkQltUjXLtUj{btUjvTsP2(}Rv%q%R`)D7t9zB3)xFD&>OT2rb>DKc`j~RF z`q*-_`nYnV`uO~_`h;?``owax`lNER`s8w>x?lcLeMy`iy+D z`pj~(`mA!Z`s{ME`kZp3x_|yzeQvo~J)qpIKCj%Y9$0Qv56VBQ2bY`G=a-w+7nGaT z7nU2)2lH>)2jH>)2nH>#)RAJtFfAJtFhAJtFgAJtFiU!psu$!R)gR|yq!;EJ)t}@a)t}}c)t}`b)t~2Iq!;BI)nDWv)nDcx)nDZw z)nDgdq!;H~q`%3xNPnAek^U~{7%TmAh@Ouuwk66FlhHJ0-{m5TaJ~_YZ@H>eO z%3U+ReL27D@H>gCgC=HEEKeL266xLUqV^6BN=&g*v)SI_^q{Pvw& z-nso=;u__wJGZ=Z`@O`5`K>#*yz~3L#5MC<*H_-}BsR*YkMlaG-$`toZ=HVMVBdM= zo!9RrHYsP_dF7qg?JS3+@k%f*U!3h$~out^ZRx_ zIp@1UKHttI=X^KJ=UX4S8?}!k-W@)8Z(HWux_7s6efYdTbMV5uyK(t#%G>u2&A|=t z?MBKJ0s^dYPw}cY5>k z*1cD~%+t$z-MXB0?^ZAK^z&}FDQDgLbwB2LzuV^5*E`ln5AS%p{9AM%_Pu9)%+tqv z-oCtb?^+-8^zp85QO>&et&e$ndEd7zXWct@KjwMox5}@t_pXl~-u-R`S8FTe8Yje zmEWnneLOG+-*DjW<#sM-9}mpIIUKl0xn0WH#{+Y4;GX$+&965e=%o)H>`?C3-G_ZV z(91l%@ZetMt>b}S=IMn8JC?JK2YQ*OA0F&f&N?2rAM@~F=luHOfj)ZR!7lml(0$m) z1AWZX2M=~FZygWxF;5>nxOX}0c%YAYdf~x+%2~$)_hTL&+&90zc%Y9SxUgIPyLKP; zaX}yR^udSwmA8%$`k1E=PTaqob)3-0JiYMZ0p+aYh5IoNHy)T@U!2oNj|b)3p?k27 zb9$Jg$AioH#yRIV$N3+U-#5-Vw>i%L(EPsfQh#$EmJbK<0M~F}_k4TCkzMM`hX>~1 z8xB0Y{9fhl~rxzaVSv-UP%)^7d^XrQT`sjfN`{aL6 z_hBCo^f6B#JlMCqbv)3=Jbm!sG3Bh|fj;Kxg$Iu(bDaNa`F-Q1{^mSA9}eOHuHnEl@*NOI_Ngx) z9+-n~IPlE!&ns^q56rx~C`>4OLR zmwSBoVIL3lGEXl&cy4*?c%YYgdf~wV<*eg@UgqhC2hS^K9S_`(d3bPOetq#kA3gBk zp#1xFANKJ;AM^CVgM-Uk#{+%L(+3ZpU(Pxn=wqHc3}=IMhIFD_>tC-gB-FT8k3IqP`ge$2y-m*&?O=k(Fz z(0u!M57u!`4|DW*SvlW0=lte4|I73H#yRIU$N688-#1?BZ_X?8;UFI18V($m@9;Qs zP<{FEz#M$TfmfA3qP%@PFbCgo;ML`hEN34N%)vPvcul#Z%Gt*Qb8z6b`H#-8Hy-Gv z4<5X(+#%hEeLT?1JiYMX_2sSOfnMh6g$IY1vyKOPnWrBf98u0X9=IR#@ZiY&`r?5; zdf>rP`484Ot*DQ6ug^f6B_ym)Il>v-XQ%)^bh<<}SI z^wHzke6Q;stmB*>=IHVEa=vlS`OR_ucjWhtbIxs!^S?8{Z@kpsoOk8JK|H`U9C&xW zv*7#d3xc&hss&U1NUPd9(*{z zzIdRI9=LEy{&#mD_HjWU^Yp=okCeBL5Biv=4^DivoOPVg$2`68;$!8kvxZ zUtgTlM~_qU9oIcr$2mRB(c=^4eB+$+o8$bS%bz$<--GW@C^q(Q~u2I_VK_Re8YjymOHDQeLOG+=WyV2<<2f=9}mpIfzRhZ zC%@i!pqD;)aC*5@x)1w!pqF`i;lUTmTgL;v%+m`G&M0Rc5A-rmKRh_IoOL{KKjz`V zS^4$F1AX+sgR}FW+I`r^1AWZX2M^9EZygWxF;5>n_+mNhc%YAYdf~yB%2~$)_hTL& zd^x|qc%Y9SxbT(yr*$9paX}yR^udR(mbZ=%`k1E=PJFGLb)3-0JiYMZ>*cKDh5IoN zH@=ZyU!2oNk8|^#-aS~yIX%qL!-4OW`*At@cwi3B;lTIHU0BXO9+-mz zKgj=+{CeYoUi#p{56gX}`>>A(dYPve9{i}hbv)3^JiYMX{BqXuKri$3!-EUTS;qtS zV;&y-IKRGlppPDSaAE#)yAS(#ppSX_;K5JITgL-^%+m)Cep=2t9_VA9UU=}ca@O&{ z{g{UbKhLi(9_XV7E?kuVyzaw3F6d*PKKSs9^49S|AM^CViC>npjuZNrrx#xQs+@Ja za6jhZ#;^11i*x$uadEyMb`REZP7ibR_)R(AIOqK4IR9_+`^GuvHplsYm)|#D>Tk~P z^Wh*K;2IA6F@9WFPy09^k89rlCFQJp|MGa|-Tx`Sb?;st&%F0P=eO>?%X{a4$)}HZ z?%dAnonKT>>)y9>o8#Qxw{P#-xy^BI@7lNb?A+!!zxV9hJJ#DA?^qA-*Lj`O`@OiH z*1cQjHOG0qTi@QR^P1zl-m7o#)OpQuZtv8$_o=rz-lrbkrSm$c_xXoYJUrrukQTUi!U`-p4=MH~RnQ?~7hh zb63<}OZ|6SxsRp2WA{z3sP{PAYq|Po&%N^Re(86!avv-A@&7mA@8GiZiu%rGdo5T0 z?796NTv2mZ)Lu*dcU!rSOaFIZN!{b zK34DVWA^^m6#wiwmiqU#TyiV-v3l=dx%@jX^_(kzAFKEGF?)Y&ihuSTOa1#=F1eNa zSiN_!T>hPxdd`)#XozFrT%>_m)y#Itlm3VF8|I;J?F~b$Ljrk%--Lc z;-5XoQvbe|OK#;pR_`4wmw)G_o^$2zWA*+%X76uJ@vkZ8xV-;vS9)Ih@B8w;@5_7s Q%D?BO|2;?V;~(eyKUyJUi2wiq literal 0 HcmV?d00001 diff --git a/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.b.i4f4.00000.bin b/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.b.i4f4.00000.bin new file mode 100644 index 0000000000000000000000000000000000000000..d4dd4fda329db3d895263036fc5218453e5e36f5 GIT binary patch literal 1064 qcmZQ%fB+UK4WoWR884V23>cpgrT|Vi*fTJU;?Xb|O#{O@4FCYu=)G(J literal 0 HcmV?d00001 diff --git a/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.b.i4f4.00001.bin b/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.b.i4f4.00001.bin new file mode 100644 index 0000000000000000000000000000000000000000..38df9a2c5befedfd116d4320183ae97eec9f4967 GIT binary patch literal 1064 rcmZQ%fB+UK{R>KeVT3SVFhgjVI8+#_3Pd&7kK)lV7)=AiI}HE;!9%`b literal 0 HcmV?d00001 diff --git a/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.b.i4f4.00002.bin b/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.b.i4f4.00002.bin new file mode 100644 index 0000000000000000000000000000000000000000..e1dddab855ed786ccf7d9b1b124a3a8418373f08 GIT binary patch literal 1064 scmZQ%fB+UK{e=<2c*g{xUob=HUr>3dG?WLT8tg~$Xc&y9f#ID70GN5cR{#J2 literal 0 HcmV?d00001 diff --git a/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.b.i4f4.00003.bin b/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.b.i4f4.00003.bin new file mode 100644 index 0000000000000000000000000000000000000000..b9878a2cfdccb951f39be81e2be443419798ef67 GIT binary patch literal 1064 qcmZQ%fB+UK{f-I3c)^TH|ANXhLTLomV9&rXibum>Gz|>rGyni^uf9zH literal 0 HcmV?d00001 diff --git a/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.b.i4f8.00000.bin b/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.b.i4f8.00000.bin new file mode 100644 index 0000000000000000000000000000000000000000..d61c9fc666d41182a93e6e7dce70de5436911d3d GIT binary patch literal 2064 zcmZQ%fB+6C4WoWR884V23>cpgrT~ThU=QJr(xc%33W3pdFq#fV)4^yy7%c~eS~&m! Dv{NeI literal 0 HcmV?d00001 diff --git a/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.b.i4f8.00001.bin b/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.b.i4f8.00001.bin new file mode 100644 index 0000000000000000000000000000000000000000..43e994a7c615a2c86e116449548185835c3560c2 GIT binary patch literal 2064 zcmZQ%fB+6C{R>KeVT3SVFhgjVI8+#_3Pydfhp3dG?WLUKG;K8qx5JvfI?t29gL=f(R47H4@S#@ Ip;it601X%`$^ZZW literal 0 HcmV?d00001 diff --git a/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.b.i4f8.00003.bin b/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.b.i4f8.00003.bin new file mode 100644 index 0000000000000000000000000000000000000000..42c1b38d5d8363d481457182a05d79390594ba1a GIT binary patch literal 2064 zcmZQ%fB+6C{f-I3c)^TH|ANXhLTOa$gFS>lN{@yECcpgrT|Vi*fTJU;?Xb|O#{O@4FCYu=)G(J literal 0 HcmV?d00001 diff --git a/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.b.i8f4.00001.bin b/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.b.i8f4.00001.bin new file mode 100644 index 0000000000000000000000000000000000000000..38df9a2c5befedfd116d4320183ae97eec9f4967 GIT binary patch literal 1064 rcmZQ%fB+UK{R>KeVT3SVFhgjVI8+#_3Pd&7kK)lV7)=AiI}HE;!9%`b literal 0 HcmV?d00001 diff --git a/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.b.i8f4.00002.bin b/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.b.i8f4.00002.bin new file mode 100644 index 0000000000000000000000000000000000000000..e1dddab855ed786ccf7d9b1b124a3a8418373f08 GIT binary patch literal 1064 scmZQ%fB+UK{e=<2c*g{xUob=HUr>3dG?WLT8tg~$Xc&y9f#ID70GN5cR{#J2 literal 0 HcmV?d00001 diff --git a/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.b.i8f4.00003.bin b/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.b.i8f4.00003.bin new file mode 100644 index 0000000000000000000000000000000000000000..b9878a2cfdccb951f39be81e2be443419798ef67 GIT binary patch literal 1064 qcmZQ%fB+UK{f-I3c)^TH|ANXhLTLomV9&rXibum>Gz|>rGyni^uf9zH literal 0 HcmV?d00001 diff --git a/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.b.i8f8.00000.bin b/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.b.i8f8.00000.bin new file mode 100644 index 0000000000000000000000000000000000000000..d61c9fc666d41182a93e6e7dce70de5436911d3d GIT binary patch literal 2064 zcmZQ%fB+6C4WoWR884V23>cpgrT~ThU=QJr(xc%33W3pdFq#fV)4^yy7%c~eS~&m! Dv{NeI literal 0 HcmV?d00001 diff --git a/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.b.i8f8.00001.bin b/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.b.i8f8.00001.bin new file mode 100644 index 0000000000000000000000000000000000000000..43e994a7c615a2c86e116449548185835c3560c2 GIT binary patch literal 2064 zcmZQ%fB+6C{R>KeVT3SVFhgjVI8+#_3Pydfhp3dG?WLUKG;K8qx5JvfI?t29gL=f(R47H4@S#@ Ip;it601X%`$^ZZW literal 0 HcmV?d00001 diff --git a/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.b.i8f8.00003.bin b/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.b.i8f8.00003.bin new file mode 100644 index 0000000000000000000000000000000000000000..42c1b38d5d8363d481457182a05d79390594ba1a GIT binary patch literal 2064 zcmZQ%fB+6C{f-I3c)^TH|ANXhLTOa$gFS>lN{@yECcpgreKsF4S~@R7%?FL0I*^L<^TWy literal 0 HcmV?d00001 diff --git a/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.x0.i4f4.00001.bin b/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.x0.i4f4.00001.bin new file mode 100644 index 0000000000000000000000000000000000000000..b06276baaf2557ea81e5184b6a2477c9117d0a5e GIT binary patch literal 1064 ncmZQ%fB+UK{R>KeVT3SVFhgjVI8+#_YLprcfzc2c2_XOgo4o_u literal 0 HcmV?d00001 diff --git a/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.x0.i4f4.00002.bin b/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.x0.i4f4.00002.bin new file mode 100644 index 0000000000000000000000000000000000000000..81473be4ce54f2f09bab4cc1fc07b3918ff564d0 GIT binary patch literal 1064 pcmZQ%fB+UK{e=<2c*g{xUob=HUr>3dG?X_=jfTKz2#kaf0046H1JM8g literal 0 HcmV?d00001 diff --git a/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.x0.i4f4.00003.bin b/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.x0.i4f4.00003.bin new file mode 100644 index 0000000000000000000000000000000000000000..0874ce661f832748a11f09224efa05cca495c955 GIT binary patch literal 1064 kcmZQ%fB+UK{f-I3c)^TH|ANXhLg`UzGz3ONVB~}V07@wX#{d8T literal 0 HcmV?d00001 diff --git a/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.x0.i4f8.00000.bin b/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.x0.i4f8.00000.bin new file mode 100644 index 0000000000000000000000000000000000000000..e8fb5f2108ef02ee129fedd1727525a645e84663 GIT binary patch literal 2064 ucmZQ%fB+6C4WoWR884V23>cpgreKsF4S~@R7!85Z5Eu=C(GVCmApig)rUL2! literal 0 HcmV?d00001 diff --git a/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.x0.i4f8.00001.bin b/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.x0.i4f8.00001.bin new file mode 100644 index 0000000000000000000000000000000000000000..644894b8117d9e6e003ee37969460001bca68037 GIT binary patch literal 2064 xcmZQ%fB+6C{R>KeVT3SVFhgjVI8+#_YLprcfzc2c4S~@R7!85Z5Eu?2007K31K$7u literal 0 HcmV?d00001 diff --git a/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.x0.i4f8.00002.bin b/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.x0.i4f8.00002.bin new file mode 100644 index 0000000000000000000000000000000000000000..7fc348739ea791ce999ef7392f543ae6d1bd6e7e GIT binary patch literal 2064 zcmZQ%fB+6C{e=<2c*g{xUob=HUr>3dG?X_=jfTKz2#kinXb6mkz-R~zhY$b&d|U(7 literal 0 HcmV?d00001 diff --git a/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.x0.i4f8.00003.bin b/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.x0.i4f8.00003.bin new file mode 100644 index 0000000000000000000000000000000000000000..63d3a3f170741a45a8a4da0196cc5fc60d699222 GIT binary patch literal 2064 ucmZQ%fB+6C{f-I3c)^TH|ANXhLg`UzGz3ONU^E0qLtr!nMnhouga806f&cpgreKsF4S~@R7%?FL0I*^L<^TWy literal 0 HcmV?d00001 diff --git a/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.x0.i8f4.00001.bin b/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.x0.i8f4.00001.bin new file mode 100644 index 0000000000000000000000000000000000000000..b06276baaf2557ea81e5184b6a2477c9117d0a5e GIT binary patch literal 1064 ncmZQ%fB+UK{R>KeVT3SVFhgjVI8+#_YLprcfzc2c2_XOgo4o_u literal 0 HcmV?d00001 diff --git a/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.x0.i8f4.00002.bin b/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.x0.i8f4.00002.bin new file mode 100644 index 0000000000000000000000000000000000000000..81473be4ce54f2f09bab4cc1fc07b3918ff564d0 GIT binary patch literal 1064 pcmZQ%fB+UK{e=<2c*g{xUob=HUr>3dG?X_=jfTKz2#kaf0046H1JM8g literal 0 HcmV?d00001 diff --git a/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.x0.i8f4.00003.bin b/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.x0.i8f4.00003.bin new file mode 100644 index 0000000000000000000000000000000000000000..0874ce661f832748a11f09224efa05cca495c955 GIT binary patch literal 1064 kcmZQ%fB+UK{f-I3c)^TH|ANXhLg`UzGz3ONVB~}V07@wX#{d8T literal 0 HcmV?d00001 diff --git a/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.x0.i8f8.00000.bin b/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.x0.i8f8.00000.bin new file mode 100644 index 0000000000000000000000000000000000000000..e8fb5f2108ef02ee129fedd1727525a645e84663 GIT binary patch literal 2064 ucmZQ%fB+6C4WoWR884V23>cpgreKsF4S~@R7!85Z5Eu=C(GVCmApig)rUL2! literal 0 HcmV?d00001 diff --git a/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.x0.i8f8.00001.bin b/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.x0.i8f8.00001.bin new file mode 100644 index 0000000000000000000000000000000000000000..644894b8117d9e6e003ee37969460001bca68037 GIT binary patch literal 2064 xcmZQ%fB+6C{R>KeVT3SVFhgjVI8+#_YLprcfzc2c4S~@R7!85Z5Eu?2007K31K$7u literal 0 HcmV?d00001 diff --git a/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.x0.i8f8.00002.bin b/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.x0.i8f8.00002.bin new file mode 100644 index 0000000000000000000000000000000000000000..7fc348739ea791ce999ef7392f543ae6d1bd6e7e GIT binary patch literal 2064 zcmZQ%fB+6C{e=<2c*g{xUob=HUr>3dG?X_=jfTKz2#kinXb6mkz-R~zhY$b&d|U(7 literal 0 HcmV?d00001 diff --git a/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.x0.i8f8.00003.bin b/external/hypre/src/test/TEST_ij/data/poisson_10x10x10_np4/IJ.x0.i8f8.00003.bin new file mode 100644 index 0000000000000000000000000000000000000000..63d3a3f170741a45a8a4da0196cc5fc60d699222 GIT binary patch literal 2064 ucmZQ%fB+6C{f-I3c)^TH|ANXhLg`UzGz3ONU^E0qLtr!nMnhouga806f& fsai.out.0 + +# The FSAI factor G is simply sqrt(1/D_A). This should give the same result as DS-PCG +mpirun -np 1 ./ij -n 10 10 10 -solver 31 -fs_max_steps 0 -fs_max_step_size 0 -fs_kap_tol 0 > fsai.out.1 +mpirun -np 1 ./ij -n 10 10 10 -solver 31 -fs_max_steps 0 -fs_max_step_size 1 -fs_kap_tol 0 > fsai.out.2 +mpirun -np 1 ./ij -n 10 10 10 -solver 2 > fsai.out.3 + +# Test different setup combinations for FSAI +mpirun -np 1 ./ij -n 10 10 10 -solver 31 -fs_max_steps 5 -fs_max_step_size 1 -fs_kap_tol 0 > fsai.out.4 +mpirun -np 1 ./ij -n 10 10 10 -solver 31 -fs_max_steps 5 -fs_max_step_size 4 -fs_kap_tol 0 > fsai.out.5 +mpirun -np 1 ./ij -n 10 10 10 -solver 31 -fs_max_steps 5 -fs_max_step_size 4 -fs_kap_tol 1e-3 > fsai.out.6 +mpirun -np 1 ./ij -n 10 10 10 -solver 31 -fs_max_steps 5 -fs_max_step_size 4 -fs_kap_tol 1e-1 > fsai.out.7 + +# Test with larger problem stencils +mpirun -np 1 ./ij -n 10 10 10 -27pt -solver 31 -fs_max_steps 5 -fs_max_step_size 3 -fs_kap_tol 0 > fsai.out.8 +mpirun -np 2 ./ij -n 10 10 10 -P 2 1 1 -27pt -solver 31 -fs_max_steps 5 -fs_max_step_size 3 -fs_kap_tol 0 > fsai.out.9 +mpirun -np 3 ./ij -n 10 10 10 -P 3 1 1 -27pt -solver 31 -fs_max_steps 5 -fs_max_step_size 3 -fs_kap_tol 0 > fsai.out.10 +mpirun -np 1 ./ij -n 10 10 10 -sysL 3 -solver 31 -fs_max_steps 5 -fs_max_step_size 3 -fs_kap_tol 0 > fsai.out.11 +mpirun -np 2 ./ij -n 10 10 10 -P 2 1 1 -sysL 3 -solver 31 -fs_max_steps 5 -fs_max_step_size 3 -fs_kap_tol 0 > fsai.out.12 +mpirun -np 3 ./ij -n 10 10 10 -P 3 1 1 -sysL 3 -solver 31 -fs_max_steps 5 -fs_max_step_size 3 -fs_kap_tol 0 > fsai.out.13 + +# Test with linear elasticity problems +mpirun -np 1 ./ij -fromfile data/beam_tet_dof459_np1/A.IJ -rhsfromfile data/beam_tet_dof459_np1/b.IJ \ + -solver 31 -fs_max_steps 5 -fs_max_step_size 3 -fs_kap_tol 0 > fsai.out.14 +mpirun -np 2 ./ij -fromfile data/beam_hex_dof459_np2/A.IJ -rhsfromfile data/beam_hex_dof459_np2/b.IJ \ + -solver 31 -fs_max_steps 5 -fs_max_step_size 3 -fs_kap_tol 0 > fsai.out.15 +mpirun -np 4 ./ij -fromfile data/beam_tet_dof2475_np4/A.IJ -rhsfromfile data/beam_tet_dof2475_np4/b.IJ \ + -solver 31 -fs_max_steps 5 -fs_max_step_size 3 -fs_kap_tol 0 > fsai.out.16 +mpirun -np 4 ./ij -fromfile data/beam_tet_dof2475_np4/A.IJ -rhsfromfile data/beam_tet_dof2475_np4/b.IJ \ + -solver 31 -fs_max_steps 15 -fs_max_step_size 4 -fs_kap_tol 0 > fsai.out.17 +mpirun -np 4 ./ij -fromfile data/beam_tet_dof2475_np4/A.IJ -rhsfromfile data/beam_tet_dof2475_np4/b.IJ \ + -solver 31 > fsai.out.18 + +#============================================================================= +# Complex smoother to BoomerAMG +#============================================================================= + +# Computes the full inverse of the lower Cholesky factor. Not practical, but it's a good sanity check. +mpirun -np 1 ./ij -n 5 5 5 -solver 1 -smtype 4 -smlv 25 -fs_max_steps 125 -fs_max_step_size 1 -fs_kap_tol 0 -fs_eig_max_iters 5 > fsai.out.100 + +# The FSAI factor G is simply sqrt(1/D_A). This should give the same result as BoomerAMG(Jac)-PCG +mpirun -np 1 ./ij -n 10 10 10 -solver 1 -smtype 4 -smlv 4 -fs_max_steps 0 -fs_max_step_size 0 -fs_kap_tol 0 -fs_eig_max_iters 0 > fsai.out.101 +mpirun -np 1 ./ij -n 10 10 10 -solver 1 -smtype 4 -smlv 4 -fs_max_steps 0 -fs_max_step_size 1 -fs_kap_tol 0 -fs_eig_max_iters 0 > fsai.out.102 +mpirun -np 1 ./ij -n 10 10 10 -solver 1 -rlx 7 > fsai.out.103 + +# Test different setup combinations for FSAI +mpirun -np 1 ./ij -n 10 10 10 -solver 1 -smtype 4 -smlv 25 -fs_max_steps 5 -fs_max_step_size 1 -fs_kap_tol 0 -fs_eig_max_iters 5 > fsai.out.104 +mpirun -np 1 ./ij -n 10 10 10 -solver 1 -smtype 4 -smlv 25 -fs_max_steps 5 -fs_max_step_size 4 -fs_kap_tol 0 -fs_eig_max_iters 5 > fsai.out.105 +mpirun -np 1 ./ij -n 10 10 10 -solver 1 -smtype 4 -smlv 25 -fs_max_steps 5 -fs_max_step_size 4 -fs_kap_tol 1e-3 -fs_eig_max_iters 5 > fsai.out.106 +mpirun -np 1 ./ij -n 10 10 10 -solver 1 -smtype 4 -smlv 25 -fs_max_steps 5 -fs_max_step_size 4 -fs_kap_tol 1e-1 -fs_eig_max_iters 5 > fsai.out.107 + +# Test with larger problem stencils +mpirun -np 1 ./ij -n 10 10 10 -27pt -solver 1 -smtype 4 -smlv 25 -fs_max_steps 5 -fs_max_step_size 3 -fs_kap_tol 0 -fs_eig_max_iters 5 > fsai.out.108 +mpirun -np 2 ./ij -n 10 10 10 -P 2 1 1 -27pt -solver 1 -smtype 4 -smlv 25 -fs_max_steps 5 -fs_max_step_size 3 -fs_kap_tol 0 -fs_eig_max_iters 5 > fsai.out.109 +mpirun -np 3 ./ij -n 10 10 10 -P 3 1 1 -27pt -solver 1 -smtype 4 -smlv 25 -fs_max_steps 5 -fs_max_step_size 3 -fs_kap_tol 0 -fs_eig_max_iters 5 > fsai.out.110 +mpirun -np 1 ./ij -n 10 10 10 -sysL 3 -solver 1 -smtype 4 -smlv 25 -fs_max_steps 5 -fs_max_step_size 3 -fs_kap_tol 0 -fs_eig_max_iters 5 > fsai.out.111 +mpirun -np 2 ./ij -n 10 10 10 -P 2 1 1 -sysL 3 -solver 1 -smtype 4 -smlv 25 -fs_max_steps 5 -fs_max_step_size 3 -fs_kap_tol 0 -fs_eig_max_iters 5 > fsai.out.112 +mpirun -np 3 ./ij -n 10 10 10 -P 3 1 1 -sysL 3 -solver 1 -smtype 4 -smlv 25 -fs_max_steps 5 -fs_max_step_size 3 -fs_kap_tol 0 -fs_eig_max_iters 5 > fsai.out.113 + +# Test with linear elasticity problems +mpirun -np 1 ./ij -fromfile data/beam_tet_dof459_np1/A.IJ -rhsfromfile data/beam_tet_dof459_np1/b.IJ \ + -nf 3 -solver 1 -smtype 4 -smlv 25 -fs_max_steps 5 -fs_max_step_size 3 -fs_kap_tol 0 -fs_eig_max_iters 5 > fsai.out.114 +mpirun -np 2 ./ij -fromfile data/beam_hex_dof459_np2/A.IJ -rhsfromfile data/beam_hex_dof459_np2/b.IJ \ + -nf 3 -solver 1 -smtype 4 -smlv 25 -fs_max_steps 5 -fs_max_step_size 3 -fs_kap_tol 0 -fs_eig_max_iters 5 > fsai.out.115 +mpirun -np 4 ./ij -fromfile data/beam_tet_dof2475_np4/A.IJ -rhsfromfile data/beam_tet_dof2475_np4/b.IJ \ + -nf 3 -solver 1 -smtype 4 -smlv 25 -fs_max_steps 5 -fs_max_step_size 3 -fs_kap_tol 0 -fs_eig_max_iters 5 > fsai.out.116 +mpirun -np 4 ./ij -fromfile data/beam_tet_dof2475_np4/A.IJ -rhsfromfile data/beam_tet_dof2475_np4/b.IJ \ + -nf 3 -solver 1 -smtype 4 -smlv 25 -fs_max_steps 15 -fs_max_step_size 4 -fs_kap_tol 0 -fs_eig_max_iters 5 > fsai.out.117 +mpirun -np 4 ./ij -fromfile data/beam_tet_dof2475_np4/A.IJ -rhsfromfile data/beam_tet_dof2475_np4/b.IJ \ + -nf 3 -solver 1 -smtype 4 -smlv 25 > fsai.out.118 diff --git a/external/hypre/src/test/TEST_ij/fsai.saved b/external/hypre/src/test/TEST_ij/fsai.saved new file mode 100644 index 00000000..b677738f --- /dev/null +++ b/external/hypre/src/test/TEST_ij/fsai.saved @@ -0,0 +1,152 @@ +# Output file: fsai.out.0 +Iterations = 1 +Final Relative Residual Norm = 2.761185e-15 + +# Output file: fsai.out.1 +Iterations = 23 +Final Relative Residual Norm = 8.691352e-09 + +# Output file: fsai.out.2 +Iterations = 23 +Final Relative Residual Norm = 8.691352e-09 + +# Output file: fsai.out.3 +Iterations = 23 +Final Relative Residual Norm = 8.691352e-09 + +# Output file: fsai.out.4 +Iterations = 19 +Final Relative Residual Norm = 8.939605e-09 + +# Output file: fsai.out.5 +Iterations = 13 +Final Relative Residual Norm = 9.676517e-09 + +# Output file: fsai.out.6 +Iterations = 13 +Final Relative Residual Norm = 4.048616e-09 + +# Output file: fsai.out.7 +Iterations = 18 +Final Relative Residual Norm = 8.582135e-09 + +# Output file: fsai.out.8 +Iterations = 12 +Final Relative Residual Norm = 5.755183e-09 + +# Output file: fsai.out.9 +Iterations = 16 +Final Relative Residual Norm = 4.809895e-09 + +# Output file: fsai.out.10 +Iterations = 17 +Final Relative Residual Norm = 9.601188e-09 + +# Output file: fsai.out.11 +Iterations = 23 +Final Relative Residual Norm = 6.857102e-09 + +# Output file: fsai.out.12 +Iterations = 26 +Final Relative Residual Norm = 7.063015e-09 + +# Output file: fsai.out.13 +Iterations = 27 +Final Relative Residual Norm = 5.145896e-09 + +# Output file: fsai.out.14 +Iterations = 78 +Final Relative Residual Norm = 3.787505e-09 + +# Output file: fsai.out.15 +Iterations = 78 +Final Relative Residual Norm = 5.414675e-09 + +# Output file: fsai.out.16 +Iterations = 171 +Final Relative Residual Norm = 4.941318e-09 + +# Output file: fsai.out.17 +Iterations = 126 +Final Relative Residual Norm = 9.030852e-09 + +# Output file: fsai.out.18 +Iterations = 185 +Final Relative Residual Norm = 4.894088e-09 + +# Output file: fsai.out.100 +Iterations = 1 +Final Relative Residual Norm = 8.370817e-16 + +# Output file: fsai.out.101 +Iterations = 22 +Final Relative Residual Norm = 7.480945e-09 + +# Output file: fsai.out.102 +Iterations = 22 +Final Relative Residual Norm = 7.480945e-09 + +# Output file: fsai.out.103 +Iterations = 22 +Final Relative Residual Norm = 7.480945e-09 + +# Output file: fsai.out.104 +Iterations = 6 +Final Relative Residual Norm = 1.781486e-09 + +# Output file: fsai.out.105 +Iterations = 4 +Final Relative Residual Norm = 6.366437e-09 + +# Output file: fsai.out.106 +Iterations = 4 +Final Relative Residual Norm = 7.562368e-09 + +# Output file: fsai.out.107 +Iterations = 7 +Final Relative Residual Norm = 5.412177e-09 + +# Output file: fsai.out.108 +Iterations = 5 +Final Relative Residual Norm = 4.839232e-10 + +# Output file: fsai.out.109 +Iterations = 6 +Final Relative Residual Norm = 9.585043e-09 + +# Output file: fsai.out.110 +Iterations = 7 +Final Relative Residual Norm = 1.636774e-09 + +# Output file: fsai.out.111 +Iterations = 9 +Final Relative Residual Norm = 1.190776e-09 + +# Output file: fsai.out.112 +Iterations = 9 +Final Relative Residual Norm = 9.352486e-09 + +# Output file: fsai.out.113 +Iterations = 10 +Final Relative Residual Norm = 1.877799e-09 + +# Output file: fsai.out.114 +Iterations = 24 +Final Relative Residual Norm = 1.913199e-09 + +# Output file: fsai.out.115 +Iterations = 27 +Final Relative Residual Norm = 8.714453e-09 + +# Output file: fsai.out.116 +Iterations = 34 +Final Relative Residual Norm = 1.456606e-09 + +# Output file: fsai.out.117 +Iterations = 30 +Final Relative Residual Norm = 2.318909e-09 + +# Output file: fsai.out.118 +Iterations = 35 +Final Relative Residual Norm = 2.996819e-09 + diff --git a/external/hypre/src/test/TEST_ij/fsai.saved.aurora b/external/hypre/src/test/TEST_ij/fsai.saved.aurora new file mode 100644 index 00000000..bdb77378 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/fsai.saved.aurora @@ -0,0 +1,152 @@ +# Output file: fsai.out.0 +Iterations = 1 +Final Relative Residual Norm = 1.327968e-15 + +# Output file: fsai.out.1 +Iterations = 23 +Final Relative Residual Norm = 8.691352e-09 + +# Output file: fsai.out.2 +Iterations = 23 +Final Relative Residual Norm = 8.691352e-09 + +# Output file: fsai.out.3 +Iterations = 23 +Final Relative Residual Norm = 8.691352e-09 + +# Output file: fsai.out.4 +Iterations = 19 +Final Relative Residual Norm = 8.939605e-09 + +# Output file: fsai.out.5 +Iterations = 13 +Final Relative Residual Norm = 9.676517e-09 + +# Output file: fsai.out.6 +Iterations = 13 +Final Relative Residual Norm = 4.048616e-09 + +# Output file: fsai.out.7 +Iterations = 18 +Final Relative Residual Norm = 8.582135e-09 + +# Output file: fsai.out.8 +Iterations = 12 +Final Relative Residual Norm = 5.755183e-09 + +# Output file: fsai.out.9 +Iterations = 16 +Final Relative Residual Norm = 4.809895e-09 + +# Output file: fsai.out.10 +Iterations = 17 +Final Relative Residual Norm = 9.601188e-09 + +# Output file: fsai.out.11 +Iterations = 23 +Final Relative Residual Norm = 6.857102e-09 + +# Output file: fsai.out.12 +Iterations = 26 +Final Relative Residual Norm = 7.063015e-09 + +# Output file: fsai.out.13 +Iterations = 27 +Final Relative Residual Norm = 5.145896e-09 + +# Output file: fsai.out.14 +Iterations = 78 +Final Relative Residual Norm = 3.787405e-09 + +# Output file: fsai.out.15 +Iterations = 78 +Final Relative Residual Norm = 5.652639e-09 + +# Output file: fsai.out.16 +Iterations = 171 +Final Relative Residual Norm = 4.890543e-09 + +# Output file: fsai.out.17 +Iterations = 126 +Final Relative Residual Norm = 9.009656e-09 + +# Output file: fsai.out.18 +Iterations = 184 +Final Relative Residual Norm = 8.235568e-09 + +# Output file: fsai.out.100 +Iterations = 1 +Final Relative Residual Norm = 8.500568e-16 + +# Output file: fsai.out.101 +Iterations = 21 +Final Relative Residual Norm = 4.410327e-09 + +# Output file: fsai.out.102 +Iterations = 21 +Final Relative Residual Norm = 4.410327e-09 + +# Output file: fsai.out.103 +Iterations = 21 +Final Relative Residual Norm = 4.410327e-09 + +# Output file: fsai.out.104 +Iterations = 6 +Final Relative Residual Norm = 8.335263e-09 + +# Output file: fsai.out.105 +Iterations = 5 +Final Relative Residual Norm = 2.235485e-09 + +# Output file: fsai.out.106 +Iterations = 5 +Final Relative Residual Norm = 2.243140e-09 + +# Output file: fsai.out.107 +Iterations = 7 +Final Relative Residual Norm = 5.102038e-09 + +# Output file: fsai.out.108 +Iterations = 5 +Final Relative Residual Norm = 5.076365e-10 + +# Output file: fsai.out.109 +Iterations = 6 +Final Relative Residual Norm = 6.739539e-09 + +# Output file: fsai.out.110 +Iterations = 7 +Final Relative Residual Norm = 3.488908e-10 + +# Output file: fsai.out.111 +Iterations = 9 +Final Relative Residual Norm = 3.676980e-09 + +# Output file: fsai.out.112 +Iterations = 10 +Final Relative Residual Norm = 1.938122e-09 + +# Output file: fsai.out.113 +Iterations = 10 +Final Relative Residual Norm = 3.955283e-09 + +# Output file: fsai.out.114 +Iterations = 25 +Final Relative Residual Norm = 2.112909e-09 + +# Output file: fsai.out.115 +Iterations = 27 +Final Relative Residual Norm = 3.910858e-09 + +# Output file: fsai.out.116 +Iterations = 37 +Final Relative Residual Norm = 2.122027e-09 + +# Output file: fsai.out.117 +Iterations = 33 +Final Relative Residual Norm = 1.272242e-09 + +# Output file: fsai.out.118 +Iterations = 38 +Final Relative Residual Norm = 5.770945e-09 + diff --git a/external/hypre/src/test/TEST_ij/fsai.saved.lassen b/external/hypre/src/test/TEST_ij/fsai.saved.lassen new file mode 100644 index 00000000..47b4ae6f --- /dev/null +++ b/external/hypre/src/test/TEST_ij/fsai.saved.lassen @@ -0,0 +1,151 @@ +# Output file: fsai.out.0 +Iterations = 1 +Final Relative Residual Norm = 1.228129e-15 + +# Output file: fsai.out.1 +Iterations = 23 +Final Relative Residual Norm = 8.691352e-09 + +# Output file: fsai.out.2 +Iterations = 23 +Final Relative Residual Norm = 8.691352e-09 + +# Output file: fsai.out.3 +Iterations = 23 +Final Relative Residual Norm = 8.691352e-09 + +# Output file: fsai.out.4 +Iterations = 19 +Final Relative Residual Norm = 8.939605e-09 + +# Output file: fsai.out.5 +Iterations = 13 +Final Relative Residual Norm = 9.676493e-09 + +# Output file: fsai.out.6 +Iterations = 13 +Final Relative Residual Norm = 4.052388e-09 + +# Output file: fsai.out.7 +Iterations = 18 +Final Relative Residual Norm = 8.582135e-09 + +# Output file: fsai.out.8 +Iterations = 12 +Final Relative Residual Norm = 4.959354e-09 + +# Output file: fsai.out.9 +Iterations = 16 +Final Relative Residual Norm = 4.823866e-09 + +# Output file: fsai.out.10 +Iterations = 17 +Final Relative Residual Norm = 9.617105e-09 + +# Output file: fsai.out.11 +Iterations = 23 +Final Relative Residual Norm = 6.181709e-09 + +# Output file: fsai.out.12 +Iterations = 26 +Final Relative Residual Norm = 6.972951e-09 + +# Output file: fsai.out.13 +Iterations = 27 +Final Relative Residual Norm = 5.307599e-09 + +# Output file: fsai.out.14 +Iterations = 78 +Final Relative Residual Norm = 3.771847e-09 + +# Output file: fsai.out.15 +Iterations = 78 +Final Relative Residual Norm = 5.076820e-09 + +# Output file: fsai.out.16 +Iterations = 171 +Final Relative Residual Norm = 5.063815e-09 + +# Output file: fsai.out.17 +Iterations = 126 +Final Relative Residual Norm = 8.488999e-09 + +# Output file: fsai.out.18 +Iterations = 184 +Final Relative Residual Norm = 7.904808e-09 + +# Output file: fsai.out.100 +Iterations = 1 +Final Relative Residual Norm = 9.870376e-16 + +# Output file: fsai.out.101 +Iterations = 21 +Final Relative Residual Norm = 7.992635e-09 + +# Output file: fsai.out.102 +Iterations = 21 +Final Relative Residual Norm = 7.992635e-09 + +# Output file: fsai.out.103 +Iterations = 21 +Final Relative Residual Norm = 7.992635e-09 + +# Output file: fsai.out.104 +Iterations = 7 +Final Relative Residual Norm = 3.296684e-10 + +# Output file: fsai.out.105 +Iterations = 5 +Final Relative Residual Norm = 1.829167e-09 + +# Output file: fsai.out.106 +Iterations = 5 +Final Relative Residual Norm = 1.901994e-09 + +# Output file: fsai.out.107 +Iterations = 7 +Final Relative Residual Norm = 7.069461e-09 + +# Output file: fsai.out.108 +Iterations = 5 +Final Relative Residual Norm = 3.267638e-10 + +# Output file: fsai.out.109 +Iterations = 6 +Final Relative Residual Norm = 8.879422e-09 + +# Output file: fsai.out.110 +Iterations = 7 +Final Relative Residual Norm = 9.454511e-10 + +# Output file: fsai.out.111 +Iterations = 10 +Final Relative Residual Norm = 1.114164e-09 + +# Output file: fsai.out.112 +Iterations = 10 +Final Relative Residual Norm = 2.738091e-09 + +# Output file: fsai.out.113 +Iterations = 10 +Final Relative Residual Norm = 4.476226e-09 + +# Output file: fsai.out.114 +Iterations = 25 +Final Relative Residual Norm = 2.054687e-09 + +# Output file: fsai.out.115 +Iterations = 27 +Final Relative Residual Norm = 2.533347e-09 + +# Output file: fsai.out.116 +Iterations = 37 +Final Relative Residual Norm = 1.700494e-09 + +# Output file: fsai.out.117 +Iterations = 32 +Final Relative Residual Norm = 7.611745e-09 + +# Output file: fsai.out.118 +Iterations = 38 +Final Relative Residual Norm = 6.230831e-09 diff --git a/external/hypre/src/test/TEST_ij/fsai.saved.lassen_cpu b/external/hypre/src/test/TEST_ij/fsai.saved.lassen_cpu new file mode 100644 index 00000000..2ab95d28 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/fsai.saved.lassen_cpu @@ -0,0 +1,152 @@ +# Output file: fsai.out.0 +Iterations = 1 +Final Relative Residual Norm = 2.749303e-15 + +# Output file: fsai.out.1 +Iterations = 23 +Final Relative Residual Norm = 8.691352e-09 + +# Output file: fsai.out.2 +Iterations = 23 +Final Relative Residual Norm = 8.691352e-09 + +# Output file: fsai.out.3 +Iterations = 23 +Final Relative Residual Norm = 8.691352e-09 + +# Output file: fsai.out.4 +Iterations = 19 +Final Relative Residual Norm = 8.939605e-09 + +# Output file: fsai.out.5 +Iterations = 13 +Final Relative Residual Norm = 9.676493e-09 + +# Output file: fsai.out.6 +Iterations = 13 +Final Relative Residual Norm = 4.052388e-09 + +# Output file: fsai.out.7 +Iterations = 18 +Final Relative Residual Norm = 8.582135e-09 + +# Output file: fsai.out.8 +Iterations = 12 +Final Relative Residual Norm = 4.959354e-09 + +# Output file: fsai.out.9 +Iterations = 16 +Final Relative Residual Norm = 4.823866e-09 + +# Output file: fsai.out.10 +Iterations = 17 +Final Relative Residual Norm = 9.617105e-09 + +# Output file: fsai.out.11 +Iterations = 23 +Final Relative Residual Norm = 6.181709e-09 + +# Output file: fsai.out.12 +Iterations = 26 +Final Relative Residual Norm = 6.972951e-09 + +# Output file: fsai.out.13 +Iterations = 27 +Final Relative Residual Norm = 5.307599e-09 + +# Output file: fsai.out.14 +Iterations = 78 +Final Relative Residual Norm = 3.771384e-09 + +# Output file: fsai.out.15 +Iterations = 78 +Final Relative Residual Norm = 5.047449e-09 + +# Output file: fsai.out.16 +Iterations = 171 +Final Relative Residual Norm = 4.772278e-09 + +# Output file: fsai.out.17 +Iterations = 126 +Final Relative Residual Norm = 8.487749e-09 + +# Output file: fsai.out.18 +Iterations = 184 +Final Relative Residual Norm = 7.799267e-09 + +# Output file: fsai.out.100 +Iterations = 1 +Final Relative Residual Norm = 7.571037e-16 + +# Output file: fsai.out.101 +Iterations = 22 +Final Relative Residual Norm = 7.482225e-09 + +# Output file: fsai.out.102 +Iterations = 22 +Final Relative Residual Norm = 7.482225e-09 + +# Output file: fsai.out.103 +Iterations = 22 +Final Relative Residual Norm = 7.482225e-09 + +# Output file: fsai.out.104 +Iterations = 6 +Final Relative Residual Norm = 1.770040e-09 + +# Output file: fsai.out.105 +Iterations = 4 +Final Relative Residual Norm = 6.400389e-09 + +# Output file: fsai.out.106 +Iterations = 4 +Final Relative Residual Norm = 7.626472e-09 + +# Output file: fsai.out.107 +Iterations = 7 +Final Relative Residual Norm = 5.411192e-09 + +# Output file: fsai.out.108 +Iterations = 5 +Final Relative Residual Norm = 4.951758e-10 + +# Output file: fsai.out.109 +Iterations = 6 +Final Relative Residual Norm = 9.572177e-09 + +# Output file: fsai.out.110 +Iterations = 7 +Final Relative Residual Norm = 1.624844e-09 + +# Output file: fsai.out.111 +Iterations = 9 +Final Relative Residual Norm = 1.023579e-09 + +# Output file: fsai.out.112 +Iterations = 9 +Final Relative Residual Norm = 9.228804e-09 + +# Output file: fsai.out.113 +Iterations = 10 +Final Relative Residual Norm = 1.921603e-09 + +# Output file: fsai.out.114 +Iterations = 24 +Final Relative Residual Norm = 1.826448e-09 + +# Output file: fsai.out.115 +Iterations = 27 +Final Relative Residual Norm = 9.403460e-09 + +# Output file: fsai.out.116 +Iterations = 34 +Final Relative Residual Norm = 1.473745e-09 + +# Output file: fsai.out.117 +Iterations = 30 +Final Relative Residual Norm = 2.330513e-09 + +# Output file: fsai.out.118 +Iterations = 35 +Final Relative Residual Norm = 2.996136e-09 + diff --git a/external/hypre/src/test/TEST_ij/fsai.sh b/external/hypre/src/test/TEST_ij/fsai.sh new file mode 100755 index 00000000..61c0cd55 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/fsai.sh @@ -0,0 +1,67 @@ +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +TNAME=`basename $0 .sh` +RTOL=$1 +ATOL=$2 + +#============================================================================= +# compare with baseline case +#============================================================================= + +FILES="\ + ${TNAME}.out.0\ + ${TNAME}.out.1\ + ${TNAME}.out.2\ + ${TNAME}.out.3\ + ${TNAME}.out.4\ + ${TNAME}.out.5\ + ${TNAME}.out.6\ + ${TNAME}.out.7\ + ${TNAME}.out.8\ + ${TNAME}.out.9\ + ${TNAME}.out.10\ + ${TNAME}.out.11\ + ${TNAME}.out.12\ + ${TNAME}.out.13\ + ${TNAME}.out.14\ + ${TNAME}.out.15\ + ${TNAME}.out.16\ + ${TNAME}.out.17\ + ${TNAME}.out.18\ + ${TNAME}.out.100\ + ${TNAME}.out.101\ + ${TNAME}.out.102\ + ${TNAME}.out.103\ + ${TNAME}.out.104\ + ${TNAME}.out.105\ + ${TNAME}.out.106\ + ${TNAME}.out.107\ + ${TNAME}.out.108\ + ${TNAME}.out.109\ + ${TNAME}.out.110\ + ${TNAME}.out.111\ + ${TNAME}.out.112\ + ${TNAME}.out.113\ + ${TNAME}.out.114\ + ${TNAME}.out.115\ + ${TNAME}.out.116\ + ${TNAME}.out.117\ + ${TNAME}.out.118\ +" + +for i in $FILES +do + echo "# Output file: $i" + tail -3 $i +done > ${TNAME}.out + +# Make sure that the output file is reasonable +RUNCOUNT=`echo $FILES | wc -w` +OUTCOUNT=`grep "Iterations" ${TNAME}.out | wc -l` +if [ "$OUTCOUNT" != "$RUNCOUNT" ]; then + echo "Incorrect number of runs in ${TNAME}.out" >&2 +fi diff --git a/external/hypre/src/test/TEST_ij/ilu.jobs b/external/hypre/src/test/TEST_ij/ilu.jobs new file mode 100755 index 00000000..26c9dfc6 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/ilu.jobs @@ -0,0 +1,49 @@ +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +# +# hypre_ILU tests +# Tests ILU(0), ILUK and ILUK solvers sequentially +# Tests Parallel combination of ILU solvers +# Tests ILU-(Flex)GMRES +# Test AMG with ILU as a complex smoother +# +mpirun -np 1 ./ij -solver 80 -ilu_type 0 -ilu_lfil 0 > ilu.out.300 +mpirun -np 1 ./ij -solver 80 -ilu_type 0 -ilu_lfil 1 > ilu.out.301 +mpirun -np 1 ./ij -solver 80 -ilu_type 1 -ilu_droptol 1.0e-2 -ilu_max_row_nnz 1000 > ilu.out.302 +# parallel ILU +# BJ +mpirun -np 2 ./ij -solver 80 -ilu_type 0 -ilu_lfil 1 > ilu.out.303 +mpirun -np 2 ./ij -solver 80 -ilu_type 1 -ilu_droptol 1.0e-2 -ilu_max_row_nnz 1000 > ilu.out.304 +# GMRES+ILU +mpirun -np 2 ./ij -solver 80 -ilu_type 10 -ilu_lfil 1 -ilu_schur_max_iter 5 > ilu.out.305 +mpirun -np 2 ./ij -solver 80 -ilu_type 11 -ilu_droptol 1.0e-2 -ilu_max_row_nnz 1000 -ilu_schur_max_iter 5 > ilu.out.306 +# NSH+ILU +mpirun -np 2 ./ij -solver 80 -ilu_type 20 -ilu_lfil 1 -ilu_schur_max_iter 5 > ilu.out.307 +mpirun -np 2 ./ij -solver 80 -ilu_type 21 -ilu_droptol 1.0e-2 -ilu_max_row_nnz 1000 -ilu_schur_max_iter 5 > ilu.out.308 +# RAS+ILU +mpirun -np 2 ./ij -solver 80 -ilu_type 30 -ilu_lfil 1 > ilu.out.309 +mpirun -np 2 ./ij -solver 80 -ilu_type 31 -ilu_droptol 1.0e-2 -ilu_max_row_nnz 1000 > ilu.out.310 +# ddPQ-GMRES+ILU +mpirun -np 2 ./ij -solver 80 -ilu_type 40 -ilu_lfil 1 -ilu_schur_max_iter 5 > ilu.out.311 +mpirun -np 2 ./ij -solver 80 -ilu_type 41 -ilu_droptol 1.0e-2 -ilu_max_row_nnz 1000 -ilu_schur_max_iter 5 > ilu.out.312 +## ILU-GMRES +mpirun -np 2 ./ij -solver 81 -ilu_type 0 -ilu_lfil 0 > ilu.out.313 +mpirun -np 2 ./ij -solver 81 -ilu_type 1 -ilu_droptol 1.0e-2 -ilu_max_row_nnz 1000 > ilu.out.314 +mpirun -np 2 ./ij -solver 81 -ilu_type 30 -ilu_lfil 0 > ilu.out.315 +mpirun -np 2 ./ij -solver 81 -ilu_type 31 -ilu_droptol 1.0e-2 -ilu_max_row_nnz 1000 > ilu.out.316 +## ILU-FlexGMRES +mpirun -np 2 ./ij -solver 82 -ilu_type 10 -ilu_lfil 0 -ilu_schur_max_iter 5 > ilu.out.317 +mpirun -np 2 ./ij -solver 82 -ilu_type 11 -ilu_droptol 1.0e-2 -ilu_max_row_nnz 1000 -ilu_schur_max_iter 5 > ilu.out.318 +mpirun -np 2 ./ij -solver 82 -ilu_type 20 -ilu_lfil 0 -ilu_schur_max_iter 5 > ilu.out.319 +mpirun -np 2 ./ij -solver 82 -ilu_type 21 -ilu_droptol 1.0e-2 -ilu_max_row_nnz 1000 -ilu_schur_max_iter 5 > ilu.out.320 +mpirun -np 2 ./ij -solver 82 -ilu_type 40 -ilu_lfil 0 -ilu_schur_max_iter 5 > ilu.out.321 +mpirun -np 2 ./ij -solver 82 -ilu_type 41 -ilu_droptol 1.0e-2 -ilu_max_row_nnz 1000 -ilu_schur_max_iter 5 > ilu.out.322 +## RAP-ILU +mpirun -np 2 ./ij -solver 82 -ilu_type 50 -ilu_lfil 0 > ilu.out.323 +## ILU smoother for AMG +mpirun -np 2 ./ij -solver 0 -smtype 5 -smlv 1 -ilu_type 30 > ilu.out.324 +mpirun -np 2 ./ij -solver 0 -smtype 15 -smlv 1 -ilu_type 30 > ilu.out.325 diff --git a/external/hypre/src/test/TEST_ij/ilu.saved b/external/hypre/src/test/TEST_ij/ilu.saved new file mode 100644 index 00000000..c71674c4 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/ilu.saved @@ -0,0 +1,104 @@ +# Output file: solvers.out.300 +hypre_ILU Iterations = 85 +Final Relative Residual Norm = 9.266244e-09 + +# Output file: solvers.out.301 +hypre_ILU Iterations = 40 +Final Relative Residual Norm = 9.772377e-09 + +# Output file: solvers.out.302 +hypre_ILU Iterations = 23 +Final Relative Residual Norm = 5.512717e-09 + +# Output file: solvers.out.303 +hypre_ILU Iterations = 64 +Final Relative Residual Norm = 8.558467e-09 + +# Output file: solvers.out.304 +hypre_ILU Iterations = 52 +Final Relative Residual Norm = 9.189235e-09 + +# Output file: solvers.out.305 +hypre_ILU Iterations = 38 +Final Relative Residual Norm = 7.024121e-09 + +# Output file: solvers.out.306 +hypre_ILU Iterations = 26 +Final Relative Residual Norm = 7.556742e-09 + +# Output file: solvers.out.307 +hypre_ILU Iterations = 38 +Final Relative Residual Norm = 7.037599e-09 + +# Output file: solvers.out.308 +hypre_ILU Iterations = 26 +Final Relative Residual Norm = 7.593126e-09 + +# Output file: solvers.out.309 +hypre_ILU Iterations = 49 +Final Relative Residual Norm = 7.072947e-09 + +# Output file: solvers.out.310 +hypre_ILU Iterations = 42 +Final Relative Residual Norm = 6.699477e-09 + +# Output file: solvers.out.311 +hypre_ILU Iterations = 36 +Final Relative Residual Norm = 6.392185e-09 + +# Output file: solvers.out.312 +hypre_ILU Iterations = 24 +Final Relative Residual Norm = 5.953652e-09 + +# Output file: solvers.out.313 +GMRES Iterations = 25 +Final GMRES Relative Residual Norm = 3.968804e-09 + +# Output file: solvers.out.314 +GMRES Iterations = 19 +Final GMRES Relative Residual Norm = 7.026446e-09 + +# Output file: solvers.out.315 +GMRES Iterations = 20 +Final GMRES Relative Residual Norm = 7.908624e-09 + +# Output file: solvers.out.316 +GMRES Iterations = 13 +Final GMRES Relative Residual Norm = 7.969372e-09 + +# Output file: solvers.out.317 +FlexGMRES Iterations = 17 +Final FlexGMRES Relative Residual Norm = 9.152443e-09 + +# Output file: solvers.out.318 +FlexGMRES Iterations = 9 +Final FlexGMRES Relative Residual Norm = 5.768785e-09 + +# Output file: solvers.out.319 +FlexGMRES Iterations = 17 +Final FlexGMRES Relative Residual Norm = 9.133102e-09 + +# Output file: solvers.out.320 +FlexGMRES Iterations = 9 +Final FlexGMRES Relative Residual Norm = 6.299457e-09 + +# Output file: solvers.out.321 +FlexGMRES Iterations = 17 +Final FlexGMRES Relative Residual Norm = 4.489256e-09 + +# Output file: solvers.out.322 +FlexGMRES Iterations = 8 +Final FlexGMRES Relative Residual Norm = 3.082447e-09 + +# Output file: solvers.out.323 +FlexGMRES Iterations = 18 +Final FlexGMRES Relative Residual Norm = 4.133851e-09 + +# Output file: solvers.out.324 +BoomerAMG Iterations = 8 +Final Relative Residual Norm = 8.380440e-09 + +# Output file: solvers.out.325 +BoomerAMG Iterations = 7 +Final Relative Residual Norm = 7.074639e-09 + diff --git a/external/hypre/src/test/TEST_ij/ilu.saved.aurora b/external/hypre/src/test/TEST_ij/ilu.saved.aurora new file mode 100644 index 00000000..5bf054d2 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/ilu.saved.aurora @@ -0,0 +1,104 @@ +# Output file: ilu.out.300 +hypre_ILU Iterations = 85 +Final Relative Residual Norm = 9.266245e-09 + +# Output file: ilu.out.301 +hypre_ILU Iterations = 40 +Final Relative Residual Norm = 9.772377e-09 + +# Output file: ilu.out.302 +hypre_ILU Iterations = 23 +Final Relative Residual Norm = 5.512717e-09 + +# Output file: ilu.out.303 +hypre_ILU Iterations = 64 +Final Relative Residual Norm = 8.558468e-09 + +# Output file: ilu.out.304 +hypre_ILU Iterations = 52 +Final Relative Residual Norm = 9.189235e-09 + +# Output file: ilu.out.305 +hypre_ILU Iterations = 39 +Final Relative Residual Norm = 8.838452e-09 + +# Output file: ilu.out.306 +hypre_ILU Iterations = 27 +Final Relative Residual Norm = 6.194020e-09 + +# Output file: ilu.out.307 +hypre_ILU Iterations = 39 +Final Relative Residual Norm = 6.866281e-09 + +# Output file: ilu.out.308 +hypre_ILU Iterations = 27 +Final Relative Residual Norm = 9.107681e-09 + +# Output file: ilu.out.309 +hypre_ILU Iterations = 49 +Final Relative Residual Norm = 7.072947e-09 + +# Output file: ilu.out.310 +hypre_ILU Iterations = 42 +Final Relative Residual Norm = 6.699477e-09 + +# Output file: ilu.out.311 +hypre_ILU Iterations = 36 +Final Relative Residual Norm = 6.392185e-09 + +# Output file: ilu.out.312 +hypre_ILU Iterations = 24 +Final Relative Residual Norm = 5.953652e-09 + +# Output file: ilu.out.313 +GMRES Iterations = 25 +Final GMRES Relative Residual Norm = 3.968804e-09 + +# Output file: ilu.out.314 +GMRES Iterations = 19 +Final GMRES Relative Residual Norm = 7.026445e-09 + +# Output file: ilu.out.315 +GMRES Iterations = 20 +Final GMRES Relative Residual Norm = 7.908624e-09 + +# Output file: ilu.out.316 +GMRES Iterations = 13 +Final GMRES Relative Residual Norm = 7.969372e-09 + +# Output file: ilu.out.317 +FlexGMRES Iterations = 17 +Final FlexGMRES Relative Residual Norm = 7.140004e-09 + +# Output file: ilu.out.318 +FlexGMRES Iterations = 9 +Final FlexGMRES Relative Residual Norm = 9.362787e-09 + +# Output file: ilu.out.319 +FlexGMRES Iterations = 17 +Final FlexGMRES Relative Residual Norm = 8.299377e-09 + +# Output file: ilu.out.320 +FlexGMRES Iterations = 9 +Final FlexGMRES Relative Residual Norm = 3.716965e-09 + +# Output file: ilu.out.321 +FlexGMRES Iterations = 17 +Final FlexGMRES Relative Residual Norm = 4.489256e-09 + +# Output file: ilu.out.322 +FlexGMRES Iterations = 8 +Final FlexGMRES Relative Residual Norm = 3.082447e-09 + +# Output file: ilu.out.323 +FlexGMRES Iterations = 18 +Final FlexGMRES Relative Residual Norm = 3.782082e-09 + +# Output file: ilu.out.324 +BoomerAMG Iterations = 10 +Final Relative Residual Norm = 7.955485e-09 + +# Output file: ilu.out.325 +BoomerAMG Iterations = 9 +Final Relative Residual Norm = 2.327436e-09 + diff --git a/external/hypre/src/test/TEST_ij/ilu.saved.lassen b/external/hypre/src/test/TEST_ij/ilu.saved.lassen new file mode 100644 index 00000000..ba77e785 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/ilu.saved.lassen @@ -0,0 +1,104 @@ +# Output file: solvers.out.300 +hypre_ILU Iterations = 85 +Final Relative Residual Norm = 9.266244e-09 + +# Output file: solvers.out.301 +hypre_ILU Iterations = 40 +Final Relative Residual Norm = 9.772377e-09 + +# Output file: solvers.out.302 +hypre_ILU Iterations = 23 +Final Relative Residual Norm = 5.512717e-09 + +# Output file: solvers.out.303 +hypre_ILU Iterations = 64 +Final Relative Residual Norm = 8.558467e-09 + +# Output file: solvers.out.304 +hypre_ILU Iterations = 52 +Final Relative Residual Norm = 9.189235e-09 + +# Output file: solvers.out.305 +hypre_ILU Iterations = 39 +Final Relative Residual Norm = 8.838452e-09 + +# Output file: solvers.out.306 +hypre_ILU Iterations = 27 +Final Relative Residual Norm = 6.194020e-09 + +# Output file: solvers.out.307 +hypre_ILU Iterations = 39 +Final Relative Residual Norm = 6.866281e-09 + +# Output file: solvers.out.308 +hypre_ILU Iterations = 27 +Final Relative Residual Norm = 9.107681e-09 + +# Output file: solvers.out.309 +hypre_ILU Iterations = 49 +Final Relative Residual Norm = 7.072947e-09 + +# Output file: solvers.out.310 +hypre_ILU Iterations = 42 +Final Relative Residual Norm = 6.699477e-09 + +# Output file: solvers.out.311 +hypre_ILU Iterations = 35 +Final Relative Residual Norm = 6.392185e-09 + +# Output file: solvers.out.312 +hypre_ILU Iterations = 23 +Final Relative Residual Norm = 5.953652e-09 + +# Output file: solvers.out.313 +GMRES Iterations = 25 +Final GMRES Relative Residual Norm = 3.968804e-09 + +# Output file: solvers.out.314 +GMRES Iterations = 19 +Final GMRES Relative Residual Norm = 7.026445e-09 + +# Output file: solvers.out.315 +GMRES Iterations = 20 +Final GMRES Relative Residual Norm = 7.908624e-09 + +# Output file: solvers.out.316 +GMRES Iterations = 13 +Final GMRES Relative Residual Norm = 7.969372e-09 + +# Output file: solvers.out.317 +FlexGMRES Iterations = 17 +Final FlexGMRES Relative Residual Norm = 7.140004e-09 + +# Output file: solvers.out.318 +FlexGMRES Iterations = 9 +Final FlexGMRES Relative Residual Norm = 9.362787e-09 + +# Output file: solvers.out.319 +FlexGMRES Iterations = 17 +Final FlexGMRES Relative Residual Norm = 8.299377e-09 + +# Output file: solvers.out.320 +FlexGMRES Iterations = 9 +Final FlexGMRES Relative Residual Norm = 3.716965e-09 + +# Output file: solvers.out.321 +FlexGMRES Iterations = 17 +Final FlexGMRES Relative Residual Norm = 4.489256e-09 + +# Output file: solvers.out.322 +FlexGMRES Iterations = 9 +Final FlexGMRES Relative Residual Norm = 3.082447e-09 + +# Output file: solvers.out.323 +FlexGMRES Iterations = 18 +Final FlexGMRES Relative Residual Norm = 3.782082e-09 + +# Output file: solvers.out.324 +BoomerAMG Iterations = 11 +Final Relative Residual Norm = 3.641397e-09 + +# Output file: solvers.out.325 +BoomerAMG Iterations = 9 +Final Relative Residual Norm = 3.551558e-09 + diff --git a/external/hypre/src/test/TEST_ij/ilu.saved.lassen_cpu b/external/hypre/src/test/TEST_ij/ilu.saved.lassen_cpu new file mode 100644 index 00000000..7384d8e8 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/ilu.saved.lassen_cpu @@ -0,0 +1,104 @@ +# Output file: ilu.out.300 +hypre_ILU Iterations = 85 +Final Relative Residual Norm = 9.266244e-09 + +# Output file: ilu.out.301 +hypre_ILU Iterations = 40 +Final Relative Residual Norm = 9.772377e-09 + +# Output file: ilu.out.302 +hypre_ILU Iterations = 23 +Final Relative Residual Norm = 5.512717e-09 + +# Output file: ilu.out.303 +hypre_ILU Iterations = 64 +Final Relative Residual Norm = 8.558467e-09 + +# Output file: ilu.out.304 +hypre_ILU Iterations = 52 +Final Relative Residual Norm = 9.189235e-09 + +# Output file: ilu.out.305 +hypre_ILU Iterations = 38 +Final Relative Residual Norm = 7.024121e-09 + +# Output file: ilu.out.306 +hypre_ILU Iterations = 26 +Final Relative Residual Norm = 7.556742e-09 + +# Output file: ilu.out.307 +hypre_ILU Iterations = 38 +Final Relative Residual Norm = 7.037599e-09 + +# Output file: ilu.out.308 +hypre_ILU Iterations = 26 +Final Relative Residual Norm = 7.593126e-09 + +# Output file: ilu.out.309 +hypre_ILU Iterations = 49 +Final Relative Residual Norm = 7.072947e-09 + +# Output file: ilu.out.310 +hypre_ILU Iterations = 42 +Final Relative Residual Norm = 6.699477e-09 + +# Output file: ilu.out.311 +hypre_ILU Iterations = 36 +Final Relative Residual Norm = 6.392185e-09 + +# Output file: ilu.out.312 +hypre_ILU Iterations = 24 +Final Relative Residual Norm = 5.953652e-09 + +# Output file: ilu.out.313 +GMRES Iterations = 25 +Final GMRES Relative Residual Norm = 3.968804e-09 + +# Output file: ilu.out.314 +GMRES Iterations = 19 +Final GMRES Relative Residual Norm = 7.026446e-09 + +# Output file: ilu.out.315 +GMRES Iterations = 20 +Final GMRES Relative Residual Norm = 7.908624e-09 + +# Output file: ilu.out.316 +GMRES Iterations = 13 +Final GMRES Relative Residual Norm = 7.969372e-09 + +# Output file: ilu.out.317 +FlexGMRES Iterations = 17 +Final FlexGMRES Relative Residual Norm = 9.152443e-09 + +# Output file: ilu.out.318 +FlexGMRES Iterations = 9 +Final FlexGMRES Relative Residual Norm = 5.768784e-09 + +# Output file: ilu.out.319 +FlexGMRES Iterations = 17 +Final FlexGMRES Relative Residual Norm = 9.133102e-09 + +# Output file: ilu.out.320 +FlexGMRES Iterations = 9 +Final FlexGMRES Relative Residual Norm = 6.299457e-09 + +# Output file: ilu.out.321 +FlexGMRES Iterations = 17 +Final FlexGMRES Relative Residual Norm = 4.489256e-09 + +# Output file: ilu.out.322 +FlexGMRES Iterations = 8 +Final FlexGMRES Relative Residual Norm = 3.082447e-09 + +# Output file: ilu.out.323 +FlexGMRES Iterations = 18 +Final FlexGMRES Relative Residual Norm = 4.133851e-09 + +# Output file: ilu.out.324 +BoomerAMG Iterations = 8 +Final Relative Residual Norm = 8.314480e-09 + +# Output file: ilu.out.325 +BoomerAMG Iterations = 7 +Final Relative Residual Norm = 7.035763e-09 + diff --git a/external/hypre/src/test/TEST_ij/ilu.sh b/external/hypre/src/test/TEST_ij/ilu.sh new file mode 100755 index 00000000..df64a4dc --- /dev/null +++ b/external/hypre/src/test/TEST_ij/ilu.sh @@ -0,0 +1,56 @@ +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +TNAME=`basename $0 .sh` +RTOL=$1 +ATOL=$2 + +FILES="\ + ${TNAME}.out.300\ + ${TNAME}.out.301\ + ${TNAME}.out.302\ + ${TNAME}.out.303\ + ${TNAME}.out.304\ + ${TNAME}.out.305\ + ${TNAME}.out.306\ + ${TNAME}.out.307\ + ${TNAME}.out.308\ + ${TNAME}.out.309\ + ${TNAME}.out.310\ + ${TNAME}.out.311\ + ${TNAME}.out.312\ + ${TNAME}.out.313\ + ${TNAME}.out.314\ + ${TNAME}.out.315\ + ${TNAME}.out.316\ + ${TNAME}.out.317\ + ${TNAME}.out.318\ + ${TNAME}.out.319\ + ${TNAME}.out.320\ + ${TNAME}.out.321\ + ${TNAME}.out.322\ + ${TNAME}.out.323\ + ${TNAME}.out.324\ + ${TNAME}.out.325\ +" + +for i in $FILES +do + echo "# Output file: $i" + tail -3 $i +done > ${TNAME}.out + +# Make sure that the output file is reasonable +RUNCOUNT=`echo $FILES | wc -w` +OUTCOUNT=`grep "Iterations" ${TNAME}.out | wc -l` +if [ "$OUTCOUNT" != "$RUNCOUNT" ]; then + echo "Incorrect number of runs in ${TNAME}.out" >&2 +fi + +#============================================================================= +# remove temporary files +#============================================================================= + diff --git a/external/hypre/src/test/TEST_ij/interp.jobs b/external/hypre/src/test/TEST_ij/interp.jobs old mode 100644 new mode 100755 index d525778f..a704b601 --- a/external/hypre/src/test/TEST_ij/interp.jobs +++ b/external/hypre/src/test/TEST_ij/interp.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -44,4 +44,14 @@ mpirun -np 4 ./ij -rhsrand -n 15 15 10 -P 2 2 1 -interptype 16 -Pmx 12 \ mpirun -np 4 ./ij -rhsrand -n 15 15 10 -P 2 2 1 -interptype 17 \ > interp.out.8 +mpirun -np 4 ./ij -rhsrand -n 8 8 8 -sysL 2 -nf 2 -interptype 15 \ + > interp.out.9 +mpirun -np 4 ./ij -rhsrand -n 8 8 8 -sysL 2 -nf 2 -interptype 16 \ + > interp.out.10 + +mpirun -np 4 ./ij -rhsrand -n 8 8 8 -sysL 2 -nf 2 -interptype 17 \ + > interp.out.11 + +mpirun -np 4 ./ij -rhsrand -n 8 8 8 -sysL 2 -nf 2 -interptype 18 \ + > interp.out.12 diff --git a/external/hypre/src/test/TEST_ij/interp.saved b/external/hypre/src/test/TEST_ij/interp.saved index 8c2a926e..0fb2fa5a 100644 --- a/external/hypre/src/test/TEST_ij/interp.saved +++ b/external/hypre/src/test/TEST_ij/interp.saved @@ -61,3 +61,30 @@ operator = 2.681224 cycle = 5.360748 +# Output file: interp.out.9 + Average Convergence Factor = 0.522598 + + Complexity: grid = 1.489258 + operator = 2.126953 + cycle = 4.251953 + +# Output file: interp.out.10 + Average Convergence Factor = 0.467057 + + Complexity: grid = 1.474609 + operator = 2.478906 + cycle = 4.957109 + +# Output file: interp.out.11 + Average Convergence Factor = 0.423068 + + Complexity: grid = 1.478516 + operator = 2.503750 + cycle = 5.005547 + +# Output file: interp.out.12 + Average Convergence Factor = 0.428721 + + Complexity: grid = 1.479492 + operator = 2.506016 + cycle = 5.010078 diff --git a/external/hypre/src/test/TEST_ij/interp.saved.aurora b/external/hypre/src/test/TEST_ij/interp.saved.aurora new file mode 100644 index 00000000..3defe781 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/interp.saved.aurora @@ -0,0 +1,91 @@ +# Output file: interp.out.0 + Average Convergence Factor = 0.473381 + + Complexity: grid = 1.397778 + operator = 3.521837 + cycle = 7.043061 + +# Output file: interp.out.1 + Average Convergence Factor = 0.474675 + + Complexity: grid = 1.400444 + operator = 3.456939 + cycle = 6.912177 + +# Output file: interp.out.2 + Average Convergence Factor = 0.472783 + + Complexity: grid = 1.398667 + operator = 3.508095 + cycle = 7.015102 + +# Output file: interp.out.3 + Average Convergence Factor = 0.469524 + + Complexity: grid = 1.410222 + operator = 2.566327 + cycle = 5.131565 + +# Output file: interp.out.4 + Average Convergence Factor = 0.474961 + + Complexity: grid = 1.409778 + operator = 2.539456 + cycle = 5.075578 + +# Output file: interp.out.5 + Average Convergence Factor = 0.484045 + + Complexity: grid = 1.403111 + operator = 2.556667 + cycle = 5.113061 + +# Output file: interp.out.6 + Average Convergence Factor = 0.284534 + + Complexity: grid = 1.716889 + operator = 3.594082 + cycle = 7.186463 + +# Output file: interp.out.7 + Average Convergence Factor = 0.508605 + + Complexity: grid = 1.412889 + operator = 3.766871 + cycle = 7.531293 + +# Output file: interp.out.8 + Average Convergence Factor = 0.469524 + + Complexity: grid = 1.410222 + operator = 2.566327 + cycle = 5.131565 + +# Output file: interp.out.9 + Average Convergence Factor = 0.795761 + + Complexity: grid = 1.460938 + operator = 2.152031 + cycle = 4.303359 + +# Output file: interp.out.10 + Average Convergence Factor = 0.795949 + + Complexity: grid = 1.447266 + operator = 2.585625 + cycle = 5.170547 + +# Output file: interp.out.11 + Average Convergence Factor = 0.764146 + + Complexity: grid = 1.429688 + operator = 2.505000 + cycle = 5.005000 + +# Output file: interp.out.12 + Average Convergence Factor = 0.764224 + + Complexity: grid = 1.429688 + operator = 2.502813 + cycle = 5.000625 + diff --git a/external/hypre/src/test/TEST_ij/interp.saved.lassen b/external/hypre/src/test/TEST_ij/interp.saved.lassen index 834391cc..6fc8c9bf 100644 --- a/external/hypre/src/test/TEST_ij/interp.saved.lassen +++ b/external/hypre/src/test/TEST_ij/interp.saved.lassen @@ -20,25 +20,25 @@ cycle = 7.073741 # Output file: interp.out.3 - Average Convergence Factor = 0.465899 + Average Convergence Factor = 0.467056 - Complexity: grid = 1.412889 - operator = 2.571633 - cycle = 5.142177 + Complexity: grid = 1.408889 + operator = 2.556327 + cycle = 5.110952 # Output file: interp.out.4 - Average Convergence Factor = 0.467607 + Average Convergence Factor = 0.468315 - Complexity: grid = 1.409778 - operator = 2.547347 - cycle = 5.094082 + Complexity: grid = 1.406667 + operator = 2.531361 + cycle = 5.062109 # Output file: interp.out.5 - Average Convergence Factor = 0.486364 + Average Convergence Factor = 0.482765 - Complexity: grid = 1.402222 - operator = 2.533810 - cycle = 5.066531 + Complexity: grid = 1.404444 + operator = 2.561361 + cycle = 5.122109 # Output file: interp.out.6 Average Convergence Factor = 0.284534 @@ -55,9 +55,36 @@ cycle = 7.536871 # Output file: interp.out.8 - Average Convergence Factor = 0.465899 + Average Convergence Factor = 0.467056 - Complexity: grid = 1.412889 - operator = 2.571633 - cycle = 5.142177 + Complexity: grid = 1.408889 + operator = 2.556327 + cycle = 5.110952 +# Output file: interp.out.9 + Average Convergence Factor = 0.790196 + + Complexity: grid = 1.487305 + operator = 2.181797 + cycle = 4.363281 + +# Output file: interp.out.10 + Average Convergence Factor = 0.797378 + + Complexity: grid = 1.471680 + operator = 2.534453 + cycle = 5.068203 + +# Output file: interp.out.11 + Average Convergence Factor = 0.767811 + + Complexity: grid = 1.469727 + operator = 2.535234 + cycle = 5.070156 + +# Output file: interp.out.12 + Average Convergence Factor = 0.767716 + + Complexity: grid = 1.465820 + operator = 2.527891 + cycle = 5.049453 diff --git a/external/hypre/src/test/TEST_ij/interp.saved.lassen_cpu b/external/hypre/src/test/TEST_ij/interp.saved.lassen_cpu new file mode 100644 index 00000000..21ffacf8 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/interp.saved.lassen_cpu @@ -0,0 +1,90 @@ +# Output file: interp.out.0 + Average Convergence Factor = 0.199088 + + Complexity: grid = 1.571556 + operator = 2.973333 + cycle = 5.944218 + +# Output file: interp.out.1 + Average Convergence Factor = 0.197964 + + Complexity: grid = 1.580000 + operator = 2.885102 + cycle = 5.765850 + +# Output file: interp.out.2 + Average Convergence Factor = 0.181048 + + Complexity: grid = 1.572889 + operator = 2.983469 + cycle = 5.966327 + +# Output file: interp.out.3 + Average Convergence Factor = 0.194064 + + Complexity: grid = 1.587556 + operator = 2.683946 + cycle = 5.365442 + +# Output file: interp.out.4 + Average Convergence Factor = 0.195128 + + Complexity: grid = 1.588444 + operator = 2.627483 + cycle = 5.252517 + +# Output file: interp.out.5 + Average Convergence Factor = 0.203480 + + Complexity: grid = 1.582667 + operator = 2.662245 + cycle = 5.324218 + +# Output file: interp.out.6 + Average Convergence Factor = 0.166090 + + Complexity: grid = 1.713333 + operator = 3.541020 + cycle = 7.080340 + +# Output file: interp.out.7 + Average Convergence Factor = 0.219604 + + Complexity: grid = 1.571556 + operator = 2.958639 + cycle = 5.916190 + +# Output file: interp.out.8 + Average Convergence Factor = 0.194359 + + Complexity: grid = 1.586667 + operator = 2.681224 + cycle = 5.360748 + +# Output file: interp.out.9 + Average Convergence Factor = 0.522598 + + Complexity: grid = 1.489258 + operator = 2.126953 + cycle = 4.251953 + +# Output file: interp.out.10 + Average Convergence Factor = 0.467547 + + Complexity: grid = 1.472656 + operator = 2.464844 + cycle = 4.928984 + +# Output file: interp.out.11 + Average Convergence Factor = 0.423068 + + Complexity: grid = 1.478516 + operator = 2.503750 + cycle = 5.005547 + +# Output file: interp.out.12 + Average Convergence Factor = 0.428721 + + Complexity: grid = 1.479492 + operator = 2.506016 + cycle = 5.010078 diff --git a/external/hypre/src/test/TEST_ij/interp.saved.ray b/external/hypre/src/test/TEST_ij/interp.saved.ray deleted file mode 100644 index 834391cc..00000000 --- a/external/hypre/src/test/TEST_ij/interp.saved.ray +++ /dev/null @@ -1,63 +0,0 @@ -# Output file: interp.out.0 - Average Convergence Factor = 0.468023 - - Complexity: grid = 1.400000 - operator = 3.557007 - cycle = 7.113401 - -# Output file: interp.out.1 - Average Convergence Factor = 0.468239 - - Complexity: grid = 1.401778 - operator = 3.477007 - cycle = 6.952313 - -# Output file: interp.out.2 - Average Convergence Factor = 0.472049 - - Complexity: grid = 1.399111 - operator = 3.537415 - cycle = 7.073741 - -# Output file: interp.out.3 - Average Convergence Factor = 0.465899 - - Complexity: grid = 1.412889 - operator = 2.571633 - cycle = 5.142177 - -# Output file: interp.out.4 - Average Convergence Factor = 0.467607 - - Complexity: grid = 1.409778 - operator = 2.547347 - cycle = 5.094082 - -# Output file: interp.out.5 - Average Convergence Factor = 0.486364 - - Complexity: grid = 1.402222 - operator = 2.533810 - cycle = 5.066531 - -# Output file: interp.out.6 - Average Convergence Factor = 0.284534 - - Complexity: grid = 1.716889 - operator = 3.594082 - cycle = 7.186463 - -# Output file: interp.out.7 - Average Convergence Factor = 0.486438 - - Complexity: grid = 1.411556 - operator = 3.768980 - cycle = 7.536871 - -# Output file: interp.out.8 - Average Convergence Factor = 0.465899 - - Complexity: grid = 1.412889 - operator = 2.571633 - cycle = 5.142177 - diff --git a/external/hypre/src/test/TEST_ij/interp.sh b/external/hypre/src/test/TEST_ij/interp.sh old mode 100644 new mode 100755 index 235a2298..c82954be --- a/external/hypre/src/test/TEST_ij/interp.sh +++ b/external/hypre/src/test/TEST_ij/interp.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -22,6 +22,10 @@ FILES="\ ${TNAME}.out.6\ ${TNAME}.out.7\ ${TNAME}.out.8\ + ${TNAME}.out.9\ + ${TNAME}.out.10\ + ${TNAME}.out.11\ + ${TNAME}.out.12\ " for i in $FILES diff --git a/external/hypre/src/test/TEST_ij/io.jobs b/external/hypre/src/test/TEST_ij/io.jobs new file mode 100755 index 00000000..dcd36240 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/io.jobs @@ -0,0 +1,71 @@ +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +#============================================================================= +# IJ input tests - Sequential +#============================================================================= + +mpirun -np 1 ./ij -solver 2 -tol 1e-2 \ + -frombinfile data/poisson_10x10x10_np1/IJ.A.i4f8 \ + -rhsfrombinfile data/poisson_10x10x10_np1/IJ.b.i4f8 \ + -x0frombinfile data/poisson_10x10x10_np1/IJ.x0.i4f8 > io.out.0 + +mpirun -np 1 ./ij -solver 2 -tol 1e-2 \ + -frombinfile data/poisson_10x10x10_np1/IJ.A.i8f8 \ + -rhsfrombinfile data/poisson_10x10x10_np1/IJ.b.i8f8 \ + -x0frombinfile data/poisson_10x10x10_np1/IJ.x0.i8f8 > io.out.1 + +mpirun -np 1 ./ij -solver 2 -tol 1e-2 \ + -frombinfile data/poisson_10x10x10_np1/IJ.A.i4f4 \ + -rhsfrombinfile data/poisson_10x10x10_np1/IJ.b.i4f4 \ + -x0frombinfile data/poisson_10x10x10_np1/IJ.x0.i4f4 > io.out.2 + +mpirun -np 1 ./ij -solver 2 -tol 1e-2 \ + -frombinfile data/poisson_10x10x10_np1/IJ.A.i8f4 \ + -rhsfrombinfile data/poisson_10x10x10_np1/IJ.b.i8f4 \ + -x0frombinfile data/poisson_10x10x10_np1/IJ.x0.i8f4 > io.out.3 + +#============================================================================= +# IJ output tests - Sequential +#============================================================================= + +mpirun -np 1 ./ij -solver 2 -tol 1e-2 -printbin > io.out.50 +mpirun -np 1 ./ij -solver 2 -tol 1e-2 -printbin \ + -frombinfile IJ.out.A -rhsfrombinfile IJ.out.b \ + -x0frombinfile IJ.out.x0 > io.out.51 + +#============================================================================= +# IJ input tests - Parallel +#============================================================================= + +mpirun -np 4 ./ij -solver 2 -tol 1e-2 \ + -frombinfile data/poisson_10x10x10_np4/IJ.A.i4f8 \ + -rhsfrombinfile data/poisson_10x10x10_np4/IJ.b.i4f8 \ + -x0frombinfile data/poisson_10x10x10_np4/IJ.x0.i4f8 > io.out.100 + +mpirun -np 4 ./ij -solver 2 -tol 1e-2 \ + -frombinfile data/poisson_10x10x10_np4/IJ.A.i8f8 \ + -rhsfrombinfile data/poisson_10x10x10_np4/IJ.b.i8f8 \ + -x0frombinfile data/poisson_10x10x10_np4/IJ.x0.i8f8 > io.out.101 + +mpirun -np 4 ./ij -solver 2 -tol 1e-2 \ + -frombinfile data/poisson_10x10x10_np4/IJ.A.i4f4 \ + -rhsfrombinfile data/poisson_10x10x10_np4/IJ.b.i4f4 \ + -x0frombinfile data/poisson_10x10x10_np4/IJ.x0.i4f4 > io.out.102 + +mpirun -np 4 ./ij -solver 2 -tol 1e-2 \ + -frombinfile data/poisson_10x10x10_np4/IJ.A.i8f4 \ + -rhsfrombinfile data/poisson_10x10x10_np4/IJ.b.i8f4 \ + -x0frombinfile data/poisson_10x10x10_np4/IJ.x0.i8f4 > io.out.103 + +#============================================================================= +# IJ output tests - Sequential +#============================================================================= + +mpirun -np 4 ./ij -solver 2 -tol 1e-2 -printbin > io.out.150 +mpirun -np 4 ./ij -solver 2 -tol 1e-2 -printbin \ + -frombinfile IJ.out.A -rhsfrombinfile IJ.out.b \ + -x0frombinfile IJ.out.x0 > io.out.151 diff --git a/external/hypre/src/test/TEST_ij/io.saved b/external/hypre/src/test/TEST_ij/io.saved new file mode 100644 index 00000000..92c2ceac --- /dev/null +++ b/external/hypre/src/test/TEST_ij/io.saved @@ -0,0 +1,47 @@ +# Output file: solvers.out.0 +Iterations = 11 +Final Relative Residual Norm = 6.733697e-03 + +# Output file: solvers.out.1 +Iterations = 11 +Final Relative Residual Norm = 6.733697e-03 + +# Output file: solvers.out.2 +Iterations = 11 +Final Relative Residual Norm = 6.733697e-03 + +# Output file: solvers.out.3 +Iterations = 11 +Final Relative Residual Norm = 6.733697e-03 + +# Output file: solvers.out.50 +Iterations = 11 +Final Relative Residual Norm = 6.733697e-03 + +# Output file: solvers.out.51 +Iterations = 11 +Final Relative Residual Norm = 6.733697e-03 + +# Output file: solvers.out.100 +Iterations = 11 +Final Relative Residual Norm = 6.733697e-03 + +# Output file: solvers.out.101 +Iterations = 11 +Final Relative Residual Norm = 6.733697e-03 + +# Output file: solvers.out.102 +Iterations = 11 +Final Relative Residual Norm = 6.733697e-03 + +# Output file: solvers.out.103 +Iterations = 11 +Final Relative Residual Norm = 6.733697e-03 + +# Output file: solvers.out.150 +Iterations = 11 +Final Relative Residual Norm = 6.733697e-03 + +# Output file: solvers.out.151 +Iterations = 11 +Final Relative Residual Norm = 6.733697e-03 diff --git a/external/hypre/src/test/TEST_ij/io.sh b/external/hypre/src/test/TEST_ij/io.sh new file mode 100755 index 00000000..922556ad --- /dev/null +++ b/external/hypre/src/test/TEST_ij/io.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +TNAME=`basename $0 .sh` +RTOL=$1 +ATOL=$2 + +FILES="\ + ${TNAME}.out.0\ + ${TNAME}.out.1\ + ${TNAME}.out.2\ + ${TNAME}.out.3\ + ${TNAME}.out.50\ + ${TNAME}.out.51\ + ${TNAME}.out.100\ + ${TNAME}.out.101\ + ${TNAME}.out.102\ + ${TNAME}.out.103\ + ${TNAME}.out.150\ + ${TNAME}.out.151\ +" + +for i in $FILES +do + echo "# Output file: $i" + tail -3 $i +done > ${TNAME}.out + +# Make sure that the output file is reasonable +RUNCOUNT=`echo $FILES | wc -w` +OUTCOUNT=`grep "Iterations" ${TNAME}.out | wc -l` +if [ "$OUTCOUNT" != "$RUNCOUNT" ]; then + echo "Incorrect number of runs in ${TNAME}.out" >&2 +fi + +#============================================================================= +# remove temporary files +#============================================================================= + +rm -rf IJ.out.A.0000?.bin IJ.out.b.0000?.bin IJ.out.x0.0000?.bin IJ.out.x.0000?.bin diff --git a/external/hypre/src/test/TEST_ij/lazy.jobs b/external/hypre/src/test/TEST_ij/lazy.jobs new file mode 100755 index 00000000..a7c7045e --- /dev/null +++ b/external/hypre/src/test/TEST_ij/lazy.jobs @@ -0,0 +1,16 @@ +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +#============================================================================= +# Test library lazy initialization (sequential and parallel) +#============================================================================= + +mpirun -np 1 ./ij > lazy.out.1.a +mpirun -np 1 ./ij -lazy_device_init 1 > lazy.out.1.b + +mpirun -np 4 ./ij > lazy.out.2.a +mpirun -np 4 ./ij -lazy_device_init 1 > lazy.out.2.b + diff --git a/external/hypre/src/test/TEST_ij/lazy.sh b/external/hypre/src/test/TEST_ij/lazy.sh new file mode 100755 index 00000000..6fe3822b --- /dev/null +++ b/external/hypre/src/test/TEST_ij/lazy.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +TNAME=`basename $0 .sh` + +tail -3 ${TNAME}.out.1.a | head -2 > ${TNAME}.testdata +tail -3 ${TNAME}.out.1.b | head -2 > ${TNAME}.testdata.temp + +# Abuse HYPRE_NO_SAVED to skip the following diff with OMP +if [ -z $HYPRE_NO_SAVED ]; then + diff ${TNAME}.testdata ${TNAME}.testdata.temp >&2 +fi + +tail -3 ${TNAME}.out.2.a | head -2 > ${TNAME}.testdata +tail -3 ${TNAME}.out.2.b | head -2 > ${TNAME}.testdata.temp + +# Abuse HYPRE_NO_SAVED to skip the following diff with OMP +if [ -z $HYPRE_NO_SAVED ]; then + diff ${TNAME}.testdata ${TNAME}.testdata.temp >&2 +fi + +#============================================================================= +# remove temporary files +#============================================================================= + +rm -f ${TNAME}.testdata* diff --git a/external/hypre/src/test/TEST_ij/matrix.jobs b/external/hypre/src/test/TEST_ij/matrix.jobs old mode 100644 new mode 100755 index 902651d8..9658073f --- a/external/hypre/src/test/TEST_ij/matrix.jobs +++ b/external/hypre/src/test/TEST_ij/matrix.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -33,3 +33,25 @@ mpirun -np 2 ./ij -test_ij -solver 2 -tol 0 -max_iter 5 -chunk 1 -omp 1 > matrix mpirun -np 3 ./ij -fromfile test.A -rhsfromfile test.b > matrix.out.11 mpirun -np 2 ./ij -test_ij -solver 2 -tol 0 -max_iter 5 -chunk 1 -add 1 -check_constant 1 > matrix.out.12 + +#============================================================================= +# Test matrix scaling. Solver: BJ-GMRES +#============================================================================= + +# Sequential - Left scaling +mpirun -np 1 ./ij -fromfile data/beam_tet_dof459_np1/A.IJ -solver 4 -tol 1e-2 -k 100 -test_scaling 1 > matrix.out.100 + +# Sequential - Right scaling +mpirun -np 1 ./ij -fromfile data/beam_tet_dof459_np1/A.IJ -solver 4 -tol 1e-2 -k 100 -test_scaling 2 > matrix.out.101 + +# Sequential - Left and right scaling +mpirun -np 1 ./ij -fromfile data/beam_tet_dof459_np1/A.IJ -solver 4 -tol 1e-2 -k 100 -test_scaling 3 > matrix.out.102 + +# Parallel - Left scaling +mpirun -np 4 ./ij -fromfile data/beam_tet_dof2475_np4/A.IJ -solver 4 -tol 9e-1 -k 100 -test_scaling 1 > matrix.out.110 + +# Parallel - Right scaling +mpirun -np 4 ./ij -fromfile data/beam_tet_dof2475_np4/A.IJ -solver 4 -tol 9e-1 -k 100 -test_scaling 2 > matrix.out.111 + +# Parallel - Left and right scaling +mpirun -np 4 ./ij -fromfile data/beam_tet_dof2475_np4/A.IJ -solver 4 -tol 9e-1 -k 100 -test_scaling 3 > matrix.out.112 diff --git a/external/hypre/src/test/TEST_ij/matrix.saved b/external/hypre/src/test/TEST_ij/matrix.saved index 0dc9e2c9..ff6bd0c7 100644 --- a/external/hypre/src/test/TEST_ij/matrix.saved +++ b/external/hypre/src/test/TEST_ij/matrix.saved @@ -50,3 +50,26 @@ Final Relative Residual Norm = 2.638706e-09 Iterations = 5 Final Relative Residual Norm = 3.515462e-01 +# Output file: matrix.out.100 +GMRES Iterations = 79 +Final GMRES Relative Residual Norm = 9.996735e-03 + +# Output file: matrix.out.101 +GMRES Iterations = 79 +Final GMRES Relative Residual Norm = 7.176706e-03 + +# Output file: matrix.out.102 +GMRES Iterations = 74 +Final GMRES Relative Residual Norm = 7.155117e-03 + +# Output file: matrix.out.110 +GMRES Iterations = 13 +Final GMRES Relative Residual Norm = 8.997992e-01 + +# Output file: matrix.out.111 +GMRES Iterations = 35 +Final GMRES Relative Residual Norm = 8.909955e-01 + +# Output file: matrix.out.112 +GMRES Iterations = 6 +Final GMRES Relative Residual Norm = 8.963555e-01 \ No newline at end of file diff --git a/external/hypre/src/test/TEST_ij/matrix.saved.ray b/external/hypre/src/test/TEST_ij/matrix.saved.aurora similarity index 54% rename from external/hypre/src/test/TEST_ij/matrix.saved.ray rename to external/hypre/src/test/TEST_ij/matrix.saved.aurora index 46ff169c..1865584e 100644 --- a/external/hypre/src/test/TEST_ij/matrix.saved.ray +++ b/external/hypre/src/test/TEST_ij/matrix.saved.aurora @@ -1,14 +1,14 @@ # Output file: matrix.out.0 -BoomerAMG Iterations = 25 -Final Relative Residual Norm = 5.900046e-09 +BoomerAMG Iterations = 24 +Final Relative Residual Norm = 6.703514e-09 # Output file: matrix.out.1 -BoomerAMG Iterations = 25 -Final Relative Residual Norm = 5.900046e-09 +BoomerAMG Iterations = 24 +Final Relative Residual Norm = 6.703514e-09 # Output file: matrix.out.2 -BoomerAMG Iterations = 25 -Final Relative Residual Norm = 5.900046e-09 +BoomerAMG Iterations = 24 +Final Relative Residual Norm = 6.703514e-09 # Output file: matrix.out.3 BoomerAMG Iterations = 1 @@ -50,3 +50,27 @@ Final Relative Residual Norm = 3.055519e-09 Iterations = 5 Final Relative Residual Norm = 3.515462e-01 +# Output file: matrix.out.100 +GMRES Iterations = 79 +Final GMRES Relative Residual Norm = 9.996735e-03 + +# Output file: matrix.out.101 +GMRES Iterations = 79 +Final GMRES Relative Residual Norm = 7.176706e-03 + +# Output file: matrix.out.102 +GMRES Iterations = 74 +Final GMRES Relative Residual Norm = 7.155117e-03 + +# Output file: matrix.out.110 +GMRES Iterations = 13 +Final GMRES Relative Residual Norm = 8.997992e-01 + +# Output file: matrix.out.111 +GMRES Iterations = 35 +Final GMRES Relative Residual Norm = 8.909955e-01 + +# Output file: matrix.out.112 +GMRES Iterations = 6 +Final GMRES Relative Residual Norm = 8.963555e-01 + diff --git a/external/hypre/src/test/TEST_ij/matrix.saved.lassen b/external/hypre/src/test/TEST_ij/matrix.saved.lassen index 46ff169c..fb90f62a 100644 --- a/external/hypre/src/test/TEST_ij/matrix.saved.lassen +++ b/external/hypre/src/test/TEST_ij/matrix.saved.lassen @@ -1,14 +1,14 @@ # Output file: matrix.out.0 -BoomerAMG Iterations = 25 -Final Relative Residual Norm = 5.900046e-09 +BoomerAMG Iterations = 23 +Final Relative Residual Norm = 8.600534e-09 # Output file: matrix.out.1 -BoomerAMG Iterations = 25 -Final Relative Residual Norm = 5.900046e-09 +BoomerAMG Iterations = 23 +Final Relative Residual Norm = 8.600534e-09 # Output file: matrix.out.2 -BoomerAMG Iterations = 25 -Final Relative Residual Norm = 5.900046e-09 +BoomerAMG Iterations = 23 +Final Relative Residual Norm = 8.600534e-09 # Output file: matrix.out.3 BoomerAMG Iterations = 1 @@ -50,3 +50,26 @@ Final Relative Residual Norm = 3.055519e-09 Iterations = 5 Final Relative Residual Norm = 3.515462e-01 +# Output file: matrix.out.100 +GMRES Iterations = 79 +Final GMRES Relative Residual Norm = 9.996735e-03 + +# Output file: matrix.out.101 +GMRES Iterations = 79 +Final GMRES Relative Residual Norm = 7.176706e-03 + +# Output file: matrix.out.102 +GMRES Iterations = 74 +Final GMRES Relative Residual Norm = 7.155117e-03 + +# Output file: matrix.out.110 +GMRES Iterations = 13 +Final GMRES Relative Residual Norm = 8.997992e-01 + +# Output file: matrix.out.111 +GMRES Iterations = 35 +Final GMRES Relative Residual Norm = 8.909955e-01 + +# Output file: matrix.out.112 +GMRES Iterations = 6 +Final GMRES Relative Residual Norm = 8.963555e-01 diff --git a/external/hypre/src/test/TEST_ij/matrix.saved.lassen_cpu b/external/hypre/src/test/TEST_ij/matrix.saved.lassen_cpu new file mode 100644 index 00000000..924ae733 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/matrix.saved.lassen_cpu @@ -0,0 +1,75 @@ +# Output file: matrix.out.0 +BoomerAMG Iterations = 11 +Final Relative Residual Norm = 4.156373e-09 + +# Output file: matrix.out.1 +BoomerAMG Iterations = 11 +Final Relative Residual Norm = 4.156373e-09 + +# Output file: matrix.out.2 +BoomerAMG Iterations = 11 +Final Relative Residual Norm = 4.156373e-09 + +# Output file: matrix.out.3 +BoomerAMG Iterations = 1 +Final Relative Residual Norm = 0.000000e+00 + +# Output file: matrix.out.4 +Iterations = 5 +Final Relative Residual Norm = 3.515462e-01 + +# Output file: matrix.out.5 +Iterations = 5 +Final Relative Residual Norm = 4.233149e-01 + +# Output file: matrix.out.6 +Iterations = 5 +Final Relative Residual Norm = 3.515462e-01 + +# Output file: matrix.out.7 +Iterations = 5 +Final Relative Residual Norm = 3.515462e-01 + +# Output file: matrix.out.8 +Iterations = 5 +Final Relative Residual Norm = 4.233149e-01 + +# Output file: matrix.out.9 +Iterations = 5 +Final Relative Residual Norm = 3.515462e-01 + +# Output file: matrix.out.10 +Iterations = 5 +Final Relative Residual Norm = 3.515462e-01 + +# Output file: matrix.out.11 +BoomerAMG Iterations = 8 +Final Relative Residual Norm = 2.638706e-09 + +# Output file: matrix.out.12 +Iterations = 5 +Final Relative Residual Norm = 3.515462e-01 + +# Output file: matrix.out.100 +GMRES Iterations = 79 +Final GMRES Relative Residual Norm = 9.996735e-03 + +# Output file: matrix.out.101 +GMRES Iterations = 79 +Final GMRES Relative Residual Norm = 7.176706e-03 + +# Output file: matrix.out.102 +GMRES Iterations = 74 +Final GMRES Relative Residual Norm = 7.155117e-03 + +# Output file: matrix.out.110 +GMRES Iterations = 13 +Final GMRES Relative Residual Norm = 8.997992e-01 + +# Output file: matrix.out.111 +GMRES Iterations = 35 +Final GMRES Relative Residual Norm = 8.909955e-01 + +# Output file: matrix.out.112 +GMRES Iterations = 6 +Final GMRES Relative Residual Norm = 8.963555e-01 diff --git a/external/hypre/src/test/TEST_ij/matrix.sh b/external/hypre/src/test/TEST_ij/matrix.sh old mode 100644 new mode 100755 index 59b04eb0..7fb4c112 --- a/external/hypre/src/test/TEST_ij/matrix.sh +++ b/external/hypre/src/test/TEST_ij/matrix.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -42,6 +42,12 @@ FILES="\ ${TNAME}.out.10\ ${TNAME}.out.11\ ${TNAME}.out.12\ + ${TNAME}.out.100\ + ${TNAME}.out.101\ + ${TNAME}.out.102\ + ${TNAME}.out.110\ + ${TNAME}.out.111\ + ${TNAME}.out.112\ " for i in $FILES diff --git a/external/hypre/src/test/TEST_ij/nonmixedint.jobs b/external/hypre/src/test/TEST_ij/nonmixedint.jobs old mode 100644 new mode 100755 index ea7d414f..53475888 --- a/external/hypre/src/test/TEST_ij/nonmixedint.jobs +++ b/external/hypre/src/test/TEST_ij/nonmixedint.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_ij/nonmixedint.saved.ray b/external/hypre/src/test/TEST_ij/nonmixedint.saved.aurora similarity index 85% rename from external/hypre/src/test/TEST_ij/nonmixedint.saved.ray rename to external/hypre/src/test/TEST_ij/nonmixedint.saved.aurora index 6fe9cfce..c24f8ac7 100644 --- a/external/hypre/src/test/TEST_ij/nonmixedint.saved.ray +++ b/external/hypre/src/test/TEST_ij/nonmixedint.saved.aurora @@ -1,6 +1,6 @@ # Output file: nonmixedint.out.0 BoomerAMG Iterations = 18 -Final Relative Residual Norm = 5.361427e-09 +Final Relative Residual Norm = 4.636260e-09 # Output file: nonmixedint.out.1 GMRES Iterations = 32 diff --git a/external/hypre/src/test/TEST_ij/nonmixedint.saved.lassen b/external/hypre/src/test/TEST_ij/nonmixedint.saved.lassen index 6fe9cfce..c24f8ac7 100644 --- a/external/hypre/src/test/TEST_ij/nonmixedint.saved.lassen +++ b/external/hypre/src/test/TEST_ij/nonmixedint.saved.lassen @@ -1,6 +1,6 @@ # Output file: nonmixedint.out.0 BoomerAMG Iterations = 18 -Final Relative Residual Norm = 5.361427e-09 +Final Relative Residual Norm = 4.636260e-09 # Output file: nonmixedint.out.1 GMRES Iterations = 32 diff --git a/external/hypre/src/test/TEST_ij/nonmixedint.saved.lassen_cpu b/external/hypre/src/test/TEST_ij/nonmixedint.saved.lassen_cpu new file mode 100644 index 00000000..14f073b9 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/nonmixedint.saved.lassen_cpu @@ -0,0 +1,12 @@ +# Output file: nonmixedint.out.0 +BoomerAMG Iterations = 16 +Final Relative Residual Norm = 3.804106e-09 + +# Output file: nonmixedint.out.1 +GMRES Iterations = 32 +Final GMRES Relative Residual Norm = 6.756785e-09 + +# Output file: nonmixedint.out.2 +Iterations = 22 +Final Relative Residual Norm = 9.936851e-09 + diff --git a/external/hypre/src/test/TEST_ij/nonmixedint.sh b/external/hypre/src/test/TEST_ij/nonmixedint.sh old mode 100644 new mode 100755 index 5481ea7b..326e0522 --- a/external/hypre/src/test/TEST_ij/nonmixedint.sh +++ b/external/hypre/src/test/TEST_ij/nonmixedint.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_ij/posneg.jobs b/external/hypre/src/test/TEST_ij/posneg.jobs new file mode 100755 index 00000000..a1f0a91f --- /dev/null +++ b/external/hypre/src/test/TEST_ij/posneg.jobs @@ -0,0 +1,17 @@ +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +## Solve Ax=b and -Ax=b, convergence should be the same +mpirun -np 2 ./ij -solver 0 -rhsrand -negA 0 > posneg.out.400.p +mpirun -np 2 ./ij -solver 0 -rhsrand -negA 1 > posneg.out.400.n +mpirun -np 3 ./ij -solver 3 -rhsrand -negA 0 > posneg.out.401.p +mpirun -np 3 ./ij -solver 3 -rhsrand -negA 1 > posneg.out.401.n +mpirun -np 4 ./ij -cheby_eig_est 10 -cheby_order 4 -cheby_variant 0 -cheby_scale 1 -rlx 16 -negA 0 > posneg.out.402.p +mpirun -np 4 ./ij -cheby_eig_est 10 -cheby_order 4 -cheby_variant 0 -cheby_scale 1 -rlx 16 -negA 1 > posneg.out.402.n +mpirun -np 4 ./ij -solver 3 -cheby_eig_est 0 -cheby_order 3 -cheby_variant 1 -cheby_scale 1 -rlx 16 -negA 0 > posneg.out.403.p +mpirun -np 4 ./ij -solver 3 -cheby_eig_est 0 -cheby_order 3 -cheby_variant 1 -cheby_scale 1 -rlx 16 -negA 1 > posneg.out.403.n + + diff --git a/external/hypre/src/test/TEST_ij/posneg.sh b/external/hypre/src/test/TEST_ij/posneg.sh new file mode 100755 index 00000000..85918e04 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/posneg.sh @@ -0,0 +1,46 @@ +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +TNAME=`basename $0 .sh` + +tail -3 ${TNAME}.out.400.p | head -2 > ${TNAME}.testdata +tail -3 ${TNAME}.out.400.n | head -2 > ${TNAME}.testdata.temp + +# Abuse HYPRE_NO_SAVED to skip the following diff with OMP +if [ -z $HYPRE_NO_SAVED ]; then + diff ${TNAME}.testdata ${TNAME}.testdata.temp >&2 +fi + +tail -3 ${TNAME}.out.401.p | head -2 > ${TNAME}.testdata +tail -3 ${TNAME}.out.401.n | head -2 > ${TNAME}.testdata.temp + +# Abuse HYPRE_NO_SAVED to skip the following diff with OMP +if [ -z $HYPRE_NO_SAVED ]; then + diff ${TNAME}.testdata ${TNAME}.testdata.temp >&2 +fi + +tail -3 ${TNAME}.out.402.p | head -2 > ${TNAME}.testdata +tail -3 ${TNAME}.out.402.n | head -2 > ${TNAME}.testdata.temp + +# Abuse HYPRE_NO_SAVED to skip the following diff with OMP +if [ -z $HYPRE_NO_SAVED ]; then + diff ${TNAME}.testdata ${TNAME}.testdata.temp >&2 +fi + +tail -3 ${TNAME}.out.403.p | head -2 > ${TNAME}.testdata +tail -3 ${TNAME}.out.403.n | head -2 > ${TNAME}.testdata.temp + +# Abuse HYPRE_NO_SAVED to skip the following diff with OMP +if [ -z $HYPRE_NO_SAVED ]; then + diff ${TNAME}.testdata ${TNAME}.testdata.temp >&2 +fi + +#============================================================================= +# remove temporary files +#============================================================================= + +rm -f ${TNAME}.testdata* + diff --git a/external/hypre/src/test/TEST_ij/smoother.jobs b/external/hypre/src/test/TEST_ij/smoother.jobs old mode 100644 new mode 100755 index c2fc2a23..96df376b --- a/external/hypre/src/test/TEST_ij/smoother.jobs +++ b/external/hypre/src/test/TEST_ij/smoother.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -63,6 +63,12 @@ mpirun -np 3 ./ij -rhsrand -n 15 30 10 -rlx 18 \ mpirun -np 4 ./ij -rhsrand -solver 1 -rlx 8 -n 20 20 10 -P 2 2 1 \ > smoother.out.11 +mpirun -np 4 ./ij -rhsrand -solver 1 -rlx 88 -n 20 20 10 -P 2 2 1 \ +> smoother.out.11.1 + +mpirun -np 4 ./ij -rhsrand -solver 1 -rlx 89 -n 20 20 10 -P 2 2 1 \ +> smoother.out.11.2 + mpirun -np 4 ./ij -rhsrand -solver 1 -rlx 16 -n 20 20 10 -P 2 2 1 \ > smoother.out.12 diff --git a/external/hypre/src/test/TEST_ij/smoother.saved b/external/hypre/src/test/TEST_ij/smoother.saved index f7a782b0..495f061c 100644 --- a/external/hypre/src/test/TEST_ij/smoother.saved +++ b/external/hypre/src/test/TEST_ij/smoother.saved @@ -40,7 +40,7 @@ Final Relative Residual Norm = 5.359205e-09 # Output file: smoother.out.7 BoomerAMG Iterations = 18 -Final Relative Residual Norm = 7.334920e-09 +Final Relative Residual Norm = 7.334921e-09 # Output file: smoother.out.8 BoomerAMG Iterations = 11 @@ -58,13 +58,21 @@ Final Relative Residual Norm = 8.254191e-09 Iterations = 6 Final Relative Residual Norm = 2.509163e-09 +# Output file: smoother.out.11.1 +Iterations = 6 +Final Relative Residual Norm = 2.881634e-09 + +# Output file: smoother.out.11.2 +Iterations = 6 +Final Relative Residual Norm = 3.877871e-10 + # Output file: smoother.out.12 Iterations = 6 -Final Relative Residual Norm = 2.510138e-09 +Final Relative Residual Norm = 2.510130e-09 # Output file: smoother.out.13 Iterations = 5 -Final Relative Residual Norm = 6.702216e-09 +Final Relative Residual Norm = 6.702200e-09 # Output file: smoother.out.14 Iterations = 6 diff --git a/external/hypre/src/test/TEST_ij/smoother.saved.aurora b/external/hypre/src/test/TEST_ij/smoother.saved.aurora new file mode 100644 index 00000000..4f8f9db0 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/smoother.saved.aurora @@ -0,0 +1,120 @@ +# Output file: smoother.out.0 + Average Convergence Factor = 0.431523 + + Complexity: grid = 1.421333 + operator = 2.629966 + cycle = 5.257845 + +# Output file: smoother.out.1 + Average Convergence Factor = 0.110961 + + Complexity: grid = 1.410222 + operator = 2.566327 + cycle = 5.131565 + +# Output file: smoother.out.2 + Average Convergence Factor = 0.212015 + + Complexity: grid = 1.391500 + operator = 2.577045 + cycle = 5.153750 + +# Output file: smoother.out.3 + Average Convergence Factor = 0.412913 + + Complexity: grid = 1.391500 + operator = 2.577045 + cycle = 5.153750 + +# Output file: smoother.out.4 +Iterations = 7 +Final Relative Residual Norm = 1.278668e-09 + +# Output file: smoother.out.5 +BoomerAMG Iterations = 15 +Final Relative Residual Norm = 5.891292e-09 + +# Output file: smoother.out.6 +Iterations = 12 +Final Relative Residual Norm = 2.096851e-09 + +# Output file: smoother.out.7 +BoomerAMG Iterations = 26 +Final Relative Residual Norm = 6.720942e-09 + +# Output file: smoother.out.8 +BoomerAMG Iterations = 16 +Final Relative Residual Norm = 5.214696e-09 + +# Output file: smoother.out.9 +BoomerAMG Iterations = 21 +Final Relative Residual Norm = 6.303936e-09 + +# Output file: smoother.out.10 +BoomerAMG Iterations = 25 +Final Relative Residual Norm = 7.215178e-09 + +# Output file: smoother.out.11 +Iterations = 6 +Final Relative Residual Norm = 9.298524e-09 + +# Output file: smoother.out.11.1 +Iterations = 7 +Final Relative Residual Norm = 5.260748e-10 + +# Output file: smoother.out.11.2 +Iterations = 6 +Final Relative Residual Norm = 2.206219e-09 + +# Output file: smoother.out.12 +Iterations = 7 +Final Relative Residual Norm = 8.196976e-10 + +# Output file: smoother.out.13 +Iterations = 6 +Final Relative Residual Norm = 1.773257e-09 + +# Output file: smoother.out.14 +Iterations = 7 +Final Relative Residual Norm = 2.271932e-09 + +# Output file: smoother.out.15 +Iterations = 11 +Final Relative Residual Norm = 3.586129e-09 + +# Output file: smoother.out.16 +Iterations = 6 +Final Relative Residual Norm = 1.304969e-09 + +# Output file: smoother.out.17 +Iterations = 8 +Final Relative Residual Norm = 9.180516e-10 + +# Output file: smoother.out.18 +GMRES Iterations = 11 +Final GMRES Relative Residual Norm = 4.221402e-09 + +# Output file: smoother.out.19 +Iterations = 8 +Final Relative Residual Norm = 8.108092e-10 + +# Output file: smoother.out.20 +Iterations = 12 +Final Relative Residual Norm = 1.470318e-09 + +# Output file: smoother.out.21 +Iterations = 8 +Final Relative Residual Norm = 7.703209e-09 + +# Output file: smoother.out.22 +Iterations = 8 +Final Relative Residual Norm = 5.187397e-09 + +# Output file: smoother.out.23 +Iterations = 9 +Final Relative Residual Norm = 1.766467e-09 + +# Output file: smoother.out.24 +Iterations = 9 +Final Relative Residual Norm = 4.371789e-09 + diff --git a/external/hypre/src/test/TEST_ij/smoother.saved.lassen b/external/hypre/src/test/TEST_ij/smoother.saved.lassen index 1534fc1d..58b1d360 100644 --- a/external/hypre/src/test/TEST_ij/smoother.saved.lassen +++ b/external/hypre/src/test/TEST_ij/smoother.saved.lassen @@ -1,34 +1,34 @@ # Output file: smoother.out.0 - Average Convergence Factor = 0.430612 + Average Convergence Factor = 0.431493 - Complexity: grid = 1.404222 - operator = 2.596532 - cycle = 5.191852 + Complexity: grid = 1.408000 + operator = 2.614613 + cycle = 5.228687 # Output file: smoother.out.1 - Average Convergence Factor = 0.109467 + Average Convergence Factor = 0.113256 - Complexity: grid = 1.412889 - operator = 2.571633 - cycle = 5.142177 + Complexity: grid = 1.408889 + operator = 2.556327 + cycle = 5.110952 # Output file: smoother.out.2 - Average Convergence Factor = 0.213961 + Average Convergence Factor = 0.224466 - Complexity: grid = 1.403750 - operator = 2.592614 - cycle = 5.183864 + Complexity: grid = 1.405000 + operator = 2.599848 + cycle = 5.197424 # Output file: smoother.out.3 - Average Convergence Factor = 0.412622 + Average Convergence Factor = 0.421413 - Complexity: grid = 1.403750 - operator = 2.592614 - cycle = 5.183864 + Complexity: grid = 1.405000 + operator = 2.599848 + cycle = 5.197424 # Output file: smoother.out.4 Iterations = 7 -Final Relative Residual Norm = 1.757560e-09 +Final Relative Residual Norm = 1.555935e-09 # Output file: smoother.out.5 BoomerAMG Iterations = 16 @@ -36,77 +36,85 @@ Final Relative Residual Norm = 5.453527e-09 # Output file: smoother.out.6 Iterations = 12 -Final Relative Residual Norm = 2.762490e-09 +Final Relative Residual Norm = 2.566134e-09 # Output file: smoother.out.7 -BoomerAMG Iterations = 26 -Final Relative Residual Norm = 5.404255e-09 +BoomerAMG Iterations = 25 +Final Relative Residual Norm = 7.315253e-09 # Output file: smoother.out.8 BoomerAMG Iterations = 17 -Final Relative Residual Norm = 3.896878e-09 +Final Relative Residual Norm = 4.008618e-09 # Output file: smoother.out.9 BoomerAMG Iterations = 21 -Final Relative Residual Norm = 5.872644e-09 +Final Relative Residual Norm = 5.801823e-09 # Output file: smoother.out.10 BoomerAMG Iterations = 25 -Final Relative Residual Norm = 6.780708e-09 +Final Relative Residual Norm = 7.183351e-09 # Output file: smoother.out.11 Iterations = 7 -Final Relative Residual Norm = 4.597200e-10 +Final Relative Residual Norm = 5.165447e-10 + +# Output file: smoother.out.11.1 +Iterations = 7 +Final Relative Residual Norm = 7.894184e-10 + +# Output file: smoother.out.11.2 +Iterations = 6 +Final Relative Residual Norm = 2.796467e-09 # Output file: smoother.out.12 Iterations = 7 -Final Relative Residual Norm = 1.208193e-09 +Final Relative Residual Norm = 1.029948e-09 # Output file: smoother.out.13 Iterations = 6 -Final Relative Residual Norm = 2.719926e-09 +Final Relative Residual Norm = 2.623731e-09 # Output file: smoother.out.14 Iterations = 7 -Final Relative Residual Norm = 1.367899e-09 +Final Relative Residual Norm = 2.017716e-09 # Output file: smoother.out.15 Iterations = 11 -Final Relative Residual Norm = 7.629513e-09 +Final Relative Residual Norm = 6.677405e-09 # Output file: smoother.out.16 Iterations = 6 -Final Relative Residual Norm = 2.357281e-09 +Final Relative Residual Norm = 1.779789e-09 # Output file: smoother.out.17 Iterations = 8 -Final Relative Residual Norm = 9.338545e-10 +Final Relative Residual Norm = 8.751128e-10 # Output file: smoother.out.18 GMRES Iterations = 11 -Final GMRES Relative Residual Norm = 6.828913e-09 +Final GMRES Relative Residual Norm = 7.508329e-09 # Output file: smoother.out.19 -Iterations = 7 -Final Relative Residual Norm = 8.750911e-09 +Iterations = 8 +Final Relative Residual Norm = 7.890622e-10 # Output file: smoother.out.20 Iterations = 12 -Final Relative Residual Norm = 3.976961e-09 +Final Relative Residual Norm = 4.179250e-09 # Output file: smoother.out.21 Iterations = 8 -Final Relative Residual Norm = 4.590448e-09 +Final Relative Residual Norm = 7.563157e-09 # Output file: smoother.out.22 Iterations = 8 -Final Relative Residual Norm = 3.792255e-09 +Final Relative Residual Norm = 4.121892e-09 # Output file: smoother.out.23 Iterations = 9 -Final Relative Residual Norm = 8.958228e-10 +Final Relative Residual Norm = 1.248089e-09 # Output file: smoother.out.24 Iterations = 9 -Final Relative Residual Norm = 2.458527e-09 +Final Relative Residual Norm = 4.848620e-09 diff --git a/external/hypre/src/test/TEST_ij/smoother.saved.lassen_cpu b/external/hypre/src/test/TEST_ij/smoother.saved.lassen_cpu new file mode 100644 index 00000000..560fe1bc --- /dev/null +++ b/external/hypre/src/test/TEST_ij/smoother.saved.lassen_cpu @@ -0,0 +1,120 @@ +# Output file: smoother.out.0 + Average Convergence Factor = 0.239194 + + Complexity: grid = 1.608444 + operator = 2.760808 + cycle = 5.521077 + +# Output file: smoother.out.1 + Average Convergence Factor = 0.114248 + + Complexity: grid = 1.587556 + operator = 2.683946 + cycle = 5.365442 + +# Output file: smoother.out.2 + Average Convergence Factor = 0.200422 + + Complexity: grid = 1.601000 + operator = 2.738333 + cycle = 5.476061 + +# Output file: smoother.out.3 + Average Convergence Factor = 0.120193 + + Complexity: grid = 1.601000 + operator = 2.738333 + cycle = 5.476061 + +# Output file: smoother.out.4 +Iterations = 6 +Final Relative Residual Norm = 5.847352e-09 + +# Output file: smoother.out.5 +BoomerAMG Iterations = 17 +Final Relative Residual Norm = 5.893051e-09 + +# Output file: smoother.out.6 +Iterations = 10 +Final Relative Residual Norm = 5.359240e-09 + +# Output file: smoother.out.7 +BoomerAMG Iterations = 18 +Final Relative Residual Norm = 7.391197e-09 + +# Output file: smoother.out.8 +BoomerAMG Iterations = 11 +Final Relative Residual Norm = 7.427657e-09 + +# Output file: smoother.out.9 +BoomerAMG Iterations = 17 +Final Relative Residual Norm = 4.933895e-09 + +# Output file: smoother.out.10 +BoomerAMG Iterations = 23 +Final Relative Residual Norm = 8.200305e-09 + +# Output file: smoother.out.11 +Iterations = 6 +Final Relative Residual Norm = 2.508901e-09 + +# Output file: smoother.out.11.1 +Iterations = 6 +Final Relative Residual Norm = 2.881660e-09 + +# Output file: smoother.out.11.2 +Iterations = 6 +Final Relative Residual Norm = 3.875555e-10 + +# Output file: smoother.out.12 +Iterations = 6 +Final Relative Residual Norm = 2.508759e-09 + +# Output file: smoother.out.13 +Iterations = 5 +Final Relative Residual Norm = 6.702046e-09 + +# Output file: smoother.out.14 +Iterations = 6 +Final Relative Residual Norm = 5.041183e-10 + +# Output file: smoother.out.15 +Iterations = 15 +Final Relative Residual Norm = 5.817439e-09 + +# Output file: smoother.out.16 +Iterations = 6 +Final Relative Residual Norm = 1.555966e-09 + +# Output file: smoother.out.17 +Iterations = 7 +Final Relative Residual Norm = 2.088773e-09 + +# Output file: smoother.out.18 +GMRES Iterations = 11 +Final GMRES Relative Residual Norm = 7.591488e-09 + +# Output file: smoother.out.19 +Iterations = 6 +Final Relative Residual Norm = 8.887235e-10 + +# Output file: smoother.out.20 +Iterations = 11 +Final Relative Residual Norm = 2.175824e-09 + +# Output file: smoother.out.21 +Iterations = 8 +Final Relative Residual Norm = 8.625152e-10 + +# Output file: smoother.out.22 +Iterations = 7 +Final Relative Residual Norm = 8.370996e-09 + +# Output file: smoother.out.23 +Iterations = 8 +Final Relative Residual Norm = 3.171595e-09 + +# Output file: smoother.out.24 +Iterations = 9 +Final Relative Residual Norm = 1.481290e-09 + diff --git a/external/hypre/src/test/TEST_ij/smoother.saved.ray b/external/hypre/src/test/TEST_ij/smoother.saved.ray deleted file mode 100644 index c00d09e1..00000000 --- a/external/hypre/src/test/TEST_ij/smoother.saved.ray +++ /dev/null @@ -1,112 +0,0 @@ -# Output file: smoother.out.0 - Average Convergence Factor = 0.430612 - - Complexity: grid = 1.404222 - operator = 2.596532 - cycle = 5.191852 - -# Output file: smoother.out.1 - Average Convergence Factor = 0.109467 - - Complexity: grid = 1.412889 - operator = 2.571633 - cycle = 5.142177 - -# Output file: smoother.out.2 - Average Convergence Factor = 0.213961 - - Complexity: grid = 1.403750 - operator = 2.592614 - cycle = 5.183864 - -# Output file: smoother.out.3 - Average Convergence Factor = 0.412622 - - Complexity: grid = 1.403750 - operator = 2.592614 - cycle = 5.183864 - -# Output file: smoother.out.4 -Iterations = 7 -Final Relative Residual Norm = 1.757560e-09 - -# Output file: smoother.out.5 -BoomerAMG Iterations = 16 -Final Relative Residual Norm = 5.453527e-09 - -# Output file: smoother.out.6 -Iterations = 12 -Final Relative Residual Norm = 2.762490e-09 - -# Output file: smoother.out.7 -BoomerAMG Iterations = 26 -Final Relative Residual Norm = 5.404255e-09 - -# Output file: smoother.out.8 -BoomerAMG Iterations = 17 -Final Relative Residual Norm = 3.896878e-09 - -# Output file: smoother.out.9 -BoomerAMG Iterations = 21 -Final Relative Residual Norm = 5.872645e-09 - -# Output file: smoother.out.10 -BoomerAMG Iterations = 25 -Final Relative Residual Norm = 6.780708e-09 - -# Output file: smoother.out.11 -Iterations = 7 -Final Relative Residual Norm = 4.597200e-10 - -# Output file: smoother.out.12 -Iterations = 7 -Final Relative Residual Norm = 1.208193e-09 - -# Output file: smoother.out.13 -Iterations = 6 -Final Relative Residual Norm = 2.719926e-09 - -# Output file: smoother.out.14 -Iterations = 7 -Final Relative Residual Norm = 1.367899e-09 - -# Output file: smoother.out.15 -Iterations = 11 -Final Relative Residual Norm = 7.629513e-09 - -# Output file: smoother.out.16 -Iterations = 6 -Final Relative Residual Norm = 2.345015e-09 - -# Output file: smoother.out.17 -Iterations = 8 -Final Relative Residual Norm = 9.338545e-10 - -# Output file: smoother.out.18 -GMRES Iterations = 11 -Final GMRES Relative Residual Norm = 6.828913e-09 - -# Output file: smoother.out.19 -Iterations = 7 -Final Relative Residual Norm = 8.750911e-09 - -# Output file: smoother.out.20 -Iterations = 12 -Final Relative Residual Norm = 3.976961e-09 - -# Output file: smoother.out.21 -Iterations = 8 -Final Relative Residual Norm = 5.442169e-09 - -# Output file: smoother.out.22 -Iterations = 8 -Final Relative Residual Norm = 4.050427e-09 - -# Output file: smoother.out.23 -Iterations = 9 -Final Relative Residual Norm = 1.019347e-09 - -# Output file: smoother.out.24 -Iterations = 9 -Final Relative Residual Norm = 2.886424e-09 - diff --git a/external/hypre/src/test/TEST_ij/smoother.sh b/external/hypre/src/test/TEST_ij/smoother.sh old mode 100644 new mode 100755 index 687196a2..a478278c --- a/external/hypre/src/test/TEST_ij/smoother.sh +++ b/external/hypre/src/test/TEST_ij/smoother.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -34,6 +34,8 @@ FILES="\ ${TNAME}.out.9\ ${TNAME}.out.10\ ${TNAME}.out.11\ + ${TNAME}.out.11.1\ + ${TNAME}.out.11.2\ ${TNAME}.out.12\ ${TNAME}.out.13\ ${TNAME}.out.14\ diff --git a/external/hypre/src/test/TEST_ij/solvers.jobs b/external/hypre/src/test/TEST_ij/solvers.jobs old mode 100644 new mode 100755 index f1c37d82..8a043b10 --- a/external/hypre/src/test/TEST_ij/solvers.jobs +++ b/external/hypre/src/test/TEST_ij/solvers.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -50,11 +50,27 @@ mpirun -np 2 ./ij -solver 17 -rhsrand -unroll 4 > solvers.out.16 mpirun -np 2 ./ij -solver 3 -rhsrand -check_residual > solvers.out.17 mpirun -np 2 ./ij -solver 4 -rhsrand -check_residual > solvers.out.18 +mpirun -np 3 ./ij -n 23 29 31 -solver 1 -rhsrand -precon_cycles 2 -rlx 18 > solvers.out.19 +mpirun -np 4 ./ij -n 23 29 31 -solver 3 -rhsrand -precon_cycles 3 -rlx 18 > solvers.out.20 +mpirun -np 2 ./ij -n 23 29 31 -solver 0 -rhsrand -mu 2 -rlx 18 > solvers.out.21 +mpirun -np 2 ./ij -n 23 29 31 -solver 3 -rhsrand -mu 2 -rlx 18 > solvers.out.22 +mpirun -np 2 ./ij -n 23 29 31 -solver 0 -rhsrand -fmg -rlx 18 > solvers.out.23 +mpirun -np 2 ./ij -n 23 29 31 -solver 3 -rhsrand -fmg -rlx 18 > solvers.out.24 +#flexible CG vs CG; AMG with CG smoother +mpirun -np 2 ./ij -solver 1 -rlx 15 -flex 1 > solvers.out.25 +mpirun -np 2 ./ij -solver 1 -rlx 15 > solvers.out.26 + #systems AMG run ...unknown approach, hybrid approach, nodal approach mpirun -np 2 ./ij -n 20 20 20 -sysL 2 -nf 2 > solvers.out.sysu mpirun -np 2 ./ij -n 20 20 20 -sysL 2 -nf 2 -nodal 1 -smtype 6 -smlv 10 -dom 1 -ov 0 > solvers.out.sysh mpirun -np 2 ./ij -n 20 20 20 -sysL 2 -nf 2 -interptype 10 -Pmx 6 > solvers.out.sysn +#systems AMG using unknown approach and filtering +mpirun -np 1 ./ij -solver 1 -n 8 8 8 -sysL 2 -nf 2 -ff 1 > solvers.out.27 +mpirun -np 1 ./ij -solver 1 -n 8 8 8 -sysL 3 -nf 3 -ff 1 > solvers.out.28 +mpirun -np 4 ./ij -solver 1 -n 8 8 8 -sysL 2 -nf 2 -ff 1 > solvers.out.29 +mpirun -np 4 ./ij -solver 1 -n 8 8 8 -sysL 3 -nf 3 -ff 1 > solvers.out.30 + #LGMRS and FlexGMRES mpirun -np 2 ./ij -solver 50 -rhsrand > solvers.out.101 mpirun -np 2 ./ij -solver 51 -rhsrand > solvers.out.102 @@ -116,57 +132,6 @@ mpirun -np 2 ./ij -solver 70 -mgr_nlevels 5 -mgr_bsize 2 -mgr_non_c_to_f 0 -mgr_ mpirun -np 2 ./ij -solver 71 -mgr_nlevels 0 -mgr_bsize 2 -mgr_non_c_to_f 0 -mgr_frelax_method 0 -mgr_num_reserved_nodes 0 > solvers.out.212 mpirun -np 2 ./ij -solver 71 -mgr_nlevels 1 -mgr_bsize 2 -mgr_non_c_to_f 0 -mgr_frelax_method 0 -mgr_num_reserved_nodes 0 > solvers.out.213 -# -# hypre_ILU tests -# Tests ILU(0), ILUK and ILUK solvers sequentially -# Tests Parallel combination of ILU solvers -# Tests ILU-(Flex)GMRES -# Test AMG with ILU as a complex smoother -# -mpirun -np 1 ./ij -solver 80 -ilu_type 0 -ilu_lfil 0 > solvers.out.300 -mpirun -np 1 ./ij -solver 80 -ilu_type 0 -ilu_lfil 1 > solvers.out.301 -mpirun -np 1 ./ij -solver 80 -ilu_type 1 -ilu_droptol 1.0e-2 -ilu_max_row_nnz 1000 > solvers.out.302 -# parallel ILU -# BJ -mpirun -np 2 ./ij -solver 80 -ilu_type 0 -ilu_lfil 1 > solvers.out.303 -mpirun -np 2 ./ij -solver 80 -ilu_type 1 -ilu_droptol 1.0e-2 -ilu_max_row_nnz 1000 > solvers.out.304 -# GMRES+ILU -mpirun -np 2 ./ij -solver 80 -ilu_type 10 -ilu_lfil 1 -ilu_schur_max_iter 5 > solvers.out.305 -mpirun -np 2 ./ij -solver 80 -ilu_type 11 -ilu_droptol 1.0e-2 -ilu_max_row_nnz 1000 -ilu_schur_max_iter 5 > solvers.out.306 -# NSH+ILU -mpirun -np 2 ./ij -solver 80 -ilu_type 20 -ilu_lfil 1 -ilu_schur_max_iter 5 > solvers.out.307 -mpirun -np 2 ./ij -solver 80 -ilu_type 21 -ilu_droptol 1.0e-2 -ilu_max_row_nnz 1000 -ilu_schur_max_iter 5 > solvers.out.308 -# RAS+ILU -mpirun -np 2 ./ij -solver 80 -ilu_type 30 -ilu_lfil 1 > solvers.out.309 -mpirun -np 2 ./ij -solver 80 -ilu_type 31 -ilu_droptol 1.0e-2 -ilu_max_row_nnz 1000 > solvers.out.310 -# ddPQ-GMRES+ILU -mpirun -np 2 ./ij -solver 80 -ilu_type 40 -ilu_lfil 1 -ilu_schur_max_iter 5 > solvers.out.311 -mpirun -np 2 ./ij -solver 80 -ilu_type 41 -ilu_droptol 1.0e-2 -ilu_max_row_nnz 1000 -ilu_schur_max_iter 5 > solvers.out.312 -## ILU-GMRES -mpirun -np 2 ./ij -solver 81 -ilu_type 0 -ilu_lfil 0 > solvers.out.313 -mpirun -np 2 ./ij -solver 81 -ilu_type 1 -ilu_droptol 1.0e-2 -ilu_max_row_nnz 1000 > solvers.out.314 -mpirun -np 2 ./ij -solver 81 -ilu_type 30 -ilu_lfil 0 > solvers.out.315 -mpirun -np 2 ./ij -solver 81 -ilu_type 31 -ilu_droptol 1.0e-2 -ilu_max_row_nnz 1000 > solvers.out.316 -## ILU-FlexGMRES -mpirun -np 2 ./ij -solver 82 -ilu_type 10 -ilu_lfil 0 -ilu_schur_max_iter 5 > solvers.out.317 -mpirun -np 2 ./ij -solver 82 -ilu_type 11 -ilu_droptol 1.0e-2 -ilu_max_row_nnz 1000 -ilu_schur_max_iter 5 > solvers.out.318 -mpirun -np 2 ./ij -solver 82 -ilu_type 20 -ilu_lfil 0 -ilu_schur_max_iter 5 > solvers.out.319 -mpirun -np 2 ./ij -solver 82 -ilu_type 21 -ilu_droptol 1.0e-2 -ilu_max_row_nnz 1000 -ilu_schur_max_iter 5 > solvers.out.320 -mpirun -np 2 ./ij -solver 82 -ilu_type 40 -ilu_lfil 0 -ilu_schur_max_iter 5 > solvers.out.321 -mpirun -np 2 ./ij -solver 82 -ilu_type 41 -ilu_droptol 1.0e-2 -ilu_max_row_nnz 1000 -ilu_schur_max_iter 5 > solvers.out.322 -## RAP-ILU -mpirun -np 2 ./ij -solver 82 -ilu_type 50 -ilu_lfil 0 > solvers.out.323 -## ILU smoother for AMG -mpirun -np 2 ./ij -solver 0 -smtype 5 -smlv 1 -ilu_type 30 > solvers.out.324 -mpirun -np 2 ./ij -solver 0 -smtype 15 -smlv 1 -ilu_type 30 > solvers.out.325 - -## Solve Ax=b and -Ax=b, convergence should be the same -mpirun -np 2 ./ij -solver 0 -rhsrand -negA 0 > solvers.out.400.p -mpirun -np 2 ./ij -solver 0 -rhsrand -negA 1 > solvers.out.400.n -mpirun -np 3 ./ij -solver 3 -rhsrand -negA 0 > solvers.out.401.p -mpirun -np 3 ./ij -solver 3 -rhsrand -negA 1 > solvers.out.401.n -mpirun -np 4 ./ij -cheby_eig_est 10 -cheby_order 4 -cheby_variant 0 -cheby_scale 1 -rlx 16 -negA 0 > solvers.out.402.p -mpirun -np 4 ./ij -cheby_eig_est 10 -cheby_order 4 -cheby_variant 0 -cheby_scale 1 -rlx 16 -negA 1 > solvers.out.402.n -mpirun -np 4 ./ij -solver 3 -cheby_eig_est 0 -cheby_order 3 -cheby_variant 1 -cheby_scale 1 -rlx 16 -negA 0 > solvers.out.403.p -mpirun -np 4 ./ij -solver 3 -cheby_eig_est 0 -cheby_order 3 -cheby_variant 1 -cheby_scale 1 -rlx 16 -negA 1 > solvers.out.403.n - +## Test relaxation methods 88 (L1 hybrid Symm. Gauss-Seidel with a convergent l1 term) and 89 (L1 Symm. hybrid Gauss-Seidel) +mpirun -np 4 ./ij -fromfile data/tucker21935/IJ.A -solver 1 -rlx 88 > solvers.out.404 +mpirun -np 4 ./ij -fromfile data/tucker21935/IJ.A -solver 1 -rlx 89 > solvers.out.405 diff --git a/external/hypre/src/test/TEST_ij/solvers.saved b/external/hypre/src/test/TEST_ij/solvers.saved index 0cee9ca2..f0bdd53a 100644 --- a/external/hypre/src/test/TEST_ij/solvers.saved +++ b/external/hypre/src/test/TEST_ij/solvers.saved @@ -88,6 +88,54 @@ index 19 value -7.497267e-11 GMRES Iterations = 93 Final GMRES Relative Residual Norm = 8.225661e-09 +# Output file: solvers.out.19 + + +Iterations = 8 +Final Relative Residual Norm = 2.463625e-09 + +# Output file: solvers.out.20 + + +GMRES Iterations = 7 +Final GMRES Relative Residual Norm = 5.912905e-10 + +# Output file: solvers.out.21 + + +BoomerAMG Iterations = 23 +Final Relative Residual Norm = 5.120965e-09 + +# Output file: solvers.out.22 + + +GMRES Iterations = 11 +Final GMRES Relative Residual Norm = 7.241893e-09 + +# Output file: solvers.out.23 + + +BoomerAMG Iterations = 15 +Final Relative Residual Norm = 5.927198e-09 + +# Output file: solvers.out.24 + + +GMRES Iterations = 9 +Final GMRES Relative Residual Norm = 2.177357e-09 + +# Output file: solvers.out.25 + + +Iterations = 9 +Final Relative Residual Norm = 9.023254e-09 + +# Output file: solvers.out.26 + + +Iterations = 18 +Final Relative Residual Norm = 9.578132e-09 + # Output file: solvers.out.sysh Average Convergence Factor = 0.119746 @@ -109,6 +157,22 @@ Final GMRES Relative Residual Norm = 8.225661e-09 operator = 2.866563 cycle = 5.732747 +# Output file: solvers.out.27 +Iterations = 12 +Final Relative Residual Norm = 5.893893e-09 + +# Output file: solvers.out.28 +Iterations = 18 +Final Relative Residual Norm = 3.448418e-09 + +# Output file: solvers.out.29 +Iterations = 13 +Final Relative Residual Norm = 4.536558e-09 + +# Output file: solvers.out.30 +Iterations = 19 +Final Relative Residual Norm = 3.853111e-09 + # Output file: solvers.out.101 LGMRES Iterations = 83 Final LGMRES Relative Residual Norm = 8.591967e-09 @@ -155,7 +219,7 @@ Final Relative Residual Norm = 8.452076e-09 # Output file: solvers.out.112 GMRES Iterations = 23 -Final GMRES Relative Residual Norm = 3.979844e-09 +Final GMRES Relative Residual Norm = 3.979845e-09 # Output file: solvers.out.113 GMRES Iterations = 25 @@ -231,7 +295,7 @@ Final Relative Residual Norm = 7.963764e-09 # Output file: solvers.out.208 MGR Iterations = 15 -Final Relative Residual Norm = 8.038753e-09 +Final Relative Residual Norm = 7.901013e-09 # Output file: solvers.out.209 MGR Iterations = 14 @@ -239,7 +303,7 @@ Final Relative Residual Norm = 7.561893e-09 # Output file: solvers.out.210 MGR Iterations = 22 -Final Relative Residual Norm = 6.502164e-09 +Final Relative Residual Norm = 6.427895e-09 # Output file: solvers.out.211 MGR Iterations = 29 @@ -253,107 +317,11 @@ Final Relative Residual Norm = 1.371340e-09 Iterations = 29 Final Relative Residual Norm = 5.204677e-09 -# Output file: solvers.out.300 -hypre_ILU Iterations = 85 -Final Relative Residual Norm = 9.266244e-09 - -# Output file: solvers.out.301 -hypre_ILU Iterations = 40 -Final Relative Residual Norm = 9.772377e-09 - -# Output file: solvers.out.302 -hypre_ILU Iterations = 23 -Final Relative Residual Norm = 5.512717e-09 - -# Output file: solvers.out.303 -hypre_ILU Iterations = 64 -Final Relative Residual Norm = 8.558467e-09 - -# Output file: solvers.out.304 -hypre_ILU Iterations = 52 -Final Relative Residual Norm = 9.189235e-09 - -# Output file: solvers.out.305 -hypre_ILU Iterations = 38 -Final Relative Residual Norm = 7.024121e-09 - -# Output file: solvers.out.306 -hypre_ILU Iterations = 26 -Final Relative Residual Norm = 7.556742e-09 - -# Output file: solvers.out.307 -hypre_ILU Iterations = 38 -Final Relative Residual Norm = 7.037599e-09 - -# Output file: solvers.out.308 -hypre_ILU Iterations = 26 -Final Relative Residual Norm = 7.593126e-09 - -# Output file: solvers.out.309 -hypre_ILU Iterations = 49 -Final Relative Residual Norm = 7.072947e-09 - -# Output file: solvers.out.310 -hypre_ILU Iterations = 42 -Final Relative Residual Norm = 6.699477e-09 - -# Output file: solvers.out.311 -hypre_ILU Iterations = 36 -Final Relative Residual Norm = 6.392185e-09 - -# Output file: solvers.out.312 -hypre_ILU Iterations = 24 -Final Relative Residual Norm = 5.953652e-09 - -# Output file: solvers.out.313 -GMRES Iterations = 25 -Final GMRES Relative Residual Norm = 3.968804e-09 - -# Output file: solvers.out.314 -GMRES Iterations = 19 -Final GMRES Relative Residual Norm = 7.026446e-09 - -# Output file: solvers.out.315 -GMRES Iterations = 20 -Final GMRES Relative Residual Norm = 7.908624e-09 - -# Output file: solvers.out.316 -GMRES Iterations = 13 -Final GMRES Relative Residual Norm = 7.969372e-09 - -# Output file: solvers.out.317 -FlexGMRES Iterations = 17 -Final FlexGMRES Relative Residual Norm = 9.152443e-09 - -# Output file: solvers.out.318 -FlexGMRES Iterations = 9 -Final FlexGMRES Relative Residual Norm = 5.768785e-09 - -# Output file: solvers.out.319 -FlexGMRES Iterations = 17 -Final FlexGMRES Relative Residual Norm = 9.133102e-09 - -# Output file: solvers.out.320 -FlexGMRES Iterations = 9 -Final FlexGMRES Relative Residual Norm = 6.299457e-09 - -# Output file: solvers.out.321 -FlexGMRES Iterations = 17 -Final FlexGMRES Relative Residual Norm = 4.489256e-09 - -# Output file: solvers.out.322 -FlexGMRES Iterations = 8 -Final FlexGMRES Relative Residual Norm = 3.082447e-09 - -# Output file: solvers.out.323 -FlexGMRES Iterations = 18 -Final FlexGMRES Relative Residual Norm = 4.133851e-09 - -# Output file: solvers.out.324 -BoomerAMG Iterations = 8 -Final Relative Residual Norm = 8.380440e-09 +# Output file: solvers.out.404 +Iterations = 30 +Final Relative Residual Norm = 8.259159e-09 -# Output file: solvers.out.325 -BoomerAMG Iterations = 7 -Final Relative Residual Norm = 7.074639e-09 +# Output file: solvers.out.405 +Iterations = 24 +Final Relative Residual Norm = 6.793588e-09 diff --git a/external/hypre/src/test/TEST_ij/solvers.saved.aurora b/external/hypre/src/test/TEST_ij/solvers.saved.aurora new file mode 100644 index 00000000..2b988c36 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/solvers.saved.aurora @@ -0,0 +1,327 @@ +# Output file: solvers.out.0 +Iterations = 11 +Final Relative Residual Norm = 8.313179e-09 + +# Output file: solvers.out.1 +Iterations = 41 +Final Relative Residual Norm = 6.698760e-09 + +# Output file: solvers.out.2 +GMRES Iterations = 12 +Final GMRES Relative Residual Norm = 2.591429e-09 + +# Output file: solvers.out.3 +GMRES Iterations = 93 +Final GMRES Relative Residual Norm = 8.225661e-09 + +# Output file: solvers.out.4 +Iterations = 9 +Final Relative Residual Norm = 5.357266e-09 + +# Output file: solvers.out.5 +Iterations = 196 +Final Relative Residual Norm = 9.097622e-09 + +# Output file: solvers.out.8 +Iterations = 41 +PCG_Iterations = 0 +DSCG_Iterations = 41 +Final Relative Residual Norm = 6.698760e-09 + +# Output file: solvers.out.9 +Iterations = 11 +PCG_Iterations = 7 +DSCG_Iterations = 4 +Final Relative Residual Norm = 2.051260e-09 + +# Output file: solvers.out.10 +Iterations = 10 +PCG_Iterations = 8 +DSCG_Iterations = 2 +Final Relative Residual Norm = 7.391720e-10 + +# Output file: solvers.out.11 +Iterations = 7 +PCG_Iterations = 4 +DSCG_Iterations = 3 +Final Relative Residual Norm = 9.120827e-10 + +# Output file: solvers.out.12 + + +COGMRES Iterations = 12 +Final COGMRES Relative Residual Norm = 2.591429e-09 + +# Output file: solvers.out.13 + + +COGMRES Iterations = 93 +Final COGMRES Relative Residual Norm = 8.225661e-09 + +# Output file: solvers.out.14 + + +COGMRES Iterations = 93 +Final COGMRES Relative Residual Norm = 8.225662e-09 + +# Output file: solvers.out.15 + + +COGMRES Iterations = 93 +Final COGMRES Relative Residual Norm = 8.225662e-09 + +# Output file: solvers.out.16 + + +COGMRES Iterations = 93 +Final COGMRES Relative Residual Norm = 8.225661e-09 + +# Output file: solvers.out.17 +index 19 value -9.448537e-11 + +GMRES Iterations = 12 +Final GMRES Relative Residual Norm = 2.591429e-09 + +# Output file: solvers.out.18 +index 19 value -7.497267e-11 + +GMRES Iterations = 93 +Final GMRES Relative Residual Norm = 8.225661e-09 + +# Output file: solvers.out.19 + + +Iterations = 8 +Final Relative Residual Norm = 7.973874e-09 + +# Output file: solvers.out.20 + + +GMRES Iterations = 7 +Final GMRES Relative Residual Norm = 1.137542e-09 + +# Output file: solvers.out.21 + + +BoomerAMG Iterations = 25 +Final Relative Residual Norm = 7.040419e-09 + +# Output file: solvers.out.22 + + +GMRES Iterations = 12 +Final GMRES Relative Residual Norm = 5.729132e-09 + +# Output file: solvers.out.23 + + +BoomerAMG Iterations = 17 +Final Relative Residual Norm = 4.244345e-09 + +# Output file: solvers.out.24 + + +GMRES Iterations = 10 +Final GMRES Relative Residual Norm = 1.351898e-09 + +# Output file: solvers.out.25 + + +Iterations = 10 +Final Relative Residual Norm = 1.562615e-09 + +# Output file: solvers.out.26 + + +Iterations = 15 +Final Relative Residual Norm = 4.161298e-09 + +# Output file: solvers.out.sysh + Average Convergence Factor = 0.206046 + + Complexity: grid = 1.388375 + operator = 2.644981 + cycle = 5.289944 + +# Output file: solvers.out.sysn + Average Convergence Factor = 0.537936 + + Complexity: grid = 1.391500 + operator = 2.082687 + cycle = 10.165075 + +# Output file: solvers.out.sysu + Average Convergence Factor = 0.773088 + + Complexity: grid = 1.384375 + operator = 2.726847 + cycle = 5.453526 + +# Output file: solvers.out.27 +Iterations = 17 +Final Relative Residual Norm = 5.745047e-09 + +# Output file: solvers.out.28 +Iterations = 23 +Final Relative Residual Norm = 9.165818e-09 + +# Output file: solvers.out.29 +Iterations = 17 +Final Relative Residual Norm = 9.344808e-09 + +# Output file: solvers.out.30 +Iterations = 24 +Final Relative Residual Norm = 6.006718e-09 + +# Output file: solvers.out.101 +LGMRES Iterations = 83 +Final LGMRES Relative Residual Norm = 8.591967e-09 + +# Output file: solvers.out.102 +LGMRES Iterations = 13 +Final LGMRES Relative Residual Norm = 2.506722e-09 + +# Output file: solvers.out.103 +FlexGMRES Iterations = 93 +Final FlexGMRES Relative Residual Norm = 8.225661e-09 + +# Output file: solvers.out.104 +FlexGMRES Iterations = 12 +Final FlexGMRES Relative Residual Norm = 2.591429e-09 + +# Output file: solvers.out.105 +Iterations = 19 +Final Relative Residual Norm = 3.770440e-09 + +# Output file: solvers.out.106 +Iterations = 19 +Final Relative Residual Norm = 3.770440e-09 + +# Output file: solvers.out.107 +Iterations = 29 +Final Relative Residual Norm = 7.980731e-09 + +# Output file: solvers.out.108 +Iterations = 29 +Final Relative Residual Norm = 7.980731e-09 + +# Output file: solvers.out.109 +Iterations = 20 +Final Relative Residual Norm = 8.472626e-09 + +# Output file: solvers.out.110 +Iterations = 20 +Final Relative Residual Norm = 8.472626e-09 + +# Output file: solvers.out.111 +Iterations = 32 +Final Relative Residual Norm = 7.550239e-09 + +# Output file: solvers.out.112 +GMRES Iterations = 38 +Final GMRES Relative Residual Norm = 8.733188e-09 + +# Output file: solvers.out.113 +GMRES Iterations = 27 +Final GMRES Relative Residual Norm = 5.801918e-09 + +# Output file: solvers.out.114 +BoomerAMG Iterations = 35 +Final Relative Residual Norm = 8.610293e-09 + +# Output file: solvers.out.115 +BoomerAMG Iterations = 35 +Final Relative Residual Norm = 5.954720e-09 + +# Output file: solvers.out.116 +GMRES Iterations = 15 +Final GMRES Relative Residual Norm = 3.189139e-09 + +# Output file: solvers.out.117 +GMRES Iterations = 15 +Final GMRES Relative Residual Norm = 3.189139e-09 + +# Output file: solvers.out.118 +GMRES Iterations = 27 +Final GMRES Relative Residual Norm = 7.132129e-09 + +# Output file: solvers.out.119 +GMRES Iterations = 19 +Final GMRES Relative Residual Norm = 9.374280e-09 + +# Output file: solvers.out.121 +GMRES Iterations = 26 +Final GMRES Relative Residual Norm = 4.243767e-09 + +# Output file: solvers.out.122 +GMRES Iterations = 19 +Final GMRES Relative Residual Norm = 9.374280e-09 + +# Output file: solvers.out.120 +GMRES Iterations = 19 +Final GMRES Relative Residual Norm = 9.374304e-09 + +# Output file: solvers.out.200 +MGR Iterations = 9 +Final Relative Residual Norm = 1.247303e-09 + +# Output file: solvers.out.201 +MGR Iterations = 9 +Final Relative Residual Norm = 3.708381e-09 + +# Output file: solvers.out.202 +MGR Iterations = 9 +Final Relative Residual Norm = 1.247303e-09 + +# Output file: solvers.out.203 +MGR Iterations = 9 +Final Relative Residual Norm = 3.708381e-09 + +# Output file: solvers.out.204 +MGR Iterations = 74 +Final Relative Residual Norm = 9.572092e-09 + +# Output file: solvers.out.205 +MGR Iterations = 71 +Final Relative Residual Norm = 8.439033e-09 + +# Output file: solvers.out.206 +MGR Iterations = 52 +Final Relative Residual Norm = 8.583644e-09 + +# Output file: solvers.out.207 +MGR Iterations = 50 +Final Relative Residual Norm = 9.909484e-09 + +# Output file: solvers.out.208 +MGR Iterations = 16 +Final Relative Residual Norm = 4.090193e-09 + +# Output file: solvers.out.209 +MGR Iterations = 15 +Final Relative Residual Norm = 7.976848e-09 + +# Output file: solvers.out.210 +MGR Iterations = 22 +Final Relative Residual Norm = 9.412142e-09 + +# Output file: solvers.out.211 +MGR Iterations = 29 +Final Relative Residual Norm = 9.128075e-09 + +# Output file: solvers.out.212 +Iterations = 11 +Final Relative Residual Norm = 6.598043e-09 + +# Output file: solvers.out.213 +Iterations = 28 +Final Relative Residual Norm = 9.579850e-09 + +# Output file: solvers.out.404 +Iterations = 28 +Final Relative Residual Norm = 8.560163e-09 + +# Output file: solvers.out.405 +Iterations = 22 +Final Relative Residual Norm = 7.991509e-09 + diff --git a/external/hypre/src/test/TEST_ij/solvers.saved.lassen b/external/hypre/src/test/TEST_ij/solvers.saved.lassen index aac47972..65bee4fd 100644 --- a/external/hypre/src/test/TEST_ij/solvers.saved.lassen +++ b/external/hypre/src/test/TEST_ij/solvers.saved.lassen @@ -1,22 +1,22 @@ # Output file: solvers.out.0 Iterations = 11 -Final Relative Residual Norm = 7.964594e-09 +Final Relative Residual Norm = 5.395554e-09 # Output file: solvers.out.1 Iterations = 41 Final Relative Residual Norm = 6.698760e-09 # Output file: solvers.out.2 -GMRES Iterations = 12 -Final GMRES Relative Residual Norm = 2.545775e-09 +GMRES Iterations = 11 +Final GMRES Relative Residual Norm = 8.872614e-09 # Output file: solvers.out.3 GMRES Iterations = 93 -Final GMRES Relative Residual Norm = 8.225662e-09 +Final GMRES Relative Residual Norm = 8.225661e-09 # Output file: solvers.out.4 -Iterations = 9 -Final Relative Residual Norm = 9.889817e-09 +Iterations = 10 +Final Relative Residual Norm = 1.243936e-09 # Output file: solvers.out.5 Iterations = 196 @@ -32,31 +32,31 @@ Final Relative Residual Norm = 6.698760e-09 Iterations = 11 PCG_Iterations = 7 DSCG_Iterations = 4 -Final Relative Residual Norm = 1.482757e-09 +Final Relative Residual Norm = 2.361078e-09 # Output file: solvers.out.10 Iterations = 10 PCG_Iterations = 8 DSCG_Iterations = 2 -Final Relative Residual Norm = 6.686412e-10 +Final Relative Residual Norm = 7.996975e-10 # Output file: solvers.out.11 Iterations = 7 PCG_Iterations = 4 DSCG_Iterations = 3 -Final Relative Residual Norm = 8.612722e-10 +Final Relative Residual Norm = 1.374567e-09 # Output file: solvers.out.12 -COGMRES Iterations = 12 -Final COGMRES Relative Residual Norm = 2.545775e-09 +COGMRES Iterations = 11 +Final COGMRES Relative Residual Norm = 8.872614e-09 # Output file: solvers.out.13 COGMRES Iterations = 93 -Final COGMRES Relative Residual Norm = 8.225662e-09 +Final COGMRES Relative Residual Norm = 8.225661e-09 # Output file: solvers.out.14 @@ -74,26 +74,74 @@ Final COGMRES Relative Residual Norm = 8.225662e-09 COGMRES Iterations = 93 -Final COGMRES Relative Residual Norm = 8.225661e-09 +Final COGMRES Relative Residual Norm = 8.225662e-09 # Output file: solvers.out.17 -index 19 value -1.312642e-11 +index 19 value -8.373864e-12 -GMRES Iterations = 12 -Final GMRES Relative Residual Norm = 2.545775e-09 +GMRES Iterations = 11 +Final GMRES Relative Residual Norm = 8.872614e-09 # Output file: solvers.out.18 -index 19 value -7.497266e-11 +index 19 value -7.497267e-11 GMRES Iterations = 93 -Final GMRES Relative Residual Norm = 8.225662e-09 +Final GMRES Relative Residual Norm = 8.225661e-09 + +# Output file: solvers.out.19 + + +Iterations = 8 +Final Relative Residual Norm = 8.565049e-09 + +# Output file: solvers.out.20 + + +GMRES Iterations = 7 +Final GMRES Relative Residual Norm = 1.597168e-09 + +# Output file: solvers.out.21 + + +BoomerAMG Iterations = 25 +Final Relative Residual Norm = 7.139146e-09 + +# Output file: solvers.out.22 + + +GMRES Iterations = 12 +Final GMRES Relative Residual Norm = 5.069641e-09 + +# Output file: solvers.out.23 + + +BoomerAMG Iterations = 17 +Final Relative Residual Norm = 4.412175e-09 + +# Output file: solvers.out.24 + + +GMRES Iterations = 9 +Final GMRES Relative Residual Norm = 9.074692e-09 + +# Output file: solvers.out.25 + + +Iterations = 10 +Final Relative Residual Norm = 2.384986e-09 + +# Output file: solvers.out.26 + + +Iterations = 15 +Final Relative Residual Norm = 7.167937e-09 # Output file: solvers.out.sysh - Average Convergence Factor = 0.209143 + Average Convergence Factor = 0.205554 - Complexity: grid = 1.400375 - operator = 2.672127 - cycle = 5.344235 + Complexity: grid = 1.401500 + operator = 2.689142 + cycle = 5.378265 # Output file: solvers.out.sysn Average Convergence Factor = 0.537935 @@ -103,43 +151,59 @@ Final GMRES Relative Residual Norm = 8.225662e-09 cycle = 10.165075 # Output file: solvers.out.sysu - Average Convergence Factor = 0.781122 + Average Convergence Factor = 0.773233 + + Complexity: grid = 1.395375 + operator = 2.737043 + cycle = 5.473918 - Complexity: grid = 1.395438 - operator = 2.730089 - cycle = 5.460009 +# Output file: solvers.out.27 +Iterations = 17 +Final Relative Residual Norm = 4.472032e-09 + +# Output file: solvers.out.28 +Iterations = 25 +Final Relative Residual Norm = 4.134529e-09 + +# Output file: solvers.out.29 +Iterations = 17 +Final Relative Residual Norm = 7.555200e-09 + +# Output file: solvers.out.30 +Iterations = 23 +Final Relative Residual Norm = 8.408484e-09 # Output file: solvers.out.101 LGMRES Iterations = 83 Final LGMRES Relative Residual Norm = 8.591967e-09 # Output file: solvers.out.102 -LGMRES Iterations = 13 -Final LGMRES Relative Residual Norm = 2.815593e-09 +LGMRES Iterations = 12 +Final LGMRES Relative Residual Norm = 9.399192e-09 # Output file: solvers.out.103 FlexGMRES Iterations = 93 -Final FlexGMRES Relative Residual Norm = 8.225662e-09 +Final FlexGMRES Relative Residual Norm = 8.225661e-09 # Output file: solvers.out.104 -FlexGMRES Iterations = 12 -Final FlexGMRES Relative Residual Norm = 2.545775e-09 +FlexGMRES Iterations = 11 +Final FlexGMRES Relative Residual Norm = 8.872614e-09 # Output file: solvers.out.105 Iterations = 19 -Final Relative Residual Norm = 4.349071e-09 +Final Relative Residual Norm = 4.250469e-09 # Output file: solvers.out.106 Iterations = 19 -Final Relative Residual Norm = 4.349071e-09 +Final Relative Residual Norm = 4.250469e-09 # Output file: solvers.out.107 Iterations = 29 -Final Relative Residual Norm = 7.167010e-09 +Final Relative Residual Norm = 7.512162e-09 # Output file: solvers.out.108 Iterations = 29 -Final Relative Residual Norm = 7.167601e-09 +Final Relative Residual Norm = 7.512135e-09 # Output file: solvers.out.109 Iterations = 20 @@ -159,27 +223,27 @@ Final GMRES Relative Residual Norm = 7.222662e-09 # Output file: solvers.out.113 GMRES Iterations = 26 -Final GMRES Relative Residual Norm = 6.905243e-09 +Final GMRES Relative Residual Norm = 6.954824e-09 # Output file: solvers.out.114 -BoomerAMG Iterations = 33 -Final Relative Residual Norm = 8.651263e-09 +BoomerAMG Iterations = 34 +Final Relative Residual Norm = 7.848170e-09 # Output file: solvers.out.115 -BoomerAMG Iterations = 33 -Final Relative Residual Norm = 7.342374e-09 +BoomerAMG Iterations = 34 +Final Relative Residual Norm = 9.839249e-09 # Output file: solvers.out.116 -GMRES Iterations = 14 -Final GMRES Relative Residual Norm = 7.870943e-09 +GMRES Iterations = 15 +Final GMRES Relative Residual Norm = 2.830234e-09 # Output file: solvers.out.117 -GMRES Iterations = 14 -Final GMRES Relative Residual Norm = 7.870943e-09 +GMRES Iterations = 15 +Final GMRES Relative Residual Norm = 2.830235e-09 # Output file: solvers.out.118 GMRES Iterations = 27 -Final GMRES Relative Residual Norm = 5.487850e-09 +Final GMRES Relative Residual Norm = 5.532388e-09 # Output file: solvers.out.119 GMRES Iterations = 19 @@ -195,165 +259,68 @@ Final GMRES Relative Residual Norm = 5.040776e-09 # Output file: solvers.out.120 GMRES Iterations = 19 -Final GMRES Relative Residual Norm = 5.041387e-09 +Final GMRES Relative Residual Norm = 5.041386e-09 # Output file: solvers.out.200 -MGR Iterations = 6 -Final Relative Residual Norm = 6.980277e-10 +MGR Iterations = 8 +Final Relative Residual Norm = 7.317392e-09 # Output file: solvers.out.201 -MGR Iterations = 6 -Final Relative Residual Norm = 5.136059e-09 +MGR Iterations = 9 +Final Relative Residual Norm = 1.802890e-09 # Output file: solvers.out.202 -MGR Iterations = 6 -Final Relative Residual Norm = 6.980277e-10 +MGR Iterations = 8 +Final Relative Residual Norm = 7.317392e-09 # Output file: solvers.out.203 -MGR Iterations = 6 -Final Relative Residual Norm = 5.136059e-09 +MGR Iterations = 9 +Final Relative Residual Norm = 1.802890e-09 # Output file: solvers.out.204 MGR Iterations = 74 -Final Relative Residual Norm = 8.553927e-09 +Final Relative Residual Norm = 9.563442e-09 # Output file: solvers.out.205 -MGR Iterations = 70 -Final Relative Residual Norm = 9.518056e-09 +MGR Iterations = 71 +Final Relative Residual Norm = 8.505703e-09 # Output file: solvers.out.206 MGR Iterations = 52 -Final Relative Residual Norm = 7.229063e-09 +Final Relative Residual Norm = 8.514201e-09 # Output file: solvers.out.207 MGR Iterations = 50 -Final Relative Residual Norm = 7.963764e-09 +Final Relative Residual Norm = 9.941525e-09 # Output file: solvers.out.208 -MGR Iterations = 15 -Final Relative Residual Norm = 7.901013e-09 +MGR Iterations = 16 +Final Relative Residual Norm = 5.064272e-09 # Output file: solvers.out.209 -MGR Iterations = 14 -Final Relative Residual Norm = 7.032756e-09 +MGR Iterations = 15 +Final Relative Residual Norm = 7.693914e-09 # Output file: solvers.out.210 -MGR Iterations = 22 -Final Relative Residual Norm = 6.427895e-09 +MGR Iterations = 23 +Final Relative Residual Norm = 4.625304e-09 # Output file: solvers.out.211 MGR Iterations = 29 -Final Relative Residual Norm = 5.774842e-09 +Final Relative Residual Norm = 8.665192e-09 # Output file: solvers.out.212 -Iterations = 5 -Final Relative Residual Norm = 1.371340e-09 +Iterations = 11 +Final Relative Residual Norm = 3.738613e-09 # Output file: solvers.out.213 Iterations = 29 -Final Relative Residual Norm = 5.199506e-09 - -# Output file: solvers.out.300 -hypre_ILU Iterations = 85 -Final Relative Residual Norm = 9.266244e-09 - -# Output file: solvers.out.301 -hypre_ILU Iterations = 40 -Final Relative Residual Norm = 9.772377e-09 - -# Output file: solvers.out.302 -hypre_ILU Iterations = 23 -Final Relative Residual Norm = 5.512717e-09 - -# Output file: solvers.out.303 -hypre_ILU Iterations = 64 -Final Relative Residual Norm = 8.558467e-09 - -# Output file: solvers.out.304 -hypre_ILU Iterations = 52 -Final Relative Residual Norm = 9.189235e-09 - -# Output file: solvers.out.305 -hypre_ILU Iterations = 39 -Final Relative Residual Norm = 8.838453e-09 - -# Output file: solvers.out.306 -hypre_ILU Iterations = 27 -Final Relative Residual Norm = 6.194020e-09 - -# Output file: solvers.out.307 -hypre_ILU Iterations = 39 -Final Relative Residual Norm = 6.866281e-09 - -# Output file: solvers.out.308 -hypre_ILU Iterations = 27 -Final Relative Residual Norm = 9.107681e-09 - -# Output file: solvers.out.309 -hypre_ILU Iterations = 49 -Final Relative Residual Norm = 7.072947e-09 - -# Output file: solvers.out.310 -hypre_ILU Iterations = 42 -Final Relative Residual Norm = 6.699477e-09 - -# Output file: solvers.out.311 -hypre_ILU Iterations = 35 -Final Relative Residual Norm = 8.236857e-09 - -# Output file: solvers.out.312 -hypre_ILU Iterations = 23 -Final Relative Residual Norm = 8.226180e-09 - -# Output file: solvers.out.313 -GMRES Iterations = 25 -Final GMRES Relative Residual Norm = 3.968804e-09 - -# Output file: solvers.out.314 -GMRES Iterations = 19 -Final GMRES Relative Residual Norm = 7.026445e-09 - -# Output file: solvers.out.315 -GMRES Iterations = 20 -Final GMRES Relative Residual Norm = 7.908624e-09 - -# Output file: solvers.out.316 -GMRES Iterations = 13 -Final GMRES Relative Residual Norm = 7.969372e-09 - -# Output file: solvers.out.317 -FlexGMRES Iterations = 17 -Final FlexGMRES Relative Residual Norm = 7.140004e-09 - -# Output file: solvers.out.318 -FlexGMRES Iterations = 9 -Final FlexGMRES Relative Residual Norm = 9.362787e-09 - -# Output file: solvers.out.319 -FlexGMRES Iterations = 17 -Final FlexGMRES Relative Residual Norm = 8.299377e-09 - -# Output file: solvers.out.320 -FlexGMRES Iterations = 9 -Final FlexGMRES Relative Residual Norm = 3.716965e-09 - -# Output file: solvers.out.321 -FlexGMRES Iterations = 17 -Final FlexGMRES Relative Residual Norm = 4.489256e-09 - -# Output file: solvers.out.322 -FlexGMRES Iterations = 9 -Final FlexGMRES Relative Residual Norm = 4.095675e-09 - -# Output file: solvers.out.323 -FlexGMRES Iterations = 18 -Final FlexGMRES Relative Residual Norm = 3.782082e-09 - -# Output file: solvers.out.324 -BoomerAMG Iterations = 10 -Final Relative Residual Norm = 9.027250e-09 +Final Relative Residual Norm = 5.268647e-09 -# Output file: solvers.out.325 -BoomerAMG Iterations = 9 -Final Relative Residual Norm = 2.499887e-09 +# Output file: solvers.out.404 +Iterations = 28 +Final Relative Residual Norm = 8.548826e-09 +# Output file: solvers.out.405 +Iterations = 22 +Final Relative Residual Norm = 7.996427e-09 diff --git a/external/hypre/src/test/TEST_ij/solvers.saved.lassen_cpu b/external/hypre/src/test/TEST_ij/solvers.saved.lassen_cpu new file mode 100644 index 00000000..8b8f0e6b --- /dev/null +++ b/external/hypre/src/test/TEST_ij/solvers.saved.lassen_cpu @@ -0,0 +1,326 @@ +# Output file: solvers.out.0 +Iterations = 7 +Final Relative Residual Norm = 3.087349e-09 + +# Output file: solvers.out.1 +Iterations = 41 +Final Relative Residual Norm = 6.698760e-09 + +# Output file: solvers.out.2 +GMRES Iterations = 7 +Final GMRES Relative Residual Norm = 4.829641e-09 + +# Output file: solvers.out.3 +GMRES Iterations = 93 +Final GMRES Relative Residual Norm = 8.225662e-09 + +# Output file: solvers.out.4 +Iterations = 9 +Final Relative Residual Norm = 3.697151e-09 + +# Output file: solvers.out.5 +Iterations = 196 +Final Relative Residual Norm = 9.097622e-09 + +# Output file: solvers.out.8 +Iterations = 41 +PCG_Iterations = 0 +DSCG_Iterations = 41 +Final Relative Residual Norm = 6.698760e-09 + +# Output file: solvers.out.9 +Iterations = 11 +PCG_Iterations = 7 +DSCG_Iterations = 4 +Final Relative Residual Norm = 6.766130e-10 + +# Output file: solvers.out.10 +Iterations = 9 +PCG_Iterations = 7 +DSCG_Iterations = 2 +Final Relative Residual Norm = 4.829641e-09 + +# Output file: solvers.out.11 +Iterations = 7 +PCG_Iterations = 4 +DSCG_Iterations = 3 +Final Relative Residual Norm = 1.284758e-10 + +# Output file: solvers.out.12 + + +COGMRES Iterations = 7 +Final COGMRES Relative Residual Norm = 4.829641e-09 + +# Output file: solvers.out.13 + + +COGMRES Iterations = 93 +Final COGMRES Relative Residual Norm = 8.225662e-09 + +# Output file: solvers.out.14 + + +COGMRES Iterations = 93 +Final COGMRES Relative Residual Norm = 8.225662e-09 + +# Output file: solvers.out.15 + + +COGMRES Iterations = 93 +Final COGMRES Relative Residual Norm = 8.225662e-09 + +# Output file: solvers.out.16 + + +COGMRES Iterations = 93 +Final COGMRES Relative Residual Norm = 8.225662e-09 + +# Output file: solvers.out.17 +index 19 value -2.647363e-11 + +GMRES Iterations = 7 +Final GMRES Relative Residual Norm = 4.829641e-09 + +# Output file: solvers.out.18 +index 19 value -7.497266e-11 + +GMRES Iterations = 93 +Final GMRES Relative Residual Norm = 8.225662e-09 + +# Output file: solvers.out.19 + + +Iterations = 8 +Final Relative Residual Norm = 2.463498e-09 + +# Output file: solvers.out.20 + + +GMRES Iterations = 7 +Final GMRES Relative Residual Norm = 5.912905e-10 + +# Output file: solvers.out.21 + + +BoomerAMG Iterations = 23 +Final Relative Residual Norm = 5.119642e-09 + +# Output file: solvers.out.22 + + +GMRES Iterations = 11 +Final GMRES Relative Residual Norm = 7.238674e-09 + +# Output file: solvers.out.23 + + +BoomerAMG Iterations = 15 +Final Relative Residual Norm = 5.926430e-09 + +# Output file: solvers.out.24 + + +GMRES Iterations = 9 +Final GMRES Relative Residual Norm = 2.174161e-09 + +# Output file: solvers.out.25 + + +Iterations = 9 +Final Relative Residual Norm = 9.045045e-09 + +# Output file: solvers.out.26 + + +Iterations = 18 +Final Relative Residual Norm = 9.458475e-09 + +# Output file: solvers.out.sysh + Average Convergence Factor = 0.119752 + + Complexity: grid = 1.613875 + operator = 2.860093 + cycle = 5.719888 + +# Output file: solvers.out.sysn + Average Convergence Factor = 0.232267 + + Complexity: grid = 1.592000 + operator = 2.633619 + cycle = 11.267164 + +# Output file: solvers.out.sysu + Average Convergence Factor = 0.419934 + + Complexity: grid = 1.614875 + operator = 2.866222 + cycle = 5.732066 + +# Output file: solvers.out.27 +Iterations = 12 +Final Relative Residual Norm = 5.876623e-09 + +# Output file: solvers.out.28 +Iterations = 18 +Final Relative Residual Norm = 3.457366e-09 + +# Output file: solvers.out.29 +Iterations = 13 +Final Relative Residual Norm = 4.536558e-09 + +# Output file: solvers.out.30 +Iterations = 19 +Final Relative Residual Norm = 3.853111e-09 + +# Output file: solvers.out.101 +LGMRES Iterations = 83 +Final LGMRES Relative Residual Norm = 8.591967e-09 + +# Output file: solvers.out.102 +LGMRES Iterations = 7 +Final LGMRES Relative Residual Norm = 4.829641e-09 + +# Output file: solvers.out.103 +FlexGMRES Iterations = 93 +Final FlexGMRES Relative Residual Norm = 8.225662e-09 + +# Output file: solvers.out.104 +FlexGMRES Iterations = 7 +Final FlexGMRES Relative Residual Norm = 4.829641e-09 + +# Output file: solvers.out.105 +Iterations = 15 +Final Relative Residual Norm = 2.852019e-09 + +# Output file: solvers.out.106 +Iterations = 15 +Final Relative Residual Norm = 2.852019e-09 + +# Output file: solvers.out.107 +Iterations = 22 +Final Relative Residual Norm = 4.376715e-09 + +# Output file: solvers.out.108 +Iterations = 22 +Final Relative Residual Norm = 4.376715e-09 + +# Output file: solvers.out.109 +Iterations = 17 +Final Relative Residual Norm = 6.163208e-09 + +# Output file: solvers.out.110 +Iterations = 17 +Final Relative Residual Norm = 6.163208e-09 + +# Output file: solvers.out.111 +Iterations = 29 +Final Relative Residual Norm = 8.452076e-09 + +# Output file: solvers.out.112 +GMRES Iterations = 23 +Final GMRES Relative Residual Norm = 3.979845e-09 + +# Output file: solvers.out.113 +GMRES Iterations = 25 +Final GMRES Relative Residual Norm = 8.744056e-09 + +# Output file: solvers.out.114 +BoomerAMG Iterations = 16 +Final Relative Residual Norm = 9.190895e-09 + +# Output file: solvers.out.115 +BoomerAMG Iterations = 17 +Final Relative Residual Norm = 4.095117e-09 + +# Output file: solvers.out.116 +GMRES Iterations = 10 +Final GMRES Relative Residual Norm = 8.606250e-10 + +# Output file: solvers.out.117 +GMRES Iterations = 9 +Final GMRES Relative Residual Norm = 9.119362e-09 + +# Output file: solvers.out.118 +GMRES Iterations = 25 +Final GMRES Relative Residual Norm = 9.464475e-09 + +# Output file: solvers.out.119 +GMRES Iterations = 17 +Final GMRES Relative Residual Norm = 3.995718e-09 + +# Output file: solvers.out.121 +GMRES Iterations = 23 +Final GMRES Relative Residual Norm = 9.269997e-09 + +# Output file: solvers.out.122 +GMRES Iterations = 17 +Final GMRES Relative Residual Norm = 3.995718e-09 + +# Output file: solvers.out.120 +GMRES Iterations = 17 +Final GMRES Relative Residual Norm = 3.995717e-09 + +# Output file: solvers.out.200 +MGR Iterations = 6 +Final Relative Residual Norm = 6.980274e-10 + +# Output file: solvers.out.201 +MGR Iterations = 6 +Final Relative Residual Norm = 5.136059e-09 + +# Output file: solvers.out.202 +MGR Iterations = 6 +Final Relative Residual Norm = 6.980274e-10 + +# Output file: solvers.out.203 +MGR Iterations = 6 +Final Relative Residual Norm = 5.136059e-09 + +# Output file: solvers.out.204 +MGR Iterations = 74 +Final Relative Residual Norm = 8.553484e-09 + +# Output file: solvers.out.205 +MGR Iterations = 70 +Final Relative Residual Norm = 9.518056e-09 + +# Output file: solvers.out.206 +MGR Iterations = 52 +Final Relative Residual Norm = 7.228497e-09 + +# Output file: solvers.out.207 +MGR Iterations = 50 +Final Relative Residual Norm = 7.963764e-09 + +# Output file: solvers.out.208 +MGR Iterations = 15 +Final Relative Residual Norm = 7.901013e-09 + +# Output file: solvers.out.209 +MGR Iterations = 14 +Final Relative Residual Norm = 7.561893e-09 + +# Output file: solvers.out.210 +MGR Iterations = 22 +Final Relative Residual Norm = 6.427895e-09 + +# Output file: solvers.out.211 +MGR Iterations = 29 +Final Relative Residual Norm = 5.923832e-09 + +# Output file: solvers.out.212 +Iterations = 5 +Final Relative Residual Norm = 1.371340e-09 + +# Output file: solvers.out.213 +Iterations = 29 +Final Relative Residual Norm = 5.204677e-09 + +# Output file: solvers.out.404 +Iterations = 30 +Final Relative Residual Norm = 8.259159e-09 + +# Output file: solvers.out.405 +Iterations = 24 +Final Relative Residual Norm = 6.793588e-09 diff --git a/external/hypre/src/test/TEST_ij/solvers.saved.ray b/external/hypre/src/test/TEST_ij/solvers.saved.ray deleted file mode 100644 index 8d00ee21..00000000 --- a/external/hypre/src/test/TEST_ij/solvers.saved.ray +++ /dev/null @@ -1,359 +0,0 @@ -# Output file: solvers.out.0 -Iterations = 11 -Final Relative Residual Norm = 7.964594e-09 - -# Output file: solvers.out.1 -Iterations = 41 -Final Relative Residual Norm = 6.698760e-09 - -# Output file: solvers.out.2 -GMRES Iterations = 12 -Final GMRES Relative Residual Norm = 2.545775e-09 - -# Output file: solvers.out.3 -GMRES Iterations = 93 -Final GMRES Relative Residual Norm = 8.225662e-09 - -# Output file: solvers.out.4 -Iterations = 9 -Final Relative Residual Norm = 9.889817e-09 - -# Output file: solvers.out.5 -Iterations = 196 -Final Relative Residual Norm = 9.097622e-09 - -# Output file: solvers.out.8 -Iterations = 41 -PCG_Iterations = 0 -DSCG_Iterations = 41 -Final Relative Residual Norm = 6.698760e-09 - -# Output file: solvers.out.9 -Iterations = 11 -PCG_Iterations = 7 -DSCG_Iterations = 4 -Final Relative Residual Norm = 1.482757e-09 - -# Output file: solvers.out.10 -Iterations = 10 -PCG_Iterations = 8 -DSCG_Iterations = 2 -Final Relative Residual Norm = 6.686412e-10 - -# Output file: solvers.out.11 -Iterations = 7 -PCG_Iterations = 4 -DSCG_Iterations = 3 -Final Relative Residual Norm = 8.612722e-10 - -# Output file: solvers.out.12 - - -COGMRES Iterations = 12 -Final COGMRES Relative Residual Norm = 2.545775e-09 - -# Output file: solvers.out.13 - - -COGMRES Iterations = 93 -Final COGMRES Relative Residual Norm = 8.225662e-09 - -# Output file: solvers.out.14 - - -COGMRES Iterations = 93 -Final COGMRES Relative Residual Norm = 8.225661e-09 - -# Output file: solvers.out.15 - - -COGMRES Iterations = 93 -Final COGMRES Relative Residual Norm = 8.225662e-09 - -# Output file: solvers.out.16 - - -COGMRES Iterations = 93 -Final COGMRES Relative Residual Norm = 8.225661e-09 - -# Output file: solvers.out.17 -index 19 value -1.312641e-11 - -GMRES Iterations = 12 -Final GMRES Relative Residual Norm = 2.545775e-09 - -# Output file: solvers.out.18 -index 19 value -7.497266e-11 - -GMRES Iterations = 93 -Final GMRES Relative Residual Norm = 8.225662e-09 - -# Output file: solvers.out.sysh - Average Convergence Factor = 0.209293 - - Complexity: grid = 1.400375 - operator = 2.672276 - cycle = 5.344534 - -# Output file: solvers.out.sysn - Average Convergence Factor = 0.537935 - - Complexity: grid = 1.391500 - operator = 2.082687 - cycle = 10.165075 - -# Output file: solvers.out.sysu - Average Convergence Factor = 0.777642 - - Complexity: grid = 1.395687 - operator = 2.731768 - cycle = 5.463419 - -# Output file: solvers.out.101 -LGMRES Iterations = 83 -Final LGMRES Relative Residual Norm = 8.591967e-09 - -# Output file: solvers.out.102 -LGMRES Iterations = 13 -Final LGMRES Relative Residual Norm = 2.815593e-09 - -# Output file: solvers.out.103 -FlexGMRES Iterations = 93 -Final FlexGMRES Relative Residual Norm = 8.225662e-09 - -# Output file: solvers.out.104 -FlexGMRES Iterations = 12 -Final FlexGMRES Relative Residual Norm = 2.545775e-09 - -# Output file: solvers.out.105 -Iterations = 19 -Final Relative Residual Norm = 4.347930e-09 - -# Output file: solvers.out.106 -Iterations = 19 -Final Relative Residual Norm = 4.347930e-09 - -# Output file: solvers.out.107 -Iterations = 29 -Final Relative Residual Norm = 7.167010e-09 - -# Output file: solvers.out.108 -Iterations = 29 -Final Relative Residual Norm = 7.167601e-09 - -# Output file: solvers.out.109 -Iterations = 20 -Final Relative Residual Norm = 8.005329e-09 - -# Output file: solvers.out.110 -Iterations = 20 -Final Relative Residual Norm = 8.005329e-09 - -# Output file: solvers.out.111 -Iterations = 32 -Final Relative Residual Norm = 6.308682e-09 - -# Output file: solvers.out.112 -GMRES Iterations = 38 -Final GMRES Relative Residual Norm = 7.222663e-09 - -# Output file: solvers.out.113 -GMRES Iterations = 26 -Final GMRES Relative Residual Norm = 6.905243e-09 - -# Output file: solvers.out.114 -BoomerAMG Iterations = 34 -Final Relative Residual Norm = 6.453416e-09 - -# Output file: solvers.out.115 -BoomerAMG Iterations = 34 -Final Relative Residual Norm = 5.870423e-09 - -# Output file: solvers.out.116 -GMRES Iterations = 14 -Final GMRES Relative Residual Norm = 9.589221e-09 - -# Output file: solvers.out.117 -GMRES Iterations = 14 -Final GMRES Relative Residual Norm = 9.589221e-09 - -# Output file: solvers.out.118 -GMRES Iterations = 27 -Final GMRES Relative Residual Norm = 5.487850e-09 - -# Output file: solvers.out.119 -GMRES Iterations = 19 -Final GMRES Relative Residual Norm = 5.040776e-09 - -# Output file: solvers.out.121 -GMRES Iterations = 25 -Final GMRES Relative Residual Norm = 7.473980e-09 - -# Output file: solvers.out.122 -GMRES Iterations = 19 -Final GMRES Relative Residual Norm = 5.040776e-09 - -# Output file: solvers.out.120 -GMRES Iterations = 19 -Final GMRES Relative Residual Norm = 5.041387e-09 - -# Output file: solvers.out.200 -MGR Iterations = 6 -Final Relative Residual Norm = 6.980276e-10 - -# Output file: solvers.out.201 -MGR Iterations = 6 -Final Relative Residual Norm = 5.136059e-09 - -# Output file: solvers.out.202 -MGR Iterations = 6 -Final Relative Residual Norm = 6.980276e-10 - -# Output file: solvers.out.203 -MGR Iterations = 6 -Final Relative Residual Norm = 5.136059e-09 - -# Output file: solvers.out.204 -MGR Iterations = 74 -Final Relative Residual Norm = 8.553927e-09 - -# Output file: solvers.out.205 -MGR Iterations = 70 -Final Relative Residual Norm = 9.518056e-09 - -# Output file: solvers.out.206 -MGR Iterations = 52 -Final Relative Residual Norm = 7.229063e-09 - -# Output file: solvers.out.207 -MGR Iterations = 50 -Final Relative Residual Norm = 7.963764e-09 - -# Output file: solvers.out.208 -MGR Iterations = 15 -Final Relative Residual Norm = 7.901013e-09 - -# Output file: solvers.out.209 -MGR Iterations = 14 -Final Relative Residual Norm = 7.032756e-09 - -# Output file: solvers.out.210 -MGR Iterations = 22 -Final Relative Residual Norm = 6.427895e-09 - -# Output file: solvers.out.211 -MGR Iterations = 29 -Final Relative Residual Norm = 5.774842e-09 - -# Output file: solvers.out.212 -Iterations = 5 -Final Relative Residual Norm = 1.371340e-09 - -# Output file: solvers.out.213 -Iterations = 29 -Final Relative Residual Norm = 5.199506e-09 - -# Output file: solvers.out.300 -hypre_ILU Iterations = 85 -Final Relative Residual Norm = 9.266244e-09 - -# Output file: solvers.out.301 -hypre_ILU Iterations = 40 -Final Relative Residual Norm = 9.772377e-09 - -# Output file: solvers.out.302 -hypre_ILU Iterations = 23 -Final Relative Residual Norm = 5.512717e-09 - -# Output file: solvers.out.303 -hypre_ILU Iterations = 64 -Final Relative Residual Norm = 8.558467e-09 - -# Output file: solvers.out.304 -hypre_ILU Iterations = 52 -Final Relative Residual Norm = 9.189235e-09 - -# Output file: solvers.out.305 -hypre_ILU Iterations = 39 -Final Relative Residual Norm = 8.838453e-09 - -# Output file: solvers.out.306 -hypre_ILU Iterations = 27 -Final Relative Residual Norm = 6.194020e-09 - -# Output file: solvers.out.307 -hypre_ILU Iterations = 39 -Final Relative Residual Norm = 6.866281e-09 - -# Output file: solvers.out.308 -hypre_ILU Iterations = 27 -Final Relative Residual Norm = 9.107681e-09 - -# Output file: solvers.out.309 -hypre_ILU Iterations = 49 -Final Relative Residual Norm = 7.072947e-09 - -# Output file: solvers.out.310 -hypre_ILU Iterations = 42 -Final Relative Residual Norm = 6.699477e-09 - -# Output file: solvers.out.311 -hypre_ILU Iterations = 35 -Final Relative Residual Norm = 8.236857e-09 - -# Output file: solvers.out.312 -hypre_ILU Iterations = 23 -Final Relative Residual Norm = 8.226180e-09 - -# Output file: solvers.out.313 -GMRES Iterations = 25 -Final GMRES Relative Residual Norm = 3.968804e-09 - -# Output file: solvers.out.314 -GMRES Iterations = 19 -Final GMRES Relative Residual Norm = 7.026445e-09 - -# Output file: solvers.out.315 -GMRES Iterations = 20 -Final GMRES Relative Residual Norm = 7.908624e-09 - -# Output file: solvers.out.316 -GMRES Iterations = 13 -Final GMRES Relative Residual Norm = 7.969372e-09 - -# Output file: solvers.out.317 -FlexGMRES Iterations = 17 -Final FlexGMRES Relative Residual Norm = 7.140004e-09 - -# Output file: solvers.out.318 -FlexGMRES Iterations = 9 -Final FlexGMRES Relative Residual Norm = 9.362787e-09 - -# Output file: solvers.out.319 -FlexGMRES Iterations = 17 -Final FlexGMRES Relative Residual Norm = 8.299377e-09 - -# Output file: solvers.out.320 -FlexGMRES Iterations = 9 -Final FlexGMRES Relative Residual Norm = 3.716965e-09 - -# Output file: solvers.out.321 -FlexGMRES Iterations = 17 -Final FlexGMRES Relative Residual Norm = 4.489256e-09 - -# Output file: solvers.out.322 -FlexGMRES Iterations = 9 -Final FlexGMRES Relative Residual Norm = 4.095675e-09 - -# Output file: solvers.out.323 -FlexGMRES Iterations = 18 -Final FlexGMRES Relative Residual Norm = 3.782082e-09 - -# Output file: solvers.out.324 -BoomerAMG Iterations = 10 -Final Relative Residual Norm = 9.027251e-09 - -# Output file: solvers.out.325 -BoomerAMG Iterations = 9 -Final Relative Residual Norm = 2.499887e-09 - diff --git a/external/hypre/src/test/TEST_ij/solvers.sh b/external/hypre/src/test/TEST_ij/solvers.sh old mode 100644 new mode 100755 index 6231754f..661a0609 --- a/external/hypre/src/test/TEST_ij/solvers.sh +++ b/external/hypre/src/test/TEST_ij/solvers.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -32,23 +32,6 @@ tail -17 ${TNAME}.out.200 | head -6 > ${TNAME}.mgr_testdata tail -17 ${TNAME}.out.202 | head -6 > ${TNAME}.mgr_testdata.temp diff ${TNAME}.mgr_testdata ${TNAME}.mgr_testdata.temp >&2 -#============================================================================= -tail -3 ${TNAME}.out.400.p | head -2 > ${TNAME}.testdata -tail -3 ${TNAME}.out.400.n | head -2 > ${TNAME}.testdata.temp -diff ${TNAME}.testdata ${TNAME}.testdata.temp >&2 - -tail -3 ${TNAME}.out.401.p | head -2 > ${TNAME}.testdata -tail -3 ${TNAME}.out.401.n | head -2 > ${TNAME}.testdata.temp -diff ${TNAME}.testdata ${TNAME}.testdata.temp >&2 - -tail -3 ${TNAME}.out.402.p | head -2 > ${TNAME}.testdata -tail -3 ${TNAME}.out.402.n | head -2 > ${TNAME}.testdata.temp -diff ${TNAME}.testdata ${TNAME}.testdata.temp >&2 - -tail -3 ${TNAME}.out.403.p | head -2 > ${TNAME}.testdata -tail -3 ${TNAME}.out.403.n | head -2 > ${TNAME}.testdata.temp -diff ${TNAME}.testdata ${TNAME}.testdata.temp >&2 - #============================================================================= # compare with baseline case #============================================================================= @@ -89,6 +72,14 @@ FILES="\ ${TNAME}.out.16\ ${TNAME}.out.17\ ${TNAME}.out.18\ + ${TNAME}.out.19\ + ${TNAME}.out.20\ + ${TNAME}.out.21\ + ${TNAME}.out.22\ + ${TNAME}.out.23\ + ${TNAME}.out.24\ + ${TNAME}.out.25\ + ${TNAME}.out.26 " for i in $FILES @@ -124,6 +115,10 @@ if [ "$OUTCOUNT" != "$RUNCOUNT" ]; then fi FILES="\ + ${TNAME}.out.27\ + ${TNAME}.out.28\ + ${TNAME}.out.29\ + ${TNAME}.out.30\ ${TNAME}.out.101\ ${TNAME}.out.102\ ${TNAME}.out.103\ @@ -176,6 +171,8 @@ FILES="\ ${TNAME}.out.211\ ${TNAME}.out.212\ ${TNAME}.out.213\ + ${TNAME}.out.404\ + ${TNAME}.out.405\ " for i in $FILES @@ -191,48 +188,6 @@ if [ "$OUTCOUNT" != "$RUNCOUNT" ]; then echo "Incorrect number of runs in ${TNAME}.out" >&2 fi -FILES="\ - ${TNAME}.out.300\ - ${TNAME}.out.301\ - ${TNAME}.out.302\ - ${TNAME}.out.303\ - ${TNAME}.out.304\ - ${TNAME}.out.305\ - ${TNAME}.out.306\ - ${TNAME}.out.307\ - ${TNAME}.out.308\ - ${TNAME}.out.309\ - ${TNAME}.out.310\ - ${TNAME}.out.311\ - ${TNAME}.out.312\ - ${TNAME}.out.313\ - ${TNAME}.out.314\ - ${TNAME}.out.315\ - ${TNAME}.out.316\ - ${TNAME}.out.317\ - ${TNAME}.out.318\ - ${TNAME}.out.319\ - ${TNAME}.out.320\ - ${TNAME}.out.321\ - ${TNAME}.out.322\ - ${TNAME}.out.323\ - ${TNAME}.out.324\ - ${TNAME}.out.325\ -" - -for i in $FILES -do - echo "# Output file: $i" - tail -3 $i -done > ${TNAME}.out.f - -# Make sure that the output file is reasonable -RUNCOUNT=`echo $FILES | wc -w` -OUTCOUNT=`grep "Iterations" ${TNAME}.out.f | wc -l` -if [ "$OUTCOUNT" != "$RUNCOUNT" ]; then - echo "Incorrect number of runs in ${TNAME}.out" >&2 -fi - # put all of the output files together cat ${TNAME}.out.[a-z] > ${TNAME}.out diff --git a/external/hypre/src/test/TEST_ij/state.jobs b/external/hypre/src/test/TEST_ij/state.jobs new file mode 100755 index 00000000..c7ab0bc1 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/state.jobs @@ -0,0 +1,13 @@ +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +#============================================================================= +# Test library initialization (sequential and parallel) +#============================================================================= + +mpirun -np 1 ./ij -test_init > state.out.1 +mpirun -np 4 ./ij -test_init > state.out.100 + diff --git a/external/hypre/src/test/TEST_ij/state.saved b/external/hypre/src/test/TEST_ij/state.saved new file mode 100644 index 00000000..911e5e90 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/state.saved @@ -0,0 +1,13 @@ +# Output file: state.out.1 +hypre library has not been initialized or finalized yet +hypre library has been initialized +hypre library has been finalized +hypre library has been re-initialized +hypre library has been finalized + +# Output file: state.out.100 +hypre library has not been initialized or finalized yet +hypre library has been initialized +hypre library has been finalized +hypre library has been re-initialized +hypre library has been finalized diff --git a/external/hypre/src/test/TEST_ij/state.saved.aurora b/external/hypre/src/test/TEST_ij/state.saved.aurora new file mode 100644 index 00000000..2f62682b --- /dev/null +++ b/external/hypre/src/test/TEST_ij/state.saved.aurora @@ -0,0 +1,8 @@ +# Output file: state.out.1 +hypre library has been finalized +hypre library has been re-initialized +hypre library has been finalized +# Output file: state.out.100 +hypre library has been finalized +hypre library has been re-initialized +hypre library has been finalized diff --git a/external/hypre/src/test/TEST_ij/state.saved.lassen b/external/hypre/src/test/TEST_ij/state.saved.lassen new file mode 100644 index 00000000..911e5e90 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/state.saved.lassen @@ -0,0 +1,13 @@ +# Output file: state.out.1 +hypre library has not been initialized or finalized yet +hypre library has been initialized +hypre library has been finalized +hypre library has been re-initialized +hypre library has been finalized + +# Output file: state.out.100 +hypre library has not been initialized or finalized yet +hypre library has been initialized +hypre library has been finalized +hypre library has been re-initialized +hypre library has been finalized diff --git a/external/hypre/src/test/TEST_ij/state.saved.lassen_cpu b/external/hypre/src/test/TEST_ij/state.saved.lassen_cpu new file mode 100644 index 00000000..911e5e90 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/state.saved.lassen_cpu @@ -0,0 +1,13 @@ +# Output file: state.out.1 +hypre library has not been initialized or finalized yet +hypre library has been initialized +hypre library has been finalized +hypre library has been re-initialized +hypre library has been finalized + +# Output file: state.out.100 +hypre library has not been initialized or finalized yet +hypre library has been initialized +hypre library has been finalized +hypre library has been re-initialized +hypre library has been finalized diff --git a/external/hypre/src/test/TEST_ij/state.sh b/external/hypre/src/test/TEST_ij/state.sh new file mode 100755 index 00000000..ea1e7538 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/state.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +TNAME=`basename $0 .sh` + +#============================================================================= +# Compare with baseline case +#============================================================================= + +FILES="\ + ${TNAME}.out.1\ + ${TNAME}.out.100\ +" + +for i in $FILES +do + echo "# Output file: $i" + tail -3 $i +done > ${TNAME}.out + diff --git a/external/hypre/src/test/TEST_ij/tst.00000 b/external/hypre/src/test/TEST_ij/tst.00000 new file mode 100644 index 00000000..63198e18 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/tst.00000 @@ -0,0 +1,21 @@ +0 15 0 15 +0 0 2.0 +1 1 2.0 +2 2 2.0 +2 3 -1.0 +3 2 -1.0 +3 3 2.0 +4 4 2.0 +5 5 2.0 +6 6 2.0 +7 7 2.0 +8 8 2.0 +9 9 2.0 +9 10 -1.0 +10 10 2.0 +11 11 2.0 +12 12 2.0 +13 13 2.0 +14 13 -1.0 +14 14 2.0 +15 15 2.0 diff --git a/external/hypre/src/test/TEST_ij/tst.00001 b/external/hypre/src/test/TEST_ij/tst.00001 new file mode 100644 index 00000000..856a4b76 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/tst.00001 @@ -0,0 +1,20 @@ +16 31 16 31 +16 16 2.0 +17 17 2.0 +18 18 2.0 +18 19 -1.0 +19 18 -1.0 +19 19 2.0 +20 20 2.0 +21 21 2.0 +22 22 2.0 +23 23 2.0 +24 24 2.0 +25 25 2.0 +25 26 -1.0 +26 26 2.0 +27 27 2.0 +28 28 2.0 +29 29 2.0 +30 30 2.0 +31 31 2.0 diff --git a/external/hypre/src/test/TEST_ij/vector.jobs b/external/hypre/src/test/TEST_ij/vector.jobs new file mode 100755 index 00000000..3b65f7b2 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/vector.jobs @@ -0,0 +1,51 @@ +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +#============================================================================= +# A. set/get: multi-component vector tests +#============================================================================= + +mpirun -np 1 ./ij -test_multivec 1 -solver -2 -rhsisone -nc 2 > vector.out.A0 +mpirun -np 1 ./ij -test_multivec 1 -solver -2 -rhsisone -nc 4 > vector.out.A1 +mpirun -np 1 ./ij -test_multivec 1 -solver -2 -rhsisone -nc 7 > vector.out.A2 +mpirun -np 2 ./ij -test_multivec 1 -solver -2 -rhsisone -nc 7 > vector.out.A3 +mpirun -np 4 ./ij -test_multivec 1 -solver -2 -rhsisone -nc 7 > vector.out.A4 +mpirun -np 1 ./ij -test_multivec 1 -solver -2 -rhsrand -nc 3 > vector.out.A5 +mpirun -np 2 ./ij -test_multivec 1 -solver -2 -rhsrand -nc 3 > vector.out.A6 +mpirun -np 1 ./ij -test_multivec 1 -solver -2 -rhszero -nc 2 > vector.out.A7 +mpirun -np 2 ./ij -test_multivec 1 -solver -2 -rhszero -nc 2 > vector.out.A8 +mpirun -np 1 ./ij -test_multivec 1 -solver -2 -xisone -nc 2 > vector.out.A9 +mpirun -np 2 ./ij -test_multivec 1 -solver -2 -xisone -nc 2 > vector.out.A10 + +#============================================================================= +# B. krylov solvers: multi-component vector tests +#============================================================================= + +# Diagonal scaling (sequential) +mpirun -np 1 ./ij -n 8 8 8 -solver 2 -rhsisone -nc 4 > vector.out.B0 +mpirun -np 1 ./ij -n 8 8 8 -solver 4 -rhsisone -nc 4 > vector.out.B1 +mpirun -np 1 ./ij -n 8 8 8 -solver 6 -rhsisone -nc 4 > vector.out.B2 +mpirun -np 1 ./ij -n 8 8 8 -solver 10 -rhsisone -nc 4 > vector.out.B3 +mpirun -np 1 ./ij -n 8 8 8 -solver 50 -rhsisone -nc 4 > vector.out.B4 +mpirun -np 1 ./ij -n 8 8 8 -solver 60 -rhsisone -nc 4 > vector.out.B5 +mpirun -np 1 ./ij -n 8 8 8 -solver 2 -rhsisone -nc 3 > vector.out.B6 +mpirun -np 1 ./ij -n 8 8 8 -solver 2 -rhsisone -nc 7 > vector.out.B7 +mpirun -np 1 ./ij -n 8 8 8 -solver 2 -rhsisone -nc 10 > vector.out.B8 +mpirun -np 1 ./ij -n 8 8 8 -solver 2 -rhsisone -nc 15 > vector.out.B9 +mpirun -np 1 ./ij -n 8 8 8 -solver 2 -rhsisone -nc 32 > vector.out.B10 + +# Diagonal scaling (parallel) +mpirun -np 4 ./ij -n 8 8 8 -solver 2 -rhsisone -nc 6 > vector.out.B100 +mpirun -np 4 ./ij -n 8 8 8 -solver 4 -rhsisone -nc 6 > vector.out.B101 +mpirun -np 4 ./ij -n 8 8 8 -solver 6 -rhsisone -nc 6 > vector.out.B102 +mpirun -np 4 ./ij -n 8 8 8 -solver 10 -rhsisone -nc 6 > vector.out.B103 +mpirun -np 4 ./ij -n 8 8 8 -solver 50 -rhsisone -nc 6 > vector.out.B104 +mpirun -np 4 ./ij -n 8 8 8 -solver 60 -rhsisone -nc 6 > vector.out.B105 +mpirun -np 4 ./ij -n 8 8 8 -solver 2 -rhsisone -nc 3 > vector.out.B106 +mpirun -np 4 ./ij -n 8 8 8 -solver 2 -rhsisone -nc 7 > vector.out.B107 +mpirun -np 4 ./ij -n 8 8 8 -solver 2 -rhsisone -nc 10 > vector.out.B108 +mpirun -np 4 ./ij -n 8 8 8 -solver 2 -rhsisone -nc 15 > vector.out.B109 +mpirun -np 4 ./ij -n 8 8 8 -solver 2 -rhsisone -nc 32 > vector.out.B110 diff --git a/external/hypre/src/test/TEST_ij/vector.saved b/external/hypre/src/test/TEST_ij/vector.saved new file mode 100644 index 00000000..1cdae576 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/vector.saved @@ -0,0 +1,121 @@ +# Output file: vector.out.A0 +Vector/Multivector error = 0.000000e+00 + +# Output file: vector.out.A1 +Vector/Multivector error = 0.000000e+00 + +# Output file: vector.out.A2 +Vector/Multivector error = 0.000000e+00 + +# Output file: vector.out.A3 +Vector/Multivector error = 0.000000e+00 + +# Output file: vector.out.A4 +Vector/Multivector error = 0.000000e+00 + +# Output file: vector.out.A5 +Vector/Multivector error = 0.000000e+00 + +# Output file: vector.out.A6 +Vector/Multivector error = 0.000000e+00 + +# Output file: vector.out.A7 +Vector/Multivector error = 0.000000e+00 + +# Output file: vector.out.A8 +Vector/Multivector error = 0.000000e+00 + +# Output file: vector.out.A9 +Vector/Multivector error = 0.000000e+00 + +# Output file: vector.out.A10 +Vector/Multivector error = 0.000000e+00 + +# Output file: vector.out.B0 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + +# Output file: vector.out.B1 +GMRES Iterations = 54 +Final GMRES Relative Residual Norm = 7.982372e-09 + +# Output file: vector.out.B2 +Iterations = 202 +Final Relative Residual Norm = 9.657758e-09 + +# Output file: vector.out.B3 +BiCGSTAB Iterations = 12 +Final BiCGSTAB Relative Residual Norm = 6.282586e-09 + +# Output file: vector.out.B4 +LGMRES Iterations = 53 +Final LGMRES Relative Residual Norm = 8.975949e-09 + +# Output file: vector.out.B5 +FlexGMRES Iterations = 54 +Final FlexGMRES Relative Residual Norm = 7.982372e-09 + +# Output file: vector.out.B6 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + +# Output file: vector.out.B7 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + +# Output file: vector.out.B8 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + +# Output file: vector.out.B9 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + +# Output file: vector.out.B10 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + +# Output file: vector.out.B100 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + +# Output file: vector.out.B101 +GMRES Iterations = 54 +Final GMRES Relative Residual Norm = 7.982371e-09 + +# Output file: vector.out.B102 +Iterations = 202 +Final Relative Residual Norm = 9.504933e-09 + +# Output file: vector.out.B103 +BiCGSTAB Iterations = 12 +Final BiCGSTAB Relative Residual Norm = 6.282586e-09 + +# Output file: vector.out.B104 +LGMRES Iterations = 53 +Final LGMRES Relative Residual Norm = 8.975947e-09 + +# Output file: vector.out.B105 +FlexGMRES Iterations = 54 +Final FlexGMRES Relative Residual Norm = 7.982371e-09 + +# Output file: vector.out.B106 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + +# Output file: vector.out.B107 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + +# Output file: vector.out.B108 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + +# Output file: vector.out.B109 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + +# Output file: vector.out.B110 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + diff --git a/external/hypre/src/test/TEST_ij/vector.saved.aurora b/external/hypre/src/test/TEST_ij/vector.saved.aurora new file mode 100644 index 00000000..f214749c --- /dev/null +++ b/external/hypre/src/test/TEST_ij/vector.saved.aurora @@ -0,0 +1,121 @@ +# Output file: vector.out.A0 +Vector/Multivector error = 0.000000e+00 + +# Output file: vector.out.A1 +Vector/Multivector error = 0.000000e+00 + +# Output file: vector.out.A2 +Vector/Multivector error = 0.000000e+00 + +# Output file: vector.out.A3 +Vector/Multivector error = 0.000000e+00 + +# Output file: vector.out.A4 +Vector/Multivector error = 0.000000e+00 + +# Output file: vector.out.A5 +Vector/Multivector error = 0.000000e+00 + +# Output file: vector.out.A6 +Vector/Multivector error = 0.000000e+00 + +# Output file: vector.out.A7 +Vector/Multivector error = 0.000000e+00 + +# Output file: vector.out.A8 +Vector/Multivector error = 0.000000e+00 + +# Output file: vector.out.A9 +Vector/Multivector error = 0.000000e+00 + +# Output file: vector.out.A10 +Vector/Multivector error = 0.000000e+00 + +# Output file: vector.out.B0 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + +# Output file: vector.out.B1 +GMRES Iterations = 54 +Final GMRES Relative Residual Norm = 7.982371e-09 + +# Output file: vector.out.B2 +Iterations = 202 +Final Relative Residual Norm = 9.559932e-09 + +# Output file: vector.out.B3 +BiCGSTAB Iterations = 12 +Final BiCGSTAB Relative Residual Norm = 6.282586e-09 + +# Output file: vector.out.B4 +LGMRES Iterations = 53 +Final LGMRES Relative Residual Norm = 8.975949e-09 + +# Output file: vector.out.B5 +FlexGMRES Iterations = 54 +Final FlexGMRES Relative Residual Norm = 7.982371e-09 + +# Output file: vector.out.B6 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + +# Output file: vector.out.B7 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + +# Output file: vector.out.B8 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + +# Output file: vector.out.B9 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + +# Output file: vector.out.B10 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + +# Output file: vector.out.B100 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + +# Output file: vector.out.B101 +GMRES Iterations = 54 +Final GMRES Relative Residual Norm = 7.982371e-09 + +# Output file: vector.out.B102 +Iterations = 202 +Final Relative Residual Norm = 9.508045e-09 + +# Output file: vector.out.B103 +BiCGSTAB Iterations = 12 +Final BiCGSTAB Relative Residual Norm = 6.282586e-09 + +# Output file: vector.out.B104 +LGMRES Iterations = 53 +Final LGMRES Relative Residual Norm = 8.975948e-09 + +# Output file: vector.out.B105 +FlexGMRES Iterations = 54 +Final FlexGMRES Relative Residual Norm = 7.982371e-09 + +# Output file: vector.out.B106 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + +# Output file: vector.out.B107 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + +# Output file: vector.out.B108 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + +# Output file: vector.out.B109 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + +# Output file: vector.out.B110 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + diff --git a/external/hypre/src/test/TEST_ij/vector.saved.lassen b/external/hypre/src/test/TEST_ij/vector.saved.lassen new file mode 100644 index 00000000..5d1d219e --- /dev/null +++ b/external/hypre/src/test/TEST_ij/vector.saved.lassen @@ -0,0 +1,121 @@ +# Output file: vector.out.A0 +Vector/Multivector error = 0.000000e+00 + +# Output file: vector.out.A1 +Vector/Multivector error = 0.000000e+00 + +# Output file: vector.out.A2 +Vector/Multivector error = 0.000000e+00 + +# Output file: vector.out.A3 +Vector/Multivector error = 0.000000e+00 + +# Output file: vector.out.A4 +Vector/Multivector error = 0.000000e+00 + +# Output file: vector.out.A5 +Vector/Multivector error = 0.000000e+00 + +# Output file: vector.out.A6 +Vector/Multivector error = 0.000000e+00 + +# Output file: vector.out.A7 +Vector/Multivector error = 0.000000e+00 + +# Output file: vector.out.A8 +Vector/Multivector error = 0.000000e+00 + +# Output file: vector.out.A9 +Vector/Multivector error = 0.000000e+00 + +# Output file: vector.out.A10 +Vector/Multivector error = 0.000000e+00 + +# Output file: vector.out.B0 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + +# Output file: vector.out.B1 +GMRES Iterations = 54 +Final GMRES Relative Residual Norm = 7.982372e-09 + +# Output file: vector.out.B2 +Iterations = 202 +Final Relative Residual Norm = 9.613027e-09 + +# Output file: vector.out.B3 +BiCGSTAB Iterations = 12 +Final BiCGSTAB Relative Residual Norm = 6.282586e-09 + +# Output file: vector.out.B4 +LGMRES Iterations = 53 +Final LGMRES Relative Residual Norm = 8.975949e-09 + +# Output file: vector.out.B5 +FlexGMRES Iterations = 54 +Final FlexGMRES Relative Residual Norm = 7.982372e-09 + +# Output file: vector.out.B6 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + +# Output file: vector.out.B7 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + +# Output file: vector.out.B8 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + +# Output file: vector.out.B9 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + +# Output file: vector.out.B10 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + +# Output file: vector.out.B100 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + +# Output file: vector.out.B101 +GMRES Iterations = 54 +Final GMRES Relative Residual Norm = 7.982371e-09 + +# Output file: vector.out.B102 +Iterations = 202 +Final Relative Residual Norm = 9.550922e-09 + +# Output file: vector.out.B103 +BiCGSTAB Iterations = 12 +Final BiCGSTAB Relative Residual Norm = 6.282586e-09 + +# Output file: vector.out.B104 +LGMRES Iterations = 53 +Final LGMRES Relative Residual Norm = 8.975948e-09 + +# Output file: vector.out.B105 +FlexGMRES Iterations = 54 +Final FlexGMRES Relative Residual Norm = 7.982371e-09 + +# Output file: vector.out.B106 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + +# Output file: vector.out.B107 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + +# Output file: vector.out.B108 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + +# Output file: vector.out.B109 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + +# Output file: vector.out.B110 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + diff --git a/external/hypre/src/test/TEST_ij/vector.saved.lassen_cpu b/external/hypre/src/test/TEST_ij/vector.saved.lassen_cpu new file mode 100644 index 00000000..911cdbda --- /dev/null +++ b/external/hypre/src/test/TEST_ij/vector.saved.lassen_cpu @@ -0,0 +1,121 @@ +# Output file: vector.out.A0 +Vector/Multivector error = 0.000000e+00 + +# Output file: vector.out.A1 +Vector/Multivector error = 0.000000e+00 + +# Output file: vector.out.A2 +Vector/Multivector error = 0.000000e+00 + +# Output file: vector.out.A3 +Vector/Multivector error = 0.000000e+00 + +# Output file: vector.out.A4 +Vector/Multivector error = 0.000000e+00 + +# Output file: vector.out.A5 +Vector/Multivector error = 0.000000e+00 + +# Output file: vector.out.A6 +Vector/Multivector error = 0.000000e+00 + +# Output file: vector.out.A7 +Vector/Multivector error = 0.000000e+00 + +# Output file: vector.out.A8 +Vector/Multivector error = 0.000000e+00 + +# Output file: vector.out.A9 +Vector/Multivector error = 0.000000e+00 + +# Output file: vector.out.A10 +Vector/Multivector error = 0.000000e+00 + +# Output file: vector.out.B0 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + +# Output file: vector.out.B1 +GMRES Iterations = 54 +Final GMRES Relative Residual Norm = 7.982370e-09 + +# Output file: vector.out.B2 +Iterations = 202 +Final Relative Residual Norm = 9.611457e-09 + +# Output file: vector.out.B3 +BiCGSTAB Iterations = 12 +Final BiCGSTAB Relative Residual Norm = 6.282586e-09 + +# Output file: vector.out.B4 +LGMRES Iterations = 53 +Final LGMRES Relative Residual Norm = 8.975949e-09 + +# Output file: vector.out.B5 +FlexGMRES Iterations = 54 +Final FlexGMRES Relative Residual Norm = 7.982370e-09 + +# Output file: vector.out.B6 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + +# Output file: vector.out.B7 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + +# Output file: vector.out.B8 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + +# Output file: vector.out.B9 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + +# Output file: vector.out.B10 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + +# Output file: vector.out.B100 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + +# Output file: vector.out.B101 +GMRES Iterations = 54 +Final GMRES Relative Residual Norm = 7.982371e-09 + +# Output file: vector.out.B102 +Iterations = 202 +Final Relative Residual Norm = 9.570265e-09 + +# Output file: vector.out.B103 +BiCGSTAB Iterations = 12 +Final BiCGSTAB Relative Residual Norm = 6.282586e-09 + +# Output file: vector.out.B104 +LGMRES Iterations = 53 +Final LGMRES Relative Residual Norm = 8.975946e-09 + +# Output file: vector.out.B105 +FlexGMRES Iterations = 54 +Final FlexGMRES Relative Residual Norm = 7.982371e-09 + +# Output file: vector.out.B106 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + +# Output file: vector.out.B107 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + +# Output file: vector.out.B108 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + +# Output file: vector.out.B109 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + +# Output file: vector.out.B110 +Iterations = 18 +Final Relative Residual Norm = 3.923978e-09 + diff --git a/external/hypre/src/test/TEST_ij/vector.sh b/external/hypre/src/test/TEST_ij/vector.sh new file mode 100755 index 00000000..c4ad58d3 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/vector.sh @@ -0,0 +1,85 @@ +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +TNAME=`basename $0 .sh` +RTOL=$1 +ATOL=$2 + +#============================================================================= +# A. set/get: multi-component vector tests +#============================================================================= + +FILES="\ + ${TNAME}.out.A0\ + ${TNAME}.out.A1\ + ${TNAME}.out.A2\ + ${TNAME}.out.A3\ + ${TNAME}.out.A4\ + ${TNAME}.out.A5\ + ${TNAME}.out.A6\ + ${TNAME}.out.A7\ + ${TNAME}.out.A8\ + ${TNAME}.out.A9\ + ${TNAME}.out.A10 +" + +for i in $FILES +do + echo "# Output file: $i" + tail -2 $i +done > ${TNAME}.out.A + +# Make sure that the output file is reasonable +RUNCOUNT=`echo $FILES | wc -w` +OUTCOUNT=`grep "Vector/Multivector error" ${TNAME}.out.A | wc -l` +if [ "$OUTCOUNT" != "$RUNCOUNT" ]; then + echo "Incorrect number of runs in ${TNAME}.out.A" >&2 +fi + +#============================================================================= +# B. krylov solvers: multi-component vector tests +#============================================================================= + +FILES="\ + ${TNAME}.out.B0\ + ${TNAME}.out.B1\ + ${TNAME}.out.B2\ + ${TNAME}.out.B3\ + ${TNAME}.out.B4\ + ${TNAME}.out.B5\ + ${TNAME}.out.B6\ + ${TNAME}.out.B7\ + ${TNAME}.out.B8\ + ${TNAME}.out.B9\ + ${TNAME}.out.B10\ + ${TNAME}.out.B100\ + ${TNAME}.out.B101\ + ${TNAME}.out.B102\ + ${TNAME}.out.B103\ + ${TNAME}.out.B104\ + ${TNAME}.out.B105\ + ${TNAME}.out.B106\ + ${TNAME}.out.B107\ + ${TNAME}.out.B108\ + ${TNAME}.out.B109\ + ${TNAME}.out.B110 +" + +for i in $FILES +do + echo "# Output file: $i" + tail -3 $i +done > ${TNAME}.out.B + +# Make sure that the output file is reasonable +RUNCOUNT=`echo $FILES | wc -w` +OUTCOUNT=`grep "Iterations" ${TNAME}.out.B | wc -l` +if [ "$OUTCOUNT" != "$RUNCOUNT" ]; then + echo "Incorrect number of runs in ${TNAME}.out.B" >&2 +fi + +# put all of the output files together +cat ${TNAME}.out.[A-Z] > ${TNAME}.out diff --git a/external/hypre/src/test/TEST_ij/versioncheck.jobs b/external/hypre/src/test/TEST_ij/versioncheck.jobs new file mode 100755 index 00000000..3bb0fb88 --- /dev/null +++ b/external/hypre/src/test/TEST_ij/versioncheck.jobs @@ -0,0 +1,12 @@ +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +#============================================================================= +# Check the version header file variables +#============================================================================= + +mpirun -np 1 ./ij > versioncheck.out.1 + diff --git a/external/hypre/src/test/TEST_ij/versioncheck.sh b/external/hypre/src/test/TEST_ij/versioncheck.sh new file mode 100755 index 00000000..87db6aaf --- /dev/null +++ b/external/hypre/src/test/TEST_ij/versioncheck.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +TNAME=`basename $0 .sh` + +#============================================================================= +# Check the HYPRE_DEVELOP variables +#============================================================================= + +grep "Using HYPRE_DEVELOP_STRING" ${TNAME}.out.1 > ${TNAME}.testdata + +echo -n > ${TNAME}.testdatacheck +if [ -d ../../../.git ]; then + DEVSTRING=`git describe --match 'v*' --long --abbrev=9 2>/dev/null` + DEVNUMBER=`echo $DEVSTRING | awk -F- '{print $2}'` + DEVBRANCH=`git rev-parse --abbrev-ref HEAD` + if [ -n "$DEVSTRING" ]; then + if [ "$DEVBRANCH" != "master" ]; then + echo "Using HYPRE_DEVELOP_STRING: $DEVSTRING (branch $DEVBRANCH; not the develop branch)" \ + > ${TNAME}.testdatacheck + else + echo "Using HYPRE_DEVELOP_STRING: $DEVSTRING (branch $DEVBRANCH; the develop branch)" \ + > ${TNAME}.testdatacheck + fi + fi +fi +diff ${TNAME}.testdata ${TNAME}.testdatacheck >&2 + +#============================================================================= +# remove temporary files +#============================================================================= + +rm -f ${TNAME}.testdata* diff --git a/external/hypre/src/test/TEST_lobpcg/ijdefault.jobs b/external/hypre/src/test/TEST_lobpcg/ijdefault.jobs old mode 100644 new mode 100755 index 216b79db..cf8bdd2d --- a/external/hypre/src/test/TEST_lobpcg/ijdefault.jobs +++ b/external/hypre/src/test/TEST_lobpcg/ijdefault.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_lobpcg/ijdefault.sh b/external/hypre/src/test/TEST_lobpcg/ijdefault.sh old mode 100644 new mode 100755 index 2ff52cd4..bbbbedff --- a/external/hypre/src/test/TEST_lobpcg/ijdefault.sh +++ b/external/hypre/src/test/TEST_lobpcg/ijdefault.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_lobpcg/ijoptions.jobs b/external/hypre/src/test/TEST_lobpcg/ijoptions.jobs old mode 100644 new mode 100755 index 7314f530..bdb45845 --- a/external/hypre/src/test/TEST_lobpcg/ijoptions.jobs +++ b/external/hypre/src/test/TEST_lobpcg/ijoptions.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_lobpcg/ijoptions.sh b/external/hypre/src/test/TEST_lobpcg/ijoptions.sh old mode 100644 new mode 100755 index fbdc8d2c..64550c34 --- a/external/hypre/src/test/TEST_lobpcg/ijoptions.sh +++ b/external/hypre/src/test/TEST_lobpcg/ijoptions.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -54,7 +54,7 @@ tail -11 ${TNAME}.out.verb.2 | head -3 >> ${TNAME}.out # Make sure that the output file is reasonable RUNCOUNT=18 -OUTCOUNT=`grep "Eigenvalue" ${TNAME}.out | wc -l` +OUTCOUNT=`grep "Eigenvalue" ${TNAME}.out | wc -l | sed -e 's/^[[:space:]]*//'` if [ "$OUTCOUNT" != "$RUNCOUNT" ]; then echo "Incorrect number of runs in ${TNAME}.out" >&2 fi diff --git a/external/hypre/src/test/TEST_lobpcg/nonmixedint.jobs b/external/hypre/src/test/TEST_lobpcg/nonmixedint.jobs old mode 100644 new mode 100755 index 35948dc0..a33a52f3 --- a/external/hypre/src/test/TEST_lobpcg/nonmixedint.jobs +++ b/external/hypre/src/test/TEST_lobpcg/nonmixedint.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_lobpcg/nonmixedint.sh b/external/hypre/src/test/TEST_lobpcg/nonmixedint.sh old mode 100644 new mode 100755 index 77e5320f..eafa215f --- a/external/hypre/src/test/TEST_lobpcg/nonmixedint.sh +++ b/external/hypre/src/test/TEST_lobpcg/nonmixedint.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_lobpcg/sstruct.in.default b/external/hypre/src/test/TEST_lobpcg/sstruct.in.default index c1d589cc..6567356c 100644 --- a/external/hypre/src/test/TEST_lobpcg/sstruct.in.default +++ b/external/hypre/src/test/TEST_lobpcg/sstruct.in.default @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_lobpcg/sstruct.jobs b/external/hypre/src/test/TEST_lobpcg/sstruct.jobs old mode 100644 new mode 100755 index 62d69324..7910745f --- a/external/hypre/src/test/TEST_lobpcg/sstruct.jobs +++ b/external/hypre/src/test/TEST_lobpcg/sstruct.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_lobpcg/sstruct.sh b/external/hypre/src/test/TEST_lobpcg/sstruct.sh old mode 100644 new mode 100755 index 4a7e10f6..73e14d70 --- a/external/hypre/src/test/TEST_lobpcg/sstruct.sh +++ b/external/hypre/src/test/TEST_lobpcg/sstruct.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_lobpcg/struct.jobs b/external/hypre/src/test/TEST_lobpcg/struct.jobs old mode 100644 new mode 100755 index 704faba7..6def4bf5 --- a/external/hypre/src/test/TEST_lobpcg/struct.jobs +++ b/external/hypre/src/test/TEST_lobpcg/struct.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_lobpcg/struct.sh b/external/hypre/src/test/TEST_lobpcg/struct.sh old mode 100644 new mode 100755 index c682528b..c4791c7c --- a/external/hypre/src/test/TEST_lobpcg/struct.sh +++ b/external/hypre/src/test/TEST_lobpcg/struct.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_longdouble/solvers_ij.jobs b/external/hypre/src/test/TEST_longdouble/solvers_ij.jobs old mode 100644 new mode 100755 index faf9d120..5026ccae --- a/external/hypre/src/test/TEST_longdouble/solvers_ij.jobs +++ b/external/hypre/src/test/TEST_longdouble/solvers_ij.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_longdouble/solvers_ij.saved b/external/hypre/src/test/TEST_longdouble/solvers_ij.saved index 38e79424..6ba7dcea 100644 --- a/external/hypre/src/test/TEST_longdouble/solvers_ij.saved +++ b/external/hypre/src/test/TEST_longdouble/solvers_ij.saved @@ -8,11 +8,11 @@ Final Relative Residual Norm = 5.127733e-17 # Output file: solvers_ij.out.2 GMRES Iterations = 14 -Final GMRES Relative Residual Norm = 2.081795e-17 +Final GMRES Relative Residual Norm = 2.081367e-17 # Output file: solvers_ij.out.3 GMRES Iterations = 199 -Final GMRES Relative Residual Norm = 9.120984e-17 +Final GMRES Relative Residual Norm = 9.519631e-17 # Output file: solvers_ij.out.4 Iterations = 18 @@ -23,8 +23,8 @@ Iterations = 375 Final Relative Residual Norm = 9.100420e-17 # Output file: solvers_ij.out.6 -GMRES Iterations = 65 -Final GMRES Relative Residual Norm = 9.781815e-17 +GMRES Iterations = 64 +Final GMRES Relative Residual Norm = 8.111594e-17 # Output file: solvers_ij.out.7 Iterations = 42 @@ -46,20 +46,20 @@ Final Relative Residual Norm = 2.361559e-17 Iterations = 16 PCG_Iterations = 14 DSCG_Iterations = 2 -Final Relative Residual Norm = 2.081795e-17 +Final Relative Residual Norm = 2.081367e-17 # Output file: solvers_ij.out.11 Iterations = 10 PCG_Iterations = 7 DSCG_Iterations = 3 -Final Relative Residual Norm = 1.093762e-17 +Final Relative Residual Norm = 1.095097e-17 # Output file: solvers_ij.out.sysh - Average Convergence Factor = 0.120646 + Average Convergence Factor = 0.120656 Complexity: grid = 1.613875 - operator = 2.860168 - cycle = 5.720037 + operator = 2.860056 + cycle = 5.719813 # Output file: solvers_ij.out.sysn Average Convergence Factor = 0.222219 @@ -69,43 +69,43 @@ Final Relative Residual Norm = 1.093762e-17 cycle = 11.267164 # Output file: solvers_ij.out.sysu - Average Convergence Factor = 0.430744 + Average Convergence Factor = 0.430732 Complexity: grid = 1.614937 - operator = 2.866488 - cycle = 5.732598 + operator = 2.866376 + cycle = 5.732374 # Output file: solvers_ij.out.101 -LGMRES Iterations = 175 -Final LGMRES Relative Residual Norm = 9.266081e-17 +LGMRES Iterations = 174 +Final LGMRES Relative Residual Norm = 9.552264e-17 # Output file: solvers_ij.out.102 LGMRES Iterations = 17 -Final LGMRES Relative Residual Norm = 2.722394e-17 +Final LGMRES Relative Residual Norm = 2.723270e-17 # Output file: solvers_ij.out.103 FlexGMRES Iterations = 199 -Final FlexGMRES Relative Residual Norm = 9.121062e-17 +Final FlexGMRES Relative Residual Norm = 9.519793e-17 # Output file: solvers_ij.out.104 FlexGMRES Iterations = 14 -Final FlexGMRES Relative Residual Norm = 2.080945e-17 +Final FlexGMRES Relative Residual Norm = 2.080779e-17 # Output file: solvers_ij.out.105 Iterations = 27 -Final Relative Residual Norm = 4.195866e-17 +Final Relative Residual Norm = 4.117029e-17 # Output file: solvers_ij.out.106 Iterations = 27 -Final Relative Residual Norm = 4.195866e-17 +Final Relative Residual Norm = 4.117029e-17 # Output file: solvers_ij.out.107 Iterations = 41 -Final Relative Residual Norm = 5.542245e-17 +Final Relative Residual Norm = 5.530831e-17 # Output file: solvers_ij.out.108 Iterations = 41 -Final Relative Residual Norm = 5.542245e-17 +Final Relative Residual Norm = 5.530831e-17 # Output file: solvers_ij.out.109 Iterations = 32 @@ -121,24 +121,25 @@ Final Relative Residual Norm = 8.514971e-17 # Output file: solvers_ij.out.112 GMRES Iterations = 43 -Final GMRES Relative Residual Norm = 8.429921e-17 +Final GMRES Relative Residual Norm = 8.435563e-17 # Output file: solvers_ij.out.113 GMRES Iterations = 50 -Final GMRES Relative Residual Norm = 7.072526e-17 +Final GMRES Relative Residual Norm = 7.198289e-17 # Output file: solvers_ij.out.114 BoomerAMG Iterations = 33 -Final Relative Residual Norm = 3.985038e-17 +Final Relative Residual Norm = 7.715444e-17 # Output file: solvers_ij.out.115 BoomerAMG Iterations = 33 -Final Relative Residual Norm = 8.090140e-17 +Final Relative Residual Norm = 7.295558e-17 # Output file: solvers_ij.out.116 GMRES Iterations = 18 -Final GMRES Relative Residual Norm = 3.015970e-17 +Final GMRES Relative Residual Norm = 3.539225e-17 # Output file: solvers_ij.out.117 GMRES Iterations = 18 -Final GMRES Relative Residual Norm = 3.054189e-17 +Final GMRES Relative Residual Norm = 3.377119e-17 + diff --git a/external/hypre/src/test/TEST_longdouble/solvers_ij.sh b/external/hypre/src/test/TEST_longdouble/solvers_ij.sh old mode 100644 new mode 100755 index 03ea5104..6b963ef9 --- a/external/hypre/src/test/TEST_longdouble/solvers_ij.sh +++ b/external/hypre/src/test/TEST_longdouble/solvers_ij.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_longdouble/solvers_struct.jobs b/external/hypre/src/test/TEST_longdouble/solvers_struct.jobs index b4a55284..19d8a40e 100644 --- a/external/hypre/src/test/TEST_longdouble/solvers_struct.jobs +++ b/external/hypre/src/test/TEST_longdouble/solvers_struct.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_longdouble/solvers_struct.saved b/external/hypre/src/test/TEST_longdouble/solvers_struct.saved index 7991994d..a54b4e7b 100644 --- a/external/hypre/src/test/TEST_longdouble/solvers_struct.saved +++ b/external/hypre/src/test/TEST_longdouble/solvers_struct.saved @@ -44,7 +44,7 @@ Final Relative Residual Norm = 4.957736e-17 # Output file: solvers_struct.out.11.lobpcg.1 Eigenvalue lambda 1.84366453091756e-01 -Residual 5.90808378148735e-08 +Residual 5.90808378148877e-08 # Output file: solvers_struct.out.11.lobpcg.5 Eigenvalue lambda 1.84366453091753e-01 @@ -52,11 +52,11 @@ Eigenvalue lambda 2.50882493969729e-01 Eigenvalue lambda 3.60090369737179e-01 Eigenvalue lambda 4.20845334658427e-01 Eigenvalue lambda 4.20845334658489e-01 -Residual 3.21720429474277e-08 -Residual 6.44224703495451e-08 -Residual 2.42812454193394e-07 -Residual 3.37502151131599e-07 -Residual 3.28950894745568e-07 +Residual 3.21720429474187e-08 +Residual 6.44224703497146e-08 +Residual 2.42812454193411e-07 +Residual 3.37502154312378e-07 +Residual 3.28950912831126e-07 # Output file: solvers_struct.out.17.lobpcg Iterations = 34 diff --git a/external/hypre/src/test/TEST_longdouble/solvers_struct.sh b/external/hypre/src/test/TEST_longdouble/solvers_struct.sh old mode 100644 new mode 100755 index 4892c63e..467f49f3 --- a/external/hypre/src/test/TEST_longdouble/solvers_struct.sh +++ b/external/hypre/src/test/TEST_longdouble/solvers_struct.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_single/solvers_ij.jobs b/external/hypre/src/test/TEST_single/solvers_ij.jobs old mode 100644 new mode 100755 index 7731d3a0..2183a9e3 --- a/external/hypre/src/test/TEST_single/solvers_ij.jobs +++ b/external/hypre/src/test/TEST_single/solvers_ij.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_single/solvers_ij.saved b/external/hypre/src/test/TEST_single/solvers_ij.saved index 4422bb2d..97bcf887 100644 --- a/external/hypre/src/test/TEST_single/solvers_ij.saved +++ b/external/hypre/src/test/TEST_single/solvers_ij.saved @@ -28,7 +28,7 @@ Final GMRES Relative Residual Norm = 7.132032e-05 # Output file: solvers_ij.out.7 Iterations = 13 -Final Relative Residual Norm = 7.750608e-05 +Final Relative Residual Norm = 7.750613e-05 # Output file: solvers_ij.out.8 Iterations = 26 @@ -93,19 +93,19 @@ Final FlexGMRES Relative Residual Norm = 1.566998e-05 # Output file: solvers_ij.out.105 Iterations = 9 -Final Relative Residual Norm = 2.436061e-05 +Final Relative Residual Norm = 2.436053e-05 # Output file: solvers_ij.out.106 Iterations = 9 -Final Relative Residual Norm = 2.436061e-05 +Final Relative Residual Norm = 2.436053e-05 # Output file: solvers_ij.out.107 Iterations = 12 -Final Relative Residual Norm = 6.371655e-05 +Final Relative Residual Norm = 6.371622e-05 # Output file: solvers_ij.out.108 Iterations = 12 -Final Relative Residual Norm = 6.371655e-05 +Final Relative Residual Norm = 6.371622e-05 # Output file: solvers_ij.out.109 Iterations = 9 @@ -117,15 +117,15 @@ Final Relative Residual Norm = 8.952637e-05 # Output file: solvers_ij.out.111 Iterations = 15 -Final Relative Residual Norm = 8.953387e-05 +Final Relative Residual Norm = 8.953385e-05 # Output file: solvers_ij.out.112 GMRES Iterations = 12 -Final GMRES Relative Residual Norm = 5.901872e-05 +Final GMRES Relative Residual Norm = 5.912302e-05 # Output file: solvers_ij.out.113 GMRES Iterations = 13 -Final GMRES Relative Residual Norm = 7.924740e-05 +Final GMRES Relative Residual Norm = 7.921693e-05 # Output file: solvers_ij.out.114 BoomerAMG Iterations = 9 @@ -137,8 +137,9 @@ Final Relative Residual Norm = 3.870274e-05 # Output file: solvers_ij.out.116 GMRES Iterations = 6 -Final GMRES Relative Residual Norm = 3.056660e-05 +Final GMRES Relative Residual Norm = 3.071691e-05 # Output file: solvers_ij.out.117 GMRES Iterations = 6 -Final GMRES Relative Residual Norm = 3.009877e-05 +Final GMRES Relative Residual Norm = 3.018834e-05 + diff --git a/external/hypre/src/test/TEST_single/solvers_ij.saved.lassen b/external/hypre/src/test/TEST_single/solvers_ij.saved.lassen new file mode 100644 index 00000000..7d429461 --- /dev/null +++ b/external/hypre/src/test/TEST_single/solvers_ij.saved.lassen @@ -0,0 +1,145 @@ +# Output file: solvers_ij.out.0 +Iterations = 6 +Final Relative Residual Norm = 3.613604e-05 + +# Output file: solvers_ij.out.1 +Iterations = 26 +Final Relative Residual Norm = 7.193498e-05 + +# Output file: solvers_ij.out.2 +GMRES Iterations = 6 +Final GMRES Relative Residual Norm = 4.896985e-05 + +# Output file: solvers_ij.out.3 +GMRES Iterations = 39 +Final GMRES Relative Residual Norm = 9.047663e-05 + +# Output file: solvers_ij.out.4 +Iterations = 5 +Final Relative Residual Norm = 1.712172e-05 + +# Output file: solvers_ij.out.5 +Iterations = 103 +Final Relative Residual Norm = 8.784411e-05 + +# Output file: solvers_ij.out.6 +GMRES Iterations = 15 +Final GMRES Relative Residual Norm = 7.132540e-05 + +# Output file: solvers_ij.out.7 +Iterations = 13 +Final Relative Residual Norm = 7.750618e-05 + +# Output file: solvers_ij.out.8 +Iterations = 26 +PCG_Iterations = 0 +DSCG_Iterations = 26 +Final Relative Residual Norm = 7.193498e-05 + +# Output file: solvers_ij.out.9 +Iterations = 7 +PCG_Iterations = 3 +DSCG_Iterations = 4 +Final Relative Residual Norm = 7.681886e-05 + +# Output file: solvers_ij.out.10 +Iterations = 6 +PCG_Iterations = 4 +DSCG_Iterations = 2 +Final Relative Residual Norm = 2.434827e-05 + +# Output file: solvers_ij.out.11 +Iterations = 5 +PCG_Iterations = 2 +DSCG_Iterations = 3 +Final Relative Residual Norm = 1.167394e-05 + +# Output file: solvers_ij.out.sysh + Average Convergence Factor = 0.203916 + + Complexity: grid = 1.393625 + operator = 2.648489 + cycle = 5.296959 + +# Output file: solvers_ij.out.sysn + Average Convergence Factor = 0.533108 + + Complexity: grid = 1.390750 + operator = 2.080112 + cycle = 10.160150 + +# Output file: solvers_ij.out.sysu + Average Convergence Factor = 0.738350 + + Complexity: grid = 1.392063 + operator = 2.742309 + cycle = 5.484450 + +# Output file: solvers_ij.out.101 +LGMRES Iterations = 39 +Final LGMRES Relative Residual Norm = 7.221823e-05 + +# Output file: solvers_ij.out.102 +LGMRES Iterations = 6 +Final LGMRES Relative Residual Norm = 4.896985e-05 + +# Output file: solvers_ij.out.103 +FlexGMRES Iterations = 39 +Final FlexGMRES Relative Residual Norm = 9.047555e-05 + +# Output file: solvers_ij.out.104 +FlexGMRES Iterations = 6 +Final FlexGMRES Relative Residual Norm = 4.897068e-05 + +# Output file: solvers_ij.out.105 +Iterations = 11 +Final Relative Residual Norm = 4.008468e-05 + +# Output file: solvers_ij.out.106 +Iterations = 11 +Final Relative Residual Norm = 4.008468e-05 + +# Output file: solvers_ij.out.107 +Iterations = 16 +Final Relative Residual Norm = 6.769229e-05 + +# Output file: solvers_ij.out.108 +Iterations = 16 +Final Relative Residual Norm = 6.769223e-05 + +# Output file: solvers_ij.out.109 +Iterations = 11 +Final Relative Residual Norm = 7.168816e-05 + +# Output file: solvers_ij.out.110 +Iterations = 11 +Final Relative Residual Norm = 7.168804e-05 + +# Output file: solvers_ij.out.111 +Iterations = 17 +Final Relative Residual Norm = 7.756728e-05 + +# Output file: solvers_ij.out.112 +GMRES Iterations = 21 +Final GMRES Relative Residual Norm = 7.639248e-05 + +# Output file: solvers_ij.out.113 +GMRES Iterations = 14 +Final GMRES Relative Residual Norm = 9.875665e-05 + +# Output file: solvers_ij.out.114 +BoomerAMG Iterations = 17 +Final Relative Residual Norm = 8.243789e-05 + +# Output file: solvers_ij.out.115 +BoomerAMG Iterations = 17 +Final Relative Residual Norm = 8.901364e-05 + +# Output file: solvers_ij.out.116 +GMRES Iterations = 8 +Final GMRES Relative Residual Norm = 8.284889e-05 + +# Output file: solvers_ij.out.117 +GMRES Iterations = 8 +Final GMRES Relative Residual Norm = 8.300778e-05 + diff --git a/external/hypre/src/test/TEST_single/solvers_ij.sh b/external/hypre/src/test/TEST_single/solvers_ij.sh old mode 100644 new mode 100755 index 0a09f8ee..0ac7b43c --- a/external/hypre/src/test/TEST_single/solvers_ij.sh +++ b/external/hypre/src/test/TEST_single/solvers_ij.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_single/solvers_struct.jobs b/external/hypre/src/test/TEST_single/solvers_struct.jobs old mode 100644 new mode 100755 index 2a1c71d2..0cd9629e --- a/external/hypre/src/test/TEST_single/solvers_struct.jobs +++ b/external/hypre/src/test/TEST_single/solvers_struct.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_single/solvers_struct.saved.lassen b/external/hypre/src/test/TEST_single/solvers_struct.saved.lassen new file mode 100644 index 00000000..d32a9369 --- /dev/null +++ b/external/hypre/src/test/TEST_single/solvers_struct.saved.lassen @@ -0,0 +1,120 @@ +# Output file: solvers_struct.out.0 +Iterations = 3 +Final Relative Residual Norm = 3.246689e-05 + +# Output file: solvers_struct.out.1 +Iterations = 6 +Final Relative Residual Norm = 2.055851e-05 + +# Output file: solvers_struct.out.2 +Iterations = 16 +Final Relative Residual Norm = 5.377654e-05 + +# Output file: solvers_struct.out.3 +Iterations = 16 +Final Relative Residual Norm = 3.718371e-05 + +# Output file: solvers_struct.out.4 +Iterations = 16 +Final Relative Residual Norm = 3.718370e-05 + +# Output file: solvers_struct.out.10.lobpcg +Iterations = 3 +Final Relative Residual Norm = 6.275833e-06 + +# Output file: solvers_struct.out.10.lobpcg.1 +Eigenvalue lambda 1.84366509318352e-01 +Residual 2.48082087637158e-05 + +# Output file: solvers_struct.out.10.lobpcg.3 +Iteration 10 bsize 2 maxres 4.33511973824352e-04 +Iteration 11 bsize 1 maxres 2.04666575882584e-04 +Iteration 12 bsize 1 maxres 8.50733777042478e-05 + +Eigenvalue lambda 1.84366509318352e-01 +Eigenvalue lambda 2.50882238149643e-01 +Eigenvalue lambda 3.60091090202332e-01 +Residual 7.41478434065357e-05 +Residual 4.07401748816483e-05 +Residual 8.50733777042478e-05 + +# Output file: solvers_struct.out.11.lobpcg +Iterations = 6 +Final Relative Residual Norm = 2.112819e-05 + +# Output file: solvers_struct.out.11.lobpcg.1 +Eigenvalue lambda 1.84366583824158e-01 +Residual 3.15948745992500e-05 + +# Output file: solvers_struct.out.11.lobpcg.3 +Iteration 11 bsize 2 maxres 6.90118235070258e-04 +Iteration 12 bsize 2 maxres 2.52081663347781e-04 +Iteration 13 bsize 1 maxres 7.02887409715913e-05 + +Eigenvalue lambda 1.84366479516029e-01 +Eigenvalue lambda 2.50883370637894e-01 +Eigenvalue lambda 3.60090911388397e-01 +Residual 5.58231040486135e-05 +Residual 2.60377983067883e-05 +Residual 7.02887409715913e-05 + +# Output file: solvers_struct.out.17.lobpcg +Iterations = 17 +Final Relative Residual Norm = 8.241194e-07 + +# Output file: solvers_struct.out.17.lobpcg.1 +Eigenvalue lambda 1.84366509318352e-01 +Residual 1.95705306396121e-05 + +# Output file: solvers_struct.out.17.lobpcg.3 +Iteration 10 bsize 2 maxres 3.62064485670999e-04 +Iteration 11 bsize 1 maxres 1.69921870110556e-04 +Iteration 12 bsize 1 maxres 7.11168977431953e-05 + +Eigenvalue lambda 1.84366405010223e-01 +Eigenvalue lambda 2.50881940126419e-01 +Eigenvalue lambda 3.60090613365173e-01 +Residual 5.52630408492405e-05 +Residual 3.09487622871529e-05 +Residual 7.11168977431953e-05 + +# Output file: solvers_struct.out.18.lobpcg +Iterations = 32 +Final Relative Residual Norm = 8.266953e-07 + +# Output file: solvers_struct.out.18.lobpcg.1 +Eigenvalue lambda 1.84366241097450e-01 +Residual 4.44491524831392e-05 + +# Output file: solvers_struct.out.18.lobpcg.3 +Iteration 10 bsize 2 maxres 5.81342901568860e-04 +Iteration 11 bsize 1 maxres 1.98838606593199e-04 +Iteration 12 bsize 1 maxres 9.27079236134887e-05 + +Eigenvalue lambda 1.84366494417191e-01 +Eigenvalue lambda 2.50879585742950e-01 +Eigenvalue lambda 3.60090494155884e-01 +Residual 9.27079236134887e-05 +Residual 8.72101882123388e-05 +Residual 5.49681753909681e-05 + +# Output file: solvers_struct.out.19.lobpcg +Iterations = 25 +Final Relative Residual Norm = 7.712439e-05 + +# Output file: solvers_struct.out.19.lobpcg.1 +Eigenvalue lambda 1.84366539120674e-01 +Residual 4.44510842498858e-05 + +# Output file: solvers_struct.out.19.lobpcg.3 +Iteration 10 bsize 2 maxres 5.81450236495584e-04 +Iteration 11 bsize 1 maxres 1.98705645743757e-04 +Iteration 12 bsize 1 maxres 9.26581269595772e-05 + +Eigenvalue lambda 1.84366509318352e-01 +Eigenvalue lambda 2.50874906778336e-01 +Eigenvalue lambda 3.60090017318726e-01 +Residual 9.26581269595772e-05 +Residual 8.80578954820521e-05 +Residual 5.49828182556666e-05 + diff --git a/external/hypre/src/test/TEST_single/solvers_struct.sh b/external/hypre/src/test/TEST_single/solvers_struct.sh old mode 100644 new mode 100755 index 9f1bc38f..02697eed --- a/external/hypre/src/test/TEST_single/solvers_struct.sh +++ b/external/hypre/src/test/TEST_single/solvers_struct.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/addtovalues.jobs b/external/hypre/src/test/TEST_sstruct/addtovalues.jobs old mode 100644 new mode 100755 index 38c556cd..0daf8e6d --- a/external/hypre/src/test/TEST_sstruct/addtovalues.jobs +++ b/external/hypre/src/test/TEST_sstruct/addtovalues.jobs @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/addtovalues.saved.lassen b/external/hypre/src/test/TEST_sstruct/addtovalues.saved.lassen index 8ac19bc2..7e261d62 100644 --- a/external/hypre/src/test/TEST_sstruct/addtovalues.saved.lassen +++ b/external/hypre/src/test/TEST_sstruct/addtovalues.saved.lassen @@ -8,11 +8,11 @@ Final Relative Residual Norm = 7.226958e-07 # Output file: addtovalues.out.2 Iterations = 83 -Final Relative Residual Norm = 9.421343e-07 +Final Relative Residual Norm = 9.421346e-07 # Output file: addtovalues.out.3 Iterations = 83 -Final Relative Residual Norm = 9.421343e-07 +Final Relative Residual Norm = 9.421346e-07 # Output file: addtovalues.out.4 Iterations = 11 @@ -24,9 +24,9 @@ Final Relative Residual Norm = 9.051371e-07 # Output file: addtovalues.out.6 Iterations = 92 -Final Relative Residual Norm = 8.612786e-07 +Final Relative Residual Norm = 8.697370e-07 # Output file: addtovalues.out.7 Iterations = 92 -Final Relative Residual Norm = 8.612786e-07 +Final Relative Residual Norm = 8.697370e-07 diff --git a/external/hypre/src/test/TEST_sstruct/addtovalues.saved.ray b/external/hypre/src/test/TEST_sstruct/addtovalues.saved.lassen_cpu similarity index 68% rename from external/hypre/src/test/TEST_sstruct/addtovalues.saved.ray rename to external/hypre/src/test/TEST_sstruct/addtovalues.saved.lassen_cpu index 46cc6f94..b126689d 100644 --- a/external/hypre/src/test/TEST_sstruct/addtovalues.saved.ray +++ b/external/hypre/src/test/TEST_sstruct/addtovalues.saved.lassen_cpu @@ -7,12 +7,12 @@ Iterations = 9 Final Relative Residual Norm = 7.226958e-07 # Output file: addtovalues.out.2 -Iterations = 83 -Final Relative Residual Norm = 9.421346e-07 +Iterations = 34 +Final Relative Residual Norm = 5.437407e-07 # Output file: addtovalues.out.3 -Iterations = 83 -Final Relative Residual Norm = 9.421346e-07 +Iterations = 34 +Final Relative Residual Norm = 5.437407e-07 # Output file: addtovalues.out.4 Iterations = 11 @@ -23,10 +23,10 @@ Iterations = 11 Final Relative Residual Norm = 9.051371e-07 # Output file: addtovalues.out.6 -Iterations = 92 -Final Relative Residual Norm = 8.612847e-07 +Iterations = 44 +Final Relative Residual Norm = 8.778287e-07 # Output file: addtovalues.out.7 -Iterations = 92 -Final Relative Residual Norm = 8.612847e-07 +Iterations = 44 +Final Relative Residual Norm = 8.778287e-07 diff --git a/external/hypre/src/test/TEST_sstruct/addtovalues.sh b/external/hypre/src/test/TEST_sstruct/addtovalues.sh old mode 100644 new mode 100755 index 76420f76..790d1c93 --- a/external/hypre/src/test/TEST_sstruct/addtovalues.sh +++ b/external/hypre/src/test/TEST_sstruct/addtovalues.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/amr2d.jobs b/external/hypre/src/test/TEST_sstruct/amr2d.jobs old mode 100644 new mode 100755 index 9e706879..81141db2 --- a/external/hypre/src/test/TEST_sstruct/amr2d.jobs +++ b/external/hypre/src/test/TEST_sstruct/amr2d.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/amr2d.saved.lassen b/external/hypre/src/test/TEST_sstruct/amr2d.saved.lassen index 13ef34a9..a544659b 100644 --- a/external/hypre/src/test/TEST_sstruct/amr2d.saved.lassen +++ b/external/hypre/src/test/TEST_sstruct/amr2d.saved.lassen @@ -8,11 +8,11 @@ Final Relative Residual Norm = 8.188904e-07 # Output file: amr2d.out.2 Iterations = 7 -Final Relative Residual Norm = 2.380297e-07 +Final Relative Residual Norm = 2.345061e-07 # Output file: amr2d.out.3 Iterations = 7 -Final Relative Residual Norm = 4.126143e-07 +Final Relative Residual Norm = 4.180192e-07 # Output file: amr2d.out.4 Iterations = 20 @@ -24,11 +24,11 @@ Final Relative Residual Norm = 8.510163e-07 # Output file: amr2d.out.6 Iterations = 7 -Final Relative Residual Norm = 4.984335e-07 +Final Relative Residual Norm = 4.464926e-07 # Output file: amr2d.out.7 Iterations = 7 -Final Relative Residual Norm = 6.148553e-07 +Final Relative Residual Norm = 5.993784e-07 # Output file: amr2d.out.8 Iterations = 21 @@ -36,11 +36,11 @@ Final Relative Residual Norm = 5.392338e-07 # Output file: amr2d.out.10 Iterations = 8 -Final Relative Residual Norm = 6.202045e-07 +Final Relative Residual Norm = 6.330324e-07 # Output file: amr2d.out.11 Iterations = 8 -Final Relative Residual Norm = 1.996753e-07 +Final Relative Residual Norm = 2.085852e-07 # Output file: amr2d.out.12 Iterations = 18 diff --git a/external/hypre/src/test/TEST_sstruct/amr2d.saved.ray b/external/hypre/src/test/TEST_sstruct/amr2d.saved.lassen_cpu similarity index 69% rename from external/hypre/src/test/TEST_sstruct/amr2d.saved.ray rename to external/hypre/src/test/TEST_sstruct/amr2d.saved.lassen_cpu index 13ef34a9..42a57fa5 100644 --- a/external/hypre/src/test/TEST_sstruct/amr2d.saved.ray +++ b/external/hypre/src/test/TEST_sstruct/amr2d.saved.lassen_cpu @@ -7,12 +7,12 @@ Iterations = 19 Final Relative Residual Norm = 8.188904e-07 # Output file: amr2d.out.2 -Iterations = 7 -Final Relative Residual Norm = 2.380297e-07 +Iterations = 5 +Final Relative Residual Norm = 1.746768e-07 # Output file: amr2d.out.3 -Iterations = 7 -Final Relative Residual Norm = 4.126143e-07 +Iterations = 5 +Final Relative Residual Norm = 3.155589e-07 # Output file: amr2d.out.4 Iterations = 20 @@ -23,24 +23,24 @@ Iterations = 20 Final Relative Residual Norm = 8.510163e-07 # Output file: amr2d.out.6 -Iterations = 7 -Final Relative Residual Norm = 4.984335e-07 +Iterations = 5 +Final Relative Residual Norm = 1.646222e-07 # Output file: amr2d.out.7 -Iterations = 7 -Final Relative Residual Norm = 6.148553e-07 +Iterations = 5 +Final Relative Residual Norm = 4.675292e-07 # Output file: amr2d.out.8 Iterations = 21 Final Relative Residual Norm = 5.392338e-07 # Output file: amr2d.out.10 -Iterations = 8 -Final Relative Residual Norm = 6.202045e-07 +Iterations = 6 +Final Relative Residual Norm = 6.135506e-07 # Output file: amr2d.out.11 -Iterations = 8 -Final Relative Residual Norm = 1.996753e-07 +Iterations = 6 +Final Relative Residual Norm = 1.744213e-07 # Output file: amr2d.out.12 Iterations = 18 diff --git a/external/hypre/src/test/TEST_sstruct/amr2d.sh b/external/hypre/src/test/TEST_sstruct/amr2d.sh old mode 100644 new mode 100755 index 040929b8..a0806aa2 --- a/external/hypre/src/test/TEST_sstruct/amr2d.sh +++ b/external/hypre/src/test/TEST_sstruct/amr2d.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/cube.jobs b/external/hypre/src/test/TEST_sstruct/cube.jobs old mode 100644 new mode 100755 index b888fa47..5cf47385 --- a/external/hypre/src/test/TEST_sstruct/cube.jobs +++ b/external/hypre/src/test/TEST_sstruct/cube.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/cube.saved.ray b/external/hypre/src/test/TEST_sstruct/cube.saved.lassen_cpu similarity index 100% rename from external/hypre/src/test/TEST_sstruct/cube.saved.ray rename to external/hypre/src/test/TEST_sstruct/cube.saved.lassen_cpu diff --git a/external/hypre/src/test/TEST_sstruct/cube.sh b/external/hypre/src/test/TEST_sstruct/cube.sh old mode 100644 new mode 100755 index fe679022..609a38c4 --- a/external/hypre/src/test/TEST_sstruct/cube.sh +++ b/external/hypre/src/test/TEST_sstruct/cube.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/cycred.jobs b/external/hypre/src/test/TEST_sstruct/cycred.jobs old mode 100644 new mode 100755 index 0cfca243..16b4570f --- a/external/hypre/src/test/TEST_sstruct/cycred.jobs +++ b/external/hypre/src/test/TEST_sstruct/cycred.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/cycred.saved.ray b/external/hypre/src/test/TEST_sstruct/cycred.saved.lassen_cpu similarity index 100% rename from external/hypre/src/test/TEST_sstruct/cycred.saved.ray rename to external/hypre/src/test/TEST_sstruct/cycred.saved.lassen_cpu diff --git a/external/hypre/src/test/TEST_sstruct/cycred.sh b/external/hypre/src/test/TEST_sstruct/cycred.sh old mode 100644 new mode 100755 index ec633075..1ace9c2f --- a/external/hypre/src/test/TEST_sstruct/cycred.sh +++ b/external/hypre/src/test/TEST_sstruct/cycred.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/default2d.jobs b/external/hypre/src/test/TEST_sstruct/default2d.jobs old mode 100644 new mode 100755 index bb99e0b2..cb349ea8 --- a/external/hypre/src/test/TEST_sstruct/default2d.jobs +++ b/external/hypre/src/test/TEST_sstruct/default2d.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/default2d.saved.ray b/external/hypre/src/test/TEST_sstruct/default2d.saved.lassen_cpu similarity index 100% rename from external/hypre/src/test/TEST_sstruct/default2d.saved.ray rename to external/hypre/src/test/TEST_sstruct/default2d.saved.lassen_cpu diff --git a/external/hypre/src/test/TEST_sstruct/default2d.sh b/external/hypre/src/test/TEST_sstruct/default2d.sh old mode 100644 new mode 100755 index 0c91fc1e..7356d6a6 --- a/external/hypre/src/test/TEST_sstruct/default2d.sh +++ b/external/hypre/src/test/TEST_sstruct/default2d.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/default3d.jobs b/external/hypre/src/test/TEST_sstruct/default3d.jobs old mode 100644 new mode 100755 index 14047b65..a0bf7eb3 --- a/external/hypre/src/test/TEST_sstruct/default3d.jobs +++ b/external/hypre/src/test/TEST_sstruct/default3d.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/default3d.saved.ray b/external/hypre/src/test/TEST_sstruct/default3d.saved.lassen_cpu similarity index 100% rename from external/hypre/src/test/TEST_sstruct/default3d.saved.ray rename to external/hypre/src/test/TEST_sstruct/default3d.saved.lassen_cpu diff --git a/external/hypre/src/test/TEST_sstruct/default3d.sh b/external/hypre/src/test/TEST_sstruct/default3d.sh old mode 100644 new mode 100755 index a6fc0020..0b8dc1da --- a/external/hypre/src/test/TEST_sstruct/default3d.sh +++ b/external/hypre/src/test/TEST_sstruct/default3d.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/emptyProc.jobs b/external/hypre/src/test/TEST_sstruct/emptyProc.jobs old mode 100644 new mode 100755 index 7a98d29e..16af1aa2 --- a/external/hypre/src/test/TEST_sstruct/emptyProc.jobs +++ b/external/hypre/src/test/TEST_sstruct/emptyProc.jobs @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/emptyProc.saved.lassen b/external/hypre/src/test/TEST_sstruct/emptyProc.saved.lassen index aa5df5e6..b03b94a9 100644 --- a/external/hypre/src/test/TEST_sstruct/emptyProc.saved.lassen +++ b/external/hypre/src/test/TEST_sstruct/emptyProc.saved.lassen @@ -20,7 +20,7 @@ Final Relative Residual Norm = 5.962015e-07 # Output file: emptyProc.out.05 Iterations = 9 -Final Relative Residual Norm = 4.770573e-07 +Final Relative Residual Norm = 6.100240e-07 # Output file: emptyProc.out.08 Iterations = 20 @@ -40,7 +40,7 @@ Final Relative Residual Norm = 9.962554e-07 # Output file: emptyProc.out.12 Iterations = 9 -Final Relative Residual Norm = 6.064748e-07 +Final Relative Residual Norm = 7.982121e-07 # Output file: emptyProc.out.15 Iterations = 2 @@ -56,7 +56,7 @@ Final Relative Residual Norm = 6.421347e-07 # Output file: emptyProc.out.18 Iterations = 5 -Final Relative Residual Norm = 2.114640e-07 +Final Relative Residual Norm = 6.241458e-07 # Output file: emptyProc.out.21 Iterations = 20 diff --git a/external/hypre/src/test/TEST_sstruct/emptyProc.saved.ray b/external/hypre/src/test/TEST_sstruct/emptyProc.saved.lassen_cpu similarity index 94% rename from external/hypre/src/test/TEST_sstruct/emptyProc.saved.ray rename to external/hypre/src/test/TEST_sstruct/emptyProc.saved.lassen_cpu index aa5df5e6..391ff4dc 100644 --- a/external/hypre/src/test/TEST_sstruct/emptyProc.saved.ray +++ b/external/hypre/src/test/TEST_sstruct/emptyProc.saved.lassen_cpu @@ -19,8 +19,8 @@ Iterations = 20 Final Relative Residual Norm = 5.962015e-07 # Output file: emptyProc.out.05 -Iterations = 9 -Final Relative Residual Norm = 4.770573e-07 +Iterations = 6 +Final Relative Residual Norm = 2.139764e-07 # Output file: emptyProc.out.08 Iterations = 20 @@ -39,8 +39,8 @@ Iterations = 64 Final Relative Residual Norm = 9.962554e-07 # Output file: emptyProc.out.12 -Iterations = 9 -Final Relative Residual Norm = 6.064748e-07 +Iterations = 6 +Final Relative Residual Norm = 3.079649e-07 # Output file: emptyProc.out.15 Iterations = 2 @@ -55,8 +55,8 @@ Iterations = 14 Final Relative Residual Norm = 6.421347e-07 # Output file: emptyProc.out.18 -Iterations = 5 -Final Relative Residual Norm = 2.114640e-07 +Iterations = 3 +Final Relative Residual Norm = 6.839240e-07 # Output file: emptyProc.out.21 Iterations = 20 diff --git a/external/hypre/src/test/TEST_sstruct/emptyProc.sh b/external/hypre/src/test/TEST_sstruct/emptyProc.sh old mode 100644 new mode 100755 index f2665d42..b3a35fa9 --- a/external/hypre/src/test/TEST_sstruct/emptyProc.sh +++ b/external/hypre/src/test/TEST_sstruct/emptyProc.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/io.jobs b/external/hypre/src/test/TEST_sstruct/io.jobs new file mode 100644 index 00000000..71aa5657 --- /dev/null +++ b/external/hypre/src/test/TEST_sstruct/io.jobs @@ -0,0 +1,61 @@ +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +#============================================================================= +# Sequential I/O tests +#============================================================================= + +mpirun -np 1 ./sstruct -in sstruct.in.block -r 6 6 6 -solver 18 -print > io.out.0P +mpirun -np 1 ./sstruct -fromfile sstruct.out.A -rhsfromfile sstruct.out.b -x0fromfile sstruct.out.x0 -solver 18 -print > io.out.0R + +mpirun -np 1 ./sstruct -in sstruct.in.amr.2D -r 8 8 1 -solver 18 -print > io.out.1P +mpirun -np 1 ./sstruct -fromfile sstruct.out.A -rhsfromfile sstruct.out.b -x0fromfile sstruct.out.x0 -solver 18 -print > io.out.1R + +mpirun -np 1 ./sstruct -in sstruct.in.amr.graphadd -r 3 3 1 -solver 18 -print > io.out.2P +mpirun -np 1 ./sstruct -fromfile sstruct.out.A -rhsfromfile sstruct.out.b -x0fromfile sstruct.out.x0 -solver 18 -print > io.out.2R + +mpirun -np 1 ./sstruct -in sstruct.in.laps -r 4 4 1 -solver 18 -print > io.out.3P +mpirun -np 1 ./sstruct -fromfile sstruct.out.A -rhsfromfile sstruct.out.b -x0fromfile sstruct.out.x0 -solver 18 -print > io.out.3R + +mpirun -np 1 ./sstruct -in sstruct.in.miller_3blk -r 4 4 1 -solver 18 -print > io.out.4P +mpirun -np 1 ./sstruct -fromfile sstruct.out.A -rhsfromfile sstruct.out.b -x0fromfile sstruct.out.x0 -solver 18 -print > io.out.4R + +mpirun -np 1 ./sstruct -in sstruct.in.marinak -solver 18 -tol 1e-3 -print > io.out.5P +mpirun -np 1 ./sstruct -fromfile sstruct.out.A -rhsfromfile sstruct.out.b -x0fromfile sstruct.out.x0 -solver 18 -print -tol 1e-3 > io.out.5R + +mpirun -np 1 ./sstruct -in sstruct.in.p7iso -r 2 2 2 -solver 18 -print > io.out.6P +mpirun -np 1 ./sstruct -fromfile sstruct.out.A -rhsfromfile sstruct.out.b -x0fromfile sstruct.out.x0 -solver 18 -print > io.out.6R + +mpirun -np 1 ./sstruct -in sstruct.in.symm3 -r 4 4 4 -solver 18 -print > io.out.7P +mpirun -np 1 ./sstruct -fromfile sstruct.out.A -rhsfromfile sstruct.out.b -x0fromfile sstruct.out.x0 -solver 18 -print > io.out.7R + +#============================================================================= +# Parallel I/O tests +#============================================================================= + +mpirun -np 8 ./sstruct -in ../TEST_sstruct/sstruct.in.block -r 3 3 3 -P 2 2 2 -solver 18 -print > io.out.100P +mpirun -np 8 ./sstruct -fromfile sstruct.out.A -rhsfromfile sstruct.out.b -x0fromfile sstruct.out.x0 -solver 18 -print > io.out.100R + +mpirun -np 4 ./sstruct -in sstruct.in.amr.2D -r 4 4 1 -P 2 2 1 -solver 18 -print > io.out.101P +mpirun -np 4 ./sstruct -fromfile sstruct.out.A -rhsfromfile sstruct.out.b -x0fromfile sstruct.out.x0 -solver 18 -print > io.out.101R + +mpirun -np 2 ./sstruct -in sstruct.in.amr.graphadd -r 3 3 1 -pooldist 1 -solver 18 -print > io.out.102P +mpirun -np 2 ./sstruct -fromfile sstruct.out.A -rhsfromfile sstruct.out.b -x0fromfile sstruct.out.x0 -solver 18 -print > io.out.102R + +mpirun -np 4 ./sstruct -in sstruct.in.laps -r 2 2 1 -P 2 2 1 -solver 18 -print > io.out.103P +mpirun -np 4 ./sstruct -fromfile sstruct.out.A -rhsfromfile sstruct.out.b -x0fromfile sstruct.out.x0 -solver 18 -print > io.out.103R + +mpirun -np 4 ./sstruct -in sstruct.in.miller_3blk -r 2 2 1 -P 2 2 1 -solver 18 -print > io.out.104P +mpirun -np 4 ./sstruct -fromfile sstruct.out.A -rhsfromfile sstruct.out.b -x0fromfile sstruct.out.x0 -solver 18 -print > io.out.104R + +mpirun -np 8 ./sstruct -in sstruct.in.marinak -pooldist 1 -solver 18 -tol 1e-3 -print > io.out.105P +mpirun -np 8 ./sstruct -fromfile sstruct.out.A -rhsfromfile sstruct.out.b -x0fromfile sstruct.out.x0 -solver 18 -print -tol 1e-3 > io.out.105R + +mpirun -np 8 ./sstruct -in sstruct.in.p7iso -P 2 2 2 -solver 18 -print > io.out.106P +mpirun -np 8 ./sstruct -fromfile sstruct.out.A -rhsfromfile sstruct.out.b -x0fromfile sstruct.out.x0 -solver 18 -print > io.out.106R + +mpirun -np 8 ./sstruct -in sstruct.in.symm3 -r 2 2 2 -P 2 2 2 -solver 18 -print > io.out.107P +mpirun -np 8 ./sstruct -fromfile sstruct.out.A -rhsfromfile sstruct.out.b -x0fromfile sstruct.out.x0 -solver 18 -print > io.out.107R diff --git a/external/hypre/src/test/TEST_sstruct/io.saved b/external/hypre/src/test/TEST_sstruct/io.saved new file mode 100644 index 00000000..f7ec8177 --- /dev/null +++ b/external/hypre/src/test/TEST_sstruct/io.saved @@ -0,0 +1,127 @@ +# Output file: io.out.0P +Iterations = 40 +Final Relative Residual Norm = 6.360366e-07 + +# Output file: io.out.0R +Iterations = 40 +Final Relative Residual Norm = 6.360366e-07 + +# Output file: io.out.1P +Iterations = 20 +Final Relative Residual Norm = 8.532200e-07 + +# Output file: io.out.1R +Iterations = 20 +Final Relative Residual Norm = 8.532200e-07 + +# Output file: io.out.2P +Iterations = 23 +Final Relative Residual Norm = 8.435286e-07 + +# Output file: io.out.2R +Iterations = 23 +Final Relative Residual Norm = 8.435286e-07 + +# Output file: io.out.3P +Iterations = 92 +Final Relative Residual Norm = 7.654048e-07 + +# Output file: io.out.3R +Iterations = 92 +Final Relative Residual Norm = 7.654048e-07 + +# Output file: io.out.4P +Iterations = 65 +Final Relative Residual Norm = 9.321074e-07 + +# Output file: io.out.4R +Iterations = 65 +Final Relative Residual Norm = 9.321074e-07 + +# Output file: io.out.5P +Iterations = 64 +Final Relative Residual Norm = 9.708691e-04 + +# Output file: io.out.5R +Iterations = 64 +Final Relative Residual Norm = 9.708691e-04 + +# Output file: io.out.6P +Iterations = 60 +Final Relative Residual Norm = 8.657637e-07 + +# Output file: io.out.6R +Iterations = 60 +Final Relative Residual Norm = 8.657637e-07 + +# Output file: io.out.7P +Iterations = 27 +Final Relative Residual Norm = 4.507162e-07 + +# Output file: io.out.7R +Iterations = 27 +Final Relative Residual Norm = 4.507162e-07 + +# Output file: io.out.100P +Iterations = 40 +Final Relative Residual Norm = 6.360366e-07 + +# Output file: io.out.100R +Iterations = 40 +Final Relative Residual Norm = 6.360366e-07 + +# Output file: io.out.101P +Iterations = 20 +Final Relative Residual Norm = 8.532200e-07 + +# Output file: io.out.101R +Iterations = 20 +Final Relative Residual Norm = 8.532200e-07 + +# Output file: io.out.102P +Iterations = 23 +Final Relative Residual Norm = 8.435286e-07 + +# Output file: io.out.102R +Iterations = 23 +Final Relative Residual Norm = 8.435286e-07 + +# Output file: io.out.103P +Iterations = 92 +Final Relative Residual Norm = 7.654048e-07 + +# Output file: io.out.103R +Iterations = 92 +Final Relative Residual Norm = 7.654048e-07 + +# Output file: io.out.104P +Iterations = 65 +Final Relative Residual Norm = 9.321074e-07 + +# Output file: io.out.104R +Iterations = 65 +Final Relative Residual Norm = 9.321074e-07 + +# Output file: io.out.105P +Iterations = 64 +Final Relative Residual Norm = 9.708691e-04 + +# Output file: io.out.105R +Iterations = 64 +Final Relative Residual Norm = 9.708691e-04 + +# Output file: io.out.106P +Iterations = 60 +Final Relative Residual Norm = 8.657637e-07 + +# Output file: io.out.106R +Iterations = 60 +Final Relative Residual Norm = 8.657637e-07 + +# Output file: io.out.107P +Iterations = 27 +Final Relative Residual Norm = 4.507162e-07 + +# Output file: io.out.107R +Iterations = 27 +Final Relative Residual Norm = 4.507162e-07 \ No newline at end of file diff --git a/external/hypre/src/test/TEST_sstruct/io.saved.lassen b/external/hypre/src/test/TEST_sstruct/io.saved.lassen new file mode 100644 index 00000000..1c44c5aa --- /dev/null +++ b/external/hypre/src/test/TEST_sstruct/io.saved.lassen @@ -0,0 +1,128 @@ +# Output file: io.out.0P +Iterations = 40 +Final Relative Residual Norm = 6.360366e-07 + +# Output file: io.out.0R +Iterations = 40 +Final Relative Residual Norm = 6.360366e-07 + +# Output file: io.out.1P +Iterations = 20 +Final Relative Residual Norm = 8.532200e-07 + +# Output file: io.out.1R +Iterations = 20 +Final Relative Residual Norm = 8.532200e-07 + +# Output file: io.out.2P +Iterations = 23 +Final Relative Residual Norm = 8.435286e-07 + +# Output file: io.out.2R +Iterations = 23 +Final Relative Residual Norm = 8.435286e-07 + +# Output file: io.out.3P +Iterations = 92 +Final Relative Residual Norm = 7.654048e-07 + +# Output file: io.out.3R +Iterations = 92 +Final Relative Residual Norm = 7.654048e-07 + +# Output file: io.out.4P +Iterations = 65 +Final Relative Residual Norm = 9.321074e-07 + +# Output file: io.out.4R +Iterations = 65 +Final Relative Residual Norm = 9.321074e-07 + +# Output file: io.out.5P +Iterations = 64 +Final Relative Residual Norm = 9.708691e-04 + +# Output file: io.out.5R +Iterations = 64 +Final Relative Residual Norm = 9.708691e-04 + +# Output file: io.out.6P +Iterations = 60 +Final Relative Residual Norm = 8.657637e-07 + +# Output file: io.out.6R +Iterations = 60 +Final Relative Residual Norm = 8.657637e-07 + +# Output file: io.out.7P +Iterations = 27 +Final Relative Residual Norm = 4.507162e-07 + +# Output file: io.out.7R +Iterations = 27 +Final Relative Residual Norm = 4.507162e-07 + +# Output file: io.out.100P +Iterations = 40 +Final Relative Residual Norm = 6.360366e-07 + +# Output file: io.out.100R +Iterations = 40 +Final Relative Residual Norm = 6.360366e-07 + +# Output file: io.out.101P +Iterations = 20 +Final Relative Residual Norm = 8.532200e-07 + +# Output file: io.out.101R +Iterations = 20 +Final Relative Residual Norm = 8.532200e-07 + +# Output file: io.out.102P +Iterations = 23 +Final Relative Residual Norm = 8.435286e-07 + +# Output file: io.out.102R +Iterations = 23 +Final Relative Residual Norm = 8.435286e-07 + +# Output file: io.out.103P +Iterations = 92 +Final Relative Residual Norm = 7.654048e-07 + +# Output file: io.out.103R +Iterations = 92 +Final Relative Residual Norm = 7.654048e-07 + +# Output file: io.out.104P +Iterations = 65 +Final Relative Residual Norm = 9.321074e-07 + +# Output file: io.out.104R +Iterations = 65 +Final Relative Residual Norm = 9.321074e-07 + +# Output file: io.out.105P +Iterations = 64 +Final Relative Residual Norm = 9.708691e-04 + +# Output file: io.out.105R +Iterations = 64 +Final Relative Residual Norm = 9.708691e-04 + +# Output file: io.out.106P +Iterations = 60 +Final Relative Residual Norm = 8.657637e-07 + +# Output file: io.out.106R +Iterations = 60 +Final Relative Residual Norm = 8.657637e-07 + +# Output file: io.out.107P +Iterations = 27 +Final Relative Residual Norm = 4.507162e-07 + +# Output file: io.out.107R +Iterations = 27 +Final Relative Residual Norm = 4.507162e-07 + diff --git a/external/hypre/src/test/TEST_sstruct/io.saved.lassen_cpu b/external/hypre/src/test/TEST_sstruct/io.saved.lassen_cpu new file mode 100644 index 00000000..1c44c5aa --- /dev/null +++ b/external/hypre/src/test/TEST_sstruct/io.saved.lassen_cpu @@ -0,0 +1,128 @@ +# Output file: io.out.0P +Iterations = 40 +Final Relative Residual Norm = 6.360366e-07 + +# Output file: io.out.0R +Iterations = 40 +Final Relative Residual Norm = 6.360366e-07 + +# Output file: io.out.1P +Iterations = 20 +Final Relative Residual Norm = 8.532200e-07 + +# Output file: io.out.1R +Iterations = 20 +Final Relative Residual Norm = 8.532200e-07 + +# Output file: io.out.2P +Iterations = 23 +Final Relative Residual Norm = 8.435286e-07 + +# Output file: io.out.2R +Iterations = 23 +Final Relative Residual Norm = 8.435286e-07 + +# Output file: io.out.3P +Iterations = 92 +Final Relative Residual Norm = 7.654048e-07 + +# Output file: io.out.3R +Iterations = 92 +Final Relative Residual Norm = 7.654048e-07 + +# Output file: io.out.4P +Iterations = 65 +Final Relative Residual Norm = 9.321074e-07 + +# Output file: io.out.4R +Iterations = 65 +Final Relative Residual Norm = 9.321074e-07 + +# Output file: io.out.5P +Iterations = 64 +Final Relative Residual Norm = 9.708691e-04 + +# Output file: io.out.5R +Iterations = 64 +Final Relative Residual Norm = 9.708691e-04 + +# Output file: io.out.6P +Iterations = 60 +Final Relative Residual Norm = 8.657637e-07 + +# Output file: io.out.6R +Iterations = 60 +Final Relative Residual Norm = 8.657637e-07 + +# Output file: io.out.7P +Iterations = 27 +Final Relative Residual Norm = 4.507162e-07 + +# Output file: io.out.7R +Iterations = 27 +Final Relative Residual Norm = 4.507162e-07 + +# Output file: io.out.100P +Iterations = 40 +Final Relative Residual Norm = 6.360366e-07 + +# Output file: io.out.100R +Iterations = 40 +Final Relative Residual Norm = 6.360366e-07 + +# Output file: io.out.101P +Iterations = 20 +Final Relative Residual Norm = 8.532200e-07 + +# Output file: io.out.101R +Iterations = 20 +Final Relative Residual Norm = 8.532200e-07 + +# Output file: io.out.102P +Iterations = 23 +Final Relative Residual Norm = 8.435286e-07 + +# Output file: io.out.102R +Iterations = 23 +Final Relative Residual Norm = 8.435286e-07 + +# Output file: io.out.103P +Iterations = 92 +Final Relative Residual Norm = 7.654048e-07 + +# Output file: io.out.103R +Iterations = 92 +Final Relative Residual Norm = 7.654048e-07 + +# Output file: io.out.104P +Iterations = 65 +Final Relative Residual Norm = 9.321074e-07 + +# Output file: io.out.104R +Iterations = 65 +Final Relative Residual Norm = 9.321074e-07 + +# Output file: io.out.105P +Iterations = 64 +Final Relative Residual Norm = 9.708691e-04 + +# Output file: io.out.105R +Iterations = 64 +Final Relative Residual Norm = 9.708691e-04 + +# Output file: io.out.106P +Iterations = 60 +Final Relative Residual Norm = 8.657637e-07 + +# Output file: io.out.106R +Iterations = 60 +Final Relative Residual Norm = 8.657637e-07 + +# Output file: io.out.107P +Iterations = 27 +Final Relative Residual Norm = 4.507162e-07 + +# Output file: io.out.107R +Iterations = 27 +Final Relative Residual Norm = 4.507162e-07 + diff --git a/external/hypre/src/test/TEST_sstruct/io.sh b/external/hypre/src/test/TEST_sstruct/io.sh new file mode 100755 index 00000000..17c2f998 --- /dev/null +++ b/external/hypre/src/test/TEST_sstruct/io.sh @@ -0,0 +1,61 @@ +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +TNAME=`basename $0 .sh` +RTOL=$1 +ATOL=$2 + +#============================================================================= +# compare with baseline case +#============================================================================= + +FILES="\ + ${TNAME}.out.0P\ + ${TNAME}.out.0R\ + ${TNAME}.out.1P\ + ${TNAME}.out.1R\ + ${TNAME}.out.2P\ + ${TNAME}.out.2R\ + ${TNAME}.out.3P\ + ${TNAME}.out.3R\ + ${TNAME}.out.4P\ + ${TNAME}.out.4R\ + ${TNAME}.out.5P\ + ${TNAME}.out.5R\ + ${TNAME}.out.6P\ + ${TNAME}.out.6R\ + ${TNAME}.out.7P\ + ${TNAME}.out.7R\ + ${TNAME}.out.100P\ + ${TNAME}.out.100R\ + ${TNAME}.out.101P\ + ${TNAME}.out.101R\ + ${TNAME}.out.102P\ + ${TNAME}.out.102R\ + ${TNAME}.out.103P\ + ${TNAME}.out.103R\ + ${TNAME}.out.104P\ + ${TNAME}.out.104R\ + ${TNAME}.out.105P\ + ${TNAME}.out.105R\ + ${TNAME}.out.106P\ + ${TNAME}.out.106R\ + ${TNAME}.out.107P\ + ${TNAME}.out.107R\ +" + +for i in $FILES +do + echo "# Output file: $i" + tail -3 $i +done > ${TNAME}.out + +# Make sure that the output file is reasonable +RUNCOUNT=`echo $FILES | wc -w` +OUTCOUNT=`grep "Iterations" ${TNAME}.out | wc -l` +if [ "$OUTCOUNT" != "$RUNCOUNT" ]; then + echo "Incorrect number of runs in ${TNAME}.out" >&2 +fi diff --git a/external/hypre/src/test/TEST_sstruct/maxwell.jobs b/external/hypre/src/test/TEST_sstruct/maxwell.jobs old mode 100644 new mode 100755 index acbb3f5e..d4fa3918 --- a/external/hypre/src/test/TEST_sstruct/maxwell.jobs +++ b/external/hypre/src/test/TEST_sstruct/maxwell.jobs @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/maxwell.saved.lassen b/external/hypre/src/test/TEST_sstruct/maxwell.saved.lassen index 6536083d..28eb5624 100644 --- a/external/hypre/src/test/TEST_sstruct/maxwell.saved.lassen +++ b/external/hypre/src/test/TEST_sstruct/maxwell.saved.lassen @@ -1,12 +1,12 @@ # Output file: maxwell.out.0 Iterations = 10 -Final Relative Residual Norm = 2.480525e-09 +Final Relative Residual Norm = 2.480102e-09 # Output file: maxwell.out.1 Iterations = 10 -Final Relative Residual Norm = 3.776021e-09 +Final Relative Residual Norm = 3.782219e-09 # Output file: maxwell.out.2 Iterations = 10 -Final Relative Residual Norm = 7.164237e-09 +Final Relative Residual Norm = 7.164797e-09 diff --git a/external/hypre/src/test/TEST_sstruct/maxwell.saved.ray b/external/hypre/src/test/TEST_sstruct/maxwell.saved.lassen_cpu similarity index 51% rename from external/hypre/src/test/TEST_sstruct/maxwell.saved.ray rename to external/hypre/src/test/TEST_sstruct/maxwell.saved.lassen_cpu index 6536083d..3c0b326e 100644 --- a/external/hypre/src/test/TEST_sstruct/maxwell.saved.ray +++ b/external/hypre/src/test/TEST_sstruct/maxwell.saved.lassen_cpu @@ -1,12 +1,12 @@ # Output file: maxwell.out.0 Iterations = 10 -Final Relative Residual Norm = 2.480525e-09 +Final Relative Residual Norm = 2.476905e-09 # Output file: maxwell.out.1 Iterations = 10 -Final Relative Residual Norm = 3.776021e-09 +Final Relative Residual Norm = 3.773173e-09 # Output file: maxwell.out.2 Iterations = 10 -Final Relative Residual Norm = 7.164237e-09 +Final Relative Residual Norm = 7.155215e-09 diff --git a/external/hypre/src/test/TEST_sstruct/maxwell.sh b/external/hypre/src/test/TEST_sstruct/maxwell.sh old mode 100644 new mode 100755 index c4080171..b5389bd1 --- a/external/hypre/src/test/TEST_sstruct/maxwell.sh +++ b/external/hypre/src/test/TEST_sstruct/maxwell.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/miller.jobs b/external/hypre/src/test/TEST_sstruct/miller.jobs old mode 100644 new mode 100755 index 24c2ab40..984fc0df --- a/external/hypre/src/test/TEST_sstruct/miller.jobs +++ b/external/hypre/src/test/TEST_sstruct/miller.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/miller.saved.lassen b/external/hypre/src/test/TEST_sstruct/miller.saved.lassen index 8f3c80ea..3766d36b 100644 --- a/external/hypre/src/test/TEST_sstruct/miller.saved.lassen +++ b/external/hypre/src/test/TEST_sstruct/miller.saved.lassen @@ -4,7 +4,7 @@ Final Relative Residual Norm = 8.455333e-07 # Output file: miller.out.1 Iterations = 7 -Final Relative Residual Norm = 2.927538e-07 +Final Relative Residual Norm = 3.361152e-07 # Output file: miller.out.2 Iterations = 15 @@ -12,7 +12,7 @@ Final Relative Residual Norm = 6.496892e-07 # Output file: miller.out.3 Iterations = 9 -Final Relative Residual Norm = 4.153907e-07 +Final Relative Residual Norm = 4.304655e-07 # Output file: miller.out.4 Iterations = 18 @@ -28,7 +28,7 @@ Final Relative Residual Norm = 6.181674e-07 # Output file: miller.out.7 Iterations = 7 -Final Relative Residual Norm = 7.676131e-07 +Final Relative Residual Norm = 7.661617e-07 # Output file: miller.out.8 Iterations = 3 diff --git a/external/hypre/src/test/TEST_sstruct/miller.saved.ray b/external/hypre/src/test/TEST_sstruct/miller.saved.lassen_cpu similarity index 73% rename from external/hypre/src/test/TEST_sstruct/miller.saved.ray rename to external/hypre/src/test/TEST_sstruct/miller.saved.lassen_cpu index 8f3c80ea..5c7bcc98 100644 --- a/external/hypre/src/test/TEST_sstruct/miller.saved.ray +++ b/external/hypre/src/test/TEST_sstruct/miller.saved.lassen_cpu @@ -3,32 +3,32 @@ Iterations = 16 Final Relative Residual Norm = 8.455333e-07 # Output file: miller.out.1 -Iterations = 7 -Final Relative Residual Norm = 2.927538e-07 +Iterations = 6 +Final Relative Residual Norm = 9.625406e-08 # Output file: miller.out.2 Iterations = 15 Final Relative Residual Norm = 6.496892e-07 # Output file: miller.out.3 -Iterations = 9 -Final Relative Residual Norm = 4.153907e-07 +Iterations = 5 +Final Relative Residual Norm = 4.213555e-07 # Output file: miller.out.4 Iterations = 18 Final Relative Residual Norm = 3.006677e-07 # Output file: miller.out.5 -Iterations = 7 -Final Relative Residual Norm = 1.958737e-07 +Iterations = 6 +Final Relative Residual Norm = 8.758757e-08 # Output file: miller.out.6 Iterations = 37 Final Relative Residual Norm = 6.181674e-07 # Output file: miller.out.7 -Iterations = 7 -Final Relative Residual Norm = 7.676131e-07 +Iterations = 5 +Final Relative Residual Norm = 8.323418e-07 # Output file: miller.out.8 Iterations = 3 diff --git a/external/hypre/src/test/TEST_sstruct/miller.sh b/external/hypre/src/test/TEST_sstruct/miller.sh old mode 100644 new mode 100755 index 99537708..fc9015c4 --- a/external/hypre/src/test/TEST_sstruct/miller.sh +++ b/external/hypre/src/test/TEST_sstruct/miller.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/neighborpart.jobs b/external/hypre/src/test/TEST_sstruct/neighborpart.jobs old mode 100644 new mode 100755 index fbc14885..d7990fd2 --- a/external/hypre/src/test/TEST_sstruct/neighborpart.jobs +++ b/external/hypre/src/test/TEST_sstruct/neighborpart.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/neighborpart.saved b/external/hypre/src/test/TEST_sstruct/neighborpart.saved index a974480e..a071ccf6 100644 --- a/external/hypre/src/test/TEST_sstruct/neighborpart.saved +++ b/external/hypre/src/test/TEST_sstruct/neighborpart.saved @@ -64,13 +64,13 @@ Final Relative Residual Norm = 8.604821e-07 # Output file: neighborpart.out.60 Iterations = 5 -Final Relative Residual Norm = 1.963879e-18 +Final Relative Residual Norm = 5.456678e-18 # Output file: neighborpart.out.61 Iterations = 5 -Final Relative Residual Norm = 1.963879e-18 +Final Relative Residual Norm = 5.456678e-18 # Output file: neighborpart.out.62 Iterations = 5 -Final Relative Residual Norm = 1.963879e-18 +Final Relative Residual Norm = 5.456678e-18 diff --git a/external/hypre/src/test/TEST_sstruct/neighborpart.saved.lassen b/external/hypre/src/test/TEST_sstruct/neighborpart.saved.lassen index 9b94a99e..278e7789 100644 --- a/external/hypre/src/test/TEST_sstruct/neighborpart.saved.lassen +++ b/external/hypre/src/test/TEST_sstruct/neighborpart.saved.lassen @@ -64,13 +64,13 @@ Final Relative Residual Norm = 8.604821e-07 # Output file: neighborpart.out.60 Iterations = 5 -Final Relative Residual Norm = 2.116338e-18 +Final Relative Residual Norm = 3.281199e-18 # Output file: neighborpart.out.61 Iterations = 5 -Final Relative Residual Norm = 2.116338e-18 +Final Relative Residual Norm = 3.281199e-18 # Output file: neighborpart.out.62 Iterations = 5 -Final Relative Residual Norm = 2.116338e-18 +Final Relative Residual Norm = 3.281199e-18 diff --git a/external/hypre/src/test/TEST_sstruct/neighborpart.saved.ray b/external/hypre/src/test/TEST_sstruct/neighborpart.saved.lassen_cpu similarity index 92% rename from external/hypre/src/test/TEST_sstruct/neighborpart.saved.ray rename to external/hypre/src/test/TEST_sstruct/neighborpart.saved.lassen_cpu index 9b94a99e..4cc800ca 100644 --- a/external/hypre/src/test/TEST_sstruct/neighborpart.saved.ray +++ b/external/hypre/src/test/TEST_sstruct/neighborpart.saved.lassen_cpu @@ -64,13 +64,13 @@ Final Relative Residual Norm = 8.604821e-07 # Output file: neighborpart.out.60 Iterations = 5 -Final Relative Residual Norm = 2.116338e-18 +Final Relative Residual Norm = 6.242460e-18 # Output file: neighborpart.out.61 Iterations = 5 -Final Relative Residual Norm = 2.116338e-18 +Final Relative Residual Norm = 6.242460e-18 # Output file: neighborpart.out.62 Iterations = 5 -Final Relative Residual Norm = 2.116338e-18 +Final Relative Residual Norm = 6.242460e-18 diff --git a/external/hypre/src/test/TEST_sstruct/neighborpart.sh b/external/hypre/src/test/TEST_sstruct/neighborpart.sh old mode 100644 new mode 100755 index 20841299..90da9fad --- a/external/hypre/src/test/TEST_sstruct/neighborpart.sh +++ b/external/hypre/src/test/TEST_sstruct/neighborpart.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/neumann.jobs b/external/hypre/src/test/TEST_sstruct/neumann.jobs old mode 100644 new mode 100755 index a166862f..965725d4 --- a/external/hypre/src/test/TEST_sstruct/neumann.jobs +++ b/external/hypre/src/test/TEST_sstruct/neumann.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/neumann.saved.ray b/external/hypre/src/test/TEST_sstruct/neumann.saved.lassen_cpu similarity index 100% rename from external/hypre/src/test/TEST_sstruct/neumann.saved.ray rename to external/hypre/src/test/TEST_sstruct/neumann.saved.lassen_cpu diff --git a/external/hypre/src/test/TEST_sstruct/neumann.sh b/external/hypre/src/test/TEST_sstruct/neumann.sh old mode 100644 new mode 100755 index f360fc73..d4c97e21 --- a/external/hypre/src/test/TEST_sstruct/neumann.sh +++ b/external/hypre/src/test/TEST_sstruct/neumann.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/nonmixedint.jobs b/external/hypre/src/test/TEST_sstruct/nonmixedint.jobs old mode 100644 new mode 100755 index a340c2fa..4b9ffe75 --- a/external/hypre/src/test/TEST_sstruct/nonmixedint.jobs +++ b/external/hypre/src/test/TEST_sstruct/nonmixedint.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/nonmixedint.saved.ray b/external/hypre/src/test/TEST_sstruct/nonmixedint.saved.lassen_cpu similarity index 100% rename from external/hypre/src/test/TEST_sstruct/nonmixedint.saved.ray rename to external/hypre/src/test/TEST_sstruct/nonmixedint.saved.lassen_cpu diff --git a/external/hypre/src/test/TEST_sstruct/nonmixedint.sh b/external/hypre/src/test/TEST_sstruct/nonmixedint.sh old mode 100644 new mode 100755 index a9f3efba..f6f64120 --- a/external/hypre/src/test/TEST_sstruct/nonmixedint.sh +++ b/external/hypre/src/test/TEST_sstruct/nonmixedint.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/periodic.jobs b/external/hypre/src/test/TEST_sstruct/periodic.jobs old mode 100644 new mode 100755 index fee7125c..71c0c17e --- a/external/hypre/src/test/TEST_sstruct/periodic.jobs +++ b/external/hypre/src/test/TEST_sstruct/periodic.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/periodic.saved.ray b/external/hypre/src/test/TEST_sstruct/periodic.saved.lassen_cpu similarity index 100% rename from external/hypre/src/test/TEST_sstruct/periodic.saved.ray rename to external/hypre/src/test/TEST_sstruct/periodic.saved.lassen_cpu diff --git a/external/hypre/src/test/TEST_sstruct/periodic.sh b/external/hypre/src/test/TEST_sstruct/periodic.sh old mode 100644 new mode 100755 index 2469045a..74cc37db --- a/external/hypre/src/test/TEST_sstruct/periodic.sh +++ b/external/hypre/src/test/TEST_sstruct/periodic.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sharedpart.jobs b/external/hypre/src/test/TEST_sstruct/sharedpart.jobs old mode 100644 new mode 100755 index 83966a97..8ca0fac4 --- a/external/hypre/src/test/TEST_sstruct/sharedpart.jobs +++ b/external/hypre/src/test/TEST_sstruct/sharedpart.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sharedpart.saved b/external/hypre/src/test/TEST_sstruct/sharedpart.saved index 62280643..6c7d245a 100644 --- a/external/hypre/src/test/TEST_sstruct/sharedpart.saved +++ b/external/hypre/src/test/TEST_sstruct/sharedpart.saved @@ -24,15 +24,15 @@ Final Relative Residual Norm = 4.922026e-07 # Output file: sharedpart.out.50 Iterations = 5 -Final Relative Residual Norm = 1.368642e-07 +Final Relative Residual Norm = 1.476647e-07 # Output file: sharedpart.out.51 Iterations = 5 -Final Relative Residual Norm = 1.549669e-07 +Final Relative Residual Norm = 1.593675e-07 # Output file: sharedpart.out.52 Iterations = 5 -Final Relative Residual Norm = 1.368642e-07 +Final Relative Residual Norm = 1.482436e-07 # Output file: sharedpart.out.53 Iterations = 7 diff --git a/external/hypre/src/test/TEST_sstruct/sharedpart.saved.lassen b/external/hypre/src/test/TEST_sstruct/sharedpart.saved.lassen index b56d1222..f4a08fac 100644 --- a/external/hypre/src/test/TEST_sstruct/sharedpart.saved.lassen +++ b/external/hypre/src/test/TEST_sstruct/sharedpart.saved.lassen @@ -24,15 +24,15 @@ Final Relative Residual Norm = 4.922026e-07 # Output file: sharedpart.out.50 Iterations = 7 -Final Relative Residual Norm = 6.535037e-07 +Final Relative Residual Norm = 6.613426e-07 # Output file: sharedpart.out.51 Iterations = 7 -Final Relative Residual Norm = 5.648415e-07 +Final Relative Residual Norm = 6.078964e-07 # Output file: sharedpart.out.52 Iterations = 7 -Final Relative Residual Norm = 6.535037e-07 +Final Relative Residual Norm = 6.613426e-07 # Output file: sharedpart.out.53 Iterations = 11 diff --git a/external/hypre/src/test/TEST_sstruct/sharedpart.saved.ray b/external/hypre/src/test/TEST_sstruct/sharedpart.saved.lassen_cpu similarity index 76% rename from external/hypre/src/test/TEST_sstruct/sharedpart.saved.ray rename to external/hypre/src/test/TEST_sstruct/sharedpart.saved.lassen_cpu index b56d1222..292ae5c9 100644 --- a/external/hypre/src/test/TEST_sstruct/sharedpart.saved.ray +++ b/external/hypre/src/test/TEST_sstruct/sharedpart.saved.lassen_cpu @@ -23,18 +23,18 @@ Iterations = 18 Final Relative Residual Norm = 4.922026e-07 # Output file: sharedpart.out.50 -Iterations = 7 -Final Relative Residual Norm = 6.535037e-07 +Iterations = 5 +Final Relative Residual Norm = 1.476576e-07 # Output file: sharedpart.out.51 -Iterations = 7 -Final Relative Residual Norm = 5.648415e-07 +Iterations = 5 +Final Relative Residual Norm = 1.593654e-07 # Output file: sharedpart.out.52 -Iterations = 7 -Final Relative Residual Norm = 6.535037e-07 +Iterations = 5 +Final Relative Residual Norm = 1.482297e-07 # Output file: sharedpart.out.53 -Iterations = 11 -Final Relative Residual Norm = 1.984668e-07 +Iterations = 7 +Final Relative Residual Norm = 2.557686e-07 diff --git a/external/hypre/src/test/TEST_sstruct/sharedpart.sh b/external/hypre/src/test/TEST_sstruct/sharedpart.sh old mode 100644 new mode 100755 index a0309a3a..f72c20c7 --- a/external/hypre/src/test/TEST_sstruct/sharedpart.sh +++ b/external/hypre/src/test/TEST_sstruct/sharedpart.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/solvers.jobs b/external/hypre/src/test/TEST_sstruct/solvers.jobs old mode 100644 new mode 100755 index 235a6fe1..01e35154 --- a/external/hypre/src/test/TEST_sstruct/solvers.jobs +++ b/external/hypre/src/test/TEST_sstruct/solvers.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/solvers.saved.lassen b/external/hypre/src/test/TEST_sstruct/solvers.saved.lassen index 4d740c04..a27b6238 100644 --- a/external/hypre/src/test/TEST_sstruct/solvers.saved.lassen +++ b/external/hypre/src/test/TEST_sstruct/solvers.saved.lassen @@ -16,7 +16,7 @@ Final Relative Residual Norm = 9.124482e-07 # Output file: solvers.out.4 Iterations = 8 -Final Relative Residual Norm = 3.387495e-07 +Final Relative Residual Norm = 3.394170e-07 # Output file: solvers.out.7 Iterations = 28 @@ -36,7 +36,7 @@ Final Relative Residual Norm = 9.036190e-07 # Output file: solvers.out.11 Iterations = 8 -Final Relative Residual Norm = 4.189540e-07 +Final Relative Residual Norm = 4.151604e-07 # Output file: solvers.out.14 Iterations = 11 @@ -44,7 +44,7 @@ Final Relative Residual Norm = 8.131824e-07 # Output file: solvers.out.15 Iterations = 9 -Final Relative Residual Norm = 6.163010e-07 +Final Relative Residual Norm = 6.612411e-07 # Output file: solvers.out.16 Iterations = 28 @@ -60,9 +60,9 @@ Final Relative Residual Norm = 9.036190e-07 # Output file: solvers.out.19 Iterations = 8 -Final Relative Residual Norm = 4.189540e-07 +Final Relative Residual Norm = 4.151604e-07 # Output file: solvers.out.20 Iterations = 8 -Final Relative Residual Norm = 3.309270e-07 +Final Relative Residual Norm = 3.335606e-07 diff --git a/external/hypre/src/test/TEST_sstruct/solvers.saved.ray b/external/hypre/src/test/TEST_sstruct/solvers.saved.lassen_cpu similarity index 80% rename from external/hypre/src/test/TEST_sstruct/solvers.saved.ray rename to external/hypre/src/test/TEST_sstruct/solvers.saved.lassen_cpu index 7add4ee9..61d07df1 100644 --- a/external/hypre/src/test/TEST_sstruct/solvers.saved.ray +++ b/external/hypre/src/test/TEST_sstruct/solvers.saved.lassen_cpu @@ -15,8 +15,8 @@ Iterations = 25 Final Relative Residual Norm = 9.124482e-07 # Output file: solvers.out.4 -Iterations = 8 -Final Relative Residual Norm = 3.652576e-07 +Iterations = 4 +Final Relative Residual Norm = 9.533500e-07 # Output file: solvers.out.7 Iterations = 28 @@ -35,16 +35,16 @@ Iterations = 30 Final Relative Residual Norm = 9.036190e-07 # Output file: solvers.out.11 -Iterations = 8 -Final Relative Residual Norm = 4.492904e-07 +Iterations = 4 +Final Relative Residual Norm = 9.340843e-07 # Output file: solvers.out.14 Iterations = 11 Final Relative Residual Norm = 8.131824e-07 # Output file: solvers.out.15 -Iterations = 9 -Final Relative Residual Norm = 6.163052e-07 +Iterations = 5 +Final Relative Residual Norm = 3.553535e-07 # Output file: solvers.out.16 Iterations = 28 @@ -59,10 +59,10 @@ Iterations = 30 Final Relative Residual Norm = 9.036190e-07 # Output file: solvers.out.19 -Iterations = 8 -Final Relative Residual Norm = 4.492904e-07 +Iterations = 4 +Final Relative Residual Norm = 9.340843e-07 # Output file: solvers.out.20 -Iterations = 8 -Final Relative Residual Norm = 3.569281e-07 +Iterations = 4 +Final Relative Residual Norm = 9.340843e-07 diff --git a/external/hypre/src/test/TEST_sstruct/solvers.sh b/external/hypre/src/test/TEST_sstruct/solvers.sh old mode 100644 new mode 100755 index 06d5c34a..a37e3269 --- a/external/hypre/src/test/TEST_sstruct/solvers.sh +++ b/external/hypre/src/test/TEST_sstruct/solvers.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.19aniso b/external/hypre/src/test/TEST_sstruct/sstruct.in.19aniso index 18271612..e657e73d 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.19aniso +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.19aniso @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.19iso b/external/hypre/src/test/TEST_sstruct/sstruct.in.19iso index 61673ed5..8b4d17b0 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.19iso +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.19iso @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.7aniso b/external/hypre/src/test/TEST_sstruct/sstruct.in.7aniso index 8ed38ea8..88dfc1c7 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.7aniso +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.7aniso @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.7iso b/external/hypre/src/test/TEST_sstruct/sstruct.in.7iso index 548443c4..e0607696 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.7iso +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.7iso @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.7zero-x b/external/hypre/src/test/TEST_sstruct/sstruct.in.7zero-x index 2b46e9fc..29853095 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.7zero-x +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.7zero-x @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.7zero-y b/external/hypre/src/test/TEST_sstruct/sstruct.in.7zero-y index 8d1695c1..b2a07394 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.7zero-y +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.7zero-y @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.7zero-z b/external/hypre/src/test/TEST_sstruct/sstruct.in.7zero-z index 864d8f23..0fe159ae 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.7zero-z +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.7zero-z @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.addtoval_cellcentre b/external/hypre/src/test/TEST_sstruct/sstruct.in.addtoval_cellcentre index 1b1abec3..1dcf5ad3 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.addtoval_cellcentre +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.addtoval_cellcentre @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.addtoval_edges b/external/hypre/src/test/TEST_sstruct/sstruct.in.addtoval_edges index 7e072bb5..792291f3 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.addtoval_edges +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.addtoval_edges @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.amr.2D b/external/hypre/src/test/TEST_sstruct/sstruct.in.amr.2D index 0cd6853d..6f031dec 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.amr.2D +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.amr.2D @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.amr.2Db b/external/hypre/src/test/TEST_sstruct/sstruct.in.amr.2Db index aee95371..22eaee46 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.amr.2Db +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.amr.2Db @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.amr.2Dc b/external/hypre/src/test/TEST_sstruct/sstruct.in.amr.2Dc index 6443d14a..4fd4ead5 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.amr.2Dc +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.amr.2Dc @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.amr.2De b/external/hypre/src/test/TEST_sstruct/sstruct.in.amr.2De index 6ebb6e1f..d01be0e8 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.amr.2De +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.amr.2De @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.amr.graphadd b/external/hypre/src/test/TEST_sstruct/sstruct.in.amr.graphadd index 18472535..7a3c371a 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.amr.graphadd +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.amr.graphadd @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.bcube b/external/hypre/src/test/TEST_sstruct/sstruct.in.bcube index a5ff1ff5..f906fee2 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.bcube +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.bcube @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.bcube-fem b/external/hypre/src/test/TEST_sstruct/sstruct.in.bcube-fem index 07f2856c..b8869427 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.bcube-fem +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.bcube-fem @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.block b/external/hypre/src/test/TEST_sstruct/sstruct.in.block index be75d3a5..2bc48d08 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.block +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.block @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.cube b/external/hypre/src/test/TEST_sstruct/sstruct.in.cube index d9d8c626..255e4af9 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.cube +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.cube @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.cube-fem b/external/hypre/src/test/TEST_sstruct/sstruct.in.cube-fem new file mode 100644 index 00000000..8d1079cc --- /dev/null +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.cube-fem @@ -0,0 +1,45 @@ +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + + +########################################################### + +# GridCreate: ndim nparts +GridCreate: 3 1 + +# GridSetExtents: part ilower(ndim) iupper(ndim) +GridSetExtents: 0 (1- 1- 1-) (2+ 2+ 2+) + +# GridSetVariables: part nvars vartypes[nvars] +# NODE = 1 +GridSetVariables: 0 1 [1] + +########################################################### + +# FEMStencilCreate: size +FEMStencilCreate: 8 + +# FEMStencilSetRow: row offset[ndim] var values[size] +FEMStencilSetRow: 0 [-1 -1 -1] 0 [ 4 -1 -1 0 -1 0 0 0 ] +FEMStencilSetRow: 1 [ 0 -1 -1] 0 [ -1 4 0 -1 0 -1 0 0 ] +FEMStencilSetRow: 2 [-1 0 -1] 0 [ -1 0 4 -1 0 0 -1 0 ] +FEMStencilSetRow: 3 [ 0 0 -1] 0 [ 0 -1 -1 4 0 0 0 -1 ] +FEMStencilSetRow: 4 [-1 -1 0] 0 [ -1 0 0 0 4 -1 -1 0 ] +FEMStencilSetRow: 5 [ 0 -1 0] 0 [ 0 -1 0 0 -1 4 0 -1 ] +FEMStencilSetRow: 6 [-1 0 0] 0 [ 0 0 -1 0 -1 0 4 -1 ] +FEMStencilSetRow: 7 [ 0 0 0] 0 [ 0 0 0 -1 0 -1 -1 4 ] + +# FEMRhsSet: values[size] +FEMRhsSet: [ 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 ] + +########################################################### + +# ProcessPoolCreate: num_pools +ProcessPoolCreate: 1 + +# ProcessPoolSetPart: pool part +ProcessPoolSetPart: 0 0 + +########################################################### diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.cube21 b/external/hypre/src/test/TEST_sstruct/sstruct.in.cube21 index 0618c7f4..2c842948 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.cube21 +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.cube21 @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.cubes2_aniso b/external/hypre/src/test/TEST_sstruct/sstruct.in.cubes2_aniso new file mode 100644 index 00000000..d630f4db --- /dev/null +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.cubes2_aniso @@ -0,0 +1,99 @@ +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + + +############################################################ + +# GridCreate: ndim nparts +GridCreate: 3 2 + +# GridSetExtents: part ilower(ndim) iupper(ndim) +GridSetExtents: 0 (0- 0- 0-) (1+ 1+ 1+) +GridSetExtents: 1 (0- 0- 0-) (1+ 1+ 1+) + +# GridSetVariables: part nvars vartypes[nvars] +GridSetVariables: 0 1 [0] +GridSetVariables: 1 1 [0] + +# GridSetNeighborPart: part ilower(ndim) iupper(ndim) +# nbor_part nbor_ilower(ndim) nbor_iupper(ndim) +# index_map[ndim] index_dir[ndim] +# East neighbors +GridSetNeighborPart: 0 (1+ 0- 0- : 1 0 0) (1+ 1+ 1+ : 1 0 0) 1 (0- 0- 0-) (0- 1+ 1+) [0 1 2] [1 1 1] + +# West neighbors +GridSetNeighborPart: 1 (0- 0- 0- : -1 0 0) (0- 1+ 1+ : -1 0 0) 0 (1+ 0- 0-) (1+ 1+ 1+) [0 1 2] [1 1 1] + +############################################################ + +# StencilCreate: nstencils sizes[nstencils] +StencilCreate: 2 [7 7] + +# StencilSetEntry: stencil_num entry offset[ndim] var value +StencilSetEntry: 0 0 [ 0 0 0] 0 24.0 +StencilSetEntry: 0 1 [-1 0 0] 0 -1.0 +StencilSetEntry: 0 2 [ 1 0 0] 0 -1.0 +StencilSetEntry: 0 3 [ 0 -1 0] 0 -10.0 +StencilSetEntry: 0 4 [ 0 1 0] 0 -10.0 +StencilSetEntry: 0 5 [ 0 0 -1] 0 -1.0 +StencilSetEntry: 0 6 [ 0 0 1] 0 -1.0 + +# StencilSetEntry: stencil_num entry offset[ndim] var value +StencilSetEntry: 1 0 [ 0 0 0] 0 14.0 +StencilSetEntry: 1 1 [-1 0 0] 0 -1.0 +StencilSetEntry: 1 2 [ 1 0 0] 0 -1.0 +StencilSetEntry: 1 3 [ 0 -1 0] 0 -1.0 +StencilSetEntry: 1 4 [ 0 1 0] 0 -1.0 +StencilSetEntry: 1 5 [ 0 0 -1] 0 -5.0 +StencilSetEntry: 1 6 [ 0 0 1] 0 -5.0 + +############################################################ + +# GraphSetStencil: part var stencil_num +GraphSetStencil: 0 0 0 +GraphSetStencil: 1 0 1 + +############################################################ + +# MatrixSetValues: boundary conditions +# part ilower(ndim) iupper(ndim) stride[ndim] var entry value +# Top BCs +MatrixSetValues: 0 (0- 0- 1+) (1+ 1+ 1+) [1 1 1] 0 6 0.0 +MatrixSetValues: 1 (0- 0- 1+) (1+ 1+ 1+) [1 1 1] 0 6 0.0 + +# Bottom BCs +MatrixSetValues: 0 (0- 0- 0-) (1+ 1+ 0-) [1 1 1] 0 5 0.0 +MatrixSetValues: 1 (0- 0- 0-) (1+ 1+ 0-) [1 1 1] 0 5 0.0 + +# North BCs +MatrixSetValues: 0 (0- 1+ 0-) (1+ 1+ 1+) [1 1 1] 0 4 0.0 +MatrixSetValues: 1 (0- 1+ 0-) (1+ 1+ 1+) [1 1 1] 0 4 0.0 + +# South BCs +MatrixSetValues: 0 (0- 0- 0-) (1+ 0- 1+) [1 1 1] 0 3 0.0 +MatrixSetValues: 1 (0- 0- 0-) (1+ 0- 1+) [1 1 1] 0 3 0.0 + +# East BCs +MatrixSetValues: 1 (1+ 0- 0-) (1+ 1+ 1+) [1 1 1] 0 2 0.0 + +# West BCs +MatrixSetValues: 0 (0- 0- 0-) (0- 1+ 1+) [1 1 1] 0 1 0.0 + +############################################################ + +# ProcessPoolCreate: num_pools +ProcessPoolCreate: 2 + +# ProcessPoolSetPart: pool part +ProcessPoolSetPart: 0 0 +ProcessPoolSetPart: 1 1 + +# ProcessPoolCreate: num_pools +ProcessPoolCreate: 1 + +# ProcessPoolSetPart: pool part +ProcessPoolSetPart: 0 0 +ProcessPoolSetPart: 0 1 +############################################################ diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.cubes4_27pt b/external/hypre/src/test/TEST_sstruct/sstruct.in.cubes4_27pt new file mode 100644 index 00000000..946dac7d --- /dev/null +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.cubes4_27pt @@ -0,0 +1,266 @@ +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + + +############################################################ + +# GridCreate: ndim nparts +GridCreate: 3 4 + +# GridSetExtents: part ilower(ndim) iupper(ndim) +GridSetExtents: 0 (0- 0- 0-) (1+ 1+ 3+) +GridSetExtents: 1 (0- 0- 0-) (1+ 1+ 3+) +GridSetExtents: 2 (0- 0- 0-) (1+ 1+ 3+) +GridSetExtents: 3 (0- 0- 0-) (1+ 1+ 3+) + +# GridSetVariables: part nvars vartypes[nvars] +GridSetVariables: 0 1 [0] +GridSetVariables: 1 1 [0] +GridSetVariables: 2 1 [0] +GridSetVariables: 3 1 [0] + +# GridSetNeighborPart: part ilower(ndim) iupper(ndim) +# nbor_part nbor_ilower(ndim) nbor_iupper(ndim) +# index_map[ndim] index_dir[ndim] +# North neighbors +GridSetNeighborPart: 0 (0- 1+ 0- : 0 1 0) (1+ 1+ 3+ : 0 1 0) 2 (0- 0- 0-) (1+ 0- 3+) [0 1 2] [1 1 1] +GridSetNeighborPart: 1 (0- 1+ 0- : 0 1 0) (1+ 1+ 3+ : 0 1 0) 3 (0- 0- 0-) (1+ 0- 3+) [0 1 2] [1 1 1] + +# South neighbors +GridSetNeighborPart: 2 (0- 0- 0- : 0 -1 0) (1+ 0- 3+ : 0 -1 0) 0 (0- 1+ 0-) (1+ 1+ 3+) [0 1 2] [1 1 1] +GridSetNeighborPart: 3 (0- 0- 0- : 0 -1 0) (1+ 0- 3+ : 0 -1 0) 1 (0- 1+ 0-) (1+ 1+ 3+) [0 1 2] [1 1 1] + +# East neighbors +GridSetNeighborPart: 0 (1+ 0- 0- : 1 0 0) (1+ 1+ 3+ : 1 0 0) 1 (0- 0- 0-) (0- 1+ 3+) [0 1 2] [1 1 1] +GridSetNeighborPart: 2 (1+ 0- 0- : 1 0 0) (1+ 1+ 3+ : 1 0 0) 3 (0- 0- 0-) (0- 1+ 3+) [0 1 2] [1 1 1] + +# West neighbors +GridSetNeighborPart: 1 (0- 0- 0- : -1 0 0) (0- 1+ 3+ : -1 0 0) 0 (1+ 0- 0-) (1+ 1+ 3+) [0 1 2] [1 1 1] +GridSetNeighborPart: 3 (0- 0- 0- : -1 0 0) (0- 1+ 3+ : -1 0 0) 2 (1+ 0- 0-) (1+ 1+ 3+) [0 1 2] [1 1 1] + +############################################################ + +############################################################ + +# StencilCreate: nstencils sizes[nstencils] +StencilCreate: 1 [27] + +# StencilSetEntry: stencil_num entry offset[ndim] var value +StencilSetEntry: 0 0 [ 0 0 0] 0 26.0 +StencilSetEntry: 0 1 [-1 0 0] 0 -1.0 +StencilSetEntry: 0 2 [ 1 0 0] 0 -1.0 +StencilSetEntry: 0 3 [-1 -1 0] 0 -1.0 +StencilSetEntry: 0 4 [ 0 -1 0] 0 -1.0 +StencilSetEntry: 0 5 [ 1 -1 0] 0 -1.0 +StencilSetEntry: 0 6 [-1 1 0] 0 -1.0 +StencilSetEntry: 0 7 [ 0 1 0] 0 -1.0 +StencilSetEntry: 0 8 [ 1 1 0] 0 -1.0 +StencilSetEntry: 0 9 [ 0 0 -1] 0 -1.0 +StencilSetEntry: 0 10 [-1 0 -1] 0 -1.0 +StencilSetEntry: 0 11 [ 1 0 -1] 0 -1.0 +StencilSetEntry: 0 12 [-1 -1 -1] 0 -1.0 +StencilSetEntry: 0 13 [ 0 -1 -1] 0 -1.0 +StencilSetEntry: 0 14 [ 1 -1 -1] 0 -1.0 +StencilSetEntry: 0 15 [-1 1 -1] 0 -1.0 +StencilSetEntry: 0 16 [ 0 1 -1] 0 -1.0 +StencilSetEntry: 0 17 [ 1 1 -1] 0 -1.0 +StencilSetEntry: 0 18 [ 0 0 1] 0 -1.0 +StencilSetEntry: 0 19 [-1 0 1] 0 -1.0 +StencilSetEntry: 0 20 [ 1 0 1] 0 -1.0 +StencilSetEntry: 0 21 [-1 -1 1] 0 -1.0 +StencilSetEntry: 0 22 [ 0 -1 1] 0 -1.0 +StencilSetEntry: 0 23 [ 1 -1 1] 0 -1.0 +StencilSetEntry: 0 24 [-1 1 1] 0 -1.0 +StencilSetEntry: 0 25 [ 0 1 1] 0 -1.0 +StencilSetEntry: 0 26 [ 1 1 1] 0 -1.0 + +############################################################ + +# GraphSetStencil: part var stencil_num +GraphSetStencil: 0 0 0 +GraphSetStencil: 1 0 0 +GraphSetStencil: 2 0 0 +GraphSetStencil: 3 0 0 + +############################################################ + +# MatrixSetValues: boundary conditions +# part ilower(ndim) iupper(ndim) stride[ndim] var entry value +# Top BCs +MatrixSetValues: 0 (0- 0- 3+) (1+ 1+ 3+) [1 1 1] 0 18 0.0 +MatrixSetValues: 0 (0- 0- 3+) (1+ 1+ 3+) [1 1 1] 0 19 0.0 +MatrixSetValues: 0 (0- 0- 3+) (1+ 1+ 3+) [1 1 1] 0 20 0.0 +MatrixSetValues: 0 (0- 0- 3+) (1+ 1+ 3+) [1 1 1] 0 21 0.0 +MatrixSetValues: 0 (0- 0- 3+) (1+ 1+ 3+) [1 1 1] 0 22 0.0 +MatrixSetValues: 0 (0- 0- 3+) (1+ 1+ 3+) [1 1 1] 0 23 0.0 +MatrixSetValues: 0 (0- 0- 3+) (1+ 1+ 3+) [1 1 1] 0 24 0.0 +MatrixSetValues: 0 (0- 0- 3+) (1+ 1+ 3+) [1 1 1] 0 25 0.0 +MatrixSetValues: 0 (0- 0- 3+) (1+ 1+ 3+) [1 1 1] 0 26 0.0 +MatrixSetValues: 1 (0- 0- 3+) (1+ 1+ 3+) [1 1 1] 0 18 0.0 +MatrixSetValues: 1 (0- 0- 3+) (1+ 1+ 3+) [1 1 1] 0 19 0.0 +MatrixSetValues: 1 (0- 0- 3+) (1+ 1+ 3+) [1 1 1] 0 20 0.0 +MatrixSetValues: 1 (0- 0- 3+) (1+ 1+ 3+) [1 1 1] 0 21 0.0 +MatrixSetValues: 1 (0- 0- 3+) (1+ 1+ 3+) [1 1 1] 0 22 0.0 +MatrixSetValues: 1 (0- 0- 3+) (1+ 1+ 3+) [1 1 1] 0 23 0.0 +MatrixSetValues: 1 (0- 0- 3+) (1+ 1+ 3+) [1 1 1] 0 24 0.0 +MatrixSetValues: 1 (0- 0- 3+) (1+ 1+ 3+) [1 1 1] 0 25 0.0 +MatrixSetValues: 1 (0- 0- 3+) (1+ 1+ 3+) [1 1 1] 0 26 0.0 +MatrixSetValues: 2 (0- 0- 3+) (1+ 1+ 3+) [1 1 1] 0 18 0.0 +MatrixSetValues: 2 (0- 0- 3+) (1+ 1+ 3+) [1 1 1] 0 19 0.0 +MatrixSetValues: 2 (0- 0- 3+) (1+ 1+ 3+) [1 1 1] 0 20 0.0 +MatrixSetValues: 2 (0- 0- 3+) (1+ 1+ 3+) [1 1 1] 0 21 0.0 +MatrixSetValues: 2 (0- 0- 3+) (1+ 1+ 3+) [1 1 1] 0 22 0.0 +MatrixSetValues: 2 (0- 0- 3+) (1+ 1+ 3+) [1 1 1] 0 23 0.0 +MatrixSetValues: 2 (0- 0- 3+) (1+ 1+ 3+) [1 1 1] 0 24 0.0 +MatrixSetValues: 2 (0- 0- 3+) (1+ 1+ 3+) [1 1 1] 0 25 0.0 +MatrixSetValues: 2 (0- 0- 3+) (1+ 1+ 3+) [1 1 1] 0 26 0.0 +MatrixSetValues: 3 (0- 0- 3+) (1+ 1+ 3+) [1 1 1] 0 18 0.0 +MatrixSetValues: 3 (0- 0- 3+) (1+ 1+ 3+) [1 1 1] 0 19 0.0 +MatrixSetValues: 3 (0- 0- 3+) (1+ 1+ 3+) [1 1 1] 0 20 0.0 +MatrixSetValues: 3 (0- 0- 3+) (1+ 1+ 3+) [1 1 1] 0 21 0.0 +MatrixSetValues: 3 (0- 0- 3+) (1+ 1+ 3+) [1 1 1] 0 22 0.0 +MatrixSetValues: 3 (0- 0- 3+) (1+ 1+ 3+) [1 1 1] 0 23 0.0 +MatrixSetValues: 3 (0- 0- 3+) (1+ 1+ 3+) [1 1 1] 0 24 0.0 +MatrixSetValues: 3 (0- 0- 3+) (1+ 1+ 3+) [1 1 1] 0 25 0.0 +MatrixSetValues: 3 (0- 0- 3+) (1+ 1+ 3+) [1 1 1] 0 26 0.0 + +# Bottom BCs +MatrixSetValues: 0 (0- 0- 0-) (1+ 1+ 0-) [1 1 1] 0 9 0.0 +MatrixSetValues: 0 (0- 0- 0-) (1+ 1+ 0-) [1 1 1] 0 10 0.0 +MatrixSetValues: 0 (0- 0- 0-) (1+ 1+ 0-) [1 1 1] 0 11 0.0 +MatrixSetValues: 0 (0- 0- 0-) (1+ 1+ 0-) [1 1 1] 0 12 0.0 +MatrixSetValues: 0 (0- 0- 0-) (1+ 1+ 0-) [1 1 1] 0 13 0.0 +MatrixSetValues: 0 (0- 0- 0-) (1+ 1+ 0-) [1 1 1] 0 14 0.0 +MatrixSetValues: 0 (0- 0- 0-) (1+ 1+ 0-) [1 1 1] 0 15 0.0 +MatrixSetValues: 0 (0- 0- 0-) (1+ 1+ 0-) [1 1 1] 0 16 0.0 +MatrixSetValues: 0 (0- 0- 0-) (1+ 1+ 0-) [1 1 1] 0 17 0.0 +MatrixSetValues: 1 (0- 0- 0-) (1+ 1+ 0-) [1 1 1] 0 9 0.0 +MatrixSetValues: 1 (0- 0- 0-) (1+ 1+ 0-) [1 1 1] 0 10 0.0 +MatrixSetValues: 1 (0- 0- 0-) (1+ 1+ 0-) [1 1 1] 0 11 0.0 +MatrixSetValues: 1 (0- 0- 0-) (1+ 1+ 0-) [1 1 1] 0 12 0.0 +MatrixSetValues: 1 (0- 0- 0-) (1+ 1+ 0-) [1 1 1] 0 13 0.0 +MatrixSetValues: 1 (0- 0- 0-) (1+ 1+ 0-) [1 1 1] 0 14 0.0 +MatrixSetValues: 1 (0- 0- 0-) (1+ 1+ 0-) [1 1 1] 0 15 0.0 +MatrixSetValues: 1 (0- 0- 0-) (1+ 1+ 0-) [1 1 1] 0 16 0.0 +MatrixSetValues: 1 (0- 0- 0-) (1+ 1+ 0-) [1 1 1] 0 17 0.0 +MatrixSetValues: 2 (0- 0- 0-) (1+ 1+ 0-) [1 1 1] 0 9 0.0 +MatrixSetValues: 2 (0- 0- 0-) (1+ 1+ 0-) [1 1 1] 0 10 0.0 +MatrixSetValues: 2 (0- 0- 0-) (1+ 1+ 0-) [1 1 1] 0 11 0.0 +MatrixSetValues: 2 (0- 0- 0-) (1+ 1+ 0-) [1 1 1] 0 12 0.0 +MatrixSetValues: 2 (0- 0- 0-) (1+ 1+ 0-) [1 1 1] 0 13 0.0 +MatrixSetValues: 2 (0- 0- 0-) (1+ 1+ 0-) [1 1 1] 0 14 0.0 +MatrixSetValues: 2 (0- 0- 0-) (1+ 1+ 0-) [1 1 1] 0 15 0.0 +MatrixSetValues: 2 (0- 0- 0-) (1+ 1+ 0-) [1 1 1] 0 16 0.0 +MatrixSetValues: 2 (0- 0- 0-) (1+ 1+ 0-) [1 1 1] 0 17 0.0 +MatrixSetValues: 3 (0- 0- 0-) (1+ 1+ 0-) [1 1 1] 0 9 0.0 +MatrixSetValues: 3 (0- 0- 0-) (1+ 1+ 0-) [1 1 1] 0 10 0.0 +MatrixSetValues: 3 (0- 0- 0-) (1+ 1+ 0-) [1 1 1] 0 11 0.0 +MatrixSetValues: 3 (0- 0- 0-) (1+ 1+ 0-) [1 1 1] 0 12 0.0 +MatrixSetValues: 3 (0- 0- 0-) (1+ 1+ 0-) [1 1 1] 0 13 0.0 +MatrixSetValues: 3 (0- 0- 0-) (1+ 1+ 0-) [1 1 1] 0 14 0.0 +MatrixSetValues: 3 (0- 0- 0-) (1+ 1+ 0-) [1 1 1] 0 15 0.0 +MatrixSetValues: 3 (0- 0- 0-) (1+ 1+ 0-) [1 1 1] 0 16 0.0 +MatrixSetValues: 3 (0- 0- 0-) (1+ 1+ 0-) [1 1 1] 0 17 0.0 + +# North BCs +MatrixSetValues: 2 (0- 1+ 0-) (1+ 1+ 3+) [1 1 1] 0 6 0.0 +MatrixSetValues: 2 (0- 1+ 0-) (1+ 1+ 3+) [1 1 1] 0 7 0.0 +MatrixSetValues: 2 (0- 1+ 0-) (1+ 1+ 3+) [1 1 1] 0 8 0.0 +MatrixSetValues: 2 (0- 1+ 0-) (1+ 1+ 3+) [1 1 1] 0 15 0.0 +MatrixSetValues: 2 (0- 1+ 0-) (1+ 1+ 3+) [1 1 1] 0 16 0.0 +MatrixSetValues: 2 (0- 1+ 0-) (1+ 1+ 3+) [1 1 1] 0 17 0.0 +MatrixSetValues: 2 (0- 1+ 0-) (1+ 1+ 3+) [1 1 1] 0 24 0.0 +MatrixSetValues: 2 (0- 1+ 0-) (1+ 1+ 3+) [1 1 1] 0 25 0.0 +MatrixSetValues: 2 (0- 1+ 0-) (1+ 1+ 3+) [1 1 1] 0 26 0.0 +MatrixSetValues: 3 (0- 1+ 0-) (1+ 1+ 3+) [1 1 1] 0 6 0.0 +MatrixSetValues: 3 (0- 1+ 0-) (1+ 1+ 3+) [1 1 1] 0 7 0.0 +MatrixSetValues: 3 (0- 1+ 0-) (1+ 1+ 3+) [1 1 1] 0 8 0.0 +MatrixSetValues: 3 (0- 1+ 0-) (1+ 1+ 3+) [1 1 1] 0 15 0.0 +MatrixSetValues: 3 (0- 1+ 0-) (1+ 1+ 3+) [1 1 1] 0 16 0.0 +MatrixSetValues: 3 (0- 1+ 0-) (1+ 1+ 3+) [1 1 1] 0 17 0.0 +MatrixSetValues: 3 (0- 1+ 0-) (1+ 1+ 3+) [1 1 1] 0 24 0.0 +MatrixSetValues: 3 (0- 1+ 0-) (1+ 1+ 3+) [1 1 1] 0 25 0.0 +MatrixSetValues: 3 (0- 1+ 0-) (1+ 1+ 3+) [1 1 1] 0 26 0.0 + +# South BCs +MatrixSetValues: 0 (0- 0- 0-) (1+ 0- 3+) [1 1 1] 0 3 0.0 +MatrixSetValues: 0 (0- 0- 0-) (1+ 0- 3+) [1 1 1] 0 4 0.0 +MatrixSetValues: 0 (0- 0- 0-) (1+ 0- 3+) [1 1 1] 0 5 0.0 +MatrixSetValues: 0 (0- 0- 0-) (1+ 0- 3+) [1 1 1] 0 12 0.0 +MatrixSetValues: 0 (0- 0- 0-) (1+ 0- 3+) [1 1 1] 0 13 0.0 +MatrixSetValues: 0 (0- 0- 0-) (1+ 0- 3+) [1 1 1] 0 14 0.0 +MatrixSetValues: 0 (0- 0- 0-) (1+ 0- 3+) [1 1 1] 0 21 0.0 +MatrixSetValues: 0 (0- 0- 0-) (1+ 0- 3+) [1 1 1] 0 22 0.0 +MatrixSetValues: 0 (0- 0- 0-) (1+ 0- 3+) [1 1 1] 0 23 0.0 +MatrixSetValues: 1 (0- 0- 0-) (1+ 0- 3+) [1 1 1] 0 3 0.0 +MatrixSetValues: 1 (0- 0- 0-) (1+ 0- 3+) [1 1 1] 0 4 0.0 +MatrixSetValues: 1 (0- 0- 0-) (1+ 0- 3+) [1 1 1] 0 5 0.0 +MatrixSetValues: 1 (0- 0- 0-) (1+ 0- 3+) [1 1 1] 0 12 0.0 +MatrixSetValues: 1 (0- 0- 0-) (1+ 0- 3+) [1 1 1] 0 13 0.0 +MatrixSetValues: 1 (0- 0- 0-) (1+ 0- 3+) [1 1 1] 0 14 0.0 +MatrixSetValues: 1 (0- 0- 0-) (1+ 0- 3+) [1 1 1] 0 21 0.0 +MatrixSetValues: 1 (0- 0- 0-) (1+ 0- 3+) [1 1 1] 0 22 0.0 +MatrixSetValues: 1 (0- 0- 0-) (1+ 0- 3+) [1 1 1] 0 23 0.0 + +# East BCs +MatrixSetValues: 1 (1+ 0- 0-) (1+ 1+ 3+) [1 1 1] 0 2 0.0 +MatrixSetValues: 1 (1+ 0- 0-) (1+ 1+ 3+) [1 1 1] 0 5 0.0 +MatrixSetValues: 1 (1+ 0- 0-) (1+ 1+ 3+) [1 1 1] 0 8 0.0 +MatrixSetValues: 1 (1+ 0- 0-) (1+ 1+ 3+) [1 1 1] 0 11 0.0 +MatrixSetValues: 1 (1+ 0- 0-) (1+ 1+ 3+) [1 1 1] 0 14 0.0 +MatrixSetValues: 1 (1+ 0- 0-) (1+ 1+ 3+) [1 1 1] 0 17 0.0 +MatrixSetValues: 1 (1+ 0- 0-) (1+ 1+ 3+) [1 1 1] 0 20 0.0 +MatrixSetValues: 1 (1+ 0- 0-) (1+ 1+ 3+) [1 1 1] 0 23 0.0 +MatrixSetValues: 1 (1+ 0- 0-) (1+ 1+ 3+) [1 1 1] 0 26 0.0 +MatrixSetValues: 3 (1+ 0- 0-) (1+ 1+ 3+) [1 1 1] 0 2 0.0 +MatrixSetValues: 3 (1+ 0- 0-) (1+ 1+ 3+) [1 1 1] 0 5 0.0 +MatrixSetValues: 3 (1+ 0- 0-) (1+ 1+ 3+) [1 1 1] 0 8 0.0 +MatrixSetValues: 3 (1+ 0- 0-) (1+ 1+ 3+) [1 1 1] 0 11 0.0 +MatrixSetValues: 3 (1+ 0- 0-) (1+ 1+ 3+) [1 1 1] 0 14 0.0 +MatrixSetValues: 3 (1+ 0- 0-) (1+ 1+ 3+) [1 1 1] 0 17 0.0 +MatrixSetValues: 3 (1+ 0- 0-) (1+ 1+ 3+) [1 1 1] 0 20 0.0 +MatrixSetValues: 3 (1+ 0- 0-) (1+ 1+ 3+) [1 1 1] 0 23 0.0 +MatrixSetValues: 3 (1+ 0- 0-) (1+ 1+ 3+) [1 1 1] 0 26 0.0 + +# West BCs +MatrixSetValues: 0 (0- 0- 0-) (0- 1+ 3+) [1 1 1] 0 1 0.0 +MatrixSetValues: 0 (0- 0- 0-) (0- 1+ 3+) [1 1 1] 0 3 0.0 +MatrixSetValues: 0 (0- 0- 0-) (0- 1+ 3+) [1 1 1] 0 6 0.0 +MatrixSetValues: 0 (0- 0- 0-) (0- 1+ 3+) [1 1 1] 0 10 0.0 +MatrixSetValues: 0 (0- 0- 0-) (0- 1+ 3+) [1 1 1] 0 12 0.0 +MatrixSetValues: 0 (0- 0- 0-) (0- 1+ 3+) [1 1 1] 0 15 0.0 +MatrixSetValues: 0 (0- 0- 0-) (0- 1+ 3+) [1 1 1] 0 19 0.0 +MatrixSetValues: 0 (0- 0- 0-) (0- 1+ 3+) [1 1 1] 0 21 0.0 +MatrixSetValues: 0 (0- 0- 0-) (0- 1+ 3+) [1 1 1] 0 24 0.0 +MatrixSetValues: 2 (0- 0- 0-) (0- 1+ 3+) [1 1 1] 0 1 0.0 +MatrixSetValues: 2 (0- 0- 0-) (0- 1+ 3+) [1 1 1] 0 3 0.0 +MatrixSetValues: 2 (0- 0- 0-) (0- 1+ 3+) [1 1 1] 0 6 0.0 +MatrixSetValues: 2 (0- 0- 0-) (0- 1+ 3+) [1 1 1] 0 10 0.0 +MatrixSetValues: 2 (0- 0- 0-) (0- 1+ 3+) [1 1 1] 0 12 0.0 +MatrixSetValues: 2 (0- 0- 0-) (0- 1+ 3+) [1 1 1] 0 15 0.0 +MatrixSetValues: 2 (0- 0- 0-) (0- 1+ 3+) [1 1 1] 0 19 0.0 +MatrixSetValues: 2 (0- 0- 0-) (0- 1+ 3+) [1 1 1] 0 21 0.0 +MatrixSetValues: 2 (0- 0- 0-) (0- 1+ 3+) [1 1 1] 0 24 0.0 + +############################################################ + +# ProcessPoolCreate: num_pools +ProcessPoolCreate: 4 + +# ProcessPoolSetPart: pool part +ProcessPoolSetPart: 0 0 +ProcessPoolSetPart: 1 1 +ProcessPoolSetPart: 2 2 +ProcessPoolSetPart: 3 3 + +# ProcessPoolCreate: num_pools +ProcessPoolCreate: 1 + +# ProcessPoolSetPart: pool part +ProcessPoolSetPart: 0 0 +ProcessPoolSetPart: 0 1 +ProcessPoolSetPart: 0 2 +ProcessPoolSetPart: 0 3 +############################################################ diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.cycred-1Dx b/external/hypre/src/test/TEST_sstruct/sstruct.in.cycred-1Dx index dcc63f09..a44b5617 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.cycred-1Dx +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.cycred-1Dx @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.cycred-2Dx b/external/hypre/src/test/TEST_sstruct/sstruct.in.cycred-2Dx index 88d0fb2d..c0b646ea 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.cycred-2Dx +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.cycred-2Dx @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.cycred-2Dy b/external/hypre/src/test/TEST_sstruct/sstruct.in.cycred-2Dy index 2a5c0773..edd641f3 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.cycred-2Dy +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.cycred-2Dy @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.cycred-3Dx b/external/hypre/src/test/TEST_sstruct/sstruct.in.cycred-3Dx index 3ef37237..c97699e6 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.cycred-3Dx +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.cycred-3Dx @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.cycred-3Dy b/external/hypre/src/test/TEST_sstruct/sstruct.in.cycred-3Dy index ed13f629..a9e75179 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.cycred-3Dy +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.cycred-3Dy @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.cycred-3Dz b/external/hypre/src/test/TEST_sstruct/sstruct.in.cycred-3Dz index 95ebcecf..a1b04235 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.cycred-3Dz +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.cycred-3Dz @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.default b/external/hypre/src/test/TEST_sstruct/sstruct.in.default index c1d589cc..6567356c 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.default +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.default @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.default_2D b/external/hypre/src/test/TEST_sstruct/sstruct.in.default_2D index 958052af..6a9ad1d6 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.default_2D +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.default_2D @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.dirichlet b/external/hypre/src/test/TEST_sstruct/sstruct.in.dirichlet index 3925fcc2..908399b4 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.dirichlet +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.dirichlet @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.emptyProc1 b/external/hypre/src/test/TEST_sstruct/sstruct.in.emptyProc1 index 24ca7c9f..71a67764 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.emptyProc1 +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.emptyProc1 @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.emptyProc2 b/external/hypre/src/test/TEST_sstruct/sstruct.in.emptyProc2 index 53d5765d..b8ff900a 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.emptyProc2 +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.emptyProc2 @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.emptyProc3 b/external/hypre/src/test/TEST_sstruct/sstruct.in.emptyProc3 index 00864849..4df2344a 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.emptyProc3 +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.emptyProc3 @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.enhanced3D b/external/hypre/src/test/TEST_sstruct/sstruct.in.enhanced3D index bbe05375..60dba8bc 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.enhanced3D +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.enhanced3D @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_all2_2D b/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_all2_2D index ccf05e8d..ce1879cf 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_all2_2D +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_all2_2D @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_all2_2D_coord b/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_all2_2D_coord index 9115fcac..55a909cf 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_all2_2D_coord +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_all2_2D_coord @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_all2_2Ds b/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_all2_2Ds index d8bf6fbe..fe9d535c 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_all2_2Ds +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_all2_2Ds @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_all2_2Dss b/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_all2_2Dss index 7ce6dc8f..fb811e56 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_all2_2Dss +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_all2_2Dss @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_all2_3D b/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_all2_3D index 950af876..01b17f34 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_all2_3D +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_all2_3D @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_all2_3D_coord b/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_all2_3D_coord index 4d0f4a9f..738ca02a 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_all2_3D_coord +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_all2_3D_coord @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_all3_3D b/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_all3_3D index 8b87a969..2b245a7c 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_all3_3D +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_all3_3D @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_all3_3D_coord b/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_all3_3D_coord index c7e1f343..6d45ef54 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_all3_3D_coord +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_all3_3D_coord @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_node1_2D b/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_node1_2D index 4859cca6..56fad2de 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_node1_2D +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_node1_2D @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_node2_2D b/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_node2_2D index 33a1de5a..ec9bad7b 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_node2_2D +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_node2_2D @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_node2_2D_coord b/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_node2_2D_coord index 8bb3cdd3..4bf02eac 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_node2_2D_coord +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_node2_2D_coord @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_rhombus5 b/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_rhombus5 index ef7d7873..b880edbd 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_rhombus5 +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.fe_rhombus5 @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.laps b/external/hypre/src/test/TEST_sstruct/sstruct.in.laps index d5e1f288..8062ecc5 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.laps +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.laps @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.laps.periodic b/external/hypre/src/test/TEST_sstruct/sstruct.in.laps.periodic index ac10ddb7..84a9b335 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.laps.periodic +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.laps.periodic @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.marinak b/external/hypre/src/test/TEST_sstruct/sstruct.in.marinak index 256ebad8..3987d752 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.marinak +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.marinak @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.maxwell3d_unscaled b/external/hypre/src/test/TEST_sstruct/sstruct.in.maxwell3d_unscaled index 63ddbbef..05d79389 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.maxwell3d_unscaled +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.maxwell3d_unscaled @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.miller_2blk b/external/hypre/src/test/TEST_sstruct/sstruct.in.miller_2blk index cf55dcb9..83d5173b 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.miller_2blk +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.miller_2blk @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.miller_2blk1 b/external/hypre/src/test/TEST_sstruct/sstruct.in.miller_2blk1 index afc46c04..8087f965 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.miller_2blk1 +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.miller_2blk1 @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.miller_2stk b/external/hypre/src/test/TEST_sstruct/sstruct.in.miller_2stk index 6f406278..4cd67b46 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.miller_2stk +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.miller_2stk @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.miller_3blk b/external/hypre/src/test/TEST_sstruct/sstruct.in.miller_3blk index de25ce04..b8cc9fe2 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.miller_3blk +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.miller_3blk @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -11,13 +11,13 @@ # | / | # | part 1 / | # | / | -# | j / | -# | | / | +# | j / | +# | | / | # | ---i / | -# --------------- part 2 | +# --------------- part 2 | # | | | # | part 0 | | -# | | | +# | | | # | j | j | # | | | | | # | ---i | ---i | @@ -125,5 +125,12 @@ ProcessPoolSetPart: 0 0 ProcessPoolSetPart: 0 1 ProcessPoolSetPart: 0 2 -########################################################### +# ProcessPoolCreate: num_pools +ProcessPoolCreate: 3 +# ProcessPoolSetPart: pool part +ProcessPoolSetPart: 0 0 +ProcessPoolSetPart: 1 1 +ProcessPoolSetPart: 2 2 + +########################################################### diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.miller_diag b/external/hypre/src/test/TEST_sstruct/sstruct.in.miller_diag index fc356793..fe43561d 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.miller_diag +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.miller_diag @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.neumann b/external/hypre/src/test/TEST_sstruct/sstruct.in.neumann index b5e7e4a9..a0ac0ed2 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.neumann +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.neumann @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.neumann-yz b/external/hypre/src/test/TEST_sstruct/sstruct.in.neumann-yz index e93f2029..a3401708 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.neumann-yz +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.neumann-yz @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.noaddtoval_cellcentre b/external/hypre/src/test/TEST_sstruct/sstruct.in.noaddtoval_cellcentre index a1a8cd83..8dcfc4f3 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.noaddtoval_cellcentre +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.noaddtoval_cellcentre @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.noaddtoval_edges b/external/hypre/src/test/TEST_sstruct/sstruct.in.noaddtoval_edges index e5f12f33..1352d8e9 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.noaddtoval_edges +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.noaddtoval_edges @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.p19aniso b/external/hypre/src/test/TEST_sstruct/sstruct.in.p19aniso index 1cc49e46..e8b5d5d4 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.p19aniso +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.p19aniso @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.p19iso b/external/hypre/src/test/TEST_sstruct/sstruct.in.p19iso index 486b02b4..532bff31 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.p19iso +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.p19iso @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.p7aniso b/external/hypre/src/test/TEST_sstruct/sstruct.in.p7aniso index 4fb6800a..2dff9f2f 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.p7aniso +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.p7aniso @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.p7iso b/external/hypre/src/test/TEST_sstruct/sstruct.in.p7iso index 2e366f6a..2c8af134 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.p7iso +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.p7iso @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.pcube b/external/hypre/src/test/TEST_sstruct/sstruct.in.pcube index 65239e3d..cafccbcc 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.pcube +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.pcube @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.periodic b/external/hypre/src/test/TEST_sstruct/sstruct.in.periodic index d4a40bfe..5aa79c67 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.periodic +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.periodic @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.periodic.2D b/external/hypre/src/test/TEST_sstruct/sstruct.in.periodic.2D index 62ab78b4..f1f5c188 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.periodic.2D +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.periodic.2D @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.periodic.add b/external/hypre/src/test/TEST_sstruct/sstruct.in.periodic.add index 625b0127..7876160f 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.periodic.add +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.periodic.add @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.periodic.bigA b/external/hypre/src/test/TEST_sstruct/sstruct.in.periodic.bigA index 55c69f90..e6b9bd82 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.periodic.bigA +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.periodic.bigA @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.periodic.bigB b/external/hypre/src/test/TEST_sstruct/sstruct.in.periodic.bigB index 7838be3f..08450219 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.periodic.bigB +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.periodic.bigB @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.periodic.cellA b/external/hypre/src/test/TEST_sstruct/sstruct.in.periodic.cellA index 38351de4..3fed8b8d 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.periodic.cellA +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.periodic.cellA @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.periodic.cellB b/external/hypre/src/test/TEST_sstruct/sstruct.in.periodic.cellB index 8a0c18bc..ff38a73b 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.periodic.cellB +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.periodic.cellB @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.periodic.nodeA b/external/hypre/src/test/TEST_sstruct/sstruct.in.periodic.nodeA index bd29bc73..cae610ed 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.periodic.nodeA +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.periodic.nodeA @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.periodic.nodeB b/external/hypre/src/test/TEST_sstruct/sstruct.in.periodic.nodeB index 42477975..b63a7b81 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.periodic.nodeB +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.periodic.nodeB @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.reduced3D b/external/hypre/src/test/TEST_sstruct/sstruct.in.reduced3D index ecf88c52..da6a5648 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.reduced3D +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.reduced3D @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.reduced3D-4 b/external/hypre/src/test/TEST_sstruct/sstruct.in.reduced3D-4 index c74c88c0..37c01004 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.reduced3D-4 +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.reduced3D-4 @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.struct b/external/hypre/src/test/TEST_sstruct/sstruct.in.struct index a36ae048..e0b120b5 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.struct +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.struct @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.symm0 b/external/hypre/src/test/TEST_sstruct/sstruct.in.symm0 index d9d8c626..255e4af9 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.symm0 +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.symm0 @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.symm0.2D b/external/hypre/src/test/TEST_sstruct/sstruct.in.symm0.2D index 1efe95c8..f36b363e 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.symm0.2D +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.symm0.2D @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.symm1 b/external/hypre/src/test/TEST_sstruct/sstruct.in.symm1 index 0338e778..8b82ea4b 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.symm1 +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.symm1 @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.symm1.2D b/external/hypre/src/test/TEST_sstruct/sstruct.in.symm1.2D index 9de5498d..c985de7f 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.symm1.2D +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.symm1.2D @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.symm2 b/external/hypre/src/test/TEST_sstruct/sstruct.in.symm2 index 89c73cd5..f96a8014 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.symm2 +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.symm2 @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.symm2.2D b/external/hypre/src/test/TEST_sstruct/sstruct.in.symm2.2D index 0036f065..a4d52aed 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.symm2.2D +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.symm2.2D @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.symm3 b/external/hypre/src/test/TEST_sstruct/sstruct.in.symm3 index 436d3389..6ce41dfb 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.symm3 +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.symm3 @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.symm3.2D b/external/hypre/src/test/TEST_sstruct/sstruct.in.symm3.2D index 641290a8..02583b1f 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.symm3.2D +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.symm3.2D @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct.in.wide.2D b/external/hypre/src/test/TEST_sstruct/sstruct.in.wide.2D index 2a321a78..0af1c5c5 100644 --- a/external/hypre/src/test/TEST_sstruct/sstruct.in.wide.2D +++ b/external/hypre/src/test/TEST_sstruct/sstruct.in.wide.2D @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct_struct.jobs b/external/hypre/src/test/TEST_sstruct/sstruct_struct.jobs old mode 100644 new mode 100755 index 72283e01..ea4b0b77 --- a/external/hypre/src/test/TEST_sstruct/sstruct_struct.jobs +++ b/external/hypre/src/test/TEST_sstruct/sstruct_struct.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/sstruct_struct.saved.ray b/external/hypre/src/test/TEST_sstruct/sstruct_struct.saved.lassen_cpu similarity index 100% rename from external/hypre/src/test/TEST_sstruct/sstruct_struct.saved.ray rename to external/hypre/src/test/TEST_sstruct/sstruct_struct.saved.lassen_cpu diff --git a/external/hypre/src/test/TEST_sstruct/sstruct_struct.sh b/external/hypre/src/test/TEST_sstruct/sstruct_struct.sh old mode 100644 new mode 100755 index 9bd165a7..8ec64c4c --- a/external/hypre/src/test/TEST_sstruct/sstruct_struct.sh +++ b/external/hypre/src/test/TEST_sstruct/sstruct_struct.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/symm.jobs b/external/hypre/src/test/TEST_sstruct/symm.jobs old mode 100644 new mode 100755 index 60c4b9fe..998603e2 --- a/external/hypre/src/test/TEST_sstruct/symm.jobs +++ b/external/hypre/src/test/TEST_sstruct/symm.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/symm.saved.ray b/external/hypre/src/test/TEST_sstruct/symm.saved.lassen_cpu similarity index 100% rename from external/hypre/src/test/TEST_sstruct/symm.saved.ray rename to external/hypre/src/test/TEST_sstruct/symm.saved.lassen_cpu diff --git a/external/hypre/src/test/TEST_sstruct/symm.sh b/external/hypre/src/test/TEST_sstruct/symm.sh old mode 100644 new mode 100755 index a1b741e6..73f3a8c7 --- a/external/hypre/src/test/TEST_sstruct/symm.sh +++ b/external/hypre/src/test/TEST_sstruct/symm.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/versioncheck.jobs b/external/hypre/src/test/TEST_sstruct/versioncheck.jobs new file mode 100755 index 00000000..162dca2c --- /dev/null +++ b/external/hypre/src/test/TEST_sstruct/versioncheck.jobs @@ -0,0 +1,12 @@ +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +#============================================================================= +# Check the version header file variables +#============================================================================= + +mpirun -np 1 ./sstruct > versioncheck.out.1 + diff --git a/external/hypre/src/test/TEST_sstruct/versioncheck.sh b/external/hypre/src/test/TEST_sstruct/versioncheck.sh new file mode 100755 index 00000000..87db6aaf --- /dev/null +++ b/external/hypre/src/test/TEST_sstruct/versioncheck.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +TNAME=`basename $0 .sh` + +#============================================================================= +# Check the HYPRE_DEVELOP variables +#============================================================================= + +grep "Using HYPRE_DEVELOP_STRING" ${TNAME}.out.1 > ${TNAME}.testdata + +echo -n > ${TNAME}.testdatacheck +if [ -d ../../../.git ]; then + DEVSTRING=`git describe --match 'v*' --long --abbrev=9 2>/dev/null` + DEVNUMBER=`echo $DEVSTRING | awk -F- '{print $2}'` + DEVBRANCH=`git rev-parse --abbrev-ref HEAD` + if [ -n "$DEVSTRING" ]; then + if [ "$DEVBRANCH" != "master" ]; then + echo "Using HYPRE_DEVELOP_STRING: $DEVSTRING (branch $DEVBRANCH; not the develop branch)" \ + > ${TNAME}.testdatacheck + else + echo "Using HYPRE_DEVELOP_STRING: $DEVSTRING (branch $DEVBRANCH; the develop branch)" \ + > ${TNAME}.testdatacheck + fi + fi +fi +diff ${TNAME}.testdata ${TNAME}.testdatacheck >&2 + +#============================================================================= +# remove temporary files +#============================================================================= + +rm -f ${TNAME}.testdata* diff --git a/external/hypre/src/test/TEST_sstruct/wide.jobs b/external/hypre/src/test/TEST_sstruct/wide.jobs old mode 100644 new mode 100755 index f3ab572c..f3e7598c --- a/external/hypre/src/test/TEST_sstruct/wide.jobs +++ b/external/hypre/src/test/TEST_sstruct/wide.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/wide.saved.ray b/external/hypre/src/test/TEST_sstruct/wide.saved.lassen_cpu similarity index 100% rename from external/hypre/src/test/TEST_sstruct/wide.saved.ray rename to external/hypre/src/test/TEST_sstruct/wide.saved.lassen_cpu diff --git a/external/hypre/src/test/TEST_sstruct/wide.sh b/external/hypre/src/test/TEST_sstruct/wide.sh old mode 100644 new mode 100755 index f74cde93..888f2386 --- a/external/hypre/src/test/TEST_sstruct/wide.sh +++ b/external/hypre/src/test/TEST_sstruct/wide.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/zcube.jobs b/external/hypre/src/test/TEST_sstruct/zcube.jobs old mode 100644 new mode 100755 index b0b55936..1110b231 --- a/external/hypre/src/test/TEST_sstruct/zcube.jobs +++ b/external/hypre/src/test/TEST_sstruct/zcube.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/zcube.saved.ray b/external/hypre/src/test/TEST_sstruct/zcube.saved.lassen_cpu similarity index 100% rename from external/hypre/src/test/TEST_sstruct/zcube.saved.ray rename to external/hypre/src/test/TEST_sstruct/zcube.saved.lassen_cpu diff --git a/external/hypre/src/test/TEST_sstruct/zcube.sh b/external/hypre/src/test/TEST_sstruct/zcube.sh old mode 100644 new mode 100755 index 066009aa..9c14fcd1 --- a/external/hypre/src/test/TEST_sstruct/zcube.sh +++ b/external/hypre/src/test/TEST_sstruct/zcube.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/zsstruct.in.bcube b/external/hypre/src/test/TEST_sstruct/zsstruct.in.bcube index d4f7e268..5e93bda3 100644 --- a/external/hypre/src/test/TEST_sstruct/zsstruct.in.bcube +++ b/external/hypre/src/test/TEST_sstruct/zsstruct.in.bcube @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_sstruct/zsstruct.in.cube b/external/hypre/src/test/TEST_sstruct/zsstruct.in.cube index e08030a6..7d5870cb 100644 --- a/external/hypre/src/test/TEST_sstruct/zsstruct.in.cube +++ b/external/hypre/src/test/TEST_sstruct/zsstruct.in.cube @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/cgpfmg3d.jobs b/external/hypre/src/test/TEST_struct/cgpfmg3d.jobs old mode 100644 new mode 100755 index 8eef3ba1..ec14d94f --- a/external/hypre/src/test/TEST_struct/cgpfmg3d.jobs +++ b/external/hypre/src/test/TEST_struct/cgpfmg3d.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/cgpfmg3d.saved.ray b/external/hypre/src/test/TEST_struct/cgpfmg3d.saved.florentia similarity index 100% rename from external/hypre/src/test/TEST_struct/cgpfmg3d.saved.ray rename to external/hypre/src/test/TEST_struct/cgpfmg3d.saved.florentia diff --git a/external/hypre/src/test/TEST_struct/cgpfmg3d.saved.lassen_cpu b/external/hypre/src/test/TEST_struct/cgpfmg3d.saved.lassen_cpu new file mode 100644 index 00000000..08802877 --- /dev/null +++ b/external/hypre/src/test/TEST_struct/cgpfmg3d.saved.lassen_cpu @@ -0,0 +1,8 @@ +# Output file: cgpfmg3d.out.0 +Iterations = 9 +Final Relative Residual Norm = 4.287624e-07 + +# Output file: cgpfmg3d.out.1 +Iterations = 9 +Final Relative Residual Norm = 4.287624e-07 + diff --git a/external/hypre/src/test/TEST_struct/cgpfmg3d.saved.tioga b/external/hypre/src/test/TEST_struct/cgpfmg3d.saved.tioga new file mode 100644 index 00000000..08802877 --- /dev/null +++ b/external/hypre/src/test/TEST_struct/cgpfmg3d.saved.tioga @@ -0,0 +1,8 @@ +# Output file: cgpfmg3d.out.0 +Iterations = 9 +Final Relative Residual Norm = 4.287624e-07 + +# Output file: cgpfmg3d.out.1 +Iterations = 9 +Final Relative Residual Norm = 4.287624e-07 + diff --git a/external/hypre/src/test/TEST_struct/cgpfmg3d.sh b/external/hypre/src/test/TEST_struct/cgpfmg3d.sh old mode 100644 new mode 100755 index eebefa3c..36908e3b --- a/external/hypre/src/test/TEST_struct/cgpfmg3d.sh +++ b/external/hypre/src/test/TEST_struct/cgpfmg3d.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/emptyproc.jobs b/external/hypre/src/test/TEST_struct/emptyproc.jobs old mode 100644 new mode 100755 index 9a07af93..6321e7c8 --- a/external/hypre/src/test/TEST_struct/emptyproc.jobs +++ b/external/hypre/src/test/TEST_struct/emptyproc.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/emptyproc.saved.ray b/external/hypre/src/test/TEST_struct/emptyproc.saved.florentia similarity index 100% rename from external/hypre/src/test/TEST_struct/emptyproc.saved.ray rename to external/hypre/src/test/TEST_struct/emptyproc.saved.florentia diff --git a/external/hypre/src/test/TEST_struct/emptyproc.saved.lassen_cpu b/external/hypre/src/test/TEST_struct/emptyproc.saved.lassen_cpu new file mode 100644 index 00000000..4d3786f5 --- /dev/null +++ b/external/hypre/src/test/TEST_struct/emptyproc.saved.lassen_cpu @@ -0,0 +1,68 @@ +# Output file: emptyproc.out.00a +Iterations = 6 +Final Relative Residual Norm = 1.883632e-07 + +# Output file: emptyproc.out.01a +Iterations = 16 +Final Relative Residual Norm = 5.557193e-07 + +# Output file: emptyproc.out.01b +Iterations = 17 +Final Relative Residual Norm = 6.926794e-07 + +# Output file: emptyproc.out.03a +Iterations = 23 +Final Relative Residual Norm = 9.157321e-07 + +# Output file: emptyproc.out.03b +Iterations = 20 +Final Relative Residual Norm = 6.594761e-07 + +# Output file: emptyproc.out.04a +Iterations = 15 +Final Relative Residual Norm = 9.712834e-07 + +# Output file: emptyproc.out.04b +Iterations = 15 +Final Relative Residual Norm = 9.646051e-07 + +# Output file: emptyproc.out.11a +Iterations = 8 +Final Relative Residual Norm = 9.301342e-07 + +# Output file: emptyproc.out.13a +Iterations = 11 +Final Relative Residual Norm = 3.054686e-07 + +# Output file: emptyproc.out.14a +Iterations = 8 +Final Relative Residual Norm = 6.561630e-07 + +# Output file: emptyproc.out.17a +Iterations = 20 +Final Relative Residual Norm = 6.766509e-07 + +# Output file: emptyproc.out.18a +Iterations = 42 +Final Relative Residual Norm = 7.820632e-07 + +# Output file: emptyproc.out.21a +Iterations = 11 +Final Relative Residual Norm = 5.851154e-07 + +# Output file: emptyproc.out.31a +Iterations = 9 +Final Relative Residual Norm = 1.848351e-07 + +# Output file: emptyproc.out.41a +Iterations = 5 +Final Relative Residual Norm = 1.853522e-07 + +# Output file: emptyproc.out.51a +Iterations = 9 +Final Relative Residual Norm = 1.848351e-07 + +# Output file: emptyproc.out.61a +Iterations = 9 +Final Relative Residual Norm = 1.848351e-07 + diff --git a/external/hypre/src/test/TEST_struct/emptyproc.saved.tioga b/external/hypre/src/test/TEST_struct/emptyproc.saved.tioga new file mode 100644 index 00000000..4d3786f5 --- /dev/null +++ b/external/hypre/src/test/TEST_struct/emptyproc.saved.tioga @@ -0,0 +1,68 @@ +# Output file: emptyproc.out.00a +Iterations = 6 +Final Relative Residual Norm = 1.883632e-07 + +# Output file: emptyproc.out.01a +Iterations = 16 +Final Relative Residual Norm = 5.557193e-07 + +# Output file: emptyproc.out.01b +Iterations = 17 +Final Relative Residual Norm = 6.926794e-07 + +# Output file: emptyproc.out.03a +Iterations = 23 +Final Relative Residual Norm = 9.157321e-07 + +# Output file: emptyproc.out.03b +Iterations = 20 +Final Relative Residual Norm = 6.594761e-07 + +# Output file: emptyproc.out.04a +Iterations = 15 +Final Relative Residual Norm = 9.712834e-07 + +# Output file: emptyproc.out.04b +Iterations = 15 +Final Relative Residual Norm = 9.646051e-07 + +# Output file: emptyproc.out.11a +Iterations = 8 +Final Relative Residual Norm = 9.301342e-07 + +# Output file: emptyproc.out.13a +Iterations = 11 +Final Relative Residual Norm = 3.054686e-07 + +# Output file: emptyproc.out.14a +Iterations = 8 +Final Relative Residual Norm = 6.561630e-07 + +# Output file: emptyproc.out.17a +Iterations = 20 +Final Relative Residual Norm = 6.766509e-07 + +# Output file: emptyproc.out.18a +Iterations = 42 +Final Relative Residual Norm = 7.820632e-07 + +# Output file: emptyproc.out.21a +Iterations = 11 +Final Relative Residual Norm = 5.851154e-07 + +# Output file: emptyproc.out.31a +Iterations = 9 +Final Relative Residual Norm = 1.848351e-07 + +# Output file: emptyproc.out.41a +Iterations = 5 +Final Relative Residual Norm = 1.853522e-07 + +# Output file: emptyproc.out.51a +Iterations = 9 +Final Relative Residual Norm = 1.848351e-07 + +# Output file: emptyproc.out.61a +Iterations = 9 +Final Relative Residual Norm = 1.848351e-07 + diff --git a/external/hypre/src/test/TEST_struct/emptyproc.sh b/external/hypre/src/test/TEST_struct/emptyproc.sh old mode 100644 new mode 100755 index 4b8d23cf..8dbfe0a3 --- a/external/hypre/src/test/TEST_struct/emptyproc.sh +++ b/external/hypre/src/test/TEST_struct/emptyproc.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/hybrid.jobs b/external/hypre/src/test/TEST_struct/hybrid.jobs old mode 100644 new mode 100755 index 42f6ad5a..7391e0dd --- a/external/hypre/src/test/TEST_struct/hybrid.jobs +++ b/external/hypre/src/test/TEST_struct/hybrid.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/hybrid.saved.ray b/external/hypre/src/test/TEST_struct/hybrid.saved.florentia similarity index 100% rename from external/hypre/src/test/TEST_struct/hybrid.saved.ray rename to external/hypre/src/test/TEST_struct/hybrid.saved.florentia diff --git a/external/hypre/src/test/TEST_struct/hybrid.saved.lassen_cpu b/external/hypre/src/test/TEST_struct/hybrid.saved.lassen_cpu new file mode 100644 index 00000000..5054c85e --- /dev/null +++ b/external/hypre/src/test/TEST_struct/hybrid.saved.lassen_cpu @@ -0,0 +1,20 @@ +# Output file: hybrid.out.0 +Iterations = 20 +Final Relative Residual Norm = 5.962015e-07 + +# Output file: hybrid.out.1 +Iterations = 20 +Final Relative Residual Norm = 5.962015e-07 + +# Output file: hybrid.out.2 +Iterations = 20 +Final Relative Residual Norm = 5.962015e-07 + +# Output file: hybrid.out.3 +Iterations = 6 +Final Relative Residual Norm = 1.175679e-07 + +# Output file: hybrid.out.4 +Iterations = 10 +Final Relative Residual Norm = 3.092333e-07 + diff --git a/external/hypre/src/test/TEST_struct/hybrid.saved.tioga b/external/hypre/src/test/TEST_struct/hybrid.saved.tioga new file mode 100644 index 00000000..5054c85e --- /dev/null +++ b/external/hypre/src/test/TEST_struct/hybrid.saved.tioga @@ -0,0 +1,20 @@ +# Output file: hybrid.out.0 +Iterations = 20 +Final Relative Residual Norm = 5.962015e-07 + +# Output file: hybrid.out.1 +Iterations = 20 +Final Relative Residual Norm = 5.962015e-07 + +# Output file: hybrid.out.2 +Iterations = 20 +Final Relative Residual Norm = 5.962015e-07 + +# Output file: hybrid.out.3 +Iterations = 6 +Final Relative Residual Norm = 1.175679e-07 + +# Output file: hybrid.out.4 +Iterations = 10 +Final Relative Residual Norm = 3.092333e-07 + diff --git a/external/hypre/src/test/TEST_struct/hybrid.sh b/external/hypre/src/test/TEST_struct/hybrid.sh old mode 100644 new mode 100755 index d7af8d3e..f5961473 --- a/external/hypre/src/test/TEST_struct/hybrid.sh +++ b/external/hypre/src/test/TEST_struct/hybrid.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/hybridswitch.jobs b/external/hypre/src/test/TEST_struct/hybridswitch.jobs old mode 100644 new mode 100755 index 8f81fa64..b5f085e6 --- a/external/hypre/src/test/TEST_struct/hybridswitch.jobs +++ b/external/hypre/src/test/TEST_struct/hybridswitch.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/hybridswitch.saved.ray b/external/hypre/src/test/TEST_struct/hybridswitch.saved.florentia similarity index 100% rename from external/hypre/src/test/TEST_struct/hybridswitch.saved.ray rename to external/hypre/src/test/TEST_struct/hybridswitch.saved.florentia diff --git a/external/hypre/src/test/TEST_struct/hybridswitch.saved.lassen_cpu b/external/hypre/src/test/TEST_struct/hybridswitch.saved.lassen_cpu new file mode 100644 index 00000000..c5ef6e03 --- /dev/null +++ b/external/hypre/src/test/TEST_struct/hybridswitch.saved.lassen_cpu @@ -0,0 +1,32 @@ +# Output file: hybridswitch.out.0 +Iterations = 6 +Final Relative Residual Norm = 8.777304e-07 + +# Output file: hybridswitch.out.1 +Iterations = 11 +Final Relative Residual Norm = 4.303572e-07 + +# Output file: hybridswitch.out.2 +Iterations = 6 +Final Relative Residual Norm = 8.777304e-07 + +# Output file: hybridswitch.out.3 +Iterations = 4 +Final Relative Residual Norm = 7.591871e-07 + +# Output file: hybridswitch.out.4 +Iterations = 8 +Final Relative Residual Norm = 7.771813e-07 + +# Output file: hybridswitch.out.5 +Iterations = 36 +Final Relative Residual Norm = 9.833457e-07 + +# Output file: hybridswitch.out.6 +Iterations = 64 +Final Relative Residual Norm = 9.962554e-07 + +# Output file: hybridswitch.out.7 +Iterations = 64 +Final Relative Residual Norm = 9.962554e-07 + diff --git a/external/hypre/src/test/TEST_struct/hybridswitch.saved.tioga b/external/hypre/src/test/TEST_struct/hybridswitch.saved.tioga new file mode 100644 index 00000000..c5ef6e03 --- /dev/null +++ b/external/hypre/src/test/TEST_struct/hybridswitch.saved.tioga @@ -0,0 +1,32 @@ +# Output file: hybridswitch.out.0 +Iterations = 6 +Final Relative Residual Norm = 8.777304e-07 + +# Output file: hybridswitch.out.1 +Iterations = 11 +Final Relative Residual Norm = 4.303572e-07 + +# Output file: hybridswitch.out.2 +Iterations = 6 +Final Relative Residual Norm = 8.777304e-07 + +# Output file: hybridswitch.out.3 +Iterations = 4 +Final Relative Residual Norm = 7.591871e-07 + +# Output file: hybridswitch.out.4 +Iterations = 8 +Final Relative Residual Norm = 7.771813e-07 + +# Output file: hybridswitch.out.5 +Iterations = 36 +Final Relative Residual Norm = 9.833457e-07 + +# Output file: hybridswitch.out.6 +Iterations = 64 +Final Relative Residual Norm = 9.962554e-07 + +# Output file: hybridswitch.out.7 +Iterations = 64 +Final Relative Residual Norm = 9.962554e-07 + diff --git a/external/hypre/src/test/TEST_struct/hybridswitch.sh b/external/hypre/src/test/TEST_struct/hybridswitch.sh old mode 100644 new mode 100755 index c1776789..0bc8c3e6 --- a/external/hypre/src/test/TEST_struct/hybridswitch.sh +++ b/external/hypre/src/test/TEST_struct/hybridswitch.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/lazy.jobs b/external/hypre/src/test/TEST_struct/lazy.jobs new file mode 100644 index 00000000..6a161c7b --- /dev/null +++ b/external/hypre/src/test/TEST_struct/lazy.jobs @@ -0,0 +1,16 @@ +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +#============================================================================= +# Test library lazy initialization (sequential and parallel) +#============================================================================= + +mpirun -np 1 ./struct > lazy.out.1.a +mpirun -np 1 ./struct -lazy_device_init 1 > lazy.out.1.b + +mpirun -np 4 ./struct > lazy.out.2.a +mpirun -np 4 ./struct -lazy_device_init 1 > lazy.out.2.b + diff --git a/external/hypre/src/test/TEST_struct/lazy.sh b/external/hypre/src/test/TEST_struct/lazy.sh new file mode 100755 index 00000000..12571909 --- /dev/null +++ b/external/hypre/src/test/TEST_struct/lazy.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +TNAME=`basename $0 .sh` + +tail -3 ${TNAME}.out.1.a | head -2 > ${TNAME}.testdata +tail -3 ${TNAME}.out.1.b | head -2 > ${TNAME}.testdata.temp +diff ${TNAME}.testdata ${TNAME}.testdata.temp >&2 + +tail -3 ${TNAME}.out.2.a | head -2 > ${TNAME}.testdata +tail -3 ${TNAME}.out.2.b | head -2 > ${TNAME}.testdata.temp +diff ${TNAME}.testdata ${TNAME}.testdata.temp >&2 + +#============================================================================= +# remove temporary files +#============================================================================= + +rm -f ${TNAME}.testdata* diff --git a/external/hypre/src/test/TEST_struct/migrate.jobs b/external/hypre/src/test/TEST_struct/migrate.jobs old mode 100644 new mode 100755 index ffca19e1..e44ab387 --- a/external/hypre/src/test/TEST_struct/migrate.jobs +++ b/external/hypre/src/test/TEST_struct/migrate.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/migrate.saved.ray b/external/hypre/src/test/TEST_struct/migrate.saved.florentia similarity index 100% rename from external/hypre/src/test/TEST_struct/migrate.saved.ray rename to external/hypre/src/test/TEST_struct/migrate.saved.florentia diff --git a/external/hypre/src/test/TEST_struct/migrate.saved.lassen_cpu b/external/hypre/src/test/TEST_struct/migrate.saved.lassen_cpu new file mode 100644 index 00000000..c913c5fc --- /dev/null +++ b/external/hypre/src/test/TEST_struct/migrate.saved.lassen_cpu @@ -0,0 +1,27 @@ +# Output file: migrate.out.10 +Check = 0 (success = 0) + +# Output file: migrate.out.11 +Check = 0 (success = 0) + +# Output file: migrate.out.12 +Check = 0 (success = 0) + +# Output file: migrate.out.20 +Check = 0 (success = 0) + +# Output file: migrate.out.21 +Check = 0 (success = 0) + +# Output file: migrate.out.22 +Check = 0 (success = 0) + +# Output file: migrate.out.30 +Check = 0 (success = 0) + +# Output file: migrate.out.31 +Check = 0 (success = 0) + +# Output file: migrate.out.32 +Check = 0 (success = 0) + diff --git a/external/hypre/src/test/TEST_struct/migrate.saved.tioga b/external/hypre/src/test/TEST_struct/migrate.saved.tioga new file mode 100644 index 00000000..c913c5fc --- /dev/null +++ b/external/hypre/src/test/TEST_struct/migrate.saved.tioga @@ -0,0 +1,27 @@ +# Output file: migrate.out.10 +Check = 0 (success = 0) + +# Output file: migrate.out.11 +Check = 0 (success = 0) + +# Output file: migrate.out.12 +Check = 0 (success = 0) + +# Output file: migrate.out.20 +Check = 0 (success = 0) + +# Output file: migrate.out.21 +Check = 0 (success = 0) + +# Output file: migrate.out.22 +Check = 0 (success = 0) + +# Output file: migrate.out.30 +Check = 0 (success = 0) + +# Output file: migrate.out.31 +Check = 0 (success = 0) + +# Output file: migrate.out.32 +Check = 0 (success = 0) + diff --git a/external/hypre/src/test/TEST_struct/migrate.sh b/external/hypre/src/test/TEST_struct/migrate.sh old mode 100644 new mode 100755 index 84c6b164..0474569c --- a/external/hypre/src/test/TEST_struct/migrate.sh +++ b/external/hypre/src/test/TEST_struct/migrate.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/parflow.jobs b/external/hypre/src/test/TEST_struct/parflow.jobs old mode 100644 new mode 100755 index ac66797f..2fec62c4 --- a/external/hypre/src/test/TEST_struct/parflow.jobs +++ b/external/hypre/src/test/TEST_struct/parflow.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/parflow.saved.ray b/external/hypre/src/test/TEST_struct/parflow.saved.florentia similarity index 100% rename from external/hypre/src/test/TEST_struct/parflow.saved.ray rename to external/hypre/src/test/TEST_struct/parflow.saved.florentia diff --git a/external/hypre/src/test/TEST_struct/parflow.saved.lassen_cpu b/external/hypre/src/test/TEST_struct/parflow.saved.lassen_cpu new file mode 100644 index 00000000..c3946d0d --- /dev/null +++ b/external/hypre/src/test/TEST_struct/parflow.saved.lassen_cpu @@ -0,0 +1,24 @@ +# Output file: parflow.out.0 +Iterations = 10 +Final Relative Residual Norm = 8.112584e-07 + +# Output file: parflow.out.1 +Iterations = 10 +Final Relative Residual Norm = 8.112584e-07 + +# Output file: parflow.out.2 +Iterations = 10 +Final Relative Residual Norm = 8.112584e-07 + +# Output file: parflow.out.3 +Iterations = 15 +Final Relative Residual Norm = 9.466307e-07 + +# Output file: parflow.out.4 +Iterations = 15 +Final Relative Residual Norm = 9.466307e-07 + +# Output file: parflow.out.5 +Iterations = 15 +Final Relative Residual Norm = 9.466307e-07 + diff --git a/external/hypre/src/test/TEST_struct/parflow.saved.tioga b/external/hypre/src/test/TEST_struct/parflow.saved.tioga new file mode 100644 index 00000000..c3946d0d --- /dev/null +++ b/external/hypre/src/test/TEST_struct/parflow.saved.tioga @@ -0,0 +1,24 @@ +# Output file: parflow.out.0 +Iterations = 10 +Final Relative Residual Norm = 8.112584e-07 + +# Output file: parflow.out.1 +Iterations = 10 +Final Relative Residual Norm = 8.112584e-07 + +# Output file: parflow.out.2 +Iterations = 10 +Final Relative Residual Norm = 8.112584e-07 + +# Output file: parflow.out.3 +Iterations = 15 +Final Relative Residual Norm = 9.466307e-07 + +# Output file: parflow.out.4 +Iterations = 15 +Final Relative Residual Norm = 9.466307e-07 + +# Output file: parflow.out.5 +Iterations = 15 +Final Relative Residual Norm = 9.466307e-07 + diff --git a/external/hypre/src/test/TEST_struct/parflow.sh b/external/hypre/src/test/TEST_struct/parflow.sh old mode 100644 new mode 100755 index 58d2c235..4a5527e3 --- a/external/hypre/src/test/TEST_struct/parflow.sh +++ b/external/hypre/src/test/TEST_struct/parflow.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/periodic.jobs b/external/hypre/src/test/TEST_struct/periodic.jobs old mode 100644 new mode 100755 index 6bc02581..6aedb579 --- a/external/hypre/src/test/TEST_struct/periodic.jobs +++ b/external/hypre/src/test/TEST_struct/periodic.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/periodic.saved.florentia b/external/hypre/src/test/TEST_struct/periodic.saved.florentia new file mode 100644 index 00000000..98abb67a --- /dev/null +++ b/external/hypre/src/test/TEST_struct/periodic.saved.florentia @@ -0,0 +1,67 @@ +# Output file: periodic.out.10 +Iterations = 16 +Final Relative Residual Norm = 5.765014e-07 + +# Output file: periodic.out.11 +Iterations = 16 +Final Relative Residual Norm = 5.765014e-07 + +# Output file: periodic.out.12 +Iterations = 16 +Final Relative Residual Norm = 5.765014e-07 + +# Output file: periodic.out.13 +Iterations = 16 +Final Relative Residual Norm = 5.765014e-07 + +# Output file: periodic.out.20 +Iterations = 23 +Final Relative Residual Norm = 6.111317e-07 + +# Output file: periodic.out.21 +Iterations = 23 +Final Relative Residual Norm = 6.111317e-07 + +# Output file: periodic.out.30 +Iterations = 21 +Final Relative Residual Norm = 4.973134e-07 + +# Output file: periodic.out.31 +Iterations = 21 +Final Relative Residual Norm = 4.973134e-07 + +# Output file: periodic.out.32 +Iterations = 21 +Final Relative Residual Norm = 4.973134e-07 + +# Output file: periodic.out.33 +Iterations = 21 +Final Relative Residual Norm = 4.973134e-07 + +# Output file: periodic.out.40 +Iterations = 43 +Final Relative Residual Norm = 8.515463e-07 + +# Output file: periodic.out.41 +Iterations = 43 +Final Relative Residual Norm = 8.515463e-07 + +# Output file: periodic.out.50 +Iterations = 7 +Final Relative Residual Norm = 3.701014e-07 + +# Output file: periodic.out.51 +Iterations = 7 +Final Relative Residual Norm = 3.701014e-07 + +# Output file: periodic.out.52 +Iterations = 7 +Final Relative Residual Norm = 3.701014e-07 + +# Output file: periodic.out.53 +Iterations = 7 +Final Relative Residual Norm = 3.701014e-07 + +# Output file: periodic.out.60 +Iterations = 10 +Final Relative Residual Norm = 1.565392e-07 diff --git a/external/hypre/src/test/TEST_struct/periodic.saved.ray b/external/hypre/src/test/TEST_struct/periodic.saved.lassen_cpu similarity index 100% rename from external/hypre/src/test/TEST_struct/periodic.saved.ray rename to external/hypre/src/test/TEST_struct/periodic.saved.lassen_cpu diff --git a/external/hypre/src/test/TEST_struct/periodic.saved.tioga b/external/hypre/src/test/TEST_struct/periodic.saved.tioga new file mode 100644 index 00000000..7873f992 --- /dev/null +++ b/external/hypre/src/test/TEST_struct/periodic.saved.tioga @@ -0,0 +1,68 @@ +# Output file: periodic.out.10 +Iterations = 16 +Final Relative Residual Norm = 5.765014e-07 + +# Output file: periodic.out.11 +Iterations = 16 +Final Relative Residual Norm = 5.765014e-07 + +# Output file: periodic.out.12 +Iterations = 16 +Final Relative Residual Norm = 5.765014e-07 + +# Output file: periodic.out.13 +Iterations = 16 +Final Relative Residual Norm = 5.765014e-07 + +# Output file: periodic.out.20 +Iterations = 23 +Final Relative Residual Norm = 6.111317e-07 + +# Output file: periodic.out.21 +Iterations = 23 +Final Relative Residual Norm = 6.111317e-07 + +# Output file: periodic.out.30 +Iterations = 21 +Final Relative Residual Norm = 4.973134e-07 + +# Output file: periodic.out.31 +Iterations = 21 +Final Relative Residual Norm = 4.973134e-07 + +# Output file: periodic.out.32 +Iterations = 21 +Final Relative Residual Norm = 4.973134e-07 + +# Output file: periodic.out.33 +Iterations = 21 +Final Relative Residual Norm = 4.973134e-07 + +# Output file: periodic.out.40 +Iterations = 43 +Final Relative Residual Norm = 8.515463e-07 + +# Output file: periodic.out.41 +Iterations = 43 +Final Relative Residual Norm = 8.515463e-07 + +# Output file: periodic.out.50 +Iterations = 7 +Final Relative Residual Norm = 3.701014e-07 + +# Output file: periodic.out.51 +Iterations = 7 +Final Relative Residual Norm = 3.701014e-07 + +# Output file: periodic.out.52 +Iterations = 7 +Final Relative Residual Norm = 3.701014e-07 + +# Output file: periodic.out.53 +Iterations = 7 +Final Relative Residual Norm = 3.701014e-07 + +# Output file: periodic.out.60 +Iterations = 10 +Final Relative Residual Norm = 1.565392e-07 + diff --git a/external/hypre/src/test/TEST_struct/periodic.sh b/external/hypre/src/test/TEST_struct/periodic.sh old mode 100644 new mode 100755 index c5b217ff..cc0eb18d --- a/external/hypre/src/test/TEST_struct/periodic.sh +++ b/external/hypre/src/test/TEST_struct/periodic.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/pfmgbase1d.jobs b/external/hypre/src/test/TEST_struct/pfmgbase1d.jobs old mode 100644 new mode 100755 index 2334b896..3d362466 --- a/external/hypre/src/test/TEST_struct/pfmgbase1d.jobs +++ b/external/hypre/src/test/TEST_struct/pfmgbase1d.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/pfmgbase1d.saved.ray b/external/hypre/src/test/TEST_struct/pfmgbase1d.saved.florentia similarity index 100% rename from external/hypre/src/test/TEST_struct/pfmgbase1d.saved.ray rename to external/hypre/src/test/TEST_struct/pfmgbase1d.saved.florentia diff --git a/external/hypre/src/test/TEST_struct/pfmgbase1d.saved.lassen_cpu b/external/hypre/src/test/TEST_struct/pfmgbase1d.saved.lassen_cpu new file mode 100644 index 00000000..af3f57c4 --- /dev/null +++ b/external/hypre/src/test/TEST_struct/pfmgbase1d.saved.lassen_cpu @@ -0,0 +1,8 @@ +# Output file: pfmgbase1d.out.0 +Iterations = 9 +Final Relative Residual Norm = 2.021867e-07 + +# Output file: pfmgbase1d.out.1 +Iterations = 9 +Final Relative Residual Norm = 2.021867e-07 + diff --git a/external/hypre/src/test/TEST_struct/pfmgbase1d.saved.tioga b/external/hypre/src/test/TEST_struct/pfmgbase1d.saved.tioga new file mode 100644 index 00000000..af3f57c4 --- /dev/null +++ b/external/hypre/src/test/TEST_struct/pfmgbase1d.saved.tioga @@ -0,0 +1,8 @@ +# Output file: pfmgbase1d.out.0 +Iterations = 9 +Final Relative Residual Norm = 2.021867e-07 + +# Output file: pfmgbase1d.out.1 +Iterations = 9 +Final Relative Residual Norm = 2.021867e-07 + diff --git a/external/hypre/src/test/TEST_struct/pfmgbase1d.sh b/external/hypre/src/test/TEST_struct/pfmgbase1d.sh old mode 100644 new mode 100755 index f8e18dd2..2ca0d05b --- a/external/hypre/src/test/TEST_struct/pfmgbase1d.sh +++ b/external/hypre/src/test/TEST_struct/pfmgbase1d.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/pfmgbase2d.jobs b/external/hypre/src/test/TEST_struct/pfmgbase2d.jobs old mode 100644 new mode 100755 index 68c158e1..072f0a28 --- a/external/hypre/src/test/TEST_struct/pfmgbase2d.jobs +++ b/external/hypre/src/test/TEST_struct/pfmgbase2d.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/pfmgbase2d.saved.ray b/external/hypre/src/test/TEST_struct/pfmgbase2d.saved.florentia similarity index 100% rename from external/hypre/src/test/TEST_struct/pfmgbase2d.saved.ray rename to external/hypre/src/test/TEST_struct/pfmgbase2d.saved.florentia diff --git a/external/hypre/src/test/TEST_struct/pfmgbase2d.saved.lassen_cpu b/external/hypre/src/test/TEST_struct/pfmgbase2d.saved.lassen_cpu new file mode 100644 index 00000000..e4b1c547 --- /dev/null +++ b/external/hypre/src/test/TEST_struct/pfmgbase2d.saved.lassen_cpu @@ -0,0 +1,24 @@ +# Output file: pfmgbase2d.out.0 +Iterations = 13 +Final Relative Residual Norm = 3.655647e-07 + +# Output file: pfmgbase2d.out.1 +Iterations = 13 +Final Relative Residual Norm = 3.655647e-07 + +# Output file: pfmgbase2d.out.2 +Iterations = 13 +Final Relative Residual Norm = 3.655647e-07 + +# Output file: pfmgbase2d.out.3 +Iterations = 13 +Final Relative Residual Norm = 3.655647e-07 + +# Output file: pfmgbase2d.out.4 +Iterations = 13 +Final Relative Residual Norm = 3.655647e-07 + +# Output file: pfmgbase2d.out.5 +Iterations = 13 +Final Relative Residual Norm = 3.655647e-07 + diff --git a/external/hypre/src/test/TEST_struct/pfmgbase2d.saved.tioga b/external/hypre/src/test/TEST_struct/pfmgbase2d.saved.tioga new file mode 100644 index 00000000..e4b1c547 --- /dev/null +++ b/external/hypre/src/test/TEST_struct/pfmgbase2d.saved.tioga @@ -0,0 +1,24 @@ +# Output file: pfmgbase2d.out.0 +Iterations = 13 +Final Relative Residual Norm = 3.655647e-07 + +# Output file: pfmgbase2d.out.1 +Iterations = 13 +Final Relative Residual Norm = 3.655647e-07 + +# Output file: pfmgbase2d.out.2 +Iterations = 13 +Final Relative Residual Norm = 3.655647e-07 + +# Output file: pfmgbase2d.out.3 +Iterations = 13 +Final Relative Residual Norm = 3.655647e-07 + +# Output file: pfmgbase2d.out.4 +Iterations = 13 +Final Relative Residual Norm = 3.655647e-07 + +# Output file: pfmgbase2d.out.5 +Iterations = 13 +Final Relative Residual Norm = 3.655647e-07 + diff --git a/external/hypre/src/test/TEST_struct/pfmgbase2d.sh b/external/hypre/src/test/TEST_struct/pfmgbase2d.sh old mode 100644 new mode 100755 index a2d36b3c..8457c7ad --- a/external/hypre/src/test/TEST_struct/pfmgbase2d.sh +++ b/external/hypre/src/test/TEST_struct/pfmgbase2d.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/pfmgbase3d.jobs b/external/hypre/src/test/TEST_struct/pfmgbase3d.jobs old mode 100644 new mode 100755 index d82bdfa7..207721ea --- a/external/hypre/src/test/TEST_struct/pfmgbase3d.jobs +++ b/external/hypre/src/test/TEST_struct/pfmgbase3d.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/pfmgbase3d.saved.ray b/external/hypre/src/test/TEST_struct/pfmgbase3d.saved.florentia similarity index 100% rename from external/hypre/src/test/TEST_struct/pfmgbase3d.saved.ray rename to external/hypre/src/test/TEST_struct/pfmgbase3d.saved.florentia diff --git a/external/hypre/src/test/TEST_struct/pfmgbase3d.saved.lassen_cpu b/external/hypre/src/test/TEST_struct/pfmgbase3d.saved.lassen_cpu new file mode 100644 index 00000000..7d0a285c --- /dev/null +++ b/external/hypre/src/test/TEST_struct/pfmgbase3d.saved.lassen_cpu @@ -0,0 +1,32 @@ +# Output file: pfmgbase3d.out.0 +Iterations = 10 +Final Relative Residual Norm = 3.298941e-07 + +# Output file: pfmgbase3d.out.1 +Iterations = 10 +Final Relative Residual Norm = 3.298941e-07 + +# Output file: pfmgbase3d.out.2 +Iterations = 10 +Final Relative Residual Norm = 3.298941e-07 + +# Output file: pfmgbase3d.out.3 +Iterations = 10 +Final Relative Residual Norm = 3.298941e-07 + +# Output file: pfmgbase3d.out.4 +Iterations = 10 +Final Relative Residual Norm = 3.298941e-07 + +# Output file: pfmgbase3d.out.5 +Iterations = 10 +Final Relative Residual Norm = 3.298941e-07 + +# Output file: pfmgbase3d.out.6 +Iterations = 10 +Final Relative Residual Norm = 3.298941e-07 + +# Output file: pfmgbase3d.out.7 +Iterations = 10 +Final Relative Residual Norm = 3.298941e-07 + diff --git a/external/hypre/src/test/TEST_struct/pfmgbase3d.saved.tioga b/external/hypre/src/test/TEST_struct/pfmgbase3d.saved.tioga new file mode 100644 index 00000000..7d0a285c --- /dev/null +++ b/external/hypre/src/test/TEST_struct/pfmgbase3d.saved.tioga @@ -0,0 +1,32 @@ +# Output file: pfmgbase3d.out.0 +Iterations = 10 +Final Relative Residual Norm = 3.298941e-07 + +# Output file: pfmgbase3d.out.1 +Iterations = 10 +Final Relative Residual Norm = 3.298941e-07 + +# Output file: pfmgbase3d.out.2 +Iterations = 10 +Final Relative Residual Norm = 3.298941e-07 + +# Output file: pfmgbase3d.out.3 +Iterations = 10 +Final Relative Residual Norm = 3.298941e-07 + +# Output file: pfmgbase3d.out.4 +Iterations = 10 +Final Relative Residual Norm = 3.298941e-07 + +# Output file: pfmgbase3d.out.5 +Iterations = 10 +Final Relative Residual Norm = 3.298941e-07 + +# Output file: pfmgbase3d.out.6 +Iterations = 10 +Final Relative Residual Norm = 3.298941e-07 + +# Output file: pfmgbase3d.out.7 +Iterations = 10 +Final Relative Residual Norm = 3.298941e-07 + diff --git a/external/hypre/src/test/TEST_struct/pfmgbase3d.sh b/external/hypre/src/test/TEST_struct/pfmgbase3d.sh old mode 100644 new mode 100755 index cbc74df8..96f99a52 --- a/external/hypre/src/test/TEST_struct/pfmgbase3d.sh +++ b/external/hypre/src/test/TEST_struct/pfmgbase3d.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/pfmgconstcoeffmp.jobs b/external/hypre/src/test/TEST_struct/pfmgconstcoeffmp.jobs old mode 100644 new mode 100755 index ba523c6e..e29ba34e --- a/external/hypre/src/test/TEST_struct/pfmgconstcoeffmp.jobs +++ b/external/hypre/src/test/TEST_struct/pfmgconstcoeffmp.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/pfmgconstcoeffmp.saved.ray b/external/hypre/src/test/TEST_struct/pfmgconstcoeffmp.saved.florentia similarity index 100% rename from external/hypre/src/test/TEST_struct/pfmgconstcoeffmp.saved.ray rename to external/hypre/src/test/TEST_struct/pfmgconstcoeffmp.saved.florentia diff --git a/external/hypre/src/test/TEST_struct/pfmgconstcoeffmp.saved.lassen_cpu b/external/hypre/src/test/TEST_struct/pfmgconstcoeffmp.saved.lassen_cpu new file mode 100644 index 00000000..15eade03 --- /dev/null +++ b/external/hypre/src/test/TEST_struct/pfmgconstcoeffmp.saved.lassen_cpu @@ -0,0 +1,80 @@ +# Output file: pfmgconstcoeffmp.out.10 +Iterations = 13 +Final Relative Residual Norm = 5.378609e-07 + +# Output file: pfmgconstcoeffmp.out.11 +Iterations = 13 +Final Relative Residual Norm = 5.378609e-07 + +# Output file: pfmgconstcoeffmp.out.12 +Iterations = 12 +Final Relative Residual Norm = 3.999260e-07 + +# Output file: pfmgconstcoeffmp.out.13 +Iterations = 12 +Final Relative Residual Norm = 3.999260e-07 + +# Output file: pfmgconstcoeffmp.out.20 +Iterations = 19 +Final Relative Residual Norm = 5.033356e-07 + +# Output file: pfmgconstcoeffmp.out.21 +Iterations = 19 +Final Relative Residual Norm = 5.033356e-07 + +# Output file: pfmgconstcoeffmp.out.22 +Iterations = 15 +Final Relative Residual Norm = 8.833880e-07 + +# Output file: pfmgconstcoeffmp.out.23 +Iterations = 15 +Final Relative Residual Norm = 8.833880e-07 + +# Output file: pfmgconstcoeffmp.out.30 +Iterations = 200 +Final Relative Residual Norm = 1.095973e+00 + +# Output file: pfmgconstcoeffmp.out.31 +Iterations = 200 +Final Relative Residual Norm = 1.095973e+00 + +# Output file: pfmgconstcoeffmp.out.32 +Iterations = 43 +Final Relative Residual Norm = 9.925149e-07 + +# Output file: pfmgconstcoeffmp.out.33 +Iterations = 43 +Final Relative Residual Norm = 9.925149e-07 + +# Output file: pfmgconstcoeffmp.out.34 +Iterations = 14 +Final Relative Residual Norm = 5.920399e-07 + +# Output file: pfmgconstcoeffmp.out.35 +Iterations = 14 +Final Relative Residual Norm = 5.920399e-07 + +# Output file: pfmgconstcoeffmp.out.40 +Iterations = 18 +Final Relative Residual Norm = 8.028630e-07 + +# Output file: pfmgconstcoeffmp.out.41 +Iterations = 18 +Final Relative Residual Norm = 8.028630e-07 + +# Output file: pfmgconstcoeffmp.out.42 +Iterations = 16 +Final Relative Residual Norm = 6.371573e-07 + +# Output file: pfmgconstcoeffmp.out.43 +Iterations = 16 +Final Relative Residual Norm = 6.371573e-07 + +# Output file: pfmgconstcoeffmp.out.44 +Iterations = 13 +Final Relative Residual Norm = 9.856117e-07 + +# Output file: pfmgconstcoeffmp.out.45 +Iterations = 13 +Final Relative Residual Norm = 9.856117e-07 + diff --git a/external/hypre/src/test/TEST_struct/pfmgconstcoeffmp.saved.tioga b/external/hypre/src/test/TEST_struct/pfmgconstcoeffmp.saved.tioga new file mode 100644 index 00000000..15eade03 --- /dev/null +++ b/external/hypre/src/test/TEST_struct/pfmgconstcoeffmp.saved.tioga @@ -0,0 +1,80 @@ +# Output file: pfmgconstcoeffmp.out.10 +Iterations = 13 +Final Relative Residual Norm = 5.378609e-07 + +# Output file: pfmgconstcoeffmp.out.11 +Iterations = 13 +Final Relative Residual Norm = 5.378609e-07 + +# Output file: pfmgconstcoeffmp.out.12 +Iterations = 12 +Final Relative Residual Norm = 3.999260e-07 + +# Output file: pfmgconstcoeffmp.out.13 +Iterations = 12 +Final Relative Residual Norm = 3.999260e-07 + +# Output file: pfmgconstcoeffmp.out.20 +Iterations = 19 +Final Relative Residual Norm = 5.033356e-07 + +# Output file: pfmgconstcoeffmp.out.21 +Iterations = 19 +Final Relative Residual Norm = 5.033356e-07 + +# Output file: pfmgconstcoeffmp.out.22 +Iterations = 15 +Final Relative Residual Norm = 8.833880e-07 + +# Output file: pfmgconstcoeffmp.out.23 +Iterations = 15 +Final Relative Residual Norm = 8.833880e-07 + +# Output file: pfmgconstcoeffmp.out.30 +Iterations = 200 +Final Relative Residual Norm = 1.095973e+00 + +# Output file: pfmgconstcoeffmp.out.31 +Iterations = 200 +Final Relative Residual Norm = 1.095973e+00 + +# Output file: pfmgconstcoeffmp.out.32 +Iterations = 43 +Final Relative Residual Norm = 9.925149e-07 + +# Output file: pfmgconstcoeffmp.out.33 +Iterations = 43 +Final Relative Residual Norm = 9.925149e-07 + +# Output file: pfmgconstcoeffmp.out.34 +Iterations = 14 +Final Relative Residual Norm = 5.920399e-07 + +# Output file: pfmgconstcoeffmp.out.35 +Iterations = 14 +Final Relative Residual Norm = 5.920399e-07 + +# Output file: pfmgconstcoeffmp.out.40 +Iterations = 18 +Final Relative Residual Norm = 8.028630e-07 + +# Output file: pfmgconstcoeffmp.out.41 +Iterations = 18 +Final Relative Residual Norm = 8.028630e-07 + +# Output file: pfmgconstcoeffmp.out.42 +Iterations = 16 +Final Relative Residual Norm = 6.371573e-07 + +# Output file: pfmgconstcoeffmp.out.43 +Iterations = 16 +Final Relative Residual Norm = 6.371573e-07 + +# Output file: pfmgconstcoeffmp.out.44 +Iterations = 13 +Final Relative Residual Norm = 9.856117e-07 + +# Output file: pfmgconstcoeffmp.out.45 +Iterations = 13 +Final Relative Residual Norm = 9.856117e-07 + diff --git a/external/hypre/src/test/TEST_struct/pfmgconstcoeffmp.sh b/external/hypre/src/test/TEST_struct/pfmgconstcoeffmp.sh old mode 100644 new mode 100755 index c025d75d..42255206 --- a/external/hypre/src/test/TEST_struct/pfmgconstcoeffmp.sh +++ b/external/hypre/src/test/TEST_struct/pfmgconstcoeffmp.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/pfmgorient.jobs b/external/hypre/src/test/TEST_struct/pfmgorient.jobs old mode 100644 new mode 100755 index 4ea95a29..b4f3de01 --- a/external/hypre/src/test/TEST_struct/pfmgorient.jobs +++ b/external/hypre/src/test/TEST_struct/pfmgorient.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/pfmgorient.saved.ray b/external/hypre/src/test/TEST_struct/pfmgorient.saved.florentia similarity index 100% rename from external/hypre/src/test/TEST_struct/pfmgorient.saved.ray rename to external/hypre/src/test/TEST_struct/pfmgorient.saved.florentia diff --git a/external/hypre/src/test/TEST_struct/pfmgorient.saved.lassen_cpu b/external/hypre/src/test/TEST_struct/pfmgorient.saved.lassen_cpu new file mode 100644 index 00000000..ad4e63f8 --- /dev/null +++ b/external/hypre/src/test/TEST_struct/pfmgorient.saved.lassen_cpu @@ -0,0 +1,12 @@ +# Output file: pfmgorient.out.0 +Iterations = 9 +Final Relative Residual Norm = 1.987658e-07 + +# Output file: pfmgorient.out.1 +Iterations = 9 +Final Relative Residual Norm = 1.987658e-07 + +# Output file: pfmgorient.out.2 +Iterations = 9 +Final Relative Residual Norm = 1.987658e-07 + diff --git a/external/hypre/src/test/TEST_struct/pfmgorient.saved.tioga b/external/hypre/src/test/TEST_struct/pfmgorient.saved.tioga new file mode 100644 index 00000000..ad4e63f8 --- /dev/null +++ b/external/hypre/src/test/TEST_struct/pfmgorient.saved.tioga @@ -0,0 +1,12 @@ +# Output file: pfmgorient.out.0 +Iterations = 9 +Final Relative Residual Norm = 1.987658e-07 + +# Output file: pfmgorient.out.1 +Iterations = 9 +Final Relative Residual Norm = 1.987658e-07 + +# Output file: pfmgorient.out.2 +Iterations = 9 +Final Relative Residual Norm = 1.987658e-07 + diff --git a/external/hypre/src/test/TEST_struct/pfmgorient.sh b/external/hypre/src/test/TEST_struct/pfmgorient.sh old mode 100644 new mode 100755 index f981edd2..5618a138 --- a/external/hypre/src/test/TEST_struct/pfmgorient.sh +++ b/external/hypre/src/test/TEST_struct/pfmgorient.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/pfmgtest1d.jobs b/external/hypre/src/test/TEST_struct/pfmgtest1d.jobs old mode 100644 new mode 100755 index 50be58ee..2d34b08f --- a/external/hypre/src/test/TEST_struct/pfmgtest1d.jobs +++ b/external/hypre/src/test/TEST_struct/pfmgtest1d.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/pfmgtest1d.saved.ray b/external/hypre/src/test/TEST_struct/pfmgtest1d.saved.florentia similarity index 100% rename from external/hypre/src/test/TEST_struct/pfmgtest1d.saved.ray rename to external/hypre/src/test/TEST_struct/pfmgtest1d.saved.florentia diff --git a/external/hypre/src/test/TEST_struct/pfmgtest1d.saved.lassen_cpu b/external/hypre/src/test/TEST_struct/pfmgtest1d.saved.lassen_cpu new file mode 100644 index 00000000..84e6234a --- /dev/null +++ b/external/hypre/src/test/TEST_struct/pfmgtest1d.saved.lassen_cpu @@ -0,0 +1,12 @@ +# Output file: pfmgtest1d.out.0 +Iterations = 9 +Final Relative Residual Norm = 2.021867e-07 + +# Output file: pfmgtest1d.out.1 +Iterations = 9 +Final Relative Residual Norm = 2.021867e-07 + +# Output file: pfmgtest1d.out.2 +Iterations = 9 +Final Relative Residual Norm = 2.021867e-07 + diff --git a/external/hypre/src/test/TEST_struct/pfmgtest1d.saved.tioga b/external/hypre/src/test/TEST_struct/pfmgtest1d.saved.tioga new file mode 100644 index 00000000..84e6234a --- /dev/null +++ b/external/hypre/src/test/TEST_struct/pfmgtest1d.saved.tioga @@ -0,0 +1,12 @@ +# Output file: pfmgtest1d.out.0 +Iterations = 9 +Final Relative Residual Norm = 2.021867e-07 + +# Output file: pfmgtest1d.out.1 +Iterations = 9 +Final Relative Residual Norm = 2.021867e-07 + +# Output file: pfmgtest1d.out.2 +Iterations = 9 +Final Relative Residual Norm = 2.021867e-07 + diff --git a/external/hypre/src/test/TEST_struct/pfmgtest1d.sh b/external/hypre/src/test/TEST_struct/pfmgtest1d.sh old mode 100644 new mode 100755 index 3c0d252b..cffd1304 --- a/external/hypre/src/test/TEST_struct/pfmgtest1d.sh +++ b/external/hypre/src/test/TEST_struct/pfmgtest1d.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/pfmgvcycle.jobs b/external/hypre/src/test/TEST_struct/pfmgvcycle.jobs old mode 100644 new mode 100755 index 00325c2d..3b2be562 --- a/external/hypre/src/test/TEST_struct/pfmgvcycle.jobs +++ b/external/hypre/src/test/TEST_struct/pfmgvcycle.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/pfmgvcycle.saved.ray b/external/hypre/src/test/TEST_struct/pfmgvcycle.saved.florentia similarity index 100% rename from external/hypre/src/test/TEST_struct/pfmgvcycle.saved.ray rename to external/hypre/src/test/TEST_struct/pfmgvcycle.saved.florentia diff --git a/external/hypre/src/test/TEST_struct/pfmgvcycle.saved.lassen_cpu b/external/hypre/src/test/TEST_struct/pfmgvcycle.saved.lassen_cpu new file mode 100644 index 00000000..f4304e4f --- /dev/null +++ b/external/hypre/src/test/TEST_struct/pfmgvcycle.saved.lassen_cpu @@ -0,0 +1,8 @@ +# Output file: pfmgvcycle.out.0 +Iterations = 30 +Final Relative Residual Norm = 8.360175e-07 + +# Output file: pfmgvcycle.out.1 +Iterations = 30 +Final Relative Residual Norm = 7.107142e-07 + diff --git a/external/hypre/src/test/TEST_struct/pfmgvcycle.saved.tioga b/external/hypre/src/test/TEST_struct/pfmgvcycle.saved.tioga new file mode 100644 index 00000000..f4304e4f --- /dev/null +++ b/external/hypre/src/test/TEST_struct/pfmgvcycle.saved.tioga @@ -0,0 +1,8 @@ +# Output file: pfmgvcycle.out.0 +Iterations = 30 +Final Relative Residual Norm = 8.360175e-07 + +# Output file: pfmgvcycle.out.1 +Iterations = 30 +Final Relative Residual Norm = 7.107142e-07 + diff --git a/external/hypre/src/test/TEST_struct/pfmgvcycle.sh b/external/hypre/src/test/TEST_struct/pfmgvcycle.sh old mode 100644 new mode 100755 index e195dcf5..74720dd7 --- a/external/hypre/src/test/TEST_struct/pfmgvcycle.sh +++ b/external/hypre/src/test/TEST_struct/pfmgvcycle.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/psmgbase3d.jobs b/external/hypre/src/test/TEST_struct/psmgbase3d.jobs old mode 100644 new mode 100755 index be5313d4..a2ac00f5 --- a/external/hypre/src/test/TEST_struct/psmgbase3d.jobs +++ b/external/hypre/src/test/TEST_struct/psmgbase3d.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/psmgbase3d.saved.ray b/external/hypre/src/test/TEST_struct/psmgbase3d.saved.florentia similarity index 100% rename from external/hypre/src/test/TEST_struct/psmgbase3d.saved.ray rename to external/hypre/src/test/TEST_struct/psmgbase3d.saved.florentia diff --git a/external/hypre/src/test/TEST_struct/psmgbase3d.saved.lassen_cpu b/external/hypre/src/test/TEST_struct/psmgbase3d.saved.lassen_cpu new file mode 100644 index 00000000..4fb7bfe5 --- /dev/null +++ b/external/hypre/src/test/TEST_struct/psmgbase3d.saved.lassen_cpu @@ -0,0 +1,20 @@ +# Output file: psmgbase3d.out.0 +Iterations = 6 +Final Relative Residual Norm = 7.016404e-07 + +# Output file: psmgbase3d.out.1 +Iterations = 6 +Final Relative Residual Norm = 7.016404e-07 + +# Output file: psmgbase3d.out.2 +Iterations = 6 +Final Relative Residual Norm = 7.016404e-07 + +# Output file: psmgbase3d.out.3 +Iterations = 6 +Final Relative Residual Norm = 7.016404e-07 + +# Output file: psmgbase3d.out.4 +Iterations = 6 +Final Relative Residual Norm = 7.016404e-07 + diff --git a/external/hypre/src/test/TEST_struct/psmgbase3d.saved.tioga b/external/hypre/src/test/TEST_struct/psmgbase3d.saved.tioga new file mode 100644 index 00000000..4fb7bfe5 --- /dev/null +++ b/external/hypre/src/test/TEST_struct/psmgbase3d.saved.tioga @@ -0,0 +1,20 @@ +# Output file: psmgbase3d.out.0 +Iterations = 6 +Final Relative Residual Norm = 7.016404e-07 + +# Output file: psmgbase3d.out.1 +Iterations = 6 +Final Relative Residual Norm = 7.016404e-07 + +# Output file: psmgbase3d.out.2 +Iterations = 6 +Final Relative Residual Norm = 7.016404e-07 + +# Output file: psmgbase3d.out.3 +Iterations = 6 +Final Relative Residual Norm = 7.016404e-07 + +# Output file: psmgbase3d.out.4 +Iterations = 6 +Final Relative Residual Norm = 7.016404e-07 + diff --git a/external/hypre/src/test/TEST_struct/psmgbase3d.sh b/external/hypre/src/test/TEST_struct/psmgbase3d.sh old mode 100644 new mode 100755 index 69b3ef13..812157e0 --- a/external/hypre/src/test/TEST_struct/psmgbase3d.sh +++ b/external/hypre/src/test/TEST_struct/psmgbase3d.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/psmgtest3d.jobs b/external/hypre/src/test/TEST_struct/psmgtest3d.jobs old mode 100644 new mode 100755 index c8dfad97..0dd18154 --- a/external/hypre/src/test/TEST_struct/psmgtest3d.jobs +++ b/external/hypre/src/test/TEST_struct/psmgtest3d.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/psmgtest3d.saved.ray b/external/hypre/src/test/TEST_struct/psmgtest3d.saved.florentia similarity index 100% rename from external/hypre/src/test/TEST_struct/psmgtest3d.saved.ray rename to external/hypre/src/test/TEST_struct/psmgtest3d.saved.florentia diff --git a/external/hypre/src/test/TEST_struct/psmgtest3d.saved.lassen_cpu b/external/hypre/src/test/TEST_struct/psmgtest3d.saved.lassen_cpu new file mode 100644 index 00000000..1f7fa836 --- /dev/null +++ b/external/hypre/src/test/TEST_struct/psmgtest3d.saved.lassen_cpu @@ -0,0 +1,8 @@ +# Output file: psmgtest3d.out.0 +Iterations = 5 +Final Relative Residual Norm = 6.944705e-08 + +# Output file: psmgtest3d.out.1 +Iterations = 5 +Final Relative Residual Norm = 6.944705e-08 + diff --git a/external/hypre/src/test/TEST_struct/psmgtest3d.saved.tioga b/external/hypre/src/test/TEST_struct/psmgtest3d.saved.tioga new file mode 100644 index 00000000..1f7fa836 --- /dev/null +++ b/external/hypre/src/test/TEST_struct/psmgtest3d.saved.tioga @@ -0,0 +1,8 @@ +# Output file: psmgtest3d.out.0 +Iterations = 5 +Final Relative Residual Norm = 6.944705e-08 + +# Output file: psmgtest3d.out.1 +Iterations = 5 +Final Relative Residual Norm = 6.944705e-08 + diff --git a/external/hypre/src/test/TEST_struct/psmgtest3d.sh b/external/hypre/src/test/TEST_struct/psmgtest3d.sh old mode 100644 new mode 100755 index 241d864e..41d977ec --- a/external/hypre/src/test/TEST_struct/psmgtest3d.sh +++ b/external/hypre/src/test/TEST_struct/psmgtest3d.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/smgbase1d.jobs b/external/hypre/src/test/TEST_struct/smgbase1d.jobs old mode 100644 new mode 100755 index 2f4d2a3a..1e3f1bfb --- a/external/hypre/src/test/TEST_struct/smgbase1d.jobs +++ b/external/hypre/src/test/TEST_struct/smgbase1d.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/smgbase1d.saved.ray b/external/hypre/src/test/TEST_struct/smgbase1d.saved.florentia similarity index 100% rename from external/hypre/src/test/TEST_struct/smgbase1d.saved.ray rename to external/hypre/src/test/TEST_struct/smgbase1d.saved.florentia diff --git a/external/hypre/src/test/TEST_struct/smgbase1d.saved.lassen_cpu b/external/hypre/src/test/TEST_struct/smgbase1d.saved.lassen_cpu new file mode 100644 index 00000000..5a24e4ac --- /dev/null +++ b/external/hypre/src/test/TEST_struct/smgbase1d.saved.lassen_cpu @@ -0,0 +1,8 @@ +# Output file: smgbase1d.out.0 +Iterations = 1 +Final Relative Residual Norm = 0.000000e+00 + +# Output file: smgbase1d.out.1 +Iterations = 1 +Final Relative Residual Norm = 0.000000e+00 + diff --git a/external/hypre/src/test/TEST_struct/smgbase1d.saved.tioga b/external/hypre/src/test/TEST_struct/smgbase1d.saved.tioga new file mode 100644 index 00000000..5a24e4ac --- /dev/null +++ b/external/hypre/src/test/TEST_struct/smgbase1d.saved.tioga @@ -0,0 +1,8 @@ +# Output file: smgbase1d.out.0 +Iterations = 1 +Final Relative Residual Norm = 0.000000e+00 + +# Output file: smgbase1d.out.1 +Iterations = 1 +Final Relative Residual Norm = 0.000000e+00 + diff --git a/external/hypre/src/test/TEST_struct/smgbase1d.sh b/external/hypre/src/test/TEST_struct/smgbase1d.sh old mode 100644 new mode 100755 index f3a37236..336c76e8 --- a/external/hypre/src/test/TEST_struct/smgbase1d.sh +++ b/external/hypre/src/test/TEST_struct/smgbase1d.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/smgbase2d.jobs b/external/hypre/src/test/TEST_struct/smgbase2d.jobs old mode 100644 new mode 100755 index 4d84cbde..e33a2479 --- a/external/hypre/src/test/TEST_struct/smgbase2d.jobs +++ b/external/hypre/src/test/TEST_struct/smgbase2d.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/smgbase2d.saved.ray b/external/hypre/src/test/TEST_struct/smgbase2d.saved.florentia similarity index 100% rename from external/hypre/src/test/TEST_struct/smgbase2d.saved.ray rename to external/hypre/src/test/TEST_struct/smgbase2d.saved.florentia diff --git a/external/hypre/src/test/TEST_struct/smgbase2d.saved.lassen_cpu b/external/hypre/src/test/TEST_struct/smgbase2d.saved.lassen_cpu new file mode 100644 index 00000000..fcde9fd3 --- /dev/null +++ b/external/hypre/src/test/TEST_struct/smgbase2d.saved.lassen_cpu @@ -0,0 +1,20 @@ +# Output file: smgbase2d.out.0 +Iterations = 5 +Final Relative Residual Norm = 2.468039e-07 + +# Output file: smgbase2d.out.1 +Iterations = 5 +Final Relative Residual Norm = 2.468039e-07 + +# Output file: smgbase2d.out.2 +Iterations = 5 +Final Relative Residual Norm = 2.468039e-07 + +# Output file: smgbase2d.out.3 +Iterations = 5 +Final Relative Residual Norm = 2.468039e-07 + +# Output file: smgbase2d.out.4 +Iterations = 5 +Final Relative Residual Norm = 2.468039e-07 + diff --git a/external/hypre/src/test/TEST_struct/smgbase2d.saved.tioga b/external/hypre/src/test/TEST_struct/smgbase2d.saved.tioga new file mode 100644 index 00000000..fcde9fd3 --- /dev/null +++ b/external/hypre/src/test/TEST_struct/smgbase2d.saved.tioga @@ -0,0 +1,20 @@ +# Output file: smgbase2d.out.0 +Iterations = 5 +Final Relative Residual Norm = 2.468039e-07 + +# Output file: smgbase2d.out.1 +Iterations = 5 +Final Relative Residual Norm = 2.468039e-07 + +# Output file: smgbase2d.out.2 +Iterations = 5 +Final Relative Residual Norm = 2.468039e-07 + +# Output file: smgbase2d.out.3 +Iterations = 5 +Final Relative Residual Norm = 2.468039e-07 + +# Output file: smgbase2d.out.4 +Iterations = 5 +Final Relative Residual Norm = 2.468039e-07 + diff --git a/external/hypre/src/test/TEST_struct/smgbase2d.sh b/external/hypre/src/test/TEST_struct/smgbase2d.sh old mode 100644 new mode 100755 index eea81468..8a50ddd4 --- a/external/hypre/src/test/TEST_struct/smgbase2d.sh +++ b/external/hypre/src/test/TEST_struct/smgbase2d.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/smgbase3d.jobs b/external/hypre/src/test/TEST_struct/smgbase3d.jobs old mode 100644 new mode 100755 index fc3c4e89..92cec294 --- a/external/hypre/src/test/TEST_struct/smgbase3d.jobs +++ b/external/hypre/src/test/TEST_struct/smgbase3d.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/smgbase3d.saved.ray b/external/hypre/src/test/TEST_struct/smgbase3d.saved.florentia similarity index 100% rename from external/hypre/src/test/TEST_struct/smgbase3d.saved.ray rename to external/hypre/src/test/TEST_struct/smgbase3d.saved.florentia diff --git a/external/hypre/src/test/TEST_struct/smgbase3d.saved.lassen_cpu b/external/hypre/src/test/TEST_struct/smgbase3d.saved.lassen_cpu new file mode 100644 index 00000000..c697ff44 --- /dev/null +++ b/external/hypre/src/test/TEST_struct/smgbase3d.saved.lassen_cpu @@ -0,0 +1,24 @@ +# Output file: smgbase3d.out.0 +Iterations = 4 +Final Relative Residual Norm = 8.971901e-07 + +# Output file: smgbase3d.out.1 +Iterations = 4 +Final Relative Residual Norm = 8.971901e-07 + +# Output file: smgbase3d.out.2 +Iterations = 4 +Final Relative Residual Norm = 8.971901e-07 + +# Output file: smgbase3d.out.3 +Iterations = 4 +Final Relative Residual Norm = 8.971901e-07 + +# Output file: smgbase3d.out.4 +Iterations = 4 +Final Relative Residual Norm = 8.971901e-07 + +# Output file: smgbase3d.out.5 +Iterations = 4 +Final Relative Residual Norm = 8.971901e-07 + diff --git a/external/hypre/src/test/TEST_struct/smgbase3d.saved.tioga b/external/hypre/src/test/TEST_struct/smgbase3d.saved.tioga new file mode 100644 index 00000000..c697ff44 --- /dev/null +++ b/external/hypre/src/test/TEST_struct/smgbase3d.saved.tioga @@ -0,0 +1,24 @@ +# Output file: smgbase3d.out.0 +Iterations = 4 +Final Relative Residual Norm = 8.971901e-07 + +# Output file: smgbase3d.out.1 +Iterations = 4 +Final Relative Residual Norm = 8.971901e-07 + +# Output file: smgbase3d.out.2 +Iterations = 4 +Final Relative Residual Norm = 8.971901e-07 + +# Output file: smgbase3d.out.3 +Iterations = 4 +Final Relative Residual Norm = 8.971901e-07 + +# Output file: smgbase3d.out.4 +Iterations = 4 +Final Relative Residual Norm = 8.971901e-07 + +# Output file: smgbase3d.out.5 +Iterations = 4 +Final Relative Residual Norm = 8.971901e-07 + diff --git a/external/hypre/src/test/TEST_struct/smgbase3d.sh b/external/hypre/src/test/TEST_struct/smgbase3d.sh old mode 100644 new mode 100755 index ef132596..5396f1bc --- a/external/hypre/src/test/TEST_struct/smgbase3d.sh +++ b/external/hypre/src/test/TEST_struct/smgbase3d.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/smgtest1d.jobs b/external/hypre/src/test/TEST_struct/smgtest1d.jobs old mode 100644 new mode 100755 index 7e5c36fe..c25f00fe --- a/external/hypre/src/test/TEST_struct/smgtest1d.jobs +++ b/external/hypre/src/test/TEST_struct/smgtest1d.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/smgtest1d.saved.ray b/external/hypre/src/test/TEST_struct/smgtest1d.saved.florentia similarity index 100% rename from external/hypre/src/test/TEST_struct/smgtest1d.saved.ray rename to external/hypre/src/test/TEST_struct/smgtest1d.saved.florentia diff --git a/external/hypre/src/test/TEST_struct/smgtest1d.saved.lassen_cpu b/external/hypre/src/test/TEST_struct/smgtest1d.saved.lassen_cpu new file mode 100644 index 00000000..fdf7e64d --- /dev/null +++ b/external/hypre/src/test/TEST_struct/smgtest1d.saved.lassen_cpu @@ -0,0 +1,12 @@ +# Output file: smgtest1d.out.0 +Iterations = 1 +Final Relative Residual Norm = 0.000000e+00 + +# Output file: smgtest1d.out.1 +Iterations = 1 +Final Relative Residual Norm = 0.000000e+00 + +# Output file: smgtest1d.out.2 +Iterations = 1 +Final Relative Residual Norm = 0.000000e+00 + diff --git a/external/hypre/src/test/TEST_struct/smgtest1d.saved.tioga b/external/hypre/src/test/TEST_struct/smgtest1d.saved.tioga new file mode 100644 index 00000000..fdf7e64d --- /dev/null +++ b/external/hypre/src/test/TEST_struct/smgtest1d.saved.tioga @@ -0,0 +1,12 @@ +# Output file: smgtest1d.out.0 +Iterations = 1 +Final Relative Residual Norm = 0.000000e+00 + +# Output file: smgtest1d.out.1 +Iterations = 1 +Final Relative Residual Norm = 0.000000e+00 + +# Output file: smgtest1d.out.2 +Iterations = 1 +Final Relative Residual Norm = 0.000000e+00 + diff --git a/external/hypre/src/test/TEST_struct/smgtest1d.sh b/external/hypre/src/test/TEST_struct/smgtest1d.sh old mode 100644 new mode 100755 index 3c0d252b..cffd1304 --- a/external/hypre/src/test/TEST_struct/smgtest1d.sh +++ b/external/hypre/src/test/TEST_struct/smgtest1d.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/smgvcycle.jobs b/external/hypre/src/test/TEST_struct/smgvcycle.jobs old mode 100644 new mode 100755 index d0f724e9..5f6ab6dc --- a/external/hypre/src/test/TEST_struct/smgvcycle.jobs +++ b/external/hypre/src/test/TEST_struct/smgvcycle.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/smgvcycle.saved.ray b/external/hypre/src/test/TEST_struct/smgvcycle.saved.florentia similarity index 100% rename from external/hypre/src/test/TEST_struct/smgvcycle.saved.ray rename to external/hypre/src/test/TEST_struct/smgvcycle.saved.florentia diff --git a/external/hypre/src/test/TEST_struct/smgvcycle.saved.lassen_cpu b/external/hypre/src/test/TEST_struct/smgvcycle.saved.lassen_cpu new file mode 100644 index 00000000..0e5dfa13 --- /dev/null +++ b/external/hypre/src/test/TEST_struct/smgvcycle.saved.lassen_cpu @@ -0,0 +1,4 @@ +# Output file: smgvcycle.out.0 +Iterations = 7 +Final Relative Residual Norm = 3.621850e-07 + diff --git a/external/hypre/src/test/TEST_struct/smgvcycle.saved.tioga b/external/hypre/src/test/TEST_struct/smgvcycle.saved.tioga new file mode 100644 index 00000000..0e5dfa13 --- /dev/null +++ b/external/hypre/src/test/TEST_struct/smgvcycle.saved.tioga @@ -0,0 +1,4 @@ +# Output file: smgvcycle.out.0 +Iterations = 7 +Final Relative Residual Norm = 3.621850e-07 + diff --git a/external/hypre/src/test/TEST_struct/smgvcycle.sh b/external/hypre/src/test/TEST_struct/smgvcycle.sh old mode 100644 new mode 100755 index a42e6027..298c3ab2 --- a/external/hypre/src/test/TEST_struct/smgvcycle.sh +++ b/external/hypre/src/test/TEST_struct/smgvcycle.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/solvers.jobs b/external/hypre/src/test/TEST_struct/solvers.jobs old mode 100644 new mode 100755 index 2597b2dc..c53d8961 --- a/external/hypre/src/test/TEST_struct/solvers.jobs +++ b/external/hypre/src/test/TEST_struct/solvers.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/solvers.saved.ray b/external/hypre/src/test/TEST_struct/solvers.saved.florentia similarity index 100% rename from external/hypre/src/test/TEST_struct/solvers.saved.ray rename to external/hypre/src/test/TEST_struct/solvers.saved.florentia diff --git a/external/hypre/src/test/TEST_struct/solvers.saved.lassen_cpu b/external/hypre/src/test/TEST_struct/solvers.saved.lassen_cpu new file mode 100644 index 00000000..9def633b --- /dev/null +++ b/external/hypre/src/test/TEST_struct/solvers.saved.lassen_cpu @@ -0,0 +1,20 @@ +# Output file: solvers.out.0 +Iterations = 4 +Final Relative Residual Norm = 7.846564e-07 + +# Output file: solvers.out.1 +Iterations = 8 +Final Relative Residual Norm = 5.298596e-07 + +# Output file: solvers.out.2 +Iterations = 20 +Final Relative Residual Norm = 6.913376e-07 + +# Output file: solvers.out.3 +Iterations = 20 +Final Relative Residual Norm = 5.962015e-07 + +# Output file: solvers.out.4 +Iterations = 20 +Final Relative Residual Norm = 5.962015e-07 + diff --git a/external/hypre/src/test/TEST_struct/solvers.saved.tioga b/external/hypre/src/test/TEST_struct/solvers.saved.tioga new file mode 100644 index 00000000..9def633b --- /dev/null +++ b/external/hypre/src/test/TEST_struct/solvers.saved.tioga @@ -0,0 +1,20 @@ +# Output file: solvers.out.0 +Iterations = 4 +Final Relative Residual Norm = 7.846564e-07 + +# Output file: solvers.out.1 +Iterations = 8 +Final Relative Residual Norm = 5.298596e-07 + +# Output file: solvers.out.2 +Iterations = 20 +Final Relative Residual Norm = 6.913376e-07 + +# Output file: solvers.out.3 +Iterations = 20 +Final Relative Residual Norm = 5.962015e-07 + +# Output file: solvers.out.4 +Iterations = 20 +Final Relative Residual Norm = 5.962015e-07 + diff --git a/external/hypre/src/test/TEST_struct/solvers.sh b/external/hypre/src/test/TEST_struct/solvers.sh old mode 100644 new mode 100755 index b6f73f39..b563bb85 --- a/external/hypre/src/test/TEST_struct/solvers.sh +++ b/external/hypre/src/test/TEST_struct/solvers.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/vcpfmgRedBlackGS.jobs b/external/hypre/src/test/TEST_struct/vcpfmgRedBlackGS.jobs old mode 100644 new mode 100755 index 12f75304..1e599a31 --- a/external/hypre/src/test/TEST_struct/vcpfmgRedBlackGS.jobs +++ b/external/hypre/src/test/TEST_struct/vcpfmgRedBlackGS.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/vcpfmgRedBlackGS.saved.ray b/external/hypre/src/test/TEST_struct/vcpfmgRedBlackGS.saved.florentia similarity index 100% rename from external/hypre/src/test/TEST_struct/vcpfmgRedBlackGS.saved.ray rename to external/hypre/src/test/TEST_struct/vcpfmgRedBlackGS.saved.florentia diff --git a/external/hypre/src/test/TEST_struct/vcpfmgRedBlackGS.saved.lassen_cpu b/external/hypre/src/test/TEST_struct/vcpfmgRedBlackGS.saved.lassen_cpu new file mode 100644 index 00000000..b288a3b4 --- /dev/null +++ b/external/hypre/src/test/TEST_struct/vcpfmgRedBlackGS.saved.lassen_cpu @@ -0,0 +1,48 @@ +# Output file: vcpfmgRedBlackGS.out.0 +Iterations = 5 +Final Relative Residual Norm = 3.344527e-07 + +# Output file: vcpfmgRedBlackGS.out.1 +Iterations = 5 +Final Relative Residual Norm = 3.344527e-07 + +# Output file: vcpfmgRedBlackGS.out.2 +Iterations = 5 +Final Relative Residual Norm = 3.344527e-07 + +# Output file: vcpfmgRedBlackGS.out.3 +Iterations = 5 +Final Relative Residual Norm = 3.344527e-07 + +# Output file: vcpfmgRedBlackGS.out.4 +Iterations = 5 +Final Relative Residual Norm = 3.344527e-07 + +# Output file: vcpfmgRedBlackGS.out.5 +Iterations = 5 +Final Relative Residual Norm = 3.344527e-07 + +# Output file: vcpfmgRedBlackGS.out.6 +Iterations = 10 +Final Relative Residual Norm = 5.540991e-07 + +# Output file: vcpfmgRedBlackGS.out.7 +Iterations = 10 +Final Relative Residual Norm = 5.540991e-07 + +# Output file: vcpfmgRedBlackGS.out.8 +Iterations = 10 +Final Relative Residual Norm = 5.540991e-07 + +# Output file: vcpfmgRedBlackGS.out.9 +Iterations = 10 +Final Relative Residual Norm = 5.540991e-07 + +# Output file: vcpfmgRedBlackGS.out.10 +Iterations = 10 +Final Relative Residual Norm = 5.540991e-07 + +# Output file: vcpfmgRedBlackGS.out.11 +Iterations = 10 +Final Relative Residual Norm = 5.540991e-07 + diff --git a/external/hypre/src/test/TEST_struct/vcpfmgRedBlackGS.saved.tioga b/external/hypre/src/test/TEST_struct/vcpfmgRedBlackGS.saved.tioga new file mode 100644 index 00000000..b288a3b4 --- /dev/null +++ b/external/hypre/src/test/TEST_struct/vcpfmgRedBlackGS.saved.tioga @@ -0,0 +1,48 @@ +# Output file: vcpfmgRedBlackGS.out.0 +Iterations = 5 +Final Relative Residual Norm = 3.344527e-07 + +# Output file: vcpfmgRedBlackGS.out.1 +Iterations = 5 +Final Relative Residual Norm = 3.344527e-07 + +# Output file: vcpfmgRedBlackGS.out.2 +Iterations = 5 +Final Relative Residual Norm = 3.344527e-07 + +# Output file: vcpfmgRedBlackGS.out.3 +Iterations = 5 +Final Relative Residual Norm = 3.344527e-07 + +# Output file: vcpfmgRedBlackGS.out.4 +Iterations = 5 +Final Relative Residual Norm = 3.344527e-07 + +# Output file: vcpfmgRedBlackGS.out.5 +Iterations = 5 +Final Relative Residual Norm = 3.344527e-07 + +# Output file: vcpfmgRedBlackGS.out.6 +Iterations = 10 +Final Relative Residual Norm = 5.540991e-07 + +# Output file: vcpfmgRedBlackGS.out.7 +Iterations = 10 +Final Relative Residual Norm = 5.540991e-07 + +# Output file: vcpfmgRedBlackGS.out.8 +Iterations = 10 +Final Relative Residual Norm = 5.540991e-07 + +# Output file: vcpfmgRedBlackGS.out.9 +Iterations = 10 +Final Relative Residual Norm = 5.540991e-07 + +# Output file: vcpfmgRedBlackGS.out.10 +Iterations = 10 +Final Relative Residual Norm = 5.540991e-07 + +# Output file: vcpfmgRedBlackGS.out.11 +Iterations = 10 +Final Relative Residual Norm = 5.540991e-07 + diff --git a/external/hypre/src/test/TEST_struct/vcpfmgRedBlackGS.sh b/external/hypre/src/test/TEST_struct/vcpfmgRedBlackGS.sh old mode 100644 new mode 100755 index 0cc4dd37..c097512a --- a/external/hypre/src/test/TEST_struct/vcpfmgRedBlackGS.sh +++ b/external/hypre/src/test/TEST_struct/vcpfmgRedBlackGS.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/vdpfmgRedBlackGS.jobs b/external/hypre/src/test/TEST_struct/vdpfmgRedBlackGS.jobs old mode 100644 new mode 100755 index c6f52234..4a7616e1 --- a/external/hypre/src/test/TEST_struct/vdpfmgRedBlackGS.jobs +++ b/external/hypre/src/test/TEST_struct/vdpfmgRedBlackGS.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/vdpfmgRedBlackGS.saved.ray b/external/hypre/src/test/TEST_struct/vdpfmgRedBlackGS.saved.florentia similarity index 100% rename from external/hypre/src/test/TEST_struct/vdpfmgRedBlackGS.saved.ray rename to external/hypre/src/test/TEST_struct/vdpfmgRedBlackGS.saved.florentia diff --git a/external/hypre/src/test/TEST_struct/vdpfmgRedBlackGS.saved.lassen_cpu b/external/hypre/src/test/TEST_struct/vdpfmgRedBlackGS.saved.lassen_cpu new file mode 100644 index 00000000..944a7308 --- /dev/null +++ b/external/hypre/src/test/TEST_struct/vdpfmgRedBlackGS.saved.lassen_cpu @@ -0,0 +1,48 @@ +# Output file: vdpfmgRedBlackGS.out.0 +Iterations = 5 +Final Relative Residual Norm = 1.616480e-07 + +# Output file: vdpfmgRedBlackGS.out.1 +Iterations = 5 +Final Relative Residual Norm = 1.616480e-07 + +# Output file: vdpfmgRedBlackGS.out.2 +Iterations = 5 +Final Relative Residual Norm = 1.616480e-07 + +# Output file: vdpfmgRedBlackGS.out.3 +Iterations = 5 +Final Relative Residual Norm = 1.616480e-07 + +# Output file: vdpfmgRedBlackGS.out.4 +Iterations = 5 +Final Relative Residual Norm = 1.616480e-07 + +# Output file: vdpfmgRedBlackGS.out.5 +Iterations = 5 +Final Relative Residual Norm = 1.616480e-07 + +# Output file: vdpfmgRedBlackGS.out.6 +Iterations = 9 +Final Relative Residual Norm = 8.392336e-07 + +# Output file: vdpfmgRedBlackGS.out.7 +Iterations = 9 +Final Relative Residual Norm = 8.392336e-07 + +# Output file: vdpfmgRedBlackGS.out.8 +Iterations = 9 +Final Relative Residual Norm = 8.392336e-07 + +# Output file: vdpfmgRedBlackGS.out.9 +Iterations = 9 +Final Relative Residual Norm = 8.392336e-07 + +# Output file: vdpfmgRedBlackGS.out.10 +Iterations = 9 +Final Relative Residual Norm = 8.392336e-07 + +# Output file: vdpfmgRedBlackGS.out.11 +Iterations = 9 +Final Relative Residual Norm = 8.392336e-07 + diff --git a/external/hypre/src/test/TEST_struct/vdpfmgRedBlackGS.saved.tioga b/external/hypre/src/test/TEST_struct/vdpfmgRedBlackGS.saved.tioga new file mode 100644 index 00000000..944a7308 --- /dev/null +++ b/external/hypre/src/test/TEST_struct/vdpfmgRedBlackGS.saved.tioga @@ -0,0 +1,48 @@ +# Output file: vdpfmgRedBlackGS.out.0 +Iterations = 5 +Final Relative Residual Norm = 1.616480e-07 + +# Output file: vdpfmgRedBlackGS.out.1 +Iterations = 5 +Final Relative Residual Norm = 1.616480e-07 + +# Output file: vdpfmgRedBlackGS.out.2 +Iterations = 5 +Final Relative Residual Norm = 1.616480e-07 + +# Output file: vdpfmgRedBlackGS.out.3 +Iterations = 5 +Final Relative Residual Norm = 1.616480e-07 + +# Output file: vdpfmgRedBlackGS.out.4 +Iterations = 5 +Final Relative Residual Norm = 1.616480e-07 + +# Output file: vdpfmgRedBlackGS.out.5 +Iterations = 5 +Final Relative Residual Norm = 1.616480e-07 + +# Output file: vdpfmgRedBlackGS.out.6 +Iterations = 9 +Final Relative Residual Norm = 8.392336e-07 + +# Output file: vdpfmgRedBlackGS.out.7 +Iterations = 9 +Final Relative Residual Norm = 8.392336e-07 + +# Output file: vdpfmgRedBlackGS.out.8 +Iterations = 9 +Final Relative Residual Norm = 8.392336e-07 + +# Output file: vdpfmgRedBlackGS.out.9 +Iterations = 9 +Final Relative Residual Norm = 8.392336e-07 + +# Output file: vdpfmgRedBlackGS.out.10 +Iterations = 9 +Final Relative Residual Norm = 8.392336e-07 + +# Output file: vdpfmgRedBlackGS.out.11 +Iterations = 9 +Final Relative Residual Norm = 8.392336e-07 + diff --git a/external/hypre/src/test/TEST_struct/vdpfmgRedBlackGS.sh b/external/hypre/src/test/TEST_struct/vdpfmgRedBlackGS.sh old mode 100644 new mode 100755 index 0cc4dd37..c097512a --- a/external/hypre/src/test/TEST_struct/vdpfmgRedBlackGS.sh +++ b/external/hypre/src/test/TEST_struct/vdpfmgRedBlackGS.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_struct/versioncheck.jobs b/external/hypre/src/test/TEST_struct/versioncheck.jobs new file mode 100755 index 00000000..59920c3b --- /dev/null +++ b/external/hypre/src/test/TEST_struct/versioncheck.jobs @@ -0,0 +1,12 @@ +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +#============================================================================= +# Check the version header file variables +#============================================================================= + +mpirun -np 1 ./struct > versioncheck.out.1 + diff --git a/external/hypre/src/test/TEST_struct/versioncheck.sh b/external/hypre/src/test/TEST_struct/versioncheck.sh new file mode 100755 index 00000000..87db6aaf --- /dev/null +++ b/external/hypre/src/test/TEST_struct/versioncheck.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +TNAME=`basename $0 .sh` + +#============================================================================= +# Check the HYPRE_DEVELOP variables +#============================================================================= + +grep "Using HYPRE_DEVELOP_STRING" ${TNAME}.out.1 > ${TNAME}.testdata + +echo -n > ${TNAME}.testdatacheck +if [ -d ../../../.git ]; then + DEVSTRING=`git describe --match 'v*' --long --abbrev=9 2>/dev/null` + DEVNUMBER=`echo $DEVSTRING | awk -F- '{print $2}'` + DEVBRANCH=`git rev-parse --abbrev-ref HEAD` + if [ -n "$DEVSTRING" ]; then + if [ "$DEVBRANCH" != "master" ]; then + echo "Using HYPRE_DEVELOP_STRING: $DEVSTRING (branch $DEVBRANCH; not the develop branch)" \ + > ${TNAME}.testdatacheck + else + echo "Using HYPRE_DEVELOP_STRING: $DEVSTRING (branch $DEVBRANCH; the develop branch)" \ + > ${TNAME}.testdatacheck + fi + fi +fi +diff ${TNAME}.testdata ${TNAME}.testdatacheck >&2 + +#============================================================================= +# remove temporary files +#============================================================================= + +rm -f ${TNAME}.testdata* diff --git a/external/hypre/src/test/TEST_superlu/sludist.jobs b/external/hypre/src/test/TEST_superlu/sludist.jobs old mode 100644 new mode 100755 index f0237268..7b25fee5 --- a/external/hypre/src/test/TEST_superlu/sludist.jobs +++ b/external/hypre/src/test/TEST_superlu/sludist.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_superlu/sludist.saved b/external/hypre/src/test/TEST_superlu/sludist.saved index becd6519..da8f6af4 100644 --- a/external/hypre/src/test/TEST_superlu/sludist.saved +++ b/external/hypre/src/test/TEST_superlu/sludist.saved @@ -14,5 +14,5 @@ Final Relative Residual Norm = 3.172597e-08 GMRES Iterations = 8 -Final GMRES Relative Residual Norm = 5.973547e-08 +Final GMRES Relative Residual Norm = 5.950181e-08 diff --git a/external/hypre/src/test/TEST_superlu/sludist.sh b/external/hypre/src/test/TEST_superlu/sludist.sh old mode 100644 new mode 100755 index 1b60265a..5db3fe8a --- a/external/hypre/src/test/TEST_superlu/sludist.sh +++ b/external/hypre/src/test/TEST_superlu/sludist.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_timing/efficiency.jobs b/external/hypre/src/test/TEST_timing/efficiency.jobs old mode 100644 new mode 100755 index 3e8663ec..22a08e95 --- a/external/hypre/src/test/TEST_timing/efficiency.jobs +++ b/external/hypre/src/test/TEST_timing/efficiency.jobs @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/TEST_timing/efficiency.sh b/external/hypre/src/test/TEST_timing/efficiency.sh old mode 100644 new mode 100755 index 4f3fa254..54a294b8 --- a/external/hypre/src/test/TEST_timing/efficiency.sh +++ b/external/hypre/src/test/TEST_timing/efficiency.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/ams_driver.c b/external/hypre/src/test/ams_driver.c index 1ec8ca14..78ac7050 100644 --- a/external/hypre/src/test/ams_driver.c +++ b/external/hypre/src/test/ams_driver.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -18,14 +18,18 @@ #include "_hypre_parcsr_ls.h" #include "_hypre_IJ_mv.h" #include "HYPRE.h" +#if defined(HYPRE_USING_CUSPARSE) +#define DISABLE_CUSPARSE_DEPRECATED +#include +#endif void CheckIfFileExists(char *file) { FILE *test; - if (!(test = fopen(file,"r"))) + if (!(test = fopen(file, "r"))) { hypre_MPI_Finalize(); - hypre_printf("Can't find the input file \"%s\"\n",file); + hypre_printf("Can't find the input file \"%s\"\n", file); exit(1); } fclose(test); @@ -35,14 +39,14 @@ void AMSDriverMatrixRead(const char *file, HYPRE_ParCSRMatrix *A) { FILE *test; char file0[100]; - sprintf(file0,"%s.D.0",file); - if (!(test = fopen(file0,"r"))) + sprintf(file0, "%s.D.0", file); + if (!(test = fopen(file0, "r"))) { - sprintf(file0,"%s.00000",file); - if (!(test = fopen(file0,"r"))) + sprintf(file0, "%s.00000", file); + if (!(test = fopen(file0, "r"))) { hypre_MPI_Finalize(); - hypre_printf("Can't find the input file \"%s\"\n",file); + hypre_printf("Can't find the input file \"%s\"\n", file); exit(1); } else /* Read in IJ format*/ @@ -67,14 +71,14 @@ void AMSDriverVectorRead(const char *file, HYPRE_ParVector *x) { FILE *test; char file0[100]; - sprintf(file0,"%s.0",file); - if (!(test = fopen(file0,"r"))) + sprintf(file0, "%s.0", file); + if (!(test = fopen(file0, "r"))) { - sprintf(file0,"%s.00000",file); - if (!(test = fopen(file0,"r"))) + sprintf(file0, "%s.00000", file); + if (!(test = fopen(file0, "r"))) { hypre_MPI_Finalize(); - hypre_printf("Can't find the input file \"%s\"\n",file); + hypre_printf("Can't find the input file \"%s\"\n", file); exit(1); } else /* Read in IJ format*/ @@ -95,13 +99,15 @@ void AMSDriverVectorRead(const char *file, HYPRE_ParVector *x) fclose(test); } -hypre_int main (hypre_int argc, char *argv[]) +hypre_int +main (hypre_int argc, + char *argv[]) { HYPRE_Int num_procs, myid; HYPRE_Int time_index; HYPRE_Int solver_id; - HYPRE_Int maxit, cycle_type, rlx_type, coarse_rlx_type, rlx_sweeps, dim; + HYPRE_Int maxit, pcg_maxit, cycle_type, rlx_type, coarse_rlx_type, rlx_sweeps, dim; HYPRE_Real rlx_weight, rlx_omega; HYPRE_Int amg_coarsen_type, amg_rlx_type, amg_agg_levels, amg_interp_type, amg_Pmax; HYPRE_Int h1_method, singular_problem, coordinates; @@ -112,12 +118,21 @@ hypre_int main (hypre_int argc, char *argv[]) HYPRE_Int blockSize; HYPRE_Solver solver, precond; - HYPRE_ParCSRMatrix A=0, G=0, Aalpha=0, Abeta=0, M=0; - HYPRE_ParVector x0=0, b=0; - HYPRE_ParVector Gx=0, Gy=0, Gz=0; - HYPRE_ParVector x=0, y=0, z=0; + HYPRE_ParCSRMatrix A = 0, G = 0, Aalpha = 0, Abeta = 0, M = 0; + HYPRE_ParVector x0 = 0, b = 0; + HYPRE_ParVector Gx = 0, Gy = 0, Gz = 0; + HYPRE_ParVector x = 0, y = 0, z = 0; - HYPRE_ParVector interior_nodes=0; + HYPRE_ParVector interior_nodes = 0; + + /* default execution policy and memory space */ +#if defined(HYPRE_TEST_USING_HOST) + HYPRE_MemoryLocation memory_location = HYPRE_MEMORY_HOST; + HYPRE_ExecutionPolicy default_exec_policy = HYPRE_EXEC_HOST; +#else + HYPRE_MemoryLocation memory_location = HYPRE_MEMORY_DEVICE; + HYPRE_ExecutionPolicy default_exec_policy = HYPRE_EXEC_DEVICE; +#endif /* Initialize MPI */ hypre_MPI_Init(&argc, &argv); @@ -126,28 +141,40 @@ hypre_int main (hypre_int argc, char *argv[]) /*----------------------------------------------------------------- * GPU Device binding - * Must be done before HYPRE_Init() and should not be changed after + * Must be done before HYPRE_Initialize() and should not be changed after *-----------------------------------------------------------------*/ - hypre_bind_device(myid, num_procs, hypre_MPI_COMM_WORLD); + hypre_bind_device_id(-1, myid, num_procs, hypre_MPI_COMM_WORLD); /*----------------------------------------------------------- * Initialize : must be the first HYPRE function to call *-----------------------------------------------------------*/ - HYPRE_Init(); + HYPRE_Initialize(); + HYPRE_DeviceInitialize(); + + /* default memory location */ + HYPRE_SetMemoryLocation(memory_location); /* default execution policy */ - HYPRE_SetExecutionPolicy(HYPRE_EXEC_DEVICE); + HYPRE_SetExecutionPolicy(default_exec_policy); #if defined(HYPRE_USING_GPU) - /* use cuSPARSE for SpGEMM */ - HYPRE_SetSpGemmUseCusparse(0); +#if defined(HYPRE_USING_CUSPARSE) && CUSPARSE_VERSION >= 11000 + /* CUSPARSE_SPMV_ALG_DEFAULT doesn't provide deterministic results */ + HYPRE_SetSpMVUseVendor(0); +#endif + /* use vendor implementation for SpGEMM */ + HYPRE_SetSpGemmUseVendor(0); +#if defined(HYPRE_USING_SYCL) + HYPRE_SetSpGemmUseVendor(1); +#endif /* use cuRand for PMIS */ HYPRE_SetUseGpuRand(1); #endif /* Set defaults */ solver_id = 3; - maxit = 100; + maxit = 200; + pcg_maxit = 50; tol = 1e-6; dim = 3; coordinates = 0; @@ -155,11 +182,17 @@ hypre_int main (hypre_int argc, char *argv[]) singular_problem = 0; rlx_sweeps = 1; rlx_weight = 1.0; rlx_omega = 1.0; -#if defined(HYPRE_USING_GPU) - cycle_type = 1; amg_coarsen_type = 8; amg_agg_levels = 1; amg_rlx_type = 8; coarse_rlx_type = 8, rlx_type = 2; /* PMIS */ -#else - cycle_type = 1; amg_coarsen_type = 10; amg_agg_levels = 1; amg_rlx_type = 8; coarse_rlx_type = 8, rlx_type = 2; /* HMIS-1 */ -#endif + if (hypre_GetExecPolicy1(memory_location) == HYPRE_EXEC_DEVICE) + { + cycle_type = 1; amg_coarsen_type = 8; amg_agg_levels = 1; amg_rlx_type = 18; + coarse_rlx_type = 18, rlx_type = 1; /* PMIS */ + } + else + { + cycle_type = 1; amg_coarsen_type = 10; amg_agg_levels = 1; amg_rlx_type = 8; + coarse_rlx_type = 8, rlx_type = 2; /* HMIS-1 */ + } + /* cycle_type = 1; amg_coarsen_type = 10; amg_agg_levels = 0; amg_rlx_type = 3; */ /* HMIS-0 */ /* cycle_type = 1; amg_coarsen_type = 8; amg_agg_levels = 1; amg_rlx_type = 3; */ /* PMIS-1 */ /* cycle_type = 1; amg_coarsen_type = 8; amg_agg_levels = 0; amg_rlx_type = 3; */ /* PMIS-0 */ @@ -189,10 +222,15 @@ hypre_int main (hypre_int argc, char *argv[]) arg_index++; maxit = atoi(argv[arg_index++]); } + else if ( strcmp(argv[arg_index], "-pcg_maxit") == 0 ) + { + arg_index++; + pcg_maxit = atoi(argv[arg_index++]); + } else if ( strcmp(argv[arg_index], "-tol") == 0 ) { arg_index++; - tol = atof(argv[arg_index++]); + tol = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-type") == 0 ) { @@ -212,12 +250,12 @@ hypre_int main (hypre_int argc, char *argv[]) else if ( strcmp(argv[arg_index], "-rlxw") == 0 ) { arg_index++; - rlx_weight = atof(argv[arg_index++]); + rlx_weight = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-rlxo") == 0 ) { arg_index++; - rlx_omega = atof(argv[arg_index++]); + rlx_omega = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-ctype") == 0 ) { @@ -272,7 +310,7 @@ hypre_int main (hypre_int argc, char *argv[]) else if ( strcmp(argv[arg_index], "-theta") == 0 ) { arg_index++; - theta = atof(argv[arg_index++]); + theta = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-bsize") == 0 ) { @@ -282,7 +320,7 @@ hypre_int main (hypre_int argc, char *argv[]) else if ( strcmp(argv[arg_index], "-rtol") == 0 ) { arg_index++; - rtol = atof(argv[arg_index++]); + rtol = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-rr") == 0 ) { @@ -306,44 +344,47 @@ hypre_int main (hypre_int argc, char *argv[]) } if (argc == 1) + { print_usage = 1; + } if ((print_usage) && (myid == 0)) { - hypre_printf("\n"); - hypre_printf("Usage: mpirun -np %s []\n", argv[0]); - hypre_printf("\n"); - hypre_printf(" Hypre solvers options: \n"); - hypre_printf(" -solver : solver ID \n"); - hypre_printf(" 0 - AMG \n"); - hypre_printf(" 1 - AMG-PCG \n"); - hypre_printf(" 2 - AMS \n"); - hypre_printf(" 3 - AMS-PCG (default) \n"); - hypre_printf(" 4 - DS-PCG \n"); - hypre_printf(" 5 - AME eigensolver \n"); - hypre_printf(" -maxit : maximum number of iterations (100) \n"); - hypre_printf(" -tol : convergence tolerance (1e-6) \n"); - hypre_printf("\n"); - hypre_printf(" AMS solver options: \n"); - hypre_printf(" -dim : space dimension \n"); - hypre_printf(" -type : 3-level cycle type (0-8, 11-14) \n"); - hypre_printf(" -theta : BoomerAMG threshold (0.25) \n"); - hypre_printf(" -ctype : BoomerAMG coarsening type \n"); - hypre_printf(" -agg : Levels of BoomerAMG agg. coarsening \n"); - hypre_printf(" -amgrlx : BoomerAMG relaxation type \n"); - hypre_printf(" -itype : BoomerAMG interpolation type \n"); - hypre_printf(" -pmax : BoomerAMG interpolation truncation \n"); - hypre_printf(" -rlx : relaxation type \n"); - hypre_printf(" -rlxn : number of relaxation sweeps \n"); - hypre_printf(" -rlxw : damping parameter (usually <=1) \n"); - hypre_printf(" -rlxo : SOR parameter (usuallyin (0,2)) \n"); - hypre_printf(" -coord : use coordinate vectors \n"); - hypre_printf(" -h1 : use block-diag Poisson solves \n"); - hypre_printf(" -sing : curl-curl only (singular) problem \n"); - hypre_printf("\n"); - hypre_printf(" AME eigensolver options: \n"); - hypre_printf(" -bsize : number of eigenvalues to compute \n"); - hypre_printf("\n"); + hypre_printf(" \n"); + hypre_printf("Usage: mpirun -np %s [] \n", argv[0]); + hypre_printf(" \n"); + hypre_printf(" Hypre solvers options: \n"); + hypre_printf(" -solver : solver ID \n"); + hypre_printf(" 0 - AMG \n"); + hypre_printf(" 1 - AMG-PCG \n"); + hypre_printf(" 2 - AMS \n"); + hypre_printf(" 3 - AMS-PCG (default) \n"); + hypre_printf(" 4 - DS-PCG \n"); + hypre_printf(" 5 - AME eigensolver \n"); + hypre_printf(" -maxit : maximum number of iterations (200) \n"); + hypre_printf(" -pcg_maxit : maximum number of PCG iterations (50) \n"); + hypre_printf(" -tol : convergence tolerance (1e-6) \n"); + hypre_printf(" \n"); + hypre_printf(" AMS solver options: \n"); + hypre_printf(" -dim : space dimension \n"); + hypre_printf(" -type : 3-level cycle type (0-8, 11-14) \n"); + hypre_printf(" -theta : BoomerAMG threshold (0.25) \n"); + hypre_printf(" -ctype : BoomerAMG coarsening type \n"); + hypre_printf(" -agg : Levels of BoomerAMG agg. coarsening \n"); + hypre_printf(" -amgrlx : BoomerAMG relaxation type \n"); + hypre_printf(" -itype : BoomerAMG interpolation type \n"); + hypre_printf(" -pmax : BoomerAMG interpolation truncation \n"); + hypre_printf(" -rlx : relaxation type \n"); + hypre_printf(" -rlxn : number of relaxation sweeps \n"); + hypre_printf(" -rlxw : damping parameter (usually <=1) \n"); + hypre_printf(" -rlxo : SOR parameter (usuallyin (0,2)) \n"); + hypre_printf(" -coord : use coordinate vectors \n"); + hypre_printf(" -h1 : use block-diag Poisson solves \n"); + hypre_printf(" -sing : curl-curl only (singular) problem \n"); + hypre_printf(" \n"); + hypre_printf(" AME eigensolver options: \n"); + hypre_printf(" -bsize : number of eigenvalues to compute \n"); + hypre_printf(" \n"); } if (print_usage) @@ -353,6 +394,13 @@ hypre_int main (hypre_int argc, char *argv[]) } } + /* RL: XXX force to use l1-jac for GPU + * TODO: change it back when GPU SpTrSV is fixed */ + if (hypre_GetExecPolicy1(memory_location) == HYPRE_EXEC_DEVICE) + { + amg_rlx_type = 18; + } + AMSDriverMatrixRead("mfem.A", &A); AMSDriverVectorRead("mfem.x0", &x0); AMSDriverVectorRead("mfem.b", &b); @@ -364,7 +412,9 @@ hypre_int main (hypre_int argc, char *argv[]) AMSDriverVectorRead("mfem.Gx", &Gx); AMSDriverVectorRead("mfem.Gy", &Gy); if (dim == 3) + { AMSDriverVectorRead("mfem.Gz", &Gz); + } } /* Vectors x, y and z */ @@ -373,7 +423,9 @@ hypre_int main (hypre_int argc, char *argv[]) AMSDriverVectorRead("mfem.x", &x); AMSDriverVectorRead("mfem.y", &y); if (dim == 3) + { AMSDriverVectorRead("mfem.z", &z); + } } /* Poisson matrices */ @@ -391,7 +443,7 @@ hypre_int main (hypre_int argc, char *argv[]) if (!myid) { hypre_printf("Problem size: %d\n\n", - hypre_ParCSRMatrixGlobalNumRows((hypre_ParCSRMatrix*)A)); + hypre_ParCSRMatrixGlobalNumRows((hypre_ParCSRMatrix*)A)); } hypre_ParCSRMatrixMigrate(A, hypre_HandleMemoryLocation(hypre_handle())); @@ -490,11 +542,15 @@ hypre_int main (hypre_int argc, char *argv[]) /* Vectors Gx, Gy and Gz */ if (!coordinates) - HYPRE_AMSSetEdgeConstantVectors(solver,Gx,Gy,Gz); + { + HYPRE_AMSSetEdgeConstantVectors(solver, Gx, Gy, Gz); + } /* Vectors x, y and z */ if (coordinates) - HYPRE_AMSSetCoordinateVectors(solver,x,y,z); + { + HYPRE_AMSSetCoordinateVectors(solver, x, y, z); + } /* Poisson matrices */ if (h1_method) @@ -504,12 +560,16 @@ hypre_int main (hypre_int argc, char *argv[]) } if (singular_problem) + { HYPRE_AMSSetBetaPoissonMatrix(solver, NULL); + } /* Smoothing and AMG options */ HYPRE_AMSSetSmoothingOptions(solver, rlx_type, rlx_sweeps, rlx_weight, rlx_omega); - HYPRE_AMSSetAlphaAMGOptions(solver, amg_coarsen_type, amg_agg_levels, amg_rlx_type, theta, amg_interp_type, amg_Pmax); - HYPRE_AMSSetBetaAMGOptions(solver, amg_coarsen_type, amg_agg_levels, amg_rlx_type, theta, amg_interp_type, amg_Pmax); + HYPRE_AMSSetAlphaAMGOptions(solver, amg_coarsen_type, amg_agg_levels, amg_rlx_type, theta, + amg_interp_type, amg_Pmax); + HYPRE_AMSSetBetaAMGOptions(solver, amg_coarsen_type, amg_agg_levels, amg_rlx_type, theta, + amg_interp_type, amg_Pmax); HYPRE_AMSSetAlphaAMGCoarseRelaxType(solver, coarse_rlx_type); HYPRE_AMSSetBetaAMGCoarseRelaxType(solver, coarse_rlx_type); @@ -546,11 +606,17 @@ hypre_int main (hypre_int argc, char *argv[]) /* Start timing */ if (solver_id == 1) + { time_index = hypre_InitializeTiming("BoomerAMG-PCG Setup"); + } else if (solver_id == 3) + { time_index = hypre_InitializeTiming("AMS-PCG Setup"); + } else if (solver_id == 4) + { time_index = hypre_InitializeTiming("DS-PCG Setup"); + } hypre_BeginTiming(time_index); /* Create solver */ @@ -600,16 +666,20 @@ hypre_int main (hypre_int argc, char *argv[]) HYPRE_AMSSetInteriorNodes(precond, interior_nodes); HYPRE_AMSSetProjectionFrequency(precond, 5); } - HYPRE_PCGSetResidualTol(solver,rtol); + HYPRE_PCGSetResidualTol(solver, rtol); HYPRE_PCGSetRecomputeResidualP(solver, rr); /* Vectors Gx, Gy and Gz */ if (!coordinates) - HYPRE_AMSSetEdgeConstantVectors(precond,Gx,Gy,Gz); + { + HYPRE_AMSSetEdgeConstantVectors(precond, Gx, Gy, Gz); + } /* Vectors x, y and z */ if (coordinates) - HYPRE_AMSSetCoordinateVectors(precond,x,y,z); + { + HYPRE_AMSSetCoordinateVectors(precond, x, y, z); + } /* Poisson matrices */ if (h1_method) @@ -619,12 +689,16 @@ hypre_int main (hypre_int argc, char *argv[]) } if (singular_problem) + { HYPRE_AMSSetBetaPoissonMatrix(precond, NULL); + } /* Smoothing and AMG options */ HYPRE_AMSSetSmoothingOptions(precond, rlx_type, rlx_sweeps, rlx_weight, rlx_omega); - HYPRE_AMSSetAlphaAMGOptions(precond, amg_coarsen_type, amg_agg_levels, amg_rlx_type, theta, amg_interp_type, amg_Pmax); - HYPRE_AMSSetBetaAMGOptions(precond, amg_coarsen_type, amg_agg_levels, amg_rlx_type, theta, amg_interp_type, amg_Pmax); + HYPRE_AMSSetAlphaAMGOptions(precond, amg_coarsen_type, amg_agg_levels, amg_rlx_type, theta, + amg_interp_type, amg_Pmax); + HYPRE_AMSSetBetaAMGOptions(precond, amg_coarsen_type, amg_agg_levels, amg_rlx_type, theta, + amg_interp_type, amg_Pmax); HYPRE_AMSSetAlphaAMGCoarseRelaxType(precond, coarse_rlx_type); HYPRE_AMSSetBetaAMGCoarseRelaxType(precond, coarse_rlx_type); @@ -655,11 +729,17 @@ hypre_int main (hypre_int argc, char *argv[]) /* Start timing again */ if (solver_id == 1) + { time_index = hypre_InitializeTiming("BoomerAMG-PCG Solve"); + } else if (solver_id == 3) + { time_index = hypre_InitializeTiming("AMS-PCG Solve"); + } else if (solver_id == 4) + { time_index = hypre_InitializeTiming("DS-PCG Solve"); + } hypre_BeginTiming(time_index); /* Solve */ @@ -685,9 +765,13 @@ hypre_int main (hypre_int argc, char *argv[]) /* Destroy solver and preconditioner */ HYPRE_ParCSRPCGDestroy(solver); if (solver_id == 1) + { HYPRE_BoomerAMGDestroy(precond); + } else if (solver_id == 3) + { HYPRE_AMSDestroy(precond); + } } if (solver_id == 5) @@ -710,11 +794,15 @@ hypre_int main (hypre_int argc, char *argv[]) /* Vectors Gx, Gy and Gz */ if (!coordinates) - HYPRE_AMSSetEdgeConstantVectors(precond,Gx,Gy,Gz); + { + HYPRE_AMSSetEdgeConstantVectors(precond, Gx, Gy, Gz); + } /* Vectors x, y and z */ if (coordinates) - HYPRE_AMSSetCoordinateVectors(precond,x,y,z); + { + HYPRE_AMSSetCoordinateVectors(precond, x, y, z); + } /* Poisson matrices */ if (h1_method) @@ -724,12 +812,16 @@ hypre_int main (hypre_int argc, char *argv[]) } if (singular_problem) + { HYPRE_AMSSetBetaPoissonMatrix(precond, NULL); + } /* Smoothing and AMG options */ HYPRE_AMSSetSmoothingOptions(precond, rlx_type, rlx_sweeps, rlx_weight, rlx_omega); - HYPRE_AMSSetAlphaAMGOptions(precond, amg_coarsen_type, amg_agg_levels, amg_rlx_type, theta, amg_interp_type, amg_Pmax); - HYPRE_AMSSetBetaAMGOptions(precond, amg_coarsen_type, amg_agg_levels, amg_rlx_type, theta, amg_interp_type, amg_Pmax); + HYPRE_AMSSetAlphaAMGOptions(precond, amg_coarsen_type, amg_agg_levels, amg_rlx_type, theta, + amg_interp_type, amg_Pmax); + HYPRE_AMSSetBetaAMGOptions(precond, amg_coarsen_type, amg_agg_levels, amg_rlx_type, theta, + amg_interp_type, amg_Pmax); HYPRE_AMSSetAlphaAMGCoarseRelaxType(precond, coarse_rlx_type); HYPRE_AMSSetBetaAMGCoarseRelaxType(precond, coarse_rlx_type); @@ -746,11 +838,16 @@ hypre_int main (hypre_int argc, char *argv[]) /* Set additional parameters */ HYPRE_AMESetMaxIter(solver, maxit); /* max iterations */ + HYPRE_AMESetMaxPCGIter(solver, pcg_maxit); /* max iterations */ HYPRE_AMESetTol(solver, tol); /* conv. tolerance */ if (myid == 0) - HYPRE_AMESetPrintLevel(solver, 1); /* print solve info */ + { + HYPRE_AMESetPrintLevel(solver, 1); /* print solve info */ + } else + { HYPRE_AMESetPrintLevel(solver, 0); + } /* Setup */ HYPRE_AMESetup(solver); @@ -787,21 +884,23 @@ hypre_int main (hypre_int argc, char *argv[]) HYPRE_ParVectorDestroy(b); HYPRE_ParCSRMatrixDestroy(G); - if (M) HYPRE_ParCSRMatrixDestroy(M); + if (M) { HYPRE_ParCSRMatrixDestroy(M); } - if (Gx) HYPRE_ParVectorDestroy(Gx); - if (Gy) HYPRE_ParVectorDestroy(Gy); - if (Gz) HYPRE_ParVectorDestroy(Gz); + if (Gx) { HYPRE_ParVectorDestroy(Gx); } + if (Gy) { HYPRE_ParVectorDestroy(Gy); } + if (Gz) { HYPRE_ParVectorDestroy(Gz); } - if (x) HYPRE_ParVectorDestroy(x); - if (y) HYPRE_ParVectorDestroy(y); - if (z) HYPRE_ParVectorDestroy(z); + if (x) { HYPRE_ParVectorDestroy(x); } + if (y) { HYPRE_ParVectorDestroy(y); } + if (z) { HYPRE_ParVectorDestroy(z); } - if (Aalpha) HYPRE_ParCSRMatrixDestroy(Aalpha); - if (Abeta) HYPRE_ParCSRMatrixDestroy(Abeta); + if (Aalpha) { HYPRE_ParCSRMatrixDestroy(Aalpha); } + if (Abeta) { HYPRE_ParCSRMatrixDestroy(Abeta); } if (zero_cond) + { HYPRE_ParVectorDestroy(interior_nodes); + } /* Finalize Hypre */ HYPRE_Finalize(); @@ -810,7 +909,9 @@ hypre_int main (hypre_int argc, char *argv[]) hypre_MPI_Finalize(); if (HYPRE_GetError() && !myid) - hypre_fprintf(stderr,"hypre_error_flag = %d\n", HYPRE_GetError()); + { + hypre_fprintf(stderr, "hypre_error_flag = %d\n", HYPRE_GetError()); + } return 0; } diff --git a/external/hypre/src/test/checktest.sh b/external/hypre/src/test/checktest.sh old mode 100644 new mode 100755 index 781cf915..f7ea0ab0 --- a/external/hypre/src/test/checktest.sh +++ b/external/hypre/src/test/checktest.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -19,6 +19,8 @@ cat < 1e-8 ) - { - hypre_printf("!!!!! WARNING !!!!! should be zero if correct = %6.10f\n", - ans); - } - else - { - hypre_printf("Matvecs match ( should be zero = %6.10f )\n", - ans); - } - } + if ( fabs(ans) > 1e-8 ) + { + hypre_printf("!!!!! WARNING !!!!! should be zero if correct = %6.10f\n", + ans); + } + else + { + hypre_printf("Matvecs match ( should be zero = %6.10f )\n", + ans); + } + } } @@ -698,20 +700,20 @@ main( HYPRE_Int argc, ours separately until it is incorporated */ - if (commpkg_flag == 3 ) - { + if (commpkg_flag == 3 ) + { hypre_ParVectorDestroy(x_new); hypre_ParVectorDestroy(y); hypre_ParVectorDestroy(y_new); - } + } hypre_MPI_Finalize(); - return(ierr); + return (ierr); } @@ -725,29 +727,30 @@ main( HYPRE_Int argc, * throw away 1st timing *------------------------------------*/ -void stats_mo(HYPRE_Real array[], HYPRE_Int n, HYPRE_Real *Tavg,HYPRE_Real *Tstd) +void stats_mo(HYPRE_Real array[], HYPRE_Int n, HYPRE_Real *Tavg, HYPRE_Real *Tstd) { - HYPRE_Int i; - HYPRE_Real atmp, tmp=0.0; - HYPRE_Real avg = 0.0, std; + HYPRE_Int i; + HYPRE_Real atmp, tmp = 0.0; + HYPRE_Real avg = 0.0, std; - for(i=1; i 1) { - values[0] += 2.0*cx; + values[0] += 2.0 * cx; } if (ny > 1) { - values[0] += 2.0*cy; + values[0] += 2.0 * cy; } if (nz > 1) { - values[0] += 2.0*cz; + values[0] += 2.0 * cz; } A = (HYPRE_ParCSRMatrix) GenerateLaplacian(hypre_MPI_COMM_WORLD, nx, ny, nz, - P, Q, R, p, q, r, values); + P, Q, R, p, q, r, values); hypre_TFree(values, HYPRE_MEMORY_HOST); diff --git a/external/hypre/src/test/ex1_for.c b/external/hypre/src/test/ex1_for.c index 5a9d6972..dd68ebfc 100644 --- a/external/hypre/src/test/ex1_for.c +++ b/external/hypre/src/test/ex1_for.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -45,11 +45,11 @@ HYPRE_Int main (HYPRE_Int argc, char *argv[]) hypre_F90_Obj b; hypre_F90_Obj x; hypre_F90_Obj solver; - HYPRE_Int temp_COMM; - HYPRE_Int one = 1; - HYPRE_Int two = 2; - HYPRE_Int five = 5; - HYPRE_Real tol = 1.e-6; + HYPRE_Int temp_COMM; + HYPRE_Int one = 1; + HYPRE_Int two = 2; + HYPRE_Int five = 5; + HYPRE_Real tol = 1.e-6; #else HYPRE_StructGrid grid; HYPRE_StructStencil stencil; @@ -77,7 +77,7 @@ HYPRE_Int main (HYPRE_Int argc, char *argv[]) /* Add boxes to the grid */ if (myid == 0) { - HYPRE_Int ilower[2]={-3,1}, iupper[2]={-1,2}; + HYPRE_Int ilower[2] = {-3, 1}, iupper[2] = {-1, 2}; #ifdef HYPRE_FORTRAN HYPRE_StructGridSetExtents(&grid, &ilower[0], &iupper[0]); #else @@ -86,7 +86,7 @@ HYPRE_Int main (HYPRE_Int argc, char *argv[]) } else if (myid == 1) { - HYPRE_Int ilower[2]={0,1}, iupper[2]={2,4}; + HYPRE_Int ilower[2] = {0, 1}, iupper[2] = {2, 4}; #ifdef HYPRE_FORTRAN HYPRE_StructGridSetExtents(&grid, &ilower[0], &iupper[0]); #else @@ -116,15 +116,19 @@ HYPRE_Int main (HYPRE_Int argc, char *argv[]) relative offset (in the index space). */ { HYPRE_Int entry; - HYPRE_Int offsets[5][2] = {{0,0}, {-1,0}, {1,0}, {0,-1}, {0,1}}; + HYPRE_Int offsets[5][2] = {{0, 0}, {-1, 0}, {1, 0}, {0, -1}, {0, 1}}; /* Assign each of the 5 stencil entries */ #ifdef HYPRE_FORTRAN for (entry = 0; entry < 5; entry++) + { HYPRE_StructStencilSetElement(&stencil, &entry, offsets[entry]); + } #else for (entry = 0; entry < 5; entry++) + { HYPRE_StructStencilSetElement(stencil, entry, offsets[entry]); + } #endif } } @@ -153,8 +157,8 @@ HYPRE_Int main (HYPRE_Int argc, char *argv[]) the boundary. */ if (myid == 0) { - HYPRE_Int ilower[2]={-3,1}, iupper[2]={-1,2}; - HYPRE_Int stencil_indices[5] = {0,1,2,3,4}; /* labels for the stencil entries - + HYPRE_Int ilower[2] = {-3, 1}, iupper[2] = {-1, 2}; + HYPRE_Int stencil_indices[5] = {0, 1, 2, 3, 4}; /* labels for the stencil entries - these correspond to the offsets defined above */ HYPRE_Int nentries = 5; @@ -166,7 +170,9 @@ HYPRE_Int main (HYPRE_Int argc, char *argv[]) { values[i] = 4.0; for (j = 1; j < nentries; j++) - values[i+j] = -1.0; + { + values[i + j] = -1.0; + } } #ifdef HYPRE_FORTRAN @@ -179,8 +185,8 @@ HYPRE_Int main (HYPRE_Int argc, char *argv[]) } else if (myid == 1) { - HYPRE_Int ilower[2]={0,1}, iupper[2]={2,4}; - HYPRE_Int stencil_indices[5] = {0,1,2,3,4}; + HYPRE_Int ilower[2] = {0, 1}, iupper[2] = {2, 4}; + HYPRE_Int stencil_indices[5] = {0, 1, 2, 3, 4}; HYPRE_Int nentries = 5; HYPRE_Int nvalues = 60; /* 12 grid points, each with 5 stencil entries */ HYPRE_Real values[60]; @@ -189,7 +195,9 @@ HYPRE_Int main (HYPRE_Int argc, char *argv[]) { values[i] = 4.0; for (j = 1; j < nentries; j++) - values[i+j] = -1.0; + { + values[i + j] = -1.0; + } } #ifdef HYPRE_FORTRAN @@ -206,14 +214,16 @@ HYPRE_Int main (HYPRE_Int argc, char *argv[]) { HYPRE_Real values[3]; for (i = 0; i < 3; i++) + { values[i] = 0.0; + } { /* values below our box */ - HYPRE_Int ilower[2]={-3,1}, iupper[2]={-1,1}; + HYPRE_Int ilower[2] = {-3, 1}, iupper[2] = {-1, 1}; HYPRE_Int stencil_indices[1] = {3}; #ifdef HYPRE_FORTRAN HYPRE_StructMatrixSetBoxValues(&A, &ilower[0], &iupper[0], &one, - &stencil_indices[0], &values[0]); + &stencil_indices[0], &values[0]); #else HYPRE_StructMatrixSetBoxValues(A, ilower, iupper, 1, stencil_indices, values); @@ -221,11 +231,11 @@ HYPRE_Int main (HYPRE_Int argc, char *argv[]) } { /* values to the left of our box */ - HYPRE_Int ilower[2]={-3,1}, iupper[2]={-3,2}; + HYPRE_Int ilower[2] = {-3, 1}, iupper[2] = {-3, 2}; HYPRE_Int stencil_indices[1] = {1}; #ifdef HYPRE_FORTRAN HYPRE_StructMatrixSetBoxValues(&A, &ilower[0], &iupper[0], &one, - &stencil_indices[0], &values[0]); + &stencil_indices[0], &values[0]); #else HYPRE_StructMatrixSetBoxValues(A, ilower, iupper, 1, stencil_indices, values); @@ -233,11 +243,11 @@ HYPRE_Int main (HYPRE_Int argc, char *argv[]) } { /* values above our box */ - HYPRE_Int ilower[2]={-3,2}, iupper[2]={-1,2}; + HYPRE_Int ilower[2] = {-3, 2}, iupper[2] = {-1, 2}; HYPRE_Int stencil_indices[1] = {4}; #ifdef HYPRE_FORTRAN HYPRE_StructMatrixSetBoxValues(&A, &ilower[0], &iupper[0], &one, - &stencil_indices[0], &values[0]); + &stencil_indices[0], &values[0]); #else HYPRE_StructMatrixSetBoxValues(A, ilower, iupper, 1, stencil_indices, values); @@ -248,14 +258,16 @@ HYPRE_Int main (HYPRE_Int argc, char *argv[]) { HYPRE_Real values[4]; for (i = 0; i < 4; i++) + { values[i] = 0.0; + } { /* values below our box */ - HYPRE_Int ilower[2]={0,1}, iupper[2]={2,1}; + HYPRE_Int ilower[2] = {0, 1}, iupper[2] = {2, 1}; HYPRE_Int stencil_indices[1] = {3}; #ifdef HYPRE_FORTRAN HYPRE_StructMatrixSetBoxValues(&A, &ilower[0], &iupper[0], &one, - &stencil_indices[0], &values[0]); + &stencil_indices[0], &values[0]); #else HYPRE_StructMatrixSetBoxValues(A, ilower, iupper, 1, stencil_indices, values); @@ -264,11 +276,11 @@ HYPRE_Int main (HYPRE_Int argc, char *argv[]) { /* values to the right of our box (that do not border the other box on proc. 0) */ - HYPRE_Int ilower[2]={2,1}, iupper[2]={2,4}; + HYPRE_Int ilower[2] = {2, 1}, iupper[2] = {2, 4}; HYPRE_Int stencil_indices[1] = {2}; #ifdef HYPRE_FORTRAN HYPRE_StructMatrixSetBoxValues(&A, &ilower[0], &iupper[0], &one, - &stencil_indices[0], &values[0]); + &stencil_indices[0], &values[0]); #else HYPRE_StructMatrixSetBoxValues(A, ilower, iupper, 1, stencil_indices, values); @@ -276,11 +288,11 @@ HYPRE_Int main (HYPRE_Int argc, char *argv[]) } { /* values above our box */ - HYPRE_Int ilower[2]={0,4}, iupper[2]={2,4}; + HYPRE_Int ilower[2] = {0, 4}, iupper[2] = {2, 4}; HYPRE_Int stencil_indices[1] = {4}; #ifdef HYPRE_FORTRAN HYPRE_StructMatrixSetBoxValues(&A, &ilower[0], &iupper[0], &one, - &stencil_indices[0], &values[0]); + &stencil_indices[0], &values[0]); #else HYPRE_StructMatrixSetBoxValues(A, ilower, iupper, 1, stencil_indices, values); @@ -288,11 +300,11 @@ HYPRE_Int main (HYPRE_Int argc, char *argv[]) } { /* values to the left of our box */ - HYPRE_Int ilower[2]={0,3}, iupper[2]={0,4}; + HYPRE_Int ilower[2] = {0, 3}, iupper[2] = {0, 4}; HYPRE_Int stencil_indices[1] = {1}; #ifdef HYPRE_FORTRAN HYPRE_StructMatrixSetBoxValues(&A, &ilower[0], &iupper[0], &one, - &stencil_indices[0], &values[0]); + &stencil_indices[0], &values[0]); #else HYPRE_StructMatrixSetBoxValues(A, ilower, iupper, 1, stencil_indices, values); @@ -333,11 +345,13 @@ HYPRE_Int main (HYPRE_Int argc, char *argv[]) /* Set the vector coefficients */ if (myid == 0) { - HYPRE_Int ilower[2]={-3,1}, iupper[2]={-1,2}; + HYPRE_Int ilower[2] = {-3, 1}, iupper[2] = {-1, 2}; HYPRE_Real values[6]; /* 6 grid points */ for (i = 0; i < 6; i ++) + { values[i] = 1.0; + } #ifdef HYPRE_FORTRAN HYPRE_StructVectorSetBoxValues(&b, &ilower[0], &iupper[0], &values[0]); #else @@ -345,7 +359,9 @@ HYPRE_Int main (HYPRE_Int argc, char *argv[]) #endif for (i = 0; i < 6; i ++) + { values[i] = 0.0; + } #ifdef HYPRE_FORTRAN HYPRE_StructVectorSetBoxValues(&x, &ilower[0], &iupper[0], &values[0]); #else @@ -354,11 +370,13 @@ HYPRE_Int main (HYPRE_Int argc, char *argv[]) } else if (myid == 1) { - HYPRE_Int ilower[2]={0,1}, iupper[2]={2,4}; + HYPRE_Int ilower[2] = {0, 1}, iupper[2] = {2, 4}; HYPRE_Real values[12]; /* 12 grid points */ for (i = 0; i < 12; i ++) + { values[i] = 1.0; + } #ifdef HYPRE_FORTRAN HYPRE_StructVectorSetBoxValues(&b, &ilower[0], &iupper[0], &values[0]); #else @@ -366,7 +384,9 @@ HYPRE_Int main (HYPRE_Int argc, char *argv[]) #endif for (i = 0; i < 12; i ++) + { values[i] = 0.0; + } #ifdef HYPRE_FORTRAN HYPRE_StructVectorSetBoxValues(&x, &ilower[0], &iupper[0], &values[0]); #else diff --git a/external/hypre/src/test/ex3_for.c b/external/hypre/src/test/ex3_for.c index 7cb4dcb5..fb76aeaa 100644 --- a/external/hypre/src/test/ex3_for.c +++ b/external/hypre/src/test/ex3_for.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -74,15 +74,15 @@ HYPRE_Int main (HYPRE_Int argc, char *argv[]) hypre_F90_Obj x; hypre_F90_Obj solver; hypre_F90_Obj precond; - HYPRE_Int temp_COMM; - HYPRE_Int precond_id; - HYPRE_Int zero = 0; - HYPRE_Int one = 1; - HYPRE_Int two = 2; - HYPRE_Int five = 5; - HYPRE_Int fifty = 50; - HYPRE_Real zero_dot = 0.0; - HYPRE_Real tol = 1.e-6; + HYPRE_Int temp_COMM; + HYPRE_Int precond_id; + HYPRE_Int zero = 0; + HYPRE_Int one = 1; + HYPRE_Int two = 2; + HYPRE_Int five = 5; + HYPRE_Int fifty = 50; + HYPRE_Real zero_dot = 0.0; + HYPRE_Real tol = 1.e-6; #else HYPRE_StructGrid grid; HYPRE_StructStencil stencil; @@ -173,19 +173,19 @@ HYPRE_Int main (HYPRE_Int argc, char *argv[]) /* Figure out the processor grid (N x N). The local problem size for the interior nodes is indicated by n (n x n). pi and pj indicate position in the processor grid. */ - N = sqrt(num_procs); - h = 1.0 / (N*n+1); /* note that when calculating h we must + N = hypre_sqrt(num_procs); + h = 1.0 / (N * n + 1); /* note that when calculating h we must remember to count the bounday nodes */ - h2 = h*h; + h2 = h * h; pj = myid / N; - pi = myid - pj*N; + pi = myid - pj * N; - /* Figure out the extents of each processor's piece of the grid. */ - ilower[0] = pi*n; - ilower[1] = pj*n; + /* Figure out the extents of each processor's piece of the grid. */ + ilower[0] = pi * n; + ilower[1] = pj * n; - iupper[0] = ilower[0] + n-1; - iupper[1] = ilower[1] + n-1; + iupper[0] = ilower[0] + n - 1; + iupper[1] = ilower[1] + n - 1; /* 1. Set up a grid */ { @@ -222,10 +222,12 @@ HYPRE_Int main (HYPRE_Int argc, char *argv[]) /* Define the geometry of the stencil */ { HYPRE_Int entry; - HYPRE_Int offsets[5][2] = {{0,0}, {-1,0}, {1,0}, {0,-1}, {0,1}}; + HYPRE_Int offsets[5][2] = {{0, 0}, {-1, 0}, {1, 0}, {0, -1}, {0, 1}}; for (entry = 0; entry < 5; entry++) + { HYPRE_StructStencilSetElement(&stencil, &entry, offsets[entry]); + } } #else /* Create an empty 2D, 5-pt stencil object */ @@ -234,10 +236,12 @@ HYPRE_Int main (HYPRE_Int argc, char *argv[]) /* Define the geometry of the stencil */ { HYPRE_Int entry; - HYPRE_Int offsets[5][2] = {{0,0}, {-1,0}, {1,0}, {0,-1}, {0,1}}; + HYPRE_Int offsets[5][2] = {{0, 0}, {-1, 0}, {1, 0}, {0, -1}, {0, 1}}; for (entry = 0; entry < 5; entry++) + { HYPRE_StructStencilSetElement(stencil, entry, offsets[entry]); + } } #endif } @@ -245,7 +249,7 @@ HYPRE_Int main (HYPRE_Int argc, char *argv[]) /* 3. Set up a Struct Matrix */ { HYPRE_Int nentries = 5; - HYPRE_Int nvalues = nentries*n*n; + HYPRE_Int nvalues = nentries * n * n; HYPRE_Real *values; HYPRE_Int stencil_indices[5]; @@ -260,7 +264,9 @@ HYPRE_Int main (HYPRE_Int argc, char *argv[]) values = hypre_CTAlloc(HYPRE_Real, nvalues, HYPRE_MEMORY_HOST); for (j = 0; j < nentries; j++) + { stencil_indices[j] = j; + } /* Set the standard stencil at each grid point, we will fix the boundaries later */ @@ -268,7 +274,9 @@ HYPRE_Int main (HYPRE_Int argc, char *argv[]) { values[i] = 4.0; for (j = 1; j < nentries; j++) - values[i+j] = -1.0; + { + values[i + j] = -1.0; + } } HYPRE_StructMatrixSetBoxValues(&A, ilower, iupper, &nentries, @@ -285,7 +293,9 @@ HYPRE_Int main (HYPRE_Int argc, char *argv[]) values = hypre_CTAlloc(HYPRE_Real, nvalues, HYPRE_MEMORY_HOST); for (j = 0; j < nentries; j++) + { stencil_indices[j] = j; + } /* Set the standard stencil at each grid point, we will fix the boundaries later */ @@ -293,7 +303,9 @@ HYPRE_Int main (HYPRE_Int argc, char *argv[]) { values[i] = 4.0; for (j = 1; j < nentries; j++) - values[i+j] = -1.0; + { + values[i + j] = -1.0; + } } HYPRE_StructMatrixSetBoxValues(A, ilower, iupper, nentries, @@ -310,23 +322,25 @@ HYPRE_Int main (HYPRE_Int argc, char *argv[]) HYPRE_Int bc_ilower[2]; HYPRE_Int bc_iupper[2]; HYPRE_Int nentries = 1; - HYPRE_Int nvalues = nentries*n; /* number of stencil entries times the length + HYPRE_Int nvalues = nentries * n; /* number of stencil entries times the length of one side of my grid box */ HYPRE_Real *values; HYPRE_Int stencil_indices[1]; values = hypre_CTAlloc(HYPRE_Real, nvalues, HYPRE_MEMORY_HOST); for (j = 0; j < nvalues; j++) - values[j] = 0.0; + { + values[j] = 0.0; + } /* Recall: pi and pj describe position in the processor grid */ if (pj == 0) { /* bottom row of grid points */ - bc_ilower[0] = pi*n; - bc_ilower[1] = pj*n; + bc_ilower[0] = pi * n; + bc_ilower[1] = pj * n; - bc_iupper[0] = bc_ilower[0] + n-1; + bc_iupper[0] = bc_ilower[0] + n - 1; bc_iupper[1] = bc_ilower[1]; stencil_indices[0] = 3; @@ -340,13 +354,13 @@ HYPRE_Int main (HYPRE_Int argc, char *argv[]) #endif } - if (pj == N-1) + if (pj == N - 1) { /* upper row of grid points */ - bc_ilower[0] = pi*n; - bc_ilower[1] = pj*n + n-1; + bc_ilower[0] = pi * n; + bc_ilower[1] = pj * n + n - 1; - bc_iupper[0] = bc_ilower[0] + n-1; + bc_iupper[0] = bc_ilower[0] + n - 1; bc_iupper[1] = bc_ilower[1]; stencil_indices[0] = 4; @@ -363,11 +377,11 @@ HYPRE_Int main (HYPRE_Int argc, char *argv[]) if (pi == 0) { /* left row of grid points */ - bc_ilower[0] = pi*n; - bc_ilower[1] = pj*n; + bc_ilower[0] = pi * n; + bc_ilower[1] = pj * n; bc_iupper[0] = bc_ilower[0]; - bc_iupper[1] = bc_ilower[1] + n-1; + bc_iupper[1] = bc_ilower[1] + n - 1; stencil_indices[0] = 1; @@ -380,14 +394,14 @@ HYPRE_Int main (HYPRE_Int argc, char *argv[]) #endif } - if (pi == N-1) + if (pi == N - 1) { /* right row of grid points */ - bc_ilower[0] = pi*n + n-1; - bc_ilower[1] = pj*n; + bc_ilower[0] = pi * n + n - 1; + bc_ilower[1] = pj * n; bc_iupper[0] = bc_ilower[0]; - bc_iupper[1] = bc_ilower[1] + n-1; + bc_iupper[1] = bc_ilower[1] + n - 1; stencil_indices[0] = 2; @@ -413,7 +427,7 @@ HYPRE_Int main (HYPRE_Int argc, char *argv[]) /* 5. Set up Struct Vectors for b and x */ { - HYPRE_Int nvalues = n*n; + HYPRE_Int nvalues = n * n; HYPRE_Real *values; values = hypre_CTAlloc(HYPRE_Real, nvalues, HYPRE_MEMORY_HOST); @@ -437,9 +451,11 @@ HYPRE_Int main (HYPRE_Int argc, char *argv[]) HYPRE_StructVectorInitialize(x); #endif - /* Set the values */ + /* Set the values */ for (i = 0; i < nvalues; i ++) + { values[i] = h2; + } #ifdef HYPRE_FORTRAN HYPRE_StructVectorSetBoxValues(&b, ilower, iupper, values); #else @@ -447,7 +463,9 @@ HYPRE_Int main (HYPRE_Int argc, char *argv[]) #endif for (i = 0; i < nvalues; i ++) + { values[i] = 0.0; + } #ifdef HYPRE_FORTRAN HYPRE_StructVectorSetBoxValues(&x, ilower, iupper, values); #else @@ -522,7 +540,7 @@ HYPRE_Int main (HYPRE_Int argc, char *argv[]) /* Set the preconditioner and solve */ HYPRE_StructPCGSetPrecond(solver, HYPRE_StructSMGSolve, - HYPRE_StructSMGSetup, precond); + HYPRE_StructSMGSetup, precond); HYPRE_StructPCGSetup(solver, A, b, x); HYPRE_StructPCGSolve(solver, A, b, x); @@ -586,10 +604,14 @@ HYPRE_Int main (HYPRE_Int argc, char *argv[]) /* Print the solution and other info */ #ifdef HYPRE_FORTRAN if (print_solution) + { HYPRE_StructVectorPrint(&x, &zero); + } #else if (print_solution) + { HYPRE_StructVectorPrint("struct.out.x", x, 0); + } #endif if (myid == 0) diff --git a/external/hypre/src/test/ex5_for.c b/external/hypre/src/test/ex5_for.c index 824d0267..fedd167c 100644 --- a/external/hypre/src/test/ex5_for.c +++ b/external/hypre/src/test/ex5_for.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -62,19 +62,19 @@ HYPRE_Int main (HYPRE_Int argc, char *argv[]) hypre_F90_Obj solver, precond; hypre_F90_Obj long_temp_COMM; - HYPRE_Int temp_COMM; - HYPRE_Int precond_id; + HYPRE_Int temp_COMM; + HYPRE_Int precond_id; - HYPRE_Int one = 1; - HYPRE_Int two = 2; - HYPRE_Int three = 3; - HYPRE_Int six = 6; - HYPRE_Int twenty = 20; - HYPRE_Int thousand = 1000; - HYPRE_Int hypre_type = HYPRE_PARCSR; + HYPRE_Int one = 1; + HYPRE_Int two = 2; + HYPRE_Int three = 3; + HYPRE_Int six = 6; + HYPRE_Int twenty = 20; + HYPRE_Int thousand = 1000; + HYPRE_Int hypre_type = HYPRE_PARCSR; - HYPRE_Real oo1 = 1.e-3; - HYPRE_Real tol = 1.e-7; + HYPRE_Real oo1 = 1.e-3; + HYPRE_Real tol = 1.e-7; #else HYPRE_IJMatrix A; HYPRE_ParCSRMatrix parcsr_A; @@ -152,22 +152,22 @@ HYPRE_Int main (HYPRE_Int argc, char *argv[]) } /* Preliminaries: want at least one processor per row */ - if (n*n < num_procs) n = sqrt(num_procs) + 1; - N = n*n; /* global number of rows */ - h = 1.0/(n+1); /* mesh size*/ - h2 = h*h; + if (n * n < num_procs) { n = hypre_sqrt(num_procs) + 1; } + N = n * n; /* global number of rows */ + h = 1.0 / (n + 1); /* mesh size*/ + h2 = h * h; /* Each processor knows only of its own rows - the range is denoted by ilower and upper. Here we partition the rows. We account for the fact that N may not divide evenly by the number of processors. */ - local_size = N/num_procs; - extra = N - local_size*num_procs; + local_size = N / num_procs; + extra = N - local_size * num_procs; - ilower = local_size*myid; + ilower = local_size * myid; ilower += hypre_min(myid, extra); - iupper = local_size*(myid+1); - iupper += hypre_min(myid+1, extra); + iupper = local_size * (myid + 1); + iupper += hypre_min(myid + 1, extra); iupper = iupper - 1; /* How many rows do I have? */ @@ -217,17 +217,17 @@ HYPRE_Int main (HYPRE_Int argc, char *argv[]) nnz = 0; /* The left identity block:position i-n */ - if ((i-n)>=0) + if ((i - n) >= 0) { - cols[nnz] = i-n; + cols[nnz] = i - n; values[nnz] = -1.0; nnz++; } /* The left -1: position i-1 */ - if (i%n) + if (i % n) { - cols[nnz] = i-1; + cols[nnz] = i - 1; values[nnz] = -1.0; nnz++; } @@ -238,17 +238,17 @@ HYPRE_Int main (HYPRE_Int argc, char *argv[]) nnz++; /* The right -1: position i+1 */ - if ((i+1)%n) + if ((i + 1) % n) { - cols[nnz] = i+1; + cols[nnz] = i + 1; values[nnz] = -1.0; nnz++; } /* The right identity block:position i+n */ - if ((i+n)< N) + if ((i + n) < N) { - cols[nnz] = i+n; + cols[nnz] = i + n; values[nnz] = -1.0; nnz++; } @@ -283,7 +283,7 @@ HYPRE_Int main (HYPRE_Int argc, char *argv[]) HYPRE_IJVectorSetObjectType(&b, &hypre_type); HYPRE_IJVectorInitialize(&b); #else - HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, ilower, iupper,&b); + HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, ilower, iupper, &b); HYPRE_IJVectorSetObjectType(b, HYPRE_PARCSR); HYPRE_IJVectorInitialize(b); #endif @@ -293,7 +293,7 @@ HYPRE_Int main (HYPRE_Int argc, char *argv[]) HYPRE_IJVectorSetObjectType(&x, &hypre_type); HYPRE_IJVectorInitialize(&x); #else - HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, ilower, iupper,&x); + HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, ilower, iupper, &x); HYPRE_IJVectorSetObjectType(x, HYPRE_PARCSR); HYPRE_IJVectorInitialize(x); #endif @@ -307,7 +307,7 @@ HYPRE_Int main (HYPRE_Int argc, char *argv[]) x_values = hypre_CTAlloc(HYPRE_Real, local_size, HYPRE_MEMORY_HOST); rows = hypre_CTAlloc(HYPRE_Int, local_size, HYPRE_MEMORY_HOST); - for (i=0; iparameters(nParams, paramStrings); - for (i = 0; i < nParams; i++) delete [] paramStrings[i]; + for (i = 0; i < nParams; i++) { delete [] paramStrings[i]; } delete [] paramStrings; /*----------------------------------------------------------- * set up the finite element interface *-----------------------------------------------------------*/ - + setupFEProblem(feiPtr); /*----------------------------------------------------------- @@ -175,7 +179,7 @@ HYPRE_Int main(HYPRE_Int argc, char *argv[]) HYPRE_Int setupFEProblem(LLNL_FEI_Impl *feiPtr) { HYPRE_Int nprocs, mypid, nElems, elemNNodes, **elemConn, startRow, endRow; - HYPRE_Int *partition, *iArray, i, j, nBCs, *BCEqn, nFields, *fieldSizes; + HYPRE_Int *partition, *iArray, i, j, nBCs, *BCEqn, nFields, *fieldSizes; HYPRE_Int *fieldIDs, elemBlkID, elemDOF, elemFormat, interleave; HYPRE_Int *nodeNFields, **nodeFieldIDs, nShared, *sharedIDs, *sharedLengs; HYPRE_Int **sharedProcs; @@ -192,7 +196,7 @@ HYPRE_Int setupFEProblem(LLNL_FEI_Impl *feiPtr) * read finite element connectivities and stiffness matrices *-----------------------------------------------------------*/ - readFEMatrix(&nElems,&elemNNodes,&elemConn,&elemStiff,&startRow,&endRow); + readFEMatrix(&nElems, &elemNNodes, &elemConn, &elemStiff, &startRow, &endRow); elemLoad = new HYPRE_Real[nElems * elemNNodes]; readFERhs(nElems, elemNNodes, elemLoad); @@ -202,10 +206,10 @@ HYPRE_Int setupFEProblem(LLNL_FEI_Impl *feiPtr) partition = new HYPRE_Int[nprocs]; iArray = new HYPRE_Int[nprocs]; - for (i = 0; i < nprocs; i++) iArray[i] = 0; + for (i = 0; i < nprocs; i++) { iArray[i] = 0; } iArray[mypid] = endRow - startRow + 1; - hypre_MPI_Allreduce(iArray,partition,nprocs,HYPRE_MPI_INT,hypre_MPI_SUM,hypre_MPI_COMM_WORLD); - for (i = 1; i < nprocs; i++) partition[i] += partition[i-1]; + hypre_MPI_Allreduce(iArray, partition, nprocs, HYPRE_MPI_INT, hypre_MPI_SUM, hypre_MPI_COMM_WORLD); + for (i = 1; i < nprocs; i++) { partition[i] += partition[i - 1]; } delete [] iArray; /*----------------------------------------------------------- @@ -228,11 +232,11 @@ HYPRE_Int setupFEProblem(LLNL_FEI_Impl *feiPtr) elemFormat = 0; interleave = 0; nodeNFields = new HYPRE_Int[elemNNodes]; - for (i = 0; i < elemNNodes; i++) nodeNFields[i] = 1; + for (i = 0; i < elemNNodes; i++) { nodeNFields[i] = 1; } nodeFieldIDs = new HYPRE_Int*[elemNNodes]; - for (i = 0; i < elemNNodes; i++) + for (i = 0; i < elemNNodes; i++) { - nodeFieldIDs[i] = new HYPRE_Int[1]; + nodeFieldIDs[i] = new HYPRE_Int[1]; nodeFieldIDs[i][0] = 0; } @@ -240,7 +244,7 @@ HYPRE_Int setupFEProblem(LLNL_FEI_Impl *feiPtr) * compose shared node list *-----------------------------------------------------------*/ - composeSharedNodes(nElems,elemNNodes,elemConn,partition,&nShared, + composeSharedNodes(nElems, elemNNodes, elemConn, partition, &nShared, &sharedIDs, &sharedLengs, &sharedProcs); /*----------------------------------------------------------- @@ -248,35 +252,37 @@ HYPRE_Int setupFEProblem(LLNL_FEI_Impl *feiPtr) *-----------------------------------------------------------*/ feiPtr->initFields(nFields, fieldSizes, fieldIDs); - feiPtr->initElemBlock(elemBlkID, nElems, elemNNodes, nodeNFields, + feiPtr->initElemBlock(elemBlkID, nElems, elemNNodes, nodeNFields, nodeFieldIDs, elemDOF, NULL, interleave); - for (i = 0; i < nElems; i++) feiPtr->initElem(elemBlkID, i, elemConn[i]); + for (i = 0; i < nElems; i++) { feiPtr->initElem(elemBlkID, i, elemConn[i]); } if (nShared > 0) + { feiPtr->initSharedNodes(nShared, sharedIDs, sharedLengs, sharedProcs); + } feiPtr->initComplete(); feiPtr->loadNodeBCs(nBCs, BCEqn, fieldIDs[0], alpha, beta, gamma); - for (i = 0; i < nElems; i++) + for (i = 0; i < nElems; i++) { - feiPtr->sumInElem(elemBlkID,i,elemConn[i], elemStiff[i], - &(elemLoad[i*elemNNodes]), elemFormat); + feiPtr->sumInElem(elemBlkID, i, elemConn[i], elemStiff[i], + &(elemLoad[i * elemNNodes]), elemFormat); } feiPtr->loadComplete(); /*----------------------------------------------------------- * clean up *-----------------------------------------------------------*/ - - for (i = 0; i < nElems; i++) delete [] elemConn[i]; + + for (i = 0; i < nElems; i++) { delete [] elemConn[i]; } delete [] elemConn; - for (i = 0; i < nElems; i++) + for (i = 0; i < nElems; i++) { - for (j = 0; j < elemNNodes; j++) delete [] elemStiff[i][j]; + for (j = 0; j < elemNNodes; j++) { delete [] elemStiff[i][j]; } delete [] elemStiff[i]; } delete [] elemStiff; delete [] partition; delete [] BCEqn; - for (i = 0; i < nBCs; i++) + for (i = 0; i < nBCs; i++) { delete [] alpha[i]; delete [] beta[i]; @@ -286,14 +292,14 @@ HYPRE_Int setupFEProblem(LLNL_FEI_Impl *feiPtr) delete [] beta; delete [] gamma; delete [] nodeNFields; - for (i = 0; i < elemNNodes; i++) delete [] nodeFieldIDs[i]; + for (i = 0; i < elemNNodes; i++) { delete [] nodeFieldIDs[i]; } delete [] nodeFieldIDs; delete [] elemLoad; if (nShared > 0) { delete [] sharedIDs; delete [] sharedLengs; - for (i = 0; i < nShared; i++) delete [] sharedProcs[i]; + for (i = 0; i < nShared; i++) { delete [] sharedProcs[i]; } delete [] sharedProcs; } return 0; @@ -303,7 +309,7 @@ HYPRE_Int setupFEProblem(LLNL_FEI_Impl *feiPtr) * read finite element matrices *--------------------------------------------------------------------------*/ HYPRE_Int readFEMatrix(HYPRE_Int *nElemsOut, HYPRE_Int *elemNNodesOut, HYPRE_Int ***elemConnOut, - HYPRE_Real ****elemStiffOut, HYPRE_Int *startRowOut, HYPRE_Int *endRowOut) + HYPRE_Real ****elemStiffOut, HYPRE_Int *startRowOut, HYPRE_Int *endRowOut) { HYPRE_Int mypid, nElems, elemNNodes, startRow, endRow, **elemConn, i, j, k; HYPRE_Real ***elemStiff; @@ -316,22 +322,24 @@ HYPRE_Int readFEMatrix(HYPRE_Int *nElemsOut, HYPRE_Int *elemNNodesOut, HYPRE_Int fp = fopen(paramString, "r"); if (fp == NULL) { - hypre_printf("%3d : feiTest ERROR - sfei file does not exist.\n",mypid); + hypre_printf("%3d : feiTest ERROR - sfei file does not exist.\n", mypid); exit(1); } - hypre_fscanf(fp,"%d %d %d %d", &nElems, &elemNNodes, &startRow, &endRow); + hypre_fscanf(fp, "%d %d %d %d", &nElems, &elemNNodes, &startRow, &endRow); elemConn = new HYPRE_Int*[nElems]; elemStiff = new HYPRE_Real**[nElems]; - for (i = 0; i < nElems; i++) + for (i = 0; i < nElems; i++) { elemConn[i] = new HYPRE_Int[elemNNodes]; elemStiff[i] = new HYPRE_Real*[elemNNodes]; - for (j = 0; j < elemNNodes; j++) hypre_fscanf(fp,"%d", &(elemConn[i][j])); - for (j = 0; j < elemNNodes; j++) + for (j = 0; j < elemNNodes; j++) { hypre_fscanf(fp, "%d", &(elemConn[i][j])); } + for (j = 0; j < elemNNodes; j++) { elemStiff[i][j] = new HYPRE_Real[elemNNodes]; - for (k = 0; k < elemNNodes; k++) - hypre_fscanf(fp,"%lg", &(elemStiff[i][j][k])); + for (k = 0; k < elemNNodes; k++) + { + hypre_fscanf(fp, "%lg", &(elemStiff[i][j][k])); + } } } fclose(fp); @@ -360,11 +368,11 @@ HYPRE_Int readFERhs(HYPRE_Int nElems, HYPRE_Int elemNNodes, HYPRE_Real *elemLoad fp = fopen(paramString, "r"); if (fp == NULL) { - hypre_printf("%3d : feiTest ERROR - rhs file does not exist.\n",mypid); + hypre_printf("%3d : feiTest ERROR - rhs file does not exist.\n", mypid); exit(1); } length = nElems * elemNNodes; - for (i = 0; i < length; i++) hypre_fscanf(fp,"%lg",&(elemLoad[i])); + for (i = 0; i < length; i++) { hypre_fscanf(fp, "%lg", &(elemLoad[i])); } fclose(fp); delete [] paramString; return 0; @@ -373,10 +381,10 @@ HYPRE_Int readFERhs(HYPRE_Int nElems, HYPRE_Int elemNNodes, HYPRE_Real *elemLoad /*************************************************************************** * read BC from file *--------------------------------------------------------------------------*/ -HYPRE_Int readFEMBC(HYPRE_Int *nBCsOut, HYPRE_Int **BCEqnOut, HYPRE_Real ***alphaOut, - HYPRE_Real ***betaOut, HYPRE_Real ***gammaOut) +HYPRE_Int readFEMBC(HYPRE_Int *nBCsOut, HYPRE_Int **BCEqnOut, HYPRE_Real ***alphaOut, + HYPRE_Real ***betaOut, HYPRE_Real ***gammaOut) { - HYPRE_Int mypid, nBCs=0, *BCEqn, i; + HYPRE_Int mypid, nBCs = 0, *BCEqn, i; HYPRE_Real **alpha, **beta, **gamma; char *paramString; FILE *fp; @@ -387,30 +395,30 @@ HYPRE_Int readFEMBC(HYPRE_Int *nBCsOut, HYPRE_Int **BCEqnOut, HYPRE_Real ***alph fp = fopen(paramString, "r"); if (fp == NULL) { - hypre_printf("%3d : feiTest ERROR - BC file does not exist.\n",mypid); + hypre_printf("%3d : feiTest ERROR - BC file does not exist.\n", mypid); exit(1); } - hypre_fscanf(fp,"%d", &nBCs); + hypre_fscanf(fp, "%d", &nBCs); BCEqn = new HYPRE_Int[nBCs]; alpha = new HYPRE_Real*[nBCs]; beta = new HYPRE_Real*[nBCs]; gamma = new HYPRE_Real*[nBCs]; - for (i = 0; i < nBCs; i++) + for (i = 0; i < nBCs; i++) { alpha[i] = new HYPRE_Real[1]; beta[i] = new HYPRE_Real[1]; gamma[i] = new HYPRE_Real[1]; } - for (i = 0; i < nBCs; i++) - hypre_fscanf(fp,"%d %lg %lg %lg",&(BCEqn[i]),&(alpha[i][0]), - &(beta[i][0]),&(gamma[i][0])); + for (i = 0; i < nBCs; i++) + hypre_fscanf(fp, "%d %lg %lg %lg", &(BCEqn[i]), &(alpha[i][0]), + &(beta[i][0]), &(gamma[i][0])); fclose(fp); delete [] paramString; (*nBCsOut) = nBCs; (*BCEqnOut) = BCEqn; - (*alphaOut) = alpha; - (*betaOut) = beta; - (*gammaOut) = gamma; + (*alphaOut) = alpha; + (*betaOut) = beta; + (*gammaOut) = gamma; return 0; } @@ -419,8 +427,8 @@ HYPRE_Int readFEMBC(HYPRE_Int *nBCsOut, HYPRE_Int **BCEqnOut, HYPRE_Real ***alph *--------------------------------------------------------------------------*/ HYPRE_Int composeSharedNodes(HYPRE_Int nElems, HYPRE_Int elemNNodes, HYPRE_Int **elemConn, - HYPRE_Int *partition, HYPRE_Int *nSharedOut, HYPRE_Int **sharedIDsOut, - HYPRE_Int **sharedLengsOut, HYPRE_Int ***sharedProcsOut) + HYPRE_Int *partition, HYPRE_Int *nSharedOut, HYPRE_Int **sharedIDsOut, + HYPRE_Int **sharedLengsOut, HYPRE_Int ***sharedProcsOut) { HYPRE_Int nShared, i, j, index, startRow, endRow, mypid, nprocs, ncnt; HYPRE_Int *sharedIDs, *iArray1, *iArray2, **iRecvBufs, **iSendBufs; @@ -432,10 +440,10 @@ HYPRE_Int composeSharedNodes(HYPRE_Int nElems, HYPRE_Int elemNNodes, HYPRE_Int * hypre_MPI_Comm_size(hypre_MPI_COMM_WORLD, &nprocs); hypre_MPI_Comm_rank(hypre_MPI_COMM_WORLD, &mypid); - if (mypid == 0) startRow = 0; - else startRow = partition[mypid-1]; + if (mypid == 0) { startRow = 0; } + else { startRow = partition[mypid - 1]; } endRow = partition[mypid] - 1; - + /* --- get a rough count of nShared --- */ nShared = 0; @@ -444,13 +452,13 @@ HYPRE_Int composeSharedNodes(HYPRE_Int nElems, HYPRE_Int elemNNodes, HYPRE_Int * for (j = 0; j < elemNNodes; j++) { index = elemConn[i][j]; - if (index < startRow || index > endRow) nShared++; + if (index < startRow || index > endRow) { nShared++; } } } /* --- allocate and fill sharedIDs array, then sort and compress --- */ - if (nShared <= 0) sharedIDs = NULL; + if (nShared <= 0) { sharedIDs = NULL; } else { sharedIDs = new HYPRE_Int[nShared]; @@ -460,43 +468,47 @@ HYPRE_Int composeSharedNodes(HYPRE_Int nElems, HYPRE_Int elemNNodes, HYPRE_Int * for (j = 0; j < elemNNodes; j++) { index = elemConn[i][j]; - if (index < startRow || index > endRow) + if (index < startRow || index > endRow) + { sharedIDs[nShared++] = index; + } } } - hypre_qsort0(sharedIDs, 0, nShared-1); + hypre_qsort0(sharedIDs, 0, nShared - 1); ncnt = 1; for (i = 1; i < nShared; i++) { - if (sharedIDs[i] != sharedIDs[ncnt-1]) + if (sharedIDs[i] != sharedIDs[ncnt - 1]) + { sharedIDs[ncnt++] = sharedIDs[i]; + } } nShared = ncnt; - } + } /* --- tabulate recv processors and send processors --- */ iArray1 = new HYPRE_Int[nprocs]; iArray2 = new HYPRE_Int[nprocs]; - for (i = 0; i < nprocs; i++) iArray1[i] = 0; + for (i = 0; i < nprocs; i++) { iArray1[i] = 0; } for (i = 0; i < nShared; i++) { for (j = 0; j < nprocs; j++) - if (sharedIDs[i] < partition[j]) break; - if (j != mypid) iArray1[j] = 1; - } - hypre_MPI_Allreduce(iArray1,iArray2,nprocs,HYPRE_MPI_INT,hypre_MPI_SUM,hypre_MPI_COMM_WORLD); - for (i = 0; i < nprocs; i++) iArray1[i] = 0; + if (sharedIDs[i] < partition[j]) { break; } + if (j != mypid) { iArray1[j] = 1; } + } + hypre_MPI_Allreduce(iArray1, iArray2, nprocs, HYPRE_MPI_INT, hypre_MPI_SUM, hypre_MPI_COMM_WORLD); + for (i = 0; i < nprocs; i++) { iArray1[i] = 0; } for (i = 0; i < nShared; i++) { for (j = 0; j < nprocs; j++) - if (sharedIDs[i] < partition[j]) break; - if (j != mypid) iArray1[j]++; - } + if (sharedIDs[i] < partition[j]) { break; } + if (j != mypid) { iArray1[j]++; } + } nSends = 0; for (i = 0; i < nprocs; i++) - if (iArray1[i] != 0) nSends++; + if (iArray1[i] != 0) { nSends++; } if (nSends > 0) { sendLengs = new HYPRE_Int[nSends]; @@ -504,7 +516,7 @@ HYPRE_Int composeSharedNodes(HYPRE_Int nElems, HYPRE_Int elemNNodes, HYPRE_Int * nSends = 0; for (i = 0; i < nprocs; i++) { - if (iArray1[i] != 0) + if (iArray1[i] != 0) { sendLengs[nSends] = iArray1[i]; sendProcs[nSends++] = i; @@ -520,11 +532,11 @@ HYPRE_Int composeSharedNodes(HYPRE_Int nElems, HYPRE_Int elemNNodes, HYPRE_Int * } for (i = 0; i < nRecvs; i++) - hypre_MPI_Irecv(&(recvLengs[i]), 1, HYPRE_MPI_INT, hypre_MPI_ANY_SOURCE, 12233, - hypre_MPI_COMM_WORLD, &(mpiRequests[i])); + hypre_MPI_Irecv(&(recvLengs[i]), 1, HYPRE_MPI_INT, hypre_MPI_ANY_SOURCE, 12233, + hypre_MPI_COMM_WORLD, &(mpiRequests[i])); for (i = 0; i < nSends; i++) - hypre_MPI_Send(&(sendLengs[i]), 1, HYPRE_MPI_INT, sendProcs[i], 12233, - hypre_MPI_COMM_WORLD); + hypre_MPI_Send(&(sendLengs[i]), 1, HYPRE_MPI_INT, sendProcs[i], 12233, + hypre_MPI_COMM_WORLD); for (i = 0; i < nRecvs; i++) { hypre_MPI_Wait(&(mpiRequests[i]), &mpiStatus); @@ -533,14 +545,14 @@ HYPRE_Int composeSharedNodes(HYPRE_Int nElems, HYPRE_Int elemNNodes, HYPRE_Int * /* get the shared nodes */ - if (nRecvs > 0) iRecvBufs = new HYPRE_Int*[nRecvs]; + if (nRecvs > 0) { iRecvBufs = new HYPRE_Int*[nRecvs]; } for (i = 0; i < nRecvs; i++) { iRecvBufs[i] = new HYPRE_Int[recvLengs[i]]; - hypre_MPI_Irecv(iRecvBufs[i], recvLengs[i], HYPRE_MPI_INT, recvProcs[i], 12234, - hypre_MPI_COMM_WORLD, &(mpiRequests[i])); + hypre_MPI_Irecv(iRecvBufs[i], recvLengs[i], HYPRE_MPI_INT, recvProcs[i], 12234, + hypre_MPI_COMM_WORLD, &(mpiRequests[i])); } - if (nSends > 0) iSendBufs = new HYPRE_Int*[nSends]; + if (nSends > 0) { iSendBufs = new HYPRE_Int*[nSends]; } for (i = 0; i < nSends; i++) { iSendBufs[i] = new HYPRE_Int[sendLengs[i]]; @@ -549,32 +561,32 @@ HYPRE_Int composeSharedNodes(HYPRE_Int nElems, HYPRE_Int elemNNodes, HYPRE_Int * for (i = 0; i < nShared; i++) { for (j = 0; j < nprocs; j++) - if (sharedIDs[i] < partition[j]) break; + if (sharedIDs[i] < partition[j]) { break; } iSendBufs[j][sendLengs[j]++] = sharedIDs[i]; } for (i = 0; i < nSends; i++) - hypre_MPI_Send(iSendBufs[i],sendLengs[i],HYPRE_MPI_INT,sendProcs[i],12234, - hypre_MPI_COMM_WORLD); - for (i = 0; i < nRecvs; i++) hypre_MPI_Wait(&(mpiRequests[i]), &mpiStatus); + hypre_MPI_Send(iSendBufs[i], sendLengs[i], HYPRE_MPI_INT, sendProcs[i], 12234, + hypre_MPI_COMM_WORLD); + for (i = 0; i < nRecvs; i++) { hypre_MPI_Wait(&(mpiRequests[i]), &mpiStatus); } /* --- finally construct the shared information --- */ ncnt = nShared; - for (i = 0; i < nRecvs; i++) ncnt += recvLengs[i]; + for (i = 0; i < nRecvs; i++) { ncnt += recvLengs[i]; } (*nSharedOut) = ncnt; (*sharedIDsOut) = new HYPRE_Int[ncnt]; (*sharedLengsOut) = new HYPRE_Int[ncnt]; (*sharedProcsOut) = new HYPRE_Int*[ncnt]; - for (i = 0; i < ncnt; i++) (*sharedProcsOut)[i] = new HYPRE_Int[2]; + for (i = 0; i < ncnt; i++) { (*sharedProcsOut)[i] = new HYPRE_Int[2]; } for (i = 0; i < nShared; i++) { (*sharedIDsOut)[i] = sharedIDs[i]; for (j = 0; j < nprocs; j++) - if (sharedIDs[i] < partition[j]) break; + if (sharedIDs[i] < partition[j]) { break; } (*sharedLengsOut)[i] = 2; (*sharedProcsOut)[i][0] = j; (*sharedProcsOut)[i][1] = mypid; - } + } ncnt = nShared; for (i = 0; i < nRecvs; i++) { @@ -587,23 +599,23 @@ HYPRE_Int composeSharedNodes(HYPRE_Int nElems, HYPRE_Int elemNNodes, HYPRE_Int * (*sharedProcsOut)[ncnt][1] = recvProcs[i]; ncnt++; } - } + } /* --- finally clean up --- */ - - if (nShared > 0) delete [] sharedIDs; + + if (nShared > 0) { delete [] sharedIDs; } if (nSends > 0) { delete [] sendProcs; delete [] sendLengs; - for (i = 0; i < nSends; i++) delete [] iSendBufs[i]; + for (i = 0; i < nSends; i++) { delete [] iSendBufs[i]; } delete [] iSendBufs; } if (nRecvs > 0) { delete [] recvProcs; delete [] recvLengs; - for (i = 0; i < nRecvs; i++) delete [] iRecvBufs[i]; + for (i = 0; i < nRecvs; i++) { delete [] iRecvBufs[i]; } delete [] iRecvBufs; delete [] mpiRequests; } @@ -611,4 +623,4 @@ HYPRE_Int composeSharedNodes(HYPRE_Int nElems, HYPRE_Int elemNNodes, HYPRE_Int * delete [] iArray2; return 0; } - + diff --git a/external/hypre/src/test/fei_lscore.c b/external/hypre/src/test/fei_lscore.c index 1d617d27..34bcf17b 100644 --- a/external/hypre/src/test/fei_lscore.c +++ b/external/hypre/src/test/fei_lscore.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -24,24 +24,24 @@ #include "HYPRE_parcsr_ls.h" #include "HYPRE_LinSysCore.h" -HYPRE_Int BuildParLaplacian27pt (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , - HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildParLaplacian27pt (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr ); #define SECOND_TIME 0 - + HYPRE_Int main( HYPRE_Int argc, char *argv[] ) { HYPRE_Int arg_index; HYPRE_Int print_usage; HYPRE_Int build_matrix_arg_index; HYPRE_Int solver_id; - HYPRE_Int ierr,i,j; - HYPRE_Int num_iterations; + HYPRE_Int ierr, i, j; + HYPRE_Int num_iterations; HYPRE_ParCSRMatrix parcsr_A; HYPRE_Int num_procs, myid; HYPRE_Int local_row; - HYPRE_Int time_index; + HYPRE_Int time_index; MPI_Comm comm; HYPRE_Int M, N; HYPRE_Int first_local_row, last_local_row; @@ -51,11 +51,11 @@ HYPRE_Int main( HYPRE_Int argc, char *argv[] ) /* parameters for BoomerAMG */ HYPRE_Real strong_threshold; - HYPRE_Int num_grid_sweeps; - HYPRE_Real relax_weight; + HYPRE_Int num_grid_sweeps; + HYPRE_Real relax_weight; /* parameters for GMRES */ - HYPRE_Int k_dim; + HYPRE_Int k_dim; char *paramString = new char[100]; @@ -70,7 +70,7 @@ HYPRE_Int main( HYPRE_Int argc, char *argv[] ) /*----------------------------------------------------------- * Set defaults *-----------------------------------------------------------*/ - + build_matrix_arg_index = argc; solver_id = 0; strong_threshold = 0.25; @@ -81,7 +81,7 @@ HYPRE_Int main( HYPRE_Int argc, char *argv[] ) /*----------------------------------------------------------- * Parse command line *-----------------------------------------------------------*/ - + print_usage = 0; arg_index = 1; @@ -110,7 +110,7 @@ HYPRE_Int main( HYPRE_Int argc, char *argv[] ) /*----------------------------------------------------------- * Print usage info *-----------------------------------------------------------*/ - + if ( (print_usage) && (myid == 0) ) { hypre_printf("\n"); @@ -119,20 +119,20 @@ HYPRE_Int main( HYPRE_Int argc, char *argv[] ) hypre_printf(" -solver : solver ID\n"); hypre_printf(" 0=DS-PCG 1=ParaSails-PCG \n"); hypre_printf(" 2=AMG-PCG 3=DS-GMRES \n"); - hypre_printf(" 4=PILUT-GMRES 5=AMG-GMRES \n"); + hypre_printf(" 4=PILUT-GMRES 5=AMG-GMRES \n"); hypre_printf("\n"); hypre_printf(" -rlx : relaxation type\n"); hypre_printf(" 0=Weighted Jacobi \n"); hypre_printf(" 1=Gauss-Seidel (very slow!) \n"); hypre_printf(" 3=Hybrid Jacobi/Gauss-Seidel \n"); - hypre_printf("\n"); + hypre_printf("\n"); exit(1); } /*----------------------------------------------------------- * Print driver parameters *-----------------------------------------------------------*/ - + if (myid == 0) { hypre_printf("Running with these driver parameters:\n"); @@ -148,7 +148,7 @@ HYPRE_Int main( HYPRE_Int argc, char *argv[] ) hypre_BeginTiming(time_index); BuildParLaplacian27pt(argc, argv, build_matrix_arg_index, &parcsr_A); - + /*----------------------------------------------------------- * Copy the parcsr matrix into the LSI through interface calls *-----------------------------------------------------------*/ @@ -156,43 +156,43 @@ HYPRE_Int main( HYPRE_Int argc, char *argv[] ) ierr = HYPRE_ParCSRMatrixGetComm( parcsr_A, &comm ); ierr += HYPRE_ParCSRMatrixGetDims( parcsr_A, &M, &N ); ierr = HYPRE_ParCSRMatrixGetLocalRange( parcsr_A, - &first_local_row, &last_local_row , - &first_local_col, &last_local_col ); + &first_local_row, &last_local_row, + &first_local_col, &last_local_col ); HYPRE_LinSysCore H(hypre_MPI_COMM_WORLD); HYPRE_Int numLocalEqns = last_local_row - first_local_row + 1; - H.createMatricesAndVectors(M,first_local_row+1,numLocalEqns); + H.createMatricesAndVectors(M, first_local_row + 1, numLocalEqns); HYPRE_Int index; HYPRE_Int *rowLengths = new HYPRE_Int[numLocalEqns]; HYPRE_Int **colIndices = new HYPRE_Int*[numLocalEqns]; local_row = 0; - for (i=first_local_row; i<= last_local_row; i++) + for (i = first_local_row; i <= last_local_row; i++) { - ierr += HYPRE_ParCSRMatrixGetRow(parcsr_A,i,&size,&col_ind,&values ); + ierr += HYPRE_ParCSRMatrixGetRow(parcsr_A, i, &size, &col_ind, &values ); rowLengths[local_row] = size; colIndices[local_row] = new HYPRE_Int[size]; - for (j=0; j s) { sdata = hypre_TReAlloc(sdata, char, (sdata_size + memchunk), HYPRE_MEMORY_HOST); - s= sdata_size + memchunk; + s = sdata_size + memchunk; } - + /* read the next input line */ sdata_line = fgets((sdata + sdata_size), maxline, file); } @@ -302,7 +302,7 @@ ReadData( char *filename, while (sdata_line < (sdata + sdata_size)) { sdata_ptr = sdata_line; - + if ( ( hypre_sscanf(sdata_ptr, "%s", key) > 0 ) && ( sdata_ptr[0] != '#' ) ) { sdata_ptr += strcspn(sdata_ptr, " \t\n"); @@ -336,8 +336,8 @@ ReadData( char *filename, iu = 1; for (i = 0; i < data.ndim; i++) { - il *= pdata.ilowers[pdata.nboxes][i+3]; - iu *= pdata.iuppers[pdata.nboxes][i+3]; + il *= pdata.ilowers[pdata.nboxes][i + 3]; + iu *= pdata.iuppers[pdata.nboxes][i + 3]; } if ( (il != 0) || (iu != 1) ) { @@ -456,7 +456,7 @@ ReadData( char *filename, data.stencil_offsets[s][entry][i] = 0; } data.stencil_vars[s][entry] = strtol(sdata_ptr, &sdata_ptr, 10); - data.stencil_values[s][entry] = strtod(sdata_ptr, &sdata_ptr); + data.stencil_values[s][entry] = (HYPRE_Real)strtod(sdata_ptr, &sdata_ptr); } else if ( strcmp(key, "GraphSetStencil:") == 0 ) { @@ -551,7 +551,7 @@ ReadData( char *filename, pdata.graph_entries[pdata.graph_nentries] = strtol(sdata_ptr, &sdata_ptr, 10); pdata.graph_values[pdata.graph_nentries] = - strtod(sdata_ptr, &sdata_ptr); + (HYPRE_Real)strtod(sdata_ptr, &sdata_ptr); pdata.graph_boxsizes[pdata.graph_nentries] = 1; for (i = 0; i < 3; i++) { @@ -625,7 +625,7 @@ ReadData( char *filename, pdata.matrix_entries[pdata.matrix_nentries] = strtol(sdata_ptr, &sdata_ptr, 10); pdata.matrix_values[pdata.matrix_nentries] = - strtod(sdata_ptr, &sdata_ptr); + (HYPRE_Real)strtod(sdata_ptr, &sdata_ptr); pdata.matrix_nentries++; data.pdata[part] = pdata; } @@ -633,9 +633,9 @@ ReadData( char *filename, else if ( strcmp(key, "rfactor:") == 0 ) { SScanIntArray(sdata_ptr, &sdata_ptr, data.ndim, data.rfactor); - for (i= data.ndim; i< 3; i++) + for (i = data.ndim; i < 3; i++) { - data.rfactor[i]= 1; + data.rfactor[i] = 1; } } @@ -664,10 +664,10 @@ ReadData( char *filename, hypre_TFree(sdata, HYPRE_MEMORY_HOST); - *data_ptr = data; + *data_ptr = data; return 0; } - + /*-------------------------------------------------------------------------- * Distribute routines *--------------------------------------------------------------------------*/ @@ -681,9 +681,9 @@ MapProblemIndex( ProblemIndex index, index[1] -= index[7]; index[2] -= index[8]; /* map the index */ - index[0] = m[0]*index[0] + (m[0]-1)*index[3]; - index[1] = m[1]*index[1] + (m[1]-1)*index[4]; - index[2] = m[2]*index[2] + (m[2]-1)*index[5]; + index[0] = m[0] * index[0] + (m[0] - 1) * index[3]; + index[1] = m[1] * index[1] + (m[1] - 1) * index[4]; + index[2] = m[2] * index[2] + (m[2] - 1) * index[5]; /* pre-shift the new mapped index */ index[0] += index[6]; index[1] += index[7]; @@ -731,7 +731,7 @@ DistributeData( ProblemData global_data, ProblemIndex int_ilower, int_iupper; /* determine first process number in each pool */ - pool_procs = hypre_CTAlloc(HYPRE_Int, (data.npools+1), HYPRE_MEMORY_HOST); + pool_procs = hypre_CTAlloc(HYPRE_Int, (data.npools + 1), HYPRE_MEMORY_HOST); for (part = 0; part < data.nparts; part++) { pool = data.pools[part] + 1; @@ -807,7 +807,7 @@ DistributeData( ProblemData global_data, { p = pid % m[0]; q = ((pid - p) / m[0]) % m[1]; - r = (pid - p - q*m[0]) / (m[0]*m[1]); + r = (pid - p - q * m[0]) / (m[0] * m[1]); for (box = 0; box < pdata.nboxes; box++) { @@ -821,12 +821,12 @@ DistributeData( ProblemData global_data, pdata.iuppers[box][1] = pdata.ilowers[box][1] + n[1] - 1; pdata.iuppers[box][2] = pdata.ilowers[box][2] + n[2] - 1; - pdata.ilowers[box][0] = pdata.ilowers[box][0] + p*n[0]; - pdata.ilowers[box][1] = pdata.ilowers[box][1] + q*n[1]; - pdata.ilowers[box][2] = pdata.ilowers[box][2] + r*n[2]; - pdata.iuppers[box][0] = pdata.iuppers[box][0] + p*n[0]; - pdata.iuppers[box][1] = pdata.iuppers[box][1] + q*n[1]; - pdata.iuppers[box][2] = pdata.iuppers[box][2] + r*n[2]; + pdata.ilowers[box][0] = pdata.ilowers[box][0] + p * n[0]; + pdata.ilowers[box][1] = pdata.ilowers[box][1] + q * n[1]; + pdata.ilowers[box][2] = pdata.ilowers[box][2] + r * n[2]; + pdata.iuppers[box][0] = pdata.iuppers[box][0] + p * n[0]; + pdata.iuppers[box][1] = pdata.iuppers[box][1] + q * n[1]; + pdata.iuppers[box][2] = pdata.iuppers[box][2] + r * n[2]; } i = 0; @@ -939,12 +939,12 @@ DistributeData( ProblemData global_data, m[2] = block[part][2]; if ( (m[0] * m[1] * m[2]) > 1) { - pdata.ilowers = hypre_TReAlloc(pdata.ilowers, ProblemIndex, - m[0]*m[1]*m[2]*pdata.nboxes, HYPRE_MEMORY_HOST); - pdata.iuppers = hypre_TReAlloc(pdata.iuppers, ProblemIndex, - m[0]*m[1]*m[2]*pdata.nboxes, HYPRE_MEMORY_HOST); - pdata.boxsizes = hypre_TReAlloc(pdata.boxsizes, HYPRE_Int, - m[0]*m[1]*m[2]*pdata.nboxes, HYPRE_MEMORY_HOST); + pdata.ilowers = hypre_TReAlloc(pdata.ilowers, ProblemIndex, + m[0] * m[1] * m[2] * pdata.nboxes, HYPRE_MEMORY_HOST); + pdata.iuppers = hypre_TReAlloc(pdata.iuppers, ProblemIndex, + m[0] * m[1] * m[2] * pdata.nboxes, HYPRE_MEMORY_HOST); + pdata.boxsizes = hypre_TReAlloc(pdata.boxsizes, HYPRE_Int, + m[0] * m[1] * m[2] * pdata.nboxes, HYPRE_MEMORY_HOST); for (box = 0; box < pdata.nboxes; box++) { n[0] = pdata.iuppers[box][0] - pdata.ilowers[box][0] + 1; @@ -965,12 +965,12 @@ DistributeData( ProblemData global_data, { for (p = 0; p < m[0]; p++) { - pdata.ilowers[i][0] = pdata.ilowers[box][0] + p*n[0]; - pdata.ilowers[i][1] = pdata.ilowers[box][1] + q*n[1]; - pdata.ilowers[i][2] = pdata.ilowers[box][2] + r*n[2]; - pdata.iuppers[i][0] = pdata.iuppers[box][0] + p*n[0]; - pdata.iuppers[i][1] = pdata.iuppers[box][1] + q*n[1]; - pdata.iuppers[i][2] = pdata.iuppers[box][2] + r*n[2]; + pdata.ilowers[i][0] = pdata.ilowers[box][0] + p * n[0]; + pdata.ilowers[i][1] = pdata.ilowers[box][1] + q * n[1]; + pdata.ilowers[i][2] = pdata.ilowers[box][2] + r * n[2]; + pdata.iuppers[i][0] = pdata.iuppers[box][0] + p * n[0]; + pdata.iuppers[i][1] = pdata.iuppers[box][1] + q * n[1]; + pdata.iuppers[i][2] = pdata.iuppers[box][2] + r * n[2]; for (d = 3; d < 9; d++) { pdata.ilowers[i][d] = pdata.ilowers[box][d]; @@ -981,7 +981,7 @@ DistributeData( ProblemData global_data, } } } - pdata.nboxes *= m[0]*m[1]*m[2]; + pdata.nboxes *= m[0] * m[1] * m[2]; for (entry = 0; entry < pdata.graph_nentries; entry++) { @@ -1101,7 +1101,7 @@ DistributeData( ProblemData global_data, hypre_TFree(pool_procs, HYPRE_MEMORY_HOST); - *data_ptr = data; + *data_ptr = data; return 0; } @@ -1232,34 +1232,34 @@ GetVariableBox( Index cell_ilower, var_iupper[1] = cell_iupper[1]; var_iupper[2] = cell_iupper[2]; - switch(vartype) + switch (vartype) { case HYPRE_SSTRUCT_VARIABLE_CELL: - var_ilower[0] -= 0; var_ilower[1] -= 0; var_ilower[2] -= 0; - break; + var_ilower[0] -= 0; var_ilower[1] -= 0; var_ilower[2] -= 0; + break; case HYPRE_SSTRUCT_VARIABLE_NODE: - var_ilower[0] -= 1; var_ilower[1] -= 1; var_ilower[2] -= 1; - break; + var_ilower[0] -= 1; var_ilower[1] -= 1; var_ilower[2] -= 1; + break; case HYPRE_SSTRUCT_VARIABLE_XFACE: - var_ilower[0] -= 1; var_ilower[1] -= 0; var_ilower[2] -= 0; - break; + var_ilower[0] -= 1; var_ilower[1] -= 0; var_ilower[2] -= 0; + break; case HYPRE_SSTRUCT_VARIABLE_YFACE: - var_ilower[0] -= 0; var_ilower[1] -= 1; var_ilower[2] -= 0; - break; + var_ilower[0] -= 0; var_ilower[1] -= 1; var_ilower[2] -= 0; + break; case HYPRE_SSTRUCT_VARIABLE_ZFACE: - var_ilower[0] -= 0; var_ilower[1] -= 0; var_ilower[2] -= 1; - break; + var_ilower[0] -= 0; var_ilower[1] -= 0; var_ilower[2] -= 1; + break; case HYPRE_SSTRUCT_VARIABLE_XEDGE: - var_ilower[0] -= 0; var_ilower[1] -= 1; var_ilower[2] -= 1; - break; + var_ilower[0] -= 0; var_ilower[1] -= 1; var_ilower[2] -= 1; + break; case HYPRE_SSTRUCT_VARIABLE_YEDGE: - var_ilower[0] -= 1; var_ilower[1] -= 0; var_ilower[2] -= 1; - break; + var_ilower[0] -= 1; var_ilower[1] -= 0; var_ilower[2] -= 1; + break; case HYPRE_SSTRUCT_VARIABLE_ZEDGE: - var_ilower[0] -= 1; var_ilower[1] -= 1; var_ilower[2] -= 0; - break; + var_ilower[0] -= 1; var_ilower[1] -= 1; var_ilower[2] -= 0; + break; case HYPRE_SSTRUCT_VARIABLE_UNDEFINED: - break; + break; } return ierr; @@ -1278,7 +1278,7 @@ PrintUsage( char *progname, hypre_printf("Usage: %s []\n", progname); hypre_printf("\n"); hypre_printf(" -in : input file (default is `%s')\n", - infile_default); + infile_default); hypre_printf("\n"); hypre_printf(" -pt ... : set part(s) for subsequent options\n"); hypre_printf(" -r : refine part(s)\n"); @@ -1298,7 +1298,7 @@ PrintUsage( char *progname, /*-------------------------------------------------------------------------- * Test driver for semi-structured matrix interface *--------------------------------------------------------------------------*/ - + HYPRE_Int main( HYPRE_Int argc, char *argv[] ) @@ -1314,7 +1314,7 @@ main( HYPRE_Int argc, Index *block; HYPRE_Int solver_id; HYPRE_Int print_system; - + #ifdef HYPRE_FORTRAN hypre_F90_Obj grid; hypre_F90_Obj *stencils; @@ -1352,10 +1352,10 @@ main( HYPRE_Int argc, HYPRE_Int num_iterations; HYPRE_Real final_res_norm; - + HYPRE_Int num_procs, myid; HYPRE_Int time_index; - + HYPRE_Int n_pre, n_post; HYPRE_Int arg_index, part, box, var, entry, s, i, j, k; @@ -1363,14 +1363,14 @@ main( HYPRE_Int argc, #ifdef HYPRE_FORTRAN hypre_F90_Obj long_temp_COMM; HYPRE_Int temp_COMM; - HYPRE_Int zero=0; - HYPRE_Int one=1; - HYPRE_Int twenty=20; - HYPRE_Int for_HYPRE_PARCSR=5555; + HYPRE_Int zero = 0; + HYPRE_Int one = 1; + HYPRE_Int twenty = 20; + HYPRE_Int for_HYPRE_PARCSR = 5555; - HYPRE_Real ftol=1.e-8; + HYPRE_Real ftol = 1.e-8; #endif - + /*----------------------------------------------------------- * Initialize some stuff *-----------------------------------------------------------*/ @@ -1636,10 +1636,10 @@ main( HYPRE_Int argc, #ifdef HYPRE_FORTRAN HYPRE_SStructGraphCreate(&temp_COMM, &grid, &graph); - HYPRE_SStructGraphSetObjectType(&graph, &for_HYPRE_PARCSR); + HYPRE_SStructGraphSetObjectType(&graph, &for_HYPRE_PARCSR); #else HYPRE_SStructGraphCreate(hypre_MPI_COMM_WORLD, grid, &graph); - HYPRE_SStructGraphSetObjectType(graph, HYPRE_PARCSR); + HYPRE_SStructGraphSetObjectType(graph, HYPRE_PARCSR); #endif for (part = 0; part < data.nparts; part++) @@ -1680,7 +1680,7 @@ main( HYPRE_Int argc, k /= pdata.graph_strides[entry][i]; k *= pdata.graph_index_signs[entry][i]; to_index[j] = pdata.graph_to_ilowers[entry][j] + - k * pdata.graph_to_strides[entry][j]; + k * pdata.graph_to_strides[entry][j]; } #ifdef HYPRE_FORTRAN HYPRE_SStructGraphAddEntries(&graph, &part, index, @@ -1752,19 +1752,19 @@ main( HYPRE_Int argc, for (part = 0; part < data.nparts; part++) { pdata = data.pdata[part]; - cell_grid= hypre_SStructPGridCellSGrid(hypre_SStructGridPGrid(grid, part)); - bounding_box= hypre_StructGridBoundingBox(cell_grid); + cell_grid = hypre_SStructPGridCellSGrid(hypre_SStructGridPGrid(grid, part)); + bounding_box = hypre_StructGridBoundingBox(cell_grid); - h= (HYPRE_Real) (hypre_BoxIMax(bounding_box)[0]- hypre_BoxIMin(bounding_box)[0]); - for (i= 1; i< data.ndim; i++) + h = (HYPRE_Real) (hypre_BoxIMax(bounding_box)[0] - hypre_BoxIMin(bounding_box)[0]); + for (i = 1; i < data.ndim; i++) { - if ((hypre_BoxIMax(bounding_box)[i]- hypre_BoxIMin(bounding_box)[i]) > h) + if ((hypre_BoxIMax(bounding_box)[i] - hypre_BoxIMin(bounding_box)[i]) > h) { - h= (HYPRE_Real) (hypre_BoxIMax(bounding_box)[i]- hypre_BoxIMin(bounding_box)[i]); + h = (HYPRE_Real) (hypre_BoxIMax(bounding_box)[i] - hypre_BoxIMin(bounding_box)[i]); } } - h= 1.0/h; - + h = 1.0 / h; + /* set stencil values */ for (var = 0; var < pdata.nvars; var++) { @@ -1773,13 +1773,13 @@ main( HYPRE_Int argc, { for (j = 0; j < pdata.max_boxsize; j++) { - values[j] = h*data.stencil_values[s][i]; + values[j] = h * data.stencil_values[s][i]; } if (i < 9) { for (j = 0; j < pdata.max_boxsize; j++) { - values[j]+= data.stencil_values[s+data.ndim][i]/h; + values[j] += data.stencil_values[s + data.ndim][i] / h; } } @@ -1895,20 +1895,20 @@ main( HYPRE_Int argc, HYPRE_ParCSRMatrixEliminateRowsCols(parA, bdryRanksCnt[0], bdryRanks[0]); #endif - + { hypre_MaxwellOffProcRow **OffProcRows; hypre_SStructSharedDOF_ParcsrMatRowsComm(&grid, (hypre_ParCSRMatrix *) parA, &i, &OffProcRows); - for (j= 0; j< i; j++) + for (j = 0; j < i; j++) { hypre_MaxwellOffProcRowDestroy((void *) OffProcRows[j]); } hypre_TFree(OffProcRows, HYPRE_MEMORY_HOST); - } - + } + /*----------------------------------------------------------- * Set up the linear system *-----------------------------------------------------------*/ @@ -1927,9 +1927,9 @@ main( HYPRE_Int argc, for (j = 0; j < data.max_boxsize; j++) { - values[j]= sin((HYPRE_Real)(j+1)); - values[j]= (HYPRE_Real) hypre_Rand(); - values[j]= (HYPRE_Real) j; + values[j] = hypre_sin((HYPRE_Real)(j + 1)); + values[j] = (HYPRE_Real) hypre_Rand(); + values[j] = (HYPRE_Real) j; } for (part = 0; part < data.nparts; part++) { @@ -1938,7 +1938,7 @@ main( HYPRE_Int argc, { for (box = 0; box < pdata.nboxes; box++) { - GetVariableBox(pdata.ilowers[box], pdata.iuppers[box], + GetVariableBox(pdata.ilowers[box], pdata.iuppers[box], pdata.vartypes[var], ilower, iupper); #ifdef HYPRE_FORTRAN HYPRE_SStructVectorSetBoxValues(&b, &part, &ilower[0], &iupper[0], @@ -1979,7 +1979,7 @@ main( HYPRE_Int argc, { for (box = 0; box < pdata.nboxes; box++) { - GetVariableBox(pdata.ilowers[box], pdata.iuppers[box], + GetVariableBox(pdata.ilowers[box], pdata.iuppers[box], pdata.vartypes[var], ilower, iupper); #ifdef HYPRE_FORTRAN HYPRE_SStructVectorSetBoxValues(&x, &part, &ilower[0], &iupper[0], @@ -2004,9 +2004,9 @@ main( HYPRE_Int argc, #endif hypre_ParVectorZeroBCValues((hypre_ParVector *) parx, bdryRanks[0], - bdryRanksCnt[0]); + bdryRanksCnt[0]); hypre_ParVectorZeroBCValues((hypre_ParVector *) parb, bdryRanks[0], - bdryRanksCnt[0]); + bdryRanksCnt[0]); hypre_TFree(bdryRanks[0], HYPRE_MEMORY_HOST); hypre_TFree(bdryRanks, HYPRE_MEMORY_HOST); @@ -2099,7 +2099,7 @@ main( HYPRE_Int argc, #else HYPRE_SStructMaxwellGetNumIterations(solver, &num_iterations); HYPRE_SStructMaxwellGetFinalRelativeResidualNorm( - solver, &final_res_norm); + solver, &final_res_norm); HYPRE_SStructMaxwellDestroy(solver); #endif } diff --git a/external/hypre/src/test/fparcsr_ls.f b/external/hypre/src/test/fparcsr_ls.f index 14101f9c..d75349e3 100644 --- a/external/hypre/src/test/fparcsr_ls.f +++ b/external/hypre/src/test/fparcsr_ls.f @@ -1,4 +1,4 @@ -! Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +! Copyright (c) 1998 Lawrence Livermore National Security, LLC and other ! HYPRE Project Developers. See the top-level COPYRIGHT file for details. ! ! SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/fparcsr_mv.f b/external/hypre/src/test/fparcsr_mv.f index 5481f779..4a3ddd32 100644 --- a/external/hypre/src/test/fparcsr_mv.f +++ b/external/hypre/src/test/fparcsr_mv.f @@ -1,4 +1,4 @@ -! Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +! Copyright (c) 1998 Lawrence Livermore National Security, LLC and other ! HYPRE Project Developers. See the top-level COPYRIGHT file for details. ! ! SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/fsstruct_ls.f b/external/hypre/src/test/fsstruct_ls.f index 8fda320b..0230cfd7 100644 --- a/external/hypre/src/test/fsstruct_ls.f +++ b/external/hypre/src/test/fsstruct_ls.f @@ -1,4 +1,4 @@ -! Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +! Copyright (c) 1998 Lawrence Livermore National Security, LLC and other ! HYPRE Project Developers. See the top-level COPYRIGHT file for details. ! ! SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/fsstruct_mv.f b/external/hypre/src/test/fsstruct_mv.f index 836aab5c..5e19fcf7 100644 --- a/external/hypre/src/test/fsstruct_mv.f +++ b/external/hypre/src/test/fsstruct_mv.f @@ -1,4 +1,4 @@ -! Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +! Copyright (c) 1998 Lawrence Livermore National Security, LLC and other ! HYPRE Project Developers. See the top-level COPYRIGHT file for details. ! ! SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/fstruct_ls.f b/external/hypre/src/test/fstruct_ls.f index 3599da1a..183748ea 100644 --- a/external/hypre/src/test/fstruct_ls.f +++ b/external/hypre/src/test/fstruct_ls.f @@ -1,4 +1,4 @@ -! Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +! Copyright (c) 1998 Lawrence Livermore National Security, LLC and other ! HYPRE Project Developers. See the top-level COPYRIGHT file for details. ! ! SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/fstruct_mv.f b/external/hypre/src/test/fstruct_mv.f index 0be09d7a..6e71fe34 100644 --- a/external/hypre/src/test/fstruct_mv.f +++ b/external/hypre/src/test/fstruct_mv.f @@ -1,4 +1,4 @@ -! Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +! Copyright (c) 1998 Lawrence Livermore National Security, LLC and other ! HYPRE Project Developers. See the top-level COPYRIGHT file for details. ! ! SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/hypre_ij_fortran_test.h b/external/hypre/src/test/hypre_ij_fortran_test.h index ba546947..2bbe4c1f 100644 --- a/external/hypre/src/test/hypre_ij_fortran_test.h +++ b/external/hypre/src/test/hypre_ij_fortran_test.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -8,7 +8,7 @@ #ifdef __cplusplus extern "C" { #endif - + /****************************************************************************** * Definitions of IJMatrix Fortran interface routines *****************************************************************************/ @@ -16,139 +16,139 @@ extern "C" { #define HYPRE_IJMatrixCreate \ hypre_F90_NAME(fhypre_ijmatrixcreate, FHYPRE_IJMATRIXCREATE) extern void hypre_F90_NAME(fhypre_ijmatrixcreate, FHYPRE_IJMATRIXCREATE) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, hypre_F90_Obj*); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, hypre_F90_Obj*); #define HYPRE_IJMatrixDestroy \ hypre_F90_NAME(fhypre_ijmatrixdestroy, FHYPRE_IJMATRIXDESTROY) extern void hypre_F90_NAME(fhypre_ijmatrixdestroy, FHYPRE_IJMATRIXDESTROY) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_IJMatrixInitialize \ hypre_F90_NAME(fhypre_ijmatrixinitialize, FHYPRE_IJMATRIXINITIALIZE) extern void hypre_F90_NAME(fhypre_ijmatrixinitialize, FHYPRE_IJMATRIXINITIALIZE) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_IJMatrixAssemble \ hypre_F90_NAME(fhypre_ijmatrixassemble, FHYPRE_IJMATRIXASSEMBLE) extern void hypre_F90_NAME(fhypre_ijmatrixassemble, FHYPRE_IJMATRIXASSEMBLE) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_IJMatrixSetRowSizes \ hypre_F90_NAME(fhypre_ijmatrixsetrowsizes, FHYPRE_IJMATRIXSETROWSIZES) extern void hypre_F90_NAME(fhypre_ijmatrixsetrowsizes, FHYPRE_IJMATRIXSETROWSIZES) - (hypre_F90_Obj *, const HYPRE_Int *); +(hypre_F90_Obj *, const HYPRE_Int *); #define HYPRE_IJMatrixSetDiagOffdSizes \ hypre_F90_NAME(fhypre_ijmatrixsetdiagoffdsizes, FHYPRE_IJMATRIXSETDIAGOFFDSIZES) extern void hypre_F90_NAME(fhypre_ijmatrixsetdiagoffdsizes, FHYPRE_IJMATRIXSETDIAGOFFDSIZES) - (hypre_F90_Obj *, const HYPRE_Int *, const HYPRE_Int *); +(hypre_F90_Obj *, const HYPRE_Int *, const HYPRE_Int *); #define HYPRE_IJMatrixSetValues \ hypre_F90_NAME(fhypre_ijmatrixsetvalues, FHYPRE_IJMATRIXSETVALUES) extern void hypre_F90_NAME(fhypre_ijmatrixsetvalues, FHYPRE_IJMATRIXSETVALUES) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, const HYPRE_Int *, const HYPRE_Int *, - const HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, const HYPRE_Int *, const HYPRE_Int *, + const HYPRE_Real *); #define HYPRE_IJMatrixAddToValues \ hypre_F90_NAME(fhypre_ijmatrixaddtovalues, FHYPRE_IJMATRIXADDTOVALUES) extern void hypre_F90_NAME(fhypre_ijmatrixaddtovalues, FHYPRE_IJMATRIXADDTOVALUES) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, const HYPRE_Int *, const HYPRE_Int *, - const HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, const HYPRE_Int *, const HYPRE_Int *, + const HYPRE_Real *); #define HYPRE_IJMatrixSetObjectType \ hypre_F90_NAME(fhypre_ijmatrixsetobjecttype, FHYPRE_IJMATRIXSETOBJECTTYPE) extern void hypre_F90_NAME(fhypre_ijmatrixsetobjecttype, FHYPRE_IJMATRIXSETOBJECTTYPE) - (hypre_F90_Obj *, const HYPRE_Int *); +(hypre_F90_Obj *, const HYPRE_Int *); #define HYPRE_IJMatrixGetObjectType \ hypre_F90_NAME(fhypre_ijmatrixgetobjecttype, FHYPRE_IJMATRIXGETOBJECTTYPE) extern void hypre_F90_NAME(fhypre_ijmatrixgetobjecttype, FHYPRE_IJMATRIXGETOBJECTTYPE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_IJMatrixGetObject \ hypre_F90_NAME(fhypre_ijmatrixgetobject, FHYPRE_IJMATRIXGETOBJECT) extern void hypre_F90_NAME(fhypre_ijmatrixgetobject, FHYPRE_IJMATRIXGETOBJECT) - (hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_IJMatrixRead \ hypre_F90_NAME(fhypre_ijmatrixread, FHYPRE_IJMATRIXREAD) extern void hypre_F90_NAME(fhypre_ijmatrixread, FHYPRE_IJMATRIXREAD) - (char *, hypre_F90_Obj *, HYPRE_Int *, hypre_F90_Obj *); +(char *, hypre_F90_Obj *, HYPRE_Int *, hypre_F90_Obj *); #define HYPRE_IJMatrixPrint \ hypre_F90_NAME(fhypre_ijmatrixprint, FHYPRE_IJMATRIXPRINT) extern void hypre_F90_NAME(fhypre_ijmatrixprint, FHYPRE_IJMATRIXPRINT) - (hypre_F90_Obj *, char *); +(hypre_F90_Obj *, char *); #define hypre_IJMatrixSetObject \ hypre_F90_NAME(fhypre_ijmatrixsetobject, FHYPRE_IJMATRIXSETOBJECT) extern void hypre_F90_NAME(fhypre_ijmatrixsetobject, FHYPRE_IJMATRIXSETOBJECT) - (hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_IJVectorCreate \ hypre_F90_NAME(fhypre_ijvectorcreate, FHYPRE_IJVECTORCREATE) extern void hypre_F90_NAME(fhypre_ijvectorcreate, FHYPRE_IJVECTORCREATE) - (HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, hypre_F90_Obj *); +(HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, hypre_F90_Obj *); #define HYPRE_IJVectorDestroy \ hypre_F90_NAME(fhypre_ijvectordestroy, FHYPRE_IJVECTORDESTROY) extern void hypre_F90_NAME(fhypre_ijvectordestroy, FHYPRE_IJVECTORDESTROY) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_IJVectorInitialize \ hypre_F90_NAME(fhypre_ijvectorinitialize, FHYPRE_IJVECTORINITIALIZE) extern void hypre_F90_NAME(fhypre_ijvectorinitialize, FHYPRE_IJVECTORINITIALIZE) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_IJVectorSetValues \ hypre_F90_NAME(fhypre_ijvectorsetvalues, FHYPRE_IJVECTORSETVALUES) extern void hypre_F90_NAME(fhypre_ijvectorsetvalues, FHYPRE_IJVECTORSETVALUES) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Real *); #define HYPRE_IJVectorAddToValues \ hypre_F90_NAME(fhypre_ijvectoraddtovalues, FHYPRE_IJVECTORADDTOVALUES) extern void hypre_F90_NAME(fhypre_ijvectoraddtovalues, FHYPRE_IJVECTORADDTOVALUES) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Real *); #define HYPRE_IJVectorAssemble \ hypre_F90_NAME(fhypre_ijvectorassemble, FHYPRE_IJVECTORASSEMBLE) extern void hypre_F90_NAME(fhypre_ijvectorassemble, FHYPRE_IJVECTORASSEMBLE) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_IJVectorGetValues \ hypre_F90_NAME(fhypre_ijvectorgetvalues, FHYPRE_IJVECTORGETVALUES) extern void hypre_F90_NAME(fhypre_ijvectorgetvalues, FHYPRE_IJVECTORGETVALUES) - (hypre_F90_Obj *, const HYPRE_Int *, const HYPRE_Int *, HYPRE_Real *); +(hypre_F90_Obj *, const HYPRE_Int *, const HYPRE_Int *, HYPRE_Real *); #define HYPRE_IJVectorSetObjectType \ hypre_F90_NAME(fhypre_ijvectorsetobjecttype, FHYPRE_IJVECTORSETOBJECTTYPE) extern void hypre_F90_NAME(fhypre_ijvectorsetobjecttype, FHYPRE_IJVECTORSETOBJECTTYPE) - (hypre_F90_Obj *, const HYPRE_Int *); +(hypre_F90_Obj *, const HYPRE_Int *); #define HYPRE_IJVectorGetObjectType \ hypre_F90_NAME(fhypre_ijvectorgetobjecttype, FHYPRE_IJVECTORGETOBJECTTYPE) extern void hypre_F90_NAME(fhypre_ijvectorgetobjecttype, FHYPRE_IJVECTORGETOBJECTTYPE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_IJVectorGetObject \ hypre_F90_NAME(fhypre_ijvectorgetobject, FHYPRE_IJVECTORGETOBJECT) extern void hypre_F90_NAME(fhypre_ijvectorgetobject, FHYPRE_IJVECTORGETOBJECT) - (hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_IJVectorRead \ hypre_F90_NAME(fhypre_ijvectorread, FHYPRE_IJVECTORREAD) extern void hypre_F90_NAME(fhypre_ijvectorread, FHYPRE_IJVECTORREAD) - (char *, hypre_F90_Obj *, HYPRE_Int *, hypre_F90_Obj *); +(char *, hypre_F90_Obj *, HYPRE_Int *, hypre_F90_Obj *); #define HYPRE_IJVectorPrint \ hypre_F90_NAME(fhypre_ijvectorprint, FHYPRE_IJVECTORPRINT) extern void hypre_F90_NAME(fhypre_ijvectorprint, FHYPRE_IJVECTORPRINT) - (hypre_F90_Obj *, const char *); - +(hypre_F90_Obj *, const char *); + #ifdef __cplusplus } #endif diff --git a/external/hypre/src/test/hypre_parcsr_fortran_test.h b/external/hypre/src/test/hypre_parcsr_fortran_test.h index 75815aef..afcf34c9 100644 --- a/external/hypre/src/test/hypre_parcsr_fortran_test.h +++ b/external/hypre/src/test/hypre_parcsr_fortran_test.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -16,1493 +16,1494 @@ extern "C" { #define HYPRE_ParCSRMatrixCreate \ hypre_F90_NAME(fhypre_parcsrmatrixcreate, FHYPRE_PARCSRMATRIXCREATE) extern void hypre_F90_NAME(fhypre_parcsrmatrixcreate, FHYPRE_PARCSRMATRIXCREATE) - (HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, hypre_F90_Obj *); +(HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, + HYPRE_Int *, hypre_F90_Obj *); #define HYPRE_ParCSRMatrixDestroy \ hypre_F90_NAME(fhypre_parcsrmatrixdestroy, FHYPRE_PARCSRMATRIXDESTROY) extern void hypre_F90_NAME(fhypre_parcsrmatrixdestroy, FHYPRE_PARCSRMATRIXDESTROY) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRMatrixInitialize \ hypre_F90_NAME(fhypre_parcsrmatrixinitialize, FHYPRE_PARCSRMATRIXINITIALIZE) extern void hypre_F90_NAME(fhypre_parcsrmatrixinitialize, FHYPRE_PARCSRMATRIXINITIALIZE) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_ParCSRMatrixRead \ hypre_F90_NAME(fhypre_parcsrmatrixread, FHYPRE_PARCSRMATRIXREAD) extern void hypre_F90_NAME(fhypre_parcsrmatrixread, FHYPRE_PARCSRMATRIXREAD) - (HYPRE_Int *, char *, hypre_F90_Obj *); +(HYPRE_Int *, char *, hypre_F90_Obj *); #define HYPRE_ParCSRMatrixPrint \ hypre_F90_NAME(fhypre_parcsrmatrixprint, FHYPRE_PARCSRMATRIXPRINT) extern void hypre_F90_NAME(fhypre_parcsrmatrixprint, FHYPRE_PARCSRMATRIXPRINT) - (hypre_F90_Obj *, char *, HYPRE_Int *); +(hypre_F90_Obj *, char *, HYPRE_Int *); #define HYPRE_ParCSRMatrixGetComm \ hypre_F90_NAME(fhypre_parcsrmatrixgetcomm, FHYPRE_PARCSRMATRIXGETCOMM) extern void hypre_F90_NAME(fhypre_parcsrmatrixgetcomm, FHYPRE_PARCSRMATRIXGETCOMM) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRMatrixGetDims \ hypre_F90_NAME(fhypre_parcsrmatrixgetdims, FHYPRE_PARCSRMATRIXGETDIMS) extern void hypre_F90_NAME(fhypre_parcsrmatrixgetdims, FHYPRE_PARCSRMATRIXGETDIMS) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *); #define HYPRE_ParCSRMatrixGetRowPartitioning \ hypre_F90_NAME(fhypre_parcsrmatrixgetrowpartit, FHYPRE_PARCSRMATRIXGETROWPARTIT) extern void hypre_F90_NAME(fhypre_parcsrmatrixgetrowpartit, FHYPRE_PARCSRMATRIXGETROWPARTIT) - (hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_ParCSRMatrixGetColPartitioning \ hypre_F90_NAME(fhypre_parcsrmatrixgetcolpartit, FHYPRE_PARCSRMATRIXGETCOLPARTIT) extern void hypre_F90_NAME(fhypre_parcsrmatrixgetcolpartit, FHYPRE_PARCSRMATRIXGETCOLPARTIT) - (hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_ParCSRMatrixGetLocalRange \ hypre_F90_NAME(fhypre_parcsrmatrixgetlocalrang, FHYPRE_PARCSRMATRIXGETLOCALRANG) extern void hypre_F90_NAME(fhypre_parcsrmatrixgetlocalrang, FHYPRE_PARCSRMATRIXGETLOCALRANG) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *); #define HYPRE_ParCSRMatrixGetRow \ hypre_F90_NAME(fhypre_parcsrmatrixgetrow, FHYPRE_PARCSRMATRIXGETROW) extern void hypre_F90_NAME(fhypre_parcsrmatrixgetrow, FHYPRE_PARCSRMATRIXGETROW) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_ParCSRMatrixRestoreRow \ hypre_F90_NAME(fhypre_parcsrmatrixrestorerow, FHYPRE_PARCSRMATRIXRESTOREROW) extern void hypre_F90_NAME(fhypre_parcsrmatrixrestorerow, FHYPRE_PARCSRMATRIXRESTOREROW) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_CSRMatrixtoParCSRMatrix \ hypre_F90_NAME(fhypre_csrmatrixtoparcsrmatrix, FHYPRE_CSRMATRIXTOPARCSRMATRIX) extern void hypre_F90_NAME(fhypre_csrmatrixtoparcsrmatrix, FHYPRE_CSRMATRIXTOPARCSRMATRIX) - (HYPRE_Int *, hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, hypre_F90_Obj *); +(HYPRE_Int *, hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, hypre_F90_Obj *); #define HYPRE_ParCSRMatrixMatvec \ hypre_F90_NAME(fhypre_parcsrmatrixmatvec, FHYPRE_PARCSRMATRIXMATVEC) extern void hypre_F90_NAME(fhypre_parcsrmatrixmatvec, FHYPRE_PARCSRMATRIXMATVEC) - (HYPRE_Real *, hypre_F90_Obj *, hypre_F90_Obj *, HYPRE_Real *, hypre_F90_Obj *); +(HYPRE_Real *, hypre_F90_Obj *, hypre_F90_Obj *, HYPRE_Real *, hypre_F90_Obj *); #define HYPRE_ParCSRMatrixMatvecT \ hypre_F90_NAME(fhypre_parcsrmatrixmatvect, FHYPRE_PARCSRMATRIXMATVECT) extern void hypre_F90_NAME(fhypre_parcsrmatrixmatvect, FHYPRE_PARCSRMATRIXMATVECT) - (HYPRE_Real *, hypre_F90_Obj *, hypre_F90_Obj *, HYPRE_Real *, hypre_F90_Obj *); +(HYPRE_Real *, hypre_F90_Obj *, hypre_F90_Obj *, HYPRE_Real *, hypre_F90_Obj *); #define HYPRE_ParVectorCreate \ hypre_F90_NAME(fhypre_parvectorcreate, FHYPRE_PARVECTORCREATE) extern void hypre_F90_NAME(fhypre_parvectorcreate, FHYPRE_PARVECTORCREATE) - (HYPRE_Int *, HYPRE_Int *, hypre_F90_Obj *, hypre_F90_Obj *); +(HYPRE_Int *, HYPRE_Int *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_ParMultiVectorCreate \ hypre_F90_NAME(fhypre_parmultivectorcreate, FHYPRE_PARMULTIVECTORCREATE) extern void hypre_F90_NAME(fhypre_parmultivectorcreate, FHYPRE_PARMULTIVECTORCREATE) - (HYPRE_Int *, HYPRE_Int *, hypre_F90_Obj *, HYPRE_Int *, hypre_F90_Obj *); +(HYPRE_Int *, HYPRE_Int *, hypre_F90_Obj *, HYPRE_Int *, hypre_F90_Obj *); #define HYPRE_ParVectorDestroy \ hypre_F90_NAME(fhypre_parvectordestroy, FHYPRE_PARVECTORDESTROY) extern void hypre_F90_NAME(fhypre_parvectordestroy, FHYPRE_PARVECTORDESTROY) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_ParVectorInitialize \ hypre_F90_NAME(fhypre_parvectorinitialize, FHYPRE_PARVECTORINITIALIZE) extern void hypre_F90_NAME(fhypre_parvectorinitialize, FHYPRE_PARVECTORINITIALIZE) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_ParVectorRead \ hypre_F90_NAME(fhypre_parvectorread, FHYPRE_PARVECTORREAD) extern void hypre_F90_NAME(fhypre_parvectorread, FHYPRE_PARVECTORREAD) - (HYPRE_Int *, hypre_F90_Obj *, char *); +(HYPRE_Int *, hypre_F90_Obj *, char *); #define HYPRE_ParVectorPrint \ hypre_F90_NAME(fhypre_parvectorprint, FHYPRE_PARVECTORPRINT) extern void hypre_F90_NAME(fhypre_parvectorprint, FHYPRE_PARVECTORPRINT) - (hypre_F90_Obj *, char *, HYPRE_Int *); +(hypre_F90_Obj *, char *, HYPRE_Int *); #define HYPRE_ParVectorSetConstantValues \ hypre_F90_NAME(fhypre_parvectorsetconstantvalu, FHYPRE_PARVECTORSETCONSTANTVALU) extern void hypre_F90_NAME(fhypre_parvectorsetconstantvalu, FHYPRE_PARVECTORSETCONSTANTVALU) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_ParVectorSetRandomValues \ hypre_F90_NAME(fhypre_parvectorsetrandomvalues, FHYPRE_PARVECTORSETRANDOMVALUES) extern void hypre_F90_NAME(fhypre_parvectorsetrandomvalues, FHYPRE_PARVECTORSETRANDOMVALUES) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParVectorCopy \ hypre_F90_NAME(fhypre_parvectorcopy, FHYPRE_PARVECTORCOPY) extern void hypre_F90_NAME(fhypre_parvectorcopy, FHYPRE_PARVECTORCOPY) - (hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_ParVectorCloneShallow \ hypre_F90_NAME(fhypre_parvectorcloneshallow, FHYPRE_PARVECTORCLONESHALLOW) extern void hypre_F90_NAME(fhypre_parvectorcloneshallow, FHYPRE_PARVECTORCLONESHALLOW) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_ParVectorScale \ hypre_F90_NAME(fhypre_parvectorscale, FHYPRE_PARVECTORSCALE) extern void hypre_F90_NAME(fhypre_parvectorscale, FHYPRE_PARVECTORSCALE) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_ParVectorAxpy \ hypre_F90_NAME(fhypre_parvectoraxpy, FHYPRE_PARVECTORAXPY) extern void hypre_F90_NAME(fhypre_parvectoraxpy, FHYPRE_PARVECTORAXPY) - (HYPRE_Real *, hypre_F90_Obj *, hypre_F90_Obj *); +(HYPRE_Real *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_ParVectorInnerProd \ hypre_F90_NAME(fhypre_parvectorinnerprod, FHYPRE_PARVECTORINNERPROD) extern void hypre_F90_NAME(fhypre_parvectorinnerprod, FHYPRE_PARVECTORINNERPROD) - (hypre_F90_Obj *, hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, hypre_F90_Obj *, HYPRE_Real *); #define hypre_ParCSRMatrixGlobalNumRows \ hypre_F90_NAME(fhypre_parcsrmatrixglobalnumrow, FHYPRE_PARCSRMATRIXGLOBALNUMROW) extern void hypre_F90_NAME(fhypre_parcsrmatrixglobalnumrow, FHYPRE_PARCSRMATRIXGLOBALNUMROW) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define hypre_ParCSRMatrixRowStarts \ hypre_F90_NAME(fhypre_parcsrmatrixrowstarts, FHYPRE_PARCSRMATRIXROWSTARTS) extern void hypre_F90_NAME(fhypre_parcsrmatrixrowstarts, FHYPRE_PARCSRMATRIXROWSTARTS) - (hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *); #define hypre_ParVectorSetDataOwner \ hypre_F90_NAME(fhypre_setparvectordataowner, FHYPRE_SETPARVECTORDATAOWNER) extern void hypre_F90_NAME(fhypre_setparvectordataowner, FHYPRE_SETPARVECTORDATAOWNER) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define GenerateLaplacian \ hypre_F90_NAME(fgeneratelaplacian, FHYPRE_GENERATELAPLACIAN) extern void hypre_F90_NAME(fgeneratelaplacian, FHYPRE_GENERATELAPLACIAN) - (HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, - HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Real *, hypre_F90_Obj *); +(HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, + HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Real *, hypre_F90_Obj *); #define HYPRE_BoomerAMGCreate \ hypre_F90_NAME(fhypre_boomeramgcreate, FHYPRE_BOOMERAMGCREATE) extern void hypre_F90_NAME(fhypre_boomeramgcreate, FHYPRE_BOOMERAMGCREATE) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_BoomerAMGDestroy \ hypre_F90_NAME(fhypre_boomeramgdestroy, FHYPRE_BOOMERAMGDESTROY) extern void hypre_F90_NAME(fhypre_boomeramgdestroy, FHYPRE_BOOMERAMGDESTROY) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_BoomerAMGSetup \ hypre_F90_NAME(fhypre_boomeramgsetup, FHYPRE_BOOMERAMGSETUP) extern void hypre_F90_NAME(fhypre_boomeramgsetup, FHYPRE_BOOMERAMGSETUP) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_BoomerAMGSolve \ hypre_F90_NAME(fhypre_boomeramgsolve, FHYPRE_BOOMERAMGSOLVE) extern void hypre_F90_NAME(fhypre_boomeramgsolve, FHYPRE_BOOMERAMGSOLVE) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_BoomerAMGSolveT \ hypre_F90_NAME(fhypre_boomeramgsolvet, FHYPRE_BOOMERAMGSOLVET) extern void hypre_F90_NAME(fhypre_boomeramgsolvet, FHYPRE_BOOMERAMGSOLVET) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_BoomerAMGSetRestriction \ hypre_F90_NAME(fhypre_boomeramgsetrestriction, FHYPRE_BOOMERAMGSETRESTRICTION) extern void hypre_F90_NAME(fhypre_boomeramgsetrestriction, FHYPRE_BOOMERAMGSETRESTRICTION) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGSetMaxLevels \ hypre_F90_NAME(fhypre_boomeramgsetmaxlevels, FHYPRE_BOOMERAMGSETMAXLEVELS) extern void hypre_F90_NAME(fhypre_boomeramgsetmaxlevels, FHYPRE_BOOMERAMGSETMAXLEVELS) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGGetMaxLevels \ hypre_F90_NAME(fhypre_boomeramggetmaxlevels, FHYPRE_BOOMERAMGGETMAXLEVELS) extern void hypre_F90_NAME(fhypre_boomeramggetmaxlevels, FHYPRE_BOOMERAMGGETMAXLEVELS) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGSetCoarsenCutFactor \ hypre_F90_NAME(fhypre_boomeramgsetcoarsencutfa, FHYPRE_BOOMERAMGSETCOARSENCUTFAC) extern void hypre_F90_NAME(fhypre_boomeramgsetcoarsencutfa, FHYPRE_BOOMERAMGSETCOARSENCUTFAC) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_BoomerAMGGetCoarsenCutFactor \ hypre_F90_NAME(fhypre_boomeramggetcoarsencutfa, FHYPRE_BOOMERAMGGETCOARSENCUTFAC) extern void hypre_F90_NAME(fhypre_boomeramggetcoarsencutfa, FHYPRE_BOOMERAMGGETCOARSENCUTFAC) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_BoomerAMGSetStrongThreshold \ hypre_F90_NAME(fhypre_boomeramgsetstrongthrshl, FHYPRE_BOOMERAMGSETSTRONGTHRSHL) extern void hypre_F90_NAME(fhypre_boomeramgsetstrongthrshl, FHYPRE_BOOMERAMGSETSTRONGTHRSHL) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_BoomerAMGGetStrongThreshold \ hypre_F90_NAME(fhypre_boomeramggetstrongthrshl, FHYPRE_BOOMERAMGGETSTRONGTHRSHL) extern void hypre_F90_NAME(fhypre_boomeramggetstrongthrshl, FHYPRE_BOOMERAMGGETSTRONGTHRSHL) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_BoomerAMGSetMaxRowSum \ hypre_F90_NAME(fhypre_boomeramgsetmaxrowsum, FHYPRE_BOOMERAMGSETMAXROWSUM) extern void hypre_F90_NAME(fhypre_boomeramgsetmaxrowsum, FHYPRE_BOOMERAMGSETMAXROWSUM) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_BoomerAMGGetMaxRowSum \ hypre_F90_NAME(fhypre_boomeramggetmaxrowsum, FHYPRE_BOOMERAMGGETMAXROWSUM) extern void hypre_F90_NAME(fhypre_boomeramggetmaxrowsum, FHYPRE_BOOMERAMGGETMAXROWSUM) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_BoomerAMGSetTruncFactor \ hypre_F90_NAME(fhypre_boomeramgsettruncfactor, FHYPRE_BOOMERAMGSETTRUNCFACTOR) extern void hypre_F90_NAME(fhypre_boomeramgsettruncfactor, FHYPRE_BOOMERAMGSETTRUNCFACTOR) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_BoomerAMGGetTruncFactor \ hypre_F90_NAME(fhypre_boomeramggettruncfactor, FHYPRE_BOOMERAMGGETTRUNCFACTOR) extern void hypre_F90_NAME(fhypre_boomeramggettruncfactor, FHYPRE_BOOMERAMGGETTRUNCFACTOR) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_BoomerAMGSetSCommPkgSwitch \ hypre_F90_NAME(fhypre_boomeramgsetscommpkgswit, FHYPRE_BOOMERAMGSETSCOMMPKGSWIT) extern void hypre_F90_NAME(fhypre_boomeramgsetscommpkgswit, FHYPRE_BOOMERAMGSETSCOMMPKGSWIT) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGSetInterpType \ hypre_F90_NAME(fhypre_boomeramgsetinterptype, FHYPRE_BOOMERAMGSETINTERPTYPE) extern void hypre_F90_NAME(fhypre_boomeramgsetinterptype, FHYPRE_BOOMERAMGSETINTERPTYPE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGSetMinIter \ hypre_F90_NAME(fhypre_boomeramgsetminiter, FHYPRE_BOOMERAMGSETMINITER) extern void hypre_F90_NAME(fhypre_boomeramgsetminiter, FHYPRE_BOOMERAMGSETMINITER) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGSetMaxIter \ hypre_F90_NAME(fhypre_boomeramgsetmaxiter, FHYPRE_BOOMERAMGSETMAXITER) extern void hypre_F90_NAME(fhypre_boomeramgsetmaxiter, FHYPRE_BOOMERAMGSETMAXITER) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGGetMaxIter \ hypre_F90_NAME(fhypre_boomeramggetmaxiter, FHYPRE_BOOMERAMGGETMAXITER) extern void hypre_F90_NAME(fhypre_boomeramggetmaxiter, FHYPRE_BOOMERAMGGETMAXITER) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGSetCoarsenType \ hypre_F90_NAME(fhypre_boomeramgsetcoarsentype, FHYPRE_BOOMERAMGSETCOARSENTYPE) extern void hypre_F90_NAME(fhypre_boomeramgsetcoarsentype, FHYPRE_BOOMERAMGSETCOARSENTYPE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGGetCoarsenType \ hypre_F90_NAME(fhypre_boomeramggetcoarsentype, FHYPRE_BOOMERAMGGETCOARSENTYPE) extern void hypre_F90_NAME(fhypre_boomeramggetcoarsentype, FHYPRE_BOOMERAMGGETCOARSENTYPE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGSetMeasureType \ hypre_F90_NAME(fhypre_boomeramgsetmeasuretype, FHYPRE_BOOMERAMGSETMEASURETYPE) extern void hypre_F90_NAME(fhypre_boomeramgsetmeasuretype, FHYPRE_BOOMERAMGSETMEASURETYPE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGGetMeasureType \ hypre_F90_NAME(fhypre_boomeramggetmeasuretype, FHYPRE_BOOMERAMGGETMEASURETYPE) extern void hypre_F90_NAME(fhypre_boomeramggetmeasuretype, FHYPRE_BOOMERAMGGETMEASURETYPE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGSetSetupType \ hypre_F90_NAME(fhypre_boomeramgsetsetuptype, FHYPRE_BOOMERAMGSETSETUPTYPE) extern void hypre_F90_NAME(fhypre_boomeramgsetsetuptype, FHYPRE_BOOMERAMGSETSETUPTYPE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGSetCycleType \ hypre_F90_NAME(fhypre_boomeramgsetcycletype, FHYPRE_BOOMERAMGSETCYCLETYPE) extern void hypre_F90_NAME(fhypre_boomeramgsetcycletype, FHYPRE_BOOMERAMGSETCYCLETYPE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGGetCycleType \ hypre_F90_NAME(fhypre_boomeramggetcycletype, FHYPRE_BOOMERAMGGETCYCLETYPE) extern void hypre_F90_NAME(fhypre_boomeramggetcycletype, FHYPRE_BOOMERAMGGETCYCLETYPE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGSetTol \ hypre_F90_NAME(fhypre_boomeramgsettol, FHYPRE_BOOMERAMGSETTOL) extern void hypre_F90_NAME(fhypre_boomeramgsettol, FHYPRE_BOOMERAMGSETTOL) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_BoomerAMGGetTol \ hypre_F90_NAME(fhypre_boomeramggettol, FHYPRE_BOOMERAMGGETTOL) extern void hypre_F90_NAME(fhypre_boomeramggettol, FHYPRE_BOOMERAMGGETTOL) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_BoomerAMGSetNumSweeps \ hypre_F90_NAME(fhypre_boomeramgsetnumsweeps, FHYPRE_BOOMERAMGSETNUMSWEEPS) extern void hypre_F90_NAME(fhypre_boomeramgsetnumsweeps, FHYPRE_BOOMERAMGSETNUMSWEEPS) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGSetCycleNumSweeps \ hypre_F90_NAME(fhypre_boomeramgsetcyclenumswee, FHYPRE_BOOMERAMGSETCYCLENUMSWEE) extern void hypre_F90_NAME(fhypre_boomeramgsetcyclenumswee, FHYPRE_BOOMERAMGSETCYCLENUMSWEE) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *); #define HYPRE_BoomerAMGGetCycleNumSweeps \ hypre_F90_NAME(fhypre_boomeramggetcyclenumswee, FHYPRE_BOOMERAMGGETCYCLENUMSWEE) extern void hypre_F90_NAME(fhypre_boomeramggetcyclenumswee, FHYPRE_BOOMERAMGGETCYCLENUMSWEE) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *); #define HYPRE_BoomerAMGInitGridRelaxation \ hypre_F90_NAME(fhypre_boomeramginitgridrelaxat, FHYPRE_BOOMERAMGINITGRIDRELAXAT) extern void hypre_F90_NAME(fhypre_boomeramginitgridrelaxat, FHYPRE_BOOMERAMGINITGRIDRELAXAT) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, HYPRE_Int *, hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, HYPRE_Int *, hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGFinalizeGridRelaxation \ hypre_F90_NAME(fhypre_boomeramgfingridrelaxatn, FHYPRE_BOOMERAMGFINGRIDRELAXATN) extern void hypre_F90_NAME(fhypre_boomeramgfingridrelaxatn, FHYPRE_BOOMERAMGFINGRIDRELAXATN) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_BoomerAMGSetRelaxType \ hypre_F90_NAME(fhypre_boomeramgsetrelaxtype, FHYPRE_BOOMERAMGSETRELAXTYPE) extern void hypre_F90_NAME(fhypre_boomeramgsetrelaxtype, FHYPRE_BOOMERAMGSETRELAXTYPE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGSetRelaxType \ hypre_F90_NAME(fhypre_boomeramgsetrelaxtype, FHYPRE_BOOMERAMGSETRELAXTYPE) extern void hypre_F90_NAME(fhypre_boomeramgsetrelaxtype, FHYPRE_BOOMERAMGSETRELAXTYPE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGSetRelaxOrder \ hypre_F90_NAME(fhypre_boomeramgsetrelaxorder, FHYPRE_BOOMERAMGSETRELAXORDER) extern void hypre_F90_NAME(fhypre_boomeramgsetrelaxorder, FHYPRE_BOOMERAMGSETRELAXORDER) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGSetRelaxWeight \ hypre_F90_NAME(fhypre_boomeramgsetrelaxweight, FHYPRE_BOOMERAMGSETRELAXWEIGHT) extern void hypre_F90_NAME(fhypre_boomeramgsetrelaxweight, FHYPRE_BOOMERAMGSETRELAXWEIGHT) - (hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_BoomerAMGSetRelaxWt \ hypre_F90_NAME(fhypre_boomeramgsetrelaxwt, FHYPRE_BOOMERAMGSETRELAXWT) extern void hypre_F90_NAME(fhypre_boomeramgsetrelaxwt, FHYPRE_BOOMERAMGSETRELAXWT) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_BoomerAMGSetLevelRelaxWt \ hypre_F90_NAME(fhypre_boomeramgsetlevelrelaxwt, FHYPRE_BOOMERAMGSETLEVELRELAXWT) extern void hypre_F90_NAME(fhypre_boomeramgsetlevelrelaxwt, FHYPRE_BOOMERAMGSETLEVELRELAXWT) - (hypre_F90_Obj *, HYPRE_Real *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Real *, HYPRE_Int *); #define HYPRE_BoomerAMGSetOuterWt \ hypre_F90_NAME(fhypre_boomeramgsetouterwt, FHYPRE_BOOMERAMGSETOUTERWT) extern void hypre_F90_NAME(fhypre_boomeramgsetouterwt, FHYPRE_BOOMERAMGSETOUTERWT) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_BoomerAMGSetLevelOuterWt \ hypre_F90_NAME(fhypre_boomeramgsetlevelouterwt, FHYPRE_BOOMERAMGSETLEVELOUTERWT) extern void hypre_F90_NAME(fhypre_boomeramgsetlevelouterwt, FHYPRE_BOOMERAMGSETLEVELOUTERWT) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_BoomerAMGSetSmoothType \ hypre_F90_NAME(fhypre_boomeramgsetsmoothtype, FHYPRE_BOOMERAMGSETSMOOTHTYPE) extern void hypre_F90_NAME(fhypre_boomeramgsetsmoothtype, FHYPRE_BOOMERAMGSETSMOOTHTYPE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGGetSmoothType \ hypre_F90_NAME(fhypre_boomeramggetsmoothtype, FHYPRE_BOOMERAMGGETSMOOTHTYPE) extern void hypre_F90_NAME(fhypre_boomeramggetsmoothtype, FHYPRE_BOOMERAMGGETSMOOTHTYPE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGSetSmoothNumLvls \ hypre_F90_NAME(fhypre_boomeramgsetsmoothnumlvl, FHYPRE_BOOMERAMGSETSMOOTHNUMLVL) extern void hypre_F90_NAME(fhypre_boomeramgsetsmoothnumlvl, FHYPRE_BOOMERAMGSETSMOOTHNUMLVL) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGGetSmoothNumLvls \ hypre_F90_NAME(fhypre_boomeramggetsmoothnumlvl, FHYPRE_BOOMERAMGGETSMOOTHNUMLVL) extern void hypre_F90_NAME(fhypre_boomeramggetsmoothnumlvl, FHYPRE_BOOMERAMGGETSMOOTHNUMLVL) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGSetSmoothNumSwps \ hypre_F90_NAME(fhypre_boomeramgsetsmoothnumswp, FHYPRE_BOOMERAMGSETSMOOTHNUMSWP) extern void hypre_F90_NAME(fhypre_boomeramgsetsmoothnumswp, FHYPRE_BOOMERAMGSETSMOOTHNUMSWP) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGGetSmoothNumSwps \ hypre_F90_NAME(fhypre_boomeramggetsmoothnumswp, FHYPRE_BOOMERAMGGETSMOOTHNUMSWP) extern void hypre_F90_NAME(fhypre_boomeramggetsmoothnumswp, FHYPRE_BOOMERAMGGETSMOOTHNUMSWP) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGSetLogging \ hypre_F90_NAME(fhypre_boomeramgsetlogging, FHYPRE_BOOMERAMGSETLOGGING) extern void hypre_F90_NAME(fhypre_boomeramgsetlogging, FHYPRE_BOOMERAMGSETLOGGING) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGGetLogging \ hypre_F90_NAME(fhypre_boomeramggetlogging, FHYPRE_BOOMERAMGGETLOGGING) extern void hypre_F90_NAME(fhypre_boomeramggetlogging, FHYPRE_BOOMERAMGGETLOGGING) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGSetPrintLevel \ hypre_F90_NAME(fhypre_boomeramgsetprintlevel, FHYPRE_BOOMERAMGSETPRINTLEVEL) extern void hypre_F90_NAME(fhypre_boomeramgsetprintlevel, FHYPRE_BOOMERAMGSETPRINTLEVEL) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGGetPrintLevel \ hypre_F90_NAME(fhypre_boomeramggetprintlevel, FHYPRE_BOOMERAMGGETPRINTLEVEL) extern void hypre_F90_NAME(fhypre_boomeramggetprintlevel, FHYPRE_BOOMERAMGGETPRINTLEVEL) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGSetPrintFileName \ hypre_F90_NAME(fhypre_boomeramgsetprintfilenam, FHYPRE_BOOMERAMGSETPRINTFILENAM) extern void hypre_F90_NAME(fhypre_boomeramgsetprintfilenam, FHYPRE_BOOMERAMGSETPRINTFILENAM) - (hypre_F90_Obj *, char *); +(hypre_F90_Obj *, char *); #define HYPRE_BoomerAMGSetDebugFlag \ hypre_F90_NAME(fhypre_boomeramgsetdebugflag, FHYPRE_BOOMERAMGSETDEBUGFLAG) extern void hypre_F90_NAME(fhypre_boomeramgsetdebugflag, FHYPRE_BOOMERAMGSETDEBUGFLAG) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGGetDebugFlag \ hypre_F90_NAME(fhypre_boomeramggetdebugflag, FHYPRE_BOOMERAMGGETDEBUGFLAG) extern void hypre_F90_NAME(fhypre_boomeramggetdebugflag, FHYPRE_BOOMERAMGGETDEBUGFLAG) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGGetNumIterations \ hypre_F90_NAME(fhypre_boomeramggetnumiteration, FHYPRE_BOOMERAMGGETNUMITERATION) extern void hypre_F90_NAME(fhypre_boomeramggetnumiteration, FHYPRE_BOOMERAMGGETNUMITERATION) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGGetCumNumIterations \ hypre_F90_NAME(fhypre_boomeramggetcumnumiterat, FHYPRE_BOOMERAMGGETCUMNUMITERAT) extern void hypre_F90_NAME(fhypre_boomeramggetcumnumiterat, FHYPRE_BOOMERAMGGETCUMNUMITERAT) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGGetResidual \ hypre_F90_NAME(fhypre_boomeramggetresidual, FHYPRE_BOOMERAMGGETRESIDUAL) extern void hypre_F90_NAME(fhypre_boomeramggetresidual, FHYPRE_BOOMERAMGGETRESIDUAL) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_BoomerAMGGetFinalRelativeResidualNorm \ hypre_F90_NAME(fhypre_boomeramggetfinalreltvre, FHYPRE_BOOMERAMGGETFINALRELTVRE) extern void hypre_F90_NAME(fhypre_boomeramggetfinalreltvre, FHYPRE_BOOMERAMGGETFINALRELTVRE) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_BoomerAMGSetVariant \ hypre_F90_NAME(fhypre_boomeramgsetvariant, FHYPRE_BOOMERAMGSETVARIANT) extern void hypre_F90_NAME(fhypre_boomeramgsetvariant, FHYPRE_BOOMERAMGSETVARIANT) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGGetVariant \ hypre_F90_NAME(fhypre_boomeramggetvariant, FHYPRE_BOOMERAMGGETVARIANT) extern void hypre_F90_NAME(fhypre_boomeramggetvariant, FHYPRE_BOOMERAMGGETVARIANT) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGSetOverlap \ hypre_F90_NAME(fhypre_boomeramgsetoverlap, FHYPRE_BOOMERAMGSETOVERLAP) extern void hypre_F90_NAME(fhypre_boomeramgsetoverlap, FHYPRE_BOOMERAMGSETOVERLAP) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGGetOverlap \ hypre_F90_NAME(fhypre_boomeramggetoverlap, FHYPRE_BOOMERAMGGETOVERLAP) extern void hypre_F90_NAME(fhypre_boomeramggetoverlap, FHYPRE_BOOMERAMGGETOVERLAP) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGSetDomainType \ hypre_F90_NAME(fhypre_boomeramgsetdomaintype, FHYPRE_BOOMERAMGSETDOMAINTYPE) extern void hypre_F90_NAME(fhypre_boomeramgsetdomaintype, FHYPRE_BOOMERAMGSETDOMAINTYPE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGGetDomainType \ hypre_F90_NAME(fhypre_boomeramggetdomaintype, FHYPRE_BOOMERAMGGETDOMAINTYPE) extern void hypre_F90_NAME(fhypre_boomeramggetdomaintype, FHYPRE_BOOMERAMGGETDOMAINTYPE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGSetSchwarzRlxWt \ hypre_F90_NAME(fhypre_boomeramgsetschwarzrlxwt, FHYPRE_BOOMERAMGSETSCHWARZRLXWT) extern void hypre_F90_NAME(fhypre_boomeramgsetschwarzrlxwt, FHYPRE_BOOMERAMGSETSCHWARZRLXWT) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGGetSchwarzRlxWt \ hypre_F90_NAME(fhypre_boomeramggetschwarzrlxwt, FHYPRE_BOOMERAMGGETSCHWARZRLXWT) extern void hypre_F90_NAME(fhypre_boomeramggetschwarzrlxwt, FHYPRE_BOOMERAMGGETSCHWARZRLXWT) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGSetSym \ hypre_F90_NAME(fhypre_boomeramgsetsym, FHYPRE_BOOMERAMGSETSYM) extern void hypre_F90_NAME(fhypre_boomeramgsetsym, FHYPRE_BOOMERAMGSETSYM) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGSetLevel \ hypre_F90_NAME(fhypre_boomeramgsetlevel, FHYPRE_BOOMERAMGSETLEVEL) extern void hypre_F90_NAME(fhypre_boomeramgsetlevel, FHYPRE_BOOMERAMGSETLEVEL) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGSetFilter \ hypre_F90_NAME(fhypre_boomeramgsetfilter, FHYPRE_BOOMERAMGSETFILTER) extern void hypre_F90_NAME(fhypre_boomeramgsetfilter, FHYPRE_BOOMERAMGSETFILTER) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGSetDropTol \ hypre_F90_NAME(fhypre_boomeramgsetdroptol, FHYPRE_BOOMERAMGSETDROPTOL) extern void hypre_F90_NAME(fhypre_boomeramgsetdroptol, FHYPRE_BOOMERAMGSETDROPTOL) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGSetMaxNzPerRow \ hypre_F90_NAME(fhypre_boomeramgsetmaxnzperrow, FHYPRE_BOOMERAMGSETMAXNZPERROW) extern void hypre_F90_NAME(fhypre_boomeramgsetmaxnzperrow, FHYPRE_BOOMERAMGSETMAXNZPERROW) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGSetEuclidFile \ hypre_F90_NAME(fhypre_boomeramgseteuclidfile, FHYPRE_BOOMERAMGSETEUCLIDFILE) extern void hypre_F90_NAME(fhypre_boomeramgseteuclidfile, FHYPRE_BOOMERAMGSETEUCLIDFILE) - (hypre_F90_Obj *, char *); +(hypre_F90_Obj *, char *); #define HYPRE_BoomerAMGSetNumFunctions \ hypre_F90_NAME(fhypre_boomeramgsetnumfunctions, FHYPRE_BOOMERAMGSETNUMFUNCTIONS) extern void hypre_F90_NAME(fhypre_boomeramgsetnumfunctions, FHYPRE_BOOMERAMGSETNUMFUNCTIONS) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGGetNumFunctions \ hypre_F90_NAME(fhypre_boomeramggetnumfunctions, FHYPRE_BOOMERAMGGETNUMFUNCTIONS) extern void hypre_F90_NAME(fhypre_boomeramggetnumfunctions, FHYPRE_BOOMERAMGGETNUMFUNCTIONS) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGSetNodal \ hypre_F90_NAME(fhypre_boomeramgsetnodal, FHYPRE_BOOMERAMGSETNODAL) extern void hypre_F90_NAME(fhypre_boomeramgsetnodal, FHYPRE_BOOMERAMGSETNODAL) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGSetDofFunc \ hypre_F90_NAME(fhypre_boomeramgsetdoffunc, FHYPRE_BOOMERAMGSETDOFFUNC) extern void hypre_F90_NAME(fhypre_boomeramgsetdoffunc, FHYPRE_BOOMERAMGSETDOFFUNC) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGSetNumPaths \ hypre_F90_NAME(fhypre_boomeramgsetnumpaths, FHYPRE_BOOMERAMGSETNUMPATHS) extern void hypre_F90_NAME(fhypre_boomeramgsetnumpaths, FHYPRE_BOOMERAMGSETNUMPATHS) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGSetAggNumLevels \ hypre_F90_NAME(fhypre_boomeramgsetaggnumlevels, FHYPRE_BOOMERAMGSETAGGNUMLEVELS) extern void hypre_F90_NAME(fhypre_boomeramgsetaggnumlevels, FHYPRE_BOOMERAMGSETAGGNUMLEVELS) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGSetGSMG \ hypre_F90_NAME(fhypre_boomeramgsetgsmg, FHYPRE_BOOMERAMGSETGSMG) extern void hypre_F90_NAME(fhypre_boomeramgsetgsmg, FHYPRE_BOOMERAMGSETGSMG) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BoomerAMGSetNumSamples \ hypre_F90_NAME(fhypre_boomeramgsetnumsamples, FHYPRE_BOOMERAMGSETNUMSAMPLES) extern void hypre_F90_NAME(fhypre_boomeramgsetsamples, FHYPRE_BOOMERAMGSETNUMSAMPLES) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRBiCGSTABCreate \ hypre_F90_NAME(fhypre_parcsrbicgstabcreate, FHYPRE_PARCSRBICGSTABCREATE) extern void hypre_F90_NAME(fhypre_parcsrbicgstabcreate, FHYPRE_PARCSRBICGSTABCREATE) - (HYPRE_Int *, hypre_F90_Obj *); +(HYPRE_Int *, hypre_F90_Obj *); #define HYPRE_ParCSRBiCGSTABDestroy \ hypre_F90_NAME(fhypre_parcsrbicgstabdestroy, FHYPRE_PARCSRBICGSTABDESTROY) extern void hypre_F90_NAME(fhypre_parcsrbicgstabdestroy, FHYPRE_PARCSRBICGSTABDESTROY) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_ParCSRBiCGSTABSetup \ hypre_F90_NAME(fhypre_parcsrbicgstabsetup, FHYPRE_PARCSRBICGSTABSETUP) extern void hypre_F90_NAME(fhypre_parcsrbicgstabsetup, FHYPRE_PARCSRBICGSTABSETUP) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_ParCSRBiCGSTABSolve \ hypre_F90_NAME(fhypre_parcsrbicgstabsolve, FHYPRE_PARCSRBICGSTABSOLVE) extern void hypre_F90_NAME(fhypre_parcsrbicgstabsolve, FHYPRE_PARCSRBICGSTABSOLVE) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_ParCSRBiCGSTABSetTol \ hypre_F90_NAME(fhypre_parcsrbicgstabsettol, FHYPRE_PARCSRBICGSTABSETTOL) extern void hypre_F90_NAME(fhypre_parcsrbicgstabsettol, FHYPRE_PARCSRBICGSTABSETTOL) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_ParCSRBiCGSTABSetMinIter \ hypre_F90_NAME(fhypre_parcsrbicgstabsetminiter, FHYPRE_PARCSRBICGSTABSETMINITER) extern void hypre_F90_NAME(fhypre_parcsrbicgstabsetminiter, FHYPRE_PARCSRBICGSTABSETMINITER) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRBiCGSTABSetMaxIter \ hypre_F90_NAME(fhypre_parcsrbicgstabsetmaxiter, FHYPRE_PARCSRBICGSTABSETMAXITER) extern void hypre_F90_NAME(fhypre_parcsrbicgstabsetmaxiter, FHYPRE_PARCSRBICGSTABSETMAXITER) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRBiCGSTABSetStopCrit \ hypre_F90_NAME(fhypre_parcsrbicgstabsetstopcri, FHYPRE_PARCSRBICGSTABSETSTOPCRI) extern void hypre_F90_NAME(fhypre_parcsrbicgstabsetstopcri, FHYPRE_PARCSRBICGSTABSETSTOPCRI) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRBiCGSTABSetPrecond \ hypre_F90_NAME(fhypre_parcsrbicgstabsetprecond, FHYPRE_PARCSRBICGSTABSETPRECOND) extern void hypre_F90_NAME(fhypre_parcsrbicgstabsetprecond, FHYPRE_PARCSRBICGSTABSETPRECOND) - (hypre_F90_Obj *, HYPRE_Int *, hypre_F90_Obj *); +(hypre_F90_Obj *, HYPRE_Int *, hypre_F90_Obj *); #define HYPRE_ParCSRBiCGSTABGetPrecond \ hypre_F90_NAME(fhypre_parcsrbicgstabgetprecond, FHYPRE_PARCSRBICGSTABGETPRECOND) extern void hypre_F90_NAME(fhypre_parcsrbicgstabgetprecond, FHYPRE_PARCSRBICGSTABGETPRECOND) - (hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_ParCSRBiCGSTABSetLogging \ hypre_F90_NAME(fhypre_parcsrbicgstabsetlogging, FHYPRE_PARCSRBICGSTABSETLOGGING) extern void hypre_F90_NAME(fhypre_parcsrbicgstabsetlogging, FHYPRE_PARCSRBICGSTABSETLOGGING) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRBiCGSTABSetPrintLevel \ hypre_F90_NAME(fhypre_parcsrbicgstabsetprintle, FHYPRE_PARCSRBICGSTABSETPRINTLE) extern void hypre_F90_NAME(fhypre_parcsrbicgstabsetprintle, FHYPRE_PARCSRBICGSTABSETPRINTLE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRBiCGSTABGetNumIter \ hypre_F90_NAME(fhypre_parcsrbicgstabgetnumiter, FHYPRE_PARCSRBICGSTABGETNUMITER) extern void hypre_F90_NAME(fhypre_parcsrbicgstabgetnumiter, FHYPRE_PARCSRBICGSTABGETNUMITER) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRBiCGSTABGetFinalRel \ hypre_F90_NAME(fhypre_parcsrbicgstabgetfinalre, FHYPRE_PARCSRBICGSTABGETFINALRE) extern void hypre_F90_NAME(fhypre_parcsrbicgstabgetfinalre, FHYPRE_PARCSRBICGSTABGETFINALRE) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_BlockTridiagCreate \ - hypre_F90_NAME(fhypre_blocktridiagcreate, FHYPRE_BLOCKTRIDIAGCREATE) + hypre_F90_NAME(fhypre_blocktridiagcreate, FHYPRE_BLOCKTRIDIAGCREATE) extern void hypre_F90_NAME(fhypre_blocktridiagcreate, FHYPRE_BLOCKTRIDIAGCREATE) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_BlockTridiagDestroy \ - hypre_F90_NAME(fhypre_blocktridiagdestroy, FHYPRE_BLOCKTRIDIAGDESTROY) + hypre_F90_NAME(fhypre_blocktridiagdestroy, FHYPRE_BLOCKTRIDIAGDESTROY) extern void hypre_F90_NAME(fhypre_blocktridiagdestroy, FHYPRE_BLOCKTRIDIAGDESTROY) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_BlockTridiagSetup \ - hypre_F90_NAME(fhypre_blocktridiagsetup, FHYPRE_BLOCKTRIDIAGSETUP) + hypre_F90_NAME(fhypre_blocktridiagsetup, FHYPRE_BLOCKTRIDIAGSETUP) extern void hypre_F90_NAME(fhypre_blocktridiagsetup, FHYPRE_BLOCKTRIDIAGSETUP) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_BlockTridiagSolve \ - hypre_F90_NAME(fhypre_blocktridiagsolve, FHYPRE_BLOCKTRIDIAGSOLVE) + hypre_F90_NAME(fhypre_blocktridiagsolve, FHYPRE_BLOCKTRIDIAGSOLVE) extern void hypre_F90_NAME(fhypre_blocktridiagsolve, FHYPRE_BLOCKTRIDIAGSOLVE) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_BlockTridiagSetIndexSet \ - hypre_F90_NAME(fhypre_blocktridiagsetindexset, FHYPRE_BLOCKTRIDIAGSETINDEXSET) + hypre_F90_NAME(fhypre_blocktridiagsetindexset, FHYPRE_BLOCKTRIDIAGSETINDEXSET) extern void hypre_F90_NAME(fhypre_blocktridiagsetindexset, FHYPRE_BLOCKTRIDIAGSETINDEXSET) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *); #define HYPRE_BlockTridiagSetAMGStrengthThreshold \ - hypre_F90_NAME(fhypre_blocktridiagsetamgstreng, FHYPRE_BLOCKTRIDIAGSETAMGSTRENG) + hypre_F90_NAME(fhypre_blocktridiagsetamgstreng, FHYPRE_BLOCKTRIDIAGSETAMGSTRENG) extern void hypre_F90_NAME(fhypre_blocktridiagsetamgstreng, FHYPRE_BLOCKTRIDIAGSETAMGSTRENG) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_BlockTridiagSetAMGNumSweeps \ - hypre_F90_NAME(fhypre_blocktridiagsetamgnumswe, FHYPRE_BLOCKTRIDIAGSETAMGNUMSWE) + hypre_F90_NAME(fhypre_blocktridiagsetamgnumswe, FHYPRE_BLOCKTRIDIAGSETAMGNUMSWE) extern void hypre_F90_NAME(fhypre_blocktridiagsetamgnumswe, FHYPRE_BLOCKTRIDIAGSETAMGNUMSWE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BlockTridiagSetAMGRelaxType \ - hypre_F90_NAME(fhypre_blocktridiagsetamgrelaxt, FHYPRE_BLOCKTRIDIAGSETAMGRELAXT) + hypre_F90_NAME(fhypre_blocktridiagsetamgrelaxt, FHYPRE_BLOCKTRIDIAGSETAMGRELAXT) extern void hypre_F90_NAME(fhypre_blocktridiagsetamgrelaxt, FHYPRE_BLOCKTRIDIAGSETAMGRELAXT) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_BlockTridiagSetPrintLevel \ - hypre_F90_NAME(fhypre_blocktridiagsetprintleve, FHYPRE_BLOCKTRIDIAGSETPRINTLEVE) + hypre_F90_NAME(fhypre_blocktridiagsetprintleve, FHYPRE_BLOCKTRIDIAGSETPRINTLEVE) extern void hypre_F90_NAME(fhypre_blocktridiagsetprintleve, FHYPRE_BLOCKTRIDIAGSETPRINTLEVE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRCGNRCreate \ - hypre_F90_NAME(fhypre_parcsrcgnrcreate, FHYPRE_PARCSRCGNRCREATE) + hypre_F90_NAME(fhypre_parcsrcgnrcreate, FHYPRE_PARCSRCGNRCREATE) extern void hypre_F90_NAME(fhypre_parcsrcgnrcreate, FHYPRE_PARCSRCGNRCREATE) - (HYPRE_Int *, hypre_F90_Obj *); +(HYPRE_Int *, hypre_F90_Obj *); #define HYPRE_ParCSRCGNRDestroy \ hypre_F90_NAME(fhypre_parcsrcgnrdestroy, FHYPRE_PARCSRCGNRDESTROY) extern void hypre_F90_NAME(fhypre_parcsrcgnrdestroy, FHYPRE_PARCSRCGNRDESTROY) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_ParCSRCGNRSetup \ hypre_F90_NAME(fhypre_parcsrcgnrsetup, FHYPRE_PARCSRCGNRSETUP) extern void hypre_F90_NAME(fhypre_parcsrcgnrsetup, FHYPRE_PARCSRCGNRSETUP) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_ParCSRCGNRSolve \ hypre_F90_NAME(fhypre_parcsrcgnrsolve, FHYPRE_PARCSRCGNRSOLVE) extern void hypre_F90_NAME(fhypre_parcsrcgnrsolve, FHYPRE_PARCSRCGNRSOLVE) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_ParCSRCGNRSetTol \ hypre_F90_NAME(fhypre_parcsrcgnrsettol, FHYPRE_PARCSRCGNRSETTOL) extern void hypre_F90_NAME(fhypre_parcsrcgnrsettol, FHYPRE_PARCSRCGNRSETTOL) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_ParCSRCGNRSetMinIter \ hypre_F90_NAME(fhypre_parcsrcgnrsetminiter, FHYPRE_PARCSRCGNRSETMINITER) extern void hypre_F90_NAME(fhypre_parcsrcgnrsetminiter, FHYPRE_PARCSRCGNRSETMINITER) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRCGNRSetMaxIter \ hypre_F90_NAME(fhypre_parcsrcgnrsetmaxiter, FHYPRE_PARCSRCGNRSETMAXITER) extern void hypre_F90_NAME(fhypre_parcsrcgnrsetmaxiter, FHYPRE_PARCSRCGNRSETMAXITER) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRCGNRSetStopCrit \ hypre_F90_NAME(fhypre_parcsrcgnrsetstopcri, FHYPRE_PARCSRCGNRSETSTOPCRI) extern void hypre_F90_NAME(fhypre_parcsrcgnrsetstopcri, FHYPRE_PARCSRCGNRSETSTOPCRI) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRCGNRSetPrecond \ hypre_F90_NAME(fhypre_parcsrcgnrsetprecond, FHYPRE_PARCSRCGNRSETPRECOND) extern void hypre_F90_NAME(fhypre_parcsrcgnrsetprecond, FHYPRE_PARCSRCGNRSETPRECOND) - (hypre_F90_Obj *, HYPRE_Int *, hypre_F90_Obj *); +(hypre_F90_Obj *, HYPRE_Int *, hypre_F90_Obj *); #define HYPRE_ParCSRCGNRGetPrecond \ hypre_F90_NAME(fhypre_parcsrcgnrgetprecond, FHYPRE_PARCSRCGNRGETPRECOND) extern void hypre_F90_NAME(fhypre_parcsrcgnrgetprecond, FHYPRE_PARCSRCGNRGETPRECOND) - (hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_ParCSRCGNRSetLogging \ hypre_F90_NAME(fhypre_parcsrcgnrsetlogging, FHYPRE_PARCSRCGNRSETLOGGING) extern void hypre_F90_NAME(fhypre_parcsrcgnrsetlogging, FHYPRE_PARCSRCGNRSETLOGGING) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRCGNRGetNumIteration \ hypre_F90_NAME(fhypre_parcsrcgnrgetnumiteratio, FHYPRE_PARCSRCGNRGETNUMITERATIO) extern void hypre_F90_NAME(fhypre_parcsrcgnrgetnumiteratio, FHYPRE_PARCSRCGNRGETNUMITERATIO) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRCGNRGetFinalRelativeResidualNorm \ hypre_F90_NAME(fhypre_parcsrcgnrgetfinalrelati, FHYPRE_PARCSRCGNRGETFINALRELATI) extern void hypre_F90_NAME(fhypre_parcsrcgnrgetfinalrelati, FHYPRE_PARCSRCGNRGETFINALRELATI) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_EuclidCreate \ hypre_F90_NAME(fhypre_euclidcreate, FHYPRE_EUCLIDCREATE) extern void hypre_F90_NAME(fhypre_euclidcreate, FHYPRE_EUCLIDCREATE) - (HYPRE_Int *, hypre_F90_Obj *); +(HYPRE_Int *, hypre_F90_Obj *); #define HYPRE_EuclidDestroy \ hypre_F90_NAME(fhypre_eucliddestroy, FHYPRE_EUCLIDDESTROY) extern void hypre_F90_NAME(fhypre_eucliddestroy, FHYPRE_EUCLIDDESTROY) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_EuclidSetup \ hypre_F90_NAME(fhypre_euclidsetup, FHYPRE_EUCLIDSETUP) extern void hypre_F90_NAME(fhypre_euclidsetup, FHYPRE_EUCLIDSETUP) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_EuclidSolve \ hypre_F90_NAME(fhypre_euclidsolve, FHYPRE_EUCLIDSOLVE) extern void hypre_F90_NAME(fhypre_euclidsolve, FHYPRE_EUCLIDSOLVE) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_EuclidSetParams \ hypre_F90_NAME(fhypre_euclidsetparams, FHYPRE_EUCLIDSETPARAMS) extern void hypre_F90_NAME(fhypre_euclidsetparams, FHYPRE_EUCLIDSETPARAMS) - (hypre_F90_Obj *, HYPRE_Int *, char *); +(hypre_F90_Obj *, HYPRE_Int *, char *); #define HYPRE_EuclidSetParamsFromFile \ hypre_F90_NAME(fhypre_euclidsetparamsfromfile, FHYPRE_EUCLIDSETPARAMSFROMFILE) extern void hypre_F90_NAME(fhypre_euclidsetparamsfromfile, FHYPRE_EUCLIDSETPARAMSFROMFILE) - (hypre_F90_Obj *, char *); +(hypre_F90_Obj *, char *); #define HYPRE_ParCSRGMRESCreate \ hypre_F90_NAME(fhypre_parcsrgmrescreate, FHYPRE_PARCSRGMRESCREATE) extern void hypre_F90_NAME(fhypre_parcsrgmrescreate, FHYPRE_PARCSRGMRESCREATE) - (HYPRE_Int *, hypre_F90_Obj *); +(HYPRE_Int *, hypre_F90_Obj *); #define HYPRE_ParCSRGMRESDestroy \ hypre_F90_NAME(fhypre_parcsrgmresdestroy, FHYPRE_PARCSRGMRESDESTROY) extern void hypre_F90_NAME(fhypre_parcsrgmresdestroy, FHYPRE_PARCSRGMRESDESTROY) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_ParCSRGMRESSetup \ hypre_F90_NAME(fhypre_parcsrgmressetup, FHYPRE_PARCSRGMRESSETUP) extern void hypre_F90_NAME(fhypre_parcsrgmressetup, FHYPRE_PARCSRGMRESSETUP) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_ParCSRGMRESSolve \ hypre_F90_NAME(fhypre_parcsrgmressolve, FHYPRE_PARCSRGMRESSOLVE) extern void hypre_F90_NAME(fhypre_parcsrgmressolve, FHYPRE_PARCSRGMRESSOLVE) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_ParCSRGMRESSetKDim \ hypre_F90_NAME(fhypre_parcsrgmressetkdim, FHYPRE_PARCSRGMRESSETKDIM) extern void hypre_F90_NAME(fhypre_parcsrgmressetkdim, FHYPRE_PARCSRGMRESSETKDIM) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRGMRESSetTol \ hypre_F90_NAME(fhypre_parcsrgmressettol, FHYPRE_PARCSRGMRESSETTOL) extern void hypre_F90_NAME(fhypre_parcsrgmressettol, FHYPRE_PARCSRGMRESSETTOL) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_ParCSRGMRESSetMinIter \ hypre_F90_NAME(fhypre_parcsrgmressetminiter, FHYPRE_PARCSRGMRESSETMINITER) extern void hypre_F90_NAME(fhypre_parcsrgmressetminiter, FHYPRE_PARCSRGMRESSETMINITER) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRGMRESSetMaxIter \ hypre_F90_NAME(fhypre_parcsrgmressetmaxiter, FHYPRE_PARCSRGMRESSETMAXITER) extern void hypre_F90_NAME(fhypre_parcsrgmressetmaxiter, FHYPRE_PARCSRGMRESSETMAXITER) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRGMRESSetPrecond \ hypre_F90_NAME(fhypre_parcsrgmressetprecond, FHYPRE_PARCSRGMRESSETPRECOND) extern void hypre_F90_NAME(fhypre_parcsrgmressetprecond, FHYPRE_PARCSRGMRESSETPRECOND) - (hypre_F90_Obj *, HYPRE_Int *, hypre_F90_Obj *); +(hypre_F90_Obj *, HYPRE_Int *, hypre_F90_Obj *); #define HYPRE_ParCSRGMRESGetPrecond \ hypre_F90_NAME(fhypre_parcsrgmresgetprecond, FHYPRE_PARCSRGMRESGETPRECOND) extern void hypre_F90_NAME(fhypre_parcsrgmresgetprecond, FHYPRE_PARCSRGMRESGETPRECOND) - (hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_ParCSRGMRESSetLogging \ hypre_F90_NAME(fhypre_parcsrgmressetlogging, FHYPRE_PARCSRGMRESSETLOGGING) extern void hypre_F90_NAME(fhypre_parcsrgmressetlogging, FHYPRE_PARCSRGMRESSETLOGGING) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRGMRESSetPrintLevel \ hypre_F90_NAME(fhypre_parcsrgmressetprintlevel, FHYPRE_PARCSRGMRESSETPRINTLEVEL) extern void hypre_F90_NAME(fhypre_parcsrgmressetprintlevel, FHYPRE_PARCSRGMRESSETPRINTLEVEL) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRGMRESGetNumIterations \ hypre_F90_NAME(fhypre_parcsrgmresgetnumiterati, FHYPRE_PARCSRGMRESGETNUMITERATI) extern void hypre_F90_NAME(fhypre_parcsrgmresgetnumiterati, FHYPRE_PARCSRGMRESGETNUMITERATI) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRGMRESGetFinalRelativeResidualNorm \ hypre_F90_NAME(fhypre_parcsrgmresgetfinalrelat, FHYPRE_PARCSRGMRESGETFINALRELAT) extern void hypre_F90_NAME(fhypre_parcsrgmresgetfinalrelat, FHYPRE_PARCSRGMRESGETFINALRELAT) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_ParCSRCOGMRESCreate \ hypre_F90_NAME(fhypre_parcsrcogmrescreate, FHYPRE_PARCSRCOGMRESCREATE) extern void hypre_F90_NAME(fhypre_parcsrcogmrescreate, FHYPRE_PARCSRCOGMRESCREATE) - (HYPRE_Int *, hypre_F90_Obj *); +(HYPRE_Int *, hypre_F90_Obj *); #define HYPRE_ParCSRCOGMRESDestroy \ hypre_F90_NAME(fhypre_parcsrcogmresdestroy, FHYPRE_PARCSRCOGMRESDESTROY) extern void hypre_F90_NAME(fhypre_parcsrcogmresdestroy, FHYPRE_PARCSRCOGMRESDESTROY) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_ParCSRCOGMRESSetup \ hypre_F90_NAME(fhypre_parcsrcogmressetup, FHYPRE_PARCSRCOGMRESSETUP) extern void hypre_F90_NAME(fhypre_parcsrcogmressetup, FHYPRE_PARCSRCOGMRESSETUP) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_ParCSRCOGMRESSolve \ hypre_F90_NAME(fhypre_parcsrcogmressolve, FHYPRE_PARCSRCOGMRESSOLVE) extern void hypre_F90_NAME(fhypre_parcsrcogmressolve, FHYPRE_PARCSRCOGMRESSOLVE) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_ParCSRCOGMRESSetKDim \ hypre_F90_NAME(fhypre_parcsrcogmressetkdim, FHYPRE_PARCSRCOGMRESSETKDIM) extern void hypre_F90_NAME(fhypre_parcsrcogmressetkdim, FHYPRE_PARCSRCOGMRESSETKDIM) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRCOGMRESSetUnroll \ hypre_F90_NAME(fhypre_parcsrcogmressetunroll, FHYPRE_PARCSRCOGMRESSETUNROLL) extern void hypre_F90_NAME(fhypre_parcsrcogmressetunroll, FHYPRE_PARCSRCOGMRESSETUNROLL) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRCOGMRESSetCGS \ hypre_F90_NAME(fhypre_parcsrcogmressetcgs, FHYPRE_PARCSRCOGMRESSETCGS) extern void hypre_F90_NAME(fhypre_parcsrcogmressetcgs, FHYPRE_PARCSRCOGMRESSETCGS) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRCOGMRESSetTol \ hypre_F90_NAME(fhypre_parcsrcogmressettol, FHYPRE_PARCSRCOGMRESSETTOL) extern void hypre_F90_NAME(fhypre_parcsrcogmressettol, FHYPRE_PARCSRCOGMRESSETTOL) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_ParCSRCOGMRESSetAbsoluteTol \ hypre_F90_NAME(fhypre_parcsrcogmressetabsolutet, FHYPRE_PARCSRCOGMRESSETABSOLUTET) extern void hypre_F90_NAME(fhypre_parcsrcogmressetabsolutet, FHYPRE_PARCSRCOGMRESSETABSOLUTET) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_ParCSRCOGMRESSetMinIter \ hypre_F90_NAME(fhypre_parcsrcogmressetminiter, FHYPRE_PARCSRCOGMRESSETMINITER) extern void hypre_F90_NAME(fhypre_parcsrcogmressetminiter, FHYPRE_PARCSRCOGMRESSETMINITER) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRCOGMRESSetMaxIter \ hypre_F90_NAME(fhypre_parcsrcogmressetmaxiter, FHYPRE_PARCSRCOGMRESSETMAXITER) extern void hypre_F90_NAME(fhypre_parcsrcogmressetmaxiter, FHYPRE_PARCSRCOGMRESSETMAXITER) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRCOGMRESSetPrecond \ hypre_F90_NAME(fhypre_parcsrcogmressetprecond, FHYPRE_PARCSRCOGMRESSETPRECOND) extern void hypre_F90_NAME(fhypre_parcsrcogmressetprecond, FHYPRE_PARCSRCOGMRESSETPRECOND) - (hypre_F90_Obj *, HYPRE_Int *, hypre_F90_Obj *); +(hypre_F90_Obj *, HYPRE_Int *, hypre_F90_Obj *); #define HYPRE_ParCSRCOGMRESGetPrecond \ hypre_F90_NAME(fhypre_parcsrcogmresgetprecond, FHYPRE_PARCSRCOGMRESGETPRECOND) extern void hypre_F90_NAME(fhypre_parcsrcogmresgetprecond, FHYPRE_PARCSRCOGMRESGETPRECOND) - (hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_ParCSRCOGMRESSetLogging \ hypre_F90_NAME(fhypre_parcsrcogmressetlogging, FHYPRE_PARCSRCOGMRESSETLOGGING) extern void hypre_F90_NAME(fhypre_parcsrcogmressetlogging, FHYPRE_PARCSRCOGMRESSETLOGGING) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRCOGMRESSetPrintLevel \ hypre_F90_NAME(fhypre_parcsrcogmressetprintlevel, FHYPRE_PARCSRCOGMRESSETPRINTLEVEL) extern void hypre_F90_NAME(fhypre_parcsrcogmressetprintlevel, FHYPRE_PARCSRCOGMRESSETPRINTLEVEL) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRCOGMRESGetNumIterations \ hypre_F90_NAME(fhypre_parcsrcogmresgetnumiterat, FHYPRE_PARCSRCOGMRESGETNUMITERAT) extern void hypre_F90_NAME(fhypre_parcsrcogmresgetnumiterat, FHYPRE_PARCSRCOGMRESGETNUMITERAT) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRCOGMRESGetFinalRelativeResidualNorm \ hypre_F90_NAME(fhypre_parcsrcogmresgetfinalrela, FHYPRE_PARCSRCOGMRESGETFINALRELA) extern void hypre_F90_NAME(fhypre_parcsrcogmresgetfinalrela, FHYPRE_PARCSRCOGMRESGETFINALRELA) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_ParCSRHybridCreate \ hypre_F90_NAME(fhypre_parcsrhybridcreate, FHYPRE_PARCSRHYBRIDCREATE) extern void hypre_F90_NAME(fhypre_parcsrhybridcreate, FHYPRE_PARCSRHYBRIDCREATE) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_ParCSRHybridDestroy \ hypre_F90_NAME(fhypre_parcsrhybriddestroy, FHYPRE_PARCSRHYBRIDDESTROY) extern void hypre_F90_NAME(fhypre_parcsrhybriddestroy, FHYPRE_PARCSRHYBRIDDESTROY) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_ParCSRHybridSetup \ hypre_F90_NAME(fhypre_parcsrhybridsetup, FHYPRE_PARCSRHYBRIDSETUP) extern void hypre_F90_NAME(fhypre_parcsrhybridsetup, FHYPRE_PARCSRHYBRIDSETUP) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_ParCSRHybridSolve \ hypre_F90_NAME(fhypre_parcsrhybridsolve, FHYPRE_PARCSRHYBRIDSOLVE) extern void hypre_F90_NAME(fhypre_parcsrhybridsolve, FHYPRE_PARCSRHYBRIDSOLVE) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_ParCSRHybridSetTol \ hypre_F90_NAME(fhypre_parcsrhybridsettol, FHYPRE_PARCSRHYBRIDSETTOL) extern void hypre_F90_NAME(fhypre_parcsrhybridsettol, FHYPRE_PARCSRHYBRIDSETTOL) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_ParCSRHybridSetConvergenceTol \ hypre_F90_NAME(fhypre_parcsrhybridsetconvergen, FHYPRE_PARCSRHYBRIDSETCONVERGEN) extern void hypre_F90_NAME(fhypre_parcsrhybridsetconvergen, FHYPRE_PARCSRHYBRIDSETCONVERGEN) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_ParCSRHybridSetDSCGMaxIter \ hypre_F90_NAME(fhypre_parcsrhybridsetdscgmaxit, FHYPRE_PARCSRHYBRIDSETDSCGMAXIT) extern void hypre_F90_NAME(fhypre_parcsrhybridsetdscgmaxit, FHYPRE_PARCSRHYBRIDSETDSCGMAXIT) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRHybridSetPCGMaxIter \ hypre_F90_NAME(fhypre_parcsrhybridsetpcgmaxite, FHYPRE_PARCSRHYBRIDSETPCGMAXITE) extern void hypre_F90_NAME(fhypre_parcsrhybridsetpcgmaxite, FHYPRE_PARCSRHYBRIDSETPCGMAXITE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRHybridSetSolverType \ hypre_F90_NAME(fhypre_parcsrhybridsetsolvertyp, FHYPRE_PARCSRHYBRIDSETSOLVERTYP) extern void hypre_F90_NAME(fhypre_parcsrhybridsetsolvertyp, FHYPRE_PARCSRHYBRIDSETSOLVERTYP) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRHybridSetKDim \ hypre_F90_NAME(fhypre_parcsrhybridsetkdim, FHYPRE_PARCSRHYBRIDSETKDIM) extern void hypre_F90_NAME(fhypre_parcsrhybridsetkdim, FHYPRE_PARCSRHYBRIDSETKDIM) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRHybridSetTwoNorm \ hypre_F90_NAME(fhypre_parcsrhybridsettwonorm, FHYPRE_PARCSRHYBRIDSETTWONORM) extern void hypre_F90_NAME(fhypre_parcsrhybridsettwonorm, FHYPRE_PARCSRHYBRIDSETTWONORM) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRHybridSetStopCrit \ hypre_F90_NAME(fhypre_parcsrhybridsetstopcrit, FHYPRE_PARCSRSETSTOPCRIT) extern void hypre_F90_NAME(fhypre_parcsrhybridsetstopcrit, FHYPRE_PARCSRSETSTOPCRIT) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRHybridSetRelChange \ hypre_F90_NAME(fhypre_parcsrhybridsetrelchange, FHYPRE_PARCSRHYBRIDSETRELCHANGE) extern void hypre_F90_NAME(fhypre_parcsrhybridsetrelchange, FHYPRE_PARCSRHYBRIDSETRELCHANGE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRHybridSetPrecond \ hypre_F90_NAME(fhypre_parcsrhybridsetprecond, FHYPRE_PARCSRHYBRIDSETPRECOND) extern void hypre_F90_NAME(fhypre_parcsrhybridsetprecond, FHYPRE_PARCSRHYBRIDSETPRECOND) - (hypre_F90_Obj *, HYPRE_Int *, hypre_F90_Obj *); +(hypre_F90_Obj *, HYPRE_Int *, hypre_F90_Obj *); #define HYPRE_ParCSRHybridSetLogging \ hypre_F90_NAME(fhypre_parcsrhybridsetlogging, FHYPRE_PARCSRHYBRIDSETLOGGING) extern void hypre_F90_NAME(fhypre_parcsrhybridsetlogging, FHYPRE_PARCSRHYBRIDSETLOGGING) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRHybridSetPrintLevel \ hypre_F90_NAME(fhypre_parcsrhybridsetprintleve, FHYPRE_PARCSRHYBRIDSETPRINTLEVE) extern void hypre_F90_NAME(fhypre_parcsrhybridsetprintleve, FHYPRE_PARCSRHYBRIDSETPRINTLEVE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRHybridSetStrongThreshold \ hypre_F90_NAME(fhypre_parcsrhybridsetstrongthr, FHYPRE_PARCSRHYBRIDSETSTRONGTHR) extern void hypre_F90_NAME(fhypre_parcsrhybridsetstrongthr, FHYPRE_PARCSRHYBRIDSETSTRONGTHR) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRHybridSetMaxRowSum \ hypre_F90_NAME(fhypre_parcsrhybridsetmaxrowsum, FHYPRE_PARCSRHYBRIDSETMAXROWSUM) extern void hypre_F90_NAME(fhypre_parcsrhybridsetmaxrowsum, FHYPRE_PARCSRHYBRIDSETMAXROWSUM) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRHybridSetTruncFactor \ hypre_F90_NAME(fhypre_parcsrhybridsettruncfact, FHYPRE_PARCSRHYBRIDSETTRUNCFACT) extern void hypre_F90_NAME(fhypre_parcsrhybridsettruncfact, FHYPRE_PARCSRHYBRIDSETTRUNCFACT) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRHybridSetMaxLevels \ hypre_F90_NAME(fhypre_parcsrhybridsetmaxlevels, FHYPRE_PARCSRHYBRIDSETMAXLEVELS) extern void hypre_F90_NAME(fhypre_parcsrhybridsetmaxlevels, FHYPRE_PARCSRHYBRIDSETMAXLEVELS) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRHybridSetMeasureType \ hypre_F90_NAME(fhypre_parcsrhybridsetmeasurety, FHYPRE_PARCSRHYBRIDSETMEASURETY) extern void hypre_F90_NAME(fhypre_parcsrhybridsetmeasurety, FHYPRE_PARCSRHYBRIDSETMEASURETY) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRHybridSetCoarsenType \ hypre_F90_NAME(fhypre_parcsrhybridsetcoarsenty, FHYPRE_PARCSRHYBRIDSETCOARSENTY) extern void hypre_F90_NAME(fhypre_parcsrhybridsetcoarsenty, FHYPRE_PARCSRHYBRIDSETCOARSENTY) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRHybridSetCycleType \ hypre_F90_NAME(fhypre_parcsrhybridsetcycletype, FHYPRE_PARCSRHYBRIDSETCYCLETYPE) extern void hypre_F90_NAME(fhypre_parcsrhybridsetcycletype, FHYPRE_PARCSRHYBRIDSETCYCLETYPE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRHybridSetNumGridSweeps \ hypre_F90_NAME(fhypre_parcsrhybridsetnumgridsw, FHYPRE_PARCSRHYBRIDSETNUMGRIDSW) extern void hypre_F90_NAME(fhypre_parcsrhybridsetnumgridsw, FHYPRE_PARCSRHYBRIDSETNUMGRIDSW) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRHybridSetGridRelaxType \ hypre_F90_NAME(fhypre_parcsrhybridsetgridrlxty, FHYPRE_PARCSRHYBRIDSETGRIDRLXTY) extern void hypre_F90_NAME(fhypre_parcsrhybridsetgridrlxty, FHYPRE_PARCSRHYBRIDSETGRIDRLXTY) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRHybridSetGridRelaxPoints \ hypre_F90_NAME(fhypre_parcsrhybridsetgridrlxpt, FHYPRE_PARCSRHYBRIDSETGRIDRLXPT) extern void hypre_F90_NAME(fhypre_parcsrhybridsetgridrlxpt, FHYPRE_PARCSRHYBRIDSETGRIDRLXPT) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRHybridSetNumSweeps \ hypre_F90_NAME(fhypre_parcsrhybridsetnumsweeps, FHYPRE_PARCSRHYBRIDSETNUMSWEEPS) extern void hypre_F90_NAME(fhypre_parcsrhybridsetnumsweeps, FHYPRE_PARCSRHYBRIDSETNUMSWEEPS) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRHybridSetCycleNumSweeps \ hypre_F90_NAME(fhypre_parcsrhybridsetcyclenums, FHYPRE_PARCSRHYBRIDSETCYCLENUMS) extern void hypre_F90_NAME(fhypre_parcsrhybridsetcyclenums, FHYPRE_PARCSRHYBRIDSETCYCLENUMS) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRHybridSetRelaxType \ hypre_F90_NAME(fhypre_parcsrhybridsetrelaxtype, FHYPRE_PARCSRHYBRIDSETRELAXTYPE) extern void hypre_F90_NAME(fhypre_parcsrhybridsetrelaxtype, FHYPRE_PARCSRHYBRIDSETRELAXTYPE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRHybridSetCycleRelaxType \ hypre_F90_NAME(fhypre_parcsrhybridsetcyclerela, FHYPRE_PARCSRHYBRIDSETCYCLERELA) extern void hypre_F90_NAME(fhypre_parcsrhybridsetcyclerela, FHYPRE_PARCSRHYBRIDSETCYCLERELA) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRHybridSetRelaxOrder \ hypre_F90_NAME(fhypre_parcsrhybridsetrelaxorde, FHYPRE_PARCSRHYBRIDSETRELAXORDE) extern void hypre_F90_NAME(fhypre_parcsrhybridsetrelaxorde, FHYPRE_PARCSRHYBRIDSETRELAXORDE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRHybridSetRelaxWt \ hypre_F90_NAME(fhypre_parcsrhybridsetrelaxwt, FHYPRE_PARCSRHYBRIDSETRELAXWT) extern void hypre_F90_NAME(fhypre_parcsrhybridsetrelaxwt, FHYPRE_PARCSRHYBRIDSETRELAXWT) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRHybridSetLevelRelaxWt \ hypre_F90_NAME(fhypre_parcsrhybridsetlevelrela, FHYPRE_PARCSRHYBRIDSETLEVELRELA) extern void hypre_F90_NAME(fhypre_parcsrhybridsetlevelrela, FHYPRE_PARCSRHYBRIDSETLEVELRELA) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRHybridSetOuterWt \ hypre_F90_NAME(fhypre_parcsrhybridsetouterwt, FHYPRE_PARCSRHYBRIDSETOUTERWT) extern void hypre_F90_NAME(fhypre_parcsrhybridsetouterwt, FHYPRE_PARCSRHYBRIDSETOUTERWT) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRHybridSetLevelOuterWt \ hypre_F90_NAME(fhypre_parcsrhybridsetleveloute, FHYPRE_PARCSRHYBRIDSETLEVELOUTE) extern void hypre_F90_NAME(fhypre_parcsrhybridsetleveloute, FHYPRE_PARCSRHYBRIDSETLEVELOUTE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRHybridSetRelaxWeight \ hypre_F90_NAME(fhypre_parcsrhybridsetrelaxweig, FHYPRE_PARCSRHYBRIDSETRELAXWEIG) extern void hypre_F90_NAME(fhypre_parcsrhybridsetrelaxweig, FHYPRE_PARCSRHYBRIDSETRELAXWEIG) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRHybridSetOmega \ hypre_F90_NAME(fhypre_parcsrhybridsetomega, FHYPRE_PARCSRHYBRIDSETOMEGA) extern void hypre_F90_NAME(fhypre_parcsrhybridsetomega, FHYPRE_PARCSRHYBRIDSETOMEGA) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRHybridGetNumIterations \ hypre_F90_NAME(fhypre_parcsrhybridgetnumiterat, FHYPRE_PARCSRHYBRIDGETNUMITERAT) extern void hypre_F90_NAME(fhypre_parcsrhybridgetnumiterat, FHYPRE_PARCSRHYBRIDGETNUMITERAT) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRHybridGetDSCGNumIterations \ hypre_F90_NAME(fhypre_parcsrhybridgetdscgnumit, FHYPRE_PARCSRHYBRIDGETDSCGNUMIT) extern void hypre_F90_NAME(fhypre_parcsrhybridgetdscgnumit, FHYPRE_PARCSRHYBRIDGETDSCGNUMIT) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRHybridGetPCGNumIterations \ hypre_F90_NAME(fhypre_parcsrhybridgetpcgnumite, FHYPRE_PARCSRHYBRIDGETPCGNUMITE) extern void hypre_F90_NAME(fhypre_parcsrhybridgetpcgnumite, FHYPRE_PARCSRHYBRIDGETPCGNUMITE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRHybridGetFinalRelativeResidualNorm \ hypre_F90_NAME(fhypre_parcsrhybridgetfinalrela, FHYPRE_PARCSRHYBRIDGETFINALRELA) extern void hypre_F90_NAME(fhypre_parcsrhybridgetfinalrela, FHYPRE_PARCSRHYBRIDGETFINALRELA) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParSetRandomValues \ hypre_F90_NAME(fhypre_parsetrandomvalues, FHYPRE_PARSETRANDOMVALUES) extern void hypre_F90_NAME(fhypre_parsetrandomvalues, FHYPRE_PARSETRANDOMVALUES) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParPrintVector \ hypre_F90_NAME(fhypre_parprintvector, FHYPRE_PARPRINTVECTOR) extern void hypre_F90_NAME(fhypre_parprintvector, FHYPRE_PARPRINTVECTOR) - (hypre_F90_Obj *, char *); +(hypre_F90_Obj *, char *); #define HYPRE_ParReadVector \ hypre_F90_NAME(fhypre_parreadvector, FHYPRE_PARREADVECTOR) extern void hypre_F90_NAME(fhypre_parreadvector, FHYPRE_PARREADVECTOR) - (HYPRE_Int *, char *); +(HYPRE_Int *, char *); #define HYPRE_ParVectorSize \ hypre_F90_NAME(fhypre_parvectorsize, FHYPRE_PARVECTORSIZE) extern void hypre_F90_NAME(fhypre_parvectorsize, FHYPRE_PARVECTORSIZE) - (HYPRE_Int *); +(HYPRE_Int *); #define HYPRE_ParCSRMultiVectorPrint \ hypre_F90_NAME(fhypre_parcsrmultivectorprint, FHYPRE_PARCSRMULTIVECTORPRINT) extern void hypre_F90_NAME(fhypre_parcsrmultivectorprint, FHYPRE_PARCSRMULTIVECTORPRINT) - (HYPRE_Int *, char *); +(HYPRE_Int *, char *); #define HYPRE_ParCSRMultiVectorRead \ hypre_F90_NAME(fhypre_parcsrmultivectorread, FHYPRE_PARCSRMULTIVECTORREAD) extern void hypre_F90_NAME(fhypre_parcsrmultivectorread, FHYPRE_PARCSRMULTIVECTORREAD) - (HYPRE_Int *, hypre_F90_Obj *, char *); +(HYPRE_Int *, hypre_F90_Obj *, char *); #define aux_maskCount \ hypre_F90_NAME(fhypre_aux_maskcount, FHYPRE_AUX_MASKCOUNT) extern void hypre_F90_NAME(fhypre_aux_maskcount, FHYPRE_AUX_MASKCOUNT) - (HYPRE_Int *, HYPRE_Int *); +(HYPRE_Int *, HYPRE_Int *); #define aux_indexFromMask \ hypre_F90_NAME(fhypre_auxindexfrommask, FHYPRE_AUXINDEXFROMMASK) extern void hypre_F90_NAME(fhypre_auxindexfrommask, FHYPRE_AUXINDEXFROMMASK) - (HYPRE_Int *, HYPRE_Int *, HYPRE_Int *); +(HYPRE_Int *, HYPRE_Int *, HYPRE_Int *); #define HYPRE_TempParCSRSetupInterpreter \ hypre_F90_NAME(fhypre_tempparcsrsetupinterpret, FHYPRE_TEMPPARCSRSETUPINTERPRET) extern void hypre_F90_NAME(fhypre_tempparcsrsetupinterpret, FHYPRE_TEMPPARCSRSETUPINTERPRET) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_ParCSRSetupInterpreter \ hypre_F90_NAME(fhypre_parcsrsetupinterpreter, FHYPRE_PARCSRSETUPINTERPRETER) extern void hypre_F90_NAME(fhypre_parcsrsetupinterpreter, FHYPRE_PARCSRSETUPINTERPRETER) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_ParCSRSetupMatvec \ hypre_F90_NAME(fhypre_parcsrsetupmatvec, FHYPRE_PARCSRSETUPMATVEC) extern void hypre_F90_NAME(fhypre_parcsrsetupmatvec, FHYPRE_PARCSRSETUPMATVEC) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_ParaSailsCreate \ hypre_F90_NAME(fhypre_parasailscreate, FHYPRE_PARASAILSCREATE) extern void hypre_F90_NAME(fhypre_parasailscreate, FHYPRE_PARASAILSCREATE) - (HYPRE_Int *, hypre_F90_Obj *); +(HYPRE_Int *, hypre_F90_Obj *); #define HYPRE_ParaSailsDestroy \ hypre_F90_NAME(fhypre_parasailsdestroy, FHYPRE_PARASAILSDESTROY) extern void hypre_F90_NAME(fhypre_parasailsdestroy, FHYPRE_PARASAILSDESTROY) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_ParaSailsSetup \ hypre_F90_NAME(fhypre_parasailssetup, FHYPRE_PARASAILSSETUP) extern void hypre_F90_NAME(fhypre_parasailssetup, FHYPRE_PARASAILSSETUP) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_ParaSailsSolve \ hypre_F90_NAME(fhypre_parasailssolve, FHYPRE_PARASAILSSOLVE) extern void hypre_F90_NAME(fhypre_parasailssolve, FHYPRE_PARASAILSSOLVE) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_ParaSailsSetParams \ hypre_F90_NAME(fhypre_parasailssetparams, FHYPRE_PARASAILSSETPARAMS) extern void hypre_F90_NAME(fhypre_parasailssetparams, FHYPRE_PARASAILSSETPARAMS) - (hypre_F90_Obj *, HYPRE_Real *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Real *, HYPRE_Int *); #define HYPRE_ParaSailsSetThresh \ hypre_F90_NAME(fhypre_parasailssetthresh, FHYPRE_PARASAILSSETTHRESH) extern void hypre_F90_NAME(fhypre_parasailssetthresh, FHYPRE_PARASAILSSETTHRESH) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_ParaSailsGetThresh \ hypre_F90_NAME(fhypre_parasailsgetthresh, FHYPRE_PARASAILSGETTHRESH) extern void hypre_F90_NAME(fhypre_parasailsgetthresh, FHYPRE_PARASAILSGETTHRESH) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_ParaSailsSetNlevels \ hypre_F90_NAME(fhypre_parasailssetnlevels, FHYPRE_PARASAILSSETNLEVELS) extern void hypre_F90_NAME(fhypre_parasailssetnlevels, FHYPRE_PARASAILSSETNLEVELS) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParaSailsGetNlevels \ hypre_F90_NAME(fhypre_parasailsgetnlevels, FHYPRE_PARASAILSGETNLEVELS) extern void hypre_F90_NAME(fhypre_parasailsgetnlevels, FHYPRE_PARASAILSGETNLEVELS) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParaSailsSetFilter \ hypre_F90_NAME(fhypre_parasailssetfilter, FHYPRE_PARASAILSSETFILTER) extern void hypre_F90_NAME(fhypre_parasailssetfilter, FHYPRE_PARASAILSSETFILTER) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_ParaSailsGetFilter \ hypre_F90_NAME(fhypre_parasailsgetfilter, FHYPRE_PARASAILSGETFILTER) extern void hypre_F90_NAME(fhypre_parasailsgetfilter, FHYPRE_PARASAILSGETFILTER) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_ParaSailsSetSym \ hypre_F90_NAME(fhypre_parasailssetsym, FHYPRE_PARASAILSSETSYM) extern void hypre_F90_NAME(fhypre_parasailssetsym, FHYPRE_PARASAILSSETSYM) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParaSailsGetSym \ hypre_F90_NAME(fhypre_parasailsgetsym, FHYPRE_PARASAILSGETSYM) extern void hypre_F90_NAME(fhypre_parasailsgetsym, FHYPRE_PARASAILSGETSYM) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParaSailsSetLoadbal \ hypre_F90_NAME(fhypre_parasailssetloadbal, FHYPRE_PARASAILSSETLOADBAL) extern void hypre_F90_NAME(fhypre_parasailssetloadbal, FHYPRE_PARASAILSSETLOADBAL) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_ParaSailsGetLoadbal \ hypre_F90_NAME(fhypre_parasailsgetloadbal, FHYPRE_PARASAILSGETLOADBAL) extern void hypre_F90_NAME(fhypre_parasailsgetloadbal, FHYPRE_PARASAILSGETLOADBAL) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_ParaSailsSetReuse \ hypre_F90_NAME(fhypre_parasailssetreuse, FHYPRE_PARASAILSSETREUSE) extern void hypre_F90_NAME(fhypre_parasailssetreuse, FHYPRE_PARASAILSSETREUSE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParaSailsGetReuse \ hypre_F90_NAME(fhypre_parasailsgetreuse, FHYPRE_PARASAILSGETREUSE) extern void hypre_F90_NAME(fhypre_parasailsgetreuse, FHYPRE_PARASAILSGETREUSE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParaSailsSetLogging \ hypre_F90_NAME(fhypre_parasailssetlogging, FHYPRE_PARASAILSSETLOGGING) extern void hypre_F90_NAME(fhypre_parasailssetlogging, FHYPRE_PARASAILSSETLOGGING) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParaSailsGetLogging \ hypre_F90_NAME(fhypre_parasailsgetlogging, FHYPRE_PARASAILSGETLOGGING) extern void hypre_F90_NAME(fhypre_parasailsgetlogging, FHYPRE_PARASAILSGETLOGGING) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRPCGCreate \ hypre_F90_NAME(fhypre_parcsrpcgcreate, FHYPRE_PARCSRPCGCREATE) extern void hypre_F90_NAME(fhypre_parcsrpcgcreate, FHYPRE_PARCSRPCGCREATE) - (HYPRE_Int *, hypre_F90_Obj *); +(HYPRE_Int *, hypre_F90_Obj *); #define HYPRE_ParCSRPCGDestroy \ hypre_F90_NAME(fhypre_parcsrpcgdestroy, FHYPRE_PARCSRPCGDESTROY) extern void hypre_F90_NAME(fhypre_parcsrpcgdestroy, FHYPRE_PARCSRPCGDESTROY) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_ParCSRPCGSetup \ hypre_F90_NAME(fhypre_parcsrpcgsetup, FHYPRE_PARCSRPCGSETUP) extern void hypre_F90_NAME(fhypre_parcsrpcgsetup, FHYPRE_PARCSRPCGSETUP) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_ParCSRPCGSolve \ hypre_F90_NAME(fhypre_parcsrpcgsolve, FHYPRE_PARCSRPCGSOLVE) extern void hypre_F90_NAME(fhypre_parcsrpcgsolve, FHYPRE_PARCSRPCGSOLVE) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_ParCSRPCGSetTol \ hypre_F90_NAME(fhypre_parcsrpcgsettol, FHYPRE_PARCSRPCGSETTOL) extern void hypre_F90_NAME(fhypre_parcsrpcgsettol, FHYPRE_PARCSRPCGSETTOL) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_ParCSRPCGSetMaxIter \ hypre_F90_NAME(fhypre_parcsrpcgsetmaxiter, FHYPRE_PARCSRPCGSETMAXITER) extern void hypre_F90_NAME(fhypre_parcsrpcgsetmaxiter, FHYPRE_PARCSRPCGSETMAXITER) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRPCGSetStopCrit \ hypre_F90_NAME(fhypre_parcsrpcgsetstopcrit, FHYPRE_PARCSRPCGSETSTOPCRIT) extern void hypre_F90_NAME(fhypre_parcsrpcgsetstopcrit, FHYPRE_PARCSRPCGSETSTOPCRIT) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRPCGSetTwoNorm \ hypre_F90_NAME(fhypre_parcsrpcgsettwonorm, FHYPRE_PARCSRPCGSETTWONORM) extern void hypre_F90_NAME(fhypre_parcsrpcgsettwonorm, FHYPRE_PARCSRPCGSETTWONORM) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRPCGSetRelChange \ hypre_F90_NAME(fhypre_parcsrpcgsetrelchange, FHYPRE_PARCSRPCGSETRELCHANGE) extern void hypre_F90_NAME(fhypre_parcsrpcgsetrelchange, FHYPRE_PARCSRPCGSETRELCHANGE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRPCGSetPrecond \ hypre_F90_NAME(fhypre_parcsrpcgsetprecond, FHYPRE_PARCSRPCGSETPRECOND) extern void hypre_F90_NAME(fhypre_parcsrpcgsetprecond, FHYPRE_PARCSRPCGSETPRECOND) - (hypre_F90_Obj *, HYPRE_Int *, hypre_F90_Obj *); +(hypre_F90_Obj *, HYPRE_Int *, hypre_F90_Obj *); #define HYPRE_ParCSRPCGGetPrecond \ hypre_F90_NAME(fhypre_parcsrpcggetprecond, FHYPRE_PARCSRPCGGETPRECOND) extern void hypre_F90_NAME(fhypre_parcsrpcggetprecond, FHYPRE_PARCSRPCGGETPRECOND) - (hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_ParCSRPCGSetPrintLevel \ hypre_F90_NAME(fhypre_parcsrpcgsetprintlevel, FHYPRE_PARCSRPCGSETPRINTLEVEL) extern void hypre_F90_NAME(fhypre_parcsrpcgsetprintlevel, FHYPRE_PARCSRPCGSETPRINTLEVEL) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRPCGGetNumIterations \ hypre_F90_NAME(fhypre_parcsrpcggetnumiteration, FHYPRE_PARCSRPCGGETNUMITERATION) extern void hypre_F90_NAME(fhypre_parcsrpcggetnumiteration, FHYPRE_PARCSRPCGGETNUMITERATION) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRPCGGetFinalRelativeResidualNorm \ hypre_F90_NAME(fhypre_parcsrpcggetfinalrelativ, FHYPRE_PARCSRPCGGETFINALRELATIV) extern void hypre_F90_NAME(fhypre_parcsrpcggetfinalrelativ, FHYPRE_PARCSRPCGGETFINALRELATIV) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_ParCSRDiagScaleSetup \ hypre_F90_NAME(fhypre_parcsrdiagscalesetup, FHYPRE_PARCSRDIAGSCALESETUP) extern void hypre_F90_NAME(fhypre_parcsrdiagscalesetup, FHYPRE_PARCSRDIAGSCALESETUP) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_ParCSRDiagScale \ hypre_F90_NAME(fhypre_parcsrdiagscale, FHYPRE_PARCSRDIAGSCALE) extern void hypre_F90_NAME(fhypre_parcsrdiagscale, FHYPRE_PARCSRDIAGSCALE) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_ParCSRPilutCreate \ hypre_F90_NAME(fhypre_parcsrpilutcreate, FHYPRE_PARCSRPILUTCREATE) extern void hypre_F90_NAME(fhypre_parcsrpilutcreate, FHYPRE_PARCSRPILUTCREATE) - (HYPRE_Int *, hypre_F90_Obj *); +(HYPRE_Int *, hypre_F90_Obj *); #define HYPRE_ParCSRPilutDestroy \ hypre_F90_NAME(fhypre_parcsrpilutdestroy, FHYPRE_PARCSRPILUTDESTROY) extern void hypre_F90_NAME(fhypre_parcsrpilutdestroy, FHYPRE_PARCSRPILUTDESTROY) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_ParCSRPilutSetup \ hypre_F90_NAME(fhypre_parcsrpilutsetup, FHYPRE_PARCSRPILUTSETUP) extern void hypre_F90_NAME(fhypre_parcsrpilutsetup, FHYPRE_PARCSRPILUTSETUP) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_ParCSRPilutSolve \ hypre_F90_NAME(fhypre_parcsrpilutsolve, FHYPRE_PARCSRPILUTSOLVE) extern void hypre_F90_NAME(fhypre_parcsrpilutsolve, FHYPRE_PARCSRPILUTSOLVE) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_ParCSRPilutSetMaxIter \ hypre_F90_NAME(fhypre_parcsrpilutsetmaxiter, FHYPRE_PARCSRPILUTSETMAXITER) extern void hypre_F90_NAME(fhypre_parcsrpilutsetmaxiter, FHYPRE_PARCSRPILUTSETMAXITER) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_ParCSRPilutSetDropToleran \ hypre_F90_NAME(fhypre_parcsrpilutsetdroptolera, FHYPRE_PARCSRPILUTSETDROPTOLERA) extern void hypre_F90_NAME(fhypre_parcsrpilutsetdroptolera, FHYPRE_PARCSRPILUTSETDROPTOLERA) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_ParCSRPilutSetFacRowSize \ hypre_F90_NAME(fhypre_parcsrpilutsetfacrowsize, FHYPRE_PARCSRPILUTSETFACROWSIZE) extern void hypre_F90_NAME(fhypre_parcsrpilutsetfacrowsize, FHYPRE_PARCSRPILUTSETFACROWSIZE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SchwarzCreate \ hypre_F90_NAME(fhypre_schwarzcreate, FHYPRE_SCHWARZCREATE) extern void hypre_F90_NAME(fhypre_schwarzcreate, FHYPRE_SCHWARZCREATE) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_SchwarzDestroy \ hypre_F90_NAME(fhypre_schwarzdestroy, FHYPRE_SCHWARZDESTROY) extern void hypre_F90_NAME(fhypre_schwarzdestroy, FHYPRE_SCHWARZDESTROY) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_SchwarzSetup \ hypre_F90_NAME(fhypre_schwarzsetup, FHYPRE_SCHWARZSETUP) extern void hypre_F90_NAME(fhypre_schwarzsetup, FHYPRE_SCHWARZSETUP) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj*); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj*); #define HYPRE_SchwarzSolve \ hypre_F90_NAME(fhypre_schwarzsolve, FHYPRE_SCHWARZSOLVE) extern void hypre_F90_NAME(fhypre_schwarzsolve, FHYPRE_SCHWARZSOLVE) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj*); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj*); #define HYPRE_SchwarzSetVariant \ hypre_F90_NAME(fhypre_schwarzsetvariant, FHYPRE_SCHWARZVARIANT) extern void hypre_F90_NAME(fhypre_schwarzsetvariant, FHYPRE_SCHWARZVARIANT) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SchwarzSetOverlap \ hypre_F90_NAME(fhypre_schwarzsetoverlap, FHYPRE_SCHWARZOVERLAP) extern void hypre_F90_NAME(fhypre_schwarzsetoverlap, FHYPRE_SCHWARZOVERLAP) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SchwarzSetDomainType \ hypre_F90_NAME(fhypre_schwarzsetdomaintype, FHYPRE_SVHWARZSETDOMAINTYPE) extern void hypre_F90_NAME(fhypre_schwarzsetdomaintype, FHYPRE_SVHWARZSETDOMAINTYPE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SchwarzSetDomainStructure \ hypre_F90_NAME(fhypre_schwarzsetdomainstructur, FHYPRE_SCHWARZSETDOMAINSTRUCTUR) extern void hypre_F90_NAME(fhypre_schwarzsetdomainstructur, FHYPRE_SCHWARZSETDOMAINSTRUCTUR) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SchwarzSetNumFunctions \ hypre_F90_NAME(fhypre_schwarzsetnumfunctions, FHYPRE_SCHWARZSETNUMFUNCTIONS) extern void hypre_F90_NAME(fhypre_schwarzsetnumfunctions, FHYPRE_SCHWARZSETNUMFUNCTIONS) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SchwarzSetRelaxWeight \ hypre_F90_NAME(fhypre_schwarzsetrelaxweight, FHYPRE_SCHWARZSETRELAXWEIGHT) extern void hypre_F90_NAME(fhypre_schwarzsetrelaxweight, FHYPRE_SCHWARZSETRELAXWEIGHT) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_SchwarzSetDofFunc \ hypre_F90_NAME(fhypre_schwarzsetdoffunc, FHYPRE_SCHWARZSETDOFFUNC) extern void hypre_F90_NAME(fhypre_schwarzsetdoffunc, FHYPRE_SCHWARZSETDOFFUNC) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #ifdef __cplusplus } diff --git a/external/hypre/src/test/hypre_set_precond.c b/external/hypre/src/test/hypre_set_precond.c index fff9b519..3591e69a 100644 --- a/external/hypre/src/test/hypre_set_precond.c +++ b/external/hypre/src/test/hypre_set_precond.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -12,628 +12,679 @@ #include "hypre_test.h" -HYPRE_Int hypre_set_precond(HYPRE_Int matrix_id, HYPRE_Int solver_id, HYPRE_Int precond_id, void *solver, - void *precond) +HYPRE_Int hypre_set_precond(HYPRE_Int matrix_id, HYPRE_Int solver_id, HYPRE_Int precond_id, + void *solver, + void *precond) { - hypre_set_precond_params(precond_id, precond); + hypre_set_precond_params(precond_id, precond); -/************************************************************************ - * PARCSR MATRIX - ***********************************************************************/ + /************************************************************************ + * PARCSR MATRIX + ***********************************************************************/ if (matrix_id == HYPRE_PARCSR) - { - -/************************************************************************ - * PCG Solver - ***********************************************************************/ - if (solver_id == HYPRE_PCG) - { - if (precond_id == HYPRE_BOOMERAMG) - { - HYPRE_PCGSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, - (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, - (HYPRE_Solver) precond); - } - else if (precond_id == HYPRE_DIAGSCALE) - { - HYPRE_PCGSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_ParCSRDiagScale, - (HYPRE_PtrToSolverFcn) HYPRE_ParCSRDiagScaleSetup, - (HYPRE_Solver) precond); - } - else if (precond_id == HYPRE_EUCLID) - { - HYPRE_PCGSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_EuclidSolve, - (HYPRE_PtrToSolverFcn) HYPRE_EuclidSetup, - (HYPRE_Solver) precond); - } - else if (precond_id == HYPRE_PARASAILS) - { - HYPRE_PCGSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_ParCSRParaSailsSolve, - (HYPRE_PtrToSolverFcn) HYPRE_ParCSRParaSailsSetup, - (HYPRE_Solver) precond); - } - else if (precond_id == HYPRE_SCHWARZ) - { - HYPRE_PCGSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_SchwarzSolve, - (HYPRE_PtrToSolverFcn) HYPRE_SchwarzSetup, - (HYPRE_Solver) precond); - } - } - -/************************************************************************ - * GMRES Solver - ***********************************************************************/ - if (solver_id == HYPRE_GMRES) - { - if (precond_id == HYPRE_BOOMERAMG) - { - HYPRE_GMRESSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, - (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, - (HYPRE_Solver) precond); - } - else if (precond_id == HYPRE_DIAGSCALE) - { - HYPRE_GMRESSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_ParCSRDiagScale, - (HYPRE_PtrToSolverFcn) HYPRE_ParCSRDiagScaleSetup, - (HYPRE_Solver) precond); - } - else if (precond_id == HYPRE_EUCLID) - { - HYPRE_GMRESSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_EuclidSolve, - (HYPRE_PtrToSolverFcn) HYPRE_EuclidSetup, - (HYPRE_Solver) precond); - } - else if (precond_id == HYPRE_PARASAILS) - { - HYPRE_GMRESSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_ParCSRParaSailsSolve, - (HYPRE_PtrToSolverFcn) HYPRE_ParCSRParaSailsSetup, - (HYPRE_Solver) precond); - } - else if (precond_id == HYPRE_PILUT) - { - HYPRE_GMRESSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_ParCSRPilutSolve, - (HYPRE_PtrToSolverFcn) HYPRE_ParCSRPilutSetup, - (HYPRE_Solver) precond); - } - else if (precond_id == HYPRE_SCHWARZ) - { - HYPRE_GMRESSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_SchwarzSolve, - (HYPRE_PtrToSolverFcn) HYPRE_SchwarzSetup, - (HYPRE_Solver) precond); - } - } - -/************************************************************************ - * BiCGSTAB Solver - ***********************************************************************/ - if (solver_id == HYPRE_BICGSTAB) - { - if (precond_id == HYPRE_BOOMERAMG) - { - HYPRE_BiCGSTABSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, - (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, - (HYPRE_Solver) precond); - } - else if (precond_id == HYPRE_DIAGSCALE) - { - HYPRE_BiCGSTABSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_ParCSRDiagScale, - (HYPRE_PtrToSolverFcn) HYPRE_ParCSRDiagScaleSetup, - (HYPRE_Solver) precond); - } - else if (precond_id == HYPRE_EUCLID) - { - HYPRE_BiCGSTABSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_EuclidSolve, - (HYPRE_PtrToSolverFcn) HYPRE_EuclidSetup, - (HYPRE_Solver) precond); - } - else if (precond_id == HYPRE_PILUT) - { - HYPRE_BiCGSTABSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_ParCSRPilutSolve, - (HYPRE_PtrToSolverFcn) HYPRE_ParCSRPilutSetup, - (HYPRE_Solver) precond); - } - } - -/************************************************************************ - * CGNR Solver - ***********************************************************************/ - if (solver_id == HYPRE_CGNR) - { - if (precond_id == HYPRE_BOOMERAMG) - { - HYPRE_CGNRSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, - (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolveT, - (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, - (HYPRE_Solver) precond); - } - else if (precond_id == HYPRE_DIAGSCALE) - { - HYPRE_CGNRSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_ParCSRDiagScale, - (HYPRE_PtrToSolverFcn) HYPRE_ParCSRDiagScale, - (HYPRE_PtrToSolverFcn) HYPRE_ParCSRDiagScaleSetup, - (HYPRE_Solver) precond); - } - } + { + /************************************************************************ + * PCG Solver + ***********************************************************************/ + if (solver_id == HYPRE_PCG) + { + if (precond_id == HYPRE_BOOMERAMG) + { + HYPRE_PCGSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, + (HYPRE_Solver) precond); + } + else if (precond_id == HYPRE_DIAGSCALE) + { + HYPRE_PCGSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_ParCSRDiagScale, + (HYPRE_PtrToSolverFcn) HYPRE_ParCSRDiagScaleSetup, + (HYPRE_Solver) precond); + } + else if (precond_id == HYPRE_EUCLID) + { + HYPRE_PCGSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_EuclidSolve, + (HYPRE_PtrToSolverFcn) HYPRE_EuclidSetup, + (HYPRE_Solver) precond); + } + else if (precond_id == HYPRE_PARASAILS) + { + HYPRE_PCGSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_ParCSRParaSailsSolve, + (HYPRE_PtrToSolverFcn) HYPRE_ParCSRParaSailsSetup, + (HYPRE_Solver) precond); + } + else if (precond_id == HYPRE_SCHWARZ) + { + HYPRE_PCGSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_SchwarzSolve, + (HYPRE_PtrToSolverFcn) HYPRE_SchwarzSetup, + (HYPRE_Solver) precond); + } } - -/************************************************************************ - * SSTRUCT MATRIX - ***********************************************************************/ - if (matrix_id == HYPRE_SSTRUCT) + /************************************************************************ + * GMRES Solver + ***********************************************************************/ + if (solver_id == HYPRE_GMRES) { - -/************************************************************************ - * PCG Solver - ***********************************************************************/ - if (solver_id == HYPRE_PCG) - { - if (precond_id == HYPRE_SPLIT) - { - HYPRE_PCGSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_SStructSplitSolve, - (HYPRE_PtrToSolverFcn) HYPRE_SStructSplitSetup, - (HYPRE_Solver) precond); - } - else if (precond_id == HYPRE_SYSPFMG) - { - HYPRE_PCGSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_SStructSysPFMGSolve, - (HYPRE_PtrToSolverFcn) HYPRE_SStructSysPFMGSetup, - (HYPRE_Solver) precond); - } - else if (precond_id == HYPRE_DIAGSCALE) - { - HYPRE_PCGSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_SStructDiagScale, - (HYPRE_PtrToSolverFcn) HYPRE_SStructDiagScaleSetup, - (HYPRE_Solver) precond); - } - } - -/************************************************************************ - * GMRES Solver - ***********************************************************************/ - if (solver_id == HYPRE_GMRES) - { - if (precond_id == HYPRE_DIAGSCALE) - { - HYPRE_GMRESSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_SStructDiagScale, - (HYPRE_PtrToSolverFcn) HYPRE_SStructDiagScaleSetup, - (HYPRE_Solver) precond); - } - else if (precond_id == HYPRE_SPLIT) - { - HYPRE_GMRESSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_SStructSplitSolve, - (HYPRE_PtrToSolverFcn) HYPRE_SStructSplitSetup, - (HYPRE_Solver) precond); - } - } - -/************************************************************************ - * BiCGSTAB Solver - ***********************************************************************/ - if (solver_id == HYPRE_BICGSTAB) - { - if (precond_id == HYPRE_DIAGSCALE) - { - HYPRE_BiCGSTABSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_SStructDiagScale, - (HYPRE_PtrToSolverFcn) HYPRE_SStructDiagScaleSetup, - (HYPRE_Solver) precond); - } - else if (precond_id == HYPRE_SPLIT) - { - HYPRE_BiCGSTABSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_SStructSplitSolve, - (HYPRE_PtrToSolverFcn) HYPRE_SStructSplitSetup, - (HYPRE_Solver) precond); - } - } - -/************************************************************************ - * CGNR Solver - ***********************************************************************/ - if (solver_id == HYPRE_CGNR) - { - if (precond_id == HYPRE_BOOMERAMG) - { - HYPRE_CGNRSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, - (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolveT, - (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, - (HYPRE_Solver) precond); - } - else if (precond_id == HYPRE_DIAGSCALE) - { - HYPRE_CGNRSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_ParCSRDiagScale, - (HYPRE_PtrToSolverFcn) HYPRE_ParCSRDiagScale, - (HYPRE_PtrToSolverFcn) HYPRE_ParCSRDiagScaleSetup, - (HYPRE_Solver) precond); - } - } - + if (precond_id == HYPRE_BOOMERAMG) + { + HYPRE_GMRESSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, + (HYPRE_Solver) precond); + } + else if (precond_id == HYPRE_DIAGSCALE) + { + HYPRE_GMRESSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_ParCSRDiagScale, + (HYPRE_PtrToSolverFcn) HYPRE_ParCSRDiagScaleSetup, + (HYPRE_Solver) precond); + } + else if (precond_id == HYPRE_EUCLID) + { + HYPRE_GMRESSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_EuclidSolve, + (HYPRE_PtrToSolverFcn) HYPRE_EuclidSetup, + (HYPRE_Solver) precond); + } + else if (precond_id == HYPRE_PARASAILS) + { + HYPRE_GMRESSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_ParCSRParaSailsSolve, + (HYPRE_PtrToSolverFcn) HYPRE_ParCSRParaSailsSetup, + (HYPRE_Solver) precond); + } + else if (precond_id == HYPRE_PILUT) + { + HYPRE_GMRESSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_ParCSRPilutSolve, + (HYPRE_PtrToSolverFcn) HYPRE_ParCSRPilutSetup, + (HYPRE_Solver) precond); + } + else if (precond_id == HYPRE_SCHWARZ) + { + HYPRE_GMRESSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_SchwarzSolve, + (HYPRE_PtrToSolverFcn) HYPRE_SchwarzSetup, + (HYPRE_Solver) precond); + } } -/************************************************************************ - * STRUCT MATRIX - ***********************************************************************/ - if (matrix_id == HYPRE_STRUCT) + /************************************************************************ + * BiCGSTAB Solver + ***********************************************************************/ + if (solver_id == HYPRE_BICGSTAB) { - -/************************************************************************ - * PCG Solver - ***********************************************************************/ - if (solver_id == HYPRE_PCG) - { - if (precond_id == HYPRE_SMG) - { - HYPRE_PCGSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_StructSMGSolve, - (HYPRE_PtrToSolverFcn) HYPRE_StructSMGSetup, - (HYPRE_Solver) precond); - } - else if (precond_id == HYPRE_PFMG) - { - HYPRE_PCGSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_StructPFMGSolve, - (HYPRE_PtrToSolverFcn) HYPRE_StructPFMGSetup, - (HYPRE_Solver) precond); - } - else if (precond_id == HYPRE_SPARSEMSG) - { - HYPRE_PCGSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_StructSparseMSGSolve, - (HYPRE_PtrToSolverFcn) HYPRE_StructSparseMSGSetup, - (HYPRE_Solver) precond); - } - else if (precond_id == HYPRE_JACOBI) - { - HYPRE_PCGSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_StructJacobiSolve, - (HYPRE_PtrToSolverFcn) HYPRE_StructJacobiSetup, - (HYPRE_Solver) precond); - } - else if (precond_id == HYPRE_DIAGSCALE) - { - HYPRE_PCGSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_StructDiagScale, - (HYPRE_PtrToSolverFcn) HYPRE_StructDiagScaleSetup, - (HYPRE_Solver) precond); - } - } - -/************************************************************************ - * HYBRID Solver - ***********************************************************************/ - if (solver_id == HYPRE_HYBRID) - { - if (precond_id == HYPRE_SMG) - { - HYPRE_StructHybridSetPrecond( (HYPRE_StructSolver) solver, - (HYPRE_PtrToStructSolverFcn) HYPRE_StructSMGSolve, - (HYPRE_PtrToStructSolverFcn) HYPRE_StructSMGSetup, - (HYPRE_StructSolver) precond); - } - else if (precond_id == HYPRE_PFMG) - { - HYPRE_StructHybridSetPrecond( (HYPRE_StructSolver) solver, - (HYPRE_PtrToStructSolverFcn) HYPRE_StructPFMGSolve, - (HYPRE_PtrToStructSolverFcn) HYPRE_StructPFMGSetup, - (HYPRE_StructSolver) precond); - } - else if (precond_id == HYPRE_SPARSEMSG) - { - HYPRE_StructHybridSetPrecond( (HYPRE_StructSolver) solver, - (HYPRE_PtrToStructSolverFcn) HYPRE_StructSparseMSGSolve, - (HYPRE_PtrToStructSolverFcn) HYPRE_StructSparseMSGSetup, - (HYPRE_StructSolver) precond); - } - } - -/************************************************************************ - * GMRES Solver - ***********************************************************************/ - if (solver_id == HYPRE_GMRES) - { - if (precond_id == HYPRE_SMG) - { - HYPRE_GMRESSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_StructSMGSolve, - (HYPRE_PtrToSolverFcn) HYPRE_StructSMGSetup, - (HYPRE_Solver) precond); - } - else if (precond_id == HYPRE_PFMG) - { - HYPRE_GMRESSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_StructPFMGSolve, - (HYPRE_PtrToSolverFcn) HYPRE_StructPFMGSetup, - (HYPRE_Solver) precond); - } - else if (precond_id == HYPRE_SPARSEMSG) - { - HYPRE_GMRESSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_StructSparseMSGSolve, - (HYPRE_PtrToSolverFcn) HYPRE_StructSparseMSGSetup, - (HYPRE_Solver) precond); - } - else if (precond_id == HYPRE_JACOBI) - { - HYPRE_GMRESSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_StructJacobiSolve, - (HYPRE_PtrToSolverFcn) HYPRE_StructJacobiSetup, - (HYPRE_Solver) precond); - } - else if (precond_id == HYPRE_DIAGSCALE) - { - HYPRE_GMRESSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_StructDiagScale, - (HYPRE_PtrToSolverFcn) HYPRE_StructDiagScaleSetup, - (HYPRE_Solver) precond); - } - } - -/************************************************************************ - * BICGSTAB Solver - ***********************************************************************/ - if (solver_id == HYPRE_BICGSTAB) - { - if (precond_id == HYPRE_SMG) - { - HYPRE_BiCGSTABSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_StructSMGSolve, - (HYPRE_PtrToSolverFcn) HYPRE_StructSMGSetup, - (HYPRE_Solver) precond); - } - else if (precond_id == HYPRE_PFMG) - { - HYPRE_BiCGSTABSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_StructPFMGSolve, - (HYPRE_PtrToSolverFcn) HYPRE_StructPFMGSetup, - (HYPRE_Solver) precond); - } - else if (precond_id == HYPRE_SPARSEMSG) - { - HYPRE_BiCGSTABSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_StructSparseMSGSolve, - (HYPRE_PtrToSolverFcn) HYPRE_StructSparseMSGSetup, - (HYPRE_Solver) precond); - } - else if (precond_id == HYPRE_JACOBI) - { - HYPRE_BiCGSTABSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_StructJacobiSolve, - (HYPRE_PtrToSolverFcn) HYPRE_StructJacobiSetup, - (HYPRE_Solver) precond); - } - else if (precond_id == HYPRE_DIAGSCALE) - { - HYPRE_BiCGSTABSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_StructDiagScale, - (HYPRE_PtrToSolverFcn) HYPRE_StructDiagScaleSetup, - (HYPRE_Solver) precond); - } - } + if (precond_id == HYPRE_BOOMERAMG) + { + HYPRE_BiCGSTABSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, + (HYPRE_Solver) precond); + } + else if (precond_id == HYPRE_DIAGSCALE) + { + HYPRE_BiCGSTABSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_ParCSRDiagScale, + (HYPRE_PtrToSolverFcn) HYPRE_ParCSRDiagScaleSetup, + (HYPRE_Solver) precond); + } + else if (precond_id == HYPRE_EUCLID) + { + HYPRE_BiCGSTABSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_EuclidSolve, + (HYPRE_PtrToSolverFcn) HYPRE_EuclidSetup, + (HYPRE_Solver) precond); + } + else if (precond_id == HYPRE_PILUT) + { + HYPRE_BiCGSTABSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_ParCSRPilutSolve, + (HYPRE_PtrToSolverFcn) HYPRE_ParCSRPilutSetup, + (HYPRE_Solver) precond); + } } -} - -HYPRE_Int hypre_set_precond_params(HYPRE_Int precond_id, void *precond) -{ - HYPRE_Int i; - HYPRE_Int ierr; - -/* use BoomerAMG preconditioner */ - if (precond_id == HYPRE_BOOMERAMG) - { - HYPRE_BoomerAMGCreate(precond); - HYPRE_BoomerAMGSetInterpType(precond, interp_type); - HYPRE_BoomerAMGSetNumSamples(precond, gsmg_samples); - HYPRE_BoomerAMGSetTol(precond, pc_tol); - HYPRE_BoomerAMGSetCoarsenType(precond, (hybrid*coarsen_type)); - HYPRE_BoomerAMGSetMeasureType(precond, measure_type); - HYPRE_BoomerAMGSetStrongThreshold(precond, strong_threshold); - HYPRE_BoomerAMGSetTruncFactor(precond, trunc_factor); - HYPRE_BoomerAMGSetPrintLevel(precond, poutdat); - HYPRE_BoomerAMGSetPrintFileName(precond, "driver.out.log"); - HYPRE_BoomerAMGSetMaxIter(precond, 1); - HYPRE_BoomerAMGSetCycleType(precond, cycle_type); - HYPRE_BoomerAMGSetNumGridSweeps(precond, num_grid_sweeps); - HYPRE_BoomerAMGSetGridRelaxType(precond, grid_relax_type); - HYPRE_BoomerAMGSetRelaxWeight(precond, relax_weight); - HYPRE_BoomerAMGSetOmega(precond, omega); - HYPRE_BoomerAMGSetSmoothType(precond, smooth_type); - HYPRE_BoomerAMGSetSmoothNumLevels(precond, smooth_num_levels); - HYPRE_BoomerAMGSetSmoothNumSweeps(precond, smooth_num_sweeps); - HYPRE_BoomerAMGSetGridRelaxPoints(precond, grid_relax_points); - HYPRE_BoomerAMGSetMaxLevels(precond, max_levels); - HYPRE_BoomerAMGSetMaxRowSum(precond, max_row_sum); - HYPRE_BoomerAMGSetNumFunctions(precond, num_functions); - HYPRE_BoomerAMGSetVariant(precond, variant); - HYPRE_BoomerAMGSetOverlap(precond, overlap); - HYPRE_BoomerAMGSetDomainType(precond, domain_type); - HYPRE_BoomerAMGSetSchwarzRlxWeight(precond, schwarz_rlx_weight); - if (num_functions > 1) - HYPRE_BoomerAMGSetDofFunc(precond, dof_func); - } -/* use DiagScale preconditioner */ - else if (precond_id == HYPRE_DIAGSCALE) - { - precond = NULL; - } -/* use ParaSails preconditioner */ - else if (precond_id == HYPRE_PARASAILS) - { - HYPRE_ParaSailsCreate(hypre_MPI_COMM_WORLD, precond); - HYPRE_ParaSailsSetParams(precond, sai_threshold, max_levels); - HYPRE_ParaSailsSetFilter(precond, sai_filter); - HYPRE_ParaSailsSetLogging(precond, poutdat); - } -/* use Schwarz preconditioner */ - else if (precond_id == HYPRE_SCHWARZ) - { - HYPRE_SchwarzCreate(precond); - HYPRE_SchwarzSetVariant(precond, variant); - HYPRE_SchwarzSetOverlap(precond, overlap); - HYPRE_SchwarzSetDomainType(precond, domain_type); - HYPRE_SchwarzSetRelaxWeight(precond, schwarz_rlx_weight); - } -/* use GSMG as preconditioner */ - else if (precond_id == HYPRE_GSMG) - { - /* fine grid */ - num_grid_sweeps[0] = num_sweep; - grid_relax_type[0] = relax_default; - hypre_TFree(grid_relax_points[0], HYPRE_MEMORY_HOST); - grid_relax_points[0] = hypre_CTAlloc(HYPRE_Int, num_sweep, HYPRE_MEMORY_HOST); - for (i=0; i 1) - HYPRE_BoomerAMGSetDofFunc(precond, dof_func); - } - -/* use PILUT as preconditioner */ - else if (precond_id == HYPRE_PILUT) - { - ierr = HYPRE_ParCSRPilutCreate( hypre_MPI_COMM_WORLD, precond ); + /************************************************************************ + * CGNR Solver + ***********************************************************************/ + if (solver_id == HYPRE_CGNR) + { + if (precond_id == HYPRE_BOOMERAMG) + { + HYPRE_CGNRSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolveT, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, + (HYPRE_Solver) precond); } -} + else if (precond_id == HYPRE_DIAGSCALE) + { + HYPRE_CGNRSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_ParCSRDiagScale, + (HYPRE_PtrToSolverFcn) HYPRE_ParCSRDiagScale, + (HYPRE_PtrToSolverFcn) HYPRE_ParCSRDiagScaleSetup, + (HYPRE_Solver) precond); + } + } + } -HYPRE_Int hypre_destroy_precond(HYPRE_Int precond_id, void *precond) -{ - - if (precond_id == HYPRE_BICGSTAB) - HYPRE_BiCGSTABDestroy(precond); - else if (precond_id == HYPRE_BOOMERAMG) - HYPRE_BoomerAMGDestroy(precond); + /************************************************************************ + * SSTRUCT MATRIX + ***********************************************************************/ + if (matrix_id == HYPRE_SSTRUCT) + { - else if (precond_id == HYPRE_CGNR) - HYPRE_CGNRDestroy(precond); + /************************************************************************ + * PCG Solver + ***********************************************************************/ + if (solver_id == HYPRE_PCG) + { + if (precond_id == HYPRE_SPLIT) + { + HYPRE_PCGSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_SStructSplitSolve, + (HYPRE_PtrToSolverFcn) HYPRE_SStructSplitSetup, + (HYPRE_Solver) precond); + } + else if (precond_id == HYPRE_SYSPFMG) + { + HYPRE_PCGSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_SStructSysPFMGSolve, + (HYPRE_PtrToSolverFcn) HYPRE_SStructSysPFMGSetup, + (HYPRE_Solver) precond); + } + else if (precond_id == HYPRE_DIAGSCALE) + { + HYPRE_PCGSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_SStructDiagScale, + (HYPRE_PtrToSolverFcn) HYPRE_SStructDiagScaleSetup, + (HYPRE_Solver) precond); + } + } - else if (precond_id == HYPRE_DIAGSCALE) - HYPRE_Destroy(precond); + /************************************************************************ + * GMRES Solver + ***********************************************************************/ + if (solver_id == HYPRE_GMRES) + { + if (precond_id == HYPRE_DIAGSCALE) + { + HYPRE_GMRESSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_SStructDiagScale, + (HYPRE_PtrToSolverFcn) HYPRE_SStructDiagScaleSetup, + (HYPRE_Solver) precond); + } + else if (precond_id == HYPRE_SPLIT) + { + HYPRE_GMRESSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_SStructSplitSolve, + (HYPRE_PtrToSolverFcn) HYPRE_SStructSplitSetup, + (HYPRE_Solver) precond); + } + } + + /************************************************************************ + * BiCGSTAB Solver + ***********************************************************************/ + if (solver_id == HYPRE_BICGSTAB) + { + if (precond_id == HYPRE_DIAGSCALE) + { + HYPRE_BiCGSTABSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_SStructDiagScale, + (HYPRE_PtrToSolverFcn) HYPRE_SStructDiagScaleSetup, + (HYPRE_Solver) precond); + } + else if (precond_id == HYPRE_SPLIT) + { + HYPRE_BiCGSTABSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_SStructSplitSolve, + (HYPRE_PtrToSolverFcn) HYPRE_SStructSplitSetup, + (HYPRE_Solver) precond); + } + } - else if (precond_id == HYPRE_EUCLID) - HYPRE_EuclidDestroy(precond); + /************************************************************************ + * CGNR Solver + ***********************************************************************/ + if (solver_id == HYPRE_CGNR) + { + if (precond_id == HYPRE_BOOMERAMG) + { + HYPRE_CGNRSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolveT, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, + (HYPRE_Solver) precond); + } + else if (precond_id == HYPRE_DIAGSCALE) + { + HYPRE_CGNRSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_ParCSRDiagScale, + (HYPRE_PtrToSolverFcn) HYPRE_ParCSRDiagScale, + (HYPRE_PtrToSolverFcn) HYPRE_ParCSRDiagScaleSetup, + (HYPRE_Solver) precond); + } + } - else if (precond_id == HYPRE_GMRES) - HYPRE_GMRESDestroy(precond); + } - else if (precond_id == HYPRE_GSMG) - HYPRE_BoomerAMGDestroy(precond); + /************************************************************************ + * STRUCT MATRIX + ***********************************************************************/ + if (matrix_id == HYPRE_STRUCT) + { - else if (precond_id == HYPRE_HYBRID) - HYPRE_HybridDestroy(precond); + /************************************************************************ + * PCG Solver + ***********************************************************************/ + if (solver_id == HYPRE_PCG) + { + if (precond_id == HYPRE_SMG) + { + HYPRE_PCGSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_StructSMGSolve, + (HYPRE_PtrToSolverFcn) HYPRE_StructSMGSetup, + (HYPRE_Solver) precond); + } + else if (precond_id == HYPRE_PFMG) + { + HYPRE_PCGSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_StructPFMGSolve, + (HYPRE_PtrToSolverFcn) HYPRE_StructPFMGSetup, + (HYPRE_Solver) precond); + } + else if (precond_id == HYPRE_SPARSEMSG) + { + HYPRE_PCGSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_StructSparseMSGSolve, + (HYPRE_PtrToSolverFcn) HYPRE_StructSparseMSGSetup, + (HYPRE_Solver) precond); + } + else if (precond_id == HYPRE_JACOBI) + { + HYPRE_PCGSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_StructJacobiSolve, + (HYPRE_PtrToSolverFcn) HYPRE_StructJacobiSetup, + (HYPRE_Solver) precond); + } + else if (precond_id == HYPRE_DIAGSCALE) + { + HYPRE_PCGSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_StructDiagScale, + (HYPRE_PtrToSolverFcn) HYPRE_StructDiagScaleSetup, + (HYPRE_Solver) precond); + } + } - else if (precond_id == HYPRE_JACOBI) - HYPRE_JacobiDestroy(precond); + /************************************************************************ + * HYBRID Solver + ***********************************************************************/ + if (solver_id == HYPRE_HYBRID) + { + if (precond_id == HYPRE_SMG) + { + HYPRE_StructHybridSetPrecond( (HYPRE_StructSolver) solver, + (HYPRE_PtrToStructSolverFcn) HYPRE_StructSMGSolve, + (HYPRE_PtrToStructSolverFcn) HYPRE_StructSMGSetup, + (HYPRE_StructSolver) precond); + } + else if (precond_id == HYPRE_PFMG) + { + HYPRE_StructHybridSetPrecond( (HYPRE_StructSolver) solver, + (HYPRE_PtrToStructSolverFcn) HYPRE_StructPFMGSolve, + (HYPRE_PtrToStructSolverFcn) HYPRE_StructPFMGSetup, + (HYPRE_StructSolver) precond); + } + else if (precond_id == HYPRE_SPARSEMSG) + { + HYPRE_StructHybridSetPrecond( (HYPRE_StructSolver) solver, + (HYPRE_PtrToStructSolverFcn) HYPRE_StructSparseMSGSolve, + (HYPRE_PtrToStructSolverFcn) HYPRE_StructSparseMSGSetup, + (HYPRE_StructSolver) precond); + } + } - else if (precond_id == HYPRE_PARASAILS) - HYPRE_ParaSailsDestroy(precond); + /************************************************************************ + * GMRES Solver + ***********************************************************************/ + if (solver_id == HYPRE_GMRES) + { + if (precond_id == HYPRE_SMG) + { + HYPRE_GMRESSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_StructSMGSolve, + (HYPRE_PtrToSolverFcn) HYPRE_StructSMGSetup, + (HYPRE_Solver) precond); + } + else if (precond_id == HYPRE_PFMG) + { + HYPRE_GMRESSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_StructPFMGSolve, + (HYPRE_PtrToSolverFcn) HYPRE_StructPFMGSetup, + (HYPRE_Solver) precond); + } + else if (precond_id == HYPRE_SPARSEMSG) + { + HYPRE_GMRESSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_StructSparseMSGSolve, + (HYPRE_PtrToSolverFcn) HYPRE_StructSparseMSGSetup, + (HYPRE_Solver) precond); + } + else if (precond_id == HYPRE_JACOBI) + { + HYPRE_GMRESSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_StructJacobiSolve, + (HYPRE_PtrToSolverFcn) HYPRE_StructJacobiSetup, + (HYPRE_Solver) precond); + } + else if (precond_id == HYPRE_DIAGSCALE) + { + HYPRE_GMRESSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_StructDiagScale, + (HYPRE_PtrToSolverFcn) HYPRE_StructDiagScaleSetup, + (HYPRE_Solver) precond); + } + } - else if (precond_id == HYPRE_PCG) - HYPRE_PCGDestroy(precond); + /************************************************************************ + * BICGSTAB Solver + ***********************************************************************/ + if (solver_id == HYPRE_BICGSTAB) + { + if (precond_id == HYPRE_SMG) + { + HYPRE_BiCGSTABSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_StructSMGSolve, + (HYPRE_PtrToSolverFcn) HYPRE_StructSMGSetup, + (HYPRE_Solver) precond); + } + else if (precond_id == HYPRE_PFMG) + { + HYPRE_BiCGSTABSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_StructPFMGSolve, + (HYPRE_PtrToSolverFcn) HYPRE_StructPFMGSetup, + (HYPRE_Solver) precond); + } + else if (precond_id == HYPRE_SPARSEMSG) + { + HYPRE_BiCGSTABSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_StructSparseMSGSolve, + (HYPRE_PtrToSolverFcn) HYPRE_StructSparseMSGSetup, + (HYPRE_Solver) precond); + } + else if (precond_id == HYPRE_JACOBI) + { + HYPRE_BiCGSTABSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_StructJacobiSolve, + (HYPRE_PtrToSolverFcn) HYPRE_StructJacobiSetup, + (HYPRE_Solver) precond); + } + else if (precond_id == HYPRE_DIAGSCALE) + { + HYPRE_BiCGSTABSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_StructDiagScale, + (HYPRE_PtrToSolverFcn) HYPRE_StructDiagScaleSetup, + (HYPRE_Solver) precond); + } + } + } +} - else if (precond_id == HYPRE_PFMG) - HYPRE_PFMGDestroy(precond); - else if (precond_id == HYPRE_PILUT) - HYPRE_PilutDestroy(precond); +HYPRE_Int hypre_set_precond_params(HYPRE_Int precond_id, void *precond) +{ + HYPRE_Int i; + HYPRE_Int ierr; + + /* use BoomerAMG preconditioner */ + if (precond_id == HYPRE_BOOMERAMG) + { + HYPRE_BoomerAMGCreate(precond); + HYPRE_BoomerAMGSetInterpType(precond, interp_type); + HYPRE_BoomerAMGSetNumSamples(precond, gsmg_samples); + HYPRE_BoomerAMGSetTol(precond, pc_tol); + HYPRE_BoomerAMGSetCoarsenType(precond, (hybrid * coarsen_type)); + HYPRE_BoomerAMGSetMeasureType(precond, measure_type); + HYPRE_BoomerAMGSetStrongThreshold(precond, strong_threshold); + HYPRE_BoomerAMGSetTruncFactor(precond, trunc_factor); + HYPRE_BoomerAMGSetPrintLevel(precond, poutdat); + HYPRE_BoomerAMGSetPrintFileName(precond, "driver.out.log"); + HYPRE_BoomerAMGSetMaxIter(precond, 1); + HYPRE_BoomerAMGSetCycleType(precond, cycle_type); + HYPRE_BoomerAMGSetNumGridSweeps(precond, num_grid_sweeps); + HYPRE_BoomerAMGSetGridRelaxType(precond, grid_relax_type); + HYPRE_BoomerAMGSetRelaxWeight(precond, relax_weight); + HYPRE_BoomerAMGSetOmega(precond, omega); + HYPRE_BoomerAMGSetSmoothType(precond, smooth_type); + HYPRE_BoomerAMGSetSmoothNumLevels(precond, smooth_num_levels); + HYPRE_BoomerAMGSetSmoothNumSweeps(precond, smooth_num_sweeps); + HYPRE_BoomerAMGSetGridRelaxPoints(precond, grid_relax_points); + HYPRE_BoomerAMGSetMaxLevels(precond, max_levels); + HYPRE_BoomerAMGSetMaxRowSum(precond, max_row_sum); + HYPRE_BoomerAMGSetNumFunctions(precond, num_functions); + HYPRE_BoomerAMGSetVariant(precond, variant); + HYPRE_BoomerAMGSetOverlap(precond, overlap); + HYPRE_BoomerAMGSetDomainType(precond, domain_type); + HYPRE_BoomerAMGSetSchwarzRlxWeight(precond, schwarz_rlx_weight); + if (num_functions > 1) + { + HYPRE_BoomerAMGSetDofFunc(precond, dof_func); + } + } + /* use DiagScale preconditioner */ + else if (precond_id == HYPRE_DIAGSCALE) + { + precond = NULL; + } + /* use ParaSails preconditioner */ + else if (precond_id == HYPRE_PARASAILS) + { + HYPRE_ParaSailsCreate(hypre_MPI_COMM_WORLD, precond); + HYPRE_ParaSailsSetParams(precond, sai_threshold, max_levels); + HYPRE_ParaSailsSetFilter(precond, sai_filter); + HYPRE_ParaSailsSetLogging(precond, poutdat); + } + /* use Schwarz preconditioner */ + else if (precond_id == HYPRE_SCHWARZ) + { + HYPRE_SchwarzCreate(precond); + HYPRE_SchwarzSetVariant(precond, variant); + HYPRE_SchwarzSetOverlap(precond, overlap); + HYPRE_SchwarzSetDomainType(precond, domain_type); + HYPRE_SchwarzSetRelaxWeight(precond, schwarz_rlx_weight); + } + /* use GSMG as preconditioner */ + else if (precond_id == HYPRE_GSMG) + { + /* fine grid */ + num_grid_sweeps[0] = num_sweep; + grid_relax_type[0] = relax_default; + hypre_TFree(grid_relax_points[0], HYPRE_MEMORY_HOST); + grid_relax_points[0] = hypre_CTAlloc(HYPRE_Int, num_sweep, HYPRE_MEMORY_HOST); + for (i = 0; i < num_sweep; i++) + { + grid_relax_points[0][i] = 0; + } - else if (precond_id == HYPRE_SCHWARZ) - HYPRE_SchwarzDestroy(precond); + /* down cycle */ + num_grid_sweeps[1] = num_sweep; + grid_relax_type[1] = relax_default; + hypre_TFree(grid_relax_points[1], HYPRE_MEMORY_HOST); + grid_relax_points[1] = hypre_CTAlloc(HYPRE_Int, num_sweep, HYPRE_MEMORY_HOST); + for (i = 0; i < num_sweep; i++) + { + grid_relax_points[1][i] = 0; + } - else if (precond_id == HYPRE_SMG) - HYPRE_SMGDestroy(precond); + /* up cycle */ + num_grid_sweeps[2] = num_sweep; + grid_relax_type[2] = relax_default; + hypre_TFree(grid_relax_points[2], HYPRE_MEMORY_HOST); + grid_relax_points[2] = hypre_CTAlloc(HYPRE_Int, num_sweep, HYPRE_MEMORY_HOST); + for (i = 0; i < num_sweep; i++) + { + grid_relax_points[2][i] = 0; + } - else if (precond_id == HYPRE_SPARSEMSG) - HYPRE_SparseMSGDestroy(precond); + /* coarsest grid */ + num_grid_sweeps[3] = 1; + grid_relax_type[3] = 9; + hypre_TFree(grid_relax_points[3], HYPRE_MEMORY_HOST); + grid_relax_points[3] = hypre_CTAlloc(HYPRE_Int, 1, HYPRE_MEMORY_HOST); + grid_relax_points[3][0] = 0; + + HYPRE_BoomerAMGCreate(precond); + HYPRE_BoomerAMGSetGSMG(precond, 4); + HYPRE_BoomerAMGSetInterpType(precond, interp_type); + HYPRE_BoomerAMGSetNumSamples(precond, gsmg_samples); + HYPRE_BoomerAMGSetTol(precond, pc_tol); + HYPRE_BoomerAMGSetCoarsenType(precond, (hybrid * coarsen_type)); + HYPRE_BoomerAMGSetMeasureType(precond, measure_type); + HYPRE_BoomerAMGSetStrongThreshold(precond, strong_threshold); + HYPRE_BoomerAMGSetTruncFactor(precond, trunc_factor); + HYPRE_BoomerAMGSetPrintLevel(precond, poutdat); + HYPRE_BoomerAMGSetPrintFileName(precond, "driver.out.log"); + HYPRE_BoomerAMGSetMaxIter(precond, 1); + HYPRE_BoomerAMGSetCycleType(precond, cycle_type); + HYPRE_BoomerAMGSetNumGridSweeps(precond, num_grid_sweeps); + HYPRE_BoomerAMGSetGridRelaxType(precond, grid_relax_type); + HYPRE_BoomerAMGSetRelaxWeight(precond, relax_weight); + HYPRE_BoomerAMGSetOmega(precond, omega); + HYPRE_BoomerAMGSetSmoothType(precond, smooth_type); + HYPRE_BoomerAMGSetSmoothNumLevels(precond, smooth_num_levels); + HYPRE_BoomerAMGSetSmoothNumSweeps(precond, smooth_num_sweeps); + HYPRE_BoomerAMGSetVariant(precond, variant); + HYPRE_BoomerAMGSetOverlap(precond, overlap); + HYPRE_BoomerAMGSetDomainType(precond, domain_type); + HYPRE_BoomerAMGSetSchwarzRlxWeight(precond, schwarz_rlx_weight); + HYPRE_BoomerAMGSetGridRelaxPoints(precond, grid_relax_points); + HYPRE_BoomerAMGSetMaxLevels(precond, max_levels); + HYPRE_BoomerAMGSetMaxRowSum(precond, max_row_sum); + HYPRE_BoomerAMGSetNumFunctions(precond, num_functions); + if (num_functions > 1) + { + HYPRE_BoomerAMGSetDofFunc(precond, dof_func); + } + } - else if (precond_id == HYPRE_SPLIT) - HYPRE_SplitDestroy(precond); + /* use PILUT as preconditioner */ + else if (precond_id == HYPRE_PILUT) + { + ierr = HYPRE_ParCSRPilutCreate( hypre_MPI_COMM_WORLD, precond ); + } +} - else if (precond_id == HYPRE_SPLITPFMG) - HYPRE_SplitDestroy(precond); - else if (precond_id == HYPRE_SPLITSMG) - HYPRE_SplitDestroy(precond); +HYPRE_Int hypre_destroy_precond(HYPRE_Int precond_id, void *precond) +{ - else if (precond_id == HYPRE_SYSPFMG) - HYPRE_SysPFMGDestroy(precond); + if (precond_id == HYPRE_BICGSTAB) + { + HYPRE_BiCGSTABDestroy(precond); + } + + else if (precond_id == HYPRE_BOOMERAMG) + { + HYPRE_BoomerAMGDestroy(precond); + } + + else if (precond_id == HYPRE_CGNR) + { + HYPRE_CGNRDestroy(precond); + } + + else if (precond_id == HYPRE_DIAGSCALE) + { + HYPRE_Destroy(precond); + } + + else if (precond_id == HYPRE_EUCLID) + { + HYPRE_EuclidDestroy(precond); + } + + else if (precond_id == HYPRE_GMRES) + { + HYPRE_GMRESDestroy(precond); + } + + else if (precond_id == HYPRE_GSMG) + { + HYPRE_BoomerAMGDestroy(precond); + } + + else if (precond_id == HYPRE_HYBRID) + { + HYPRE_HybridDestroy(precond); + } + + else if (precond_id == HYPRE_JACOBI) + { + HYPRE_JacobiDestroy(precond); + } + + else if (precond_id == HYPRE_PARASAILS) + { + HYPRE_ParaSailsDestroy(precond); + } + + else if (precond_id == HYPRE_PCG) + { + HYPRE_PCGDestroy(precond); + } + + else if (precond_id == HYPRE_PFMG) + { + HYPRE_PFMGDestroy(precond); + } + + else if (precond_id == HYPRE_PILUT) + { + HYPRE_PilutDestroy(precond); + } + + else if (precond_id == HYPRE_SCHWARZ) + { + HYPRE_SchwarzDestroy(precond); + } + + else if (precond_id == HYPRE_SMG) + { + HYPRE_SMGDestroy(precond); + } + + else if (precond_id == HYPRE_SPARSEMSG) + { + HYPRE_SparseMSGDestroy(precond); + } + + else if (precond_id == HYPRE_SPLIT) + { + HYPRE_SplitDestroy(precond); + } + + else if (precond_id == HYPRE_SPLITPFMG) + { + HYPRE_SplitDestroy(precond); + } + + else if (precond_id == HYPRE_SPLITSMG) + { + HYPRE_SplitDestroy(precond); + } + + else if (precond_id == HYPRE_SYSPFMG) + { + HYPRE_SysPFMGDestroy(precond); + } } diff --git a/external/hypre/src/test/hypre_sstruct_fortran_test.h b/external/hypre/src/test/hypre_sstruct_fortran_test.h index 504d17b5..1d05b22c 100644 --- a/external/hypre/src/test/hypre_sstruct_fortran_test.h +++ b/external/hypre/src/test/hypre_sstruct_fortran_test.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -9,7 +9,7 @@ #ifdef __cplusplus extern "C" { #endif - + /****************************************************************************** * Definitions of sstruct fortran interface routines *****************************************************************************/ @@ -17,741 +17,745 @@ extern "C" { #define HYPRE_SStructGraphCreate \ hypre_F90_NAME(fhypre_sstructgraphcreate, FHYPRE_SSTRUCTGRAPHCREATE) extern void hypre_F90_NAME(fhypre_sstructgraphcreate, FHYPRE_SSTRUCTGRAPHCREATE) - (HYPRE_Int *, hypre_F90_Obj *, hypre_F90_Obj *); +(HYPRE_Int *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_SStructGraphDestroy \ hypre_F90_NAME(fhypre_sstructgraphdestroy, FHYPRE_SSTRUCTGRAPHDESTROY) extern void hypre_F90_NAME(fhypre_sstructgraphdestroy, FHYPRE_SSTRUCTGRAPHDESTROY) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_SStructGraphSetStencil \ hypre_F90_NAME(fhypre_sstructgraphsetstencil, FHYPRE_SSTRUCTGRAPHSETSTENCIL) extern void hypre_F90_NAME(fhypre_sstructgraphsetstencil, FHYPRE_SSTRUCTGRAPHSETSTENCIL) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, hypre_F90_Obj *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, hypre_F90_Obj *); #define HYPRE_SStructGraphAddEntries \ hypre_F90_NAME(fhypre_sstructgraphaddentries, FHYPRE_SSTRUCTGRAPHADDENTRIES) extern void hypre_F90_NAME(fhypre_sstructgraphaddentries, FHYPRE_SSTRUCTGRAPHADDENTRIES) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *); #define HYPRE_SStructGraphAssemble \ hypre_F90_NAME(fhypre_sstructgraphassemble, FHYPRE_SSTRUCTGRAPHASSEMBLE) extern void hypre_F90_NAME(fhypre_sstructgraphassemble, FHYPRE_SSTRUCTGRAPHASSEMBLE) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_SStructGraphSetObjectType \ hypre_F90_NAME(fhypre_sstructgraphsetobjecttyp, FHYPRE_SSTRUCTGRAPHSETOBJECTTYP) extern void hypre_F90_NAME(fhypre_sstructgraphsetobjecttyp, FHYPRE_SSTRUCTGRAPHSETOBJECTTYP) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructGridCreate \ hypre_F90_NAME(fhypre_sstructgridcreate, FHYPRE_SSTRUCTGRIDCREATE) extern void hypre_F90_NAME(fhypre_sstructgridcreate, FHYPRE_SSTRUCTGRIDCREATE) - (HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, hypre_F90_Obj *); +(HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, hypre_F90_Obj *); #define HYPRE_SStructGridDestroy \ hypre_F90_NAME(fhypre_sstructgriddestroy, FHYPRE_SSTRUCTGRIDDESTROY) extern void hypre_F90_NAME(fhypre_sstructgriddestroy, FHYPRE_SSTRUCTGRIDDESTROY) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_SStructGridSetExtents \ hypre_F90_NAME(fhypre_sstructgridsetextents, FHYPRE_SSTRUCTGRIDSETEXTENTS) extern void hypre_F90_NAME(fhypre_sstructgridsetextents, FHYPRE_SSTRUCTGRIDSETEXTENTS) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *); #define HYPRE_SStructGridSetVariables \ hypre_F90_NAME(fhypre_sstructgridsetvariables, FHYPRE_SSTRUCTGRIDSETVARIABLES) extern void hypre_F90_NAME(fhypre_sstructgridsetvariables, FHYPRE_SSTRUCTGRIDSETVARIABLES) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, hypre_F90_Obj *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, hypre_F90_Obj *); #define HYPRE_SStructGridAddVariables \ hypre_F90_NAME(fhypre_sstructgridaddvariables, FHYPRE_SSTRUCTGRIDADDVARIABLES) extern void hypre_F90_NAME(fhypre_sstructgridaddvariables, FHYPRE_SSTRUCTGRIDADDVARIABLES) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, hypre_F90_Obj *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, hypre_F90_Obj *); #define HYPRE_SStructGridSetNeighborBox \ hypre_F90_NAME(fhypre_sstructgridsetneighborbo, FHYPRE_SSTRUCTGRIDSETNEIGHBORBO) extern void hypre_F90_NAME(fhypre_sstructgridsetneighborbo, FHYPRE_SSTRUCTGRIDSETNEIGHBORBO) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, + HYPRE_Int *); #define HYPRE_SStructGridAssemble \ hypre_F90_NAME(fhypre_sstructgridassemble, FHYPRE_SSTRUCTGRIDASSEMBLE) extern void hypre_F90_NAME(fhypre_sstructgridassemble, FHYPRE_SSTRUCTGRIDASSEMBLE) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_SStructGridSetPeriodic \ hypre_F90_NAME(fhypre_sstructgridsetperiodic, FHYPRE_SSTRUCTGRIDSETPERIODIC) extern void hypre_F90_NAME(fhypre_sstructgridsetperiodic, FHYPRE_SSTRUCTGRIDSETPERIODIC) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *); #define HYPRE_SStructGridSetNumGhost \ hypre_F90_NAME(fhypre_sstructgridsetnumghost, FHYPRE_SSTRUCTGRIDSETNUMGHOST) extern void hypre_F90_NAME(fhypre_sstructgridsetnumghost, FHYPRE_SSTRUCTGRIDSETNUMGHOST) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructMatrixCreate \ hypre_F90_NAME(fhypre_sstructmatrixcreate, FHYPRE_SSTRUCTMATRIXCREATE) extern void hypre_F90_NAME(fhypre_sstructmatrixcreate, FHYPRE_SSTRUCTMATRIXCREATE) - (HYPRE_Int *, hypre_F90_Obj *, hypre_F90_Obj *); +(HYPRE_Int *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_SStructMatrixDestroy \ hypre_F90_NAME(fhypre_sstructmatrixdestroy, FHYPRE_SSTRUCTMATRIXDESTROY) extern void hypre_F90_NAME(fhypre_sstructmatrixdestroy, FHYPRE_SSTRUCTMATRIXDESTROY) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_SStructMatrixInitialize \ hypre_F90_NAME(fhypre_sstructmatrixinitialize, FHYPRE_SSTRUCTMATRIXINITIALIZE) extern void hypre_F90_NAME(fhypre_sstructmatrixinitialize, FHYPRE_SSTRUCTMATRIXINITIALIZE) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_SStructMatrixSetValues \ hypre_F90_NAME(fhypre_sstructmatrixsetvalues, FHYPRE_SSTRUCTMATRIXSETVALUES) extern void hypre_F90_NAME(fhypre_sstructmatrixsetvalues, FHYPRE_SSTRUCTMATRIXSETVALUES) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Real *); #define HYPRE_SStructMatrixSetBoxValues \ hypre_F90_NAME(fhypre_sstructmatrixsetboxvalue, FHYPRE_SSTRUCTMATRIXSETBOXVALUE) extern void hypre_F90_NAME(fhypre_sstructmatrixsetboxvalue, FHYPRE_SSTRUCTMATRIXSETBOXVALUE) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, + HYPRE_Real *); #define HYPRE_SStructMatrixGetValues \ hypre_F90_NAME(fhypre_sstructmatrixgetvalues, FHYPRE_SSTRUCTMATRIXGETVALUES) extern void hypre_F90_NAME(fhypre_sstructmatrixgetvalues, FHYPRE_SSTRUCTMATRIXGETVALUES) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Real *); #define HYPRE_SStructMatrixGetBoxValues \ hypre_F90_NAME(fhypre_sstructmatrixgetboxvalue, FHYPRE_SSTRUCTMATRIXGETBOXVALUE) extern void hypre_F90_NAME(fhypre_sstructmatrixgetboxvalue, FHYPRE_SSTRUCTMATRIXGETBOXVALUE) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, + HYPRE_Real *); #define HYPRE_SStructMatrixAddToValues \ hypre_F90_NAME(fhypre_sstructmatrixaddtovalues, FHYPRE_SSTRUCTMATRIXADDTOVALUES) extern void hypre_F90_NAME(fhypre_sstructmatrixaddtovalues, FHYPRE_SSTRUCTMATRIXADDTOVALUES) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Real *); #define HYPRE_SStructMatrixAddToBoxValues \ hypre_F90_NAME(fhypre_sstructmatrixaddtoboxval, FHYPRE_SSTRUCTMATRIXADDTOBOXVAL) extern void hypre_F90_NAME(fhypre_sstructmatrixaddtoboxval, FHYPRE_SSTRUCTMATRIXADDTOBOXVAL) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, + HYPRE_Real *); #define HYPRE_SStructMatrixAssemble \ hypre_F90_NAME(fhypre_sstructmatrixassemble, FHYPRE_SSTRUCTMATRIXASSEMBLE) extern void hypre_F90_NAME(fhypre_sstructmatrixassemble, FHYPRE_SSTRUCTMATRIXASSEMBLE) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_SStructMatrixSetSymmetric \ hypre_F90_NAME(fhypre_sstructmatrixsetsymmetri, FHYPRE_SSTRUCTMATRIXSETSYMMETRI) extern void hypre_F90_NAME(fhypre_sstructmatrixsetsymmetri, FHYPRE_SSTRUCTMATRIXSETSYMMETRI) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *); #define HYPRE_SStructMatrixSetNSSymmetric \ hypre_F90_NAME(fhypre_sstructmatrixsetnssymmet, FHYPRE_SSTRUCTMATRIXSETNSSYMMET) extern void hypre_F90_NAME(fhypre_sstructmatrixsetnssymmet, FHYPRE_SSTRUCTMATRIXSETNSSYMMET) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructMatrixSetObjectType \ hypre_F90_NAME(fhypre_sstructmatrixsetobjectty, FHYPRE_SSTRUCTMATRIXSETOBJECTTY) extern void hypre_F90_NAME(fhypre_sstructmatrixsetobjectty, FHYPRE_SSTRUCTMATRIXSETOBJECTTY) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructMatrixGetObject \ hypre_F90_NAME(fhypre_sstructmatrixgetobject, FHYPRE_SSTRUCTMATRIXGETOBJECT) extern void hypre_F90_NAME(fhypre_sstructmatrixgetobject, FHYPRE_SSTRUCTMATRIXGETOBJECT) - (hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_SStructMatrixPrint \ hypre_F90_NAME(fhypre_sstructmatrixprint, FHYPRE_SSTRUCTMATRIXPRINT) extern void hypre_F90_NAME(fhypre_sstructmatrixprint, FHYPRE_SSTRUCTMATRIXPRINT) - (const char *, hypre_F90_Obj *, HYPRE_Int *); +(const char *, hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructStencilCreate \ hypre_F90_NAME(fhypre_sstructstencilcreate, FHYPRE_SSTRUCTSTENCILCREATE) extern void hypre_F90_NAME(fhypre_sstructstencilcreate, FHYPRE_SSTRUCTSTENCILCREATE) - (HYPRE_Int *, HYPRE_Int *, hypre_F90_Obj *); +(HYPRE_Int *, HYPRE_Int *, hypre_F90_Obj *); #define HYPRE_SStructStencilDestroy \ hypre_F90_NAME(fhypre_sstructstencildestroy, FHYPRE_SSTRUCTSTENCILDESTROY) extern void hypre_F90_NAME(fhypre_sstructstencildestroy, FHYPRE_SSTRUCTSTENCILDESTROY) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_SStructStencilSetEntry \ hypre_F90_NAME(fhypre_sstructstencilsetentry, FHYPRE_SSTRUCTSTENCILSETENTRY) extern void hypre_F90_NAME(fhypre_sstructstencilsetentry, FHYPRE_SSTRUCTSTENCILSETENTRY) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *); #define HYPRE_SStructVectorCreate \ hypre_F90_NAME(fhypre_sstructvectorcreate, FHYPRE_SSTRUCTVECTORCREATE) extern void hypre_F90_NAME(fhypre_sstructvectorcreate, FHYPRE_SSTRUCTVECTORCREATE) - (HYPRE_Int *, hypre_F90_Obj *, hypre_F90_Obj *); +(HYPRE_Int *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_SStructVectorDestroy \ hypre_F90_NAME(fhypre_sstructvectordestroy, FHYPRE_SSTRUCTVECTORDESTROY) extern void hypre_F90_NAME(fhypre_sstructvectordestroy, FHYPRE_SSTRUCTVECTORDESTROY) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_SStructVectorInitialize \ hypre_F90_NAME(fhypre_sstructvectorinitialize, FHYPRE_SSTRUCTVECTORINITIALIZE) extern void hypre_F90_NAME(fhypre_sstructvectorinitialize, FHYPRE_SSTRUCTVECTORINITIALIZE) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_SStructVectorSetValues \ hypre_F90_NAME(fhypre_sstructvectorsetvalues, FHYPRE_SSTRUCTVECTORSETVALUES) extern void hypre_F90_NAME(fhypre_sstructvectorsetvalues, FHYPRE_SSTRUCTVECTORSETVALUES) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Real *); #define HYPRE_SStructVectorSetBoxValues \ hypre_F90_NAME(fhypre_sstructvectorsetboxvalue, FHYPRE_SSTRUCTVECTORSETBOXVALUE) extern void hypre_F90_NAME(fhypre_sstructvectorsetboxvalue, FHYPRE_SSTRUCTVECTORSETBOXVALUE) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Real *); #define HYPRE_SStructVectorAddToValues \ hypre_F90_NAME(fhypre_sstructvectoraddtovalues, FHYPRE_SSTRUCTVECTORADDTOVALUES) extern void hypre_F90_NAME(fhypre_sstructvectoraddtovalues, FHYPRE_SSTRUCTVECTORADDTOVALUES) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Real *); #define HYPRE_SStructVectorAddToBoxValues \ hypre_F90_NAME(fhypre_sstructvectoraddtoboxval, FHYPRE_SSTRUCTVECTORADDTOBOXVAL) extern void hypre_F90_NAME(fhypre_sstructvectoraddtoboxval, FHYPRE_SSTRUCTVECTORADDTOBOXVAL) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Real *); #define HYPRE_SStructVectorAssemble \ hypre_F90_NAME(fhypre_sstructvectorassemble, FHYPRE_SSTRUCTVECTORASSEMBLE) extern void hypre_F90_NAME(fhypre_sstructvectorassemble, FHYPRE_SSTRUCTVECTORASSEMBLE) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_SStructVectorGather \ hypre_F90_NAME(fhypre_sstructvectorgather, FHYPRE_SSTRUCTVECTORGATHER) extern void hypre_F90_NAME(fhypre_sstructvectorgather, FHYPRE_SSTRUCTVECTORGATHER) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_SStructVectorGetValues \ hypre_F90_NAME(fhypre_sstructvectorgetvalues, FHYPRE_SSTRUCTVECTORGETVALUES) extern void hypre_F90_NAME(fhypre_sstructvectorgetvalues, FHYPRE_SSTRUCTVECTORGETVALUES) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Real *); #define HYPRE_SStructVectorGetBoxValues \ hypre_F90_NAME(fhypre_sstructvectorgetboxvalue, FHYPRE_SSTRUCTVECTORGETBOXVALUE) extern void hypre_F90_NAME(fhypre_sstructvectorgetboxvalue, FHYPRE_SSTRUCTVECTORGETBOXVALUE) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Real *); #define HYPRE_SStructVectorSetObjectType \ hypre_F90_NAME(fhypre_sstructvectorsetobjectty, FHYPRE_SSTRUCTVECTORSETOBJECTTY) extern void hypre_F90_NAME(fhypre_sstructvectorsetobjectty, FHYPRE_SSTRUCTVECTORSETOBJECTTY) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructVectorGetObject \ hypre_F90_NAME(fhypre_sstructvectorgetobject, FHYPRE_SSTRUCTVECTORGETOBJECT) extern void hypre_F90_NAME(fhypre_sstructvectorgetobject, FHYPRE_SSTRUCTVECTORGETOBJECT) - (hypre_F90_Obj *, void *); +(hypre_F90_Obj *, void *); #define HYPRE_SStructVectorPrint \ hypre_F90_NAME(fhypre_sstructvectorprint, FHYPRE_SSTRUCTVECTORPRINT) extern void hypre_F90_NAME(fhypre_sstructvectorprint, FHYPRE_SSTRUCTVECTORPRINT) - (const char *, hypre_F90_Obj *, HYPRE_Int *); +(const char *, hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructBiCGSTABCreate \ hypre_F90_NAME(fhypre_sstructbicgstabcreate, FHYPRE_SSTRUCTBICGSTABCREATE) extern void hypre_F90_NAME(fhypre_sstructbicgstabcreate, FHYPRE_SSTRUCTBICGSTABCREATE) - (HYPRE_Int *, hypre_F90_Obj *); +(HYPRE_Int *, hypre_F90_Obj *); #define HYPRE_SStructBiCGSTABDestroy \ hypre_F90_NAME(fhypre_sstructbicgstabdestroy, FHYPRE_SSTRUCTBICGSTABDESTROY) extern void hypre_F90_NAME(fhypre_sstructbicgstabdestroy, FHYPRE_SSTRUCTBICGSTABDESTROY) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_SStructBiCGSTABSetup \ hypre_F90_NAME(fhypre_sstructbicgstabsetup, FHYPRE_SSTRUCTBICGSTABSETUP) extern void hypre_F90_NAME(fhypre_sstructbicgstabsetup, FHYPRE_SSTRUCTBICGSTABSETUP) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_SStructBiCGSTABSolve \ hypre_F90_NAME(fhypre_sstructbicgstabsolve, FHYPRE_SSTRUCTBICGSTABSOLVE) extern void hypre_F90_NAME(fhypre_sstructbicgstabsolve, FHYPRE_SSTRUCTBICGSTABSOLVE) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_SStructBiCGSTABSetTol \ hypre_F90_NAME(fhypre_sstructbicgstabsettol, FHYPRE_SSTRUCTBICGSTABSETTOL) extern void hypre_F90_NAME(fhypre_sstructbicgstabsettol, FHYPRE_SSTRUCTBICGSTABSETTOL) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_SStructBiCGSTABSetMinIter \ hypre_F90_NAME(fhypre_sstructbicgstabsetminite, FHYPRE_SSTRUCTBICGSTABSETMINITE) extern void hypre_F90_NAME(fhypre_sstructbicgstabsetminite, FHYPRE_SSTRUCTBICGSTABSETMINITE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructBiCGSTABSetMaxIter \ hypre_F90_NAME(fhypre_sstructbicgstabsetmaxite, FHYPRE_SSTRUCTBICGSTABSETMAXITE) extern void hypre_F90_NAME(fhypre_sstructbicgstabsetmaxite, FHYPRE_SSTRUCTBICGSTABSETMAXITE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructBiCGSTABSetStopCrit \ hypre_F90_NAME(fhypre_sstructbicgstabsetstopcr, FHYPRE_SSTRUCTBICGSTABSETSTOPCR) extern void hypre_F90_NAME(fhypre_sstructbicgstabsetstopcr, FHYPRE_SSTRUCTBICGSTABSETSTOPCR) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructBiCGSTABSetPrecond \ hypre_F90_NAME(fhypre_sstructbicgstabsetprecon, FHYPRE_SSTRUCTBICGSTABSETPRECON) extern void hypre_F90_NAME(fhypre_sstructbicgstabsetprecon, FHYPRE_SSTRUCTBICGSTABSETPRECON) - (hypre_F90_Obj *, HYPRE_Int *, hypre_F90_Obj *); +(hypre_F90_Obj *, HYPRE_Int *, hypre_F90_Obj *); #define HYPRE_SStructBiCGSTABSetLogging \ hypre_F90_NAME(fhypre_sstructbicgstabsetloggin, FHYPRE_SSTRUCTBICGSTABSETLOGGIN) extern void hypre_F90_NAME(fhypre_sstructbicgstabsetloggin, FHYPRE_SSTRUCTBICGSTABSETLOGGIN) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructBiCGSTABSetPrintLevel \ hypre_F90_NAME(fhypre_sstructbicgstabsetprintl, FHYPRE_SSTRUCTBICGSTABSETPRINTL) extern void hypre_F90_NAME(fhypre_sstructbicgstabsetprintl, FHYPRE_SSTRUCTBICGSTABSETPRINTL) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructBiCGSTABGetNumIterations \ hypre_F90_NAME(fhypre_sstructbicgstabgetnumite, FHYPRE_SSTRUCTBICGSTABGETNUMITE) extern void hypre_F90_NAME(fhypre_sstructbicgstabgetnumite, FHYPRE_SSTRUCTBICGSTABGETNUMITE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructBiCGSTABGetFinalRelativeResidualNorm \ hypre_F90_NAME(fhypre_sstructbicgstabgetfinalr, FHYPRE_SSTRUCTBICGSTABGETFINALR) extern void hypre_F90_NAME(fhypre_sstructbicgstabgetfinalr, FHYPRE_SSTRUCTBICGSTABGETFINALR) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_SStructBiCGSTABGetResidual \ hypre_F90_NAME(fhypre_sstructbicgstabgetresidu, FHYPRE_SSTRUCTBICGSTABGETRESIDU) extern void hypre_F90_NAME(fhypre_sstructbicgstabgetresidu, FHYPRE_SSTRUCTBICGSTABGETRESIDU) - (hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_SStructGMRESCreate \ hypre_F90_NAME(fhypre_sstructgmrescreate, FHYPRE_SSTRUCTGMRESCREATE) extern void hypre_F90_NAME(fhypre_sstructgmrescreate, FHYPRE_SSTRUCTGMRESCREATE) - (hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_SStructGMRESDestroy \ hypre_F90_NAME(fhypre_sstructgmresdestroy, FHYPRE_SSTRUCTGMRESDESTROY) extern void hypre_F90_NAME(fhypre_sstructgmresdestroy, FHYPRE_SSTRUCTGMRESDESTROY) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_SStructGMRESSetup \ hypre_F90_NAME(fhypre_sstructgmressetup, FHYPRE_SSTRUCTGMRESSETUP) extern void hypre_F90_NAME(fhypre_sstructgmressetup, FHYPRE_SSTRUCTGMRESSETUP) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_SStructGMRESSolve \ hypre_F90_NAME(fhypre_sstructgmressolve, FHYPRE_SSTRUCTGMRESSOLVE) extern void hypre_F90_NAME(fhypre_sstructgmressolve, FHYPRE_SSTRUCTGMRESSOLVE) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_SStructGMRESSetKDim \ hypre_F90_NAME(fhypre_sstructgmressetkdim, FHYPRE_SSTRUCTGMRESSETKDIM) extern void hypre_F90_NAME(fhypre_sstructgmressetkdim, FHYPRE_SSTRUCTGMRESSETKDIM) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructGMRESSetTol \ hypre_F90_NAME(fhypre_sstructgmressettol, FHYPRE_SSTRUCTGMRESSETTOL) extern void hypre_F90_NAME(fhypre_sstructgmressettol, FHYPRE_SSTRUCTGMRESSETTOL) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_SStructGMRESSetMinIter \ hypre_F90_NAME(fhypre_sstructgmressetminiter, FHYPRE_SSTRUCTGMRESSETMINITER) extern void hypre_F90_NAME(fhypre_sstructgmressetminiter, FHYPRE_SSTRUCTGMRESSETMINITER) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructGMRESSetMaxIter \ hypre_F90_NAME(fhypre_sstructgmressetmaxiter, FHYPRE_SSTRUCTGMRESSETMAXITER) extern void hypre_F90_NAME(fhypre_sstructgmressetmaxiter, FHYPRE_SSTRUCTGMRESSETMAXITER) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructGMRESSetStopCrit \ hypre_F90_NAME(fhypre_sstructgmressetstopcrit, FHYPRE_SSTRUCTGMRESSETSTOPCRIT) extern void hypre_F90_NAME(fhypre_sstructgmressetstopcrit, FHYPRE_SSTRUCTGMRESSETSTOPCRIT) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructGMRESSetPrecond \ hypre_F90_NAME(fhypre_sstructgmressetprecond, FHYPRE_SSTRUCTGMRESSETPRECOND) extern void hypre_F90_NAME(fhypre_sstructgmressetprecond, FHYPRE_SSTRUCTGMRESSETPRECOND) - (hypre_F90_Obj *, HYPRE_Int *, hypre_F90_Obj *); +(hypre_F90_Obj *, HYPRE_Int *, hypre_F90_Obj *); #define HYPRE_SStructGMRESSetLogging \ hypre_F90_NAME(fhypre_sstructgmressetlogging, FHYPRE_SSTRUCTGMRESSETLOGGING) extern void hypre_F90_NAME(fhypre_sstructgmressetlogging, FHYPRE_SSTRUCTGMRESSETLOGGING) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructGMRESSetPrintLevel \ hypre_F90_NAME(fhypre_sstructgmressetprintleve, FHYPRE_SSTRUCTGMRESSETPRINTLEVE) extern void hypre_F90_NAME(fhypre_sstructgmressetprintleve, FHYPRE_SSTRUCTGMRESSETPRINTLEVE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructGMRESGetNumIterations \ hypre_F90_NAME(fhypre_sstructgmresgetnumiterati, FHYPRE_SSTRUCTGMRESGETNUMITERATI) extern void hypre_F90_NAME(fhypre_sstructgmresgetnumiterati, FHYPRE_SSTRUCTGMRESGETNUMITERATI) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructGMRESGetFinalRelativeResidualNorm \ hypre_F90_NAME(fhypre_sstructgmresgetfinalrela, FHYPRE_SSTRUCTGMRESGETFINALRELA) extern void hypre_F90_NAME(fhypre_sstructgmresgetfinalrela, FHYPRE_SSTRUCTGMRESGETFINALRELA) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_SStructGMRESGetResidual \ hypre_F90_NAME(fhypre_sstructgmresgetresidual, FHYPRE_SSTRUCTGMRESGETRESIDUAL) extern void hypre_F90_NAME(fhypre_sstructgmresgetresidual, FHYPRE_SSTRUCTGMRESGETRESIDUAL) - (hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_SStructPCGCreate \ hypre_F90_NAME(fhypre_sstructpcgcreate, FHYPRE_SSTRUCTPCGCREATE) extern void hypre_F90_NAME(fhypre_sstructpcgcreate, FHYPRE_SSTRUCTPCGCREATE) - (hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_SStructPCGDestroy \ hypre_F90_NAME(fhypre_sstructpcgdestroy, FHYPRE_SSTRUCTPCGDESTROY) extern void hypre_F90_NAME(fhypre_sstructpcgdestroy, FHYPRE_SSTRUCTPCGDESTROY) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_SStructPCGSetup \ hypre_F90_NAME(fhypre_sstructpcgsetup, FHYPRE_SSTRUCTPCGDESTROY) extern void hypre_F90_NAME(fhypre_sstructpcgsetup, FHYPRE_SSTRUCTPCGDESTROY) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_SStructPCGSolve \ hypre_F90_NAME(fhypre_sstructpcgsolve, FHYPRE_SSTRUCTPCGSOLVE) extern void hypre_F90_NAME(fhypre_sstructpcgsolve, FHYPRE_SSTRUCTPCGSOLVE) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_SStructPCGSetTol \ hypre_F90_NAME(fhypre_sstructpcgsettol, FHYPRE_SSTRUCTPCGSETTOL) extern void hypre_F90_NAME(fhypre_sstructpcgsettol, FHYPRE_SSTRUCTPCGSETTOL) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_SStructPCGSetMaxIter \ hypre_F90_NAME(fhypre_sstructpcgsetmaxiter, FHYPRE_SSTRUCTPCGSETMAXITER) extern void hypre_F90_NAME(fhypre_sstructpcgsetmaxiter, FHYPRE_SSTRUCTPCGSETMAXITER) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructPCGSetTwoNorm \ hypre_F90_NAME(fhypre_sstructpcgsettwonorm, FHYPRE_SSTRUCTPCGSETTWONORM) extern void hypre_F90_NAME(fhypre_sstructpcgsettwonorm, FHYPRE_SSTRUCTPCGSETTWONORM) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructPCGSetRelChange \ hypre_F90_NAME(fhypre_sstructpcgsetrelchange, FHYPRE_SSTRUCTPCGSETRELCHANGE) extern void hypre_F90_NAME(fhypre_sstructpcgsetrelchange, FHYPRE_SSTRUCTPCGSETRELCHANGE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructPCGSetPrecond \ hypre_F90_NAME(fhypre_sstructpcgsetprecond, FHYPRE_SSTRUCTPCGSETPRECOND) extern void hypre_F90_NAME(fhypre_sstructpcgsetprecond, FHYPRE_SSTRUCTPCGSETPRECOND) - (hypre_F90_Obj *, HYPRE_Int *, hypre_F90_Obj *); +(hypre_F90_Obj *, HYPRE_Int *, hypre_F90_Obj *); #define HYPRE_SStructPCGSetLogging \ hypre_F90_NAME(fhypre_sstructpcgsetlogging, FHYPRE_SSTRUCTPCGSETLOGGING) extern void hypre_F90_NAME(fhypre_sstructpcgsetlogging, FHYPRE_SSTRUCTPCGSETLOGGING) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructPCGSetPrintLevel \ hypre_F90_NAME(fhypre_sstructpcgsetprintlevel, FHYPRE_SSTRUCTPCGSETPRINTLEVEL) extern void hypre_F90_NAME(fhypre_sstructpcgsetprintlevel, FHYPRE_SSTRUCTPCGSETPRINTLEVEL) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructPCGGetNumIterations \ hypre_F90_NAME(fhypre_sstructpcggetnumiteratio, FHYPRE_SSTRUCTPCGGETNUMITERATIO) extern void hypre_F90_NAME(fhypre_sstructpcggetnumiteratio, FHYPRE_SSTRUCTPCGGETNUMITERATIO) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructPCGGetFinalRelativeResidualNorm \ hypre_F90_NAME(fhypre_sstructpcggetfinalrelati, FHYPRE_SSTRUCTPCGGETFINALRELATI) extern void hypre_F90_NAME(fhypre_sstructpcggetfinalrelati, FHYPRE_SSTRUCTPCGGETFINALRELATI) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_SStructPCGGetResidual \ hypre_F90_NAME(fhypre_sstructpcggetresidual, FHYPRE_SSTRUCTPCGGETRESIDUAL) extern void hypre_F90_NAME(fhypre_sstructpcggetresidual, FHYPRE_SSTRUCTPCGGETRESIDUAL) - (hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_SStructDiagScaleSetup \ hypre_F90_NAME(fhypre_sstructdiagscalesetup, FHYPRE_SSTRUCTDIAGSCALESETUP) extern void hypre_F90_NAME(fhypre_sstructdiagscalesetup, FHYPRE_SSTRUCTDIAGSCALESETUP) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_SStructDiagScale \ hypre_F90_NAME(fhypre_sstructdiagscale, FHYPRE_SSTRUCTDIAGSCALE) extern void hypre_F90_NAME(fhypre_sstructdiagscale, FHYPRE_SSTRUCTDIAGSCALE) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_SStructSplitCreate \ hypre_F90_NAME(fhypre_sstructsplitcreate, FHYPRE_SSTRUCTSPLITCREATE) extern void hypre_F90_NAME(fhypre_sstructsplitcreate, FHYPRE_SSTRUCTSPLITCREATE) - (hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_SStructSplitDestroy \ hypre_F90_NAME(fhypre_sstructsplitdestroy, FHYPRE_SSTRUCTSPLITDESTROY) extern void hypre_F90_NAME(fhypre_sstructsplitdestroy, FHYPRE_SSTRUCTSPLITDESTROY) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_SStructSplitSetup \ hypre_F90_NAME(fhypre_sstructsplitsetup, FHYPRE_SSTRUCTSPLITSETUP) extern void hypre_F90_NAME(fhypre_sstructsplitsetup, FHYPRE_SSTRUCTSPLITSETUP) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_SStructSplitSolve \ hypre_F90_NAME(fhypre_sstructsplitsolve, FHYPRE_SSTRUCTSPLITSOLVE) extern void hypre_F90_NAME(fhypre_sstructsplitsolve, FHYPRE_SSTRUCTSPLITSOLVE) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_SStructSplitSetTol \ hypre_F90_NAME(fhypre_sstructsplitsettol, FHYPRE_SSTRUCTSPLITSETTOL) extern void hypre_F90_NAME(fhypre_sstructsplitsettol, FHYPRE_SSTRUCTSPLITSETTOL) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_SStructSplitSetMaxIter \ hypre_F90_NAME(fhypre_sstructsplitsetmaxiter, FHYPRE_SSTRUCTSPLITSETMAXITER) extern void hypre_F90_NAME(fhypre_sstructsplitsetmaxiter, FHYPRE_SSTRUCTSPLITSETMAXITER) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructSplitSetZeroGuess \ hypre_F90_NAME(fhypre_sstructsplitsetzeroguess, FHYPRE_SSTRUCTSPLITSETZEROGUESS) extern void hypre_F90_NAME(fhypre_sstructsplitsetzeroguess, FHYPRE_SSTRUCTSPLITSETZEROGUESS) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_SStructSplitSetNonZeroGuess \ hypre_F90_NAME(fhypre_sstructsplitsetnonzerogu, FHYPRE_SSTRUCTSPLITSETNONZEROGU) extern void hypre_F90_NAME(fhypre_sstructsplitsetnonzerogu, FHYPRE_SSTRUCTSPLITSETNONZEROGU) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_SStructSplitSetStructSolver \ hypre_F90_NAME(fhypre_sstructsplitsetstructsol, FHYPRE_SSTRUCTSPLITSETSTRUCTSOL) extern void hypre_F90_NAME(fhypre_sstructsplitsetstructsol, FHYPRE_SSTRUCTSPLITSETSTRUCTSOL) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructSplitGetNumIterations \ hypre_F90_NAME(fhypre_sstructsplitgetnumiterat, FHYPRE_SSTRUCTSPLITGETNUMITERAT) extern void hypre_F90_NAME(fhypre_sstructsplitgetnumiterat, FHYPRE_SSTRUCTSPLITGETNUMITERAT) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructSplitGetFinalRelativeResidualNorm \ hypre_F90_NAME(fhypre_sstructsplitgetfinalrela, FHYPRE_SSTRUCTSPLITGETFINALRELA) extern void hypre_F90_NAME(fhypre_sstructsplitgetfinalrela, FHYPRE_SSTRUCTSPLITGETFINALRELA) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_SStructSysPFMGCreate \ hypre_F90_NAME(fhypre_sstructsyspfmgcreate, FHYPRE_SSTRUCTSYSPFMGCREATE) extern void hypre_F90_NAME(fhypre_sstructsyspfmgcreate, FHYPRE_SSTRUCTSYSPFMGCREATE) - (hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_SStructSysPFMGDestroy \ hypre_F90_NAME(fhypre_sstructsyspfmgdestroy, FHYPRE_SSTRUCTSYSPFMGDESTROY) extern void hypre_F90_NAME(fhypre_sstructsyspfmgdestroy, FHYPRE_SSTRUCTSYSPFMGDESTROY) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_SStructSysPFMGSetup \ hypre_F90_NAME(fhypre_sstructsyspfmgsetup, FHYPRE_SSTRUCTSYSPFMGSETUP) extern void hypre_F90_NAME(fhypre_sstructsyspfmgsetup, FHYPRE_SSTRUCTSYSPFMGSETUP) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_SStructSysPFMGSolve \ hypre_F90_NAME(fhypre_sstructsyspfmgsolve, FHYPRE_SSTRUCTSYSPFMGSOLVE) extern void hypre_F90_NAME(fhypre_sstructsyspfmgsolve, FHYPRE_SSTRUCTSYSPFMGSOLVE) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_SStructSysPFMGSetTol \ hypre_F90_NAME(fhypre_sstructsyspfmgsettol, FHYPRE_SSTRUCTSYSPFMGSETTOL) extern void hypre_F90_NAME(fhypre_sstructsyspfmgsettol, FHYPRE_SSTRUCTSYSPFMGSETTOL) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_SStructSysPFMGSetMaxIter \ hypre_F90_NAME(fhypre_sstructsyspfmgsetmaxiter, FHYPRE_SSTRUCTSYSPFMGSETMAXITER) extern void hypre_F90_NAME(fhypre_sstructsyspfmgsetmaxiter, FHYPRE_SSTRUCTSYSPFMGSETMAXITER) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructSysPFMGSetRelChange \ hypre_F90_NAME(fhypre_sstructsyspfmgsetrelchan, FHYPRE_SSTRUCTSYSPFMGSETRELCHAN) extern void hypre_F90_NAME(fhypre_sstructsyspfmgsetrelchan, FHYPRE_SSTRUCTSYSPFMGSETRELCHAN) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructSysPFMGSetZeroGuess \ hypre_F90_NAME(fhypre_sstructsyspfmgsetzerogue, FHYPRE_SSTRUCTSYSPFMGSETZEROGUE) extern void hypre_F90_NAME(fhypre_sstructsyspfmgsetzerogue, FHYPRE_SSTRUCTSYSPFMGSETZEROGUE) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_SStructSysPFMGSetNonZeroGuess \ hypre_F90_NAME(fhypre_sstructsyspfmgsetnonzero, FHYPRE_SSTRUCTSYSPFMGSETNONZERO) extern void hypre_F90_NAME(fhypre_sstructsyspfmgsetnonzero, FHYPRE_SSTRUCTSYSPFMGSETNONZERO) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_SStructSysPFMGSetRelaxType \ hypre_F90_NAME(fhypre_sstructsyspfmgsetrelaxty, FHYPRE_SSTRUCTSYSPFMGSETRELAXTY) extern void hypre_F90_NAME(fhypre_sstructsyspfmgsetrelaxty, FHYPRE_SSTRUCTSYSPFMGSETRELAXTY) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructSysPFMGSetNumPreRelax \ hypre_F90_NAME(fhypre_sstructsyspfmgsetnumprer, FHYPRE_SSTRUCTSYSPFMGSETNUMPRER) extern void hypre_F90_NAME(fhypre_sstructsyspfmgsetnumprer, FHYPRE_SSTRUCTSYSPFMGSETNUMPRER) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructSysPFMGSetNumPostRelax \ hypre_F90_NAME(fhypre_sstructsyspfmgsetnumpost, FHYPRE_SSTRUCTSYSPFMGSETNUMPOST) extern void hypre_F90_NAME(fhypre_sstructsyspfmgsetnumpost, FHYPRE_SSTRUCTSYSPFMGSETNUMPOST) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructSysPFMGSetSkipRelax \ hypre_F90_NAME(fhypre_sstructsyspfmgsetskiprel, FHYPRE_SSTRUCTSYSPFMGSETSKIPREL) extern void hypre_F90_NAME(fhypre_sstructsyspfmgsetskiprel, FHYPRE_SSTRUCTSYSPFMGSETSKIPREL) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructSysPFMGSetDxyz \ hypre_F90_NAME(fhypre_sstructsyspfmgsetdxyz, FHYPRE_SSTRUCTSYSPFMGSETDXYZ) extern void hypre_F90_NAME(fhypre_sstructsyspfmgsetdxyz, FHYPRE_SSTRUCTSYSPFMGSETDXYZ) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_SStructSysPFMGSetLogging \ hypre_F90_NAME(fhypre_sstructsyspfmgsetlogging, FHYPRE_SSTRUCTSYSPFMGSETLOGGING) extern void hypre_F90_NAME(fhypre_sstructsyspfmgsetlogging, FHYPRE_SSTRUCTSYSPFMGSETLOGGING) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructSysPFMGSetPrintLevel \ hypre_F90_NAME(fhypre_sstructsyspfmgsetprintle, FHYPRE_SSTRUCTSYSPFMGSETPRINTLE) extern void hypre_F90_NAME(fhypre_sstructsyspfmgsetprintle, FHYPRE_SSTRUCTSYSPFMGSETPRINTLE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructSysPFMGGetNumIterations \ hypre_F90_NAME(fhypre_sstructsyspfmggetnumiter, FHYPRE_SSTRUCTSYSPFMGGETNUMITER) extern void hypre_F90_NAME(fhypre_sstructsyspfmggetnumiter, FHYPRE_SSTRUCTSYSPFMGGETNUMITER) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructSysPFMGGetFinalRelativeResidualNorm \ hypre_F90_NAME(fhypre_sstructsyspfmggetfinalre, FHYPRE_SSTRUCTSYSPFMGGETFINALRE) extern void hypre_F90_NAME(fhypre_sstructsyspfmggetfinalre, FHYPRE_SSTRUCTSYSPFMGGETFINALRE) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_SStructMaxwellCreate \ hypre_F90_NAME(fhypre_sstructmaxwellcreate, FHYPRE_SSTRUCTMAXWELLCREATE) extern void hypre_F90_NAME(fhypre_sstructmaxwellcreate, FHYPRE_SSTRUCTMAXWELLCREATE) - (hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_SStructMaxwellDestroy \ hypre_F90_NAME(fhypre_sstructmaxwelldestroy, FHYPRE_SSTRUCTMAXWELLDESTROY) extern void hypre_F90_NAME(fhypre_sstructmaxwelldestroy, FHYPRE_SSTRUCTMAXWELLDESTROY) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_SStructMaxwellSetup \ hypre_F90_NAME(fhypre_sstructmaxwellsetup, FHYPRE_SSTRUCTMAXWELLSETUP) extern void hypre_F90_NAME(fhypre_sstructmaxwellsetup, FHYPRE_SSTRUCTMAXWELLSETUP) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_SStructMaxwellSolve \ hypre_F90_NAME(fhypre_sstructmaxwellsolve, FHYPRE_SSTRUCTMAXWELLSOLVE) extern void hypre_F90_NAME(fhypre_sstructmaxwellsolve, FHYPRE_SSTRUCTMAXWELLSOLVE) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_SStructMaxwellSolve2 \ hypre_F90_NAME(fhypre_sstructmaxwellsolve2, FHYPRE_SSTRUCTMAXWELLSOLVE2) extern void hypre_F90_NAME(fhypre_sstructmaxwellsolve2, FHYPRE_SSTRUCTMAXWELLSOLVE2) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_MaxwellGrad \ hypre_F90_NAME(fhypre_maxwellgrad, FHYPRE_MAXWELLGRAD) extern void hypre_F90_NAME(fhypre_maxwellgrad, FHYPRE_MAXWELLGRAD) - (hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_SStructMaxwellSetGrad \ hypre_F90_NAME(fhypre_sstructmaxwellsetgrad, FHYPRE_SSTRUCTMAXWELLSETGRAD) extern void hypre_F90_NAME(fhypre_sstructmaxwellsetgrad, FHYPRE_SSTRUCTMAXWELLSETGRAD) - (hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_SStructMaxwellSetRfactors \ hypre_F90_NAME(fhypre_sstructmaxwellsetrfactor, FHYPRE_SSTRUCTMAXWELLSETRFACTOR) extern void hypre_F90_NAME(fhypre_sstructmaxwellsetrfactor, FHYPRE_SSTRUCTMAXWELLSETRFACTOR) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructMaxwellSetTol \ hypre_F90_NAME(fhypre_sstructmaxwellsettol, FHYPRE_SSTRUCTMAXWELLSETTOL) extern void hypre_F90_NAME(fhypre_sstructmaxwellsettol, FHYPRE_SSTRUCTMAXWELLSETTOL) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_SStructMaxwellSetConstantCoef \ hypre_F90_NAME(fhypre_sstructmaxwellsetconstan, FHYPRE_SSTRUCTMAXWELLSETCONSTAN) extern void hypre_F90_NAME(fhypre_sstructmaxwellsetconstan, FHYPRE_SSTRUCTMAXWELLSETCONSTAN) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructMaxwellSetMaxIter \ hypre_F90_NAME(fhypre_sstructmaxwellsetmaxiter, FHYPRE_SSTRUCTMAXWELLSETMAXITER) extern void hypre_F90_NAME(fhypre_sstructmaxwellsetmaxiter, FHYPRE_SSTRUCTMAXWELLSETMAXITER) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructMaxwellSetRelChange \ hypre_F90_NAME(fhypre_sstructmaxwellsetrelchan, FHYPRE_SSTRUCTMAXWELLSETRELCHAN) extern void hypre_F90_NAME(fhypre_sstructmaxwellsetrelchan, FHYPRE_SSTRUCTMAXWELLSETRELCHAN) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructMaxwellSetNumPreRelax \ hypre_F90_NAME(fhypre_sstructmaxwellsetnumprer, FHYPRE_SSTRUCTMAXWELLSETNUMPRER) extern void hypre_F90_NAME(fhypre_sstructmaxwellsetnumprer, FHYPRE_SSTRUCTMAXWELLSETNUMPRER) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructMaxwellSetNumPostRelax \ hypre_F90_NAME(fhypre_sstructmaxwellsetnumpost, FHYPRE_SSTRUCTMAXWELLSETNUMPOST) extern void hypre_F90_NAME(fhypre_sstructmaxwellsetnumpost, FHYPRE_SSTRUCTMAXWELLSETNUMPOST) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructMaxwellSetLogging \ hypre_F90_NAME(fhypre_sstructmaxwellsetlogging, FHYPRE_SSTRUCTMAXWELLSETLOGGING) extern void hypre_F90_NAME(fhypre_sstructmaxwellsetlogging, FHYPRE_SSTRUCTMAXWELLSETLOGGING) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructMaxwellSetPrintLevel \ hypre_F90_NAME(fhypre_sstructmaxwellsetprintle, FHYPRE_SSTRUCTMAXWELLSETPRINTLE) extern void hypre_F90_NAME(fhypre_sstructmaxwellsetprintle, FHYPRE_SSTRUCTMAXWELLSETPRINTLE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructMaxwellPrintLogging \ hypre_F90_NAME(fhypre_sstructmaxwellprintloggi, FHYPRE_SSTRUCTMAXWELLPRINTLOGGI) extern void hypre_F90_NAME(fhypre_sstructmaxwellprintloggi, FHYPRE_SSTRUCTMAXWELLPRINTLOGGI) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructMaxwellGetNumIterations \ - hypre_F90_NAME(fhypre_sstructmaxwellgetnumiter, FHYPRE_SSTRUCTMAXWELLGETNUMITER) -extern void hypre_F90_NAME(fhypre_sstructmaxwellgetnumiter, FHYPRE_SSTRUCTMAXWELLGETNUMITER) - (hypre_F90_Obj *, HYPRE_Int *); + hypre_F90_NAME(fhypre_sstructmaxwellgetnumiter, FHYPRE_SSTRUCTMAXWELLGETNUMITER) +extern void hypre_F90_NAME(fhypre_sstructmaxwellgetnumiter, FHYPRE_SSTRUCTMAXWELLGETNUMITER) +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_SStructMaxwellGetFinalRelativeResidualNorm \ - hypre_F90_NAME(fhypre_sstructmaxwellgetfinalre, FHYPRE_SSTRUCTMAXWELLGETFINALRE) -extern void hypre_F90_NAME(fhypre_sstructmaxwellgetfinalre, FHYPRE_SSTRUCTMAXWELLGETFINALRE) - (hypre_F90_Obj *, HYPRE_Real *); + hypre_F90_NAME(fhypre_sstructmaxwellgetfinalre, FHYPRE_SSTRUCTMAXWELLGETFINALRE) +extern void hypre_F90_NAME(fhypre_sstructmaxwellgetfinalre, FHYPRE_SSTRUCTMAXWELLGETFINALRE) +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_SStructMaxwellPhysBdy \ - hypre_F90_NAME(fhypre_sstructmaxwellphysbdy, FHYPRE_SSTRUCTMAXWELLPHYSBDY) -extern void hypre_F90_NAME(fhypre_sstructmaxwellphysbdy, FHYPRE_SSTRUCTMAXWELLPHYSBDY) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *); + hypre_F90_NAME(fhypre_sstructmaxwellphysbdy, FHYPRE_SSTRUCTMAXWELLPHYSBDY) +extern void hypre_F90_NAME(fhypre_sstructmaxwellphysbdy, FHYPRE_SSTRUCTMAXWELLPHYSBDY) +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *); #define HYPRE_SStructMaxwellEliminateRowsCols \ - hypre_F90_NAME(fhypre_sstructmaxwelleliminater, FHYPRE_SSTRUCTMAXWELLELIMINATER) -extern void hypre_F90_NAME(fhypre_sstructmaxwelleliminater, FHYPRE_SSTRUCTMAXWELLELIMINATER) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *); + hypre_F90_NAME(fhypre_sstructmaxwelleliminater, FHYPRE_SSTRUCTMAXWELLELIMINATER) +extern void hypre_F90_NAME(fhypre_sstructmaxwelleliminater, FHYPRE_SSTRUCTMAXWELLELIMINATER) +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *); #define HYPRE_SStructMaxwellZeroVector \ - hypre_F90_NAME(fhypre_sstructmaxwellzerovector, FHYPRE_SSTRUCTMAXWELLZEROVECTOR) -extern void hypre_F90_NAME(fhypre_sstructmaxwellzerovector, FHYPRE_SSTRUCTMAXWELLZEROVECTOR) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *); + hypre_F90_NAME(fhypre_sstructmaxwellzerovector, FHYPRE_SSTRUCTMAXWELLZEROVECTOR) +extern void hypre_F90_NAME(fhypre_sstructmaxwellzerovector, FHYPRE_SSTRUCTMAXWELLZEROVECTOR) +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *); #ifdef __cplusplus } diff --git a/external/hypre/src/test/hypre_struct_fortran_test.h b/external/hypre/src/test/hypre_struct_fortran_test.h index 099943d8..a23b9cb4 100644 --- a/external/hypre/src/test/hypre_struct_fortran_test.h +++ b/external/hypre/src/test/hypre_struct_fortran_test.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -16,1007 +16,1007 @@ extern "C" { #define HYPRE_StructStencilCreate \ hypre_F90_NAME(fhypre_structstencilcreate, FHYPRE_STRUCTSTENCILCREATE) extern void hypre_F90_NAME(fhypre_structstencilcreate, FHYPRE_STRUCTSTENCILCREATE) - (HYPRE_Int *, HYPRE_Int *, hypre_F90_Obj *); +(HYPRE_Int *, HYPRE_Int *, hypre_F90_Obj *); #define HYPRE_StructStencilDestroy \ hypre_F90_NAME(fhypre_structstencildestroy, FHYPRE_STRUCTSTENCILDESTROY) extern void hypre_F90_NAME(fhypre_structstencildestroy, FHYPRE_STRUCTSTENCILDESTROY) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_StructStencilSetElement \ hypre_F90_NAME(fhypre_structstencilsetelement, FHYPRE_STRUCTSTENCILSETELEMENT) extern void hypre_F90_NAME(fhypre_structstencilsetelement, FHYPRE_STRUCTSTENCILSETELEMENT) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *); #define HYPRE_StructGridCreate \ hypre_F90_NAME(fhypre_structgridcreate, FHYPRE_STRUCTGRIDCREATE) extern void hypre_F90_NAME(fhypre_structgridcreate, FHYPRE_STRUCTGRIDCREATE) - (HYPRE_Int *, HYPRE_Int *, hypre_F90_Obj *); +(HYPRE_Int *, HYPRE_Int *, hypre_F90_Obj *); #define HYPRE_StructGridDestroy \ hypre_F90_NAME(fhypre_structgriddestroy, FHYPRE_STRUCTGRIDDESTROY) extern void hypre_F90_NAME(fhypre_structgriddestroy, FHYPRE_STRUCTGRIDDESTROY) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_StructGridSetExtents \ hypre_F90_NAME(fhypre_structgridsetextents, FHYPRE_STRUCTGRIDSETEXTENTS) extern void hypre_F90_NAME(fhypre_structgridsetextents, FHYPRE_STRUCTGRIDSETEXTENTS) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *); #define HYPRE_StructGridSetPeriodic \ hypre_F90_NAME(fhypre_structgridsetperiodic, FHYPRE_STRUCTGRIDSETPERIODIC) extern void hypre_F90_NAME(fhypre_structgridsetperiodic, fhypre_structsetgridperiodic) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructGridAssemble \ hypre_F90_NAME(fhypre_structgridassemble, FHYPRE_STRUCTGRIDASSEMBLE) extern void hypre_F90_NAME(fhypre_structgridassemble, FHYPRE_STRUCTGRIDASSEMBLE) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_StructGridSetNumGhost \ hypre_F90_NAME(fhypre_structgridsetnumghost, FHYPRE_STRUCTGRIDSETNUMGHOST) extern void hypre_F90_NAME(fhypre_structgridsetnumghost, fhypre_structsetgridnumghost) - (hypre_F90_Obj *, HYPRE_Int *); - +(hypre_F90_Obj *, HYPRE_Int *); + #define HYPRE_StructMatrixCreate \ hypre_F90_NAME(fhypre_structmatrixcreate, FHYPRE_STRUCTMATRIXCREATE) extern void hypre_F90_NAME(fhypre_structmatrixcreate, FHYPRE_STRUCTMATRIXCREATE) - (HYPRE_Int *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(HYPRE_Int *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_StructMatrixDestroy \ hypre_F90_NAME(fhypre_structmatrixdestroy, FHYPRE_STRUCTMATRIXDESTROY) extern void hypre_F90_NAME(fhypre_structmatrixdestroy, FHYPRE_STRUCTMATRIXDESTROY) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_StructMatrixInitialize \ hypre_F90_NAME(fhypre_structmatrixinitialize, FHYPRE_STRUCTMATRIXINITIALIZE) extern void hypre_F90_NAME(fhypre_structmatrixinitialize, FHYPRE_STRUCTMATRIXINITIALIZE) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_StructMatrixSetValues \ hypre_F90_NAME(fhypre_structmatrixsetvalues, FHYPRE_STRUCTMATRIXSETVALUES) extern void hypre_F90_NAME(fhypre_structmatrixsetvalues, FHYPRE_STRUCTMATRIXSETVALUES) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *); #define HYPRE_StructMatrixSetBoxValues \ hypre_F90_NAME(fhypre_structmatrixsetboxvalues, FHYPRE_STRUCTMATRIXSETBOXVALUES) extern void hypre_F90_NAME(fhypre_structmatrixsetboxvalues, FHYPRE_STRUCTMATRIXSETBOXVALUES) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Real *); #define HYPRE_StructMatrixGetBoxValues \ hypre_F90_NAME(fhypre_structmatrixgetboxvalues, FHYPRE_STRUCTMATRIXGETBOXVALUES) extern void hypre_F90_NAME(fhypre_structmatrixgetboxvalues, FHYPRE_STRUCTMATRIXGETBOXVALUES) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Real *); #define HYPRE_StructMatrixSetConstantEntries \ hypre_F90_NAME(fhypre_structmatrixsetconstante, FHYPRE_STRUCTMATRIXSETCONSTANTE) extern void hypre_F90_NAME(fhypre_structmatrixsetconstante, FHYPRE_STRUCTMATRIXSETCONSTANTE) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *); #define HYPRE_StructMatrixSetConstantValues \ hypre_F90_NAME(fhypre_structmatrixsetconstantv, FHYPRE_STRUCTMATRIXSETCONSTANTV) extern void hypre_F90_NAME(fhypre_structmatrixsetconstantv, FHYPRE_STRUCTMATRIXSETCONSTANTV) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Real *); #define HYPRE_StructMatrixAddToValues \ hypre_F90_NAME(fhypre_structmatrixaddtovalues, FHYPRE_STRUCTMATRIXADDTOVALUES) extern void hypre_F90_NAME(fhypre_structmatrixaddtovalues, FHYPRE_STRUCTMATRIXADDTOVALUES) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Real *); #define HYPRE_StructMatrixAddToBoxValues \ hypre_F90_NAME(fhypre_structmatrixaddtoboxvalues, FHYPRE_STRUCTMATRIXADDTOBOXVALUES) extern void hypre_F90_NAME(fhypre_structmatrixaddtoboxvalues, FHYPRE_STRUCTMATRIXADDTOBOXVALUES) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Int *, HYPRE_Real *); #define HYPRE_StructMatrixAddToConstantValues \ hypre_F90_NAME(fhypre_structmatrixaddtoconstant, FHYPRE_STRUCTMATRIXADDTOCONSTANT) extern void hypre_F90_NAME(fhypre_structmatrixaddtoconstant, FHYPRE_STRUCTMATRIXADDTOCONSTANT) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Real *); #define HYPRE_StructMatrixAssemble \ hypre_F90_NAME(fhypre_structmatrixassemble, FHYPRE_STRUCTMATRIXASSEMBLE) extern void hypre_F90_NAME(fhypre_structmatrixassemble, FHYPRE_STRUCTMATRIXASSEMBLE) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_StructMatrixSetNumGhost \ hypre_F90_NAME(fhypre_structmatrixsetnumghost, FHYPRE_STRUCTMATRIXSETNUMGHOST) extern void hypre_F90_NAME(fhypre_structmatrixsetnumghost, FHYPRE_STRUCTMATRIXSETNUMGHOST) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructMatrixGetGrid \ hypre_F90_NAME(fhypre_structmatrixgetgrid, FHYPRE_STRUCTMATRIXGETGRID) extern void hypre_F90_NAME(fhypre_structmatrixgetgrid, FHYPRE_STRUCTMATRIXGETGRID) - (hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_StructMatrixSetSymmetric \ hypre_F90_NAME(fhypre_structmatrixsetsymmetric, FHYPRE_STRUCTMATRIXSETSYMMETRIC) extern void hypre_F90_NAME(fhypre_structmatrixsetsymmetric, FHYPRE_STRUCTMATRIXSETSYMMETRIC) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructMatrixPrint \ hypre_F90_NAME(fhypre_structmatrixprint, FHYPRE_STRUCTMATRIXPRINT) extern void hypre_F90_NAME(fhypre_structmatrixprint, FHYPRE_STRUCTMATRIXPRINT) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructMatrixMatvec \ hypre_F90_NAME(fhypre_structmatrixmatvec, FHYPRE_STRUCTMATRIXMATVEC) extern void hypre_F90_NAME(fhypre_structmatrixmatvec, FHYPRE_STRUCTMATRIXMATVEC) - (HYPRE_Int *, hypre_F90_Obj *, hypre_F90_Obj *, HYPRE_Int *, hypre_F90_Obj *); - +(HYPRE_Int *, hypre_F90_Obj *, hypre_F90_Obj *, HYPRE_Int *, hypre_F90_Obj *); + #define HYPRE_StructVectorCreate \ hypre_F90_NAME(fhypre_structvectorcreate, FHYPRE_STRUCTVECTORCREATE) extern void hypre_F90_NAME(fhypre_structvectorcreate, FHYPRE_STRUCTVECTORCREATE) - (HYPRE_Int *, hypre_F90_Obj *, hypre_F90_Obj *); +(HYPRE_Int *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_StructVectorDestroy \ hypre_F90_NAME(fhypre_structvectordestroy, FHYPRE_STRUCTVECTORDESTROY) -extern void hypre_F90_NAME(fhypre_structvectordestroy, FHYPRE_STRUCTVECTORDESTROY) - (hypre_F90_Obj *); +extern void hypre_F90_NAME(fhypre_structvectordestroy, FHYPRE_STRUCTVECTORDESTROY) +(hypre_F90_Obj *); #define HYPRE_StructVectorInitialize \ hypre_F90_NAME(fhypre_structvectorinitialize, FHYPRE_STRUCTVECTORINITIALIZE) extern void hypre_F90_NAME(fhypre_structvectorinitialize, FHYPRE_STRUCTVECTORINITIALIZE) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_StructVectorSetValues \ hypre_F90_NAME(fhypre_structvectorsetvalues, FHYPRE_STRUCTVECTORSETVALUES) extern void hypre_F90_NAME(fhypre_structvectorsetvalues, FHYPRE_STRUCTVECTORSETVALUES) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *); #define HYPRE_StructVectorSetBoxValues \ hypre_F90_NAME(fhypre_structvectorsetboxvalues, FHYPRE_STRUCTVECTORSETBOXVALUES) extern void hypre_F90_NAME(fhypre_structvectorsetboxvalues, FHYPRE_STRUCTVECTORSETBOXVALUES) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Real *); #define HYPRE_StructVectorSetConstantValues \ hypre_F90_NAME(fhypre_structvectorsetconstantv, FHYPRE_STRUCTVECTORSETCONTANTV) extern void hypre_F90_NAME(fhypre_structvectorsetconstantv, FHYPRE_STRUCTVECTORSETCONTANTV) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_StructVectorAddToValues \ hypre_F90_NAME(fhypre_structvectoraddtovalues, FHYPRE_STRUCTVECTORADDTOVALUES) extern void hypre_F90_NAME(fhypre_structvectoraddtovalues, FHYPRE_STRUCTVECTORADDTOVALUES) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Real *); #define HYPRE_StructVectorAddToBoxValues \ hypre_F90_NAME(fhypre_structvectoraddtoboxvalu, FHYPRE_STRUCTVECTORADDTOBOXVALU) extern void hypre_F90_NAME(fhypre_structvectoraddtoboxvalu, FHYPRE_STRUCTVECTORADDTOBOXVALU) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Int *, HYPRE_Real *); #define HYPRE_StructVectorScaleValues \ hypre_F90_NAME(fhypre_structvectorscalevalues, FHYPRE_STRUCTVECTORSCALEVALUES) extern void hypre_F90_NAME(fhypre_structvectorscalevalues, FHYPRE_STRUCTVECTORSCALEVALUES) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_StructVectorGetValues \ hypre_F90_NAME(fhypre_structvectorgetvalues, FHYPRE_STRUCTVECTORGETVALUES) extern void hypre_F90_NAME(fhypre_structvectorgetvalues, FHYPRE_STRUCTVECTORGETVALUES) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Real *); #define HYPRE_StructVectorGetBoxValues \ hypre_F90_NAME(fhypre_structvectorgetboxvalues, FHYPRE_STRUCTVECTORGETBOXVALUES) extern void hypre_F90_NAME(fhypre_structvectorgetboxvalues, FHYPRE_STRUCTVECTORGETBOXVALUES) - (hypre_F90_Obj *, HYPRE_Int *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Int *, HYPRE_Real *); #define HYPRE_StructVectorAssemble \ hypre_F90_NAME(fhypre_structvectorassemble, FHYPRE_STRUCTVECTORASSEMBLE) extern void hypre_F90_NAME(fhypre_structvectorassemble, FHYPRE_STRUCTVECTORASSEMBLE) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_StructVectorSetNumGhost \ hypre_F90_NAME(fhypre_structvectorsetnumghost, FHYPRE_STRUCTVECTORSETNUMGHOST) extern void hypre_F90_NAME(fhypre_structvectorsetnumghost, FHYPRE_STRUCTVECTORSETNUMGHOST) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructVectorCopy \ hypre_F90_NAME(fhypre_structvectorcopy, FHYPRE_STRUCTVECTORCOPY) extern void hypre_F90_NAME(fhypre_structvectorcopy, FHYPRE_STRUCTVECTORCOPY) - (hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_StructVectorGetMigrateCommPkg \ hypre_F90_NAME(fhypre_structvectorgetmigrateco, FHYPRE_STRUCTVECTORGETMIGRATECO) extern void hypre_F90_NAME(fhypre_structvectorgetmigrateco, FHYPRE_STRUCTVECTORGETMIGRATECO) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_StructVectorMigrate \ hypre_F90_NAME(fhypre_structvectormigrate, FHYPRE_STRUCTVECTORMIGRATE) extern void hypre_F90_NAME(fhypre_structvectormigrate, FHYPRE_STRUCTVECTORMIGRATE) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_CommPkgDestroy \ hypre_F90_NAME(fhypre_commpkgdestroy, FHYPRE_COMMPKGDESTROY) extern void hypre_F90_NAME(fhypre_commpkgdestroy, FHYPRE_COMMPKGDESTROY) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_StructVectorPrint \ hypre_F90_NAME(fhypre_structvectorprint, FHYPRE_STRUCTVECTORPRINT) extern void hypre_F90_NAME(fhypre_structvectorprint, FHYPRE_STRUCTVECTORPRINT) - (hypre_F90_Obj *, HYPRE_Int *); - +(hypre_F90_Obj *, HYPRE_Int *); + #define HYPRE_StructBiCGSTABCreate \ hypre_F90_NAME(fhypre_structbicgstabcreate, FHYPRE_STRUCTBICGSTABCREATE) extern void hypre_F90_NAME(fhypre_structbicgstabcreate, FHYPRE_STRUCTBICGSTABCREATE) - (HYPRE_Int *, hypre_F90_Obj *); +(HYPRE_Int *, hypre_F90_Obj *); #define HYPRE_StructBiCGSTABDestroy \ hypre_F90_NAME(fhypre_structbicgstabdestroy, FHYPRE_STRUCTBICGSTABDESTROY) extern void hypre_F90_NAME(fhypre_structbicgstabdestroy, FHYPRE_STRUCTBICGSTABDESTROY) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_StructBiCGSTABSetup \ hypre_F90_NAME(fhypre_structbicgstabsetup, FHYPRE_STRUCTBICGSTABSETUP) extern void hypre_F90_NAME(fhypre_structbicgstabsetup, FHYPRE_STRUCTBICGSTABSETUP) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_StructBiCGSTABSolve \ hypre_F90_NAME(fhypre_structbicgstabsolve, FHYPRE_STRUCTBICGSTABSOLVE) extern void hypre_F90_NAME(fhypre_structbicgstabsolve, FHYPRE_STRUCTBICGSTABSOLVE) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_StructBiCGSTABSetTol \ hypre_F90_NAME(fhypre_structbicgstabsettol, FHYPRE_STRUCTBICGSTABSETTOL) extern void hypre_F90_NAME(fhypre_structbicgstabsettol, FHYPRE_STRUCTBICGSTABSETTOL) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_StructBiCGSTABSetMaxIter \ hypre_F90_NAME(fhypre_structbicgstabsetmaxiter, FHYPRE_STRUCTBICGSTABSETMAXITER) extern void hypre_F90_NAME(fhypre_structbicgstabsetmaxiter, FHYPRE_STRUCTBICGSTABSETMAXITER) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructBiCGSTABSetPrecond \ hypre_F90_NAME(fhypre_structbicgstabsetprecond, FHYPRE_STRUCTBICGSTABSETPRECOND) extern void hypre_F90_NAME(fhypre_structbicgstabsetprecond, FHYPRE_STRUCTBICGSTABSETPRECOND) - (hypre_F90_Obj *, HYPRE_Int *, hypre_F90_Obj *); +(hypre_F90_Obj *, HYPRE_Int *, hypre_F90_Obj *); #define HYPRE_StructBiCGSTABSetLogging \ hypre_F90_NAME(fhypre_structbicgstabsetlogging, FHYPRE_STRUCTBICGSTABSETLOGGING) extern void hypre_F90_NAME(fhypre_structbicgstabsetlogging, FHYPRE_STRUCTBICGSTABSETLOGGING) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructBiCGSTABSetPrintLevel \ hypre_F90_NAME(fhypre_structbicgstabsetprintle, FHYPRE_STRUCTBICGSTABPRINTLE) extern void hypre_F90_NAME(fhypre_structbicgstabsetprintle, FHYPRE_STRUCTBICGSTABPRINTLE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructBiCGSTABGetNumIterations \ hypre_F90_NAME(fhypre_structbicgstabgetnumiter, FHYPRE_STRUCTBICGSTABGETNUMITER) extern void hypre_F90_NAME(fhypre_structbicgstabgetnumiter, FHYPRE_STRUCTBICGSTABGETNUMITER) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructBiCGSTABGetResidual \ hypre_F90_NAME(fhypre_structbicgstabgetresidua, FHYPRE_STRUCTBICGSTABGETRESIDUA) extern void hypre_F90_NAME(fhypre_structbicgstabgetresidua, FHYPRE_STRUCTBICGSTABGETRESIDUA) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_StructBiCGSTABGetFinalRelativeResidualNorm \ hypre_F90_NAME(fhypre_structbicgstabgetfinalre, FHYPRE_STRUCTBICGSTABGETFINALRE) extern void hypre_F90_NAME(fhypre_structbicgstabgetfinalre, FHYPRE_STRUCTBICGSTABGETFINALRE) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_StructGMRESCreate \ hypre_F90_NAME(fhypre_structgmrescreate, FHYPRE_STRUCTGMRESCREATE) extern void hypre_F90_NAME(fhypre_structgmrescreate, FHYPRE_STRUCTGMRESCREATE) - (HYPRE_Int *, hypre_F90_Obj *); +(HYPRE_Int *, hypre_F90_Obj *); #define HYPRE_StructGMRESDestroy \ hypre_F90_NAME(fhypre_structgmresdestroy, FHYPRE_STRUCTGMRESDESTROY) extern void hypre_F90_NAME(fhypre_structgmresdestroy, FHYPRE_STRUCTGMRESDESTROY) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_StructGMRESSetup \ hypre_F90_NAME(fhypre_structgmressetup, FHYPRE_STRUCTGMRESSETUP) extern void hypre_F90_NAME(fhypre_structgmressetup, FHYPRE_STRUCTGMRESSETUP) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_StructGMRESSolve \ hypre_F90_NAME(fhypre_structgmressolve, FHYPRE_STRUCTGMRESSOLVE) extern void hypre_F90_NAME(fhypre_structgmressolve, FHYPRE_STRUCTGMRESSOLVE) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_StructGMRESSetTol \ hypre_F90_NAME(fhypre_structgmressettol, FHYPRE_STRUCTGMRESSETTOL) extern void hypre_F90_NAME(fhypre_structgmressettol, FHYPRE_STRUCTGMRESSETTOL) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_StructGMRESSetMaxIter \ hypre_F90_NAME(fhypre_structgmressetmaxiter, FHYPRE_STRUCTGMRESSETMAXITER) extern void hypre_F90_NAME(fhypre_structgmressetmaxiter, FHYPRE_STRUCTGMRESSETMAXITER) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructGMRESSetPrecond \ hypre_F90_NAME(fhypre_structgmressetprecond, FHYPRE_STRUCTGMRESSETPRECOND) extern void hypre_F90_NAME(fhypre_structgmressetprecond, FHYPRE_STRUCTGMRESSETPRECOND) - (hypre_F90_Obj *, HYPRE_Int *, hypre_F90_Obj *); +(hypre_F90_Obj *, HYPRE_Int *, hypre_F90_Obj *); #define HYPRE_StructGMRESSetLogging \ hypre_F90_NAME(fhypre_structgmressetlogging, FHYPRE_STRUCTGMRESSETLOGGING) extern void hypre_F90_NAME(fhypre_structgmressetlogging, FHYPRE_STRUCTGMRESSETLOGGING) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructGMRESSetPrintLevel \ hypre_F90_NAME(fhypre_structgmressetprintlevel, FHYPRE_STRUCTGMRESPRINTLEVEL) extern void hypre_F90_NAME(fhypre_structgmressetprintlevel, FHYPRE_STRUCTGMRESPRINTLEVEL) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructGMRESGetNumIterations \ hypre_F90_NAME(fhypre_structgmresgetnumiterati, FHYPRE_STRUCTGMRESGETNUMITERATI) extern void hypre_F90_NAME(fhypre_structgmresgetnumiterati, FHYPRE_STRUCTGMRESGETNUMITERATI) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructGMRESGetFinalRelativeResidualNorm \ hypre_F90_NAME(fhypre_structgmresgetfinalrelat, FHYPRE_STRUCTGMRESGETFINALRELAT) extern void hypre_F90_NAME(fhypre_structgmresgetfinalrelat, FHYPRE_STRUCTGMRESGETFINALRELAT) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_StructHybridCreate \ hypre_F90_NAME(fhypre_structhybridcreate, FHYPRE_STRUCTHYBRIDCREATE) extern void hypre_F90_NAME(fhypre_structhybridcreate, FHYPRE_STRUCTHYBRIDCREATE) - (HYPRE_Int *, hypre_F90_Obj *); +(HYPRE_Int *, hypre_F90_Obj *); #define HYPRE_StructHybridDestroy \ hypre_F90_NAME(fhypre_structhybriddestroy, FHYPRE_STRUCTHYBRIDDESTROY) extern void hypre_F90_NAME(fhypre_structhybriddestroy, FHYPRE_STRUCTHYBRIDDESTROY) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_StructHybridSetup \ hypre_F90_NAME(fhypre_structhybridsetup, FHYPRE_STRUCTHYBRIDSETUP) extern void hypre_F90_NAME(fhypre_structhybridsetup, FHYPRE_STRUCTHYBRIDSETUP) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_StructHybridSolve \ hypre_F90_NAME(fhypre_structhybridsolve, FHYPRE_STRUCTHYBRIDSOLVE) extern void hypre_F90_NAME(fhypre_structhybridsolve, FHYPRE_STRUCTHYBRIDSOLVE) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_StructHybridSetSolverType \ hypre_F90_NAME(fhypre_structhybridsetsolvertyp, FHYPRE_STRUCTHYBRIDSETSOLVERTYP) extern void hypre_F90_NAME(fhypre_structhybridsetsolvertyp, FHYPRE_STRUCTHYBRIDSETSOLVERTYP) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructHybridSetStopCrit \ hypre_F90_NAME(fhypre_structhybridsetstopcrit, FHYPRE_STRUCTHYBRIDSETSTOPCRIT) extern void hypre_F90_NAME(fhypre_structhybridsetstopcrit, FHYPRE_STRUCTHYBRIDSETSTOPCRIT) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructHybridSetKDim \ hypre_F90_NAME(fhypre_structhybridsetkdim, FHYPRE_STRUCTHYBRIDSETKDIM) extern void hypre_F90_NAME(fhypre_structhybridsetkdim, FHYPRE_STRUCTHYBRIDSETKDIM) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructHybridSetTol \ hypre_F90_NAME(fhypre_structhybridsettol, FHYPRE_STRUCTHYBRIDSETTOL) extern void hypre_F90_NAME(fhypre_structhybridsettol, FHYPRE_STRUCTHYBRIDSETTOL) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_StructHybridSetConvergenceTol \ hypre_F90_NAME(fhypre_structhybridsetconvergen, FHYPRE_STRUCTHYBRIDSETCONVERGEN) extern void hypre_F90_NAME(fhypre_structhybridsetconvergen, FHYPRE_STRUCTHYBRIDSETCONVERGEN) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_StructHybridSetPCGAbsoluteTolFactor \ hypre_F90_NAME(fhypre_structhybridsetpcgabsolu, FHYPRE_STRUCTHYBRIDSETABSOLU) extern void hypre_F90_NAME(fhypre_structhybridsetpcgabsolu, FHYPRE_STRUCTHYBRIDSETABSOLU) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_StructHybridSetMaxIter \ hypre_F90_NAME(fhypre_structhybridsetmaxiter, FHYPRE_STRUCTHYBRIDSETMAXITER) extern void hypre_F90_NAME(fhypre_structhybridsetmaxiter, FHYPRE_STRUCTHYBRIDSETMAXITER) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructHybridSetDSCGMaxIter \ hypre_F90_NAME(fhypre_structhybridsetdscgmaxit, FHYPRE_STRUCTHYBRIDSETDSCGMAXIT) extern void hypre_F90_NAME(fhypre_structhybridsetdscgmaxit, FHYPRE_STRUCTHYBRIDSETDSCGMAXIT) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructHybridSetPCGMaxIter \ hypre_F90_NAME(fhypre_structhybridsetpcgmaxite, FHYPRE_STRUCTHYBRIDSETPCGMAXITE) extern void hypre_F90_NAME(fhypre_structhybridsetpcgmaxite, FHYPRE_STRUCTHYBRIDSETPCGMAXITE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructHybridSetTwoNorm \ hypre_F90_NAME(fhypre_structhybridsettwonorm, FHYPRE_STRUCTHYBRIDSETTWONORM) extern void hypre_F90_NAME(fhypre_structhybridsettwonorm, FHYPRE_STRUCTHYBRIDSETTWONORM) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructHybridSetRelChange \ hypre_F90_NAME(fhypre_structhybridsetrelchange, FHYPRE_STRUCTHYBRIDSETRELCHANGE) extern void hypre_F90_NAME(fhypre_structhybridsetrelchange, FHYPRE_STRUCTHYBRIDSETRELCHANGE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructHybridSetPrecond \ hypre_F90_NAME(fhypre_structhybridsetprecond, FHYPRE_STRUCTHYBRIDSETPRECOND) -extern void hypre_F90_NAME(fhypre_structhybridsetprecond, FHYPRE_STRUCTHYBRIDSETPRECOND) - (hypre_F90_Obj *, HYPRE_Int *, hypre_F90_Obj *); +extern void hypre_F90_NAME(fhypre_structhybridsetprecond, FHYPRE_STRUCTHYBRIDSETPRECOND) +(hypre_F90_Obj *, HYPRE_Int *, hypre_F90_Obj *); #define HYPRE_StructHybridSetLogging \ hypre_F90_NAME(fhypre_structhybridsetlogging, FHYPRE_STRUCTHYBRIDSETLOGGING) extern void hypre_F90_NAME(fhypre_structhybridsetlogging, FHYPRE_STRUCTHYBRIDSETLOGGING) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructHybridSetPrintLevel \ hypre_F90_NAME(fhypre_structhybridsetprintleve, FHYPRE_STRUCTHYBRIDSETPRINTLEVE) extern void hypre_F90_NAME(fhypre_structhybridsetprintleve, FHYPRE_STRUCTHYBRIDSETPRINTLEVE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructHybridGetNumIterations \ hypre_F90_NAME(fhypre_structhybridgetnumiterat, FHYPRE_STRUCTHYBRIDGETNUMITERAT) extern void hypre_F90_NAME(fhypre_structhybridgetnumiterat, FHYPRE_STRUCTHYBRIDGETNUMITERAT) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructHybridGetDSCGNumIterations \ hypre_F90_NAME(fhypre_structhybridgetdscgnumit, FHYPRE_STRUCTHYBRIDGETDSCGNUMIT) extern void hypre_F90_NAME(fhypre_structhybridgetdscgnumit, FHYPRE_STRUCTHYBRIDGETDSCGNUMIT) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructHybridGetPCGNumIterations \ hypre_F90_NAME(fhypre_structhybridgetpcgnumite, FHYPRE_STRUCTHYBRIDGETPCGNUMITE) extern void hypre_F90_NAME(fhypre_structhybridgetpcgnumite, FHYPRE_STRUCTHYBRIDGETPCGNUMITE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructHybridGetFinalRelativeResidualNorm \ hypre_F90_NAME(fhypre_structhybridgetfinalrela, FHYPRE_STRUCTHYBRIDGETFINALRELA) extern void hypre_F90_NAME(fhypre_structhybridgetfinalrela, FHYPRE_STRUCTHYBRIDGETFINALRELA) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_StructVectorSetRandomValues \ hypre_F90_NAME(fhypre_structvectorsetrandomvalu, FHYPRE_STRUCTVECTORSETRANDOMVALU) extern void hypre_F90_NAME(fhypre_structvectorsetrandomvalu, FHYPRE_STRUCTVECTORSETRANDOMVALU) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructSetRandomValues \ hypre_F90_NAME(fhypre_structsetrandomvalues, FHYPRE_STRUCTSETRANDOMVALUES) extern void hypre_F90_NAME(fhypre_structsetrandomvalues, FHYPRE_STRUCTSETRANDOMVALUES) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructSetupInterpreter \ hypre_F90_NAME(fhypre_structsetupinterpreter, FHYPRE_STRUCTSETUPINTERPRETER) extern void hypre_F90_NAME(fhypre_structsetupinterpreter, FHYPRE_STRUCTSETUPINTERPRETER) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_StructSetupMatvec \ hypre_F90_NAME(fhypre_structsetupmatvec, FHYPRE_STRUCTSETUPMATVEC) extern void hypre_F90_NAME(fhypre_structsetupmatvec, FHYPRE_STRUCTSETUPMATVEC) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_StructJacobiCreate \ hypre_F90_NAME(fhypre_structjacobicreate, FHYPRE_STRUCTJACOBICREATE) extern void hypre_F90_NAME(fhypre_structjacobicreate, FHYPRE_STRUCTJACOBICREATE) - (HYPRE_Int *, hypre_F90_Obj *); +(HYPRE_Int *, hypre_F90_Obj *); #define HYPRE_StructJacobiDestroy \ hypre_F90_NAME(fhypre_structjacobidestroy, FHYPRE_STRUCTJACOBIDESTROY) extern void hypre_F90_NAME(fhypre_structjacobidestroy, FHYPRE_STRUCTJACOBIDESTROY) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_StructJacobiSetup \ hypre_F90_NAME(fhypre_structjacobisetup, FHYPRE_STRUCTJACOBISETUP) extern void hypre_F90_NAME(fhypre_structjacobisetup, FHYPRE_STRUCTJACOBISETUP) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_StructJacobiSolve \ hypre_F90_NAME(fhypre_structjacobisolve, FHYPRE_STRUCTJACOBISOLVE) extern void hypre_F90_NAME(fhypre_structjacobisolve, FHYPRE_STRUCTJACOBISOLVE) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_StructJacobiSetTol \ hypre_F90_NAME(fhypre_structjacobisettol, FHYPRE_STRUCTJACOBISETTOL) extern void hypre_F90_NAME(fhypre_structjacobisettol, FHYPRE_STRUCTJACOBISETTOL) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_StructJacobiGetTol \ hypre_F90_NAME(fhypre_structjacobigettol, FHYPRE_STRUCTJACOBIGETTOL) extern void hypre_F90_NAME(fhypre_structjacobigettol, FHYPRE_STRUCTJACOBIGETTOL) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_StructJacobiSetMaxIter \ hypre_F90_NAME(fhypre_structjacobisetmaxiter, FHYPRE_STRUCTJACOBISETTOL) extern void hypre_F90_NAME(fhypre_structjacobisetmaxiter, FHYPRE_STRUCTJACOBISETTOL) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructJacobiGetMaxIter \ hypre_F90_NAME(fhypre_structjacobigetmaxiter, FHYPRE_STRUCTJACOBIGETTOL) extern void hypre_F90_NAME(fhypre_structjacobigetmaxiter, FHYPRE_STRUCTJACOBIGETTOL) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructJacobiSetZeroGuess \ hypre_F90_NAME(fhypre_structjacobisetzeroguess, FHYPRE_STRUCTJACOBISETZEROGUESS) extern void hypre_F90_NAME(fhypre_structjacobisetzeroguess, FHYPRE_STRUCTJACOBISETZEROGUESS) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_StructJacobiGetZeroGuess \ hypre_F90_NAME(fhypre_structjacobigetzeroguess, FHYPRE_STRUCTJACOBIGETZEROGUESS) extern void hypre_F90_NAME(fhypre_structjacobigetzeroguess, FHYPRE_STRUCTJACOBIGETZEROGUESS) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_StructJacobiSetNonZeroGuess \ hypre_F90_NAME(fhypre_structjacobisetnonzerogu, FHYPRE_STRUCTJACOBISETNONZEROGU) extern void hypre_F90_NAME(fhypre_structjacobisetnonzerogu, FHYPRE_STRUCTJACOBISETNONZEROGU) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_StructJacobiGetNumIterations \ hypre_F90_NAME(fhypre_structjacobigetnumiterati, FHYPRE_STRUCTJACOBIGETNUMITERATI) extern void hypre_F90_NAME(fhypre_structjacobigetnumiterati, FHYPRE_STRUCTJACOBIGETNUMITERATI) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructJacobiGetFinalRelativeResidualNorm \ hypre_F90_NAME(fhypre_structjacobigetfinalrela, FHYPRE_STRUCTJACOBIGETFINALRELA) extern void hypre_F90_NAME(fhypre_structjacobigetfinalrela, FHYPRE_STRUCTJACOBIGETFINALRELA) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_StructPCGCreate \ hypre_F90_NAME(fhypre_structpcgcreate, FHYPRE_STRUCTPCGCREATE) extern void hypre_F90_NAME(fhypre_structpcgcreate, FHYPRE_STRUCTPCGCREATE) - (HYPRE_Int *, hypre_F90_Obj *); +(HYPRE_Int *, hypre_F90_Obj *); #define HYPRE_StructPCGDestroy \ hypre_F90_NAME(fhypre_structpcgdestroy, FHYPRE_STRUCTPCGDESTROY) extern void hypre_F90_NAME(fhypre_structpcgdestroy, FHYPRE_STRUCTPCGDESTROY) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_StructPCGSetup \ hypre_F90_NAME(fhypre_structpcgsetup, FHYPRE_STRUCTPCGSETUP) -extern void hypre_F90_NAME(fhypre_structpcgsetup, FHYPRE_STRUCTPCGSETUP) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +extern void hypre_F90_NAME(fhypre_structpcgsetup, FHYPRE_STRUCTPCGSETUP) +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_StructPCGSolve \ hypre_F90_NAME(fhypre_structpcgsolve, FHYPRE_STRUCTPCGSOLVE) extern void hypre_F90_NAME(fhypre_structpcgsolve, FHYPRE_STRUCTPCGSOLVE) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_StructPCGSetTol \ hypre_F90_NAME(fhypre_structpcgsettol, FHYPRE_STRUCTPCGSETTOL) extern void hypre_F90_NAME(fhypre_structpcgsettol, FHYPRE_STRUCTPCGSETTOL) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_StructPCGSetMaxIter \ hypre_F90_NAME(fhypre_structpcgsetmaxiter, FHYPRE_STRUCTPCGSETMAXITER) extern void hypre_F90_NAME(fhypre_structpcgsetmaxiter, FHYPRE_STRUCTPCGSETMAXITER) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructPCGSetTwoNorm \ hypre_F90_NAME(fhypre_structpcgsettwonorm, FHYRPE_STRUCTPCGSETTWONORM) extern void hypre_F90_NAME(fhypre_structpcgsettwonorm, FHYRPE_STRUCTPCGSETTWONORM) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructPCGSetRelChange \ hypre_F90_NAME(fhypre_structpcgsetrelchange, FHYPRE_STRUCTPCGSETRELCHANGE) extern void hypre_F90_NAME(fhypre_structpcgsetrelchange, FHYPRE_STRUCTPCGSETRELCHANGE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructPCGSetPrecond \ hypre_F90_NAME(fhypre_structpcgsetprecond, FHYPRE_STRUCTPCGSETPRECOND) extern void hypre_F90_NAME(fhypre_structpcgsetprecond, FHYPRE_STRUCTPCGSETPRECOND) - (hypre_F90_Obj *, HYPRE_Int *, hypre_F90_Obj *); +(hypre_F90_Obj *, HYPRE_Int *, hypre_F90_Obj *); #define HYPRE_StructPCGSetLogging \ hypre_F90_NAME(fhypre_structpcgsetlogging, FHYPRES_TRUCTPCFSETLOGGING) extern void hypre_F90_NAME(fhypre_structpcgsetlogging, FHYPRES_TRUCTPCFSETLOGGING) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructPCGSetPrintLevel \ hypre_F90_NAME(fhypre_structpcgsetprintlevel, FHYPRE_STRUCTPCGSETPRINTLEVEL) extern void hypre_F90_NAME(fhypre_structpcgsetprintlevel, FHYPRE_STRUCTPCGSETPRINTLEVEL) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructPCGGetNumIterations \ hypre_F90_NAME(fhypre_structpcggetnumiteration, FHYPRE_STRUCTPCGGETNUMITERATION) extern void hypre_F90_NAME(fhypre_structpcggetnumiteration, FHYPRE_STRUCTPCGGETNUMITERATION) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructPCGGetFinalRelativeResidualNorm \ hypre_F90_NAME(fhypre_structpcggetfinalrelativ, FHYPRE_STRUCTPCGGETFINALRELATIV) extern void hypre_F90_NAME(fhypre_structpcggetfinalrelativ, FHYPRE_STRUCTPCGGETFINALRELATIV) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_StructDiagScaleSetup \ hypre_F90_NAME(fhypre_structdiagscalesetup, FHYPRE_STRUCTDIAGSCALESETUP) extern void hypre_F90_NAME(fhypre_structdiagscalesetup, FHYPRE_STRUCTDIAGSCALESETUP) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_StructDiagScaleSolve \ hypre_F90_NAME(fhypre_structdiagscalesolve, FHYPRE_STRUCTDIAGSCALESOLVE) extern void hypre_F90_NAME(fhypre_structdiagscalesolve, FHYPRE_STRUCTDIAGSCALESOLVE) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_StructPFMGCreate \ hypre_F90_NAME(fhypre_structpfmgcreate, FHYPRE_STRUCTPFMGCREATE) extern void hypre_F90_NAME(fhypre_structpfmgcreate, FHYPRE_STRUCTPFMGCREATE) - (HYPRE_Int *, hypre_F90_Obj *); +(HYPRE_Int *, hypre_F90_Obj *); #define HYPRE_StructPFMGDestroy \ hypre_F90_NAME(fhypre_structpfmgdestroy, FHYPRE_STRUCTPFMGDESTROY) extern void hypre_F90_NAME(fhypre_structpfmgdestroy, FHYPRE_STRUCTPFMGDESTROY) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_StructPFMGSetup \ hypre_F90_NAME(fhypre_structpfmgsetup, FHYPRE_STRUCTPFMGSETUP) extern void hypre_F90_NAME(fhypre_structpfmgsetup, FHYPRE_STRUCTPFMGSETUP) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_StructPFMGSolve \ hypre_F90_NAME(fhypre_structpfmgsolve, FHYPRE_STRUCTPFMGSOLVE) extern void hypre_F90_NAME(fhypre_structpfmgsolve, FHYPRE_STRUCTPFMGSOLVE) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_StructPFMGSetTol \ hypre_F90_NAME(fhypre_structpfmgsettol, FHYPRE_STRUCTPFMGSETTOL) extern void hypre_F90_NAME(fhypre_structpfmgsettol, FHYPRE_STRUCTPFMGSETTOL) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_StructPFMGGetTol \ hypre_F90_NAME(fhypre_structpfmggettol, FHYPRE_STRUCTPFMGGETTOL) extern void hypre_F90_NAME(fhypre_structpfmggettol, FHYPRE_STRUCTPFMGGETTOL) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_StructPFMGSetMaxIter \ hypre_F90_NAME(fhypre_structpfmgsetmaxiter, FHYPRE_STRUCTPFMGSETMAXITER) extern void hypre_F90_NAME(fhypre_structpfmgsetmaxiter, FHYPRE_STRUCTPFMGSETMAXITER) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructPFMGGetMaxIter \ hypre_F90_NAME(fhypre_structpfmggetmaxiter, FHYPRE_STRUCTPFMGGETMAXITER) extern void hypre_F90_NAME(fhypre_structpfmggetmaxiter, FHYPRE_STRUCTPFMGGETMAXITER) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructPFMGSetMaxLevels \ hypre_F90_NAME(fhypre_structpfmgsetmaxlevels, FHYPRE_STRUCTPFMGSETMAXLEVELS) extern void hypre_F90_NAME(fhypre_structpfmgsetmaxlevels, FHYPRE_STRUCTPFMGSETMAXLEVELS) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructPFMGGetMaxLevels \ hypre_F90_NAME(fhypre_structpfmggetmaxlevels, FHYPRE_STRUCTPFMGGETMAXLEVELS) extern void hypre_F90_NAME(fhypre_structpfmggetmaxlevels, FHYPRE_STRUCTPFMGGETMAXLEVELS) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructPFMGSetRelChange \ hypre_F90_NAME(fhypre_structpfmgsetrelchange, FHYPRE_STRUCTPFMGSETRELCHANGE) extern void hypre_F90_NAME(fhypre_structpfmgsetrelchange, FHYPRE_STRUCTPFMGSETRELCHANGE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructPFMGGetRelChange \ hypre_F90_NAME(fhypre_structpfmggetrelchange, FHYPRE_STRUCTPFMGGETRELCHANGE) extern void hypre_F90_NAME(fhypre_structpfmggetrelchange, FHYPRE_STRUCTPFMGGETRELCHANGE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructPFMGSetZeroGuess \ hypre_F90_NAME(fhypre_structpfmgsetzeroguess, FHYPRE_STRUCTPFMGSETZEROGUESS) extern void hypre_F90_NAME(fhypre_structpfmgsetzeroguess, FHYPRE_STRUCTPFMGSETZEROGUESS) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_StructPFMGGetZeroGuess \ hypre_F90_NAME(fhypre_structpfmggetzeroguess, FHYPRE_STRUCTPFMGGETZEROGUESS) extern void hypre_F90_NAME(fhypre_structpfmggetzeroguess, FHYPRE_STRUCTPFMGGETZEROGUESS) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_StructPFMGSetNonZeroGuess \ hypre_F90_NAME(fhypre_structpfmgsetnonzerogues, FHYPRES_TRUCTPFMGSETNONZEROGUES) extern void hypre_F90_NAME(fhypre_structpfmgsetnonzerogues, FHYPRES_TRUCTPFMGSETNONZEROGUES) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_StructPFMGSetSkipRelax \ hypre_F90_NAME(fhypre_structpfmgsetskiprelax, FHYPRE_STRUCTPFMGSETSKIPRELAX) extern void hypre_F90_NAME(fhypre_structpfmgsetskiprelax, FHYPRE_STRUCTPFMGSETSKIPRELAX) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructPFMGGetSkipRelax \ hypre_F90_NAME(fhypre_structpfmggetskiprelax, FHYPRE_STRUCTPFMGGETSKIPRELAX) extern void hypre_F90_NAME(fhypre_structpfmggetskiprelax, FHYPRE_STRUCTPFMGGETSKIPRELAX) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructPFMGSetRelaxType \ hypre_F90_NAME(fhypre_structpfmgsetrelaxtype, FHYPRE_STRUCTPFMGSETRELAXTYPE) extern void hypre_F90_NAME(fhypre_structpfmgsetrelaxtype, FHYPRE_STRUCTPFMGSETRELAXTYPE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructPFMGGetRelaxType \ hypre_F90_NAME(fhypre_structpfmggetrelaxtype, FHYPRE_STRUCTPFMGGETRELAXTYPE) extern void hypre_F90_NAME(fhypre_structpfmggetrelaxtype, FHYPRE_STRUCTPFMGGETRELAXTYPE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructPFMGSetRAPType \ hypre_F90_NAME(fhypre_structpfmgsetraptype, FHYPRE_STRUCTPFMGSETRAPTYPE) extern void hypre_F90_NAME(fhypre_structpfmgsetraptype, FHYPRE_STRUCTPFMGSETRAPTYPE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructPFMGGetRAPType \ hypre_F90_NAME(fhypre_structpfmggetraptype, FHYPRE_STRUCTPFMGGETRAPTYPE) extern void hypre_F90_NAME(fhypre_structpfmggetraptype, FHYPRE_STRUCTPFMGGETRAPTYPE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructPFMGSetNumPreRelax \ hypre_F90_NAME(fhypre_structpfmgsetnumprerelax, FHYPRE_STRUCTPFMGSETNUMPRERELAX) extern void hypre_F90_NAME(fhypre_structpfmgsetnumprerelax, FHYPRE_STRUCTPFMGSETNUMPRERELAX) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructPFMGGetNumPreRelax \ hypre_F90_NAME(fhypre_structpfmggetnumprerelax, FHYPRE_STRUCTPFMGGETNUMPRERELAX) extern void hypre_F90_NAME(fhypre_structpfmggetnumprerelax, FHYPRE_STRUCTPFMGGETNUMPRERELAX) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructPFMGSetNumPostRelax \ hypre_F90_NAME(fhypre_structpfmgsetnumpostrela, FHYPRE_STRUCTPFMGSETNUMPOSTRELA) extern void hypre_F90_NAME(fhypre_structpfmgsetnumpostrela, FHYPRE_STRUCTPFMGSETNUMPOSTRELA) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructPFMGGetNumPostRelax \ hypre_F90_NAME(fhypre_structpfmggetnumpostrela, FHYPRE_STRUCTPFMGGETNUMPOSTRELA) extern void hypre_F90_NAME(fhypre_structpfmggetnumpostrela, FHYPRE_STRUCTPFMGGETNUMPOSTRELA) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructPFMGSetDxyz \ hypre_F90_NAME(fhypre_structpfmgsetdxyz, FHYPRE_STRUCTPFMGSETDXYZ) extern void hypre_F90_NAME(fhypre_structpfmgsetdxyz, FHYPRE_STRUCTPFMGSETDXYZ) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_StructPFMGSetLogging \ hypre_F90_NAME(fhypre_structpfmgsetlogging, FHYPRE_STRUCTPFMGSETLOGGING) extern void hypre_F90_NAME(fhypre_structpfmgsetlogging, FHYPRE_STRUCTPFMGSETLOGGING) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructPFMGGetLogging \ hypre_F90_NAME(fhypre_structpfmggetlogging, FHYPRE_STRUCTPFMGGETLOGGING) extern void hypre_F90_NAME(fhypre_structpfmggetlogging, FHYPRE_STRUCTPFMGGETLOGGING) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructPFMGSetPrintLevel \ hypre_F90_NAME(fhypre_structpfmgsetprintlevel, FHYPRE_STRUCTPFMGSETPRINTLEVEL) extern void hypre_F90_NAME(fhypre_structpfmgsetprintlevel, FHYPRE_STRUCTPFMGSETPRINTLEVEL) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructPFMGGetPrintLevel \ hypre_F90_NAME(fhypre_structpfmggetprintlevel, FHYPRE_STRUCTPFMGGETPRINTLEVEL) extern void hypre_F90_NAME(fhypre_structpfmggetprintlevel, FHYPRE_STRUCTPFMGGETPRINTLEVEL) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructPFMGGetNumIterations \ hypre_F90_NAME(fhypre_structpfmggetnumiteratio, FHYPRE_STRUCTPFMGGETNUMITERATIO) extern void hypre_F90_NAME(fhypre_structpfmggetnumiteratio, FHYPRE_STRUCTPFMGGETNUMITERATIO) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructPFMGGetFinalRelativeResidualNorm \ hypre_F90_NAME(fhypre_structpfmggetfinalrelati, FHYPRE_STRUCTPFMGGETFINALRELATI) extern void hypre_F90_NAME(fhypre_structpfmggetfinalrelati, FHYPRE_STRUCTPFMGGETFINALRELATI) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_StructSMGCreate \ hypre_F90_NAME(fhypre_structsmgcreate, FHYPRE_STRUCTSMGCREATE) extern void hypre_F90_NAME(fhypre_structsmgcreate, FHYPRE_STRUCTSMGCREATE) - (HYPRE_Int *, hypre_F90_Obj *); +(HYPRE_Int *, hypre_F90_Obj *); #define HYPRE_StructSMGDestroy \ hypre_F90_NAME(fhypre_structsmgdestroy, FHYPRE_STRUCTSMGDESTROY) extern void hypre_F90_NAME(fhypre_structsmgdestroy, FHYPRE_STRUCTSMGDESTROY) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_StructSMGSetup \ hypre_F90_NAME(fhypre_structsmgsetup, FHYPRE_STRUCTSMGSETUP) extern void hypre_F90_NAME(fhypre_structsmgsetup, FHYPRE_STRUCTSMGSETUP) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_StructSMGSolve \ hypre_F90_NAME(fhypre_structsmgsolve, FHYPRE_STRUCTSMGSOLVE) extern void hypre_F90_NAME(fhypre_structsmgsolve, FHYPRE_STRUCTSMGSOLVE) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_StructSMGSetMemoryUse \ hypre_F90_NAME(fhypre_structsmgsetmemoryuse, FHYPRE_STRUCTSMGSETMEMORYUSE) extern void hypre_F90_NAME(fhypre_structsmgsetmemoryuse, FHYPRE_STRUCTSMGSETMEMORYUSE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructSMGGetMemoryUse \ hypre_F90_NAME(fhypre_structsmggetmemoryuse, FHYPRE_STRUCTSMGGETMEMORYUSE) extern void hypre_F90_NAME(fhypre_structsmggetmemoryuse, FHYPRE_STRUCTSMGGETMEMORYUSE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructSMGSetTol \ hypre_F90_NAME(fhypre_structsmgsettol, FHYPRE_STRUCTSMGSETTOL) extern void hypre_F90_NAME(fhypre_structsmgsettol, FHYPRE_STRUCTSMGSETTOL) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_StructSMGGetTol \ hypre_F90_NAME(fhypre_structsmggettol, FHYPRE_STRUCTSMGGETTOL) extern void hypre_F90_NAME(fhypre_structsmggettol, FHYPRE_STRUCTSMGGETTOL) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_StructSMGSetMaxIter \ hypre_F90_NAME(fhypre_structsmgsetmaxiter, FHYPRE_STRUCTSMGSETMAXTITER) extern void hypre_F90_NAME(fhypre_structsmgsetmaxiter, FHYPRE_STRUCTSMGSETMAXTITER) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructSMGGetMaxIter \ hypre_F90_NAME(fhypre_structsmggetmaxiter, FHYPRE_STRUCTSMGGETMAXTITER) extern void hypre_F90_NAME(fhypre_structsmggetmaxiter, FHYPRE_STRUCTSMGGETMAXTITER) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructSMGSetRelChange \ hypre_F90_NAME(fhypre_structsmgsetrelchange, FHYPRE_STRUCTSMGSETRELCHANGE) extern void hypre_F90_NAME(fhypre_structsmgsetrelchange, FHYPRE_STRUCTSMGSETRELCHANGE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructSMGGetRelChange \ hypre_F90_NAME(fhypre_structsmggetrelchange, FHYPRE_STRUCTSMGGETRELCHANGE) extern void hypre_F90_NAME(fhypre_structsmggetrelchange, FHYPRE_STRUCTSMGGETRELCHANGE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructSMGSetZeroGuess \ hypre_F90_NAME(fhypre_structsmgsetzeroguess, FHYPRE_STRUCTSMGSETZEROGUESS) extern void hypre_F90_NAME(fhypre_structsmgsetzeroguess, FHYPRE_STRUCTSMGSETZEROGUESS) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_StructSMGGetZeroGuess \ hypre_F90_NAME(fhypre_structsmggetzeroguess, FHYPRE_STRUCTSMGGETZEROGUESS) extern void hypre_F90_NAME(fhypre_structsmggetzeroguess, FHYPRE_STRUCTSMGGETZEROGUESS) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_StructSMGSetNonZeroGuess \ hypre_F90_NAME(fhypre_structsmgsetnonzerogues, FHYPRE_STRUCTSMGSETNONZEROGUES) extern void hypre_F90_NAME(fhypre_structsmgsetnonzerogues, FHYPRE_STRUCTSMGSETNONZEROGUES) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_StructSMGGetNumIterations \ hypre_F90_NAME(fhypre_structsmggetnumiteration, FHYPRE_STRUCTSMGGETNUMITERATION) extern void hypre_F90_NAME(fhypre_structsmggetnumiteration, FHYPRE_STRUCTSMGGETNUMITERATION) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructSMGGetFinalRelativeResidualNorm \ hypre_F90_NAME(fhypre_structsmggetfinalrelativ, FHYPRE_STRUCTSMGGETFINALRELATIV) extern void hypre_F90_NAME(fhypre_structsmggetfinalrelativ, FHYPRE_STRUCTSMGGETFINALRELATIV) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_StructSMGSetNumPreRelax \ hypre_F90_NAME(fhypre_structsmgsetnumprerelax, FHYPRE_STRUCTSMGSETNUMPRERELAX) extern void hypre_F90_NAME(fhypre_structsmgsetnumprerelax, FHYPRE_STRUCTSMGSETNUMPRERELAX) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructSMGGetNumPreRelax \ hypre_F90_NAME(fhypre_structsmggetnumprerelax, FHYPRE_STRUCTSMGGETNUMPRERELAX) extern void hypre_F90_NAME(fhypre_structsmggetnumprerelax, FHYPRE_STRUCTSMGGETNUMPRERELAX) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructSMGSetNumPostRelax \ hypre_F90_NAME(fhypre_structsmgsetnumpostrelax, FHYPRE_STRUCTSMGSETNUMPOSTRELAX) extern void hypre_F90_NAME(fhypre_structsmgsetnumpostrelax, FHYPRE_STRUCTSMGSETNUMPOSTRELAX) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructSMGGetNumPostRelax \ hypre_F90_NAME(fhypre_structsmggetnumpostrelax, FHYPRE_STRUCTSMGGETNUMPOSTRELAX) extern void hypre_F90_NAME(fhypre_structsmggetnumpostrelax, FHYPRE_STRUCTSMGGETNUMPOSTRELAX) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructSMGSetLogging \ hypre_F90_NAME(fhypre_structsmgsetlogging, FHYPRE_STRUCTSMGSETLOGGING) extern void hypre_F90_NAME(fhypre_structsmgsetlogging, FHYPRE_STRUCTSMGSETLOGGING) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructSMGGetLogging \ hypre_F90_NAME(fhypre_structsmggetlogging, FHYPRE_STRUCTSMGGETLOGGING) extern void hypre_F90_NAME(fhypre_structsmggetlogging, FHYPRE_STRUCTSMGGETLOGGING) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructSMGSetPrintLevel \ hypre_F90_NAME(fhypre_structsmgsetprintlevel, FHYPRE_STRUCTSMGSETPRINTLEVEL) extern void hypre_F90_NAME(fhypre_structsmgsetprintlevel, FHYPRE_STRUCTSMGSETPRINTLEVEL) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructSMGGetPrintLevel \ hypre_F90_NAME(fhypre_structsmggetprintlevel, FHYPRE_STRUCTSMGGETPRINTLEVEL) extern void hypre_F90_NAME(fhypre_structsmggetprintlevel, FHYPRE_STRUCTSMGGETPRINTLEVEL) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructSparseMSGCreate \ hypre_F90_NAME(fhypre_structsparsemsgcreate, FHYPRE_STRUCTSPARSEMSGCREATE) extern void hypre_F90_NAME(fhypre_structsparsemsgcreate, FHYPRE_STRUCTSPARSEMSGCREATE) - (HYPRE_Int *, hypre_F90_Obj *); +(HYPRE_Int *, hypre_F90_Obj *); #define HYPRE_StructSparseMSGDestroy \ hypre_F90_NAME(fhypre_structsparsemsgdestroy, FHYPRE_STRUCTSPARSEMSGDESTROY) extern void hypre_F90_NAME(fhypre_structsparsemsgdestroy, FHYPRE_STRUCTSPARSEMSGDESTROY) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_StructSparseMSGSetup \ hypre_F90_NAME(fhypre_structsparsemsgsetup, FHYRPE_STRUCTSPARSEMSGSETUP) extern void hypre_F90_NAME(fhypre_structsparsemsgsetup, FHYRPE_STRUCTSPARSEMSGSETUP) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_StructSparseMSGSolve \ hypre_F90_NAME(fhypre_structsparsemsgsolve, FHYPRE_STRUCTSPARSEMSGSOLVE) extern void hypre_F90_NAME(fhypre_structsparsemsgsolve, FHYPRE_STRUCTSPARSEMSGSOLVE) - (hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); +(hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *, hypre_F90_Obj *); #define HYPRE_StructSparseMSGSetJump \ hypre_F90_NAME(fhypre_structsparsemsgsetjump, FHYPRE_STRUCTSPARSEMSGSETJUMP) extern void hypre_F90_NAME(fhypre_structsparsemsgsetjump, FHYPRE_STRUCTSPARSEMSGSETJUMP) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructSparseMSGSetTol \ hypre_F90_NAME(fhypre_structsparsemsgsettol, FHYPRE_STRUCTSPARSEMSGSETTOL) extern void hypre_F90_NAME(fhypre_structsparsemsgsettol, FHYPRE_STRUCTSPARSEMSGSETTOL) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_StructSparseMSGSetMaxIter \ hypre_F90_NAME(fhypre_structsparsemsgsetmaxite, FHYPRE_STRUCTSPARSEMSGSETMAXITE) extern void hypre_F90_NAME(fhypre_structsparsemsgsetmaxite, FHYPRE_STRUCTSPARSEMSGSETMAXITE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructSparseMSGSetRelChange \ hypre_F90_NAME(fhypre_structsparsemsgsetrelcha, FHYPRE_STRUCTSPARSEMSGSETRELCHA) extern void hypre_F90_NAME(fhypre_structsparsemsgsetrelcha, FHYPRE_STRUCTSPARSEMSGSETRELCHA) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructSparseMSGSetZeroGuess \ hypre_F90_NAME(fhypre_structsparsemsgsetzerogu, FHYPRE_STRUCTSPARSEMSGSETZEROGU) extern void hypre_F90_NAME(fhypre_structsparsemsgsetzerogu, FHYPRE_STRUCTSPARSEMSGSETZEROGU) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_StructSparseMSGSetNonZeroGuess \ hypre_F90_NAME(fhypre_structsparsemsgsetnonzer, FHYPRE_STRUCTSPARSEMSGSETNONZER) extern void hypre_F90_NAME(fhypre_structsparsemsgsetnonzer, FHYPRE_STRUCTSPARSEMSGSETNONZER) - (hypre_F90_Obj *); +(hypre_F90_Obj *); #define HYPRE_StructSparseMSGGetNumIterations \ hypre_F90_NAME(fhypre_structsparsemsggetnumite, FHYPRE_STRUCTSPARSEMSGGETNUMITE) extern void hypre_F90_NAME(fhypre_structsparsemsggetnumite, FHYPRE_STRUCTSPARSEMSGGETNUMITE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructSparseMSGGetFinalRelativeResidualNorm \ hypre_F90_NAME(fhypre_structsparsemsggetfinalr, FHYRPE_STRUCTSPARSEMSGGETFINALR) extern void hypre_F90_NAME(fhypre_structsparsemsggetfinalr, FHYRPE_STRUCTSPARSEMSGGETFINALR) - (hypre_F90_Obj *, HYPRE_Real *); +(hypre_F90_Obj *, HYPRE_Real *); #define HYPRE_StructSparseMSGSetRelaxType \ hypre_F90_NAME(fhypre_structsparsemsgsetrelaxt, FHYPRE_STRUCTSPARSEMSGSETRELAXT) extern void hypre_F90_NAME(fhypre_structsparsemsgsetrelaxt, FHYPRE_STRUCTSPARSEMSGSETRELAXT) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructSparseMSGSetNumPreRelax \ hypre_F90_NAME(fhypre_structsparsemsgsetnumpre, FHYPRE_STRUCTSPARSEMSGSETNUMPRE) extern void hypre_F90_NAME(fhypre_structsparsemsgsetnumpre, FHYPRE_STRUCTSPARSEMSGSETNUMPRE) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructSparseMSGSetNumPostRelax \ hypre_F90_NAME(fhypre_structsparsemsgsetnumpos, FHYPRE_STRUCTSPARSEMSGSETNUMPOS) extern void hypre_F90_NAME(fhypre_structsparsemsgsetnumpos, FHYPRE_STRUCTSPARSEMSGSETNUMPOS) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructSparseMSGSetNumFineRelax \ hypre_F90_NAME(fhypre_structsparsemsgsetnumfin, FHYPRE_STRUCTSPARSEMSGSETNUMFIN) extern void hypre_F90_NAME(fhypre_structsparsemsgsetnumfin, FHYPRE_STRUCTSPARSEMSGSETNUMFIN) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructSparseMSGSetLogging \ hypre_F90_NAME(fhypre_structsparsemsgsetloggin, FHYPRE_STRUCTSPARSEMSGSETLOGGIN) extern void hypre_F90_NAME(fhypre_structsparsemsgsetloggin, FHYPRE_STRUCTSPARSEMSGSETLOGGIN) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #define HYPRE_StructSparseMSGSetPrintLevel \ hypre_F90_NAME(fhypre_structsparsemsgsetprintl, FHYPRE_STRUCTSPARSEMSGSETPRINTL) extern void hypre_F90_NAME(fhypre_structsparsemsgsetprintl, FHYPRE_STRUCTSPARSEMSGSETPRINTL) - (hypre_F90_Obj *, HYPRE_Int *); +(hypre_F90_Obj *, HYPRE_Int *); #ifdef __cplusplus } diff --git a/external/hypre/src/test/hypre_test.h b/external/hypre/src/test/hypre_test.h index d4e2a473..8976d9b5 100644 --- a/external/hypre/src/test/hypre_test.h +++ b/external/hypre/src/test/hypre_test.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -21,7 +21,7 @@ #include "HYPRE_parcsr_ls.h" #include "HYPRE_struct_ls.h" #include "HYPRE_sstruct_ls.h" - + #define HYPRE_BICGSTAB 99100 #define HYPRE_BOOMERAMG 99110 #define HYPRE_CGNR 99120 @@ -46,8 +46,8 @@ /**************************************************************************** * Prototypes for testing routines ***************************************************************************/ -HYPRE_Int hypre_set_precond(HYPRE_Int matrix_id, HYPRE_Int solver_id, HYPRE_Int precond_id, - void *solver, void *precond); +HYPRE_Int hypre_set_precond(HYPRE_Int matrix_id, HYPRE_Int solver_id, HYPRE_Int precond_id, + void *solver, void *precond); HYPRE_Int hypre_set_precond_params(HYPRE_Int precond_id, void *precond); @@ -73,12 +73,12 @@ HYPRE_Int overlap = 1; HYPRE_Int domain_type = 2; HYPRE_Int nonzeros_to_keep = -1; -HYPRE_Int interp_type; +HYPRE_Int interp_type; HYPRE_Int cycle_type; HYPRE_Int relax_default; HYPRE_Int *dof_func; -HYPRE_Int *num_grid_sweeps; -HYPRE_Int *grid_relax_type; +HYPRE_Int *num_grid_sweeps; +HYPRE_Int *grid_relax_type; HYPRE_Int **grid_relax_points; HYPRE_Real tol = 1.e-8; @@ -91,7 +91,7 @@ HYPRE_Real sai_filter = 0.1; HYPRE_Real strong_threshold; HYPRE_Real trunc_factor; -HYPRE_Real *relax_weight; +HYPRE_Real *relax_weight; HYPRE_Real *omega; #endif diff --git a/external/hypre/src/test/ij.c b/external/hypre/src/test/ij.c index 923283dc..1fe0d408 100644 --- a/external/hypre/src/test/ij.c +++ b/external/hypre/src/test/ij.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -26,8 +26,12 @@ #include "_hypre_parcsr_mv.h" #include "HYPRE_krylov.h" -#if defined(HYPRE_USING_UMPIRE) -#include "umpire/interface/umpire.h" +#if defined (HYPRE_USING_CUDA) +#include +#endif +#if defined(HYPRE_USING_CUSPARSE) +#define DISABLE_CUSPARSE_DEPRECATED +#include #endif /* begin lobpcg */ @@ -49,30 +53,50 @@ BuildParIsoLaplacian( HYPRE_Int argc, char** argv, HYPRE_ParCSRMatrix *A_ptr ); extern "C" { #endif -HYPRE_Int BuildParFromFile (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int ReadParVectorFromFile (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParVector *b_ptr ); - -HYPRE_Int BuildParLaplacian (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildParSysLaplacian (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildParDifConv (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr); -HYPRE_Int BuildParFromOneFile (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_Int num_functions , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildFuncsFromFiles (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix A , HYPRE_Int **dof_func_ptr ); -HYPRE_Int BuildFuncsFromOneFile (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix A , HYPRE_Int **dof_func_ptr ); -HYPRE_Int BuildRhsParFromOneFile (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix A , HYPRE_ParVector *b_ptr ); -HYPRE_Int BuildBigArrayFromOneFile (HYPRE_Int argc , char *argv [] , const char *array_name , HYPRE_Int arg_index , HYPRE_BigInt *partitioning , HYPRE_Int *size , HYPRE_BigInt **array_ptr); -HYPRE_Int BuildParLaplacian9pt (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildParLaplacian27pt (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildParRotate7pt (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildParVarDifConv (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr , HYPRE_ParVector *rhs_ptr ); -HYPRE_ParCSRMatrix GenerateSysLaplacian (MPI_Comm comm, HYPRE_BigInt nx, HYPRE_BigInt ny, HYPRE_BigInt nz, +HYPRE_Int BuildParFromFile (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int ReadParVectorFromFile (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParVector *b_ptr ); + +HYPRE_Int BuildParLaplacian (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildParSysLaplacian (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildParDifConv (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr); +HYPRE_Int BuildParFromOneFile (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_Int num_functions, HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildFuncsFromFiles (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix A, HYPRE_Int **dof_func_ptr ); +HYPRE_Int BuildFuncsFromOneFile (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix A, HYPRE_Int **dof_func_ptr ); +HYPRE_Int BuildRhsParFromOneFile (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix A, HYPRE_ParVector *b_ptr ); +HYPRE_Int BuildBigArrayFromOneFile (HYPRE_Int argc, char *argv [], const char *array_name, + HYPRE_Int arg_index, HYPRE_BigInt *partitioning, HYPRE_Int *size, HYPRE_BigInt **array_ptr); +HYPRE_Int BuildParLaplacian9pt (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildParLaplacian27pt (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildParLaplacian125pt (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildParRotate7pt (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildParVarDifConv (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr, HYPRE_ParVector *rhs_ptr ); +HYPRE_ParCSRMatrix GenerateSysLaplacian (MPI_Comm comm, HYPRE_BigInt nx, HYPRE_BigInt ny, + HYPRE_BigInt nz, HYPRE_Int P, HYPRE_Int Q, HYPRE_Int R, HYPRE_Int p, HYPRE_Int q, HYPRE_Int r, HYPRE_Int num_fun, HYPRE_Real *mtrx, HYPRE_Real *value); -HYPRE_ParCSRMatrix GenerateSysLaplacianVCoef (MPI_Comm comm, HYPRE_BigInt nx, HYPRE_BigInt ny, HYPRE_BigInt nz, +HYPRE_ParCSRMatrix GenerateSysLaplacianVCoef (MPI_Comm comm, HYPRE_BigInt nx, HYPRE_BigInt ny, + HYPRE_BigInt nz, HYPRE_Int P, HYPRE_Int Q, HYPRE_Int R, HYPRE_Int p, HYPRE_Int q, HYPRE_Int r, HYPRE_Int num_fun, HYPRE_Real *mtrx, HYPRE_Real *value); -HYPRE_Int SetSysVcoefValues(HYPRE_Int num_fun, HYPRE_BigInt nx, HYPRE_BigInt ny, HYPRE_BigInt nz, HYPRE_Real vcx, HYPRE_Real vcy, HYPRE_Real vcz, HYPRE_Int mtx_entry, HYPRE_Real *values); +HYPRE_Int SetSysVcoefValues(HYPRE_Int num_fun, HYPRE_BigInt nx, HYPRE_BigInt ny, HYPRE_BigInt nz, + HYPRE_Real vcx, HYPRE_Real vcy, HYPRE_Real vcz, HYPRE_Int mtx_entry, HYPRE_Real *values); -HYPRE_Int BuildParCoordinates (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_Int *coorddim_ptr , float **coord_ptr ); +HYPRE_Int BuildParCoordinates (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_Int *coorddim_ptr, float **coord_ptr ); extern HYPRE_Int hypre_FlexGMRESModifyPCAMGExample(void *precond_data, HYPRE_Int iterations, HYPRE_Real rel_residual_norm); @@ -82,7 +106,6 @@ extern HYPRE_Int hypre_FlexGMRESModifyPCDefault(void *precond_data, HYPRE_Int it #ifdef __cplusplus } #endif -#define SECOND_TIME 0 hypre_int main( hypre_int argc, @@ -90,6 +113,7 @@ main( hypre_int argc, { HYPRE_Int arg_index; HYPRE_Int print_usage; + HYPRE_Int log_level = 0; HYPRE_Int sparsity_known = 0; HYPRE_Int add = 0; HYPRE_Int check_constant = 0; @@ -98,6 +122,8 @@ main( hypre_int argc, HYPRE_Int omp_flag = 0; HYPRE_Int build_matrix_type; HYPRE_Int build_matrix_arg_index; + HYPRE_Int build_matrix_M; + HYPRE_Int build_matrix_M_arg_index; HYPRE_Int build_rhs_type; HYPRE_Int build_rhs_arg_index; HYPRE_Int build_src_type; @@ -109,14 +135,17 @@ main( hypre_int argc, HYPRE_Int build_fpt_arg_index; HYPRE_Int build_sfpt_arg_index; HYPRE_Int build_cpt_arg_index; + HYPRE_Int num_components = 1; HYPRE_Int solver_id; HYPRE_Int solver_type = 1; HYPRE_Int recompute_res = 0; /* What should be the default here? */ HYPRE_Int ioutdat; HYPRE_Int poutdat; + HYPRE_Int poutusr = 0; /* if user selects pout */ + HYPRE_Int print_matrix_info = 0; HYPRE_Int debug_flag; HYPRE_Int ierr = 0; - HYPRE_Int i,j; + HYPRE_Int i, j, c; HYPRE_Int max_levels = 25; HYPRE_Int num_iterations; HYPRE_Int pcg_num_its, dscg_num_its; @@ -127,15 +156,18 @@ main( hypre_int argc, HYPRE_Int keep_same_sign = 0; HYPRE_Real cf_tol = 0.9; HYPRE_Real norm; + HYPRE_Real b_dot_b; HYPRE_Real final_res_norm; void *object; HYPRE_IJMatrix ij_A = NULL; + HYPRE_IJMatrix ij_M = NULL; HYPRE_IJVector ij_b = NULL; HYPRE_IJVector ij_x = NULL; - HYPRE_IJVector *ij_rbm; + HYPRE_IJVector *ij_rbm = NULL; HYPRE_ParCSRMatrix parcsr_A = NULL; + HYPRE_ParCSRMatrix parcsr_M = NULL; HYPRE_ParVector b = NULL; HYPRE_ParVector x = NULL; HYPRE_ParVector *interp_vecs = NULL; @@ -145,14 +177,14 @@ main( hypre_int argc, HYPRE_Solver amg_solver; HYPRE_Solver amgdd_solver; HYPRE_Solver pcg_solver; - HYPRE_Solver amg_precond=NULL; - HYPRE_Solver pcg_precond=NULL; + HYPRE_Solver amg_precond = NULL; + HYPRE_Solver pcg_precond = NULL; HYPRE_Solver pcg_precond_gotten; HYPRE_Int check_residual = 0; HYPRE_Int num_procs, myid; HYPRE_Int local_row; - HYPRE_Int *row_sizes; + HYPRE_Int *row_sizes = NULL; HYPRE_Int *diag_sizes; HYPRE_Int *offdiag_sizes; HYPRE_BigInt *rows; @@ -160,6 +192,7 @@ main( hypre_int argc, HYPRE_Int *ncols; HYPRE_BigInt *col_inds; HYPRE_Int *dof_func; + HYPRE_Int filter_functions = 0; HYPRE_Int num_functions = 1; HYPRE_Int num_paths = 1; HYPRE_Int agg_num_levels = 0; @@ -177,7 +210,6 @@ main( hypre_int argc, HYPRE_Real *values, val; HYPRE_Int use_nonsymm_schwarz = 0; - HYPRE_Int test_ij = 0; HYPRE_Int build_rbm = 0; HYPRE_Int build_rbm_index = 0; HYPRE_Int num_interp_vecs = 0; @@ -185,6 +217,15 @@ main( hypre_int argc, HYPRE_Int Q_max = 0; HYPRE_Real Q_trunc = 0; + /* Specific tests */ + HYPRE_Int test_init = 0; + HYPRE_Int lazy_device_init = 0; + HYPRE_Int device_id = -1; + HYPRE_Int test_ij = 0; + HYPRE_Int test_multivec = 0; + HYPRE_Int test_scaling = 0; + HYPRE_Int test_error = 0; + const HYPRE_Real dt_inf = DT_INF; HYPRE_Real dt = dt_inf; @@ -245,13 +286,14 @@ main( hypre_int argc, #endif HYPRE_Real relax_wt; HYPRE_Real add_relax_wt = 1.0; - HYPRE_Real relax_wt_level; + HYPRE_Real relax_wt_level = 0.0; HYPRE_Real outer_wt; - HYPRE_Real outer_wt_level; + HYPRE_Real outer_wt_level = 0; HYPRE_Real tol = 1.e-8, pc_tol = 0.; HYPRE_Real atol = 0.0; HYPRE_Real max_row_sum = 1.; HYPRE_Int converge_type = 0; + HYPRE_Int precon_cycles = 1; HYPRE_Int cheby_order = 2; HYPRE_Int cheby_eig_est = 10; @@ -260,20 +302,25 @@ main( hypre_int argc, HYPRE_Real cheby_fraction = .3; #if defined(HYPRE_USING_GPU) - keepTranspose = 1; - coarsen_type = 8; - mod_rap2 = 1; - HYPRE_Int spgemm_use_cusparse = 0; - HYPRE_Int use_curand = 1; -#if defined(HYPRE_USING_HIP) - spgemm_use_cusparse = 1; +#if defined(HYPRE_USING_CUSPARSE) && CUSPARSE_VERSION >= 11000 + /* CUSPARSE_SPMV_ALG_DEFAULT doesn't provide deterministic results */ + HYPRE_Int spmv_use_vendor = 0; +#else + HYPRE_Int spmv_use_vendor = 1; +#endif + HYPRE_Int use_curand = 1; +#if defined(HYPRE_USING_CUDA) + HYPRE_Int spgemm_use_vendor = 0; +#else + HYPRE_Int spgemm_use_vendor = 1; #endif HYPRE_Int spgemm_alg = 1; + HYPRE_Int spgemm_binned = 0; HYPRE_Int spgemm_rowest_mtd = 3; - HYPRE_Int spgemm_rowest_nsamples = 32; - HYPRE_Real spgemm_rowest_mult = 1.5; - char spgemm_hash_type = 'L'; + HYPRE_Int spgemm_rowest_nsamples = -1; /* default */ + HYPRE_Real spgemm_rowest_mult = -1.0; /* default */ #endif + HYPRE_Int nmv = 100; /* for CGC BM Aug 25, 2006 */ HYPRE_Int cgcits = 1; @@ -322,7 +369,10 @@ main( hypre_int argc, HYPRE_Real agg_P12_trunc_factor = 0; /* default value */ HYPRE_Int print_system = 0; + HYPRE_Int print_system_binary = 0; HYPRE_Int rel_change = 0; + HYPRE_Int second_time = 0; + HYPRE_Int benchmark = 0; /* begin lobpcg */ HYPRE_Int hybrid = 1; @@ -341,6 +391,8 @@ main( hypre_int argc, HYPRE_Int checkOrtho = 0; HYPRE_Int printLevel = 0; /* also c.f. poutdat */ HYPRE_Int two_norm = 1; + HYPRE_Int skip_break = 0; + HYPRE_Int flex = 0; HYPRE_Int pcgIterations = 0; HYPRE_Int pcgMode = 1; HYPRE_Real pcgTol = 1e-2; @@ -394,6 +446,14 @@ main( hypre_int argc, /* hypre_ILU options */ HYPRE_Int ilu_type = 0; HYPRE_Int ilu_lfil = 0; + HYPRE_Int ilu_reordering = 1; + HYPRE_Int ilu_tri_solve = 1; + HYPRE_Int ilu_ljac_iters = 5; + HYPRE_Int ilu_ujac_iters = 5; + HYPRE_Int ilu_iter_setup_type = 0; + HYPRE_Int ilu_iter_setup_option = 0; + HYPRE_Int ilu_iter_setup_max_iter = 100; + HYPRE_Real ilu_iter_setup_tolerance = 1.e-6; HYPRE_Int ilu_sm_max_iter = 1; HYPRE_Real ilu_droptol = 1.0e-02; HYPRE_Int ilu_max_row_nnz = 1000; @@ -401,6 +461,18 @@ main( hypre_int argc, HYPRE_Real ilu_nsh_droptol = 1.0e-02; /* end hypre ILU options */ + /* hypre_FSAI options */ + HYPRE_Int fsai_algo_type = 1; + HYPRE_Int fsai_ls_type = 1; + HYPRE_Int fsai_max_steps = 10; + HYPRE_Int fsai_max_step_size = 1; + HYPRE_Int fsai_max_nnz_row = 10; + HYPRE_Int fsai_num_levels = 2; + HYPRE_Real fsai_threshold = 1.0e-02; + HYPRE_Int fsai_eig_max_iters = 5; + HYPRE_Real fsai_kap_tolerance = 1.0e-03; + /* end hypre FSAI options */ + HYPRE_Real *nongalerk_tol = NULL; HYPRE_Int nongalerk_num_tol = 0; @@ -430,29 +502,173 @@ main( hypre_int argc, HYPRE_Int amgdd_fac_cycle_type = 1; HYPRE_Int amgdd_num_ghost_layers = 1; +#if defined(HYPRE_USING_MEMORY_TRACKER) + HYPRE_Int print_mem_tracker = 0; + char mem_tracker_name[HYPRE_MAX_FILE_NAME_LEN] = {0}; +#endif + + HYPRE_Int gpu_aware_mpi = 0; + + /* Initialize MPI */ + hypre_MPI_Init(&argc, &argv); + + hypre_MPI_Comm_size(hypre_MPI_COMM_WORLD, &num_procs ); + hypre_MPI_Comm_rank(hypre_MPI_COMM_WORLD, &myid ); + + /* Should we test library initialization? */ + for (arg_index = 1; arg_index < argc; arg_index ++) + { + if (strcmp(argv[arg_index], "-test_init") == 0) + { + test_init = 1; + } + else if (strcmp(argv[arg_index], "-lazy_device_init") == 0) + { + lazy_device_init = atoi(argv[++arg_index]); + } + else if (strcmp(argv[arg_index], "-device_id") == 0) + { + device_id = atoi(argv[++arg_index]); + } + } + + /*----------------------------------------------------------------- + * GPU Device binding + * Must be done before HYPRE_Initialize() and should not be changed after + *-----------------------------------------------------------------*/ + hypre_bind_device_id(device_id, myid, num_procs, hypre_MPI_COMM_WORLD); + + /*----------------------------------------------------------- + * Initialize : must be the first HYPRE function to call + *-----------------------------------------------------------*/ + + if (test_init) + { + /* The library should not be initialized or finalized */ + if (!HYPRE_Initialized() && !HYPRE_Finalized()) + { + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "hypre library has not been initialized or finalized yet\n"); + } + + HYPRE_Initialize(); + + /* Check if the library is in initialized state */ + if (HYPRE_Initialized() && !HYPRE_Finalized()) + { + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "hypre library has been initialized\n"); + } + + HYPRE_Finalize(); + + /* Check if the library is in finalized state */ + if (!HYPRE_Initialized() && HYPRE_Finalized()) + { + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "hypre library has been finalized\n"); + } + + HYPRE_Initialize(); + + /* Check if the library is in initialized state */ + if (HYPRE_Initialized() && !HYPRE_Finalized()) + { + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "hypre library has been re-initialized\n"); + } + + HYPRE_Finalize(); + + /* Check if the library is in finalized state */ + if (!HYPRE_Initialized() && HYPRE_Finalized()) + { + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "hypre library has been finalized\n"); + } + + hypre_MPI_Finalize(); + + return 0; + } + + time_index = hypre_InitializeTiming("Hypre init"); + hypre_BeginTiming(time_index); + + HYPRE_Initialize(); + + if (!lazy_device_init) + { + HYPRE_DeviceInitialize(); + } + + hypre_EndTiming(time_index); + hypre_PrintTiming("Hypre init times", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + /* default execution policy and memory space */ +#if defined(HYPRE_TEST_USING_HOST) + HYPRE_MemoryLocation memory_location = HYPRE_MEMORY_HOST; + HYPRE_ExecutionPolicy default_exec_policy = HYPRE_EXEC_HOST; + HYPRE_ExecutionPolicy exec2_policy = HYPRE_EXEC_HOST; +#else + HYPRE_MemoryLocation memory_location = HYPRE_MEMORY_DEVICE; HYPRE_ExecutionPolicy default_exec_policy = HYPRE_EXEC_DEVICE; - HYPRE_MemoryLocation memory_location = HYPRE_MEMORY_DEVICE; + HYPRE_ExecutionPolicy exec2_policy = HYPRE_EXEC_DEVICE; +#endif + + for (arg_index = 1; arg_index < argc; arg_index ++) + { + if ( strcmp(argv[arg_index], "-memory_host") == 0 ) + { + memory_location = HYPRE_MEMORY_HOST; + } + else if ( strcmp(argv[arg_index], "-memory_device") == 0 ) + { + memory_location = HYPRE_MEMORY_DEVICE; + } + else if ( strcmp(argv[arg_index], "-exec_host") == 0 ) + { + default_exec_policy = HYPRE_EXEC_HOST; + } + else if ( strcmp(argv[arg_index], "-exec_device") == 0 ) + { + default_exec_policy = HYPRE_EXEC_DEVICE; + } + else if ( strcmp(argv[arg_index], "-exec2_host") == 0 ) + { + exec2_policy = HYPRE_EXEC_HOST; + } + else if ( strcmp(argv[arg_index], "-exec2_device") == 0 ) + { + exec2_policy = HYPRE_EXEC_DEVICE; + } + } + + if (hypre_GetExecPolicy1(memory_location) == HYPRE_EXEC_DEVICE) + { + keepTranspose = 1; + coarsen_type = 8; + mod_rap2 = 1; + } -#ifdef HYPRE_USING_DEVICE_POOL +#if defined (HYPRE_USING_DEVICE_POOL) /* device pool allocator */ hypre_uint mempool_bin_growth = 8, mempool_min_bin = 3, mempool_max_bin = 9; size_t mempool_max_cached_bytes = 2000LL * 1024 * 1024; -#endif - - /* Initialize MPI */ - hypre_MPI_Init(&argc, &argv); - hypre_MPI_Comm_size(hypre_MPI_COMM_WORLD, &num_procs ); - hypre_MPI_Comm_rank(hypre_MPI_COMM_WORLD, &myid ); +#elif defined (HYPRE_USING_UMPIRE) + size_t umpire_dev_pool_size = 4294967296; // 4 GiB + size_t umpire_uvm_pool_size = 4294967296; // 4 GiB + size_t umpire_pinned_pool_size = 4294967296; // 4 GiB + size_t umpire_host_pool_size = 4294967296; // 4 GiB +#endif /*----------------------------------------------------------- * Set defaults *-----------------------------------------------------------*/ build_matrix_type = 2; build_matrix_arg_index = argc; + build_matrix_M = 0; + build_matrix_M_arg_index = argc; build_rhs_type = 2; build_rhs_arg_index = argc; build_src_type = -1; @@ -469,7 +685,7 @@ main( hypre_int argc, solver_id = 0; ioutdat = 3; poutdat = 1; - hypre_sprintf (plot_file_name,"AMGgrids.CF.dat"); + hypre_sprintf (plot_file_name, "AMGgrids.CF.dat"); /*----------------------------------------------------------- * Parse command line @@ -480,12 +696,29 @@ main( hypre_int argc, while ( (arg_index < argc) && (!print_usage) ) { - if ( strcmp(argv[arg_index], "-fromfile") == 0 ) + if ( strcmp(argv[arg_index], "-ll") == 0 ) + { + arg_index++; + log_level = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-frombinfile") == 0 ) + { + arg_index++; + build_matrix_type = -2; + build_matrix_arg_index = arg_index; + } + else if ( strcmp(argv[arg_index], "-fromfile") == 0 ) { arg_index++; build_matrix_type = -1; build_matrix_arg_index = arg_index; } + else if ( strcmp(argv[arg_index], "-auxfromfile") == 0 ) + { + arg_index++; + build_matrix_M = 1; + build_matrix_M_arg_index = arg_index; + } else if ( strcmp(argv[arg_index], "-fromparcsrfile") == 0 ) { arg_index++; @@ -516,29 +749,50 @@ main( hypre_int argc, build_matrix_type = 4; build_matrix_arg_index = arg_index; } - else if ( strcmp(argv[arg_index], "-difconv") == 0 ) + else if ( strcmp(argv[arg_index], "-125pt") == 0 ) { arg_index++; build_matrix_type = 5; build_matrix_arg_index = arg_index; } - else if ( strcmp(argv[arg_index], "-vardifconv") == 0 ) + else if ( strcmp(argv[arg_index], "-difconv") == 0 ) { arg_index++; build_matrix_type = 6; build_matrix_arg_index = arg_index; } - else if ( strcmp(argv[arg_index], "-rotate") == 0 ) + else if ( strcmp(argv[arg_index], "-vardifconv") == 0 ) { arg_index++; build_matrix_type = 7; build_matrix_arg_index = arg_index; } + else if ( strcmp(argv[arg_index], "-rotate") == 0 ) + { + arg_index++; + build_matrix_type = 8; + build_matrix_arg_index = arg_index; + } else if ( strcmp(argv[arg_index], "-test_ij") == 0 ) { arg_index++; test_ij = 1; } + else if ( strcmp(argv[arg_index], "-test_multivec") == 0 ) + { + arg_index++; + test_multivec = 1; + } + else if ( strcmp(argv[arg_index], "-test_scaling") == 0 ) + { + arg_index++; + test_scaling = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-test_error") == 0 ) + { + arg_index++; + test_error = atoi(argv[arg_index++]); + } else if ( strcmp(argv[arg_index], "-funcsfromonefile") == 0 ) { arg_index++; @@ -551,6 +805,11 @@ main( hypre_int argc, build_funcs_type = 2; build_funcs_arg_index = arg_index; } + else if ( strcmp(argv[arg_index], "-mat-info") == 0 ) + { + arg_index++; + print_matrix_info = 1; + } else if ( strcmp(argv[arg_index], "-exact_size") == 0 ) { arg_index++; @@ -595,7 +854,8 @@ main( hypre_int argc, { arg_index++; /* begin lobpcg */ - if ( strcmp(argv[arg_index], "none") == 0 ) { + if ( strcmp(argv[arg_index], "none") == 0 ) + { solver_id = NO_SOLVER; arg_index++; } @@ -611,12 +871,23 @@ main( hypre_int argc, num_interp_vecs = atoi(argv[arg_index++]); build_rbm_index = arg_index; } + else if ( strcmp(argv[arg_index], "-nc") == 0 ) + { + arg_index++; + num_components = atoi(argv[arg_index++]); + } else if ( strcmp(argv[arg_index], "-rhsfromfile") == 0 ) { arg_index++; build_rhs_type = 0; build_rhs_arg_index = arg_index; } + else if ( strcmp(argv[arg_index], "-rhsfrombinfile") == 0 ) + { + arg_index++; + build_rhs_type = -2; + build_rhs_arg_index = arg_index; + } else if ( strcmp(argv[arg_index], "-rhsfromonefile") == 0 ) { arg_index++; @@ -688,6 +959,12 @@ main( hypre_int argc, build_rhs_type = -1; build_src_arg_index = arg_index; } + else if ( strcmp(argv[arg_index], "-x0frombinfile") == 0 ) + { + arg_index++; + build_x0_type = -2; + build_x0_arg_index = arg_index; + } else if ( strcmp(argv[arg_index], "-x0fromfile") == 0 ) { arg_index++; @@ -831,12 +1108,12 @@ main( hypre_int argc, else if ( strcmp(argv[arg_index], "-crth") == 0 ) { arg_index++; - CR_rate = atof(argv[arg_index++]); + CR_rate = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-crst") == 0 ) { arg_index++; - CR_strong_th = atof(argv[arg_index++]); + CR_strong_th = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-rlx") == 0 ) { @@ -883,6 +1160,11 @@ main( hypre_int argc, arg_index++; num_functions = atoi(argv[arg_index++]); } + else if ( strcmp(argv[arg_index], "-ff") == 0 ) + { + arg_index++; + filter_functions = atoi(argv[arg_index++]); + } else if ( strcmp(argv[arg_index], "-agg_nl") == 0 ) { arg_index++; @@ -932,9 +1214,9 @@ main( hypre_int argc, else if ( strcmp(argv[arg_index], "-dt") == 0 ) { arg_index++; - dt = atof(argv[arg_index++]); + dt = (HYPRE_Real)atof(argv[arg_index++]); build_rhs_type = -1; - if ( build_src_type == -1 ) build_src_type = 2; + if ( build_src_type == -1 ) { build_src_type = 2; } } else if ( strcmp(argv[arg_index], "-restritype") == 0 ) { @@ -947,196 +1229,335 @@ main( hypre_int argc, } /* begin lobpcg */ else if ( strcmp(argv[arg_index], "-lobpcg") == 0 ) - { /* use lobpcg */ + { + /* use lobpcg */ arg_index++; lobpcgFlag = 1; } else if ( strcmp(argv[arg_index], "-gen") == 0 ) - { /* generalized evp */ + { + /* generalized evp */ arg_index++; lobpcgGen = 1; } else if ( strcmp(argv[arg_index], "-con") == 0 ) - { /* constrained evp */ + { + /* constrained evp */ arg_index++; constrained = 1; } else if ( strcmp(argv[arg_index], "-orthchk") == 0 ) - { /* lobpcg: check orthonormality */ + { + /* lobpcg: check orthonormality */ arg_index++; checkOrtho = 1; } else if ( strcmp(argv[arg_index], "-vfromfile") == 0 ) - { /* lobpcg: get initial vectors from file */ + { + /* lobpcg: get initial vectors from file */ arg_index++; vFromFileFlag = 1; } else if ( strcmp(argv[arg_index], "-vrand") == 0 ) - { /* lobpcg: block size */ + { + /* lobpcg: block size */ arg_index++; blockSize = atoi(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-seed") == 0 ) - { /* lobpcg: seed for srand */ + { + /* lobpcg: seed for srand */ arg_index++; lobpcgSeed = atoi(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-itr") == 0 ) - { /* lobpcg: max # of iterations */ + { + /* lobpcg: max # of iterations */ arg_index++; maxIterations = atoi(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-verb") == 0 ) - { /* lobpcg: verbosity level */ + { + /* lobpcg: verbosity level */ arg_index++; verbosity = atoi(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-vout") == 0 ) - { /* lobpcg: print level */ + { + /* lobpcg: print level */ arg_index++; printLevel = atoi(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-pcgitr") == 0 ) - { /* lobpcg: inner pcg iterations */ + { + /* lobpcg: inner pcg iterations */ arg_index++; pcgIterations = atoi(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-pcgtol") == 0 ) - { /* lobpcg: inner pcg iterations */ + { + /* lobpcg: inner pcg iterations */ arg_index++; - pcgTol = atof(argv[arg_index++]); + pcgTol = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-pcgmode") == 0 ) - { /* lobpcg: initial guess for inner pcg */ + { + /* lobpcg: initial guess for inner pcg */ arg_index++; /* 0: zero, otherwise rhs */ pcgMode = atoi(argv[arg_index++]); } /* end lobpcg */ /* begin mgr options*/ else if ( strcmp(argv[arg_index], "-mgr_bsize") == 0 ) - { /* mgr block size */ + { + /* mgr block size */ arg_index++; mgr_bsize = atoi(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-mgr_nlevels") == 0 ) - { /* mgr number of coarsening levels */ + { + /* mgr number of coarsening levels */ arg_index++; mgr_nlevels = atoi(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-mgr_non_c_to_f") == 0 ) - { /* mgr intermediate coarse grid strategy */ + { + /* mgr intermediate coarse grid strategy */ arg_index++; mgr_non_c_to_f = atoi(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-mgr_num_reserved_nodes") == 0 ) - { /* mgr number of reserved nodes to be put on coarsest grid */ + { + /* mgr number of reserved nodes to be put on coarsest grid */ arg_index++; mgr_num_reserved_nodes = atoi(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-mgr_frelax_method") == 0 ) - { /* mgr F-relaxation strategy: single/ multi level */ + { + /* mgr F-relaxation strategy: single/ multi level */ arg_index++; mgr_frelax_method = atoi(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-mgr_relax_type") == 0 ) - { /* relax type for "single level" F-relaxation */ + { + /* relax type for "single level" F-relaxation */ arg_index++; mgr_relax_type = atoi(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-mgr_relax_sweeps") == 0 ) - { /* number of relaxation sweeps */ + { + /* number of relaxation sweeps */ arg_index++; mgr_num_relax_sweeps = atoi(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-mgr_interp_type") == 0 ) - { /* interpolation type */ + { + /* interpolation type */ arg_index++; mgr_interp_type = atoi(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-mgr_interp_sweeps") == 0 ) - { /* number of interpolation sweeps*/ + { + /* number of interpolation sweeps*/ arg_index++; mgr_num_interp_sweeps = atoi(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-mgr_gsmooth_type") == 0 ) - { /* global smoother type */ + { + /* global smoother type */ arg_index++; mgr_gsmooth_type = atoi(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-mgr_gsmooth_sweeps") == 0 ) - { /* number of global smooth sweeps*/ + { + /* number of global smooth sweeps*/ arg_index++; mgr_num_gsmooth_sweeps = atoi(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-mgr_restrict_type") == 0 ) - { /* restriction type */ + { + /* restriction type */ arg_index++; mgr_restrict_type = atoi(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-mgr_restrict_sweeps") == 0 ) - { /* number of restriction sweeps*/ + { + /* number of restriction sweeps*/ arg_index++; mgr_num_restrict_sweeps = atoi(argv[arg_index++]); } /* end mgr options */ /* begin ilu options*/ else if ( strcmp(argv[arg_index], "-ilu_type") == 0 ) - { /* ilu_type */ + { + /* ilu_type */ arg_index++; ilu_type = atoi(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-ilu_sm_max_iter") == 0 ) - { /* number of iteration when applied as a smoother */ + { + /* number of iteration when applied as a smoother */ arg_index++; ilu_sm_max_iter = atoi(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-ilu_lfil") == 0 ) - { /* level of fill */ + { + /* level of fill */ arg_index++; ilu_lfil = atoi(argv[arg_index++]); } + else if ( strcmp(argv[arg_index], "-ilu_reordering") == 0 ) + { + /* local reordering type */ + arg_index++; + ilu_reordering = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-ilu_trisolve") == 0 ) + { + /* Triangular solver type */ + arg_index++; + ilu_tri_solve = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-ilu_ljac_iters") == 0 ) + { + /* Lower Jacobi Iterations */ + arg_index++; + ilu_ljac_iters = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-ilu_ujac_iters") == 0 ) + { + /* Upper Jacobi Iterations */ + arg_index++; + ilu_ujac_iters = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-ilu_iter_setup_type") == 0 ) + { + /* Iterative setup for ILU (only with rocSPARSE)*/ + arg_index++; + ilu_iter_setup_type = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-ilu_iter_setup_option") == 0 ) + { + /* Iterative setup for ILU (only with rocSPARSE)*/ + arg_index++; + ilu_iter_setup_option = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-ilu_iter_setup_option") == 0 ) + { + /* Iterative setup for ILU (only with rocSPARSE)*/ + arg_index++; + ilu_iter_setup_option = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-ilu_iter_setup_max_iter") == 0 ) + { + /* Iterative setup for ILU (only with rocSPARSE)*/ + arg_index++; + ilu_iter_setup_max_iter = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-ilu_iter_setup_tolerance") == 0 ) + { + /* Iterative setup for ILU (only with rocSPARSE)*/ + arg_index++; + ilu_iter_setup_tolerance = atof(argv[arg_index++]); + } else if ( strcmp(argv[arg_index], "-ilu_droptol") == 0 ) - { /* drop tolerance */ + { + /* drop tolerance */ arg_index++; - ilu_droptol = atof(argv[arg_index++]); + ilu_droptol = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-ilu_max_row_nnz") == 0 ) - { /* Max number of nonzeros to keep per row */ + { + /* Max number of nonzeros to keep per row */ arg_index++; ilu_max_row_nnz = atoi(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-ilu_schur_max_iter") == 0 ) - { /* Max number of iterations for schur system solver */ + { + /* Max number of iterations for schur system solver */ arg_index++; ilu_schur_max_iter = atoi(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-ilu_nsh_droptol") == 0 ) - { /* Max number of iterations for schur system solver */ + { + /* Max number of iterations for schur system solver */ arg_index++; - ilu_nsh_droptol = atof(argv[arg_index++]); + ilu_nsh_droptol = (HYPRE_Real)atof(argv[arg_index++]); } /* end ilu options */ + /* begin FSAI options*/ + else if ( strcmp(argv[arg_index], "-fs_algo_type") == 0 ) + { + arg_index++; + fsai_algo_type = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-fs_ls_type") == 0 ) + { + arg_index++; + fsai_ls_type = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-fs_max_steps") == 0 ) + { + arg_index++; + fsai_max_steps = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-fs_max_step_size") == 0 ) + { + arg_index++; + fsai_max_step_size = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-fs_max_nnz_row") == 0 ) + { + arg_index++; + fsai_max_nnz_row = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-fs_num_levels") == 0 ) + { + arg_index++; + fsai_num_levels = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-fs_threshold") == 0 ) + { + arg_index++; + fsai_threshold = atof(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-fs_eig_max_iters") == 0 ) + { + arg_index++; + fsai_eig_max_iters = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-fs_kap_tol") == 0 ) + { + arg_index++; + fsai_kap_tolerance = (HYPRE_Real)atof(argv[arg_index++]); + } + /* end FSAI options */ #if defined(HYPRE_USING_GPU) - else if ( strcmp(argv[arg_index], "-exec_host") == 0 ) + else if ( strcmp(argv[arg_index], "-mm_vendor") == 0 ) { arg_index++; - default_exec_policy = HYPRE_EXEC_HOST; + spgemm_use_vendor = atoi(argv[arg_index++]); } - else if ( strcmp(argv[arg_index], "-exec_device") == 0 ) + else if ( strcmp(argv[arg_index], "-nmv") == 0 ) { arg_index++; - default_exec_policy = HYPRE_EXEC_DEVICE; + nmv = atoi(argv[arg_index++]); } - else if ( strcmp(argv[arg_index], "-mm_cusparse") == 0 ) + else if ( strcmp(argv[arg_index], "-mv_vendor") == 0 ) { arg_index++; - spgemm_use_cusparse = atoi(argv[arg_index++]); + spmv_use_vendor = atoi(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-spgemm_alg") == 0 ) { arg_index++; spgemm_alg = atoi(argv[arg_index++]); } + else if ( strcmp(argv[arg_index], "-spgemm_binned") == 0 ) + { + arg_index++; + spgemm_binned = atoi(argv[arg_index++]); + } else if ( strcmp(argv[arg_index], "-spgemm_rowest") == 0 ) { arg_index++; @@ -1145,25 +1566,20 @@ main( hypre_int argc, else if ( strcmp(argv[arg_index], "-spgemm_rowestmult") == 0 ) { arg_index++; - spgemm_rowest_mult = atof(argv[arg_index++]); + spgemm_rowest_mult = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-spgemm_rowestnsamples") == 0 ) { arg_index++; spgemm_rowest_nsamples = atoi(argv[arg_index++]); } - else if ( strcmp(argv[arg_index], "-spgemm_hash") == 0 ) - { - arg_index++; - spgemm_hash_type = argv[arg_index++][0]; - } else if ( strcmp(argv[arg_index], "-use_curand") == 0 ) { arg_index++; use_curand = atoi(argv[arg_index++]); } #endif -#ifdef HYPRE_USING_DEVICE_POOL +#if defined (HYPRE_USING_DEVICE_POOL) else if ( strcmp(argv[arg_index], "-mempool_growth") == 0 ) { arg_index++; @@ -1183,28 +1599,77 @@ main( hypre_int argc, { // Give maximum cached in Mbytes. arg_index++; - mempool_max_cached_bytes = atoi(argv[arg_index++])*1024LL*1024LL; + mempool_max_cached_bytes = atoi(argv[arg_index++]) * 1024LL * 1024LL; } -#endif - else if ( strcmp(argv[arg_index], "-negA") == 0 ) +#elif defined (HYPRE_USING_UMPIRE) + else if ( strcmp(argv[arg_index], "-umpire_dev_pool_size") == 0 ) { arg_index++; - negA = atoi(argv[arg_index++]); + umpire_dev_pool_size = (size_t) 1073741824 * atoi(argv[arg_index++]); } - else + else if ( strcmp(argv[arg_index], "-umpire_uvm_pool_size") == 0 ) { arg_index++; + umpire_uvm_pool_size = (size_t) 1073741824 * atoi(argv[arg_index++]); } - } - - /* begin CGC BM Aug 25, 2006 */ - if (coarsen_type == 21 || coarsen_type == 22) { - arg_index = 0; - while ( (arg_index < argc) && (!print_usage) ) + else if ( strcmp(argv[arg_index], "-umpire_pinned_pool_size") == 0 ) { - if ( strcmp(argv[arg_index], "-cgcits") == 0 ) - { - arg_index++; + arg_index++; + umpire_pinned_pool_size = (size_t) 1073741824 * atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-umpire_host_pool_size") == 0 ) + { + arg_index++; + umpire_host_pool_size = (size_t) 1073741824 * atoi(argv[arg_index++]); + } +#endif + else if ( strcmp(argv[arg_index], "-negA") == 0 ) + { + arg_index++; + negA = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-second_time") == 0 ) + { + arg_index++; + second_time = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-benchmark") == 0 ) + { + arg_index++; + benchmark = atoi(argv[arg_index++]); + } +#if defined(HYPRE_USING_MEMORY_TRACKER) + else if ( strcmp(argv[arg_index], "-print_mem_tracker") == 0 ) + { + arg_index++; + print_mem_tracker = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-mem_tracker_filename") == 0 ) + { + arg_index++; + snprintf(mem_tracker_name, HYPRE_MAX_FILE_NAME_LEN, "%s", argv[arg_index++]); + } +#endif + else if ( strcmp(argv[arg_index], "-gpu_mpi") == 0 ) + { + arg_index++; + gpu_aware_mpi = atoi(argv[arg_index++]); + } + else + { + arg_index++; + } + } + + /* begin CGC BM Aug 25, 2006 */ + if (coarsen_type == 21 || coarsen_type == 22) + { + arg_index = 0; + while ( (arg_index < argc) && (!print_usage) ) + { + if ( strcmp(argv[arg_index], "-cgcits") == 0 ) + { + arg_index++; cgcits = atoi(argv[arg_index++]); } else @@ -1301,59 +1766,59 @@ main( hypre_int argc, else if ( strcmp(argv[arg_index], "-w") == 0 ) { arg_index++; - relax_wt = atof(argv[arg_index++]); + relax_wt = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-wl") == 0 ) { arg_index++; - relax_wt_level = atof(argv[arg_index++]); + relax_wt_level = (HYPRE_Real)atof(argv[arg_index++]); level_w = atoi(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-ow") == 0 ) { arg_index++; - outer_wt = atof(argv[arg_index++]); + outer_wt = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-owl") == 0 ) { arg_index++; - outer_wt_level = atof(argv[arg_index++]); + outer_wt_level = (HYPRE_Real)atof(argv[arg_index++]); level_ow = atoi(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-sw") == 0 ) { arg_index++; - schwarz_rlx_weight = atof(argv[arg_index++]); - } - else if ( strcmp(argv[arg_index], "-coarse_th") == 0 ) - { - arg_index++; - coarse_threshold = atof(argv[arg_index++]); + schwarz_rlx_weight = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-adroptol") == 0 ) { arg_index++; - A_drop_tol = atof(argv[arg_index++]); + A_drop_tol = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-adroptype") == 0 ) { arg_index++; A_drop_type = atoi(argv[arg_index++]); } + else if ( strcmp(argv[arg_index], "-coarse_th") == 0 ) + { + arg_index++; + coarse_threshold = atoi(argv[arg_index++]); + } else if ( strcmp(argv[arg_index], "-min_cs") == 0 ) { arg_index++; - min_coarse_size = atof(argv[arg_index++]); + min_coarse_size = atoi(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-seq_th") == 0 ) { arg_index++; - seq_threshold = atof(argv[arg_index++]); + seq_threshold = atoi(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-red") == 0 ) { arg_index++; - redundant = atof(argv[arg_index++]); + redundant = atoi(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-cutf") == 0 ) { @@ -1363,17 +1828,17 @@ main( hypre_int argc, else if ( strcmp(argv[arg_index], "-th") == 0 ) { arg_index++; - strong_threshold = atof(argv[arg_index++]); + strong_threshold = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-thR") == 0 ) { arg_index++; - strong_thresholdR = atof(argv[arg_index++]); + strong_thresholdR = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-fltr_thR") == 0 ) { arg_index++; - filter_thresholdR = atof(argv[arg_index++]); + filter_thresholdR = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-CF") == 0 ) { @@ -1383,12 +1848,12 @@ main( hypre_int argc, else if ( strcmp(argv[arg_index], "-cf") == 0 ) { arg_index++; - cf_tol = atof(argv[arg_index++]); + cf_tol = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-tol") == 0 ) { arg_index++; - tol = atof(argv[arg_index++]); + tol = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-conv_type") == 0 ) { @@ -1398,27 +1863,27 @@ main( hypre_int argc, else if ( strcmp(argv[arg_index], "-atol") == 0 ) { arg_index++; - atol = atof(argv[arg_index++]); + atol = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-mxrs") == 0 ) { arg_index++; - max_row_sum = atof(argv[arg_index++]); + max_row_sum = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-sai_th") == 0 ) { arg_index++; - sai_threshold = atof(argv[arg_index++]); + sai_threshold = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-sai_filt") == 0 ) { arg_index++; - sai_filter = atof(argv[arg_index++]); + sai_filter = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-drop_tol") == 0 ) { arg_index++; - drop_tol = atof(argv[arg_index++]); + drop_tol = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-nonzeros_to_keep") == 0 ) { @@ -1428,12 +1893,12 @@ main( hypre_int argc, else if ( strcmp(argv[arg_index], "-ilut") == 0 ) { arg_index++; - eu_ilut = atof(argv[arg_index++]); + eu_ilut = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-sparseA") == 0 ) { arg_index++; - eu_sparse_A = atof(argv[arg_index++]); + eu_sparse_A = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-rowScale") == 0 ) { @@ -1463,7 +1928,7 @@ main( hypre_int argc, else if ( strcmp(argv[arg_index], "-tr") == 0 ) { arg_index++; - trunc_factor = atof(argv[arg_index++]); + trunc_factor = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-Pmx") == 0 ) { @@ -1478,7 +1943,7 @@ main( hypre_int argc, else if ( strcmp(argv[arg_index], "-Qtr") == 0 ) { arg_index++; - Q_trunc = atof(argv[arg_index++]); + Q_trunc = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-Qmx") == 0 ) { @@ -1488,12 +1953,12 @@ main( hypre_int argc, else if ( strcmp(argv[arg_index], "-jtr") == 0 ) { arg_index++; - jacobi_trunc_threshold = atof(argv[arg_index++]); + jacobi_trunc_threshold = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-Ssw") == 0 ) { arg_index++; - S_commpkg_switch = atof(argv[arg_index++]); + S_commpkg_switch = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-solver_type") == 0 ) { @@ -1514,6 +1979,17 @@ main( hypre_int argc, { arg_index++; poutdat = atoi(argv[arg_index++]); + poutusr = 1; + } + else if ( strcmp(argv[arg_index], "-skipbreak") == 0 ) + { + arg_index++; + skip_break = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-flex") == 0 ) + { + arg_index++; + flex = atoi(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-var") == 0 ) { @@ -1581,12 +2057,12 @@ main( hypre_int argc, else if ( strcmp(argv[arg_index], "-agg_tr") == 0 ) { arg_index++; - agg_trunc_factor = atof(argv[arg_index++]); + agg_trunc_factor = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-agg_P12_tr") == 0 ) { arg_index++; - agg_P12_trunc_factor = atof(argv[arg_index++]); + agg_P12_trunc_factor = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-postinterptype") == 0 ) { @@ -1636,7 +2112,7 @@ main( hypre_int argc, else if ( strcmp(argv[arg_index], "-cheby_fraction") == 0 ) { arg_index++; - cheby_fraction = atof(argv[arg_index++]); + cheby_fraction = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-additive") == 0 ) { @@ -1666,7 +2142,7 @@ main( hypre_int argc, else if ( strcmp(argv[arg_index], "-add_tr") == 0 ) { arg_index++; - add_trunc_factor = atof(argv[arg_index++]); + add_trunc_factor = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-add_rlx") == 0 ) { @@ -1676,7 +2152,7 @@ main( hypre_int argc, else if ( strcmp(argv[arg_index], "-add_w") == 0 ) { arg_index++; - add_relax_wt = atof(argv[arg_index++]); + add_relax_wt = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-rap") == 0 ) { @@ -1707,7 +2183,7 @@ main( hypre_int argc, nongalerk_tol = hypre_CTAlloc(HYPRE_Real, nongalerk_num_tol, HYPRE_MEMORY_HOST); for (i = 0; i < nongalerk_num_tol; i++) { - nongalerk_tol[i] = atof(argv[arg_index++]); + nongalerk_tol[i] = (HYPRE_Real)atof(argv[arg_index++]); } } else if ( strcmp(argv[arg_index], "-print") == 0 ) @@ -1715,6 +2191,11 @@ main( hypre_int argc, arg_index++; print_system = 1; } + else if ( strcmp(argv[arg_index], "-printbin") == 0 ) + { + arg_index++; + print_system_binary = 1; + } /* BM Oct 23, 2006 */ else if ( strcmp(argv[arg_index], "-plot_grids") == 0 ) { @@ -1724,7 +2205,7 @@ main( hypre_int argc, else if ( strcmp(argv[arg_index], "-plot_file_name") == 0 ) { arg_index++; - hypre_sprintf (plot_file_name,"%s",argv[arg_index++]); + hypre_sprintf (plot_file_name, "%s", argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-AIR") == 0 ) { @@ -1766,6 +2247,11 @@ main( hypre_int argc, arg_index++; amgdd_num_ghost_layers = atoi(argv[arg_index++]); } + else if ( strcmp(argv[arg_index], "-precon_cycles") == 0 ) + { + arg_index++; + precon_cycles = atoi(argv[arg_index++]); + } else { arg_index++; @@ -1777,11 +2263,14 @@ main( hypre_int argc, { restri_type = air; /* Set Restriction to be AIR */ interp_type = 100; /* 1-pt Interp */ -#if defined(HYPRE_USING_GPU) - relax_type = 7; -#else - relax_type = 0; -#endif + if (hypre_GetExecPolicy1(memory_location) == HYPRE_EXEC_DEVICE) + { + relax_type = 7; + } + else + { + relax_type = 0; + } ns_down = 0; ns_up = 3; /* this is a 2-D 4-by-k array using Double pointers */ @@ -1791,7 +2280,7 @@ main( hypre_int argc, grid_relax_points[2] = hypre_CTAlloc(HYPRE_Int, ns_up, HYPRE_MEMORY_HOST); grid_relax_points[3] = hypre_CTAlloc(HYPRE_Int, ns_coarse, HYPRE_MEMORY_HOST); /* down cycle: C */ - for (i=0; i]\n", argv[0]); hypre_printf("\n"); + hypre_printf(" -ll : hypre's log level. \n"); + hypre_printf(" 0 = (default) No messaging.\n"); + hypre_printf(" 1 = Display memory usage statistics for each MPI rank.\n"); + hypre_printf(" 2 = Display aggregate memory usage statistics over MPI ranks.\n"); hypre_printf(" -fromfile : "); hypre_printf("matrix read from multiple files (IJ format)\n"); + hypre_printf(" -frombinfile : "); + hypre_printf("matrix read from multiple binary files (IJ format)\n"); hypre_printf(" -fromparcsrfile : "); hypre_printf("matrix read from multiple files (ParCSR format)\n"); hypre_printf(" -fromonecsrfile : "); hypre_printf("matrix read from a single file (CSR format)\n"); hypre_printf("\n"); - hypre_printf(" -laplacian [] : build 5pt 2D laplacian problem (default) \n"); + hypre_printf(" -laplacian : build 5pt 2D laplacian problem (default) \n"); hypre_printf(" -sysL : build SYSTEMS laplacian 7pt operator\n"); hypre_printf(" -9pt [] : build 9pt 2D laplacian problem\n"); hypre_printf(" -27pt [] : build 27pt 3D laplacian problem\n"); + hypre_printf(" -125pt [] : build 125pt (27pt squared) 3D laplacian\n"); hypre_printf(" -difconv [] : build convection-diffusion problem\n"); + hypre_printf(" -vardifconv [] : build variable conv.-diffusion problem\n"); + hypre_printf(" -rotate [] : build 7pt rotated laplacian problem\n"); hypre_printf(" -n : total problem size \n"); hypre_printf(" -P : processor topology\n"); hypre_printf(" -c : diffusion coefficients\n"); @@ -1854,8 +2352,12 @@ main( hypre_int argc, hypre_printf(" -storage_low : allocates not enough storage for aux struct\n"); hypre_printf(" -concrete_parcsr : use parcsr matrix type as concrete type\n"); hypre_printf("\n"); + hypre_printf(" -rbm : rigid body mode vectors\n"); + hypre_printf(" -nc : number of components of a vector (multivector)\n"); hypre_printf(" -rhsfromfile : "); hypre_printf("rhs read from multiple files (IJ format)\n"); + hypre_printf(" -rhsfrombinfile : "); + hypre_printf("rhs read from multiple binary files (IJ format)\n"); hypre_printf(" -rhsfromonefile : "); hypre_printf("rhs read from a single file (CSR format)\n"); hypre_printf(" -rhsparcsrfile : "); @@ -1865,7 +2367,7 @@ main( hypre_int argc, hypre_printf(" -SFfromonefile : "); hypre_printf("list of isolated F points from a single file\n"); hypre_printf(" -rhsrand : rhs is random vector\n"); - hypre_printf(" -rhsisone : rhs is vector with unit components (default)\n"); + hypre_printf(" -rhsisone : rhs is vector with unit coefficients (default)\n"); hypre_printf(" -xisone : solution of all ones\n"); hypre_printf(" -rhszero : rhs is zero vector\n"); hypre_printf("\n"); @@ -1877,9 +2379,9 @@ main( hypre_int argc, hypre_printf(" -srcfromonefile : "); hypre_printf("backward Euler source read from a single file (IJ format)\n"); hypre_printf(" -srcrand : "); - hypre_printf("backward Euler source is random vector with components in range 0 - 1\n"); + hypre_printf("backward Euler source is random vector with coefficients in range 0 - 1\n"); hypre_printf(" -srcisone : "); - hypre_printf("backward Euler source is vector with unit components (default)\n"); + hypre_printf("backward Euler source is vector with unit coefficients (default)\n"); hypre_printf(" -srczero : "); hypre_printf("backward Euler source is zero-vector\n"); hypre_printf(" -x0fromfile : "); @@ -1897,6 +2399,7 @@ main( hypre_int argc, hypre_printf(" 16=AMG-COGMRES 17=DIAG-COGMRES\n"); hypre_printf(" 18=ParaSails-GMRES\n"); hypre_printf(" 20=Hybrid solver/ DiagScale, AMG \n"); + hypre_printf(" 31=FSAI-PCG \n"); hypre_printf(" 43=Euclid-PCG 44=Euclid-GMRES \n"); hypre_printf(" 45=Euclid-BICGSTAB 46=Euclid-COGMRES\n"); hypre_printf(" 47=Euclid-FlexGMRES\n"); @@ -1905,7 +2408,7 @@ main( hypre_int argc, hypre_printf(" 70=MGR 71=MGR-PCG \n"); hypre_printf(" 72=MGR-FlexGMRES 73=MGR-BICGSTAB \n"); hypre_printf(" 74=MGR-COGMRES \n"); - hypre_printf(" 80=ILU 81=ILU-GMRES \n"); + hypre_printf(" 80=ILU 81=ILU-GMRES \n"); hypre_printf(" 82=ILU-FlexGMRES \n"); hypre_printf(" 90=AMG-DD 91=AMG-DD-GMRES \n"); hypre_printf("\n"); @@ -2010,6 +2513,7 @@ main( hypre_int argc, hypre_printf(" -jtr : set truncation threshold for Jacobi interpolation = val \n"); hypre_printf(" -Ssw : set S-commpkg-switch = val \n"); hypre_printf(" -mxrs : set AMG maximum row sum threshold for dependency weakening \n"); + hypre_printf(" -ff <0/1> : set filtering based on functions for systems AMG\n"); hypre_printf(" -nf : set number of functions for systems AMG\n"); hypre_printf(" -numsamp : set number of sample vectors for GSMG\n"); @@ -2165,8 +2669,27 @@ main( hypre_int argc, hypre_printf(" -ilu_max_row_nnz : set max. num of nonzeros to keep per row = val \n"); hypre_printf(" -ilu_schur_max_iter : set max. num of iteration for GMRES/NSH Schur = val \n"); hypre_printf(" -ilu_nsh_droptol : set drop tolerance threshold for NSH = val \n"); + hypre_printf(" -ilu_reordering : 0: no reordering. 1: Reverse Cuthill-McKee.\n"); + hypre_printf(" -ilu_tri_solve <0/1> : 0: iterative solve. 1: direct solve.\n"); + hypre_printf(" -ilu_ljac_iters : set number of lower Jacobi iterations for the triangular L solves when using iterative solve approach.\n"); + hypre_printf(" -ilu_ujac_iters : set number of upper Jacobi iterations for the triangular U solves when using iterative solve approach.\n"); + hypre_printf(" -ilu_iter_setup_type : set iterative ILU setup algorithm.\n"); + hypre_printf(" -ilu_iter_setup_option : set iterative ILU setup option.\n"); + hypre_printf(" -ilu_iter_setup_max_iter : set max. number of iterations for iterative ILU setup.\n"); + hypre_printf(" -ilu_iter_setup_tolerance : set stopping tolerance for iterative ILU setup.\n"); hypre_printf(" -ilu_sm_max_iter : set number of iterations when applied as a smmother in AMG = val \n"); /* end ILU options */ + /* hypre FSAI options */ + hypre_printf(" -fs_algo_type : FSAI algorithm type\n"); + hypre_printf(" -fs_ls_type : FSAI local solve type\n"); + hypre_printf(" -fs_max_steps : Max. number of steps (adaptive)\n"); + hypre_printf(" -fs_max_step_size : Max. step size (adaptive)\n"); + hypre_printf(" -fs_max_nnz_row : Max. nonzeros per row (static)\n"); + hypre_printf(" -fs_num_levels : Number of levels (static)\n"); + hypre_printf(" -fs_threshold : Filtering threshold (static)\n"); + hypre_printf(" -fs_eig_max_iters : Max. it. for eig calculation.\n"); + hypre_printf(" -fs_kap_tol : Kap. theshold (adaptive)\n"); + /* end FSAI options */ /* hypre AMG-DD options */ hypre_printf(" -amgdd_start_level : set AMG-DD start level = val\n"); hypre_printf(" -amgdd_padding : set AMG-DD padding = val\n"); @@ -2183,6 +2706,14 @@ main( hypre_int argc, hypre_printf(" 2=W-cycle \n"); hypre_printf(" 3=F-cycle \n"); /* end AMG-DD options */ +#if defined (HYPRE_USING_UMPIRE) + /* hypre umpire options */ + hypre_printf(" -umpire_dev_pool_size : device memory pool size (GiB)\n"); + hypre_printf(" -umpire_uvm_pool_size : device unified virtual memory pool size (GiB)\n"); + hypre_printf(" -umpire_pinned_pool_size : pinned memory pool size (GiB)\n"); + hypre_printf(" -umpire_host_pool_size : host memory pool size (GiB)\n"); + /* end umpire options */ +#endif } goto final; @@ -2194,47 +2725,63 @@ main( hypre_int argc, if (myid == 0) { +#if defined(HYPRE_DEVELOP_STRING) && defined(HYPRE_DEVELOP_BRANCH) + hypre_printf("\nUsing HYPRE_DEVELOP_STRING: %s (branch %s; the develop branch)\n\n", + HYPRE_DEVELOP_STRING, HYPRE_DEVELOP_BRANCH); + +#elif defined(HYPRE_DEVELOP_STRING) && !defined(HYPRE_DEVELOP_BRANCH) + hypre_printf("\nUsing HYPRE_DEVELOP_STRING: %s (branch %s; not the develop branch)\n\n", + HYPRE_DEVELOP_STRING, HYPRE_BRANCH_NAME); + +#elif defined(HYPRE_RELEASE_VERSION) + hypre_printf("\nUsing HYPRE_RELEASE_VERSION: %s\n\n", + HYPRE_RELEASE_VERSION); +#endif + hypre_printf("Running with these driver parameters:\n"); hypre_printf(" solver ID = %d\n\n", solver_id); } - /*----------------------------------------------------------------- - * GPU Device binding - * Must be done before HYPRE_Init() and should not be changed after - *-----------------------------------------------------------------*/ - hypre_bind_device(myid, num_procs, hypre_MPI_COMM_WORLD); - - time_index = hypre_InitializeTiming("Hypre init"); - hypre_BeginTiming(time_index); - /*----------------------------------------------------------- - * Initialize : must be the first HYPRE function to call + * Set various things *-----------------------------------------------------------*/ - HYPRE_Init(); - hypre_EndTiming(time_index); - hypre_PrintTiming("Hypre init times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + HYPRE_SetPrintErrorMode(1); + if (test_error == 1) + { + HYPRE_SetPrintErrorVerbosity(-1, 0); /* turn all errors off */ + HYPRE_SetPrintErrorVerbosity(HYPRE_ERROR_GENERIC, 1); /* turn generic errors on */ + } -#ifdef HYPRE_USING_DEVICE_POOL +#if defined(HYPRE_USING_DEVICE_POOL) /* To be effective, hypre_SetCubMemPoolSize must immediately follow HYPRE_Init */ HYPRE_SetGPUMemoryPoolSize( mempool_bin_growth, mempool_min_bin, mempool_max_bin, mempool_max_cached_bytes ); -#endif -#if defined(HYPRE_USING_UMPIRE) +#elif defined(HYPRE_USING_UMPIRE) /* Setup Umpire pools */ HYPRE_SetUmpireDevicePoolName("HYPRE_DEVICE_POOL_TEST"); HYPRE_SetUmpireUMPoolName("HYPRE_UM_POOL_TEST"); HYPRE_SetUmpireHostPoolName("HYPRE_HOST_POOL_TEST"); HYPRE_SetUmpirePinnedPoolName("HYPRE_PINNED_POOL_TEST"); - HYPRE_SetUmpireDevicePoolSize(4LL * 1024 * 1024 * 1024); - HYPRE_SetUmpireUMPoolSize(4LL * 1024 * 1024 * 1024); - HYPRE_SetUmpireHostPoolSize(4LL * 1024 * 1024 * 1024); - HYPRE_SetUmpirePinnedPoolSize(4LL * 1024 * 1024 * 1024); + + HYPRE_SetUmpireDevicePoolSize(umpire_dev_pool_size); + HYPRE_SetUmpireUMPoolSize(umpire_uvm_pool_size); + HYPRE_SetUmpireHostPoolSize(umpire_host_pool_size); + HYPRE_SetUmpirePinnedPoolSize(umpire_pinned_pool_size); +#endif + +#if defined(HYPRE_USING_MEMORY_TRACKER) + hypre_MemoryTrackerSetPrint(print_mem_tracker); + if (mem_tracker_name[0]) + { + hypre_MemoryTrackerSetFileName(mem_tracker_name); + } #endif + /* Set log level */ + HYPRE_SetLogLevel(log_level); + /* default memory location */ HYPRE_SetMemoryLocation(memory_location); @@ -2242,17 +2789,20 @@ main( hypre_int argc, HYPRE_SetExecutionPolicy(default_exec_policy); #if defined(HYPRE_USING_GPU) - /* use cuSPARSE for SpGEMM */ - ierr = HYPRE_SetSpGemmUseCusparse(spgemm_use_cusparse); hypre_assert(ierr == 0); + ierr = HYPRE_SetSpMVUseVendor(spmv_use_vendor); hypre_assert(ierr == 0); + /* use vendor implementation for SpGEMM */ + ierr = HYPRE_SetSpGemmUseVendor(spgemm_use_vendor); hypre_assert(ierr == 0); ierr = hypre_SetSpGemmAlgorithm(spgemm_alg); hypre_assert(ierr == 0); + ierr = hypre_SetSpGemmBinned(spgemm_binned); hypre_assert(ierr == 0); ierr = hypre_SetSpGemmRownnzEstimateMethod(spgemm_rowest_mtd); hypre_assert(ierr == 0); - ierr = hypre_SetSpGemmRownnzEstimateNSamples(spgemm_rowest_nsamples); hypre_assert(ierr == 0); - ierr = hypre_SetSpGemmRownnzEstimateMultFactor(spgemm_rowest_mult); hypre_assert(ierr == 0); - ierr = hypre_SetSpGemmHashType(spgemm_hash_type); hypre_assert(ierr == 0); + if (spgemm_rowest_nsamples > 0) { ierr = hypre_SetSpGemmRownnzEstimateNSamples(spgemm_rowest_nsamples); hypre_assert(ierr == 0); } + if (spgemm_rowest_mult > 0.0) { ierr = hypre_SetSpGemmRownnzEstimateMultFactor(spgemm_rowest_mult); hypre_assert(ierr == 0); } /* use cuRand for PMIS */ HYPRE_SetUseGpuRand(use_curand); #endif + HYPRE_SetGpuAwareMPI(gpu_aware_mpi); + /*----------------------------------------------------------- * Set up matrix *-----------------------------------------------------------*/ @@ -2265,14 +2815,24 @@ main( hypre_int argc, time_index = hypre_InitializeTiming("Spatial Operator"); hypre_BeginTiming(time_index); - if ( build_matrix_type == -1 ) + if ( build_matrix_type == -2 ) + { + ierr = HYPRE_IJMatrixReadBinary( argv[build_matrix_arg_index], comm, + HYPRE_PARCSR, &ij_A ); + if (ierr) + { + hypre_printf("ERROR: Problem reading in the system matrix!\n"); + hypre_MPI_Abort(comm, 1); + } + } + else if ( build_matrix_type == -1 ) { ierr = HYPRE_IJMatrixRead( argv[build_matrix_arg_index], comm, HYPRE_PARCSR, &ij_A ); if (ierr) { hypre_printf("ERROR: Problem reading in the system matrix!\n"); - exit(1); + hypre_MPI_Abort(comm, 1); } } else if ( build_matrix_type == 0 ) @@ -2296,45 +2856,57 @@ main( hypre_int argc, { BuildParLaplacian27pt(argc, argv, build_matrix_arg_index, &parcsr_A); - hypre_CSRMatrixGpuSpMVAnalysis(hypre_ParCSRMatrixDiag(parcsr_A)); +#if defined(HYPRE_USING_GPU) + hypre_CSRMatrixSpMVAnalysisDevice(hypre_ParCSRMatrixDiag(parcsr_A)); +#endif } else if ( build_matrix_type == 5 ) { - BuildParDifConv(argc, argv, build_matrix_arg_index, &parcsr_A); + BuildParLaplacian125pt(argc, argv, build_matrix_arg_index, &parcsr_A); + +#if defined(HYPRE_USING_GPU) + hypre_CSRMatrixSpMVAnalysisDevice(hypre_ParCSRMatrixDiag(parcsr_A)); +#endif } else if ( build_matrix_type == 6 ) + { + BuildParDifConv(argc, argv, build_matrix_arg_index, &parcsr_A); + } + else if ( build_matrix_type == 7 ) { BuildParVarDifConv(argc, argv, build_matrix_arg_index, &parcsr_A, &b); build_rhs_type = 6; build_src_type = 5; } - else if ( build_matrix_type == 7 ) + else if ( build_matrix_type == 8 ) { BuildParRotate7pt(argc, argv, build_matrix_arg_index, &parcsr_A); } - else { hypre_printf("You have asked for an unsupported problem with\n"); hypre_printf("build_matrix_type = %d.\n", build_matrix_type); - return(-1); + + hypre_MPI_Abort(comm, 1); } + /* BM Oct 23, 2006 */ if (plot_grids) { - if (build_matrix_type > 1 && build_matrix_type < 8) + if (build_matrix_type > 1 && build_matrix_type < 9) BuildParCoordinates (argc, argv, build_matrix_arg_index, &coord_dim, &coordinates); else { - hypre_printf("Warning: coordinates are not yet printed for build_matrix_type = %d.\n", build_matrix_type); + hypre_printf("Warning: coordinates are not yet printed for build_matrix_type = %d.\n", + build_matrix_type); } } if (build_matrix_type < 0) { ierr = HYPRE_IJMatrixGetLocalRange( ij_A, - &first_local_row, &last_local_row , + &first_local_row, &last_local_row, &first_local_col, &last_local_col ); local_num_rows = (HYPRE_Int)(last_local_row - first_local_row + 1); @@ -2348,7 +2920,7 @@ main( hypre_int argc, * Copy the parcsr matrix into the IJMatrix through interface calls *-----------------------------------------------------------*/ ierr = HYPRE_ParCSRMatrixGetLocalRange( parcsr_A, - &first_local_row, &last_local_row , + &first_local_row, &last_local_row, &first_local_col, &last_local_col ); local_num_rows = (HYPRE_Int)(last_local_row - first_local_row + 1); @@ -2359,6 +2931,33 @@ main( hypre_int argc, hypre_FinalizeTiming(time_index); hypre_ClearTiming(); + /* Read matrix to be passed to the preconditioner */ + if (build_matrix_M == 1) + { + time_index = hypre_InitializeTiming("Auxiliary Operator"); + hypre_BeginTiming(time_index); + + ierr = HYPRE_IJMatrixRead( argv[build_matrix_M_arg_index], comm, + HYPRE_PARCSR, &ij_M ); + if (ierr) + { + hypre_printf("ERROR: Problem reading in the auxiliary matrix B!\n"); + exit(1); + } + + HYPRE_IJMatrixGetObject(ij_M, &object); + parcsr_M = (HYPRE_ParCSRMatrix) object; + + hypre_EndTiming(time_index); + hypre_PrintTiming("Auxiliary Operator", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + } + else + { + parcsr_M = parcsr_A; + } + /* Check the ij interface - not necessary if one just wants to test solvers */ if (test_ij && build_matrix_type > -1) { @@ -2377,7 +2976,7 @@ main( hypre_int argc, num_rows = local_num_rows; if (off_proc) { - if (myid != num_procs-1) + if (myid != num_procs - 1) { num_rows++; } @@ -2404,14 +3003,18 @@ main( hypre_int argc, { size = 7; } - if (build_matrix_type == 3) + else if (build_matrix_type == 3) { size = 9; } - if (build_matrix_type == 4) + else if (build_matrix_type == 4) { size = 27; } + else if (build_matrix_type == 5) + { + size = 125; + } } row_sizes = hypre_CTAlloc(HYPRE_Int, num_rows, HYPRE_MEMORY_HOST); for (i = 0; i < num_rows; i++) @@ -2424,16 +3027,20 @@ main( hypre_int argc, { mx_size = 7; } - if (build_matrix_type == 3) + else if (build_matrix_type == 3) { mx_size = 9; } - if (build_matrix_type == 4) + else if (build_matrix_type == 4) { mx_size = 27; } - col_nums = hypre_CTAlloc(HYPRE_BigInt, mx_size*num_rows, HYPRE_MEMORY_HOST); - data = hypre_CTAlloc(HYPRE_Real, mx_size*num_rows, HYPRE_MEMORY_HOST); + else if (build_matrix_type == 5) + { + mx_size = 125; + } + col_nums = hypre_CTAlloc(HYPRE_BigInt, mx_size * num_rows, HYPRE_MEMORY_HOST); + data = hypre_CTAlloc(HYPRE_Real, mx_size * num_rows, HYPRE_MEMORY_HOST); i_indx = 0; j_indx = 0; @@ -2449,15 +3056,16 @@ main( hypre_int argc, for (i = 0; i < local_num_rows; i++) { row_nums[i_indx] = first_local_row + i; - ierr += HYPRE_ParCSRMatrixGetRow(parcsr_A, first_local_row+i, &size, &col_inds, &values); + ierr += HYPRE_ParCSRMatrixGetRow(parcsr_A, first_local_row + i, &size, &col_inds, &values); num_cols[i_indx++] = size; - hypre_TMemcpy(&col_nums[j_indx], &col_inds[0], HYPRE_BigInt, size, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + hypre_TMemcpy(&col_nums[j_indx], &col_inds[0], HYPRE_BigInt, size, HYPRE_MEMORY_HOST, + HYPRE_MEMORY_HOST); hypre_TMemcpy(&data[j_indx], &values[0], HYPRE_Real, size, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); if (sparsity_known == 1) { for (j = 0; j < size; j++) { - if (col_nums[j_indx+j] < first_local_row || col_nums[j_indx+j] > last_local_row) + if (col_nums[j_indx + j] < first_local_row || col_nums[j_indx + j] > last_local_row) { offdiag_sizes[local_row]++; } @@ -2469,10 +3077,10 @@ main( hypre_int argc, } j_indx += size; local_row++; - ierr += HYPRE_ParCSRMatrixRestoreRow(parcsr_A, first_local_row+i, &size, &col_inds, &values); + ierr += HYPRE_ParCSRMatrixRestoreRow(parcsr_A, first_local_row + i, &size, &col_inds, &values); } - if (off_proc && myid != num_procs-1) + if (off_proc && myid != num_procs - 1) { num_cols[i_indx] = 2; row_nums[i_indx++] = last_local_row + 1; @@ -2508,13 +3116,17 @@ main( hypre_int argc, { num_cols = hypre_TAlloc(HYPRE_Int, num_rows, memory_location); row_nums = hypre_TAlloc(HYPRE_BigInt, num_rows, memory_location); - col_nums = hypre_TAlloc(HYPRE_BigInt, mx_size*num_rows, memory_location); - data = hypre_TAlloc(HYPRE_Real, mx_size*num_rows, memory_location); + col_nums = hypre_TAlloc(HYPRE_BigInt, mx_size * num_rows, memory_location); + data = hypre_TAlloc(HYPRE_Real, mx_size * num_rows, memory_location); - hypre_TMemcpy(num_cols, num_cols_h, HYPRE_Int, num_rows, memory_location, HYPRE_MEMORY_HOST); - hypre_TMemcpy(row_nums, row_nums_h, HYPRE_BigInt, num_rows, memory_location, HYPRE_MEMORY_HOST); - hypre_TMemcpy(col_nums, col_nums_h, HYPRE_BigInt, mx_size*num_rows, memory_location, HYPRE_MEMORY_HOST); - hypre_TMemcpy(data, data_h, HYPRE_Real, mx_size*num_rows, memory_location, HYPRE_MEMORY_HOST); + hypre_TMemcpy(num_cols, num_cols_h, HYPRE_Int, num_rows, memory_location, + HYPRE_MEMORY_HOST); + hypre_TMemcpy(row_nums, row_nums_h, HYPRE_BigInt, num_rows, memory_location, + HYPRE_MEMORY_HOST); + hypre_TMemcpy(col_nums, col_nums_h, HYPRE_BigInt, mx_size * num_rows, memory_location, + HYPRE_MEMORY_HOST); + hypre_TMemcpy(data, data_h, HYPRE_Real, mx_size * num_rows, memory_location, + HYPRE_MEMORY_HOST); } if (chunk) @@ -2535,7 +3147,7 @@ main( hypre_int argc, else { j_indx = 0; - for (i=0; i < num_rows; i++) + for (i = 0; i < num_rows; i++) { if (add) { @@ -2584,7 +3196,7 @@ main( hypre_int argc, if (ierr) { hypre_printf("Error in driver building IJMatrix from parcsr matrix. \n"); - return(-1); + return (-1); } /* This is to emphasize that one can IJMatrixAddToValues after an @@ -2613,7 +3225,7 @@ main( hypre_int argc, } if (dt < dt_inf) { - val += 1./dt; + val += 1. / dt; } else { @@ -2641,10 +3253,14 @@ main( hypre_int argc, col_inds = hypre_TAlloc(HYPRE_BigInt, last_local_row - first_local_row + 1, memory_location); values = hypre_TAlloc(HYPRE_Real, last_local_row - first_local_row + 1, memory_location); - hypre_TMemcpy(ncols, ncols_h, HYPRE_Int, last_local_row - first_local_row + 1, memory_location, HYPRE_MEMORY_HOST); - hypre_TMemcpy(rows, rows_h, HYPRE_BigInt, last_local_row - first_local_row + 1, memory_location, HYPRE_MEMORY_HOST); - hypre_TMemcpy(col_inds, col_inds_h, HYPRE_BigInt, last_local_row - first_local_row + 1, memory_location, HYPRE_MEMORY_HOST); - hypre_TMemcpy(values, values_h, HYPRE_Real, last_local_row - first_local_row + 1, memory_location, HYPRE_MEMORY_HOST); + hypre_TMemcpy(ncols, ncols_h, HYPRE_Int, last_local_row - first_local_row + 1, + memory_location, HYPRE_MEMORY_HOST); + hypre_TMemcpy(rows, rows_h, HYPRE_BigInt, last_local_row - first_local_row + 1, + memory_location, HYPRE_MEMORY_HOST); + hypre_TMemcpy(col_inds, col_inds_h, HYPRE_BigInt, last_local_row - first_local_row + 1, + memory_location, HYPRE_MEMORY_HOST); + hypre_TMemcpy(values, values_h, HYPRE_Real, last_local_row - first_local_row + 1, + memory_location, HYPRE_MEMORY_HOST); hypre_TFree(ncols_h, HYPRE_MEMORY_HOST); hypre_TFree(rows_h, HYPRE_MEMORY_HOST); @@ -2682,15 +3298,15 @@ main( hypre_int argc, /*----------------------------------------------------------- * Set up the interp vector *-----------------------------------------------------------*/ - if ( build_rbm) + if (build_rbm) { char new_file_name[80]; /* RHS */ interp_vecs = hypre_CTAlloc(HYPRE_ParVector, num_interp_vecs, HYPRE_MEMORY_HOST); ij_rbm = hypre_CTAlloc(HYPRE_IJVector, num_interp_vecs, HYPRE_MEMORY_HOST); - for (i=0; i < num_interp_vecs; i++) + for (i = 0; i < num_interp_vecs; i++) { - hypre_sprintf(new_file_name, "%s.%d", argv[build_rbm_index],i); + hypre_sprintf(new_file_name, "%s.%d", argv[build_rbm_index], i); ierr = HYPRE_IJVectorRead( new_file_name, hypre_MPI_COMM_WORLD, HYPRE_PARCSR, &ij_rbm[i] ); ierr = HYPRE_IJVectorGetObject( ij_rbm[i], &object ); @@ -2734,13 +3350,60 @@ main( hypre_int argc, } } + /* Print matrix information */ + if (print_matrix_info) + { + HYPRE_BigInt global_num_rows, global_num_cols, global_num_nonzeros; + + if (parcsr_A) + { + HYPRE_BigInt ilower, iupper, jlower, jupper; + + HYPRE_ParCSRMatrixGetLocalRange(parcsr_A, &ilower, &iupper, &jlower, &jupper); + HYPRE_IJMatrixCreate(comm, ilower, iupper, jlower, jupper, &ij_A); + HYPRE_IJMatrixSetObjectType(ij_A, HYPRE_PARCSR); + hypre_IJMatrixObject(ij_A) = parcsr_A; + hypre_IJMatrixAssembleFlag(ij_A) = 1; + } + + HYPRE_IJMatrixGetGlobalInfo(ij_A, + &global_num_rows, + &global_num_cols, + &global_num_nonzeros); + + if (parcsr_A) + { + hypre_IJMatrixObject(ij_A) = NULL; + HYPRE_IJMatrixDestroy(ij_A); + } + + if (myid == 0) + { + hypre_printf(" Matrix Information:\n"); + hypre_printf(" Global number of rows: %b\n", global_num_rows); + hypre_printf(" Global number of columns: %b\n", global_num_cols); + hypre_printf(" Global number of nonzeros: %b\n", global_num_nonzeros); + } + } + /*----------------------------------------------------------- * Set up the RHS and initial guess *-----------------------------------------------------------*/ time_index = hypre_InitializeTiming("RHS and Initial Guess"); hypre_BeginTiming(time_index); - if ( build_rhs_type == 0 ) + if (myid == 0) + { + hypre_printf(" Number of vector components: %d\n", num_components); + } + + if (num_components > 1 && !(build_rhs_type > 1 && build_rhs_type < 6)) + { + hypre_printf("num_components > 1 not implemented for this RHS choice!\n"); + hypre_MPI_Abort(comm, 1); + } + + if (build_rhs_type == 0 || build_rhs_type == -2) { if (myid == 0) { @@ -2749,8 +3412,19 @@ main( hypre_int argc, } /* RHS */ - ierr = HYPRE_IJVectorRead( argv[build_rhs_arg_index], hypre_MPI_COMM_WORLD, - HYPRE_PARCSR, &ij_b ); + if (!build_rhs_type) + { + ierr = HYPRE_IJVectorRead(argv[build_rhs_arg_index], + hypre_MPI_COMM_WORLD, + HYPRE_PARCSR, &ij_b); + } + else + { + ierr = HYPRE_IJVectorReadBinary(argv[build_rhs_arg_index], + hypre_MPI_COMM_WORLD, + HYPRE_PARCSR, &ij_b); + } + if (ierr) { hypre_printf("ERROR: Problem reading in the right-hand-side!\n"); @@ -2768,7 +3442,7 @@ main( hypre_int argc, ierr = HYPRE_IJVectorGetObject( ij_x, &object ); x = (HYPRE_ParVector) object; } - else if ( build_rhs_type == 1 ) + else if (build_rhs_type == 1) { if (myid == 0) { @@ -2788,57 +3462,48 @@ main( hypre_int argc, ierr = HYPRE_IJVectorGetObject( ij_x, &object ); x = (HYPRE_ParVector) object; } - else if (build_rhs_type == 7) - { - if (myid == 0) - { - hypre_printf(" RHS vector read from file %s\n", argv[build_rhs_arg_index]); - hypre_printf(" Initial guess is 0\n"); - } - - ij_b = NULL; - ReadParVectorFromFile(argc, argv, build_rhs_arg_index, &b); - - /* initial guess */ - HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_col, last_local_col, &ij_x); - HYPRE_IJVectorSetObjectType(ij_x, HYPRE_PARCSR); - HYPRE_IJVectorInitialize(ij_x); - HYPRE_IJVectorAssemble(ij_x); - - ierr = HYPRE_IJVectorGetObject( ij_x, &object ); - x = (HYPRE_ParVector) object; - } - else if ( build_rhs_type == 2 ) + else if (build_rhs_type == 2) { if (myid == 0) { - hypre_printf(" RHS vector has unit components\n"); + hypre_printf(" RHS vector has unit coefficients\n"); hypre_printf(" Initial guess is 0\n"); } - HYPRE_Real *values_h = hypre_CTAlloc(HYPRE_Real, local_num_rows, HYPRE_MEMORY_HOST); - HYPRE_Real *values_d = hypre_CTAlloc(HYPRE_Real, local_num_rows, memory_location); + HYPRE_Complex *values_h = hypre_CTAlloc(HYPRE_Real, local_num_rows, HYPRE_MEMORY_HOST); + HYPRE_Complex *values_d = hypre_CTAlloc(HYPRE_Real, local_num_rows, memory_location); for (i = 0; i < local_num_rows; i++) { values_h[i] = 1.0; } - hypre_TMemcpy(values_d, values_h, HYPRE_Real, local_num_rows, memory_location, HYPRE_MEMORY_HOST); + hypre_TMemcpy(values_d, values_h, HYPRE_Complex, local_num_rows, + memory_location, HYPRE_MEMORY_HOST); /* RHS */ HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_row, last_local_row, &ij_b); HYPRE_IJVectorSetObjectType(ij_b, HYPRE_PARCSR); + HYPRE_IJVectorSetNumComponents(ij_b, num_components); HYPRE_IJVectorInitialize_v2(ij_b, memory_location); - HYPRE_IJVectorSetValues(ij_b, local_num_rows, NULL, values_d); + for (c = 0; c < num_components; c++) + { + HYPRE_IJVectorSetComponent(ij_b, c); + HYPRE_IJVectorSetValues(ij_b, local_num_rows, NULL, values_d); + } HYPRE_IJVectorAssemble(ij_b); ierr = HYPRE_IJVectorGetObject( ij_b, &object ); b = (HYPRE_ParVector) object; - hypre_Memset(values_d, 0, local_num_rows*sizeof(HYPRE_Real), HYPRE_MEMORY_DEVICE); /* Initial guess */ + hypre_Memset(values_d, 0, local_num_rows * sizeof(HYPRE_Complex), memory_location); HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_col, last_local_col, &ij_x); HYPRE_IJVectorSetObjectType(ij_x, HYPRE_PARCSR); + HYPRE_IJVectorSetNumComponents(ij_x, num_components); HYPRE_IJVectorInitialize_v2(ij_x, memory_location); - HYPRE_IJVectorSetValues(ij_x, local_num_cols, NULL, values_d); + for (c = 0; c < num_components; c++) + { + HYPRE_IJVectorSetComponent(ij_x, c); + HYPRE_IJVectorSetValues(ij_x, local_num_cols, NULL, values_d); + } HYPRE_IJVectorAssemble(ij_x); ierr = HYPRE_IJVectorGetObject( ij_x, &object ); x = (HYPRE_ParVector) object; @@ -2846,33 +3511,35 @@ main( hypre_int argc, hypre_TFree(values_h, HYPRE_MEMORY_HOST); hypre_TFree(values_d, memory_location); } - else if ( build_rhs_type == 3 ) + else if (build_rhs_type == 3) { if (myid == 0) { - hypre_printf(" RHS vector has random components and unit 2-norm\n"); + hypre_printf(" RHS vector has random coefficients and unit 2-norm\n"); hypre_printf(" Initial guess is 0\n"); } /* RHS */ HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_row, last_local_row, &ij_b); HYPRE_IJVectorSetObjectType(ij_b, HYPRE_PARCSR); + HYPRE_IJVectorSetNumComponents(ij_b, num_components); HYPRE_IJVectorInitialize(ij_b); ierr = HYPRE_IJVectorGetObject( ij_b, &object ); b = (HYPRE_ParVector) object; /* For purposes of this test, HYPRE_ParVector functions are used, but these are not necessary. For a clean use of the interface, the user - "should" modify components of ij_x by using functions + "should" modify coefficients of ij_x by using functions HYPRE_IJVectorSetValues or HYPRE_IJVectorAddToValues */ HYPRE_ParVectorSetRandomValues(b, 22775); - HYPRE_ParVectorInnerProd(b,b,&norm); - norm = 1./sqrt(norm); + HYPRE_ParVectorInnerProd(b, b, &norm); + norm = 1. / hypre_sqrt(norm); ierr = HYPRE_ParVectorScale(norm, b); /* Initial guess */ HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_col, last_local_col, &ij_x); + HYPRE_IJVectorSetNumComponents(ij_x, num_components); HYPRE_IJVectorSetObjectType(ij_x, HYPRE_PARCSR); HYPRE_IJVectorInitialize(ij_x); HYPRE_IJVectorAssemble(ij_x); @@ -2880,38 +3547,44 @@ main( hypre_int argc, ierr = HYPRE_IJVectorGetObject( ij_x, &object ); x = (HYPRE_ParVector) object; } - else if ( build_rhs_type == 4 ) + else if (build_rhs_type == 4) { if (myid == 0) { - hypre_printf(" RHS vector set for solution with unit components\n"); + hypre_printf(" RHS vector set for solution with unit coefficients\n"); hypre_printf(" Initial guess is 0\n"); } - /* Temporary use of solution vector */ - HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_col, last_local_col, &ij_x); - HYPRE_IJVectorSetObjectType(ij_x, HYPRE_PARCSR); - HYPRE_IJVectorInitialize(ij_x); - HYPRE_Real *values_h = hypre_CTAlloc(HYPRE_Real, local_num_cols, HYPRE_MEMORY_HOST); HYPRE_Real *values_d = hypre_CTAlloc(HYPRE_Real, local_num_cols, memory_location); for (i = 0; i < local_num_cols; i++) { values_h[i] = 1.; } - hypre_TMemcpy(values_d, values_h, HYPRE_Real, local_num_cols, memory_location, HYPRE_MEMORY_HOST); + hypre_TMemcpy(values_d, values_h, HYPRE_Real, local_num_cols, + memory_location, HYPRE_MEMORY_HOST); - HYPRE_IJVectorSetValues(ij_x, local_num_cols, NULL, values_d); + /* Temporary use of solution vector */ + HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_col, last_local_col, &ij_x); + HYPRE_IJVectorSetObjectType(ij_x, HYPRE_PARCSR); + HYPRE_IJVectorSetNumComponents(ij_x, num_components); + HYPRE_IJVectorInitialize(ij_x); + for (c = 0; c < num_components; c++) + { + HYPRE_IJVectorSetComponent(ij_x, c); + HYPRE_IJVectorSetValues(ij_x, local_num_cols, NULL, values_d); + } HYPRE_IJVectorAssemble(ij_x); - hypre_TFree(values_h, HYPRE_MEMORY_HOST); - hypre_TFree(values_d, memory_location); - ierr = HYPRE_IJVectorGetObject( ij_x, &object ); x = (HYPRE_ParVector) object; + hypre_TFree(values_h, HYPRE_MEMORY_HOST); + hypre_TFree(values_d, memory_location); + /* RHS */ HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_row, last_local_row, &ij_b); HYPRE_IJVectorSetObjectType(ij_b, HYPRE_PARCSR); + HYPRE_IJVectorSetNumComponents(ij_b, num_components); HYPRE_IJVectorInitialize(ij_b); ierr = HYPRE_IJVectorGetObject( ij_b, &object ); b = (HYPRE_ParVector) object; @@ -2921,17 +3594,27 @@ main( hypre_int argc, /* Zero initial guess */ hypre_IJVectorZeroValues(ij_x); } - else if ( build_rhs_type == 5 ) + else if (build_rhs_type == 5) { if (myid == 0) { hypre_printf(" RHS vector is 0\n"); - hypre_printf(" Initial guess has unit components\n"); + hypre_printf(" Initial guess has unit coefficients\n"); + } + + HYPRE_Real *values_h = hypre_CTAlloc(HYPRE_Real, local_num_cols, HYPRE_MEMORY_HOST); + HYPRE_Real *values_d = hypre_CTAlloc(HYPRE_Real, local_num_cols, memory_location); + for (i = 0; i < local_num_cols; i++) + { + values_h[i] = 1.; } + hypre_TMemcpy(values_d, values_h, HYPRE_Real, local_num_cols, + memory_location, HYPRE_MEMORY_HOST); /* RHS */ HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_row, last_local_row, &ij_b); HYPRE_IJVectorSetObjectType(ij_b, HYPRE_PARCSR); + HYPRE_IJVectorSetNumComponents(ij_b, num_components); HYPRE_IJVectorInitialize(ij_b); HYPRE_IJVectorAssemble(ij_b); @@ -2940,45 +3623,72 @@ main( hypre_int argc, /* Initial guess */ HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_col, last_local_col, &ij_x); + HYPRE_IJVectorSetNumComponents(ij_x, num_components); HYPRE_IJVectorSetObjectType(ij_x, HYPRE_PARCSR); HYPRE_IJVectorInitialize(ij_x); - - HYPRE_Real *values_h = hypre_CTAlloc(HYPRE_Real, local_num_cols, HYPRE_MEMORY_HOST); - HYPRE_Real *values_d = hypre_CTAlloc(HYPRE_Real, local_num_cols, memory_location); - for (i = 0; i < local_num_cols; i++) + for (c = 0; c < num_components; c++) { - values_h[i] = 1.; + HYPRE_IJVectorSetComponent(ij_x, c); + HYPRE_IJVectorSetValues(ij_x, local_num_cols, NULL, values_d); } - hypre_TMemcpy(values_d, values_h, HYPRE_Real, local_num_cols, memory_location, HYPRE_MEMORY_HOST); - - HYPRE_IJVectorSetValues(ij_x, local_num_cols, NULL, values_d); HYPRE_IJVectorAssemble(ij_x); - hypre_TFree(values_h, HYPRE_MEMORY_HOST); - hypre_TFree(values_d, memory_location); - ierr = HYPRE_IJVectorGetObject( ij_x, &object ); x = (HYPRE_ParVector) object; + + hypre_TFree(values_h, HYPRE_MEMORY_HOST); + hypre_TFree(values_d, memory_location); } - else if ( build_rhs_type == 6) + else if (build_rhs_type == 6) { ij_b = NULL; } - - if ( build_src_type == 0) + else if (build_rhs_type == 7) { if (myid == 0) { - hypre_printf(" Source vector read from file %s\n", argv[build_src_arg_index]); - hypre_printf(" Initial unknown vector in evolution is 0\n"); + hypre_printf(" RHS vector read from file %s\n", argv[build_rhs_arg_index]); + hypre_printf(" Initial guess is 0\n"); } - ierr = HYPRE_IJVectorRead( argv[build_src_arg_index], hypre_MPI_COMM_WORLD, - HYPRE_PARCSR, &ij_b ); - if (ierr) - { - hypre_printf("ERROR: Problem reading in the right-hand-side!\n"); - exit(1); - } + ij_b = NULL; + ReadParVectorFromFile(argc, argv, build_rhs_arg_index, &b); + + /* initial guess */ + HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_col, last_local_col, &ij_x); + HYPRE_IJVectorSetObjectType(ij_x, HYPRE_PARCSR); + HYPRE_IJVectorInitialize(ij_x); + HYPRE_IJVectorAssemble(ij_x); + + ierr = HYPRE_IJVectorGetObject( ij_x, &object ); + x = (HYPRE_ParVector) object; + } + else + { + if (build_rhs_type != -1) + { + if (myid == 0) + { + hypre_printf("Error: Invalid build_rhs_type!\n"); + } + hypre_MPI_Abort(comm, 1); + } + } + + if ( build_src_type == 0) + { + if (myid == 0) + { + hypre_printf(" Source vector read from file %s\n", argv[build_src_arg_index]); + hypre_printf(" Initial unknown vector in evolution is 0\n"); + } + + ierr = HYPRE_IJVectorRead( argv[build_src_arg_index], hypre_MPI_COMM_WORLD, + HYPRE_PARCSR, &ij_b ); + if (ierr) + { + hypre_printf("ERROR: Problem reading in the right-hand-side!\n"); + exit(1); + } ierr = HYPRE_IJVectorGetObject( ij_b, &object ); b = (HYPRE_ParVector) object; @@ -3009,7 +3719,7 @@ main( hypre_int argc, { if (myid == 0) { - hypre_printf(" Source vector has unit components\n"); + hypre_printf(" Source vector has unit coefficients\n"); hypre_printf(" Initial unknown vector is 0\n"); } @@ -3024,7 +3734,8 @@ main( hypre_int argc, { values_h[i] = 1.; } - hypre_TMemcpy(values_d, values_h, HYPRE_Real, local_num_rows, memory_location, HYPRE_MEMORY_HOST); + hypre_TMemcpy(values_d, values_h, HYPRE_Real, local_num_rows, + memory_location, HYPRE_MEMORY_HOST); HYPRE_IJVectorSetValues(ij_b, local_num_rows, NULL, values_d); HYPRE_IJVectorAssemble(ij_b); @@ -3050,7 +3761,7 @@ main( hypre_int argc, { if (myid == 0) { - hypre_printf(" Source vector has random components in range 0 - 1\n"); + hypre_printf(" Source vector has random coefficients in range 0 - 1\n"); hypre_printf(" Initial unknown vector is 0\n"); } @@ -3093,7 +3804,7 @@ main( hypre_int argc, if (myid == 0) { hypre_printf(" Source vector is 0 \n"); - hypre_printf(" Initial unknown vector has random components in range 0 - 1\n"); + hypre_printf(" Initial unknown vector has random coefficients in range 0 - 1\n"); } /* RHS */ @@ -3106,7 +3817,7 @@ main( hypre_int argc, hypre_SeedRand(myid); for (i = 0; i < local_num_rows; i++) { - values_h[i] = hypre_Rand()/dt; + values_h[i] = hypre_Rand() / dt; } hypre_TMemcpy(values_d, values_h, HYPRE_Real, local_num_rows, memory_location, HYPRE_MEMORY_HOST); @@ -3158,7 +3869,7 @@ main( hypre_int argc, random in 0 - 1 here) is usually used as the initial guess */ HYPRE_Real *values_h = hypre_CTAlloc(HYPRE_Real, local_num_cols, HYPRE_MEMORY_HOST); HYPRE_Real *values_d = hypre_CTAlloc(HYPRE_Real, local_num_cols, memory_location); - hypre_SeedRand(myid+2747); + hypre_SeedRand(myid + 2747); hypre_SeedRand(myid); for (i = 0; i < local_num_cols; i++) { @@ -3176,20 +3887,33 @@ main( hypre_int argc, } /* initial guess */ - if ( build_x0_type == 0 ) + if (build_x0_type == 0 || build_x0_type == -2) { /* from file */ if (myid == 0) { hypre_printf(" Initial guess vector read from file %s\n", argv[build_x0_arg_index]); } + /* x0 */ if (ij_x) { HYPRE_IJVectorDestroy(ij_x); } - ierr = HYPRE_IJVectorRead( argv[build_x0_arg_index], hypre_MPI_COMM_WORLD, - HYPRE_PARCSR, &ij_x ); + + if (!build_x0_type) + { + ierr = HYPRE_IJVectorRead(argv[build_x0_arg_index], + hypre_MPI_COMM_WORLD, + HYPRE_PARCSR, &ij_x); + } + else + { + ierr = HYPRE_IJVectorReadBinary(argv[build_x0_arg_index], + hypre_MPI_COMM_WORLD, + HYPRE_PARCSR, &ij_x); + } + if (ierr) { hypre_printf("ERROR: Problem reading in x0!\n"); @@ -3198,6 +3922,16 @@ main( hypre_int argc, ierr = HYPRE_IJVectorGetObject( ij_x, &object ); x = (HYPRE_ParVector) object; } + else if (build_x0_type == 7) + { + /* from file */ + if (myid == 0) + { + hypre_printf(" Initial guess vector read from file %s\n", argv[build_x0_arg_index]); + } + + ReadParVectorFromFile(argc, argv, build_x0_arg_index, &x); + } else if (build_x0_type == 1) { /* random */ @@ -3236,6 +3970,10 @@ main( hypre_int argc, x = (HYPRE_ParVector) object; } + /*----------------------------------------------------------- + * Finalize IJVector Setup timings + *-----------------------------------------------------------*/ + hypre_EndTiming(time_index); hypre_PrintTiming("IJ Vector Setup", hypre_MPI_COMM_WORLD); hypre_FinalizeTiming(time_index); @@ -3246,12 +3984,18 @@ main( hypre_int argc, dof_func = NULL; if (build_funcs_type == 1) { - hypre_printf("calling BuildFuncsFromOneFile\n"); + if (myid == 0) + { + hypre_printf(" Calling BuildFuncsFromOneFile\n"); + } BuildFuncsFromOneFile(argc, argv, build_funcs_arg_index, parcsr_A, &dof_func); } else if (build_funcs_type == 2) { - hypre_printf("calling BuildFuncsFromOneFiles\n"); + if (myid == 0) + { + hypre_printf(" Calling BuildFuncsFromFiles\n"); + } BuildFuncsFromFiles(argc, argv, build_funcs_arg_index, parcsr_A, &dof_func); } else @@ -3282,6 +4026,29 @@ main( hypre_int argc, { hypre_ParCSRMatrixPrintIJ(parcsr_A, 0, 0, "IJ.out.A"); } + else + { + if (!myid) + { + hypre_printf(" Matrix A not found!\n"); + } + } + + if (parcsr_M != parcsr_A) + { + if (ij_M) + { + HYPRE_IJMatrixPrint(ij_M, "IJ.out.M"); + } + else + { + if (!myid) + { + hypre_printf(" Matrix M not found!\n"); + } + } + } + if (ij_b) { HYPRE_IJVectorPrint(ij_b, "IJ.out.b"); @@ -3293,32 +4060,214 @@ main( hypre_int argc, HYPRE_IJVectorPrint(ij_x, "IJ.out.x0"); } + if (print_system_binary) + { + if (ij_A) + { + HYPRE_IJMatrixPrintBinary(ij_A, "IJ.out.A"); + } + else + { + hypre_ParCSRMatrixPrintBinaryIJ(parcsr_A, 0, 0, "IJ.out.A"); + } + + if (ij_b) + { + HYPRE_IJVectorPrintBinary(ij_b, "IJ.out.b"); + } + else if (b) + { + HYPRE_ParVectorPrintBinaryIJ(b, "IJ.out.b"); + } + + if (ij_x) + { + HYPRE_IJVectorPrintBinary(ij_x, "IJ.out.x0"); + } + else if (x) + { + HYPRE_ParVectorPrintBinaryIJ(x, "IJ.out.x0"); + } + } + /*----------------------------------------------------------- * Migrate the system to the wanted memory space *-----------------------------------------------------------*/ + hypre_ParCSRMatrixMigrate(parcsr_A, hypre_HandleMemoryLocation(hypre_handle())); hypre_ParVectorMigrate(b, hypre_HandleMemoryLocation(hypre_handle())); hypre_ParVectorMigrate(x, hypre_HandleMemoryLocation(hypre_handle())); + if (build_matrix_M == 1) + { + hypre_ParCSRMatrixMigrate(parcsr_M, hypre_HandleMemoryLocation(hypre_handle())); + } + + if (benchmark) + { + poutusr = 1; + poutdat = 0; + second_time = 1; + } /* save the initial guess for the 2nd time */ -#if SECOND_TIME - x0_save = hypre_ParVectorCloneDeep_v2(x, hypre_ParVectorMemoryLocation(x)); -#endif + if (second_time) + { + x0_save = hypre_ParVectorCloneDeep_v2(x, hypre_ParVectorMemoryLocation(x)); + } + + /* Compute RHS squared norm */ + if (ij_b) + { + HYPRE_IJVectorInnerProd(ij_b, ij_b, &b_dot_b); + } + else if (b) + { + HYPRE_ParVectorInnerProd(b, b, &b_dot_b); + } + else + { + if (!myid) + { + hypre_printf(" Error: Vector b not set!\n"); + } + hypre_MPI_Abort(comm, 1); + } /*----------------------------------------------------------- - * Solve the system using the hybrid solver + * Test multivector support + *-----------------------------------------------------------*/ + + if (test_multivec && ij_b && num_components > 1) + { + HYPRE_IJVector ij_bf; + HYPRE_Complex *d_data_full; + HYPRE_Real bf_dot_bf, e_dot_e; + HYPRE_Int num_rows_full = local_num_rows * num_components; + HYPRE_BigInt ilower = first_local_row * num_components; + HYPRE_BigInt iupper = ilower + (HYPRE_BigInt) num_rows_full - 1; + + /* Allocate memory */ + d_data_full = hypre_CTAlloc(HYPRE_Complex, num_rows_full, memory_location); + + /* Get values */ + for (c = 0; c < num_components; c++) + { + HYPRE_IJVectorSetComponent(ij_b, c); + HYPRE_IJVectorGetValues(ij_b, local_num_rows, NULL, + &d_data_full[c * local_num_rows]); + } + + /* Create a single component vector containing all values of b */ + HYPRE_IJVectorCreate(comm, ilower, iupper, &ij_bf); + HYPRE_IJVectorSetObjectType(ij_bf, HYPRE_PARCSR); + HYPRE_IJVectorInitialize(ij_bf); + HYPRE_IJVectorSetValues(ij_bf, num_rows_full, NULL, d_data_full); + HYPRE_IJVectorAssemble(ij_bf); + HYPRE_IJVectorInnerProd(ij_bf, ij_bf, &bf_dot_bf); + + e_dot_e = bf_dot_bf - b_dot_b; + if (myid == 0) + { + hypre_printf("\nVector/Multivector error = %e\n\n", e_dot_e); + } + + /* Free memory */ + hypre_TFree(d_data_full, memory_location); + HYPRE_IJVectorDestroy(ij_bf); + } + + /*----------------------------------------------------------- + * Test matrix scaling: B = diag(ld) * A * diag(rd) + *-----------------------------------------------------------*/ + + if (test_scaling) + { + HYPRE_IJVector ij_ld = NULL; + HYPRE_IJVector ij_rd = NULL; + HYPRE_ParVector par_ld = NULL; + HYPRE_ParVector par_rd = NULL; + HYPRE_Complex *d_data; + HYPRE_Int scaling_type; + + time_index = hypre_InitializeTiming("ParCSR scaling"); + hypre_BeginTiming(time_index); + + /* Allocate memory */ + d_data = hypre_TAlloc(HYPRE_Complex, local_num_rows, memory_location); + + /* Select scaling type: + left OR right scaling: diag inverse (2) + left AND right scaling: diag inverse sqrt (3) */ + scaling_type = (test_scaling == 1 || test_scaling == 2) ? 2 : 3; + + /* Compute scaling vector */ + hypre_CSRMatrixExtractDiagonal(hypre_ParCSRMatrixDiag(parcsr_A), d_data, scaling_type); + + /* Create diagonal scaling matrix diag(ld) */ + if (test_scaling != 2) + { + HYPRE_IJVectorCreate(comm, first_local_row, last_local_row, &ij_ld); + HYPRE_IJVectorSetObjectType(ij_ld, HYPRE_PARCSR); + HYPRE_IJVectorInitialize(ij_ld); + HYPRE_IJVectorSetValues(ij_ld, local_num_rows, NULL, d_data); + HYPRE_IJVectorAssemble(ij_ld); + HYPRE_IJVectorGetObject(ij_ld, &object); + par_ld = (HYPRE_ParVector) object; + } + + /* Create diagonal scaling matrix diag(rd) */ + if (test_scaling != 1) + { + HYPRE_IJVectorCreate(comm, first_local_row, last_local_row, &ij_rd); + HYPRE_IJVectorSetObjectType(ij_rd, HYPRE_PARCSR); + HYPRE_IJVectorInitialize(ij_rd); + HYPRE_IJVectorSetValues(ij_rd, local_num_rows, NULL, d_data); + HYPRE_IJVectorAssemble(ij_rd); + HYPRE_IJVectorGetObject(ij_rd, &object); + par_rd = (HYPRE_ParVector) object; + } + + /* Compute A = diag(ld) * A * diag(rd) */ + hypre_ParCSRMatrixDiagScale(parcsr_A, par_ld, par_rd); + + /* Print scaled matrix */ + if (print_system) + { + hypre_ParCSRMatrixPrintIJ(parcsr_A, 0, 0, "IJ.out.Ascal"); + HYPRE_IJVectorPrint(ij_ld, "IJ.out.ld"); + HYPRE_IJVectorPrint(ij_rd, "IJ.out.rd"); + } + + /* Free memory */ + hypre_TFree(d_data, memory_location); + if (ij_rd) + { + HYPRE_IJVectorDestroy(ij_rd); + } + if (ij_ld) + { + HYPRE_IJVectorDestroy(ij_ld); + } + + hypre_EndTiming(time_index); + hypre_PrintTiming("ParCSR scaling", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + } + + /*----------------------------------------------------------- + * Perform sparse matrix/vector multiplication *-----------------------------------------------------------*/ if (solver_id == -1) { - HYPRE_Int nmv = 100; HYPRE_Int num_threads = hypre_NumThreads(); if (myid == 0) { hypre_printf("Running %d matvecs with A\n", nmv); - hypre_printf("\n\n Num MPI tasks = %d\n\n",num_procs); - hypre_printf(" Num OpenMP threads = %d\n\n",num_threads); + hypre_printf("\n\n Num MPI tasks = %d\n\n", num_procs); + hypre_printf(" Num OpenMP threads = %d\n\n", num_threads); } HYPRE_Real tt = hypre_MPI_Wtime(); @@ -3331,10 +4280,6 @@ main( hypre_int argc, HYPRE_ParCSRMatrixMatvec(1., parcsr_A, x, 0., b); } -#if defined(HYPRE_USING_GPU) - hypre_SyncCudaDevice(hypre_handle()); -#endif - hypre_EndTiming(time_index); hypre_PrintTiming("MatVec Test", hypre_MPI_COMM_WORLD); hypre_FinalizeTiming(time_index); @@ -3344,15 +4289,19 @@ main( hypre_int argc, if (myid == 0) { - hypre_printf("Matvec time %.2f (ms)\n", tt*1000.0); + hypre_printf("Matvec time %.2f (ms)\n", tt * 1000.0); } goto final; } + /*----------------------------------------------------------- + * Solve the system using the hybrid solver + *-----------------------------------------------------------*/ + if (solver_id == 20) { - if (myid == 0) hypre_printf("Solver: AMG\n"); + if (myid == 0) { hypre_printf("Solver: AMG\n"); } time_index = hypre_InitializeTiming("AMG_hybrid Setup"); hypre_BeginTiming(time_index); @@ -3375,18 +4324,24 @@ main( hypre_int argc, HYPRE_ParCSRHybridSetNumSweeps(amg_solver, num_sweeps); HYPRE_ParCSRHybridSetInterpType(amg_solver, interp_type); - if (relax_type > -1) HYPRE_ParCSRHybridSetRelaxType(amg_solver, relax_type); + if (relax_type > -1) { HYPRE_ParCSRHybridSetRelaxType(amg_solver, relax_type); } HYPRE_ParCSRHybridSetAggNumLevels(amg_solver, agg_num_levels); HYPRE_ParCSRHybridSetAggInterpType(amg_solver, agg_interp_type); HYPRE_ParCSRHybridSetNumPaths(amg_solver, num_paths); HYPRE_ParCSRHybridSetNumFunctions(amg_solver, num_functions); HYPRE_ParCSRHybridSetNodal(amg_solver, nodal); if (relax_down > -1) + { HYPRE_ParCSRHybridSetCycleRelaxType(amg_solver, relax_down, 1); + } if (relax_up > -1) + { HYPRE_ParCSRHybridSetCycleRelaxType(amg_solver, relax_up, 2); + } if (relax_coarse > -1) + { HYPRE_ParCSRHybridSetCycleRelaxType(amg_solver, relax_coarse, 3); + } HYPRE_ParCSRHybridSetRelaxOrder(amg_solver, relax_order); HYPRE_ParCSRHybridSetKeepTranspose(amg_solver, keepTranspose); HYPRE_ParCSRHybridSetMaxCoarseSize(amg_solver, coarse_threshold); @@ -3395,12 +4350,16 @@ main( hypre_int argc, HYPRE_ParCSRHybridSetRelaxWt(amg_solver, relax_wt); HYPRE_ParCSRHybridSetOuterWt(amg_solver, outer_wt); if (level_w > -1) + { HYPRE_ParCSRHybridSetLevelRelaxWt(amg_solver, relax_wt_level, level_w); + } if (level_ow > -1) + { HYPRE_ParCSRHybridSetLevelOuterWt(amg_solver, outer_wt_level, level_ow); + } HYPRE_ParCSRHybridSetNonGalerkinTol(amg_solver, nongalerk_num_tol, nongalerk_tol); - HYPRE_ParCSRHybridSetup(amg_solver, parcsr_A, b, x); + HYPRE_ParCSRHybridSetup(amg_solver, parcsr_M, b, x); hypre_EndTiming(time_index); hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); @@ -3417,27 +4376,45 @@ main( hypre_int argc, hypre_FinalizeTiming(time_index); hypre_ClearTiming(); - HYPRE_ParCSRHybridGetNumIterations(amg_solver, &num_iterations); - HYPRE_ParCSRHybridGetPCGNumIterations(amg_solver, &pcg_num_its); - HYPRE_ParCSRHybridGetDSCGNumIterations(amg_solver, &dscg_num_its); - HYPRE_ParCSRHybridGetFinalRelativeResidualNorm(amg_solver, - &final_res_norm); - - if (myid == 0) + if (second_time) { - hypre_printf("\n"); - hypre_printf("Iterations = %d\n", num_iterations); - hypre_printf("PCG_Iterations = %d\n", pcg_num_its); - hypre_printf("DSCG_Iterations = %d\n", dscg_num_its); - hypre_printf("Final Relative Residual Norm = %e\n", final_res_norm); - hypre_printf("\n"); - } + /* run a second time [for timings, to check for memory leaks] */ + HYPRE_ParVectorSetRandomValues(x, 775); +#if defined(HYPRE_USING_CURAND) || defined(HYPRE_USING_ROCRAND) + hypre_ResetDeviceRandGenerator(1234ULL, 0ULL); +#endif + hypre_ParVectorCopy(x0_save, x); -#if SECOND_TIME - /* run a second time to check for memory leaks */ - hypre_ParVectorCopy(x0_save, x); - HYPRE_ParCSRHybridSetup(amg_solver, parcsr_A, b, x); - HYPRE_ParCSRHybridSolve(amg_solver, parcsr_A, b, x); + if (myid == 0) { hypre_printf("Solver: AMG\n"); } + time_index = hypre_InitializeTiming("AMG_hybrid Setup"); + hypre_BeginTiming(time_index); + + HYPRE_ParCSRHybridSetup(amg_solver, parcsr_M, b, x); + + hypre_EndTiming(time_index); + hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + time_index = hypre_InitializeTiming("ParCSR Hybrid Solve"); + hypre_BeginTiming(time_index); + + HYPRE_ParCSRHybridSolve(amg_solver, parcsr_A, b, x); + + hypre_EndTiming(time_index); + hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + HYPRE_Real time[4]; + HYPRE_ParCSRHybridGetSetupSolveTime(amg_solver, time); + + if (myid == 0) + { + hypre_printf("ParCSRHybrid: Setup-Time1 %f Solve-Time1 %f Setup-Time2 %f Solve-Time2 %f\n", + time[0], time[1], time[2], time[3]); + } + } HYPRE_ParCSRHybridGetNumIterations(amg_solver, &num_iterations); HYPRE_ParCSRHybridGetPCGNumIterations(amg_solver, &pcg_num_its); @@ -3454,15 +4431,6 @@ main( hypre_int argc, hypre_printf("\n"); } - HYPRE_Real time[4]; - HYPRE_ParCSRHybridGetSetupSolveTime(amg_solver, time); - if (myid == 0) - { - printf("ParCSRHybrid: Setup-Time1 %f Solve-Time1 %f Setup-Time2 %f Solve-Time2 %f\n", - time[0], time[1], time[2], time[3]); - } -#endif - HYPRE_ParCSRHybridDestroy(amg_solver); } /*----------------------------------------------------------- @@ -3471,9 +4439,11 @@ main( hypre_int argc, if (solver_id == 0 || solver_id == 90) { + HYPRE_ANNOTATE_REGION_BEGIN("%s", "Run-1"); + if (solver_id == 0) { - if (myid == 0) hypre_printf("Solver: AMG\n"); + if (myid == 0) { hypre_printf("Solver: AMG\n"); } time_index = hypre_InitializeTiming("BoomerAMG Setup"); hypre_BeginTiming(time_index); @@ -3481,7 +4451,7 @@ main( hypre_int argc, } else if (solver_id == 90) { - if (myid == 0) hypre_printf("Solver: AMG-DD\n"); + if (myid == 0) { hypre_printf("Solver: AMG-DD\n"); } time_index = hypre_InitializeTiming("BoomerAMGDD Setup"); hypre_BeginTiming(time_index); @@ -3535,7 +4505,7 @@ main( hypre_int argc, HYPRE_BoomerAMGSetJacobiTruncThreshold(amg_solver, jacobi_trunc_threshold); HYPRE_BoomerAMGSetSCommPkgSwitch(amg_solver, S_commpkg_switch); /* note: log is written to standard output, not to file */ - HYPRE_BoomerAMGSetPrintLevel(amg_solver, 3); + HYPRE_BoomerAMGSetPrintLevel(amg_solver, poutusr ? poutdat : 3); //HYPRE_BoomerAMGSetLogging(amg_solver, 2); HYPRE_BoomerAMGSetPrintFileName(amg_solver, "driver.out.log"); HYPRE_BoomerAMGSetCycleType(amg_solver, cycle_type); @@ -3546,13 +4516,19 @@ main( hypre_int argc, HYPRE_BoomerAMGSetCRRate(amg_solver, CR_rate); HYPRE_BoomerAMGSetCRStrongTh(amg_solver, CR_strong_th); HYPRE_BoomerAMGSetCRUseCG(amg_solver, CR_use_CG); - if (relax_type > -1) HYPRE_BoomerAMGSetRelaxType(amg_solver, relax_type); + if (relax_type > -1) { HYPRE_BoomerAMGSetRelaxType(amg_solver, relax_type); } if (relax_down > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(amg_solver, relax_down, 1); + } if (relax_up > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(amg_solver, relax_up, 2); + } if (relax_coarse > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(amg_solver, relax_coarse, 3); + } HYPRE_BoomerAMGSetAddRelaxType(amg_solver, add_relax_type); HYPRE_BoomerAMGSetAddRelaxWt(amg_solver, add_relax_wt); HYPRE_BoomerAMGSetChebyOrder(amg_solver, cheby_order); @@ -3565,9 +4541,13 @@ main( hypre_int argc, HYPRE_BoomerAMGSetOuterWt(amg_solver, outer_wt); HYPRE_BoomerAMGSetMaxLevels(amg_solver, max_levels); if (level_w > -1) + { HYPRE_BoomerAMGSetLevelRelaxWt(amg_solver, relax_wt_level, level_w); + } if (level_ow > -1) + { HYPRE_BoomerAMGSetLevelOuterWt(amg_solver, outer_wt_level, level_ow); + } HYPRE_BoomerAMGSetSmoothType(amg_solver, smooth_type); HYPRE_BoomerAMGSetSmoothNumSweeps(amg_solver, smooth_num_sweeps); HYPRE_BoomerAMGSetSmoothNumLevels(amg_solver, smooth_num_levels); @@ -3579,7 +4559,7 @@ main( hypre_int argc, HYPRE_BoomerAMGSetSchwarzUseNonSymm(amg_solver, use_nonsymm_schwarz); HYPRE_BoomerAMGSetSchwarzRlxWeight(amg_solver, schwarz_rlx_weight); - if (eu_level < 0) eu_level = 0; + if (eu_level < 0) { eu_level = 0; } HYPRE_BoomerAMGSetEuLevel(amg_solver, eu_level); HYPRE_BoomerAMGSetEuBJ(amg_solver, eu_bj); HYPRE_BoomerAMGSetEuSparseA(amg_solver, eu_sparse_A); @@ -3588,7 +4568,24 @@ main( hypre_int argc, HYPRE_BoomerAMGSetILUDroptol(amg_solver, ilu_droptol); HYPRE_BoomerAMGSetILUMaxRowNnz(amg_solver, ilu_max_row_nnz); HYPRE_BoomerAMGSetILUMaxIter(amg_solver, ilu_sm_max_iter); - + HYPRE_BoomerAMGSetILUTriSolve(amg_solver, ilu_tri_solve); + HYPRE_BoomerAMGSetILULowerJacobiIters(amg_solver, ilu_ljac_iters); + HYPRE_BoomerAMGSetILUUpperJacobiIters(amg_solver, ilu_ujac_iters); + HYPRE_BoomerAMGSetILULocalReordering(amg_solver, ilu_reordering); + HYPRE_BoomerAMGSetILUIterSetupType(amg_solver, ilu_iter_setup_type); + HYPRE_BoomerAMGSetILUIterSetupOption(amg_solver, ilu_iter_setup_option); + HYPRE_BoomerAMGSetILUIterSetupMaxIter(amg_solver, ilu_iter_setup_max_iter); + HYPRE_BoomerAMGSetILUIterSetupTolerance(amg_solver, ilu_iter_setup_tolerance); + HYPRE_BoomerAMGSetFSAIAlgoType(amg_solver, fsai_algo_type); + HYPRE_BoomerAMGSetFSAILocalSolveType(amg_solver, fsai_ls_type); + HYPRE_BoomerAMGSetFSAIMaxSteps(amg_solver, fsai_max_steps); + HYPRE_BoomerAMGSetFSAIMaxStepSize(amg_solver, fsai_max_step_size); + HYPRE_BoomerAMGSetFSAIMaxNnzRow(amg_solver, fsai_max_nnz_row); + HYPRE_BoomerAMGSetFSAINumLevels(amg_solver, fsai_num_levels); + HYPRE_BoomerAMGSetFSAIThreshold(amg_solver, fsai_threshold); + HYPRE_BoomerAMGSetFSAIEigMaxIters(amg_solver, fsai_eig_max_iters); + HYPRE_BoomerAMGSetFSAIKapTolerance(amg_solver, fsai_kap_tolerance); + HYPRE_BoomerAMGSetFilterFunctions(amg_solver, filter_functions); HYPRE_BoomerAMGSetNumFunctions(amg_solver, num_functions); HYPRE_BoomerAMGSetAggNumLevels(amg_solver, agg_num_levels); HYPRE_BoomerAMGSetAggInterpType(amg_solver, agg_interp_type); @@ -3610,7 +4607,9 @@ main( hypre_int argc, HYPRE_BoomerAMGSetCycleNumSweeps(amg_solver, ns_up, 2); } if (num_functions > 1) + { HYPRE_BoomerAMGSetDofFunc(amg_solver, dof_func); + } HYPRE_BoomerAMGSetAdditive(amg_solver, additive); HYPRE_BoomerAMGSetMultAdditive(amg_solver, mult_add); HYPRE_BoomerAMGSetSimple(amg_solver, simple); @@ -3628,9 +4627,11 @@ main( hypre_int argc, /*HYPRE_BoomerAMGSetNonGalerkTol(amg_solver, nongalerk_num_tol, nongalerk_tol);*/ if (nongalerk_tol) { - HYPRE_BoomerAMGSetNonGalerkinTol(amg_solver, nongalerk_tol[nongalerk_num_tol-1]); - for (i=0; i < nongalerk_num_tol-1; i++) + HYPRE_BoomerAMGSetNonGalerkinTol(amg_solver, nongalerk_tol[nongalerk_num_tol - 1]); + for (i = 0; i < nongalerk_num_tol - 1; i++) + { HYPRE_BoomerAMGSetLevelNonGalerkinTol(amg_solver, nongalerk_tol[i], i); + } } if (build_rbm) { @@ -3641,34 +4642,25 @@ main( hypre_int argc, } /* BM Oct 23, 2006 */ - if (plot_grids) { + if (plot_grids) + { HYPRE_BoomerAMGSetPlotGrids (amg_solver, 1); HYPRE_BoomerAMGSetPlotFileName (amg_solver, plot_file_name); HYPRE_BoomerAMGSetCoordDim (amg_solver, coord_dim); HYPRE_BoomerAMGSetCoordinates (amg_solver, coordinates); } - //cudaProfilerStart(); - -#if defined(HYPRE_USING_NVTX) hypre_GpuProfilingPushRange("AMG-Setup-1"); -#endif if (solver_id == 0) { - HYPRE_BoomerAMGSetup(amg_solver, parcsr_A, b, x); + HYPRE_BoomerAMGSetup(amg_solver, parcsr_M, b, x); } else if (solver_id == 90) { - HYPRE_BoomerAMGDDSetup(amgdd_solver, parcsr_A, b, x); + HYPRE_BoomerAMGDDSetup(amgdd_solver, parcsr_M, b, x); } -#if defined(HYPRE_USING_NVTX) hypre_GpuProfilingPopRange(); -#endif - -#if defined(HYPRE_USING_GPU) - hypre_SyncCudaDevice(hypre_handle()); -#endif hypre_EndTiming(time_index); hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); @@ -3685,11 +4677,8 @@ main( hypre_int argc, } hypre_BeginTiming(time_index); -#if defined(HYPRE_USING_NVTX) hypre_GpuProfilingPushRange("AMG-Solve-1"); -#endif - //cudaProfilerStart(); if (solver_id == 0) { HYPRE_BoomerAMGSolve(amg_solver, parcsr_A, b, x); @@ -3698,122 +4687,104 @@ main( hypre_int argc, { HYPRE_BoomerAMGDDSolve(amgdd_solver, parcsr_A, b, x); } - //cudaProfilerStop(); -#if defined(HYPRE_USING_NVTX) hypre_GpuProfilingPopRange(); -#endif - -#if defined(HYPRE_USING_GPU) - hypre_SyncCudaDevice(hypre_handle()); -#endif hypre_EndTiming(time_index); hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); + HYPRE_ANNOTATE_REGION_END("%s", "Run-1"); - if (solver_id == 0) + if (second_time) { - HYPRE_BoomerAMGGetNumIterations(amg_solver, &num_iterations); - HYPRE_BoomerAMGGetFinalRelativeResidualNorm(amg_solver, &final_res_norm); - } - else if (solver_id == 90) - { - HYPRE_BoomerAMGDDGetNumIterations(amgdd_solver, &num_iterations); - HYPRE_BoomerAMGDDGetFinalRelativeResidualNorm(amgdd_solver, &final_res_norm); - } + HYPRE_ANNOTATE_REGION_BEGIN("%s", "Run-2"); + HYPRE_SetExecutionPolicy(exec2_policy); + + /* run a second time [for timings, to check for memory leaks] */ + HYPRE_ParVectorSetRandomValues(x, 775); +#if defined(HYPRE_USING_CURAND) || defined(HYPRE_USING_ROCRAND) + hypre_ResetDeviceRandGenerator(1234ULL, 0ULL); +#endif + hypre_ParVectorCopy(x0_save, x); + +#if defined(HYPRE_USING_CUDA) + cudaProfilerStart(); +#endif + + time_index = hypre_InitializeTiming("BoomerAMG/AMG-DD Setup2"); + hypre_BeginTiming(time_index); + + hypre_GpuProfilingPushRange("AMG-Setup-2"); - if (myid == 0) - { - hypre_printf("\n"); if (solver_id == 0) { - hypre_printf("BoomerAMG Iterations = %d\n", num_iterations); + HYPRE_BoomerAMGSetup(amg_solver, parcsr_M, b, x); } else if (solver_id == 90) { - hypre_printf("BoomerAMG-DD Iterations = %d\n", num_iterations); + HYPRE_BoomerAMGDDSetup(amgdd_solver, parcsr_M, b, x); } - hypre_printf("Final Relative Residual Norm = %e\n", final_res_norm); - hypre_printf("\n"); - } - -#if SECOND_TIME - /* run a second time to check for memory leaks */ - //HYPRE_ParVectorSetRandomValues(x, 775); - hypre_ParVectorCopy(x0_save, x); - - HYPRE_Real tt, maxtt = 0.0, tset = 0.0, tsol = 0.0; - - tt = hypre_MPI_Wtime(); -#if defined(HYPRE_USING_NVTX) - hypre_GpuProfilingPushRange("AMG-Setup-2"); -#endif - - if (solver_id == 0) - { - HYPRE_BoomerAMGSetup(amg_solver, parcsr_A, b, x); - } - else if (solver_id == 90) - { - HYPRE_BoomerAMGDDSetup(amgdd_solver, parcsr_A, b, x); - } + hypre_GpuProfilingPopRange(); -#if defined(HYPRE_USING_NVTX) - hypre_GpuProfilingPopRange(); -#endif + hypre_EndTiming(time_index); + hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); -#if defined(HYPRE_USING_GPU) - hypre_SyncCudaDevice(hypre_handle()); -#endif + time_index = hypre_InitializeTiming("BoomerAMG/AMG-DD Solve2"); + hypre_BeginTiming(time_index); - tt = hypre_MPI_Wtime() - tt; + hypre_GpuProfilingPushRange("AMG-Solve-2"); - hypre_MPI_Reduce(&tt, &maxtt, 1, hypre_MPI_REAL, hypre_MPI_MAX, 0, hypre_MPI_COMM_WORLD); + if (solver_id == 0) + { + HYPRE_BoomerAMGSolve(amg_solver, parcsr_A, b, x); + } + else if (solver_id == 90) + { + HYPRE_BoomerAMGDDSolve(amgdd_solver, parcsr_A, b, x); + } - if (myid == 0) - { - tset = maxtt; - } + hypre_GpuProfilingPopRange(); - tt = hypre_MPI_Wtime(); + hypre_EndTiming(time_index); + hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); -#if defined(HYPRE_USING_NVTX) - hypre_GpuProfilingPushRange("AMG-Solve-2"); + HYPRE_ANNOTATE_REGION_END("%s", "Run-2"); +#if defined(HYPRE_USING_CUDA) + cudaProfilerStop(); #endif + } if (solver_id == 0) { - HYPRE_BoomerAMGSolve(amg_solver, parcsr_A, b, x); + HYPRE_BoomerAMGGetNumIterations(amg_solver, &num_iterations); + HYPRE_BoomerAMGGetFinalRelativeResidualNorm(amg_solver, &final_res_norm); } else if (solver_id == 90) { - HYPRE_BoomerAMGDDSolve(amgdd_solver, parcsr_A, b, x); - } - -#if defined(HYPRE_USING_NVTX) - hypre_GpuProfilingPopRange(); -#endif - -#if defined(HYPRE_USING_GPU) - hypre_SyncCudaDevice(hypre_handle()); -#endif - - tt = hypre_MPI_Wtime() - tt; - - hypre_MPI_Reduce(&tt, &maxtt, 1, hypre_MPI_REAL, hypre_MPI_MAX, 0, hypre_MPI_COMM_WORLD); + HYPRE_BoomerAMGDDGetNumIterations(amgdd_solver, &num_iterations); + HYPRE_BoomerAMGDDGetFinalRelativeResidualNorm(amgdd_solver, &final_res_norm); + } if (myid == 0) { - tsol = maxtt; - hypre_printf("AMG Setup time %.2f (s)\n", tset); - hypre_printf("AMG Solve time %.2f (s)\n", tsol); + hypre_printf("\n"); + if (solver_id == 0) + { + hypre_printf("BoomerAMG Iterations = %d\n", num_iterations); + } + else if (solver_id == 90) + { + hypre_printf("BoomerAMG-DD Iterations = %d\n", num_iterations); + } + hypre_printf("Final Relative Residual Norm = %e\n", final_res_norm); + hypre_printf("\n"); } -#endif // SECOND_TIME - - //cudaProfilerStop(); if (solver_id == 0) { @@ -3835,7 +4806,7 @@ main( hypre_int argc, relax_order = 0; - if (myid == 0) hypre_printf("Solver: GSMG\n"); + if (myid == 0) { hypre_printf("Solver: GSMG\n"); } time_index = hypre_InitializeTiming("BoomerAMG Setup"); hypre_BeginTiming(time_index); @@ -3869,13 +4840,19 @@ main( hypre_int argc, HYPRE_BoomerAMGSetCycleType(amg_solver, cycle_type); HYPRE_BoomerAMGSetFCycle(amg_solver, fcycle); HYPRE_BoomerAMGSetNumSweeps(amg_solver, num_sweeps); - if (relax_type > -1) HYPRE_BoomerAMGSetRelaxType(amg_solver, relax_type); + if (relax_type > -1) { HYPRE_BoomerAMGSetRelaxType(amg_solver, relax_type); } if (relax_down > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(amg_solver, relax_down, 1); + } if (relax_up > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(amg_solver, relax_up, 2); + } if (relax_coarse > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(amg_solver, relax_coarse, 3); + } HYPRE_BoomerAMGSetAddRelaxType(amg_solver, add_relax_type); HYPRE_BoomerAMGSetAddRelaxWt(amg_solver, add_relax_wt); HYPRE_BoomerAMGSetChebyOrder(amg_solver, cheby_order); @@ -3887,9 +4864,13 @@ main( hypre_int argc, HYPRE_BoomerAMGSetRelaxWt(amg_solver, relax_wt); HYPRE_BoomerAMGSetOuterWt(amg_solver, outer_wt); if (level_w > -1) + { HYPRE_BoomerAMGSetLevelRelaxWt(amg_solver, relax_wt_level, level_w); + } if (level_ow > -1) + { HYPRE_BoomerAMGSetLevelOuterWt(amg_solver, outer_wt_level, level_ow); + } HYPRE_BoomerAMGSetSmoothType(amg_solver, smooth_type); HYPRE_BoomerAMGSetSmoothNumSweeps(amg_solver, smooth_num_sweeps); HYPRE_BoomerAMGSetSmoothNumLevels(amg_solver, smooth_num_levels); @@ -3901,10 +4882,33 @@ main( hypre_int argc, HYPRE_BoomerAMGSetDomainType(amg_solver, domain_type); HYPRE_BoomerAMGSetSchwarzUseNonSymm(amg_solver, use_nonsymm_schwarz); HYPRE_BoomerAMGSetSchwarzRlxWeight(amg_solver, schwarz_rlx_weight); - if (eu_level < 0) eu_level = 0; + if (eu_level < 0) { eu_level = 0; } HYPRE_BoomerAMGSetEuLevel(amg_solver, eu_level); HYPRE_BoomerAMGSetEuBJ(amg_solver, eu_bj); HYPRE_BoomerAMGSetEuSparseA(amg_solver, eu_sparse_A); + HYPRE_BoomerAMGSetILUType(amg_solver, ilu_type); + HYPRE_BoomerAMGSetILULevel(amg_solver, ilu_lfil); + HYPRE_BoomerAMGSetILUDroptol(amg_solver, ilu_droptol); + HYPRE_BoomerAMGSetILUMaxRowNnz(amg_solver, ilu_max_row_nnz); + HYPRE_BoomerAMGSetILUMaxIter(amg_solver, ilu_sm_max_iter); + HYPRE_BoomerAMGSetILUTriSolve(amg_solver, ilu_tri_solve); + HYPRE_BoomerAMGSetILULowerJacobiIters(amg_solver, ilu_ljac_iters); + HYPRE_BoomerAMGSetILUUpperJacobiIters(amg_solver, ilu_ujac_iters); + HYPRE_BoomerAMGSetILULocalReordering(amg_solver, ilu_reordering); + HYPRE_BoomerAMGSetILUIterSetupType(amg_solver, ilu_iter_setup_type); + HYPRE_BoomerAMGSetILUIterSetupOption(amg_solver, ilu_iter_setup_option); + HYPRE_BoomerAMGSetILUIterSetupMaxIter(amg_solver, ilu_iter_setup_max_iter); + HYPRE_BoomerAMGSetILUIterSetupTolerance(amg_solver, ilu_iter_setup_tolerance); + HYPRE_BoomerAMGSetFSAIAlgoType(amg_solver, fsai_algo_type); + HYPRE_BoomerAMGSetFSAILocalSolveType(amg_solver, fsai_ls_type); + HYPRE_BoomerAMGSetFSAIMaxSteps(amg_solver, fsai_max_steps); + HYPRE_BoomerAMGSetFSAIMaxStepSize(amg_solver, fsai_max_step_size); + HYPRE_BoomerAMGSetFSAIMaxNnzRow(amg_solver, fsai_max_nnz_row); + HYPRE_BoomerAMGSetFSAINumLevels(amg_solver, fsai_num_levels); + HYPRE_BoomerAMGSetFSAIThreshold(amg_solver, fsai_threshold); + HYPRE_BoomerAMGSetFSAIEigMaxIters(amg_solver, fsai_eig_max_iters); + HYPRE_BoomerAMGSetFSAIKapTolerance(amg_solver, fsai_kap_tolerance); + HYPRE_BoomerAMGSetFilterFunctions(amg_solver, filter_functions); HYPRE_BoomerAMGSetNumFunctions(amg_solver, num_functions); HYPRE_BoomerAMGSetAggNumLevels(amg_solver, agg_num_levels); HYPRE_BoomerAMGSetAggInterpType(amg_solver, agg_interp_type); @@ -3916,7 +4920,9 @@ main( hypre_int argc, HYPRE_BoomerAMGSetNodal(amg_solver, nodal); HYPRE_BoomerAMGSetNodalDiag(amg_solver, nodal_diag); if (num_functions > 1) + { HYPRE_BoomerAMGSetDofFunc(amg_solver, dof_func); + } HYPRE_BoomerAMGSetAdditive(amg_solver, additive); HYPRE_BoomerAMGSetMultAdditive(amg_solver, mult_add); HYPRE_BoomerAMGSetSimple(amg_solver, simple); @@ -3928,12 +4934,14 @@ main( hypre_int argc, HYPRE_BoomerAMGSetKeepTranspose(amg_solver, keepTranspose); if (nongalerk_tol) { - HYPRE_BoomerAMGSetNonGalerkinTol(amg_solver, nongalerk_tol[nongalerk_num_tol-1]); - for (i=0; i < nongalerk_num_tol-1; i++) + HYPRE_BoomerAMGSetNonGalerkinTol(amg_solver, nongalerk_tol[nongalerk_num_tol - 1]); + for (i = 0; i < nongalerk_num_tol - 1; i++) + { HYPRE_BoomerAMGSetLevelNonGalerkinTol(amg_solver, nongalerk_tol[i], i); + } } - HYPRE_BoomerAMGSetup(amg_solver, parcsr_A, b, x); + HYPRE_BoomerAMGSetup(amg_solver, parcsr_M, b, x); hypre_EndTiming(time_index); hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); @@ -3950,23 +4958,28 @@ main( hypre_int argc, hypre_FinalizeTiming(time_index); hypre_ClearTiming(); -#if SECOND_TIME - /* run a second time to check for memory leaks */ - HYPRE_ParVectorSetRandomValues(x, 775); - HYPRE_BoomerAMGSetup(amg_solver, parcsr_A, b, x); - HYPRE_BoomerAMGSolve(amg_solver, parcsr_A, b, x); + if (second_time) + { + /* run a second time [for timings, to check for memory leaks] */ + HYPRE_ParVectorSetRandomValues(x, 775); +#if defined(HYPRE_USING_CURAND) || defined(HYPRE_USING_ROCRAND) + hypre_ResetDeviceRandGenerator(1234ULL, 0ULL); #endif + hypre_ParVectorCopy(x0_save, x); + + HYPRE_BoomerAMGSetup(amg_solver, parcsr_M, b, x); + HYPRE_BoomerAMGSolve(amg_solver, parcsr_A, b, x); + } HYPRE_BoomerAMGDestroy(amg_solver); } if (solver_id == 999) { - HYPRE_IJMatrix ij_M; - HYPRE_ParCSRMatrix parcsr_mat; + HYPRE_IJMatrix ij_N; /* use ParaSails preconditioner */ - if (myid == 0) hypre_printf("Test ParaSails Build IJMatrix\n"); + if (myid == 0) { hypre_printf("Test ParaSails Build IJMatrix\n"); } HYPRE_IJMatrixPrint(ij_A, "parasails.in"); @@ -3975,14 +4988,14 @@ main( hypre_int argc, HYPRE_ParaSailsSetFilter(pcg_precond, 0.); HYPRE_ParaSailsSetLogging(pcg_precond, ioutdat); - HYPRE_IJMatrixGetObject( ij_A, &object); - parcsr_mat = (HYPRE_ParCSRMatrix) object; + HYPRE_IJMatrixGetObject(ij_A, &object); + parcsr_A = (HYPRE_ParCSRMatrix) object; - HYPRE_ParaSailsSetup(pcg_precond, parcsr_mat, NULL, NULL); - HYPRE_ParaSailsBuildIJMatrix(pcg_precond, &ij_M); + HYPRE_ParaSailsSetup(pcg_precond, parcsr_M, NULL, NULL); + HYPRE_ParaSailsBuildIJMatrix(pcg_precond, &ij_N); HYPRE_IJMatrixPrint(ij_M, "parasails.out"); - if (myid == 0) hypre_printf("Printed to parasails.out.\n"); + if (myid == 0) { hypre_printf("Printed to parasails.out.\n"); } exit(0); } @@ -3992,9 +5005,11 @@ main( hypre_int argc, /* begin lobpcg */ if (!lobpcgFlag && (solver_id == 1 || solver_id == 2 || solver_id == 8 || - solver_id == 12 || solver_id == 14 || solver_id == 43 || solver_id == 71)) + solver_id == 12 || solver_id == 14 || solver_id == 31 || + solver_id == 43 || solver_id == 71)) /*end lobpcg */ { + HYPRE_ANNOTATE_REGION_BEGIN("%s", "Run-1"); time_index = hypre_InitializeTiming("PCG Setup"); hypre_BeginTiming(time_index); @@ -4002,6 +5017,8 @@ main( hypre_int argc, HYPRE_PCGSetMaxIter(pcg_solver, max_iter); HYPRE_PCGSetTol(pcg_solver, tol); HYPRE_PCGSetTwoNorm(pcg_solver, 1); + HYPRE_PCGSetFlex(pcg_solver, flex); + HYPRE_PCGSetSkipBreak(pcg_solver, skip_break); HYPRE_PCGSetRelChange(pcg_solver, rel_change); HYPRE_PCGSetPrintLevel(pcg_solver, ioutdat); HYPRE_PCGSetAbsoluteTol(pcg_solver, atol); @@ -4010,7 +5027,7 @@ main( hypre_int argc, if (solver_id == 1) { /* use BoomerAMG as preconditioner */ - if (myid == 0) hypre_printf("Solver: AMG-PCG\n"); + if (myid == 0) { hypre_printf("Solver: AMG-PCG\n"); } HYPRE_BoomerAMGCreate(&pcg_precond); /* BM Aug 25, 2006 */ HYPRE_BoomerAMGSetCGCIts(pcg_precond, cgcits); @@ -4035,7 +5052,7 @@ main( hypre_int argc, HYPRE_BoomerAMGSetSCommPkgSwitch(pcg_precond, S_commpkg_switch); HYPRE_BoomerAMGSetPrintLevel(pcg_precond, poutdat); HYPRE_BoomerAMGSetPrintFileName(pcg_precond, "driver.out.log"); - HYPRE_BoomerAMGSetMaxIter(pcg_precond, 1); + HYPRE_BoomerAMGSetMaxIter(pcg_precond, precon_cycles); HYPRE_BoomerAMGSetCycleType(pcg_precond, cycle_type); HYPRE_BoomerAMGSetFCycle(pcg_precond, fcycle); HYPRE_BoomerAMGSetNumSweeps(pcg_precond, num_sweeps); @@ -4044,13 +5061,19 @@ main( hypre_int argc, HYPRE_BoomerAMGSetCRRate(pcg_precond, CR_rate); HYPRE_BoomerAMGSetCRStrongTh(pcg_precond, CR_strong_th); HYPRE_BoomerAMGSetCRUseCG(pcg_precond, CR_use_CG); - if (relax_type > -1) HYPRE_BoomerAMGSetRelaxType(pcg_precond, relax_type); + if (relax_type > -1) { HYPRE_BoomerAMGSetRelaxType(pcg_precond, relax_type); } if (relax_down > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_down, 1); + } if (relax_up > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_up, 2); + } if (relax_coarse > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_coarse, 3); + } HYPRE_BoomerAMGSetAddRelaxType(pcg_precond, add_relax_type); HYPRE_BoomerAMGSetAddRelaxWt(pcg_precond, add_relax_wt); HYPRE_BoomerAMGSetChebyOrder(pcg_precond, cheby_order); @@ -4062,15 +5085,20 @@ main( hypre_int argc, HYPRE_BoomerAMGSetRelaxWt(pcg_precond, relax_wt); HYPRE_BoomerAMGSetOuterWt(pcg_precond, outer_wt); if (level_w > -1) - HYPRE_BoomerAMGSetLevelRelaxWt(pcg_precond, relax_wt_level,level_w); + { + HYPRE_BoomerAMGSetLevelRelaxWt(pcg_precond, relax_wt_level, level_w); + } if (level_ow > -1) - HYPRE_BoomerAMGSetLevelOuterWt(pcg_precond,outer_wt_level,level_ow); + { + HYPRE_BoomerAMGSetLevelOuterWt(pcg_precond, outer_wt_level, level_ow); + } HYPRE_BoomerAMGSetSmoothType(pcg_precond, smooth_type); HYPRE_BoomerAMGSetSmoothNumLevels(pcg_precond, smooth_num_levels); HYPRE_BoomerAMGSetSmoothNumSweeps(pcg_precond, smooth_num_sweeps); HYPRE_BoomerAMGSetMaxLevels(pcg_precond, max_levels); HYPRE_BoomerAMGSetMaxRowSum(pcg_precond, max_row_sum); HYPRE_BoomerAMGSetDebugFlag(pcg_precond, debug_flag); + HYPRE_BoomerAMGSetFilterFunctions(pcg_precond, filter_functions); HYPRE_BoomerAMGSetNumFunctions(pcg_precond, num_functions); HYPRE_BoomerAMGSetAggNumLevels(pcg_precond, agg_num_levels); HYPRE_BoomerAMGSetAggInterpType(pcg_precond, agg_interp_type); @@ -4087,13 +5115,37 @@ main( hypre_int argc, HYPRE_BoomerAMGSetDomainType(pcg_precond, domain_type); HYPRE_BoomerAMGSetSchwarzUseNonSymm(pcg_precond, use_nonsymm_schwarz); HYPRE_BoomerAMGSetSchwarzRlxWeight(pcg_precond, schwarz_rlx_weight); - if (eu_level < 0) eu_level = 0; + if (eu_level < 0) { eu_level = 0; } HYPRE_BoomerAMGSetEuLevel(pcg_precond, eu_level); HYPRE_BoomerAMGSetEuBJ(pcg_precond, eu_bj); HYPRE_BoomerAMGSetEuSparseA(pcg_precond, eu_sparse_A); + HYPRE_BoomerAMGSetILUType(pcg_precond, ilu_type); + HYPRE_BoomerAMGSetILULevel(pcg_precond, ilu_lfil); + HYPRE_BoomerAMGSetILUDroptol(pcg_precond, ilu_droptol); + HYPRE_BoomerAMGSetILUMaxRowNnz(pcg_precond, ilu_max_row_nnz); + HYPRE_BoomerAMGSetILUMaxIter(pcg_precond, ilu_sm_max_iter); + HYPRE_BoomerAMGSetILUTriSolve(pcg_precond, ilu_tri_solve); + HYPRE_BoomerAMGSetILULowerJacobiIters(pcg_precond, ilu_ljac_iters); + HYPRE_BoomerAMGSetILUUpperJacobiIters(pcg_precond, ilu_ujac_iters); + HYPRE_BoomerAMGSetILULocalReordering(pcg_precond, ilu_reordering); + HYPRE_BoomerAMGSetILUIterSetupType(pcg_precond, ilu_iter_setup_type); + HYPRE_BoomerAMGSetILUIterSetupOption(pcg_precond, ilu_iter_setup_option); + HYPRE_BoomerAMGSetILUIterSetupMaxIter(pcg_precond, ilu_iter_setup_max_iter); + HYPRE_BoomerAMGSetILUIterSetupTolerance(pcg_precond, ilu_iter_setup_tolerance); + HYPRE_BoomerAMGSetFSAIAlgoType(pcg_precond, fsai_algo_type); + HYPRE_BoomerAMGSetFSAILocalSolveType(pcg_precond, fsai_ls_type); + HYPRE_BoomerAMGSetFSAIMaxSteps(pcg_precond, fsai_max_steps); + HYPRE_BoomerAMGSetFSAIMaxStepSize(pcg_precond, fsai_max_step_size); + HYPRE_BoomerAMGSetFSAIMaxNnzRow(pcg_precond, fsai_max_nnz_row); + HYPRE_BoomerAMGSetFSAINumLevels(pcg_precond, fsai_num_levels); + HYPRE_BoomerAMGSetFSAIEigMaxIters(pcg_precond, fsai_eig_max_iters); + HYPRE_BoomerAMGSetFSAIThreshold(pcg_precond, fsai_threshold); + HYPRE_BoomerAMGSetFSAIKapTolerance(pcg_precond, fsai_kap_tolerance); HYPRE_BoomerAMGSetCycleNumSweeps(pcg_precond, ns_coarse, 3); if (num_functions > 1) + { HYPRE_BoomerAMGSetDofFunc(pcg_precond, dof_func); + } HYPRE_BoomerAMGSetAdditive(pcg_precond, additive); HYPRE_BoomerAMGSetMultAdditive(pcg_precond, mult_add); HYPRE_BoomerAMGSetSimple(pcg_precond, simple); @@ -4108,9 +5160,11 @@ main( hypre_int argc, #endif if (nongalerk_tol) { - HYPRE_BoomerAMGSetNonGalerkinTol(pcg_precond, nongalerk_tol[nongalerk_num_tol-1]); - for (i=0; i < nongalerk_num_tol-1; i++) + HYPRE_BoomerAMGSetNonGalerkinTol(pcg_precond, nongalerk_tol[nongalerk_num_tol - 1]); + for (i = 0; i < nongalerk_num_tol - 1; i++) + { HYPRE_BoomerAMGSetLevelNonGalerkinTol(pcg_precond, nongalerk_tol[i], i); + } } if (build_rbm) { @@ -4120,16 +5174,13 @@ main( hypre_int argc, HYPRE_BoomerAMGSetInterpVecAbsQTrunc(pcg_precond, Q_trunc); } HYPRE_PCGSetMaxIter(pcg_solver, mg_max_iter); - HYPRE_PCGSetPrecond(pcg_solver, - (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, - (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, - pcg_precond); + HYPRE_PCGSetPreconditioner(pcg_solver, pcg_precond); } else if (solver_id == 2) { /* use diagonal scaling as preconditioner */ - if (myid == 0) hypre_printf("Solver: DS-PCG\n"); + if (myid == 0) { hypre_printf("Solver: DS-PCG\n"); } pcg_precond = NULL; HYPRE_PCGSetPrecond(pcg_solver, @@ -4140,7 +5191,7 @@ main( hypre_int argc, else if (solver_id == 8) { /* use ParaSails preconditioner */ - if (myid == 0) hypre_printf("Solver: ParaSails-PCG\n"); + if (myid == 0) { hypre_printf("Solver: ParaSails-PCG\n"); } HYPRE_ParaSailsCreate(hypre_MPI_COMM_WORLD, &pcg_precond); HYPRE_ParaSailsSetParams(pcg_precond, sai_threshold, max_levels); @@ -4155,7 +5206,7 @@ main( hypre_int argc, else if (solver_id == 12) { /* use Schwarz preconditioner */ - if (myid == 0) hypre_printf("Solver: Schwarz-PCG\n"); + if (myid == 0) { hypre_printf("Solver: Schwarz-PCG\n"); } HYPRE_SchwarzCreate(&pcg_precond); HYPRE_SchwarzSetVariant(pcg_precond, variant); @@ -4177,7 +5228,7 @@ main( hypre_int argc, /* fine grid */ relax_order = 0; - if (myid == 0) hypre_printf("Solver: GSMG-PCG\n"); + if (myid == 0) { hypre_printf("Solver: GSMG-PCG\n"); } HYPRE_BoomerAMGCreate(&pcg_precond); HYPRE_BoomerAMGSetGSMG(pcg_precond, 4); /* BM Aug 25, 2006 */ @@ -4203,7 +5254,7 @@ main( hypre_int argc, HYPRE_BoomerAMGSetSCommPkgSwitch(pcg_precond, S_commpkg_switch); HYPRE_BoomerAMGSetPrintLevel(pcg_precond, poutdat); HYPRE_BoomerAMGSetPrintFileName(pcg_precond, "driver.out.log"); - HYPRE_BoomerAMGSetMaxIter(pcg_precond, 1); + HYPRE_BoomerAMGSetMaxIter(pcg_precond, precon_cycles); HYPRE_BoomerAMGSetCycleType(pcg_precond, cycle_type); HYPRE_BoomerAMGSetFCycle(pcg_precond, fcycle); HYPRE_BoomerAMGSetNumSweeps(pcg_precond, num_sweeps); @@ -4212,13 +5263,19 @@ main( hypre_int argc, HYPRE_BoomerAMGSetCRRate(pcg_precond, CR_rate); HYPRE_BoomerAMGSetCRStrongTh(pcg_precond, CR_strong_th); HYPRE_BoomerAMGSetCRUseCG(pcg_precond, CR_use_CG); - if (relax_type > -1) HYPRE_BoomerAMGSetRelaxType(pcg_precond, relax_type); + if (relax_type > -1) { HYPRE_BoomerAMGSetRelaxType(pcg_precond, relax_type); } if (relax_down > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_down, 1); + } if (relax_up > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_up, 2); + } if (relax_coarse > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_coarse, 3); + } HYPRE_BoomerAMGSetAddRelaxType(pcg_precond, add_relax_type); HYPRE_BoomerAMGSetAddRelaxWt(pcg_precond, add_relax_wt); HYPRE_BoomerAMGSetRelaxOrder(pcg_precond, relax_order); @@ -4230,9 +5287,13 @@ main( hypre_int argc, HYPRE_BoomerAMGSetRelaxWt(pcg_precond, relax_wt); HYPRE_BoomerAMGSetOuterWt(pcg_precond, outer_wt); if (level_w > -1) - HYPRE_BoomerAMGSetLevelRelaxWt(pcg_precond, relax_wt_level,level_w); + { + HYPRE_BoomerAMGSetLevelRelaxWt(pcg_precond, relax_wt_level, level_w); + } if (level_ow > -1) - HYPRE_BoomerAMGSetLevelOuterWt(pcg_precond,outer_wt_level,level_ow); + { + HYPRE_BoomerAMGSetLevelOuterWt(pcg_precond, outer_wt_level, level_ow); + } HYPRE_BoomerAMGSetSmoothType(pcg_precond, smooth_type); HYPRE_BoomerAMGSetSmoothNumLevels(pcg_precond, smooth_num_levels); HYPRE_BoomerAMGSetSmoothNumSweeps(pcg_precond, smooth_num_sweeps); @@ -4240,13 +5301,36 @@ main( hypre_int argc, HYPRE_BoomerAMGSetOverlap(pcg_precond, overlap); HYPRE_BoomerAMGSetDomainType(pcg_precond, domain_type); HYPRE_BoomerAMGSetSchwarzRlxWeight(pcg_precond, schwarz_rlx_weight); - if (eu_level < 0) eu_level = 0; + if (eu_level < 0) { eu_level = 0; } HYPRE_BoomerAMGSetEuLevel(pcg_precond, eu_level); HYPRE_BoomerAMGSetEuBJ(pcg_precond, eu_bj); HYPRE_BoomerAMGSetEuSparseA(pcg_precond, eu_sparse_A); + HYPRE_BoomerAMGSetILUType(pcg_precond, ilu_type); + HYPRE_BoomerAMGSetILULevel(pcg_precond, ilu_lfil); + HYPRE_BoomerAMGSetILUDroptol(pcg_precond, ilu_droptol); + HYPRE_BoomerAMGSetILUMaxRowNnz(pcg_precond, ilu_max_row_nnz); + HYPRE_BoomerAMGSetILUMaxIter(pcg_precond, ilu_sm_max_iter); + HYPRE_BoomerAMGSetILUTriSolve(pcg_precond, ilu_tri_solve); + HYPRE_BoomerAMGSetILULowerJacobiIters(pcg_precond, ilu_ljac_iters); + HYPRE_BoomerAMGSetILUUpperJacobiIters(pcg_precond, ilu_ujac_iters); + HYPRE_BoomerAMGSetILULocalReordering(pcg_precond, ilu_reordering); + HYPRE_BoomerAMGSetILUIterSetupType(pcg_precond, ilu_iter_setup_type); + HYPRE_BoomerAMGSetILUIterSetupOption(pcg_precond, ilu_iter_setup_option); + HYPRE_BoomerAMGSetILUIterSetupMaxIter(pcg_precond, ilu_iter_setup_max_iter); + HYPRE_BoomerAMGSetILUIterSetupTolerance(pcg_precond, ilu_iter_setup_tolerance); + HYPRE_BoomerAMGSetFSAIAlgoType(pcg_precond, fsai_algo_type); + HYPRE_BoomerAMGSetFSAILocalSolveType(pcg_precond, fsai_ls_type); + HYPRE_BoomerAMGSetFSAIMaxSteps(pcg_precond, fsai_max_steps); + HYPRE_BoomerAMGSetFSAIMaxStepSize(pcg_precond, fsai_max_step_size); + HYPRE_BoomerAMGSetFSAIMaxNnzRow(pcg_precond, fsai_max_nnz_row); + HYPRE_BoomerAMGSetFSAINumLevels(pcg_precond, fsai_num_levels); + HYPRE_BoomerAMGSetFSAIThreshold(pcg_precond, fsai_threshold); + HYPRE_BoomerAMGSetFSAIEigMaxIters(pcg_precond, fsai_eig_max_iters); + HYPRE_BoomerAMGSetFSAIKapTolerance(pcg_precond, fsai_kap_tolerance); HYPRE_BoomerAMGSetMaxLevels(pcg_precond, max_levels); HYPRE_BoomerAMGSetMaxRowSum(pcg_precond, max_row_sum); HYPRE_BoomerAMGSetDebugFlag(pcg_precond, debug_flag); + HYPRE_BoomerAMGSetFilterFunctions(pcg_precond, filter_functions); HYPRE_BoomerAMGSetNumFunctions(pcg_precond, num_functions); HYPRE_BoomerAMGSetAggNumLevels(pcg_precond, agg_num_levels); HYPRE_BoomerAMGSetAggInterpType(pcg_precond, agg_interp_type); @@ -4259,7 +5343,9 @@ main( hypre_int argc, HYPRE_BoomerAMGSetNodalDiag(pcg_precond, nodal_diag); HYPRE_BoomerAMGSetCycleNumSweeps(pcg_precond, ns_coarse, 3); if (num_functions > 1) + { HYPRE_BoomerAMGSetDofFunc(pcg_precond, dof_func); + } HYPRE_BoomerAMGSetAdditive(pcg_precond, additive); HYPRE_BoomerAMGSetMultAdditive(pcg_precond, mult_add); HYPRE_BoomerAMGSetSimple(pcg_precond, simple); @@ -4274,9 +5360,11 @@ main( hypre_int argc, #endif if (nongalerk_tol) { - HYPRE_BoomerAMGSetNonGalerkinTol(pcg_precond, nongalerk_tol[nongalerk_num_tol-1]); - for (i=0; i < nongalerk_num_tol-1; i++) + HYPRE_BoomerAMGSetNonGalerkinTol(pcg_precond, nongalerk_tol[nongalerk_num_tol - 1]); + for (i = 0; i < nongalerk_num_tol - 1; i++) + { HYPRE_BoomerAMGSetLevelNonGalerkinTol(pcg_precond, nongalerk_tol[i], i); + } } HYPRE_PCGSetMaxIter(pcg_solver, mg_max_iter); HYPRE_PCGSetPrecond(pcg_solver, @@ -4284,10 +5372,35 @@ main( hypre_int argc, (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, pcg_precond); } + else if (solver_id == 31) + { + /* use FSAI preconditioning */ + if (myid == 0) { hypre_printf("Solver: FSAI-PCG\n"); } + + HYPRE_FSAICreate(&pcg_precond); + + HYPRE_FSAISetAlgoType(pcg_precond, fsai_algo_type); + HYPRE_FSAISetLocalSolveType(pcg_precond, fsai_ls_type); + HYPRE_FSAISetMaxSteps(pcg_precond, fsai_max_steps); + HYPRE_FSAISetMaxStepSize(pcg_precond, fsai_max_step_size); + HYPRE_FSAISetMaxNnzRow(pcg_precond, fsai_max_nnz_row); + HYPRE_FSAISetNumLevels(pcg_precond, fsai_num_levels); + HYPRE_FSAISetThreshold(pcg_precond, fsai_threshold); + HYPRE_FSAISetKapTolerance(pcg_precond, fsai_kap_tolerance); + HYPRE_FSAISetMaxIterations(pcg_precond, 1); + HYPRE_FSAISetTolerance(pcg_precond, 0.0); + HYPRE_FSAISetZeroGuess(pcg_precond, 1); + HYPRE_FSAISetPrintLevel(pcg_precond, poutdat); + + HYPRE_PCGSetPrecond(pcg_solver, + (HYPRE_PtrToSolverFcn) HYPRE_FSAISolve, + (HYPRE_PtrToSolverFcn) HYPRE_FSAISetup, + pcg_precond); + } else if (solver_id == 43) { /* use Euclid preconditioning */ - if (myid == 0) hypre_printf("Solver: Euclid-PCG\n"); + if (myid == 0) { hypre_printf("Solver: Euclid-PCG\n"); } HYPRE_EuclidCreate(hypre_MPI_COMM_WORLD, &pcg_precond); @@ -4296,11 +5409,11 @@ main( hypre_int argc, we'll use what I think is simplest: let Euclid internally parse the command line. */ - if (eu_level > -1) HYPRE_EuclidSetLevel(pcg_precond, eu_level); - if (eu_ilut) HYPRE_EuclidSetILUT(pcg_precond, eu_ilut); - if (eu_sparse_A) HYPRE_EuclidSetSparseA(pcg_precond, eu_sparse_A); - if (eu_row_scale) HYPRE_EuclidSetRowScale(pcg_precond, eu_row_scale); - if (eu_bj) HYPRE_EuclidSetBJ(pcg_precond, eu_bj); + if (eu_level > -1) { HYPRE_EuclidSetLevel(pcg_precond, eu_level); } + if (eu_ilut) { HYPRE_EuclidSetILUT(pcg_precond, eu_ilut); } + if (eu_sparse_A) { HYPRE_EuclidSetSparseA(pcg_precond, eu_sparse_A); } + if (eu_row_scale) { HYPRE_EuclidSetRowScale(pcg_precond, eu_row_scale); } + if (eu_bj) { HYPRE_EuclidSetBJ(pcg_precond, eu_bj); } HYPRE_EuclidSetStats(pcg_precond, eu_stats); HYPRE_EuclidSetMem(pcg_precond, eu_mem); @@ -4311,37 +5424,41 @@ main( hypre_int argc, (HYPRE_PtrToSolverFcn) HYPRE_EuclidSetup, pcg_precond); } - else if( solver_id == 71 ) + else if ( solver_id == 71 ) { /* use MGR preconditioning */ - if (myid == 0) hypre_printf("Solver: MGR-PCG\n"); + if (myid == 0) { hypre_printf("Solver: MGR-PCG\n"); } HYPRE_MGRCreate(&pcg_precond); mgr_num_cindexes = hypre_CTAlloc(HYPRE_Int, mgr_nlevels, HYPRE_MEMORY_HOST); - for(i=0; i -1) + { + HYPRE_BoomerAMGSetCycleRelaxType(amg_solver, relax_down, 1); + } + if (relax_up > -1) + { + HYPRE_BoomerAMGSetCycleRelaxType(amg_solver, relax_up, 2); + } + if (relax_coarse > -1) + { + HYPRE_BoomerAMGSetCycleRelaxType(amg_solver, relax_coarse, 3); + } + HYPRE_BoomerAMGSetSmoothType(amg_solver, smooth_type); + HYPRE_BoomerAMGSetSmoothNumSweeps(amg_solver, smooth_num_sweeps); + } HYPRE_BoomerAMGSetCGCIts(amg_solver, cgcits); - HYPRE_BoomerAMGSetInterpType(amg_solver, 0); - HYPRE_BoomerAMGSetPostInterpType(amg_solver, post_interp_type); - HYPRE_BoomerAMGSetCoarsenType(amg_solver, 6); + HYPRE_BoomerAMGSetTol(amg_solver, 0.0); HYPRE_BoomerAMGSetPMaxElmts(amg_solver, 0); - /* note: log is written to standard output, not to file */ - HYPRE_BoomerAMGSetPrintLevel(amg_solver, 1); - HYPRE_BoomerAMGSetCycleType(amg_solver, cycle_type); - HYPRE_BoomerAMGSetFCycle(amg_solver, fcycle); HYPRE_BoomerAMGSetNumSweeps(amg_solver, num_sweeps); - HYPRE_BoomerAMGSetRelaxType(amg_solver, 3); - if (relax_down > -1) - HYPRE_BoomerAMGSetCycleRelaxType(amg_solver, relax_down, 1); - if (relax_up > -1) - HYPRE_BoomerAMGSetCycleRelaxType(amg_solver, relax_up, 2); - if (relax_coarse > -1) - HYPRE_BoomerAMGSetCycleRelaxType(amg_solver, relax_coarse, 3); HYPRE_BoomerAMGSetRelaxOrder(amg_solver, 1); HYPRE_BoomerAMGSetMaxLevels(amg_solver, max_levels); - HYPRE_BoomerAMGSetSmoothType(amg_solver, smooth_type); - HYPRE_BoomerAMGSetSmoothNumSweeps(amg_solver, smooth_num_sweeps); - HYPRE_BoomerAMGSetMaxIter(amg_solver, 1); - HYPRE_BoomerAMGSetTol(amg_solver, 0.0); + HYPRE_BoomerAMGSetMaxIter(amg_solver, precon_cycles); + HYPRE_BoomerAMGSetPrintLevel(amg_solver, 1); /* set the MGR coarse solver. Comment out to use default CG solver in MGR */ HYPRE_MGRSetCoarseSolver( pcg_precond, HYPRE_BoomerAMGSolve, HYPRE_BoomerAMGSetup, amg_solver); @@ -4402,14 +5537,17 @@ main( hypre_int argc, if (pcg_precond_gotten != pcg_precond) { hypre_printf("HYPRE_ParCSRPCGGetPrecond got bad precond\n"); - return(-1); + return (-1); + } + else if (myid == 0) + { + hypre_printf("HYPRE_ParCSRPCGGetPrecond got good precond\n"); } - else - if (myid == 0) - hypre_printf("HYPRE_ParCSRPCGGetPrecond got good precond\n"); - HYPRE_PCGSetup(pcg_solver, (HYPRE_Matrix)parcsr_A, - (HYPRE_Vector)b, (HYPRE_Vector)x); + hypre_GpuProfilingPushRange("PCG-Setup-1"); + HYPRE_PCGSetup(pcg_solver, (HYPRE_Matrix) parcsr_M, + (HYPRE_Vector) b, (HYPRE_Vector) x); + hypre_GpuProfilingPopRange(); hypre_EndTiming(time_index); hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); hypre_FinalizeTiming(time_index); @@ -4417,43 +5555,70 @@ main( hypre_int argc, time_index = hypre_InitializeTiming("PCG Solve"); hypre_BeginTiming(time_index); - + hypre_GpuProfilingPushRange("PCG-Solve-1"); HYPRE_PCGSolve(pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, (HYPRE_Vector)x); - + hypre_GpuProfilingPopRange(); hypre_EndTiming(time_index); hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); + HYPRE_ANNOTATE_REGION_END("%s", "Run-1"); - HYPRE_PCGGetNumIterations(pcg_solver, &num_iterations); - HYPRE_PCGGetFinalRelativeResidualNorm(pcg_solver, &final_res_norm); + if (second_time) + { + HYPRE_ANNOTATE_REGION_BEGIN("%s", "Run-2"); + HYPRE_SetExecutionPolicy(exec2_policy); -#if SECOND_TIME - /* run a second time to check for memory leaks */ - HYPRE_ParVectorSetRandomValues(x, 775); - time_index = hypre_InitializeTiming("PCG Setup"); - hypre_BeginTiming(time_index); + /* run a second time [for timings, to check for memory leaks] */ + HYPRE_ParVectorSetRandomValues(x, 775); +#if defined(HYPRE_USING_CURAND) || defined(HYPRE_USING_ROCRAND) + hypre_ResetDeviceRandGenerator(1234ULL, 0ULL); +#endif + hypre_ParVectorCopy(x0_save, x); - HYPRE_PCGSetup(pcg_solver, (HYPRE_Matrix)parcsr_A, - (HYPRE_Vector)b, (HYPRE_Vector)x); +#if defined(HYPRE_USING_CUDA) + cudaProfilerStart(); +#endif - hypre_EndTiming(time_index); - hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + time_index = hypre_InitializeTiming("PCG Setup"); + hypre_BeginTiming(time_index); - time_index = hypre_InitializeTiming("PCG Solve"); - hypre_BeginTiming(time_index); + hypre_GpuProfilingPushRange("PCG-Setup-2"); - HYPRE_PCGSolve(pcg_solver, (HYPRE_Matrix)parcsr_A, - (HYPRE_Vector)b, (HYPRE_Vector)x); + HYPRE_PCGSetup(pcg_solver, (HYPRE_Matrix) parcsr_M, + (HYPRE_Vector) b, (HYPRE_Vector) x); - hypre_EndTiming(time_index); - hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + hypre_GpuProfilingPopRange(); + + hypre_EndTiming(time_index); + hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + time_index = hypre_InitializeTiming("PCG Solve"); + hypre_BeginTiming(time_index); + + hypre_GpuProfilingPushRange("PCG-Solve-2"); + + HYPRE_PCGSolve(pcg_solver, (HYPRE_Matrix)parcsr_A, + (HYPRE_Vector)b, (HYPRE_Vector)x); + + hypre_GpuProfilingPopRange(); + + hypre_EndTiming(time_index); + hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + HYPRE_ANNOTATE_REGION_END("%s", "Run-2"); +#if defined(HYPRE_USING_CUDA) + cudaProfilerStop(); #endif + } + + HYPRE_PCGGetNumIterations(pcg_solver, &num_iterations); + HYPRE_PCGGetFinalRelativeResidualNorm(pcg_solver, &final_res_norm); HYPRE_ParCSRPCGDestroy(pcg_solver); @@ -4473,27 +5638,37 @@ main( hypre_int argc, { HYPRE_BoomerAMGDestroy(pcg_precond); } + else if (solver_id == 31) + { + HYPRE_FSAIDestroy(pcg_precond); + } else if (solver_id == 43) { HYPRE_EuclidDestroy(pcg_precond); } - else if(solver_id == 71) + else if (solver_id == 71) { /* free memory */ - if(mgr_num_cindexes) + if (mgr_num_cindexes) + { hypre_TFree(mgr_num_cindexes, HYPRE_MEMORY_HOST); + } mgr_num_cindexes = NULL; - if(mgr_reserved_coarse_indexes) + if (mgr_reserved_coarse_indexes) + { hypre_TFree(mgr_reserved_coarse_indexes, HYPRE_MEMORY_HOST); + } mgr_reserved_coarse_indexes = NULL; - if(mgr_cindexes) + if (mgr_cindexes) { - for( i=0; i last_local_row) + { offdiag_sizes[local_row]++; + } else + { diag_sizes[local_row]++; + } } local_row++; ierr += HYPRE_ParCSRMatrixRestoreRow( parcsr_B, big_i, &size, @@ -4571,7 +5755,7 @@ main( hypre_int argc, ierr = HYPRE_IJMatrixInitialize( ij_B ); - for (big_i=first_local_row; big_i<= last_local_row; big_i++) + for (big_i = first_local_row; big_i <= last_local_row; big_i++) { ierr += HYPRE_ParCSRMatrixGetRow( parcsr_B, big_i, &size, &col_inds, &values ); @@ -4594,13 +5778,28 @@ main( hypre_int argc, if (sparsity_known == 0) /* tries a more accurate estimate of the storage */ { - if (build_matrix_type == 2) size = 7; - if (build_matrix_type == 3) size = 9; - if (build_matrix_type == 4) size = 27; + if (build_matrix_type == 2) + { + size = 7; + } + else if (build_matrix_type == 3) + { + size = 9; + } + else if (build_matrix_type == 4) + { + size = 27; + } + else if (build_matrix_type == 5) + { + size = 125; + } } - for (i=0; i < local_num_rows; i++) + for (i = 0; i < local_num_rows; i++) + { row_sizes[i] = size; + } ierr = HYPRE_IJMatrixSetRowSizes ( ij_B, (const HYPRE_Int *) row_sizes ); @@ -4609,7 +5808,7 @@ main( hypre_int argc, ierr = HYPRE_IJMatrixInitialize( ij_B ); /* Loop through all locally stored rows and insert them into ij_matrix */ - for (big_i=first_local_row; big_i<= last_local_row; big_i++) + for (big_i = first_local_row; big_i <= last_local_row; big_i++) { ierr += HYPRE_ParCSRMatrixGetRow( parcsr_B, big_i, &size, &col_inds, &values ); @@ -4651,14 +5850,14 @@ main( hypre_int argc, if (solver_id == 1) { /* use BoomerAMG as preconditioner */ - if (myid == 0) hypre_printf("Solver: AMG-PCG\n"); + if (myid == 0) { hypre_printf("Solver: AMG-PCG\n"); } HYPRE_BoomerAMGCreate(&pcg_precond); /* BM Aug 25, 2006 */ HYPRE_BoomerAMGSetCGCIts(pcg_precond, cgcits); HYPRE_BoomerAMGSetInterpType(pcg_precond, interp_type); HYPRE_BoomerAMGSetNumSamples(pcg_precond, gsmg_samples); HYPRE_BoomerAMGSetTol(pcg_precond, pc_tol); - HYPRE_BoomerAMGSetCoarsenType(pcg_precond, (hybrid*coarsen_type)); + HYPRE_BoomerAMGSetCoarsenType(pcg_precond, (hybrid * coarsen_type)); HYPRE_BoomerAMGSetCoarsenCutFactor(pcg_precond, coarsen_cut_factor); HYPRE_BoomerAMGSetCPoints(pcg_precond, max_levels, num_cpt, cpt_index); HYPRE_BoomerAMGSetFPoints(pcg_precond, num_fpt, fpt_index); @@ -4671,17 +5870,23 @@ main( hypre_int argc, HYPRE_BoomerAMGSetJacobiTruncThreshold(pcg_precond, jacobi_trunc_threshold); HYPRE_BoomerAMGSetPrintLevel(pcg_precond, poutdat); HYPRE_BoomerAMGSetPrintFileName(pcg_precond, "driver.out.log"); - HYPRE_BoomerAMGSetMaxIter(pcg_precond, 1); + HYPRE_BoomerAMGSetMaxIter(pcg_precond, precon_cycles); HYPRE_BoomerAMGSetCycleType(pcg_precond, cycle_type); HYPRE_BoomerAMGSetFCycle(pcg_precond, fcycle); HYPRE_BoomerAMGSetNumSweeps(pcg_precond, num_sweeps); - if (relax_type > -1) HYPRE_BoomerAMGSetRelaxType(pcg_precond, relax_type); + if (relax_type > -1) { HYPRE_BoomerAMGSetRelaxType(pcg_precond, relax_type); } if (relax_down > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_down, 1); + } if (relax_up > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_up, 2); + } if (relax_coarse > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_coarse, 3); + } HYPRE_BoomerAMGSetAddRelaxType(pcg_precond, add_relax_type); HYPRE_BoomerAMGSetAddRelaxWt(pcg_precond, add_relax_wt); HYPRE_BoomerAMGSetRelaxWt(pcg_precond, relax_wt); @@ -4693,6 +5898,7 @@ main( hypre_int argc, HYPRE_BoomerAMGSetMaxLevels(pcg_precond, max_levels); HYPRE_BoomerAMGSetMaxRowSum(pcg_precond, max_row_sum); HYPRE_BoomerAMGSetDebugFlag(pcg_precond, debug_flag); + HYPRE_BoomerAMGSetFilterFunctions(pcg_precond, filter_functions); HYPRE_BoomerAMGSetNumFunctions(pcg_precond, num_functions); HYPRE_BoomerAMGSetNumPaths(pcg_precond, num_paths); HYPRE_BoomerAMGSetAggNumLevels(pcg_precond, agg_num_levels); @@ -4701,7 +5907,9 @@ main( hypre_int argc, HYPRE_BoomerAMGSetDomainType(pcg_precond, domain_type); HYPRE_BoomerAMGSetSchwarzRlxWeight(pcg_precond, schwarz_rlx_weight); if (num_functions > 1) + { HYPRE_BoomerAMGSetDofFunc(pcg_precond, dof_func); + } HYPRE_PCGSetPrecond(pcg_solver, (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, @@ -4710,7 +5918,7 @@ main( hypre_int argc, else if (solver_id == 2) { /* use diagonal scaling as preconditioner */ - if (myid == 0) hypre_printf("Solver: DS-PCG\n"); + if (myid == 0) { hypre_printf("Solver: DS-PCG\n"); } pcg_precond = NULL; HYPRE_PCGSetPrecond(pcg_solver, @@ -4721,7 +5929,7 @@ main( hypre_int argc, else if (solver_id == 8) { /* use ParaSails preconditioner */ - if (myid == 0) hypre_printf("Solver: ParaSails-PCG\n"); + if (myid == 0) { hypre_printf("Solver: ParaSails-PCG\n"); } HYPRE_ParaSailsCreate(hypre_MPI_COMM_WORLD, &pcg_precond); HYPRE_ParaSailsSetParams(pcg_precond, sai_threshold, max_levels); @@ -4736,7 +5944,7 @@ main( hypre_int argc, else if (solver_id == 12) { /* use Schwarz preconditioner */ - if (myid == 0) hypre_printf("Solver: Schwarz-PCG\n"); + if (myid == 0) { hypre_printf("Solver: Schwarz-PCG\n"); } HYPRE_SchwarzCreate(&pcg_precond); HYPRE_SchwarzSetVariant(pcg_precond, variant); @@ -4759,7 +5967,7 @@ main( hypre_int argc, relax_type = relax_default; relax_order = 0; - if (myid == 0) hypre_printf("Solver: GSMG-PCG\n"); + if (myid == 0) { hypre_printf("Solver: GSMG-PCG\n"); } HYPRE_BoomerAMGCreate(&pcg_precond); /* BM Aug 25, 2006 */ HYPRE_BoomerAMGSetCGCIts(pcg_precond, cgcits); @@ -4767,7 +5975,7 @@ main( hypre_int argc, HYPRE_BoomerAMGSetInterpType(pcg_precond, interp_type); HYPRE_BoomerAMGSetNumSamples(pcg_precond, gsmg_samples); HYPRE_BoomerAMGSetTol(pcg_precond, pc_tol); - HYPRE_BoomerAMGSetCoarsenType(pcg_precond, (hybrid*coarsen_type)); + HYPRE_BoomerAMGSetCoarsenType(pcg_precond, (hybrid * coarsen_type)); HYPRE_BoomerAMGSetCoarsenCutFactor(pcg_precond, coarsen_cut_factor); HYPRE_BoomerAMGSetCPoints(pcg_precond, max_levels, num_cpt, cpt_index); HYPRE_BoomerAMGSetFPoints(pcg_precond, num_fpt, fpt_index); @@ -4780,7 +5988,7 @@ main( hypre_int argc, HYPRE_BoomerAMGSetJacobiTruncThreshold(pcg_precond, jacobi_trunc_threshold); HYPRE_BoomerAMGSetPrintLevel(pcg_precond, poutdat); HYPRE_BoomerAMGSetPrintFileName(pcg_precond, "driver.out.log"); - HYPRE_BoomerAMGSetMaxIter(pcg_precond, 1); + HYPRE_BoomerAMGSetMaxIter(pcg_precond, precon_cycles); HYPRE_BoomerAMGSetCycleType(pcg_precond, cycle_type); HYPRE_BoomerAMGSetFCycle(pcg_precond, fcycle); HYPRE_BoomerAMGSetNumSweeps(pcg_precond, num_sweeps); @@ -4800,11 +6008,14 @@ main( hypre_int argc, HYPRE_BoomerAMGSetMaxLevels(pcg_precond, max_levels); HYPRE_BoomerAMGSetMaxRowSum(pcg_precond, max_row_sum); HYPRE_BoomerAMGSetDebugFlag(pcg_precond, debug_flag); + HYPRE_BoomerAMGSetFilterFunctions(pcg_precond, filter_functions); HYPRE_BoomerAMGSetNumFunctions(pcg_precond, num_functions); HYPRE_BoomerAMGSetNumPaths(pcg_precond, num_paths); HYPRE_BoomerAMGSetAggNumLevels(pcg_precond, agg_num_levels); if (num_functions > 1) + { HYPRE_BoomerAMGSetDofFunc(pcg_precond, dof_func); + } HYPRE_PCGSetPrecond(pcg_solver, (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, @@ -4813,7 +6024,7 @@ main( hypre_int argc, else if (solver_id == 43) { /* use Euclid preconditioning */ - if (myid == 0) hypre_printf("Solver: Euclid-PCG\n"); + if (myid == 0) { hypre_printf("Solver: Euclid-PCG\n"); } HYPRE_EuclidCreate(hypre_MPI_COMM_WORLD, &pcg_precond); @@ -4832,20 +6043,23 @@ main( hypre_int argc, else if (solver_id != NO_SOLVER ) { if ( verbosity ) + { hypre_printf("Solver ID not recognized - running inner PCG iterations without preconditioner\n\n"); + } } HYPRE_PCGGetPrecond(pcg_solver, &pcg_precond_gotten); if (pcg_precond_gotten != pcg_precond) { hypre_printf("HYPRE_ParCSRPCGGetPrecond got bad precond\n"); - return(-1); + return (-1); + } + else if (myid == 0) + { + hypre_printf("HYPRE_ParCSRPCGGetPrecond got good precond\n"); } - else - if (myid == 0) - hypre_printf("HYPRE_ParCSRPCGGetPrecond got good precond\n"); - /* HYPRE_PCGSetup(pcg_solver, (HYPRE_Matrix)parcsr_A, + /* HYPRE_PCGSetup(pcg_solver, (HYPRE_Matrix)parcsr_M, * (HYPRE_Vector)b, (HYPRE_Vector)x); */ hypre_EndTiming(time_index); @@ -4875,29 +6089,36 @@ main( hypre_int argc, HYPRE_LOBPCGSetupB(lobpcg_solver, (HYPRE_Matrix)parcsr_B, (HYPRE_Vector)x); - if ( vFromFileFlag ) { + if ( vFromFileFlag ) + { eigenvectors = mv_MultiVectorWrap( interpreter, HYPRE_ParCSRMultiVectorRead(hypre_MPI_COMM_WORLD, interpreter, - "vectors" ),1); + "vectors" ), 1); hypre_assert( eigenvectors != NULL ); blockSize = mv_MultiVectorWidth( eigenvectors ); } - else { + else + { eigenvectors = mv_MultiVectorCreateFromSampleVector( interpreter, blockSize, x ); if ( lobpcgSeed ) + { mv_MultiVectorSetRandom( eigenvectors, lobpcgSeed ); + } else + { mv_MultiVectorSetRandom( eigenvectors, (HYPRE_Int)time(0) ); + } } - if ( constrained ) { + if ( constrained ) + { constraints = mv_MultiVectorWrap( interpreter, HYPRE_ParCSRMultiVectorRead(hypre_MPI_COMM_WORLD, interpreter, - "vectors" ),1); + "vectors" ), 1); hypre_assert( constraints != NULL ); } @@ -4914,7 +6135,8 @@ main( hypre_int argc, hypre_ClearTiming(); - if ( checkOrtho ) { + if ( checkOrtho ) + { gramXX = utilities_FortranMatrixCreate(); identity = utilities_FortranMatrixCreate(); @@ -4922,7 +6144,8 @@ main( hypre_int argc, utilities_FortranMatrixAllocateData( blockSize, blockSize, gramXX ); utilities_FortranMatrixAllocateData( blockSize, blockSize, identity ); - if ( lobpcgGen ) { + if ( lobpcgGen ) + { workspace = mv_MultiVectorCreateCopy( eigenvectors, 0 ); hypre_LOBPCGMultiOperatorB( lobpcg_solver, mv_MultiVectorGetData(eigenvectors), @@ -4930,40 +6153,53 @@ main( hypre_int argc, lobpcg_MultiVectorByMultiVector( eigenvectors, workspace, gramXX ); } else + { lobpcg_MultiVectorByMultiVector( eigenvectors, eigenvectors, gramXX ); + } utilities_FortranMatrixSetToIdentity( identity ); utilities_FortranMatrixAdd( -1, identity, gramXX, gramXX ); nonOrthF = utilities_FortranMatrixFNorm( gramXX ); if ( myid == 0 ) + { hypre_printf("Non-orthonormality of eigenvectors: %12.5e\n", nonOrthF); + } utilities_FortranMatrixDestroy( gramXX ); utilities_FortranMatrixDestroy( identity ); } - if ( printLevel ) { + if ( printLevel ) + { HYPRE_ParCSRMultiVectorPrint( mv_MultiVectorGetData(eigenvectors), "vectors" ); - if ( myid == 0 ) { - if ( (filePtr = fopen("values.txt", "w")) ) { + if ( myid == 0 ) + { + if ( (filePtr = fopen("values.txt", "w")) ) + { hypre_fprintf(filePtr, "%d\n", blockSize); for ( i = 0; i < blockSize; i++ ) + { hypre_fprintf(filePtr, "%22.14e\n", eigenvalues[i]); + } fclose(filePtr); } - if ( (filePtr = fopen("residuals.txt", "w")) ) { + if ( (filePtr = fopen("residuals.txt", "w")) ) + { residualNorms = HYPRE_LOBPCGResidualNorms( lobpcg_solver ); residuals = utilities_FortranMatrixValues( residualNorms ); hypre_fprintf(filePtr, "%d\n", blockSize); for ( i = 0; i < blockSize; i++ ) + { hypre_fprintf(filePtr, "%22.14e\n", residuals[i]); + } fclose(filePtr); } - if ( printLevel > 1 ) { + if ( printLevel > 1 ) + { printBuffer = utilities_FortranMatrixCreate(); @@ -4986,9 +6222,13 @@ main( hypre_int argc, HYPRE_LOBPCGDestroy(lobpcg_solver); mv_MultiVectorDestroy( eigenvectors ); if ( constrained ) + { mv_MultiVectorDestroy( constraints ); + } if ( lobpcgGen ) + { mv_MultiVectorDestroy( workspace ); + } hypre_TFree(eigenvalues, HYPRE_MEMORY_HOST); HYPRE_ParCSRPCGDestroy(pcg_solver); @@ -5015,12 +6255,15 @@ main( hypre_int argc, } } - else { /* pcgIterations <= 0 --> use the preconditioner directly */ + else /* pcgIterations <= 0 --> use the preconditioner directly */ + { time_index = hypre_InitializeTiming("LOBPCG Setup"); hypre_BeginTiming(time_index); if (myid != 0) + { verbosity = 0; + } HYPRE_LOBPCGCreate(interpreter, &matvec_fn, &pcg_solver); HYPRE_LOBPCGSetMaxIter(pcg_solver, maxIterations); HYPRE_LOBPCGSetTol(pcg_solver, tol); @@ -5032,7 +6275,9 @@ main( hypre_int argc, { /* use BoomerAMG as preconditioner */ if (myid == 0) + { hypre_printf("Solver: AMG-PCG\n"); + } HYPRE_BoomerAMGCreate(&pcg_precond); /* BM Aug 25, 2006 */ @@ -5040,7 +6285,7 @@ main( hypre_int argc, HYPRE_BoomerAMGSetInterpType(pcg_precond, interp_type); HYPRE_BoomerAMGSetNumSamples(pcg_precond, gsmg_samples); HYPRE_BoomerAMGSetTol(pcg_precond, pc_tol); - HYPRE_BoomerAMGSetCoarsenType(pcg_precond, (hybrid*coarsen_type)); + HYPRE_BoomerAMGSetCoarsenType(pcg_precond, (hybrid * coarsen_type)); HYPRE_BoomerAMGSetCoarsenCutFactor(pcg_precond, coarsen_cut_factor); HYPRE_BoomerAMGSetCPoints(pcg_precond, max_levels, num_cpt, cpt_index); HYPRE_BoomerAMGSetFPoints(pcg_precond, num_fpt, fpt_index); @@ -5053,17 +6298,23 @@ main( hypre_int argc, HYPRE_BoomerAMGSetJacobiTruncThreshold(pcg_precond, jacobi_trunc_threshold); HYPRE_BoomerAMGSetPrintLevel(pcg_precond, poutdat); HYPRE_BoomerAMGSetPrintFileName(pcg_precond, "driver.out.log"); - HYPRE_BoomerAMGSetMaxIter(pcg_precond, 1); + HYPRE_BoomerAMGSetMaxIter(pcg_precond, precon_cycles); HYPRE_BoomerAMGSetCycleType(pcg_precond, cycle_type); HYPRE_BoomerAMGSetFCycle(pcg_precond, fcycle); HYPRE_BoomerAMGSetNumSweeps(pcg_precond, num_sweeps); - if (relax_type > -1) HYPRE_BoomerAMGSetRelaxType(pcg_precond, relax_type); + if (relax_type > -1) { HYPRE_BoomerAMGSetRelaxType(pcg_precond, relax_type); } if (relax_down > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_down, 1); + } if (relax_up > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_up, 2); + } if (relax_coarse > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_coarse, 3); + } HYPRE_BoomerAMGSetAddRelaxType(pcg_precond, add_relax_type); HYPRE_BoomerAMGSetAddRelaxWt(pcg_precond, add_relax_wt); HYPRE_BoomerAMGSetRelaxWt(pcg_precond, relax_wt); @@ -5075,6 +6326,7 @@ main( hypre_int argc, HYPRE_BoomerAMGSetMaxLevels(pcg_precond, max_levels); HYPRE_BoomerAMGSetMaxRowSum(pcg_precond, max_row_sum); HYPRE_BoomerAMGSetDebugFlag(pcg_precond, debug_flag); + HYPRE_BoomerAMGSetFilterFunctions(pcg_precond, filter_functions); HYPRE_BoomerAMGSetNumFunctions(pcg_precond, num_functions); HYPRE_BoomerAMGSetNumPaths(pcg_precond, num_paths); HYPRE_BoomerAMGSetAggNumLevels(pcg_precond, agg_num_levels); @@ -5083,7 +6335,9 @@ main( hypre_int argc, HYPRE_BoomerAMGSetDomainType(pcg_precond, domain_type); HYPRE_BoomerAMGSetSchwarzRlxWeight(pcg_precond, schwarz_rlx_weight); if (num_functions > 1) + { HYPRE_BoomerAMGSetDofFunc(pcg_precond, dof_func); + } HYPRE_LOBPCGSetPrecond(pcg_solver, (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, @@ -5094,7 +6348,9 @@ main( hypre_int argc, /* use diagonal scaling as preconditioner */ if (myid == 0) + { hypre_printf("Solver: DS-PCG\n"); + } pcg_precond = NULL; @@ -5107,7 +6363,9 @@ main( hypre_int argc, { /* use ParaSails preconditioner */ if (myid == 0) + { hypre_printf("Solver: ParaSails-PCG\n"); + } HYPRE_ParaSailsCreate(hypre_MPI_COMM_WORLD, &pcg_precond); HYPRE_ParaSailsSetParams(pcg_precond, sai_threshold, max_levels); @@ -5123,7 +6381,9 @@ main( hypre_int argc, { /* use Schwarz preconditioner */ if (myid == 0) + { hypre_printf("Solver: Schwarz-PCG\n"); + } HYPRE_SchwarzCreate(&pcg_precond); HYPRE_SchwarzSetVariant(pcg_precond, variant); @@ -5146,7 +6406,7 @@ main( hypre_int argc, relax_type = relax_default; relax_order = 0; - if (myid == 0) hypre_printf("Solver: GSMG-PCG\n"); + if (myid == 0) { hypre_printf("Solver: GSMG-PCG\n"); } HYPRE_BoomerAMGCreate(&pcg_precond); /* BM Aug 25, 2006 */ HYPRE_BoomerAMGSetCGCIts(pcg_precond, cgcits); @@ -5154,7 +6414,7 @@ main( hypre_int argc, HYPRE_BoomerAMGSetInterpType(pcg_precond, interp_type); HYPRE_BoomerAMGSetNumSamples(pcg_precond, gsmg_samples); HYPRE_BoomerAMGSetTol(pcg_precond, pc_tol); - HYPRE_BoomerAMGSetCoarsenType(pcg_precond, (hybrid*coarsen_type)); + HYPRE_BoomerAMGSetCoarsenType(pcg_precond, (hybrid * coarsen_type)); HYPRE_BoomerAMGSetCoarsenCutFactor(pcg_precond, coarsen_cut_factor); HYPRE_BoomerAMGSetCPoints(pcg_precond, max_levels, num_cpt, cpt_index); HYPRE_BoomerAMGSetFPoints(pcg_precond, num_fpt, fpt_index); @@ -5167,7 +6427,7 @@ main( hypre_int argc, HYPRE_BoomerAMGSetJacobiTruncThreshold(pcg_precond, jacobi_trunc_threshold); HYPRE_BoomerAMGSetPrintLevel(pcg_precond, poutdat); HYPRE_BoomerAMGSetPrintFileName(pcg_precond, "driver.out.log"); - HYPRE_BoomerAMGSetMaxIter(pcg_precond, 1); + HYPRE_BoomerAMGSetMaxIter(pcg_precond, precon_cycles); HYPRE_BoomerAMGSetCycleType(pcg_precond, cycle_type); HYPRE_BoomerAMGSetFCycle(pcg_precond, fcycle); HYPRE_BoomerAMGSetNumSweeps(pcg_precond, num_sweeps); @@ -5187,11 +6447,14 @@ main( hypre_int argc, HYPRE_BoomerAMGSetMaxLevels(pcg_precond, max_levels); HYPRE_BoomerAMGSetMaxRowSum(pcg_precond, max_row_sum); HYPRE_BoomerAMGSetDebugFlag(pcg_precond, debug_flag); + HYPRE_BoomerAMGSetFilterFunctions(pcg_precond, filter_functions); HYPRE_BoomerAMGSetNumFunctions(pcg_precond, num_functions); HYPRE_BoomerAMGSetNumPaths(pcg_precond, num_paths); HYPRE_BoomerAMGSetAggNumLevels(pcg_precond, agg_num_levels); if (num_functions > 1) + { HYPRE_BoomerAMGSetDofFunc(pcg_precond, dof_func); + } HYPRE_LOBPCGSetPrecond(pcg_solver, (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, @@ -5202,7 +6465,9 @@ main( hypre_int argc, { /* use Euclid preconditioning */ if (myid == 0) + { hypre_printf("Solver: Euclid-PCG\n"); + } HYPRE_EuclidCreate(hypre_MPI_COMM_WORLD, &pcg_precond); @@ -5220,18 +6485,21 @@ main( hypre_int argc, else if (solver_id != NO_SOLVER ) { if ( verbosity ) + { hypre_printf("Solver ID not recognized - running LOBPCG without preconditioner\n\n"); + } } HYPRE_LOBPCGGetPrecond(pcg_solver, &pcg_precond_gotten); if (pcg_precond_gotten != pcg_precond && pcgIterations) { hypre_printf("HYPRE_ParCSRLOBPCGGetPrecond got bad precond\n"); - return(-1); + return (-1); + } + else if (myid == 0) + { + hypre_printf("HYPRE_ParCSRLOBPCGGetPrecond got good precond\n"); } - else - if (myid == 0) - hypre_printf("HYPRE_ParCSRLOBPCGGetPrecond got good precond\n"); HYPRE_LOBPCGSetup(pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, (HYPRE_Vector)x); @@ -5245,29 +6513,36 @@ main( hypre_int argc, hypre_FinalizeTiming(time_index); hypre_ClearTiming(); - if ( vFromFileFlag ) { + if ( vFromFileFlag ) + { eigenvectors = mv_MultiVectorWrap( interpreter, HYPRE_ParCSRMultiVectorRead(hypre_MPI_COMM_WORLD, interpreter, - "vectors" ),1); + "vectors" ), 1); hypre_assert( eigenvectors != NULL ); blockSize = mv_MultiVectorWidth( eigenvectors ); } - else { + else + { eigenvectors = mv_MultiVectorCreateFromSampleVector( interpreter, blockSize, x ); if ( lobpcgSeed ) + { mv_MultiVectorSetRandom( eigenvectors, lobpcgSeed ); + } else + { mv_MultiVectorSetRandom( eigenvectors, (HYPRE_Int)time(0) ); + } } - if ( constrained ) { + if ( constrained ) + { constraints = mv_MultiVectorWrap( interpreter, HYPRE_ParCSRMultiVectorRead(hypre_MPI_COMM_WORLD, interpreter, - "vectors" ),1); + "vectors" ), 1); hypre_assert( constraints != NULL ); } @@ -5283,7 +6558,8 @@ main( hypre_int argc, hypre_FinalizeTiming(time_index); hypre_ClearTiming(); - if ( checkOrtho ) { + if ( checkOrtho ) + { gramXX = utilities_FortranMatrixCreate(); identity = utilities_FortranMatrixCreate(); @@ -5291,7 +6567,8 @@ main( hypre_int argc, utilities_FortranMatrixAllocateData( blockSize, blockSize, gramXX ); utilities_FortranMatrixAllocateData( blockSize, blockSize, identity ); - if ( lobpcgGen ) { + if ( lobpcgGen ) + { workspace = mv_MultiVectorCreateCopy( eigenvectors, 0 ); hypre_LOBPCGMultiOperatorB( pcg_solver, mv_MultiVectorGetData(eigenvectors), @@ -5299,40 +6576,53 @@ main( hypre_int argc, lobpcg_MultiVectorByMultiVector( eigenvectors, workspace, gramXX ); } else + { lobpcg_MultiVectorByMultiVector( eigenvectors, eigenvectors, gramXX ); + } utilities_FortranMatrixSetToIdentity( identity ); utilities_FortranMatrixAdd( -1, identity, gramXX, gramXX ); nonOrthF = utilities_FortranMatrixFNorm( gramXX ); if ( myid == 0 ) + { hypre_printf("Non-orthonormality of eigenvectors: %12.5e\n", nonOrthF); + } utilities_FortranMatrixDestroy( gramXX ); utilities_FortranMatrixDestroy( identity ); } - if ( printLevel ) { + if ( printLevel ) + { HYPRE_ParCSRMultiVectorPrint( mv_MultiVectorGetData(eigenvectors), "vectors" ); - if ( myid == 0 ) { - if ( (filePtr = fopen("values.txt", "w")) ) { + if ( myid == 0 ) + { + if ( (filePtr = fopen("values.txt", "w")) ) + { hypre_fprintf(filePtr, "%d\n", blockSize); for ( i = 0; i < blockSize; i++ ) + { hypre_fprintf(filePtr, "%22.14e\n", eigenvalues[i]); + } fclose(filePtr); } - if ( (filePtr = fopen("residuals.txt", "w")) ) { + if ( (filePtr = fopen("residuals.txt", "w")) ) + { residualNorms = HYPRE_LOBPCGResidualNorms( pcg_solver ); residuals = utilities_FortranMatrixValues( residualNorms ); hypre_fprintf(filePtr, "%d\n", blockSize); for ( i = 0; i < blockSize; i++ ) + { hypre_fprintf(filePtr, "%22.14e\n", residuals[i]); + } fclose(filePtr); } - if ( printLevel > 1 ) { + if ( printLevel > 1 ) + { printBuffer = utilities_FortranMatrixCreate(); @@ -5353,13 +6643,19 @@ main( hypre_int argc, } } -#if SECOND_TIME - /* run a second time to check for memory leaks */ - mv_MultiVectorSetRandom( eigenvectors, 775 ); - HYPRE_LOBPCGSetup(pcg_solver, (HYPRE_Matrix)parcsr_A, - (HYPRE_Vector)b, (HYPRE_Vector)x); - HYPRE_LOBPCGSolve(pcg_solver, constraints, eigenvectors, eigenvalues ); + if (second_time) + { + /* run a second time [for timings, to check for memory leaks] */ + mv_MultiVectorSetRandom( eigenvectors, 775 ); +#if defined(HYPRE_USING_CURAND) || defined(HYPRE_USING_ROCRAND) + hypre_ResetDeviceRandGenerator(1234ULL, 0ULL); #endif + hypre_ParVectorCopy(x0_save, x); + + HYPRE_LOBPCGSetup(pcg_solver, (HYPRE_Matrix)parcsr_A, + (HYPRE_Vector)b, (HYPRE_Vector)x); + HYPRE_LOBPCGSolve(pcg_solver, constraints, eigenvectors, eigenvalues ); + } HYPRE_LOBPCGDestroy(pcg_solver); @@ -5386,16 +6682,22 @@ main( hypre_int argc, mv_MultiVectorDestroy( eigenvectors ); if ( constrained ) + { mv_MultiVectorDestroy( constraints ); + } if ( lobpcgGen ) + { mv_MultiVectorDestroy( workspace ); + } hypre_TFree(eigenvalues, HYPRE_MEMORY_HOST); } /* if ( pcgIterations > 0 ) */ - hypre_TFree( interpreter , HYPRE_MEMORY_HOST); + hypre_TFree( interpreter, HYPRE_MEMORY_HOST); if ( lobpcgGen ) + { HYPRE_IJMatrixDestroy(ij_B); + } } /* if ( lobpcgFlag ) */ @@ -5409,6 +6711,7 @@ main( hypre_int argc, solver_id == 15 || solver_id == 18 || solver_id == 44 || solver_id == 81 || solver_id == 91) { + HYPRE_ANNOTATE_REGION_BEGIN("%s", "Run-1"); time_index = hypre_InitializeTiming("GMRES Setup"); hypre_BeginTiming(time_index); @@ -5426,13 +6729,13 @@ main( hypre_int argc, if (solver_id == 3) { /* use BoomerAMG as preconditioner */ - if (myid == 0) hypre_printf("Solver: AMG-GMRES\n"); + if (myid == 0) { hypre_printf("Solver: AMG-GMRES\n"); } HYPRE_BoomerAMGCreate(&amg_precond); } else { /* use BoomerAMG-DD as preconditioner */ - if (myid == 0) hypre_printf("Solver: AMG-DD-GMRES\n"); + if (myid == 0) { hypre_printf("Solver: AMG-DD-GMRES\n"); } HYPRE_BoomerAMGDDCreate(&pcg_precond); HYPRE_BoomerAMGDDGetAMG(pcg_precond, &amg_precond); @@ -5480,7 +6783,7 @@ main( hypre_int argc, HYPRE_BoomerAMGSetSCommPkgSwitch(amg_precond, S_commpkg_switch); HYPRE_BoomerAMGSetPrintLevel(amg_precond, poutdat); HYPRE_BoomerAMGSetPrintFileName(amg_precond, "driver.out.log"); - HYPRE_BoomerAMGSetMaxIter(amg_precond, 1); + HYPRE_BoomerAMGSetMaxIter(amg_precond, precon_cycles); HYPRE_BoomerAMGSetCycleType(amg_precond, cycle_type); HYPRE_BoomerAMGSetFCycle(amg_precond, fcycle); HYPRE_BoomerAMGSetNumSweeps(amg_precond, num_sweeps); @@ -5489,13 +6792,19 @@ main( hypre_int argc, HYPRE_BoomerAMGSetCRRate(amg_precond, CR_rate); HYPRE_BoomerAMGSetCRStrongTh(amg_precond, CR_strong_th); HYPRE_BoomerAMGSetCRUseCG(amg_precond, CR_use_CG); - if (relax_type > -1) HYPRE_BoomerAMGSetRelaxType(amg_precond, relax_type); + if (relax_type > -1) { HYPRE_BoomerAMGSetRelaxType(amg_precond, relax_type); } if (relax_down > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(amg_precond, relax_down, 1); + } if (relax_up > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(amg_precond, relax_up, 2); + } if (relax_coarse > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(amg_precond, relax_coarse, 3); + } HYPRE_BoomerAMGSetAddRelaxType(amg_precond, add_relax_type); HYPRE_BoomerAMGSetAddRelaxWt(amg_precond, add_relax_wt); HYPRE_BoomerAMGSetChebyOrder(amg_precond, cheby_order); @@ -5507,15 +6816,20 @@ main( hypre_int argc, HYPRE_BoomerAMGSetRelaxWt(amg_precond, relax_wt); HYPRE_BoomerAMGSetOuterWt(amg_precond, outer_wt); if (level_w > -1) - HYPRE_BoomerAMGSetLevelRelaxWt(amg_precond, relax_wt_level,level_w); + { + HYPRE_BoomerAMGSetLevelRelaxWt(amg_precond, relax_wt_level, level_w); + } if (level_ow > -1) - HYPRE_BoomerAMGSetLevelOuterWt(amg_precond,outer_wt_level,level_ow); + { + HYPRE_BoomerAMGSetLevelOuterWt(amg_precond, outer_wt_level, level_ow); + } HYPRE_BoomerAMGSetSmoothType(amg_precond, smooth_type); HYPRE_BoomerAMGSetSmoothNumLevels(amg_precond, smooth_num_levels); HYPRE_BoomerAMGSetSmoothNumSweeps(amg_precond, smooth_num_sweeps); HYPRE_BoomerAMGSetMaxLevels(amg_precond, max_levels); HYPRE_BoomerAMGSetMaxRowSum(amg_precond, max_row_sum); HYPRE_BoomerAMGSetDebugFlag(amg_precond, debug_flag); + HYPRE_BoomerAMGSetFilterFunctions(amg_precond, filter_functions); HYPRE_BoomerAMGSetNumFunctions(amg_precond, num_functions); HYPRE_BoomerAMGSetAggNumLevels(amg_precond, agg_num_levels); HYPRE_BoomerAMGSetAggInterpType(amg_precond, agg_interp_type); @@ -5531,10 +6845,32 @@ main( hypre_int argc, HYPRE_BoomerAMGSetDomainType(amg_precond, domain_type); HYPRE_BoomerAMGSetSchwarzUseNonSymm(amg_precond, use_nonsymm_schwarz); HYPRE_BoomerAMGSetSchwarzRlxWeight(amg_precond, schwarz_rlx_weight); - if (eu_level < 0) eu_level = 0; + if (eu_level < 0) { eu_level = 0; } HYPRE_BoomerAMGSetEuLevel(amg_precond, eu_level); HYPRE_BoomerAMGSetEuBJ(amg_precond, eu_bj); HYPRE_BoomerAMGSetEuSparseA(amg_precond, eu_sparse_A); + HYPRE_BoomerAMGSetILUType(amg_precond, ilu_type); + HYPRE_BoomerAMGSetILULevel(amg_precond, ilu_lfil); + HYPRE_BoomerAMGSetILUDroptol(amg_precond, ilu_droptol); + HYPRE_BoomerAMGSetILUMaxRowNnz(amg_precond, ilu_max_row_nnz); + HYPRE_BoomerAMGSetILUMaxIter(amg_precond, ilu_sm_max_iter); + HYPRE_BoomerAMGSetILUTriSolve(amg_precond, ilu_tri_solve); + HYPRE_BoomerAMGSetILULowerJacobiIters(amg_precond, ilu_ljac_iters); + HYPRE_BoomerAMGSetILUUpperJacobiIters(amg_precond, ilu_ujac_iters); + HYPRE_BoomerAMGSetILULocalReordering(amg_precond, ilu_reordering); + HYPRE_BoomerAMGSetILUIterSetupType(amg_precond, ilu_iter_setup_type); + HYPRE_BoomerAMGSetILUIterSetupOption(amg_precond, ilu_iter_setup_option); + HYPRE_BoomerAMGSetILUIterSetupMaxIter(amg_precond, ilu_iter_setup_max_iter); + HYPRE_BoomerAMGSetILUIterSetupTolerance(amg_precond, ilu_iter_setup_tolerance); + HYPRE_BoomerAMGSetFSAIAlgoType(amg_precond, fsai_algo_type); + HYPRE_BoomerAMGSetFSAILocalSolveType(amg_precond, fsai_ls_type); + HYPRE_BoomerAMGSetFSAIMaxSteps(amg_precond, fsai_max_steps); + HYPRE_BoomerAMGSetFSAIMaxStepSize(amg_precond, fsai_max_step_size); + HYPRE_BoomerAMGSetFSAIMaxNnzRow(amg_precond, fsai_max_nnz_row); + HYPRE_BoomerAMGSetFSAINumLevels(amg_precond, fsai_num_levels); + HYPRE_BoomerAMGSetFSAIThreshold(amg_precond, fsai_threshold); + HYPRE_BoomerAMGSetFSAIEigMaxIters(amg_precond, fsai_eig_max_iters); + HYPRE_BoomerAMGSetFSAIKapTolerance(amg_precond, fsai_kap_tolerance); HYPRE_BoomerAMGSetCycleNumSweeps(amg_precond, ns_coarse, 3); if (ns_down > -1) { @@ -5545,7 +6881,9 @@ main( hypre_int argc, HYPRE_BoomerAMGSetCycleNumSweeps(amg_precond, ns_up, 2); } if (num_functions > 1) + { HYPRE_BoomerAMGSetDofFunc(amg_precond, dof_func); + } HYPRE_BoomerAMGSetAdditive(amg_precond, additive); HYPRE_BoomerAMGSetMultAdditive(amg_precond, mult_add); HYPRE_BoomerAMGSetSimple(amg_precond, simple); @@ -5560,9 +6898,11 @@ main( hypre_int argc, #endif if (nongalerk_tol) { - HYPRE_BoomerAMGSetNonGalerkinTol(amg_precond, nongalerk_tol[nongalerk_num_tol-1]); - for (i=0; i < nongalerk_num_tol-1; i++) + HYPRE_BoomerAMGSetNonGalerkinTol(amg_precond, nongalerk_tol[nongalerk_num_tol - 1]); + for (i = 0; i < nongalerk_num_tol - 1; i++) + { HYPRE_BoomerAMGSetLevelNonGalerkinTol(amg_precond, nongalerk_tol[i], i); + } } if (build_rbm) { @@ -5592,7 +6932,7 @@ main( hypre_int argc, else if (solver_id == 4) { /* use diagonal scaling as preconditioner */ - if (myid == 0) hypre_printf("Solver: DS-GMRES\n"); + if (myid == 0) { hypre_printf("Solver: DS-GMRES\n"); } pcg_precond = NULL; HYPRE_GMRESSetPrecond(pcg_solver, @@ -5603,10 +6943,11 @@ main( hypre_int argc, else if (solver_id == 7) { /* use PILUT as preconditioner */ - if (myid == 0) hypre_printf("Solver: PILUT-GMRES\n"); + if (myid == 0) { hypre_printf("Solver: PILUT-GMRES\n"); } ierr = HYPRE_ParCSRPilutCreate( hypre_MPI_COMM_WORLD, &pcg_precond ); - if (ierr) { + if (ierr) + { hypre_printf("Error in ParPilutCreate\n"); } @@ -5631,7 +6972,7 @@ main( hypre_int argc, relax_order = 0; - if (myid == 0) hypre_printf("Solver: GSMG-GMRES\n"); + if (myid == 0) { hypre_printf("Solver: GSMG-GMRES\n"); } HYPRE_BoomerAMGCreate(&pcg_precond); HYPRE_BoomerAMGSetGSMG(pcg_precond, 4); HYPRE_BoomerAMGSetCGCIts(pcg_precond, cgcits); @@ -5656,7 +6997,7 @@ main( hypre_int argc, HYPRE_BoomerAMGSetSCommPkgSwitch(pcg_precond, S_commpkg_switch); HYPRE_BoomerAMGSetPrintLevel(pcg_precond, poutdat); HYPRE_BoomerAMGSetPrintFileName(pcg_precond, "driver.out.log"); - HYPRE_BoomerAMGSetMaxIter(pcg_precond, 1); + HYPRE_BoomerAMGSetMaxIter(pcg_precond, precon_cycles); HYPRE_BoomerAMGSetCycleType(pcg_precond, cycle_type); HYPRE_BoomerAMGSetFCycle(pcg_precond, fcycle); HYPRE_BoomerAMGSetNumSweeps(pcg_precond, num_sweeps); @@ -5665,13 +7006,19 @@ main( hypre_int argc, HYPRE_BoomerAMGSetCRRate(pcg_precond, CR_rate); HYPRE_BoomerAMGSetCRStrongTh(pcg_precond, CR_strong_th); HYPRE_BoomerAMGSetCRUseCG(pcg_precond, CR_use_CG); - if (relax_type > -1) HYPRE_BoomerAMGSetRelaxType(pcg_precond, relax_type); + if (relax_type > -1) { HYPRE_BoomerAMGSetRelaxType(pcg_precond, relax_type); } if (relax_down > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_down, 1); + } if (relax_up > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_up, 2); + } if (relax_coarse > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_coarse, 3); + } HYPRE_BoomerAMGSetAddRelaxType(pcg_precond, add_relax_type); HYPRE_BoomerAMGSetAddRelaxWt(pcg_precond, add_relax_wt); HYPRE_BoomerAMGSetChebyOrder(pcg_precond, cheby_order); @@ -5683,9 +7030,13 @@ main( hypre_int argc, HYPRE_BoomerAMGSetRelaxWt(pcg_precond, relax_wt); HYPRE_BoomerAMGSetOuterWt(pcg_precond, outer_wt); if (level_w > -1) - HYPRE_BoomerAMGSetLevelRelaxWt(pcg_precond, relax_wt_level,level_w); + { + HYPRE_BoomerAMGSetLevelRelaxWt(pcg_precond, relax_wt_level, level_w); + } if (level_ow > -1) - HYPRE_BoomerAMGSetLevelOuterWt(pcg_precond,outer_wt_level,level_ow); + { + HYPRE_BoomerAMGSetLevelOuterWt(pcg_precond, outer_wt_level, level_ow); + } HYPRE_BoomerAMGSetSmoothType(pcg_precond, smooth_type); HYPRE_BoomerAMGSetSmoothNumLevels(pcg_precond, smooth_num_levels); HYPRE_BoomerAMGSetSmoothNumSweeps(pcg_precond, smooth_num_sweeps); @@ -5694,13 +7045,36 @@ main( hypre_int argc, HYPRE_BoomerAMGSetDomainType(pcg_precond, domain_type); HYPRE_BoomerAMGSetSchwarzUseNonSymm(pcg_precond, use_nonsymm_schwarz); HYPRE_BoomerAMGSetSchwarzRlxWeight(pcg_precond, schwarz_rlx_weight); - if (eu_level < 0) eu_level = 0; + if (eu_level < 0) { eu_level = 0; } HYPRE_BoomerAMGSetEuLevel(pcg_precond, eu_level); HYPRE_BoomerAMGSetEuBJ(pcg_precond, eu_bj); HYPRE_BoomerAMGSetEuSparseA(pcg_precond, eu_sparse_A); + HYPRE_BoomerAMGSetILUType(pcg_precond, ilu_type); + HYPRE_BoomerAMGSetILULevel(pcg_precond, ilu_lfil); + HYPRE_BoomerAMGSetILUDroptol(pcg_precond, ilu_droptol); + HYPRE_BoomerAMGSetILUMaxRowNnz(pcg_precond, ilu_max_row_nnz); + HYPRE_BoomerAMGSetILUMaxIter(pcg_precond, ilu_sm_max_iter); + HYPRE_BoomerAMGSetILUTriSolve(pcg_precond, ilu_tri_solve); + HYPRE_BoomerAMGSetILULowerJacobiIters(pcg_precond, ilu_ljac_iters); + HYPRE_BoomerAMGSetILUUpperJacobiIters(pcg_precond, ilu_ujac_iters); + HYPRE_BoomerAMGSetILULocalReordering(pcg_precond, ilu_reordering); + HYPRE_BoomerAMGSetILUIterSetupType(pcg_precond, ilu_iter_setup_type); + HYPRE_BoomerAMGSetILUIterSetupOption(pcg_precond, ilu_iter_setup_option); + HYPRE_BoomerAMGSetILUIterSetupMaxIter(pcg_precond, ilu_iter_setup_max_iter); + HYPRE_BoomerAMGSetILUIterSetupTolerance(pcg_precond, ilu_iter_setup_tolerance); + HYPRE_BoomerAMGSetFSAIAlgoType(pcg_precond, fsai_algo_type); + HYPRE_BoomerAMGSetFSAILocalSolveType(pcg_precond, fsai_ls_type); + HYPRE_BoomerAMGSetFSAIMaxSteps(pcg_precond, fsai_max_steps); + HYPRE_BoomerAMGSetFSAIMaxStepSize(pcg_precond, fsai_max_step_size); + HYPRE_BoomerAMGSetFSAIMaxNnzRow(pcg_precond, fsai_max_nnz_row); + HYPRE_BoomerAMGSetFSAINumLevels(pcg_precond, fsai_num_levels); + HYPRE_BoomerAMGSetFSAIThreshold(pcg_precond, fsai_threshold); + HYPRE_BoomerAMGSetFSAIEigMaxIters(pcg_precond, fsai_eig_max_iters); + HYPRE_BoomerAMGSetFSAIKapTolerance(pcg_precond, fsai_kap_tolerance); HYPRE_BoomerAMGSetMaxLevels(pcg_precond, max_levels); HYPRE_BoomerAMGSetMaxRowSum(pcg_precond, max_row_sum); HYPRE_BoomerAMGSetDebugFlag(pcg_precond, debug_flag); + HYPRE_BoomerAMGSetFilterFunctions(pcg_precond, filter_functions); HYPRE_BoomerAMGSetNumFunctions(pcg_precond, num_functions); HYPRE_BoomerAMGSetAggNumLevels(pcg_precond, agg_num_levels); HYPRE_BoomerAMGSetAggInterpType(pcg_precond, agg_interp_type); @@ -5713,7 +7087,9 @@ main( hypre_int argc, HYPRE_BoomerAMGSetNodalDiag(pcg_precond, nodal_diag); HYPRE_BoomerAMGSetCycleNumSweeps(pcg_precond, ns_coarse, 3); if (num_functions > 1) + { HYPRE_BoomerAMGSetDofFunc(pcg_precond, dof_func); + } HYPRE_BoomerAMGSetAdditive(pcg_precond, additive); HYPRE_BoomerAMGSetMultAdditive(pcg_precond, mult_add); HYPRE_BoomerAMGSetSimple(pcg_precond, simple); @@ -5728,9 +7104,11 @@ main( hypre_int argc, #endif if (nongalerk_tol) { - HYPRE_BoomerAMGSetNonGalerkinTol(pcg_precond, nongalerk_tol[nongalerk_num_tol-1]); - for (i=0; i < nongalerk_num_tol-1; i++) + HYPRE_BoomerAMGSetNonGalerkinTol(pcg_precond, nongalerk_tol[nongalerk_num_tol - 1]); + for (i = 0; i < nongalerk_num_tol - 1; i++) + { HYPRE_BoomerAMGSetLevelNonGalerkinTol(pcg_precond, nongalerk_tol[i], i); + } } HYPRE_GMRESSetMaxIter(pcg_solver, mg_max_iter); HYPRE_GMRESSetPrecond(pcg_solver, @@ -5741,7 +7119,7 @@ main( hypre_int argc, else if (solver_id == 18) { /* use ParaSails preconditioner */ - if (myid == 0) hypre_printf("Solver: ParaSails-GMRES\n"); + if (myid == 0) { hypre_printf("Solver: ParaSails-GMRES\n"); } HYPRE_ParaSailsCreate(hypre_MPI_COMM_WORLD, &pcg_precond); HYPRE_ParaSailsSetParams(pcg_precond, sai_threshold, max_levels); @@ -5757,15 +7135,15 @@ main( hypre_int argc, else if (solver_id == 44) { /* use Euclid preconditioning */ - if (myid == 0) hypre_printf("Solver: Euclid-GMRES\n"); + if (myid == 0) { hypre_printf("Solver: Euclid-GMRES\n"); } HYPRE_EuclidCreate(hypre_MPI_COMM_WORLD, &pcg_precond); - if (eu_level > -1) HYPRE_EuclidSetLevel(pcg_precond, eu_level); - if (eu_ilut) HYPRE_EuclidSetILUT(pcg_precond, eu_ilut); - if (eu_sparse_A) HYPRE_EuclidSetSparseA(pcg_precond, eu_sparse_A); - if (eu_row_scale) HYPRE_EuclidSetRowScale(pcg_precond, eu_row_scale); - if (eu_bj) HYPRE_EuclidSetBJ(pcg_precond, eu_bj); + if (eu_level > -1) { HYPRE_EuclidSetLevel(pcg_precond, eu_level); } + if (eu_ilut) { HYPRE_EuclidSetILUT(pcg_precond, eu_ilut); } + if (eu_sparse_A) { HYPRE_EuclidSetSparseA(pcg_precond, eu_sparse_A); } + if (eu_row_scale) { HYPRE_EuclidSetRowScale(pcg_precond, eu_row_scale); } + if (eu_bj) { HYPRE_EuclidSetBJ(pcg_precond, eu_bj); } HYPRE_EuclidSetStats(pcg_precond, eu_stats); HYPRE_EuclidSetMem(pcg_precond, eu_mem); /*HYPRE_EuclidSetParams(pcg_precond, argc, argv);*/ @@ -5778,24 +7156,32 @@ main( hypre_int argc, else if (solver_id == 81) { /* use hypre_ILU preconditioning */ - if (myid == 0) hypre_printf("Solver: ILU-GMRES\n"); + if (myid == 0) { hypre_printf("Solver: ILU-GMRES\n"); } /* create precon */ HYPRE_ILUCreate(&pcg_precond); HYPRE_ILUSetType(pcg_precond, ilu_type); HYPRE_ILUSetLevelOfFill(pcg_precond, ilu_lfil); + HYPRE_ILUSetLocalReordering(pcg_precond, ilu_reordering); + HYPRE_ILUSetTriSolve(pcg_precond, ilu_tri_solve); + HYPRE_ILUSetLowerJacobiIters(pcg_precond, ilu_ljac_iters); + HYPRE_ILUSetUpperJacobiIters(pcg_precond, ilu_ujac_iters); + HYPRE_ILUSetIterativeSetupType(pcg_precond, ilu_iter_setup_type); + HYPRE_ILUSetIterativeSetupOption(pcg_precond, ilu_iter_setup_option); + HYPRE_ILUSetIterativeSetupMaxIter(pcg_precond, ilu_iter_setup_max_iter); + HYPRE_ILUSetIterativeSetupTolerance(pcg_precond, ilu_iter_setup_tolerance); /* set print level */ - HYPRE_ILUSetPrintLevel(pcg_precond, 1); + HYPRE_ILUSetPrintLevel(pcg_precond, poutdat); /* set max iterations */ HYPRE_ILUSetMaxIter(pcg_precond, 1); HYPRE_ILUSetTol(pcg_precond, pc_tol); /* set max number of nonzeros per row */ - HYPRE_ILUSetMaxNnzPerRow(pcg_precond,ilu_max_row_nnz); + HYPRE_ILUSetMaxNnzPerRow(pcg_precond, ilu_max_row_nnz); /* set the droptol */ - HYPRE_ILUSetDropThreshold(pcg_precond,ilu_droptol); + HYPRE_ILUSetDropThreshold(pcg_precond, ilu_droptol); /* set max iterations for Schur system solve */ HYPRE_ILUSetSchurMaxIter( pcg_precond, ilu_schur_max_iter ); - if(ilu_type == 20 || ilu_type == 21) + if (ilu_type == 20 || ilu_type == 21) { HYPRE_ILUSetNSHDropThreshold( pcg_precond, ilu_nsh_droptol); } @@ -5812,7 +7198,7 @@ main( hypre_int argc, if (pcg_precond_gotten != ((solver_id == 3) ? amg_precond : pcg_precond)) { hypre_printf("HYPRE_GMRESGetPrecond got bad precond\n"); - return(-1); + return (-1); } else { @@ -5821,7 +7207,7 @@ main( hypre_int argc, hypre_printf("HYPRE_GMRESGetPrecond got good precond\n"); } } - HYPRE_GMRESSetup(pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, (HYPRE_Vector)x); + HYPRE_GMRESSetup(pcg_solver, (HYPRE_Matrix)parcsr_M, (HYPRE_Vector)b, (HYPRE_Vector)x); hypre_EndTiming(time_index); hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); @@ -5838,9 +7224,6 @@ main( hypre_int argc, hypre_FinalizeTiming(time_index); hypre_ClearTiming(); - HYPRE_GMRESGetNumIterations(pcg_solver, &num_iterations); - HYPRE_GMRESGetFinalRelativeResidualNorm(pcg_solver,&final_res_norm); - if (check_residual) { HYPRE_BigInt *indices_h, *indices_d; @@ -5848,7 +7231,7 @@ main( hypre_int argc, HYPRE_Int num_values = 20; HYPRE_ParCSRGMRESGetResidual(pcg_solver, &residual); HYPRE_ParCSRMatrixGetLocalRange( parcsr_A, - &first_local_row, &last_local_row , + &first_local_row, &last_local_row, &first_local_col, &last_local_col ); local_num_rows = (HYPRE_Int)(last_local_row - first_local_row + 1); if (local_num_rows < 20) @@ -5857,17 +7240,19 @@ main( hypre_int argc, } indices_h = hypre_TAlloc(HYPRE_BigInt, num_values, HYPRE_MEMORY_HOST); values_h = hypre_TAlloc(HYPRE_Complex, num_values, HYPRE_MEMORY_HOST); - indices_d = hypre_TAlloc(HYPRE_BigInt, num_values, HYPRE_MEMORY_DEVICE); - values_d = hypre_TAlloc(HYPRE_Complex, num_values, HYPRE_MEMORY_DEVICE); + indices_d = hypre_TAlloc(HYPRE_BigInt, num_values, memory_location); + values_d = hypre_TAlloc(HYPRE_Complex, num_values, memory_location); for (i = 0; i < num_values; i++) { indices_h[i] = first_local_row + i; } - hypre_TMemcpy(indices_d, indices_h, HYPRE_BigInt, num_values, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); + hypre_TMemcpy(indices_d, indices_h, HYPRE_BigInt, num_values, memory_location, + HYPRE_MEMORY_HOST); HYPRE_ParVectorGetValues((HYPRE_ParVector) residual, num_values, indices_d, values_d); - hypre_TMemcpy(values_h, values_d, HYPRE_Complex, num_values, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(values_h, values_d, HYPRE_Complex, num_values, HYPRE_MEMORY_HOST, + memory_location); for (i = 0; i < num_values; i++) { @@ -5878,18 +7263,34 @@ main( hypre_int argc, } hypre_TFree(indices_h, HYPRE_MEMORY_HOST); hypre_TFree(values_h, HYPRE_MEMORY_HOST); - hypre_TFree(indices_d, HYPRE_MEMORY_DEVICE); - hypre_TFree(values_d, HYPRE_MEMORY_DEVICE); + hypre_TFree(indices_d, memory_location); + hypre_TFree(values_d, memory_location); } + HYPRE_ANNOTATE_REGION_END("%s", "Run-1"); -#if SECOND_TIME - /* run a second time to check for memory leaks */ - HYPRE_ParVectorSetRandomValues(x, 775); - HYPRE_GMRESSetup(pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, - (HYPRE_Vector)x); - HYPRE_GMRESSolve(pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, - (HYPRE_Vector)x); + if (second_time) + { + HYPRE_ANNOTATE_REGION_BEGIN("%s", "Run-2"); + /* run a second time [for timings, to check for memory leaks] */ + HYPRE_ParVectorSetRandomValues(x, 775); +#if defined(HYPRE_USING_CURAND) || defined(HYPRE_USING_ROCRAND) + hypre_ResetDeviceRandGenerator(1234ULL, 0ULL); #endif + hypre_ParVectorCopy(x0_save, x); + + HYPRE_GMRESSetup(pcg_solver, + (HYPRE_Matrix) parcsr_M, + (HYPRE_Vector) b, + (HYPRE_Vector) x); + HYPRE_GMRESSolve(pcg_solver, + (HYPRE_Matrix) parcsr_A, + (HYPRE_Vector) b, + (HYPRE_Vector) x); + HYPRE_ANNOTATE_REGION_END("%s", "Run-2"); + } + + HYPRE_GMRESGetNumIterations(pcg_solver, &num_iterations); + HYPRE_GMRESGetFinalRelativeResidualNorm(pcg_solver, &final_res_norm); HYPRE_ParCSRGMRESDestroy(pcg_solver); @@ -5930,12 +7331,13 @@ main( hypre_int argc, hypre_printf("\n"); } } -/*----------------------------------------------------------- - * Solve the system using LGMRES - *-----------------------------------------------------------*/ + /*----------------------------------------------------------- + * Solve the system using LGMRES + *-----------------------------------------------------------*/ if (solver_id == 50 || solver_id == 51 ) { + HYPRE_ANNOTATE_REGION_BEGIN("%s", "Run-1"); time_index = hypre_InitializeTiming("LGMRES Setup"); hypre_BeginTiming(time_index); @@ -5951,7 +7353,7 @@ main( hypre_int argc, if (solver_id == 51) { /* use BoomerAMG as preconditioner */ - if (myid == 0) hypre_printf("Solver: AMG-LGMRES\n"); + if (myid == 0) { hypre_printf("Solver: AMG-LGMRES\n"); } HYPRE_BoomerAMGCreate(&pcg_precond); HYPRE_BoomerAMGSetCGCIts(pcg_precond, cgcits); @@ -5976,7 +7378,7 @@ main( hypre_int argc, HYPRE_BoomerAMGSetSCommPkgSwitch(pcg_precond, S_commpkg_switch); HYPRE_BoomerAMGSetPrintLevel(pcg_precond, poutdat); HYPRE_BoomerAMGSetPrintFileName(pcg_precond, "driver.out.log"); - HYPRE_BoomerAMGSetMaxIter(pcg_precond, 1); + HYPRE_BoomerAMGSetMaxIter(pcg_precond, precon_cycles); HYPRE_BoomerAMGSetCycleType(pcg_precond, cycle_type); HYPRE_BoomerAMGSetFCycle(pcg_precond, fcycle); HYPRE_BoomerAMGSetNumSweeps(pcg_precond, num_sweeps); @@ -5985,13 +7387,19 @@ main( hypre_int argc, HYPRE_BoomerAMGSetCRRate(pcg_precond, CR_rate); HYPRE_BoomerAMGSetCRStrongTh(pcg_precond, CR_strong_th); HYPRE_BoomerAMGSetCRUseCG(pcg_precond, CR_use_CG); - if (relax_type > -1) HYPRE_BoomerAMGSetRelaxType(pcg_precond, relax_type); + if (relax_type > -1) { HYPRE_BoomerAMGSetRelaxType(pcg_precond, relax_type); } if (relax_down > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_down, 1); + } if (relax_up > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_up, 2); + } if (relax_coarse > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_coarse, 3); + } HYPRE_BoomerAMGSetAddRelaxType(pcg_precond, add_relax_type); HYPRE_BoomerAMGSetAddRelaxWt(pcg_precond, add_relax_wt); HYPRE_BoomerAMGSetChebyOrder(pcg_precond, cheby_order); @@ -6003,15 +7411,20 @@ main( hypre_int argc, HYPRE_BoomerAMGSetRelaxWt(pcg_precond, relax_wt); HYPRE_BoomerAMGSetOuterWt(pcg_precond, outer_wt); if (level_w > -1) - HYPRE_BoomerAMGSetLevelRelaxWt(pcg_precond, relax_wt_level,level_w); + { + HYPRE_BoomerAMGSetLevelRelaxWt(pcg_precond, relax_wt_level, level_w); + } if (level_ow > -1) - HYPRE_BoomerAMGSetLevelOuterWt(pcg_precond,outer_wt_level,level_ow); + { + HYPRE_BoomerAMGSetLevelOuterWt(pcg_precond, outer_wt_level, level_ow); + } HYPRE_BoomerAMGSetSmoothType(pcg_precond, smooth_type); HYPRE_BoomerAMGSetSmoothNumLevels(pcg_precond, smooth_num_levels); HYPRE_BoomerAMGSetSmoothNumSweeps(pcg_precond, smooth_num_sweeps); HYPRE_BoomerAMGSetMaxLevels(pcg_precond, max_levels); HYPRE_BoomerAMGSetMaxRowSum(pcg_precond, max_row_sum); HYPRE_BoomerAMGSetDebugFlag(pcg_precond, debug_flag); + HYPRE_BoomerAMGSetFilterFunctions(pcg_precond, filter_functions); HYPRE_BoomerAMGSetNumFunctions(pcg_precond, num_functions); HYPRE_BoomerAMGSetAggNumLevels(pcg_precond, agg_num_levels); HYPRE_BoomerAMGSetAggInterpType(pcg_precond, agg_interp_type); @@ -6027,13 +7440,37 @@ main( hypre_int argc, HYPRE_BoomerAMGSetDomainType(pcg_precond, domain_type); HYPRE_BoomerAMGSetSchwarzUseNonSymm(pcg_precond, use_nonsymm_schwarz); HYPRE_BoomerAMGSetSchwarzRlxWeight(pcg_precond, schwarz_rlx_weight); - if (eu_level < 0) eu_level = 0; + if (eu_level < 0) { eu_level = 0; } HYPRE_BoomerAMGSetEuLevel(pcg_precond, eu_level); HYPRE_BoomerAMGSetEuBJ(pcg_precond, eu_bj); HYPRE_BoomerAMGSetEuSparseA(pcg_precond, eu_sparse_A); + HYPRE_BoomerAMGSetILUType(pcg_precond, ilu_type); + HYPRE_BoomerAMGSetILULevel(pcg_precond, ilu_lfil); + HYPRE_BoomerAMGSetILUDroptol(pcg_precond, ilu_droptol); + HYPRE_BoomerAMGSetILUMaxRowNnz(pcg_precond, ilu_max_row_nnz); + HYPRE_BoomerAMGSetILUMaxIter(pcg_precond, ilu_sm_max_iter); + HYPRE_BoomerAMGSetILUTriSolve(pcg_precond, ilu_tri_solve); + HYPRE_BoomerAMGSetILULowerJacobiIters(pcg_precond, ilu_ljac_iters); + HYPRE_BoomerAMGSetILUUpperJacobiIters(pcg_precond, ilu_ujac_iters); + HYPRE_BoomerAMGSetILULocalReordering(pcg_precond, ilu_reordering); + HYPRE_BoomerAMGSetILUIterSetupType(pcg_precond, ilu_iter_setup_type); + HYPRE_BoomerAMGSetILUIterSetupOption(pcg_precond, ilu_iter_setup_option); + HYPRE_BoomerAMGSetILUIterSetupMaxIter(pcg_precond, ilu_iter_setup_max_iter); + HYPRE_BoomerAMGSetILUIterSetupTolerance(pcg_precond, ilu_iter_setup_tolerance); + HYPRE_BoomerAMGSetFSAIAlgoType(pcg_precond, fsai_algo_type); + HYPRE_BoomerAMGSetFSAILocalSolveType(pcg_precond, fsai_ls_type); + HYPRE_BoomerAMGSetFSAIMaxSteps(pcg_precond, fsai_max_steps); + HYPRE_BoomerAMGSetFSAIMaxStepSize(pcg_precond, fsai_max_step_size); + HYPRE_BoomerAMGSetFSAIMaxNnzRow(pcg_precond, fsai_max_nnz_row); + HYPRE_BoomerAMGSetFSAINumLevels(pcg_precond, fsai_num_levels); + HYPRE_BoomerAMGSetFSAIThreshold(pcg_precond, fsai_threshold); + HYPRE_BoomerAMGSetFSAIEigMaxIters(pcg_precond, fsai_eig_max_iters); + HYPRE_BoomerAMGSetFSAIKapTolerance(pcg_precond, fsai_kap_tolerance); HYPRE_BoomerAMGSetCycleNumSweeps(pcg_precond, ns_coarse, 3); if (num_functions > 1) + { HYPRE_BoomerAMGSetDofFunc(pcg_precond, dof_func); + } HYPRE_BoomerAMGSetAdditive(pcg_precond, additive); HYPRE_BoomerAMGSetMultAdditive(pcg_precond, mult_add); HYPRE_BoomerAMGSetSimple(pcg_precond, simple); @@ -6048,9 +7485,11 @@ main( hypre_int argc, #endif if (nongalerk_tol) { - HYPRE_BoomerAMGSetNonGalerkinTol(pcg_precond, nongalerk_tol[nongalerk_num_tol-1]); - for (i=0; i < nongalerk_num_tol-1; i++) + HYPRE_BoomerAMGSetNonGalerkinTol(pcg_precond, nongalerk_tol[nongalerk_num_tol - 1]); + for (i = 0; i < nongalerk_num_tol - 1; i++) + { HYPRE_BoomerAMGSetLevelNonGalerkinTol(pcg_precond, nongalerk_tol[i], i); + } } HYPRE_LGMRESSetMaxIter(pcg_solver, mg_max_iter); HYPRE_LGMRESSetPrecond(pcg_solver, @@ -6061,7 +7500,7 @@ main( hypre_int argc, else if (solver_id == 50) { /* use diagonal scaling as preconditioner */ - if (myid == 0) hypre_printf("Solver: DS-LGMRES\n"); + if (myid == 0) { hypre_printf("Solver: DS-LGMRES\n"); } pcg_precond = NULL; HYPRE_LGMRESSetPrecond(pcg_solver, @@ -6074,13 +7513,14 @@ main( hypre_int argc, if (pcg_precond_gotten != pcg_precond) { hypre_printf("HYPRE_LGMRESGetPrecond got bad precond\n"); - return(-1); + return (-1); + } + else if (myid == 0) + { + hypre_printf("HYPRE_LGMRESGetPrecond got good precond\n"); } - else - if (myid == 0) - hypre_printf("HYPRE_LGMRESGetPrecond got good precond\n"); HYPRE_LGMRESSetup - (pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, (HYPRE_Vector)x); + (pcg_solver, (HYPRE_Matrix)parcsr_M, (HYPRE_Vector)b, (HYPRE_Vector)x); hypre_EndTiming(time_index); hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); @@ -6091,7 +7531,7 @@ main( hypre_int argc, hypre_BeginTiming(time_index); HYPRE_LGMRESSolve - (pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, (HYPRE_Vector)x); + (pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, (HYPRE_Vector)x); hypre_EndTiming(time_index); hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); @@ -6099,7 +7539,7 @@ main( hypre_int argc, hypre_ClearTiming(); HYPRE_LGMRESGetNumIterations(pcg_solver, &num_iterations); - HYPRE_LGMRESGetFinalRelativeResidualNorm(pcg_solver,&final_res_norm); + HYPRE_LGMRESGetFinalRelativeResidualNorm(pcg_solver, &final_res_norm); HYPRE_ParCSRLGMRESDestroy(pcg_solver); @@ -6115,6 +7555,7 @@ main( hypre_int argc, hypre_printf("Final LGMRES Relative Residual Norm = %e\n", final_res_norm); hypre_printf("\n"); } + HYPRE_ANNOTATE_REGION_END("%s", "Run-1"); } /*----------------------------------------------------------- @@ -6123,6 +7564,7 @@ main( hypre_int argc, if (solver_id == 60 || solver_id == 61 || solver_id == 72 || solver_id == 82 || solver_id == 47) { + HYPRE_ANNOTATE_REGION_BEGIN("%s", "Run-1"); time_index = hypre_InitializeTiming("FlexGMRES Setup"); hypre_BeginTiming(time_index); @@ -6137,7 +7579,7 @@ main( hypre_int argc, if (solver_id == 61) { /* use BoomerAMG as preconditioner */ - if (myid == 0) hypre_printf("Solver: AMG-FlexGMRES\n"); + if (myid == 0) { hypre_printf("Solver: AMG-FlexGMRES\n"); } HYPRE_BoomerAMGCreate(&pcg_precond); HYPRE_BoomerAMGSetCGCIts(pcg_precond, cgcits); @@ -6162,7 +7604,7 @@ main( hypre_int argc, HYPRE_BoomerAMGSetSCommPkgSwitch(pcg_precond, S_commpkg_switch); HYPRE_BoomerAMGSetPrintLevel(pcg_precond, poutdat); HYPRE_BoomerAMGSetPrintFileName(pcg_precond, "driver.out.log"); - HYPRE_BoomerAMGSetMaxIter(pcg_precond, 1); + HYPRE_BoomerAMGSetMaxIter(pcg_precond, precon_cycles); HYPRE_BoomerAMGSetCycleType(pcg_precond, cycle_type); HYPRE_BoomerAMGSetFCycle(pcg_precond, fcycle); HYPRE_BoomerAMGSetNumSweeps(pcg_precond, num_sweeps); @@ -6171,13 +7613,19 @@ main( hypre_int argc, HYPRE_BoomerAMGSetCRRate(pcg_precond, CR_rate); HYPRE_BoomerAMGSetCRStrongTh(pcg_precond, CR_strong_th); HYPRE_BoomerAMGSetCRUseCG(pcg_precond, CR_use_CG); - if (relax_type > -1) HYPRE_BoomerAMGSetRelaxType(pcg_precond, relax_type); + if (relax_type > -1) { HYPRE_BoomerAMGSetRelaxType(pcg_precond, relax_type); } if (relax_down > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_down, 1); + } if (relax_up > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_up, 2); + } if (relax_coarse > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_coarse, 3); + } HYPRE_BoomerAMGSetAddRelaxType(pcg_precond, add_relax_type); HYPRE_BoomerAMGSetAddRelaxWt(pcg_precond, add_relax_wt); HYPRE_BoomerAMGSetChebyOrder(pcg_precond, cheby_order); @@ -6189,15 +7637,20 @@ main( hypre_int argc, HYPRE_BoomerAMGSetRelaxWt(pcg_precond, relax_wt); HYPRE_BoomerAMGSetOuterWt(pcg_precond, outer_wt); if (level_w > -1) - HYPRE_BoomerAMGSetLevelRelaxWt(pcg_precond, relax_wt_level,level_w); + { + HYPRE_BoomerAMGSetLevelRelaxWt(pcg_precond, relax_wt_level, level_w); + } if (level_ow > -1) - HYPRE_BoomerAMGSetLevelOuterWt(pcg_precond,outer_wt_level,level_ow); + { + HYPRE_BoomerAMGSetLevelOuterWt(pcg_precond, outer_wt_level, level_ow); + } HYPRE_BoomerAMGSetSmoothType(pcg_precond, smooth_type); HYPRE_BoomerAMGSetSmoothNumLevels(pcg_precond, smooth_num_levels); HYPRE_BoomerAMGSetSmoothNumSweeps(pcg_precond, smooth_num_sweeps); HYPRE_BoomerAMGSetMaxLevels(pcg_precond, max_levels); HYPRE_BoomerAMGSetMaxRowSum(pcg_precond, max_row_sum); HYPRE_BoomerAMGSetDebugFlag(pcg_precond, debug_flag); + HYPRE_BoomerAMGSetFilterFunctions(pcg_precond, filter_functions); HYPRE_BoomerAMGSetNumFunctions(pcg_precond, num_functions); HYPRE_BoomerAMGSetAggNumLevels(pcg_precond, agg_num_levels); HYPRE_BoomerAMGSetAggInterpType(pcg_precond, agg_interp_type); @@ -6213,13 +7666,37 @@ main( hypre_int argc, HYPRE_BoomerAMGSetDomainType(pcg_precond, domain_type); HYPRE_BoomerAMGSetSchwarzUseNonSymm(pcg_precond, use_nonsymm_schwarz); HYPRE_BoomerAMGSetSchwarzRlxWeight(pcg_precond, schwarz_rlx_weight); - if (eu_level < 0) eu_level = 0; + if (eu_level < 0) { eu_level = 0; } HYPRE_BoomerAMGSetEuLevel(pcg_precond, eu_level); HYPRE_BoomerAMGSetEuBJ(pcg_precond, eu_bj); HYPRE_BoomerAMGSetEuSparseA(pcg_precond, eu_sparse_A); + HYPRE_BoomerAMGSetILUType(pcg_precond, ilu_type); + HYPRE_BoomerAMGSetILULevel(pcg_precond, ilu_lfil); + HYPRE_BoomerAMGSetILUDroptol(pcg_precond, ilu_droptol); + HYPRE_BoomerAMGSetILUMaxRowNnz(pcg_precond, ilu_max_row_nnz); + HYPRE_BoomerAMGSetILUMaxIter(pcg_precond, ilu_sm_max_iter); + HYPRE_BoomerAMGSetILUTriSolve(pcg_precond, ilu_tri_solve); + HYPRE_BoomerAMGSetILULowerJacobiIters(pcg_precond, ilu_ljac_iters); + HYPRE_BoomerAMGSetILUUpperJacobiIters(pcg_precond, ilu_ujac_iters); + HYPRE_BoomerAMGSetILULocalReordering(pcg_precond, ilu_reordering); + HYPRE_BoomerAMGSetILUIterSetupType(pcg_precond, ilu_iter_setup_type); + HYPRE_BoomerAMGSetILUIterSetupOption(pcg_precond, ilu_iter_setup_option); + HYPRE_BoomerAMGSetILUIterSetupMaxIter(pcg_precond, ilu_iter_setup_max_iter); + HYPRE_BoomerAMGSetILUIterSetupTolerance(pcg_precond, ilu_iter_setup_tolerance); + HYPRE_BoomerAMGSetFSAIAlgoType(pcg_precond, fsai_algo_type); + HYPRE_BoomerAMGSetFSAILocalSolveType(pcg_precond, fsai_ls_type); + HYPRE_BoomerAMGSetFSAIMaxSteps(pcg_precond, fsai_max_steps); + HYPRE_BoomerAMGSetFSAIMaxStepSize(pcg_precond, fsai_max_step_size); + HYPRE_BoomerAMGSetFSAIMaxNnzRow(pcg_precond, fsai_max_nnz_row); + HYPRE_BoomerAMGSetFSAINumLevels(pcg_precond, fsai_num_levels); + HYPRE_BoomerAMGSetFSAIThreshold(pcg_precond, fsai_threshold); + HYPRE_BoomerAMGSetFSAIEigMaxIters(pcg_precond, fsai_eig_max_iters); + HYPRE_BoomerAMGSetFSAIKapTolerance(pcg_precond, fsai_kap_tolerance); HYPRE_BoomerAMGSetCycleNumSweeps(pcg_precond, ns_coarse, 3); if (num_functions > 1) + { HYPRE_BoomerAMGSetDofFunc(pcg_precond, dof_func); + } HYPRE_BoomerAMGSetAdditive(pcg_precond, additive); HYPRE_BoomerAMGSetMultAdditive(pcg_precond, mult_add); HYPRE_BoomerAMGSetSimple(pcg_precond, simple); @@ -6234,9 +7711,11 @@ main( hypre_int argc, #endif if (nongalerk_tol) { - HYPRE_BoomerAMGSetNonGalerkinTol(pcg_precond, nongalerk_tol[nongalerk_num_tol-1]); - for (i=0; i < nongalerk_num_tol-1; i++) + HYPRE_BoomerAMGSetNonGalerkinTol(pcg_precond, nongalerk_tol[nongalerk_num_tol - 1]); + for (i = 0; i < nongalerk_num_tol - 1; i++) + { HYPRE_BoomerAMGSetLevelNonGalerkinTol(pcg_precond, nongalerk_tol[i], i); + } } HYPRE_FlexGMRESSetMaxIter(pcg_solver, mg_max_iter); HYPRE_FlexGMRESSetPrecond(pcg_solver, @@ -6244,37 +7723,41 @@ main( hypre_int argc, (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, pcg_precond); } - else if( solver_id == 72 ) + else if ( solver_id == 72 ) { /* use MGR preconditioning */ - if (myid == 0) hypre_printf("Solver: MGR-FlexGMRES\n"); + if (myid == 0) { hypre_printf("Solver: MGR-FlexGMRES\n"); } HYPRE_MGRCreate(&pcg_precond); mgr_num_cindexes = hypre_CTAlloc(HYPRE_Int, mgr_nlevels, HYPRE_MEMORY_HOST); - for(i=0; i -1) + { + HYPRE_BoomerAMGSetCycleRelaxType(amg_solver, relax_down, 1); + } + if (relax_up > -1) + { + HYPRE_BoomerAMGSetCycleRelaxType(amg_solver, relax_up, 2); + } + if (relax_coarse > -1) + { + HYPRE_BoomerAMGSetCycleRelaxType(amg_solver, relax_coarse, 3); + } + HYPRE_BoomerAMGSetSmoothType(amg_solver, smooth_type); + HYPRE_BoomerAMGSetSmoothNumSweeps(amg_solver, smooth_num_sweeps); + } HYPRE_BoomerAMGSetCGCIts(amg_solver, cgcits); - HYPRE_BoomerAMGSetInterpType(amg_solver, 0); - HYPRE_BoomerAMGSetPostInterpType(amg_solver, post_interp_type); - HYPRE_BoomerAMGSetCoarsenType(amg_solver, 6); + HYPRE_BoomerAMGSetTol(amg_solver, 0.0); HYPRE_BoomerAMGSetPMaxElmts(amg_solver, 0); - /* note: log is written to standard output, not to file */ - HYPRE_BoomerAMGSetPrintLevel(amg_solver, 1); - HYPRE_BoomerAMGSetCycleType(amg_solver, cycle_type); - HYPRE_BoomerAMGSetFCycle(amg_solver, fcycle); HYPRE_BoomerAMGSetNumSweeps(amg_solver, num_sweeps); - HYPRE_BoomerAMGSetRelaxType(amg_solver, 3); - if (relax_down > -1) - HYPRE_BoomerAMGSetCycleRelaxType(amg_solver, relax_down, 1); - if (relax_up > -1) - HYPRE_BoomerAMGSetCycleRelaxType(amg_solver, relax_up, 2); - if (relax_coarse > -1) - HYPRE_BoomerAMGSetCycleRelaxType(amg_solver, relax_coarse, 3); HYPRE_BoomerAMGSetRelaxOrder(amg_solver, 1); HYPRE_BoomerAMGSetMaxLevels(amg_solver, max_levels); - HYPRE_BoomerAMGSetSmoothType(amg_solver, smooth_type); - HYPRE_BoomerAMGSetSmoothNumSweeps(amg_solver, smooth_num_sweeps); - HYPRE_BoomerAMGSetMaxIter(amg_solver, 1); - HYPRE_BoomerAMGSetTol(amg_solver, 0.0); + HYPRE_BoomerAMGSetMaxIter(amg_solver, precon_cycles); + HYPRE_BoomerAMGSetPrintLevel(amg_solver, 1); /* set the MGR coarse solver. Comment out to use default CG solver in MGR */ HYPRE_MGRSetCoarseSolver( pcg_precond, HYPRE_BoomerAMGSolve, HYPRE_BoomerAMGSetup, amg_solver); @@ -6336,15 +7832,15 @@ main( hypre_int argc, else if (solver_id == 47) { /* use Euclid preconditioning */ - if (myid == 0) hypre_printf("Solver: Euclid-FlexGMRES\n"); + if (myid == 0) { hypre_printf("Solver: Euclid-FlexGMRES\n"); } HYPRE_EuclidCreate(hypre_MPI_COMM_WORLD, &pcg_precond); - if (eu_level > -1) HYPRE_EuclidSetLevel(pcg_precond, eu_level); - if (eu_ilut) HYPRE_EuclidSetILUT(pcg_precond, eu_ilut); - if (eu_sparse_A) HYPRE_EuclidSetSparseA(pcg_precond, eu_sparse_A); - if (eu_row_scale) HYPRE_EuclidSetRowScale(pcg_precond, eu_row_scale); - if (eu_bj) HYPRE_EuclidSetBJ(pcg_precond, eu_bj); + if (eu_level > -1) { HYPRE_EuclidSetLevel(pcg_precond, eu_level); } + if (eu_ilut) { HYPRE_EuclidSetILUT(pcg_precond, eu_ilut); } + if (eu_sparse_A) { HYPRE_EuclidSetSparseA(pcg_precond, eu_sparse_A); } + if (eu_row_scale) { HYPRE_EuclidSetRowScale(pcg_precond, eu_row_scale); } + if (eu_bj) { HYPRE_EuclidSetBJ(pcg_precond, eu_bj); } HYPRE_EuclidSetStats(pcg_precond, eu_stats); HYPRE_EuclidSetMem(pcg_precond, eu_mem); /*HYPRE_EuclidSetParams(pcg_precond, argc, argv);*/ @@ -6359,21 +7855,29 @@ main( hypre_int argc, else if (solver_id == 82) { /* use hypre_ILU preconditioning */ - if (myid == 0) hypre_printf("Solver: ILU-FlexGMRES\n"); + if (myid == 0) { hypre_printf("Solver: ILU-FlexGMRES\n"); } /* create precon */ HYPRE_ILUCreate(&pcg_precond); HYPRE_ILUSetType(pcg_precond, ilu_type); HYPRE_ILUSetLevelOfFill(pcg_precond, ilu_lfil); + HYPRE_ILUSetLocalReordering(pcg_precond, ilu_reordering); + HYPRE_ILUSetTriSolve(pcg_precond, ilu_tri_solve); + HYPRE_ILUSetLowerJacobiIters(pcg_precond, ilu_ljac_iters); + HYPRE_ILUSetUpperJacobiIters(pcg_precond, ilu_ujac_iters); + HYPRE_ILUSetIterativeSetupType(pcg_precond, ilu_iter_setup_type); + HYPRE_ILUSetIterativeSetupOption(pcg_precond, ilu_iter_setup_option); + HYPRE_ILUSetIterativeSetupMaxIter(pcg_precond, ilu_iter_setup_max_iter); + HYPRE_ILUSetIterativeSetupTolerance(pcg_precond, ilu_iter_setup_tolerance); /* set print level */ - HYPRE_ILUSetPrintLevel(pcg_precond, 1); + HYPRE_ILUSetPrintLevel(pcg_precond, poutdat); /* set max iterations */ HYPRE_ILUSetMaxIter(pcg_precond, 1); HYPRE_ILUSetTol(pcg_precond, pc_tol); /* set max number of nonzeros per row */ - HYPRE_ILUSetMaxNnzPerRow(pcg_precond,ilu_max_row_nnz); + HYPRE_ILUSetMaxNnzPerRow(pcg_precond, ilu_max_row_nnz); /* set the droptol */ - HYPRE_ILUSetDropThreshold(pcg_precond,ilu_droptol); + HYPRE_ILUSetDropThreshold(pcg_precond, ilu_droptol); /* set max iterations for Schur system solve */ HYPRE_ILUSetSchurMaxIter( pcg_precond, ilu_schur_max_iter ); HYPRE_ILUSetNSHDropThreshold( pcg_precond, ilu_nsh_droptol); @@ -6388,7 +7892,7 @@ main( hypre_int argc, else if (solver_id == 60) { /* use diagonal scaling as preconditioner */ - if (myid == 0) hypre_printf("Solver: DS-FlexGMRES\n"); + if (myid == 0) { hypre_printf("Solver: DS-FlexGMRES\n"); } pcg_precond = NULL; HYPRE_FlexGMRESSetPrecond(pcg_solver, @@ -6401,11 +7905,12 @@ main( hypre_int argc, if (pcg_precond_gotten != pcg_precond) { hypre_printf("HYPRE_FlexGMRESGetPrecond got bad precond\n"); - return(-1); + return (-1); + } + else if (myid == 0) + { + hypre_printf("HYPRE_FlexGMRESGetPrecond got good precond\n"); } - else - if (myid == 0) - hypre_printf("HYPRE_FlexGMRESGetPrecond got good precond\n"); /* this is optional - could be a user defined one instead (see ex5.c)*/ @@ -6414,7 +7919,7 @@ main( hypre_int argc, HYPRE_FlexGMRESSetup - (pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, (HYPRE_Vector)x); + (pcg_solver, (HYPRE_Matrix)parcsr_M, (HYPRE_Vector)b, (HYPRE_Vector)x); hypre_EndTiming(time_index); hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); @@ -6425,7 +7930,7 @@ main( hypre_int argc, hypre_BeginTiming(time_index); HYPRE_FlexGMRESSolve - (pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, (HYPRE_Vector)x); + (pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, (HYPRE_Vector)x); hypre_EndTiming(time_index); hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); @@ -6433,7 +7938,7 @@ main( hypre_int argc, hypre_ClearTiming(); HYPRE_FlexGMRESGetNumIterations(pcg_solver, &num_iterations); - HYPRE_FlexGMRESGetFinalRelativeResidualNorm(pcg_solver,&final_res_norm); + HYPRE_FlexGMRESGetFinalRelativeResidualNorm(pcg_solver, &final_res_norm); HYPRE_ParCSRFlexGMRESDestroy(pcg_solver); @@ -6441,23 +7946,29 @@ main( hypre_int argc, { HYPRE_BoomerAMGDestroy(pcg_precond); } - else if(solver_id == 72) + else if (solver_id == 72) { /* free memory */ - if(mgr_num_cindexes) + if (mgr_num_cindexes) + { hypre_TFree(mgr_num_cindexes, HYPRE_MEMORY_HOST); + } mgr_num_cindexes = NULL; - if(mgr_reserved_coarse_indexes) + if (mgr_reserved_coarse_indexes) + { hypre_TFree(mgr_reserved_coarse_indexes, HYPRE_MEMORY_HOST); + } mgr_reserved_coarse_indexes = NULL; - if(mgr_cindexes) + if (mgr_cindexes) { - for( i=0; i -1) HYPRE_BoomerAMGSetRelaxType(pcg_precond, relax_type); + if (relax_type > -1) { HYPRE_BoomerAMGSetRelaxType(pcg_precond, relax_type); } if (relax_down > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_down, 1); + } if (relax_up > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_up, 2); + } if (relax_coarse > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_coarse, 3); + } HYPRE_BoomerAMGSetAddRelaxType(pcg_precond, add_relax_type); HYPRE_BoomerAMGSetAddRelaxWt(pcg_precond, add_relax_wt); HYPRE_BoomerAMGSetChebyOrder(pcg_precond, cheby_order); @@ -6553,15 +8072,20 @@ main( hypre_int argc, HYPRE_BoomerAMGSetRelaxWt(pcg_precond, relax_wt); HYPRE_BoomerAMGSetOuterWt(pcg_precond, outer_wt); if (level_w > -1) - HYPRE_BoomerAMGSetLevelRelaxWt(pcg_precond, relax_wt_level,level_w); + { + HYPRE_BoomerAMGSetLevelRelaxWt(pcg_precond, relax_wt_level, level_w); + } if (level_ow > -1) - HYPRE_BoomerAMGSetLevelOuterWt(pcg_precond,outer_wt_level,level_ow); + { + HYPRE_BoomerAMGSetLevelOuterWt(pcg_precond, outer_wt_level, level_ow); + } HYPRE_BoomerAMGSetSmoothType(pcg_precond, smooth_type); HYPRE_BoomerAMGSetSmoothNumLevels(pcg_precond, smooth_num_levels); HYPRE_BoomerAMGSetSmoothNumSweeps(pcg_precond, smooth_num_sweeps); HYPRE_BoomerAMGSetMaxLevels(pcg_precond, max_levels); HYPRE_BoomerAMGSetMaxRowSum(pcg_precond, max_row_sum); HYPRE_BoomerAMGSetDebugFlag(pcg_precond, debug_flag); + HYPRE_BoomerAMGSetFilterFunctions(pcg_precond, filter_functions); HYPRE_BoomerAMGSetNumFunctions(pcg_precond, num_functions); HYPRE_BoomerAMGSetAggNumLevels(pcg_precond, agg_num_levels); HYPRE_BoomerAMGSetAggInterpType(pcg_precond, agg_interp_type); @@ -6578,13 +8102,37 @@ main( hypre_int argc, HYPRE_BoomerAMGSetSchwarzUseNonSymm(pcg_precond, use_nonsymm_schwarz); HYPRE_BoomerAMGSetSchwarzRlxWeight(pcg_precond, schwarz_rlx_weight); - if (eu_level < 0) eu_level = 0; + if (eu_level < 0) { eu_level = 0; } HYPRE_BoomerAMGSetEuLevel(pcg_precond, eu_level); HYPRE_BoomerAMGSetEuBJ(pcg_precond, eu_bj); HYPRE_BoomerAMGSetEuSparseA(pcg_precond, eu_sparse_A); + HYPRE_BoomerAMGSetILUType(pcg_precond, ilu_type); + HYPRE_BoomerAMGSetILULevel(pcg_precond, ilu_lfil); + HYPRE_BoomerAMGSetILUDroptol(pcg_precond, ilu_droptol); + HYPRE_BoomerAMGSetILUMaxRowNnz(pcg_precond, ilu_max_row_nnz); + HYPRE_BoomerAMGSetILUMaxIter(pcg_precond, ilu_sm_max_iter); + HYPRE_BoomerAMGSetILUTriSolve(pcg_precond, ilu_tri_solve); + HYPRE_BoomerAMGSetILULowerJacobiIters(pcg_precond, ilu_ljac_iters); + HYPRE_BoomerAMGSetILUUpperJacobiIters(pcg_precond, ilu_ujac_iters); + HYPRE_BoomerAMGSetILULocalReordering(pcg_precond, ilu_reordering); + HYPRE_BoomerAMGSetILUIterSetupType(pcg_precond, ilu_iter_setup_type); + HYPRE_BoomerAMGSetILUIterSetupOption(pcg_precond, ilu_iter_setup_option); + HYPRE_BoomerAMGSetILUIterSetupMaxIter(pcg_precond, ilu_iter_setup_max_iter); + HYPRE_BoomerAMGSetILUIterSetupTolerance(pcg_precond, ilu_iter_setup_tolerance); + HYPRE_BoomerAMGSetFSAIAlgoType(pcg_precond, fsai_algo_type); + HYPRE_BoomerAMGSetFSAILocalSolveType(pcg_precond, fsai_ls_type); + HYPRE_BoomerAMGSetFSAIMaxSteps(pcg_precond, fsai_max_steps); + HYPRE_BoomerAMGSetFSAIMaxStepSize(pcg_precond, fsai_max_step_size); + HYPRE_BoomerAMGSetFSAIMaxNnzRow(pcg_precond, fsai_max_nnz_row); + HYPRE_BoomerAMGSetFSAINumLevels(pcg_precond, fsai_num_levels); + HYPRE_BoomerAMGSetFSAIEigMaxIters(pcg_precond, fsai_eig_max_iters); + HYPRE_BoomerAMGSetFSAIThreshold(pcg_precond, fsai_threshold); + HYPRE_BoomerAMGSetFSAIKapTolerance(pcg_precond, fsai_kap_tolerance); HYPRE_BoomerAMGSetCycleNumSweeps(pcg_precond, ns_coarse, 3); if (num_functions > 1) + { HYPRE_BoomerAMGSetDofFunc(pcg_precond, dof_func); + } HYPRE_BoomerAMGSetAdditive(pcg_precond, additive); HYPRE_BoomerAMGSetMultAdditive(pcg_precond, mult_add); HYPRE_BoomerAMGSetSimple(pcg_precond, simple); @@ -6599,9 +8147,11 @@ main( hypre_int argc, #endif if (nongalerk_tol) { - HYPRE_BoomerAMGSetNonGalerkinTol(pcg_precond, nongalerk_tol[nongalerk_num_tol-1]); - for (i=0; i < nongalerk_num_tol-1; i++) + HYPRE_BoomerAMGSetNonGalerkinTol(pcg_precond, nongalerk_tol[nongalerk_num_tol - 1]); + for (i = 0; i < nongalerk_num_tol - 1; i++) + { HYPRE_BoomerAMGSetLevelNonGalerkinTol(pcg_precond, nongalerk_tol[i], i); + } } HYPRE_BiCGSTABSetMaxIter(pcg_solver, mg_max_iter); HYPRE_BiCGSTABSetPrecond(pcg_solver, @@ -6612,7 +8162,7 @@ main( hypre_int argc, else if (solver_id == 10) { /* use diagonal scaling as preconditioner */ - if (myid == 0) hypre_printf("Solver: DS-BiCGSTAB\n"); + if (myid == 0) { hypre_printf("Solver: DS-BiCGSTAB\n"); } pcg_precond = NULL; HYPRE_BiCGSTABSetPrecond(pcg_solver, @@ -6623,10 +8173,11 @@ main( hypre_int argc, else if (solver_id == 11) { /* use PILUT as preconditioner */ - if (myid == 0) hypre_printf("Solver: PILUT-BiCGSTAB\n"); + if (myid == 0) { hypre_printf("Solver: PILUT-BiCGSTAB\n"); } ierr = HYPRE_ParCSRPilutCreate( hypre_MPI_COMM_WORLD, &pcg_precond ); - if (ierr) { + if (ierr) + { hypre_printf("Error in ParPilutCreate\n"); } @@ -6648,7 +8199,7 @@ main( hypre_int argc, else if (solver_id == 45) { /* use Euclid preconditioning */ - if (myid == 0) hypre_printf("Solver: Euclid-BICGSTAB\n"); + if (myid == 0) { hypre_printf("Solver: Euclid-BICGSTAB\n"); } HYPRE_EuclidCreate(hypre_MPI_COMM_WORLD, &pcg_precond); @@ -6657,11 +8208,11 @@ main( hypre_int argc, we'll use what I think is simplest: let Euclid internally parse the command line. */ - if (eu_level > -1) HYPRE_EuclidSetLevel(pcg_precond, eu_level); - if (eu_ilut) HYPRE_EuclidSetILUT(pcg_precond, eu_ilut); - if (eu_sparse_A) HYPRE_EuclidSetSparseA(pcg_precond, eu_sparse_A); - if (eu_row_scale) HYPRE_EuclidSetRowScale(pcg_precond, eu_row_scale); - if (eu_bj) HYPRE_EuclidSetBJ(pcg_precond, eu_bj); + if (eu_level > -1) { HYPRE_EuclidSetLevel(pcg_precond, eu_level); } + if (eu_ilut) { HYPRE_EuclidSetILUT(pcg_precond, eu_ilut); } + if (eu_sparse_A) { HYPRE_EuclidSetSparseA(pcg_precond, eu_sparse_A); } + if (eu_row_scale) { HYPRE_EuclidSetRowScale(pcg_precond, eu_row_scale); } + if (eu_bj) { HYPRE_EuclidSetBJ(pcg_precond, eu_bj); } HYPRE_EuclidSetStats(pcg_precond, eu_stats); HYPRE_EuclidSetMem(pcg_precond, eu_mem); @@ -6675,37 +8226,40 @@ main( hypre_int argc, else if (solver_id == 73) { /* use MGR preconditioning */ - if (myid == 0) hypre_printf("Solver: MGR-BICGSTAB\n"); + if (myid == 0) { hypre_printf("Solver: MGR-BICGSTAB\n"); } HYPRE_MGRCreate(&pcg_precond); mgr_num_cindexes = hypre_CTAlloc(HYPRE_Int, mgr_nlevels, HYPRE_MEMORY_HOST); - for(i=0; i -1) HYPRE_BoomerAMGSetRelaxType(pcg_precond, relax_type); + if (relax_type > -1) { HYPRE_BoomerAMGSetRelaxType(pcg_precond, relax_type); } if (relax_down > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_down, 1); + } if (relax_up > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_up, 2); + } if (relax_coarse > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_coarse, 3); + } HYPRE_BoomerAMGSetAddRelaxType(pcg_precond, add_relax_type); HYPRE_BoomerAMGSetAddRelaxWt(pcg_precond, add_relax_wt); HYPRE_BoomerAMGSetChebyOrder(pcg_precond, cheby_order); @@ -6904,15 +8499,20 @@ main( hypre_int argc, HYPRE_BoomerAMGSetRelaxWt(pcg_precond, relax_wt); HYPRE_BoomerAMGSetOuterWt(pcg_precond, outer_wt); if (level_w > -1) - HYPRE_BoomerAMGSetLevelRelaxWt(pcg_precond, relax_wt_level,level_w); + { + HYPRE_BoomerAMGSetLevelRelaxWt(pcg_precond, relax_wt_level, level_w); + } if (level_ow > -1) - HYPRE_BoomerAMGSetLevelOuterWt(pcg_precond,outer_wt_level,level_ow); + { + HYPRE_BoomerAMGSetLevelOuterWt(pcg_precond, outer_wt_level, level_ow); + } HYPRE_BoomerAMGSetSmoothType(pcg_precond, smooth_type); HYPRE_BoomerAMGSetSmoothNumLevels(pcg_precond, smooth_num_levels); HYPRE_BoomerAMGSetSmoothNumSweeps(pcg_precond, smooth_num_sweeps); HYPRE_BoomerAMGSetMaxLevels(pcg_precond, max_levels); HYPRE_BoomerAMGSetMaxRowSum(pcg_precond, max_row_sum); HYPRE_BoomerAMGSetDebugFlag(pcg_precond, debug_flag); + HYPRE_BoomerAMGSetFilterFunctions(pcg_precond, filter_functions); HYPRE_BoomerAMGSetNumFunctions(pcg_precond, num_functions); HYPRE_BoomerAMGSetAggNumLevels(pcg_precond, agg_num_levels); HYPRE_BoomerAMGSetAggInterpType(pcg_precond, agg_interp_type); @@ -6929,13 +8529,37 @@ main( hypre_int argc, HYPRE_BoomerAMGSetSchwarzUseNonSymm(pcg_precond, use_nonsymm_schwarz); HYPRE_BoomerAMGSetSchwarzRlxWeight(pcg_precond, schwarz_rlx_weight); - if (eu_level < 0) eu_level = 0; + if (eu_level < 0) { eu_level = 0; } HYPRE_BoomerAMGSetEuLevel(pcg_precond, eu_level); HYPRE_BoomerAMGSetEuBJ(pcg_precond, eu_bj); HYPRE_BoomerAMGSetEuSparseA(pcg_precond, eu_sparse_A); + HYPRE_BoomerAMGSetILUType(pcg_precond, ilu_type); + HYPRE_BoomerAMGSetILULevel(pcg_precond, ilu_lfil); + HYPRE_BoomerAMGSetILUDroptol(pcg_precond, ilu_droptol); + HYPRE_BoomerAMGSetILUMaxRowNnz(pcg_precond, ilu_max_row_nnz); + HYPRE_BoomerAMGSetILUMaxIter(pcg_precond, ilu_sm_max_iter); + HYPRE_BoomerAMGSetILUTriSolve(pcg_precond, ilu_tri_solve); + HYPRE_BoomerAMGSetILULowerJacobiIters(pcg_precond, ilu_ljac_iters); + HYPRE_BoomerAMGSetILUUpperJacobiIters(pcg_precond, ilu_ujac_iters); + HYPRE_BoomerAMGSetILULocalReordering(pcg_precond, ilu_reordering); + HYPRE_BoomerAMGSetILUIterSetupType(pcg_precond, ilu_iter_setup_type); + HYPRE_BoomerAMGSetILUIterSetupOption(pcg_precond, ilu_iter_setup_option); + HYPRE_BoomerAMGSetILUIterSetupMaxIter(pcg_precond, ilu_iter_setup_max_iter); + HYPRE_BoomerAMGSetILUIterSetupTolerance(pcg_precond, ilu_iter_setup_tolerance); + HYPRE_BoomerAMGSetFSAIAlgoType(pcg_precond, fsai_algo_type); + HYPRE_BoomerAMGSetFSAILocalSolveType(pcg_precond, fsai_ls_type); + HYPRE_BoomerAMGSetFSAIMaxSteps(pcg_precond, fsai_max_steps); + HYPRE_BoomerAMGSetFSAIMaxStepSize(pcg_precond, fsai_max_step_size); + HYPRE_BoomerAMGSetFSAIMaxNnzRow(pcg_precond, fsai_max_nnz_row); + HYPRE_BoomerAMGSetFSAINumLevels(pcg_precond, fsai_num_levels); + HYPRE_BoomerAMGSetFSAIThreshold(pcg_precond, fsai_threshold); + HYPRE_BoomerAMGSetFSAIEigMaxIters(pcg_precond, fsai_eig_max_iters); + HYPRE_BoomerAMGSetFSAIKapTolerance(pcg_precond, fsai_kap_tolerance); HYPRE_BoomerAMGSetCycleNumSweeps(pcg_precond, ns_coarse, 3); if (num_functions > 1) + { HYPRE_BoomerAMGSetDofFunc(pcg_precond, dof_func); + } HYPRE_BoomerAMGSetAdditive(pcg_precond, additive); HYPRE_BoomerAMGSetMultAdditive(pcg_precond, mult_add); HYPRE_BoomerAMGSetSimple(pcg_precond, simple); @@ -6950,9 +8574,11 @@ main( hypre_int argc, #endif if (nongalerk_tol) { - HYPRE_BoomerAMGSetNonGalerkinTol(pcg_precond, nongalerk_tol[nongalerk_num_tol-1]); - for (i=0; i < nongalerk_num_tol-1; i++) + HYPRE_BoomerAMGSetNonGalerkinTol(pcg_precond, nongalerk_tol[nongalerk_num_tol - 1]); + for (i = 0; i < nongalerk_num_tol - 1; i++) + { HYPRE_BoomerAMGSetLevelNonGalerkinTol(pcg_precond, nongalerk_tol[i], i); + } } HYPRE_COGMRESSetMaxIter(pcg_solver, mg_max_iter); HYPRE_COGMRESSetPrecond(pcg_solver, @@ -6963,7 +8589,7 @@ main( hypre_int argc, else if (solver_id == 17) { /* use diagonal scaling as preconditioner */ - if (myid == 0) hypre_printf("Solver: DS-COGMRES\n"); + if (myid == 0) { hypre_printf("Solver: DS-COGMRES\n"); } pcg_precond = NULL; HYPRE_COGMRESSetPrecond(pcg_solver, @@ -6974,7 +8600,7 @@ main( hypre_int argc, else if (solver_id == 46) { /* use Euclid preconditioning */ - if (myid == 0) hypre_printf("Solver: Euclid-BICGSTAB\n"); + if (myid == 0) { hypre_printf("Solver: Euclid-BICGSTAB\n"); } HYPRE_EuclidCreate(hypre_MPI_COMM_WORLD, &pcg_precond); @@ -6983,11 +8609,11 @@ main( hypre_int argc, we'll use what I think is simplest: let Euclid internally parse the command line. */ - if (eu_level > -1) HYPRE_EuclidSetLevel(pcg_precond, eu_level); - if (eu_ilut) HYPRE_EuclidSetILUT(pcg_precond, eu_ilut); - if (eu_sparse_A) HYPRE_EuclidSetSparseA(pcg_precond, eu_sparse_A); - if (eu_row_scale) HYPRE_EuclidSetRowScale(pcg_precond, eu_row_scale); - if (eu_bj) HYPRE_EuclidSetBJ(pcg_precond, eu_bj); + if (eu_level > -1) { HYPRE_EuclidSetLevel(pcg_precond, eu_level); } + if (eu_ilut) { HYPRE_EuclidSetILUT(pcg_precond, eu_ilut); } + if (eu_sparse_A) { HYPRE_EuclidSetSparseA(pcg_precond, eu_sparse_A); } + if (eu_row_scale) { HYPRE_EuclidSetRowScale(pcg_precond, eu_row_scale); } + if (eu_bj) { HYPRE_EuclidSetBJ(pcg_precond, eu_bj); } HYPRE_EuclidSetStats(pcg_precond, eu_stats); HYPRE_EuclidSetMem(pcg_precond, eu_mem); @@ -7001,37 +8627,40 @@ main( hypre_int argc, else if (solver_id == 74) { /* use MGR preconditioning */ - if (myid == 0) hypre_printf("Solver: MGR-BICGSTAB\n"); + if (myid == 0) { hypre_printf("Solver: MGR-BICGSTAB\n"); } HYPRE_MGRCreate(&pcg_precond); mgr_num_cindexes = hypre_CTAlloc(HYPRE_Int, mgr_nlevels, HYPRE_MEMORY_HOST); - for(i=0; i -1) HYPRE_BoomerAMGSetRelaxType(pcg_precond, relax_type); + if (relax_type > -1) { HYPRE_BoomerAMGSetRelaxType(pcg_precond, relax_type); } if (relax_down > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_down, 1); + } if (relax_up > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_up, 2); + } if (relax_coarse > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_coarse, 3); + } HYPRE_BoomerAMGSetAddRelaxType(pcg_precond, add_relax_type); HYPRE_BoomerAMGSetAddRelaxWt(pcg_precond, add_relax_wt); HYPRE_BoomerAMGSetChebyOrder(pcg_precond, cheby_order); @@ -7214,15 +8870,20 @@ main( hypre_int argc, HYPRE_BoomerAMGSetRelaxWt(pcg_precond, relax_wt); HYPRE_BoomerAMGSetOuterWt(pcg_precond, outer_wt); if (level_w > -1) - HYPRE_BoomerAMGSetLevelRelaxWt(pcg_precond, relax_wt_level,level_w); + { + HYPRE_BoomerAMGSetLevelRelaxWt(pcg_precond, relax_wt_level, level_w); + } if (level_ow > -1) - HYPRE_BoomerAMGSetLevelOuterWt(pcg_precond,outer_wt_level,level_ow); + { + HYPRE_BoomerAMGSetLevelOuterWt(pcg_precond, outer_wt_level, level_ow); + } HYPRE_BoomerAMGSetSmoothType(pcg_precond, smooth_type); HYPRE_BoomerAMGSetSmoothNumLevels(pcg_precond, smooth_num_levels); HYPRE_BoomerAMGSetSmoothNumSweeps(pcg_precond, smooth_num_sweeps); HYPRE_BoomerAMGSetMaxLevels(pcg_precond, max_levels); HYPRE_BoomerAMGSetMaxRowSum(pcg_precond, max_row_sum); HYPRE_BoomerAMGSetDebugFlag(pcg_precond, debug_flag); + HYPRE_BoomerAMGSetFilterFunctions(pcg_precond, filter_functions); HYPRE_BoomerAMGSetNumFunctions(pcg_precond, num_functions); HYPRE_BoomerAMGSetAggNumLevels(pcg_precond, agg_num_levels); HYPRE_BoomerAMGSetAggInterpType(pcg_precond, agg_interp_type); @@ -7237,7 +8898,9 @@ main( hypre_int argc, HYPRE_BoomerAMGSetOverlap(pcg_precond, overlap); HYPRE_BoomerAMGSetDomainType(pcg_precond, domain_type); if (num_functions > 1) + { HYPRE_BoomerAMGSetDofFunc(pcg_precond, dof_func); + } HYPRE_BoomerAMGSetAdditive(pcg_precond, additive); HYPRE_BoomerAMGSetMultAdditive(pcg_precond, mult_add); HYPRE_BoomerAMGSetSimple(pcg_precond, simple); @@ -7252,9 +8915,11 @@ main( hypre_int argc, #endif if (nongalerk_tol) { - HYPRE_BoomerAMGSetNonGalerkinTol(pcg_precond, nongalerk_tol[nongalerk_num_tol-1]); - for (i=0; i < nongalerk_num_tol-1; i++) + HYPRE_BoomerAMGSetNonGalerkinTol(pcg_precond, nongalerk_tol[nongalerk_num_tol - 1]); + for (i = 0; i < nongalerk_num_tol - 1; i++) + { HYPRE_BoomerAMGSetLevelNonGalerkinTol(pcg_precond, nongalerk_tol[i], i); + } } HYPRE_CGNRSetMaxIter(pcg_solver, mg_max_iter); HYPRE_CGNRSetPrecond(pcg_solver, @@ -7266,7 +8931,7 @@ main( hypre_int argc, else if (solver_id == 6) { /* use diagonal scaling as preconditioner */ - if (myid == 0) hypre_printf("Solver: DS-CGNR\n"); + if (myid == 0) { hypre_printf("Solver: DS-CGNR\n"); } pcg_precond = NULL; HYPRE_CGNRSetPrecond(pcg_solver, @@ -7280,13 +8945,14 @@ main( hypre_int argc, if (pcg_precond_gotten != pcg_precond) { hypre_printf("HYPRE_ParCSRCGNRGetPrecond got bad precond\n"); - return(-1); + return (-1); } - else - if (myid == 0) - hypre_printf("HYPRE_ParCSRCGNRGetPrecond got good precond\n"); - HYPRE_CGNRSetup(pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, - (HYPRE_Vector)x); + else if (myid == 0) + { + hypre_printf("HYPRE_ParCSRCGNRGetPrecond got good precond\n"); + } + HYPRE_CGNRSetup(pcg_solver, (HYPRE_Matrix) parcsr_M, + (HYPRE_Vector) b, (HYPRE_Vector) x); hypre_EndTiming(time_index); hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); @@ -7303,19 +8969,31 @@ main( hypre_int argc, hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); + HYPRE_ANNOTATE_REGION_END("%s", "Run-1"); - HYPRE_CGNRGetNumIterations(pcg_solver, &num_iterations); - HYPRE_CGNRGetFinalRelativeResidualNorm(pcg_solver,&final_res_norm); - -#if SECOND_TIME - /* run a second time to check for memory leaks */ - HYPRE_ParVectorSetRandomValues(x, 775); - HYPRE_CGNRSetup(pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, - (HYPRE_Vector)x); - HYPRE_CGNRSolve(pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, - (HYPRE_Vector)x); + if (second_time) + { + /* run a second time [for timings, to check for memory leaks] */ + HYPRE_ANNOTATE_REGION_BEGIN("%s", "Run-2"); + HYPRE_ParVectorSetRandomValues(x, 775); +#if defined(HYPRE_USING_CURAND) || defined(HYPRE_USING_ROCRAND) + hypre_ResetDeviceRandGenerator(1234ULL, 0ULL); #endif + hypre_ParVectorCopy(x0_save, x); + + HYPRE_CGNRSetup(pcg_solver, + (HYPRE_Matrix) parcsr_M, + (HYPRE_Vector) b, + (HYPRE_Vector) x); + HYPRE_CGNRSolve(pcg_solver, + (HYPRE_Matrix) parcsr_A, + (HYPRE_Vector) b, + (HYPRE_Vector) x); + HYPRE_ANNOTATE_REGION_END("%s", "Run-2"); + } + HYPRE_CGNRGetNumIterations(pcg_solver, &num_iterations); + HYPRE_CGNRGetFinalRelativeResidualNorm(pcg_solver, &final_res_norm); HYPRE_ParCSRCGNRDestroy(pcg_solver); if (solver_id == 5) @@ -7337,7 +9015,7 @@ main( hypre_int argc, if (solver_id == 70) { - if (myid == 0) hypre_printf("Solver: MGR\n"); + if (myid == 0) { hypre_printf("Solver: MGR\n"); } time_index = hypre_InitializeTiming("MGR Setup"); hypre_BeginTiming(time_index); @@ -7345,29 +9023,33 @@ main( hypre_int argc, HYPRE_MGRCreate(&mgr_solver); mgr_num_cindexes = hypre_CTAlloc(HYPRE_Int, mgr_nlevels, HYPRE_MEMORY_HOST); - for(i=0; i -1) + { + HYPRE_BoomerAMGSetCycleRelaxType(amg_solver, relax_down, 1); + } + if (relax_up > -1) + { + HYPRE_BoomerAMGSetCycleRelaxType(amg_solver, relax_up, 2); + } + if (relax_coarse > -1) + { + HYPRE_BoomerAMGSetCycleRelaxType(amg_solver, relax_coarse, 3); + } + HYPRE_BoomerAMGSetSmoothType(amg_solver, smooth_type); + HYPRE_BoomerAMGSetSmoothNumSweeps(amg_solver, smooth_num_sweeps); + } HYPRE_BoomerAMGSetCGCIts(amg_solver, cgcits); - HYPRE_BoomerAMGSetInterpType(amg_solver, 0); - HYPRE_BoomerAMGSetPostInterpType(amg_solver, post_interp_type); - HYPRE_BoomerAMGSetCoarsenType(amg_solver, 6); HYPRE_BoomerAMGSetTol(amg_solver, tol); HYPRE_BoomerAMGSetPMaxElmts(amg_solver, 0); - HYPRE_BoomerAMGSetCycleType(amg_solver, cycle_type); - HYPRE_BoomerAMGSetFCycle(amg_solver, fcycle); HYPRE_BoomerAMGSetNumSweeps(amg_solver, num_sweeps); - HYPRE_BoomerAMGSetRelaxType(amg_solver, 3); - if (relax_down > -1) - HYPRE_BoomerAMGSetCycleRelaxType(amg_solver, relax_down, 1); - if (relax_up > -1) - HYPRE_BoomerAMGSetCycleRelaxType(amg_solver, relax_up, 2); - if (relax_coarse > -1) - HYPRE_BoomerAMGSetCycleRelaxType(amg_solver, relax_coarse, 3); HYPRE_BoomerAMGSetRelaxOrder(amg_solver, 1); HYPRE_BoomerAMGSetMaxLevels(amg_solver, max_levels); - HYPRE_BoomerAMGSetSmoothType(amg_solver, smooth_type); - HYPRE_BoomerAMGSetSmoothNumSweeps(amg_solver, smooth_num_sweeps); - if(mgr_nlevels < 1 || mgr_bsize < 2) + if (mgr_nlevels < 1 || mgr_bsize < 2) { HYPRE_BoomerAMGSetMaxIter(amg_solver, max_iter); HYPRE_BoomerAMGSetPrintLevel(amg_solver, 3); } else { - HYPRE_BoomerAMGSetMaxIter(amg_solver, 1); + HYPRE_BoomerAMGSetMaxIter(amg_solver, precon_cycles); HYPRE_BoomerAMGSetTol(amg_solver, 0.0); HYPRE_BoomerAMGSetPrintLevel(amg_solver, 1); } @@ -7429,7 +9125,7 @@ main( hypre_int argc, HYPRE_MGRSetCoarseSolver( mgr_solver, HYPRE_BoomerAMGSolve, HYPRE_BoomerAMGSetup, amg_solver); /* setup MGR solver */ - HYPRE_MGRSetup(mgr_solver, parcsr_A, b, x); + HYPRE_MGRSetup(mgr_solver, parcsr_M, b, x); hypre_EndTiming(time_index); hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); @@ -7447,6 +9143,19 @@ main( hypre_int argc, hypre_FinalizeTiming(time_index); hypre_ClearTiming(); + if (second_time) + { + /* run a second time [for timings, to check for memory leaks] */ + HYPRE_ParVectorSetRandomValues(x, 775); +#if defined(HYPRE_USING_CURAND) || defined(HYPRE_USING_ROCRAND) + hypre_ResetDeviceRandGenerator(1234ULL, 0ULL); +#endif + hypre_ParVectorCopy(x0_save, x); + + HYPRE_MGRSetup(mgr_solver, parcsr_M, b, x); + HYPRE_MGRSolve(mgr_solver, parcsr_A, b, x); + } + HYPRE_MGRGetNumIterations(mgr_solver, &num_iterations); HYPRE_MGRGetFinalRelativeResidualNorm(mgr_solver, &final_res_norm); @@ -7458,28 +9167,27 @@ main( hypre_int argc, hypre_printf("\n"); } -#if SECOND_TIME - /* run a second time to check for memory leaks */ - HYPRE_ParVectorSetRandomValues(x, 775); - HYPRE_MGRSetup(mgr_solver, parcsr_A, b, x); - HYPRE_MGRSolve(mgr_solver, parcsr_A, b, x); -#endif - /* free memory */ - if(mgr_num_cindexes) + if (mgr_num_cindexes) + { hypre_TFree(mgr_num_cindexes, HYPRE_MEMORY_HOST); + } mgr_num_cindexes = NULL; - if(mgr_reserved_coarse_indexes) + if (mgr_reserved_coarse_indexes) + { hypre_TFree(mgr_reserved_coarse_indexes, HYPRE_MEMORY_HOST); + } mgr_reserved_coarse_indexes = NULL; - if(mgr_cindexes) + if (mgr_cindexes) { - for( i=0; i 1) { - values[0] += 2.0*cx; + values[0] += 2.0 * cx; } if (ny > 1) { - values[0] += 2.0*cy; + values[0] += 2.0 * cy; } if (nz > 1) { - values[0] += 2.0*cz; + values[0] += 2.0 * cz; } if (num_fun == 1) @@ -7947,46 +9723,46 @@ BuildParLaplacian( HYPRE_Int argc, nx, ny, nz, P, Q, R, p, q, r, values); else { - mtrx = hypre_CTAlloc(HYPRE_Real, num_fun*num_fun, HYPRE_MEMORY_HOST); + mtrx = hypre_CTAlloc(HYPRE_Real, num_fun * num_fun, HYPRE_MEMORY_HOST); if (num_fun == 2) { - if (sys_opt ==1) /* identity */ + if (sys_opt == 1) /* identity */ { mtrx[0] = 1.0; mtrx[1] = 0.0; mtrx[2] = 0.0; mtrx[3] = 1.0; } - else if (sys_opt ==2) + else if (sys_opt == 2) { mtrx[0] = 1.0; mtrx[1] = 0.0; mtrx[2] = 0.0; mtrx[3] = 20.0; } - else if (sys_opt ==3) /* similar to barry's talk - ex1 */ + else if (sys_opt == 3) /* similar to barry's talk - ex1 */ { mtrx[0] = 1.0; mtrx[1] = 2.0; mtrx[2] = 2.0; mtrx[3] = 1.0; } - else if (sys_opt ==4) /* can use with vcoef to get barry's ex*/ + else if (sys_opt == 4) /* can use with vcoef to get barry's ex*/ { mtrx[0] = 1.0; mtrx[1] = 1.0; mtrx[2] = 1.0; mtrx[3] = 1.0; } - else if (sys_opt ==5) /* barry's talk - ex1 */ + else if (sys_opt == 5) /* barry's talk - ex1 */ { mtrx[0] = 1.0; mtrx[1] = 1.1; mtrx[2] = 1.1; mtrx[3] = 1.0; } - else if (sys_opt ==6) /* */ + else if (sys_opt == 6) /* */ { mtrx[0] = 1.1; mtrx[1] = 1.0; @@ -8004,7 +9780,7 @@ BuildParLaplacian( HYPRE_Int argc, } else if (num_fun == 3) { - if (sys_opt ==1) + if (sys_opt == 1) { mtrx[0] = 1.0; mtrx[1] = 0.0; @@ -8016,7 +9792,7 @@ BuildParLaplacian( HYPRE_Int argc, mtrx[7] = 0.0; mtrx[8] = 1.0; } - else if (sys_opt ==2) + else if (sys_opt == 2) { mtrx[0] = 1.0; mtrx[1] = 0.0; @@ -8026,9 +9802,9 @@ BuildParLaplacian( HYPRE_Int argc, mtrx[5] = 0.0; mtrx[6] = 0.0; mtrx[7] = 0.0; - mtrx[8] =.01; + mtrx[8] = .01; } - else if (sys_opt ==3) + else if (sys_opt == 3) { mtrx[0] = 1.01; mtrx[1] = 1; @@ -8040,7 +9816,7 @@ BuildParLaplacian( HYPRE_Int argc, mtrx[7] = 1; mtrx[8] = 1.01; } - else if (sys_opt ==4) /* barry ex4 */ + else if (sys_opt == 4) /* barry ex4 */ { mtrx[0] = 3; mtrx[1] = 1; @@ -8096,7 +9872,7 @@ BuildParLaplacian( HYPRE_Int argc, { HYPRE_Real *mtrx_values; - mtrx_values = hypre_CTAlloc(HYPRE_Real, num_fun*num_fun*4, HYPRE_MEMORY_HOST); + mtrx_values = hypre_CTAlloc(HYPRE_Real, num_fun * num_fun * 4, HYPRE_MEMORY_HOST); if (num_fun == 2) { @@ -8134,13 +9910,13 @@ BuildParLaplacian( HYPRE_Int argc, { /* mtrx[0] */ - SetSysVcoefValues(num_fun, nx, ny, nz, ep*1.0, 1.0, 1.0, 0, mtrx_values); + SetSysVcoefValues(num_fun, nx, ny, nz, ep * 1.0, 1.0, 1.0, 0, mtrx_values); /* mtrx[1] */ SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, 1.0, 1.0, 1, mtrx_values); /* mtrx[2] */ - SetSysVcoefValues(num_fun, nx, ny, nz, ep*1.0, 1.0, 1.0, 2, mtrx_values); + SetSysVcoefValues(num_fun, nx, ny, nz, ep * 1.0, 1.0, 1.0, 2, mtrx_values); /* mtrx[3] */ SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, 1.0, 1.0, 3, mtrx_values); @@ -8150,16 +9926,16 @@ BuildParLaplacian( HYPRE_Int argc, HYPRE_Real ep2 = ep; /* mtrx[0] */ - SetSysVcoefValues(num_fun, nx, ny, nz, ep*1.0, 1.0, 1.0, 0, mtrx_values); + SetSysVcoefValues(num_fun, nx, ny, nz, ep * 1.0, 1.0, 1.0, 0, mtrx_values); /* mtrx[1] */ - SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, ep*1.0, 1.0, 1, mtrx_values); + SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, ep * 1.0, 1.0, 1, mtrx_values); /* mtrx[2] */ - SetSysVcoefValues(num_fun, nx, ny, nz, ep*1.0, 1.0, 1.0, 2, mtrx_values); + SetSysVcoefValues(num_fun, nx, ny, nz, ep * 1.0, 1.0, 1.0, 2, mtrx_values); /* mtrx[3] */ - SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, ep2*1.0, 1.0, 3, mtrx_values); + SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, ep2 * 1.0, 1.0, 3, mtrx_values); } else if (vcoef_opt == 5) /* use with default sys_opt - */ { @@ -8168,16 +9944,16 @@ BuildParLaplacian( HYPRE_Int argc, beta = 10; /* mtrx[0] */ - SetSysVcoefValues(num_fun, nx, ny, nz, alp*1.0, 1.0, 1.0, 0, mtrx_values); + SetSysVcoefValues(num_fun, nx, ny, nz, alp * 1.0, 1.0, 1.0, 0, mtrx_values); /* mtrx[1] */ - SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, beta*1.0, 1.0, 1, mtrx_values); + SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, beta * 1.0, 1.0, 1, mtrx_values); /* mtrx[2] */ - SetSysVcoefValues(num_fun, nx, ny, nz, alp*1.0, 1.0, 1.0, 2, mtrx_values); + SetSysVcoefValues(num_fun, nx, ny, nz, alp * 1.0, 1.0, 1.0, 2, mtrx_values); /* mtrx[3] */ - SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, beta*1.0, 1.0, 3, mtrx_values); + SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, beta * 1.0, 1.0, 3, mtrx_values); } else /* = 0 */ { @@ -8271,7 +10047,7 @@ BuildParDifConv( HYPRE_Int argc, HYPRE_Int P, Q, R; HYPRE_Real cx, cy, cz; HYPRE_Real ax, ay, az, atype; - HYPRE_Real hinx,hiny,hinz; + HYPRE_Real hinx, hiny, hinz; HYPRE_Int sign_prod; HYPRE_ParCSRMatrix A; @@ -8332,16 +10108,16 @@ BuildParDifConv( HYPRE_Int argc, else if ( strcmp(argv[arg_index], "-c") == 0 ) { arg_index++; - cx = atof(argv[arg_index++]); - cy = atof(argv[arg_index++]); - cz = atof(argv[arg_index++]); + cx = (HYPRE_Real)atof(argv[arg_index++]); + cy = (HYPRE_Real)atof(argv[arg_index++]); + cz = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-a") == 0 ) { arg_index++; - ax = atof(argv[arg_index++]); - ay = atof(argv[arg_index++]); - az = atof(argv[arg_index++]); + ax = (HYPRE_Real)atof(argv[arg_index++]); + ay = (HYPRE_Real)atof(argv[arg_index++]); + az = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-atype") == 0 ) { @@ -8358,7 +10134,7 @@ BuildParDifConv( HYPRE_Int argc, * Check a few things *-----------------------------------------------------------*/ - if ((P*Q*R) != num_procs) + if ((P * Q * R) != num_procs) { hypre_printf("Error: Invalid number of processors or processor topology \n"); exit(1); @@ -8384,12 +10160,12 @@ BuildParDifConv( HYPRE_Int argc, /* compute p,q,r from P,Q,R and myid */ p = myid % P; - q = (( myid - p)/P) % Q; - r = ( myid - p - P*q)/( P*Q ); + q = (( myid - p) / P) % Q; + r = ( myid - p - P * q) / ( P * Q ); - hinx = 1./(HYPRE_Real)(nx+1); - hiny = 1./(HYPRE_Real)(ny+1); - hinz = 1./(HYPRE_Real)(nz+1); + hinx = 1. / (HYPRE_Real)(nx + 1); + hiny = 1. / (HYPRE_Real)(ny + 1); + hinz = 1. / (HYPRE_Real)(nz + 1); /*----------------------------------------------------------- * Generate the matrix @@ -8409,46 +10185,46 @@ BuildParDifConv( HYPRE_Int argc, if (0 == atype) /* forward scheme for conv */ { - values[1] = -cx/(hinx*hinx); - values[2] = -cy/(hiny*hiny); - values[3] = -cz/(hinz*hinz); - values[4] = -cx/(hinx*hinx) + ax/hinx; - values[5] = -cy/(hiny*hiny) + ay/hiny; - values[6] = -cz/(hinz*hinz) + az/hinz; + values[1] = -cx / (hinx * hinx); + values[2] = -cy / (hiny * hiny); + values[3] = -cz / (hinz * hinz); + values[4] = -cx / (hinx * hinx) + ax / hinx; + values[5] = -cy / (hiny * hiny) + ay / hiny; + values[6] = -cz / (hinz * hinz) + az / hinz; if (nx > 1) { - values[0] += 2.0*cx/(hinx*hinx) - 1.*ax/hinx; + values[0] += 2.0 * cx / (hinx * hinx) - 1.*ax / hinx; } if (ny > 1) { - values[0] += 2.0*cy/(hiny*hiny) - 1.*ay/hiny; + values[0] += 2.0 * cy / (hiny * hiny) - 1.*ay / hiny; } if (nz > 1) { - values[0] += 2.0*cz/(hinz*hinz) - 1.*az/hinz; + values[0] += 2.0 * cz / (hinz * hinz) - 1.*az / hinz; } } else if (1 == atype) /* backward scheme for conv */ { - values[1] = -cx/(hinx*hinx) - ax/hinx; - values[2] = -cy/(hiny*hiny) - ay/hiny; - values[3] = -cz/(hinz*hinz) - az/hinz; - values[4] = -cx/(hinx*hinx); - values[5] = -cy/(hiny*hiny); - values[6] = -cz/(hinz*hinz); + values[1] = -cx / (hinx * hinx) - ax / hinx; + values[2] = -cy / (hiny * hiny) - ay / hiny; + values[3] = -cz / (hinz * hinz) - az / hinz; + values[4] = -cx / (hinx * hinx); + values[5] = -cy / (hiny * hiny); + values[6] = -cz / (hinz * hinz); if (nx > 1) { - values[0] += 2.0*cx/(hinx*hinx) + 1.*ax/hinx; + values[0] += 2.0 * cx / (hinx * hinx) + 1.*ax / hinx; } if (ny > 1) { - values[0] += 2.0*cy/(hiny*hiny) + 1.*ay/hiny; + values[0] += 2.0 * cy / (hiny * hiny) + 1.*ay / hiny; } if (nz > 1) { - values[0] += 2.0*cz/(hinz*hinz) + 1.*az/hinz; + values[0] += 2.0 * cz / (hinz * hinz) + 1.*az / hinz; } } else if (3 == atype) /* upwind scheme */ @@ -8456,83 +10232,83 @@ BuildParDifConv( HYPRE_Int argc, sign_prod = sign_double(cx) * sign_double(ax); if (sign_prod == 1) /* same sign use back scheme */ { - values[1] = -cx/(hinx*hinx) - ax/hinx; - values[4] = -cx/(hinx*hinx); + values[1] = -cx / (hinx * hinx) - ax / hinx; + values[4] = -cx / (hinx * hinx); if (nx > 1) { - values[0] += 2.0*cx/(hinx*hinx) + 1.*ax/hinx; + values[0] += 2.0 * cx / (hinx * hinx) + 1.*ax / hinx; } } else /* diff sign use forward scheme */ { - values[1] = -cx/(hinx*hinx); - values[4] = -cx/(hinx*hinx) + ax/hinx; + values[1] = -cx / (hinx * hinx); + values[4] = -cx / (hinx * hinx) + ax / hinx; if (nx > 1) { - values[0] += 2.0*cx/(hinx*hinx) - 1.*ax/hinx; + values[0] += 2.0 * cx / (hinx * hinx) - 1.*ax / hinx; } } sign_prod = sign_double(cy) * sign_double(ay); if (sign_prod == 1) /* same sign use back scheme */ { - values[2] = -cy/(hiny*hiny) - ay/hiny; - values[5] = -cy/(hiny*hiny); + values[2] = -cy / (hiny * hiny) - ay / hiny; + values[5] = -cy / (hiny * hiny); if (ny > 1) { - values[0] += 2.0*cy/(hiny*hiny) + 1.*ay/hiny; + values[0] += 2.0 * cy / (hiny * hiny) + 1.*ay / hiny; } } else /* diff sign use forward scheme */ { - values[2] = -cy/(hiny*hiny); - values[5] = -cy/(hiny*hiny) + ay/hiny; + values[2] = -cy / (hiny * hiny); + values[5] = -cy / (hiny * hiny) + ay / hiny; if (ny > 1) { - values[0] += 2.0*cy/(hiny*hiny) - 1.*ay/hiny; + values[0] += 2.0 * cy / (hiny * hiny) - 1.*ay / hiny; } } sign_prod = sign_double(cz) * sign_double(az); if (sign_prod == 1) /* same sign use back scheme */ { - values[3] = -cz/(hinz*hinz) - az/hinz; - values[6] = -cz/(hinz*hinz); + values[3] = -cz / (hinz * hinz) - az / hinz; + values[6] = -cz / (hinz * hinz); if (nz > 1) { - values[0] += 2.0*cz/(hinz*hinz) + 1.*az/hinz; + values[0] += 2.0 * cz / (hinz * hinz) + 1.*az / hinz; } } else /* diff sign use forward scheme */ { - values[3] = -cz/(hinz*hinz); - values[6] = -cz/(hinz*hinz) + az/hinz; + values[3] = -cz / (hinz * hinz); + values[6] = -cz / (hinz * hinz) + az / hinz; if (nz > 1) { - values[0] += 2.0*cz/(hinz*hinz) - 1.*az/hinz; + values[0] += 2.0 * cz / (hinz * hinz) - 1.*az / hinz; } } } else /* centered difference scheme */ { - values[1] = -cx/(hinx*hinx) - ax/(2.*hinx); - values[2] = -cy/(hiny*hiny) - ay/(2.*hiny); - values[3] = -cz/(hinz*hinz) - az/(2.*hinz); - values[4] = -cx/(hinx*hinx) + ax/(2.*hinx); - values[5] = -cy/(hiny*hiny) + ay/(2.*hiny); - values[6] = -cz/(hinz*hinz) + az/(2.*hinz); + values[1] = -cx / (hinx * hinx) - ax / (2.*hinx); + values[2] = -cy / (hiny * hiny) - ay / (2.*hiny); + values[3] = -cz / (hinz * hinz) - az / (2.*hinz); + values[4] = -cx / (hinx * hinx) + ax / (2.*hinx); + values[5] = -cy / (hiny * hiny) + ay / (2.*hiny); + values[6] = -cz / (hinz * hinz) + az / (2.*hinz); if (nx > 1) { - values[0] += 2.0*cx/(hinx*hinx); + values[0] += 2.0 * cx / (hinx * hinx); } if (ny > 1) { - values[0] += 2.0*cy/(hiny*hiny); + values[0] += 2.0 * cy / (hiny * hiny); } if (nz > 1) { - values[0] += 2.0*cz/(hinz*hinz); + values[0] += 2.0 * cz / (hinz * hinz); } } @@ -8608,21 +10384,21 @@ BuildParFromOneFile( HYPRE_Int argc, if (myid == 0 && num_functions > 1) { HYPRE_CSRMatrixGetNumRows(A_CSR, &num_dofs); - num_nodes = num_dofs/num_functions; - if (num_dofs == num_functions*num_nodes) + num_nodes = num_dofs / num_functions; + if (num_dofs == num_functions * num_nodes) { - row_part = hypre_CTAlloc(HYPRE_BigInt, numprocs+1, HYPRE_MEMORY_HOST); + row_part = hypre_CTAlloc(HYPRE_BigInt, numprocs + 1, HYPRE_MEMORY_HOST); row_part[0] = 0; - size = num_nodes/numprocs; - rest = num_nodes-size*numprocs; + size = num_nodes / numprocs; + rest = num_nodes - size * numprocs; for (i = 0; i < rest; i++) { - row_part[i+1] = row_part[i] + (size + 1)*num_functions; + row_part[i + 1] = row_part[i] + (size + 1) * num_functions; } for (i = rest; i < numprocs; i++) { - row_part[i+1] = row_part[i]+size*num_functions; + row_part[i + 1] = row_part[i] + size * num_functions; } col_part = row_part; @@ -8644,19 +10420,24 @@ BuildParFromOneFile( HYPRE_Int argc, *----------------------------------------------------------------------*/ HYPRE_Int -BuildFuncsFromFiles( HYPRE_Int argc, - char *argv[], - HYPRE_Int arg_index, - HYPRE_ParCSRMatrix parcsr_A, - HYPRE_Int **dof_func_ptr ) +BuildFuncsFromFiles( HYPRE_Int argc, + char *argv[], + HYPRE_Int arg_index, + HYPRE_ParCSRMatrix parcsr_A, + HYPRE_Int **dof_func_ptr ) { -/*---------------------------------------------------------------------- - * Build Function array from files on different processors - *----------------------------------------------------------------------*/ + HYPRE_UNUSED_VAR(argc); + HYPRE_UNUSED_VAR(argv); + HYPRE_UNUSED_VAR(arg_index); + HYPRE_UNUSED_VAR(parcsr_A); + HYPRE_UNUSED_VAR(dof_func_ptr); - hypre_printf (" Feature is not implemented yet!\n"); - return(0); + /*---------------------------------------------------------------------- + * Build Function array from files on different processors + *----------------------------------------------------------------------*/ + hypre_printf("Feature is not implemented yet!\n"); + return (0); } /*---------------------------------------------------------------------- @@ -8664,19 +10445,19 @@ BuildFuncsFromFiles( HYPRE_Int argc, *----------------------------------------------------------------------*/ HYPRE_Int -BuildFuncsFromOneFile( HYPRE_Int argc, - char *argv[], - HYPRE_Int arg_index, - HYPRE_ParCSRMatrix parcsr_A, - HYPRE_Int **dof_func_ptr ) +BuildFuncsFromOneFile( HYPRE_Int argc, + char *argv[], + HYPRE_Int arg_index, + HYPRE_ParCSRMatrix parcsr_A, + HYPRE_Int **dof_func_ptr ) { - char *filename; + char *filename; HYPRE_Int myid, num_procs; HYPRE_Int first_row_index; HYPRE_Int last_row_index; HYPRE_BigInt *partitioning; - HYPRE_Int *dof_func; + HYPRE_Int *dof_func = NULL; HYPRE_Int *dof_func_local; HYPRE_Int i, j; HYPRE_Int local_size; @@ -8736,35 +10517,35 @@ BuildFuncsFromOneFile( HYPRE_Int argc, first_row_index = hypre_ParCSRMatrixFirstRowIndex(parcsr_A); last_row_index = hypre_ParCSRMatrixLastRowIndex(parcsr_A); local_size = last_row_index - first_row_index + 1; - dof_func_local = hypre_CTAlloc(HYPRE_Int, local_size, HYPRE_MEMORY_HOST); + dof_func_local = hypre_CTAlloc(HYPRE_Int, local_size, HYPRE_MEMORY_HOST); if (myid == 0) { - requests = hypre_CTAlloc(hypre_MPI_Request, num_procs-1, HYPRE_MEMORY_HOST); - status = hypre_CTAlloc(hypre_MPI_Status, num_procs-1, HYPRE_MEMORY_HOST); - for (i=1; i < num_procs; i++) + requests = hypre_CTAlloc(hypre_MPI_Request, num_procs - 1, HYPRE_MEMORY_HOST); + status = hypre_CTAlloc(hypre_MPI_Status, num_procs - 1, HYPRE_MEMORY_HOST); + for (i = 1; i < num_procs; i++) { hypre_MPI_Isend(&dof_func[partitioning[i]], - (partitioning[i+1] - partitioning[i]), - HYPRE_MPI_INT, i, 0, comm, &requests[i-1]); + (partitioning[i + 1] - partitioning[i]), + HYPRE_MPI_INT, i, 0, comm, &requests[i - 1]); } - for (i=0; i < local_size; i++) + for (i = 0; i < local_size; i++) { dof_func_local[i] = dof_func[i]; } - hypre_MPI_Waitall(num_procs-1,requests, status); + hypre_MPI_Waitall(num_procs - 1, requests, status); hypre_TFree(requests, HYPRE_MEMORY_HOST); hypre_TFree(status, HYPRE_MEMORY_HOST); } else { - hypre_MPI_Recv(dof_func_local,local_size,HYPRE_MPI_INT,0,0,comm,&status0); + hypre_MPI_Recv(dof_func_local, local_size, HYPRE_MPI_INT, 0, 0, comm, &status0); } *dof_func_ptr = dof_func_local; - if (myid == 0) hypre_TFree(dof_func, HYPRE_MEMORY_HOST); + if (myid == 0) { hypre_TFree(dof_func, HYPRE_MEMORY_HOST); } - if (partitioning) hypre_TFree(partitioning, HYPRE_MEMORY_HOST); + if (partitioning) { hypre_TFree(partitioning, HYPRE_MEMORY_HOST); } return (0); } @@ -8785,7 +10566,7 @@ BuildRhsParFromOneFile( HYPRE_Int argc, HYPRE_Int myid; HYPRE_BigInt *partitioning; HYPRE_ParVector b; - HYPRE_Vector b_CSR=NULL; + HYPRE_Vector b_CSR = NULL; /*----------------------------------------------------------- * Initialize some stuff @@ -8822,7 +10603,7 @@ BuildRhsParFromOneFile( HYPRE_Int argc, b_CSR = HYPRE_VectorRead(filename); } - HYPRE_VectorToParVector(hypre_MPI_COMM_WORLD, b_CSR, partitioning,&b); + HYPRE_VectorToParVector(hypre_MPI_COMM_WORLD, b_CSR, partitioning, &b); *b_ptr = b; @@ -8846,17 +10627,17 @@ BuildBigArrayFromOneFile( HYPRE_Int argc, HYPRE_BigInt **array_ptr ) { MPI_Comm comm = hypre_MPI_COMM_WORLD; - char *filename; + char *filename = NULL; FILE *fp; HYPRE_Int myid; HYPRE_Int num_procs; HYPRE_Int global_size; - HYPRE_BigInt *global_array; - HYPRE_BigInt *array; - HYPRE_BigInt *send_buffer; - HYPRE_Int *send_counts = NULL; - HYPRE_Int *displs; - HYPRE_Int *array_procs; + HYPRE_BigInt *global_array = NULL; + HYPRE_BigInt *array = NULL; + HYPRE_BigInt *send_buffer = NULL; + HYPRE_Int *send_counts = NULL; + HYPRE_Int *displs = NULL; + HYPRE_Int *array_procs = NULL; HYPRE_Int j, jj, proc; /*----------------------------------------------------------- @@ -8935,7 +10716,7 @@ BuildBigArrayFromOneFile( HYPRE_Int argc, for (proc = 0; proc < (num_procs - 1); proc++) { - displs[proc+1] = displs[proc] + send_counts[proc]; + displs[proc + 1] = displs[proc] + send_counts[proc]; } } hypre_MPI_Scatter(send_counts, 1, HYPRE_MPI_INT, size, 1, HYPRE_MPI_INT, 0, comm); @@ -9042,7 +10823,7 @@ BuildParLaplacian9pt( HYPRE_Int argc, * Check a few things *-----------------------------------------------------------*/ - if ((P*Q) != num_procs) + if ((P * Q) != num_procs) { hypre_printf("Error: Invalid number of processors or processor topology \n"); exit(1); @@ -9065,7 +10846,7 @@ BuildParLaplacian9pt( HYPRE_Int argc, /* compute p,q from P,Q and myid */ p = myid % P; - q = ( myid - p)/P; + q = ( myid - p) / P; /*----------------------------------------------------------- * Generate the matrix @@ -9098,6 +10879,7 @@ BuildParLaplacian9pt( HYPRE_Int argc, return (0); } + /*---------------------------------------------------------------------- * Build 27-point laplacian in 3D, * Parameters given in command line. @@ -9167,7 +10949,7 @@ BuildParLaplacian27pt( HYPRE_Int argc, * Check a few things *-----------------------------------------------------------*/ - if ((P*Q*R) != num_procs) + if ((P * Q * R) != num_procs) { hypre_printf("Error: Invalid number of processors or processor topology \n"); exit(1); @@ -9190,8 +10972,8 @@ BuildParLaplacian27pt( HYPRE_Int argc, /* compute p,q,r from P,Q,R and myid */ p = myid % P; - q = (( myid - p)/P) % Q; - r = ( myid - p - P*q)/( P*Q ); + q = (( myid - p) / P) % Q; + r = ( myid - p - P * q) / ( P * Q ); /*----------------------------------------------------------- * Generate the matrix @@ -9201,9 +10983,13 @@ BuildParLaplacian27pt( HYPRE_Int argc, values[0] = 26.0; if (nx == 1 || ny == 1 || nz == 1) + { values[0] = 8.0; - if (nx*ny == 1 || nx*nz == 1 || ny*nz == 1) + } + if (nx * ny == 1 || nx * nz == 1 || ny * nz == 1) + { values[0] = 2.0; + } values[1] = -1.; A = (HYPRE_ParCSRMatrix) GenerateLaplacian27pt(hypre_MPI_COMM_WORLD, @@ -9216,6 +11002,129 @@ BuildParLaplacian27pt( HYPRE_Int argc, return (0); } +/*---------------------------------------------------------------------- + * Build 125-point laplacian in 3D (27-pt squared) + * Parameters given in command line. + *----------------------------------------------------------------------*/ + +HYPRE_Int +BuildParLaplacian125pt( HYPRE_Int argc, + char *argv[], + HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr ) +{ + HYPRE_BigInt nx, ny, nz; + HYPRE_Int P, Q, R; + + HYPRE_ParCSRMatrix A, B; + + HYPRE_Int num_procs, myid; + HYPRE_Int p, q, r; + HYPRE_Real *values; + + /*----------------------------------------------------------- + * Initialize some stuff + *-----------------------------------------------------------*/ + + hypre_MPI_Comm_size(hypre_MPI_COMM_WORLD, &num_procs ); + hypre_MPI_Comm_rank(hypre_MPI_COMM_WORLD, &myid ); + + /*----------------------------------------------------------- + * Set defaults + *-----------------------------------------------------------*/ + + nx = 10; + ny = 10; + nz = 10; + + P = 1; + Q = num_procs; + R = 1; + + /*----------------------------------------------------------- + * Parse command line + *-----------------------------------------------------------*/ + arg_index = 0; + while (arg_index < argc) + { + if ( strcmp(argv[arg_index], "-n") == 0 ) + { + arg_index++; + nx = atoi(argv[arg_index++]); + ny = atoi(argv[arg_index++]); + nz = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-P") == 0 ) + { + arg_index++; + P = atoi(argv[arg_index++]); + Q = atoi(argv[arg_index++]); + R = atoi(argv[arg_index++]); + } + else + { + arg_index++; + } + } + + /*----------------------------------------------------------- + * Check a few things + *-----------------------------------------------------------*/ + + if ((P * Q * R) != num_procs) + { + hypre_printf("Error: Invalid number of processors or processor topology \n"); + exit(1); + } + + /*----------------------------------------------------------- + * Print driver parameters + *-----------------------------------------------------------*/ + + if (myid == 0) + { + hypre_printf(" Laplacian_125pt:\n"); + hypre_printf(" (nx, ny, nz) = (%b, %b, %b)\n", nx, ny, nz); + hypre_printf(" (Px, Py, Pz) = (%d, %d, %d)\n\n", P, Q, R); + } + + /*----------------------------------------------------------- + * Set up the grid structure + *-----------------------------------------------------------*/ + + /* compute p,q,r from P,Q,R and myid */ + p = myid % P; + q = (( myid - p) / P) % Q; + r = ( myid - p - P * q) / ( P * Q ); + + /*----------------------------------------------------------- + * Generate the matrix + *-----------------------------------------------------------*/ + + values = hypre_CTAlloc(HYPRE_Real, 2, HYPRE_MEMORY_HOST); + + values[0] = 26.0; + if (nx == 1 || ny == 1 || nz == 1) + { + values[0] = 8.0; + } + if (nx * ny == 1 || nx * nz == 1 || ny * nz == 1) + { + values[0] = 2.0; + } + values[1] = -1.; + + B = (HYPRE_ParCSRMatrix) GenerateLaplacian27pt(hypre_MPI_COMM_WORLD, + nx, ny, nz, P, Q, R, p, q, r, values); + A = (HYPRE_ParCSRMatrix) hypre_ParCSRMatMat(B, B); + + HYPRE_ParCSRMatrixDestroy(B); + hypre_TFree(values, HYPRE_MEMORY_HOST); + + *A_ptr = A; + + return (0); +} /*---------------------------------------------------------------------- * Build 7-point in 2D @@ -9228,14 +11137,14 @@ BuildParRotate7pt( HYPRE_Int argc, HYPRE_Int arg_index, HYPRE_ParCSRMatrix *A_ptr ) { - HYPRE_BigInt nx, ny; - HYPRE_Int P, Q; + HYPRE_BigInt nx, ny; + HYPRE_Int P, Q; HYPRE_ParCSRMatrix A; - HYPRE_Int num_procs, myid; - HYPRE_Int p, q; - HYPRE_Real eps, alpha; + HYPRE_Int num_procs, myid; + HYPRE_Int p, q; + HYPRE_Real eps = 0.0, alpha = 1.0; /*----------------------------------------------------------- * Initialize some stuff @@ -9275,12 +11184,12 @@ BuildParRotate7pt( HYPRE_Int argc, else if ( strcmp(argv[arg_index], "-alpha") == 0 ) { arg_index++; - alpha = atof(argv[arg_index++]); + alpha = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-eps") == 0 ) { arg_index++; - eps = atof(argv[arg_index++]); + eps = (HYPRE_Real)atof(argv[arg_index++]); } else { @@ -9292,7 +11201,7 @@ BuildParRotate7pt( HYPRE_Int argc, * Check a few things *-----------------------------------------------------------*/ - if ((P*Q) != num_procs) + if ((P * Q) != num_procs) { hypre_printf("Error: Invalid number of processors or processor topology \n"); exit(1); @@ -9305,7 +11214,7 @@ BuildParRotate7pt( HYPRE_Int argc, if (myid == 0) { hypre_printf(" Rotate 7pt:\n"); - hypre_printf(" alpha = %f, eps = %f\n", alpha,eps); + hypre_printf(" alpha = %f, eps = %f\n", alpha, eps); hypre_printf(" (nx, ny) = (%b, %b)\n", nx, ny); hypre_printf(" (Px, Py) = (%d, %d)\n", P, Q); } @@ -9316,7 +11225,7 @@ BuildParRotate7pt( HYPRE_Int argc, /* compute p,q from P,Q and myid */ p = myid % P; - q = ( myid - p)/P; + q = ( myid - p) / P; /*----------------------------------------------------------- * Generate the matrix @@ -9404,7 +11313,7 @@ BuildParVarDifConv( HYPRE_Int argc, else if ( strcmp(argv[arg_index], "-eps") == 0 ) { arg_index++; - eps = atof(argv[arg_index++]); + eps = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-vardifconvRS") == 0 ) { @@ -9421,7 +11330,7 @@ BuildParVarDifConv( HYPRE_Int argc, * Check a few things *-----------------------------------------------------------*/ - if ((P*Q*R) != num_procs) + if ((P * Q * R) != num_procs) { hypre_printf("Error: Invalid number of processors or processor topology \n"); exit(1); @@ -9444,8 +11353,8 @@ BuildParVarDifConv( HYPRE_Int argc, /* compute p,q,r from P,Q,R and myid */ p = myid % P; - q = (( myid - p)/P) % Q; - r = ( myid - p - P*q)/( P*Q ); + q = (( myid - p) / P) % Q; + r = ( myid - p - P * q) / ( P * Q ); /*----------------------------------------------------------- * Generate the matrix @@ -9471,29 +11380,30 @@ BuildParVarDifConv( HYPRE_Int argc, /**************************************************************************/ -HYPRE_Int SetSysVcoefValues(HYPRE_Int num_fun, HYPRE_BigInt nx, HYPRE_BigInt ny, HYPRE_BigInt nz, HYPRE_Real vcx, +HYPRE_Int SetSysVcoefValues(HYPRE_Int num_fun, HYPRE_BigInt nx, HYPRE_BigInt ny, HYPRE_BigInt nz, + HYPRE_Real vcx, HYPRE_Real vcy, HYPRE_Real vcz, HYPRE_Int mtx_entry, HYPRE_Real *values) { - HYPRE_Int sz = num_fun*num_fun; + HYPRE_Int sz = num_fun * num_fun; - values[1*sz + mtx_entry] = -vcx; - values[2*sz + mtx_entry] = -vcy; - values[3*sz + mtx_entry] = -vcz; - values[0*sz + mtx_entry] = 0.0; + values[1 * sz + mtx_entry] = -vcx; + values[2 * sz + mtx_entry] = -vcy; + values[3 * sz + mtx_entry] = -vcz; + values[0 * sz + mtx_entry] = 0.0; if (nx > 1) { - values[0*sz + mtx_entry] += 2.0*vcx; + values[0 * sz + mtx_entry] += 2.0 * vcx; } if (ny > 1) { - values[0*sz + mtx_entry] += 2.0*vcy; + values[0 * sz + mtx_entry] += 2.0 * vcy; } if (nz > 1) { - values[0*sz + mtx_entry] += 2.0*vcz; + values[0 * sz + mtx_entry] += 2.0 * vcz; } return 0; @@ -9567,23 +11477,27 @@ BuildParCoordinates( HYPRE_Int argc, /* compute p,q,r from P,Q,R and myid */ p = myid % P; - q = (( myid - p)/P) % Q; - r = ( myid - p - P*q)/( P*Q ); + q = (( myid - p) / P) % Q; + r = ( myid - p - P * q) / ( P * Q ); /*----------------------------------------------------------- * Generate the coordinates *-----------------------------------------------------------*/ coorddim = 3; - if (nx<2) coorddim--; - if (ny<2) coorddim--; - if (nz<2) coorddim--; + if (nx < 2) { coorddim--; } + if (ny < 2) { coorddim--; } + if (nz < 2) { coorddim--; } - if (coorddim>0) - coordinates = GenerateCoordinates (hypre_MPI_COMM_WORLD, - nx, ny, nz, P, Q, R, p, q, r, coorddim); + if (coorddim > 0) + { + coordinates = hypre_GenerateCoordinates(hypre_MPI_COMM_WORLD, + nx, ny, nz, P, Q, R, p, q, r, coorddim); + } else - coordinates=NULL; + { + coordinates = NULL; + } *coorddim_ptr = coorddim; *coord_ptr = coordinates; @@ -9672,8 +11586,8 @@ BuildParIsoLaplacian( HYPRE_Int argc, char** argv, HYPRE_ParCSRMatrix *A_ptr ) /* compute p,q,r from P,Q,R and myid */ p = myid % P; - q = (( myid - p)/P) % Q; - r = ( myid - p - P*q)/( P*Q ); + q = (( myid - p) / P) % Q; + r = ( myid - p - P * q) / ( P * Q ); /*----------------------------------------------------------- * Generate the matrix @@ -9688,15 +11602,15 @@ BuildParIsoLaplacian( HYPRE_Int argc, char** argv, HYPRE_ParCSRMatrix *A_ptr ) values[0] = 0.; if (nx > 1) { - values[0] += 2.0*cx; + values[0] += 2.0 * cx; } if (ny > 1) { - values[0] += 2.0*cy; + values[0] += 2.0 * cy; } if (nz > 1) { - values[0] += 2.0*cz; + values[0] += 2.0 * cz; } A = (HYPRE_ParCSRMatrix) GenerateLaplacian(hypre_MPI_COMM_WORLD, diff --git a/external/hypre/src/test/ij_assembly.c b/external/hypre/src/test/ij_assembly.c index 798a85a7..febf3632 100644 --- a/external/hypre/src/test/ij_assembly.c +++ b/external/hypre/src/test/ij_assembly.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -16,57 +16,33 @@ #include "_hypre_IJ_mv.h" #include "_hypre_parcsr_mv.h" #include "HYPRE_parcsr_ls.h" +#include "_hypre_utilities.h" //#include "_hypre_utilities.hpp" HYPRE_Int buildMatrixEntries(MPI_Comm comm, HYPRE_Int nx, HYPRE_Int ny, HYPRE_Int nz, HYPRE_Int Px, HYPRE_Int Py, HYPRE_Int Pz, - HYPRE_Int cx, HYPRE_Int cy, HYPRE_Int cz, + HYPRE_Real cx, HYPRE_Real cy, HYPRE_Real cz, HYPRE_Int base, HYPRE_BigInt *ilower, HYPRE_BigInt *iupper, HYPRE_BigInt *jlower, HYPRE_BigInt *jupper, HYPRE_Int *nrows, HYPRE_BigInt *num_nonzeros, HYPRE_Int **nnzrow_ptr, HYPRE_BigInt **rows_ptr, - HYPRE_BigInt **rows2_ptr, HYPRE_BigInt **cols_ptr, + HYPRE_BigInt **rows_coo_ptr, HYPRE_BigInt **cols_ptr, HYPRE_Real **coefs_ptr, HYPRE_Int stencil, HYPRE_ParCSRMatrix *parcsr_ptr); -HYPRE_Int getParCSRMatrixData(HYPRE_ParCSRMatrix A, HYPRE_Int *nrows_ptr, HYPRE_BigInt *num_nonzeros_ptr, - HYPRE_Int **nnzrow_ptr, HYPRE_BigInt **rows_ptr, HYPRE_BigInt **rows2_ptr, +HYPRE_Int getParCSRMatrixData(HYPRE_ParCSRMatrix A, HYPRE_Int base, HYPRE_Int *nrows_ptr, + HYPRE_BigInt *num_nonzeros_ptr, + HYPRE_Int **nnzrow_ptr, HYPRE_BigInt **rows_ptr, HYPRE_BigInt **rows_coo_ptr, HYPRE_BigInt **cols_ptr, HYPRE_Real **coefs_ptr); -HYPRE_Int checkMatrix(HYPRE_ParCSRMatrix parcsr_ref, HYPRE_IJMatrix ij_A); - -HYPRE_Int test_Set(MPI_Comm comm, HYPRE_MemoryLocation memory_location, HYPRE_Int option, - HYPRE_BigInt ilower, HYPRE_BigInt iupper, - HYPRE_Int nrows, HYPRE_BigInt num_nonzeros, - HYPRE_Int nchunks, HYPRE_Int *h_nnzrow, HYPRE_Int *nnzrow, - HYPRE_BigInt *rows, HYPRE_BigInt *cols, - HYPRE_Real *coefs, HYPRE_IJMatrix *ij_A_ptr); - -HYPRE_Int test_SetOffProc(HYPRE_ParCSRMatrix parcsr_A, HYPRE_MemoryLocation memory_location, - HYPRE_Int nchunks, HYPRE_Int option, HYPRE_IJMatrix *ij_AT_ptr); - -HYPRE_Int test_SetSet(MPI_Comm comm, HYPRE_MemoryLocation memory_location, HYPRE_Int option, - HYPRE_BigInt ilower, HYPRE_BigInt iupper, - HYPRE_Int nrows, HYPRE_BigInt num_nonzeros, - HYPRE_Int nchunks, HYPRE_Int *h_nnzrow, HYPRE_Int *nnzrow, - HYPRE_BigInt *rows, HYPRE_BigInt *cols, - HYPRE_Real *coefs, HYPRE_IJMatrix *ij_A_ptr); - -HYPRE_Int test_AddSet(MPI_Comm comm, HYPRE_MemoryLocation memory_location, HYPRE_Int option, - HYPRE_BigInt ilower, HYPRE_BigInt iupper, - HYPRE_Int nrows, HYPRE_BigInt num_nonzeros, - HYPRE_Int nchunks, HYPRE_Int *h_nnzrow, HYPRE_Int *nnzrow, - HYPRE_BigInt *rows, HYPRE_BigInt *cols, - HYPRE_Real *coefs, HYPRE_IJMatrix *ij_A_ptr); - -HYPRE_Int test_SetAddSet(MPI_Comm comm, HYPRE_MemoryLocation memory_location, HYPRE_Int option, - HYPRE_BigInt ilower, HYPRE_BigInt iupper, - HYPRE_Int nrows, HYPRE_BigInt num_nonzeros, - HYPRE_Int nchunks, HYPRE_Int *h_nnzrow, HYPRE_Int *nnzrow, - HYPRE_BigInt *rows, HYPRE_BigInt *cols, - HYPRE_Real *coefs, HYPRE_IJMatrix *ij_A_ptr); - -//#define CUDA_PROFILER +HYPRE_Real checkMatrix(HYPRE_ParCSRMatrix parcsr_ref, HYPRE_IJMatrix ij_A); + +HYPRE_Int test_all(MPI_Comm comm, const char *test_name, HYPRE_MemoryLocation memory_location, + HYPRE_Int option, const char *cmd_sequence, HYPRE_BigInt ilower, HYPRE_BigInt iupper, + HYPRE_BigInt jlower, HYPRE_BigInt jupper, HYPRE_Int nrows, HYPRE_BigInt num_nonzeros, + HYPRE_Int nchunks, HYPRE_Int init_alloc, HYPRE_Int early_assemble, HYPRE_Real grow_factor, + HYPRE_Int *h_nnzrow, HYPRE_Int *nnzrow, HYPRE_BigInt *rows, HYPRE_BigInt *cols, HYPRE_Real *coefs, + HYPRE_IJMatrix *ij_A_ptr); hypre_int main( hypre_int argc, @@ -79,33 +55,34 @@ main( hypre_int argc, HYPRE_Int time_index; HYPRE_Int print_usage; HYPRE_MemoryLocation memory_location; -#if defined(HYPRE_USING_GPU) - HYPRE_ExecutionPolicy default_exec_policy; +#if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) + HYPRE_ExecutionPolicy default_exec_policy; #endif char memory_location_name[8]; - HYPRE_Int nrows; HYPRE_BigInt num_nonzeros; HYPRE_BigInt ilower, iupper; HYPRE_BigInt jlower, jupper; - HYPRE_Int *nnzrow, *h_nnzrow, *d_nnzrow; - HYPRE_BigInt *rows, *h_rows, *d_rows; - HYPRE_BigInt *rows2, *h_rows2, *d_rows2; - HYPRE_BigInt *cols, *h_cols, *d_cols; - HYPRE_Real *coefs, *h_coefs, *d_coefs; - HYPRE_IJMatrix ij_A; - HYPRE_IJMatrix ij_AT; - HYPRE_ParCSRMatrix parcsr_ref; - + HYPRE_Int *nnzrow = NULL, *h_nnzrow, *d_nnzrow = NULL; + HYPRE_BigInt *rows = NULL, *h_rows, *d_rows = NULL; + HYPRE_BigInt *rows_coo = NULL, *h_rows_coo, *d_rows_coo = NULL; + HYPRE_BigInt *cols = NULL, *h_cols, *d_cols = NULL; + HYPRE_Real *coefs = NULL, *h_coefs, *d_coefs = NULL; + HYPRE_IJMatrix ij_A, ij_AT; + HYPRE_ParCSRMatrix parcsr_ref = NULL, parcsr_trans = NULL; // Driver input parameters HYPRE_Int Px, Py, Pz; HYPRE_Int nx, ny, nz; HYPRE_Real cx, cy, cz; HYPRE_Int nchunks; - HYPRE_Int mode; - HYPRE_Int option; + HYPRE_Int mode, ierr = 0; + HYPRE_Real tol = HYPRE_REAL_EPSILON; + HYPRE_Int option, base; HYPRE_Int stencil; HYPRE_Int print_matrix; + HYPRE_Int init_alloc = -1; + HYPRE_Int early_assemble = 0; + HYPRE_Real grow_factor = -1.0; /* Initialize MPI */ hypre_MPI_Init(&argc, &argv); @@ -114,15 +91,16 @@ main( hypre_int argc, /*----------------------------------------------------------------- * GPU Device binding - * Must be done before HYPRE_Init() and should not be changed after + * Must be done before HYPRE_Initialize() and should not be changed after *-----------------------------------------------------------------*/ - hypre_bind_device(myid, num_procs, hypre_MPI_COMM_WORLD); + hypre_bind_device_id(-1, myid, num_procs, hypre_MPI_COMM_WORLD); /* Initialize Hypre */ /* Initialize Hypre: must be the first Hypre function to call */ time_index = hypre_InitializeTiming("Hypre init"); hypre_BeginTiming(time_index); - HYPRE_Init(); + HYPRE_Initialize(); + HYPRE_DeviceInitialize(); hypre_EndTiming(time_index); hypre_PrintTiming("Hypre init times", hypre_MPI_COMM_WORLD); hypre_FinalizeTiming(time_index); @@ -143,13 +121,14 @@ main( hypre_int argc, cy = 2.0; cz = 3.0; -#if defined(HYPRE_USING_GPU) +#if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) default_exec_policy = HYPRE_EXEC_DEVICE; #endif memory_location = HYPRE_MEMORY_DEVICE; - mode = 1; + mode = (1 << 7) - 1; option = 1; - nchunks = 1; + nchunks = 3; + base = 0; print_matrix = 0; stencil = 7; @@ -182,9 +161,9 @@ main( hypre_int argc, else if ( strcmp(argv[arg_index], "-c") == 0 ) { arg_index++; - cx = atof(argv[arg_index++]); - cy = atof(argv[arg_index++]); - cz = atof(argv[arg_index++]); + cx = (HYPRE_Real)atof(argv[arg_index++]); + cy = (HYPRE_Real)atof(argv[arg_index++]); + cz = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-mode") == 0 ) { @@ -211,6 +190,26 @@ main( hypre_int argc, arg_index++; nchunks = atoi(argv[arg_index++]); } + else if ( strcmp(argv[arg_index], "-base") == 0 ) + { + arg_index++; + base = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-init") == 0 ) + { + arg_index++; + init_alloc = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-early") == 0 ) + { + arg_index++; + early_assemble = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-grow") == 0 ) + { + arg_index++; + grow_factor = (HYPRE_Real) atof(argv[arg_index++]); + } else if ( strcmp(argv[arg_index], "-print") == 0 ) { arg_index++; @@ -225,7 +224,7 @@ main( hypre_int argc, /*----------------------------------------------------------- * Safety checks *-----------------------------------------------------------*/ - if (Px*Py*Pz != num_procs) + if (Px * Py * Pz != num_procs) { hypre_printf("Px x Py x Pz is different than the number of MPI processes"); return (-1); @@ -248,6 +247,7 @@ main( hypre_int argc, hypre_printf(" 0 = HOST\n"); hypre_printf(" 1 = DEVICE (default)\n"); hypre_printf(" -nchunks : number of chunks passed to Set/AddValues\n"); + hypre_printf(" -base : matrix index base\n"); hypre_printf(" -mode : tests to be performed\n"); hypre_printf(" 1 = Set (default)\n"); hypre_printf(" 2 = SetOffProc\n"); @@ -264,6 +264,10 @@ main( hypre_int argc, return (0); } +#if defined(HYPRE_USING_MEMORY_TRACKER) + hypre_MemoryTrackerSetPrint(1); +#endif + /*----------------------------------------------------------- * Print driver parameters *-----------------------------------------------------------*/ @@ -288,35 +292,47 @@ main( hypre_int argc, hypre_printf("\n"); } -#if defined(HYPRE_USING_GPU) +#if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) hypre_HandleDefaultExecPolicy(hypre_handle()) = default_exec_policy; #endif +#if defined(HYPRE_USING_OPENMP) + if (hypre_GetExecPolicy1(memory_location) == HYPRE_EXEC_HOST) + { + mode = mode & ~2; /* skip AddTranspose with OMP */ + } +#endif + /*----------------------------------------------------------- * Build matrix entries *-----------------------------------------------------------*/ - buildMatrixEntries(comm, nx, ny, nz, Px, Py, Pz, cx, cy, cz, + buildMatrixEntries(comm, nx, ny, nz, Px, Py, Pz, cx, cy, cz, base, &ilower, &iupper, &jlower, &jupper, &nrows, &num_nonzeros, - &h_nnzrow, &h_rows, &h_rows2, &h_cols, &h_coefs, stencil, &parcsr_ref); + &h_nnzrow, &h_rows, &h_rows_coo, &h_cols, &h_coefs, stencil, &parcsr_ref); switch (memory_location) { case HYPRE_MEMORY_DEVICE: d_nnzrow = hypre_TAlloc(HYPRE_Int, nrows, HYPRE_MEMORY_DEVICE); d_rows = hypre_TAlloc(HYPRE_BigInt, nrows, HYPRE_MEMORY_DEVICE); - d_rows2 = hypre_TAlloc(HYPRE_BigInt, num_nonzeros, HYPRE_MEMORY_DEVICE); + d_rows_coo = hypre_TAlloc(HYPRE_BigInt, num_nonzeros, HYPRE_MEMORY_DEVICE); d_cols = hypre_TAlloc(HYPRE_BigInt, num_nonzeros, HYPRE_MEMORY_DEVICE); d_coefs = hypre_TAlloc(HYPRE_Real, num_nonzeros, HYPRE_MEMORY_DEVICE); - hypre_TMemcpy(d_nnzrow, h_nnzrow, HYPRE_Int, nrows, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - hypre_TMemcpy(d_rows, h_rows, HYPRE_BigInt, nrows, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - hypre_TMemcpy(d_rows2, h_rows2, HYPRE_BigInt, num_nonzeros, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - hypre_TMemcpy(d_cols, h_cols, HYPRE_BigInt, num_nonzeros, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - hypre_TMemcpy(d_coefs, h_coefs, HYPRE_Real, num_nonzeros, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); + hypre_TMemcpy(d_nnzrow, h_nnzrow, HYPRE_Int, nrows, HYPRE_MEMORY_DEVICE, + HYPRE_MEMORY_HOST); + hypre_TMemcpy(d_rows, h_rows, HYPRE_BigInt, nrows, HYPRE_MEMORY_DEVICE, + HYPRE_MEMORY_HOST); + hypre_TMemcpy(d_rows_coo, h_rows_coo, HYPRE_BigInt, num_nonzeros, HYPRE_MEMORY_DEVICE, + HYPRE_MEMORY_HOST); + hypre_TMemcpy(d_cols, h_cols, HYPRE_BigInt, num_nonzeros, HYPRE_MEMORY_DEVICE, + HYPRE_MEMORY_HOST); + hypre_TMemcpy(d_coefs, h_coefs, HYPRE_Real, num_nonzeros, HYPRE_MEMORY_DEVICE, + HYPRE_MEMORY_HOST); nnzrow = d_nnzrow; rows = d_rows; - rows2 = d_rows2; + rows_coo = d_rows_coo; cols = d_cols; coefs = d_coefs; break; @@ -324,7 +340,7 @@ main( hypre_int argc, case HYPRE_MEMORY_HOST: nnzrow = h_nnzrow; rows = h_rows; - rows2 = h_rows2; + rows_coo = h_rows_coo; cols = h_cols; coefs = h_coefs; break; @@ -339,10 +355,12 @@ main( hypre_int argc, /* Test Set */ if (mode & 1) { - test_Set(comm, memory_location, option, ilower, iupper, nrows, num_nonzeros, - nchunks, h_nnzrow, nnzrow, option == 1 ? rows : rows2, cols, coefs, &ij_A); + test_all(comm, "set", memory_location, option, "sA", ilower, iupper, jlower, jupper, nrows, + num_nonzeros, + nchunks, init_alloc, early_assemble, grow_factor, h_nnzrow, nnzrow, option == 1 ? rows : rows_coo, + cols, coefs, &ij_A); - checkMatrix(parcsr_ref, ij_A); + ierr += checkMatrix(parcsr_ref, ij_A) > tol; if (print_matrix) { HYPRE_IJMatrixPrint(ij_A, "ij_Set"); @@ -350,25 +368,37 @@ main( hypre_int argc, HYPRE_IJMatrixDestroy(ij_A); } - /* Test SetOffProc */ + /* Test AddTranspose + * set values with (row, col) reversed, i.e., the transpose of A + * in this way, we can test off-proc add to values + */ if (mode & 2) { - test_SetOffProc(parcsr_ref, memory_location, nchunks, option, &ij_AT); - checkMatrix(parcsr_ref, ij_AT); + test_all(comm, "addtrans", memory_location, 2, "aaaaaA", ilower, iupper, jlower, jupper, nrows, + num_nonzeros, + nchunks, init_alloc, early_assemble, grow_factor, h_nnzrow, nnzrow, cols, rows_coo, coefs, &ij_AT); + + hypre_ParCSRMatrixTranspose(parcsr_ref, &parcsr_trans, 1); + hypre_ParCSRMatrixScale(parcsr_trans, 5.0); + + ierr += checkMatrix(parcsr_trans, ij_AT) > tol; if (print_matrix) { - HYPRE_IJMatrixPrint(ij_A, "ij_SetOffProc"); + HYPRE_IJMatrixPrint(ij_AT, "ij_AddTrans"); } HYPRE_IJMatrixDestroy(ij_AT); + HYPRE_ParCSRMatrixDestroy(parcsr_trans); } /* Test Set/Set */ if (mode & 4) { - test_SetSet(comm, memory_location, option, ilower, iupper, nrows, num_nonzeros, - nchunks, h_nnzrow, nnzrow, option == 1 ? rows : rows2, cols, coefs, &ij_A); + test_all(comm, "set/set", memory_location, option, "ssA", ilower, iupper, jlower, jupper, nrows, + num_nonzeros, + nchunks, init_alloc, early_assemble, grow_factor, h_nnzrow, nnzrow, option == 1 ? rows : rows_coo, + cols, coefs, &ij_A); - checkMatrix(parcsr_ref, ij_A); + ierr += checkMatrix(parcsr_ref, ij_A) > tol; if (print_matrix) { HYPRE_IJMatrixPrint(ij_A, "ij_SetSet"); @@ -379,10 +409,12 @@ main( hypre_int argc, /* Test Add/Set */ if (mode & 8) { - test_AddSet(comm, memory_location, option, ilower, iupper, nrows, num_nonzeros, - nchunks, h_nnzrow, nnzrow, option == 1 ? rows : rows2, cols, coefs, &ij_A); + test_all(comm, "add/set", memory_location, option, "asA", ilower, iupper, jlower, jupper, nrows, + num_nonzeros, + nchunks, init_alloc, early_assemble, grow_factor, h_nnzrow, nnzrow, option == 1 ? rows : rows_coo, + cols, coefs, &ij_A); - checkMatrix(parcsr_ref, ij_A); + ierr += checkMatrix(parcsr_ref, ij_A) > tol; if (print_matrix) { HYPRE_IJMatrixPrint(ij_A, "ij_AddSet"); @@ -390,20 +422,65 @@ main( hypre_int argc, HYPRE_IJMatrixDestroy(ij_A); } - /* Test Set/Add/Set */ + /* Test Set/Add */ if (mode & 16) { - test_SetAddSet(comm, memory_location, option, ilower, iupper, nrows, num_nonzeros, - nchunks, h_nnzrow, nnzrow, option == 1 ? rows : rows2, cols, coefs, &ij_A); + test_all(comm, "set/add", memory_location, option, "saA", ilower, iupper, jlower, jupper, nrows, + num_nonzeros, + nchunks, init_alloc, early_assemble, grow_factor, h_nnzrow, nnzrow, option == 1 ? rows : rows_coo, + cols, coefs, &ij_A); + + hypre_ParCSRMatrix *parcsr_ref2 = hypre_ParCSRMatrixClone(parcsr_ref, 1); + hypre_ParCSRMatrixScale(parcsr_ref2, 2.0); + + ierr += checkMatrix(parcsr_ref2, ij_A) > tol; + if (print_matrix) + { + HYPRE_IJMatrixPrint(ij_A, "ij_SetAdd"); + } + HYPRE_IJMatrixDestroy(ij_A); + HYPRE_ParCSRMatrixDestroy(parcsr_ref2); + } + + /* Test Set/Add/Assemble/Set */ + if (mode & 32) + { + test_all(comm, "set/add/assemble/set", memory_location, option, "saAsA", ilower, iupper, jlower, + jupper, nrows, num_nonzeros, + nchunks, init_alloc, early_assemble, grow_factor, h_nnzrow, nnzrow, option == 1 ? rows : rows_coo, + cols, coefs, &ij_A); - checkMatrix(parcsr_ref, ij_A); + ierr += checkMatrix(parcsr_ref, ij_A) > tol; if (print_matrix) { - HYPRE_IJMatrixPrint(ij_A, "ij_SetAddSet"); + HYPRE_IJMatrixPrint(ij_A, "ij_SetAddAssembleSet"); } HYPRE_IJMatrixDestroy(ij_A); } + /* Test Adds */ + if (mode & 64) + { + test_all(comm, "5adds/set", memory_location, option, "aaaaasA", ilower, iupper, jlower, jupper, + nrows, num_nonzeros, + nchunks, init_alloc, early_assemble, grow_factor, h_nnzrow, nnzrow, option == 1 ? rows : rows_coo, + cols, coefs, &ij_A); + + hypre_ParCSRMatrix *parcsr_ref2 = hypre_ParCSRMatrixClone(parcsr_ref, 1); + hypre_ParCSRMatrixScale(parcsr_ref2, 1.); + + ierr += checkMatrix(parcsr_ref2, ij_A) > tol; + if (print_matrix) + { + HYPRE_IJMatrixPrint(ij_A, "ij_5AddsSet"); + } + HYPRE_IJMatrixDestroy(ij_A); + HYPRE_ParCSRMatrixDestroy(parcsr_ref2); + } + + /* Print the error code */ + hypre_ParPrintf(comm, "Test error code = %d\n", ierr); + /*----------------------------------------------------------- * Free memory *-----------------------------------------------------------*/ @@ -411,13 +488,13 @@ main( hypre_int argc, { hypre_TFree(d_nnzrow, HYPRE_MEMORY_DEVICE); hypre_TFree(d_rows, HYPRE_MEMORY_DEVICE); - hypre_TFree(d_rows2, HYPRE_MEMORY_DEVICE); + hypre_TFree(d_rows_coo, HYPRE_MEMORY_DEVICE); hypre_TFree(d_cols, HYPRE_MEMORY_DEVICE); hypre_TFree(d_coefs, HYPRE_MEMORY_DEVICE); } hypre_TFree(h_nnzrow, HYPRE_MEMORY_HOST); hypre_TFree(h_rows, HYPRE_MEMORY_HOST); - hypre_TFree(h_rows2, HYPRE_MEMORY_HOST); + hypre_TFree(h_rows_coo, HYPRE_MEMORY_HOST); hypre_TFree(h_cols, HYPRE_MEMORY_HOST); hypre_TFree(h_coefs, HYPRE_MEMORY_HOST); @@ -431,7 +508,7 @@ main( hypre_int argc, /* when using cuda-memcheck --leak-check full, uncomment this */ #if defined(HYPRE_USING_GPU) - hypre_ResetCudaDevice(hypre_handle()); + hypre_ResetDevice(); #endif return (0); @@ -445,9 +522,10 @@ buildMatrixEntries(MPI_Comm comm, HYPRE_Int Px, HYPRE_Int Py, HYPRE_Int Pz, - HYPRE_Int cx, - HYPRE_Int cy, - HYPRE_Int cz, + HYPRE_Real cx, + HYPRE_Real cy, + HYPRE_Real cz, + HYPRE_Int base, HYPRE_BigInt *ilower_ptr, HYPRE_BigInt *iupper_ptr, HYPRE_BigInt *jlower_ptr, @@ -456,23 +534,23 @@ buildMatrixEntries(MPI_Comm comm, HYPRE_BigInt *num_nonzeros_ptr, HYPRE_Int **nnzrow_ptr, HYPRE_BigInt **rows_ptr, /* row indices of length nrows */ - HYPRE_BigInt **rows2_ptr, /* row indices of length nnz */ + HYPRE_BigInt **rows_coo_ptr, /* row indices of length nnz */ HYPRE_BigInt **cols_ptr, /* col indices of length nnz */ HYPRE_Real **coefs_ptr, /* values of length nnz */ HYPRE_Int stencil, HYPRE_ParCSRMatrix *parcsr_ptr) { - HYPRE_Int num_procs; - HYPRE_Int myid; - HYPRE_Real values[4]; - HYPRE_ParCSRMatrix A; + HYPRE_Int num_procs; + HYPRE_Int myid; + HYPRE_Real values[4]; + HYPRE_ParCSRMatrix A = NULL; hypre_MPI_Comm_size(comm, &num_procs ); hypre_MPI_Comm_rank(comm, &myid ); HYPRE_Int ip = myid % Px; - HYPRE_Int iq = (( myid - ip)/Px) % Py; - HYPRE_Int ir = ( myid - ip - Px*iq)/( Px*Py ); + HYPRE_Int iq = (( myid - ip) / Px) % Py; + HYPRE_Int ir = ( myid - ip - Px * iq) / ( Px * Py ); values[0] = 0; values[1] = -cx; @@ -497,13 +575,52 @@ buildMatrixEntries(MPI_Comm comm, } hypre_ParCSRMatrixMigrate(A, HYPRE_MEMORY_HOST); - getParCSRMatrixData(A, nrows_ptr, num_nonzeros_ptr, nnzrow_ptr, rows_ptr, rows2_ptr, cols_ptr, coefs_ptr); + + /* modify the upper triangular part to A nonsymmetric */ + HYPRE_Int i, j; + HYPRE_Int nrows = hypre_ParCSRMatrixNumRows(A); + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); + HYPRE_Int *A_diag_i = hypre_CSRMatrixI(A_diag); + HYPRE_Int *A_diag_j = hypre_CSRMatrixJ(A_diag); + HYPRE_Int *A_offd_i = hypre_CSRMatrixI(A_offd); + HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); + HYPRE_BigInt *col_map_offd_A = hypre_ParCSRMatrixColMapOffd(A); + HYPRE_BigInt ilower = hypre_ParCSRMatrixFirstRowIndex(A); + HYPRE_BigInt jlower = hypre_ParCSRMatrixFirstColDiag(A); + + for (i = 0; i < nrows; i++) + { + for (j = A_diag_i[i]; j < A_diag_i[i + 1]; j++) + { + HYPRE_BigInt row = ilower + (HYPRE_BigInt) i; + HYPRE_BigInt col = jlower + (HYPRE_BigInt) A_diag_j[j]; + if (row < col) + { + hypre_CSRMatrixData(A_diag)[j] += myid + .89; + } + } + for (j = A_offd_i[i]; j < A_offd_i[i + 1]; j++) + { + HYPRE_BigInt row = ilower + (HYPRE_BigInt) i; + HYPRE_BigInt col = col_map_offd_A[A_offd_j[j]]; + if (row < col) + { + hypre_CSRMatrixData(A_offd)[j] += myid + .64; + } + } + } + + /* get I, J, data from A */ + getParCSRMatrixData(A, base, nrows_ptr, num_nonzeros_ptr, nnzrow_ptr, rows_ptr, rows_coo_ptr, + cols_ptr, + coefs_ptr); // Set pointers - *ilower_ptr = hypre_ParCSRMatrixFirstRowIndex(A); - *iupper_ptr = hypre_ParCSRMatrixLastRowIndex(A); - *jlower_ptr = hypre_ParCSRMatrixFirstColDiag(A); - *jupper_ptr = hypre_ParCSRMatrixLastColDiag(A); + *ilower_ptr = hypre_ParCSRMatrixFirstRowIndex(A) + base; + *iupper_ptr = hypre_ParCSRMatrixLastRowIndex(A) + base; + *jlower_ptr = hypre_ParCSRMatrixFirstColDiag(A) + base; + *jupper_ptr = hypre_ParCSRMatrixLastColDiag(A) + base; *parcsr_ptr = A; return hypre_error_flag; @@ -511,11 +628,12 @@ buildMatrixEntries(MPI_Comm comm, HYPRE_Int getParCSRMatrixData(HYPRE_ParCSRMatrix A, + HYPRE_Int base, HYPRE_Int *nrows_ptr, HYPRE_BigInt *num_nonzeros_ptr, HYPRE_Int **nnzrow_ptr, HYPRE_BigInt **rows_ptr, - HYPRE_BigInt **rows2_ptr, + HYPRE_BigInt **rows_coo_ptr, HYPRE_BigInt **cols_ptr, HYPRE_Real **coefs_ptr) { @@ -527,14 +645,14 @@ getParCSRMatrixData(HYPRE_ParCSRMatrix A, HYPRE_Int *A_offd_j = hypre_CSRMatrixJ(A_offd); HYPRE_BigInt *col_map_offd_A = hypre_ParCSRMatrixColMapOffd(A); - HYPRE_Int ilower = hypre_ParCSRMatrixFirstRowIndex(A); - HYPRE_Int jlower = hypre_ParCSRMatrixFirstColDiag(A); + HYPRE_BigInt ilower = hypre_ParCSRMatrixFirstRowIndex(A); + HYPRE_BigInt jlower = hypre_ParCSRMatrixFirstColDiag(A); HYPRE_Int nrows; HYPRE_BigInt num_nonzeros; HYPRE_Int *nnzrow; HYPRE_BigInt *rows; - HYPRE_BigInt *rows2; + HYPRE_BigInt *rows_coo; HYPRE_BigInt *cols; HYPRE_Real *coefs; HYPRE_Int i, j, k; @@ -543,7 +661,7 @@ getParCSRMatrixData(HYPRE_ParCSRMatrix A, num_nonzeros = hypre_CSRMatrixNumNonzeros(A_diag) + hypre_CSRMatrixNumNonzeros(A_offd); nnzrow = hypre_CTAlloc(HYPRE_Int, nrows, HYPRE_MEMORY_HOST); rows = hypre_CTAlloc(HYPRE_BigInt, nrows, HYPRE_MEMORY_HOST); - rows2 = hypre_CTAlloc(HYPRE_BigInt, num_nonzeros, HYPRE_MEMORY_HOST); + rows_coo = hypre_CTAlloc(HYPRE_BigInt, num_nonzeros, HYPRE_MEMORY_HOST); cols = hypre_CTAlloc(HYPRE_BigInt, num_nonzeros, HYPRE_MEMORY_HOST); coefs = hypre_CTAlloc(HYPRE_Real, num_nonzeros, HYPRE_MEMORY_HOST); @@ -551,40 +669,40 @@ getParCSRMatrixData(HYPRE_ParCSRMatrix A, #if 0 for (i = 0; i < nrows; i++) { - nnzrow[i] = A_diag_i[i+1] - A_diag_i[i] + - A_offd_i[i+1] - A_offd_i[i]; + nnzrow[i] = A_diag_i[i + 1] - A_diag_i[i] + + A_offd_i[i + 1] - A_offd_i[i]; rows[i] = ilower + i; - for (j = A_diag_i[i]; j < A_diag_i[i+1]; j++) + for (j = A_diag_i[i]; j < A_diag_i[i + 1]; j++) { - rows2[k] = ilower + (HYPRE_BigInt) i; + rows_coo[k] = ilower + (HYPRE_BigInt) i; cols[k] = jlower + (HYPRE_BigInt) A_diag_j[j]; coefs[k++] = hypre_CSRMatrixData(A_diag)[j]; } - for (j = A_offd_i[i]; j < A_offd_i[i+1]; j++) + for (j = A_offd_i[i]; j < A_offd_i[i + 1]; j++) { - rows2[k] = ilower + (HYPRE_BigInt) i; + rows_coo[k] = ilower + (HYPRE_BigInt) i; cols[k] = hypre_ParCSRMatrixColMapOffd(A)[A_offd_j[j]]; coefs[k++] = hypre_CSRMatrixData(A_offd)[j]; } } #else - for (i = nrows-1; i >= 0; i--) + for (i = nrows - 1; i >= 0; i--) { - nnzrow[nrows-1-i] = A_diag_i[i+1] - A_diag_i[i] + - A_offd_i[i+1] - A_offd_i[i]; - rows[nrows-1-i] = ilower + i; + nnzrow[nrows - 1 - i] = A_diag_i[i + 1] - A_diag_i[i] + + A_offd_i[i + 1] - A_offd_i[i]; + rows[nrows - 1 - i] = ilower + i + base; - for (j = A_diag_i[i]; j < A_diag_i[i+1]; j++) + for (j = A_diag_i[i]; j < A_diag_i[i + 1]; j++) { - rows2[k] = ilower + (HYPRE_BigInt) i; - cols[k] = jlower + (HYPRE_BigInt) A_diag_j[j]; + rows_coo[k] = ilower + (HYPRE_BigInt) i + base; + cols[k] = jlower + (HYPRE_BigInt) A_diag_j[j] + base; coefs[k++] = hypre_CSRMatrixData(A_diag)[j]; } - for (j = A_offd_i[i]; j < A_offd_i[i+1]; j++) + for (j = A_offd_i[i]; j < A_offd_i[i + 1]; j++) { - rows2[k] = ilower + (HYPRE_BigInt) i; - cols[k] = col_map_offd_A[A_offd_j[j]]; + rows_coo[k] = ilower + (HYPRE_BigInt) i + base; + cols[k] = col_map_offd_A[A_offd_j[j]] + base; coefs[k++] = hypre_CSRMatrixData(A_offd)[j]; } } @@ -597,7 +715,7 @@ getParCSRMatrixData(HYPRE_ParCSRMatrix A, *num_nonzeros_ptr = num_nonzeros; *nnzrow_ptr = nnzrow; *rows_ptr = rows; - *rows2_ptr = rows2; + *rows_coo_ptr = rows_coo; *cols_ptr = cols; *coefs_ptr = coefs; @@ -605,506 +723,148 @@ getParCSRMatrixData(HYPRE_ParCSRMatrix A, } -HYPRE_Int +HYPRE_Real checkMatrix(HYPRE_ParCSRMatrix h_parcsr_ref, HYPRE_IJMatrix ij_A) { MPI_Comm comm = hypre_IJMatrixComm(ij_A); HYPRE_ParCSRMatrix parcsr_A = (HYPRE_ParCSRMatrix) hypre_IJMatrixObject(ij_A); HYPRE_ParCSRMatrix h_parcsr_A; HYPRE_ParCSRMatrix parcsr_error; - HYPRE_Int myid; - HYPRE_Real fnorm; - - hypre_MPI_Comm_rank(comm, &myid); + HYPRE_Real fnorm_err, fnorm_ref, rel_err; h_parcsr_A = hypre_ParCSRMatrixClone_v2(parcsr_A, 1, HYPRE_MEMORY_HOST); // Check norm of (parcsr_ref - parcsr_A) hypre_ParCSRMatrixAdd(1.0, h_parcsr_ref, -1.0, h_parcsr_A, &parcsr_error); - fnorm = hypre_ParCSRMatrixFnorm(parcsr_error); + fnorm_err = hypre_ParCSRMatrixFnorm(parcsr_error); + fnorm_ref = hypre_ParCSRMatrixFnorm(h_parcsr_ref); + rel_err = fnorm_err / fnorm_ref; - if (myid == 0) - { - hypre_printf("Frobenius norm of (A_ref - A): %e\n", fnorm); - } + hypre_ParPrintf(comm, "||A_ref - A||_F / ||A_ref||_F: %e\n", rel_err); HYPRE_ParCSRMatrixDestroy(h_parcsr_A); HYPRE_ParCSRMatrixDestroy(parcsr_error); - return hypre_error_flag; + return rel_err; } +/* ---------------------------------- * + * All test functions for assembly * + * option = 1: length of nrows, * + * = 2: length of num_nonzeros * + * ---------------------------------- */ + +/* set values */ HYPRE_Int -test_Set(MPI_Comm comm, +test_all(MPI_Comm comm, + const char *test_name, HYPRE_MemoryLocation memory_location, - HYPRE_Int option, /* 1 or 2 */ + HYPRE_Int option, + const char *cmd_sequence, HYPRE_BigInt ilower, HYPRE_BigInt iupper, + HYPRE_BigInt jlower, + HYPRE_BigInt jupper, HYPRE_Int nrows, HYPRE_BigInt num_nonzeros, HYPRE_Int nchunks, + HYPRE_Int init_alloc, + HYPRE_Int early_assemble, + HYPRE_Real grow_factor, HYPRE_Int *h_nnzrow, HYPRE_Int *nnzrow, - HYPRE_BigInt *rows, /* option = 1: length of nrows, = 2: length of num_nonzeros */ + HYPRE_BigInt *rows, HYPRE_BigInt *cols, HYPRE_Real *coefs, HYPRE_IJMatrix *ij_A_ptr) { HYPRE_IJMatrix ij_A; - HYPRE_Int i, chunk, chunk_size; + HYPRE_Int i, j, chunk, chunk_size; HYPRE_Int time_index; - HYPRE_Int *h_rowptr; - - HYPRE_IJMatrixCreate(comm, ilower, iupper, ilower, iupper, &ij_A); - HYPRE_IJMatrixSetObjectType(ij_A, HYPRE_PARCSR); - HYPRE_IJMatrixInitialize_v2(ij_A, memory_location); - HYPRE_IJMatrixSetOMPFlag(ij_A, 1); - - h_rowptr = hypre_CTAlloc(HYPRE_Int, nrows+1, HYPRE_MEMORY_HOST); - for (i = 1; i < nrows + 1; i++) - { - h_rowptr[i] = h_rowptr[i-1] + h_nnzrow[i-1]; - } - hypre_assert(h_rowptr[nrows] == num_nonzeros); - - chunk_size = nrows / nchunks; + HYPRE_Int *h_rowptr = hypre_CTAlloc(HYPRE_Int, nrows + 1, HYPRE_MEMORY_HOST); + HYPRE_Int cmd_len = strlen(cmd_sequence); + HYPRE_Int myid; -#if defined(HYPRE_USING_GPU) - hypre_SyncCudaDevice(hypre_handle()); -#if defined(CUDA_PROFILER) - cudaProfilerStart(); -#endif -#endif - - time_index = hypre_InitializeTiming("Test SetValues"); - hypre_BeginTiming(time_index); - for (chunk = 0; chunk < nrows; chunk += chunk_size) - { - chunk_size = hypre_min(chunk_size, nrows-chunk); - - if (1 == option) - { - HYPRE_IJMatrixSetValues(ij_A, chunk_size, &nnzrow[chunk], &rows[chunk], - &cols[h_rowptr[chunk]], &coefs[h_rowptr[chunk]]); - } - else - { - HYPRE_IJMatrixSetValues(ij_A, h_rowptr[chunk+chunk_size]-h_rowptr[chunk], - NULL, &rows[h_rowptr[chunk]], - &cols[h_rowptr[chunk]], &coefs[h_rowptr[chunk]]); - } - } - - // Assemble matrix - HYPRE_IJMatrixAssemble(ij_A); - -#if defined(HYPRE_USING_GPU) - hypre_SyncCudaDevice(hypre_handle()); -#if defined(CUDA_PROFILER) - cudaProfilerStop(); -#endif -#endif - - // Finalize timer - hypre_EndTiming(time_index); - hypre_PrintTiming("Test SetValues", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); - - // Free memory - hypre_TFree(h_rowptr, HYPRE_MEMORY_HOST); - - // Set pointer to matrix - *ij_A_ptr = ij_A; - - return hypre_error_flag; -} - -HYPRE_Int -test_SetOffProc(HYPRE_ParCSRMatrix parcsr_A, - HYPRE_MemoryLocation memory_location, - HYPRE_Int nchunks, - HYPRE_Int option, /* 1 or 2 */ - HYPRE_IJMatrix *ij_AT_ptr) -{ - MPI_Comm comm = hypre_ParCSRMatrixComm(parcsr_A); - HYPRE_ParCSRMatrix parcsr_AT; - HYPRE_IJMatrix ij_AT; - - HYPRE_Int nrows; - HYPRE_BigInt num_nonzeros; - HYPRE_BigInt ilower, iupper; - - HYPRE_Int *h_nnzrow; - HYPRE_BigInt *h_rows1; - HYPRE_BigInt *h_rows2; - HYPRE_BigInt *h_cols; - HYPRE_Real *h_coefs; - - HYPRE_Int *d_nnzrow; - HYPRE_BigInt *d_rows; - HYPRE_BigInt *d_cols; - HYPRE_Real *d_coefs; - - HYPRE_Int *nnzrow; - HYPRE_BigInt *rows; - HYPRE_BigInt *cols; - HYPRE_Real *coefs; - - HYPRE_Int *h_rowptr; - - HYPRE_Int time_index; - HYPRE_Int chunk_size; - HYPRE_Int chunk; - HYPRE_Int i; - - hypre_ParCSRMatrixTranspose(parcsr_A, &parcsr_AT, 1); - ilower = hypre_ParCSRMatrixFirstRowIndex(parcsr_AT); - iupper = hypre_ParCSRMatrixLastRowIndex(parcsr_AT); - getParCSRMatrixData(parcsr_AT, &nrows, &num_nonzeros, &h_nnzrow, &h_rows1, &h_rows2, &h_cols, &h_coefs); - HYPRE_ParCSRMatrixDestroy(parcsr_AT); - - switch (memory_location) - { - case HYPRE_MEMORY_DEVICE: - d_nnzrow = hypre_TAlloc(HYPRE_Int, nrows, HYPRE_MEMORY_DEVICE); - d_cols = hypre_TAlloc(HYPRE_BigInt, num_nonzeros, HYPRE_MEMORY_DEVICE); - d_coefs = hypre_TAlloc(HYPRE_Real, num_nonzeros, HYPRE_MEMORY_DEVICE); - if (option == 1) - { - d_rows = hypre_TAlloc(HYPRE_BigInt, nrows, HYPRE_MEMORY_DEVICE); - hypre_TMemcpy(d_rows, h_rows1, HYPRE_BigInt, nrows, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - } - else - { - d_rows = hypre_TAlloc(HYPRE_BigInt, num_nonzeros, HYPRE_MEMORY_DEVICE); - hypre_TMemcpy(d_rows, h_rows2, HYPRE_BigInt, num_nonzeros, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - } - hypre_TMemcpy(d_nnzrow, h_nnzrow, HYPRE_Int, nrows, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - hypre_TMemcpy(d_cols, h_cols, HYPRE_BigInt, num_nonzeros, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - hypre_TMemcpy(d_coefs, h_coefs, HYPRE_Real, num_nonzeros, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - - nnzrow = d_nnzrow; - rows = d_rows; - cols = d_cols; - coefs = d_coefs; - break; - - case HYPRE_MEMORY_HOST: - nnzrow = h_nnzrow; - rows = (option == 1) ? h_rows1 : h_rows2; - cols = h_cols; - coefs = h_coefs; - break; - - case HYPRE_MEMORY_UNDEFINED: - return -1; - } - - // Create transpose with SetValues - HYPRE_IJMatrixCreate(comm, ilower, iupper, ilower, iupper, &ij_AT); - HYPRE_IJMatrixSetObjectType(ij_AT, HYPRE_PARCSR); - HYPRE_IJMatrixInitialize_v2(ij_AT, memory_location); - HYPRE_IJMatrixSetOMPFlag(ij_AT, 1); + hypre_MPI_Comm_rank(comm, &myid); - h_rowptr = hypre_CTAlloc(HYPRE_Int, nrows+1, HYPRE_MEMORY_HOST); for (i = 1; i < nrows + 1; i++) { - h_rowptr[i] = h_rowptr[i-1] + h_nnzrow[i-1]; + h_rowptr[i] = h_rowptr[i - 1] + h_nnzrow[i - 1]; } hypre_assert(h_rowptr[nrows] == num_nonzeros); - chunk_size = nrows / nchunks; - -#if defined(HYPRE_USING_GPU) - hypre_SyncCudaDevice(hypre_handle()); -#endif - - time_index = hypre_InitializeTiming("Test SetValues OffProc"); - hypre_BeginTiming(time_index); - - //cudaProfilerStart(); - - for (chunk = 0; chunk < nrows; chunk += chunk_size) - { - chunk_size = hypre_min(chunk_size, nrows-chunk); - - if (1 == option) - { - HYPRE_IJMatrixSetValues(ij_AT, chunk_size, &nnzrow[chunk], &rows[chunk], - &cols[h_rowptr[chunk]], &coefs[h_rowptr[chunk]]); - } - else - { - HYPRE_IJMatrixSetValues(ij_AT, h_rowptr[chunk+chunk_size]-h_rowptr[chunk], - NULL, &rows[h_rowptr[chunk]], - &cols[h_rowptr[chunk]], &coefs[h_rowptr[chunk]]); - } - } - - // Assemble matrix - HYPRE_IJMatrixAssemble(ij_AT); - - //cudaProfilerStop(); - -#if defined(HYPRE_USING_GPU) - hypre_SyncCudaDevice(hypre_handle()); -#endif - - hypre_EndTiming(time_index); - hypre_PrintTiming("Test SetValues OffProc", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); - - // Set pointer to output - *ij_AT_ptr = ij_AT; - - // Free memory - hypre_TFree(h_rowptr, HYPRE_MEMORY_HOST); - if (memory_location == HYPRE_MEMORY_DEVICE) - { - hypre_TFree(d_nnzrow, HYPRE_MEMORY_DEVICE); - hypre_TFree(d_rows, HYPRE_MEMORY_DEVICE); - hypre_TFree(d_cols, HYPRE_MEMORY_DEVICE); - hypre_TFree(d_coefs, HYPRE_MEMORY_DEVICE); - } - hypre_TFree(h_nnzrow, HYPRE_MEMORY_HOST); - hypre_TFree(h_rows1, HYPRE_MEMORY_HOST); - hypre_TFree(h_rows2, HYPRE_MEMORY_HOST); - hypre_TFree(h_cols, HYPRE_MEMORY_HOST); - hypre_TFree(h_coefs, HYPRE_MEMORY_HOST); - - return hypre_error_flag; -} - -HYPRE_Int -test_SetSet(MPI_Comm comm, - HYPRE_MemoryLocation memory_location, - HYPRE_Int option, /* 1 or 2 */ - HYPRE_BigInt ilower, - HYPRE_BigInt iupper, - HYPRE_Int nrows, - HYPRE_BigInt num_nonzeros, - HYPRE_Int nchunks, - HYPRE_Int *h_nnzrow, - HYPRE_Int *nnzrow, - HYPRE_BigInt *rows, /* option = 1: length of nrows, = 2: length of num_nonzeros */ - HYPRE_BigInt *cols, - HYPRE_Real *coefs, - HYPRE_IJMatrix *ij_A_ptr) -{ - HYPRE_IJMatrix ij_A; - HYPRE_Int i, chunk, chunk_size; - HYPRE_Int time_index; - HYPRE_Int *h_rowptr; - HYPRE_Real *new_coefs; - - HYPRE_IJMatrixCreate(comm, ilower, iupper, ilower, iupper, &ij_A); + HYPRE_IJMatrixCreate(comm, ilower, iupper, jlower, jupper, &ij_A); HYPRE_IJMatrixSetObjectType(ij_A, HYPRE_PARCSR); HYPRE_IJMatrixInitialize_v2(ij_A, memory_location); HYPRE_IJMatrixSetOMPFlag(ij_A, 1); - - h_rowptr = hypre_CTAlloc(HYPRE_Int, nrows+1, HYPRE_MEMORY_HOST); - for (i = 1; i < nrows + 1; i++) + grow_factor = myid ? grow_factor : 2 * grow_factor; + if (init_alloc >= 0) { - h_rowptr[i] = h_rowptr[i-1] + h_nnzrow[i-1]; + HYPRE_IJMatrixSetInitAllocation(ij_A, init_alloc); } - hypre_assert(h_rowptr[nrows] == num_nonzeros); - - chunk_size = nrows / nchunks; - new_coefs = hypre_TAlloc(HYPRE_Real, num_nonzeros, memory_location); - - if (hypre_GetActualMemLocation(memory_location) == hypre_MEMORY_HOST) - { - for (i = 0; i < num_nonzeros; i++) - { - new_coefs[i] = 2.0*coefs[i]; - } - } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - else + HYPRE_IJMatrixSetEarlyAssemble(ij_A, early_assemble); + if (grow_factor > 0) { - hypre_TMemcpy(new_coefs, coefs, HYPRE_Real, num_nonzeros, memory_location, memory_location); - hypreDevice_Scalen(new_coefs, num_nonzeros, 2.0); + HYPRE_IJMatrixSetGrowFactor(ij_A, grow_factor); } -#endif - -#if defined(HYPRE_USING_GPU) - hypre_SyncCudaDevice(hypre_handle()); -#if defined(CUDA_PROFILER) - cudaProfilerStart(); -#endif -#endif - - // First Set - time_index = hypre_InitializeTiming("Test Set/Set"); - hypre_BeginTiming(time_index); - for (chunk = 0; chunk < nrows; chunk += chunk_size) - { - chunk_size = hypre_min(chunk_size, nrows-chunk); - - if (1 == option) - { - HYPRE_IJMatrixSetValues(ij_A, chunk_size, &nnzrow[chunk], &rows[chunk], - &cols[h_rowptr[chunk]], &new_coefs[h_rowptr[chunk]]); - } - else - { - HYPRE_IJMatrixSetValues(ij_A, h_rowptr[chunk+chunk_size]-h_rowptr[chunk], - NULL, &rows[h_rowptr[chunk]], - &cols[h_rowptr[chunk]], &new_coefs[h_rowptr[chunk]]); - } - } - - // Assemble matrix - HYPRE_IJMatrixAssemble(ij_A); - - // Second set - for (chunk = 0; chunk < nrows; chunk += chunk_size) - { - chunk_size = hypre_min(chunk_size, nrows-chunk); - - if (1 == option) - { - HYPRE_IJMatrixSetValues(ij_A, chunk_size, &nnzrow[chunk], &rows[chunk], - &cols[h_rowptr[chunk]], &coefs[h_rowptr[chunk]]); - } - else - { - HYPRE_IJMatrixSetValues(ij_A, h_rowptr[chunk+chunk_size]-h_rowptr[chunk], - NULL, &rows[h_rowptr[chunk]], - &cols[h_rowptr[chunk]], &coefs[h_rowptr[chunk]]); - } - } - - // Assemble matrix - HYPRE_IJMatrixAssemble(ij_A); - -#if defined(HYPRE_USING_GPU) - hypre_SyncCudaDevice(hypre_handle()); -#if defined(CUDA_PROFILER) - cudaProfilerStop(); -#endif -#endif - - // Finalize timer - hypre_EndTiming(time_index); - hypre_PrintTiming("Test Set/Set", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); - - // Free memory - hypre_TFree(h_rowptr, HYPRE_MEMORY_HOST); - hypre_TFree(new_coefs, memory_location); - - // Set pointer to matrix - *ij_A_ptr = ij_A; - - return hypre_error_flag; -} - -HYPRE_Int -test_AddSet(MPI_Comm comm, - HYPRE_MemoryLocation memory_location, - HYPRE_Int option, /* 1 or 2 */ - HYPRE_BigInt ilower, - HYPRE_BigInt iupper, - HYPRE_Int nrows, - HYPRE_BigInt num_nonzeros, - HYPRE_Int nchunks, - HYPRE_Int *h_nnzrow, - HYPRE_Int *nnzrow, - HYPRE_BigInt *rows, /* option = 1: length of nrows, = 2: length of num_nonzeros */ - HYPRE_BigInt *cols, - HYPRE_Real *coefs, - HYPRE_IJMatrix *ij_A_ptr) -{ - HYPRE_IJMatrix ij_A; - HYPRE_Int i, chunk, chunk_size; - HYPRE_Int time_index; - HYPRE_Int *h_rowptr; - HYPRE_Real *new_coefs; - - HYPRE_IJMatrixCreate(comm, ilower, iupper, ilower, iupper, &ij_A); - HYPRE_IJMatrixSetObjectType(ij_A, HYPRE_PARCSR); - HYPRE_IJMatrixInitialize_v2(ij_A, memory_location); - HYPRE_IJMatrixSetOMPFlag(ij_A, 1); - - h_rowptr = hypre_CTAlloc(HYPRE_Int, nrows+1, HYPRE_MEMORY_HOST); - for (i = 1; i < nrows + 1; i++) - { - h_rowptr[i] = h_rowptr[i-1] + h_nnzrow[i-1]; - } - hypre_assert(h_rowptr[nrows] == num_nonzeros); chunk_size = nrows / nchunks; - new_coefs = hypre_TAlloc(HYPRE_Real, num_nonzeros, memory_location); - - if (hypre_GetActualMemLocation(memory_location) == hypre_MEMORY_HOST) - { - for (i = 0; i < num_nonzeros; i++) - { - new_coefs[i] = 2.0*coefs[i]; - } - } -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - else - { - hypre_TMemcpy(new_coefs, coefs, HYPRE_Real, num_nonzeros, memory_location, memory_location); - hypreDevice_Scalen(new_coefs, num_nonzeros, 2.0); - } -#endif #if defined(HYPRE_USING_GPU) - hypre_SyncCudaDevice(hypre_handle()); + hypre_SyncDevice(); #if defined(CUDA_PROFILER) cudaProfilerStart(); #endif #endif - // First Add - time_index = hypre_InitializeTiming("Test Add/Set"); + time_index = hypre_InitializeTiming(test_name); hypre_BeginTiming(time_index); - for (chunk = 0; chunk < nrows; chunk += chunk_size) - { - chunk_size = hypre_min(chunk_size, nrows-chunk); - if (1 == option) - { - HYPRE_IJMatrixAddToValues(ij_A, chunk_size, &nnzrow[chunk], &rows[chunk], - &cols[h_rowptr[chunk]], &new_coefs[h_rowptr[chunk]]); - } - else - { - HYPRE_IJMatrixAddToValues(ij_A, h_rowptr[chunk+chunk_size]-h_rowptr[chunk], - NULL, &rows[h_rowptr[chunk]], - &cols[h_rowptr[chunk]], &new_coefs[h_rowptr[chunk]]); - } - } - - // Then Set - for (chunk = 0; chunk < nrows; chunk += chunk_size) + for (j = 0; j < cmd_len; j++) { - chunk_size = hypre_min(chunk_size, nrows-chunk); - - if (1 == option) + if (cmd_sequence[j] == 's' || cmd_sequence[j] == 'a') { - HYPRE_IJMatrixSetValues(ij_A, chunk_size, &nnzrow[chunk], &rows[chunk], - &cols[h_rowptr[chunk]], &coefs[h_rowptr[chunk]]); + for (chunk = 0; chunk < nrows; chunk += chunk_size) + { + chunk_size = hypre_min(chunk_size, nrows - chunk); + if (1 == option) + { + if (cmd_sequence[j] == 's') + { + HYPRE_IJMatrixSetValues(ij_A, chunk_size, &nnzrow[chunk], &rows[chunk], + &cols[h_rowptr[chunk]], &coefs[h_rowptr[chunk]]); + } + else + { + HYPRE_IJMatrixAddToValues(ij_A, chunk_size, &nnzrow[chunk], &rows[chunk], + &cols[h_rowptr[chunk]], &coefs[h_rowptr[chunk]]); + } + } + else + { + if (cmd_sequence[j] == 's') + { + HYPRE_IJMatrixSetValues(ij_A, h_rowptr[chunk + chunk_size] - h_rowptr[chunk], + NULL, &rows[h_rowptr[chunk]], + &cols[h_rowptr[chunk]], &coefs[h_rowptr[chunk]]); + } + else + { + HYPRE_IJMatrixAddToValues(ij_A, h_rowptr[chunk + chunk_size] - h_rowptr[chunk], + NULL, &rows[h_rowptr[chunk]], + &cols[h_rowptr[chunk]], &coefs[h_rowptr[chunk]]); + } + } + } } - else + else if (cmd_sequence[j] == 'A') { - HYPRE_IJMatrixSetValues(ij_A, h_rowptr[chunk+chunk_size]-h_rowptr[chunk], - NULL, &rows[h_rowptr[chunk]], - &cols[h_rowptr[chunk]], &coefs[h_rowptr[chunk]]); + HYPRE_IJMatrixAssemble(ij_A); } } - // Assemble matrix - HYPRE_IJMatrixAssemble(ij_A); - #if defined(HYPRE_USING_GPU) - hypre_SyncCudaDevice(hypre_handle()); + hypre_SyncDevice(); #if defined(CUDA_PROFILER) cudaProfilerStop(); #endif @@ -1112,13 +872,12 @@ test_AddSet(MPI_Comm comm, // Finalize timer hypre_EndTiming(time_index); - hypre_PrintTiming("Test Add/Set", hypre_MPI_COMM_WORLD); + hypre_PrintTiming(test_name, hypre_MPI_COMM_WORLD); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); // Free memory hypre_TFree(h_rowptr, HYPRE_MEMORY_HOST); - hypre_TFree(new_coefs, memory_location); // Set pointer to matrix *ij_A_ptr = ij_A; @@ -1126,124 +885,7 @@ test_AddSet(MPI_Comm comm, return hypre_error_flag; } -HYPRE_Int -test_SetAddSet(MPI_Comm comm, - HYPRE_MemoryLocation memory_location, - HYPRE_Int option, /* 1 or 2 */ - HYPRE_BigInt ilower, - HYPRE_BigInt iupper, - HYPRE_Int nrows, - HYPRE_BigInt num_nonzeros, - HYPRE_Int nchunks, - HYPRE_Int *h_nnzrow, - HYPRE_Int *nnzrow, - HYPRE_BigInt *rows, /* option = 1: length of nrows, = 2: length of num_nonzeros */ - HYPRE_BigInt *cols, - HYPRE_Real *coefs, - HYPRE_IJMatrix *ij_A_ptr) -{ - HYPRE_IJMatrix ij_A; - HYPRE_Int i, chunk, chunk_size; - HYPRE_Int time_index; - HYPRE_Int *h_rowptr; - - HYPRE_IJMatrixCreate(comm, ilower, iupper, ilower, iupper, &ij_A); - HYPRE_IJMatrixSetObjectType(ij_A, HYPRE_PARCSR); - HYPRE_IJMatrixInitialize_v2(ij_A, memory_location); - HYPRE_IJMatrixSetOMPFlag(ij_A, 1); - - h_rowptr = hypre_CTAlloc(HYPRE_Int, nrows+1, HYPRE_MEMORY_HOST); - for (i = 1; i < nrows + 1; i++) - { - h_rowptr[i] = h_rowptr[i-1] + h_nnzrow[i-1]; - } - hypre_assert(h_rowptr[nrows] == num_nonzeros); - chunk_size = nrows / nchunks; - -#if defined(HYPRE_USING_GPU) - hypre_SyncCudaDevice(hypre_handle()); -#if defined(CUDA_PROFILER) - cudaProfilerStart(); -#endif -#endif - - // First Set - time_index = hypre_InitializeTiming("Test Set/Add/Set"); - hypre_BeginTiming(time_index); - for (chunk = 0; chunk < nrows; chunk += chunk_size) - { - chunk_size = hypre_min(chunk_size, nrows-chunk); - if (1 == option) - { - HYPRE_IJMatrixSetValues(ij_A, chunk_size, &nnzrow[chunk], &rows[chunk], - &cols[h_rowptr[chunk]], &coefs[h_rowptr[chunk]]); - } - else - { - HYPRE_IJMatrixSetValues(ij_A, h_rowptr[chunk+chunk_size]-h_rowptr[chunk], - NULL, &rows[h_rowptr[chunk]], - &cols[h_rowptr[chunk]], &coefs[h_rowptr[chunk]]); - } - } - // Then Add - for (chunk = 0; chunk < nrows; chunk += chunk_size) - { - chunk_size = hypre_min(chunk_size, nrows-chunk); - if (1 == option) - { - HYPRE_IJMatrixAddToValues(ij_A, chunk_size, &nnzrow[chunk], &rows[chunk], - &cols[h_rowptr[chunk]], &coefs[h_rowptr[chunk]]); - } - else - { - HYPRE_IJMatrixAddToValues(ij_A, h_rowptr[chunk+chunk_size]-h_rowptr[chunk], - NULL, &rows[h_rowptr[chunk]], - &cols[h_rowptr[chunk]], &coefs[h_rowptr[chunk]]); - } - } - - // Then Set - for (chunk = 0; chunk < nrows; chunk += chunk_size) - { - chunk_size = hypre_min(chunk_size, nrows-chunk); - if (1 == option) - { - HYPRE_IJMatrixSetValues(ij_A, chunk_size, &nnzrow[chunk], &rows[chunk], - &cols[h_rowptr[chunk]], &coefs[h_rowptr[chunk]]); - } - else - { - HYPRE_IJMatrixSetValues(ij_A, h_rowptr[chunk+chunk_size]-h_rowptr[chunk], - NULL, &rows[h_rowptr[chunk]], - &cols[h_rowptr[chunk]], &coefs[h_rowptr[chunk]]); - } - } - - // Assemble matrix - HYPRE_IJMatrixAssemble(ij_A); - -#if defined(HYPRE_USING_GPU) - hypre_SyncCudaDevice(hypre_handle()); -#if defined(CUDA_PROFILER) - cudaProfilerStop(); -#endif -#endif - - // Finalize timer - hypre_EndTiming(time_index); - hypre_PrintTiming("Test Set/Add/Set", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); - - // Free memory - hypre_TFree(h_rowptr, HYPRE_MEMORY_HOST); - - // Set pointer to matrix - *ij_A_ptr = ij_A; - - return hypre_error_flag; -} diff --git a/external/hypre/src/test/ij_device.c b/external/hypre/src/test/ij_device.c index bdc98f66..a1fd59fe 100644 --- a/external/hypre/src/test/ij_device.c +++ b/external/hypre/src/test/ij_device.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -34,27 +34,41 @@ extern "C" { -HYPRE_Int BuildParFromFile (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildParRhsFromFile (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParVector *b_ptr ); - -HYPRE_Int BuildParLaplacian (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildParSysLaplacian (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildParDifConv (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr); -HYPRE_Int BuildFuncsFromFiles (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix A , HYPRE_Int **dof_func_ptr ); -HYPRE_Int BuildFuncsFromOneFile (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix A , HYPRE_Int **dof_func_ptr ); -HYPRE_Int BuildParLaplacian9pt (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildParLaplacian27pt (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildParRotate7pt (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildParVarDifConv (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr , HYPRE_ParVector *rhs_ptr ); +HYPRE_Int BuildParFromFile (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildParRhsFromFile (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParVector *b_ptr ); + +HYPRE_Int BuildParLaplacian (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildParSysLaplacian (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildParDifConv (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr); +HYPRE_Int BuildFuncsFromFiles (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix A, HYPRE_Int **dof_func_ptr ); +HYPRE_Int BuildFuncsFromOneFile (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix A, HYPRE_Int **dof_func_ptr ); +HYPRE_Int BuildParLaplacian9pt (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildParLaplacian27pt (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildParRotate7pt (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildParVarDifConv (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr, HYPRE_ParVector *rhs_ptr ); HYPRE_ParCSRMatrix GenerateSysLaplacian (MPI_Comm comm, HYPRE_Int nx, HYPRE_Int ny, HYPRE_Int nz, HYPRE_Int P, HYPRE_Int Q, HYPRE_Int R, HYPRE_Int p, HYPRE_Int q, HYPRE_Int r, HYPRE_Int num_fun, HYPRE_Real *mtrx, HYPRE_Real *value); -HYPRE_ParCSRMatrix GenerateSysLaplacianVCoef (MPI_Comm comm, HYPRE_Int nx, HYPRE_Int ny, HYPRE_Int nz, +HYPRE_ParCSRMatrix GenerateSysLaplacianVCoef (MPI_Comm comm, HYPRE_Int nx, HYPRE_Int ny, + HYPRE_Int nz, HYPRE_Int P, HYPRE_Int Q, HYPRE_Int R, HYPRE_Int p, HYPRE_Int q, HYPRE_Int r, HYPRE_Int num_fun, HYPRE_Real *mtrx, HYPRE_Real *value); -HYPRE_Int SetSysVcoefValues(HYPRE_Int num_fun, HYPRE_Int nx, HYPRE_Int ny, HYPRE_Int nz, HYPRE_Real vcx, HYPRE_Real vcy, HYPRE_Real vcz, HYPRE_Int mtx_entry, HYPRE_Real *values); +HYPRE_Int SetSysVcoefValues(HYPRE_Int num_fun, HYPRE_Int nx, HYPRE_Int ny, HYPRE_Int nz, + HYPRE_Real vcx, HYPRE_Real vcy, HYPRE_Real vcz, HYPRE_Int mtx_entry, HYPRE_Real *values); -HYPRE_Int BuildParCoordinates (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_Int *coorddim_ptr , float **coord_ptr ); +HYPRE_Int BuildParCoordinates (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_Int *coorddim_ptr, float **coord_ptr ); void testPMIS(HYPRE_ParCSRMatrix parcsr_A); void testPMIS2(HYPRE_ParCSRMatrix parcsr_A); @@ -102,14 +116,14 @@ main( hypre_int argc, /*----------------------------------------------------------------- * GPU Device binding - * Must be done before HYPRE_Init() and should not be changed after + * Must be done before HYPRE_Initialize() and should not be changed after *-----------------------------------------------------------------*/ - hypre_bind_device(myid, num_procs, hypre_MPI_COMM_WORLD); + hypre_bind_device_id(myid, num_procs, hypre_MPI_COMM_WORLD); /*----------------------------------------------------------- * Initialize : must be the first HYPRE function to call *-----------------------------------------------------------*/ - HYPRE_Init(); + HYPRE_Initialize(); hypre_SetNumThreads(5); hypre_printf("CPU #OMP THREADS %d\n", hypre_NumThreads()); @@ -210,7 +224,7 @@ main( hypre_int argc, * Print driver parameters *-----------------------------------------------------------*/ - HYPRE_SetSpGemmUseCusparse(0); + HYPRE_SetSpGemmUseVendor(0); /* use cuRand for PMIS */ HYPRE_SetUseGpuRand(1); @@ -257,7 +271,7 @@ main( hypre_int argc, { hypre_printf("You have asked for an unsupported problem with\n"); hypre_printf("build_matrix_type = %d.\n", build_matrix_type); - return(-1); + return (-1); } if (build_matrix_type < 0) @@ -312,7 +326,7 @@ main( hypre_int argc, HYPRE_ParCSRMatrixDestroy(parcsr_A); } - final: +final: /* Finalize Hypre */ HYPRE_Finalize(); @@ -322,7 +336,7 @@ main( hypre_int argc, /* when using cuda-memcheck --leak-check full, uncomment this */ #if defined(HYPRE_USING_GPU) - hypre_ResetCudaDevice(hypre_handle()); + hypre_ResetDevice(); #endif return (0); @@ -382,7 +396,7 @@ BuildParFromFile( HYPRE_Int argc, * Generate the matrix *-----------------------------------------------------------*/ - HYPRE_ParCSRMatrixRead(hypre_MPI_COMM_WORLD, filename,&A); + HYPRE_ParCSRMatrixRead(hypre_MPI_COMM_WORLD, filename, &A); *A_ptr = A; @@ -442,7 +456,7 @@ BuildParRhsFromFile( HYPRE_Int argc, * Generate the matrix *-----------------------------------------------------------*/ - HYPRE_ParVectorRead(hypre_MPI_COMM_WORLD, filename,&b); + HYPRE_ParVectorRead(hypre_MPI_COMM_WORLD, filename, &b); *b_ptr = b; @@ -528,9 +542,9 @@ BuildParLaplacian( HYPRE_Int argc, else if ( strcmp(argv[arg_index], "-c") == 0 ) { arg_index++; - cx = atof(argv[arg_index++]); - cy = atof(argv[arg_index++]); - cz = atof(argv[arg_index++]); + cx = (HYPRE_Real)atof(argv[arg_index++]); + cy = (HYPRE_Real)atof(argv[arg_index++]); + cz = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-sysL") == 0 ) { @@ -556,7 +570,7 @@ BuildParLaplacian( HYPRE_Int argc, else if ( strcmp(argv[arg_index], "-ep") == 0 ) { arg_index++; - ep = atof(argv[arg_index++]); + ep = (HYPRE_Real)atof(argv[arg_index++]); } else { @@ -568,7 +582,7 @@ BuildParLaplacian( HYPRE_Int argc, * Check a few things *-----------------------------------------------------------*/ - if ((P*Q*R) != num_procs) + if ((P * Q * R) != num_procs) { hypre_printf("Error: Invalid number of processors or processor topology \n"); exit(1); @@ -592,8 +606,8 @@ BuildParLaplacian( HYPRE_Int argc, /* compute p,q,r from P,Q,R and myid */ p = myid % P; - q = (( myid - p)/P) % Q; - r = ( myid - p - P*q)/( P*Q ); + q = (( myid - p) / P) % Q; + r = ( myid - p - P * q) / ( P * Q ); /*----------------------------------------------------------- * Generate the matrix @@ -608,15 +622,15 @@ BuildParLaplacian( HYPRE_Int argc, values[0] = 0.; if (nx > 1) { - values[0] += 2.0*cx; + values[0] += 2.0 * cx; } if (ny > 1) { - values[0] += 2.0*cy; + values[0] += 2.0 * cy; } if (nz > 1) { - values[0] += 2.0*cz; + values[0] += 2.0 * cz; } if (num_fun == 1) @@ -624,46 +638,46 @@ BuildParLaplacian( HYPRE_Int argc, nx, ny, nz, P, Q, R, p, q, r, values); else { - mtrx = hypre_CTAlloc(HYPRE_Real, num_fun*num_fun, HYPRE_MEMORY_HOST); + mtrx = hypre_CTAlloc(HYPRE_Real, num_fun * num_fun, HYPRE_MEMORY_HOST); if (num_fun == 2) { - if (sys_opt ==1) /* identity */ + if (sys_opt == 1) /* identity */ { mtrx[0] = 1.0; mtrx[1] = 0.0; mtrx[2] = 0.0; mtrx[3] = 1.0; } - else if (sys_opt ==2) + else if (sys_opt == 2) { mtrx[0] = 1.0; mtrx[1] = 0.0; mtrx[2] = 0.0; mtrx[3] = 20.0; } - else if (sys_opt ==3) /* similar to barry's talk - ex1 */ + else if (sys_opt == 3) /* similar to barry's talk - ex1 */ { mtrx[0] = 1.0; mtrx[1] = 2.0; mtrx[2] = 2.0; mtrx[3] = 1.0; } - else if (sys_opt ==4) /* can use with vcoef to get barry's ex*/ + else if (sys_opt == 4) /* can use with vcoef to get barry's ex*/ { mtrx[0] = 1.0; mtrx[1] = 1.0; mtrx[2] = 1.0; mtrx[3] = 1.0; } - else if (sys_opt ==5) /* barry's talk - ex1 */ + else if (sys_opt == 5) /* barry's talk - ex1 */ { mtrx[0] = 1.0; mtrx[1] = 1.1; mtrx[2] = 1.1; mtrx[3] = 1.0; } - else if (sys_opt ==6) /* */ + else if (sys_opt == 6) /* */ { mtrx[0] = 1.1; mtrx[1] = 1.0; @@ -681,7 +695,7 @@ BuildParLaplacian( HYPRE_Int argc, } else if (num_fun == 3) { - if (sys_opt ==1) + if (sys_opt == 1) { mtrx[0] = 1.0; mtrx[1] = 0.0; @@ -693,7 +707,7 @@ BuildParLaplacian( HYPRE_Int argc, mtrx[7] = 0.0; mtrx[8] = 1.0; } - else if (sys_opt ==2) + else if (sys_opt == 2) { mtrx[0] = 1.0; mtrx[1] = 0.0; @@ -703,9 +717,9 @@ BuildParLaplacian( HYPRE_Int argc, mtrx[5] = 0.0; mtrx[6] = 0.0; mtrx[7] = 0.0; - mtrx[8] =.01; + mtrx[8] = .01; } - else if (sys_opt ==3) + else if (sys_opt == 3) { mtrx[0] = 1.01; mtrx[1] = 1; @@ -717,7 +731,7 @@ BuildParLaplacian( HYPRE_Int argc, mtrx[7] = 1; mtrx[8] = 1.01; } - else if (sys_opt ==4) /* barry ex4 */ + else if (sys_opt == 4) /* barry ex4 */ { mtrx[0] = 3; mtrx[1] = 1; @@ -778,7 +792,7 @@ BuildParLaplacian( HYPRE_Int argc, HYPRE_Real *mtrx_values; - mtrx_values = hypre_CTAlloc(HYPRE_Real, num_fun*num_fun*4, HYPRE_MEMORY_HOST); + mtrx_values = hypre_CTAlloc(HYPRE_Real, num_fun * num_fun * 4, HYPRE_MEMORY_HOST); if (num_fun == 2) { @@ -818,13 +832,13 @@ BuildParLaplacian( HYPRE_Int argc, { /* mtrx[0] */ - SetSysVcoefValues(num_fun, nx, ny, nz, ep*1.0, 1.0, 1.0, 0, mtrx_values); + SetSysVcoefValues(num_fun, nx, ny, nz, ep * 1.0, 1.0, 1.0, 0, mtrx_values); /* mtrx[1] */ SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, 1.0, 1.0, 1, mtrx_values); /* mtrx[2] */ - SetSysVcoefValues(num_fun, nx, ny, nz, ep*1.0, 1.0, 1.0, 2, mtrx_values); + SetSysVcoefValues(num_fun, nx, ny, nz, ep * 1.0, 1.0, 1.0, 2, mtrx_values); /* mtrx[3] */ SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, 1.0, 1.0, 3, mtrx_values); @@ -834,16 +848,16 @@ BuildParLaplacian( HYPRE_Int argc, HYPRE_Real ep2 = ep; /* mtrx[0] */ - SetSysVcoefValues(num_fun, nx, ny, nz, ep*1.0, 1.0, 1.0, 0, mtrx_values); + SetSysVcoefValues(num_fun, nx, ny, nz, ep * 1.0, 1.0, 1.0, 0, mtrx_values); /* mtrx[1] */ - SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, ep*1.0, 1.0, 1, mtrx_values); + SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, ep * 1.0, 1.0, 1, mtrx_values); /* mtrx[2] */ - SetSysVcoefValues(num_fun, nx, ny, nz, ep*1.0, 1.0, 1.0, 2, mtrx_values); + SetSysVcoefValues(num_fun, nx, ny, nz, ep * 1.0, 1.0, 1.0, 2, mtrx_values); /* mtrx[3] */ - SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, ep2*1.0, 1.0, 3, mtrx_values); + SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, ep2 * 1.0, 1.0, 3, mtrx_values); } else if (vcoef_opt == 5) /* use with default sys_opt - */ { @@ -852,16 +866,16 @@ BuildParLaplacian( HYPRE_Int argc, beta = 10; /* mtrx[0] */ - SetSysVcoefValues(num_fun, nx, ny, nz, alp*1.0, 1.0, 1.0, 0, mtrx_values); + SetSysVcoefValues(num_fun, nx, ny, nz, alp * 1.0, 1.0, 1.0, 0, mtrx_values); /* mtrx[1] */ - SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, beta*1.0, 1.0, 1, mtrx_values); + SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, beta * 1.0, 1.0, 1, mtrx_values); /* mtrx[2] */ - SetSysVcoefValues(num_fun, nx, ny, nz, alp*1.0, 1.0, 1.0, 2, mtrx_values); + SetSysVcoefValues(num_fun, nx, ny, nz, alp * 1.0, 1.0, 1.0, 2, mtrx_values); /* mtrx[3] */ - SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, beta*1.0, 1.0, 3, mtrx_values); + SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, beta * 1.0, 1.0, 3, mtrx_values); } else /* = 0 */ { @@ -961,7 +975,7 @@ BuildParDifConv( HYPRE_Int argc, HYPRE_Int P, Q, R; HYPRE_Real cx, cy, cz; HYPRE_Real ax, ay, az, atype; - HYPRE_Real hinx,hiny,hinz; + HYPRE_Real hinx, hiny, hinz; HYPRE_Int sign_prod; HYPRE_ParCSRMatrix A; @@ -1022,16 +1036,16 @@ BuildParDifConv( HYPRE_Int argc, else if ( strcmp(argv[arg_index], "-c") == 0 ) { arg_index++; - cx = atof(argv[arg_index++]); - cy = atof(argv[arg_index++]); - cz = atof(argv[arg_index++]); + cx = (HYPRE_Real)atof(argv[arg_index++]); + cy = (HYPRE_Real)atof(argv[arg_index++]); + cz = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-a") == 0 ) { arg_index++; - ax = atof(argv[arg_index++]); - ay = atof(argv[arg_index++]); - az = atof(argv[arg_index++]); + ax = (HYPRE_Real)atof(argv[arg_index++]); + ay = (HYPRE_Real)atof(argv[arg_index++]); + az = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-atype") == 0 ) { @@ -1048,7 +1062,7 @@ BuildParDifConv( HYPRE_Int argc, * Check a few things *-----------------------------------------------------------*/ - if ((P*Q*R) != num_procs) + if ((P * Q * R) != num_procs) { hypre_printf("Error: Invalid number of processors or processor topology \n"); exit(1); @@ -1074,12 +1088,12 @@ BuildParDifConv( HYPRE_Int argc, /* compute p,q,r from P,Q,R and myid */ p = myid % P; - q = (( myid - p)/P) % Q; - r = ( myid - p - P*q)/( P*Q ); + q = (( myid - p) / P) % Q; + r = ( myid - p - P * q) / ( P * Q ); - hinx = 1./(nx+1); - hiny = 1./(ny+1); - hinz = 1./(nz+1); + hinx = 1. / (nx + 1); + hiny = 1. / (ny + 1); + hinz = 1. / (nz + 1); /*----------------------------------------------------------- * Generate the matrix @@ -1099,46 +1113,46 @@ BuildParDifConv( HYPRE_Int argc, if (0 == atype) /* forward scheme for conv */ { - values[1] = -cx/(hinx*hinx); - values[2] = -cy/(hiny*hiny); - values[3] = -cz/(hinz*hinz); - values[4] = -cx/(hinx*hinx) + ax/hinx; - values[5] = -cy/(hiny*hiny) + ay/hiny; - values[6] = -cz/(hinz*hinz) + az/hinz; + values[1] = -cx / (hinx * hinx); + values[2] = -cy / (hiny * hiny); + values[3] = -cz / (hinz * hinz); + values[4] = -cx / (hinx * hinx) + ax / hinx; + values[5] = -cy / (hiny * hiny) + ay / hiny; + values[6] = -cz / (hinz * hinz) + az / hinz; if (nx > 1) { - values[0] += 2.0*cx/(hinx*hinx) - 1.*ax/hinx; + values[0] += 2.0 * cx / (hinx * hinx) - 1.*ax / hinx; } if (ny > 1) { - values[0] += 2.0*cy/(hiny*hiny) - 1.*ay/hiny; + values[0] += 2.0 * cy / (hiny * hiny) - 1.*ay / hiny; } if (nz > 1) { - values[0] += 2.0*cz/(hinz*hinz) - 1.*az/hinz; + values[0] += 2.0 * cz / (hinz * hinz) - 1.*az / hinz; } } else if (1 == atype) /* backward scheme for conv */ { - values[1] = -cx/(hinx*hinx) - ax/hinx; - values[2] = -cy/(hiny*hiny) - ay/hiny; - values[3] = -cz/(hinz*hinz) - az/hinz; - values[4] = -cx/(hinx*hinx); - values[5] = -cy/(hiny*hiny); - values[6] = -cz/(hinz*hinz); + values[1] = -cx / (hinx * hinx) - ax / hinx; + values[2] = -cy / (hiny * hiny) - ay / hiny; + values[3] = -cz / (hinz * hinz) - az / hinz; + values[4] = -cx / (hinx * hinx); + values[5] = -cy / (hiny * hiny); + values[6] = -cz / (hinz * hinz); if (nx > 1) { - values[0] += 2.0*cx/(hinx*hinx) + 1.*ax/hinx; + values[0] += 2.0 * cx / (hinx * hinx) + 1.*ax / hinx; } if (ny > 1) { - values[0] += 2.0*cy/(hiny*hiny) + 1.*ay/hiny; + values[0] += 2.0 * cy / (hiny * hiny) + 1.*ay / hiny; } if (nz > 1) { - values[0] += 2.0*cz/(hinz*hinz) + 1.*az/hinz; + values[0] += 2.0 * cz / (hinz * hinz) + 1.*az / hinz; } } else if (3 == atype) /* upwind scheme */ @@ -1146,83 +1160,83 @@ BuildParDifConv( HYPRE_Int argc, sign_prod = sign_double(cx) * sign_double(ax); if (sign_prod == 1) /* same sign use back scheme */ { - values[1] = -cx/(hinx*hinx) - ax/hinx; - values[4] = -cx/(hinx*hinx); + values[1] = -cx / (hinx * hinx) - ax / hinx; + values[4] = -cx / (hinx * hinx); if (nx > 1) { - values[0] += 2.0*cx/(hinx*hinx) + 1.*ax/hinx; + values[0] += 2.0 * cx / (hinx * hinx) + 1.*ax / hinx; } } else /* diff sign use forward scheme */ { - values[1] = -cx/(hinx*hinx); - values[4] = -cx/(hinx*hinx) + ax/hinx; + values[1] = -cx / (hinx * hinx); + values[4] = -cx / (hinx * hinx) + ax / hinx; if (nx > 1) { - values[0] += 2.0*cx/(hinx*hinx) - 1.*ax/hinx; + values[0] += 2.0 * cx / (hinx * hinx) - 1.*ax / hinx; } } sign_prod = sign_double(cy) * sign_double(ay); if (sign_prod == 1) /* same sign use back scheme */ { - values[2] = -cy/(hiny*hiny) - ay/hiny; - values[5] = -cy/(hiny*hiny); + values[2] = -cy / (hiny * hiny) - ay / hiny; + values[5] = -cy / (hiny * hiny); if (ny > 1) { - values[0] += 2.0*cy/(hiny*hiny) + 1.*ay/hiny; + values[0] += 2.0 * cy / (hiny * hiny) + 1.*ay / hiny; } } else /* diff sign use forward scheme */ { - values[2] = -cy/(hiny*hiny); - values[5] = -cy/(hiny*hiny) + ay/hiny; + values[2] = -cy / (hiny * hiny); + values[5] = -cy / (hiny * hiny) + ay / hiny; if (ny > 1) { - values[0] += 2.0*cy/(hiny*hiny) - 1.*ay/hiny; + values[0] += 2.0 * cy / (hiny * hiny) - 1.*ay / hiny; } } sign_prod = sign_double(cz) * sign_double(az); if (sign_prod == 1) /* same sign use back scheme */ { - values[3] = -cz/(hinz*hinz) - az/hinz; - values[6] = -cz/(hinz*hinz); + values[3] = -cz / (hinz * hinz) - az / hinz; + values[6] = -cz / (hinz * hinz); if (nz > 1) { - values[0] += 2.0*cz/(hinz*hinz) + 1.*az/hinz; + values[0] += 2.0 * cz / (hinz * hinz) + 1.*az / hinz; } } else /* diff sign use forward scheme */ { - values[3] = -cz/(hinz*hinz); - values[6] = -cz/(hinz*hinz) + az/hinz; + values[3] = -cz / (hinz * hinz); + values[6] = -cz / (hinz * hinz) + az / hinz; if (nz > 1) { - values[0] += 2.0*cz/(hinz*hinz) - 1.*az/hinz; + values[0] += 2.0 * cz / (hinz * hinz) - 1.*az / hinz; } } } else /* centered difference scheme */ { - values[1] = -cx/(hinx*hinx) - ax/(2.*hinx); - values[2] = -cy/(hiny*hiny) - ay/(2.*hiny); - values[3] = -cz/(hinz*hinz) - az/(2.*hinz); - values[4] = -cx/(hinx*hinx) + ax/(2.*hinx); - values[5] = -cy/(hiny*hiny) + ay/(2.*hiny); - values[6] = -cz/(hinz*hinz) + az/(2.*hinz); + values[1] = -cx / (hinx * hinx) - ax / (2.*hinx); + values[2] = -cy / (hiny * hiny) - ay / (2.*hiny); + values[3] = -cz / (hinz * hinz) - az / (2.*hinz); + values[4] = -cx / (hinx * hinx) + ax / (2.*hinx); + values[5] = -cy / (hiny * hiny) + ay / (2.*hiny); + values[6] = -cz / (hinz * hinz) + az / (2.*hinz); if (nx > 1) { - values[0] += 2.0*cx/(hinx*hinx); + values[0] += 2.0 * cx / (hinx * hinx); } if (ny > 1) { - values[0] += 2.0*cy/(hiny*hiny); + values[0] += 2.0 * cy / (hiny * hiny); } if (nz > 1) { - values[0] += 2.0*cz/(hinz*hinz); + values[0] += 2.0 * cz / (hinz * hinz); } } @@ -1301,7 +1315,7 @@ BuildParLaplacian9pt( HYPRE_Int argc, * Check a few things *-----------------------------------------------------------*/ - if ((P*Q) != num_procs) + if ((P * Q) != num_procs) { hypre_printf("Error: Invalid number of processors or processor topology \n"); exit(1); @@ -1324,7 +1338,7 @@ BuildParLaplacian9pt( HYPRE_Int argc, /* compute p,q from P,Q and myid */ p = myid % P; - q = ( myid - p)/P; + q = ( myid - p) / P; /*----------------------------------------------------------- * Generate the matrix @@ -1426,7 +1440,7 @@ BuildParLaplacian27pt( HYPRE_Int argc, * Check a few things *-----------------------------------------------------------*/ - if ((P*Q*R) != num_procs) + if ((P * Q * R) != num_procs) { hypre_printf("Error: Invalid number of processors or processor topology \n"); exit(1); @@ -1449,8 +1463,8 @@ BuildParLaplacian27pt( HYPRE_Int argc, /* compute p,q,r from P,Q,R and myid */ p = myid % P; - q = (( myid - p)/P) % Q; - r = ( myid - p - P*q)/( P*Q ); + q = (( myid - p) / P) % Q; + r = ( myid - p - P * q) / ( P * Q ); /*----------------------------------------------------------- * Generate the matrix @@ -1460,9 +1474,13 @@ BuildParLaplacian27pt( HYPRE_Int argc, values[0] = 26.0; if (nx == 1 || ny == 1 || nz == 1) + { values[0] = 8.0; - if (nx*ny == 1 || nx*nz == 1 || ny*nz == 1) + } + if (nx * ny == 1 || nx * nz == 1 || ny * nz == 1) + { values[0] = 2.0; + } values[1] = -1.; A = (HYPRE_ParCSRMatrix) GenerateLaplacian27pt(hypre_MPI_COMM_WORLD, @@ -1534,12 +1552,12 @@ BuildParRotate7pt( HYPRE_Int argc, else if ( strcmp(argv[arg_index], "-alpha") == 0 ) { arg_index++; - alpha = atof(argv[arg_index++]); + alpha = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-eps") == 0 ) { arg_index++; - eps = atof(argv[arg_index++]); + eps = (HYPRE_Real)atof(argv[arg_index++]); } else { @@ -1551,7 +1569,7 @@ BuildParRotate7pt( HYPRE_Int argc, * Check a few things *-----------------------------------------------------------*/ - if ((P*Q) != num_procs) + if ((P * Q) != num_procs) { hypre_printf("Error: Invalid number of processors or processor topology \n"); exit(1); @@ -1564,7 +1582,7 @@ BuildParRotate7pt( HYPRE_Int argc, if (myid == 0) { hypre_printf(" Rotate 7pt:\n"); - hypre_printf(" alpha = %f, eps = %f\n", alpha,eps); + hypre_printf(" alpha = %f, eps = %f\n", alpha, eps); hypre_printf(" (nx, ny) = (%d, %d)\n", nx, ny); hypre_printf(" (Px, Py) = (%d, %d)\n", P, Q); } @@ -1575,7 +1593,7 @@ BuildParRotate7pt( HYPRE_Int argc, /* compute p,q from P,Q and myid */ p = myid % P; - q = ( myid - p)/P; + q = ( myid - p) / P; /*----------------------------------------------------------- * Generate the matrix @@ -1603,7 +1621,7 @@ HYPRE_Int BuildParVarDifConv( HYPRE_Int argc, char *argv[], HYPRE_Int arg_index, - HYPRE_ParCSRMatrix *A_ptr , + HYPRE_ParCSRMatrix *A_ptr, HYPRE_ParVector *rhs_ptr ) { HYPRE_Int nx, ny, nz; @@ -1663,7 +1681,7 @@ BuildParVarDifConv( HYPRE_Int argc, else if ( strcmp(argv[arg_index], "-eps") == 0 ) { arg_index++; - eps = atof(argv[arg_index++]); + eps = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-vardifconvRS") == 0 ) { @@ -1680,7 +1698,7 @@ BuildParVarDifConv( HYPRE_Int argc, * Check a few things *-----------------------------------------------------------*/ - if ((P*Q*R) != num_procs) + if ((P * Q * R) != num_procs) { hypre_printf("Error: Invalid number of processors or processor topology \n"); exit(1); @@ -1703,8 +1721,8 @@ BuildParVarDifConv( HYPRE_Int argc, /* compute p,q,r from P,Q,R and myid */ p = myid % P; - q = (( myid - p)/P) % Q; - r = ( myid - p - P*q)/( P*Q ); + q = (( myid - p) / P) % Q; + r = ( myid - p - P * q) / ( P * Q ); /*----------------------------------------------------------- * Generate the matrix @@ -1731,29 +1749,30 @@ BuildParVarDifConv( HYPRE_Int argc, /**************************************************************************/ -HYPRE_Int SetSysVcoefValues(HYPRE_Int num_fun, HYPRE_Int nx, HYPRE_Int ny, HYPRE_Int nz, HYPRE_Real vcx, +HYPRE_Int SetSysVcoefValues(HYPRE_Int num_fun, HYPRE_Int nx, HYPRE_Int ny, HYPRE_Int nz, + HYPRE_Real vcx, HYPRE_Real vcy, HYPRE_Real vcz, HYPRE_Int mtx_entry, HYPRE_Real *values) { - HYPRE_Int sz = num_fun*num_fun; + HYPRE_Int sz = num_fun * num_fun; - values[1*sz + mtx_entry] = -vcx; - values[2*sz + mtx_entry] = -vcy; - values[3*sz + mtx_entry] = -vcz; - values[0*sz + mtx_entry] = 0.0; + values[1 * sz + mtx_entry] = -vcx; + values[2 * sz + mtx_entry] = -vcy; + values[3 * sz + mtx_entry] = -vcz; + values[0 * sz + mtx_entry] = 0.0; if (nx > 1) { - values[0*sz + mtx_entry] += 2.0*vcx; + values[0 * sz + mtx_entry] += 2.0 * vcx; } if (ny > 1) { - values[0*sz + mtx_entry] += 2.0*vcy; + values[0 * sz + mtx_entry] += 2.0 * vcy; } if (nz > 1) { - values[0*sz + mtx_entry] += 2.0*vcz; + values[0 * sz + mtx_entry] += 2.0 * vcz; } return 0; @@ -1827,23 +1846,27 @@ BuildParCoordinates( HYPRE_Int argc, /* compute p,q,r from P,Q,R and myid */ p = myid % P; - q = (( myid - p)/P) % Q; - r = ( myid - p - P*q)/( P*Q ); + q = (( myid - p) / P) % Q; + r = ( myid - p - P * q) / ( P * Q ); /*----------------------------------------------------------- * Generate the coordinates *-----------------------------------------------------------*/ coorddim = 3; - if (nx<2) coorddim--; - if (ny<2) coorddim--; - if (nz<2) coorddim--; + if (nx < 2) { coorddim--; } + if (ny < 2) { coorddim--; } + if (nz < 2) { coorddim--; } - if (coorddim>0) - coordinates = GenerateCoordinates (hypre_MPI_COMM_WORLD, - nx, ny, nz, P, Q, R, p, q, r, coorddim); + if (coorddim > 0) + { + coordinates = hypre_GenerateCoordinates(hypre_MPI_COMM_WORLD, + nx, ny, nz, P, Q, R, p, q, r, coorddim); + } else - coordinates=NULL; + { + coordinates = NULL; + } *coorddim_ptr = coorddim; *coord_ptr = coordinates; @@ -1873,7 +1896,7 @@ testPMIS(HYPRE_ParCSRMatrix parcsr_A) hypre_MPI_Comm_rank(hypre_MPI_COMM_WORLD, &myid ); HYPRE_ParCSRMatrixGetLocalRange( parcsr_A, - &first_local_row, &last_local_row , + &first_local_row, &last_local_row, &first_local_col, &last_local_col ); local_num_rows = last_local_row - first_local_row + 1; @@ -1923,7 +1946,8 @@ testPMIS(HYPRE_ParCSRMatrix parcsr_A) nC1++; } - hypre_assert(hypre_IntArrayData(h_CF_marker2)[i] == 1 || hypre_IntArrayData(h_CF_marker2)[i] == -1 || hypre_IntArrayData(h_CF_marker2)[i] == -3); + hypre_assert(hypre_IntArrayData(h_CF_marker2)[i] == 1 || + hypre_IntArrayData(h_CF_marker2)[i] == -1 || hypre_IntArrayData(h_CF_marker2)[i] == -3); //hypre_assert(h_CF_marker[i] == h_CF_marker2[i]); @@ -1967,7 +1991,7 @@ testPMIS3(HYPRE_ParCSRMatrix parcsr_A) hypre_MPI_Comm_rank(hypre_MPI_COMM_WORLD, &myid ); HYPRE_ParCSRMatrixGetLocalRange( parcsr_A, - &first_local_row, &last_local_row , + &first_local_row, &last_local_row, &first_local_col, &last_local_col ); local_num_rows = last_local_row - first_local_row + 1; @@ -1984,7 +2008,8 @@ testPMIS3(HYPRE_ParCSRMatrix parcsr_A) for (i = 0; i < local_num_rows; i++) { - hypre_assert(hypre_IntArrayData(h_CF_marker2)[i] == 1 || hypre_IntArrayData(h_CF_marker2)[i] == -1 || hypre_IntArrayData(h_CF_marker2)[i] == -3); + hypre_assert(hypre_IntArrayData(h_CF_marker2)[i] == 1 || + hypre_IntArrayData(h_CF_marker2)[i] == -1 || hypre_IntArrayData(h_CF_marker2)[i] == -3); if (hypre_IntArrayData(h_CF_marker2)[i] > 0) { @@ -2023,7 +2048,7 @@ testPMIS2(HYPRE_ParCSRMatrix parcsr_A) hypre_MPI_Comm_rank(comm, &myid ); HYPRE_ParCSRMatrixGetLocalRange( parcsr_A, - &first_local_row, &last_local_row , + &first_local_row, &last_local_row, &first_local_col, &last_local_col ); local_num_rows = last_local_row - first_local_row + 1; @@ -2038,9 +2063,9 @@ testPMIS2(HYPRE_ParCSRMatrix parcsr_A) hypre_IntArrayInitialize(h_CF_marker); hypre_BoomerAMGCoarsenPMISDevice(parcsr_S_device, parcsr_A, 2, debug_flag, &h_CF_marker); - HYPRE_Int *coarse_pnts_global = NULL; + HYPRE_Int coarse_pnts_global[2]; hypre_BoomerAMGCoarseParms(comm, local_num_rows, 1, NULL, h_CF_marker, NULL, - &coarse_pnts_global); + coarse_pnts_global); /* interp */ hypre_ParCSRMatrix *P; @@ -2068,7 +2093,8 @@ testPMIS2(HYPRE_ParCSRMatrix parcsr_A) for (i = 0; i < local_num_rows2; i++) { - hypre_assert(hypre_IntArrayData(h_CF_marker2)[i] == 1 || hypre_IntArrayData(h_CF_marker2)[i] == -1 || hypre_IntArrayData(h_CF_marker2)[i] == -3); + hypre_assert(hypre_IntArrayData(h_CF_marker2)[i] == 1 || + hypre_IntArrayData(h_CF_marker2)[i] == -1 || hypre_IntArrayData(h_CF_marker2)[i] == -3); if (hypre_IntArrayData(h_CF_marker2)[i] > 0) { @@ -2127,7 +2153,7 @@ testTranspose(HYPRE_ParCSRMatrix parcsr_A) HYPRE_Int first_local_row, last_local_row; HYPRE_Int first_local_col, last_local_col; HYPRE_ParCSRMatrixGetLocalRange( parcsr_A, - &first_local_row, &last_local_row , + &first_local_row, &last_local_row, &first_local_col, &last_local_col ); HYPRE_Int local_num_rows = last_local_row - first_local_row + 1; HYPRE_ParCSRMatrix parcsr_S_device = NULL; @@ -2136,9 +2162,9 @@ testTranspose(HYPRE_ParCSRMatrix parcsr_A) hypre_IntArrayInitialize(h_CF_marker); hypre_BoomerAMGCoarsenPMISDevice(parcsr_S_device, parcsr_A, 2, 0, &h_CF_marker); hypre_ParCSRMatrix *P, *PT, *P_h, *PT_h, *P2; - HYPRE_Int *coarse_pnts_global = NULL; + HYPRE_Int coarse_pnts_global[2]; MPI_Comm comm = hypre_ParCSRMatrixComm(parcsr_A); - hypre_BoomerAMGCoarseParms(comm, local_num_rows, 1, NULL, h_CF_marker, NULL, &coarse_pnts_global); + hypre_BoomerAMGCoarseParms(comm, local_num_rows, 1, NULL, h_CF_marker, NULL, coarse_pnts_global); hypre_BoomerAMGBuildDirInterpDevice(parcsr_A, hypre_IntArrayData(h_CF_marker), parcsr_S_device, coarse_pnts_global, 1, NULL, 0, 0.0, 0, 3, &P); @@ -2172,7 +2198,7 @@ testAdd(HYPRE_ParCSRMatrix parcsr_A) HYPRE_Real tol = 1e-14; HYPRE_Int ierr = 0; - HYPRE_Real alpha = 3.141592654, beta = 2.718281828*9.9; + HYPRE_Real alpha = 3.141592654, beta = 2.718281828 * 9.9; HYPRE_ParCSRMatrix parcsr_A2 = hypre_ParCSRMatMatDevice(parcsr_A, parcsr_A); HYPRE_ParCSRMatrix parcsr_C; @@ -2194,7 +2220,7 @@ testAdd(HYPRE_ParCSRMatrix parcsr_A) HYPRE_Int first_local_row, last_local_row; HYPRE_Int first_local_col, last_local_col; HYPRE_ParCSRMatrixGetLocalRange( parcsr_A, - &first_local_row, &last_local_row , + &first_local_row, &last_local_row, &first_local_col, &last_local_col ); HYPRE_Int local_num_rows = last_local_row - first_local_row + 1; HYPRE_ParCSRMatrix parcsr_S_device = NULL; @@ -2203,9 +2229,9 @@ testAdd(HYPRE_ParCSRMatrix parcsr_A) hypre_IntArrayInitialize(h_CF_marker); hypre_BoomerAMGCoarsenPMISDevice(parcsr_S_device, parcsr_A, 2, 0, &h_CF_marker); hypre_ParCSRMatrix *P, *AP, *P_h, *AP_h; - HYPRE_Int *coarse_pnts_global = NULL; + HYPRE_Int coarse_pnts_global[2]; MPI_Comm comm = hypre_ParCSRMatrixComm(parcsr_A); - hypre_BoomerAMGCoarseParms(comm, local_num_rows, 1, NULL, h_CF_marker, NULL, &coarse_pnts_global); + hypre_BoomerAMGCoarseParms(comm, local_num_rows, 1, NULL, h_CF_marker, NULL, coarse_pnts_global); hypre_BoomerAMGBuildDirInterpDevice(parcsr_A, hypre_IntArrayData(h_CF_marker), parcsr_S_device, coarse_pnts_global, 1, NULL, 0, 0.0, 0, 3, &P); @@ -2243,8 +2269,7 @@ testFFFC(HYPRE_ParCSRMatrix parcsr_A) HYPRE_Int local_num_rows; HYPRE_Int first_local_row, last_local_row; HYPRE_Int first_local_col, last_local_col; - HYPRE_Int *coarse_dof_func = NULL; - HYPRE_BigInt *coarse_pnts_global = NULL; + HYPRE_BigInt coarse_pnts_global[2]; HYPRE_Int ierr = 0; HYPRE_Int myid; @@ -2255,27 +2280,30 @@ testFFFC(HYPRE_ParCSRMatrix parcsr_A) HYPRE_ParCSRMatrix parcsr_S_h, parcsr_S_device; HYPRE_ParCSRMatrixGetLocalRange( parcsr_A, - &first_local_row, &last_local_row , + &first_local_row, &last_local_row, &first_local_col, &last_local_col ); local_num_rows = last_local_row - first_local_row + 1; /* Soc on DEVICE */ - hypre_BoomerAMGCreateSDevice(parcsr_A, strong_threshold, max_row_sum, num_functions, NULL, &parcsr_S_device); + hypre_BoomerAMGCreateSDevice(parcsr_A, strong_threshold, max_row_sum, num_functions, NULL, + &parcsr_S_device); h_CF_marker = hypre_IntArrayCreate(local_num_rows); hypre_IntArrayInitialize(h_CF_marker); hypre_BoomerAMGCoarsenPMISDevice(parcsr_S_device, parcsr_A, 0, debug_flag, &h_CF_marker); hypre_BoomerAMGCoarseParms(hypre_ParCSRMatrixComm(parcsr_A), local_num_rows, num_functions, NULL, - h_CF_marker, &coarse_dof_func, &coarse_pnts_global); + h_CF_marker, NULL, coarse_pnts_global); /* FFFC on Device */ - hypre_ParCSRMatrixGenerateFFFCDevice(parcsr_A, hypre_IntArrayData(h_CF_marker), coarse_pnts_global, parcsr_S_device, &AFC, &AFF); + hypre_ParCSRMatrixGenerateFFFCDevice(parcsr_A, hypre_IntArrayData(h_CF_marker), coarse_pnts_global, + parcsr_S_device, &AFC, &AFF); /* FFFC on Host */ parcsr_A_h = hypre_ParCSRMatrixClone_v2(parcsr_A, 1, HYPRE_MEMORY_HOST); parcsr_S_h = hypre_ParCSRMatrixClone_v2(parcsr_S_device, 0, HYPRE_MEMORY_HOST); hypre_MatvecCommPkgCreate(parcsr_A_h); - hypre_ParCSRMatrixGenerateFFFC(parcsr_A_h, hypre_IntArrayData(h_CF_marker), coarse_pnts_global, parcsr_S_h, &AFC_h, &AFF_h); + hypre_ParCSRMatrixGenerateFFFCHost(parcsr_A_h, hypre_IntArrayData(h_CF_marker), + coarse_pnts_global, parcsr_S_h, &AFC_h, &AFF_h); /* AFF * AFC */ W_h = hypre_ParCSRMatMatHost(AFF_h, AFC_h); @@ -2321,11 +2349,13 @@ CompareParCSRDH(HYPRE_ParCSRMatrix hmat, HYPRE_ParCSRMatrix dmat, HYPRE_Real tol { ecode ++; } - if (hypre_CSRMatrixNumRows(hypre_ParCSRMatrixOffd(hmat)) != hypre_CSRMatrixNumRows(hypre_ParCSRMatrixOffd(hmat2))) + if (hypre_CSRMatrixNumRows(hypre_ParCSRMatrixOffd(hmat)) != hypre_CSRMatrixNumRows( + hypre_ParCSRMatrixOffd(hmat2))) { ecode ++; } - if (hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(hmat)) != hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(hmat2))) + if (hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(hmat)) != hypre_CSRMatrixNumCols( + hypre_ParCSRMatrixOffd(hmat2))) { ecode ++; } @@ -2337,11 +2367,13 @@ CompareParCSRDH(HYPRE_ParCSRMatrix hmat, HYPRE_ParCSRMatrix dmat, HYPRE_Real tol break; } } - if (hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixDiag(hmat)) != hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixDiag(hmat2))) + if (hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixDiag(hmat)) != hypre_CSRMatrixNumNonzeros( + hypre_ParCSRMatrixDiag(hmat2))) { ecode ++; } - if (hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixOffd(hmat)) != hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixOffd(hmat2))) + if (hypre_CSRMatrixNumNonzeros(hypre_ParCSRMatrixOffd(hmat)) != hypre_CSRMatrixNumNonzeros( + hypre_ParCSRMatrixOffd(hmat2))) { ecode ++; } diff --git a/external/hypre/src/test/ij_mm.c b/external/hypre/src/test/ij_mm.c index a3a1af9b..1d273fd5 100644 --- a/external/hypre/src/test/ij_mm.c +++ b/external/hypre/src/test/ij_mm.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -34,27 +34,34 @@ extern "C" { #endif -HYPRE_Int BuildParFromFile (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildParRhsFromFile (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParVector *b_ptr ); - -HYPRE_Int BuildParLaplacian (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildParSysLaplacian (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildParDifConv (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr); -HYPRE_Int BuildFuncsFromFiles (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix A , HYPRE_Int **dof_func_ptr ); -HYPRE_Int BuildFuncsFromOneFile (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix A , HYPRE_Int **dof_func_ptr ); -HYPRE_Int BuildParLaplacian9pt (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildParLaplacian27pt (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildParRotate7pt (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildParVarDifConv (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr , HYPRE_ParVector *rhs_ptr ); -HYPRE_ParCSRMatrix GenerateSysLaplacian (MPI_Comm comm, HYPRE_Int nx, HYPRE_Int ny, HYPRE_Int nz, - HYPRE_Int P, HYPRE_Int Q, HYPRE_Int R, HYPRE_Int p, HYPRE_Int q, HYPRE_Int r, - HYPRE_Int num_fun, HYPRE_Real *mtrx, HYPRE_Real *value); -HYPRE_ParCSRMatrix GenerateSysLaplacianVCoef (MPI_Comm comm, HYPRE_Int nx, HYPRE_Int ny, HYPRE_Int nz, - HYPRE_Int P, HYPRE_Int Q, HYPRE_Int R, HYPRE_Int p, HYPRE_Int q, HYPRE_Int r, - HYPRE_Int num_fun, HYPRE_Real *mtrx, HYPRE_Real *value); -HYPRE_Int SetSysVcoefValues(HYPRE_Int num_fun, HYPRE_Int nx, HYPRE_Int ny, HYPRE_Int nz, HYPRE_Real vcx, HYPRE_Real vcy, HYPRE_Real vcz, HYPRE_Int mtx_entry, HYPRE_Real *values); - -HYPRE_Int BuildParCoordinates (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_Int *coorddim_ptr , float **coord_ptr ); +HYPRE_Int BuildParFromFile (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildParRhsFromFile (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParVector *b_ptr ); + +HYPRE_Int BuildParLaplacian (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildParSysLaplacian (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildParDifConv (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr); +HYPRE_Int BuildFuncsFromFiles (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix A, HYPRE_Int **dof_func_ptr ); +HYPRE_Int BuildFuncsFromOneFile (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix A, HYPRE_Int **dof_func_ptr ); +HYPRE_Int BuildParLaplacian9pt (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildParLaplacian27pt (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildParRotate7pt (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildParVarDifConv (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr, HYPRE_ParVector *rhs_ptr ); +HYPRE_Int SetSysVcoefValues(HYPRE_Int num_fun, HYPRE_BigInt nx, HYPRE_BigInt ny, HYPRE_BigInt nz, + HYPRE_Real vcx, HYPRE_Real vcy, HYPRE_Real vcz, HYPRE_Int mtx_entry, HYPRE_Real *values); + +HYPRE_Int BuildParCoordinates (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_Int *coorddim_ptr, float **coord_ptr ); #ifdef __cplusplus } @@ -77,33 +84,39 @@ void gpu_alloc(void **ptr, size_t size) void gpu_free(void *ptr) { + HYPRE_UNUSED_VAR(ptr); return; } +char file_dir[] = "./"; void runjob1( HYPRE_ParCSRMatrix parcsr_A, HYPRE_Int print_system, + HYPRE_Int rep, HYPRE_Int verify) { - HYPRE_Int num_procs, myid, i; + HYPRE_Int i; HYPRE_ParCSRMatrix parcsr_A_host = NULL; HYPRE_ParCSRMatrix parcsr_B_host = NULL; HYPRE_ParCSRMatrix parcsr_B_host2 = NULL; HYPRE_ParCSRMatrix parcsr_B = NULL; HYPRE_ParCSRMatrix parcsr_error_host = NULL; HYPRE_Real fnorm, rfnorm, fnorm0; - HYPRE_Int time_index, rep = 2; + HYPRE_Int time_index; + char fname[1024]; - hypre_MPI_Comm_size(hypre_MPI_COMM_WORLD, &num_procs ); - hypre_MPI_Comm_rank(hypre_MPI_COMM_WORLD, &myid ); + MPI_Comm comm = hypre_ParCSRMatrixComm(parcsr_A); - if (myid == 0) - { - hypre_printf("A %d x %d\n", hypre_ParCSRMatrixGlobalNumRows(parcsr_A), hypre_ParCSRMatrixGlobalNumCols(parcsr_A)); - } + hypre_ParPrintf(comm, "A %d x %d, NNZ %d, RNZ %d\n", hypre_ParCSRMatrixGlobalNumRows(parcsr_A), + hypre_ParCSRMatrixGlobalNumCols(parcsr_A), + hypre_ParCSRMatrixNumNonzeros(parcsr_A), + hypre_ParCSRMatrixNumNonzeros(parcsr_A) / hypre_ParCSRMatrixGlobalNumRows(parcsr_A)); hypre_assert(hypre_ParCSRMatrixMemoryLocation(parcsr_A) == HYPRE_MEMORY_DEVICE); + hypre_MatvecCommPkgCreate(parcsr_A); + hypre_ParCSRMatrixCopyColMapOffdToDevice(parcsr_A); + if (verify) { parcsr_A_host = hypre_ParCSRMatrixClone_v2(parcsr_A, 1, HYPRE_MEMORY_HOST); @@ -113,22 +126,29 @@ void runjob1( HYPRE_ParCSRMatrix parcsr_A, hypre_BeginTiming(time_index); - parcsr_B_host = hypre_ParCSRMatMat(parcsr_A_host, parcsr_A_host); + parcsr_B_host = hypre_ParCSRMatMat(parcsr_A_host, parcsr_A_host); hypre_EndTiming(time_index); hypre_PrintTiming("Host Parcsr Matrix-by-Matrix, A*A", hypre_MPI_COMM_WORLD); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); + + hypre_ParCSRMatrixSetNumNonzeros(parcsr_B_host); } if (print_system) { - hypre_CSRMatrixPrintMM(hypre_ParCSRMatrixDiag(parcsr_A_host), 1, 1, 0, "/p/gpfs1/li50/A.mtx"); + sprintf(fname, "%s/%s", file_dir, "IJ.out.A"); + hypre_ParCSRMatrixPrintIJ(parcsr_A, 0, 0, fname); + + //hypre_CSRMatrixPrintMM(hypre_ParCSRMatrixDiag(parcsr_A_host), 1, 1, 0, "A.mtx"); } for (i = 0 ; i < rep; i++) { - if (i == rep-1) + hypre_ParPrintf(comm, "--- rep %d (out of %d) ---\n", i, rep); + + if (i == rep - 1) { time_index = hypre_InitializeTiming("Device Parcsr Matrix-by-Matrix, A*A"); hypre_BeginTiming(time_index); @@ -137,9 +157,11 @@ void runjob1( HYPRE_ParCSRMatrix parcsr_A, parcsr_B = hypre_ParCSRMatMat(parcsr_A, parcsr_A); - if (i == rep-1) + if (i == rep - 1) { - hypre_SyncCudaDevice(hypre_handle()); +#if defined(HYPRE_USING_GPU) + hypre_SyncDevice(); +#endif //cudaProfilerStop(); hypre_EndTiming(time_index); hypre_PrintTiming("Device Parcsr Matrix-by-Matrix, A*A", hypre_MPI_COMM_WORLD); @@ -147,7 +169,7 @@ void runjob1( HYPRE_ParCSRMatrix parcsr_A, hypre_ClearTiming(); } - if (i < rep-1) + if (i < rep - 1) { hypre_ParCSRMatrixDestroy(parcsr_B); } @@ -163,41 +185,182 @@ void runjob1( HYPRE_ParCSRMatrix parcsr_A, fnorm0 = hypre_ParCSRMatrixFnorm(parcsr_B_host); rfnorm = fnorm0 > 0 ? fnorm / fnorm0 : fnorm; - if (myid == 0) + hypre_ParPrintf(comm, "A^2: %d x %d, nnz [CPU %d, GPU %d], CPU-GPU err %e\n", + hypre_ParCSRMatrixGlobalNumRows(parcsr_B_host2), + hypre_ParCSRMatrixGlobalNumCols(parcsr_B_host2), + hypre_ParCSRMatrixNumNonzeros(parcsr_B_host), + hypre_ParCSRMatrixNumNonzeros(parcsr_B_host2), + rfnorm); + } + + if (print_system) + { + if (!parcsr_B_host2) { - printf("A^2: %d x %d, nnz %d, CPU-GPU err %e\n", hypre_ParCSRMatrixGlobalNumRows(parcsr_B_host2), - hypre_ParCSRMatrixGlobalNumCols(parcsr_B_host2), - hypre_ParCSRMatrixNumNonzeros(parcsr_B_host2), - rfnorm); + parcsr_B_host2 = hypre_ParCSRMatrixClone_v2(parcsr_B, 1, HYPRE_MEMORY_HOST); } + sprintf(fname, "%s/%s", file_dir, "IJ.out.B"); + hypre_ParCSRMatrixPrintIJ(parcsr_B_host2, 0, 0, fname); + sprintf(fname, "%s/%s", file_dir, "IJ.out.B.CPU"); + hypre_ParCSRMatrixPrintIJ(parcsr_B_host, 0, 0, fname); } + hypre_ParCSRMatrixSetNumNonzeros(parcsr_B); + + hypre_ParPrintf(comm, "B %d x %d, NNZ %d, RNZ %d\n", hypre_ParCSRMatrixGlobalNumRows(parcsr_B), + hypre_ParCSRMatrixGlobalNumCols(parcsr_B), + hypre_ParCSRMatrixNumNonzeros(parcsr_B), + hypre_ParCSRMatrixNumNonzeros(parcsr_B) / hypre_ParCSRMatrixGlobalNumRows(parcsr_B)); + hypre_ParCSRMatrixDestroy(parcsr_B); + hypre_ParCSRMatrixDestroy(parcsr_A_host); + hypre_ParCSRMatrixDestroy(parcsr_B_host); + hypre_ParCSRMatrixDestroy(parcsr_B_host2); + hypre_ParCSRMatrixDestroy(parcsr_error_host); } void runjob2( HYPRE_ParCSRMatrix parcsr_A, HYPRE_Int print_system, + HYPRE_Int rep, + HYPRE_Int verify) +{ + HYPRE_Int i; + HYPRE_ParCSRMatrix parcsr_A_host = NULL; + HYPRE_ParCSRMatrix parcsr_B_host = NULL; + HYPRE_ParCSRMatrix parcsr_B_host2 = NULL; + HYPRE_ParCSRMatrix parcsr_B = NULL; + HYPRE_ParCSRMatrix parcsr_error_host = NULL; + HYPRE_Real fnorm, rfnorm, fnorm0; + HYPRE_Int time_index; + char fname[1024]; + + MPI_Comm comm = hypre_ParCSRMatrixComm(parcsr_A); + + hypre_ParPrintf(comm, "A %d x %d, NNZ %d, RNZ %d\n", hypre_ParCSRMatrixGlobalNumRows(parcsr_A), + hypre_ParCSRMatrixGlobalNumCols(parcsr_A), + hypre_ParCSRMatrixNumNonzeros(parcsr_A), + hypre_ParCSRMatrixNumNonzeros(parcsr_A) / hypre_ParCSRMatrixGlobalNumRows(parcsr_A)); + + hypre_assert(hypre_ParCSRMatrixMemoryLocation(parcsr_A) == HYPRE_MEMORY_DEVICE); + + hypre_MatvecCommPkgCreate(parcsr_A); + hypre_ParCSRMatrixCopyColMapOffdToDevice(parcsr_A); + + if (verify) + { + parcsr_A_host = hypre_ParCSRMatrixClone_v2(parcsr_A, 1, HYPRE_MEMORY_HOST); + hypre_MatvecCommPkgCreate(parcsr_A_host); + + time_index = hypre_InitializeTiming("Host Parcsr Matrix-by-Matrix, AT*A"); + + hypre_BeginTiming(time_index); + + parcsr_B_host = hypre_ParCSRTMatMat(parcsr_A_host, parcsr_A_host); + + hypre_EndTiming(time_index); + hypre_PrintTiming("Host Parcsr Matrix-by-Matrix, AT*A", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + hypre_ParCSRMatrixSetNumNonzeros(parcsr_B_host); + } + + if (print_system) + { + if (!parcsr_A_host) + { + parcsr_A_host = hypre_ParCSRMatrixClone_v2(parcsr_A, 1, HYPRE_MEMORY_HOST); + } + sprintf(fname, "%s/%s", file_dir, "IJ.out.A"); + hypre_ParCSRMatrixPrintIJ(parcsr_A_host, 0, 0, fname); + } + + for (i = 0 ; i < rep; i++) + { + hypre_ParPrintf(comm, "--- rep %d (out of %d) ---\n", i, rep); + + if (i == rep - 1) + { + time_index = hypre_InitializeTiming("Device Parcsr Matrix-by-Matrix, AT*A"); + hypre_BeginTiming(time_index); + //cudaProfilerStart(); + } + + parcsr_B = hypre_ParCSRTMatMatKT(parcsr_A, parcsr_A, 0); + + if (i == rep - 1) + { +#if defined(HYPRE_USING_GPU) + hypre_SyncDevice(); +#endif + //cudaProfilerStop(); + hypre_EndTiming(time_index); + hypre_PrintTiming("Device Parcsr Matrix-by-Matrix, AT*A", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + } + + if (i < rep - 1) + { + hypre_ParCSRMatrixDestroy(parcsr_B); + } + } + + if (verify) + { + parcsr_B_host2 = hypre_ParCSRMatrixClone_v2(parcsr_B, 1, HYPRE_MEMORY_HOST); + hypre_ParCSRMatrixSetNumNonzeros(parcsr_B_host2); + + hypre_ParCSRMatrixAdd(1.0, parcsr_B_host, -1.0, parcsr_B_host2, &parcsr_error_host); + fnorm = hypre_ParCSRMatrixFnorm(parcsr_error_host); + fnorm0 = hypre_ParCSRMatrixFnorm(parcsr_B_host); + rfnorm = fnorm0 > 0 ? fnorm / fnorm0 : fnorm; + + hypre_ParPrintf(comm, "A^T*A: %d x %d, nnz [CPU %d, GPU %d], CPU-GPU err %e\n", + hypre_ParCSRMatrixGlobalNumRows(parcsr_B_host2), + hypre_ParCSRMatrixGlobalNumCols(parcsr_B_host2), + hypre_ParCSRMatrixNumNonzeros(parcsr_B_host), + hypre_ParCSRMatrixNumNonzeros(parcsr_B_host2), + rfnorm); + } + + if (print_system) + { + sprintf(fname, "%s/%s", file_dir, "IJ.out.B"); + hypre_ParCSRMatrixPrintIJ(parcsr_B, 0, 0, fname); + sprintf(fname, "%s/%s", file_dir, "IJ.out.B.CPU"); + hypre_ParCSRMatrixPrintIJ(parcsr_B_host, 0, 0, fname); + } + + hypre_ParCSRMatrixSetNumNonzeros(parcsr_B); + + hypre_ParPrintf(comm, "B %d x %d, NNZ %d, RNZ %d\n", hypre_ParCSRMatrixGlobalNumRows(parcsr_B), + hypre_ParCSRMatrixGlobalNumCols(parcsr_B), + hypre_ParCSRMatrixNumNonzeros(parcsr_B), + hypre_ParCSRMatrixNumNonzeros(parcsr_B) / hypre_ParCSRMatrixGlobalNumRows(parcsr_B)); + + hypre_ParCSRMatrixDestroy(parcsr_B); + hypre_ParCSRMatrixDestroy(parcsr_A_host); + hypre_ParCSRMatrixDestroy(parcsr_B_host); + hypre_ParCSRMatrixDestroy(parcsr_B_host2); + hypre_ParCSRMatrixDestroy(parcsr_error_host); +} + +void runjob3( HYPRE_ParCSRMatrix parcsr_A, + HYPRE_ParCSRMatrix parcsr_P, + HYPRE_Int boolean_P, + HYPRE_Int print_system, + HYPRE_Int rap2, HYPRE_Int mult_order, + HYPRE_Int rep, HYPRE_Int verify) { - HYPRE_Int measure_type = 0; - HYPRE_Real trunc_factor = 0.0; - HYPRE_Int P_max_elmts = 8; - HYPRE_Int debug_flag = 0; - HYPRE_Int rap2=1; - HYPRE_Int keepTranspose = 0; - HYPRE_Int num_functions = 1; - HYPRE_Real strong_threshold = 0.25; - HYPRE_Real max_row_sum = 1.0; - HYPRE_Real fnorm, rfnorm, fnorm0; - HYPRE_Int local_num_vars, *coarse_pnts_global; - HYPRE_Int num_procs, myid; - HYPRE_Int time_index, i; + HYPRE_Int i; + char fname[1024]; + HYPRE_Int time_index; + HYPRE_Int keepTranspose = 0; + HYPRE_Real fnorm, rfnorm, fnorm0; - hypre_IntArray *CF_marker = NULL; - hypre_IntArray *coarse_dof_func = NULL; - HYPRE_ParCSRMatrix parcsr_S = NULL; - HYPRE_ParCSRMatrix parcsr_P = NULL; HYPRE_ParCSRMatrix parcsr_Q = NULL; HYPRE_ParCSRMatrix parcsr_AH = NULL; HYPRE_ParCSRMatrix parcsr_A_host = NULL; @@ -207,49 +370,42 @@ void runjob2( HYPRE_ParCSRMatrix parcsr_A, HYPRE_ParCSRMatrix parcsr_AH_host_2 = NULL; HYPRE_ParCSRMatrix parcsr_error_host = NULL; - hypre_MPI_Comm_size(hypre_MPI_COMM_WORLD, &num_procs ); - hypre_MPI_Comm_rank(hypre_MPI_COMM_WORLD, &myid ); + MPI_Comm comm = hypre_ParCSRMatrixComm(parcsr_A); - /* coarsening */ - hypre_BoomerAMGCreateS(parcsr_A, strong_threshold, max_row_sum, num_functions, NULL, &parcsr_S); - - hypre_BoomerAMGCoarsenPMIS(parcsr_S, parcsr_A, measure_type, debug_flag, &CF_marker); + hypre_ParPrintf(comm, "A %d x %d, NNZ %d\n", hypre_ParCSRMatrixGlobalNumRows(parcsr_A), + hypre_ParCSRMatrixGlobalNumCols(parcsr_A), hypre_ParCSRMatrixNumNonzeros(parcsr_A)); + hypre_ParPrintf(comm, "P %d x %d, NNZ %d\n", hypre_ParCSRMatrixGlobalNumRows(parcsr_P), + hypre_ParCSRMatrixGlobalNumCols(parcsr_P), hypre_ParCSRMatrixNumNonzeros(parcsr_P)); - local_num_vars = hypre_ParCSRMatrixNumRows(parcsr_A); - coarse_dof_func = NULL; - coarse_pnts_global = NULL; - - hypre_BoomerAMGCoarseParms(hypre_ParCSRMatrixComm(parcsr_A), local_num_vars, num_functions, NULL, - CF_marker, &coarse_dof_func, &coarse_pnts_global); + /* !!! */ + hypre_assert(hypre_ParCSRMatrixMemoryLocation(parcsr_A) == HYPRE_MEMORY_DEVICE); + hypre_assert(hypre_ParCSRMatrixMemoryLocation(parcsr_P) == HYPRE_MEMORY_DEVICE); - /* generate P */ - hypre_BoomerAMGBuildExtPIInterp(parcsr_A, hypre_IntArrayData(CF_marker), parcsr_S, coarse_pnts_global, - num_functions, NULL, debug_flag, trunc_factor, P_max_elmts, - &parcsr_P); + if (!hypre_ParCSRMatrixCommPkg(parcsr_A)) + { + hypre_MatvecCommPkgCreate(parcsr_A); + } - if (myid == 0) + if (!hypre_ParCSRMatrixCommPkg(parcsr_P)) { - hypre_printf("A %d x %d\n", hypre_ParCSRMatrixGlobalNumRows(parcsr_A), hypre_ParCSRMatrixGlobalNumCols(parcsr_A)); - hypre_printf("P %d x %d\n", hypre_ParCSRMatrixGlobalNumRows(parcsr_P), hypre_ParCSRMatrixGlobalNumCols(parcsr_P)); + hypre_MatvecCommPkgCreate(parcsr_P); } - /* !!! */ - hypre_assert(hypre_ParCSRMatrixMemoryLocation(parcsr_A) == HYPRE_MEMORY_DEVICE); - hypre_assert(hypre_ParCSRMatrixMemoryLocation(parcsr_P) == HYPRE_MEMORY_DEVICE); + hypre_ParCSRMatrixSetPatternOnly(parcsr_P, boolean_P); /*----------------------------------------------------------- * Matrix-by-Matrix on host *-----------------------------------------------------------*/ if (verify) { - hypre_printf("Clone matrices to the host\n"); + //hypre_ParPrintf("Clone matrices to the host\n"); parcsr_A_host = hypre_ParCSRMatrixClone_v2(parcsr_A, 1, HYPRE_MEMORY_HOST); parcsr_P_host = hypre_ParCSRMatrixClone_v2(parcsr_P, 1, HYPRE_MEMORY_HOST); hypre_MatvecCommPkgCreate(parcsr_A_host); hypre_MatvecCommPkgCreate(parcsr_P_host); - time_index = hypre_InitializeTiming("Host Parcsr Matrix-by-Matrix, RAP2"); + time_index = hypre_InitializeTiming("Host Parcsr Matrix-by-Matrix, RAP"); hypre_BeginTiming(time_index); if (mult_order == 0) @@ -263,9 +419,11 @@ void runjob2( HYPRE_ParCSRMatrix parcsr_A, parcsr_AH_host = hypre_ParCSRMatMat(parcsr_Q_host, parcsr_P_host); } hypre_EndTiming(time_index); - hypre_PrintTiming("Host Parcsr Matrix-by-Matrix, RAP2", hypre_MPI_COMM_WORLD); + hypre_PrintTiming("Host Parcsr Matrix-by-Matrix, RAP", hypre_MPI_COMM_WORLD); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); + + hypre_ParCSRMatrixSetNumNonzeros(parcsr_AH_host); } /*----------------------------------------------------------- @@ -273,8 +431,10 @@ void runjob2( HYPRE_ParCSRMatrix parcsr_A, *-----------------------------------------------------------*/ if (print_system) { - hypre_CSRMatrixPrintMM(hypre_ParCSRMatrixDiag(parcsr_A_host), 1, 1, 0, "/p/gpfs1/li50/A.mtx"); - hypre_CSRMatrixPrintMM(hypre_ParCSRMatrixDiag(parcsr_P_host), 1, 1, 0, "/p/gpfs1/li50/P.mtx"); + sprintf(fname, "%s/%s", file_dir, "IJ.out.A"); + hypre_ParCSRMatrixPrintIJ(parcsr_A_host, 0, 0, fname); + sprintf(fname, "%s/%s", file_dir, "IJ.out.P"); + hypre_ParCSRMatrixPrintIJ(parcsr_P_host, 0, 0, fname); } /*----------------------------------------------------------- @@ -283,11 +443,13 @@ void runjob2( HYPRE_ParCSRMatrix parcsr_A, /* run for the first time without timing [some allocation is done] */ /* run for a second time for timing */ - for (i = 0 ; i < 2; i++) + for (i = 0 ; i < rep; i++) { - if (i == 1) + hypre_ParPrintf(comm, "--- rep %d (out of %d) ---\n", i, rep); + + if (i == rep - 1) { - time_index = hypre_InitializeTiming("Device Parcsr Matrix-by-Matrix, RAP2"); + time_index = hypre_InitializeTiming("Device Parcsr Matrix-by-Matrix, RAP"); hypre_BeginTiming(time_index); //cudaProfilerStart(); } @@ -310,17 +472,19 @@ void runjob2( HYPRE_ParCSRMatrix parcsr_A, parcsr_AH = hypre_ParCSRMatrixRAPKT(parcsr_P, parcsr_A, parcsr_P, keepTranspose); } - if (i == 1) + if (i == rep - 1) { - hypre_SyncCudaDevice(hypre_handle()); +#if defined(HYPRE_USING_GPU) + hypre_SyncDevice(); +#endif //cudaProfilerStop(); hypre_EndTiming(time_index); - hypre_PrintTiming("Device Parcsr Matrix-by-Matrix, RAP2", hypre_MPI_COMM_WORLD); + hypre_PrintTiming("Device Parcsr Matrix-by-Matrix, RAP", hypre_MPI_COMM_WORLD); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); } - if (i == 0) + if (i < rep - 1) { hypre_ParCSRMatrixDestroy(parcsr_Q); hypre_ParCSRMatrixDestroy(parcsr_AH); @@ -340,23 +504,23 @@ void runjob2( HYPRE_ParCSRMatrix parcsr_A, fnorm0 = hypre_ParCSRMatrixFnorm(parcsr_AH_host); rfnorm = fnorm0 > 0 ? fnorm / fnorm0 : fnorm; - if (myid == 0) - { - printf("AH: %d x %d, nnz %d, CPU-GPU err %e\n", hypre_ParCSRMatrixGlobalNumRows(parcsr_AH_host_2), - hypre_ParCSRMatrixGlobalNumCols(parcsr_AH_host_2), - hypre_ParCSRMatrixNumNonzeros(parcsr_AH_host_2), - rfnorm); - } + hypre_ParPrintf(comm, "AH: %d x %d, nnz [CPU %d, GPU %d], CPU-GPU err %e\n", + hypre_ParCSRMatrixGlobalNumRows(parcsr_AH_host_2), + hypre_ParCSRMatrixGlobalNumCols(parcsr_AH_host_2), + hypre_ParCSRMatrixNumNonzeros(parcsr_AH_host), + hypre_ParCSRMatrixNumNonzeros(parcsr_AH_host_2), + rfnorm); } - hypre_IntArrayDestroy(CF_marker); - hypre_TFree(coarse_dof_func, HYPRE_MEMORY_HOST); + hypre_ParCSRMatrixSetNumNonzeros(parcsr_AH); + + hypre_ParPrintf(comm, "AH %d x %d, NNZ %d, RNZ %d\n", hypre_ParCSRMatrixGlobalNumRows(parcsr_AH), + hypre_ParCSRMatrixGlobalNumCols(parcsr_AH), + hypre_ParCSRMatrixNumNonzeros(parcsr_AH), + hypre_ParCSRMatrixNumNonzeros(parcsr_AH) / hypre_ParCSRMatrixGlobalNumRows(parcsr_AH)); - hypre_ParCSRMatrixDestroy(parcsr_S); - hypre_ParCSRMatrixDestroy(parcsr_P); hypre_ParCSRMatrixDestroy(parcsr_Q); hypre_ParCSRMatrixDestroy(parcsr_AH); - hypre_ParCSRMatrixDestroy(parcsr_A_host); hypre_ParCSRMatrixDestroy(parcsr_P_host); hypre_ParCSRMatrixDestroy(parcsr_Q_host); @@ -365,6 +529,225 @@ void runjob2( HYPRE_ParCSRMatrix parcsr_A, hypre_ParCSRMatrixDestroy(parcsr_error_host); } +void runjob4( HYPRE_ParCSRMatrix parcsr_A, + HYPRE_Int print_system, + HYPRE_Int rap2, + HYPRE_Int mult_order, + HYPRE_Int rep, + HYPRE_Int verify) +{ + HYPRE_Int measure_type = 0; + HYPRE_Real trunc_factor = 0.0; + HYPRE_Int P_max_elmts = 8; + HYPRE_Int debug_flag = 0; + HYPRE_Int num_functions = 1; + HYPRE_Real strong_threshold = 0.25; + HYPRE_Real max_row_sum = 1.0; + HYPRE_Int local_num_vars; + HYPRE_BigInt coarse_pnts_global[2]; + + hypre_IntArray *CF_marker = NULL; + HYPRE_ParCSRMatrix parcsr_S = NULL; + HYPRE_ParCSRMatrix parcsr_P = NULL; + + /* coarsening */ + hypre_BoomerAMGCreateS(parcsr_A, strong_threshold, max_row_sum, num_functions, NULL, &parcsr_S); + + hypre_BoomerAMGCoarsenPMIS(parcsr_S, parcsr_A, measure_type, debug_flag, &CF_marker); + + local_num_vars = hypre_ParCSRMatrixNumRows(parcsr_A); + + hypre_BoomerAMGCoarseParms(hypre_ParCSRMatrixComm(parcsr_A), local_num_vars, num_functions, NULL, + CF_marker, NULL, coarse_pnts_global); + + /* generate P */ + hypre_BoomerAMGBuildExtPIInterp(parcsr_A, hypre_IntArrayData(CF_marker), parcsr_S, + coarse_pnts_global, + num_functions, NULL, debug_flag, trunc_factor, P_max_elmts, + &parcsr_P); + + runjob3(parcsr_A, parcsr_P, 0, print_system, rap2, mult_order, rep, verify); + + hypre_IntArrayDestroy(CF_marker); + hypre_ParCSRMatrixDestroy(parcsr_S); + hypre_ParCSRMatrixDestroy(parcsr_P); +} + +void runjob5( HYPRE_ParCSRMatrix parcsr_A, + HYPRE_Int print_system, + HYPRE_Int rep, + HYPRE_Int verify) +{ +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + HYPRE_Int i; + HYPRE_ParCSRMatrix parcsr_B = NULL; + HYPRE_ParCSRMatrix parcsr_A_host = NULL; + HYPRE_ParCSRMatrix parcsr_B_host = NULL; + HYPRE_ParCSRMatrix parcsr_error_host = NULL; + HYPRE_Real fnorm, rfnorm, fnorm0; + HYPRE_Int time_index; + char fname[1024]; + + MPI_Comm comm = hypre_ParCSRMatrixComm(parcsr_A); + + hypre_ParPrintf(comm, "A %d x %d, NNZ %d, RNZ %d\n", hypre_ParCSRMatrixGlobalNumRows(parcsr_A), + hypre_ParCSRMatrixGlobalNumCols(parcsr_A), + hypre_ParCSRMatrixNumNonzeros(parcsr_A), + hypre_ParCSRMatrixNumNonzeros(parcsr_A) / hypre_ParCSRMatrixGlobalNumRows(parcsr_A)); + + hypre_assert(hypre_ParCSRMatrixMemoryLocation(parcsr_A) == HYPRE_MEMORY_DEVICE); + + // D = diag(diag(A)) + HYPRE_ParCSRMatrix parcsr_D = hypre_ParCSRMatrixCreate(hypre_ParCSRMatrixComm(parcsr_A), + hypre_ParCSRMatrixGlobalNumRows(parcsr_A), + hypre_ParCSRMatrixGlobalNumCols(parcsr_A), + hypre_ParCSRMatrixRowStarts(parcsr_A), + hypre_ParCSRMatrixColStarts(parcsr_A), + 0, + hypre_ParCSRMatrixNumRows(parcsr_A), + 0); + hypre_CSRMatrixDestroy(hypre_ParCSRMatrixDiag(parcsr_D)); + hypre_ParCSRMatrixDiag(parcsr_D) = hypre_CSRMatrixDiagMatrixFromMatrixDevice(hypre_ParCSRMatrixDiag( + parcsr_A), 0); + + // Diag Scale on host + if (verify) + { + parcsr_A_host = hypre_ParCSRMatrixClone_v2(parcsr_A, 1, HYPRE_MEMORY_HOST); + hypre_Vector *vec_d_host = hypre_SeqVectorCreate(hypre_ParCSRMatrixNumRows(parcsr_A_host)); + hypre_SeqVectorInitialize_v2(vec_d_host, HYPRE_MEMORY_HOST); + + hypre_CSRMatrixExtractDiagonal(hypre_ParCSRMatrixDiag(parcsr_A_host), + hypre_VectorData(vec_d_host), 0); + + time_index = hypre_InitializeTiming("Host Parcsr DiagScale Matrix, Diag(A)*A"); + hypre_BeginTiming(time_index); + + hypre_CSRMatrixDiagScale(hypre_ParCSRMatrixDiag(parcsr_A_host), vec_d_host, NULL); + hypre_CSRMatrixDiagScale(hypre_ParCSRMatrixOffd(parcsr_A_host), vec_d_host, NULL); + + hypre_EndTiming(time_index); + hypre_PrintTiming("Host Parcsr DiagScale Matrix, Diag(A)*A", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + hypre_SeqVectorDestroy(vec_d_host); + } + + // [FAST] diag scale using vector + { + HYPRE_ParCSRMatrix parcsr_C = hypre_ParCSRMatrixClone_v2(parcsr_A, 1, HYPRE_MEMORY_DEVICE); + hypre_Vector *vec_d = hypre_SeqVectorCreate(hypre_ParCSRMatrixNumRows(parcsr_C)); + hypre_SeqVectorInitialize_v2(vec_d, HYPRE_MEMORY_DEVICE); + + hypre_CSRMatrixExtractDiagonal(hypre_ParCSRMatrixDiag(parcsr_C), + hypre_VectorData(vec_d), 0); + + for (i = 0 ; i < rep; i++) + { + if (i == rep - 1) + { + time_index = hypre_InitializeTiming("Device Parcsr DiagScale Matrix"); + hypre_BeginTiming(time_index); + } + + hypre_CSRMatrixDiagScale(hypre_ParCSRMatrixDiag(parcsr_C), vec_d, NULL); + hypre_CSRMatrixDiagScale(hypre_ParCSRMatrixOffd(parcsr_C), vec_d, NULL); + + if (i == rep - 1) + { +#if defined(HYPRE_USING_GPU) + hypre_SyncDevice(); +#endif + hypre_EndTiming(time_index); + hypre_PrintTiming("Device Parcsr DiagScale Matrix", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + } + } + + hypre_ParCSRMatrixDestroy(parcsr_C); + hypre_SeqVectorDestroy(vec_d); + } + + // [SLOW] Diag-by-Matrix + for (i = 0 ; i < rep; i++) + { + hypre_ParPrintf(comm, "--- rep %d (out of %d) ---\n", i, rep); + + if (i == rep - 1) + { + time_index = hypre_InitializeTiming("Device Parcsr Matrix-by-Matrix, Diag(A)*A"); + hypre_BeginTiming(time_index); + } + + parcsr_B = hypre_ParCSRMatMat(parcsr_D, parcsr_A); + + if (i == rep - 1) + { +#if defined(HYPRE_USING_GPU) + hypre_SyncDevice(); +#endif + hypre_EndTiming(time_index); + hypre_PrintTiming("Device Parcsr Matrix-by-Matrix, Diag(A)*A", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + } + + if (i < rep - 1) + { + hypre_ParCSRMatrixDestroy(parcsr_B); + } + } + + if (verify) + { + parcsr_B_host = hypre_ParCSRMatrixClone_v2(parcsr_B, 1, HYPRE_MEMORY_HOST); + hypre_ParCSRMatrixSetNumNonzeros(parcsr_B_host); + + hypre_ParCSRMatrixAdd(1.0, parcsr_A_host, -1.0, parcsr_B_host, &parcsr_error_host); + fnorm = hypre_ParCSRMatrixFnorm(parcsr_error_host); + fnorm0 = hypre_ParCSRMatrixFnorm(parcsr_B_host); + rfnorm = fnorm0 > 0 ? fnorm / fnorm0 : fnorm; + + hypre_ParPrintf(comm, "Diag(A)*A: %d x %d, nnz [CPU %d, GPU %d], CPU-GPU err %e\n", + hypre_ParCSRMatrixGlobalNumRows(parcsr_B_host), + hypre_ParCSRMatrixGlobalNumCols(parcsr_B_host), + hypre_ParCSRMatrixNumNonzeros(parcsr_A_host), + hypre_ParCSRMatrixNumNonzeros(parcsr_B_host), + rfnorm); + } + + if (print_system) + { + if (!parcsr_B_host) + { + parcsr_B_host = hypre_ParCSRMatrixClone_v2(parcsr_B, 1, HYPRE_MEMORY_HOST); + } + sprintf(fname, "%s/%s", file_dir, "IJ.out.B"); + hypre_ParCSRMatrixPrintIJ(parcsr_B_host, 0, 0, fname); + } + + hypre_ParCSRMatrixSetNumNonzeros(parcsr_B); + + hypre_ParPrintf(comm, "B %d x %d, NNZ %d, RNZ %d\n", hypre_ParCSRMatrixGlobalNumRows(parcsr_B), + hypre_ParCSRMatrixGlobalNumCols(parcsr_B), + hypre_ParCSRMatrixNumNonzeros(parcsr_B), + hypre_ParCSRMatrixNumNonzeros(parcsr_B) / hypre_ParCSRMatrixGlobalNumRows(parcsr_B)); + + hypre_ParCSRMatrixDestroy(parcsr_B); + hypre_ParCSRMatrixDestroy(parcsr_A_host); + hypre_ParCSRMatrixDestroy(parcsr_B_host); + hypre_ParCSRMatrixDestroy(parcsr_D); + hypre_ParCSRMatrixDestroy(parcsr_error_host); +#else + HYPRE_UNUSED_VAR(parcsr_A); + HYPRE_UNUSED_VAR(print_system); + HYPRE_UNUSED_VAR(rep); + HYPRE_UNUSED_VAR(verify); +#endif +} + hypre_int main( hypre_int argc, char *argv[] ) @@ -375,25 +758,29 @@ main( hypre_int argc, HYPRE_Int build_matrix_arg_index; HYPRE_Int ierr = 0; void *object; - HYPRE_IJMatrix ij_A = NULL; - HYPRE_ParCSRMatrix parcsr_A = NULL; - HYPRE_Int errcode, job = 2; - HYPRE_Int num_procs, myid; - HYPRE_Int time_index; - MPI_Comm comm = hypre_MPI_COMM_WORLD; - HYPRE_Int first_local_row, last_local_row;//, local_num_rows; - HYPRE_Int first_local_col, last_local_col;//, local_num_cols; - HYPRE_Int mult_order = 0; - - HYPRE_Int print_system = 0; - HYPRE_Int verify = 0; - HYPRE_Int use_cusparse = 0; - HYPRE_Int spgemm_alg = 1; - HYPRE_Int rowest_mtd = 3; - HYPRE_Int rowest_nsamples = 32; - HYPRE_Real rowest_mult = 1.0; - HYPRE_Int zero_mem_cost = 0; - char hash_type = 'L'; + HYPRE_IJMatrix ij_A = NULL; + HYPRE_IJMatrix ij_P = NULL; + HYPRE_ParCSRMatrix parcsr_A = NULL; + HYPRE_ParCSRMatrix parcsr_P = NULL; + HYPRE_Int errcode, job = 1; + HYPRE_Int num_procs, myid; + HYPRE_Int time_index; + MPI_Comm comm = hypre_MPI_COMM_WORLD; + HYPRE_BigInt first_local_row, last_local_row; + HYPRE_BigInt first_local_col, last_local_col; + HYPRE_Int rap2 = 0; + HYPRE_Int mult_order = 0; + HYPRE_Int print_system = 0; + HYPRE_Int verify = 0; + HYPRE_Int use_vendor = 0; + HYPRE_Int spgemm_alg = 1; + HYPRE_Int spgemm_binned = 0; + HYPRE_Int rowest_mtd = 3; + HYPRE_Int rowest_nsamples = -1; /* default */ + HYPRE_Real rowest_mult = -1.0; /* default */ + HYPRE_Int zero_mem_cost = 0; + HYPRE_Int boolean_P = 1; + HYPRE_Int rep = 10; /*----------------------------------------------------------- * Initialize some stuff @@ -406,24 +793,33 @@ main( hypre_int argc, /*----------------------------------------------------------------- * GPU Device binding - * Must be done before HYPRE_Init() and should not be changed after + * Must be done before HYPRE_Initialize() and should not be changed after *-----------------------------------------------------------------*/ - hypre_bind_device(myid, num_procs, hypre_MPI_COMM_WORLD); + hypre_bind_device_id(-1, myid, num_procs, hypre_MPI_COMM_WORLD); /*----------------------------------------------------------- * Initialize : must be the first HYPRE function to call *-----------------------------------------------------------*/ - HYPRE_Init(); + HYPRE_Initialize(); + HYPRE_DeviceInitialize(); + + if (myid == 0) + { + HYPRE_PrintDeviceInfo(); + } /* for timing, sync after kernels */ +#if defined(HYPRE_USING_GPU) hypre_SetSyncCudaCompute(1); - -#if defined(HYPRE_USING_CUDA) - hypre_HandleDefaultExecPolicy(hypre_handle()) = HYPRE_EXEC_DEVICE; #endif + HYPRE_SetExecutionPolicy(HYPRE_EXEC_DEVICE); + //hypre_SetNumThreads(20); - hypre_printf("CPU #OMP THREADS %d\n", hypre_NumThreads()); + if (myid == 0) + { + hypre_printf("CPU #OMP THREADS %d\n", hypre_NumThreads()); + } /*----------------------------------------------------------- * Set defaults @@ -440,7 +836,13 @@ main( hypre_int argc, while ( (arg_index < argc) && (!print_usage) ) { - if ( strcmp(argv[arg_index], "-fromfile") == 0 ) + if ( strcmp(argv[arg_index], "-fromMMfile") == 0 ) + { + arg_index++; + build_matrix_type = -2; + build_matrix_arg_index = arg_index; + } + else if ( strcmp(argv[arg_index], "-fromfile") == 0 ) { arg_index++; build_matrix_type = -1; @@ -452,11 +854,12 @@ main( hypre_int argc, build_matrix_type = 0; build_matrix_arg_index = arg_index; } - else if ( strcmp(argv[arg_index], "-fromonecsrfile") == 0 ) + else if ( strcmp(argv[arg_index], "-from2files") == 0 ) { arg_index++; build_matrix_type = 1; build_matrix_arg_index = arg_index; + arg_index++; } else if ( strcmp(argv[arg_index], "-laplacian") == 0 ) { @@ -509,21 +912,31 @@ main( hypre_int argc, arg_index++; verify = atoi(argv[arg_index++]); } + else if ( strcmp(argv[arg_index], "-rap2") == 0 ) + { + arg_index++; + rap2 = atoi(argv[arg_index++]); + } else if ( strcmp(argv[arg_index], "-order") == 0 ) { arg_index++; mult_order = atoi(argv[arg_index++]); } - else if ( strcmp(argv[arg_index], "-cusparse") == 0 ) + else if ( strcmp(argv[arg_index], "-vendor") == 0 ) { arg_index++; - use_cusparse = 1; + use_vendor = atoi(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-spgemmalg") == 0 ) { arg_index++; spgemm_alg = atoi(argv[arg_index++]); } + else if ( strcmp(argv[arg_index], "-spgemm_binned") == 0 ) + { + arg_index++; + spgemm_binned = atoi(argv[arg_index++]); + } else if ( strcmp(argv[arg_index], "-rowest") == 0 ) { arg_index++; @@ -532,7 +945,7 @@ main( hypre_int argc, else if ( strcmp(argv[arg_index], "-rowestmult") == 0 ) { arg_index++; - rowest_mult = atof(argv[arg_index++]); + rowest_mult = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-rowestnsamples") == 0 ) { @@ -544,16 +957,20 @@ main( hypre_int argc, arg_index++; job = atoi(argv[arg_index++]); } - else if ( strcmp(argv[arg_index], "-hash") == 0 ) + else if ( strcmp(argv[arg_index], "-rep") == 0 ) { arg_index++; - hash_type = argv[arg_index++][0]; + rep = atoi(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-zeromemcost") == 0 ) { arg_index++; zero_mem_cost = atoi(argv[arg_index++]); } + else if ( strcmp(argv[arg_index], "-help") == 0 ) + { + print_usage = 1; + } else { arg_index++; @@ -565,7 +982,7 @@ main( hypre_int argc, #ifdef HYPRE_USING_CUDA total_size = 15LL * 1024 * 1024 * 1024; #elif defined(HYPRE_USING_HIP) - total_size = 31LL * 1024 * 1024 * 1024; + total_size = 20LL * 1024 * 1024 * 1024; #endif gpu_ptr = hypre_TAlloc(char, total_size, HYPRE_MEMORY_DEVICE); hypre_SetUserDeviceMalloc(gpu_alloc); @@ -604,12 +1021,11 @@ main( hypre_int argc, hypre_printf(" 0=Forward (default) 1=Backward\n"); hypre_printf(" 2=Centered 3=Upwind\n"); hypre_printf("\n"); - hypre_printf(" -exact_size : inserts immediately into ParCSR structure\n"); - hypre_printf(" -storage_low : allocates not enough storage for aux struct\n"); hypre_printf(" -concrete_parcsr : use parcsr matrix type as concrete type\n"); hypre_printf("\n"); - - hypre_printf(" -Pmx : set maximal no. of elmts per row for AMG interpolation (default: 4)\n"); + hypre_printf(" -job : 1. A^2 2. A^T*A 3. P^T*A*P\n"); + hypre_printf(" 4. P^T*A*P (P is AMG Interp from A)\n"); + hypre_printf(" 5. Diag(A) * A\n"); } goto final; } @@ -619,23 +1035,39 @@ main( hypre_int argc, *-----------------------------------------------------------*/ errcode = hypre_SetSpGemmRownnzEstimateMethod(rowest_mtd); hypre_assert(errcode == 0); - errcode = hypre_SetSpGemmRownnzEstimateNSamples(rowest_nsamples); - hypre_assert(errcode == 0); - errcode = hypre_SetSpGemmRownnzEstimateMultFactor(rowest_mult); - hypre_assert(errcode == 0); - errcode = hypre_SetSpGemmHashType(hash_type); - hypre_assert(errcode == 0); - errcode = HYPRE_SetSpGemmUseCusparse(use_cusparse); + if (rowest_nsamples > 0) + { + errcode = hypre_SetSpGemmRownnzEstimateNSamples(rowest_nsamples); + hypre_assert(errcode == 0); + } + if (rowest_mult > 0.0) + { + errcode = hypre_SetSpGemmRownnzEstimateMultFactor(rowest_mult); + hypre_assert(errcode == 0); + } + errcode = HYPRE_SetSpGemmUseVendor(use_vendor); hypre_assert(errcode == 0); errcode = hypre_SetSpGemmAlgorithm(spgemm_alg); hypre_assert(errcode == 0); + ierr = hypre_SetSpGemmBinned(spgemm_binned); + hypre_assert(ierr == 0); /*----------------------------------------------------------- * Set up matrix *-----------------------------------------------------------*/ - time_index = hypre_InitializeTiming("Generate Matrix A"); + time_index = hypre_InitializeTiming("Generate Matrices"); hypre_BeginTiming(time_index); - if ( build_matrix_type == -1 ) + if ( build_matrix_type == -2 ) + { + ierr = HYPRE_IJMatrixReadMM( argv[build_matrix_arg_index], comm, + HYPRE_PARCSR, &ij_A ); + if (ierr) + { + hypre_printf("ERROR: Problem reading in the system matrix in MM format!\n"); + exit(1); + } + } + else if ( build_matrix_type == -1 ) { ierr = HYPRE_IJMatrixRead( argv[build_matrix_arg_index], comm, HYPRE_PARCSR, &ij_A ); @@ -649,6 +1081,18 @@ main( hypre_int argc, { BuildParFromFile(argc, argv, build_matrix_arg_index, &parcsr_A); } + else if ( build_matrix_type == 1 ) + { + HYPRE_Int ierr1 = HYPRE_IJMatrixRead( argv[build_matrix_arg_index], comm, + HYPRE_PARCSR, &ij_A ); + HYPRE_Int ierr2 = HYPRE_IJMatrixRead( argv[build_matrix_arg_index + 1], comm, + HYPRE_PARCSR, &ij_P ); + if (ierr1 || ierr2) + { + hypre_printf("ERROR: Problem reading in the system matrix!\n"); + exit(1); + } + } else if ( build_matrix_type == 2 ) { BuildParLaplacian(argc, argv, build_matrix_arg_index, &parcsr_A); @@ -673,13 +1117,14 @@ main( hypre_int argc, { hypre_printf("You have asked for an unsupported problem with\n"); hypre_printf("build_matrix_type = %d.\n", build_matrix_type); - return(-1); + return (-1); } - if (build_matrix_type < 0) + /* first matrix */ + if (ij_A) { ierr = HYPRE_IJMatrixGetLocalRange( ij_A, - &first_local_row, &last_local_row , + &first_local_row, &last_local_row, &first_local_col, &last_local_col ); ierr += HYPRE_IJMatrixGetObject( ij_A, &object); @@ -691,31 +1136,60 @@ main( hypre_int argc, * Copy the parcsr matrix into the IJMatrix through interface calls *-----------------------------------------------------------*/ ierr = HYPRE_ParCSRMatrixGetLocalRange( parcsr_A, - &first_local_row, &last_local_row , + &first_local_row, &last_local_row, &first_local_col, &last_local_col ); + } + + hypre_ParCSRMatrixSetNumNonzeros(parcsr_A); - //local_num_rows = last_local_row - first_local_row + 1; - //local_num_cols = last_local_col - first_local_col + 1; + /* [optional] second matrix */ + if (ij_P) + { + ierr += HYPRE_IJMatrixGetObject( ij_P, &object); + parcsr_P = (HYPRE_ParCSRMatrix) object; + } + + if (parcsr_P) + { + hypre_ParCSRMatrixSetNumNonzeros(parcsr_P); } hypre_EndTiming(time_index); - hypre_PrintTiming("Generate Matrix A", hypre_MPI_COMM_WORLD); + hypre_PrintTiming("Generate Matrices", hypre_MPI_COMM_WORLD); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); + hypre_ParCSRMatrixMigrate(parcsr_A, hypre_HandleMemoryLocation(hypre_handle())); + if (parcsr_P) + { + hypre_ParCSRMatrixMigrate(parcsr_P, hypre_HandleMemoryLocation(hypre_handle())); + } + if (job == 1) { - runjob1(parcsr_A, print_system, verify); + runjob1(parcsr_A, print_system, rep, verify); } else if (job == 2) { - runjob2(parcsr_A, print_system, mult_order, verify); + runjob2(parcsr_A, print_system, rep, verify); + } + else if (job == 3) + { + runjob3(parcsr_A, parcsr_P, boolean_P, print_system, rap2, mult_order, rep, verify); + } + else if (job == 4) + { + runjob4(parcsr_A, print_system, rap2, mult_order, rep, verify); + } + else if (job == 5) + { + runjob5(parcsr_A, print_system, rep, verify); } /*----------------------------------------------------------- * Finalize things *-----------------------------------------------------------*/ - if (build_matrix_type == -1) + if (ij_A) { HYPRE_IJMatrixDestroy(ij_A); } @@ -724,7 +1198,14 @@ main( hypre_int argc, HYPRE_ParCSRMatrixDestroy(parcsr_A); } - final: + if (ij_P) + { + HYPRE_IJMatrixDestroy(ij_P); + } + +final: + + hypre_TFree(gpu_ptr, HYPRE_MEMORY_DEVICE); /* Finalize Hypre */ HYPRE_Finalize(); @@ -732,10 +1213,6 @@ main( hypre_int argc, /* Finalize MPI */ hypre_MPI_Finalize(); - hypre_printf("Done ...\n"); - - hypre_TFree(gpu_ptr, HYPRE_MEMORY_DEVICE); - return (0); } @@ -793,7 +1270,7 @@ BuildParFromFile( HYPRE_Int argc, * Generate the matrix *-----------------------------------------------------------*/ - HYPRE_ParCSRMatrixRead(hypre_MPI_COMM_WORLD, filename,&A); + HYPRE_ParCSRMatrixRead(hypre_MPI_COMM_WORLD, filename, &A); *A_ptr = A; @@ -853,7 +1330,7 @@ BuildParRhsFromFile( HYPRE_Int argc, * Generate the matrix *-----------------------------------------------------------*/ - HYPRE_ParVectorRead(hypre_MPI_COMM_WORLD, filename,&b); + HYPRE_ParVectorRead(hypre_MPI_COMM_WORLD, filename, &b); *b_ptr = b; @@ -939,9 +1416,9 @@ BuildParLaplacian( HYPRE_Int argc, else if ( strcmp(argv[arg_index], "-c") == 0 ) { arg_index++; - cx = atof(argv[arg_index++]); - cy = atof(argv[arg_index++]); - cz = atof(argv[arg_index++]); + cx = (HYPRE_Real)atof(argv[arg_index++]); + cy = (HYPRE_Real)atof(argv[arg_index++]); + cz = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-sysL") == 0 ) { @@ -967,7 +1444,7 @@ BuildParLaplacian( HYPRE_Int argc, else if ( strcmp(argv[arg_index], "-ep") == 0 ) { arg_index++; - ep = atof(argv[arg_index++]); + ep = (HYPRE_Real)atof(argv[arg_index++]); } else { @@ -979,7 +1456,7 @@ BuildParLaplacian( HYPRE_Int argc, * Check a few things *-----------------------------------------------------------*/ - if ((P*Q*R) != num_procs) + if ((P * Q * R) != num_procs) { hypre_printf("Error: Invalid number of processors or processor topology \n"); exit(1); @@ -1003,8 +1480,8 @@ BuildParLaplacian( HYPRE_Int argc, /* compute p,q,r from P,Q,R and myid */ p = myid % P; - q = (( myid - p)/P) % Q; - r = ( myid - p - P*q)/( P*Q ); + q = (( myid - p) / P) % Q; + r = ( myid - p - P * q) / ( P * Q ); /*----------------------------------------------------------- * Generate the matrix @@ -1019,15 +1496,15 @@ BuildParLaplacian( HYPRE_Int argc, values[0] = 0.; if (nx > 1) { - values[0] += 2.0*cx; + values[0] += 2.0 * cx; } if (ny > 1) { - values[0] += 2.0*cy; + values[0] += 2.0 * cy; } if (nz > 1) { - values[0] += 2.0*cz; + values[0] += 2.0 * cz; } if (num_fun == 1) @@ -1035,46 +1512,46 @@ BuildParLaplacian( HYPRE_Int argc, nx, ny, nz, P, Q, R, p, q, r, values); else { - mtrx = hypre_CTAlloc(HYPRE_Real, num_fun*num_fun, HYPRE_MEMORY_HOST); + mtrx = hypre_CTAlloc(HYPRE_Real, num_fun * num_fun, HYPRE_MEMORY_HOST); if (num_fun == 2) { - if (sys_opt ==1) /* identity */ + if (sys_opt == 1) /* identity */ { mtrx[0] = 1.0; mtrx[1] = 0.0; mtrx[2] = 0.0; mtrx[3] = 1.0; } - else if (sys_opt ==2) + else if (sys_opt == 2) { mtrx[0] = 1.0; mtrx[1] = 0.0; mtrx[2] = 0.0; mtrx[3] = 20.0; } - else if (sys_opt ==3) /* similar to barry's talk - ex1 */ + else if (sys_opt == 3) /* similar to barry's talk - ex1 */ { mtrx[0] = 1.0; mtrx[1] = 2.0; mtrx[2] = 2.0; mtrx[3] = 1.0; } - else if (sys_opt ==4) /* can use with vcoef to get barry's ex*/ + else if (sys_opt == 4) /* can use with vcoef to get barry's ex*/ { mtrx[0] = 1.0; mtrx[1] = 1.0; mtrx[2] = 1.0; mtrx[3] = 1.0; } - else if (sys_opt ==5) /* barry's talk - ex1 */ + else if (sys_opt == 5) /* barry's talk - ex1 */ { mtrx[0] = 1.0; mtrx[1] = 1.1; mtrx[2] = 1.1; mtrx[3] = 1.0; } - else if (sys_opt ==6) /* */ + else if (sys_opt == 6) /* */ { mtrx[0] = 1.1; mtrx[1] = 1.0; @@ -1092,7 +1569,7 @@ BuildParLaplacian( HYPRE_Int argc, } else if (num_fun == 3) { - if (sys_opt ==1) + if (sys_opt == 1) { mtrx[0] = 1.0; mtrx[1] = 0.0; @@ -1104,7 +1581,7 @@ BuildParLaplacian( HYPRE_Int argc, mtrx[7] = 0.0; mtrx[8] = 1.0; } - else if (sys_opt ==2) + else if (sys_opt == 2) { mtrx[0] = 1.0; mtrx[1] = 0.0; @@ -1114,9 +1591,9 @@ BuildParLaplacian( HYPRE_Int argc, mtrx[5] = 0.0; mtrx[6] = 0.0; mtrx[7] = 0.0; - mtrx[8] =.01; + mtrx[8] = .01; } - else if (sys_opt ==3) + else if (sys_opt == 3) { mtrx[0] = 1.01; mtrx[1] = 1; @@ -1128,7 +1605,7 @@ BuildParLaplacian( HYPRE_Int argc, mtrx[7] = 1; mtrx[8] = 1.01; } - else if (sys_opt ==4) /* barry ex4 */ + else if (sys_opt == 4) /* barry ex4 */ { mtrx[0] = 3; mtrx[1] = 1; @@ -1189,7 +1666,7 @@ BuildParLaplacian( HYPRE_Int argc, HYPRE_Real *mtrx_values; - mtrx_values = hypre_CTAlloc(HYPRE_Real, num_fun*num_fun*4, HYPRE_MEMORY_HOST); + mtrx_values = hypre_CTAlloc(HYPRE_Real, num_fun * num_fun * 4, HYPRE_MEMORY_HOST); if (num_fun == 2) { @@ -1229,13 +1706,13 @@ BuildParLaplacian( HYPRE_Int argc, { /* mtrx[0] */ - SetSysVcoefValues(num_fun, nx, ny, nz, ep*1.0, 1.0, 1.0, 0, mtrx_values); + SetSysVcoefValues(num_fun, nx, ny, nz, ep * 1.0, 1.0, 1.0, 0, mtrx_values); /* mtrx[1] */ SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, 1.0, 1.0, 1, mtrx_values); /* mtrx[2] */ - SetSysVcoefValues(num_fun, nx, ny, nz, ep*1.0, 1.0, 1.0, 2, mtrx_values); + SetSysVcoefValues(num_fun, nx, ny, nz, ep * 1.0, 1.0, 1.0, 2, mtrx_values); /* mtrx[3] */ SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, 1.0, 1.0, 3, mtrx_values); @@ -1245,16 +1722,16 @@ BuildParLaplacian( HYPRE_Int argc, HYPRE_Real ep2 = ep; /* mtrx[0] */ - SetSysVcoefValues(num_fun, nx, ny, nz, ep*1.0, 1.0, 1.0, 0, mtrx_values); + SetSysVcoefValues(num_fun, nx, ny, nz, ep * 1.0, 1.0, 1.0, 0, mtrx_values); /* mtrx[1] */ - SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, ep*1.0, 1.0, 1, mtrx_values); + SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, ep * 1.0, 1.0, 1, mtrx_values); /* mtrx[2] */ - SetSysVcoefValues(num_fun, nx, ny, nz, ep*1.0, 1.0, 1.0, 2, mtrx_values); + SetSysVcoefValues(num_fun, nx, ny, nz, ep * 1.0, 1.0, 1.0, 2, mtrx_values); /* mtrx[3] */ - SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, ep2*1.0, 1.0, 3, mtrx_values); + SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, ep2 * 1.0, 1.0, 3, mtrx_values); } else if (vcoef_opt == 5) /* use with default sys_opt - */ { @@ -1263,16 +1740,16 @@ BuildParLaplacian( HYPRE_Int argc, beta = 10; /* mtrx[0] */ - SetSysVcoefValues(num_fun, nx, ny, nz, alp*1.0, 1.0, 1.0, 0, mtrx_values); + SetSysVcoefValues(num_fun, nx, ny, nz, alp * 1.0, 1.0, 1.0, 0, mtrx_values); /* mtrx[1] */ - SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, beta*1.0, 1.0, 1, mtrx_values); + SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, beta * 1.0, 1.0, 1, mtrx_values); /* mtrx[2] */ - SetSysVcoefValues(num_fun, nx, ny, nz, alp*1.0, 1.0, 1.0, 2, mtrx_values); + SetSysVcoefValues(num_fun, nx, ny, nz, alp * 1.0, 1.0, 1.0, 2, mtrx_values); /* mtrx[3] */ - SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, beta*1.0, 1.0, 3, mtrx_values); + SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, beta * 1.0, 1.0, 3, mtrx_values); } else /* = 0 */ { @@ -1372,7 +1849,7 @@ BuildParDifConv( HYPRE_Int argc, HYPRE_Int P, Q, R; HYPRE_Real cx, cy, cz; HYPRE_Real ax, ay, az, atype; - HYPRE_Real hinx,hiny,hinz; + HYPRE_Real hinx, hiny, hinz; HYPRE_Int sign_prod; HYPRE_ParCSRMatrix A; @@ -1433,16 +1910,16 @@ BuildParDifConv( HYPRE_Int argc, else if ( strcmp(argv[arg_index], "-c") == 0 ) { arg_index++; - cx = atof(argv[arg_index++]); - cy = atof(argv[arg_index++]); - cz = atof(argv[arg_index++]); + cx = (HYPRE_Real)atof(argv[arg_index++]); + cy = (HYPRE_Real)atof(argv[arg_index++]); + cz = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-a") == 0 ) { arg_index++; - ax = atof(argv[arg_index++]); - ay = atof(argv[arg_index++]); - az = atof(argv[arg_index++]); + ax = (HYPRE_Real)atof(argv[arg_index++]); + ay = (HYPRE_Real)atof(argv[arg_index++]); + az = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-atype") == 0 ) { @@ -1459,7 +1936,7 @@ BuildParDifConv( HYPRE_Int argc, * Check a few things *-----------------------------------------------------------*/ - if ((P*Q*R) != num_procs) + if ((P * Q * R) != num_procs) { hypre_printf("Error: Invalid number of processors or processor topology \n"); exit(1); @@ -1485,12 +1962,12 @@ BuildParDifConv( HYPRE_Int argc, /* compute p,q,r from P,Q,R and myid */ p = myid % P; - q = (( myid - p)/P) % Q; - r = ( myid - p - P*q)/( P*Q ); + q = (( myid - p) / P) % Q; + r = ( myid - p - P * q) / ( P * Q ); - hinx = 1./(nx+1); - hiny = 1./(ny+1); - hinz = 1./(nz+1); + hinx = 1. / (nx + 1); + hiny = 1. / (ny + 1); + hinz = 1. / (nz + 1); /*----------------------------------------------------------- * Generate the matrix @@ -1510,46 +1987,46 @@ BuildParDifConv( HYPRE_Int argc, if (0 == atype) /* forward scheme for conv */ { - values[1] = -cx/(hinx*hinx); - values[2] = -cy/(hiny*hiny); - values[3] = -cz/(hinz*hinz); - values[4] = -cx/(hinx*hinx) + ax/hinx; - values[5] = -cy/(hiny*hiny) + ay/hiny; - values[6] = -cz/(hinz*hinz) + az/hinz; + values[1] = -cx / (hinx * hinx); + values[2] = -cy / (hiny * hiny); + values[3] = -cz / (hinz * hinz); + values[4] = -cx / (hinx * hinx) + ax / hinx; + values[5] = -cy / (hiny * hiny) + ay / hiny; + values[6] = -cz / (hinz * hinz) + az / hinz; if (nx > 1) { - values[0] += 2.0*cx/(hinx*hinx) - 1.*ax/hinx; + values[0] += 2.0 * cx / (hinx * hinx) - 1.*ax / hinx; } if (ny > 1) { - values[0] += 2.0*cy/(hiny*hiny) - 1.*ay/hiny; + values[0] += 2.0 * cy / (hiny * hiny) - 1.*ay / hiny; } if (nz > 1) { - values[0] += 2.0*cz/(hinz*hinz) - 1.*az/hinz; + values[0] += 2.0 * cz / (hinz * hinz) - 1.*az / hinz; } } else if (1 == atype) /* backward scheme for conv */ { - values[1] = -cx/(hinx*hinx) - ax/hinx; - values[2] = -cy/(hiny*hiny) - ay/hiny; - values[3] = -cz/(hinz*hinz) - az/hinz; - values[4] = -cx/(hinx*hinx); - values[5] = -cy/(hiny*hiny); - values[6] = -cz/(hinz*hinz); + values[1] = -cx / (hinx * hinx) - ax / hinx; + values[2] = -cy / (hiny * hiny) - ay / hiny; + values[3] = -cz / (hinz * hinz) - az / hinz; + values[4] = -cx / (hinx * hinx); + values[5] = -cy / (hiny * hiny); + values[6] = -cz / (hinz * hinz); if (nx > 1) { - values[0] += 2.0*cx/(hinx*hinx) + 1.*ax/hinx; + values[0] += 2.0 * cx / (hinx * hinx) + 1.*ax / hinx; } if (ny > 1) { - values[0] += 2.0*cy/(hiny*hiny) + 1.*ay/hiny; + values[0] += 2.0 * cy / (hiny * hiny) + 1.*ay / hiny; } if (nz > 1) { - values[0] += 2.0*cz/(hinz*hinz) + 1.*az/hinz; + values[0] += 2.0 * cz / (hinz * hinz) + 1.*az / hinz; } } else if (3 == atype) /* upwind scheme */ @@ -1557,83 +2034,83 @@ BuildParDifConv( HYPRE_Int argc, sign_prod = sign_double(cx) * sign_double(ax); if (sign_prod == 1) /* same sign use back scheme */ { - values[1] = -cx/(hinx*hinx) - ax/hinx; - values[4] = -cx/(hinx*hinx); + values[1] = -cx / (hinx * hinx) - ax / hinx; + values[4] = -cx / (hinx * hinx); if (nx > 1) { - values[0] += 2.0*cx/(hinx*hinx) + 1.*ax/hinx; + values[0] += 2.0 * cx / (hinx * hinx) + 1.*ax / hinx; } } else /* diff sign use forward scheme */ { - values[1] = -cx/(hinx*hinx); - values[4] = -cx/(hinx*hinx) + ax/hinx; + values[1] = -cx / (hinx * hinx); + values[4] = -cx / (hinx * hinx) + ax / hinx; if (nx > 1) { - values[0] += 2.0*cx/(hinx*hinx) - 1.*ax/hinx; + values[0] += 2.0 * cx / (hinx * hinx) - 1.*ax / hinx; } } sign_prod = sign_double(cy) * sign_double(ay); if (sign_prod == 1) /* same sign use back scheme */ { - values[2] = -cy/(hiny*hiny) - ay/hiny; - values[5] = -cy/(hiny*hiny); + values[2] = -cy / (hiny * hiny) - ay / hiny; + values[5] = -cy / (hiny * hiny); if (ny > 1) { - values[0] += 2.0*cy/(hiny*hiny) + 1.*ay/hiny; + values[0] += 2.0 * cy / (hiny * hiny) + 1.*ay / hiny; } } else /* diff sign use forward scheme */ { - values[2] = -cy/(hiny*hiny); - values[5] = -cy/(hiny*hiny) + ay/hiny; + values[2] = -cy / (hiny * hiny); + values[5] = -cy / (hiny * hiny) + ay / hiny; if (ny > 1) { - values[0] += 2.0*cy/(hiny*hiny) - 1.*ay/hiny; + values[0] += 2.0 * cy / (hiny * hiny) - 1.*ay / hiny; } } sign_prod = sign_double(cz) * sign_double(az); if (sign_prod == 1) /* same sign use back scheme */ { - values[3] = -cz/(hinz*hinz) - az/hinz; - values[6] = -cz/(hinz*hinz); + values[3] = -cz / (hinz * hinz) - az / hinz; + values[6] = -cz / (hinz * hinz); if (nz > 1) { - values[0] += 2.0*cz/(hinz*hinz) + 1.*az/hinz; + values[0] += 2.0 * cz / (hinz * hinz) + 1.*az / hinz; } } else /* diff sign use forward scheme */ { - values[3] = -cz/(hinz*hinz); - values[6] = -cz/(hinz*hinz) + az/hinz; + values[3] = -cz / (hinz * hinz); + values[6] = -cz / (hinz * hinz) + az / hinz; if (nz > 1) { - values[0] += 2.0*cz/(hinz*hinz) - 1.*az/hinz; + values[0] += 2.0 * cz / (hinz * hinz) - 1.*az / hinz; } } } else /* centered difference scheme */ { - values[1] = -cx/(hinx*hinx) - ax/(2.*hinx); - values[2] = -cy/(hiny*hiny) - ay/(2.*hiny); - values[3] = -cz/(hinz*hinz) - az/(2.*hinz); - values[4] = -cx/(hinx*hinx) + ax/(2.*hinx); - values[5] = -cy/(hiny*hiny) + ay/(2.*hiny); - values[6] = -cz/(hinz*hinz) + az/(2.*hinz); + values[1] = -cx / (hinx * hinx) - ax / (2.*hinx); + values[2] = -cy / (hiny * hiny) - ay / (2.*hiny); + values[3] = -cz / (hinz * hinz) - az / (2.*hinz); + values[4] = -cx / (hinx * hinx) + ax / (2.*hinx); + values[5] = -cy / (hiny * hiny) + ay / (2.*hiny); + values[6] = -cz / (hinz * hinz) + az / (2.*hinz); if (nx > 1) { - values[0] += 2.0*cx/(hinx*hinx); + values[0] += 2.0 * cx / (hinx * hinx); } if (ny > 1) { - values[0] += 2.0*cy/(hiny*hiny); + values[0] += 2.0 * cy / (hiny * hiny); } if (nz > 1) { - values[0] += 2.0*cz/(hinz*hinz); + values[0] += 2.0 * cz / (hinz * hinz); } } @@ -1712,7 +2189,7 @@ BuildParLaplacian9pt( HYPRE_Int argc, * Check a few things *-----------------------------------------------------------*/ - if ((P*Q) != num_procs) + if ((P * Q) != num_procs) { hypre_printf("Error: Invalid number of processors or processor topology \n"); exit(1); @@ -1735,7 +2212,7 @@ BuildParLaplacian9pt( HYPRE_Int argc, /* compute p,q from P,Q and myid */ p = myid % P; - q = ( myid - p)/P; + q = ( myid - p) / P; /*----------------------------------------------------------- * Generate the matrix @@ -1837,7 +2314,7 @@ BuildParLaplacian27pt( HYPRE_Int argc, * Check a few things *-----------------------------------------------------------*/ - if ((P*Q*R) != num_procs) + if ((P * Q * R) != num_procs) { hypre_printf("Error: Invalid number of processors or processor topology \n"); exit(1); @@ -1860,8 +2337,8 @@ BuildParLaplacian27pt( HYPRE_Int argc, /* compute p,q,r from P,Q,R and myid */ p = myid % P; - q = (( myid - p)/P) % Q; - r = ( myid - p - P*q)/( P*Q ); + q = (( myid - p) / P) % Q; + r = ( myid - p - P * q) / ( P * Q ); /*----------------------------------------------------------- * Generate the matrix @@ -1871,9 +2348,13 @@ BuildParLaplacian27pt( HYPRE_Int argc, values[0] = 26.0; if (nx == 1 || ny == 1 || nz == 1) + { values[0] = 8.0; - if (nx*ny == 1 || nx*nz == 1 || ny*nz == 1) + } + if (nx * ny == 1 || nx * nz == 1 || ny * nz == 1) + { values[0] = 2.0; + } values[1] = -1.; A = (HYPRE_ParCSRMatrix) GenerateLaplacian27pt(hypre_MPI_COMM_WORLD, @@ -1893,19 +2374,19 @@ BuildParLaplacian27pt( HYPRE_Int argc, *----------------------------------------------------------------------*/ HYPRE_Int -BuildParRotate7pt( HYPRE_Int argc, +BuildParRotate7pt( HYPRE_Int argc, char *argv[], - HYPRE_Int arg_index, + HYPRE_Int arg_index, HYPRE_ParCSRMatrix *A_ptr ) { HYPRE_Int nx, ny; HYPRE_Int P, Q; - HYPRE_ParCSRMatrix A; + HYPRE_ParCSRMatrix A; HYPRE_Int num_procs, myid; HYPRE_Int p, q; - HYPRE_Real eps, alpha; + HYPRE_Real eps = 0.0, alpha = 1.0; /*----------------------------------------------------------- * Initialize some stuff @@ -1945,12 +2426,12 @@ BuildParRotate7pt( HYPRE_Int argc, else if ( strcmp(argv[arg_index], "-alpha") == 0 ) { arg_index++; - alpha = atof(argv[arg_index++]); + alpha = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-eps") == 0 ) { arg_index++; - eps = atof(argv[arg_index++]); + eps = (HYPRE_Real)atof(argv[arg_index++]); } else { @@ -1962,7 +2443,7 @@ BuildParRotate7pt( HYPRE_Int argc, * Check a few things *-----------------------------------------------------------*/ - if ((P*Q) != num_procs) + if ((P * Q) != num_procs) { hypre_printf("Error: Invalid number of processors or processor topology \n"); exit(1); @@ -1975,7 +2456,7 @@ BuildParRotate7pt( HYPRE_Int argc, if (myid == 0) { hypre_printf(" Rotate 7pt:\n"); - hypre_printf(" alpha = %f, eps = %f\n", alpha,eps); + hypre_printf(" alpha = %f, eps = %f\n", alpha, eps); hypre_printf(" (nx, ny) = (%d, %d)\n", nx, ny); hypre_printf(" (Px, Py) = (%d, %d)\n", P, Q); } @@ -1986,7 +2467,7 @@ BuildParRotate7pt( HYPRE_Int argc, /* compute p,q from P,Q and myid */ p = myid % P; - q = ( myid - p)/P; + q = ( myid - p) / P; /*----------------------------------------------------------- * Generate the matrix @@ -2014,7 +2495,7 @@ HYPRE_Int BuildParVarDifConv( HYPRE_Int argc, char *argv[], HYPRE_Int arg_index, - HYPRE_ParCSRMatrix *A_ptr , + HYPRE_ParCSRMatrix *A_ptr, HYPRE_ParVector *rhs_ptr ) { HYPRE_Int nx, ny, nz; @@ -2074,7 +2555,7 @@ BuildParVarDifConv( HYPRE_Int argc, else if ( strcmp(argv[arg_index], "-eps") == 0 ) { arg_index++; - eps = atof(argv[arg_index++]); + eps = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-vardifconvRS") == 0 ) { @@ -2091,7 +2572,7 @@ BuildParVarDifConv( HYPRE_Int argc, * Check a few things *-----------------------------------------------------------*/ - if ((P*Q*R) != num_procs) + if ((P * Q * R) != num_procs) { hypre_printf("Error: Invalid number of processors or processor topology \n"); exit(1); @@ -2114,8 +2595,8 @@ BuildParVarDifConv( HYPRE_Int argc, /* compute p,q,r from P,Q,R and myid */ p = myid % P; - q = (( myid - p)/P) % Q; - r = ( myid - p - P*q)/( P*Q ); + q = (( myid - p) / P) % Q; + r = ( myid - p - P * q) / ( P * Q ); /*----------------------------------------------------------- * Generate the matrix @@ -2141,30 +2622,30 @@ BuildParVarDifConv( HYPRE_Int argc, /**************************************************************************/ - -HYPRE_Int SetSysVcoefValues(HYPRE_Int num_fun, HYPRE_Int nx, HYPRE_Int ny, HYPRE_Int nz, HYPRE_Real vcx, +HYPRE_Int SetSysVcoefValues(HYPRE_Int num_fun, HYPRE_BigInt nx, HYPRE_BigInt ny, HYPRE_BigInt nz, + HYPRE_Real vcx, HYPRE_Real vcy, HYPRE_Real vcz, HYPRE_Int mtx_entry, HYPRE_Real *values) { - HYPRE_Int sz = num_fun*num_fun; + HYPRE_Int sz = num_fun * num_fun; - values[1*sz + mtx_entry] = -vcx; - values[2*sz + mtx_entry] = -vcy; - values[3*sz + mtx_entry] = -vcz; - values[0*sz + mtx_entry] = 0.0; + values[1 * sz + mtx_entry] = -vcx; + values[2 * sz + mtx_entry] = -vcy; + values[3 * sz + mtx_entry] = -vcz; + values[0 * sz + mtx_entry] = 0.0; if (nx > 1) { - values[0*sz + mtx_entry] += 2.0*vcx; + values[0 * sz + mtx_entry] += 2.0 * vcx; } if (ny > 1) { - values[0*sz + mtx_entry] += 2.0*vcy; + values[0 * sz + mtx_entry] += 2.0 * vcy; } if (nz > 1) { - values[0*sz + mtx_entry] += 2.0*vcz; + values[0 * sz + mtx_entry] += 2.0 * vcz; } return 0; @@ -2177,10 +2658,10 @@ HYPRE_Int SetSysVcoefValues(HYPRE_Int num_fun, HYPRE_Int nx, HYPRE_Int ny, HYPRE HYPRE_Int BuildParCoordinates( HYPRE_Int argc, - char *argv[], + char *argv[], HYPRE_Int arg_index, HYPRE_Int *coorddim_ptr, - float **coord_ptr ) + float **coord_ptr ) { HYPRE_Int nx, ny, nz; HYPRE_Int P, Q, R; @@ -2238,23 +2719,27 @@ BuildParCoordinates( HYPRE_Int argc, /* compute p,q,r from P,Q,R and myid */ p = myid % P; - q = (( myid - p)/P) % Q; - r = ( myid - p - P*q)/( P*Q ); + q = (( myid - p) / P) % Q; + r = ( myid - p - P * q) / ( P * Q ); /*----------------------------------------------------------- * Generate the coordinates *-----------------------------------------------------------*/ coorddim = 3; - if (nx<2) coorddim--; - if (ny<2) coorddim--; - if (nz<2) coorddim--; + if (nx < 2) { coorddim--; } + if (ny < 2) { coorddim--; } + if (nz < 2) { coorddim--; } - if (coorddim>0) - coordinates = GenerateCoordinates (hypre_MPI_COMM_WORLD, - nx, ny, nz, P, Q, R, p, q, r, coorddim); + if (coorddim > 0) + { + coordinates = hypre_GenerateCoordinates(hypre_MPI_COMM_WORLD, + nx, ny, nz, P, Q, R, p, q, r, coorddim); + } else - coordinates=NULL; + { + coordinates = NULL; + } *coorddim_ptr = coorddim; *coord_ptr = coordinates; diff --git a/external/hypre/src/test/ij_mv.c b/external/hypre/src/test/ij_mv.c deleted file mode 100644 index 315bd8c3..00000000 --- a/external/hypre/src/test/ij_mv.c +++ /dev/null @@ -1,1527 +0,0 @@ -/****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other - * HYPRE Project Developers. See the top-level COPYRIGHT file for details. - * - * SPDX-License-Identifier: (Apache-2.0 OR MIT) - ******************************************************************************/ - -/*-------------------------------------------------------------------------- - * Test driver for unstructured matrix-vector interface. - * Do `driver -help' for usage info. - * This driver started from the driver for parcsr_linear_solvers, and it - * works by first building a parcsr matrix as before and then "copying" - * that matrix row-by-row into the IJMatrix interface. - *--------------------------------------------------------------------------*/ -#include -#include -#include - -#include "_hypre_utilities.h" -#include "HYPRE.h" -#include "HYPRE_parcsr_mv.h" - -#include "HYPRE_IJ_mv.h" -#include "HYPRE_parcsr_ls.h" -#include "HYPRE_krylov.h" - -HYPRE_Int BuildParFromFile (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildParLaplacian (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildParDifConv (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildParFromOneFile (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildRhsParFromOneFile (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_BigInt *partitioning , HYPRE_ParVector *b_ptr ); -HYPRE_Int BuildParLaplacian9pt (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildParLaplacian27pt (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); - -#define SECOND_TIME 0 - -hypre_int -main( hypre_int argc, - char *argv[] ) -{ - HYPRE_Int arg_index; - HYPRE_Int print_usage; - HYPRE_Int sparsity_known = 0; - HYPRE_Int build_matrix_type; - HYPRE_Int build_matrix_arg_index; - HYPRE_Int build_rhs_type; - HYPRE_Int build_rhs_arg_index; - HYPRE_Real norm; - void *object; - - HYPRE_IJMatrix ij_A; - HYPRE_IJVector ij_b=NULL; - HYPRE_IJVector ij_x=NULL; - HYPRE_IJVector ij_v; - - HYPRE_ParCSRMatrix parcsr_A; - HYPRE_ParVector b; - HYPRE_ParVector x; - - HYPRE_Int num_procs, myid; - HYPRE_Int local_row; - HYPRE_BigInt *indices; - HYPRE_Int *row_sizes; - HYPRE_Int *diag_sizes; - HYPRE_Int *offdiag_sizes; - HYPRE_BigInt *rows; - HYPRE_Int size; - HYPRE_Int *ncols; - HYPRE_BigInt *col_inds; - - MPI_Comm comm = hypre_MPI_COMM_WORLD; - HYPRE_Int time_index; - HYPRE_Int ierr = 0; - HYPRE_BigInt M, N, big_i; - HYPRE_Int i, j; - HYPRE_Int local_num_rows, local_num_cols; - HYPRE_BigInt first_local_row, last_local_row; - HYPRE_BigInt first_local_col, last_local_col; - HYPRE_Real *values; - - /*----------------------------------------------------------- - * Initialize some stuff - *-----------------------------------------------------------*/ - - /* Initialize MPI */ - hypre_MPI_Init(&argc, &argv); - - hypre_MPI_Comm_size(hypre_MPI_COMM_WORLD, &num_procs ); - hypre_MPI_Comm_rank(hypre_MPI_COMM_WORLD, &myid ); - - /*----------------------------------------------------------- - * Set defaults - *-----------------------------------------------------------*/ - - build_matrix_type = 2; - build_matrix_arg_index = argc; - build_rhs_type = 2; - build_rhs_arg_index = argc; - - /*----------------------------------------------------------- - * Parse command line - *-----------------------------------------------------------*/ - - print_usage = 0; - arg_index = 1; - - while ( (arg_index < argc) && (!print_usage) ) - { - if ( strcmp(argv[arg_index], "-fromijfile") == 0 ) - { - arg_index++; - build_matrix_type = -1; - build_matrix_arg_index = arg_index; - } - else if ( strcmp(argv[arg_index], "-fromparcsrfile") == 0 ) - { - arg_index++; - build_matrix_type = 0; - build_matrix_arg_index = arg_index; - } - else if ( strcmp(argv[arg_index], "-fromonecsrfile") == 0 ) - { - arg_index++; - build_matrix_type = 1; - build_matrix_arg_index = arg_index; - } - else if ( strcmp(argv[arg_index], "-laplacian") == 0 ) - { - arg_index++; - build_matrix_type = 2; - build_matrix_arg_index = arg_index; - } - else if ( strcmp(argv[arg_index], "-9pt") == 0 ) - { - arg_index++; - build_matrix_type = 3; - build_matrix_arg_index = arg_index; - } - else if ( strcmp(argv[arg_index], "-27pt") == 0 ) - { - arg_index++; - build_matrix_type = 4; - build_matrix_arg_index = arg_index; - } - else if ( strcmp(argv[arg_index], "-difconv") == 0 ) - { - arg_index++; - build_matrix_type = 5; - build_matrix_arg_index = arg_index; - } - else if ( strcmp(argv[arg_index], "-exact_size") == 0 ) - { - arg_index++; - sparsity_known = 1; - } - else if ( strcmp(argv[arg_index], "-storage_low") == 0 ) - { - arg_index++; - sparsity_known = 2; - } - else if ( strcmp(argv[arg_index], "-concrete_parcsr") == 0 ) - { - arg_index++; - build_matrix_arg_index = arg_index; - } - else if ( strcmp(argv[arg_index], "-rhsfromfile") == 0 ) - { - arg_index++; - build_rhs_type = 0; - build_rhs_arg_index = arg_index; - } - else if ( strcmp(argv[arg_index], "-rhsfromonefile") == 0 ) - { - arg_index++; - build_rhs_type = 1; - build_rhs_arg_index = arg_index; - } - else if ( strcmp(argv[arg_index], "-rhsisone") == 0 ) - { - arg_index++; - build_rhs_type = 2; - build_rhs_arg_index = arg_index; - } - else if ( strcmp(argv[arg_index], "-rhsrand") == 0 ) - { - arg_index++; - build_rhs_type = 3; - build_rhs_arg_index = arg_index; - } - else if ( strcmp(argv[arg_index], "-xisone") == 0 ) - { - arg_index++; - build_rhs_type = 4; - build_rhs_arg_index = arg_index; - } - else if ( strcmp(argv[arg_index], "-rhszero") == 0 ) - { - arg_index++; - build_rhs_type = 5; - build_rhs_arg_index = arg_index; - } - else if ( strcmp(argv[arg_index], "-help") == 0 ) - { - print_usage = 1; - } - else - { - arg_index++; - } - } - - /*----------------------------------------------------------- - * Print usage info - *-----------------------------------------------------------*/ - - if ( (print_usage) && (myid == 0) ) - { - hypre_printf("\n"); - hypre_printf("Usage: %s []\n", argv[0]); - hypre_printf("\n"); - hypre_printf(" -fromijfile : "); - hypre_printf("matrix read in IJ format from distributed files\n"); - hypre_printf(" -fromparcsrfile : "); - hypre_printf("matrix read in ParCSR format from distributed files\n"); - hypre_printf(" -fromonecsrfile : "); - hypre_printf("matrix read in CSR format from a file on one processor\n"); - hypre_printf("\n"); - hypre_printf(" -laplacian [] : build laplacian problem\n"); - hypre_printf(" -9pt [] : build 9pt 2D laplacian problem\n"); - hypre_printf(" -27pt [] : build 27pt 3D laplacian problem\n"); - hypre_printf(" -difconv [] : build convection-diffusion problem\n"); - hypre_printf(" -n : total problem size \n"); - hypre_printf(" -P : processor topology\n"); - hypre_printf(" -c : diffusion coefficients\n"); - hypre_printf(" -a : convection coefficients\n"); - hypre_printf("\n"); - hypre_printf(" -exact_size : inserts immediately into ParCSR structure\n"); - hypre_printf(" -storage_low : allocates not enough storage for aux struct\n"); - hypre_printf(" -concrete_parcsr : use parcsr matrix type as concrete type\n"); - hypre_printf("\n"); - hypre_printf(" -rhsfromfile : rhs read in IJ form from distributed files\n"); - hypre_printf(" -rhsfromonefile : rhs read from a file one one processor\n"); - hypre_printf(" -rhsrand : rhs is random vector\n"); - hypre_printf(" -rhsisone : rhs is vector with unit components (default)\n"); - hypre_printf(" -xisone : solution of all ones\n"); - hypre_printf(" -rhszero : rhs is zero vector\n"); - exit(1); - } - - /*----------------------------------------------------------- - * Print driver parameters - *-----------------------------------------------------------*/ - - if (myid == 0) - { - hypre_printf("Running with these driver parameters:\n"); - } - - /*----------------------------------------------------------- - * Set up matrix - *-----------------------------------------------------------*/ - - if ( build_matrix_type == -1 ) - { - HYPRE_IJMatrixRead( argv[build_matrix_arg_index], comm, - HYPRE_PARCSR, &ij_A ); - } - else if ( build_matrix_type == 0 ) - { - BuildParFromFile(argc, argv, build_matrix_arg_index, &parcsr_A); - } - else if ( build_matrix_type == 1 ) - { - BuildParFromOneFile(argc, argv, build_matrix_arg_index, &parcsr_A); - } - else if ( build_matrix_type == 2 ) - { - BuildParLaplacian(argc, argv, build_matrix_arg_index, &parcsr_A); - } - else if ( build_matrix_type == 3 ) - { - BuildParLaplacian9pt(argc, argv, build_matrix_arg_index, &parcsr_A); - } - else if ( build_matrix_type == 4 ) - { - BuildParLaplacian27pt(argc, argv, build_matrix_arg_index, &parcsr_A); - } - else if ( build_matrix_type == 5 ) - { - BuildParDifConv(argc, argv, build_matrix_arg_index, &parcsr_A); - } - else - { - hypre_printf("You have asked for an unsupported test with\n"); - hypre_printf("build_matrix_type = %d.\n", build_matrix_type); - return(-1); - } - - time_index = hypre_InitializeTiming("Spatial Operator"); - hypre_BeginTiming(time_index); - - if (build_matrix_type < 2) - { - ierr += HYPRE_IJMatrixGetObject( ij_A, &object); - parcsr_A = (HYPRE_ParCSRMatrix) object; - - ierr = HYPRE_ParCSRMatrixGetLocalRange( parcsr_A, - &first_local_row, &last_local_row , - &first_local_col, &last_local_col ); - - local_num_rows = last_local_row - first_local_row + 1; - local_num_cols = last_local_col - first_local_col + 1; - - ierr = HYPRE_IJMatrixInitialize( ij_A ); - } - else - { - /*-------------------------------------------------------------------- - * Copy the parcsr matrix into the IJMatrix through interface calls - *--------------------------------------------------------------------*/ - - ierr = HYPRE_ParCSRMatrixGetLocalRange( parcsr_A, - &first_local_row, &last_local_row , - &first_local_col, &last_local_col ); - - local_num_rows = (HYPRE_Int)(last_local_row - first_local_row + 1); - local_num_cols = (HYPRE_Int)(last_local_col - first_local_col + 1); - - ierr += HYPRE_ParCSRMatrixGetDims( parcsr_A, &M, &N ); - - ierr += HYPRE_IJMatrixCreate( comm, first_local_row, last_local_row, - first_local_col, last_local_col, - &ij_A ); - - ierr += HYPRE_IJMatrixSetObjectType( ij_A, HYPRE_PARCSR ); - - - /* the following shows how to build an IJMatrix if one has only an - estimate for the row sizes */ - if (sparsity_known == 1) - { - /* build IJMatrix using exact row_sizes for diag and offdiag */ - - diag_sizes = hypre_CTAlloc(HYPRE_Int, local_num_rows, HYPRE_MEMORY_HOST); - offdiag_sizes = hypre_CTAlloc(HYPRE_Int, local_num_rows, HYPRE_MEMORY_HOST); - local_row = 0; - for (big_i=first_local_row; big_i<= last_local_row; big_i++) - { - ierr += HYPRE_ParCSRMatrixGetRow( parcsr_A, big_i, &size, - &col_inds, &values ); - - for (j=0; j < size; j++) - { - if (col_inds[j] < first_local_row || col_inds[j] > last_local_row) - offdiag_sizes[local_row]++; - else - diag_sizes[local_row]++; - } - local_row++; - ierr += HYPRE_ParCSRMatrixRestoreRow( parcsr_A, big_i, &size, - &col_inds, &values ); - } - ierr += HYPRE_IJMatrixSetDiagOffdSizes( ij_A, - (const HYPRE_Int *) diag_sizes, - (const HYPRE_Int *) offdiag_sizes ); - hypre_TFree(diag_sizes, HYPRE_MEMORY_HOST); - hypre_TFree(offdiag_sizes, HYPRE_MEMORY_HOST); - - ierr = HYPRE_IJMatrixInitialize( ij_A ); - - for (big_i=first_local_row; big_i<= last_local_row; big_i++) - { - ierr += HYPRE_ParCSRMatrixGetRow( parcsr_A, big_i, &size, - &col_inds, &values ); - - ierr += HYPRE_IJMatrixSetValues( ij_A, 1, &size, &big_i, - (const HYPRE_BigInt *) col_inds, - (const HYPRE_Real *) values ); - - ierr += HYPRE_ParCSRMatrixRestoreRow( parcsr_A, big_i, &size, - &col_inds, &values ); - } - } - else - { - row_sizes = hypre_CTAlloc(HYPRE_Int, local_num_rows, HYPRE_MEMORY_HOST); - - size = 5; /* this is in general too low, and supposed to test - the capability of the reallocation of the interface */ - - if (sparsity_known == 0) /* tries a more accurate estimate of the - storage */ - { - if (build_matrix_type == 2) size = 7; - if (build_matrix_type == 3) size = 9; - if (build_matrix_type == 4) size = 27; - } - - for (i=0; i < local_num_rows; i++) - row_sizes[i] = size; - - ierr = HYPRE_IJMatrixSetRowSizes ( ij_A, (const HYPRE_Int *) row_sizes ); - - hypre_TFree(row_sizes, HYPRE_MEMORY_HOST); - - ierr = HYPRE_IJMatrixInitialize( ij_A ); - - /* Loop through all locally stored rows and insert them into ij_matrix */ - for (big_i=first_local_row; big_i<= last_local_row; big_i++) - { - ierr += HYPRE_ParCSRMatrixGetRow( parcsr_A, big_i, &size, - &col_inds, &values ); - - ierr += HYPRE_IJMatrixSetValues( ij_A, 1, &size, &big_i, - (const HYPRE_BigInt *) col_inds, - (const HYPRE_Real *) values ); - - ierr += HYPRE_ParCSRMatrixRestoreRow( parcsr_A, big_i, &size, - &col_inds, &values ); - } - } - - ierr += HYPRE_IJMatrixAssemble( ij_A ); - - } - - hypre_EndTiming(time_index); - hypre_PrintTiming("Initial IJ Matrix Setup", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); - - if (ierr) - { - hypre_printf("Error in driver building IJMatrix from parcsr matrix. \n"); - return(-1); - } - - time_index = hypre_InitializeTiming("Backward Euler Time Step"); - hypre_BeginTiming(time_index); - - /* This is to emphasize that one can IJMatrixAddToValues after an - IJMatrixRead or an IJMatrixAssemble. After an IJMatrixRead, - assembly is unnecessary if the sparsity pattern of the matrix is - not changed somehow. If one has not used IJMatrixRead, one has - the opportunity to IJMatrixAddTo before a IJMatrixAssemble. */ - - ncols = hypre_CTAlloc(HYPRE_Int, last_local_row - first_local_row + 1, HYPRE_MEMORY_HOST); - rows = hypre_CTAlloc(HYPRE_BigInt, last_local_row - first_local_row + 1, HYPRE_MEMORY_HOST); - col_inds = hypre_CTAlloc(HYPRE_BigInt, last_local_row - first_local_row + 1, HYPRE_MEMORY_HOST); - values = hypre_CTAlloc(HYPRE_Real, last_local_row - first_local_row + 1, HYPRE_MEMORY_HOST); - - for (big_i = first_local_row; big_i <= last_local_row; big_i++) - { - j = (HYPRE_Int)(big_i - first_local_row); - rows[j] = big_i; - ncols[j] = 1; - col_inds[j] = big_i; - values[j] = -27.8; - } - - ierr += HYPRE_IJMatrixAddToValues( ij_A, - local_num_rows, - ncols, rows, - (const HYPRE_BigInt *) col_inds, - (const HYPRE_Real *) values ); - - hypre_TFree(values, HYPRE_MEMORY_HOST); - hypre_TFree(col_inds, HYPRE_MEMORY_HOST); - hypre_TFree(rows, HYPRE_MEMORY_HOST); - hypre_TFree(ncols, HYPRE_MEMORY_HOST); - - /* If sparsity pattern is not changed since last IJMatrixAssemble call, - this should be a no-op */ - - ierr += HYPRE_IJMatrixAssemble( ij_A ); - - hypre_EndTiming(time_index); - hypre_PrintTiming("IJ Matrix Diagonal Augmentation", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); - - /*----------------------------------------------------------- - * Fetch the resulting underlying matrix out - *-----------------------------------------------------------*/ - - if (build_matrix_type > 1) - ierr += HYPRE_ParCSRMatrixDestroy(parcsr_A); - - ierr += HYPRE_IJMatrixGetObject( ij_A, &object); - parcsr_A = (HYPRE_ParCSRMatrix) object; - - HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_col, last_local_col, &ij_v); - HYPRE_IJVectorSetObjectType(ij_v, HYPRE_PARCSR ); - HYPRE_IJVectorInitialize(ij_v); - - values = hypre_CTAlloc(HYPRE_Real, local_num_cols, HYPRE_MEMORY_HOST); - - /*------------------------------------------------------------------- - * Check HYPRE_IJVectorSet(Get)Values calls - * - * All local components changed -- NULL indices - *-------------------------------------------------------------------*/ - - for (i = 0; i < local_num_cols; i++) - values[i] = 1.; - - HYPRE_IJVectorSetValues(ij_v, local_num_cols, NULL, values); - - for (i = 0; i < local_num_cols; i++) - values[i] = (HYPRE_Real)i; - - HYPRE_IJVectorAddToValues(ij_v, local_num_cols/2, NULL, values); - - HYPRE_IJVectorGetValues(ij_v, local_num_cols, NULL, values); - - ierr = 0; - for (i = 0; i < local_num_cols/2; i++) - if (values[i] != (HYPRE_Real)i + 1.) ++ierr; - for (i = local_num_cols/2; i < local_num_cols; i++) - if (values[i] != 1.) ++ierr; - if (ierr) - { - hypre_printf("One of HYPRE_IJVectorSet(AddTo,Get)Values\n"); - hypre_printf("calls with NULL indices bad\n"); - hypre_printf("IJVector Error 1 with ierr = %d\n", ierr); - exit(1); - } - - /*------------------------------------------------------------------- - * All local components changed, assigned reverse-ordered values - * as specified by indices - *-------------------------------------------------------------------*/ - - indices = hypre_CTAlloc(HYPRE_BigInt, local_num_cols, HYPRE_MEMORY_HOST); - - for (big_i = first_local_col; big_i <= last_local_col; big_i++) - { - j = (HYPRE_Int)(big_i - first_local_col); - values[j] = (HYPRE_Real)big_i; - indices[j] = last_local_col - big_i; - } - - HYPRE_IJVectorSetValues(ij_v, local_num_cols, indices, values); - - for (big_i = first_local_col; big_i <= last_local_col; big_i++) - { - j = (HYPRE_Int)(big_i - first_local_col); - values[j] = (HYPRE_Real)big_i*big_i; - } - - HYPRE_IJVectorAddToValues(ij_v, local_num_cols, indices, values); - - HYPRE_IJVectorGetValues(ij_v, local_num_cols, indices, values); - - hypre_TFree(indices, HYPRE_MEMORY_HOST); - - ierr = 0; - for (big_i = first_local_col; big_i <= last_local_col; big_i++) - { - j = (HYPRE_Int)(big_i - first_local_col); - if (values[j] != (HYPRE_Real)(big_i*big_i + big_i)) ++ierr; - } - - if (ierr) - { - hypre_printf("One of HYPRE_IJVectorSet(Get)Values\n"); - hypre_printf("calls bad\n"); - hypre_printf("IJVector Error 2 with ierr = %d\n", ierr); - exit(1); - } - - HYPRE_IJVectorDestroy(ij_v); - - /*----------------------------------------------------------- - * Set up the RHS and initial guess - *-----------------------------------------------------------*/ - - time_index = hypre_InitializeTiming("RHS and Initial Guess"); - hypre_BeginTiming(time_index); - - if ( build_rhs_type == 0 ) - { - if (myid == 0) - { - hypre_printf(" RHS vector read from file %s\n", argv[build_rhs_arg_index]); - hypre_printf(" Initial guess is 0\n"); - } - - /* RHS */ - ierr = HYPRE_IJVectorRead( argv[build_rhs_arg_index], hypre_MPI_COMM_WORLD, - HYPRE_PARCSR, &ij_b ); - ierr = HYPRE_IJVectorGetObject( ij_b, &object ); - b = (HYPRE_ParVector) object; - - /* Initial guess */ - HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_col, last_local_col, &ij_x); - HYPRE_IJVectorSetObjectType(ij_x, HYPRE_PARCSR); - HYPRE_IJVectorInitialize(ij_x); - - values = hypre_CTAlloc(HYPRE_Real, local_num_cols, HYPRE_MEMORY_HOST); - for (i = 0; i < local_num_cols; i++) - values[i] = 0.; - HYPRE_IJVectorSetValues(ij_x, local_num_cols, NULL, values); - hypre_TFree(values, HYPRE_MEMORY_HOST); - - ierr = HYPRE_IJVectorGetObject( ij_x, &object ); - x = (HYPRE_ParVector) object; - } - else if ( build_rhs_type == 1 ) - { - hypre_printf("build_rhs_type == 1 not currently implemented\n"); - return(-1); - -#if 0 - /* RHS */ - BuildRhsParFromOneFile(argc, argv, build_rhs_arg_index, part_b, &b); -#endif - } - else if ( build_rhs_type == 2 ) - { - if (myid == 0) - { - hypre_printf(" RHS vector has unit components\n"); - hypre_printf(" Initial guess is 0\n"); - } - - /* RHS */ - HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_row, last_local_row, &ij_b); - HYPRE_IJVectorSetObjectType(ij_b, HYPRE_PARCSR); - HYPRE_IJVectorInitialize(ij_b); - - values = hypre_CTAlloc(HYPRE_Real, local_num_rows, HYPRE_MEMORY_HOST); - for (i = 0; i < local_num_rows; i++) - values[i] = 1.; - HYPRE_IJVectorSetValues(ij_b, local_num_rows, NULL, values); - hypre_TFree(values, HYPRE_MEMORY_HOST); - ierr = HYPRE_IJVectorGetObject( ij_b, &object ); - b = (HYPRE_ParVector) object; - - /* Initial guess */ - HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_col, last_local_col, &ij_x); - HYPRE_IJVectorSetObjectType(ij_x, HYPRE_PARCSR); - HYPRE_IJVectorInitialize(ij_x); - - values = hypre_CTAlloc(HYPRE_Real, local_num_cols, HYPRE_MEMORY_HOST); - for (i = 0; i < local_num_cols; i++) - values[i] = 0.; - HYPRE_IJVectorSetValues(ij_x, local_num_cols, NULL, values); - hypre_TFree(values, HYPRE_MEMORY_HOST); - - ierr = HYPRE_IJVectorGetObject( ij_x, &object ); - x = (HYPRE_ParVector) object; - } - else if ( build_rhs_type == 3 ) - { - if (myid == 0) - { - hypre_printf(" RHS vector has random components and unit 2-norm\n"); - hypre_printf(" Initial guess is 0\n"); - } - - /* RHS */ - HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_row, last_local_row, &ij_b); - HYPRE_IJVectorSetObjectType(ij_b, HYPRE_PARCSR); - HYPRE_IJVectorInitialize(ij_b); - ierr = HYPRE_IJVectorGetObject( ij_b, &object ); - b = (HYPRE_ParVector) object; - - /* For purposes of this test, HYPRE_ParVector functions are used, but these are - not necessary. For a clean use of the interface, the user "should" - modify components of ij_x by using functions HYPRE_IJVectorSetValues or - HYPRE_IJVectorAddToValues */ - - HYPRE_ParVectorSetRandomValues(b, 22775); - HYPRE_ParVectorInnerProd(b,b,&norm); - norm = 1./sqrt(norm); - ierr = HYPRE_ParVectorScale(norm, b); - - /* Initial guess */ - HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_col, last_local_col, &ij_x); - HYPRE_IJVectorSetObjectType(ij_x, HYPRE_PARCSR); - HYPRE_IJVectorInitialize(ij_x); - - values = hypre_CTAlloc(HYPRE_Real, local_num_cols, HYPRE_MEMORY_HOST); - for (i = 0; i < local_num_cols; i++) - values[i] = 0.; - HYPRE_IJVectorSetValues(ij_x, local_num_cols, NULL, values); - hypre_TFree(values, HYPRE_MEMORY_HOST); - - ierr = HYPRE_IJVectorGetObject( ij_x, &object ); - x = (HYPRE_ParVector) object; - } - else if ( build_rhs_type == 4 ) - { - if (myid == 0) - { - hypre_printf(" RHS vector set for solution with unit components\n"); - hypre_printf(" Initial guess is 0\n"); - } - - /* Temporary use of solution vector */ - HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_col, last_local_col, &ij_x); - HYPRE_IJVectorSetObjectType(ij_x, HYPRE_PARCSR); - HYPRE_IJVectorInitialize(ij_x); - - values = hypre_CTAlloc(HYPRE_Real, local_num_cols, HYPRE_MEMORY_HOST); - for (i = 0; i < local_num_cols; i++) - values[i] = 1.; - HYPRE_IJVectorSetValues(ij_x, local_num_cols, NULL, values); - hypre_TFree(values, HYPRE_MEMORY_HOST); - - ierr = HYPRE_IJVectorGetObject( ij_x, &object ); - x = (HYPRE_ParVector) object; - - /* RHS */ - HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_row, last_local_row, &ij_b); - HYPRE_IJVectorSetObjectType(ij_b, HYPRE_PARCSR); - HYPRE_IJVectorInitialize(ij_b); - ierr = HYPRE_IJVectorGetObject( ij_b, &object ); - b = (HYPRE_ParVector) object; - - HYPRE_ParCSRMatrixMatvec(1.,parcsr_A,x,0.,b); - - /* Initial guess */ - values = hypre_CTAlloc(HYPRE_Real, local_num_cols, HYPRE_MEMORY_HOST); - for (i = 0; i < local_num_cols; i++) - values[i] = 0.; - HYPRE_IJVectorSetValues(ij_x, local_num_cols, NULL, values); - hypre_TFree(values, HYPRE_MEMORY_HOST); - } - else if ( build_rhs_type == 5 ) - { - if (myid == 0) - { - hypre_printf(" RHS vector is 0\n"); - hypre_printf(" Initial guess has unit components\n"); - } - - /* RHS */ - HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_row, last_local_row, &ij_b); - HYPRE_IJVectorSetObjectType(ij_b, HYPRE_PARCSR); - HYPRE_IJVectorInitialize(ij_b); - - values = hypre_CTAlloc(HYPRE_Real, local_num_rows, HYPRE_MEMORY_HOST); - for (i = 0; i < local_num_rows; i++) - values[i] = 0.; - HYPRE_IJVectorSetValues(ij_b, local_num_rows, NULL, values); - hypre_TFree(values, HYPRE_MEMORY_HOST); - - ierr = HYPRE_IJVectorGetObject( ij_b, &object ); - b = (HYPRE_ParVector) object; - - /* Initial guess */ - HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_col, last_local_col, &ij_x); - HYPRE_IJVectorSetObjectType(ij_x, HYPRE_PARCSR); - HYPRE_IJVectorInitialize(ij_x); - - values = hypre_CTAlloc(HYPRE_Real, local_num_cols, HYPRE_MEMORY_HOST); - for (i = 0; i < local_num_cols; i++) - values[i] = 1.; - HYPRE_IJVectorSetValues(ij_x, local_num_cols, NULL, values); - hypre_TFree(values, HYPRE_MEMORY_HOST); - - ierr = HYPRE_IJVectorGetObject( ij_x, &object ); - x = (HYPRE_ParVector) object; - } - - hypre_EndTiming(time_index); - hypre_PrintTiming("IJ Vector Setup", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); - - /*----------------------------------------------------------- - * Print the solution and other info - *-----------------------------------------------------------*/ - - HYPRE_IJVectorGetObjectType(ij_b, &j); - HYPRE_IJVectorPrint(ij_b, "driver.out.b"); - HYPRE_IJVectorPrint(ij_x, "driver.out.x"); - - /*----------------------------------------------------------- - * Finalize things - *-----------------------------------------------------------*/ - - HYPRE_IJMatrixDestroy(ij_A); - HYPRE_IJVectorDestroy(ij_b); - HYPRE_IJVectorDestroy(ij_x); - - hypre_MPI_Finalize(); - - return (0); -} - -/*---------------------------------------------------------------------- - * Build matrix from file. Expects three files on each processor. - * filename.D.n contains the diagonal part, filename.O.n contains - * the offdiagonal part and filename.INFO.n contains global row - * and column numbers, number of columns of offdiagonal matrix - * and the mapping of offdiagonal column numbers to global column numbers. - * Parameters given in command line. - *----------------------------------------------------------------------*/ - -HYPRE_Int -BuildParFromFile( HYPRE_Int argc, - char *argv[], - HYPRE_Int arg_index, - HYPRE_ParCSRMatrix *A_ptr ) -{ - char *filename; - - HYPRE_ParCSRMatrix A; - - HYPRE_Int myid; - - /*----------------------------------------------------------- - * Initialize some stuff - *-----------------------------------------------------------*/ - - hypre_MPI_Comm_rank(hypre_MPI_COMM_WORLD, &myid ); - - /*----------------------------------------------------------- - * Parse command line - *-----------------------------------------------------------*/ - - if (arg_index < argc) - { - filename = argv[arg_index]; - } - else - { - hypre_printf("Error: No filename specified \n"); - exit(1); - } - - /*----------------------------------------------------------- - * Print driver parameters - *-----------------------------------------------------------*/ - - if (myid == 0) - { - hypre_printf(" FromFile: %s\n", filename); - } - - /*----------------------------------------------------------- - * Generate the matrix - *-----------------------------------------------------------*/ - - HYPRE_ParCSRMatrixRead(hypre_MPI_COMM_WORLD, filename,&A); - - *A_ptr = A; - - return (0); -} - -/*---------------------------------------------------------------------- - * Build standard 7-point laplacian in 3D with grid and anisotropy. - * Parameters given in command line. - *----------------------------------------------------------------------*/ - -HYPRE_Int -BuildParLaplacian( HYPRE_Int argc, - char *argv[], - HYPRE_Int arg_index, - HYPRE_ParCSRMatrix *A_ptr ) -{ - HYPRE_BigInt nx, ny, nz; - HYPRE_Int P, Q, R; - HYPRE_Real cx, cy, cz; - - HYPRE_ParCSRMatrix A; - - HYPRE_Int num_procs, myid; - HYPRE_Int p, q, r; - HYPRE_Real *values; - - /*----------------------------------------------------------- - * Initialize some stuff - *-----------------------------------------------------------*/ - - hypre_MPI_Comm_size(hypre_MPI_COMM_WORLD, &num_procs ); - hypre_MPI_Comm_rank(hypre_MPI_COMM_WORLD, &myid ); - - /*----------------------------------------------------------- - * Set defaults - *-----------------------------------------------------------*/ - - nx = 10; - ny = 10; - nz = 10; - - P = 1; - Q = num_procs; - R = 1; - - cx = 1.0; - cy = 1.0; - cz = 1.0; - - /*----------------------------------------------------------- - * Parse command line - *-----------------------------------------------------------*/ - arg_index = 0; - while (arg_index < argc) - { - if ( strcmp(argv[arg_index], "-n") == 0 ) - { - arg_index++; - nx = atoi(argv[arg_index++]); - ny = atoi(argv[arg_index++]); - nz = atoi(argv[arg_index++]); - } - else if ( strcmp(argv[arg_index], "-P") == 0 ) - { - arg_index++; - P = atoi(argv[arg_index++]); - Q = atoi(argv[arg_index++]); - R = atoi(argv[arg_index++]); - } - else if ( strcmp(argv[arg_index], "-c") == 0 ) - { - arg_index++; - cx = atof(argv[arg_index++]); - cy = atof(argv[arg_index++]); - cz = atof(argv[arg_index++]); - } - else - { - arg_index++; - } - } - - /*----------------------------------------------------------- - * Check a few things - *-----------------------------------------------------------*/ - - if ((P*Q*R) != num_procs) - { - hypre_printf("Error: Invalid number of processors or processor topology \n"); - exit(1); - } - - /*----------------------------------------------------------- - * Print driver parameters - *-----------------------------------------------------------*/ - - if (myid == 0) - { - hypre_printf(" Laplacian:\n"); - hypre_printf(" (nx, ny, nz) = (%b, %b, %b)\n", nx, ny, nz); - hypre_printf(" (Px, Py, Pz) = (%d, %d, %d)\n", P, Q, R); - hypre_printf(" (cx, cy, cz) = (%f, %f, %f)\n\n", cx, cy, cz); - } - - /*----------------------------------------------------------- - * Set up the grid structure - *-----------------------------------------------------------*/ - - /* compute p,q,r from P,Q,R and myid */ - p = myid % P; - q = (( myid - p)/P) % Q; - r = ( myid - p - P*q)/( P*Q ); - - /*----------------------------------------------------------- - * Generate the matrix - *-----------------------------------------------------------*/ - - values = hypre_CTAlloc(HYPRE_Real, 4, HYPRE_MEMORY_HOST); - - values[1] = -cx; - values[2] = -cy; - values[3] = -cz; - - values[0] = 0.0; - if (nx > 1) - { - values[0] += 2.0*cx; - } - if (ny > 1) - { - values[0] += 2.0*cy; - } - if (nz > 1) - { - values[0] += 2.0*cz; - } - - A = (HYPRE_ParCSRMatrix) GenerateLaplacian(hypre_MPI_COMM_WORLD, - nx, ny, nz, P, Q, R, p, q, r, values); - - hypre_TFree(values, HYPRE_MEMORY_HOST); - - *A_ptr = A; - - return (0); -} - -/*---------------------------------------------------------------------- - * Build standard 7-point convection-diffusion operator - * Parameters given in command line. - * Operator: - * - * -cx Dxx - cy Dyy - cz Dzz + ax Dx + ay Dy + az Dz = f - * - *----------------------------------------------------------------------*/ - -HYPRE_Int -BuildParDifConv( HYPRE_Int argc, - char *argv[], - HYPRE_Int arg_index, - HYPRE_ParCSRMatrix *A_ptr ) -{ - HYPRE_BigInt nx, ny, nz; - HYPRE_Int P, Q, R; - HYPRE_Real cx, cy, cz; - HYPRE_Real ax, ay, az; - HYPRE_Real hinx,hiny,hinz; - - HYPRE_ParCSRMatrix A; - - HYPRE_Int num_procs, myid; - HYPRE_Int p, q, r; - HYPRE_Real *values; - - /*----------------------------------------------------------- - * Initialize some stuff - *-----------------------------------------------------------*/ - - hypre_MPI_Comm_size(hypre_MPI_COMM_WORLD, &num_procs ); - hypre_MPI_Comm_rank(hypre_MPI_COMM_WORLD, &myid ); - - /*----------------------------------------------------------- - * Set defaults - *-----------------------------------------------------------*/ - - nx = 10; - ny = 10; - nz = 10; - - hinx = 1.0/(nx+1); - hiny = 1.0/(ny+1); - hinz = 1.0/(nz+1); - - P = 1; - Q = num_procs; - R = 1; - - cx = 1.0; - cy = 1.0; - cz = 1.0; - - ax = 1.0; - ay = 1.0; - az = 1.0; - - /*----------------------------------------------------------- - * Parse command line - *-----------------------------------------------------------*/ - arg_index = 0; - while (arg_index < argc) - { - if ( strcmp(argv[arg_index], "-n") == 0 ) - { - arg_index++; - nx = atoi(argv[arg_index++]); - ny = atoi(argv[arg_index++]); - nz = atoi(argv[arg_index++]); - } - else if ( strcmp(argv[arg_index], "-P") == 0 ) - { - arg_index++; - P = atoi(argv[arg_index++]); - Q = atoi(argv[arg_index++]); - R = atoi(argv[arg_index++]); - } - else if ( strcmp(argv[arg_index], "-c") == 0 ) - { - arg_index++; - cx = atof(argv[arg_index++]); - cy = atof(argv[arg_index++]); - cz = atof(argv[arg_index++]); - } - else if ( strcmp(argv[arg_index], "-a") == 0 ) - { - arg_index++; - ax = atof(argv[arg_index++]); - ay = atof(argv[arg_index++]); - az = atof(argv[arg_index++]); - } - else - { - arg_index++; - } - } - - /*----------------------------------------------------------- - * Check a few things - *-----------------------------------------------------------*/ - - if ((P*Q*R) != num_procs) - { - hypre_printf("Error: Invalid number of processors or processor topology \n"); - exit(1); - } - - /*----------------------------------------------------------- - * Print driver parameters - *-----------------------------------------------------------*/ - - if (myid == 0) - { - hypre_printf(" Convection-Diffusion: \n"); - hypre_printf(" -cx Dxx - cy Dyy - cz Dzz + ax Dx + ay Dy + az Dz = f\n"); - hypre_printf(" (nx, ny, nz) = (%b, %b, %b)\n", nx, ny, nz); - hypre_printf(" (Px, Py, Pz) = (%d, %d, %d)\n", P, Q, R); - hypre_printf(" (cx, cy, cz) = (%f, %f, %f)\n", cx, cy, cz); - hypre_printf(" (ax, ay, az) = (%f, %f, %f)\n\n", ax, ay, az); - } - - /*----------------------------------------------------------- - * Set up the grid structure - *-----------------------------------------------------------*/ - - /* compute p,q,r from P,Q,R and myid */ - p = myid % P; - q = (( myid - p)/P) % Q; - r = ( myid - p - P*q)/( P*Q ); - - /*----------------------------------------------------------- - * Generate the matrix - *-----------------------------------------------------------*/ - - values = hypre_CTAlloc(HYPRE_Real, 7, HYPRE_MEMORY_HOST); - - values[1] = -cx/(hinx*hinx); - values[2] = -cy/(hiny*hiny); - values[3] = -cz/(hinz*hinz); - values[4] = -cx/(hinx*hinx) + ax/hinx; - values[5] = -cy/(hiny*hiny) + ay/hiny; - values[6] = -cz/(hinz*hinz) + az/hinz; - - values[0] = 0.0; - if (nx > 1) - { - values[0] += 2.0*cx/(hinx*hinx) - 1.0*ax/hinx; - } - if (ny > 1) - { - values[0] += 2.0*cy/(hiny*hiny) - 1.0*ay/hiny; - } - if (nz > 1) - { - values[0] += 2.0*cz/(hinz*hinz) - 1.0*az/hinz; - } - - A = (HYPRE_ParCSRMatrix) GenerateDifConv(hypre_MPI_COMM_WORLD, - nx, ny, nz, P, Q, R, p, q, r, values); - - hypre_TFree(values, HYPRE_MEMORY_HOST); - - *A_ptr = A; - - return (0); -} - -/*---------------------------------------------------------------------- - * Build matrix from one file on Proc. 0. Expects matrix to be in - * CSR format. Distributes matrix across processors giving each about - * the same number of rows. - * Parameters given in command line. - *----------------------------------------------------------------------*/ - -HYPRE_Int -BuildParFromOneFile( HYPRE_Int argc, - char *argv[], - HYPRE_Int arg_index, - HYPRE_ParCSRMatrix *A_ptr ) -{ - char *filename; - - HYPRE_ParCSRMatrix A; - HYPRE_CSRMatrix A_CSR = NULL; - - HYPRE_Int myid; - - /*----------------------------------------------------------- - * Initialize some stuff - *-----------------------------------------------------------*/ - - hypre_MPI_Comm_rank(hypre_MPI_COMM_WORLD, &myid ); - - /*----------------------------------------------------------- - * Parse command line - *-----------------------------------------------------------*/ - - if (arg_index < argc) - { - filename = argv[arg_index]; - } - else - { - hypre_printf("Error: No filename specified \n"); - exit(1); - } - - /*----------------------------------------------------------- - * Print driver parameters - *-----------------------------------------------------------*/ - - if (myid == 0) - { - hypre_printf(" FromFile: %s\n", filename); - - /*----------------------------------------------------------- - * Generate the matrix - *-----------------------------------------------------------*/ - - A_CSR = HYPRE_CSRMatrixRead(filename); - } - HYPRE_CSRMatrixToParCSRMatrix(hypre_MPI_COMM_WORLD, A_CSR, NULL, NULL, &A); - - *A_ptr = A; - - if (myid == 0) HYPRE_CSRMatrixDestroy(A_CSR); - - return (0); -} - -/*---------------------------------------------------------------------- - * Build Rhs from one file on Proc. 0. Distributes vector across processors - * giving each about using the distribution of the matrix A. - *----------------------------------------------------------------------*/ - -HYPRE_Int -BuildRhsParFromOneFile( HYPRE_Int argc, - char *argv[], - HYPRE_Int arg_index, - HYPRE_BigInt *partitioning, - HYPRE_ParVector *b_ptr ) -{ - char *filename; - - HYPRE_ParVector b; - HYPRE_Vector b_CSR=NULL; - - HYPRE_Int myid; - - /*----------------------------------------------------------- - * Initialize some stuff - *-----------------------------------------------------------*/ - - hypre_MPI_Comm_rank(hypre_MPI_COMM_WORLD, &myid ); - - /*----------------------------------------------------------- - * Parse command line - *-----------------------------------------------------------*/ - - if (arg_index < argc) - { - filename = argv[arg_index]; - } - else - { - hypre_printf("Error: No filename specified \n"); - exit(1); - } - - /*----------------------------------------------------------- - * Print driver parameters - *-----------------------------------------------------------*/ - - if (myid == 0) - { - hypre_printf(" Rhs FromFile: %s\n", filename); - - /*----------------------------------------------------------- - * Generate the matrix - *-----------------------------------------------------------*/ - - b_CSR = HYPRE_VectorRead(filename); - } - HYPRE_VectorToParVector(hypre_MPI_COMM_WORLD, b_CSR, partitioning,&b); - - *b_ptr = b; - - HYPRE_VectorDestroy(b_CSR); - - return (0); -} - -/*---------------------------------------------------------------------- - * Build standard 9-point laplacian in 2D with grid and anisotropy. - * Parameters given in command line. - *----------------------------------------------------------------------*/ - -HYPRE_Int -BuildParLaplacian9pt( HYPRE_Int argc, - char *argv[], - HYPRE_Int arg_index, - HYPRE_ParCSRMatrix *A_ptr ) -{ - HYPRE_BigInt nx, ny; - HYPRE_Int P, Q; - - HYPRE_ParCSRMatrix A; - - HYPRE_Int num_procs, myid; - HYPRE_Int p, q; - HYPRE_Real *values; - - /*----------------------------------------------------------- - * Initialize some stuff - *-----------------------------------------------------------*/ - - hypre_MPI_Comm_size(hypre_MPI_COMM_WORLD, &num_procs ); - hypre_MPI_Comm_rank(hypre_MPI_COMM_WORLD, &myid ); - - /*----------------------------------------------------------- - * Set defaults - *-----------------------------------------------------------*/ - - nx = 10; - ny = 10; - - P = 1; - Q = num_procs; - - /*----------------------------------------------------------- - * Parse command line - *-----------------------------------------------------------*/ - arg_index = 0; - while (arg_index < argc) - { - if ( strcmp(argv[arg_index], "-n") == 0 ) - { - arg_index++; - nx = atoi(argv[arg_index++]); - ny = atoi(argv[arg_index++]); - } - else if ( strcmp(argv[arg_index], "-P") == 0 ) - { - arg_index++; - P = atoi(argv[arg_index++]); - Q = atoi(argv[arg_index++]); - } - else - { - arg_index++; - } - } - - /*----------------------------------------------------------- - * Check a few things - *-----------------------------------------------------------*/ - - if ((P*Q) != num_procs) - { - hypre_printf("Error: Invalid number of processors or processor topology \n"); - exit(1); - } - - /*----------------------------------------------------------- - * Print driver parameters - *-----------------------------------------------------------*/ - - if (myid == 0) - { - hypre_printf(" Laplacian 9pt:\n"); - hypre_printf(" (nx, ny) = (%b, %b)\n", nx, ny); - hypre_printf(" (Px, Py) = (%d, %d)\n", P, Q); - } - - /*----------------------------------------------------------- - * Set up the grid structure - *-----------------------------------------------------------*/ - - /* compute p,q from P,Q and myid */ - p = myid % P; - q = ( myid - p)/P; - - /*----------------------------------------------------------- - * Generate the matrix - *-----------------------------------------------------------*/ - - values = hypre_CTAlloc(HYPRE_Real, 2, HYPRE_MEMORY_HOST); - - values[1] = -1.0; - - values[0] = 0.0; - if (nx > 1) - { - values[0] += 2.0; - } - if (ny > 1) - { - values[0] += 2.0; - } - if (nx > 1 && ny > 1) - { - values[0] += 4.0; - } - - A = (HYPRE_ParCSRMatrix) GenerateLaplacian9pt(hypre_MPI_COMM_WORLD, - nx, ny, P, Q, p, q, values); - - hypre_TFree(values, HYPRE_MEMORY_HOST); - - *A_ptr = A; - - return (0); -} -/*---------------------------------------------------------------------- - * Build 27-point laplacian in 3D, - * Parameters given in command line. - *----------------------------------------------------------------------*/ - -HYPRE_Int -BuildParLaplacian27pt( HYPRE_Int argc, - char *argv[], - HYPRE_Int arg_index, - HYPRE_ParCSRMatrix *A_ptr ) -{ - HYPRE_Int nx, ny, nz; - HYPRE_Int P, Q, R; - - HYPRE_ParCSRMatrix A; - - HYPRE_Int num_procs, myid; - HYPRE_Int p, q, r; - HYPRE_Real *values; - - /*----------------------------------------------------------- - * Initialize some stuff - *-----------------------------------------------------------*/ - - hypre_MPI_Comm_size(hypre_MPI_COMM_WORLD, &num_procs ); - hypre_MPI_Comm_rank(hypre_MPI_COMM_WORLD, &myid ); - - /*----------------------------------------------------------- - * Set defaults - *-----------------------------------------------------------*/ - - nx = 10; - ny = 10; - nz = 10; - - P = 1; - Q = num_procs; - R = 1; - - /*----------------------------------------------------------- - * Parse command line - *-----------------------------------------------------------*/ - arg_index = 0; - while (arg_index < argc) - { - if ( strcmp(argv[arg_index], "-n") == 0 ) - { - arg_index++; - nx = atoi(argv[arg_index++]); - ny = atoi(argv[arg_index++]); - nz = atoi(argv[arg_index++]); - } - else if ( strcmp(argv[arg_index], "-P") == 0 ) - { - arg_index++; - P = atoi(argv[arg_index++]); - Q = atoi(argv[arg_index++]); - R = atoi(argv[arg_index++]); - } - else - { - arg_index++; - } - } - - /*----------------------------------------------------------- - * Check a few things - *-----------------------------------------------------------*/ - - if ((P*Q*R) != num_procs) - { - hypre_printf("Error: Invalid number of processors or processor topology \n"); - exit(1); - } - - /*----------------------------------------------------------- - * Print driver parameters - *-----------------------------------------------------------*/ - - if (myid == 0) - { - hypre_printf(" Laplacian_27pt:\n"); - hypre_printf(" (nx, ny, nz) = (%b, %b, %b)\n", nx, ny, nz); - hypre_printf(" (Px, Py, Pz) = (%d, %d, %d)\n\n", P, Q, R); - } - - /*----------------------------------------------------------- - * Set up the grid structure - *-----------------------------------------------------------*/ - - /* compute p,q,r from P,Q,R and myid */ - p = myid % P; - q = (( myid - p)/P) % Q; - r = ( myid - p - P*q)/( P*Q ); - - /*----------------------------------------------------------- - * Generate the matrix - *-----------------------------------------------------------*/ - - values = hypre_CTAlloc(HYPRE_Real, 2, HYPRE_MEMORY_HOST); - - values[0] = 26.0; - if (nx == 1 || ny == 1 || nz == 1) - values[0] = 8.0; - if (nx*ny == 1 || nx*nz == 1 || ny*nz == 1) - values[0] = 2.0; - values[1] = -1.0; - - A = (HYPRE_ParCSRMatrix) GenerateLaplacian27pt(hypre_MPI_COMM_WORLD, - nx, ny, nz, P, Q, R, p, q, r, values); - - hypre_TFree(values, HYPRE_MEMORY_HOST); - - *A_ptr = A; - - return (0); -} diff --git a/external/hypre/src/test/maxwell_unscaled.c b/external/hypre/src/test/maxwell_unscaled.c index 940fcb6e..933133fb 100644 --- a/external/hypre/src/test/maxwell_unscaled.c +++ b/external/hypre/src/test/maxwell_unscaled.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -96,6 +96,8 @@ typedef struct ProblemPartData *pdata; HYPRE_Int max_boxsize; + HYPRE_MemoryLocation memory_location; + HYPRE_Int nstencils; HYPRE_Int *stencil_sizes; Index **stencil_offsets; @@ -159,19 +161,19 @@ SScanProblemIndex( char *sdata_ptr, switch (ndim) { case 1: - hypre_sscanf(sdata_ptr, "%d%c", - &index[0], &sign[0]); - break; + hypre_sscanf(sdata_ptr, "%d%c", + &index[0], &sign[0]); + break; case 2: - hypre_sscanf(sdata_ptr, "%d%c%d%c", - &index[0], &sign[0], &index[1], &sign[1]); - break; + hypre_sscanf(sdata_ptr, "%d%c%d%c", + &index[0], &sign[0], &index[1], &sign[1]); + break; case 3: - hypre_sscanf(sdata_ptr, "%d%c%d%c%d%c", - &index[0], &sign[0], &index[1], &sign[1], &index[2], &sign[2]); - break; + hypre_sscanf(sdata_ptr, "%d%c%d%c%d%c", + &index[0], &sign[0], &index[1], &sign[1], &index[2], &sign[2]); + break; } sdata_ptr += strcspn(sdata_ptr, ":)"); if ( *sdata_ptr == ':' ) @@ -195,7 +197,7 @@ SScanProblemIndex( char *sdata_ptr, /* pre-shift the index */ for (i = 0; i < ndim; i++) { - index[i] += index[i+6]; + index[i] += index[i + 6]; } } sdata_ptr += strcspn(sdata_ptr, ")") + 1; @@ -204,7 +206,7 @@ SScanProblemIndex( char *sdata_ptr, { if (sign[i] == '+') { - index[i+3] = 1; + index[i + 3] = 1; } } @@ -234,6 +236,8 @@ ReadData( char *filename, HYPRE_Int part, var, entry, s, i, il, iu; + HYPRE_MemoryLocation memory_location = data_ptr -> memory_location; + /*----------------------------------------------------------- * Read data file from process 0, then broadcast *-----------------------------------------------------------*/ @@ -253,7 +257,7 @@ ReadData( char *filename, sdata = hypre_TAlloc(char, memchunk, HYPRE_MEMORY_HOST); sdata_line = fgets(sdata, maxline, file); - s= 0; + s = 0; while (sdata_line != NULL) { sdata_size += strlen(sdata_line) + 1; @@ -262,12 +266,14 @@ ReadData( char *filename, if ((sdata_size + maxline) > s) { sdata = hypre_TReAlloc(sdata, char, (sdata_size + memchunk), HYPRE_MEMORY_HOST); - s= sdata_size + memchunk; + s = sdata_size + memchunk; } /* read the next input line */ sdata_line = fgets((sdata + sdata_size), maxline, file); } + + fclose(file); } /* broadcast the data size */ @@ -281,6 +287,7 @@ ReadData( char *filename, * Parse the data and fill ProblemData structure *-----------------------------------------------------------*/ + data.memory_location = memory_location; data.max_boxsize = 0; data.symmetric_nentries = 0; data.symmetric_parts = NULL; @@ -327,8 +334,8 @@ ReadData( char *filename, iu = 1; for (i = 0; i < data.ndim; i++) { - il *= pdata.ilowers[pdata.nboxes][i+3]; - iu *= pdata.iuppers[pdata.nboxes][i+3]; + il *= pdata.ilowers[pdata.nboxes][i + 3]; + iu *= pdata.iuppers[pdata.nboxes][i + 3]; } if ( (il != 0) || (iu != 1) ) { @@ -443,7 +450,7 @@ ReadData( char *filename, data.stencil_offsets[s][entry][i] = 0; } data.stencil_vars[s][entry] = strtol(sdata_ptr, &sdata_ptr, 10); - data.stencil_values[s][entry] = strtod(sdata_ptr, &sdata_ptr); + data.stencil_values[s][entry] = (HYPRE_Real)strtod(sdata_ptr, &sdata_ptr); } else if ( strcmp(key, "GraphSetStencil:") == 0 ) { @@ -493,7 +500,7 @@ ReadData( char *filename, hypre_TReAlloc(pdata.graph_values, HYPRE_Real, size, HYPRE_MEMORY_HOST); pdata.d_graph_values = hypre_TReAlloc_v2(pdata.d_graph_values, HYPRE_Real, pdata.graph_values_size, - HYPRE_Real, size, HYPRE_MEMORY_DEVICE); + HYPRE_Real, size, memory_location); pdata.graph_values_size = size; pdata.graph_boxsizes = hypre_TReAlloc(pdata.graph_boxsizes, HYPRE_Int, size, HYPRE_MEMORY_HOST); @@ -542,7 +549,7 @@ ReadData( char *filename, pdata.graph_entries[pdata.graph_nentries] = strtol(sdata_ptr, &sdata_ptr, 10); pdata.graph_values[pdata.graph_nentries] = - strtod(sdata_ptr, &sdata_ptr); + (HYPRE_Real)strtod(sdata_ptr, &sdata_ptr); pdata.graph_boxsizes[pdata.graph_nentries] = 1; for (i = 0; i < 3; i++) { @@ -602,7 +609,7 @@ ReadData( char *filename, hypre_TReAlloc(pdata.matrix_values, HYPRE_Real, size, HYPRE_MEMORY_HOST); pdata.d_matrix_values = hypre_TReAlloc_v2(pdata.d_matrix_values, HYPRE_Real, pdata.matrix_values_size, - HYPRE_Real, size, HYPRE_MEMORY_DEVICE); + HYPRE_Real, size, memory_location); pdata.matrix_values_size = size; } SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, @@ -620,7 +627,7 @@ ReadData( char *filename, pdata.matrix_entries[pdata.matrix_nentries] = strtol(sdata_ptr, &sdata_ptr, 10); pdata.matrix_values[pdata.matrix_nentries] = - strtod(sdata_ptr, &sdata_ptr); + (HYPRE_Real)strtod(sdata_ptr, &sdata_ptr); pdata.matrix_nentries++; data.pdata[part] = pdata; } @@ -628,9 +635,9 @@ ReadData( char *filename, else if ( strcmp(key, "rfactor:") == 0 ) { SScanIntArray(sdata_ptr, &sdata_ptr, data.ndim, data.rfactor); - for (i= data.ndim; i< 3; i++) + for (i = data.ndim; i < 3; i++) { - data.rfactor[i]= 1; + data.rfactor[i] = 1; } } @@ -676,9 +683,9 @@ MapProblemIndex( ProblemIndex index, index[1] -= index[7]; index[2] -= index[8]; /* map the index */ - index[0] = m[0]*index[0] + (m[0]-1)*index[3]; - index[1] = m[1]*index[1] + (m[1]-1)*index[4]; - index[2] = m[2]*index[2] + (m[2]-1)*index[5]; + index[0] = m[0] * index[0] + (m[0] - 1) * index[3]; + index[1] = m[1] * index[1] + (m[1] - 1) * index[4]; + index[2] = m[2] * index[2] + (m[2] - 1) * index[5]; /* pre-shift the new mapped index */ index[0] += index[6]; index[1] += index[7]; @@ -717,6 +724,7 @@ DistributeData( ProblemData global_data, HYPRE_Int myid, ProblemData *data_ptr ) { + HYPRE_MemoryLocation memory_location = global_data.memory_location; ProblemData data = global_data; ProblemPartData pdata; HYPRE_Int *pool_procs; @@ -726,7 +734,7 @@ DistributeData( ProblemData global_data, ProblemIndex int_ilower, int_iupper; /* determine first process number in each pool */ - pool_procs = hypre_CTAlloc(HYPRE_Int, (data.npools+1), HYPRE_MEMORY_HOST); + pool_procs = hypre_CTAlloc(HYPRE_Int, (data.npools + 1), HYPRE_MEMORY_HOST); for (part = 0; part < data.nparts; part++) { pool = data.pools[part] + 1; @@ -802,7 +810,7 @@ DistributeData( ProblemData global_data, { p = pid % m[0]; q = ((pid - p) / m[0]) % m[1]; - r = (pid - p - q*m[0]) / (m[0]*m[1]); + r = (pid - p - q * m[0]) / (m[0] * m[1]); for (box = 0; box < pdata.nboxes; box++) { @@ -816,12 +824,12 @@ DistributeData( ProblemData global_data, pdata.iuppers[box][1] = pdata.ilowers[box][1] + n[1] - 1; pdata.iuppers[box][2] = pdata.ilowers[box][2] + n[2] - 1; - pdata.ilowers[box][0] = pdata.ilowers[box][0] + p*n[0]; - pdata.ilowers[box][1] = pdata.ilowers[box][1] + q*n[1]; - pdata.ilowers[box][2] = pdata.ilowers[box][2] + r*n[2]; - pdata.iuppers[box][0] = pdata.iuppers[box][0] + p*n[0]; - pdata.iuppers[box][1] = pdata.iuppers[box][1] + q*n[1]; - pdata.iuppers[box][2] = pdata.iuppers[box][2] + r*n[2]; + pdata.ilowers[box][0] = pdata.ilowers[box][0] + p * n[0]; + pdata.ilowers[box][1] = pdata.ilowers[box][1] + q * n[1]; + pdata.ilowers[box][2] = pdata.ilowers[box][2] + r * n[2]; + pdata.iuppers[box][0] = pdata.iuppers[box][0] + p * n[0]; + pdata.iuppers[box][1] = pdata.iuppers[box][1] + q * n[1]; + pdata.iuppers[box][2] = pdata.iuppers[box][2] + r * n[2]; } i = 0; @@ -935,11 +943,11 @@ DistributeData( ProblemData global_data, if ( (m[0] * m[1] * m[2]) > 1) { pdata.ilowers = hypre_TReAlloc(pdata.ilowers, ProblemIndex, - m[0]*m[1]*m[2]*pdata.nboxes, HYPRE_MEMORY_HOST); + m[0] * m[1] * m[2] * pdata.nboxes, HYPRE_MEMORY_HOST); pdata.iuppers = hypre_TReAlloc(pdata.iuppers, ProblemIndex, - m[0]*m[1]*m[2]*pdata.nboxes, HYPRE_MEMORY_HOST); + m[0] * m[1] * m[2] * pdata.nboxes, HYPRE_MEMORY_HOST); pdata.boxsizes = hypre_TReAlloc(pdata.boxsizes, HYPRE_Int, - m[0]*m[1]*m[2]*pdata.nboxes, HYPRE_MEMORY_HOST); + m[0] * m[1] * m[2] * pdata.nboxes, HYPRE_MEMORY_HOST); for (box = 0; box < pdata.nboxes; box++) { n[0] = pdata.iuppers[box][0] - pdata.ilowers[box][0] + 1; @@ -960,12 +968,12 @@ DistributeData( ProblemData global_data, { for (p = 0; p < m[0]; p++) { - pdata.ilowers[i][0] = pdata.ilowers[box][0] + p*n[0]; - pdata.ilowers[i][1] = pdata.ilowers[box][1] + q*n[1]; - pdata.ilowers[i][2] = pdata.ilowers[box][2] + r*n[2]; - pdata.iuppers[i][0] = pdata.iuppers[box][0] + p*n[0]; - pdata.iuppers[i][1] = pdata.iuppers[box][1] + q*n[1]; - pdata.iuppers[i][2] = pdata.iuppers[box][2] + r*n[2]; + pdata.ilowers[i][0] = pdata.ilowers[box][0] + p * n[0]; + pdata.ilowers[i][1] = pdata.ilowers[box][1] + q * n[1]; + pdata.ilowers[i][2] = pdata.ilowers[box][2] + r * n[2]; + pdata.iuppers[i][0] = pdata.iuppers[box][0] + p * n[0]; + pdata.iuppers[i][1] = pdata.iuppers[box][1] + q * n[1]; + pdata.iuppers[i][2] = pdata.iuppers[box][2] + r * n[2]; for (d = 3; d < 9; d++) { pdata.ilowers[i][d] = pdata.ilowers[box][d]; @@ -976,7 +984,7 @@ DistributeData( ProblemData global_data, } } } - pdata.nboxes *= m[0]*m[1]*m[2]; + pdata.nboxes *= m[0] * m[1] * m[2]; for (entry = 0; entry < pdata.graph_nentries; entry++) { @@ -1072,7 +1080,7 @@ DistributeData( ProblemData global_data, hypre_TFree(pdata.graph_entries, HYPRE_MEMORY_HOST); pdata.graph_values_size = 0; hypre_TFree(pdata.graph_values, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.d_graph_values, HYPRE_MEMORY_DEVICE); + hypre_TFree(pdata.d_graph_values, memory_location); hypre_TFree(pdata.graph_boxsizes, HYPRE_MEMORY_HOST); } @@ -1085,7 +1093,7 @@ DistributeData( ProblemData global_data, hypre_TFree(pdata.matrix_entries, HYPRE_MEMORY_HOST); pdata.matrix_values_size = 0; hypre_TFree(pdata.matrix_values, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.d_matrix_values, HYPRE_MEMORY_DEVICE); + hypre_TFree(pdata.d_matrix_values, memory_location); } data.pdata[part] = pdata; @@ -1111,6 +1119,7 @@ DistributeData( ProblemData global_data, HYPRE_Int DestroyData( ProblemData data ) { + HYPRE_MemoryLocation memory_location = data.memory_location; ProblemPartData pdata; HYPRE_Int part, s; @@ -1166,7 +1175,7 @@ DestroyData( ProblemData data ) hypre_TFree(pdata.graph_index_signs, HYPRE_MEMORY_HOST); hypre_TFree(pdata.graph_entries, HYPRE_MEMORY_HOST); hypre_TFree(pdata.graph_values, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.d_graph_values, HYPRE_MEMORY_DEVICE); + hypre_TFree(pdata.d_graph_values, memory_location); hypre_TFree(pdata.graph_boxsizes, HYPRE_MEMORY_HOST); } @@ -1178,7 +1187,7 @@ DestroyData( ProblemData data ) hypre_TFree(pdata.matrix_vars, HYPRE_MEMORY_HOST); hypre_TFree(pdata.matrix_entries, HYPRE_MEMORY_HOST); hypre_TFree(pdata.matrix_values, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.d_matrix_values, HYPRE_MEMORY_DEVICE); + hypre_TFree(pdata.d_matrix_values, memory_location); } } @@ -1229,34 +1238,34 @@ GetVariableBox( Index cell_ilower, var_iupper[1] = cell_iupper[1]; var_iupper[2] = cell_iupper[2]; - switch(vartype) + switch (vartype) { case HYPRE_SSTRUCT_VARIABLE_CELL: - var_ilower[0] -= 0; var_ilower[1] -= 0; var_ilower[2] -= 0; - break; + var_ilower[0] -= 0; var_ilower[1] -= 0; var_ilower[2] -= 0; + break; case HYPRE_SSTRUCT_VARIABLE_NODE: - var_ilower[0] -= 1; var_ilower[1] -= 1; var_ilower[2] -= 1; - break; + var_ilower[0] -= 1; var_ilower[1] -= 1; var_ilower[2] -= 1; + break; case HYPRE_SSTRUCT_VARIABLE_XFACE: - var_ilower[0] -= 1; var_ilower[1] -= 0; var_ilower[2] -= 0; - break; + var_ilower[0] -= 1; var_ilower[1] -= 0; var_ilower[2] -= 0; + break; case HYPRE_SSTRUCT_VARIABLE_YFACE: - var_ilower[0] -= 0; var_ilower[1] -= 1; var_ilower[2] -= 0; - break; + var_ilower[0] -= 0; var_ilower[1] -= 1; var_ilower[2] -= 0; + break; case HYPRE_SSTRUCT_VARIABLE_ZFACE: - var_ilower[0] -= 0; var_ilower[1] -= 0; var_ilower[2] -= 1; - break; + var_ilower[0] -= 0; var_ilower[1] -= 0; var_ilower[2] -= 1; + break; case HYPRE_SSTRUCT_VARIABLE_XEDGE: - var_ilower[0] -= 0; var_ilower[1] -= 1; var_ilower[2] -= 1; - break; + var_ilower[0] -= 0; var_ilower[1] -= 1; var_ilower[2] -= 1; + break; case HYPRE_SSTRUCT_VARIABLE_YEDGE: - var_ilower[0] -= 1; var_ilower[1] -= 0; var_ilower[2] -= 1; - break; + var_ilower[0] -= 1; var_ilower[1] -= 0; var_ilower[2] -= 1; + break; case HYPRE_SSTRUCT_VARIABLE_ZEDGE: - var_ilower[0] -= 1; var_ilower[1] -= 1; var_ilower[2] -= 0; - break; + var_ilower[0] -= 1; var_ilower[1] -= 1; var_ilower[2] -= 0; + break; case HYPRE_SSTRUCT_VARIABLE_UNDEFINED: - break; + break; } return ierr; @@ -1275,7 +1284,7 @@ PrintUsage( char *progname, hypre_printf("Usage: %s []\n", progname); hypre_printf("\n"); hypre_printf(" -in : input file (default is `%s')\n", - infile_default); + infile_default); hypre_printf("\n"); hypre_printf(" -pt ... : set part(s) for subsequent options\n"); hypre_printf(" -r : refine part(s)\n"); @@ -1340,11 +1349,24 @@ main( hypre_int argc, HYPRE_Int arg_index, part, box, var, entry, s, i, j, k; +#if defined(HYPRE_USING_MEMORY_TRACKER) + HYPRE_Int print_mem_tracker = 0; + char mem_tracker_name[HYPRE_MAX_FILE_NAME_LEN] = {0}; +#endif + #if defined(HYPRE_USING_GPU) - HYPRE_Int spgemm_use_cusparse = 0; + HYPRE_Int spgemm_use_vendor = 0; #endif + +#if defined(HYPRE_TEST_USING_HOST) + HYPRE_MemoryLocation memory_location = HYPRE_MEMORY_HOST; HYPRE_ExecutionPolicy default_exec_policy = HYPRE_EXEC_HOST; +#else HYPRE_MemoryLocation memory_location = HYPRE_MEMORY_DEVICE; + HYPRE_ExecutionPolicy default_exec_policy = HYPRE_EXEC_DEVICE; +#endif + + global_data.memory_location = memory_location; /*----------------------------------------------------------- * Initialize some stuff @@ -1357,14 +1379,15 @@ main( hypre_int argc, /*----------------------------------------------------------------- * GPU Device binding - * Must be done before HYPRE_Init() and should not be changed after + * Must be done before HYPRE_Initialize() and should not be changed after *-----------------------------------------------------------------*/ - hypre_bind_device(myid, num_procs, hypre_MPI_COMM_WORLD); + hypre_bind_device_id(-1, myid, num_procs, hypre_MPI_COMM_WORLD); /*----------------------------------------------------------- * Initialize : must be the first HYPRE function to call *-----------------------------------------------------------*/ - HYPRE_Init(); + HYPRE_Initialize(); + HYPRE_DeviceInitialize(); /*----------------------------------------------------------- * Read input file @@ -1406,6 +1429,7 @@ main( hypre_int argc, } } + solver_id = 0; print_system = 0; /*----------------------------------------------------------- @@ -1475,7 +1499,6 @@ main( hypre_int argc, arg_index++; print_system = 1; } -#if defined(HYPRE_USING_GPU) else if ( strcmp(argv[arg_index], "-exec_host") == 0 ) { arg_index++; @@ -1486,10 +1509,23 @@ main( hypre_int argc, arg_index++; default_exec_policy = HYPRE_EXEC_DEVICE; } - else if ( strcmp(argv[arg_index], "-mm_cusparse") == 0 ) +#if defined(HYPRE_USING_GPU) + else if ( strcmp(argv[arg_index], "-mm_vendor") == 0 ) + { + arg_index++; + spgemm_use_vendor = atoi(argv[arg_index++]); + } +#endif +#if defined(HYPRE_USING_MEMORY_TRACKER) + else if ( strcmp(argv[arg_index], "-print_mem_tracker") == 0 ) + { + arg_index++; + print_mem_tracker = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-mem_tracker_filename") == 0 ) { arg_index++; - spgemm_use_cusparse = atoi(argv[arg_index++]); + snprintf(mem_tracker_name, HYPRE_MAX_FILE_NAME_LEN, "%s", argv[arg_index++]); } #endif else if ( strcmp(argv[arg_index], "-help") == 0 ) @@ -1504,6 +1540,11 @@ main( hypre_int argc, } } +#if defined(HYPRE_USING_MEMORY_TRACKER) + hypre_MemoryTrackerSetPrint(print_mem_tracker); + if (mem_tracker_name[0]) { hypre_MemoryTrackerSetFileName(mem_tracker_name); } +#endif + /* default memory location */ HYPRE_SetMemoryLocation(memory_location); @@ -1511,10 +1552,9 @@ main( hypre_int argc, HYPRE_SetExecutionPolicy(default_exec_policy); #if defined(HYPRE_USING_GPU) - HYPRE_SetSpGemmUseCusparse(spgemm_use_cusparse); + HYPRE_SetSpGemmUseVendor(spgemm_use_vendor); #endif - /*----------------------------------------------------------- * Distribute data *-----------------------------------------------------------*/ @@ -1625,7 +1665,7 @@ main( hypre_int argc, k /= pdata.graph_strides[entry][i]; k *= pdata.graph_index_signs[entry][i]; to_index[j] = pdata.graph_to_ilowers[entry][j] + - k * pdata.graph_to_strides[entry][j]; + k * pdata.graph_to_strides[entry][j]; } HYPRE_SStructGraphAddEntries(graph, part, index, pdata.graph_vars[entry], @@ -1645,7 +1685,7 @@ main( hypre_int argc, *-----------------------------------------------------------*/ values = hypre_CTAlloc(HYPRE_Real, data.max_boxsize, HYPRE_MEMORY_HOST); - d_values = hypre_TAlloc(HYPRE_Real, data.max_boxsize, HYPRE_MEMORY_DEVICE); + d_values = hypre_TAlloc(HYPRE_Real, data.max_boxsize, memory_location); HYPRE_SStructMatrixCreate(hypre_MPI_COMM_WORLD, graph, &A); @@ -1669,10 +1709,10 @@ main( hypre_int argc, cell_grid = hypre_SStructPGridCellSGrid(hypre_SStructGridPGrid(grid, part)); bounding_box = hypre_StructGridBoundingBox(cell_grid); - h = (HYPRE_Real) (hypre_BoxIMax(bounding_box)[0]- hypre_BoxIMin(bounding_box)[0]); + h = (HYPRE_Real) (hypre_BoxIMax(bounding_box)[0] - hypre_BoxIMin(bounding_box)[0]); for (i = 1; i < data.ndim; i++) { - if ((hypre_BoxIMax(bounding_box)[i]- hypre_BoxIMin(bounding_box)[i]) > h) + if ((hypre_BoxIMax(bounding_box)[i] - hypre_BoxIMin(bounding_box)[i]) > h) { h = (HYPRE_Real) (hypre_BoxIMax(bounding_box)[i] - hypre_BoxIMin(bounding_box)[i]); } @@ -1687,18 +1727,18 @@ main( hypre_int argc, { for (j = 0; j < pdata.max_boxsize; j++) { - values[j] = h*data.stencil_values[s][i]; + values[j] = h * data.stencil_values[s][i]; } if (i < 9) { for (j = 0; j < pdata.max_boxsize; j++) { - values[j] += data.stencil_values[s+data.ndim][i] / h; + values[j] += data.stencil_values[s + data.ndim][i] / h; } } hypre_TMemcpy(d_values, values, HYPRE_Real, data.max_boxsize, - HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); + memory_location, HYPRE_MEMORY_HOST); for (box = 0; box < pdata.nboxes; box++) { @@ -1711,7 +1751,7 @@ main( hypre_int argc, } hypre_TMemcpy(pdata.d_graph_values, pdata.graph_values, HYPRE_Real, pdata.graph_values_size, - HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); + memory_location, HYPRE_MEMORY_HOST); /* set non-stencil entries */ for (entry = 0; entry < pdata.graph_nentries; entry++) @@ -1748,7 +1788,7 @@ main( hypre_int argc, pdata = data.pdata[part]; hypre_TMemcpy(pdata.d_matrix_values, pdata.matrix_values, HYPRE_Real, pdata.matrix_values_size, - HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); + memory_location, HYPRE_MEMORY_HOST); for (entry = 0; entry < pdata.matrix_nentries; entry++) { @@ -1807,13 +1847,13 @@ main( hypre_int argc, HYPRE_SStructVectorInitialize(b); for (j = 0; j < data.max_boxsize; j++) { - values[j]= sin((HYPRE_Real)(j+1)); - values[j]= (HYPRE_Real) hypre_Rand(); - values[j]= (HYPRE_Real) j; + values[j] = hypre_sin((HYPRE_Real)(j + 1)); + values[j] = (HYPRE_Real) hypre_Rand(); + values[j] = (HYPRE_Real) j; } hypre_TMemcpy(d_values, values, HYPRE_Real, data.max_boxsize, - HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); + memory_location, HYPRE_MEMORY_HOST); for (part = 0; part < data.nparts; part++) { @@ -1841,7 +1881,7 @@ main( hypre_int argc, } hypre_TMemcpy(d_values, values, HYPRE_Real, data.max_boxsize, - HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); + memory_location, HYPRE_MEMORY_HOST); for (part = 0; part < data.nparts; part++) { @@ -1889,7 +1929,7 @@ main( hypre_int argc, *-----------------------------------------------------------*/ hypre_TFree(values, HYPRE_MEMORY_HOST); - hypre_TFree(d_values, HYPRE_MEMORY_DEVICE); + hypre_TFree(d_values, memory_location); if (solver_id == 1) { @@ -1926,7 +1966,7 @@ main( hypre_int argc, HYPRE_SStructMaxwellGetNumIterations(solver, &num_iterations); HYPRE_SStructMaxwellGetFinalRelativeResidualNorm( - solver, &final_res_norm); + solver, &final_res_norm); HYPRE_SStructMaxwellDestroy(solver); } @@ -1979,6 +2019,16 @@ main( hypre_int argc, /* Finalize MPI */ hypre_MPI_Finalize(); +#if defined(HYPRE_USING_MEMORY_TRACKER) + if (memory_location == HYPRE_MEMORY_HOST) + { + if (hypre_total_bytes[hypre_MEMORY_DEVICE] || hypre_total_bytes[hypre_MEMORY_UNIFIED]) + { + hypre_printf("Error: nonzero GPU memory allocated with the HOST mode\n"); + hypre_assert(0); + } + } +#endif + return (0); } - diff --git a/external/hypre/src/test/new_ij.c b/external/hypre/src/test/new_ij.c index b6674a2c..e786b6f1 100644 --- a/external/hypre/src/test/new_ij.c +++ b/external/hypre/src/test/new_ij.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -29,41 +29,57 @@ extern "C" { #endif -HYPRE_Int BuildParFromFile (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildParRhsFromFile (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParVector *b_ptr ); - -HYPRE_Int BuildParLaplacian (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildParSysLaplacian (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildParDifConv (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildParFromOneFile (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_Int num_functions , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildFuncsFromFiles (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix A , HYPRE_Int **dof_func_ptr ); -HYPRE_Int BuildFuncsFromOneFile (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix A , HYPRE_Int **dof_func_ptr ); -HYPRE_Int BuildRhsParFromOneFile (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_Int *partitioning , HYPRE_ParVector *b_ptr ); -HYPRE_Int BuildParLaplacian9pt (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildParLaplacian27pt (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildParRotate7pt (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildParVarDifConv (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr , HYPRE_ParVector *rhs_ptr ); -HYPRE_ParCSRMatrix GenerateSysLaplacian (MPI_Comm comm, HYPRE_Int nx, HYPRE_Int ny, HYPRE_Int nz, +HYPRE_Int BuildParFromFile (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildParRhsFromFile (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParVector *b_ptr ); + +HYPRE_Int BuildParLaplacian (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildParSysLaplacian (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildParDifConv (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildParFromOneFile (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_Int num_functions, HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildFuncsFromFiles (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix A, HYPRE_Int **dof_func_ptr ); +HYPRE_Int BuildFuncsFromOneFile (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix A, HYPRE_Int **dof_func_ptr ); +HYPRE_Int BuildRhsParFromOneFile (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_Int *partitioning, HYPRE_ParVector *b_ptr ); +HYPRE_Int BuildParLaplacian9pt (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildParLaplacian27pt (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildParRotate7pt (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildParVarDifConv (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr, HYPRE_ParVector *rhs_ptr ); +HYPRE_ParCSRMatrix GenerateSysLaplacian (MPI_Comm comm, HYPRE_Int nx, HYPRE_Int ny, HYPRE_Int nz, HYPRE_Int P, HYPRE_Int Q, HYPRE_Int R, HYPRE_Int p, HYPRE_Int q, HYPRE_Int r, HYPRE_Int num_fun, HYPRE_Real *mtrx, HYPRE_Real *value); -HYPRE_ParCSRMatrix GenerateSysLaplacianVCoef (MPI_Comm comm, HYPRE_Int nx, HYPRE_Int ny, HYPRE_Int nz, +HYPRE_ParCSRMatrix GenerateSysLaplacianVCoef (MPI_Comm comm, HYPRE_Int nx, HYPRE_Int ny, + HYPRE_Int nz, HYPRE_Int P, HYPRE_Int Q, HYPRE_Int R, HYPRE_Int p, HYPRE_Int q, HYPRE_Int r, HYPRE_Int num_fun, HYPRE_Real *mtrx, HYPRE_Real *value); -HYPRE_Int SetSysVcoefValues(HYPRE_Int num_fun, HYPRE_Int nx, HYPRE_Int ny, HYPRE_Int nz, HYPRE_Real vcx, HYPRE_Real vcy, HYPRE_Real vcz, HYPRE_Int mtx_entry, HYPRE_Real *values); +HYPRE_Int SetSysVcoefValues(HYPRE_Int num_fun, HYPRE_Int nx, HYPRE_Int ny, HYPRE_Int nz, + HYPRE_Real vcx, HYPRE_Real vcy, HYPRE_Real vcz, HYPRE_Int mtx_entry, HYPRE_Real *values); -HYPRE_Int BuildParCoordinates (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_Int *coorddim_ptr , float **coord_ptr ); - -extern HYPRE_Int hypre_FlexGMRESModifyPCAMGExample(void *precond_data, HYPRE_Int iterations, +HYPRE_Int BuildParCoordinates (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_Int *coorddim_ptr, float **coord_ptr ); + +extern HYPRE_Int hypre_FlexGMRESModifyPCAMGExample(void *precond_data, HYPRE_Int iterations, HYPRE_Real rel_residual_norm); -extern HYPRE_Int hypre_FlexGMRESModifyPCDefault(void *precond_data, HYPRE_Int iteration, +extern HYPRE_Int hypre_FlexGMRESModifyPCDefault(void *precond_data, HYPRE_Int iteration, HYPRE_Real rel_residual_norm); #ifdef __cplusplus } #endif #define SECOND_TIME 0 - + hypre_int main( hypre_int argc, char *argv[] ) @@ -89,7 +105,7 @@ main( hypre_int argc, HYPRE_Int poutdat; HYPRE_Int debug_flag; HYPRE_Int ierr = 0; - HYPRE_Int i,j; + HYPRE_Int i, j; HYPRE_Int max_levels = 25; HYPRE_Int num_iterations; HYPRE_Int pcg_num_its, dscg_num_its; @@ -102,7 +118,7 @@ main( hypre_int argc, HYPRE_Real final_res_norm; void *object; - HYPRE_IJMatrix ij_A; + HYPRE_IJMatrix ij_A; HYPRE_IJVector ij_b; HYPRE_IJVector ij_x; HYPRE_IJVector *ij_rbm; @@ -114,7 +130,7 @@ main( hypre_int argc, HYPRE_Solver amg_solver; HYPRE_Solver pcg_solver; - HYPRE_Solver pcg_precond=NULL, pcg_precond_gotten; + HYPRE_Solver pcg_precond = NULL, pcg_precond_gotten; HYPRE_Int num_procs, myid; HYPRE_Int local_row; @@ -126,12 +142,12 @@ main( hypre_int argc, HYPRE_Int *ncols; HYPRE_Int *col_inds; HYPRE_Int *dof_func; - HYPRE_Int num_functions = 1; - HYPRE_Int num_paths = 1; - HYPRE_Int agg_num_levels = 0; - HYPRE_Int ns_coarse = 1; + HYPRE_Int num_functions = 1; + HYPRE_Int num_paths = 1; + HYPRE_Int agg_num_levels = 0; + HYPRE_Int ns_coarse = 1; - HYPRE_Int time_index; + HYPRE_Int time_index; MPI_Comm comm = hypre_MPI_COMM_WORLD; HYPRE_Int M, N; HYPRE_Int first_local_row, last_local_row, local_num_rows; @@ -164,37 +180,37 @@ main( hypre_int argc, HYPRE_Int cycle_type; HYPRE_Int coarsen_type = 6; HYPRE_Int measure_type = 0; - HYPRE_Int num_sweeps = 1; - HYPRE_Int IS_type; - HYPRE_Int num_CR_relax_steps = 2; - HYPRE_Int relax_type; - HYPRE_Int relax_coarse = -1; - HYPRE_Int relax_up = -1; - HYPRE_Int relax_down = -1; - HYPRE_Int relax_order = 1; + HYPRE_Int num_sweeps = 1; + HYPRE_Int IS_type; + HYPRE_Int num_CR_relax_steps = 2; + HYPRE_Int relax_type; + HYPRE_Int relax_coarse = -1; + HYPRE_Int relax_up = -1; + HYPRE_Int relax_down = -1; + HYPRE_Int relax_order = 1; HYPRE_Int level_w = -1; HYPRE_Int level_ow = -1; -/* HYPRE_Int smooth_lev; */ -/* HYPRE_Int smooth_rlx = 8; */ - HYPRE_Int smooth_type = 6; - HYPRE_Int smooth_num_levels = 0; + /* HYPRE_Int smooth_lev; */ + /* HYPRE_Int smooth_rlx = 8; */ + HYPRE_Int smooth_type = 6; + HYPRE_Int smooth_num_levels = 0; HYPRE_Int smooth_num_sweeps = 1; HYPRE_Int coarse_threshold = 9; HYPRE_Int min_coarse_size = 0; -/* redundant coarse grid solve */ + /* redundant coarse grid solve */ HYPRE_Int seq_threshold = 0; HYPRE_Int redundant = 0; -/* additive versions */ + /* additive versions */ HYPRE_Int additive = -1; HYPRE_Int mult_add = -1; HYPRE_Int simple = -1; HYPRE_Int add_P_max_elmts = 0; HYPRE_Real add_trunc_factor = 0; - HYPRE_Int rap2=0; + HYPRE_Int rap2 = 0; HYPRE_Int keepTranspose = 0; - HYPRE_Real relax_wt; - HYPRE_Real relax_wt_level; + HYPRE_Real relax_wt; + HYPRE_Real relax_wt_level; HYPRE_Real outer_wt; HYPRE_Real outer_wt_level; HYPRE_Real tol = 1.e-8, pc_tol = 0.; @@ -211,7 +227,7 @@ main( hypre_int argc, HYPRE_Int coord_dim = 3; float *coordinates = NULL; char plot_file_name[256]; - + /* parameters for ParaSAILS */ HYPRE_Real sai_threshold = 0.1; HYPRE_Real sai_filter = 0.1; @@ -223,16 +239,16 @@ main( hypre_int argc, /* parameters for Euclid or ILU smoother in AMG */ HYPRE_Real eu_ilut = 0.0; HYPRE_Real eu_sparse_A = 0.0; - HYPRE_Int eu_bj = 0; - HYPRE_Int eu_level = -1; - HYPRE_Int eu_stats = 0; - HYPRE_Int eu_mem = 0; - HYPRE_Int eu_row_scale = 0; /* Euclid only */ + HYPRE_Int eu_bj = 0; + HYPRE_Int eu_level = -1; + HYPRE_Int eu_stats = 0; + HYPRE_Int eu_mem = 0; + HYPRE_Int eu_row_scale = 0; /* Euclid only */ /* parameters for GMRES */ - HYPRE_Int k_dim; + HYPRE_Int k_dim; /* parameters for LGMRES */ - HYPRE_Int aug_dim; + HYPRE_Int aug_dim; /* parameters for GSMG */ HYPRE_Int gsmg_samples = 5; /* interpolation */ @@ -271,7 +287,7 @@ main( hypre_int argc, /*----------------------------------------------------------- * Set defaults *-----------------------------------------------------------*/ - + build_matrix_type = 2; build_matrix_arg_index = argc; build_rhs_type = 2; @@ -289,12 +305,12 @@ main( hypre_int argc, ioutdat = 3; poutdat = 1; - hypre_sprintf (plot_file_name,"AMGgrids.CF.dat"); + hypre_sprintf (plot_file_name, "AMGgrids.CF.dat"); /*----------------------------------------------------------- * Parse command line *-----------------------------------------------------------*/ - + print_usage = 0; arg_index = 1; @@ -353,7 +369,7 @@ main( hypre_int argc, arg_index++; build_matrix_type = 7; build_matrix_arg_index = arg_index; - } + } else if ( strcmp(argv[arg_index], "-test_ij") == 0 ) { arg_index++; @@ -429,13 +445,13 @@ main( hypre_int argc, arg_index++; build_rhs_type = 1; build_rhs_arg_index = arg_index; - } + } else if ( strcmp(argv[arg_index], "-rhsparcsrfile") == 0 ) { arg_index++; build_rhs_type = 7; build_rhs_arg_index = arg_index; - } + } else if ( strcmp(argv[arg_index], "-rhsisone") == 0 ) { arg_index++; @@ -447,7 +463,7 @@ main( hypre_int argc, arg_index++; build_rhs_type = 3; build_rhs_arg_index = arg_index; - } + } else if ( strcmp(argv[arg_index], "-xisone") == 0 ) { arg_index++; @@ -459,7 +475,7 @@ main( hypre_int argc, arg_index++; build_rhs_type = 5; build_rhs_arg_index = arg_index; - } + } else if ( strcmp(argv[arg_index], "-srcfromfile") == 0 ) { arg_index++; @@ -499,12 +515,12 @@ main( hypre_int argc, { arg_index++; coarsen_type = 0; - } + } else if ( strcmp(argv[arg_index], "-cljp1") == 0 ) { arg_index++; coarsen_type = 7; - } + } else if ( strcmp(argv[arg_index], "-cgc") == 0 ) { arg_index++; @@ -521,72 +537,72 @@ main( hypre_int argc, { arg_index++; coarsen_type = 8; - } + } else if ( strcmp(argv[arg_index], "-pmis1") == 0 ) { arg_index++; coarsen_type = 9; - } + } else if ( strcmp(argv[arg_index], "-cr1") == 0 ) { arg_index++; coarsen_type = 98; - } + } else if ( strcmp(argv[arg_index], "-cr") == 0 ) { arg_index++; coarsen_type = 99; - } + } else if ( strcmp(argv[arg_index], "-crcg") == 0 ) { arg_index++; CR_use_CG = atoi(argv[arg_index++]); - } + } else if ( strcmp(argv[arg_index], "-hmis") == 0 ) { arg_index++; coarsen_type = 10; - } + } else if ( strcmp(argv[arg_index], "-ruge") == 0 ) { arg_index++; coarsen_type = 1; - } + } else if ( strcmp(argv[arg_index], "-ruge1p") == 0 ) { arg_index++; coarsen_type = 11; - } + } else if ( strcmp(argv[arg_index], "-ruge2b") == 0 ) { arg_index++; coarsen_type = 2; - } + } else if ( strcmp(argv[arg_index], "-ruge3") == 0 ) { arg_index++; coarsen_type = 3; - } + } else if ( strcmp(argv[arg_index], "-ruge3c") == 0 ) { arg_index++; coarsen_type = 4; - } + } else if ( strcmp(argv[arg_index], "-rugerlx") == 0 ) { arg_index++; coarsen_type = 5; - } + } else if ( strcmp(argv[arg_index], "-falgout") == 0 ) { arg_index++; coarsen_type = 6; - } + } else if ( strcmp(argv[arg_index], "-gm") == 0 ) { arg_index++; measure_type = 1; - } + } else if ( strcmp(argv[arg_index], "-is") == 0 ) { arg_index++; @@ -600,12 +616,12 @@ main( hypre_int argc, else if ( strcmp(argv[arg_index], "-crth") == 0 ) { arg_index++; - CR_rate = atof(argv[arg_index++]); + CR_rate = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-crst") == 0 ) { arg_index++; - CR_strong_th = atof(argv[arg_index++]); + CR_strong_th = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-rlx") == 0 ) { @@ -691,9 +707,9 @@ main( hypre_int argc, else if ( strcmp(argv[arg_index], "-dt") == 0 ) { arg_index++; - dt = atof(argv[arg_index++]); + dt = (HYPRE_Real)atof(argv[arg_index++]); build_rhs_type = -1; - if ( build_src_type == -1 ) build_src_type = 2; + if ( build_src_type == -1 ) { build_src_type = 2; } } else if ( strcmp(argv[arg_index], "-help") == 0 ) { @@ -706,7 +722,8 @@ main( hypre_int argc, } /* begin CGC BM Aug 25, 2006 */ - if (coarsen_type == 21 || coarsen_type == 22) { + if (coarsen_type == 21 || coarsen_type == 22) + { arg_index = 0; while ( (arg_index < argc) && (!print_usage) ) { @@ -742,8 +759,8 @@ main( hypre_int argc, /* for CGNR preconditioned with Boomeramg, only relaxation scheme 0 is implemented, i.e. Jacobi relaxation, and needs to be used without CF ordering */ - if (solver_id == 5) - { + if (solver_id == 5) + { relax_type = 0; relax_order = 0; } @@ -779,54 +796,54 @@ main( hypre_int argc, else if ( strcmp(argv[arg_index], "-w") == 0 ) { arg_index++; - relax_wt = atof(argv[arg_index++]); + relax_wt = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-wl") == 0 ) { arg_index++; - relax_wt_level = atof(argv[arg_index++]); + relax_wt_level = (HYPRE_Real)atof(argv[arg_index++]); level_w = atoi(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-ow") == 0 ) { arg_index++; - outer_wt = atof(argv[arg_index++]); + outer_wt = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-owl") == 0 ) { arg_index++; - outer_wt_level = atof(argv[arg_index++]); + outer_wt_level = (HYPRE_Real)atof(argv[arg_index++]); level_ow = atoi(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-sw") == 0 ) { arg_index++; - schwarz_rlx_weight = atof(argv[arg_index++]); + schwarz_rlx_weight = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-coarse_th") == 0 ) { arg_index++; - coarse_threshold = atof(argv[arg_index++]); + coarse_threshold = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-min_cs") == 0 ) { arg_index++; - min_coarse_size = atof(argv[arg_index++]); + min_coarse_size = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-seq_th") == 0 ) { arg_index++; - seq_threshold = atof(argv[arg_index++]); + seq_threshold = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-red") == 0 ) { arg_index++; - redundant = atof(argv[arg_index++]); + redundant = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-th") == 0 ) { arg_index++; - strong_threshold = atof(argv[arg_index++]); + strong_threshold = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-CF") == 0 ) { @@ -836,37 +853,37 @@ main( hypre_int argc, else if ( strcmp(argv[arg_index], "-cf") == 0 ) { arg_index++; - cf_tol = atof(argv[arg_index++]); + cf_tol = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-tol") == 0 ) { arg_index++; - tol = atof(argv[arg_index++]); + tol = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-atol") == 0 ) { arg_index++; - atol = atof(argv[arg_index++]); + atol = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-mxrs") == 0 ) { arg_index++; - max_row_sum = atof(argv[arg_index++]); + max_row_sum = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-sai_th") == 0 ) { arg_index++; - sai_threshold = atof(argv[arg_index++]); + sai_threshold = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-sai_filt") == 0 ) { arg_index++; - sai_filter = atof(argv[arg_index++]); + sai_filter = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-drop_tol") == 0 ) { arg_index++; - drop_tol = atof(argv[arg_index++]); + drop_tol = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-nonzeros_to_keep") == 0 ) { @@ -876,12 +893,12 @@ main( hypre_int argc, else if ( strcmp(argv[arg_index], "-ilut") == 0 ) { arg_index++; - eu_ilut = atof(argv[arg_index++]); + eu_ilut = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-sparseA") == 0 ) { arg_index++; - eu_sparse_A = atof(argv[arg_index++]); + eu_sparse_A = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-rowScale") == 0 ) { @@ -911,7 +928,7 @@ main( hypre_int argc, else if ( strcmp(argv[arg_index], "-tr") == 0 ) { arg_index++; - trunc_factor = atof(argv[arg_index++]); + trunc_factor = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-Pmx") == 0 ) { @@ -926,7 +943,7 @@ main( hypre_int argc, else if ( strcmp(argv[arg_index], "-Qtr") == 0 ) { arg_index++; - Q_trunc = atof(argv[arg_index++]); + Q_trunc = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-Qmx") == 0 ) { @@ -936,12 +953,12 @@ main( hypre_int argc, else if ( strcmp(argv[arg_index], "-jtr") == 0 ) { arg_index++; - jacobi_trunc_threshold = atof(argv[arg_index++]); + jacobi_trunc_threshold = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-Ssw") == 0 ) { arg_index++; - S_commpkg_switch = atof(argv[arg_index++]); + S_commpkg_switch = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-solver_type") == 0 ) { @@ -1019,12 +1036,12 @@ main( hypre_int argc, else if ( strcmp(argv[arg_index], "-agg_tr") == 0 ) { arg_index++; - agg_trunc_factor = atof(argv[arg_index++]); + agg_trunc_factor = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-agg_P12_tr") == 0 ) { arg_index++; - agg_P12_trunc_factor = atof(argv[arg_index++]); + agg_P12_trunc_factor = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-postinterptype") == 0 ) { @@ -1054,7 +1071,7 @@ main( hypre_int argc, else if ( strcmp(argv[arg_index], "-cheby_fraction") == 0 ) { arg_index++; - cheby_fraction = atof(argv[arg_index++]); + cheby_fraction = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-additive") == 0 ) { @@ -1079,7 +1096,7 @@ main( hypre_int argc, else if ( strcmp(argv[arg_index], "-add_tr") == 0 ) { arg_index++; - add_trunc_factor = atof(argv[arg_index++]); + add_trunc_factor = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-rap") == 0 ) { @@ -1097,7 +1114,9 @@ main( hypre_int argc, nongalerk_num_tol = atoi(argv[arg_index++]); nongalerk_tol = hypre_CTAlloc(HYPRE_Real, nongalerk_num_tol, HYPRE_MEMORY_HOST); for (i = 0; i < nongalerk_num_tol; i++) - nongalerk_tol[i] = atof(argv[arg_index++]); + { + nongalerk_tol[i] = (HYPRE_Real)atof(argv[arg_index++]); + } } else if ( strcmp(argv[arg_index], "-print") == 0 ) { @@ -1113,7 +1132,7 @@ main( hypre_int argc, else if ( strcmp(argv[arg_index], "-plot_file_name") == 0 ) { arg_index++; - hypre_sprintf (plot_file_name,"%s",argv[arg_index++]); + hypre_sprintf (plot_file_name, "%s", argv[arg_index++]); } else { @@ -1124,7 +1143,7 @@ main( hypre_int argc, /*----------------------------------------------------------- * Print usage info *-----------------------------------------------------------*/ - + if ( (print_usage) && (myid == 0) ) { hypre_printf("\n"); @@ -1179,13 +1198,13 @@ main( hypre_int argc, hypre_printf(" -solver : solver ID\n"); hypre_printf(" 0=AMG 1=AMG-PCG \n"); hypre_printf(" 2=DS-PCG 3=AMG-GMRES \n"); - hypre_printf(" 4=DS-GMRES 5=AMG-CGNR \n"); - hypre_printf(" 6=DS-CGNR 7=PILUT-GMRES \n"); + hypre_printf(" 4=DS-GMRES 5=AMG-CGNR \n"); + hypre_printf(" 6=DS-CGNR 7=PILUT-GMRES \n"); hypre_printf(" 8=ParaSails-PCG 9=AMG-BiCGSTAB \n"); hypre_printf(" 10=DS-BiCGSTAB 11=PILUT-BiCGSTAB \n"); - hypre_printf(" 12=Schwarz-PCG 13=GSMG \n"); - hypre_printf(" 14=GSMG-PCG 15=GSMG-GMRES\n"); - hypre_printf(" 18=ParaSails-GMRES\n"); + hypre_printf(" 12=Schwarz-PCG 13=GSMG \n"); + hypre_printf(" 14=GSMG-PCG 15=GSMG-GMRES\n"); + hypre_printf(" 18=ParaSails-GMRES\n"); hypre_printf(" 20=Hybrid solver/ DiagScale, AMG \n"); hypre_printf(" 43=Euclid-PCG 44=Euclid-GMRES \n"); hypre_printf(" 45=Euclid-BICGSTAB\n"); @@ -1219,12 +1238,12 @@ main( hypre_int argc, hypre_printf(" 9=standard interpolation with separation of weights \n"); hypre_printf(" 12=FF interpolation \n"); hypre_printf(" 13=FF1 interpolation \n"); - + hypre_printf(" 16=use modified unknown interpolation for a system (w/unknown or hybrid approach) \n"); hypre_printf(" 17=use non-systems interp = 6 for a system (w/unknown or hybrid approach) \n"); hypre_printf(" 18=use non-systems interp = 8 for a system (w/unknown or hybrid approach) \n"); hypre_printf(" 19=use non-systems interp = 0 for a system (w/unknown or hybrid approach) \n"); - + hypre_printf(" 10=classical block interpolation for nodal systems AMG\n"); hypre_printf(" 11=classical block interpolation with diagonal blocks for nodal systems AMG\n"); @@ -1235,7 +1254,7 @@ main( hypre_int argc, hypre_printf(" 24=direct block interpolation for nodal systems AMG\n"); - + hypre_printf("\n"); hypre_printf(" -rlx : relaxation type\n"); hypre_printf(" 0=Weighted Jacobi \n"); @@ -1278,8 +1297,8 @@ main( hypre_int argc, hypre_printf(" -ns_coarse : set no. of sweeps for coarsest grid\n"); hypre_printf(" -ns_down : set no. of sweeps for down cycle\n"); hypre_printf(" -ns_up : set no. of sweeps for up cycle\n"); - hypre_printf("\n"); - hypre_printf(" -mu : set AMG cycles (1=V, 2=W, etc.)\n"); + hypre_printf("\n"); + hypre_printf(" -mu : set AMG cycles (1=V, 2=W, etc.)\n"); hypre_printf(" -th : set AMG threshold Theta = val \n"); hypre_printf(" -tr : set AMG interpolation truncation factor = val \n"); hypre_printf(" -Pmx : set maximal no. of elmts per row for AMG interpolation \n"); @@ -1288,7 +1307,7 @@ main( hypre_int argc, hypre_printf(" -mxrs : set AMG maximum row sum threshold for dependency weakening \n"); hypre_printf(" -nf : set number of functions for systems AMG\n"); hypre_printf(" -numsamp : set number of sample vectors for GSMG\n"); - + hypre_printf(" -postinterptype : invokes no. of Jacobi interpolation steps after main interpolation\n"); hypre_printf("\n"); hypre_printf(" -cgcitr : set maximal number of coarsening iterations for CGC\n"); @@ -1296,7 +1315,7 @@ main( hypre_int argc, hypre_printf(" : 1 PCG (default)\n"); hypre_printf(" : 2 GMRES\n"); hypre_printf(" : 3 BiCGSTAB\n"); - + hypre_printf(" -w : set Jacobi relax weight = val\n"); hypre_printf(" -k : dimension Krylov space for GMRES\n"); hypre_printf(" -aug : number of augmentation vectors for LGMRES (-k indicates total approx space size)\n"); @@ -1318,14 +1337,14 @@ main( hypre_int argc, hypre_printf(" Note ILUT is sequential only!\n"); hypre_printf(" -sparseA : set drop tolerance in ILU(k) for Euclid \n"); hypre_printf(" -rowScale : enable row scaling in Euclid \n"); - hypre_printf("\n"); + hypre_printf("\n"); hypre_printf(" -drop_tol : set threshold for dropping in PILUT\n"); hypre_printf(" -nonzeros_to_keep : number of nonzeros in each row to keep\n"); - hypre_printf("\n"); + hypre_printf("\n"); hypre_printf(" -iout : set output flag\n"); - hypre_printf(" 0=no output 1=matrix stats\n"); - hypre_printf(" 2=cycle stats 3=matrix & cycle stats\n"); - hypre_printf("\n"); + hypre_printf(" 0=no output 1=matrix stats\n"); + hypre_printf(" 2=cycle stats 3=matrix & cycle stats\n"); + hypre_printf("\n"); hypre_printf(" -dbg : set debug flag\n"); hypre_printf(" 0=no debugging\n 1=internal timing\n 2=interpolation truncation\n 3=more detailed timing in coarsening routine\n"); hypre_printf("\n"); @@ -1350,7 +1369,7 @@ main( hypre_int argc, /*----------------------------------------------------------- * Print driver parameters *-----------------------------------------------------------*/ - + if (myid == 0) { hypre_printf("Running with these driver parameters:\n"); @@ -1418,24 +1437,25 @@ main( hypre_int argc, { hypre_printf("You have asked for an unsupported problem with\n"); hypre_printf("build_matrix_type = %d.\n", build_matrix_type); - return(-1); + return (-1); } /* BM Oct 23, 2006 */ if (plot_grids) { if (build_matrix_type > 1 && build_matrix_type < 8) - BuildParCoordinates (argc, argv, build_matrix_arg_index, + BuildParCoordinates (argc, argv, build_matrix_arg_index, &coord_dim, &coordinates); else { - hypre_printf("Warning: coordinates are not yet printed for build_matrix_type = %d.\n", build_matrix_type); + hypre_printf("Warning: coordinates are not yet printed for build_matrix_type = %d.\n", + build_matrix_type); } } if (build_matrix_type < 0) { ierr = HYPRE_IJMatrixGetLocalRange( ij_A, - &first_local_row, &last_local_row , + &first_local_row, &last_local_row, &first_local_col, &last_local_col ); local_num_rows = last_local_row - first_local_row + 1; @@ -1449,7 +1469,7 @@ main( hypre_int argc, * Copy the parcsr matrix into the IJMatrix through interface calls *-----------------------------------------------------------*/ ierr = HYPRE_ParCSRMatrixGetLocalRange( parcsr_A, - &first_local_row, &last_local_row , + &first_local_row, &last_local_row, &first_local_col, &last_local_col ); local_num_rows = last_local_row - first_local_row + 1; @@ -1463,7 +1483,7 @@ main( hypre_int argc, /* Check the ij interface - not necessary if one just wants to test solvers */ if (test_ij && build_matrix_type > -1) { - HYPRE_Int mx_size = 5; + HYPRE_Int mx_size = 5; time_index = hypre_InitializeTiming("Generate IJ matrix"); hypre_BeginTiming(time_index); @@ -1477,54 +1497,56 @@ main( hypre_int argc, num_rows = local_num_rows; if (off_proc) { - if (myid != num_procs-1) num_rows++; - if (myid) num_rows++; + if (myid != num_procs - 1) { num_rows++; } + if (myid) { num_rows++; } } /* The following shows how to build an IJMatrix if one has only an estimate for the row sizes */ - row_nums = hypre_CTAlloc(HYPRE_Int, num_rows, HYPRE_MEMORY_HOST); - num_cols = hypre_CTAlloc(HYPRE_Int, num_rows, HYPRE_MEMORY_HOST); - if (sparsity_known == 1) - { + row_nums = hypre_CTAlloc(HYPRE_Int, num_rows, HYPRE_MEMORY_HOST); + num_cols = hypre_CTAlloc(HYPRE_Int, num_rows, HYPRE_MEMORY_HOST); + if (sparsity_known == 1) + { diag_sizes = hypre_CTAlloc(HYPRE_Int, local_num_rows, HYPRE_MEMORY_HOST); offdiag_sizes = hypre_CTAlloc(HYPRE_Int, local_num_rows, HYPRE_MEMORY_HOST); - } - else - { + } + else + { size = 5; if (sparsity_known == 0) { - if (build_matrix_type == 2) size = 7; - if (build_matrix_type == 3) size = 9; - if (build_matrix_type == 4) size = 27; + if (build_matrix_type == 2) { size = 7; } + if (build_matrix_type == 3) { size = 9; } + if (build_matrix_type == 4) { size = 27; } } - row_sizes = hypre_CTAlloc(HYPRE_Int, num_rows, HYPRE_MEMORY_HOST); - for (i=0; i < num_rows; i++) - row_sizes[i] = size; - } - local_row = 0; - if (build_matrix_type == 2) mx_size = 7; - if (build_matrix_type == 3) mx_size = 9; - if (build_matrix_type == 4) mx_size = 27; - col_nums = hypre_CTAlloc(HYPRE_Int, mx_size*num_rows, HYPRE_MEMORY_HOST); - data = hypre_CTAlloc(HYPRE_Real, mx_size*num_rows, HYPRE_MEMORY_HOST); - i_indx = 0; - j_indx = 0; - if (off_proc && myid) - { - num_cols[i_indx] = 2; - row_nums[i_indx++] = first_local_row-1; - col_nums[j_indx] = first_local_row-1; + row_sizes = hypre_CTAlloc(HYPRE_Int, num_rows, HYPRE_MEMORY_HOST); + for (i = 0; i < num_rows; i++) + { + row_sizes[i] = size; + } + } + local_row = 0; + if (build_matrix_type == 2) { mx_size = 7; } + if (build_matrix_type == 3) { mx_size = 9; } + if (build_matrix_type == 4) { mx_size = 27; } + col_nums = hypre_CTAlloc(HYPRE_Int, mx_size * num_rows, HYPRE_MEMORY_HOST); + data = hypre_CTAlloc(HYPRE_Real, mx_size * num_rows, HYPRE_MEMORY_HOST); + i_indx = 0; + j_indx = 0; + if (off_proc && myid) + { + num_cols[i_indx] = 2; + row_nums[i_indx++] = first_local_row - 1; + col_nums[j_indx] = first_local_row - 1; data[j_indx++] = 6.; - col_nums[j_indx] = first_local_row-2; + col_nums[j_indx] = first_local_row - 2; data[j_indx++] = -1; - } - for (i=0; i < local_num_rows; i++) - { - row_nums[i_indx] = first_local_row +i; - ierr += HYPRE_ParCSRMatrixGetRow( parcsr_A, first_local_row+i, &size, - &col_inds, &values); - num_cols[i_indx++] = size; + } + for (i = 0; i < local_num_rows; i++) + { + row_nums[i_indx] = first_local_row + i; + ierr += HYPRE_ParCSRMatrixGetRow( parcsr_A, first_local_row + i, &size, + &col_inds, &values); + num_cols[i_indx++] = size; for (j = 0; j < size; j++) { col_nums[j_indx] = col_inds[j]; @@ -1532,74 +1554,82 @@ main( hypre_int argc, if (sparsity_known == 1) { if (col_inds[j] < first_local_row || col_inds[j] > last_local_row) + { offdiag_sizes[local_row]++; + } else + { diag_sizes[local_row]++; + } } } local_row++; - ierr += HYPRE_ParCSRMatrixRestoreRow( parcsr_A, first_local_row+i, &size, - &col_inds, &values ); - } - if (off_proc && myid != num_procs-1) - { - num_cols[i_indx] = 2; - row_nums[i_indx++] = last_local_row+1; - col_nums[j_indx] = last_local_row+2; + ierr += HYPRE_ParCSRMatrixRestoreRow( parcsr_A, first_local_row + i, &size, + &col_inds, &values ); + } + if (off_proc && myid != num_procs - 1) + { + num_cols[i_indx] = 2; + row_nums[i_indx++] = last_local_row + 1; + col_nums[j_indx] = last_local_row + 2; data[j_indx++] = -1.; - col_nums[j_indx] = last_local_row+1; + col_nums[j_indx] = last_local_row + 1; data[j_indx++] = 6; - } + } - /*ierr += HYPRE_IJMatrixSetRowSizes ( ij_A, (const HYPRE_Int *) num_cols );*/ - if (sparsity_known == 1) - ierr += HYPRE_IJMatrixSetDiagOffdSizes( ij_A, (const HYPRE_Int *) diag_sizes, - (const HYPRE_Int *) offdiag_sizes ); - else - ierr = HYPRE_IJMatrixSetRowSizes ( ij_A, (const HYPRE_Int *) row_sizes ); + /*ierr += HYPRE_IJMatrixSetRowSizes ( ij_A, (const HYPRE_Int *) num_cols );*/ + if (sparsity_known == 1) + ierr += HYPRE_IJMatrixSetDiagOffdSizes( ij_A, (const HYPRE_Int *) diag_sizes, + (const HYPRE_Int *) offdiag_sizes ); + else + { + ierr = HYPRE_IJMatrixSetRowSizes ( ij_A, (const HYPRE_Int *) row_sizes ); + } - ierr += HYPRE_IJMatrixInitialize( ij_A ); + ierr += HYPRE_IJMatrixInitialize( ij_A ); - if (omp_flag) HYPRE_IJMatrixSetOMPFlag(ij_A, 1); + if (omp_flag) { HYPRE_IJMatrixSetOMPFlag(ij_A, 1); } - if (chunk) - { + if (chunk) + { if (add) - ierr += HYPRE_IJMatrixAddToValues(ij_A, num_rows, num_cols, row_nums, - (const HYPRE_Int *) col_nums, - (const HYPRE_Real *) data); + ierr += HYPRE_IJMatrixAddToValues(ij_A, num_rows, num_cols, row_nums, + (const HYPRE_Int *) col_nums, + (const HYPRE_Real *) data); else - ierr += HYPRE_IJMatrixSetValues(ij_A, num_rows, num_cols, row_nums, - (const HYPRE_Int *) col_nums, - (const HYPRE_Real *) data); - } - else - { + ierr += HYPRE_IJMatrixSetValues(ij_A, num_rows, num_cols, row_nums, + (const HYPRE_Int *) col_nums, + (const HYPRE_Real *) data); + } + else + { j_indx = 0; - for (i=0; i < num_rows; i++) + for (i = 0; i < num_rows; i++) { if (add) ierr += HYPRE_IJMatrixAddToValues( ij_A, 1, &num_cols[i], &row_nums[i], - (const HYPRE_Int *) &col_nums[j_indx], - (const HYPRE_Real *) &data[j_indx] ); + (const HYPRE_Int *) &col_nums[j_indx], + (const HYPRE_Real *) &data[j_indx] ); else ierr += HYPRE_IJMatrixSetValues( ij_A, 1, &num_cols[i], &row_nums[i], - (const HYPRE_Int *) &col_nums[j_indx], - (const HYPRE_Real *) &data[j_indx] ); + (const HYPRE_Int *) &col_nums[j_indx], + (const HYPRE_Real *) &data[j_indx] ); j_indx += num_cols[i]; } - } - hypre_TFree(col_nums, HYPRE_MEMORY_HOST); - hypre_TFree(data, HYPRE_MEMORY_HOST); - hypre_TFree(row_nums, HYPRE_MEMORY_HOST); - hypre_TFree(num_cols, HYPRE_MEMORY_HOST); - if (sparsity_known == 1) - { + } + hypre_TFree(col_nums, HYPRE_MEMORY_HOST); + hypre_TFree(data, HYPRE_MEMORY_HOST); + hypre_TFree(row_nums, HYPRE_MEMORY_HOST); + hypre_TFree(num_cols, HYPRE_MEMORY_HOST); + if (sparsity_known == 1) + { hypre_TFree(diag_sizes, HYPRE_MEMORY_HOST); hypre_TFree(offdiag_sizes, HYPRE_MEMORY_HOST); - } - else + } + else + { hypre_TFree(row_sizes, HYPRE_MEMORY_HOST); + } ierr += HYPRE_IJMatrixAssemble( ij_A ); @@ -1607,18 +1637,18 @@ main( hypre_int argc, hypre_PrintTiming("IJ Matrix Setup", hypre_MPI_COMM_WORLD); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); - + if (ierr) { hypre_printf("Error in driver building IJMatrix from parcsr matrix. \n"); - return(-1); + return (-1); } - /* This is to emphasize that one can IJMatrixAddToValues after an - IJMatrixRead or an IJMatrixAssemble. After an IJMatrixRead, - assembly is unnecessary if the sparsity pattern of the matrix is - not changed somehow. If one has not used IJMatrixRead, one has - the opportunity to IJMatrixAddTo before a IJMatrixAssemble. */ + /* This is to emphasize that one can IJMatrixAddToValues after an + IJMatrixRead or an IJMatrixAssemble. After an IJMatrixRead, + assembly is unnecessary if the sparsity pattern of the matrix is + not changed somehow. If one has not used IJMatrixRead, one has + the opportunity to IJMatrixAddTo before a IJMatrixAssemble. */ ncols = hypre_CTAlloc(HYPRE_Int, last_local_row - first_local_row + 1, HYPRE_MEMORY_HOST); rows = hypre_CTAlloc(HYPRE_Int, last_local_row - first_local_row + 1, HYPRE_MEMORY_HOST); @@ -1626,9 +1656,13 @@ main( hypre_int argc, values = hypre_CTAlloc(HYPRE_Real, last_local_row - first_local_row + 1, HYPRE_MEMORY_HOST); if (dt < dt_inf) - val = 1./dt; - else + { + val = 1. / dt; + } + else + { val = 0.; /* Use zero to avoid unintentional loss of significance */ + } for (i = first_local_row; i <= last_local_row; i++) { @@ -1638,31 +1672,33 @@ main( hypre_int argc, col_inds[j] = i; values[j] = val; } - + ierr += HYPRE_IJMatrixAddToValues( ij_A, - local_num_rows, - ncols, rows, - (const HYPRE_Int *) col_inds, - (const HYPRE_Real *) values ); + local_num_rows, + ncols, rows, + (const HYPRE_Int *) col_inds, + (const HYPRE_Real *) values ); hypre_TFree(values, HYPRE_MEMORY_HOST); hypre_TFree(col_inds, HYPRE_MEMORY_HOST); hypre_TFree(rows, HYPRE_MEMORY_HOST); hypre_TFree(ncols, HYPRE_MEMORY_HOST); - /* If sparsity pattern is not changed since last IJMatrixAssemble call, - this should be a no-op */ + /* If sparsity pattern is not changed since last IJMatrixAssemble call, + this should be a no-op */ ierr += HYPRE_IJMatrixAssemble( ij_A ); - /*----------------------------------------------------------- - * Fetch the resulting underlying matrix out - *-----------------------------------------------------------*/ - if (build_matrix_type > -1) + /*----------------------------------------------------------- + * Fetch the resulting underlying matrix out + *-----------------------------------------------------------*/ + if (build_matrix_type > -1) + { ierr += HYPRE_ParCSRMatrixDestroy(parcsr_A); + } - ierr += HYPRE_IJMatrixGetObject( ij_A, &object); - parcsr_A = (HYPRE_ParCSRMatrix) object; + ierr += HYPRE_IJMatrixGetObject( ij_A, &object); + parcsr_A = (HYPRE_ParCSRMatrix) object; } @@ -1676,11 +1712,11 @@ main( hypre_int argc, /* RHS */ interp_vecs = hypre_CTAlloc(HYPRE_ParVector, num_interp_vecs, HYPRE_MEMORY_HOST); ij_rbm = hypre_CTAlloc(HYPRE_IJVector, num_interp_vecs, HYPRE_MEMORY_HOST); - for (i=0; i < num_interp_vecs; i++) + for (i = 0; i < num_interp_vecs; i++) { - hypre_sprintf(new_file_name, "%s.%d", argv[build_rbm_index],i); - ierr = HYPRE_IJVectorRead( new_file_name, hypre_MPI_COMM_WORLD, - HYPRE_PARCSR, &ij_rbm[i] ); + hypre_sprintf(new_file_name, "%s.%d", argv[build_rbm_index], i); + ierr = HYPRE_IJVectorRead( new_file_name, hypre_MPI_COMM_WORLD, + HYPRE_PARCSR, &ij_rbm[i] ); ierr = HYPRE_IJVectorGetObject( ij_rbm[i], &object ); interp_vecs[i] = (HYPRE_ParVector) object; } @@ -1706,7 +1742,7 @@ main( hypre_int argc, } /* RHS */ - ierr = HYPRE_IJVectorRead( argv[build_rhs_arg_index], hypre_MPI_COMM_WORLD, + ierr = HYPRE_IJVectorRead( argv[build_rhs_arg_index], hypre_MPI_COMM_WORLD, HYPRE_PARCSR, &ij_b ); if (ierr) { @@ -1723,7 +1759,9 @@ main( hypre_int argc, values = hypre_CTAlloc(HYPRE_Real, local_num_cols, HYPRE_MEMORY_HOST); for (i = 0; i < local_num_cols; i++) + { values[i] = 0.; + } HYPRE_IJVectorSetValues(ij_x, local_num_cols, NULL, values); hypre_TFree(values, HYPRE_MEMORY_HOST); @@ -1735,7 +1773,7 @@ main( hypre_int argc, #if 0 hypre_printf("build_rhs_type == 1 not currently implemented\n"); - return(-1); + return (-1); #else /* RHS - this has not been tested for multiple processors*/ BuildRhsParFromOneFile(argc, argv, build_rhs_arg_index, NULL, &b); @@ -1744,17 +1782,19 @@ main( hypre_int argc, ij_b = NULL; - /* initial guess */ + /* initial guess */ HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_col, last_local_col, &ij_x); HYPRE_IJVectorSetObjectType(ij_x, HYPRE_PARCSR); HYPRE_IJVectorInitialize(ij_x); - + values = hypre_CTAlloc(HYPRE_Real, local_num_cols, HYPRE_MEMORY_HOST); for (i = 0; i < local_num_cols; i++) + { values[i] = 0.; + } HYPRE_IJVectorSetValues(ij_x, local_num_cols, NULL, values); hypre_TFree(values, HYPRE_MEMORY_HOST); - + ierr = HYPRE_IJVectorGetObject( ij_x, &object ); x = (HYPRE_ParVector) object; @@ -1763,24 +1803,26 @@ main( hypre_int argc, else if ( build_rhs_type == 7 ) { - /* rhs */ + /* rhs */ BuildParRhsFromFile(argc, argv, build_rhs_arg_index, &b); hypre_printf(" Initial guess is 0\n"); ij_b = NULL; - /* initial guess */ + /* initial guess */ HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_col, last_local_col, &ij_x); HYPRE_IJVectorSetObjectType(ij_x, HYPRE_PARCSR); HYPRE_IJVectorInitialize(ij_x); - + values = hypre_CTAlloc(HYPRE_Real, local_num_cols, HYPRE_MEMORY_HOST); for (i = 0; i < local_num_cols; i++) + { values[i] = 0.; + } HYPRE_IJVectorSetValues(ij_x, local_num_cols, NULL, values); hypre_TFree(values, HYPRE_MEMORY_HOST); - + ierr = HYPRE_IJVectorGetObject( ij_x, &object ); x = (HYPRE_ParVector) object; } @@ -1800,7 +1842,9 @@ main( hypre_int argc, values = hypre_CTAlloc(HYPRE_Real, local_num_rows, HYPRE_MEMORY_HOST); for (i = 0; i < local_num_rows; i++) + { values[i] = 1.0; + } HYPRE_IJVectorSetValues(ij_b, local_num_rows, NULL, values); hypre_TFree(values, HYPRE_MEMORY_HOST); @@ -1814,7 +1858,9 @@ main( hypre_int argc, values = hypre_CTAlloc(HYPRE_Real, local_num_cols, HYPRE_MEMORY_HOST); for (i = 0; i < local_num_cols; i++) + { values[i] = 0.; + } HYPRE_IJVectorSetValues(ij_x, local_num_cols, NULL, values); hypre_TFree(values, HYPRE_MEMORY_HOST); @@ -1830,7 +1876,7 @@ main( hypre_int argc, } /* RHS */ - HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_row, last_local_row, &ij_b); + HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_row, last_local_row, &ij_b); HYPRE_IJVectorSetObjectType(ij_b, HYPRE_PARCSR); HYPRE_IJVectorInitialize(ij_b); ierr = HYPRE_IJVectorGetObject( ij_b, &object ); @@ -1842,9 +1888,9 @@ main( hypre_int argc, HYPRE_IJVectorSetValues or HYPRE_IJVectorAddToValues */ HYPRE_ParVectorSetRandomValues(b, 22775); - HYPRE_ParVectorInnerProd(b,b,&norm); - norm = 1./sqrt(norm); - ierr = HYPRE_ParVectorScale(norm, b); + HYPRE_ParVectorInnerProd(b, b, &norm); + norm = 1. / hypre_sqrt(norm); + ierr = HYPRE_ParVectorScale(norm, b); /* Initial guess */ HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_col, last_local_col, &ij_x); @@ -1853,7 +1899,9 @@ main( hypre_int argc, values = hypre_CTAlloc(HYPRE_Real, local_num_cols, HYPRE_MEMORY_HOST); for (i = 0; i < local_num_cols; i++) + { values[i] = 0.; + } HYPRE_IJVectorSetValues(ij_x, local_num_cols, NULL, values); hypre_TFree(values, HYPRE_MEMORY_HOST); @@ -1875,7 +1923,9 @@ main( hypre_int argc, values = hypre_CTAlloc(HYPRE_Real, local_num_cols, HYPRE_MEMORY_HOST); for (i = 0; i < local_num_cols; i++) + { values[i] = 1.; + } HYPRE_IJVectorSetValues(ij_x, local_num_cols, NULL, values); hypre_TFree(values, HYPRE_MEMORY_HOST); @@ -1883,18 +1933,20 @@ main( hypre_int argc, x = (HYPRE_ParVector) object; /* RHS */ - HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_row, last_local_row, &ij_b); + HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_row, last_local_row, &ij_b); HYPRE_IJVectorSetObjectType(ij_b, HYPRE_PARCSR); HYPRE_IJVectorInitialize(ij_b); ierr = HYPRE_IJVectorGetObject( ij_b, &object ); b = (HYPRE_ParVector) object; - HYPRE_ParCSRMatrixMatvec(1.,parcsr_A,x,0.,b); + HYPRE_ParCSRMatrixMatvec(1., parcsr_A, x, 0., b); /* Initial guess */ values = hypre_CTAlloc(HYPRE_Real, local_num_cols, HYPRE_MEMORY_HOST); for (i = 0; i < local_num_cols; i++) + { values[i] = 0.; + } HYPRE_IJVectorSetValues(ij_x, local_num_cols, NULL, values); hypre_TFree(values, HYPRE_MEMORY_HOST); } @@ -1913,7 +1965,9 @@ main( hypre_int argc, values = hypre_CTAlloc(HYPRE_Real, local_num_rows, HYPRE_MEMORY_HOST); for (i = 0; i < local_num_rows; i++) + { values[i] = 0.; + } HYPRE_IJVectorSetValues(ij_b, local_num_rows, NULL, values); hypre_TFree(values, HYPRE_MEMORY_HOST); @@ -1927,7 +1981,9 @@ main( hypre_int argc, values = hypre_CTAlloc(HYPRE_Real, local_num_cols, HYPRE_MEMORY_HOST); for (i = 0; i < local_num_cols; i++) + { values[i] = 1.; + } HYPRE_IJVectorSetValues(ij_x, local_num_cols, NULL, values); hypre_TFree(values, HYPRE_MEMORY_HOST); @@ -1948,7 +2004,7 @@ main( hypre_int argc, hypre_printf(" Initial unknown vector in evolution is 0\n"); } - ierr = HYPRE_IJVectorRead( argv[build_src_arg_index], hypre_MPI_COMM_WORLD, + ierr = HYPRE_IJVectorRead( argv[build_src_arg_index], hypre_MPI_COMM_WORLD, HYPRE_PARCSR, &ij_b ); if (ierr) { @@ -1965,7 +2021,9 @@ main( hypre_int argc, values = hypre_CTAlloc(HYPRE_Real, local_num_cols, HYPRE_MEMORY_HOST); for (i = 0; i < local_num_cols; i++) + { values[i] = 0.; + } HYPRE_IJVectorSetValues(ij_x, local_num_cols, NULL, values); hypre_TFree(values, HYPRE_MEMORY_HOST); @@ -1975,7 +2033,7 @@ main( hypre_int argc, else if ( build_src_type == 1 ) { hypre_printf("build_src_type == 1 not currently implemented\n"); - return(-1); + return (-1); #if 0 BuildRhsParFromOneFile(argc, argv, build_src_arg_index, part_b, &b); @@ -1996,7 +2054,9 @@ main( hypre_int argc, values = hypre_CTAlloc(HYPRE_Real, local_num_rows, HYPRE_MEMORY_HOST); for (i = 0; i < local_num_rows; i++) + { values[i] = 1.; + } HYPRE_IJVectorSetValues(ij_b, local_num_rows, NULL, values); hypre_TFree(values, HYPRE_MEMORY_HOST); @@ -2012,7 +2072,9 @@ main( hypre_int argc, 0 here) is usually used as the initial guess */ values = hypre_CTAlloc(HYPRE_Real, local_num_cols, HYPRE_MEMORY_HOST); for (i = 0; i < local_num_cols; i++) + { values[i] = 0.; + } HYPRE_IJVectorSetValues(ij_x, local_num_cols, NULL, values); hypre_TFree(values, HYPRE_MEMORY_HOST); @@ -2035,7 +2097,9 @@ main( hypre_int argc, hypre_SeedRand(myid); for (i = 0; i < local_num_rows; i++) + { values[i] = hypre_Rand(); + } HYPRE_IJVectorSetValues(ij_b, local_num_rows, NULL, values); hypre_TFree(values, HYPRE_MEMORY_HOST); @@ -2052,7 +2116,9 @@ main( hypre_int argc, 0 here) is usually used as the initial guess */ values = hypre_CTAlloc(HYPRE_Real, local_num_cols, HYPRE_MEMORY_HOST); for (i = 0; i < local_num_cols; i++) + { values[i] = 0.; + } HYPRE_IJVectorSetValues(ij_x, local_num_cols, NULL, values); hypre_TFree(values, HYPRE_MEMORY_HOST); @@ -2075,7 +2141,9 @@ main( hypre_int argc, values = hypre_CTAlloc(HYPRE_Real, local_num_rows, HYPRE_MEMORY_HOST); hypre_SeedRand(myid); for (i = 0; i < local_num_rows; i++) - values[i] = hypre_Rand()/dt; + { + values[i] = hypre_Rand() / dt; + } HYPRE_IJVectorSetValues(ij_b, local_num_rows, NULL, values); hypre_TFree(values, HYPRE_MEMORY_HOST); @@ -2092,7 +2160,9 @@ main( hypre_int argc, values = hypre_CTAlloc(HYPRE_Real, local_num_cols, HYPRE_MEMORY_HOST); hypre_SeedRand(myid); for (i = 0; i < local_num_cols; i++) + { values[i] = hypre_Rand(); + } HYPRE_IJVectorSetValues(ij_x, local_num_cols, NULL, values); hypre_TFree(values, HYPRE_MEMORY_HOST); @@ -2104,25 +2174,27 @@ main( hypre_int argc, hypre_PrintTiming("IJ Vector Setup", hypre_MPI_COMM_WORLD); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); - + if (num_functions > 1) { dof_func = NULL; if (build_funcs_type == 1) { - BuildFuncsFromOneFile(argc, argv, build_funcs_arg_index, parcsr_A, &dof_func); + BuildFuncsFromOneFile(argc, argv, build_funcs_arg_index, parcsr_A, &dof_func); } else if (build_funcs_type == 2) { - BuildFuncsFromFiles(argc, argv, build_funcs_arg_index, parcsr_A, &dof_func); + BuildFuncsFromFiles(argc, argv, build_funcs_arg_index, parcsr_A, &dof_func); } else { if (myid == 0) - hypre_printf (" Number of functions = %d \n", num_functions); + { + hypre_printf (" Number of functions = %d \n", num_functions); + } } } - + /*----------------------------------------------------------- * Print out the system and initial guess *-----------------------------------------------------------*/ @@ -2142,7 +2214,7 @@ main( hypre_int argc, if (solver_id == 20) { - if (myid == 0) hypre_printf("Solver: AMG\n"); + if (myid == 0) { hypre_printf("Solver: AMG\n"); } time_index = hypre_InitializeTiming("AMG_hybrid Setup"); hypre_BeginTiming(time_index); @@ -2168,11 +2240,17 @@ main( hypre_int argc, HYPRE_ParCSRHybridSetNumFunctions(amg_solver, num_functions); HYPRE_ParCSRHybridSetNodal(amg_solver, nodal); if (relax_down > -1) + { HYPRE_ParCSRHybridSetCycleRelaxType(amg_solver, relax_down, 1); + } if (relax_up > -1) + { HYPRE_ParCSRHybridSetCycleRelaxType(amg_solver, relax_up, 2); + } if (relax_coarse > -1) + { HYPRE_ParCSRHybridSetCycleRelaxType(amg_solver, relax_coarse, 3); + } HYPRE_ParCSRHybridSetRelaxOrder(amg_solver, relax_order); HYPRE_ParCSRHybridSetMaxCoarseSize(amg_solver, coarse_threshold); HYPRE_ParCSRHybridSetMinCoarseSize(amg_solver, min_coarse_size); @@ -2180,17 +2258,21 @@ main( hypre_int argc, HYPRE_ParCSRHybridSetRelaxWt(amg_solver, relax_wt); HYPRE_ParCSRHybridSetOuterWt(amg_solver, outer_wt); if (level_w > -1) + { HYPRE_ParCSRHybridSetLevelRelaxWt(amg_solver, relax_wt_level, level_w); + } if (level_ow > -1) + { HYPRE_ParCSRHybridSetLevelOuterWt(amg_solver, outer_wt_level, level_ow); - + } + HYPRE_ParCSRHybridSetup(amg_solver, parcsr_A, b, x); hypre_EndTiming(time_index); hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); - + time_index = hypre_InitializeTiming("ParCSR Hybrid Solve"); hypre_BeginTiming(time_index); @@ -2204,7 +2286,7 @@ main( hypre_int argc, HYPRE_ParCSRHybridGetNumIterations(amg_solver, &num_iterations); HYPRE_ParCSRHybridGetPCGNumIterations(amg_solver, &pcg_num_its); HYPRE_ParCSRHybridGetDSCGNumIterations(amg_solver, &dscg_num_its); - HYPRE_ParCSRHybridGetFinalRelativeResidualNorm(amg_solver, + HYPRE_ParCSRHybridGetFinalRelativeResidualNorm(amg_solver, &final_res_norm); if (myid == 0) @@ -2225,11 +2307,11 @@ main( hypre_int argc, if (solver_id == 0) { - if (myid == 0) hypre_printf("Solver: AMG\n"); + if (myid == 0) { hypre_printf("Solver: AMG\n"); } time_index = hypre_InitializeTiming("BoomerAMG Setup"); hypre_BeginTiming(time_index); - HYPRE_BoomerAMGCreate(&amg_solver); + HYPRE_BoomerAMGCreate(&amg_solver); /* BM Aug 25, 2006 */ HYPRE_BoomerAMGSetCGCIts(amg_solver, cgcits); HYPRE_BoomerAMGSetInterpType(amg_solver, interp_type); @@ -2247,9 +2329,9 @@ main( hypre_int argc, HYPRE_BoomerAMGSetPMaxElmts(amg_solver, P_max_elmts); HYPRE_BoomerAMGSetJacobiTruncThreshold(amg_solver, jacobi_trunc_threshold); HYPRE_BoomerAMGSetSCommPkgSwitch(amg_solver, S_commpkg_switch); -/* note: log is written to standard output, not to file */ + /* note: log is written to standard output, not to file */ HYPRE_BoomerAMGSetPrintLevel(amg_solver, 3); - HYPRE_BoomerAMGSetPrintFileName(amg_solver, "driver.out.log"); + HYPRE_BoomerAMGSetPrintFileName(amg_solver, "driver.out.log"); HYPRE_BoomerAMGSetCycleType(amg_solver, cycle_type); HYPRE_BoomerAMGSetNumSweeps(amg_solver, num_sweeps); HYPRE_BoomerAMGSetISType(amg_solver, IS_type); @@ -2259,11 +2341,17 @@ main( hypre_int argc, HYPRE_BoomerAMGSetCRUseCG(amg_solver, CR_use_CG); HYPRE_BoomerAMGSetRelaxType(amg_solver, relax_type); if (relax_down > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(amg_solver, relax_down, 1); + } if (relax_up > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(amg_solver, relax_up, 2); + } if (relax_coarse > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(amg_solver, relax_coarse, 3); + } HYPRE_BoomerAMGSetChebyOrder(amg_solver, cheby_order); HYPRE_BoomerAMGSetChebyFraction(amg_solver, cheby_fraction); HYPRE_BoomerAMGSetRelaxOrder(amg_solver, relax_order); @@ -2271,9 +2359,13 @@ main( hypre_int argc, HYPRE_BoomerAMGSetOuterWt(amg_solver, outer_wt); HYPRE_BoomerAMGSetMaxLevels(amg_solver, max_levels); if (level_w > -1) + { HYPRE_BoomerAMGSetLevelRelaxWt(amg_solver, relax_wt_level, level_w); + } if (level_ow > -1) + { HYPRE_BoomerAMGSetLevelOuterWt(amg_solver, outer_wt_level, level_ow); + } HYPRE_BoomerAMGSetSmoothType(amg_solver, smooth_type); HYPRE_BoomerAMGSetSmoothNumSweeps(amg_solver, smooth_num_sweeps); HYPRE_BoomerAMGSetSmoothNumLevels(amg_solver, smooth_num_levels); @@ -2283,9 +2375,9 @@ main( hypre_int argc, HYPRE_BoomerAMGSetOverlap(amg_solver, overlap); HYPRE_BoomerAMGSetDomainType(amg_solver, domain_type); HYPRE_BoomerAMGSetSchwarzUseNonSymm(amg_solver, use_nonsymm_schwarz); - + HYPRE_BoomerAMGSetSchwarzRlxWeight(amg_solver, schwarz_rlx_weight); - if (eu_level < 0) eu_level = 0; + if (eu_level < 0) { eu_level = 0; } HYPRE_BoomerAMGSetEuLevel(amg_solver, eu_level); HYPRE_BoomerAMGSetEuBJ(amg_solver, eu_bj); HYPRE_BoomerAMGSetEuSparseA(amg_solver, eu_sparse_A); @@ -2301,7 +2393,9 @@ main( hypre_int argc, HYPRE_BoomerAMGSetNodalDiag(amg_solver, nodal_diag); HYPRE_BoomerAMGSetCycleNumSweeps(amg_solver, ns_coarse, 3); if (num_functions > 1) - HYPRE_BoomerAMGSetDofFunc(amg_solver, dof_func); + { + HYPRE_BoomerAMGSetDofFunc(amg_solver, dof_func); + } HYPRE_BoomerAMGSetAdditive(amg_solver, additive); HYPRE_BoomerAMGSetMultAdditive(amg_solver, mult_add); HYPRE_BoomerAMGSetSimple(amg_solver, simple); @@ -2314,9 +2408,11 @@ main( hypre_int argc, /*HYPRE_BoomerAMGSetNonGalerkTol(amg_solver, nongalerk_num_tol, nongalerk_tol);*/ if (nongalerk_tol) { - HYPRE_BoomerAMGSetNonGalerkinTol(amg_solver, nongalerk_tol[nongalerk_num_tol-1]); - for (i=0; i < nongalerk_num_tol-1; i++) + HYPRE_BoomerAMGSetNonGalerkinTol(amg_solver, nongalerk_tol[nongalerk_num_tol - 1]); + for (i = 0; i < nongalerk_num_tol - 1; i++) + { HYPRE_BoomerAMGSetLevelNonGalerkinTol(amg_solver, nongalerk_tol[i], i); + } } if (build_rbm) { @@ -2327,7 +2423,8 @@ main( hypre_int argc, } /* BM Oct 23, 2006 */ - if (plot_grids) { + if (plot_grids) + { HYPRE_BoomerAMGSetPlotGrids (amg_solver, 1); HYPRE_BoomerAMGSetPlotFileName (amg_solver, plot_file_name); HYPRE_BoomerAMGSetCoordDim (amg_solver, coord_dim); @@ -2340,7 +2437,7 @@ main( hypre_int argc, hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); - + time_index = hypre_InitializeTiming("BoomerAMG Solve"); hypre_BeginTiming(time_index); @@ -2379,13 +2476,13 @@ main( hypre_int argc, if (solver_id == 13) { /* reset some smoother parameters */ - + relax_order = 0; - - if (myid == 0) hypre_printf("Solver: GSMG\n"); + + if (myid == 0) { hypre_printf("Solver: GSMG\n"); } time_index = hypre_InitializeTiming("BoomerAMG Setup"); hypre_BeginTiming(time_index); - + HYPRE_BoomerAMGCreate(&amg_solver); HYPRE_BoomerAMGSetGSMG(amg_solver, 4); /* specify GSMG */ /* BM Aug 25, 2006 */ @@ -2413,20 +2510,30 @@ main( hypre_int argc, HYPRE_BoomerAMGSetNumSweeps(amg_solver, num_sweeps); HYPRE_BoomerAMGSetRelaxType(amg_solver, relax_type); if (relax_down > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(amg_solver, relax_down, 1); + } if (relax_up > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(amg_solver, relax_up, 2); + } if (relax_coarse > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(amg_solver, relax_coarse, 3); + } HYPRE_BoomerAMGSetChebyOrder(amg_solver, cheby_order); HYPRE_BoomerAMGSetChebyFraction(amg_solver, cheby_fraction); HYPRE_BoomerAMGSetRelaxOrder(amg_solver, relax_order); HYPRE_BoomerAMGSetRelaxWt(amg_solver, relax_wt); HYPRE_BoomerAMGSetOuterWt(amg_solver, outer_wt); if (level_w > -1) + { HYPRE_BoomerAMGSetLevelRelaxWt(amg_solver, relax_wt_level, level_w); + } if (level_ow > -1) + { HYPRE_BoomerAMGSetLevelOuterWt(amg_solver, outer_wt_level, level_ow); + } HYPRE_BoomerAMGSetSmoothType(amg_solver, smooth_type); HYPRE_BoomerAMGSetSmoothNumSweeps(amg_solver, smooth_num_sweeps); HYPRE_BoomerAMGSetSmoothNumLevels(amg_solver, smooth_num_levels); @@ -2438,7 +2545,7 @@ main( hypre_int argc, HYPRE_BoomerAMGSetDomainType(amg_solver, domain_type); HYPRE_BoomerAMGSetSchwarzUseNonSymm(amg_solver, use_nonsymm_schwarz); HYPRE_BoomerAMGSetSchwarzRlxWeight(amg_solver, schwarz_rlx_weight); - if (eu_level < 0) eu_level = 0; + if (eu_level < 0) { eu_level = 0; } HYPRE_BoomerAMGSetEuLevel(amg_solver, eu_level); HYPRE_BoomerAMGSetEuBJ(amg_solver, eu_bj); HYPRE_BoomerAMGSetEuSparseA(amg_solver, eu_sparse_A); @@ -2453,7 +2560,9 @@ main( hypre_int argc, HYPRE_BoomerAMGSetNodal(amg_solver, nodal); HYPRE_BoomerAMGSetNodalDiag(amg_solver, nodal_diag); if (num_functions > 1) + { HYPRE_BoomerAMGSetDofFunc(amg_solver, dof_func); + } HYPRE_BoomerAMGSetAdditive(amg_solver, additive); HYPRE_BoomerAMGSetMultAdditive(amg_solver, mult_add); HYPRE_BoomerAMGSetSimple(amg_solver, simple); @@ -2463,23 +2572,25 @@ main( hypre_int argc, HYPRE_BoomerAMGSetKeepTranspose(amg_solver, keepTranspose); if (nongalerk_tol) { - HYPRE_BoomerAMGSetNonGalerkinTol(amg_solver, nongalerk_tol[nongalerk_num_tol-1]); - for (i=0; i < nongalerk_num_tol-1; i++) + HYPRE_BoomerAMGSetNonGalerkinTol(amg_solver, nongalerk_tol[nongalerk_num_tol - 1]); + for (i = 0; i < nongalerk_num_tol - 1; i++) + { HYPRE_BoomerAMGSetLevelNonGalerkinTol(amg_solver, nongalerk_tol[i], i); + } } - + HYPRE_BoomerAMGSetup(amg_solver, parcsr_A, b, x); - + hypre_EndTiming(time_index); hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); - + time_index = hypre_InitializeTiming("BoomerAMG Solve"); hypre_BeginTiming(time_index); - + HYPRE_BoomerAMGSolve(amg_solver, parcsr_A, b, x); - + hypre_EndTiming(time_index); hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); hypre_FinalizeTiming(time_index); @@ -2491,7 +2602,7 @@ main( hypre_int argc, HYPRE_BoomerAMGSetup(amg_solver, parcsr_A, b, x); HYPRE_BoomerAMGSolve(amg_solver, parcsr_A, b, x); #endif - + HYPRE_BoomerAMGDestroy(amg_solver); } @@ -2501,7 +2612,7 @@ main( hypre_int argc, HYPRE_ParCSRMatrix parcsr_mat; /* use ParaSails preconditioner */ - if (myid == 0) hypre_printf("Test ParaSails Build IJMatrix\n"); + if (myid == 0) { hypre_printf("Test ParaSails Build IJMatrix\n"); } HYPRE_IJMatrixPrint(ij_A, "parasails.in"); @@ -2517,20 +2628,20 @@ main( hypre_int argc, HYPRE_ParaSailsBuildIJMatrix(pcg_precond, &ij_M); HYPRE_IJMatrixPrint(ij_M, "parasails.out"); - if (myid == 0) hypre_printf("Printed to parasails.out.\n"); + if (myid == 0) { hypre_printf("Printed to parasails.out.\n"); } exit(0); } /*----------------------------------------------------------- - * Solve the system using PCG + * Solve the system using PCG *-----------------------------------------------------------*/ - if (solver_id == 1 || solver_id == 2 || solver_id == 8 || + if (solver_id == 1 || solver_id == 2 || solver_id == 8 || solver_id == 12 || solver_id == 14 || solver_id == 43) { time_index = hypre_InitializeTiming("PCG Setup"); hypre_BeginTiming(time_index); - + HYPRE_ParCSRPCGCreate(hypre_MPI_COMM_WORLD, &pcg_solver); HYPRE_PCGSetMaxIter(pcg_solver, max_iter); HYPRE_PCGSetTol(pcg_solver, tol); @@ -2542,8 +2653,8 @@ main( hypre_int argc, if (solver_id == 1) { /* use BoomerAMG as preconditioner */ - if (myid == 0) hypre_printf("Solver: AMG-PCG\n"); - HYPRE_BoomerAMGCreate(&pcg_precond); + if (myid == 0) { hypre_printf("Solver: AMG-PCG\n"); } + HYPRE_BoomerAMGCreate(&pcg_precond); /* BM Aug 25, 2006 */ HYPRE_BoomerAMGSetCGCIts(pcg_precond, cgcits); HYPRE_BoomerAMGSetInterpType(pcg_precond, interp_type); @@ -2573,20 +2684,30 @@ main( hypre_int argc, HYPRE_BoomerAMGSetCRUseCG(pcg_precond, CR_use_CG); HYPRE_BoomerAMGSetRelaxType(pcg_precond, relax_type); if (relax_down > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_down, 1); + } if (relax_up > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_up, 2); + } if (relax_coarse > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_coarse, 3); + } HYPRE_BoomerAMGSetChebyOrder(pcg_precond, cheby_order); HYPRE_BoomerAMGSetChebyFraction(pcg_precond, cheby_fraction); HYPRE_BoomerAMGSetRelaxOrder(pcg_precond, relax_order); HYPRE_BoomerAMGSetRelaxWt(pcg_precond, relax_wt); HYPRE_BoomerAMGSetOuterWt(pcg_precond, outer_wt); if (level_w > -1) - HYPRE_BoomerAMGSetLevelRelaxWt(pcg_precond, relax_wt_level,level_w); + { + HYPRE_BoomerAMGSetLevelRelaxWt(pcg_precond, relax_wt_level, level_w); + } if (level_ow > -1) - HYPRE_BoomerAMGSetLevelOuterWt(pcg_precond,outer_wt_level,level_ow); + { + HYPRE_BoomerAMGSetLevelOuterWt(pcg_precond, outer_wt_level, level_ow); + } HYPRE_BoomerAMGSetSmoothType(pcg_precond, smooth_type); HYPRE_BoomerAMGSetSmoothNumLevels(pcg_precond, smooth_num_levels); HYPRE_BoomerAMGSetSmoothNumSweeps(pcg_precond, smooth_num_sweeps); @@ -2607,13 +2728,15 @@ main( hypre_int argc, HYPRE_BoomerAMGSetDomainType(pcg_precond, domain_type); HYPRE_BoomerAMGSetSchwarzUseNonSymm(pcg_precond, use_nonsymm_schwarz); HYPRE_BoomerAMGSetSchwarzRlxWeight(pcg_precond, schwarz_rlx_weight); - if (eu_level < 0) eu_level = 0; + if (eu_level < 0) { eu_level = 0; } HYPRE_BoomerAMGSetEuLevel(pcg_precond, eu_level); HYPRE_BoomerAMGSetEuBJ(pcg_precond, eu_bj); HYPRE_BoomerAMGSetEuSparseA(pcg_precond, eu_sparse_A); HYPRE_BoomerAMGSetCycleNumSweeps(pcg_precond, ns_coarse, 3); if (num_functions > 1) + { HYPRE_BoomerAMGSetDofFunc(pcg_precond, dof_func); + } HYPRE_BoomerAMGSetAdditive(pcg_precond, additive); HYPRE_BoomerAMGSetMultAdditive(pcg_precond, mult_add); HYPRE_BoomerAMGSetSimple(pcg_precond, simple); @@ -2623,9 +2746,11 @@ main( hypre_int argc, HYPRE_BoomerAMGSetKeepTranspose(pcg_precond, keepTranspose); if (nongalerk_tol) { - HYPRE_BoomerAMGSetNonGalerkinTol(pcg_precond, nongalerk_tol[nongalerk_num_tol-1]); - for (i=0; i < nongalerk_num_tol-1; i++) + HYPRE_BoomerAMGSetNonGalerkinTol(pcg_precond, nongalerk_tol[nongalerk_num_tol - 1]); + for (i = 0; i < nongalerk_num_tol - 1; i++) + { HYPRE_BoomerAMGSetLevelNonGalerkinTol(pcg_precond, nongalerk_tol[i], i); + } } if (build_rbm) { @@ -2642,9 +2767,9 @@ main( hypre_int argc, } else if (solver_id == 2) { - + /* use diagonal scaling as preconditioner */ - if (myid == 0) hypre_printf("Solver: DS-PCG\n"); + if (myid == 0) { hypre_printf("Solver: DS-PCG\n"); } pcg_precond = NULL; HYPRE_PCGSetPrecond(pcg_solver, @@ -2655,9 +2780,9 @@ main( hypre_int argc, else if (solver_id == 8) { /* use ParaSails preconditioner */ - if (myid == 0) hypre_printf("Solver: ParaSails-PCG\n"); + if (myid == 0) { hypre_printf("Solver: ParaSails-PCG\n"); } - HYPRE_ParaSailsCreate(hypre_MPI_COMM_WORLD, &pcg_precond); + HYPRE_ParaSailsCreate(hypre_MPI_COMM_WORLD, &pcg_precond); HYPRE_ParaSailsSetParams(pcg_precond, sai_threshold, max_levels); HYPRE_ParaSailsSetFilter(pcg_precond, sai_filter); HYPRE_ParaSailsSetLogging(pcg_precond, poutdat); @@ -2670,12 +2795,12 @@ main( hypre_int argc, else if (solver_id == 12) { /* use Schwarz preconditioner */ - if (myid == 0) hypre_printf("Solver: Schwarz-PCG\n"); + if (myid == 0) { hypre_printf("Solver: Schwarz-PCG\n"); } - HYPRE_SchwarzCreate(&pcg_precond); - HYPRE_SchwarzSetVariant(pcg_precond, variant); - HYPRE_SchwarzSetOverlap(pcg_precond, overlap); - HYPRE_SchwarzSetDomainType(pcg_precond, domain_type); + HYPRE_SchwarzCreate(&pcg_precond); + HYPRE_SchwarzSetVariant(pcg_precond, variant); + HYPRE_SchwarzSetOverlap(pcg_precond, overlap); + HYPRE_SchwarzSetDomainType(pcg_precond, domain_type); HYPRE_SchwarzSetRelaxWeight(pcg_precond, schwarz_rlx_weight); HYPRE_SchwarzSetNonSymm(pcg_precond, use_nonsymm_schwarz); HYPRE_PCGSetPrecond(pcg_solver, @@ -2688,13 +2813,13 @@ main( hypre_int argc, /* use GSMG as preconditioner */ /* reset some smoother parameters */ - + /* fine grid */ relax_order = 0; - - if (myid == 0) hypre_printf("Solver: GSMG-PCG\n"); - HYPRE_BoomerAMGCreate(&pcg_precond); - HYPRE_BoomerAMGSetGSMG(pcg_precond, 4); + + if (myid == 0) { hypre_printf("Solver: GSMG-PCG\n"); } + HYPRE_BoomerAMGCreate(&pcg_precond); + HYPRE_BoomerAMGSetGSMG(pcg_precond, 4); /* BM Aug 25, 2006 */ HYPRE_BoomerAMGSetCGCIts(pcg_precond, cgcits); HYPRE_BoomerAMGSetInterpType(pcg_precond, interp_type); @@ -2724,20 +2849,30 @@ main( hypre_int argc, HYPRE_BoomerAMGSetCRUseCG(pcg_precond, CR_use_CG); HYPRE_BoomerAMGSetRelaxType(pcg_precond, relax_type); if (relax_down > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_down, 1); + } if (relax_up > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_up, 2); + } if (relax_coarse > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_coarse, 3); + } HYPRE_BoomerAMGSetRelaxOrder(pcg_precond, relax_order); HYPRE_BoomerAMGSetChebyOrder(pcg_precond, cheby_order); HYPRE_BoomerAMGSetChebyFraction(pcg_precond, cheby_fraction); HYPRE_BoomerAMGSetRelaxWt(pcg_precond, relax_wt); HYPRE_BoomerAMGSetOuterWt(pcg_precond, outer_wt); if (level_w > -1) - HYPRE_BoomerAMGSetLevelRelaxWt(pcg_precond, relax_wt_level,level_w); + { + HYPRE_BoomerAMGSetLevelRelaxWt(pcg_precond, relax_wt_level, level_w); + } if (level_ow > -1) - HYPRE_BoomerAMGSetLevelOuterWt(pcg_precond,outer_wt_level,level_ow); + { + HYPRE_BoomerAMGSetLevelOuterWt(pcg_precond, outer_wt_level, level_ow); + } HYPRE_BoomerAMGSetSmoothType(pcg_precond, smooth_type); HYPRE_BoomerAMGSetSmoothNumLevels(pcg_precond, smooth_num_levels); HYPRE_BoomerAMGSetSmoothNumSweeps(pcg_precond, smooth_num_sweeps); @@ -2745,7 +2880,7 @@ main( hypre_int argc, HYPRE_BoomerAMGSetOverlap(pcg_precond, overlap); HYPRE_BoomerAMGSetDomainType(pcg_precond, domain_type); HYPRE_BoomerAMGSetSchwarzRlxWeight(pcg_precond, schwarz_rlx_weight); - if (eu_level < 0) eu_level = 0; + if (eu_level < 0) { eu_level = 0; } HYPRE_BoomerAMGSetEuLevel(pcg_precond, eu_level); HYPRE_BoomerAMGSetEuBJ(pcg_precond, eu_bj); HYPRE_BoomerAMGSetEuSparseA(pcg_precond, eu_sparse_A); @@ -2763,7 +2898,9 @@ main( hypre_int argc, HYPRE_BoomerAMGSetNodalDiag(pcg_precond, nodal_diag); HYPRE_BoomerAMGSetCycleNumSweeps(pcg_precond, ns_coarse, 3); if (num_functions > 1) + { HYPRE_BoomerAMGSetDofFunc(pcg_precond, dof_func); + } HYPRE_BoomerAMGSetAdditive(pcg_precond, additive); HYPRE_BoomerAMGSetMultAdditive(pcg_precond, mult_add); HYPRE_BoomerAMGSetSimple(pcg_precond, simple); @@ -2773,9 +2910,11 @@ main( hypre_int argc, HYPRE_BoomerAMGSetKeepTranspose(pcg_precond, keepTranspose); if (nongalerk_tol) { - HYPRE_BoomerAMGSetNonGalerkinTol(pcg_precond, nongalerk_tol[nongalerk_num_tol-1]); - for (i=0; i < nongalerk_num_tol-1; i++) + HYPRE_BoomerAMGSetNonGalerkinTol(pcg_precond, nongalerk_tol[nongalerk_num_tol - 1]); + for (i = 0; i < nongalerk_num_tol - 1; i++) + { HYPRE_BoomerAMGSetLevelNonGalerkinTol(pcg_precond, nongalerk_tol[i], i); + } } HYPRE_PCGSetMaxIter(pcg_solver, mg_max_iter); HYPRE_PCGSetPrecond(pcg_solver, @@ -2786,20 +2925,20 @@ main( hypre_int argc, else if (solver_id == 43) { /* use Euclid preconditioning */ - if (myid == 0) hypre_printf("Solver: Euclid-PCG\n"); + if (myid == 0) { hypre_printf("Solver: Euclid-PCG\n"); } HYPRE_EuclidCreate(hypre_MPI_COMM_WORLD, &pcg_precond); - /* note: There are three three methods of setting run-time + /* note: There are three three methods of setting run-time parameters for Euclid: (see HYPRE_parcsr_ls.h); here - we'll use what I think is simplest: let Euclid internally + we'll use what I think is simplest: let Euclid internally parse the command line. - */ - if (eu_level > -1) HYPRE_EuclidSetLevel(pcg_precond, eu_level); - if (eu_ilut) HYPRE_EuclidSetILUT(pcg_precond, eu_ilut); - if (eu_sparse_A) HYPRE_EuclidSetSparseA(pcg_precond, eu_sparse_A); - if (eu_row_scale) HYPRE_EuclidSetRowScale(pcg_precond, eu_row_scale); - if (eu_bj) HYPRE_EuclidSetBJ(pcg_precond, eu_bj); + */ + if (eu_level > -1) { HYPRE_EuclidSetLevel(pcg_precond, eu_level); } + if (eu_ilut) { HYPRE_EuclidSetILUT(pcg_precond, eu_ilut); } + if (eu_sparse_A) { HYPRE_EuclidSetSparseA(pcg_precond, eu_sparse_A); } + if (eu_row_scale) { HYPRE_EuclidSetRowScale(pcg_precond, eu_row_scale); } + if (eu_bj) { HYPRE_EuclidSetBJ(pcg_precond, eu_bj); } HYPRE_EuclidSetStats(pcg_precond, eu_stats); HYPRE_EuclidSetMem(pcg_precond, eu_mem); @@ -2810,65 +2949,66 @@ main( hypre_int argc, (HYPRE_PtrToSolverFcn) HYPRE_EuclidSetup, pcg_precond); } - + HYPRE_PCGGetPrecond(pcg_solver, &pcg_precond_gotten); if (pcg_precond_gotten != pcg_precond) { hypre_printf("HYPRE_ParCSRPCGGetPrecond got bad precond\n"); - return(-1); + return (-1); + } + else if (myid == 0) + { + hypre_printf("HYPRE_ParCSRPCGGetPrecond got good precond\n"); } - else - if (myid == 0) - hypre_printf("HYPRE_ParCSRPCGGetPrecond got good precond\n"); - HYPRE_PCGSetup(pcg_solver, (HYPRE_Matrix)parcsr_A, + HYPRE_PCGSetup(pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, (HYPRE_Vector)x); - + hypre_EndTiming(time_index); hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); - + time_index = hypre_InitializeTiming("PCG Solve"); hypre_BeginTiming(time_index); - - HYPRE_PCGSolve(pcg_solver, (HYPRE_Matrix)parcsr_A, + + HYPRE_PCGSolve(pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, (HYPRE_Vector)x); - + hypre_EndTiming(time_index); hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); - + HYPRE_PCGGetNumIterations(pcg_solver, &num_iterations); HYPRE_PCGGetFinalRelativeResidualNorm(pcg_solver, &final_res_norm); #if SECOND_TIME /* run a second time to check for memory leaks */ HYPRE_ParVectorSetRandomValues(x, 775); - HYPRE_PCGSetup(pcg_solver, (HYPRE_Matrix)parcsr_A, + HYPRE_PCGSetup(pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, (HYPRE_Vector)x); - HYPRE_PCGSolve(pcg_solver, (HYPRE_Matrix)parcsr_A, + HYPRE_PCGSolve(pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, (HYPRE_Vector)x); #endif HYPRE_ParCSRPCGDestroy(pcg_solver); - + if (solver_id == 1) { HYPRE_BoomerAMGDestroy(pcg_precond); } else if (solver_id == 8) { - HYPRE_ParaSailsDestroy(pcg_precond); + HYPRE_ParaSailsDestroy(pcg_precond); } else if (solver_id == 12) { - HYPRE_SchwarzDestroy(pcg_precond); + HYPRE_SchwarzDestroy(pcg_precond); } else if (solver_id == 14) { - HYPRE_BoomerAMGDestroy(pcg_precond); + HYPRE_BoomerAMGDestroy(pcg_precond); } else if (solver_id == 43) { @@ -2882,11 +3022,11 @@ main( hypre_int argc, hypre_printf("Final Relative Residual Norm = %e\n", final_res_norm); hypre_printf("\n"); } - + } /*----------------------------------------------------------- - * Solve the system using GMRES + * Solve the system using GMRES *-----------------------------------------------------------*/ if (solver_id == 3 || solver_id == 4 || solver_id == 7 || @@ -2894,7 +3034,7 @@ main( hypre_int argc, { time_index = hypre_InitializeTiming("GMRES Setup"); hypre_BeginTiming(time_index); - + HYPRE_ParCSRGMRESCreate(hypre_MPI_COMM_WORLD, &pcg_solver); HYPRE_GMRESSetKDim(pcg_solver, k_dim); HYPRE_GMRESSetMaxIter(pcg_solver, max_iter); @@ -2907,9 +3047,9 @@ main( hypre_int argc, if (solver_id == 3) { /* use BoomerAMG as preconditioner */ - if (myid == 0) hypre_printf("Solver: AMG-GMRES\n"); + if (myid == 0) { hypre_printf("Solver: AMG-GMRES\n"); } - HYPRE_BoomerAMGCreate(&pcg_precond); + HYPRE_BoomerAMGCreate(&pcg_precond); HYPRE_BoomerAMGSetCGCIts(pcg_precond, cgcits); HYPRE_BoomerAMGSetInterpType(pcg_precond, interp_type); HYPRE_BoomerAMGSetPostInterpType(pcg_precond, post_interp_type); @@ -2938,20 +3078,30 @@ main( hypre_int argc, HYPRE_BoomerAMGSetCRUseCG(pcg_precond, CR_use_CG); HYPRE_BoomerAMGSetRelaxType(pcg_precond, relax_type); if (relax_down > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_down, 1); + } if (relax_up > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_up, 2); + } if (relax_coarse > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_coarse, 3); + } HYPRE_BoomerAMGSetChebyOrder(pcg_precond, cheby_order); HYPRE_BoomerAMGSetChebyFraction(pcg_precond, cheby_fraction); HYPRE_BoomerAMGSetRelaxOrder(pcg_precond, relax_order); HYPRE_BoomerAMGSetRelaxWt(pcg_precond, relax_wt); HYPRE_BoomerAMGSetOuterWt(pcg_precond, outer_wt); if (level_w > -1) - HYPRE_BoomerAMGSetLevelRelaxWt(pcg_precond, relax_wt_level,level_w); + { + HYPRE_BoomerAMGSetLevelRelaxWt(pcg_precond, relax_wt_level, level_w); + } if (level_ow > -1) - HYPRE_BoomerAMGSetLevelOuterWt(pcg_precond,outer_wt_level,level_ow); + { + HYPRE_BoomerAMGSetLevelOuterWt(pcg_precond, outer_wt_level, level_ow); + } HYPRE_BoomerAMGSetSmoothType(pcg_precond, smooth_type); HYPRE_BoomerAMGSetSmoothNumLevels(pcg_precond, smooth_num_levels); HYPRE_BoomerAMGSetSmoothNumSweeps(pcg_precond, smooth_num_sweeps); @@ -2972,13 +3122,15 @@ main( hypre_int argc, HYPRE_BoomerAMGSetDomainType(pcg_precond, domain_type); HYPRE_BoomerAMGSetSchwarzUseNonSymm(pcg_precond, use_nonsymm_schwarz); HYPRE_BoomerAMGSetSchwarzRlxWeight(pcg_precond, schwarz_rlx_weight); - if (eu_level < 0) eu_level = 0; + if (eu_level < 0) { eu_level = 0; } HYPRE_BoomerAMGSetEuLevel(pcg_precond, eu_level); HYPRE_BoomerAMGSetEuBJ(pcg_precond, eu_bj); HYPRE_BoomerAMGSetEuSparseA(pcg_precond, eu_sparse_A); HYPRE_BoomerAMGSetCycleNumSweeps(pcg_precond, ns_coarse, 3); if (num_functions > 1) + { HYPRE_BoomerAMGSetDofFunc(pcg_precond, dof_func); + } HYPRE_BoomerAMGSetAdditive(pcg_precond, additive); HYPRE_BoomerAMGSetMultAdditive(pcg_precond, mult_add); HYPRE_BoomerAMGSetSimple(pcg_precond, simple); @@ -2988,9 +3140,11 @@ main( hypre_int argc, HYPRE_BoomerAMGSetKeepTranspose(pcg_precond, keepTranspose); if (nongalerk_tol) { - HYPRE_BoomerAMGSetNonGalerkinTol(pcg_precond, nongalerk_tol[nongalerk_num_tol-1]); - for (i=0; i < nongalerk_num_tol-1; i++) + HYPRE_BoomerAMGSetNonGalerkinTol(pcg_precond, nongalerk_tol[nongalerk_num_tol - 1]); + for (i = 0; i < nongalerk_num_tol - 1; i++) + { HYPRE_BoomerAMGSetLevelNonGalerkinTol(pcg_precond, nongalerk_tol[i], i); + } } if (build_rbm) { @@ -3008,7 +3162,7 @@ main( hypre_int argc, else if (solver_id == 4) { /* use diagonal scaling as preconditioner */ - if (myid == 0) hypre_printf("Solver: DS-GMRES\n"); + if (myid == 0) { hypre_printf("Solver: DS-GMRES\n"); } pcg_precond = NULL; HYPRE_GMRESSetPrecond(pcg_solver, @@ -3019,10 +3173,11 @@ main( hypre_int argc, else if (solver_id == 7) { /* use PILUT as preconditioner */ - if (myid == 0) hypre_printf("Solver: PILUT-GMRES\n"); + if (myid == 0) { hypre_printf("Solver: PILUT-GMRES\n"); } - ierr = HYPRE_ParCSRPilutCreate( hypre_MPI_COMM_WORLD, &pcg_precond ); - if (ierr) { + ierr = HYPRE_ParCSRPilutCreate( hypre_MPI_COMM_WORLD, &pcg_precond ); + if (ierr) + { hypre_printf("Error in ParPilutCreate\n"); } @@ -3044,12 +3199,12 @@ main( hypre_int argc, /* use GSMG as preconditioner */ /* reset some smoother parameters */ - + relax_order = 0; - - if (myid == 0) hypre_printf("Solver: GSMG-GMRES\n"); - HYPRE_BoomerAMGCreate(&pcg_precond); - HYPRE_BoomerAMGSetGSMG(pcg_precond, 4); + + if (myid == 0) { hypre_printf("Solver: GSMG-GMRES\n"); } + HYPRE_BoomerAMGCreate(&pcg_precond); + HYPRE_BoomerAMGSetGSMG(pcg_precond, 4); HYPRE_BoomerAMGSetCGCIts(pcg_precond, cgcits); HYPRE_BoomerAMGSetInterpType(pcg_precond, interp_type); HYPRE_BoomerAMGSetPostInterpType(pcg_precond, post_interp_type); @@ -3078,20 +3233,30 @@ main( hypre_int argc, HYPRE_BoomerAMGSetCRUseCG(pcg_precond, CR_use_CG); HYPRE_BoomerAMGSetRelaxType(pcg_precond, relax_type); if (relax_down > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_down, 1); + } if (relax_up > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_up, 2); + } if (relax_coarse > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_coarse, 3); + } HYPRE_BoomerAMGSetChebyOrder(pcg_precond, cheby_order); HYPRE_BoomerAMGSetChebyFraction(pcg_precond, cheby_fraction); HYPRE_BoomerAMGSetRelaxOrder(pcg_precond, relax_order); HYPRE_BoomerAMGSetRelaxWt(pcg_precond, relax_wt); HYPRE_BoomerAMGSetOuterWt(pcg_precond, outer_wt); if (level_w > -1) - HYPRE_BoomerAMGSetLevelRelaxWt(pcg_precond, relax_wt_level,level_w); + { + HYPRE_BoomerAMGSetLevelRelaxWt(pcg_precond, relax_wt_level, level_w); + } if (level_ow > -1) - HYPRE_BoomerAMGSetLevelOuterWt(pcg_precond,outer_wt_level,level_ow); + { + HYPRE_BoomerAMGSetLevelOuterWt(pcg_precond, outer_wt_level, level_ow); + } HYPRE_BoomerAMGSetSmoothType(pcg_precond, smooth_type); HYPRE_BoomerAMGSetSmoothNumLevels(pcg_precond, smooth_num_levels); HYPRE_BoomerAMGSetSmoothNumSweeps(pcg_precond, smooth_num_sweeps); @@ -3100,7 +3265,7 @@ main( hypre_int argc, HYPRE_BoomerAMGSetDomainType(pcg_precond, domain_type); HYPRE_BoomerAMGSetSchwarzUseNonSymm(pcg_precond, use_nonsymm_schwarz); HYPRE_BoomerAMGSetSchwarzRlxWeight(pcg_precond, schwarz_rlx_weight); - if (eu_level < 0) eu_level = 0; + if (eu_level < 0) { eu_level = 0; } HYPRE_BoomerAMGSetEuLevel(pcg_precond, eu_level); HYPRE_BoomerAMGSetEuBJ(pcg_precond, eu_bj); HYPRE_BoomerAMGSetEuSparseA(pcg_precond, eu_sparse_A); @@ -3118,7 +3283,9 @@ main( hypre_int argc, HYPRE_BoomerAMGSetNodalDiag(pcg_precond, nodal_diag); HYPRE_BoomerAMGSetCycleNumSweeps(pcg_precond, ns_coarse, 3); if (num_functions > 1) + { HYPRE_BoomerAMGSetDofFunc(pcg_precond, dof_func); + } HYPRE_BoomerAMGSetAdditive(pcg_precond, additive); HYPRE_BoomerAMGSetMultAdditive(pcg_precond, mult_add); HYPRE_BoomerAMGSetSimple(pcg_precond, simple); @@ -3128,9 +3295,11 @@ main( hypre_int argc, HYPRE_BoomerAMGSetKeepTranspose(pcg_precond, keepTranspose); if (nongalerk_tol) { - HYPRE_BoomerAMGSetNonGalerkinTol(pcg_precond, nongalerk_tol[nongalerk_num_tol-1]); - for (i=0; i < nongalerk_num_tol-1; i++) + HYPRE_BoomerAMGSetNonGalerkinTol(pcg_precond, nongalerk_tol[nongalerk_num_tol - 1]); + for (i = 0; i < nongalerk_num_tol - 1; i++) + { HYPRE_BoomerAMGSetLevelNonGalerkinTol(pcg_precond, nongalerk_tol[i], i); + } } HYPRE_GMRESSetMaxIter(pcg_solver, mg_max_iter); HYPRE_GMRESSetPrecond(pcg_solver, @@ -3141,13 +3310,13 @@ main( hypre_int argc, else if (solver_id == 18) { /* use ParaSails preconditioner */ - if (myid == 0) hypre_printf("Solver: ParaSails-GMRES\n"); + if (myid == 0) { hypre_printf("Solver: ParaSails-GMRES\n"); } - HYPRE_ParaSailsCreate(hypre_MPI_COMM_WORLD, &pcg_precond); - HYPRE_ParaSailsSetParams(pcg_precond, sai_threshold, max_levels); + HYPRE_ParaSailsCreate(hypre_MPI_COMM_WORLD, &pcg_precond); + HYPRE_ParaSailsSetParams(pcg_precond, sai_threshold, max_levels); HYPRE_ParaSailsSetFilter(pcg_precond, sai_filter); HYPRE_ParaSailsSetLogging(pcg_precond, poutdat); - HYPRE_ParaSailsSetSym(pcg_precond, 0); + HYPRE_ParaSailsSetSym(pcg_precond, 0); HYPRE_GMRESSetPrecond(pcg_solver, (HYPRE_PtrToSolverFcn) HYPRE_ParaSailsSolve, @@ -3157,15 +3326,15 @@ main( hypre_int argc, else if (solver_id == 44) { /* use Euclid preconditioning */ - if (myid == 0) hypre_printf("Solver: Euclid-GMRES\n"); + if (myid == 0) { hypre_printf("Solver: Euclid-GMRES\n"); } HYPRE_EuclidCreate(hypre_MPI_COMM_WORLD, &pcg_precond); - if (eu_level > -1) HYPRE_EuclidSetLevel(pcg_precond, eu_level); - if (eu_ilut) HYPRE_EuclidSetILUT(pcg_precond, eu_ilut); - if (eu_sparse_A) HYPRE_EuclidSetSparseA(pcg_precond, eu_sparse_A); - if (eu_row_scale) HYPRE_EuclidSetRowScale(pcg_precond, eu_row_scale); - if (eu_bj) HYPRE_EuclidSetBJ(pcg_precond, eu_bj); + if (eu_level > -1) { HYPRE_EuclidSetLevel(pcg_precond, eu_level); } + if (eu_ilut) { HYPRE_EuclidSetILUT(pcg_precond, eu_ilut); } + if (eu_sparse_A) { HYPRE_EuclidSetSparseA(pcg_precond, eu_sparse_A); } + if (eu_row_scale) { HYPRE_EuclidSetRowScale(pcg_precond, eu_row_scale); } + if (eu_bj) { HYPRE_EuclidSetBJ(pcg_precond, eu_bj); } HYPRE_EuclidSetStats(pcg_precond, eu_stats); HYPRE_EuclidSetMem(pcg_precond, eu_mem); /*HYPRE_EuclidSetParams(pcg_precond, argc, argv);*/ @@ -3175,48 +3344,49 @@ main( hypre_int argc, (HYPRE_PtrToSolverFcn) HYPRE_EuclidSetup, pcg_precond); } - + HYPRE_GMRESGetPrecond(pcg_solver, &pcg_precond_gotten); if (pcg_precond_gotten != pcg_precond) { hypre_printf("HYPRE_GMRESGetPrecond got bad precond\n"); - return(-1); + return (-1); + } + else if (myid == 0) + { + hypre_printf("HYPRE_GMRESGetPrecond got good precond\n"); } - else - if (myid == 0) - hypre_printf("HYPRE_GMRESGetPrecond got good precond\n"); HYPRE_GMRESSetup - (pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, (HYPRE_Vector)x); - + (pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, (HYPRE_Vector)x); + hypre_EndTiming(time_index); hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); - + time_index = hypre_InitializeTiming("GMRES Solve"); hypre_BeginTiming(time_index); - + HYPRE_GMRESSolve - (pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, (HYPRE_Vector)x); - + (pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, (HYPRE_Vector)x); + hypre_EndTiming(time_index); hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); - + HYPRE_GMRESGetNumIterations(pcg_solver, &num_iterations); - HYPRE_GMRESGetFinalRelativeResidualNorm(pcg_solver,&final_res_norm); + HYPRE_GMRESGetFinalRelativeResidualNorm(pcg_solver, &final_res_norm); #if SECOND_TIME /* run a second time to check for memory leaks */ HYPRE_ParVectorSetRandomValues(x, 775); - HYPRE_GMRESSetup(pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, + HYPRE_GMRESSetup(pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, (HYPRE_Vector)x); - HYPRE_GMRESSolve(pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, + HYPRE_GMRESSolve(pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, (HYPRE_Vector)x); #endif HYPRE_ParCSRGMRESDestroy(pcg_solver); - + if (solver_id == 3 || solver_id == 15) { HYPRE_BoomerAMGDestroy(pcg_precond); @@ -3228,7 +3398,7 @@ main( hypre_int argc, } else if (solver_id == 18) { - HYPRE_ParaSailsDestroy(pcg_precond); + HYPRE_ParaSailsDestroy(pcg_precond); } else if (solver_id == 44) { @@ -3243,15 +3413,15 @@ main( hypre_int argc, hypre_printf("\n"); } } -/*----------------------------------------------------------- - * Solve the system using LGMRES - *-----------------------------------------------------------*/ + /*----------------------------------------------------------- + * Solve the system using LGMRES + *-----------------------------------------------------------*/ if (solver_id == 50 || solver_id == 51 ) { time_index = hypre_InitializeTiming("LGMRES Setup"); hypre_BeginTiming(time_index); - + HYPRE_ParCSRLGMRESCreate(hypre_MPI_COMM_WORLD, &pcg_solver); HYPRE_LGMRESSetKDim(pcg_solver, k_dim); HYPRE_LGMRESSetAugDim(pcg_solver, aug_dim); @@ -3260,13 +3430,13 @@ main( hypre_int argc, HYPRE_LGMRESSetAbsoluteTol(pcg_solver, atol); HYPRE_LGMRESSetLogging(pcg_solver, 1); HYPRE_LGMRESSetPrintLevel(pcg_solver, ioutdat); - + if (solver_id == 51) { /* use BoomerAMG as preconditioner */ - if (myid == 0) hypre_printf("Solver: AMG-LGMRES\n"); + if (myid == 0) { hypre_printf("Solver: AMG-LGMRES\n"); } - HYPRE_BoomerAMGCreate(&pcg_precond); + HYPRE_BoomerAMGCreate(&pcg_precond); HYPRE_BoomerAMGSetCGCIts(pcg_precond, cgcits); HYPRE_BoomerAMGSetInterpType(pcg_precond, interp_type); HYPRE_BoomerAMGSetPostInterpType(pcg_precond, post_interp_type); @@ -3295,20 +3465,30 @@ main( hypre_int argc, HYPRE_BoomerAMGSetCRUseCG(pcg_precond, CR_use_CG); HYPRE_BoomerAMGSetRelaxType(pcg_precond, relax_type); if (relax_down > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_down, 1); + } if (relax_up > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_up, 2); + } if (relax_coarse > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_coarse, 3); + } HYPRE_BoomerAMGSetChebyOrder(pcg_precond, cheby_order); HYPRE_BoomerAMGSetChebyFraction(pcg_precond, cheby_fraction); HYPRE_BoomerAMGSetRelaxOrder(pcg_precond, relax_order); HYPRE_BoomerAMGSetRelaxWt(pcg_precond, relax_wt); HYPRE_BoomerAMGSetOuterWt(pcg_precond, outer_wt); if (level_w > -1) - HYPRE_BoomerAMGSetLevelRelaxWt(pcg_precond, relax_wt_level,level_w); + { + HYPRE_BoomerAMGSetLevelRelaxWt(pcg_precond, relax_wt_level, level_w); + } if (level_ow > -1) - HYPRE_BoomerAMGSetLevelOuterWt(pcg_precond,outer_wt_level,level_ow); + { + HYPRE_BoomerAMGSetLevelOuterWt(pcg_precond, outer_wt_level, level_ow); + } HYPRE_BoomerAMGSetSmoothType(pcg_precond, smooth_type); HYPRE_BoomerAMGSetSmoothNumLevels(pcg_precond, smooth_num_levels); HYPRE_BoomerAMGSetSmoothNumSweeps(pcg_precond, smooth_num_sweeps); @@ -3329,13 +3509,15 @@ main( hypre_int argc, HYPRE_BoomerAMGSetDomainType(pcg_precond, domain_type); HYPRE_BoomerAMGSetSchwarzUseNonSymm(pcg_precond, use_nonsymm_schwarz); HYPRE_BoomerAMGSetSchwarzRlxWeight(pcg_precond, schwarz_rlx_weight); - if (eu_level < 0) eu_level = 0; + if (eu_level < 0) { eu_level = 0; } HYPRE_BoomerAMGSetEuLevel(pcg_precond, eu_level); HYPRE_BoomerAMGSetEuBJ(pcg_precond, eu_bj); HYPRE_BoomerAMGSetEuSparseA(pcg_precond, eu_sparse_A); HYPRE_BoomerAMGSetCycleNumSweeps(pcg_precond, ns_coarse, 3); if (num_functions > 1) + { HYPRE_BoomerAMGSetDofFunc(pcg_precond, dof_func); + } HYPRE_BoomerAMGSetAdditive(pcg_precond, additive); HYPRE_BoomerAMGSetMultAdditive(pcg_precond, mult_add); HYPRE_BoomerAMGSetSimple(pcg_precond, simple); @@ -3345,9 +3527,11 @@ main( hypre_int argc, HYPRE_BoomerAMGSetKeepTranspose(pcg_precond, keepTranspose); if (nongalerk_tol) { - HYPRE_BoomerAMGSetNonGalerkinTol(pcg_precond, nongalerk_tol[nongalerk_num_tol-1]); - for (i=0; i < nongalerk_num_tol-1; i++) + HYPRE_BoomerAMGSetNonGalerkinTol(pcg_precond, nongalerk_tol[nongalerk_num_tol - 1]); + for (i = 0; i < nongalerk_num_tol - 1; i++) + { HYPRE_BoomerAMGSetLevelNonGalerkinTol(pcg_precond, nongalerk_tol[i], i); + } } HYPRE_LGMRESSetMaxIter(pcg_solver, mg_max_iter); HYPRE_LGMRESSetPrecond(pcg_solver, @@ -3358,7 +3542,7 @@ main( hypre_int argc, else if (solver_id == 50) { /* use diagonal scaling as preconditioner */ - if (myid == 0) hypre_printf("Solver: DS-LGMRES\n"); + if (myid == 0) { hypre_printf("Solver: DS-LGMRES\n"); } pcg_precond = NULL; HYPRE_LGMRESSetPrecond(pcg_solver, @@ -3371,35 +3555,36 @@ main( hypre_int argc, if (pcg_precond_gotten != pcg_precond) { hypre_printf("HYPRE_LGMRESGetPrecond got bad precond\n"); - return(-1); + return (-1); + } + else if (myid == 0) + { + hypre_printf("HYPRE_LGMRESGetPrecond got good precond\n"); } - else - if (myid == 0) - hypre_printf("HYPRE_LGMRESGetPrecond got good precond\n"); HYPRE_LGMRESSetup - (pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, (HYPRE_Vector)x); - + (pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, (HYPRE_Vector)x); + hypre_EndTiming(time_index); hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); - + time_index = hypre_InitializeTiming("LGMRES Solve"); hypre_BeginTiming(time_index); - + HYPRE_LGMRESSolve - (pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, (HYPRE_Vector)x); - + (pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, (HYPRE_Vector)x); + hypre_EndTiming(time_index); hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); - + HYPRE_LGMRESGetNumIterations(pcg_solver, &num_iterations); - HYPRE_LGMRESGetFinalRelativeResidualNorm(pcg_solver,&final_res_norm); + HYPRE_LGMRESGetFinalRelativeResidualNorm(pcg_solver, &final_res_norm); HYPRE_ParCSRLGMRESDestroy(pcg_solver); - + if (solver_id == 51) { HYPRE_BoomerAMGDestroy(pcg_precond); @@ -3415,14 +3600,14 @@ main( hypre_int argc, } /*----------------------------------------------------------- - * Solve the system using FlexGMRES + * Solve the system using FlexGMRES *-----------------------------------------------------------*/ if (solver_id == 60 || solver_id == 61 ) { time_index = hypre_InitializeTiming("FlexGMRES Setup"); hypre_BeginTiming(time_index); - + HYPRE_ParCSRFlexGMRESCreate(hypre_MPI_COMM_WORLD, &pcg_solver); HYPRE_FlexGMRESSetKDim(pcg_solver, k_dim); HYPRE_FlexGMRESSetMaxIter(pcg_solver, max_iter); @@ -3430,13 +3615,13 @@ main( hypre_int argc, HYPRE_FlexGMRESSetAbsoluteTol(pcg_solver, atol); HYPRE_FlexGMRESSetLogging(pcg_solver, 1); HYPRE_FlexGMRESSetPrintLevel(pcg_solver, ioutdat); - + if (solver_id == 61) { /* use BoomerAMG as preconditioner */ - if (myid == 0) hypre_printf("Solver: AMG-FlexGMRES\n"); + if (myid == 0) { hypre_printf("Solver: AMG-FlexGMRES\n"); } - HYPRE_BoomerAMGCreate(&pcg_precond); + HYPRE_BoomerAMGCreate(&pcg_precond); HYPRE_BoomerAMGSetCGCIts(pcg_precond, cgcits); HYPRE_BoomerAMGSetInterpType(pcg_precond, interp_type); HYPRE_BoomerAMGSetPostInterpType(pcg_precond, post_interp_type); @@ -3465,20 +3650,30 @@ main( hypre_int argc, HYPRE_BoomerAMGSetCRUseCG(pcg_precond, CR_use_CG); HYPRE_BoomerAMGSetRelaxType(pcg_precond, relax_type); if (relax_down > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_down, 1); + } if (relax_up > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_up, 2); + } if (relax_coarse > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_coarse, 3); + } HYPRE_BoomerAMGSetChebyOrder(pcg_precond, cheby_order); HYPRE_BoomerAMGSetChebyFraction(pcg_precond, cheby_fraction); HYPRE_BoomerAMGSetRelaxOrder(pcg_precond, relax_order); HYPRE_BoomerAMGSetRelaxWt(pcg_precond, relax_wt); HYPRE_BoomerAMGSetOuterWt(pcg_precond, outer_wt); if (level_w > -1) - HYPRE_BoomerAMGSetLevelRelaxWt(pcg_precond, relax_wt_level,level_w); + { + HYPRE_BoomerAMGSetLevelRelaxWt(pcg_precond, relax_wt_level, level_w); + } if (level_ow > -1) - HYPRE_BoomerAMGSetLevelOuterWt(pcg_precond,outer_wt_level,level_ow); + { + HYPRE_BoomerAMGSetLevelOuterWt(pcg_precond, outer_wt_level, level_ow); + } HYPRE_BoomerAMGSetSmoothType(pcg_precond, smooth_type); HYPRE_BoomerAMGSetSmoothNumLevels(pcg_precond, smooth_num_levels); HYPRE_BoomerAMGSetSmoothNumSweeps(pcg_precond, smooth_num_sweeps); @@ -3499,13 +3694,15 @@ main( hypre_int argc, HYPRE_BoomerAMGSetDomainType(pcg_precond, domain_type); HYPRE_BoomerAMGSetSchwarzUseNonSymm(pcg_precond, use_nonsymm_schwarz); HYPRE_BoomerAMGSetSchwarzRlxWeight(pcg_precond, schwarz_rlx_weight); - if (eu_level < 0) eu_level = 0; + if (eu_level < 0) { eu_level = 0; } HYPRE_BoomerAMGSetEuLevel(pcg_precond, eu_level); HYPRE_BoomerAMGSetEuBJ(pcg_precond, eu_bj); HYPRE_BoomerAMGSetEuSparseA(pcg_precond, eu_sparse_A); HYPRE_BoomerAMGSetCycleNumSweeps(pcg_precond, ns_coarse, 3); if (num_functions > 1) + { HYPRE_BoomerAMGSetDofFunc(pcg_precond, dof_func); + } HYPRE_BoomerAMGSetAdditive(pcg_precond, additive); HYPRE_BoomerAMGSetMultAdditive(pcg_precond, mult_add); HYPRE_BoomerAMGSetSimple(pcg_precond, simple); @@ -3515,9 +3712,11 @@ main( hypre_int argc, HYPRE_BoomerAMGSetKeepTranspose(pcg_precond, keepTranspose); if (nongalerk_tol) { - HYPRE_BoomerAMGSetNonGalerkinTol(pcg_precond, nongalerk_tol[nongalerk_num_tol-1]); - for (i=0; i < nongalerk_num_tol-1; i++) + HYPRE_BoomerAMGSetNonGalerkinTol(pcg_precond, nongalerk_tol[nongalerk_num_tol - 1]); + for (i = 0; i < nongalerk_num_tol - 1; i++) + { HYPRE_BoomerAMGSetLevelNonGalerkinTol(pcg_precond, nongalerk_tol[i], i); + } } HYPRE_FlexGMRESSetMaxIter(pcg_solver, mg_max_iter); HYPRE_FlexGMRESSetPrecond(pcg_solver, @@ -3528,7 +3727,7 @@ main( hypre_int argc, else if (solver_id == 60) { /* use diagonal scaling as preconditioner */ - if (myid == 0) hypre_printf("Solver: DS-FlexGMRES\n"); + if (myid == 0) { hypre_printf("Solver: DS-FlexGMRES\n"); } pcg_precond = NULL; HYPRE_FlexGMRESSetPrecond(pcg_solver, @@ -3541,42 +3740,43 @@ main( hypre_int argc, if (pcg_precond_gotten != pcg_precond) { hypre_printf("HYPRE_FlexGMRESGetPrecond got bad precond\n"); - return(-1); + return (-1); + } + else if (myid == 0) + { + hypre_printf("HYPRE_FlexGMRESGetPrecond got good precond\n"); } - else - if (myid == 0) - hypre_printf("HYPRE_FlexGMRESGetPrecond got good precond\n"); /* this is optional - could be a user defined one instead (see ex5.c)*/ - HYPRE_FlexGMRESSetModifyPC( pcg_solver, + HYPRE_FlexGMRESSetModifyPC( pcg_solver, (HYPRE_PtrToModifyPCFcn) hypre_FlexGMRESModifyPCDefault); HYPRE_FlexGMRESSetup - (pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, (HYPRE_Vector)x); - + (pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, (HYPRE_Vector)x); + hypre_EndTiming(time_index); hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); - + time_index = hypre_InitializeTiming("FlexGMRES Solve"); hypre_BeginTiming(time_index); - + HYPRE_FlexGMRESSolve - (pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, (HYPRE_Vector)x); - + (pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, (HYPRE_Vector)x); + hypre_EndTiming(time_index); hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); - + HYPRE_FlexGMRESGetNumIterations(pcg_solver, &num_iterations); - HYPRE_FlexGMRESGetFinalRelativeResidualNorm(pcg_solver,&final_res_norm); + HYPRE_FlexGMRESGetFinalRelativeResidualNorm(pcg_solver, &final_res_norm); HYPRE_ParCSRFlexGMRESDestroy(pcg_solver); - + if (solver_id == 61) { HYPRE_BoomerAMGDestroy(pcg_precond); @@ -3592,26 +3792,26 @@ main( hypre_int argc, } /*----------------------------------------------------------- - * Solve the system using BiCGSTAB + * Solve the system using BiCGSTAB *-----------------------------------------------------------*/ if (solver_id == 9 || solver_id == 10 || solver_id == 11 || solver_id == 45) { time_index = hypre_InitializeTiming("BiCGSTAB Setup"); hypre_BeginTiming(time_index); - + HYPRE_ParCSRBiCGSTABCreate(hypre_MPI_COMM_WORLD, &pcg_solver); HYPRE_BiCGSTABSetMaxIter(pcg_solver, max_iter); HYPRE_BiCGSTABSetTol(pcg_solver, tol); HYPRE_BiCGSTABSetAbsoluteTol(pcg_solver, atol); HYPRE_BiCGSTABSetLogging(pcg_solver, ioutdat); HYPRE_BiCGSTABSetPrintLevel(pcg_solver, ioutdat); - + if (solver_id == 9) { /* use BoomerAMG as preconditioner */ - if (myid == 0) hypre_printf("Solver: AMG-BiCGSTAB\n"); - HYPRE_BoomerAMGCreate(&pcg_precond); + if (myid == 0) { hypre_printf("Solver: AMG-BiCGSTAB\n"); } + HYPRE_BoomerAMGCreate(&pcg_precond); HYPRE_BoomerAMGSetCGCIts(pcg_precond, cgcits); HYPRE_BoomerAMGSetInterpType(pcg_precond, interp_type); HYPRE_BoomerAMGSetPostInterpType(pcg_precond, post_interp_type); @@ -3640,20 +3840,30 @@ main( hypre_int argc, HYPRE_BoomerAMGSetCRUseCG(pcg_precond, CR_use_CG); HYPRE_BoomerAMGSetRelaxType(pcg_precond, relax_type); if (relax_down > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_down, 1); + } if (relax_up > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_up, 2); + } if (relax_coarse > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_coarse, 3); + } HYPRE_BoomerAMGSetChebyOrder(pcg_precond, cheby_order); HYPRE_BoomerAMGSetChebyFraction(pcg_precond, cheby_fraction); HYPRE_BoomerAMGSetRelaxOrder(pcg_precond, relax_order); HYPRE_BoomerAMGSetRelaxWt(pcg_precond, relax_wt); HYPRE_BoomerAMGSetOuterWt(pcg_precond, outer_wt); if (level_w > -1) - HYPRE_BoomerAMGSetLevelRelaxWt(pcg_precond, relax_wt_level,level_w); + { + HYPRE_BoomerAMGSetLevelRelaxWt(pcg_precond, relax_wt_level, level_w); + } if (level_ow > -1) - HYPRE_BoomerAMGSetLevelOuterWt(pcg_precond,outer_wt_level,level_ow); + { + HYPRE_BoomerAMGSetLevelOuterWt(pcg_precond, outer_wt_level, level_ow); + } HYPRE_BoomerAMGSetSmoothType(pcg_precond, smooth_type); HYPRE_BoomerAMGSetSmoothNumLevels(pcg_precond, smooth_num_levels); HYPRE_BoomerAMGSetSmoothNumSweeps(pcg_precond, smooth_num_sweeps); @@ -3673,15 +3883,17 @@ main( hypre_int argc, HYPRE_BoomerAMGSetOverlap(pcg_precond, overlap); HYPRE_BoomerAMGSetDomainType(pcg_precond, domain_type); HYPRE_BoomerAMGSetSchwarzUseNonSymm(pcg_precond, use_nonsymm_schwarz); - + HYPRE_BoomerAMGSetSchwarzRlxWeight(pcg_precond, schwarz_rlx_weight); - if (eu_level < 0) eu_level = 0; + if (eu_level < 0) { eu_level = 0; } HYPRE_BoomerAMGSetEuLevel(pcg_precond, eu_level); HYPRE_BoomerAMGSetEuBJ(pcg_precond, eu_bj); HYPRE_BoomerAMGSetEuSparseA(pcg_precond, eu_sparse_A); HYPRE_BoomerAMGSetCycleNumSweeps(pcg_precond, ns_coarse, 3); if (num_functions > 1) + { HYPRE_BoomerAMGSetDofFunc(pcg_precond, dof_func); + } HYPRE_BoomerAMGSetAdditive(pcg_precond, additive); HYPRE_BoomerAMGSetMultAdditive(pcg_precond, mult_add); HYPRE_BoomerAMGSetSimple(pcg_precond, simple); @@ -3691,9 +3903,11 @@ main( hypre_int argc, HYPRE_BoomerAMGSetKeepTranspose(pcg_precond, keepTranspose); if (nongalerk_tol) { - HYPRE_BoomerAMGSetNonGalerkinTol(pcg_precond, nongalerk_tol[nongalerk_num_tol-1]); - for (i=0; i < nongalerk_num_tol-1; i++) + HYPRE_BoomerAMGSetNonGalerkinTol(pcg_precond, nongalerk_tol[nongalerk_num_tol - 1]); + for (i = 0; i < nongalerk_num_tol - 1; i++) + { HYPRE_BoomerAMGSetLevelNonGalerkinTol(pcg_precond, nongalerk_tol[i], i); + } } HYPRE_BiCGSTABSetMaxIter(pcg_solver, mg_max_iter); HYPRE_BiCGSTABSetPrecond(pcg_solver, @@ -3704,7 +3918,7 @@ main( hypre_int argc, else if (solver_id == 10) { /* use diagonal scaling as preconditioner */ - if (myid == 0) hypre_printf("Solver: DS-BiCGSTAB\n"); + if (myid == 0) { hypre_printf("Solver: DS-BiCGSTAB\n"); } pcg_precond = NULL; HYPRE_BiCGSTABSetPrecond(pcg_solver, @@ -3715,10 +3929,11 @@ main( hypre_int argc, else if (solver_id == 11) { /* use PILUT as preconditioner */ - if (myid == 0) hypre_printf("Solver: PILUT-BiCGSTAB\n"); + if (myid == 0) { hypre_printf("Solver: PILUT-BiCGSTAB\n"); } - ierr = HYPRE_ParCSRPilutCreate( hypre_MPI_COMM_WORLD, &pcg_precond ); - if (ierr) { + ierr = HYPRE_ParCSRPilutCreate( hypre_MPI_COMM_WORLD, &pcg_precond ); + if (ierr) + { hypre_printf("Error in ParPilutCreate\n"); } @@ -3738,20 +3953,20 @@ main( hypre_int argc, else if (solver_id == 45) { /* use Euclid preconditioning */ - if (myid == 0) hypre_printf("Solver: Euclid-BICGSTAB\n"); + if (myid == 0) { hypre_printf("Solver: Euclid-BICGSTAB\n"); } HYPRE_EuclidCreate(hypre_MPI_COMM_WORLD, &pcg_precond); - /* note: There are three three methods of setting run-time + /* note: There are three three methods of setting run-time parameters for Euclid: (see HYPRE_parcsr_ls.h); here - we'll use what I think is simplest: let Euclid internally + we'll use what I think is simplest: let Euclid internally parse the command line. - */ - if (eu_level > -1) HYPRE_EuclidSetLevel(pcg_precond, eu_level); - if (eu_ilut) HYPRE_EuclidSetILUT(pcg_precond, eu_ilut); - if (eu_sparse_A) HYPRE_EuclidSetSparseA(pcg_precond, eu_sparse_A); - if (eu_row_scale) HYPRE_EuclidSetRowScale(pcg_precond, eu_row_scale); - if (eu_bj) HYPRE_EuclidSetBJ(pcg_precond, eu_bj); + */ + if (eu_level > -1) { HYPRE_EuclidSetLevel(pcg_precond, eu_level); } + if (eu_ilut) { HYPRE_EuclidSetILUT(pcg_precond, eu_ilut); } + if (eu_sparse_A) { HYPRE_EuclidSetSparseA(pcg_precond, eu_sparse_A); } + if (eu_row_scale) { HYPRE_EuclidSetRowScale(pcg_precond, eu_row_scale); } + if (eu_bj) { HYPRE_EuclidSetBJ(pcg_precond, eu_bj); } HYPRE_EuclidSetStats(pcg_precond, eu_stats); HYPRE_EuclidSetMem(pcg_precond, eu_mem); @@ -3762,39 +3977,39 @@ main( hypre_int argc, (HYPRE_PtrToSolverFcn) HYPRE_EuclidSetup, pcg_precond); } - - HYPRE_BiCGSTABSetup(pcg_solver, (HYPRE_Matrix)parcsr_A, + + HYPRE_BiCGSTABSetup(pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, (HYPRE_Vector)x); - + hypre_EndTiming(time_index); hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); - + time_index = hypre_InitializeTiming("BiCGSTAB Solve"); hypre_BeginTiming(time_index); - - HYPRE_BiCGSTABSolve(pcg_solver, (HYPRE_Matrix)parcsr_A, + + HYPRE_BiCGSTABSolve(pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, (HYPRE_Vector)x); - + hypre_EndTiming(time_index); hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); - + HYPRE_BiCGSTABGetNumIterations(pcg_solver, &num_iterations); - HYPRE_BiCGSTABGetFinalRelativeResidualNorm(pcg_solver,&final_res_norm); + HYPRE_BiCGSTABGetFinalRelativeResidualNorm(pcg_solver, &final_res_norm); #if SECOND_TIME /* run a second time to check for memory leaks */ HYPRE_ParVectorSetRandomValues(x, 775); - HYPRE_BiCGSTABSetup(pcg_solver, (HYPRE_Matrix)parcsr_A, + HYPRE_BiCGSTABSetup(pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, (HYPRE_Vector)x); - HYPRE_BiCGSTABSolve(pcg_solver, (HYPRE_Matrix)parcsr_A, + HYPRE_BiCGSTABSolve(pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, (HYPRE_Vector)x); #endif HYPRE_ParCSRBiCGSTABDestroy(pcg_solver); - + if (solver_id == 9) { HYPRE_BoomerAMGDestroy(pcg_precond); @@ -3818,24 +4033,24 @@ main( hypre_int argc, } } /*----------------------------------------------------------- - * Solve the system using CGNR + * Solve the system using CGNR *-----------------------------------------------------------*/ if (solver_id == 5 || solver_id == 6) { time_index = hypre_InitializeTiming("CGNR Setup"); hypre_BeginTiming(time_index); - + HYPRE_ParCSRCGNRCreate(hypre_MPI_COMM_WORLD, &pcg_solver); HYPRE_CGNRSetMaxIter(pcg_solver, max_iter); HYPRE_CGNRSetTol(pcg_solver, tol); HYPRE_CGNRSetLogging(pcg_solver, ioutdat); - + if (solver_id == 5) { /* use BoomerAMG as preconditioner */ - if (myid == 0) hypre_printf("Solver: AMG-CGNR\n"); - HYPRE_BoomerAMGCreate(&pcg_precond); + if (myid == 0) { hypre_printf("Solver: AMG-CGNR\n"); } + HYPRE_BoomerAMGCreate(&pcg_precond); HYPRE_BoomerAMGSetCGCIts(pcg_precond, cgcits); HYPRE_BoomerAMGSetInterpType(pcg_precond, interp_type); HYPRE_BoomerAMGSetPostInterpType(pcg_precond, post_interp_type); @@ -3859,20 +4074,30 @@ main( hypre_int argc, HYPRE_BoomerAMGSetNumSweeps(pcg_precond, num_sweeps); HYPRE_BoomerAMGSetRelaxType(pcg_precond, relax_type); if (relax_down > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_down, 1); + } if (relax_up > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_up, 2); + } if (relax_coarse > -1) + { HYPRE_BoomerAMGSetCycleRelaxType(pcg_precond, relax_coarse, 3); + } HYPRE_BoomerAMGSetChebyOrder(pcg_precond, cheby_order); HYPRE_BoomerAMGSetChebyFraction(pcg_precond, cheby_fraction); HYPRE_BoomerAMGSetRelaxOrder(pcg_precond, relax_order); HYPRE_BoomerAMGSetRelaxWt(pcg_precond, relax_wt); HYPRE_BoomerAMGSetOuterWt(pcg_precond, outer_wt); if (level_w > -1) - HYPRE_BoomerAMGSetLevelRelaxWt(pcg_precond, relax_wt_level,level_w); + { + HYPRE_BoomerAMGSetLevelRelaxWt(pcg_precond, relax_wt_level, level_w); + } if (level_ow > -1) - HYPRE_BoomerAMGSetLevelOuterWt(pcg_precond,outer_wt_level,level_ow); + { + HYPRE_BoomerAMGSetLevelOuterWt(pcg_precond, outer_wt_level, level_ow); + } HYPRE_BoomerAMGSetSmoothType(pcg_precond, smooth_type); HYPRE_BoomerAMGSetSmoothNumLevels(pcg_precond, smooth_num_levels); HYPRE_BoomerAMGSetSmoothNumSweeps(pcg_precond, smooth_num_sweeps); @@ -3892,7 +4117,9 @@ main( hypre_int argc, HYPRE_BoomerAMGSetOverlap(pcg_precond, overlap); HYPRE_BoomerAMGSetDomainType(pcg_precond, domain_type); if (num_functions > 1) + { HYPRE_BoomerAMGSetDofFunc(pcg_precond, dof_func); + } HYPRE_BoomerAMGSetAdditive(pcg_precond, additive); HYPRE_BoomerAMGSetMultAdditive(pcg_precond, mult_add); HYPRE_BoomerAMGSetSimple(pcg_precond, simple); @@ -3902,9 +4129,11 @@ main( hypre_int argc, HYPRE_BoomerAMGSetKeepTranspose(pcg_precond, keepTranspose); if (nongalerk_tol) { - HYPRE_BoomerAMGSetNonGalerkinTol(pcg_precond, nongalerk_tol[nongalerk_num_tol-1]); - for (i=0; i < nongalerk_num_tol-1; i++) + HYPRE_BoomerAMGSetNonGalerkinTol(pcg_precond, nongalerk_tol[nongalerk_num_tol - 1]); + for (i = 0; i < nongalerk_num_tol - 1; i++) + { HYPRE_BoomerAMGSetLevelNonGalerkinTol(pcg_precond, nongalerk_tol[i], i); + } } HYPRE_CGNRSetMaxIter(pcg_solver, mg_max_iter); HYPRE_CGNRSetPrecond(pcg_solver, @@ -3916,7 +4145,7 @@ main( hypre_int argc, else if (solver_id == 6) { /* use diagonal scaling as preconditioner */ - if (myid == 0) hypre_printf("Solver: DS-CGNR\n"); + if (myid == 0) { hypre_printf("Solver: DS-CGNR\n"); } pcg_precond = NULL; HYPRE_CGNRSetPrecond(pcg_solver, @@ -3925,49 +4154,50 @@ main( hypre_int argc, (HYPRE_PtrToSolverFcn) HYPRE_ParCSRDiagScaleSetup, pcg_precond); } - + HYPRE_CGNRGetPrecond(pcg_solver, &pcg_precond_gotten); if (pcg_precond_gotten != pcg_precond) { hypre_printf("HYPRE_ParCSRCGNRGetPrecond got bad precond\n"); - return(-1); + return (-1); } - else - if (myid == 0) - hypre_printf("HYPRE_ParCSRCGNRGetPrecond got good precond\n"); - HYPRE_CGNRSetup(pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, + else if (myid == 0) + { + hypre_printf("HYPRE_ParCSRCGNRGetPrecond got good precond\n"); + } + HYPRE_CGNRSetup(pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, (HYPRE_Vector)x); - + hypre_EndTiming(time_index); hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); - + time_index = hypre_InitializeTiming("CGNR Solve"); hypre_BeginTiming(time_index); - - HYPRE_CGNRSolve(pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, + + HYPRE_CGNRSolve(pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, (HYPRE_Vector)x); - + hypre_EndTiming(time_index); hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); - + HYPRE_CGNRGetNumIterations(pcg_solver, &num_iterations); - HYPRE_CGNRGetFinalRelativeResidualNorm(pcg_solver,&final_res_norm); + HYPRE_CGNRGetFinalRelativeResidualNorm(pcg_solver, &final_res_norm); #if SECOND_TIME /* run a second time to check for memory leaks */ HYPRE_ParVectorSetRandomValues(x, 775); - HYPRE_CGNRSetup(pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, + HYPRE_CGNRSetup(pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, (HYPRE_Vector)x); - HYPRE_CGNRSolve(pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, + HYPRE_CGNRSolve(pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, (HYPRE_Vector)x); #endif HYPRE_ParCSRCGNRDestroy(pcg_solver); - + if (solver_id == 5) { HYPRE_BoomerAMGDestroy(pcg_precond); @@ -3986,8 +4216,10 @@ main( hypre_int argc, *-----------------------------------------------------------*/ /* RDF: Why is this here? */ - if (!(build_rhs_type ==1 || build_rhs_type ==7)) + if (!(build_rhs_type == 1 || build_rhs_type == 7)) + { HYPRE_IJVectorGetObjectType(ij_b, &j); + } if (print_system) { @@ -3998,25 +4230,31 @@ main( hypre_int argc, * Finalize things *-----------------------------------------------------------*/ - if (test_ij || build_matrix_type == -1) HYPRE_IJMatrixDestroy(ij_A); - else HYPRE_ParCSRMatrixDestroy(parcsr_A); + if (test_ij || build_matrix_type == -1) { HYPRE_IJMatrixDestroy(ij_A); } + else { HYPRE_ParCSRMatrixDestroy(parcsr_A); } /* for build_rhs_type = 1 or 7, we did not create ij_b - just b*/ - if (build_rhs_type ==1 || build_rhs_type ==7) + if (build_rhs_type == 1 || build_rhs_type == 7) + { HYPRE_ParVectorDestroy(b); + } else + { HYPRE_IJVectorDestroy(ij_b); + } HYPRE_IJVectorDestroy(ij_x); - if (build_rbm) + if (build_rbm) { - for (i=0; i< num_interp_vecs; i++) + for (i = 0; i < num_interp_vecs; i++) + { HYPRE_IJVectorDestroy(ij_rbm[i]); + } hypre_TFree(ij_rbm, HYPRE_MEMORY_HOST); hypre_TFree(interp_vecs, HYPRE_MEMORY_HOST); } - if (nongalerk_tol) hypre_TFree(nongalerk_tol, HYPRE_MEMORY_HOST); + if (nongalerk_tol) { hypre_TFree(nongalerk_tol, HYPRE_MEMORY_HOST); } hypre_MPI_Finalize(); @@ -4067,17 +4305,17 @@ BuildParFromFile( HYPRE_Int argc, /*----------------------------------------------------------- * Print driver parameters *-----------------------------------------------------------*/ - + if (myid == 0) { hypre_printf(" FromFile: %s\n", filename); } /*----------------------------------------------------------- - * Generate the matrix + * Generate the matrix *-----------------------------------------------------------*/ - - HYPRE_ParCSRMatrixRead(hypre_MPI_COMM_WORLD, filename,&A); + + HYPRE_ParCSRMatrixRead(hypre_MPI_COMM_WORLD, filename, &A); *A_ptr = A; @@ -4127,17 +4365,17 @@ BuildParRhsFromFile( HYPRE_Int argc, /*----------------------------------------------------------- * Print driver parameters *-----------------------------------------------------------*/ - + if (myid == 0) { hypre_printf(" RhsFromParFile: %s\n", filename); } /*----------------------------------------------------------- - * Generate the matrix + * Generate the matrix *-----------------------------------------------------------*/ - - HYPRE_ParVectorRead(hypre_MPI_COMM_WORLD, filename,&b); + + HYPRE_ParVectorRead(hypre_MPI_COMM_WORLD, filename, &b); *b_ptr = b; @@ -4171,12 +4409,12 @@ BuildParLaplacian( HYPRE_Int argc, HYPRE_Real *mtrx; HYPRE_Real ep = .1; - + HYPRE_Int system_vcoef = 0; HYPRE_Int sys_opt = 0; HYPRE_Int vcoef_opt = 0; - - + + /*----------------------------------------------------------- * Initialize some stuff *-----------------------------------------------------------*/ @@ -4187,7 +4425,7 @@ BuildParLaplacian( HYPRE_Int argc, /*----------------------------------------------------------- * Set defaults *-----------------------------------------------------------*/ - + nx = 10; ny = 10; nz = 10; @@ -4223,9 +4461,9 @@ BuildParLaplacian( HYPRE_Int argc, else if ( strcmp(argv[arg_index], "-c") == 0 ) { arg_index++; - cx = atof(argv[arg_index++]); - cy = atof(argv[arg_index++]); - cz = atof(argv[arg_index++]); + cx = (HYPRE_Real)atof(argv[arg_index++]); + cy = (HYPRE_Real)atof(argv[arg_index++]); + cz = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-sysL") == 0 ) { @@ -4246,12 +4484,12 @@ BuildParLaplacian( HYPRE_Int argc, else if ( strcmp(argv[arg_index], "-sys_vcoef_opt") == 0 ) { arg_index++; - vcoef_opt = atoi(argv[arg_index++]); + vcoef_opt = atoi(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-ep") == 0 ) { arg_index++; - ep = atof(argv[arg_index++]); + ep = (HYPRE_Real)atof(argv[arg_index++]); } else { @@ -4263,7 +4501,7 @@ BuildParLaplacian( HYPRE_Int argc, * Check a few things *-----------------------------------------------------------*/ - if ((P*Q*R) != num_procs) + if ((P * Q * R) != num_procs) { hypre_printf("Error: Invalid number of processors or processor topology \n"); exit(1); @@ -4272,7 +4510,7 @@ BuildParLaplacian( HYPRE_Int argc, /*----------------------------------------------------------- * Print driver parameters *-----------------------------------------------------------*/ - + if (myid == 0) { hypre_printf(" Laplacian: num_fun = %d\n", num_fun); @@ -4287,13 +4525,13 @@ BuildParLaplacian( HYPRE_Int argc, /* compute p,q,r from P,Q,R and myid */ p = myid % P; - q = (( myid - p)/P) % Q; - r = ( myid - p - P*q)/( P*Q ); + q = (( myid - p) / P) % Q; + r = ( myid - p - P * q) / ( P * Q ); /*----------------------------------------------------------- - * Generate the matrix + * Generate the matrix *-----------------------------------------------------------*/ - + values = hypre_CTAlloc(HYPRE_Real, 4, HYPRE_MEMORY_HOST); values[1] = -cx; @@ -4303,67 +4541,67 @@ BuildParLaplacian( HYPRE_Int argc, values[0] = 0.; if (nx > 1) { - values[0] += 2.0*cx; + values[0] += 2.0 * cx; } if (ny > 1) { - values[0] += 2.0*cy; + values[0] += 2.0 * cy; } if (nz > 1) { - values[0] += 2.0*cz; + values[0] += 2.0 * cz; } if (num_fun == 1) - A = (HYPRE_ParCSRMatrix) GenerateLaplacian(hypre_MPI_COMM_WORLD, + A = (HYPRE_ParCSRMatrix) GenerateLaplacian(hypre_MPI_COMM_WORLD, nx, ny, nz, P, Q, R, p, q, r, values); else { - mtrx = hypre_CTAlloc(HYPRE_Real, num_fun*num_fun, HYPRE_MEMORY_HOST); + mtrx = hypre_CTAlloc(HYPRE_Real, num_fun * num_fun, HYPRE_MEMORY_HOST); if (num_fun == 2) { - if (sys_opt ==1) /* identity */ + if (sys_opt == 1) /* identity */ { mtrx[0] = 1.0; - mtrx[1] = 0.0; + mtrx[1] = 0.0; mtrx[2] = 0.0; - mtrx[3] = 1.0; + mtrx[3] = 1.0; } - else if (sys_opt ==2) + else if (sys_opt == 2) { mtrx[0] = 1.0; - mtrx[1] = 0.0; + mtrx[1] = 0.0; mtrx[2] = 0.0; - mtrx[3] = 20.0; + mtrx[3] = 20.0; } - else if (sys_opt ==3) /* similar to barry's talk - ex1 */ + else if (sys_opt == 3) /* similar to barry's talk - ex1 */ { mtrx[0] = 1.0; - mtrx[1] = 2.0; + mtrx[1] = 2.0; mtrx[2] = 2.0; - mtrx[3] = 1.0; + mtrx[3] = 1.0; } - else if (sys_opt ==4) /* can use with vcoef to get barry's ex*/ + else if (sys_opt == 4) /* can use with vcoef to get barry's ex*/ { mtrx[0] = 1.0; - mtrx[1] = 1.0; + mtrx[1] = 1.0; mtrx[2] = 1.0; - mtrx[3] = 1.0; + mtrx[3] = 1.0; } - else if (sys_opt ==5) /* barry's talk - ex1 */ + else if (sys_opt == 5) /* barry's talk - ex1 */ { mtrx[0] = 1.0; - mtrx[1] = 1.1; + mtrx[1] = 1.1; mtrx[2] = 1.1; - mtrx[3] = 1.0; + mtrx[3] = 1.0; } - else if (sys_opt ==6) /* */ + else if (sys_opt == 6) /* */ { mtrx[0] = 1.1; - mtrx[1] = 1.0; + mtrx[1] = 1.0; mtrx[2] = 1.0; - mtrx[3] = 1.1; + mtrx[3] = 1.1; } else /* == 0 */ @@ -4376,7 +4614,7 @@ BuildParLaplacian( HYPRE_Int argc, } else if (num_fun == 3) { - if (sys_opt ==1) + if (sys_opt == 1) { mtrx[0] = 1.0; mtrx[1] = 0.0; @@ -4388,7 +4626,7 @@ BuildParLaplacian( HYPRE_Int argc, mtrx[7] = 0.0; mtrx[8] = 1.0; } - else if (sys_opt ==2) + else if (sys_opt == 2) { mtrx[0] = 1.0; mtrx[1] = 0.0; @@ -4398,9 +4636,9 @@ BuildParLaplacian( HYPRE_Int argc, mtrx[5] = 0.0; mtrx[6] = 0.0; mtrx[7] = 0.0; - mtrx[8] =.01; + mtrx[8] = .01; } - else if (sys_opt ==3) + else if (sys_opt == 3) { mtrx[0] = 1.01; mtrx[1] = 1; @@ -4410,9 +4648,9 @@ BuildParLaplacian( HYPRE_Int argc, mtrx[5] = 1; mtrx[6] = 0.0; mtrx[7] = 1; - mtrx[8] = 1.01; + mtrx[8] = 1.01; } - else if (sys_opt ==4) /* barry ex4 */ + else if (sys_opt == 4) /* barry ex4 */ { mtrx[0] = 3; mtrx[1] = 1; @@ -4422,7 +4660,7 @@ BuildParLaplacian( HYPRE_Int argc, mtrx[5] = 2; mtrx[6] = 0.0; mtrx[7] = 2; - mtrx[8] = .25; + mtrx[8] = .25; } else /* == 0 */ { @@ -4437,7 +4675,7 @@ BuildParLaplacian( HYPRE_Int argc, mtrx[8] = 2.0; } - } + } else if (num_fun == 4) { mtrx[0] = 1.01; @@ -4456,24 +4694,24 @@ BuildParLaplacian( HYPRE_Int argc, mtrx[13] = 1; mtrx[14] = 0.0; mtrx[15] = 1; - } + } if (!system_vcoef) { - A = (HYPRE_ParCSRMatrix) GenerateSysLaplacian(hypre_MPI_COMM_WORLD, - nx, ny, nz, P, Q, + A = (HYPRE_ParCSRMatrix) GenerateSysLaplacian(hypre_MPI_COMM_WORLD, + nx, ny, nz, P, Q, R, p, q, r, num_fun, mtrx, values); } else { - - + + HYPRE_Real *mtrx_values; - mtrx_values = hypre_CTAlloc(HYPRE_Real, num_fun*num_fun*4, HYPRE_MEMORY_HOST); + mtrx_values = hypre_CTAlloc(HYPRE_Real, num_fun * num_fun * 4, HYPRE_MEMORY_HOST); if (num_fun == 2) { @@ -4482,93 +4720,93 @@ BuildParLaplacian( HYPRE_Int argc, /* Barry's talk * - must also have sys_opt = 4, all fail */ mtrx[0] = 1.0; SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, .10, 1.0, 0, mtrx_values); - + mtrx[1] = 1.0; SetSysVcoefValues(num_fun, nx, ny, nz, .1, 1.0, 1.0, 1, mtrx_values); - + mtrx[2] = 1.0; SetSysVcoefValues(num_fun, nx, ny, nz, .01, 1.0, 1.0, 2, mtrx_values); - + mtrx[3] = 1.0; SetSysVcoefValues(num_fun, nx, ny, nz, 2.0, .02, 1.0, 3, mtrx_values); - + } else if (vcoef_opt == 2) { /* Barry's talk * - ex2 - if have sys-opt = 4*/ mtrx[0] = 1.0; SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, .010, 1.0, 0, mtrx_values); - + mtrx[1] = 200.0; SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, 1.0, 1.0, 1, mtrx_values); mtrx[2] = 200.0; SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, 1.0, 1.0, 2, mtrx_values); - + mtrx[3] = 1.0; SetSysVcoefValues(num_fun, nx, ny, nz, 2.0, .02, 1.0, 3, mtrx_values); - + } else if (vcoef_opt == 3) /* use with default sys_opt - ulrike ex 3*/ { - + /* mtrx[0] */ - SetSysVcoefValues(num_fun, nx, ny, nz, ep*1.0, 1.0, 1.0, 0, mtrx_values); - + SetSysVcoefValues(num_fun, nx, ny, nz, ep * 1.0, 1.0, 1.0, 0, mtrx_values); + /* mtrx[1] */ SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, 1.0, 1.0, 1, mtrx_values); - + /* mtrx[2] */ - SetSysVcoefValues(num_fun, nx, ny, nz, ep*1.0, 1.0, 1.0, 2, mtrx_values); - + SetSysVcoefValues(num_fun, nx, ny, nz, ep * 1.0, 1.0, 1.0, 2, mtrx_values); + /* mtrx[3] */ SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, 1.0, 1.0, 3, mtrx_values); } else if (vcoef_opt == 4) /* use with default sys_opt - ulrike ex 4*/ { HYPRE_Real ep2 = ep; - + /* mtrx[0] */ - SetSysVcoefValues(num_fun, nx, ny, nz, ep*1.0, 1.0, 1.0, 0, mtrx_values); - + SetSysVcoefValues(num_fun, nx, ny, nz, ep * 1.0, 1.0, 1.0, 0, mtrx_values); + /* mtrx[1] */ - SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, ep*1.0, 1.0, 1, mtrx_values); - + SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, ep * 1.0, 1.0, 1, mtrx_values); + /* mtrx[2] */ - SetSysVcoefValues(num_fun, nx, ny, nz, ep*1.0, 1.0, 1.0, 2, mtrx_values); - + SetSysVcoefValues(num_fun, nx, ny, nz, ep * 1.0, 1.0, 1.0, 2, mtrx_values); + /* mtrx[3] */ - SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, ep2*1.0, 1.0, 3, mtrx_values); + SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, ep2 * 1.0, 1.0, 3, mtrx_values); } else if (vcoef_opt == 5) /* use with default sys_opt - */ { HYPRE_Real alp, beta; alp = .001; beta = 10; - + /* mtrx[0] */ - SetSysVcoefValues(num_fun, nx, ny, nz, alp*1.0, 1.0, 1.0, 0, mtrx_values); - + SetSysVcoefValues(num_fun, nx, ny, nz, alp * 1.0, 1.0, 1.0, 0, mtrx_values); + /* mtrx[1] */ - SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, beta*1.0, 1.0, 1, mtrx_values); - + SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, beta * 1.0, 1.0, 1, mtrx_values); + /* mtrx[2] */ - SetSysVcoefValues(num_fun, nx, ny, nz, alp*1.0, 1.0, 1.0, 2, mtrx_values); - + SetSysVcoefValues(num_fun, nx, ny, nz, alp * 1.0, 1.0, 1.0, 2, mtrx_values); + /* mtrx[3] */ - SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, beta*1.0, 1.0, 3, mtrx_values); + SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, beta * 1.0, 1.0, 3, mtrx_values); } else /* = 0 */ { /* mtrx[0] */ SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, 1.0, 1.0, 0, mtrx_values); - + /* mtrx[1] */ SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, 2.0, 1.0, 1, mtrx_values); - + /* mtrx[2] */ SetSysVcoefValues(num_fun, nx, ny, nz, 2.0, 1.0, 0.0, 2, mtrx_values); - + /* mtrx[3] */ SetSysVcoefValues(num_fun, nx, ny, nz, 1.0, 3.0, 1.0, 3, mtrx_values); } @@ -4605,8 +4843,8 @@ BuildParLaplacian( HYPRE_Int argc, } - A = (HYPRE_ParCSRMatrix) GenerateSysLaplacianVCoef(hypre_MPI_COMM_WORLD, - nx, ny, nz, P, Q, + A = (HYPRE_ParCSRMatrix) GenerateSysLaplacianVCoef(hypre_MPI_COMM_WORLD, + nx, ny, nz, P, Q, R, p, q, r, num_fun, mtrx, mtrx_values); @@ -4627,7 +4865,7 @@ BuildParLaplacian( HYPRE_Int argc, } /*---------------------------------------------------------------------- - * Build standard 7-point convection-diffusion operator + * Build standard 7-point convection-diffusion operator * Parameters given in command line. * Operator: * @@ -4645,7 +4883,7 @@ BuildParDifConv( HYPRE_Int argc, HYPRE_Int P, Q, R; HYPRE_Real cx, cy, cz; HYPRE_Real ax, ay, az; - HYPRE_Real hinx,hiny,hinz; + HYPRE_Real hinx, hiny, hinz; HYPRE_ParCSRMatrix A; @@ -4663,7 +4901,7 @@ BuildParDifConv( HYPRE_Int argc, /*----------------------------------------------------------- * Set defaults *-----------------------------------------------------------*/ - + nx = 10; ny = 10; nz = 10; @@ -4703,16 +4941,16 @@ BuildParDifConv( HYPRE_Int argc, else if ( strcmp(argv[arg_index], "-c") == 0 ) { arg_index++; - cx = atof(argv[arg_index++]); - cy = atof(argv[arg_index++]); - cz = atof(argv[arg_index++]); + cx = (HYPRE_Real)atof(argv[arg_index++]); + cy = (HYPRE_Real)atof(argv[arg_index++]); + cz = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-a") == 0 ) { arg_index++; - ax = atof(argv[arg_index++]); - ay = atof(argv[arg_index++]); - az = atof(argv[arg_index++]); + ax = (HYPRE_Real)atof(argv[arg_index++]); + ay = (HYPRE_Real)atof(argv[arg_index++]); + az = (HYPRE_Real)atof(argv[arg_index++]); } else { @@ -4724,7 +4962,7 @@ BuildParDifConv( HYPRE_Int argc, * Check a few things *-----------------------------------------------------------*/ - if ((P*Q*R) != num_procs) + if ((P * Q * R) != num_procs) { hypre_printf("Error: Invalid number of processors or processor topology \n"); exit(1); @@ -4733,11 +4971,11 @@ BuildParDifConv( HYPRE_Int argc, /*----------------------------------------------------------- * Print driver parameters *-----------------------------------------------------------*/ - + if (myid == 0) { hypre_printf(" Convection-Diffusion: \n"); - hypre_printf(" -cx Dxx - cy Dyy - cz Dzz + ax Dx + ay Dy + az Dz = f\n"); + hypre_printf(" -cx Dxx - cy Dyy - cz Dzz + ax Dx + ay Dy + az Dz = f\n"); hypre_printf(" (nx, ny, nz) = (%d, %d, %d)\n", nx, ny, nz); hypre_printf(" (Px, Py, Pz) = (%d, %d, %d)\n", P, Q, R); hypre_printf(" (cx, cy, cz) = (%f, %f, %f)\n", cx, cy, cz); @@ -4750,38 +4988,38 @@ BuildParDifConv( HYPRE_Int argc, /* compute p,q,r from P,Q,R and myid */ p = myid % P; - q = (( myid - p)/P) % Q; - r = ( myid - p - P*q)/( P*Q ); + q = (( myid - p) / P) % Q; + r = ( myid - p - P * q) / ( P * Q ); - hinx = 1./(nx+1); - hiny = 1./(ny+1); - hinz = 1./(nz+1); + hinx = 1. / (nx + 1); + hiny = 1. / (ny + 1); + hinz = 1. / (nz + 1); /*----------------------------------------------------------- - * Generate the matrix + * Generate the matrix *-----------------------------------------------------------*/ - + values = hypre_CTAlloc(HYPRE_Real, 7, HYPRE_MEMORY_HOST); - values[1] = -cx/(hinx*hinx); - values[2] = -cy/(hiny*hiny); - values[3] = -cz/(hinz*hinz); - values[4] = -cx/(hinx*hinx) + ax/hinx; - values[5] = -cy/(hiny*hiny) + ay/hiny; - values[6] = -cz/(hinz*hinz) + az/hinz; + values[1] = -cx / (hinx * hinx); + values[2] = -cy / (hiny * hiny); + values[3] = -cz / (hinz * hinz); + values[4] = -cx / (hinx * hinx) + ax / hinx; + values[5] = -cy / (hiny * hiny) + ay / hiny; + values[6] = -cz / (hinz * hinz) + az / hinz; values[0] = 0.; if (nx > 1) { - values[0] += 2.0*cx/(hinx*hinx) - 1.*ax/hinx; + values[0] += 2.0 * cx / (hinx * hinx) - 1.*ax / hinx; } if (ny > 1) { - values[0] += 2.0*cy/(hiny*hiny) - 1.*ay/hiny; + values[0] += 2.0 * cy / (hiny * hiny) - 1.*ay / hiny; } if (nz > 1) { - values[0] += 2.0*cz/(hinz*hinz) - 1.*az/hinz; + values[0] += 2.0 * cz / (hinz * hinz) - 1.*az / hinz; } A = (HYPRE_ParCSRMatrix) GenerateDifConv(hypre_MPI_COMM_WORLD, @@ -4815,8 +5053,8 @@ BuildParFromOneFile( HYPRE_Int argc, HYPRE_Int myid, numprocs; HYPRE_Int i, rest, size, num_nodes, num_dofs; - HYPRE_Int *row_part; - HYPRE_Int *col_part; + HYPRE_Int *row_part; + HYPRE_Int *col_part; /*----------------------------------------------------------- * Initialize some stuff @@ -4842,15 +5080,15 @@ BuildParFromOneFile( HYPRE_Int argc, /*----------------------------------------------------------- * Print driver parameters *-----------------------------------------------------------*/ - + if (myid == 0) { hypre_printf(" FromFile: %s\n", filename); /*----------------------------------------------------------- - * Generate the matrix + * Generate the matrix *-----------------------------------------------------------*/ - + A_CSR = HYPRE_CSRMatrixRead(filename); } @@ -4859,22 +5097,22 @@ BuildParFromOneFile( HYPRE_Int argc, if (myid == 0 && num_functions > 1) { HYPRE_CSRMatrixGetNumRows(A_CSR, &num_dofs); - num_nodes = num_dofs/num_functions; - if (num_dofs != num_functions*num_nodes) + num_nodes = num_dofs / num_functions; + if (num_dofs != num_functions * num_nodes) { - row_part = NULL; - col_part = NULL; + row_part = NULL; + col_part = NULL; } else { - row_part = hypre_CTAlloc(HYPRE_Int, numprocs+1, HYPRE_MEMORY_HOST); - row_part[0] = 0; - size = num_nodes/numprocs; - rest = num_nodes-size*numprocs; - for (i=0; i < numprocs; i++) - { - row_part[i+1] = row_part[i]+size*num_functions; - if (i < rest) row_part[i+1] += num_functions; + row_part = hypre_CTAlloc(HYPRE_Int, numprocs + 1, HYPRE_MEMORY_HOST); + row_part[0] = 0; + size = num_nodes / numprocs; + rest = num_nodes - size * numprocs; + for (i = 0; i < numprocs; i++) + { + row_part[i + 1] = row_part[i] + size * num_functions; + if (i < rest) { row_part[i + 1] += num_functions; } } col_part = row_part; } @@ -4884,7 +5122,7 @@ BuildParFromOneFile( HYPRE_Int argc, *A_ptr = A; - if (myid == 0) HYPRE_CSRMatrixDestroy(A_CSR); + if (myid == 0) { HYPRE_CSRMatrixDestroy(A_CSR); } return (0); } @@ -4900,12 +5138,12 @@ BuildFuncsFromFiles( HYPRE_Int argc, HYPRE_ParCSRMatrix parcsr_A, HYPRE_Int **dof_func_ptr ) { -/*---------------------------------------------------------------------- - * Build Function array from files on different processors - *----------------------------------------------------------------------*/ + /*---------------------------------------------------------------------- + * Build Function array from files on different processors + *----------------------------------------------------------------------*/ - hypre_printf (" Feature is not implemented yet!\n"); - return(0); + hypre_printf (" Feature is not implemented yet!\n"); + return (0); } @@ -4925,9 +5163,9 @@ BuildFuncsFromOneFile( HYPRE_Int argc, HYPRE_Int *dof_func_local; HYPRE_Int i, j; HYPRE_Int local_size, global_size; - hypre_MPI_Request *requests; - hypre_MPI_Status *status, status0; - MPI_Comm comm; + hypre_MPI_Request *requests; + hypre_MPI_Status *status, status0; + MPI_Comm comm; /*----------------------------------------------------------- * Initialize some stuff @@ -4954,7 +5192,7 @@ BuildFuncsFromOneFile( HYPRE_Int argc, /*----------------------------------------------------------- * Print driver parameters *-----------------------------------------------------------*/ - + if (myid == 0) { FILE *fp; @@ -4974,41 +5212,43 @@ BuildFuncsFromOneFile( HYPRE_Int argc, } fclose(fp); - + } HYPRE_ParCSRMatrixGetRowPartitioning(parcsr_A, &partitioning); - local_size = partitioning[myid+1]-partitioning[myid]; + local_size = partitioning[myid + 1] - partitioning[myid]; dof_func_local = hypre_CTAlloc(HYPRE_Int, local_size, HYPRE_MEMORY_HOST); if (myid == 0) { - requests = hypre_CTAlloc(hypre_MPI_Request, num_procs-1, HYPRE_MEMORY_HOST); - status = hypre_CTAlloc(hypre_MPI_Status, num_procs-1, HYPRE_MEMORY_HOST); + requests = hypre_CTAlloc(hypre_MPI_Request, num_procs - 1, HYPRE_MEMORY_HOST); + status = hypre_CTAlloc(hypre_MPI_Status, num_procs - 1, HYPRE_MEMORY_HOST); j = 0; - for (i=1; i < num_procs; i++) + for (i = 1; i < num_procs; i++) hypre_MPI_Isend(&dof_func[partitioning[i]], - partitioning[i+1]-partitioning[i], + partitioning[i + 1] - partitioning[i], HYPRE_MPI_INT, i, 0, comm, &requests[j++]); - for (i=0; i < local_size; i++) + for (i = 0; i < local_size; i++) + { dof_func_local[i] = dof_func[i]; - hypre_MPI_Waitall(num_procs-1,requests, status); + } + hypre_MPI_Waitall(num_procs - 1, requests, status); hypre_TFree(requests, HYPRE_MEMORY_HOST); hypre_TFree(status, HYPRE_MEMORY_HOST); } else { - hypre_MPI_Recv(dof_func_local,local_size,HYPRE_MPI_INT,0,0,comm,&status0); + hypre_MPI_Recv(dof_func_local, local_size, HYPRE_MPI_INT, 0, 0, comm, &status0); } *dof_func_ptr = dof_func_local; - if (myid == 0) hypre_TFree(dof_func, HYPRE_MEMORY_HOST); + if (myid == 0) { hypre_TFree(dof_func, HYPRE_MEMORY_HOST); } return (0); } /*---------------------------------------------------------------------- - * Build Rhs from one file on Proc. 0. Distributes vector across processors + * Build Rhs from one file on Proc. 0. Distributes vector across processors * giving each about using the distribution of the matrix A. *----------------------------------------------------------------------*/ @@ -5022,7 +5262,7 @@ BuildRhsParFromOneFile( HYPRE_Int argc, char *filename; HYPRE_ParVector b; - HYPRE_Vector b_CSR=NULL; + HYPRE_Vector b_CSR = NULL; HYPRE_Int myid; @@ -5049,18 +5289,18 @@ BuildRhsParFromOneFile( HYPRE_Int argc, /*----------------------------------------------------------- * Print driver parameters *-----------------------------------------------------------*/ - + if (myid == 0) { hypre_printf(" Rhs FromFile: %s\n", filename); /*----------------------------------------------------------- - * Generate the matrix + * Generate the matrix *-----------------------------------------------------------*/ - + b_CSR = HYPRE_VectorRead(filename); } - HYPRE_VectorToParVector(hypre_MPI_COMM_WORLD, b_CSR, partitioning,&b); + HYPRE_VectorToParVector(hypre_MPI_COMM_WORLD, b_CSR, partitioning, &b); *b_ptr = b; @@ -5099,7 +5339,7 @@ BuildParLaplacian9pt( HYPRE_Int argc, /*----------------------------------------------------------- * Set defaults *-----------------------------------------------------------*/ - + nx = 10; ny = 10; @@ -5134,7 +5374,7 @@ BuildParLaplacian9pt( HYPRE_Int argc, * Check a few things *-----------------------------------------------------------*/ - if ((P*Q) != num_procs) + if ((P * Q) != num_procs) { hypre_printf("Error: Invalid number of processors or processor topology \n"); exit(1); @@ -5143,7 +5383,7 @@ BuildParLaplacian9pt( HYPRE_Int argc, /*----------------------------------------------------------- * Print driver parameters *-----------------------------------------------------------*/ - + if (myid == 0) { hypre_printf(" Laplacian 9pt:\n"); @@ -5157,12 +5397,12 @@ BuildParLaplacian9pt( HYPRE_Int argc, /* compute p,q from P,Q and myid */ p = myid % P; - q = ( myid - p)/P; + q = ( myid - p) / P; /*----------------------------------------------------------- - * Generate the matrix + * Generate the matrix *-----------------------------------------------------------*/ - + values = hypre_CTAlloc(HYPRE_Real, 2, HYPRE_MEMORY_HOST); values[1] = -1.; @@ -5220,7 +5460,7 @@ BuildParLaplacian27pt( HYPRE_Int argc, /*----------------------------------------------------------- * Set defaults *-----------------------------------------------------------*/ - + nx = 10; ny = 10; nz = 10; @@ -5259,7 +5499,7 @@ BuildParLaplacian27pt( HYPRE_Int argc, * Check a few things *-----------------------------------------------------------*/ - if ((P*Q*R) != num_procs) + if ((P * Q * R) != num_procs) { hypre_printf("Error: Invalid number of processors or processor topology \n"); exit(1); @@ -5268,7 +5508,7 @@ BuildParLaplacian27pt( HYPRE_Int argc, /*----------------------------------------------------------- * Print driver parameters *-----------------------------------------------------------*/ - + if (myid == 0) { hypre_printf(" Laplacian_27pt:\n"); @@ -5282,20 +5522,24 @@ BuildParLaplacian27pt( HYPRE_Int argc, /* compute p,q,r from P,Q,R and myid */ p = myid % P; - q = (( myid - p)/P) % Q; - r = ( myid - p - P*q)/( P*Q ); + q = (( myid - p) / P) % Q; + r = ( myid - p - P * q) / ( P * Q ); /*----------------------------------------------------------- - * Generate the matrix + * Generate the matrix *-----------------------------------------------------------*/ - + values = hypre_CTAlloc(HYPRE_Real, 2, HYPRE_MEMORY_HOST); values[0] = 26.0; if (nx == 1 || ny == 1 || nz == 1) + { values[0] = 8.0; - if (nx*ny == 1 || nx*nz == 1 || ny*nz == 1) + } + if (nx * ny == 1 || nx * nz == 1 || ny * nz == 1) + { values[0] = 2.0; + } values[1] = -1.; A = (HYPRE_ParCSRMatrix) GenerateLaplacian27pt(hypre_MPI_COMM_WORLD, @@ -5310,7 +5554,7 @@ BuildParLaplacian27pt( HYPRE_Int argc, /*---------------------------------------------------------------------- - * Build 7-point in 2D + * Build 7-point in 2D * Parameters given in command line. *----------------------------------------------------------------------*/ @@ -5367,12 +5611,12 @@ BuildParRotate7pt( HYPRE_Int argc, else if ( strcmp(argv[arg_index], "-alpha") == 0 ) { arg_index++; - alpha = atof(argv[arg_index++]); + alpha = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-eps") == 0 ) { arg_index++; - eps = atof(argv[arg_index++]); + eps = (HYPRE_Real)atof(argv[arg_index++]); } else { @@ -5384,7 +5628,7 @@ BuildParRotate7pt( HYPRE_Int argc, * Check a few things *-----------------------------------------------------------*/ - if ((P*Q) != num_procs) + if ((P * Q) != num_procs) { hypre_printf("Error: Invalid number of processors or processor topology \n"); exit(1); @@ -5397,7 +5641,7 @@ BuildParRotate7pt( HYPRE_Int argc, if (myid == 0) { hypre_printf(" Rotate 7pt:\n"); - hypre_printf(" alpha = %f, eps = %f\n", alpha,eps); + hypre_printf(" alpha = %f, eps = %f\n", alpha, eps); hypre_printf(" (nx, ny) = (%d, %d)\n", nx, ny); hypre_printf(" (Px, Py) = (%d, %d)\n", P, Q); } @@ -5408,10 +5652,10 @@ BuildParRotate7pt( HYPRE_Int argc, /* compute p,q from P,Q and myid */ p = myid % P; - q = ( myid - p)/P; + q = ( myid - p) / P; /*----------------------------------------------------------- - * Generate the matrix + * Generate the matrix *-----------------------------------------------------------*/ A = (HYPRE_ParCSRMatrix) GenerateRotate7pt(hypre_MPI_COMM_WORLD, @@ -5425,7 +5669,7 @@ BuildParRotate7pt( HYPRE_Int argc, /*---------------------------------------------------------------------- * Build standard 7-point difference operator using centered differences * - * eps*(a(x,y,z) ux)x + (b(x,y,z) uy)y + (c(x,y,z) uz)z + * eps*(a(x,y,z) ux)x + (b(x,y,z) uy)y + (c(x,y,z) uz)z * d(x,y,z) ux + e(x,y,z) uy + f(x,y,z) uz + g(x,y,z) u * * functions a,b,c,d,e,f,g need to be defined inside par_vardifconv.c @@ -5436,7 +5680,7 @@ HYPRE_Int BuildParVarDifConv( HYPRE_Int argc, char *argv[], HYPRE_Int arg_index, - HYPRE_ParCSRMatrix *A_ptr , + HYPRE_ParCSRMatrix *A_ptr, HYPRE_ParVector *rhs_ptr ) { HYPRE_Int nx, ny, nz; @@ -5490,7 +5734,7 @@ BuildParVarDifConv( HYPRE_Int argc, else if ( strcmp(argv[arg_index], "-eps") == 0 ) { arg_index++; - eps = atof(argv[arg_index++]); + eps = (HYPRE_Real)atof(argv[arg_index++]); } else { @@ -5502,7 +5746,7 @@ BuildParVarDifConv( HYPRE_Int argc, * Check a few things *-----------------------------------------------------------*/ - if ((P*Q*R) != num_procs) + if ((P * Q * R) != num_procs) { hypre_printf("Error: Invalid number of processors or processor topology \n"); exit(1); @@ -5525,8 +5769,8 @@ BuildParVarDifConv( HYPRE_Int argc, /* compute p,q,r from P,Q,R and myid */ p = myid % P; - q = (( myid - p)/P) % Q; - r = ( myid - p - P*q)/( P*Q ); + q = (( myid - p) / P) % Q; + r = ( myid - p - P * q) / ( P * Q ); /*----------------------------------------------------------- * Generate the matrix @@ -5544,39 +5788,40 @@ BuildParVarDifConv( HYPRE_Int argc, /**************************************************************************/ -HYPRE_Int SetSysVcoefValues(HYPRE_Int num_fun, HYPRE_Int nx, HYPRE_Int ny, HYPRE_Int nz, HYPRE_Real vcx, +HYPRE_Int SetSysVcoefValues(HYPRE_Int num_fun, HYPRE_Int nx, HYPRE_Int ny, HYPRE_Int nz, + HYPRE_Real vcx, HYPRE_Real vcy, HYPRE_Real vcz, HYPRE_Int mtx_entry, HYPRE_Real *values) { - HYPRE_Int sz = num_fun*num_fun; + HYPRE_Int sz = num_fun * num_fun; - values[1*sz + mtx_entry] = -vcx; - values[2*sz + mtx_entry] = -vcy; - values[3*sz + mtx_entry] = -vcz; - values[0*sz + mtx_entry] = 0.0; + values[1 * sz + mtx_entry] = -vcx; + values[2 * sz + mtx_entry] = -vcy; + values[3 * sz + mtx_entry] = -vcz; + values[0 * sz + mtx_entry] = 0.0; if (nx > 1) { - values[0*sz + mtx_entry] += 2.0*vcx; + values[0 * sz + mtx_entry] += 2.0 * vcx; } if (ny > 1) { - values[0*sz + mtx_entry] += 2.0*vcy; + values[0 * sz + mtx_entry] += 2.0 * vcy; } if (nz > 1) { - values[0*sz + mtx_entry] += 2.0*vcz; + values[0 * sz + mtx_entry] += 2.0 * vcz; } return 0; - + } - + /*---------------------------------------------------------------------- * Build coordinates for 1D/2D/3D *----------------------------------------------------------------------*/ - + HYPRE_Int BuildParCoordinates( HYPRE_Int argc, char *argv[], @@ -5586,32 +5831,32 @@ BuildParCoordinates( HYPRE_Int argc, { HYPRE_Int nx, ny, nz; HYPRE_Int P, Q, R; - + HYPRE_Int num_procs, myid; HYPRE_Int p, q, r; - + HYPRE_Int coorddim; float *coordinates; - + /*----------------------------------------------------------- * Initialize some stuff *-----------------------------------------------------------*/ - + hypre_MPI_Comm_size(hypre_MPI_COMM_WORLD, &num_procs ); hypre_MPI_Comm_rank(hypre_MPI_COMM_WORLD, &myid ); - + /*----------------------------------------------------------- * Set defaults *-----------------------------------------------------------*/ - + nx = 10; ny = 10; nz = 10; - + P = 1; Q = num_procs; R = 1; - + /*----------------------------------------------------------- * Parse command line *-----------------------------------------------------------*/ @@ -5637,31 +5882,32 @@ BuildParCoordinates( HYPRE_Int argc, arg_index++; } } - + /* compute p,q,r from P,Q,R and myid */ p = myid % P; - q = (( myid - p)/P) % Q; - r = ( myid - p - P*q)/( P*Q ); - + q = (( myid - p) / P) % Q; + r = ( myid - p - P * q) / ( P * Q ); + /*----------------------------------------------------------- * Generate the coordinates *-----------------------------------------------------------*/ - + coorddim = 3; - if (nx<2) coorddim--; - if (ny<2) coorddim--; - if (nz<2) coorddim--; - - if (coorddim>0) - coordinates = GenerateCoordinates (hypre_MPI_COMM_WORLD, - nx, ny, nz, P, Q, R, p, q, r, coorddim); + if (nx < 2) { coorddim--; } + if (ny < 2) { coorddim--; } + if (nz < 2) { coorddim--; } + + if (coorddim > 0) + { + coordinates = hypre_GenerateCoordinates(hypre_MPI_COMM_WORLD, + nx, ny, nz, P, Q, R, p, q, r, coorddim); + } else - coordinates=NULL; - + { + coordinates = NULL; + } + *coorddim_ptr = coorddim; *coord_ptr = coordinates; return (0); } - - - diff --git a/external/hypre/src/test/runcheck.sh b/external/hypre/src/test/runcheck.sh old mode 100644 new mode 100755 index f8ef362b..e08a2cc4 --- a/external/hypre/src/test/runcheck.sh +++ b/external/hypre/src/test/runcheck.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/runtest.sh b/external/hypre/src/test/runtest.sh old mode 100644 new mode 100755 index 31efb61d..37a3d393 --- a/external/hypre/src/test/runtest.sh +++ b/external/hypre/src/test/runtest.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -19,10 +19,13 @@ TestDirNames="" # string of names of TEST_* directories used HOST=`hostname` NumThreads=0 # number of OpenMP threads to use if > 0 Valgrind="" # string to add to MpirunString when using valgrind +cudamemcheck="" # string to add to MpirunString when using cudamemcheck mpibind="" # string to add to MpirunString when using mpibind +script="" # string to add to MpirunString when using script SaveExt="saved" # saved file extension RTOL=0 ATOL=0 +RTOL_PERF=0.15 function usage { @@ -40,7 +43,9 @@ function usage printf " -atol use absolute tolerance 'tol' to compare numeric test values\n" printf " -save use '.saved. for the saved-file extension\n" printf " -valgrind use valgrind memory checker\n" + printf " -cudamemcheck use CUDA memory checker\n" printf " -mpibind use mpibind\n" + printf " -script use a script before the command\n" printf " -n|-norun turn off execute mode, echo what would be run\n" printf " -t|-trace echo each command\n" printf " -D define when running tests\n" @@ -69,6 +74,8 @@ function usage # generate default command based on the first 4 characters of the platform name function MpirunString { + NumArgs1=$# + case $HOST in *bgl*) BatchMode=1 @@ -94,40 +101,38 @@ function MpirunString # RunString="${RunString} -nodes $POE_NUM_NODES $MY_ARGS" RunString="poe $MY_ARGS -rmpool pdebug -procs $POE_NUM_PROCS -nodes $POE_NUM_NODES" ;; - rztopaz*|aztec*|cab*|quartz*|sierra*|syrah*|vulcan*) + rzhound*|aztec*|cab*|quartz*|sierra*|syrah*|vulcan*) shift if [ $NumThreads -gt 0 ] ; then export OMP_NUM_THREADS=$NumThreads - RunString="srun -p pdebug -c $NumThreads -n$*" + RunString="srun -p pdebug -c $NumThreads -n$1" else - RunString="srun -p pdebug -n$*" + RunString="srun -p pdebug -n$1" fi ;; surface*) shift - RunString="srun -n$*" + RunString="srun -n$1" ;; pascal*) shift - RunString="srun -n$*" + RunString="srun -n$1" ;; rzansel*) shift - RunString="lrun -T$*" + RunString="lrun -T$1" ;; - ray*) + lassen*) shift - #RunString="mpirun -n $*" - RunString="lrun -n$*" + RunString="lrun -n$1" ;; - lassen*) + tioga*) shift - #RunString="mpirun -n $*" - RunString="lrun -n$*" + RunString="srun -n$1" ;; - redwood*) + node*) shift - RunString="srun -n$*" + RunString="srun -n$1" ;; *) shift @@ -135,10 +140,15 @@ function MpirunString export OMP_NUM_THREADS=$NumThreads fi RunString="$RunPrefix $1" - shift - RunString="$RunString $mpibind $Valgrind $*" ;; esac + + NumArgs2=$(($#+1)) + if [ "$NumArgs1" -eq "$NumArgs2" ] ; then + shift + RunString="$RunString $script $mpibind $cudamemcheck $Valgrind $*" + #echo $RunString + fi } # determine the "number of nodes" desired by dividing the "number of processes" @@ -306,8 +316,8 @@ function ExecuteJobs ;; *mpirun*) - RunCmd=`echo $InputLine| sed -e 's/^[ \t]*mpirun[ \t]*//'` # remove 'mpirun' - RunCmd=`echo $RunCmd | sed -e 's/[ \t]*>.*$//'` # remove output redirect + RunCmd=`echo $InputLine| sed -e 's/^[[:space:]]*mpirun[[:space:]]*//'` # remove 'mpirun' + RunCmd=`echo $RunCmd | sed -e 's/[[:space:]]*>.*$//'` # remove output redirect OutFile=`echo $InputLine | sed -e 's/^.*>//'` # set output file OutFile=`echo $OutFile | sed -e 's/ //g'` # remove extra space ErrFile=`echo $OutFile | sed -e 's/\.out\./.err./'` # set error file @@ -405,6 +415,14 @@ function ExecuteTest # diff -U3 -bI"time" ${TestName}.saved ${TestName}.out # old way of diffing (../runcheck.sh $TestName.out $SaveName $RTOL $ATOL >> $TestName.err 2>&1) fi + # check performance + PerfTestName=$TestName.perf.out + PerfSaveName=$TestName.perf.$SaveExt + if [ -f $PerfTestName ]; then + if [ -f $PerfSaveName ]; then + (../runcheck.sh $PerfTestName $PerfSaveName $RTOL_PERF >> $TestName.err 2>&1) + fi + fi fi cd $SavePWD } @@ -504,12 +522,21 @@ do ;; -valgrind) shift - Valgrind="valgrind -q --suppressions=`pwd`/runtest.valgrind --leak-check=yes --track-origins=yes" + Valgrind="valgrind -q --suppressions=`pwd`/runtest.valgrind --track-origins=yes --leak-check=full --show-leak-kinds=all" + ;; + -cudamemcheck) + shift + cudamemcheck="cuda-memcheck --leak-check full" ;; -mpibind) shift mpibind="mpibind" ;; + -script) + shift + script=$1 + shift + ;; -n|-norun) NoRun=1 RunEcho="echo" @@ -579,7 +606,10 @@ CleanUp $TestDirNames $ExecFileNames # Filter misleading error messages cat > runtest.filters < memory_location; + /*----------------------------------------------------------- * Read data file from process 0, then broadcast *-----------------------------------------------------------*/ @@ -442,7 +445,7 @@ ReadData( char *filename, sdata = hypre_TAlloc(char, memchunk, HYPRE_MEMORY_HOST); sdata_line = fgets(sdata, maxline, file); - s= 0; + s = 0; while (sdata_line != NULL) { sdata_size += strlen(sdata_line) + 1; @@ -451,12 +454,15 @@ ReadData( char *filename, if ((sdata_size + maxline) > s) { sdata = hypre_TReAlloc(sdata, char, (sdata_size + memchunk), HYPRE_MEMORY_HOST); - s= sdata_size + memchunk; + s = sdata_size + memchunk; } /* read the next input line */ sdata_line = fgets((sdata + sdata_size), maxline, file); } + + /* Close file handle */ + fclose(file); } /* broadcast the data size */ hypre_MPI_Bcast(&sdata_size, 1, HYPRE_MPI_INT, 0, hypre_MPI_COMM_WORLD); @@ -469,6 +475,7 @@ ReadData( char *filename, * Parse the data and fill ProblemData structure *-----------------------------------------------------------*/ + data.memory_location = memory_location; data.max_boxsize = 0; data.numghost = NULL; data.nstencils = 0; @@ -505,8 +512,8 @@ ReadData( char *filename, { // # GridSetNumGhost: numghost[2*ndim] // GridSetNumGhost: [3 3 3 3] - data.numghost = hypre_CTAlloc(HYPRE_Int, 2*data.ndim, HYPRE_MEMORY_HOST); - SScanIntArray(sdata_ptr, &sdata_ptr, 2*data.ndim, data.numghost); + data.numghost = hypre_CTAlloc(HYPRE_Int, 2 * data.ndim, HYPRE_MEMORY_HOST); + SScanIntArray(sdata_ptr, &sdata_ptr, 2 * data.ndim, data.numghost); } else if ( strcmp(key, "GridSetExtents:") == 0 ) { @@ -531,8 +538,8 @@ ReadData( char *filename, iu = 1; for (i = 0; i < data.ndim; i++) { - il *= pdata.ilowers[pdata.nboxes][i+3]; - iu *= pdata.iuppers[pdata.nboxes][i+3]; + il *= pdata.ilowers[pdata.nboxes][i + 3]; + iu *= pdata.iuppers[pdata.nboxes][i + 3]; } if ( (il != 0) || (iu != 1) ) { @@ -696,7 +703,7 @@ ReadData( char *filename, data.stencil_offsets[s][entry][i] = 0; } data.stencil_vars[s][entry] = strtol(sdata_ptr, &sdata_ptr, 10); - data.stencil_values[s][entry] = strtod(sdata_ptr, &sdata_ptr); + data.stencil_values[s][entry] = (HYPRE_Real)strtod(sdata_ptr, &sdata_ptr); } else if ( strcmp(key, "RhsSet:") == 0 ) { @@ -704,7 +711,7 @@ ReadData( char *filename, { data.rhs_true = 1; } - data.rhs_value = strtod(sdata_ptr, &sdata_ptr); + data.rhs_value = (HYPRE_Real)strtod(sdata_ptr, &sdata_ptr); } else if ( strcmp(key, "FEMStencilCreate:") == 0 ) { @@ -741,7 +748,7 @@ ReadData( char *filename, { data.fem_rhs_true = 1; data.fem_rhs_values = hypre_CTAlloc(HYPRE_Real, data.fem_nvars, HYPRE_MEMORY_HOST); - data.d_fem_rhs_values = hypre_CTAlloc(HYPRE_Real, data.fem_nvars, HYPRE_MEMORY_DEVICE); + data.d_fem_rhs_values = hypre_CTAlloc(HYPRE_Real, data.fem_nvars, memory_location); } SScanDblArray(sdata_ptr, &sdata_ptr, data.fem_nvars, data.fem_rhs_values); @@ -794,7 +801,7 @@ ReadData( char *filename, hypre_TReAlloc(pdata.graph_values, HYPRE_Real, size, HYPRE_MEMORY_HOST); pdata.d_graph_values = hypre_TReAlloc_v2(pdata.d_graph_values, HYPRE_Real, pdata.graph_values_size, - HYPRE_Real, size, HYPRE_MEMORY_DEVICE); + HYPRE_Real, size, memory_location); pdata.graph_values_size = size; pdata.graph_boxsizes = hypre_TReAlloc(pdata.graph_boxsizes, HYPRE_Int, size, HYPRE_MEMORY_HOST); @@ -843,7 +850,7 @@ ReadData( char *filename, pdata.graph_entries[pdata.graph_nboxes] = strtol(sdata_ptr, &sdata_ptr, 10); pdata.graph_values[pdata.graph_nboxes] = - strtod(sdata_ptr, &sdata_ptr); + (HYPRE_Real)strtod(sdata_ptr, &sdata_ptr); pdata.graph_boxsizes[pdata.graph_nboxes] = 1; for (i = 0; i < 3; i++) { @@ -917,7 +924,7 @@ ReadData( char *filename, pdata.matset_entries[pdata.matset_nboxes] = strtol(sdata_ptr, &sdata_ptr, 10); pdata.matset_values[pdata.matset_nboxes] = - strtod(sdata_ptr, &sdata_ptr); + (HYPRE_Real)strtod(sdata_ptr, &sdata_ptr); pdata.matset_nboxes++; data.pdata[part] = pdata; } @@ -925,30 +932,30 @@ ReadData( char *filename, { part = strtol(sdata_ptr, &sdata_ptr, 10); pdata = data.pdata[part]; - if ((pdata.matadd_nboxes% 10) == 0) + if ((pdata.matadd_nboxes % 10) == 0) { - size = pdata.matadd_nboxes+10; - pdata.matadd_ilowers= + size = pdata.matadd_nboxes + 10; + pdata.matadd_ilowers = hypre_TReAlloc(pdata.matadd_ilowers, ProblemIndex, size, HYPRE_MEMORY_HOST); - pdata.matadd_iuppers= + pdata.matadd_iuppers = hypre_TReAlloc(pdata.matadd_iuppers, ProblemIndex, size, HYPRE_MEMORY_HOST); - pdata.matadd_vars= + pdata.matadd_vars = hypre_TReAlloc(pdata.matadd_vars, HYPRE_Int, size, HYPRE_MEMORY_HOST); - pdata.matadd_nentries= + pdata.matadd_nentries = hypre_TReAlloc(pdata.matadd_nentries, HYPRE_Int, size, HYPRE_MEMORY_HOST); - pdata.matadd_entries= + pdata.matadd_entries = hypre_TReAlloc(pdata.matadd_entries, HYPRE_Int *, size, HYPRE_MEMORY_HOST); - pdata.matadd_values= + pdata.matadd_values = hypre_TReAlloc(pdata.matadd_values, HYPRE_Real *, size, HYPRE_MEMORY_HOST); } SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, pdata.matadd_ilowers[pdata.matadd_nboxes]); SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, pdata.matadd_iuppers[pdata.matadd_nboxes]); - pdata.matadd_vars[pdata.matadd_nboxes]= + pdata.matadd_vars[pdata.matadd_nboxes] = strtol(sdata_ptr, &sdata_ptr, 10); - i= strtol(sdata_ptr, &sdata_ptr, 10); - pdata.matadd_nentries[pdata.matadd_nboxes]= i; + i = strtol(sdata_ptr, &sdata_ptr, 10); + pdata.matadd_nentries[pdata.matadd_nboxes] = i; pdata.matadd_entries[pdata.matadd_nboxes] = hypre_TAlloc(HYPRE_Int, i, HYPRE_MEMORY_HOST); SScanIntArray(sdata_ptr, &sdata_ptr, i, @@ -964,41 +971,41 @@ ReadData( char *filename, { part = strtol(sdata_ptr, &sdata_ptr, 10); pdata = data.pdata[part]; - if ((pdata.fem_matadd_nboxes% 10) == 0) + if ((pdata.fem_matadd_nboxes % 10) == 0) { - size = pdata.fem_matadd_nboxes+10; - pdata.fem_matadd_ilowers= + size = pdata.fem_matadd_nboxes + 10; + pdata.fem_matadd_ilowers = hypre_TReAlloc(pdata.fem_matadd_ilowers, ProblemIndex, size, HYPRE_MEMORY_HOST); - pdata.fem_matadd_iuppers= + pdata.fem_matadd_iuppers = hypre_TReAlloc(pdata.fem_matadd_iuppers, ProblemIndex, size, HYPRE_MEMORY_HOST); - pdata.fem_matadd_nrows= + pdata.fem_matadd_nrows = hypre_TReAlloc(pdata.fem_matadd_nrows, HYPRE_Int, size, HYPRE_MEMORY_HOST); - pdata.fem_matadd_rows= + pdata.fem_matadd_rows = hypre_TReAlloc(pdata.fem_matadd_rows, HYPRE_Int *, size, HYPRE_MEMORY_HOST); - pdata.fem_matadd_ncols= + pdata.fem_matadd_ncols = hypre_TReAlloc(pdata.fem_matadd_ncols, HYPRE_Int, size, HYPRE_MEMORY_HOST); - pdata.fem_matadd_cols= + pdata.fem_matadd_cols = hypre_TReAlloc(pdata.fem_matadd_cols, HYPRE_Int *, size, HYPRE_MEMORY_HOST); - pdata.fem_matadd_values= + pdata.fem_matadd_values = hypre_TReAlloc(pdata.fem_matadd_values, HYPRE_Real *, size, HYPRE_MEMORY_HOST); } SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, pdata.fem_matadd_ilowers[pdata.fem_matadd_nboxes]); SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, pdata.fem_matadd_iuppers[pdata.fem_matadd_nboxes]); - i= strtol(sdata_ptr, &sdata_ptr, 10); - pdata.fem_matadd_nrows[pdata.fem_matadd_nboxes]= i; + i = strtol(sdata_ptr, &sdata_ptr, 10); + pdata.fem_matadd_nrows[pdata.fem_matadd_nboxes] = i; pdata.fem_matadd_rows[pdata.fem_matadd_nboxes] = hypre_TAlloc(HYPRE_Int, i, HYPRE_MEMORY_HOST); SScanIntArray(sdata_ptr, &sdata_ptr, i, (HYPRE_Int*) pdata.fem_matadd_rows[pdata.fem_matadd_nboxes]); - j= strtol(sdata_ptr, &sdata_ptr, 10); - pdata.fem_matadd_ncols[pdata.fem_matadd_nboxes]= j; + j = strtol(sdata_ptr, &sdata_ptr, 10); + pdata.fem_matadd_ncols[pdata.fem_matadd_nboxes] = j; pdata.fem_matadd_cols[pdata.fem_matadd_nboxes] = hypre_TAlloc(HYPRE_Int, j, HYPRE_MEMORY_HOST); SScanIntArray(sdata_ptr, &sdata_ptr, j, (HYPRE_Int*) pdata.fem_matadd_cols[pdata.fem_matadd_nboxes]); pdata.fem_matadd_values[pdata.fem_matadd_nboxes] = - hypre_TAlloc(HYPRE_Real, i*j, HYPRE_MEMORY_HOST); - SScanDblArray(sdata_ptr, &sdata_ptr, i*j, + hypre_TAlloc(HYPRE_Real, i * j, HYPRE_MEMORY_HOST); + SScanDblArray(sdata_ptr, &sdata_ptr, i * j, (HYPRE_Real *) pdata.fem_matadd_values[pdata.fem_matadd_nboxes]); pdata.fem_matadd_nboxes++; data.pdata[part] = pdata; @@ -1007,26 +1014,26 @@ ReadData( char *filename, { part = strtol(sdata_ptr, &sdata_ptr, 10); pdata = data.pdata[part]; - if ((pdata.rhsadd_nboxes% 10) == 0) + if ((pdata.rhsadd_nboxes % 10) == 0) { - size = pdata.rhsadd_nboxes+10; - pdata.rhsadd_ilowers= + size = pdata.rhsadd_nboxes + 10; + pdata.rhsadd_ilowers = hypre_TReAlloc(pdata.rhsadd_ilowers, ProblemIndex, size, HYPRE_MEMORY_HOST); - pdata.rhsadd_iuppers= + pdata.rhsadd_iuppers = hypre_TReAlloc(pdata.rhsadd_iuppers, ProblemIndex, size, HYPRE_MEMORY_HOST); - pdata.rhsadd_vars= + pdata.rhsadd_vars = hypre_TReAlloc(pdata.rhsadd_vars, HYPRE_Int, size, HYPRE_MEMORY_HOST); - pdata.rhsadd_values= + pdata.rhsadd_values = hypre_TReAlloc(pdata.rhsadd_values, HYPRE_Real, size, HYPRE_MEMORY_HOST); } SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, pdata.rhsadd_ilowers[pdata.rhsadd_nboxes]); SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, pdata.rhsadd_iuppers[pdata.rhsadd_nboxes]); - pdata.rhsadd_vars[pdata.rhsadd_nboxes]= + pdata.rhsadd_vars[pdata.rhsadd_nboxes] = strtol(sdata_ptr, &sdata_ptr, 10); pdata.rhsadd_values[pdata.rhsadd_nboxes] = - strtod(sdata_ptr, &sdata_ptr); + (HYPRE_Real)strtod(sdata_ptr, &sdata_ptr); pdata.rhsadd_nboxes++; data.pdata[part] = pdata; } @@ -1034,14 +1041,14 @@ ReadData( char *filename, { part = strtol(sdata_ptr, &sdata_ptr, 10); pdata = data.pdata[part]; - if ((pdata.fem_rhsadd_nboxes% 10) == 0) + if ((pdata.fem_rhsadd_nboxes % 10) == 0) { - size = pdata.fem_rhsadd_nboxes+10; - pdata.fem_rhsadd_ilowers= + size = pdata.fem_rhsadd_nboxes + 10; + pdata.fem_rhsadd_ilowers = hypre_TReAlloc(pdata.fem_rhsadd_ilowers, ProblemIndex, size, HYPRE_MEMORY_HOST); - pdata.fem_rhsadd_iuppers= + pdata.fem_rhsadd_iuppers = hypre_TReAlloc(pdata.fem_rhsadd_iuppers, ProblemIndex, size, HYPRE_MEMORY_HOST); - pdata.fem_rhsadd_values= + pdata.fem_rhsadd_values = hypre_TReAlloc(pdata.fem_rhsadd_values, HYPRE_Real *, size, HYPRE_MEMORY_HOST); } SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, @@ -1058,10 +1065,10 @@ ReadData( char *filename, else if ( strcmp(key, "ProcessPoolCreate:") == 0 ) { data.ndists++; - data.dist_npools= hypre_TReAlloc(data.dist_npools, HYPRE_Int, data.ndists, HYPRE_MEMORY_HOST); - data.dist_pools= hypre_TReAlloc(data.dist_pools, HYPRE_Int *, data.ndists, HYPRE_MEMORY_HOST); - data.dist_npools[data.ndists-1] = strtol(sdata_ptr, &sdata_ptr, 10); - data.dist_pools[data.ndists-1] = hypre_CTAlloc(HYPRE_Int, data.nparts, HYPRE_MEMORY_HOST); + data.dist_npools = hypre_TReAlloc(data.dist_npools, HYPRE_Int, data.ndists, HYPRE_MEMORY_HOST); + data.dist_pools = hypre_TReAlloc(data.dist_pools, HYPRE_Int *, data.ndists, HYPRE_MEMORY_HOST); + data.dist_npools[data.ndists - 1] = strtol(sdata_ptr, &sdata_ptr, 10); + data.dist_pools[data.ndists - 1] = hypre_CTAlloc(HYPRE_Int, data.nparts, HYPRE_MEMORY_HOST); #if 0 data.npools = strtol(sdata_ptr, &sdata_ptr, 10); data.pools = hypre_CTAlloc(HYPRE_Int, data.nparts, HYPRE_MEMORY_HOST); @@ -1071,7 +1078,7 @@ ReadData( char *filename, { i = strtol(sdata_ptr, &sdata_ptr, 10); part = strtol(sdata_ptr, &sdata_ptr, 10); - data.dist_pools[data.ndists-1][part] = i; + data.dist_pools[data.ndists - 1][part] = i; } else if ( strcmp(key, "GridSetNeighborBox:") == 0 ) { @@ -1095,27 +1102,28 @@ ReadData( char *filename, HYPRE_Int d; data.fem_ivalues_full = hypre_CTAlloc(HYPRE_Int *, data.fem_nvars, HYPRE_MEMORY_HOST); - data.fem_ordering = hypre_CTAlloc(HYPRE_Int, (1+data.ndim)*data.fem_nvars, HYPRE_MEMORY_HOST); - data.fem_sparsity = hypre_CTAlloc(HYPRE_Int, 2*data.fem_nvars*data.fem_nvars, HYPRE_MEMORY_HOST); - data.fem_values = hypre_CTAlloc(HYPRE_Real, data.fem_nvars*data.fem_nvars, HYPRE_MEMORY_HOST); - data.d_fem_values = hypre_TAlloc(HYPRE_Real, data.fem_nvars*data.fem_nvars, HYPRE_MEMORY_DEVICE); + data.fem_ordering = hypre_CTAlloc(HYPRE_Int, (1 + data.ndim) * data.fem_nvars, HYPRE_MEMORY_HOST); + data.fem_sparsity = hypre_CTAlloc(HYPRE_Int, 2 * data.fem_nvars * data.fem_nvars, + HYPRE_MEMORY_HOST); + data.fem_values = hypre_CTAlloc(HYPRE_Real, data.fem_nvars * data.fem_nvars, HYPRE_MEMORY_HOST); + data.d_fem_values = hypre_TAlloc(HYPRE_Real, data.fem_nvars * data.fem_nvars, memory_location); for (i = 0; i < data.fem_nvars; i++) { data.fem_ivalues_full[i] = hypre_CTAlloc(HYPRE_Int, data.fem_nvars, HYPRE_MEMORY_HOST); - k = (1+data.ndim)*i; + k = (1 + data.ndim) * i; data.fem_ordering[k] = data.fem_vars[i]; for (d = 0; d < data.ndim; d++) { - data.fem_ordering[k+1+d] = data.fem_offsets[i][d]; + data.fem_ordering[k + 1 + d] = data.fem_offsets[i][d]; } for (j = 0; j < data.fem_nvars; j++) { if (data.fem_values_full[i][j] != 0.0) { - k = 2*data.fem_nsparse; + k = 2 * data.fem_nsparse; data.fem_sparsity[k] = i; - data.fem_sparsity[k+1] = j; + data.fem_sparsity[k + 1] = j; data.fem_values[data.fem_nsparse] = data.fem_values_full[i][j]; data.fem_ivalues_full[i][j] = data.fem_nsparse; data.fem_nsparse ++; @@ -1143,9 +1151,9 @@ MapProblemIndex( ProblemIndex index, index[1] -= index[7]; index[2] -= index[8]; /* map the index */ - index[0] = m[0]*index[0] + (m[0]-1)*index[3]; - index[1] = m[1]*index[1] + (m[1]-1)*index[4]; - index[2] = m[2]*index[2] + (m[2]-1)*index[5]; + index[0] = m[0] * index[0] + (m[0] - 1) * index[3]; + index[1] = m[1] * index[1] + (m[1] - 1) * index[4]; + index[2] = m[2] * index[2] + (m[2] - 1) * index[5]; /* pre-shift the new mapped index */ index[0] += index[6]; index[1] += index[7]; @@ -1185,6 +1193,7 @@ DistributeData( ProblemData global_data, HYPRE_Int myid, ProblemData *data_ptr ) { + HYPRE_MemoryLocation memory_location = global_data.memory_location; ProblemData data = global_data; ProblemPartData pdata; HYPRE_Int *pool_procs; @@ -1201,7 +1210,7 @@ DistributeData( ProblemData global_data, data.pools = data.dist_pools[pooldist]; /* determine first process number in each pool */ - pool_procs = hypre_CTAlloc(HYPRE_Int, (data.npools+1), HYPRE_MEMORY_HOST); + pool_procs = hypre_CTAlloc(HYPRE_Int, (data.npools + 1), HYPRE_MEMORY_HOST); for (part = 0; part < data.nparts; part++) { pool = data.pools[part] + 1; @@ -1218,7 +1227,7 @@ DistributeData( ProblemData global_data, /* check number of processes */ if (pool_procs[data.npools] != num_procs) { - hypre_printf("%d, %d \n",pool_procs[data.npools],num_procs); + hypre_printf("%d, %d \n", pool_procs[data.npools], num_procs); hypre_printf("Error: Invalid number of processes or process topology \n"); exit(1); } @@ -1319,7 +1328,7 @@ DistributeData( ProblemData global_data, { p = pid % m[0]; q = ((pid - p) / m[0]) % m[1]; - r = (pid - p - q*m[0]) / (m[0]*m[1]); + r = (pid - p - q * m[0]) / (m[0] * m[1]); for (box = 0; box < pdata.nboxes; box++) { @@ -1333,12 +1342,12 @@ DistributeData( ProblemData global_data, pdata.iuppers[box][1] = pdata.ilowers[box][1] + n[1] - 1; pdata.iuppers[box][2] = pdata.ilowers[box][2] + n[2] - 1; - pdata.ilowers[box][0] = pdata.ilowers[box][0] + p*n[0]; - pdata.ilowers[box][1] = pdata.ilowers[box][1] + q*n[1]; - pdata.ilowers[box][2] = pdata.ilowers[box][2] + r*n[2]; - pdata.iuppers[box][0] = pdata.iuppers[box][0] + p*n[0]; - pdata.iuppers[box][1] = pdata.iuppers[box][1] + q*n[1]; - pdata.iuppers[box][2] = pdata.iuppers[box][2] + r*n[2]; + pdata.ilowers[box][0] = pdata.ilowers[box][0] + p * n[0]; + pdata.ilowers[box][1] = pdata.ilowers[box][1] + q * n[1]; + pdata.ilowers[box][2] = pdata.ilowers[box][2] + r * n[2]; + pdata.iuppers[box][0] = pdata.iuppers[box][0] + p * n[0]; + pdata.iuppers[box][1] = pdata.iuppers[box][1] + q * n[1]; + pdata.iuppers[box][2] = pdata.iuppers[box][2] + r * n[2]; } i = 0; @@ -1648,11 +1657,11 @@ DistributeData( ProblemData global_data, if ( (m[0] * m[1] * m[2]) > 1) { pdata.ilowers = hypre_TReAlloc(pdata.ilowers, ProblemIndex, - m[0]*m[1]*m[2]*pdata.nboxes, HYPRE_MEMORY_HOST); + m[0] * m[1] * m[2] * pdata.nboxes, HYPRE_MEMORY_HOST); pdata.iuppers = hypre_TReAlloc(pdata.iuppers, ProblemIndex, - m[0]*m[1]*m[2]*pdata.nboxes, HYPRE_MEMORY_HOST); + m[0] * m[1] * m[2] * pdata.nboxes, HYPRE_MEMORY_HOST); pdata.boxsizes = hypre_TReAlloc(pdata.boxsizes, HYPRE_Int, - m[0]*m[1]*m[2]*pdata.nboxes, HYPRE_MEMORY_HOST); + m[0] * m[1] * m[2] * pdata.nboxes, HYPRE_MEMORY_HOST); for (box = 0; box < pdata.nboxes; box++) { n[0] = pdata.iuppers[box][0] - pdata.ilowers[box][0] + 1; @@ -1673,12 +1682,12 @@ DistributeData( ProblemData global_data, { for (p = 0; p < m[0]; p++) { - pdata.ilowers[i][0] = pdata.ilowers[box][0] + p*n[0]; - pdata.ilowers[i][1] = pdata.ilowers[box][1] + q*n[1]; - pdata.ilowers[i][2] = pdata.ilowers[box][2] + r*n[2]; - pdata.iuppers[i][0] = pdata.iuppers[box][0] + p*n[0]; - pdata.iuppers[i][1] = pdata.iuppers[box][1] + q*n[1]; - pdata.iuppers[i][2] = pdata.iuppers[box][2] + r*n[2]; + pdata.ilowers[i][0] = pdata.ilowers[box][0] + p * n[0]; + pdata.ilowers[i][1] = pdata.ilowers[box][1] + q * n[1]; + pdata.ilowers[i][2] = pdata.ilowers[box][2] + r * n[2]; + pdata.iuppers[i][0] = pdata.iuppers[box][0] + p * n[0]; + pdata.iuppers[i][1] = pdata.iuppers[box][1] + q * n[1]; + pdata.iuppers[i][2] = pdata.iuppers[box][2] + r * n[2]; for (d = 3; d < 9; d++) { pdata.ilowers[i][d] = pdata.ilowers[box][d]; @@ -1689,7 +1698,7 @@ DistributeData( ProblemData global_data, } } } - pdata.nboxes *= m[0]*m[1]*m[2]; + pdata.nboxes *= m[0] * m[1] * m[2]; for (box = 0; box < pdata.graph_nboxes; box++) { @@ -1774,8 +1783,8 @@ DistributeData( ProblemData global_data, size = 1; for (i = 0; i < 3; i++) { - size*= (pdata.matset_iuppers[box][i] - - pdata.matset_ilowers[box][i] + 1); + size *= (pdata.matset_iuppers[box][i] - + pdata.matset_ilowers[box][i] + 1); } pdata.max_boxsize = hypre_max(pdata.max_boxsize, size); } @@ -1784,8 +1793,8 @@ DistributeData( ProblemData global_data, size = 1; for (i = 0; i < 3; i++) { - size*= (pdata.matadd_iuppers[box][i] - - pdata.matadd_ilowers[box][i] + 1); + size *= (pdata.matadd_iuppers[box][i] - + pdata.matadd_ilowers[box][i] + 1); } pdata.max_boxsize = hypre_max(pdata.max_boxsize, size); } @@ -1794,8 +1803,8 @@ DistributeData( ProblemData global_data, size = 1; for (i = 0; i < 3; i++) { - size*= (pdata.fem_matadd_iuppers[box][i] - - pdata.fem_matadd_ilowers[box][i] + 1); + size *= (pdata.fem_matadd_iuppers[box][i] - + pdata.fem_matadd_ilowers[box][i] + 1); } pdata.max_boxsize = hypre_max(pdata.max_boxsize, size); } @@ -1804,8 +1813,8 @@ DistributeData( ProblemData global_data, size = 1; for (i = 0; i < 3; i++) { - size*= (pdata.rhsadd_iuppers[box][i] - - pdata.rhsadd_ilowers[box][i] + 1); + size *= (pdata.rhsadd_iuppers[box][i] - + pdata.rhsadd_ilowers[box][i] + 1); } pdata.max_boxsize = hypre_max(pdata.max_boxsize, size); } @@ -1814,16 +1823,16 @@ DistributeData( ProblemData global_data, size = 1; for (i = 0; i < 3; i++) { - size*= (pdata.fem_rhsadd_iuppers[box][i] - - pdata.fem_rhsadd_ilowers[box][i] + 1); + size *= (pdata.fem_rhsadd_iuppers[box][i] - + pdata.fem_rhsadd_ilowers[box][i] + 1); } pdata.max_boxsize = hypre_max(pdata.max_boxsize, size); } /* refine periodicity */ - pdata.periodic[0] *= refine[part][0]*block[part][0]*distribute[part][0]; - pdata.periodic[1] *= refine[part][1]*block[part][1]*distribute[part][1]; - pdata.periodic[2] *= refine[part][2]*block[part][2]*distribute[part][2]; + pdata.periodic[0] *= refine[part][0] * block[part][0] * distribute[part][0]; + pdata.periodic[1] *= refine[part][1] * block[part][1] * distribute[part][1]; + pdata.periodic[2] *= refine[part][2] * block[part][2] * distribute[part][2]; } if (pdata.nboxes == 0) @@ -1865,7 +1874,7 @@ DistributeData( ProblemData global_data, hypre_TFree(pdata.graph_entries, HYPRE_MEMORY_HOST); pdata.graph_values_size = 0; hypre_TFree(pdata.graph_values, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.d_graph_values, HYPRE_MEMORY_DEVICE); + hypre_TFree(pdata.d_graph_values, memory_location); hypre_TFree(pdata.graph_boxsizes, HYPRE_MEMORY_HOST); } @@ -1938,6 +1947,7 @@ DistributeData( ProblemData global_data, HYPRE_Int DestroyData( ProblemData data ) { + HYPRE_MemoryLocation memory_location = data.memory_location; ProblemPartData pdata; HYPRE_Int part, box, s, i; @@ -1999,7 +2009,7 @@ DestroyData( ProblemData data ) hypre_TFree(pdata.graph_entries, HYPRE_MEMORY_HOST); pdata.graph_values_size = 0; hypre_TFree(pdata.graph_values, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.d_graph_values, HYPRE_MEMORY_DEVICE); + hypre_TFree(pdata.d_graph_values, memory_location); hypre_TFree(pdata.graph_boxsizes, HYPRE_MEMORY_HOST); } @@ -2096,13 +2106,13 @@ DestroyData( ProblemData data ) hypre_TFree(data.fem_ordering, HYPRE_MEMORY_HOST); hypre_TFree(data.fem_sparsity, HYPRE_MEMORY_HOST); hypre_TFree(data.fem_values, HYPRE_MEMORY_HOST); - hypre_TFree(data.d_fem_values, HYPRE_MEMORY_DEVICE); + hypre_TFree(data.d_fem_values, memory_location); } if (data.fem_rhs_true > 0) { hypre_TFree(data.fem_rhs_values, HYPRE_MEMORY_HOST); - hypre_TFree(data.d_fem_rhs_values, HYPRE_MEMORY_DEVICE); + hypre_TFree(data.d_fem_rhs_values, memory_location); } if (data.symmetric_num > 0) @@ -2142,13 +2152,13 @@ SetCosineVector(HYPRE_Real scale, { for (i = ilower[0]; i <= iupper[0]; i++) { - values[count] = scale * cos((i+j+k)/10.0); + values[count] = scale * hypre_cos((i + j + k) / 10.0); count++; } } } - return(0); + return (0); } /*-------------------------------------------------------------------------- @@ -2167,6 +2177,7 @@ PrintUsage( char *progname, hypre_printf("\n"); hypre_printf(" -in : input file (default is `%s')\n", infile_default); + hypre_printf(" -fromfile : read SStructMatrix from file\n"); hypre_printf("\n"); hypre_printf(" -pt ... : set part(s) for subsequent options\n"); hypre_printf(" -pooldist

: pool distribution to use\n"); @@ -2236,6 +2247,13 @@ PrintUsage( char *progname, hypre_printf(" 247- Struct BiCGSTAB with 2-step Jacobi\n"); hypre_printf(" 248- Struct BiCGSTAB with diagonal scaling\n"); hypre_printf(" 249- Struct BiCGSTAB\n"); + hypre_printf(" -repeats : number of times to repeat\n"); + hypre_printf(" -pout : print level for the preconditioner\n"); + hypre_printf(" -sout : print level for the solver\n"); + hypre_printf(" -ll : hypre's log level\n"); + hypre_printf(" 0 - (default) No messaging.\n"); + hypre_printf(" 1 - Display memory usage statistics for each MPI rank.\n"); + hypre_printf(" 2 - Display aggregate memory usage statistics over MPI ranks.\n"); hypre_printf(" -print : print out the system\n"); hypre_printf(" -rhsfromcosine : solution is cosine function (default)\n"); hypre_printf(" -rhsone : rhs is vector with unit components\n"); @@ -2317,27 +2335,39 @@ hypre_int main( hypre_int argc, char *argv[] ) { + MPI_Comm comm = hypre_MPI_COMM_WORLD; + char *infile; ProblemData global_data; ProblemData data; ProblemPartData pdata; - HYPRE_Int nparts; + HYPRE_Int nparts = 0; HYPRE_Int pooldist; - HYPRE_Int *parts; - Index *refine; - Index *distribute; - Index *block; + HYPRE_Int *parts = NULL; + Index *refine = NULL; + Index *distribute = NULL; + Index *block = NULL; HYPRE_Int solver_id, object_type; + HYPRE_Int repeats, rep; + HYPRE_Int prec_print_level; + HYPRE_Int solver_print_level; + HYPRE_Int log_level; HYPRE_Int print_system; HYPRE_Int cosine; HYPRE_Real scale; - - HYPRE_SStructGrid grid, G_grid; - HYPRE_SStructStencil *stencils, *G_stencils; - HYPRE_SStructGraph graph, G_graph; - HYPRE_SStructMatrix A, G; - HYPRE_SStructVector b; - HYPRE_SStructVector x; + HYPRE_Int read_fromfile_flag = 0; + HYPRE_Int read_fromfile_index[3] = {-1, -1, -1}; + + HYPRE_SStructGrid grid = NULL; + HYPRE_SStructGrid G_grid = NULL; + HYPRE_SStructStencil *stencils = NULL; + HYPRE_SStructStencil *G_stencils = NULL; + HYPRE_SStructGraph graph = NULL; + HYPRE_SStructGraph G_graph = NULL; + HYPRE_SStructMatrix A = NULL; + HYPRE_SStructMatrix G = NULL; + HYPRE_SStructVector b = NULL; + HYPRE_SStructVector x = NULL; HYPRE_SStructSolver solver; HYPRE_SStructSolver precond; @@ -2356,14 +2386,16 @@ main( hypre_int argc, Index ilower, iupper; Index index, to_index; - HYPRE_Int values_size; - HYPRE_Real *values; - HYPRE_Real *d_values; + HYPRE_Int values_size = 0; + HYPRE_Real *values = NULL; + HYPRE_Real *d_values = NULL; HYPRE_Int num_iterations; HYPRE_Real final_res_norm; HYPRE_Int num_procs, myid; + HYPRE_Int device_id = -1; + HYPRE_Int lazy_device_init = 0; HYPRE_Int time_index; HYPRE_Int n_pre, n_post; @@ -2423,11 +2455,26 @@ main( hypre_int argc, /* end lobpcg */ +#if defined(HYPRE_USING_MEMORY_TRACKER) + HYPRE_Int print_mem_tracker = 0; + char mem_tracker_name[HYPRE_MAX_FILE_NAME_LEN] = {0}; +#endif + #if defined(HYPRE_USING_GPU) - HYPRE_Int spgemm_use_cusparse = 0; + HYPRE_Int spgemm_use_vendor = 0; #endif - HYPRE_ExecutionPolicy default_exec_policy = HYPRE_EXEC_DEVICE; + +#if defined(HYPRE_TEST_USING_HOST) + HYPRE_MemoryLocation memory_location = HYPRE_MEMORY_HOST; + HYPRE_ExecutionPolicy default_exec_policy = HYPRE_EXEC_HOST; +#else HYPRE_MemoryLocation memory_location = HYPRE_MEMORY_DEVICE; + HYPRE_ExecutionPolicy default_exec_policy = HYPRE_EXEC_DEVICE; +#endif + + global_data.memory_location = memory_location; + + HYPRE_Int gpu_aware_mpi = 0; /*----------------------------------------------------------- * Initialize some stuff @@ -2435,19 +2482,72 @@ main( hypre_int argc, /* Initialize MPI */ hypre_MPI_Init(&argc, &argv); - hypre_MPI_Comm_size(hypre_MPI_COMM_WORLD, &num_procs); - hypre_MPI_Comm_rank(hypre_MPI_COMM_WORLD, &myid); + hypre_MPI_Comm_size(comm, &num_procs); + hypre_MPI_Comm_rank(comm, &myid); /*----------------------------------------------------------------- * GPU Device binding - * Must be done before HYPRE_Init() and should not be changed after + * Must be done before HYPRE_Initialize() and should not be changed after *-----------------------------------------------------------------*/ - hypre_bind_device(myid, num_procs, hypre_MPI_COMM_WORLD); + for (arg_index = 1; arg_index < argc; arg_index ++) + { + if (strcmp(argv[arg_index], "-lazy_device_init") == 0) + { + lazy_device_init = atoi(argv[++arg_index]); + } + else if (strcmp(argv[arg_index], "-device_id") == 0) + { + device_id = atoi(argv[++arg_index]); + } + } + + hypre_bind_device_id(device_id, myid, num_procs, comm); /*----------------------------------------------------------- * Initialize : must be the first HYPRE function to call *-----------------------------------------------------------*/ - HYPRE_Init(); + HYPRE_Initialize(); + + if (!lazy_device_init) + { + HYPRE_DeviceInitialize(); + } + + /*----------------------------------------------------------- + * Set defaults + *-----------------------------------------------------------*/ + + skip = 0; + rap = 0; + relax = 1; + jacobi_weight = 1.0; + usr_jacobi_weight = 0; + jump = 0; + gradient_matrix = 0; + object_type = HYPRE_SSTRUCT; + solver_type = 1; + recompute_res = 0; /* What should be the default here? */ + cf_tol = 0.90; + pooldist = 0; + cycred_tdim = 0; + for (i = 0; i < 3; i++) + { + cycred_index[i] = 0; + cycred_stride[i] = 1; + } + + solver_id = 39; + repeats = 1; + prec_print_level = 0; + solver_print_level = 0; + log_level = 0; + print_system = 0; + cosine = 1; + skip = 0; + n_pre = 1; + n_post = 1; + + old_default = 0; /*----------------------------------------------------------- * Read input file @@ -2456,13 +2556,31 @@ main( hypre_int argc, /* parse command line for input file name */ infile = infile_default; - if (argc > 1) + while (arg_index < argc) { if ( strcmp(argv[arg_index], "-in") == 0 ) { arg_index++; infile = argv[arg_index++]; } + else if (strcmp(argv[arg_index], "-fromfile") == 0 ) + { + arg_index++; + read_fromfile_flag += 1; + read_fromfile_index[0] = arg_index++; + } + else if (strcmp(argv[arg_index], "-rhsfromfile") == 0 ) + { + arg_index++; + read_fromfile_flag += 2; + read_fromfile_index[1] = arg_index++; + } + else if (strcmp(argv[arg_index], "-x0fromfile") == 0 ) + { + arg_index++; + read_fromfile_flag += 4; + read_fromfile_index[2] = arg_index++; + } else if ( strcmp(argv[arg_index], "-help") == 0 ) { PrintUsage(argv[0], myid); @@ -2484,61 +2602,55 @@ main( hypre_int argc, hypre_printf("HYPRE Single = %d\n", single); exit(1); } + else + { + break; + } } - ReadData(infile, &global_data); - /*----------------------------------------------------------- - * Set defaults + * Are we reading matrices/vectors directly from file? *-----------------------------------------------------------*/ - skip = 0; - rap = 0; - relax = 1; - usr_jacobi_weight= 0; - jump = 0; - solver_type = 1; - recompute_res = 0; /* What should be the default here? */ - cf_tol = 0.90; + if (read_fromfile_index[0] == -1 && + read_fromfile_index[1] == -1 && + read_fromfile_index[2] == -1) + { + ReadData(infile, &global_data); - nparts = global_data.nparts; - pooldist = 0; + nparts = global_data.nparts; + parts = hypre_TAlloc(HYPRE_Int, nparts, HYPRE_MEMORY_HOST); + refine = hypre_TAlloc(Index, nparts, HYPRE_MEMORY_HOST); + distribute = hypre_TAlloc(Index, nparts, HYPRE_MEMORY_HOST); + block = hypre_TAlloc(Index, nparts, HYPRE_MEMORY_HOST); + for (part = 0; part < nparts; part++) + { + parts[part] = part; + for (j = 0; j < 3; j++) + { + refine[part][j] = 1; + distribute[part][j] = 1; + block[part][j] = 1; + } + } - parts = hypre_TAlloc(HYPRE_Int, nparts, HYPRE_MEMORY_HOST); - refine = hypre_TAlloc(Index, nparts, HYPRE_MEMORY_HOST); - distribute = hypre_TAlloc(Index, nparts, HYPRE_MEMORY_HOST); - block = hypre_TAlloc(Index, nparts, HYPRE_MEMORY_HOST); - for (part = 0; part < nparts; part++) - { - parts[part] = part; - for (j = 0; j < 3; j++) + if (global_data.rhs_true || global_data.fem_rhs_true) { - refine[part][j] = 1; - distribute[part][j] = 1; - block[part][j] = 1; + cosine = 0; } } - cycred_tdim = 0; - for (i = 0; i < 3; i++) - { - cycred_index[i] = 0; - cycred_stride[i] = 1; - } - - solver_id = 39; - print_system = 0; - cosine = 1; - if (global_data.rhs_true || global_data.fem_rhs_true) + else { - cosine = 0; + if (read_fromfile_flag < 7) + { + if (!myid) + { + hypre_printf("Error: Must read A, b, and x from file! \n"); + } + exit(1); + } } - skip = 0; - n_pre = 1; - n_post = 1; - - old_default = 0; - /*----------------------------------------------------------- * Parse command line *-----------------------------------------------------------*/ @@ -2606,12 +2718,35 @@ main( hypre_int argc, arg_index++; /* begin lobpcg */ - if ( strcmp(argv[arg_index], "none") == 0 ) { + if ( strcmp(argv[arg_index], "none") == 0 ) + { solver_id = NO_SOLVER; arg_index++; } else /* end lobpcg */ + { solver_id = atoi(argv[arg_index++]); + } + } + else if ( strcmp(argv[arg_index], "-repeats") == 0 ) + { + arg_index++; + repeats = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-pout") == 0 ) + { + arg_index++; + prec_print_level = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-sout") == 0 ) + { + arg_index++; + solver_print_level = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-ll") == 0 ) + { + arg_index++; + log_level = atoi(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-print") == 0 ) { @@ -2631,7 +2766,7 @@ main( hypre_int argc, else if ( strcmp(argv[arg_index], "-tol") == 0 ) { arg_index++; - tol = atof(argv[arg_index++]); + tol = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-v") == 0 ) { @@ -2657,8 +2792,8 @@ main( hypre_int argc, else if ( strcmp(argv[arg_index], "-w") == 0 ) { arg_index++; - jacobi_weight= atof(argv[arg_index++]); - usr_jacobi_weight= 1; /* flag user weight */ + jacobi_weight = (HYPRE_Real)atof(argv[arg_index++]); + usr_jacobi_weight = 1; /* flag user weight */ } else if ( strcmp(argv[arg_index], "-jump") == 0 ) { @@ -2678,12 +2813,12 @@ main( hypre_int argc, else if ( strcmp(argv[arg_index], "-cf") == 0 ) { arg_index++; - cf_tol = atof(argv[arg_index++]); + cf_tol = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-crtdim") == 0 ) { arg_index++; - cycred_tdim = atof(argv[arg_index++]); + cycred_tdim = atoi(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-cri") == 0 ) { @@ -2727,7 +2862,8 @@ main( hypre_int argc, verbosity = atoi(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-vrand") == 0 ) - { /* lobpcg: block size */ + { + /* lobpcg: block size */ arg_index++; blockSize = atoi(argv[arg_index++]); } @@ -2753,7 +2889,7 @@ main( hypre_int argc, { /* lobpcg: inner pcg iterations tolerance */ arg_index++; - pcgTol = atof(argv[arg_index++]); + pcgTol = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-pcgmode") == 0 ) { @@ -2768,7 +2904,16 @@ main( hypre_int argc, arg_index++; printLevel = atoi(argv[arg_index++]); } -#if defined(HYPRE_USING_GPU) + else if ( strcmp(argv[arg_index], "-memory_host") == 0 ) + { + arg_index++; + memory_location = HYPRE_MEMORY_HOST; + } + else if ( strcmp(argv[arg_index], "-memory_device") == 0 ) + { + arg_index++; + memory_location = HYPRE_MEMORY_DEVICE; + } else if ( strcmp(argv[arg_index], "-exec_host") == 0 ) { arg_index++; @@ -2779,1195 +2924,1206 @@ main( hypre_int argc, arg_index++; default_exec_policy = HYPRE_EXEC_DEVICE; } - else if ( strcmp(argv[arg_index], "-mm_cusparse") == 0 ) +#if defined(HYPRE_USING_GPU) + else if ( strcmp(argv[arg_index], "-mm_vendor") == 0 ) + { + arg_index++; + spgemm_use_vendor = atoi(argv[arg_index++]); + } +#endif +#if defined(HYPRE_USING_MEMORY_TRACKER) + else if ( strcmp(argv[arg_index], "-print_mem_tracker") == 0 ) + { + arg_index++; + print_mem_tracker = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-mem_tracker_filename") == 0 ) { arg_index++; - spgemm_use_cusparse = atoi(argv[arg_index++]); + snprintf(mem_tracker_name, HYPRE_MAX_FILE_NAME_LEN, "%s", argv[arg_index++]); } #endif + else if ( strcmp(argv[arg_index], "-gpu_mpi") == 0 ) + { + arg_index++; + gpu_aware_mpi = atoi(argv[arg_index++]); + } else { arg_index++; - /*break;*/ } } +#if defined(HYPRE_USING_MEMORY_TRACKER) + hypre_MemoryTrackerSetPrint(print_mem_tracker); + if (mem_tracker_name[0]) { hypre_MemoryTrackerSetFileName(mem_tracker_name); } +#endif + + /* Set library log level */ + HYPRE_SetLogLevel(log_level); + /* default memory location */ HYPRE_SetMemoryLocation(memory_location); /* default execution policy */ HYPRE_SetExecutionPolicy(default_exec_policy); - HYPRE_SetStructExecutionPolicy(HYPRE_EXEC_DEVICE); - #if defined(HYPRE_USING_GPU) - HYPRE_SetSpGemmUseCusparse(spgemm_use_cusparse); + HYPRE_SetSpGemmUseVendor(spgemm_use_vendor); #endif + HYPRE_SetGpuAwareMPI(gpu_aware_mpi); + if ( solver_id == 39 && lobpcgFlag ) + { solver_id = 10; + } /* end lobpcg */ /*----------------------------------------------------------- * Print driver parameters TODO *-----------------------------------------------------------*/ + if (myid == 0) { +#if defined(HYPRE_DEVELOP_STRING) && defined(HYPRE_DEVELOP_BRANCH) + hypre_printf("\nUsing HYPRE_DEVELOP_STRING: %s (branch %s; the develop branch)\n\n", + HYPRE_DEVELOP_STRING, HYPRE_DEVELOP_BRANCH); + +#elif defined(HYPRE_DEVELOP_STRING) && !defined(HYPRE_DEVELOP_BRANCH) + hypre_printf("\nUsing HYPRE_DEVELOP_STRING: %s (branch %s; not the develop branch)\n\n", + HYPRE_DEVELOP_STRING, HYPRE_BRANCH_NAME); + +#elif defined(HYPRE_RELEASE_VERSION) + hypre_printf("\nUsing HYPRE_RELEASE_VERSION: %s\n\n", + HYPRE_RELEASE_VERSION); +#endif } /*----------------------------------------------------------- - * Distribute data + * Synchronize so that timings make sense *-----------------------------------------------------------*/ - DistributeData(global_data, pooldist, refine, distribute, block, - num_procs, myid, &data); + hypre_MPI_Barrier(comm); - /*----------------------------------------------------------- - * Check a few things - *-----------------------------------------------------------*/ - if (solver_id >= 200) + for (rep = 0; rep < repeats; rep++) { - pdata = data.pdata[0]; - if (nparts > 1) + + /*----------------------------------------------------------- + * Set up the grid + *-----------------------------------------------------------*/ + + time_index = hypre_InitializeTiming("SStruct Interface"); + hypre_BeginTiming(time_index); + + if (read_fromfile_flag & 0x1) { if (!myid) { - hypre_printf("Warning: Invalid number of parts for Struct Solver. Part 0 taken. \n"); + hypre_printf("Reading SStructMatrix A from file: %s\n", argv[read_fromfile_index[0]]); } - } - if (pdata.nvars > 1) + HYPRE_SStructMatrixRead(comm, argv[read_fromfile_index[0]], &A); + } + else { - if (!myid) + /*----------------------------------------------------------- + * Distribute data + *-----------------------------------------------------------*/ + + DistributeData(global_data, pooldist, refine, distribute, block, + num_procs, myid, &data); + + /*----------------------------------------------------------- + * Check a few things + *-----------------------------------------------------------*/ + if (solver_id >= 200) { - hypre_printf("Error: Invalid number of nvars for Struct Solver \n"); - } - exit(1); - } - } + pdata = data.pdata[0]; + if (nparts > 1) + { + if (!myid) + { + hypre_printf("Warning: Invalid number of parts for Struct Solver. Part 0 taken.\n"); + } + } - /*----------------------------------------------------------- - * Synchronize so that timings make sense - *-----------------------------------------------------------*/ + if (pdata.nvars > 1) + { + if (!myid) + { + hypre_printf("Error: Invalid number of nvars for Struct Solver \n"); + } + exit(1); + } + } - hypre_MPI_Barrier(hypre_MPI_COMM_WORLD); + HYPRE_SStructGridCreate(comm, data.ndim, data.nparts, &grid); + if (data.numghost != NULL) + { + HYPRE_SStructGridSetNumGhost(grid, data.numghost); + } + for (part = 0; part < data.nparts; part++) + { + pdata = data.pdata[part]; + for (box = 0; box < pdata.nboxes; box++) + { + HYPRE_SStructGridSetExtents(grid, part, + pdata.ilowers[box], pdata.iuppers[box]); + } - /*----------------------------------------------------------- - * Set up the grid - *-----------------------------------------------------------*/ + HYPRE_SStructGridSetVariables(grid, part, pdata.nvars, pdata.vartypes); - time_index = hypre_InitializeTiming("SStruct Interface"); - hypre_BeginTiming(time_index); + /* GridAddVariabes */ - HYPRE_SStructGridCreate(hypre_MPI_COMM_WORLD, data.ndim, data.nparts, &grid); - if (data.numghost != NULL) - { - HYPRE_SStructGridSetNumGhost(grid, data.numghost); - } - for (part = 0; part < data.nparts; part++) - { - pdata = data.pdata[part]; - for (box = 0; box < pdata.nboxes; box++) - { - HYPRE_SStructGridSetExtents(grid, part, - pdata.ilowers[box], pdata.iuppers[box]); - } + if (data.fem_nvars > 0) + { + HYPRE_SStructGridSetFEMOrdering(grid, part, data.fem_ordering); + } - HYPRE_SStructGridSetVariables(grid, part, pdata.nvars, pdata.vartypes); + /* GridSetNeighborPart and GridSetSharedPart */ + for (box = 0; box < pdata.glue_nboxes; box++) + { + if (pdata.glue_shared[box]) + { + HYPRE_SStructGridSetSharedPart(grid, part, + pdata.glue_ilowers[box], + pdata.glue_iuppers[box], + pdata.glue_offsets[box], + pdata.glue_nbor_parts[box], + pdata.glue_nbor_ilowers[box], + pdata.glue_nbor_iuppers[box], + pdata.glue_nbor_offsets[box], + pdata.glue_index_maps[box], + pdata.glue_index_dirs[box]); + } + else + { + HYPRE_SStructGridSetNeighborPart(grid, part, + pdata.glue_ilowers[box], + pdata.glue_iuppers[box], + pdata.glue_nbor_parts[box], + pdata.glue_nbor_ilowers[box], + pdata.glue_nbor_iuppers[box], + pdata.glue_index_maps[box], + pdata.glue_index_dirs[box]); + } + } - /* GridAddVariabes */ + HYPRE_SStructGridSetPeriodic(grid, part, pdata.periodic); + } + HYPRE_SStructGridAssemble(grid); - if (data.fem_nvars > 0) - { - HYPRE_SStructGridSetFEMOrdering(grid, part, data.fem_ordering); - } + /*----------------------------------------------------------- + * Set up the stencils + *-----------------------------------------------------------*/ - /* GridSetNeighborPart and GridSetSharedPart */ - for (box = 0; box < pdata.glue_nboxes; box++) - { - if (pdata.glue_shared[box]) + stencils = hypre_CTAlloc(HYPRE_SStructStencil, data.nstencils, HYPRE_MEMORY_HOST); + for (s = 0; s < data.nstencils; s++) { - HYPRE_SStructGridSetSharedPart(grid, part, - pdata.glue_ilowers[box], - pdata.glue_iuppers[box], - pdata.glue_offsets[box], - pdata.glue_nbor_parts[box], - pdata.glue_nbor_ilowers[box], - pdata.glue_nbor_iuppers[box], - pdata.glue_nbor_offsets[box], - pdata.glue_index_maps[box], - pdata.glue_index_dirs[box]); + HYPRE_SStructStencilCreate(data.ndim, data.stencil_sizes[s], + &stencils[s]); + for (entry = 0; entry < data.stencil_sizes[s]; entry++) + { + HYPRE_SStructStencilSetEntry(stencils[s], entry, + data.stencil_offsets[s][entry], + data.stencil_vars[s][entry]); + } } - else + + /*----------------------------------------------------------- + * Set object type + *-----------------------------------------------------------*/ + /* determine if we build a gradient matrix */ + if (solver_id == 150) { - HYPRE_SStructGridSetNeighborPart(grid, part, - pdata.glue_ilowers[box], - pdata.glue_iuppers[box], - pdata.glue_nbor_parts[box], - pdata.glue_nbor_ilowers[box], - pdata.glue_nbor_iuppers[box], - pdata.glue_index_maps[box], - pdata.glue_index_dirs[box]); + gradient_matrix = 1; + /* for now, change solver 150 to solver 28 */ + solver_id = 28; } - } - HYPRE_SStructGridSetPeriodic(grid, part, pdata.periodic); - } - HYPRE_SStructGridAssemble(grid); + if ( ((solver_id >= 20) && (solver_id < 30)) || + ((solver_id >= 40) && (solver_id < 50)) || + ((solver_id >= 60) && (solver_id < 70)) || + ((solver_id >= 80) && (solver_id < 90)) || + ((solver_id >= 90) && (solver_id < 100)) || + (solver_id == 120) ) + { + object_type = HYPRE_PARCSR; + } - /*----------------------------------------------------------- - * Set up the stencils - *-----------------------------------------------------------*/ + if (solver_id >= 200) + { + object_type = HYPRE_STRUCT; + } - stencils = hypre_CTAlloc(HYPRE_SStructStencil, data.nstencils, HYPRE_MEMORY_HOST); - for (s = 0; s < data.nstencils; s++) - { - HYPRE_SStructStencilCreate(data.ndim, data.stencil_sizes[s], - &stencils[s]); - for (entry = 0; entry < data.stencil_sizes[s]; entry++) - { - HYPRE_SStructStencilSetEntry(stencils[s], entry, - data.stencil_offsets[s][entry], - data.stencil_vars[s][entry]); - } - } + /*----------------------------------------------------------- + * Set up the graph + *-----------------------------------------------------------*/ - /*----------------------------------------------------------- - * Set object type - *-----------------------------------------------------------*/ + HYPRE_SStructGraphCreate(comm, grid, &graph); - object_type = HYPRE_SSTRUCT; + /* HYPRE_SSTRUCT is the default, so we don't have to call SetObjectType */ + if ( object_type != HYPRE_SSTRUCT ) + { + HYPRE_SStructGraphSetObjectType(graph, object_type); + } - /* determine if we build a gradient matrix */ - gradient_matrix = 0; - if (solver_id == 150) - { - gradient_matrix = 1; - /* for now, change solver 150 to solver 28 */ - solver_id = 28; - } + for (part = 0; part < data.nparts; part++) + { + pdata = data.pdata[part]; - if ( ((solver_id >= 20) && (solver_id < 30)) || - ((solver_id >= 40) && (solver_id < 50)) || - ((solver_id >= 60) && (solver_id < 70)) || - ((solver_id >= 80) && (solver_id < 90)) || - ((solver_id >= 90) && (solver_id < 100)) || - (solver_id == 120) ) - { - object_type = HYPRE_PARCSR; - } + if (data.nstencils > 0) + { + /* set stencils */ + for (var = 0; var < pdata.nvars; var++) + { + HYPRE_SStructGraphSetStencil(graph, part, var, + stencils[pdata.stencil_num[var]]); + } + } + else if (data.fem_nvars > 0) + { + /* indicate FEM approach */ + HYPRE_SStructGraphSetFEM(graph, part); - if (solver_id >= 200) - { - object_type = HYPRE_STRUCT; - } + /* set sparsity */ + HYPRE_SStructGraphSetFEMSparsity(graph, part, + data.fem_nsparse, data.fem_sparsity); + } - /*----------------------------------------------------------- - * Set up the graph - *-----------------------------------------------------------*/ - - HYPRE_SStructGraphCreate(hypre_MPI_COMM_WORLD, grid, &graph); - - /* HYPRE_SSTRUCT is the default, so we don't have to call SetObjectType */ - if ( object_type != HYPRE_SSTRUCT ) - { - HYPRE_SStructGraphSetObjectType(graph, object_type); - } - - for (part = 0; part < data.nparts; part++) - { - pdata = data.pdata[part]; - - if (data.nstencils > 0) - { - /* set stencils */ - for (var = 0; var < pdata.nvars; var++) - { - HYPRE_SStructGraphSetStencil(graph, part, var, - stencils[pdata.stencil_num[var]]); - } - } - else if (data.fem_nvars > 0) - { - /* indicate FEM approach */ - HYPRE_SStructGraphSetFEM(graph, part); - - /* set sparsity */ - HYPRE_SStructGraphSetFEMSparsity(graph, part, - data.fem_nsparse, data.fem_sparsity); - } - - /* add entries */ - for (box = 0; box < pdata.graph_nboxes; box++) - { - for (index[2] = pdata.graph_ilowers[box][2]; - index[2] <= pdata.graph_iuppers[box][2]; - index[2] += pdata.graph_strides[box][2]) - { - for (index[1] = pdata.graph_ilowers[box][1]; - index[1] <= pdata.graph_iuppers[box][1]; - index[1] += pdata.graph_strides[box][1]) + /* add entries */ + for (box = 0; box < pdata.graph_nboxes; box++) { - for (index[0] = pdata.graph_ilowers[box][0]; - index[0] <= pdata.graph_iuppers[box][0]; - index[0] += pdata.graph_strides[box][0]) + for (index[2] = pdata.graph_ilowers[box][2]; + index[2] <= pdata.graph_iuppers[box][2]; + index[2] += pdata.graph_strides[box][2]) { - for (i = 0; i < 3; i++) + for (index[1] = pdata.graph_ilowers[box][1]; + index[1] <= pdata.graph_iuppers[box][1]; + index[1] += pdata.graph_strides[box][1]) { - j = pdata.graph_index_maps[box][i]; - k = index[i] - pdata.graph_ilowers[box][i]; - k /= pdata.graph_strides[box][i]; - k *= pdata.graph_index_signs[box][i]; + for (index[0] = pdata.graph_ilowers[box][0]; + index[0] <= pdata.graph_iuppers[box][0]; + index[0] += pdata.graph_strides[box][0]) + { + for (i = 0; i < 3; i++) + { + j = pdata.graph_index_maps[box][i]; + k = index[i] - pdata.graph_ilowers[box][i]; + k /= pdata.graph_strides[box][i]; + k *= pdata.graph_index_signs[box][i]; #if 0 /* the following does not work with some Intel compilers with -O2 */ - to_index[j] = pdata.graph_to_ilowers[box][j] + - k * pdata.graph_to_strides[box][j]; + to_index[j] = pdata.graph_to_ilowers[box][j] + + k * pdata.graph_to_strides[box][j]; #else - to_index[j] = pdata.graph_to_ilowers[box][j]; - to_index[j] += k * pdata.graph_to_strides[box][j]; + to_index[j] = pdata.graph_to_ilowers[box][j]; + to_index[j] += k * pdata.graph_to_strides[box][j]; #endif + } + HYPRE_SStructGraphAddEntries(graph, part, index, + pdata.graph_vars[box], + pdata.graph_to_parts[box], + to_index, + pdata.graph_to_vars[box]); + } } - HYPRE_SStructGraphAddEntries(graph, part, index, - pdata.graph_vars[box], - pdata.graph_to_parts[box], - to_index, - pdata.graph_to_vars[box]); } } } - } - } - HYPRE_SStructGraphAssemble(graph); + HYPRE_SStructGraphAssemble(graph); - /*----------------------------------------------------------- - * Set up the matrix - *-----------------------------------------------------------*/ + /*----------------------------------------------------------- + * Set up the matrix + *-----------------------------------------------------------*/ - values_size = hypre_max(data.max_boxsize, data.fem_nsparse); - values = hypre_TAlloc(HYPRE_Real, values_size, HYPRE_MEMORY_HOST); - d_values = hypre_TAlloc(HYPRE_Real, values_size, HYPRE_MEMORY_DEVICE); + values_size = hypre_max(data.max_boxsize, data.max_boxsize * data.fem_nsparse); - HYPRE_SStructMatrixCreate(hypre_MPI_COMM_WORLD, graph, &A); + values = hypre_TAlloc(HYPRE_Real, values_size, HYPRE_MEMORY_HOST); + d_values = hypre_TAlloc(HYPRE_Real, values_size, memory_location); - /* TODO HYPRE_SStructMatrixSetSymmetric(A, 1); */ - for (i = 0; i < data.symmetric_num; i++) - { - HYPRE_SStructMatrixSetSymmetric(A, data.symmetric_parts[i], - data.symmetric_vars[i], - data.symmetric_to_vars[i], - data.symmetric_booleans[i]); - } - HYPRE_SStructMatrixSetNSSymmetric(A, data.ns_symmetric); + HYPRE_SStructMatrixCreate(comm, graph, &A); - /* HYPRE_SSTRUCT is the default, so we don't have to call SetObjectType */ - if ( object_type != HYPRE_SSTRUCT ) - { - HYPRE_SStructMatrixSetObjectType(A, object_type); - } + /* TODO HYPRE_SStructMatrixSetSymmetric(A, 1); */ + for (i = 0; i < data.symmetric_num; i++) + { + HYPRE_SStructMatrixSetSymmetric(A, data.symmetric_parts[i], + data.symmetric_vars[i], + data.symmetric_to_vars[i], + data.symmetric_booleans[i]); + } + HYPRE_SStructMatrixSetNSSymmetric(A, data.ns_symmetric); - HYPRE_SStructMatrixInitialize(A); + /* HYPRE_SSTRUCT is the default, so we don't have to call SetObjectType */ + if ( object_type != HYPRE_SSTRUCT ) + { + HYPRE_SStructMatrixSetObjectType(A, object_type); + } - if (data.nstencils > 0) - { - /* StencilSetEntry: set stencil values */ - for (part = 0; part < data.nparts; part++) - { - pdata = data.pdata[part]; - for (var = 0; var < pdata.nvars; var++) + HYPRE_SStructMatrixInitialize(A); + + if (data.nstencils > 0) { - s = pdata.stencil_num[var]; - for (i = 0; i < data.stencil_sizes[s]; i++) + /* StencilSetEntry: set stencil values */ + for (part = 0; part < data.nparts; part++) { - for (j = 0; j < pdata.max_boxsize; j++) + pdata = data.pdata[part]; + for (var = 0; var < pdata.nvars; var++) { - values[j] = data.stencil_values[s][i]; - } + s = pdata.stencil_num[var]; + for (i = 0; i < data.stencil_sizes[s]; i++) + { + for (j = 0; j < pdata.max_boxsize; j++) + { + values[j] = data.stencil_values[s][i]; + } + + hypre_TMemcpy(d_values, values, HYPRE_Real, values_size, + memory_location, HYPRE_MEMORY_HOST); - hypre_TMemcpy(d_values, values, HYPRE_Real, values_size, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); + for (box = 0; box < pdata.nboxes; box++) + { + GetVariableBox(pdata.ilowers[box], pdata.iuppers[box], + pdata.vartypes[var], ilower, iupper); + + HYPRE_SStructMatrixSetBoxValues(A, part, ilower, iupper, + var, 1, &i, d_values); + } + } + } + } + } + else if (data.fem_nvars > 0) + { + /* FEMStencilSetRow: add to stencil values */ +#if 0 // Use AddFEMValues + hypre_TMemcpy(data.d_fem_values, data.fem_values, HYPRE_Real, + data.fem_nsparse, memory_location, HYPRE_MEMORY_HOST); + for (part = 0; part < data.nparts; part++) + { + pdata = data.pdata[part]; for (box = 0; box < pdata.nboxes; box++) { - GetVariableBox(pdata.ilowers[box], pdata.iuppers[box], - pdata.vartypes[var], ilower, iupper); - - HYPRE_SStructMatrixSetBoxValues(A, part, ilower, iupper, - var, 1, &i, d_values); + for (index[2] = pdata.ilowers[box][2]; + index[2] <= pdata.iuppers[box][2]; index[2]++) + { + for (index[1] = pdata.ilowers[box][1]; + index[1] <= pdata.iuppers[box][1]; index[1]++) + { + for (index[0] = pdata.ilowers[box][0]; + index[0] <= pdata.iuppers[box][0]; index[0]++) + { + HYPRE_SStructMatrixAddFEMValues(A, part, index, + data.d_fem_values); + } + } + } + } + } +#else // Use AddFEMBoxValues + /* TODO: There is probably a smarter way to do this copy */ + for (i = 0; i < data.max_boxsize; i++) + { + j = i * data.fem_nsparse; + hypre_TMemcpy(&d_values[j], data.fem_values, HYPRE_Real, + data.fem_nsparse, memory_location, HYPRE_MEMORY_HOST); + } + for (part = 0; part < data.nparts; part++) + { + pdata = data.pdata[part]; + for (box = 0; box < pdata.nboxes; box++) + { + HYPRE_SStructMatrixAddFEMBoxValues( + A, part, pdata.ilowers[box], pdata.iuppers[box], d_values); } } +#endif } - } - } - else if (data.fem_nvars > 0) - { - hypre_TMemcpy(data.d_fem_values, data.fem_values, HYPRE_Real, data.fem_nvars * data.fem_nvars, - HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - /* FEMStencilSetRow: add to stencil values */ - for (part = 0; part < data.nparts; part++) - { - pdata = data.pdata[part]; - for (box = 0; box < pdata.nboxes; box++) + /* GraphAddEntries: set non-stencil entries */ + for (part = 0; part < data.nparts; part++) { - for (index[2] = pdata.ilowers[box][2]; - index[2] <= pdata.iuppers[box][2]; index[2]++) + pdata = data.pdata[part]; + + hypre_TMemcpy(pdata.d_graph_values, pdata.graph_values, + HYPRE_Real, pdata.graph_values_size, + memory_location, HYPRE_MEMORY_HOST); + + for (box = 0; box < pdata.graph_nboxes; box++) { - for (index[1] = pdata.ilowers[box][1]; - index[1] <= pdata.iuppers[box][1]; index[1]++) + /* + * RDF NOTE: Add a separate interface routine for setting non-stencil + * entries. It would be more efficient to set boundary values a box + * at a time, but AMR may require striding, and some codes may already + * have a natural values array to pass in, but can't because it uses + * ghost values. + * + * Example new interface routine: + * SetNSBoxValues(matrix, part, ilower, iupper, stride, entry + * values_ilower, values_iupper, values); + */ + + /* since we have already tested SetBoxValues above, use SetValues here */ +#if 0 + for (j = 0; j < pdata.graph_boxsizes[box]; j++) + { + values[j] = pdata.graph_values[box]; + } + HYPRE_SStructMatrixSetBoxValues(A, part, + pdata.graph_ilowers[box], + pdata.graph_iuppers[box], + pdata.graph_vars[box], + 1, &pdata.graph_entries[box], + values); +#else + for (index[2] = pdata.graph_ilowers[box][2]; + index[2] <= pdata.graph_iuppers[box][2]; + index[2] += pdata.graph_strides[box][2]) { - for (index[0] = pdata.ilowers[box][0]; - index[0] <= pdata.iuppers[box][0]; index[0]++) + for (index[1] = pdata.graph_ilowers[box][1]; + index[1] <= pdata.graph_iuppers[box][1]; + index[1] += pdata.graph_strides[box][1]) { - HYPRE_SStructMatrixAddFEMValues(A, part, index, - data.d_fem_values); + for (index[0] = pdata.graph_ilowers[box][0]; + index[0] <= pdata.graph_iuppers[box][0]; + index[0] += pdata.graph_strides[box][0]) + { + HYPRE_SStructMatrixSetValues(A, part, index, + pdata.graph_vars[box], + 1, &pdata.graph_entries[box], + &pdata.d_graph_values[box]); + } } } +#endif } } - } - } - /* GraphAddEntries: set non-stencil entries */ - for (part = 0; part < data.nparts; part++) - { - pdata = data.pdata[part]; + /* MatrixSetValues: reset some matrix values */ + for (part = 0; part < data.nparts; part++) + { + pdata = data.pdata[part]; + for (box = 0; box < pdata.matset_nboxes; box++) + { + size = 1; + for (j = 0; j < 3; j++) + { + size *= (pdata.matset_iuppers[box][j] - + pdata.matset_ilowers[box][j] + 1); + } + for (j = 0; j < size; j++) + { + values[j] = pdata.matset_values[box]; + } - hypre_TMemcpy(pdata.d_graph_values, pdata.graph_values, HYPRE_Real, pdata.graph_values_size, - HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); + hypre_TMemcpy(d_values, values, HYPRE_Real, values_size, + memory_location, HYPRE_MEMORY_HOST); - for (box = 0; box < pdata.graph_nboxes; box++) - { - /* - * RDF NOTE: Add a separate interface routine for setting non-stencil - * entries. It would be more efficient to set boundary values a box - * at a time, but AMR may require striding, and some codes may already - * have a natural values array to pass in, but can't because it uses - * ghost values. - * - * Example new interface routine: - * SetNSBoxValues(matrix, part, ilower, iupper, stride, entry - * values_ilower, values_iupper, values); - */ + HYPRE_SStructMatrixSetBoxValues(A, part, + pdata.matset_ilowers[box], + pdata.matset_iuppers[box], + pdata.matset_vars[box], + 1, &pdata.matset_entries[box], + d_values); + } + } - /* since we have already tested SetBoxValues above, use SetValues here */ -#if 0 - for (j = 0; j < pdata.graph_boxsizes[box]; j++) + /* MatrixAddToValues: add to some matrix values */ + for (part = 0; part < data.nparts; part++) { - values[j] = pdata.graph_values[box]; + pdata = data.pdata[part]; + for (box = 0; box < pdata.matadd_nboxes; box++) + { + size = 1; + for (j = 0; j < 3; j++) + { + size *= (pdata.matadd_iuppers[box][j] - + pdata.matadd_ilowers[box][j] + 1); + } + + for (entry = 0; entry < pdata.matadd_nentries[box]; entry++) + { + for (j = 0; j < size; j++) + { + values[j] = pdata.matadd_values[box][entry]; + } + + hypre_TMemcpy(d_values, values, HYPRE_Real, values_size, + memory_location, HYPRE_MEMORY_HOST); + + HYPRE_SStructMatrixAddToBoxValues(A, part, + pdata.matadd_ilowers[box], + pdata.matadd_iuppers[box], + pdata.matadd_vars[box], + 1, &pdata.matadd_entries[box][entry], + d_values); + } + } } - HYPRE_SStructMatrixSetBoxValues(A, part, - pdata.graph_ilowers[box], - pdata.graph_iuppers[box], - pdata.graph_vars[box], - 1, &pdata.graph_entries[box], - values); -#else - for (index[2] = pdata.graph_ilowers[box][2]; - index[2] <= pdata.graph_iuppers[box][2]; - index[2] += pdata.graph_strides[box][2]) + + /* FEMMatrixAddToValues: add to some matrix values */ + for (part = 0; part < data.nparts; part++) { - for (index[1] = pdata.graph_ilowers[box][1]; - index[1] <= pdata.graph_iuppers[box][1]; - index[1] += pdata.graph_strides[box][1]) + pdata = data.pdata[part]; + for (box = 0; box < pdata.fem_matadd_nboxes; box++) { - for (index[0] = pdata.graph_ilowers[box][0]; - index[0] <= pdata.graph_iuppers[box][0]; - index[0] += pdata.graph_strides[box][0]) + for (i = 0; i < data.fem_nsparse; i++) { - HYPRE_SStructMatrixSetValues(A, part, index, - pdata.graph_vars[box], - 1, &pdata.graph_entries[box], - &pdata.d_graph_values[box]); + values[i] = 0.0; + } + s = 0; + for (i = 0; i < pdata.fem_matadd_nrows[box]; i++) + { + row = pdata.fem_matadd_rows[box][i]; + for (j = 0; j < pdata.fem_matadd_ncols[box]; j++) + { + col = pdata.fem_matadd_cols[box][j]; + values[data.fem_ivalues_full[row][col]] = + pdata.fem_matadd_values[box][s]; + s++; + } + } + + hypre_TMemcpy(d_values, values, HYPRE_Real, values_size, + memory_location, HYPRE_MEMORY_HOST); + + for (index[2] = pdata.fem_matadd_ilowers[box][2]; + index[2] <= pdata.fem_matadd_iuppers[box][2]; index[2]++) + { + for (index[1] = pdata.fem_matadd_ilowers[box][1]; + index[1] <= pdata.fem_matadd_iuppers[box][1]; index[1]++) + { + for (index[0] = pdata.fem_matadd_ilowers[box][0]; + index[0] <= pdata.fem_matadd_iuppers[box][0]; index[0]++) + { + HYPRE_SStructMatrixAddFEMValues(A, part, index, d_values); + } + } } } } -#endif + + HYPRE_SStructMatrixAssemble(A); } - } - /* MatrixSetValues: reset some matrix values */ - for (part = 0; part < data.nparts; part++) - { - pdata = data.pdata[part]; - for (box = 0; box < pdata.matset_nboxes; box++) + /*----------------------------------------------------------- + * Set up the RHS vector + *-----------------------------------------------------------*/ + + if (read_fromfile_flag & 0x2) { - size = 1; - for (j = 0; j < 3; j++) - { - size *= (pdata.matset_iuppers[box][j] - - pdata.matset_ilowers[box][j] + 1); - } - for (j = 0; j < size; j++) + if (!myid) { - values[j] = pdata.matset_values[box]; + hypre_printf("Reading SStructVector b from file: %s\n", argv[read_fromfile_index[1]]); } + cosine = 0; - hypre_TMemcpy(d_values, values, HYPRE_Real, values_size, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - - HYPRE_SStructMatrixSetBoxValues(A, part, - pdata.matset_ilowers[box], - pdata.matset_iuppers[box], - pdata.matset_vars[box], - 1, &pdata.matset_entries[box], - d_values); + HYPRE_SStructVectorRead(comm, argv[read_fromfile_index[1]], &b); } - } - - /* MatrixAddToValues: add to some matrix values */ - for (part = 0; part < data.nparts; part++) - { - pdata = data.pdata[part]; - for (box = 0; box < pdata.matadd_nboxes; box++) + else { - size = 1; - for (j = 0; j < 3; j++) + HYPRE_SStructVectorCreate(comm, grid, &b); + + /* HYPRE_SSTRUCT is the default, so we don't have to call SetObjectType */ + if ( object_type != HYPRE_SSTRUCT ) { - size *= (pdata.matadd_iuppers[box][j] - - pdata.matadd_ilowers[box][j] + 1); + HYPRE_SStructVectorSetObjectType(b, object_type); } - for (entry = 0; entry < pdata.matadd_nentries[box]; entry++) + HYPRE_SStructVectorInitialize(b); + + /* Initialize the rhs values */ + if (data.rhs_true) { - for (j = 0; j < size; j++) + for (j = 0; j < data.max_boxsize; j++) { - values[j] = pdata.matadd_values[box][entry]; + values[j] = data.rhs_value; } - - hypre_TMemcpy(d_values, values, HYPRE_Real, values_size, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - - HYPRE_SStructMatrixAddToBoxValues(A, part, - pdata.matadd_ilowers[box], - pdata.matadd_iuppers[box], - pdata.matadd_vars[box], - 1, &pdata.matadd_entries[box][entry], - d_values); } - } - } - - /* FEMMatrixAddToValues: add to some matrix values */ - for (part = 0; part < data.nparts; part++) - { - pdata = data.pdata[part]; - for (box = 0; box < pdata.fem_matadd_nboxes; box++) - { - for (i = 0; i < data.fem_nsparse; i++) + else if (data.fem_rhs_true) { - values[i] = 0.0; + for (j = 0; j < data.max_boxsize; j++) + { + values[j] = 0.0; + } } - s = 0; - for (i = 0; i < pdata.fem_matadd_nrows[box]; i++) + else /* rhs=1 is the default */ { - row = pdata.fem_matadd_rows[box][i]; - for (j = 0; j < pdata.fem_matadd_ncols[box]; j++) + for (j = 0; j < data.max_boxsize; j++) { - col = pdata.fem_matadd_cols[box][j]; - values[data.fem_ivalues_full[row][col]] = - pdata.fem_matadd_values[box][s]; - s++; + values[j] = 1.0; } } - hypre_TMemcpy(d_values, values, HYPRE_Real, values_size, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); + hypre_TMemcpy(d_values, values, HYPRE_Real, values_size, + memory_location, HYPRE_MEMORY_HOST); - for (index[2] = pdata.fem_matadd_ilowers[box][2]; - index[2] <= pdata.fem_matadd_iuppers[box][2]; index[2]++) + for (part = 0; part < data.nparts; part++) { - for (index[1] = pdata.fem_matadd_ilowers[box][1]; - index[1] <= pdata.fem_matadd_iuppers[box][1]; index[1]++) + pdata = data.pdata[part]; + for (var = 0; var < pdata.nvars; var++) { - for (index[0] = pdata.fem_matadd_ilowers[box][0]; - index[0] <= pdata.fem_matadd_iuppers[box][0]; index[0]++) + for (box = 0; box < pdata.nboxes; box++) { - HYPRE_SStructMatrixAddFEMValues(A, part, index, d_values); + GetVariableBox(pdata.ilowers[box], pdata.iuppers[box], + pdata.vartypes[var], ilower, iupper); + HYPRE_SStructVectorSetBoxValues(b, part, ilower, iupper, + var, d_values); } } } - } - } - - HYPRE_SStructMatrixAssemble(A); - - /*----------------------------------------------------------- - * Set up the linear system - *-----------------------------------------------------------*/ - HYPRE_SStructVectorCreate(hypre_MPI_COMM_WORLD, grid, &b); + /* Add values for FEMRhsSet */ + if (data.fem_rhs_true) + { +#if 0 // Use AddFEMValues + hypre_TMemcpy(data.d_fem_rhs_values, data.fem_rhs_values, HYPRE_Real, + data.fem_nvars, memory_location, HYPRE_MEMORY_HOST); - /* HYPRE_SSTRUCT is the default, so we don't have to call SetObjectType */ - if ( object_type != HYPRE_SSTRUCT ) - { - HYPRE_SStructVectorSetObjectType(b, object_type); - } + for (part = 0; part < data.nparts; part++) + { + pdata = data.pdata[part]; + for (box = 0; box < pdata.nboxes; box++) + { + for (index[2] = pdata.ilowers[box][2]; + index[2] <= pdata.iuppers[box][2]; index[2]++) + { + for (index[1] = pdata.ilowers[box][1]; + index[1] <= pdata.iuppers[box][1]; index[1]++) + { + for (index[0] = pdata.ilowers[box][0]; + index[0] <= pdata.iuppers[box][0]; index[0]++) + { + HYPRE_SStructVectorAddFEMValues(b, part, index, + data.d_fem_rhs_values); + } + } + } + } + } +#else // Use AddFEMBoxValues + /* TODO: There is probably a smarter way to do this copy */ + for (i = 0; i < data.max_boxsize; i++) + { + j = i * data.fem_nvars; + hypre_TMemcpy(&d_values[j], data.fem_rhs_values, HYPRE_Real, + data.fem_nvars, memory_location, HYPRE_MEMORY_HOST); + } + for (part = 0; part < data.nparts; part++) + { + pdata = data.pdata[part]; + for (box = 0; box < pdata.nboxes; box++) + { + HYPRE_SStructVectorAddFEMBoxValues( + b, part, pdata.ilowers[box], pdata.iuppers[box], d_values); + } + } +#endif + } - HYPRE_SStructVectorInitialize(b); + /* RhsAddToValues: add to some RHS values */ + for (part = 0; part < data.nparts; part++) + { + pdata = data.pdata[part]; + for (box = 0; box < pdata.rhsadd_nboxes; box++) + { + size = 1; + for (j = 0; j < 3; j++) + { + size *= (pdata.rhsadd_iuppers[box][j] - + pdata.rhsadd_ilowers[box][j] + 1); + } - /* Initialize the rhs values */ - if (data.rhs_true) - { - for (j = 0; j < data.max_boxsize; j++) - { - values[j] = data.rhs_value; - } - } - else if (data.fem_rhs_true) - { - for (j = 0; j < data.max_boxsize; j++) - { - values[j] = 0.0; - } - } - else /* rhs=1 is the default */ - { - for (j = 0; j < data.max_boxsize; j++) - { - values[j] = 1.0; - } - } + for (j = 0; j < size; j++) + { + values[j] = pdata.rhsadd_values[box]; + } - hypre_TMemcpy(d_values, values, HYPRE_Real, values_size, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); + hypre_TMemcpy(d_values, values, HYPRE_Real, values_size, + memory_location, HYPRE_MEMORY_HOST); - for (part = 0; part < data.nparts; part++) - { - pdata = data.pdata[part]; - for (var = 0; var < pdata.nvars; var++) - { - for (box = 0; box < pdata.nboxes; box++) - { - GetVariableBox(pdata.ilowers[box], pdata.iuppers[box], - pdata.vartypes[var], ilower, iupper); - HYPRE_SStructVectorSetBoxValues(b, part, ilower, iupper, - var, d_values); + HYPRE_SStructVectorAddToBoxValues(b, part, + pdata.rhsadd_ilowers[box], + pdata.rhsadd_iuppers[box], + pdata.rhsadd_vars[box], d_values); + } } - } - } - - /* Add values for FEMRhsSet */ - if (data.fem_rhs_true) - { - hypre_TMemcpy(data.d_fem_rhs_values, data.fem_rhs_values, HYPRE_Real, data.fem_nvars, - HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - for (part = 0; part < data.nparts; part++) - { - pdata = data.pdata[part]; - for (box = 0; box < pdata.nboxes; box++) + /* FEMRhsAddToValues: add to some RHS values */ + for (part = 0; part < data.nparts; part++) { - for (index[2] = pdata.ilowers[box][2]; - index[2] <= pdata.iuppers[box][2]; index[2]++) + pdata = data.pdata[part]; + for (box = 0; box < pdata.fem_rhsadd_nboxes; box++) { - for (index[1] = pdata.ilowers[box][1]; - index[1] <= pdata.iuppers[box][1]; index[1]++) + for (index[2] = pdata.fem_rhsadd_ilowers[box][2]; + index[2] <= pdata.fem_rhsadd_iuppers[box][2]; index[2]++) { - for (index[0] = pdata.ilowers[box][0]; - index[0] <= pdata.iuppers[box][0]; index[0]++) + for (index[1] = pdata.fem_rhsadd_ilowers[box][1]; + index[1] <= pdata.fem_rhsadd_iuppers[box][1]; index[1]++) { - HYPRE_SStructVectorAddFEMValues(b, part, index, - data.d_fem_rhs_values); + for (index[0] = pdata.fem_rhsadd_ilowers[box][0]; + index[0] <= pdata.fem_rhsadd_iuppers[box][0]; index[0]++) + { + HYPRE_SStructVectorAddFEMValues(b, part, index, + pdata.fem_rhsadd_values[box]); + } } } } } + + HYPRE_SStructVectorAssemble(b); } - } - /* RhsAddToValues: add to some RHS values */ - for (part = 0; part < data.nparts; part++) - { - pdata = data.pdata[part]; - for (box = 0; box < pdata.rhsadd_nboxes; box++) + /*----------------------------------------------------------- + * Set up the initial solution vector + *-----------------------------------------------------------*/ + + if (read_fromfile_flag & 0x4) { - size = 1; - for (j = 0; j < 3; j++) + if (!myid) { - size *= (pdata.rhsadd_iuppers[box][j] - - pdata.rhsadd_ilowers[box][j] + 1); + hypre_printf("Reading SStructVector x0 from file: %s\n", argv[read_fromfile_index[2]]); } - for (j = 0; j < size; j++) + HYPRE_SStructVectorRead(comm, argv[read_fromfile_index[2]], &x); + } + else + { + HYPRE_SStructVectorCreate(comm, grid, &x); + + /* HYPRE_SSTRUCT is the default, so we don't have to call SetObjectType */ + if ( object_type != HYPRE_SSTRUCT ) { - values[j] = pdata.rhsadd_values[box]; + HYPRE_SStructVectorSetObjectType(x, object_type); } - hypre_TMemcpy(d_values, values, HYPRE_Real, values_size, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); + HYPRE_SStructVectorInitialize(x); - HYPRE_SStructVectorAddToBoxValues(b, part, - pdata.rhsadd_ilowers[box], - pdata.rhsadd_iuppers[box], - pdata.rhsadd_vars[box], d_values); - } - } + /*----------------------------------------------------------- + * If requested, reset linear system so that it has + * exact solution: + * + * u(part,var,i,j,k) = (part+1)*(var+1)*cosine[(i+j+k)/10] + * + *-----------------------------------------------------------*/ - /* FEMRhsAddToValues: add to some RHS values */ - for (part = 0; part < data.nparts; part++) - { - pdata = data.pdata[part]; - for (box = 0; box < pdata.fem_rhsadd_nboxes; box++) - { - for (index[2] = pdata.fem_rhsadd_ilowers[box][2]; - index[2] <= pdata.fem_rhsadd_iuppers[box][2]; index[2]++) + if (cosine) { - for (index[1] = pdata.fem_rhsadd_ilowers[box][1]; - index[1] <= pdata.fem_rhsadd_iuppers[box][1]; index[1]++) + for (part = 0; part < data.nparts; part++) { - for (index[0] = pdata.fem_rhsadd_ilowers[box][0]; - index[0] <= pdata.fem_rhsadd_iuppers[box][0]; index[0]++) + pdata = data.pdata[part]; + for (var = 0; var < pdata.nvars; var++) { - HYPRE_SStructVectorAddFEMValues(b, part, index, - pdata.fem_rhsadd_values[box]); + scale = (part + 1.0) * (var + 1.0); + for (box = 0; box < pdata.nboxes; box++) + { + /* + GetVariableBox(pdata.ilowers[box], pdata.iuppers[box], + pdata.vartypes[var], ilower, iupper); + */ + GetVariableBox(pdata.ilowers[box], pdata.iuppers[box], + var, ilower, iupper); + SetCosineVector(scale, ilower, iupper, values); + + hypre_TMemcpy(d_values, values, HYPRE_Real, values_size, + memory_location, HYPRE_MEMORY_HOST); + + HYPRE_SStructVectorSetBoxValues(x, part, ilower, iupper, + var, d_values); + } } } } - } - } - - HYPRE_SStructVectorAssemble(b); - - HYPRE_SStructVectorCreate(hypre_MPI_COMM_WORLD, grid, &x); - - /* HYPRE_SSTRUCT is the default, so we don't have to call SetObjectType */ - if ( object_type != HYPRE_SSTRUCT ) - { - HYPRE_SStructVectorSetObjectType(x, object_type); - } - - HYPRE_SStructVectorInitialize(x); - - /*----------------------------------------------------------- - * If requested, reset linear system so that it has - * exact solution: - * - * u(part,var,i,j,k) = (part+1)*(var+1)*cosine[(i+j+k)/10] - * - *-----------------------------------------------------------*/ - - if (cosine) - { - for (part = 0; part < data.nparts; part++) - { - pdata = data.pdata[part]; - for (var = 0; var < pdata.nvars; var++) - { - scale = (part+1.0)*(var+1.0); - for (box = 0; box < pdata.nboxes; box++) - { - /* - GetVariableBox(pdata.ilowers[box], pdata.iuppers[box], - pdata.vartypes[var], ilower, iupper); - */ - GetVariableBox(pdata.ilowers[box], pdata.iuppers[box], - var, ilower, iupper); - SetCosineVector(scale, ilower, iupper, values); - hypre_TMemcpy(d_values, values, HYPRE_Real, values_size, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - - HYPRE_SStructVectorSetBoxValues(x, part, ilower, iupper, - var, d_values); - } - } + HYPRE_SStructVectorAssemble(x); } - } - HYPRE_SStructVectorAssemble(x); - - hypre_EndTiming(time_index); - hypre_PrintTiming("SStruct Interface", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); - - /*----------------------------------------------------------- - * Get the objects out - * NOTE: This should go after the cosine part, but for the bug - *-----------------------------------------------------------*/ - - if (object_type == HYPRE_PARCSR) - { - HYPRE_SStructMatrixGetObject(A, (void **) &par_A); - HYPRE_SStructVectorGetObject(b, (void **) &par_b); - HYPRE_SStructVectorGetObject(x, (void **) &par_x); - } - else if (object_type == HYPRE_STRUCT) - { - HYPRE_SStructMatrixGetObject(A, (void **) &sA); - HYPRE_SStructVectorGetObject(b, (void **) &sb); - HYPRE_SStructVectorGetObject(x, (void **) &sx); - } + hypre_EndTiming(time_index); + hypre_PrintTiming("SStruct Interface", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); - /*----------------------------------------------------------- - * Finish resetting the linear system - *-----------------------------------------------------------*/ + /*----------------------------------------------------------- + * Get the objects out + * NOTE: This should go after the cosine part, but for the bug + *-----------------------------------------------------------*/ - if (cosine) - { - /* This if/else is due to a bug in SStructMatvec */ - if (object_type == HYPRE_SSTRUCT) - { - /* Apply A to cosine vector to yield righthand side */ - hypre_SStructMatvec(1.0, A, x, 0.0, b); - /* Reset initial guess to zero */ - hypre_SStructMatvec(0.0, A, b, 0.0, x); - } - else if (object_type == HYPRE_PARCSR) + if (object_type == HYPRE_PARCSR) { - /* Apply A to cosine vector to yield righthand side */ - HYPRE_ParCSRMatrixMatvec(1.0, par_A, par_x, 0.0, par_b ); - /* Reset initial guess to zero */ - HYPRE_ParCSRMatrixMatvec(0.0, par_A, par_b, 0.0, par_x ); + HYPRE_SStructMatrixGetObject(A, (void **) &par_A); + HYPRE_SStructVectorGetObject(b, (void **) &par_b); + HYPRE_SStructVectorGetObject(x, (void **) &par_x); } else if (object_type == HYPRE_STRUCT) { - /* Apply A to cosine vector to yield righthand side */ - hypre_StructMatvec(1.0, sA, sx, 0.0, sb); - /* Reset initial guess to zero */ - hypre_StructMatvec(0.0, sA, sb, 0.0, sx); + HYPRE_SStructMatrixGetObject(A, (void **) &sA); + HYPRE_SStructVectorGetObject(b, (void **) &sb); + HYPRE_SStructVectorGetObject(x, (void **) &sx); } - } - - /*----------------------------------------------------------- - * Set up a gradient matrix G - *-----------------------------------------------------------*/ - - if (gradient_matrix) - { - HYPRE_SStructVariable vartypes[1] = {HYPRE_SSTRUCT_VARIABLE_NODE}; - HYPRE_Int offsets[3][2][3] = { {{0,0,0}, {-1,0,0}}, - {{0,0,0}, {0,-1,0}}, - {{0,0,0}, {0,0,-1}} }; - HYPRE_Real stencil_values[2] = {1.0, -1.0}; - /* Set up the domain grid */ + /*----------------------------------------------------------- + * Finish resetting the linear system + *-----------------------------------------------------------*/ - HYPRE_SStructGridCreate(hypre_MPI_COMM_WORLD, data.ndim, data.nparts, &G_grid); - for (part = 0; part < data.nparts; part++) + if (cosine) { - pdata = data.pdata[part]; - for (box = 0; box < pdata.nboxes; box++) + /* This if/else is due to a bug in SStructMatvec */ + if (object_type == HYPRE_SSTRUCT) { - HYPRE_SStructGridSetExtents(G_grid, part, - pdata.ilowers[box], pdata.iuppers[box]); + /* Apply A to cosine vector to yield righthand side */ + hypre_SStructMatvec(1.0, A, x, 0.0, b); + /* Reset initial guess to zero */ + hypre_SStructMatvec(0.0, A, b, 0.0, x); } - HYPRE_SStructGridSetVariables(G_grid, part, 1, vartypes); - for (box = 0; box < pdata.glue_nboxes; box++) + else if (object_type == HYPRE_PARCSR) { - if (pdata.glue_shared[box]) + /* Apply A to cosine vector to yield righthand side */ + HYPRE_ParCSRMatrixMatvec(1.0, par_A, par_x, 0.0, par_b ); + /* Reset initial guess to zero */ + HYPRE_ParCSRMatrixMatvec(0.0, par_A, par_b, 0.0, par_x ); + } + else if (object_type == HYPRE_STRUCT) + { + /* Apply A to cosine vector to yield righthand side */ + hypre_StructMatvec(1.0, sA, sx, 0.0, sb); + /* Reset initial guess to zero */ + hypre_StructMatvec(0.0, sA, sb, 0.0, sx); + } + } + + /*----------------------------------------------------------- + * Set up a gradient matrix G + *-----------------------------------------------------------*/ + + if (gradient_matrix) + { + HYPRE_SStructVariable vartypes[1] = {HYPRE_SSTRUCT_VARIABLE_NODE}; + HYPRE_Int offsets[3][2][3] = { {{0, 0, 0}, {-1, 0, 0}}, + {{0, 0, 0}, {0, -1, 0}}, + {{0, 0, 0}, {0, 0, -1}} + }; + HYPRE_Real stencil_values[2] = {1.0, -1.0}; + + /* Set up the domain grid */ + + HYPRE_SStructGridCreate(comm, data.ndim, data.nparts, &G_grid); + for (part = 0; part < data.nparts; part++) + { + pdata = data.pdata[part]; + for (box = 0; box < pdata.nboxes; box++) { - HYPRE_SStructGridSetSharedPart(G_grid, part, - pdata.glue_ilowers[box], - pdata.glue_iuppers[box], - pdata.glue_offsets[box], - pdata.glue_nbor_parts[box], - pdata.glue_nbor_ilowers[box], - pdata.glue_nbor_iuppers[box], - pdata.glue_nbor_offsets[box], - pdata.glue_index_maps[box], - pdata.glue_index_dirs[box]); + HYPRE_SStructGridSetExtents(G_grid, part, + pdata.ilowers[box], pdata.iuppers[box]); } - else + HYPRE_SStructGridSetVariables(G_grid, part, 1, vartypes); + for (box = 0; box < pdata.glue_nboxes; box++) { - HYPRE_SStructGridSetNeighborPart(G_grid, part, - pdata.glue_ilowers[box], - pdata.glue_iuppers[box], - pdata.glue_nbor_parts[box], - pdata.glue_nbor_ilowers[box], - pdata.glue_nbor_iuppers[box], - pdata.glue_index_maps[box], - pdata.glue_index_dirs[box]); + if (pdata.glue_shared[box]) + { + HYPRE_SStructGridSetSharedPart(G_grid, part, + pdata.glue_ilowers[box], + pdata.glue_iuppers[box], + pdata.glue_offsets[box], + pdata.glue_nbor_parts[box], + pdata.glue_nbor_ilowers[box], + pdata.glue_nbor_iuppers[box], + pdata.glue_nbor_offsets[box], + pdata.glue_index_maps[box], + pdata.glue_index_dirs[box]); + } + else + { + HYPRE_SStructGridSetNeighborPart(G_grid, part, + pdata.glue_ilowers[box], + pdata.glue_iuppers[box], + pdata.glue_nbor_parts[box], + pdata.glue_nbor_ilowers[box], + pdata.glue_nbor_iuppers[box], + pdata.glue_index_maps[box], + pdata.glue_index_dirs[box]); + } } } - } - HYPRE_SStructGridAssemble(G_grid); + HYPRE_SStructGridAssemble(G_grid); - /* Set up the gradient stencils */ + /* Set up the gradient stencils */ - G_stencils = hypre_CTAlloc(HYPRE_SStructStencil, data.ndim, HYPRE_MEMORY_HOST); - for (s = 0; s < data.ndim; s++) - { - HYPRE_SStructStencilCreate(data.ndim, 2, &G_stencils[s]); - for (entry = 0; entry < 2; entry++) + G_stencils = hypre_CTAlloc(HYPRE_SStructStencil, data.ndim, HYPRE_MEMORY_HOST); + for (s = 0; s < data.ndim; s++) { - HYPRE_SStructStencilSetEntry( - G_stencils[s], entry, offsets[s][entry], 0); + HYPRE_SStructStencilCreate(data.ndim, 2, &G_stencils[s]); + for (entry = 0; entry < 2; entry++) + { + HYPRE_SStructStencilSetEntry( + G_stencils[s], entry, offsets[s][entry], 0); + } } - } - /* Set up the gradient graph */ + /* Set up the gradient graph */ - HYPRE_SStructGraphCreate(hypre_MPI_COMM_WORLD, grid, &G_graph); - HYPRE_SStructGraphSetDomainGrid(G_graph, G_grid); - HYPRE_SStructGraphSetObjectType(G_graph, HYPRE_PARCSR); - for (part = 0; part < data.nparts; part++) - { - pdata = data.pdata[part]; - for (var = 0; var < data.ndim; var++) + HYPRE_SStructGraphCreate(comm, grid, &G_graph); + HYPRE_SStructGraphSetDomainGrid(G_graph, G_grid); + HYPRE_SStructGraphSetObjectType(G_graph, HYPRE_PARCSR); + for (part = 0; part < data.nparts; part++) { - HYPRE_SStructGraphSetStencil(G_graph, part, var, G_stencils[var]); + pdata = data.pdata[part]; + for (var = 0; var < data.ndim; var++) + { + HYPRE_SStructGraphSetStencil(G_graph, part, var, G_stencils[var]); + } } - } - HYPRE_SStructGraphAssemble(G_graph); + HYPRE_SStructGraphAssemble(G_graph); - /* Set up the matrix */ + /* Set up the matrix */ - HYPRE_SStructMatrixCreate(hypre_MPI_COMM_WORLD, G_graph, &G); - HYPRE_SStructMatrixSetObjectType(G, HYPRE_PARCSR); - HYPRE_SStructMatrixInitialize(G); - for (part = 0; part < data.nparts; part++) - { - pdata = data.pdata[part]; - for (var = 0; var < data.ndim; var++) + HYPRE_SStructMatrixCreate(comm, G_graph, &G); + HYPRE_SStructMatrixSetObjectType(G, HYPRE_PARCSR); + HYPRE_SStructMatrixInitialize(G); + for (part = 0; part < data.nparts; part++) { - for (i = 0; i < 2; i++) + pdata = data.pdata[part]; + for (var = 0; var < data.ndim; var++) { - for (j = 0; j < pdata.max_boxsize; j++) + for (i = 0; i < 2; i++) { - values[j] = stencil_values[i]; - } + for (j = 0; j < pdata.max_boxsize; j++) + { + values[j] = stencil_values[i]; + } - hypre_TMemcpy(d_values, values, HYPRE_Real, values_size, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); + hypre_TMemcpy(d_values, values, HYPRE_Real, values_size, memory_location, HYPRE_MEMORY_HOST); - for (box = 0; box < pdata.nboxes; box++) - { - GetVariableBox(pdata.ilowers[box], pdata.iuppers[box], - pdata.vartypes[var], ilower, iupper); - HYPRE_SStructMatrixSetBoxValues(G, part, ilower, iupper, - var, 1, &i, d_values); + for (box = 0; box < pdata.nboxes; box++) + { + GetVariableBox(pdata.ilowers[box], pdata.iuppers[box], + pdata.vartypes[var], ilower, iupper); + HYPRE_SStructMatrixSetBoxValues(G, part, ilower, iupper, + var, 1, &i, d_values); + } } } } - } - - HYPRE_SStructMatrixAssemble(G); - } - /*----------------------------------------------------------- - * Print out the system and initial guess - *-----------------------------------------------------------*/ + HYPRE_SStructMatrixAssemble(G); + } - if (print_system) - { - HYPRE_SStructVectorGather(b); - HYPRE_SStructVectorGather(x); - HYPRE_SStructMatrixPrint("sstruct.out.A", A, 0); - HYPRE_SStructVectorPrint("sstruct.out.b", b, 0); - HYPRE_SStructVectorPrint("sstruct.out.x0", x, 0); + /*----------------------------------------------------------- + * Print out the system and initial guess + *-----------------------------------------------------------*/ - if (gradient_matrix) + if (print_system) { - HYPRE_SStructMatrixPrint("sstruct.out.G", G, 0); + HYPRE_SStructVectorGather(b); + HYPRE_SStructVectorGather(x); + HYPRE_SStructMatrixPrint("sstruct.out.A", A, 0); + HYPRE_SStructVectorPrint("sstruct.out.b", b, 0); + HYPRE_SStructVectorPrint("sstruct.out.x0", x, 0); + + if (gradient_matrix) + { + HYPRE_SStructMatrixPrint("sstruct.out.G", G, 0); + } } - } - /*----------------------------------------------------------- - * Debugging code - *-----------------------------------------------------------*/ + /*----------------------------------------------------------- + * Debugging code + *-----------------------------------------------------------*/ #if DEBUG - { - FILE *file; - char filename[255]; + { + FILE *file; + char filename[255]; - /* result is 1's on the interior of the grid */ - hypre_SStructMatvec(1.0, A, b, 0.0, x); - HYPRE_SStructVectorPrint("sstruct.out.matvec", x, 0); + /* result is 1's on the interior of the grid */ + hypre_SStructMatvec(1.0, A, b, 0.0, x); + HYPRE_SStructVectorPrint("sstruct.out.matvec", x, 0); - /* result is all 1's */ - hypre_SStructCopy(b, x); - HYPRE_SStructVectorPrint("sstruct.out.copy", x, 0); + /* result is all 1's */ + hypre_SStructCopy(b, x); + HYPRE_SStructVectorPrint("sstruct.out.copy", x, 0); - /* result is all 2's */ - hypre_SStructScale(2.0, x); - HYPRE_SStructVectorPrint("sstruct.out.scale", x, 0); + /* result is all 2's */ + hypre_SStructScale(2.0, x); + HYPRE_SStructVectorPrint("sstruct.out.scale", x, 0); - /* result is all 0's */ - hypre_SStructAxpy(-2.0, b, x); - HYPRE_SStructVectorPrint("sstruct.out.axpy", x, 0); + /* result is all 0's */ + hypre_SStructAxpy(-2.0, b, x); + HYPRE_SStructVectorPrint("sstruct.out.axpy", x, 0); - /* result is 1's with 0's on some boundaries */ - hypre_SStructCopy(b, x); - hypre_sprintf(filename, "sstruct.out.gatherpre.%05d", myid); - file = fopen(filename, "w"); - for (part = 0; part < data.nparts; part++) - { - pdata = data.pdata[part]; - for (var = 0; var < pdata.nvars; var++) + /* result is 1's with 0's on some boundaries */ + hypre_SStructCopy(b, x); + hypre_sprintf(filename, "sstruct.out.gatherpre.%05d", myid); + file = fopen(filename, "w"); + for (part = 0; part < data.nparts; part++) { - for (box = 0; box < pdata.nboxes; box++) + pdata = data.pdata[part]; + for (var = 0; var < pdata.nvars; var++) { - GetVariableBox(pdata.ilowers[box], pdata.iuppers[box], - pdata.vartypes[var], ilower, iupper); - HYPRE_SStructVectorGetBoxValues(x, part, ilower, iupper, - var, values); - hypre_fprintf(file, "\nPart %d, var %d, box %d:\n", part, var, box); - for (i = 0; i < pdata.boxsizes[box]; i++) + for (box = 0; box < pdata.nboxes; box++) { - hypre_fprintf(file, "%e\n", values[i]); + GetVariableBox(pdata.ilowers[box], pdata.iuppers[box], + pdata.vartypes[var], ilower, iupper); + HYPRE_SStructVectorGetBoxValues(x, part, ilower, iupper, + var, values); + hypre_fprintf(file, "\nPart %d, var %d, box %d:\n", part, var, box); + for (i = 0; i < pdata.boxsizes[box]; i++) + { + hypre_fprintf(file, "%e\n", values[i]); + } } } } - } - fclose(file); + fclose(file); - /* result is all 1's */ - HYPRE_SStructVectorGather(x); - hypre_sprintf(filename, "sstruct.out.gatherpost.%05d", myid); - file = fopen(filename, "w"); - for (part = 0; part < data.nparts; part++) - { - pdata = data.pdata[part]; - for (var = 0; var < pdata.nvars; var++) + /* result is all 1's */ + HYPRE_SStructVectorGather(x); + hypre_sprintf(filename, "sstruct.out.gatherpost.%05d", myid); + file = fopen(filename, "w"); + for (part = 0; part < data.nparts; part++) { - for (box = 0; box < pdata.nboxes; box++) + pdata = data.pdata[part]; + for (var = 0; var < pdata.nvars; var++) { - GetVariableBox(pdata.ilowers[box], pdata.iuppers[box], - pdata.vartypes[var], ilower, iupper); - HYPRE_SStructVectorGetBoxValues(x, part, ilower, iupper, - var, values); - hypre_fprintf(file, "\nPart %d, var %d, box %d:\n", part, var, box); - for (i = 0; i < pdata.boxsizes[box]; i++) + for (box = 0; box < pdata.nboxes; box++) { - hypre_fprintf(file, "%e\n", values[i]); + GetVariableBox(pdata.ilowers[box], pdata.iuppers[box], + pdata.vartypes[var], ilower, iupper); + HYPRE_SStructVectorGetBoxValues(x, part, ilower, iupper, + var, values); + hypre_fprintf(file, "\nPart %d, var %d, box %d:\n", part, var, box); + for (i = 0; i < pdata.boxsizes[box]; i++) + { + hypre_fprintf(file, "%e\n", values[i]); + } } } } - } + fclose(file); - /* re-initializes x to 0 */ - hypre_SStructAxpy(-1.0, b, x); - } + /* re-initializes x to 0 */ + hypre_SStructAxpy(-1.0, b, x); + } #endif - hypre_TFree(values, HYPRE_MEMORY_HOST); - hypre_TFree(d_values, HYPRE_MEMORY_DEVICE); - - /*----------------------------------------------------------- - * Solve the system using SysPFMG or Split - *-----------------------------------------------------------*/ + hypre_TFree(values, HYPRE_MEMORY_HOST); + hypre_TFree(d_values, memory_location); - if (solver_id == 3) - { - time_index = hypre_InitializeTiming("SysPFMG Setup"); - hypre_BeginTiming(time_index); + /*----------------------------------------------------------- + * Solve the system using SysPFMG or Split + *-----------------------------------------------------------*/ - HYPRE_SStructSysPFMGCreate(hypre_MPI_COMM_WORLD, &solver); - HYPRE_SStructSysPFMGSetMaxIter(solver, 100); - HYPRE_SStructSysPFMGSetTol(solver, tol); - HYPRE_SStructSysPFMGSetRelChange(solver, 0); - /* weighted Jacobi = 1; red-black GS = 2 */ - HYPRE_SStructSysPFMGSetRelaxType(solver, relax); - if (usr_jacobi_weight) + if (solver_id == 3) { - HYPRE_SStructSysPFMGSetJacobiWeight(solver, jacobi_weight); - } - HYPRE_SStructSysPFMGSetNumPreRelax(solver, n_pre); - HYPRE_SStructSysPFMGSetNumPostRelax(solver, n_post); - HYPRE_SStructSysPFMGSetSkipRelax(solver, skip); - /*HYPRE_StructPFMGSetDxyz(solver, dxyz);*/ - HYPRE_SStructSysPFMGSetPrintLevel(solver, 1); - HYPRE_SStructSysPFMGSetLogging(solver, 1); - HYPRE_SStructSysPFMGSetup(solver, A, b, x); - - hypre_EndTiming(time_index); - hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + time_index = hypre_InitializeTiming("SysPFMG Setup"); + hypre_BeginTiming(time_index); - time_index = hypre_InitializeTiming("SysPFMG Solve"); - hypre_BeginTiming(time_index); + HYPRE_SStructSysPFMGCreate(comm, &solver); + HYPRE_SStructSysPFMGSetMaxIter(solver, 100); + HYPRE_SStructSysPFMGSetTol(solver, tol); + HYPRE_SStructSysPFMGSetRelChange(solver, 0); + /* weighted Jacobi = 1; red-black GS = 2 */ + HYPRE_SStructSysPFMGSetRelaxType(solver, relax); + if (usr_jacobi_weight) + { + HYPRE_SStructSysPFMGSetJacobiWeight(solver, jacobi_weight); + } + HYPRE_SStructSysPFMGSetNumPreRelax(solver, n_pre); + HYPRE_SStructSysPFMGSetNumPostRelax(solver, n_post); + HYPRE_SStructSysPFMGSetSkipRelax(solver, skip); + /*HYPRE_StructPFMGSetDxyz(solver, dxyz);*/ + HYPRE_SStructSysPFMGSetPrintLevel(solver, prec_print_level); + HYPRE_SStructSysPFMGSetLogging(solver, 1); + HYPRE_SStructSysPFMGSetup(solver, A, b, x); - HYPRE_SStructSysPFMGSolve(solver, A, b, x); + hypre_EndTiming(time_index); + hypre_PrintTiming("Setup phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); - hypre_EndTiming(time_index); - hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + time_index = hypre_InitializeTiming("SysPFMG Solve"); + hypre_BeginTiming(time_index); - HYPRE_SStructSysPFMGGetNumIterations(solver, &num_iterations); - HYPRE_SStructSysPFMGGetFinalRelativeResidualNorm(solver, &final_res_norm); + HYPRE_SStructSysPFMGSolve(solver, A, b, x); - HYPRE_SStructSysPFMGDestroy(solver); - } + hypre_EndTiming(time_index); + hypre_PrintTiming("Solve phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); - else if ((solver_id >= 0) && (solver_id < 10) && (solver_id != 3)) - { - time_index = hypre_InitializeTiming("Split Setup"); - hypre_BeginTiming(time_index); + HYPRE_SStructSysPFMGGetNumIterations(solver, &num_iterations); + HYPRE_SStructSysPFMGGetFinalRelativeResidualNorm(solver, &final_res_norm); - HYPRE_SStructSplitCreate(hypre_MPI_COMM_WORLD, &solver); - HYPRE_SStructSplitSetMaxIter(solver, 100); - HYPRE_SStructSplitSetTol(solver, tol); - if (solver_id == 0) - { - HYPRE_SStructSplitSetStructSolver(solver, HYPRE_SMG); - } - else if (solver_id == 1) - { - HYPRE_SStructSplitSetStructSolver(solver, HYPRE_PFMG); + HYPRE_SStructSysPFMGDestroy(solver); } - else if (solver_id == 8) - { - HYPRE_SStructSplitSetStructSolver(solver, HYPRE_Jacobi); - } - HYPRE_SStructSplitSetup(solver, A, b, x); - - hypre_EndTiming(time_index); - hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); - - time_index = hypre_InitializeTiming("Split Solve"); - hypre_BeginTiming(time_index); - - HYPRE_SStructSplitSolve(solver, A, b, x); - - hypre_EndTiming(time_index); - hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); - - HYPRE_SStructSplitGetNumIterations(solver, &num_iterations); - HYPRE_SStructSplitGetFinalRelativeResidualNorm(solver, &final_res_norm); - - HYPRE_SStructSplitDestroy(solver); - } - /*----------------------------------------------------------- - * Solve the system using PCG - *-----------------------------------------------------------*/ - - if ((solver_id >= 10) && (solver_id < 20)) - { - time_index = hypre_InitializeTiming("PCG Setup"); - hypre_BeginTiming(time_index); - - HYPRE_SStructPCGCreate(hypre_MPI_COMM_WORLD, &solver); - HYPRE_PCGSetMaxIter( (HYPRE_Solver) solver, 100 ); - HYPRE_PCGSetTol( (HYPRE_Solver) solver, tol ); - HYPRE_PCGSetTwoNorm( (HYPRE_Solver) solver, 1 ); - HYPRE_PCGSetRelChange( (HYPRE_Solver) solver, 0 ); - HYPRE_PCGSetPrintLevel( (HYPRE_Solver) solver, 1 ); - HYPRE_PCGSetRecomputeResidual( (HYPRE_Solver) solver, recompute_res); - - if ((solver_id == 10) || (solver_id == 11)) + else if ((solver_id >= 0) && (solver_id < 10) && (solver_id != 3)) { - /* use Split solver as preconditioner */ - HYPRE_SStructSplitCreate(hypre_MPI_COMM_WORLD, &precond); - HYPRE_SStructSplitSetMaxIter(precond, 1); - HYPRE_SStructSplitSetTol(precond, 0.0); - HYPRE_SStructSplitSetZeroGuess(precond); - if (solver_id == 10) + time_index = hypre_InitializeTiming("Split Setup"); + hypre_BeginTiming(time_index); + + HYPRE_SStructSplitCreate(comm, &solver); + HYPRE_SStructSplitSetMaxIter(solver, 100); + HYPRE_SStructSplitSetTol(solver, tol); + if (solver_id == 0) { - HYPRE_SStructSplitSetStructSolver(precond, HYPRE_SMG); + HYPRE_SStructSplitSetStructSolver(solver, HYPRE_SMG); } - else if (solver_id == 11) + else if (solver_id == 1) { - HYPRE_SStructSplitSetStructSolver(precond, HYPRE_PFMG); + HYPRE_SStructSplitSetStructSolver(solver, HYPRE_PFMG); } - HYPRE_PCGSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_SStructSplitSolve, - (HYPRE_PtrToSolverFcn) HYPRE_SStructSplitSetup, - (HYPRE_Solver) precond); - } - - else if (solver_id == 13) - { - /* use SysPFMG solver as preconditioner */ - HYPRE_SStructSysPFMGCreate(hypre_MPI_COMM_WORLD, &precond); - HYPRE_SStructSysPFMGSetMaxIter(precond, 1); - HYPRE_SStructSysPFMGSetTol(precond, 0.0); - HYPRE_SStructSysPFMGSetZeroGuess(precond); - /* weighted Jacobi = 1; red-black GS = 2 */ - HYPRE_SStructSysPFMGSetRelaxType(precond, relax); - if (usr_jacobi_weight) + else if (solver_id == 8) { - HYPRE_SStructSysPFMGSetJacobiWeight(precond, jacobi_weight); + HYPRE_SStructSplitSetStructSolver(solver, HYPRE_Jacobi); } - HYPRE_SStructSysPFMGSetNumPreRelax(precond, n_pre); - HYPRE_SStructSysPFMGSetNumPostRelax(precond, n_post); - HYPRE_SStructSysPFMGSetSkipRelax(precond, skip); - /*HYPRE_StructPFMGSetDxyz(precond, dxyz);*/ - HYPRE_PCGSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_SStructSysPFMGSolve, - (HYPRE_PtrToSolverFcn) HYPRE_SStructSysPFMGSetup, - (HYPRE_Solver) precond); - - } - else if (solver_id == 18) - { - /* use diagonal scaling as preconditioner */ - precond = NULL; - HYPRE_PCGSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_SStructDiagScale, - (HYPRE_PtrToSolverFcn) HYPRE_SStructDiagScaleSetup, - (HYPRE_Solver) precond); - } + HYPRE_SStructSplitSetup(solver, A, b, x); - HYPRE_PCGSetup( (HYPRE_Solver) solver, (HYPRE_Matrix) A, - (HYPRE_Vector) b, (HYPRE_Vector) x); - - hypre_EndTiming(time_index); - hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + hypre_EndTiming(time_index); + hypre_PrintTiming("Setup phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); - time_index = hypre_InitializeTiming("PCG Solve"); - hypre_BeginTiming(time_index); + time_index = hypre_InitializeTiming("Split Solve"); + hypre_BeginTiming(time_index); - HYPRE_PCGSolve( (HYPRE_Solver) solver, (HYPRE_Matrix) A, - (HYPRE_Vector) b, (HYPRE_Vector) x); + HYPRE_SStructSplitSolve(solver, A, b, x); - hypre_EndTiming(time_index); - hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + hypre_EndTiming(time_index); + hypre_PrintTiming("Solve phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); - HYPRE_PCGGetNumIterations( (HYPRE_Solver) solver, &num_iterations ); - HYPRE_PCGGetFinalRelativeResidualNorm( (HYPRE_Solver) solver, &final_res_norm ); - HYPRE_SStructPCGDestroy(solver); + HYPRE_SStructSplitGetNumIterations(solver, &num_iterations); + HYPRE_SStructSplitGetFinalRelativeResidualNorm(solver, &final_res_norm); - if ((solver_id == 10) || (solver_id == 11)) - { - HYPRE_SStructSplitDestroy(precond); - } - else if (solver_id == 13) - { - HYPRE_SStructSysPFMGDestroy(precond); + HYPRE_SStructSplitDestroy(solver); } - } - - /* begin lobpcg */ - - /*----------------------------------------------------------- - * Solve the eigenvalue problem using LOBPCG - *-----------------------------------------------------------*/ - - if ( lobpcgFlag && ( solver_id < 10 || solver_id >= 20 ) && verbosity ) - hypre_printf("\nLOBPCG works with solvers 10, 11, 13 and 18 only\n"); - - if ( lobpcgFlag && (solver_id >= 10) && (solver_id < 20) ) { - interpreter = hypre_CTAlloc(mv_InterfaceInterpreter, 1, HYPRE_MEMORY_HOST); - - HYPRE_SStructSetupInterpreter( interpreter ); - HYPRE_SStructSetupMatvec(&matvec_fn); - - if (myid != 0) - verbosity = 0; - - if ( pcgIterations > 0 ) { + /*----------------------------------------------------------- + * Solve the system using PCG + *-----------------------------------------------------------*/ + if ((solver_id >= 10) && (solver_id < 20)) + { time_index = hypre_InitializeTiming("PCG Setup"); hypre_BeginTiming(time_index); - HYPRE_SStructPCGCreate(hypre_MPI_COMM_WORLD, &solver); - HYPRE_PCGSetMaxIter( (HYPRE_Solver) solver, pcgIterations ); - HYPRE_PCGSetTol( (HYPRE_Solver) solver, pcgTol ); + HYPRE_SStructPCGCreate(comm, &solver); + HYPRE_PCGSetMaxIter( (HYPRE_Solver) solver, 100 ); + HYPRE_PCGSetTol( (HYPRE_Solver) solver, tol ); HYPRE_PCGSetTwoNorm( (HYPRE_Solver) solver, 1 ); HYPRE_PCGSetRelChange( (HYPRE_Solver) solver, 0 ); - HYPRE_PCGSetPrintLevel( (HYPRE_Solver) solver, 0 ); + HYPRE_PCGSetPrintLevel( (HYPRE_Solver) solver, solver_print_level ); + HYPRE_PCGSetRecomputeResidual( (HYPRE_Solver) solver, recompute_res); if ((solver_id == 10) || (solver_id == 11)) { /* use Split solver as preconditioner */ - HYPRE_SStructSplitCreate(hypre_MPI_COMM_WORLD, &precond); + HYPRE_SStructSplitCreate(comm, &precond); HYPRE_SStructSplitSetMaxIter(precond, 1); HYPRE_SStructSplitSetTol(precond, 0.0); HYPRE_SStructSplitSetZeroGuess(precond); @@ -3988,12 +4144,16 @@ main( hypre_int argc, else if (solver_id == 13) { /* use SysPFMG solver as preconditioner */ - HYPRE_SStructSysPFMGCreate(hypre_MPI_COMM_WORLD, &precond); + HYPRE_SStructSysPFMGCreate(comm, &precond); HYPRE_SStructSysPFMGSetMaxIter(precond, 1); HYPRE_SStructSysPFMGSetTol(precond, 0.0); HYPRE_SStructSysPFMGSetZeroGuess(precond); /* weighted Jacobi = 1; red-black GS = 2 */ - HYPRE_SStructSysPFMGSetRelaxType(precond, 1); + HYPRE_SStructSysPFMGSetRelaxType(precond, relax); + if (usr_jacobi_weight) + { + HYPRE_SStructSysPFMGSetJacobiWeight(precond, jacobi_weight); + } HYPRE_SStructSysPFMGSetNumPreRelax(precond, n_pre); HYPRE_SStructSysPFMGSetNumPostRelax(precond, n_post); HYPRE_SStructSysPFMGSetSkipRelax(precond, skip); @@ -4013,114 +4173,29 @@ main( hypre_int argc, (HYPRE_PtrToSolverFcn) HYPRE_SStructDiagScaleSetup, (HYPRE_Solver) precond); } - else if (solver_id != NO_SOLVER ) - { - if ( verbosity ) - hypre_printf("Solver ID not recognized - running inner PCG iterations without preconditioner\n\n"); - } + HYPRE_PCGSetup( (HYPRE_Solver) solver, (HYPRE_Matrix) A, + (HYPRE_Vector) b, (HYPRE_Vector) x); hypre_EndTiming(time_index); - hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); + hypre_PrintTiming("Setup phase times", comm); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); - HYPRE_LOBPCGCreate(interpreter, &matvec_fn, (HYPRE_Solver*)&lobpcg_solver); - HYPRE_LOBPCGSetMaxIter((HYPRE_Solver)lobpcg_solver, maxIterations); - HYPRE_LOBPCGSetPrecondUsageMode((HYPRE_Solver)lobpcg_solver, pcgMode); - HYPRE_LOBPCGSetTol((HYPRE_Solver)lobpcg_solver, tol); - HYPRE_LOBPCGSetPrintLevel((HYPRE_Solver)lobpcg_solver, verbosity); - - HYPRE_LOBPCGSetPrecond((HYPRE_Solver)lobpcg_solver, - (HYPRE_PtrToSolverFcn) HYPRE_PCGSolve, - (HYPRE_PtrToSolverFcn) HYPRE_PCGSetup, - (HYPRE_Solver)solver); - - HYPRE_LOBPCGSetup((HYPRE_Solver)lobpcg_solver, (HYPRE_Matrix)A, - (HYPRE_Vector)b, (HYPRE_Vector)x); - - eigenvectors = mv_MultiVectorCreateFromSampleVector( interpreter, - blockSize, - x ); - eigenvalues = hypre_CTAlloc(HYPRE_Real, blockSize, HYPRE_MEMORY_HOST); - - if ( lobpcgSeed ) - mv_MultiVectorSetRandom( eigenvectors, lobpcgSeed ); - else - mv_MultiVectorSetRandom( eigenvectors, (HYPRE_Int)time(0) ); - time_index = hypre_InitializeTiming("PCG Solve"); hypre_BeginTiming(time_index); - HYPRE_LOBPCGSolve((HYPRE_Solver)lobpcg_solver, constrains, - eigenvectors, eigenvalues ); + HYPRE_PCGSolve( (HYPRE_Solver) solver, (HYPRE_Matrix) A, + (HYPRE_Vector) b, (HYPRE_Vector) x); hypre_EndTiming(time_index); - hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); + hypre_PrintTiming("Solve phase times", comm); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); - if ( checkOrtho ) { - - gramXX = utilities_FortranMatrixCreate(); - identity = utilities_FortranMatrixCreate(); - - utilities_FortranMatrixAllocateData( blockSize, blockSize, gramXX ); - utilities_FortranMatrixAllocateData( blockSize, blockSize, identity ); - - lobpcg_MultiVectorByMultiVector( eigenvectors, eigenvectors, gramXX ); - utilities_FortranMatrixSetToIdentity( identity ); - utilities_FortranMatrixAdd( -1, identity, gramXX, gramXX ); - nonOrthF = utilities_FortranMatrixFNorm( gramXX ); - if ( myid == 0 ) - hypre_printf("Non-orthonormality of eigenvectors: %12.5e\n", nonOrthF); - - utilities_FortranMatrixDestroy( gramXX ); - utilities_FortranMatrixDestroy( identity ); - - } - - if ( printLevel ) { - - if ( myid == 0 ) { - if ( (filePtr = fopen("values.txt", "w")) ) { - hypre_fprintf(filePtr, "%d\n", blockSize); - for ( i = 0; i < blockSize; i++ ) - hypre_fprintf(filePtr, "%22.14e\n", eigenvalues[i]); - fclose(filePtr); - } - - if ( (filePtr = fopen("residuals.txt", "w")) ) { - residualNorms = HYPRE_LOBPCGResidualNorms( (HYPRE_Solver)lobpcg_solver ); - residuals = utilities_FortranMatrixValues( residualNorms ); - hypre_fprintf(filePtr, "%d\n", blockSize); - for ( i = 0; i < blockSize; i++ ) - hypre_fprintf(filePtr, "%22.14e\n", residuals[i]); - fclose(filePtr); - } - - if ( printLevel > 1 ) { - - printBuffer = utilities_FortranMatrixCreate(); - - iterations = HYPRE_LOBPCGIterations( (HYPRE_Solver)lobpcg_solver ); - - eigenvaluesHistory = HYPRE_LOBPCGEigenvaluesHistory( (HYPRE_Solver)lobpcg_solver ); - utilities_FortranMatrixSelectBlock( eigenvaluesHistory, - 1, blockSize, 1, iterations + 1, printBuffer ); - utilities_FortranMatrixPrint( printBuffer, "val_hist.txt" ); - - residualNormsHistory = HYPRE_LOBPCGResidualNormsHistory( (HYPRE_Solver)lobpcg_solver ); - utilities_FortranMatrixSelectBlock(residualNormsHistory, - 1, blockSize, 1, iterations + 1, printBuffer ); - utilities_FortranMatrixPrint( printBuffer, "res_hist.txt" ); - - utilities_FortranMatrixDestroy( printBuffer ); - } - } - } - - HYPRE_SStructPCGDestroy(solver); + HYPRE_PCGGetNumIterations( (HYPRE_Solver) solver, &num_iterations ); + HYPRE_PCGGetFinalRelativeResidualNorm( (HYPRE_Solver) solver, &final_res_norm ); + HYPRE_SStructPCGDestroy(solver); if ((solver_id == 10) || (solver_id == 11)) { @@ -4130,1858 +4205,2115 @@ main( hypre_int argc, { HYPRE_SStructSysPFMGDestroy(precond); } + } + + /* begin lobpcg */ - HYPRE_LOBPCGDestroy((HYPRE_Solver)lobpcg_solver); - mv_MultiVectorDestroy( eigenvectors ); - hypre_TFree(eigenvalues, HYPRE_MEMORY_HOST); + /*----------------------------------------------------------- + * Solve the eigenvalue problem using LOBPCG + *-----------------------------------------------------------*/ + + if ( lobpcgFlag && ( solver_id < 10 || solver_id >= 20 ) && verbosity ) + { + hypre_printf("\nLOBPCG works with solvers 10, 11, 13 and 18 only\n"); } - else { - time_index = hypre_InitializeTiming("LOBPCG Setup"); - hypre_BeginTiming(time_index); + if ( lobpcgFlag && (solver_id >= 10) && (solver_id < 20) ) + { - HYPRE_LOBPCGCreate(interpreter, &matvec_fn, (HYPRE_Solver*)&solver); - HYPRE_LOBPCGSetMaxIter( (HYPRE_Solver) solver, maxIterations ); - HYPRE_LOBPCGSetTol( (HYPRE_Solver) solver, tol ); - HYPRE_LOBPCGSetPrintLevel( (HYPRE_Solver) solver, verbosity ); + interpreter = hypre_CTAlloc(mv_InterfaceInterpreter, 1, HYPRE_MEMORY_HOST); - if ((solver_id == 10) || (solver_id == 11)) + HYPRE_SStructSetupInterpreter( interpreter ); + HYPRE_SStructSetupMatvec(&matvec_fn); + + if (myid != 0) { - /* use Split solver as preconditioner */ - HYPRE_SStructSplitCreate(hypre_MPI_COMM_WORLD, &precond); - HYPRE_SStructSplitSetMaxIter(precond, 1); - HYPRE_SStructSplitSetTol(precond, 0.0); - HYPRE_SStructSplitSetZeroGuess(precond); - if (solver_id == 10) - { - HYPRE_SStructSplitSetStructSolver(precond, HYPRE_SMG); - } - else if (solver_id == 11) + verbosity = 0; + } + + if ( pcgIterations > 0 ) + { + + time_index = hypre_InitializeTiming("PCG Setup"); + hypre_BeginTiming(time_index); + + HYPRE_SStructPCGCreate(comm, &solver); + HYPRE_PCGSetMaxIter( (HYPRE_Solver) solver, pcgIterations ); + HYPRE_PCGSetTol( (HYPRE_Solver) solver, pcgTol ); + HYPRE_PCGSetTwoNorm( (HYPRE_Solver) solver, 1 ); + HYPRE_PCGSetRelChange( (HYPRE_Solver) solver, 0 ); + HYPRE_PCGSetPrintLevel( (HYPRE_Solver) solver, solver_print_level ); + + if ((solver_id == 10) || (solver_id == 11)) { - HYPRE_SStructSplitSetStructSolver(precond, HYPRE_PFMG); - } - HYPRE_LOBPCGSetPrecond( (HYPRE_Solver) solver, + /* use Split solver as preconditioner */ + HYPRE_SStructSplitCreate(comm, &precond); + HYPRE_SStructSplitSetMaxIter(precond, 1); + HYPRE_SStructSplitSetTol(precond, 0.0); + HYPRE_SStructSplitSetZeroGuess(precond); + if (solver_id == 10) + { + HYPRE_SStructSplitSetStructSolver(precond, HYPRE_SMG); + } + else if (solver_id == 11) + { + HYPRE_SStructSplitSetStructSolver(precond, HYPRE_PFMG); + } + HYPRE_PCGSetPrecond( (HYPRE_Solver) solver, (HYPRE_PtrToSolverFcn) HYPRE_SStructSplitSolve, (HYPRE_PtrToSolverFcn) HYPRE_SStructSplitSetup, (HYPRE_Solver) precond); - } + } - else if (solver_id == 13) - { - /* use SysPFMG solver as preconditioner */ - HYPRE_SStructSysPFMGCreate(hypre_MPI_COMM_WORLD, &precond); - HYPRE_SStructSysPFMGSetMaxIter(precond, 1); - HYPRE_SStructSysPFMGSetTol(precond, 0.0); - HYPRE_SStructSysPFMGSetZeroGuess(precond); - /* weighted Jacobi = 1; red-black GS = 2 */ - HYPRE_SStructSysPFMGSetRelaxType(precond, 1); - HYPRE_SStructSysPFMGSetNumPreRelax(precond, n_pre); - HYPRE_SStructSysPFMGSetNumPostRelax(precond, n_post); - HYPRE_SStructSysPFMGSetSkipRelax(precond, skip); - /*HYPRE_StructPFMGSetDxyz(precond, dxyz);*/ - HYPRE_LOBPCGSetPrecond( (HYPRE_Solver) solver, + else if (solver_id == 13) + { + /* use SysPFMG solver as preconditioner */ + HYPRE_SStructSysPFMGCreate(comm, &precond); + HYPRE_SStructSysPFMGSetMaxIter(precond, 1); + HYPRE_SStructSysPFMGSetTol(precond, 0.0); + HYPRE_SStructSysPFMGSetZeroGuess(precond); + /* weighted Jacobi = 1; red-black GS = 2 */ + HYPRE_SStructSysPFMGSetRelaxType(precond, 1); + HYPRE_SStructSysPFMGSetNumPreRelax(precond, n_pre); + HYPRE_SStructSysPFMGSetNumPostRelax(precond, n_post); + HYPRE_SStructSysPFMGSetSkipRelax(precond, skip); + /*HYPRE_StructPFMGSetDxyz(precond, dxyz);*/ + HYPRE_PCGSetPrecond( (HYPRE_Solver) solver, (HYPRE_PtrToSolverFcn) HYPRE_SStructSysPFMGSolve, (HYPRE_PtrToSolverFcn) HYPRE_SStructSysPFMGSetup, (HYPRE_Solver) precond); - } - else if (solver_id == 18) - { - /* use diagonal scaling as preconditioner */ - precond = NULL; - HYPRE_LOBPCGSetPrecond( (HYPRE_Solver) solver, + } + else if (solver_id == 18) + { + /* use diagonal scaling as preconditioner */ + precond = NULL; + HYPRE_PCGSetPrecond( (HYPRE_Solver) solver, (HYPRE_PtrToSolverFcn) HYPRE_SStructDiagScale, (HYPRE_PtrToSolverFcn) HYPRE_SStructDiagScaleSetup, (HYPRE_Solver) precond); - } - else if (solver_id != NO_SOLVER ) - { - if ( verbosity ) - hypre_printf("Solver ID not recognized - running LOBPCG without preconditioner\n\n"); - } - - HYPRE_LOBPCGSetup( (HYPRE_Solver) solver, (HYPRE_Matrix) A, - (HYPRE_Vector) b, (HYPRE_Vector) x); + } + else if (solver_id != NO_SOLVER ) + { + if ( verbosity ) + { + hypre_printf("Solver ID not recognized - running inner PCG iterations without preconditioner\n\n"); + } + } - hypre_EndTiming(time_index); - hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); - eigenvectors = mv_MultiVectorCreateFromSampleVector( interpreter, - blockSize, - x ); - eigenvalues = hypre_CTAlloc(HYPRE_Real, blockSize, HYPRE_MEMORY_HOST); + hypre_EndTiming(time_index); + hypre_PrintTiming("Setup phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); - if ( lobpcgSeed ) - mv_MultiVectorSetRandom( eigenvectors, lobpcgSeed ); - else - mv_MultiVectorSetRandom( eigenvectors, (HYPRE_Int)time(0) ); + HYPRE_LOBPCGCreate(interpreter, &matvec_fn, (HYPRE_Solver*)&lobpcg_solver); + HYPRE_LOBPCGSetMaxIter((HYPRE_Solver)lobpcg_solver, maxIterations); + HYPRE_LOBPCGSetPrecondUsageMode((HYPRE_Solver)lobpcg_solver, pcgMode); + HYPRE_LOBPCGSetTol((HYPRE_Solver)lobpcg_solver, tol); + HYPRE_LOBPCGSetPrintLevel((HYPRE_Solver)lobpcg_solver, verbosity); - time_index = hypre_InitializeTiming("LOBPCG Solve"); - hypre_BeginTiming(time_index); + HYPRE_LOBPCGSetPrecond((HYPRE_Solver)lobpcg_solver, + (HYPRE_PtrToSolverFcn) HYPRE_PCGSolve, + (HYPRE_PtrToSolverFcn) HYPRE_PCGSetup, + (HYPRE_Solver)solver); - HYPRE_LOBPCGSolve - ( (HYPRE_Solver) solver, constrains, eigenvectors, eigenvalues ); + HYPRE_LOBPCGSetup((HYPRE_Solver)lobpcg_solver, (HYPRE_Matrix)A, + (HYPRE_Vector)b, (HYPRE_Vector)x); - hypre_EndTiming(time_index); - hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + eigenvectors = mv_MultiVectorCreateFromSampleVector( interpreter, + blockSize, + x ); + eigenvalues = hypre_CTAlloc(HYPRE_Real, blockSize, HYPRE_MEMORY_HOST); - if ( checkOrtho ) { + if ( lobpcgSeed ) + { + mv_MultiVectorSetRandom( eigenvectors, lobpcgSeed ); + } + else + { + mv_MultiVectorSetRandom( eigenvectors, (HYPRE_Int)time(0) ); + } - gramXX = utilities_FortranMatrixCreate(); - identity = utilities_FortranMatrixCreate(); + time_index = hypre_InitializeTiming("PCG Solve"); + hypre_BeginTiming(time_index); - utilities_FortranMatrixAllocateData( blockSize, blockSize, gramXX ); - utilities_FortranMatrixAllocateData( blockSize, blockSize, identity ); + HYPRE_LOBPCGSolve((HYPRE_Solver)lobpcg_solver, constrains, + eigenvectors, eigenvalues ); - lobpcg_MultiVectorByMultiVector( eigenvectors, eigenvectors, gramXX ); - utilities_FortranMatrixSetToIdentity( identity ); - utilities_FortranMatrixAdd( -1, identity, gramXX, gramXX ); - nonOrthF = utilities_FortranMatrixFNorm( gramXX ); - if ( myid == 0 ) - hypre_printf("Non-orthonormality of eigenvectors: %12.5e\n", nonOrthF); + hypre_EndTiming(time_index); + hypre_PrintTiming("Solve phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); - utilities_FortranMatrixDestroy( gramXX ); - utilities_FortranMatrixDestroy( identity ); + if ( checkOrtho ) + { - } + gramXX = utilities_FortranMatrixCreate(); + identity = utilities_FortranMatrixCreate(); - if ( printLevel ) { + utilities_FortranMatrixAllocateData( blockSize, blockSize, gramXX ); + utilities_FortranMatrixAllocateData( blockSize, blockSize, identity ); - if ( myid == 0 ) { - if ( (filePtr = fopen("values.txt", "w")) ) { - hypre_fprintf(filePtr, "%d\n", blockSize); - for ( i = 0; i < blockSize; i++ ) - hypre_fprintf(filePtr, "%22.14e\n", eigenvalues[i]); - fclose(filePtr); + lobpcg_MultiVectorByMultiVector( eigenvectors, eigenvectors, gramXX ); + utilities_FortranMatrixSetToIdentity( identity ); + utilities_FortranMatrixAdd( -1, identity, gramXX, gramXX ); + nonOrthF = utilities_FortranMatrixFNorm( gramXX ); + if ( myid == 0 ) + { + hypre_printf("Non-orthonormality of eigenvectors: %12.5e\n", nonOrthF); } - if ( (filePtr = fopen("residuals.txt", "w")) ) { - residualNorms = HYPRE_LOBPCGResidualNorms( (HYPRE_Solver)solver ); - residuals = utilities_FortranMatrixValues( residualNorms ); - hypre_fprintf(filePtr, "%d\n", blockSize); - for ( i = 0; i < blockSize; i++ ) - hypre_fprintf(filePtr, "%22.14e\n", residuals[i]); - fclose(filePtr); - } + utilities_FortranMatrixDestroy( gramXX ); + utilities_FortranMatrixDestroy( identity ); + + } + + if ( printLevel ) + { + + if ( myid == 0 ) + { + if ( (filePtr = fopen("values.txt", "w")) ) + { + hypre_fprintf(filePtr, "%d\n", blockSize); + for ( i = 0; i < blockSize; i++ ) + { + hypre_fprintf(filePtr, "%22.14e\n", eigenvalues[i]); + } + fclose(filePtr); + } + + if ( (filePtr = fopen("residuals.txt", "w")) ) + { + residualNorms = HYPRE_LOBPCGResidualNorms( (HYPRE_Solver)lobpcg_solver ); + residuals = utilities_FortranMatrixValues( residualNorms ); + hypre_fprintf(filePtr, "%d\n", blockSize); + for ( i = 0; i < blockSize; i++ ) + { + hypre_fprintf(filePtr, "%22.14e\n", residuals[i]); + } + fclose(filePtr); + } - if ( printLevel > 1 ) { + if ( printLevel > 1 ) + { - printBuffer = utilities_FortranMatrixCreate(); + printBuffer = utilities_FortranMatrixCreate(); - iterations = HYPRE_LOBPCGIterations( (HYPRE_Solver)solver ); + iterations = HYPRE_LOBPCGIterations( (HYPRE_Solver)lobpcg_solver ); - eigenvaluesHistory = HYPRE_LOBPCGEigenvaluesHistory( (HYPRE_Solver)solver ); - utilities_FortranMatrixSelectBlock( eigenvaluesHistory, - 1, blockSize, 1, iterations + 1, printBuffer ); - utilities_FortranMatrixPrint( printBuffer, "val_hist.txt" ); + eigenvaluesHistory = HYPRE_LOBPCGEigenvaluesHistory( (HYPRE_Solver)lobpcg_solver ); + utilities_FortranMatrixSelectBlock( eigenvaluesHistory, + 1, blockSize, 1, iterations + 1, printBuffer ); + utilities_FortranMatrixPrint( printBuffer, "val_hist.txt" ); - residualNormsHistory = HYPRE_LOBPCGResidualNormsHistory( (HYPRE_Solver)solver ); - utilities_FortranMatrixSelectBlock(residualNormsHistory, - 1, blockSize, 1, iterations + 1, printBuffer ); - utilities_FortranMatrixPrint( printBuffer, "res_hist.txt" ); + residualNormsHistory = HYPRE_LOBPCGResidualNormsHistory( (HYPRE_Solver)lobpcg_solver ); + utilities_FortranMatrixSelectBlock(residualNormsHistory, + 1, blockSize, 1, iterations + 1, printBuffer ); + utilities_FortranMatrixPrint( printBuffer, "res_hist.txt" ); - utilities_FortranMatrixDestroy( printBuffer ); + utilities_FortranMatrixDestroy( printBuffer ); + } } } - } - HYPRE_LOBPCGDestroy((HYPRE_Solver)solver); + HYPRE_SStructPCGDestroy(solver); - if ((solver_id == 10) || (solver_id == 11)) - { - HYPRE_SStructSplitDestroy(precond); + if ((solver_id == 10) || (solver_id == 11)) + { + HYPRE_SStructSplitDestroy(precond); + } + else if (solver_id == 13) + { + HYPRE_SStructSysPFMGDestroy(precond); + } + + HYPRE_LOBPCGDestroy((HYPRE_Solver)lobpcg_solver); + mv_MultiVectorDestroy( eigenvectors ); + hypre_TFree(eigenvalues, HYPRE_MEMORY_HOST); } - else if (solver_id == 13) + else { - HYPRE_SStructSysPFMGDestroy(precond); - } - mv_MultiVectorDestroy( eigenvectors ); - hypre_TFree(eigenvalues, HYPRE_MEMORY_HOST); - } + time_index = hypre_InitializeTiming("LOBPCG Setup"); + hypre_BeginTiming(time_index); - hypre_TFree( interpreter , HYPRE_MEMORY_HOST); + HYPRE_LOBPCGCreate(interpreter, &matvec_fn, (HYPRE_Solver*)&solver); + HYPRE_LOBPCGSetMaxIter( (HYPRE_Solver) solver, maxIterations ); + HYPRE_LOBPCGSetTol( (HYPRE_Solver) solver, tol ); + HYPRE_LOBPCGSetPrintLevel( (HYPRE_Solver) solver, verbosity ); - } + if ((solver_id == 10) || (solver_id == 11)) + { + /* use Split solver as preconditioner */ + HYPRE_SStructSplitCreate(comm, &precond); + HYPRE_SStructSplitSetMaxIter(precond, 1); + HYPRE_SStructSplitSetTol(precond, 0.0); + HYPRE_SStructSplitSetZeroGuess(precond); + if (solver_id == 10) + { + HYPRE_SStructSplitSetStructSolver(precond, HYPRE_SMG); + } + else if (solver_id == 11) + { + HYPRE_SStructSplitSetStructSolver(precond, HYPRE_PFMG); + } + HYPRE_LOBPCGSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_SStructSplitSolve, + (HYPRE_PtrToSolverFcn) HYPRE_SStructSplitSetup, + (HYPRE_Solver) precond); + } - /* end lobpcg */ + else if (solver_id == 13) + { + /* use SysPFMG solver as preconditioner */ + HYPRE_SStructSysPFMGCreate(comm, &precond); + HYPRE_SStructSysPFMGSetMaxIter(precond, 1); + HYPRE_SStructSysPFMGSetTol(precond, 0.0); + HYPRE_SStructSysPFMGSetZeroGuess(precond); + /* weighted Jacobi = 1; red-black GS = 2 */ + HYPRE_SStructSysPFMGSetRelaxType(precond, 1); + HYPRE_SStructSysPFMGSetNumPreRelax(precond, n_pre); + HYPRE_SStructSysPFMGSetNumPostRelax(precond, n_post); + HYPRE_SStructSysPFMGSetSkipRelax(precond, skip); + /*HYPRE_StructPFMGSetDxyz(precond, dxyz);*/ + HYPRE_LOBPCGSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_SStructSysPFMGSolve, + (HYPRE_PtrToSolverFcn) HYPRE_SStructSysPFMGSetup, + (HYPRE_Solver) precond); - /*----------------------------------------------------------- - * Solve the system using ParCSR version of PCG - *-----------------------------------------------------------*/ + } + else if (solver_id == 18) + { + /* use diagonal scaling as preconditioner */ + precond = NULL; + HYPRE_LOBPCGSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_SStructDiagScale, + (HYPRE_PtrToSolverFcn) HYPRE_SStructDiagScaleSetup, + (HYPRE_Solver) precond); + } + else if (solver_id != NO_SOLVER ) + { + if ( verbosity ) + { + hypre_printf("Solver ID not recognized - running LOBPCG without preconditioner\n\n"); + } + } - if ((solver_id >= 20) && (solver_id < 30)) - { - time_index = hypre_InitializeTiming("PCG Setup"); - hypre_BeginTiming(time_index); + HYPRE_LOBPCGSetup( (HYPRE_Solver) solver, (HYPRE_Matrix) A, + (HYPRE_Vector) b, (HYPRE_Vector) x); - HYPRE_ParCSRPCGCreate(hypre_MPI_COMM_WORLD, &par_solver); - HYPRE_PCGSetMaxIter( par_solver, 100 ); - HYPRE_PCGSetTol( par_solver, tol ); - HYPRE_PCGSetTwoNorm( par_solver, 1 ); - HYPRE_PCGSetRelChange( par_solver, 0 ); - HYPRE_PCGSetPrintLevel( par_solver, 1 ); - HYPRE_PCGSetRecomputeResidual( (HYPRE_Solver) par_solver, recompute_res); - - if (solver_id == 20) - { - /* use BoomerAMG as preconditioner */ - HYPRE_BoomerAMGCreate(&par_precond); - if (old_default) HYPRE_BoomerAMGSetOldDefault(par_precond); - HYPRE_BoomerAMGSetStrongThreshold(par_precond, 0.25); - HYPRE_BoomerAMGSetTol(par_precond, 0.0); - HYPRE_BoomerAMGSetPrintLevel(par_precond, 1); - HYPRE_BoomerAMGSetPrintFileName(par_precond, "sstruct.out.log"); - HYPRE_BoomerAMGSetMaxIter(par_precond, 1); - HYPRE_PCGSetPrecond( par_solver, - (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, - (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, - par_precond ); - } - else if (solver_id == 21) - { - /* use Euclid as preconditioner */ - HYPRE_EuclidCreate(hypre_MPI_COMM_WORLD, &par_precond); - HYPRE_EuclidSetParams(par_precond, argc, argv); - HYPRE_PCGSetPrecond(par_solver, - (HYPRE_PtrToSolverFcn) HYPRE_EuclidSolve, - (HYPRE_PtrToSolverFcn) HYPRE_EuclidSetup, - par_precond); - } - else if (solver_id == 22) - { - /* use ParaSails as preconditioner */ - HYPRE_ParCSRParaSailsCreate(hypre_MPI_COMM_WORLD, &par_precond ); - HYPRE_ParCSRParaSailsSetParams(par_precond, 0.1, 1); - HYPRE_PCGSetPrecond( par_solver, - (HYPRE_PtrToSolverFcn) HYPRE_ParCSRParaSailsSolve, - (HYPRE_PtrToSolverFcn) HYPRE_ParCSRParaSailsSetup, - par_precond ); - } - - else if (solver_id == 28) - { - /* use diagonal scaling as preconditioner */ - par_precond = NULL; - HYPRE_PCGSetPrecond( par_solver, - (HYPRE_PtrToSolverFcn) HYPRE_ParCSRDiagScale, - (HYPRE_PtrToSolverFcn) HYPRE_ParCSRDiagScaleSetup, - par_precond ); - } - - HYPRE_PCGSetup( par_solver, (HYPRE_Matrix) par_A, - (HYPRE_Vector) par_b, (HYPRE_Vector) par_x ); + hypre_EndTiming(time_index); + hypre_PrintTiming("Setup phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); - hypre_EndTiming(time_index); - hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + eigenvectors = mv_MultiVectorCreateFromSampleVector( interpreter, + blockSize, + x ); + eigenvalues = hypre_CTAlloc(HYPRE_Real, blockSize, HYPRE_MEMORY_HOST); - time_index = hypre_InitializeTiming("PCG Solve"); - hypre_BeginTiming(time_index); + if ( lobpcgSeed ) + { + mv_MultiVectorSetRandom( eigenvectors, lobpcgSeed ); + } + else + { + mv_MultiVectorSetRandom( eigenvectors, (HYPRE_Int)time(0) ); + } - HYPRE_PCGSolve( par_solver, (HYPRE_Matrix) par_A, - (HYPRE_Vector) par_b, (HYPRE_Vector) par_x ); + time_index = hypre_InitializeTiming("LOBPCG Solve"); + hypre_BeginTiming(time_index); - hypre_EndTiming(time_index); - hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + HYPRE_LOBPCGSolve + ( (HYPRE_Solver) solver, constrains, eigenvectors, eigenvalues ); - HYPRE_PCGGetNumIterations( par_solver, &num_iterations ); - HYPRE_PCGGetFinalRelativeResidualNorm( par_solver, &final_res_norm ); - HYPRE_ParCSRPCGDestroy(par_solver); + hypre_EndTiming(time_index); + hypre_PrintTiming("Solve phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); - if (solver_id == 20) - { - HYPRE_BoomerAMGDestroy(par_precond); - } - else if (solver_id == 21) - { - HYPRE_EuclidDestroy(par_precond); - } - else if (solver_id == 22) - { - HYPRE_ParCSRParaSailsDestroy(par_precond); - } - } + if ( checkOrtho ) + { - /*----------------------------------------------------------- - * Solve the system using GMRES - *-----------------------------------------------------------*/ + gramXX = utilities_FortranMatrixCreate(); + identity = utilities_FortranMatrixCreate(); - if ((solver_id >= 30) && (solver_id < 40)) - { - time_index = hypre_InitializeTiming("GMRES Setup"); - hypre_BeginTiming(time_index); + utilities_FortranMatrixAllocateData( blockSize, blockSize, gramXX ); + utilities_FortranMatrixAllocateData( blockSize, blockSize, identity ); - HYPRE_SStructGMRESCreate(hypre_MPI_COMM_WORLD, &solver); - HYPRE_GMRESSetKDim( (HYPRE_Solver) solver, 5 ); - HYPRE_GMRESSetMaxIter( (HYPRE_Solver) solver, 100 ); - HYPRE_GMRESSetTol( (HYPRE_Solver) solver, tol ); - HYPRE_GMRESSetPrintLevel( (HYPRE_Solver) solver, 1 ); - HYPRE_GMRESSetLogging( (HYPRE_Solver) solver, 1 ); + lobpcg_MultiVectorByMultiVector( eigenvectors, eigenvectors, gramXX ); + utilities_FortranMatrixSetToIdentity( identity ); + utilities_FortranMatrixAdd( -1, identity, gramXX, gramXX ); + nonOrthF = utilities_FortranMatrixFNorm( gramXX ); + if ( myid == 0 ) + { + hypre_printf("Non-orthonormality of eigenvectors: %12.5e\n", nonOrthF); + } - if ((solver_id == 30) || (solver_id == 31)) - { - /* use Split solver as preconditioner */ - HYPRE_SStructSplitCreate(hypre_MPI_COMM_WORLD, &precond); - HYPRE_SStructSplitSetMaxIter(precond, 1); - HYPRE_SStructSplitSetTol(precond, 0.0); - HYPRE_SStructSplitSetZeroGuess(precond); - if (solver_id == 30) - { - HYPRE_SStructSplitSetStructSolver(precond, HYPRE_SMG); - } - else if (solver_id == 31) - { - HYPRE_SStructSplitSetStructSolver(precond, HYPRE_PFMG); - } - HYPRE_GMRESSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_SStructSplitSolve, - (HYPRE_PtrToSolverFcn) HYPRE_SStructSplitSetup, - (HYPRE_Solver) precond ); - } + utilities_FortranMatrixDestroy( gramXX ); + utilities_FortranMatrixDestroy( identity ); - else if (solver_id == 38) - { - /* use diagonal scaling as preconditioner */ - precond = NULL; - HYPRE_GMRESSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_SStructDiagScale, - (HYPRE_PtrToSolverFcn) HYPRE_SStructDiagScaleSetup, - (HYPRE_Solver) precond ); - } + } - HYPRE_GMRESSetup( (HYPRE_Solver) solver, (HYPRE_Matrix) A, - (HYPRE_Vector) b, (HYPRE_Vector) x ); + if ( printLevel ) + { - hypre_EndTiming(time_index); - hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + if ( myid == 0 ) + { + if ( (filePtr = fopen("values.txt", "w")) ) + { + hypre_fprintf(filePtr, "%d\n", blockSize); + for ( i = 0; i < blockSize; i++ ) + { + hypre_fprintf(filePtr, "%22.14e\n", eigenvalues[i]); + } + fclose(filePtr); + } - time_index = hypre_InitializeTiming("GMRES Solve"); - hypre_BeginTiming(time_index); + if ( (filePtr = fopen("residuals.txt", "w")) ) + { + residualNorms = HYPRE_LOBPCGResidualNorms( (HYPRE_Solver)solver ); + residuals = utilities_FortranMatrixValues( residualNorms ); + hypre_fprintf(filePtr, "%d\n", blockSize); + for ( i = 0; i < blockSize; i++ ) + { + hypre_fprintf(filePtr, "%22.14e\n", residuals[i]); + } + fclose(filePtr); + } - HYPRE_GMRESSolve( (HYPRE_Solver) solver, (HYPRE_Matrix) A, - (HYPRE_Vector) b, (HYPRE_Vector) x ); + if ( printLevel > 1 ) + { - hypre_EndTiming(time_index); - hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + printBuffer = utilities_FortranMatrixCreate(); - HYPRE_GMRESGetNumIterations( (HYPRE_Solver) solver, &num_iterations ); - HYPRE_GMRESGetFinalRelativeResidualNorm( (HYPRE_Solver) solver, &final_res_norm ); - HYPRE_SStructGMRESDestroy(solver); + iterations = HYPRE_LOBPCGIterations( (HYPRE_Solver)solver ); - if ((solver_id == 30) || (solver_id == 31)) - { - HYPRE_SStructSplitDestroy(precond); - } - } + eigenvaluesHistory = HYPRE_LOBPCGEigenvaluesHistory( (HYPRE_Solver)solver ); + utilities_FortranMatrixSelectBlock( eigenvaluesHistory, + 1, blockSize, 1, iterations + 1, printBuffer ); + utilities_FortranMatrixPrint( printBuffer, "val_hist.txt" ); - /*----------------------------------------------------------- - * Solve the system using ParCSR version of GMRES - *-----------------------------------------------------------*/ + residualNormsHistory = HYPRE_LOBPCGResidualNormsHistory( (HYPRE_Solver)solver ); + utilities_FortranMatrixSelectBlock(residualNormsHistory, + 1, blockSize, 1, iterations + 1, printBuffer ); + utilities_FortranMatrixPrint( printBuffer, "res_hist.txt" ); - if ((solver_id >= 40) && (solver_id < 50)) - { - time_index = hypre_InitializeTiming("GMRES Setup"); - hypre_BeginTiming(time_index); + utilities_FortranMatrixDestroy( printBuffer ); + } + } + } - HYPRE_ParCSRGMRESCreate(hypre_MPI_COMM_WORLD, &par_solver); - HYPRE_GMRESSetKDim(par_solver, 5); - HYPRE_GMRESSetMaxIter(par_solver, 100); - HYPRE_GMRESSetTol(par_solver, tol); - HYPRE_GMRESSetPrintLevel(par_solver, 1); - HYPRE_GMRESSetLogging(par_solver, 1); - - if (solver_id == 40) - { - /* use BoomerAMG as preconditioner */ - HYPRE_BoomerAMGCreate(&par_precond); - if (old_default) HYPRE_BoomerAMGSetOldDefault(par_precond); - HYPRE_BoomerAMGSetStrongThreshold(par_precond, 0.25); - HYPRE_BoomerAMGSetTol(par_precond, 0.0); - HYPRE_BoomerAMGSetPrintLevel(par_precond, 1); - HYPRE_BoomerAMGSetPrintFileName(par_precond, "sstruct.out.log"); - HYPRE_BoomerAMGSetMaxIter(par_precond, 1); - HYPRE_GMRESSetPrecond( par_solver, - (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, - (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, - par_precond); - } - else if (solver_id == 41) - { - /* use Euclid as preconditioner */ - HYPRE_EuclidCreate(hypre_MPI_COMM_WORLD, &par_precond); - HYPRE_EuclidSetParams(par_precond, argc, argv); - HYPRE_GMRESSetPrecond(par_solver, - (HYPRE_PtrToSolverFcn) HYPRE_EuclidSolve, - (HYPRE_PtrToSolverFcn) HYPRE_EuclidSetup, - par_precond); - } - else if (solver_id == 42) - { - /* use ParaSails as preconditioner */ - HYPRE_ParCSRParaSailsCreate(hypre_MPI_COMM_WORLD, &par_precond ); - HYPRE_ParCSRParaSailsSetParams(par_precond, 0.1, 1); - HYPRE_ParCSRParaSailsSetSym(par_precond, 0); - HYPRE_GMRESSetPrecond( par_solver, - (HYPRE_PtrToSolverFcn) HYPRE_ParCSRParaSailsSolve, - (HYPRE_PtrToSolverFcn) HYPRE_ParCSRParaSailsSetup, - par_precond); - } + HYPRE_LOBPCGDestroy((HYPRE_Solver)solver); - HYPRE_GMRESSetup( par_solver, (HYPRE_Matrix) par_A, - (HYPRE_Vector) par_b, (HYPRE_Vector) par_x); + if ((solver_id == 10) || (solver_id == 11)) + { + HYPRE_SStructSplitDestroy(precond); + } + else if (solver_id == 13) + { + HYPRE_SStructSysPFMGDestroy(precond); + } - hypre_EndTiming(time_index); - hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + mv_MultiVectorDestroy( eigenvectors ); + hypre_TFree(eigenvalues, HYPRE_MEMORY_HOST); + } - time_index = hypre_InitializeTiming("GMRES Solve"); - hypre_BeginTiming(time_index); + hypre_TFree( interpreter, HYPRE_MEMORY_HOST); - HYPRE_GMRESSolve( par_solver, (HYPRE_Matrix) par_A, - (HYPRE_Vector) par_b, (HYPRE_Vector) par_x); + } - hypre_EndTiming(time_index); - hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + /* end lobpcg */ - HYPRE_GMRESGetNumIterations( par_solver, &num_iterations); - HYPRE_GMRESGetFinalRelativeResidualNorm( par_solver, &final_res_norm); - HYPRE_ParCSRGMRESDestroy(par_solver); + /*----------------------------------------------------------- + * Solve the system using ParCSR version of PCG + *-----------------------------------------------------------*/ - if (solver_id == 40) - { - HYPRE_BoomerAMGDestroy(par_precond); - } - else if (solver_id == 41) - { - HYPRE_EuclidDestroy(par_precond); - } - else if (solver_id == 42) + if ((solver_id >= 20) && (solver_id < 30)) { - HYPRE_ParCSRParaSailsDestroy(par_precond); - } - } - - /*----------------------------------------------------------- - * Solve the system using BiCGSTAB - *-----------------------------------------------------------*/ - - if ((solver_id >= 50) && (solver_id < 60)) - { - time_index = hypre_InitializeTiming("BiCGSTAB Setup"); - hypre_BeginTiming(time_index); + time_index = hypre_InitializeTiming("PCG Setup"); + hypre_BeginTiming(time_index); - HYPRE_SStructBiCGSTABCreate(hypre_MPI_COMM_WORLD, &solver); - HYPRE_BiCGSTABSetMaxIter( (HYPRE_Solver) solver, 100 ); - HYPRE_BiCGSTABSetTol( (HYPRE_Solver) solver, tol ); - HYPRE_BiCGSTABSetPrintLevel( (HYPRE_Solver) solver, 1 ); - HYPRE_BiCGSTABSetLogging( (HYPRE_Solver) solver, 1 ); + HYPRE_ParCSRPCGCreate(comm, &par_solver); + HYPRE_PCGSetMaxIter( par_solver, 100 ); + HYPRE_PCGSetTol( par_solver, tol ); + HYPRE_PCGSetTwoNorm( par_solver, 1 ); + HYPRE_PCGSetRelChange( par_solver, 0 ); + HYPRE_PCGSetPrintLevel( par_solver, solver_print_level ); + HYPRE_PCGSetRecomputeResidual( (HYPRE_Solver) par_solver, recompute_res); - if ((solver_id == 50) || (solver_id == 51)) - { - /* use Split solver as preconditioner */ - HYPRE_SStructSplitCreate(hypre_MPI_COMM_WORLD, &precond); - HYPRE_SStructSplitSetMaxIter(precond, 1); - HYPRE_SStructSplitSetTol(precond, 0.0); - HYPRE_SStructSplitSetZeroGuess(precond); - if (solver_id == 50) + if (solver_id == 20) { - HYPRE_SStructSplitSetStructSolver(precond, HYPRE_SMG); + /* use BoomerAMG as preconditioner */ + HYPRE_BoomerAMGCreate(&par_precond); + if (old_default) { HYPRE_BoomerAMGSetOldDefault(par_precond); } + HYPRE_BoomerAMGSetStrongThreshold(par_precond, 0.25); + HYPRE_BoomerAMGSetTol(par_precond, 0.0); + HYPRE_BoomerAMGSetPrintLevel(par_precond, prec_print_level); + HYPRE_BoomerAMGSetPrintFileName(par_precond, "sstruct.out.log"); + HYPRE_BoomerAMGSetMaxIter(par_precond, 1); + HYPRE_PCGSetPrecond( par_solver, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, + par_precond ); } - else if (solver_id == 51) + else if (solver_id == 21) { - HYPRE_SStructSplitSetStructSolver(precond, HYPRE_PFMG); + /* use Euclid as preconditioner */ + HYPRE_EuclidCreate(comm, &par_precond); + HYPRE_EuclidSetParams(par_precond, argc, argv); + HYPRE_PCGSetPrecond(par_solver, + (HYPRE_PtrToSolverFcn) HYPRE_EuclidSolve, + (HYPRE_PtrToSolverFcn) HYPRE_EuclidSetup, + par_precond); + } + else if (solver_id == 22) + { + /* use ParaSails as preconditioner */ + HYPRE_ParCSRParaSailsCreate(comm, &par_precond ); + HYPRE_ParCSRParaSailsSetParams(par_precond, 0.1, 1); + HYPRE_PCGSetPrecond( par_solver, + (HYPRE_PtrToSolverFcn) HYPRE_ParCSRParaSailsSolve, + (HYPRE_PtrToSolverFcn) HYPRE_ParCSRParaSailsSetup, + par_precond ); } - HYPRE_BiCGSTABSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_SStructSplitSolve, - (HYPRE_PtrToSolverFcn) HYPRE_SStructSplitSetup, - (HYPRE_Solver) precond ); - } - else if (solver_id == 58) - { - /* use diagonal scaling as preconditioner */ - precond = NULL; - HYPRE_BiCGSTABSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_SStructDiagScale, - (HYPRE_PtrToSolverFcn) HYPRE_SStructDiagScaleSetup, - (HYPRE_Solver) precond ); + else if (solver_id == 28) + { + /* use diagonal scaling as preconditioner */ + par_precond = NULL; + HYPRE_PCGSetPrecond( par_solver, + (HYPRE_PtrToSolverFcn) HYPRE_ParCSRDiagScale, + (HYPRE_PtrToSolverFcn) HYPRE_ParCSRDiagScaleSetup, + par_precond ); + } + + HYPRE_PCGSetup( par_solver, (HYPRE_Matrix) par_A, + (HYPRE_Vector) par_b, (HYPRE_Vector) par_x ); + + hypre_EndTiming(time_index); + hypre_PrintTiming("Setup phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + time_index = hypre_InitializeTiming("PCG Solve"); + hypre_BeginTiming(time_index); + + HYPRE_PCGSolve( par_solver, (HYPRE_Matrix) par_A, + (HYPRE_Vector) par_b, (HYPRE_Vector) par_x ); + + hypre_EndTiming(time_index); + hypre_PrintTiming("Solve phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + HYPRE_PCGGetNumIterations( par_solver, &num_iterations ); + HYPRE_PCGGetFinalRelativeResidualNorm( par_solver, &final_res_norm ); + HYPRE_ParCSRPCGDestroy(par_solver); + + if (solver_id == 20) + { + HYPRE_BoomerAMGDestroy(par_precond); + } + else if (solver_id == 21) + { + HYPRE_EuclidDestroy(par_precond); + } + else if (solver_id == 22) + { + HYPRE_ParCSRParaSailsDestroy(par_precond); + } } - HYPRE_BiCGSTABSetup( (HYPRE_Solver) solver, (HYPRE_Matrix) A, + /*----------------------------------------------------------- + * Solve the system using GMRES + *-----------------------------------------------------------*/ + + if ((solver_id >= 30) && (solver_id < 40)) + { + time_index = hypre_InitializeTiming("GMRES Setup"); + hypre_BeginTiming(time_index); + + HYPRE_SStructGMRESCreate(comm, &solver); + HYPRE_GMRESSetKDim( (HYPRE_Solver) solver, 5 ); + HYPRE_GMRESSetMaxIter( (HYPRE_Solver) solver, 100 ); + HYPRE_GMRESSetTol( (HYPRE_Solver) solver, tol ); + HYPRE_GMRESSetPrintLevel( (HYPRE_Solver) solver, solver_print_level ); + HYPRE_GMRESSetLogging( (HYPRE_Solver) solver, 1 ); + + if ((solver_id == 30) || (solver_id == 31)) + { + /* use Split solver as preconditioner */ + HYPRE_SStructSplitCreate(comm, &precond); + HYPRE_SStructSplitSetMaxIter(precond, 1); + HYPRE_SStructSplitSetTol(precond, 0.0); + HYPRE_SStructSplitSetZeroGuess(precond); + if (solver_id == 30) + { + HYPRE_SStructSplitSetStructSolver(precond, HYPRE_SMG); + } + else if (solver_id == 31) + { + HYPRE_SStructSplitSetStructSolver(precond, HYPRE_PFMG); + } + HYPRE_GMRESSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_SStructSplitSolve, + (HYPRE_PtrToSolverFcn) HYPRE_SStructSplitSetup, + (HYPRE_Solver) precond ); + } + + else if (solver_id == 38) + { + /* use diagonal scaling as preconditioner */ + precond = NULL; + HYPRE_GMRESSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_SStructDiagScale, + (HYPRE_PtrToSolverFcn) HYPRE_SStructDiagScaleSetup, + (HYPRE_Solver) precond ); + } + + HYPRE_GMRESSetup( (HYPRE_Solver) solver, (HYPRE_Matrix) A, (HYPRE_Vector) b, (HYPRE_Vector) x ); - hypre_EndTiming(time_index); - hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + hypre_EndTiming(time_index); + hypre_PrintTiming("Setup phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); - time_index = hypre_InitializeTiming("BiCGSTAB Solve"); - hypre_BeginTiming(time_index); + time_index = hypre_InitializeTiming("GMRES Solve"); + hypre_BeginTiming(time_index); - HYPRE_BiCGSTABSolve( (HYPRE_Solver) solver, (HYPRE_Matrix) A, + HYPRE_GMRESSolve( (HYPRE_Solver) solver, (HYPRE_Matrix) A, (HYPRE_Vector) b, (HYPRE_Vector) x ); - hypre_EndTiming(time_index); - hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + hypre_EndTiming(time_index); + hypre_PrintTiming("Solve phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); - HYPRE_BiCGSTABGetNumIterations( (HYPRE_Solver) solver, &num_iterations ); - HYPRE_BiCGSTABGetFinalRelativeResidualNorm( (HYPRE_Solver) solver, &final_res_norm ); - HYPRE_SStructBiCGSTABDestroy(solver); + HYPRE_GMRESGetNumIterations( (HYPRE_Solver) solver, &num_iterations ); + HYPRE_GMRESGetFinalRelativeResidualNorm( (HYPRE_Solver) solver, &final_res_norm ); + HYPRE_SStructGMRESDestroy(solver); - if ((solver_id == 50) || (solver_id == 51)) - { - HYPRE_SStructSplitDestroy(precond); + if ((solver_id == 30) || (solver_id == 31)) + { + HYPRE_SStructSplitDestroy(precond); + } } - } - /*----------------------------------------------------------- - * Solve the system using ParCSR version of BiCGSTAB - *-----------------------------------------------------------*/ + /*----------------------------------------------------------- + * Solve the system using ParCSR version of GMRES + *-----------------------------------------------------------*/ - if ((solver_id >= 60) && (solver_id < 70)) - { - time_index = hypre_InitializeTiming("BiCGSTAB Setup"); - hypre_BeginTiming(time_index); + if ((solver_id >= 40) && (solver_id < 50)) + { + time_index = hypre_InitializeTiming("GMRES Setup"); + hypre_BeginTiming(time_index); + + HYPRE_ParCSRGMRESCreate(comm, &par_solver); + HYPRE_GMRESSetKDim(par_solver, 5); + HYPRE_GMRESSetMaxIter(par_solver, 100); + HYPRE_GMRESSetTol(par_solver, tol); + HYPRE_GMRESSetPrintLevel(par_solver, solver_print_level); + HYPRE_GMRESSetLogging(par_solver, 1); - HYPRE_ParCSRBiCGSTABCreate(hypre_MPI_COMM_WORLD, &par_solver); - HYPRE_BiCGSTABSetMaxIter(par_solver, 100); - HYPRE_BiCGSTABSetTol(par_solver, tol); - HYPRE_BiCGSTABSetPrintLevel(par_solver, 1); - HYPRE_BiCGSTABSetLogging(par_solver, 1); - - if (solver_id == 60) - { - /* use BoomerAMG as preconditioner */ - HYPRE_BoomerAMGCreate(&par_precond); - if (old_default) HYPRE_BoomerAMGSetOldDefault(par_precond); - HYPRE_BoomerAMGSetStrongThreshold(par_precond, 0.25); - HYPRE_BoomerAMGSetTol(par_precond, 0.0); - HYPRE_BoomerAMGSetPrintLevel(par_precond, 1); - HYPRE_BoomerAMGSetPrintFileName(par_precond, "sstruct.out.log"); - HYPRE_BoomerAMGSetMaxIter(par_precond, 1); - HYPRE_BiCGSTABSetPrecond( par_solver, + if (solver_id == 40) + { + /* use BoomerAMG as preconditioner */ + HYPRE_BoomerAMGCreate(&par_precond); + if (old_default) { HYPRE_BoomerAMGSetOldDefault(par_precond); } + HYPRE_BoomerAMGSetStrongThreshold(par_precond, 0.25); + HYPRE_BoomerAMGSetTol(par_precond, 0.0); + HYPRE_BoomerAMGSetPrintLevel(par_precond, prec_print_level); + HYPRE_BoomerAMGSetPrintFileName(par_precond, "sstruct.out.log"); + HYPRE_BoomerAMGSetMaxIter(par_precond, 1); + HYPRE_GMRESSetPrecond( par_solver, (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, par_precond); - } - else if (solver_id == 61) - { - /* use Euclid as preconditioner */ - HYPRE_EuclidCreate(hypre_MPI_COMM_WORLD, &par_precond); - HYPRE_EuclidSetParams(par_precond, argc, argv); - HYPRE_BiCGSTABSetPrecond(par_solver, + } + else if (solver_id == 41) + { + /* use Euclid as preconditioner */ + HYPRE_EuclidCreate(comm, &par_precond); + HYPRE_EuclidSetParams(par_precond, argc, argv); + HYPRE_GMRESSetPrecond(par_solver, (HYPRE_PtrToSolverFcn) HYPRE_EuclidSolve, (HYPRE_PtrToSolverFcn) HYPRE_EuclidSetup, par_precond); - } - - else if (solver_id == 62) - { - /* use ParaSails as preconditioner */ - HYPRE_ParCSRParaSailsCreate(hypre_MPI_COMM_WORLD, &par_precond ); - HYPRE_ParCSRParaSailsSetParams(par_precond, 0.1, 1); - HYPRE_ParCSRParaSailsSetSym(par_precond, 0); - HYPRE_BiCGSTABSetPrecond( par_solver, + } + else if (solver_id == 42) + { + /* use ParaSails as preconditioner */ + HYPRE_ParCSRParaSailsCreate(comm, &par_precond ); + HYPRE_ParCSRParaSailsSetParams(par_precond, 0.1, 1); + HYPRE_ParCSRParaSailsSetSym(par_precond, 0); + HYPRE_GMRESSetPrecond( par_solver, (HYPRE_PtrToSolverFcn) HYPRE_ParCSRParaSailsSolve, (HYPRE_PtrToSolverFcn) HYPRE_ParCSRParaSailsSetup, par_precond); - } + } - HYPRE_BiCGSTABSetup( par_solver, (HYPRE_Matrix) par_A, + HYPRE_GMRESSetup( par_solver, (HYPRE_Matrix) par_A, (HYPRE_Vector) par_b, (HYPRE_Vector) par_x); - hypre_EndTiming(time_index); - hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + hypre_EndTiming(time_index); + hypre_PrintTiming("Setup phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); - time_index = hypre_InitializeTiming("BiCGSTAB Solve"); - hypre_BeginTiming(time_index); + time_index = hypre_InitializeTiming("GMRES Solve"); + hypre_BeginTiming(time_index); - HYPRE_BiCGSTABSolve( par_solver, (HYPRE_Matrix) par_A, + HYPRE_GMRESSolve( par_solver, (HYPRE_Matrix) par_A, (HYPRE_Vector) par_b, (HYPRE_Vector) par_x); - hypre_EndTiming(time_index); - hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + hypre_EndTiming(time_index); + hypre_PrintTiming("Solve phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); - HYPRE_BiCGSTABGetNumIterations( par_solver, &num_iterations); - HYPRE_BiCGSTABGetFinalRelativeResidualNorm( par_solver, &final_res_norm); - HYPRE_ParCSRBiCGSTABDestroy(par_solver); + HYPRE_GMRESGetNumIterations( par_solver, &num_iterations); + HYPRE_GMRESGetFinalRelativeResidualNorm( par_solver, &final_res_norm); + HYPRE_ParCSRGMRESDestroy(par_solver); - if (solver_id == 60) - { - HYPRE_BoomerAMGDestroy(par_precond); + if (solver_id == 40) + { + HYPRE_BoomerAMGDestroy(par_precond); + } + else if (solver_id == 41) + { + HYPRE_EuclidDestroy(par_precond); + } + else if (solver_id == 42) + { + HYPRE_ParCSRParaSailsDestroy(par_precond); + } } - else if (solver_id == 61) + + /*----------------------------------------------------------- + * Solve the system using BiCGSTAB + *-----------------------------------------------------------*/ + + if ((solver_id >= 50) && (solver_id < 60)) { - HYPRE_EuclidDestroy(par_precond); + time_index = hypre_InitializeTiming("BiCGSTAB Setup"); + hypre_BeginTiming(time_index); + + HYPRE_SStructBiCGSTABCreate(comm, &solver); + HYPRE_BiCGSTABSetMaxIter( (HYPRE_Solver) solver, 100 ); + HYPRE_BiCGSTABSetTol( (HYPRE_Solver) solver, tol ); + HYPRE_BiCGSTABSetPrintLevel( (HYPRE_Solver) solver, solver_print_level ); + HYPRE_BiCGSTABSetLogging( (HYPRE_Solver) solver, 1 ); + + if ((solver_id == 50) || (solver_id == 51)) + { + /* use Split solver as preconditioner */ + HYPRE_SStructSplitCreate(comm, &precond); + HYPRE_SStructSplitSetMaxIter(precond, 1); + HYPRE_SStructSplitSetTol(precond, 0.0); + HYPRE_SStructSplitSetZeroGuess(precond); + if (solver_id == 50) + { + HYPRE_SStructSplitSetStructSolver(precond, HYPRE_SMG); + } + else if (solver_id == 51) + { + HYPRE_SStructSplitSetStructSolver(precond, HYPRE_PFMG); + } + HYPRE_BiCGSTABSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_SStructSplitSolve, + (HYPRE_PtrToSolverFcn) HYPRE_SStructSplitSetup, + (HYPRE_Solver) precond ); + } + + else if (solver_id == 58) + { + /* use diagonal scaling as preconditioner */ + precond = NULL; + HYPRE_BiCGSTABSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_SStructDiagScale, + (HYPRE_PtrToSolverFcn) HYPRE_SStructDiagScaleSetup, + (HYPRE_Solver) precond ); + } + + HYPRE_BiCGSTABSetup( (HYPRE_Solver) solver, (HYPRE_Matrix) A, + (HYPRE_Vector) b, (HYPRE_Vector) x ); + + hypre_EndTiming(time_index); + hypre_PrintTiming("Setup phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + time_index = hypre_InitializeTiming("BiCGSTAB Solve"); + hypre_BeginTiming(time_index); + + HYPRE_BiCGSTABSolve( (HYPRE_Solver) solver, (HYPRE_Matrix) A, + (HYPRE_Vector) b, (HYPRE_Vector) x ); + + hypre_EndTiming(time_index); + hypre_PrintTiming("Solve phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + HYPRE_BiCGSTABGetNumIterations( (HYPRE_Solver) solver, &num_iterations ); + HYPRE_BiCGSTABGetFinalRelativeResidualNorm( (HYPRE_Solver) solver, &final_res_norm ); + HYPRE_SStructBiCGSTABDestroy(solver); + + if ((solver_id == 50) || (solver_id == 51)) + { + HYPRE_SStructSplitDestroy(precond); + } } - else if (solver_id == 62) + + /*----------------------------------------------------------- + * Solve the system using ParCSR version of BiCGSTAB + *-----------------------------------------------------------*/ + + if ((solver_id >= 60) && (solver_id < 70)) { - HYPRE_ParCSRParaSailsDestroy(par_precond); - } - } + time_index = hypre_InitializeTiming("BiCGSTAB Setup"); + hypre_BeginTiming(time_index); - /*----------------------------------------------------------- - * Solve the system using Flexible GMRES - *-----------------------------------------------------------*/ + HYPRE_ParCSRBiCGSTABCreate(comm, &par_solver); + HYPRE_BiCGSTABSetMaxIter(par_solver, 100); + HYPRE_BiCGSTABSetTol(par_solver, tol); + HYPRE_BiCGSTABSetPrintLevel(par_solver, solver_print_level); + HYPRE_BiCGSTABSetLogging(par_solver, 1); - if ((solver_id >= 70) && (solver_id < 80)) - { - time_index = hypre_InitializeTiming("FlexGMRES Setup"); - hypre_BeginTiming(time_index); + if (solver_id == 60) + { + /* use BoomerAMG as preconditioner */ + HYPRE_BoomerAMGCreate(&par_precond); + if (old_default) { HYPRE_BoomerAMGSetOldDefault(par_precond); } + HYPRE_BoomerAMGSetStrongThreshold(par_precond, 0.25); + HYPRE_BoomerAMGSetTol(par_precond, 0.0); + HYPRE_BoomerAMGSetPrintLevel(par_precond, prec_print_level); + HYPRE_BoomerAMGSetPrintFileName(par_precond, "sstruct.out.log"); + HYPRE_BoomerAMGSetMaxIter(par_precond, 1); + HYPRE_BiCGSTABSetPrecond( par_solver, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, + par_precond); + } + else if (solver_id == 61) + { + /* use Euclid as preconditioner */ + HYPRE_EuclidCreate(comm, &par_precond); + HYPRE_EuclidSetParams(par_precond, argc, argv); + HYPRE_BiCGSTABSetPrecond(par_solver, + (HYPRE_PtrToSolverFcn) HYPRE_EuclidSolve, + (HYPRE_PtrToSolverFcn) HYPRE_EuclidSetup, + par_precond); + } - HYPRE_SStructFlexGMRESCreate(hypre_MPI_COMM_WORLD, &solver); - HYPRE_FlexGMRESSetKDim( (HYPRE_Solver) solver, 5 ); - HYPRE_FlexGMRESSetMaxIter( (HYPRE_Solver) solver, 100 ); - HYPRE_FlexGMRESSetTol( (HYPRE_Solver) solver, tol ); - HYPRE_FlexGMRESSetPrintLevel( (HYPRE_Solver) solver, 1 ); - HYPRE_FlexGMRESSetLogging( (HYPRE_Solver) solver, 1 ); + else if (solver_id == 62) + { + /* use ParaSails as preconditioner */ + HYPRE_ParCSRParaSailsCreate(comm, &par_precond ); + HYPRE_ParCSRParaSailsSetParams(par_precond, 0.1, 1); + HYPRE_ParCSRParaSailsSetSym(par_precond, 0); + HYPRE_BiCGSTABSetPrecond( par_solver, + (HYPRE_PtrToSolverFcn) HYPRE_ParCSRParaSailsSolve, + (HYPRE_PtrToSolverFcn) HYPRE_ParCSRParaSailsSetup, + par_precond); + } - if ((solver_id == 70) || (solver_id == 71)) - { - /* use Split solver as preconditioner */ - HYPRE_SStructSplitCreate(hypre_MPI_COMM_WORLD, &precond); - HYPRE_SStructSplitSetMaxIter(precond, 1); - HYPRE_SStructSplitSetTol(precond, 0.0); - HYPRE_SStructSplitSetZeroGuess(precond); - if (solver_id == 70) + HYPRE_BiCGSTABSetup( par_solver, (HYPRE_Matrix) par_A, + (HYPRE_Vector) par_b, (HYPRE_Vector) par_x); + + hypre_EndTiming(time_index); + hypre_PrintTiming("Setup phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + time_index = hypre_InitializeTiming("BiCGSTAB Solve"); + hypre_BeginTiming(time_index); + + HYPRE_BiCGSTABSolve( par_solver, (HYPRE_Matrix) par_A, + (HYPRE_Vector) par_b, (HYPRE_Vector) par_x); + + hypre_EndTiming(time_index); + hypre_PrintTiming("Solve phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + HYPRE_BiCGSTABGetNumIterations( par_solver, &num_iterations); + HYPRE_BiCGSTABGetFinalRelativeResidualNorm( par_solver, &final_res_norm); + HYPRE_ParCSRBiCGSTABDestroy(par_solver); + + if (solver_id == 60) { - HYPRE_SStructSplitSetStructSolver(precond, HYPRE_SMG); + HYPRE_BoomerAMGDestroy(par_precond); } - else if (solver_id == 71) + else if (solver_id == 61) { - HYPRE_SStructSplitSetStructSolver(precond, HYPRE_PFMG); + HYPRE_EuclidDestroy(par_precond); + } + else if (solver_id == 62) + { + HYPRE_ParCSRParaSailsDestroy(par_precond); } - HYPRE_FlexGMRESSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_SStructSplitSolve, - (HYPRE_PtrToSolverFcn) HYPRE_SStructSplitSetup, - (HYPRE_Solver) precond ); } - else if (solver_id == 78) + /*----------------------------------------------------------- + * Solve the system using Flexible GMRES + *-----------------------------------------------------------*/ + + if ((solver_id >= 70) && (solver_id < 80)) { - /* use diagonal scaling as preconditioner */ - precond = NULL; - HYPRE_FlexGMRESSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_SStructDiagScale, - (HYPRE_PtrToSolverFcn) HYPRE_SStructDiagScaleSetup, - (HYPRE_Solver) precond ); - } + time_index = hypre_InitializeTiming("FlexGMRES Setup"); + hypre_BeginTiming(time_index); - HYPRE_FlexGMRESSetup( (HYPRE_Solver) solver, (HYPRE_Matrix) A, - (HYPRE_Vector) b, (HYPRE_Vector) x ); + HYPRE_SStructFlexGMRESCreate(comm, &solver); + HYPRE_FlexGMRESSetKDim( (HYPRE_Solver) solver, 5 ); + HYPRE_FlexGMRESSetMaxIter( (HYPRE_Solver) solver, 100 ); + HYPRE_FlexGMRESSetTol( (HYPRE_Solver) solver, tol ); + HYPRE_FlexGMRESSetPrintLevel( (HYPRE_Solver) solver, solver_print_level ); + HYPRE_FlexGMRESSetLogging( (HYPRE_Solver) solver, 1 ); - hypre_EndTiming(time_index); - hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + if ((solver_id == 70) || (solver_id == 71)) + { + /* use Split solver as preconditioner */ + HYPRE_SStructSplitCreate(comm, &precond); + HYPRE_SStructSplitSetMaxIter(precond, 1); + HYPRE_SStructSplitSetTol(precond, 0.0); + HYPRE_SStructSplitSetZeroGuess(precond); + if (solver_id == 70) + { + HYPRE_SStructSplitSetStructSolver(precond, HYPRE_SMG); + } + else if (solver_id == 71) + { + HYPRE_SStructSplitSetStructSolver(precond, HYPRE_PFMG); + } + HYPRE_FlexGMRESSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_SStructSplitSolve, + (HYPRE_PtrToSolverFcn) HYPRE_SStructSplitSetup, + (HYPRE_Solver) precond ); + } - time_index = hypre_InitializeTiming("FlexGMRES Solve"); - hypre_BeginTiming(time_index); + else if (solver_id == 78) + { + /* use diagonal scaling as preconditioner */ + precond = NULL; + HYPRE_FlexGMRESSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_SStructDiagScale, + (HYPRE_PtrToSolverFcn) HYPRE_SStructDiagScaleSetup, + (HYPRE_Solver) precond ); + } - HYPRE_FlexGMRESSolve( (HYPRE_Solver) solver, (HYPRE_Matrix) A, - (HYPRE_Vector) b, (HYPRE_Vector) x ); + HYPRE_FlexGMRESSetup( (HYPRE_Solver) solver, (HYPRE_Matrix) A, + (HYPRE_Vector) b, (HYPRE_Vector) x ); - hypre_EndTiming(time_index); - hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + hypre_EndTiming(time_index); + hypre_PrintTiming("Setup phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); - HYPRE_FlexGMRESGetNumIterations( (HYPRE_Solver) solver, &num_iterations ); - HYPRE_FlexGMRESGetFinalRelativeResidualNorm( (HYPRE_Solver) solver, &final_res_norm ); - HYPRE_SStructFlexGMRESDestroy(solver); + time_index = hypre_InitializeTiming("FlexGMRES Solve"); + hypre_BeginTiming(time_index); - if ((solver_id == 70) || (solver_id == 71)) - { - HYPRE_SStructSplitDestroy(precond); - } - } + HYPRE_FlexGMRESSolve( (HYPRE_Solver) solver, (HYPRE_Matrix) A, + (HYPRE_Vector) b, (HYPRE_Vector) x ); - /*----------------------------------------------------------- - * Solve the system using ParCSR version of Flexible GMRES - *-----------------------------------------------------------*/ + hypre_EndTiming(time_index); + hypre_PrintTiming("Solve phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); - if ((solver_id >= 80) && (solver_id < 90)) - { - time_index = hypre_InitializeTiming("FlexGMRES Setup"); - hypre_BeginTiming(time_index); + HYPRE_FlexGMRESGetNumIterations( (HYPRE_Solver) solver, &num_iterations ); + HYPRE_FlexGMRESGetFinalRelativeResidualNorm( (HYPRE_Solver) solver, &final_res_norm ); + HYPRE_SStructFlexGMRESDestroy(solver); - HYPRE_ParCSRFlexGMRESCreate(hypre_MPI_COMM_WORLD, &par_solver); - HYPRE_FlexGMRESSetKDim(par_solver, 5); - HYPRE_FlexGMRESSetMaxIter(par_solver, 100); - HYPRE_FlexGMRESSetTol(par_solver, tol); - HYPRE_FlexGMRESSetPrintLevel(par_solver, 1); - HYPRE_FlexGMRESSetLogging(par_solver, 1); - - if (solver_id == 80) - { - /* use BoomerAMG as preconditioner */ - HYPRE_BoomerAMGCreate(&par_precond); - if (old_default) HYPRE_BoomerAMGSetOldDefault(par_precond); - HYPRE_BoomerAMGSetStrongThreshold(par_precond, 0.25); - HYPRE_BoomerAMGSetTol(par_precond, 0.0); - HYPRE_BoomerAMGSetPrintLevel(par_precond, 1); - HYPRE_BoomerAMGSetPrintFileName(par_precond, "sstruct.out.log"); - HYPRE_BoomerAMGSetMaxIter(par_precond, 1); - HYPRE_FlexGMRESSetPrecond( par_solver, - (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, - (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, - par_precond); + if ((solver_id == 70) || (solver_id == 71)) + { + HYPRE_SStructSplitDestroy(precond); + } } - HYPRE_FlexGMRESSetup( par_solver, (HYPRE_Matrix) par_A, - (HYPRE_Vector) par_b, (HYPRE_Vector) par_x); + /*----------------------------------------------------------- + * Solve the system using ParCSR version of Flexible GMRES + *-----------------------------------------------------------*/ - hypre_EndTiming(time_index); - hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + if ((solver_id >= 80) && (solver_id < 90)) + { + time_index = hypre_InitializeTiming("FlexGMRES Setup"); + hypre_BeginTiming(time_index); - time_index = hypre_InitializeTiming("FlexGMRES Solve"); - hypre_BeginTiming(time_index); + HYPRE_ParCSRFlexGMRESCreate(comm, &par_solver); + HYPRE_FlexGMRESSetKDim(par_solver, 5); + HYPRE_FlexGMRESSetMaxIter(par_solver, 100); + HYPRE_FlexGMRESSetTol(par_solver, tol); + HYPRE_FlexGMRESSetPrintLevel(par_solver, solver_print_level); + HYPRE_FlexGMRESSetLogging(par_solver, 1); - HYPRE_FlexGMRESSolve( par_solver, (HYPRE_Matrix) par_A, - (HYPRE_Vector) par_b, (HYPRE_Vector) par_x); + if (solver_id == 80) + { + /* use BoomerAMG as preconditioner */ + HYPRE_BoomerAMGCreate(&par_precond); + if (old_default) { HYPRE_BoomerAMGSetOldDefault(par_precond); } + HYPRE_BoomerAMGSetStrongThreshold(par_precond, 0.25); + HYPRE_BoomerAMGSetTol(par_precond, 0.0); + HYPRE_BoomerAMGSetPrintLevel(par_precond, prec_print_level); + HYPRE_BoomerAMGSetPrintFileName(par_precond, "sstruct.out.log"); + HYPRE_BoomerAMGSetMaxIter(par_precond, 1); + HYPRE_FlexGMRESSetPrecond( par_solver, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, + par_precond); + } - hypre_EndTiming(time_index); - hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + HYPRE_FlexGMRESSetup( par_solver, (HYPRE_Matrix) par_A, + (HYPRE_Vector) par_b, (HYPRE_Vector) par_x); - HYPRE_FlexGMRESGetNumIterations( par_solver, &num_iterations); - HYPRE_FlexGMRESGetFinalRelativeResidualNorm( par_solver, &final_res_norm); - HYPRE_ParCSRFlexGMRESDestroy(par_solver); + hypre_EndTiming(time_index); + hypre_PrintTiming("Setup phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); - if (solver_id == 80) - { - HYPRE_BoomerAMGDestroy(par_precond); - } - } + time_index = hypre_InitializeTiming("FlexGMRES Solve"); + hypre_BeginTiming(time_index); - /*----------------------------------------------------------- - * Solve the system using ParCSR version of LGMRES - *-----------------------------------------------------------*/ + HYPRE_FlexGMRESSolve( par_solver, (HYPRE_Matrix) par_A, + (HYPRE_Vector) par_b, (HYPRE_Vector) par_x); - if ((solver_id >= 90) && (solver_id < 100)) - { - time_index = hypre_InitializeTiming("LGMRES Setup"); - hypre_BeginTiming(time_index); + hypre_EndTiming(time_index); + hypre_PrintTiming("Solve phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); - HYPRE_ParCSRLGMRESCreate(hypre_MPI_COMM_WORLD, &par_solver); - HYPRE_LGMRESSetKDim(par_solver, 10); - HYPRE_LGMRESSetAugDim(par_solver, 2); - HYPRE_LGMRESSetMaxIter(par_solver, 100); - HYPRE_LGMRESSetTol(par_solver, tol); - HYPRE_LGMRESSetPrintLevel(par_solver, 1); - HYPRE_LGMRESSetLogging(par_solver, 1); - - if (solver_id == 90) - { - /* use BoomerAMG as preconditioner */ - HYPRE_BoomerAMGCreate(&par_precond); - if (old_default) HYPRE_BoomerAMGSetOldDefault(par_precond); - HYPRE_BoomerAMGSetStrongThreshold(par_precond, 0.25); - HYPRE_BoomerAMGSetTol(par_precond, 0.0); - HYPRE_BoomerAMGSetPrintLevel(par_precond, 1); - HYPRE_BoomerAMGSetPrintFileName(par_precond, "sstruct.out.log"); - HYPRE_BoomerAMGSetMaxIter(par_precond, 1); - HYPRE_LGMRESSetPrecond( par_solver, - (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, - (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, - par_precond); + HYPRE_FlexGMRESGetNumIterations( par_solver, &num_iterations); + HYPRE_FlexGMRESGetFinalRelativeResidualNorm( par_solver, &final_res_norm); + HYPRE_ParCSRFlexGMRESDestroy(par_solver); + + if (solver_id == 80) + { + HYPRE_BoomerAMGDestroy(par_precond); + } } - HYPRE_LGMRESSetup( par_solver, (HYPRE_Matrix) par_A, - (HYPRE_Vector) par_b, (HYPRE_Vector) par_x); + /*----------------------------------------------------------- + * Solve the system using ParCSR version of LGMRES + *-----------------------------------------------------------*/ - hypre_EndTiming(time_index); - hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + if ((solver_id >= 90) && (solver_id < 100)) + { + time_index = hypre_InitializeTiming("LGMRES Setup"); + hypre_BeginTiming(time_index); - time_index = hypre_InitializeTiming("LGMRES Solve"); - hypre_BeginTiming(time_index); + HYPRE_ParCSRLGMRESCreate(comm, &par_solver); + HYPRE_LGMRESSetKDim(par_solver, 10); + HYPRE_LGMRESSetAugDim(par_solver, 2); + HYPRE_LGMRESSetMaxIter(par_solver, 100); + HYPRE_LGMRESSetTol(par_solver, tol); + HYPRE_LGMRESSetPrintLevel(par_solver, solver_print_level); + HYPRE_LGMRESSetLogging(par_solver, 1); - HYPRE_LGMRESSolve( par_solver, (HYPRE_Matrix) par_A, - (HYPRE_Vector) par_b, (HYPRE_Vector) par_x); + if (solver_id == 90) + { + /* use BoomerAMG as preconditioner */ + HYPRE_BoomerAMGCreate(&par_precond); + if (old_default) { HYPRE_BoomerAMGSetOldDefault(par_precond); } + HYPRE_BoomerAMGSetStrongThreshold(par_precond, 0.25); + HYPRE_BoomerAMGSetTol(par_precond, 0.0); + HYPRE_BoomerAMGSetPrintLevel(par_precond, prec_print_level); + HYPRE_BoomerAMGSetPrintFileName(par_precond, "sstruct.out.log"); + HYPRE_BoomerAMGSetMaxIter(par_precond, 1); + HYPRE_LGMRESSetPrecond( par_solver, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, + par_precond); + } - hypre_EndTiming(time_index); - hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + HYPRE_LGMRESSetup( par_solver, (HYPRE_Matrix) par_A, + (HYPRE_Vector) par_b, (HYPRE_Vector) par_x); + + hypre_EndTiming(time_index); + hypre_PrintTiming("Setup phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + time_index = hypre_InitializeTiming("LGMRES Solve"); + hypre_BeginTiming(time_index); + + HYPRE_LGMRESSolve( par_solver, (HYPRE_Matrix) par_A, + (HYPRE_Vector) par_b, (HYPRE_Vector) par_x); + + hypre_EndTiming(time_index); + hypre_PrintTiming("Solve phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); - HYPRE_LGMRESGetNumIterations( par_solver, &num_iterations); - HYPRE_LGMRESGetFinalRelativeResidualNorm( par_solver, &final_res_norm); - HYPRE_ParCSRLGMRESDestroy(par_solver); + HYPRE_LGMRESGetNumIterations( par_solver, &num_iterations); + HYPRE_LGMRESGetFinalRelativeResidualNorm( par_solver, &final_res_norm); + HYPRE_ParCSRLGMRESDestroy(par_solver); - if (solver_id == 90) - { - HYPRE_BoomerAMGDestroy(par_precond); + if (solver_id == 90) + { + HYPRE_BoomerAMGDestroy(par_precond); + } } - } - /*----------------------------------------------------------- - * Solve the system using ParCSR hybrid DSCG/BoomerAMG - *-----------------------------------------------------------*/ + /*----------------------------------------------------------- + * Solve the system using ParCSR hybrid DSCG/BoomerAMG + *-----------------------------------------------------------*/ - if (solver_id == 120) - { - time_index = hypre_InitializeTiming("Hybrid Setup"); - hypre_BeginTiming(time_index); + if (solver_id == 120) + { + time_index = hypre_InitializeTiming("Hybrid Setup"); + hypre_BeginTiming(time_index); - HYPRE_ParCSRHybridCreate(&par_solver); - HYPRE_ParCSRHybridSetTol(par_solver, tol); - HYPRE_ParCSRHybridSetTwoNorm(par_solver, 1); - HYPRE_ParCSRHybridSetRelChange(par_solver, 0); - HYPRE_ParCSRHybridSetPrintLevel(par_solver,1); //13 - HYPRE_ParCSRHybridSetLogging(par_solver,1); - HYPRE_ParCSRHybridSetSolverType(par_solver, solver_type); - HYPRE_ParCSRHybridSetRecomputeResidual(par_solver, recompute_res); + HYPRE_ParCSRHybridCreate(&par_solver); + HYPRE_ParCSRHybridSetTol(par_solver, tol); + HYPRE_ParCSRHybridSetTwoNorm(par_solver, 1); + HYPRE_ParCSRHybridSetRelChange(par_solver, 0); + HYPRE_ParCSRHybridSetPrintLevel(par_solver, prec_print_level); //13 + HYPRE_ParCSRHybridSetLogging(par_solver, 1); + HYPRE_ParCSRHybridSetSolverType(par_solver, solver_type); + HYPRE_ParCSRHybridSetRecomputeResidual(par_solver, recompute_res); #if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_DEVICE_OPENMP) - /* - HYPRE_ParCSRHybridSetPMaxElmts(par_solver, 8); - HYPRE_ParCSRHybridSetRelaxType(par_solver, 18); - HYPRE_ParCSRHybridSetCycleRelaxType(par_solver, 9, 3); - HYPRE_ParCSRHybridSetCoarsenType(par_solver, 8); - HYPRE_ParCSRHybridSetInterpType(par_solver, 3); - HYPRE_ParCSRHybridSetMaxCoarseSize(par_solver, 20); - */ + /* + HYPRE_ParCSRHybridSetPMaxElmts(par_solver, 8); + HYPRE_ParCSRHybridSetRelaxType(par_solver, 18); + HYPRE_ParCSRHybridSetCycleRelaxType(par_solver, 9, 3); + HYPRE_ParCSRHybridSetCoarsenType(par_solver, 8); + HYPRE_ParCSRHybridSetInterpType(par_solver, 3); + HYPRE_ParCSRHybridSetMaxCoarseSize(par_solver, 20); + */ #endif #if SECOND_TIME - hypre_ParVector *par_x2 = - hypre_ParVectorCreate(hypre_ParVectorComm(par_x), hypre_ParVectorGlobalSize(par_x), - hypre_ParVectorPartitioning(par_x)); - hypre_ParVectorInitialize(par_x2); - hypre_ParVectorCopy(par_x, par_x2); + hypre_ParVector *par_x2 = + hypre_ParVectorCreate(hypre_ParVectorComm(par_x), hypre_ParVectorGlobalSize(par_x), + hypre_ParVectorPartitioning(par_x)); + hypre_ParVectorInitialize(par_x2); + hypre_ParVectorCopy(par_x, par_x2); - HYPRE_ParCSRHybridSetup(par_solver,par_A,par_b,par_x); - HYPRE_ParCSRHybridSolve(par_solver,par_A,par_b,par_x); + HYPRE_ParCSRHybridSetup(par_solver, par_A, par_b, par_x); + HYPRE_ParCSRHybridSolve(par_solver, par_A, par_b, par_x); - hypre_ParVectorCopy(par_x2, par_x); + hypre_ParVectorCopy(par_x2, par_x); #endif -#if defined(HYPRE_USING_NVTX) - hypre_GpuProfilingPushRange("HybridSolve"); -#endif - //cudaProfilerStart(); + hypre_GpuProfilingPushRange("HybridSolve"); + //cudaProfilerStart(); - HYPRE_ParCSRHybridSetup(par_solver,par_A,par_b,par_x); + HYPRE_ParCSRHybridSetup(par_solver, par_A, par_b, par_x); - hypre_EndTiming(time_index); - hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + hypre_EndTiming(time_index); + hypre_PrintTiming("Setup phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); - time_index = hypre_InitializeTiming("Hybrid Solve"); - hypre_BeginTiming(time_index); + time_index = hypre_InitializeTiming("Hybrid Solve"); + hypre_BeginTiming(time_index); - HYPRE_ParCSRHybridSolve(par_solver,par_A,par_b,par_x); + HYPRE_ParCSRHybridSolve(par_solver, par_A, par_b, par_x); - hypre_EndTiming(time_index); - hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + hypre_EndTiming(time_index); + hypre_PrintTiming("Solve phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); - HYPRE_ParCSRHybridGetNumIterations(par_solver, &num_iterations); - HYPRE_ParCSRHybridGetFinalRelativeResidualNorm(par_solver, &final_res_norm); + HYPRE_ParCSRHybridGetNumIterations(par_solver, &num_iterations); + HYPRE_ParCSRHybridGetFinalRelativeResidualNorm(par_solver, &final_res_norm); - /* - HYPRE_Real time[4]; - HYPRE_ParCSRHybridGetSetupSolveTime(par_solver, time); - if (myid == 0) - { - printf("ParCSRHybrid: Setup-Time1 %f, Solve-Time1 %f, Setup-Time2 %f, Solve-Time2 %f\n", - time[0], time[1], time[2], time[3]); - } - */ + /* + HYPRE_Real time[4]; + HYPRE_ParCSRHybridGetSetupSolveTime(par_solver, time); + if (myid == 0) + { + printf("ParCSRHybrid: Setup-Time1 %f, Solve-Time1 %f, Setup-Time2 %f, Solve-Time2 %f\n", + time[0], time[1], time[2], time[3]); + } + */ - HYPRE_ParCSRHybridDestroy(par_solver); + HYPRE_ParCSRHybridDestroy(par_solver); -#if defined(HYPRE_USING_NVTX) - hypre_GpuProfilingPopRange(); -#endif - //cudaProfilerStop(); + hypre_GpuProfilingPopRange(); + //cudaProfilerStop(); #if SECOND_TIME - hypre_ParVectorDestroy(par_x2); + hypre_ParVectorDestroy(par_x2); #endif - } - - /*----------------------------------------------------------- - * Solve the system using Struct solvers - *-----------------------------------------------------------*/ + } - if (solver_id == 200) - { - time_index = hypre_InitializeTiming("SMG Setup"); - hypre_BeginTiming(time_index); + /*----------------------------------------------------------- + * Solve the system using Struct solvers + *-----------------------------------------------------------*/ - HYPRE_StructSMGCreate(hypre_MPI_COMM_WORLD, &struct_solver); - HYPRE_StructSMGSetMemoryUse(struct_solver, 0); - HYPRE_StructSMGSetMaxIter(struct_solver, 50); - HYPRE_StructSMGSetTol(struct_solver, tol); - HYPRE_StructSMGSetRelChange(struct_solver, 0); - HYPRE_StructSMGSetNumPreRelax(struct_solver, n_pre); - HYPRE_StructSMGSetNumPostRelax(struct_solver, n_post); - HYPRE_StructSMGSetPrintLevel(struct_solver, 1); - HYPRE_StructSMGSetLogging(struct_solver, 1); - HYPRE_StructSMGSetup(struct_solver, sA, sb, sx); + if (solver_id == 200) + { + time_index = hypre_InitializeTiming("SMG Setup"); + hypre_BeginTiming(time_index); - hypre_EndTiming(time_index); - hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + HYPRE_StructSMGCreate(comm, &struct_solver); + HYPRE_StructSMGSetMemoryUse(struct_solver, 0); + HYPRE_StructSMGSetMaxIter(struct_solver, 50); + HYPRE_StructSMGSetTol(struct_solver, tol); + HYPRE_StructSMGSetRelChange(struct_solver, 0); + HYPRE_StructSMGSetNumPreRelax(struct_solver, n_pre); + HYPRE_StructSMGSetNumPostRelax(struct_solver, n_post); + HYPRE_StructSMGSetPrintLevel(struct_solver, prec_print_level); + HYPRE_StructSMGSetLogging(struct_solver, 1); + HYPRE_StructSMGSetup(struct_solver, sA, sb, sx); - time_index = hypre_InitializeTiming("SMG Solve"); - hypre_BeginTiming(time_index); + hypre_EndTiming(time_index); + hypre_PrintTiming("Setup phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); - HYPRE_StructSMGSolve(struct_solver, sA, sb, sx); + time_index = hypre_InitializeTiming("SMG Solve"); + hypre_BeginTiming(time_index); - hypre_EndTiming(time_index); - hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + HYPRE_StructSMGSolve(struct_solver, sA, sb, sx); - HYPRE_StructSMGGetNumIterations(struct_solver, &num_iterations); - HYPRE_StructSMGGetFinalRelativeResidualNorm(struct_solver, &final_res_norm); - HYPRE_StructSMGDestroy(struct_solver); - } + hypre_EndTiming(time_index); + hypre_PrintTiming("Solve phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); - else if ( solver_id == 201 || solver_id == 203 || solver_id == 204 ) - { - time_index = hypre_InitializeTiming("PFMG Setup"); - hypre_BeginTiming(time_index); + HYPRE_StructSMGGetNumIterations(struct_solver, &num_iterations); + HYPRE_StructSMGGetFinalRelativeResidualNorm(struct_solver, &final_res_norm); + HYPRE_StructSMGDestroy(struct_solver); + } - HYPRE_StructPFMGCreate(hypre_MPI_COMM_WORLD, &struct_solver); - HYPRE_StructPFMGSetMaxIter(struct_solver, 50); - HYPRE_StructPFMGSetTol(struct_solver, tol); - HYPRE_StructPFMGSetRelChange(struct_solver, 0); - HYPRE_StructPFMGSetRAPType(struct_solver, rap); - HYPRE_StructPFMGSetRelaxType(struct_solver, relax); - if (usr_jacobi_weight) + else if ( solver_id == 201 || solver_id == 203 || solver_id == 204 ) { - HYPRE_StructPFMGSetJacobiWeight(struct_solver, jacobi_weight); - } - HYPRE_StructPFMGSetNumPreRelax(struct_solver, n_pre); - HYPRE_StructPFMGSetNumPostRelax(struct_solver, n_post); - HYPRE_StructPFMGSetSkipRelax(struct_solver, skip); - /*HYPRE_StructPFMGSetDxyz(struct_solver, dxyz);*/ - HYPRE_StructPFMGSetPrintLevel(struct_solver, 1); - HYPRE_StructPFMGSetLogging(struct_solver, 1); - HYPRE_StructPFMGSetup(struct_solver, sA, sb, sx); + time_index = hypre_InitializeTiming("PFMG Setup"); + hypre_BeginTiming(time_index); - hypre_EndTiming(time_index); - hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + HYPRE_StructPFMGCreate(comm, &struct_solver); + HYPRE_StructPFMGSetMaxIter(struct_solver, 50); + HYPRE_StructPFMGSetTol(struct_solver, tol); + HYPRE_StructPFMGSetRelChange(struct_solver, 0); + HYPRE_StructPFMGSetRAPType(struct_solver, rap); + HYPRE_StructPFMGSetRelaxType(struct_solver, relax); + if (usr_jacobi_weight) + { + HYPRE_StructPFMGSetJacobiWeight(struct_solver, jacobi_weight); + } + HYPRE_StructPFMGSetNumPreRelax(struct_solver, n_pre); + HYPRE_StructPFMGSetNumPostRelax(struct_solver, n_post); + HYPRE_StructPFMGSetSkipRelax(struct_solver, skip); + /*HYPRE_StructPFMGSetDxyz(struct_solver, dxyz);*/ + HYPRE_StructPFMGSetPrintLevel(struct_solver, prec_print_level); + HYPRE_StructPFMGSetLogging(struct_solver, 1); + HYPRE_StructPFMGSetup(struct_solver, sA, sb, sx); - time_index = hypre_InitializeTiming("PFMG Solve"); - hypre_BeginTiming(time_index); + hypre_EndTiming(time_index); + hypre_PrintTiming("Setup phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); - HYPRE_StructPFMGSolve(struct_solver, sA, sb, sx); + time_index = hypre_InitializeTiming("PFMG Solve"); + hypre_BeginTiming(time_index); - hypre_EndTiming(time_index); - hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + HYPRE_StructPFMGSolve(struct_solver, sA, sb, sx); - HYPRE_StructPFMGGetNumIterations(struct_solver, &num_iterations); - HYPRE_StructPFMGGetFinalRelativeResidualNorm(struct_solver, &final_res_norm); - HYPRE_StructPFMGDestroy(struct_solver); - } + hypre_EndTiming(time_index); + hypre_PrintTiming("Solve phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); - /*----------------------------------------------------------- - * Solve the system using Cyclic Reduction - *-----------------------------------------------------------*/ + HYPRE_StructPFMGGetNumIterations(struct_solver, &num_iterations); + HYPRE_StructPFMGGetFinalRelativeResidualNorm(struct_solver, &final_res_norm); + HYPRE_StructPFMGDestroy(struct_solver); + } - else if ( solver_id == 205 ) - { - HYPRE_StructVector sr; + /*----------------------------------------------------------- + * Solve the system using Cyclic Reduction + *-----------------------------------------------------------*/ - time_index = hypre_InitializeTiming("CycRed Setup"); - hypre_BeginTiming(time_index); + else if ( solver_id == 205 ) + { + HYPRE_StructVector sr; - HYPRE_StructCycRedCreate(hypre_MPI_COMM_WORLD, &struct_solver); - HYPRE_StructCycRedSetTDim(struct_solver, cycred_tdim); - HYPRE_StructCycRedSetBase(struct_solver, data.ndim, - cycred_index, cycred_stride); - HYPRE_StructCycRedSetup(struct_solver, sA, sb, sx); + time_index = hypre_InitializeTiming("CycRed Setup"); + hypre_BeginTiming(time_index); - hypre_EndTiming(time_index); - hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + HYPRE_StructCycRedCreate(comm, &struct_solver); + HYPRE_StructCycRedSetTDim(struct_solver, cycred_tdim); + HYPRE_StructCycRedSetBase(struct_solver, data.ndim, + cycred_index, cycred_stride); + HYPRE_StructCycRedSetup(struct_solver, sA, sb, sx); - time_index = hypre_InitializeTiming("CycRed Solve"); - hypre_BeginTiming(time_index); + hypre_EndTiming(time_index); + hypre_PrintTiming("Setup phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); - HYPRE_StructCycRedSolve(struct_solver, sA, sb, sx); + time_index = hypre_InitializeTiming("CycRed Solve"); + hypre_BeginTiming(time_index); - hypre_EndTiming(time_index); - hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + HYPRE_StructCycRedSolve(struct_solver, sA, sb, sx); - num_iterations = 1; - HYPRE_StructVectorCreate(hypre_MPI_COMM_WORLD, - hypre_StructVectorGrid(sb), &sr); - HYPRE_StructVectorInitialize(sr); - HYPRE_StructVectorAssemble(sr); - HYPRE_StructVectorCopy(sb, sr); - hypre_StructMatvec(-1.0, sA, sx, 1.0, sr); - /* Using an inner product instead of a norm to help with testing */ - final_res_norm = hypre_StructInnerProd(sr, sr); - if (final_res_norm < 1.0e-20) - { - final_res_norm = 0.0; - } - HYPRE_StructVectorDestroy(sr); + hypre_EndTiming(time_index); + hypre_PrintTiming("Solve phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); - HYPRE_StructCycRedDestroy(struct_solver); - } + num_iterations = 1; + HYPRE_StructVectorCreate(comm, + hypre_StructVectorGrid(sb), &sr); + HYPRE_StructVectorInitialize(sr); + HYPRE_StructVectorAssemble(sr); + HYPRE_StructVectorCopy(sb, sr); + hypre_StructMatvec(-1.0, sA, sx, 1.0, sr); + /* Using an inner product instead of a norm to help with testing */ + final_res_norm = hypre_StructInnerProd(sr, sr); + if (final_res_norm < 1.0e-20) + { + final_res_norm = 0.0; + } + HYPRE_StructVectorDestroy(sr); - /*----------------------------------------------------------- - * Solve the system using SparseMSG - *-----------------------------------------------------------*/ + HYPRE_StructCycRedDestroy(struct_solver); + } - else if (solver_id == 202) - { - time_index = hypre_InitializeTiming("SparseMSG Setup"); - hypre_BeginTiming(time_index); + /*----------------------------------------------------------- + * Solve the system using SparseMSG + *-----------------------------------------------------------*/ - HYPRE_StructSparseMSGCreate(hypre_MPI_COMM_WORLD, &struct_solver); - HYPRE_StructSparseMSGSetMaxIter(struct_solver, 50); - HYPRE_StructSparseMSGSetJump(struct_solver, jump); - HYPRE_StructSparseMSGSetTol(struct_solver, tol); - HYPRE_StructSparseMSGSetRelChange(struct_solver, 0); - HYPRE_StructSparseMSGSetRelaxType(struct_solver, relax); - if (usr_jacobi_weight) + else if (solver_id == 202) { - HYPRE_StructSparseMSGSetJacobiWeight(struct_solver, jacobi_weight); - } - HYPRE_StructSparseMSGSetNumPreRelax(struct_solver, n_pre); - HYPRE_StructSparseMSGSetNumPostRelax(struct_solver, n_post); - HYPRE_StructSparseMSGSetPrintLevel(struct_solver, 1); - HYPRE_StructSparseMSGSetLogging(struct_solver, 1); - HYPRE_StructSparseMSGSetup(struct_solver, sA, sb, sx); + time_index = hypre_InitializeTiming("SparseMSG Setup"); + hypre_BeginTiming(time_index); - hypre_EndTiming(time_index); - hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + HYPRE_StructSparseMSGCreate(comm, &struct_solver); + HYPRE_StructSparseMSGSetMaxIter(struct_solver, 50); + HYPRE_StructSparseMSGSetJump(struct_solver, jump); + HYPRE_StructSparseMSGSetTol(struct_solver, tol); + HYPRE_StructSparseMSGSetRelChange(struct_solver, 0); + HYPRE_StructSparseMSGSetRelaxType(struct_solver, relax); + if (usr_jacobi_weight) + { + HYPRE_StructSparseMSGSetJacobiWeight(struct_solver, jacobi_weight); + } + HYPRE_StructSparseMSGSetNumPreRelax(struct_solver, n_pre); + HYPRE_StructSparseMSGSetNumPostRelax(struct_solver, n_post); + HYPRE_StructSparseMSGSetPrintLevel(struct_solver, prec_print_level); + HYPRE_StructSparseMSGSetLogging(struct_solver, 1); + HYPRE_StructSparseMSGSetup(struct_solver, sA, sb, sx); - time_index = hypre_InitializeTiming("SparseMSG Solve"); - hypre_BeginTiming(time_index); + hypre_EndTiming(time_index); + hypre_PrintTiming("Setup phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + time_index = hypre_InitializeTiming("SparseMSG Solve"); + hypre_BeginTiming(time_index); - HYPRE_StructSparseMSGSolve(struct_solver, sA, sb, sx); + HYPRE_StructSparseMSGSolve(struct_solver, sA, sb, sx); - hypre_EndTiming(time_index); - hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + hypre_EndTiming(time_index); + hypre_PrintTiming("Solve phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); - HYPRE_StructSparseMSGGetNumIterations(struct_solver, &num_iterations); - HYPRE_StructSparseMSGGetFinalRelativeResidualNorm(struct_solver, - &final_res_norm); - HYPRE_StructSparseMSGDestroy(struct_solver); - } + HYPRE_StructSparseMSGGetNumIterations(struct_solver, &num_iterations); + HYPRE_StructSparseMSGGetFinalRelativeResidualNorm(struct_solver, + &final_res_norm); + HYPRE_StructSparseMSGDestroy(struct_solver); + } - /*----------------------------------------------------------- - * Solve the system using Jacobi - *-----------------------------------------------------------*/ + /*----------------------------------------------------------- + * Solve the system using Jacobi + *-----------------------------------------------------------*/ - else if ( solver_id == 208 ) - { - time_index = hypre_InitializeTiming("Jacobi Setup"); - hypre_BeginTiming(time_index); + else if ( solver_id == 208 ) + { + time_index = hypre_InitializeTiming("Jacobi Setup"); + hypre_BeginTiming(time_index); - HYPRE_StructJacobiCreate(hypre_MPI_COMM_WORLD, &struct_solver); - HYPRE_StructJacobiSetMaxIter(struct_solver, 100); - HYPRE_StructJacobiSetTol(struct_solver, tol); - HYPRE_StructJacobiSetup(struct_solver, sA, sb, sx); + HYPRE_StructJacobiCreate(comm, &struct_solver); + HYPRE_StructJacobiSetMaxIter(struct_solver, 100); + HYPRE_StructJacobiSetTol(struct_solver, tol); + HYPRE_StructJacobiSetup(struct_solver, sA, sb, sx); - hypre_EndTiming(time_index); - hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + hypre_EndTiming(time_index); + hypre_PrintTiming("Setup phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); - time_index = hypre_InitializeTiming("Jacobi Solve"); - hypre_BeginTiming(time_index); + time_index = hypre_InitializeTiming("Jacobi Solve"); + hypre_BeginTiming(time_index); - HYPRE_StructJacobiSolve(struct_solver, sA, sb, sx); + HYPRE_StructJacobiSolve(struct_solver, sA, sb, sx); - hypre_EndTiming(time_index); - hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + hypre_EndTiming(time_index); + hypre_PrintTiming("Solve phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); - HYPRE_StructJacobiGetNumIterations(struct_solver, &num_iterations); - HYPRE_StructJacobiGetFinalRelativeResidualNorm(struct_solver, - &final_res_norm); - HYPRE_StructJacobiDestroy(struct_solver); - } + HYPRE_StructJacobiGetNumIterations(struct_solver, &num_iterations); + HYPRE_StructJacobiGetFinalRelativeResidualNorm(struct_solver, + &final_res_norm); + HYPRE_StructJacobiDestroy(struct_solver); + } - /*----------------------------------------------------------- - * Solve the system using CG - *-----------------------------------------------------------*/ + /*----------------------------------------------------------- + * Solve the system using CG + *-----------------------------------------------------------*/ - if ((solver_id > 209) && (solver_id < 220)) - { - time_index = hypre_InitializeTiming("PCG Setup"); - hypre_BeginTiming(time_index); + if ((solver_id > 209) && (solver_id < 220)) + { + time_index = hypre_InitializeTiming("PCG Setup"); + hypre_BeginTiming(time_index); - HYPRE_StructPCGCreate(hypre_MPI_COMM_WORLD, &struct_solver); - HYPRE_PCGSetMaxIter( (HYPRE_Solver)struct_solver, 100 ); - HYPRE_PCGSetTol( (HYPRE_Solver)struct_solver, tol ); - HYPRE_PCGSetTwoNorm( (HYPRE_Solver)struct_solver, 1 ); - HYPRE_PCGSetRelChange( (HYPRE_Solver)struct_solver, 0 ); - HYPRE_PCGSetPrintLevel( (HYPRE_Solver)struct_solver, 1 ); - HYPRE_PCGSetRecomputeResidual( (HYPRE_Solver)struct_solver, recompute_res); - - if (solver_id == 210) - { - /* use symmetric SMG as preconditioner */ - HYPRE_StructSMGCreate(hypre_MPI_COMM_WORLD, &struct_precond); - HYPRE_StructSMGSetMemoryUse(struct_precond, 0); - HYPRE_StructSMGSetMaxIter(struct_precond, 1); - HYPRE_StructSMGSetTol(struct_precond, 0.0); - HYPRE_StructSMGSetZeroGuess(struct_precond); - HYPRE_StructSMGSetNumPreRelax(struct_precond, n_pre); - HYPRE_StructSMGSetNumPostRelax(struct_precond, n_post); - HYPRE_StructSMGSetPrintLevel(struct_precond, 0); - HYPRE_StructSMGSetLogging(struct_precond, 0); - HYPRE_PCGSetPrecond( (HYPRE_Solver) struct_solver, - (HYPRE_PtrToSolverFcn) HYPRE_StructSMGSolve, - (HYPRE_PtrToSolverFcn) HYPRE_StructSMGSetup, - (HYPRE_Solver) struct_precond); - } - - else if (solver_id == 211) - { - /* use symmetric PFMG as preconditioner */ - HYPRE_StructPFMGCreate(hypre_MPI_COMM_WORLD, &struct_precond); - HYPRE_StructPFMGSetMaxIter(struct_precond, 1); - HYPRE_StructPFMGSetTol(struct_precond, 0.0); - HYPRE_StructPFMGSetZeroGuess(struct_precond); - HYPRE_StructPFMGSetRAPType(struct_precond, rap); - HYPRE_StructPFMGSetRelaxType(struct_precond, relax); - if (usr_jacobi_weight) + HYPRE_StructPCGCreate(comm, &struct_solver); + HYPRE_PCGSetMaxIter( (HYPRE_Solver)struct_solver, 100 ); + HYPRE_PCGSetTol( (HYPRE_Solver)struct_solver, tol ); + HYPRE_PCGSetTwoNorm( (HYPRE_Solver)struct_solver, 1 ); + HYPRE_PCGSetRelChange( (HYPRE_Solver)struct_solver, 0 ); + HYPRE_PCGSetPrintLevel( (HYPRE_Solver)struct_solver, solver_print_level ); + HYPRE_PCGSetRecomputeResidual( (HYPRE_Solver)struct_solver, recompute_res); + + if (solver_id == 210) { - HYPRE_StructPFMGSetJacobiWeight(struct_precond, jacobi_weight); - } - HYPRE_StructPFMGSetNumPreRelax(struct_precond, n_pre); - HYPRE_StructPFMGSetNumPostRelax(struct_precond, n_post); - HYPRE_StructPFMGSetSkipRelax(struct_precond, skip); - /*HYPRE_StructPFMGSetDxyz(struct_precond, dxyz);*/ - HYPRE_StructPFMGSetPrintLevel(struct_precond, 0); - HYPRE_StructPFMGSetLogging(struct_precond, 0); - HYPRE_PCGSetPrecond( (HYPRE_Solver) struct_solver, - (HYPRE_PtrToSolverFcn) HYPRE_StructPFMGSolve, - (HYPRE_PtrToSolverFcn) HYPRE_StructPFMGSetup, - (HYPRE_Solver) struct_precond); - } - - else if (solver_id == 212) - { - /* use symmetric SparseMSG as preconditioner */ - HYPRE_StructSparseMSGCreate(hypre_MPI_COMM_WORLD, &struct_precond); - HYPRE_StructSparseMSGSetMaxIter(struct_precond, 1); - HYPRE_StructSparseMSGSetJump(struct_precond, jump); - HYPRE_StructSparseMSGSetTol(struct_precond, 0.0); - HYPRE_StructSparseMSGSetZeroGuess(struct_precond); - HYPRE_StructSparseMSGSetRelaxType(struct_precond, relax); - if (usr_jacobi_weight) + /* use symmetric SMG as preconditioner */ + HYPRE_StructSMGCreate(comm, &struct_precond); + HYPRE_StructSMGSetMemoryUse(struct_precond, 0); + HYPRE_StructSMGSetMaxIter(struct_precond, 1); + HYPRE_StructSMGSetTol(struct_precond, 0.0); + HYPRE_StructSMGSetZeroGuess(struct_precond); + HYPRE_StructSMGSetNumPreRelax(struct_precond, n_pre); + HYPRE_StructSMGSetNumPostRelax(struct_precond, n_post); + HYPRE_StructSMGSetPrintLevel(struct_precond, prec_print_level); + HYPRE_StructSMGSetLogging(struct_precond, 0); + HYPRE_PCGSetPrecond( (HYPRE_Solver) struct_solver, + (HYPRE_PtrToSolverFcn) HYPRE_StructSMGSolve, + (HYPRE_PtrToSolverFcn) HYPRE_StructSMGSetup, + (HYPRE_Solver) struct_precond); + } + + else if (solver_id == 211) { - HYPRE_StructSparseMSGSetJacobiWeight(struct_precond, jacobi_weight); + /* use symmetric PFMG as preconditioner */ + HYPRE_StructPFMGCreate(comm, &struct_precond); + HYPRE_StructPFMGSetMaxIter(struct_precond, 1); + HYPRE_StructPFMGSetTol(struct_precond, 0.0); + HYPRE_StructPFMGSetZeroGuess(struct_precond); + HYPRE_StructPFMGSetRAPType(struct_precond, rap); + HYPRE_StructPFMGSetRelaxType(struct_precond, relax); + if (usr_jacobi_weight) + { + HYPRE_StructPFMGSetJacobiWeight(struct_precond, jacobi_weight); + } + HYPRE_StructPFMGSetNumPreRelax(struct_precond, n_pre); + HYPRE_StructPFMGSetNumPostRelax(struct_precond, n_post); + HYPRE_StructPFMGSetSkipRelax(struct_precond, skip); + /*HYPRE_StructPFMGSetDxyz(struct_precond, dxyz);*/ + HYPRE_StructPFMGSetPrintLevel(struct_precond, prec_print_level); + HYPRE_StructPFMGSetLogging(struct_precond, 0); + HYPRE_PCGSetPrecond( (HYPRE_Solver) struct_solver, + (HYPRE_PtrToSolverFcn) HYPRE_StructPFMGSolve, + (HYPRE_PtrToSolverFcn) HYPRE_StructPFMGSetup, + (HYPRE_Solver) struct_precond); } - HYPRE_StructSparseMSGSetNumPreRelax(struct_precond, n_pre); - HYPRE_StructSparseMSGSetNumPostRelax(struct_precond, n_post); - HYPRE_StructSparseMSGSetPrintLevel(struct_precond, 0); - HYPRE_StructSparseMSGSetLogging(struct_precond, 0); - HYPRE_PCGSetPrecond( (HYPRE_Solver) struct_solver, - (HYPRE_PtrToSolverFcn) HYPRE_StructSparseMSGSolve, - (HYPRE_PtrToSolverFcn) HYPRE_StructSparseMSGSetup, - (HYPRE_Solver) struct_precond); - } - else if (solver_id == 217) - { - /* use two-step Jacobi as preconditioner */ - HYPRE_StructJacobiCreate(hypre_MPI_COMM_WORLD, &struct_precond); - HYPRE_StructJacobiSetMaxIter(struct_precond, 2); - HYPRE_StructJacobiSetTol(struct_precond, 0.0); - HYPRE_StructJacobiSetZeroGuess(struct_precond); - HYPRE_PCGSetPrecond( (HYPRE_Solver) struct_solver, - (HYPRE_PtrToSolverFcn) HYPRE_StructJacobiSolve, - (HYPRE_PtrToSolverFcn) HYPRE_StructJacobiSetup, - (HYPRE_Solver) struct_precond); - } + else if (solver_id == 212) + { + /* use symmetric SparseMSG as preconditioner */ + HYPRE_StructSparseMSGCreate(comm, &struct_precond); + HYPRE_StructSparseMSGSetMaxIter(struct_precond, 1); + HYPRE_StructSparseMSGSetJump(struct_precond, jump); + HYPRE_StructSparseMSGSetTol(struct_precond, 0.0); + HYPRE_StructSparseMSGSetZeroGuess(struct_precond); + HYPRE_StructSparseMSGSetRelaxType(struct_precond, relax); + if (usr_jacobi_weight) + { + HYPRE_StructSparseMSGSetJacobiWeight(struct_precond, jacobi_weight); + } + HYPRE_StructSparseMSGSetNumPreRelax(struct_precond, n_pre); + HYPRE_StructSparseMSGSetNumPostRelax(struct_precond, n_post); + HYPRE_StructSparseMSGSetPrintLevel(struct_precond, prec_print_level); + HYPRE_StructSparseMSGSetLogging(struct_precond, 0); + HYPRE_PCGSetPrecond( (HYPRE_Solver) struct_solver, + (HYPRE_PtrToSolverFcn) HYPRE_StructSparseMSGSolve, + (HYPRE_PtrToSolverFcn) HYPRE_StructSparseMSGSetup, + (HYPRE_Solver) struct_precond); + } - else if (solver_id == 218) - { - /* use diagonal scaling as preconditioner */ - struct_precond = NULL; - HYPRE_PCGSetPrecond( (HYPRE_Solver) struct_solver, - (HYPRE_PtrToSolverFcn) HYPRE_StructDiagScale, - (HYPRE_PtrToSolverFcn) HYPRE_StructDiagScaleSetup, - (HYPRE_Solver) struct_precond); - } + else if (solver_id == 217) + { + /* use two-step Jacobi as preconditioner */ + HYPRE_StructJacobiCreate(comm, &struct_precond); + HYPRE_StructJacobiSetMaxIter(struct_precond, 2); + HYPRE_StructJacobiSetTol(struct_precond, 0.0); + HYPRE_StructJacobiSetZeroGuess(struct_precond); + HYPRE_PCGSetPrecond( (HYPRE_Solver) struct_solver, + (HYPRE_PtrToSolverFcn) HYPRE_StructJacobiSolve, + (HYPRE_PtrToSolverFcn) HYPRE_StructJacobiSetup, + (HYPRE_Solver) struct_precond); + } + + else if (solver_id == 218) + { + /* use diagonal scaling as preconditioner */ + struct_precond = NULL; + HYPRE_PCGSetPrecond( (HYPRE_Solver) struct_solver, + (HYPRE_PtrToSolverFcn) HYPRE_StructDiagScale, + (HYPRE_PtrToSolverFcn) HYPRE_StructDiagScaleSetup, + (HYPRE_Solver) struct_precond); + } - HYPRE_PCGSetup + HYPRE_PCGSetup ( (HYPRE_Solver)struct_solver, (HYPRE_Matrix)sA, (HYPRE_Vector)sb, (HYPRE_Vector)sx ); - hypre_EndTiming(time_index); - hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + hypre_EndTiming(time_index); + hypre_PrintTiming("Setup phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); - time_index = hypre_InitializeTiming("PCG Solve"); - hypre_BeginTiming(time_index); + time_index = hypre_InitializeTiming("PCG Solve"); + hypre_BeginTiming(time_index); - HYPRE_PCGSolve + HYPRE_PCGSolve ( (HYPRE_Solver) struct_solver, (HYPRE_Matrix)sA, (HYPRE_Vector)sb, (HYPRE_Vector)sx); - hypre_EndTiming(time_index); - hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); - - HYPRE_PCGGetNumIterations( (HYPRE_Solver)struct_solver, &num_iterations ); - HYPRE_PCGGetFinalRelativeResidualNorm( (HYPRE_Solver)struct_solver, &final_res_norm ); - HYPRE_StructPCGDestroy(struct_solver); - - if (solver_id == 210) - { - HYPRE_StructSMGDestroy(struct_precond); - } - else if (solver_id == 211) - { - HYPRE_StructPFMGDestroy(struct_precond); - } - else if (solver_id == 212) - { - HYPRE_StructSparseMSGDestroy(struct_precond); - } - else if (solver_id == 217) - { - HYPRE_StructJacobiDestroy(struct_precond); - } - } - - /*----------------------------------------------------------- - * Solve the system using Hybrid - *-----------------------------------------------------------*/ + hypre_EndTiming(time_index); + hypre_PrintTiming("Solve phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); - if ((solver_id > 219) && (solver_id < 230)) - { - time_index = hypre_InitializeTiming("Hybrid Setup"); - hypre_BeginTiming(time_index); + HYPRE_PCGGetNumIterations( (HYPRE_Solver)struct_solver, &num_iterations ); + HYPRE_PCGGetFinalRelativeResidualNorm( (HYPRE_Solver)struct_solver, &final_res_norm ); + HYPRE_StructPCGDestroy(struct_solver); - HYPRE_StructHybridCreate(hypre_MPI_COMM_WORLD, &struct_solver); - HYPRE_StructHybridSetDSCGMaxIter(struct_solver, 100); - HYPRE_StructHybridSetPCGMaxIter(struct_solver, 100); - HYPRE_StructHybridSetTol(struct_solver, tol); - /*HYPRE_StructHybridSetPCGAbsoluteTolFactor(struct_solver, 1.0e-200);*/ - HYPRE_StructHybridSetConvergenceTol(struct_solver, cf_tol); - HYPRE_StructHybridSetTwoNorm(struct_solver, 1); - HYPRE_StructHybridSetRelChange(struct_solver, 0); - if (solver_type == 2) /* for use with GMRES */ - { - HYPRE_StructHybridSetStopCrit(struct_solver, 0); - HYPRE_StructHybridSetKDim(struct_solver, 10); - } - HYPRE_StructHybridSetPrintLevel(struct_solver, 1); - HYPRE_StructHybridSetLogging(struct_solver, 1); - HYPRE_StructHybridSetSolverType(struct_solver, solver_type); - HYPRE_StructHybridSetRecomputeResidual(struct_solver, recompute_res); - - if (solver_id == 220) - { - /* use symmetric SMG as preconditioner */ - HYPRE_StructSMGCreate(hypre_MPI_COMM_WORLD, &struct_precond); - HYPRE_StructSMGSetMemoryUse(struct_precond, 0); - HYPRE_StructSMGSetMaxIter(struct_precond, 1); - HYPRE_StructSMGSetTol(struct_precond, 0.0); - HYPRE_StructSMGSetZeroGuess(struct_precond); - HYPRE_StructSMGSetNumPreRelax(struct_precond, n_pre); - HYPRE_StructSMGSetNumPostRelax(struct_precond, n_post); - HYPRE_StructSMGSetPrintLevel(struct_precond, 0); - HYPRE_StructSMGSetLogging(struct_precond, 0); - HYPRE_StructHybridSetPrecond(struct_solver, - HYPRE_StructSMGSolve, - HYPRE_StructSMGSetup, - struct_precond); - } - - else if (solver_id == 221) - { - /* use symmetric PFMG as preconditioner */ - HYPRE_StructPFMGCreate(hypre_MPI_COMM_WORLD, &struct_precond); - HYPRE_StructPFMGSetMaxIter(struct_precond, 1); - HYPRE_StructPFMGSetTol(struct_precond, 0.0); - HYPRE_StructPFMGSetZeroGuess(struct_precond); - HYPRE_StructPFMGSetRAPType(struct_precond, rap); - HYPRE_StructPFMGSetRelaxType(struct_precond, relax); - if (usr_jacobi_weight) + if (solver_id == 210) { - HYPRE_StructPFMGSetJacobiWeight(struct_precond, jacobi_weight); - } - HYPRE_StructPFMGSetNumPreRelax(struct_precond, n_pre); - HYPRE_StructPFMGSetNumPostRelax(struct_precond, n_post); - HYPRE_StructPFMGSetSkipRelax(struct_precond, skip); - /*HYPRE_StructPFMGSetDxyz(struct_precond, dxyz);*/ - HYPRE_StructPFMGSetPrintLevel(struct_precond, 0); - HYPRE_StructPFMGSetLogging(struct_precond, 0); - HYPRE_StructHybridSetPrecond(struct_solver, - HYPRE_StructPFMGSolve, - HYPRE_StructPFMGSetup, - struct_precond); - } - - else if (solver_id == 222) - { - /* use symmetric SparseMSG as preconditioner */ - HYPRE_StructSparseMSGCreate(hypre_MPI_COMM_WORLD, &struct_precond); - HYPRE_StructSparseMSGSetJump(struct_precond, jump); - HYPRE_StructSparseMSGSetMaxIter(struct_precond, 1); - HYPRE_StructSparseMSGSetTol(struct_precond, 0.0); - HYPRE_StructSparseMSGSetZeroGuess(struct_precond); - HYPRE_StructSparseMSGSetRelaxType(struct_precond, relax); - if (usr_jacobi_weight) + HYPRE_StructSMGDestroy(struct_precond); + } + else if (solver_id == 211) { - HYPRE_StructSparseMSGSetJacobiWeight(struct_precond, jacobi_weight); + HYPRE_StructPFMGDestroy(struct_precond); } - HYPRE_StructSparseMSGSetNumPreRelax(struct_precond, n_pre); - HYPRE_StructSparseMSGSetNumPostRelax(struct_precond, n_post); - HYPRE_StructSparseMSGSetPrintLevel(struct_precond, 0); - HYPRE_StructSparseMSGSetLogging(struct_precond, 0); - HYPRE_StructHybridSetPrecond(struct_solver, - HYPRE_StructSparseMSGSolve, - HYPRE_StructSparseMSGSetup, - struct_precond); - } - - HYPRE_StructHybridSetup(struct_solver, sA, sb, sx); - - hypre_EndTiming(time_index); - hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); - - time_index = hypre_InitializeTiming("Hybrid Solve"); - hypre_BeginTiming(time_index); - - HYPRE_StructHybridSolve(struct_solver, sA, sb, sx); - - hypre_EndTiming(time_index); - hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); - - HYPRE_StructHybridGetNumIterations(struct_solver, &num_iterations); - HYPRE_StructHybridGetFinalRelativeResidualNorm(struct_solver, &final_res_norm); - HYPRE_StructHybridDestroy(struct_solver); - - if (solver_id == 220) - { - HYPRE_StructSMGDestroy(struct_precond); - } - else if (solver_id == 221) - { - HYPRE_StructPFMGDestroy(struct_precond); - } - else if (solver_id == 222) - { - HYPRE_StructSparseMSGDestroy(struct_precond); - } - } - - /*----------------------------------------------------------- - * Solve the system using GMRES - *-----------------------------------------------------------*/ - - if ((solver_id > 229) && (solver_id < 240)) - { - time_index = hypre_InitializeTiming("GMRES Setup"); - hypre_BeginTiming(time_index); - - HYPRE_StructGMRESCreate(hypre_MPI_COMM_WORLD, &struct_solver); - HYPRE_GMRESSetMaxIter( (HYPRE_Solver)struct_solver, 100 ); - HYPRE_GMRESSetTol( (HYPRE_Solver)struct_solver, tol ); - HYPRE_GMRESSetRelChange( (HYPRE_Solver)struct_solver, 0 ); - HYPRE_GMRESSetPrintLevel( (HYPRE_Solver)struct_solver, 1 ); - HYPRE_GMRESSetLogging( (HYPRE_Solver)struct_solver, 1 ); - - if (solver_id == 230) - { - /* use symmetric SMG as preconditioner */ - HYPRE_StructSMGCreate(hypre_MPI_COMM_WORLD, &struct_precond); - HYPRE_StructSMGSetMemoryUse(struct_precond, 0); - HYPRE_StructSMGSetMaxIter(struct_precond, 1); - HYPRE_StructSMGSetTol(struct_precond, 0.0); - HYPRE_StructSMGSetZeroGuess(struct_precond); - HYPRE_StructSMGSetNumPreRelax(struct_precond, n_pre); - HYPRE_StructSMGSetNumPostRelax(struct_precond, n_post); - HYPRE_StructSMGSetPrintLevel(struct_precond, 0); - HYPRE_StructSMGSetLogging(struct_precond, 0); - HYPRE_GMRESSetPrecond( (HYPRE_Solver)struct_solver, - (HYPRE_PtrToSolverFcn) HYPRE_StructSMGSolve, - (HYPRE_PtrToSolverFcn) HYPRE_StructSMGSetup, - (HYPRE_Solver)struct_precond); - } - - else if (solver_id == 231) - { - /* use symmetric PFMG as preconditioner */ - HYPRE_StructPFMGCreate(hypre_MPI_COMM_WORLD, &struct_precond); - HYPRE_StructPFMGSetMaxIter(struct_precond, 1); - HYPRE_StructPFMGSetTol(struct_precond, 0.0); - HYPRE_StructPFMGSetZeroGuess(struct_precond); - HYPRE_StructPFMGSetRAPType(struct_precond, rap); - HYPRE_StructPFMGSetRelaxType(struct_precond, relax); - if (usr_jacobi_weight) + else if (solver_id == 212) { - HYPRE_StructPFMGSetJacobiWeight(struct_precond, jacobi_weight); - } - HYPRE_StructPFMGSetNumPreRelax(struct_precond, n_pre); - HYPRE_StructPFMGSetNumPostRelax(struct_precond, n_post); - HYPRE_StructPFMGSetSkipRelax(struct_precond, skip); - /*HYPRE_StructPFMGSetDxyz(struct_precond, dxyz);*/ - HYPRE_StructPFMGSetPrintLevel(struct_precond, 0); - HYPRE_StructPFMGSetLogging(struct_precond, 0); - HYPRE_GMRESSetPrecond( (HYPRE_Solver)struct_solver, - (HYPRE_PtrToSolverFcn) HYPRE_StructPFMGSolve, - (HYPRE_PtrToSolverFcn) HYPRE_StructPFMGSetup, - (HYPRE_Solver)struct_precond); - } - else if (solver_id == 232) - { - /* use symmetric SparseMSG as preconditioner */ - HYPRE_StructSparseMSGCreate(hypre_MPI_COMM_WORLD, &struct_precond); - HYPRE_StructSparseMSGSetMaxIter(struct_precond, 1); - HYPRE_StructSparseMSGSetJump(struct_precond, jump); - HYPRE_StructSparseMSGSetTol(struct_precond, 0.0); - HYPRE_StructSparseMSGSetZeroGuess(struct_precond); - HYPRE_StructSparseMSGSetRelaxType(struct_precond, relax); - if (usr_jacobi_weight) + HYPRE_StructSparseMSGDestroy(struct_precond); + } + else if (solver_id == 217) { - HYPRE_StructSparseMSGSetJacobiWeight(struct_precond, jacobi_weight); + HYPRE_StructJacobiDestroy(struct_precond); } - HYPRE_StructSparseMSGSetNumPreRelax(struct_precond, n_pre); - HYPRE_StructSparseMSGSetNumPostRelax(struct_precond, n_post); - HYPRE_StructSparseMSGSetPrintLevel(struct_precond, 0); - HYPRE_StructSparseMSGSetLogging(struct_precond, 0); - HYPRE_GMRESSetPrecond( (HYPRE_Solver)struct_solver, - (HYPRE_PtrToSolverFcn) HYPRE_StructSparseMSGSolve, - (HYPRE_PtrToSolverFcn) HYPRE_StructSparseMSGSetup, - (HYPRE_Solver)struct_precond); } - else if (solver_id == 237) - { - /* use two-step Jacobi as preconditioner */ - HYPRE_StructJacobiCreate(hypre_MPI_COMM_WORLD, &struct_precond); - HYPRE_StructJacobiSetMaxIter(struct_precond, 2); - HYPRE_StructJacobiSetTol(struct_precond, 0.0); - HYPRE_StructJacobiSetZeroGuess(struct_precond); - HYPRE_GMRESSetPrecond( (HYPRE_Solver)struct_solver, - (HYPRE_PtrToSolverFcn) HYPRE_StructJacobiSolve, - (HYPRE_PtrToSolverFcn) HYPRE_StructJacobiSetup, - (HYPRE_Solver)struct_precond); - } + /*----------------------------------------------------------- + * Solve the system using Hybrid + *-----------------------------------------------------------*/ - else if (solver_id == 238) + if ((solver_id > 219) && (solver_id < 230)) { - /* use diagonal scaling as preconditioner */ - struct_precond = NULL; - HYPRE_GMRESSetPrecond( (HYPRE_Solver)struct_solver, - (HYPRE_PtrToSolverFcn) HYPRE_StructDiagScale, - (HYPRE_PtrToSolverFcn) HYPRE_StructDiagScaleSetup, - (HYPRE_Solver)struct_precond); - } + time_index = hypre_InitializeTiming("Hybrid Setup"); + hypre_BeginTiming(time_index); - HYPRE_GMRESSetup - ( (HYPRE_Solver)struct_solver, (HYPRE_Matrix)sA, (HYPRE_Vector)sb, - (HYPRE_Vector)sx ); + HYPRE_StructHybridCreate(comm, &struct_solver); + HYPRE_StructHybridSetDSCGMaxIter(struct_solver, 100); + HYPRE_StructHybridSetPCGMaxIter(struct_solver, 100); + HYPRE_StructHybridSetTol(struct_solver, tol); + /*HYPRE_StructHybridSetPCGAbsoluteTolFactor(struct_solver, 1.0e-200);*/ + HYPRE_StructHybridSetConvergenceTol(struct_solver, cf_tol); + HYPRE_StructHybridSetTwoNorm(struct_solver, 1); + HYPRE_StructHybridSetRelChange(struct_solver, 0); + if (solver_type == 2) /* for use with GMRES */ + { + HYPRE_StructHybridSetStopCrit(struct_solver, 0); + HYPRE_StructHybridSetKDim(struct_solver, 10); + } + HYPRE_StructHybridSetPrintLevel(struct_solver, solver_print_level); + HYPRE_StructHybridSetLogging(struct_solver, 1); + HYPRE_StructHybridSetSolverType(struct_solver, solver_type); + HYPRE_StructHybridSetRecomputeResidual(struct_solver, recompute_res); - hypre_EndTiming(time_index); - hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + if (solver_id == 220) + { + /* use symmetric SMG as preconditioner */ + HYPRE_StructSMGCreate(comm, &struct_precond); + HYPRE_StructSMGSetMemoryUse(struct_precond, 0); + HYPRE_StructSMGSetMaxIter(struct_precond, 1); + HYPRE_StructSMGSetTol(struct_precond, 0.0); + HYPRE_StructSMGSetZeroGuess(struct_precond); + HYPRE_StructSMGSetNumPreRelax(struct_precond, n_pre); + HYPRE_StructSMGSetNumPostRelax(struct_precond, n_post); + HYPRE_StructSMGSetPrintLevel(struct_precond, prec_print_level); + HYPRE_StructSMGSetLogging(struct_precond, 0); + HYPRE_StructHybridSetPrecond(struct_solver, + HYPRE_StructSMGSolve, + HYPRE_StructSMGSetup, + struct_precond); + } - time_index = hypre_InitializeTiming("GMRES Solve"); - hypre_BeginTiming(time_index); + else if (solver_id == 221) + { + /* use symmetric PFMG as preconditioner */ + HYPRE_StructPFMGCreate(comm, &struct_precond); + HYPRE_StructPFMGSetMaxIter(struct_precond, 1); + HYPRE_StructPFMGSetTol(struct_precond, 0.0); + HYPRE_StructPFMGSetZeroGuess(struct_precond); + HYPRE_StructPFMGSetRAPType(struct_precond, rap); + HYPRE_StructPFMGSetRelaxType(struct_precond, relax); + if (usr_jacobi_weight) + { + HYPRE_StructPFMGSetJacobiWeight(struct_precond, jacobi_weight); + } + HYPRE_StructPFMGSetNumPreRelax(struct_precond, n_pre); + HYPRE_StructPFMGSetNumPostRelax(struct_precond, n_post); + HYPRE_StructPFMGSetSkipRelax(struct_precond, skip); + /*HYPRE_StructPFMGSetDxyz(struct_precond, dxyz);*/ + HYPRE_StructPFMGSetPrintLevel(struct_precond, prec_print_level); + HYPRE_StructPFMGSetLogging(struct_precond, 0); + HYPRE_StructHybridSetPrecond(struct_solver, + HYPRE_StructPFMGSolve, + HYPRE_StructPFMGSetup, + struct_precond); + } - HYPRE_GMRESSolve - ( (HYPRE_Solver)struct_solver, (HYPRE_Matrix)sA, (HYPRE_Vector)sb, - (HYPRE_Vector)sx); + else if (solver_id == 222) + { + /* use symmetric SparseMSG as preconditioner */ + HYPRE_StructSparseMSGCreate(comm, &struct_precond); + HYPRE_StructSparseMSGSetJump(struct_precond, jump); + HYPRE_StructSparseMSGSetMaxIter(struct_precond, 1); + HYPRE_StructSparseMSGSetTol(struct_precond, 0.0); + HYPRE_StructSparseMSGSetZeroGuess(struct_precond); + HYPRE_StructSparseMSGSetRelaxType(struct_precond, relax); + if (usr_jacobi_weight) + { + HYPRE_StructSparseMSGSetJacobiWeight(struct_precond, jacobi_weight); + } + HYPRE_StructSparseMSGSetNumPreRelax(struct_precond, n_pre); + HYPRE_StructSparseMSGSetNumPostRelax(struct_precond, n_post); + HYPRE_StructSparseMSGSetPrintLevel(struct_precond, prec_print_level); + HYPRE_StructSparseMSGSetLogging(struct_precond, 0); + HYPRE_StructHybridSetPrecond(struct_solver, + HYPRE_StructSparseMSGSolve, + HYPRE_StructSparseMSGSetup, + struct_precond); + } - hypre_EndTiming(time_index); - hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + HYPRE_StructHybridSetup(struct_solver, sA, sb, sx); - HYPRE_GMRESGetNumIterations( (HYPRE_Solver)struct_solver, &num_iterations); - HYPRE_GMRESGetFinalRelativeResidualNorm( (HYPRE_Solver)struct_solver, &final_res_norm); - HYPRE_StructGMRESDestroy(struct_solver); + hypre_EndTiming(time_index); + hypre_PrintTiming("Setup phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); - if (solver_id == 230) - { - HYPRE_StructSMGDestroy(struct_precond); - } - else if (solver_id == 231) - { - HYPRE_StructPFMGDestroy(struct_precond); - } - else if (solver_id == 232) - { - HYPRE_StructSparseMSGDestroy(struct_precond); + time_index = hypre_InitializeTiming("Hybrid Solve"); + hypre_BeginTiming(time_index); + + HYPRE_StructHybridSolve(struct_solver, sA, sb, sx); + + hypre_EndTiming(time_index); + hypre_PrintTiming("Solve phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + HYPRE_StructHybridGetNumIterations(struct_solver, &num_iterations); + HYPRE_StructHybridGetFinalRelativeResidualNorm(struct_solver, &final_res_norm); + HYPRE_StructHybridDestroy(struct_solver); + + if (solver_id == 220) + { + HYPRE_StructSMGDestroy(struct_precond); + } + else if (solver_id == 221) + { + HYPRE_StructPFMGDestroy(struct_precond); + } + else if (solver_id == 222) + { + HYPRE_StructSparseMSGDestroy(struct_precond); + } } - else if (solver_id == 237) + + /*----------------------------------------------------------- + * Solve the system using GMRES + *-----------------------------------------------------------*/ + + if ((solver_id > 229) && (solver_id < 240)) { - HYPRE_StructJacobiDestroy(struct_precond); - } - } - /*----------------------------------------------------------- - * Solve the system using BiCGTAB - *-----------------------------------------------------------*/ + time_index = hypre_InitializeTiming("GMRES Setup"); + hypre_BeginTiming(time_index); - if ((solver_id > 239) && (solver_id < 250)) - { - time_index = hypre_InitializeTiming("BiCGSTAB Setup"); - hypre_BeginTiming(time_index); + HYPRE_StructGMRESCreate(comm, &struct_solver); + HYPRE_GMRESSetMaxIter( (HYPRE_Solver)struct_solver, 100 ); + HYPRE_GMRESSetTol( (HYPRE_Solver)struct_solver, tol ); + HYPRE_GMRESSetRelChange( (HYPRE_Solver)struct_solver, 0 ); + HYPRE_GMRESSetPrintLevel( (HYPRE_Solver)struct_solver, solver_print_level ); + HYPRE_GMRESSetLogging( (HYPRE_Solver)struct_solver, 1 ); - HYPRE_StructBiCGSTABCreate(hypre_MPI_COMM_WORLD, &struct_solver); - HYPRE_BiCGSTABSetMaxIter( (HYPRE_Solver)struct_solver, 100 ); - HYPRE_BiCGSTABSetTol( (HYPRE_Solver)struct_solver, tol ); - HYPRE_BiCGSTABSetPrintLevel( (HYPRE_Solver)struct_solver, 1 ); - HYPRE_BiCGSTABSetLogging( (HYPRE_Solver)struct_solver, 1 ); - - if (solver_id == 240) - { - /* use symmetric SMG as preconditioner */ - HYPRE_StructSMGCreate(hypre_MPI_COMM_WORLD, &struct_precond); - HYPRE_StructSMGSetMemoryUse(struct_precond, 0); - HYPRE_StructSMGSetMaxIter(struct_precond, 1); - HYPRE_StructSMGSetTol(struct_precond, 0.0); - HYPRE_StructSMGSetZeroGuess(struct_precond); - HYPRE_StructSMGSetNumPreRelax(struct_precond, n_pre); - HYPRE_StructSMGSetNumPostRelax(struct_precond, n_post); - HYPRE_StructSMGSetPrintLevel(struct_precond, 0); - HYPRE_StructSMGSetLogging(struct_precond, 0); - HYPRE_BiCGSTABSetPrecond( (HYPRE_Solver)struct_solver, + if (solver_id == 230) + { + /* use symmetric SMG as preconditioner */ + HYPRE_StructSMGCreate(comm, &struct_precond); + HYPRE_StructSMGSetMemoryUse(struct_precond, 0); + HYPRE_StructSMGSetMaxIter(struct_precond, 1); + HYPRE_StructSMGSetTol(struct_precond, 0.0); + HYPRE_StructSMGSetZeroGuess(struct_precond); + HYPRE_StructSMGSetNumPreRelax(struct_precond, n_pre); + HYPRE_StructSMGSetNumPostRelax(struct_precond, n_post); + HYPRE_StructSMGSetPrintLevel(struct_precond, prec_print_level); + HYPRE_StructSMGSetLogging(struct_precond, 0); + HYPRE_GMRESSetPrecond( (HYPRE_Solver)struct_solver, (HYPRE_PtrToSolverFcn) HYPRE_StructSMGSolve, (HYPRE_PtrToSolverFcn) HYPRE_StructSMGSetup, (HYPRE_Solver)struct_precond); - } + } - else if (solver_id == 241) - { - /* use symmetric PFMG as preconditioner */ - HYPRE_StructPFMGCreate(hypre_MPI_COMM_WORLD, &struct_precond); - HYPRE_StructPFMGSetMaxIter(struct_precond, 1); - HYPRE_StructPFMGSetTol(struct_precond, 0.0); - HYPRE_StructPFMGSetZeroGuess(struct_precond); - HYPRE_StructPFMGSetRAPType(struct_precond, rap); - HYPRE_StructPFMGSetRelaxType(struct_precond, relax); - if (usr_jacobi_weight) + else if (solver_id == 231) { - HYPRE_StructPFMGSetJacobiWeight(struct_precond, jacobi_weight); - } - HYPRE_StructPFMGSetNumPreRelax(struct_precond, n_pre); - HYPRE_StructPFMGSetNumPostRelax(struct_precond, n_post); - HYPRE_StructPFMGSetSkipRelax(struct_precond, skip); - /*HYPRE_StructPFMGSetDxyz(struct_precond, dxyz);*/ - HYPRE_StructPFMGSetPrintLevel(struct_precond, 0); - HYPRE_StructPFMGSetLogging(struct_precond, 0); - HYPRE_BiCGSTABSetPrecond( (HYPRE_Solver)struct_solver, + /* use symmetric PFMG as preconditioner */ + HYPRE_StructPFMGCreate(comm, &struct_precond); + HYPRE_StructPFMGSetMaxIter(struct_precond, 1); + HYPRE_StructPFMGSetTol(struct_precond, 0.0); + HYPRE_StructPFMGSetZeroGuess(struct_precond); + HYPRE_StructPFMGSetRAPType(struct_precond, rap); + HYPRE_StructPFMGSetRelaxType(struct_precond, relax); + if (usr_jacobi_weight) + { + HYPRE_StructPFMGSetJacobiWeight(struct_precond, jacobi_weight); + } + HYPRE_StructPFMGSetNumPreRelax(struct_precond, n_pre); + HYPRE_StructPFMGSetNumPostRelax(struct_precond, n_post); + HYPRE_StructPFMGSetSkipRelax(struct_precond, skip); + /*HYPRE_StructPFMGSetDxyz(struct_precond, dxyz);*/ + HYPRE_StructPFMGSetPrintLevel(struct_precond, prec_print_level); + HYPRE_StructPFMGSetLogging(struct_precond, 0); + HYPRE_GMRESSetPrecond( (HYPRE_Solver)struct_solver, (HYPRE_PtrToSolverFcn) HYPRE_StructPFMGSolve, (HYPRE_PtrToSolverFcn) HYPRE_StructPFMGSetup, (HYPRE_Solver)struct_precond); - } - - else if (solver_id == 242) - { - /* use symmetric SparseMSG as preconditioner */ - HYPRE_StructSparseMSGCreate(hypre_MPI_COMM_WORLD, &struct_precond); - HYPRE_StructSparseMSGSetMaxIter(struct_precond, 1); - HYPRE_StructSparseMSGSetJump(struct_precond, jump); - HYPRE_StructSparseMSGSetTol(struct_precond, 0.0); - HYPRE_StructSparseMSGSetZeroGuess(struct_precond); - HYPRE_StructSparseMSGSetRelaxType(struct_precond, relax); - if (usr_jacobi_weight) - { - HYPRE_StructSparseMSGSetJacobiWeight(struct_precond, jacobi_weight); } - HYPRE_StructSparseMSGSetNumPreRelax(struct_precond, n_pre); - HYPRE_StructSparseMSGSetNumPostRelax(struct_precond, n_post); - HYPRE_StructSparseMSGSetPrintLevel(struct_precond, 0); - HYPRE_StructSparseMSGSetLogging(struct_precond, 0); - HYPRE_BiCGSTABSetPrecond( (HYPRE_Solver)struct_solver, + else if (solver_id == 232) + { + /* use symmetric SparseMSG as preconditioner */ + HYPRE_StructSparseMSGCreate(comm, &struct_precond); + HYPRE_StructSparseMSGSetMaxIter(struct_precond, 1); + HYPRE_StructSparseMSGSetJump(struct_precond, jump); + HYPRE_StructSparseMSGSetTol(struct_precond, 0.0); + HYPRE_StructSparseMSGSetZeroGuess(struct_precond); + HYPRE_StructSparseMSGSetRelaxType(struct_precond, relax); + if (usr_jacobi_weight) + { + HYPRE_StructSparseMSGSetJacobiWeight(struct_precond, jacobi_weight); + } + HYPRE_StructSparseMSGSetNumPreRelax(struct_precond, n_pre); + HYPRE_StructSparseMSGSetNumPostRelax(struct_precond, n_post); + HYPRE_StructSparseMSGSetPrintLevel(struct_precond, prec_print_level); + HYPRE_StructSparseMSGSetLogging(struct_precond, 0); + HYPRE_GMRESSetPrecond( (HYPRE_Solver)struct_solver, (HYPRE_PtrToSolverFcn) HYPRE_StructSparseMSGSolve, (HYPRE_PtrToSolverFcn) HYPRE_StructSparseMSGSetup, (HYPRE_Solver)struct_precond); - } + } - else if (solver_id == 247) - { - /* use two-step Jacobi as preconditioner */ - HYPRE_StructJacobiCreate(hypre_MPI_COMM_WORLD, &struct_precond); - HYPRE_StructJacobiSetMaxIter(struct_precond, 2); - HYPRE_StructJacobiSetTol(struct_precond, 0.0); - HYPRE_StructJacobiSetZeroGuess(struct_precond); - HYPRE_BiCGSTABSetPrecond( (HYPRE_Solver)struct_solver, + else if (solver_id == 237) + { + /* use two-step Jacobi as preconditioner */ + HYPRE_StructJacobiCreate(comm, &struct_precond); + HYPRE_StructJacobiSetMaxIter(struct_precond, 2); + HYPRE_StructJacobiSetTol(struct_precond, 0.0); + HYPRE_StructJacobiSetZeroGuess(struct_precond); + HYPRE_GMRESSetPrecond( (HYPRE_Solver)struct_solver, (HYPRE_PtrToSolverFcn) HYPRE_StructJacobiSolve, (HYPRE_PtrToSolverFcn) HYPRE_StructJacobiSetup, (HYPRE_Solver)struct_precond); - } + } - else if (solver_id == 248) - { - /* use diagonal scaling as preconditioner */ - struct_precond = NULL; - HYPRE_BiCGSTABSetPrecond( (HYPRE_Solver)struct_solver, + else if (solver_id == 238) + { + /* use diagonal scaling as preconditioner */ + struct_precond = NULL; + HYPRE_GMRESSetPrecond( (HYPRE_Solver)struct_solver, (HYPRE_PtrToSolverFcn) HYPRE_StructDiagScale, (HYPRE_PtrToSolverFcn) HYPRE_StructDiagScaleSetup, (HYPRE_Solver)struct_precond); - } + } - HYPRE_BiCGSTABSetup + HYPRE_GMRESSetup ( (HYPRE_Solver)struct_solver, (HYPRE_Matrix)sA, (HYPRE_Vector)sb, (HYPRE_Vector)sx ); - hypre_EndTiming(time_index); - hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + hypre_EndTiming(time_index); + hypre_PrintTiming("Setup phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); - time_index = hypre_InitializeTiming("BiCGSTAB Solve"); - hypre_BeginTiming(time_index); + time_index = hypre_InitializeTiming("GMRES Solve"); + hypre_BeginTiming(time_index); - HYPRE_BiCGSTABSolve + HYPRE_GMRESSolve ( (HYPRE_Solver)struct_solver, (HYPRE_Matrix)sA, (HYPRE_Vector)sb, (HYPRE_Vector)sx); - hypre_EndTiming(time_index); - hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + hypre_EndTiming(time_index); + hypre_PrintTiming("Solve phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); - HYPRE_BiCGSTABGetNumIterations( (HYPRE_Solver)struct_solver, &num_iterations); - HYPRE_BiCGSTABGetFinalRelativeResidualNorm( (HYPRE_Solver)struct_solver, &final_res_norm); - HYPRE_StructBiCGSTABDestroy(struct_solver); + HYPRE_GMRESGetNumIterations( (HYPRE_Solver)struct_solver, &num_iterations); + HYPRE_GMRESGetFinalRelativeResidualNorm( (HYPRE_Solver)struct_solver, &final_res_norm); + HYPRE_StructGMRESDestroy(struct_solver); - if (solver_id == 240) - { - HYPRE_StructSMGDestroy(struct_precond); - } - else if (solver_id == 241) - { - HYPRE_StructPFMGDestroy(struct_precond); - } - else if (solver_id == 242) - { - HYPRE_StructSparseMSGDestroy(struct_precond); + if (solver_id == 230) + { + HYPRE_StructSMGDestroy(struct_precond); + } + else if (solver_id == 231) + { + HYPRE_StructPFMGDestroy(struct_precond); + } + else if (solver_id == 232) + { + HYPRE_StructSparseMSGDestroy(struct_precond); + } + else if (solver_id == 237) + { + HYPRE_StructJacobiDestroy(struct_precond); + } } - else if (solver_id == 247) + /*----------------------------------------------------------- + * Solve the system using BiCGTAB + *-----------------------------------------------------------*/ + + if ((solver_id > 239) && (solver_id < 250)) { - HYPRE_StructJacobiDestroy(struct_precond); - } - } + time_index = hypre_InitializeTiming("BiCGSTAB Setup"); + hypre_BeginTiming(time_index); - /*----------------------------------------------------------- - * Gather the solution vector - *-----------------------------------------------------------*/ + HYPRE_StructBiCGSTABCreate(comm, &struct_solver); + HYPRE_BiCGSTABSetMaxIter( (HYPRE_Solver)struct_solver, 100 ); + HYPRE_BiCGSTABSetTol( (HYPRE_Solver)struct_solver, tol ); + HYPRE_BiCGSTABSetPrintLevel( (HYPRE_Solver)struct_solver, solver_print_level ); + HYPRE_BiCGSTABSetLogging( (HYPRE_Solver)struct_solver, 1 ); - HYPRE_SStructVectorGather(x); + if (solver_id == 240) + { + /* use symmetric SMG as preconditioner */ + HYPRE_StructSMGCreate(comm, &struct_precond); + HYPRE_StructSMGSetMemoryUse(struct_precond, 0); + HYPRE_StructSMGSetMaxIter(struct_precond, 1); + HYPRE_StructSMGSetTol(struct_precond, 0.0); + HYPRE_StructSMGSetZeroGuess(struct_precond); + HYPRE_StructSMGSetNumPreRelax(struct_precond, n_pre); + HYPRE_StructSMGSetNumPostRelax(struct_precond, n_post); + HYPRE_StructSMGSetPrintLevel(struct_precond, prec_print_level); + HYPRE_StructSMGSetLogging(struct_precond, 0); + HYPRE_BiCGSTABSetPrecond( (HYPRE_Solver)struct_solver, + (HYPRE_PtrToSolverFcn) HYPRE_StructSMGSolve, + (HYPRE_PtrToSolverFcn) HYPRE_StructSMGSetup, + (HYPRE_Solver)struct_precond); + } - /*----------------------------------------------------------- - * Print the solution and other info - *-----------------------------------------------------------*/ + else if (solver_id == 241) + { + /* use symmetric PFMG as preconditioner */ + HYPRE_StructPFMGCreate(comm, &struct_precond); + HYPRE_StructPFMGSetMaxIter(struct_precond, 1); + HYPRE_StructPFMGSetTol(struct_precond, 0.0); + HYPRE_StructPFMGSetZeroGuess(struct_precond); + HYPRE_StructPFMGSetRAPType(struct_precond, rap); + HYPRE_StructPFMGSetRelaxType(struct_precond, relax); + if (usr_jacobi_weight) + { + HYPRE_StructPFMGSetJacobiWeight(struct_precond, jacobi_weight); + } + HYPRE_StructPFMGSetNumPreRelax(struct_precond, n_pre); + HYPRE_StructPFMGSetNumPostRelax(struct_precond, n_post); + HYPRE_StructPFMGSetSkipRelax(struct_precond, skip); + /*HYPRE_StructPFMGSetDxyz(struct_precond, dxyz);*/ + HYPRE_StructPFMGSetPrintLevel(struct_precond, prec_print_level); + HYPRE_StructPFMGSetLogging(struct_precond, 0); + HYPRE_BiCGSTABSetPrecond( (HYPRE_Solver)struct_solver, + (HYPRE_PtrToSolverFcn) HYPRE_StructPFMGSolve, + (HYPRE_PtrToSolverFcn) HYPRE_StructPFMGSetup, + (HYPRE_Solver)struct_precond); + } - if (print_system) - { - FILE *file; - char filename[255]; + else if (solver_id == 242) + { + /* use symmetric SparseMSG as preconditioner */ + HYPRE_StructSparseMSGCreate(comm, &struct_precond); + HYPRE_StructSparseMSGSetMaxIter(struct_precond, 1); + HYPRE_StructSparseMSGSetJump(struct_precond, jump); + HYPRE_StructSparseMSGSetTol(struct_precond, 0.0); + HYPRE_StructSparseMSGSetZeroGuess(struct_precond); + HYPRE_StructSparseMSGSetRelaxType(struct_precond, relax); + if (usr_jacobi_weight) + { + HYPRE_StructSparseMSGSetJacobiWeight(struct_precond, jacobi_weight); + } + HYPRE_StructSparseMSGSetNumPreRelax(struct_precond, n_pre); + HYPRE_StructSparseMSGSetNumPostRelax(struct_precond, n_post); + HYPRE_StructSparseMSGSetPrintLevel(struct_precond, prec_print_level); + HYPRE_StructSparseMSGSetLogging(struct_precond, 0); + HYPRE_BiCGSTABSetPrecond( (HYPRE_Solver)struct_solver, + (HYPRE_PtrToSolverFcn) HYPRE_StructSparseMSGSolve, + (HYPRE_PtrToSolverFcn) HYPRE_StructSparseMSGSetup, + (HYPRE_Solver)struct_precond); + } + + else if (solver_id == 247) + { + /* use two-step Jacobi as preconditioner */ + HYPRE_StructJacobiCreate(comm, &struct_precond); + HYPRE_StructJacobiSetMaxIter(struct_precond, 2); + HYPRE_StructJacobiSetTol(struct_precond, 0.0); + HYPRE_StructJacobiSetZeroGuess(struct_precond); + HYPRE_BiCGSTABSetPrecond( (HYPRE_Solver)struct_solver, + (HYPRE_PtrToSolverFcn) HYPRE_StructJacobiSolve, + (HYPRE_PtrToSolverFcn) HYPRE_StructJacobiSetup, + (HYPRE_Solver)struct_precond); + } + + else if (solver_id == 248) + { + /* use diagonal scaling as preconditioner */ + struct_precond = NULL; + HYPRE_BiCGSTABSetPrecond( (HYPRE_Solver)struct_solver, + (HYPRE_PtrToSolverFcn) HYPRE_StructDiagScale, + (HYPRE_PtrToSolverFcn) HYPRE_StructDiagScaleSetup, + (HYPRE_Solver)struct_precond); + } + + HYPRE_BiCGSTABSetup + ( (HYPRE_Solver)struct_solver, (HYPRE_Matrix)sA, (HYPRE_Vector)sb, + (HYPRE_Vector)sx ); + + hypre_EndTiming(time_index); + hypre_PrintTiming("Setup phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + time_index = hypre_InitializeTiming("BiCGSTAB Solve"); + hypre_BeginTiming(time_index); + + HYPRE_BiCGSTABSolve + ( (HYPRE_Solver)struct_solver, (HYPRE_Matrix)sA, (HYPRE_Vector)sb, + (HYPRE_Vector)sx); + + hypre_EndTiming(time_index); + hypre_PrintTiming("Solve phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + HYPRE_BiCGSTABGetNumIterations( (HYPRE_Solver)struct_solver, &num_iterations); + HYPRE_BiCGSTABGetFinalRelativeResidualNorm( (HYPRE_Solver)struct_solver, &final_res_norm); + HYPRE_StructBiCGSTABDestroy(struct_solver); + + if (solver_id == 240) + { + HYPRE_StructSMGDestroy(struct_precond); + } + else if (solver_id == 241) + { + HYPRE_StructPFMGDestroy(struct_precond); + } + else if (solver_id == 242) + { + HYPRE_StructSparseMSGDestroy(struct_precond); + } + else if (solver_id == 247) + { + HYPRE_StructJacobiDestroy(struct_precond); + } + } + + /*----------------------------------------------------------- + * Gather the solution vector + *-----------------------------------------------------------*/ + + HYPRE_SStructVectorGather(x); - HYPRE_SStructVectorPrint("sstruct.out.x", x, 0); + /*----------------------------------------------------------- + * Print the solution and other info + *-----------------------------------------------------------*/ - /* print out with shared data replicated */ - values = hypre_TAlloc(HYPRE_Real, data.max_boxsize, HYPRE_MEMORY_HOST); - for (part = 0; part < data.nparts; part++) + if (print_system) { - pdata = data.pdata[part]; - for (var = 0; var < pdata.nvars; var++) + FILE *file; + char filename[255]; + + HYPRE_SStructVectorPrint("sstruct.out.x", x, 0); + + /* print out with shared data replicated */ + if (!read_fromfile_flag) { - hypre_sprintf(filename, "sstruct.out.xx.%02d.%02d.%05d", part, var, myid); - if ((file = fopen(filename, "w")) == NULL) - { - hypre_printf("Error: can't open output file %s\n", filename); - exit(1); - } - for (box = 0; box < pdata.nboxes; box++) + values = hypre_TAlloc(HYPRE_Real, data.max_boxsize, HYPRE_MEMORY_HOST); + d_values = hypre_TAlloc(HYPRE_Real, data.max_boxsize, memory_location); + for (part = 0; part < data.nparts; part++) { - GetVariableBox(pdata.ilowers[box], pdata.iuppers[box], - pdata.vartypes[var], ilower, iupper); - HYPRE_SStructVectorGetBoxValues(x, part, ilower, iupper, - var, values); - hypre_fprintf(file, "\nBox %d:\n\n", box); - size = 1; - for (j = 0; j < data.ndim; j++) - { - size*= (iupper[j] - ilower[j] + 1); - } - for (j = 0; j < size; j++) + pdata = data.pdata[part]; + for (var = 0; var < pdata.nvars; var++) { - hypre_fprintf(file, "%.14e\n", values[j]); + hypre_sprintf(filename, "sstruct.out.xx.%02d.%02d.%05d", part, var, myid); + if ((file = fopen(filename, "w")) == NULL) + { + hypre_printf("Error: can't open output file %s\n", filename); + exit(1); + } + for (box = 0; box < pdata.nboxes; box++) + { + GetVariableBox(pdata.ilowers[box], pdata.iuppers[box], + pdata.vartypes[var], ilower, iupper); + HYPRE_SStructVectorGetBoxValues(x, part, ilower, iupper, + var, d_values); + hypre_TMemcpy(values, d_values, HYPRE_Real, data.max_boxsize, + HYPRE_MEMORY_HOST, memory_location); + hypre_fprintf(file, "\nBox %d:\n\n", box); + size = 1; + for (j = 0; j < data.ndim; j++) + { + size *= (iupper[j] - ilower[j] + 1); + } + for (j = 0; j < size; j++) + { + hypre_fprintf(file, "%.14e\n", values[j]); + } + } + fflush(file); + fclose(file); } } - fflush(file); - fclose(file); + hypre_TFree(values, HYPRE_MEMORY_HOST); + hypre_TFree(d_values, memory_location); } } - hypre_TFree(values, HYPRE_MEMORY_HOST); - } - if (myid == 0 /* begin lobpcg */ && !lobpcgFlag /* end lobpcg */) - { - hypre_printf("\n"); - hypre_printf("Iterations = %d\n", num_iterations); - hypre_printf("Final Relative Residual Norm = %e\n", final_res_norm); - hypre_printf("\n"); - } + if (myid == 0 && rep == repeats - 1 /* begin lobpcg */ && !lobpcgFlag /* end lobpcg */) + { + hypre_printf("\n"); + hypre_printf("Iterations = %d\n", num_iterations); + hypre_printf("Final Relative Residual Norm = %e\n", final_res_norm); + hypre_printf("\n"); + } - /*----------------------------------------------------------- - * Verify GetBoxValues() - *-----------------------------------------------------------*/ + /*----------------------------------------------------------- + * Verify GetBoxValues() + *-----------------------------------------------------------*/ #if 0 - { - HYPRE_SStructVector xnew; - HYPRE_ParVector par_xnew; - HYPRE_StructVector sxnew; - HYPRE_Real rnorm, bnorm; + { + HYPRE_SStructVector xnew; + HYPRE_ParVector par_xnew; + HYPRE_StructVector sxnew; + HYPRE_Real rnorm, bnorm; - HYPRE_SStructVectorCreate(hypre_MPI_COMM_WORLD, grid, &xnew); - HYPRE_SStructVectorSetObjectType(xnew, object_type); - HYPRE_SStructVectorInitialize(xnew); + HYPRE_SStructVectorCreate(comm, grid, &xnew); + HYPRE_SStructVectorSetObjectType(xnew, object_type); + HYPRE_SStructVectorInitialize(xnew); - /* get/set replicated shared data */ - values = hypre_TAlloc(HYPRE_Real, data.max_boxsize, HYPRE_MEMORY_HOST); - for (part = 0; part < data.nparts; part++) - { - pdata = data.pdata[part]; - for (var = 0; var < pdata.nvars; var++) + /* get/set replicated shared data */ + values = hypre_TAlloc(HYPRE_Real, data.max_boxsize, HYPRE_MEMORY_HOST); + for (part = 0; part < data.nparts; part++) { - for (box = 0; box < pdata.nboxes; box++) + pdata = data.pdata[part]; + for (var = 0; var < pdata.nvars; var++) { - GetVariableBox(pdata.ilowers[box], pdata.iuppers[box], - pdata.vartypes[var], ilower, iupper); - HYPRE_SStructVectorGetBoxValues(x, part, ilower, iupper, - var, values); - HYPRE_SStructVectorSetBoxValues(xnew, part, ilower, iupper, - var, values); + for (box = 0; box < pdata.nboxes; box++) + { + GetVariableBox(pdata.ilowers[box], pdata.iuppers[box], + pdata.vartypes[var], ilower, iupper); + HYPRE_SStructVectorGetBoxValues(x, part, ilower, iupper, + var, values); + HYPRE_SStructVectorSetBoxValues(xnew, part, ilower, iupper, + var, values); + } } } - } - hypre_TFree(values, HYPRE_MEMORY_HOST); + hypre_TFree(values, HYPRE_MEMORY_HOST); - HYPRE_SStructVectorAssemble(xnew); + HYPRE_SStructVectorAssemble(xnew); - /* Compute residual norm - this if/else is due to a bug in SStructMatvec */ - if (object_type == HYPRE_SSTRUCT) - { - HYPRE_SStructInnerProd(b, b, &bnorm); - hypre_SStructMatvec(-1.0, A, xnew, 1.0, b); - HYPRE_SStructInnerProd(b, b, &rnorm); - } - else if (object_type == HYPRE_PARCSR) - { - bnorm = hypre_ParVectorInnerProd(par_b, par_b); - HYPRE_SStructVectorGetObject(xnew, (void **) &par_xnew); - HYPRE_ParCSRMatrixMatvec(-1.0, par_A, par_xnew, 1.0, par_b ); - rnorm = hypre_ParVectorInnerProd(par_b, par_b); - } - else if (object_type == HYPRE_STRUCT) - { - bnorm = hypre_StructInnerProd(sb, sb); - HYPRE_SStructVectorGetObject(xnew, (void **) &sxnew); - hypre_StructMatvec(-1.0, sA, sxnew, 1.0, sb); - rnorm = hypre_StructInnerProd(sb, sb); - } - bnorm = sqrt(bnorm); - rnorm = sqrt(rnorm); + /* Compute residual norm - this if/else is due to a bug in SStructMatvec */ + if (object_type == HYPRE_SSTRUCT) + { + HYPRE_SStructInnerProd(b, b, &bnorm); + hypre_SStructMatvec(-1.0, A, xnew, 1.0, b); + HYPRE_SStructInnerProd(b, b, &rnorm); + } + else if (object_type == HYPRE_PARCSR) + { + bnorm = hypre_ParVectorInnerProd(par_b, par_b); + HYPRE_SStructVectorGetObject(xnew, (void **) &par_xnew); + HYPRE_ParCSRMatrixMatvec(-1.0, par_A, par_xnew, 1.0, par_b ); + rnorm = hypre_ParVectorInnerProd(par_b, par_b); + } + else if (object_type == HYPRE_STRUCT) + { + bnorm = hypre_StructInnerProd(sb, sb); + HYPRE_SStructVectorGetObject(xnew, (void **) &sxnew); + hypre_StructMatvec(-1.0, sA, sxnew, 1.0, sb); + rnorm = hypre_StructInnerProd(sb, sb); + } + bnorm = hypre_sqrt(bnorm); + rnorm = hypre_sqrt(rnorm); - if (myid == 0) - { - hypre_printf("\n"); - hypre_printf("solver relnorm = %16.14e\n", final_res_norm); - hypre_printf("check relnorm = %16.14e, bnorm = %16.14e, rnorm = %16.14e\n", - (rnorm/bnorm), bnorm, rnorm); - hypre_printf("\n"); - } + if (myid == 0) + { + hypre_printf("\n"); + hypre_printf("solver relnorm = %16.14e\n", final_res_norm); + hypre_printf("check relnorm = %16.14e, bnorm = %16.14e, rnorm = %16.14e\n", + (rnorm / bnorm), bnorm, rnorm); + hypre_printf("\n"); + } - HYPRE_SStructVectorDestroy(xnew); - } + HYPRE_SStructVectorDestroy(xnew); + } #endif - /*----------------------------------------------------------- - * Finalize things - *-----------------------------------------------------------*/ + /*----------------------------------------------------------- + * Finalize things + *-----------------------------------------------------------*/ - HYPRE_SStructGridDestroy(grid); - for (s = 0; s < data.nstencils; s++) - { - HYPRE_SStructStencilDestroy(stencils[s]); - } - hypre_TFree(stencils, HYPRE_MEMORY_HOST); - HYPRE_SStructGraphDestroy(graph); - HYPRE_SStructMatrixDestroy(A); - HYPRE_SStructVectorDestroy(b); - HYPRE_SStructVectorDestroy(x); - if (gradient_matrix) - { - for (s = 0; s < data.ndim; s++) + HYPRE_SStructMatrixDestroy(A); + HYPRE_SStructVectorDestroy(b); + HYPRE_SStructVectorDestroy(x); + if (gradient_matrix) { - HYPRE_SStructStencilDestroy(G_stencils[s]); + for (s = 0; s < data.ndim; s++) + { + HYPRE_SStructStencilDestroy(G_stencils[s]); + } + hypre_TFree(G_stencils, HYPRE_MEMORY_HOST); + HYPRE_SStructGraphDestroy(G_graph); + HYPRE_SStructGridDestroy(G_grid); + HYPRE_SStructMatrixDestroy(G); } - hypre_TFree(G_stencils, HYPRE_MEMORY_HOST); - HYPRE_SStructGraphDestroy(G_graph); - HYPRE_SStructGridDestroy(G_grid); - HYPRE_SStructMatrixDestroy(G); - } - DestroyData(data); + if (!read_fromfile_flag) + { + HYPRE_SStructGridDestroy(grid); + HYPRE_SStructGraphDestroy(graph); + + for (s = 0; s < data.nstencils; s++) + { + HYPRE_SStructStencilDestroy(stencils[s]); + } + hypre_TFree(stencils, HYPRE_MEMORY_HOST); - hypre_TFree(parts, HYPRE_MEMORY_HOST); - hypre_TFree(refine, HYPRE_MEMORY_HOST); - hypre_TFree(distribute, HYPRE_MEMORY_HOST); - hypre_TFree(block, HYPRE_MEMORY_HOST); - /*hypre_FinalizeMemoryDebug(); */ + DestroyData(data); + if (rep == repeats - 1) + { + hypre_TFree(parts, HYPRE_MEMORY_HOST); + hypre_TFree(refine, HYPRE_MEMORY_HOST); + hypre_TFree(distribute, HYPRE_MEMORY_HOST); + hypre_TFree(block, HYPRE_MEMORY_HOST); + } + if (rep < repeats - 1) + { + ReadData(infile, &global_data); + } + } + /*hypre_FinalizeMemoryDebug(); */ + } /* Finalize Hypre */ HYPRE_Finalize(); @@ -5989,5 +6321,16 @@ main( hypre_int argc, /* Finalize MPI */ hypre_MPI_Finalize(); +#if defined(HYPRE_USING_MEMORY_TRACKER) + if (memory_location == HYPRE_MEMORY_HOST) + { + if (hypre_total_bytes[hypre_MEMORY_DEVICE] || hypre_total_bytes[hypre_MEMORY_UNIFIED]) + { + hypre_printf("Error: nonzero GPU memory allocated with the HOST mode\n"); + hypre_assert(0); + } + } +#endif + return (0); } diff --git a/external/hypre/src/test/sstruct.in.README b/external/hypre/src/test/sstruct.in.README index 56f974f4..6bd90688 100644 --- a/external/hypre/src/test/sstruct.in.README +++ b/external/hypre/src/test/sstruct.in.README @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/test/sstruct_fac.c b/external/hypre/src/test/sstruct_fac.c index 6af83a44..6eb0ca28 100644 --- a/external/hypre/src/test/sstruct_fac.c +++ b/external/hypre/src/test/sstruct_fac.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -134,34 +134,34 @@ GetVariableBox( Index cell_ilower, var_iupper[1] = cell_iupper[1]; var_iupper[2] = cell_iupper[2]; - switch(vartype) + switch (vartype) { case HYPRE_SSTRUCT_VARIABLE_CELL: - var_ilower[0] -= 0; var_ilower[1] -= 0; var_ilower[2] -= 0; - break; + var_ilower[0] -= 0; var_ilower[1] -= 0; var_ilower[2] -= 0; + break; case HYPRE_SSTRUCT_VARIABLE_NODE: - var_ilower[0] -= 1; var_ilower[1] -= 1; var_ilower[2] -= 1; - break; + var_ilower[0] -= 1; var_ilower[1] -= 1; var_ilower[2] -= 1; + break; case HYPRE_SSTRUCT_VARIABLE_XFACE: - var_ilower[0] -= 1; var_ilower[1] -= 0; var_ilower[2] -= 0; - break; + var_ilower[0] -= 1; var_ilower[1] -= 0; var_ilower[2] -= 0; + break; case HYPRE_SSTRUCT_VARIABLE_YFACE: - var_ilower[0] -= 0; var_ilower[1] -= 1; var_ilower[2] -= 0; - break; + var_ilower[0] -= 0; var_ilower[1] -= 1; var_ilower[2] -= 0; + break; case HYPRE_SSTRUCT_VARIABLE_ZFACE: - var_ilower[0] -= 0; var_ilower[1] -= 0; var_ilower[2] -= 1; - break; + var_ilower[0] -= 0; var_ilower[1] -= 0; var_ilower[2] -= 1; + break; case HYPRE_SSTRUCT_VARIABLE_XEDGE: - var_ilower[0] -= 0; var_ilower[1] -= 1; var_ilower[2] -= 1; - break; + var_ilower[0] -= 0; var_ilower[1] -= 1; var_ilower[2] -= 1; + break; case HYPRE_SSTRUCT_VARIABLE_YEDGE: - var_ilower[0] -= 1; var_ilower[1] -= 0; var_ilower[2] -= 1; - break; + var_ilower[0] -= 1; var_ilower[1] -= 0; var_ilower[2] -= 1; + break; case HYPRE_SSTRUCT_VARIABLE_ZEDGE: - var_ilower[0] -= 1; var_ilower[1] -= 1; var_ilower[2] -= 0; - break; + var_ilower[0] -= 1; var_ilower[1] -= 1; var_ilower[2] -= 0; + break; case HYPRE_SSTRUCT_VARIABLE_UNDEFINED: - break; + break; } return ierr; @@ -209,19 +209,19 @@ SScanProblemIndex( char *sdata_ptr, switch (ndim) { case 1: - hypre_sscanf(sdata_ptr, "%d%c", - &index[0], &sign[0]); - break; + hypre_sscanf(sdata_ptr, "%d%c", + &index[0], &sign[0]); + break; case 2: - hypre_sscanf(sdata_ptr, "%d%c%d%c", - &index[0], &sign[0], &index[1], &sign[1]); - break; + hypre_sscanf(sdata_ptr, "%d%c%d%c", + &index[0], &sign[0], &index[1], &sign[1]); + break; case 3: - hypre_sscanf(sdata_ptr, "%d%c%d%c%d%c", - &index[0], &sign[0], &index[1], &sign[1], &index[2], &sign[2]); - break; + hypre_sscanf(sdata_ptr, "%d%c%d%c%d%c", + &index[0], &sign[0], &index[1], &sign[1], &index[2], &sign[2]); + break; } sdata_ptr += strcspn(sdata_ptr, ":)"); if ( *sdata_ptr == ':' ) @@ -245,7 +245,7 @@ SScanProblemIndex( char *sdata_ptr, /* pre-shift the index */ for (i = 0; i < ndim; i++) { - index[i] += index[i+6]; + index[i] += index[i + 6]; } } sdata_ptr += strcspn(sdata_ptr, ")") + 1; @@ -254,7 +254,7 @@ SScanProblemIndex( char *sdata_ptr, { if (sign[i] == '+') { - index[i+3] = 1; + index[i + 3] = 1; } } @@ -303,7 +303,7 @@ ReadData( char *filename, sdata = hypre_TAlloc(char, memchunk, HYPRE_MEMORY_HOST); sdata_line = fgets(sdata, maxline, file); - s= memchunk; + s = memchunk; while (sdata_line != NULL) { sdata_size += strlen(sdata_line) + 1; @@ -312,7 +312,7 @@ ReadData( char *filename, if ((sdata_size + maxline) > s) { sdata = hypre_TReAlloc(sdata, char, (sdata_size + memchunk), HYPRE_MEMORY_HOST); - s= sdata_size + memchunk; + s = sdata_size + memchunk; } /* read the next input line */ @@ -470,7 +470,7 @@ ReadData( char *filename, SScanIntArray(sdata_ptr, &sdata_ptr, data.ndim, data.stencil_offsets[s][entry]); data.stencil_vars[s][entry] = strtol(sdata_ptr, &sdata_ptr, 10); - data.stencil_values[s][entry] = strtod(sdata_ptr, &sdata_ptr); + data.stencil_values[s][entry] = (HYPRE_Real)strtod(sdata_ptr, &sdata_ptr); } else if ( strcmp(key, "GraphSetStencil:") == 0 ) { @@ -565,7 +565,7 @@ ReadData( char *filename, pdata.graph_entries[pdata.graph_nentries] = strtol(sdata_ptr, &sdata_ptr, 10); pdata.graph_values[pdata.graph_nentries] = - strtod(sdata_ptr, &sdata_ptr); + (HYPRE_Real)strtod(sdata_ptr, &sdata_ptr); pdata.graph_boxsizes[pdata.graph_nentries] = 1; for (i = 0; i < 3; i++) { @@ -611,7 +611,7 @@ ReadData( char *filename, pdata.matrix_entries[pdata.matrix_nentries] = strtol(sdata_ptr, &sdata_ptr, 10); pdata.matrix_values[pdata.matrix_nentries] = - strtod(sdata_ptr, &sdata_ptr); + (HYPRE_Real)strtod(sdata_ptr, &sdata_ptr); pdata.matrix_nentries++; data.pdata[part] = pdata; } @@ -620,7 +620,7 @@ ReadData( char *filename, { part = strtol(sdata_ptr, &sdata_ptr, 10); pdata = data.pdata[part]; - pdata.fac_plevel= strtol(sdata_ptr, &sdata_ptr, 10); + pdata.fac_plevel = strtol(sdata_ptr, &sdata_ptr, 10); SScanIntArray(sdata_ptr, &sdata_ptr, data.ndim, pdata.fac_prefinement); data.pdata[part] = pdata; } @@ -663,9 +663,9 @@ MapProblemIndex( ProblemIndex index, index[1] -= index[7]; index[2] -= index[8]; /* map the index */ - index[0] = m[0]*index[0] + (m[0]-1)*index[3]; - index[1] = m[1]*index[1] + (m[1]-1)*index[4]; - index[2] = m[2]*index[2] + (m[2]-1)*index[5]; + index[0] = m[0] * index[0] + (m[0] - 1) * index[3]; + index[1] = m[1] * index[1] + (m[1] - 1) * index[4]; + index[2] = m[2] * index[2] + (m[2] - 1) * index[5]; /* pre-shift the new mapped index */ index[0] += index[6]; index[1] += index[7]; @@ -715,7 +715,7 @@ DistributeData( ProblemData global_data, ProblemIndex ilower, iupper, int_ilower, int_iupper; /* determine first process number in each pool */ - pool_procs = hypre_CTAlloc(HYPRE_Int, (data.npools+1), HYPRE_MEMORY_HOST); + pool_procs = hypre_CTAlloc(HYPRE_Int, (data.npools + 1), HYPRE_MEMORY_HOST); for (part = 0; part < data.nparts; part++) { pool = data.pools[part] + 1; @@ -791,7 +791,7 @@ DistributeData( ProblemData global_data, { p = pid % m[0]; q = ((pid - p) / m[0]) % m[1]; - r = (pid - p - q*m[0]) / (m[0]*m[1]); + r = (pid - p - q * m[0]) / (m[0] * m[1]); for (box = 0; box < pdata.nboxes; box++) { @@ -805,12 +805,12 @@ DistributeData( ProblemData global_data, pdata.iuppers[box][1] = pdata.ilowers[box][1] + n[1] - 1; pdata.iuppers[box][2] = pdata.ilowers[box][2] + n[2] - 1; - pdata.ilowers[box][0] = pdata.ilowers[box][0] + p*n[0]; - pdata.ilowers[box][1] = pdata.ilowers[box][1] + q*n[1]; - pdata.ilowers[box][2] = pdata.ilowers[box][2] + r*n[2]; - pdata.iuppers[box][0] = pdata.iuppers[box][0] + p*n[0]; - pdata.iuppers[box][1] = pdata.iuppers[box][1] + q*n[1]; - pdata.iuppers[box][2] = pdata.iuppers[box][2] + r*n[2]; + pdata.ilowers[box][0] = pdata.ilowers[box][0] + p * n[0]; + pdata.ilowers[box][1] = pdata.ilowers[box][1] + q * n[1]; + pdata.ilowers[box][2] = pdata.ilowers[box][2] + r * n[2]; + pdata.iuppers[box][0] = pdata.iuppers[box][0] + p * n[0]; + pdata.iuppers[box][1] = pdata.iuppers[box][1] + q * n[1]; + pdata.iuppers[box][2] = pdata.iuppers[box][2] + r * n[2]; } i = 0; @@ -824,9 +824,9 @@ DistributeData( ProblemData global_data, MapProblemIndex(pdata.graph_to_ilowers[entry], mmap); MapProblemIndex(pdata.graph_to_iuppers[entry], mmap); - for (d= 0; d< 3; d++) + for (d = 0; d < 3; d++) { - mod_graph[d]= pdata.graph_ilowers[entry][d] % pdata.graph_strides[entry][d]; + mod_graph[d] = pdata.graph_ilowers[entry][d] % pdata.graph_strides[entry][d]; } for (box = 0; box < pdata.nboxes; box++) @@ -843,32 +843,32 @@ DistributeData( ProblemData global_data, correctly */ if (size > 0) { - for (d= 0; d< 3; d++) + for (d = 0; d < 3; d++) { - mod_lower= int_ilower[d] % pdata.graph_strides[entry][d]; + mod_lower = int_ilower[d] % pdata.graph_strides[entry][d]; if (mod_graph[d] >= mod_lower) { - int_ilower[d]+= (mod_graph[d] - mod_lower); + int_ilower[d] += (mod_graph[d] - mod_lower); } else { - int_ilower[d]+= pdata.graph_strides[entry][d] + (mod_graph[d] - mod_lower); + int_ilower[d] += pdata.graph_strides[entry][d] + (mod_graph[d] - mod_lower); } - mod_lower= mod_graph[d]; + mod_lower = mod_graph[d]; - mod_upper= int_iupper[d] % pdata.graph_strides[entry][d]; + mod_upper = int_iupper[d] % pdata.graph_strides[entry][d]; if (mod_lower >= mod_upper) { - int_iupper[d]-= (mod_lower-mod_upper); + int_iupper[d] -= (mod_lower - mod_upper); } else { - int_iupper[d]+= (mod_upper-mod_lower) - pdata.graph_strides[entry][d]; + int_iupper[d] += (mod_upper - mod_lower) - pdata.graph_strides[entry][d]; } if (int_iupper[d] - int_ilower[d] < 0) { - size= -1; + size = -1; break; } } @@ -881,16 +881,16 @@ DistributeData( ProblemData global_data, { dmap = pdata.graph_index_maps[entry][d]; sign = pdata.graph_index_signs[entry][d]; - size =(int_iupper[d] - pdata.graph_iuppers[entry][d])/ + size = (int_iupper[d] - pdata.graph_iuppers[entry][d]) / pdata.graph_strides[entry][d]; pdata.graph_to_iuppers[i][dmap] = - pdata.graph_to_ilowers[entry][dmap] + sign* - size*pdata.graph_to_strides[entry][d]; - size= (int_ilower[d] - pdata.graph_ilowers[entry][d])/ + pdata.graph_to_ilowers[entry][dmap] + sign * + size * pdata.graph_to_strides[entry][d]; + size = (int_ilower[d] - pdata.graph_ilowers[entry][d]) / pdata.graph_strides[entry][d]; pdata.graph_to_ilowers[i][dmap] = pdata.graph_to_ilowers[entry][dmap] + sign * - size*pdata.graph_to_strides[entry][d]; + size * pdata.graph_to_strides[entry][d]; pdata.graph_ilowers[i][d] = int_ilower[d]; pdata.graph_iuppers[i][d] = int_iupper[d]; pdata.graph_strides[i][d] = @@ -974,11 +974,11 @@ DistributeData( ProblemData global_data, if ( (m[0] * m[1] * m[2]) > 1) { pdata.ilowers = hypre_TReAlloc(pdata.ilowers, ProblemIndex, - m[0]*m[1]*m[2]*pdata.nboxes, HYPRE_MEMORY_HOST); + m[0] * m[1] * m[2] * pdata.nboxes, HYPRE_MEMORY_HOST); pdata.iuppers = hypre_TReAlloc(pdata.iuppers, ProblemIndex, - m[0]*m[1]*m[2]*pdata.nboxes, HYPRE_MEMORY_HOST); + m[0] * m[1] * m[2] * pdata.nboxes, HYPRE_MEMORY_HOST); pdata.boxsizes = hypre_TReAlloc(pdata.boxsizes, HYPRE_Int, - m[0]*m[1]*m[2]*pdata.nboxes, HYPRE_MEMORY_HOST); + m[0] * m[1] * m[2] * pdata.nboxes, HYPRE_MEMORY_HOST); for (box = 0; box < pdata.nboxes; box++) { n[0] = pdata.iuppers[box][0] - pdata.ilowers[box][0] + 1; @@ -999,12 +999,12 @@ DistributeData( ProblemData global_data, { for (p = 0; p < m[0]; p++) { - pdata.ilowers[i][0] = pdata.ilowers[box][0] + p*n[0]; - pdata.ilowers[i][1] = pdata.ilowers[box][1] + q*n[1]; - pdata.ilowers[i][2] = pdata.ilowers[box][2] + r*n[2]; - pdata.iuppers[i][0] = pdata.iuppers[box][0] + p*n[0]; - pdata.iuppers[i][1] = pdata.iuppers[box][1] + q*n[1]; - pdata.iuppers[i][2] = pdata.iuppers[box][2] + r*n[2]; + pdata.ilowers[i][0] = pdata.ilowers[box][0] + p * n[0]; + pdata.ilowers[i][1] = pdata.ilowers[box][1] + q * n[1]; + pdata.ilowers[i][2] = pdata.ilowers[box][2] + r * n[2]; + pdata.iuppers[i][0] = pdata.iuppers[box][0] + p * n[0]; + pdata.iuppers[i][1] = pdata.iuppers[box][1] + q * n[1]; + pdata.iuppers[i][2] = pdata.iuppers[box][2] + r * n[2]; for (d = 3; d < 9; d++) { pdata.ilowers[i][d] = pdata.ilowers[box][d]; @@ -1015,7 +1015,7 @@ DistributeData( ProblemData global_data, } } } - pdata.nboxes *= m[0]*m[1]*m[2]; + pdata.nboxes *= m[0] * m[1] * m[2]; for (entry = 0; entry < pdata.graph_nentries; entry++) { @@ -1206,12 +1206,12 @@ DestroyData( ProblemData data ) if (pdata.matrix_nentries > 0) { - hypre_TFree(pdata.matrix_ilowers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.matrix_iuppers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.matrix_strides, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.matrix_vars, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.matrix_entries, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.matrix_values, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.matrix_ilowers, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.matrix_iuppers, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.matrix_strides, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.matrix_vars, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.matrix_entries, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.matrix_values, HYPRE_MEMORY_HOST); } } @@ -1299,14 +1299,15 @@ main( hypre_int argc, /*----------------------------------------------------------------- * GPU Device binding - * Must be done before HYPRE_Init() and should not be changed after + * Must be done before HYPRE_Initialize() and should not be changed after *-----------------------------------------------------------------*/ - hypre_bind_device(myid, num_procs, hypre_MPI_COMM_WORLD); + hypre_bind_device_id(-1, myid, num_procs, hypre_MPI_COMM_WORLD); /*----------------------------------------------------------- * Initialize : must be the first HYPRE function to call *-----------------------------------------------------------*/ - HYPRE_Init(); + HYPRE_Initialize(); + HYPRE_DeviceInitialize(); /*----------------------------------------------------------- * Read input file @@ -1505,19 +1506,19 @@ main( hypre_int argc, * Set up the amr structure *-----------------------------------------------------------*/ plevels = hypre_TAlloc(HYPRE_Int, data.nparts, HYPRE_MEMORY_HOST); - prefinements= hypre_TAlloc(Index, data.nparts, HYPRE_MEMORY_HOST); + prefinements = hypre_TAlloc(Index, data.nparts, HYPRE_MEMORY_HOST); for (part = 0; part < data.nparts; part++) { pdata = data.pdata[part]; - plevels[part]= pdata.fac_plevel; - for (i= 0; i< data.ndim; i++) + plevels[part] = pdata.fac_plevel; + for (i = 0; i < data.ndim; i++) { - prefinements[part][i]= pdata.fac_prefinement[i]; + prefinements[part][i] = pdata.fac_prefinement[i]; } } - n_pre = prefinements[data.nparts-1][0]-1; - n_post = prefinements[data.nparts-1][0]-1; + n_pre = prefinements[data.nparts - 1][0] - 1; + n_post = prefinements[data.nparts - 1][0] - 1; /*----------------------------------------------------------- * Set up the graph *-----------------------------------------------------------*/ @@ -1526,7 +1527,7 @@ main( hypre_int argc, if ( ((solver_id >= 20) && (solver_id <= 30)) || ((solver_id >= 40) && (solver_id < 60)) ) { - HYPRE_SStructGraphSetObjectType(graph, HYPRE_PARCSR); + HYPRE_SStructGraphSetObjectType(graph, HYPRE_PARCSR); } for (part = 0; part < data.nparts; part++) @@ -1562,7 +1563,7 @@ main( hypre_int argc, k /= pdata.graph_strides[entry][i]; k *= pdata.graph_index_signs[entry][i]; to_index[j] = pdata.graph_to_ilowers[entry][j] + - k * pdata.graph_to_strides[entry][j]; + k * pdata.graph_to_strides[entry][j]; } HYPRE_SStructGraphAddEntries(graph, part, index, pdata.graph_vars[entry], @@ -1660,9 +1661,9 @@ main( hypre_int argc, index[0] <= pdata.graph_iuppers[entry][0]; index[0] += pdata.graph_strides[entry][0]) { - HYPRE_SStructMatrixSetValues(A_amg, part, index, - pdata.graph_vars[entry], - 1, &pdata.graph_entries[entry], + HYPRE_SStructMatrixSetValues(A_amg, part, index, + pdata.graph_vars[entry], + 1, &pdata.graph_entries[entry], &pdata.graph_values[entry]); } } @@ -1701,7 +1702,7 @@ main( hypre_int argc, } /* reset matrix values so that stencil connections between two parts are zeroed */ - for (part= data.nparts-1; part> 0; part--) + for (part = data.nparts - 1; part > 0; part--) { /*hypre_FacZeroCFSten(hypre_SStructMatrixPMatrix(A, part), hypre_SStructMatrixPMatrix(A, part-1), @@ -1717,7 +1718,7 @@ main( hypre_int argc, HYPRE_SStructFACZeroFCSten(A, grid, part); - HYPRE_SStructFACZeroAMRMatrixData(A, part-1, prefinements[part]); + HYPRE_SStructFACZeroAMRMatrixData(A, part - 1, prefinements[part]); } HYPRE_SStructMatrixAssemble(A); @@ -1725,24 +1726,24 @@ main( hypre_int argc, if ( ((solver_id >= 20) && (solver_id <= 30)) || ((solver_id >= 40) && (solver_id < 60)) ) { - for (part= data.nparts-1; part>= 0; part--) + for (part = data.nparts - 1; part >= 0; part--) { pdata = data.pdata[part]; for (var = 0; var < pdata.nvars; var++) { - sA= hypre_SStructPMatrixSMatrix(hypre_SStructMatrixPMatrix(A, part), - var, var); + sA = hypre_SStructPMatrixSMatrix(hypre_SStructMatrixPMatrix(A, part), + var, var); s = pdata.stencil_num[var]; for (i = 0; i < data.stencil_sizes[s]; i++) { for (box = 0; box < pdata.nboxes; box++) { - box_values= hypre_TAlloc(HYPRE_Real, data.max_boxsize, HYPRE_MEMORY_HOST); + box_values = hypre_TAlloc(HYPRE_Real, data.max_boxsize, HYPRE_MEMORY_HOST); GetVariableBox(pdata.ilowers[box], pdata.iuppers[box], pdata.vartypes[var], ilower, iupper); HYPRE_StructMatrixGetBoxValues(sA, ilower, iupper, 1, - &i, box_values); + &i, box_values); HYPRE_SStructMatrixSetBoxValues(A_amg, part, ilower, iupper, var, 1, &i, box_values); @@ -1802,11 +1803,11 @@ main( hypre_int argc, pdata = data.pdata[part]; for (var = 0; var < pdata.nvars; var++) { - sx= hypre_SStructPVectorSVector(hypre_SStructVectorPVector(b, part), - var); + sx = hypre_SStructPVectorSVector(hypre_SStructVectorPVector(b, part), + var); for (box = 0; box < pdata.nboxes; box++) { - box_values= hypre_TAlloc(HYPRE_Real, data.max_boxsize, HYPRE_MEMORY_HOST); + box_values = hypre_TAlloc(HYPRE_Real, data.max_boxsize, HYPRE_MEMORY_HOST); GetVariableBox(pdata.ilowers[box], pdata.iuppers[box], var, ilower, iupper); HYPRE_StructVectorGetBoxValues(sx, ilower, iupper, box_values); @@ -1865,11 +1866,11 @@ main( hypre_int argc, pdata = data.pdata[part]; for (var = 0; var < pdata.nvars; var++) { - sx= hypre_SStructPVectorSVector(hypre_SStructVectorPVector(x, part), - var); + sx = hypre_SStructPVectorSVector(hypre_SStructVectorPVector(x, part), + var); for (box = 0; box < pdata.nboxes; box++) { - box_values= hypre_TAlloc(HYPRE_Real, data.max_boxsize, HYPRE_MEMORY_HOST); + box_values = hypre_TAlloc(HYPRE_Real, data.max_boxsize, HYPRE_MEMORY_HOST); GetVariableBox(pdata.ilowers[box], pdata.iuppers[box], var, ilower, iupper); HYPRE_StructVectorGetBoxValues(sx, ilower, iupper, box_values); @@ -1984,12 +1985,12 @@ main( hypre_int argc, * Solve the system using FAC *-----------------------------------------------------------*/ - if ((solver_id >=50) && (solver_id <100)) + if ((solver_id >= 50) && (solver_id < 100)) { if (solver_id < 100) { - /* n_pre+= n_post;*/ - /* n_post= 0;*/ + /* n_pre+= n_post;*/ + /* n_post= 0;*/ } time_index = hypre_InitializeTiming("FAC Setup"); hypre_BeginTiming(time_index); @@ -2039,7 +2040,7 @@ main( hypre_int argc, HYPRE_SStructFACGetNumIterations(solver, &num_iterations); HYPRE_SStructFACGetFinalRelativeResidualNorm( - solver, &final_res_norm); + solver, &final_res_norm); HYPRE_SStructFACDestroy2(solver); } @@ -2072,9 +2073,9 @@ main( hypre_int argc, /*HYPRE_BoomerAMGSetLogging(par_precond, 1, "sstruct.out.log");*/ HYPRE_BoomerAMGSetMaxIter(par_precond, 1); HYPRE_PCGSetPrecond( par_solver, - (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, - (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, - par_precond ); + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, + par_precond ); } HYPRE_PCGSetup( par_solver, (HYPRE_Matrix) par_A, (HYPRE_Vector) par_b, (HYPRE_Vector) par_x ); @@ -2199,7 +2200,7 @@ main( hypre_int argc, HYPRE_BoomerAMGGetNumIterations(par_solver, &num_iterations); HYPRE_BoomerAMGGetFinalRelativeResidualNorm(par_solver, - &final_res_norm); + &final_res_norm); HYPRE_BoomerAMGDestroy(par_solver); } diff --git a/external/hypre/src/test/struct.c b/external/hypre/src/test/struct.c index 2d6ad28c..5968fb24 100644 --- a/external/hypre/src/test/struct.c +++ b/external/hypre/src/test/struct.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -20,7 +20,6 @@ /* RDF: Why is this include here? */ #include "_hypre_struct_mv.h" -#include "_hypre_struct_mv.hpp" #ifdef HYPRE_DEBUG /*#include */ @@ -36,9 +35,9 @@ /* end lobpcg */ -HYPRE_Int SetStencilBndry(HYPRE_StructMatrix A,HYPRE_StructGrid gridmatrix,HYPRE_Int* period); +HYPRE_Int SetStencilBndry(HYPRE_StructMatrix A, HYPRE_StructGrid gridmatrix, HYPRE_Int* period); -HYPRE_Int AddValuesMatrix(HYPRE_StructMatrix A,HYPRE_StructGrid gridmatrix, +HYPRE_Int AddValuesMatrix(HYPRE_StructMatrix A, HYPRE_StructGrid gridmatrix, HYPRE_Real cx, HYPRE_Real cy, HYPRE_Real cz, @@ -94,11 +93,13 @@ main( hypre_int argc, HYPRE_Real cf_tol; HYPRE_Int num_procs, myid; + HYPRE_Int device_id = -1; + HYPRE_Int lazy_device_init = 0; HYPRE_Int p, q, r; HYPRE_Int dim; HYPRE_Int n_pre, n_post; - HYPRE_Int nblocks ; + HYPRE_Int nblocks = 0; HYPRE_Int skip; HYPRE_Int sym; HYPRE_Int rap; @@ -133,11 +134,18 @@ main( hypre_int argc, HYPRE_Int read_rhsfromfile_index; HYPRE_Int read_x0fromfile_param; HYPRE_Int read_x0fromfile_index; - HYPRE_Int periodx0[3] = {0,0,0}; + HYPRE_Int periodx0[3] = {0, 0, 0}; HYPRE_Int *readperiodic; HYPRE_Int sum; + HYPRE_Int prec_print_level = 0; + HYPRE_Int solver_print_level = 0; + HYPRE_Int log_level = 0; HYPRE_Int print_system = 0; +#if defined(HYPRE_USING_MEMORY_TRACKER) + HYPRE_Int print_mem_tracker = 0; + char mem_tracker_name[HYPRE_MAX_FILE_NAME_LEN] = {0}; +#endif /* begin lobpcg */ @@ -175,7 +183,18 @@ main( hypre_int argc, HYPRE_MatvecFunctions matvec_fn; /* end lobpcg */ + /* default execution policy and memory space */ +#if defined(HYPRE_TEST_USING_HOST) + HYPRE_MemoryLocation memory_location = HYPRE_MEMORY_HOST; + HYPRE_ExecutionPolicy default_exec_policy = HYPRE_EXEC_HOST; +#else + HYPRE_MemoryLocation memory_location = HYPRE_MEMORY_DEVICE; + HYPRE_ExecutionPolicy default_exec_policy = HYPRE_EXEC_DEVICE; +#endif + HYPRE_Int gpu_aware_mpi = 0; + //HYPRE_Int device_level = -2; + /*----------------------------------------------------------- * Initialize some stuff *-----------------------------------------------------------*/ @@ -186,14 +205,31 @@ main( hypre_int argc, /*----------------------------------------------------------------- * GPU Device binding - * Must be done before HYPRE_Init() and should not be changed after + * Must be done before HYPRE_Initialize() and should not be changed after *-----------------------------------------------------------------*/ - hypre_bind_device(myid, num_procs, hypre_MPI_COMM_WORLD); + for (arg_index = 1; arg_index < argc; arg_index ++) + { + if (strcmp(argv[arg_index], "-lazy_device_init") == 0) + { + lazy_device_init = atoi(argv[++arg_index]); + } + else if (strcmp(argv[arg_index], "-device_id") == 0) + { + device_id = atoi(argv[++arg_index]); + } + } + + hypre_bind_device_id(device_id, myid, num_procs, hypre_MPI_COMM_WORLD); /*----------------------------------------------------------- * Initialize : must be the first HYPRE function to call *-----------------------------------------------------------*/ - HYPRE_Init(); + HYPRE_Initialize(); + + if (!lazy_device_init) + { + HYPRE_DeviceInitialize(); + } #if defined(HYPRE_USING_KOKKOS) Kokkos::initialize (argc, argv); @@ -213,7 +249,8 @@ main( hypre_int argc, sym = 1; rap = 0; relax = 1; - usr_jacobi_weight= 0; + jacobi_weight = 1.0; + usr_jacobi_weight = 0; jump = 0; reps = 1; @@ -263,7 +300,7 @@ main( hypre_int argc, sum = 0; /* ghost defaults */ - for (i = 0; i < 2*dim; i++) + for (i = 0; i < 2 * dim; i++) { num_ghost[i] = 1; A_num_ghost[i] = num_ghost[i]; @@ -318,16 +355,16 @@ main( hypre_int argc, else if ( strcmp(argv[arg_index], "-c") == 0 ) { arg_index++; - cx = atof(argv[arg_index++]); - cy = atof(argv[arg_index++]); - cz = atof(argv[arg_index++]); + cx = (HYPRE_Real)atof(argv[arg_index++]); + cy = (HYPRE_Real)atof(argv[arg_index++]); + cz = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-convect") == 0 ) { arg_index++; - conx = atof(argv[arg_index++]); - cony = atof(argv[arg_index++]); - conz = atof(argv[arg_index++]); + conx = (HYPRE_Real)atof(argv[arg_index++]); + cony = (HYPRE_Real)atof(argv[arg_index++]); + conz = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-d") == 0 ) { @@ -362,12 +399,15 @@ main( hypre_int argc, arg_index++; /* begin lobpcg */ - if ( strcmp(argv[arg_index], "none") == 0 ) { + if ( strcmp(argv[arg_index], "none") == 0 ) + { solver_id = NO_SOLVER; arg_index++; } else /* end lobpcg */ + { solver_id = atoi(argv[arg_index++]); + } } else if ( strcmp(argv[arg_index], "-v") == 0 ) { @@ -388,8 +428,8 @@ main( hypre_int argc, else if ( strcmp(argv[arg_index], "-w") == 0 ) { arg_index++; - jacobi_weight= atof(argv[arg_index++]); - usr_jacobi_weight= 1; /* flag user weight */ + jacobi_weight = (HYPRE_Real)atof(argv[arg_index++]); + usr_jacobi_weight = 1; /* flag user weight */ } else if ( strcmp(argv[arg_index], "-sym") == 0 ) { @@ -419,13 +459,28 @@ main( hypre_int argc, else if ( strcmp(argv[arg_index], "-cf") == 0 ) { arg_index++; - cf_tol = atof(argv[arg_index++]); + cf_tol = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-print") == 0 ) { arg_index++; print_system = 1; } + else if ( strcmp(argv[arg_index], "-pout") == 0 ) + { + arg_index++; + prec_print_level = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-sout") == 0 ) + { + arg_index++; + solver_print_level = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-ll") == 0 ) + { + arg_index++; + log_level = atoi(argv[arg_index++]); + } else if ( strcmp(argv[arg_index], "-help") == 0 ) { print_usage = 1; @@ -451,7 +506,8 @@ main( hypre_int argc, verbosity = atoi(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-vrand") == 0 ) - { /* lobpcg: block size */ + { + /* lobpcg: block size */ arg_index++; blockSize = atoi(argv[arg_index++]); } @@ -471,7 +527,7 @@ main( hypre_int argc, { /* lobpcg: tolerance */ arg_index++; - tol = atof(argv[arg_index++]); + tol = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-pcgitr") == 0 ) { @@ -483,7 +539,7 @@ main( hypre_int argc, { /* lobpcg: inner pcg iterations tolerance */ arg_index++; - pcgTol = atof(argv[arg_index++]); + pcgTol = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-pcgmode") == 0 ) { @@ -497,13 +553,43 @@ main( hypre_int argc, arg_index++; printLevel = atoi(argv[arg_index++]); } - /* - else if ( strcmp(argv[arg_index], "-devicelevel") == 0 ) + else if ( strcmp(argv[arg_index], "-memory_host") == 0 ) + { + arg_index++; + memory_location = HYPRE_MEMORY_HOST; + } + else if ( strcmp(argv[arg_index], "-memory_device") == 0 ) { arg_index++; - device_level = atoi(argv[arg_index++]); + memory_location = HYPRE_MEMORY_DEVICE; + } + else if ( strcmp(argv[arg_index], "-exec_host") == 0 ) + { + arg_index++; + default_exec_policy = HYPRE_EXEC_HOST; + } + else if ( strcmp(argv[arg_index], "-exec_device") == 0 ) + { + arg_index++; + default_exec_policy = HYPRE_EXEC_DEVICE; + } +#if defined(HYPRE_USING_MEMORY_TRACKER) + else if ( strcmp(argv[arg_index], "-print_mem_tracker") == 0 ) + { + arg_index++; + print_mem_tracker = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-mem_tracker_filename") == 0 ) + { + arg_index++; + snprintf(mem_tracker_name, HYPRE_MAX_FILE_NAME_LEN, "%s", argv[arg_index++]); + } +#endif + else if ( strcmp(argv[arg_index], "-gpu_mpi") == 0 ) + { + arg_index++; + gpu_aware_mpi = atoi(argv[arg_index++]); } - */ /* end lobpcg */ else { @@ -511,10 +597,28 @@ main( hypre_int argc, } } +#if defined(HYPRE_USING_MEMORY_TRACKER) + hypre_MemoryTrackerSetPrint(print_mem_tracker); + if (mem_tracker_name[0]) { hypre_MemoryTrackerSetFileName(mem_tracker_name); } +#endif + + /* Set library log level */ + HYPRE_SetLogLevel(log_level); + + /* default memory location */ + HYPRE_SetMemoryLocation(memory_location); + + /* default execution policy */ + HYPRE_SetExecutionPolicy(default_exec_policy); + + HYPRE_SetGpuAwareMPI(gpu_aware_mpi); + /* begin lobpcg */ if ( solver_id == 0 && lobpcgFlag ) + { solver_id = 10; + } /*end lobpcg */ @@ -596,6 +700,13 @@ main( hypre_int argc, hypre_printf(" 2 - GMRES\n"); hypre_printf(" -recompute : Recompute residual in PCG?\n"); hypre_printf(" -cf : convergence factor for Hybrid\n"); + hypre_printf(" -print : print out the system\n"); + hypre_printf(" -pout : print level for the preconditioner\n"); + hypre_printf(" -sout : print level for the solver\n"); + hypre_printf(" -ll : hypre's log level\n"); + hypre_printf(" 0 - (default) No messaging.\n"); + hypre_printf(" 1 - Display memory usage statistics for each MPI rank.\n"); + hypre_printf(" 2 - Display aggregate memory usage statistics over MPI ranks.\n"); hypre_printf("\n"); /* begin lobpcg */ @@ -650,7 +761,7 @@ main( hypre_int argc, * Check a few things *-----------------------------------------------------------*/ - if ((P*Q*R) > num_procs) + if ((P * Q * R) > num_procs) { if (myid == 0) { @@ -658,7 +769,7 @@ main( hypre_int argc, } exit(1); } - else if ((P*Q*R) < num_procs) + else if ((P * Q * R) < num_procs) { if (myid == 0) { @@ -666,7 +777,7 @@ main( hypre_int argc, } } - if ((conx != 0.0 || cony !=0 || conz != 0) && sym == 1 ) + if ((conx != 0.0 || cony != 0 || conz != 0) && sym == 1 ) { if (myid == 0) { @@ -681,10 +792,23 @@ main( hypre_int argc, if (myid == 0 && sum == 0) { +#if defined(HYPRE_DEVELOP_STRING) && defined(HYPRE_DEVELOP_BRANCH) + hypre_printf("\nUsing HYPRE_DEVELOP_STRING: %s (branch %s; the develop branch)\n\n", + HYPRE_DEVELOP_STRING, HYPRE_DEVELOP_BRANCH); + +#elif defined(HYPRE_DEVELOP_STRING) && !defined(HYPRE_DEVELOP_BRANCH) + hypre_printf("\nUsing HYPRE_DEVELOP_STRING: %s (branch %s; not the develop branch)\n\n", + HYPRE_DEVELOP_STRING, HYPRE_BRANCH_NAME); + +#elif defined(HYPRE_RELEASE_VERSION) + hypre_printf("\nUsing HYPRE_RELEASE_VERSION: %s\n\n", + HYPRE_RELEASE_VERSION); +#endif + hypre_printf("Running with these driver parameters:\n"); hypre_printf(" (nx, ny, nz) = (%d, %d, %d)\n", nx, ny, nz); hypre_printf(" (istart[0],istart[1],istart[2]) = (%d, %d, %d)\n", \ - istart[0],istart[1],istart[2]); + istart[0], istart[1], istart[2]); hypre_printf(" (Px, Py, Pz) = (%d, %d, %d)\n", P, Q, R); hypre_printf(" (bx, by, bz) = (%d, %d, %d)\n", bx, by, bz); hypre_printf(" (px, py, pz) = (%d, %d, %d)\n", px, py, pz); @@ -724,7 +848,7 @@ main( hypre_int argc, hypre_MPI_Barrier(hypre_MPI_COMM_WORLD); - for ( rep=0; rep= (P*Q*R)) + if (myid >= (P * Q * R)) { /* My processor has no data on it */ nblocks = bx = by = bz = 0; @@ -871,8 +995,8 @@ main( hypre_int argc, * which is always the case for read_fromfile_param == 0 *-----------------------------------------------------------*/ - HYPRE_StructStencilCreate(dim, (2-sym)*dim + 1, &stencil); - for (s = 0; s < (2-sym)*dim + 1; s++) + HYPRE_StructStencilCreate(dim, (2 - sym)*dim + 1, &stencil); + for (s = 0; s < (2 - sym)*dim + 1; s++) { HYPRE_StructStencilSetElement(stencil, s, offsets[s]); } @@ -895,46 +1019,46 @@ main( hypre_int argc, dxyz[2] = 1.0e+123; if (cx > 0) { - dxyz[0] = sqrt(1.0 / cx); + dxyz[0] = hypre_sqrt(1.0 / cx); } if (cy > 0) { - dxyz[1] = sqrt(1.0 / cy); + dxyz[1] = hypre_sqrt(1.0 / cy); } if (cz > 0) { - dxyz[2] = sqrt(1.0 / cz); + dxyz[2] = hypre_sqrt(1.0 / cz); } #endif /* We do the extreme cases first reading everything from files => sum = 3 * building things from scratch (grid,stencils,extents) sum = 0 */ - if ( (read_fromfile_param ==1) && - (read_x0fromfile_param ==1) && - (read_rhsfromfile_param ==1) + if ( (read_fromfile_param == 1) && + (read_x0fromfile_param == 1) && + (read_rhsfromfile_param == 1) ) { /* ghost selection for reading the matrix and vectors */ for (i = 0; i < dim; i++) { - A_num_ghost[2*i] = 1; - A_num_ghost[2*i + 1] = 1; - v_num_ghost[2*i] = 1; - v_num_ghost[2*i + 1] = 1; + A_num_ghost[2 * i] = 1; + A_num_ghost[2 * i + 1] = 1; + v_num_ghost[2 * i] = 1; + v_num_ghost[2 * i + 1] = 1; } - A = (HYPRE_StructMatrix) - hypre_StructMatrixRead(hypre_MPI_COMM_WORLD, - argv[read_fromfile_index],A_num_ghost); + HYPRE_StructMatrixRead(hypre_MPI_COMM_WORLD, + argv[read_fromfile_index], + A_num_ghost, &A); - b = (HYPRE_StructVector) - hypre_StructVectorRead(hypre_MPI_COMM_WORLD, - argv[read_rhsfromfile_index],v_num_ghost); + HYPRE_StructVectorRead(hypre_MPI_COMM_WORLD, + argv[read_rhsfromfile_index], + v_num_ghost, &b); - x = (HYPRE_StructVector) - hypre_StructVectorRead(hypre_MPI_COMM_WORLD, - argv[read_x0fromfile_index],v_num_ghost); + HYPRE_StructVectorRead(hypre_MPI_COMM_WORLD, + argv[read_x0fromfile_index], + v_num_ghost, &x); } /* beginning of sum == 0 */ @@ -959,8 +1083,8 @@ main( hypre_int argc, case 1: for (ix = 0; ix < bx; ix++) { - ilower[ib][0] = istart[0]+ nx*(bx*p+ix); - iupper[ib][0] = istart[0]+ nx*(bx*p+ix+1) - 1; + ilower[ib][0] = istart[0] + nx * (bx * p + ix); + iupper[ib][0] = istart[0] + nx * (bx * p + ix + 1) - 1; ib++; } break; @@ -968,10 +1092,10 @@ main( hypre_int argc, for (iy = 0; iy < by; iy++) for (ix = 0; ix < bx; ix++) { - ilower[ib][0] = istart[0]+ nx*(bx*p+ix); - iupper[ib][0] = istart[0]+ nx*(bx*p+ix+1) - 1; - ilower[ib][1] = istart[1]+ ny*(by*q+iy); - iupper[ib][1] = istart[1]+ ny*(by*q+iy+1) - 1; + ilower[ib][0] = istart[0] + nx * (bx * p + ix); + iupper[ib][0] = istart[0] + nx * (bx * p + ix + 1) - 1; + ilower[ib][1] = istart[1] + ny * (by * q + iy); + iupper[ib][1] = istart[1] + ny * (by * q + iy + 1) - 1; ib++; } break; @@ -980,12 +1104,12 @@ main( hypre_int argc, for (iy = 0; iy < by; iy++) for (ix = 0; ix < bx; ix++) { - ilower[ib][0] = istart[0]+ nx*(bx*p+ix); - iupper[ib][0] = istart[0]+ nx*(bx*p+ix+1) - 1; - ilower[ib][1] = istart[1]+ ny*(by*q+iy); - iupper[ib][1] = istart[1]+ ny*(by*q+iy+1) - 1; - ilower[ib][2] = istart[2]+ nz*(bz*r+iz); - iupper[ib][2] = istart[2]+ nz*(bz*r+iz+1) - 1; + ilower[ib][0] = istart[0] + nx * (bx * p + ix); + iupper[ib][0] = istart[0] + nx * (bx * p + ix + 1) - 1; + ilower[ib][1] = istart[1] + ny * (by * q + iy); + iupper[ib][1] = istart[1] + ny * (by * q + iy + 1) - 1; + ilower[ib][2] = istart[2] + nz * (bz * r + iz); + iupper[ib][2] = istart[2] + nz * (bz * r + iz + 1) - 1; ib++; } break; @@ -1001,30 +1125,6 @@ main( hypre_int argc, HYPRE_StructGridSetNumGhost(grid, num_ghost); HYPRE_StructGridAssemble(grid); -#if 0// defined(HYPRE_USING_CUDA) - HYPRE_StructGridSetDataLocation(grid, HYPRE_MEMORY_DEVICE); - /* - if (device_level == 0) - { - HYPRE_StructGridSetDataLocation(grid, HYPRE_MEMORY_HOST); - hypre_SetDeviceOff(); - } - else - { - HYPRE_Int max_box_size = hypre_StructGridGetMaxBoxSize(grid); - if (max_box_size < 0)//HYPRE_MIN_GPU_SIZE) - { - HYPRE_StructGridSetDataLocation(grid, HYPRE_MEMORY_HOST); - hypre_SetDeviceOff(); - } - else - { - HYPRE_StructGridSetDataLocation(grid, HYPRE_MEMORY_DEVICE); - } - } - */ -#endif - /*----------------------------------------------------------- * Set up the matrix structure *-----------------------------------------------------------*/ @@ -1038,38 +1138,38 @@ main( hypre_int argc, stencil_entries = hypre_CTAlloc(HYPRE_Int, stencil_size, HYPRE_MEMORY_HOST); if ( solver_id == 3 || solver_id == 13) { - for ( i=0; i=1 ); - if ( diag_rank==0 ) + hypre_assert( stencil_size >= 1 ); + if ( diag_rank == 0 ) { - stencil_entries[diag_rank]=1; + stencil_entries[diag_rank] = 1; } else { - stencil_entries[diag_rank]=0; + stencil_entries[diag_rank] = 0; } - for ( i=0; i 0 ) { + if ( pcgIterations > 0 ) + { time_index = hypre_InitializeTiming("PCG Setup"); hypre_BeginTiming(time_index); @@ -1739,7 +1854,7 @@ main( hypre_int argc, HYPRE_PCGSetTol( (HYPRE_Solver)solver, pcgTol ); HYPRE_PCGSetTwoNorm( (HYPRE_Solver)solver, 1 ); HYPRE_PCGSetRelChange( (HYPRE_Solver)solver, 0 ); - HYPRE_PCGSetPrintLevel( (HYPRE_Solver)solver, 0 ); + HYPRE_PCGSetPrintLevel( (HYPRE_Solver)solver, solver_print_level ); if (solver_id == 10) { @@ -1751,7 +1866,7 @@ main( hypre_int argc, HYPRE_StructSMGSetZeroGuess(precond); HYPRE_StructSMGSetNumPreRelax(precond, n_pre); HYPRE_StructSMGSetNumPostRelax(precond, n_post); - HYPRE_StructSMGSetPrintLevel(precond, 0); + HYPRE_StructSMGSetPrintLevel(precond, prec_print_level); HYPRE_StructSMGSetLogging(precond, 0); #if 0 //defined(HYPRE_USING_CUDA) HYPRE_StructSMGSetDeviceLevel(precond, device_level); @@ -1779,7 +1894,7 @@ main( hypre_int argc, HYPRE_StructPFMGSetNumPostRelax(precond, n_post); HYPRE_StructPFMGSetSkipRelax(precond, skip); /*HYPRE_StructPFMGSetDxyz(precond, dxyz);*/ - HYPRE_StructPFMGSetPrintLevel(precond, 0); + HYPRE_StructPFMGSetPrintLevel(precond, prec_print_level); HYPRE_StructPFMGSetLogging(precond, 0); #if 0 //defined(HYPRE_USING_CUDA) HYPRE_StructPFMGSetDeviceLevel(precond, device_level); @@ -1805,7 +1920,7 @@ main( hypre_int argc, } HYPRE_StructSparseMSGSetNumPreRelax(precond, n_pre); HYPRE_StructSparseMSGSetNumPostRelax(precond, n_post); - HYPRE_StructSparseMSGSetPrintLevel(precond, 0); + HYPRE_StructSparseMSGSetPrintLevel(precond, prec_print_level); HYPRE_StructSparseMSGSetLogging(precond, 0); HYPRE_PCGSetPrecond( (HYPRE_Solver) solver, (HYPRE_PtrToSolverFcn) HYPRE_StructSparseMSGSolve, @@ -1838,7 +1953,9 @@ main( hypre_int argc, else if (solver_id != NO_SOLVER ) { if ( verbosity ) + { hypre_printf("Solver ID not recognized - running inner PCG iterations without preconditioner\n\n"); + } } hypre_EndTiming(time_index); @@ -1866,9 +1983,13 @@ main( hypre_int argc, eigenvalues = hypre_CTAlloc(HYPRE_Real, blockSize, HYPRE_MEMORY_HOST); if ( lobpcgSeed ) + { mv_MultiVectorSetRandom( eigenvectors, lobpcgSeed ); + } else + { mv_MultiVectorSetRandom( eigenvectors, (HYPRE_Int)time(0) ); + } time_index = hypre_InitializeTiming("LOBPCG Solve"); hypre_BeginTiming(time_index); @@ -1881,7 +2002,8 @@ main( hypre_int argc, hypre_FinalizeTiming(time_index); hypre_ClearTiming(); - if ( checkOrtho ) { + if ( checkOrtho ) + { gramXX = utilities_FortranMatrixCreate(); identity = utilities_FortranMatrixCreate(); @@ -1894,33 +2016,44 @@ main( hypre_int argc, utilities_FortranMatrixAdd( -1, identity, gramXX, gramXX ); nonOrthF = utilities_FortranMatrixFNorm( gramXX ); if ( myid == 0 ) + { hypre_printf("Non-orthonormality of eigenvectors: %12.5e\n", nonOrthF); + } utilities_FortranMatrixDestroy( gramXX ); utilities_FortranMatrixDestroy( identity ); } - if ( printLevel ) { + if ( printLevel ) + { - if ( myid == 0 ) { - if ( (filePtr = fopen("values.txt", "w")) ) { + if ( myid == 0 ) + { + if ( (filePtr = fopen("values.txt", "w")) ) + { hypre_fprintf(filePtr, "%d\n", blockSize); for ( i = 0; i < blockSize; i++ ) + { hypre_fprintf(filePtr, "%22.14e\n", eigenvalues[i]); + } fclose(filePtr); } - if ( (filePtr = fopen("residuals.txt", "w")) ) { + if ( (filePtr = fopen("residuals.txt", "w")) ) + { residualNorms = HYPRE_LOBPCGResidualNorms( (HYPRE_Solver)lobpcg_solver ); residuals = utilities_FortranMatrixValues( residualNorms ); hypre_fprintf(filePtr, "%d\n", blockSize); for ( i = 0; i < blockSize; i++ ) + { hypre_fprintf(filePtr, "%22.14e\n", residuals[i]); + } fclose(filePtr); } - if ( printLevel > 1 ) { + if ( printLevel > 1 ) + { printBuffer = utilities_FortranMatrixCreate(); @@ -1984,7 +2117,7 @@ main( hypre_int argc, HYPRE_StructSMGSetZeroGuess(precond); HYPRE_StructSMGSetNumPreRelax(precond, n_pre); HYPRE_StructSMGSetNumPostRelax(precond, n_post); - HYPRE_StructSMGSetPrintLevel(precond, 0); + HYPRE_StructSMGSetPrintLevel(precond, prec_print_level); HYPRE_StructSMGSetLogging(precond, 0); #if 0 //defined(HYPRE_USING_CUDA) HYPRE_StructSMGSetDeviceLevel(precond, device_level); @@ -2012,7 +2145,7 @@ main( hypre_int argc, HYPRE_StructPFMGSetNumPostRelax(precond, n_post); HYPRE_StructPFMGSetSkipRelax(precond, skip); /*HYPRE_StructPFMGSetDxyz(precond, dxyz);*/ - HYPRE_StructPFMGSetPrintLevel(precond, 0); + HYPRE_StructPFMGSetPrintLevel(precond, prec_print_level); HYPRE_StructPFMGSetLogging(precond, 0); #if 0 //defined(HYPRE_USING_CUDA) HYPRE_StructPFMGSetDeviceLevel(precond, device_level); @@ -2038,7 +2171,7 @@ main( hypre_int argc, } HYPRE_StructSparseMSGSetNumPreRelax(precond, n_pre); HYPRE_StructSparseMSGSetNumPostRelax(precond, n_post); - HYPRE_StructSparseMSGSetPrintLevel(precond, 0); + HYPRE_StructSparseMSGSetPrintLevel(precond, prec_print_level); HYPRE_StructSparseMSGSetLogging(precond, 0); HYPRE_LOBPCGSetPrecond( (HYPRE_Solver) solver, (HYPRE_PtrToSolverFcn) HYPRE_StructSparseMSGSolve, @@ -2071,11 +2204,13 @@ main( hypre_int argc, else if (solver_id != NO_SOLVER ) { if ( verbosity ) + { hypre_printf("Solver ID not recognized - running LOBPCG without preconditioner\n\n"); + } } HYPRE_LOBPCGSetup - ( (HYPRE_Solver)solver, (HYPRE_Matrix)A, (HYPRE_Vector)b, (HYPRE_Vector)x ); + ( (HYPRE_Solver)solver, (HYPRE_Matrix)A, (HYPRE_Vector)b, (HYPRE_Vector)x ); hypre_EndTiming(time_index); hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); @@ -2088,22 +2223,27 @@ main( hypre_int argc, eigenvalues = hypre_CTAlloc(HYPRE_Real, blockSize, HYPRE_MEMORY_HOST); if ( lobpcgSeed ) + { mv_MultiVectorSetRandom( eigenvectors, lobpcgSeed ); + } else + { mv_MultiVectorSetRandom( eigenvectors, (HYPRE_Int)time(0) ); + } time_index = hypre_InitializeTiming("PCG Solve"); hypre_BeginTiming(time_index); HYPRE_LOBPCGSolve - ( (HYPRE_Solver)solver, constrains, eigenvectors, eigenvalues ); + ( (HYPRE_Solver)solver, constrains, eigenvectors, eigenvalues ); hypre_EndTiming(time_index); hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); - if ( checkOrtho ) { + if ( checkOrtho ) + { gramXX = utilities_FortranMatrixCreate(); identity = utilities_FortranMatrixCreate(); @@ -2116,33 +2256,44 @@ main( hypre_int argc, utilities_FortranMatrixAdd( -1, identity, gramXX, gramXX ); nonOrthF = utilities_FortranMatrixFNorm( gramXX ); if ( myid == 0 ) + { hypre_printf("Non-orthonormality of eigenvectors: %12.5e\n", nonOrthF); + } utilities_FortranMatrixDestroy( gramXX ); utilities_FortranMatrixDestroy( identity ); } - if ( printLevel ) { + if ( printLevel ) + { - if ( myid == 0 ) { - if ( (filePtr = fopen("values.txt", "w")) ) { + if ( myid == 0 ) + { + if ( (filePtr = fopen("values.txt", "w")) ) + { hypre_fprintf(filePtr, "%d\n", blockSize); for ( i = 0; i < blockSize; i++ ) + { hypre_fprintf(filePtr, "%22.14e\n", eigenvalues[i]); + } fclose(filePtr); } - if ( (filePtr = fopen("residuals.txt", "w")) ) { + if ( (filePtr = fopen("residuals.txt", "w")) ) + { residualNorms = HYPRE_LOBPCGResidualNorms( (HYPRE_Solver)solver ); residuals = utilities_FortranMatrixValues( residualNorms ); hypre_fprintf(filePtr, "%d\n", blockSize); for ( i = 0; i < blockSize; i++ ) + { hypre_fprintf(filePtr, "%22.14e\n", residuals[i]); + } fclose(filePtr); } - if ( printLevel > 1 ) { + if ( printLevel > 1 ) + { printBuffer = utilities_FortranMatrixCreate(); @@ -2186,7 +2337,7 @@ main( hypre_int argc, hypre_TFree(eigenvalues, HYPRE_MEMORY_HOST); } - hypre_TFree( interpreter , HYPRE_MEMORY_HOST); + hypre_TFree( interpreter, HYPRE_MEMORY_HOST); } @@ -2214,7 +2365,7 @@ main( hypre_int argc, HYPRE_StructHybridSetStopCrit(solver, 0); HYPRE_StructHybridSetKDim(solver, 10); } - HYPRE_StructHybridSetPrintLevel(solver, 1); + HYPRE_StructHybridSetPrintLevel(solver, solver_print_level); HYPRE_StructHybridSetLogging(solver, 1); HYPRE_StructHybridSetSolverType(solver, solver_type); HYPRE_StructHybridSetRecomputeResidual(solver, recompute_res); @@ -2229,7 +2380,7 @@ main( hypre_int argc, HYPRE_StructSMGSetZeroGuess(precond); HYPRE_StructSMGSetNumPreRelax(precond, n_pre); HYPRE_StructSMGSetNumPostRelax(precond, n_post); - HYPRE_StructSMGSetPrintLevel(precond, 0); + HYPRE_StructSMGSetPrintLevel(precond, prec_print_level); HYPRE_StructSMGSetLogging(precond, 0); #if 0 //defined(HYPRE_USING_CUDA) HYPRE_StructSMGSetDeviceLevel(precond, device_level); @@ -2257,7 +2408,7 @@ main( hypre_int argc, HYPRE_StructPFMGSetNumPostRelax(precond, n_post); HYPRE_StructPFMGSetSkipRelax(precond, skip); /*HYPRE_StructPFMGSetDxyz(precond, dxyz);*/ - HYPRE_StructPFMGSetPrintLevel(precond, 0); + HYPRE_StructPFMGSetPrintLevel(precond, prec_print_level); HYPRE_StructPFMGSetLogging(precond, 0); #if 0 //defined(HYPRE_USING_CUDA) HYPRE_StructPFMGSetDeviceLevel(precond, device_level); @@ -2283,7 +2434,7 @@ main( hypre_int argc, } HYPRE_StructSparseMSGSetNumPreRelax(precond, n_pre); HYPRE_StructSparseMSGSetNumPostRelax(precond, n_post); - HYPRE_StructSparseMSGSetPrintLevel(precond, 0); + HYPRE_StructSparseMSGSetPrintLevel(precond, prec_print_level); HYPRE_StructSparseMSGSetLogging(precond, 0); HYPRE_StructHybridSetPrecond(solver, HYPRE_StructSparseMSGSolve, @@ -2340,7 +2491,7 @@ main( hypre_int argc, HYPRE_GMRESSetMaxIter( (HYPRE_Solver)solver, 100 ); HYPRE_GMRESSetTol( (HYPRE_Solver)solver, tol ); HYPRE_GMRESSetRelChange( (HYPRE_Solver)solver, 0 ); - HYPRE_GMRESSetPrintLevel( (HYPRE_Solver)solver, 1 ); + HYPRE_GMRESSetPrintLevel( (HYPRE_Solver)solver, solver_print_level ); HYPRE_GMRESSetLogging( (HYPRE_Solver)solver, 1 ); if (solver_id == 30) @@ -2353,7 +2504,7 @@ main( hypre_int argc, HYPRE_StructSMGSetZeroGuess(precond); HYPRE_StructSMGSetNumPreRelax(precond, n_pre); HYPRE_StructSMGSetNumPostRelax(precond, n_post); - HYPRE_StructSMGSetPrintLevel(precond, 0); + HYPRE_StructSMGSetPrintLevel(precond, prec_print_level); HYPRE_StructSMGSetLogging(precond, 0); #if 0 //defined(HYPRE_USING_CUDA) HYPRE_StructSMGSetDeviceLevel(precond, device_level); @@ -2381,7 +2532,7 @@ main( hypre_int argc, HYPRE_StructPFMGSetNumPostRelax(precond, n_post); HYPRE_StructPFMGSetSkipRelax(precond, skip); /*HYPRE_StructPFMGSetDxyz(precond, dxyz);*/ - HYPRE_StructPFMGSetPrintLevel(precond, 0); + HYPRE_StructPFMGSetPrintLevel(precond, prec_print_level); HYPRE_StructPFMGSetLogging(precond, 0); #if 0 //defined(HYPRE_USING_CUDA) HYPRE_StructPFMGSetDeviceLevel(precond, device_level); @@ -2407,7 +2558,7 @@ main( hypre_int argc, } HYPRE_StructSparseMSGSetNumPreRelax(precond, n_pre); HYPRE_StructSparseMSGSetNumPostRelax(precond, n_post); - HYPRE_StructSparseMSGSetPrintLevel(precond, 0); + HYPRE_StructSparseMSGSetPrintLevel(precond, prec_print_level); HYPRE_StructSparseMSGSetLogging(precond, 0); HYPRE_GMRESSetPrecond( (HYPRE_Solver)solver, (HYPRE_PtrToSolverFcn) HYPRE_StructSparseMSGSolve, @@ -2439,7 +2590,7 @@ main( hypre_int argc, } HYPRE_GMRESSetup - ( (HYPRE_Solver)solver, (HYPRE_Matrix)A, (HYPRE_Vector)b, (HYPRE_Vector)x ); + ( (HYPRE_Solver)solver, (HYPRE_Matrix)A, (HYPRE_Vector)b, (HYPRE_Vector)x ); hypre_EndTiming(time_index); hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); @@ -2450,7 +2601,7 @@ main( hypre_int argc, hypre_BeginTiming(time_index); HYPRE_GMRESSolve - ( (HYPRE_Solver)solver, (HYPRE_Matrix)A, (HYPRE_Vector)b, (HYPRE_Vector)x); + ( (HYPRE_Solver)solver, (HYPRE_Matrix)A, (HYPRE_Vector)b, (HYPRE_Vector)x); hypre_EndTiming(time_index); hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); @@ -2491,7 +2642,7 @@ main( hypre_int argc, HYPRE_StructBiCGSTABCreate(hypre_MPI_COMM_WORLD, &solver); HYPRE_BiCGSTABSetMaxIter( (HYPRE_Solver)solver, 100 ); HYPRE_BiCGSTABSetTol( (HYPRE_Solver)solver, tol ); - HYPRE_BiCGSTABSetPrintLevel( (HYPRE_Solver)solver, 1 ); + HYPRE_BiCGSTABSetPrintLevel( (HYPRE_Solver)solver, solver_print_level ); HYPRE_BiCGSTABSetLogging( (HYPRE_Solver)solver, 1 ); if (solver_id == 40) @@ -2504,7 +2655,7 @@ main( hypre_int argc, HYPRE_StructSMGSetZeroGuess(precond); HYPRE_StructSMGSetNumPreRelax(precond, n_pre); HYPRE_StructSMGSetNumPostRelax(precond, n_post); - HYPRE_StructSMGSetPrintLevel(precond, 0); + HYPRE_StructSMGSetPrintLevel(precond, prec_print_level); HYPRE_StructSMGSetLogging(precond, 0); #if 0 //defined(HYPRE_USING_CUDA) HYPRE_StructSMGSetDeviceLevel(precond, device_level); @@ -2532,7 +2683,7 @@ main( hypre_int argc, HYPRE_StructPFMGSetNumPostRelax(precond, n_post); HYPRE_StructPFMGSetSkipRelax(precond, skip); /*HYPRE_StructPFMGSetDxyz(precond, dxyz);*/ - HYPRE_StructPFMGSetPrintLevel(precond, 0); + HYPRE_StructPFMGSetPrintLevel(precond, prec_print_level); HYPRE_StructPFMGSetLogging(precond, 0); #if 0 //defined(HYPRE_USING_CUDA) HYPRE_StructPFMGSetDeviceLevel(precond, device_level); @@ -2558,7 +2709,7 @@ main( hypre_int argc, } HYPRE_StructSparseMSGSetNumPreRelax(precond, n_pre); HYPRE_StructSparseMSGSetNumPostRelax(precond, n_post); - HYPRE_StructSparseMSGSetPrintLevel(precond, 0); + HYPRE_StructSparseMSGSetPrintLevel(precond, prec_print_level); HYPRE_StructSparseMSGSetLogging(precond, 0); HYPRE_BiCGSTABSetPrecond( (HYPRE_Solver)solver, (HYPRE_PtrToSolverFcn) HYPRE_StructSparseMSGSolve, @@ -2590,7 +2741,7 @@ main( hypre_int argc, } HYPRE_BiCGSTABSetup - ( (HYPRE_Solver)solver, (HYPRE_Matrix)A, (HYPRE_Vector)b, (HYPRE_Vector)x ); + ( (HYPRE_Solver)solver, (HYPRE_Matrix)A, (HYPRE_Vector)b, (HYPRE_Vector)x ); hypre_EndTiming(time_index); hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); @@ -2601,7 +2752,7 @@ main( hypre_int argc, hypre_BeginTiming(time_index); HYPRE_BiCGSTABSolve - ( (HYPRE_Solver)solver, (HYPRE_Matrix)A, (HYPRE_Vector)b, (HYPRE_Vector)x); + ( (HYPRE_Solver)solver, (HYPRE_Matrix)A, (HYPRE_Vector)b, (HYPRE_Vector)x); hypre_EndTiming(time_index); hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); @@ -2642,7 +2793,7 @@ main( hypre_int argc, HYPRE_LGMRESSetKDim( (HYPRE_Solver) solver, 5 ); HYPRE_LGMRESSetMaxIter( (HYPRE_Solver)solver, 100 ); HYPRE_LGMRESSetTol( (HYPRE_Solver)solver, tol ); - HYPRE_LGMRESSetPrintLevel( (HYPRE_Solver)solver, 1 ); + HYPRE_LGMRESSetPrintLevel( (HYPRE_Solver)solver, solver_print_level ); HYPRE_LGMRESSetLogging( (HYPRE_Solver)solver, 1 ); if (solver_id == 50) @@ -2655,7 +2806,7 @@ main( hypre_int argc, HYPRE_StructSMGSetZeroGuess(precond); HYPRE_StructSMGSetNumPreRelax(precond, n_pre); HYPRE_StructSMGSetNumPostRelax(precond, n_post); - HYPRE_StructSMGSetPrintLevel(precond, 0); + HYPRE_StructSMGSetPrintLevel(precond, prec_print_level); HYPRE_StructSMGSetLogging(precond, 0); #if 0 //defined(HYPRE_USING_CUDA) HYPRE_StructSMGSetDeviceLevel(precond, device_level); @@ -2683,7 +2834,7 @@ main( hypre_int argc, HYPRE_StructPFMGSetNumPostRelax(precond, n_post); HYPRE_StructPFMGSetSkipRelax(precond, skip); /*HYPRE_StructPFMGSetDxyz(precond, dxyz);*/ - HYPRE_StructPFMGSetPrintLevel(precond, 0); + HYPRE_StructPFMGSetPrintLevel(precond, prec_print_level); HYPRE_StructPFMGSetLogging(precond, 0); #if 0 //defined(HYPRE_USING_CUDA) HYPRE_StructPFMGSetDeviceLevel(precond, device_level); @@ -2695,7 +2846,7 @@ main( hypre_int argc, } HYPRE_LGMRESSetup - ( (HYPRE_Solver)solver, (HYPRE_Matrix)A, (HYPRE_Vector)b, (HYPRE_Vector)x ); + ( (HYPRE_Solver)solver, (HYPRE_Matrix)A, (HYPRE_Vector)b, (HYPRE_Vector)x ); hypre_EndTiming(time_index); hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); @@ -2706,7 +2857,7 @@ main( hypre_int argc, hypre_BeginTiming(time_index); HYPRE_LGMRESSolve - ( (HYPRE_Solver)solver, (HYPRE_Matrix)A, (HYPRE_Vector)b, (HYPRE_Vector)x); + ( (HYPRE_Solver)solver, (HYPRE_Matrix)A, (HYPRE_Vector)b, (HYPRE_Vector)x); hypre_EndTiming(time_index); hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); @@ -2740,7 +2891,7 @@ main( hypre_int argc, HYPRE_FlexGMRESSetKDim( (HYPRE_Solver) solver, 5 ); HYPRE_FlexGMRESSetMaxIter( (HYPRE_Solver)solver, 100 ); HYPRE_FlexGMRESSetTol( (HYPRE_Solver)solver, tol ); - HYPRE_FlexGMRESSetPrintLevel( (HYPRE_Solver)solver, 1 ); + HYPRE_FlexGMRESSetPrintLevel( (HYPRE_Solver)solver, solver_print_level ); HYPRE_FlexGMRESSetLogging( (HYPRE_Solver)solver, 1 ); if (solver_id == 60) @@ -2753,7 +2904,7 @@ main( hypre_int argc, HYPRE_StructSMGSetZeroGuess(precond); HYPRE_StructSMGSetNumPreRelax(precond, n_pre); HYPRE_StructSMGSetNumPostRelax(precond, n_post); - HYPRE_StructSMGSetPrintLevel(precond, 0); + HYPRE_StructSMGSetPrintLevel(precond, prec_print_level); HYPRE_StructSMGSetLogging(precond, 0); #if 0 //defined(HYPRE_USING_CUDA) HYPRE_StructSMGSetDeviceLevel(precond, device_level); @@ -2781,7 +2932,7 @@ main( hypre_int argc, HYPRE_StructPFMGSetNumPostRelax(precond, n_post); HYPRE_StructPFMGSetSkipRelax(precond, skip); /*HYPRE_StructPFMGSetDxyz(precond, dxyz);*/ - HYPRE_StructPFMGSetPrintLevel(precond, 0); + HYPRE_StructPFMGSetPrintLevel(precond, prec_print_level); HYPRE_StructPFMGSetLogging(precond, 0); #if 0 //defined(HYPRE_USING_CUDA) HYPRE_StructPFMGSetDeviceLevel(precond, device_level); @@ -2793,7 +2944,7 @@ main( hypre_int argc, } HYPRE_FlexGMRESSetup - ( (HYPRE_Solver)solver, (HYPRE_Matrix)A, (HYPRE_Vector)b, (HYPRE_Vector)x ); + ( (HYPRE_Solver)solver, (HYPRE_Matrix)A, (HYPRE_Vector)b, (HYPRE_Vector)x ); hypre_EndTiming(time_index); hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); @@ -2804,7 +2955,7 @@ main( hypre_int argc, hypre_BeginTiming(time_index); HYPRE_FlexGMRESSolve - ( (HYPRE_Solver)solver, (HYPRE_Matrix)A, (HYPRE_Vector)b, (HYPRE_Vector)x); + ( (HYPRE_Solver)solver, (HYPRE_Matrix)A, (HYPRE_Vector)b, (HYPRE_Vector)x); hypre_EndTiming(time_index); hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); @@ -2823,7 +2974,6 @@ main( hypre_int argc, { HYPRE_StructPFMGDestroy(precond); } - } /*----------------------------------------------------------- @@ -2835,7 +2985,7 @@ main( hypre_int argc, HYPRE_StructVectorPrint("struct.out.x", x, 0); } - if (myid == 0 && rep==reps-1 /* begin lobpcg */ && !lobpcgFlag /* end lobpcg */) + if (myid == 0 && rep == reps - 1 /* begin lobpcg */ && !lobpcgFlag /* end lobpcg */) { hypre_printf("\n"); hypre_printf("Iterations = %d\n", num_iterations); @@ -2855,8 +3005,8 @@ main( hypre_int argc, HYPRE_Int i, imax, N; /* compute imax */ - N = (P*nx)*(Q*ny)*(R*nz); - imax = (5*1000000) / N; + N = (P * nx) * (Q * ny) * (R * nz); + imax = (5 * 1000000) / N; matvec_data = hypre_StructMatvecCreate(); hypre_StructMatvecSetup(matvec_data, A, x); @@ -2869,7 +3019,7 @@ main( hypre_int argc, hypre_StructMatvecCompute(matvec_data, 1.0, A, x, 1.0, b); } /* this counts mult-adds */ - hypre_IncFLOPCount(7*N*imax); + hypre_IncFLOPCount(7 * N * imax); hypre_EndTiming(time_index); hypre_PrintTiming("Matvec time", hypre_MPI_COMM_WORLD); @@ -2890,7 +3040,9 @@ main( hypre_int argc, HYPRE_StructVectorDestroy(x); for ( i = 0; i < (dim + 1); i++) + { hypre_TFree(offsets[i], HYPRE_MEMORY_HOST); + } hypre_TFree(offsets, HYPRE_MEMORY_HOST); } @@ -2904,6 +3056,17 @@ main( hypre_int argc, /* Finalize MPI */ hypre_MPI_Finalize(); +#if defined(HYPRE_USING_MEMORY_TRACKER) + if (memory_location == HYPRE_MEMORY_HOST) + { + if (hypre_total_bytes[hypre_MEMORY_DEVICE] || hypre_total_bytes[hypre_MEMORY_UNIFIED]) + { + hypre_printf("Error: nonzero GPU memory allocated with the HOST mode\n"); + hypre_assert(0); + } + } +#endif + #if defined(HYPRE_USING_DEVICE_OPENMP) /* use this for the stats of the offloading counts */ //HYPRE_OMPOffloadStatPrint(); @@ -2918,90 +3081,63 @@ main( hypre_int argc, *-------------------------------------------------------------------------*/ HYPRE_Int -AddValuesVector( hypre_StructGrid *gridvector, +AddValuesVector( hypre_StructGrid *gridvector, hypre_StructVector *zvector, HYPRE_Int *period, - HYPRE_Real value ) + HYPRE_Real value ) { -/* #include "_hypre_struct_mv.h" */ - HYPRE_Int ierr = 0; - hypre_BoxArray *gridboxes; - HYPRE_Int ib; - hypre_IndexRef ilower; - hypre_IndexRef iupper; - hypre_Box *box; - HYPRE_Real *values; - HYPRE_Int volume,dim; -#if 0 //defined(HYPRE_USING_CUDA) - HYPRE_Int data_location = hypre_StructGridDataLocation(hypre_StructVectorGrid(zvector)); -#endif + /* #include "_hypre_struct_mv.h" */ + HYPRE_Int i, ierr = 0; + hypre_BoxArray *gridboxes; + HYPRE_Int ib; + hypre_IndexRef ilower; + hypre_IndexRef iupper; + hypre_Box *box; + HYPRE_Real *values; + HYPRE_Real *values_h; + HYPRE_Int volume, dim; + HYPRE_MemoryLocation memory_location = hypre_StructVectorMemoryLocation(zvector); gridboxes = hypre_StructGridBoxes(gridvector); dim = hypre_StructGridNDim(gridvector); - ib=0; + ib = 0; hypre_ForBoxI(ib, gridboxes) { box = hypre_BoxArrayBox(gridboxes, ib); - volume = hypre_BoxVolume(box); -#if 0 //defined(HYPRE_USING_CUDA) - if (data_location != HYPRE_MEMORY_HOST) - { - values = hypre_CTAlloc(HYPRE_Real, volume,HYPRE_MEMORY_DEVICE); - } - else - { - values = hypre_CTAlloc(HYPRE_Real, volume,HYPRE_MEMORY_HOST); - } -#else - values = hypre_CTAlloc(HYPRE_Real, volume,HYPRE_MEMORY_DEVICE); -#endif + volume = hypre_BoxVolume(box); + values = hypre_CTAlloc(HYPRE_Real, volume, memory_location); + values_h = hypre_CTAlloc(HYPRE_Real, volume, HYPRE_MEMORY_HOST); + /*----------------------------------------------------------- * For periodic b.c. in all directions, need rhs to satisfy * compatibility condition. Achieved by setting a source and * sink of equal strength. All other problems have rhs = 1. *-----------------------------------------------------------*/ -#define DEVICE_VAR is_device_ptr(values) if ((dim == 2 && period[0] != 0 && period[1] != 0) || (dim == 3 && period[0] != 0 && period[1] != 0 && period[2] != 0)) { - hypre_LoopBegin(volume,i) - { - values[i] = 0.0; - values[0] = value; - values[volume - 1] = -value; - - } - hypre_LoopEnd() + values_h[0] = value; + values_h[volume - 1] = -value; } else { - hypre_LoopBegin(volume,i) + for (i = 0; i < volume; i++) { - values[i] = value; + values_h[i] = value; } - hypre_LoopEnd() } -#undef DEVICE_VAR + + hypre_TMemcpy(values, values_h, HYPRE_Real, volume, memory_location, HYPRE_MEMORY_HOST); ilower = hypre_BoxIMin(box); iupper = hypre_BoxIMax(box); HYPRE_StructVectorSetBoxValues(zvector, ilower, iupper, values); -#if 0 //defined(HYPRE_USING_CUDA) - if (data_location != HYPRE_MEMORY_HOST) - { - hypre_TFree(values,HYPRE_MEMORY_DEVICE); - } - else - { - hypre_TFree(values,HYPRE_MEMORY_HOST); - } -#else - hypre_TFree(values,HYPRE_MEMORY_DEVICE); -#endif + hypre_TFree(values, memory_location); + hypre_TFree(values_h, HYPRE_MEMORY_HOST); } return ierr; @@ -3025,31 +3161,30 @@ AddValuesMatrix(HYPRE_StructMatrix A, HYPRE_Real conz) { - HYPRE_Int ierr=0; - hypre_BoxArray *gridboxes; - HYPRE_Int s,bi; - hypre_IndexRef ilower; - hypre_IndexRef iupper; - hypre_Box *box; - HYPRE_Real *values; - HYPRE_Real east,west; - HYPRE_Real north,south; - HYPRE_Real top,bottom; - HYPRE_Real center; - HYPRE_Int volume,dim,sym; - HYPRE_Int *stencil_indices; - HYPRE_Int stencil_size; - HYPRE_Int constant_coefficient; -#if 0 //defined(HYPRE_USING_CUDA) - HYPRE_Int data_location = hypre_StructGridDataLocation(hypre_StructMatrixGrid(A)); -#endif - - gridboxes = hypre_StructGridBoxes(gridmatrix); - dim = hypre_StructGridNDim(gridmatrix); - sym = hypre_StructMatrixSymmetric(A); + HYPRE_Int d, ierr = 0; + hypre_BoxArray *gridboxes; + HYPRE_Int s, bi; + hypre_IndexRef ilower; + hypre_IndexRef iupper; + hypre_Box *box; + HYPRE_Real *values; + HYPRE_Real *values_h; + HYPRE_Real east, west; + HYPRE_Real north, south; + HYPRE_Real top, bottom; + HYPRE_Real center; + HYPRE_Int volume, dim, sym; + HYPRE_Int *stencil_indices; + HYPRE_Int stencil_size; + HYPRE_Int constant_coefficient; + HYPRE_MemoryLocation memory_location = hypre_StructMatrixMemoryLocation(A); + + gridboxes = hypre_StructGridBoxes(gridmatrix); + dim = hypre_StructGridNDim(gridmatrix); + sym = hypre_StructMatrixSymmetric(A); constant_coefficient = hypre_StructMatrixConstantCoefficient(A); - bi=0; + bi = 0; east = -cx; west = -cx; @@ -3057,9 +3192,9 @@ AddValuesMatrix(HYPRE_StructMatrix A, south = -cy; top = -cz; bottom = -cz; - center = 2.0*cx; - if (dim > 1) center += 2.0*cy; - if (dim > 2) center += 2.0*cz; + center = 2.0 * cx; + if (dim > 1) { center += 2.0 * cy; } + if (dim > 2) { center += 2.0 * cz; } stencil_size = 1 + (2 - sym) * dim; stencil_indices = hypre_CTAlloc(HYPRE_Int, stencil_size, HYPRE_MEMORY_HOST); @@ -3068,56 +3203,50 @@ AddValuesMatrix(HYPRE_StructMatrix A, stencil_indices[s] = s; } - if(sym) + if (sym) { - if ( constant_coefficient==0 ) + if ( constant_coefficient == 0 ) { hypre_ForBoxI(bi, gridboxes) { - box = hypre_BoxArrayBox(gridboxes, bi); - volume = hypre_BoxVolume(box); -#if 0 //defined(HYPRE_USING_CUDA) - if (data_location != HYPRE_MEMORY_HOST) - { - values = hypre_CTAlloc(HYPRE_Real, stencil_size*volume, HYPRE_MEMORY_DEVICE); - } - else - { - values = hypre_CTAlloc(HYPRE_Real, stencil_size*volume, HYPRE_MEMORY_HOST); - } -#else - values = hypre_CTAlloc(HYPRE_Real, stencil_size*volume, HYPRE_MEMORY_DEVICE); -#endif + box = hypre_BoxArrayBox(gridboxes, bi); + volume = hypre_BoxVolume(box); + values = hypre_CTAlloc(HYPRE_Real, stencil_size * volume, memory_location); + values_h = hypre_CTAlloc(HYPRE_Real, stencil_size * volume, HYPRE_MEMORY_HOST); -#define DEVICE_VAR is_device_ptr(values) if (dim == 1) { - hypre_LoopBegin(volume, d) + for (d = 0; d < volume; d++) + { HYPRE_Int i = stencil_size * d; - values[i ] = west; - values[i + 1] = center; - hypre_LoopEnd() + values_h[i] = west; + values_h[i + 1] = center; + } } else if (dim == 2) { - hypre_LoopBegin(volume, d) + for (d = 0; d < volume; d++) + { HYPRE_Int i = stencil_size * d; - values[i ] = west; - values[i + 1] = south; - values[i + 2] = center; - hypre_LoopEnd() + values_h[i] = west; + values_h[i + 1] = south; + values_h[i + 2] = center; + } } else if (dim == 3) { - hypre_LoopBegin(volume, d) + for (d = 0; d < volume; d++) + { HYPRE_Int i = stencil_size * d; - values[i ] = west; - values[i + 1] = south; - values[i + 2] = bottom; - values[i + 3] = center; - hypre_LoopEnd() + values_h[i] = west; + values_h[i + 1] = south; + values_h[i + 2] = bottom; + values_h[i + 3] = center; + } } -#undef DEVICE_VAR + + hypre_TMemcpy(values, values_h, HYPRE_Real, stencil_size * volume, memory_location, + HYPRE_MEMORY_HOST); ilower = hypre_BoxIMin(box); iupper = hypre_BoxIMax(box); @@ -3125,23 +3254,13 @@ AddValuesMatrix(HYPRE_StructMatrix A, HYPRE_StructMatrixSetBoxValues(A, ilower, iupper, stencil_size, stencil_indices, values); -#if 0 //defined(HYPRE_USING_CUDA) - if (data_location != HYPRE_MEMORY_HOST) - { - hypre_TFree(values,HYPRE_MEMORY_DEVICE); - } - else - { - hypre_TFree(values,HYPRE_MEMORY_HOST); - } -#else - hypre_TFree(values,HYPRE_MEMORY_DEVICE); -#endif + hypre_TFree(values, memory_location); + hypre_TFree(values_h, HYPRE_MEMORY_HOST); } } - else if ( constant_coefficient==1 ) + else if ( constant_coefficient == 1 ) { - values = hypre_CTAlloc(HYPRE_Real, stencil_size, HYPRE_MEMORY_HOST); + values = hypre_CTAlloc(HYPRE_Real, stencil_size, HYPRE_MEMORY_HOST); switch (dim) { case 1: @@ -3169,10 +3288,10 @@ AddValuesMatrix(HYPRE_StructMatrix A, } else { - hypre_assert( constant_coefficient==2 ); + hypre_assert( constant_coefficient == 2 ); /* stencil index for the center equals dim, so it's easy to leave out */ - values = hypre_CTAlloc(HYPRE_Real, stencil_size-1, HYPRE_MEMORY_HOST); + values = hypre_CTAlloc(HYPRE_Real, stencil_size - 1, HYPRE_MEMORY_HOST); switch (dim) { case 1: @@ -3190,53 +3309,32 @@ AddValuesMatrix(HYPRE_StructMatrix A, } if (hypre_BoxArraySize(gridboxes) > 0) { - HYPRE_StructMatrixSetConstantValues(A, stencil_size-1, + HYPRE_StructMatrixSetConstantValues(A, stencil_size - 1, stencil_indices, values); } hypre_TFree(values, HYPRE_MEMORY_HOST); - hypre_ForBoxI(bi, gridboxes) { - box = hypre_BoxArrayBox(gridboxes, bi); - volume = hypre_BoxVolume(box); -#if 0 //defined(HYPRE_USING_CUDA) - if (data_location != HYPRE_MEMORY_HOST) - { - values = hypre_CTAlloc(HYPRE_Real, volume,HYPRE_MEMORY_DEVICE); - } - else - { - values = hypre_CTAlloc(HYPRE_Real, volume,HYPRE_MEMORY_HOST); - } -#else - values = hypre_CTAlloc(HYPRE_Real, volume,HYPRE_MEMORY_DEVICE); -#endif + box = hypre_BoxArrayBox(gridboxes, bi); + volume = hypre_BoxVolume(box); + values = hypre_CTAlloc(HYPRE_Real, volume, memory_location); + values_h = hypre_CTAlloc(HYPRE_Real, volume, HYPRE_MEMORY_HOST); + HYPRE_Int i; -#define DEVICE_VAR is_device_ptr(values) - hypre_LoopBegin(volume,i) + for (i = 0; i < volume; i++) { - values[i] = center; + values_h[i] = center; } - hypre_LoopEnd() -#undef DEVICE_VAR + + hypre_TMemcpy(values, values_h, HYPRE_Real, volume, memory_location, HYPRE_MEMORY_HOST); ilower = hypre_BoxIMin(box); iupper = hypre_BoxIMax(box); HYPRE_StructMatrixSetBoxValues(A, ilower, iupper, 1, - stencil_indices+dim, values); -#if 0 //defined(HYPRE_USING_CUDA) - if (data_location == HYPRE_MEMORY_DEVICE) - { - hypre_TFree(values,HYPRE_MEMORY_DEVICE); - } - else - { - hypre_TFree(values,HYPRE_MEMORY_HOST); - } -#else - hypre_TFree(values,HYPRE_MEMORY_DEVICE); -#endif + stencil_indices + dim, values); + hypre_TFree(values, memory_location); + hypre_TFree(values_h, HYPRE_MEMORY_HOST); } } } @@ -3273,79 +3371,59 @@ AddValuesMatrix(HYPRE_StructMatrix A, center -= conz; } - if ( constant_coefficient==0 ) + if ( constant_coefficient == 0 ) { hypre_ForBoxI(bi, gridboxes) { - box = hypre_BoxArrayBox(gridboxes, bi); - volume = hypre_BoxVolume(box); -#if 0 //defined(HYPRE_USING_CUDA) - if (data_location == HYPRE_MEMORY_DEVICE) - { - values = hypre_CTAlloc(HYPRE_Real, stencil_size*volume,HYPRE_MEMORY_DEVICE); - } - else - { - values = hypre_CTAlloc(HYPRE_Real, stencil_size*volume,HYPRE_MEMORY_HOST); - } -#else - values = hypre_CTAlloc(HYPRE_Real, stencil_size*volume,HYPRE_MEMORY_DEVICE); -#endif + box = hypre_BoxArrayBox(gridboxes, bi); + volume = hypre_BoxVolume(box); + values = hypre_CTAlloc(HYPRE_Real, stencil_size * volume, memory_location); + values_h = hypre_CTAlloc(HYPRE_Real, stencil_size * volume, HYPRE_MEMORY_HOST); -#define DEVICE_VAR is_device_ptr(values) - hypre_LoopBegin(volume,d) + for (d = 0; d < volume; d++) { - HYPRE_Int i = stencil_size*d; + HYPRE_Int i = stencil_size * d; switch (dim) { case 1: - values[i ] = west; - values[i+1] = center; - values[i+2] = east; + values_h[i] = west; + values_h[i + 1] = center; + values_h[i + 2] = east; break; case 2: - values[i ] = west; - values[i+1] = south; - values[i+2] = center; - values[i+3] = east; - values[i+4] = north; + values_h[i] = west; + values_h[i + 1] = south; + values_h[i + 2] = center; + values_h[i + 3] = east; + values_h[i + 4] = north; break; case 3: - values[i ] = west; - values[i+1] = south; - values[i+2] = bottom; - values[i+3] = center; - values[i+4] = east; - values[i+5] = north; - values[i+6] = top; + values_h[i] = west; + values_h[i + 1] = south; + values_h[i + 2] = bottom; + values_h[i + 3] = center; + values_h[i + 4] = east; + values_h[i + 5] = north; + values_h[i + 6] = top; break; } } - hypre_LoopEnd() -#undef DEVICE_VAR + + hypre_TMemcpy(values, values_h, HYPRE_Real, stencil_size * volume, memory_location, + HYPRE_MEMORY_HOST); ilower = hypre_BoxIMin(box); iupper = hypre_BoxIMax(box); HYPRE_StructMatrixSetBoxValues(A, ilower, iupper, stencil_size, stencil_indices, values); -#if 0 //defined(HYPRE_USING_CUDA) - if (data_location == HYPRE_MEMORY_DEVICE) - { - hypre_TFree(values,HYPRE_MEMORY_DEVICE); - } - else - { - hypre_TFree(values,HYPRE_MEMORY_HOST); - } -#else - hypre_TFree(values,HYPRE_MEMORY_DEVICE); -#endif + hypre_TFree(values, memory_location); + hypre_TFree(values_h, HYPRE_MEMORY_HOST); } } - else if ( constant_coefficient==1 ) + else if ( constant_coefficient == 1 ) { - values = hypre_CTAlloc( HYPRE_Real, stencil_size , HYPRE_MEMORY_HOST); + values = hypre_CTAlloc( HYPRE_Real, stencil_size, HYPRE_MEMORY_HOST); switch (dim) { @@ -3382,10 +3460,11 @@ AddValuesMatrix(HYPRE_StructMatrix A, } else { - hypre_assert( constant_coefficient==2 ); - values = hypre_CTAlloc( HYPRE_Real, stencil_size-1 , HYPRE_MEMORY_HOST); + hypre_assert( constant_coefficient == 2 ); + values = hypre_CTAlloc( HYPRE_Real, stencil_size - 1, HYPRE_MEMORY_HOST); switch (dim) - { /* no center in stencil_indices and values */ + { + /* no center in stencil_indices and values */ case 1: stencil_indices[0] = 0; stencil_indices[1] = 2; @@ -3430,46 +3509,25 @@ AddValuesMatrix(HYPRE_StructMatrix A, stencil_indices[0] = dim; /* refers to center */ hypre_ForBoxI(bi, gridboxes) { - box = hypre_BoxArrayBox(gridboxes, bi); - volume = hypre_BoxVolume(box); -#if 0 //defined(HYPRE_USING_CUDA) - if (data_location == HYPRE_MEMORY_DEVICE) - { - values = hypre_CTAlloc(HYPRE_Real, volume,HYPRE_MEMORY_DEVICE); - } - else - { - values = hypre_CTAlloc(HYPRE_Real, volume,HYPRE_MEMORY_HOST); - } -#else - values = hypre_CTAlloc(HYPRE_Real, volume,HYPRE_MEMORY_DEVICE); -#endif - + box = hypre_BoxArrayBox(gridboxes, bi); + volume = hypre_BoxVolume(box); + values = hypre_CTAlloc(HYPRE_Real, volume, memory_location); + values_h = hypre_CTAlloc(HYPRE_Real, volume, HYPRE_MEMORY_HOST); + HYPRE_Int i; -#define DEVICE_VAR is_device_ptr(values) - hypre_LoopBegin(volume,i) + for (i = 0; i < volume; i++) { - values[i] = center; + values_h[i] = center; } - hypre_LoopEnd() -#undef DEVICE_VAR + + hypre_TMemcpy(values, values_h, HYPRE_Real, volume, memory_location, HYPRE_MEMORY_HOST); ilower = hypre_BoxIMin(box); iupper = hypre_BoxIMax(box); HYPRE_StructMatrixSetBoxValues(A, ilower, iupper, 1, stencil_indices, values); -#if 0 //defined(HYPRE_USING_CUDA) - if (data_location == HYPRE_MEMORY_DEVICE) - { - hypre_TFree(values,HYPRE_MEMORY_DEVICE); - } - else - { - hypre_TFree(values,HYPRE_MEMORY_HOST); - } -#else - hypre_TFree(values,HYPRE_MEMORY_DEVICE); -#endif + hypre_TFree(values, memory_location); + hypre_TFree(values_h, HYPRE_MEMORY_HOST); } } } @@ -3485,26 +3543,26 @@ AddValuesMatrix(HYPRE_StructMatrix A, *********************************************************************************/ HYPRE_Int -SetStencilBndry(HYPRE_StructMatrix A,HYPRE_StructGrid gridmatrix,HYPRE_Int* period) +SetStencilBndry(HYPRE_StructMatrix A, + HYPRE_StructGrid gridmatrix, + HYPRE_Int *period) { + HYPRE_Int ierr = 0; + hypre_BoxArray *gridboxes; + HYPRE_Int size, i, j, d, ib; + HYPRE_Int **ilower; + HYPRE_Int **iupper; + HYPRE_Int *vol; + HYPRE_Int *istart, *iend; + hypre_Box *box; + hypre_Box *dummybox; + hypre_Box *boundingbox; + HYPRE_Real *values; + HYPRE_Int volume, dim; + HYPRE_Int *stencil_indices; + HYPRE_Int constant_coefficient; + HYPRE_MemoryLocation memory_location = hypre_StructMatrixMemoryLocation(A); - HYPRE_Int ierr=0; - hypre_BoxArray *gridboxes; - HYPRE_Int size,i,j,d,ib; - HYPRE_Int **ilower; - HYPRE_Int **iupper; - HYPRE_Int *vol; - HYPRE_Int *istart, *iend; - hypre_Box *box; - hypre_Box *dummybox; - hypre_Box *boundingbox; - HYPRE_Real *values; - HYPRE_Int volume, dim; - HYPRE_Int *stencil_indices; - HYPRE_Int constant_coefficient; -#if 0 //defined(HYPRE_USING_CUDA) - HYPRE_Int data_location = hypre_StructGridDataLocation(hypre_StructMatrixGrid(A)); -#endif gridboxes = hypre_StructGridBoxes(gridmatrix); boundingbox = hypre_StructGridBoundingBox(gridmatrix); istart = hypre_BoxIMin(boundingbox); @@ -3514,7 +3572,7 @@ SetStencilBndry(HYPRE_StructMatrix A,HYPRE_StructGrid gridmatrix,HYPRE_Int* peri stencil_indices = hypre_CTAlloc(HYPRE_Int, 1, HYPRE_MEMORY_HOST); constant_coefficient = hypre_StructMatrixConstantCoefficient(A); - if ( constant_coefficient>0 ) return 1; + if ( constant_coefficient > 0 ) { return 1; } /*...no space dependence if constant_coefficient==1, and space dependence only for diagonal if constant_coefficient==2 -- and this function only touches off-diagonal entries */ @@ -3536,45 +3594,25 @@ SetStencilBndry(HYPRE_StructMatrix A,HYPRE_StructGrid gridmatrix,HYPRE_Int* peri box = hypre_BoxArrayBox(gridboxes, i); volume = hypre_BoxVolume(box); vol[i] = volume; - hypre_CopyBox(box,dummybox); + hypre_CopyBox(box, dummybox); for (d = 0; d < dim; d++) { - ilower[ib][d] = hypre_BoxIMinD(dummybox,d); - iupper[ib][d] = hypre_BoxIMaxD(dummybox,d); + ilower[ib][d] = hypre_BoxIMinD(dummybox, d); + iupper[ib][d] = hypre_BoxIMaxD(dummybox, d); } ib++ ; hypre_BoxDestroy(dummybox); } - if ( constant_coefficient==0 ) + if ( constant_coefficient == 0 ) { for (d = 0; d < dim; d++) { for (ib = 0; ib < size; ib++) { -#if 0 //defined(HYPRE_USING_CUDA) - if (data_location == HYPRE_MEMORY_DEVICE) - { - values = hypre_CTAlloc(HYPRE_Real, vol[ib],HYPRE_MEMORY_DEVICE); - } - else - { - values = hypre_CTAlloc(HYPRE_Real, vol[ib],HYPRE_MEMORY_HOST); - } -#else - values = hypre_CTAlloc(HYPRE_Real, vol[ib],HYPRE_MEMORY_DEVICE); -#endif + values = hypre_CTAlloc(HYPRE_Real, vol[ib], memory_location); - /* RL: if used CTAlloc, then don't need to set 0.0 */ -#define DEVICE_VAR is_device_ptr(values) - hypre_LoopBegin(vol[ib],i) - { - values[i] = 0.0; - } - hypre_LoopEnd() -#undef DEVICE_VAR - - if( ilower[ib][d] == istart[d] && period[d] == 0 ) + if ( ilower[ib][d] == istart[d] && period[d] == 0 ) { j = iupper[ib][d]; iupper[ib][d] = istart[d]; @@ -3584,7 +3622,7 @@ SetStencilBndry(HYPRE_StructMatrix A,HYPRE_StructGrid gridmatrix,HYPRE_Int* peri iupper[ib][d] = j; } - if( iupper[ib][d] == iend[d] && period[d] == 0 ) + if ( iupper[ib][d] == iend[d] && period[d] == 0 ) { j = ilower[ib][d]; ilower[ib][d] = iend[d]; @@ -3594,25 +3632,14 @@ SetStencilBndry(HYPRE_StructMatrix A,HYPRE_StructGrid gridmatrix,HYPRE_Int* peri ilower[ib][d] = j; } -#if 0 //defined(HYPRE_USING_CUDA) - if (data_location == HYPRE_MEMORY_DEVICE) - { - hypre_TFree(values,HYPRE_MEMORY_DEVICE); - } - else - { - hypre_TFree(values,HYPRE_MEMORY_HOST); - } -#else - hypre_TFree(values,HYPRE_MEMORY_DEVICE); -#endif + hypre_TFree(values, memory_location); } } } hypre_TFree(vol, HYPRE_MEMORY_HOST); hypre_TFree(stencil_indices, HYPRE_MEMORY_HOST); - for (ib =0 ; ib < size ; ib++) + for (ib = 0 ; ib < size ; ib++) { hypre_TFree(ilower[ib], HYPRE_MEMORY_HOST); hypre_TFree(iupper[ib], HYPRE_MEMORY_HOST); @@ -3622,4 +3649,3 @@ SetStencilBndry(HYPRE_StructMatrix A,HYPRE_StructGrid gridmatrix,HYPRE_Int* peri return ierr; } - diff --git a/external/hypre/src/test/struct_migrate.c b/external/hypre/src/test/struct_migrate.c index e26b26f1..66f44c62 100644 --- a/external/hypre/src/test/struct_migrate.c +++ b/external/hypre/src/test/struct_migrate.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -13,7 +13,6 @@ #include "HYPRE_struct_mv.h" /* RDF: This include is only needed for AddValuesVector() */ #include "_hypre_struct_mv.h" -#include "_hypre_struct_mv.hpp" HYPRE_Int AddValuesVector( hypre_StructGrid *grid, hypre_StructVector *vector, @@ -47,7 +46,7 @@ main( hypre_int argc, HYPRE_Int p, q, r; HYPRE_Int dim; - HYPRE_Int nblocks ; + HYPRE_Int nblocks = 0; HYPRE_Int **ilower, **iupper, **iupper2; HYPRE_Int istart[3]; HYPRE_Int i, ix, iy, iz, ib; @@ -66,14 +65,19 @@ main( hypre_int argc, /*----------------------------------------------------------------- * GPU Device binding - * Must be done before HYPRE_Init() and should not be changed after + * Must be done before HYPRE_Initialize() and should not be changed after *-----------------------------------------------------------------*/ - hypre_bind_device(myid, num_procs, hypre_MPI_COMM_WORLD); + hypre_bind_device_id(-1, myid, num_procs, hypre_MPI_COMM_WORLD); /*----------------------------------------------------------- * Initialize : must be the first HYPRE function to call *-----------------------------------------------------------*/ - HYPRE_Init(); + HYPRE_Initialize(); + HYPRE_DeviceInitialize(); + +#if defined(HYPRE_USING_KOKKOS) + Kokkos::initialize (argc, argv); +#endif /*----------------------------------------------------------- * Set defaults @@ -89,6 +93,8 @@ main( hypre_int argc, Q = 1; R = 1; + p = q = r = 1; + bx = 1; by = 1; bz = 1; @@ -181,7 +187,7 @@ main( hypre_int argc, * Check a few things *-----------------------------------------------------------*/ - if ((P*Q*R) > num_procs) + if ((P * Q * R) > num_procs) { if (myid == 0) { @@ -189,7 +195,7 @@ main( hypre_int argc, } exit(1); } - else if ((P*Q*R) < num_procs) + else if ((P * Q * R) < num_procs) { if (myid == 0) { @@ -206,7 +212,7 @@ main( hypre_int argc, hypre_printf("Running with these driver parameters:\n"); hypre_printf(" (nx, ny, nz) = (%d, %d, %d)\n", nx, ny, nz); hypre_printf(" (ix, iy, iz) = (%d, %d, %d)\n", - istart[0],istart[1],istart[2]); + istart[0], istart[1], istart[2]); hypre_printf(" (Px, Py, Pz) = (%d, %d, %d)\n", P, Q, R); hypre_printf(" (bx, by, bz) = (%d, %d, %d)\n", bx, by, bz); hypre_printf(" dim = %d\n", dim); @@ -225,20 +231,20 @@ main( hypre_int argc, break; case 2: - nblocks = bx*by; + nblocks = bx * by; p = myid % P; - q = (( myid - p)/P) % Q; + q = (( myid - p) / P) % Q; break; case 3: - nblocks = bx*by*bz; + nblocks = bx * by * bz; p = myid % P; - q = (( myid - p)/P) % Q; - r = ( myid - p - P*q)/( P*Q ); + q = (( myid - p) / P) % Q; + r = ( myid - p - P * q) / ( P * Q ); break; } - if (myid >= (P*Q*R)) + if (myid >= (P * Q * R)) { /* My processor has no data on it */ nblocks = bx = by = bz = 0; @@ -264,11 +270,13 @@ main( hypre_int argc, case 1: for (ix = 0; ix < bx; ix++) { - ilower[ib][0] = istart[0]+ nx*(bx*p+ix); - iupper[ib][0] = istart[0]+ nx*(bx*p+ix+1) - 1; + ilower[ib][0] = istart[0] + nx * (bx * p + ix); + iupper[ib][0] = istart[0] + nx * (bx * p + ix + 1) - 1; iupper2[ib][0] = iupper[ib][0]; - if ( (ix == (bx-1)) && (p < (P-1)) ) + if ( (ix == (bx - 1)) && (p < (P - 1)) ) + { iupper2[ib][0] = iupper[ib][0] + 1; + } ib++; } break; @@ -276,16 +284,20 @@ main( hypre_int argc, for (iy = 0; iy < by; iy++) for (ix = 0; ix < bx; ix++) { - ilower[ib][0] = istart[0]+ nx*(bx*p+ix); - iupper[ib][0] = istart[0]+ nx*(bx*p+ix+1) - 1; - ilower[ib][1] = istart[1]+ ny*(by*q+iy); - iupper[ib][1] = istart[1]+ ny*(by*q+iy+1) - 1; + ilower[ib][0] = istart[0] + nx * (bx * p + ix); + iupper[ib][0] = istart[0] + nx * (bx * p + ix + 1) - 1; + ilower[ib][1] = istart[1] + ny * (by * q + iy); + iupper[ib][1] = istart[1] + ny * (by * q + iy + 1) - 1; iupper2[ib][0] = iupper[ib][0]; iupper2[ib][1] = iupper[ib][1]; - if ( (ix == (bx-1)) && (p < (P-1)) ) + if ( (ix == (bx - 1)) && (p < (P - 1)) ) + { iupper2[ib][0] = iupper[ib][0] + 1; - if ( (iy == (by-1)) && (q < (Q-1)) ) + } + if ( (iy == (by - 1)) && (q < (Q - 1)) ) + { iupper2[ib][1] = iupper[ib][1] + 1; + } ib++; } break; @@ -294,21 +306,27 @@ main( hypre_int argc, for (iy = 0; iy < by; iy++) for (ix = 0; ix < bx; ix++) { - ilower[ib][0] = istart[0]+ nx*(bx*p+ix); - iupper[ib][0] = istart[0]+ nx*(bx*p+ix+1) - 1; - ilower[ib][1] = istart[1]+ ny*(by*q+iy); - iupper[ib][1] = istart[1]+ ny*(by*q+iy+1) - 1; - ilower[ib][2] = istart[2]+ nz*(bz*r+iz); - iupper[ib][2] = istart[2]+ nz*(bz*r+iz+1) - 1; + ilower[ib][0] = istart[0] + nx * (bx * p + ix); + iupper[ib][0] = istart[0] + nx * (bx * p + ix + 1) - 1; + ilower[ib][1] = istart[1] + ny * (by * q + iy); + iupper[ib][1] = istart[1] + ny * (by * q + iy + 1) - 1; + ilower[ib][2] = istart[2] + nz * (bz * r + iz); + iupper[ib][2] = istart[2] + nz * (bz * r + iz + 1) - 1; iupper2[ib][0] = iupper[ib][0]; iupper2[ib][1] = iupper[ib][1]; iupper2[ib][2] = iupper[ib][2]; - if ( (ix == (bx-1)) && (p < (P-1)) ) + if ( (ix == (bx - 1)) && (p < (P - 1)) ) + { iupper2[ib][0] = iupper[ib][0] + 1; - if ( (iy == (by-1)) && (q < (Q-1)) ) + } + if ( (iy == (by - 1)) && (q < (Q - 1)) ) + { iupper2[ib][1] = iupper[ib][1] + 1; - if ( (iz == (bz-1)) && (r < (R-1)) ) + } + if ( (iz == (bz - 1)) && (r < (R - 1)) ) + { iupper2[ib][2] = iupper[ib][2] + 1; + } ib++; } break; @@ -402,6 +420,10 @@ main( hypre_int argc, HYPRE_StructVectorDestroy(to_vector); HYPRE_StructVectorDestroy(check_vector); +#if defined(HYPRE_USING_KOKKOS) + Kokkos::finalize (); +#endif + /* Finalize Hypre */ HYPRE_Finalize(); @@ -420,38 +442,41 @@ AddValuesVector( hypre_StructGrid *grid, hypre_StructVector *vector, HYPRE_Real value ) { - HYPRE_Int ierr = 0; + HYPRE_Int i, ierr = 0; hypre_BoxArray *gridboxes; HYPRE_Int ib; hypre_IndexRef ilower; hypre_IndexRef iupper; hypre_Box *box; HYPRE_Real *values; + HYPRE_Real *values_h; HYPRE_Int volume; - gridboxes = hypre_StructGridBoxes(grid); + HYPRE_MemoryLocation memory_location = hypre_StructVectorMemoryLocation(vector); + + gridboxes = hypre_StructGridBoxes(grid); - ib=0; + ib = 0; hypre_ForBoxI(ib, gridboxes) { - box = hypre_BoxArrayBox(gridboxes, ib); - volume = hypre_BoxVolume(box); - values = hypre_CTAlloc(HYPRE_Real, volume, HYPRE_MEMORY_DEVICE); + box = hypre_BoxArrayBox(gridboxes, ib); + volume = hypre_BoxVolume(box); + values = hypre_CTAlloc(HYPRE_Real, volume, memory_location); + values_h = hypre_CTAlloc(HYPRE_Real, volume, HYPRE_MEMORY_HOST); -#define DEVICE_VAR is_device_ptr(values) - hypre_LoopBegin(volume,i) + for (i = 0; i < volume; i++) { - values[i] = value; + values_h[i] = value; } - hypre_LoopEnd(); -#undef DEVICE_VAR + + hypre_TMemcpy(values, values_h, HYPRE_Real, volume, memory_location, HYPRE_MEMORY_HOST); ilower = hypre_BoxIMin(box); iupper = hypre_BoxIMax(box); HYPRE_StructVectorSetBoxValues(vector, ilower, iupper, values); - hypre_TFree(values, HYPRE_MEMORY_DEVICE); + hypre_TFree(values, memory_location); + hypre_TFree(values_h, HYPRE_MEMORY_HOST); } return ierr; } - diff --git a/external/hypre/src/test/struct_newboxloop.c b/external/hypre/src/test/struct_newboxloop.c index a88e3a35..3dac60be 100644 --- a/external/hypre/src/test/struct_newboxloop.c +++ b/external/hypre/src/test/struct_newboxloop.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -41,9 +41,9 @@ /* end lobpcg */ -HYPRE_Int SetStencilBndry(HYPRE_StructMatrix A,HYPRE_StructGrid gridmatrix,HYPRE_Int* period); +HYPRE_Int SetStencilBndry(HYPRE_StructMatrix A, HYPRE_StructGrid gridmatrix, HYPRE_Int* period); -HYPRE_Int AddValuesMatrix(HYPRE_StructMatrix A,HYPRE_StructGrid gridmatrix, +HYPRE_Int AddValuesMatrix(HYPRE_StructMatrix A, HYPRE_StructGrid gridmatrix, HYPRE_Real cx, HYPRE_Real cy, HYPRE_Real cz, @@ -125,7 +125,7 @@ main( hypre_int argc, HYPRE_Int i, s; HYPRE_Int ix, iy, iz, ib; - HYPRE_Int periodx0[3] = {0,0,0}; + HYPRE_Int periodx0[3] = {0, 0, 0}; HYPRE_Int sum; HYPRE_Real inner; @@ -219,8 +219,8 @@ main( hypre_int argc, /* ghosts for the building of matrix: default */ for (i = 0; i < dim; i++) { - A_num_ghost[2*i] = 1; - A_num_ghost[2*i + 1] = 1; + A_num_ghost[2 * i] = 1; + A_num_ghost[2 * i + 1] = 1; } /*----------------------------------------------------------- @@ -269,16 +269,16 @@ main( hypre_int argc, else if ( strcmp(argv[arg_index], "-c") == 0 ) { arg_index++; - cx = atof(argv[arg_index++]); - cy = atof(argv[arg_index++]); - cz = atof(argv[arg_index++]); + cx = (HYPRE_Real)atof(argv[arg_index++]); + cy = (HYPRE_Real)atof(argv[arg_index++]); + cz = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-convect") == 0 ) { arg_index++; - conx = atof(argv[arg_index++]); - cony = atof(argv[arg_index++]); - conz = atof(argv[arg_index++]); + conx = (HYPRE_Real)atof(argv[arg_index++]); + cony = (HYPRE_Real)atof(argv[arg_index++]); + conz = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-d") == 0 ) { @@ -295,12 +295,15 @@ main( hypre_int argc, arg_index++; /* begin lobpcg */ - if ( strcmp(argv[arg_index], "none") == 0 ) { + if ( strcmp(argv[arg_index], "none") == 0 ) + { solver_id = NO_SOLVER; arg_index++; } else /* end lobpcg */ + { solver_id = atoi(argv[arg_index++]); + } } else if ( strcmp(argv[arg_index], "-v") == 0 ) { @@ -362,7 +365,9 @@ main( hypre_int argc, /* begin lobpcg */ if ( solver_id == 0 && lobpcgFlag ) + { solver_id = 10; + } /*end lobpcg */ @@ -410,7 +415,7 @@ main( hypre_int argc, * Check a few things *-----------------------------------------------------------*/ - if ((P*Q*R) > num_procs) + if ((P * Q * R) > num_procs) { if (myid == 0) { @@ -418,7 +423,7 @@ main( hypre_int argc, } exit(1); } - else if ((P*Q*R) < num_procs) + else if ((P * Q * R) < num_procs) { if (myid == 0) { @@ -426,7 +431,7 @@ main( hypre_int argc, } } - if ((conx != 0.0 || cony !=0 || conz != 0) && sym == 1 ) + if ((conx != 0.0 || cony != 0 || conz != 0) && sym == 1 ) { if (myid == 0) { @@ -457,7 +462,7 @@ main( hypre_int argc, hypre_printf("Running with these driver parameters:\n"); hypre_printf(" (nx, ny, nz) = (%d, %d, %d)\n", nx, ny, nz); hypre_printf(" (istart[0],istart[1],istart[2]) = (%d, %d, %d)\n", \ - istart[0],istart[1],istart[2]); + istart[0], istart[1], istart[2]); hypre_printf(" (Px, Py, Pz) = (%d, %d, %d)\n", P, Q, R); hypre_printf(" (bx, by, bz) = (%d, %d, %d)\n", bx, by, bz); hypre_printf(" (px, py, pz) = (%d, %d, %d)\n", px, py, pz); @@ -497,131 +502,131 @@ main( hypre_int argc, switch (dim) { - case 1: - nblocks = bx; - if(sym) - { - offsets = hypre_CTAlloc(HYPRE_Int*, 2, HYPRE_MEMORY_HOST); - offsets[0] = hypre_CTAlloc(HYPRE_Int, 1, HYPRE_MEMORY_HOST); - offsets[0][0] = -1; - offsets[1] = hypre_CTAlloc(HYPRE_Int, 1, HYPRE_MEMORY_HOST); - offsets[1][0] = 0; - } - else - { - offsets = hypre_CTAlloc(HYPRE_Int*, 3, HYPRE_MEMORY_HOST); - offsets[0] = hypre_CTAlloc(HYPRE_Int, 1, HYPRE_MEMORY_HOST); - offsets[0][0] = -1; - offsets[1] = hypre_CTAlloc(HYPRE_Int, 1, HYPRE_MEMORY_HOST); - offsets[1][0] = 0; - offsets[2] = hypre_CTAlloc(HYPRE_Int, 1, HYPRE_MEMORY_HOST); - offsets[2][0] = 1; - } - /* compute p from P and myid */ - p = myid % P; - break; + case 1: + nblocks = bx; + if (sym) + { + offsets = hypre_CTAlloc(HYPRE_Int*, 2, HYPRE_MEMORY_HOST); + offsets[0] = hypre_CTAlloc(HYPRE_Int, 1, HYPRE_MEMORY_HOST); + offsets[0][0] = -1; + offsets[1] = hypre_CTAlloc(HYPRE_Int, 1, HYPRE_MEMORY_HOST); + offsets[1][0] = 0; + } + else + { + offsets = hypre_CTAlloc(HYPRE_Int*, 3, HYPRE_MEMORY_HOST); + offsets[0] = hypre_CTAlloc(HYPRE_Int, 1, HYPRE_MEMORY_HOST); + offsets[0][0] = -1; + offsets[1] = hypre_CTAlloc(HYPRE_Int, 1, HYPRE_MEMORY_HOST); + offsets[1][0] = 0; + offsets[2] = hypre_CTAlloc(HYPRE_Int, 1, HYPRE_MEMORY_HOST); + offsets[2][0] = 1; + } + /* compute p from P and myid */ + p = myid % P; + break; - case 2: - nblocks = bx*by; - if(sym) - { - offsets = hypre_CTAlloc(HYPRE_Int*, 3, HYPRE_MEMORY_HOST); - offsets[0] = hypre_CTAlloc(HYPRE_Int, 2, HYPRE_MEMORY_HOST); - offsets[0][0] = -1; - offsets[0][1] = 0; - offsets[1] = hypre_CTAlloc(HYPRE_Int, 2, HYPRE_MEMORY_HOST); - offsets[1][0] = 0; - offsets[1][1] = -1; - offsets[2] = hypre_CTAlloc(HYPRE_Int, 2, HYPRE_MEMORY_HOST); - offsets[2][0] = 0; - offsets[2][1] = 0; - } - else - { - offsets = hypre_CTAlloc(HYPRE_Int*, 5, HYPRE_MEMORY_HOST); - offsets[0] = hypre_CTAlloc(HYPRE_Int, 2, HYPRE_MEMORY_HOST); - offsets[0][0] = -1; - offsets[0][1] = 0; - offsets[1] = hypre_CTAlloc(HYPRE_Int, 2, HYPRE_MEMORY_HOST); - offsets[1][0] = 0; - offsets[1][1] = -1; - offsets[2] = hypre_CTAlloc(HYPRE_Int, 2, HYPRE_MEMORY_HOST); - offsets[2][0] = 0; - offsets[2][1] = 0; - offsets[3] = hypre_CTAlloc(HYPRE_Int, 2, HYPRE_MEMORY_HOST); - offsets[3][0] = 1; - offsets[3][1] = 0; - offsets[4] = hypre_CTAlloc(HYPRE_Int, 2, HYPRE_MEMORY_HOST); - offsets[4][0] = 0; - offsets[4][1] = 1; - } - /* compute p,q from P,Q and myid */ - p = myid % P; - q = (( myid - p)/P) % Q; - break; - - case 3: - nblocks = bx*by*bz; - if(sym) - { - offsets = hypre_CTAlloc(HYPRE_Int*, 4, HYPRE_MEMORY_HOST); - offsets[0] = hypre_CTAlloc(HYPRE_Int, 3, HYPRE_MEMORY_HOST); - offsets[0][0] = -1; - offsets[0][1] = 0; - offsets[0][2] = 0; - offsets[1] = hypre_CTAlloc(HYPRE_Int, 3, HYPRE_MEMORY_HOST); - offsets[1][0] = 0; - offsets[1][1] = -1; - offsets[1][2] = 0; - offsets[2] = hypre_CTAlloc(HYPRE_Int, 3, HYPRE_MEMORY_HOST); - offsets[2][0] = 0; - offsets[2][1] = 0; - offsets[2][2] = -1; - offsets[3] = hypre_CTAlloc(HYPRE_Int, 3, HYPRE_MEMORY_HOST); - offsets[3][0] = 0; - offsets[3][1] = 0; - offsets[3][2] = 0; - } - else - { - offsets = hypre_CTAlloc(HYPRE_Int*, 7, HYPRE_MEMORY_HOST); - offsets[0] = hypre_CTAlloc(HYPRE_Int, 3, HYPRE_MEMORY_HOST); - offsets[0][0] = -1; - offsets[0][1] = 0; - offsets[0][2] = 0; - offsets[1] = hypre_CTAlloc(HYPRE_Int, 3, HYPRE_MEMORY_HOST); - offsets[1][0] = 0; - offsets[1][1] = -1; - offsets[1][2] = 0; - offsets[2] = hypre_CTAlloc(HYPRE_Int, 3, HYPRE_MEMORY_HOST); - offsets[2][0] = 0; - offsets[2][1] = 0; - offsets[2][2] = -1; - offsets[3] = hypre_CTAlloc(HYPRE_Int, 3, HYPRE_MEMORY_HOST); - offsets[3][0] = 0; - offsets[3][1] = 0; - offsets[3][2] = 0; - offsets[4] = hypre_CTAlloc(HYPRE_Int, 3, HYPRE_MEMORY_HOST); - offsets[4][0] = 1; - offsets[4][1] = 0; - offsets[4][2] = 0; - offsets[5] = hypre_CTAlloc(HYPRE_Int, 3, HYPRE_MEMORY_HOST); - offsets[5][0] = 0; - offsets[5][1] = 1; - offsets[5][2] = 0; - offsets[6] = hypre_CTAlloc(HYPRE_Int, 3, HYPRE_MEMORY_HOST); - offsets[6][0] = 0; - offsets[6][1] = 0; - offsets[6][2] = 1; - } - /* compute p,q,r from P,Q,R and myid */ - p = myid % P; - q = (( myid - p)/P) % Q; - r = ( myid - p - P*q)/( P*Q ); - break; + case 2: + nblocks = bx * by; + if (sym) + { + offsets = hypre_CTAlloc(HYPRE_Int*, 3, HYPRE_MEMORY_HOST); + offsets[0] = hypre_CTAlloc(HYPRE_Int, 2, HYPRE_MEMORY_HOST); + offsets[0][0] = -1; + offsets[0][1] = 0; + offsets[1] = hypre_CTAlloc(HYPRE_Int, 2, HYPRE_MEMORY_HOST); + offsets[1][0] = 0; + offsets[1][1] = -1; + offsets[2] = hypre_CTAlloc(HYPRE_Int, 2, HYPRE_MEMORY_HOST); + offsets[2][0] = 0; + offsets[2][1] = 0; + } + else + { + offsets = hypre_CTAlloc(HYPRE_Int*, 5, HYPRE_MEMORY_HOST); + offsets[0] = hypre_CTAlloc(HYPRE_Int, 2, HYPRE_MEMORY_HOST); + offsets[0][0] = -1; + offsets[0][1] = 0; + offsets[1] = hypre_CTAlloc(HYPRE_Int, 2, HYPRE_MEMORY_HOST); + offsets[1][0] = 0; + offsets[1][1] = -1; + offsets[2] = hypre_CTAlloc(HYPRE_Int, 2, HYPRE_MEMORY_HOST); + offsets[2][0] = 0; + offsets[2][1] = 0; + offsets[3] = hypre_CTAlloc(HYPRE_Int, 2, HYPRE_MEMORY_HOST); + offsets[3][0] = 1; + offsets[3][1] = 0; + offsets[4] = hypre_CTAlloc(HYPRE_Int, 2, HYPRE_MEMORY_HOST); + offsets[4][0] = 0; + offsets[4][1] = 1; + } + /* compute p,q from P,Q and myid */ + p = myid % P; + q = (( myid - p) / P) % Q; + break; + + case 3: + nblocks = bx * by * bz; + if (sym) + { + offsets = hypre_CTAlloc(HYPRE_Int*, 4, HYPRE_MEMORY_HOST); + offsets[0] = hypre_CTAlloc(HYPRE_Int, 3, HYPRE_MEMORY_HOST); + offsets[0][0] = -1; + offsets[0][1] = 0; + offsets[0][2] = 0; + offsets[1] = hypre_CTAlloc(HYPRE_Int, 3, HYPRE_MEMORY_HOST); + offsets[1][0] = 0; + offsets[1][1] = -1; + offsets[1][2] = 0; + offsets[2] = hypre_CTAlloc(HYPRE_Int, 3, HYPRE_MEMORY_HOST); + offsets[2][0] = 0; + offsets[2][1] = 0; + offsets[2][2] = -1; + offsets[3] = hypre_CTAlloc(HYPRE_Int, 3, HYPRE_MEMORY_HOST); + offsets[3][0] = 0; + offsets[3][1] = 0; + offsets[3][2] = 0; + } + else + { + offsets = hypre_CTAlloc(HYPRE_Int*, 7, HYPRE_MEMORY_HOST); + offsets[0] = hypre_CTAlloc(HYPRE_Int, 3, HYPRE_MEMORY_HOST); + offsets[0][0] = -1; + offsets[0][1] = 0; + offsets[0][2] = 0; + offsets[1] = hypre_CTAlloc(HYPRE_Int, 3, HYPRE_MEMORY_HOST); + offsets[1][0] = 0; + offsets[1][1] = -1; + offsets[1][2] = 0; + offsets[2] = hypre_CTAlloc(HYPRE_Int, 3, HYPRE_MEMORY_HOST); + offsets[2][0] = 0; + offsets[2][1] = 0; + offsets[2][2] = -1; + offsets[3] = hypre_CTAlloc(HYPRE_Int, 3, HYPRE_MEMORY_HOST); + offsets[3][0] = 0; + offsets[3][1] = 0; + offsets[3][2] = 0; + offsets[4] = hypre_CTAlloc(HYPRE_Int, 3, HYPRE_MEMORY_HOST); + offsets[4][0] = 1; + offsets[4][1] = 0; + offsets[4][2] = 0; + offsets[5] = hypre_CTAlloc(HYPRE_Int, 3, HYPRE_MEMORY_HOST); + offsets[5][0] = 0; + offsets[5][1] = 1; + offsets[5][2] = 0; + offsets[6] = hypre_CTAlloc(HYPRE_Int, 3, HYPRE_MEMORY_HOST); + offsets[6][0] = 0; + offsets[6][1] = 0; + offsets[6][2] = 1; + } + /* compute p,q,r from P,Q,R and myid */ + p = myid % P; + q = (( myid - p) / P) % Q; + r = ( myid - p - P * q) / ( P * Q ); + break; } - if (myid >= (P*Q*R)) + if (myid >= (P * Q * R)) { /* My processor has no data on it */ nblocks = bx = by = bz = 0; @@ -632,8 +637,8 @@ main( hypre_int argc, * which is always the case for read_fromfile_param == 0 *-----------------------------------------------------------*/ - HYPRE_StructStencilCreate(dim, (2-sym)*dim + 1, &stencil); - for (s = 0; s < (2-sym)*dim + 1; s++) + HYPRE_StructStencilCreate(dim, (2 - sym)*dim + 1, &stencil); + for (s = 0; s < (2 - sym)*dim + 1; s++) { HYPRE_StructStencilSetElement(stencil, s, offsets[s]); } @@ -672,8 +677,8 @@ main( hypre_int argc, case 1: for (ix = 0; ix < bx; ix++) { - ilower[ib][0] = istart[0]+ nx*(bx*p+ix); - iupper[ib][0] = istart[0]+ nx*(bx*p+ix+1) - 1; + ilower[ib][0] = istart[0] + nx * (bx * p + ix); + iupper[ib][0] = istart[0] + nx * (bx * p + ix + 1) - 1; ib++; } break; @@ -681,10 +686,10 @@ main( hypre_int argc, for (iy = 0; iy < by; iy++) for (ix = 0; ix < bx; ix++) { - ilower[ib][0] = istart[0]+ nx*(bx*p+ix); - iupper[ib][0] = istart[0]+ nx*(bx*p+ix+1) - 1; - ilower[ib][1] = istart[1]+ ny*(by*q+iy); - iupper[ib][1] = istart[1]+ ny*(by*q+iy+1) - 1; + ilower[ib][0] = istart[0] + nx * (bx * p + ix); + iupper[ib][0] = istart[0] + nx * (bx * p + ix + 1) - 1; + ilower[ib][1] = istart[1] + ny * (by * q + iy); + iupper[ib][1] = istart[1] + ny * (by * q + iy + 1) - 1; ib++; } break; @@ -693,12 +698,12 @@ main( hypre_int argc, for (iy = 0; iy < by; iy++) for (ix = 0; ix < bx; ix++) { - ilower[ib][0] = istart[0]+ nx*(bx*p+ix); - iupper[ib][0] = istart[0]+ nx*(bx*p+ix+1) - 1; - ilower[ib][1] = istart[1]+ ny*(by*q+iy); - iupper[ib][1] = istart[1]+ ny*(by*q+iy+1) - 1; - ilower[ib][2] = istart[2]+ nz*(bz*r+iz); - iupper[ib][2] = istart[2]+ nz*(bz*r+iz+1) - 1; + ilower[ib][0] = istart[0] + nx * (bx * p + ix); + iupper[ib][0] = istart[0] + nx * (bx * p + ix + 1) - 1; + ilower[ib][1] = istart[1] + ny * (by * q + iy); + iupper[ib][1] = istart[1] + ny * (by * q + iy + 1) - 1; + ilower[ib][2] = istart[2] + nz * (bz * r + iz); + iupper[ib][2] = istart[2] + nz * (bz * r + iz + 1) - 1; ib++; } break; @@ -719,41 +724,41 @@ main( hypre_int argc, for (i = 0; i < dim; i++) { - A_num_ghost[2*i] = 1; - A_num_ghost[2*i + 1] = 1; + A_num_ghost[2 * i] = 1; + A_num_ghost[2 * i + 1] = 1; } HYPRE_StructMatrixCreate(hypre_MPI_COMM_WORLD, grid, stencil, &A); if ( solver_id == 3 || solver_id == 4 || - solver_id == 13 || solver_id == 14 ) + solver_id == 13 || solver_id == 14 ) { stencil_size = hypre_StructStencilSize(stencil); stencil_entries = hypre_CTAlloc(HYPRE_Int, stencil_size, HYPRE_MEMORY_HOST); if ( solver_id == 3 || solver_id == 13) { - for ( i=0; i=1 ); - if ( diag_rank==0 ) stencil_entries[diag_rank]=1; - else stencil_entries[diag_rank]=0; - for ( i=0; i= 1 ); + if ( diag_rank == 0 ) { stencil_entries[diag_rank] = 1; } + else { stencil_entries[diag_rank] = 0; } + for ( i = 0; i < stencil_size; ++i ) + { + if ( i != diag_rank ) { stencil_entries[i] = i; } + } + hypre_StructMatrixSetConstantEntries( + A, stencil_size, stencil_entries ); + hypre_TFree( stencil_entries, HYPRE_MEMORY_HOST); + constant_coefficient = 2; } } HYPRE_StructMatrixSetSymmetric(A, sym); @@ -775,12 +780,12 @@ main( hypre_int argc, * Fill in the matrix elements *-----------------------------------------------------------*/ - AddValuesMatrix(A,grid,cx,cy,cz,conx,cony,conz); + AddValuesMatrix(A, grid, cx, cy, cz, conx, cony, conz); /* Zero out stencils reaching to real boundary */ /* But in constant coefficient case, no special stencils! */ - if ( constant_coefficient == 0 ) SetStencilBndry(A,grid,periodic); + if ( constant_coefficient == 0 ) { SetStencilBndry(A, grid, periodic); } HYPRE_StructMatrixAssemble(A); /*----------------------------------------------------------- @@ -796,13 +801,13 @@ main( hypre_int argc, * sink of equal strength. All other problems have rhs = 1. *-----------------------------------------------------------*/ - AddValuesVector(grid,b,periodic,1.0); + AddValuesVector(grid, b, periodic, 1.0); HYPRE_StructVectorAssemble(b); HYPRE_StructVectorCreate(hypre_MPI_COMM_WORLD, grid, &x); HYPRE_StructVectorInitialize(x); - AddValuesVector(grid,x,periodx0,1.0); + AddValuesVector(grid, x, periodx0, 1.0); HYPRE_StructVectorAssemble(x); HYPRE_StructGridDestroy(grid); @@ -837,12 +842,12 @@ main( hypre_int argc, if (solver_id == 0) { - //timeval tstart,tstop; + //timeval tstart,tstop; time_index = hypre_InitializeTiming("axpy"); hypre_BeginTiming(time_index); //gettimeofday(&tstart,NULL); - for ( rep=0; rep 1) center += 2.0*cy; - if (dim > 2) center += 2.0*cz; + center = 2.0 * cx; + if (dim > 1) { center += 2.0 * cy; } + if (dim > 2) { center += 2.0 * cz; } stencil_size = 1 + (2 - sym) * dim; stencil_indices = hypre_CTAlloc(HYPRE_Int, stencil_size, HYPRE_MEMORY_HOST); @@ -1180,9 +1187,9 @@ AddValuesMatrix(HYPRE_StructMatrix A,HYPRE_StructGrid gridmatrix, stencil_indices[s] = s; } - if(sym) + if (sym) { - if ( constant_coefficient==0 ) + if ( constant_coefficient == 0 ) { hypre_ForBoxI(bi, gridboxes) { @@ -1191,34 +1198,34 @@ AddValuesMatrix(HYPRE_StructMatrix A,HYPRE_StructGrid gridmatrix, #if 0 //defined(HYPRE_USING_CUDA) if (data_location != HYPRE_MEMORY_HOST) { - values = hypre_CTAlloc(HYPRE_Real, stencil_size*volume,HYPRE_MEMORY_DEVICE); + values = hypre_CTAlloc(HYPRE_Real, stencil_size * volume, HYPRE_MEMORY_DEVICE); } else { - values = hypre_CTAlloc(HYPRE_Real, stencil_size*volume,HYPRE_MEMORY_HOST); + values = hypre_CTAlloc(HYPRE_Real, stencil_size * volume, HYPRE_MEMORY_HOST); } #else - values = hypre_CTAlloc(HYPRE_Real, stencil_size*volume,HYPRE_MEMORY_DEVICE); + values = hypre_CTAlloc(HYPRE_Real, stencil_size * volume, HYPRE_MEMORY_DEVICE); #endif - hypre_LoopBegin(volume,d) + hypre_LoopBegin(volume, d) { - HYPRE_Int i = stencil_size*d; + HYPRE_Int i = stencil_size * d; switch (dim) { case 1: values[i ] = west; - values[i+1] = center; + values[i + 1] = center; break; case 2: values[i ] = west; - values[i+1] = south; - values[i+2] = center; + values[i + 1] = south; + values[i + 2] = center; break; case 3: values[i ] = west; - values[i+1] = south; - values[i+2] = bottom; - values[i+3] = center; + values[i + 1] = south; + values[i + 2] = bottom; + values[i + 3] = center; break; } } @@ -1231,18 +1238,18 @@ AddValuesMatrix(HYPRE_StructMatrix A,HYPRE_StructGrid gridmatrix, #if 0 //defined(HYPRE_USING_CUDA) if (data_location != HYPRE_MEMORY_HOST) { - hypre_TFree(values,HYPRE_MEMORY_DEVICE); + hypre_TFree(values, HYPRE_MEMORY_DEVICE); } else { - hypre_TFree(values,HYPRE_MEMORY_HOST); + hypre_TFree(values, HYPRE_MEMORY_HOST); } #else - hypre_TFree(values,HYPRE_MEMORY_DEVICE); + hypre_TFree(values, HYPRE_MEMORY_DEVICE); #endif } } - else if ( constant_coefficient==1 ) + else if ( constant_coefficient == 1 ) { values = hypre_CTAlloc(HYPRE_Real, stencil_size, HYPRE_MEMORY_HOST); switch (dim) @@ -1272,10 +1279,10 @@ AddValuesMatrix(HYPRE_StructMatrix A,HYPRE_StructGrid gridmatrix, } else { - hypre_assert( constant_coefficient==2 ); + hypre_assert( constant_coefficient == 2 ); /* stencil index for the center equals dim, so it's easy to leave out */ - values = hypre_CTAlloc(HYPRE_Real, stencil_size-1, HYPRE_MEMORY_HOST); + values = hypre_CTAlloc(HYPRE_Real, stencil_size - 1, HYPRE_MEMORY_HOST); switch (dim) { case 1: @@ -1293,7 +1300,7 @@ AddValuesMatrix(HYPRE_StructMatrix A,HYPRE_StructGrid gridmatrix, } if (hypre_BoxArraySize(gridboxes) > 0) { - HYPRE_StructMatrixSetConstantValues(A, stencil_size-1, + HYPRE_StructMatrixSetConstantValues(A, stencil_size - 1, stencil_indices, values); } hypre_TFree(values, HYPRE_MEMORY_HOST); @@ -1305,16 +1312,16 @@ AddValuesMatrix(HYPRE_StructMatrix A,HYPRE_StructGrid gridmatrix, #if 0 //defined(HYPRE_USING_CUDA) if (data_location != HYPRE_MEMORY_HOST) { - values = hypre_CTAlloc(HYPRE_Real, volume,HYPRE_MEMORY_DEVICE); + values = hypre_CTAlloc(HYPRE_Real, volume, HYPRE_MEMORY_DEVICE); } else { - values = hypre_CTAlloc(HYPRE_Real, volume,HYPRE_MEMORY_HOST); + values = hypre_CTAlloc(HYPRE_Real, volume, HYPRE_MEMORY_HOST); } #else - values = hypre_CTAlloc(HYPRE_Real, volume,HYPRE_MEMORY_DEVICE); + values = hypre_CTAlloc(HYPRE_Real, volume, HYPRE_MEMORY_DEVICE); #endif - hypre_LoopBegin(volume,i) + hypre_LoopBegin(volume, i) { values[i] = center; } @@ -1323,18 +1330,18 @@ AddValuesMatrix(HYPRE_StructMatrix A,HYPRE_StructGrid gridmatrix, ilower = hypre_BoxIMin(box); iupper = hypre_BoxIMax(box); HYPRE_StructMatrixSetBoxValues(A, ilower, iupper, 1, - stencil_indices+dim, values); + stencil_indices + dim, values); #if 0 //defined(HYPRE_USING_CUDA) if (data_location == HYPRE_MEMORY_DEVICE) { - hypre_TFree(values,HYPRE_MEMORY_DEVICE); + hypre_TFree(values, HYPRE_MEMORY_DEVICE); } else { - hypre_TFree(values,HYPRE_MEMORY_HOST); + hypre_TFree(values, HYPRE_MEMORY_HOST); } #else - hypre_TFree(values,HYPRE_MEMORY_DEVICE); + hypre_TFree(values, HYPRE_MEMORY_DEVICE); #endif } } @@ -1372,7 +1379,7 @@ AddValuesMatrix(HYPRE_StructMatrix A,HYPRE_StructGrid gridmatrix, center -= conz; } - if ( constant_coefficient==0 ) + if ( constant_coefficient == 0 ) { hypre_ForBoxI(bi, gridboxes) { @@ -1381,40 +1388,40 @@ AddValuesMatrix(HYPRE_StructMatrix A,HYPRE_StructGrid gridmatrix, #if 0 //defined(HYPRE_USING_CUDA) if (data_location < 1) { - values = hypre_CTAlloc(HYPRE_Real, stencil_size*volume,HYPRE_MEMORY_DEVICE); + values = hypre_CTAlloc(HYPRE_Real, stencil_size * volume, HYPRE_MEMORY_DEVICE); } else { - values = hypre_CTAlloc(HYPRE_Real, stencil_size*volume,HYPRE_MEMORY_HOST); + values = hypre_CTAlloc(HYPRE_Real, stencil_size * volume, HYPRE_MEMORY_HOST); } #else - values = hypre_CTAlloc(HYPRE_Real, stencil_size*volume,HYPRE_MEMORY_DEVICE); + values = hypre_CTAlloc(HYPRE_Real, stencil_size * volume, HYPRE_MEMORY_DEVICE); #endif - hypre_LoopBegin(volume,d) + hypre_LoopBegin(volume, d) { - HYPRE_Int i = stencil_size*d; + HYPRE_Int i = stencil_size * d; switch (dim) { case 1: values[i ] = west; - values[i+1] = center; - values[i+2] = east; + values[i + 1] = center; + values[i + 2] = east; break; case 2: values[i ] = west; - values[i+1] = south; - values[i+2] = center; - values[i+3] = east; - values[i+4] = north; + values[i + 1] = south; + values[i + 2] = center; + values[i + 3] = east; + values[i + 4] = north; break; case 3: values[i ] = west; - values[i+1] = south; - values[i+2] = bottom; - values[i+3] = center; - values[i+4] = east; - values[i+5] = north; - values[i+6] = top; + values[i + 1] = south; + values[i + 2] = bottom; + values[i + 3] = center; + values[i + 4] = east; + values[i + 5] = north; + values[i + 6] = top; break; } } @@ -1428,20 +1435,20 @@ AddValuesMatrix(HYPRE_StructMatrix A,HYPRE_StructGrid gridmatrix, #if 0 //defined(HYPRE_USING_CUDA) if (data_location < 1) { - hypre_TFree(values,HYPRE_MEMORY_DEVICE); + hypre_TFree(values, HYPRE_MEMORY_DEVICE); } else { - hypre_TFree(values,HYPRE_MEMORY_HOST); + hypre_TFree(values, HYPRE_MEMORY_HOST); } #else - hypre_TFree(values,HYPRE_MEMORY_DEVICE); + hypre_TFree(values, HYPRE_MEMORY_DEVICE); #endif } } - else if ( constant_coefficient==1 ) + else if ( constant_coefficient == 1 ) { - values = hypre_CTAlloc( HYPRE_Real, stencil_size , HYPRE_MEMORY_HOST); + values = hypre_CTAlloc( HYPRE_Real, stencil_size, HYPRE_MEMORY_HOST); switch (dim) { @@ -1478,10 +1485,11 @@ AddValuesMatrix(HYPRE_StructMatrix A,HYPRE_StructGrid gridmatrix, } else { - hypre_assert( constant_coefficient==2 ); - values = hypre_CTAlloc( HYPRE_Real, stencil_size-1 , HYPRE_MEMORY_HOST); + hypre_assert( constant_coefficient == 2 ); + values = hypre_CTAlloc( HYPRE_Real, stencil_size - 1, HYPRE_MEMORY_HOST); switch (dim) - { /* no center in stencil_indices and values */ + { + /* no center in stencil_indices and values */ case 1: stencil_indices[0] = 0; stencil_indices[1] = 2; @@ -1531,16 +1539,16 @@ AddValuesMatrix(HYPRE_StructMatrix A,HYPRE_StructGrid gridmatrix, #if 0 //defined(HYPRE_USING_CUDA) if (data_location < 1) { - values = hypre_CTAlloc(HYPRE_Real, volume,HYPRE_MEMORY_DEVICE); + values = hypre_CTAlloc(HYPRE_Real, volume, HYPRE_MEMORY_DEVICE); } else { - values = hypre_CTAlloc(HYPRE_Real, volume,HYPRE_MEMORY_HOST); + values = hypre_CTAlloc(HYPRE_Real, volume, HYPRE_MEMORY_HOST); } #else - values = hypre_CTAlloc(HYPRE_Real, volume,HYPRE_MEMORY_DEVICE); + values = hypre_CTAlloc(HYPRE_Real, volume, HYPRE_MEMORY_DEVICE); #endif - hypre_LoopBegin(volume,i) + hypre_LoopBegin(volume, i) { values[i] = center; } @@ -1553,14 +1561,14 @@ AddValuesMatrix(HYPRE_StructMatrix A,HYPRE_StructGrid gridmatrix, #if 0 //defined(HYPRE_USING_CUDA) if (data_location < 1) { - hypre_TFree(values,HYPRE_MEMORY_DEVICE); + hypre_TFree(values, HYPRE_MEMORY_DEVICE); } else { - hypre_TFree(values,HYPRE_MEMORY_HOST); + hypre_TFree(values, HYPRE_MEMORY_HOST); } #else - hypre_TFree(values,HYPRE_MEMORY_DEVICE); + hypre_TFree(values, HYPRE_MEMORY_DEVICE); #endif } } @@ -1577,12 +1585,12 @@ AddValuesMatrix(HYPRE_StructMatrix A,HYPRE_StructGrid gridmatrix, *********************************************************************************/ HYPRE_Int -SetStencilBndry(HYPRE_StructMatrix A,HYPRE_StructGrid gridmatrix,HYPRE_Int* period) +SetStencilBndry(HYPRE_StructMatrix A, HYPRE_StructGrid gridmatrix, HYPRE_Int* period) { - HYPRE_Int ierr=0; + HYPRE_Int ierr = 0; hypre_BoxArray *gridboxes; - HYPRE_Int size,i,j,d,ib; + HYPRE_Int size, i, j, d, ib; HYPRE_Int **ilower; HYPRE_Int **iupper; HYPRE_Int *vol; @@ -1606,7 +1614,7 @@ SetStencilBndry(HYPRE_StructMatrix A,HYPRE_StructGrid gridmatrix,HYPRE_Int* peri stencil_indices = hypre_CTAlloc(HYPRE_Int, 1, HYPRE_MEMORY_HOST); constant_coefficient = hypre_StructMatrixConstantCoefficient(A); - if ( constant_coefficient>0 ) return 1; + if ( constant_coefficient > 0 ) { return 1; } /*...no space dependence if constant_coefficient==1, and space dependence only for diagonal if constant_coefficient==2 -- and this function only touches off-diagonal entries */ @@ -1628,17 +1636,17 @@ SetStencilBndry(HYPRE_StructMatrix A,HYPRE_StructGrid gridmatrix,HYPRE_Int* peri box = hypre_BoxArrayBox(gridboxes, i); volume = hypre_BoxVolume(box); vol[i] = volume; - hypre_CopyBox(box,dummybox); + hypre_CopyBox(box, dummybox); for (d = 0; d < dim; d++) { - ilower[ib][d] = hypre_BoxIMinD(dummybox,d); - iupper[ib][d] = hypre_BoxIMaxD(dummybox,d); + ilower[ib][d] = hypre_BoxIMinD(dummybox, d); + iupper[ib][d] = hypre_BoxIMaxD(dummybox, d); } ib++ ; hypre_BoxDestroy(dummybox); } - if ( constant_coefficient==0 ) + if ( constant_coefficient == 0 ) { for (d = 0; d < dim; d++) { @@ -1647,22 +1655,22 @@ SetStencilBndry(HYPRE_StructMatrix A,HYPRE_StructGrid gridmatrix,HYPRE_Int* peri #if 0 //defined(HYPRE_USING_CUDA) if (data_location < 1) { - values = hypre_CTAlloc(HYPRE_Real, vol[ib],HYPRE_MEMORY_DEVICE); + values = hypre_CTAlloc(HYPRE_Real, vol[ib], HYPRE_MEMORY_DEVICE); } else { - values = hypre_CTAlloc(HYPRE_Real, vol[ib],HYPRE_MEMORY_HOST); + values = hypre_CTAlloc(HYPRE_Real, vol[ib], HYPRE_MEMORY_HOST); } #else - values = hypre_CTAlloc(HYPRE_Real, vol[ib],HYPRE_MEMORY_DEVICE); + values = hypre_CTAlloc(HYPRE_Real, vol[ib], HYPRE_MEMORY_DEVICE); #endif - hypre_LoopBegin(vol[ib],i) + hypre_LoopBegin(vol[ib], i) { values[i] = 0.0; } hypre_LoopEnd() - if( ilower[ib][d] == istart[d] && period[d] == 0 ) + if ( ilower[ib][d] == istart[d] && period[d] == 0 ) { j = iupper[ib][d]; iupper[ib][d] = istart[d]; @@ -1672,7 +1680,7 @@ SetStencilBndry(HYPRE_StructMatrix A,HYPRE_StructGrid gridmatrix,HYPRE_Int* peri iupper[ib][d] = j; } - if( iupper[ib][d] == iend[d] && period[d] == 0 ) + if ( iupper[ib][d] == iend[d] && period[d] == 0 ) { j = ilower[ib][d]; ilower[ib][d] = iend[d]; @@ -1684,14 +1692,14 @@ SetStencilBndry(HYPRE_StructMatrix A,HYPRE_StructGrid gridmatrix,HYPRE_Int* peri #if 0 //defined(HYPRE_USING_CUDA) if (data_location < 1) { - hypre_TFree(values,HYPRE_MEMORY_DEVICE); + hypre_TFree(values, HYPRE_MEMORY_DEVICE); } else { - hypre_TFree(values,HYPRE_MEMORY_HOST); + hypre_TFree(values, HYPRE_MEMORY_HOST); } #else - hypre_TFree(values,HYPRE_MEMORY_DEVICE); + hypre_TFree(values, HYPRE_MEMORY_DEVICE); #endif } } @@ -1699,7 +1707,7 @@ SetStencilBndry(HYPRE_StructMatrix A,HYPRE_StructGrid gridmatrix,HYPRE_Int* peri hypre_TFree(vol, HYPRE_MEMORY_HOST); hypre_TFree(stencil_indices, HYPRE_MEMORY_HOST); - for (ib =0 ; ib < size ; ib++) + for (ib = 0 ; ib < size ; ib++) { hypre_TFree(ilower[ib], HYPRE_MEMORY_HOST); hypre_TFree(iupper[ib], HYPRE_MEMORY_HOST); diff --git a/external/hypre/src/test/test_ij.c b/external/hypre/src/test/test_ij.c index 4ee3487d..fb94b12e 100644 --- a/external/hypre/src/test/test_ij.c +++ b/external/hypre/src/test/test_ij.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -41,15 +41,24 @@ BuildParIsoLaplacian( HYPRE_Int argc, char** argv, HYPRE_ParCSRMatrix *A_ptr ); /* end lobpcg */ -HYPRE_Int BuildParFromFile (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildParLaplacian (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildParDifConv (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildParFromOneFile2(HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_Int num_functions , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildFuncsFromFiles (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix A , HYPRE_Int **dof_func_ptr ); -HYPRE_Int BuildFuncsFromOneFile (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix A , HYPRE_Int **dof_func_ptr ); -HYPRE_Int BuildRhsParFromOneFile2(HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_Int *partitioning , HYPRE_ParVector *b_ptr ); -HYPRE_Int BuildParLaplacian9pt (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); -HYPRE_Int BuildParLaplacian27pt (HYPRE_Int argc , char *argv [], HYPRE_Int arg_index , HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildParFromFile (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildParLaplacian (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildParDifConv (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildParFromOneFile2(HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_Int num_functions, HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildFuncsFromFiles (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix A, HYPRE_Int **dof_func_ptr ); +HYPRE_Int BuildFuncsFromOneFile (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix A, HYPRE_Int **dof_func_ptr ); +HYPRE_Int BuildRhsParFromOneFile2(HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_Int *partitioning, HYPRE_ParVector *b_ptr ); +HYPRE_Int BuildParLaplacian9pt (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr ); +HYPRE_Int BuildParLaplacian27pt (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_ptr ); #define SECOND_TIME 0 @@ -76,7 +85,7 @@ main( HYPRE_Int argc, HYPRE_Int poutdat; HYPRE_Int debug_flag; HYPRE_Int ierr = 0; - HYPRE_Int i,j,k; + HYPRE_Int i, j, k; HYPRE_Int indx, rest, tms; HYPRE_Int max_levels = 25; HYPRE_Int num_iterations; @@ -283,17 +292,17 @@ main( HYPRE_Int argc, { arg_index++; if ( strcmp(argv[arg_index], "parcsr") == 0 ) - { - matrix_id = HYPRE_PARCSR; - } + { + matrix_id = HYPRE_PARCSR; + } else if ( strcmp(argv[arg_index], "sstruct") == 0 ) - { - matrix_id = HYPRE_SSTRUCT; - } + { + matrix_id = HYPRE_SSTRUCT; + } else if ( strcmp(argv[arg_index], "struct") == 0 ) - { - matrix_id = HYPRE_STRUCT; - }; + { + matrix_id = HYPRE_STRUCT; + }; arg_index++; } else if ( strcmp(argv[arg_index], "-solver") == 0 ) @@ -302,90 +311,90 @@ main( HYPRE_Int argc, /* begin lobpcg */ if ( strcmp(argv[arg_index], "none") == 0 ) - { - solver_id = NO_SOLVER; - } /* end lobpcg */ + { + solver_id = NO_SOLVER; + } /* end lobpcg */ else if ( strcmp(argv[arg_index], "boomeramg") == 0 || strcmp(argv[arg_index], "amg") == 0 ) - { - solver_id = HYPRE_BOOMERAMG; - } + { + solver_id = HYPRE_BOOMERAMG; + } else if ( strcmp(argv[arg_index], "bicgstab") == 0 ) - { - solver_id = HYPRE_BICGSTAB; - } + { + solver_id = HYPRE_BICGSTAB; + } else if ( strcmp(argv[arg_index], "cgnr") == 0 ) - { - solver_id = HYPRE_CGNR; - } + { + solver_id = HYPRE_CGNR; + } else if ( strcmp(argv[arg_index], "diagscale") == 0 ) - { - solver_id = HYPRE_DIAGSCALE; - } + { + solver_id = HYPRE_DIAGSCALE; + } else if ( strcmp(argv[arg_index], "euclid") == 0 ) - { - solver_id = HYPRE_EUCLID; - } + { + solver_id = HYPRE_EUCLID; + } else if ( strcmp(argv[arg_index], "gmres") == 0 ) - { - solver_id = HYPRE_GMRES; - } + { + solver_id = HYPRE_GMRES; + } else if ( strcmp(argv[arg_index], "gsmg") == 0 ) - { - solver_id = HYPRE_GSMG; - } + { + solver_id = HYPRE_GSMG; + } else if ( strcmp(argv[arg_index], "hybrid") == 0 ) - { - solver_id = HYPRE_HYBRID; - } + { + solver_id = HYPRE_HYBRID; + } else if ( strcmp(argv[arg_index], "jacobi") == 0 ) - { - solver_id = HYPRE_JACOBI; - } + { + solver_id = HYPRE_JACOBI; + } else if ( strcmp(argv[arg_index], "parasails") == 0 ) - { - solver_id = HYPRE_PARASAILS; - } + { + solver_id = HYPRE_PARASAILS; + } else if ( strcmp(argv[arg_index], "pcg") == 0 ) - { - solver_id = HYPRE_PCG; - } + { + solver_id = HYPRE_PCG; + } else if ( strcmp(argv[arg_index], "pfmg") == 0 ) - { - solver_id = HYPRE_PFMG; - } + { + solver_id = HYPRE_PFMG; + } else if ( strcmp(argv[arg_index], "pilut") == 0 ) - { - solver_id = HYPRE_PILUT; - } + { + solver_id = HYPRE_PILUT; + } else if ( strcmp(argv[arg_index], "schwarz") == 0 ) - { - solver_id = HYPRE_SCHWARZ; - } + { + solver_id = HYPRE_SCHWARZ; + } else if ( strcmp(argv[arg_index], "smg") == 0 ) - { - solver_id = HYPRE_SMG; - } + { + solver_id = HYPRE_SMG; + } else if ( strcmp(argv[arg_index], "sparsemsg") == 0 ) - { - solver_id = HYPRE_SPARSEMSG; - } + { + solver_id = HYPRE_SPARSEMSG; + } else if ( strcmp(argv[arg_index], "split") == 0 ) - { - solver_id = HYPRE_SPLIT; - } + { + solver_id = HYPRE_SPLIT; + } else if ( strcmp(argv[arg_index], "splitpfmg") == 0 ) - { - solver_id = HYPRE_SPLITPFMG; - } + { + solver_id = HYPRE_SPLITPFMG; + } else if ( strcmp(argv[arg_index], "splitsmg") == 0 ) - { - solver_id = HYPRE_SPLITSMG; - } + { + solver_id = HYPRE_SPLITSMG; + } else if ( strcmp(argv[arg_index], "syspfmg") == 0 ) - { - solver_id = HYPRE_SYSPFMG; - }; + { + solver_id = HYPRE_SYSPFMG; + }; arg_index++; } else if ( strcmp(argv[arg_index], "-precond") == 0 ) @@ -394,90 +403,90 @@ main( HYPRE_Int argc, /* begin lobpcg */ if ( strcmp(argv[arg_index], "none") == 0 ) - { - precond_id = NO_SOLVER; - } /* end lobpcg */ + { + precond_id = NO_SOLVER; + } /* end lobpcg */ else if ( strcmp(argv[arg_index], "boomeramg") == 0 || strcmp(argv[arg_index], "amg") == 0 ) - { - precond_id = HYPRE_BOOMERAMG; - } + { + precond_id = HYPRE_BOOMERAMG; + } else if ( strcmp(argv[arg_index], "bicgstab") == 0 ) - { - precond_id = HYPRE_BICGSTAB; - } + { + precond_id = HYPRE_BICGSTAB; + } else if ( strcmp(argv[arg_index], "cgnr") == 0 ) - { - precond_id = HYPRE_CGNR; - } + { + precond_id = HYPRE_CGNR; + } else if ( strcmp(argv[arg_index], "diagscale") == 0 ) - { - precond_id = HYPRE_DIAGSCALE; - } + { + precond_id = HYPRE_DIAGSCALE; + } else if ( strcmp(argv[arg_index], "euclid") == 0 ) - { - precond_id = HYPRE_EUCLID; - } + { + precond_id = HYPRE_EUCLID; + } else if ( strcmp(argv[arg_index], "gmres") == 0 ) - { - precond_id = HYPRE_GMRES; - } + { + precond_id = HYPRE_GMRES; + } else if ( strcmp(argv[arg_index], "gsmg") == 0 ) - { - precond_id = HYPRE_GSMG; - } + { + precond_id = HYPRE_GSMG; + } else if ( strcmp(argv[arg_index], "hybrid") == 0 ) - { - precond_id = HYPRE_HYBRID; - } + { + precond_id = HYPRE_HYBRID; + } else if ( strcmp(argv[arg_index], "jacobi") == 0 ) - { - precond_id = HYPRE_JACOBI; - } + { + precond_id = HYPRE_JACOBI; + } else if ( strcmp(argv[arg_index], "parasails") == 0 ) - { - precond_id = HYPRE_PARASAILS; - } + { + precond_id = HYPRE_PARASAILS; + } else if ( strcmp(argv[arg_index], "pcg") == 0 ) - { - precond_id = HYPRE_PCG; - } + { + precond_id = HYPRE_PCG; + } else if ( strcmp(argv[arg_index], "pfmg") == 0 ) - { - precond_id = HYPRE_PFMG; - } + { + precond_id = HYPRE_PFMG; + } else if ( strcmp(argv[arg_index], "pilut") == 0 ) - { - precond_id = HYPRE_PILUT; - } + { + precond_id = HYPRE_PILUT; + } else if ( strcmp(argv[arg_index], "schwarz") == 0 ) - { - precond_id = HYPRE_SCHWARZ; - } + { + precond_id = HYPRE_SCHWARZ; + } else if ( strcmp(argv[arg_index], "smg") == 0 ) - { - precond_id = HYPRE_SMG; - } + { + precond_id = HYPRE_SMG; + } else if ( strcmp(argv[arg_index], "sparsemsg") == 0 ) - { - precond_id = HYPRE_SPARSEMSG; - } + { + precond_id = HYPRE_SPARSEMSG; + } else if ( strcmp(argv[arg_index], "split") == 0 ) - { - precond_id = HYPRE_SPLIT; - } + { + precond_id = HYPRE_SPLIT; + } else if ( strcmp(argv[arg_index], "splitpfmg") == 0 ) - { - precond_id = HYPRE_SPLITPFMG; - } + { + precond_id = HYPRE_SPLITPFMG; + } else if ( strcmp(argv[arg_index], "splitsmg") == 0 ) - { - precond_id = HYPRE_SPLITSMG; - } + { + precond_id = HYPRE_SPLITSMG; + } else if ( strcmp(argv[arg_index], "syspfmg") == 0 ) - { - precond_id = HYPRE_SYSPFMG; - }; + { + precond_id = HYPRE_SYSPFMG; + }; arg_index++; } else if ( strcmp(argv[arg_index], "-rhsfromfile") == 0 ) @@ -644,9 +653,9 @@ main( HYPRE_Int argc, else if ( strcmp(argv[arg_index], "-dt") == 0 ) { arg_index++; - dt = atof(argv[arg_index++]); + dt = (HYPRE_Real)atof(argv[arg_index++]); build_rhs_type = -1; - if ( build_src_type == -1 ) build_src_type = 2; + if ( build_src_type == -1 ) { build_src_type = 2; } } else if ( strcmp(argv[arg_index], "-help") == 0 ) { @@ -723,7 +732,7 @@ main( HYPRE_Int argc, { /* lobpcg: inner pcg iterations */ arg_index++; - pcgTol = atof(argv[arg_index++]); + pcgTol = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-pcgmode") == 0 ) { @@ -741,152 +750,153 @@ main( HYPRE_Int argc, /* begin lobpcg */ if ( solver_id == HYPRE_BOOMERAMG && lobpcgFlag ) - {solver_id = HYPRE_BOOMERAMG; - precond_id = HYPRE_PCG; - }; + { + solver_id = HYPRE_BOOMERAMG; + precond_id = HYPRE_PCG; + }; /* end lobpcg */ if (solver_id == HYPRE_PARASAILS) { - max_levels = 1; + max_levels = 1; } /* defaults for BoomerAMG */ if (solver_id == HYPRE_BOOMERAMG) { - strong_threshold = 0.25; - trunc_factor = 0.; - cycle_type = 1; - - num_grid_sweeps = hypre_CTAlloc(HYPRE_Int, 4, HYPRE_MEMORY_HOST); - grid_relax_type = hypre_CTAlloc(HYPRE_Int, 4, HYPRE_MEMORY_HOST); - grid_relax_points = hypre_CTAlloc(HYPRE_Int *, 4, HYPRE_MEMORY_HOST); - relax_weight = hypre_CTAlloc(HYPRE_Real, max_levels, HYPRE_MEMORY_HOST); - omega = hypre_CTAlloc(HYPRE_Real, max_levels, HYPRE_MEMORY_HOST); + strong_threshold = 0.25; + trunc_factor = 0.; + cycle_type = 1; - for (i=0; i < max_levels; i++) - { - relax_weight[i] = 1.; - omega[i] = 1.; - } + num_grid_sweeps = hypre_CTAlloc(HYPRE_Int, 4, HYPRE_MEMORY_HOST); + grid_relax_type = hypre_CTAlloc(HYPRE_Int, 4, HYPRE_MEMORY_HOST); + grid_relax_points = hypre_CTAlloc(HYPRE_Int *, 4, HYPRE_MEMORY_HOST); + relax_weight = hypre_CTAlloc(HYPRE_Real, max_levels, HYPRE_MEMORY_HOST); + omega = hypre_CTAlloc(HYPRE_Real, max_levels, HYPRE_MEMORY_HOST); - /* for CGNR preconditioned with Boomeramg, only relaxation scheme 0 is - implemented, i.e. Jacobi relaxation */ - if (precond_id == HYPRE_CGNR) - { - /* fine grid */ - relax_default = 7; - grid_relax_type[0] = relax_default; - num_grid_sweeps[0] = num_sweep; - grid_relax_points[0] = hypre_CTAlloc(HYPRE_Int, num_sweep, HYPRE_MEMORY_HOST); - for (i=0; i last_local_row) + { + offdiag_sizes[local_row]++; + } + else + { + diag_sizes[local_row]++; + } + } + local_row++; + ierr += HYPRE_ParCSRMatrixRestoreRow( parcsr_A, i, &size, + &col_inds, &values ); + } + ierr += HYPRE_IJMatrixSetDiagOffdSizes( ij_A, + (const HYPRE_Int *) diag_sizes, + (const HYPRE_Int *) offdiag_sizes ); + hypre_TFree(diag_sizes, HYPRE_MEMORY_HOST); + hypre_TFree(offdiag_sizes, HYPRE_MEMORY_HOST); - diag_sizes = hypre_CTAlloc(HYPRE_Int, local_num_rows, HYPRE_MEMORY_HOST); - offdiag_sizes = hypre_CTAlloc(HYPRE_Int, local_num_rows, HYPRE_MEMORY_HOST); - local_row = 0; - for (i=first_local_row; i<= last_local_row; i++) - { - ierr += HYPRE_ParCSRMatrixGetRow( parcsr_A, i, &size, - &col_inds, &values ); + ierr = HYPRE_IJMatrixInitialize( ij_A ); - for (j=0; j < size; j++) + for (i = first_local_row; i <= last_local_row; i++) { - if (col_inds[j] < first_local_row || col_inds[j] > last_local_row) - offdiag_sizes[local_row]++; - else - diag_sizes[local_row]++; + ierr += HYPRE_ParCSRMatrixGetRow( parcsr_A, i, &size, + &col_inds, &values ); + + ierr += HYPRE_IJMatrixSetValues( ij_A, 1, &size, &i, + (const HYPRE_Int *) col_inds, + (const HYPRE_Real *) values ); + + ierr += HYPRE_ParCSRMatrixRestoreRow( parcsr_A, i, &size, + &col_inds, &values ); } - local_row++; - ierr += HYPRE_ParCSRMatrixRestoreRow( parcsr_A, i, &size, - &col_inds, &values ); - } - ierr += HYPRE_IJMatrixSetDiagOffdSizes( ij_A, - (const HYPRE_Int *) diag_sizes, - (const HYPRE_Int *) offdiag_sizes ); - hypre_TFree(diag_sizes, HYPRE_MEMORY_HOST); - hypre_TFree(offdiag_sizes, HYPRE_MEMORY_HOST); - - ierr = HYPRE_IJMatrixInitialize( ij_A ); - - for (i=first_local_row; i<= last_local_row; i++) - { - ierr += HYPRE_ParCSRMatrixGetRow( parcsr_A, i, &size, - &col_inds, &values ); - - ierr += HYPRE_IJMatrixSetValues( ij_A, 1, &size, &i, - (const HYPRE_Int *) col_inds, - (const HYPRE_Real *) values ); - - ierr += HYPRE_ParCSRMatrixRestoreRow( parcsr_A, i, &size, - &col_inds, &values ); - } - } - else - { - row_sizes = hypre_CTAlloc(HYPRE_Int, local_num_rows, HYPRE_MEMORY_HOST); - - size = 5; /* this is in general too low, and supposed to test + } + else + { + row_sizes = hypre_CTAlloc(HYPRE_Int, local_num_rows, HYPRE_MEMORY_HOST); + + size = 5; /* this is in general too low, and supposed to test the capability of the reallocation of the interface */ - if (sparsity_known == 0) /* tries a more accurate estimate of the + if (sparsity_known == 0) /* tries a more accurate estimate of the storage */ - { - if (build_matrix_type == 2) size = 7; - if (build_matrix_type == 3) size = 9; - if (build_matrix_type == 4) size = 27; - } + { + if (build_matrix_type == 2) { size = 7; } + if (build_matrix_type == 3) { size = 9; } + if (build_matrix_type == 4) { size = 27; } + } - for (i=0; i < local_num_rows; i++) - row_sizes[i] = size; + for (i = 0; i < local_num_rows; i++) + { + row_sizes[i] = size; + } - ierr = HYPRE_IJMatrixSetRowSizes ( ij_A, (const HYPRE_Int *) row_sizes ); + ierr = HYPRE_IJMatrixSetRowSizes ( ij_A, (const HYPRE_Int *) row_sizes ); - hypre_TFree(row_sizes, HYPRE_MEMORY_HOST); + hypre_TFree(row_sizes, HYPRE_MEMORY_HOST); - ierr = HYPRE_IJMatrixInitialize( ij_A ); + ierr = HYPRE_IJMatrixInitialize( ij_A ); - /* Loop through all locally stored rows and insert them into ij_matrix */ - for (i=first_local_row; i<= last_local_row; i++) - { - ierr += HYPRE_ParCSRMatrixGetRow( parcsr_A, i, &size, - &col_inds, &values ); + /* Loop through all locally stored rows and insert them into ij_matrix */ + for (i = first_local_row; i <= last_local_row; i++) + { + ierr += HYPRE_ParCSRMatrixGetRow( parcsr_A, i, &size, + &col_inds, &values ); - ierr += HYPRE_IJMatrixSetValues( ij_A, 1, &size, &i, - (const HYPRE_Int *) col_inds, - (const HYPRE_Real *) values ); + ierr += HYPRE_IJMatrixSetValues( ij_A, 1, &size, &i, + (const HYPRE_Int *) col_inds, + (const HYPRE_Real *) values ); - ierr += HYPRE_ParCSRMatrixRestoreRow( parcsr_A, i, &size, - &col_inds, &values ); - } - } + ierr += HYPRE_ParCSRMatrixRestoreRow( parcsr_A, i, &size, + &col_inds, &values ); + } + } - ierr += HYPRE_IJMatrixAssemble( ij_A ); + ierr += HYPRE_IJMatrixAssemble( ij_A ); } @@ -1448,8 +1468,8 @@ main( HYPRE_Int argc, if (ierr) { - hypre_printf("Error in driver building IJMatrix from parcsr matrix. \n"); - return(-1); + hypre_printf("Error in driver building IJMatrix from parcsr matrix. \n"); + return (-1); } /* This is to emphasize that one can IJMatrixAddToValues after an @@ -1459,21 +1479,21 @@ main( HYPRE_Int argc, the opportunity to IJMatrixAddTo before a IJMatrixAssemble. */ - ierr = HYPRE_IJMatrixInitialize( ij_A ); + ierr = HYPRE_IJMatrixInitialize( ij_A ); - /* Loop through all locally stored rows and insert them into ij_matrix */ - for (i=first_local_row; i<= last_local_row; i++) - { - ierr += HYPRE_ParCSRMatrixGetRow( parcsr_A, i, &size, - &col_inds, &values ); + /* Loop through all locally stored rows and insert them into ij_matrix */ + for (i = first_local_row; i <= last_local_row; i++) + { + ierr += HYPRE_ParCSRMatrixGetRow( parcsr_A, i, &size, + &col_inds, &values ); - ierr += HYPRE_IJMatrixSetValues( ij_A, 1, &size, &i, - (const HYPRE_Int *) col_inds, - (const HYPRE_Real *) values ); + ierr += HYPRE_IJMatrixSetValues( ij_A, 1, &size, &i, + (const HYPRE_Int *) col_inds, + (const HYPRE_Real *) values ); - ierr += HYPRE_ParCSRMatrixRestoreRow( parcsr_A, i, &size, - &col_inds, &values ); - } + ierr += HYPRE_ParCSRMatrixRestoreRow( parcsr_A, i, &size, + &col_inds, &values ); + } /* If sparsity pattern is not changed since last IJMatrixAssemble call, this should be a no-op */ @@ -1485,7 +1505,9 @@ main( HYPRE_Int argc, *-----------------------------------------------------------*/ if (build_matrix_type > -1) - ierr += HYPRE_ParCSRMatrixDestroy(parcsr_A); + { + ierr += HYPRE_ParCSRMatrixDestroy(parcsr_A); + } ierr += HYPRE_IJMatrixGetObject( ij_A, &object); parcsr_A = (HYPRE_ParCSRMatrix) object; @@ -1501,24 +1523,26 @@ main( HYPRE_Int argc, { if (myid == 0) { - hypre_printf(" RHS vector read from file %s\n", argv[build_rhs_arg_index]); - hypre_printf(" Initial guess is 0\n"); + hypre_printf(" RHS vector read from file %s\n", argv[build_rhs_arg_index]); + hypre_printf(" Initial guess is 0\n"); } -/* RHS */ + /* RHS */ ierr = HYPRE_IJVectorRead( argv[build_rhs_arg_index], hypre_MPI_COMM_WORLD, HYPRE_PARCSR, &ij_b ); ierr = HYPRE_IJVectorGetObject( ij_b, &object ); b = (HYPRE_ParVector) object; -/* Initial guess */ + /* Initial guess */ HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_col, last_local_col, &ij_x); HYPRE_IJVectorSetObjectType(ij_x, HYPRE_PARCSR); HYPRE_IJVectorInitialize(ij_x); values = hypre_CTAlloc(HYPRE_Real, local_num_cols, HYPRE_MEMORY_HOST); for (i = 0; i < local_num_cols; i++) + { values[i] = 0.; + } HYPRE_IJVectorSetValues(ij_x, local_num_cols, NULL, values); hypre_TFree(values, HYPRE_MEMORY_HOST); @@ -1528,10 +1552,10 @@ main( HYPRE_Int argc, else if ( build_rhs_type == 1 ) { hypre_printf("build_rhs_type == 1 not currently implemented\n"); - return(-1); + return (-1); #if 0 -/* RHS */ + /* RHS */ BuildRhsParFromOneFile2(argc, argv, build_rhs_arg_index, part_b, &b); #endif } @@ -1539,32 +1563,36 @@ main( HYPRE_Int argc, { if (myid == 0) { - hypre_printf(" RHS vector has unit components\n"); - hypre_printf(" Initial guess is 0\n"); + hypre_printf(" RHS vector has unit components\n"); + hypre_printf(" Initial guess is 0\n"); } -/* RHS */ + /* RHS */ HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_row, last_local_row, &ij_b); HYPRE_IJVectorSetObjectType(ij_b, HYPRE_PARCSR); HYPRE_IJVectorInitialize(ij_b); values = hypre_CTAlloc(HYPRE_Real, local_num_rows, HYPRE_MEMORY_HOST); for (i = 0; i < local_num_rows; i++) + { values[i] = 1.0; + } HYPRE_IJVectorSetValues(ij_b, local_num_rows, NULL, values); hypre_TFree(values, HYPRE_MEMORY_HOST); ierr = HYPRE_IJVectorGetObject( ij_b, &object ); b = (HYPRE_ParVector) object; -/* Initial guess */ + /* Initial guess */ HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_col, last_local_col, &ij_x); HYPRE_IJVectorSetObjectType(ij_x, HYPRE_PARCSR); HYPRE_IJVectorInitialize(ij_x); values = hypre_CTAlloc(HYPRE_Real, local_num_cols, HYPRE_MEMORY_HOST); for (i = 0; i < local_num_cols; i++) + { values[i] = 0.; + } HYPRE_IJVectorSetValues(ij_x, local_num_cols, NULL, values); hypre_TFree(values, HYPRE_MEMORY_HOST); @@ -1575,35 +1603,37 @@ main( HYPRE_Int argc, { if (myid == 0) { - hypre_printf(" RHS vector has random components and unit 2-norm\n"); - hypre_printf(" Initial guess is 0\n"); + hypre_printf(" RHS vector has random components and unit 2-norm\n"); + hypre_printf(" Initial guess is 0\n"); } -/* RHS */ + /* RHS */ HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_row, last_local_row, &ij_b); HYPRE_IJVectorSetObjectType(ij_b, HYPRE_PARCSR); HYPRE_IJVectorInitialize(ij_b); ierr = HYPRE_IJVectorGetObject( ij_b, &object ); b = (HYPRE_ParVector) object; -/* For purposes of this test, HYPRE_ParVector functions are used, but these are - not necessary. For a clean use of the interface, the user "should" - modify components of ij_x by using functions HYPRE_IJVectorSetValues or - HYPRE_IJVectorAddToValues */ + /* For purposes of this test, HYPRE_ParVector functions are used, but these are + not necessary. For a clean use of the interface, the user "should" + modify components of ij_x by using functions HYPRE_IJVectorSetValues or + HYPRE_IJVectorAddToValues */ HYPRE_ParVectorSetRandomValues(b, 22775); - HYPRE_ParVectorInnerProd(b,b,&norm); - norm = 1./sqrt(norm); + HYPRE_ParVectorInnerProd(b, b, &norm); + norm = 1. / hypre_sqrt(norm); ierr = HYPRE_ParVectorScale(norm, b); -/* Initial guess */ + /* Initial guess */ HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_col, last_local_col, &ij_x); HYPRE_IJVectorSetObjectType(ij_x, HYPRE_PARCSR); HYPRE_IJVectorInitialize(ij_x); values = hypre_CTAlloc(HYPRE_Real, local_num_cols, HYPRE_MEMORY_HOST); for (i = 0; i < local_num_cols; i++) + { values[i] = 0.; + } HYPRE_IJVectorSetValues(ij_x, local_num_cols, NULL, values); hypre_TFree(values, HYPRE_MEMORY_HOST); @@ -1614,37 +1644,41 @@ main( HYPRE_Int argc, { if (myid == 0) { - hypre_printf(" RHS vector set for solution with unit components\n"); - hypre_printf(" Initial guess is 0\n"); + hypre_printf(" RHS vector set for solution with unit components\n"); + hypre_printf(" Initial guess is 0\n"); } -/* Temporary use of solution vector */ + /* Temporary use of solution vector */ HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_col, last_local_col, &ij_x); HYPRE_IJVectorSetObjectType(ij_x, HYPRE_PARCSR); HYPRE_IJVectorInitialize(ij_x); values = hypre_CTAlloc(HYPRE_Real, local_num_cols, HYPRE_MEMORY_HOST); for (i = 0; i < local_num_cols; i++) + { values[i] = 1.; + } HYPRE_IJVectorSetValues(ij_x, local_num_cols, NULL, values); hypre_TFree(values, HYPRE_MEMORY_HOST); ierr = HYPRE_IJVectorGetObject( ij_x, &object ); x = (HYPRE_ParVector) object; -/* RHS */ + /* RHS */ HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_row, last_local_row, &ij_b); HYPRE_IJVectorSetObjectType(ij_b, HYPRE_PARCSR); HYPRE_IJVectorInitialize(ij_b); ierr = HYPRE_IJVectorGetObject( ij_b, &object ); b = (HYPRE_ParVector) object; - HYPRE_ParCSRMatrixMatvec(1.,parcsr_A,x,0.,b); + HYPRE_ParCSRMatrixMatvec(1., parcsr_A, x, 0., b); -/* Initial guess */ + /* Initial guess */ values = hypre_CTAlloc(HYPRE_Real, local_num_cols, HYPRE_MEMORY_HOST); for (i = 0; i < local_num_cols; i++) + { values[i] = 0.; + } HYPRE_IJVectorSetValues(ij_x, local_num_cols, NULL, values); hypre_TFree(values, HYPRE_MEMORY_HOST); } @@ -1652,32 +1686,36 @@ main( HYPRE_Int argc, { if (myid == 0) { - hypre_printf(" RHS vector is 0\n"); - hypre_printf(" Initial guess has unit components\n"); + hypre_printf(" RHS vector is 0\n"); + hypre_printf(" Initial guess has unit components\n"); } -/* RHS */ + /* RHS */ HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_row, last_local_row, &ij_b); HYPRE_IJVectorSetObjectType(ij_b, HYPRE_PARCSR); HYPRE_IJVectorInitialize(ij_b); values = hypre_CTAlloc(HYPRE_Real, local_num_rows, HYPRE_MEMORY_HOST); for (i = 0; i < local_num_rows; i++) + { values[i] = 0.; + } HYPRE_IJVectorSetValues(ij_b, local_num_rows, NULL, values); hypre_TFree(values, HYPRE_MEMORY_HOST); ierr = HYPRE_IJVectorGetObject( ij_b, &object ); b = (HYPRE_ParVector) object; -/* Initial guess */ + /* Initial guess */ HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_col, last_local_col, &ij_x); HYPRE_IJVectorSetObjectType(ij_x, HYPRE_PARCSR); HYPRE_IJVectorInitialize(ij_x); values = hypre_CTAlloc(HYPRE_Real, local_num_cols, HYPRE_MEMORY_HOST); for (i = 0; i < local_num_cols; i++) + { values[i] = 1.; + } HYPRE_IJVectorSetValues(ij_x, local_num_cols, NULL, values); hypre_TFree(values, HYPRE_MEMORY_HOST); @@ -1688,14 +1726,14 @@ main( HYPRE_Int argc, if ( build_src_type == 0 ) { #if 0 -/* RHS */ + /* RHS */ BuildRhsParFromFile(argc, argv, build_src_arg_index, &b); #endif if (myid == 0) { - hypre_printf(" Source vector read from file %s\n", argv[build_src_arg_index]); - hypre_printf(" Initial unknown vector in evolution is 0\n"); + hypre_printf(" Source vector read from file %s\n", argv[build_src_arg_index]); + hypre_printf(" Initial unknown vector in evolution is 0\n"); } ierr = HYPRE_IJVectorRead( argv[build_src_arg_index], hypre_MPI_COMM_WORLD, @@ -1704,14 +1742,16 @@ main( HYPRE_Int argc, ierr = HYPRE_IJVectorGetObject( ij_b, &object ); b = (HYPRE_ParVector) object; -/* Initial unknown vector */ + /* Initial unknown vector */ HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_col, last_local_col, &ij_x); HYPRE_IJVectorSetObjectType(ij_x, HYPRE_PARCSR); HYPRE_IJVectorInitialize(ij_x); values = hypre_CTAlloc(HYPRE_Real, local_num_cols, HYPRE_MEMORY_HOST); for (i = 0; i < local_num_cols; i++) + { values[i] = 0.; + } HYPRE_IJVectorSetValues(ij_x, local_num_cols, NULL, values); hypre_TFree(values, HYPRE_MEMORY_HOST); @@ -1721,7 +1761,7 @@ main( HYPRE_Int argc, else if ( build_src_type == 1 ) { hypre_printf("build_src_type == 1 not currently implemented\n"); - return(-1); + return (-1); #if 0 BuildRhsParFromOneFile2(argc, argv, build_src_arg_index, part_b, &b); @@ -1731,34 +1771,38 @@ main( HYPRE_Int argc, { if (myid == 0) { - hypre_printf(" Source vector has unit components\n"); - hypre_printf(" Initial unknown vector is 0\n"); + hypre_printf(" Source vector has unit components\n"); + hypre_printf(" Initial unknown vector is 0\n"); } -/* RHS */ + /* RHS */ HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_row, last_local_row, &ij_b); HYPRE_IJVectorSetObjectType(ij_b, HYPRE_PARCSR); HYPRE_IJVectorInitialize(ij_b); values = hypre_CTAlloc(HYPRE_Real, local_num_rows, HYPRE_MEMORY_HOST); for (i = 0; i < local_num_rows; i++) + { values[i] = 1.; + } HYPRE_IJVectorSetValues(ij_b, local_num_rows, NULL, values); hypre_TFree(values, HYPRE_MEMORY_HOST); ierr = HYPRE_IJVectorGetObject( ij_b, &object ); b = (HYPRE_ParVector) object; -/* Initial guess */ + /* Initial guess */ HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_col, last_local_col, &ij_x); HYPRE_IJVectorSetObjectType(ij_x, HYPRE_PARCSR); HYPRE_IJVectorInitialize(ij_x); -/* For backward Euler the previous backward Euler iterate (assumed - 0 here) is usually used as the initial guess */ + /* For backward Euler the previous backward Euler iterate (assumed + 0 here) is usually used as the initial guess */ values = hypre_CTAlloc(HYPRE_Real, local_num_cols, HYPRE_MEMORY_HOST); for (i = 0; i < local_num_cols; i++) + { values[i] = 0.; + } HYPRE_IJVectorSetValues(ij_x, local_num_cols, NULL, values); hypre_TFree(values, HYPRE_MEMORY_HOST); @@ -1769,11 +1813,11 @@ main( HYPRE_Int argc, { if (myid == 0) { - hypre_printf(" Source vector has random components in range 0 - 1\n"); - hypre_printf(" Initial unknown vector is 0\n"); + hypre_printf(" Source vector has random components in range 0 - 1\n"); + hypre_printf(" Initial unknown vector is 0\n"); } -/* RHS */ + /* RHS */ HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_row, last_local_row, &ij_b); HYPRE_IJVectorSetObjectType(ij_b, HYPRE_PARCSR); HYPRE_IJVectorInitialize(ij_b); @@ -1781,7 +1825,9 @@ main( HYPRE_Int argc, hypre_SeedRand(myid); for (i = 0; i < local_num_rows; i++) + { values[i] = hypre_Rand(); + } HYPRE_IJVectorSetValues(ij_b, local_num_rows, NULL, values); hypre_TFree(values, HYPRE_MEMORY_HOST); @@ -1789,16 +1835,18 @@ main( HYPRE_Int argc, ierr = HYPRE_IJVectorGetObject( ij_b, &object ); b = (HYPRE_ParVector) object; -/* Initial guess */ + /* Initial guess */ HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_col, last_local_col, &ij_x); HYPRE_IJVectorSetObjectType(ij_x, HYPRE_PARCSR); HYPRE_IJVectorInitialize(ij_x); -/* For backward Euler the previous backward Euler iterate (assumed - 0 here) is usually used as the initial guess */ + /* For backward Euler the previous backward Euler iterate (assumed + 0 here) is usually used as the initial guess */ values = hypre_CTAlloc(HYPRE_Real, local_num_cols, HYPRE_MEMORY_HOST); for (i = 0; i < local_num_cols; i++) + { values[i] = 0.; + } HYPRE_IJVectorSetValues(ij_x, local_num_cols, NULL, values); hypre_TFree(values, HYPRE_MEMORY_HOST); @@ -1809,11 +1857,11 @@ main( HYPRE_Int argc, { if (myid == 0) { - hypre_printf(" Source vector is 0 \n"); - hypre_printf(" Initial unknown vector has random components in range 0 - 1\n"); + hypre_printf(" Source vector is 0 \n"); + hypre_printf(" Initial unknown vector has random components in range 0 - 1\n"); } -/* RHS */ + /* RHS */ HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_row, last_local_row, &ij_b); HYPRE_IJVectorSetObjectType(ij_b, HYPRE_PARCSR); HYPRE_IJVectorInitialize(ij_b); @@ -1821,24 +1869,28 @@ main( HYPRE_Int argc, values = hypre_CTAlloc(HYPRE_Real, local_num_rows, HYPRE_MEMORY_HOST); hypre_SeedRand(myid); for (i = 0; i < local_num_rows; i++) - values[i] = hypre_Rand()/dt; + { + values[i] = hypre_Rand() / dt; + } HYPRE_IJVectorSetValues(ij_b, local_num_rows, NULL, values); hypre_TFree(values, HYPRE_MEMORY_HOST); ierr = HYPRE_IJVectorGetObject( ij_b, &object ); b = (HYPRE_ParVector) object; -/* Initial guess */ + /* Initial guess */ HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_col, last_local_col, &ij_x); HYPRE_IJVectorSetObjectType(ij_x, HYPRE_PARCSR); HYPRE_IJVectorInitialize(ij_x); -/* For backward Euler the previous backward Euler iterate (assumed - random in 0 - 1 here) is usually used as the initial guess */ + /* For backward Euler the previous backward Euler iterate (assumed + random in 0 - 1 here) is usually used as the initial guess */ values = hypre_CTAlloc(HYPRE_Real, local_num_cols, HYPRE_MEMORY_HOST); hypre_SeedRand(myid); for (i = 0; i < local_num_cols; i++) + { values[i] = hypre_Rand(); + } HYPRE_IJVectorSetValues(ij_x, local_num_cols, NULL, values); hypre_TFree(values, HYPRE_MEMORY_HOST); @@ -1870,23 +1922,31 @@ main( HYPRE_Int argc, local_num_vars = local_num_rows; dof_func = hypre_CTAlloc(HYPRE_Int, local_num_vars, HYPRE_MEMORY_HOST); if (myid == 0) + { hypre_printf (" Number of unknown functions = %d \n", num_functions); - rest = first_local_row-((first_local_row/num_functions)*num_functions); - indx = num_functions-rest; - if (rest == 0) indx = 0; + } + rest = first_local_row - ((first_local_row / num_functions) * num_functions); + indx = num_functions - rest; + if (rest == 0) { indx = 0; } k = num_functions - 1; - for (j = indx-1; j > -1; j--) + for (j = indx - 1; j > -1; j--) + { dof_func[j] = k--; - tms = local_num_vars/num_functions; - if (tms*num_functions+indx > local_num_vars) tms--; - for (j=0; j < tms; j++) + } + tms = local_num_vars / num_functions; + if (tms * num_functions + indx > local_num_vars) { tms--; } + for (j = 0; j < tms; j++) { - for (k=0; k < num_functions; k++) + for (k = 0; k < num_functions; k++) + { dof_func[indx++] = k; + } } k = 0; while (indx < local_num_vars) + { dof_func[indx++] = k++; + } } } @@ -1909,7 +1969,7 @@ main( HYPRE_Int argc, { dscg_max_its = 1000; pcg_max_its = 200; - if (myid == 0) hypre_printf("Solver: AMG_Hybrid\n"); + if (myid == 0) { hypre_printf("Solver: AMG_Hybrid\n"); } time_index = hypre_InitializeTiming("AMG_hybrid Setup"); hypre_BeginTiming(time_index); @@ -1921,7 +1981,7 @@ main( HYPRE_Int argc, HYPRE_ParCSRHybridSetPrintLevel(amg_solver, poutdat); HYPRE_ParCSRHybridSetDSCGMaxIter(amg_solver, dscg_max_its ); HYPRE_ParCSRHybridSetPCGMaxIter(amg_solver, pcg_max_its ); - HYPRE_ParCSRHybridSetCoarsenType(amg_solver, (hybrid*coarsen_type)); + HYPRE_ParCSRHybridSetCoarsenType(amg_solver, (hybrid * coarsen_type)); HYPRE_ParCSRHybridSetStrongThreshold(amg_solver, strong_threshold); HYPRE_ParCSRHybridSetTruncFactor(amg_solver, trunc_factor); HYPRE_ParCSRHybridSetNumGridSweeps(amg_solver, num_grid_sweeps); @@ -1953,7 +2013,7 @@ main( HYPRE_Int argc, HYPRE_ParCSRHybridGetPCGNumIterations(amg_solver, &pcg_num_its); HYPRE_ParCSRHybridGetDSCGNumIterations(amg_solver, &dscg_num_its); HYPRE_ParCSRHybridGetFinalRelativeResidualNorm(amg_solver, - &final_res_norm); + &final_res_norm); if (myid == 0) { @@ -1972,19 +2032,19 @@ main( HYPRE_Int argc, if (solver_id == HYPRE_BOOMERAMG) { - if (myid == 0) hypre_printf("Solver: AMG\n"); + if (myid == 0) { hypre_printf("Solver: AMG\n"); } time_index = hypre_InitializeTiming("BoomerAMG Setup"); hypre_BeginTiming(time_index); HYPRE_BoomerAMGCreate(&amg_solver); HYPRE_BoomerAMGSetInterpType(amg_solver, interp_type); HYPRE_BoomerAMGSetNumSamples(amg_solver, gsmg_samples); - HYPRE_BoomerAMGSetCoarsenType(amg_solver, (hybrid*coarsen_type)); + HYPRE_BoomerAMGSetCoarsenType(amg_solver, (hybrid * coarsen_type)); HYPRE_BoomerAMGSetMeasureType(amg_solver, measure_type); HYPRE_BoomerAMGSetTol(amg_solver, tol); HYPRE_BoomerAMGSetStrongThreshold(amg_solver, strong_threshold); HYPRE_BoomerAMGSetTruncFactor(amg_solver, trunc_factor); -/* note: log is written to standard output, not to file */ + /* note: log is written to standard output, not to file */ HYPRE_BoomerAMGSetPrintLevel(amg_solver, 3); HYPRE_BoomerAMGSetPrintFileName(amg_solver, "driver.out.log"); HYPRE_BoomerAMGSetCycleType(amg_solver, cycle_type); @@ -2005,7 +2065,9 @@ main( HYPRE_Int argc, HYPRE_BoomerAMGSetSchwarzRlxWeight(amg_solver, schwarz_rlx_weight); HYPRE_BoomerAMGSetNumFunctions(amg_solver, num_functions); if (num_functions > 1) + { HYPRE_BoomerAMGSetDofFunc(amg_solver, dof_func); + } HYPRE_BoomerAMGSetup(amg_solver, parcsr_A, b, x); @@ -2047,24 +2109,30 @@ main( HYPRE_Int argc, grid_relax_type[0] = relax_default; hypre_TFree(grid_relax_points[0], HYPRE_MEMORY_HOST); grid_relax_points[0] = hypre_CTAlloc(HYPRE_Int, num_sweep, HYPRE_MEMORY_HOST); - for (i=0; i 1) + { HYPRE_BoomerAMGSetDofFunc(amg_solver, dof_func); + } + + HYPRE_BoomerAMGSetup(amg_solver, parcsr_A, b, x); + + hypre_EndTiming(time_index); + hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + time_index = hypre_InitializeTiming("BoomerAMG Solve"); + hypre_BeginTiming(time_index); + + HYPRE_BoomerAMGSolve(amg_solver, parcsr_A, b, x); + + hypre_EndTiming(time_index); + hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + +#if SECOND_TIME + /* run a second time to check for memory leaks */ + HYPRE_ParVectorSetRandomValues(x, 775); + HYPRE_BoomerAMGSetup(amg_solver, parcsr_A, b, x); + HYPRE_BoomerAMGSolve(amg_solver, parcsr_A, b, x); +#endif + + HYPRE_BoomerAMGDestroy(amg_solver); + } + + if (solver_id == HYPRE_PARASAILS) + { + HYPRE_IJMatrix ij_M; + HYPRE_ParCSRMatrix parcsr_mat; + + /* use ParaSails preconditioner */ + if (myid == 0) { hypre_printf("Test ParaSails Build IJMatrix\n"); } + + HYPRE_IJMatrixPrint(ij_A, "parasails.in"); + + HYPRE_ParaSailsCreate(hypre_MPI_COMM_WORLD, &pcg_precond); + HYPRE_ParaSailsSetParams(pcg_precond, 0., 0); + HYPRE_ParaSailsSetFilter(pcg_precond, 0.); + HYPRE_ParaSailsSetLogging(pcg_precond, ioutdat); + + HYPRE_IJMatrixGetObject( ij_A, &object); + parcsr_mat = (HYPRE_ParCSRMatrix) object; + + HYPRE_ParaSailsSetup(pcg_precond, parcsr_mat, NULL, NULL); + HYPRE_ParaSailsBuildIJMatrix(pcg_precond, &ij_M); + HYPRE_IJMatrixPrint(ij_M, "parasails.out"); + + if (myid == 0) { hypre_printf("Printed to parasails.out.\n"); } + exit(0); + } + + /*----------------------------------------------------------- + * Solve the system using PCG + *-----------------------------------------------------------*/ + + /* begin lobpcg */ + if ( !lobpcgFlag && ( solver_id == HYPRE_PCG) ) + /*end lobpcg */ + { + time_index = hypre_InitializeTiming("PCG Setup"); + hypre_BeginTiming(time_index); + ioutdat = 2; + + HYPRE_ParCSRPCGCreate(hypre_MPI_COMM_WORLD, &pcg_solver); + HYPRE_PCGSetMaxIter(pcg_solver, 1000); + HYPRE_PCGSetTol(pcg_solver, tol); + HYPRE_PCGSetTwoNorm(pcg_solver, 1); + HYPRE_PCGSetRelChange(pcg_solver, 0); + HYPRE_PCGSetPrintLevel(pcg_solver, ioutdat); + + if (precond_id == HYPRE_EUCLID) + { + /* use Euclid preconditioning */ + if (myid == 0) { hypre_printf("Solver: Euclid-PCG\n"); } + + HYPRE_EuclidCreate(hypre_MPI_COMM_WORLD, &pcg_precond); + + /* note: There are three methods of setting run-time + parameters for Euclid: (see HYPRE_parcsr_ls.h); here + we'll use what I think is simplest: let Euclid internally + parse the command line. + */ + HYPRE_EuclidSetParams(pcg_precond, argc, argv); + + HYPRE_PCGSetPrecond(pcg_solver, + (HYPRE_PtrToSolverFcn) HYPRE_EuclidSolve, + (HYPRE_PtrToSolverFcn) HYPRE_EuclidSetup, + pcg_precond); + } + else + { + hypre_set_precond(matrix_id, solver_id, precond_id, pcg_solver, pcg_precond); + } + + HYPRE_PCGGetPrecond(pcg_solver, &pcg_precond_gotten); + if (pcg_precond_gotten != pcg_precond) + { + hypre_printf("HYPRE_ParCSRPCGGetPrecond got bad precond\n"); + return (-1); + } + else if (myid == 0) + { + hypre_printf("HYPRE_ParCSRPCGGetPrecond got good precond\n"); + } + + HYPRE_PCGSetup(pcg_solver, (HYPRE_Matrix)parcsr_A, + (HYPRE_Vector)b, (HYPRE_Vector)x); + + hypre_EndTiming(time_index); + hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + time_index = hypre_InitializeTiming("PCG Solve"); + hypre_BeginTiming(time_index); + + HYPRE_PCGSolve(pcg_solver, (HYPRE_Matrix)parcsr_A, + (HYPRE_Vector)b, (HYPRE_Vector)x); + + hypre_EndTiming(time_index); + hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + HYPRE_PCGGetNumIterations(pcg_solver, &num_iterations); + HYPRE_PCGGetFinalRelativeResidualNorm(pcg_solver, &final_res_norm); + +#if SECOND_TIME + /* run a second time to check for memory leaks */ + HYPRE_ParVectorSetRandomValues(x, 775); + HYPRE_PCGSetup(pcg_solver, (HYPRE_Matrix)parcsr_A, + (HYPRE_Vector)b, (HYPRE_Vector)x); + HYPRE_PCGSolve(pcg_solver, (HYPRE_Matrix)parcsr_A, + (HYPRE_Vector)b, (HYPRE_Vector)x); +#endif + + HYPRE_ParCSRPCGDestroy(pcg_solver); + + hypre_destroy_precond(precond_id, pcg_precond); + + + if (myid == 0) + { + hypre_printf("\n"); + hypre_printf("Iterations = %d\n", num_iterations); + hypre_printf("Final Relative Residual Norm = %e\n", final_res_norm); + hypre_printf("\n"); + } + + } + + /* begin lobpcg */ + + /*----------------------------------------------------------- + * Solve the eigenvalue problem using LOBPCG + *-----------------------------------------------------------*/ + + if ( lobpcgFlag ) + { + + interpreter = hypre_CTAlloc(mv_InterfaceInterpreter, 1, HYPRE_MEMORY_HOST); + + HYPRE_ParCSRSetupInterpreter( interpreter ); + HYPRE_ParCSRSetupMatvec(&matvec_fn); + + if (myid != 0) + { + verbosity = 0; + } + + if ( lobpcgGen ) + { + BuildParIsoLaplacian(argc, argv, &parcsr_B); + + ierr = HYPRE_ParCSRMatrixGetLocalRange( parcsr_B, + &first_local_row, &last_local_row, + &first_local_col, &last_local_col ); + + local_num_rows = last_local_row - first_local_row + 1; + local_num_cols = last_local_col - first_local_col + 1; + ierr += HYPRE_ParCSRMatrixGetDims( parcsr_B, &M, &N ); + + ierr += HYPRE_IJMatrixCreate( comm, first_local_row, last_local_row, + first_local_col, last_local_col, + &ij_B ); + + ierr += HYPRE_IJMatrixSetObjectType( ij_B, HYPRE_PARCSR ); + + if (sparsity_known == 1) + { + diag_sizes = hypre_CTAlloc(HYPRE_Int, local_num_rows, HYPRE_MEMORY_HOST); + offdiag_sizes = hypre_CTAlloc(HYPRE_Int, local_num_rows, HYPRE_MEMORY_HOST); + local_row = 0; + for (i = first_local_row; i <= last_local_row; i++) + { + ierr += HYPRE_ParCSRMatrixGetRow( parcsr_B, i, &size, + &col_inds, &values ); + for (j = 0; j < size; j++) + { + if (col_inds[j] < first_local_row || col_inds[j] > last_local_row) + { + offdiag_sizes[local_row]++; + } + else + { + diag_sizes[local_row]++; + } + } + local_row++; + ierr += HYPRE_ParCSRMatrixRestoreRow( parcsr_B, i, &size, + &col_inds, &values ); + } + ierr += HYPRE_IJMatrixSetDiagOffdSizes( ij_B, + (const HYPRE_Int *) diag_sizes, + (const HYPRE_Int *) offdiag_sizes ); + hypre_TFree(diag_sizes, HYPRE_MEMORY_HOST); + hypre_TFree(offdiag_sizes, HYPRE_MEMORY_HOST); + + ierr = HYPRE_IJMatrixInitialize( ij_B ); + + for (i = first_local_row; i <= last_local_row; i++) + { + ierr += HYPRE_ParCSRMatrixGetRow( parcsr_B, i, &size, + &col_inds, &values ); + + ierr += HYPRE_IJMatrixSetValues( ij_B, 1, &size, &i, + (const HYPRE_Int *) col_inds, + (const HYPRE_Real *) values ); + + ierr += HYPRE_ParCSRMatrixRestoreRow( parcsr_B, i, &size, + &col_inds, &values ); + } + } + else + { + row_sizes = hypre_CTAlloc(HYPRE_Int, local_num_rows, HYPRE_MEMORY_HOST); + + size = 5; /* this is in general too low, and supposed to test + the capability of the reallocation of the interface */ + + if (sparsity_known == 0) /* tries a more accurate estimate of the + storage */ + { + if (build_matrix_type == 2) { size = 7; } + if (build_matrix_type == 3) { size = 9; } + if (build_matrix_type == 4) { size = 27; } + } + + for (i = 0; i < local_num_rows; i++) + { + row_sizes[i] = size; + } + + ierr = HYPRE_IJMatrixSetRowSizes ( ij_B, (const HYPRE_Int *) row_sizes ); + + hypre_TFree(row_sizes, HYPRE_MEMORY_HOST); + + ierr = HYPRE_IJMatrixInitialize( ij_B ); + + /* Loop through all locally stored rows and insert them into ij_matrix */ + for (i = first_local_row; i <= last_local_row; i++) + { + ierr += HYPRE_ParCSRMatrixGetRow( parcsr_B, i, &size, + &col_inds, &values ); + + ierr += HYPRE_IJMatrixSetValues( ij_B, 1, &size, &i, + (const HYPRE_Int *) col_inds, + (const HYPRE_Real *) values ); + + ierr += HYPRE_ParCSRMatrixRestoreRow( parcsr_B, i, &size, + &col_inds, &values ); + } + } + + ierr += HYPRE_IJMatrixAssemble( ij_B ); + + ierr += HYPRE_ParCSRMatrixDestroy(parcsr_B); + + ierr += HYPRE_IJMatrixGetObject( ij_B, &object); + parcsr_B = (HYPRE_ParCSRMatrix) object; + + } /* if ( lobpcgGen ) */ + + if ( pcgIterations > 0 ) /* do inner pcg iterations */ + { + + time_index = hypre_InitializeTiming("PCG Setup"); + hypre_BeginTiming(time_index); + + HYPRE_ParCSRPCGCreate(hypre_MPI_COMM_WORLD, &pcg_solver); + HYPRE_PCGSetMaxIter(pcg_solver, pcgIterations); + HYPRE_PCGSetTol(pcg_solver, pcgTol); + HYPRE_PCGSetTwoNorm(pcg_solver, 1); + HYPRE_PCGSetRelChange(pcg_solver, 0); + HYPRE_PCGSetPrintLevel(pcg_solver, 0); + + HYPRE_PCGGetPrecond(pcg_solver, &pcg_precond); + + if (solver_id == 1) + { + /* use BoomerAMG as preconditioner */ + if (myid == 0) { hypre_printf("Solver: AMG-PCG\n"); } + HYPRE_BoomerAMGCreate(&pcg_precond); + HYPRE_BoomerAMGSetInterpType(pcg_precond, interp_type); + HYPRE_BoomerAMGSetNumSamples(pcg_precond, gsmg_samples); + HYPRE_BoomerAMGSetTol(pcg_precond, pc_tol); + HYPRE_BoomerAMGSetCoarsenType(pcg_precond, (hybrid * coarsen_type)); + HYPRE_BoomerAMGSetMeasureType(pcg_precond, measure_type); + HYPRE_BoomerAMGSetStrongThreshold(pcg_precond, strong_threshold); + HYPRE_BoomerAMGSetTruncFactor(pcg_precond, trunc_factor); + HYPRE_BoomerAMGSetPrintLevel(pcg_precond, poutdat); + HYPRE_BoomerAMGSetPrintFileName(pcg_precond, "driver.out.log"); + HYPRE_BoomerAMGSetMaxIter(pcg_precond, 1); + HYPRE_BoomerAMGSetCycleType(pcg_precond, cycle_type); + HYPRE_BoomerAMGSetNumGridSweeps(pcg_precond, num_grid_sweeps); + HYPRE_BoomerAMGSetGridRelaxType(pcg_precond, grid_relax_type); + HYPRE_BoomerAMGSetRelaxWeight(pcg_precond, relax_weight); + HYPRE_BoomerAMGSetOmega(pcg_precond, omega); + HYPRE_BoomerAMGSetSmoothType(pcg_precond, smooth_type); + HYPRE_BoomerAMGSetSmoothNumLevels(pcg_precond, smooth_num_levels); + HYPRE_BoomerAMGSetSmoothNumSweeps(pcg_precond, smooth_num_sweeps); + HYPRE_BoomerAMGSetGridRelaxPoints(pcg_precond, grid_relax_points); + HYPRE_BoomerAMGSetMaxLevels(pcg_precond, max_levels); + HYPRE_BoomerAMGSetMaxRowSum(pcg_precond, max_row_sum); + HYPRE_BoomerAMGSetNumFunctions(pcg_precond, num_functions); + HYPRE_BoomerAMGSetVariant(pcg_precond, variant); + HYPRE_BoomerAMGSetOverlap(pcg_precond, overlap); + HYPRE_BoomerAMGSetDomainType(pcg_precond, domain_type); + HYPRE_BoomerAMGSetSchwarzRlxWeight(pcg_precond, schwarz_rlx_weight); + if (num_functions > 1) + { + HYPRE_BoomerAMGSetDofFunc(pcg_precond, dof_func); + } + HYPRE_PCGSetPrecond(pcg_solver, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, + pcg_precond); + } + else if (solver_id == 2) + { + + /* use diagonal scaling as preconditioner */ + if (myid == 0) { hypre_printf("Solver: DS-PCG\n"); } + pcg_precond = NULL; + + HYPRE_PCGSetPrecond(pcg_solver, + (HYPRE_PtrToSolverFcn) HYPRE_ParCSRDiagScale, + (HYPRE_PtrToSolverFcn) HYPRE_ParCSRDiagScaleSetup, + pcg_precond); + } + else if (solver_id == 8) + { + /* use ParaSails preconditioner */ + if (myid == 0) { hypre_printf("Solver: ParaSails-PCG\n"); } + + HYPRE_ParaSailsCreate(hypre_MPI_COMM_WORLD, &pcg_precond); + HYPRE_ParaSailsSetParams(pcg_precond, sai_threshold, max_levels); + HYPRE_ParaSailsSetFilter(pcg_precond, sai_filter); + HYPRE_ParaSailsSetLogging(pcg_precond, poutdat); + + HYPRE_PCGSetPrecond(pcg_solver, + (HYPRE_PtrToSolverFcn) HYPRE_ParaSailsSolve, + (HYPRE_PtrToSolverFcn) HYPRE_ParaSailsSetup, + pcg_precond); + } + else if (solver_id == 12) + { + /* use Schwarz preconditioner */ + if (myid == 0) { hypre_printf("Solver: Schwarz-PCG\n"); } + + HYPRE_SchwarzCreate(&pcg_precond); + HYPRE_SchwarzSetVariant(pcg_precond, variant); + HYPRE_SchwarzSetOverlap(pcg_precond, overlap); + HYPRE_SchwarzSetDomainType(pcg_precond, domain_type); + HYPRE_SchwarzSetRelaxWeight(pcg_precond, schwarz_rlx_weight); + + HYPRE_PCGSetPrecond(pcg_solver, + (HYPRE_PtrToSolverFcn) HYPRE_SchwarzSolve, + (HYPRE_PtrToSolverFcn) HYPRE_SchwarzSetup, + pcg_precond); + } + else if (solver_id == 14) + { + /* use GSMG as preconditioner */ + + /* reset some smoother parameters */ + + /* fine grid */ + num_grid_sweeps[0] = num_sweep; + grid_relax_type[0] = relax_default; + hypre_TFree(grid_relax_points[0], HYPRE_MEMORY_HOST); + grid_relax_points[0] = hypre_CTAlloc(HYPRE_Int, num_sweep, HYPRE_MEMORY_HOST); + for (i = 0; i < num_sweep; i++) + { + grid_relax_points[0][i] = 0; + } + + /* down cycle */ + num_grid_sweeps[1] = num_sweep; + grid_relax_type[1] = relax_default; + hypre_TFree(grid_relax_points[1], HYPRE_MEMORY_HOST); + grid_relax_points[1] = hypre_CTAlloc(HYPRE_Int, num_sweep, HYPRE_MEMORY_HOST); + for (i = 0; i < num_sweep; i++) + { + grid_relax_points[1][i] = 0; + } + + /* up cycle */ + num_grid_sweeps[2] = num_sweep; + grid_relax_type[2] = relax_default; + hypre_TFree(grid_relax_points[2], HYPRE_MEMORY_HOST); + grid_relax_points[2] = hypre_CTAlloc(HYPRE_Int, num_sweep, HYPRE_MEMORY_HOST); + for (i = 0; i < num_sweep; i++) + { + grid_relax_points[2][i] = 0; + } + + /* coarsest grid */ + num_grid_sweeps[3] = 1; + grid_relax_type[3] = 9; + hypre_TFree(grid_relax_points[3], HYPRE_MEMORY_HOST); + grid_relax_points[3] = hypre_CTAlloc(HYPRE_Int, 1, HYPRE_MEMORY_HOST); + grid_relax_points[3][0] = 0; + + if (myid == 0) { hypre_printf("Solver: GSMG-PCG\n"); } + HYPRE_BoomerAMGCreate(&pcg_precond); + HYPRE_BoomerAMGSetGSMG(pcg_precond, 4); + HYPRE_BoomerAMGSetInterpType(pcg_precond, interp_type); + HYPRE_BoomerAMGSetNumSamples(pcg_precond, gsmg_samples); + HYPRE_BoomerAMGSetTol(pcg_precond, pc_tol); + HYPRE_BoomerAMGSetCoarsenType(pcg_precond, (hybrid * coarsen_type)); + HYPRE_BoomerAMGSetMeasureType(pcg_precond, measure_type); + HYPRE_BoomerAMGSetStrongThreshold(pcg_precond, strong_threshold); + HYPRE_BoomerAMGSetTruncFactor(pcg_precond, trunc_factor); + HYPRE_BoomerAMGSetPrintLevel(pcg_precond, poutdat); + HYPRE_BoomerAMGSetPrintFileName(pcg_precond, "driver.out.log"); + HYPRE_BoomerAMGSetMaxIter(pcg_precond, 1); + HYPRE_BoomerAMGSetCycleType(pcg_precond, cycle_type); + HYPRE_BoomerAMGSetNumGridSweeps(pcg_precond, num_grid_sweeps); + HYPRE_BoomerAMGSetGridRelaxType(pcg_precond, grid_relax_type); + HYPRE_BoomerAMGSetRelaxWeight(pcg_precond, relax_weight); + HYPRE_BoomerAMGSetOmega(pcg_precond, omega); + HYPRE_BoomerAMGSetSmoothType(pcg_precond, smooth_type); + HYPRE_BoomerAMGSetSmoothNumLevels(pcg_precond, smooth_num_levels); + HYPRE_BoomerAMGSetSmoothNumSweeps(pcg_precond, smooth_num_sweeps); + HYPRE_BoomerAMGSetVariant(pcg_precond, variant); + HYPRE_BoomerAMGSetOverlap(pcg_precond, overlap); + HYPRE_BoomerAMGSetDomainType(pcg_precond, domain_type); + HYPRE_BoomerAMGSetSchwarzRlxWeight(pcg_precond, schwarz_rlx_weight); + HYPRE_BoomerAMGSetGridRelaxPoints(pcg_precond, grid_relax_points); + HYPRE_BoomerAMGSetMaxLevels(pcg_precond, max_levels); + HYPRE_BoomerAMGSetMaxRowSum(pcg_precond, max_row_sum); + HYPRE_BoomerAMGSetNumFunctions(pcg_precond, num_functions); + if (num_functions > 1) + { + HYPRE_BoomerAMGSetDofFunc(pcg_precond, dof_func); + } + HYPRE_PCGSetPrecond(pcg_solver, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, + pcg_precond); + } + else if (solver_id == 43) + { + /* use Euclid preconditioning */ + if (myid == 0) { hypre_printf("Solver: Euclid-PCG\n"); } + + HYPRE_EuclidCreate(hypre_MPI_COMM_WORLD, &pcg_precond); + + /* note: There are three methods of setting run-time + parameters for Euclid: (see HYPRE_parcsr_ls.h); here + we'll use what I think is simplest: let Euclid internally + parse the command line. + */ + HYPRE_EuclidSetParams(pcg_precond, argc, argv); + + HYPRE_PCGSetPrecond(pcg_solver, + (HYPRE_PtrToSolverFcn) HYPRE_EuclidSolve, + (HYPRE_PtrToSolverFcn) HYPRE_EuclidSetup, + pcg_precond); + } + else if (solver_id != NO_SOLVER ) + { + if ( verbosity ) + { + hypre_printf("Solver ID not recognized - running inner PCG iterations without preconditioner\n\n"); + } + } + + HYPRE_PCGGetPrecond(pcg_solver, &pcg_precond_gotten); + if (pcg_precond_gotten != pcg_precond) + { + hypre_printf("HYPRE_ParCSRPCGGetPrecond got bad precond\n"); + return (-1); + } + else if (myid == 0) + { + hypre_printf("HYPRE_ParCSRPCGGetPrecond got good precond\n"); + } + + /* HYPRE_PCGSetup(pcg_solver, (HYPRE_Matrix)parcsr_A, + (HYPRE_Vector)b, (HYPRE_Vector)x); */ + + hypre_EndTiming(time_index); + hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + HYPRE_LOBPCGCreate(interpreter, &matvec_fn, &lobpcg_solver); + + HYPRE_LOBPCGSetMaxIter(lobpcg_solver, maxIterations); + HYPRE_LOBPCGSetPrecondUsageMode(lobpcg_solver, pcgMode); + HYPRE_LOBPCGSetTol(lobpcg_solver, tol); + HYPRE_LOBPCGSetPrintLevel(lobpcg_solver, verbosity); + + HYPRE_LOBPCGSetPrecond(lobpcg_solver, + (HYPRE_PtrToSolverFcn) HYPRE_PCGSolve, + (HYPRE_PtrToSolverFcn) HYPRE_PCGSetup, + pcg_solver); + + HYPRE_LOBPCGSetupT(lobpcg_solver, (HYPRE_Matrix)parcsr_A, + (HYPRE_Vector)x); + + HYPRE_LOBPCGSetup(lobpcg_solver, (HYPRE_Matrix)parcsr_A, + (HYPRE_Vector)b, (HYPRE_Vector)x); + + if ( lobpcgGen ) + HYPRE_LOBPCGSetupB(lobpcg_solver, (HYPRE_Matrix)parcsr_B, + (HYPRE_Vector)x); + + if ( vFromFileFlag ) + { + eigenvectors = mv_MultiVectorWrap( interpreter, + hypre_ParCSRMultiVectorRead(hypre_MPI_COMM_WORLD, + interpreter, + "vectors" ), 1); + hypre_assert( eigenvectors != NULL ); + blockSize = mv_MultiVectorWidth( eigenvectors ); + } + else + { + eigenvectors = mv_MultiVectorCreateFromSampleVector( interpreter, + blockSize, + x ); + if ( lobpcgSeed ) + { + mv_MultiVectorSetRandom( eigenvectors, lobpcgSeed ); + } + else + { + mv_MultiVectorSetRandom( eigenvectors, (HYPRE_Int)time(0) ); + } + } + + if ( constrained ) + { + constraints = mv_MultiVectorWrap( interpreter, + hypre_ParCSRMultiVectorRead(hypre_MPI_COMM_WORLD, + interpreter, + "vectors" ), 1); + hypre_assert( constraints != NULL ); + } + + eigenvalues = hypre_CTAlloc(HYPRE_Real, blockSize, HYPRE_MEMORY_HOST); + + time_index = hypre_InitializeTiming("LOBPCG Solve"); + hypre_BeginTiming(time_index); + + HYPRE_LOBPCGSolve(lobpcg_solver, constraints, eigenvectors, eigenvalues ); + + hypre_EndTiming(time_index); + hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + + if ( checkOrtho ) + { + + gramXX = utilities_FortranMatrixCreate(); + identity = utilities_FortranMatrixCreate(); + + utilities_FortranMatrixAllocateData( blockSize, blockSize, gramXX ); + utilities_FortranMatrixAllocateData( blockSize, blockSize, identity ); + + if ( lobpcgGen ) + { + workspace = mv_MultiVectorCreateCopy( eigenvectors, 0 ); + hypre_LOBPCGMultiOperatorB( lobpcg_solver, + mv_MultiVectorGetData(eigenvectors), + mv_MultiVectorGetData(workspace) ); + lobpcg_MultiVectorByMultiVector( eigenvectors, workspace, gramXX ); + } + else + { + lobpcg_MultiVectorByMultiVector( eigenvectors, eigenvectors, gramXX ); + } + + utilities_FortranMatrixSetToIdentity( identity ); + utilities_FortranMatrixAdd( -1, identity, gramXX, gramXX ); + nonOrthF = utilities_FortranMatrixFNorm( gramXX ); + if ( myid == 0 ) + { + hypre_printf("Non-orthonormality of eigenvectors: %12.5e\n", nonOrthF); + } + + utilities_FortranMatrixDestroy( gramXX ); + utilities_FortranMatrixDestroy( identity ); + + } + + if ( printLevel ) + { - HYPRE_BoomerAMGSetup(amg_solver, parcsr_A, b, x); + hypre_ParCSRMultiVectorPrint( mv_MultiVectorGetData(eigenvectors), "vectors" ); - hypre_EndTiming(time_index); - hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + if ( myid == 0 ) + { + if ( (filePtr = fopen("values.txt", "w")) ) + { + hypre_fprintf(filePtr, "%d\n", blockSize); + for ( i = 0; i < blockSize; i++ ) + { + hypre_fprintf(filePtr, "%22.14e\n", eigenvalues[i]); + } + fclose(filePtr); + } + + if ( (filePtr = fopen("residuals.txt", "w")) ) + { + residualNorms = HYPRE_LOBPCGResidualNorms( lobpcg_solver ); + residuals = utilities_FortranMatrixValues( residualNorms ); + hypre_fprintf(filePtr, "%d\n", blockSize); + for ( i = 0; i < blockSize; i++ ) + { + hypre_fprintf(filePtr, "%22.14e\n", residuals[i]); + } + fclose(filePtr); + } + + if ( printLevel > 1 ) + { + + printBuffer = utilities_FortranMatrixCreate(); + + iterations = HYPRE_LOBPCGIterations( lobpcg_solver ); + + eigenvaluesHistory = HYPRE_LOBPCGEigenvaluesHistory( lobpcg_solver ); + utilities_FortranMatrixSelectBlock( eigenvaluesHistory, + 1, blockSize, 1, iterations + 1, printBuffer ); + utilities_FortranMatrixPrint( printBuffer, "val_hist.txt" ); + + residualNormsHistory = HYPRE_LOBPCGResidualNormsHistory( lobpcg_solver ); + utilities_FortranMatrixSelectBlock(residualNormsHistory, + 1, blockSize, 1, iterations + 1, printBuffer ); + utilities_FortranMatrixPrint( printBuffer, "res_hist.txt" ); + + utilities_FortranMatrixDestroy( printBuffer ); + } + } + } - time_index = hypre_InitializeTiming("BoomerAMG Solve"); - hypre_BeginTiming(time_index); + HYPRE_LOBPCGDestroy(lobpcg_solver); + mv_MultiVectorDestroy( eigenvectors ); + if ( constrained ) + { + mv_MultiVectorDestroy( constraints ); + } + if ( lobpcgGen ) + { + mv_MultiVectorDestroy( workspace ); + } + hypre_TFree(eigenvalues, HYPRE_MEMORY_HOST); - HYPRE_BoomerAMGSolve(amg_solver, parcsr_A, b, x); + HYPRE_ParCSRPCGDestroy(pcg_solver); - hypre_EndTiming(time_index); - hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + if (solver_id == 1) + { + HYPRE_BoomerAMGDestroy(pcg_precond); + } + else if (solver_id == 8) + { + HYPRE_ParaSailsDestroy(pcg_precond); + } + else if (solver_id == 12) + { + HYPRE_SchwarzDestroy(pcg_precond); + } + else if (solver_id == 14) + { + HYPRE_BoomerAMGDestroy(pcg_precond); + } + else if (solver_id == 43) + { + HYPRE_EuclidDestroy(pcg_precond); + } -#if SECOND_TIME - /* run a second time to check for memory leaks */ - HYPRE_ParVectorSetRandomValues(x, 775); - HYPRE_BoomerAMGSetup(amg_solver, parcsr_A, b, x); - HYPRE_BoomerAMGSolve(amg_solver, parcsr_A, b, x); -#endif + } + else /* pcgIterations <= 0 --> use the preconditioner directly */ + { - HYPRE_BoomerAMGDestroy(amg_solver); - } + time_index = hypre_InitializeTiming("LOBPCG Setup"); + hypre_BeginTiming(time_index); + if (myid != 0) + { + verbosity = 0; + } - if (solver_id == HYPRE_PARASAILS) - { - HYPRE_IJMatrix ij_M; - HYPRE_ParCSRMatrix parcsr_mat; + HYPRE_LOBPCGCreate(interpreter, &matvec_fn, &pcg_solver); + HYPRE_LOBPCGSetMaxIter(pcg_solver, maxIterations); + HYPRE_LOBPCGSetTol(pcg_solver, tol); + HYPRE_LOBPCGSetPrintLevel(pcg_solver, verbosity); - /* use ParaSails preconditioner */ - if (myid == 0) hypre_printf("Test ParaSails Build IJMatrix\n"); + HYPRE_LOBPCGGetPrecond(pcg_solver, &pcg_precond); - HYPRE_IJMatrixPrint(ij_A, "parasails.in"); + if (solver_id == 1) + { + /* use BoomerAMG as preconditioner */ + if (myid == 0) + { + hypre_printf("Solver: AMG-PCG\n"); + } - HYPRE_ParaSailsCreate(hypre_MPI_COMM_WORLD, &pcg_precond); - HYPRE_ParaSailsSetParams(pcg_precond, 0., 0); - HYPRE_ParaSailsSetFilter(pcg_precond, 0.); - HYPRE_ParaSailsSetLogging(pcg_precond, ioutdat); + HYPRE_BoomerAMGCreate(&pcg_precond); + HYPRE_BoomerAMGSetInterpType(pcg_precond, interp_type); + HYPRE_BoomerAMGSetNumSamples(pcg_precond, gsmg_samples); + HYPRE_BoomerAMGSetTol(pcg_precond, pc_tol); + HYPRE_BoomerAMGSetCoarsenType(pcg_precond, (hybrid * coarsen_type)); + HYPRE_BoomerAMGSetMeasureType(pcg_precond, measure_type); + HYPRE_BoomerAMGSetStrongThreshold(pcg_precond, strong_threshold); + HYPRE_BoomerAMGSetTruncFactor(pcg_precond, trunc_factor); + HYPRE_BoomerAMGSetPrintLevel(pcg_precond, poutdat); + HYPRE_BoomerAMGSetPrintFileName(pcg_precond, "driver.out.log"); + HYPRE_BoomerAMGSetMaxIter(pcg_precond, 1); + HYPRE_BoomerAMGSetCycleType(pcg_precond, cycle_type); + HYPRE_BoomerAMGSetNumGridSweeps(pcg_precond, num_grid_sweeps); + HYPRE_BoomerAMGSetGridRelaxType(pcg_precond, grid_relax_type); + HYPRE_BoomerAMGSetRelaxWeight(pcg_precond, relax_weight); + HYPRE_BoomerAMGSetOmega(pcg_precond, omega); + HYPRE_BoomerAMGSetSmoothType(pcg_precond, smooth_type); + HYPRE_BoomerAMGSetSmoothNumLevels(pcg_precond, smooth_num_levels); + HYPRE_BoomerAMGSetSmoothNumSweeps(pcg_precond, smooth_num_sweeps); + HYPRE_BoomerAMGSetGridRelaxPoints(pcg_precond, grid_relax_points); + HYPRE_BoomerAMGSetMaxLevels(pcg_precond, max_levels); + HYPRE_BoomerAMGSetMaxRowSum(pcg_precond, max_row_sum); + HYPRE_BoomerAMGSetNumFunctions(pcg_precond, num_functions); + HYPRE_BoomerAMGSetVariant(pcg_precond, variant); + HYPRE_BoomerAMGSetOverlap(pcg_precond, overlap); + HYPRE_BoomerAMGSetDomainType(pcg_precond, domain_type); + HYPRE_BoomerAMGSetSchwarzRlxWeight(pcg_precond, schwarz_rlx_weight); + if (num_functions > 1) + { + HYPRE_BoomerAMGSetDofFunc(pcg_precond, dof_func); + } - HYPRE_IJMatrixGetObject( ij_A, &object); - parcsr_mat = (HYPRE_ParCSRMatrix) object; + HYPRE_LOBPCGSetPrecond(pcg_solver, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, + pcg_precond); + } + else if (solver_id == 2) + { - HYPRE_ParaSailsSetup(pcg_precond, parcsr_mat, NULL, NULL); - HYPRE_ParaSailsBuildIJMatrix(pcg_precond, &ij_M); - HYPRE_IJMatrixPrint(ij_M, "parasails.out"); + /* use diagonal scaling as preconditioner */ + if (myid == 0) + { + hypre_printf("Solver: DS-PCG\n"); + } - if (myid == 0) hypre_printf("Printed to parasails.out.\n"); - exit(0); - } + pcg_precond = NULL; - /*----------------------------------------------------------- - * Solve the system using PCG - *-----------------------------------------------------------*/ + HYPRE_LOBPCGSetPrecond(pcg_solver, + (HYPRE_PtrToSolverFcn) HYPRE_ParCSRDiagScale, + (HYPRE_PtrToSolverFcn) HYPRE_ParCSRDiagScaleSetup, + pcg_precond); + } + else if (solver_id == 8) + { + /* use ParaSails preconditioner */ + if (myid == 0) + { + hypre_printf("Solver: ParaSails-PCG\n"); + } - /* begin lobpcg */ - if ( !lobpcgFlag && ( solver_id == HYPRE_PCG) ) - /*end lobpcg */ - { - time_index = hypre_InitializeTiming("PCG Setup"); - hypre_BeginTiming(time_index); - ioutdat = 2; + HYPRE_ParaSailsCreate(hypre_MPI_COMM_WORLD, &pcg_precond); + HYPRE_ParaSailsSetParams(pcg_precond, sai_threshold, max_levels); + HYPRE_ParaSailsSetFilter(pcg_precond, sai_filter); + HYPRE_ParaSailsSetLogging(pcg_precond, poutdat); - HYPRE_ParCSRPCGCreate(hypre_MPI_COMM_WORLD, &pcg_solver); - HYPRE_PCGSetMaxIter(pcg_solver, 1000); - HYPRE_PCGSetTol(pcg_solver, tol); - HYPRE_PCGSetTwoNorm(pcg_solver, 1); - HYPRE_PCGSetRelChange(pcg_solver, 0); - HYPRE_PCGSetPrintLevel(pcg_solver, ioutdat); + HYPRE_LOBPCGSetPrecond(pcg_solver, + (HYPRE_PtrToSolverFcn) HYPRE_ParaSailsSolve, + (HYPRE_PtrToSolverFcn) HYPRE_ParaSailsSetup, + pcg_precond); + } + else if (solver_id == 12) + { + /* use Schwarz preconditioner */ + if (myid == 0) + { + hypre_printf("Solver: Schwarz-PCG\n"); + } - if (precond_id == HYPRE_EUCLID) - { - /* use Euclid preconditioning */ - if (myid == 0) hypre_printf("Solver: Euclid-PCG\n"); + HYPRE_SchwarzCreate(&pcg_precond); + HYPRE_SchwarzSetVariant(pcg_precond, variant); + HYPRE_SchwarzSetOverlap(pcg_precond, overlap); + HYPRE_SchwarzSetDomainType(pcg_precond, domain_type); + HYPRE_SchwarzSetRelaxWeight(pcg_precond, schwarz_rlx_weight); - HYPRE_EuclidCreate(hypre_MPI_COMM_WORLD, &pcg_precond); + HYPRE_LOBPCGSetPrecond(pcg_solver, + (HYPRE_PtrToSolverFcn) HYPRE_SchwarzSolve, + (HYPRE_PtrToSolverFcn) HYPRE_SchwarzSetup, + pcg_precond); + } + else if (solver_id == 14) + { + /* use GSMG as preconditioner */ - /* note: There are three three methods of setting run-time - parameters for Euclid: (see HYPRE_parcsr_ls.h); here - we'll use what I think is simplest: let Euclid internally - parse the command line. - */ - HYPRE_EuclidSetParams(pcg_precond, argc, argv); + /* reset some smoother parameters */ - HYPRE_PCGSetPrecond(pcg_solver, - (HYPRE_PtrToSolverFcn) HYPRE_EuclidSolve, - (HYPRE_PtrToSolverFcn) HYPRE_EuclidSetup, - pcg_precond); - } - else - hypre_set_precond(matrix_id, solver_id, precond_id, pcg_solver, pcg_precond); + /* fine grid */ + num_grid_sweeps[0] = num_sweep; + grid_relax_type[0] = relax_default; + hypre_TFree(grid_relax_points[0], HYPRE_MEMORY_HOST); + grid_relax_points[0] = hypre_CTAlloc(HYPRE_Int, num_sweep, HYPRE_MEMORY_HOST); + for (i = 0; i < num_sweep; i++) + { + grid_relax_points[0][i] = 0; + } - HYPRE_PCGGetPrecond(pcg_solver, &pcg_precond_gotten); - if (pcg_precond_gotten != pcg_precond) - { - hypre_printf("HYPRE_ParCSRPCGGetPrecond got bad precond\n"); - return(-1); - } - else - if (myid == 0) - hypre_printf("HYPRE_ParCSRPCGGetPrecond got good precond\n"); + /* down cycle */ + num_grid_sweeps[1] = num_sweep; + grid_relax_type[1] = relax_default; + hypre_TFree(grid_relax_points[1], HYPRE_MEMORY_HOST); + grid_relax_points[1] = hypre_CTAlloc(HYPRE_Int, num_sweep, HYPRE_MEMORY_HOST); + for (i = 0; i < num_sweep; i++) + { + grid_relax_points[1][i] = 0; + } - HYPRE_PCGSetup(pcg_solver, (HYPRE_Matrix)parcsr_A, - (HYPRE_Vector)b, (HYPRE_Vector)x); + /* up cycle */ + num_grid_sweeps[2] = num_sweep; + grid_relax_type[2] = relax_default; + hypre_TFree(grid_relax_points[2], HYPRE_MEMORY_HOST); + grid_relax_points[2] = hypre_CTAlloc(HYPRE_Int, num_sweep, HYPRE_MEMORY_HOST); + for (i = 0; i < num_sweep; i++) + { + grid_relax_points[2][i] = 0; + } - hypre_EndTiming(time_index); - hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + /* coarsest grid */ + num_grid_sweeps[3] = 1; + grid_relax_type[3] = 9; + hypre_TFree(grid_relax_points[3], HYPRE_MEMORY_HOST); + grid_relax_points[3] = hypre_CTAlloc(HYPRE_Int, 1, HYPRE_MEMORY_HOST); + grid_relax_points[3][0] = 0; + + if (myid == 0) { hypre_printf("Solver: GSMG-PCG\n"); } + HYPRE_BoomerAMGCreate(&pcg_precond); + HYPRE_BoomerAMGSetGSMG(pcg_precond, 4); + HYPRE_BoomerAMGSetInterpType(pcg_precond, interp_type); + HYPRE_BoomerAMGSetNumSamples(pcg_precond, gsmg_samples); + HYPRE_BoomerAMGSetTol(pcg_precond, pc_tol); + HYPRE_BoomerAMGSetCoarsenType(pcg_precond, (hybrid * coarsen_type)); + HYPRE_BoomerAMGSetMeasureType(pcg_precond, measure_type); + HYPRE_BoomerAMGSetStrongThreshold(pcg_precond, strong_threshold); + HYPRE_BoomerAMGSetTruncFactor(pcg_precond, trunc_factor); + HYPRE_BoomerAMGSetPrintLevel(pcg_precond, poutdat); + HYPRE_BoomerAMGSetPrintFileName(pcg_precond, "driver.out.log"); + HYPRE_BoomerAMGSetMaxIter(pcg_precond, 1); + HYPRE_BoomerAMGSetCycleType(pcg_precond, cycle_type); + HYPRE_BoomerAMGSetNumGridSweeps(pcg_precond, num_grid_sweeps); + HYPRE_BoomerAMGSetGridRelaxType(pcg_precond, grid_relax_type); + HYPRE_BoomerAMGSetRelaxWeight(pcg_precond, relax_weight); + HYPRE_BoomerAMGSetOmega(pcg_precond, omega); + HYPRE_BoomerAMGSetSmoothType(pcg_precond, smooth_type); + HYPRE_BoomerAMGSetSmoothNumLevels(pcg_precond, smooth_num_levels); + HYPRE_BoomerAMGSetSmoothNumSweeps(pcg_precond, smooth_num_sweeps); + HYPRE_BoomerAMGSetVariant(pcg_precond, variant); + HYPRE_BoomerAMGSetOverlap(pcg_precond, overlap); + HYPRE_BoomerAMGSetDomainType(pcg_precond, domain_type); + HYPRE_BoomerAMGSetSchwarzRlxWeight(pcg_precond, schwarz_rlx_weight); + HYPRE_BoomerAMGSetGridRelaxPoints(pcg_precond, grid_relax_points); + HYPRE_BoomerAMGSetMaxLevels(pcg_precond, max_levels); + HYPRE_BoomerAMGSetMaxRowSum(pcg_precond, max_row_sum); + HYPRE_BoomerAMGSetNumFunctions(pcg_precond, num_functions); + if (num_functions > 1) + { + HYPRE_BoomerAMGSetDofFunc(pcg_precond, dof_func); + } - time_index = hypre_InitializeTiming("PCG Solve"); - hypre_BeginTiming(time_index); + HYPRE_LOBPCGSetPrecond(pcg_solver, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, + pcg_precond); + } + else if (solver_id == 43) + { + /* use Euclid preconditioning */ + if (myid == 0) + { + hypre_printf("Solver: Euclid-PCG\n"); + } - HYPRE_PCGSolve(pcg_solver, (HYPRE_Matrix)parcsr_A, - (HYPRE_Vector)b, (HYPRE_Vector)x); + HYPRE_EuclidCreate(hypre_MPI_COMM_WORLD, &pcg_precond); - hypre_EndTiming(time_index); - hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + /* note: There are three methods of setting run-time + parameters for Euclid: (see HYPRE_parcsr_ls.h); here + we'll use what I think is simplest: let Euclid internally + parse the command line. + */ + HYPRE_EuclidSetParams(pcg_precond, argc, argv); - HYPRE_PCGGetNumIterations(pcg_solver, &num_iterations); - HYPRE_PCGGetFinalRelativeResidualNorm(pcg_solver, &final_res_norm); + HYPRE_LOBPCGSetPrecond(pcg_solver, + (HYPRE_PtrToSolverFcn) HYPRE_EuclidSolve, + (HYPRE_PtrToSolverFcn) HYPRE_EuclidSetup, + pcg_precond); + } + else if (solver_id != NO_SOLVER ) + { + if ( verbosity ) + { + hypre_printf("Solver ID not recognized - running LOBPCG without preconditioner\n\n"); + } + } -#if SECOND_TIME - /* run a second time to check for memory leaks */ - HYPRE_ParVectorSetRandomValues(x, 775); - HYPRE_PCGSetup(pcg_solver, (HYPRE_Matrix)parcsr_A, - (HYPRE_Vector)b, (HYPRE_Vector)x); - HYPRE_PCGSolve(pcg_solver, (HYPRE_Matrix)parcsr_A, - (HYPRE_Vector)b, (HYPRE_Vector)x); -#endif + HYPRE_LOBPCGGetPrecond(pcg_solver, &pcg_precond_gotten); + if (pcg_precond_gotten != pcg_precond && pcgIterations) + { + hypre_printf("HYPRE_ParCSRLOBPCGGetPrecond got bad precond\n"); + return (-1); + } + else if (myid == 0) + { + hypre_printf("HYPRE_ParCSRLOBPCGGetPrecond got good precond\n"); + } - HYPRE_ParCSRPCGDestroy(pcg_solver); + HYPRE_LOBPCGSetup(pcg_solver, (HYPRE_Matrix)parcsr_A, + (HYPRE_Vector)b, (HYPRE_Vector)x); - hypre_destroy_precond(precond_id, pcg_precond); + if ( lobpcgGen ) + HYPRE_LOBPCGSetupB(pcg_solver, (HYPRE_Matrix)parcsr_B, + (HYPRE_Vector)x); + hypre_EndTiming(time_index); + hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); - if (myid == 0) - { - hypre_printf("\n"); - hypre_printf("Iterations = %d\n", num_iterations); - hypre_printf("Final Relative Residual Norm = %e\n", final_res_norm); - hypre_printf("\n"); - } + if ( vFromFileFlag ) + { + eigenvectors = mv_MultiVectorWrap( interpreter, + hypre_ParCSRMultiVectorRead(hypre_MPI_COMM_WORLD, + interpreter, + "vectors" ), 1); + hypre_assert( eigenvectors != NULL ); + blockSize = mv_MultiVectorWidth( eigenvectors ); + } + else + { + eigenvectors = mv_MultiVectorCreateFromSampleVector( interpreter, + blockSize, + x ); + if ( lobpcgSeed ) + { + mv_MultiVectorSetRandom( eigenvectors, lobpcgSeed ); + } + else + { + mv_MultiVectorSetRandom( eigenvectors, (HYPRE_Int)time(0) ); + } + } - } + if ( constrained ) + { + constraints = mv_MultiVectorWrap( interpreter, + hypre_ParCSRMultiVectorRead(hypre_MPI_COMM_WORLD, + interpreter, + "vectors" ), 1); + hypre_assert( constraints != NULL ); + } - /* begin lobpcg */ + eigenvalues = hypre_CTAlloc(HYPRE_Real, blockSize, HYPRE_MEMORY_HOST); - /*----------------------------------------------------------- - * Solve the eigenvalue problem using LOBPCG - *-----------------------------------------------------------*/ + time_index = hypre_InitializeTiming("LOBPCG Solve"); + hypre_BeginTiming(time_index); - if ( lobpcgFlag ) { - - interpreter = hypre_CTAlloc(mv_InterfaceInterpreter, 1, HYPRE_MEMORY_HOST); - - HYPRE_ParCSRSetupInterpreter( interpreter ); - HYPRE_ParCSRSetupMatvec(&matvec_fn); - - if (myid != 0) - verbosity = 0; - - if ( lobpcgGen ) { - BuildParIsoLaplacian(argc, argv, &parcsr_B); - - ierr = HYPRE_ParCSRMatrixGetLocalRange( parcsr_B, - &first_local_row, &last_local_row , - &first_local_col, &last_local_col ); - - local_num_rows = last_local_row - first_local_row + 1; - local_num_cols = last_local_col - first_local_col + 1; - ierr += HYPRE_ParCSRMatrixGetDims( parcsr_B, &M, &N ); - - ierr += HYPRE_IJMatrixCreate( comm, first_local_row, last_local_row, - first_local_col, last_local_col, - &ij_B ); - - ierr += HYPRE_IJMatrixSetObjectType( ij_B, HYPRE_PARCSR ); - - if (sparsity_known == 1) { - diag_sizes = hypre_CTAlloc(HYPRE_Int, local_num_rows, HYPRE_MEMORY_HOST); - offdiag_sizes = hypre_CTAlloc(HYPRE_Int, local_num_rows, HYPRE_MEMORY_HOST); - local_row = 0; - for (i=first_local_row; i<= last_local_row; i++) { - ierr += HYPRE_ParCSRMatrixGetRow( parcsr_B, i, &size, - &col_inds, &values ); - for (j=0; j < size; j++) - { - if (col_inds[j] < first_local_row || col_inds[j] > last_local_row) - offdiag_sizes[local_row]++; - else - diag_sizes[local_row]++; - } - local_row++; - ierr += HYPRE_ParCSRMatrixRestoreRow( parcsr_B, i, &size, - &col_inds, &values ); - } - ierr += HYPRE_IJMatrixSetDiagOffdSizes( ij_B, - (const HYPRE_Int *) diag_sizes, - (const HYPRE_Int *) offdiag_sizes ); - hypre_TFree(diag_sizes, HYPRE_MEMORY_HOST); - hypre_TFree(offdiag_sizes, HYPRE_MEMORY_HOST); - - ierr = HYPRE_IJMatrixInitialize( ij_B ); - - for (i=first_local_row; i<= last_local_row; i++) - { - ierr += HYPRE_ParCSRMatrixGetRow( parcsr_B, i, &size, - &col_inds, &values ); - - ierr += HYPRE_IJMatrixSetValues( ij_B, 1, &size, &i, - (const HYPRE_Int *) col_inds, - (const HYPRE_Real *) values ); - - ierr += HYPRE_ParCSRMatrixRestoreRow( parcsr_B, i, &size, - &col_inds, &values ); - } - } - else - { - row_sizes = hypre_CTAlloc(HYPRE_Int, local_num_rows, HYPRE_MEMORY_HOST); - - size = 5; /* this is in general too low, and supposed to test - the capability of the reallocation of the interface */ + HYPRE_LOBPCGSolve(pcg_solver, constraints, eigenvectors, eigenvalues); - if (sparsity_known == 0) /* tries a more accurate estimate of the - storage */ - { - if (build_matrix_type == 2) size = 7; - if (build_matrix_type == 3) size = 9; - if (build_matrix_type == 4) size = 27; - } - - for (i=0; i < local_num_rows; i++) - row_sizes[i] = size; - - ierr = HYPRE_IJMatrixSetRowSizes ( ij_B, (const HYPRE_Int *) row_sizes ); - - hypre_TFree(row_sizes, HYPRE_MEMORY_HOST); - - ierr = HYPRE_IJMatrixInitialize( ij_B ); - - /* Loop through all locally stored rows and insert them into ij_matrix */ - for (i=first_local_row; i<= last_local_row; i++) - { - ierr += HYPRE_ParCSRMatrixGetRow( parcsr_B, i, &size, - &col_inds, &values ); - - ierr += HYPRE_IJMatrixSetValues( ij_B, 1, &size, &i, - (const HYPRE_Int *) col_inds, - (const HYPRE_Real *) values ); - - ierr += HYPRE_ParCSRMatrixRestoreRow( parcsr_B, i, &size, - &col_inds, &values ); - } - } - - ierr += HYPRE_IJMatrixAssemble( ij_B ); - - ierr += HYPRE_ParCSRMatrixDestroy(parcsr_B); - - ierr += HYPRE_IJMatrixGetObject( ij_B, &object); - parcsr_B = (HYPRE_ParCSRMatrix) object; - - } /* if ( lobpcgGen ) */ - - if ( pcgIterations > 0 ) { /* do inner pcg iterations */ - - time_index = hypre_InitializeTiming("PCG Setup"); - hypre_BeginTiming(time_index); - - HYPRE_ParCSRPCGCreate(hypre_MPI_COMM_WORLD, &pcg_solver); - HYPRE_PCGSetMaxIter(pcg_solver, pcgIterations); - HYPRE_PCGSetTol(pcg_solver, pcgTol); - HYPRE_PCGSetTwoNorm(pcg_solver, 1); - HYPRE_PCGSetRelChange(pcg_solver, 0); - HYPRE_PCGSetPrintLevel(pcg_solver, 0); - - HYPRE_PCGGetPrecond(pcg_solver, &pcg_precond); - - if (solver_id == 1) - { - /* use BoomerAMG as preconditioner */ - if (myid == 0) hypre_printf("Solver: AMG-PCG\n"); - HYPRE_BoomerAMGCreate(&pcg_precond); - HYPRE_BoomerAMGSetInterpType(pcg_precond, interp_type); - HYPRE_BoomerAMGSetNumSamples(pcg_precond, gsmg_samples); - HYPRE_BoomerAMGSetTol(pcg_precond, pc_tol); - HYPRE_BoomerAMGSetCoarsenType(pcg_precond, (hybrid*coarsen_type)); - HYPRE_BoomerAMGSetMeasureType(pcg_precond, measure_type); - HYPRE_BoomerAMGSetStrongThreshold(pcg_precond, strong_threshold); - HYPRE_BoomerAMGSetTruncFactor(pcg_precond, trunc_factor); - HYPRE_BoomerAMGSetPrintLevel(pcg_precond, poutdat); - HYPRE_BoomerAMGSetPrintFileName(pcg_precond, "driver.out.log"); - HYPRE_BoomerAMGSetMaxIter(pcg_precond, 1); - HYPRE_BoomerAMGSetCycleType(pcg_precond, cycle_type); - HYPRE_BoomerAMGSetNumGridSweeps(pcg_precond, num_grid_sweeps); - HYPRE_BoomerAMGSetGridRelaxType(pcg_precond, grid_relax_type); - HYPRE_BoomerAMGSetRelaxWeight(pcg_precond, relax_weight); - HYPRE_BoomerAMGSetOmega(pcg_precond, omega); - HYPRE_BoomerAMGSetSmoothType(pcg_precond, smooth_type); - HYPRE_BoomerAMGSetSmoothNumLevels(pcg_precond, smooth_num_levels); - HYPRE_BoomerAMGSetSmoothNumSweeps(pcg_precond, smooth_num_sweeps); - HYPRE_BoomerAMGSetGridRelaxPoints(pcg_precond, grid_relax_points); - HYPRE_BoomerAMGSetMaxLevels(pcg_precond, max_levels); - HYPRE_BoomerAMGSetMaxRowSum(pcg_precond, max_row_sum); - HYPRE_BoomerAMGSetNumFunctions(pcg_precond, num_functions); - HYPRE_BoomerAMGSetVariant(pcg_precond, variant); - HYPRE_BoomerAMGSetOverlap(pcg_precond, overlap); - HYPRE_BoomerAMGSetDomainType(pcg_precond, domain_type); - HYPRE_BoomerAMGSetSchwarzRlxWeight(pcg_precond, schwarz_rlx_weight); - if (num_functions > 1) - HYPRE_BoomerAMGSetDofFunc(pcg_precond, dof_func); - HYPRE_PCGSetPrecond(pcg_solver, - (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, - (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, - pcg_precond); - } - else if (solver_id == 2) - { - - /* use diagonal scaling as preconditioner */ - if (myid == 0) hypre_printf("Solver: DS-PCG\n"); - pcg_precond = NULL; - - HYPRE_PCGSetPrecond(pcg_solver, - (HYPRE_PtrToSolverFcn) HYPRE_ParCSRDiagScale, - (HYPRE_PtrToSolverFcn) HYPRE_ParCSRDiagScaleSetup, - pcg_precond); - } - else if (solver_id == 8) - { - /* use ParaSails preconditioner */ - if (myid == 0) hypre_printf("Solver: ParaSails-PCG\n"); - - HYPRE_ParaSailsCreate(hypre_MPI_COMM_WORLD, &pcg_precond); - HYPRE_ParaSailsSetParams(pcg_precond, sai_threshold, max_levels); - HYPRE_ParaSailsSetFilter(pcg_precond, sai_filter); - HYPRE_ParaSailsSetLogging(pcg_precond, poutdat); - - HYPRE_PCGSetPrecond(pcg_solver, - (HYPRE_PtrToSolverFcn) HYPRE_ParaSailsSolve, - (HYPRE_PtrToSolverFcn) HYPRE_ParaSailsSetup, - pcg_precond); - } - else if (solver_id == 12) - { - /* use Schwarz preconditioner */ - if (myid == 0) hypre_printf("Solver: Schwarz-PCG\n"); - - HYPRE_SchwarzCreate(&pcg_precond); - HYPRE_SchwarzSetVariant(pcg_precond, variant); - HYPRE_SchwarzSetOverlap(pcg_precond, overlap); - HYPRE_SchwarzSetDomainType(pcg_precond, domain_type); - HYPRE_SchwarzSetRelaxWeight(pcg_precond, schwarz_rlx_weight); - - HYPRE_PCGSetPrecond(pcg_solver, - (HYPRE_PtrToSolverFcn) HYPRE_SchwarzSolve, - (HYPRE_PtrToSolverFcn) HYPRE_SchwarzSetup, - pcg_precond); - } - else if (solver_id == 14) - { - /* use GSMG as preconditioner */ - - /* reset some smoother parameters */ - - /* fine grid */ - num_grid_sweeps[0] = num_sweep; - grid_relax_type[0] = relax_default; - hypre_TFree(grid_relax_points[0], HYPRE_MEMORY_HOST); - grid_relax_points[0] = hypre_CTAlloc(HYPRE_Int, num_sweep, HYPRE_MEMORY_HOST); - for (i=0; i 1) - HYPRE_BoomerAMGSetDofFunc(pcg_precond, dof_func); - HYPRE_PCGSetPrecond(pcg_solver, - (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, - (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, - pcg_precond); - } - else if (solver_id == 43) - { - /* use Euclid preconditioning */ - if (myid == 0) hypre_printf("Solver: Euclid-PCG\n"); - - HYPRE_EuclidCreate(hypre_MPI_COMM_WORLD, &pcg_precond); - - /* note: There are three three methods of setting run-time - parameters for Euclid: (see HYPRE_parcsr_ls.h); here - we'll use what I think is simplest: let Euclid internally - parse the command line. - */ - HYPRE_EuclidSetParams(pcg_precond, argc, argv); - - HYPRE_PCGSetPrecond(pcg_solver, - (HYPRE_PtrToSolverFcn) HYPRE_EuclidSolve, - (HYPRE_PtrToSolverFcn) HYPRE_EuclidSetup, - pcg_precond); - } - else if (solver_id != NO_SOLVER ) - { - if ( verbosity ) - hypre_printf("Solver ID not recognized - running inner PCG iterations without preconditioner\n\n"); - } - - HYPRE_PCGGetPrecond(pcg_solver, &pcg_precond_gotten); - if (pcg_precond_gotten != pcg_precond) - { - hypre_printf("HYPRE_ParCSRPCGGetPrecond got bad precond\n"); - return(-1); - } - else - if (myid == 0) - hypre_printf("HYPRE_ParCSRPCGGetPrecond got good precond\n"); - - /* HYPRE_PCGSetup(pcg_solver, (HYPRE_Matrix)parcsr_A, - (HYPRE_Vector)b, (HYPRE_Vector)x); */ - - hypre_EndTiming(time_index); - hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); - - HYPRE_LOBPCGCreate(interpreter, &matvec_fn, &lobpcg_solver); - - HYPRE_LOBPCGSetMaxIter(lobpcg_solver, maxIterations); - HYPRE_LOBPCGSetPrecondUsageMode(lobpcg_solver, pcgMode); - HYPRE_LOBPCGSetTol(lobpcg_solver, tol); - HYPRE_LOBPCGSetPrintLevel(lobpcg_solver, verbosity); - - HYPRE_LOBPCGSetPrecond(lobpcg_solver, - (HYPRE_PtrToSolverFcn) HYPRE_PCGSolve, - (HYPRE_PtrToSolverFcn) HYPRE_PCGSetup, - pcg_solver); - - HYPRE_LOBPCGSetupT(lobpcg_solver, (HYPRE_Matrix)parcsr_A, - (HYPRE_Vector)x); - - HYPRE_LOBPCGSetup(lobpcg_solver, (HYPRE_Matrix)parcsr_A, - (HYPRE_Vector)b, (HYPRE_Vector)x); - - if ( lobpcgGen ) - HYPRE_LOBPCGSetupB(lobpcg_solver, (HYPRE_Matrix)parcsr_B, - (HYPRE_Vector)x); - - if ( vFromFileFlag ) { - eigenvectors = mv_MultiVectorWrap( interpreter, - hypre_ParCSRMultiVectorRead(hypre_MPI_COMM_WORLD, - interpreter, - "vectors" ),1); - hypre_assert( eigenvectors != NULL ); - blockSize = mv_MultiVectorWidth( eigenvectors ); - } - else { - eigenvectors = mv_MultiVectorCreateFromSampleVector( interpreter, - blockSize, - x ); - if ( lobpcgSeed ) - mv_MultiVectorSetRandom( eigenvectors, lobpcgSeed ); - else - mv_MultiVectorSetRandom( eigenvectors, (HYPRE_Int)time(0) ); - } - - if ( constrained ) { - constraints = mv_MultiVectorWrap( interpreter, - hypre_ParCSRMultiVectorRead(hypre_MPI_COMM_WORLD, - interpreter, - "vectors" ),1); - hypre_assert( constraints != NULL ); - } - - eigenvalues = hypre_CTAlloc(HYPRE_Real, blockSize, HYPRE_MEMORY_HOST); - - time_index = hypre_InitializeTiming("LOBPCG Solve"); - hypre_BeginTiming(time_index); - - HYPRE_LOBPCGSolve(lobpcg_solver, constraints, eigenvectors, eigenvalues ); - - hypre_EndTiming(time_index); - hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); - - - if ( checkOrtho ) { - - gramXX = utilities_FortranMatrixCreate(); - identity = utilities_FortranMatrixCreate(); - - utilities_FortranMatrixAllocateData( blockSize, blockSize, gramXX ); - utilities_FortranMatrixAllocateData( blockSize, blockSize, identity ); - - if ( lobpcgGen ) { - workspace = mv_MultiVectorCreateCopy( eigenvectors, 0 ); - hypre_LOBPCGMultiOperatorB( lobpcg_solver, - mv_MultiVectorGetData(eigenvectors), - mv_MultiVectorGetData(workspace) ); - lobpcg_MultiVectorByMultiVector( eigenvectors, workspace, gramXX ); - } - else - lobpcg_MultiVectorByMultiVector( eigenvectors, eigenvectors, gramXX ); - - utilities_FortranMatrixSetToIdentity( identity ); - utilities_FortranMatrixAdd( -1, identity, gramXX, gramXX ); - nonOrthF = utilities_FortranMatrixFNorm( gramXX ); - if ( myid == 0 ) - hypre_printf("Non-orthonormality of eigenvectors: %12.5e\n", nonOrthF); - - utilities_FortranMatrixDestroy( gramXX ); - utilities_FortranMatrixDestroy( identity ); - - } - - if ( printLevel ) { - - hypre_ParCSRMultiVectorPrint( mv_MultiVectorGetData(eigenvectors), "vectors" ); - - if ( myid == 0 ) { - if ( (filePtr = fopen("values.txt", "w")) ) { - hypre_fprintf(filePtr, "%d\n", blockSize); - for ( i = 0; i < blockSize; i++ ) - hypre_fprintf(filePtr, "%22.14e\n", eigenvalues[i]); - fclose(filePtr); - } - - if ( (filePtr = fopen("residuals.txt", "w")) ) { - residualNorms = HYPRE_LOBPCGResidualNorms( lobpcg_solver ); - residuals = utilities_FortranMatrixValues( residualNorms ); - hypre_fprintf(filePtr, "%d\n", blockSize); - for ( i = 0; i < blockSize; i++ ) - hypre_fprintf(filePtr, "%22.14e\n", residuals[i]); - fclose(filePtr); - } - - if ( printLevel > 1 ) { - - printBuffer = utilities_FortranMatrixCreate(); - - iterations = HYPRE_LOBPCGIterations( lobpcg_solver ); - - eigenvaluesHistory = HYPRE_LOBPCGEigenvaluesHistory( lobpcg_solver ); - utilities_FortranMatrixSelectBlock( eigenvaluesHistory, - 1, blockSize, 1, iterations + 1, printBuffer ); - utilities_FortranMatrixPrint( printBuffer, "val_hist.txt" ); - - residualNormsHistory = HYPRE_LOBPCGResidualNormsHistory( lobpcg_solver ); - utilities_FortranMatrixSelectBlock(residualNormsHistory, - 1, blockSize, 1, iterations + 1, printBuffer ); - utilities_FortranMatrixPrint( printBuffer, "res_hist.txt" ); - - utilities_FortranMatrixDestroy( printBuffer ); - } - } - } - - HYPRE_LOBPCGDestroy(lobpcg_solver); - mv_MultiVectorDestroy( eigenvectors ); - if ( constrained ) - mv_MultiVectorDestroy( constraints ); - if ( lobpcgGen ) - mv_MultiVectorDestroy( workspace ); - hypre_TFree(eigenvalues, HYPRE_MEMORY_HOST); - - HYPRE_ParCSRPCGDestroy(pcg_solver); - - if (solver_id == 1) - { - HYPRE_BoomerAMGDestroy(pcg_precond); - } - else if (solver_id == 8) - { - HYPRE_ParaSailsDestroy(pcg_precond); - } - else if (solver_id == 12) - { - HYPRE_SchwarzDestroy(pcg_precond); - } - else if (solver_id == 14) - { - HYPRE_BoomerAMGDestroy(pcg_precond); - } - else if (solver_id == 43) - { - HYPRE_EuclidDestroy(pcg_precond); - } - - } - else { /* pcgIterations <= 0 --> use the preconditioner directly */ - - time_index = hypre_InitializeTiming("LOBPCG Setup"); - hypre_BeginTiming(time_index); - if (myid != 0) - verbosity = 0; - - HYPRE_LOBPCGCreate(interpreter, &matvec_fn, &pcg_solver); - HYPRE_LOBPCGSetMaxIter(pcg_solver, maxIterations); - HYPRE_LOBPCGSetTol(pcg_solver, tol); - HYPRE_LOBPCGSetPrintLevel(pcg_solver, verbosity); - - HYPRE_LOBPCGGetPrecond(pcg_solver, &pcg_precond); - - if (solver_id == 1) - { - /* use BoomerAMG as preconditioner */ - if (myid == 0) - hypre_printf("Solver: AMG-PCG\n"); - - HYPRE_BoomerAMGCreate(&pcg_precond); - HYPRE_BoomerAMGSetInterpType(pcg_precond, interp_type); - HYPRE_BoomerAMGSetNumSamples(pcg_precond, gsmg_samples); - HYPRE_BoomerAMGSetTol(pcg_precond, pc_tol); - HYPRE_BoomerAMGSetCoarsenType(pcg_precond, (hybrid*coarsen_type)); - HYPRE_BoomerAMGSetMeasureType(pcg_precond, measure_type); - HYPRE_BoomerAMGSetStrongThreshold(pcg_precond, strong_threshold); - HYPRE_BoomerAMGSetTruncFactor(pcg_precond, trunc_factor); - HYPRE_BoomerAMGSetPrintLevel(pcg_precond, poutdat); - HYPRE_BoomerAMGSetPrintFileName(pcg_precond, "driver.out.log"); - HYPRE_BoomerAMGSetMaxIter(pcg_precond, 1); - HYPRE_BoomerAMGSetCycleType(pcg_precond, cycle_type); - HYPRE_BoomerAMGSetNumGridSweeps(pcg_precond, num_grid_sweeps); - HYPRE_BoomerAMGSetGridRelaxType(pcg_precond, grid_relax_type); - HYPRE_BoomerAMGSetRelaxWeight(pcg_precond, relax_weight); - HYPRE_BoomerAMGSetOmega(pcg_precond, omega); - HYPRE_BoomerAMGSetSmoothType(pcg_precond, smooth_type); - HYPRE_BoomerAMGSetSmoothNumLevels(pcg_precond, smooth_num_levels); - HYPRE_BoomerAMGSetSmoothNumSweeps(pcg_precond, smooth_num_sweeps); - HYPRE_BoomerAMGSetGridRelaxPoints(pcg_precond, grid_relax_points); - HYPRE_BoomerAMGSetMaxLevels(pcg_precond, max_levels); - HYPRE_BoomerAMGSetMaxRowSum(pcg_precond, max_row_sum); - HYPRE_BoomerAMGSetNumFunctions(pcg_precond, num_functions); - HYPRE_BoomerAMGSetVariant(pcg_precond, variant); - HYPRE_BoomerAMGSetOverlap(pcg_precond, overlap); - HYPRE_BoomerAMGSetDomainType(pcg_precond, domain_type); - HYPRE_BoomerAMGSetSchwarzRlxWeight(pcg_precond, schwarz_rlx_weight); - if (num_functions > 1) - HYPRE_BoomerAMGSetDofFunc(pcg_precond, dof_func); - - HYPRE_LOBPCGSetPrecond(pcg_solver, - (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, - (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, - pcg_precond); - } - else if (solver_id == 2) - { - - /* use diagonal scaling as preconditioner */ - if (myid == 0) - hypre_printf("Solver: DS-PCG\n"); - - pcg_precond = NULL; - - HYPRE_LOBPCGSetPrecond(pcg_solver, - (HYPRE_PtrToSolverFcn) HYPRE_ParCSRDiagScale, - (HYPRE_PtrToSolverFcn) HYPRE_ParCSRDiagScaleSetup, - pcg_precond); - } - else if (solver_id == 8) - { - /* use ParaSails preconditioner */ - if (myid == 0) - hypre_printf("Solver: ParaSails-PCG\n"); - - HYPRE_ParaSailsCreate(hypre_MPI_COMM_WORLD, &pcg_precond); - HYPRE_ParaSailsSetParams(pcg_precond, sai_threshold, max_levels); - HYPRE_ParaSailsSetFilter(pcg_precond, sai_filter); - HYPRE_ParaSailsSetLogging(pcg_precond, poutdat); - - HYPRE_LOBPCGSetPrecond(pcg_solver, - (HYPRE_PtrToSolverFcn) HYPRE_ParaSailsSolve, - (HYPRE_PtrToSolverFcn) HYPRE_ParaSailsSetup, - pcg_precond); - } - else if (solver_id == 12) - { - /* use Schwarz preconditioner */ - if (myid == 0) - hypre_printf("Solver: Schwarz-PCG\n"); - - HYPRE_SchwarzCreate(&pcg_precond); - HYPRE_SchwarzSetVariant(pcg_precond, variant); - HYPRE_SchwarzSetOverlap(pcg_precond, overlap); - HYPRE_SchwarzSetDomainType(pcg_precond, domain_type); - HYPRE_SchwarzSetRelaxWeight(pcg_precond, schwarz_rlx_weight); - - HYPRE_LOBPCGSetPrecond(pcg_solver, - (HYPRE_PtrToSolverFcn) HYPRE_SchwarzSolve, - (HYPRE_PtrToSolverFcn) HYPRE_SchwarzSetup, - pcg_precond); - } - else if (solver_id == 14) - { - /* use GSMG as preconditioner */ - - /* reset some smoother parameters */ - - /* fine grid */ - num_grid_sweeps[0] = num_sweep; - grid_relax_type[0] = relax_default; - hypre_TFree(grid_relax_points[0], HYPRE_MEMORY_HOST); - grid_relax_points[0] = hypre_CTAlloc(HYPRE_Int, num_sweep, HYPRE_MEMORY_HOST); - for (i=0; i 1) - HYPRE_BoomerAMGSetDofFunc(pcg_precond, dof_func); - - HYPRE_LOBPCGSetPrecond(pcg_solver, - (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, - (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, - pcg_precond); - } - else if (solver_id == 43) - { - /* use Euclid preconditioning */ - if (myid == 0) - hypre_printf("Solver: Euclid-PCG\n"); - - HYPRE_EuclidCreate(hypre_MPI_COMM_WORLD, &pcg_precond); - - /* note: There are three three methods of setting run-time - parameters for Euclid: (see HYPRE_parcsr_ls.h); here - we'll use what I think is simplest: let Euclid internally - parse the command line. - */ - HYPRE_EuclidSetParams(pcg_precond, argc, argv); - - HYPRE_LOBPCGSetPrecond(pcg_solver, - (HYPRE_PtrToSolverFcn) HYPRE_EuclidSolve, - (HYPRE_PtrToSolverFcn) HYPRE_EuclidSetup, - pcg_precond); - } - else if (solver_id != NO_SOLVER ) - { - if ( verbosity ) - hypre_printf("Solver ID not recognized - running LOBPCG without preconditioner\n\n"); - } - - HYPRE_LOBPCGGetPrecond(pcg_solver, &pcg_precond_gotten); - if (pcg_precond_gotten != pcg_precond && pcgIterations) - { - hypre_printf("HYPRE_ParCSRLOBPCGGetPrecond got bad precond\n"); - return(-1); - } - else - if (myid == 0) - hypre_printf("HYPRE_ParCSRLOBPCGGetPrecond got good precond\n"); - - HYPRE_LOBPCGSetup(pcg_solver, (HYPRE_Matrix)parcsr_A, - (HYPRE_Vector)b, (HYPRE_Vector)x); - - if ( lobpcgGen ) - HYPRE_LOBPCGSetupB(pcg_solver, (HYPRE_Matrix)parcsr_B, - (HYPRE_Vector)x); - - hypre_EndTiming(time_index); - hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); - - if ( vFromFileFlag ) { - eigenvectors = mv_MultiVectorWrap( interpreter, - hypre_ParCSRMultiVectorRead(hypre_MPI_COMM_WORLD, - interpreter, - "vectors" ),1); - hypre_assert( eigenvectors != NULL ); - blockSize = mv_MultiVectorWidth( eigenvectors ); - } - else { - eigenvectors = mv_MultiVectorCreateFromSampleVector( interpreter, - blockSize, - x ); - if ( lobpcgSeed ) - mv_MultiVectorSetRandom( eigenvectors, lobpcgSeed ); - else - mv_MultiVectorSetRandom( eigenvectors, (HYPRE_Int)time(0) ); - } - - if ( constrained ) { - constraints = mv_MultiVectorWrap( interpreter, - hypre_ParCSRMultiVectorRead(hypre_MPI_COMM_WORLD, - interpreter, - "vectors" ),1); - hypre_assert( constraints != NULL ); - } - - eigenvalues = hypre_CTAlloc(HYPRE_Real, blockSize, HYPRE_MEMORY_HOST); - - time_index = hypre_InitializeTiming("LOBPCG Solve"); - hypre_BeginTiming(time_index); - - HYPRE_LOBPCGSolve(pcg_solver, constraints, eigenvectors, eigenvalues); - - hypre_EndTiming(time_index); - hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); - - if ( checkOrtho ) { - - gramXX = utilities_FortranMatrixCreate(); - identity = utilities_FortranMatrixCreate(); - - utilities_FortranMatrixAllocateData( blockSize, blockSize, gramXX ); - utilities_FortranMatrixAllocateData( blockSize, blockSize, identity ); - - if ( lobpcgGen ) { - workspace = mv_MultiVectorCreateCopy( eigenvectors, 0 ); - hypre_LOBPCGMultiOperatorB( pcg_solver, - mv_MultiVectorGetData(eigenvectors), - mv_MultiVectorGetData(workspace) ); - lobpcg_MultiVectorByMultiVector( eigenvectors, workspace, gramXX ); - } - else - lobpcg_MultiVectorByMultiVector( eigenvectors, eigenvectors, gramXX ); - - utilities_FortranMatrixSetToIdentity( identity ); - utilities_FortranMatrixAdd( -1, identity, gramXX, gramXX ); - nonOrthF = utilities_FortranMatrixFNorm( gramXX ); - if ( myid == 0 ) - hypre_printf("Non-orthonormality of eigenvectors: %12.5e\n", nonOrthF); - - utilities_FortranMatrixDestroy( gramXX ); - utilities_FortranMatrixDestroy( identity ); - - } - - if ( printLevel ) { - - hypre_ParCSRMultiVectorPrint( mv_MultiVectorGetData(eigenvectors), "vectors" ); - - if ( myid == 0 ) { - if ( (filePtr = fopen("values.txt", "w")) ) { - hypre_fprintf(filePtr, "%d\n", blockSize); - for ( i = 0; i < blockSize; i++ ) - hypre_fprintf(filePtr, "%22.14e\n", eigenvalues[i]); - fclose(filePtr); - } + hypre_EndTiming(time_index); + hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + if ( checkOrtho ) + { + + gramXX = utilities_FortranMatrixCreate(); + identity = utilities_FortranMatrixCreate(); - if ( (filePtr = fopen("residuals.txt", "w")) ) { - residualNorms = HYPRE_LOBPCGResidualNorms( pcg_solver ); - residuals = utilities_FortranMatrixValues( residualNorms ); - hypre_fprintf(filePtr, "%d\n", blockSize); - for ( i = 0; i < blockSize; i++ ) - hypre_fprintf(filePtr, "%22.14e\n", residuals[i]); - fclose(filePtr); + utilities_FortranMatrixAllocateData( blockSize, blockSize, gramXX ); + utilities_FortranMatrixAllocateData( blockSize, blockSize, identity ); + + if ( lobpcgGen ) + { + workspace = mv_MultiVectorCreateCopy( eigenvectors, 0 ); + hypre_LOBPCGMultiOperatorB( pcg_solver, + mv_MultiVectorGetData(eigenvectors), + mv_MultiVectorGetData(workspace) ); + lobpcg_MultiVectorByMultiVector( eigenvectors, workspace, gramXX ); + } + else + { + lobpcg_MultiVectorByMultiVector( eigenvectors, eigenvectors, gramXX ); } - if ( printLevel > 1 ) { + utilities_FortranMatrixSetToIdentity( identity ); + utilities_FortranMatrixAdd( -1, identity, gramXX, gramXX ); + nonOrthF = utilities_FortranMatrixFNorm( gramXX ); + if ( myid == 0 ) + { + hypre_printf("Non-orthonormality of eigenvectors: %12.5e\n", nonOrthF); + } - printBuffer = utilities_FortranMatrixCreate(); + utilities_FortranMatrixDestroy( gramXX ); + utilities_FortranMatrixDestroy( identity ); - iterations = HYPRE_LOBPCGIterations( pcg_solver ); + } - eigenvaluesHistory = HYPRE_LOBPCGEigenvaluesHistory( pcg_solver ); - utilities_FortranMatrixSelectBlock( eigenvaluesHistory, - 1, blockSize, 1, iterations + 1, printBuffer ); - utilities_FortranMatrixPrint( printBuffer, "val_hist.txt" ); + if ( printLevel ) + { - residualNormsHistory = HYPRE_LOBPCGResidualNormsHistory( pcg_solver ); - utilities_FortranMatrixSelectBlock(residualNormsHistory, - 1, blockSize, 1, iterations + 1, printBuffer ); - utilities_FortranMatrixPrint( printBuffer, "res_hist.txt" ); + hypre_ParCSRMultiVectorPrint( mv_MultiVectorGetData(eigenvectors), "vectors" ); - utilities_FortranMatrixDestroy( printBuffer ); + if ( myid == 0 ) + { + if ( (filePtr = fopen("values.txt", "w")) ) + { + hypre_fprintf(filePtr, "%d\n", blockSize); + for ( i = 0; i < blockSize; i++ ) + { + hypre_fprintf(filePtr, "%22.14e\n", eigenvalues[i]); + } + fclose(filePtr); + } + + if ( (filePtr = fopen("residuals.txt", "w")) ) + { + residualNorms = HYPRE_LOBPCGResidualNorms( pcg_solver ); + residuals = utilities_FortranMatrixValues( residualNorms ); + hypre_fprintf(filePtr, "%d\n", blockSize); + for ( i = 0; i < blockSize; i++ ) + { + hypre_fprintf(filePtr, "%22.14e\n", residuals[i]); + } + fclose(filePtr); + } + + if ( printLevel > 1 ) + { + + printBuffer = utilities_FortranMatrixCreate(); + + iterations = HYPRE_LOBPCGIterations( pcg_solver ); + + eigenvaluesHistory = HYPRE_LOBPCGEigenvaluesHistory( pcg_solver ); + utilities_FortranMatrixSelectBlock( eigenvaluesHistory, + 1, blockSize, 1, iterations + 1, printBuffer ); + utilities_FortranMatrixPrint( printBuffer, "val_hist.txt" ); + + residualNormsHistory = HYPRE_LOBPCGResidualNormsHistory( pcg_solver ); + utilities_FortranMatrixSelectBlock(residualNormsHistory, + 1, blockSize, 1, iterations + 1, printBuffer ); + utilities_FortranMatrixPrint( printBuffer, "res_hist.txt" ); + + utilities_FortranMatrixDestroy( printBuffer ); + } } } - } #if SECOND_TIME - /* run a second time to check for memory leaks */ - mv_MultiVectorSetRandom( eigenvectors, 775 ); - HYPRE_LOBPCGSetup(pcg_solver, (HYPRE_Matrix)parcsr_A, - (HYPRE_Vector)b, (HYPRE_Vector)x); - HYPRE_LOBPCGSolve(pcg_solver, constraints, eigenvectors, eigenvalues ); + /* run a second time to check for memory leaks */ + mv_MultiVectorSetRandom( eigenvectors, 775 ); + HYPRE_LOBPCGSetup(pcg_solver, (HYPRE_Matrix)parcsr_A, + (HYPRE_Vector)b, (HYPRE_Vector)x); + HYPRE_LOBPCGSolve(pcg_solver, constraints, eigenvectors, eigenvalues ); #endif - HYPRE_LOBPCGDestroy(pcg_solver); - - if (solver_id == 1) - { - HYPRE_BoomerAMGDestroy(pcg_precond); - } - else if (solver_id == 8) - { - HYPRE_ParaSailsDestroy(pcg_precond); - } - else if (solver_id == 12) - { - HYPRE_SchwarzDestroy(pcg_precond); - } - else if (solver_id == 14) - { - HYPRE_BoomerAMGDestroy(pcg_precond); - } - else if (solver_id == 43) - { - HYPRE_EuclidDestroy(pcg_precond); - } - - mv_MultiVectorDestroy( eigenvectors ); - if ( constrained ) - mv_MultiVectorDestroy( constraints ); - if ( lobpcgGen ) - mv_MultiVectorDestroy( workspace ); - hypre_TFree(eigenvalues, HYPRE_MEMORY_HOST); - } /* if ( pcgIterations > 0 ) */ - - hypre_TFree( interpreter , HYPRE_MEMORY_HOST); - - if ( lobpcgGen ) - HYPRE_IJMatrixDestroy(ij_B); + HYPRE_LOBPCGDestroy(pcg_solver); + + if (solver_id == 1) + { + HYPRE_BoomerAMGDestroy(pcg_precond); + } + else if (solver_id == 8) + { + HYPRE_ParaSailsDestroy(pcg_precond); + } + else if (solver_id == 12) + { + HYPRE_SchwarzDestroy(pcg_precond); + } + else if (solver_id == 14) + { + HYPRE_BoomerAMGDestroy(pcg_precond); + } + else if (solver_id == 43) + { + HYPRE_EuclidDestroy(pcg_precond); + } + + mv_MultiVectorDestroy( eigenvectors ); + if ( constrained ) + { + mv_MultiVectorDestroy( constraints ); + } + if ( lobpcgGen ) + { + mv_MultiVectorDestroy( workspace ); + } + hypre_TFree(eigenvalues, HYPRE_MEMORY_HOST); + } /* if ( pcgIterations > 0 ) */ + + hypre_TFree( interpreter, HYPRE_MEMORY_HOST); + + if ( lobpcgGen ) + { + HYPRE_IJMatrixDestroy(ij_B); + } } /* if ( lobpcgFlag ) */ @@ -3156,13 +3335,13 @@ main( HYPRE_Int argc, if (solver_id == 3) { /* use BoomerAMG as preconditioner */ - if (myid == 0) hypre_printf("Solver: AMG-GMRES\n"); + if (myid == 0) { hypre_printf("Solver: AMG-GMRES\n"); } HYPRE_BoomerAMGCreate(&pcg_precond); HYPRE_BoomerAMGSetInterpType(pcg_precond, interp_type); HYPRE_BoomerAMGSetNumSamples(pcg_precond, gsmg_samples); HYPRE_BoomerAMGSetTol(pcg_precond, pc_tol); - HYPRE_BoomerAMGSetCoarsenType(pcg_precond, (hybrid*coarsen_type)); + HYPRE_BoomerAMGSetCoarsenType(pcg_precond, (hybrid * coarsen_type)); HYPRE_BoomerAMGSetMeasureType(pcg_precond, measure_type); HYPRE_BoomerAMGSetStrongThreshold(pcg_precond, strong_threshold); HYPRE_BoomerAMGSetTruncFactor(pcg_precond, trunc_factor); @@ -3185,7 +3364,9 @@ main( HYPRE_Int argc, HYPRE_BoomerAMGSetOverlap(pcg_precond, overlap); HYPRE_BoomerAMGSetDomainType(pcg_precond, domain_type); if (num_functions > 1) + { HYPRE_BoomerAMGSetDofFunc(pcg_precond, dof_func); + } HYPRE_GMRESSetPrecond(pcg_solver, (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, @@ -3194,7 +3375,7 @@ main( HYPRE_Int argc, else if (solver_id == 4) { /* use diagonal scaling as preconditioner */ - if (myid == 0) hypre_printf("Solver: DS-GMRES\n"); + if (myid == 0) { hypre_printf("Solver: DS-GMRES\n"); } pcg_precond = NULL; HYPRE_GMRESSetPrecond(pcg_solver, @@ -3205,10 +3386,11 @@ main( HYPRE_Int argc, else if (solver_id == 7) { /* use PILUT as preconditioner */ - if (myid == 0) hypre_printf("Solver: PILUT-GMRES\n"); + if (myid == 0) { hypre_printf("Solver: PILUT-GMRES\n"); } ierr = HYPRE_ParCSRPilutCreate( hypre_MPI_COMM_WORLD, &pcg_precond ); - if (ierr) { + if (ierr) + { hypre_printf("Error in ParPilutCreate\n"); } @@ -3219,11 +3401,11 @@ main( HYPRE_Int argc, if (drop_tol >= 0 ) HYPRE_ParCSRPilutSetDropTolerance( pcg_precond, - drop_tol ); + drop_tol ); if (nonzeros_to_keep >= 0 ) HYPRE_ParCSRPilutSetFactorRowSize( pcg_precond, - nonzeros_to_keep ); + nonzeros_to_keep ); } else if (solver_id == 15) { @@ -3236,24 +3418,30 @@ main( HYPRE_Int argc, grid_relax_type[0] = relax_default; hypre_TFree(grid_relax_points[0], HYPRE_MEMORY_HOST); grid_relax_points[0] = hypre_CTAlloc(HYPRE_Int, num_sweep, HYPRE_MEMORY_HOST); - for (i=0; i 1) + { HYPRE_BoomerAMGSetDofFunc(pcg_precond, dof_func); + } HYPRE_GMRESSetPrecond(pcg_solver, - (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, - (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, - pcg_precond); + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, + pcg_precond); } else if (solver_id == 18) { /* use ParaSails preconditioner */ - if (myid == 0) hypre_printf("Solver: ParaSails-GMRES\n"); + if (myid == 0) { hypre_printf("Solver: ParaSails-GMRES\n"); } HYPRE_ParaSailsCreate(hypre_MPI_COMM_WORLD, &pcg_precond); HYPRE_ParaSailsSetParams(pcg_precond, sai_threshold, max_levels); @@ -3317,11 +3507,11 @@ main( HYPRE_Int argc, else if (solver_id == 44) { /* use Euclid preconditioning */ - if (myid == 0) hypre_printf("Solver: Euclid-GMRES\n"); + if (myid == 0) { hypre_printf("Solver: Euclid-GMRES\n"); } HYPRE_EuclidCreate(hypre_MPI_COMM_WORLD, &pcg_precond); - /* note: There are three three methods of setting run-time + /* note: There are three methods of setting run-time parameters for Euclid: (see HYPRE_parcsr_ls.h); here we'll use what I think is simplest: let Euclid internally parse the command line. @@ -3337,14 +3527,15 @@ main( HYPRE_Int argc, HYPRE_GMRESGetPrecond(pcg_solver, &pcg_precond_gotten); if (pcg_precond_gotten != pcg_precond) { - hypre_printf("HYPRE_GMRESGetPrecond got bad precond\n"); - return(-1); + hypre_printf("HYPRE_GMRESGetPrecond got bad precond\n"); + return (-1); + } + else if (myid == 0) + { + hypre_printf("HYPRE_GMRESGetPrecond got good precond\n"); } - else - if (myid == 0) - hypre_printf("HYPRE_GMRESGetPrecond got good precond\n"); HYPRE_GMRESSetup - (pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, (HYPRE_Vector)x); + (pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, (HYPRE_Vector)x); hypre_EndTiming(time_index); hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); @@ -3355,7 +3546,7 @@ main( HYPRE_Int argc, hypre_BeginTiming(time_index); HYPRE_GMRESSolve - (pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, (HYPRE_Vector)x); + (pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, (HYPRE_Vector)x); hypre_EndTiming(time_index); hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); @@ -3363,14 +3554,14 @@ main( HYPRE_Int argc, hypre_ClearTiming(); HYPRE_GMRESGetNumIterations(pcg_solver, &num_iterations); - HYPRE_GMRESGetFinalRelativeResidualNorm(pcg_solver,&final_res_norm); + HYPRE_GMRESGetFinalRelativeResidualNorm(pcg_solver, &final_res_norm); #if SECOND_TIME /* run a second time to check for memory leaks */ HYPRE_ParVectorSetRandomValues(x, 775); HYPRE_GMRESSetup(pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, - (HYPRE_Vector)x); + (HYPRE_Vector)x); HYPRE_GMRESSolve(pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, - (HYPRE_Vector)x); + (HYPRE_Vector)x); #endif HYPRE_ParCSRGMRESDestroy(pcg_solver); @@ -3390,7 +3581,7 @@ main( HYPRE_Int argc, } else if (solver_id == 44) { - HYPRE_EuclidDestroy(pcg_precond); + HYPRE_EuclidDestroy(pcg_precond); } if (myid == 0) @@ -3420,12 +3611,12 @@ main( HYPRE_Int argc, if (solver_id == 9) { /* use BoomerAMG as preconditioner */ - if (myid == 0) hypre_printf("Solver: AMG-BiCGSTAB\n"); + if (myid == 0) { hypre_printf("Solver: AMG-BiCGSTAB\n"); } HYPRE_BoomerAMGCreate(&pcg_precond); HYPRE_BoomerAMGSetInterpType(pcg_precond, interp_type); HYPRE_BoomerAMGSetNumSamples(pcg_precond, gsmg_samples); HYPRE_BoomerAMGSetTol(pcg_precond, pc_tol); - HYPRE_BoomerAMGSetCoarsenType(pcg_precond, (hybrid*coarsen_type)); + HYPRE_BoomerAMGSetCoarsenType(pcg_precond, (hybrid * coarsen_type)); HYPRE_BoomerAMGSetMeasureType(pcg_precond, measure_type); HYPRE_BoomerAMGSetStrongThreshold(pcg_precond, strong_threshold); HYPRE_BoomerAMGSetTruncFactor(pcg_precond, trunc_factor); @@ -3448,7 +3639,9 @@ main( HYPRE_Int argc, HYPRE_BoomerAMGSetOverlap(pcg_precond, overlap); HYPRE_BoomerAMGSetDomainType(pcg_precond, domain_type); if (num_functions > 1) + { HYPRE_BoomerAMGSetDofFunc(pcg_precond, dof_func); + } HYPRE_BiCGSTABSetPrecond(pcg_solver, (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, @@ -3457,21 +3650,22 @@ main( HYPRE_Int argc, else if (solver_id == 10) { /* use diagonal scaling as preconditioner */ - if (myid == 0) hypre_printf("Solver: DS-BiCGSTAB\n"); + if (myid == 0) { hypre_printf("Solver: DS-BiCGSTAB\n"); } pcg_precond = NULL; HYPRE_BiCGSTABSetPrecond(pcg_solver, - (HYPRE_PtrToSolverFcn) HYPRE_ParCSRDiagScale, - (HYPRE_PtrToSolverFcn) HYPRE_ParCSRDiagScaleSetup, + (HYPRE_PtrToSolverFcn) HYPRE_ParCSRDiagScale, + (HYPRE_PtrToSolverFcn) HYPRE_ParCSRDiagScaleSetup, pcg_precond); } else if (solver_id == 11) { /* use PILUT as preconditioner */ - if (myid == 0) hypre_printf("Solver: PILUT-BiCGSTAB\n"); + if (myid == 0) { hypre_printf("Solver: PILUT-BiCGSTAB\n"); } ierr = HYPRE_ParCSRPilutCreate( hypre_MPI_COMM_WORLD, &pcg_precond ); - if (ierr) { + if (ierr) + { hypre_printf("Error in ParPilutCreate\n"); } @@ -3482,20 +3676,20 @@ main( HYPRE_Int argc, if (drop_tol >= 0 ) HYPRE_ParCSRPilutSetDropTolerance( pcg_precond, - drop_tol ); + drop_tol ); if (nonzeros_to_keep >= 0 ) HYPRE_ParCSRPilutSetFactorRowSize( pcg_precond, - nonzeros_to_keep ); + nonzeros_to_keep ); } else if (solver_id == 45) { /* use Euclid preconditioning */ - if (myid == 0) hypre_printf("Solver: Euclid-BICGSTAB\n"); + if (myid == 0) { hypre_printf("Solver: Euclid-BICGSTAB\n"); } HYPRE_EuclidCreate(hypre_MPI_COMM_WORLD, &pcg_precond); - /* note: There are three three methods of setting run-time + /* note: There are three methods of setting run-time parameters for Euclid: (see HYPRE_parcsr_ls.h); here we'll use what I think is simplest: let Euclid internally parse the command line. @@ -3509,7 +3703,7 @@ main( HYPRE_Int argc, } HYPRE_BiCGSTABSetup(pcg_solver, (HYPRE_Matrix)parcsr_A, - (HYPRE_Vector)b, (HYPRE_Vector)x); + (HYPRE_Vector)b, (HYPRE_Vector)x); hypre_EndTiming(time_index); hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); @@ -3520,7 +3714,7 @@ main( HYPRE_Int argc, hypre_BeginTiming(time_index); HYPRE_BiCGSTABSolve(pcg_solver, (HYPRE_Matrix)parcsr_A, - (HYPRE_Vector)b, (HYPRE_Vector)x); + (HYPRE_Vector)b, (HYPRE_Vector)x); hypre_EndTiming(time_index); hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); @@ -3528,14 +3722,14 @@ main( HYPRE_Int argc, hypre_ClearTiming(); HYPRE_BiCGSTABGetNumIterations(pcg_solver, &num_iterations); - HYPRE_BiCGSTABGetFinalRelativeResidualNorm(pcg_solver,&final_res_norm); + HYPRE_BiCGSTABGetFinalRelativeResidualNorm(pcg_solver, &final_res_norm); #if SECOND_TIME /* run a second time to check for memory leaks */ HYPRE_ParVectorSetRandomValues(x, 775); HYPRE_BiCGSTABSetup(pcg_solver, (HYPRE_Matrix)parcsr_A, - (HYPRE_Vector)b, (HYPRE_Vector)x); + (HYPRE_Vector)b, (HYPRE_Vector)x); HYPRE_BiCGSTABSolve(pcg_solver, (HYPRE_Matrix)parcsr_A, - (HYPRE_Vector)b, (HYPRE_Vector)x); + (HYPRE_Vector)b, (HYPRE_Vector)x); #endif HYPRE_ParCSRBiCGSTABDestroy(pcg_solver); @@ -3551,7 +3745,7 @@ main( HYPRE_Int argc, } else if (solver_id == 45) { - HYPRE_EuclidDestroy(pcg_precond); + HYPRE_EuclidDestroy(pcg_precond); } if (myid == 0) @@ -3580,12 +3774,12 @@ main( HYPRE_Int argc, if (solver_id == 5) { /* use BoomerAMG as preconditioner */ - if (myid == 0) hypre_printf("Solver: AMG-CGNR\n"); + if (myid == 0) { hypre_printf("Solver: AMG-CGNR\n"); } HYPRE_BoomerAMGCreate(&pcg_precond); HYPRE_BoomerAMGSetInterpType(pcg_precond, interp_type); HYPRE_BoomerAMGSetNumSamples(pcg_precond, gsmg_samples); HYPRE_BoomerAMGSetTol(pcg_precond, pc_tol); - HYPRE_BoomerAMGSetCoarsenType(pcg_precond, (hybrid*coarsen_type)); + HYPRE_BoomerAMGSetCoarsenType(pcg_precond, (hybrid * coarsen_type)); HYPRE_BoomerAMGSetMeasureType(pcg_precond, measure_type); HYPRE_BoomerAMGSetStrongThreshold(pcg_precond, strong_threshold); HYPRE_BoomerAMGSetTruncFactor(pcg_precond, trunc_factor); @@ -3608,7 +3802,9 @@ main( HYPRE_Int argc, HYPRE_BoomerAMGSetOverlap(pcg_precond, overlap); HYPRE_BoomerAMGSetDomainType(pcg_precond, domain_type); if (num_functions > 1) + { HYPRE_BoomerAMGSetDofFunc(pcg_precond, dof_func); + } HYPRE_CGNRSetPrecond(pcg_solver, (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolveT, @@ -3618,7 +3814,7 @@ main( HYPRE_Int argc, else if (solver_id == 6) { /* use diagonal scaling as preconditioner */ - if (myid == 0) hypre_printf("Solver: DS-CGNR\n"); + if (myid == 0) { hypre_printf("Solver: DS-CGNR\n"); } pcg_precond = NULL; HYPRE_CGNRSetPrecond(pcg_solver, @@ -3631,14 +3827,15 @@ main( HYPRE_Int argc, HYPRE_CGNRGetPrecond(pcg_solver, &pcg_precond_gotten); if (pcg_precond_gotten != pcg_precond) { - hypre_printf("HYPRE_ParCSRCGNRGetPrecond got bad precond\n"); - return(-1); + hypre_printf("HYPRE_ParCSRCGNRGetPrecond got bad precond\n"); + return (-1); + } + else if (myid == 0) + { + hypre_printf("HYPRE_ParCSRCGNRGetPrecond got good precond\n"); } - else - if (myid == 0) - hypre_printf("HYPRE_ParCSRCGNRGetPrecond got good precond\n"); HYPRE_CGNRSetup(pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, - (HYPRE_Vector)x); + (HYPRE_Vector)x); hypre_EndTiming(time_index); hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); @@ -3649,7 +3846,7 @@ main( HYPRE_Int argc, hypre_BeginTiming(time_index); HYPRE_CGNRSolve(pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, - (HYPRE_Vector)x); + (HYPRE_Vector)x); hypre_EndTiming(time_index); hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); @@ -3657,15 +3854,15 @@ main( HYPRE_Int argc, hypre_ClearTiming(); HYPRE_CGNRGetNumIterations(pcg_solver, &num_iterations); - HYPRE_CGNRGetFinalRelativeResidualNorm(pcg_solver,&final_res_norm); + HYPRE_CGNRGetFinalRelativeResidualNorm(pcg_solver, &final_res_norm); #if SECOND_TIME /* run a second time to check for memory leaks */ HYPRE_ParVectorSetRandomValues(x, 775); HYPRE_CGNRSetup(pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, - (HYPRE_Vector)x); + (HYPRE_Vector)x); HYPRE_CGNRSolve(pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, - (HYPRE_Vector)x); + (HYPRE_Vector)x); #endif HYPRE_ParCSRCGNRDestroy(pcg_solver); @@ -3758,7 +3955,7 @@ BuildParFromFile( HYPRE_Int argc, * Generate the matrix *-----------------------------------------------------------*/ - HYPRE_ParCSRMatrixRead(hypre_MPI_COMM_WORLD, filename,&A); + HYPRE_ParCSRMatrixRead(hypre_MPI_COMM_WORLD, filename, &A); *A_ptr = A; @@ -3832,9 +4029,9 @@ BuildParLaplacian( HYPRE_Int argc, else if ( strcmp(argv[arg_index], "-c") == 0 ) { arg_index++; - cx = atof(argv[arg_index++]); - cy = atof(argv[arg_index++]); - cz = atof(argv[arg_index++]); + cx = (HYPRE_Real)atof(argv[arg_index++]); + cy = (HYPRE_Real)atof(argv[arg_index++]); + cz = (HYPRE_Real)atof(argv[arg_index++]); } else { @@ -3846,7 +4043,7 @@ BuildParLaplacian( HYPRE_Int argc, * Check a few things *-----------------------------------------------------------*/ - if ((P*Q*R) != num_procs) + if ((P * Q * R) != num_procs) { hypre_printf("Error: Invalid number of processors or processor topology \n"); exit(1); @@ -3870,8 +4067,8 @@ BuildParLaplacian( HYPRE_Int argc, /* compute p,q,r from P,Q,R and myid */ p = myid % P; - q = (( myid - p)/P) % Q; - r = ( myid - p - P*q)/( P*Q ); + q = (( myid - p) / P) % Q; + r = ( myid - p - P * q) / ( P * Q ); /*----------------------------------------------------------- * Generate the matrix @@ -3886,19 +4083,19 @@ BuildParLaplacian( HYPRE_Int argc, values[0] = 0.; if (nx > 1) { - values[0] += 2.0*cx; + values[0] += 2.0 * cx; } if (ny > 1) { - values[0] += 2.0*cy; + values[0] += 2.0 * cy; } if (nz > 1) { - values[0] += 2.0*cz; + values[0] += 2.0 * cz; } A = (HYPRE_ParCSRMatrix) GenerateLaplacian(hypre_MPI_COMM_WORLD, - nx, ny, nz, P, Q, R, p, q, r, values); + nx, ny, nz, P, Q, R, p, q, r, values); hypre_TFree(values, HYPRE_MEMORY_HOST); @@ -3926,7 +4123,7 @@ BuildParDifConv( HYPRE_Int argc, HYPRE_Int P, Q, R; HYPRE_Real cx, cy, cz; HYPRE_Real ax, ay, az; - HYPRE_Real hinx,hiny,hinz; + HYPRE_Real hinx, hiny, hinz; HYPRE_ParCSRMatrix A; @@ -3984,16 +4181,16 @@ BuildParDifConv( HYPRE_Int argc, else if ( strcmp(argv[arg_index], "-c") == 0 ) { arg_index++; - cx = atof(argv[arg_index++]); - cy = atof(argv[arg_index++]); - cz = atof(argv[arg_index++]); + cx = (HYPRE_Real)atof(argv[arg_index++]); + cy = (HYPRE_Real)atof(argv[arg_index++]); + cz = (HYPRE_Real)atof(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-a") == 0 ) { arg_index++; - ax = atof(argv[arg_index++]); - ay = atof(argv[arg_index++]); - az = atof(argv[arg_index++]); + ax = (HYPRE_Real)atof(argv[arg_index++]); + ay = (HYPRE_Real)atof(argv[arg_index++]); + az = (HYPRE_Real)atof(argv[arg_index++]); } else { @@ -4005,7 +4202,7 @@ BuildParDifConv( HYPRE_Int argc, * Check a few things *-----------------------------------------------------------*/ - if ((P*Q*R) != num_procs) + if ((P * Q * R) != num_procs) { hypre_printf("Error: Invalid number of processors or processor topology \n"); exit(1); @@ -4031,12 +4228,12 @@ BuildParDifConv( HYPRE_Int argc, /* compute p,q,r from P,Q,R and myid */ p = myid % P; - q = (( myid - p)/P) % Q; - r = ( myid - p - P*q)/( P*Q ); + q = (( myid - p) / P) % Q; + r = ( myid - p - P * q) / ( P * Q ); - hinx = 1./(nx+1); - hiny = 1./(ny+1); - hinz = 1./(nz+1); + hinx = 1. / (nx + 1); + hiny = 1. / (ny + 1); + hinz = 1. / (nz + 1); /*----------------------------------------------------------- * Generate the matrix @@ -4044,29 +4241,29 @@ BuildParDifConv( HYPRE_Int argc, values = hypre_CTAlloc(HYPRE_Real, 7, HYPRE_MEMORY_HOST); - values[1] = -cx/(hinx*hinx); - values[2] = -cy/(hiny*hiny); - values[3] = -cz/(hinz*hinz); - values[4] = -cx/(hinx*hinx) + ax/hinx; - values[5] = -cy/(hiny*hiny) + ay/hiny; - values[6] = -cz/(hinz*hinz) + az/hinz; + values[1] = -cx / (hinx * hinx); + values[2] = -cy / (hiny * hiny); + values[3] = -cz / (hinz * hinz); + values[4] = -cx / (hinx * hinx) + ax / hinx; + values[5] = -cy / (hiny * hiny) + ay / hiny; + values[6] = -cz / (hinz * hinz) + az / hinz; values[0] = 0.; if (nx > 1) { - values[0] += 2.0*cx/(hinx*hinx) - 1.*ax/hinx; + values[0] += 2.0 * cx / (hinx * hinx) - 1.*ax / hinx; } if (ny > 1) { - values[0] += 2.0*cy/(hiny*hiny) - 1.*ay/hiny; + values[0] += 2.0 * cy / (hiny * hiny) - 1.*ay / hiny; } if (nz > 1) { - values[0] += 2.0*cz/(hinz*hinz) - 1.*az/hinz; + values[0] += 2.0 * cz / (hinz * hinz) - 1.*az / hinz; } A = (HYPRE_ParCSRMatrix) GenerateDifConv(hypre_MPI_COMM_WORLD, - nx, ny, nz, P, Q, R, p, q, r, values); + nx, ny, nz, P, Q, R, p, q, r, values); hypre_TFree(values, HYPRE_MEMORY_HOST); @@ -4140,22 +4337,22 @@ BuildParFromOneFile2(HYPRE_Int argc, if (myid == 0 && num_functions > 1) { HYPRE_CSRMatrixGetNumRows(A_CSR, &num_dofs); - num_nodes = num_dofs/num_functions; - if (num_dofs != num_functions*num_nodes) + num_nodes = num_dofs / num_functions; + if (num_dofs != num_functions * num_nodes) { row_part = NULL; col_part = NULL; } else { - row_part = hypre_CTAlloc(HYPRE_Int, numprocs+1, HYPRE_MEMORY_HOST); + row_part = hypre_CTAlloc(HYPRE_Int, numprocs + 1, HYPRE_MEMORY_HOST); row_part[0] = 0; - size = num_nodes/numprocs; - rest = num_nodes-size*numprocs; - for (i=0; i < numprocs; i++) + size = num_nodes / numprocs; + rest = num_nodes - size * numprocs; + for (i = 0; i < numprocs; i++) { - row_part[i+1] = row_part[i]+size*num_functions; - if (i < rest) row_part[i+1] += num_functions; + row_part[i + 1] = row_part[i] + size * num_functions; + if (i < rest) { row_part[i + 1] += num_functions; } } col_part = row_part; } @@ -4165,7 +4362,7 @@ BuildParFromOneFile2(HYPRE_Int argc, *A_ptr = A; - if (myid == 0) HYPRE_CSRMatrixDestroy(A_CSR); + if (myid == 0) { HYPRE_CSRMatrixDestroy(A_CSR); } return (0); } @@ -4181,12 +4378,12 @@ BuildFuncsFromFiles( HYPRE_Int argc, HYPRE_ParCSRMatrix parcsr_A, HYPRE_Int **dof_func_ptr ) { -/*---------------------------------------------------------------------- - * Build Function array from files on different processors - *----------------------------------------------------------------------*/ + /*---------------------------------------------------------------------- + * Build Function array from files on different processors + *----------------------------------------------------------------------*/ hypre_printf (" Feature is not implemented yet!\n"); - return(0); + return (0); } @@ -4258,32 +4455,34 @@ BuildFuncsFromOneFile( HYPRE_Int argc, } HYPRE_ParCSRMatrixGetRowPartitioning(parcsr_A, &partitioning); - local_size = partitioning[myid+1]-partitioning[myid]; + local_size = partitioning[myid + 1] - partitioning[myid]; dof_func_local = hypre_CTAlloc(HYPRE_Int, local_size, HYPRE_MEMORY_HOST); if (myid == 0) { - requests = hypre_CTAlloc(hypre_MPI_Request, num_procs-1, HYPRE_MEMORY_HOST); - status = hypre_CTAlloc(hypre_MPI_Status, num_procs-1, HYPRE_MEMORY_HOST); - j = 0; - for (i=1; i < num_procs; i++) - hypre_MPI_Isend(&dof_func[partitioning[i]], - partitioning[i+1]-partitioning[i], - HYPRE_MPI_INT, i, 0, comm, &requests[j++]); - for (i=0; i < local_size; i++) - dof_func_local[i] = dof_func[i]; - hypre_MPI_Waitall(num_procs-1,requests, status); - hypre_TFree(requests, HYPRE_MEMORY_HOST); - hypre_TFree(status, HYPRE_MEMORY_HOST); + requests = hypre_CTAlloc(hypre_MPI_Request, num_procs - 1, HYPRE_MEMORY_HOST); + status = hypre_CTAlloc(hypre_MPI_Status, num_procs - 1, HYPRE_MEMORY_HOST); + j = 0; + for (i = 1; i < num_procs; i++) + hypre_MPI_Isend(&dof_func[partitioning[i]], + partitioning[i + 1] - partitioning[i], + HYPRE_MPI_INT, i, 0, comm, &requests[j++]); + for (i = 0; i < local_size; i++) + { + dof_func_local[i] = dof_func[i]; + } + hypre_MPI_Waitall(num_procs - 1, requests, status); + hypre_TFree(requests, HYPRE_MEMORY_HOST); + hypre_TFree(status, HYPRE_MEMORY_HOST); } else { - hypre_MPI_Recv(dof_func_local,local_size,HYPRE_MPI_INT,0,0,comm,&status0); + hypre_MPI_Recv(dof_func_local, local_size, HYPRE_MPI_INT, 0, 0, comm, &status0); } *dof_func_ptr = dof_func_local; - if (myid == 0) hypre_TFree(dof_func, HYPRE_MEMORY_HOST); + if (myid == 0) { hypre_TFree(dof_func, HYPRE_MEMORY_HOST); } return (0); } @@ -4341,7 +4540,7 @@ BuildRhsParFromOneFile2(HYPRE_Int argc, b_CSR = HYPRE_VectorRead(filename); } - HYPRE_VectorToParVector(hypre_MPI_COMM_WORLD, b_CSR, partitioning,&b); + HYPRE_VectorToParVector(hypre_MPI_COMM_WORLD, b_CSR, partitioning, &b); *b_ptr = b; @@ -4415,7 +4614,7 @@ BuildParLaplacian9pt( HYPRE_Int argc, * Check a few things *-----------------------------------------------------------*/ - if ((P*Q) != num_procs) + if ((P * Q) != num_procs) { hypre_printf("Error: Invalid number of processors or processor topology \n"); exit(1); @@ -4438,7 +4637,7 @@ BuildParLaplacian9pt( HYPRE_Int argc, /* compute p,q from P,Q and myid */ p = myid % P; - q = ( myid - p)/P; + q = ( myid - p) / P; /*----------------------------------------------------------- * Generate the matrix @@ -4463,7 +4662,7 @@ BuildParLaplacian9pt( HYPRE_Int argc, } A = (HYPRE_ParCSRMatrix) GenerateLaplacian9pt(hypre_MPI_COMM_WORLD, - nx, ny, P, Q, p, q, values); + nx, ny, P, Q, p, q, values); hypre_TFree(values, HYPRE_MEMORY_HOST); @@ -4540,7 +4739,7 @@ BuildParLaplacian27pt( HYPRE_Int argc, * Check a few things *-----------------------------------------------------------*/ - if ((P*Q*R) != num_procs) + if ((P * Q * R) != num_procs) { hypre_printf("Error: Invalid number of processors or processor topology \n"); exit(1); @@ -4563,8 +4762,8 @@ BuildParLaplacian27pt( HYPRE_Int argc, /* compute p,q,r from P,Q,R and myid */ p = myid % P; - q = (( myid - p)/P) % Q; - r = ( myid - p - P*q)/( P*Q ); + q = (( myid - p) / P) % Q; + r = ( myid - p - P * q) / ( P * Q ); /*----------------------------------------------------------- * Generate the matrix @@ -4574,13 +4773,17 @@ BuildParLaplacian27pt( HYPRE_Int argc, values[0] = 26.0; if (nx == 1 || ny == 1 || nz == 1) + { values[0] = 8.0; - if (nx*ny == 1 || nx*nz == 1 || ny*nz == 1) + } + if (nx * ny == 1 || nx * nz == 1 || ny * nz == 1) + { values[0] = 2.0; + } values[1] = -1.; A = (HYPRE_ParCSRMatrix) GenerateLaplacian27pt(hypre_MPI_COMM_WORLD, - nx, ny, nz, P, Q, R, p, q, r, values); + nx, ny, nz, P, Q, R, p, q, r, values); hypre_TFree(values, HYPRE_MEMORY_HOST); @@ -4670,8 +4873,8 @@ BuildParIsoLaplacian( HYPRE_Int argc, char** argv, HYPRE_ParCSRMatrix *A_ptr ) /* compute p,q,r from P,Q,R and myid */ p = myid % P; - q = (( myid - p)/P) % Q; - r = ( myid - p - P*q)/( P*Q ); + q = (( myid - p) / P) % Q; + r = ( myid - p - P * q) / ( P * Q ); /*----------------------------------------------------------- * Generate the matrix @@ -4686,19 +4889,19 @@ BuildParIsoLaplacian( HYPRE_Int argc, char** argv, HYPRE_ParCSRMatrix *A_ptr ) values[0] = 0.; if (nx > 1) { - values[0] += 2.0*cx; + values[0] += 2.0 * cx; } if (ny > 1) { - values[0] += 2.0*cy; + values[0] += 2.0 * cy; } if (nz > 1) { - values[0] += 2.0*cz; + values[0] += 2.0 * cz; } A = (HYPRE_ParCSRMatrix) GenerateLaplacian(hypre_MPI_COMM_WORLD, - nx, ny, nz, P, Q, R, p, q, r, values); + nx, ny, nz, P, Q, R, p, q, r, values); hypre_TFree(values, HYPRE_MEMORY_HOST); diff --git a/external/hypre/src/test/test_mgr.c b/external/hypre/src/test/test_mgr.c deleted file mode 100644 index 396cbad2..00000000 --- a/external/hypre/src/test/test_mgr.c +++ /dev/null @@ -1,1313 +0,0 @@ -/****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other - * HYPRE Project Developers. See the top-level COPYRIGHT file for details. - * - * SPDX-License-Identifier: (Apache-2.0 OR MIT) - ******************************************************************************/ - -/*-------------------------------------------------------------------------- - * Test driver for unstructured matrix interface (IJ_matrix interface). - * Do `driver -help' for usage info. - * This driver started from the driver for parcsr_linear_solvers, and it - * works by first building a parcsr matrix as before and then "copying" - * that matrix row-by-row into the IJMatrix interface. AJC 7/99. - *--------------------------------------------------------------------------*/ -#include -#include -#include - -#include "_hypre_utilities.h" -#include "HYPRE.h" -#include "HYPRE_parcsr_mv.h" - -#include "HYPRE_IJ_mv.h" -#include "HYPRE_parcsr_ls.h" -#include "_hypre_parcsr_mv.h" -#include "HYPRE_krylov.h" - -#ifdef HAVE_DSUPERLU -#include "superlu_ddefs.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} -#endif -#define SECOND_TIME 0 - - -hypre_int -main( hypre_int argc, - char *argv[] ) -{ - HYPRE_Int arg_index; - HYPRE_Int print_usage; - HYPRE_Int build_matrix_type; - HYPRE_Int build_matrix_arg_index; - HYPRE_Int build_precond_type; - HYPRE_Int build_precond_arg_index; - HYPRE_Int build_rhs_type; - HYPRE_Int build_rhs_arg_index; - HYPRE_Int use_block_cf = 0; - HYPRE_Int use_point_marker_array = 0; - HYPRE_Int use_reserved_coarse_grid; - HYPRE_Int build_block_cf_arg_index; - HYPRE_Int build_marker_array_arg_index; - HYPRE_Int solver_id; - HYPRE_Int print_system = 0; - HYPRE_Int poutdat; - HYPRE_Int debug_flag; - HYPRE_Int ierr = 0; - HYPRE_Int i,j; - HYPRE_Int max_levels = 25; - HYPRE_Int num_iterations; - HYPRE_Real final_res_norm; - void *object; - - HYPRE_IJMatrix ij_A = NULL; - HYPRE_IJMatrix ij_M = NULL; - HYPRE_IJVector ij_b = NULL; - HYPRE_IJVector ij_x = NULL; - - HYPRE_ParCSRMatrix parcsr_A = NULL; - HYPRE_ParCSRMatrix parcsr_M = NULL; - HYPRE_ParCSRMatrix parcsr_C = NULL; - HYPRE_ParVector b = NULL; - HYPRE_ParVector x = NULL; - - HYPRE_Solver aux_precond = NULL, aux_solver = NULL; - HYPRE_Solver amg_solver = NULL; - HYPRE_Solver pcg_solver = NULL; - HYPRE_Solver pcg_precond=NULL, pcg_precond_gotten = NULL; - - HYPRE_Int num_procs, myid; - - HYPRE_Int time_index; - MPI_Comm comm = hypre_MPI_COMM_WORLD; - - HYPRE_Real *values = NULL; - - HYPRE_BigInt first_local_row, last_local_row, local_num_rows; - HYPRE_BigInt first_local_col, last_local_col, local_num_cols; -#ifdef HAVE_DSUPERLU - HYPRE_Int dslu_threshold = -1; -#endif - - /* parameters for GMRES */ - HYPRE_Int k_dim = 100; - HYPRE_Real tol = 1e-6; - HYPRE_Real atol = 1e-12; - HYPRE_Real pc_tol = 0.0; - HYPRE_Int max_iter = 400; - HYPRE_Int pc_max_iter = 1; - - /* mgr options */ - HYPRE_Int mgr_bsize = 7; - HYPRE_Int mgr_nlevels = 3; - HYPRE_Int mgr_num_reserved_nodes = 0; - HYPRE_Int mgr_non_c_to_f = 1; - HYPRE_Int P_max_elmts = 0; - - HYPRE_Int *mgr_frelax_num_functions= NULL; - HYPRE_BigInt *mgr_idx_array = NULL; - HYPRE_Int *mgr_point_marker_array = NULL; - HYPRE_Int *mgr_num_cindexes = NULL; - HYPRE_Int **mgr_cindexes = NULL; - HYPRE_BigInt *mgr_reserved_coarse_indexes = NULL; - - HYPRE_Int mgr_relax_type = 0; - HYPRE_Int mgr_num_relax_sweeps = 1; - - HYPRE_Int mgr_gsmooth_type = 16; - HYPRE_Int mgr_num_gsmooth_sweeps = 0; - - HYPRE_Int mgr_restrict_type = 0; - HYPRE_Int mgr_num_restrict_sweeps = 0; - HYPRE_Int *mgr_level_restrict_type = hypre_CTAlloc(HYPRE_Int, mgr_nlevels, HYPRE_MEMORY_HOST); - mgr_level_restrict_type[0] = 0; - mgr_level_restrict_type[1] = 0; - mgr_level_restrict_type[2] = 0; - - HYPRE_Int mgr_interp_type = 2; - HYPRE_Int mgr_num_interp_sweeps = 0; - HYPRE_Int *mgr_level_interp_type = hypre_CTAlloc(HYPRE_Int, mgr_nlevels, HYPRE_MEMORY_HOST); - mgr_level_interp_type[0] = 2; - mgr_level_interp_type[1] = 2; - mgr_level_interp_type[2] = 2; - - HYPRE_Int *mgr_coarse_grid_method = hypre_CTAlloc(HYPRE_Int, mgr_nlevels, HYPRE_MEMORY_HOST); - mgr_coarse_grid_method[0] = 0; - mgr_coarse_grid_method[1] = 0; - mgr_coarse_grid_method[2] = 0; - - mgr_cindexes = hypre_CTAlloc(HYPRE_Int*, mgr_nlevels, HYPRE_MEMORY_HOST); - HYPRE_Int *lv1 = hypre_CTAlloc(HYPRE_Int, mgr_bsize, HYPRE_MEMORY_HOST); - HYPRE_Int *lv2 = hypre_CTAlloc(HYPRE_Int, mgr_bsize, HYPRE_MEMORY_HOST); - HYPRE_Int *lv3 = hypre_CTAlloc(HYPRE_Int, mgr_bsize, HYPRE_MEMORY_HOST); - lv1[0] = 0; - lv1[1] = 1; - lv1[2] = 3; - lv1[3] = 4; - lv1[4] = 5; - lv1[5] = 6; - lv2[0] = 0; - lv2[1] = 3; - lv2[2] = 4; - lv2[3] = 5; - lv2[4] = 6; - lv3[0] = 3; - lv3[1] = 4; - lv3[2] = 5; - lv3[3] = 6; - mgr_cindexes[0] = lv1; - mgr_cindexes[1] = lv2; - mgr_cindexes[2] = lv3; - - mgr_num_cindexes = hypre_CTAlloc(HYPRE_Int, mgr_nlevels, HYPRE_MEMORY_HOST); - mgr_num_cindexes[0] = 6; - mgr_num_cindexes[1] = 5; - mgr_num_cindexes[2] = 4; - - HYPRE_Int mgr_frelax_method = 0; - HYPRE_Int *mgr_level_frelax_method = hypre_CTAlloc(HYPRE_Int, mgr_nlevels, HYPRE_MEMORY_HOST); - mgr_level_frelax_method[0] = 0; - mgr_level_frelax_method[1] = 0; - mgr_level_frelax_method[2] = 2; - - char* indexList = NULL; - /* end mgr options */ - - /*----------------------------------------------------------- - * Initialize some stuff - *-----------------------------------------------------------*/ - - /* Initialize MPI */ - hypre_MPI_Init(&argc, &argv); - - hypre_MPI_Comm_size(hypre_MPI_COMM_WORLD, &num_procs ); - hypre_MPI_Comm_rank(hypre_MPI_COMM_WORLD, &myid ); - - /*----------------------------------------------------------- - * Set defaults - *-----------------------------------------------------------*/ - - build_matrix_type = -1; - build_matrix_arg_index = argc; - build_precond_type = 0; - build_precond_arg_index = argc; - build_rhs_type = 2; - build_rhs_arg_index = argc; - debug_flag = 0; - - solver_id = 72; - - poutdat = 1; - - /*----------------------------------------------------------- - * Parse command line - *-----------------------------------------------------------*/ - - print_usage = 0; - arg_index = 1; - - while ( (arg_index < argc) && (!print_usage) ) - { - if ( strcmp(argv[arg_index], "-fromfile") == 0 ) - { - arg_index++; - build_matrix_type = -1; - build_matrix_arg_index = arg_index; - } - if ( strcmp(argv[arg_index], "-precondfromfile") == 0 ) - { - arg_index++; - build_precond_type = -1; - build_precond_arg_index = arg_index; - } - else if ( strcmp(argv[arg_index], "-solver") == 0 ) - { - arg_index++; - solver_id = atoi(argv[arg_index++]); - } - else if ( strcmp(argv[arg_index], "-print") == 0 ) - { - arg_index++; - print_system = 1; - } - else if ( strcmp(argv[arg_index], "-rhsfromfile") == 0 ) - { - arg_index++; - build_rhs_type = 0; - build_rhs_arg_index = arg_index; - } - else if ( strcmp(argv[arg_index], "-indexList") == 0) - { - arg_index++; - use_reserved_coarse_grid = 1; - indexList = (argv[arg_index++]); - } - else if ( strcmp(argv[arg_index], "-blockCF") == 0) - { - arg_index++; - use_block_cf = 1; - build_block_cf_arg_index = arg_index; - } - else if ( strcmp(argv[arg_index], "-markerArray") == 0) - { - arg_index++; - use_point_marker_array = 1; - build_marker_array_arg_index = arg_index; - } - else - { - arg_index++; - } - } - - if (myid == 0) - { - hypre_printf("Reading the system matrix\n"); - } - ierr = HYPRE_IJMatrixRead( argv[build_matrix_arg_index], comm, - HYPRE_PARCSR, &ij_A ); - if (ierr) - { - hypre_printf("ERROR: Problem reading in the system matrix!\n"); - exit(1); - } - - if (build_matrix_type < 0) - { - ierr = HYPRE_IJMatrixGetLocalRange( ij_A, - &first_local_row, &last_local_row , - &first_local_col, &last_local_col ); - - local_num_rows = last_local_row - first_local_row + 1; - local_num_cols = last_local_col - first_local_col + 1; - ierr += HYPRE_IJMatrixGetObject( ij_A, &object); - parcsr_A = (HYPRE_ParCSRMatrix) object; - } - - - - if (build_precond_type < 0) - { - ierr = HYPRE_IJMatrixRead( argv[build_precond_arg_index], comm, - HYPRE_PARCSR, &ij_M ); - if (ierr) - { - hypre_printf("ERROR: Problem reading in the preconditioning matrix!\n"); - exit(1); - } - ierr = HYPRE_IJMatrixGetLocalRange( ij_M, - &first_local_row, &last_local_row , - &first_local_col, &last_local_col ); - - local_num_rows = last_local_row - first_local_row + 1; - local_num_cols = last_local_col - first_local_col + 1; - ierr += HYPRE_IJMatrixGetObject( ij_M, &object); - parcsr_M = (HYPRE_ParCSRMatrix) object; - } - else - { - parcsr_M = parcsr_A; - } - - if ( build_rhs_type == 0 ) - { - if (myid == 0) - { - hypre_printf(" RHS vector read from file %s\n", argv[build_rhs_arg_index]); - hypre_printf(" Initial guess is 0\n"); - } - - /* RHS */ - ierr = HYPRE_IJVectorRead( argv[build_rhs_arg_index], hypre_MPI_COMM_WORLD, - HYPRE_PARCSR, &ij_b ); - if (ierr) - { - hypre_printf("ERROR: Problem reading in the right-hand-side!\n"); - exit(1); - } - ierr = HYPRE_IJVectorGetObject( ij_b, &object ); - b = (HYPRE_ParVector) object; - - /* Initial guess */ - HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_col, last_local_col, &ij_x); - HYPRE_IJVectorSetObjectType(ij_x, HYPRE_PARCSR); - HYPRE_IJVectorInitialize(ij_x); - - values = hypre_CTAlloc(HYPRE_Real, local_num_cols, HYPRE_MEMORY_HOST); - for (i = 0; i < local_num_cols; i++) - values[i] = 0.; - HYPRE_IJVectorSetValues(ij_x, local_num_cols, NULL, values); - hypre_TFree(values, HYPRE_MEMORY_HOST); - - ierr = HYPRE_IJVectorGetObject( ij_x, &object ); - x = (HYPRE_ParVector) object; - } - else if ( build_rhs_type == 2 ) - { - if (myid == 0) - { - hypre_printf(" RHS vector has unit components\n"); - hypre_printf(" Initial guess is 0\n"); - } - - /* RHS */ - HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_row, last_local_row, &ij_b); - HYPRE_IJVectorSetObjectType(ij_b, HYPRE_PARCSR); - HYPRE_IJVectorInitialize(ij_b); - - values = hypre_CTAlloc(HYPRE_Real, local_num_rows, HYPRE_MEMORY_HOST); - for (i = 0; i < local_num_rows; i++) - values[i] = 1.0; - HYPRE_IJVectorSetValues(ij_b, local_num_rows, NULL, values); - hypre_TFree(values, HYPRE_MEMORY_HOST); - - ierr = HYPRE_IJVectorGetObject( ij_b, &object ); - b = (HYPRE_ParVector) object; - - /* Initial guess */ - HYPRE_IJVectorCreate(hypre_MPI_COMM_WORLD, first_local_col, last_local_col, &ij_x); - HYPRE_IJVectorSetObjectType(ij_x, HYPRE_PARCSR); - HYPRE_IJVectorInitialize(ij_x); - - values = hypre_CTAlloc(HYPRE_Real, local_num_cols, HYPRE_MEMORY_HOST); - for (i = 0; i < local_num_cols; i++) - values[i] = 0.; - HYPRE_IJVectorSetValues(ij_x, local_num_cols, NULL, values); - hypre_TFree(values, HYPRE_MEMORY_HOST); - - ierr = HYPRE_IJVectorGetObject( ij_x, &object ); - x = (HYPRE_ParVector) object; - } - - - if (indexList != NULL) - { - mgr_reserved_coarse_indexes = hypre_CTAlloc(HYPRE_BigInt, mgr_num_reserved_nodes, HYPRE_MEMORY_HOST); - FILE* ifp; - ifp = fopen(indexList,"r"); - if (ifp == NULL) - { - fprintf(stderr, "Can't open input file for index list!\n"); - exit(1); - } - fscanf(ifp, "%d", &mgr_num_reserved_nodes); - fprintf(stderr, "There are %d additional indices\n", mgr_num_reserved_nodes); - for (i = 0; i < mgr_num_reserved_nodes; i++) { - fscanf(ifp, "%d", &mgr_reserved_coarse_indexes[i]); - } - } - else - { - mgr_num_reserved_nodes = 0; - mgr_reserved_coarse_indexes = NULL; - } - - if (use_block_cf) - { - mgr_idx_array = hypre_CTAlloc(HYPRE_BigInt, mgr_bsize, HYPRE_MEMORY_HOST); - FILE *ifp; - char fname[80]; - hypre_sprintf(fname, "%s.%05i", argv[build_block_cf_arg_index],myid); - hypre_printf("Reading block CF indices from %s \n", fname); - ifp = fopen(fname,"r"); - if (ifp == NULL) - { - fprintf(stderr, "Can't open input file for block CF indices!\n"); - exit(1); - } - for (i = 0; i < mgr_bsize; i++) - { - fscanf(ifp, "%d", &mgr_idx_array[i]); - } - } - - mgr_point_marker_array = hypre_CTAlloc(HYPRE_Int, local_num_rows, HYPRE_MEMORY_HOST); - if (use_point_marker_array) - { - FILE *ifp; - char fname[80]; - hypre_sprintf(fname, "%s.%05i", argv[build_marker_array_arg_index], myid); - hypre_printf("Reading marker array from %s \n", fname); - ifp = fopen(fname,"r"); - if (ifp == NULL) - { - fprintf(stderr, "Can't open input file for block CF indices!\n"); - exit(1); - } - for (i = 0; i < local_num_rows; i++) - { - fscanf(ifp, "%d", &mgr_point_marker_array[i]); - } - } - - if ( solver_id == 72 ) - { - time_index = hypre_InitializeTiming("FlexGMRES Setup"); - hypre_BeginTiming(time_index); - - HYPRE_ParCSRFlexGMRESCreate(hypre_MPI_COMM_WORLD, &pcg_solver); - HYPRE_FlexGMRESSetKDim(pcg_solver, k_dim); - HYPRE_FlexGMRESSetMaxIter(pcg_solver, max_iter); - HYPRE_FlexGMRESSetTol(pcg_solver, tol); - HYPRE_FlexGMRESSetAbsoluteTol(pcg_solver, atol); - HYPRE_FlexGMRESSetLogging(pcg_solver, 1); - HYPRE_FlexGMRESSetPrintLevel(pcg_solver, 2); - - /* - ierr = HYPRE_ILUCreate(&aux_precond); - HYPRE_ILUSetType(aux_precond, 0); - HYPRE_ILUSetMaxIter(aux_precond, pc_max_iter); - HYPRE_ILUSetTol(aux_precond, pc_tol); - HYPRE_ILUSetLevelOfFill(aux_precond, 0); - - HYPRE_ParCSRGMRESCreate(hypre_MPI_COMM_WORLD, &aux_solver); - HYPRE_GMRESSetMaxIter(aux_solver, 1); - HYPRE_GMRESSetTol(aux_solver, 1e-09); - HYPRE_GMRESSetPrintLevel(aux_solver, 0); - HYPRE_GMRESSetPrecond(aux_solver, - (HYPRE_PtrToSolverFcn)HYPRE_ILUSolve, - (HYPRE_PtrToSolverFcn)HYPRE_ILUSetup, - aux_precond); - - HYPRE_BoomerAMGCreate(&aux_precond); - HYPRE_BoomerAMGSetPrintLevel(aux_precond, 0); - HYPRE_BoomerAMGSetRelaxOrder(aux_precond, 1); - HYPRE_BoomerAMGSetMaxIter(aux_precond, 1); - HYPRE_BoomerAMGSetNumSweeps(aux_precond, 1); - HYPRE_BoomerAMGSetNumFunctions(aux_precond, 3); - HYPRE_BoomerAMGSetAggNumLevels(aux_precond, 1); - - HYPRE_ParCSRGMRESCreate(hypre_MPI_COMM_WORLD, &aux_solver); - HYPRE_GMRESSetMaxIter(aux_solver, 10); - HYPRE_GMRESSetPrecond(aux_solver, - (HYPRE_PtrToSolverFcn)HYPRE_BoomerAMGSolve, - (HYPRE_PtrToSolverFcn)HYPRE_BoomerAMGSetup, - aux_precond); - */ - - /* use MGR preconditioning */ - if (myid == 0) hypre_printf("Solver: MGR-FlexGMRES\n"); - - HYPRE_MGRCreate(&pcg_precond); - - /* set MGR data by block */ - if (use_block_cf) - { - HYPRE_MGRSetCpointsByContiguousBlock( pcg_precond, mgr_bsize, mgr_nlevels, mgr_idx_array, mgr_num_cindexes, mgr_cindexes); - } - else if (use_point_marker_array) - { - HYPRE_MGRSetCpointsByPointMarkerArray( pcg_precond, mgr_bsize, mgr_nlevels, mgr_num_cindexes, mgr_cindexes, mgr_point_marker_array); - } - else - { - HYPRE_MGRSetCpointsByBlock( pcg_precond, mgr_bsize, mgr_nlevels, mgr_num_cindexes,mgr_cindexes); - } - /* set reserved coarse nodes */ - if (mgr_num_reserved_nodes) HYPRE_MGRSetReservedCoarseNodes(pcg_precond, mgr_num_reserved_nodes, mgr_reserved_coarse_indexes); - - /* set intermediate coarse grid strategy */ - HYPRE_MGRSetNonCpointsToFpoints(pcg_precond, mgr_non_c_to_f); - /* set F relaxation strategy */ - HYPRE_MGRSetLevelFRelaxMethod(pcg_precond, mgr_level_frelax_method); - /* set F relaxation number of functions*/ - //HYPRE_MGRSetLevelFRelaxNumFunctions(pcg_precond, mgr_frelax_num_functions); - /* set relax type for single level F-relaxation and post-relaxation */ - HYPRE_MGRSetRelaxType(pcg_precond, mgr_relax_type); - HYPRE_MGRSetNumRelaxSweeps(pcg_precond, mgr_num_relax_sweeps); - /* set restrict type */ - //HYPRE_MGRSetRestrictType(pcg_precond, mgr_restrict_type); - HYPRE_MGRSetLevelRestrictType(pcg_precond, mgr_level_restrict_type); - HYPRE_MGRSetNumRestrictSweeps(pcg_precond, mgr_num_restrict_sweeps); - /* set interpolation type */ - //HYPRE_MGRSetInterpType(pcg_precond, mgr_interp_type); - HYPRE_MGRSetLevelInterpType(pcg_precond, mgr_level_interp_type); - HYPRE_MGRSetNumInterpSweeps(pcg_precond, mgr_num_interp_sweeps); - /* set P_max_elmts for coarse grid */ - HYPRE_MGRSetPMaxElmts(pcg_precond, P_max_elmts); - /* set print level */ - HYPRE_MGRSetPrintLevel(pcg_precond, poutdat); - /* set max iterations */ - HYPRE_MGRSetMaxIter(pcg_precond, pc_max_iter); - HYPRE_MGRSetTol(pcg_precond, pc_tol); - HYPRE_MGRSetCoarseGridMethod(pcg_precond, mgr_coarse_grid_method); - HYPRE_MGRSetReservedCpointsLevelToKeep(pcg_precond, 0); - - HYPRE_MGRSetGlobalsmoothType(pcg_precond, mgr_gsmooth_type); - HYPRE_MGRSetMaxGlobalsmoothIters( pcg_precond, mgr_num_gsmooth_sweeps ); - if (print_system) hypre_MGRPrintCoarseSystem( pcg_precond, 1 ); - - /* create AMG coarse grid solver */ - - /* - HYPRE_BoomerAMGCreate(&amg_solver); - HYPRE_BoomerAMGSetRelaxOrder(amg_solver, 1); - HYPRE_BoomerAMGSetMaxIter(amg_solver, 1); - HYPRE_BoomerAMGSetNumFunctions(amg_solver, 1); - //HYPRE_BoomerAMGSetMaxLevels(amg_solver, 1); - //HYPRE_BoomerAMGSetRelaxType(amg_solver, 3); - HYPRE_BoomerAMGSetNumSweeps(amg_solver, 3); - //HYPRE_BoomerAMGSetMaxCoarseSize(amg_solver, 104); - HYPRE_BoomerAMGSetSmoothType(amg_solver, 9); - HYPRE_BoomerAMGSetEuLevel(amg_solver, 5); - HYPRE_BoomerAMGSetSmoothNumLevels(amg_solver, 4); - HYPRE_BoomerAMGSetSmoothNumSweeps(amg_solver, 1); - */ - - /* set the MGR coarse solver. Comment out to use default CG solver in MGR */ - //HYPRE_MGRSetCoarseSolver( pcg_precond, HYPRE_BoomerAMGSolve, HYPRE_BoomerAMGSetup, amg_solver); - //HYPRE_MGRSetCoarseSolver( pcg_precond, (HYPRE_PtrToParSolverFcn)HYPRE_GMRESSolve, (HYPRE_PtrToParSolverFcn)HYPRE_GMRESSetup, aux_solver); - //HYPRE_MGRSetCoarseSolver( pcg_precond, (HYPRE_PtrToParSolverFcn)HYPRE_ILUSolve, (HYPRE_PtrToParSolverFcn)HYPRE_ILUSetup, aux_precond); -#ifdef HYPRE_USING_DSUPERLU - HYPRE_MGRDirectSolverCreate(&aux_solver); - HYPRE_MGRSetCoarseSolver( pcg_precond, (HYPRE_PtrToParSolverFcn)HYPRE_MGRDirectSolverSolve, (HYPRE_PtrToParSolverFcn)HYPRE_MGRDirectSolverSetup, aux_solver); -#endif - - // set fine grid solver - //HYPRE_MGRSetFSolver(pcg_precond, (HYPRE_PtrToParSolverFcn)HYPRE_BoomerAMGSolve, (HYPRE_PtrToParSolverFcn)HYPRE_BoomerAMGSetup, aux_precond); - - /* setup MGR-PCG solver */ - HYPRE_FlexGMRESSetPrecond(pcg_solver, - (HYPRE_PtrToSolverFcn) HYPRE_MGRSolve, - (HYPRE_PtrToSolverFcn) HYPRE_MGRSetup, - pcg_precond); - - - HYPRE_FlexGMRESGetPrecond(pcg_solver, &pcg_precond_gotten); - if (pcg_precond_gotten != pcg_precond) - { - hypre_printf("HYPRE_FlexGMRESGetPrecond got bad precond\n"); - return(-1); - } - else - if (myid == 0) - hypre_printf("HYPRE_FlexGMRESGetPrecond got good precond\n"); - - - HYPRE_FlexGMRESSetup - (pcg_solver, (HYPRE_Matrix)parcsr_M, (HYPRE_Vector)b, (HYPRE_Vector)x); - - hypre_EndTiming(time_index); - hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); - - time_index = hypre_InitializeTiming("FlexGMRES Solve"); - hypre_BeginTiming(time_index); - - hypre_ParVectorSetConstantValues(x, 0.0); - HYPRE_FlexGMRESSolve - (pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, (HYPRE_Vector)x); - - hypre_EndTiming(time_index); - hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); - - if (print_system) - { - hypre_ParVectorPrintIJ((HYPRE_Vector)x, 1, "x.out"); - } - - HYPRE_FlexGMRESGetNumIterations(pcg_solver, &num_iterations); - HYPRE_FlexGMRESGetFinalRelativeResidualNorm(pcg_solver,&final_res_norm); - - // free memory for flex FlexGMRES - if (pcg_solver) HYPRE_ParCSRFlexGMRESDestroy(pcg_solver); - if (pcg_precond) HYPRE_MGRDestroy(pcg_precond); - if (amg_solver) HYPRE_BoomerAMGDestroy(amg_solver); -#ifdef HYPRE_USING_DSUPERLU - if (aux_solver) HYPRE_MGRDirectSolverDestroy(aux_solver); -#endif - - // Print out solver summary - if (myid == 0) - { - hypre_printf("\n"); - hypre_printf("FlexGMRES Iterations = %d\n", num_iterations); - hypre_printf("Final FlexGMRES Relative Residual Norm = %e\n", final_res_norm); - hypre_printf("\n"); - } - } - else if (solver_id == 73) - { - HYPRE_Solver mgr_solver_flow; - - // setup A_ff block - hypre_ParCSRMatrix *A_ff = NULL; - hypre_ParVector *F_vector = NULL; - hypre_ParVector *U_vector = NULL; - HYPRE_Solver aff_solver; - HYPRE_Int nloc = hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(parcsr_A)); - HYPRE_Int *CF_marker = hypre_CTAlloc(HYPRE_Int, nloc, HYPRE_MEMORY_HOST); - HYPRE_Int i; - for (i = 0; i < nloc; i++) - { - if (i < (mgr_idx_array[1] - mgr_idx_array[0])) - { - CF_marker[i] = -1; - } - else - { - CF_marker[i] = 1; - } - } - HYPRE_MGRBuildAff(parcsr_A, CF_marker, 0, &A_ff); - hypre_TFree(CF_marker, HYPRE_MEMORY_HOST); - //time_index = hypre_InitializeTiming("Compute A_ff_inv"); - //hypre_BeginTiming(time_index); - //hypre_ParCSRMatrix *A_ff_inv = NULL; - //hypre_MGRApproximateInverse(A_ff, &A_ff_inv); - //hypre_EndTiming(time_index); - //hypre_PrintTiming("Compute A_ff_inv times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); - - time_index = hypre_InitializeTiming("AMG setup for UU block"); - hypre_BeginTiming(time_index); - HYPRE_BoomerAMGCreate(&aff_solver); - HYPRE_BoomerAMGSetPrintLevel(aff_solver, 0); - HYPRE_BoomerAMGSetRelaxOrder(aff_solver, 1); - HYPRE_BoomerAMGSetMaxIter(aff_solver, 1); - HYPRE_BoomerAMGSetNumFunctions(aff_solver, 3); - HYPRE_BoomerAMGSetAggNumLevels(aff_solver, 1); - - // setup - HYPRE_BoomerAMGSetup(aff_solver, A_ff, F_vector, U_vector); - - hypre_EndTiming(time_index); - hypre_PrintTiming("Setup A_uu times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); - - time_index = hypre_InitializeTiming("FlexGMRES Setup"); - hypre_BeginTiming(time_index); - - HYPRE_ParCSRFlexGMRESCreate(hypre_MPI_COMM_WORLD, &pcg_solver); - HYPRE_FlexGMRESSetKDim(pcg_solver, k_dim); - HYPRE_FlexGMRESSetMaxIter(pcg_solver, max_iter); - HYPRE_FlexGMRESSetTol(pcg_solver, tol); - HYPRE_FlexGMRESSetAbsoluteTol(pcg_solver, atol); - HYPRE_FlexGMRESSetLogging(pcg_solver, 1); - HYPRE_FlexGMRESSetPrintLevel(pcg_solver, 2); - - /* use MGR preconditioning */ - if (myid == 0) hypre_printf("Solver: MGR-FlexGMRES\n"); - - HYPRE_MGRCreate(&pcg_precond); - - // MGR parameters for special case - mgr_bsize = 2; - mgr_nlevels = 1; - mgr_num_reserved_nodes = 0; - mgr_non_c_to_f = 1; - mgr_frelax_method = 99; - //mgr_idx_array = NULL; - hypre_TFree(mgr_num_cindexes, HYPRE_MEMORY_HOST); - mgr_num_cindexes = NULL; - hypre_TFree(mgr_cindexes, HYPRE_MEMORY_HOST); - mgr_cindexes = NULL; - mgr_reserved_coarse_indexes = NULL; - mgr_relax_type = 0; - mgr_num_relax_sweeps = 1; - mgr_num_interp_sweeps = 0; - mgr_gsmooth_type = 0; - mgr_num_gsmooth_sweeps = 0; - mgr_restrict_type = 0; - mgr_num_restrict_sweeps = 0; - mgr_interp_type = 2; - - mgr_cindexes = hypre_CTAlloc(HYPRE_Int*, mgr_nlevels, HYPRE_MEMORY_HOST); - hypre_TFree(lv1, HYPRE_MEMORY_HOST); - lv1 = hypre_CTAlloc(HYPRE_Int, mgr_bsize, HYPRE_MEMORY_HOST); - lv1[0] = 1; - mgr_cindexes[0] = lv1; - - mgr_num_cindexes = hypre_CTAlloc(HYPRE_Int, mgr_nlevels, HYPRE_MEMORY_HOST); - mgr_num_cindexes[0] = 1; - - hypre_TFree(mgr_coarse_grid_method, HYPRE_MEMORY_HOST); - mgr_coarse_grid_method = hypre_CTAlloc(HYPRE_Int, mgr_nlevels, HYPRE_MEMORY_HOST); - mgr_coarse_grid_method[0] = 1; - - //hypre_TFree(mgr_idx_array, HYPRE_MEMORY_HOST); - HYPRE_Int *mgr_outer_idx_array = hypre_CTAlloc(HYPRE_Int, mgr_bsize, HYPRE_MEMORY_HOST); - HYPRE_Int ilower = hypre_ParCSRMatrixFirstRowIndex(parcsr_A); - mgr_outer_idx_array[0] = ilower; - for (i = 0; i < mgr_bsize; i++) - { - mgr_outer_idx_array[i] = mgr_idx_array[i]; - } - use_block_cf = 1; - - /* set MGR data by block */ - if (use_block_cf) { - HYPRE_MGRSetCpointsByContiguousBlock( pcg_precond, mgr_bsize, mgr_nlevels, mgr_outer_idx_array, mgr_num_cindexes, mgr_cindexes); - } else { - HYPRE_MGRSetCpointsByBlock( pcg_precond, mgr_bsize, mgr_nlevels, mgr_num_cindexes,mgr_cindexes); - } - /* set reserved coarse nodes */ - if(mgr_num_reserved_nodes)HYPRE_MGRSetReservedCoarseNodes(pcg_precond, mgr_num_reserved_nodes, mgr_reserved_coarse_indexes); - - /* set intermediate coarse grid strategy */ - HYPRE_MGRSetNonCpointsToFpoints(pcg_precond, mgr_non_c_to_f); - /* set F relaxation strategy */ - HYPRE_MGRSetFRelaxMethod(pcg_precond, mgr_frelax_method); - /* set F relaxation number of functions*/ - //HYPRE_MGRSetLevelFRelaxNumFunctions(pcg_precond, mgr_frelax_num_functions); - /* set relax type for single level F-relaxation and post-relaxation */ - HYPRE_MGRSetRelaxType(pcg_precond, mgr_relax_type); - HYPRE_MGRSetNumRelaxSweeps(pcg_precond, mgr_num_relax_sweeps); - /* set restrict type */ - HYPRE_MGRSetRestrictType(pcg_precond, mgr_restrict_type); - HYPRE_MGRSetNumRestrictSweeps(pcg_precond, mgr_num_restrict_sweeps); - /* set interpolation type */ - HYPRE_MGRSetInterpType(pcg_precond, mgr_interp_type); - HYPRE_MGRSetNumInterpSweeps(pcg_precond, mgr_num_interp_sweeps); - /* set P_max_elmts for coarse grid */ - HYPRE_MGRSetPMaxElmts(pcg_precond, P_max_elmts); - /* set print level */ - HYPRE_MGRSetPrintLevel(pcg_precond, 0); - /* set max iterations */ - HYPRE_MGRSetMaxIter(pcg_precond, pc_max_iter); - HYPRE_MGRSetTol(pcg_precond, pc_tol); - HYPRE_MGRSetCoarseGridMethod(pcg_precond, mgr_coarse_grid_method); - - HYPRE_MGRSetGlobalsmoothType(pcg_precond, mgr_gsmooth_type); - HYPRE_MGRSetMaxGlobalsmoothIters( pcg_precond, mgr_num_gsmooth_sweeps ); - if (print_system) hypre_MGRPrintCoarseSystem( pcg_precond, 1 ); - - // set fine grid solver, already setup above - //HYPRE_MGRSetFSolver(pcg_precond, HYPRE_BoomerAMGSolve, HYPRE_BoomerAMGSetup, aff_solver); - - // Set the A_ff_inv for constructing P - //hypre_MGRSetAffInv(pcg_precond, A_ff_inv); - - /* create MGR coarse grid solver */ - HYPRE_Solver gmres_flow; - HYPRE_ParCSRGMRESCreate(hypre_MPI_COMM_WORLD, &gmres_flow); - HYPRE_GMRESSetKDim(gmres_flow, 100); - HYPRE_GMRESSetMaxIter(gmres_flow, 100); - HYPRE_GMRESSetTol(gmres_flow, 1e-6); - HYPRE_GMRESSetAbsoluteTol(gmres_flow, 1e-12); - HYPRE_GMRESSetLogging(gmres_flow, 1); - HYPRE_GMRESSetPrintLevel(gmres_flow, 2); - - HYPRE_MGRCreate(&mgr_solver_flow); - - mgr_gsmooth_type = 16; - mgr_num_gsmooth_sweeps = 1; - mgr_frelax_method = 0; - mgr_num_relax_sweeps = 1; - mgr_interp_type = 2; - use_block_cf = 0; - mgr_non_c_to_f = 0; - - HYPRE_Int flow_size = 2*(mgr_idx_array[2] - mgr_idx_array[1]); - HYPRE_Int *flow_size_array = hypre_CTAlloc(HYPRE_Int, num_procs, HYPRE_MEMORY_HOST); - hypre_MPI_Allgather(&flow_size, 1, HYPRE_MPI_INT, flow_size_array, 1, HYPRE_MPI_INT, hypre_MPI_COMM_WORLD); - HYPRE_Int flow_ibegin = 0; - for (HYPRE_Int i = 0; i < myid; i++) - { - //printf("My_id = %d, flow size = %d\n", myid, *(flow_size_array+i)); - flow_ibegin += flow_size_array[i]; - } - HYPRE_Int *mgr_flow_idx_array = hypre_CTAlloc(HYPRE_Int, 2, HYPRE_MEMORY_HOST); - mgr_flow_idx_array[0] = flow_ibegin; - mgr_flow_idx_array[1] = flow_ibegin + flow_size_array[myid]/2; - - /* set MGR data by block */ - if (use_block_cf) { - HYPRE_MGRSetCpointsByContiguousBlock( mgr_solver_flow, mgr_bsize, mgr_nlevels, mgr_flow_idx_array, mgr_num_cindexes, mgr_cindexes); - } else { - HYPRE_MGRSetCpointsByBlock( mgr_solver_flow, mgr_bsize, mgr_nlevels, mgr_num_cindexes,mgr_cindexes); - } - /* set reserved coarse nodes */ - if(mgr_num_reserved_nodes)HYPRE_MGRSetReservedCoarseNodes(mgr_solver_flow, mgr_num_reserved_nodes, mgr_reserved_coarse_indexes); - - /* set intermediate coarse grid strategy */ - HYPRE_MGRSetNonCpointsToFpoints(mgr_solver_flow, mgr_non_c_to_f); - /* set F relaxation strategy */ - HYPRE_MGRSetFRelaxMethod(mgr_solver_flow, mgr_frelax_method); - /* set F relaxation number of functions*/ - //HYPRE_MGRSetLevelFRelaxNumFunctions(mgr_solver_flow, mgr_frelax_num_functions); - /* set relax type for single level F-relaxation and post-relaxation */ - HYPRE_MGRSetRelaxType(mgr_solver_flow, mgr_relax_type); - HYPRE_MGRSetNumRelaxSweeps(mgr_solver_flow, mgr_num_relax_sweeps); - /* set restrict type */ - HYPRE_MGRSetRestrictType(mgr_solver_flow, mgr_restrict_type); - HYPRE_MGRSetNumRestrictSweeps(mgr_solver_flow, mgr_num_restrict_sweeps); - /* set interpolation type */ - HYPRE_MGRSetInterpType(mgr_solver_flow, mgr_interp_type); - HYPRE_MGRSetNumInterpSweeps(mgr_solver_flow, mgr_num_interp_sweeps); - /* set P_max_elmts for coarse grid */ - HYPRE_MGRSetPMaxElmts(mgr_solver_flow, P_max_elmts); - /* set print level */ - HYPRE_MGRSetPrintLevel(mgr_solver_flow, 1); - /* set max iterations */ - HYPRE_MGRSetMaxIter(mgr_solver_flow, pc_max_iter); - HYPRE_MGRSetTol(mgr_solver_flow, pc_tol); - /* set coarse grid method, non-Galerkin will keep the stencil for interleaved ordering */ - //HYPRE_MGRSetCoarseGridMethod(mgr_solver_flow, mgr_coarse_grid_method); - - HYPRE_MGRSetGlobalsmoothType(mgr_solver_flow, mgr_gsmooth_type); - HYPRE_MGRSetMaxGlobalsmoothIters( mgr_solver_flow, mgr_num_gsmooth_sweeps ); - hypre_MGRPrintCoarseSystem( mgr_solver_flow, 0 ); - - HYPRE_BoomerAMGCreate(&amg_solver); - // BM Aug 25, 2006 - HYPRE_BoomerAMGSetPrintLevel(amg_solver, 0); - HYPRE_BoomerAMGSetRelaxOrder(amg_solver, 1); - HYPRE_BoomerAMGSetMaxIter(amg_solver, 1); - //HYPRE_BoomerAMGSetSmoothType(amg_solver, 9); - //HYPRE_BoomerAMGSetEuLevel(amg_solver, 1); - //HYPRE_BoomerAMGSetSmoothNumLevels(amg_solver, 1); - //HYPRE_BoomerAMGSetSmoothNumSweeps(amg_solver, 1); - - // set the MGR coarse solver. Comment out to use default CG solver in MGR - HYPRE_MGRSetCoarseSolver( mgr_solver_flow, HYPRE_BoomerAMGSolve, HYPRE_BoomerAMGSetup, amg_solver); - - HYPRE_GMRESSetPrecond(gmres_flow, - (HYPRE_PtrToSolverFcn) HYPRE_MGRSolve, - (HYPRE_PtrToSolverFcn) HYPRE_MGRSetup, - mgr_solver_flow); - - /* set the MGR coarse solver. Comment out to use default CG solver in MGR */ - //HYPRE_MGRSetCoarseSolver( pcg_precond, (HYPRE_PtrToParSolverFcn)HYPRE_GMRESSolve, (HYPRE_PtrToParSolverFcn)HYPRE_GMRESSetup, gmres_flow); - HYPRE_MGRSetCoarseSolver( pcg_precond, (HYPRE_PtrToParSolverFcn)HYPRE_MGRSolve, (HYPRE_PtrToParSolverFcn)HYPRE_MGRSetup, mgr_solver_flow); - - /* setup MGR-PCG solver */ - HYPRE_FlexGMRESSetMaxIter(pcg_solver, max_iter); - HYPRE_FlexGMRESSetPrecond(pcg_solver, - (HYPRE_PtrToSolverFcn) HYPRE_MGRSolve, - (HYPRE_PtrToSolverFcn) HYPRE_MGRSetup, - pcg_precond); - - - HYPRE_FlexGMRESGetPrecond(pcg_solver, &pcg_precond_gotten); - if (pcg_precond_gotten != pcg_precond) - { - hypre_printf("HYPRE_FlexGMRESGetPrecond got bad precond\n"); - return(-1); - } - else - if (myid == 0) - hypre_printf("HYPRE_FlexGMRESGetPrecond got good precond\n"); - - - HYPRE_FlexGMRESSetup - (pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, (HYPRE_Vector)x); - - hypre_EndTiming(time_index); - hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); - - time_index = hypre_InitializeTiming("FlexGMRES Solve"); - hypre_BeginTiming(time_index); - - HYPRE_FlexGMRESSolve - (pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)b, (HYPRE_Vector)x); - - hypre_EndTiming(time_index); - hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); - - if (print_system) - { - hypre_ParVectorPrintIJ(x, 1, "x.out"); - } - - HYPRE_FlexGMRESGetNumIterations(pcg_solver, &num_iterations); - HYPRE_FlexGMRESGetFinalRelativeResidualNorm(pcg_solver,&final_res_norm); - //HYPRE_FlexGMRESGetPrecondLogData(pcg_solver, &cg_conv_factor); - //hypre_printf("Average coarse grid convergence factor: %1.6f\n", cg_conv_factor); - - // free memory for flex FlexGMRES - HYPRE_ParCSRFlexGMRESDestroy(pcg_solver); - - /* free memory for MGR */ - /* - if(mgr_num_cindexes) - hypre_TFree(mgr_num_cindexes, HYPRE_MEMORY_HOST); - mgr_num_cindexes = NULL; - - if(mgr_reserved_coarse_indexes) - hypre_TFree(mgr_reserved_coarse_indexes, HYPRE_MEMORY_HOST); - mgr_reserved_coarse_indexes = NULL; - - if(mgr_cindexes) - { - for( i=0; i 0) hypre_TFree(mgr_reserved_coarse_indexes, HYPRE_MEMORY_HOST); - - hypre_MPI_Finalize(); - - return (0); -} diff --git a/external/hypre/src/test/zboxloop.c b/external/hypre/src/test/zboxloop.c index f506d7f4..b4c697b7 100644 --- a/external/hypre/src/test/zboxloop.c +++ b/external/hypre/src/test/zboxloop.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -20,8 +20,6 @@ * Test driver to time new boxloops and compare to the old ones *--------------------------------------------------------------------------*/ -#define DEVICE_VAR - hypre_int main( hypre_int argc, char *argv[] ) @@ -39,6 +37,7 @@ main( hypre_int argc, //HYPRE_Int xi1, xi2, xi3, xi4; HYPRE_Int xi1; HYPRE_Real *xp1, *xp2, *xp3, *xp4; + HYPRE_Real *d_xp1, *d_xp2, *d_xp3, *d_xp4; hypre_Index loop_size, start, unit_stride, index; /*----------------------------------------------------------- @@ -51,6 +50,12 @@ main( hypre_int argc, hypre_MPI_Comm_size(hypre_MPI_COMM_WORLD, &num_procs ); hypre_MPI_Comm_rank(hypre_MPI_COMM_WORLD, &myid ); + HYPRE_Initialize(); + +#if defined(HYPRE_USING_KOKKOS) + Kokkos::initialize (argc, argv); +#endif + /*----------------------------------------------------------- * Set defaults *-----------------------------------------------------------*/ @@ -65,6 +70,8 @@ main( hypre_int argc, Q = 1; R = 1; + reps = -1; + /*----------------------------------------------------------- * Parse command line *-----------------------------------------------------------*/ @@ -92,6 +99,11 @@ main( hypre_int argc, arg_index++; dim = atoi(argv[arg_index++]); } + else if ( strcmp(argv[arg_index], "-reps") == 0 ) + { + arg_index++; + reps = atoi(argv[arg_index++]); + } else if ( strcmp(argv[arg_index], "-help") == 0 ) { print_usage = 1; @@ -127,7 +139,7 @@ main( hypre_int argc, * Check a few things *-----------------------------------------------------------*/ - if ((P*Q*R) > num_procs) + if ((P * Q * R) > num_procs) { if (myid == 0) { @@ -135,7 +147,7 @@ main( hypre_int argc, } exit(1); } - else if ((P*Q*R) < num_procs) + else if ((P * Q * R) < num_procs) { if (myid == 0) { @@ -156,18 +168,26 @@ main( hypre_int argc, x3_data_box = hypre_BoxCreate(dim); x4_data_box = hypre_BoxCreate(dim); hypre_SetIndex3(hypre_BoxIMin(x1_data_box), 0, 0, 0); - hypre_SetIndex3(hypre_BoxIMax(x1_data_box), nx+1, ny+1, nz+1); + hypre_SetIndex3(hypre_BoxIMax(x1_data_box), nx + 1, ny + 1, nz + 1); hypre_CopyBox(x1_data_box, x2_data_box); hypre_CopyBox(x1_data_box, x3_data_box); hypre_CopyBox(x1_data_box, x4_data_box); - size = (nx+2)*(ny+2)*(nz+2); - xp1 = hypre_CTAlloc(HYPRE_Real, size, HYPRE_MEMORY_HOST); - xp2 = hypre_CTAlloc(HYPRE_Real, size, HYPRE_MEMORY_HOST); - xp3 = hypre_CTAlloc(HYPRE_Real, size, HYPRE_MEMORY_HOST); - xp4 = hypre_CTAlloc(HYPRE_Real, size, HYPRE_MEMORY_HOST); + size = (nx + 2) * (ny + 2) * (nz + 2); + xp1 = hypre_CTAlloc(HYPRE_Real, size, HYPRE_MEMORY_HOST); + xp2 = hypre_CTAlloc(HYPRE_Real, size, HYPRE_MEMORY_HOST); + xp3 = hypre_CTAlloc(HYPRE_Real, size, HYPRE_MEMORY_HOST); + xp4 = hypre_CTAlloc(HYPRE_Real, size, HYPRE_MEMORY_HOST); + + d_xp1 = hypre_CTAlloc(HYPRE_Real, size, HYPRE_MEMORY_DEVICE); + d_xp2 = hypre_CTAlloc(HYPRE_Real, size, HYPRE_MEMORY_DEVICE); + d_xp3 = hypre_CTAlloc(HYPRE_Real, size, HYPRE_MEMORY_DEVICE); + d_xp4 = hypre_CTAlloc(HYPRE_Real, size, HYPRE_MEMORY_DEVICE); - reps = 1000000000/(nx*ny*nz+1000); + if (reps < 0) + { + reps = 1000000000 / (nx * ny * nz + 1000); + } /*----------------------------------------------------------- * Print driver parameters @@ -190,7 +210,6 @@ main( hypre_int argc, zypre_BoxLoop1Begin(dim, loop_size, x1_data_box, start, unit_stride, xi1); - zypre_BoxLoop1For(xi1) { xp1[xi1] ++; } @@ -202,7 +221,7 @@ main( hypre_int argc, hypre_SerialBoxLoop1Begin(3, loop_size, x1_data_box, start, unit_stride, xi1); { - sum += xp1[xi1]; + sum += (HYPRE_Int)xp1[xi1]; if (xp1[xi1] != 1) { zypre_BoxLoopGetIndex(index); @@ -213,7 +232,7 @@ main( hypre_int argc, } hypre_SerialBoxLoop1End(xi1); - if (sum != (nx*ny*nz)) + if (sum != (nx * ny * nz)) { hypre_printf("*sum = %d\n", sum); fail = 1; @@ -230,7 +249,7 @@ main( hypre_int argc, hypre_MPI_Barrier(hypre_MPI_COMM_WORLD); /*----------------------------------------------------------- - * Time old boxloops + * Time (device) boxloops *-----------------------------------------------------------*/ /* Time BoxLoop0 */ @@ -239,12 +258,14 @@ main( hypre_int argc, for (rep = 0; rep < reps; rep++) { xi1 = 0; +#define DEVICE_VAR is_device_ptr(d_xp1) hypre_BoxLoop0Begin(3, loop_size); { - xp1[xi1] += xp1[xi1]; + d_xp1[xi1] += d_xp1[xi1]; //xi1++; } hypre_BoxLoop0End(); +#undef DEVICE_VAR } hypre_EndTiming(time_index); @@ -253,12 +274,14 @@ main( hypre_int argc, hypre_BeginTiming(time_index); for (rep = 0; rep < reps; rep++) { +#define DEVICE_VAR is_device_ptr(d_xp1) hypre_BoxLoop1Begin(3, loop_size, x1_data_box, start, unit_stride, xi1); { - xp1[xi1] += xp1[xi1]; + d_xp1[xi1] += d_xp1[xi1]; } hypre_BoxLoop1End(xi1); +#undef DEVICE_VAR } hypre_EndTiming(time_index); @@ -267,13 +290,15 @@ main( hypre_int argc, hypre_BeginTiming(time_index); for (rep = 0; rep < reps; rep++) { +#define DEVICE_VAR is_device_ptr(d_xp1,d_xp2) hypre_BoxLoop2Begin(3, loop_size, x1_data_box, start, unit_stride, xi1, x2_data_box, start, unit_stride, xi2); { - xp1[xi1] += xp1[xi1] + xp2[xi2]; + d_xp1[xi1] += d_xp1[xi1] + d_xp2[xi2]; } hypre_BoxLoop2End(xi1, xi2); +#undef DEVICE_VAR } hypre_EndTiming(time_index); @@ -282,14 +307,16 @@ main( hypre_int argc, hypre_BeginTiming(time_index); for (rep = 0; rep < reps; rep++) { +#define DEVICE_VAR is_device_ptr(d_xp1,d_xp2,d_xp3) hypre_BoxLoop3Begin(3, loop_size, x1_data_box, start, unit_stride, xi1, x2_data_box, start, unit_stride, xi2, x3_data_box, start, unit_stride, xi3); { - xp1[xi1] += xp1[xi1] + xp2[xi2] + xp3[xi3]; + d_xp1[xi1] += d_xp1[xi1] + d_xp2[xi2] + d_xp3[xi3]; } hypre_BoxLoop3End(xi1, xi2, xi3); +#undef DEVICE_VAR } hypre_EndTiming(time_index); @@ -298,24 +325,26 @@ main( hypre_int argc, hypre_BeginTiming(time_index); for (rep = 0; rep < reps; rep++) { +#define DEVICE_VAR is_device_ptr(d_xp1,d_xp2,d_xp3,d_xp4) hypre_BoxLoop4Begin(3, loop_size, x1_data_box, start, unit_stride, xi1, x2_data_box, start, unit_stride, xi2, x3_data_box, start, unit_stride, xi3, x4_data_box, start, unit_stride, xi4); { - xp1[xi1] += xp1[xi1] + xp2[xi2] + xp3[xi3] + xp4[xi4]; + d_xp1[xi1] += d_xp1[xi1] + d_xp2[xi2] + d_xp3[xi3] + d_xp4[xi4]; } hypre_BoxLoop4End(xi1, xi2, xi3, xi4); +#undef DEVICE_VAR } hypre_EndTiming(time_index); - hypre_PrintTiming("Old BoxLoop times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); + hypre_PrintTiming("BoxLoop times [DEVICE]", hypre_MPI_COMM_WORLD); + hypre_FinalizeAllTimings(); hypre_ClearTiming(); /*----------------------------------------------------------- - * Time new boxloops + * Time host boxloops *-----------------------------------------------------------*/ /* Time BoxLoop0 */ @@ -324,11 +353,9 @@ main( hypre_int argc, for (rep = 0; rep < reps; rep++) { xi1 = 0; +#undef HYPRE_OMP_CLAUSE +#define HYPRE_OMP_CLAUSE firstprivate(xi1) zypre_BoxLoop0Begin(dim, loop_size); -#ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(ZYPRE_BOX_PRIVATE) firstprivate(xi1) HYPRE_SMP_SCHEDULE -#endif - zypre_BoxLoop0For() { xp1[xi1] += xp1[xi1]; xi1++; @@ -344,10 +371,6 @@ main( hypre_int argc, { zypre_BoxLoop1Begin(dim, loop_size, x1_data_box, start, unit_stride, xi1); -#ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(ZYPRE_BOX_PRIVATE) HYPRE_SMP_SCHEDULE -#endif - zypre_BoxLoop1For(xi1) { xp1[xi1] += xp1[xi1]; } @@ -363,10 +386,6 @@ main( hypre_int argc, zypre_BoxLoop2Begin(dim, loop_size, x1_data_box, start, unit_stride, xi1, x2_data_box, start, unit_stride, xi2); -#ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(ZYPRE_BOX_PRIVATE) HYPRE_SMP_SCHEDULE -#endif - zypre_BoxLoop2For(xi1, xi2) { xp1[xi1] += xp1[xi1] + xp2[xi2]; } @@ -383,10 +402,6 @@ main( hypre_int argc, x1_data_box, start, unit_stride, xi1, x2_data_box, start, unit_stride, xi2, x3_data_box, start, unit_stride, xi3); -#ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(ZYPRE_BOX_PRIVATE) HYPRE_SMP_SCHEDULE -#endif - zypre_BoxLoop3For(xi1, xi2, xi3) { xp1[xi1] += xp1[xi1] + xp2[xi2] + xp3[xi3]; } @@ -404,10 +419,6 @@ main( hypre_int argc, x2_data_box, start, unit_stride, xi2, x3_data_box, start, unit_stride, xi3, x4_data_box, start, unit_stride, xi4); -#ifdef HYPRE_USING_OPENMP -#pragma omp parallel for private(ZYPRE_BOX_PRIVATE) HYPRE_SMP_SCHEDULE -#endif - zypre_BoxLoop4For(xi1, xi2, xi3, xi4) { xp1[xi1] += xp1[xi1] + xp2[xi2] + xp3[xi3] + xp4[xi4]; } @@ -415,10 +426,134 @@ main( hypre_int argc, } hypre_EndTiming(time_index); - hypre_PrintTiming("New BoxLoop times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); + hypre_PrintTiming("BoxLoop times [HOST]", hypre_MPI_COMM_WORLD); + hypre_FinalizeAllTimings(); + hypre_ClearTiming(); + + /*----------------------------------------------------------- + * Reduction Loops + *-----------------------------------------------------------*/ + { + HYPRE_Int i; + for (i = 0; i < size; i++) + { + xp1[i] = hypre_cos(i + 1.0); + xp2[i] = hypre_sin(i + 2.0); + } + hypre_TMemcpy(d_xp1, xp1, HYPRE_Real, size, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); + hypre_TMemcpy(d_xp2, xp2, HYPRE_Real, size, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); + } + +#if defined(HYPRE_USING_KOKKOS) + HYPRE_Real reducer = 0.0; +#elif defined(HYPRE_USING_RAJA) + ReduceSum reducer(0.0); +#elif defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + ReduceSum reducer(0.0); +#else + HYPRE_Real reducer = 0.0; +#endif + HYPRE_Real box_sum1 = 0.0, box_sum2 = 0.0; + +#undef HYPRE_BOX_REDUCTION +#if defined(HYPRE_USING_DEVICE_OPENMP) +#define HYPRE_BOX_REDUCTION map(tofrom:reducer) reduction(+:reducer) +#else +#define HYPRE_BOX_REDUCTION reduction(+:reducer) +#endif + + /*----------------------------------------------------------- + * Time (device) boxloops + *-----------------------------------------------------------*/ + + /* Time BoxLoop1Reduction */ + time_index = hypre_InitializeTiming("BoxLoopReduction1"); + hypre_BeginTiming(time_index); + for (rep = 0; rep < reps; rep++) + { + reducer = 0.0; +#define DEVICE_VAR is_device_ptr(d_xp1) + hypre_BoxLoop1ReductionBegin(3, loop_size, + x1_data_box, start, unit_stride, xi1, + reducer); + { + reducer += 1.0 / d_xp1[xi1]; + } + hypre_BoxLoop1ReductionEnd(xi1, reducer); +#undef DEVICE_VAR + box_sum1 += (HYPRE_Real) reducer; + } + hypre_EndTiming(time_index); + + /* Time BoxLoop2Reduction */ + time_index = hypre_InitializeTiming("BoxLoopReduction2"); + hypre_BeginTiming(time_index); + for (rep = 0; rep < reps; rep++) + { + reducer = 0.0; +#define DEVICE_VAR is_device_ptr(d_xp1,d_xp2) + hypre_BoxLoop2ReductionBegin(3, loop_size, + x1_data_box, start, unit_stride, xi1, + x2_data_box, start, unit_stride, xi2, + reducer); + { + reducer += 1.0 / d_xp1[xi1] + d_xp2[xi2] * 3.1415926; + } + hypre_BoxLoop2ReductionEnd(xi1, xi2, reducer); +#undef DEVICE_VAR + box_sum2 += (HYPRE_Real) reducer; + } + hypre_EndTiming(time_index); + + hypre_PrintTiming("BoxLoopReduction times [DEVICE]", hypre_MPI_COMM_WORLD); + hypre_FinalizeAllTimings(); hypre_ClearTiming(); + /*----------------------------------------------------------- + * Time host boxloops + *-----------------------------------------------------------*/ + HYPRE_Real zbox_sum1 = 0.0, zbox_sum2 = 0.0; + + /* Time BoxLoop1 */ + time_index = hypre_InitializeTiming("BoxLoopReduction1"); + hypre_BeginTiming(time_index); + for (rep = 0; rep < reps; rep++) + { +#undef HYPRE_BOX_REDUCTION +#define HYPRE_BOX_REDUCTION reduction(+:zbox_sum1) + zypre_BoxLoop1Begin(dim, loop_size, + x1_data_box, start, unit_stride, xi1); + { + zbox_sum1 += 1.0 / xp1[xi1]; + } + zypre_BoxLoop1End(xi1); + } + hypre_EndTiming(time_index); + + /* Time BoxLoop2 */ + time_index = hypre_InitializeTiming("BoxLoopReduction2"); + hypre_BeginTiming(time_index); + for (rep = 0; rep < reps; rep++) + { +#undef HYPRE_BOX_REDUCTION +#define HYPRE_BOX_REDUCTION reduction(+:zbox_sum2) + zypre_BoxLoop2Begin(dim, loop_size, + x1_data_box, start, unit_stride, xi1, + x2_data_box, start, unit_stride, xi2); + { + zbox_sum2 += 1.0 / xp1[xi1] + xp2[xi2] * 3.1415926; + } + zypre_BoxLoop2End(xi1, xi2); + } + hypre_EndTiming(time_index); + + hypre_PrintTiming("BoxLoopReduction times [HOST]", hypre_MPI_COMM_WORLD); + hypre_FinalizeAllTimings(); + hypre_ClearTiming(); + + hypre_printf("BoxLoopReduction1, error %e\n", hypre_abs((zbox_sum1 - box_sum1) / zbox_sum1)); + hypre_printf("BoxLoopReduction2, error %e\n", hypre_abs((zbox_sum2 - box_sum2) / zbox_sum2)); + /*----------------------------------------------------------- * Finalize things *-----------------------------------------------------------*/ @@ -427,14 +562,25 @@ main( hypre_int argc, hypre_BoxDestroy(x2_data_box); hypre_BoxDestroy(x3_data_box); hypre_BoxDestroy(x4_data_box); + hypre_TFree(xp1, HYPRE_MEMORY_HOST); hypre_TFree(xp2, HYPRE_MEMORY_HOST); hypre_TFree(xp3, HYPRE_MEMORY_HOST); hypre_TFree(xp4, HYPRE_MEMORY_HOST); + hypre_TFree(d_xp1, HYPRE_MEMORY_DEVICE); + hypre_TFree(d_xp2, HYPRE_MEMORY_DEVICE); + hypre_TFree(d_xp3, HYPRE_MEMORY_DEVICE); + hypre_TFree(d_xp4, HYPRE_MEMORY_DEVICE); + +#if defined(HYPRE_USING_KOKKOS) + Kokkos::finalize (); +#endif + + HYPRE_Finalize(); + /* Finalize MPI */ hypre_MPI_Finalize(); return (0); } - diff --git a/external/hypre/src/utilities/CMakeLists.txt b/external/hypre/src/utilities/CMakeLists.txt index 50213231..27af9d86 100644 --- a/external/hypre/src/utilities/CMakeLists.txt +++ b/external/hypre/src/utilities/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -6,6 +6,7 @@ set(HDRS HYPRE_utilities.h _hypre_utilities.h + _hypre_utilities.hpp HYPRE_error_f.h fortran.h fortran_matrix.h @@ -23,14 +24,19 @@ set(SRCS ap.c log.c complex.c - cuda_utils.c + device_utils.c error.c general.c handle.c int_array.c + int_array_device.c hopscotch_hash.c + matrix_stats.c + magma.c memory.c + memory_tracker.c merge_sort.c + mmio.c mpi_comm_f2c.c nvtx.c omp_device.c @@ -41,6 +47,8 @@ set(SRCS mpistubs.c qsplit.c random.c + state.c + stl_ops.c threading.c timer.c timing.c @@ -51,19 +59,21 @@ target_sources(${PROJECT_NAME} ${HDRS} ) -if (HYPRE_USING_CUDA) - set(CUDA_SRCS - HYPRE_handle.c - cuda_utils.c - handle.c - int_array.c +if (HYPRE_USING_GPU) + set(GPU_SRCS + device_utils.c general.c + handle.c + int_array_device.c memory.c - omp_device.c + memory_tracker.c nvtx.c + omp_device.c + stl_ops.c + HYPRE_handle.c ) - convert_filenames_to_full_paths(CUDA_SRCS) - set(HYPRE_CUDA_SOURCES ${HYPRE_CUDA_SOURCES} ${CUDA_SRCS} PARENT_SCOPE) + convert_filenames_to_full_paths(GPU_SRCS) + set(HYPRE_GPU_SOURCES ${HYPRE_GPU_SOURCES} ${GPU_SRCS} PARENT_SCOPE) endif () convert_filenames_to_full_paths(HDRS) diff --git a/external/hypre/src/utilities/F90_HYPRE_error.c b/external/hypre/src/utilities/F90_HYPRE_error.c index 49f58d43..4047faf4 100644 --- a/external/hypre/src/utilities/F90_HYPRE_error.c +++ b/external/hypre/src/utilities/F90_HYPRE_error.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -14,43 +14,43 @@ extern "C" { void hypre_F90_IFACE(hypre_geterror, HYPRE_GETERROR) - (hypre_F90_Int *result) +(hypre_F90_Int *result) { *result = (hypre_F90_Int) HYPRE_GetError(); } void hypre_F90_IFACE(hypre_checkerror, HYPRE_CHECKERROR) - (hypre_F90_Int *ierr, - hypre_F90_Int *hypre_error_code, - hypre_F90_Int *result) +(hypre_F90_Int *ierr, + hypre_F90_Int *hypre_error_code, + hypre_F90_Int *result) { *result = (hypre_F90_Int) HYPRE_CheckError( - hypre_F90_PassInt(ierr), - hypre_F90_PassInt(hypre_error_code)); + hypre_F90_PassInt(ierr), + hypre_F90_PassInt(hypre_error_code)); } void hypre_F90_IFACE(hypre_geterrorarg, HYPRE_GETERRORARG) - (hypre_F90_Int *result) +(hypre_F90_Int *result) { *result = (hypre_F90_Int) HYPRE_GetErrorArg(); } void hypre_F90_IFACE(hypre_clearallerrors, HYPRE_CLEARALLERRORS) - (hypre_F90_Int *result) +(hypre_F90_Int *result) { *result = HYPRE_ClearAllErrors(); } void hypre_F90_IFACE(hypre_clearerror, HYPRE_CLEARERROR) - (hypre_F90_Int *hypre_error_code, - hypre_F90_Int *result) +(hypre_F90_Int *hypre_error_code, + hypre_F90_Int *result) { *result = (hypre_F90_Int) HYPRE_ClearError( - hypre_F90_PassInt(hypre_error_code)); + hypre_F90_PassInt(hypre_error_code)); } #ifdef __cplusplus diff --git a/external/hypre/src/utilities/F90_HYPRE_general.c b/external/hypre/src/utilities/F90_HYPRE_general.c index 571aa009..9ad6bf93 100644 --- a/external/hypre/src/utilities/F90_HYPRE_general.c +++ b/external/hypre/src/utilities/F90_HYPRE_general.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -14,18 +14,49 @@ extern "C" { void hypre_F90_IFACE(hypre_init, HYPRE_INIT) - (hypre_F90_Int *ierr) +(hypre_F90_Int *ierr) { - *ierr = (hypre_F90_Int) HYPRE_Init(); + *ierr = (hypre_F90_Int) HYPRE_Initialize(); +} + +void +hypre_F90_IFACE(hypre_initialize, HYPRE_INITIALIZE) +(hypre_F90_Int *ierr) +{ + *ierr = (hypre_F90_Int) HYPRE_Initialize(); } void hypre_F90_IFACE(hypre_finalize, HYPRE_FINALIZE) - (hypre_F90_Int *ierr) +(hypre_F90_Int *ierr) { *ierr = (hypre_F90_Int) HYPRE_Finalize(); } +void +hypre_F90_IFACE(hypre_setmemorylocation, HYPRE_SETMEMORYLOCATION) +(hypre_F90_Int *memory_location, hypre_F90_Int *ierr) +{ + HYPRE_MemoryLocation loc = (HYPRE_MemoryLocation) * memory_location; + *ierr = (hypre_F90_Int) HYPRE_SetMemoryLocation(loc); +} + +void +hypre_F90_IFACE(hypre_setexecutionpolicy, HYPRE_SETEXECUTIONPOLICY) +(hypre_F90_Int *exec_policy, hypre_F90_Int *ierr) +{ + HYPRE_ExecutionPolicy exec = (HYPRE_ExecutionPolicy) * exec_policy; + + *ierr = (hypre_F90_Int) HYPRE_SetExecutionPolicy(exec); +} + +void +hypre_F90_IFACE(hypre_setspgemmusevendor, HYPRE_SETSPGEMMUSEVENDOR) +(hypre_F90_Int *use_vendor, hypre_F90_Int *ierr) +{ + *ierr = (hypre_F90_Int) HYPRE_SetSpGemmUseVendor(*use_vendor); +} + #ifdef __cplusplus } #endif diff --git a/external/hypre/src/utilities/HYPRE_error_f.h b/external/hypre/src/utilities/HYPRE_error_f.h index 0985a9ae..83f3d8a0 100644 --- a/external/hypre/src/utilities/HYPRE_error_f.h +++ b/external/hypre/src/utilities/HYPRE_error_f.h @@ -1,4 +1,4 @@ -! Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +! Copyright (c) 1998 Lawrence Livermore National Security, LLC and other ! HYPRE Project Developers. See the top-level COPYRIGHT file for details. ! ! SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/utilities/HYPRE_handle.c b/external/hypre/src/utilities/HYPRE_handle.c index d8c69a24..c052dc4c 100644 --- a/external/hypre/src/utilities/HYPRE_handle.c +++ b/external/hypre/src/utilities/HYPRE_handle.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -14,20 +14,61 @@ #include "_hypre_utilities.h" /*-------------------------------------------------------------------------- - * HYPRE_SetSpGemmUseCusparse + * HYPRE_SetLogLevel *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SetLogLevel( HYPRE_Int log_level ) +{ + return hypre_SetLogLevel(log_level); +} + +/*-------------------------------------------------------------------------- + * HYPRE_SetSpTransUseVendor + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SetSpTransUseVendor( HYPRE_Int use_vendor ) +{ + return hypre_SetSpTransUseVendor(use_vendor); +} + +/*-------------------------------------------------------------------------- + * HYPRE_SetSpMVUseVendor + *--------------------------------------------------------------------------*/ + HYPRE_Int -HYPRE_SetSpGemmUseCusparse( HYPRE_Int use_cusparse ) +HYPRE_SetSpMVUseVendor( HYPRE_Int use_vendor ) { - return hypre_SetSpGemmUseCusparse(use_cusparse); + return hypre_SetSpMVUseVendor(use_vendor); +} + +/*-------------------------------------------------------------------------- + * HYPRE_SetSpGemmUseVendor + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SetSpGemmUseVendor( HYPRE_Int use_vendor ) +{ + return hypre_SetSpGemmUseVendor(use_vendor); } /*-------------------------------------------------------------------------- * HYPRE_SetUseGpuRand *--------------------------------------------------------------------------*/ + HYPRE_Int -HYPRE_SetUseGpuRand( HYPRE_Int use_curand ) +HYPRE_SetUseGpuRand( HYPRE_Int use_gpu_rand ) { - return hypre_SetUseGpuRand(use_curand); + return hypre_SetUseGpuRand(use_gpu_rand); } +/*-------------------------------------------------------------------------- + * HYPRE_SetGPUAwareMPI + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SetGpuAwareMPI( HYPRE_Int use_gpu_aware_mpi ) +{ + return hypre_SetGpuAwareMPI(use_gpu_aware_mpi); +} diff --git a/external/hypre/src/utilities/HYPRE_utilities.h b/external/hypre/src/utilities/HYPRE_utilities.h index 106e70ae..0dd1b70f 100644 --- a/external/hypre/src/utilities/HYPRE_utilities.h +++ b/external/hypre/src/utilities/HYPRE_utilities.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -35,18 +35,36 @@ extern "C" { #if defined(HYPRE_BIGINT) typedef long long int HYPRE_BigInt; typedef long long int HYPRE_Int; + +#define HYPRE_BIG_INT_MAX LLONG_MAX +#define HYPRE_BIG_INT_MIN LLONG_MIN +#define HYPRE_INT_MAX LLONG_MAX +#define HYPRE_INT_MIN LLONG_MIN + #define HYPRE_MPI_BIG_INT MPI_LONG_LONG_INT #define HYPRE_MPI_INT MPI_LONG_LONG_INT #elif defined(HYPRE_MIXEDINT) typedef long long int HYPRE_BigInt; typedef int HYPRE_Int; + +#define HYPRE_BIG_INT_MAX LLONG_MAX +#define HYPRE_BIG_INT_MIN LLONG_MIN +#define HYPRE_INT_MAX INT_MAX +#define HYPRE_INT_MIN INT_MIN + #define HYPRE_MPI_BIG_INT MPI_LONG_LONG_INT #define HYPRE_MPI_INT MPI_INT #else /* default */ typedef int HYPRE_BigInt; typedef int HYPRE_Int; + +#define HYPRE_BIG_INT_MAX INT_MAX +#define HYPRE_BIG_INT_MIN INT_MIN +#define HYPRE_INT_MAX INT_MAX +#define HYPRE_INT_MIN INT_MIN + #define HYPRE_MPI_BIG_INT MPI_INT #define HYPRE_MPI_INT MPI_INT #endif @@ -61,6 +79,11 @@ typedef int HYPRE_Int; typedef float HYPRE_Real; #define HYPRE_REAL_MAX FLT_MAX #define HYPRE_REAL_MIN FLT_MIN +#if defined(FLT_TRUE_MIN) +#define HYPRE_REAL_TRUE_MIN FLT_TRUE_MIN +#else +#define HYPRE_REAL_TRUE_MIN FLT_MIN +#endif #define HYPRE_REAL_EPSILON FLT_EPSILON #define HYPRE_REAL_MIN_EXP FLT_MIN_EXP #define HYPRE_MPI_REAL MPI_FLOAT @@ -69,6 +92,11 @@ typedef float HYPRE_Real; typedef long double HYPRE_Real; #define HYPRE_REAL_MAX LDBL_MAX #define HYPRE_REAL_MIN LDBL_MIN +#if defined(LDBL_TRUE_MIN) +#define HYPRE_REAL_TRUE_MIN LDBL_TRUE_MIN +#else +#define HYPRE_REAL_TRUE_MIN LDBL_MIN +#endif #define HYPRE_REAL_EPSILON LDBL_EPSILON #define HYPRE_REAL_MIN_EXP DBL_MIN_EXP #define HYPRE_MPI_REAL MPI_LONG_DOUBLE @@ -77,15 +105,28 @@ typedef long double HYPRE_Real; typedef double HYPRE_Real; #define HYPRE_REAL_MAX DBL_MAX #define HYPRE_REAL_MIN DBL_MIN +#if defined(DBL_TRUE_MIN) +#define HYPRE_REAL_TRUE_MIN DBL_TRUE_MIN +#else +#define HYPRE_REAL_TRUE_MIN DBL_MIN +#endif #define HYPRE_REAL_EPSILON DBL_EPSILON #define HYPRE_REAL_MIN_EXP DBL_MIN_EXP #define HYPRE_MPI_REAL MPI_DOUBLE #endif #if defined(HYPRE_COMPLEX) +/* support for float double and long double complex types */ +#if defined(HYPRE_SINGLE) +typedef float _Complex HYPRE_Complex; +#define HYPRE_MPI_COMPLEX MPI_C_FLOAT_COMPLEX +#elif defined(HYPRE_LONG_DOUBLE) +typedef long double _Complex HYPRE_Complex; +#define HYPRE_MPI_COMPLEX MPI_C_LONG_DOUBLE_COMPLEX +#else /* default */ typedef double _Complex HYPRE_Complex; #define HYPRE_MPI_COMPLEX MPI_C_DOUBLE_COMPLEX /* or MPI_LONG_DOUBLE ? */ - +#endif #else /* default */ typedef HYPRE_Real HYPRE_Complex; #define HYPRE_MPI_COMPLEX HYPRE_MPI_REAL @@ -108,39 +149,132 @@ typedef HYPRE_Int MPI_Comm; #define HYPRE_ERROR_ARG 4 /* argument error */ /* bits 4-8 are reserved for the index of the argument error */ #define HYPRE_ERROR_CONV 256 /* method did not converge as expected */ +#define HYPRE_MAX_FILE_NAME_LEN 1024 /* longest filename length used in hypre */ +#define HYPRE_MAX_MSG_LEN 2048 /* longest message length */ /*-------------------------------------------------------------------------- * HYPRE init/finalize *--------------------------------------------------------------------------*/ -HYPRE_Int HYPRE_Init(); -HYPRE_Int HYPRE_Finalize(); +/** + * (Required) Initializes the hypre library. + **/ + +HYPRE_Int HYPRE_Initialize(void); + +/** + * (Required) Initializes the hypre library. This function is provided for backward compatibility. + * Please, use HYPRE_Initialize instead. + **/ + +#define HYPRE_Init() HYPRE_Initialize() + +/** + * (Optional) Initializes GPU features in the hypre library. + **/ + +HYPRE_Int HYPRE_DeviceInitialize(void); + +/** + * (Required) Finalizes the hypre library. + **/ + +HYPRE_Int HYPRE_Finalize(void); + +/** + * (Optional) Returns true if the hypre library has been initialized but not finalized yet. + **/ + +HYPRE_Int HYPRE_Initialized(void); + +/** + * (Optional) Returns true if the hypre library has been finalized but not re-initialized yet. + **/ + +HYPRE_Int HYPRE_Finalized(void); /*-------------------------------------------------------------------------- * HYPRE error user functions *--------------------------------------------------------------------------*/ +/* Return an aggregate error code representing the collective status of all ranks */ +HYPRE_Int HYPRE_GetGlobalError(MPI_Comm comm); + /* Return the current hypre error flag */ -HYPRE_Int HYPRE_GetError(); +HYPRE_Int HYPRE_GetError(void); /* Check if the given error flag contains the given error code */ HYPRE_Int HYPRE_CheckError(HYPRE_Int hypre_ierr, HYPRE_Int hypre_error_code); /* Return the index of the argument (counting from 1) where argument error (HYPRE_ERROR_ARG) has occured */ -HYPRE_Int HYPRE_GetErrorArg(); +HYPRE_Int HYPRE_GetErrorArg(void); /* Describe the given error flag in the given string */ void HYPRE_DescribeError(HYPRE_Int hypre_ierr, char *descr); /* Clears the hypre error flag */ -HYPRE_Int HYPRE_ClearAllErrors(); +HYPRE_Int HYPRE_ClearAllErrors(void); /* Clears the given error code from the hypre error flag */ HYPRE_Int HYPRE_ClearError(HYPRE_Int hypre_error_code); +/* Set behavior for printing errors: mode 0 = stderr, mode 1 = memory buffer */ +HYPRE_Int HYPRE_SetPrintErrorMode(HYPRE_Int mode); + +/* Set which error code messages to record for printing: code is an error code + * such as HYPRE_ERROR_CONV, code -1 = all codes, verbosity 0 = do not record */ +HYPRE_Int HYPRE_SetPrintErrorVerbosity(HYPRE_Int code, HYPRE_Int verbosity); + +/* Return a buffer of error messages and clear them in hypre */ +HYPRE_Int HYPRE_GetErrorMessages(char **buffer, HYPRE_Int *bufsz); + +/* Print the error messages and clear them in hypre */ +HYPRE_Int HYPRE_PrintErrorMessages(MPI_Comm comm); + +/* Clear the error messages in hypre and free any related memory allocated */ +HYPRE_Int HYPRE_ClearErrorMessages(void); + /* Print GPU information */ -HYPRE_Int HYPRE_PrintDeviceInfo(); +HYPRE_Int HYPRE_PrintDeviceInfo(void); + +/** + * @brief Prints the memory usage of the current process. + * + * This function prints the memory usage details of the process to standard output. + * It provides information such as the virtual memory size, resident set size, + * and other related statistics including GPU memory usage for device builds. + * + * @param[in] comm The MPI communicator. This parameter allows the function + * to print memory usage information for the process within + * the context of an MPI program. + * + * @param[in] level The level of detail in the memory statistics output. + * - 1 : Display memory usage statistics for each MPI rank. + * - 2 : Display aggregate memory usage statistics over MPI ranks. + * + * @param[in] function The name of the function from which `HYPRE_MemoryPrintUsage` + * is called. This is typically set to `__func__`, which + * automatically captures the name of the calling function. + * This variable can also be used to denote a region name. + * + * @param[in] line The line number in the source file where `HYPRE_MemoryPrintUsage` + * is called. This is typically set to `__LINE__`, which + * automatically captures the line number. The line number can be + * omitted by passing a negative value to this variable. + * + * @return Returns an integer status code. `0` indicates success, while + * a non-zero value indicates an error occurred. + * + * @note The function is designed to be platform-independent but + * may provide different levels of detail depending on the + * underlying operating system (e.g., Linux, macOS). However, + * this function does not lead to correct memory usage statistics + * on Windows platforms. + */ + +HYPRE_Int HYPRE_MemoryPrintUsage(MPI_Comm comm, HYPRE_Int level, const char *function, + HYPRE_Int line); /*-------------------------------------------------------------------------- * HYPRE Version routines @@ -170,8 +304,10 @@ HYPRE_VersionNumber( HYPRE_Int *major_ptr, * HYPRE AP user functions *--------------------------------------------------------------------------*/ -/*Checks whether the AP is on */ -HYPRE_Int HYPRE_AssumedPartitionCheck(); +/* Checks whether the AP is on */ +/* TODO (VPM): this function is provided for backwards compatibility + and will be removed in a future release */ +HYPRE_Int HYPRE_AssumedPartitionCheck(void); /*-------------------------------------------------------------------------- * HYPRE memory location @@ -180,11 +316,20 @@ HYPRE_Int HYPRE_AssumedPartitionCheck(); typedef enum _HYPRE_MemoryLocation { HYPRE_MEMORY_UNDEFINED = -1, - HYPRE_MEMORY_HOST , + HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE } HYPRE_MemoryLocation; +/** + * (Optional) Sets the default (abstract) memory location. + **/ + HYPRE_Int HYPRE_SetMemoryLocation(HYPRE_MemoryLocation memory_location); + +/** + * (Optional) Gets a pointer to the default (abstract) memory location. + **/ + HYPRE_Int HYPRE_GetMemoryLocation(HYPRE_MemoryLocation *memory_location); #include @@ -196,41 +341,255 @@ HYPRE_Int HYPRE_GetMemoryLocation(HYPRE_MemoryLocation *memory_location); typedef enum _HYPRE_ExecutionPolicy { HYPRE_EXEC_UNDEFINED = -1, - HYPRE_EXEC_HOST , + HYPRE_EXEC_HOST, HYPRE_EXEC_DEVICE } HYPRE_ExecutionPolicy; +/** + * (Optional) Sets the default execution policy. + **/ + HYPRE_Int HYPRE_SetExecutionPolicy(HYPRE_ExecutionPolicy exec_policy); + +/** + * (Optional) Gets a pointer to the default execution policy. + **/ + HYPRE_Int HYPRE_GetExecutionPolicy(HYPRE_ExecutionPolicy *exec_policy); -HYPRE_Int HYPRE_SetStructExecutionPolicy(HYPRE_ExecutionPolicy exec_policy); -HYPRE_Int HYPRE_GetStructExecutionPolicy(HYPRE_ExecutionPolicy *exec_policy); + +/** + * (Optional) Returns a string denoting the execution policy passed as input. + **/ + +const char* HYPRE_GetExecutionPolicyName(HYPRE_ExecutionPolicy exec_policy); /*-------------------------------------------------------------------------- * HYPRE UMPIRE *--------------------------------------------------------------------------*/ +/** + * @brief Sets the size of the Umpire device memory pool. + * + * @param[in] nbytes The size of the device memory pool in bytes. + * + * @return Returns hypre's global error code, where 0 indicates success. + **/ HYPRE_Int HYPRE_SetUmpireDevicePoolSize(size_t nbytes); + +/** + * @brief Sets the size of the Umpire unified memory pool. + * + * @param[in] nbytes The size of the unified memory pool in bytes. + * + * @return Returns hypre's global error code, where 0 indicates success. + **/ HYPRE_Int HYPRE_SetUmpireUMPoolSize(size_t nbytes); + +/** + * @brief Sets the size of the Umpire host memory pool. + * + * @param[in] nbytes The size of the host memory pool in bytes. + * + * @return Returns hypre's global error code, where 0 indicates success. + **/ HYPRE_Int HYPRE_SetUmpireHostPoolSize(size_t nbytes); + +/** + * @brief Sets the size of the Umpire pinned memory pool. + * + * @param[in] nbytes The size of the pinned memory pool in bytes. + * + * @return Returns hypre's global error code, where 0 indicates success. + **/ HYPRE_Int HYPRE_SetUmpirePinnedPoolSize(size_t nbytes); + +/** + * @brief Sets the name of the Umpire device memory pool. + * + * @param[in] pool_name The name to assign to the device memory pool. + * + * @return Returns hypre's global error code, where 0 indicates success. + **/ HYPRE_Int HYPRE_SetUmpireDevicePoolName(const char *pool_name); + +/** + * @brief Sets the name of the Umpire unified memory pool. + * + * @param[in] pool_name The name to assign to the unified memory pool. + * + * @return Returns hypre's global error code, where 0 indicates success. + **/ HYPRE_Int HYPRE_SetUmpireUMPoolName(const char *pool_name); + +/** + * @brief Sets the name of the Umpire host memory pool. + * + * @param[in] pool_name The name to assign to the host memory pool. + * + * @return Returns hypre's global error code, where 0 indicates success. + **/ HYPRE_Int HYPRE_SetUmpireHostPoolName(const char *pool_name); + +/** + * @brief Sets the name of the Umpire pinned memory pool. + * + * @param[in] pool_name The name to assign to the pinned memory pool. + * + * @return Returns hypre's global error code, where 0 indicates success. + **/ HYPRE_Int HYPRE_SetUmpirePinnedPoolName(const char *pool_name); /*-------------------------------------------------------------------------- * HYPRE GPU memory pool *--------------------------------------------------------------------------*/ -HYPRE_Int HYPRE_SetGPUMemoryPoolSize(HYPRE_Int bin_growth, HYPRE_Int min_bin, HYPRE_Int max_bin, size_t max_cached_bytes); +HYPRE_Int HYPRE_SetGPUMemoryPoolSize(HYPRE_Int bin_growth, HYPRE_Int min_bin, HYPRE_Int max_bin, + size_t max_cached_bytes); /*-------------------------------------------------------------------------- * HYPRE handle *--------------------------------------------------------------------------*/ -HYPRE_Int HYPRE_SetSpGemmUseCusparse( HYPRE_Int use_cusparse ); +/** + * Sets the logging level for the HYPRE library. + * + * The following options are available for \e log_level: + * + * - 0 : (default) No messaging. + * - 1 : Display memory usage statistics for each MPI rank. + * - 2 : Display aggregate memory usage statistics over MPI ranks. + * + * @note Log level codes can be combined using bitwise OR to enable multiple + * logging behaviors simultaneously. + * + * @param log_level The logging level to set. + * + * @return Returns hypre's global error code, where 0 indicates success. + **/ +HYPRE_Int HYPRE_SetLogLevel(HYPRE_Int log_level); + +/** + * Specifies the algorithm used for sparse matrix transposition in device builds. + * + * The following options are available for \e use_vendor: + * + * - 0 : Use hypre's internal implementation. + * - 1 : (default) Use the vendor library's implementation. This includes: + * - cuSPARSE for CUDA (HYPRE_USING_CUSPARSE) + * - rocSPARSE for HIP (HYPRE_USING_ROCSPARSE) + * - oneMKL for SYCL (HYPRE_USING_ONEMKLSPARSE) + * + * @param use_vendor Indicates whether to use the internal or vendor-provided implementation. + * + * @return Returns hypre's global error code, where 0 indicates success. + **/ +HYPRE_Int HYPRE_SetSpTransUseVendor(HYPRE_Int use_vendor); + +/** + * Specifies the algorithm used for sparse matrix/vector multiplication in device builds. + * + * The following options are available for \e use_vendor: + * + * - 0 : Use hypre's internal implementation. + * - 1 : (default) Use the vendor library's implementation. This includes: + * - cuSPARSE for CUDA (HYPRE_USING_CUSPARSE) + * - rocSPARSE for HIP (HYPRE_USING_ROCSPARSE) + * - oneMKL for SYCL (HYPRE_USING_ONEMKLSPARSE) + * + * @param use_vendor Indicates whether to use the internal or vendor-provided implementation. + * + * @return Returns hypre's global error code, where 0 indicates success. + **/ +HYPRE_Int HYPRE_SetSpMVUseVendor(HYPRE_Int use_vendor); + +/** + * Specifies the algorithm used for sparse matrix/matrix multiplication in device builds. + * + * The following options are available for \e use_vendor: + * + * - 0 : Use hypre's internal implementation. + * - 1 : Use the vendor library's implementation. This includes: + * - cuSPARSE for CUDA (HYPRE_USING_CUSPARSE) + * - rocSPARSE for HIP (HYPRE_USING_ROCSPARSE) + * - oneMKL for SYCL (HYPRE_USING_ONEMKLSPARSE) + * + * @param use_vendor Indicates whether to use the internal or vendor-provided implementation. + * + * @note The default value is 1, except for CUDA builds, which is zero. + * + * @return Returns hypre's global error code, where 0 indicates success. + **/ +HYPRE_Int HYPRE_SetSpGemmUseVendor( HYPRE_Int use_vendor ); +/* Backwards compatibility with HYPRE_SetSpGemmUseCusparse() */ +#define HYPRE_SetSpGemmUseCusparse(use_vendor) HYPRE_SetSpGemmUseVendor(use_vendor) + +/** + * Specifies the algorithm used for generating random numbers in device builds. + * + * The following options are available for \e use_curand: + * + * - 0 : random numbers are generated on the host and copied to device memory. + * - 1 : (default) Use the vendor library's implementation. This includes: + * - cuSPARSE for CUDA (HYPRE_USING_CUSPARSE) + * - rocSPARSE for HIP (HYPRE_USING_ROCSPARSE) + * - oneMKL for SYCL (HYPRE_USING_ONEMKLSPARSE) + * + * @param use_curand Indicates whether to use the vendor-provided implementation or not. + * + * @return Returns hypre's global error code, where 0 indicates success. + **/ + HYPRE_Int HYPRE_SetUseGpuRand( HYPRE_Int use_curand ); +/** + * Configures the usage of GPU-aware MPI for communication in device builds. + * + * The following options are available for \e use_gpu_aware_mpi: + * + * - 0 : MPI buffers are transferred between device and host memory. Communication occurs on the host. + * - 1 : MPI communication is performed directly from the device using device-resident buffers. + * + * @param use_gpu_aware_mpi Specifies whether to enable GPU-aware MPI communication or not. + * + * @note This option requires hypre to be configured with GPU-aware MPI support for it to take effect. + * + * @return Returns hypre's global error code, where 0 indicates success. + **/ +HYPRE_Int HYPRE_SetGpuAwareMPI( HYPRE_Int use_gpu_aware_mpi ); + +/*-------------------------------------------------------------------------- + * Base objects + *--------------------------------------------------------------------------*/ + +/* RDF: How should we provide reference documentation for this (and above)? */ + +/* Base public solver struct */ +struct hypre_Solver_struct; +typedef struct hypre_Solver_struct *HYPRE_Solver; + +/* Base public matrix struct */ +struct hypre_Matrix_struct; +typedef struct hypre_Matrix_struct *HYPRE_Matrix; + +/* Base public vector struct */ +struct hypre_Vector_struct; +typedef struct hypre_Vector_struct *HYPRE_Vector; + +/* Base function pointers */ + +/* RDF: Note that only PtrToSolverFcn is needed at the user level right now to + * keep backward compatibility with SetPrecond(). In general, do we want these + * at the user level? I guess it doesn't hurt. */ + +/* RDF: Also note that PtrToSolverFcn is defined again in 'HYPRE_krylov.h' and + * probably needs to be for the reference manual. */ + +typedef HYPRE_Int (*HYPRE_PtrToSolverFcn)(HYPRE_Solver, + HYPRE_Matrix, + HYPRE_Vector, + HYPRE_Vector); +typedef HYPRE_Int (*HYPRE_PtrToDestroyFcn)(HYPRE_Solver); + #ifdef __cplusplus } #endif diff --git a/external/hypre/src/utilities/HYPRE_version.c b/external/hypre/src/utilities/HYPRE_version.c index e22ab923..734c70d6 100644 --- a/external/hypre/src/utilities/HYPRE_version.c +++ b/external/hypre/src/utilities/HYPRE_version.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/utilities/_hypre_onedpl.hpp b/external/hypre/src/utilities/_hypre_onedpl.hpp new file mode 100644 index 00000000..a0e8f36c --- /dev/null +++ b/external/hypre/src/utilities/_hypre_onedpl.hpp @@ -0,0 +1,284 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#ifndef HYPRE_ONEDPL_H +#define HYPRE_ONEDPL_H + +#include "HYPRE_config.h" + +#if defined(HYPRE_USING_SYCL) + +/* oneAPI DPL headers */ +/* NOTE: these must be included before standard C++ headers */ + +/* WM: this is a workaround for a bug in oneDPL reduce by segment */ +#define ONEDPL_WORKAROUND_FOR_IGPU_64BIT_REDUCTION 1 + +#include +#include +#include +#include +#include +#include "_hypre_utilities.h" +#include "_hypre_utilities.hpp" + +/* WM: dpct below currently needed for constant iterators */ +#include + +//[pred, op](Ref1 a, Ref2 s) { return pred(s) ? op(a) : a; }); +template +struct hypreSycl_transform_if_unary_zip_mask_fun +{ + hypreSycl_transform_if_unary_zip_mask_fun(Predicate _pred, Operator _op) : pred(_pred), op(_op) {} + template + void operator()(_T&& t) const + { + using std::get; + if (pred(get<1>(t))) + { + get<2>(t) = op(get<0>(t)); + } + } + +private: + Predicate pred; + Operator op; +}; + +template +Iter3 hypreSycl_transform_if(Iter1 first, Iter1 last, Iter2 mask, + Iter3 result, UnaryOperation unary_op, Pred pred) +{ + static_assert( + std::is_same::iterator_category, + std::random_access_iterator_tag>::value && + std::is_same::iterator_category, + std::random_access_iterator_tag>::value && + std::is_same::iterator_category, + std::random_access_iterator_tag>::value, + "Iterators passed to algorithms must be random-access iterators."); + using T = typename std::iterator_traits::value_type; + const auto n = std::distance(first, last); + auto begin_for_each = oneapi::dpl::make_zip_iterator(first, mask, result); + HYPRE_ONEDPL_CALL( std::for_each, + begin_for_each, begin_for_each + n, + hypreSycl_transform_if_unary_zip_mask_fun(pred, unary_op) ); + return result + n; +} + +// Functor evaluates second element of tied sequence with predicate. +// Used by: copy_if +template struct hypreSycl_predicate_key_fun +{ + hypreSycl_predicate_key_fun(Predicate _pred) : pred(_pred) {} + + template bool operator()(_T1 &&a) const + { + return pred(std::get<1>(a)); + } + +private: + Predicate pred; +}; + +// Need custom version of copy_if when predicate operates on a mask +// instead of the data being copied (natively suppored in thrust, but +// not supported in oneDPL) +template +Iter3 hypreSycl_copy_if(Iter1 first, Iter1 last, Iter2 mask, + Iter3 result, Pred pred) +{ + static_assert( + std::is_same::iterator_category, + std::random_access_iterator_tag>::value && + std::is_same::iterator_category, + std::random_access_iterator_tag>::value && + std::is_same::iterator_category, + std::random_access_iterator_tag>::value, + "Iterators passed to algorithms must be random-access iterators."); + auto ret_val = HYPRE_ONEDPL_CALL( std::copy_if, + oneapi::dpl::make_zip_iterator(first, mask), + oneapi::dpl::make_zip_iterator(last, mask + std::distance(first, last)), + oneapi::dpl::make_zip_iterator(result, oneapi::dpl::discard_iterator()), + hypreSycl_predicate_key_fun(pred)); + return std::get<0>(ret_val.base()); +} + +// Similar to above, need mask version of remove_if +// NOTE: We copy the mask below because this implementation also +// remove elements from the mask in addition to the input. +template +Iter1 hypreSycl_remove_if(Iter1 first, Iter1 last, Iter2 mask, Pred pred) +{ + static_assert( + std::is_same::iterator_category, + std::random_access_iterator_tag>::value && + std::is_same::iterator_category, + std::random_access_iterator_tag>::value, + "Iterators passed to algorithms must be random-access iterators."); + using ValueType = typename std::iterator_traits::value_type; + Iter2 mask_cpy = hypre_CTAlloc(ValueType, std::distance(first, last), HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(mask_cpy, mask, ValueType, std::distance(first, last), HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + auto ret_val = HYPRE_ONEDPL_CALL( std::remove_if, + oneapi::dpl::make_zip_iterator(first, mask_cpy), + oneapi::dpl::make_zip_iterator(last, mask_cpy + std::distance(first, last)), + hypreSycl_predicate_key_fun(pred)); + hypre_TFree(mask_cpy, HYPRE_MEMORY_DEVICE); + return std::get<0>(ret_val.base()); +} + +// Similar to above, need mask version of remove_copy_if +template +Iter3 hypreSycl_remove_copy_if(Iter1 first, Iter1 last, Iter2 mask, Iter3 result, Pred pred) +{ + static_assert( + std::is_same::iterator_category, + std::random_access_iterator_tag>::value && + std::is_same::iterator_category, + std::random_access_iterator_tag>::value, + "Iterators passed to algorithms must be random-access iterators."); + auto ret_val = HYPRE_ONEDPL_CALL( std::remove_copy_if, + oneapi::dpl::make_zip_iterator(first, mask), + oneapi::dpl::make_zip_iterator(last, mask + std::distance(first, last)), + oneapi::dpl::make_zip_iterator(result, oneapi::dpl::discard_iterator()), + hypreSycl_predicate_key_fun(pred)); + return std::get<0>(ret_val.base()); +} + +// Equivalent of thrust::scatter_if +template +void hypreSycl_scatter_if(InputIter1 first, InputIter1 last, + InputIter2 map, InputIter3 mask, OutputIter result, + Predicate pred) +{ + static_assert( + std::is_same::iterator_category, + std::random_access_iterator_tag>::value && + std::is_same < + typename std::iterator_traits::iterator_category, + std::random_access_iterator_tag >::value && + std::is_same < + typename std::iterator_traits::iterator_category, + std::random_access_iterator_tag >::value && + std::is_same < + typename std::iterator_traits::iterator_category, + std::random_access_iterator_tag >::value, + "Iterators passed to algorithms must be random-access iterators."); + hypreSycl_transform_if(first, last, mask, + oneapi::dpl::make_permutation_iterator(result, map), + [ = ](auto &&v) { return v; }, [ = ](auto &&m) { return pred(m); }); +} + +// Equivalent of thrust::scatter +template +void hypreSycl_scatter(InputIter1 first, InputIter1 last, + InputIter2 map, OutputIter result) +{ + static_assert( + std::is_same::iterator_category, + std::random_access_iterator_tag>::value && + std::is_same < + typename std::iterator_traits::iterator_category, + std::random_access_iterator_tag >::value && + std::is_same < + typename std::iterator_traits::iterator_category, + std::random_access_iterator_tag >::value, + "Iterators passed to algorithms must be random-access iterators."); + auto perm_result = + oneapi::dpl::make_permutation_iterator(result, map); + HYPRE_ONEDPL_CALL( oneapi::dpl::copy, first, last, perm_result); +} + +// Equivalent of thrust::gather_if +template +void hypreSycl_gather_if(InputIter1 map_first, InputIter1 map_last, + InputIter2 mask, InputIter3 input_first, OutputIter result, + Predicate pred) +{ + static_assert( + std::is_same::iterator_category, + std::random_access_iterator_tag>::value && + std::is_same < + typename std::iterator_traits::iterator_category, + std::random_access_iterator_tag >::value && + std::is_same < + typename std::iterator_traits::iterator_category, + std::random_access_iterator_tag >::value && + std::is_same < + typename std::iterator_traits::iterator_category, + std::random_access_iterator_tag >::value, + "Iterators passed to algorithms must be random-access iterators."); + auto perm_begin = + oneapi::dpl::make_permutation_iterator(input_first, map_first); + const auto n = std::distance(map_first, map_last); + hypreSycl_copy_if(perm_begin, perm_begin + n, mask, result, + [ = ](auto &&m) { return pred(m); } ); +} + +// Equivalent of thrust::gather +template +OutputIter hypreSycl_gather(InputIter1 map_first, InputIter1 map_last, + InputIter2 input_first, OutputIter result) +{ + static_assert( + std::is_same::iterator_category, + std::random_access_iterator_tag>::value && + std::is_same < + typename std::iterator_traits::iterator_category, + std::random_access_iterator_tag >::value && + std::is_same < + typename std::iterator_traits::iterator_category, + std::random_access_iterator_tag >::value, + "Iterators passed to algorithms must be random-access iterators."); + auto perm_begin = + oneapi::dpl::make_permutation_iterator(input_first, map_first); + const auto n = std::distance(map_first, map_last); + return HYPRE_ONEDPL_CALL( oneapi::dpl::copy, perm_begin, perm_begin + n, result); +} + +// Equivalent of thrust::sequence (with step=1) +template +void hypreSycl_sequence(Iter first, Iter last, T init = 0) +{ + static_assert( + std::is_same::iterator_category, + std::random_access_iterator_tag>::value, + "Iterators passed to algorithms must be random-access iterators."); + using DiffType = typename std::iterator_traits::difference_type; + HYPRE_ONEDPL_CALL( std::transform, + oneapi::dpl::counting_iterator(init), + oneapi::dpl::counting_iterator(init + std::distance(first, last)), + first, + [](auto i) { return i; }); +} + +// Equivalent of thrust::stable_sort_by_key +template +void hypreSycl_stable_sort_by_key(Iter1 keys_first, Iter1 keys_last, Iter2 values_first) +{ + static_assert( + std::is_same::iterator_category, + std::random_access_iterator_tag>::value && + std::is_same::iterator_category, + std::random_access_iterator_tag>::value, + "Iterators passed to algorithms must be random-access iterators."); + const auto n = std::distance(keys_first, keys_last); + auto zipped_begin = oneapi::dpl::make_zip_iterator(keys_first, values_first); + HYPRE_ONEDPL_CALL( std::stable_sort, + zipped_begin, + zipped_begin + n, + [](auto lhs, auto rhs) { return std::get<0>(lhs) < std::get<0>(rhs); } ); +} + +#endif + +#endif diff --git a/external/hypre/src/utilities/_hypre_utilities.h b/external/hypre/src/utilities/_hypre_utilities.h index 07ccf9a7..731f95fc 100644 --- a/external/hypre/src/utilities/_hypre_utilities.h +++ b/external/hypre/src/utilities/_hypre_utilities.h @@ -15,7 +15,179 @@ extern "C" { #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +/****************************************************************************** + * + * General structures and values + * + *****************************************************************************/ + +#ifndef HYPRE_HANDLE_H +#define HYPRE_HANDLE_H + +#if defined(HYPRE_USING_UMPIRE) +#include "umpire/config.hpp" +#if UMPIRE_VERSION_MAJOR >= 2022 +#include "umpire/interface/c_fortran/umpire.h" +#define hypre_umpire_resourcemanager_make_allocator_pool umpire_resourcemanager_make_allocator_quick_pool +#else +#include "umpire/interface/umpire.h" +#define hypre_umpire_resourcemanager_make_allocator_pool umpire_resourcemanager_make_allocator_pool +#endif /* UMPIRE_VERSION_MAJOR >= 2022 */ +#define HYPRE_UMPIRE_POOL_NAME_MAX_LEN 1024 +#endif /* defined(HYPRE_USING_UMPIRE) */ + +struct hypre_DeviceData; +typedef struct hypre_DeviceData hypre_DeviceData; +typedef void (*GPUMallocFunc)(void **, size_t); +typedef void (*GPUMfreeFunc)(void *); + +typedef struct +{ + HYPRE_Int log_level; + HYPRE_Int hypre_error; + HYPRE_MemoryLocation memory_location; + HYPRE_ExecutionPolicy default_exec_policy; + + /* the device buffers needed to do MPI communication for struct comm */ + HYPRE_Complex *struct_comm_recv_buffer; + HYPRE_Complex *struct_comm_send_buffer; + HYPRE_Int struct_comm_recv_buffer_size; + HYPRE_Int struct_comm_send_buffer_size; + + /* GPU MPI */ +#if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) + HYPRE_Int use_gpu_aware_mpi; +#endif + +#if defined(HYPRE_USING_GPU) + hypre_DeviceData *device_data; + HYPRE_Int device_gs_method; /* device G-S options */ +#endif + + /* user malloc/free function pointers */ + GPUMallocFunc user_device_malloc; + GPUMfreeFunc user_device_free; + +#if defined(HYPRE_USING_UMPIRE) + char umpire_device_pool_name[HYPRE_UMPIRE_POOL_NAME_MAX_LEN]; + char umpire_um_pool_name[HYPRE_UMPIRE_POOL_NAME_MAX_LEN]; + char umpire_host_pool_name[HYPRE_UMPIRE_POOL_NAME_MAX_LEN]; + char umpire_pinned_pool_name[HYPRE_UMPIRE_POOL_NAME_MAX_LEN]; + size_t umpire_device_pool_size; + size_t umpire_um_pool_size; + size_t umpire_host_pool_size; + size_t umpire_pinned_pool_size; + size_t umpire_block_size; + HYPRE_Int own_umpire_device_pool; + HYPRE_Int own_umpire_um_pool; + HYPRE_Int own_umpire_host_pool; + HYPRE_Int own_umpire_pinned_pool; + umpire_resourcemanager umpire_rm; +#endif + +#if defined(HYPRE_USING_MAGMA) + magma_queue_t magma_queue; +#endif +} hypre_Handle; + +/* accessor macros to hypre_Handle */ +#define hypre_HandleLogLevel(hypre_handle) ((hypre_handle) -> log_level) +#define hypre_HandleMemoryLocation(hypre_handle) ((hypre_handle) -> memory_location) +#define hypre_HandleDefaultExecPolicy(hypre_handle) ((hypre_handle) -> default_exec_policy) + +#define hypre_HandleStructCommRecvBuffer(hypre_handle) ((hypre_handle) -> struct_comm_recv_buffer) +#define hypre_HandleStructCommSendBuffer(hypre_handle) ((hypre_handle) -> struct_comm_send_buffer) +#define hypre_HandleStructCommRecvBufferSize(hypre_handle) ((hypre_handle) -> struct_comm_recv_buffer_size) +#define hypre_HandleStructCommSendBufferSize(hypre_handle) ((hypre_handle) -> struct_comm_send_buffer_size) + +#define hypre_HandleDeviceData(hypre_handle) ((hypre_handle) -> device_data) +#define hypre_HandleDeviceGSMethod(hypre_handle) ((hypre_handle) -> device_gs_method) +#define hypre_HandleUseGpuAwareMPI(hypre_handle) ((hypre_handle) -> use_gpu_aware_mpi) + +#define hypre_HandleCurandGenerator(hypre_handle) hypre_DeviceDataCurandGenerator(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleCublasHandle(hypre_handle) hypre_DeviceDataCublasHandle(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleCusparseHandle(hypre_handle) hypre_DeviceDataCusparseHandle(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleVendorSolverHandle(hypre_handle) hypre_DeviceDataVendorSolverHandle(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleComputeStream(hypre_handle) hypre_DeviceDataComputeStream(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleCubBinGrowth(hypre_handle) hypre_DeviceDataCubBinGrowth(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleCubMinBin(hypre_handle) hypre_DeviceDataCubMinBin(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleCubMaxBin(hypre_handle) hypre_DeviceDataCubMaxBin(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleCubMaxCachedBytes(hypre_handle) hypre_DeviceDataCubMaxCachedBytes(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleCubDevAllocator(hypre_handle) hypre_DeviceDataCubDevAllocator(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleCubUvmAllocator(hypre_handle) hypre_DeviceDataCubUvmAllocator(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleDevice(hypre_handle) hypre_DeviceDataDevice(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleDeviceMaxWorkGroupSize(hypre_handle) hypre_DeviceDataDeviceMaxWorkGroupSize(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleDeviceMaxShmemPerBlock(hypre_handle) hypre_DeviceDataDeviceMaxShmemPerBlock(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleDeviceMaxShmemPerBlockInited(hypre_handle) hypre_DeviceDataDeviceMaxShmemPerBlockInited(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleComputeStreamNum(hypre_handle) hypre_DeviceDataComputeStreamNum(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleReduceBuffer(hypre_handle) hypre_DeviceDataReduceBuffer(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleSpgemmUseVendor(hypre_handle) hypre_DeviceDataSpgemmUseVendor(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleSpMVUseVendor(hypre_handle) hypre_DeviceDataSpMVUseVendor(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleSpTransUseVendor(hypre_handle) hypre_DeviceDataSpTransUseVendor(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleSpgemmAlgorithm(hypre_handle) hypre_DeviceDataSpgemmAlgorithm(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleSpgemmBinned(hypre_handle) hypre_DeviceDataSpgemmBinned(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleSpgemmNumBin(hypre_handle) hypre_DeviceDataSpgemmNumBin(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleSpgemmHighestBin(hypre_handle) hypre_DeviceDataSpgemmHighestBin(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleSpgemmBlockNumDim(hypre_handle) hypre_DeviceDataSpgemmBlockNumDim(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleSpgemmRownnzEstimateMethod(hypre_handle) hypre_DeviceDataSpgemmRownnzEstimateMethod(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleSpgemmRownnzEstimateNsamples(hypre_handle) hypre_DeviceDataSpgemmRownnzEstimateNsamples(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleSpgemmRownnzEstimateMultFactor(hypre_handle) hypre_DeviceDataSpgemmRownnzEstimateMultFactor(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleDeviceAllocator(hypre_handle) hypre_DeviceDataDeviceAllocator(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleUseGpuRand(hypre_handle) hypre_DeviceDataUseGpuRand(hypre_HandleDeviceData(hypre_handle)) + +#define hypre_HandleUserDeviceMalloc(hypre_handle) ((hypre_handle) -> user_device_malloc) +#define hypre_HandleUserDeviceMfree(hypre_handle) ((hypre_handle) -> user_device_free) + +#define hypre_HandleUmpireResourceMan(hypre_handle) ((hypre_handle) -> umpire_rm) +#define hypre_HandleUmpireDevicePoolSize(hypre_handle) ((hypre_handle) -> umpire_device_pool_size) +#define hypre_HandleUmpireUMPoolSize(hypre_handle) ((hypre_handle) -> umpire_um_pool_size) +#define hypre_HandleUmpireHostPoolSize(hypre_handle) ((hypre_handle) -> umpire_host_pool_size) +#define hypre_HandleUmpirePinnedPoolSize(hypre_handle) ((hypre_handle) -> umpire_pinned_pool_size) +#define hypre_HandleUmpireBlockSize(hypre_handle) ((hypre_handle) -> umpire_block_size) +#define hypre_HandleUmpireDevicePoolName(hypre_handle) ((hypre_handle) -> umpire_device_pool_name) +#define hypre_HandleUmpireUMPoolName(hypre_handle) ((hypre_handle) -> umpire_um_pool_name) +#define hypre_HandleUmpireHostPoolName(hypre_handle) ((hypre_handle) -> umpire_host_pool_name) +#define hypre_HandleUmpirePinnedPoolName(hypre_handle) ((hypre_handle) -> umpire_pinned_pool_name) +#define hypre_HandleOwnUmpireDevicePool(hypre_handle) ((hypre_handle) -> own_umpire_device_pool) +#define hypre_HandleOwnUmpireUMPool(hypre_handle) ((hypre_handle) -> own_umpire_um_pool) +#define hypre_HandleOwnUmpireHostPool(hypre_handle) ((hypre_handle) -> own_umpire_host_pool) +#define hypre_HandleOwnUmpirePinnedPool(hypre_handle) ((hypre_handle) -> own_umpire_pinned_pool) + +#define hypre_HandleMagmaQueue(hypre_handle) ((hypre_handle) -> magma_queue) + +#endif +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#ifndef hypre_STATE_HEADER +#define hypre_STATE_HEADER + +/*-------------------------------------------------------------------------- + * hypre library state + *--------------------------------------------------------------------------*/ + +typedef enum hypre_State_enum +{ + HYPRE_STATE_NONE = 0, + HYPRE_STATE_INITIALIZED = 1, + HYPRE_STATE_FINALIZED = 2 +} hypre_State; + +extern hypre_State hypre__global_state; + +#endif /* hypre_STATE_HEADER */ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -30,16 +202,48 @@ extern "C" { #ifndef hypre_GENERAL_HEADER #define hypre_GENERAL_HEADER +/* #include */ +/* #include */ +#include +#include +#include + +/*-------------------------------------------------------------------------- + * typedefs + *--------------------------------------------------------------------------*/ + /* This allows us to consistently avoid 'int' throughout hypre */ typedef int hypre_int; typedef long int hypre_longint; typedef unsigned int hypre_uint; typedef unsigned long int hypre_ulongint; typedef unsigned long long int hypre_ulonglongint; +typedef uint32_t hypre_uint32; +typedef uint64_t hypre_uint64; -/* This allows us to consistently avoid 'double' throughout hypre */ +/* This allows us to consistently avoid 'float' and 'double' throughout hypre */ +typedef float hypre_float; typedef double hypre_double; +/*-------------------------------------------------------------------------- + * Define macros + *--------------------------------------------------------------------------*/ + +/* Macro for silencing unused function warning */ +#if defined(__GNUC__) || defined(__clang__) +#define HYPRE_MAYBE_UNUSED_FUNC __attribute__((unused)) +#elif defined(_MSC_VER) +#define HYPRE_MAYBE_UNUSED_FUNC +#else +#define HYPRE_MAYBE_UNUSED_FUNC +#endif + +/* Macro for silencing unused variable warning */ +#define HYPRE_UNUSED_VAR(var) ((void) var) + +/* Macro for marking deprecated functions */ +#define HYPRE_DEPRECATED(reason) _Pragma(reason) + /*-------------------------------------------------------------------------- * Define various functions *--------------------------------------------------------------------------*/ @@ -63,10 +267,353 @@ typedef double hypre_double; #define hypre_pow2(i) ( 1 << (i) ) #endif +#ifndef hypre_squared +#define hypre_squared(i) ((i) * (i)) +#endif + +#ifndef hypre_sqrt +#if defined(HYPRE_SINGLE) +#define hypre_sqrt sqrtf +#elif defined(HYPRE_LONG_DOUBLE) +#define hypre_sqrt sqrtl +#else +#define hypre_sqrt sqrt +#endif +#endif + +#ifndef hypre_pow +#if defined(HYPRE_SINGLE) +#define hypre_pow powf +#elif defined(HYPRE_LONG_DOUBLE) +#define hypre_pow powl +#else +#define hypre_pow pow +#endif +#endif + +/* Macro for ceiling division. It assumes non-negative dividend and positive divisor. + The result of this macro might need to be casted to an integer type depending on the use case */ +#ifndef hypre_ceildiv +#define hypre_ceildiv(a, b) (((a) + (b) - 1) / (b)) +#endif + +#ifndef hypre_ceil +#if defined(HYPRE_SINGLE) +#define hypre_ceil ceilf +#elif defined(HYPRE_LONG_DOUBLE) +#define hypre_ceil ceill +#else +#define hypre_ceil ceil +#endif +#endif + +#ifndef hypre_floor +#if defined(HYPRE_SINGLE) +#define hypre_floor floorf +#elif defined(HYPRE_LONG_DOUBLE) +#define hypre_floor floorl +#else +#define hypre_floor floor +#endif +#endif + +#ifndef hypre_log +#if defined(HYPRE_SINGLE) +#define hypre_log logf +#elif defined(HYPRE_LONG_DOUBLE) +#define hypre_log logl +#else +#define hypre_log log +#endif +#endif + +#ifndef hypre_exp +#if defined(HYPRE_SINGLE) +#define hypre_exp expf +#elif defined(HYPRE_LONG_DOUBLE) +#define hypre_exp expl +#else +#define hypre_exp exp +#endif +#endif + +#ifndef hypre_sin +#if defined(HYPRE_SINGLE) +#define hypre_sin sinf +#elif defined(HYPRE_LONG_DOUBLE) +#define hypre_sin sinl +#else +#define hypre_sin sin +#endif +#endif + +#ifndef hypre_cos +#if defined(HYPRE_SINGLE) +#define hypre_cos cosf +#elif defined(HYPRE_LONG_DOUBLE) +#define hypre_cos cosl +#else +#define hypre_cos cos +#endif +#endif + +#ifndef hypre_atan +#if defined(HYPRE_SINGLE) +#define hypre_atan atanf +#elif defined(HYPRE_LONG_DOUBLE) +#define hypre_atan atanl +#else +#define hypre_atan atan +#endif +#endif + +#ifndef hypre_fmod +#if defined(HYPRE_SINGLE) +#define hypre_fmod fmodf +#elif defined(HYPRE_LONG_DOUBLE) +#define hypre_fmod fmodl +#else +#define hypre_fmod fmod +#endif +#endif + #endif /* hypre_GENERAL_HEADER */ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#ifndef HYPRE_BASE_HEADER +#define HYPRE_BASE_HEADER + +/****************************************************************************** + * + * Base private solver struct + * + *****************************************************************************/ + +typedef struct +{ + HYPRE_PtrToSolverFcn setup; + HYPRE_PtrToSolverFcn solve; + HYPRE_PtrToDestroyFcn destroy; + +} hypre_Solver; +/*-------------------------------------------------------------------------- + * Accessor functions for the hypre_Solver structure + *--------------------------------------------------------------------------*/ + +#define hypre_SolverSetup(data) ((data) -> setup) +#define hypre_SolverSolve(data) ((data) -> solve) +#define hypre_SolverDestroy(data) ((data) -> destroy) + +#endif /* HYPRE_BASE_HEADER */ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#ifndef HYPRE_MAGMA_HEADER +#define HYPRE_MAGMA_HEADER + +#include "HYPRE_config.h" + +#if defined(HYPRE_USING_MAGMA) + +#include "error.h" + +#ifdef __cplusplus +extern "C++" +{ +#endif + +#if !defined(MAGMA_GLOBAL) +#define ADD_ +#endif +#include + +#ifdef __cplusplus +} +#endif + +/*-------------------------------------------------------------------------- + * Wrappers to MAGMA functions according to hypre's precision + *--------------------------------------------------------------------------*/ + +#if defined(HYPRE_COMPLEX) || defined(HYPRE_LONG_DOUBLE) +#error "MAGMA interface does not support (yet) HYPRE_COMPLEX and HYPRE_LONG_DOUBLE" + +#elif defined(HYPRE_SINGLE) +#define hypre_magma_getrf_gpu magma_sgetrf_gpu +#define hypre_magma_getrf_nat magma_sgetrf_native +#define hypre_magma_getrs_gpu magma_sgetrs_gpu +#define hypre_magma_getri_gpu magma_sgetri_gpu +#define hypre_magma_getri_nb magma_get_dgetri_nb +#define hypre_magma_gemv magma_sgemv + +#else /* Double precision */ +#define hypre_magma_getrf_gpu magma_dgetrf_gpu +#define hypre_magma_getrf_nat magma_dgetrf_native +#define hypre_magma_getrs_gpu magma_dgetrs_gpu +#define hypre_magma_getri_gpu magma_dgetri_gpu +#define hypre_magma_getri_nb magma_get_sgetri_nb +#define hypre_magma_gemv magma_dgemv + +#endif + +/*-------------------------------------------------------------------------- + * General wrapper call to MAGMA functions + *--------------------------------------------------------------------------*/ + +#define HYPRE_MAGMA_CALL(call) do { \ + magma_int_t err = call; \ + if (MAGMA_SUCCESS != err) { \ + printf("MAGMA ERROR (code = %d) at %s:%d\n", \ + err, __FILE__, __LINE__); \ + hypre_assert(0); \ + } } while(0) + +#define HYPRE_MAGMA_VCALL(call) call + +#endif /* HYPRE_USING_MAGMA */ +#endif /* HYPRE_MAGMA_HEADER */ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#ifndef hypre_MATRIX_STATS_HEADER +#define hypre_MATRIX_STATS_HEADER + +/****************************************************************************** + * + * Header info for (generic) matrix statistics data structure + * + *****************************************************************************/ + +typedef struct hypre_MatrixStats_struct +{ + /* General info */ + HYPRE_BigInt num_rows; + HYPRE_BigInt num_cols; + hypre_ulonglongint num_nonzeros; + + /* Actual nonzeros statistics */ + hypre_ulonglongint actual_nonzeros; + HYPRE_Real actual_threshold; + HYPRE_Real sparsity; + + /* Nonzeros per row statistics */ + HYPRE_Int nnzrow_min; + HYPRE_Int nnzrow_max; + HYPRE_Real nnzrow_avg; + HYPRE_Real nnzrow_stdev; + HYPRE_Real nnzrow_sqsum; + + /* Row sum statistics */ + HYPRE_Real rowsum_min; + HYPRE_Real rowsum_max; + HYPRE_Real rowsum_avg; + HYPRE_Real rowsum_stdev; + HYPRE_Real rowsum_sqsum; +} hypre_MatrixStats; + +/*-------------------------------------------------------------------------- + * Accessor macros + *--------------------------------------------------------------------------*/ + +#define hypre_MatrixStatsNumRows(data) ((data) -> num_rows) +#define hypre_MatrixStatsNumCols(data) ((data) -> num_cols) +#define hypre_MatrixStatsNumNonzeros(data) ((data) -> num_nonzeros) + +#define hypre_MatrixStatsSparsity(data) ((data) -> sparsity) +#define hypre_MatrixStatsActualNonzeros(data) ((data) -> actual_nonzeros) +#define hypre_MatrixStatsActualThreshold(data) ((data) -> actual_threshold) + +#define hypre_MatrixStatsNnzrowMin(data) ((data) -> nnzrow_min) +#define hypre_MatrixStatsNnzrowMax(data) ((data) -> nnzrow_max) +#define hypre_MatrixStatsNnzrowAvg(data) ((data) -> nnzrow_avg) +#define hypre_MatrixStatsNnzrowStDev(data) ((data) -> nnzrow_stdev) +#define hypre_MatrixStatsNnzrowSqsum(data) ((data) -> nnzrow_sqsum) + +#define hypre_MatrixStatsRowsumMin(data) ((data) -> rowsum_min) +#define hypre_MatrixStatsRowsumMax(data) ((data) -> rowsum_max) +#define hypre_MatrixStatsRowsumAvg(data) ((data) -> rowsum_avg) +#define hypre_MatrixStatsRowsumStDev(data) ((data) -> rowsum_stdev) +#define hypre_MatrixStatsRowsumSqsum(data) ((data) -> rowsum_sqsum) + +/****************************************************************************** + * + * Header info for array of (generic) matrix statistics data structure + * + *****************************************************************************/ + +typedef struct hypre_MatrixStatsArray_struct +{ + HYPRE_Int capacity; + hypre_MatrixStats **entries; +} hypre_MatrixStatsArray; + +/*-------------------------------------------------------------------------- + * Accessor macros + *--------------------------------------------------------------------------*/ + +#define hypre_MatrixStatsArrayCapacity(data) ((data) -> capacity) +#define hypre_MatrixStatsArrayEntries(data) ((data) -> entries) +#define hypre_MatrixStatsArrayEntry(data, i) ((data) -> entries[i]) + +/*-------------------------------------------------------------------------- + * Helper macros for table formatting + *--------------------------------------------------------------------------*/ + +#define HYPRE_PRINT_TOP_DIVISOR(m, d) \ + for (HYPRE_Int __i = 0; __i < m; __i++) \ + { \ + for (HYPRE_Int __j = 0; __j < d[__i]; __j++) \ + { \ + hypre_printf("%s", "="); \ + } \ + if (__i < m - 1) \ + { \ + hypre_printf("+"); \ + } \ + } \ + hypre_printf("\n"); + +#define HYPRE_PRINT_MID_DIVISOR(m, d, msg) \ + for (HYPRE_Int __i = 0; __i < m; __i++) \ + { \ + for (HYPRE_Int __j = 0; __j < d[__i]; __j++) \ + { \ + hypre_printf("%s", "-"); \ + } \ + if (__i < m - 1) \ + { \ + hypre_printf("+"); \ + } \ + } \ + hypre_printf(" %s\n", msg); + +#define HYPRE_PRINT_INDENT(n) \ + hypre_printf("%*s", (n > 0) ? n : 0, ""); + + +#define HYPRE_PRINT_SHIFTED_PARAM(n, ...) \ + HYPRE_PRINT_INDENT(n) \ + hypre_printf(__VA_ARGS__) + +#define HYPRE_NDIGITS_SIZE 12 + +#endif /* hypre_MATRIX_STATS_HEADER */ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -80,12 +627,14 @@ typedef double hypre_double; /* printf.c */ // #ifdef HYPRE_BIGINT HYPRE_Int hypre_ndigits( HYPRE_BigInt number ); -HYPRE_Int hypre_printf( const char *format , ... ); -HYPRE_Int hypre_fprintf( FILE *stream , const char *format, ... ); -HYPRE_Int hypre_sprintf( char *s , const char *format, ... ); -HYPRE_Int hypre_scanf( const char *format , ... ); -HYPRE_Int hypre_fscanf( FILE *stream , const char *format, ... ); -HYPRE_Int hypre_sscanf( char *s , const char *format, ... ); +HYPRE_Int hypre_printf( const char *format, ... ); +HYPRE_Int hypre_fprintf( FILE *stream, const char *format, ... ); +HYPRE_Int hypre_sprintf( char *s, const char *format, ... ); +HYPRE_Int hypre_snprintf( char *s, size_t size, const char *format, ...); +HYPRE_Int hypre_scanf( const char *format, ... ); +HYPRE_Int hypre_fscanf( FILE *stream, const char *format, ... ); +HYPRE_Int hypre_sscanf( char *s, const char *format, ... ); +HYPRE_Int hypre_ParPrintf(MPI_Comm comm, const char *format, ...); // #else // #define hypre_printf printf // #define hypre_fprintf fprintf @@ -97,7 +646,7 @@ HYPRE_Int hypre_sscanf( char *s , const char *format, ... ); #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -106,24 +655,49 @@ HYPRE_Int hypre_sscanf( char *s , const char *format, ... ); #ifndef hypre_ERROR_HEADER #define hypre_ERROR_HEADER +#ifdef __cplusplus +extern "C++" +{ +#endif + #include +#ifdef __cplusplus +} +#endif + /*-------------------------------------------------------------------------- * Global variable used in hypre error checking *--------------------------------------------------------------------------*/ -extern HYPRE_Int hypre__global_error; -#define hypre_error_flag hypre__global_error +typedef struct +{ + HYPRE_Int error_flag; + HYPRE_Int temp_error_flag; + HYPRE_Int print_to_memory; + HYPRE_Int verbosity; + char *memory; + HYPRE_Int mem_sz; + HYPRE_Int msg_sz; + +} hypre_Error; + +extern hypre_Error hypre__global_error; +#define hypre_error_flag hypre__global_error.error_flag +#define hypre_error_temp_flag hypre__global_error.temp_error_flag /*-------------------------------------------------------------------------- * HYPRE error macros *--------------------------------------------------------------------------*/ void hypre_error_handler(const char *filename, HYPRE_Int line, HYPRE_Int ierr, const char *msg); +void hypre_error_handler_clear_messages(void); +void hypre_error_code_save(void); +void hypre_error_code_restore(void); -#define hypre_error(IERR) hypre_error_handler(__FILE__, __LINE__, IERR, NULL) -#define hypre_error_w_msg(IERR, msg) hypre_error_handler(__FILE__, __LINE__, IERR, msg) -#define hypre_error_in_arg(IARG) hypre_error(HYPRE_ERROR_ARG | IARG<<3) +#define hypre_error(IERR) hypre_error_handler(__FILE__, __LINE__, IERR, NULL) +#define hypre_error_w_msg(IERR, msg) hypre_error_handler(__FILE__, __LINE__, IERR, msg) +#define hypre_error_in_arg(IARG) hypre_error(HYPRE_ERROR_ARG | IARG<<3) #if defined(HYPRE_DEBUG) /* host assert */ @@ -133,7 +707,9 @@ void hypre_error_handler(const char *filename, HYPRE_Int line, HYPRE_Int ierr, c #define hypre_device_assert(EX) assert(EX) #elif defined(HYPRE_USING_HIP) /* FIXME: Currently, asserts in device kernels in HIP do not behave well */ -#define hypre_device_assert(EX) +#define hypre_device_assert(EX) do { if (0) { static_cast (EX); } } while (0) +#elif defined(HYPRE_USING_SYCL) +#define hypre_device_assert(EX) assert(EX) #endif #else /* #ifdef HYPRE_DEBUG */ /* this is to silence compiler's unused variable warnings */ @@ -146,9 +722,8 @@ void hypre_error_handler(const char *filename, HYPRE_Int line, HYPRE_Int ierr, c #endif #endif /* hypre_ERROR_HEADER */ - /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -194,16 +769,19 @@ extern "C" { #define MPI_COMM_SELF hypre_MPI_COMM_SELF #define MPI_COMM_TYPE_SHARED hypre_MPI_COMM_TYPE_SHARED -#define MPI_BOTTOM hypre_MPI_BOTTOM +#define MPI_BOTTOM hypre_MPI_BOTTOM #define MPI_FLOAT hypre_MPI_FLOAT #define MPI_DOUBLE hypre_MPI_DOUBLE #define MPI_LONG_DOUBLE hypre_MPI_LONG_DOUBLE #define MPI_INT hypre_MPI_INT -#define MPI_LONG_LONG_INT hypre_MPI_INT +#define MPI_LONG_LONG_INT hypre_MPI_LONG_LONG_INT #define MPI_CHAR hypre_MPI_CHAR #define MPI_LONG hypre_MPI_LONG #define MPI_BYTE hypre_MPI_BYTE + +#define MPI_C_FLOAT_COMPLEX hypre_MPI_COMPLEX +#define MPI_C_LONG_DOUBLE_COMPLEX hypre_MPI_COMPLEX #define MPI_C_DOUBLE_COMPLEX hypre_MPI_COMPLEX #define MPI_SUM hypre_MPI_SUM @@ -211,6 +789,7 @@ extern "C" { #define MPI_MAX hypre_MPI_MAX #define MPI_LOR hypre_MPI_LOR #define MPI_LAND hypre_MPI_LAND +#define MPI_BOR hypre_MPI_BOR #define MPI_SUCCESS hypre_MPI_SUCCESS #define MPI_STATUSES_IGNORE hypre_MPI_STATUSES_IGNORE @@ -288,7 +867,7 @@ typedef HYPRE_Int hypre_MPI_Comm; typedef HYPRE_Int hypre_MPI_Group; typedef HYPRE_Int hypre_MPI_Request; typedef HYPRE_Int hypre_MPI_Datatype; -typedef void (hypre_MPI_User_function) (); +typedef void (hypre_MPI_User_function) (void); typedef struct { @@ -317,12 +896,14 @@ typedef HYPRE_Int hypre_MPI_Info; #define hypre_MPI_BYTE 6 #define hypre_MPI_REAL 7 #define hypre_MPI_COMPLEX 8 +#define hypre_MPI_LONG_LONG_INT 9 #define hypre_MPI_SUM 0 #define hypre_MPI_MIN 1 #define hypre_MPI_MAX 2 #define hypre_MPI_LOR 3 #define hypre_MPI_LAND 4 +#define hypre_MPI_BOR 5 #define hypre_MPI_SUCCESS 0 #define hypre_MPI_STATUSES_IGNORE 0 @@ -371,6 +952,7 @@ typedef MPI_User_function hypre_MPI_User_function; #define hypre_MPI_MIN MPI_MIN #define hypre_MPI_MAX MPI_MAX #define hypre_MPI_LOR MPI_LOR +#define hypre_MPI_BOR MPI_BOR #define hypre_MPI_SUCCESS MPI_SUCCESS #define hypre_MPI_STATUSES_IGNORE MPI_STATUSES_IGNORE @@ -394,61 +976,100 @@ typedef MPI_User_function hypre_MPI_User_function; *--------------------------------------------------------------------------*/ /* mpistubs.c */ -HYPRE_Int hypre_MPI_Init( hypre_int *argc , char ***argv ); +HYPRE_Int hypre_MPI_Init( hypre_int *argc, char ***argv ); HYPRE_Int hypre_MPI_Finalize( void ); -HYPRE_Int hypre_MPI_Abort( hypre_MPI_Comm comm , HYPRE_Int errorcode ); +HYPRE_Int hypre_MPI_Abort( hypre_MPI_Comm comm, HYPRE_Int errorcode ); HYPRE_Real hypre_MPI_Wtime( void ); HYPRE_Real hypre_MPI_Wtick( void ); HYPRE_Int hypre_MPI_Barrier( hypre_MPI_Comm comm ); -HYPRE_Int hypre_MPI_Comm_create( hypre_MPI_Comm comm , hypre_MPI_Group group , hypre_MPI_Comm *newcomm ); -HYPRE_Int hypre_MPI_Comm_dup( hypre_MPI_Comm comm , hypre_MPI_Comm *newcomm ); +HYPRE_Int hypre_MPI_Comm_create( hypre_MPI_Comm comm, hypre_MPI_Group group, + hypre_MPI_Comm *newcomm ); +HYPRE_Int hypre_MPI_Comm_dup( hypre_MPI_Comm comm, hypre_MPI_Comm *newcomm ); hypre_MPI_Comm hypre_MPI_Comm_f2c( hypre_int comm ); -HYPRE_Int hypre_MPI_Comm_size( hypre_MPI_Comm comm , HYPRE_Int *size ); -HYPRE_Int hypre_MPI_Comm_rank( hypre_MPI_Comm comm , HYPRE_Int *rank ); +HYPRE_Int hypre_MPI_Comm_size( hypre_MPI_Comm comm, HYPRE_Int *size ); +HYPRE_Int hypre_MPI_Comm_rank( hypre_MPI_Comm comm, HYPRE_Int *rank ); HYPRE_Int hypre_MPI_Comm_free( hypre_MPI_Comm *comm ); -HYPRE_Int hypre_MPI_Comm_group( hypre_MPI_Comm comm , hypre_MPI_Group *group ); -HYPRE_Int hypre_MPI_Comm_split( hypre_MPI_Comm comm, HYPRE_Int n, HYPRE_Int m, hypre_MPI_Comm * comms ); -HYPRE_Int hypre_MPI_Group_incl( hypre_MPI_Group group , HYPRE_Int n , HYPRE_Int *ranks , hypre_MPI_Group *newgroup ); +HYPRE_Int hypre_MPI_Comm_group( hypre_MPI_Comm comm, hypre_MPI_Group *group ); +HYPRE_Int hypre_MPI_Comm_split( hypre_MPI_Comm comm, HYPRE_Int n, HYPRE_Int m, + hypre_MPI_Comm * comms ); +HYPRE_Int hypre_MPI_Group_incl( hypre_MPI_Group group, HYPRE_Int n, HYPRE_Int *ranks, + hypre_MPI_Group *newgroup ); HYPRE_Int hypre_MPI_Group_free( hypre_MPI_Group *group ); -HYPRE_Int hypre_MPI_Address( void *location , hypre_MPI_Aint *address ); -HYPRE_Int hypre_MPI_Get_count( hypre_MPI_Status *status , hypre_MPI_Datatype datatype , HYPRE_Int *count ); -HYPRE_Int hypre_MPI_Alltoall( void *sendbuf , HYPRE_Int sendcount , hypre_MPI_Datatype sendtype , void *recvbuf , HYPRE_Int recvcount , hypre_MPI_Datatype recvtype , hypre_MPI_Comm comm ); -HYPRE_Int hypre_MPI_Allgather( void *sendbuf , HYPRE_Int sendcount , hypre_MPI_Datatype sendtype , void *recvbuf , HYPRE_Int recvcount , hypre_MPI_Datatype recvtype , hypre_MPI_Comm comm ); -HYPRE_Int hypre_MPI_Allgatherv( void *sendbuf , HYPRE_Int sendcount , hypre_MPI_Datatype sendtype , void *recvbuf , HYPRE_Int *recvcounts , HYPRE_Int *displs , hypre_MPI_Datatype recvtype , hypre_MPI_Comm comm ); -HYPRE_Int hypre_MPI_Gather( void *sendbuf , HYPRE_Int sendcount , hypre_MPI_Datatype sendtype , void *recvbuf , HYPRE_Int recvcount , hypre_MPI_Datatype recvtype , HYPRE_Int root , hypre_MPI_Comm comm ); -HYPRE_Int hypre_MPI_Gatherv( void *sendbuf , HYPRE_Int sendcount , hypre_MPI_Datatype sendtype , void *recvbuf , HYPRE_Int *recvcounts , HYPRE_Int *displs , hypre_MPI_Datatype recvtype , HYPRE_Int root , hypre_MPI_Comm comm ); -HYPRE_Int hypre_MPI_Scatter( void *sendbuf , HYPRE_Int sendcount , hypre_MPI_Datatype sendtype , void *recvbuf , HYPRE_Int recvcount , hypre_MPI_Datatype recvtype , HYPRE_Int root , hypre_MPI_Comm comm ); -HYPRE_Int hypre_MPI_Scatterv( void *sendbuf , HYPRE_Int *sendcounts , HYPRE_Int *displs, hypre_MPI_Datatype sendtype , void *recvbuf , HYPRE_Int recvcount , hypre_MPI_Datatype recvtype , HYPRE_Int root , hypre_MPI_Comm comm ); -HYPRE_Int hypre_MPI_Bcast( void *buffer , HYPRE_Int count , hypre_MPI_Datatype datatype , HYPRE_Int root , hypre_MPI_Comm comm ); -HYPRE_Int hypre_MPI_Send( void *buf , HYPRE_Int count , hypre_MPI_Datatype datatype , HYPRE_Int dest , HYPRE_Int tag , hypre_MPI_Comm comm ); -HYPRE_Int hypre_MPI_Recv( void *buf , HYPRE_Int count , hypre_MPI_Datatype datatype , HYPRE_Int source , HYPRE_Int tag , hypre_MPI_Comm comm , hypre_MPI_Status *status ); -HYPRE_Int hypre_MPI_Isend( void *buf , HYPRE_Int count , hypre_MPI_Datatype datatype , HYPRE_Int dest , HYPRE_Int tag , hypre_MPI_Comm comm , hypre_MPI_Request *request ); -HYPRE_Int hypre_MPI_Irecv( void *buf , HYPRE_Int count , hypre_MPI_Datatype datatype , HYPRE_Int source , HYPRE_Int tag , hypre_MPI_Comm comm , hypre_MPI_Request *request ); -HYPRE_Int hypre_MPI_Send_init( void *buf , HYPRE_Int count , hypre_MPI_Datatype datatype , HYPRE_Int dest , HYPRE_Int tag , hypre_MPI_Comm comm , hypre_MPI_Request *request ); -HYPRE_Int hypre_MPI_Recv_init( void *buf , HYPRE_Int count , hypre_MPI_Datatype datatype , HYPRE_Int dest , HYPRE_Int tag , hypre_MPI_Comm comm , hypre_MPI_Request *request ); -HYPRE_Int hypre_MPI_Irsend( void *buf , HYPRE_Int count , hypre_MPI_Datatype datatype , HYPRE_Int dest , HYPRE_Int tag , hypre_MPI_Comm comm , hypre_MPI_Request *request ); -HYPRE_Int hypre_MPI_Startall( HYPRE_Int count , hypre_MPI_Request *array_of_requests ); -HYPRE_Int hypre_MPI_Probe( HYPRE_Int source , HYPRE_Int tag , hypre_MPI_Comm comm , hypre_MPI_Status *status ); -HYPRE_Int hypre_MPI_Iprobe( HYPRE_Int source , HYPRE_Int tag , hypre_MPI_Comm comm , HYPRE_Int *flag , hypre_MPI_Status *status ); -HYPRE_Int hypre_MPI_Test( hypre_MPI_Request *request , HYPRE_Int *flag , hypre_MPI_Status *status ); -HYPRE_Int hypre_MPI_Testall( HYPRE_Int count , hypre_MPI_Request *array_of_requests , HYPRE_Int *flag , hypre_MPI_Status *array_of_statuses ); -HYPRE_Int hypre_MPI_Wait( hypre_MPI_Request *request , hypre_MPI_Status *status ); -HYPRE_Int hypre_MPI_Waitall( HYPRE_Int count , hypre_MPI_Request *array_of_requests , hypre_MPI_Status *array_of_statuses ); -HYPRE_Int hypre_MPI_Waitany( HYPRE_Int count , hypre_MPI_Request *array_of_requests , HYPRE_Int *index , hypre_MPI_Status *status ); -HYPRE_Int hypre_MPI_Allreduce( void *sendbuf , void *recvbuf , HYPRE_Int count , hypre_MPI_Datatype datatype , hypre_MPI_Op op , hypre_MPI_Comm comm ); -HYPRE_Int hypre_MPI_Reduce( void *sendbuf , void *recvbuf , HYPRE_Int count , hypre_MPI_Datatype datatype , hypre_MPI_Op op , HYPRE_Int root , hypre_MPI_Comm comm ); -HYPRE_Int hypre_MPI_Scan( void *sendbuf , void *recvbuf , HYPRE_Int count , hypre_MPI_Datatype datatype , hypre_MPI_Op op , hypre_MPI_Comm comm ); +HYPRE_Int hypre_MPI_Address( void *location, hypre_MPI_Aint *address ); +HYPRE_Int hypre_MPI_Get_count( hypre_MPI_Status *status, hypre_MPI_Datatype datatype, + HYPRE_Int *count ); +HYPRE_Int hypre_MPI_Alltoall( void *sendbuf, HYPRE_Int sendcount, hypre_MPI_Datatype sendtype, + void *recvbuf, HYPRE_Int recvcount, hypre_MPI_Datatype recvtype, hypre_MPI_Comm comm ); +HYPRE_Int hypre_MPI_Allgather( void *sendbuf, HYPRE_Int sendcount, hypre_MPI_Datatype sendtype, + void *recvbuf, HYPRE_Int recvcount, hypre_MPI_Datatype recvtype, hypre_MPI_Comm comm ); +HYPRE_Int hypre_MPI_Allgatherv( void *sendbuf, HYPRE_Int sendcount, hypre_MPI_Datatype sendtype, + void *recvbuf, HYPRE_Int *recvcounts, HYPRE_Int *displs, hypre_MPI_Datatype recvtype, + hypre_MPI_Comm comm ); +HYPRE_Int hypre_MPI_Gather( void *sendbuf, HYPRE_Int sendcount, hypre_MPI_Datatype sendtype, + void *recvbuf, HYPRE_Int recvcount, hypre_MPI_Datatype recvtype, HYPRE_Int root, + hypre_MPI_Comm comm ); +HYPRE_Int hypre_MPI_Gatherv( void *sendbuf, HYPRE_Int sendcount, hypre_MPI_Datatype sendtype, + void *recvbuf, HYPRE_Int *recvcounts, HYPRE_Int *displs, hypre_MPI_Datatype recvtype, + HYPRE_Int root, hypre_MPI_Comm comm ); +HYPRE_Int hypre_MPI_Scatter( void *sendbuf, HYPRE_Int sendcount, hypre_MPI_Datatype sendtype, + void *recvbuf, HYPRE_Int recvcount, hypre_MPI_Datatype recvtype, HYPRE_Int root, + hypre_MPI_Comm comm ); +HYPRE_Int hypre_MPI_Scatterv( void *sendbuf, HYPRE_Int *sendcounts, HYPRE_Int *displs, + hypre_MPI_Datatype sendtype, void *recvbuf, HYPRE_Int recvcount, hypre_MPI_Datatype recvtype, + HYPRE_Int root, hypre_MPI_Comm comm ); +HYPRE_Int hypre_MPI_Bcast( void *buffer, HYPRE_Int count, hypre_MPI_Datatype datatype, + HYPRE_Int root, hypre_MPI_Comm comm ); +HYPRE_Int hypre_MPI_Send( void *buf, HYPRE_Int count, hypre_MPI_Datatype datatype, HYPRE_Int dest, + HYPRE_Int tag, hypre_MPI_Comm comm ); +HYPRE_Int hypre_MPI_Recv( void *buf, HYPRE_Int count, hypre_MPI_Datatype datatype, HYPRE_Int source, + HYPRE_Int tag, hypre_MPI_Comm comm, hypre_MPI_Status *status ); +HYPRE_Int hypre_MPI_Isend( void *buf, HYPRE_Int count, hypre_MPI_Datatype datatype, HYPRE_Int dest, + HYPRE_Int tag, hypre_MPI_Comm comm, hypre_MPI_Request *request ); +HYPRE_Int hypre_MPI_Irecv( void *buf, HYPRE_Int count, hypre_MPI_Datatype datatype, + HYPRE_Int source, HYPRE_Int tag, hypre_MPI_Comm comm, hypre_MPI_Request *request ); +HYPRE_Int hypre_MPI_Send_init( void *buf, HYPRE_Int count, hypre_MPI_Datatype datatype, + HYPRE_Int dest, HYPRE_Int tag, hypre_MPI_Comm comm, hypre_MPI_Request *request ); +HYPRE_Int hypre_MPI_Recv_init( void *buf, HYPRE_Int count, hypre_MPI_Datatype datatype, + HYPRE_Int dest, HYPRE_Int tag, hypre_MPI_Comm comm, hypre_MPI_Request *request ); +HYPRE_Int hypre_MPI_Irsend( void *buf, HYPRE_Int count, hypre_MPI_Datatype datatype, HYPRE_Int dest, + HYPRE_Int tag, hypre_MPI_Comm comm, hypre_MPI_Request *request ); +HYPRE_Int hypre_MPI_Startall( HYPRE_Int count, hypre_MPI_Request *array_of_requests ); +HYPRE_Int hypre_MPI_Probe( HYPRE_Int source, HYPRE_Int tag, hypre_MPI_Comm comm, + hypre_MPI_Status *status ); +HYPRE_Int hypre_MPI_Iprobe( HYPRE_Int source, HYPRE_Int tag, hypre_MPI_Comm comm, HYPRE_Int *flag, + hypre_MPI_Status *status ); +HYPRE_Int hypre_MPI_Test( hypre_MPI_Request *request, HYPRE_Int *flag, hypre_MPI_Status *status ); +HYPRE_Int hypre_MPI_Testall( HYPRE_Int count, hypre_MPI_Request *array_of_requests, HYPRE_Int *flag, + hypre_MPI_Status *array_of_statuses ); +HYPRE_Int hypre_MPI_Wait( hypre_MPI_Request *request, hypre_MPI_Status *status ); +HYPRE_Int hypre_MPI_Waitall( HYPRE_Int count, hypre_MPI_Request *array_of_requests, + hypre_MPI_Status *array_of_statuses ); +HYPRE_Int hypre_MPI_Waitany( HYPRE_Int count, hypre_MPI_Request *array_of_requests, + HYPRE_Int *index, hypre_MPI_Status *status ); +HYPRE_Int hypre_MPI_Allreduce( void *sendbuf, void *recvbuf, HYPRE_Int count, + hypre_MPI_Datatype datatype, hypre_MPI_Op op, hypre_MPI_Comm comm ); +HYPRE_Int hypre_MPI_Reduce( void *sendbuf, void *recvbuf, HYPRE_Int count, + hypre_MPI_Datatype datatype, hypre_MPI_Op op, HYPRE_Int root, hypre_MPI_Comm comm ); +HYPRE_Int hypre_MPI_Scan( void *sendbuf, void *recvbuf, HYPRE_Int count, + hypre_MPI_Datatype datatype, hypre_MPI_Op op, hypre_MPI_Comm comm ); HYPRE_Int hypre_MPI_Request_free( hypre_MPI_Request *request ); -HYPRE_Int hypre_MPI_Type_contiguous( HYPRE_Int count , hypre_MPI_Datatype oldtype , hypre_MPI_Datatype *newtype ); -HYPRE_Int hypre_MPI_Type_vector( HYPRE_Int count , HYPRE_Int blocklength , HYPRE_Int stride , hypre_MPI_Datatype oldtype , hypre_MPI_Datatype *newtype ); -HYPRE_Int hypre_MPI_Type_hvector( HYPRE_Int count , HYPRE_Int blocklength , hypre_MPI_Aint stride , hypre_MPI_Datatype oldtype , hypre_MPI_Datatype *newtype ); -HYPRE_Int hypre_MPI_Type_struct( HYPRE_Int count , HYPRE_Int *array_of_blocklengths , hypre_MPI_Aint *array_of_displacements , hypre_MPI_Datatype *array_of_types , hypre_MPI_Datatype *newtype ); +HYPRE_Int hypre_MPI_Type_contiguous( HYPRE_Int count, hypre_MPI_Datatype oldtype, + hypre_MPI_Datatype *newtype ); +HYPRE_Int hypre_MPI_Type_vector( HYPRE_Int count, HYPRE_Int blocklength, HYPRE_Int stride, + hypre_MPI_Datatype oldtype, hypre_MPI_Datatype *newtype ); +HYPRE_Int hypre_MPI_Type_hvector( HYPRE_Int count, HYPRE_Int blocklength, hypre_MPI_Aint stride, + hypre_MPI_Datatype oldtype, hypre_MPI_Datatype *newtype ); +HYPRE_Int hypre_MPI_Type_struct( HYPRE_Int count, HYPRE_Int *array_of_blocklengths, + hypre_MPI_Aint *array_of_displacements, hypre_MPI_Datatype *array_of_types, + hypre_MPI_Datatype *newtype ); HYPRE_Int hypre_MPI_Type_commit( hypre_MPI_Datatype *datatype ); HYPRE_Int hypre_MPI_Type_free( hypre_MPI_Datatype *datatype ); HYPRE_Int hypre_MPI_Op_free( hypre_MPI_Op *op ); -HYPRE_Int hypre_MPI_Op_create( hypre_MPI_User_function *function , hypre_int commute , hypre_MPI_Op *op ); -#if defined(HYPRE_USING_GPU) -HYPRE_Int hypre_MPI_Comm_split_type(hypre_MPI_Comm comm, HYPRE_Int split_type, HYPRE_Int key, hypre_MPI_Info info, hypre_MPI_Comm *newcomm); +HYPRE_Int hypre_MPI_Op_create( hypre_MPI_User_function *function, hypre_int commute, + hypre_MPI_Op *op ); +#if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) +HYPRE_Int hypre_MPI_Comm_split_type(hypre_MPI_Comm comm, HYPRE_Int split_type, HYPRE_Int key, + hypre_MPI_Info info, hypre_MPI_Comm *newcomm); HYPRE_Int hypre_MPI_Info_create(hypre_MPI_Info *info); HYPRE_Int hypre_MPI_Info_free( hypre_MPI_Info *info ); #endif @@ -459,7 +1080,7 @@ HYPRE_Int hypre_MPI_Info_free( hypre_MPI_Info *info ); #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -472,7 +1093,7 @@ HYPRE_Int hypre_MPI_Info_free( hypre_MPI_Info *info ); #define HYPRE_SMP_SCHEDULE schedule(static) /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -544,9 +1165,8 @@ HYPRE_Int hypre_MPI_Info_free( hypre_MPI_Info *info ); #include #include -#if defined(HYPRE_USING_UMPIRE) -#include "umpire/interface/umpire.h" -#define HYPRE_UMPIRE_POOL_NAME_MAX_LEN 1024 +#if defined(HYPRE_USING_UNIFIED_MEMORY) && defined(HYPRE_USING_DEVICE_OPENMP) +//#pragma omp requires unified_shared_memory #endif /* stringification: @@ -564,17 +1184,18 @@ extern "C" { typedef enum _hypre_MemoryLocation { hypre_MEMORY_UNDEFINED = -1, - hypre_MEMORY_HOST , - hypre_MEMORY_HOST_PINNED , - hypre_MEMORY_DEVICE , - hypre_MEMORY_UNIFIED + hypre_MEMORY_HOST, + hypre_MEMORY_HOST_PINNED, + hypre_MEMORY_DEVICE, + hypre_MEMORY_UNIFIED, + hypre_NUM_MEMORY_LOCATION } hypre_MemoryLocation; /*------------------------------------------------------- * hypre_GetActualMemLocation * return actual location based on the selected memory model *-------------------------------------------------------*/ -static inline hypre_MemoryLocation +static inline HYPRE_MAYBE_UNUSED_FUNC hypre_MemoryLocation hypre_GetActualMemLocation(HYPRE_MemoryLocation location) { if (location == HYPRE_MEMORY_HOST) @@ -598,102 +1219,8 @@ hypre_GetActualMemLocation(HYPRE_MemoryLocation location) return hypre_MEMORY_UNDEFINED; } -#ifdef HYPRE_USING_MEMORY_TRACKER - -typedef struct -{ - char _action[16]; - void *_ptr; - size_t _nbytes; - hypre_MemoryLocation _memory_location; - char _filename[256]; - char _function[256]; - HYPRE_Int _line; - size_t _pair; -} hypre_MemoryTrackerEntry; - -typedef struct -{ - size_t actual_size; - size_t alloced_size; - size_t prev_end; - hypre_MemoryTrackerEntry *data; -} hypre_MemoryTracker; - -/* These Allocs are with memory tracker, for debug */ -#define hypre_TAlloc(type, count, location) \ -( \ -{ \ - void *ptr = hypre_MAlloc((size_t)(sizeof(type) * (count)), location); \ - hypre_MemoryTrackerInsert("malloc", ptr, sizeof(type)*(count), hypre_GetActualMemLocation(location), __FILE__, __func__, __LINE__);\ - (type *) ptr; \ -} \ -) - -#define _hypre_TAlloc(type, count, location) \ -( \ -{ \ - void *ptr = _hypre_MAlloc((size_t)(sizeof(type) * (count)), location); \ - hypre_MemoryTrackerInsert("malloc", ptr, sizeof(type)*(count), location, __FILE__, __func__, __LINE__); \ - (type *) ptr; \ -} \ -) - -#define hypre_CTAlloc(type, count, location) \ -( \ -{ \ - void *ptr = hypre_CAlloc((size_t)(count), (size_t)sizeof(type), location); \ - hypre_MemoryTrackerInsert("calloc", ptr, sizeof(type)*(count), hypre_GetActualMemLocation(location), __FILE__, __func__, __LINE__);\ - (type *) ptr; \ -} \ -) - -#define hypre_TReAlloc(ptr, type, count, location) \ -( \ -{ \ - hypre_MemoryTrackerInsert("rfree", ptr, (size_t) -1, hypre_GetActualMemLocation(location), __FILE__, __func__, __LINE__); \ - void *new_ptr = hypre_ReAlloc((char *)ptr, (size_t)(sizeof(type) * (count)), location); \ - hypre_MemoryTrackerInsert("rmalloc", new_ptr, sizeof(type)*(count), hypre_GetActualMemLocation(location), __FILE__, __func__, __LINE__);\ - (type *) new_ptr; \ -} \ -) - -#define hypre_TReAlloc_v2(ptr, old_type, old_count, new_type, new_count, location) \ -( \ -{ \ - hypre_MemoryTrackerInsert("rfree", ptr, sizeof(old_type)*(old_count), hypre_GetActualMemLocation(location), __FILE__, __func__, __LINE__); \ - void *new_ptr = hypre_ReAlloc_v2((char *)ptr, (size_t)(sizeof(old_type)*(old_count)), (size_t)(sizeof(new_type)*(new_count)), location); \ - hypre_MemoryTrackerInsert("rmalloc", new_ptr, sizeof(new_type)*(new_count), hypre_GetActualMemLocation(location), __FILE__, __func__, __LINE__);\ - (new_type *) new_ptr; \ -} \ -) - -#define hypre_TMemcpy(dst, src, type, count, locdst, locsrc) \ -( \ -{ \ - hypre_Memcpy((void *)(dst), (void *)(src), (size_t)(sizeof(type) * (count)), locdst, locsrc); \ -} \ -) - -#define hypre_TFree(ptr, location) \ -( \ -{ \ - hypre_MemoryTrackerInsert("free", ptr, (size_t) -1, hypre_GetActualMemLocation(location), __FILE__, __func__, __LINE__); \ - hypre_Free((void *)ptr, location); \ - ptr = NULL; \ -} \ -) - -#define _hypre_TFree(ptr, location) \ -( \ -{ \ - hypre_MemoryTrackerInsert("free", ptr, (size_t) -1, location, __FILE__, __func__, __LINE__); \ - _hypre_Free((void *)ptr, location); \ - ptr = NULL; \ -} \ -) -#else /* #ifdef HYPRE_USING_MEMORY_TRACKER */ +#if !defined(HYPRE_USING_MEMORY_TRACKER) #define hypre_TAlloc(type, count, location) \ ( (type *) hypre_MAlloc((size_t)(sizeof(type) * (count)), location) ) @@ -719,7 +1246,7 @@ typedef struct #define _hypre_TFree(ptr, location) \ ( _hypre_Free((void *)ptr, location), ptr = NULL ) -#endif /* #ifdef HYPRE_USING_MEMORY_TRACKER */ +#endif /* #if !defined(HYPRE_USING_MEMORY_TRACKER) */ /*-------------------------------------------------------------------------- @@ -727,12 +1254,16 @@ typedef struct *--------------------------------------------------------------------------*/ /* memory.c */ +HYPRE_Int hypre_GetMemoryLocationName(hypre_MemoryLocation memory_location, + char *memory_location_name); +void hypre_CheckMemoryLocation(void *ptr, hypre_MemoryLocation location); void * hypre_Memset(void *ptr, HYPRE_Int value, size_t num, HYPRE_MemoryLocation location); void hypre_MemPrefetch(void *ptr, size_t size, HYPRE_MemoryLocation location); void * hypre_MAlloc(size_t size, HYPRE_MemoryLocation location); void * hypre_CAlloc( size_t count, size_t elt_size, HYPRE_MemoryLocation location); void hypre_Free(void *ptr, HYPRE_MemoryLocation location); -void hypre_Memcpy(void *dst, void *src, size_t size, HYPRE_MemoryLocation loc_dst, HYPRE_MemoryLocation loc_src); +void hypre_Memcpy(void *dst, void *src, size_t size, HYPRE_MemoryLocation loc_dst, + HYPRE_MemoryLocation loc_src); void * hypre_ReAlloc(void *ptr, size_t size, HYPRE_MemoryLocation location); void * hypre_ReAlloc_v2(void *ptr, size_t old_size, size_t new_size, HYPRE_MemoryLocation location); @@ -740,11 +1271,12 @@ void * _hypre_MAlloc(size_t size, hypre_MemoryLocation location); void _hypre_Free(void *ptr, hypre_MemoryLocation location); HYPRE_ExecutionPolicy hypre_GetExecPolicy1(HYPRE_MemoryLocation location); -HYPRE_ExecutionPolicy hypre_GetExecPolicy2(HYPRE_MemoryLocation location1, HYPRE_MemoryLocation location2); +HYPRE_ExecutionPolicy hypre_GetExecPolicy2(HYPRE_MemoryLocation location1, + HYPRE_MemoryLocation location2); HYPRE_Int hypre_GetPointerLocation(const void *ptr, hypre_MemoryLocation *memory_location); -HYPRE_Int hypre_PrintMemoryTracker(); -HYPRE_Int hypre_SetCubMemPoolSize( hypre_uint bin_growth, hypre_uint min_bin, hypre_uint max_bin, size_t max_cached_bytes ); +HYPRE_Int hypre_SetCubMemPoolSize( hypre_uint bin_growth, hypre_uint min_bin, hypre_uint max_bin, + size_t max_cached_bytes ); HYPRE_Int hypre_umpire_host_pooled_allocate(void **ptr, size_t nbytes); HYPRE_Int hypre_umpire_host_pooled_free(void *ptr); void *hypre_umpire_host_pooled_realloc(void *ptr, size_t size); @@ -754,34 +1286,208 @@ HYPRE_Int hypre_umpire_um_pooled_allocate(void **ptr, size_t nbytes); HYPRE_Int hypre_umpire_um_pooled_free(void *ptr); HYPRE_Int hypre_umpire_pinned_pooled_allocate(void **ptr, size_t nbytes); HYPRE_Int hypre_umpire_pinned_pooled_free(void *ptr); - -#ifdef HYPRE_USING_MEMORY_TRACKER -hypre_MemoryTracker * hypre_MemoryTrackerCreate(); -void hypre_MemoryTrackerDestroy(hypre_MemoryTracker *tracker); -void hypre_MemoryTrackerInsert(const char *action, void *ptr, size_t nbytes, hypre_MemoryLocation memory_location, const char *filename, const char *function, HYPRE_Int line); -HYPRE_Int hypre_PrintMemoryTracker(); -#endif - +HYPRE_Int hypre_UmpireInit(hypre_Handle *hypre_handle_); +HYPRE_Int hypre_UmpireFinalize(hypre_Handle *hypre_handle_); +HYPRE_Int hypre_UmpireGetCurrentMemoryUsage(MPI_Comm comm, HYPRE_Real *current); +HYPRE_Int hypre_UmpireMemoryGetUsage(HYPRE_Real *memory); +HYPRE_Int hypre_HostMemoryGetUsage(HYPRE_Real *mem); +HYPRE_Int hypre_MemoryPrintUsage(MPI_Comm comm, HYPRE_Int level, + const char *function, HYPRE_Int line); +#define HYPRE_PRINT_MEMORY_USAGE(comm) hypre_MemoryPrintUsage(comm,\ + hypre_HandleLogLevel(hypre_handle()),\ + __func__,\ + __LINE__) /* memory_dmalloc.c */ HYPRE_Int hypre_InitMemoryDebugDML( HYPRE_Int id ); HYPRE_Int hypre_FinalizeMemoryDebugDML( void ); -char *hypre_MAllocDML( HYPRE_Int size , char *file , HYPRE_Int line ); -char *hypre_CAllocDML( HYPRE_Int count , HYPRE_Int elt_size , char *file , HYPRE_Int line ); -char *hypre_ReAllocDML( char *ptr , HYPRE_Int size , char *file , HYPRE_Int line ); -void hypre_FreeDML( char *ptr , char *file , HYPRE_Int line ); - -/* GPU malloc prototype */ -typedef void (*GPUMallocFunc)(void **, size_t); -typedef void (*GPUMfreeFunc)(void *); +char *hypre_MAllocDML( HYPRE_Int size, char *file, HYPRE_Int line ); +char *hypre_CAllocDML( HYPRE_Int count, HYPRE_Int elt_size, char *file, HYPRE_Int line ); +char *hypre_ReAllocDML( char *ptr, HYPRE_Int size, char *file, HYPRE_Int line ); +void hypre_FreeDML( char *ptr, char *file, HYPRE_Int line ); #ifdef __cplusplus } #endif -#endif +#endif /* hypre_MEMORY_HEADER */ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#ifndef hypre_MEMORY_TRACKER_HEADER +#define hypre_MEMORY_TRACKER_HEADER + +#if defined(HYPRE_USING_MEMORY_TRACKER) + +extern size_t hypre_total_bytes[hypre_MEMORY_UNIFIED + 1]; +extern size_t hypre_peak_bytes[hypre_MEMORY_UNIFIED + 1]; +extern size_t hypre_current_bytes[hypre_MEMORY_UNIFIED + 1]; +extern HYPRE_Int hypre_memory_tracker_print; +extern char hypre_memory_tracker_filename[HYPRE_MAX_FILE_NAME_LEN]; + +typedef enum _hypre_MemoryTrackerEvent +{ + HYPRE_MEMORY_EVENT_ALLOC = 0, + HYPRE_MEMORY_EVENT_FREE, + HYPRE_MEMORY_EVENT_COPY, + HYPRE_MEMORY_NUM_EVENTS, +} hypre_MemoryTrackerEvent; + +typedef enum _hypre_MemcpyType +{ + hypre_MEMCPY_H2H = 0, + hypre_MEMCPY_D2H, + hypre_MEMCPY_H2D, + hypre_MEMCPY_D2D, + hypre_MEMCPY_NUM_TYPES, +} hypre_MemcpyType; + +typedef struct +{ + size_t index; + size_t time_step; + char action[16]; + void *ptr; + void *ptr2; + size_t nbytes; + hypre_MemoryLocation memory_location; + hypre_MemoryLocation memory_location2; + char filename[HYPRE_MAX_FILE_NAME_LEN]; + char function[256]; + HYPRE_Int line; + size_t pair; +} hypre_MemoryTrackerEntry; + +typedef struct +{ + size_t head; + size_t actual_size; + size_t alloced_size; + hypre_MemoryTrackerEntry *data; + /* Free Queue is sorted based on (ptr, time_step) ascendingly */ + hypre_MemoryTrackerEntry *sorted_data; + /* compressed sorted_data with the same ptr */ + size_t sorted_data_compressed_len; + size_t *sorted_data_compressed_offset; + hypre_MemoryTrackerEntry **sorted_data_compressed; +} hypre_MemoryTrackerQueue; + +typedef struct +{ + size_t curr_time_step; + hypre_MemoryTrackerQueue queue[HYPRE_MEMORY_NUM_EVENTS]; +} hypre_MemoryTracker; + +extern hypre_MemoryTracker *_hypre_memory_tracker; + +#define hypre_TAlloc(type, count, location) \ +( \ +{ \ + void *ptr = hypre_MAlloc((size_t)(sizeof(type) * (count)), location); \ + \ + hypre_MemoryLocation alocation = hypre_GetActualMemLocation(location); \ + hypre_MemoryTrackerInsert1("malloc", ptr, sizeof(type)*(count), alocation, \ + __FILE__, __func__, __LINE__); \ + (type *) ptr; \ +} \ +) + +#define hypre_CTAlloc(type, count, location) \ +( \ +{ \ + void *ptr = hypre_CAlloc((size_t)(count), (size_t)sizeof(type), location); \ + \ + hypre_MemoryLocation alocation = hypre_GetActualMemLocation(location); \ + hypre_MemoryTrackerInsert1("calloc", ptr, sizeof(type)*(count), alocation, \ + __FILE__, __func__, __LINE__); \ + (type *) ptr; \ +} \ +) + +#define hypre_TReAlloc(ptr, type, count, location) \ +( \ +{ \ + void *new_ptr = hypre_ReAlloc((char *)ptr, (size_t)(sizeof(type) * (count)), location); \ + \ + hypre_MemoryLocation alocation = hypre_GetActualMemLocation(location); \ + hypre_MemoryTrackerInsert1("rfree", ptr, (size_t) -1, alocation, \ + __FILE__, __func__, __LINE__); \ + hypre_MemoryTrackerInsert1("rmalloc", new_ptr, sizeof(type)*(count), alocation, \ + __FILE__, __func__, __LINE__); \ + (type *) new_ptr; \ +} \ +) + +#define hypre_TReAlloc_v2(ptr, old_type, old_count, new_type, new_count, location) \ +( \ +{ \ + void *new_ptr = hypre_ReAlloc_v2((char *)ptr, (size_t)(sizeof(old_type)*(old_count)), \ + (size_t)(sizeof(new_type)*(new_count)), location); \ + \ + hypre_MemoryLocation alocation = hypre_GetActualMemLocation(location); \ + hypre_MemoryTrackerInsert1("rfree", ptr, sizeof(old_type)*(old_count), alocation, \ + __FILE__, __func__, __LINE__); \ + hypre_MemoryTrackerInsert1("rmalloc", new_ptr, sizeof(new_type)*(new_count), alocation, \ + __FILE__, __func__, __LINE__); \ + (new_type *) new_ptr; \ +} \ +) + +#define hypre_TMemcpy(dst, src, type, count, locdst, locsrc) \ +( \ +{ \ + hypre_Memcpy((void *)(dst), (void *)(src), (size_t)(sizeof(type) * (count)), locdst, locsrc); \ + \ + hypre_MemoryLocation alocation_dst = hypre_GetActualMemLocation(locdst); \ + hypre_MemoryLocation alocation_src = hypre_GetActualMemLocation(locsrc); \ + hypre_MemoryTrackerInsert2("memcpy", (void *) (dst), (void *) (src), sizeof(type)*(count), \ + alocation_dst, alocation_src, \ + __FILE__, __func__, __LINE__); \ +} \ +) + +#define hypre_TFree(ptr, location) \ +( \ +{ \ + hypre_Free((void *)ptr, location); \ + \ + hypre_MemoryLocation alocation = hypre_GetActualMemLocation(location); \ + hypre_MemoryTrackerInsert1("free", ptr, (size_t) -1, alocation, \ + __FILE__, __func__, __LINE__); \ + ptr = NULL; \ +} \ +) + +#define _hypre_TAlloc(type, count, location) \ +( \ +{ \ + void *ptr = _hypre_MAlloc((size_t)(sizeof(type) * (count)), location); \ + \ + hypre_MemoryTrackerInsert1("malloc", ptr, sizeof(type)*(count), location, \ + __FILE__, __func__, __LINE__); \ + (type *) ptr; \ +} \ +) + +#define _hypre_TFree(ptr, location) \ +( \ +{ \ + _hypre_Free((void *)ptr, location); \ + \ + hypre_MemoryTrackerInsert1("free", ptr, (size_t) -1, location, \ + __FILE__, __func__, __LINE__); \ + ptr = NULL; \ +} \ +) + +#endif /* #if defined(HYPRE_USING_MEMORY_TRACKER) */ +#endif /* #ifndef hypre_MEMORY_TRACKER_HEADER */ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -884,17 +1590,18 @@ extern size_t hypre__target_dtoh_bytes; } \ } -HYPRE_Int HYPRE_OMPOffload(HYPRE_Int device, void *ptr, size_t num, const char *type1, const char *type2); +HYPRE_Int HYPRE_OMPOffload(HYPRE_Int device, void *ptr, size_t num, const char *type1, + const char *type2); HYPRE_Int HYPRE_OMPPtrIsMapped(void *p, HYPRE_Int device_num); -HYPRE_Int HYPRE_OMPOffloadOn(); -HYPRE_Int HYPRE_OMPOffloadOff(); -HYPRE_Int HYPRE_OMPOffloadStatPrint(); +HYPRE_Int HYPRE_OMPOffloadOn(void); +HYPRE_Int HYPRE_OMPOffloadOff(void); +HYPRE_Int HYPRE_OMPOffloadStatPrint(void); #endif /* HYPRE_USING_DEVICE_OPENMP */ #endif /* HYPRE_OMP_DEVICE_H */ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -924,7 +1631,7 @@ void hypre_GetSimpleThreadPartition( HYPRE_Int *begin, HYPRE_Int *end, HYPRE_Int #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -965,11 +1672,13 @@ HYPRE_Real time_get_cpu_seconds_( void ); #define hypre_InitializeTiming(name) 0 #define hypre_FinalizeTiming(index) +#define hypre_FinalizeAllTimings() #define hypre_IncFLOPCount(inc) #define hypre_BeginTiming(i) #define hypre_EndTiming(i) #define hypre_PrintTiming(heading, comm) #define hypre_ClearTiming() +#define hypre_GetTiming(heading, comm, time) /*-------------------------------------------------------------------------- * With timing on @@ -1026,11 +1735,13 @@ extern hypre_TimingType *hypre_global_timing; /* timing.c */ HYPRE_Int hypre_InitializeTiming( const char *name ); HYPRE_Int hypre_FinalizeTiming( HYPRE_Int time_index ); +HYPRE_Int hypre_FinalizeAllTimings( void ); HYPRE_Int hypre_IncFLOPCount( HYPRE_BigInt inc ); HYPRE_Int hypre_BeginTiming( HYPRE_Int time_index ); HYPRE_Int hypre_EndTiming( HYPRE_Int time_index ); HYPRE_Int hypre_ClearTiming( void ); -HYPRE_Int hypre_PrintTiming( const char *heading , MPI_Comm comm ); +HYPRE_Int hypre_PrintTiming( const char *heading, MPI_Comm comm ); +HYPRE_Int hypre_GetTiming( const char *heading, HYPRE_Real *wall_time_ptr, MPI_Comm comm ); #endif @@ -1041,7 +1752,7 @@ HYPRE_Int hypre_PrintTiming( const char *heading , MPI_Comm comm ); #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -1083,7 +1794,7 @@ typedef hypre_ListElement *hypre_LinkList; #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -1115,9 +1826,9 @@ typedef struct typedef struct { HYPRE_Int (*fill_response)(void* recv_buf, HYPRE_Int contact_size, - HYPRE_Int contact_proc, void* response_obj, - MPI_Comm comm, void** response_buf, - HYPRE_Int* response_message_size); + HYPRE_Int contact_proc, void* response_obj, + MPI_Comm comm, void** response_buf, + HYPRE_Int* response_message_size); HYPRE_Int send_response_overhead; /*set by exchange data */ HYPRE_Int send_response_storage; /*storage allocated for send_response_buf*/ void *data1; /*data fields user may want to access in fill_response */ @@ -1125,14 +1836,16 @@ typedef struct } hypre_DataExchangeResponse; -HYPRE_Int hypre_CreateBinaryTree(HYPRE_Int, HYPRE_Int, hypre_BinaryTree*); +HYPRE_Int hypre_CreateBinaryTree(HYPRE_Int, HYPRE_Int, hypre_BinaryTree**); HYPRE_Int hypre_DestroyBinaryTree(hypre_BinaryTree*); -HYPRE_Int hypre_DataExchangeList(HYPRE_Int num_contacts, HYPRE_Int *contact_proc_list, void *contact_send_buf, HYPRE_Int *contact_send_buf_starts, HYPRE_Int contact_obj_size, HYPRE_Int response_obj_size, hypre_DataExchangeResponse *response_obj, HYPRE_Int max_response_size, HYPRE_Int rnum, MPI_Comm comm, void **p_response_recv_buf, HYPRE_Int **p_response_recv_buf_starts); +HYPRE_Int hypre_DataExchangeList(HYPRE_Int num_contacts, HYPRE_Int *contact_proc_list, + void *contact_send_buf, HYPRE_Int *contact_send_buf_starts, HYPRE_Int contact_obj_size, + HYPRE_Int response_obj_size, hypre_DataExchangeResponse *response_obj, HYPRE_Int max_response_size, + HYPRE_Int rnum, MPI_Comm comm, void **p_response_recv_buf, HYPRE_Int **p_response_recv_buf_starts); #endif /* end of header */ - /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -1152,7 +1865,8 @@ HYPRE_Int hypre_DataExchangeList(HYPRE_Int num_contacts, HYPRE_Int *contact_proc #ifdef HYPRE_USING_CALIPER #ifdef __cplusplus -extern "C++" { +extern "C++" +{ #endif #include @@ -1161,9 +1875,6 @@ extern "C++" { } #endif -static char hypre__levelname[16]; -static char hypre__markname[1024]; - #define HYPRE_ANNOTATE_FUNC_BEGIN CALI_MARK_FUNCTION_BEGIN #define HYPRE_ANNOTATE_FUNC_END CALI_MARK_FUNCTION_END #define HYPRE_ANNOTATE_LOOP_BEGIN(id, str) CALI_MARK_LOOP_BEGIN(id, str) @@ -1172,21 +1883,25 @@ static char hypre__markname[1024]; #define HYPRE_ANNOTATE_ITER_END(id) CALI_MARK_ITERATION_END(id) #define HYPRE_ANNOTATE_REGION_BEGIN(...)\ {\ + char hypre__markname[1024];\ hypre_sprintf(hypre__markname, __VA_ARGS__);\ CALI_MARK_BEGIN(hypre__markname);\ } #define HYPRE_ANNOTATE_REGION_END(...)\ {\ + char hypre__markname[1024];\ hypre_sprintf(hypre__markname, __VA_ARGS__);\ CALI_MARK_END(hypre__markname);\ } #define HYPRE_ANNOTATE_MGLEVEL_BEGIN(lvl)\ {\ + char hypre__levelname[16];\ hypre_sprintf(hypre__levelname, "MG level %d", lvl);\ CALI_MARK_BEGIN(hypre__levelname);\ } #define HYPRE_ANNOTATE_MGLEVEL_END(lvl)\ {\ + char hypre__levelname[16];\ hypre_sprintf(hypre__levelname, "MG level %d", lvl);\ CALI_MARK_END(hypre__levelname);\ } @@ -1209,110 +1924,7 @@ static char hypre__markname[1024]; #endif /* CALIPER_INSTRUMENTATION_HEADER */ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other - * HYPRE Project Developers. See the top-level COPYRIGHT file for details. - * - * SPDX-License-Identifier: (Apache-2.0 OR MIT) - ******************************************************************************/ - -/****************************************************************************** - * - * General structures and values - * - *****************************************************************************/ - -#ifndef HYPRE_HANDLE_H -#define HYPRE_HANDLE_H - -struct hypre_CudaData; -typedef struct hypre_CudaData hypre_CudaData; - -typedef struct -{ - HYPRE_Int hypre_error; - HYPRE_MemoryLocation memory_location; - HYPRE_ExecutionPolicy default_exec_policy; - HYPRE_ExecutionPolicy struct_exec_policy; -#if defined(HYPRE_USING_GPU) - hypre_CudaData *cuda_data; - /* device G-S options */ - HYPRE_Int device_gs_method; -#endif -#if defined(HYPRE_USING_UMPIRE) - char umpire_device_pool_name[HYPRE_UMPIRE_POOL_NAME_MAX_LEN]; - char umpire_um_pool_name[HYPRE_UMPIRE_POOL_NAME_MAX_LEN]; - char umpire_host_pool_name[HYPRE_UMPIRE_POOL_NAME_MAX_LEN]; - char umpire_pinned_pool_name[HYPRE_UMPIRE_POOL_NAME_MAX_LEN]; - size_t umpire_device_pool_size; - size_t umpire_um_pool_size; - size_t umpire_host_pool_size; - size_t umpire_pinned_pool_size; - size_t umpire_block_size; - HYPRE_Int own_umpire_device_pool; - HYPRE_Int own_umpire_um_pool; - HYPRE_Int own_umpire_host_pool; - HYPRE_Int own_umpire_pinned_pool; - umpire_resourcemanager umpire_rm; -#endif - /* user malloc/free function pointers */ - GPUMallocFunc user_device_malloc; - GPUMfreeFunc user_device_free; -} hypre_Handle; - -/* accessor macros to hypre_Handle */ -#define hypre_HandleMemoryLocation(hypre_handle) ((hypre_handle) -> memory_location) -#define hypre_HandleDefaultExecPolicy(hypre_handle) ((hypre_handle) -> default_exec_policy) -#define hypre_HandleStructExecPolicy(hypre_handle) ((hypre_handle) -> struct_exec_policy) -#define hypre_HandleCudaData(hypre_handle) ((hypre_handle) -> cuda_data) -#define hypre_HandleDeviceGSMethod(hypre_handle) ((hypre_handle) -> device_gs_method) - -#define hypre_HandleCurandGenerator(hypre_handle) hypre_CudaDataCurandGenerator(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleCublasHandle(hypre_handle) hypre_CudaDataCublasHandle(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleCusparseHandle(hypre_handle) hypre_CudaDataCusparseHandle(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleCudaComputeStream(hypre_handle) hypre_CudaDataCudaComputeStream(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleCubBinGrowth(hypre_handle) hypre_CudaDataCubBinGrowth(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleCubMinBin(hypre_handle) hypre_CudaDataCubMinBin(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleCubMaxBin(hypre_handle) hypre_CudaDataCubMaxBin(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleCubMaxCachedBytes(hypre_handle) hypre_CudaDataCubMaxCachedBytes(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleCubDevAllocator(hypre_handle) hypre_CudaDataCubDevAllocator(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleCubUvmAllocator(hypre_handle) hypre_CudaDataCubUvmAllocator(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleCudaDevice(hypre_handle) hypre_CudaDataCudaDevice(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleCudaComputeStreamNum(hypre_handle) hypre_CudaDataCudaComputeStreamNum(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleCudaReduceBuffer(hypre_handle) hypre_CudaDataCudaReduceBuffer(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleStructCommRecvBuffer(hypre_handle) hypre_CudaDataStructCommRecvBuffer(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleStructCommSendBuffer(hypre_handle) hypre_CudaDataStructCommSendBuffer(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleStructCommRecvBufferSize(hypre_handle) hypre_CudaDataStructCommRecvBufferSize(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleStructCommSendBufferSize(hypre_handle) hypre_CudaDataStructCommSendBufferSize(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleSpgemmUseCusparse(hypre_handle) hypre_CudaDataSpgemmUseCusparse(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleSpgemmAlgorithm(hypre_handle) hypre_CudaDataSpgemmAlgorithm(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleSpgemmRownnzEstimateMethod(hypre_handle) hypre_CudaDataSpgemmRownnzEstimateMethod(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleSpgemmRownnzEstimateNsamples(hypre_handle) hypre_CudaDataSpgemmRownnzEstimateNsamples(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleSpgemmRownnzEstimateMultFactor(hypre_handle) hypre_CudaDataSpgemmRownnzEstimateMultFactor(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleSpgemmHashType(hypre_handle) hypre_CudaDataSpgemmHashType(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleDeviceAllocator(hypre_handle) hypre_CudaDataDeviceAllocator(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleUseGpuRand(hypre_handle) hypre_CudaDataUseGpuRand(hypre_HandleCudaData(hypre_handle)) - -#define hypre_HandleUserDeviceMalloc(hypre_handle) ((hypre_handle) -> user_device_malloc) -#define hypre_HandleUserDeviceMfree(hypre_handle) ((hypre_handle) -> user_device_free) - -#define hypre_HandleUmpireResourceMan(hypre_handle) ((hypre_handle) -> umpire_rm) -#define hypre_HandleUmpireDevicePoolSize(hypre_handle) ((hypre_handle) -> umpire_device_pool_size) -#define hypre_HandleUmpireUMPoolSize(hypre_handle) ((hypre_handle) -> umpire_um_pool_size) -#define hypre_HandleUmpireHostPoolSize(hypre_handle) ((hypre_handle) -> umpire_host_pool_size) -#define hypre_HandleUmpirePinnedPoolSize(hypre_handle) ((hypre_handle) -> umpire_pinned_pool_size) -#define hypre_HandleUmpireBlockSize(hypre_handle) ((hypre_handle) -> umpire_block_size) -#define hypre_HandleUmpireDevicePoolName(hypre_handle) ((hypre_handle) -> umpire_device_pool_name) -#define hypre_HandleUmpireUMPoolName(hypre_handle) ((hypre_handle) -> umpire_um_pool_name) -#define hypre_HandleUmpireHostPoolName(hypre_handle) ((hypre_handle) -> umpire_host_pool_name) -#define hypre_HandleUmpirePinnedPoolName(hypre_handle) ((hypre_handle) -> umpire_pinned_pool_name) -#define hypre_HandleOwnUmpireDevicePool(hypre_handle) ((hypre_handle) -> own_umpire_device_pool) -#define hypre_HandleOwnUmpireUMPool(hypre_handle) ((hypre_handle) -> own_umpire_um_pool) -#define hypre_HandleOwnUmpireHostPool(hypre_handle) ((hypre_handle) -> own_umpire_host_pool) -#define hypre_HandleOwnUmpirePinnedPool(hypre_handle) ((hypre_handle) -> own_umpire_pinned_pool) - -#endif -/****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -1381,7 +1993,7 @@ typedef struct #endif /* #ifndef HYPRE_GSELIM_H */ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -1400,9 +2012,9 @@ typedef struct * hypre_IntArray *--------------------------------------------------------------------------*/ -typedef struct +typedef struct { - /* pointer to data and size of data */ + /* pointer to data and size of data */ HYPRE_Int *data; HYPRE_Int size; @@ -1415,12 +2027,39 @@ typedef struct *--------------------------------------------------------------------------*/ #define hypre_IntArrayData(array) ((array) -> data) +#define hypre_IntArrayDataI(array, i) ((array) -> data[i]) #define hypre_IntArraySize(array) ((array) -> size) #define hypre_IntArrayMemoryLocation(array) ((array) -> memory_location) +/****************************************************************************** + * + * hypre_IntArrayArray: struct for holding an array of hypre_IntArray + * + *****************************************************************************/ + +/*-------------------------------------------------------------------------- + * hypre_IntArrayArray + *--------------------------------------------------------------------------*/ + +typedef struct +{ + hypre_IntArray **entries; + HYPRE_Int size; +} hypre_IntArrayArray; + +/*-------------------------------------------------------------------------- + * Accessor functions for the IntArrayArray structure + *--------------------------------------------------------------------------*/ + +#define hypre_IntArrayArrayEntries(array) ((array) -> entries) +#define hypre_IntArrayArrayEntryI(array, i) ((array) -> entries[i]) +#define hypre_IntArrayArrayEntryIData(array, i) ((array) -> entries[i] -> data) +#define hypre_IntArrayArrayEntryIDataJ(array, i, j) ((array) -> entries[i] -> data[j]) +#define hypre_IntArrayArraySize(array) ((array) -> size) + #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -1428,14 +2067,17 @@ typedef struct /* amg_linklist.c */ void hypre_dispose_elt ( hypre_LinkList element_ptr ); -void hypre_remove_point ( hypre_LinkList *LoL_head_ptr , hypre_LinkList *LoL_tail_ptr , HYPRE_Int measure , HYPRE_Int index , HYPRE_Int *lists , HYPRE_Int *where ); +void hypre_remove_point ( hypre_LinkList *LoL_head_ptr, hypre_LinkList *LoL_tail_ptr, + HYPRE_Int measure, HYPRE_Int index, HYPRE_Int *lists, HYPRE_Int *where ); hypre_LinkList hypre_create_elt ( HYPRE_Int Item ); -void hypre_enter_on_lists ( hypre_LinkList *LoL_head_ptr , hypre_LinkList *LoL_tail_ptr , HYPRE_Int measure , HYPRE_Int index , HYPRE_Int *lists , HYPRE_Int *where ); +void hypre_enter_on_lists ( hypre_LinkList *LoL_head_ptr, hypre_LinkList *LoL_tail_ptr, + HYPRE_Int measure, HYPRE_Int index, HYPRE_Int *lists, HYPRE_Int *where ); /* binsearch.c */ -HYPRE_Int hypre_BinarySearch ( HYPRE_Int *list , HYPRE_Int value , HYPRE_Int list_length ); -HYPRE_Int hypre_BigBinarySearch ( HYPRE_BigInt *list , HYPRE_BigInt value , HYPRE_Int list_length ); -HYPRE_Int hypre_BinarySearch2 ( HYPRE_Int *list , HYPRE_Int value , HYPRE_Int low , HYPRE_Int high , HYPRE_Int *spot ); +HYPRE_Int hypre_BinarySearch ( HYPRE_Int *list, HYPRE_Int value, HYPRE_Int list_length ); +HYPRE_Int hypre_BigBinarySearch ( HYPRE_BigInt *list, HYPRE_BigInt value, HYPRE_Int list_length ); +HYPRE_Int hypre_BinarySearch2 ( HYPRE_Int *list, HYPRE_Int value, HYPRE_Int low, HYPRE_Int high, + HYPRE_Int *spot ); HYPRE_Int *hypre_LowerBound( HYPRE_Int *first, HYPRE_Int *last, HYPRE_Int value ); HYPRE_BigInt *hypre_BigLowerBound( HYPRE_BigInt *first, HYPRE_BigInt *last, HYPRE_BigInt value ); @@ -1448,65 +2090,87 @@ HYPRE_Complex hypre_conj( HYPRE_Complex value ); HYPRE_Real hypre_cabs( HYPRE_Complex value ); HYPRE_Real hypre_creal( HYPRE_Complex value ); HYPRE_Real hypre_cimag( HYPRE_Complex value ); +HYPRE_Complex hypre_csqrt( HYPRE_Complex value ); #else #define hypre_conj(value) value -#define hypre_cabs(value) fabs(value) +#define hypre_cabs(value) hypre_abs(value) #define hypre_creal(value) value #define hypre_cimag(value) 0.0 +#define hypre_csqrt(value) hypre_sqrt(value) #endif +/* state.c */ +HYPRE_Int hypre_Initialized( void ); +HYPRE_Int hypre_Finalized( void ); +HYPRE_Int hypre_SetInitialized( void ); +HYPRE_Int hypre_SetFinalized( void ); + /* general.c */ -#ifdef HYPRE_USING_MEMORY_TRACKER -hypre_MemoryTracker* hypre_memory_tracker(); -#endif -hypre_Handle* hypre_handle(); -hypre_Handle* hypre_HandleCreate(); +hypre_Handle* hypre_handle(void); +hypre_Handle* hypre_HandleCreate(void); HYPRE_Int hypre_HandleDestroy(hypre_Handle *hypre_handle_); HYPRE_Int hypre_SetDevice(hypre_int device_id, hypre_Handle *hypre_handle_); HYPRE_Int hypre_GetDevice(hypre_int *device_id); HYPRE_Int hypre_GetDeviceCount(hypre_int *device_count); -HYPRE_Int hypre_GetDeviceLastError(); -HYPRE_Int hypre_UmpireInit(hypre_Handle *hypre_handle_); -HYPRE_Int hypre_UmpireFinalize(hypre_Handle *hypre_handle_); +HYPRE_Int hypre_GetDeviceLastError(void); +HYPRE_Int hypre_GetDeviceMaxShmemSize(hypre_int device_id, hypre_int *max_size_ptr, + hypre_int *max_size_optin_ptr); + +/* matrix_stats.h */ +hypre_MatrixStats* hypre_MatrixStatsCreate( void ); +HYPRE_Int hypre_MatrixStatsDestroy( hypre_MatrixStats *stats ); +hypre_MatrixStatsArray* hypre_MatrixStatsArrayCreate( HYPRE_Int capacity ); +HYPRE_Int hypre_MatrixStatsArrayDestroy( hypre_MatrixStatsArray *stats_array ); +HYPRE_Int hypre_MatrixStatsArrayPrint( HYPRE_Int num_hierarchies, HYPRE_Int *num_levels, + HYPRE_Int use_divisors, HYPRE_Int shift, + const char **messages, + hypre_MatrixStatsArray *stats_array ); /* qsort.c */ -void hypre_swap ( HYPRE_Int *v , HYPRE_Int i , HYPRE_Int j ); -void hypre_swap_c ( HYPRE_Complex *v , HYPRE_Int i , HYPRE_Int j ); -void hypre_swap2 ( HYPRE_Int *v , HYPRE_Real *w , HYPRE_Int i , HYPRE_Int j ); -void hypre_BigSwap2 ( HYPRE_BigInt *v , HYPRE_Real *w , HYPRE_Int i , HYPRE_Int j ); -void hypre_swap2i ( HYPRE_Int *v , HYPRE_Int *w , HYPRE_Int i , HYPRE_Int j ); -void hypre_BigSwap2i ( HYPRE_BigInt *v , HYPRE_Int *w , HYPRE_Int i , HYPRE_Int j ); -void hypre_swap3i ( HYPRE_Int *v , HYPRE_Int *w , HYPRE_Int *z , HYPRE_Int i , HYPRE_Int j ); -void hypre_swap3_d ( HYPRE_Real *v , HYPRE_Int *w , HYPRE_Int *z , HYPRE_Int i , HYPRE_Int j ); +void hypre_swap ( HYPRE_Int *v, HYPRE_Int i, HYPRE_Int j ); +void hypre_swap_c ( HYPRE_Complex *v, HYPRE_Int i, HYPRE_Int j ); +void hypre_swap2 ( HYPRE_Int *v, HYPRE_Real *w, HYPRE_Int i, HYPRE_Int j ); +void hypre_BigSwap2 ( HYPRE_BigInt *v, HYPRE_Real *w, HYPRE_Int i, HYPRE_Int j ); +void hypre_swap2i ( HYPRE_Int *v, HYPRE_Int *w, HYPRE_Int i, HYPRE_Int j ); +void hypre_BigSwap2i ( HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int i, HYPRE_Int j ); +void hypre_swap3i ( HYPRE_Int *v, HYPRE_Int *w, HYPRE_Int *z, HYPRE_Int i, HYPRE_Int j ); +void hypre_swap3_d ( HYPRE_Real *v, HYPRE_Int *w, HYPRE_Int *z, HYPRE_Int i, HYPRE_Int j ); void hypre_swap3_d_perm(HYPRE_Int *v, HYPRE_Real *w, HYPRE_Int *z, HYPRE_Int i, HYPRE_Int j ); -void hypre_BigSwap4_d ( HYPRE_Real *v , HYPRE_BigInt *w , HYPRE_Int *z , HYPRE_Int *y , HYPRE_Int i , HYPRE_Int j ); -void hypre_swap_d ( HYPRE_Real *v , HYPRE_Int i , HYPRE_Int j ); -void hypre_qsort0 ( HYPRE_Int *v , HYPRE_Int left , HYPRE_Int right ); -void hypre_qsort1 ( HYPRE_Int *v , HYPRE_Real *w , HYPRE_Int left , HYPRE_Int right ); -void hypre_BigQsort1 ( HYPRE_BigInt *v , HYPRE_Real *w , HYPRE_Int left , HYPRE_Int right ); -void hypre_qsort2i ( HYPRE_Int *v , HYPRE_Int *w , HYPRE_Int left , HYPRE_Int right ); +void hypre_BigSwap4_d ( HYPRE_Real *v, HYPRE_BigInt *w, HYPRE_Int *z, HYPRE_Int *y, HYPRE_Int i, + HYPRE_Int j ); +void hypre_swap_d ( HYPRE_Real *v, HYPRE_Int i, HYPRE_Int j ); +void hypre_qsort0 ( HYPRE_Int *v, HYPRE_Int left, HYPRE_Int right ); +void hypre_qsort1 ( HYPRE_Int *v, HYPRE_Real *w, HYPRE_Int left, HYPRE_Int right ); +void hypre_BigQsort1 ( HYPRE_BigInt *v, HYPRE_Real *w, HYPRE_Int left, HYPRE_Int right ); +void hypre_qsort2i ( HYPRE_Int *v, HYPRE_Int *w, HYPRE_Int left, HYPRE_Int right ); void hypre_BigQsort2i( HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int left, HYPRE_Int right ); -void hypre_qsort2 ( HYPRE_Int *v , HYPRE_Real *w , HYPRE_Int left , HYPRE_Int right ); -void hypre_qsort2_abs ( HYPRE_Int *v , HYPRE_Real *w , HYPRE_Int left , HYPRE_Int right ); -void hypre_qsort3i ( HYPRE_Int *v , HYPRE_Int *w , HYPRE_Int *z , HYPRE_Int left , HYPRE_Int right ); -void hypre_qsort3ir ( HYPRE_Int *v , HYPRE_Real *w , HYPRE_Int *z , HYPRE_Int left , HYPRE_Int right ); +void hypre_qsort2 ( HYPRE_Int *v, HYPRE_Real *w, HYPRE_Int left, HYPRE_Int right ); +void hypre_qsort2_abs ( HYPRE_Int *v, HYPRE_Real *w, HYPRE_Int left, HYPRE_Int right ); +void hypre_qsort3i ( HYPRE_Int *v, HYPRE_Int *w, HYPRE_Int *z, HYPRE_Int left, HYPRE_Int right ); +void hypre_qsort3ir ( HYPRE_Int *v, HYPRE_Real *w, HYPRE_Int *z, HYPRE_Int left, HYPRE_Int right ); void hypre_qsort3( HYPRE_Real *v, HYPRE_Int *w, HYPRE_Int *z, HYPRE_Int left, HYPRE_Int right ); -void hypre_qsort3_abs ( HYPRE_Real *v , HYPRE_Int *w , HYPRE_Int *z , HYPRE_Int left , HYPRE_Int right ); -void hypre_BigQsort4_abs ( HYPRE_Real *v , HYPRE_BigInt *w , HYPRE_Int *z , HYPRE_Int *y , HYPRE_Int left , HYPRE_Int right ); -void hypre_qsort_abs ( HYPRE_Real *w , HYPRE_Int left , HYPRE_Int right ); +void hypre_qsort3_abs ( HYPRE_Real *v, HYPRE_Int *w, HYPRE_Int *z, HYPRE_Int left, + HYPRE_Int right ); +void hypre_BigQsort4_abs ( HYPRE_Real *v, HYPRE_BigInt *w, HYPRE_Int *z, HYPRE_Int *y, + HYPRE_Int left, HYPRE_Int right ); +void hypre_qsort_abs ( HYPRE_Real *w, HYPRE_Int left, HYPRE_Int right ); void hypre_BigSwapbi(HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int i, HYPRE_Int j ); void hypre_BigQsortbi( HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int left, HYPRE_Int right ); void hypre_BigSwapLoc(HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int i, HYPRE_Int j ); void hypre_BigQsortbLoc( HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int left, HYPRE_Int right ); void hypre_BigSwapb2i(HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int *z, HYPRE_Int i, HYPRE_Int j ); -void hypre_BigQsortb2i( HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int *z, HYPRE_Int left, HYPRE_Int right ); +void hypre_BigQsortb2i( HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int *z, HYPRE_Int left, + HYPRE_Int right ); void hypre_BigSwap( HYPRE_BigInt *v, HYPRE_Int i, HYPRE_Int j ); void hypre_BigQsort0( HYPRE_BigInt *v, HYPRE_Int left, HYPRE_Int right ); -void hypre_topo_sort(const HYPRE_Int *row_ptr, const HYPRE_Int *col_inds, const HYPRE_Complex *data, HYPRE_Int *ordering, HYPRE_Int n); -void hypre_dense_topo_sort(const HYPRE_Complex *L, HYPRE_Int *ordering, HYPRE_Int n, HYPRE_Int is_col_major); +void hypre_topo_sort(const HYPRE_Int *row_ptr, const HYPRE_Int *col_inds, const HYPRE_Complex *data, + HYPRE_Int *ordering, HYPRE_Int n); +void hypre_dense_topo_sort(const HYPRE_Complex *L, HYPRE_Int *ordering, HYPRE_Int n, + HYPRE_Int is_col_major); /* qsplit.c */ -HYPRE_Int hypre_DoubleQuickSplit ( HYPRE_Real *values , HYPRE_Int *indices , HYPRE_Int list_length , HYPRE_Int NumberKept ); +HYPRE_Int hypre_DoubleQuickSplit ( HYPRE_Real *values, HYPRE_Int *indices, HYPRE_Int list_length, + HYPRE_Int NumberKept ); /* random.c */ /* HYPRE_CUDA_GLOBAL */ void hypre_SeedRand ( HYPRE_Int seed ); @@ -1534,12 +2198,14 @@ void hypre_prefix_sum(HYPRE_Int *in_out, HYPRE_Int *sum, HYPRE_Int *workspace); * workspace[2*tid] and workspace[2*tid+1] will contain results for tid * workspace[3*nthreads] and workspace[3*nthreads + 1] will contain sums */ -void hypre_prefix_sum_pair(HYPRE_Int *in_out1, HYPRE_Int *sum1, HYPRE_Int *in_out2, HYPRE_Int *sum2, HYPRE_Int *workspace); +void hypre_prefix_sum_pair(HYPRE_Int *in_out1, HYPRE_Int *sum1, HYPRE_Int *in_out2, HYPRE_Int *sum2, + HYPRE_Int *workspace); /** * @param workspace at least with length 3*(nthreads+1) * workspace[3*tid:3*tid+3) will contain results for tid */ -void hypre_prefix_sum_triple(HYPRE_Int *in_out1, HYPRE_Int *sum1, HYPRE_Int *in_out2, HYPRE_Int *sum2, HYPRE_Int *in_out3, HYPRE_Int *sum3, HYPRE_Int *workspace); +void hypre_prefix_sum_triple(HYPRE_Int *in_out1, HYPRE_Int *sum1, HYPRE_Int *in_out2, + HYPRE_Int *sum2, HYPRE_Int *in_out3, HYPRE_Int *sum3, HYPRE_Int *workspace); /** * n prefix-sums together. @@ -1548,7 +2214,8 @@ void hypre_prefix_sum_triple(HYPRE_Int *in_out1, HYPRE_Int *sum1, HYPRE_Int *in_ * * @param workspace at least with length n*(nthreads+1) */ -void hypre_prefix_sum_multiple(HYPRE_Int *in_out, HYPRE_Int *sum, HYPRE_Int n, HYPRE_Int *workspace); +void hypre_prefix_sum_multiple(HYPRE_Int *in_out, HYPRE_Int *sum, HYPRE_Int n, + HYPRE_Int *workspace); /* hopscotch_hash.c */ @@ -1567,7 +2234,7 @@ void hypre_prefix_sum_multiple(HYPRE_Int *in_out, HYPRE_Int *sum, HYPRE_Int n, H #endif // HYPRE_USING_OPENMP -#ifdef HYPRE_HOPSCOTCH +#ifdef HYPRE_USING_HOPSCOTCH #ifdef HYPRE_USING_ATOMIC // concurrent hopscotch hashing is possible only with atomic supports #define HYPRE_CONCURRENT_HOPSCOTCH @@ -1577,8 +2244,8 @@ void hypre_prefix_sum_multiple(HYPRE_Int *in_out, HYPRE_Int *sum, HYPRE_Int n, H #ifdef HYPRE_CONCURRENT_HOPSCOTCH typedef struct { - HYPRE_Int volatile timestamp; - omp_lock_t lock; + HYPRE_Int volatile timestamp; + omp_lock_t lock; } hypre_HopscotchSegment; #endif @@ -1618,18 +2285,18 @@ typedef struct typedef struct { - hypre_uint volatile hopInfo; - HYPRE_Int volatile hash; - HYPRE_Int volatile key; - HYPRE_Int volatile data; + hypre_uint volatile hopInfo; + HYPRE_Int volatile hash; + HYPRE_Int volatile key; + HYPRE_Int volatile data; } hypre_HopscotchBucket; typedef struct { - hypre_uint volatile hopInfo; - HYPRE_BigInt volatile hash; - HYPRE_BigInt volatile key; - HYPRE_Int volatile data; + hypre_uint volatile hopInfo; + HYPRE_BigInt volatile hash; + HYPRE_BigInt volatile key; + HYPRE_Int volatile data; } hypre_BigHopscotchBucket; /** @@ -1664,49 +2331,124 @@ typedef struct * 1) Merge sort can take advantage of eliminating duplicates. * 2) Merge sort is more efficiently parallelizable than qsort */ -HYPRE_Int hypre_MergeOrderedArrays( HYPRE_Int size1 , HYPRE_Int *array1 , HYPRE_Int size2 , HYPRE_Int *array2 , HYPRE_Int *size3_ptr , HYPRE_Int **array3_ptr); -void hypre_union2(HYPRE_Int n1, HYPRE_BigInt *arr1, HYPRE_Int n2, HYPRE_BigInt *arr2, HYPRE_Int *n3, HYPRE_BigInt *arr3, HYPRE_Int *map1, HYPRE_Int *map2); +HYPRE_Int hypre_IntArrayMergeOrdered( hypre_IntArray *array1, hypre_IntArray *array2, + hypre_IntArray *array3 ); +void hypre_union2(HYPRE_Int n1, HYPRE_BigInt *arr1, HYPRE_Int n2, HYPRE_BigInt *arr2, HYPRE_Int *n3, + HYPRE_BigInt *arr3, HYPRE_Int *map1, HYPRE_Int *map2); void hypre_merge_sort(HYPRE_Int *in, HYPRE_Int *temp, HYPRE_Int len, HYPRE_Int **sorted); -void hypre_big_merge_sort(HYPRE_BigInt *in, HYPRE_BigInt *temp, HYPRE_Int len, HYPRE_BigInt **sorted); -void hypre_sort_and_create_inverse_map(HYPRE_Int *in, HYPRE_Int len, HYPRE_Int **out, hypre_UnorderedIntMap *inverse_map); -void hypre_big_sort_and_create_inverse_map(HYPRE_BigInt *in, HYPRE_Int len, HYPRE_BigInt **out, hypre_UnorderedBigIntMap *inverse_map); - +void hypre_big_merge_sort(HYPRE_BigInt *in, HYPRE_BigInt *temp, HYPRE_Int len, + HYPRE_BigInt **sorted); +void hypre_sort_and_create_inverse_map(HYPRE_Int *in, HYPRE_Int len, HYPRE_Int **out, + hypre_UnorderedIntMap *inverse_map); +void hypre_big_sort_and_create_inverse_map(HYPRE_BigInt *in, HYPRE_Int len, HYPRE_BigInt **out, + hypre_UnorderedBigIntMap *inverse_map); + +/* device_utils.c */ #if defined(HYPRE_USING_GPU) -HYPRE_Int hypre_SyncCudaComputeStream(hypre_Handle *hypre_handle); -HYPRE_Int hypre_SyncCudaDevice(hypre_Handle *hypre_handle); -HYPRE_Int hypre_ResetCudaDevice(hypre_Handle *hypre_handle); -HYPRE_Int hypreDevice_DiagScaleVector(HYPRE_Int n, HYPRE_Int *A_i, HYPRE_Complex *A_data, HYPRE_Complex *x, HYPRE_Complex beta, HYPRE_Complex *y); -HYPRE_Int hypreDevice_DiagScaleVector2(HYPRE_Int n, HYPRE_Int *A_i, HYPRE_Complex *A_data, HYPRE_Complex *x, HYPRE_Complex beta, HYPRE_Complex *y, HYPRE_Complex *z); +HYPRE_Int hypre_DeviceMemoryGetUsage(HYPRE_Real *mem); +HYPRE_Int hypre_ForceSyncComputeStream(); +HYPRE_Int hypre_SyncComputeStream(); +HYPRE_Int hypre_SyncDevice(); +HYPRE_Int hypre_ResetDevice(); + +HYPRE_Int hypreDevice_DiagScaleVector(HYPRE_Int num_vectors, HYPRE_Int num_rows, + HYPRE_Int *A_i, HYPRE_Complex *A_data, + HYPRE_Complex *x, HYPRE_Complex beta, + HYPRE_Complex *y); +HYPRE_Int hypreDevice_DiagScaleVector2(HYPRE_Int num_vectors, HYPRE_Int num_rows, + HYPRE_Complex *diag, HYPRE_Complex *x, + HYPRE_Complex beta, HYPRE_Complex *y, + HYPRE_Complex *z, HYPRE_Int computeY); +HYPRE_Int hypreDevice_ComplexArrayToArrayOfPtrs(HYPRE_Int n, HYPRE_Int m, + HYPRE_Complex *data, HYPRE_Complex **data_aop); +HYPRE_Int hypreDevice_zeqxmydd(HYPRE_Int n, HYPRE_Complex *x, HYPRE_Complex alpha, + HYPRE_Complex *y, HYPRE_Complex *z, HYPRE_Complex *d); HYPRE_Int hypreDevice_IVAXPY(HYPRE_Int n, HYPRE_Complex *a, HYPRE_Complex *x, HYPRE_Complex *y); -HYPRE_Int hypreDevice_IVAXPYMarked(HYPRE_Int n, HYPRE_Complex *a, HYPRE_Complex *x, HYPRE_Complex *y, HYPRE_Int *marker, HYPRE_Int marker_val); +HYPRE_Int hypreDevice_IVAXPYMarked(HYPRE_Int n, HYPRE_Complex *a, HYPRE_Complex *x, + HYPRE_Complex *y, HYPRE_Int *marker, HYPRE_Int marker_val); +HYPRE_Int hypreDevice_IVAMXPMY(HYPRE_Int m, HYPRE_Int n, HYPRE_Complex *a, + HYPRE_Complex *x, HYPRE_Complex *y); +HYPRE_Int hypreDevice_IntFilln(HYPRE_Int *d_x, size_t n, HYPRE_Int v); HYPRE_Int hypreDevice_BigIntFilln(HYPRE_BigInt *d_x, size_t n, HYPRE_BigInt v); -HYPRE_Int hypreDevice_Filln(HYPRE_Complex *d_x, size_t n, HYPRE_Complex v); -HYPRE_Int hypreDevice_Scalen(HYPRE_Complex *d_x, size_t n, HYPRE_Complex v); -#endif - -HYPRE_Int hypre_CurandUniform( HYPRE_Int n, HYPRE_Real *urand, HYPRE_Int set_seed, hypre_ulonglongint seed, HYPRE_Int set_offset, hypre_ulonglongint offset); -HYPRE_Int hypre_CurandUniformSingle( HYPRE_Int n, float *urand, HYPRE_Int set_seed, hypre_ulonglongint seed, HYPRE_Int set_offset, hypre_ulonglongint offset); - +HYPRE_Int hypreDevice_ComplexFilln(HYPRE_Complex *d_x, size_t n, HYPRE_Complex v); +HYPRE_Int hypreDevice_CharFilln(char *d_x, size_t n, char v); +HYPRE_Int hypreDevice_IntStridedCopy ( HYPRE_Int size, HYPRE_Int stride, + HYPRE_Int *in, HYPRE_Int *out ); +HYPRE_Int hypreDevice_ComplexStridedCopy ( HYPRE_Int size, HYPRE_Int stride, + HYPRE_Complex *in, HYPRE_Complex *out ); +HYPRE_Int hypreDevice_IntScalen(HYPRE_Int *d_x, size_t n, HYPRE_Int *d_y, HYPRE_Int v); +HYPRE_Int hypreDevice_ComplexScalen(HYPRE_Complex *d_x, size_t n, HYPRE_Complex *d_y, + HYPRE_Complex v); +HYPRE_Int hypreDevice_ComplexAxpyn(HYPRE_Complex *d_x, size_t n, HYPRE_Complex *d_y, + HYPRE_Complex *d_z, HYPRE_Complex a); +HYPRE_Int hypreDevice_ComplexAxpyzn(HYPRE_Int n, HYPRE_Complex *d_x, HYPRE_Complex *d_y, + HYPRE_Complex *d_z, HYPRE_Complex a, HYPRE_Complex b); +HYPRE_Int hypreDevice_IntAxpyn(HYPRE_Int *d_x, size_t n, HYPRE_Int *d_y, HYPRE_Int *d_z, + HYPRE_Int a); +HYPRE_Int hypreDevice_BigIntAxpyn(HYPRE_BigInt *d_x, size_t n, HYPRE_BigInt *d_y, + HYPRE_BigInt *d_z, HYPRE_BigInt a); +HYPRE_Int* hypreDevice_CsrRowPtrsToIndices(HYPRE_Int nrows, HYPRE_Int nnz, HYPRE_Int *d_row_ptr); +HYPRE_Int hypreDevice_CsrRowPtrsToIndices_v2(HYPRE_Int nrows, HYPRE_Int nnz, HYPRE_Int *d_row_ptr, + HYPRE_Int *d_row_ind); +HYPRE_Int* hypreDevice_CsrRowIndicesToPtrs(HYPRE_Int nrows, HYPRE_Int nnz, HYPRE_Int *d_row_ind); +HYPRE_Int hypreDevice_CsrRowIndicesToPtrs_v2(HYPRE_Int nrows, HYPRE_Int nnz, HYPRE_Int *d_row_ind, + HYPRE_Int *d_row_ptr); +HYPRE_Int hypreDevice_GetRowNnz(HYPRE_Int nrows, HYPRE_Int *d_row_indices, HYPRE_Int *d_diag_ia, + HYPRE_Int *d_offd_ia, HYPRE_Int *d_rownnz); +HYPRE_Int hypreDevice_CopyParCSRRows(HYPRE_Int nrows, HYPRE_Int *d_row_indices, HYPRE_Int job, + HYPRE_Int has_offd, HYPRE_BigInt first_col, + HYPRE_BigInt *d_col_map_offd_A, HYPRE_Int *d_diag_i, + HYPRE_Int *d_diag_j, HYPRE_Complex *d_diag_a, + HYPRE_Int *d_offd_i, HYPRE_Int *d_offd_j, + HYPRE_Complex *d_offd_a, HYPRE_Int *d_ib, + HYPRE_BigInt *d_jb, HYPRE_Complex *d_ab); +HYPRE_Int hypreDevice_IntegerReduceSum(HYPRE_Int m, HYPRE_Int *d_i); +HYPRE_Complex hypreDevice_ComplexReduceSum(HYPRE_Int m, HYPRE_Complex *d_x); +HYPRE_Int hypreDevice_IntegerInclusiveScan(HYPRE_Int n, HYPRE_Int *d_i); +HYPRE_Int hypreDevice_IntegerExclusiveScan(HYPRE_Int n, HYPRE_Int *d_i); +HYPRE_Int hypre_CudaCompileFlagCheck(void); +#endif + +HYPRE_Int hypre_CurandUniform( HYPRE_Int n, HYPRE_Real *urand, HYPRE_Int set_seed, + hypre_ulonglongint seed, HYPRE_Int set_offset, hypre_ulonglongint offset); +HYPRE_Int hypre_CurandUniformSingle( HYPRE_Int n, float *urand, HYPRE_Int set_seed, + hypre_ulonglongint seed, HYPRE_Int set_offset, hypre_ulonglongint offset); + +HYPRE_Int hypre_ResetDeviceRandGenerator( hypre_ulonglongint seed, hypre_ulonglongint offset ); + +HYPRE_Int hypre_bind_device_id(HYPRE_Int device_id_in, HYPRE_Int myid, + HYPRE_Int nproc, MPI_Comm comm); HYPRE_Int hypre_bind_device(HYPRE_Int myid, HYPRE_Int nproc, MPI_Comm comm); +/* stl_ops.c */ +HYPRE_Int hypre_IntSequence(HYPRE_MemoryLocation memory_location, HYPRE_Int size, HYPRE_Int *data); + /* nvtx.c */ void hypre_GpuProfilingPushRangeColor(const char *name, HYPRE_Int cid); void hypre_GpuProfilingPushRange(const char *name); -void hypre_GpuProfilingPopRange(); +void hypre_GpuProfilingPopRange(void); /* utilities.c */ HYPRE_Int hypre_multmod(HYPRE_Int a, HYPRE_Int b, HYPRE_Int mod); void hypre_partition1D(HYPRE_Int n, HYPRE_Int p, HYPRE_Int j, HYPRE_Int *s, HYPRE_Int *e); char *hypre_strcpy(char *destination, const char *source); +HYPRE_Int hypre_CheckDirExists(const char *path); +HYPRE_Int hypre_CreateDir(const char *path); +HYPRE_Int hypre_CreateNextDirOfSequence(const char *basepath, const char *prefix, + char **fullpath_ptr); +char* hypre_ConvertIndicesToString(HYPRE_Int size, HYPRE_Int *indices); HYPRE_Int hypre_SetSyncCudaCompute(HYPRE_Int action); -HYPRE_Int hypre_RestoreSyncCudaCompute(); +HYPRE_Int hypre_RestoreSyncCudaCompute(void); HYPRE_Int hypre_GetSyncCudaCompute(HYPRE_Int *cuda_compute_stream_sync_ptr); -HYPRE_Int hypre_SyncCudaComputeStream(hypre_Handle *hypre_handle); /* handle.c */ -HYPRE_Int hypre_SetSpGemmUseCusparse( HYPRE_Int use_cusparse ); +HYPRE_Int hypre_SetLogLevel( HYPRE_Int log_level ); +HYPRE_Int hypre_SetSpTransUseVendor( HYPRE_Int use_vendor ); +HYPRE_Int hypre_SetSpMVUseVendor( HYPRE_Int use_vendor ); +HYPRE_Int hypre_SetSpGemmUseVendor( HYPRE_Int use_vendor ); HYPRE_Int hypre_SetSpGemmAlgorithm( HYPRE_Int value ); +HYPRE_Int hypre_SetSpGemmBinned( HYPRE_Int value ); HYPRE_Int hypre_SetSpGemmRownnzEstimateMethod( HYPRE_Int value ); HYPRE_Int hypre_SetSpGemmRownnzEstimateNSamples( HYPRE_Int value ); HYPRE_Int hypre_SetSpGemmRownnzEstimateMultFactor( HYPRE_Real value ); @@ -1715,18 +2457,81 @@ HYPRE_Int hypre_SetUseGpuRand( HYPRE_Int use_gpurand ); HYPRE_Int hypre_SetGaussSeidelMethod( HYPRE_Int gs_method ); HYPRE_Int hypre_SetUserDeviceMalloc(GPUMallocFunc func); HYPRE_Int hypre_SetUserDeviceMfree(GPUMfreeFunc func); +HYPRE_Int hypre_SetGpuAwareMPI( HYPRE_Int use_gpu_aware_mpi ); +HYPRE_Int hypre_GetGpuAwareMPI(void); /* int_array.c */ hypre_IntArray* hypre_IntArrayCreate( HYPRE_Int size ); HYPRE_Int hypre_IntArrayDestroy( hypre_IntArray *array ); -HYPRE_Int hypre_IntArrayInitialize_v2( hypre_IntArray *array, HYPRE_MemoryLocation memory_location ); +HYPRE_Int hypre_IntArrayInitialize_v2( hypre_IntArray *array, + HYPRE_MemoryLocation memory_location ); HYPRE_Int hypre_IntArrayInitialize( hypre_IntArray *array ); HYPRE_Int hypre_IntArrayCopy( hypre_IntArray *x, hypre_IntArray *y ); -hypre_IntArray* hypre_IntArrayCloneDeep_v2( hypre_IntArray *x, HYPRE_MemoryLocation memory_location ); +hypre_IntArray* hypre_IntArrayCloneDeep_v2( hypre_IntArray *x, + HYPRE_MemoryLocation memory_location ); hypre_IntArray* hypre_IntArrayCloneDeep( hypre_IntArray *x ); +HYPRE_Int hypre_IntArrayMigrate( hypre_IntArray *v, HYPRE_MemoryLocation memory_location ); +HYPRE_Int hypre_IntArrayPrint( MPI_Comm comm, hypre_IntArray *array, const char *filename ); +HYPRE_Int hypre_IntArrayRead( MPI_Comm comm, const char *filename, hypre_IntArray **array_ptr ); +HYPRE_Int hypre_IntArraySetConstantValuesHost( hypre_IntArray *v, HYPRE_Int value ); HYPRE_Int hypre_IntArraySetConstantValues( hypre_IntArray *v, HYPRE_Int value ); +HYPRE_Int hypre_IntArraySetInterleavedValues( hypre_IntArray *v, HYPRE_Int cycle ); +HYPRE_Int hypre_IntArrayCountHost( hypre_IntArray *v, HYPRE_Int value, + HYPRE_Int *num_values_ptr ); +HYPRE_Int hypre_IntArrayCount( hypre_IntArray *v, HYPRE_Int value, + HYPRE_Int *num_values_ptr ); +HYPRE_Int hypre_IntArrayInverseMapping( hypre_IntArray *v, hypre_IntArray **w_ptr ); +HYPRE_Int hypre_IntArrayNegate( hypre_IntArray *v ); +HYPRE_Int hypre_IntArraySeparateByValue( HYPRE_Int num_values, HYPRE_Int *values, + HYPRE_Int *sizes, hypre_IntArray *v, + hypre_IntArrayArray **w_ptr ); +hypre_IntArrayArray* hypre_IntArrayArrayCreate( HYPRE_Int num_entries, HYPRE_Int *sizes ); +HYPRE_Int hypre_IntArrayArrayDestroy( hypre_IntArrayArray *w ); +HYPRE_Int hypre_IntArrayArrayInitializeIn( hypre_IntArrayArray *w, + HYPRE_MemoryLocation memory_location ); +HYPRE_Int hypre_IntArrayArrayInitialize( hypre_IntArrayArray *w ); +HYPRE_Int hypre_IntArrayArrayMigrate( hypre_IntArrayArray *w, + HYPRE_MemoryLocation memory_location ); + +/* int_array_device.c */ +#if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) +HYPRE_Int hypre_IntArraySetConstantValuesDevice( hypre_IntArray *v, HYPRE_Int value ); +HYPRE_Int hypre_IntArrayCountDevice ( hypre_IntArray *v, HYPRE_Int value, + HYPRE_Int *num_values_ptr ); +HYPRE_Int hypre_IntArrayInverseMappingDevice( hypre_IntArray *v, hypre_IntArray *w ); +HYPRE_Int hypre_IntArrayNegateDevice( hypre_IntArray *v ); +HYPRE_Int hypre_IntArraySetInterleavedValuesDevice( hypre_IntArray *v, HYPRE_Int cycle ); +HYPRE_Int hypre_IntArraySeparateByValueDevice( HYPRE_Int num_values, HYPRE_Int *values, + HYPRE_Int *sizes, hypre_IntArray *v, + hypre_IntArrayArray *w ); +#endif + +/* memory_tracker.c */ +#ifdef HYPRE_USING_MEMORY_TRACKER +hypre_MemoryTracker* hypre_memory_tracker(void); +hypre_MemoryTracker * hypre_MemoryTrackerCreate(void); +void hypre_MemoryTrackerDestroy(hypre_MemoryTracker *tracker); +void hypre_MemoryTrackerInsert1(const char *action, void *ptr, size_t nbytes, + hypre_MemoryLocation memory_location, const char *filename, + const char *function, HYPRE_Int line); +void hypre_MemoryTrackerInsert2(const char *action, void *ptr, void *ptr2, size_t nbytes, + hypre_MemoryLocation memory_location, + hypre_MemoryLocation memory_location2, + const char *filename, + const char *function, HYPRE_Int line); +HYPRE_Int hypre_PrintMemoryTracker( size_t *totl_bytes_o, size_t *peak_bytes_o, + size_t *curr_bytes_o, HYPRE_Int do_print, const char *fname ); +HYPRE_Int hypre_MemoryTrackerSetPrint(HYPRE_Int do_print); +HYPRE_Int hypre_MemoryTrackerSetFileName(const char *file_name); +#endif + +/* magma.c */ +#if defined(HYPRE_USING_MAGMA) +HYPRE_Int hypre_MagmaInitialize(void); +HYPRE_Int hypre_MagmaFinalize(void); +#endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -1774,13 +2579,13 @@ HYPRE_Int hypre_IntArraySetConstantValues( hypre_IntArray *v, HYPRE_Int value ); #include #include #include -#include +//#include #ifdef HYPRE_USING_OPENMP #include #endif -#include "_hypre_utilities.h" +//#include "_hypre_utilities.h" // Potentially architecture specific features used here: // __sync_val_compare_and_swap @@ -1797,36 +2602,36 @@ extern "C" { ******************************************************************************/ #ifdef HYPRE_USING_ATOMIC -static inline HYPRE_Int +static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_Int hypre_compare_and_swap( HYPRE_Int *ptr, HYPRE_Int oldval, HYPRE_Int newval ) { #if defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__) && (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) > 40100 - return __sync_val_compare_and_swap(ptr, oldval, newval); -//#elif defind _MSC_VER - //return _InterlockedCompareExchange((long *)ptr, newval, oldval); -//#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L && !defined(__STDC_NO_ATOMICS__) -// JSP: not many compilers have implemented this, so comment out for now - //_Atomic HYPRE_Int *atomic_ptr = ptr; - //atomic_compare_exchange_strong(atomic_ptr, &oldval, newval); - //return oldval; + return __sync_val_compare_and_swap(ptr, oldval, newval); + //#elif defind _MSC_VER + //return _InterlockedCompareExchange((long *)ptr, newval, oldval); + //#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L && !defined(__STDC_NO_ATOMICS__) + // JSP: not many compilers have implemented this, so comment out for now + //_Atomic HYPRE_Int *atomic_ptr = ptr; + //atomic_compare_exchange_strong(atomic_ptr, &oldval, newval); + //return oldval; #endif } -static inline HYPRE_Int +static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_Int hypre_fetch_and_add( HYPRE_Int *ptr, HYPRE_Int value ) { #if defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__) && (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) > 40100 - return __sync_fetch_and_add(ptr, value); -//#elif defined _MSC_VER - //return _InterlockedExchangeAdd((long *)ptr, value); -//#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L && !defined(__STDC_NO_ATOMICS__) -// JSP: not many compilers have implemented this, so comment out for now - //_Atomic HYPRE_Int *atomic_ptr = ptr; - //return atomic_fetch_add(atomic_ptr, value); + return __sync_fetch_and_add(ptr, value); + //#elif defined _MSC_VER + //return _InterlockedExchangeAdd((long *)ptr, value); + //#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L && !defined(__STDC_NO_ATOMICS__) + // JSP: not many compilers have implemented this, so comment out for now + //_Atomic HYPRE_Int *atomic_ptr = ptr; + //return atomic_fetch_add(atomic_ptr, value); #endif } #else // !HYPRE_USING_ATOMIC -static inline HYPRE_Int +static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_Int hypre_compare_and_swap( HYPRE_Int *ptr, HYPRE_Int oldval, HYPRE_Int newval ) { if (*ptr == oldval) @@ -1834,10 +2639,10 @@ hypre_compare_and_swap( HYPRE_Int *ptr, HYPRE_Int oldval, HYPRE_Int newval ) *ptr = newval; return oldval; } - else return *ptr; + else { return *ptr; } } -static inline HYPRE_Int +static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_Int hypre_fetch_and_add( HYPRE_Int *ptr, HYPRE_Int value ) { HYPRE_Int oldval = *ptr; @@ -1856,7 +2661,7 @@ hypre_fetch_and_add( HYPRE_Int *ptr, HYPRE_Int value ) #define HYPRE_HOPSCOTCH_HASH_BUSY (1) // Small Utilities .......................................................... -static inline HYPRE_Int +static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_Int first_lsb_bit_indx( hypre_uint x ) { HYPRE_Int pos; @@ -1933,181 +2738,189 @@ first_lsb_bit_indx( hypre_uint x ) #define HYPRE_XXH_rotl64(x,r) ((x << r) | (x >> (64 - r))) #if defined(HYPRE_MIXEDINT) || defined(HYPRE_BIGINT) -static inline HYPRE_BigInt +static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_BigInt hypre_BigHash( HYPRE_BigInt input ) { - hypre_ulongint h64 = HYPRE_XXH_PRIME64_5 + sizeof(input); + hypre_ulonglongint h64 = HYPRE_XXH_PRIME64_5 + sizeof(input); - hypre_ulongint k1 = input; - k1 *= HYPRE_XXH_PRIME64_2; - k1 = HYPRE_XXH_rotl64(k1, 31); - k1 *= HYPRE_XXH_PRIME64_1; - h64 ^= k1; - h64 = HYPRE_XXH_rotl64(h64, 27)*HYPRE_XXH_PRIME64_1 + HYPRE_XXH_PRIME64_4; + hypre_ulonglongint k1 = input; + k1 *= HYPRE_XXH_PRIME64_2; + k1 = HYPRE_XXH_rotl64(k1, 31); + k1 *= HYPRE_XXH_PRIME64_1; + h64 ^= k1; + h64 = HYPRE_XXH_rotl64(h64, 27) * HYPRE_XXH_PRIME64_1 + HYPRE_XXH_PRIME64_4; - h64 ^= h64 >> 33; - h64 *= HYPRE_XXH_PRIME64_2; - h64 ^= h64 >> 29; - h64 *= HYPRE_XXH_PRIME64_3; - h64 ^= h64 >> 32; + h64 ^= h64 >> 33; + h64 *= HYPRE_XXH_PRIME64_2; + h64 ^= h64 >> 29; + h64 *= HYPRE_XXH_PRIME64_3; + h64 ^= h64 >> 32; #ifndef NDEBUG - if (HYPRE_HOPSCOTCH_HASH_EMPTY == h64) { + if (HYPRE_HOPSCOTCH_HASH_EMPTY == h64) + { hypre_printf("hash(%lld) = %d\n", h64, HYPRE_HOPSCOTCH_HASH_EMPTY); hypre_assert(HYPRE_HOPSCOTCH_HASH_EMPTY != h64); - } + } #endif - return h64; + return h64; } #else -static inline HYPRE_Int +static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_Int hypre_BigHash(HYPRE_Int input) { - hypre_uint h32 = HYPRE_XXH_PRIME32_5 + sizeof(input); + hypre_uint h32 = HYPRE_XXH_PRIME32_5 + sizeof(input); - // 1665863975 is added to input so that - // only -1073741824 gives HYPRE_HOPSCOTCH_HASH_EMPTY. - // Hence, we're fine as long as key is non-negative. - h32 += (input + 1665863975)*HYPRE_XXH_PRIME32_3; - h32 = HYPRE_XXH_rotl32(h32, 17)*HYPRE_XXH_PRIME32_4; + // 1665863975 is added to input so that + // only -1073741824 gives HYPRE_HOPSCOTCH_HASH_EMPTY. + // Hence, we're fine as long as key is non-negative. + h32 += (input + 1665863975) * HYPRE_XXH_PRIME32_3; + h32 = HYPRE_XXH_rotl32(h32, 17) * HYPRE_XXH_PRIME32_4; - h32 ^= h32 >> 15; - h32 *= HYPRE_XXH_PRIME32_2; - h32 ^= h32 >> 13; - h32 *= HYPRE_XXH_PRIME32_3; - h32 ^= h32 >> 16; + h32 ^= h32 >> 15; + h32 *= HYPRE_XXH_PRIME32_2; + h32 ^= h32 >> 13; + h32 *= HYPRE_XXH_PRIME32_3; + h32 ^= h32 >> 16; - //hypre_assert(HYPRE_HOPSCOTCH_HASH_EMPTY != h32); + //hypre_assert(HYPRE_HOPSCOTCH_HASH_EMPTY != h32); - return h32; + return h32; } #endif #ifdef HYPRE_BIGINT -static inline HYPRE_Int +static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_Int hypre_Hash(HYPRE_Int input) { - hypre_ulongint h64 = HYPRE_XXH_PRIME64_5 + sizeof(input); + hypre_ulonglongint h64 = HYPRE_XXH_PRIME64_5 + sizeof(input); - hypre_ulongint k1 = input; - k1 *= HYPRE_XXH_PRIME64_2; - k1 = HYPRE_XXH_rotl64(k1, 31); - k1 *= HYPRE_XXH_PRIME64_1; - h64 ^= k1; - h64 = HYPRE_XXH_rotl64(h64, 27)*HYPRE_XXH_PRIME64_1 + HYPRE_XXH_PRIME64_4; + hypre_ulonglongint k1 = input; + k1 *= HYPRE_XXH_PRIME64_2; + k1 = HYPRE_XXH_rotl64(k1, 31); + k1 *= HYPRE_XXH_PRIME64_1; + h64 ^= k1; + h64 = HYPRE_XXH_rotl64(h64, 27) * HYPRE_XXH_PRIME64_1 + HYPRE_XXH_PRIME64_4; - h64 ^= h64 >> 33; - h64 *= HYPRE_XXH_PRIME64_2; - h64 ^= h64 >> 29; - h64 *= HYPRE_XXH_PRIME64_3; - h64 ^= h64 >> 32; + h64 ^= h64 >> 33; + h64 *= HYPRE_XXH_PRIME64_2; + h64 ^= h64 >> 29; + h64 *= HYPRE_XXH_PRIME64_3; + h64 ^= h64 >> 32; #ifndef NDEBUG - if (HYPRE_HOPSCOTCH_HASH_EMPTY == h64) { + if (HYPRE_HOPSCOTCH_HASH_EMPTY == h64) + { hypre_printf("hash(%lld) = %d\n", h64, HYPRE_HOPSCOTCH_HASH_EMPTY); hypre_assert(HYPRE_HOPSCOTCH_HASH_EMPTY != h64); - } + } #endif - return h64; + return h64; } #else -static inline HYPRE_Int +static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_Int hypre_Hash(HYPRE_Int input) { - hypre_uint h32 = HYPRE_XXH_PRIME32_5 + sizeof(input); + hypre_uint h32 = HYPRE_XXH_PRIME32_5 + sizeof(input); - // 1665863975 is added to input so that - // only -1073741824 gives HYPRE_HOPSCOTCH_HASH_EMPTY. - // Hence, we're fine as long as key is non-negative. - h32 += (input + 1665863975)*HYPRE_XXH_PRIME32_3; - h32 = HYPRE_XXH_rotl32(h32, 17)*HYPRE_XXH_PRIME32_4; + // 1665863975 is added to input so that + // only -1073741824 gives HYPRE_HOPSCOTCH_HASH_EMPTY. + // Hence, we're fine as long as key is non-negative. + h32 += (input + 1665863975) * HYPRE_XXH_PRIME32_3; + h32 = HYPRE_XXH_rotl32(h32, 17) * HYPRE_XXH_PRIME32_4; - h32 ^= h32 >> 15; - h32 *= HYPRE_XXH_PRIME32_2; - h32 ^= h32 >> 13; - h32 *= HYPRE_XXH_PRIME32_3; - h32 ^= h32 >> 16; + h32 ^= h32 >> 15; + h32 *= HYPRE_XXH_PRIME32_2; + h32 ^= h32 >> 13; + h32 *= HYPRE_XXH_PRIME32_3; + h32 ^= h32 >> 16; - //hypre_assert(HYPRE_HOPSCOTCH_HASH_EMPTY != h32); + //hypre_assert(HYPRE_HOPSCOTCH_HASH_EMPTY != h32); - return h32; + return h32; } #endif -static inline void - hypre_UnorderedIntSetFindCloserFreeBucket( hypre_UnorderedIntSet *s, +static inline HYPRE_MAYBE_UNUSED_FUNC void +hypre_UnorderedIntSetFindCloserFreeBucket( hypre_UnorderedIntSet *s, #ifdef HYPRE_CONCURRENT_HOPSCOTCH - hypre_HopscotchSegment *start_seg, + hypre_HopscotchSegment *start_seg, #endif - HYPRE_Int *free_bucket, - HYPRE_Int *free_dist ) + HYPRE_Int *free_bucket, + HYPRE_Int *free_dist ) { - HYPRE_Int move_bucket = *free_bucket - (HYPRE_HOPSCOTCH_HASH_HOP_RANGE - 1); - HYPRE_Int move_free_dist; - for (move_free_dist = HYPRE_HOPSCOTCH_HASH_HOP_RANGE - 1; move_free_dist > 0; --move_free_dist) - { - hypre_uint start_hop_info = s->hopInfo[move_bucket]; - HYPRE_Int move_new_free_dist = -1; - hypre_uint mask = 1; - HYPRE_Int i; - for (i = 0; i < move_free_dist; ++i, mask <<= 1) - { - if (mask & start_hop_info) + HYPRE_Int move_bucket = *free_bucket - (HYPRE_HOPSCOTCH_HASH_HOP_RANGE - 1); + HYPRE_Int move_free_dist; + for (move_free_dist = HYPRE_HOPSCOTCH_HASH_HOP_RANGE - 1; move_free_dist > 0; --move_free_dist) + { + hypre_uint start_hop_info = s->hopInfo[move_bucket]; + HYPRE_Int move_new_free_dist = -1; + hypre_uint mask = 1; + HYPRE_Int i; + for (i = 0; i < move_free_dist; ++i, mask <<= 1) { - move_new_free_dist = i; - break; + if (mask & start_hop_info) + { + move_new_free_dist = i; + break; + } } - } - if (-1 != move_new_free_dist) - { + if (-1 != move_new_free_dist) + { #ifdef HYPRE_CONCURRENT_HOPSCOTCH - hypre_HopscotchSegment* move_segment = &(s->segments[move_bucket & s->segmentMask]); + hypre_HopscotchSegment* move_segment = &(s->segments[move_bucket & s->segmentMask]); - if(start_seg != move_segment) - omp_set_lock(&move_segment->lock); + if (start_seg != move_segment) + { + omp_set_lock(&move_segment->lock); + } #endif - if (start_hop_info == s->hopInfo[move_bucket]) - { - // new_free_bucket -> free_bucket and empty new_free_bucket - HYPRE_Int new_free_bucket = move_bucket + move_new_free_dist; - s->key[*free_bucket] = s->key[new_free_bucket]; - s->hash[*free_bucket] = s->hash[new_free_bucket]; + if (start_hop_info == s->hopInfo[move_bucket]) + { + // new_free_bucket -> free_bucket and empty new_free_bucket + HYPRE_Int new_free_bucket = move_bucket + move_new_free_dist; + s->key[*free_bucket] = s->key[new_free_bucket]; + s->hash[*free_bucket] = s->hash[new_free_bucket]; #ifdef HYPRE_CONCURRENT_HOPSCOTCH - ++move_segment->timestamp; -#pragma omp flush + ++move_segment->timestamp; + #pragma omp flush #endif - s->hopInfo[move_bucket] |= (1U << move_free_dist); - s->hopInfo[move_bucket] &= ~(1U << move_new_free_dist); + s->hopInfo[move_bucket] |= (1U << move_free_dist); + s->hopInfo[move_bucket] &= ~(1U << move_new_free_dist); - *free_bucket = new_free_bucket; - *free_dist -= move_free_dist - move_new_free_dist; + *free_bucket = new_free_bucket; + *free_dist -= move_free_dist - move_new_free_dist; #ifdef HYPRE_CONCURRENT_HOPSCOTCH - if(start_seg != move_segment) - omp_unset_lock(&move_segment->lock); + if (start_seg != move_segment) + { + omp_unset_lock(&move_segment->lock); + } #endif - return; - } + return; + } #ifdef HYPRE_CONCURRENT_HOPSCOTCH - if(start_seg != move_segment) - omp_unset_lock(&move_segment->lock); -#endif - } - ++move_bucket; - } - *free_bucket = -1; - *free_dist = 0; + if (start_seg != move_segment) + { + omp_unset_lock(&move_segment->lock); + } +#endif + } + ++move_bucket; + } + *free_bucket = -1; + *free_dist = 0; } -static inline void +static inline HYPRE_MAYBE_UNUSED_FUNC void hypre_UnorderedBigIntSetFindCloserFreeBucket( hypre_UnorderedBigIntSet *s, #ifdef HYPRE_CONCURRENT_HOPSCOTCH hypre_HopscotchSegment *start_seg, @@ -2115,68 +2928,74 @@ hypre_UnorderedBigIntSetFindCloserFreeBucket( hypre_UnorderedBigIntSet *s, HYPRE_Int *free_bucket, HYPRE_Int *free_dist ) { - HYPRE_Int move_bucket = *free_bucket - (HYPRE_HOPSCOTCH_HASH_HOP_RANGE - 1); - HYPRE_Int move_free_dist; - for (move_free_dist = HYPRE_HOPSCOTCH_HASH_HOP_RANGE - 1; move_free_dist > 0; --move_free_dist) - { - hypre_uint start_hop_info = s->hopInfo[move_bucket]; - HYPRE_Int move_new_free_dist = -1; - hypre_uint mask = 1; - HYPRE_Int i; - for (i = 0; i < move_free_dist; ++i, mask <<= 1) - { - if (mask & start_hop_info) + HYPRE_Int move_bucket = *free_bucket - (HYPRE_HOPSCOTCH_HASH_HOP_RANGE - 1); + HYPRE_Int move_free_dist; + for (move_free_dist = HYPRE_HOPSCOTCH_HASH_HOP_RANGE - 1; move_free_dist > 0; --move_free_dist) + { + hypre_uint start_hop_info = s->hopInfo[move_bucket]; + HYPRE_Int move_new_free_dist = -1; + hypre_uint mask = 1; + HYPRE_Int i; + for (i = 0; i < move_free_dist; ++i, mask <<= 1) { - move_new_free_dist = i; - break; + if (mask & start_hop_info) + { + move_new_free_dist = i; + break; + } } - } - if (-1 != move_new_free_dist) - { + if (-1 != move_new_free_dist) + { #ifdef HYPRE_CONCURRENT_HOPSCOTCH - hypre_HopscotchSegment* move_segment = &(s->segments[move_bucket & s->segmentMask]); + hypre_HopscotchSegment* move_segment = &(s->segments[move_bucket & s->segmentMask]); - if(start_seg != move_segment) - omp_set_lock(&move_segment->lock); + if (start_seg != move_segment) + { + omp_set_lock(&move_segment->lock); + } #endif - if (start_hop_info == s->hopInfo[move_bucket]) - { - // new_free_bucket -> free_bucket and empty new_free_bucket - HYPRE_Int new_free_bucket = move_bucket + move_new_free_dist; - s->key[*free_bucket] = s->key[new_free_bucket]; - s->hash[*free_bucket] = s->hash[new_free_bucket]; + if (start_hop_info == s->hopInfo[move_bucket]) + { + // new_free_bucket -> free_bucket and empty new_free_bucket + HYPRE_Int new_free_bucket = move_bucket + move_new_free_dist; + s->key[*free_bucket] = s->key[new_free_bucket]; + s->hash[*free_bucket] = s->hash[new_free_bucket]; #ifdef HYPRE_CONCURRENT_HOPSCOTCH - ++move_segment->timestamp; -#pragma omp flush + ++move_segment->timestamp; + #pragma omp flush #endif - s->hopInfo[move_bucket] |= (1U << move_free_dist); - s->hopInfo[move_bucket] &= ~(1U << move_new_free_dist); + s->hopInfo[move_bucket] |= (1U << move_free_dist); + s->hopInfo[move_bucket] &= ~(1U << move_new_free_dist); - *free_bucket = new_free_bucket; - *free_dist -= move_free_dist - move_new_free_dist; + *free_bucket = new_free_bucket; + *free_dist -= move_free_dist - move_new_free_dist; #ifdef HYPRE_CONCURRENT_HOPSCOTCH - if(start_seg != move_segment) - omp_unset_lock(&move_segment->lock); + if (start_seg != move_segment) + { + omp_unset_lock(&move_segment->lock); + } #endif - return; - } + return; + } #ifdef HYPRE_CONCURRENT_HOPSCOTCH - if(start_seg != move_segment) - omp_unset_lock(&move_segment->lock); -#endif - } - ++move_bucket; - } - *free_bucket = -1; - *free_dist = 0; + if (start_seg != move_segment) + { + omp_unset_lock(&move_segment->lock); + } +#endif + } + ++move_bucket; + } + *free_bucket = -1; + *free_dist = 0; } -static inline void +static inline HYPRE_MAYBE_UNUSED_FUNC void hypre_UnorderedIntMapFindCloserFreeBucket( hypre_UnorderedIntMap *m, #ifdef HYPRE_CONCURRENT_HOPSCOTCH hypre_HopscotchSegment *start_seg, @@ -2184,69 +3003,77 @@ hypre_UnorderedIntMapFindCloserFreeBucket( hypre_UnorderedIntMap *m, hypre_HopscotchBucket **free_bucket, HYPRE_Int *free_dist) { - hypre_HopscotchBucket* move_bucket = *free_bucket - (HYPRE_HOPSCOTCH_HASH_HOP_RANGE - 1); - HYPRE_Int move_free_dist; - for (move_free_dist = HYPRE_HOPSCOTCH_HASH_HOP_RANGE - 1; move_free_dist > 0; --move_free_dist) - { - hypre_uint start_hop_info = move_bucket->hopInfo; - HYPRE_Int move_new_free_dist = -1; - hypre_uint mask = 1; - HYPRE_Int i; - for (i = 0; i < move_free_dist; ++i, mask <<= 1) - { - if (mask & start_hop_info) + HYPRE_UNUSED_VAR(m); + + hypre_HopscotchBucket* move_bucket = *free_bucket - (HYPRE_HOPSCOTCH_HASH_HOP_RANGE - 1); + HYPRE_Int move_free_dist; + for (move_free_dist = HYPRE_HOPSCOTCH_HASH_HOP_RANGE - 1; move_free_dist > 0; --move_free_dist) + { + hypre_uint start_hop_info = move_bucket->hopInfo; + HYPRE_Int move_new_free_dist = -1; + hypre_uint mask = 1; + HYPRE_Int i; + for (i = 0; i < move_free_dist; ++i, mask <<= 1) { - move_new_free_dist = i; - break; + if (mask & start_hop_info) + { + move_new_free_dist = i; + break; + } } - } - if (-1 != move_new_free_dist) - { + if (-1 != move_new_free_dist) + { #ifdef HYPRE_CONCURRENT_HOPSCOTCH - hypre_HopscotchSegment* move_segment = &(m->segments[(move_bucket - m->table) & m->segmentMask]); + hypre_HopscotchSegment* move_segment = &(m->segments[(move_bucket - m->table) & m->segmentMask]); - if (start_seg != move_segment) - omp_set_lock(&move_segment->lock); + if (start_seg != move_segment) + { + omp_set_lock(&move_segment->lock); + } #endif - if (start_hop_info == move_bucket->hopInfo) - { - // new_free_bucket -> free_bucket and empty new_free_bucket - hypre_HopscotchBucket* new_free_bucket = move_bucket + move_new_free_dist; - (*free_bucket)->data = new_free_bucket->data; - (*free_bucket)->key = new_free_bucket->key; - (*free_bucket)->hash = new_free_bucket->hash; + if (start_hop_info == move_bucket->hopInfo) + { + // new_free_bucket -> free_bucket and empty new_free_bucket + hypre_HopscotchBucket* new_free_bucket = move_bucket + move_new_free_dist; + (*free_bucket)->data = new_free_bucket->data; + (*free_bucket)->key = new_free_bucket->key; + (*free_bucket)->hash = new_free_bucket->hash; #ifdef HYPRE_CONCURRENT_HOPSCOTCH - ++move_segment->timestamp; + ++move_segment->timestamp; -#pragma omp flush + #pragma omp flush #endif - move_bucket->hopInfo |= (1U << move_free_dist); - move_bucket->hopInfo &= ~(1U << move_new_free_dist); + move_bucket->hopInfo = move_bucket->hopInfo | (1U << move_free_dist); + move_bucket->hopInfo = move_bucket->hopInfo & ~(1U << move_new_free_dist); - *free_bucket = new_free_bucket; - *free_dist -= move_free_dist - move_new_free_dist; + *free_bucket = new_free_bucket; + *free_dist -= move_free_dist - move_new_free_dist; #ifdef HYPRE_CONCURRENT_HOPSCOTCH - if(start_seg != move_segment) - omp_unset_lock(&move_segment->lock); + if (start_seg != move_segment) + { + omp_unset_lock(&move_segment->lock); + } #endif - return; - } + return; + } #ifdef HYPRE_CONCURRENT_HOPSCOTCH - if(start_seg != move_segment) - omp_unset_lock(&move_segment->lock); -#endif - } - ++move_bucket; - } - *free_bucket = NULL; - *free_dist = 0; + if (start_seg != move_segment) + { + omp_unset_lock(&move_segment->lock); + } +#endif + } + ++move_bucket; + } + *free_bucket = NULL; + *free_dist = 0; } -static inline void +static inline HYPRE_MAYBE_UNUSED_FUNC void hypre_UnorderedBigIntMapFindCloserFreeBucket( hypre_UnorderedBigIntMap *m, #ifdef HYPRE_CONCURRENT_HOPSCOTCH hypre_HopscotchSegment *start_seg, @@ -2254,80 +3081,88 @@ hypre_UnorderedBigIntMapFindCloserFreeBucket( hypre_UnorderedBigIntMap *m, hypre_BigHopscotchBucket **free_bucket, HYPRE_Int *free_dist) { - hypre_BigHopscotchBucket* move_bucket = *free_bucket - (HYPRE_HOPSCOTCH_HASH_HOP_RANGE - 1); - HYPRE_Int move_free_dist; - for (move_free_dist = HYPRE_HOPSCOTCH_HASH_HOP_RANGE - 1; move_free_dist > 0; --move_free_dist) - { - hypre_uint start_hop_info = move_bucket->hopInfo; - HYPRE_Int move_new_free_dist = -1; - hypre_uint mask = 1; - HYPRE_Int i; - for (i = 0; i < move_free_dist; ++i, mask <<= 1) - { - if (mask & start_hop_info) + HYPRE_UNUSED_VAR(m); + + hypre_BigHopscotchBucket* move_bucket = *free_bucket - (HYPRE_HOPSCOTCH_HASH_HOP_RANGE - 1); + HYPRE_Int move_free_dist; + for (move_free_dist = HYPRE_HOPSCOTCH_HASH_HOP_RANGE - 1; move_free_dist > 0; --move_free_dist) + { + hypre_uint start_hop_info = move_bucket->hopInfo; + HYPRE_Int move_new_free_dist = -1; + hypre_uint mask = 1; + HYPRE_Int i; + for (i = 0; i < move_free_dist; ++i, mask <<= 1) { - move_new_free_dist = i; - break; + if (mask & start_hop_info) + { + move_new_free_dist = i; + break; + } } - } - if (-1 != move_new_free_dist) - { + if (-1 != move_new_free_dist) + { #ifdef HYPRE_CONCURRENT_HOPSCOTCH - hypre_HopscotchSegment* move_segment = &(m->segments[(move_bucket - m->table) & m->segmentMask]); + hypre_HopscotchSegment* move_segment = &(m->segments[(move_bucket - m->table) & m->segmentMask]); - if (start_seg != move_segment) - omp_set_lock(&move_segment->lock); + if (start_seg != move_segment) + { + omp_set_lock(&move_segment->lock); + } #endif - if (start_hop_info == move_bucket->hopInfo) - { - // new_free_bucket -> free_bucket and empty new_free_bucket - hypre_BigHopscotchBucket* new_free_bucket = move_bucket + move_new_free_dist; - (*free_bucket)->data = new_free_bucket->data; - (*free_bucket)->key = new_free_bucket->key; - (*free_bucket)->hash = new_free_bucket->hash; + if (start_hop_info == move_bucket->hopInfo) + { + // new_free_bucket -> free_bucket and empty new_free_bucket + hypre_BigHopscotchBucket* new_free_bucket = move_bucket + move_new_free_dist; + (*free_bucket)->data = new_free_bucket->data; + (*free_bucket)->key = new_free_bucket->key; + (*free_bucket)->hash = new_free_bucket->hash; #ifdef HYPRE_CONCURRENT_HOPSCOTCH - ++move_segment->timestamp; + ++move_segment->timestamp; -#pragma omp flush + #pragma omp flush #endif - move_bucket->hopInfo |= (1U << move_free_dist); - move_bucket->hopInfo &= ~(1U << move_new_free_dist); + move_bucket->hopInfo = move_bucket->hopInfo | (1U << move_free_dist); + move_bucket->hopInfo = move_bucket->hopInfo & ~(1U << move_new_free_dist); - *free_bucket = new_free_bucket; - *free_dist -= move_free_dist - move_new_free_dist; + *free_bucket = new_free_bucket; + *free_dist -= move_free_dist - move_new_free_dist; #ifdef HYPRE_CONCURRENT_HOPSCOTCH - if(start_seg != move_segment) - omp_unset_lock(&move_segment->lock); + if (start_seg != move_segment) + { + omp_unset_lock(&move_segment->lock); + } #endif - return; - } + return; + } #ifdef HYPRE_CONCURRENT_HOPSCOTCH - if(start_seg != move_segment) - omp_unset_lock(&move_segment->lock); -#endif - } - ++move_bucket; - } - *free_bucket = NULL; - *free_dist = 0; + if (start_seg != move_segment) + { + omp_unset_lock(&move_segment->lock); + } +#endif + } + ++move_bucket; + } + *free_bucket = NULL; + *free_dist = 0; } void hypre_UnorderedIntSetCreate( hypre_UnorderedIntSet *s, HYPRE_Int inCapacity, HYPRE_Int concurrencyLevel); void hypre_UnorderedBigIntSetCreate( hypre_UnorderedBigIntSet *s, - HYPRE_Int inCapacity, - HYPRE_Int concurrencyLevel); + HYPRE_Int inCapacity, + HYPRE_Int concurrencyLevel); void hypre_UnorderedIntMapCreate( hypre_UnorderedIntMap *m, HYPRE_Int inCapacity, HYPRE_Int concurrencyLevel); void hypre_UnorderedBigIntMapCreate( hypre_UnorderedBigIntMap *m, - HYPRE_Int inCapacity, - HYPRE_Int concurrencyLevel); + HYPRE_Int inCapacity, + HYPRE_Int concurrencyLevel); void hypre_UnorderedIntSetDestroy( hypre_UnorderedIntSet *s ); void hypre_UnorderedBigIntSetDestroy( hypre_UnorderedBigIntSet *s ); @@ -2335,606 +3170,658 @@ void hypre_UnorderedIntMapDestroy( hypre_UnorderedIntMap *m ); void hypre_UnorderedBigIntMapDestroy( hypre_UnorderedBigIntMap *m ); // Query Operations ......................................................... -static inline HYPRE_Int +static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_Int hypre_UnorderedIntSetContains( hypre_UnorderedIntSet *s, HYPRE_Int key ) { - //CALCULATE HASH .......................... + //CALCULATE HASH .......................... #ifdef HYPRE_BIGINT - HYPRE_Int hash = hypre_BigHash(key); + HYPRE_Int hash = hypre_BigHash(key); #else - HYPRE_Int hash = hypre_Hash(key); + HYPRE_Int hash = hypre_Hash(key); #endif - //CHECK IF ALREADY CONTAIN ................ + //CHECK IF ALREADY CONTAIN ................ #ifdef HYPRE_CONCURRENT_HOPSCOTCH - hypre_HopscotchSegment *segment = &s->segments[hash & s->segmentMask]; + hypre_HopscotchSegment *segment = &s->segments[hash & s->segmentMask]; #endif - HYPRE_Int bucket = hash & s->bucketMask; - hypre_uint hopInfo = s->hopInfo[bucket]; + HYPRE_Int bucket = hash & s->bucketMask; + hypre_uint hopInfo = s->hopInfo[bucket]; - if (0 == hopInfo) - return 0; - else if (1 == hopInfo ) - { - if (hash == s->hash[bucket] && key == s->key[bucket]) - return 1; - else return 0; - } + if (0 == hopInfo) + { + return 0; + } + else if (1 == hopInfo ) + { + if (hash == s->hash[bucket] && key == s->key[bucket]) + { + return 1; + } + else { return 0; } + } #ifdef HYPRE_CONCURRENT_HOPSCOTCH - HYPRE_Int startTimestamp = segment->timestamp; + HYPRE_Int startTimestamp = segment->timestamp; #endif - while (0 != hopInfo) - { - HYPRE_Int i = first_lsb_bit_indx(hopInfo); - HYPRE_Int currElm = bucket + i; + while (0 != hopInfo) + { + HYPRE_Int i = first_lsb_bit_indx(hopInfo); + HYPRE_Int currElm = bucket + i; - if (hash == s->hash[currElm] && key == s->key[currElm]) - return 1; - hopInfo &= ~(1U << i); - } + if (hash == s->hash[currElm] && key == s->key[currElm]) + { + return 1; + } + hopInfo &= ~(1U << i); + } #ifdef HYPRE_CONCURRENT_HOPSCOTCH - if (segment->timestamp == startTimestamp) - return 0; + if (segment->timestamp == startTimestamp) + { + return 0; + } #endif - HYPRE_Int i; - for (i = 0; i< HYPRE_HOPSCOTCH_HASH_HOP_RANGE; ++i) - { - if (hash == s->hash[bucket + i] && key == s->key[bucket + i]) - return 1; - } - return 0; + HYPRE_Int i; + for (i = 0; i < HYPRE_HOPSCOTCH_HASH_HOP_RANGE; ++i) + { + if (hash == s->hash[bucket + i] && key == s->key[bucket + i]) + { + return 1; + } + } + return 0; } -static inline HYPRE_Int +static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_Int hypre_UnorderedBigIntSetContains( hypre_UnorderedBigIntSet *s, HYPRE_BigInt key ) { - //CALCULATE HASH .......................... + //CALCULATE HASH .......................... #if defined(HYPRE_BIGINT) || defined(HYPRE_MIXEDINT) - HYPRE_BigInt hash = hypre_BigHash(key); + HYPRE_BigInt hash = hypre_BigHash(key); #else - HYPRE_BigInt hash = hypre_Hash(key); + HYPRE_BigInt hash = hypre_Hash(key); #endif - //CHECK IF ALREADY CONTAIN ................ + //CHECK IF ALREADY CONTAIN ................ #ifdef HYPRE_CONCURRENT_HOPSCOTCH - hypre_HopscotchSegment *segment = &s->segments[(HYPRE_Int)(hash & s->segmentMask)]; + hypre_HopscotchSegment *segment = &s->segments[(HYPRE_Int)(hash & s->segmentMask)]; #endif - HYPRE_Int bucket = (HYPRE_Int)(hash & s->bucketMask); - hypre_uint hopInfo = s->hopInfo[bucket]; + HYPRE_Int bucket = (HYPRE_Int)(hash & s->bucketMask); + hypre_uint hopInfo = s->hopInfo[bucket]; - if (0 == hopInfo) - return 0; - else if (1 == hopInfo ) - { - if (hash == s->hash[bucket] && key == s->key[bucket]) - return 1; - else return 0; - } + if (0 == hopInfo) + { + return 0; + } + else if (1 == hopInfo ) + { + if (hash == s->hash[bucket] && key == s->key[bucket]) + { + return 1; + } + else { return 0; } + } #ifdef HYPRE_CONCURRENT_HOPSCOTCH - HYPRE_Int startTimestamp = segment->timestamp; + HYPRE_Int startTimestamp = segment->timestamp; #endif - while (0 != hopInfo) - { - HYPRE_Int i = first_lsb_bit_indx(hopInfo); - HYPRE_Int currElm = bucket + i; + while (0 != hopInfo) + { + HYPRE_Int i = first_lsb_bit_indx(hopInfo); + HYPRE_Int currElm = bucket + i; - if (hash == s->hash[currElm] && key == s->key[currElm]) - return 1; - hopInfo &= ~(1U << i); - } + if (hash == s->hash[currElm] && key == s->key[currElm]) + { + return 1; + } + hopInfo &= ~(1U << i); + } #ifdef HYPRE_CONCURRENT_HOPSCOTCH - if (segment->timestamp == startTimestamp) - return 0; + if (segment->timestamp == startTimestamp) + { + return 0; + } #endif - HYPRE_Int i; - for (i = 0; i< HYPRE_HOPSCOTCH_HASH_HOP_RANGE; ++i) - { - if (hash == s->hash[bucket + i] && key == s->key[bucket + i]) - return 1; - } - return 0; + HYPRE_Int i; + for (i = 0; i < HYPRE_HOPSCOTCH_HASH_HOP_RANGE; ++i) + { + if (hash == s->hash[bucket + i] && key == s->key[bucket + i]) + { + return 1; + } + } + return 0; } /** * @ret -1 if key doesn't exist */ -static inline HYPRE_Int +static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_Int hypre_UnorderedIntMapGet( hypre_UnorderedIntMap *m, HYPRE_Int key ) { - //CALCULATE HASH .......................... + //CALCULATE HASH .......................... #ifdef HYPRE_BIGINT - HYPRE_Int hash = hypre_BigHash(key); + HYPRE_Int hash = hypre_BigHash(key); #else - HYPRE_Int hash = hypre_Hash(key); + HYPRE_Int hash = hypre_Hash(key); #endif - //CHECK IF ALREADY CONTAIN ................ + //CHECK IF ALREADY CONTAIN ................ #ifdef HYPRE_CONCURRENT_HOPSCOTCH - hypre_HopscotchSegment *segment = &m->segments[hash & m->segmentMask]; -#endif - hypre_HopscotchBucket *elmAry = &(m->table[hash & m->bucketMask]); - hypre_uint hopInfo = elmAry->hopInfo; - if (0 == hopInfo) - return -1; - else if (1 == hopInfo ) - { - if (hash == elmAry->hash && key == elmAry->key) - return elmAry->data; - else return -1; - } + hypre_HopscotchSegment *segment = &m->segments[hash & m->segmentMask]; +#endif + hypre_HopscotchBucket *elmAry = &(m->table[hash & m->bucketMask]); + hypre_uint hopInfo = elmAry->hopInfo; + if (0 == hopInfo) + { + return -1; + } + else if (1 == hopInfo ) + { + if (hash == elmAry->hash && key == elmAry->key) + { + return elmAry->data; + } + else { return -1; } + } #ifdef HYPRE_CONCURRENT_HOPSCOTCH - HYPRE_Int startTimestamp = segment->timestamp; + HYPRE_Int startTimestamp = segment->timestamp; #endif - while (0 != hopInfo) - { - HYPRE_Int i = first_lsb_bit_indx(hopInfo); - hypre_HopscotchBucket* currElm = elmAry + i; - if (hash == currElm->hash && key == currElm->key) - return currElm->data; - hopInfo &= ~(1U << i); - } + while (0 != hopInfo) + { + HYPRE_Int i = first_lsb_bit_indx(hopInfo); + hypre_HopscotchBucket* currElm = elmAry + i; + if (hash == currElm->hash && key == currElm->key) + { + return currElm->data; + } + hopInfo &= ~(1U << i); + } #ifdef HYPRE_CONCURRENT_HOPSCOTCH - if (segment->timestamp == startTimestamp) - return -1; -#endif - - hypre_HopscotchBucket *currBucket = &(m->table[hash & m->bucketMask]); - HYPRE_Int i; - for (i = 0; i< HYPRE_HOPSCOTCH_HASH_HOP_RANGE; ++i, ++currBucket) - { - if (hash == currBucket->hash && key == currBucket->key) - return currBucket->data; - } - return -1; + if (segment->timestamp == startTimestamp) + { + return -1; + } +#endif + + hypre_HopscotchBucket *currBucket = &(m->table[hash & m->bucketMask]); + HYPRE_Int i; + for (i = 0; i < HYPRE_HOPSCOTCH_HASH_HOP_RANGE; ++i, ++currBucket) + { + if (hash == currBucket->hash && key == currBucket->key) + { + return currBucket->data; + } + } + return -1; } -static inline +static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_Int hypre_UnorderedBigIntMapGet( hypre_UnorderedBigIntMap *m, HYPRE_BigInt key ) { - //CALCULATE HASH .......................... + //CALCULATE HASH .......................... #if defined(HYPRE_BIGINT) || defined(HYPRE_MIXEDINT) - HYPRE_BigInt hash = hypre_BigHash(key); + HYPRE_BigInt hash = hypre_BigHash(key); #else - HYPRE_BigInt hash = hypre_Hash(key); + HYPRE_BigInt hash = hypre_Hash(key); #endif - //CHECK IF ALREADY CONTAIN ................ + //CHECK IF ALREADY CONTAIN ................ #ifdef HYPRE_CONCURRENT_HOPSCOTCH - hypre_HopscotchSegment *segment = &m->segments[(HYPRE_Int)(hash & m->segmentMask)]; -#endif - hypre_BigHopscotchBucket *elmAry = &(m->table[(HYPRE_Int)(hash & m->bucketMask)]); - hypre_uint hopInfo = elmAry->hopInfo; - if (0 == hopInfo) - return -1; - else if (1 == hopInfo ) - { - if (hash == elmAry->hash && key == elmAry->key) - return elmAry->data; - else return -1; - } + hypre_HopscotchSegment *segment = &m->segments[(HYPRE_Int)(hash & m->segmentMask)]; +#endif + hypre_BigHopscotchBucket *elmAry = &(m->table[(HYPRE_Int)(hash & m->bucketMask)]); + hypre_uint hopInfo = elmAry->hopInfo; + if (0 == hopInfo) + { + return -1; + } + else if (1 == hopInfo ) + { + if (hash == elmAry->hash && key == elmAry->key) + { + return elmAry->data; + } + else { return -1; } + } #ifdef HYPRE_CONCURRENT_HOPSCOTCH - HYPRE_Int startTimestamp = segment->timestamp; + HYPRE_Int startTimestamp = segment->timestamp; #endif - while (0 != hopInfo) - { - HYPRE_Int i = first_lsb_bit_indx(hopInfo); - hypre_BigHopscotchBucket* currElm = elmAry + i; - if (hash == currElm->hash && key == currElm->key) - return currElm->data; - hopInfo &= ~(1U << i); - } + while (0 != hopInfo) + { + HYPRE_Int i = first_lsb_bit_indx(hopInfo); + hypre_BigHopscotchBucket* currElm = elmAry + i; + if (hash == currElm->hash && key == currElm->key) + { + return currElm->data; + } + hopInfo &= ~(1U << i); + } #ifdef HYPRE_CONCURRENT_HOPSCOTCH - if (segment->timestamp == startTimestamp) - return -1; -#endif - - hypre_BigHopscotchBucket *currBucket = &(m->table[hash & m->bucketMask]); - HYPRE_Int i; - for (i = 0; i< HYPRE_HOPSCOTCH_HASH_HOP_RANGE; ++i, ++currBucket) - { - if (hash == currBucket->hash && key == currBucket->key) - return currBucket->data; - } - return -1; + if (segment->timestamp == startTimestamp) + { + return -1; + } +#endif + + hypre_BigHopscotchBucket *currBucket = &(m->table[hash & m->bucketMask]); + HYPRE_Int i; + for (i = 0; i < HYPRE_HOPSCOTCH_HASH_HOP_RANGE; ++i, ++currBucket) + { + if (hash == currBucket->hash && key == currBucket->key) + { + return currBucket->data; + } + } + return -1; } //status Operations ......................................................... -static inline +static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_Int hypre_UnorderedIntSetSize( hypre_UnorderedIntSet *s ) { - HYPRE_Int counter = 0; - HYPRE_Int n = s->bucketMask + HYPRE_HOPSCOTCH_HASH_INSERT_RANGE; - HYPRE_Int i; - for (i = 0; i < n; ++i) - { - if (HYPRE_HOPSCOTCH_HASH_EMPTY != s->hash[i]) - { - ++counter; - } - } - return counter; + HYPRE_Int counter = 0; + HYPRE_Int n = s->bucketMask + HYPRE_HOPSCOTCH_HASH_INSERT_RANGE; + HYPRE_Int i; + for (i = 0; i < n; ++i) + { + if (HYPRE_HOPSCOTCH_HASH_EMPTY != s->hash[i]) + { + ++counter; + } + } + return counter; } -static inline +static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_Int hypre_UnorderedBigIntSetSize( hypre_UnorderedBigIntSet *s ) { - HYPRE_Int counter = 0; - HYPRE_BigInt n = s->bucketMask + HYPRE_HOPSCOTCH_HASH_INSERT_RANGE; - HYPRE_Int i; - for (i = 0; i < n; ++i) - { - if (HYPRE_HOPSCOTCH_HASH_EMPTY != s->hash[i]) - { - ++counter; - } - } - return counter; + HYPRE_Int counter = 0; + HYPRE_BigInt n = s->bucketMask + HYPRE_HOPSCOTCH_HASH_INSERT_RANGE; + HYPRE_Int i; + for (i = 0; i < n; ++i) + { + if (HYPRE_HOPSCOTCH_HASH_EMPTY != s->hash[i]) + { + ++counter; + } + } + return counter; } -static inline HYPRE_Int +static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_Int hypre_UnorderedIntMapSize( hypre_UnorderedIntMap *m ) { - HYPRE_Int counter = 0; - HYPRE_Int n = m->bucketMask + HYPRE_HOPSCOTCH_HASH_INSERT_RANGE; - HYPRE_Int i; - for (i = 0; i < n; ++i) - { - if( HYPRE_HOPSCOTCH_HASH_EMPTY != m->table[i].hash ) - { - ++counter; - } - } - return counter; + HYPRE_Int counter = 0; + HYPRE_Int n = m->bucketMask + HYPRE_HOPSCOTCH_HASH_INSERT_RANGE; + HYPRE_Int i; + for (i = 0; i < n; ++i) + { + if ( HYPRE_HOPSCOTCH_HASH_EMPTY != m->table[i].hash ) + { + ++counter; + } + } + return counter; } -static inline HYPRE_Int +static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_Int hypre_UnorderedBigIntMapSize( hypre_UnorderedBigIntMap *m ) { - HYPRE_Int counter = 0; - HYPRE_Int n = m->bucketMask + HYPRE_HOPSCOTCH_HASH_INSERT_RANGE; - HYPRE_Int i; - for (i = 0; i < n; ++i) - { - if( HYPRE_HOPSCOTCH_HASH_EMPTY != m->table[i].hash ) - { - ++counter; - } - } - return counter; + HYPRE_Int counter = 0; + HYPRE_Int n = m->bucketMask + HYPRE_HOPSCOTCH_HASH_INSERT_RANGE; + HYPRE_Int i; + for (i = 0; i < n; ++i) + { + if ( HYPRE_HOPSCOTCH_HASH_EMPTY != m->table[i].hash ) + { + ++counter; + } + } + return counter; } HYPRE_Int *hypre_UnorderedIntSetCopyToArray( hypre_UnorderedIntSet *s, HYPRE_Int *len ); HYPRE_BigInt *hypre_UnorderedBigIntSetCopyToArray( hypre_UnorderedBigIntSet *s, HYPRE_Int *len ); //modification Operations ................................................... -static inline void +static inline HYPRE_MAYBE_UNUSED_FUNC void hypre_UnorderedIntSetPut( hypre_UnorderedIntSet *s, HYPRE_Int key ) { - //CALCULATE HASH .......................... + //CALCULATE HASH .......................... #ifdef HYPRE_BIGINT - HYPRE_Int hash = hypre_BigHash(key); + HYPRE_Int hash = hypre_BigHash(key); #else - HYPRE_Int hash = hypre_Hash(key); + HYPRE_Int hash = hypre_Hash(key); #endif - //LOCK KEY HASH ENTERY .................... + //LOCK KEY HASH ENTERY .................... #ifdef HYPRE_CONCURRENT_HOPSCOTCH - hypre_HopscotchSegment *segment = &s->segments[hash & s->segmentMask]; - omp_set_lock(&segment->lock); + hypre_HopscotchSegment *segment = &s->segments[hash & s->segmentMask]; + omp_set_lock(&segment->lock); #endif - HYPRE_Int bucket = hash&s->bucketMask; + HYPRE_Int bucket = hash & s->bucketMask; - //CHECK IF ALREADY CONTAIN ................ - hypre_uint hopInfo = s->hopInfo[bucket]; - while (0 != hopInfo) - { - HYPRE_Int i = first_lsb_bit_indx(hopInfo); - HYPRE_Int currElm = bucket + i; + //CHECK IF ALREADY CONTAIN ................ + hypre_uint hopInfo = s->hopInfo[bucket]; + while (0 != hopInfo) + { + HYPRE_Int i = first_lsb_bit_indx(hopInfo); + HYPRE_Int currElm = bucket + i; - if(hash == s->hash[currElm] && key == s->key[currElm]) - { + if (hash == s->hash[currElm] && key == s->key[currElm]) + { #ifdef HYPRE_CONCURRENT_HOPSCOTCH - omp_unset_lock(&segment->lock); -#endif - return; - } - hopInfo &= ~(1U << i); - } - - //LOOK FOR FREE BUCKET .................... - HYPRE_Int free_bucket = bucket; - HYPRE_Int free_dist = 0; - for ( ; free_dist < HYPRE_HOPSCOTCH_HASH_INSERT_RANGE; ++free_dist, ++free_bucket) - { - if( (HYPRE_HOPSCOTCH_HASH_EMPTY == s->hash[free_bucket]) && - (HYPRE_HOPSCOTCH_HASH_EMPTY == - hypre_compare_and_swap((HYPRE_Int *)&s->hash[free_bucket], - (HYPRE_Int)HYPRE_HOPSCOTCH_HASH_EMPTY, - (HYPRE_Int)HYPRE_HOPSCOTCH_HASH_BUSY)) ) - break; - } - - //PLACE THE NEW KEY ....................... - if (free_dist < HYPRE_HOPSCOTCH_HASH_INSERT_RANGE) - { - do - { - if (free_dist < HYPRE_HOPSCOTCH_HASH_HOP_RANGE) + omp_unset_lock(&segment->lock); +#endif + return; + } + hopInfo &= ~(1U << i); + } + + //LOOK FOR FREE BUCKET .................... + HYPRE_Int free_bucket = bucket; + HYPRE_Int free_dist = 0; + for ( ; free_dist < HYPRE_HOPSCOTCH_HASH_INSERT_RANGE; ++free_dist, ++free_bucket) + { + if ( (HYPRE_HOPSCOTCH_HASH_EMPTY == s->hash[free_bucket]) && + (HYPRE_HOPSCOTCH_HASH_EMPTY == + hypre_compare_and_swap((HYPRE_Int *)&s->hash[free_bucket], + (HYPRE_Int)HYPRE_HOPSCOTCH_HASH_EMPTY, + (HYPRE_Int)HYPRE_HOPSCOTCH_HASH_BUSY)) ) + { + break; + } + } + + //PLACE THE NEW KEY ....................... + if (free_dist < HYPRE_HOPSCOTCH_HASH_INSERT_RANGE) + { + do { - s->key[free_bucket] = key; - s->hash[free_bucket] = hash; - s->hopInfo[bucket] |= 1U << free_dist; + if (free_dist < HYPRE_HOPSCOTCH_HASH_HOP_RANGE) + { + s->key[free_bucket] = key; + s->hash[free_bucket] = hash; + s->hopInfo[bucket] |= 1U << free_dist; #ifdef HYPRE_CONCURRENT_HOPSCOTCH - omp_unset_lock(&segment->lock); + omp_unset_lock(&segment->lock); #endif - return; - } - hypre_UnorderedIntSetFindCloserFreeBucket(s, + return; + } + hypre_UnorderedIntSetFindCloserFreeBucket(s, #ifdef HYPRE_CONCURRENT_HOPSCOTCH - segment, + segment, #endif - &free_bucket, &free_dist); - } while (-1 != free_bucket); - } + &free_bucket, &free_dist); + } + while (-1 != free_bucket); + } - //NEED TO RESIZE .......................... - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"ERROR - RESIZE is not implemented\n"); - /*fprintf(stderr, "ERROR - RESIZE is not implemented\n");*/ - exit(1); - return; + //NEED TO RESIZE .......................... + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ERROR - RESIZE is not implemented\n"); + /*fprintf(stderr, "ERROR - RESIZE is not implemented\n");*/ + exit(1); + return; } -static inline void +static inline HYPRE_MAYBE_UNUSED_FUNC void hypre_UnorderedBigIntSetPut( hypre_UnorderedBigIntSet *s, HYPRE_BigInt key ) { - //CALCULATE HASH .......................... + //CALCULATE HASH .......................... #if defined(HYPRE_BIGINT) || defined(HYPRE_MIXEDINT) - HYPRE_BigInt hash = hypre_BigHash(key); + HYPRE_BigInt hash = hypre_BigHash(key); #else - HYPRE_BigInt hash = hypre_Hash(key); + HYPRE_BigInt hash = hypre_Hash(key); #endif - //LOCK KEY HASH ENTERY .................... + //LOCK KEY HASH ENTERY .................... #ifdef HYPRE_CONCURRENT_HOPSCOTCH - hypre_HopscotchSegment *segment = &s->segments[hash & s->segmentMask]; - omp_set_lock(&segment->lock); + hypre_HopscotchSegment *segment = &s->segments[hash & s->segmentMask]; + omp_set_lock(&segment->lock); #endif - HYPRE_Int bucket = (HYPRE_Int)(hash&s->bucketMask); + HYPRE_Int bucket = (HYPRE_Int)(hash & s->bucketMask); - //CHECK IF ALREADY CONTAIN ................ - hypre_uint hopInfo = s->hopInfo[bucket]; - while (0 != hopInfo) - { - HYPRE_Int i = first_lsb_bit_indx(hopInfo); - HYPRE_Int currElm = bucket + i; + //CHECK IF ALREADY CONTAIN ................ + hypre_uint hopInfo = s->hopInfo[bucket]; + while (0 != hopInfo) + { + HYPRE_Int i = first_lsb_bit_indx(hopInfo); + HYPRE_Int currElm = bucket + i; - if(hash == s->hash[currElm] && key == s->key[currElm]) - { + if (hash == s->hash[currElm] && key == s->key[currElm]) + { #ifdef HYPRE_CONCURRENT_HOPSCOTCH - omp_unset_lock(&segment->lock); -#endif - return; - } - hopInfo &= ~(1U << i); - } - - //LOOK FOR FREE BUCKET .................... - HYPRE_Int free_bucket = bucket; - HYPRE_Int free_dist = 0; - for ( ; free_dist < HYPRE_HOPSCOTCH_HASH_INSERT_RANGE; ++free_dist, ++free_bucket) - { - if( (HYPRE_HOPSCOTCH_HASH_EMPTY == s->hash[free_bucket]) && - (HYPRE_HOPSCOTCH_HASH_EMPTY == - hypre_compare_and_swap((HYPRE_Int *)&s->hash[free_bucket], - (HYPRE_Int)HYPRE_HOPSCOTCH_HASH_EMPTY, - (HYPRE_Int)HYPRE_HOPSCOTCH_HASH_BUSY)) ) - break; - } - - //PLACE THE NEW KEY ....................... - if (free_dist < HYPRE_HOPSCOTCH_HASH_INSERT_RANGE) - { - do - { - if (free_dist < HYPRE_HOPSCOTCH_HASH_HOP_RANGE) + omp_unset_lock(&segment->lock); +#endif + return; + } + hopInfo &= ~(1U << i); + } + + //LOOK FOR FREE BUCKET .................... + HYPRE_Int free_bucket = bucket; + HYPRE_Int free_dist = 0; + for ( ; free_dist < HYPRE_HOPSCOTCH_HASH_INSERT_RANGE; ++free_dist, ++free_bucket) + { + if ( (HYPRE_HOPSCOTCH_HASH_EMPTY == s->hash[free_bucket]) && + (HYPRE_HOPSCOTCH_HASH_EMPTY == + hypre_compare_and_swap((HYPRE_Int *)&s->hash[free_bucket], + (HYPRE_Int)HYPRE_HOPSCOTCH_HASH_EMPTY, + (HYPRE_Int)HYPRE_HOPSCOTCH_HASH_BUSY)) ) + { + break; + } + } + + //PLACE THE NEW KEY ....................... + if (free_dist < HYPRE_HOPSCOTCH_HASH_INSERT_RANGE) + { + do { - s->key[free_bucket] = key; - s->hash[free_bucket] = hash; - s->hopInfo[bucket] |= 1U << free_dist; + if (free_dist < HYPRE_HOPSCOTCH_HASH_HOP_RANGE) + { + s->key[free_bucket] = key; + s->hash[free_bucket] = hash; + s->hopInfo[bucket] |= 1U << free_dist; #ifdef HYPRE_CONCURRENT_HOPSCOTCH - omp_unset_lock(&segment->lock); + omp_unset_lock(&segment->lock); #endif - return; - } - hypre_UnorderedBigIntSetFindCloserFreeBucket(s, + return; + } + hypre_UnorderedBigIntSetFindCloserFreeBucket(s, #ifdef HYPRE_CONCURRENT_HOPSCOTCH - segment, + segment, #endif - &free_bucket, &free_dist); - } while (-1 != free_bucket); - } - - //NEED TO RESIZE .......................... - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"ERROR - RESIZE is not implemented\n"); - /*fprintf(stderr, "ERROR - RESIZE is not implemented\n");*/ - exit(1); - return; + &free_bucket, &free_dist); + } + while (-1 != free_bucket); + } + + //NEED TO RESIZE .......................... + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ERROR - RESIZE is not implemented\n"); + /*fprintf(stderr, "ERROR - RESIZE is not implemented\n");*/ + exit(1); + return; } -static inline HYPRE_Int +static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_Int hypre_UnorderedIntMapPutIfAbsent( hypre_UnorderedIntMap *m, HYPRE_Int key, HYPRE_Int data ) { - //CALCULATE HASH .......................... + //CALCULATE HASH .......................... #ifdef HYPRE_BIGINT - HYPRE_Int hash = hypre_BigHash(key); + HYPRE_Int hash = hypre_BigHash(key); #else - HYPRE_Int hash = hypre_Hash(key); + HYPRE_Int hash = hypre_Hash(key); #endif - //LOCK KEY HASH ENTERY .................... + //LOCK KEY HASH ENTERY .................... #ifdef HYPRE_CONCURRENT_HOPSCOTCH - hypre_HopscotchSegment *segment = &m->segments[hash & m->segmentMask]; - omp_set_lock(&segment->lock); -#endif - hypre_HopscotchBucket* startBucket = &(m->table[hash & m->bucketMask]); - - //CHECK IF ALREADY CONTAIN ................ - hypre_uint hopInfo = startBucket->hopInfo; - while (0 != hopInfo) - { - HYPRE_Int i = first_lsb_bit_indx(hopInfo); - hypre_HopscotchBucket* currElm = startBucket + i; - if (hash == currElm->hash && key == currElm->key) - { - HYPRE_Int rc = currElm->data; + hypre_HopscotchSegment *segment = &m->segments[hash & m->segmentMask]; + omp_set_lock(&segment->lock); +#endif + hypre_HopscotchBucket* startBucket = &(m->table[hash & m->bucketMask]); + + //CHECK IF ALREADY CONTAIN ................ + hypre_uint hopInfo = startBucket->hopInfo; + while (0 != hopInfo) + { + HYPRE_Int i = first_lsb_bit_indx(hopInfo); + hypre_HopscotchBucket* currElm = startBucket + i; + if (hash == currElm->hash && key == currElm->key) + { + HYPRE_Int rc = currElm->data; #ifdef HYPRE_CONCURRENT_HOPSCOTCH - omp_unset_lock(&segment->lock); -#endif - return rc; - } - hopInfo &= ~(1U << i); - } - - //LOOK FOR FREE BUCKET .................... - hypre_HopscotchBucket* free_bucket = startBucket; - HYPRE_Int free_dist = 0; - for ( ; free_dist < HYPRE_HOPSCOTCH_HASH_INSERT_RANGE; ++free_dist, ++free_bucket) - { - if( (HYPRE_HOPSCOTCH_HASH_EMPTY == free_bucket->hash) && - (HYPRE_HOPSCOTCH_HASH_EMPTY == + omp_unset_lock(&segment->lock); +#endif + return rc; + } + hopInfo &= ~(1U << i); + } + + //LOOK FOR FREE BUCKET .................... + hypre_HopscotchBucket* free_bucket = startBucket; + HYPRE_Int free_dist = 0; + for ( ; free_dist < HYPRE_HOPSCOTCH_HASH_INSERT_RANGE; ++free_dist, ++free_bucket) + { + if ( (HYPRE_HOPSCOTCH_HASH_EMPTY == free_bucket->hash) && + (HYPRE_HOPSCOTCH_HASH_EMPTY == hypre_compare_and_swap((HYPRE_Int *)&free_bucket->hash, (HYPRE_Int)HYPRE_HOPSCOTCH_HASH_EMPTY, (HYPRE_Int)HYPRE_HOPSCOTCH_HASH_BUSY)) ) - break; - } - - //PLACE THE NEW KEY ....................... - if (free_dist < HYPRE_HOPSCOTCH_HASH_INSERT_RANGE) - { - do - { - if (free_dist < HYPRE_HOPSCOTCH_HASH_HOP_RANGE) { - free_bucket->data = data; - free_bucket->key = key; - free_bucket->hash = hash; - startBucket->hopInfo |= 1U << free_dist; + break; + } + } + + //PLACE THE NEW KEY ....................... + if (free_dist < HYPRE_HOPSCOTCH_HASH_INSERT_RANGE) + { + do + { + if (free_dist < HYPRE_HOPSCOTCH_HASH_HOP_RANGE) + { + free_bucket->data = data; + free_bucket->key = key; + free_bucket->hash = hash; + startBucket->hopInfo = startBucket->hopInfo | (1U << free_dist); #ifdef HYPRE_CONCURRENT_HOPSCOTCH - omp_unset_lock(&segment->lock); + omp_unset_lock(&segment->lock); #endif - return HYPRE_HOPSCOTCH_HASH_EMPTY; - } - hypre_UnorderedIntMapFindCloserFreeBucket(m, + return HYPRE_HOPSCOTCH_HASH_EMPTY; + } + hypre_UnorderedIntMapFindCloserFreeBucket(m, #ifdef HYPRE_CONCURRENT_HOPSCOTCH - segment, + segment, #endif - &free_bucket, &free_dist); - } while (NULL != free_bucket); - } + &free_bucket, &free_dist); + } + while (NULL != free_bucket); + } - //NEED TO RESIZE .......................... - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"ERROR - RESIZE is not implemented\n"); - /*fprintf(stderr, "ERROR - RESIZE is not implemented\n");*/ - exit(1); - return HYPRE_HOPSCOTCH_HASH_EMPTY; + //NEED TO RESIZE .......................... + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ERROR - RESIZE is not implemented\n"); + /*fprintf(stderr, "ERROR - RESIZE is not implemented\n");*/ + exit(1); + return HYPRE_HOPSCOTCH_HASH_EMPTY; } -static inline HYPRE_Int +static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_Int hypre_UnorderedBigIntMapPutIfAbsent( hypre_UnorderedBigIntMap *m, HYPRE_BigInt key, HYPRE_Int data) { - //CALCULATE HASH .......................... + //CALCULATE HASH .......................... #if defined(HYPRE_BIGINT) || defined(HYPRE_MIXEDINT) - HYPRE_BigInt hash = hypre_BigHash(key); + HYPRE_BigInt hash = hypre_BigHash(key); #else - HYPRE_BigInt hash = hypre_Hash(key); + HYPRE_BigInt hash = hypre_Hash(key); #endif - //LOCK KEY HASH ENTERY .................... -#ifdef HYPRE_CONCURRENT_HOPSCOTCH - hypre_HopscotchSegment *segment = &m->segments[hash & m->segmentMask]; - omp_set_lock(&segment->lock); -#endif - hypre_BigHopscotchBucket* startBucket = &(m->table[hash & m->bucketMask]); - - //CHECK IF ALREADY CONTAIN ................ - hypre_uint hopInfo = startBucket->hopInfo; - while (0 != hopInfo) - { - HYPRE_Int i = first_lsb_bit_indx(hopInfo); - hypre_BigHopscotchBucket* currElm = startBucket + i; - if (hash == currElm->hash && key == currElm->key) - { - HYPRE_Int rc = currElm->data; + //LOCK KEY HASH ENTERY .................... #ifdef HYPRE_CONCURRENT_HOPSCOTCH - omp_unset_lock(&segment->lock); -#endif - return rc; - } - hopInfo &= ~(1U << i); - } - - //LOOK FOR FREE BUCKET .................... - hypre_BigHopscotchBucket* free_bucket = startBucket; - HYPRE_Int free_dist = 0; - for ( ; free_dist < HYPRE_HOPSCOTCH_HASH_INSERT_RANGE; ++free_dist, ++free_bucket) - { - if( (HYPRE_HOPSCOTCH_HASH_EMPTY == free_bucket->hash) && - (HYPRE_HOPSCOTCH_HASH_EMPTY == - hypre_compare_and_swap((HYPRE_Int *)&free_bucket->hash, - (HYPRE_Int)HYPRE_HOPSCOTCH_HASH_EMPTY, - (HYPRE_Int)HYPRE_HOPSCOTCH_HASH_BUSY)) ) - break; - } - - //PLACE THE NEW KEY ....................... - if (free_dist < HYPRE_HOPSCOTCH_HASH_INSERT_RANGE) - { - do - { - if (free_dist < HYPRE_HOPSCOTCH_HASH_HOP_RANGE) + hypre_HopscotchSegment *segment = &m->segments[hash & m->segmentMask]; + omp_set_lock(&segment->lock); +#endif + hypre_BigHopscotchBucket* startBucket = &(m->table[hash & m->bucketMask]); + + //CHECK IF ALREADY CONTAIN ................ + hypre_uint hopInfo = startBucket->hopInfo; + while (0 != hopInfo) + { + HYPRE_Int i = first_lsb_bit_indx(hopInfo); + hypre_BigHopscotchBucket* currElm = startBucket + i; + if (hash == currElm->hash && key == currElm->key) { - free_bucket->data = data; - free_bucket->key = key; - free_bucket->hash = hash; - startBucket->hopInfo |= 1U << free_dist; + HYPRE_Int rc = currElm->data; #ifdef HYPRE_CONCURRENT_HOPSCOTCH - omp_unset_lock(&segment->lock); + omp_unset_lock(&segment->lock); #endif - return HYPRE_HOPSCOTCH_HASH_EMPTY; + return rc; + } + hopInfo &= ~(1U << i); + } + + //LOOK FOR FREE BUCKET .................... + hypre_BigHopscotchBucket* free_bucket = startBucket; + HYPRE_Int free_dist = 0; + for ( ; free_dist < HYPRE_HOPSCOTCH_HASH_INSERT_RANGE; ++free_dist, ++free_bucket) + { + if ( (HYPRE_HOPSCOTCH_HASH_EMPTY == free_bucket->hash) && + (HYPRE_HOPSCOTCH_HASH_EMPTY == + hypre_compare_and_swap((HYPRE_Int *)&free_bucket->hash, + (HYPRE_Int)HYPRE_HOPSCOTCH_HASH_EMPTY, + (HYPRE_Int)HYPRE_HOPSCOTCH_HASH_BUSY)) ) + { + break; } - hypre_UnorderedBigIntMapFindCloserFreeBucket(m, + } + + //PLACE THE NEW KEY ....................... + if (free_dist < HYPRE_HOPSCOTCH_HASH_INSERT_RANGE) + { + do + { + if (free_dist < HYPRE_HOPSCOTCH_HASH_HOP_RANGE) + { + free_bucket->data = data; + free_bucket->key = key; + free_bucket->hash = hash; + startBucket->hopInfo = startBucket->hopInfo | (1U << free_dist); #ifdef HYPRE_CONCURRENT_HOPSCOTCH - segment, + omp_unset_lock(&segment->lock); #endif - &free_bucket, &free_dist); - } while (NULL != free_bucket); - } - - //NEED TO RESIZE .......................... - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"ERROR - RESIZE is not implemented\n"); - /*fprintf(stderr, "ERROR - RESIZE is not implemented\n");*/ - exit(1); - return HYPRE_HOPSCOTCH_HASH_EMPTY; + return HYPRE_HOPSCOTCH_HASH_EMPTY; + } + hypre_UnorderedBigIntMapFindCloserFreeBucket(m, +#ifdef HYPRE_CONCURRENT_HOPSCOTCH + segment, +#endif + &free_bucket, &free_dist); + } + while (NULL != free_bucket); + } + + //NEED TO RESIZE .......................... + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ERROR - RESIZE is not implemented\n"); + /*fprintf(stderr, "ERROR - RESIZE is not implemented\n");*/ + exit(1); + return HYPRE_HOPSCOTCH_HASH_EMPTY; } #ifdef __cplusplus @@ -2942,6 +3829,126 @@ hypre_UnorderedBigIntMapPutIfAbsent( hypre_UnorderedBigIntMap *m, #endif #endif // hypre_HOPSCOTCH_HASH_HEADER +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +/* +* Matrix Market I/O library for ANSI C +* +* See http://math.nist.gov/MatrixMarket for details. +* +* +*/ + +#ifndef MM_IO_H +#define MM_IO_H + +#define MM_MAX_LINE_LENGTH 1025 +#define MatrixMarketBanner "%%MatrixMarket" +#define MM_MAX_TOKEN_LENGTH 64 + +typedef char MM_typecode[4]; + +HYPRE_Int hypre_mm_is_valid(MM_typecode matcode); /* too complex for a macro */ +HYPRE_Int hypre_mm_read_banner(FILE *f, MM_typecode *matcode); +HYPRE_Int hypre_mm_read_mtx_crd_size(FILE *f, HYPRE_Int *M, HYPRE_Int *N, HYPRE_Int *nz); + +/********************* MM_typecode query fucntions ***************************/ + +#define hypre_mm_is_matrix(typecode) ((typecode)[0]=='M') + +#define hypre_mm_is_sparse(typecode) ((typecode)[1]=='C') +#define hypre_mm_is_coordinate(typecode)((typecode)[1]=='C') +#define hypre_mm_is_dense(typecode) ((typecode)[1]=='A') +#define hypre_mm_is_array(typecode) ((typecode)[1]=='A') + +#define hypre_mm_is_complex(typecode) ((typecode)[2]=='C') +#define hypre_mm_is_real(typecode) ((typecode)[2]=='R') +#define hypre_mm_is_pattern(typecode) ((typecode)[2]=='P') +#define hypre_mm_is_integer(typecode) ((typecode)[2]=='I') + +#define hypre_mm_is_symmetric(typecode)((typecode)[3]=='S') +#define hypre_mm_is_general(typecode) ((typecode)[3]=='G') +#define hypre_mm_is_skew(typecode) ((typecode)[3]=='K') +#define hypre_mm_is_hermitian(typecode)((typecode)[3]=='H') + + + +/********************* MM_typecode modify fucntions ***************************/ + +#define hypre_mm_set_matrix(typecode) ((*typecode)[0]='M') +#define hypre_mm_set_coordinate(typecode) ((*typecode)[1]='C') +#define hypre_mm_set_array(typecode) ((*typecode)[1]='A') +#define hypre_mm_set_dense(typecode) hypre_mm_set_array(typecode) +#define hypre_mm_set_sparse(typecode) hypre_mm_set_coordinate(typecode) + +#define hypre_mm_set_complex(typecode)((*typecode)[2]='C') +#define hypre_mm_set_real(typecode) ((*typecode)[2]='R') +#define hypre_mm_set_pattern(typecode)((*typecode)[2]='P') +#define hypre_mm_set_integer(typecode)((*typecode)[2]='I') + + +#define hypre_mm_set_symmetric(typecode)((*typecode)[3]='S') +#define hypre_mm_set_general(typecode) ((*typecode)[3]='G') +#define hypre_mm_set_skew(typecode) ((*typecode)[3]='K') +#define hypre_mm_set_hermitian(typecode)((*typecode)[3]='H') + +#define hypre_mm_clear_typecode(typecode) ((*typecode)[0]=(*typecode)[1]= \ + (*typecode)[2]=' ',(*typecode)[3]='G') + +#define hypre_mm_initialize_typecode(typecode) hypre_mm_clear_typecode(typecode) + + +/********************* Matrix Market error codes ***************************/ + + +#define MM_COULD_NOT_READ_FILE 11 +#define MM_PREMATURE_EOF 12 +#define MM_NOT_MTX 13 +#define MM_NO_HEADER 14 +#define MM_UNSUPPORTED_TYPE 15 +#define MM_LINE_TOO_LONG 16 +#define MM_COULD_NOT_WRITE_FILE 17 + + +/******************** Matrix Market internal definitions ******************** + + MM_matrix_typecode: 4-character sequence + + object sparse/data storage + dense type scheme + + string position: [0] [1] [2] [3] + + Matrix typecode: M(atrix) C(oord) R(eal) G(eneral) + A(array) C(omplex) H(ermitian) + P(attern) S(ymmetric) + I(nteger) K(kew) + + ***********************************************************************/ + +#define MM_MTX_STR "matrix" +#define MM_ARRAY_STR "array" +#define MM_DENSE_STR "array" +#define MM_COORDINATE_STR "coordinate" +#define MM_SPARSE_STR "coordinate" +#define MM_COMPLEX_STR "complex" +#define MM_REAL_STR "real" +#define MM_INT_STR "integer" +#define MM_GENERAL_STR "general" +#define MM_SYMM_STR "symmetric" +#define MM_HERM_STR "hermitian" +#define MM_SKEW_STR "skew-symmetric" +#define MM_PATTERN_STR "pattern" + + +/* high level routines */ + +#endif #ifdef __cplusplus } diff --git a/external/hypre/src/utilities/_hypre_utilities.hpp b/external/hypre/src/utilities/_hypre_utilities.hpp index 22c302d8..43df71f6 100644 --- a/external/hypre/src/utilities/_hypre_utilities.hpp +++ b/external/hypre/src/utilities/_hypre_utilities.hpp @@ -4,62 +4,247 @@ #ifndef hypre_UTILITIES_HPP #define hypre_UTILITIES_HPP + #ifdef __cplusplus extern "C++" { #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ -#ifndef DEVICE_ALLOCATOR_H -#define DEVICE_ALLOCATOR_H +#ifndef HYPRE_FUNCTORS_H +#define HYPRE_FUNCTORS_H #if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) -/* C++ style memory allocator for GPU **device** memory - * Just wraps _hypre_TAlloc and _hypre_TFree */ -struct hypre_device_allocator { - typedef char value_type; +/*-------------------------------------------------------------------------- + * hypreFunctor_DenseMatrixIdentity + * + * Functor for generating a dense identity matrix. + * This assumes that the input array "a" is zeros everywhere + *--------------------------------------------------------------------------*/ + +struct hypreFunctor_DenseMatrixIdentity +{ + HYPRE_Int n_; + HYPRE_Real *a_; + + hypreFunctor_DenseMatrixIdentity(HYPRE_Int n, HYPRE_Real *a) + { + n_ = n; + a_ = a; + } + + __host__ __device__ void operator()(HYPRE_Int i) + { + a_[i * n_ + i] = 1.0; + } +}; - hypre_device_allocator() { - // constructor - } +/*-------------------------------------------------------------------------- + * hypreFunctor_ArrayStridedAccess + * + * Functor for performing strided data access on a templated array. + * + * The stride interval "s_" is used to access every "s_"-th element + * from the source array "a_". + * + * It is templated to support various data types for the array. + *--------------------------------------------------------------------------*/ - ~hypre_device_allocator() { - // destructor - } +template +struct hypreFunctor_ArrayStridedAccess +{ + HYPRE_Int s_; + T *a_; + + hypreFunctor_ArrayStridedAccess(HYPRE_Int s, T *a) : s_(s), a_(a) {} + + __host__ __device__ T operator()(HYPRE_Int i) + { + return a_[i * s_]; + } +}; + +/*-------------------------------------------------------------------------- + * hypreFunctor_IndexStrided + * + * This functor multiplies a given index "i" by a specified stride "s_". + * + * It is templated to support various data types for the index and stride. + *--------------------------------------------------------------------------*/ + +template +struct hypreFunctor_IndexStrided +{ + T s_; - char *allocate(std::ptrdiff_t num_bytes) { return _hypre_TAlloc(char, num_bytes, hypre_MEMORY_DEVICE); } + hypreFunctor_IndexStrided(T s) : s_(s) {} - void deallocate(char *ptr, size_t n) { _hypre_TFree(ptr, hypre_MEMORY_DEVICE); } + __host__ __device__ T operator()(const T i) const + { + return i * s_; + } +}; + +/*-------------------------------------------------------------------------- + * hypreFunctor_IndexCycle + *--------------------------------------------------------------------------*/ + +struct hypreFunctor_IndexCycle +{ + HYPRE_Int cycle_length; + + hypreFunctor_IndexCycle(HYPRE_Int _cycle_length) : cycle_length(_cycle_length) {} + + __host__ __device__ HYPRE_Int operator()(HYPRE_Int i) const + { + return i % cycle_length; + } +}; + +#endif /* if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) */ +#endif /* ifndef HYPRE_FUNCTORS_H */ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#ifndef HYPRE_PREDICATES_H +#define HYPRE_PREDICATES_H + +/****************************************************************************** + * + * Header file defining predicates for thrust used throughout hypre + * + *****************************************************************************/ + +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + +/*-------------------------------------------------------------------------- + * hyprePred_StridedAccess + * + * This struct defines a predicate for strided access in array-like data. + * + * It is used to determine if an element at a given index should be processed + * or not, based on a specified stride. The operator() returns true when the + * index is a multiple of the stride, indicating the element at that index + * is part of the strided subset. + *--------------------------------------------------------------------------*/ + +struct hyprePred_StridedAccess +{ + HYPRE_Int s_; + + hyprePred_StridedAccess(HYPRE_Int s) : s_(s) {} + + __host__ __device__ HYPRE_Int operator()(const HYPRE_Int i) const + { + return (!(i % s_)); + } +}; + +#endif /* if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) */ +#endif /* ifndef HYPRE_PREDICATES_H */ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#ifndef DEVICE_ALLOCATOR_H +#define DEVICE_ALLOCATOR_H + +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + +/* C++ style memory allocator for the device using the abstract memory model */ +struct hypre_device_allocator +{ + typedef char value_type; + + hypre_device_allocator() + { + // constructor + } + + ~hypre_device_allocator() + { + // destructor + } + + char *allocate(std::ptrdiff_t num_bytes) + { + return hypre_TAlloc(char, num_bytes, HYPRE_MEMORY_DEVICE); + } + + void deallocate(char *ptr, size_t n) + { + HYPRE_UNUSED_VAR(n); + hypre_TFree(ptr, HYPRE_MEMORY_DEVICE); + } }; #endif /* #if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) */ #endif /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ -#ifndef HYPRE_CUDA_UTILS_H -#define HYPRE_CUDA_UTILS_H +#ifndef HYPRE_DEVICE_UTILS_H +#define HYPRE_DEVICE_UTILS_H #if defined(HYPRE_USING_GPU) -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_DEVICE_OPENMP) -#include +/* Data types depending on GPU architecture */ +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_SYCL) +typedef hypre_uint hypre_mask; +#define hypre_mask_one 1U + +#elif defined(HYPRE_USING_HIP) +typedef hypre_ulonglongint hypre_mask; +#define hypre_mask_one 1ULL + +#endif + +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * cuda includes + * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + +#if defined(HYPRE_USING_CUDA) +using hypre_DeviceItem = void*; #include -#include #include +#include + +#if defined(HYPRE_USING_CURAND) #include +#endif + +#if defined(HYPRE_USING_CUBLAS) +#include +#endif + +#if defined(HYPRE_USING_CUSPARSE) +/* Note (VPM) : As of cuSPARSE 12, ILU functionalities have been marked as deprecated. + The following definition avoids compilation warnings regarding the use of ILU routines */ +#define DISABLE_CUSPARSE_DEPRECATED #include +#endif + +#if defined(HYPRE_USING_CUSOLVER) +#include +#endif #ifndef CUDART_VERSION #error CUDART_VERSION Undefined! @@ -76,767 +261,1972 @@ struct hypre_device_allocator { #define CUB_IGNORE_DEPRECATED_CPP_DIALECT #endif +#ifndef CUSPARSE_VERSION +#if defined(CUSPARSE_VER_MAJOR) && defined(CUSPARSE_VER_MINOR) && defined(CUSPARSE_VER_PATCH) +#define CUSPARSE_VERSION (CUSPARSE_VER_MAJOR * 1000 + CUSPARSE_VER_MINOR * 100 + CUSPARSE_VER_PATCH) +#else +#define CUSPARSE_VERSION CUDA_VERSION +#endif +#endif + #define CUSPARSE_NEWAPI_VERSION 11000 +#define CUSPARSE_NEWSPMM_VERSION 11401 +#define CUDA_MALLOCASYNC_VERSION 11020 +#define CUDA_THRUST_NOSYNC_VERSION 12000 + +#define CUSPARSE_SPSV_VERSION 11600 +#if CUSPARSE_VERSION >= CUSPARSE_SPSV_VERSION +#define hypre_cusparseSpSVDescr cusparseSpSVDescr_t +#define hypre_cusparseSpSV_createDescr cusparseSpSV_createDescr +#define hypre_cusparseSpSV_destroyDescr cusparseSpSV_destroyDescr +#else +#define hypre_cusparseSpSVDescr csrsv2Info_t +#define hypre_cusparseSpSV_createDescr cusparseCreateCsrsv2Info +#define hypre_cusparseSpSV_destroyDescr cusparseDestroyCsrsv2Info +#endif -#elif defined(HYPRE_USING_HIP) +#define CUSPARSE_SPSM_VERSION 11600 +#if CUSPARSE_VERSION >= CUSPARSE_SPSM_VERSION +#define hypre_cusparseSpSMDescr cusparseSpSMDescr_t +#define hypre_cusparseSpSM_createDescr cusparseSpSM_createDescr +#define hypre_cusparseSpSM_destroyDescr cusparseSpSM_destroyDescr +#else +#define hypre_cusparseSpSMDescr csrsm2Info_t +#define hypre_cusparseSpSM_createDescr cusparseCreateCsrsm2Info +#define hypre_cusparseSpSM_destroyDescr cusparseDestroyCsrsm2Info +#endif + +#if defined(HYPRE_USING_DEVICE_MALLOC_ASYNC) +#if CUDA_VERSION < CUDA_MALLOCASYNC_VERSION +#error cudaMalloc/FreeAsync needs CUDA 11.2 +#endif +#endif + +#if defined(HYPRE_USING_THRUST_NOSYNC) +#if CUDA_VERSION < CUDA_THRUST_NOSYNC_VERSION +#error thrust::cuda::par_nosync needs CUDA 12 +#endif +#define HYPRE_THRUST_EXECUTION thrust::cuda::par_nosync +#else +#define HYPRE_THRUST_EXECUTION thrust::cuda::par +#endif + +#endif /* defined(HYPRE_USING_CUDA) */ + +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * hip includes + * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ +#if defined(HYPRE_USING_HIP) + +using hypre_DeviceItem = void*; #include -#endif// defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_DEVICE_OPENMP) +#if defined(HYPRE_USING_ROCBLAS) +#include +#endif #if defined(HYPRE_USING_ROCSPARSE) -#include +#include +#if !defined(ROCSPARSE_VERSION) +#define ROCSPARSE_VERSION (ROCSPARSE_VERSION_MAJOR * 100000 + ROCSPARSE_VERSION_MINOR * 100 + ROCSPARSE_VERSION_PATCH) +#endif +#endif + +#if defined(HYPRE_USING_ROCSOLVER) +#include #endif #if defined(HYPRE_USING_ROCRAND) -#include +#include #endif -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_DEVICE_OPENMP) -#define HYPRE_CUDA_CALL(call) \ - do { \ - cudaError_t err = call; \ - if (cudaSuccess != err) { \ - printf("CUDA ERROR (code = %d, %s) at %s:%d\n", err, cudaGetErrorString(err), __FILE__, \ - __LINE__); \ - hypre_assert(0); \ - exit(1); \ - } \ - } while (0) +#endif /* defined(HYPRE_USING_HIP) */ +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * thrust includes + * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + +#include +#if defined(HYPRE_USING_CUDA) +#include #elif defined(HYPRE_USING_HIP) -#define HYPRE_HIP_CALL(call) \ - do { \ - hipError_t err = call; \ - if (hipSuccess != err) { \ - printf("HIP ERROR (code = %d, %s) at %s:%d\n", err, hipGetErrorString(err), __FILE__, __LINE__); \ - hypre_assert(0); \ - exit(1); \ - } \ - } while (0) - -#endif// defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_DEVICE_OPENMP) - -#define HYPRE_CUBLAS_CALL(call) \ - do { \ - cublasStatus_t err = call; \ - if (CUBLAS_STATUS_SUCCESS != err) { \ - printf("CUBLAS ERROR (code = %d, %d) at %s:%d\n", err, err == CUBLAS_STATUS_EXECUTION_FAILED, \ - __FILE__, __LINE__); \ - hypre_assert(0); \ - exit(1); \ - } \ - } while (0) - -#define HYPRE_CUSPARSE_CALL(call) \ - do { \ - cusparseStatus_t err = call; \ - if (CUSPARSE_STATUS_SUCCESS != err) { \ - printf("CUSPARSE ERROR (code = %d, %s) at %s:%d\n", err, cusparseGetErrorString(err), __FILE__, \ - __LINE__); \ - hypre_assert(0); \ - exit(1); \ - } \ - } while (0) - -#define HYPRE_ROCSPARSE_CALL(call) \ - do { \ - rocsparse_status err = call; \ - if (rocsparse_status_success != err) { \ - printf("rocSPARSE ERROR (code = %d) at %s:%d\n", err, __FILE__, __LINE__); \ - assert(0); \ - exit(1); \ - } \ - } while (0) - -#define HYPRE_CURAND_CALL(call) \ - do { \ - curandStatus_t err = call; \ - if (CURAND_STATUS_SUCCESS != err) { \ - printf("CURAND ERROR (code = %d) at %s:%d\n", err, __FILE__, __LINE__); \ - hypre_assert(0); \ - exit(1); \ - } \ - } while (0) - -#define HYPRE_ROCRAND_CALL(call) \ - do { \ - rocrand_status err = call; \ - if (ROCRAND_STATUS_SUCCESS != err) { \ - printf("ROCRAND ERROR (code = %d) at %s:%d\n", err, __FILE__, __LINE__); \ - hypre_assert(0); \ - exit(1); \ - } \ - } while (0) +#include +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -struct hypre_cub_CachingDeviceAllocator; -typedef struct hypre_cub_CachingDeviceAllocator hypre_cub_CachingDeviceAllocator; +/* VPM: this is needed to support cuda 10. not_fn is the correct replacement going forward. */ +#define THRUST_VERSION_NOTFN 200700 +#if (defined(THRUST_VERSION) && THRUST_VERSION < THRUST_VERSION_NOTFN) +#define HYPRE_THRUST_NOT(pred) thrust::not1(pred) +#else +#define HYPRE_THRUST_NOT(pred) thrust::not_fn(pred) +#endif + +using namespace thrust::placeholders; +#endif /* defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) */ + +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * sycl includes + * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + +#if defined(HYPRE_USING_SYCL) + +#include +#include +#if defined(HYPRE_USING_ONEMKLSPARSE) +#include +#endif +#if defined(HYPRE_USING_ONEMKLBLAS) +#include +#include +#endif +#if defined(HYPRE_USING_ONEMKLRAND) +#include +#endif + +/* The following definitions facilitate code reuse and limits + * if/def-ing when unifying cuda/hip code with sycl code */ +using dim3 = sycl::range<3>; +using hypre_DeviceItem = sycl::nd_item<3>; +#define __global__ +#define __host__ +#define __device__ +#define __forceinline__ __inline__ __attribute__((always_inline)) + +#endif /* defined(HYPRE_USING_SYCL) */ + +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * device defined values + * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + +#define HYPRE_MAX_NTHREADS_BLOCK 1024 // HYPRE_WARP_BITSHIFT is just log2 of HYPRE_WARP_SIZE -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_DEVICE_OPENMP) -#define HYPRE_WARP_SIZE 32 -#define HYPRE_WARP_BITSHIFT 5 +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_SYCL) +#define HYPRE_WARP_SIZE 32 +#define HYPRE_WARP_BITSHIFT 5 +#define HYPRE_WARP_FULL_MASK 0xFFFFFFFF #elif defined(HYPRE_USING_HIP) -#define HYPRE_WARP_SIZE 64 -#define HYPRE_WARP_BITSHIFT 6 +#define HYPRE_WARP_SIZE 64 +#define HYPRE_WARP_BITSHIFT 6 +#define HYPRE_WARP_FULL_MASK 0xFFFFFFFFFFFFFFF #endif -#define HYPRE_WARP_FULL_MASK 0xFFFFFFFF -#define HYPRE_MAX_NUM_WARPS (64 * 64 * 32) -#define HYPRE_FLT_LARGE 1e30 -#define HYPRE_1D_BLOCK_SIZE 512 +#define HYPRE_MAX_NUM_WARPS (64 * 64 * 32) +#define HYPRE_FLT_LARGE 1e30 +#define HYPRE_1D_BLOCK_SIZE 512 #define HYPRE_MAX_NUM_STREAMS 10 +#define HYPRE_SPGEMM_MAX_NBIN 10 + +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * macro for launching GPU kernels + * NOTE: IN HYPRE'S DEFAULT STREAM + * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + +#if defined(HYPRE_DEBUG) +#define GPU_LAUNCH_SYNC { hypre_SyncComputeStream(); hypre_GetDeviceLastError(); } +#else +#define GPU_LAUNCH_SYNC +#endif + +/* cuda/hip version */ +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#define HYPRE_GPU_LAUNCH2(kernel_name, gridsize, blocksize, shmem_size, ...) \ +{ \ + if ( gridsize.x == 0 || gridsize.y == 0 || gridsize.z == 0 || \ + blocksize.x == 0 || blocksize.y == 0 || blocksize.z == 0 ) \ + { \ + /* printf("Warning %s %d: Zero CUDA grid/block (%d %d %d) (%d %d %d)\n", \ + __FILE__, __LINE__, \ + gridsize.x, gridsize.y, gridsize.z, blocksize.x, blocksize.y, blocksize.z); */ \ + } \ + else \ + { \ + hypre_DeviceItem item = NULL; \ + (kernel_name) <<< (gridsize), (blocksize), shmem_size, hypre_HandleComputeStream(hypre_handle()) >>> (item, __VA_ARGS__); \ + GPU_LAUNCH_SYNC; \ + } \ +} + +#define HYPRE_GPU_LAUNCH(kernel_name, gridsize, blocksize, ...) HYPRE_GPU_LAUNCH2(kernel_name, gridsize, blocksize, 0, __VA_ARGS__) +#endif /* defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) */ + +/* sycl version */ +#if defined(HYPRE_USING_SYCL) + +#define HYPRE_GPU_LAUNCH(kernel_name, gridsize, blocksize, ...) \ +{ \ + if ( gridsize[2] == 0 || blocksize[2] == 0 ) \ + { \ + /* hypre_printf("Warning %s %d: Zero SYCL 1D launch parameters grid/block (%d) (%d)\n", \ + __FILE__, __LINE__, \ + gridsize[0], blocksize[0]); */ \ + } \ + else \ + { \ + hypre_HandleComputeStream(hypre_handle())->submit([&] (sycl::handler& cgh) { \ + cgh.parallel_for(sycl::nd_range<3>(gridsize*blocksize, blocksize), \ + [=] (hypre_DeviceItem item) [[intel::reqd_sub_group_size(HYPRE_WARP_SIZE)]] \ + { (kernel_name)(item, __VA_ARGS__); \ + }); \ + }).wait_and_throw(); \ + } \ +} + +#define HYPRE_CPU_LAUNCH(kernel_name, gridsize, blocksize, ...) \ +{ \ + if ( gridsize[2] == 0 || blocksize[2] == 0 ) \ + { \ + /* hypre_printf("Warning %s %d: Zero SYCL 1D launch parameters grid/block (%d) (%d)\n", \ + __FILE__, __LINE__, \ + gridsize[0], blocksize[0]); */ \ + } \ + else \ + { \ + HPYRE_Int compute_stream = hypre_HandleComputeStreamNum(hypre_handle()); \ + hypre_HandleComputeStreamNum(hypre_handle) = HYPRE_MAX_NUM_STREAMS - 1; \ + hypre_HandleComputeStream(hypre_handle())->submit([&] (sycl::handler& cgh) { \ + cgh.parallel_for(sycl::nd_range<3>(gridsize*blocksize, blocksize), \ + [=] (hypre_DeviceItem item) [[intel::reqd_sub_group_size(HYPRE_WARP_SIZE)]] \ + { (kernel_name)(item, __VA_ARGS__); \ + }); \ + }).wait_and_throw(); \ + hypre_HandleComputeStreamNum(hypre_handle) = compute_stream; \ + } \ +} + +#define HYPRE_GPU_LAUNCH2(kernel_name, gridsize, blocksize, shmem_size, ...) \ +{ \ + if ( gridsize[2] == 0 || blocksize[2] == 0 ) \ + { \ + /* hypre_printf("Warning %s %d: Zero SYCL 1D launch parameters grid/block (%d) (%d)\n", \ + __FILE__, __LINE__, \ + gridsize[0], blocksize[0]); */ \ + } \ + else \ + { \ + hypre_HandleComputeStream(hypre_handle())->submit([&] (sycl::handler& cgh) { \ + sycl::range<1> shmem_range(shmem_size); \ + sycl::local_accessor shmem_accessor(shmem_range, cgh); \ + cgh.parallel_for(sycl::nd_range<3>(gridsize*blocksize, blocksize), \ + [=] (hypre_DeviceItem item) [[intel::reqd_sub_group_size(HYPRE_WARP_SIZE)]] \ + { (kernel_name)(item, \ + shmem_accessor.get_multi_ptr(), __VA_ARGS__);\ + }); \ + }).wait_and_throw(); \ + } \ +} + +#define HYPRE_GPU_DEBUG_LAUNCH(kernel_name, gridsize, blocksize, ...) \ +{ \ + if ( gridsize[2] == 0 || blocksize[2] == 0 ) \ + { \ + /* hypre_printf("Warning %s %d: Zero SYCL 1D launch parameters grid/block (%d) (%d)\n", \ + __FILE__, __LINE__, \ + gridsize[0], blocksize[0]); */ \ + } \ + else \ + { \ + hypre_HandleComputeStream(hypre_handle())->submit([&] (sycl::handler& cgh) { \ + auto debug_stream = sycl::stream(4096, 1024, cgh); \ + cgh.parallel_for(sycl::nd_range<3>(gridsize*blocksize, blocksize), \ + [=] (hypre_DeviceItem item) [[intel::reqd_sub_group_size(HYPRE_WARP_SIZE)]] \ + { (kernel_name)(item, debug_stream, __VA_ARGS__); \ + }); \ + }).wait_and_throw(); \ + } \ +} + +#define HYPRE_GPU_DEBUG_LAUNCH2(kernel_name, gridsize, blocksize, shmem_size, ...) \ +{ \ + if ( gridsize[2] == 0 || blocksize[2] == 0 ) \ + { \ + /* hypre_printf("Warning %s %d: Zero SYCL 1D launch parameters grid/block (%d) (%d)\n", \ + __FILE__, __LINE__, \ + gridsize[0], blocksize[0]); */ \ + } \ + else \ + { \ + hypre_HandleComputeStream(hypre_handle())->submit([&] (sycl::handler& cgh) { \ + auto debug_stream = sycl::stream(4096, 1024, cgh); \ + sycl::range<1> shmem_range(shmem_size); \ + sycl::accessor shmem_accessor(shmem_range, cgh); \ + cgh.parallel_for(sycl::nd_range<3>(gridsize*blocksize, blocksize), \ + [=] (hypre_DeviceItem item) [[intel::reqd_sub_group_size(HYPRE_WARP_SIZE)]] \ + { (kernel_name)(item, debug_stream, \ + shmem_accessor.get_multi_ptr(), __VA_ARGS__);\ + }); \ + }).wait_and_throw(); \ + } \ +} +#endif /* defined(HYPRE_USING_SYCL) */ + +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * macros for wrapping cuda/hip/sycl calls for error reporting + * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + +#if defined(HYPRE_USING_CUDA) +#define HYPRE_CUDA_CALL(call) do { \ + cudaError_t err = call; \ + if (cudaSuccess != err) { \ + printf("CUDA ERROR (code = %d, %s) at %s:%d\n", err, cudaGetErrorString(err), \ + __FILE__, __LINE__); \ + hypre_assert(0); \ + } } while(0) + +#elif defined(HYPRE_USING_HIP) +#define HYPRE_HIP_CALL(call) do { \ + hipError_t err = call; \ + if (hipSuccess != err) { \ + printf("HIP ERROR (code = %d, %s) at %s:%d\n", err, hipGetErrorString(err), \ + __FILE__, __LINE__); \ + hypre_assert(0); \ + } } while(0) + +#elif defined(HYPRE_USING_SYCL) +#define HYPRE_SYCL_CALL(call) \ + try \ + { \ + call; \ + } \ + catch (sycl::exception const &ex) \ + { \ + hypre_printf("SYCL ERROR (code = %s) at %s:%d\n", ex.what(), \ + __FILE__, __LINE__); \ + assert(0); \ + } \ + catch(std::runtime_error const& ex) \ + { \ + hypre_printf("STD ERROR (code = %s) at %s:%d\n", ex.what(), \ + __FILE__, __LINE__); \ + assert(0); \ + } +#endif -struct hypre_CudaData { +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * macros for wrapping vendor library calls for error reporting + * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + +#if defined(HYPRE_COMPLEX) /* Double Complex */ +#error "GPU build does not support complex numbers!" + +#elif defined(HYPRE_SINGLE) /* Single */ +#if defined(HYPRE_USING_CUDA) +/* cuBLAS */ +#define hypre_cublas_scal cublasSscal +#define hypre_cublas_axpy cublasSaxpy +#define hypre_cublas_dot cublasSdot +#define hypre_cublas_gemv cublasSgemv +#define hypre_cublas_getrfBatched cublasSgetrfBatched +#define hypre_cublas_getriBatched cublasSgetriBatched + +/* cuSPARSE */ +#define hypre_cusparse_csru2csr_bufferSizeExt cusparseScsru2csr_bufferSizeExt +#define hypre_cusparse_csru2csr cusparseScsru2csr +#define hypre_cusparse_csrsv2_bufferSize cusparseScsrsv2_bufferSize +#define hypre_cusparse_csrsv2_analysis cusparseScsrsv2_analysis +#define hypre_cusparse_csrsv2_solve cusparseScsrsv2_solve +#define hypre_cusparse_csrmv cusparseScsrmv +#define hypre_cusparse_csrgemm cusparseScsrgemm +#define hypre_cusparse_csr2csc cusparseScsr2csc +#define hypre_cusparse_csrilu02_bufferSize cusparseScsrilu02_bufferSize +#define hypre_cusparse_csrilu02_analysis cusparseScsrilu02_analysis +#define hypre_cusparse_csrilu02 cusparseScsrilu02 +#define hypre_cusparse_csrsm2_bufferSizeExt cusparseScsrsm2_bufferSizeExt +#define hypre_cusparse_csrsm2_analysis cusparseScsrsm2_analysis +#define hypre_cusparse_csrsm2_solve cusparseScsrsm2_solve + +/* cuSOLVER */ +#define hypre_cusolver_dngetrf cusolverDnSgetrf +#define hypre_cusolver_dngetrf_bs cusolverDnSgetrf_bufferSize +#define hypre_cusolver_dngetrs cusolverDnSgetrs + +#elif defined(HYPRE_USING_HIP) +/* rocSPARSE */ +#define hypre_rocsparse_csrsv_buffer_size rocsparse_scsrsv_buffer_size +#define hypre_rocsparse_csrsv_analysis rocsparse_scsrsv_analysis +#define hypre_rocsparse_csrsv_solve rocsparse_scsrsv_solve +#define hypre_rocsparse_gthr rocsparse_sgthr +#define hypre_rocsparse_csrmv_analysis rocsparse_scsrmv_analysis +#define hypre_rocsparse_csrmv rocsparse_scsrmv +#define hypre_rocsparse_csrgemm_buffer_size rocsparse_scsrgemm_buffer_size +#define hypre_rocsparse_csrgemm rocsparse_scsrgemm +#define hypre_rocsparse_csr2csc rocsparse_scsr2csc +#define hypre_rocsparse_csrilu0_buffer_size rocsparse_scsrilu0_buffer_size +#define hypre_rocsparse_csrilu0_analysis rocsparse_scsrilu0_analysis +#define hypre_rocsparse_csrilu0 rocsparse_scsrilu0 +#define hypre_rocsparse_csritilu0_compute rocsparse_scsritilu0_compute +#define hypre_rocsparse_csritilu0_history rocsparse_scsritilu0_history + +/* rocSOLVER */ + +/************** + * TODO (VPM) * + **************/ + +#endif /* if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) */ + +#elif defined(HYPRE_LONG_DOUBLE) /* Long Double */ +#error "GPU build does not support Long Double numbers!" + +#else /* Double */ +#if defined(HYPRE_USING_CUDA) +/* cuBLAS */ +#define hypre_cublas_scal cublasDscal +#define hypre_cublas_axpy cublasDaxpy +#define hypre_cublas_dot cublasDdot +#define hypre_cublas_gemv cublasDgemv +#define hypre_cublas_getrfBatched cublasDgetrfBatched +#define hypre_cublas_getriBatched cublasDgetriBatched + +/* cuSPARSE */ +#define hypre_cusparse_csru2csr_bufferSizeExt cusparseDcsru2csr_bufferSizeExt +#define hypre_cusparse_csru2csr cusparseDcsru2csr +#define hypre_cusparse_csrsv2_bufferSize cusparseDcsrsv2_bufferSize +#define hypre_cusparse_csrsv2_analysis cusparseDcsrsv2_analysis +#define hypre_cusparse_csrsv2_solve cusparseDcsrsv2_solve +#define hypre_cusparse_csrmv cusparseDcsrmv +#define hypre_cusparse_csrgemm cusparseDcsrgemm +#define hypre_cusparse_csr2csc cusparseDcsr2csc +#define hypre_cusparse_csrilu02_bufferSize cusparseDcsrilu02_bufferSize +#define hypre_cusparse_csrilu02_analysis cusparseDcsrilu02_analysis +#define hypre_cusparse_csrilu02 cusparseDcsrilu02 +#define hypre_cusparse_csrsm2_bufferSizeExt cusparseDcsrsm2_bufferSizeExt +#define hypre_cusparse_csrsm2_analysis cusparseDcsrsm2_analysis +#define hypre_cusparse_csrsm2_solve cusparseDcsrsm2_solve + +/* cuSOLVER */ +#define hypre_cusolver_dngetrf cusolverDnDgetrf +#define hypre_cusolver_dngetrf_bs cusolverDnDgetrf_bufferSize +#define hypre_cusolver_dngetrs cusolverDnDgetrs + +#elif defined(HYPRE_USING_HIP) +/* rocSPARSE */ +#define hypre_rocsparse_csrsv_buffer_size rocsparse_dcsrsv_buffer_size +#define hypre_rocsparse_csrsv_analysis rocsparse_dcsrsv_analysis +#define hypre_rocsparse_csrsv_solve rocsparse_dcsrsv_solve +#define hypre_rocsparse_gthr rocsparse_dgthr +#define hypre_rocsparse_csrmv_analysis rocsparse_dcsrmv_analysis +#define hypre_rocsparse_csrmv rocsparse_dcsrmv +#define hypre_rocsparse_csrgemm_buffer_size rocsparse_dcsrgemm_buffer_size +#define hypre_rocsparse_csrgemm rocsparse_dcsrgemm +#define hypre_rocsparse_csr2csc rocsparse_dcsr2csc +#define hypre_rocsparse_csrilu0_buffer_size rocsparse_dcsrilu0_buffer_size +#define hypre_rocsparse_csrilu0_analysis rocsparse_dcsrilu0_analysis +#define hypre_rocsparse_csrilu0 rocsparse_dcsrilu0 +#define hypre_rocsparse_csritilu0_compute rocsparse_dcsritilu0_compute +#define hypre_rocsparse_csritilu0_history rocsparse_dcsritilu0_history + +/* rocSOLVER */ + +/************** + * TODO (VPM) * + **************/ + +#endif /* #if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP)*/ +#endif /* #if defined(HYPRE_COMPLEX) || defined(HYPRE_SINGLE) || defined(HYPRE_LONG_DOUBLE) */ + +#define HYPRE_CUBLAS_CALL(call) do { \ + cublasStatus_t err = call; \ + if (CUBLAS_STATUS_SUCCESS != err) { \ + printf("CUBLAS ERROR (code = %d, %d) at %s:%d\n", \ + err, err == CUBLAS_STATUS_EXECUTION_FAILED, __FILE__, __LINE__); \ + hypre_assert(0); exit(1); \ + } } while(0) + +#define HYPRE_ROCBLAS_CALL(call) do { \ + rocblas_status err = call; \ + if (rocblas_status_success != err) { \ + printf("rocBLAS ERROR (code = %d, %s) at %s:%d\n", \ + err, rocblas_status_to_string(err), __FILE__, __LINE__); \ + hypre_assert(0); exit(1); \ + } } while(0) + +#if CUSPARSE_VERSION >= 10300 +#define HYPRE_CUSPARSE_CALL(call) do { \ + cusparseStatus_t err = call; \ + if (CUSPARSE_STATUS_SUCCESS != err) { \ + printf("CUSPARSE ERROR (code = %d, %s) at %s:%d\n", \ + err, cusparseGetErrorString(err), __FILE__, __LINE__); \ + hypre_assert(0); exit(1); \ + } } while(0) +#else +#define HYPRE_CUSPARSE_CALL(call) do { \ + cusparseStatus_t err = call; \ + if (CUSPARSE_STATUS_SUCCESS != err) { \ + printf("CUSPARSE ERROR (code = %d) at %s:%d\n", \ + err, __FILE__, __LINE__); \ + hypre_assert(0); exit(1); \ + } } while(0) +#endif + +#define HYPRE_ROCSPARSE_CALL(call) do { \ + rocsparse_status err = call; \ + if (rocsparse_status_success != err) { \ + printf("rocSPARSE ERROR (code = %d) at %s:%d\n", \ + err, __FILE__, __LINE__); \ + assert(0); exit(1); \ + } } while(0) + +#define HYPRE_CUSOLVER_CALL(call) do { \ + cusolverStatus_t err = call; \ + if (CUSOLVER_STATUS_SUCCESS != err) { \ + printf("cuSOLVER ERROR (code = %d) at %s:%d\n", \ + err, __FILE__, __LINE__); \ + hypre_assert(0); \ + } } while(0) + +#define HYPRE_ROCSOLVER_CALL(call) do { \ + rocblas_status err = call; \ + if (rocblas_status_success != err) { \ + printf("rocSOLVER ERROR (code = %d, %s) at %s:%d\n", \ + err, rocblas_status_to_string(err), __FILE__, __LINE__); \ + } } while(0) + +#define HYPRE_CURAND_CALL(call) do { \ + curandStatus_t err = call; \ + if (CURAND_STATUS_SUCCESS != err) { \ + printf("CURAND ERROR (code = %d) at %s:%d\n", err, __FILE__, __LINE__); \ + hypre_assert(0); exit(1); \ + } } while(0) + +#define HYPRE_ROCRAND_CALL(call) do { \ + rocrand_status err = call; \ + if (ROCRAND_STATUS_SUCCESS != err) { \ + printf("ROCRAND ERROR (code = %d) at %s:%d\n", err, __FILE__, __LINE__); \ + hypre_assert(0); exit(1); \ + } } while(0) + +#define HYPRE_ONEMKL_CALL(call) \ + try \ + { \ + call; \ + } \ + catch (oneapi::mkl::exception const &ex) \ + { \ + hypre_printf("ONEMKL ERROR (code = %s) at %s:%d\n", ex.what(), \ + __FILE__, __LINE__); \ + assert(0); exit(1); \ + } + +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * macros for wrapping thrust/oneDPL calls for error reporting + * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + +/* RL: TODO Want macro HYPRE_THRUST_CALL to return value but I don't know how to do it right + * The following one works OK for now */ + +#if defined(HYPRE_USING_CUDA) +#define HYPRE_THRUST_CALL(func_name, ...) \ + thrust::func_name(HYPRE_THRUST_EXECUTION(hypre_HandleDeviceAllocator(hypre_handle())).on(hypre_HandleComputeStream(hypre_handle())), __VA_ARGS__); +#elif defined(HYPRE_USING_HIP) +#define HYPRE_THRUST_CALL(func_name, ...) \ + thrust::func_name(thrust::hip::par(hypre_HandleDeviceAllocator(hypre_handle())).on(hypre_HandleComputeStream(hypre_handle())), __VA_ARGS__); + +#elif defined(HYPRE_USING_SYCL) + +#define HYPRE_ONEDPL_CALL(func_name, ...) \ + func_name(oneapi::dpl::execution::make_device_policy( \ + *hypre_HandleComputeStream(hypre_handle())), __VA_ARGS__); + +#define HYPRE_ONEDPL_CPU_CALL(func_name, ...) \ + func_name(oneapi::dpl::execution::make_device_policy( \ + *hypre_DeviceDataStream(hypre_HandleDeviceData(hypre_handle()), HYPRE_MAX_NUM_STREAMS - 1)), __VA_ARGS__); + +#endif + +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * device info data structures + * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + +struct hypre_cub_CachingDeviceAllocator; +typedef struct hypre_cub_CachingDeviceAllocator hypre_cub_CachingDeviceAllocator; + +#if defined(HYPRE_USING_CUSOLVER) +typedef cusolverDnHandle_t vendorSolverHandle_t; +#elif defined(HYPRE_USING_ROCSOLVER) +typedef rocblas_handle vendorSolverHandle_t; +#endif + +struct hypre_DeviceData +{ #if defined(HYPRE_USING_CURAND) - curandGenerator_t curand_generator; + curandGenerator_t curand_generator; #endif #if defined(HYPRE_USING_ROCRAND) - rocrand_generator curand_generator; + rocrand_generator curand_generator; #endif #if defined(HYPRE_USING_CUBLAS) - cublasHandle_t cublas_handle; + cublasHandle_t cublas_handle; #endif #if defined(HYPRE_USING_CUSPARSE) - cusparseHandle_t cusparse_handle; + cusparseHandle_t cusparse_handle; #endif #if defined(HYPRE_USING_ROCSPARSE) - rocsparse_handle cusparse_handle; + rocsparse_handle cusparse_handle; #endif -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_DEVICE_OPENMP) - cudaStream_t cuda_streams[HYPRE_MAX_NUM_STREAMS]; +#if defined(HYPRE_USING_CUSOLVER) || defined(HYPRE_USING_ROCSOLVER) + vendorSolverHandle_t vendor_solver_handle; +#endif + + /* TODO (VPM): Change to HYPRE_USING_GPU_STREAMS*/ +#if defined(HYPRE_USING_CUDA_STREAMS) +#if defined(HYPRE_USING_CUDA) + cudaStream_t streams[HYPRE_MAX_NUM_STREAMS]; #elif defined(HYPRE_USING_HIP) - hipStream_t cuda_streams[HYPRE_MAX_NUM_STREAMS]; + hipStream_t streams[HYPRE_MAX_NUM_STREAMS]; +#elif defined(HYPRE_USING_SYCL) + sycl::queue* streams[HYPRE_MAX_NUM_STREAMS] = {NULL}; +#endif #endif -#ifdef HYPRE_USING_DEVICE_POOL - hypre_uint cub_bin_growth; - hypre_uint cub_min_bin; - hypre_uint cub_max_bin; - size_t cub_max_cached_bytes; - hypre_cub_CachingDeviceAllocator *cub_dev_allocator; - hypre_cub_CachingDeviceAllocator *cub_uvm_allocator; +#if defined(HYPRE_USING_DEVICE_POOL) + hypre_uint cub_bin_growth; + hypre_uint cub_min_bin; + hypre_uint cub_max_bin; + size_t cub_max_cached_bytes; + hypre_cub_CachingDeviceAllocator *cub_dev_allocator; + hypre_cub_CachingDeviceAllocator *cub_uvm_allocator; #endif #if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - hypre_device_allocator device_allocator; -#endif - - HYPRE_Int cuda_device; - /* by default, hypre puts GPU computations in this stream - * Do not be confused with the default (null) CUDA stream */ - HYPRE_Int cuda_compute_stream_num; - /* work space for hypre's CUDA reducer */ - void *cuda_reduce_buffer; - /* the device buffers needed to do MPI communication for struct comm */ - HYPRE_Complex *struct_comm_recv_buffer; - HYPRE_Complex *struct_comm_send_buffer; - HYPRE_Int struct_comm_recv_buffer_size; - HYPRE_Int struct_comm_send_buffer_size; - /* device spgemm options */ - HYPRE_Int spgemm_use_cusparse; - HYPRE_Int spgemm_algorithm; - HYPRE_Int spgemm_rownnz_estimate_method; - HYPRE_Int spgemm_rownnz_estimate_nsamples; - float spgemm_rownnz_estimate_mult_factor; - char spgemm_hash_type; - /* PMIS */ - HYPRE_Int use_gpu_rand; + hypre_device_allocator device_allocator; +#endif +#if defined(HYPRE_USING_SYCL) + sycl::device *device; + HYPRE_Int device_max_work_group_size; +#else + HYPRE_Int device; +#endif + hypre_int device_max_shmem_per_block[3]; + /* by default, hypre puts GPU computations in this stream + * Do not be confused with the default (null) stream */ + HYPRE_Int compute_stream_num; + /* work space for hypre's device reducer */ + void *reduce_buffer; + /* device spgemm options */ + HYPRE_Int spgemm_algorithm; + HYPRE_Int spgemm_binned; + HYPRE_Int spgemm_num_bin; + /* the highest bins for symbl [0] and numer [1] + * which are not necessary to be `spgemm_num_bin' due to shmem limit on GPUs */ + HYPRE_Int spgemm_highest_bin[2]; + /* for bin i: ([0][i], [2][i]) = (max #block to launch, block dimension) for symbl + * ([1][i], [3][i]) = (max #block to launch, block dimension) for numer */ + HYPRE_Int spgemm_block_num_dim[4][HYPRE_SPGEMM_MAX_NBIN + 1]; + HYPRE_Int spgemm_rownnz_estimate_method; + HYPRE_Int spgemm_rownnz_estimate_nsamples; + float spgemm_rownnz_estimate_mult_factor; + /* cusparse */ + HYPRE_Int spmv_use_vendor; + HYPRE_Int sptrans_use_vendor; + HYPRE_Int spgemm_use_vendor; + /* PMIS RNG */ + HYPRE_Int use_gpu_rand; }; -#define hypre_CudaDataCubBinGrowth(data) ((data)->cub_bin_growth) -#define hypre_CudaDataCubMinBin(data) ((data)->cub_min_bin) -#define hypre_CudaDataCubMaxBin(data) ((data)->cub_max_bin) -#define hypre_CudaDataCubMaxCachedBytes(data) ((data)->cub_max_cached_bytes) -#define hypre_CudaDataCubDevAllocator(data) ((data)->cub_dev_allocator) -#define hypre_CudaDataCubUvmAllocator(data) ((data)->cub_uvm_allocator) -#define hypre_CudaDataCudaDevice(data) ((data)->cuda_device) -#define hypre_CudaDataCudaComputeStreamNum(data) ((data)->cuda_compute_stream_num) -#define hypre_CudaDataCudaReduceBuffer(data) ((data)->cuda_reduce_buffer) -#define hypre_CudaDataStructCommRecvBuffer(data) ((data)->struct_comm_recv_buffer) -#define hypre_CudaDataStructCommSendBuffer(data) ((data)->struct_comm_send_buffer) -#define hypre_CudaDataStructCommRecvBufferSize(data) ((data)->struct_comm_recv_buffer_size) -#define hypre_CudaDataStructCommSendBufferSize(data) ((data)->struct_comm_send_buffer_size) -#define hypre_CudaDataSpgemmUseCusparse(data) ((data)->spgemm_use_cusparse) -#define hypre_CudaDataSpgemmAlgorithm(data) ((data)->spgemm_algorithm) -#define hypre_CudaDataSpgemmRownnzEstimateMethod(data) ((data)->spgemm_rownnz_estimate_method) -#define hypre_CudaDataSpgemmRownnzEstimateNsamples(data) ((data)->spgemm_rownnz_estimate_nsamples) -#define hypre_CudaDataSpgemmRownnzEstimateMultFactor(data) ((data)->spgemm_rownnz_estimate_mult_factor) -#define hypre_CudaDataSpgemmHashType(data) ((data)->spgemm_hash_type) -#define hypre_CudaDataDeviceAllocator(data) ((data)->device_allocator) -#define hypre_CudaDataUseGpuRand(data) ((data)->use_gpu_rand) - -hypre_CudaData *hypre_CudaDataCreate(); -void hypre_CudaDataDestroy(hypre_CudaData *data); +#define hypre_DeviceDataCubBinGrowth(data) ((data) -> cub_bin_growth) +#define hypre_DeviceDataCubMinBin(data) ((data) -> cub_min_bin) +#define hypre_DeviceDataCubMaxBin(data) ((data) -> cub_max_bin) +#define hypre_DeviceDataCubMaxCachedBytes(data) ((data) -> cub_max_cached_bytes) +#define hypre_DeviceDataCubDevAllocator(data) ((data) -> cub_dev_allocator) +#define hypre_DeviceDataCubUvmAllocator(data) ((data) -> cub_uvm_allocator) +#define hypre_DeviceDataDevice(data) ((data) -> device) +#define hypre_DeviceDataDeviceMaxWorkGroupSize(data) ((data) -> device_max_work_group_size) +#define hypre_DeviceDataDeviceMaxShmemPerBlock(data) ((data) -> device_max_shmem_per_block) +#define hypre_DeviceDataDeviceMaxShmemPerBlockInited(data) (((data) -> device_max_shmem_per_block)[2]) +#define hypre_DeviceDataComputeStreamNum(data) ((data) -> compute_stream_num) +#define hypre_DeviceDataReduceBuffer(data) ((data) -> reduce_buffer) +#define hypre_DeviceDataSpgemmUseVendor(data) ((data) -> spgemm_use_vendor) +#define hypre_DeviceDataSpMVUseVendor(data) ((data) -> spmv_use_vendor) +#define hypre_DeviceDataSpTransUseVendor(data) ((data) -> sptrans_use_vendor) +#define hypre_DeviceDataSpgemmAlgorithm(data) ((data) -> spgemm_algorithm) +#define hypre_DeviceDataSpgemmBinned(data) ((data) -> spgemm_binned) +#define hypre_DeviceDataSpgemmNumBin(data) ((data) -> spgemm_num_bin) +#define hypre_DeviceDataSpgemmHighestBin(data) ((data) -> spgemm_highest_bin) +#define hypre_DeviceDataSpgemmBlockNumDim(data) ((data) -> spgemm_block_num_dim) +#define hypre_DeviceDataSpgemmRownnzEstimateMethod(data) ((data) -> spgemm_rownnz_estimate_method) +#define hypre_DeviceDataSpgemmRownnzEstimateNsamples(data) ((data) -> spgemm_rownnz_estimate_nsamples) +#define hypre_DeviceDataSpgemmRownnzEstimateMultFactor(data) ((data) -> spgemm_rownnz_estimate_mult_factor) +#define hypre_DeviceDataDeviceAllocator(data) ((data) -> device_allocator) +#define hypre_DeviceDataUseGpuRand(data) ((data) -> use_gpu_rand) + +hypre_DeviceData* hypre_DeviceDataCreate(); +void hypre_DeviceDataDestroy(hypre_DeviceData* data); #if defined(HYPRE_USING_CURAND) -curandGenerator_t hypre_CudaDataCurandGenerator(hypre_CudaData *data); +curandGenerator_t hypre_DeviceDataCurandGenerator(hypre_DeviceData *data); #endif #if defined(HYPRE_USING_ROCRAND) -rocrand_generator hypre_CudaDataCurandGenerator(hypre_CudaData *data); +rocrand_generator hypre_DeviceDataCurandGenerator(hypre_DeviceData *data); #endif #if defined(HYPRE_USING_CUBLAS) -cublasHandle_t hypre_CudaDataCublasHandle(hypre_CudaData *data); +cublasHandle_t hypre_DeviceDataCublasHandle(hypre_DeviceData *data); #endif #if defined(HYPRE_USING_CUSPARSE) -cusparseHandle_t hypre_CudaDataCusparseHandle(hypre_CudaData *data); +cusparseHandle_t hypre_DeviceDataCusparseHandle(hypre_DeviceData *data); #endif #if defined(HYPRE_USING_ROCSPARSE) -rocsparse_handle hypre_CudaDataCusparseHandle(hypre_CudaData *data); +rocsparse_handle hypre_DeviceDataCusparseHandle(hypre_DeviceData *data); #endif -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_DEVICE_OPENMP) -cudaStream_t hypre_CudaDataCudaStream(hypre_CudaData *data, HYPRE_Int i); -cudaStream_t hypre_CudaDataCudaComputeStream(hypre_CudaData *data); +#if defined(HYPRE_USING_CUSOLVER) || defined(HYPRE_USING_ROCSOLVER) +vendorSolverHandle_t hypre_DeviceDataVendorSolverHandle(hypre_DeviceData *data); +#endif + +/* TODO (VPM): Create a deviceStream_t to encapsulate all stream types below */ +#if defined(HYPRE_USING_CUDA) +cudaStream_t hypre_DeviceDataStream(hypre_DeviceData *data, HYPRE_Int i); +cudaStream_t hypre_DeviceDataComputeStream(hypre_DeviceData *data); #elif defined(HYPRE_USING_HIP) -hipStream_t hypre_CudaDataCudaStream(hypre_CudaData *data, HYPRE_Int i); -hipStream_t hypre_CudaDataCudaComputeStream(hypre_CudaData *data); +hipStream_t hypre_DeviceDataStream(hypre_DeviceData *data, HYPRE_Int i); +hipStream_t hypre_DeviceDataComputeStream(hypre_DeviceData *data); +#elif defined(HYPRE_USING_SYCL) +sycl::queue* hypre_DeviceDataStream(hypre_DeviceData *data, HYPRE_Int i); +sycl::queue* hypre_DeviceDataComputeStream(hypre_DeviceData *data); #endif -// Data structure and accessor routines for Cuda Sparse Triangular Matrices -struct hypre_CsrsvData { +/* Data structure and accessor routines for Sparse Triangular Matrices */ +struct hypre_CsrsvData +{ #if defined(HYPRE_USING_CUSPARSE) - csrsv2Info_t info_L; - csrsv2Info_t info_U; + hypre_cusparseSpSVDescr info_L; + hypre_cusparseSpSVDescr info_U; + cusparseSolvePolicy_t analysis_policy; + cusparseSolvePolicy_t solve_policy; #elif defined(HYPRE_USING_ROCSPARSE) - rocsparse_mat_info info_L; - rocsparse_mat_info info_U; + rocsparse_mat_info info_L; + rocsparse_mat_info info_U; + rocsparse_analysis_policy analysis_policy; + rocsparse_solve_policy solve_policy; #endif - hypre_int BufferSize; - char *Buffer; + +#if defined(HYPRE_USING_CUSPARSE) && (CUSPARSE_VERSION >= CUSPARSE_SPSV_VERSION) + size_t buffer_size_L; + size_t buffer_size_U; + char *buffer_L; + char *buffer_U; +#else + hypre_int buffer_size; + char *buffer; +#endif + + /* Temporary array to save matrix values with modified diagonal */ + HYPRE_Complex *mat_data; + + /* Flags for checking whether the analysis phase has been executed or not */ + HYPRE_Int analyzed_L; + HYPRE_Int analyzed_U; }; -#define hypre_CsrsvDataInfoL(data) ((data)->info_L) -#define hypre_CsrsvDataInfoU(data) ((data)->info_U) -#define hypre_CsrsvDataBufferSize(data) ((data)->BufferSize) -#define hypre_CsrsvDataBuffer(data) ((data)->Buffer) +#define hypre_CsrsvDataInfoL(data) ((data) -> info_L) +#define hypre_CsrsvDataInfoU(data) ((data) -> info_U) +#define hypre_CsrsvDataAnalyzedL(data) ((data) -> analyzed_L) +#define hypre_CsrsvDataAnalyzedU(data) ((data) -> analyzed_U) +#define hypre_CsrsvDataSolvePolicy(data) ((data) -> solve_policy) +#define hypre_CsrsvDataAnalysisPolicy(data) ((data) -> analysis_policy) +#if defined(HYPRE_USING_CUSPARSE) && (CUSPARSE_VERSION >= CUSPARSE_SPSV_VERSION) +#define hypre_CsrsvDataBufferSizeL(data) ((data) -> buffer_size_L) +#define hypre_CsrsvDataBufferSizeU(data) ((data) -> buffer_size_U) +#define hypre_CsrsvDataBufferL(data) ((data) -> buffer_L) +#define hypre_CsrsvDataBufferU(data) ((data) -> buffer_U) +#else +#define hypre_CsrsvDataBufferSize(data) ((data) -> buffer_size) +#define hypre_CsrsvDataBuffer(data) ((data) -> buffer) +#endif +#define hypre_CsrsvDataMatData(data) ((data) -> mat_data) -struct hypre_GpuMatData { +struct hypre_GpuMatData +{ #if defined(HYPRE_USING_CUSPARSE) - cusparseMatDescr_t mat_descr; -#endif + cusparseMatDescr_t mat_descr; + char *spmv_buffer; -#if defined(HYPRE_USING_ROCSPARSE) - rocsparse_mat_descr mat_descr; - rocsparse_mat_info mat_info; +#elif defined(HYPRE_USING_ROCSPARSE) + rocsparse_mat_descr mat_descr; + rocsparse_mat_info mat_info; + +#elif defined(HYPRE_USING_ONEMKLSPARSE) + oneapi::mkl::sparse::matrix_handle_t mat_handle; #endif }; -#define hypre_GpuMatDataMatDecsr(data) ((data)->mat_descr) -#define hypre_GpuMatDataMatInfo(data) ((data)->mat_info) +#define hypre_GpuMatDataMatDescr(data) ((data) -> mat_descr) +#define hypre_GpuMatDataMatInfo(data) ((data) -> mat_info) +#define hypre_GpuMatDataMatHandle(data) ((data) -> mat_handle) +#define hypre_GpuMatDataSpMVBuffer(data) ((data) -> spmv_buffer) -#endif//#if defined(HYPRE_USING_GPU) +#endif /* if defined(HYPRE_USING_GPU) */ -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * generic device functions (cuda/hip/sycl) + * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -#include -#if defined(HYPRE_USING_CUDA) -#include -#elif defined(HYPRE_USING_HIP) -#include +#if defined(HYPRE_USING_GPU) +template +static __device__ __forceinline__ +T read_only_load( const T *ptr ) +{ +#if defined(__CUDA_ARCH__) && __CUDA_ARCH__ >= 350 + return __ldg( ptr ); +#else + return *ptr; #endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +} -using namespace thrust::placeholders; +static __device__ __forceinline__ +hypre_int next_power_of_2(hypre_int n) +{ + if (n <= 0) + { + return 0; + } + + /* if n is power of 2, return itself */ + if ( (n & (n - 1)) == 0 ) + { + return n; + } + + n |= (n >> 1); + n |= (n >> 2); + n |= (n >> 4); + n |= (n >> 8); + n |= (n >> 16); + n ^= (n >> 1); + n = (n << 1); + + return n; +} + +/* Flip n-th bit of bitmask (0 becomes 1. 1 becomes 0) */ +static __device__ __forceinline__ +hypre_mask hypre_mask_flip_at(hypre_mask bitmask, hypre_int n) +{ + return bitmask ^ (hypre_mask_one << n); +} + +#endif // defined(HYPRE_USING_GPU) /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * macro for launching CUDA kernels, CUDA, Thrust, Cusparse, Curand calls - * NOTE: IN HYPRE'S DEFAULT STREAM - * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + * cuda/hip functions + * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -#if defined(HYPRE_DEBUG) -#if defined(HYPRE_USING_CUDA) -#define GPU_LAUNCH_SYNC \ - { \ - hypre_SyncCudaComputeStream(hypre_handle()); \ - HYPRE_CUDA_CALL(cudaGetLastError()); \ - } -#elif defined(HYPRE_USING_HIP) -#define GPU_LAUNCH_SYNC \ - { \ - hypre_SyncCudaComputeStream(hypre_handle()); \ - HYPRE_HIP_CALL(hipGetLastError()); \ - } +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + +/* return the number of threads in block */ +template +static __device__ __forceinline__ +hypre_int hypre_gpu_get_num_threads(hypre_DeviceItem &item) +{ + switch (dim) + { + case 1: + return (blockDim.x); + case 2: + return (blockDim.x * blockDim.y); + case 3: + return (blockDim.x * blockDim.y * blockDim.z); + } + + return -1; +} + +/* return the flattened thread id in block */ +template +static __device__ __forceinline__ +hypre_int hypre_gpu_get_thread_id(hypre_DeviceItem &item) +{ + switch (dim) + { + case 1: + return (threadIdx.x); + case 2: + return (threadIdx.y * blockDim.x + threadIdx.x); + case 3: + return (threadIdx.z * blockDim.x * blockDim.y + threadIdx.y * blockDim.x + + threadIdx.x); + } + + return -1; +} + +/* return the number of warps in block */ +template +static __device__ __forceinline__ +hypre_int hypre_gpu_get_num_warps(hypre_DeviceItem &item) +{ + return hypre_gpu_get_num_threads(item) >> HYPRE_WARP_BITSHIFT; +} + +/* return the warp id in block */ +template +static __device__ __forceinline__ +hypre_int hypre_gpu_get_warp_id(hypre_DeviceItem &item) +{ + return hypre_gpu_get_thread_id(item) >> HYPRE_WARP_BITSHIFT; +} + +/* return the thread lane id in warp */ +template +static __device__ __forceinline__ +hypre_int hypre_gpu_get_lane_id(hypre_DeviceItem &item) +{ + return hypre_gpu_get_thread_id(item) & (HYPRE_WARP_SIZE - 1); +} + +/* return the num of blocks in grid */ +template +static __device__ __forceinline__ +hypre_int hypre_gpu_get_num_blocks() +{ + switch (dim) + { + case 1: + return (gridDim.x); + case 2: + return (gridDim.x * gridDim.y); + case 3: + return (gridDim.x * gridDim.y * gridDim.z); + } + + return -1; +} + +/* return the flattened block id in grid */ +template +static __device__ __forceinline__ +hypre_int hypre_gpu_get_block_id(hypre_DeviceItem &item) +{ + switch (dim) + { + case 1: + return (blockIdx.x); + case 2: + return (blockIdx.y * gridDim.x + blockIdx.x); + case 3: + return (blockIdx.z * gridDim.x * gridDim.y + blockIdx.y * gridDim.x + + blockIdx.x); + } + + return -1; +} + +/* return the number of threads in grid */ +template +static __device__ __forceinline__ +hypre_int hypre_gpu_get_grid_num_threads(hypre_DeviceItem &item) +{ + return hypre_gpu_get_num_blocks() * hypre_gpu_get_num_threads(item); +} + +/* return the flattened thread id in grid */ +template +static __device__ __forceinline__ +hypre_int hypre_gpu_get_grid_thread_id(hypre_DeviceItem &item) +{ + return hypre_gpu_get_block_id(item) * hypre_gpu_get_num_threads(item) + + hypre_gpu_get_thread_id(item); +} + +/* return the number of warps in grid */ +template +static __device__ __forceinline__ +hypre_int hypre_gpu_get_grid_num_warps(hypre_DeviceItem &item) +{ + return hypre_gpu_get_num_blocks() * hypre_gpu_get_num_warps(item); +} + +/* return the flattened warp id in grid */ +template +static __device__ __forceinline__ +hypre_int hypre_gpu_get_grid_warp_id(hypre_DeviceItem &item) +{ + return hypre_gpu_get_block_id(item) * hypre_gpu_get_num_warps(item) + + hypre_gpu_get_warp_id(item); +} + +#if defined(__CUDA_ARCH__) && __CUDA_ARCH__ < 600 +static __device__ __forceinline__ +hypre_double atomicAdd(hypre_double* address, hypre_double val) +{ + hypre_ulonglongint* address_as_ull = (hypre_ulonglongint*) address; + hypre_ulonglongint old = *address_as_ull, assumed; + + do + { + assumed = old; + old = atomicCAS(address_as_ull, assumed, + __double_as_longlong(val + + __longlong_as_double(assumed))); + + // Note: uses integer comparison to avoid hang in case of NaN (since NaN != NaN) + } + while (assumed != old); + + return __longlong_as_double(old); +} #endif -#else// #if defined(HYPRE_DEBUG) -#define GPU_LAUNCH_SYNC -#endif// defined(HYPRE_DEBUG) - -#define HYPRE_CUDA_LAUNCH2(kernel_name, gridsize, blocksize, shmem_size, ...) \ - { \ - if (gridsize.x == 0 || gridsize.y == 0 || gridsize.z == 0 || blocksize.x == 0 || blocksize.y == 0 \ - || blocksize.z == 0) { \ - /* printf("Warning %s %d: Zero CUDA grid/block (%d %d %d) (%d %d %d)\n", \ - __FILE__, __LINE__, \ - gridsize.x, gridsize.y, gridsize.z, blocksize.x, blocksize.y, blocksize.z); */ \ - } else { \ - (kernel_name)<<<(gridsize), (blocksize), shmem_size, \ - hypre_HandleCudaComputeStream(hypre_handle())>>>(__VA_ARGS__); \ - GPU_LAUNCH_SYNC; \ - } \ - } -#define HYPRE_CUDA_LAUNCH(kernel_name, gridsize, blocksize, ...) \ - HYPRE_CUDA_LAUNCH2(kernel_name, gridsize, blocksize, 0, __VA_ARGS__) +// There are no *_sync functions in HIP +#if defined(HYPRE_USING_HIP) || (CUDA_VERSION < 9000) + +template +static __device__ __forceinline__ +T __shfl_sync(hypre_mask mask, T val, hypre_int src_line, hypre_int width = HYPRE_WARP_SIZE) +{ + return __shfl(val, src_line, width); +} -/* RL: TODO Want macro HYPRE_THRUST_CALL to return value but I don't know how to do it right - * The following one works OK for now */ +template +static __device__ __forceinline__ +T __shfl_up_sync(hypre_mask mask, T val, hypre_uint delta, hypre_int width = HYPRE_WARP_SIZE) +{ + return __shfl_up(val, delta, width); +} +template +static __device__ __forceinline__ +T __shfl_down_sync(hypre_mask mask, T val, hypre_uint delta, hypre_int width = HYPRE_WARP_SIZE) +{ + return __shfl_down(val, delta, width); +} + +template +static __device__ __forceinline__ +T __shfl_xor_sync(hypre_mask mask, T val, hypre_int lanemask, hypre_int width = HYPRE_WARP_SIZE) +{ + return __shfl_xor(val, lanemask, width); +} + +static __device__ __forceinline__ +void __syncwarp() +{ +} + +#endif // #if defined(HYPRE_USING_HIP) || (CUDA_VERSION < 9000) + +static __device__ __forceinline__ +hypre_mask hypre_ballot_sync(hypre_DeviceItem &item, hypre_mask mask, hypre_int predicate) +{ #if defined(HYPRE_USING_CUDA) -#define HYPRE_THRUST_CALL(func_name, ...) \ - thrust::func_name(thrust::cuda::par(hypre_HandleDeviceAllocator(hypre_handle())) \ - .on(hypre_HandleCudaComputeStream(hypre_handle())), \ - __VA_ARGS__); -#elif defined(HYPRE_USING_HIP) -#define HYPRE_THRUST_CALL(func_name, ...) \ - thrust::func_name(thrust::hip::par(hypre_HandleDeviceAllocator(hypre_handle())) \ - .on(hypre_HandleCudaComputeStream(hypre_handle())), \ - __VA_ARGS__); + return __ballot_sync(mask, predicate); +#else + return __ballot(predicate); +#endif +} + +static __device__ __forceinline__ +HYPRE_Int hypre_popc(hypre_mask mask) +{ +#if defined(HYPRE_USING_CUDA) + return (HYPRE_Int) __popc(mask); +#else + return (HYPRE_Int) __popcll(mask); #endif +} + +static __device__ __forceinline__ +HYPRE_Int hypre_ffs(hypre_mask mask) +{ +#if defined(HYPRE_USING_CUDA) + return (HYPRE_Int) __ffs(mask); +#else + return (HYPRE_Int) __ffsll(mask); +#endif +} + +#if defined(HYPRE_USING_HIP) +static __device__ __forceinline__ +hypre_int __any_sync(unsigned mask, hypre_int predicate) +{ + return __any(predicate); +} +#endif + +/* sync the thread block */ +static __device__ __forceinline__ +void block_sync(hypre_DeviceItem &item) +{ + __syncthreads(); +} + +/* sync the warp */ +static __device__ __forceinline__ +void warp_sync(hypre_DeviceItem &item) +{ + __syncwarp(); +} + +/* exclusive prefix scan */ +template +static __device__ __forceinline__ +T warp_prefix_sum(hypre_DeviceItem &item, hypre_int lane_id, T in, T &all_sum) +{ +#pragma unroll + for (hypre_int d = 2; d <= HYPRE_WARP_SIZE; d <<= 1) + { + T t = __shfl_up_sync(HYPRE_WARP_FULL_MASK, in, d >> 1); + if ( (lane_id & (d - 1)) == (d - 1) ) + { + in += t; + } + } + + all_sum = __shfl_sync(HYPRE_WARP_FULL_MASK, in, HYPRE_WARP_SIZE - 1); + + if (lane_id == HYPRE_WARP_SIZE - 1) + { + in = 0; + } + +#pragma unroll + for (hypre_int d = HYPRE_WARP_SIZE >> 1; d > 0; d >>= 1) + { + T t = __shfl_xor_sync(HYPRE_WARP_FULL_MASK, in, d); + + if ( (lane_id & (d - 1)) == (d - 1)) + { + if ( (lane_id & ((d << 1) - 1)) == ((d << 1) - 1) ) + { + in += t; + } + else + { + in = t; + } + } + } + return in; +} + +static __device__ __forceinline__ +hypre_int warp_any_sync(hypre_DeviceItem &item, hypre_mask mask, hypre_int predicate) +{ + return __any_sync(mask, predicate); +} + +template +static __device__ __forceinline__ +T warp_shuffle_sync(hypre_DeviceItem &item, hypre_mask mask, T val, hypre_int src_line, + hypre_int width = HYPRE_WARP_SIZE) +{ + return __shfl_sync(mask, val, src_line, width); +} + +template +static __device__ __forceinline__ +T warp_shuffle_up_sync(hypre_DeviceItem &item, hypre_mask mask, T val, hypre_uint delta, + hypre_int width = HYPRE_WARP_SIZE) +{ + return __shfl_up_sync(mask, val, delta, width); +} + +template +static __device__ __forceinline__ +T warp_shuffle_down_sync(hypre_DeviceItem &item, hypre_mask mask, T val, hypre_uint delta, + hypre_int width = HYPRE_WARP_SIZE) +{ + return __shfl_down_sync(mask, val, delta, width); +} + +template +static __device__ __forceinline__ +T warp_shuffle_xor_sync(hypre_DeviceItem &item, hypre_mask mask, T val, hypre_int lane_mask, + hypre_int width = HYPRE_WARP_SIZE) +{ + return __shfl_xor_sync(mask, val, lane_mask, width); +} + +template +static __device__ __forceinline__ +T warp_reduce_sum(hypre_DeviceItem &item, T in) +{ +#pragma unroll + for (hypre_int d = HYPRE_WARP_SIZE >> 1; d > 0; d >>= 1) + { + in += __shfl_down_sync(HYPRE_WARP_FULL_MASK, in, d); + } + return in; +} + +template +static __device__ __forceinline__ +T warp_allreduce_sum(hypre_DeviceItem &item, T in) +{ +#pragma unroll + for (hypre_int d = HYPRE_WARP_SIZE >> 1; d > 0; d >>= 1) + { + in += __shfl_xor_sync(HYPRE_WARP_FULL_MASK, in, d); + } + return in; +} + +template +static __device__ __forceinline__ +T warp_reduce_max(hypre_DeviceItem &item, T in) +{ +#pragma unroll + for (hypre_int d = HYPRE_WARP_SIZE >> 1; d > 0; d >>= 1) + { + in = max(in, __shfl_down_sync(HYPRE_WARP_FULL_MASK, in, d)); + } + return in; +} + +template +static __device__ __forceinline__ +T warp_allreduce_max(hypre_DeviceItem &item, T in) +{ +#pragma unroll + for (hypre_int d = HYPRE_WARP_SIZE >> 1; d > 0; d >>= 1) + { + in = max(in, __shfl_xor_sync(HYPRE_WARP_FULL_MASK, in, d)); + } + return in; +} + +template +static __device__ __forceinline__ +T warp_reduce_min(hypre_DeviceItem &item, T in) +{ +#pragma unroll + for (hypre_int d = HYPRE_WARP_SIZE >> 1; d > 0; d >>= 1) + { + in = min(in, __shfl_down_sync(HYPRE_WARP_FULL_MASK, in, d)); + } + return in; +} + +template +static __device__ __forceinline__ +T warp_allreduce_min(hypre_DeviceItem &item, T in) +{ +#pragma unroll + for (hypre_int d = HYPRE_WARP_SIZE >> 1; d > 0; d >>= 1) + { + in = min(in, __shfl_xor_sync(HYPRE_WARP_FULL_MASK, in, d)); + } + return in; +} + +template +#if (defined(THRUST_VERSION) && THRUST_VERSION < THRUST_VERSION_NOTFN) +struct type_cast : public thrust::unary_function +#else +struct type_cast +#endif +{ + __host__ __device__ T2 operator()(const T1 &x) const + { + return (T2) x; + } +}; + +template +#if (defined(THRUST_VERSION) && THRUST_VERSION < THRUST_VERSION_NOTFN) +struct absolute_value : public thrust::unary_function +#else +struct absolute_value +#endif +{ + __host__ __device__ T operator()(const T &x) const + { + return x < T(0) ? -x : x; + } +}; + +template +struct TupleComp2 +{ + typedef thrust::tuple Tuple; + + __host__ __device__ bool operator()(const Tuple& t1, const Tuple& t2) + { + if (thrust::get<0>(t1) < thrust::get<0>(t2)) + { + return true; + } + if (thrust::get<0>(t1) > thrust::get<0>(t2)) + { + return false; + } + return hypre_abs(thrust::get<1>(t1)) > hypre_abs(thrust::get<1>(t2)); + } +}; + +template +struct TupleComp3 +{ + typedef thrust::tuple Tuple; + + __host__ __device__ bool operator()(const Tuple& t1, const Tuple& t2) + { + if (thrust::get<0>(t1) < thrust::get<0>(t2)) + { + return true; + } + if (thrust::get<0>(t1) > thrust::get<0>(t2)) + { + return false; + } + if (thrust::get<0>(t2) == thrust::get<1>(t2)) + { + return false; + } + return thrust::get<0>(t1) == thrust::get<1>(t1) || thrust::get<1>(t1) < thrust::get<1>(t2); + } +}; + +template +#if (defined(THRUST_VERSION) && THRUST_VERSION < THRUST_VERSION_NOTFN) +struct is_negative : public thrust::unary_function +#else +struct is_negative +#endif +{ + __host__ __device__ bool operator()(const T &x) + { + return (x < 0); + } +}; + +template +#if (defined(THRUST_VERSION) && THRUST_VERSION < THRUST_VERSION_NOTFN) +struct is_positive : public thrust::unary_function +#else +struct is_positive +#endif +{ + __host__ __device__ bool operator()(const T &x) + { + return (x > 0); + } +}; + +template +#if (defined(THRUST_VERSION) && THRUST_VERSION < THRUST_VERSION_NOTFN) +struct is_nonnegative : public thrust::unary_function +#else +struct is_nonnegative +#endif +{ + __host__ __device__ bool operator()(const T &x) + { + return (x >= 0); + } +}; + +template +#if (defined(THRUST_VERSION) && THRUST_VERSION < THRUST_VERSION_NOTFN) +struct in_range : public thrust::unary_function +#else +struct in_range +#endif +{ + T low, up; + + in_range(T low_, T up_) { low = low_; up = up_; } + + __host__ __device__ bool operator()(const T &x) + { + return (x >= low && x <= up); + } +}; + +template +#if (defined(THRUST_VERSION) && THRUST_VERSION < THRUST_VERSION_NOTFN) +struct out_of_range : public thrust::unary_function +#else +struct out_of_range +#endif +{ + T low, up; + + out_of_range(T low_, T up_) { low = low_; up = up_; } + + __host__ __device__ bool operator()(const T &x) + { + return (x < low || x > up); + } +}; + +template +#if (defined(THRUST_VERSION) && THRUST_VERSION < THRUST_VERSION_NOTFN) +struct less_than : public thrust::unary_function +#else +struct less_than +#endif +{ + T val; + + less_than(T val_) { val = val_; } + + __host__ __device__ bool operator()(const T &x) + { + return (x < val); + } +}; + +template +#if (defined(THRUST_VERSION) && THRUST_VERSION < THRUST_VERSION_NOTFN) +struct modulo : public thrust::unary_function +#else +struct modulo +#endif +{ + T val; + + modulo(T val_) { val = val_; } + + __host__ __device__ T operator()(const T &x) + { + return (x % val); + } +}; + +template +#if (defined(THRUST_VERSION) && THRUST_VERSION < THRUST_VERSION_NOTFN) +struct equal : public thrust::unary_function +#else +struct equal +#endif +{ + T val; + + equal(T val_) { val = val_; } + + __host__ __device__ bool operator()(const T &x) + { + return (x == val); + } +}; + +struct print_functor +{ + __host__ __device__ void operator()(HYPRE_Real val) + { + printf("%f\n", val); + } +}; + +#endif // defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * sycl functions + * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + +#if defined(HYPRE_USING_SYCL) /* return the number of threads in block */ template -static __device__ __forceinline__ hypre_int hypre_cuda_get_num_threads() { - switch (dim) { - case 1: - return (blockDim.x); - case 2: - return (blockDim.x * blockDim.y); - case 3: - return (blockDim.x * blockDim.y * blockDim.z); - } - - return -1; +static __device__ __forceinline__ +hypre_int hypre_gpu_get_num_threads(hypre_DeviceItem &item) +{ + return static_cast(item.get_local_range().size()); } /* return the flattened thread id in block */ template -static __device__ __forceinline__ hypre_int hypre_cuda_get_thread_id() { - switch (dim) { - case 1: - return (threadIdx.x); - case 2: - return (threadIdx.y * blockDim.x + threadIdx.x); - case 3: - return (threadIdx.z * blockDim.x * blockDim.y + threadIdx.y * blockDim.x + threadIdx.x); - } - - return -1; +static __device__ __forceinline__ +hypre_int hypre_gpu_get_thread_id(hypre_DeviceItem &item) +{ + return static_cast(item.get_local_linear_id()); } /* return the number of warps in block */ template -static __device__ __forceinline__ hypre_int hypre_cuda_get_num_warps() { - return hypre_cuda_get_num_threads() >> HYPRE_WARP_BITSHIFT; +static __device__ __forceinline__ +hypre_int hypre_gpu_get_num_warps(hypre_DeviceItem &item) +{ + return hypre_gpu_get_num_threads(item) >> HYPRE_WARP_BITSHIFT; } /* return the warp id in block */ template -static __device__ __forceinline__ hypre_int hypre_cuda_get_warp_id() { - return hypre_cuda_get_thread_id() >> HYPRE_WARP_BITSHIFT; +static __device__ __forceinline__ +hypre_int hypre_gpu_get_warp_id(hypre_DeviceItem &item) +{ + return hypre_gpu_get_thread_id(item) >> HYPRE_WARP_BITSHIFT; } /* return the thread lane id in warp */ template -static __device__ __forceinline__ hypre_int hypre_cuda_get_lane_id() { - return hypre_cuda_get_thread_id() & (HYPRE_WARP_SIZE - 1); +static __device__ __forceinline__ +hypre_int hypre_gpu_get_lane_id(hypre_DeviceItem &item) +{ + return static_cast(item.get_sub_group().get_local_linear_id()); } /* return the num of blocks in grid */ template -static __device__ __forceinline__ hypre_int hypre_cuda_get_num_blocks() { - switch (dim) { - case 1: - return (gridDim.x); - case 2: - return (gridDim.x * gridDim.y); - case 3: - return (gridDim.x * gridDim.y * gridDim.z); - } - - return -1; +static __device__ __forceinline__ +hypre_int hypre_gpu_get_num_blocks(hypre_DeviceItem &item) +{ + return static_cast(item.get_group_range().size()); } /* return the flattened block id in grid */ template -static __device__ __forceinline__ hypre_int hypre_cuda_get_block_id() { - switch (dim) { - case 1: - return (blockIdx.x); - case 2: - return (blockIdx.y * gridDim.x + blockIdx.x); - case 3: - return (blockIdx.z * gridDim.x * gridDim.y + blockIdx.y * gridDim.x + blockIdx.x); - } - - return -1; +static __device__ __forceinline__ +hypre_int hypre_gpu_get_block_id(hypre_DeviceItem &item) +{ + return item.get_group_linear_id(); } /* return the number of threads in grid */ template -static __device__ __forceinline__ hypre_int hypre_cuda_get_grid_num_threads() { - return hypre_cuda_get_num_blocks() * hypre_cuda_get_num_threads(); +static __device__ __forceinline__ +hypre_int hypre_gpu_get_grid_num_threads(hypre_DeviceItem &item) +{ + return hypre_gpu_get_num_blocks(item) * hypre_gpu_get_num_threads(item); } /* return the flattened thread id in grid */ template -static __device__ __forceinline__ hypre_int hypre_cuda_get_grid_thread_id() { - return hypre_cuda_get_block_id() * hypre_cuda_get_num_threads() - + hypre_cuda_get_thread_id(); +static __device__ __forceinline__ +hypre_int hypre_gpu_get_grid_thread_id(hypre_DeviceItem &item) +{ + return hypre_gpu_get_block_id(item) * hypre_gpu_get_num_threads(item) + + hypre_gpu_get_thread_id(item); } /* return the number of warps in grid */ template -static __device__ __forceinline__ hypre_int hypre_cuda_get_grid_num_warps() { - return hypre_cuda_get_num_blocks() * hypre_cuda_get_num_warps(); +static __device__ __forceinline__ +hypre_int hypre_gpu_get_grid_num_warps(hypre_DeviceItem &item) +{ + return hypre_gpu_get_num_blocks(item) * hypre_gpu_get_num_warps(item); } -/* return the flattened warp id in grid */ +/* return the flattened warp id in nd_range */ template -static __device__ __forceinline__ hypre_int hypre_cuda_get_grid_warp_id() { - return hypre_cuda_get_block_id() * hypre_cuda_get_num_warps() - + hypre_cuda_get_warp_id(); +static __device__ __forceinline__ +hypre_int hypre_gpu_get_grid_warp_id(hypre_DeviceItem &item) +{ + return hypre_gpu_get_block_id(item) * hypre_gpu_get_num_warps(item) + + hypre_gpu_get_warp_id(item); } -#if defined(__CUDA_ARCH__) && __CUDA_ARCH__ < 600 -static __device__ __forceinline__ hypre_double atomicAdd(hypre_double *address, hypre_double val) { - hypre_ulonglongint *address_as_ull = (hypre_ulonglongint *) address; - hypre_ulonglongint old = *address_as_ull, assumed; +/* sync the thread block */ +static __device__ __forceinline__ +void block_sync(hypre_DeviceItem &item) +{ + sycl::group_barrier(item.get_group()); +} - do { - assumed = old; - old = atomicCAS(address_as_ull, assumed, __double_as_longlong(val + __longlong_as_double(assumed))); +/* sync the warp */ +static __device__ __forceinline__ +void warp_sync(hypre_DeviceItem &item) +{ + sycl::group_barrier(item.get_sub_group()); +} - // Note: uses integer comparison to avoid hang in case of NaN (since NaN != NaN) - } while (assumed != old); +/* exclusive prefix scan */ +template +static __device__ __forceinline__ +T warp_prefix_sum(hypre_DeviceItem &item, hypre_int lane_id, T in, T &all_sum) +{ +#pragma unroll + for (hypre_int d = 2; d <= HYPRE_WARP_SIZE; d <<= 1) + { + T t = sycl::shift_group_right(item.get_sub_group(), in, d >> 1); + if ( (lane_id & (d - 1)) == (d - 1) ) + { + in += t; + } + } + + all_sum = sycl::group_broadcast(item.get_sub_group(), in, HYPRE_WARP_SIZE - 1); + + if (lane_id == HYPRE_WARP_SIZE - 1) + { + in = 0; + } - return __longlong_as_double(old); +#pragma unroll + for (hypre_int d = HYPRE_WARP_SIZE >> 1; d > 0; d >>= 1) + { + T t = sycl::permute_group_by_xor(item.get_sub_group(), in, d); + + if ( (lane_id & (d - 1)) == (d - 1)) + { + if ( (lane_id & ((d << 1) - 1)) == ((d << 1) - 1) ) + { + in += t; + } + else + { + in = t; + } + } + } + return in; } -#endif -// There are no *_sync functions in HIP -#if defined(HYPRE_USING_HIP) || (CUDA_VERSION < 9000) +static __device__ __forceinline__ +hypre_mask hypre_ballot_sync(hypre_DeviceItem &item, hypre_mask mask, hypre_int predicate) +{ + return sycl::reduce_over_group( + item.get_sub_group(), + (mask & (0x1 << item.get_sub_group().get_local_linear_id())) && + predicate ? (0x1 << item.get_sub_group().get_local_linear_id()) : 0, + sycl::ext::oneapi::plus<>()); +} -template -static __device__ __forceinline__ T __shfl_sync(unsigned mask, T val, hypre_int src_line, - hypre_int width = HYPRE_WARP_SIZE) { - return __shfl(val, src_line, width); +static __device__ __forceinline__ +HYPRE_Int hypre_popc(hypre_mask mask) +{ + return (HYPRE_Int) sycl::popcount(mask); } -template -static __device__ __forceinline__ T __shfl_down_sync(unsigned mask, T val, unsigned delta, - hypre_int width = HYPRE_WARP_SIZE) { - return __shfl_down(val, delta, width); +static __device__ __forceinline__ +HYPRE_Int hypre_ffs(hypre_mask mask) +{ + return (HYPRE_Int)dpct::ffs(mask); } -template -static __device__ __forceinline__ T __shfl_xor_sync(unsigned mask, T val, unsigned lanemask, - hypre_int width = HYPRE_WARP_SIZE) { - return __shfl_xor(val, lanemask, width); +static __device__ __forceinline__ +hypre_int warp_any_sync(hypre_DeviceItem &item, hypre_mask mask, hypre_int predicate) +{ + return sycl::any_of_group(item.get_sub_group(), predicate); } template -static __device__ __forceinline__ T __shfl_up_sync(unsigned mask, T val, unsigned delta, - hypre_int width = HYPRE_WARP_SIZE) { - return __shfl_up(val, delta, width); +static __device__ __forceinline__ +T warp_shuffle_sync(hypre_DeviceItem &item, hypre_mask mask, T val, hypre_int src_line) +{ + return sycl::group_broadcast(item.get_sub_group(), val, src_line); } -static __device__ __forceinline__ void __syncwarp() {} - -#endif// #if defined(HYPRE_USING_HIP) || (CUDA_VERSION < 9000) - -// __any was technically deprecated in CUDA 7 so we don't bother -// with this overload for CUDA, just for HIP. -#if defined(HYPRE_USING_HIP) -static __device__ __forceinline__ hypre_int __any_sync(unsigned mask, hypre_int predicate) { - return __any(predicate); +template +static __device__ __forceinline__ +T warp_shuffle_sync(hypre_DeviceItem &item, hypre_mask mask, T val, hypre_int src_line, + hypre_int width) +{ + hypre_int lane_id = hypre_gpu_get_lane_id<1>(item); + hypre_int group_start = (lane_id / width) * width; + hypre_int src_in_warp = group_start + (src_line % width); + return sycl::select_from_group(item.get_sub_group(), val, src_in_warp); } -#endif template -static __device__ __forceinline__ T read_only_load(const T *ptr) { - return __ldg(ptr); +static __device__ __forceinline__ +T warp_shuffle_up_sync(hypre_DeviceItem &item, hypre_mask mask, T val, hypre_uint delta) +{ + return sycl::shift_group_right(item.get_sub_group(), val, delta); } -/* exclusive prefix scan */ template -static __device__ __forceinline__ T warp_prefix_sum(hypre_int lane_id, T in, T &all_sum) { -#pragma unroll - for (hypre_int d = 2; d <= HYPRE_WARP_SIZE; d <<= 1) { - T t = __shfl_up_sync(HYPRE_WARP_FULL_MASK, in, d >> 1); - if ((lane_id & (d - 1)) == (d - 1)) { in += t; } - } - - all_sum = __shfl_sync(HYPRE_WARP_FULL_MASK, in, HYPRE_WARP_SIZE - 1); - - if (lane_id == HYPRE_WARP_SIZE - 1) { in = 0; } - -#pragma unroll - for (hypre_int d = HYPRE_WARP_SIZE / 2; d > 0; d >>= 1) { - T t = __shfl_xor_sync(HYPRE_WARP_FULL_MASK, in, d); - - if ((lane_id & (d - 1)) == (d - 1)) { - if ((lane_id & ((d << 1) - 1)) == ((d << 1) - 1)) { - in += t; - } else { - in = t; - } - } - } - return in; +static __device__ __forceinline__ +T warp_shuffle_up_sync(hypre_DeviceItem &item, hypre_mask mask, T val, hypre_uint delta, + hypre_int width) +{ + hypre_int lane_id = hypre_gpu_get_lane_id<1>(item); + hypre_int group_start = (lane_id / width) * width; + hypre_int src_in_warp = lane_id - delta >= group_start ? lane_id - delta : lane_id; + return sycl::select_from_group(item.get_sub_group(), val, src_in_warp); } template -static __device__ __forceinline__ T warp_reduce_sum(T in) { -#pragma unroll - for (hypre_int d = HYPRE_WARP_SIZE / 2; d > 0; d >>= 1) { - in += __shfl_down_sync(HYPRE_WARP_FULL_MASK, in, d); - } - return in; +static __device__ __forceinline__ +T warp_shuffle_down_sync(hypre_DeviceItem &item, hypre_mask mask, T val, hypre_uint delta) +{ + return sycl::shift_group_left(item.get_sub_group(), val, delta); } template -static __device__ __forceinline__ T warp_allreduce_sum(T in) { -#pragma unroll - for (hypre_int d = HYPRE_WARP_SIZE / 2; d > 0; d >>= 1) { - in += __shfl_xor_sync(HYPRE_WARP_FULL_MASK, in, d); - } - return in; +static __device__ __forceinline__ +T warp_shuffle_down_sync(hypre_DeviceItem &item, hypre_mask mask, T val, hypre_uint delta, + hypre_int width) +{ + hypre_int lane_id = hypre_gpu_get_lane_id<1>(item); + hypre_int group_end = ((lane_id / width) + 1) * width - 1; + hypre_int src_in_warp = lane_id + delta <= group_end ? lane_id + delta : lane_id; + return sycl::select_from_group(item.get_sub_group(), val, src_in_warp); } template -static __device__ __forceinline__ T warp_reduce_max(T in) { -#pragma unroll - for (hypre_int d = HYPRE_WARP_SIZE / 2; d > 0; d >>= 1) { - in = max(in, __shfl_down_sync(HYPRE_WARP_FULL_MASK, in, d)); - } - return in; +static __device__ __forceinline__ +T warp_shuffle_xor_sync(hypre_DeviceItem &item, hypre_mask mask, T val, hypre_int lane_mask) +{ + return sycl::permute_group_by_xor(item.get_sub_group(), val, lane_mask); } template -static __device__ __forceinline__ T warp_allreduce_max(T in) { -#pragma unroll - for (hypre_int d = HYPRE_WARP_SIZE / 2; d > 0; d >>= 1) { - in = max(in, __shfl_xor_sync(HYPRE_WARP_FULL_MASK, in, d)); - } - return in; +static __device__ __forceinline__ +T warp_shuffle_xor_sync(hypre_DeviceItem &item, hypre_mask mask, T val, hypre_int lane_mask, + hypre_int width) +{ + hypre_int lane_id = hypre_gpu_get_lane_id<1>(item); + hypre_int group_end = ((lane_id / width) + 1) * width - 1; + hypre_int src_in_warp = lane_id ^ lane_mask; + src_in_warp = src_in_warp > group_end ? lane_id : src_in_warp; + return sycl::select_from_group(item.get_sub_group(), val, src_in_warp); } template -static __device__ __forceinline__ T warp_reduce_min(T in) { -#pragma unroll - for (hypre_int d = HYPRE_WARP_SIZE / 2; d > 0; d >>= 1) { - in = min(in, __shfl_down_sync(HYPRE_WARP_FULL_MASK, in, d)); - } - return in; +static __forceinline__ +T warp_reduce_sum(hypre_DeviceItem &item, T in) +{ + for (hypre_int d = HYPRE_WARP_SIZE >> 1; d > 0; d >>= 1) + { + in += sycl::shift_group_left(item.get_sub_group(), in, d); + } + return in; } template -static __device__ __forceinline__ T warp_allreduce_min(T in) { -#pragma unroll - for (hypre_int d = HYPRE_WARP_SIZE / 2; d > 0; d >>= 1) { - in = min(in, __shfl_xor_sync(HYPRE_WARP_FULL_MASK, in, d)); - } - return in; +static __forceinline__ +T warp_allreduce_sum(hypre_DeviceItem &item, T in) +{ + for (hypre_int d = HYPRE_WARP_SIZE >> 1; d > 0; d >>= 1) + { + in += sycl::permute_group_by_xor(item.get_sub_group(), in, d); + } + return in; } -static __device__ __forceinline__ hypre_int next_power_of_2(hypre_int n) { - if (n <= 0) { return 0; } - - /* if n is power of 2, return itself */ - if ((n & (n - 1)) == 0) { return n; } +template +static __forceinline__ +T warp_reduce_max(hypre_DeviceItem &item, T in) +{ + for (hypre_int d = HYPRE_WARP_SIZE >> 1; d > 0; d >>= 1) + { + in = std::max(in, sycl::shift_group_left(item.get_sub_group(), in, d)); + } + return in; +} - n |= (n >> 1); - n |= (n >> 2); - n |= (n >> 4); - n |= (n >> 8); - n |= (n >> 16); - n ^= (n >> 1); - n = (n << 1); +template +static __forceinline__ +T warp_allreduce_max(hypre_DeviceItem &item, T in) +{ + for (hypre_int d = HYPRE_WARP_SIZE >> 1; d > 0; d >>= 1) + { + in = std::max(in, sycl::permute_group_by_xor(item.get_sub_group(), in, d)); + } + return in; +} - return n; +template +static __forceinline__ +T warp_reduce_min(hypre_DeviceItem &item, T in) +{ + for (hypre_int d = HYPRE_WARP_SIZE >> 1; d > 0; d >>= 1) + { + in = std::min(in, sycl::shift_group_left(item.get_sub_group(), in, d)); + } + return in; } template -struct absolute_value : public thrust::unary_function { - __host__ __device__ T operator()(const T &x) const { return x < T(0) ? -x : x; } -}; +static __forceinline__ +T warp_allreduce_min(hypre_DeviceItem &item, T in) +{ + for (hypre_int d = HYPRE_WARP_SIZE >> 1; d > 0; d >>= 1) + { + in = std::min(in, sycl::permute_group_by_xor(item.get_sub_group(), in, d)); + } + return in; +} -template -struct TupleComp2 { - typedef thrust::tuple Tuple; +template +struct is_negative +{ + is_negative() {} - __host__ __device__ bool operator()(const Tuple &t1, const Tuple &t2) { - if (thrust::get<0>(t1) < thrust::get<0>(t2)) { return true; } - if (thrust::get<0>(t1) > thrust::get<0>(t2)) { return false; } - return hypre_abs(thrust::get<1>(t1)) > hypre_abs(thrust::get<1>(t2)); - } + constexpr bool operator()(const T &x = T()) const { return (x < 0); } }; -template -struct TupleComp3 { - typedef thrust::tuple Tuple; +template +struct is_positive +{ + is_positive() {} - __host__ __device__ bool operator()(const Tuple &t1, const Tuple &t2) { - if (thrust::get<0>(t1) < thrust::get<0>(t2)) { return true; } - if (thrust::get<0>(t1) > thrust::get<0>(t2)) { return false; } - if (thrust::get<0>(t2) == thrust::get<1>(t2)) { return false; } - return thrust::get<0>(t1) == thrust::get<1>(t1) || thrust::get<1>(t1) < thrust::get<1>(t2); - } + constexpr bool operator()(const T &x = T()) const { return (x > 0); } }; -template -struct is_negative : public thrust::unary_function { - __host__ __device__ bool operator()(const T &x) { return (x < 0); } -}; +template +struct is_nonnegative +{ + is_nonnegative() {} -template -struct is_positive : public thrust::unary_function { - __host__ __device__ bool operator()(const T &x) { return (x > 0); } + constexpr bool operator()(const T &x = T()) const { return (x >= 0); } }; -template -struct is_nonnegative : public thrust::unary_function { - __host__ __device__ bool operator()(const T &x) { return (x >= 0); } -}; +template +struct in_range +{ + T low, high; + in_range(T low_ = T(), T high_ = T()) { low = low_; high = high_; } -template -struct in_range : public thrust::unary_function { - T low, up; + constexpr bool operator()(const T &x) const { return (x >= low && x <= high); } +}; - in_range(T low_, T up_) { - low = low_; - up = up_; - } +template +struct out_of_range +{ + T low, high; + out_of_range(T low_ = T(), T high_ = T()) { low = low_; high = high_; } - __host__ __device__ bool operator()(const T &x) { return (x >= low && x <= up); } + constexpr bool operator()(const T &x) const { return (x < low || x > high); } }; -template -struct out_of_range : public thrust::unary_function { - T low, up; - - out_of_range(T low_, T up_) { - low = low_; - up = up_; - } +template +struct less_than +{ + T val; + less_than(T val_ = T()) { val = val_; } - __host__ __device__ bool operator()(const T &x) { return (x < low || x > up); } + constexpr bool operator()(const T &x) const { return (x < val); } }; -template -struct less_than : public thrust::unary_function { - T val; - - less_than(T val_) { val = val_; } +template +struct modulo +{ + T val; + modulo(T val_ = T()) { val = val_; } - __host__ __device__ bool operator()(const T &x) { return (x < val); } + constexpr T operator()(const T &x) const { return (x % val); } }; -template -struct modulo : public thrust::unary_function { - T val; - - modulo(T val_) { val = val_; } +template +struct equal +{ + T val; + equal(T val_ = T()) { val = val_; } - __host__ __device__ T operator()(const T &x) { return (x % val); } + constexpr bool operator()(const T &x) const { return (x == val); } }; -template -struct equal : public thrust::unary_function { - T val; +template +struct type_cast +{ + constexpr T2 operator()(const T1 &x = T1()) const { return (T2) x; } +}; - equal(T val_) { val = val_; } +template +struct absolute_value +{ + constexpr T operator()(const T &x) const { return x < T(0) ? -x : x; } +}; - __host__ __device__ bool operator()(const T &x) { return (x == val); } +template +struct TupleComp2 +{ + typedef std::tuple Tuple; + bool operator()(const Tuple& t1, const Tuple& t2) + { + if (std::get<0>(t1) < std::get<0>(t2)) + { + return true; + } + if (std::get<0>(t1) > std::get<0>(t2)) + { + return false; + } + return hypre_abs(std::get<1>(t1)) > hypre_abs(std::get<1>(t2)); + } }; -struct print_functor { - __host__ __device__ void operator()(HYPRE_Real val) { printf("%f\n", val); } +template +struct TupleComp3 +{ + typedef std::tuple Tuple; + bool operator()(const Tuple& t1, const Tuple& t2) + { + if (std::get<0>(t1) < std::get<0>(t2)) + { + return true; + } + if (std::get<0>(t1) > std::get<0>(t2)) + { + return false; + } + if (std::get<0>(t2) == std::get<1>(t2)) + { + return false; + } + return std::get<0>(t1) == std::get<1>(t1) || std::get<1>(t1) < std::get<1>(t2); + } }; -/* cuda_utils.c */ -dim3 hypre_GetDefaultCUDABlockDimension(); +#endif // #if defined(HYPRE_USING_SYCL) + +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * end of functions defined here + * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + +/* device_utils.c */ +#if defined(HYPRE_USING_GPU) +dim3 hypre_GetDefaultDeviceBlockDimension(); + +dim3 hypre_GetDefaultDeviceGridDimension( HYPRE_Int n, const char *granularity, dim3 bDim ); -dim3 hypre_GetDefaultCUDAGridDimension(HYPRE_Int n, const char *granularity, dim3 bDim); +dim3 hypre_dim3(HYPRE_Int x); +dim3 hypre_dim3(HYPRE_Int x, HYPRE_Int y); +dim3 hypre_dim3(HYPRE_Int x, HYPRE_Int y, HYPRE_Int z); template -HYPRE_Int hypreDevice_StableSortByTupleKey(HYPRE_Int N, T1 *keys1, T2 *keys2, T3 *vals, HYPRE_Int opt); +HYPRE_Int hypreDevice_StableSortByTupleKey(HYPRE_Int N, T1 *keys1, T2 *keys2, + T3 *vals, HYPRE_Int opt); template -HYPRE_Int hypreDevice_StableSortTupleByTupleKey(HYPRE_Int N, T1 *keys1, T2 *keys2, T3 *vals1, T4 *vals2, - HYPRE_Int opt); +HYPRE_Int hypreDevice_StableSortTupleByTupleKey(HYPRE_Int N, T1 *keys1, T2 *keys2, + T3 *vals1, T4 *vals2, HYPRE_Int opt); template -HYPRE_Int hypreDevice_ReduceByTupleKey(HYPRE_Int N, T1 *keys1_in, T2 *keys2_in, T3 *vals_in, T1 *keys1_out, - T2 *keys2_out, T3 *vals_out); - -template -HYPRE_Int hypreDevice_CsrRowPtrsToIndicesWithRowNum(HYPRE_Int nrows, HYPRE_Int nnz, HYPRE_Int *d_row_ptr, - T *d_row_num, T *d_row_ind); +HYPRE_Int hypreDevice_ReduceByTupleKey(HYPRE_Int N, T1 *keys1_in, T2 *keys2_in, + T3 *vals_in, T1 *keys1_out, T2 *keys2_out, + T3 *vals_out); template HYPRE_Int hypreDevice_ScatterConstant(T *x, HYPRE_Int n, HYPRE_Int *map, T v); -HYPRE_Int hypreDevice_GetRowNnz(HYPRE_Int nrows, HYPRE_Int *d_row_indices, HYPRE_Int *d_diag_ia, - HYPRE_Int *d_offd_ia, HYPRE_Int *d_rownnz); - -HYPRE_Int hypreDevice_CopyParCSRRows(HYPRE_Int nrows, HYPRE_Int *d_row_indices, HYPRE_Int job, - HYPRE_Int has_offd, HYPRE_BigInt first_col, - HYPRE_BigInt *d_col_map_offd_A, HYPRE_Int *d_diag_i, HYPRE_Int *d_diag_j, - HYPRE_Complex *d_diag_a, HYPRE_Int *d_offd_i, HYPRE_Int *d_offd_j, - HYPRE_Complex *d_offd_a, HYPRE_Int *d_ib, HYPRE_BigInt *d_jb, - HYPRE_Complex *d_ab); - -HYPRE_Int hypreDevice_IntegerReduceSum(HYPRE_Int m, HYPRE_Int *d_i); - -HYPRE_Int hypreDevice_IntegerInclusiveScan(HYPRE_Int n, HYPRE_Int *d_i); - -HYPRE_Int hypreDevice_IntegerExclusiveScan(HYPRE_Int n, HYPRE_Int *d_i); - -HYPRE_Int *hypreDevice_CsrRowPtrsToIndices(HYPRE_Int nrows, HYPRE_Int nnz, HYPRE_Int *d_row_ptr); +HYPRE_Int hypreDevice_GenScatterAdd(HYPRE_Real *x, HYPRE_Int ny, HYPRE_Int *map, + HYPRE_Real *y, char *work); -HYPRE_Int hypreDevice_CsrRowPtrsToIndices_v2(HYPRE_Int nrows, HYPRE_Int nnz, HYPRE_Int *d_row_ptr, - HYPRE_Int *d_row_ind); - -HYPRE_Int *hypreDevice_CsrRowIndicesToPtrs(HYPRE_Int nrows, HYPRE_Int nnz, HYPRE_Int *d_row_ind); - -HYPRE_Int hypreDevice_CsrRowIndicesToPtrs_v2(HYPRE_Int nrows, HYPRE_Int nnz, HYPRE_Int *d_row_ind, - HYPRE_Int *d_row_ptr); - -HYPRE_Int hypreDevice_GenScatterAdd(HYPRE_Real *x, HYPRE_Int ny, HYPRE_Int *map, HYPRE_Real *y, char *work); +template +HYPRE_Int hypreDevice_CsrRowPtrsToIndicesWithRowNum(HYPRE_Int nrows, HYPRE_Int nnz, + HYPRE_Int *d_row_ptr, T *d_row_num, T *d_row_ind); -HYPRE_Int hypreDevice_BigToSmallCopy(HYPRE_Int *tgt, const HYPRE_BigInt *src, HYPRE_Int size); +#endif -void hypre_CudaCompileFlagCheck(); +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) #if defined(HYPRE_USING_CUDA) cudaError_t hypre_CachingMallocDevice(void **ptr, size_t nbytes); @@ -848,26 +2238,27 @@ cudaError_t hypre_CachingFreeDevice(void *ptr); cudaError_t hypre_CachingFreeManaged(void *ptr); #endif -hypre_cub_CachingDeviceAllocator * -hypre_CudaDataCubCachingAllocatorCreate(hypre_uint bin_growth, hypre_uint min_bin, hypre_uint max_bin, - size_t max_cached_bytes, bool skip_cleanup, bool debug, - bool use_managed_memory); +hypre_cub_CachingDeviceAllocator * hypre_DeviceDataCubCachingAllocatorCreate(hypre_uint bin_growth, + hypre_uint min_bin, hypre_uint max_bin, size_t max_cached_bytes, bool skip_cleanup, bool debug, + bool use_managed_memory); -void hypre_CudaDataCubCachingAllocatorDestroy(hypre_CudaData *data); +void hypre_DeviceDataCubCachingAllocatorDestroy(hypre_DeviceData *data); -#endif// #if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#endif // #if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) #if defined(HYPRE_USING_CUSPARSE) cudaDataType hypre_HYPREComplexToCudaDataType(); +#if CUSPARSE_VERSION >= CUSPARSE_NEWAPI_VERSION cusparseIndexType_t hypre_HYPREIntToCusparseIndexType(); +#endif -#endif// #if defined(HYPRE_USING_CUSPARSE) +#endif // #if defined(HYPRE_USING_CUSPARSE) #endif /* #ifndef HYPRE_CUDA_UTILS_H */ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -881,203 +2272,285 @@ cusparseIndexType_t hypre_HYPREIntToCusparseIndexType(); #if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) #if !defined(HYPRE_USING_RAJA) && !defined(HYPRE_USING_KOKKOS) -template -void OneBlockReduce(T *d_arr, HYPRE_Int N, T *h_out); - -struct HYPRE_double4 { - HYPRE_Real x, y, z, w; - - __host__ __device__ HYPRE_double4() {} - - __host__ __device__ HYPRE_double4(HYPRE_Real x1, HYPRE_Real x2, HYPRE_Real x3, HYPRE_Real x4) { - x = x1; - y = x2; - z = x3; - w = x4; - } - - __host__ __device__ void operator=(HYPRE_Real val) { x = y = z = w = val; } +template void OneBlockReduce(T *d_arr, HYPRE_Int N, T *h_out); + +struct HYPRE_double4 +{ + HYPRE_Real x, y, z, w; + + __host__ __device__ + HYPRE_double4() {} + + __host__ __device__ + HYPRE_double4(HYPRE_Real x1, HYPRE_Real x2, HYPRE_Real x3, HYPRE_Real x4) + { + x = x1; + y = x2; + z = x3; + w = x4; + } + + __host__ __device__ + void operator=(HYPRE_Real val) + { + x = y = z = w = val; + } + + __host__ __device__ + void operator+=(HYPRE_double4 rhs) + { + x += rhs.x; + y += rhs.y; + z += rhs.z; + w += rhs.w; + } - __host__ __device__ void operator+=(HYPRE_double4 rhs) { - x += rhs.x; - y += rhs.y; - z += rhs.z; - w += rhs.w; - } }; -struct HYPRE_double6 { - HYPRE_Real x, y, z, w, u, v; - - __host__ __device__ HYPRE_double6() {} - - __host__ __device__ HYPRE_double6(HYPRE_Real x1, HYPRE_Real x2, HYPRE_Real x3, HYPRE_Real x4, - HYPRE_Real x5, HYPRE_Real x6) { - x = x1; - y = x2; - z = x3; - w = x4; - u = x5; - v = x6; - } - - __host__ __device__ void operator=(HYPRE_Real val) { x = y = z = w = u = v = val; } +struct HYPRE_double6 +{ + HYPRE_Real x, y, z, w, u, v; + + __host__ __device__ + HYPRE_double6() {} + + __host__ __device__ + HYPRE_double6(HYPRE_Real x1, HYPRE_Real x2, HYPRE_Real x3, HYPRE_Real x4, + HYPRE_Real x5, HYPRE_Real x6) + { + x = x1; + y = x2; + z = x3; + w = x4; + u = x5; + v = x6; + } + + __host__ __device__ + void operator=(HYPRE_Real val) + { + x = y = z = w = u = v = val; + } + + __host__ __device__ + void operator+=(HYPRE_double6 rhs) + { + x += rhs.x; + y += rhs.y; + z += rhs.z; + w += rhs.w; + u += rhs.u; + v += rhs.v; + } - __host__ __device__ void operator+=(HYPRE_double6 rhs) { - x += rhs.x; - y += rhs.y; - z += rhs.z; - w += rhs.w; - u += rhs.u; - v += rhs.v; - } }; /* reduction within a warp */ -__inline__ __host__ __device__ HYPRE_Real warpReduceSum(HYPRE_Real val) { +__inline__ __host__ __device__ +HYPRE_Real warpReduceSum(HYPRE_Real val) +{ #if defined(__CUDA_ARCH__) || defined(__HIP_DEVICE_COMPILE__) - for (HYPRE_Int offset = warpSize / 2; offset > 0; offset /= 2) { - val += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val, offset); - } + for (HYPRE_Int offset = warpSize / 2; offset > 0; offset /= 2) + { + val += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val, offset); + } #endif - return val; + return val; } -__inline__ __host__ __device__ HYPRE_double4 warpReduceSum(HYPRE_double4 val) { +__inline__ __host__ __device__ +HYPRE_double4 warpReduceSum(HYPRE_double4 val) +{ #if defined(__CUDA_ARCH__) || defined(__HIP_DEVICE_COMPILE__) - for (HYPRE_Int offset = warpSize / 2; offset > 0; offset /= 2) { - val.x += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.x, offset); - val.y += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.y, offset); - val.z += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.z, offset); - val.w += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.w, offset); - } + for (HYPRE_Int offset = warpSize / 2; offset > 0; offset /= 2) + { + val.x += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.x, offset); + val.y += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.y, offset); + val.z += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.z, offset); + val.w += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.w, offset); + } #endif - return val; + return val; } -__inline__ __host__ __device__ HYPRE_double6 warpReduceSum(HYPRE_double6 val) { +__inline__ __host__ __device__ +HYPRE_double6 warpReduceSum(HYPRE_double6 val) +{ #if defined(__CUDA_ARCH__) || defined(__HIP_DEVICE_COMPILE__) - for (HYPRE_Int offset = warpSize / 2; offset > 0; offset /= 2) { - val.x += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.x, offset); - val.y += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.y, offset); - val.z += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.z, offset); - val.w += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.w, offset); - val.u += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.u, offset); - val.v += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.v, offset); - } + for (HYPRE_Int offset = warpSize / 2; offset > 0; offset /= 2) + { + val.x += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.x, offset); + val.y += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.y, offset); + val.z += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.z, offset); + val.w += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.w, offset); + val.u += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.u, offset); + val.v += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.v, offset); + } #endif - return val; + return val; } /* reduction within a block */ template -__inline__ __host__ __device__ T blockReduceSum(T val) { +__inline__ __host__ __device__ +T blockReduceSum(T val) +{ #if defined(__CUDA_ARCH__) || defined(__HIP_DEVICE_COMPILE__) - //static __shared__ T shared[HYPRE_WARP_SIZE]; // Shared mem for HYPRE_WARP_SIZE partial sums - - __shared__ T shared[HYPRE_WARP_SIZE];// Shared mem for HYPRE_WARP_SIZE partial sums - - //HYPRE_Int lane = threadIdx.x % warpSize; - //HYPRE_Int wid = threadIdx.x / warpSize; - HYPRE_Int lane = threadIdx.x & (warpSize - 1); - HYPRE_Int wid = threadIdx.x >> HYPRE_WARP_BITSHIFT; + // Shared mem for HYPRE_WARP_SIZE partial sums + __shared__ T shared[HYPRE_WARP_SIZE]; + + HYPRE_Int lane = threadIdx.x & (warpSize - 1); + HYPRE_Int wid = threadIdx.x >> HYPRE_WARP_BITSHIFT; + + // Each warp performs partial reduction + val = warpReduceSum(val); + + // Write reduced value to shared memory + if (lane == 0) + { + shared[wid] = val; + } + + // Wait for all partial reductions + __syncthreads(); + + // read from shared memory only if that warp existed + if (threadIdx.x < (blockDim.x >> HYPRE_WARP_BITSHIFT)) + { + val = shared[lane]; + } + else + { + val = 0.0; + } + + // Final reduce within first warp + if (wid == 0) + { + val = warpReduceSum(val); + } - val = warpReduceSum(val);// Each warp performs partial reduction - - if (lane == 0) { - shared[wid] = val;// Write reduced value to shared memory - } +#endif + return val; +} - __syncthreads();// Wait for all partial reductions +template +__global__ void +OneBlockReduceKernel(hypre_DeviceItem &item, + T *arr, + HYPRE_Int N) +{ + T sum; - //read from shared memory only if that warp existed - if (threadIdx.x < blockDim.x / warpSize) { - val = shared[lane]; - } else { - val = 0.0; - } + sum = 0.0; - if (wid == 0) { - val = warpReduceSum(val);//Final reduce within first warp - } + if (threadIdx.x < N) + { + sum = arr[threadIdx.x]; + } -#endif - return val; -} + sum = blockReduceSum(sum); -template -__global__ void OneBlockReduceKernel(T *arr, HYPRE_Int N) { - T sum; - sum = 0.0; - if (threadIdx.x < N) { sum = arr[threadIdx.x]; } - sum = blockReduceSum(sum); - if (threadIdx.x == 0) { arr[0] = sum; } + if (threadIdx.x == 0) + { + arr[0] = sum; + } } /* Reducer class */ template -struct ReduceSum { - using value_type = T; +struct ReduceSum +{ + using value_type = T; - T init; /* initial value passed in */ - mutable T __thread_sum; /* place to hold local sum of a thread, + T init; /* initial value passed in */ + mutable T __thread_sum; /* place to hold local sum of a thread, and partial sum of a block */ - T *d_buf; /* place to store partial sum within blocks + T *d_buf; /* place to store partial sum within blocks in the 1st round, used in the 2nd round */ - HYPRE_Int nblocks; /* number of blocks used in the 1st round */ + HYPRE_Int nblocks; /* number of blocks used in the 1st round */ - /* constructor + /* constructor * val is the initial value (added to the reduced sum) */ - __host__ ReduceSum(T val) { - init = val; - __thread_sum = 0.0; - nblocks = -1; - - if (hypre_HandleCudaReduceBuffer(hypre_handle()) == NULL) { - /* allocate for the max size for reducing double6 type */ - hypre_HandleCudaReduceBuffer(hypre_handle()) - = hypre_TAlloc(HYPRE_double6, 1024, HYPRE_MEMORY_DEVICE); - } - - d_buf = (T *) hypre_HandleCudaReduceBuffer(hypre_handle()); - } - - /* copy constructor */ - __host__ __device__ ReduceSum(const ReduceSum &other) { *this = other; } - - /* reduction within blocks */ - __host__ __device__ void BlockReduce() const { + __host__ + ReduceSum(T val) + { + init = val; + __thread_sum = 0.0; + nblocks = -1; + } + + /* copy constructor */ + __host__ __device__ + ReduceSum(const ReduceSum& other) + { + *this = other; + } + + __host__ void + Allocate2ndPhaseBuffer() + { + if (hypre_HandleReduceBuffer(hypre_handle()) == NULL) + { + /* allocate for the max size for reducing double6 type */ + hypre_HandleReduceBuffer(hypre_handle()) = + hypre_TAlloc(HYPRE_double6, HYPRE_MAX_NTHREADS_BLOCK, HYPRE_MEMORY_DEVICE); + } + + d_buf = (T*) hypre_HandleReduceBuffer(hypre_handle()); + } + + /* reduction within blocks */ + __host__ __device__ + void BlockReduce() const + { #if defined(__CUDA_ARCH__) || defined(__HIP_DEVICE_COMPILE__) - __thread_sum = blockReduceSum(__thread_sum); - if (threadIdx.x == 0) { d_buf[blockIdx.x] = __thread_sum; } + __thread_sum = blockReduceSum(__thread_sum); + if (threadIdx.x == 0) + { + d_buf[blockIdx.x] = __thread_sum; + } #endif - } - - __host__ __device__ void operator+=(T val) const { __thread_sum += val; } - - /* invoke the 2nd reduction at the time want the sum from the reducer */ - __host__ operator T() { - T val; - - HYPRE_ExecutionPolicy exec_policy = hypre_HandleStructExecPolicy(hypre_handle()); - - if (exec_policy == HYPRE_EXEC_HOST) { - val = __thread_sum; - val += init; - } else { - /* 2nd reduction with only *one* block */ - hypre_assert(nblocks >= 0 && nblocks <= 1024); - const dim3 gDim(1), bDim(1024); - HYPRE_CUDA_LAUNCH(OneBlockReduceKernel, gDim, bDim, d_buf, nblocks); - hypre_TMemcpy(&val, d_buf, T, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); - val += init; - } - - return val; - } - - /* destructor */ - __host__ __device__ ~ReduceSum() {} + } + + __host__ __device__ + void operator+=(T val) const + { + __thread_sum += val; + } + + /* invoke the 2nd reduction at the time want the sum from the reducer */ + __host__ + operator T() + { + T val; + + const HYPRE_MemoryLocation memory_location = hypre_HandleMemoryLocation(hypre_handle()); + const HYPRE_ExecutionPolicy exec_policy = hypre_GetExecPolicy1(memory_location); + + if (exec_policy == HYPRE_EXEC_HOST) + { + val = __thread_sum; + val += init; + } + else + { + /* 2nd reduction with only *one* block */ + hypre_assert(nblocks >= 0 && nblocks <= HYPRE_MAX_NTHREADS_BLOCK); + const dim3 gDim(1), bDim(HYPRE_MAX_NTHREADS_BLOCK); + HYPRE_GPU_LAUNCH( OneBlockReduceKernel, gDim, bDim, d_buf, nblocks ); + hypre_TMemcpy(&val, d_buf, T, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); + val += init; + } + + return val; + } + + /* destructor */ + __host__ __device__ + ~ReduceSum() + { + } }; #endif /* #if !defined(HYPRE_USING_RAJA) && !defined(HYPRE_USING_KOKKOS) */ @@ -1121,27 +2594,27 @@ struct ReduceSum { #if defined(HYPRE_USING_CUDA) && defined(HYPRE_USING_DEVICE_POOL) -#include #include +#include #if (__cplusplus > 199711L) || (defined(_MSC_VER) && _MSC_VER >= 1800) -#include + #include #else -#if defined(_WIN32) || defined(_WIN64) -#include + #if defined(_WIN32) || defined(_WIN64) + #include -#define WIN32_LEAN_AND_MEAN -#define NOMINMAX -#include -#undef WIN32_LEAN_AND_MEAN -#undef NOMINMAX + #define WIN32_LEAN_AND_MEAN + #define NOMINMAX + #include + #undef WIN32_LEAN_AND_MEAN + #undef NOMINMAX -/** + /** * Compiler read/write barrier */ -#pragma intrinsic(_ReadWriteBarrier) + #pragma intrinsic(_ReadWriteBarrier) -#endif + #endif #endif /** @@ -1149,78 +2622,98 @@ struct ReduceSum { * - Wraps std::mutex when compiled with C++11 or newer (supported on all platforms) * - Uses GNU/Windows spinlock mechanisms for pre C++11 (supported on x86/x64 when compiled with cl.exe or g++) */ -struct hypre_cub_Mutex { +struct hypre_cub_Mutex +{ #if (__cplusplus > 199711L) || (defined(_MSC_VER) && _MSC_VER >= 1800) std::mutex mtx; - void Lock() { mtx.lock(); } + void Lock() + { + mtx.lock(); + } - void Unlock() { mtx.unlock(); } + void Unlock() + { + mtx.unlock(); + } - void TryLock() { mtx.try_lock(); } + void TryLock() + { + mtx.try_lock(); + } -#else//__cplusplus > 199711L +#else //__cplusplus > 199711L -#if defined(_MSC_VER) + #if defined(_MSC_VER) - // Microsoft VC++ - typedef hypre_longint Spinlock; + // Microsoft VC++ + typedef hypre_longint Spinlock; -#else + #else - // GNU g++ - typedef hypre_int Spinlock; + // GNU g++ + typedef hypre_int Spinlock; - /** + /** * Compiler read/write barrier */ - __forceinline__ void _ReadWriteBarrier() { __sync_synchronize(); } + __forceinline__ void _ReadWriteBarrier() + { + __sync_synchronize(); + } - /** + /** * Atomic exchange */ - __forceinline__ hypre_longint _InterlockedExchange(volatile hypre_int *const Target, - const hypre_int Value) { - // NOTE: __sync_lock_test_and_set would be an acquire barrier, so we force a full barrier - _ReadWriteBarrier(); - return __sync_lock_test_and_set(Target, Value); - } + __forceinline__ hypre_longint _InterlockedExchange(volatile hypre_int * const Target, const hypre_int Value) + { + // NOTE: __sync_lock_test_and_set would be an acquire barrier, so we force a full barrier + _ReadWriteBarrier(); + return __sync_lock_test_and_set(Target, Value); + } - /** + /** * Pause instruction to prevent excess processor bus usage */ - __forceinline__ void YieldProcessor() {} + __forceinline__ void YieldProcessor() + { + } -#endif// defined(_MSC_VER) + #endif // defined(_MSC_VER) - /// Lock member - volatile Spinlock lock; + /// Lock member + volatile Spinlock lock; - /** + /** * Constructor */ - hypre_cub_Mutex() : lock(0) {} + hypre_cub_Mutex() : lock(0) {} - /** + /** * Return when the specified spinlock has been acquired */ - __forceinline__ void Lock() { - while (1) { - if (!_InterlockedExchange(&lock, 1)) return; - while (lock) YieldProcessor(); + __forceinline__ void Lock() + { + while (1) + { + if (!_InterlockedExchange(&lock, 1)) return; + while (lock) YieldProcessor(); + } } - } - /** + + /** * Release the specified spinlock */ - __forceinline__ void Unlock() { - _ReadWriteBarrier(); - lock = 0; - } + __forceinline__ void Unlock() + { + _ReadWriteBarrier(); + lock = 0; + } + +#endif // __cplusplus > 199711L -#endif// __cplusplus > 199711L }; #include @@ -1268,169 +2761,204 @@ struct hypre_cub_Mutex { * and sets a maximum of 6,291,455 cached bytes per device * */ -struct hypre_cub_CachingDeviceAllocator { - typedef char value_type; +struct hypre_cub_CachingDeviceAllocator +{ + typedef char value_type; - //--------------------------------------------------------------------- - // Constants - //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + // Constants + //--------------------------------------------------------------------- - /// Out-of-bounds bin - static const hypre_uint INVALID_BIN = (hypre_uint) -1; + /// Out-of-bounds bin + static const hypre_uint INVALID_BIN = (hypre_uint) -1; - /// Invalid size - static const size_t INVALID_SIZE = (size_t) -1; + /// Invalid size + static const size_t INVALID_SIZE = (size_t) -1; - /// Invalid device ordinal - static const hypre_int INVALID_DEVICE_ORDINAL = -1; + /// Invalid device ordinal + static const hypre_int INVALID_DEVICE_ORDINAL = -1; - //--------------------------------------------------------------------- - // Type definitions and helper types - //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + // Type definitions and helper types + //--------------------------------------------------------------------- - /** + /** * Descriptor for device memory allocations */ - struct BlockDescriptor { - void *d_ptr; // Device pointer - size_t bytes; // Size of allocation in bytes - hypre_uint bin; // Bin enumeration - hypre_int device; // device ordinal - cudaStream_t associated_stream;// Associated associated_stream - cudaEvent_t - ready_event;// Signal when associated stream has run to the point at which this block was freed - - // Constructor (suitable for searching maps for a specific block, given its pointer and device) - BlockDescriptor(void *d_ptr, hypre_int device) - : d_ptr(d_ptr), bytes(0), bin(INVALID_BIN), device(device), associated_stream(0), ready_event(0) { - } - - // Constructor (suitable for searching maps for a range of suitable blocks, given a device) - BlockDescriptor(hypre_int device) - : d_ptr(NULL), bytes(0), bin(INVALID_BIN), device(device), associated_stream(0), ready_event(0) {} - - // Comparison functor for comparing device pointers - static bool PtrCompare(const BlockDescriptor &a, const BlockDescriptor &b) { - if (a.device == b.device) return (a.d_ptr < b.d_ptr); - else - return (a.device < b.device); - } - - // Comparison functor for comparing allocation sizes - static bool SizeCompare(const BlockDescriptor &a, const BlockDescriptor &b) { - if (a.device == b.device) return (a.bytes < b.bytes); - else - return (a.device < b.device); - } - }; - - /// BlockDescriptor comparator function interface - typedef bool (*Compare)(const BlockDescriptor &, const BlockDescriptor &); - - class TotalBytes { - public: - size_t free; - size_t live; - TotalBytes() { free = live = 0; } - }; - - /// Set type for cached blocks (ordered by size) - typedef std::multiset CachedBlocks; - - /// Set type for live blocks (ordered by ptr) - typedef std::multiset BusyBlocks; - - /// Map type of device ordinals to the number of cached bytes cached by each device - typedef std::map GpuCachedBytes; - - //--------------------------------------------------------------------- - // Utility functions - //--------------------------------------------------------------------- - - /** + struct BlockDescriptor + { + void* d_ptr; // Device pointer + size_t bytes; // Size of allocation in bytes + hypre_uint bin; // Bin enumeration + hypre_int device; // device ordinal + cudaStream_t associated_stream; // Associated associated_stream + cudaEvent_t ready_event; // Signal when associated stream has run to the point at which this block was freed + + // Constructor (suitable for searching maps for a specific block, given its pointer and device) + BlockDescriptor(void *d_ptr, hypre_int device) : + d_ptr(d_ptr), + bytes(0), + bin(INVALID_BIN), + device(device), + associated_stream(0), + ready_event(0) + {} + + // Constructor (suitable for searching maps for a range of suitable blocks, given a device) + BlockDescriptor(hypre_int device) : + d_ptr(NULL), + bytes(0), + bin(INVALID_BIN), + device(device), + associated_stream(0), + ready_event(0) + {} + + // Comparison functor for comparing device pointers + static bool PtrCompare(const BlockDescriptor &a, const BlockDescriptor &b) + { + if (a.device == b.device) + return (a.d_ptr < b.d_ptr); + else + return (a.device < b.device); + } + + // Comparison functor for comparing allocation sizes + static bool SizeCompare(const BlockDescriptor &a, const BlockDescriptor &b) + { + if (a.device == b.device) + return (a.bytes < b.bytes); + else + return (a.device < b.device); + } + }; + + /// BlockDescriptor comparator function interface + typedef bool (*Compare)(const BlockDescriptor &, const BlockDescriptor &); + + class TotalBytes { + public: + size_t free; + size_t live; + TotalBytes() { free = live = 0; } + }; + + /// Set type for cached blocks (ordered by size) + typedef std::multiset CachedBlocks; + + /// Set type for live blocks (ordered by ptr) + typedef std::multiset BusyBlocks; + + /// Map type of device ordinals to the number of cached bytes cached by each device + typedef std::map GpuCachedBytes; + + + //--------------------------------------------------------------------- + // Utility functions + //--------------------------------------------------------------------- + + /** * Integer pow function for unsigned base and exponent */ - static hypre_uint IntPow(hypre_uint base, hypre_uint exp) { - hypre_uint retval = 1; - while (exp > 0) { - if (exp & 1) { - retval = retval * base;// multiply the result by the current base - } - base = base * base;// square the base - exp = exp >> 1; // divide the exponent in half - } - return retval; - } - - /** + static hypre_uint IntPow( + hypre_uint base, + hypre_uint exp) + { + hypre_uint retval = 1; + while (exp > 0) + { + if (exp & 1) { + retval = retval * base; // multiply the result by the current base + } + base = base * base; // square the base + exp = exp >> 1; // divide the exponent in half + } + return retval; + } + + + /** * Round up to the nearest power-of */ - void NearestPowerOf(hypre_uint &power, size_t &rounded_bytes, hypre_uint base, size_t value) { - power = 0; - rounded_bytes = 1; - - if (value * base < value) { - // Overflow - power = sizeof(size_t) * 8; - rounded_bytes = size_t(0) - 1; - return; - } - - while (rounded_bytes < value) { - rounded_bytes *= base; - power++; - } - } - - //--------------------------------------------------------------------- - // Fields - //--------------------------------------------------------------------- - - hypre_cub_Mutex mutex;/// Mutex for thread-safety - - hypre_uint bin_growth;/// Geometric growth factor for bin-sizes - hypre_uint min_bin; /// Minimum bin enumeration - hypre_uint max_bin; /// Maximum bin enumeration - - size_t min_bin_bytes; /// Minimum bin size - size_t max_bin_bytes; /// Maximum bin size - size_t max_cached_bytes;/// Maximum aggregate cached bytes per device - - const bool - skip_cleanup;/// Whether or not to skip a call to FreeAllCached() when destructor is called. (The CUDA runtime may have already shut down for statically declared allocators) - bool debug; /// Whether or not to print (de)allocation events to stdout - - GpuCachedBytes cached_bytes;/// Map of device ordinal to aggregate cached bytes on that device - CachedBlocks cached_blocks; /// Set of cached device allocations available for reuse - BusyBlocks live_blocks; /// Set of live device allocations currently in use - - bool use_managed_memory;/// Whether to use managed memory or device memory - - //--------------------------------------------------------------------- - // Methods - //--------------------------------------------------------------------- - - /** + void NearestPowerOf( + hypre_uint &power, + size_t &rounded_bytes, + hypre_uint base, + size_t value) + { + power = 0; + rounded_bytes = 1; + + if (value * base < value) + { + // Overflow + power = sizeof(size_t) * 8; + rounded_bytes = size_t(0) - 1; + return; + } + + while (rounded_bytes < value) + { + rounded_bytes *= base; + power++; + } + } + + + //--------------------------------------------------------------------- + // Fields + //--------------------------------------------------------------------- + + hypre_cub_Mutex mutex; /// Mutex for thread-safety + + hypre_uint bin_growth; /// Geometric growth factor for bin-sizes + hypre_uint min_bin; /// Minimum bin enumeration + hypre_uint max_bin; /// Maximum bin enumeration + + size_t min_bin_bytes; /// Minimum bin size + size_t max_bin_bytes; /// Maximum bin size + size_t max_cached_bytes; /// Maximum aggregate cached bytes per device + + const bool skip_cleanup; /// Whether or not to skip a call to FreeAllCached() when destructor is called. (The CUDA runtime may have already shut down for statically declared allocators) + bool debug; /// Whether or not to print (de)allocation events to stdout + + GpuCachedBytes cached_bytes; /// Map of device ordinal to aggregate cached bytes on that device + CachedBlocks cached_blocks; /// Set of cached device allocations available for reuse + BusyBlocks live_blocks; /// Set of live device allocations currently in use + + bool use_managed_memory; /// Whether to use managed memory or device memory + + //--------------------------------------------------------------------- + // Methods + //--------------------------------------------------------------------- + + /** * \brief Constructor. */ - hypre_cub_CachingDeviceAllocator( - hypre_uint bin_growth, ///< Geometric growth factor for bin-sizes - hypre_uint min_bin = 1, ///< Minimum bin (default is bin_growth ^ 1) - hypre_uint max_bin = INVALID_BIN,///< Maximum bin (default is no max bin) - size_t max_cached_bytes - = INVALID_SIZE,///< Maximum aggregate cached bytes per device (default is no limit) - bool skip_cleanup - = false,///< Whether or not to skip a call to \p FreeAllCached() when the destructor is called (default is to deallocate) - bool debug - = false,///< Whether or not to print (de)allocation events to stdout (default is no stderr output) - bool use_managed_memory = false)///< Whether to use managed memory or device memory - : bin_growth(bin_growth), min_bin(min_bin), max_bin(max_bin), - min_bin_bytes(IntPow(bin_growth, min_bin)), max_bin_bytes(IntPow(bin_growth, max_bin)), - max_cached_bytes(max_cached_bytes), skip_cleanup(skip_cleanup), debug(debug), - use_managed_memory(use_managed_memory), cached_blocks(BlockDescriptor::SizeCompare), - live_blocks(BlockDescriptor::PtrCompare) {} - - /** + hypre_cub_CachingDeviceAllocator( + hypre_uint bin_growth, ///< Geometric growth factor for bin-sizes + hypre_uint min_bin = 1, ///< Minimum bin (default is bin_growth ^ 1) + hypre_uint max_bin = INVALID_BIN, ///< Maximum bin (default is no max bin) + size_t max_cached_bytes = INVALID_SIZE, ///< Maximum aggregate cached bytes per device (default is no limit) + bool skip_cleanup = false, ///< Whether or not to skip a call to \p FreeAllCached() when the destructor is called (default is to deallocate) + bool debug = false, ///< Whether or not to print (de)allocation events to stdout (default is no stderr output) + bool use_managed_memory = false) ///< Whether to use managed memory or device memory + : + bin_growth(bin_growth), + min_bin(min_bin), + max_bin(max_bin), + min_bin_bytes(IntPow(bin_growth, min_bin)), + max_bin_bytes(IntPow(bin_growth, max_bin)), + max_cached_bytes(max_cached_bytes), + skip_cleanup(skip_cleanup), + debug(debug), + use_managed_memory(use_managed_memory), + cached_blocks(BlockDescriptor::SizeCompare), + live_blocks(BlockDescriptor::PtrCompare) + {} + + + /** * \brief Default constructor. * * Configured with: @@ -1443,391 +2971,435 @@ struct hypre_cub_CachingDeviceAllocator { * which delineates five bin-sizes: 512B, 4KB, 32KB, 256KB, and 2MB and * sets a maximum of 6,291,455 cached bytes per device */ - hypre_cub_CachingDeviceAllocator(bool skip_cleanup = false, bool debug = false, - bool use_managed_memory = false) - : bin_growth(8), min_bin(3), max_bin(7), min_bin_bytes(IntPow(bin_growth, min_bin)), - max_bin_bytes(IntPow(bin_growth, max_bin)), max_cached_bytes((max_bin_bytes * 3) - 1), - skip_cleanup(skip_cleanup), debug(debug), use_managed_memory(use_managed_memory), - cached_blocks(BlockDescriptor::SizeCompare), live_blocks(BlockDescriptor::PtrCompare) {} - - /** + hypre_cub_CachingDeviceAllocator( + bool skip_cleanup = false, + bool debug = false, + bool use_managed_memory = false) + : + bin_growth(8), + min_bin(3), + max_bin(7), + min_bin_bytes(IntPow(bin_growth, min_bin)), + max_bin_bytes(IntPow(bin_growth, max_bin)), + max_cached_bytes((max_bin_bytes * 3) - 1), + skip_cleanup(skip_cleanup), + debug(debug), + use_managed_memory(use_managed_memory), + cached_blocks(BlockDescriptor::SizeCompare), + live_blocks(BlockDescriptor::PtrCompare) + {} + + + /** * \brief Sets the limit on the number bytes this allocator is allowed to cache per device. * * Changing the ceiling of cached bytes does not cause any allocations (in-use or * cached-in-reserve) to be freed. See \p FreeAllCached(). */ - cudaError_t SetMaxCachedBytes(size_t max_cached_bytes) { - // Lock - mutex.Lock(); + cudaError_t SetMaxCachedBytes( + size_t max_cached_bytes) + { + // Lock + mutex.Lock(); - if (debug) - printf("Changing max_cached_bytes (%zu -> %zu)\n", this->max_cached_bytes, max_cached_bytes); + if (debug) printf("Changing max_cached_bytes (%zu -> %zu)\n", this->max_cached_bytes, max_cached_bytes); - this->max_cached_bytes = max_cached_bytes; + this->max_cached_bytes = max_cached_bytes; - // Unlock - mutex.Unlock(); + // Unlock + mutex.Unlock(); + + return cudaSuccess; + } - return cudaSuccess; - } - /** + /** * \brief Provides a suitable allocation of device memory for the given size on the specified device. * * Once freed, the allocation becomes available immediately for reuse within the \p active_stream * with which it was associated with during allocation, and it becomes available for reuse within other * streams when all prior work submitted to \p active_stream has completed. */ - cudaError_t DeviceAllocate(hypre_int device,///< [in] Device on which to place the allocation - void **d_ptr, ///< [out] Reference to pointer to the allocation - size_t bytes, ///< [in] Minimum number of bytes for the allocation - cudaStream_t active_stream - = 0)///< [in] The stream to be associated with this allocation - { - *d_ptr = NULL; - hypre_int entrypoint_device = INVALID_DEVICE_ORDINAL; - cudaError_t error = cudaSuccess; - - if (device == INVALID_DEVICE_ORDINAL) { + cudaError_t DeviceAllocate( + hypre_int device, ///< [in] Device on which to place the allocation + void **d_ptr, ///< [out] Reference to pointer to the allocation + size_t bytes, ///< [in] Minimum number of bytes for the allocation + cudaStream_t active_stream = 0) ///< [in] The stream to be associated with this allocation + { + *d_ptr = NULL; + hypre_int entrypoint_device = INVALID_DEVICE_ORDINAL; + cudaError_t error = cudaSuccess; + + if (device == INVALID_DEVICE_ORDINAL) + { + if ((error = cudaGetDevice(&entrypoint_device))) return error; + device = entrypoint_device; + } + + // Create a block descriptor for the requested allocation + bool found = false; + BlockDescriptor search_key(device); + search_key.associated_stream = active_stream; + NearestPowerOf(search_key.bin, search_key.bytes, bin_growth, bytes); + + if (search_key.bin > max_bin) + { + // Bin is greater than our maximum bin: allocate the request + // exactly and give out-of-bounds bin. It will not be cached + // for reuse when returned. + search_key.bin = INVALID_BIN; + search_key.bytes = bytes; + } + else + { + // Search for a suitable cached allocation: lock + mutex.Lock(); + + if (search_key.bin < min_bin) + { + // Bin is less than minimum bin: round up + search_key.bin = min_bin; + search_key.bytes = min_bin_bytes; + } + + // Iterate through the range of cached blocks on the same device in the same bin + CachedBlocks::iterator block_itr = cached_blocks.lower_bound(search_key); + while ((block_itr != cached_blocks.end()) + && (block_itr->device == device) + && (block_itr->bin == search_key.bin)) + { + // To prevent races with reusing blocks returned by the host but still + // in use by the device, only consider cached blocks that are + // either (from the active stream) or (from an idle stream) + if ((active_stream == block_itr->associated_stream) || + (cudaEventQuery(block_itr->ready_event) != cudaErrorNotReady)) + { + // Reuse existing cache block. Insert into live blocks. + found = true; + search_key = *block_itr; + search_key.associated_stream = active_stream; + live_blocks.insert(search_key); + + // Remove from free blocks + cached_bytes[device].free -= search_key.bytes; + cached_bytes[device].live += search_key.bytes; + + if (debug) printf("\tDevice %d reused cached block at %p (%zu bytes) for stream %p (previously associated with stream %p).\n", + device, search_key.d_ptr, search_key.bytes, search_key.associated_stream, block_itr->associated_stream); + + cached_blocks.erase(block_itr); + + break; + } + block_itr++; + } + + // Done searching: unlock + mutex.Unlock(); + } + + // Allocate the block if necessary + if (!found) + { + // Set runtime's current device to specified device (entrypoint may not be set) + if (device != entrypoint_device) + { if ((error = cudaGetDevice(&entrypoint_device))) return error; - device = entrypoint_device; - } - - // Create a block descriptor for the requested allocation - bool found = false; - BlockDescriptor search_key(device); - search_key.associated_stream = active_stream; - NearestPowerOf(search_key.bin, search_key.bytes, bin_growth, bytes); - - if (search_key.bin > max_bin) { - // Bin is greater than our maximum bin: allocate the request - // exactly and give out-of-bounds bin. It will not be cached - // for reuse when returned. - search_key.bin = INVALID_BIN; - search_key.bytes = bytes; - } else { - // Search for a suitable cached allocation: lock + if ((error = cudaSetDevice(device))) return error; + } + + // Attempt to allocate + + if (use_managed_memory) + { + error = cudaMallocManaged(&search_key.d_ptr, search_key.bytes); + } + else + { + error = cudaMalloc(&search_key.d_ptr, search_key.bytes); + } + if ((error) == cudaErrorMemoryAllocation) + { + // The allocation attempt failed: free all cached blocks on device and retry + if (debug) printf("\tDevice %d failed to allocate %zu bytes for stream %p, retrying after freeing cached allocations", + device, search_key.bytes, search_key.associated_stream); + + error = cudaSuccess; // Reset the error we will return + cudaGetLastError(); // Reset CUDART's error + + // Lock mutex.Lock(); - if (search_key.bin < min_bin) { - // Bin is less than minimum bin: round up - search_key.bin = min_bin; - search_key.bytes = min_bin_bytes; - } - - // Iterate through the range of cached blocks on the same device in the same bin - CachedBlocks::iterator block_itr = cached_blocks.lower_bound(search_key); - while ((block_itr != cached_blocks.end()) && (block_itr->device == device) - && (block_itr->bin == search_key.bin)) { - // To prevent races with reusing blocks returned by the host but still - // in use by the device, only consider cached blocks that are - // either (from the active stream) or (from an idle stream) - if ((active_stream == block_itr->associated_stream) - || (cudaEventQuery(block_itr->ready_event) != cudaErrorNotReady)) { - // Reuse existing cache block. Insert into live blocks. - found = true; - search_key = *block_itr; - search_key.associated_stream = active_stream; - live_blocks.insert(search_key); - - // Remove from free blocks - cached_bytes[device].free -= search_key.bytes; - cached_bytes[device].live += search_key.bytes; - - if (debug) - printf("\tDevice %d reused cached block at %p (%zu bytes) for stream %p (previously " - "associated with stream %p).\n", - device, search_key.d_ptr, search_key.bytes, search_key.associated_stream, - block_itr->associated_stream); - - cached_blocks.erase(block_itr); - - break; - } - block_itr++; - } - - // Done searching: unlock - mutex.Unlock(); - } - - // Allocate the block if necessary - if (!found) { - // Set runtime's current device to specified device (entrypoint may not be set) - if (device != entrypoint_device) { - if ((error = cudaGetDevice(&entrypoint_device))) return error; - if ((error = cudaSetDevice(device))) return error; - } - - // Attempt to allocate - - if (use_managed_memory) { - error = cudaMallocManaged(&search_key.d_ptr, search_key.bytes); - } else { - error = cudaMalloc(&search_key.d_ptr, search_key.bytes); - } - if ((error) == cudaErrorMemoryAllocation) { - // The allocation attempt failed: free all cached blocks on device and retry - if (debug) - printf("\tDevice %d failed to allocate %zu bytes for stream %p, retrying after freeing " - "cached allocations", - device, search_key.bytes, search_key.associated_stream); - - error = cudaSuccess;// Reset the error we will return - cudaGetLastError(); // Reset CUDART's error + // Iterate the range of free blocks on the same device + BlockDescriptor free_key(device); + CachedBlocks::iterator block_itr = cached_blocks.lower_bound(free_key); - // Lock - mutex.Lock(); + while ((block_itr != cached_blocks.end()) && (block_itr->device == device)) + { + // No need to worry about synchronization with the device: cudaFree is + // blocking and will synchronize across all kernels executing + // on the current device - // Iterate the range of free blocks on the same device - BlockDescriptor free_key(device); - CachedBlocks::iterator block_itr = cached_blocks.lower_bound(free_key); + // Free device memory and destroy stream event. + if ((error = cudaFree(block_itr->d_ptr))) break; + if ((error = cudaEventDestroy(block_itr->ready_event))) break; - while ((block_itr != cached_blocks.end()) && (block_itr->device == device)) { - // No need to worry about synchronization with the device: cudaFree is - // blocking and will synchronize across all kernels executing - // on the current device + // Reduce balance and erase entry + cached_bytes[device].free -= block_itr->bytes; - // Free device memory and destroy stream event. - if ((error = cudaFree(block_itr->d_ptr))) break; - if ((error = cudaEventDestroy(block_itr->ready_event))) break; + if (debug) printf("\tDevice %d freed %zu bytes.\n\t\t %zu available blocks cached (%zu bytes), %zu live blocks (%zu bytes) outstanding.\n", + device, block_itr->bytes, cached_blocks.size(), cached_bytes[device].free, live_blocks.size(), cached_bytes[device].live); - // Reduce balance and erase entry - cached_bytes[device].free -= block_itr->bytes; + cached_blocks.erase(block_itr); - if (debug) - printf("\tDevice %d freed %zu bytes.\n\t\t %zu available blocks cached (%zu bytes), " - "%zu live blocks (%zu bytes) outstanding.\n", - device, block_itr->bytes, cached_blocks.size(), cached_bytes[device].free, - live_blocks.size(), cached_bytes[device].live); - - cached_blocks.erase(block_itr); - - block_itr++; - } + block_itr++; + } - // Unlock - mutex.Unlock(); + // Unlock + mutex.Unlock(); - // Return under error - if (error) return error; + // Return under error + if (error) return error; - // Try to allocate again + // Try to allocate again - if (use_managed_memory) { - error = cudaMallocManaged(&search_key.d_ptr, search_key.bytes); - } else { - error = cudaMalloc(&search_key.d_ptr, search_key.bytes); - } - if ((error)) return error; + if (use_managed_memory) + { + error = cudaMallocManaged(&search_key.d_ptr, search_key.bytes); } + else + { + error = cudaMalloc(&search_key.d_ptr, search_key.bytes); + } + if ((error)) return error; + } - // Create ready event - if ((error = cudaEventCreateWithFlags(&search_key.ready_event, cudaEventDisableTiming))) - return error; + // Create ready event + if ((error = cudaEventCreateWithFlags(&search_key.ready_event, cudaEventDisableTiming))) + return error; - // Insert into live blocks - mutex.Lock(); - live_blocks.insert(search_key); - cached_bytes[device].live += search_key.bytes; - mutex.Unlock(); + // Insert into live blocks + mutex.Lock(); + live_blocks.insert(search_key); + cached_bytes[device].live += search_key.bytes; + mutex.Unlock(); - if (debug) - printf("\tDevice %d allocated new device block at %p (%zu bytes associated with stream " - "%p).\n", - device, search_key.d_ptr, search_key.bytes, search_key.associated_stream); + if (debug) printf("\tDevice %d allocated new device block at %p (%zu bytes associated with stream %p).\n", + device, search_key.d_ptr, search_key.bytes, search_key.associated_stream); - // Attempt to revert back to previous device if necessary - if ((entrypoint_device != INVALID_DEVICE_ORDINAL) && (entrypoint_device != device)) { - if ((error = cudaSetDevice(entrypoint_device))) return error; - } - } + // Attempt to revert back to previous device if necessary + if ((entrypoint_device != INVALID_DEVICE_ORDINAL) && (entrypoint_device != device)) + { + if ((error = cudaSetDevice(entrypoint_device))) return error; + } + } - // Copy device pointer to output parameter - *d_ptr = search_key.d_ptr; + // Copy device pointer to output parameter + *d_ptr = search_key.d_ptr; - if (debug) - printf("\t\t%zu available blocks cached (%zu bytes), %zu live blocks outstanding(%zu bytes).\n", - cached_blocks.size(), cached_bytes[device].free, live_blocks.size(), - cached_bytes[device].live); + if (debug) printf("\t\t%zu available blocks cached (%zu bytes), %zu live blocks outstanding(%zu bytes).\n", + cached_blocks.size(), cached_bytes[device].free, live_blocks.size(), cached_bytes[device].live); - return error; - } + return error; + } - /** + + /** * \brief Provides a suitable allocation of device memory for the given size on the current device. * * Once freed, the allocation becomes available immediately for reuse within the \p active_stream * with which it was associated with during allocation, and it becomes available for reuse within other * streams when all prior work submitted to \p active_stream has completed. */ - cudaError_t DeviceAllocate(void **d_ptr,///< [out] Reference to pointer to the allocation - size_t bytes,///< [in] Minimum number of bytes for the allocation - cudaStream_t active_stream - = 0)///< [in] The stream to be associated with this allocation - { - return DeviceAllocate(INVALID_DEVICE_ORDINAL, d_ptr, bytes, active_stream); - } + cudaError_t DeviceAllocate( + void **d_ptr, ///< [out] Reference to pointer to the allocation + size_t bytes, ///< [in] Minimum number of bytes for the allocation + cudaStream_t active_stream = 0) ///< [in] The stream to be associated with this allocation + { + return DeviceAllocate(INVALID_DEVICE_ORDINAL, d_ptr, bytes, active_stream); + } - char *allocate(size_t bytes) { - char *ptr; - DeviceAllocate((void **) &ptr, bytes); + char * allocate(size_t bytes) + { + char *ptr; + DeviceAllocate((void **) &ptr, bytes); - return ptr; - } + return ptr; + } - /** + + /** * \brief Frees a live allocation of device memory on the specified device, returning it to the allocator. * * Once freed, the allocation becomes available immediately for reuse within the \p active_stream * with which it was associated with during allocation, and it becomes available for reuse within other * streams when all prior work submitted to \p active_stream has completed. */ - cudaError_t DeviceFree(hypre_int device, void *d_ptr) { - hypre_int entrypoint_device = INVALID_DEVICE_ORDINAL; - cudaError_t error = cudaSuccess; - - if (device == INVALID_DEVICE_ORDINAL) { - if ((error = cudaGetDevice(&entrypoint_device))) return error; - device = entrypoint_device; - } - - // Lock - mutex.Lock(); - - // Find corresponding block descriptor - bool recached = false; - BlockDescriptor search_key(d_ptr, device); - BusyBlocks::iterator block_itr = live_blocks.find(search_key); - if (block_itr != live_blocks.end()) { - // Remove from live blocks - search_key = *block_itr; - live_blocks.erase(block_itr); - cached_bytes[device].live -= search_key.bytes; - - // Keep the returned allocation if bin is valid and we won't exceed the max cached threshold - if ((search_key.bin != INVALID_BIN) - && (cached_bytes[device].free + search_key.bytes <= max_cached_bytes)) { - // Insert returned allocation into free blocks - recached = true; - cached_blocks.insert(search_key); - cached_bytes[device].free += search_key.bytes; - - if (debug) - printf("\tDevice %d returned %zu bytes from associated stream %p.\n\t\t %zu available " - "blocks cached (%zu bytes), %zu live blocks outstanding. (%zu bytes)\n", - device, search_key.bytes, search_key.associated_stream, cached_blocks.size(), - cached_bytes[device].free, live_blocks.size(), cached_bytes[device].live); - } - } - - // Unlock - mutex.Unlock(); - - // First set to specified device (entrypoint may not be set) - if (device != entrypoint_device) { - if ((error = cudaGetDevice(&entrypoint_device))) return error; - if ((error = cudaSetDevice(device))) return error; - } - - if (recached) { - // Insert the ready event in the associated stream (must have current device set properly) - if ((error = cudaEventRecord(search_key.ready_event, search_key.associated_stream))) return error; - } else { - // Free the allocation from the runtime and cleanup the event. - if ((error = cudaFree(d_ptr))) return error; - if ((error = cudaEventDestroy(search_key.ready_event))) return error; - - if (debug) - printf("\tDevice %d freed %zu bytes from associated stream %p.\n\t\t %zu available blocks " - "cached (%zu bytes), %zu live blocks (%zu bytes) outstanding.\n", - device, search_key.bytes, search_key.associated_stream, cached_blocks.size(), - cached_bytes[device].free, live_blocks.size(), cached_bytes[device].live); - } - - // Reset device - if ((entrypoint_device != INVALID_DEVICE_ORDINAL) && (entrypoint_device != device)) { - if ((error = cudaSetDevice(entrypoint_device))) return error; - } - - return error; - } - - /** + cudaError_t DeviceFree( + hypre_int device, + void* d_ptr) + { + hypre_int entrypoint_device = INVALID_DEVICE_ORDINAL; + cudaError_t error = cudaSuccess; + + if (device == INVALID_DEVICE_ORDINAL) + { + if ((error = cudaGetDevice(&entrypoint_device))) + return error; + device = entrypoint_device; + } + + // Lock + mutex.Lock(); + + // Find corresponding block descriptor + bool recached = false; + BlockDescriptor search_key(d_ptr, device); + BusyBlocks::iterator block_itr = live_blocks.find(search_key); + if (block_itr != live_blocks.end()) + { + // Remove from live blocks + search_key = *block_itr; + live_blocks.erase(block_itr); + cached_bytes[device].live -= search_key.bytes; + + // Keep the returned allocation if bin is valid and we won't exceed the max cached threshold + if ((search_key.bin != INVALID_BIN) && (cached_bytes[device].free + search_key.bytes <= max_cached_bytes)) + { + // Insert returned allocation into free blocks + recached = true; + cached_blocks.insert(search_key); + cached_bytes[device].free += search_key.bytes; + + if (debug) printf("\tDevice %d returned %zu bytes from associated stream %p.\n\t\t %zu available blocks cached (%zu bytes), %zu live blocks outstanding. (%zu bytes)\n", + device, search_key.bytes, search_key.associated_stream, cached_blocks.size(), + cached_bytes[device].free, live_blocks.size(), cached_bytes[device].live); + } + } + + // Unlock + mutex.Unlock(); + + // First set to specified device (entrypoint may not be set) + if (device != entrypoint_device) + { + if ((error = cudaGetDevice(&entrypoint_device))) return error; + if ((error = cudaSetDevice(device))) return error; + } + + if (recached) + { + // Insert the ready event in the associated stream (must have current device set properly) + if ((error = cudaEventRecord(search_key.ready_event, search_key.associated_stream))) return error; + } + else + { + // Free the allocation from the runtime and cleanup the event. + if ((error = cudaFree(d_ptr))) return error; + if ((error = cudaEventDestroy(search_key.ready_event))) return error; + + if (debug) printf("\tDevice %d freed %zu bytes from associated stream %p.\n\t\t %zu available blocks cached (%zu bytes), %zu live blocks (%zu bytes) outstanding.\n", + device, search_key.bytes, search_key.associated_stream, cached_blocks.size(), cached_bytes[device].free, live_blocks.size(), cached_bytes[device].live); + } + + // Reset device + if ((entrypoint_device != INVALID_DEVICE_ORDINAL) && (entrypoint_device != device)) + { + if ((error = cudaSetDevice(entrypoint_device))) return error; + } + + return error; + } + + /** * \brief Frees a live allocation of device memory on the current device, returning it to the allocator. * * Once freed, the allocation becomes available immediately for reuse within the \p active_stream * with which it was associated with during allocation, and it becomes available for reuse within other * streams when all prior work submitted to \p active_stream has completed. */ - cudaError_t DeviceFree(void *d_ptr) { return DeviceFree(INVALID_DEVICE_ORDINAL, d_ptr); } - - void deallocate(char *ptr, size_t) { DeviceFree((void *) ptr); } - - /** + cudaError_t DeviceFree( + void* d_ptr) + { + return DeviceFree(INVALID_DEVICE_ORDINAL, d_ptr); + } + + void deallocate(char *ptr, size_t) + { + DeviceFree((void *) ptr); + } + + /** * \brief Frees all cached device allocations on all devices */ - cudaError_t FreeAllCached() { - cudaError_t error = cudaSuccess; - hypre_int entrypoint_device = INVALID_DEVICE_ORDINAL; - hypre_int current_device = INVALID_DEVICE_ORDINAL; + cudaError_t FreeAllCached() + { + cudaError_t error = cudaSuccess; + hypre_int entrypoint_device = INVALID_DEVICE_ORDINAL; + hypre_int current_device = INVALID_DEVICE_ORDINAL; - mutex.Lock(); + mutex.Lock(); - while (!cached_blocks.empty()) { - // Get first block - CachedBlocks::iterator begin = cached_blocks.begin(); + while (!cached_blocks.empty()) + { + // Get first block + CachedBlocks::iterator begin = cached_blocks.begin(); - // Get entry-point device ordinal if necessary - if (entrypoint_device == INVALID_DEVICE_ORDINAL) { - if ((error = cudaGetDevice(&entrypoint_device))) break; - } + // Get entry-point device ordinal if necessary + if (entrypoint_device == INVALID_DEVICE_ORDINAL) + { + if ((error = cudaGetDevice(&entrypoint_device))) break; + } - // Set current device ordinal if necessary - if (begin->device != current_device) { - if ((error = cudaSetDevice(begin->device))) break; - current_device = begin->device; - } + // Set current device ordinal if necessary + if (begin->device != current_device) + { + if ((error = cudaSetDevice(begin->device))) break; + current_device = begin->device; + } - // Free device memory - if ((error = cudaFree(begin->d_ptr))) break; - if ((error = cudaEventDestroy(begin->ready_event))) break; + // Free device memory + if ((error = cudaFree(begin->d_ptr))) break; + if ((error = cudaEventDestroy(begin->ready_event))) break; - // Reduce balance and erase entry - cached_bytes[current_device].free -= begin->bytes; + // Reduce balance and erase entry + cached_bytes[current_device].free -= begin->bytes; - if (debug) - printf("\tDevice %d freed %zu bytes.\n\t\t %zu available blocks cached (%zu bytes), %zu " - "live blocks (%zu bytes) outstanding.\n", - current_device, begin->bytes, cached_blocks.size(), cached_bytes[current_device].free, - live_blocks.size(), cached_bytes[current_device].live); + if (debug) printf("\tDevice %d freed %zu bytes.\n\t\t %zu available blocks cached (%zu bytes), %zu live blocks (%zu bytes) outstanding.\n", + current_device, begin->bytes, cached_blocks.size(), cached_bytes[current_device].free, live_blocks.size(), cached_bytes[current_device].live); - cached_blocks.erase(begin); - } + cached_blocks.erase(begin); + } - mutex.Unlock(); + mutex.Unlock(); - // Attempt to revert back to entry-point device if necessary - if (entrypoint_device != INVALID_DEVICE_ORDINAL) { - if ((error = cudaSetDevice(entrypoint_device))) return error; - } + // Attempt to revert back to entry-point device if necessary + if (entrypoint_device != INVALID_DEVICE_ORDINAL) + { + if ((error = cudaSetDevice(entrypoint_device))) return error; + } - return error; - } + return error; + } - /** + + /** * \brief Destructor */ - virtual ~hypre_cub_CachingDeviceAllocator() { - if (!skip_cleanup) FreeAllCached(); - } + virtual ~hypre_cub_CachingDeviceAllocator() + { + if (!skip_cleanup) + FreeAllCached(); + } }; -#endif// #if defined(HYPRE_USING_CUDA) && defined(HYPRE_USING_DEVICE_POOL) -#endif// #ifndef HYPRE_CUB_ALLOCATOR_HEADER +#endif // #if defined(HYPRE_USING_CUDA) && defined(HYPRE_USING_DEVICE_POOL) +#endif // #ifndef HYPRE_CUB_ALLOCATOR_HEADER + #ifdef __cplusplus } #endif #endif + diff --git a/external/hypre/src/utilities/amg_linklist.c b/external/hypre/src/utilities/amg_linklist.c index 8a66fd21..1b89f014 100644 --- a/external/hypre/src/utilities/amg_linklist.c +++ b/external/hypre/src/utilities/amg_linklist.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -32,17 +32,17 @@ void hypre_dispose_elt ( hypre_LinkList element_ptr ) /***************************************************************** - * + * * remove_point: removes a point from the lists * ****************************************************************/ -void -hypre_remove_point(hypre_LinkList *LoL_head_ptr, - hypre_LinkList *LoL_tail_ptr, - HYPRE_Int measure, - HYPRE_Int index, - HYPRE_Int *lists, - HYPRE_Int *where) +void +hypre_remove_point(hypre_LinkList *LoL_head_ptr, + hypre_LinkList *LoL_tail_ptr, + HYPRE_Int measure, + HYPRE_Int index, + HYPRE_Int *lists, + HYPRE_Int *where) { hypre_LinkList LoL_head = *LoL_head_ptr; @@ -122,9 +122,10 @@ hypre_remove_point(hypre_LinkList *LoL_head_ptr, } } list_ptr = list_ptr -> next_elt; - } while (list_ptr != NULL); + } + while (list_ptr != NULL); - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"No such list!\n"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "No such list!\n"); return ; } @@ -138,14 +139,14 @@ hypre_LinkList hypre_create_elt( HYPRE_Int Item ) { hypre_LinkList new_elt_ptr; - /* Allocate memory space for the new node. + /* Allocate memory space for the new node. * return with error if no space available */ if ( (new_elt_ptr = hypre_TAlloc(hypre_ListElement, 1, HYPRE_MEMORY_HOST)) == NULL) { - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"\n create_elt: malloc failed \n\n"); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "\n create_elt: malloc failed \n\n"); } - else + else /* new_elt_ptr = hypre_CTAlloc(hypre_LinkList, 1); */ { new_elt_ptr -> data = Item; @@ -159,16 +160,16 @@ hypre_LinkList hypre_create_elt( HYPRE_Int Item ) } /***************************************************************** - * + * * enter_on_lists places point in new list * ****************************************************************/ -void -hypre_enter_on_lists(hypre_LinkList *LoL_head_ptr, - hypre_LinkList *LoL_tail_ptr, +void +hypre_enter_on_lists(hypre_LinkList *LoL_head_ptr, + hypre_LinkList *LoL_tail_ptr, HYPRE_Int measure, - HYPRE_Int index, - HYPRE_Int *lists, + HYPRE_Int index, + HYPRE_Int *lists, HYPRE_Int *where) { hypre_LinkList LoL_head = *LoL_head_ptr; @@ -187,7 +188,7 @@ hypre_enter_on_lists(hypre_LinkList *LoL_head_ptr, new_ptr->head = index; new_ptr->tail = index; lists[index] = hypre_LIST_TAIL; - where[index] = hypre_LIST_HEAD; + where[index] = hypre_LIST_HEAD; LoL_head = new_ptr; LoL_tail = new_ptr; @@ -208,9 +209,9 @@ hypre_enter_on_lists(hypre_LinkList *LoL_head_ptr, where[index] = hypre_LIST_HEAD; if ( list_ptr->prev_elt != NULL) - { + { new_ptr->prev_elt = list_ptr->prev_elt; - list_ptr->prev_elt->next_elt = new_ptr; + list_ptr->prev_elt->next_elt = new_ptr; list_ptr->prev_elt = new_ptr; new_ptr->next_elt = list_ptr; } @@ -223,7 +224,7 @@ hypre_enter_on_lists(hypre_LinkList *LoL_head_ptr, } *LoL_head_ptr = LoL_head; - *LoL_tail_ptr = LoL_tail; + *LoL_tail_ptr = LoL_tail; return; } else if (measure == list_ptr->data) @@ -237,9 +238,10 @@ hypre_enter_on_lists(hypre_LinkList *LoL_head_ptr, } list_ptr = list_ptr->next_elt; - } while (list_ptr != NULL); + } + while (list_ptr != NULL); - new_ptr = hypre_create_elt(measure); + new_ptr = hypre_create_elt(measure); new_ptr->head = index; new_ptr->tail = index; lists[index] = hypre_LIST_TAIL; diff --git a/external/hypre/src/utilities/amg_linklist.h b/external/hypre/src/utilities/amg_linklist.h index 3a4b608d..ebce87ad 100644 --- a/external/hypre/src/utilities/amg_linklist.h +++ b/external/hypre/src/utilities/amg_linklist.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/utilities/ap.c b/external/hypre/src/utilities/ap.c index 9ca8ed12..c1e2ab35 100644 --- a/external/hypre/src/utilities/ap.c +++ b/external/hypre/src/utilities/ap.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -13,7 +13,7 @@ /* returns 1 if the assumed partition is in use */ -HYPRE_Int HYPRE_AssumedPartitionCheck() +HYPRE_Int HYPRE_AssumedPartitionCheck(void) { return 1; } diff --git a/external/hypre/src/utilities/base.h b/external/hypre/src/utilities/base.h new file mode 100644 index 00000000..0877c3f3 --- /dev/null +++ b/external/hypre/src/utilities/base.h @@ -0,0 +1,33 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#ifndef HYPRE_BASE_HEADER +#define HYPRE_BASE_HEADER + +/****************************************************************************** + * + * Base private solver struct + * + *****************************************************************************/ + +typedef struct +{ + HYPRE_PtrToSolverFcn setup; + HYPRE_PtrToSolverFcn solve; + HYPRE_PtrToDestroyFcn destroy; + +} hypre_Solver; + +/*-------------------------------------------------------------------------- + * Accessor functions for the hypre_Solver structure + *--------------------------------------------------------------------------*/ + +#define hypre_SolverSetup(data) ((data) -> setup) +#define hypre_SolverSolve(data) ((data) -> solve) +#define hypre_SolverDestroy(data) ((data) -> destroy) + +#endif /* HYPRE_BASE_HEADER */ diff --git a/external/hypre/src/utilities/binsearch.c b/external/hypre/src/utilities/binsearch.c index 34932528..786d2db4 100644 --- a/external/hypre/src/utilities/binsearch.c +++ b/external/hypre/src/utilities/binsearch.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -20,7 +20,7 @@ HYPRE_Int hypre_BinarySearch(HYPRE_Int *list, HYPRE_Int value, HYPRE_Int list_le HYPRE_Int not_found = 1; low = 0; - high = list_length-1; + high = list_length - 1; while (not_found && low <= high) { m = (low + high) / 2; @@ -30,12 +30,12 @@ HYPRE_Int hypre_BinarySearch(HYPRE_Int *list, HYPRE_Int value, HYPRE_Int list_le } else if (value > list[m]) { - low = m + 1; + low = m + 1; } else { - not_found = 0; - return m; + not_found = 0; + return m; } } return -1; @@ -54,22 +54,22 @@ HYPRE_Int hypre_BigBinarySearch(HYPRE_BigInt *list, HYPRE_BigInt value, HYPRE_In HYPRE_Int not_found = 1; low = 0; - high = list_length-1; + high = list_length - 1; while (not_found && low <= high) { - m = low + (high-low) / 2; + m = low + (high - low) / 2; if (value < list[m]) { high = m - 1; } else if (value > list[m]) { - low = m + 1; + low = m + 1; } else { - not_found = 0; - return m; + not_found = 0; + return m; } } return -1; @@ -85,19 +85,24 @@ HYPRE_Int hypre_BigBinarySearch(HYPRE_BigInt *list, HYPRE_BigInt value, HYPRE_In *--------------------------------------------------------------------------*/ -HYPRE_Int hypre_BinarySearch2(HYPRE_Int *list, HYPRE_Int value, HYPRE_Int low, HYPRE_Int high, HYPRE_Int *spot) +HYPRE_Int hypre_BinarySearch2(HYPRE_Int *list, HYPRE_Int value, HYPRE_Int low, HYPRE_Int high, + HYPRE_Int *spot) { HYPRE_Int m; while (low <= high) { - m = low + (high - low)/2; + m = low + (high - low) / 2; if (value < list[m]) + { high = m - 1; + } else if (value > list[m]) + { low = m + 1; + } else { *spot = m; @@ -120,13 +125,15 @@ HYPRE_Int *hypre_LowerBound( HYPRE_Int *first, HYPRE_Int *last, HYPRE_Int value HYPRE_Int *it; HYPRE_Int count = last - first, step; - while (count > 0) { - it = first; step = count/2; it += step; - if (*it < value) { + while (count > 0) + { + it = first; step = count / 2; it += step; + if (*it < value) + { first = ++it; count -= step + 1; } - else count = step; + else { count = step; } } return first; } @@ -139,13 +146,15 @@ HYPRE_BigInt *hypre_BigLowerBound( HYPRE_BigInt *first, HYPRE_BigInt *last, HYPR HYPRE_BigInt *it; HYPRE_BigInt count = last - first, step; - while (count > 0) { - it = first; step = count/2; it += step; - if (*it < value) { + while (count > 0) + { + it = first; step = count / 2; it += step; + if (*it < value) + { first = ++it; count -= step + 1; } - else count = step; + else { count = step; } } return first; } diff --git a/external/hypre/src/utilities/caliper_instrumentation.h b/external/hypre/src/utilities/caliper_instrumentation.h index cf59c757..57fdcbcc 100644 --- a/external/hypre/src/utilities/caliper_instrumentation.h +++ b/external/hypre/src/utilities/caliper_instrumentation.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -19,7 +19,8 @@ #ifdef HYPRE_USING_CALIPER #ifdef __cplusplus -extern "C++" { +extern "C++" +{ #endif #include @@ -28,9 +29,6 @@ extern "C++" { } #endif -static char hypre__levelname[16]; -static char hypre__markname[1024]; - #define HYPRE_ANNOTATE_FUNC_BEGIN CALI_MARK_FUNCTION_BEGIN #define HYPRE_ANNOTATE_FUNC_END CALI_MARK_FUNCTION_END #define HYPRE_ANNOTATE_LOOP_BEGIN(id, str) CALI_MARK_LOOP_BEGIN(id, str) @@ -39,21 +37,25 @@ static char hypre__markname[1024]; #define HYPRE_ANNOTATE_ITER_END(id) CALI_MARK_ITERATION_END(id) #define HYPRE_ANNOTATE_REGION_BEGIN(...)\ {\ + char hypre__markname[1024];\ hypre_sprintf(hypre__markname, __VA_ARGS__);\ CALI_MARK_BEGIN(hypre__markname);\ } #define HYPRE_ANNOTATE_REGION_END(...)\ {\ + char hypre__markname[1024];\ hypre_sprintf(hypre__markname, __VA_ARGS__);\ CALI_MARK_END(hypre__markname);\ } #define HYPRE_ANNOTATE_MGLEVEL_BEGIN(lvl)\ {\ + char hypre__levelname[16];\ hypre_sprintf(hypre__levelname, "MG level %d", lvl);\ CALI_MARK_BEGIN(hypre__levelname);\ } #define HYPRE_ANNOTATE_MGLEVEL_END(lvl)\ {\ + char hypre__levelname[16];\ hypre_sprintf(hypre__levelname, "MG level %d", lvl);\ CALI_MARK_END(hypre__levelname);\ } diff --git a/external/hypre/src/utilities/complex.c b/external/hypre/src/utilities/complex.c index eb8dca4f..a53b7c2a 100644 --- a/external/hypre/src/utilities/complex.c +++ b/external/hypre/src/utilities/complex.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -14,25 +14,61 @@ HYPRE_Complex hypre_conj( HYPRE_Complex value ) { +#if defined(HYPRE_SINGLE) + return conjf(value); +#elif defined(HYPRE_LONG_DOUBLE) + return conjl(value); +#else return conj(value); +#endif } HYPRE_Real hypre_cabs( HYPRE_Complex value ) { +#if defined(HYPRE_SINGLE) + return cabsf(value); +#elif defined(HYPRE_LONG_DOUBLE) + return cabsl(value); +#else return cabs(value); +#endif } HYPRE_Real hypre_creal( HYPRE_Complex value ) { +#if defined(HYPRE_SINGLE) + return crealf(value); +#elif defined(HYPRE_LONG_DOUBLE) + return creall(value); +#else return creal(value); +#endif } HYPRE_Real hypre_cimag( HYPRE_Complex value ) { +#if defined(HYPRE_SINGLE) + return cimagf(value); +#elif defined(HYPRE_LONG_DOUBLE) + return cimagl(value); +#else return cimag(value); +#endif +} + +HYPRE_Complex +hypre_csqrt( HYPRE_Complex value ) +{ +#if defined(HYPRE_SINGLE) + return csqrtf(value); +#elif defined(HYPRE_LONG_DOUBLE) + return csqrtl(value); +#else + return csqrt(value); +#endif } #endif diff --git a/external/hypre/src/utilities/cuda_utils.c b/external/hypre/src/utilities/cuda_utils.c deleted file mode 100644 index 14ff64e8..00000000 --- a/external/hypre/src/utilities/cuda_utils.c +++ /dev/null @@ -1,1420 +0,0 @@ -/****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other - * HYPRE Project Developers. See the top-level COPYRIGHT file for details. - * - * SPDX-License-Identifier: (Apache-2.0 OR MIT) - ******************************************************************************/ - -#include "_hypre_utilities.h" -#include "_hypre_utilities.hpp" - -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - -/* - * The architecture identification macro __CUDA_ARCH__ is assigned a three-digit value string xy0 - * (ending in a literal 0) during each nvcc compilation stage 1 that compiles for compute_xy. - * This macro can be used in the implementation of GPU functions for determining the virtual architecture - * for which it is currently being compiled. The host code (the non-GPU code) must not depend on it. - * Note that compute_XX refers to a PTX version and sm_XX refers to a cubin version. -*/ -__global__ void -hypreCUDAKernel_CompileFlagSafetyCheck(hypre_int *cuda_arch_compile) -{ -#if defined(__CUDA_ARCH__) - cuda_arch_compile[0] = __CUDA_ARCH__; -#endif -} - -/* - * Assume this function is called inside HYPRE_Init(), at a place where we do not want to - * activate memory pooling, so we do not use hypre's memory model to Alloc and Free. - * See commented out code below (and do not delete) -*/ -void hypre_CudaCompileFlagCheck() -{ - // This is really only defined for CUDA and not for HIP -#if defined(HYPRE_USING_CUDA) - - HYPRE_Int device = hypre_HandleCudaDevice(hypre_handle()); - - struct cudaDeviceProp props; - cudaGetDeviceProperties(&props, device); - hypre_int cuda_arch_actual = props.major*100 + props.minor*10; - hypre_int cuda_arch_compile = -1; - dim3 gDim(1,1,1), bDim(1,1,1); - - hypre_int *cuda_arch_compile_d = NULL; - //cuda_arch_compile_d = hypre_TAlloc(hypre_int, 1, HYPRE_MEMORY_DEVICE); - HYPRE_CUDA_CALL( cudaMalloc(&cuda_arch_compile_d, sizeof(hypre_int)) ); - hypre_TMemcpy(cuda_arch_compile_d, &cuda_arch_compile, hypre_int, 1, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_CompileFlagSafetyCheck, gDim, bDim, cuda_arch_compile_d ); - hypre_TMemcpy(&cuda_arch_compile, cuda_arch_compile_d, hypre_int, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); - //hypre_TFree(cuda_arch_compile_d, HYPRE_MEMORY_DEVICE); - HYPRE_CUDA_CALL( cudaFree(cuda_arch_compile_d) ); - - /* HYPRE_CUDA_CALL(cudaDeviceSynchronize()); */ - - if (-1 == cuda_arch_compile) - { - hypre_error_w_msg(1, "hypre error: no proper cuda_arch found"); - } - else if (cuda_arch_actual != cuda_arch_compile) - { - char msg[256]; - hypre_sprintf(msg, "hypre warning: Compile 'arch=compute_' does not match device arch %d", cuda_arch_actual); - hypre_error_w_msg(1, msg); - /* - hypre_printf("%s\n", msg); - hypre_MPI_Abort(hypre_MPI_COMM_WORLD, -1); - */ - } - -#endif // defined(HYPRE_USING_CUDA) -} - -dim3 -hypre_GetDefaultCUDABlockDimension() -{ - dim3 bDim(512, 1, 1); - - return bDim; -} - -dim3 -hypre_GetDefaultCUDAGridDimension( HYPRE_Int n, - const char *granularity, - dim3 bDim ) -{ - HYPRE_Int num_blocks = 0; - HYPRE_Int num_threads_per_block = bDim.x * bDim.y * bDim.z; - - if (granularity[0] == 't') - { - num_blocks = (n + num_threads_per_block - 1) / num_threads_per_block; - } - else if (granularity[0] == 'w') - { - HYPRE_Int num_warps_per_block = num_threads_per_block >> HYPRE_WARP_BITSHIFT; - - hypre_assert(num_warps_per_block * HYPRE_WARP_SIZE == num_threads_per_block); - - num_blocks = (n + num_warps_per_block - 1) / num_warps_per_block; - } - else - { - hypre_printf("Error %s %d: Unknown granularity !\n", __FILE__, __LINE__); - hypre_assert(0); - } - - dim3 gDim(num_blocks, 1, 1); - - return gDim; -} - -/** - * Get NNZ of each row in d_row_indices and stored the results in d_rownnz - * All pointers are device pointers. - * d_rownnz can be the same as d_row_indices - */ -__global__ void -hypreCUDAKernel_GetRowNnz(HYPRE_Int nrows, HYPRE_Int *d_row_indices, HYPRE_Int *d_diag_ia, HYPRE_Int *d_offd_ia, - HYPRE_Int *d_rownnz) -{ - const HYPRE_Int global_thread_id = hypre_cuda_get_grid_thread_id<1,1>(); - - if (global_thread_id < nrows) - { - HYPRE_Int i; - - if (d_row_indices) - { - i = read_only_load(&d_row_indices[global_thread_id]); - } - else - { - i = global_thread_id; - } - - d_rownnz[global_thread_id] = read_only_load(&d_diag_ia[i+1]) - read_only_load(&d_diag_ia[i]) + - read_only_load(&d_offd_ia[i+1]) - read_only_load(&d_offd_ia[i]); - } -} - -/* special case: if d_row_indices == NULL, it means d_row_indices=[0,1,...,nrows-1] */ -HYPRE_Int -hypreDevice_GetRowNnz(HYPRE_Int nrows, HYPRE_Int *d_row_indices, HYPRE_Int *d_diag_ia, HYPRE_Int *d_offd_ia, - HYPRE_Int *d_rownnz) -{ - const dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - const dim3 gDim = hypre_GetDefaultCUDAGridDimension(nrows, "thread", bDim); - - /* trivial case */ - if (nrows <= 0) - { - return hypre_error_flag; - } - - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_GetRowNnz, gDim, bDim, nrows, d_row_indices, d_diag_ia, d_offd_ia, d_rownnz ); - - return hypre_error_flag; -} - -__global__ void -hypreCUDAKernel_CopyParCSRRows(HYPRE_Int nrows, - HYPRE_Int *d_row_indices, - HYPRE_Int has_offd, - HYPRE_BigInt first_col, - HYPRE_BigInt *d_col_map_offd_A, - HYPRE_Int *d_diag_i, - HYPRE_Int *d_diag_j, - HYPRE_Complex *d_diag_a, - HYPRE_Int *d_offd_i, - HYPRE_Int *d_offd_j, - HYPRE_Complex *d_offd_a, - HYPRE_Int *d_ib, - HYPRE_BigInt *d_jb, - HYPRE_Complex *d_ab) -{ - const HYPRE_Int global_warp_id = hypre_cuda_get_grid_warp_id<1,1>(); - - if (global_warp_id >= nrows) - { - return; - } - - /* lane id inside the warp */ - const HYPRE_Int lane_id = hypre_cuda_get_lane_id<1>(); - HYPRE_Int i, j, k, p, row, istart, iend, bstart; - - /* diag part */ - if (lane_id < 2) - { - /* row index to work on */ - if (d_row_indices) - { - row = read_only_load(d_row_indices + global_warp_id); - } - else - { - row = global_warp_id; - } - /* start/end position of the row */ - j = read_only_load(d_diag_i + row + lane_id); - /* start position of b */ - k = d_ib ? read_only_load(d_ib + global_warp_id) : 0; - } - istart = __shfl_sync(HYPRE_WARP_FULL_MASK, j, 0); - iend = __shfl_sync(HYPRE_WARP_FULL_MASK, j, 1); - bstart = __shfl_sync(HYPRE_WARP_FULL_MASK, k, 0); - - p = bstart - istart; - for (i = istart + lane_id; i < iend; i += HYPRE_WARP_SIZE) - { - d_jb[p+i] = read_only_load(d_diag_j + i) + first_col; - if (d_ab) - { - d_ab[p+i] = read_only_load(d_diag_a + i); - } - } - - if (!has_offd) - { - return; - } - - /* offd part */ - if (lane_id < 2) - { - j = read_only_load(d_offd_i + row + lane_id); - } - bstart += iend - istart; - istart = __shfl_sync(HYPRE_WARP_FULL_MASK, j, 0); - iend = __shfl_sync(HYPRE_WARP_FULL_MASK, j, 1); - - p = bstart - istart; - for (i = istart + lane_id; i < iend; i += HYPRE_WARP_SIZE) - { - if (d_col_map_offd_A) - { - d_jb[p+i] = d_col_map_offd_A[read_only_load(d_offd_j + i)]; - } - else - { - d_jb[p+i] = -1 - read_only_load(d_offd_j + i); - } - - if (d_ab) - { - d_ab[p+i] = read_only_load(d_offd_a + i); - } - } -} - -/* B = A(row_indices, :) */ -/* Note: d_ib is an input vector that contains row ptrs, - * i.e., start positions where to put the rows in d_jb and d_ab. - * The col indices in B are global indices, i.e., BigJ - * of length (nrows + 1) or nrow (without the last entry, nnz) */ -/* Special cases: - * if d_row_indices == NULL, it means d_row_indices=[0,1,...,nrows-1] - * If col_map_offd_A == NULL, use (-1 - d_offd_j) as column id - * If nrows == 1 and d_ib == NULL, it means d_ib[0] = 0 */ -HYPRE_Int -hypreDevice_CopyParCSRRows(HYPRE_Int nrows, - HYPRE_Int *d_row_indices, - HYPRE_Int job, - HYPRE_Int has_offd, - HYPRE_BigInt first_col, - HYPRE_BigInt *d_col_map_offd_A, - HYPRE_Int *d_diag_i, - HYPRE_Int *d_diag_j, - HYPRE_Complex *d_diag_a, - HYPRE_Int *d_offd_i, - HYPRE_Int *d_offd_j, - HYPRE_Complex *d_offd_a, - HYPRE_Int *d_ib, - HYPRE_BigInt *d_jb, - HYPRE_Complex *d_ab) -{ - /* trivial case */ - if (nrows <= 0) - { - return hypre_error_flag; - } - - hypre_assert(!(nrows > 1 && d_ib == NULL)); - - const dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - const dim3 gDim = hypre_GetDefaultCUDAGridDimension(nrows, "warp", bDim); - - /* - if (job == 2) - { - } - */ - - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_CopyParCSRRows, gDim, bDim, - nrows, d_row_indices, has_offd, first_col, d_col_map_offd_A, - d_diag_i, d_diag_j, d_diag_a, - d_offd_i, d_offd_j, d_offd_a, - d_ib, d_jb, d_ab ); - - return hypre_error_flag; -} - -HYPRE_Int -hypreDevice_IntegerReduceSum(HYPRE_Int n, HYPRE_Int *d_i) -{ - return HYPRE_THRUST_CALL(reduce, d_i, d_i + n); -} - -HYPRE_Int -hypreDevice_IntegerInclusiveScan(HYPRE_Int n, HYPRE_Int *d_i) -{ - HYPRE_THRUST_CALL(inclusive_scan, d_i, d_i + n, d_i); - - return hypre_error_flag; -} - -HYPRE_Int -hypreDevice_IntegerExclusiveScan(HYPRE_Int n, HYPRE_Int *d_i) -{ - HYPRE_THRUST_CALL(exclusive_scan, d_i, d_i + n, d_i); - - return hypre_error_flag; -} - -HYPRE_Int -hypreDevice_Scalen(HYPRE_Complex *d_x, size_t n, HYPRE_Complex v) -{ - HYPRE_THRUST_CALL( transform, d_x, d_x + n, d_x, v * _1 ); - - return hypre_error_flag; -} - -HYPRE_Int -hypreDevice_Filln(HYPRE_Complex *d_x, size_t n, HYPRE_Complex v) -{ - HYPRE_THRUST_CALL( fill_n, d_x, n, v); - - return hypre_error_flag; -} - -HYPRE_Int -hypreDevice_BigIntFilln(HYPRE_BigInt *d_x, size_t n, HYPRE_BigInt v) -{ - HYPRE_THRUST_CALL( fill_n, d_x, n, v); - - return hypre_error_flag; -} - -struct hypre_empty_row_functor -{ - // This is needed for clang - typedef bool result_type; - - __device__ - bool operator()(const thrust::tuple& t) const - { - const HYPRE_Int a = thrust::get<0>(t); - const HYPRE_Int b = thrust::get<1>(t); - - return a != b; - } -}; - -HYPRE_Int* -hypreDevice_CsrRowPtrsToIndices(HYPRE_Int nrows, HYPRE_Int nnz, HYPRE_Int *d_row_ptr) -{ - /* trivial case */ - if (nrows <= 0 || nnz <= 0) - { - return NULL; - } - - HYPRE_Int *d_row_ind = hypre_TAlloc(HYPRE_Int, nnz, HYPRE_MEMORY_DEVICE); - - hypreDevice_CsrRowPtrsToIndices_v2(nrows, nnz, d_row_ptr, d_row_ind); - - return d_row_ind; -} - -HYPRE_Int -hypreDevice_CsrRowPtrsToIndices_v2(HYPRE_Int nrows, HYPRE_Int nnz, HYPRE_Int *d_row_ptr, HYPRE_Int *d_row_ind) -{ - /* trivial case */ - if (nrows <= 0 || nnz <= 0) - { - return hypre_error_flag; - } - - HYPRE_THRUST_CALL( fill, d_row_ind, d_row_ind + nnz, 0 ); - - HYPRE_THRUST_CALL( scatter_if, - thrust::counting_iterator(0), - thrust::counting_iterator(nrows), - d_row_ptr, - thrust::make_transform_iterator( thrust::make_zip_iterator(thrust::make_tuple(d_row_ptr, d_row_ptr+1)), - hypre_empty_row_functor() ), - d_row_ind ); - - HYPRE_THRUST_CALL( inclusive_scan, d_row_ind, d_row_ind + nnz, d_row_ind, thrust::maximum()); - - return hypre_error_flag; -} - -/* Input: d_row_num, of size nrows, contains the rows indices that can be BigInt or Int - * Output: d_row_ind */ -template -HYPRE_Int -hypreDevice_CsrRowPtrsToIndicesWithRowNum(HYPRE_Int nrows, HYPRE_Int nnz, HYPRE_Int *d_row_ptr, T *d_row_num, T *d_row_ind) -{ - /* trivial case */ - if (nrows <= 0) - { - return hypre_error_flag; - } - - HYPRE_Int *map = hypre_TAlloc(HYPRE_Int, nnz, HYPRE_MEMORY_DEVICE); - - hypreDevice_CsrRowPtrsToIndices_v2(nrows, nnz, d_row_ptr, map); - - HYPRE_THRUST_CALL(gather, map, map + nnz, d_row_num, d_row_ind); - - hypre_TFree(map, HYPRE_MEMORY_DEVICE); - - return hypre_error_flag; -} - -template HYPRE_Int hypreDevice_CsrRowPtrsToIndicesWithRowNum(HYPRE_Int nrows, HYPRE_Int nnz, HYPRE_Int *d_row_ptr, HYPRE_Int *d_row_num, HYPRE_Int *d_row_ind); -#if defined(HYPRE_MIXEDINT) -template HYPRE_Int hypreDevice_CsrRowPtrsToIndicesWithRowNum(HYPRE_Int nrows, HYPRE_Int nnz, HYPRE_Int *d_row_ptr, HYPRE_BigInt *d_row_num, HYPRE_BigInt *d_row_ind); -#endif - -HYPRE_Int* -hypreDevice_CsrRowIndicesToPtrs(HYPRE_Int nrows, HYPRE_Int nnz, HYPRE_Int *d_row_ind) -{ - HYPRE_Int *d_row_ptr = hypre_TAlloc(HYPRE_Int, nrows+1, HYPRE_MEMORY_DEVICE); - - HYPRE_THRUST_CALL( lower_bound, - d_row_ind, d_row_ind + nnz, - thrust::counting_iterator(0), - thrust::counting_iterator(nrows+1), - d_row_ptr); - - return d_row_ptr; -} - -HYPRE_Int -hypreDevice_CsrRowIndicesToPtrs_v2(HYPRE_Int nrows, HYPRE_Int nnz, HYPRE_Int *d_row_ind, HYPRE_Int *d_row_ptr) -{ - HYPRE_THRUST_CALL( lower_bound, - d_row_ind, d_row_ind + nnz, - thrust::counting_iterator(0), - thrust::counting_iterator(nrows+1), - d_row_ptr); - - return hypre_error_flag; -} - -__global__ void -hypreCUDAKernel_ScatterAddTrivial(HYPRE_Int n, HYPRE_Real *x, HYPRE_Int *map, HYPRE_Real *y) -{ - for (HYPRE_Int i = 0; i < n; i++) - { - x[map[i]] += y[i]; - } -} - -/* x[map[i]] += y[i], same index cannot appear more than once in map */ -__global__ void -hypreCUDAKernel_ScatterAdd(HYPRE_Int n, HYPRE_Real *x, HYPRE_Int *map, HYPRE_Real *y) -{ - HYPRE_Int global_thread_id = hypre_cuda_get_grid_thread_id<1,1>(); - - if (global_thread_id < n) - { - x[map[global_thread_id]] += y[global_thread_id]; - } -} - -/* Generalized Scatter-and-Add - * for i = 0 : ny-1, x[map[i]] += y[i]; - * Note: An index is allowed to appear more than once in map - * Content in y will be destroyed - * When work != NULL, work is at least of size [2*sizeof(HYPRE_Int)+sizeof(HYPRE_Complex)]*ny - */ -HYPRE_Int -hypreDevice_GenScatterAdd(HYPRE_Real *x, HYPRE_Int ny, HYPRE_Int *map, HYPRE_Real *y, char *work) -{ - if (ny <= 0) - { - return hypre_error_flag; - } - - if (ny <= 2) - { - /* trivial cases, n = 1, 2 */ - dim3 bDim = 1; - dim3 gDim = 1; - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_ScatterAddTrivial, gDim, bDim, ny, x, map, y ); - } - else - { - /* general cases */ - HYPRE_Int *map2, *reduced_map, reduced_n; - HYPRE_Real *reduced_y; - - if (work) - { - map2 = (HYPRE_Int *) work; - reduced_map = map2 + ny; - reduced_y = (HYPRE_Real *) (reduced_map + ny); - } - else - { - map2 = hypre_TAlloc(HYPRE_Int, ny, HYPRE_MEMORY_DEVICE); - reduced_map = hypre_TAlloc(HYPRE_Int, ny, HYPRE_MEMORY_DEVICE); - reduced_y = hypre_TAlloc(HYPRE_Real, ny, HYPRE_MEMORY_DEVICE); - } - - hypre_TMemcpy(map2, map, HYPRE_Int, ny, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); - - HYPRE_THRUST_CALL(sort_by_key, map2, map2 + ny, y); - - thrust::pair new_end = HYPRE_THRUST_CALL( reduce_by_key, - map2, - map2 + ny, - y, - reduced_map, - reduced_y ); - - reduced_n = new_end.first - reduced_map; - - hypre_assert(reduced_n == new_end.second - reduced_y); - - dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(reduced_n, "thread", bDim); - - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_ScatterAdd, gDim, bDim, - reduced_n, x, reduced_map, reduced_y ); - - if (!work) - { - hypre_TFree(map2, HYPRE_MEMORY_DEVICE); - hypre_TFree(reduced_map, HYPRE_MEMORY_DEVICE); - hypre_TFree(reduced_y, HYPRE_MEMORY_DEVICE); - } - } - - return hypre_error_flag; -} - -/* x[map[i]] = v */ -template -__global__ void -hypreCUDAKernel_ScatterConstant(T *x, HYPRE_Int n, HYPRE_Int *map, T v) -{ - HYPRE_Int global_thread_id = hypre_cuda_get_grid_thread_id<1,1>(); - - if (global_thread_id < n) - { - x[map[global_thread_id]] = v; - } -} - -/* x[map[i]] = v - * n is length of map - * TODO: thrust? */ -template -HYPRE_Int -hypreDevice_ScatterConstant(T *x, HYPRE_Int n, HYPRE_Int *map, T v) -{ - /* trivial case */ - if (n <= 0) - { - return hypre_error_flag; - } - - dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(n, "thread", bDim); - - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_ScatterConstant, gDim, bDim, x, n, map, v ); - - return hypre_error_flag; -} - -template HYPRE_Int hypreDevice_ScatterConstant(HYPRE_Int *x, HYPRE_Int n, HYPRE_Int *map, HYPRE_Int v); -template HYPRE_Int hypreDevice_ScatterConstant(HYPRE_Complex *x, HYPRE_Int n, HYPRE_Int *map, HYPRE_Complex v); - -__global__ void -hypreCUDAKernel_IVAXPY(HYPRE_Int n, HYPRE_Complex *a, HYPRE_Complex *x, HYPRE_Complex *y) -{ - HYPRE_Int i = hypre_cuda_get_grid_thread_id<1,1>(); - - if (i < n) - { - y[i] += x[i] / a[i]; - } -} - -/* Inverse Vector AXPY: y[i] = x[i] / a[i] + y[i] */ -HYPRE_Int -hypreDevice_IVAXPY(HYPRE_Int n, HYPRE_Complex *a, HYPRE_Complex *x, HYPRE_Complex *y) -{ - /* trivial case */ - if (n <= 0) - { - return hypre_error_flag; - } - - dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(n, "thread", bDim); - - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_IVAXPY, gDim, bDim, n, a, x, y ); - - return hypre_error_flag; -} - -__global__ void -hypreCUDAKernel_IVAXPYMarked(HYPRE_Int n, HYPRE_Complex *a, HYPRE_Complex *x, HYPRE_Complex *y, HYPRE_Int *marker, HYPRE_Int marker_val) -{ - HYPRE_Int i = hypre_cuda_get_grid_thread_id<1,1>(); - - if (i < n) - { - if (marker[i] == marker_val) - { - y[i] += x[i] / a[i]; - } - } -} - -/* Inverse Vector AXPY: y[i] = x[i] / a[i] + y[i] */ -HYPRE_Int -hypreDevice_IVAXPYMarked(HYPRE_Int n, HYPRE_Complex *a, HYPRE_Complex *x, HYPRE_Complex *y, HYPRE_Int *marker, HYPRE_Int marker_val) -{ - /* trivial case */ - if (n <= 0) - { - return hypre_error_flag; - } - - dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(n, "thread", bDim); - - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_IVAXPYMarked, gDim, bDim, n, a, x, y, marker, marker_val ); - - return hypre_error_flag; -} - -__global__ void -hypreCUDAKernel_DiagScaleVector(HYPRE_Int n, HYPRE_Int *A_i, HYPRE_Complex *A_data, HYPRE_Complex *x, HYPRE_Complex beta, HYPRE_Complex *y) -{ - HYPRE_Int i = hypre_cuda_get_grid_thread_id<1,1>(); - - if (i < n) - { - if (beta != 0.0) - { - y[i] = x[i] / A_data[A_i[i]] + beta * y[i]; - } - else - { - y[i] = x[i] / A_data[A_i[i]]; - } - } -} - -/* y = diag(A) \ x + beta y - * Note: Assume A_i[i] points to the ith diagonal entry of A */ -HYPRE_Int -hypreDevice_DiagScaleVector(HYPRE_Int n, HYPRE_Int *A_i, HYPRE_Complex *A_data, HYPRE_Complex *x, HYPRE_Complex beta, HYPRE_Complex *y) -{ - /* trivial case */ - if (n <= 0) - { - return hypre_error_flag; - } - - dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(n, "thread", bDim); - - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_DiagScaleVector, gDim, bDim, n, A_i, A_data, x, beta, y ); - - return hypre_error_flag; -} - -__global__ void -hypreCUDAKernel_DiagScaleVector2(HYPRE_Int n, HYPRE_Int *A_i, HYPRE_Complex *A_data, HYPRE_Complex *x, HYPRE_Complex beta, HYPRE_Complex *y, HYPRE_Complex *z) -{ - HYPRE_Int i = hypre_cuda_get_grid_thread_id<1,1>(); - - if (i < n) - { - HYPRE_Complex t = x[i] / A_data[A_i[i]]; - y[i] = t; - z[i] += beta*t; - } -} - -/* y = diag(A) \ x - * z = beta * (diag(A) \ x) + z - * Note: Assume A_i[i] points to the ith diagonal entry of A */ -HYPRE_Int -hypreDevice_DiagScaleVector2(HYPRE_Int n, HYPRE_Int *A_i, HYPRE_Complex *A_data, HYPRE_Complex *x, HYPRE_Complex beta, HYPRE_Complex *y, HYPRE_Complex *z) -{ - /* trivial case */ - if (n <= 0) - { - return hypre_error_flag; - } - - dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(n, "thread", bDim); - - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_DiagScaleVector2, gDim, bDim, n, A_i, A_data, x, beta, y, z ); - - return hypre_error_flag; -} - -__global__ void -hypreCUDAKernel_BigToSmallCopy( HYPRE_Int* __restrict__ tgt, - const HYPRE_BigInt* __restrict__ src, - HYPRE_Int size) -{ - HYPRE_Int i = hypre_cuda_get_grid_thread_id<1,1>(); - - if (i < size) - { - tgt[i] = src[i]; - } -} - -HYPRE_Int -hypreDevice_BigToSmallCopy(HYPRE_Int *tgt, const HYPRE_BigInt *src, HYPRE_Int size) -{ - dim3 bDim = hypre_GetDefaultCUDABlockDimension(); - dim3 gDim = hypre_GetDefaultCUDAGridDimension(size, "thread", bDim); - - HYPRE_CUDA_LAUNCH( hypreCUDAKernel_BigToSmallCopy, gDim, bDim, tgt, src, size); - - return hypre_error_flag; -} - - -/* https://github.com/OrangeOwlSolutions/Thrust/blob/master/Sort_by_key_with_tuple_key.cu */ -/* opt: 0, (a,b) < (a',b') iff a < a' or (a = a' and b < b') [normal tupe comp] - * 1, (a,b) < (a',b') iff a < a' or (a = a' and |b| > |b'|) [used in dropping small entries] - * 2, (a,b) < (a',b') iff a < a' or (a = a' and (b == a or b < b') and b' != a') [used in putting diagonal first] - */ -template -HYPRE_Int -hypreDevice_StableSortByTupleKey(HYPRE_Int N, T1 *keys1, T2 *keys2, T3 *vals, HYPRE_Int opt) -{ - auto begin_keys = thrust::make_zip_iterator(thrust::make_tuple(keys1, keys2)); - auto end_keys = thrust::make_zip_iterator(thrust::make_tuple(keys1 + N, keys2 + N)); - - if (opt == 0) - { - HYPRE_THRUST_CALL(stable_sort_by_key, begin_keys, end_keys, vals, thrust::less< thrust::tuple >()); - } - else if (opt == 1) - { - HYPRE_THRUST_CALL(stable_sort_by_key, begin_keys, end_keys, vals, TupleComp2()); - } - else if (opt == 2) - { - HYPRE_THRUST_CALL(stable_sort_by_key, begin_keys, end_keys, vals, TupleComp3()); - } - - return hypre_error_flag; -} - -template HYPRE_Int hypreDevice_StableSortByTupleKey(HYPRE_Int N, HYPRE_Int *keys1, HYPRE_Int *keys2, HYPRE_Int *vals, HYPRE_Int opt); -template HYPRE_Int hypreDevice_StableSortByTupleKey(HYPRE_Int N, HYPRE_Int *keys1, HYPRE_Real *keys2, HYPRE_Int *vals, HYPRE_Int opt); -template HYPRE_Int hypreDevice_StableSortByTupleKey(HYPRE_Int N, HYPRE_Int *keys1, HYPRE_Int *keys2, HYPRE_Complex *vals, HYPRE_Int opt); - -/* opt: - * 0, (a,b) < (a',b') iff a < a' or (a = a' and b < b') [normal tupe comp] - * 2, (a,b) < (a',b') iff a < a' or (a = a' and (b == a or b < b') and b' != a') [used in assembly to put diagonal first] - */ -template -HYPRE_Int -hypreDevice_StableSortTupleByTupleKey(HYPRE_Int N, T1 *keys1, T2 *keys2, T3 *vals1, T4 *vals2, HYPRE_Int opt) -{ - auto begin_keys = thrust::make_zip_iterator(thrust::make_tuple(keys1, keys2)); - auto end_keys = thrust::make_zip_iterator(thrust::make_tuple(keys1 + N, keys2 + N)); - auto begin_vals = thrust::make_zip_iterator(thrust::make_tuple(vals1, vals2)); - - if (opt == 0) - { - HYPRE_THRUST_CALL(stable_sort_by_key, begin_keys, end_keys, begin_vals, thrust::less< thrust::tuple >()); - } - else if (opt == 2) - { - HYPRE_THRUST_CALL(stable_sort_by_key, begin_keys, end_keys, begin_vals, TupleComp3()); - } - - return hypre_error_flag; -} - -template HYPRE_Int hypreDevice_StableSortTupleByTupleKey(HYPRE_Int N, HYPRE_Int *keys1, HYPRE_Int *keys2, char *vals1, HYPRE_Complex *vals2, HYPRE_Int opt); -#if defined(HYPRE_MIXEDINT) -template HYPRE_Int hypreDevice_StableSortTupleByTupleKey(HYPRE_Int N, HYPRE_BigInt *keys1, HYPRE_BigInt *keys2, char *vals1, HYPRE_Complex *vals2, HYPRE_Int opt); -#endif - -template -HYPRE_Int -hypreDevice_ReduceByTupleKey(HYPRE_Int N, T1 *keys1_in, T2 *keys2_in, T3 *vals_in, - T1 *keys1_out, T2 *keys2_out, T3 *vals_out) -{ - auto begin_keys_in = thrust::make_zip_iterator(thrust::make_tuple(keys1_in, keys2_in )); - auto end_keys_in = thrust::make_zip_iterator(thrust::make_tuple(keys1_in + N, keys2_in + N)); - auto begin_keys_out = thrust::make_zip_iterator(thrust::make_tuple(keys1_out, keys2_out )); - thrust::equal_to< thrust::tuple > pred; - thrust::plus func; - - auto new_end = HYPRE_THRUST_CALL(reduce_by_key, begin_keys_in, end_keys_in, vals_in, begin_keys_out, vals_out, pred, func); - - return new_end.second - vals_out; -} - -template HYPRE_Int hypreDevice_ReduceByTupleKey(HYPRE_Int N, HYPRE_Int *keys1_in, HYPRE_Int *keys2_in, HYPRE_Complex *vals_in, HYPRE_Int *keys1_out, HYPRE_Int *keys2_out, HYPRE_Complex *vals_out); - -#endif // #if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - -#if defined(HYPRE_USING_CUSPARSE) -/* - * @brief Determines the associated CudaDataType for the HYPRE_Complex typedef - * @return Returns cuda data type corresponding with HYPRE_Complex - * - * @todo Should be known compile time - * @todo Support more sizes - * @todo Support complex - * @warning Only works for Single and Double precision - * @note Perhaps some typedefs should be added where HYPRE_Complex is typedef'd - */ -cudaDataType -hypre_HYPREComplexToCudaDataType() -{ - /* - if (sizeof(char)*CHAR_BIT != 8) - { - hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ERROR: Unsupported char size"); - hypre_assert(false); - } - */ -#if defined(HYPRE_COMPLEX) - return CUDA_C_64F; -#else -#if defined(HYPRE_SINGLE) - hypre_assert(sizeof(HYPRE_Complex) == 4); - return CUDA_R_32F; -#elif defined(HYPRE_LONG_DOUBLE) -#error "Long Double is not supported on GPUs" -#else - hypre_assert(sizeof(HYPRE_Complex) == 8); - return CUDA_R_64F; -#endif -#endif // #if defined(HYPRE_COMPLEX) -} - -/* - * @brief Determines the associated cusparseIndexType_t for the HYPRE_Int typedef - */ -cusparseIndexType_t -hypre_HYPREIntToCusparseIndexType() -{ - /* - if(sizeof(char)*CHAR_BIT!=8) - { - hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ERROR: Unsupported char size"); - hypre_assert(false); - } - */ - -#if defined(HYPRE_BIGINT) - hypre_assert(sizeof(HYPRE_Int) == 8); - return CUSPARSE_INDEX_64I; -#else - hypre_assert(sizeof(HYPRE_Int) == 4); - return CUSPARSE_INDEX_32I; -#endif -} -#endif // #if defined(HYPRE_USING_CUSPARSE) - -#if defined(HYPRE_USING_GPU) - -#if defined(HYPRE_USING_DEVICE_OPENMP) -cudaStream_t -#elif defined(HYPRE_USING_CUDA) -cudaStream_t -#elif defined(HYPRE_USING_HIP) -hipStream_t -#endif -hypre_CudaDataCudaStream(hypre_CudaData *data, HYPRE_Int i) -{ -#if defined(HYPRE_USING_DEVICE_OPENMP) - cudaStream_t stream = 0; -#elif defined(HYPRE_USING_CUDA) - cudaStream_t stream = 0; -#elif defined(HYPRE_USING_HIP) - hipStream_t stream = 0; -#endif - -#if defined(HYPRE_USING_CUDA_STREAMS) - if (i >= HYPRE_MAX_NUM_STREAMS) - { - /* return the default stream, i.e., the NULL stream */ - /* - hypre_printf("CUDA stream %d exceeds the max number %d\n", - i, HYPRE_MAX_NUM_STREAMS); - */ - return NULL; - } - - if (data->cuda_streams[i]) - { - return data->cuda_streams[i]; - } - -#if defined(HYPRE_USING_DEVICE_OPENMP) - HYPRE_CUDA_CALL(cudaStreamCreateWithFlags(&stream, cudaStreamDefault)); -#elif defined(HYPRE_USING_CUDA) - //HYPRE_CUDA_CALL(cudaStreamCreateWithFlags(&stream,cudaStreamNonBlocking)); - HYPRE_CUDA_CALL(cudaStreamCreateWithFlags(&stream, cudaStreamDefault)); -#elif defined(HYPRE_USING_HIP) - HYPRE_HIP_CALL(hipStreamCreateWithFlags(&stream, hipStreamDefault)); -#endif - - data->cuda_streams[i] = stream; -#endif - - return stream; -} - -#if defined(HYPRE_USING_DEVICE_OPENMP) -cudaStream_t -#elif defined(HYPRE_USING_CUDA) -cudaStream_t -#elif defined(HYPRE_USING_HIP) -hipStream_t -#endif -hypre_CudaDataCudaComputeStream(hypre_CudaData *data) -{ - return hypre_CudaDataCudaStream(data, - hypre_CudaDataCudaComputeStreamNum(data)); -} - -#if defined(HYPRE_USING_CURAND) -curandGenerator_t -hypre_CudaDataCurandGenerator(hypre_CudaData *data) -{ - if (data->curand_generator) - { - return data->curand_generator; - } - - curandGenerator_t gen; - HYPRE_CURAND_CALL( curandCreateGenerator(&gen, CURAND_RNG_PSEUDO_DEFAULT) ); - HYPRE_CURAND_CALL( curandSetPseudoRandomGeneratorSeed(gen, 1234ULL) ); - HYPRE_CURAND_CALL( curandSetStream(gen, hypre_CudaDataCudaComputeStream(data)) ); - - data->curand_generator = gen; - - return gen; -} - -/* T = float or hypre_double */ -template -HYPRE_Int -hypre_CurandUniform_core( HYPRE_Int n, - T *urand, - HYPRE_Int set_seed, - hypre_ulonglongint seed, - HYPRE_Int set_offset, - hypre_ulonglongint offset) -{ - curandGenerator_t gen = hypre_HandleCurandGenerator(hypre_handle()); - - if (set_seed) - { - HYPRE_CURAND_CALL( curandSetPseudoRandomGeneratorSeed(gen, seed) ); - } - - if (set_offset) - { - HYPRE_CURAND_CALL( curandSetGeneratorOffset(gen, offset) ); - } - - if (sizeof(T) == sizeof(hypre_double)) - { - HYPRE_CURAND_CALL( curandGenerateUniformDouble(gen, (hypre_double *) urand, n) ); - } - else if (sizeof(T) == sizeof(float)) - { - HYPRE_CURAND_CALL( curandGenerateUniform(gen, (float *) urand, n) ); - } - - return hypre_error_flag; -} -#endif /* #if defined(HYPRE_USING_CURAND) */ - -#if defined(HYPRE_USING_ROCRAND) -rocrand_generator -hypre_CudaDataCurandGenerator(hypre_CudaData *data) -{ - if (data->curand_generator) - { - return data->curand_generator; - } - - rocrand_generator gen; - HYPRE_ROCRAND_CALL( rocrand_create_generator(&gen, ROCRAND_RNG_PSEUDO_DEFAULT) ); - HYPRE_ROCRAND_CALL( rocrand_set_seed(gen, 1234ULL) ); - HYPRE_ROCRAND_CALL( rocrand_set_stream(gen, hypre_CudaDataCudaComputeStream(data)) ); - - data->curand_generator = gen; - - return gen; -} - -template -HYPRE_Int -hypre_CurandUniform_core( HYPRE_Int n, - T *urand, - HYPRE_Int set_seed, - hypre_ulonglongint seed, - HYPRE_Int set_offset, - hypre_ulonglongint offset) -{ - hypre_GpuProfilingPushRange("hypre_CurandUniform_core"); - - rocrand_generator gen = hypre_HandleCurandGenerator(hypre_handle()); - - if (set_seed) - { - HYPRE_ROCRAND_CALL( rocrand_set_seed(gen, seed) ); - } - - if (set_offset) - { - HYPRE_ROCRAND_CALL( rocrand_set_offset(gen, offset) ); - } - - if (sizeof(T) == sizeof(hypre_double)) - { - HYPRE_ROCRAND_CALL( rocrand_generate_uniform_double(gen, (hypre_double *) urand, n) ); - } - else if (sizeof(T) == sizeof(float)) - { - HYPRE_ROCRAND_CALL( rocrand_generate_uniform(gen, (float *) urand, n) ); - } - - hypre_GpuProfilingPopRange(); - - return hypre_error_flag; -} -#endif /* #if defined(HYPRE_USING_ROCRAND) */ - -#if defined(HYPRE_USING_CURAND) || defined(HYPRE_USING_ROCRAND) - -HYPRE_Int -hypre_CurandUniform( HYPRE_Int n, - HYPRE_Real *urand, - HYPRE_Int set_seed, - hypre_ulonglongint seed, - HYPRE_Int set_offset, - hypre_ulonglongint offset) -{ - return hypre_CurandUniform_core(n, urand, set_seed, seed, set_offset, offset); -} - -HYPRE_Int -hypre_CurandUniformSingle( HYPRE_Int n, - float *urand, - HYPRE_Int set_seed, - hypre_ulonglongint seed, - HYPRE_Int set_offset, - hypre_ulonglongint offset) -{ - return hypre_CurandUniform_core(n, urand, set_seed, seed, set_offset, offset); -} - -#endif /* #if defined(HYPRE_USING_CURAND) || defined(HYPRE_USING_ROCRAND) */ - -#if defined(HYPRE_USING_CUBLAS) -cublasHandle_t -hypre_CudaDataCublasHandle(hypre_CudaData *data) -{ - if (data->cublas_handle) - { - return data->cublas_handle; - } - - cublasHandle_t handle; - HYPRE_CUBLAS_CALL( cublasCreate(&handle) ); - - HYPRE_CUBLAS_CALL( cublasSetStream(handle, hypre_CudaDataCudaComputeStream(data)) ); - - data->cublas_handle = handle; - - return handle; -} -#endif - -#if defined(HYPRE_USING_CUSPARSE) -cusparseHandle_t -hypre_CudaDataCusparseHandle(hypre_CudaData *data) -{ - if (data->cusparse_handle) - { - return data->cusparse_handle; - } - - cusparseHandle_t handle; - HYPRE_CUSPARSE_CALL( cusparseCreate(&handle) ); - - HYPRE_CUSPARSE_CALL( cusparseSetStream(handle, hypre_CudaDataCudaComputeStream(data)) ); - - data->cusparse_handle = handle; - - return handle; -} -#endif // defined(HYPRE_USING_CUSPARSE) - - -#if defined(HYPRE_USING_ROCSPARSE) -rocsparse_handle -hypre_CudaDataCusparseHandle(hypre_CudaData *data) -{ - if (data->cusparse_handle) - { - return data->cusparse_handle; - } - - rocsparse_handle handle; - HYPRE_ROCSPARSE_CALL( rocsparse_create_handle(&handle) ); - - HYPRE_ROCSPARSE_CALL( rocsparse_set_stream(handle, hypre_CudaDataCudaComputeStream(data)) ); - - data->cusparse_handle = handle; - - return handle; -} -#endif // defined(HYPRE_USING_ROCSPARSE) - - - -hypre_CudaData* -hypre_CudaDataCreate() -{ - hypre_CudaData *data = hypre_CTAlloc(hypre_CudaData, 1, HYPRE_MEMORY_HOST); - - hypre_CudaDataCudaDevice(data) = 0; - hypre_CudaDataCudaComputeStreamNum(data) = 0; - - /* SpGeMM */ -#if defined(HYPRE_USING_CUSPARSE) || defined(HYPRE_USING_ROCSPARSE) - hypre_CudaDataSpgemmUseCusparse(data) = 1; -#else - hypre_CudaDataSpgemmUseCusparse(data) = 0; -#endif - - hypre_CudaDataSpgemmAlgorithm(data) = 1; - /* 1: naive overestimate, 2: naive underestimate, 3: Cohen's algorithm */ - hypre_CudaDataSpgemmRownnzEstimateMethod(data) = 3; - hypre_CudaDataSpgemmRownnzEstimateNsamples(data) = 32; - hypre_CudaDataSpgemmRownnzEstimateMultFactor(data) = 1.5; - hypre_CudaDataSpgemmHashType(data) = 'D'; - - /* pmis */ -#if defined(HYPRE_USING_CURAND) || defined(HYPRE_USING_ROCRAND) - hypre_CudaDataUseGpuRand(data) = 1; -#else - hypre_CudaDataUseGpuRand(data) = 0; -#endif - - /* device pool */ -#ifdef HYPRE_USING_DEVICE_POOL - hypre_CudaDataCubBinGrowth(data) = 8u; - hypre_CudaDataCubMinBin(data) = 1u; - hypre_CudaDataCubMaxBin(data) = (hypre_uint) -1; - hypre_CudaDataCubMaxCachedBytes(data) = (size_t) -1; - hypre_CudaDataCubDevAllocator(data) = NULL; - hypre_CudaDataCubUvmAllocator(data) = NULL; -#endif - - return data; -} - -void -hypre_CudaDataDestroy(hypre_CudaData *data) -{ - if (!data) - { - return; - } - - hypre_TFree(hypre_CudaDataCudaReduceBuffer(data), HYPRE_MEMORY_DEVICE); - hypre_TFree(hypre_CudaDataStructCommRecvBuffer(data), HYPRE_MEMORY_DEVICE); - hypre_TFree(hypre_CudaDataStructCommSendBuffer(data), HYPRE_MEMORY_DEVICE); - -#if defined(HYPRE_USING_CURAND) - if (data->curand_generator) - { - HYPRE_CURAND_CALL( curandDestroyGenerator(data->curand_generator) ); - } -#endif - -#if defined(HYPRE_USING_ROCRAND) - if (data->curand_generator) - { - HYPRE_ROCRAND_CALL( rocrand_destroy_generator(data->curand_generator) ); - } -#endif - -#if defined(HYPRE_USING_CUBLAS) - if (data->cublas_handle) - { - HYPRE_CUBLAS_CALL( cublasDestroy(data->cublas_handle) ); - } -#endif - -#if defined(HYPRE_USING_CUSPARSE) || defined(HYPRE_USING_ROCSPARSE) - if (data->cusparse_handle) - { -#if defined(HYPRE_USING_CUSPARSE) - HYPRE_CUSPARSE_CALL( cusparseDestroy(data->cusparse_handle) ); -#elif defined(HYPRE_USING_ROCSPARSE) - HYPRE_ROCSPARSE_CALL( rocsparse_destroy_handle(data->cusparse_handle) ); -#endif - } -#endif // #if defined(HYPRE_USING_CUSPARSE) || defined(HYPRE_USING_ROCSPARSE) - - for (HYPRE_Int i = 0; i < HYPRE_MAX_NUM_STREAMS; i++) - { - if (data->cuda_streams[i]) - { -#if defined(HYPRE_USING_DEVICE_OPENMP) - HYPRE_CUDA_CALL( cudaStreamDestroy(data->cuda_streams[i]) ); -#elif defined(HYPRE_USING_CUDA) - HYPRE_CUDA_CALL( cudaStreamDestroy(data->cuda_streams[i]) ); -#elif defined(HYPRE_USING_HIP) - HYPRE_HIP_CALL( hipStreamDestroy(data->cuda_streams[i]) ); -#endif - } - } - -#ifdef HYPRE_USING_DEVICE_POOL - hypre_CudaDataCubCachingAllocatorDestroy(data); -#endif - - hypre_TFree(data, HYPRE_MEMORY_HOST); -} - -HYPRE_Int -hypre_SyncCudaDevice(hypre_Handle *hypre_handle) -{ -#if defined(HYPRE_USING_DEVICE_OPENMP) - HYPRE_CUDA_CALL( cudaDeviceSynchronize() ); -#elif defined(HYPRE_USING_CUDA) - HYPRE_CUDA_CALL( cudaDeviceSynchronize() ); -#elif defined(HYPRE_USING_HIP) - HYPRE_HIP_CALL( hipDeviceSynchronize() ); -#endif - return hypre_error_flag; -} - -HYPRE_Int -hypre_ResetCudaDevice(hypre_Handle *hypre_handle) -{ -#if defined(HYPRE_USING_CUDA) - cudaDeviceReset(); -#elif defined(HYPRE_USING_HIP) - hipDeviceReset(); -#endif - return hypre_error_flag; -} - -/* synchronize the Hypre compute stream - * action: 0: set sync stream to false - * 1: set sync stream to true - * 2: restore sync stream to default - * 3: return the current value of cuda_compute_stream_sync - * 4: sync stream based on cuda_compute_stream_sync - */ -HYPRE_Int -hypre_SyncCudaComputeStream_core(HYPRE_Int action, - hypre_Handle *hypre_handle, - HYPRE_Int *cuda_compute_stream_sync_ptr) -{ - /* with UVM the default is to sync at kernel completions, since host is also able to - * touch GPU memory */ -#if defined(HYPRE_USING_UNIFIED_MEMORY) - static const HYPRE_Int cuda_compute_stream_sync_default = 1; -#else - static const HYPRE_Int cuda_compute_stream_sync_default = 0; -#endif - - /* this controls if synchronize the stream after computations */ - static HYPRE_Int cuda_compute_stream_sync = cuda_compute_stream_sync_default; - - switch (action) - { - case 0: - cuda_compute_stream_sync = 0; - break; - case 1: - cuda_compute_stream_sync = 1; - break; - case 2: - cuda_compute_stream_sync = cuda_compute_stream_sync_default; - break; - case 3: - *cuda_compute_stream_sync_ptr = cuda_compute_stream_sync; - break; - case 4: -#if defined(HYPRE_USING_DEVICE_OPENMP) - HYPRE_CUDA_CALL( cudaDeviceSynchronize() ); -#else - if (cuda_compute_stream_sync) - { -#if defined(HYPRE_USING_CUDA) - HYPRE_CUDA_CALL( cudaStreamSynchronize(hypre_HandleCudaComputeStream(hypre_handle)) ); -#elif defined(HYPRE_USING_HIP) - HYPRE_HIP_CALL( hipStreamSynchronize(hypre_HandleCudaComputeStream(hypre_handle)) ); -#endif - } -#endif - break; - default: - hypre_printf("hypre_SyncCudaComputeStream_core invalid action\n"); - hypre_error_in_arg(1); - } - - return hypre_error_flag; -} - -HYPRE_Int -hypre_SetSyncCudaCompute(HYPRE_Int action) -{ - /* convert to 1/0 */ - action = action != 0; - hypre_SyncCudaComputeStream_core(action, NULL, NULL); - - return hypre_error_flag; -} - -HYPRE_Int -hypre_RestoreSyncCudaCompute() -{ - hypre_SyncCudaComputeStream_core(2, NULL, NULL); - - return hypre_error_flag; -} - -HYPRE_Int -hypre_GetSyncCudaCompute(HYPRE_Int *cuda_compute_stream_sync_ptr) -{ - hypre_SyncCudaComputeStream_core(3, NULL, cuda_compute_stream_sync_ptr); - - return hypre_error_flag; -} - -HYPRE_Int -hypre_SyncCudaComputeStream(hypre_Handle *hypre_handle) -{ - hypre_SyncCudaComputeStream_core(4, hypre_handle, NULL); - - return hypre_error_flag; -} - -#endif // #if defined(HYPRE_USING_GPU) - - -/* This function is supposed to be used in the test drivers to mimic - * users' GPU binding approaches - * It is supposed to be called before HYPRE_Init, - * so that HYPRE_Init can get the wanted device id - */ -HYPRE_Int -hypre_bind_device( HYPRE_Int myid, - HYPRE_Int nproc, - MPI_Comm comm ) -{ -#ifdef HYPRE_USING_GPU - /* proc id (rank) on the running node */ - HYPRE_Int myNodeid; - /* num of procs (size) on the node */ - HYPRE_Int NodeSize; - /* num of devices seen */ - hypre_int nDevices; - /* device id that want to bind */ - hypre_int device_id; - - hypre_MPI_Comm node_comm; - hypre_MPI_Comm_split_type( comm, hypre_MPI_COMM_TYPE_SHARED, - myid, hypre_MPI_INFO_NULL, &node_comm ); - hypre_MPI_Comm_rank(node_comm, &myNodeid); - hypre_MPI_Comm_size(node_comm, &NodeSize); - hypre_MPI_Comm_free(&node_comm); - - /* get number of devices on this node */ - hypre_GetDeviceCount(&nDevices); - - /* set device */ - device_id = myNodeid % nDevices; - hypre_SetDevice(device_id, NULL); - -#if defined(HYPRE_DEBUG) && defined(HYPRE_PRINT_ERRORS) - hypre_printf("Proc [global %d/%d, local %d/%d] can see %d GPUs and is running on %d\n", - myid, nproc, myNodeid, NodeSize, nDevices, device_id); -#endif - -#endif /* #ifdef HYPRE_USING_GPU */ - - return hypre_error_flag; -} - diff --git a/external/hypre/src/utilities/cuda_utils.h b/external/hypre/src/utilities/cuda_utils.h deleted file mode 100644 index 155fdd0c..00000000 --- a/external/hypre/src/utilities/cuda_utils.h +++ /dev/null @@ -1,919 +0,0 @@ -/****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other - * HYPRE Project Developers. See the top-level COPYRIGHT file for details. - * - * SPDX-License-Identifier: (Apache-2.0 OR MIT) - ******************************************************************************/ - -#ifndef HYPRE_CUDA_UTILS_H -#define HYPRE_CUDA_UTILS_H - -#if defined(HYPRE_USING_GPU) - -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_DEVICE_OPENMP) -#include -#include -#include -#include -#include -#include - -#ifndef CUDART_VERSION -#error CUDART_VERSION Undefined! -#endif - -#ifndef CUDA_VERSION -#error CUDA_VERSION Undefined! -#endif - -#if CUDA_VERSION >= 11000 -#define THRUST_IGNORE_DEPRECATED_CPP11 -#define CUB_IGNORE_DEPRECATED_CPP11 -#define THRUST_IGNORE_DEPRECATED_CPP_DIALECT -#define CUB_IGNORE_DEPRECATED_CPP_DIALECT -#endif - -#define CUSPARSE_NEWAPI_VERSION 11000 - -#elif defined(HYPRE_USING_HIP) - -#include - -#endif // defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_DEVICE_OPENMP) - -#if defined(HYPRE_USING_ROCSPARSE) -#include -#endif - -#if defined(HYPRE_USING_ROCRAND) -#include -#endif - -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_DEVICE_OPENMP) -#define HYPRE_CUDA_CALL(call) do { \ - cudaError_t err = call; \ - if (cudaSuccess != err) { \ - printf("CUDA ERROR (code = %d, %s) at %s:%d\n", err, cudaGetErrorString(err), \ - __FILE__, __LINE__); \ - hypre_assert(0); exit(1); \ - } } while(0) - -#elif defined(HYPRE_USING_HIP) -#define HYPRE_HIP_CALL(call) do { \ - hipError_t err = call; \ - if (hipSuccess != err) { \ - printf("HIP ERROR (code = %d, %s) at %s:%d\n", err, hipGetErrorString(err), \ - __FILE__, __LINE__); \ - hypre_assert(0); exit(1); \ - } } while(0) - -#endif // defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_DEVICE_OPENMP) - -#define HYPRE_CUBLAS_CALL(call) do { \ - cublasStatus_t err = call; \ - if (CUBLAS_STATUS_SUCCESS != err) { \ - printf("CUBLAS ERROR (code = %d, %d) at %s:%d\n", \ - err, err == CUBLAS_STATUS_EXECUTION_FAILED, __FILE__, __LINE__); \ - hypre_assert(0); exit(1); \ - } } while(0) - -#define HYPRE_CUSPARSE_CALL(call) do { \ - cusparseStatus_t err = call; \ - if (CUSPARSE_STATUS_SUCCESS != err) { \ - printf("CUSPARSE ERROR (code = %d, %s) at %s:%d\n", \ - err, cusparseGetErrorString(err), __FILE__, __LINE__); \ - hypre_assert(0); exit(1); \ - } } while(0) - -#define HYPRE_ROCSPARSE_CALL(call) do { \ - rocsparse_status err = call; \ - if (rocsparse_status_success != err) { \ - printf("rocSPARSE ERROR (code = %d) at %s:%d\n", \ - err, __FILE__, __LINE__); \ - assert(0); exit(1); \ - } } while(0) - -#define HYPRE_CURAND_CALL(call) do { \ - curandStatus_t err = call; \ - if (CURAND_STATUS_SUCCESS != err) { \ - printf("CURAND ERROR (code = %d) at %s:%d\n", err, __FILE__, __LINE__); \ - hypre_assert(0); exit(1); \ - } } while(0) - -#define HYPRE_ROCRAND_CALL(call) do { \ - rocrand_status err = call; \ - if (ROCRAND_STATUS_SUCCESS != err) { \ - printf("ROCRAND ERROR (code = %d) at %s:%d\n", err, __FILE__, __LINE__); \ - hypre_assert(0); exit(1); \ - } } while(0) - -struct hypre_cub_CachingDeviceAllocator; -typedef struct hypre_cub_CachingDeviceAllocator hypre_cub_CachingDeviceAllocator; - -// HYPRE_WARP_BITSHIFT is just log2 of HYPRE_WARP_SIZE -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_DEVICE_OPENMP) -#define HYPRE_WARP_SIZE 32 -#define HYPRE_WARP_BITSHIFT 5 -#elif defined(HYPRE_USING_HIP) -#define HYPRE_WARP_SIZE 64 -#define HYPRE_WARP_BITSHIFT 6 -#endif - -#define HYPRE_WARP_FULL_MASK 0xFFFFFFFF -#define HYPRE_MAX_NUM_WARPS (64 * 64 * 32) -#define HYPRE_FLT_LARGE 1e30 -#define HYPRE_1D_BLOCK_SIZE 512 -#define HYPRE_MAX_NUM_STREAMS 10 - -struct hypre_CudaData -{ -#if defined(HYPRE_USING_CURAND) - curandGenerator_t curand_generator; -#endif - -#if defined(HYPRE_USING_ROCRAND) - rocrand_generator curand_generator; -#endif - -#if defined(HYPRE_USING_CUBLAS) - cublasHandle_t cublas_handle; -#endif - -#if defined(HYPRE_USING_CUSPARSE) - cusparseHandle_t cusparse_handle; -#endif - -#if defined(HYPRE_USING_ROCSPARSE) - rocsparse_handle cusparse_handle; -#endif - -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_DEVICE_OPENMP) - cudaStream_t cuda_streams[HYPRE_MAX_NUM_STREAMS]; -#elif defined(HYPRE_USING_HIP) - hipStream_t cuda_streams[HYPRE_MAX_NUM_STREAMS]; -#endif - -#ifdef HYPRE_USING_DEVICE_POOL - hypre_uint cub_bin_growth; - hypre_uint cub_min_bin; - hypre_uint cub_max_bin; - size_t cub_max_cached_bytes; - hypre_cub_CachingDeviceAllocator *cub_dev_allocator; - hypre_cub_CachingDeviceAllocator *cub_uvm_allocator; -#endif - -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - hypre_device_allocator device_allocator; -#endif - - HYPRE_Int cuda_device; - /* by default, hypre puts GPU computations in this stream - * Do not be confused with the default (null) CUDA stream */ - HYPRE_Int cuda_compute_stream_num; - /* work space for hypre's CUDA reducer */ - void *cuda_reduce_buffer; - /* the device buffers needed to do MPI communication for struct comm */ - HYPRE_Complex* struct_comm_recv_buffer; - HYPRE_Complex* struct_comm_send_buffer; - HYPRE_Int struct_comm_recv_buffer_size; - HYPRE_Int struct_comm_send_buffer_size; - /* device spgemm options */ - HYPRE_Int spgemm_use_cusparse; - HYPRE_Int spgemm_algorithm; - HYPRE_Int spgemm_rownnz_estimate_method; - HYPRE_Int spgemm_rownnz_estimate_nsamples; - float spgemm_rownnz_estimate_mult_factor; - char spgemm_hash_type; - /* PMIS */ - HYPRE_Int use_gpu_rand; -}; - -#define hypre_CudaDataCubBinGrowth(data) ((data) -> cub_bin_growth) -#define hypre_CudaDataCubMinBin(data) ((data) -> cub_min_bin) -#define hypre_CudaDataCubMaxBin(data) ((data) -> cub_max_bin) -#define hypre_CudaDataCubMaxCachedBytes(data) ((data) -> cub_max_cached_bytes) -#define hypre_CudaDataCubDevAllocator(data) ((data) -> cub_dev_allocator) -#define hypre_CudaDataCubUvmAllocator(data) ((data) -> cub_uvm_allocator) -#define hypre_CudaDataCudaDevice(data) ((data) -> cuda_device) -#define hypre_CudaDataCudaComputeStreamNum(data) ((data) -> cuda_compute_stream_num) -#define hypre_CudaDataCudaReduceBuffer(data) ((data) -> cuda_reduce_buffer) -#define hypre_CudaDataStructCommRecvBuffer(data) ((data) -> struct_comm_recv_buffer) -#define hypre_CudaDataStructCommSendBuffer(data) ((data) -> struct_comm_send_buffer) -#define hypre_CudaDataStructCommRecvBufferSize(data) ((data) -> struct_comm_recv_buffer_size) -#define hypre_CudaDataStructCommSendBufferSize(data) ((data) -> struct_comm_send_buffer_size) -#define hypre_CudaDataSpgemmUseCusparse(data) ((data) -> spgemm_use_cusparse) -#define hypre_CudaDataSpgemmAlgorithm(data) ((data) -> spgemm_algorithm) -#define hypre_CudaDataSpgemmRownnzEstimateMethod(data) ((data) -> spgemm_rownnz_estimate_method) -#define hypre_CudaDataSpgemmRownnzEstimateNsamples(data) ((data) -> spgemm_rownnz_estimate_nsamples) -#define hypre_CudaDataSpgemmRownnzEstimateMultFactor(data) ((data) -> spgemm_rownnz_estimate_mult_factor) -#define hypre_CudaDataSpgemmHashType(data) ((data) -> spgemm_hash_type) -#define hypre_CudaDataDeviceAllocator(data) ((data) -> device_allocator) -#define hypre_CudaDataUseGpuRand(data) ((data) -> use_gpu_rand) - -hypre_CudaData* hypre_CudaDataCreate(); -void hypre_CudaDataDestroy(hypre_CudaData* data); - -#if defined(HYPRE_USING_CURAND) -curandGenerator_t hypre_CudaDataCurandGenerator(hypre_CudaData *data); -#endif - -#if defined(HYPRE_USING_ROCRAND) -rocrand_generator hypre_CudaDataCurandGenerator(hypre_CudaData *data); -#endif - -#if defined(HYPRE_USING_CUBLAS) -cublasHandle_t hypre_CudaDataCublasHandle(hypre_CudaData *data); -#endif - -#if defined(HYPRE_USING_CUSPARSE) -cusparseHandle_t hypre_CudaDataCusparseHandle(hypre_CudaData *data); -#endif - -#if defined(HYPRE_USING_ROCSPARSE) -rocsparse_handle hypre_CudaDataCusparseHandle(hypre_CudaData *data); -#endif - -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_DEVICE_OPENMP) -cudaStream_t hypre_CudaDataCudaStream(hypre_CudaData *data, HYPRE_Int i); -cudaStream_t hypre_CudaDataCudaComputeStream(hypre_CudaData *data); -#elif defined(HYPRE_USING_HIP) -hipStream_t hypre_CudaDataCudaStream(hypre_CudaData *data, HYPRE_Int i); -hipStream_t hypre_CudaDataCudaComputeStream(hypre_CudaData *data); -#endif - -// Data structure and accessor routines for Cuda Sparse Triangular Matrices -struct hypre_CsrsvData -{ -#if defined(HYPRE_USING_CUSPARSE) - csrsv2Info_t info_L; - csrsv2Info_t info_U; -#elif defined(HYPRE_USING_ROCSPARSE) - rocsparse_mat_info info_L; - rocsparse_mat_info info_U; -#endif - hypre_int BufferSize; - char *Buffer; -}; - -#define hypre_CsrsvDataInfoL(data) ((data) -> info_L) -#define hypre_CsrsvDataInfoU(data) ((data) -> info_U) -#define hypre_CsrsvDataBufferSize(data) ((data) -> BufferSize) -#define hypre_CsrsvDataBuffer(data) ((data) -> Buffer) - -struct hypre_GpuMatData -{ -#if defined(HYPRE_USING_CUSPARSE) - cusparseMatDescr_t mat_descr; -#endif - -#if defined(HYPRE_USING_ROCSPARSE) - rocsparse_mat_descr mat_descr; - rocsparse_mat_info mat_info; -#endif -}; - -#define hypre_GpuMatDataMatDecsr(data) ((data) -> mat_descr) -#define hypre_GpuMatDataMatInfo(data) ((data) -> mat_info) - -#endif //#if defined(HYPRE_USING_GPU) - -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - -#include -#if defined(HYPRE_USING_CUDA) -#include -#elif defined(HYPRE_USING_HIP) -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace thrust::placeholders; - -/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * macro for launching CUDA kernels, CUDA, Thrust, Cusparse, Curand calls - * NOTE: IN HYPRE'S DEFAULT STREAM - * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ - -#if defined(HYPRE_DEBUG) -#if defined(HYPRE_USING_CUDA) -#define GPU_LAUNCH_SYNC { hypre_SyncCudaComputeStream(hypre_handle()); HYPRE_CUDA_CALL( cudaGetLastError() ); } -#elif defined(HYPRE_USING_HIP) -#define GPU_LAUNCH_SYNC { hypre_SyncCudaComputeStream(hypre_handle()); HYPRE_HIP_CALL( hipGetLastError() ); } -#endif -#else // #if defined(HYPRE_DEBUG) -#define GPU_LAUNCH_SYNC -#endif // defined(HYPRE_DEBUG) - -#define HYPRE_CUDA_LAUNCH2(kernel_name, gridsize, blocksize, shmem_size, ...) \ -{ \ - if ( gridsize.x == 0 || gridsize.y == 0 || gridsize.z == 0 || \ - blocksize.x == 0 || blocksize.y == 0 || blocksize.z == 0 ) \ - { \ - /* printf("Warning %s %d: Zero CUDA grid/block (%d %d %d) (%d %d %d)\n", \ - __FILE__, __LINE__, \ - gridsize.x, gridsize.y, gridsize.z, blocksize.x, blocksize.y, blocksize.z); */ \ - } \ - else \ - { \ - (kernel_name) <<< (gridsize), (blocksize), shmem_size, hypre_HandleCudaComputeStream(hypre_handle()) >>> (__VA_ARGS__); \ - GPU_LAUNCH_SYNC; \ - } \ -} - -#define HYPRE_CUDA_LAUNCH(kernel_name, gridsize, blocksize, ...) HYPRE_CUDA_LAUNCH2(kernel_name, gridsize, blocksize, 0, __VA_ARGS__) - -/* RL: TODO Want macro HYPRE_THRUST_CALL to return value but I don't know how to do it right - * The following one works OK for now */ - -#if defined(HYPRE_USING_CUDA) -#define HYPRE_THRUST_CALL(func_name, ...) \ - thrust::func_name(thrust::cuda::par(hypre_HandleDeviceAllocator(hypre_handle())).on(hypre_HandleCudaComputeStream(hypre_handle())), __VA_ARGS__); -#elif defined(HYPRE_USING_HIP) -#define HYPRE_THRUST_CALL(func_name, ...) \ - thrust::func_name(thrust::hip::par(hypre_HandleDeviceAllocator(hypre_handle())).on(hypre_HandleCudaComputeStream(hypre_handle())), __VA_ARGS__); -#endif - -/* return the number of threads in block */ -template -static __device__ __forceinline__ -hypre_int hypre_cuda_get_num_threads() -{ - switch (dim) - { - case 1: - return (blockDim.x); - case 2: - return (blockDim.x * blockDim.y); - case 3: - return (blockDim.x * blockDim.y * blockDim.z); - } - - return -1; -} - -/* return the flattened thread id in block */ -template -static __device__ __forceinline__ -hypre_int hypre_cuda_get_thread_id() -{ - switch (dim) - { - case 1: - return (threadIdx.x); - case 2: - return (threadIdx.y * blockDim.x + threadIdx.x); - case 3: - return (threadIdx.z * blockDim.x * blockDim.y + threadIdx.y * blockDim.x + - threadIdx.x); - } - - return -1; -} - -/* return the number of warps in block */ -template -static __device__ __forceinline__ -hypre_int hypre_cuda_get_num_warps() -{ - return hypre_cuda_get_num_threads() >> HYPRE_WARP_BITSHIFT; -} - -/* return the warp id in block */ -template -static __device__ __forceinline__ -hypre_int hypre_cuda_get_warp_id() -{ - return hypre_cuda_get_thread_id() >> HYPRE_WARP_BITSHIFT; -} - -/* return the thread lane id in warp */ -template -static __device__ __forceinline__ -hypre_int hypre_cuda_get_lane_id() -{ - return hypre_cuda_get_thread_id() & (HYPRE_WARP_SIZE-1); -} - -/* return the num of blocks in grid */ -template -static __device__ __forceinline__ -hypre_int hypre_cuda_get_num_blocks() -{ - switch (dim) - { - case 1: - return (gridDim.x); - case 2: - return (gridDim.x * gridDim.y); - case 3: - return (gridDim.x * gridDim.y * gridDim.z); - } - - return -1; -} - -/* return the flattened block id in grid */ -template -static __device__ __forceinline__ -hypre_int hypre_cuda_get_block_id() -{ - switch (dim) - { - case 1: - return (blockIdx.x); - case 2: - return (blockIdx.y * gridDim.x + blockIdx.x); - case 3: - return (blockIdx.z * gridDim.x * gridDim.y + blockIdx.y * gridDim.x + - blockIdx.x); - } - - return -1; -} - -/* return the number of threads in grid */ -template -static __device__ __forceinline__ -hypre_int hypre_cuda_get_grid_num_threads() -{ - return hypre_cuda_get_num_blocks() * hypre_cuda_get_num_threads(); -} - -/* return the flattened thread id in grid */ -template -static __device__ __forceinline__ -hypre_int hypre_cuda_get_grid_thread_id() -{ - return hypre_cuda_get_block_id() * hypre_cuda_get_num_threads() + - hypre_cuda_get_thread_id(); -} - -/* return the number of warps in grid */ -template -static __device__ __forceinline__ -hypre_int hypre_cuda_get_grid_num_warps() -{ - return hypre_cuda_get_num_blocks() * hypre_cuda_get_num_warps(); -} - -/* return the flattened warp id in grid */ -template -static __device__ __forceinline__ -hypre_int hypre_cuda_get_grid_warp_id() -{ - return hypre_cuda_get_block_id() * hypre_cuda_get_num_warps() + - hypre_cuda_get_warp_id(); -} - -#if defined(__CUDA_ARCH__) && __CUDA_ARCH__ < 600 -static __device__ __forceinline__ -hypre_double atomicAdd(hypre_double* address, hypre_double val) -{ - hypre_ulonglongint* address_as_ull = (hypre_ulonglongint*) address; - hypre_ulonglongint old = *address_as_ull, assumed; - - do { - assumed = old; - old = atomicCAS(address_as_ull, assumed, - __double_as_longlong(val + - __longlong_as_double(assumed))); - - // Note: uses integer comparison to avoid hang in case of NaN (since NaN != NaN) - } while (assumed != old); - - return __longlong_as_double(old); -} -#endif - -// There are no *_sync functions in HIP -#if defined(HYPRE_USING_HIP) || (CUDA_VERSION < 9000) - -template -static __device__ __forceinline__ -T __shfl_sync(unsigned mask, T val, hypre_int src_line, hypre_int width=HYPRE_WARP_SIZE) -{ - return __shfl(val, src_line, width); -} - -template -static __device__ __forceinline__ -T __shfl_down_sync(unsigned mask, T val, unsigned delta, hypre_int width=HYPRE_WARP_SIZE) -{ - return __shfl_down(val, delta, width); -} - -template -static __device__ __forceinline__ -T __shfl_xor_sync(unsigned mask, T val, unsigned lanemask, hypre_int width=HYPRE_WARP_SIZE) -{ - return __shfl_xor(val, lanemask, width); -} - -template -static __device__ __forceinline__ -T __shfl_up_sync(unsigned mask, T val, unsigned delta, hypre_int width=HYPRE_WARP_SIZE) -{ - return __shfl_up(val, delta, width); -} - -static __device__ __forceinline__ -void __syncwarp() -{ -} - -#endif // #if defined(HYPRE_USING_HIP) || (CUDA_VERSION < 9000) - - -// __any was technically deprecated in CUDA 7 so we don't bother -// with this overload for CUDA, just for HIP. -#if defined(HYPRE_USING_HIP) -static __device__ __forceinline__ -hypre_int __any_sync(unsigned mask, hypre_int predicate) -{ - return __any(predicate); -} -#endif - - -template -static __device__ __forceinline__ -T read_only_load( const T *ptr ) -{ - return __ldg( ptr ); -} - -/* exclusive prefix scan */ -template -static __device__ __forceinline__ -T warp_prefix_sum(hypre_int lane_id, T in, T &all_sum) -{ -#pragma unroll - for (hypre_int d = 2; d <=HYPRE_WARP_SIZE; d <<= 1) - { - T t = __shfl_up_sync(HYPRE_WARP_FULL_MASK, in, d >> 1); - if ( (lane_id & (d - 1)) == (d - 1) ) - { - in += t; - } - } - - all_sum = __shfl_sync(HYPRE_WARP_FULL_MASK, in, HYPRE_WARP_SIZE-1); - - if (lane_id == HYPRE_WARP_SIZE-1) - { - in = 0; - } - -#pragma unroll - for (hypre_int d = HYPRE_WARP_SIZE/2; d > 0; d >>= 1) - { - T t = __shfl_xor_sync(HYPRE_WARP_FULL_MASK, in, d); - - if ( (lane_id & (d - 1)) == (d - 1)) - { - if ( (lane_id & ((d << 1) - 1)) == ((d << 1) - 1) ) - { - in += t; - } - else - { - in = t; - } - } - } - return in; -} - -template -static __device__ __forceinline__ -T warp_reduce_sum(T in) -{ -#pragma unroll - for (hypre_int d = HYPRE_WARP_SIZE/2; d > 0; d >>= 1) - { - in += __shfl_down_sync(HYPRE_WARP_FULL_MASK, in, d); - } - return in; -} - -template -static __device__ __forceinline__ -T warp_allreduce_sum(T in) -{ -#pragma unroll - for (hypre_int d = HYPRE_WARP_SIZE/2; d > 0; d >>= 1) - { - in += __shfl_xor_sync(HYPRE_WARP_FULL_MASK, in, d); - } - return in; -} - -template -static __device__ __forceinline__ -T warp_reduce_max(T in) -{ -#pragma unroll - for (hypre_int d = HYPRE_WARP_SIZE/2; d > 0; d >>= 1) - { - in = max(in, __shfl_down_sync(HYPRE_WARP_FULL_MASK, in, d)); - } - return in; -} - -template -static __device__ __forceinline__ -T warp_allreduce_max(T in) -{ -#pragma unroll - for (hypre_int d = HYPRE_WARP_SIZE/2; d > 0; d >>= 1) - { - in = max(in, __shfl_xor_sync(HYPRE_WARP_FULL_MASK, in, d)); - } - return in; -} - -template -static __device__ __forceinline__ -T warp_reduce_min(T in) -{ -#pragma unroll - for (hypre_int d = HYPRE_WARP_SIZE/2; d > 0; d >>= 1) - { - in = min(in, __shfl_down_sync(HYPRE_WARP_FULL_MASK, in, d)); - } - return in; -} - -template -static __device__ __forceinline__ -T warp_allreduce_min(T in) -{ -#pragma unroll - for (hypre_int d = HYPRE_WARP_SIZE/2; d > 0; d >>= 1) - { - in = min(in, __shfl_xor_sync(HYPRE_WARP_FULL_MASK, in, d)); - } - return in; -} - -static __device__ __forceinline__ -hypre_int next_power_of_2(hypre_int n) -{ - if (n <= 0) - { - return 0; - } - - /* if n is power of 2, return itself */ - if ( (n & (n - 1)) == 0 ) - { - return n; - } - - n |= (n >> 1); - n |= (n >> 2); - n |= (n >> 4); - n |= (n >> 8); - n |= (n >> 16); - n ^= (n >> 1); - n = (n << 1); - - return n; -} - -template -struct absolute_value : public thrust::unary_function -{ - __host__ __device__ T operator()(const T &x) const - { - return x < T(0) ? -x : x; - } -}; - -template -struct TupleComp2 -{ - typedef thrust::tuple Tuple; - - __host__ __device__ bool operator()(const Tuple& t1, const Tuple& t2) - { - if (thrust::get<0>(t1) < thrust::get<0>(t2)) - { - return true; - } - if (thrust::get<0>(t1) > thrust::get<0>(t2)) - { - return false; - } - return hypre_abs(thrust::get<1>(t1)) > hypre_abs(thrust::get<1>(t2)); - } -}; - -template -struct TupleComp3 -{ - typedef thrust::tuple Tuple; - - __host__ __device__ bool operator()(const Tuple& t1, const Tuple& t2) - { - if (thrust::get<0>(t1) < thrust::get<0>(t2)) - { - return true; - } - if (thrust::get<0>(t1) > thrust::get<0>(t2)) - { - return false; - } - if (thrust::get<0>(t2) == thrust::get<1>(t2)) - { - return false; - } - return thrust::get<0>(t1) == thrust::get<1>(t1) || thrust::get<1>(t1) < thrust::get<1>(t2); - } -}; - -template -struct is_negative : public thrust::unary_function -{ - __host__ __device__ bool operator()(const T &x) - { - return (x < 0); - } -}; - -template -struct is_positive : public thrust::unary_function -{ - __host__ __device__ bool operator()(const T &x) - { - return (x > 0); - } -}; - -template -struct is_nonnegative : public thrust::unary_function -{ - __host__ __device__ bool operator()(const T &x) - { - return (x >= 0); - } -}; - -template -struct in_range : public thrust::unary_function -{ - T low, up; - - in_range(T low_, T up_) { low = low_; up = up_; } - - __host__ __device__ bool operator()(const T &x) - { - return (x >= low && x <= up); - } -}; - -template -struct out_of_range : public thrust::unary_function -{ - T low, up; - - out_of_range(T low_, T up_) { low = low_; up = up_; } - - __host__ __device__ bool operator()(const T &x) - { - return (x < low || x > up); - } -}; - -template -struct less_than : public thrust::unary_function -{ - T val; - - less_than(T val_) { val = val_; } - - __host__ __device__ bool operator()(const T &x) - { - return (x < val); - } -}; - -template -struct modulo : public thrust::unary_function -{ - T val; - - modulo(T val_) { val = val_; } - - __host__ __device__ T operator()(const T &x) - { - return (x % val); - } -}; - -template -struct equal : public thrust::unary_function -{ - T val; - - equal(T val_) { val = val_; } - - __host__ __device__ bool operator()(const T &x) - { - return (x == val); - } -}; - -struct print_functor -{ - __host__ __device__ void operator()(HYPRE_Real val) - { - printf("%f\n", val); - } -}; - -/* cuda_utils.c */ -dim3 hypre_GetDefaultCUDABlockDimension(); - -dim3 hypre_GetDefaultCUDAGridDimension( HYPRE_Int n, const char *granularity, dim3 bDim ); - -template HYPRE_Int hypreDevice_StableSortByTupleKey(HYPRE_Int N, T1 *keys1, T2 *keys2, T3 *vals, HYPRE_Int opt); - -template HYPRE_Int hypreDevice_StableSortTupleByTupleKey(HYPRE_Int N, T1 *keys1, T2 *keys2, T3 *vals1, T4 *vals2, HYPRE_Int opt); - -template HYPRE_Int hypreDevice_ReduceByTupleKey(HYPRE_Int N, T1 *keys1_in, T2 *keys2_in, T3 *vals_in, T1 *keys1_out, T2 *keys2_out, T3 *vals_out); - -template -HYPRE_Int hypreDevice_CsrRowPtrsToIndicesWithRowNum(HYPRE_Int nrows, HYPRE_Int nnz, HYPRE_Int *d_row_ptr, T *d_row_num, T *d_row_ind); - -template -HYPRE_Int hypreDevice_ScatterConstant(T *x, HYPRE_Int n, HYPRE_Int *map, T v); - -HYPRE_Int hypreDevice_GetRowNnz(HYPRE_Int nrows, HYPRE_Int *d_row_indices, HYPRE_Int *d_diag_ia, HYPRE_Int *d_offd_ia, HYPRE_Int *d_rownnz); - -HYPRE_Int hypreDevice_CopyParCSRRows(HYPRE_Int nrows, HYPRE_Int *d_row_indices, HYPRE_Int job, HYPRE_Int has_offd, HYPRE_BigInt first_col, HYPRE_BigInt *d_col_map_offd_A, HYPRE_Int *d_diag_i, HYPRE_Int *d_diag_j, HYPRE_Complex *d_diag_a, HYPRE_Int *d_offd_i, HYPRE_Int *d_offd_j, HYPRE_Complex *d_offd_a, HYPRE_Int *d_ib, HYPRE_BigInt *d_jb, HYPRE_Complex *d_ab); - -HYPRE_Int hypreDevice_IntegerReduceSum(HYPRE_Int m, HYPRE_Int *d_i); - -HYPRE_Int hypreDevice_IntegerInclusiveScan(HYPRE_Int n, HYPRE_Int *d_i); - -HYPRE_Int hypreDevice_IntegerExclusiveScan(HYPRE_Int n, HYPRE_Int *d_i); - -HYPRE_Int* hypreDevice_CsrRowPtrsToIndices(HYPRE_Int nrows, HYPRE_Int nnz, HYPRE_Int *d_row_ptr); - -HYPRE_Int hypreDevice_CsrRowPtrsToIndices_v2(HYPRE_Int nrows, HYPRE_Int nnz, HYPRE_Int *d_row_ptr, HYPRE_Int *d_row_ind); - -HYPRE_Int* hypreDevice_CsrRowIndicesToPtrs(HYPRE_Int nrows, HYPRE_Int nnz, HYPRE_Int *d_row_ind); - -HYPRE_Int hypreDevice_CsrRowIndicesToPtrs_v2(HYPRE_Int nrows, HYPRE_Int nnz, HYPRE_Int *d_row_ind, HYPRE_Int *d_row_ptr); - -HYPRE_Int hypreDevice_GenScatterAdd(HYPRE_Real *x, HYPRE_Int ny, HYPRE_Int *map, HYPRE_Real *y, char *work); - -HYPRE_Int hypreDevice_BigToSmallCopy(HYPRE_Int *tgt, const HYPRE_BigInt *src, HYPRE_Int size); - -void hypre_CudaCompileFlagCheck(); - -#if defined(HYPRE_USING_CUDA) -cudaError_t hypre_CachingMallocDevice(void **ptr, size_t nbytes); - -cudaError_t hypre_CachingMallocManaged(void **ptr, size_t nbytes); - -cudaError_t hypre_CachingFreeDevice(void *ptr); - -cudaError_t hypre_CachingFreeManaged(void *ptr); -#endif - -hypre_cub_CachingDeviceAllocator * hypre_CudaDataCubCachingAllocatorCreate(hypre_uint bin_growth, hypre_uint min_bin, hypre_uint max_bin, size_t max_cached_bytes, bool skip_cleanup, bool debug, bool use_managed_memory); - -void hypre_CudaDataCubCachingAllocatorDestroy(hypre_CudaData *data); - -#endif // #if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - -#if defined(HYPRE_USING_CUSPARSE) - -cudaDataType hypre_HYPREComplexToCudaDataType(); - -cusparseIndexType_t hypre_HYPREIntToCusparseIndexType(); - -#endif // #if defined(HYPRE_USING_CUSPARSE) - -#endif /* #ifndef HYPRE_CUDA_UTILS_H */ diff --git a/external/hypre/src/utilities/device_allocator.h b/external/hypre/src/utilities/device_allocator.h index f8307f72..e38e26fb 100644 --- a/external/hypre/src/utilities/device_allocator.h +++ b/external/hypre/src/utilities/device_allocator.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -10,8 +10,7 @@ #if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) -/* C++ style memory allocator for GPU **device** memory - * Just wraps _hypre_TAlloc and _hypre_TFree */ +/* C++ style memory allocator for the device using the abstract memory model */ struct hypre_device_allocator { typedef char value_type; @@ -28,12 +27,13 @@ struct hypre_device_allocator char *allocate(std::ptrdiff_t num_bytes) { - return _hypre_TAlloc(char, num_bytes, hypre_MEMORY_DEVICE); + return hypre_TAlloc(char, num_bytes, HYPRE_MEMORY_DEVICE); } void deallocate(char *ptr, size_t n) { - _hypre_TFree(ptr, hypre_MEMORY_DEVICE); + HYPRE_UNUSED_VAR(n); + hypre_TFree(ptr, HYPRE_MEMORY_DEVICE); } }; diff --git a/external/hypre/src/utilities/cuda_reducer.h b/external/hypre/src/utilities/device_reducer.h similarity index 64% rename from external/hypre/src/utilities/cuda_reducer.h rename to external/hypre/src/utilities/device_reducer.h index d489bb58..5bd14dc8 100644 --- a/external/hypre/src/utilities/cuda_reducer.h +++ b/external/hypre/src/utilities/device_reducer.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,7 +17,7 @@ template void OneBlockReduce(T *d_arr, HYPRE_Int N, T *h_out); struct HYPRE_double4 { - HYPRE_Real x,y,z,w; + HYPRE_Real x, y, z, w; __host__ __device__ HYPRE_double4() {} @@ -50,7 +50,7 @@ struct HYPRE_double4 struct HYPRE_double6 { - HYPRE_Real x,y,z,w,u,v; + HYPRE_Real x, y, z, w, u, v; __host__ __device__ HYPRE_double6() {} @@ -91,42 +91,44 @@ __inline__ __host__ __device__ HYPRE_Real warpReduceSum(HYPRE_Real val) { #if defined(__CUDA_ARCH__) || defined(__HIP_DEVICE_COMPILE__) - for (HYPRE_Int offset = warpSize/2; offset > 0; offset /= 2) - { - val += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val, offset); - } + for (HYPRE_Int offset = warpSize / 2; offset > 0; offset /= 2) + { + val += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val, offset); + } #endif - return val; + return val; } __inline__ __host__ __device__ -HYPRE_double4 warpReduceSum(HYPRE_double4 val) { +HYPRE_double4 warpReduceSum(HYPRE_double4 val) +{ #if defined(__CUDA_ARCH__) || defined(__HIP_DEVICE_COMPILE__) - for (HYPRE_Int offset = warpSize / 2; offset > 0; offset /= 2) - { - val.x += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.x, offset); - val.y += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.y, offset); - val.z += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.z, offset); - val.w += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.w, offset); - } + for (HYPRE_Int offset = warpSize / 2; offset > 0; offset /= 2) + { + val.x += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.x, offset); + val.y += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.y, offset); + val.z += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.z, offset); + val.w += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.w, offset); + } #endif - return val; + return val; } __inline__ __host__ __device__ -HYPRE_double6 warpReduceSum(HYPRE_double6 val) { +HYPRE_double6 warpReduceSum(HYPRE_double6 val) +{ #if defined(__CUDA_ARCH__) || defined(__HIP_DEVICE_COMPILE__) - for (HYPRE_Int offset = warpSize / 2; offset > 0; offset /= 2) - { - val.x += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.x, offset); - val.y += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.y, offset); - val.z += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.z, offset); - val.w += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.w, offset); - val.u += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.u, offset); - val.v += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.v, offset); - } + for (HYPRE_Int offset = warpSize / 2; offset > 0; offset /= 2) + { + val.x += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.x, offset); + val.y += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.y, offset); + val.z += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.z, offset); + val.w += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.w, offset); + val.u += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.u, offset); + val.v += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.v, offset); + } #endif - return val; + return val; } /* reduction within a block */ @@ -135,26 +137,26 @@ __inline__ __host__ __device__ T blockReduceSum(T val) { #if defined(__CUDA_ARCH__) || defined(__HIP_DEVICE_COMPILE__) - //static __shared__ T shared[HYPRE_WARP_SIZE]; // Shared mem for HYPRE_WARP_SIZE partial sums + // Shared mem for HYPRE_WARP_SIZE partial sums + __shared__ T shared[HYPRE_WARP_SIZE]; - __shared__ T shared[HYPRE_WARP_SIZE]; // Shared mem for HYPRE_WARP_SIZE partial sums - - //HYPRE_Int lane = threadIdx.x % warpSize; - //HYPRE_Int wid = threadIdx.x / warpSize; HYPRE_Int lane = threadIdx.x & (warpSize - 1); HYPRE_Int wid = threadIdx.x >> HYPRE_WARP_BITSHIFT; - val = warpReduceSum(val); // Each warp performs partial reduction + // Each warp performs partial reduction + val = warpReduceSum(val); + // Write reduced value to shared memory if (lane == 0) { - shared[wid] = val; // Write reduced value to shared memory + shared[wid] = val; } - __syncthreads(); // Wait for all partial reductions + // Wait for all partial reductions + __syncthreads(); - //read from shared memory only if that warp existed - if (threadIdx.x < blockDim.x / warpSize) + // read from shared memory only if that warp existed + if (threadIdx.x < (blockDim.x >> HYPRE_WARP_BITSHIFT)) { val = shared[lane]; } @@ -163,9 +165,10 @@ T blockReduceSum(T val) val = 0.0; } + // Final reduce within first warp if (wid == 0) { - val = warpReduceSum(val); //Final reduce within first warp + val = warpReduceSum(val); } #endif @@ -174,15 +177,21 @@ T blockReduceSum(T val) template __global__ void -OneBlockReduceKernel(T *arr, HYPRE_Int N) +OneBlockReduceKernel(hypre_DeviceItem &item, + T *arr, + HYPRE_Int N) { T sum; + sum = 0.0; + if (threadIdx.x < N) { sum = arr[threadIdx.x]; } + sum = blockReduceSum(sum); + if (threadIdx.x == 0) { arr[0] = sum; @@ -210,14 +219,6 @@ struct ReduceSum init = val; __thread_sum = 0.0; nblocks = -1; - - if (hypre_HandleCudaReduceBuffer(hypre_handle()) == NULL) - { - /* allocate for the max size for reducing double6 type */ - hypre_HandleCudaReduceBuffer(hypre_handle()) = hypre_TAlloc(HYPRE_double6, 1024, HYPRE_MEMORY_DEVICE); - } - - d_buf = (T*) hypre_HandleCudaReduceBuffer(hypre_handle()); } /* copy constructor */ @@ -227,6 +228,19 @@ struct ReduceSum *this = other; } + __host__ void + Allocate2ndPhaseBuffer() + { + if (hypre_HandleReduceBuffer(hypre_handle()) == NULL) + { + /* allocate for the max size for reducing double6 type */ + hypre_HandleReduceBuffer(hypre_handle()) = + hypre_TAlloc(HYPRE_double6, HYPRE_MAX_NTHREADS_BLOCK, HYPRE_MEMORY_DEVICE); + } + + d_buf = (T*) hypre_HandleReduceBuffer(hypre_handle()); + } + /* reduction within blocks */ __host__ __device__ void BlockReduce() const @@ -252,7 +266,8 @@ struct ReduceSum { T val; - HYPRE_ExecutionPolicy exec_policy = hypre_HandleStructExecPolicy(hypre_handle()); + const HYPRE_MemoryLocation memory_location = hypre_HandleMemoryLocation(hypre_handle()); + const HYPRE_ExecutionPolicy exec_policy = hypre_GetExecPolicy1(memory_location); if (exec_policy == HYPRE_EXEC_HOST) { @@ -262,9 +277,9 @@ struct ReduceSum else { /* 2nd reduction with only *one* block */ - hypre_assert(nblocks >= 0 && nblocks <= 1024); - const dim3 gDim(1), bDim(1024); - HYPRE_CUDA_LAUNCH( OneBlockReduceKernel, gDim, bDim, d_buf, nblocks ); + hypre_assert(nblocks >= 0 && nblocks <= HYPRE_MAX_NTHREADS_BLOCK); + const dim3 gDim(1), bDim(HYPRE_MAX_NTHREADS_BLOCK); + HYPRE_GPU_LAUNCH( OneBlockReduceKernel, gDim, bDim, d_buf, nblocks ); hypre_TMemcpy(&val, d_buf, T, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); val += init; } diff --git a/external/hypre/src/utilities/device_utils.c b/external/hypre/src/utilities/device_utils.c new file mode 100644 index 00000000..569290c5 --- /dev/null +++ b/external/hypre/src/utilities/device_utils.c @@ -0,0 +1,3078 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#include "_hypre_onedpl.hpp" +#include "_hypre_utilities.h" +#include "_hypre_utilities.hpp" +#include + +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * generic device functions (HYPRE_USING_GPU) + * NOTE: This includes device openmp for now + * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ +#if defined(HYPRE_USING_GPU) + +/*-------------------------------------------------------------------- + * hypre_DeviceDataCreate + *--------------------------------------------------------------------*/ + +hypre_DeviceData* +hypre_DeviceDataCreate() +{ + /* Note: this allocation is done directly with calloc in order to + avoid a segmentation fault when building with HYPRE_USING_UMPIRE_HOST */ + hypre_DeviceData *data = (hypre_DeviceData*) calloc(1, sizeof(hypre_DeviceData)); + +#if defined(HYPRE_USING_SYCL) + hypre_DeviceDataDevice(data) = nullptr; +#else + hypre_DeviceDataDevice(data) = 0; +#endif + hypre_DeviceDataComputeStreamNum(data) = 0; + + /* SpMV, SpGeMM, SpTrans: use vendor's lib by default */ +#if defined(HYPRE_USING_CUSPARSE) || defined(HYPRE_USING_ROCSPARSE) || defined(HYPRE_USING_ONEMKLSPARSE) + hypre_DeviceDataSpgemmUseVendor(data) = 1; + hypre_DeviceDataSpMVUseVendor(data) = 1; + hypre_DeviceDataSpTransUseVendor(data) = 1; +#else + hypre_DeviceDataSpgemmUseVendor(data) = 0; + hypre_DeviceDataSpMVUseVendor(data) = 0; + hypre_DeviceDataSpTransUseVendor(data) = 0; +#endif + /* for CUDA, it seems cusparse is slow due to memory allocation inside the transposition */ +#if defined(HYPRE_USING_CUDA) + hypre_DeviceDataSpTransUseVendor(data) = 0; +#endif + + /* hypre SpGEMM parameters */ + const HYPRE_Int Nsamples = 64; + const HYPRE_Real sigma = 1.0 / hypre_sqrt((HYPRE_Real)(Nsamples - 2.0)); + const HYPRE_Real multfactor = 1.0 / (1.0 - 3.0 * sigma); + + hypre_DeviceDataSpgemmAlgorithm(data) = 1; + hypre_DeviceDataSpgemmBinned(data) = 0; + hypre_DeviceDataSpgemmNumBin(data) = 0; + hypre_DeviceDataSpgemmHighestBin(data)[0] = 0; + hypre_DeviceDataSpgemmHighestBin(data)[1] = 0; + /* 1: naive overestimate, 2: naive underestimate, 3: Cohen's algorithm */ + hypre_DeviceDataSpgemmRownnzEstimateMethod(data) = 3; + hypre_DeviceDataSpgemmRownnzEstimateNsamples(data) = Nsamples; + hypre_DeviceDataSpgemmRownnzEstimateMultFactor(data) = multfactor; + + /* pmis */ +#if defined(HYPRE_USING_CURAND) || defined(HYPRE_USING_ROCRAND) || defined(HYPRE_USING_ONEMKLRAND) + hypre_DeviceDataUseGpuRand(data) = 1; +#else + hypre_DeviceDataUseGpuRand(data) = 0; +#endif + + /* device pool */ +#ifdef HYPRE_USING_DEVICE_POOL + hypre_DeviceDataCubBinGrowth(data) = 8u; + hypre_DeviceDataCubMinBin(data) = 1u; + hypre_DeviceDataCubMaxBin(data) = (hypre_uint) - 1; + hypre_DeviceDataCubMaxCachedBytes(data) = (size_t) -1; + hypre_DeviceDataCubDevAllocator(data) = NULL; + hypre_DeviceDataCubUvmAllocator(data) = NULL; +#endif + + return data; +} + +/*-------------------------------------------------------------------- + * hypre_DeviceDataDestroy + *--------------------------------------------------------------------*/ + +void +hypre_DeviceDataDestroy(hypre_DeviceData *data) +{ + if (!data) + { + return; + } + + hypre_TFree(hypre_DeviceDataReduceBuffer(data), HYPRE_MEMORY_DEVICE); + +#if defined(HYPRE_USING_CURAND) + if (data->curand_generator) + { + HYPRE_CURAND_CALL( curandDestroyGenerator(data->curand_generator) ); + } +#endif + +#if defined(HYPRE_USING_ROCRAND) + if (data->curand_generator) + { + HYPRE_ROCRAND_CALL( rocrand_destroy_generator(data->curand_generator) ); + } +#endif + +#if defined(HYPRE_USING_CUBLAS) + if (data->cublas_handle) + { + HYPRE_CUBLAS_CALL( cublasDestroy(data->cublas_handle) ); + } +#endif + +#if defined(HYPRE_USING_CUSPARSE) || defined(HYPRE_USING_ROCSPARSE) + if (data->cusparse_handle) + { +#if defined(HYPRE_USING_CUSPARSE) + HYPRE_CUSPARSE_CALL( cusparseDestroy(data->cusparse_handle) ); +#elif defined(HYPRE_USING_ROCSPARSE) + HYPRE_ROCSPARSE_CALL( rocsparse_destroy_handle(data->cusparse_handle) ); +#endif + } +#endif // #if defined(HYPRE_USING_CUSPARSE) || defined(HYPRE_USING_ROCSPARSE) + +#if defined(HYPRE_USING_CUSOLVER) || defined(HYPRE_USING_ROCSOLVER) + if (data->vendor_solver_handle) + { +#if defined(HYPRE_USING_CUSOLVER) + HYPRE_CUSOLVER_CALL(cusolverDnDestroy(data->vendor_solver_handle)); +#else + HYPRE_ROCBLAS_CALL(rocblas_destroy_handle(data->vendor_solver_handle)); +#endif + } +#endif // #if defined(HYPRE_USING_CUSOLVER) || defined(HYPRE_USING_ROCSOLVER) + +#if defined(HYPRE_USING_CUDA_STREAMS) + for (HYPRE_Int i = 0; i < HYPRE_MAX_NUM_STREAMS; i++) + { + if (data->streams[i]) + { +#if defined(HYPRE_USING_CUDA) + HYPRE_CUDA_CALL( cudaStreamDestroy(data->streams[i]) ); +#elif defined(HYPRE_USING_HIP) + HYPRE_HIP_CALL( hipStreamDestroy(data->streams[i]) ); +#elif defined(HYPRE_USING_SYCL) + delete data->streams[i]; + data->streams[i] = nullptr; +#endif + } + } +#endif + +#ifdef HYPRE_USING_DEVICE_POOL + hypre_DeviceDataCubCachingAllocatorDestroy(data); +#endif + +#if defined(HYPRE_USING_SYCL) + delete data->device; + data->device = nullptr; +#endif + + /* Note: Directly using free since this variable was allocated with calloc */ + free((void*) data); +} + +/*-------------------------------------------------------------------- + * hypre_SyncDevice + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SyncDevice() +{ +#if defined(HYPRE_USING_CUDA) + HYPRE_CUDA_CALL( cudaDeviceSynchronize() ); +#elif defined(HYPRE_USING_HIP) + HYPRE_HIP_CALL( hipDeviceSynchronize() ); +#elif defined(HYPRE_USING_SYCL) + try + { + HYPRE_SYCL_CALL( hypre_HandleComputeStream(hypre_handle())->wait_and_throw() ); + } + catch (sycl::exception const &exc) + { + std::cerr << exc.what() << "Exception caught at file:" << __FILE__ + << ", line:" << __LINE__ << std::endl; + std::exit(1); + } +#endif + return hypre_error_flag; +} + +/*-------------------------------------------------------------------- + * hypre_ResetDevice + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ResetDevice() +{ +#if defined(HYPRE_USING_CUDA) + HYPRE_CUDA_CALL(cudaDeviceReset()); + +#elif defined(HYPRE_USING_HIP) + HYPRE_HIP_CALL(hipDeviceReset()); +#endif + return hypre_error_flag; +} + +/*-------------------------------------------------------------------- + * hypre_SyncComputeStream_core + * + * Synchronize the Hypre compute stream + * + * action: 0: set sync stream to false + * 1: set sync stream to true + * 2: restore sync stream to default + * 3: return the current value of cuda_compute_stream_sync + * 4: sync stream based on cuda_compute_stream_sync + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SyncComputeStream_core(HYPRE_Int action, + hypre_Handle *hypre_handle, + HYPRE_Int *cuda_compute_stream_sync_ptr) +{ + /* with UVM the default is to sync at kernel completions, since host is also able to + * touch GPU memory */ +#if defined(HYPRE_USING_UNIFIED_MEMORY) + static const HYPRE_Int cuda_compute_stream_sync_default = 1; +#else + static const HYPRE_Int cuda_compute_stream_sync_default = 0; +#endif + + /* this controls if synchronize the stream after computations */ + static HYPRE_Int cuda_compute_stream_sync = cuda_compute_stream_sync_default; + + switch (action) + { + case 0: + cuda_compute_stream_sync = 0; + break; + case 1: + cuda_compute_stream_sync = 1; + break; + case 2: + cuda_compute_stream_sync = cuda_compute_stream_sync_default; + break; + case 3: + *cuda_compute_stream_sync_ptr = cuda_compute_stream_sync; + break; + case 4: + if (hypre_HandleDefaultExecPolicy(hypre_handle) == HYPRE_EXEC_DEVICE && cuda_compute_stream_sync) + { +#if defined(HYPRE_USING_CUDA) + HYPRE_CUDA_CALL( cudaStreamSynchronize(hypre_HandleComputeStream(hypre_handle)) ); +#elif defined(HYPRE_USING_HIP) + HYPRE_HIP_CALL( hipStreamSynchronize(hypre_HandleComputeStream(hypre_handle)) ); +#elif defined(HYPRE_USING_SYCL) + HYPRE_SYCL_CALL( hypre_HandleComputeStream(hypre_handle)->ext_oneapi_submit_barrier() ); +#endif + } + break; + default: + hypre_printf("hypre_SyncComputeStream_core invalid action\n"); + hypre_error_in_arg(1); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------- + * hypre_SetSyncCudaCompute + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SetSyncCudaCompute(HYPRE_Int action) +{ + /* convert to 1/0 */ + action = action != 0; + hypre_SyncComputeStream_core(action, NULL, NULL); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------- + * hypre_RestoreSyncCudaCompute + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypre_RestoreSyncCudaCompute() +{ + hypre_SyncComputeStream_core(2, NULL, NULL); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------- + * hypre_GetSyncCudaCompute + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GetSyncCudaCompute(HYPRE_Int *cuda_compute_stream_sync_ptr) +{ + hypre_SyncComputeStream_core(3, NULL, cuda_compute_stream_sync_ptr); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------- + * hypre_SyncComputeStream + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SyncComputeStream() +{ + hypre_SyncComputeStream_core(4, hypre_handle(), NULL); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------- + * hypre_ForceSyncComputeStream + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ForceSyncComputeStream() +{ + HYPRE_Int sync_stream; + hypre_GetSyncCudaCompute(&sync_stream); + hypre_SetSyncCudaCompute(1); + hypre_SyncComputeStream_core(4, hypre_handle(), NULL); + hypre_SetSyncCudaCompute(sync_stream); + + return hypre_error_flag; +} + +#endif // #if defined(HYPRE_USING_GPU) + +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * generic device functions (cuda/hip/sycl) + * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + +#if defined(HYPRE_USING_GPU) + +/*-------------------------------------------------------------------------- + * hypre_DeviceMemoryGetUsage + * + * Retrieves memory usage statistics for the current GPU device. The function + * fills an array with memory data, converted to gibibytes (GiB): + * + * - mem[0]: Current memory usage (allocated by the process). + * - mem[1]: Total device memory available on the GPU. + * + * This implementation supports NVIDIA GPUs using CUDA and AMD GPUs using HIP. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_DeviceMemoryGetUsage(HYPRE_Real *mem) +{ + size_t free_mem = 0; + size_t total_mem = 0; + HYPRE_Real b_to_gib = (HYPRE_Real)(1 << 30); + + /* Sanity check */ + if (!mem) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Mem is a NULL pointer!"); + return hypre_error_flag; + } + + /* Get free and total memory available on the device */ +#if defined(HYPRE_USING_CUDA) + HYPRE_CUDA_CALL(cudaMemGetInfo(&free_mem, &total_mem)); + +#elif defined(HYPRE_USING_HIP) + HYPRE_HIP_CALL(hipMemGetInfo(&free_mem, &total_mem)); + +#else + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "No supported GPU backend found!"); + return hypre_error_flag; +#endif + + /* Convert data from bytes to GiB (HYPRE_Real) */ + mem[0] = (total_mem - free_mem) / b_to_gib; + mem[1] = total_mem / b_to_gib; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------- + * hypre_DeviceDataComputeStream + *--------------------------------------------------------------------*/ + +/* CUDA/HIP stream */ +#if defined(HYPRE_USING_CUDA) +cudaStream_t +#elif defined(HYPRE_USING_HIP) +hipStream_t +#elif defined(HYPRE_USING_SYCL) +sycl::queue* +#endif +hypre_DeviceDataComputeStream(hypre_DeviceData *data) +{ + return hypre_DeviceDataStream(data, hypre_DeviceDataComputeStreamNum(data)); +} + +/*-------------------------------------------------------------------- + * hypre_DeviceDataStream + *--------------------------------------------------------------------*/ + +#if defined(HYPRE_USING_CUDA) +cudaStream_t +#elif defined(HYPRE_USING_HIP) +hipStream_t +#elif defined(HYPRE_USING_SYCL) +sycl::queue* +#endif +hypre_DeviceDataStream(hypre_DeviceData *data, HYPRE_Int i) +{ +#if defined(HYPRE_USING_CUDA) + cudaStream_t stream = 0; +#elif defined(HYPRE_USING_HIP) + hipStream_t stream = 0; +#elif defined(HYPRE_USING_SYCL) + sycl::queue *stream = NULL; +#endif + +#if defined(HYPRE_USING_CUDA_STREAMS) + if (i >= HYPRE_MAX_NUM_STREAMS) + { + /* return the default stream, i.e., the NULL stream */ + /* + hypre_printf("device stream %d exceeds the max number %d\n", + i, HYPRE_MAX_NUM_STREAMS); + */ + return NULL; + } + + if (data->streams[i]) + { + return data->streams[i]; + } + +#if defined(HYPRE_USING_CUDA) + //HYPRE_CUDA_CALL(cudaStreamCreateWithFlags(&stream,cudaStreamNonBlocking)); + HYPRE_CUDA_CALL(cudaStreamCreateWithFlags(&stream, cudaStreamDefault)); +#elif defined(HYPRE_USING_HIP) + HYPRE_HIP_CALL(hipStreamCreateWithFlags(&stream, hipStreamDefault)); +#elif defined(HYPRE_USING_SYCL) + /* Reserve the last stream as a debugging stream on the CPU */ + if (i == HYPRE_MAX_NUM_STREAMS - 1) + { + stream = new sycl::queue(sycl::cpu_selector_v, sycl::property_list{sycl::property::queue::in_order{}}); + } + else + { + auto sycl_asynchandler = [] (sycl::exception_list exceptions) + { + for (std::exception_ptr const& e : exceptions) + { + try + { + std::rethrow_exception(e); + } + catch (sycl::exception const& ex) + { + std::cout << "Caught asynchronous SYCL exception:" << std::endl + << ex.what() << ", SYCL code: " << ex.code() << std::endl; + } + } + }; + + if (!data->device) + { + HYPRE_DeviceInitialize(); + } + sycl::device* sycl_device = data->device; + sycl::context sycl_ctxt = sycl::context(*sycl_device, sycl_asynchandler); + stream = new sycl::queue(sycl_ctxt, *sycl_device, sycl::property_list{sycl::property::queue::in_order{}}); + } +#endif + + data->streams[i] = stream; +#endif + + return stream; +} + +/*-------------------------------------------------------------------- + * hypre_GetDefaultDeviceBlockDimension + *--------------------------------------------------------------------*/ + +dim3 +hypre_GetDefaultDeviceBlockDimension() +{ +#if defined(HYPRE_USING_SYCL) + dim3 bDim(1, 1, hypre_HandleDeviceMaxWorkGroupSize(hypre_handle())); +#else + dim3 bDim(HYPRE_1D_BLOCK_SIZE, 1, 1); +#endif + + return bDim; +} + +/*-------------------------------------------------------------------- + * hypre_GetDefaultDeviceGridDimension + *--------------------------------------------------------------------*/ + +dim3 +hypre_GetDefaultDeviceGridDimension( HYPRE_Int n, + const char *granularity, + dim3 bDim ) +{ + HYPRE_Int num_blocks = 0; +#if defined(HYPRE_USING_SYCL) + HYPRE_Int num_threads_per_block = bDim.get(0) * bDim.get(1) * bDim.get(2); +#else + HYPRE_Int num_threads_per_block = bDim.x * bDim.y * bDim.z; +#endif + + if (granularity[0] == 't') + { + num_blocks = (n + num_threads_per_block - 1) / num_threads_per_block; + } + else if (granularity[0] == 'w') + { + HYPRE_Int num_warps_per_block = num_threads_per_block >> HYPRE_WARP_BITSHIFT; + + hypre_assert(num_warps_per_block * HYPRE_WARP_SIZE == num_threads_per_block); + + num_blocks = (n + num_warps_per_block - 1) / num_warps_per_block; + } + else + { + hypre_printf("Error %s %d: Unknown granularity !\n", __FILE__, __LINE__); + hypre_assert(0); + } + + dim3 gDim = hypre_dim3(num_blocks); + + return gDim; +} + +/*-------------------------------------------------------------------- + * hypre_dim3 + * NOTE: these functions are necessary due to different linearization + * procedures between cuda/hip and sycl + *--------------------------------------------------------------------*/ + +dim3 +hypre_dim3(HYPRE_Int x) +{ +#if defined(HYPRE_USING_SYCL) + dim3 d(1, 1, x); +#else + dim3 d(x); +#endif + return d; +} + +dim3 +hypre_dim3(HYPRE_Int x, HYPRE_Int y) +{ +#if defined(HYPRE_USING_SYCL) + dim3 d(1, y, x); +#else + dim3 d(x, y); +#endif + return d; +} + +dim3 +hypre_dim3(HYPRE_Int x, HYPRE_Int y, HYPRE_Int z) +{ +#if defined(HYPRE_USING_SYCL) + dim3 d(z, y, x); +#else + dim3 d(x, y, z); +#endif + return d; +} + +/*-------------------------------------------------------------------------- + * hypreGPUKernel_ArrayToArrayOfPtrs + *--------------------------------------------------------------------------*/ + +template +__global__ void +hypreGPUKernel_ArrayToArrayOfPtrs( hypre_DeviceItem &item, + HYPRE_Int n, + HYPRE_Int m, + T *data, + T **data_aop ) +{ + HYPRE_Int i = hypre_gpu_get_grid_thread_id<1, 1>(item); + + if (i < n) + { + data_aop[i] = &data[i * m]; + } +} + +/*-------------------------------------------------------------------- + * hypreDevice_ArrayToArrayOfPtrs + *--------------------------------------------------------------------*/ + +template +HYPRE_Int +hypreDevice_ArrayToArrayOfPtrs(HYPRE_Int n, HYPRE_Int m, T *data, T **data_aop) +{ + /* Trivial case */ + if (n <= 0) + { + return hypre_error_flag; + } + + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(n, "thread", bDim); + + HYPRE_GPU_LAUNCH( hypreGPUKernel_ArrayToArrayOfPtrs, gDim, bDim, n, m, data, data_aop); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------- + * hypreDevice_ComplexArrayToArrayOfPtrs + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypreDevice_ComplexArrayToArrayOfPtrs(HYPRE_Int n, + HYPRE_Int m, + HYPRE_Complex *data, + HYPRE_Complex **data_aop) +{ + return hypreDevice_ArrayToArrayOfPtrs(n, m, data, data_aop); +} + +/*-------------------------------------------------------------------- + * hypreGPUKernel_IVAXPY + *--------------------------------------------------------------------*/ + +__global__ void +hypreGPUKernel_IVAXPY( hypre_DeviceItem &item, HYPRE_Int n, HYPRE_Complex *a, HYPRE_Complex *x, + HYPRE_Complex *y) +{ + HYPRE_Int i = hypre_gpu_get_grid_thread_id<1, 1>(item); + if (i < n) + { + y[i] += x[i] / a[i]; + } +} + +/*-------------------------------------------------------------------- + * hypreDevice_IVAXPY + * + * Inverse Vector AXPY: y[i] = x[i] / a[i] + y[i] + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypreDevice_IVAXPY(HYPRE_Int n, HYPRE_Complex *a, HYPRE_Complex *x, HYPRE_Complex *y) +{ + /* trivial case */ + if (n <= 0) + { + return hypre_error_flag; + } + + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(n, "thread", bDim); + + HYPRE_GPU_LAUNCH( hypreGPUKernel_IVAXPY, gDim, bDim, n, a, x, y ); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------- + * hypreGPUKernel_IVAXPYMarked + *--------------------------------------------------------------------*/ + +__global__ void +hypreGPUKernel_IVAXPYMarked( hypre_DeviceItem &item, + HYPRE_Int n, + HYPRE_Complex *a, + HYPRE_Complex *x, + HYPRE_Complex *y, + HYPRE_Int *marker, + HYPRE_Int marker_val) +{ + HYPRE_Int i = hypre_gpu_get_grid_thread_id<1, 1>(item); + if (i < n) + { + if (marker[i] == marker_val) + { + y[i] += x[i] / a[i]; + } + } +} + +/*-------------------------------------------------------------------- + * hypreDevice_IVAXPYMarked + * + * Inverse Vector AXPY: y[i] = x[i] / a[i] + y[i] + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypreDevice_IVAXPYMarked( HYPRE_Int n, + HYPRE_Complex *a, + HYPRE_Complex *x, + HYPRE_Complex *y, + HYPRE_Int *marker, + HYPRE_Int marker_val ) +{ + /* trivial case */ + if (n <= 0) + { + return hypre_error_flag; + } + + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(n, "thread", bDim); + + HYPRE_GPU_LAUNCH( hypreGPUKernel_IVAXPYMarked, gDim, bDim, n, a, x, y, marker, marker_val ); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypreGPUKernel_IVAMXPMY + * + * Device kernel for hypreDevice_IVAMXPMY. The template argument MM tells + * the maximum number of vectors in the unrolled loop + *--------------------------------------------------------------------------*/ + +template +__global__ void +hypreGPUKernel_IVAMXPMY( hypre_DeviceItem &item, + HYPRE_Int m, + HYPRE_Int n, + HYPRE_Complex *a, + HYPRE_Complex *x, + HYPRE_Complex *y) +{ + HYPRE_Int i = hypre_gpu_get_grid_thread_id<1, 1>(item); + HYPRE_Int j; + HYPRE_Complex val; + + if (i < n) + { + val = 1.0 / a[i]; + + if (MM > 0) + { +#pragma unroll + for (j = 0; j < MM; j++) + { + y[i + j * n] += x[i + j * n] * val; + } + } + else + { + /* Generic case */ + for (j = 0; j < m; j++) + { + y[i + j * n] += x[i + j * n] * val; + } + } + } +} + +/*-------------------------------------------------------------------------- + * hypreDevice_IVAMXPMY + * + * Inverse Vector AXPY for m vectors x and y of size n stored column-wise: + * + * y[i + 0] += x[i + 0] / a[i] + * y[i + n] += x[i + n] / a[i] + * ... ... + * y[i + (m-1)*n] += x[i + (m-1)*n] / a[i] + * + * Note: does not work for row-wise multivectors + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypreDevice_IVAMXPMY( HYPRE_Int m, + HYPRE_Int n, + HYPRE_Complex *a, + HYPRE_Complex *x, + HYPRE_Complex *y) +{ + /* trivial case */ + if (n <= 0) + { + return hypre_error_flag; + } + + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(n, "thread", bDim); + + switch (m) + { + case 1: + HYPRE_GPU_LAUNCH( hypreGPUKernel_IVAXPY, gDim, bDim, n, a, x, y ); + break; + + case 2: + HYPRE_GPU_LAUNCH( hypreGPUKernel_IVAMXPMY<2>, gDim, bDim, m, n, a, x, y ); + break; + + case 3: + HYPRE_GPU_LAUNCH( hypreGPUKernel_IVAMXPMY<3>, gDim, bDim, m, n, a, x, y ); + break; + + case 4: + HYPRE_GPU_LAUNCH( hypreGPUKernel_IVAMXPMY<4>, gDim, bDim, m, n, a, x, y ); + break; + + default: + HYPRE_GPU_LAUNCH( hypreGPUKernel_IVAMXPMY<0>, gDim, bDim, m, n, a, x, y ); + break; + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------- + * hypreDevice_CsrRowPtrsToIndices + *--------------------------------------------------------------------*/ + +HYPRE_Int* +hypreDevice_CsrRowPtrsToIndices( HYPRE_Int nrows, + HYPRE_Int nnz, + HYPRE_Int *d_row_ptr ) +{ + /* trivial case */ + if (nrows <= 0 || nnz <= 0) + { + return NULL; + } + + HYPRE_Int *d_row_ind = hypre_TAlloc(HYPRE_Int, nnz, HYPRE_MEMORY_DEVICE); + + hypreDevice_CsrRowPtrsToIndices_v2(nrows, nnz, d_row_ptr, d_row_ind); + + return d_row_ind; +} + +#if defined(HYPRE_USING_SYCL) + +/*-------------------------------------------------------------------- + * hypreSYCLKernel_ScatterRowPtr + *--------------------------------------------------------------------*/ + +void +hypreSYCLKernel_ScatterRowPtr( hypre_DeviceItem &item, + HYPRE_Int nrows, + HYPRE_Int *d_row_ptr, + HYPRE_Int *d_row_ind ) +{ + HYPRE_Int i = (HYPRE_Int) item.get_global_linear_id(); + + if (i < nrows) + { + HYPRE_Int row_start = d_row_ptr[i]; + HYPRE_Int row_end = d_row_ptr[i + 1]; + if (row_start != row_end) + { + d_row_ind[row_start] = i; + } + } +} +#endif + +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +struct hypre_empty_row_functor +{ + // This is needed for clang + typedef bool result_type; + + __device__ + bool operator()(const thrust::tuple& t) const + { + const HYPRE_Int a = thrust::get<0>(t); + const HYPRE_Int b = thrust::get<1>(t); + + return a != b; + } +}; +#endif + +/*-------------------------------------------------------------------- + * hypreDevice_CsrRowPtrsToIndices_v2 + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypreDevice_CsrRowPtrsToIndices_v2( HYPRE_Int nrows, + HYPRE_Int nnz, + HYPRE_Int *d_row_ptr, + HYPRE_Int *d_row_ind ) +{ + /* trivial case */ + if (nrows <= 0 || nnz <= 0) + { + return hypre_error_flag; + } +#if defined(HYPRE_USING_SYCL) + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(nrows, "thread", bDim); + HYPRE_ONEDPL_CALL( std::fill, d_row_ind, d_row_ind + nnz, 0 ); + HYPRE_GPU_LAUNCH( hypreSYCLKernel_ScatterRowPtr, gDim, bDim, nrows, d_row_ptr, d_row_ind ); + HYPRE_ONEDPL_CALL( std::inclusive_scan, d_row_ind, d_row_ind + nnz, d_row_ind, + oneapi::dpl::maximum()); +#else + + hypre_GpuProfilingPushRange("CsrRowPtrsToIndices"); + HYPRE_THRUST_CALL( fill, d_row_ind, d_row_ind + nnz, 0 ); + HYPRE_THRUST_CALL( scatter_if, + thrust::counting_iterator(0), + thrust::counting_iterator(nrows), + d_row_ptr, + thrust::make_transform_iterator( thrust::make_zip_iterator(thrust::make_tuple(d_row_ptr, + d_row_ptr + 1)), + hypre_empty_row_functor() ), + d_row_ind ); + HYPRE_THRUST_CALL( inclusive_scan, d_row_ind, d_row_ind + nnz, d_row_ind, + thrust::maximum()); + hypre_GpuProfilingPopRange(); +#endif + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------- + * hypreDevice_CsrRowIndicesToPtrs + *--------------------------------------------------------------------*/ + +HYPRE_Int* +hypreDevice_CsrRowIndicesToPtrs( HYPRE_Int nrows, + HYPRE_Int nnz, + HYPRE_Int *d_row_ind ) +{ + HYPRE_Int *d_row_ptr = hypre_TAlloc(HYPRE_Int, nrows + 1, HYPRE_MEMORY_DEVICE); + + hypreDevice_CsrRowIndicesToPtrs_v2(nrows, nnz, d_row_ind, d_row_ptr); + + return d_row_ptr; +} + +/*-------------------------------------------------------------------- + * hypreDevice_CsrRowIndicesToPtrs_v2 + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypreDevice_CsrRowIndicesToPtrs_v2( HYPRE_Int nrows, + HYPRE_Int nnz, + HYPRE_Int *d_row_ind, + HYPRE_Int *d_row_ptr ) +{ +#if defined(HYPRE_USING_SYCL) + /* Note: if nnz <= 0, then dpl::lower_bound is a no-op, which means we still need to zero out the row pointer */ + /* Note that this is different from thrust's behavior, where lower_bound zeros out the row pointer when nnz = 0 */ + if (nnz <= 0) + { + hypre_Memset(d_row_ptr, 0, (nrows + 1) * sizeof(HYPRE_Int), HYPRE_MEMORY_DEVICE); + return hypre_error_flag; + } + oneapi::dpl::counting_iterator count(0); + HYPRE_ONEDPL_CALL( oneapi::dpl::lower_bound, + d_row_ind, d_row_ind + nnz, + count, + count + nrows + 1, + d_row_ptr); +#else + hypre_GpuProfilingPushRange("CSRIndicesToPtrs"); + HYPRE_THRUST_CALL( lower_bound, + d_row_ind, d_row_ind + nnz, + thrust::counting_iterator(0), + thrust::counting_iterator(nrows + 1), + d_row_ptr); + hypre_GpuProfilingPopRange(); +#endif + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------- + * hypreGPUKernel_GetRowNnz + * + * Get NNZ of each row in d_row_indices and store the results in d_rownnz + * All pointers are device pointers. + * d_rownnz can be the same as d_row_indices. + *--------------------------------------------------------------------*/ + +__global__ void +hypreGPUKernel_GetRowNnz( hypre_DeviceItem &item, + HYPRE_Int nrows, + HYPRE_Int *d_row_indices, + HYPRE_Int *d_diag_ia, + HYPRE_Int *d_offd_ia, + HYPRE_Int *d_rownnz ) +{ + const HYPRE_Int global_thread_id = hypre_gpu_get_grid_thread_id<1, 1>(item); + + if (global_thread_id < nrows) + { + HYPRE_Int i; + + if (d_row_indices) + { + i = read_only_load(&d_row_indices[global_thread_id]); + } + else + { + i = global_thread_id; + } + + d_rownnz[global_thread_id] = + read_only_load(&d_diag_ia[i + 1]) - read_only_load(&d_diag_ia[i]) + + read_only_load(&d_offd_ia[i + 1]) - read_only_load(&d_offd_ia[i]); + } +} + +/*-------------------------------------------------------------------- + * hypreDevice_GetRowNnz + * + * Note: (d_row_indices == NULL) means d_row_indices = [0,1,...,nrows-1] + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypreDevice_GetRowNnz( HYPRE_Int nrows, + HYPRE_Int *d_row_indices, + HYPRE_Int *d_diag_ia, + HYPRE_Int *d_offd_ia, + HYPRE_Int *d_rownnz ) +{ + const dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + const dim3 gDim = hypre_GetDefaultDeviceGridDimension(nrows, "thread", bDim); + + /* trivial case */ + if (nrows <= 0) + { + return hypre_error_flag; + } + + HYPRE_GPU_LAUNCH( hypreGPUKernel_GetRowNnz, gDim, bDim, nrows, d_row_indices, + d_diag_ia, d_offd_ia, d_rownnz ); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------- + * hypreDevice_IntegerInclusiveScan + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypreDevice_IntegerInclusiveScan( HYPRE_Int n, + HYPRE_Int *d_i ) +{ +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL(std::inclusive_scan, d_i, d_i + n, d_i); +#else + HYPRE_THRUST_CALL(inclusive_scan, d_i, d_i + n, d_i); +#endif + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------- + * hypreGPUKernel_CopyParCSRRows + *--------------------------------------------------------------------*/ + +__global__ void +hypreGPUKernel_CopyParCSRRows( hypre_DeviceItem &item, + HYPRE_Int nrows, + HYPRE_Int *d_row_indices, + HYPRE_Int has_offd, + HYPRE_BigInt first_col, + HYPRE_BigInt *d_col_map_offd_A, + HYPRE_Int *d_diag_i, + HYPRE_Int *d_diag_j, + HYPRE_Complex *d_diag_a, + HYPRE_Int *d_offd_i, + HYPRE_Int *d_offd_j, + HYPRE_Complex *d_offd_a, + HYPRE_Int *d_ib, + HYPRE_BigInt *d_jb, + HYPRE_Complex *d_ab ) +{ + const HYPRE_Int global_warp_id = hypre_gpu_get_grid_warp_id<1, 1>(item); + + if (global_warp_id >= nrows) + { + return; + } + + /* lane id inside the warp */ + const HYPRE_Int lane_id = hypre_gpu_get_lane_id<1>(item); + HYPRE_Int i, j = 0, k = 0, p, row, istart, iend, bstart; + + /* diag part */ + if (lane_id < 2) + { + /* row index to work on */ + if (d_row_indices) + { + row = read_only_load(d_row_indices + global_warp_id); + } + else + { + row = global_warp_id; + } + /* start/end position of the row */ + j = read_only_load(d_diag_i + row + lane_id); + /* start position of b */ + k = d_ib ? read_only_load(d_ib + global_warp_id) : 0; + } + istart = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, j, 0); + iend = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, j, 1); + bstart = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, k, 0); + + p = bstart - istart; + for (i = istart + lane_id; i < iend; i += HYPRE_WARP_SIZE) + { + d_jb[p + i] = read_only_load(d_diag_j + i) + first_col; + if (d_ab) + { + d_ab[p + i] = read_only_load(d_diag_a + i); + } + } + + if (!has_offd) + { + return; + } + + /* offd part */ + if (lane_id < 2) + { + j = read_only_load(d_offd_i + row + lane_id); + } + bstart += iend - istart; + istart = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, j, 0); + iend = warp_shuffle_sync(item, HYPRE_WARP_FULL_MASK, j, 1); + + p = bstart - istart; + for (i = istart + lane_id; i < iend; i += HYPRE_WARP_SIZE) + { + if (d_col_map_offd_A) + { + d_jb[p + i] = d_col_map_offd_A[read_only_load(d_offd_j + i)]; + } + else + { + d_jb[p + i] = -1 - read_only_load(d_offd_j + i); + } + + if (d_ab) + { + d_ab[p + i] = read_only_load(d_offd_a + i); + } + } +} + +/*-------------------------------------------------------------------- + * hypreDevice_CopyParCSRRows + * + * B = A(row_indices, :) + * Note: d_ib is an input vector that contains row ptrs, + * i.e., start positions where to put the rows in d_jb and d_ab. + * The col indices in B are global indices, i.e., BigJ + * of length (nrows + 1) or nrow (without the last entry, nnz) + * Special cases: + * if d_row_indices == NULL, it means d_row_indices=[0,1,...,nrows-1] + * If col_map_offd_A == NULL, use (-1 - d_offd_j) as column id + * If nrows == 1 and d_ib == NULL, it means d_ib[0] = 0 + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypreDevice_CopyParCSRRows( HYPRE_Int nrows, + HYPRE_Int *d_row_indices, + HYPRE_Int job, + HYPRE_Int has_offd, + HYPRE_BigInt first_col, + HYPRE_BigInt *d_col_map_offd_A, + HYPRE_Int *d_diag_i, + HYPRE_Int *d_diag_j, + HYPRE_Complex *d_diag_a, + HYPRE_Int *d_offd_i, + HYPRE_Int *d_offd_j, + HYPRE_Complex *d_offd_a, + HYPRE_Int *d_ib, + HYPRE_BigInt *d_jb, + HYPRE_Complex *d_ab ) +{ + HYPRE_UNUSED_VAR(job); + + /* trivial case */ + if (nrows <= 0) + { + return hypre_error_flag; + } + + hypre_assert(!(nrows > 1 && d_ib == NULL)); + + const dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + const dim3 gDim = hypre_GetDefaultDeviceGridDimension(nrows, "warp", bDim); + + /* + if (job == 2) + { + } + */ + + HYPRE_GPU_LAUNCH( hypreGPUKernel_CopyParCSRRows, gDim, bDim, + nrows, d_row_indices, has_offd, first_col, d_col_map_offd_A, + d_diag_i, d_diag_j, d_diag_a, + d_offd_i, d_offd_j, d_offd_a, + d_ib, d_jb, d_ab ); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------- + * hypreDevice_IntegerExclusiveScan + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypreDevice_IntegerExclusiveScan( HYPRE_Int n, + HYPRE_Int *d_i ) +{ +#if defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL(std::exclusive_scan, d_i, d_i + n, d_i, 0); +#else + HYPRE_THRUST_CALL(exclusive_scan, d_i, d_i + n, d_i); +#endif + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------- + * hypreDevice_StableSortByTupleKey + * + * https://github.com/OrangeOwlSolutions/Thrust/blob/master/Sort_by_key_with_tuple_key.cu + * + * opt: 0, (a,b) < (a',b') iff a < a' or (a = a' and b < b') [normal tupe comp] + * 1, (a,b) < (a',b') iff a < a' or (a = a' and |b| > |b'|) [used in dropping small entries] + * 2, (a,b) < (a',b') iff a < a' or (a = a' and (b == a or b < b') and b' != a') [used in putting diagonal first] + *--------------------------------------------------------------------*/ + +template +HYPRE_Int +hypreDevice_StableSortByTupleKey( HYPRE_Int N, + T1 *keys1, T2 *keys2, T3 *vals, + HYPRE_Int opt ) +{ +#if defined(HYPRE_USING_SYCL) + auto zipped_begin = oneapi::dpl::make_zip_iterator(keys1, keys2, vals); + + if (opt == 0) + { + HYPRE_ONEDPL_CALL(std::stable_sort, + zipped_begin, + zipped_begin + N, + std::less< std::tuple >()); + } + else if (opt == 1) + { + HYPRE_ONEDPL_CALL(std::stable_sort, + zipped_begin, + zipped_begin + N, + TupleComp2()); + } + else if (opt == 2) + { + HYPRE_ONEDPL_CALL(std::stable_sort, + zipped_begin, + zipped_begin + N, + TupleComp3()); + } +#else + hypre_GpuProfilingPushRange("StableSortByTupleKey"); + auto begin_keys = thrust::make_zip_iterator(thrust::make_tuple(keys1, keys2)); + auto end_keys = thrust::make_zip_iterator(thrust::make_tuple(keys1 + N, keys2 + N)); + + if (opt == 0) + { + HYPRE_THRUST_CALL(stable_sort_by_key, + begin_keys, + end_keys, + vals, + thrust::less< thrust::tuple >()); + } + else if (opt == 1) + { + HYPRE_THRUST_CALL(stable_sort_by_key, + begin_keys, + end_keys, + vals, + TupleComp2()); + } + else if (opt == 2) + { + HYPRE_THRUST_CALL(stable_sort_by_key, + begin_keys, + end_keys, + vals, + TupleComp3()); + } + hypre_GpuProfilingPopRange(); +#endif + return hypre_error_flag; +} + +template HYPRE_Int hypreDevice_StableSortByTupleKey(HYPRE_Int N, + HYPRE_Int *keys1, HYPRE_Int *keys2, + HYPRE_Int *vals, HYPRE_Int opt); +template HYPRE_Int hypreDevice_StableSortByTupleKey(HYPRE_Int N, + HYPRE_Int *keys1, HYPRE_Real *keys2, + HYPRE_Int *vals, HYPRE_Int opt); +template HYPRE_Int hypreDevice_StableSortByTupleKey(HYPRE_Int N, + HYPRE_Int *keys1, HYPRE_Int *keys2, + HYPRE_Complex *vals, HYPRE_Int opt); + +/*-------------------------------------------------------------------- + * hypreDevice_ReduceByTupleKey + *--------------------------------------------------------------------*/ + +template +HYPRE_Int +hypreDevice_ReduceByTupleKey( HYPRE_Int N, + T1 *keys1_in, T2 *keys2_in, T3 *vals_in, + T1 *keys1_out, T2 *keys2_out, T3 *vals_out ) +{ +#if defined(HYPRE_USING_SYCL) + auto begin_keys_in = oneapi::dpl::make_zip_iterator(keys1_in, keys2_in ); + auto begin_keys_out = oneapi::dpl::make_zip_iterator(keys1_out, keys2_out); + std::equal_to< std::tuple > pred; + std::plus func; + + auto new_end = HYPRE_ONEDPL_CALL(oneapi::dpl::reduce_by_segment, + begin_keys_in, + begin_keys_in + N, + vals_in, + begin_keys_out, + vals_out, + pred, + func); +#else + auto begin_keys_in = thrust::make_zip_iterator(thrust::make_tuple(keys1_in, keys2_in )); + auto end_keys_in = thrust::make_zip_iterator(thrust::make_tuple(keys1_in + N, keys2_in + N)); + auto begin_keys_out = thrust::make_zip_iterator(thrust::make_tuple(keys1_out, keys2_out )); + thrust::equal_to< thrust::tuple > pred; + thrust::plus func; + + auto new_end = HYPRE_THRUST_CALL(reduce_by_key, + begin_keys_in, + end_keys_in, + vals_in, + begin_keys_out, + vals_out, + pred, + func); +#endif + + return new_end.second - vals_out; +} + +template HYPRE_Int hypreDevice_ReduceByTupleKey(HYPRE_Int N, + HYPRE_Int *keys1_in, + HYPRE_Int *keys2_in, + HYPRE_Complex *vals_in, + HYPRE_Int *keys1_out, + HYPRE_Int *keys2_out, + HYPRE_Complex *vals_out); + +/*-------------------------------------------------------------------- + * hypreGPUKernel_ScatterConstant + *--------------------------------------------------------------------*/ + +template +__global__ void +hypreGPUKernel_ScatterConstant(hypre_DeviceItem &item, + T *x, + HYPRE_Int n, + HYPRE_Int *map, + T v) +{ + HYPRE_Int global_thread_id = hypre_gpu_get_grid_thread_id<1, 1>(item); + + if (global_thread_id < n) + { + x[map[global_thread_id]] = v; + } +} + +/*-------------------------------------------------------------------- + * hypreDevice_ScatterConstant + * + * x[map[i]] = v + * n is length of map + * TODO: thrust? + *--------------------------------------------------------------------*/ + +template +HYPRE_Int +hypreDevice_ScatterConstant(T *x, HYPRE_Int n, HYPRE_Int *map, T v) +{ + /* trivial case */ + if (n <= 0) + { + return hypre_error_flag; + } + + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(n, "thread", bDim); + + HYPRE_GPU_LAUNCH( hypreGPUKernel_ScatterConstant, gDim, bDim, x, n, map, v ); + + return hypre_error_flag; +} + +template HYPRE_Int hypreDevice_ScatterConstant(HYPRE_Int *x, HYPRE_Int n, HYPRE_Int *map, + HYPRE_Int v); +template HYPRE_Int hypreDevice_ScatterConstant(HYPRE_Complex *x, HYPRE_Int n, HYPRE_Int *map, + HYPRE_Complex v); + +/*-------------------------------------------------------------------- + * hypreGPUKernel_ScatterAddTrivial + *--------------------------------------------------------------------*/ + +__global__ void +hypreGPUKernel_ScatterAddTrivial(hypre_DeviceItem &item, + HYPRE_Int n, + HYPRE_Real *x, + HYPRE_Int *map, + HYPRE_Real *y) +{ + for (HYPRE_Int i = 0; i < n; i++) + { + x[map[i]] += y[i]; + } +} + +/*-------------------------------------------------------------------- + * hypreGPUKernel_ScatterAdd + * + * x[map[i]] += y[i], same index cannot appear more than once in map + *--------------------------------------------------------------------*/ + +__global__ void +hypreGPUKernel_ScatterAdd(hypre_DeviceItem &item, + HYPRE_Int n, + HYPRE_Real *x, + HYPRE_Int *map, + HYPRE_Real *y) +{ + HYPRE_Int global_thread_id = hypre_gpu_get_grid_thread_id<1, 1>(item); + + if (global_thread_id < n) + { + x[map[global_thread_id]] += y[global_thread_id]; + } +} + +/*-------------------------------------------------------------------- + * hypreDevice_GenScatterAdd + * + * Generalized Scatter-and-Add + * + * for i = 0 : ny-1, x[map[i]] += y[i]; + * + * Note: An index is allowed to appear more than once in map + * Content in y will be destroyed + * When work != NULL, work is at least of size + * [2 * sizeof(HYPRE_Int) + sizeof(HYPRE_Complex)] * ny + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypreDevice_GenScatterAdd( HYPRE_Real *x, + HYPRE_Int ny, + HYPRE_Int *map, + HYPRE_Real *y, + char *work) +{ + if (ny <= 0) + { + return hypre_error_flag; + } + + if (ny <= 2) + { + /* trivial cases, n = 1, 2 */ + dim3 bDim = hypre_dim3(1); + dim3 gDim = hypre_dim3(1); + HYPRE_GPU_LAUNCH( hypreGPUKernel_ScatterAddTrivial, gDim, bDim, ny, x, map, y ); + } + else + { + /* general cases */ + HYPRE_Int *map2, *reduced_map, reduced_n; + HYPRE_Real *reduced_y; + + if (work) + { + map2 = (HYPRE_Int *) work; + reduced_map = map2 + ny; + reduced_y = (HYPRE_Real *) (reduced_map + ny); + } + else + { + map2 = hypre_TAlloc(HYPRE_Int, ny, HYPRE_MEMORY_DEVICE); + reduced_map = hypre_TAlloc(HYPRE_Int, ny, HYPRE_MEMORY_DEVICE); + reduced_y = hypre_TAlloc(HYPRE_Real, ny, HYPRE_MEMORY_DEVICE); + } + + hypre_TMemcpy(map2, map, HYPRE_Int, ny, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + +#if defined(HYPRE_USING_SYCL) + auto zipped_begin = oneapi::dpl::make_zip_iterator(map2, y); + HYPRE_ONEDPL_CALL(std::sort, zipped_begin, zipped_begin + ny, + [](auto lhs, auto rhs) {return std::get<0>(lhs) < std::get<0>(rhs);}); + + auto new_end = HYPRE_ONEDPL_CALL( oneapi::dpl::reduce_by_segment, + map2, + map2 + ny, + y, + reduced_map, + reduced_y ); +#else + HYPRE_THRUST_CALL(sort_by_key, map2, map2 + ny, y); + + thrust::pair new_end = HYPRE_THRUST_CALL( reduce_by_key, + map2, + map2 + ny, + y, + reduced_map, + reduced_y ); +#endif + + reduced_n = new_end.first - reduced_map; + + hypre_assert(reduced_n == new_end.second - reduced_y); + + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(reduced_n, "thread", bDim); + + HYPRE_GPU_LAUNCH( hypreGPUKernel_ScatterAdd, gDim, bDim, + reduced_n, x, reduced_map, reduced_y ); + + if (!work) + { + hypre_TFree(map2, HYPRE_MEMORY_DEVICE); + hypre_TFree(reduced_map, HYPRE_MEMORY_DEVICE); + hypre_TFree(reduced_y, HYPRE_MEMORY_DEVICE); + } + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------- + * hypreGPUKernel_Axpyzn + *--------------------------------------------------------------------*/ + +template +__global__ void +hypreGPUKernel_Axpyzn( hypre_DeviceItem &item, + HYPRE_Int n, + T *x, + T *y, + T *z, + T a, + T b ) +{ + HYPRE_Int i = hypre_gpu_get_grid_thread_id<1, 1>(item); + + if (i < n) + { + z[i] = a * x[i] + b * y[i]; + } +} + +/*-------------------------------------------------------------------- + * hypreDevice_Axpyzn + *--------------------------------------------------------------------*/ + +template +HYPRE_Int +hypreDevice_Axpyzn(HYPRE_Int n, T *d_x, T *d_y, T *d_z, T a, T b) +{ + if (n <= 0) + { + return hypre_error_flag; + } + + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(n, "thread", bDim); + + HYPRE_GPU_LAUNCH( hypreGPUKernel_Axpyzn, gDim, bDim, n, d_x, d_y, d_z, a, b ); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------- + * hypreDevice_ComplexAxpyn + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypreDevice_ComplexAxpyn( HYPRE_Complex *d_x, + size_t n, + HYPRE_Complex *d_y, + HYPRE_Complex *d_z, + HYPRE_Complex a ) +{ + return hypreDevice_Axpyzn((HYPRE_Int) n, d_x, d_y, d_z, a, (HYPRE_Complex) 1.0); +} + +/*-------------------------------------------------------------------- + * hypreDevice_IntAxpyn + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypreDevice_IntAxpyn( HYPRE_Int *d_x, + size_t n, + HYPRE_Int *d_y, + HYPRE_Int *d_z, + HYPRE_Int a ) +{ + return hypreDevice_Axpyzn((HYPRE_Int) n, d_x, d_y, d_z, a, (HYPRE_Int) 1); +} + +/*-------------------------------------------------------------------- + * hypreDevice_BigIntAxpyn + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypreDevice_BigIntAxpyn( HYPRE_BigInt *d_x, + size_t n, + HYPRE_BigInt *d_y, + HYPRE_BigInt *d_z, + HYPRE_BigInt a ) +{ + return hypreDevice_Axpyzn((HYPRE_Int) n, d_x, d_y, d_z, a, (HYPRE_BigInt) 1); +} + +/*-------------------------------------------------------------------- + * hypreDevice_ComplexAxpyzn + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypreDevice_ComplexAxpyzn( HYPRE_Int n, + HYPRE_Complex *d_x, + HYPRE_Complex *d_y, + HYPRE_Complex *d_z, + HYPRE_Complex a, + HYPRE_Complex b ) +{ + return hypreDevice_Axpyzn(n, d_x, d_y, d_z, a, b); +} + +#if defined(HYPRE_USING_CURAND) + +/*-------------------------------------------------------------------- + * hypre_DeviceDataCurandGenerator + *--------------------------------------------------------------------*/ + +curandGenerator_t +hypre_DeviceDataCurandGenerator(hypre_DeviceData *data) +{ + if (data->curand_generator) + { + return data->curand_generator; + } + + curandGenerator_t gen; + HYPRE_CURAND_CALL( curandCreateGenerator(&gen, CURAND_RNG_PSEUDO_DEFAULT) ); + HYPRE_CURAND_CALL( curandSetPseudoRandomGeneratorSeed(gen, 1234ULL) ); + HYPRE_CURAND_CALL( curandSetGeneratorOffset(gen, 0) ); + HYPRE_CURAND_CALL( curandSetStream(gen, hypre_DeviceDataComputeStream(data)) ); + + data->curand_generator = gen; + + return gen; +} + +/*-------------------------------------------------------------------- + * hypre_CurandUniform_core + * + * T = float or hypre_double + *--------------------------------------------------------------------*/ + +template +HYPRE_Int +hypre_CurandUniform_core( HYPRE_Int n, + T *urand, + HYPRE_Int set_seed, + hypre_ulonglongint seed, + HYPRE_Int set_offset, + hypre_ulonglongint offset) +{ + curandGenerator_t gen = hypre_HandleCurandGenerator(hypre_handle()); + + hypre_GpuProfilingPushRange("RandGen"); + + if (set_seed) + { + HYPRE_CURAND_CALL( curandSetPseudoRandomGeneratorSeed(gen, seed) ); + } + + if (set_offset) + { + HYPRE_CURAND_CALL( curandSetGeneratorOffset(gen, offset) ); + } + + if (sizeof(T) == sizeof(hypre_double)) + { + HYPRE_CURAND_CALL( curandGenerateUniformDouble(gen, (hypre_double *) urand, n) ); + } + else if (sizeof(T) == sizeof(float)) + { + HYPRE_CURAND_CALL( curandGenerateUniform(gen, (float *) urand, n) ); + } + + hypre_GpuProfilingPopRange(); + + return hypre_error_flag; +} +#endif /* #if defined(HYPRE_USING_CURAND) */ + +#if defined(HYPRE_USING_ROCRAND) + +/*-------------------------------------------------------------------- + * hypre_DeviceDataCurandGenerator + *--------------------------------------------------------------------*/ + +rocrand_generator +hypre_DeviceDataCurandGenerator(hypre_DeviceData *data) +{ + if (data->curand_generator) + { + return data->curand_generator; + } + + rocrand_generator gen; + HYPRE_ROCRAND_CALL( rocrand_create_generator(&gen, ROCRAND_RNG_PSEUDO_DEFAULT) ); + HYPRE_ROCRAND_CALL( rocrand_set_seed(gen, 1234ULL) ); + HYPRE_ROCRAND_CALL( rocrand_set_offset(gen, 0) ); + HYPRE_ROCRAND_CALL( rocrand_set_stream(gen, hypre_DeviceDataComputeStream(data)) ); + + data->curand_generator = gen; + + return gen; +} + +/*-------------------------------------------------------------------- + * hypre_CurandUniform_core + *--------------------------------------------------------------------*/ + +template +HYPRE_Int +hypre_CurandUniform_core( HYPRE_Int n, + T *urand, + HYPRE_Int set_seed, + hypre_ulonglongint seed, + HYPRE_Int set_offset, + hypre_ulonglongint offset) +{ + hypre_GpuProfilingPushRange("hypre_CurandUniform_core"); + + rocrand_generator gen = hypre_HandleCurandGenerator(hypre_handle()); + + if (set_seed) + { + HYPRE_ROCRAND_CALL( rocrand_set_seed(gen, seed) ); + } + + if (set_offset) + { + HYPRE_ROCRAND_CALL( rocrand_set_offset(gen, offset) ); + } + + if (sizeof(T) == sizeof(hypre_double)) + { + HYPRE_ROCRAND_CALL( rocrand_generate_uniform_double(gen, (hypre_double *) urand, n) ); + } + else if (sizeof(T) == sizeof(float)) + { + HYPRE_ROCRAND_CALL( rocrand_generate_uniform(gen, (float *) urand, n) ); + } + + hypre_GpuProfilingPopRange(); + + return hypre_error_flag; +} +#endif /* #if defined(HYPRE_USING_ROCRAND) */ + +#if defined(HYPRE_USING_ONEMKLRAND) + +/*-------------------------------------------------------------------- + * hypre_CurandUniform_core + * + * T = float or hypre_double + *--------------------------------------------------------------------*/ + +template +HYPRE_Int +hypre_CurandUniform_core( HYPRE_Int n, + T *urand, + HYPRE_Int set_seed, + hypre_ulonglongint seed, + HYPRE_Int set_offset, + hypre_ulonglongint offset) +{ + /* Note: if n is zero, onemkl rand throws an error */ + if (n <= 0) + { + return hypre_error_flag; + } + + static_assert(std::is_same_v || std::is_same_v, + "oneMKL: rng/uniform: T is not supported"); + + oneapi::mkl::rng::default_engine engine(*hypre_HandleComputeStream(hypre_handle()), seed); + oneapi::mkl::rng::uniform distribution(0.0 + offset, 1.0 + offset); + oneapi::mkl::rng::generate(distribution, engine, n, urand).wait_and_throw(); + + return hypre_error_flag; +} +#endif /* #if defined(HYPRE_USING_ONEMKLRAND) */ + +#if defined(HYPRE_USING_CURAND) || defined(HYPRE_USING_ROCRAND) || defined(HYPRE_USING_ONEMKLRAND) + +/*-------------------------------------------------------------------- + * hypre_CurandUniform + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CurandUniform( HYPRE_Int n, + HYPRE_Real *urand, + HYPRE_Int set_seed, + hypre_ulonglongint seed, + HYPRE_Int set_offset, + hypre_ulonglongint offset) +{ + return hypre_CurandUniform_core(n, urand, set_seed, seed, set_offset, offset); +} + +/*-------------------------------------------------------------------- + * hypre_CurandUniformSingle + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CurandUniformSingle( HYPRE_Int n, + float *urand, + HYPRE_Int set_seed, + hypre_ulonglongint seed, + HYPRE_Int set_offset, + hypre_ulonglongint offset) +{ + return hypre_CurandUniform_core(n, urand, set_seed, seed, set_offset, offset); +} + +/*-------------------------------------------------------------------- + * hypre_ResetDeviceRandGenerator + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ResetDeviceRandGenerator( hypre_ulonglongint seed, + hypre_ulonglongint offset ) +{ +#if defined(HYPRE_USING_CURAND) + curandGenerator_t gen = hypre_HandleCurandGenerator(hypre_handle()); + HYPRE_CURAND_CALL( curandSetPseudoRandomGeneratorSeed(gen, seed) ); + HYPRE_CURAND_CALL( curandSetGeneratorOffset(gen, offset) ); + +#elif defined(HYPRE_USING_ROCRAND) + rocrand_generator gen = hypre_HandleCurandGenerator(hypre_handle()); + HYPRE_ROCRAND_CALL( rocrand_set_seed(gen, seed) ); + HYPRE_ROCRAND_CALL( rocrand_set_offset(gen, offset) ); +#endif + + return hypre_error_flag; +} + +#endif /* #if defined(HYPRE_USING_CURAND) || defined(HYPRE_USING_ROCRAND) || defined(HYPRE_USING_ONEMKLRAND) */ + +/*-------------------------------------------------------------------- + * hypreGPUKernel_filln + *--------------------------------------------------------------------*/ + +template +__global__ void +hypreGPUKernel_filln(hypre_DeviceItem &item, T *x, size_t n, T v) +{ + HYPRE_Int i = hypre_gpu_get_grid_thread_id<1, 1>(item); + + if (i < n) + { + x[i] = v; + } +} + +/*-------------------------------------------------------------------- + * hypreDevice_Filln + *--------------------------------------------------------------------*/ + +template +HYPRE_Int +hypreDevice_Filln(T *d_x, size_t n, T v) +{ +#if 0 + HYPRE_THRUST_CALL( fill_n, d_x, n, v); +#else + if (n <= 0) + { + return hypre_error_flag; + } + + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(n, "thread", bDim); + + HYPRE_GPU_LAUNCH( hypreGPUKernel_filln, gDim, bDim, d_x, n, v ); +#endif + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------- + * hypreDevice_ComplexFilln + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypreDevice_ComplexFilln( HYPRE_Complex *d_x, + size_t n, + HYPRE_Complex v ) +{ + return hypreDevice_Filln(d_x, n, v); +} + +/*-------------------------------------------------------------------- + * hypreDevice_CharFilln + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypreDevice_CharFilln( char *d_x, + size_t n, + char v ) +{ + return hypreDevice_Filln(d_x, n, v); +} + +/*-------------------------------------------------------------------- + * hypreDevice_IntFilln + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypreDevice_IntFilln( HYPRE_Int *d_x, + size_t n, + HYPRE_Int v ) +{ + return hypreDevice_Filln(d_x, n, v); +} + +/*-------------------------------------------------------------------- + * hypreDevice_BigIntFilln + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypreDevice_BigIntFilln( HYPRE_BigInt *d_x, + size_t n, + HYPRE_BigInt v) +{ + return hypreDevice_Filln(d_x, n, v); +} + +/*-------------------------------------------------------------------- + * hypreGPUKernel_StridedCopy + *--------------------------------------------------------------------*/ + +template +__global__ void +hypreGPUKernel_StridedCopy(hypre_DeviceItem &item, + HYPRE_Int size, + HYPRE_Int stride, + T *in, + T *out ) +{ + HYPRE_Int i = hypre_gpu_get_grid_thread_id<1, 1>(item); + + if (i < size) + { + out[i] = in[i * stride]; + } +} + +/*-------------------------------------------------------------------- + * hypreDevice_StridedCopy + *--------------------------------------------------------------------*/ + +template +HYPRE_Int +hypreDevice_StridedCopy( HYPRE_Int size, + HYPRE_Int stride, + T *in, + T *out ) +{ + if (size < 1 || stride < 1) + { + return hypre_error_flag; + } + + if (in == out) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Cannot perform in-place strided copy"); + return hypre_error_flag; + } + + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(size, "thread", bDim); + + HYPRE_GPU_LAUNCH( hypreGPUKernel_StridedCopy, gDim, bDim, size, stride, in, out ); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------- + * hypreDevice_IntStridedCopy + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypreDevice_IntStridedCopy( HYPRE_Int size, + HYPRE_Int stride, + HYPRE_Int *in, + HYPRE_Int *out ) +{ + return hypreDevice_StridedCopy(size, stride, in, out); +} + +/*-------------------------------------------------------------------- + * hypreDevice_ComplexStridedCopy + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypreDevice_ComplexStridedCopy( HYPRE_Int size, + HYPRE_Int stride, + HYPRE_Complex *in, + HYPRE_Complex *out ) +{ + return hypreDevice_StridedCopy(size, stride, in, out); +} + +/*-------------------------------------------------------------------- + * hypreDevice_CsrRowPtrsToIndicesWithRowNum + * + * Input: d_row_num, of size nrows, contains the rows indices that + * can be HYPRE_BigInt or HYPRE_Int + * Output: d_row_ind + *--------------------------------------------------------------------*/ + +template +HYPRE_Int +hypreDevice_CsrRowPtrsToIndicesWithRowNum( HYPRE_Int nrows, + HYPRE_Int nnz, + HYPRE_Int *d_row_ptr, + T *d_row_num, + T *d_row_ind ) +{ + /* trivial case */ + if (nrows <= 0) + { + return hypre_error_flag; + } + + HYPRE_Int *map = hypre_TAlloc(HYPRE_Int, nnz, HYPRE_MEMORY_DEVICE); + + hypreDevice_CsrRowPtrsToIndices_v2(nrows, nnz, d_row_ptr, map); + +#if defined(HYPRE_USING_SYCL) + hypreSycl_gather(map, map + nnz, d_row_num, d_row_ind); +#else + HYPRE_THRUST_CALL(gather, map, map + nnz, d_row_num, d_row_ind); +#endif + + hypre_TFree(map, HYPRE_MEMORY_DEVICE); + + return hypre_error_flag; +} + +template HYPRE_Int hypreDevice_CsrRowPtrsToIndicesWithRowNum( HYPRE_Int nrows, + HYPRE_Int nnz, + HYPRE_Int *d_row_ptr, + HYPRE_Int *d_row_num, + HYPRE_Int *d_row_ind ); +#if defined(HYPRE_MIXEDINT) +template HYPRE_Int hypreDevice_CsrRowPtrsToIndicesWithRowNum( HYPRE_Int nrows, + HYPRE_Int nnz, + HYPRE_Int *d_row_ptr, + HYPRE_BigInt *d_row_num, + HYPRE_BigInt *d_row_ind ); +#endif + +/*-------------------------------------------------------------------- + * hypreDevice_IntegerReduceSum + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypreDevice_IntegerReduceSum( HYPRE_Int n, + HYPRE_Int *d_i ) +{ +#if defined(HYPRE_USING_SYCL) + return HYPRE_ONEDPL_CALL(std::reduce, d_i, d_i + n); +#else + return HYPRE_THRUST_CALL(reduce, d_i, d_i + n); +#endif +} + +/*-------------------------------------------------------------------- + * hypreDevice_ComplexReduceSum + *--------------------------------------------------------------------*/ + +HYPRE_Complex +hypreDevice_ComplexReduceSum(HYPRE_Int n, HYPRE_Complex *d_x) +{ +#if defined(HYPRE_USING_SYCL) + return HYPRE_ONEDPL_CALL(std::reduce, d_x, d_x + n); +#else + return HYPRE_THRUST_CALL(reduce, d_x, d_x + n); +#endif +} + +/*-------------------------------------------------------------------- + * hypreGPUKernel_scalen + *--------------------------------------------------------------------*/ + +template +__global__ void +hypreGPUKernel_scalen( hypre_DeviceItem &item, + T *x, + size_t n, + T *y, + T v ) +{ + HYPRE_Int i = hypre_gpu_get_grid_thread_id<1, 1>(item); + + if (i < n) + { + y[i] = x[i] * v; + } +} + +/*-------------------------------------------------------------------- + * hypreDevice_Scalen + *--------------------------------------------------------------------*/ + +template +HYPRE_Int +hypreDevice_Scalen( T *d_x, size_t n, T *d_y, T v ) +{ +#if 0 + HYPRE_THRUST_CALL( transform, d_x, d_x + n, d_y, v * _1 ); +#else + if (n <= 0) + { + return hypre_error_flag; + } + + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(n, "thread", bDim); + + HYPRE_GPU_LAUNCH( hypreGPUKernel_scalen, gDim, bDim, d_x, n, d_y, v ); +#endif + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------- + * hypreDevice_IntScalen + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypreDevice_IntScalen( HYPRE_Int *d_x, + size_t n, + HYPRE_Int *d_y, + HYPRE_Int v ) +{ + return hypreDevice_Scalen(d_x, n, d_y, v); +} + +/*-------------------------------------------------------------------- + * hypreDevice_ComplexScalen + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypreDevice_ComplexScalen( HYPRE_Complex *d_x, + size_t n, + HYPRE_Complex *d_y, + HYPRE_Complex v ) +{ + return hypreDevice_Scalen(d_x, n, d_y, v); +} + +/*-------------------------------------------------------------------- + * hypreDevice_StableSortTupleByTupleKey + * + * opt: + * 0, (a,b) < (a',b') iff a < a' or (a = a' and b < b') + * [normal tupe comp] + * + * 2, (a,b) < (a',b') iff a < a' or (a = a' and (b == a or b < b') and b' != a') + * [used in assembly to put diagonal first] + *--------------------------------------------------------------------*/ + +template +HYPRE_Int +hypreDevice_StableSortTupleByTupleKey(HYPRE_Int N, + T1 *keys1, T2 *keys2, T3 *vals1, T4 *vals2, + HYPRE_Int opt) +{ +#if defined(HYPRE_USING_SYCL) + auto zipped_begin = oneapi::dpl::make_zip_iterator(keys1, keys2, vals1, vals2); + + if (opt == 0) + { + HYPRE_ONEDPL_CALL(std::stable_sort, + zipped_begin, + zipped_begin + N, + std::less< std::tuple >()); + } + else if (opt == 2) + { + HYPRE_ONEDPL_CALL(std::stable_sort, + zipped_begin, + zipped_begin + N, + TupleComp3()); + } +#else + auto begin_keys = thrust::make_zip_iterator(thrust::make_tuple(keys1, keys2)); + auto end_keys = thrust::make_zip_iterator(thrust::make_tuple(keys1 + N, keys2 + N)); + auto begin_vals = thrust::make_zip_iterator(thrust::make_tuple(vals1, vals2)); + + if (opt == 0) + { + HYPRE_THRUST_CALL(stable_sort_by_key, + begin_keys, + end_keys, + begin_vals, + thrust::less< thrust::tuple >()); + } + else if (opt == 2) + { + HYPRE_THRUST_CALL(stable_sort_by_key, + begin_keys, + end_keys, + begin_vals, + TupleComp3()); + } +#endif + + return hypre_error_flag; +} + +template HYPRE_Int hypreDevice_StableSortTupleByTupleKey(HYPRE_Int N, HYPRE_Int *keys1, + HYPRE_Int *keys2, char *vals1, HYPRE_Complex *vals2, HYPRE_Int opt); +#if defined(HYPRE_MIXEDINT) +template HYPRE_Int hypreDevice_StableSortTupleByTupleKey(HYPRE_Int N, HYPRE_BigInt *keys1, + HYPRE_BigInt *keys2, char *vals1, HYPRE_Complex *vals2, HYPRE_Int opt); +#endif + +/*-------------------------------------------------------------------- + * hypreGPUKernel_DiagScaleVector + *--------------------------------------------------------------------*/ + +template +__global__ void +hypreGPUKernel_DiagScaleVector( hypre_DeviceItem &item, + HYPRE_Int num_vectors, + HYPRE_Int num_rows, + HYPRE_Int *A_i, + HYPRE_Complex *A_data, + HYPRE_Complex *x, + HYPRE_Complex beta, + HYPRE_Complex *y ) +{ + HYPRE_Int i = hypre_gpu_get_grid_thread_id<1, 1>(item); + HYPRE_Int j; + HYPRE_Complex val; + + if (i < num_rows) + { + val = 1.0 / A_data[A_i[i]]; + + if (beta != 0.0) + { + if (NV > 0) + { +#pragma unroll + for (j = 0; j < NV; j++) + { + y[i + j * num_rows] = val * x[i + j * num_rows] + + beta * y[i + j * num_rows]; + } + } + else + { +#pragma unroll 8 + for (j = 0; j < num_vectors; j++) + { + y[i + j * num_rows] = val * x[i + j * num_rows] + + beta * y[i + j * num_rows]; + } + } + } + else + { + if (NV > 0) + { +#pragma unroll + for (j = 0; j < NV; j++) + { + y[i + j * num_rows] = val * x[i + j * num_rows]; + } + } + else + { +#pragma unroll 8 + for (j = 0; j < num_vectors; j++) + { + y[i + j * num_rows] = val * x[i + j * num_rows]; + } + } + } + } +} + +/*-------------------------------------------------------------------- + * hypreDevice_DiagScaleVector + * + * y = diag(A) \ x + beta y + * Note: Assume A_i[i] points to the ith diagonal entry of A + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypreDevice_DiagScaleVector( HYPRE_Int num_vectors, + HYPRE_Int num_rows, + HYPRE_Int *A_i, + HYPRE_Complex *A_data, + HYPRE_Complex *x, + HYPRE_Complex beta, + HYPRE_Complex *y ) +{ + /* trivial case */ + if (num_rows <= 0) + { + return hypre_error_flag; + } + hypre_assert(num_vectors > 0); + + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(num_rows, "thread", bDim); + + switch (num_vectors) + { + case 1: + HYPRE_GPU_LAUNCH( hypreGPUKernel_DiagScaleVector<1>, gDim, bDim, + num_vectors, num_rows, A_i, A_data, x, beta, y ); + break; + + case 2: + HYPRE_GPU_LAUNCH( hypreGPUKernel_DiagScaleVector<2>, gDim, bDim, + num_vectors, num_rows, A_i, A_data, x, beta, y ); + break; + + case 3: + HYPRE_GPU_LAUNCH( hypreGPUKernel_DiagScaleVector<3>, gDim, bDim, + num_vectors, num_rows, A_i, A_data, x, beta, y ); + break; + + case 4: + HYPRE_GPU_LAUNCH( hypreGPUKernel_DiagScaleVector<4>, gDim, bDim, + num_vectors, num_rows, A_i, A_data, x, beta, y ); + break; + + case 5: + HYPRE_GPU_LAUNCH( hypreGPUKernel_DiagScaleVector<5>, gDim, bDim, + num_vectors, num_rows, A_i, A_data, x, beta, y ); + break; + + case 6: + HYPRE_GPU_LAUNCH( hypreGPUKernel_DiagScaleVector<6>, gDim, bDim, + num_vectors, num_rows, A_i, A_data, x, beta, y ); + break; + + case 7: + HYPRE_GPU_LAUNCH( hypreGPUKernel_DiagScaleVector<7>, gDim, bDim, + num_vectors, num_rows, A_i, A_data, x, beta, y ); + break; + + case 8: + HYPRE_GPU_LAUNCH( hypreGPUKernel_DiagScaleVector<8>, gDim, bDim, + num_vectors, num_rows, A_i, A_data, x, beta, y ); + break; + + default: + HYPRE_GPU_LAUNCH( hypreGPUKernel_DiagScaleVector<0>, gDim, bDim, + num_vectors, num_rows, A_i, A_data, x, beta, y ); + break; + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------- + * hypreGPUKernel_DiagScaleVector2 + *--------------------------------------------------------------------*/ + +template +__global__ void +hypreGPUKernel_DiagScaleVector2( hypre_DeviceItem &item, + HYPRE_Int num_vectors, + HYPRE_Int num_rows, + HYPRE_Complex *diag, + HYPRE_Complex *x, + HYPRE_Complex beta, + HYPRE_Complex *y, + HYPRE_Complex *z ) +{ + HYPRE_Int i = hypre_gpu_get_grid_thread_id<1, 1>(item); + HYPRE_Int j; + HYPRE_Complex inv_diag; + HYPRE_Complex x_over_diag; + + if (i < num_rows) + { + inv_diag = 1.0 / diag[i]; + + if (NV > 0) + { +#pragma unroll + for (j = 0; j < NV; j++) + { + x_over_diag = x[i + j * num_rows] * inv_diag; + + if (CY) + { + y[i + j * num_rows] = x_over_diag; + } + z[i + j * num_rows] += beta * x_over_diag; + } + } + else + { +#pragma unroll 8 + for (j = 0; j < num_vectors; j++) + { + x_over_diag = x[i + j * num_rows] * inv_diag; + + if (CY) + { + y[i + j * num_rows] = x_over_diag; + } + z[i + j * num_rows] += beta * x_over_diag; + } + } + } +} + +/*-------------------------------------------------------------------- + * hypreDevice_DiagScaleVector2 + * + * y = x ./ diag + * z = z + beta * (x ./ diag) + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypreDevice_DiagScaleVector2( HYPRE_Int num_vectors, + HYPRE_Int num_rows, + HYPRE_Complex *diag, + HYPRE_Complex *x, + HYPRE_Complex beta, + HYPRE_Complex *y, + HYPRE_Complex *z, + HYPRE_Int computeY ) +{ + /* trivial case */ + if (num_rows <= 0) + { + return hypre_error_flag; + } + hypre_assert(num_vectors > 0); + + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(num_rows, "thread", bDim); + + switch (num_vectors) + { + case 1: + if (computeY > 0) + { + HYPRE_GPU_LAUNCH( (hypreGPUKernel_DiagScaleVector2<1, 1>), gDim, bDim, + num_vectors, num_rows, diag, x, beta, y, z ); + } + else + { + HYPRE_GPU_LAUNCH( (hypreGPUKernel_DiagScaleVector2<1, 0>), gDim, bDim, + num_vectors, num_rows, diag, x, beta, y, z ); + } + break; + + case 2: + if (computeY > 0) + { + HYPRE_GPU_LAUNCH( (hypreGPUKernel_DiagScaleVector2<2, 1>), gDim, bDim, + num_vectors, num_rows, diag, x, beta, y, z ); + } + else + { + HYPRE_GPU_LAUNCH( (hypreGPUKernel_DiagScaleVector2<2, 0>), gDim, bDim, + num_vectors, num_rows, diag, x, beta, y, z ); + } + break; + + case 3: + if (computeY > 0) + { + HYPRE_GPU_LAUNCH( (hypreGPUKernel_DiagScaleVector2<3, 1>), gDim, bDim, + num_vectors, num_rows, diag, x, beta, y, z ); + } + else + { + HYPRE_GPU_LAUNCH( (hypreGPUKernel_DiagScaleVector2<3, 0>), gDim, bDim, + num_vectors, num_rows, diag, x, beta, y, z ); + } + break; + + case 4: + if (computeY > 0) + { + HYPRE_GPU_LAUNCH( (hypreGPUKernel_DiagScaleVector2<4, 1>), gDim, bDim, + num_vectors, num_rows, diag, x, beta, y, z ); + } + else + { + HYPRE_GPU_LAUNCH( (hypreGPUKernel_DiagScaleVector2<4, 0>), gDim, bDim, + num_vectors, num_rows, diag, x, beta, y, z ); + } + break; + + case 5: + if (computeY > 0) + { + HYPRE_GPU_LAUNCH( (hypreGPUKernel_DiagScaleVector2<5, 1>), gDim, bDim, + num_vectors, num_rows, diag, x, beta, y, z ); + } + else + { + HYPRE_GPU_LAUNCH( (hypreGPUKernel_DiagScaleVector2<5, 0>), gDim, bDim, + num_vectors, num_rows, diag, x, beta, y, z ); + } + break; + + case 6: + if (computeY > 0) + { + HYPRE_GPU_LAUNCH( (hypreGPUKernel_DiagScaleVector2<6, 1>), gDim, bDim, + num_vectors, num_rows, diag, x, beta, y, z ); + } + else + { + HYPRE_GPU_LAUNCH( (hypreGPUKernel_DiagScaleVector2<6, 0>), gDim, bDim, + num_vectors, num_rows, diag, x, beta, y, z ); + } + break; + + case 7: + if (computeY > 0) + { + HYPRE_GPU_LAUNCH( (hypreGPUKernel_DiagScaleVector2<7, 1>), gDim, bDim, + num_vectors, num_rows, diag, x, beta, y, z ); + } + else + { + HYPRE_GPU_LAUNCH( (hypreGPUKernel_DiagScaleVector2<7, 0>), gDim, bDim, + num_vectors, num_rows, diag, x, beta, y, z ); + } + break; + + case 8: + if (computeY > 0) + { + HYPRE_GPU_LAUNCH( (hypreGPUKernel_DiagScaleVector2<8, 1>), gDim, bDim, + num_vectors, num_rows, diag, x, beta, y, z ); + } + else + { + HYPRE_GPU_LAUNCH( (hypreGPUKernel_DiagScaleVector2<8, 0>), gDim, bDim, + num_vectors, num_rows, diag, x, beta, y, z ); + } + break; + + default: + if (computeY > 0) + { + HYPRE_GPU_LAUNCH( (hypreGPUKernel_DiagScaleVector2<0, 1>), gDim, bDim, + num_vectors, num_rows, diag, x, beta, y, z ); + } + else + { + HYPRE_GPU_LAUNCH( (hypreGPUKernel_DiagScaleVector2<0, 0>), gDim, bDim, + num_vectors, num_rows, diag, x, beta, y, z ); + } + break; + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------- + * hypreGPUKernel_zeqxmydd + * + * z[i] = (x[i] + alpha*y[i])*d[i] + *--------------------------------------------------------------------*/ + +__global__ void +hypreGPUKernel_zeqxmydd(hypre_DeviceItem &item, + HYPRE_Int n, + HYPRE_Complex* __restrict__ x, + HYPRE_Complex alpha, + HYPRE_Complex* __restrict__ y, + HYPRE_Complex* __restrict__ z, + HYPRE_Complex* __restrict__ d) +{ + HYPRE_Int i = hypre_gpu_get_grid_thread_id<1, 1>(item); + + if (i < n) + { + z[i] = (x[i] + alpha * y[i]) * d[i]; + } +} + +/*-------------------------------------------------------------------- + * hypreDevice_zeqxmydd + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypreDevice_zeqxmydd(HYPRE_Int n, + HYPRE_Complex *x, + HYPRE_Complex alpha, + HYPRE_Complex *y, + HYPRE_Complex *z, + HYPRE_Complex *d) +{ + /* trivial case */ + if (n <= 0) + { + return hypre_error_flag; + } + + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(n, "thread", bDim); + + HYPRE_GPU_LAUNCH( hypreGPUKernel_zeqxmydd, gDim, bDim, n, x, alpha, y, z, d); + + return hypre_error_flag; +} + +#endif // #if defined(HYPRE_USING_GPU) + +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * cuda/hip functions + * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + +/*-------------------------------------------------------------------- + * hypreGPUKernel_CompileFlagSafetyCheck + * + * The architecture identification macro __CUDA_ARCH__ is assigned a + * three-digit value string xy0 (ending in a literal 0) during each + * nvcc compilation stage 1 that compiles for compute_xy. + * + * This macro can be used in the implementation of GPU functions for + * determining the virtual architecture for which it is currently being + * compiled. The host code (the non-GPU code) must not depend on it. + * + * Note that compute_XX refers to a PTX version and sm_XX refers to + * a cubin version. + *--------------------------------------------------------------------*/ + +__global__ void +hypreGPUKernel_CompileFlagSafetyCheck( hypre_DeviceItem &item, + hypre_int *cuda_arch_compile ) +{ +#if defined(__CUDA_ARCH__) + cuda_arch_compile[0] = __CUDA_ARCH__; +#endif +} + +/*-------------------------------------------------------------------- + * hypre_CudaCompileFlagCheck + * + * Assume this function is called inside HYPRE_Init(), at a place + * where we do not want to activate memory pooling, so we do not use + * hypre's memory model to Alloc and Free. + * + * See commented out code below (and do not delete) + * + * This is really only defined for CUDA and not for HIP + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CudaCompileFlagCheck() +{ +#if defined(HYPRE_USING_CUDA) + HYPRE_Int device; + hypre_GetDevice(&device); + + struct cudaDeviceProp props; + HYPRE_CUDA_CALL(cudaGetDeviceProperties(&props, device)); + hypre_int cuda_arch_actual = props.major * 100 + props.minor * 10; + hypre_int cuda_arch_compile = -1; + dim3 gDim(1, 1, 1), bDim(1, 1, 1); + + hypre_int *cuda_arch_compile_d = NULL; + //cuda_arch_compile_d = hypre_TAlloc(hypre_int, 1, HYPRE_MEMORY_DEVICE); + HYPRE_CUDA_CALL( cudaMalloc(&cuda_arch_compile_d, sizeof(hypre_int)) ); + HYPRE_CUDA_CALL( cudaMemcpy(cuda_arch_compile_d, &cuda_arch_compile, sizeof(hypre_int), + cudaMemcpyHostToDevice) ); + HYPRE_GPU_LAUNCH( hypreGPUKernel_CompileFlagSafetyCheck, gDim, bDim, cuda_arch_compile_d ); + HYPRE_CUDA_CALL( cudaMemcpy(&cuda_arch_compile, cuda_arch_compile_d, sizeof(hypre_int), + cudaMemcpyDeviceToHost) ); + //hypre_TFree(cuda_arch_compile_d, HYPRE_MEMORY_DEVICE); + HYPRE_CUDA_CALL( cudaFree(cuda_arch_compile_d) ); + + /* HYPRE_CUDA_CALL(cudaDeviceSynchronize()); */ + + const hypre_int cuda_arch_actual_major = cuda_arch_actual / 100; + const hypre_int cuda_arch_compile_major = cuda_arch_compile / 100; + const hypre_int cuda_arch_actual_minor = cuda_arch_actual % 100; + const hypre_int cuda_arch_compile_minor = cuda_arch_compile % 100; + + if (cuda_arch_actual_major != cuda_arch_compile_major || + cuda_arch_actual_minor < cuda_arch_compile_minor) + { + char msg[256]; + + if (-1 == cuda_arch_compile) + { + hypre_sprintf(msg, "hypre error: no proper cuda_arch found"); + } + else + { + hypre_sprintf(msg, + "hypre error: Compile arch %d ('--generate-code arch=compute_%d') does not match device arch %d", + cuda_arch_compile, cuda_arch_compile / 10, cuda_arch_actual); + } + + hypre_error_w_msg(1, msg); +#if defined(HYPRE_DEBUG) + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "%s\n", msg); +#endif + hypre_assert(0); + } +#endif // defined(HYPRE_USING_CUDA) + + return hypre_error_flag; +} + +#if defined(HYPRE_USING_CUSPARSE) + +/*-------------------------------------------------------------------- + * hypre_HYPREComplexToCudaDataType + * + * Determines the associated CudaDataType for HYPRE_Complex + * + * TODO: Should be known at compile time. + * Support more sizes. + * Support complex. + * + * Note: Only works for Single and Double precision. + *--------------------------------------------------------------------*/ + +cudaDataType +hypre_HYPREComplexToCudaDataType() +{ + /* + if (sizeof(char)*CHAR_BIT != 8) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ERROR: Unsupported char size"); + hypre_assert(false); + } + */ +#if defined(HYPRE_COMPLEX) + return CUDA_C_64F; +#else +#if defined(HYPRE_SINGLE) + hypre_assert(sizeof(HYPRE_Complex) == 4); + return CUDA_R_32F; +#elif defined(HYPRE_LONG_DOUBLE) +#error "Long Double is not supported on GPUs" +#else + hypre_assert(sizeof(HYPRE_Complex) == 8); + return CUDA_R_64F; +#endif +#endif // #if defined(HYPRE_COMPLEX) +} + +#if CUSPARSE_VERSION >= 10300 +/*-------------------------------------------------------------------- + * hypre_HYPREIntToCusparseIndexType + * + * Determines the associated cusparseIndexType_t for HYPRE_Int + *--------------------------------------------------------------------*/ + +cusparseIndexType_t +hypre_HYPREIntToCusparseIndexType() +{ + /* + if(sizeof(char)*CHAR_BIT!=8) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ERROR: Unsupported char size"); + hypre_assert(false); + } + */ + +#if defined(HYPRE_BIGINT) + hypre_assert(sizeof(HYPRE_Int) == 8); + return CUSPARSE_INDEX_64I; +#else + hypre_assert(sizeof(HYPRE_Int) == 4); + return CUSPARSE_INDEX_32I; +#endif +} +#endif + +#endif // #if defined(HYPRE_USING_CUSPARSE) + +#if defined(HYPRE_USING_CUBLAS) + +/*-------------------------------------------------------------------- + * hypre_DeviceDataCublasHandle + *--------------------------------------------------------------------*/ + +cublasHandle_t +hypre_DeviceDataCublasHandle(hypre_DeviceData *data) +{ + if (data->cublas_handle) + { + return data->cublas_handle; + } + + cublasHandle_t handle; + HYPRE_CUBLAS_CALL( cublasCreate(&handle) ); + + HYPRE_CUBLAS_CALL( cublasSetStream(handle, hypre_DeviceDataComputeStream(data)) ); + + data->cublas_handle = handle; + + return handle; +} +#endif + +#if defined(HYPRE_USING_CUSPARSE) + +/*-------------------------------------------------------------------- + * hypre_DeviceDataCusparseHandle + *--------------------------------------------------------------------*/ + +cusparseHandle_t +hypre_DeviceDataCusparseHandle(hypre_DeviceData *data) +{ + if (data->cusparse_handle) + { + return data->cusparse_handle; + } + + cusparseHandle_t handle; + HYPRE_CUSPARSE_CALL( cusparseCreate(&handle) ); + + HYPRE_CUSPARSE_CALL( cusparseSetStream(handle, hypre_DeviceDataComputeStream(data)) ); + + data->cusparse_handle = handle; + + return handle; +} +#endif // defined(HYPRE_USING_CUSPARSE) + +#if defined(HYPRE_USING_ROCSPARSE) + +/*-------------------------------------------------------------------- + * hypre_DeviceDataCusparseHandle + *--------------------------------------------------------------------*/ + +rocsparse_handle +hypre_DeviceDataCusparseHandle(hypre_DeviceData *data) +{ + if (data->cusparse_handle) + { + return data->cusparse_handle; + } + + rocsparse_handle handle; + HYPRE_ROCSPARSE_CALL( rocsparse_create_handle(&handle) ); + + HYPRE_ROCSPARSE_CALL( rocsparse_set_stream(handle, hypre_DeviceDataComputeStream(data)) ); + + data->cusparse_handle = handle; + + return handle; +} +#endif // defined(HYPRE_USING_ROCSPARSE) + +#if defined(HYPRE_USING_CUSOLVER) || defined(HYPRE_USING_ROCSOLVER) + +/*-------------------------------------------------------------------- + * hypre_DeviceDataVendorSolverHandle + *--------------------------------------------------------------------*/ + +vendorSolverHandle_t +hypre_DeviceDataVendorSolverHandle(hypre_DeviceData *data) +{ + if (data->vendor_solver_handle) + { + return data->vendor_solver_handle; + } + +#if defined(HYPRE_USING_CUSOLVER) + cusolverDnHandle_t handle; + + HYPRE_CUSOLVER_CALL( cusolverDnCreate(&handle) ); + HYPRE_CUSOLVER_CALL( cusolverDnSetStream(handle, hypre_DeviceDataComputeStream(data)) ); +#else + rocblas_handle handle; + + HYPRE_ROCBLAS_CALL( rocblas_create_handle(&handle) ); + HYPRE_ROCBLAS_CALL( rocblas_set_stream(handle, hypre_DeviceDataComputeStream(data)) ); +#endif + + data->vendor_solver_handle = handle; + + return handle; +} +#endif // defined(HYPRE_USING_CUSOLVER) || defined(HYPRE_USING_ROCSOLVER) + +#endif // #if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * sycl functions + * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + +#if defined(HYPRE_USING_SYCL) + +/*-------------------------------------------------------------------- + * HYPRE_SetSYCLDevice + *--------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SetSYCLDevice(sycl::device user_device) +{ + hypre_DeviceData *data = hypre_HandleDeviceData(hypre_handle()); + + /* Cleanup default device and queues */ + if (data->device) + { + delete data->device; + } + +#if defined(HYPRE_USING_CUDA_STREAMS) + for (HYPRE_Int i = 0; i < HYPRE_MAX_NUM_STREAMS; i++) + { + if (data->streams[i]) + { + delete data->streams[i]; + data->streams[i] = nullptr; + } + } +#endif + + /* Setup new device and compute stream */ + data->device = new sycl::device(user_device); + hypre_HandleComputeStream(hypre_handle()); + + return hypre_error_flag; +} + +#endif // #if defined(HYPRE_USING_SYCL) + +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * additional functions + * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + +/*-------------------------------------------------------------------- + * hypre_bind_device + * + * This function is supposed to be used in the test drivers to mimic + * users' GPU binding approaches + * It is supposed to be called before HYPRE_Init, + * so that HYPRE_Init can get the wanted device id + * Note - sycl has no analogue to cudaSetDevice(), + * so this has no effect on the sycl implementation. + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypre_bind_device_id( HYPRE_Int device_id_in, + HYPRE_Int myid, + HYPRE_Int nproc, + MPI_Comm comm ) +{ +#if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) + /* proc id (rank) on the running node */ + HYPRE_Int myNodeid; + /* num of procs (size) on the node */ + HYPRE_Int NodeSize; + /* num of devices seen */ + hypre_int nDevices; + /* device id that want to bind */ + hypre_int device_id; + + hypre_MPI_Comm node_comm; + hypre_MPI_Comm_split_type( comm, hypre_MPI_COMM_TYPE_SHARED, + myid, hypre_MPI_INFO_NULL, &node_comm ); + hypre_MPI_Comm_rank(node_comm, &myNodeid); + hypre_MPI_Comm_size(node_comm, &NodeSize); + hypre_MPI_Comm_free(&node_comm); + hypre_GetDeviceCount(&nDevices); + + if (-1 == device_id_in) + { + /* get number of devices on this node */ + device_id = myNodeid % nDevices; + } + else + { + device_id = (hypre_int) device_id_in; + } + + /* set device */ +#if defined(HYPRE_USING_DEVICE_OPENMP) + omp_set_default_device(device_id); + +#elif defined(HYPRE_USING_CUDA) + HYPRE_CUDA_CALL( cudaSetDevice(device_id) ); + +#elif defined(HYPRE_USING_HIP) + HYPRE_HIP_CALL( hipSetDevice(device_id) ); + +#elif defined(HYPRE_USING_SYCL) + HYPRE_UNUSED_VAR(device_id); +#endif + +#if defined(HYPRE_DEBUG) && defined(HYPRE_PRINT_ERRORS) + hypre_printf("Proc [global %d/%d, local %d/%d] can see %d GPUs and is running on %d\n", + myid, nproc, myNodeid, NodeSize, nDevices, device_id); +#endif + +#else + HYPRE_UNUSED_VAR(device_id_in); + HYPRE_UNUSED_VAR(myid); + HYPRE_UNUSED_VAR(nproc); + HYPRE_UNUSED_VAR(comm); + +#endif // #if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) + + return hypre_error_flag; +} + +HYPRE_Int +hypre_bind_device( HYPRE_Int myid, + HYPRE_Int nproc, + MPI_Comm comm ) +{ + return hypre_bind_device_id(-1, myid, nproc, comm); +} diff --git a/external/hypre/src/utilities/device_utils.h b/external/hypre/src/utilities/device_utils.h new file mode 100644 index 00000000..6cc7fbc5 --- /dev/null +++ b/external/hypre/src/utilities/device_utils.h @@ -0,0 +1,2063 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#ifndef HYPRE_DEVICE_UTILS_H +#define HYPRE_DEVICE_UTILS_H + +#if defined(HYPRE_USING_GPU) + +/* Data types depending on GPU architecture */ +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_SYCL) +typedef hypre_uint hypre_mask; +#define hypre_mask_one 1U + +#elif defined(HYPRE_USING_HIP) +typedef hypre_ulonglongint hypre_mask; +#define hypre_mask_one 1ULL + +#endif + +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * cuda includes + * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + +#if defined(HYPRE_USING_CUDA) +using hypre_DeviceItem = void*; +#include +#include +#include + +#if defined(HYPRE_USING_CURAND) +#include +#endif + +#if defined(HYPRE_USING_CUBLAS) +#include +#endif + +#if defined(HYPRE_USING_CUSPARSE) +/* Note (VPM) : As of cuSPARSE 12, ILU functionalities have been marked as deprecated. + The following definition avoids compilation warnings regarding the use of ILU routines */ +#define DISABLE_CUSPARSE_DEPRECATED +#include +#endif + +#if defined(HYPRE_USING_CUSOLVER) +#include +#endif + +#ifndef CUDART_VERSION +#error CUDART_VERSION Undefined! +#endif + +#ifndef CUDA_VERSION +#error CUDA_VERSION Undefined! +#endif + +#if CUDA_VERSION >= 11000 +#define THRUST_IGNORE_DEPRECATED_CPP11 +#define CUB_IGNORE_DEPRECATED_CPP11 +#define THRUST_IGNORE_DEPRECATED_CPP_DIALECT +#define CUB_IGNORE_DEPRECATED_CPP_DIALECT +#endif + +#ifndef CUSPARSE_VERSION +#if defined(CUSPARSE_VER_MAJOR) && defined(CUSPARSE_VER_MINOR) && defined(CUSPARSE_VER_PATCH) +#define CUSPARSE_VERSION (CUSPARSE_VER_MAJOR * 1000 + CUSPARSE_VER_MINOR * 100 + CUSPARSE_VER_PATCH) +#else +#define CUSPARSE_VERSION CUDA_VERSION +#endif +#endif + +#define CUSPARSE_NEWAPI_VERSION 11000 +#define CUSPARSE_NEWSPMM_VERSION 11401 +#define CUDA_MALLOCASYNC_VERSION 11020 +#define CUDA_THRUST_NOSYNC_VERSION 12000 + +#define CUSPARSE_SPSV_VERSION 11600 +#if CUSPARSE_VERSION >= CUSPARSE_SPSV_VERSION +#define hypre_cusparseSpSVDescr cusparseSpSVDescr_t +#define hypre_cusparseSpSV_createDescr cusparseSpSV_createDescr +#define hypre_cusparseSpSV_destroyDescr cusparseSpSV_destroyDescr +#else +#define hypre_cusparseSpSVDescr csrsv2Info_t +#define hypre_cusparseSpSV_createDescr cusparseCreateCsrsv2Info +#define hypre_cusparseSpSV_destroyDescr cusparseDestroyCsrsv2Info +#endif + +#define CUSPARSE_SPSM_VERSION 11600 +#if CUSPARSE_VERSION >= CUSPARSE_SPSM_VERSION +#define hypre_cusparseSpSMDescr cusparseSpSMDescr_t +#define hypre_cusparseSpSM_createDescr cusparseSpSM_createDescr +#define hypre_cusparseSpSM_destroyDescr cusparseSpSM_destroyDescr +#else +#define hypre_cusparseSpSMDescr csrsm2Info_t +#define hypre_cusparseSpSM_createDescr cusparseCreateCsrsm2Info +#define hypre_cusparseSpSM_destroyDescr cusparseDestroyCsrsm2Info +#endif + +#if defined(HYPRE_USING_DEVICE_MALLOC_ASYNC) +#if CUDA_VERSION < CUDA_MALLOCASYNC_VERSION +#error cudaMalloc/FreeAsync needs CUDA 11.2 +#endif +#endif + +#if defined(HYPRE_USING_THRUST_NOSYNC) +#if CUDA_VERSION < CUDA_THRUST_NOSYNC_VERSION +#error thrust::cuda::par_nosync needs CUDA 12 +#endif +#define HYPRE_THRUST_EXECUTION thrust::cuda::par_nosync +#else +#define HYPRE_THRUST_EXECUTION thrust::cuda::par +#endif + +#endif /* defined(HYPRE_USING_CUDA) */ + +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * hip includes + * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + +#if defined(HYPRE_USING_HIP) + +using hypre_DeviceItem = void*; +#include + +#if defined(HYPRE_USING_ROCBLAS) +#include +#endif + +#if defined(HYPRE_USING_ROCSPARSE) +#include +#if !defined(ROCSPARSE_VERSION) +#define ROCSPARSE_VERSION (ROCSPARSE_VERSION_MAJOR * 100000 + ROCSPARSE_VERSION_MINOR * 100 + ROCSPARSE_VERSION_PATCH) +#endif +#endif + +#if defined(HYPRE_USING_ROCSOLVER) +#include +#endif + +#if defined(HYPRE_USING_ROCRAND) +#include +#endif + +#endif /* defined(HYPRE_USING_HIP) */ + +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * thrust includes + * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + +#include +#if defined(HYPRE_USING_CUDA) +#include +#elif defined(HYPRE_USING_HIP) +#include +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* VPM: this is needed to support cuda 10. not_fn is the correct replacement going forward. */ +#define THRUST_VERSION_NOTFN 200700 +#if (defined(THRUST_VERSION) && THRUST_VERSION < THRUST_VERSION_NOTFN) +#define HYPRE_THRUST_NOT(pred) thrust::not1(pred) +#else +#define HYPRE_THRUST_NOT(pred) thrust::not_fn(pred) +#endif + +using namespace thrust::placeholders; +#endif /* defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) */ + +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * sycl includes + * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + +#if defined(HYPRE_USING_SYCL) + +#include +#include +#if defined(HYPRE_USING_ONEMKLSPARSE) +#include +#endif +#if defined(HYPRE_USING_ONEMKLBLAS) +#include +#include +#endif +#if defined(HYPRE_USING_ONEMKLRAND) +#include +#endif + +/* The following definitions facilitate code reuse and limits + * if/def-ing when unifying cuda/hip code with sycl code */ +using dim3 = sycl::range<3>; +using hypre_DeviceItem = sycl::nd_item<3>; +#define __global__ +#define __host__ +#define __device__ +#define __forceinline__ __inline__ __attribute__((always_inline)) + +#endif /* defined(HYPRE_USING_SYCL) */ + +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * device defined values + * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + +#define HYPRE_MAX_NTHREADS_BLOCK 1024 + +// HYPRE_WARP_BITSHIFT is just log2 of HYPRE_WARP_SIZE +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_SYCL) +#define HYPRE_WARP_SIZE 32 +#define HYPRE_WARP_BITSHIFT 5 +#define HYPRE_WARP_FULL_MASK 0xFFFFFFFF +#elif defined(HYPRE_USING_HIP) +#define HYPRE_WARP_SIZE 64 +#define HYPRE_WARP_BITSHIFT 6 +#define HYPRE_WARP_FULL_MASK 0xFFFFFFFFFFFFFFF +#endif + +#define HYPRE_MAX_NUM_WARPS (64 * 64 * 32) +#define HYPRE_FLT_LARGE 1e30 +#define HYPRE_1D_BLOCK_SIZE 512 +#define HYPRE_MAX_NUM_STREAMS 10 +#define HYPRE_SPGEMM_MAX_NBIN 10 + +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * macro for launching GPU kernels + * NOTE: IN HYPRE'S DEFAULT STREAM + * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + +#if defined(HYPRE_DEBUG) +#define GPU_LAUNCH_SYNC { hypre_SyncComputeStream(); hypre_GetDeviceLastError(); } +#else +#define GPU_LAUNCH_SYNC +#endif + +/* cuda/hip version */ +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +#define HYPRE_GPU_LAUNCH2(kernel_name, gridsize, blocksize, shmem_size, ...) \ +{ \ + if ( gridsize.x == 0 || gridsize.y == 0 || gridsize.z == 0 || \ + blocksize.x == 0 || blocksize.y == 0 || blocksize.z == 0 ) \ + { \ + /* printf("Warning %s %d: Zero CUDA grid/block (%d %d %d) (%d %d %d)\n", \ + __FILE__, __LINE__, \ + gridsize.x, gridsize.y, gridsize.z, blocksize.x, blocksize.y, blocksize.z); */ \ + } \ + else \ + { \ + hypre_DeviceItem item = NULL; \ + (kernel_name) <<< (gridsize), (blocksize), shmem_size, hypre_HandleComputeStream(hypre_handle()) >>> (item, __VA_ARGS__); \ + GPU_LAUNCH_SYNC; \ + } \ +} + +#define HYPRE_GPU_LAUNCH(kernel_name, gridsize, blocksize, ...) HYPRE_GPU_LAUNCH2(kernel_name, gridsize, blocksize, 0, __VA_ARGS__) +#endif /* defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) */ + +/* sycl version */ +#if defined(HYPRE_USING_SYCL) + +#define HYPRE_GPU_LAUNCH(kernel_name, gridsize, blocksize, ...) \ +{ \ + if ( gridsize[2] == 0 || blocksize[2] == 0 ) \ + { \ + /* hypre_printf("Warning %s %d: Zero SYCL 1D launch parameters grid/block (%d) (%d)\n", \ + __FILE__, __LINE__, \ + gridsize[0], blocksize[0]); */ \ + } \ + else \ + { \ + hypre_HandleComputeStream(hypre_handle())->submit([&] (sycl::handler& cgh) { \ + cgh.parallel_for(sycl::nd_range<3>(gridsize*blocksize, blocksize), \ + [=] (hypre_DeviceItem item) [[intel::reqd_sub_group_size(HYPRE_WARP_SIZE)]] \ + { (kernel_name)(item, __VA_ARGS__); \ + }); \ + }).wait_and_throw(); \ + } \ +} + +#define HYPRE_CPU_LAUNCH(kernel_name, gridsize, blocksize, ...) \ +{ \ + if ( gridsize[2] == 0 || blocksize[2] == 0 ) \ + { \ + /* hypre_printf("Warning %s %d: Zero SYCL 1D launch parameters grid/block (%d) (%d)\n", \ + __FILE__, __LINE__, \ + gridsize[0], blocksize[0]); */ \ + } \ + else \ + { \ + HPYRE_Int compute_stream = hypre_HandleComputeStreamNum(hypre_handle()); \ + hypre_HandleComputeStreamNum(hypre_handle) = HYPRE_MAX_NUM_STREAMS - 1; \ + hypre_HandleComputeStream(hypre_handle())->submit([&] (sycl::handler& cgh) { \ + cgh.parallel_for(sycl::nd_range<3>(gridsize*blocksize, blocksize), \ + [=] (hypre_DeviceItem item) [[intel::reqd_sub_group_size(HYPRE_WARP_SIZE)]] \ + { (kernel_name)(item, __VA_ARGS__); \ + }); \ + }).wait_and_throw(); \ + hypre_HandleComputeStreamNum(hypre_handle) = compute_stream; \ + } \ +} + +#define HYPRE_GPU_LAUNCH2(kernel_name, gridsize, blocksize, shmem_size, ...) \ +{ \ + if ( gridsize[2] == 0 || blocksize[2] == 0 ) \ + { \ + /* hypre_printf("Warning %s %d: Zero SYCL 1D launch parameters grid/block (%d) (%d)\n", \ + __FILE__, __LINE__, \ + gridsize[0], blocksize[0]); */ \ + } \ + else \ + { \ + hypre_HandleComputeStream(hypre_handle())->submit([&] (sycl::handler& cgh) { \ + sycl::range<1> shmem_range(shmem_size); \ + sycl::local_accessor shmem_accessor(shmem_range, cgh); \ + cgh.parallel_for(sycl::nd_range<3>(gridsize*blocksize, blocksize), \ + [=] (hypre_DeviceItem item) [[intel::reqd_sub_group_size(HYPRE_WARP_SIZE)]] \ + { (kernel_name)(item, \ + shmem_accessor.get_multi_ptr(), __VA_ARGS__);\ + }); \ + }).wait_and_throw(); \ + } \ +} + +#define HYPRE_GPU_DEBUG_LAUNCH(kernel_name, gridsize, blocksize, ...) \ +{ \ + if ( gridsize[2] == 0 || blocksize[2] == 0 ) \ + { \ + /* hypre_printf("Warning %s %d: Zero SYCL 1D launch parameters grid/block (%d) (%d)\n", \ + __FILE__, __LINE__, \ + gridsize[0], blocksize[0]); */ \ + } \ + else \ + { \ + hypre_HandleComputeStream(hypre_handle())->submit([&] (sycl::handler& cgh) { \ + auto debug_stream = sycl::stream(4096, 1024, cgh); \ + cgh.parallel_for(sycl::nd_range<3>(gridsize*blocksize, blocksize), \ + [=] (hypre_DeviceItem item) [[intel::reqd_sub_group_size(HYPRE_WARP_SIZE)]] \ + { (kernel_name)(item, debug_stream, __VA_ARGS__); \ + }); \ + }).wait_and_throw(); \ + } \ +} + +#define HYPRE_GPU_DEBUG_LAUNCH2(kernel_name, gridsize, blocksize, shmem_size, ...) \ +{ \ + if ( gridsize[2] == 0 || blocksize[2] == 0 ) \ + { \ + /* hypre_printf("Warning %s %d: Zero SYCL 1D launch parameters grid/block (%d) (%d)\n", \ + __FILE__, __LINE__, \ + gridsize[0], blocksize[0]); */ \ + } \ + else \ + { \ + hypre_HandleComputeStream(hypre_handle())->submit([&] (sycl::handler& cgh) { \ + auto debug_stream = sycl::stream(4096, 1024, cgh); \ + sycl::range<1> shmem_range(shmem_size); \ + sycl::accessor shmem_accessor(shmem_range, cgh); \ + cgh.parallel_for(sycl::nd_range<3>(gridsize*blocksize, blocksize), \ + [=] (hypre_DeviceItem item) [[intel::reqd_sub_group_size(HYPRE_WARP_SIZE)]] \ + { (kernel_name)(item, debug_stream, \ + shmem_accessor.get_multi_ptr(), __VA_ARGS__);\ + }); \ + }).wait_and_throw(); \ + } \ +} +#endif /* defined(HYPRE_USING_SYCL) */ + +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * macros for wrapping cuda/hip/sycl calls for error reporting + * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + +#if defined(HYPRE_USING_CUDA) +#define HYPRE_CUDA_CALL(call) do { \ + cudaError_t err = call; \ + if (cudaSuccess != err) { \ + printf("CUDA ERROR (code = %d, %s) at %s:%d\n", err, cudaGetErrorString(err), \ + __FILE__, __LINE__); \ + hypre_assert(0); \ + } } while(0) + +#elif defined(HYPRE_USING_HIP) +#define HYPRE_HIP_CALL(call) do { \ + hipError_t err = call; \ + if (hipSuccess != err) { \ + printf("HIP ERROR (code = %d, %s) at %s:%d\n", err, hipGetErrorString(err), \ + __FILE__, __LINE__); \ + hypre_assert(0); \ + } } while(0) + +#elif defined(HYPRE_USING_SYCL) +#define HYPRE_SYCL_CALL(call) \ + try \ + { \ + call; \ + } \ + catch (sycl::exception const &ex) \ + { \ + hypre_printf("SYCL ERROR (code = %s) at %s:%d\n", ex.what(), \ + __FILE__, __LINE__); \ + assert(0); \ + } \ + catch(std::runtime_error const& ex) \ + { \ + hypre_printf("STD ERROR (code = %s) at %s:%d\n", ex.what(), \ + __FILE__, __LINE__); \ + assert(0); \ + } +#endif + +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * macros for wrapping vendor library calls for error reporting + * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + +#if defined(HYPRE_COMPLEX) /* Double Complex */ +#error "GPU build does not support complex numbers!" + +#elif defined(HYPRE_SINGLE) /* Single */ +#if defined(HYPRE_USING_CUDA) +/* cuBLAS */ +#define hypre_cublas_scal cublasSscal +#define hypre_cublas_axpy cublasSaxpy +#define hypre_cublas_dot cublasSdot +#define hypre_cublas_gemv cublasSgemv +#define hypre_cublas_getrfBatched cublasSgetrfBatched +#define hypre_cublas_getriBatched cublasSgetriBatched + +/* cuSPARSE */ +#define hypre_cusparse_csru2csr_bufferSizeExt cusparseScsru2csr_bufferSizeExt +#define hypre_cusparse_csru2csr cusparseScsru2csr +#define hypre_cusparse_csrsv2_bufferSize cusparseScsrsv2_bufferSize +#define hypre_cusparse_csrsv2_analysis cusparseScsrsv2_analysis +#define hypre_cusparse_csrsv2_solve cusparseScsrsv2_solve +#define hypre_cusparse_csrmv cusparseScsrmv +#define hypre_cusparse_csrgemm cusparseScsrgemm +#define hypre_cusparse_csr2csc cusparseScsr2csc +#define hypre_cusparse_csrilu02_bufferSize cusparseScsrilu02_bufferSize +#define hypre_cusparse_csrilu02_analysis cusparseScsrilu02_analysis +#define hypre_cusparse_csrilu02 cusparseScsrilu02 +#define hypre_cusparse_csrsm2_bufferSizeExt cusparseScsrsm2_bufferSizeExt +#define hypre_cusparse_csrsm2_analysis cusparseScsrsm2_analysis +#define hypre_cusparse_csrsm2_solve cusparseScsrsm2_solve + +/* cuSOLVER */ +#define hypre_cusolver_dngetrf cusolverDnSgetrf +#define hypre_cusolver_dngetrf_bs cusolverDnSgetrf_bufferSize +#define hypre_cusolver_dngetrs cusolverDnSgetrs + +#elif defined(HYPRE_USING_HIP) +/* rocSPARSE */ +#define hypre_rocsparse_csrsv_buffer_size rocsparse_scsrsv_buffer_size +#define hypre_rocsparse_csrsv_analysis rocsparse_scsrsv_analysis +#define hypre_rocsparse_csrsv_solve rocsparse_scsrsv_solve +#define hypre_rocsparse_gthr rocsparse_sgthr +#define hypre_rocsparse_csrmv_analysis rocsparse_scsrmv_analysis +#define hypre_rocsparse_csrmv rocsparse_scsrmv +#define hypre_rocsparse_csrgemm_buffer_size rocsparse_scsrgemm_buffer_size +#define hypre_rocsparse_csrgemm rocsparse_scsrgemm +#define hypre_rocsparse_csr2csc rocsparse_scsr2csc +#define hypre_rocsparse_csrilu0_buffer_size rocsparse_scsrilu0_buffer_size +#define hypre_rocsparse_csrilu0_analysis rocsparse_scsrilu0_analysis +#define hypre_rocsparse_csrilu0 rocsparse_scsrilu0 +#define hypre_rocsparse_csritilu0_compute rocsparse_scsritilu0_compute +#define hypre_rocsparse_csritilu0_history rocsparse_scsritilu0_history + +/* rocSOLVER */ + +/************** + * TODO (VPM) * + **************/ + +#endif /* if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) */ + +#elif defined(HYPRE_LONG_DOUBLE) /* Long Double */ +#error "GPU build does not support Long Double numbers!" + +#else /* Double */ +#if defined(HYPRE_USING_CUDA) +/* cuBLAS */ +#define hypre_cublas_scal cublasDscal +#define hypre_cublas_axpy cublasDaxpy +#define hypre_cublas_dot cublasDdot +#define hypre_cublas_gemv cublasDgemv +#define hypre_cublas_getrfBatched cublasDgetrfBatched +#define hypre_cublas_getriBatched cublasDgetriBatched + +/* cuSPARSE */ +#define hypre_cusparse_csru2csr_bufferSizeExt cusparseDcsru2csr_bufferSizeExt +#define hypre_cusparse_csru2csr cusparseDcsru2csr +#define hypre_cusparse_csrsv2_bufferSize cusparseDcsrsv2_bufferSize +#define hypre_cusparse_csrsv2_analysis cusparseDcsrsv2_analysis +#define hypre_cusparse_csrsv2_solve cusparseDcsrsv2_solve +#define hypre_cusparse_csrmv cusparseDcsrmv +#define hypre_cusparse_csrgemm cusparseDcsrgemm +#define hypre_cusparse_csr2csc cusparseDcsr2csc +#define hypre_cusparse_csrilu02_bufferSize cusparseDcsrilu02_bufferSize +#define hypre_cusparse_csrilu02_analysis cusparseDcsrilu02_analysis +#define hypre_cusparse_csrilu02 cusparseDcsrilu02 +#define hypre_cusparse_csrsm2_bufferSizeExt cusparseDcsrsm2_bufferSizeExt +#define hypre_cusparse_csrsm2_analysis cusparseDcsrsm2_analysis +#define hypre_cusparse_csrsm2_solve cusparseDcsrsm2_solve + +/* cuSOLVER */ +#define hypre_cusolver_dngetrf cusolverDnDgetrf +#define hypre_cusolver_dngetrf_bs cusolverDnDgetrf_bufferSize +#define hypre_cusolver_dngetrs cusolverDnDgetrs + +#elif defined(HYPRE_USING_HIP) +/* rocSPARSE */ +#define hypre_rocsparse_csrsv_buffer_size rocsparse_dcsrsv_buffer_size +#define hypre_rocsparse_csrsv_analysis rocsparse_dcsrsv_analysis +#define hypre_rocsparse_csrsv_solve rocsparse_dcsrsv_solve +#define hypre_rocsparse_gthr rocsparse_dgthr +#define hypre_rocsparse_csrmv_analysis rocsparse_dcsrmv_analysis +#define hypre_rocsparse_csrmv rocsparse_dcsrmv +#define hypre_rocsparse_csrgemm_buffer_size rocsparse_dcsrgemm_buffer_size +#define hypre_rocsparse_csrgemm rocsparse_dcsrgemm +#define hypre_rocsparse_csr2csc rocsparse_dcsr2csc +#define hypre_rocsparse_csrilu0_buffer_size rocsparse_dcsrilu0_buffer_size +#define hypre_rocsparse_csrilu0_analysis rocsparse_dcsrilu0_analysis +#define hypre_rocsparse_csrilu0 rocsparse_dcsrilu0 +#define hypre_rocsparse_csritilu0_compute rocsparse_dcsritilu0_compute +#define hypre_rocsparse_csritilu0_history rocsparse_dcsritilu0_history + +/* rocSOLVER */ + +/************** + * TODO (VPM) * + **************/ + +#endif /* #if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP)*/ +#endif /* #if defined(HYPRE_COMPLEX) || defined(HYPRE_SINGLE) || defined(HYPRE_LONG_DOUBLE) */ + +#define HYPRE_CUBLAS_CALL(call) do { \ + cublasStatus_t err = call; \ + if (CUBLAS_STATUS_SUCCESS != err) { \ + printf("CUBLAS ERROR (code = %d, %d) at %s:%d\n", \ + err, err == CUBLAS_STATUS_EXECUTION_FAILED, __FILE__, __LINE__); \ + hypre_assert(0); exit(1); \ + } } while(0) + +#define HYPRE_ROCBLAS_CALL(call) do { \ + rocblas_status err = call; \ + if (rocblas_status_success != err) { \ + printf("rocBLAS ERROR (code = %d, %s) at %s:%d\n", \ + err, rocblas_status_to_string(err), __FILE__, __LINE__); \ + hypre_assert(0); exit(1); \ + } } while(0) + +#if CUSPARSE_VERSION >= 10300 +#define HYPRE_CUSPARSE_CALL(call) do { \ + cusparseStatus_t err = call; \ + if (CUSPARSE_STATUS_SUCCESS != err) { \ + printf("CUSPARSE ERROR (code = %d, %s) at %s:%d\n", \ + err, cusparseGetErrorString(err), __FILE__, __LINE__); \ + hypre_assert(0); exit(1); \ + } } while(0) +#else +#define HYPRE_CUSPARSE_CALL(call) do { \ + cusparseStatus_t err = call; \ + if (CUSPARSE_STATUS_SUCCESS != err) { \ + printf("CUSPARSE ERROR (code = %d) at %s:%d\n", \ + err, __FILE__, __LINE__); \ + hypre_assert(0); exit(1); \ + } } while(0) +#endif + +#define HYPRE_ROCSPARSE_CALL(call) do { \ + rocsparse_status err = call; \ + if (rocsparse_status_success != err) { \ + printf("rocSPARSE ERROR (code = %d) at %s:%d\n", \ + err, __FILE__, __LINE__); \ + assert(0); exit(1); \ + } } while(0) + +#define HYPRE_CUSOLVER_CALL(call) do { \ + cusolverStatus_t err = call; \ + if (CUSOLVER_STATUS_SUCCESS != err) { \ + printf("cuSOLVER ERROR (code = %d) at %s:%d\n", \ + err, __FILE__, __LINE__); \ + hypre_assert(0); \ + } } while(0) + +#define HYPRE_ROCSOLVER_CALL(call) do { \ + rocblas_status err = call; \ + if (rocblas_status_success != err) { \ + printf("rocSOLVER ERROR (code = %d, %s) at %s:%d\n", \ + err, rocblas_status_to_string(err), __FILE__, __LINE__); \ + } } while(0) + +#define HYPRE_CURAND_CALL(call) do { \ + curandStatus_t err = call; \ + if (CURAND_STATUS_SUCCESS != err) { \ + printf("CURAND ERROR (code = %d) at %s:%d\n", err, __FILE__, __LINE__); \ + hypre_assert(0); exit(1); \ + } } while(0) + +#define HYPRE_ROCRAND_CALL(call) do { \ + rocrand_status err = call; \ + if (ROCRAND_STATUS_SUCCESS != err) { \ + printf("ROCRAND ERROR (code = %d) at %s:%d\n", err, __FILE__, __LINE__); \ + hypre_assert(0); exit(1); \ + } } while(0) + +#define HYPRE_ONEMKL_CALL(call) \ + try \ + { \ + call; \ + } \ + catch (oneapi::mkl::exception const &ex) \ + { \ + hypre_printf("ONEMKL ERROR (code = %s) at %s:%d\n", ex.what(), \ + __FILE__, __LINE__); \ + assert(0); exit(1); \ + } + +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * macros for wrapping thrust/oneDPL calls for error reporting + * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + +/* RL: TODO Want macro HYPRE_THRUST_CALL to return value but I don't know how to do it right + * The following one works OK for now */ + +#if defined(HYPRE_USING_CUDA) +#define HYPRE_THRUST_CALL(func_name, ...) \ + thrust::func_name(HYPRE_THRUST_EXECUTION(hypre_HandleDeviceAllocator(hypre_handle())).on(hypre_HandleComputeStream(hypre_handle())), __VA_ARGS__); +#elif defined(HYPRE_USING_HIP) +#define HYPRE_THRUST_CALL(func_name, ...) \ + thrust::func_name(thrust::hip::par(hypre_HandleDeviceAllocator(hypre_handle())).on(hypre_HandleComputeStream(hypre_handle())), __VA_ARGS__); + +#elif defined(HYPRE_USING_SYCL) + +#define HYPRE_ONEDPL_CALL(func_name, ...) \ + func_name(oneapi::dpl::execution::make_device_policy( \ + *hypre_HandleComputeStream(hypre_handle())), __VA_ARGS__); + +#define HYPRE_ONEDPL_CPU_CALL(func_name, ...) \ + func_name(oneapi::dpl::execution::make_device_policy( \ + *hypre_DeviceDataStream(hypre_HandleDeviceData(hypre_handle()), HYPRE_MAX_NUM_STREAMS - 1)), __VA_ARGS__); + +#endif + +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * device info data structures + * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + +struct hypre_cub_CachingDeviceAllocator; +typedef struct hypre_cub_CachingDeviceAllocator hypre_cub_CachingDeviceAllocator; + +#if defined(HYPRE_USING_CUSOLVER) +typedef cusolverDnHandle_t vendorSolverHandle_t; +#elif defined(HYPRE_USING_ROCSOLVER) +typedef rocblas_handle vendorSolverHandle_t; +#endif + +struct hypre_DeviceData +{ +#if defined(HYPRE_USING_CURAND) + curandGenerator_t curand_generator; +#endif + +#if defined(HYPRE_USING_ROCRAND) + rocrand_generator curand_generator; +#endif + +#if defined(HYPRE_USING_CUBLAS) + cublasHandle_t cublas_handle; +#endif + +#if defined(HYPRE_USING_CUSPARSE) + cusparseHandle_t cusparse_handle; +#endif + +#if defined(HYPRE_USING_ROCSPARSE) + rocsparse_handle cusparse_handle; +#endif + +#if defined(HYPRE_USING_CUSOLVER) || defined(HYPRE_USING_ROCSOLVER) + vendorSolverHandle_t vendor_solver_handle; +#endif + + /* TODO (VPM): Change to HYPRE_USING_GPU_STREAMS*/ +#if defined(HYPRE_USING_CUDA_STREAMS) +#if defined(HYPRE_USING_CUDA) + cudaStream_t streams[HYPRE_MAX_NUM_STREAMS]; +#elif defined(HYPRE_USING_HIP) + hipStream_t streams[HYPRE_MAX_NUM_STREAMS]; +#elif defined(HYPRE_USING_SYCL) + sycl::queue* streams[HYPRE_MAX_NUM_STREAMS] = {NULL}; +#endif +#endif + +#if defined(HYPRE_USING_DEVICE_POOL) + hypre_uint cub_bin_growth; + hypre_uint cub_min_bin; + hypre_uint cub_max_bin; + size_t cub_max_cached_bytes; + hypre_cub_CachingDeviceAllocator *cub_dev_allocator; + hypre_cub_CachingDeviceAllocator *cub_uvm_allocator; +#endif + +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + hypre_device_allocator device_allocator; +#endif +#if defined(HYPRE_USING_SYCL) + sycl::device *device; + HYPRE_Int device_max_work_group_size; +#else + HYPRE_Int device; +#endif + hypre_int device_max_shmem_per_block[3]; + /* by default, hypre puts GPU computations in this stream + * Do not be confused with the default (null) stream */ + HYPRE_Int compute_stream_num; + /* work space for hypre's device reducer */ + void *reduce_buffer; + /* device spgemm options */ + HYPRE_Int spgemm_algorithm; + HYPRE_Int spgemm_binned; + HYPRE_Int spgemm_num_bin; + /* the highest bins for symbl [0] and numer [1] + * which are not necessary to be `spgemm_num_bin' due to shmem limit on GPUs */ + HYPRE_Int spgemm_highest_bin[2]; + /* for bin i: ([0][i], [2][i]) = (max #block to launch, block dimension) for symbl + * ([1][i], [3][i]) = (max #block to launch, block dimension) for numer */ + HYPRE_Int spgemm_block_num_dim[4][HYPRE_SPGEMM_MAX_NBIN + 1]; + HYPRE_Int spgemm_rownnz_estimate_method; + HYPRE_Int spgemm_rownnz_estimate_nsamples; + float spgemm_rownnz_estimate_mult_factor; + /* cusparse */ + HYPRE_Int spmv_use_vendor; + HYPRE_Int sptrans_use_vendor; + HYPRE_Int spgemm_use_vendor; + /* PMIS RNG */ + HYPRE_Int use_gpu_rand; +}; + +#define hypre_DeviceDataCubBinGrowth(data) ((data) -> cub_bin_growth) +#define hypre_DeviceDataCubMinBin(data) ((data) -> cub_min_bin) +#define hypre_DeviceDataCubMaxBin(data) ((data) -> cub_max_bin) +#define hypre_DeviceDataCubMaxCachedBytes(data) ((data) -> cub_max_cached_bytes) +#define hypre_DeviceDataCubDevAllocator(data) ((data) -> cub_dev_allocator) +#define hypre_DeviceDataCubUvmAllocator(data) ((data) -> cub_uvm_allocator) +#define hypre_DeviceDataDevice(data) ((data) -> device) +#define hypre_DeviceDataDeviceMaxWorkGroupSize(data) ((data) -> device_max_work_group_size) +#define hypre_DeviceDataDeviceMaxShmemPerBlock(data) ((data) -> device_max_shmem_per_block) +#define hypre_DeviceDataDeviceMaxShmemPerBlockInited(data) (((data) -> device_max_shmem_per_block)[2]) +#define hypre_DeviceDataComputeStreamNum(data) ((data) -> compute_stream_num) +#define hypre_DeviceDataReduceBuffer(data) ((data) -> reduce_buffer) +#define hypre_DeviceDataSpgemmUseVendor(data) ((data) -> spgemm_use_vendor) +#define hypre_DeviceDataSpMVUseVendor(data) ((data) -> spmv_use_vendor) +#define hypre_DeviceDataSpTransUseVendor(data) ((data) -> sptrans_use_vendor) +#define hypre_DeviceDataSpgemmAlgorithm(data) ((data) -> spgemm_algorithm) +#define hypre_DeviceDataSpgemmBinned(data) ((data) -> spgemm_binned) +#define hypre_DeviceDataSpgemmNumBin(data) ((data) -> spgemm_num_bin) +#define hypre_DeviceDataSpgemmHighestBin(data) ((data) -> spgemm_highest_bin) +#define hypre_DeviceDataSpgemmBlockNumDim(data) ((data) -> spgemm_block_num_dim) +#define hypre_DeviceDataSpgemmRownnzEstimateMethod(data) ((data) -> spgemm_rownnz_estimate_method) +#define hypre_DeviceDataSpgemmRownnzEstimateNsamples(data) ((data) -> spgemm_rownnz_estimate_nsamples) +#define hypre_DeviceDataSpgemmRownnzEstimateMultFactor(data) ((data) -> spgemm_rownnz_estimate_mult_factor) +#define hypre_DeviceDataDeviceAllocator(data) ((data) -> device_allocator) +#define hypre_DeviceDataUseGpuRand(data) ((data) -> use_gpu_rand) + +hypre_DeviceData* hypre_DeviceDataCreate(); +void hypre_DeviceDataDestroy(hypre_DeviceData* data); + +#if defined(HYPRE_USING_CURAND) +curandGenerator_t hypre_DeviceDataCurandGenerator(hypre_DeviceData *data); +#endif + +#if defined(HYPRE_USING_ROCRAND) +rocrand_generator hypre_DeviceDataCurandGenerator(hypre_DeviceData *data); +#endif + +#if defined(HYPRE_USING_CUBLAS) +cublasHandle_t hypre_DeviceDataCublasHandle(hypre_DeviceData *data); +#endif + +#if defined(HYPRE_USING_CUSPARSE) +cusparseHandle_t hypre_DeviceDataCusparseHandle(hypre_DeviceData *data); +#endif + +#if defined(HYPRE_USING_ROCSPARSE) +rocsparse_handle hypre_DeviceDataCusparseHandle(hypre_DeviceData *data); +#endif + +#if defined(HYPRE_USING_CUSOLVER) || defined(HYPRE_USING_ROCSOLVER) +vendorSolverHandle_t hypre_DeviceDataVendorSolverHandle(hypre_DeviceData *data); +#endif + +/* TODO (VPM): Create a deviceStream_t to encapsulate all stream types below */ +#if defined(HYPRE_USING_CUDA) +cudaStream_t hypre_DeviceDataStream(hypre_DeviceData *data, HYPRE_Int i); +cudaStream_t hypre_DeviceDataComputeStream(hypre_DeviceData *data); +#elif defined(HYPRE_USING_HIP) +hipStream_t hypre_DeviceDataStream(hypre_DeviceData *data, HYPRE_Int i); +hipStream_t hypre_DeviceDataComputeStream(hypre_DeviceData *data); +#elif defined(HYPRE_USING_SYCL) +sycl::queue* hypre_DeviceDataStream(hypre_DeviceData *data, HYPRE_Int i); +sycl::queue* hypre_DeviceDataComputeStream(hypre_DeviceData *data); +#endif + +/* Data structure and accessor routines for Sparse Triangular Matrices */ +struct hypre_CsrsvData +{ +#if defined(HYPRE_USING_CUSPARSE) + hypre_cusparseSpSVDescr info_L; + hypre_cusparseSpSVDescr info_U; + cusparseSolvePolicy_t analysis_policy; + cusparseSolvePolicy_t solve_policy; +#elif defined(HYPRE_USING_ROCSPARSE) + rocsparse_mat_info info_L; + rocsparse_mat_info info_U; + rocsparse_analysis_policy analysis_policy; + rocsparse_solve_policy solve_policy; +#endif + +#if defined(HYPRE_USING_CUSPARSE) && (CUSPARSE_VERSION >= CUSPARSE_SPSV_VERSION) + size_t buffer_size_L; + size_t buffer_size_U; + char *buffer_L; + char *buffer_U; +#else + hypre_int buffer_size; + char *buffer; +#endif + + /* Temporary array to save matrix values with modified diagonal */ + HYPRE_Complex *mat_data; + + /* Flags for checking whether the analysis phase has been executed or not */ + HYPRE_Int analyzed_L; + HYPRE_Int analyzed_U; +}; + +#define hypre_CsrsvDataInfoL(data) ((data) -> info_L) +#define hypre_CsrsvDataInfoU(data) ((data) -> info_U) +#define hypre_CsrsvDataAnalyzedL(data) ((data) -> analyzed_L) +#define hypre_CsrsvDataAnalyzedU(data) ((data) -> analyzed_U) +#define hypre_CsrsvDataSolvePolicy(data) ((data) -> solve_policy) +#define hypre_CsrsvDataAnalysisPolicy(data) ((data) -> analysis_policy) +#if defined(HYPRE_USING_CUSPARSE) && (CUSPARSE_VERSION >= CUSPARSE_SPSV_VERSION) +#define hypre_CsrsvDataBufferSizeL(data) ((data) -> buffer_size_L) +#define hypre_CsrsvDataBufferSizeU(data) ((data) -> buffer_size_U) +#define hypre_CsrsvDataBufferL(data) ((data) -> buffer_L) +#define hypre_CsrsvDataBufferU(data) ((data) -> buffer_U) +#else +#define hypre_CsrsvDataBufferSize(data) ((data) -> buffer_size) +#define hypre_CsrsvDataBuffer(data) ((data) -> buffer) +#endif +#define hypre_CsrsvDataMatData(data) ((data) -> mat_data) + +struct hypre_GpuMatData +{ +#if defined(HYPRE_USING_CUSPARSE) + cusparseMatDescr_t mat_descr; + char *spmv_buffer; + +#elif defined(HYPRE_USING_ROCSPARSE) + rocsparse_mat_descr mat_descr; + rocsparse_mat_info mat_info; + +#elif defined(HYPRE_USING_ONEMKLSPARSE) + oneapi::mkl::sparse::matrix_handle_t mat_handle; +#endif +}; + +#define hypre_GpuMatDataMatDescr(data) ((data) -> mat_descr) +#define hypre_GpuMatDataMatInfo(data) ((data) -> mat_info) +#define hypre_GpuMatDataMatHandle(data) ((data) -> mat_handle) +#define hypre_GpuMatDataSpMVBuffer(data) ((data) -> spmv_buffer) + +#endif /* if defined(HYPRE_USING_GPU) */ + +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * generic device functions (cuda/hip/sycl) + * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + +#if defined(HYPRE_USING_GPU) +template +static __device__ __forceinline__ +T read_only_load( const T *ptr ) +{ +#if defined(__CUDA_ARCH__) && __CUDA_ARCH__ >= 350 + return __ldg( ptr ); +#else + return *ptr; +#endif +} + +static __device__ __forceinline__ +hypre_int next_power_of_2(hypre_int n) +{ + if (n <= 0) + { + return 0; + } + + /* if n is power of 2, return itself */ + if ( (n & (n - 1)) == 0 ) + { + return n; + } + + n |= (n >> 1); + n |= (n >> 2); + n |= (n >> 4); + n |= (n >> 8); + n |= (n >> 16); + n ^= (n >> 1); + n = (n << 1); + + return n; +} + +/* Flip n-th bit of bitmask (0 becomes 1. 1 becomes 0) */ +static __device__ __forceinline__ +hypre_mask hypre_mask_flip_at(hypre_mask bitmask, hypre_int n) +{ + return bitmask ^ (hypre_mask_one << n); +} + +#endif // defined(HYPRE_USING_GPU) + +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * cuda/hip functions + * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + +/* return the number of threads in block */ +template +static __device__ __forceinline__ +hypre_int hypre_gpu_get_num_threads(hypre_DeviceItem &item) +{ + switch (dim) + { + case 1: + return (blockDim.x); + case 2: + return (blockDim.x * blockDim.y); + case 3: + return (blockDim.x * blockDim.y * blockDim.z); + } + + return -1; +} + +/* return the flattened thread id in block */ +template +static __device__ __forceinline__ +hypre_int hypre_gpu_get_thread_id(hypre_DeviceItem &item) +{ + switch (dim) + { + case 1: + return (threadIdx.x); + case 2: + return (threadIdx.y * blockDim.x + threadIdx.x); + case 3: + return (threadIdx.z * blockDim.x * blockDim.y + threadIdx.y * blockDim.x + + threadIdx.x); + } + + return -1; +} + +/* return the number of warps in block */ +template +static __device__ __forceinline__ +hypre_int hypre_gpu_get_num_warps(hypre_DeviceItem &item) +{ + return hypre_gpu_get_num_threads(item) >> HYPRE_WARP_BITSHIFT; +} + +/* return the warp id in block */ +template +static __device__ __forceinline__ +hypre_int hypre_gpu_get_warp_id(hypre_DeviceItem &item) +{ + return hypre_gpu_get_thread_id(item) >> HYPRE_WARP_BITSHIFT; +} + +/* return the thread lane id in warp */ +template +static __device__ __forceinline__ +hypre_int hypre_gpu_get_lane_id(hypre_DeviceItem &item) +{ + return hypre_gpu_get_thread_id(item) & (HYPRE_WARP_SIZE - 1); +} + +/* return the num of blocks in grid */ +template +static __device__ __forceinline__ +hypre_int hypre_gpu_get_num_blocks() +{ + switch (dim) + { + case 1: + return (gridDim.x); + case 2: + return (gridDim.x * gridDim.y); + case 3: + return (gridDim.x * gridDim.y * gridDim.z); + } + + return -1; +} + +/* return the flattened block id in grid */ +template +static __device__ __forceinline__ +hypre_int hypre_gpu_get_block_id(hypre_DeviceItem &item) +{ + switch (dim) + { + case 1: + return (blockIdx.x); + case 2: + return (blockIdx.y * gridDim.x + blockIdx.x); + case 3: + return (blockIdx.z * gridDim.x * gridDim.y + blockIdx.y * gridDim.x + + blockIdx.x); + } + + return -1; +} + +/* return the number of threads in grid */ +template +static __device__ __forceinline__ +hypre_int hypre_gpu_get_grid_num_threads(hypre_DeviceItem &item) +{ + return hypre_gpu_get_num_blocks() * hypre_gpu_get_num_threads(item); +} + +/* return the flattened thread id in grid */ +template +static __device__ __forceinline__ +hypre_int hypre_gpu_get_grid_thread_id(hypre_DeviceItem &item) +{ + return hypre_gpu_get_block_id(item) * hypre_gpu_get_num_threads(item) + + hypre_gpu_get_thread_id(item); +} + +/* return the number of warps in grid */ +template +static __device__ __forceinline__ +hypre_int hypre_gpu_get_grid_num_warps(hypre_DeviceItem &item) +{ + return hypre_gpu_get_num_blocks() * hypre_gpu_get_num_warps(item); +} + +/* return the flattened warp id in grid */ +template +static __device__ __forceinline__ +hypre_int hypre_gpu_get_grid_warp_id(hypre_DeviceItem &item) +{ + return hypre_gpu_get_block_id(item) * hypre_gpu_get_num_warps(item) + + hypre_gpu_get_warp_id(item); +} + +#if defined(__CUDA_ARCH__) && __CUDA_ARCH__ < 600 +static __device__ __forceinline__ +hypre_double atomicAdd(hypre_double* address, hypre_double val) +{ + hypre_ulonglongint* address_as_ull = (hypre_ulonglongint*) address; + hypre_ulonglongint old = *address_as_ull, assumed; + + do + { + assumed = old; + old = atomicCAS(address_as_ull, assumed, + __double_as_longlong(val + + __longlong_as_double(assumed))); + + // Note: uses integer comparison to avoid hang in case of NaN (since NaN != NaN) + } + while (assumed != old); + + return __longlong_as_double(old); +} +#endif + +// There are no *_sync functions in HIP +#if defined(HYPRE_USING_HIP) || (CUDA_VERSION < 9000) + +template +static __device__ __forceinline__ +T __shfl_sync(hypre_mask mask, T val, hypre_int src_line, hypre_int width = HYPRE_WARP_SIZE) +{ + return __shfl(val, src_line, width); +} + +template +static __device__ __forceinline__ +T __shfl_up_sync(hypre_mask mask, T val, hypre_uint delta, hypre_int width = HYPRE_WARP_SIZE) +{ + return __shfl_up(val, delta, width); +} + +template +static __device__ __forceinline__ +T __shfl_down_sync(hypre_mask mask, T val, hypre_uint delta, hypre_int width = HYPRE_WARP_SIZE) +{ + return __shfl_down(val, delta, width); +} + +template +static __device__ __forceinline__ +T __shfl_xor_sync(hypre_mask mask, T val, hypre_int lanemask, hypre_int width = HYPRE_WARP_SIZE) +{ + return __shfl_xor(val, lanemask, width); +} + +static __device__ __forceinline__ +void __syncwarp() +{ +} + +#endif // #if defined(HYPRE_USING_HIP) || (CUDA_VERSION < 9000) + +static __device__ __forceinline__ +hypre_mask hypre_ballot_sync(hypre_DeviceItem &item, hypre_mask mask, hypre_int predicate) +{ +#if defined(HYPRE_USING_CUDA) + return __ballot_sync(mask, predicate); +#else + return __ballot(predicate); +#endif +} + +static __device__ __forceinline__ +HYPRE_Int hypre_popc(hypre_mask mask) +{ +#if defined(HYPRE_USING_CUDA) + return (HYPRE_Int) __popc(mask); +#else + return (HYPRE_Int) __popcll(mask); +#endif +} + +static __device__ __forceinline__ +HYPRE_Int hypre_ffs(hypre_mask mask) +{ +#if defined(HYPRE_USING_CUDA) + return (HYPRE_Int) __ffs(mask); +#else + return (HYPRE_Int) __ffsll(mask); +#endif +} + +#if defined(HYPRE_USING_HIP) +static __device__ __forceinline__ +hypre_int __any_sync(unsigned mask, hypre_int predicate) +{ + return __any(predicate); +} +#endif + +/* sync the thread block */ +static __device__ __forceinline__ +void block_sync(hypre_DeviceItem &item) +{ + __syncthreads(); +} + +/* sync the warp */ +static __device__ __forceinline__ +void warp_sync(hypre_DeviceItem &item) +{ + __syncwarp(); +} + +/* exclusive prefix scan */ +template +static __device__ __forceinline__ +T warp_prefix_sum(hypre_DeviceItem &item, hypre_int lane_id, T in, T &all_sum) +{ +#pragma unroll + for (hypre_int d = 2; d <= HYPRE_WARP_SIZE; d <<= 1) + { + T t = __shfl_up_sync(HYPRE_WARP_FULL_MASK, in, d >> 1); + if ( (lane_id & (d - 1)) == (d - 1) ) + { + in += t; + } + } + + all_sum = __shfl_sync(HYPRE_WARP_FULL_MASK, in, HYPRE_WARP_SIZE - 1); + + if (lane_id == HYPRE_WARP_SIZE - 1) + { + in = 0; + } + +#pragma unroll + for (hypre_int d = HYPRE_WARP_SIZE >> 1; d > 0; d >>= 1) + { + T t = __shfl_xor_sync(HYPRE_WARP_FULL_MASK, in, d); + + if ( (lane_id & (d - 1)) == (d - 1)) + { + if ( (lane_id & ((d << 1) - 1)) == ((d << 1) - 1) ) + { + in += t; + } + else + { + in = t; + } + } + } + return in; +} + +static __device__ __forceinline__ +hypre_int warp_any_sync(hypre_DeviceItem &item, hypre_mask mask, hypre_int predicate) +{ + return __any_sync(mask, predicate); +} + +template +static __device__ __forceinline__ +T warp_shuffle_sync(hypre_DeviceItem &item, hypre_mask mask, T val, hypre_int src_line, + hypre_int width = HYPRE_WARP_SIZE) +{ + return __shfl_sync(mask, val, src_line, width); +} + +template +static __device__ __forceinline__ +T warp_shuffle_up_sync(hypre_DeviceItem &item, hypre_mask mask, T val, hypre_uint delta, + hypre_int width = HYPRE_WARP_SIZE) +{ + return __shfl_up_sync(mask, val, delta, width); +} + +template +static __device__ __forceinline__ +T warp_shuffle_down_sync(hypre_DeviceItem &item, hypre_mask mask, T val, hypre_uint delta, + hypre_int width = HYPRE_WARP_SIZE) +{ + return __shfl_down_sync(mask, val, delta, width); +} + +template +static __device__ __forceinline__ +T warp_shuffle_xor_sync(hypre_DeviceItem &item, hypre_mask mask, T val, hypre_int lane_mask, + hypre_int width = HYPRE_WARP_SIZE) +{ + return __shfl_xor_sync(mask, val, lane_mask, width); +} + +template +static __device__ __forceinline__ +T warp_reduce_sum(hypre_DeviceItem &item, T in) +{ +#pragma unroll + for (hypre_int d = HYPRE_WARP_SIZE >> 1; d > 0; d >>= 1) + { + in += __shfl_down_sync(HYPRE_WARP_FULL_MASK, in, d); + } + return in; +} + +template +static __device__ __forceinline__ +T warp_allreduce_sum(hypre_DeviceItem &item, T in) +{ +#pragma unroll + for (hypre_int d = HYPRE_WARP_SIZE >> 1; d > 0; d >>= 1) + { + in += __shfl_xor_sync(HYPRE_WARP_FULL_MASK, in, d); + } + return in; +} + +template +static __device__ __forceinline__ +T warp_reduce_max(hypre_DeviceItem &item, T in) +{ +#pragma unroll + for (hypre_int d = HYPRE_WARP_SIZE >> 1; d > 0; d >>= 1) + { + in = max(in, __shfl_down_sync(HYPRE_WARP_FULL_MASK, in, d)); + } + return in; +} + +template +static __device__ __forceinline__ +T warp_allreduce_max(hypre_DeviceItem &item, T in) +{ +#pragma unroll + for (hypre_int d = HYPRE_WARP_SIZE >> 1; d > 0; d >>= 1) + { + in = max(in, __shfl_xor_sync(HYPRE_WARP_FULL_MASK, in, d)); + } + return in; +} + +template +static __device__ __forceinline__ +T warp_reduce_min(hypre_DeviceItem &item, T in) +{ +#pragma unroll + for (hypre_int d = HYPRE_WARP_SIZE >> 1; d > 0; d >>= 1) + { + in = min(in, __shfl_down_sync(HYPRE_WARP_FULL_MASK, in, d)); + } + return in; +} + +template +static __device__ __forceinline__ +T warp_allreduce_min(hypre_DeviceItem &item, T in) +{ +#pragma unroll + for (hypre_int d = HYPRE_WARP_SIZE >> 1; d > 0; d >>= 1) + { + in = min(in, __shfl_xor_sync(HYPRE_WARP_FULL_MASK, in, d)); + } + return in; +} + +template +#if (defined(THRUST_VERSION) && THRUST_VERSION < THRUST_VERSION_NOTFN) +struct type_cast : public thrust::unary_function +#else +struct type_cast +#endif +{ + __host__ __device__ T2 operator()(const T1 &x) const + { + return (T2) x; + } +}; + +template +#if (defined(THRUST_VERSION) && THRUST_VERSION < THRUST_VERSION_NOTFN) +struct absolute_value : public thrust::unary_function +#else +struct absolute_value +#endif +{ + __host__ __device__ T operator()(const T &x) const + { + return x < T(0) ? -x : x; + } +}; + +template +struct TupleComp2 +{ + typedef thrust::tuple Tuple; + + __host__ __device__ bool operator()(const Tuple& t1, const Tuple& t2) + { + if (thrust::get<0>(t1) < thrust::get<0>(t2)) + { + return true; + } + if (thrust::get<0>(t1) > thrust::get<0>(t2)) + { + return false; + } + return hypre_abs(thrust::get<1>(t1)) > hypre_abs(thrust::get<1>(t2)); + } +}; + +template +struct TupleComp3 +{ + typedef thrust::tuple Tuple; + + __host__ __device__ bool operator()(const Tuple& t1, const Tuple& t2) + { + if (thrust::get<0>(t1) < thrust::get<0>(t2)) + { + return true; + } + if (thrust::get<0>(t1) > thrust::get<0>(t2)) + { + return false; + } + if (thrust::get<0>(t2) == thrust::get<1>(t2)) + { + return false; + } + return thrust::get<0>(t1) == thrust::get<1>(t1) || thrust::get<1>(t1) < thrust::get<1>(t2); + } +}; + +template +#if (defined(THRUST_VERSION) && THRUST_VERSION < THRUST_VERSION_NOTFN) +struct is_negative : public thrust::unary_function +#else +struct is_negative +#endif +{ + __host__ __device__ bool operator()(const T &x) + { + return (x < 0); + } +}; + +template +#if (defined(THRUST_VERSION) && THRUST_VERSION < THRUST_VERSION_NOTFN) +struct is_positive : public thrust::unary_function +#else +struct is_positive +#endif +{ + __host__ __device__ bool operator()(const T &x) + { + return (x > 0); + } +}; + +template +#if (defined(THRUST_VERSION) && THRUST_VERSION < THRUST_VERSION_NOTFN) +struct is_nonnegative : public thrust::unary_function +#else +struct is_nonnegative +#endif +{ + __host__ __device__ bool operator()(const T &x) + { + return (x >= 0); + } +}; + +template +#if (defined(THRUST_VERSION) && THRUST_VERSION < THRUST_VERSION_NOTFN) +struct in_range : public thrust::unary_function +#else +struct in_range +#endif +{ + T low, up; + + in_range(T low_, T up_) { low = low_; up = up_; } + + __host__ __device__ bool operator()(const T &x) + { + return (x >= low && x <= up); + } +}; + +template +#if (defined(THRUST_VERSION) && THRUST_VERSION < THRUST_VERSION_NOTFN) +struct out_of_range : public thrust::unary_function +#else +struct out_of_range +#endif +{ + T low, up; + + out_of_range(T low_, T up_) { low = low_; up = up_; } + + __host__ __device__ bool operator()(const T &x) + { + return (x < low || x > up); + } +}; + +template +#if (defined(THRUST_VERSION) && THRUST_VERSION < THRUST_VERSION_NOTFN) +struct less_than : public thrust::unary_function +#else +struct less_than +#endif +{ + T val; + + less_than(T val_) { val = val_; } + + __host__ __device__ bool operator()(const T &x) + { + return (x < val); + } +}; + +template +#if (defined(THRUST_VERSION) && THRUST_VERSION < THRUST_VERSION_NOTFN) +struct modulo : public thrust::unary_function +#else +struct modulo +#endif +{ + T val; + + modulo(T val_) { val = val_; } + + __host__ __device__ T operator()(const T &x) + { + return (x % val); + } +}; + +template +#if (defined(THRUST_VERSION) && THRUST_VERSION < THRUST_VERSION_NOTFN) +struct equal : public thrust::unary_function +#else +struct equal +#endif +{ + T val; + + equal(T val_) { val = val_; } + + __host__ __device__ bool operator()(const T &x) + { + return (x == val); + } +}; + +struct print_functor +{ + __host__ __device__ void operator()(HYPRE_Real val) + { + printf("%f\n", val); + } +}; + +#endif // defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * sycl functions + * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + +#if defined(HYPRE_USING_SYCL) + +/* return the number of threads in block */ +template +static __device__ __forceinline__ +hypre_int hypre_gpu_get_num_threads(hypre_DeviceItem &item) +{ + return static_cast(item.get_local_range().size()); +} + +/* return the flattened thread id in block */ +template +static __device__ __forceinline__ +hypre_int hypre_gpu_get_thread_id(hypre_DeviceItem &item) +{ + return static_cast(item.get_local_linear_id()); +} + +/* return the number of warps in block */ +template +static __device__ __forceinline__ +hypre_int hypre_gpu_get_num_warps(hypre_DeviceItem &item) +{ + return hypre_gpu_get_num_threads(item) >> HYPRE_WARP_BITSHIFT; +} + +/* return the warp id in block */ +template +static __device__ __forceinline__ +hypre_int hypre_gpu_get_warp_id(hypre_DeviceItem &item) +{ + return hypre_gpu_get_thread_id(item) >> HYPRE_WARP_BITSHIFT; +} + +/* return the thread lane id in warp */ +template +static __device__ __forceinline__ +hypre_int hypre_gpu_get_lane_id(hypre_DeviceItem &item) +{ + return static_cast(item.get_sub_group().get_local_linear_id()); +} + +/* return the num of blocks in grid */ +template +static __device__ __forceinline__ +hypre_int hypre_gpu_get_num_blocks(hypre_DeviceItem &item) +{ + return static_cast(item.get_group_range().size()); +} + +/* return the flattened block id in grid */ +template +static __device__ __forceinline__ +hypre_int hypre_gpu_get_block_id(hypre_DeviceItem &item) +{ + return item.get_group_linear_id(); +} + +/* return the number of threads in grid */ +template +static __device__ __forceinline__ +hypre_int hypre_gpu_get_grid_num_threads(hypre_DeviceItem &item) +{ + return hypre_gpu_get_num_blocks(item) * hypre_gpu_get_num_threads(item); +} + +/* return the flattened thread id in grid */ +template +static __device__ __forceinline__ +hypre_int hypre_gpu_get_grid_thread_id(hypre_DeviceItem &item) +{ + return hypre_gpu_get_block_id(item) * hypre_gpu_get_num_threads(item) + + hypre_gpu_get_thread_id(item); +} + +/* return the number of warps in grid */ +template +static __device__ __forceinline__ +hypre_int hypre_gpu_get_grid_num_warps(hypre_DeviceItem &item) +{ + return hypre_gpu_get_num_blocks(item) * hypre_gpu_get_num_warps(item); +} + +/* return the flattened warp id in nd_range */ +template +static __device__ __forceinline__ +hypre_int hypre_gpu_get_grid_warp_id(hypre_DeviceItem &item) +{ + return hypre_gpu_get_block_id(item) * hypre_gpu_get_num_warps(item) + + hypre_gpu_get_warp_id(item); +} + +/* sync the thread block */ +static __device__ __forceinline__ +void block_sync(hypre_DeviceItem &item) +{ + sycl::group_barrier(item.get_group()); +} + +/* sync the warp */ +static __device__ __forceinline__ +void warp_sync(hypre_DeviceItem &item) +{ + sycl::group_barrier(item.get_sub_group()); +} + +/* exclusive prefix scan */ +template +static __device__ __forceinline__ +T warp_prefix_sum(hypre_DeviceItem &item, hypre_int lane_id, T in, T &all_sum) +{ +#pragma unroll + for (hypre_int d = 2; d <= HYPRE_WARP_SIZE; d <<= 1) + { + T t = sycl::shift_group_right(item.get_sub_group(), in, d >> 1); + if ( (lane_id & (d - 1)) == (d - 1) ) + { + in += t; + } + } + + all_sum = sycl::group_broadcast(item.get_sub_group(), in, HYPRE_WARP_SIZE - 1); + + if (lane_id == HYPRE_WARP_SIZE - 1) + { + in = 0; + } + +#pragma unroll + for (hypre_int d = HYPRE_WARP_SIZE >> 1; d > 0; d >>= 1) + { + T t = sycl::permute_group_by_xor(item.get_sub_group(), in, d); + + if ( (lane_id & (d - 1)) == (d - 1)) + { + if ( (lane_id & ((d << 1) - 1)) == ((d << 1) - 1) ) + { + in += t; + } + else + { + in = t; + } + } + } + return in; +} + +static __device__ __forceinline__ +hypre_mask hypre_ballot_sync(hypre_DeviceItem &item, hypre_mask mask, hypre_int predicate) +{ + return sycl::reduce_over_group( + item.get_sub_group(), + (mask & (0x1 << item.get_sub_group().get_local_linear_id())) && + predicate ? (0x1 << item.get_sub_group().get_local_linear_id()) : 0, + sycl::ext::oneapi::plus<>()); +} + +static __device__ __forceinline__ +HYPRE_Int hypre_popc(hypre_mask mask) +{ + return (HYPRE_Int) sycl::popcount(mask); +} + +static __device__ __forceinline__ +HYPRE_Int hypre_ffs(hypre_mask mask) +{ + return (HYPRE_Int)dpct::ffs(mask); +} + +static __device__ __forceinline__ +hypre_int warp_any_sync(hypre_DeviceItem &item, hypre_mask mask, hypre_int predicate) +{ + return sycl::any_of_group(item.get_sub_group(), predicate); +} + +template +static __device__ __forceinline__ +T warp_shuffle_sync(hypre_DeviceItem &item, hypre_mask mask, T val, hypre_int src_line) +{ + return sycl::group_broadcast(item.get_sub_group(), val, src_line); +} + +template +static __device__ __forceinline__ +T warp_shuffle_sync(hypre_DeviceItem &item, hypre_mask mask, T val, hypre_int src_line, + hypre_int width) +{ + hypre_int lane_id = hypre_gpu_get_lane_id<1>(item); + hypre_int group_start = (lane_id / width) * width; + hypre_int src_in_warp = group_start + (src_line % width); + return sycl::select_from_group(item.get_sub_group(), val, src_in_warp); +} + +template +static __device__ __forceinline__ +T warp_shuffle_up_sync(hypre_DeviceItem &item, hypre_mask mask, T val, hypre_uint delta) +{ + return sycl::shift_group_right(item.get_sub_group(), val, delta); +} + +template +static __device__ __forceinline__ +T warp_shuffle_up_sync(hypre_DeviceItem &item, hypre_mask mask, T val, hypre_uint delta, + hypre_int width) +{ + hypre_int lane_id = hypre_gpu_get_lane_id<1>(item); + hypre_int group_start = (lane_id / width) * width; + hypre_int src_in_warp = lane_id - delta >= group_start ? lane_id - delta : lane_id; + return sycl::select_from_group(item.get_sub_group(), val, src_in_warp); +} + +template +static __device__ __forceinline__ +T warp_shuffle_down_sync(hypre_DeviceItem &item, hypre_mask mask, T val, hypre_uint delta) +{ + return sycl::shift_group_left(item.get_sub_group(), val, delta); +} + +template +static __device__ __forceinline__ +T warp_shuffle_down_sync(hypre_DeviceItem &item, hypre_mask mask, T val, hypre_uint delta, + hypre_int width) +{ + hypre_int lane_id = hypre_gpu_get_lane_id<1>(item); + hypre_int group_end = ((lane_id / width) + 1) * width - 1; + hypre_int src_in_warp = lane_id + delta <= group_end ? lane_id + delta : lane_id; + return sycl::select_from_group(item.get_sub_group(), val, src_in_warp); +} + +template +static __device__ __forceinline__ +T warp_shuffle_xor_sync(hypre_DeviceItem &item, hypre_mask mask, T val, hypre_int lane_mask) +{ + return sycl::permute_group_by_xor(item.get_sub_group(), val, lane_mask); +} + +template +static __device__ __forceinline__ +T warp_shuffle_xor_sync(hypre_DeviceItem &item, hypre_mask mask, T val, hypre_int lane_mask, + hypre_int width) +{ + hypre_int lane_id = hypre_gpu_get_lane_id<1>(item); + hypre_int group_end = ((lane_id / width) + 1) * width - 1; + hypre_int src_in_warp = lane_id ^ lane_mask; + src_in_warp = src_in_warp > group_end ? lane_id : src_in_warp; + return sycl::select_from_group(item.get_sub_group(), val, src_in_warp); +} + +template +static __forceinline__ +T warp_reduce_sum(hypre_DeviceItem &item, T in) +{ + for (hypre_int d = HYPRE_WARP_SIZE >> 1; d > 0; d >>= 1) + { + in += sycl::shift_group_left(item.get_sub_group(), in, d); + } + return in; +} + +template +static __forceinline__ +T warp_allreduce_sum(hypre_DeviceItem &item, T in) +{ + for (hypre_int d = HYPRE_WARP_SIZE >> 1; d > 0; d >>= 1) + { + in += sycl::permute_group_by_xor(item.get_sub_group(), in, d); + } + return in; +} + +template +static __forceinline__ +T warp_reduce_max(hypre_DeviceItem &item, T in) +{ + for (hypre_int d = HYPRE_WARP_SIZE >> 1; d > 0; d >>= 1) + { + in = std::max(in, sycl::shift_group_left(item.get_sub_group(), in, d)); + } + return in; +} + +template +static __forceinline__ +T warp_allreduce_max(hypre_DeviceItem &item, T in) +{ + for (hypre_int d = HYPRE_WARP_SIZE >> 1; d > 0; d >>= 1) + { + in = std::max(in, sycl::permute_group_by_xor(item.get_sub_group(), in, d)); + } + return in; +} + +template +static __forceinline__ +T warp_reduce_min(hypre_DeviceItem &item, T in) +{ + for (hypre_int d = HYPRE_WARP_SIZE >> 1; d > 0; d >>= 1) + { + in = std::min(in, sycl::shift_group_left(item.get_sub_group(), in, d)); + } + return in; +} + +template +static __forceinline__ +T warp_allreduce_min(hypre_DeviceItem &item, T in) +{ + for (hypre_int d = HYPRE_WARP_SIZE >> 1; d > 0; d >>= 1) + { + in = std::min(in, sycl::permute_group_by_xor(item.get_sub_group(), in, d)); + } + return in; +} + +template +struct is_negative +{ + is_negative() {} + + constexpr bool operator()(const T &x = T()) const { return (x < 0); } +}; + +template +struct is_positive +{ + is_positive() {} + + constexpr bool operator()(const T &x = T()) const { return (x > 0); } +}; + +template +struct is_nonnegative +{ + is_nonnegative() {} + + constexpr bool operator()(const T &x = T()) const { return (x >= 0); } +}; + +template +struct in_range +{ + T low, high; + in_range(T low_ = T(), T high_ = T()) { low = low_; high = high_; } + + constexpr bool operator()(const T &x) const { return (x >= low && x <= high); } +}; + +template +struct out_of_range +{ + T low, high; + out_of_range(T low_ = T(), T high_ = T()) { low = low_; high = high_; } + + constexpr bool operator()(const T &x) const { return (x < low || x > high); } +}; + +template +struct less_than +{ + T val; + less_than(T val_ = T()) { val = val_; } + + constexpr bool operator()(const T &x) const { return (x < val); } +}; + +template +struct modulo +{ + T val; + modulo(T val_ = T()) { val = val_; } + + constexpr T operator()(const T &x) const { return (x % val); } +}; + +template +struct equal +{ + T val; + equal(T val_ = T()) { val = val_; } + + constexpr bool operator()(const T &x) const { return (x == val); } +}; + +template +struct type_cast +{ + constexpr T2 operator()(const T1 &x = T1()) const { return (T2) x; } +}; + +template +struct absolute_value +{ + constexpr T operator()(const T &x) const { return x < T(0) ? -x : x; } +}; + +template +struct TupleComp2 +{ + typedef std::tuple Tuple; + bool operator()(const Tuple& t1, const Tuple& t2) + { + if (std::get<0>(t1) < std::get<0>(t2)) + { + return true; + } + if (std::get<0>(t1) > std::get<0>(t2)) + { + return false; + } + return hypre_abs(std::get<1>(t1)) > hypre_abs(std::get<1>(t2)); + } +}; + +template +struct TupleComp3 +{ + typedef std::tuple Tuple; + bool operator()(const Tuple& t1, const Tuple& t2) + { + if (std::get<0>(t1) < std::get<0>(t2)) + { + return true; + } + if (std::get<0>(t1) > std::get<0>(t2)) + { + return false; + } + if (std::get<0>(t2) == std::get<1>(t2)) + { + return false; + } + return std::get<0>(t1) == std::get<1>(t1) || std::get<1>(t1) < std::get<1>(t2); + } +}; + +#endif // #if defined(HYPRE_USING_SYCL) + +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * end of functions defined here + * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + +/* device_utils.c */ +#if defined(HYPRE_USING_GPU) +dim3 hypre_GetDefaultDeviceBlockDimension(); + +dim3 hypre_GetDefaultDeviceGridDimension( HYPRE_Int n, const char *granularity, dim3 bDim ); + +dim3 hypre_dim3(HYPRE_Int x); +dim3 hypre_dim3(HYPRE_Int x, HYPRE_Int y); +dim3 hypre_dim3(HYPRE_Int x, HYPRE_Int y, HYPRE_Int z); + +template +HYPRE_Int hypreDevice_StableSortByTupleKey(HYPRE_Int N, T1 *keys1, T2 *keys2, + T3 *vals, HYPRE_Int opt); + +template +HYPRE_Int hypreDevice_StableSortTupleByTupleKey(HYPRE_Int N, T1 *keys1, T2 *keys2, + T3 *vals1, T4 *vals2, HYPRE_Int opt); + +template +HYPRE_Int hypreDevice_ReduceByTupleKey(HYPRE_Int N, T1 *keys1_in, T2 *keys2_in, + T3 *vals_in, T1 *keys1_out, T2 *keys2_out, + T3 *vals_out); + +template +HYPRE_Int hypreDevice_ScatterConstant(T *x, HYPRE_Int n, HYPRE_Int *map, T v); + +HYPRE_Int hypreDevice_GenScatterAdd(HYPRE_Real *x, HYPRE_Int ny, HYPRE_Int *map, + HYPRE_Real *y, char *work); + +template +HYPRE_Int hypreDevice_CsrRowPtrsToIndicesWithRowNum(HYPRE_Int nrows, HYPRE_Int nnz, + HYPRE_Int *d_row_ptr, T *d_row_num, T *d_row_ind); + +#endif + +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + +#if defined(HYPRE_USING_CUDA) +cudaError_t hypre_CachingMallocDevice(void **ptr, size_t nbytes); + +cudaError_t hypre_CachingMallocManaged(void **ptr, size_t nbytes); + +cudaError_t hypre_CachingFreeDevice(void *ptr); + +cudaError_t hypre_CachingFreeManaged(void *ptr); +#endif + +hypre_cub_CachingDeviceAllocator * hypre_DeviceDataCubCachingAllocatorCreate(hypre_uint bin_growth, + hypre_uint min_bin, hypre_uint max_bin, size_t max_cached_bytes, bool skip_cleanup, bool debug, + bool use_managed_memory); + +void hypre_DeviceDataCubCachingAllocatorDestroy(hypre_DeviceData *data); + +#endif // #if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + +#if defined(HYPRE_USING_CUSPARSE) + +cudaDataType hypre_HYPREComplexToCudaDataType(); + +#if CUSPARSE_VERSION >= CUSPARSE_NEWAPI_VERSION +cusparseIndexType_t hypre_HYPREIntToCusparseIndexType(); +#endif + +#endif // #if defined(HYPRE_USING_CUSPARSE) + +#endif /* #ifndef HYPRE_CUDA_UTILS_H */ diff --git a/external/hypre/src/utilities/error.c b/external/hypre/src/utilities/error.c index 43ac4956..e48b74a6 100644 --- a/external/hypre/src/utilities/error.c +++ b/external/hypre/src/utilities/error.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -7,72 +7,303 @@ #include "_hypre_utilities.h" -HYPRE_Int hypre__global_error = 0; +/* Global variable for error handling */ +hypre_Error hypre__global_error = {0, 0, 0, HYPRE_INT_MAX, NULL, 0, 0}; -/* Process the error with code ierr raised in the given line of the - given source file. */ -void hypre_error_handler(const char *filename, HYPRE_Int line, HYPRE_Int ierr, const char *msg) +/*-------------------------------------------------------------------------- + * Process the error raised on the given line of the given source file + *--------------------------------------------------------------------------*/ + +void +hypre_error_handler(const char *filename, HYPRE_Int line, HYPRE_Int ierr, const char *msg) { - hypre_error_flag |= ierr; + /* Copy global struct into a short name and copy changes back before exiting */ + hypre_Error err = hypre__global_error; -#ifdef HYPRE_PRINT_ERRORS - if (msg) - { - hypre_fprintf( - stderr, "hypre error in file \"%s\", line %d, error code = %d - %s\n", - filename, line, ierr, msg); - } - else + /* Store the error code */ + err.error_flag |= ierr; + +#if defined(HYPRE_PRINT_ERRORS) + + /* process the error message only if verbosity is turned on for that error code */ + if (ierr & hypre__global_error.verbosity) { - hypre_fprintf( - stderr, "hypre error in file \"%s\", line %d, error code = %d\n", - filename, line, ierr); + /* Error format strings without and with a message */ + const char fmt_wo[] = "hypre error in file \"%s\", line %d, error code = %d\n"; + const char fmt_wm[] = "hypre error in file \"%s\", line %d, error code = %d - %s\n"; + char *buffer; + HYPRE_Int bufsz; + + /* Print error message to local buffer first */ + + if (msg) + { + bufsz = hypre_snprintf(NULL, 0, fmt_wm, filename, line, ierr, msg); + } + else + { + bufsz = hypre_snprintf(NULL, 0, fmt_wo, filename, line, ierr); + } + + bufsz += 1; + buffer = hypre_TAlloc(char, bufsz, HYPRE_MEMORY_HOST); + + if (msg) + { + hypre_snprintf(buffer, bufsz, fmt_wm, filename, line, ierr, msg); + } + else + { + hypre_snprintf(buffer, bufsz, fmt_wo, filename, line, ierr); + } + + /* Now print buffer to either memory or stderr */ + if (err.print_to_memory) + { + HYPRE_Int msg_sz = err.msg_sz; /* Store msg_sz for snprintf below */ + + /* Make sure there is enough memory for the new message */ + err.msg_sz += bufsz; + if ( err.msg_sz > err.mem_sz ) + { + err.mem_sz = err.msg_sz + 1024; /* Add some excess */ + err.memory = hypre_TReAlloc(err.memory, char, err.mem_sz, HYPRE_MEMORY_HOST); + } + + hypre_snprintf((err.memory + msg_sz), bufsz, "%s", buffer); + } + else + { + hypre_fprintf(stderr, "%s", buffer); + } + + /* Free buffer */ + hypre_TFree(buffer, HYPRE_MEMORY_HOST); } -#endif +#else + HYPRE_UNUSED_VAR(filename); + HYPRE_UNUSED_VAR(line); + HYPRE_UNUSED_VAR(msg); +#endif /* if defined(HYPRE_PRINT_ERRORS) */ + + hypre__global_error = err; } -HYPRE_Int HYPRE_GetError() +/*-------------------------------------------------------------------------- + * hypre_error_handler_clear_messages + *--------------------------------------------------------------------------*/ + +void +hypre_error_handler_clear_messages(void) +{ + hypre_Error err = hypre__global_error; + + hypre_TFree(err.memory, HYPRE_MEMORY_HOST); + err.mem_sz = 0; + err.msg_sz = 0; + + hypre__global_error = err; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +void +hypre_error_code_save(void) +{ + /* Store the current error code in a temporary variable */ + hypre_error_temp_flag = hypre_error_flag; + + /* Reset current error code */ + HYPRE_ClearAllErrors(); +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +void +hypre_error_code_restore(void) +{ + /* Restore hypre's error code */ + hypre_error_flag = hypre_error_temp_flag; + + /* Reset temporary error code */ + hypre_error_temp_flag = 0; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GetGlobalError(MPI_Comm comm) +{ + HYPRE_Int global_error_flag; + + hypre_MPI_Allreduce(&hypre_error_flag, &global_error_flag, 1, + HYPRE_MPI_INT, hypre_MPI_BOR, comm); + + return global_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GetError(void) { return hypre_error_flag; } -HYPRE_Int HYPRE_CheckError(HYPRE_Int ierr, HYPRE_Int hypre_error_code) +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_CheckError(HYPRE_Int ierr, HYPRE_Int hypre_error_code) { return ierr & hypre_error_code; } -void HYPRE_DescribeError(HYPRE_Int ierr, char *msg) +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +void +HYPRE_DescribeError(HYPRE_Int ierr, char *msg) { if (ierr == 0) - hypre_sprintf(msg,"[No error] "); + { + hypre_sprintf(msg, "[No error] "); + } if (ierr & HYPRE_ERROR_GENERIC) - hypre_sprintf(msg,"[Generic error] "); + { + hypre_sprintf(msg, "[Generic error] "); + } if (ierr & HYPRE_ERROR_MEMORY) - hypre_sprintf(msg,"[Memory error] "); + { + hypre_sprintf(msg, "[Memory error] "); + } if (ierr & HYPRE_ERROR_ARG) - hypre_sprintf(msg,"[Error in argument %d] ", HYPRE_GetErrorArg()); + { + hypre_sprintf(msg, "[Error in argument %d] ", HYPRE_GetErrorArg()); + } if (ierr & HYPRE_ERROR_CONV) - hypre_sprintf(msg,"[Method did not converge] "); + { + hypre_sprintf(msg, "[Method did not converge] "); + } } -HYPRE_Int HYPRE_GetErrorArg() +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GetErrorArg(void) { - return (hypre_error_flag>>3 & 31); + return (hypre_error_flag >> 3 & 31); } -HYPRE_Int HYPRE_ClearAllErrors() +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ClearAllErrors(void) { hypre_error_flag = 0; return (hypre_error_flag != 0); } -HYPRE_Int HYPRE_ClearError(HYPRE_Int hypre_error_code) +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ClearError(HYPRE_Int hypre_error_code) { hypre_error_flag &= ~hypre_error_code; return (hypre_error_flag & hypre_error_code); } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SetPrintErrorMode(HYPRE_Int mode) +{ + hypre__global_error.print_to_memory = mode; + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SetPrintErrorVerbosity(HYPRE_Int code, + HYPRE_Int verbosity) +{ + if (code < 0) + { + /* Change all error codes */ + code = HYPRE_INT_MAX; + } + /* First turn the bit(s) on with bitwise or */ + hypre__global_error.verbosity |= code; + if (!verbosity) + { + /* Turn the bit(s) off with bitwise xor (this works because they were first turned on */ + hypre__global_error.verbosity ^= code; + } + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GetErrorMessages(char **buffer, HYPRE_Int *bufsz) +{ + hypre_Error err = hypre__global_error; + + *bufsz = err.msg_sz; + *buffer = hypre_CTAlloc(char, *bufsz, HYPRE_MEMORY_HOST); + hypre_TMemcpy(*buffer, err.memory, char, *bufsz, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + + /* Clear error messages */ + hypre_error_handler_clear_messages(); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * This routine can be called from any rank; it is NOT collective + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PrintErrorMessages(MPI_Comm comm) +{ + hypre_Error err = hypre__global_error; + HYPRE_Int myid; + char *msg; + + hypre_MPI_Comm_rank(comm, &myid); + for (msg = err.memory; msg < (err.memory + err.msg_sz); msg += strlen(msg) + 1) + { + hypre_fprintf(stderr, "%d: %s", myid, msg); + } + + /* Clear error messages */ + hypre_error_handler_clear_messages(); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ClearErrorMessages(void) +{ + hypre_error_handler_clear_messages(); + + return hypre_error_flag; +} diff --git a/external/hypre/src/utilities/error.h b/external/hypre/src/utilities/error.h index 592bae71..38dace43 100644 --- a/external/hypre/src/utilities/error.h +++ b/external/hypre/src/utilities/error.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -8,24 +8,49 @@ #ifndef hypre_ERROR_HEADER #define hypre_ERROR_HEADER +#ifdef __cplusplus +extern "C++" +{ +#endif + #include +#ifdef __cplusplus +} +#endif + /*-------------------------------------------------------------------------- * Global variable used in hypre error checking *--------------------------------------------------------------------------*/ -extern HYPRE_Int hypre__global_error; -#define hypre_error_flag hypre__global_error +typedef struct +{ + HYPRE_Int error_flag; + HYPRE_Int temp_error_flag; + HYPRE_Int print_to_memory; + HYPRE_Int verbosity; + char *memory; + HYPRE_Int mem_sz; + HYPRE_Int msg_sz; + +} hypre_Error; + +extern hypre_Error hypre__global_error; +#define hypre_error_flag hypre__global_error.error_flag +#define hypre_error_temp_flag hypre__global_error.temp_error_flag /*-------------------------------------------------------------------------- * HYPRE error macros *--------------------------------------------------------------------------*/ void hypre_error_handler(const char *filename, HYPRE_Int line, HYPRE_Int ierr, const char *msg); +void hypre_error_handler_clear_messages(void); +void hypre_error_code_save(void); +void hypre_error_code_restore(void); -#define hypre_error(IERR) hypre_error_handler(__FILE__, __LINE__, IERR, NULL) -#define hypre_error_w_msg(IERR, msg) hypre_error_handler(__FILE__, __LINE__, IERR, msg) -#define hypre_error_in_arg(IARG) hypre_error(HYPRE_ERROR_ARG | IARG<<3) +#define hypre_error(IERR) hypre_error_handler(__FILE__, __LINE__, IERR, NULL) +#define hypre_error_w_msg(IERR, msg) hypre_error_handler(__FILE__, __LINE__, IERR, msg) +#define hypre_error_in_arg(IARG) hypre_error(HYPRE_ERROR_ARG | IARG<<3) #if defined(HYPRE_DEBUG) /* host assert */ @@ -35,7 +60,9 @@ void hypre_error_handler(const char *filename, HYPRE_Int line, HYPRE_Int ierr, c #define hypre_device_assert(EX) assert(EX) #elif defined(HYPRE_USING_HIP) /* FIXME: Currently, asserts in device kernels in HIP do not behave well */ -#define hypre_device_assert(EX) +#define hypre_device_assert(EX) do { if (0) { static_cast (EX); } } while (0) +#elif defined(HYPRE_USING_SYCL) +#define hypre_device_assert(EX) assert(EX) #endif #else /* #ifdef HYPRE_DEBUG */ /* this is to silence compiler's unused variable warnings */ @@ -48,4 +75,3 @@ void hypre_error_handler(const char *filename, HYPRE_Int line, HYPRE_Int ierr, c #endif #endif /* hypre_ERROR_HEADER */ - diff --git a/external/hypre/src/utilities/exchange_data.README b/external/hypre/src/utilities/exchange_data.README index ef3bf1ea..ba922fb0 100644 --- a/external/hypre/src/utilities/exchange_data.README +++ b/external/hypre/src/utilities/exchange_data.README @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/utilities/exchange_data.c b/external/hypre/src/utilities/exchange_data.c index baf69660..933da2ba 100644 --- a/external/hypre/src/utilities/exchange_data.c +++ b/external/hypre/src/utilities/exchange_data.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -15,19 +15,25 @@ #include "_hypre_utilities.h" /*--------------------------------------------------- - * hypre_CreateBinaryTree() + * hypre_CreateBinaryTree + * * Get the processors position in the binary tree (i.e., * its children and parent processor ids) *----------------------------------------------------*/ -HYPRE_Int hypre_CreateBinaryTree(HYPRE_Int myid, HYPRE_Int num_procs, - hypre_BinaryTree *tree) +HYPRE_Int +hypre_CreateBinaryTree(HYPRE_Int myid, + HYPRE_Int num_procs, + hypre_BinaryTree **tree_ptr) { - HYPRE_Int i, proc, size=0; + hypre_BinaryTree *tree; + HYPRE_Int i, proc, size = 0; HYPRE_Int *tmp_child_id; - HYPRE_Int num=0, parent = 0; + HYPRE_Int num = 0, parent = 0; + + tree = hypre_CTAlloc(hypre_BinaryTree, 1, HYPRE_MEMORY_HOST); - /* initialize*/ + /* initialize */ proc = myid; /*how many children can a processor have?*/ @@ -37,14 +43,14 @@ HYPRE_Int hypre_CreateBinaryTree(HYPRE_Int myid, HYPRE_Int num_procs, } /* allocate space */ - tmp_child_id = hypre_TAlloc(HYPRE_Int, size, HYPRE_MEMORY_HOST); + tmp_child_id = hypre_TAlloc(HYPRE_Int, size, HYPRE_MEMORY_HOST); /* find children and parent */ for (i = 1; i < num_procs; i *= 2) { if ( (proc % 2) == 0) { - if( (myid + i) < num_procs ) + if ( (myid + i) < num_procs ) { tmp_child_id[num] = myid + i; num++; @@ -56,30 +62,38 @@ HYPRE_Int hypre_CreateBinaryTree(HYPRE_Int myid, HYPRE_Int num_procs, parent = myid - i; break; } - } hypre_BinaryTreeParentId(tree) = parent; hypre_BinaryTreeNumChild(tree) = num; hypre_BinaryTreeChildIds(tree) = tmp_child_id; + *tree_ptr = tree; + return hypre_error_flag; } /*--------------------------------------------------- * hypre_DestroyBinaryTree() - * Destroy storage created by createBinaryTree + * + * Destroy storage created by hypre_CreateBinaryTree *----------------------------------------------------*/ -HYPRE_Int hypre_DestroyBinaryTree(hypre_BinaryTree *tree) -{ - hypre_TFree(hypre_BinaryTreeChildIds(tree), HYPRE_MEMORY_HOST); +HYPRE_Int +hypre_DestroyBinaryTree(hypre_BinaryTree *tree) +{ + if (tree) + { + hypre_TFree(hypre_BinaryTreeChildIds(tree), HYPRE_MEMORY_HOST); + hypre_TFree(tree, HYPRE_MEMORY_HOST); + } return hypre_error_flag; } /*--------------------------------------------------- * hypre_DataExchangeList() + * * This function is for sending a list of messages ("contacts" to * a list of processors. The receiving processors * do not know how many messages they are getting. The @@ -90,17 +104,19 @@ HYPRE_Int hypre_DestroyBinaryTree(hypre_BinaryTree *tree) /* should change to where the buffers for sending and receiving are voids instead of ints - then cast accordingly */ -HYPRE_Int hypre_DataExchangeList(HYPRE_Int num_contacts, - HYPRE_Int *contact_proc_list, - void *contact_send_buf, - HYPRE_Int *contact_send_buf_starts, - HYPRE_Int contact_obj_size, - HYPRE_Int response_obj_size, - hypre_DataExchangeResponse *response_obj, - HYPRE_Int max_response_size, - HYPRE_Int rnum, MPI_Comm comm, - void **p_response_recv_buf, - HYPRE_Int **p_response_recv_buf_starts) +HYPRE_Int +hypre_DataExchangeList(HYPRE_Int num_contacts, + HYPRE_Int *contact_proc_list, + void *contact_send_buf, + HYPRE_Int *contact_send_buf_starts, + HYPRE_Int contact_obj_size, + HYPRE_Int response_obj_size, + hypre_DataExchangeResponse *response_obj, + HYPRE_Int max_response_size, + HYPRE_Int rnum, + MPI_Comm comm, + void **p_response_recv_buf, + HYPRE_Int **p_response_recv_buf_starts) { /*------------------------------------------- * parameters: @@ -140,8 +156,8 @@ HYPRE_Int hypre_DataExchangeList(HYPRE_Int num_contacts, HYPRE_Int size, post_size, copy_size; HYPRE_Int total_size, count; - void *start_ptr = NULL, *index_ptr=NULL; - HYPRE_Int *int_ptr=NULL; + void *start_ptr = NULL, *index_ptr = NULL; + HYPRE_Int *int_ptr = NULL; void *response_recv_buf = NULL; void *send_response_buf = NULL; @@ -163,26 +179,26 @@ HYPRE_Int hypre_DataExchangeList(HYPRE_Int num_contacts, void **post_array = NULL; /*this must be set to null or realloc will crash */ HYPRE_Int post_array_storage = 0; HYPRE_Int post_array_size = 0; - HYPRE_Int num_post_recvs =0; + HYPRE_Int num_post_recvs = 0; - void **contact_ptrs = NULL, **response_ptrs=NULL, **post_ptrs=NULL; + void **contact_ptrs = NULL, **response_ptrs = NULL, **post_ptrs = NULL; - hypre_BinaryTree tree; + hypre_BinaryTree *tree = NULL; - hypre_MPI_Request *response_requests, *contact_requests; - hypre_MPI_Status *response_statuses, *contact_statuses; + hypre_MPI_Request *response_requests = NULL, *contact_requests = NULL; + hypre_MPI_Status *response_statuses = NULL, *contact_statuses = NULL; hypre_MPI_Request *post_send_requests = NULL, *post_recv_requests = NULL; hypre_MPI_Status *post_send_statuses = NULL, *post_recv_statuses = NULL; - hypre_MPI_Request *term_requests, term_request1, request_parent; - hypre_MPI_Status *term_statuses, term_status1, status_parent; + hypre_MPI_Request *term_requests = NULL, term_request1, request_parent; + hypre_MPI_Status *term_statuses = NULL, term_status1, status_parent; hypre_MPI_Status status, fill_status; - const HYPRE_Int contact_tag = 1000*rnum; - const HYPRE_Int response_tag = 1002*rnum; - const HYPRE_Int term_tag = 1004*rnum; - const HYPRE_Int post_tag = 1006*rnum; + const HYPRE_Int contact_tag = 1000 * rnum; + const HYPRE_Int response_tag = 1002 * rnum; + const HYPRE_Int term_tag = 1004 * rnum; + const HYPRE_Int post_tag = 1006 * rnum; hypre_MPI_Comm_size(comm, &num_procs ); hypre_MPI_Comm_rank(comm, &myid ); @@ -190,44 +206,46 @@ HYPRE_Int hypre_DataExchangeList(HYPRE_Int num_contacts, /* ---------initializations ----------------*/ /* if the response_obj_size or contact_obj_size is 0, set to sizeof(HYPRE_Int) */ - if (!response_obj_size) response_obj_size = sizeof(HYPRE_Int); - if (!contact_obj_size) contact_obj_size = sizeof(HYPRE_Int); + if (!response_obj_size) { response_obj_size = sizeof(HYPRE_Int); } + if (!contact_obj_size) { contact_obj_size = sizeof(HYPRE_Int); } - max_response_size_bytes = max_response_size*response_obj_size; + max_response_size_bytes = max_response_size * response_obj_size; /* pre-allocate the max space for responding to contacts */ - overhead = ceil((HYPRE_Real) sizeof(HYPRE_Int)/response_obj_size); /*for appending an integer*/ + overhead = (HYPRE_Int)hypre_ceil((HYPRE_Real) sizeof(HYPRE_Int) / + response_obj_size); /*for appending an integer*/ - max_response_total_bytes = (max_response_size+overhead)*response_obj_size; + max_response_total_bytes = (max_response_size + overhead) * response_obj_size; response_obj->send_response_overhead = overhead; response_obj->send_response_storage = max_response_size; - /*send_response_buf = hypre_MAlloc(max_response_total_bytes);*/ - send_response_buf = hypre_CTAlloc(char, (max_response_size+overhead)*response_obj_size, HYPRE_MEMORY_HOST); + /*send_response_buf = hypre_TAlloc(char, max_response_total_bytes);*/ + send_response_buf = hypre_CTAlloc(char, (max_response_size + overhead) * response_obj_size, + HYPRE_MEMORY_HOST); /*allocate space for inital recv array for the responses - give each processor size max_response_size */ - initial_recv_buf = hypre_TAlloc(char, max_response_total_bytes*num_contacts, HYPRE_MEMORY_HOST); - response_recv_buf_starts = hypre_CTAlloc(HYPRE_Int, num_contacts+1, HYPRE_MEMORY_HOST); + initial_recv_buf = hypre_TAlloc(char, max_response_total_bytes * num_contacts, HYPRE_MEMORY_HOST); + response_recv_buf_starts = hypre_CTAlloc(HYPRE_Int, num_contacts + 1, HYPRE_MEMORY_HOST); contact_ptrs = hypre_TAlloc( void *, num_contacts, HYPRE_MEMORY_HOST); response_ptrs = hypre_TAlloc(void *, num_contacts, HYPRE_MEMORY_HOST); /*-------------SEND CONTACTS AND POST RECVS FOR RESPONSES---*/ - for (i=0; i<= num_contacts; i++) + for (i = 0; i <= num_contacts; i++) { - response_recv_buf_starts[i] = i*(max_response_size+overhead); + response_recv_buf_starts[i] = i * (max_response_size + overhead); } /* Send "contact" messages to the list of processors and pre-post receives to wait for their response*/ responses_complete = 1; - if (num_contacts > 0 ) + if (num_contacts > 0) { responses_complete = 0; response_requests = hypre_CTAlloc(hypre_MPI_Request, num_contacts, HYPRE_MEMORY_HOST); @@ -238,11 +256,11 @@ HYPRE_Int hypre_DataExchangeList(HYPRE_Int num_contacts, /* post receives - could be confirmation or data*/ /* the size to post is max_response_total_bytes*/ - for (i=0; i< num_contacts; i++) + for (i = 0; i < num_contacts; i++) { /* response_ptrs[i] = initial_recv_buf + i*max_response_total_bytes ; */ response_ptrs[i] = (void *)((char *) initial_recv_buf + - i*max_response_total_bytes) ; + i * max_response_total_bytes) ; hypre_MPI_Irecv(response_ptrs[i], max_response_total_bytes, hypre_MPI_BYTE, contact_proc_list[i], @@ -251,15 +269,15 @@ HYPRE_Int hypre_DataExchangeList(HYPRE_Int num_contacts, /* send out contact messages */ start_ptr = contact_send_buf; - for (i=0; i< num_contacts; i++) + for (i = 0; i < num_contacts; i++) { contact_ptrs[i] = start_ptr; - size = contact_send_buf_starts[i+1] - contact_send_buf_starts[i] ; - hypre_MPI_Isend(contact_ptrs[i], size*contact_obj_size, + size = contact_send_buf_starts[i + 1] - contact_send_buf_starts[i] ; + hypre_MPI_Isend(contact_ptrs[i], size * contact_obj_size, hypre_MPI_BYTE, contact_proc_list[i], contact_tag, comm, &contact_requests[i]); /* start_ptr += (size*contact_obj_size); */ - start_ptr = (void *) ((char *) start_ptr + (size*contact_obj_size)); + start_ptr = (void *) ((char *) start_ptr + (size * contact_obj_size)); } } @@ -279,20 +297,19 @@ HYPRE_Int hypre_DataExchangeList(HYPRE_Int num_contacts, have received responses for all of their contacts. So post receives now */ - term_requests = hypre_CTAlloc(hypre_MPI_Request, tree.num_child, HYPRE_MEMORY_HOST); - term_statuses = hypre_CTAlloc(hypre_MPI_Status, tree.num_child, HYPRE_MEMORY_HOST); + term_requests = hypre_CTAlloc(hypre_MPI_Request, tree -> num_child, HYPRE_MEMORY_HOST); + term_statuses = hypre_CTAlloc(hypre_MPI_Status, tree -> num_child, HYPRE_MEMORY_HOST); - for (i=0; i< tree.num_child; i++) + for (i = 0; i < tree -> num_child; i++) { - hypre_MPI_Irecv(NULL, 0, HYPRE_MPI_INT, tree.child_id[i], term_tag, comm, + hypre_MPI_Irecv(NULL, 0, HYPRE_MPI_INT, (tree -> child_id)[i], term_tag, comm, &term_requests[i]); } terminate = 0; - children_complete = 0; } - else if (num_procs ==1 && num_contacts > 0 ) /* added 11/08 */ + else if (num_procs == 1 && num_contacts > 0) /* added 11/08 */ { terminate = 0; } @@ -313,7 +330,7 @@ HYPRE_Int hypre_DataExchangeList(HYPRE_Int num_contacts, proc = status.hypre_MPI_SOURCE; hypre_MPI_Get_count(&status, hypre_MPI_BYTE, &contact_size); - contact_size = contact_size/contact_obj_size; + contact_size = contact_size / contact_obj_size; /*---------------FILL RESPONSE ------------------------*/ @@ -321,15 +338,15 @@ HYPRE_Int hypre_DataExchangeList(HYPRE_Int num_contacts, to determine how to populate the send buffer for the reponse*/ /* do we have enough space to recv it? */ - if(contact_size > recv_contact_buf_size) + if (contact_size > recv_contact_buf_size) { recv_contact_buf = hypre_TReAlloc((char*)recv_contact_buf, - char, contact_obj_size*contact_size, HYPRE_MEMORY_HOST); + char, contact_obj_size * contact_size, HYPRE_MEMORY_HOST); recv_contact_buf_size = contact_size; } /* this must be blocking - can't fill recv without the buffer*/ - hypre_MPI_Recv(recv_contact_buf, contact_size*contact_obj_size, + hypre_MPI_Recv(recv_contact_buf, contact_size * contact_obj_size, hypre_MPI_BYTE, proc, contact_tag, comm, &fill_status); response_obj->fill_response(recv_contact_buf, contact_size, proc, @@ -356,13 +373,14 @@ HYPRE_Int hypre_DataExchangeList(HYPRE_Int num_contacts, /* allocate space for the data this post only*/ /* this should not happen often (unless a poor max_size has been chosen) - so we will allocate space for the data as needed */ - size = post_size*response_obj_size; + size = post_size * response_obj_size; post_array[post_array_size] = hypre_TAlloc(char, size, HYPRE_MEMORY_HOST); /* index_ptr = send_response_buf + max_response_size_bytes */; index_ptr = (void *) ((char *) send_response_buf + max_response_size_bytes); - hypre_TMemcpy(post_array[post_array_size], index_ptr, char, size, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + hypre_TMemcpy(post_array[post_array_size], index_ptr, char, size, HYPRE_MEMORY_HOST, + HYPRE_MEMORY_HOST); /*now post any part of the message that is too long with a non-blocking send and a different tag */ @@ -381,7 +399,8 @@ HYPRE_Int hypre_DataExchangeList(HYPRE_Int num_contacts, index_ptr = (void *) ((char *) send_response_buf + max_response_size_bytes); - hypre_TMemcpy(index_ptr, &response_message_size, HYPRE_Int, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + hypre_TMemcpy(index_ptr, &response_message_size, HYPRE_Int, 1, HYPRE_MEMORY_HOST, + HYPRE_MEMORY_HOST); /*send the block of data that includes the overhead */ /* this is a blocking send - the recv has already been posted */ @@ -404,23 +423,23 @@ HYPRE_Int hypre_DataExchangeList(HYPRE_Int num_contacts, { hypre_MPI_Testall(num_contacts, response_requests, &responses_complete, response_statuses); - if (responses_complete && num_procs == 1) terminate = 1; /*added 11/08 */ + if (responses_complete && num_procs == 1) { terminate = 1; } /*added 11/08 */ } - else if(!children_complete) /* have all of our children received all of their + else if (!children_complete) /* have all of our children received all of their response messages?*/ { - hypre_MPI_Testall(tree.num_child, term_requests, &children_complete, + hypre_MPI_Testall(tree -> num_child, term_requests, &children_complete, term_statuses); /* if we have gotten term messages from all of our children, send a term message to our parent. Then post a receive to hear back from parent */ - if (children_complete & (myid > 0)) /*root does not have a parent*/ + if (children_complete & (myid > 0)) /*root does not have a parent*/ { - hypre_MPI_Isend(NULL, 0, HYPRE_MPI_INT, tree.parent_id, term_tag, + hypre_MPI_Isend(NULL, 0, HYPRE_MPI_INT, tree -> parent_id, term_tag, comm, &request_parent); - hypre_MPI_Irecv(NULL, 0, HYPRE_MPI_INT, tree.parent_id, term_tag, + hypre_MPI_Irecv(NULL, 0, HYPRE_MPI_INT, tree -> parent_id, term_tag, comm, &term_request1); } } @@ -435,15 +454,16 @@ HYPRE_Int hypre_DataExchangeList(HYPRE_Int num_contacts, hypre_MPI_Test(&term_request1, &terminate, &term_status1); } if (terminate) /*tell children to terminate */ - { - if (myid > 0 ) hypre_MPI_Wait(&request_parent, &status_parent); + { + if (myid > 0 ) { hypre_MPI_Wait(&request_parent, &status_parent); } - for (i=0; i< tree.num_child; i++) - { /*a blocking send - recv has been posted already*/ - hypre_MPI_Send(NULL, 0, HYPRE_MPI_INT, tree.child_id[i], + for (i = 0; i < tree -> num_child; i++) + { + /*a blocking send - recv has been posted already*/ + hypre_MPI_Send(NULL, 0, HYPRE_MPI_INT, (tree -> child_id)[i], term_tag, comm); - } - } + } + } } } @@ -471,15 +491,15 @@ HYPRE_Int hypre_DataExchangeList(HYPRE_Int num_contacts, /*an extra loop to determine sizes. This is better than reallocating the array that will be used in posting the irecvs */ - for (i=0; i< num_contacts; i++) + for (i = 0; i < num_contacts; i++) { int_ptr = (HYPRE_Int *) ((char *) start_ptr + max_response_size_bytes); /*the overhead HYPRE_Int*/ response_message_size = *int_ptr; - response_recv_buf_starts[i+1] = + response_recv_buf_starts[i + 1] = response_recv_buf_starts[i] + response_message_size; total_size += response_message_size; - if (max_response_size < response_message_size) num_post_recvs++; + if (max_response_size < response_message_size) { num_post_recvs++; } /* start_ptr += max_response_total_bytes; */ start_ptr = (void *) ((char *) start_ptr + max_response_total_bytes); } @@ -489,31 +509,32 @@ HYPRE_Int hypre_DataExchangeList(HYPRE_Int num_contacts, post_ptrs = hypre_TAlloc(void *, num_post_recvs, HYPRE_MEMORY_HOST); /*second loop to post any recvs and set up recv_response_buf */ - response_recv_buf = hypre_TAlloc(char, total_size*response_obj_size, HYPRE_MEMORY_HOST); + response_recv_buf = hypre_TAlloc(char, total_size * response_obj_size, HYPRE_MEMORY_HOST); index_ptr = response_recv_buf; start_ptr = initial_recv_buf; count = 0; - for (i=0; i< num_contacts; i++) + for (i = 0; i < num_contacts; i++) { response_message_size = - response_recv_buf_starts[i+1] - response_recv_buf_starts[i]; + response_recv_buf_starts[i + 1] - response_recv_buf_starts[i]; copy_size = hypre_min(response_message_size, max_response_size); - hypre_TMemcpy(index_ptr, start_ptr, char, copy_size*response_obj_size, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + hypre_TMemcpy(index_ptr, start_ptr, char, copy_size * response_obj_size, HYPRE_MEMORY_HOST, + HYPRE_MEMORY_HOST); /* index_ptr += copy_size*response_obj_size; */ - index_ptr = (void *) ((char *) index_ptr + copy_size*response_obj_size); + index_ptr = (void *) ((char *) index_ptr + copy_size * response_obj_size); if (max_response_size < response_message_size) { - size = (response_message_size - max_response_size)*response_obj_size; + size = (response_message_size - max_response_size) * response_obj_size; post_ptrs[count] = index_ptr; hypre_MPI_Irecv(post_ptrs[count], size, hypre_MPI_BYTE, contact_proc_list[i], post_tag, comm, &post_recv_requests[count]); count++; /* index_ptr+=size;*/ - index_ptr= (void *) ((char *) index_ptr + size); + index_ptr = (void *) ((char *) index_ptr + size); } /* start_ptr += max_response_total_bytes; */ @@ -554,7 +575,7 @@ HYPRE_Int hypre_DataExchangeList(HYPRE_Int num_contacts, hypre_TFree(post_send_requests, HYPRE_MEMORY_HOST); hypre_TFree(post_send_statuses, HYPRE_MEMORY_HOST); - for (i=0; i< post_array_size; i++) + for (i = 0; i < post_array_size; i++) { hypre_TFree(post_array[i], HYPRE_MEMORY_HOST); } @@ -566,7 +587,7 @@ HYPRE_Int hypre_DataExchangeList(HYPRE_Int num_contacts, hypre_TFree(term_requests, HYPRE_MEMORY_HOST); hypre_TFree(term_statuses, HYPRE_MEMORY_HOST); - hypre_DestroyBinaryTree(&tree); + hypre_DestroyBinaryTree(tree); } /* output */ diff --git a/external/hypre/src/utilities/exchange_data.h b/external/hypre/src/utilities/exchange_data.h index 52e10e37..ed2531f8 100644 --- a/external/hypre/src/utilities/exchange_data.h +++ b/external/hypre/src/utilities/exchange_data.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -31,9 +31,9 @@ typedef struct typedef struct { HYPRE_Int (*fill_response)(void* recv_buf, HYPRE_Int contact_size, - HYPRE_Int contact_proc, void* response_obj, - MPI_Comm comm, void** response_buf, - HYPRE_Int* response_message_size); + HYPRE_Int contact_proc, void* response_obj, + MPI_Comm comm, void** response_buf, + HYPRE_Int* response_message_size); HYPRE_Int send_response_overhead; /*set by exchange data */ HYPRE_Int send_response_storage; /*storage allocated for send_response_buf*/ void *data1; /*data fields user may want to access in fill_response */ @@ -41,9 +41,11 @@ typedef struct } hypre_DataExchangeResponse; -HYPRE_Int hypre_CreateBinaryTree(HYPRE_Int, HYPRE_Int, hypre_BinaryTree*); +HYPRE_Int hypre_CreateBinaryTree(HYPRE_Int, HYPRE_Int, hypre_BinaryTree**); HYPRE_Int hypre_DestroyBinaryTree(hypre_BinaryTree*); -HYPRE_Int hypre_DataExchangeList(HYPRE_Int num_contacts, HYPRE_Int *contact_proc_list, void *contact_send_buf, HYPRE_Int *contact_send_buf_starts, HYPRE_Int contact_obj_size, HYPRE_Int response_obj_size, hypre_DataExchangeResponse *response_obj, HYPRE_Int max_response_size, HYPRE_Int rnum, MPI_Comm comm, void **p_response_recv_buf, HYPRE_Int **p_response_recv_buf_starts); +HYPRE_Int hypre_DataExchangeList(HYPRE_Int num_contacts, HYPRE_Int *contact_proc_list, + void *contact_send_buf, HYPRE_Int *contact_send_buf_starts, HYPRE_Int contact_obj_size, + HYPRE_Int response_obj_size, hypre_DataExchangeResponse *response_obj, HYPRE_Int max_response_size, + HYPRE_Int rnum, MPI_Comm comm, void **p_response_recv_buf, HYPRE_Int **p_response_recv_buf_starts); #endif /* end of header */ - diff --git a/external/hypre/src/utilities/fortran.h b/external/hypre/src/utilities/fortran.h index d2471c98..7646eedc 100644 --- a/external/hypre/src/utilities/fortran.h +++ b/external/hypre/src/utilities/fortran.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -25,7 +25,7 @@ #ifdef __cplusplus extern "C" { #endif - + /*------------------------------------------------------- * Define specific name mangling macros to be used below *-------------------------------------------------------*/ @@ -127,7 +127,9 @@ typedef hypre_int hypre_F90_Comm; typedef HYPRE_Int hypre_F90_Int; typedef HYPRE_BigInt hypre_F90_BigInt; typedef HYPRE_Int hypre_F90_IntArray; +typedef HYPRE_Int hypre_F90_IntArrayArray; typedef HYPRE_BigInt hypre_F90_BigIntArray; +typedef HYPRE_BigInt hypre_F90_BigIntArrayArray; typedef HYPRE_Real hypre_F90_Real; typedef HYPRE_Real hypre_F90_RealArray; typedef HYPRE_Complex hypre_F90_Complex; @@ -135,25 +137,26 @@ typedef HYPRE_Complex hypre_F90_ComplexArray; typedef HYPRE_Int *hypre_F90_Obj; typedef HYPRE_Int *hypre_F90_ObjRef; -#define hypre_F90_PassComm(arg) (hypre_MPI_Comm_f2c(*arg)) -#define hypre_F90_PassInt(arg) ((HYPRE_Int) *arg) -#define hypre_F90_PassIntRef(arg) ((HYPRE_Int *) arg) -#define hypre_F90_PassIntArray(arg) ((HYPRE_Int *) arg) -#define hypre_F90_PassBigInt(arg) ((HYPRE_BigInt) *arg) -#define hypre_F90_PassBigIntRef(arg) ((HYPRE_BigInt *) arg) -#define hypre_F90_PassBigIntArray(arg) ((HYPRE_BigInt *) arg) -#define hypre_F90_PassReal(arg) ((HYPRE_Real) *arg) -#define hypre_F90_PassRealRef(arg) ((HYPRE_Real *) arg) -#define hypre_F90_PassRealArray(arg) ((HYPRE_Real *) arg) -#define hypre_F90_PassComplex(arg) ((HYPRE_Complex) *arg) -#define hypre_F90_PassComplexRef(arg) ((HYPRE_Complex *) arg) -#define hypre_F90_PassComplexArray(arg) ((HYPRE_Complex *) arg) -#define hypre_F90_PassObj(obj,arg) ((obj) *arg) -#define hypre_F90_PassObjRef(obj,arg) ((obj *) arg) +#define hypre_F90_PassComm(arg) (hypre_MPI_Comm_f2c(*arg)) +#define hypre_F90_PassInt(arg) ((HYPRE_Int) *arg) +#define hypre_F90_PassIntRef(arg) ((HYPRE_Int *) arg) +#define hypre_F90_PassIntArray(arg) ((HYPRE_Int *) arg) +#define hypre_F90_PassIntArrayArray(arg) ((HYPRE_Int **) arg) +#define hypre_F90_PassBigInt(arg) ((HYPRE_BigInt) *arg) +#define hypre_F90_PassBigIntRef(arg) ((HYPRE_BigInt *) arg) +#define hypre_F90_PassBigIntArray(arg) ((HYPRE_BigInt *) arg) +#define hypre_F90_PassBigIntArrayArray(arg) ((HYPRE_BigInt **) arg) +#define hypre_F90_PassReal(arg) ((HYPRE_Real) *arg) +#define hypre_F90_PassRealRef(arg) ((HYPRE_Real *) arg) +#define hypre_F90_PassRealArray(arg) ((HYPRE_Real *) arg) +#define hypre_F90_PassComplex(arg) ((HYPRE_Complex) *arg) +#define hypre_F90_PassComplexRef(arg) ((HYPRE_Complex *) arg) +#define hypre_F90_PassComplexArray(arg) ((HYPRE_Complex *) arg) +#define hypre_F90_PassObj(obj,arg) ((obj) *arg) +#define hypre_F90_PassObjRef(obj,arg) ((obj *) arg) #ifdef __cplusplus } #endif #endif - diff --git a/external/hypre/src/utilities/fortran_matrix.c b/external/hypre/src/utilities/fortran_matrix.c index cacbec16..b881a52c 100644 --- a/external/hypre/src/utilities/fortran_matrix.c +++ b/external/hypre/src/utilities/fortran_matrix.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -13,7 +13,8 @@ #include "_hypre_utilities.h" utilities_FortranMatrix* -utilities_FortranMatrixCreate(void) { +utilities_FortranMatrixCreate(void) +{ utilities_FortranMatrix* mtx; @@ -31,15 +32,18 @@ utilities_FortranMatrixCreate(void) { void utilities_FortranMatrixAllocateData( HYPRE_BigInt h, HYPRE_BigInt w, - utilities_FortranMatrix* mtx ) { + utilities_FortranMatrix* mtx ) +{ hypre_assert( h > 0 && w > 0 ); hypre_assert( mtx != NULL ); if ( mtx->value != NULL && mtx->ownsValues ) - hypre_TFree( mtx->value ,HYPRE_MEMORY_HOST); + { + hypre_TFree( mtx->value, HYPRE_MEMORY_HOST); + } - mtx->value = hypre_CTAlloc(HYPRE_Real, h*w, HYPRE_MEMORY_HOST); + mtx->value = hypre_CTAlloc(HYPRE_Real, h * w, HYPRE_MEMORY_HOST); hypre_assert ( mtx->value != NULL ); mtx->globalHeight = h; @@ -51,13 +55,16 @@ utilities_FortranMatrixAllocateData( HYPRE_BigInt h, HYPRE_BigInt w, void utilities_FortranMatrixWrap( HYPRE_Real* v, HYPRE_BigInt gh, HYPRE_BigInt h, HYPRE_BigInt w, - utilities_FortranMatrix* mtx ) { + utilities_FortranMatrix* mtx ) +{ hypre_assert( h > 0 && w > 0 ); hypre_assert( mtx != NULL ); if ( mtx->value != NULL && mtx->ownsValues ) - hypre_TFree( mtx->value ,HYPRE_MEMORY_HOST); + { + hypre_TFree( mtx->value, HYPRE_MEMORY_HOST); + } mtx->value = v; hypre_assert ( mtx->value != NULL ); @@ -70,19 +77,25 @@ utilities_FortranMatrixWrap( HYPRE_Real* v, HYPRE_BigInt gh, HYPRE_BigInt h, HY void -utilities_FortranMatrixDestroy( utilities_FortranMatrix* mtx ) { +utilities_FortranMatrixDestroy( utilities_FortranMatrix* mtx ) +{ if ( mtx == NULL ) + { return; + } if ( mtx->ownsValues && mtx->value != NULL ) - hypre_TFree(mtx->value,HYPRE_MEMORY_HOST); + { + hypre_TFree(mtx->value, HYPRE_MEMORY_HOST); + } - hypre_TFree(mtx,HYPRE_MEMORY_HOST); + hypre_TFree(mtx, HYPRE_MEMORY_HOST); } HYPRE_BigInt -utilities_FortranMatrixGlobalHeight( utilities_FortranMatrix* mtx ) { +utilities_FortranMatrixGlobalHeight( utilities_FortranMatrix* mtx ) +{ hypre_assert( mtx != NULL ); @@ -90,7 +103,8 @@ utilities_FortranMatrixGlobalHeight( utilities_FortranMatrix* mtx ) { } HYPRE_BigInt -utilities_FortranMatrixHeight( utilities_FortranMatrix* mtx ) { +utilities_FortranMatrixHeight( utilities_FortranMatrix* mtx ) +{ hypre_assert( mtx != NULL ); @@ -98,7 +112,8 @@ utilities_FortranMatrixHeight( utilities_FortranMatrix* mtx ) { } HYPRE_BigInt -utilities_FortranMatrixWidth( utilities_FortranMatrix* mtx ) { +utilities_FortranMatrixWidth( utilities_FortranMatrix* mtx ) +{ hypre_assert( mtx != NULL ); @@ -106,7 +121,8 @@ utilities_FortranMatrixWidth( utilities_FortranMatrix* mtx ) { } HYPRE_Real* -utilities_FortranMatrixValues( utilities_FortranMatrix* mtx ) { +utilities_FortranMatrixValues( utilities_FortranMatrix* mtx ) +{ hypre_assert( mtx != NULL ); @@ -114,7 +130,8 @@ utilities_FortranMatrixValues( utilities_FortranMatrix* mtx ) { } void -utilities_FortranMatrixClear( utilities_FortranMatrix* mtx ) { +utilities_FortranMatrixClear( utilities_FortranMatrix* mtx ) +{ HYPRE_BigInt i, j, h, w, jump; HYPRE_Real* p; @@ -126,15 +143,19 @@ utilities_FortranMatrixClear( utilities_FortranMatrix* mtx ) { jump = mtx->globalHeight - h; - for ( j = 0, p = mtx->value; j < w; j++ ) { + for ( j = 0, p = mtx->value; j < w; j++ ) + { for ( i = 0; i < h; i++, p++ ) + { *p = 0.0; + } p += jump; } } void -utilities_FortranMatrixClearL( utilities_FortranMatrix* mtx ) { +utilities_FortranMatrixClearL( utilities_FortranMatrix* mtx ) +{ HYPRE_BigInt i, j, k, h, w, jump; HYPRE_Real* p; @@ -145,22 +166,28 @@ utilities_FortranMatrixClearL( utilities_FortranMatrix* mtx ) { w = mtx->width; if ( w > h ) + { w = h; + } jump = mtx->globalHeight - h; - for ( j = 0, p = mtx->value; j < w - 1; j++ ) { + for ( j = 0, p = mtx->value; j < w - 1; j++ ) + { k = j + 1; p += k; for ( i = k; i < h; i++, p++ ) + { *p = 0.0; + } p += jump; } } void -utilities_FortranMatrixSetToIdentity( utilities_FortranMatrix* mtx ) { +utilities_FortranMatrixSetToIdentity( utilities_FortranMatrix* mtx ) +{ HYPRE_BigInt j, h, w, jump; HYPRE_Real* p; @@ -175,12 +202,15 @@ utilities_FortranMatrixSetToIdentity( utilities_FortranMatrix* mtx ) { jump = mtx->globalHeight; for ( j = 0, p = mtx->value; j < w && j < h; j++, p += jump ) + { *p++ = 1.0; + } } void -utilities_FortranMatrixTransposeSquare( utilities_FortranMatrix* mtx ) { +utilities_FortranMatrixTransposeSquare( utilities_FortranMatrix* mtx ) +{ HYPRE_BigInt i, j, g, h, w, jump; HYPRE_Real* p; @@ -197,11 +227,13 @@ utilities_FortranMatrixTransposeSquare( utilities_FortranMatrix* mtx ) { jump = mtx->globalHeight - h; - for ( j = 0, p = mtx->value; j < w; j++ ) { + for ( j = 0, p = mtx->value; j < w; j++ ) + { q = p; p++; q += g; - for ( i = j + 1; i < h; i++, p++, q += g ) { + for ( i = j + 1; i < h; i++, p++, q += g ) + { tmp = *p; *p = *q; *q = tmp; @@ -211,7 +243,8 @@ utilities_FortranMatrixTransposeSquare( utilities_FortranMatrix* mtx ) { } void -utilities_FortranMatrixSymmetrize( utilities_FortranMatrix* mtx ) { +utilities_FortranMatrixSymmetrize( utilities_FortranMatrix* mtx ) +{ HYPRE_BigInt i, j, g, h, w, jump; HYPRE_Real* p; @@ -227,19 +260,23 @@ utilities_FortranMatrixSymmetrize( utilities_FortranMatrix* mtx ) { jump = mtx->globalHeight - h; - for ( j = 0, p = mtx->value; j < w; j++ ) { + for ( j = 0, p = mtx->value; j < w; j++ ) + { q = p; p++; q += g; for ( i = j + 1; i < h; i++, p++, q += g ) - *p = *q = (*p + *q)*0.5; + { + *p = *q = (*p + *q) * 0.5; + } p += ++jump; } } void utilities_FortranMatrixCopy( utilities_FortranMatrix* src, HYPRE_Int t, - utilities_FortranMatrix* dest ) { + utilities_FortranMatrix* dest ) +{ HYPRE_BigInt i, j, h, w; HYPRE_BigInt jp, jq, jr; @@ -254,12 +291,14 @@ utilities_FortranMatrixCopy( utilities_FortranMatrix* src, HYPRE_Int t, jp = dest->globalHeight - h; - if ( t == 0 ) { + if ( t == 0 ) + { hypre_assert( src->height == h && src->width == w ); jq = 1; jr = src->globalHeight; } - else { + else + { hypre_assert( src->height == w && src->width == h ); jr = 1; jq = src->globalHeight; @@ -267,13 +306,16 @@ utilities_FortranMatrixCopy( utilities_FortranMatrix* src, HYPRE_Int t, for ( j = 0, p = dest->value, r = src->value; j < w; j++, p += jp, r += jr ) for ( i = 0, q = r; i < h; i++, p++, q += jq ) + { *p = *q; + } } void utilities_FortranMatrixIndexCopy( HYPRE_Int* index, utilities_FortranMatrix* src, HYPRE_Int t, - utilities_FortranMatrix* dest ) { + utilities_FortranMatrix* dest ) +{ HYPRE_BigInt i, j, h, w; HYPRE_BigInt jp, jq, jr; @@ -288,27 +330,33 @@ utilities_FortranMatrixIndexCopy( HYPRE_Int* index, jp = dest->globalHeight - h; - if ( t == 0 ) { + if ( t == 0 ) + { hypre_assert( src->height == h && src->width == w ); jq = 1; jr = src->globalHeight; } - else { + else + { hypre_assert( src->height == w && src->width == h ); jr = 1; jq = src->globalHeight; } - for ( j = 0, p = dest->value; j < w; j++, p += jp ) { - r = src->value + (index[j]-1)*jr; + for ( j = 0, p = dest->value; j < w; j++, p += jp ) + { + r = src->value + (index[j] - 1) * jr; for ( i = 0, q = r; i < h; i++, p++, q += jq ) + { *p = *q; + } } } void utilities_FortranMatrixSetDiagonal( utilities_FortranMatrix* mtx, - utilities_FortranMatrix* vec ) { + utilities_FortranMatrix* vec ) +{ HYPRE_BigInt j, h, w, jump; HYPRE_Real* p; @@ -325,13 +373,16 @@ utilities_FortranMatrixSetDiagonal( utilities_FortranMatrix* mtx, for ( j = 0, p = mtx->value, q = vec->value; j < w && j < h; j++, p += jump, q++ ) + { *p = *q; + } } void utilities_FortranMatrixGetDiagonal( utilities_FortranMatrix* mtx, - utilities_FortranMatrix* vec ) { + utilities_FortranMatrix* vec ) +{ HYPRE_BigInt j, h, w, jump; HYPRE_Real* p; @@ -348,7 +399,9 @@ utilities_FortranMatrixGetDiagonal( utilities_FortranMatrix* mtx, for ( j = 0, p = mtx->value, q = vec->value; j < w && j < h; j++, p += jump, q++ ) + { *q = *p; + } } @@ -356,7 +409,8 @@ void utilities_FortranMatrixAdd( HYPRE_Real a, utilities_FortranMatrix* mtxA, utilities_FortranMatrix* mtxB, - utilities_FortranMatrix* mtxC ) { + utilities_FortranMatrix* mtxC ) +{ HYPRE_BigInt i, j, h, w, jA, jB, jC; HYPRE_Real *pA; @@ -379,37 +433,53 @@ utilities_FortranMatrixAdd( HYPRE_Real a, pB = mtxB->value; pC = mtxC->value; - if ( a == 0.0 ) { - for ( j = 0; j < w; j++ ) { + if ( a == 0.0 ) + { + for ( j = 0; j < w; j++ ) + { for ( i = 0; i < h; i++, pA++, pB++, pC++ ) + { *pC = *pB; + } pA += jA; pB += jB; pC += jC; } } - else if ( a == 1.0 ) { - for ( j = 0; j < w; j++ ) { + else if ( a == 1.0 ) + { + for ( j = 0; j < w; j++ ) + { for ( i = 0; i < h; i++, pA++, pB++, pC++ ) + { *pC = *pA + *pB; + } pA += jA; pB += jB; pC += jC; } } - else if ( a == -1.0 ) { - for ( j = 0; j < w; j++ ) { + else if ( a == -1.0 ) + { + for ( j = 0; j < w; j++ ) + { for ( i = 0; i < h; i++, pA++, pB++, pC++ ) + { *pC = *pB - *pA; + } pA += jA; pB += jB; pC += jC; } } - else { - for ( j = 0; j < w; j++ ) { + else + { + for ( j = 0; j < w; j++ ) + { for ( i = 0; i < h; i++, pA++, pB++, pC++ ) + { *pC = *pA * a + *pB; + } pA += jA; pB += jB; pC += jC; @@ -419,7 +489,8 @@ utilities_FortranMatrixAdd( HYPRE_Real a, void utilities_FortranMatrixDMultiply( utilities_FortranMatrix* vec, - utilities_FortranMatrix* mtx ) { + utilities_FortranMatrix* mtx ) +{ HYPRE_BigInt i, j, h, w, jump; HYPRE_Real* p; @@ -434,9 +505,12 @@ utilities_FortranMatrixDMultiply( utilities_FortranMatrix* vec, jump = mtx->globalHeight - h; - for ( j = 0, p = mtx->value; j < w; j++ ) { + for ( j = 0, p = mtx->value; j < w; j++ ) + { for ( i = 0, q = vec->value; i < h; i++, p++, q++ ) + { *p = *p * (*q); + } p += jump; } @@ -444,7 +518,8 @@ utilities_FortranMatrixDMultiply( utilities_FortranMatrix* vec, void utilities_FortranMatrixMultiplyD( utilities_FortranMatrix* mtx, - utilities_FortranMatrix* vec ) { + utilities_FortranMatrix* vec ) +{ HYPRE_BigInt i, j, h, w, jump; HYPRE_Real* p; @@ -459,9 +534,12 @@ utilities_FortranMatrixMultiplyD( utilities_FortranMatrix* mtx, jump = mtx->globalHeight - h; - for ( j = 0, q = vec->value, p = mtx->value; j < w; j++, q++ ) { + for ( j = 0, q = vec->value, p = mtx->value; j < w; j++, q++ ) + { for ( i = 0; i < h; i++, p++) + { *p = *p * (*q); + } p += jump; } @@ -470,7 +548,8 @@ utilities_FortranMatrixMultiplyD( utilities_FortranMatrix* mtx, void utilities_FortranMatrixMultiply( utilities_FortranMatrix* mtxA, HYPRE_Int tA, utilities_FortranMatrix* mtxB, HYPRE_Int tB, - utilities_FortranMatrix* mtxC ) { + utilities_FortranMatrix* mtxC ) +{ HYPRE_BigInt h, w; HYPRE_BigInt i, j, k, l; HYPRE_BigInt iA, kA; @@ -493,26 +572,30 @@ utilities_FortranMatrixMultiply( utilities_FortranMatrix* mtxA, HYPRE_Int tA, iC = 1; jC = mtxC->globalHeight; - if ( tA == 0 ) { + if ( tA == 0 ) + { hypre_assert( mtxA->height == h ); l = mtxA->width; iA = 1; kA = mtxA->globalHeight; } - else { + else + { l = mtxA->height; hypre_assert( mtxA->width == h ); kA = 1; iA = mtxA->globalHeight; } - if ( tB == 0 ) { + if ( tB == 0 ) + { hypre_assert( mtxB->height == l ); hypre_assert( mtxB->width == w ); kB = 1; jB = mtxB->globalHeight; } - else { + else + { hypre_assert( mtxB->width == l ); hypre_assert( mtxB->height == w ); jB = 1; @@ -522,17 +605,21 @@ utilities_FortranMatrixMultiply( utilities_FortranMatrix* mtxA, HYPRE_Int tA, for ( j = 0, pB0j = mtxB->value, pC0j = mtxC->value; j < w; j++, pB0j += jB, pC0j += jC ) for ( i = 0, pCij = pC0j, pAi0 = mtxA->value; i < h; - i++, pCij += iC, pAi0 += iA ) { + i++, pCij += iC, pAi0 += iA ) + { s = 0.0; for ( k = 0, pAik = pAi0, pBkj = pB0j; k < l; k++, pAik += kA, pBkj += kB ) + { s += *pAik * (*pBkj); + } *pCij = s; } } HYPRE_Real -utilities_FortranMatrixFNorm( utilities_FortranMatrix* mtx ) { +utilities_FortranMatrixFNorm( utilities_FortranMatrix* mtx ) +{ HYPRE_BigInt i, j, h, w, jump; HYPRE_Real* p; @@ -548,19 +635,23 @@ utilities_FortranMatrixFNorm( utilities_FortranMatrix* mtx ) { norm = 0.0; - for ( j = 0, p = mtx->value; j < w; j++ ) { + for ( j = 0, p = mtx->value; j < w; j++ ) + { for ( i = 0; i < h; i++, p++ ) + { norm += (*p) * (*p); + } p += jump; } - norm = sqrt(norm); + norm = hypre_sqrt(norm); return norm; } HYPRE_Real utilities_FortranMatrixValue( utilities_FortranMatrix* mtx, - HYPRE_BigInt i, HYPRE_BigInt j ) { + HYPRE_BigInt i, HYPRE_BigInt j ) +{ HYPRE_BigInt k; @@ -569,13 +660,14 @@ utilities_FortranMatrixValue( utilities_FortranMatrix* mtx, hypre_assert( 1 <= i && i <= mtx->height ); hypre_assert( 1 <= j && j <= mtx->width ); - k = i - 1 + (j - 1)*mtx->globalHeight; + k = i - 1 + (j - 1) * mtx->globalHeight; return mtx->value[k]; } HYPRE_Real* utilities_FortranMatrixValuePtr( utilities_FortranMatrix* mtx, - HYPRE_BigInt i, HYPRE_BigInt j ) { + HYPRE_BigInt i, HYPRE_BigInt j ) +{ HYPRE_BigInt k; @@ -584,12 +676,13 @@ utilities_FortranMatrixValuePtr( utilities_FortranMatrix* mtx, hypre_assert( 1 <= i && i <= mtx->height ); hypre_assert( 1 <= j && j <= mtx->width ); - k = i - 1 + (j - 1)*mtx->globalHeight; + k = i - 1 + (j - 1) * mtx->globalHeight; return mtx->value + k; } HYPRE_Real -utilities_FortranMatrixMaxValue( utilities_FortranMatrix* mtx ) { +utilities_FortranMatrixMaxValue( utilities_FortranMatrix* mtx ) +{ HYPRE_BigInt i, j, jump; HYPRE_BigInt h, w; @@ -605,10 +698,13 @@ utilities_FortranMatrixMaxValue( utilities_FortranMatrix* mtx ) { maxVal = mtx->value[0]; - for ( j = 0, p = mtx->value; j < w; j++ ) { + for ( j = 0, p = mtx->value; j < w; j++ ) + { for ( i = 0; i < h; i++, p++ ) if ( *p > maxVal ) + { maxVal = *p; + } p += jump; } @@ -619,13 +715,17 @@ void utilities_FortranMatrixSelectBlock( utilities_FortranMatrix* mtx, HYPRE_BigInt iFrom, HYPRE_BigInt iTo, HYPRE_BigInt jFrom, HYPRE_BigInt jTo, - utilities_FortranMatrix* block ) { + utilities_FortranMatrix* block ) +{ if ( block->value != NULL && block->ownsValues ) - hypre_TFree( block->value ,HYPRE_MEMORY_HOST); + { + hypre_TFree( block->value, HYPRE_MEMORY_HOST); + } block->globalHeight = mtx->globalHeight; - if ( iTo < iFrom || jTo < jFrom ) { + if ( iTo < iFrom || jTo < jFrom ) + { block->height = 0; block->width = 0; block->value = NULL; @@ -633,12 +733,13 @@ utilities_FortranMatrixSelectBlock( utilities_FortranMatrix* mtx, } block->height = iTo - iFrom + 1; block->width = jTo - jFrom + 1; - block->value = mtx->value + iFrom - 1 + (jFrom - 1)*mtx->globalHeight; + block->value = mtx->value + iFrom - 1 + (jFrom - 1) * mtx->globalHeight; block->ownsValues = 0; } void -utilities_FortranMatrixUpperInv( utilities_FortranMatrix* u ) { +utilities_FortranMatrixUpperInv( utilities_FortranMatrix* u ) +{ HYPRE_BigInt i, j, k; HYPRE_BigInt n, jc, jd; @@ -662,34 +763,39 @@ utilities_FortranMatrixUpperInv( utilities_FortranMatrix* u ) { pii = u->value; pd = diag; - for ( i = 0; i < n; i++, pii += jd, pd++ ) { + for ( i = 0; i < n; i++, pii += jd, pd++ ) + { v = *pd = *pii; - *pii = 1.0/v; + *pii = 1.0 / v; } pii -= jd; pin = pii - 1; pii -= jd; pd -= 2; - for ( i = n - 1; i > 0; i--, pii -= jd, pin--, pd-- ) { + for ( i = n - 1; i > 0; i--, pii -= jd, pin--, pd-- ) + { pij = pin; - for ( j = n; j > i; j--, pij -= jc ) { + for ( j = n; j > i; j--, pij -= jc ) + { v = 0; pik = pii + jc; pkj = pij + 1; - for ( k = i + 1; k <= j; k++, pik += jc, pkj++ ) { + for ( k = i + 1; k <= j; k++, pik += jc, pkj++ ) + { v -= (*pik) * (*pkj); } - *pij = v/(*pd); + *pij = v / (*pd); } } - hypre_TFree( diag ,HYPRE_MEMORY_HOST); + hypre_TFree( diag, HYPRE_MEMORY_HOST); } HYPRE_Int -utilities_FortranMatrixPrint( utilities_FortranMatrix* mtx, const char *fileName) { +utilities_FortranMatrixPrint( utilities_FortranMatrix* mtx, const char *fileName) +{ HYPRE_BigInt i, j, h, w, jump; HYPRE_Real* p; @@ -697,20 +803,25 @@ utilities_FortranMatrixPrint( utilities_FortranMatrix* mtx, const char *fileName hypre_assert( mtx != NULL ); - if ( !(fp = fopen(fileName,"w")) ) + if ( !(fp = fopen(fileName, "w")) ) + { return 1; + } h = mtx->height; w = mtx->width; - hypre_fprintf(fp,"%ld\n",h); - hypre_fprintf(fp,"%ld\n",w); + hypre_fprintf(fp, "%ld\n", h); + hypre_fprintf(fp, "%ld\n", w); jump = mtx->globalHeight - h; - for ( j = 0, p = mtx->value; j < w; j++ ) { + for ( j = 0, p = mtx->value; j < w; j++ ) + { for ( i = 0; i < h; i++, p++ ) - hypre_fprintf(fp,"%.14e\n",*p); + { + hypre_fprintf(fp, "%.14e\n", *p); + } p += jump; } diff --git a/external/hypre/src/utilities/fortran_matrix.h b/external/hypre/src/utilities/fortran_matrix.h index 2c6d1bc9..aedd800b 100644 --- a/external/hypre/src/utilities/fortran_matrix.h +++ b/external/hypre/src/utilities/fortran_matrix.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -12,26 +12,26 @@ typedef struct { - HYPRE_BigInt globalHeight; - HYPRE_BigInt height; - HYPRE_BigInt width; - HYPRE_Real* value; - HYPRE_Int ownsValues; + HYPRE_BigInt globalHeight; + HYPRE_BigInt height; + HYPRE_BigInt width; + HYPRE_Real* value; + HYPRE_Int ownsValues; } utilities_FortranMatrix; #ifdef __cplusplus extern "C" { #endif -utilities_FortranMatrix* +utilities_FortranMatrix* utilities_FortranMatrixCreate(void); -void -utilities_FortranMatrixAllocateData( HYPRE_BigInt h, HYPRE_BigInt w, - utilities_FortranMatrix* mtx ); -void -utilities_FortranMatrixWrap( HYPRE_Real*, HYPRE_BigInt gh, HYPRE_BigInt h, HYPRE_BigInt w, - utilities_FortranMatrix* mtx ); -void +void +utilities_FortranMatrixAllocateData( HYPRE_BigInt h, HYPRE_BigInt w, + utilities_FortranMatrix* mtx ); +void +utilities_FortranMatrixWrap( HYPRE_Real*, HYPRE_BigInt gh, HYPRE_BigInt h, HYPRE_BigInt w, + utilities_FortranMatrix* mtx ); +void utilities_FortranMatrixDestroy( utilities_FortranMatrix* mtx ); HYPRE_BigInt @@ -43,65 +43,65 @@ utilities_FortranMatrixWidth( utilities_FortranMatrix* mtx ); HYPRE_Real* utilities_FortranMatrixValues( utilities_FortranMatrix* mtx ); -void +void utilities_FortranMatrixClear( utilities_FortranMatrix* mtx ); -void +void utilities_FortranMatrixClearL( utilities_FortranMatrix* mtx ); -void +void utilities_FortranMatrixSetToIdentity( utilities_FortranMatrix* mtx ); -void +void utilities_FortranMatrixTransposeSquare( utilities_FortranMatrix* mtx ); -void +void utilities_FortranMatrixSymmetrize( utilities_FortranMatrix* mtx ); -void -utilities_FortranMatrixCopy( utilities_FortranMatrix* src, HYPRE_Int t, - utilities_FortranMatrix* dest ); -void -utilities_FortranMatrixIndexCopy( HYPRE_Int* index, - utilities_FortranMatrix* src, HYPRE_Int t, - utilities_FortranMatrix* dest ); - -void -utilities_FortranMatrixSetDiagonal( utilities_FortranMatrix* mtx, - utilities_FortranMatrix* d ); -void -utilities_FortranMatrixGetDiagonal( utilities_FortranMatrix* mtx, - utilities_FortranMatrix* d ); -void -utilities_FortranMatrixAdd( HYPRE_Real a, - utilities_FortranMatrix* mtxA, - utilities_FortranMatrix* mtxB, - utilities_FortranMatrix* mtxC ); -void -utilities_FortranMatrixDMultiply( utilities_FortranMatrix* d, - utilities_FortranMatrix* mtx ); -void -utilities_FortranMatrixMultiplyD( utilities_FortranMatrix* mtx, - utilities_FortranMatrix* d ); -void -utilities_FortranMatrixMultiply( utilities_FortranMatrix* mtxA, HYPRE_Int tA, - utilities_FortranMatrix* mtxB, HYPRE_Int tB, - utilities_FortranMatrix* mtxC ); -HYPRE_Real +void +utilities_FortranMatrixCopy( utilities_FortranMatrix* src, HYPRE_Int t, + utilities_FortranMatrix* dest ); +void +utilities_FortranMatrixIndexCopy( HYPRE_Int* index, + utilities_FortranMatrix* src, HYPRE_Int t, + utilities_FortranMatrix* dest ); + +void +utilities_FortranMatrixSetDiagonal( utilities_FortranMatrix* mtx, + utilities_FortranMatrix* d ); +void +utilities_FortranMatrixGetDiagonal( utilities_FortranMatrix* mtx, + utilities_FortranMatrix* d ); +void +utilities_FortranMatrixAdd( HYPRE_Real a, + utilities_FortranMatrix* mtxA, + utilities_FortranMatrix* mtxB, + utilities_FortranMatrix* mtxC ); +void +utilities_FortranMatrixDMultiply( utilities_FortranMatrix* d, + utilities_FortranMatrix* mtx ); +void +utilities_FortranMatrixMultiplyD( utilities_FortranMatrix* mtx, + utilities_FortranMatrix* d ); +void +utilities_FortranMatrixMultiply( utilities_FortranMatrix* mtxA, HYPRE_Int tA, + utilities_FortranMatrix* mtxB, HYPRE_Int tB, + utilities_FortranMatrix* mtxC ); +HYPRE_Real utilities_FortranMatrixFNorm( utilities_FortranMatrix* mtx ); -HYPRE_Real -utilities_FortranMatrixValue( utilities_FortranMatrix* mtx, - HYPRE_BigInt i, HYPRE_BigInt j ); -HYPRE_Real* -utilities_FortranMatrixValuePtr( utilities_FortranMatrix* mtx, - HYPRE_BigInt i, HYPRE_BigInt j ); -HYPRE_Real +HYPRE_Real +utilities_FortranMatrixValue( utilities_FortranMatrix* mtx, + HYPRE_BigInt i, HYPRE_BigInt j ); +HYPRE_Real* +utilities_FortranMatrixValuePtr( utilities_FortranMatrix* mtx, + HYPRE_BigInt i, HYPRE_BigInt j ); +HYPRE_Real utilities_FortranMatrixMaxValue( utilities_FortranMatrix* mtx ); -void +void utilities_FortranMatrixSelectBlock( utilities_FortranMatrix* mtx, - HYPRE_BigInt iFrom, HYPRE_BigInt iTo, - HYPRE_BigInt jFrom, HYPRE_BigInt jTo, - utilities_FortranMatrix* block ); -void + HYPRE_BigInt iFrom, HYPRE_BigInt iTo, + HYPRE_BigInt jFrom, HYPRE_BigInt jTo, + utilities_FortranMatrix* block ); +void utilities_FortranMatrixUpperInv( utilities_FortranMatrix* u ); HYPRE_Int diff --git a/external/hypre/src/utilities/functors.h b/external/hypre/src/utilities/functors.h new file mode 100644 index 00000000..c721696e --- /dev/null +++ b/external/hypre/src/utilities/functors.h @@ -0,0 +1,100 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#ifndef HYPRE_FUNCTORS_H +#define HYPRE_FUNCTORS_H + +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + +/*-------------------------------------------------------------------------- + * hypreFunctor_DenseMatrixIdentity + * + * Functor for generating a dense identity matrix. + * This assumes that the input array "a" is zeros everywhere + *--------------------------------------------------------------------------*/ + +struct hypreFunctor_DenseMatrixIdentity +{ + HYPRE_Int n_; + HYPRE_Real *a_; + + hypreFunctor_DenseMatrixIdentity(HYPRE_Int n, HYPRE_Real *a) + { + n_ = n; + a_ = a; + } + + __host__ __device__ void operator()(HYPRE_Int i) + { + a_[i * n_ + i] = 1.0; + } +}; + +/*-------------------------------------------------------------------------- + * hypreFunctor_ArrayStridedAccess + * + * Functor for performing strided data access on a templated array. + * + * The stride interval "s_" is used to access every "s_"-th element + * from the source array "a_". + * + * It is templated to support various data types for the array. + *--------------------------------------------------------------------------*/ + +template +struct hypreFunctor_ArrayStridedAccess +{ + HYPRE_Int s_; + T *a_; + + hypreFunctor_ArrayStridedAccess(HYPRE_Int s, T *a) : s_(s), a_(a) {} + + __host__ __device__ T operator()(HYPRE_Int i) + { + return a_[i * s_]; + } +}; + +/*-------------------------------------------------------------------------- + * hypreFunctor_IndexStrided + * + * This functor multiplies a given index "i" by a specified stride "s_". + * + * It is templated to support various data types for the index and stride. + *--------------------------------------------------------------------------*/ + +template +struct hypreFunctor_IndexStrided +{ + T s_; + + hypreFunctor_IndexStrided(T s) : s_(s) {} + + __host__ __device__ T operator()(const T i) const + { + return i * s_; + } +}; + +/*-------------------------------------------------------------------------- + * hypreFunctor_IndexCycle + *--------------------------------------------------------------------------*/ + +struct hypreFunctor_IndexCycle +{ + HYPRE_Int cycle_length; + + hypreFunctor_IndexCycle(HYPRE_Int _cycle_length) : cycle_length(_cycle_length) {} + + __host__ __device__ HYPRE_Int operator()(HYPRE_Int i) const + { + return i % cycle_length; + } +}; + +#endif /* if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) */ +#endif /* ifndef HYPRE_FUNCTORS_H */ diff --git a/external/hypre/src/utilities/general.c b/external/hypre/src/utilities/general.c index 1f132110..e6de9e48 100644 --- a/external/hypre/src/utilities/general.c +++ b/external/hypre/src/utilities/general.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -8,22 +8,6 @@ #include "_hypre_utilities.h" #include "_hypre_utilities.hpp" -#ifdef HYPRE_USING_MEMORY_TRACKER -hypre_MemoryTracker *_hypre_memory_tracker = NULL; - -/* accessor to the global ``_hypre_memory_tracker'' */ -hypre_MemoryTracker* -hypre_memory_tracker() -{ - if (!_hypre_memory_tracker) - { - _hypre_memory_tracker = hypre_MemoryTrackerCreate(); - } - - return _hypre_memory_tracker; -} -#endif - /* global variable _hypre_handle: * Outside this file, do NOT access it directly, * but use hypre_handle() instead (see handle.h) */ @@ -31,31 +15,46 @@ hypre_Handle *_hypre_handle = NULL; /* accessor to the global ``_hypre_handle'' */ hypre_Handle* -hypre_handle() +hypre_handle(void) { if (!_hypre_handle) { - _hypre_handle = hypre_HandleCreate(); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "ERROR - _hypre_handle is not initialized. Calling HYPRE_Initialize(). All HYPRE_* or hypre_* function calls should occur between HYPRE_Initialize() and HYPRE_Finalize().\n"); + HYPRE_Initialize(); } return _hypre_handle; } hypre_Handle* -hypre_HandleCreate() +hypre_HandleCreate(void) { - hypre_Handle *hypre_handle_ = hypre_CTAlloc(hypre_Handle, 1, HYPRE_MEMORY_HOST); + /* Note: this allocation is done directly with calloc in order to + avoid a segmentation fault when building with HYPRE_USING_UMPIRE_HOST */ + hypre_Handle *hypre_handle_ = (hypre_Handle*) calloc(1, sizeof(hypre_Handle)); + hypre_HandleLogLevel(hypre_handle_) = 0; hypre_HandleMemoryLocation(hypre_handle_) = HYPRE_MEMORY_DEVICE; -#if defined(HYPRE_USING_GPU) +#if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) hypre_HandleDefaultExecPolicy(hypre_handle_) = HYPRE_EXEC_DEVICE; - hypre_HandleStructExecPolicy(hypre_handle_) = HYPRE_EXEC_DEVICE; - hypre_HandleCudaData(hypre_handle_) = hypre_CudaDataCreate(); +#endif + +#if defined(HYPRE_USING_GPU) + hypre_HandleDeviceData(hypre_handle_) = hypre_DeviceDataCreate(); /* Gauss-Seidel: SpTrSV */ hypre_HandleDeviceGSMethod(hypre_handle_) = 1; /* CPU: 0; Cusparse: 1 */ #endif +#if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) +#if defined(HYPRE_USING_GPU_AWARE_MPI) + hypre_HandleUseGpuAwareMPI(hypre_handle_) = 1; +#else + hypre_HandleUseGpuAwareMPI(hypre_handle_) = 0; +#endif +#endif + return hypre_handle_; } @@ -67,11 +66,18 @@ hypre_HandleDestroy(hypre_Handle *hypre_handle_) return hypre_error_flag; } + hypre_TFree(hypre_HandleStructCommRecvBuffer(hypre_handle_), HYPRE_MEMORY_DEVICE); + hypre_TFree(hypre_HandleStructCommSendBuffer(hypre_handle_), HYPRE_MEMORY_DEVICE); #if defined(HYPRE_USING_GPU) - hypre_CudaDataDestroy(hypre_HandleCudaData(hypre_handle_)); + hypre_DeviceDataDestroy(hypre_HandleDeviceData(hypre_handle_)); + hypre_HandleDeviceData(hypre_handle_) = NULL; #endif - hypre_TFree(hypre_handle_, HYPRE_MEMORY_HOST); + /* Deallocate error messages in error handler */ + hypre_error_handler_clear_messages(); + + /* Note: Directly using free since this variable was allocated with calloc */ + free((void*) hypre_handle_); return hypre_error_flag; } @@ -79,31 +85,127 @@ hypre_HandleDestroy(hypre_Handle *hypre_handle_) HYPRE_Int hypre_SetDevice(hypre_int device_id, hypre_Handle *hypre_handle_) { - #if defined(HYPRE_USING_DEVICE_OPENMP) - HYPRE_CUDA_CALL( cudaSetDevice(device_id) ); omp_set_default_device(device_id); -#endif -#if defined(HYPRE_USING_CUDA) +#elif defined(HYPRE_USING_CUDA) HYPRE_CUDA_CALL( cudaSetDevice(device_id) ); -#endif + hypre_HandleDevice(hypre_handle_) = device_id; -#if defined(HYPRE_USING_HIP) +#elif defined(HYPRE_USING_HIP) HYPRE_HIP_CALL( hipSetDevice(device_id) ); + hypre_HandleDevice(hypre_handle_) = device_id; + +#elif defined(HYPRE_USING_SYCL) + if (hypre_handle_) + { + if (!hypre_HandleDevice(hypre_handle_)) + { + /* Note: this enforces "explicit scaling," i.e. we treat each tile of a multi-tile GPU as a separate device */ + sycl::platform platform(sycl::gpu_selector_v); + auto gpu_devices = platform.get_devices(sycl::info::device_type::gpu); + hypre_int n_devices = 0; + hypre_GetDeviceCount(&n_devices); + if (device_id >= n_devices) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "ERROR: SYCL device-ID exceed the number of devices on-node\n"); + } + + hypre_int local_n_devices = 0; + hypre_int i; + for (i = 0; i < gpu_devices.size(); i++) + { + if (local_n_devices == device_id) + { + hypre_HandleDevice(hypre_handle_) = new sycl::device(gpu_devices[i]); + } + local_n_devices++; + } + } + hypre_DeviceDataDeviceMaxWorkGroupSize(hypre_HandleDeviceData(hypre_handle_)) = + hypre_DeviceDataDevice(hypre_HandleDeviceData( + hypre_handle_))->get_info(); + } +#else + HYPRE_UNUSED_VAR(device_id); + HYPRE_UNUSED_VAR(hypre_handle_); #endif + return hypre_error_flag; +} + +HYPRE_Int +hypre_GetDeviceMaxShmemSize(hypre_int device_id, + hypre_int *max_size_ptr, + hypre_int *max_size_optin_ptr) +{ + hypre_int max_size = 0, max_size_optin = 0; + #if defined(HYPRE_USING_GPU) - if (hypre_handle_) + hypre_Handle *handle = hypre_handle(); + + if (!hypre_HandleDeviceMaxShmemPerBlockInited(handle)) { - hypre_HandleCudaDevice(hypre_handle_) = device_id; + if (device_id == -1) + { + hypre_GetDevice(&device_id); + } + +#if defined(HYPRE_USING_CUDA) + HYPRE_CUDA_CALL(cudaDeviceGetAttribute( + &max_size, + cudaDevAttrMaxSharedMemoryPerBlock, + device_id)); + + HYPRE_CUDA_CALL(cudaDeviceGetAttribute( + &max_size_optin, + cudaDevAttrMaxSharedMemoryPerBlockOptin, + device_id)); + +#elif defined(HYPRE_USING_HIP) + HYPRE_HIP_CALL(hipDeviceGetAttribute( + &max_size, + hipDeviceAttributeMaxSharedMemoryPerBlock, + device_id)); + +#elif defined(HYPRE_USING_SYCL) + auto device = *hypre_HandleDevice(hypre_handle()); + max_size = device.get_info(); +#endif + hypre_HandleDeviceMaxShmemPerBlock(handle)[0] = max_size; + hypre_HandleDeviceMaxShmemPerBlock(handle)[1] = max_size_optin; + + hypre_HandleDeviceMaxShmemPerBlockInited(handle) = 1; + } + + if (max_size_ptr) + { + *max_size_ptr = hypre_HandleDeviceMaxShmemPerBlock(handle)[0]; + } + + if (max_size_optin_ptr) + { + *max_size_optin_ptr = hypre_HandleDeviceMaxShmemPerBlock(handle)[1]; + } +#else /* not HYPRE_USING_GPU */ + HYPRE_UNUSED_VAR(device_id); + + if (max_size_ptr) + { + *max_size_ptr = max_size; + } + + if (max_size_optin_ptr) + { + *max_size_optin_ptr = max_size_optin; } #endif return hypre_error_flag; } -/* Note: it doesn't return device_id in hypre_Handle->hypre_CudaData, +/* Note: it doesn't return device_id in hypre_Handle->hypre_DeviceData, * calls API instead. But these two should match at all times */ HYPRE_Int @@ -111,14 +213,24 @@ hypre_GetDevice(hypre_int *device_id) { #if defined(HYPRE_USING_DEVICE_OPENMP) *device_id = omp_get_default_device(); -#endif -#if defined(HYPRE_USING_CUDA) +#elif defined(HYPRE_USING_CUDA) HYPRE_CUDA_CALL( cudaGetDevice(device_id) ); -#endif -#if defined(HYPRE_USING_HIP) +#elif defined(HYPRE_USING_HIP) HYPRE_HIP_CALL( hipGetDevice(device_id) ); + +#elif defined(HYPRE_USING_SYCL) + /* Note - no sycl call to get which device is setup for use (if the user has already setup a device at all) + * Assume the rank/device binding below */ + HYPRE_Int my_id; + hypre_int n_devices; + hypre_MPI_Comm_rank(hypre_MPI_COMM_WORLD, &my_id); + hypre_GetDeviceCount(&n_devices); + (*device_id) = my_id % n_devices; + +#else + *device_id = 0; #endif return hypre_error_flag; @@ -129,32 +241,49 @@ hypre_GetDeviceCount(hypre_int *device_count) { #if defined(HYPRE_USING_DEVICE_OPENMP) *device_count = omp_get_num_devices(); -#endif -#if defined(HYPRE_USING_CUDA) +#elif defined(HYPRE_USING_CUDA) HYPRE_CUDA_CALL( cudaGetDeviceCount(device_count) ); -#endif -#if defined(HYPRE_USING_HIP) +#elif defined(HYPRE_USING_HIP) HYPRE_HIP_CALL( hipGetDeviceCount(device_count) ); + +#elif defined(HYPRE_USING_SYCL) + (*device_count) = 0; + sycl::platform platform(sycl::gpu_selector_v); + auto const& gpu_devices = platform.get_devices(sycl::info::device_type::gpu); + HYPRE_Int i; + for (i = 0; i < gpu_devices.size(); i++) + { + (*device_count)++; + } + +#else + *device_count = 0; #endif return hypre_error_flag; } HYPRE_Int -hypre_GetDeviceLastError() +hypre_GetDeviceLastError(void) { -#if defined(HYPRE_USING_DEVICE_OPENMP) - HYPRE_CUDA_CALL( cudaGetLastError() ); -#endif - #if defined(HYPRE_USING_CUDA) HYPRE_CUDA_CALL( cudaGetLastError() ); -#endif -#if defined(HYPRE_USING_HIP) +#elif defined(HYPRE_USING_HIP) HYPRE_HIP_CALL( hipGetLastError() ); + +#elif defined(HYPRE_USING_SYCL) + try + { + hypre_HandleComputeStream(hypre_handle())->wait_and_throw(); + } + catch (sycl::exception const& e) + { + std::cout << "Caught synchronous SYCL exception:\n" + << e.what() << std::endl; + } #endif return hypre_error_flag; @@ -167,22 +296,15 @@ hypre_GetDeviceLastError() *****************************************************************************/ HYPRE_Int -HYPRE_Init() +HYPRE_DeviceInitialize(void) { -#ifdef HYPRE_USING_MEMORY_TRACKER - if (!_hypre_memory_tracker) - { - _hypre_memory_tracker = hypre_MemoryTrackerCreate(); - } -#endif - - if (!_hypre_handle) - { - _hypre_handle = hypre_HandleCreate(); - } +#if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) + hypre_Handle *handle = hypre_handle(); -#if defined(HYPRE_USING_GPU) +#if !defined(HYPRE_USING_SYCL) + /* With sycl, cannot call hypre_GetDeviceLastError() until after device and queue setup */ hypre_GetDeviceLastError(); +#endif /* Notice: the cudaStream created is specific to the device * that was in effect when you created the stream. @@ -190,290 +312,214 @@ HYPRE_Init() */ hypre_int device_id; hypre_GetDevice(&device_id); - hypre_SetDevice(device_id, _hypre_handle); + hypre_SetDevice(device_id, handle); + + hypre_GetDeviceMaxShmemSize(device_id, NULL, NULL); + +#if defined(HYPRE_USING_DEVICE_MALLOC_ASYNC) + cudaMemPool_t mempool; + cudaDeviceGetDefaultMemPool(&mempool, device_id); + uint64_t threshold = UINT64_MAX; + cudaMemPoolSetAttribute(mempool, cudaMemPoolAttrReleaseThreshold, &threshold); +#endif /* To include the cost of creating streams/cudahandles in HYPRE_Init */ /* If not here, will be done at the first use */ - hypre_HandleCudaComputeStream(_hypre_handle); +#if defined(HYPRE_USING_CUDA_STREAMS) + hypre_HandleComputeStream(handle); +#endif /* A separate stream for prefetching */ - //hypre_HandleCudaPrefetchStream(_hypre_handle); -#endif // HYPRE_USING_GPU + //hypre_HandleCudaPrefetchStream(handle); #if defined(HYPRE_USING_CUBLAS) - hypre_HandleCublasHandle(_hypre_handle); + hypre_HandleCublasHandle(handle); #endif #if defined(HYPRE_USING_CUSPARSE) || defined(HYPRE_USING_ROCSPARSE) - hypre_HandleCusparseHandle(_hypre_handle); + hypre_HandleCusparseHandle(handle); #endif #if defined(HYPRE_USING_CURAND) || defined(HYPRE_USING_ROCRAND) - hypre_HandleCurandGenerator(_hypre_handle); + hypre_HandleCurandGenerator(handle); #endif - /* Check if cuda arch flags in compiling match the device */ -#if defined(HYPRE_USING_CUDA) - hypre_CudaCompileFlagCheck(); +#if defined(HYPRE_USING_CUSOLVER) || defined(HYPRE_USING_ROCSOLVER) + hypre_HandleVendorSolverHandle(handle); #endif -#if defined(HYPRE_USING_DEVICE_OPENMP) - HYPRE_OMPOffloadOn(); + /* Check if cuda arch flags in compiling match the device */ +#if defined(HYPRE_USING_CUDA) && defined(HYPRE_DEBUG) + hypre_CudaCompileFlagCheck(); #endif -#ifdef HYPRE_USING_DEVICE_POOL - /* Keep this check here at the end of HYPRE_Init() - * Make sure that device pool allocator has not been setup in HYPRE_Init, +#if defined(HYPRE_USING_DEVICE_POOL) + /* Keep this check here at the end of HYPRE_Initialize() + * Make sure that device pool allocator has not been setup in HYPRE_Initialize, * otherwise users are not able to set all the parameters */ - if ( hypre_HandleCubDevAllocator(_hypre_handle) || - hypre_HandleCubUvmAllocator(_hypre_handle) ) + if ( hypre_HandleCubDevAllocator(handle) || + hypre_HandleCubUvmAllocator(handle) ) { char msg[256]; hypre_sprintf(msg, "%s %s", "ERROR: device pool allocators have been created in", __func__); - hypre_fprintf(stderr, "%s\n", msg); hypre_error_w_msg(-1, msg); } #endif -#if defined(HYPRE_USING_UMPIRE) - hypre_UmpireInit(_hypre_handle); -#endif +#endif /* if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) */ return hypre_error_flag; } -/****************************************************************************** - * - * hypre finalization - * - *****************************************************************************/ - HYPRE_Int -HYPRE_Finalize() +HYPRE_Initialize(void) { -#if defined(HYPRE_USING_UMPIRE) - hypre_UmpireFinalize(_hypre_handle); -#endif - - hypre_HandleDestroy(_hypre_handle); - - _hypre_handle = NULL; - - hypre_GetDeviceLastError(); + /* Return if the hypre library is in initialized state */ + if (hypre_Initialized()) + { + return hypre_error_flag; + } -#ifdef HYPRE_USING_MEMORY_TRACKER - hypre_PrintMemoryTracker(); - hypre_MemoryTrackerDestroy(_hypre_memory_tracker); +#if defined(HYPRE_USING_MEMORY_TRACKER) + if (!_hypre_memory_tracker) + { + _hypre_memory_tracker = hypre_MemoryTrackerCreate(); + } #endif - return hypre_error_flag; -} + if (!_hypre_handle) + { + _hypre_handle = hypre_HandleCreate(); + } -HYPRE_Int -HYPRE_PrintDeviceInfo() -{ #if defined(HYPRE_USING_DEVICE_OPENMP) - hypre_int dev; - struct cudaDeviceProp deviceProp; - - HYPRE_CUDA_CALL( cudaGetDevice(&dev) ); - HYPRE_CUDA_CALL( cudaGetDeviceProperties(&deviceProp, dev) ); - hypre_printf("Running on \"%s\", major %d, minor %d, total memory %.2f GB\n", deviceProp.name, deviceProp.major, deviceProp.minor, deviceProp.totalGlobalMem/1e9); + HYPRE_OMPOffloadOn(); #endif -#if defined(HYPRE_USING_CUDA) - hypre_int dev; - struct cudaDeviceProp deviceProp; - - HYPRE_CUDA_CALL( cudaGetDevice(&dev) ); - HYPRE_CUDA_CALL( cudaGetDeviceProperties(&deviceProp, dev) ); - hypre_printf("Running on \"%s\", major %d, minor %d, total memory %.2f GB\n", deviceProp.name, deviceProp.major, deviceProp.minor, deviceProp.totalGlobalMem/1e9); +#if defined(HYPRE_USING_UMPIRE) + hypre_UmpireInit(_hypre_handle); #endif -#if defined(HYPRE_USING_HIP) - hypre_int dev; - hipDeviceProp_t deviceProp; - - HYPRE_HIP_CALL( hipGetDevice(&dev) ); - HYPRE_HIP_CALL( hipGetDeviceProperties(&deviceProp, dev) ); - hypre_printf("Running on \"%s\", major %d, minor %d, total memory %.2f GB\n", deviceProp.name, deviceProp.major, deviceProp.minor, deviceProp.totalGlobalMem/1e9); +#if defined(HYPRE_USING_MAGMA) + hypre_MagmaInitialize(); #endif + /* Update library state */ + hypre_SetInitialized(); + return hypre_error_flag; } /****************************************************************************** * - * hypre Umpire + * hypre finalization * *****************************************************************************/ -#if defined(HYPRE_USING_UMPIRE) HYPRE_Int -hypre_UmpireInit(hypre_Handle *hypre_handle_) +HYPRE_Finalize(void) { - umpire_resourcemanager_get_instance(&hypre_HandleUmpireResourceMan(hypre_handle_)); - - hypre_HandleUmpireDevicePoolSize(hypre_handle_) = 4LL * 1024 * 1024 * 1024; - hypre_HandleUmpireUMPoolSize(hypre_handle_) = 4LL * 1024 * 1024 * 1024; - hypre_HandleUmpireHostPoolSize(hypre_handle_) = 4LL * 1024 * 1024 * 1024; - hypre_HandleUmpirePinnedPoolSize(hypre_handle_) = 4LL * 1024 * 1024 * 1024; - - hypre_HandleUmpireBlockSize(hypre_handle_) = 512; - - strcpy(hypre_HandleUmpireDevicePoolName(hypre_handle_), "HYPRE_DEVICE_POOL"); - strcpy(hypre_HandleUmpireUMPoolName(hypre_handle_), "HYPRE_UM_POOL"); - strcpy(hypre_HandleUmpireHostPoolName(hypre_handle_), "HYPRE_HOST_POOL"); - strcpy(hypre_HandleUmpirePinnedPoolName(hypre_handle_), "HYPRE_PINNED_POOL"); - - hypre_HandleOwnUmpireDevicePool(hypre_handle_) = 0; - hypre_HandleOwnUmpireUMPool(hypre_handle_) = 0; - hypre_HandleOwnUmpireHostPool(hypre_handle_) = 0; - hypre_HandleOwnUmpirePinnedPool(hypre_handle_) = 0; - - return hypre_error_flag; -} - -HYPRE_Int -hypre_UmpireFinalize(hypre_Handle *hypre_handle_) -{ - umpire_resourcemanager *rm_ptr = &hypre_HandleUmpireResourceMan(hypre_handle_); - umpire_allocator allocator; - -#if defined(HYPRE_USING_UMPIRE_HOST) - if (hypre_HandleOwnUmpireHostPool(hypre_handle_)) + /* Return if the hypre library has already been finalized */ + if (hypre_Finalized()) { - const char *pool_name = hypre_HandleUmpireHostPoolName(hypre_handle_); - umpire_resourcemanager_get_allocator_by_name(rm_ptr, pool_name, &allocator); - umpire_allocator_release(&allocator); + return hypre_error_flag; } -#endif -#if defined(HYPRE_USING_UMPIRE_DEVICE) - if (hypre_HandleOwnUmpireDevicePool(hypre_handle_)) - { - const char *pool_name = hypre_HandleUmpireDevicePoolName(hypre_handle_); - umpire_resourcemanager_get_allocator_by_name(rm_ptr, pool_name, &allocator); - umpire_allocator_release(&allocator); - } +#if defined(HYPRE_USING_UMPIRE) + hypre_UmpireFinalize(_hypre_handle); #endif -#if defined(HYPRE_USING_UMPIRE_UM) - if (hypre_HandleOwnUmpireUMPool(hypre_handle_)) - { - const char *pool_name = hypre_HandleUmpireUMPoolName(hypre_handle_); - umpire_resourcemanager_get_allocator_by_name(rm_ptr, pool_name, &allocator); - umpire_allocator_release(&allocator); - } +#if defined(HYPRE_USING_MAGMA) + hypre_MagmaFinalize(); #endif -#if defined(HYPRE_USING_UMPIRE_PINNED) - if (hypre_HandleOwnUmpirePinnedPool(hypre_handle_)) - { - const char *pool_name = hypre_HandleUmpirePinnedPoolName(hypre_handle_); - umpire_resourcemanager_get_allocator_by_name(rm_ptr, pool_name, &allocator); - umpire_allocator_release(&allocator); - } +#if defined(HYPRE_USING_SYCL) + /* With sycl, cannot call hypre_GetDeviceLastError() after destroying the handle, so do it here */ + hypre_GetDeviceLastError(); #endif - return hypre_error_flag; -} - -HYPRE_Int -HYPRE_SetUmpireDevicePoolSize(size_t nbytes) -{ - hypre_HandleUmpireDevicePoolSize(hypre_handle()) = nbytes; - - return hypre_error_flag; -} - -HYPRE_Int -HYPRE_SetUmpireUMPoolSize(size_t nbytes) -{ - hypre_HandleUmpireUMPoolSize(hypre_handle()) = nbytes; - - return hypre_error_flag; -} - -HYPRE_Int -HYPRE_SetUmpireHostPoolSize(size_t nbytes) -{ - hypre_HandleUmpireHostPoolSize(hypre_handle()) = nbytes; - - return hypre_error_flag; -} - -HYPRE_Int -HYPRE_SetUmpirePinnedPoolSize(size_t nbytes) -{ - hypre_HandleUmpirePinnedPoolSize(hypre_handle()) = nbytes; + hypre_HandleDestroy(_hypre_handle); + _hypre_handle = NULL; - return hypre_error_flag; -} +#if !defined(HYPRE_USING_SYCL) + hypre_GetDeviceLastError(); +#endif -HYPRE_Int -HYPRE_SetUmpireDevicePoolName(const char *pool_name) -{ - if (strlen(pool_name) > HYPRE_UMPIRE_POOL_NAME_MAX_LEN) - { - hypre_error_in_arg(1); +#if defined(HYPRE_USING_MEMORY_TRACKER) + hypre_PrintMemoryTracker(hypre_total_bytes, hypre_peak_bytes, hypre_current_bytes, + hypre_memory_tracker_print, hypre_memory_tracker_filename); - return hypre_error_flag; - } + hypre_MemoryTrackerDestroy(_hypre_memory_tracker); + _hypre_memory_tracker = NULL; +#endif - strcpy(hypre_HandleUmpireDevicePoolName(hypre_handle()), pool_name); + /* Update library state */ + hypre_SetFinalized(); return hypre_error_flag; } HYPRE_Int -HYPRE_SetUmpireUMPoolName(const char *pool_name) +HYPRE_PrintDeviceInfo(void) { - if (strlen(pool_name) > HYPRE_UMPIRE_POOL_NAME_MAX_LEN) - { - hypre_error_in_arg(1); +#if defined(HYPRE_USING_GPU) + hypre_int dev = 0; +#endif - return hypre_error_flag; - } +#if defined(HYPRE_USING_CUDA) + struct cudaDeviceProp deviceProp; + + HYPRE_CUDA_CALL( cudaGetDevice(&dev) ); + HYPRE_CUDA_CALL( cudaGetDeviceProperties(&deviceProp, dev) ); + hypre_printf("Running on \"%s\", major %d, minor %d, total memory %.2f GiB\n", deviceProp.name, + deviceProp.major, deviceProp.minor, deviceProp.totalGlobalMem / (1 << 30)); + +#elif defined(HYPRE_USING_HIP) + hipDeviceProp_t deviceProp; + + HYPRE_HIP_CALL( hipGetDevice(&dev) ); + HYPRE_HIP_CALL( hipGetDeviceProperties(&deviceProp, dev) ); + hypre_printf("Running on \"%s\", major %d, minor %d, total memory %.2f GiB\n", deviceProp.name, + deviceProp.major, deviceProp.minor, deviceProp.totalGlobalMem / (1 << 30)); + +#elif defined(HYPRE_USING_SYCL) + auto device = *hypre_HandleDevice(hypre_handle()); + auto p_name = device.get_platform().get_info(); + hypre_printf("Platform Name: %s\n", p_name.c_str()); + auto p_version = device.get_platform().get_info(); + hypre_printf("Platform Version: %s\n", p_version.c_str()); + auto d_name = device.get_info(); + hypre_printf("Device Name: %s\n", d_name.c_str()); + auto max_work_group = device.get_info(); + hypre_printf("Max Work Groups: %d\n", max_work_group); + auto max_compute_units = device.get_info(); + hypre_printf("Max Compute Units: %d\n", max_compute_units); +#endif - strcpy(hypre_HandleUmpireUMPoolName(hypre_handle()), pool_name); +#if defined(HYPRE_USING_GPU) + hypre_int max_size = 0, max_size_optin = 0; + hypre_GetDeviceMaxShmemSize(dev, &max_size, &max_size_optin); + hypre_printf("MaxSharedMemoryPerBlock %d, MaxSharedMemoryPerBlockOptin %d\n", + max_size, max_size_optin); +#endif return hypre_error_flag; } -HYPRE_Int -HYPRE_SetUmpireHostPoolName(const char *pool_name) -{ - if (strlen(pool_name) > HYPRE_UMPIRE_POOL_NAME_MAX_LEN) - { - hypre_error_in_arg(1); - - return hypre_error_flag; - } - - strcpy(hypre_HandleUmpireHostPoolName(hypre_handle()), pool_name); - - return hypre_error_flag; -} +/*-------------------------------------------------------------------------- + * HYPRE_MemoryPrintUsage + *--------------------------------------------------------------------------*/ HYPRE_Int -HYPRE_SetUmpirePinnedPoolName(const char *pool_name) +HYPRE_MemoryPrintUsage(MPI_Comm comm, + HYPRE_Int level, + const char *function, + HYPRE_Int line) { - if (strlen(pool_name) > HYPRE_UMPIRE_POOL_NAME_MAX_LEN) - { - hypre_error_in_arg(1); - - return hypre_error_flag; - } - - strcpy(hypre_HandleUmpirePinnedPoolName(hypre_handle()), pool_name); - - return hypre_error_flag; + return hypre_MemoryPrintUsage(comm, level, function, line); } -#endif /* #if defined(HYPRE_USING_UMPIRE) */ - /****************************************************************************** * * HYPRE memory location @@ -510,14 +556,6 @@ HYPRE_SetExecutionPolicy(HYPRE_ExecutionPolicy exec_policy) return hypre_error_flag; } -HYPRE_Int -HYPRE_SetStructExecutionPolicy(HYPRE_ExecutionPolicy exec_policy) -{ - hypre_HandleStructExecPolicy(hypre_handle()) = exec_policy; - - return hypre_error_flag; -} - HYPRE_Int HYPRE_GetExecutionPolicy(HYPRE_ExecutionPolicy *exec_policy) { @@ -526,11 +564,30 @@ HYPRE_GetExecutionPolicy(HYPRE_ExecutionPolicy *exec_policy) return hypre_error_flag; } -HYPRE_Int -HYPRE_GetStructExecutionPolicy(HYPRE_ExecutionPolicy *exec_policy) +const char* +HYPRE_GetExecutionPolicyName(HYPRE_ExecutionPolicy exec_policy) { - *exec_policy = hypre_HandleStructExecPolicy(hypre_handle()); + switch (exec_policy) + { + case HYPRE_EXEC_HOST: + return "Host"; - return hypre_error_flag; + case HYPRE_EXEC_DEVICE: +#if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) +#if defined(HYPRE_USING_CUDA) + return "Device (CUDA)"; +#elif defined(HYPRE_USING_HIP) + return "Device (HIP)"; +#elif defined(HYPRE_USING_SYCL) + return "Device (SYCL)"; +#else + return "Device (OpenMP)"; +#endif +#else + return "Host"; +#endif + case HYPRE_EXEC_UNDEFINED: + default: + return "Undefined"; + } } - diff --git a/external/hypre/src/utilities/general.h b/external/hypre/src/utilities/general.h index 8a89948f..fb48c781 100644 --- a/external/hypre/src/utilities/general.h +++ b/external/hypre/src/utilities/general.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -14,16 +14,48 @@ #ifndef hypre_GENERAL_HEADER #define hypre_GENERAL_HEADER +/* #include */ +/* #include */ +#include +#include +#include + +/*-------------------------------------------------------------------------- + * typedefs + *--------------------------------------------------------------------------*/ + /* This allows us to consistently avoid 'int' throughout hypre */ typedef int hypre_int; typedef long int hypre_longint; typedef unsigned int hypre_uint; typedef unsigned long int hypre_ulongint; typedef unsigned long long int hypre_ulonglongint; +typedef uint32_t hypre_uint32; +typedef uint64_t hypre_uint64; -/* This allows us to consistently avoid 'double' throughout hypre */ +/* This allows us to consistently avoid 'float' and 'double' throughout hypre */ +typedef float hypre_float; typedef double hypre_double; +/*-------------------------------------------------------------------------- + * Define macros + *--------------------------------------------------------------------------*/ + +/* Macro for silencing unused function warning */ +#if defined(__GNUC__) || defined(__clang__) +#define HYPRE_MAYBE_UNUSED_FUNC __attribute__((unused)) +#elif defined(_MSC_VER) +#define HYPRE_MAYBE_UNUSED_FUNC +#else +#define HYPRE_MAYBE_UNUSED_FUNC +#endif + +/* Macro for silencing unused variable warning */ +#define HYPRE_UNUSED_VAR(var) ((void) var) + +/* Macro for marking deprecated functions */ +#define HYPRE_DEPRECATED(reason) _Pragma(reason) + /*-------------------------------------------------------------------------- * Define various functions *--------------------------------------------------------------------------*/ @@ -47,5 +79,114 @@ typedef double hypre_double; #define hypre_pow2(i) ( 1 << (i) ) #endif -#endif /* hypre_GENERAL_HEADER */ +#ifndef hypre_squared +#define hypre_squared(i) ((i) * (i)) +#endif + +#ifndef hypre_sqrt +#if defined(HYPRE_SINGLE) +#define hypre_sqrt sqrtf +#elif defined(HYPRE_LONG_DOUBLE) +#define hypre_sqrt sqrtl +#else +#define hypre_sqrt sqrt +#endif +#endif + +#ifndef hypre_pow +#if defined(HYPRE_SINGLE) +#define hypre_pow powf +#elif defined(HYPRE_LONG_DOUBLE) +#define hypre_pow powl +#else +#define hypre_pow pow +#endif +#endif + +/* Macro for ceiling division. It assumes non-negative dividend and positive divisor. + The result of this macro might need to be casted to an integer type depending on the use case */ +#ifndef hypre_ceildiv +#define hypre_ceildiv(a, b) (((a) + (b) - 1) / (b)) +#endif + +#ifndef hypre_ceil +#if defined(HYPRE_SINGLE) +#define hypre_ceil ceilf +#elif defined(HYPRE_LONG_DOUBLE) +#define hypre_ceil ceill +#else +#define hypre_ceil ceil +#endif +#endif + +#ifndef hypre_floor +#if defined(HYPRE_SINGLE) +#define hypre_floor floorf +#elif defined(HYPRE_LONG_DOUBLE) +#define hypre_floor floorl +#else +#define hypre_floor floor +#endif +#endif + +#ifndef hypre_log +#if defined(HYPRE_SINGLE) +#define hypre_log logf +#elif defined(HYPRE_LONG_DOUBLE) +#define hypre_log logl +#else +#define hypre_log log +#endif +#endif + +#ifndef hypre_exp +#if defined(HYPRE_SINGLE) +#define hypre_exp expf +#elif defined(HYPRE_LONG_DOUBLE) +#define hypre_exp expl +#else +#define hypre_exp exp +#endif +#endif +#ifndef hypre_sin +#if defined(HYPRE_SINGLE) +#define hypre_sin sinf +#elif defined(HYPRE_LONG_DOUBLE) +#define hypre_sin sinl +#else +#define hypre_sin sin +#endif +#endif + +#ifndef hypre_cos +#if defined(HYPRE_SINGLE) +#define hypre_cos cosf +#elif defined(HYPRE_LONG_DOUBLE) +#define hypre_cos cosl +#else +#define hypre_cos cos +#endif +#endif + +#ifndef hypre_atan +#if defined(HYPRE_SINGLE) +#define hypre_atan atanf +#elif defined(HYPRE_LONG_DOUBLE) +#define hypre_atan atanl +#else +#define hypre_atan atan +#endif +#endif + +#ifndef hypre_fmod +#if defined(HYPRE_SINGLE) +#define hypre_fmod fmodf +#elif defined(HYPRE_LONG_DOUBLE) +#define hypre_fmod fmodl +#else +#define hypre_fmod fmod +#endif +#endif + +#endif /* hypre_GENERAL_HEADER */ diff --git a/external/hypre/src/utilities/gselim.h b/external/hypre/src/utilities/gselim.h index 9bffd54a..cca92ba9 100644 --- a/external/hypre/src/utilities/gselim.h +++ b/external/hypre/src/utilities/gselim.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/utilities/handle.c b/external/hypre/src/utilities/handle.c index 4f484080..8abaf30b 100644 --- a/external/hypre/src/utilities/handle.c +++ b/external/hypre/src/utilities/handle.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -14,16 +14,70 @@ #include "_hypre_utilities.h" #include "_hypre_utilities.hpp" -/* GPU SpGemm */ +/*-------------------------------------------------------------------------- + * hypre_SetLogLevel + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SetLogLevel(HYPRE_Int log_level) +{ + hypre_HandleLogLevel(hypre_handle()) = log_level; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_SetSpTransUseVendor + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SetSpTransUseVendor( HYPRE_Int use_vendor ) +{ +#if defined(HYPRE_USING_GPU) + hypre_HandleSpTransUseVendor(hypre_handle()) = use_vendor; +#else + HYPRE_UNUSED_VAR(use_vendor); +#endif + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_SetSpMVUseVendor + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SetSpMVUseVendor( HYPRE_Int use_vendor ) +{ +#if defined(HYPRE_USING_GPU) + hypre_HandleSpMVUseVendor(hypre_handle()) = use_vendor; +#else + HYPRE_UNUSED_VAR(use_vendor); +#endif + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_SetSpGemmUseVendor + *--------------------------------------------------------------------------*/ + HYPRE_Int -hypre_SetSpGemmUseCusparse( HYPRE_Int use_cusparse ) +hypre_SetSpGemmUseVendor( HYPRE_Int use_vendor ) { #if defined(HYPRE_USING_GPU) - hypre_HandleSpgemmUseCusparse(hypre_handle()) = use_cusparse; + hypre_HandleSpgemmUseVendor(hypre_handle()) = use_vendor; +#else + HYPRE_UNUSED_VAR(use_vendor); #endif + return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_SetSpGemmAlgorithm + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_SetSpGemmAlgorithm( HYPRE_Int value ) { @@ -36,10 +90,33 @@ hypre_SetSpGemmAlgorithm( HYPRE_Int value ) { hypre_error_in_arg(1); } +#else + HYPRE_UNUSED_VAR(value); #endif + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_SetSpGemmBinned + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SetSpGemmBinned( HYPRE_Int value ) +{ +#if defined(HYPRE_USING_GPU) + hypre_HandleSpgemmBinned(hypre_handle()) = value; +#else + HYPRE_UNUSED_VAR(value); +#endif + return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_SetSpGemmRownnzEstimateMethod + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_SetSpGemmRownnzEstimateMethod( HYPRE_Int value ) { @@ -52,19 +129,33 @@ hypre_SetSpGemmRownnzEstimateMethod( HYPRE_Int value ) { hypre_error_in_arg(1); } +#else + HYPRE_UNUSED_VAR(value); #endif + return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_SetSpGemmRownnzEstimateNSamples + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_SetSpGemmRownnzEstimateNSamples( HYPRE_Int value ) { #if defined(HYPRE_USING_GPU) hypre_HandleSpgemmRownnzEstimateNsamples(hypre_handle()) = value; +#else + HYPRE_UNUSED_VAR(value); #endif + return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_SetSpGemmRownnzEstimateMultFactor + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_SetSpGemmRownnzEstimateMultFactor( HYPRE_Real value ) { @@ -77,59 +168,102 @@ hypre_SetSpGemmRownnzEstimateMultFactor( HYPRE_Real value ) { hypre_error_in_arg(1); } +#else + HYPRE_UNUSED_VAR(value); #endif - return hypre_error_flag; -} -HYPRE_Int -hypre_SetSpGemmHashType( char value ) -{ -#if defined(HYPRE_USING_GPU) - if (value == 'L' || value == 'Q' || value == 'D') - { - hypre_HandleSpgemmHashType(hypre_handle()) = value; - } - else - { - hypre_error_in_arg(1); - } -#endif return hypre_error_flag; } -/* GPU Rand */ +/*-------------------------------------------------------------------------- + * hypre_SetUseGpuRand + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_SetUseGpuRand( HYPRE_Int use_gpurand ) { #if defined(HYPRE_USING_GPU) hypre_HandleUseGpuRand(hypre_handle()) = use_gpurand; +#else + HYPRE_UNUSED_VAR(use_gpurand); #endif + return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_SetGaussSeidelMethod + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_SetGaussSeidelMethod( HYPRE_Int gs_method ) { #if defined(HYPRE_USING_GPU) hypre_HandleDeviceGSMethod(hypre_handle()) = gs_method; +#else + HYPRE_UNUSED_VAR(gs_method); #endif + return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_SetUserDeviceMalloc + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_SetUserDeviceMalloc(GPUMallocFunc func) { #if defined(HYPRE_USING_GPU) hypre_HandleUserDeviceMalloc(hypre_handle()) = func; +#else + HYPRE_UNUSED_VAR(func); #endif + return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_SetUserDeviceMfree + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_SetUserDeviceMfree(GPUMfreeFunc func) { #if defined(HYPRE_USING_GPU) hypre_HandleUserDeviceMfree(hypre_handle()) = func; +#else + HYPRE_UNUSED_VAR(func); #endif + return hypre_error_flag; } + +/*-------------------------------------------------------------------------- + * hypre_SetGpuAwareMPI + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SetGpuAwareMPI( HYPRE_Int use_gpu_aware_mpi ) +{ +#if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) + hypre_HandleUseGpuAwareMPI(hypre_handle()) = use_gpu_aware_mpi; +#else + HYPRE_UNUSED_VAR(use_gpu_aware_mpi); +#endif + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_GetGpuAwareMPI + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GetGpuAwareMPI(void) +{ +#if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) + return hypre_HandleUseGpuAwareMPI(hypre_handle()); +#else + return 0; +#endif +} diff --git a/external/hypre/src/utilities/handle.h b/external/hypre/src/utilities/handle.h index f46e5b89..7ca8c124 100644 --- a/external/hypre/src/utilities/handle.h +++ b/external/hypre/src/utilities/handle.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -14,20 +14,50 @@ #ifndef HYPRE_HANDLE_H #define HYPRE_HANDLE_H -struct hypre_CudaData; -typedef struct hypre_CudaData hypre_CudaData; +#if defined(HYPRE_USING_UMPIRE) +#include "umpire/config.hpp" +#if UMPIRE_VERSION_MAJOR >= 2022 +#include "umpire/interface/c_fortran/umpire.h" +#define hypre_umpire_resourcemanager_make_allocator_pool umpire_resourcemanager_make_allocator_quick_pool +#else +#include "umpire/interface/umpire.h" +#define hypre_umpire_resourcemanager_make_allocator_pool umpire_resourcemanager_make_allocator_pool +#endif /* UMPIRE_VERSION_MAJOR >= 2022 */ +#define HYPRE_UMPIRE_POOL_NAME_MAX_LEN 1024 +#endif /* defined(HYPRE_USING_UMPIRE) */ + +struct hypre_DeviceData; +typedef struct hypre_DeviceData hypre_DeviceData; +typedef void (*GPUMallocFunc)(void **, size_t); +typedef void (*GPUMfreeFunc)(void *); typedef struct { + HYPRE_Int log_level; HYPRE_Int hypre_error; HYPRE_MemoryLocation memory_location; HYPRE_ExecutionPolicy default_exec_policy; - HYPRE_ExecutionPolicy struct_exec_policy; + + /* the device buffers needed to do MPI communication for struct comm */ + HYPRE_Complex *struct_comm_recv_buffer; + HYPRE_Complex *struct_comm_send_buffer; + HYPRE_Int struct_comm_recv_buffer_size; + HYPRE_Int struct_comm_send_buffer_size; + + /* GPU MPI */ +#if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) + HYPRE_Int use_gpu_aware_mpi; +#endif + #if defined(HYPRE_USING_GPU) - hypre_CudaData *cuda_data; - /* device G-S options */ - HYPRE_Int device_gs_method; + hypre_DeviceData *device_data; + HYPRE_Int device_gs_method; /* device G-S options */ #endif + + /* user malloc/free function pointers */ + GPUMallocFunc user_device_malloc; + GPUMfreeFunc user_device_free; + #if defined(HYPRE_USING_UMPIRE) char umpire_device_pool_name[HYPRE_UMPIRE_POOL_NAME_MAX_LEN]; char umpire_um_pool_name[HYPRE_UMPIRE_POOL_NAME_MAX_LEN]; @@ -44,43 +74,56 @@ typedef struct HYPRE_Int own_umpire_pinned_pool; umpire_resourcemanager umpire_rm; #endif - /* user malloc/free function pointers */ - GPUMallocFunc user_device_malloc; - GPUMfreeFunc user_device_free; + +#if defined(HYPRE_USING_MAGMA) + magma_queue_t magma_queue; +#endif } hypre_Handle; /* accessor macros to hypre_Handle */ +#define hypre_HandleLogLevel(hypre_handle) ((hypre_handle) -> log_level) #define hypre_HandleMemoryLocation(hypre_handle) ((hypre_handle) -> memory_location) #define hypre_HandleDefaultExecPolicy(hypre_handle) ((hypre_handle) -> default_exec_policy) -#define hypre_HandleStructExecPolicy(hypre_handle) ((hypre_handle) -> struct_exec_policy) -#define hypre_HandleCudaData(hypre_handle) ((hypre_handle) -> cuda_data) + +#define hypre_HandleStructCommRecvBuffer(hypre_handle) ((hypre_handle) -> struct_comm_recv_buffer) +#define hypre_HandleStructCommSendBuffer(hypre_handle) ((hypre_handle) -> struct_comm_send_buffer) +#define hypre_HandleStructCommRecvBufferSize(hypre_handle) ((hypre_handle) -> struct_comm_recv_buffer_size) +#define hypre_HandleStructCommSendBufferSize(hypre_handle) ((hypre_handle) -> struct_comm_send_buffer_size) + +#define hypre_HandleDeviceData(hypre_handle) ((hypre_handle) -> device_data) #define hypre_HandleDeviceGSMethod(hypre_handle) ((hypre_handle) -> device_gs_method) +#define hypre_HandleUseGpuAwareMPI(hypre_handle) ((hypre_handle) -> use_gpu_aware_mpi) -#define hypre_HandleCurandGenerator(hypre_handle) hypre_CudaDataCurandGenerator(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleCublasHandle(hypre_handle) hypre_CudaDataCublasHandle(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleCusparseHandle(hypre_handle) hypre_CudaDataCusparseHandle(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleCudaComputeStream(hypre_handle) hypre_CudaDataCudaComputeStream(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleCubBinGrowth(hypre_handle) hypre_CudaDataCubBinGrowth(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleCubMinBin(hypre_handle) hypre_CudaDataCubMinBin(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleCubMaxBin(hypre_handle) hypre_CudaDataCubMaxBin(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleCubMaxCachedBytes(hypre_handle) hypre_CudaDataCubMaxCachedBytes(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleCubDevAllocator(hypre_handle) hypre_CudaDataCubDevAllocator(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleCubUvmAllocator(hypre_handle) hypre_CudaDataCubUvmAllocator(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleCudaDevice(hypre_handle) hypre_CudaDataCudaDevice(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleCudaComputeStreamNum(hypre_handle) hypre_CudaDataCudaComputeStreamNum(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleCudaReduceBuffer(hypre_handle) hypre_CudaDataCudaReduceBuffer(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleStructCommRecvBuffer(hypre_handle) hypre_CudaDataStructCommRecvBuffer(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleStructCommSendBuffer(hypre_handle) hypre_CudaDataStructCommSendBuffer(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleStructCommRecvBufferSize(hypre_handle) hypre_CudaDataStructCommRecvBufferSize(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleStructCommSendBufferSize(hypre_handle) hypre_CudaDataStructCommSendBufferSize(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleSpgemmUseCusparse(hypre_handle) hypre_CudaDataSpgemmUseCusparse(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleSpgemmAlgorithm(hypre_handle) hypre_CudaDataSpgemmAlgorithm(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleSpgemmRownnzEstimateMethod(hypre_handle) hypre_CudaDataSpgemmRownnzEstimateMethod(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleSpgemmRownnzEstimateNsamples(hypre_handle) hypre_CudaDataSpgemmRownnzEstimateNsamples(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleSpgemmRownnzEstimateMultFactor(hypre_handle) hypre_CudaDataSpgemmRownnzEstimateMultFactor(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleSpgemmHashType(hypre_handle) hypre_CudaDataSpgemmHashType(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleDeviceAllocator(hypre_handle) hypre_CudaDataDeviceAllocator(hypre_HandleCudaData(hypre_handle)) -#define hypre_HandleUseGpuRand(hypre_handle) hypre_CudaDataUseGpuRand(hypre_HandleCudaData(hypre_handle)) +#define hypre_HandleCurandGenerator(hypre_handle) hypre_DeviceDataCurandGenerator(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleCublasHandle(hypre_handle) hypre_DeviceDataCublasHandle(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleCusparseHandle(hypre_handle) hypre_DeviceDataCusparseHandle(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleVendorSolverHandle(hypre_handle) hypre_DeviceDataVendorSolverHandle(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleComputeStream(hypre_handle) hypre_DeviceDataComputeStream(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleCubBinGrowth(hypre_handle) hypre_DeviceDataCubBinGrowth(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleCubMinBin(hypre_handle) hypre_DeviceDataCubMinBin(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleCubMaxBin(hypre_handle) hypre_DeviceDataCubMaxBin(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleCubMaxCachedBytes(hypre_handle) hypre_DeviceDataCubMaxCachedBytes(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleCubDevAllocator(hypre_handle) hypre_DeviceDataCubDevAllocator(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleCubUvmAllocator(hypre_handle) hypre_DeviceDataCubUvmAllocator(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleDevice(hypre_handle) hypre_DeviceDataDevice(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleDeviceMaxWorkGroupSize(hypre_handle) hypre_DeviceDataDeviceMaxWorkGroupSize(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleDeviceMaxShmemPerBlock(hypre_handle) hypre_DeviceDataDeviceMaxShmemPerBlock(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleDeviceMaxShmemPerBlockInited(hypre_handle) hypre_DeviceDataDeviceMaxShmemPerBlockInited(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleComputeStreamNum(hypre_handle) hypre_DeviceDataComputeStreamNum(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleReduceBuffer(hypre_handle) hypre_DeviceDataReduceBuffer(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleSpgemmUseVendor(hypre_handle) hypre_DeviceDataSpgemmUseVendor(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleSpMVUseVendor(hypre_handle) hypre_DeviceDataSpMVUseVendor(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleSpTransUseVendor(hypre_handle) hypre_DeviceDataSpTransUseVendor(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleSpgemmAlgorithm(hypre_handle) hypre_DeviceDataSpgemmAlgorithm(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleSpgemmBinned(hypre_handle) hypre_DeviceDataSpgemmBinned(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleSpgemmNumBin(hypre_handle) hypre_DeviceDataSpgemmNumBin(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleSpgemmHighestBin(hypre_handle) hypre_DeviceDataSpgemmHighestBin(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleSpgemmBlockNumDim(hypre_handle) hypre_DeviceDataSpgemmBlockNumDim(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleSpgemmRownnzEstimateMethod(hypre_handle) hypre_DeviceDataSpgemmRownnzEstimateMethod(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleSpgemmRownnzEstimateNsamples(hypre_handle) hypre_DeviceDataSpgemmRownnzEstimateNsamples(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleSpgemmRownnzEstimateMultFactor(hypre_handle) hypre_DeviceDataSpgemmRownnzEstimateMultFactor(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleDeviceAllocator(hypre_handle) hypre_DeviceDataDeviceAllocator(hypre_HandleDeviceData(hypre_handle)) +#define hypre_HandleUseGpuRand(hypre_handle) hypre_DeviceDataUseGpuRand(hypre_HandleDeviceData(hypre_handle)) #define hypre_HandleUserDeviceMalloc(hypre_handle) ((hypre_handle) -> user_device_malloc) #define hypre_HandleUserDeviceMfree(hypre_handle) ((hypre_handle) -> user_device_free) @@ -100,4 +143,6 @@ typedef struct #define hypre_HandleOwnUmpireHostPool(hypre_handle) ((hypre_handle) -> own_umpire_host_pool) #define hypre_HandleOwnUmpirePinnedPool(hypre_handle) ((hypre_handle) -> own_umpire_pinned_pool) +#define hypre_HandleMagmaQueue(hypre_handle) ((hypre_handle) -> magma_queue) + #endif diff --git a/external/hypre/src/utilities/headers b/external/hypre/src/utilities/headers old mode 100644 new mode 100755 index 01990752..7de3d3a8 --- a/external/hypre/src/utilities/headers +++ b/external/hypre/src/utilities/headers @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -33,23 +33,29 @@ extern "C" { # Structures and prototypes #=========================================================================== +cat handle.h >> $INTERNAL_HEADER +cat state.h >> $INTERNAL_HEADER cat general.h >> $INTERNAL_HEADER +cat base.h >> $INTERNAL_HEADER +cat magma.h >> $INTERNAL_HEADER +cat matrix_stats.h >> $INTERNAL_HEADER cat printf.h >> $INTERNAL_HEADER cat error.h >> $INTERNAL_HEADER cat mpistubs.h >> $INTERNAL_HEADER cat smp.h >> $INTERNAL_HEADER cat memory.h >> $INTERNAL_HEADER +cat memory_tracker.h >> $INTERNAL_HEADER cat omp_device.h >> $INTERNAL_HEADER cat threading.h >> $INTERNAL_HEADER cat timing.h >> $INTERNAL_HEADER cat amg_linklist.h >> $INTERNAL_HEADER cat exchange_data.h >> $INTERNAL_HEADER cat caliper_instrumentation.h >> $INTERNAL_HEADER -cat handle.h >> $INTERNAL_HEADER cat gselim.h >> $INTERNAL_HEADER cat int_array.h >> $INTERNAL_HEADER cat protos.h >> $INTERNAL_HEADER cat hopscotch_hash.h >> $INTERNAL_HEADER +cat mmio.h >> $INTERNAL_HEADER #=========================================================================== # Include guards @@ -79,6 +85,7 @@ cat > $INTERNAL_HEADER <<@ #ifndef hypre_UTILITIES_HPP #define hypre_UTILITIES_HPP + #ifdef __cplusplus extern "C++" { #endif @@ -89,10 +96,12 @@ extern "C++" { # Structures and prototypes #=========================================================================== -cat device_allocator.h >> $INTERNAL_HEADER -cat cuda_utils.h >> $INTERNAL_HEADER -cat cuda_reducer.h >> $INTERNAL_HEADER -cat cub_allocator.h >> $INTERNAL_HEADER +cat functors.h >> $INTERNAL_HEADER +cat predicates.h >> $INTERNAL_HEADER +cat device_allocator.h >> $INTERNAL_HEADER +cat device_utils.h >> $INTERNAL_HEADER +cat device_reducer.h >> $INTERNAL_HEADER +cat cub_allocator.h >> $INTERNAL_HEADER #=========================================================================== # Include guards @@ -107,4 +116,3 @@ cat >> $INTERNAL_HEADER <<@ #endif @ - diff --git a/external/hypre/src/utilities/hopscotch_hash.c b/external/hypre/src/utilities/hopscotch_hash.c index 0f58378d..b38ed35e 100644 --- a/external/hypre/src/utilities/hopscotch_hash.c +++ b/external/hypre/src/utilities/hopscotch_hash.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -9,35 +9,36 @@ static HYPRE_Int NearestPowerOfTwo( HYPRE_Int value ) { - HYPRE_Int rc = 1; - while (rc < value) { - rc <<= 1; - } - return rc; + HYPRE_Int rc = 1; + while (rc < value) + { + rc <<= 1; + } + return rc; } static void InitBucket(hypre_HopscotchBucket *b) { - b->hopInfo = 0; - b->hash = HYPRE_HOPSCOTCH_HASH_EMPTY; + b->hopInfo = 0; + b->hash = HYPRE_HOPSCOTCH_HASH_EMPTY; } static void InitBigBucket(hypre_BigHopscotchBucket *b) { - b->hopInfo = 0; - b->hash = HYPRE_HOPSCOTCH_HASH_EMPTY; + b->hopInfo = 0; + b->hash = HYPRE_HOPSCOTCH_HASH_EMPTY; } #ifdef HYPRE_CONCURRENT_HOPSCOTCH static void InitSegment(hypre_HopscotchSegment *s) { - s->timestamp = 0; - omp_init_lock(&s->lock); + s->timestamp = 0; + omp_init_lock(&s->lock); } static void DestroySegment(hypre_HopscotchSegment *s) { - omp_destroy_lock(&s->lock); + omp_destroy_lock(&s->lock); } #endif @@ -45,306 +46,306 @@ void hypre_UnorderedIntSetCreate( hypre_UnorderedIntSet *s, HYPRE_Int inCapacity, HYPRE_Int concurrencyLevel) { - s->segmentMask = NearestPowerOfTwo(concurrencyLevel) - 1; - if (inCapacity < s->segmentMask + 1) - { - inCapacity = s->segmentMask + 1; - } + s->segmentMask = NearestPowerOfTwo(concurrencyLevel) - 1; + if (inCapacity < s->segmentMask + 1) + { + inCapacity = s->segmentMask + 1; + } - //ADJUST INPUT ............................ - HYPRE_Int adjInitCap = NearestPowerOfTwo(inCapacity+4096); - HYPRE_Int num_buckets = adjInitCap + HYPRE_HOPSCOTCH_HASH_INSERT_RANGE + 1; - s->bucketMask = adjInitCap - 1; + //ADJUST INPUT ............................ + HYPRE_Int adjInitCap = NearestPowerOfTwo(inCapacity + 4096); + HYPRE_Int num_buckets = adjInitCap + HYPRE_HOPSCOTCH_HASH_INSERT_RANGE + 1; + s->bucketMask = adjInitCap - 1; - HYPRE_Int i; + HYPRE_Int i; - //ALLOCATE THE SEGMENTS ................... + //ALLOCATE THE SEGMENTS ................... #ifdef HYPRE_CONCURRENT_HOPSCOTCH - s->segments = hypre_TAlloc(hypre_HopscotchSegment, s->segmentMask + 1, HYPRE_MEMORY_HOST); - for (i = 0; i <= s->segmentMask; ++i) - { - InitSegment(&s->segments[i]); - } + s->segments = hypre_TAlloc(hypre_HopscotchSegment, s->segmentMask + 1, HYPRE_MEMORY_HOST); + for (i = 0; i <= s->segmentMask; ++i) + { + InitSegment(&s->segments[i]); + } #endif - s->hopInfo = hypre_TAlloc(hypre_uint, num_buckets, HYPRE_MEMORY_HOST); - s->key = hypre_TAlloc(HYPRE_Int, num_buckets, HYPRE_MEMORY_HOST); - s->hash = hypre_TAlloc(HYPRE_Int, num_buckets, HYPRE_MEMORY_HOST); + s->hopInfo = hypre_TAlloc(hypre_uint, num_buckets, HYPRE_MEMORY_HOST); + s->key = hypre_TAlloc(HYPRE_Int, num_buckets, HYPRE_MEMORY_HOST); + s->hash = hypre_TAlloc(HYPRE_Int, num_buckets, HYPRE_MEMORY_HOST); #ifdef HYPRE_CONCURRENT_HOPSCOTCH -#pragma omp parallel for + #pragma omp parallel for #endif - for (i = 0; i < num_buckets; ++i) - { - s->hopInfo[i] = 0; - s->hash[i] = HYPRE_HOPSCOTCH_HASH_EMPTY; - } + for (i = 0; i < num_buckets; ++i) + { + s->hopInfo[i] = 0; + s->hash[i] = HYPRE_HOPSCOTCH_HASH_EMPTY; + } } void hypre_UnorderedBigIntSetCreate( hypre_UnorderedBigIntSet *s, - HYPRE_Int inCapacity, - HYPRE_Int concurrencyLevel) + HYPRE_Int inCapacity, + HYPRE_Int concurrencyLevel) { - s->segmentMask = NearestPowerOfTwo(concurrencyLevel) - 1; - if (inCapacity < s->segmentMask + 1) - { - inCapacity = s->segmentMask + 1; - } + s->segmentMask = NearestPowerOfTwo(concurrencyLevel) - 1; + if (inCapacity < s->segmentMask + 1) + { + inCapacity = s->segmentMask + 1; + } - //ADJUST INPUT ............................ - HYPRE_Int adjInitCap = NearestPowerOfTwo(inCapacity+4096); - HYPRE_Int num_buckets = adjInitCap + HYPRE_HOPSCOTCH_HASH_INSERT_RANGE + 1; - s->bucketMask = adjInitCap - 1; + //ADJUST INPUT ............................ + HYPRE_Int adjInitCap = NearestPowerOfTwo(inCapacity + 4096); + HYPRE_Int num_buckets = adjInitCap + HYPRE_HOPSCOTCH_HASH_INSERT_RANGE + 1; + s->bucketMask = adjInitCap - 1; - HYPRE_Int i; + HYPRE_Int i; - //ALLOCATE THE SEGMENTS ................... + //ALLOCATE THE SEGMENTS ................... #ifdef HYPRE_CONCURRENT_HOPSCOTCH - s->segments = hypre_TAlloc(hypre_HopscotchSegment, s->segmentMask + 1, HYPRE_MEMORY_HOST); - for (i = 0; i <= s->segmentMask; ++i) - { - InitSegment(&s->segments[i]); - } + s->segments = hypre_TAlloc(hypre_HopscotchSegment, s->segmentMask + 1, HYPRE_MEMORY_HOST); + for (i = 0; i <= s->segmentMask; ++i) + { + InitSegment(&s->segments[i]); + } #endif - s->hopInfo = hypre_TAlloc(hypre_uint, num_buckets, HYPRE_MEMORY_HOST); - s->key = hypre_TAlloc(HYPRE_BigInt, num_buckets, HYPRE_MEMORY_HOST); - s->hash = hypre_TAlloc(HYPRE_BigInt, num_buckets, HYPRE_MEMORY_HOST); + s->hopInfo = hypre_TAlloc(hypre_uint, num_buckets, HYPRE_MEMORY_HOST); + s->key = hypre_TAlloc(HYPRE_BigInt, num_buckets, HYPRE_MEMORY_HOST); + s->hash = hypre_TAlloc(HYPRE_BigInt, num_buckets, HYPRE_MEMORY_HOST); #ifdef HYPRE_CONCURRENT_HOPSCOTCH -#pragma omp parallel for + #pragma omp parallel for #endif - for (i = 0; i < num_buckets; ++i) - { - s->hopInfo[i] = 0; - s->hash[i] = HYPRE_HOPSCOTCH_HASH_EMPTY; - } + for (i = 0; i < num_buckets; ++i) + { + s->hopInfo[i] = 0; + s->hash[i] = HYPRE_HOPSCOTCH_HASH_EMPTY; + } } void hypre_UnorderedIntMapCreate( hypre_UnorderedIntMap *m, HYPRE_Int inCapacity, HYPRE_Int concurrencyLevel) { - m->segmentMask = NearestPowerOfTwo(concurrencyLevel) - 1; - if (inCapacity < m->segmentMask + 1) - { - inCapacity = m->segmentMask + 1; - } + m->segmentMask = NearestPowerOfTwo(concurrencyLevel) - 1; + if (inCapacity < m->segmentMask + 1) + { + inCapacity = m->segmentMask + 1; + } - //ADJUST INPUT ............................ - HYPRE_Int adjInitCap = NearestPowerOfTwo(inCapacity+4096); - HYPRE_Int num_buckets = adjInitCap + HYPRE_HOPSCOTCH_HASH_INSERT_RANGE + 1; - m->bucketMask = adjInitCap - 1; + //ADJUST INPUT ............................ + HYPRE_Int adjInitCap = NearestPowerOfTwo(inCapacity + 4096); + HYPRE_Int num_buckets = adjInitCap + HYPRE_HOPSCOTCH_HASH_INSERT_RANGE + 1; + m->bucketMask = adjInitCap - 1; - HYPRE_Int i; + HYPRE_Int i; - //ALLOCATE THE SEGMENTS ................... + //ALLOCATE THE SEGMENTS ................... #ifdef HYPRE_CONCURRENT_HOPSCOTCH - m->segments = hypre_TAlloc(hypre_HopscotchSegment, m->segmentMask + 1, HYPRE_MEMORY_HOST); - for (i = 0; i <= m->segmentMask; i++) - { - InitSegment(&m->segments[i]); - } + m->segments = hypre_TAlloc(hypre_HopscotchSegment, m->segmentMask + 1, HYPRE_MEMORY_HOST); + for (i = 0; i <= m->segmentMask; i++) + { + InitSegment(&m->segments[i]); + } #endif - m->table = hypre_TAlloc(hypre_HopscotchBucket, num_buckets, HYPRE_MEMORY_HOST); + m->table = hypre_TAlloc(hypre_HopscotchBucket, num_buckets, HYPRE_MEMORY_HOST); #ifdef HYPRE_CONCURRENT_HOPSCOTCH -#pragma omp parallel for + #pragma omp parallel for #endif - for (i = 0; i < num_buckets; i++) - { - InitBucket(&m->table[i]); - } + for (i = 0; i < num_buckets; i++) + { + InitBucket(&m->table[i]); + } } void hypre_UnorderedBigIntMapCreate( hypre_UnorderedBigIntMap *m, - HYPRE_Int inCapacity, - HYPRE_Int concurrencyLevel) + HYPRE_Int inCapacity, + HYPRE_Int concurrencyLevel) { - m->segmentMask = NearestPowerOfTwo(concurrencyLevel) - 1; - if (inCapacity < m->segmentMask + 1) - { - inCapacity = m->segmentMask + 1; - } + m->segmentMask = NearestPowerOfTwo(concurrencyLevel) - 1; + if (inCapacity < m->segmentMask + 1) + { + inCapacity = m->segmentMask + 1; + } - //ADJUST INPUT ............................ - HYPRE_Int adjInitCap = NearestPowerOfTwo(inCapacity+4096); - HYPRE_Int num_buckets = adjInitCap + HYPRE_HOPSCOTCH_HASH_INSERT_RANGE + 1; - m->bucketMask = adjInitCap - 1; + //ADJUST INPUT ............................ + HYPRE_Int adjInitCap = NearestPowerOfTwo(inCapacity + 4096); + HYPRE_Int num_buckets = adjInitCap + HYPRE_HOPSCOTCH_HASH_INSERT_RANGE + 1; + m->bucketMask = adjInitCap - 1; - HYPRE_Int i; + HYPRE_Int i; - //ALLOCATE THE SEGMENTS ................... + //ALLOCATE THE SEGMENTS ................... #ifdef HYPRE_CONCURRENT_HOPSCOTCH - m->segments = hypre_TAlloc(hypre_HopscotchSegment, m->segmentMask + 1, HYPRE_MEMORY_HOST); - for (i = 0; i <= m->segmentMask; i++) - { - InitSegment(&m->segments[i]); - } + m->segments = hypre_TAlloc(hypre_HopscotchSegment, m->segmentMask + 1, HYPRE_MEMORY_HOST); + for (i = 0; i <= m->segmentMask; i++) + { + InitSegment(&m->segments[i]); + } #endif - m->table = hypre_TAlloc(hypre_BigHopscotchBucket, num_buckets, HYPRE_MEMORY_HOST); + m->table = hypre_TAlloc(hypre_BigHopscotchBucket, num_buckets, HYPRE_MEMORY_HOST); #ifdef HYPRE_CONCURRENT_HOPSCOTCH -#pragma omp parallel for + #pragma omp parallel for #endif - for (i = 0; i < num_buckets; i++) - { - InitBigBucket(&m->table[i]); - } + for (i = 0; i < num_buckets; i++) + { + InitBigBucket(&m->table[i]); + } } void hypre_UnorderedIntSetDestroy( hypre_UnorderedIntSet *s ) { - hypre_TFree(s->hopInfo, HYPRE_MEMORY_HOST); - hypre_TFree(s->key, HYPRE_MEMORY_HOST); - hypre_TFree(s->hash, HYPRE_MEMORY_HOST); + hypre_TFree(s->hopInfo, HYPRE_MEMORY_HOST); + hypre_TFree(s->key, HYPRE_MEMORY_HOST); + hypre_TFree(s->hash, HYPRE_MEMORY_HOST); #ifdef HYPRE_CONCURRENT_HOPSCOTCH - HYPRE_Int i; - for (i = 0; i <= s->segmentMask; i++) - { - DestroySegment(&s->segments[i]); - } - hypre_TFree(s->segments, HYPRE_MEMORY_HOST); + HYPRE_Int i; + for (i = 0; i <= s->segmentMask; i++) + { + DestroySegment(&s->segments[i]); + } + hypre_TFree(s->segments, HYPRE_MEMORY_HOST); #endif } void hypre_UnorderedBigIntSetDestroy( hypre_UnorderedBigIntSet *s ) { - hypre_TFree(s->hopInfo, HYPRE_MEMORY_HOST); - hypre_TFree(s->key, HYPRE_MEMORY_HOST); - hypre_TFree(s->hash, HYPRE_MEMORY_HOST); + hypre_TFree(s->hopInfo, HYPRE_MEMORY_HOST); + hypre_TFree(s->key, HYPRE_MEMORY_HOST); + hypre_TFree(s->hash, HYPRE_MEMORY_HOST); #ifdef HYPRE_CONCURRENT_HOPSCOTCH - HYPRE_Int i; - for (i = 0; i <= s->segmentMask; i++) - { - DestroySegment(&s->segments[i]); - } - hypre_TFree(s->segments, HYPRE_MEMORY_HOST); + HYPRE_Int i; + for (i = 0; i <= s->segmentMask; i++) + { + DestroySegment(&s->segments[i]); + } + hypre_TFree(s->segments, HYPRE_MEMORY_HOST); #endif } void hypre_UnorderedIntMapDestroy( hypre_UnorderedIntMap *m) { - hypre_TFree(m->table, HYPRE_MEMORY_HOST); + hypre_TFree(m->table, HYPRE_MEMORY_HOST); #ifdef HYPRE_CONCURRENT_HOPSCOTCH - HYPRE_Int i; - for (i = 0; i <= m->segmentMask; i++) - { - DestroySegment(&m->segments[i]); - } - hypre_TFree(m->segments, HYPRE_MEMORY_HOST); + HYPRE_Int i; + for (i = 0; i <= m->segmentMask; i++) + { + DestroySegment(&m->segments[i]); + } + hypre_TFree(m->segments, HYPRE_MEMORY_HOST); #endif } void hypre_UnorderedBigIntMapDestroy( hypre_UnorderedBigIntMap *m) { - hypre_TFree(m->table, HYPRE_MEMORY_HOST); + hypre_TFree(m->table, HYPRE_MEMORY_HOST); #ifdef HYPRE_CONCURRENT_HOPSCOTCH - HYPRE_Int i; - for (i = 0; i <= m->segmentMask; i++) - { - DestroySegment(&m->segments[i]); - } - hypre_TFree(m->segments, HYPRE_MEMORY_HOST); + HYPRE_Int i; + for (i = 0; i <= m->segmentMask; i++) + { + DestroySegment(&m->segments[i]); + } + hypre_TFree(m->segments, HYPRE_MEMORY_HOST); #endif } HYPRE_Int *hypre_UnorderedIntSetCopyToArray( hypre_UnorderedIntSet *s, HYPRE_Int *len ) { - /*HYPRE_Int prefix_sum_workspace[hypre_NumThreads() + 1];*/ - HYPRE_Int *prefix_sum_workspace; - HYPRE_Int *ret_array = NULL; + /*HYPRE_Int prefix_sum_workspace[hypre_NumThreads() + 1];*/ + HYPRE_Int *prefix_sum_workspace; + HYPRE_Int *ret_array = NULL; - prefix_sum_workspace = hypre_TAlloc(HYPRE_Int, hypre_NumThreads() + 1, HYPRE_MEMORY_HOST); + prefix_sum_workspace = hypre_TAlloc(HYPRE_Int, hypre_NumThreads() + 1, HYPRE_MEMORY_HOST); #ifdef HYPRE_CONCURRENT_HOPSCOTCH -#pragma omp parallel + #pragma omp parallel #endif - { - HYPRE_Int n = s->bucketMask + HYPRE_HOPSCOTCH_HASH_INSERT_RANGE; - HYPRE_Int i_begin, i_end; - hypre_GetSimpleThreadPartition(&i_begin, &i_end, n); + { + HYPRE_Int n = s->bucketMask + HYPRE_HOPSCOTCH_HASH_INSERT_RANGE; + HYPRE_Int i_begin, i_end; + hypre_GetSimpleThreadPartition(&i_begin, &i_end, n); - HYPRE_Int cnt = 0; - HYPRE_Int i; - for (i = i_begin; i < i_end; i++) - { - if (HYPRE_HOPSCOTCH_HASH_EMPTY != s->hash[i]) cnt++; - } + HYPRE_Int cnt = 0; + HYPRE_Int i; + for (i = i_begin; i < i_end; i++) + { + if (HYPRE_HOPSCOTCH_HASH_EMPTY != s->hash[i]) { cnt++; } + } - hypre_prefix_sum(&cnt, len, prefix_sum_workspace); + hypre_prefix_sum(&cnt, len, prefix_sum_workspace); #ifdef HYPRE_CONCURRENT_HOPSCOTCH -#pragma omp barrier -#pragma omp master + #pragma omp barrier + #pragma omp master #endif - { - ret_array = hypre_TAlloc(HYPRE_Int, *len, HYPRE_MEMORY_HOST); - } + { + ret_array = hypre_TAlloc(HYPRE_Int, *len, HYPRE_MEMORY_HOST); + } #ifdef HYPRE_CONCURRENT_HOPSCOTCH -#pragma omp barrier + #pragma omp barrier #endif - for (i = i_begin; i < i_end; i++) - { - if (HYPRE_HOPSCOTCH_HASH_EMPTY != s->hash[i]) ret_array[cnt++] = s->key[i]; - } - } + for (i = i_begin; i < i_end; i++) + { + if (HYPRE_HOPSCOTCH_HASH_EMPTY != s->hash[i]) { ret_array[cnt++] = s->key[i]; } + } + } - hypre_TFree(prefix_sum_workspace, HYPRE_MEMORY_HOST); + hypre_TFree(prefix_sum_workspace, HYPRE_MEMORY_HOST); - return ret_array; + return ret_array; } HYPRE_BigInt *hypre_UnorderedBigIntSetCopyToArray( hypre_UnorderedBigIntSet *s, HYPRE_Int *len ) { - /*HYPRE_Int prefix_sum_workspace[hypre_NumThreads() + 1];*/ - HYPRE_Int *prefix_sum_workspace; - HYPRE_BigInt *ret_array = NULL; + /*HYPRE_Int prefix_sum_workspace[hypre_NumThreads() + 1];*/ + HYPRE_Int *prefix_sum_workspace; + HYPRE_BigInt *ret_array = NULL; - prefix_sum_workspace = hypre_TAlloc(HYPRE_Int, hypre_NumThreads() + 1, HYPRE_MEMORY_HOST); + prefix_sum_workspace = hypre_TAlloc(HYPRE_Int, hypre_NumThreads() + 1, HYPRE_MEMORY_HOST); #ifdef HYPRE_CONCURRENT_HOPSCOTCH -#pragma omp parallel + #pragma omp parallel #endif - { - HYPRE_Int n = s->bucketMask + HYPRE_HOPSCOTCH_HASH_INSERT_RANGE; - HYPRE_Int i_begin, i_end; - hypre_GetSimpleThreadPartition(&i_begin, &i_end, n); + { + HYPRE_Int n = s->bucketMask + HYPRE_HOPSCOTCH_HASH_INSERT_RANGE; + HYPRE_Int i_begin, i_end; + hypre_GetSimpleThreadPartition(&i_begin, &i_end, n); - HYPRE_Int cnt = 0; - HYPRE_Int i; - for (i = i_begin; i < i_end; i++) - { - if (HYPRE_HOPSCOTCH_HASH_EMPTY != s->hash[i]) cnt++; - } + HYPRE_Int cnt = 0; + HYPRE_Int i; + for (i = i_begin; i < i_end; i++) + { + if (HYPRE_HOPSCOTCH_HASH_EMPTY != s->hash[i]) { cnt++; } + } - hypre_prefix_sum(&cnt, len, prefix_sum_workspace); + hypre_prefix_sum(&cnt, len, prefix_sum_workspace); #ifdef HYPRE_CONCURRENT_HOPSCOTCH -#pragma omp barrier -#pragma omp master + #pragma omp barrier + #pragma omp master #endif - { - ret_array = hypre_TAlloc(HYPRE_BigInt, *len, HYPRE_MEMORY_HOST); - } + { + ret_array = hypre_TAlloc(HYPRE_BigInt, *len, HYPRE_MEMORY_HOST); + } #ifdef HYPRE_CONCURRENT_HOPSCOTCH -#pragma omp barrier + #pragma omp barrier #endif - for (i = i_begin; i < i_end; i++) - { - if (HYPRE_HOPSCOTCH_HASH_EMPTY != s->hash[i]) ret_array[cnt++] = s->key[i]; - } - } + for (i = i_begin; i < i_end; i++) + { + if (HYPRE_HOPSCOTCH_HASH_EMPTY != s->hash[i]) { ret_array[cnt++] = s->key[i]; } + } + } - hypre_TFree(prefix_sum_workspace, HYPRE_MEMORY_HOST); + hypre_TFree(prefix_sum_workspace, HYPRE_MEMORY_HOST); - return ret_array; + return ret_array; } diff --git a/external/hypre/src/utilities/hopscotch_hash.h b/external/hypre/src/utilities/hopscotch_hash.h index 22bde2bb..32e9e1ed 100644 --- a/external/hypre/src/utilities/hopscotch_hash.h +++ b/external/hypre/src/utilities/hopscotch_hash.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -47,13 +47,13 @@ #include #include #include -#include +//#include #ifdef HYPRE_USING_OPENMP #include #endif -#include "_hypre_utilities.h" +//#include "_hypre_utilities.h" // Potentially architecture specific features used here: // __sync_val_compare_and_swap @@ -70,36 +70,36 @@ extern "C" { ******************************************************************************/ #ifdef HYPRE_USING_ATOMIC -static inline HYPRE_Int +static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_Int hypre_compare_and_swap( HYPRE_Int *ptr, HYPRE_Int oldval, HYPRE_Int newval ) { #if defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__) && (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) > 40100 - return __sync_val_compare_and_swap(ptr, oldval, newval); -//#elif defind _MSC_VER - //return _InterlockedCompareExchange((long *)ptr, newval, oldval); -//#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L && !defined(__STDC_NO_ATOMICS__) -// JSP: not many compilers have implemented this, so comment out for now - //_Atomic HYPRE_Int *atomic_ptr = ptr; - //atomic_compare_exchange_strong(atomic_ptr, &oldval, newval); - //return oldval; + return __sync_val_compare_and_swap(ptr, oldval, newval); + //#elif defind _MSC_VER + //return _InterlockedCompareExchange((long *)ptr, newval, oldval); + //#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L && !defined(__STDC_NO_ATOMICS__) + // JSP: not many compilers have implemented this, so comment out for now + //_Atomic HYPRE_Int *atomic_ptr = ptr; + //atomic_compare_exchange_strong(atomic_ptr, &oldval, newval); + //return oldval; #endif } -static inline HYPRE_Int +static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_Int hypre_fetch_and_add( HYPRE_Int *ptr, HYPRE_Int value ) { #if defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__) && (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) > 40100 - return __sync_fetch_and_add(ptr, value); -//#elif defined _MSC_VER - //return _InterlockedExchangeAdd((long *)ptr, value); -//#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L && !defined(__STDC_NO_ATOMICS__) -// JSP: not many compilers have implemented this, so comment out for now - //_Atomic HYPRE_Int *atomic_ptr = ptr; - //return atomic_fetch_add(atomic_ptr, value); + return __sync_fetch_and_add(ptr, value); + //#elif defined _MSC_VER + //return _InterlockedExchangeAdd((long *)ptr, value); + //#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L && !defined(__STDC_NO_ATOMICS__) + // JSP: not many compilers have implemented this, so comment out for now + //_Atomic HYPRE_Int *atomic_ptr = ptr; + //return atomic_fetch_add(atomic_ptr, value); #endif } #else // !HYPRE_USING_ATOMIC -static inline HYPRE_Int +static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_Int hypre_compare_and_swap( HYPRE_Int *ptr, HYPRE_Int oldval, HYPRE_Int newval ) { if (*ptr == oldval) @@ -107,10 +107,10 @@ hypre_compare_and_swap( HYPRE_Int *ptr, HYPRE_Int oldval, HYPRE_Int newval ) *ptr = newval; return oldval; } - else return *ptr; + else { return *ptr; } } -static inline HYPRE_Int +static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_Int hypre_fetch_and_add( HYPRE_Int *ptr, HYPRE_Int value ) { HYPRE_Int oldval = *ptr; @@ -129,7 +129,7 @@ hypre_fetch_and_add( HYPRE_Int *ptr, HYPRE_Int value ) #define HYPRE_HOPSCOTCH_HASH_BUSY (1) // Small Utilities .......................................................... -static inline HYPRE_Int +static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_Int first_lsb_bit_indx( hypre_uint x ) { HYPRE_Int pos; @@ -206,181 +206,189 @@ first_lsb_bit_indx( hypre_uint x ) #define HYPRE_XXH_rotl64(x,r) ((x << r) | (x >> (64 - r))) #if defined(HYPRE_MIXEDINT) || defined(HYPRE_BIGINT) -static inline HYPRE_BigInt +static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_BigInt hypre_BigHash( HYPRE_BigInt input ) { - hypre_ulongint h64 = HYPRE_XXH_PRIME64_5 + sizeof(input); + hypre_ulonglongint h64 = HYPRE_XXH_PRIME64_5 + sizeof(input); - hypre_ulongint k1 = input; - k1 *= HYPRE_XXH_PRIME64_2; - k1 = HYPRE_XXH_rotl64(k1, 31); - k1 *= HYPRE_XXH_PRIME64_1; - h64 ^= k1; - h64 = HYPRE_XXH_rotl64(h64, 27)*HYPRE_XXH_PRIME64_1 + HYPRE_XXH_PRIME64_4; + hypre_ulonglongint k1 = input; + k1 *= HYPRE_XXH_PRIME64_2; + k1 = HYPRE_XXH_rotl64(k1, 31); + k1 *= HYPRE_XXH_PRIME64_1; + h64 ^= k1; + h64 = HYPRE_XXH_rotl64(h64, 27) * HYPRE_XXH_PRIME64_1 + HYPRE_XXH_PRIME64_4; - h64 ^= h64 >> 33; - h64 *= HYPRE_XXH_PRIME64_2; - h64 ^= h64 >> 29; - h64 *= HYPRE_XXH_PRIME64_3; - h64 ^= h64 >> 32; + h64 ^= h64 >> 33; + h64 *= HYPRE_XXH_PRIME64_2; + h64 ^= h64 >> 29; + h64 *= HYPRE_XXH_PRIME64_3; + h64 ^= h64 >> 32; #ifndef NDEBUG - if (HYPRE_HOPSCOTCH_HASH_EMPTY == h64) { + if (HYPRE_HOPSCOTCH_HASH_EMPTY == h64) + { hypre_printf("hash(%lld) = %d\n", h64, HYPRE_HOPSCOTCH_HASH_EMPTY); hypre_assert(HYPRE_HOPSCOTCH_HASH_EMPTY != h64); - } + } #endif - return h64; + return h64; } #else -static inline HYPRE_Int +static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_Int hypre_BigHash(HYPRE_Int input) { - hypre_uint h32 = HYPRE_XXH_PRIME32_5 + sizeof(input); + hypre_uint h32 = HYPRE_XXH_PRIME32_5 + sizeof(input); - // 1665863975 is added to input so that - // only -1073741824 gives HYPRE_HOPSCOTCH_HASH_EMPTY. - // Hence, we're fine as long as key is non-negative. - h32 += (input + 1665863975)*HYPRE_XXH_PRIME32_3; - h32 = HYPRE_XXH_rotl32(h32, 17)*HYPRE_XXH_PRIME32_4; + // 1665863975 is added to input so that + // only -1073741824 gives HYPRE_HOPSCOTCH_HASH_EMPTY. + // Hence, we're fine as long as key is non-negative. + h32 += (input + 1665863975) * HYPRE_XXH_PRIME32_3; + h32 = HYPRE_XXH_rotl32(h32, 17) * HYPRE_XXH_PRIME32_4; - h32 ^= h32 >> 15; - h32 *= HYPRE_XXH_PRIME32_2; - h32 ^= h32 >> 13; - h32 *= HYPRE_XXH_PRIME32_3; - h32 ^= h32 >> 16; + h32 ^= h32 >> 15; + h32 *= HYPRE_XXH_PRIME32_2; + h32 ^= h32 >> 13; + h32 *= HYPRE_XXH_PRIME32_3; + h32 ^= h32 >> 16; - //hypre_assert(HYPRE_HOPSCOTCH_HASH_EMPTY != h32); + //hypre_assert(HYPRE_HOPSCOTCH_HASH_EMPTY != h32); - return h32; + return h32; } #endif #ifdef HYPRE_BIGINT -static inline HYPRE_Int +static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_Int hypre_Hash(HYPRE_Int input) { - hypre_ulongint h64 = HYPRE_XXH_PRIME64_5 + sizeof(input); + hypre_ulonglongint h64 = HYPRE_XXH_PRIME64_5 + sizeof(input); - hypre_ulongint k1 = input; - k1 *= HYPRE_XXH_PRIME64_2; - k1 = HYPRE_XXH_rotl64(k1, 31); - k1 *= HYPRE_XXH_PRIME64_1; - h64 ^= k1; - h64 = HYPRE_XXH_rotl64(h64, 27)*HYPRE_XXH_PRIME64_1 + HYPRE_XXH_PRIME64_4; + hypre_ulonglongint k1 = input; + k1 *= HYPRE_XXH_PRIME64_2; + k1 = HYPRE_XXH_rotl64(k1, 31); + k1 *= HYPRE_XXH_PRIME64_1; + h64 ^= k1; + h64 = HYPRE_XXH_rotl64(h64, 27) * HYPRE_XXH_PRIME64_1 + HYPRE_XXH_PRIME64_4; - h64 ^= h64 >> 33; - h64 *= HYPRE_XXH_PRIME64_2; - h64 ^= h64 >> 29; - h64 *= HYPRE_XXH_PRIME64_3; - h64 ^= h64 >> 32; + h64 ^= h64 >> 33; + h64 *= HYPRE_XXH_PRIME64_2; + h64 ^= h64 >> 29; + h64 *= HYPRE_XXH_PRIME64_3; + h64 ^= h64 >> 32; #ifndef NDEBUG - if (HYPRE_HOPSCOTCH_HASH_EMPTY == h64) { + if (HYPRE_HOPSCOTCH_HASH_EMPTY == h64) + { hypre_printf("hash(%lld) = %d\n", h64, HYPRE_HOPSCOTCH_HASH_EMPTY); hypre_assert(HYPRE_HOPSCOTCH_HASH_EMPTY != h64); - } + } #endif - return h64; + return h64; } #else -static inline HYPRE_Int +static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_Int hypre_Hash(HYPRE_Int input) { - hypre_uint h32 = HYPRE_XXH_PRIME32_5 + sizeof(input); + hypre_uint h32 = HYPRE_XXH_PRIME32_5 + sizeof(input); - // 1665863975 is added to input so that - // only -1073741824 gives HYPRE_HOPSCOTCH_HASH_EMPTY. - // Hence, we're fine as long as key is non-negative. - h32 += (input + 1665863975)*HYPRE_XXH_PRIME32_3; - h32 = HYPRE_XXH_rotl32(h32, 17)*HYPRE_XXH_PRIME32_4; + // 1665863975 is added to input so that + // only -1073741824 gives HYPRE_HOPSCOTCH_HASH_EMPTY. + // Hence, we're fine as long as key is non-negative. + h32 += (input + 1665863975) * HYPRE_XXH_PRIME32_3; + h32 = HYPRE_XXH_rotl32(h32, 17) * HYPRE_XXH_PRIME32_4; - h32 ^= h32 >> 15; - h32 *= HYPRE_XXH_PRIME32_2; - h32 ^= h32 >> 13; - h32 *= HYPRE_XXH_PRIME32_3; - h32 ^= h32 >> 16; + h32 ^= h32 >> 15; + h32 *= HYPRE_XXH_PRIME32_2; + h32 ^= h32 >> 13; + h32 *= HYPRE_XXH_PRIME32_3; + h32 ^= h32 >> 16; - //hypre_assert(HYPRE_HOPSCOTCH_HASH_EMPTY != h32); + //hypre_assert(HYPRE_HOPSCOTCH_HASH_EMPTY != h32); - return h32; + return h32; } #endif -static inline void - hypre_UnorderedIntSetFindCloserFreeBucket( hypre_UnorderedIntSet *s, +static inline HYPRE_MAYBE_UNUSED_FUNC void +hypre_UnorderedIntSetFindCloserFreeBucket( hypre_UnorderedIntSet *s, #ifdef HYPRE_CONCURRENT_HOPSCOTCH - hypre_HopscotchSegment *start_seg, + hypre_HopscotchSegment *start_seg, #endif - HYPRE_Int *free_bucket, - HYPRE_Int *free_dist ) + HYPRE_Int *free_bucket, + HYPRE_Int *free_dist ) { - HYPRE_Int move_bucket = *free_bucket - (HYPRE_HOPSCOTCH_HASH_HOP_RANGE - 1); - HYPRE_Int move_free_dist; - for (move_free_dist = HYPRE_HOPSCOTCH_HASH_HOP_RANGE - 1; move_free_dist > 0; --move_free_dist) - { - hypre_uint start_hop_info = s->hopInfo[move_bucket]; - HYPRE_Int move_new_free_dist = -1; - hypre_uint mask = 1; - HYPRE_Int i; - for (i = 0; i < move_free_dist; ++i, mask <<= 1) - { - if (mask & start_hop_info) + HYPRE_Int move_bucket = *free_bucket - (HYPRE_HOPSCOTCH_HASH_HOP_RANGE - 1); + HYPRE_Int move_free_dist; + for (move_free_dist = HYPRE_HOPSCOTCH_HASH_HOP_RANGE - 1; move_free_dist > 0; --move_free_dist) + { + hypre_uint start_hop_info = s->hopInfo[move_bucket]; + HYPRE_Int move_new_free_dist = -1; + hypre_uint mask = 1; + HYPRE_Int i; + for (i = 0; i < move_free_dist; ++i, mask <<= 1) { - move_new_free_dist = i; - break; + if (mask & start_hop_info) + { + move_new_free_dist = i; + break; + } } - } - if (-1 != move_new_free_dist) - { + if (-1 != move_new_free_dist) + { #ifdef HYPRE_CONCURRENT_HOPSCOTCH - hypre_HopscotchSegment* move_segment = &(s->segments[move_bucket & s->segmentMask]); + hypre_HopscotchSegment* move_segment = &(s->segments[move_bucket & s->segmentMask]); - if(start_seg != move_segment) - omp_set_lock(&move_segment->lock); + if (start_seg != move_segment) + { + omp_set_lock(&move_segment->lock); + } #endif - if (start_hop_info == s->hopInfo[move_bucket]) - { - // new_free_bucket -> free_bucket and empty new_free_bucket - HYPRE_Int new_free_bucket = move_bucket + move_new_free_dist; - s->key[*free_bucket] = s->key[new_free_bucket]; - s->hash[*free_bucket] = s->hash[new_free_bucket]; + if (start_hop_info == s->hopInfo[move_bucket]) + { + // new_free_bucket -> free_bucket and empty new_free_bucket + HYPRE_Int new_free_bucket = move_bucket + move_new_free_dist; + s->key[*free_bucket] = s->key[new_free_bucket]; + s->hash[*free_bucket] = s->hash[new_free_bucket]; #ifdef HYPRE_CONCURRENT_HOPSCOTCH - ++move_segment->timestamp; -#pragma omp flush + ++move_segment->timestamp; + #pragma omp flush #endif - s->hopInfo[move_bucket] |= (1U << move_free_dist); - s->hopInfo[move_bucket] &= ~(1U << move_new_free_dist); + s->hopInfo[move_bucket] |= (1U << move_free_dist); + s->hopInfo[move_bucket] &= ~(1U << move_new_free_dist); - *free_bucket = new_free_bucket; - *free_dist -= move_free_dist - move_new_free_dist; + *free_bucket = new_free_bucket; + *free_dist -= move_free_dist - move_new_free_dist; #ifdef HYPRE_CONCURRENT_HOPSCOTCH - if(start_seg != move_segment) - omp_unset_lock(&move_segment->lock); + if (start_seg != move_segment) + { + omp_unset_lock(&move_segment->lock); + } #endif - return; - } + return; + } #ifdef HYPRE_CONCURRENT_HOPSCOTCH - if(start_seg != move_segment) - omp_unset_lock(&move_segment->lock); -#endif - } - ++move_bucket; - } - *free_bucket = -1; - *free_dist = 0; + if (start_seg != move_segment) + { + omp_unset_lock(&move_segment->lock); + } +#endif + } + ++move_bucket; + } + *free_bucket = -1; + *free_dist = 0; } -static inline void +static inline HYPRE_MAYBE_UNUSED_FUNC void hypre_UnorderedBigIntSetFindCloserFreeBucket( hypre_UnorderedBigIntSet *s, #ifdef HYPRE_CONCURRENT_HOPSCOTCH hypre_HopscotchSegment *start_seg, @@ -388,68 +396,74 @@ hypre_UnorderedBigIntSetFindCloserFreeBucket( hypre_UnorderedBigIntSet *s, HYPRE_Int *free_bucket, HYPRE_Int *free_dist ) { - HYPRE_Int move_bucket = *free_bucket - (HYPRE_HOPSCOTCH_HASH_HOP_RANGE - 1); - HYPRE_Int move_free_dist; - for (move_free_dist = HYPRE_HOPSCOTCH_HASH_HOP_RANGE - 1; move_free_dist > 0; --move_free_dist) - { - hypre_uint start_hop_info = s->hopInfo[move_bucket]; - HYPRE_Int move_new_free_dist = -1; - hypre_uint mask = 1; - HYPRE_Int i; - for (i = 0; i < move_free_dist; ++i, mask <<= 1) - { - if (mask & start_hop_info) + HYPRE_Int move_bucket = *free_bucket - (HYPRE_HOPSCOTCH_HASH_HOP_RANGE - 1); + HYPRE_Int move_free_dist; + for (move_free_dist = HYPRE_HOPSCOTCH_HASH_HOP_RANGE - 1; move_free_dist > 0; --move_free_dist) + { + hypre_uint start_hop_info = s->hopInfo[move_bucket]; + HYPRE_Int move_new_free_dist = -1; + hypre_uint mask = 1; + HYPRE_Int i; + for (i = 0; i < move_free_dist; ++i, mask <<= 1) { - move_new_free_dist = i; - break; + if (mask & start_hop_info) + { + move_new_free_dist = i; + break; + } } - } - if (-1 != move_new_free_dist) - { + if (-1 != move_new_free_dist) + { #ifdef HYPRE_CONCURRENT_HOPSCOTCH - hypre_HopscotchSegment* move_segment = &(s->segments[move_bucket & s->segmentMask]); + hypre_HopscotchSegment* move_segment = &(s->segments[move_bucket & s->segmentMask]); - if(start_seg != move_segment) - omp_set_lock(&move_segment->lock); + if (start_seg != move_segment) + { + omp_set_lock(&move_segment->lock); + } #endif - if (start_hop_info == s->hopInfo[move_bucket]) - { - // new_free_bucket -> free_bucket and empty new_free_bucket - HYPRE_Int new_free_bucket = move_bucket + move_new_free_dist; - s->key[*free_bucket] = s->key[new_free_bucket]; - s->hash[*free_bucket] = s->hash[new_free_bucket]; + if (start_hop_info == s->hopInfo[move_bucket]) + { + // new_free_bucket -> free_bucket and empty new_free_bucket + HYPRE_Int new_free_bucket = move_bucket + move_new_free_dist; + s->key[*free_bucket] = s->key[new_free_bucket]; + s->hash[*free_bucket] = s->hash[new_free_bucket]; #ifdef HYPRE_CONCURRENT_HOPSCOTCH - ++move_segment->timestamp; -#pragma omp flush + ++move_segment->timestamp; + #pragma omp flush #endif - s->hopInfo[move_bucket] |= (1U << move_free_dist); - s->hopInfo[move_bucket] &= ~(1U << move_new_free_dist); + s->hopInfo[move_bucket] |= (1U << move_free_dist); + s->hopInfo[move_bucket] &= ~(1U << move_new_free_dist); - *free_bucket = new_free_bucket; - *free_dist -= move_free_dist - move_new_free_dist; + *free_bucket = new_free_bucket; + *free_dist -= move_free_dist - move_new_free_dist; #ifdef HYPRE_CONCURRENT_HOPSCOTCH - if(start_seg != move_segment) - omp_unset_lock(&move_segment->lock); + if (start_seg != move_segment) + { + omp_unset_lock(&move_segment->lock); + } #endif - return; - } + return; + } #ifdef HYPRE_CONCURRENT_HOPSCOTCH - if(start_seg != move_segment) - omp_unset_lock(&move_segment->lock); -#endif - } - ++move_bucket; - } - *free_bucket = -1; - *free_dist = 0; + if (start_seg != move_segment) + { + omp_unset_lock(&move_segment->lock); + } +#endif + } + ++move_bucket; + } + *free_bucket = -1; + *free_dist = 0; } -static inline void +static inline HYPRE_MAYBE_UNUSED_FUNC void hypre_UnorderedIntMapFindCloserFreeBucket( hypre_UnorderedIntMap *m, #ifdef HYPRE_CONCURRENT_HOPSCOTCH hypre_HopscotchSegment *start_seg, @@ -457,69 +471,77 @@ hypre_UnorderedIntMapFindCloserFreeBucket( hypre_UnorderedIntMap *m, hypre_HopscotchBucket **free_bucket, HYPRE_Int *free_dist) { - hypre_HopscotchBucket* move_bucket = *free_bucket - (HYPRE_HOPSCOTCH_HASH_HOP_RANGE - 1); - HYPRE_Int move_free_dist; - for (move_free_dist = HYPRE_HOPSCOTCH_HASH_HOP_RANGE - 1; move_free_dist > 0; --move_free_dist) - { - hypre_uint start_hop_info = move_bucket->hopInfo; - HYPRE_Int move_new_free_dist = -1; - hypre_uint mask = 1; - HYPRE_Int i; - for (i = 0; i < move_free_dist; ++i, mask <<= 1) - { - if (mask & start_hop_info) + HYPRE_UNUSED_VAR(m); + + hypre_HopscotchBucket* move_bucket = *free_bucket - (HYPRE_HOPSCOTCH_HASH_HOP_RANGE - 1); + HYPRE_Int move_free_dist; + for (move_free_dist = HYPRE_HOPSCOTCH_HASH_HOP_RANGE - 1; move_free_dist > 0; --move_free_dist) + { + hypre_uint start_hop_info = move_bucket->hopInfo; + HYPRE_Int move_new_free_dist = -1; + hypre_uint mask = 1; + HYPRE_Int i; + for (i = 0; i < move_free_dist; ++i, mask <<= 1) { - move_new_free_dist = i; - break; + if (mask & start_hop_info) + { + move_new_free_dist = i; + break; + } } - } - if (-1 != move_new_free_dist) - { + if (-1 != move_new_free_dist) + { #ifdef HYPRE_CONCURRENT_HOPSCOTCH - hypre_HopscotchSegment* move_segment = &(m->segments[(move_bucket - m->table) & m->segmentMask]); + hypre_HopscotchSegment* move_segment = &(m->segments[(move_bucket - m->table) & m->segmentMask]); - if (start_seg != move_segment) - omp_set_lock(&move_segment->lock); + if (start_seg != move_segment) + { + omp_set_lock(&move_segment->lock); + } #endif - if (start_hop_info == move_bucket->hopInfo) - { - // new_free_bucket -> free_bucket and empty new_free_bucket - hypre_HopscotchBucket* new_free_bucket = move_bucket + move_new_free_dist; - (*free_bucket)->data = new_free_bucket->data; - (*free_bucket)->key = new_free_bucket->key; - (*free_bucket)->hash = new_free_bucket->hash; + if (start_hop_info == move_bucket->hopInfo) + { + // new_free_bucket -> free_bucket and empty new_free_bucket + hypre_HopscotchBucket* new_free_bucket = move_bucket + move_new_free_dist; + (*free_bucket)->data = new_free_bucket->data; + (*free_bucket)->key = new_free_bucket->key; + (*free_bucket)->hash = new_free_bucket->hash; #ifdef HYPRE_CONCURRENT_HOPSCOTCH - ++move_segment->timestamp; + ++move_segment->timestamp; -#pragma omp flush + #pragma omp flush #endif - move_bucket->hopInfo |= (1U << move_free_dist); - move_bucket->hopInfo &= ~(1U << move_new_free_dist); + move_bucket->hopInfo = move_bucket->hopInfo | (1U << move_free_dist); + move_bucket->hopInfo = move_bucket->hopInfo & ~(1U << move_new_free_dist); - *free_bucket = new_free_bucket; - *free_dist -= move_free_dist - move_new_free_dist; + *free_bucket = new_free_bucket; + *free_dist -= move_free_dist - move_new_free_dist; #ifdef HYPRE_CONCURRENT_HOPSCOTCH - if(start_seg != move_segment) - omp_unset_lock(&move_segment->lock); + if (start_seg != move_segment) + { + omp_unset_lock(&move_segment->lock); + } #endif - return; - } + return; + } #ifdef HYPRE_CONCURRENT_HOPSCOTCH - if(start_seg != move_segment) - omp_unset_lock(&move_segment->lock); -#endif - } - ++move_bucket; - } - *free_bucket = NULL; - *free_dist = 0; + if (start_seg != move_segment) + { + omp_unset_lock(&move_segment->lock); + } +#endif + } + ++move_bucket; + } + *free_bucket = NULL; + *free_dist = 0; } -static inline void +static inline HYPRE_MAYBE_UNUSED_FUNC void hypre_UnorderedBigIntMapFindCloserFreeBucket( hypre_UnorderedBigIntMap *m, #ifdef HYPRE_CONCURRENT_HOPSCOTCH hypre_HopscotchSegment *start_seg, @@ -527,80 +549,88 @@ hypre_UnorderedBigIntMapFindCloserFreeBucket( hypre_UnorderedBigIntMap *m, hypre_BigHopscotchBucket **free_bucket, HYPRE_Int *free_dist) { - hypre_BigHopscotchBucket* move_bucket = *free_bucket - (HYPRE_HOPSCOTCH_HASH_HOP_RANGE - 1); - HYPRE_Int move_free_dist; - for (move_free_dist = HYPRE_HOPSCOTCH_HASH_HOP_RANGE - 1; move_free_dist > 0; --move_free_dist) - { - hypre_uint start_hop_info = move_bucket->hopInfo; - HYPRE_Int move_new_free_dist = -1; - hypre_uint mask = 1; - HYPRE_Int i; - for (i = 0; i < move_free_dist; ++i, mask <<= 1) - { - if (mask & start_hop_info) + HYPRE_UNUSED_VAR(m); + + hypre_BigHopscotchBucket* move_bucket = *free_bucket - (HYPRE_HOPSCOTCH_HASH_HOP_RANGE - 1); + HYPRE_Int move_free_dist; + for (move_free_dist = HYPRE_HOPSCOTCH_HASH_HOP_RANGE - 1; move_free_dist > 0; --move_free_dist) + { + hypre_uint start_hop_info = move_bucket->hopInfo; + HYPRE_Int move_new_free_dist = -1; + hypre_uint mask = 1; + HYPRE_Int i; + for (i = 0; i < move_free_dist; ++i, mask <<= 1) { - move_new_free_dist = i; - break; + if (mask & start_hop_info) + { + move_new_free_dist = i; + break; + } } - } - if (-1 != move_new_free_dist) - { + if (-1 != move_new_free_dist) + { #ifdef HYPRE_CONCURRENT_HOPSCOTCH - hypre_HopscotchSegment* move_segment = &(m->segments[(move_bucket - m->table) & m->segmentMask]); + hypre_HopscotchSegment* move_segment = &(m->segments[(move_bucket - m->table) & m->segmentMask]); - if (start_seg != move_segment) - omp_set_lock(&move_segment->lock); + if (start_seg != move_segment) + { + omp_set_lock(&move_segment->lock); + } #endif - if (start_hop_info == move_bucket->hopInfo) - { - // new_free_bucket -> free_bucket and empty new_free_bucket - hypre_BigHopscotchBucket* new_free_bucket = move_bucket + move_new_free_dist; - (*free_bucket)->data = new_free_bucket->data; - (*free_bucket)->key = new_free_bucket->key; - (*free_bucket)->hash = new_free_bucket->hash; + if (start_hop_info == move_bucket->hopInfo) + { + // new_free_bucket -> free_bucket and empty new_free_bucket + hypre_BigHopscotchBucket* new_free_bucket = move_bucket + move_new_free_dist; + (*free_bucket)->data = new_free_bucket->data; + (*free_bucket)->key = new_free_bucket->key; + (*free_bucket)->hash = new_free_bucket->hash; #ifdef HYPRE_CONCURRENT_HOPSCOTCH - ++move_segment->timestamp; + ++move_segment->timestamp; -#pragma omp flush + #pragma omp flush #endif - move_bucket->hopInfo |= (1U << move_free_dist); - move_bucket->hopInfo &= ~(1U << move_new_free_dist); + move_bucket->hopInfo = move_bucket->hopInfo | (1U << move_free_dist); + move_bucket->hopInfo = move_bucket->hopInfo & ~(1U << move_new_free_dist); - *free_bucket = new_free_bucket; - *free_dist -= move_free_dist - move_new_free_dist; + *free_bucket = new_free_bucket; + *free_dist -= move_free_dist - move_new_free_dist; #ifdef HYPRE_CONCURRENT_HOPSCOTCH - if(start_seg != move_segment) - omp_unset_lock(&move_segment->lock); + if (start_seg != move_segment) + { + omp_unset_lock(&move_segment->lock); + } #endif - return; - } + return; + } #ifdef HYPRE_CONCURRENT_HOPSCOTCH - if(start_seg != move_segment) - omp_unset_lock(&move_segment->lock); -#endif - } - ++move_bucket; - } - *free_bucket = NULL; - *free_dist = 0; + if (start_seg != move_segment) + { + omp_unset_lock(&move_segment->lock); + } +#endif + } + ++move_bucket; + } + *free_bucket = NULL; + *free_dist = 0; } void hypre_UnorderedIntSetCreate( hypre_UnorderedIntSet *s, HYPRE_Int inCapacity, HYPRE_Int concurrencyLevel); void hypre_UnorderedBigIntSetCreate( hypre_UnorderedBigIntSet *s, - HYPRE_Int inCapacity, - HYPRE_Int concurrencyLevel); + HYPRE_Int inCapacity, + HYPRE_Int concurrencyLevel); void hypre_UnorderedIntMapCreate( hypre_UnorderedIntMap *m, HYPRE_Int inCapacity, HYPRE_Int concurrencyLevel); void hypre_UnorderedBigIntMapCreate( hypre_UnorderedBigIntMap *m, - HYPRE_Int inCapacity, - HYPRE_Int concurrencyLevel); + HYPRE_Int inCapacity, + HYPRE_Int concurrencyLevel); void hypre_UnorderedIntSetDestroy( hypre_UnorderedIntSet *s ); void hypre_UnorderedBigIntSetDestroy( hypre_UnorderedBigIntSet *s ); @@ -608,606 +638,658 @@ void hypre_UnorderedIntMapDestroy( hypre_UnorderedIntMap *m ); void hypre_UnorderedBigIntMapDestroy( hypre_UnorderedBigIntMap *m ); // Query Operations ......................................................... -static inline HYPRE_Int +static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_Int hypre_UnorderedIntSetContains( hypre_UnorderedIntSet *s, HYPRE_Int key ) { - //CALCULATE HASH .......................... + //CALCULATE HASH .......................... #ifdef HYPRE_BIGINT - HYPRE_Int hash = hypre_BigHash(key); + HYPRE_Int hash = hypre_BigHash(key); #else - HYPRE_Int hash = hypre_Hash(key); + HYPRE_Int hash = hypre_Hash(key); #endif - //CHECK IF ALREADY CONTAIN ................ + //CHECK IF ALREADY CONTAIN ................ #ifdef HYPRE_CONCURRENT_HOPSCOTCH - hypre_HopscotchSegment *segment = &s->segments[hash & s->segmentMask]; + hypre_HopscotchSegment *segment = &s->segments[hash & s->segmentMask]; #endif - HYPRE_Int bucket = hash & s->bucketMask; - hypre_uint hopInfo = s->hopInfo[bucket]; + HYPRE_Int bucket = hash & s->bucketMask; + hypre_uint hopInfo = s->hopInfo[bucket]; - if (0 == hopInfo) - return 0; - else if (1 == hopInfo ) - { - if (hash == s->hash[bucket] && key == s->key[bucket]) - return 1; - else return 0; - } + if (0 == hopInfo) + { + return 0; + } + else if (1 == hopInfo ) + { + if (hash == s->hash[bucket] && key == s->key[bucket]) + { + return 1; + } + else { return 0; } + } #ifdef HYPRE_CONCURRENT_HOPSCOTCH - HYPRE_Int startTimestamp = segment->timestamp; + HYPRE_Int startTimestamp = segment->timestamp; #endif - while (0 != hopInfo) - { - HYPRE_Int i = first_lsb_bit_indx(hopInfo); - HYPRE_Int currElm = bucket + i; + while (0 != hopInfo) + { + HYPRE_Int i = first_lsb_bit_indx(hopInfo); + HYPRE_Int currElm = bucket + i; - if (hash == s->hash[currElm] && key == s->key[currElm]) - return 1; - hopInfo &= ~(1U << i); - } + if (hash == s->hash[currElm] && key == s->key[currElm]) + { + return 1; + } + hopInfo &= ~(1U << i); + } #ifdef HYPRE_CONCURRENT_HOPSCOTCH - if (segment->timestamp == startTimestamp) - return 0; + if (segment->timestamp == startTimestamp) + { + return 0; + } #endif - HYPRE_Int i; - for (i = 0; i< HYPRE_HOPSCOTCH_HASH_HOP_RANGE; ++i) - { - if (hash == s->hash[bucket + i] && key == s->key[bucket + i]) - return 1; - } - return 0; + HYPRE_Int i; + for (i = 0; i < HYPRE_HOPSCOTCH_HASH_HOP_RANGE; ++i) + { + if (hash == s->hash[bucket + i] && key == s->key[bucket + i]) + { + return 1; + } + } + return 0; } -static inline HYPRE_Int +static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_Int hypre_UnorderedBigIntSetContains( hypre_UnorderedBigIntSet *s, HYPRE_BigInt key ) { - //CALCULATE HASH .......................... + //CALCULATE HASH .......................... #if defined(HYPRE_BIGINT) || defined(HYPRE_MIXEDINT) - HYPRE_BigInt hash = hypre_BigHash(key); + HYPRE_BigInt hash = hypre_BigHash(key); #else - HYPRE_BigInt hash = hypre_Hash(key); + HYPRE_BigInt hash = hypre_Hash(key); #endif - //CHECK IF ALREADY CONTAIN ................ + //CHECK IF ALREADY CONTAIN ................ #ifdef HYPRE_CONCURRENT_HOPSCOTCH - hypre_HopscotchSegment *segment = &s->segments[(HYPRE_Int)(hash & s->segmentMask)]; + hypre_HopscotchSegment *segment = &s->segments[(HYPRE_Int)(hash & s->segmentMask)]; #endif - HYPRE_Int bucket = (HYPRE_Int)(hash & s->bucketMask); - hypre_uint hopInfo = s->hopInfo[bucket]; + HYPRE_Int bucket = (HYPRE_Int)(hash & s->bucketMask); + hypre_uint hopInfo = s->hopInfo[bucket]; - if (0 == hopInfo) - return 0; - else if (1 == hopInfo ) - { - if (hash == s->hash[bucket] && key == s->key[bucket]) - return 1; - else return 0; - } + if (0 == hopInfo) + { + return 0; + } + else if (1 == hopInfo ) + { + if (hash == s->hash[bucket] && key == s->key[bucket]) + { + return 1; + } + else { return 0; } + } #ifdef HYPRE_CONCURRENT_HOPSCOTCH - HYPRE_Int startTimestamp = segment->timestamp; + HYPRE_Int startTimestamp = segment->timestamp; #endif - while (0 != hopInfo) - { - HYPRE_Int i = first_lsb_bit_indx(hopInfo); - HYPRE_Int currElm = bucket + i; + while (0 != hopInfo) + { + HYPRE_Int i = first_lsb_bit_indx(hopInfo); + HYPRE_Int currElm = bucket + i; - if (hash == s->hash[currElm] && key == s->key[currElm]) - return 1; - hopInfo &= ~(1U << i); - } + if (hash == s->hash[currElm] && key == s->key[currElm]) + { + return 1; + } + hopInfo &= ~(1U << i); + } #ifdef HYPRE_CONCURRENT_HOPSCOTCH - if (segment->timestamp == startTimestamp) - return 0; + if (segment->timestamp == startTimestamp) + { + return 0; + } #endif - HYPRE_Int i; - for (i = 0; i< HYPRE_HOPSCOTCH_HASH_HOP_RANGE; ++i) - { - if (hash == s->hash[bucket + i] && key == s->key[bucket + i]) - return 1; - } - return 0; + HYPRE_Int i; + for (i = 0; i < HYPRE_HOPSCOTCH_HASH_HOP_RANGE; ++i) + { + if (hash == s->hash[bucket + i] && key == s->key[bucket + i]) + { + return 1; + } + } + return 0; } /** * @ret -1 if key doesn't exist */ -static inline HYPRE_Int +static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_Int hypre_UnorderedIntMapGet( hypre_UnorderedIntMap *m, HYPRE_Int key ) { - //CALCULATE HASH .......................... + //CALCULATE HASH .......................... #ifdef HYPRE_BIGINT - HYPRE_Int hash = hypre_BigHash(key); + HYPRE_Int hash = hypre_BigHash(key); #else - HYPRE_Int hash = hypre_Hash(key); + HYPRE_Int hash = hypre_Hash(key); #endif - //CHECK IF ALREADY CONTAIN ................ + //CHECK IF ALREADY CONTAIN ................ #ifdef HYPRE_CONCURRENT_HOPSCOTCH - hypre_HopscotchSegment *segment = &m->segments[hash & m->segmentMask]; -#endif - hypre_HopscotchBucket *elmAry = &(m->table[hash & m->bucketMask]); - hypre_uint hopInfo = elmAry->hopInfo; - if (0 == hopInfo) - return -1; - else if (1 == hopInfo ) - { - if (hash == elmAry->hash && key == elmAry->key) - return elmAry->data; - else return -1; - } + hypre_HopscotchSegment *segment = &m->segments[hash & m->segmentMask]; +#endif + hypre_HopscotchBucket *elmAry = &(m->table[hash & m->bucketMask]); + hypre_uint hopInfo = elmAry->hopInfo; + if (0 == hopInfo) + { + return -1; + } + else if (1 == hopInfo ) + { + if (hash == elmAry->hash && key == elmAry->key) + { + return elmAry->data; + } + else { return -1; } + } #ifdef HYPRE_CONCURRENT_HOPSCOTCH - HYPRE_Int startTimestamp = segment->timestamp; + HYPRE_Int startTimestamp = segment->timestamp; #endif - while (0 != hopInfo) - { - HYPRE_Int i = first_lsb_bit_indx(hopInfo); - hypre_HopscotchBucket* currElm = elmAry + i; - if (hash == currElm->hash && key == currElm->key) - return currElm->data; - hopInfo &= ~(1U << i); - } + while (0 != hopInfo) + { + HYPRE_Int i = first_lsb_bit_indx(hopInfo); + hypre_HopscotchBucket* currElm = elmAry + i; + if (hash == currElm->hash && key == currElm->key) + { + return currElm->data; + } + hopInfo &= ~(1U << i); + } #ifdef HYPRE_CONCURRENT_HOPSCOTCH - if (segment->timestamp == startTimestamp) - return -1; -#endif - - hypre_HopscotchBucket *currBucket = &(m->table[hash & m->bucketMask]); - HYPRE_Int i; - for (i = 0; i< HYPRE_HOPSCOTCH_HASH_HOP_RANGE; ++i, ++currBucket) - { - if (hash == currBucket->hash && key == currBucket->key) - return currBucket->data; - } - return -1; + if (segment->timestamp == startTimestamp) + { + return -1; + } +#endif + + hypre_HopscotchBucket *currBucket = &(m->table[hash & m->bucketMask]); + HYPRE_Int i; + for (i = 0; i < HYPRE_HOPSCOTCH_HASH_HOP_RANGE; ++i, ++currBucket) + { + if (hash == currBucket->hash && key == currBucket->key) + { + return currBucket->data; + } + } + return -1; } -static inline +static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_Int hypre_UnorderedBigIntMapGet( hypre_UnorderedBigIntMap *m, HYPRE_BigInt key ) { - //CALCULATE HASH .......................... + //CALCULATE HASH .......................... #if defined(HYPRE_BIGINT) || defined(HYPRE_MIXEDINT) - HYPRE_BigInt hash = hypre_BigHash(key); + HYPRE_BigInt hash = hypre_BigHash(key); #else - HYPRE_BigInt hash = hypre_Hash(key); + HYPRE_BigInt hash = hypre_Hash(key); #endif - //CHECK IF ALREADY CONTAIN ................ + //CHECK IF ALREADY CONTAIN ................ #ifdef HYPRE_CONCURRENT_HOPSCOTCH - hypre_HopscotchSegment *segment = &m->segments[(HYPRE_Int)(hash & m->segmentMask)]; -#endif - hypre_BigHopscotchBucket *elmAry = &(m->table[(HYPRE_Int)(hash & m->bucketMask)]); - hypre_uint hopInfo = elmAry->hopInfo; - if (0 == hopInfo) - return -1; - else if (1 == hopInfo ) - { - if (hash == elmAry->hash && key == elmAry->key) - return elmAry->data; - else return -1; - } + hypre_HopscotchSegment *segment = &m->segments[(HYPRE_Int)(hash & m->segmentMask)]; +#endif + hypre_BigHopscotchBucket *elmAry = &(m->table[(HYPRE_Int)(hash & m->bucketMask)]); + hypre_uint hopInfo = elmAry->hopInfo; + if (0 == hopInfo) + { + return -1; + } + else if (1 == hopInfo ) + { + if (hash == elmAry->hash && key == elmAry->key) + { + return elmAry->data; + } + else { return -1; } + } #ifdef HYPRE_CONCURRENT_HOPSCOTCH - HYPRE_Int startTimestamp = segment->timestamp; + HYPRE_Int startTimestamp = segment->timestamp; #endif - while (0 != hopInfo) - { - HYPRE_Int i = first_lsb_bit_indx(hopInfo); - hypre_BigHopscotchBucket* currElm = elmAry + i; - if (hash == currElm->hash && key == currElm->key) - return currElm->data; - hopInfo &= ~(1U << i); - } + while (0 != hopInfo) + { + HYPRE_Int i = first_lsb_bit_indx(hopInfo); + hypre_BigHopscotchBucket* currElm = elmAry + i; + if (hash == currElm->hash && key == currElm->key) + { + return currElm->data; + } + hopInfo &= ~(1U << i); + } #ifdef HYPRE_CONCURRENT_HOPSCOTCH - if (segment->timestamp == startTimestamp) - return -1; -#endif - - hypre_BigHopscotchBucket *currBucket = &(m->table[hash & m->bucketMask]); - HYPRE_Int i; - for (i = 0; i< HYPRE_HOPSCOTCH_HASH_HOP_RANGE; ++i, ++currBucket) - { - if (hash == currBucket->hash && key == currBucket->key) - return currBucket->data; - } - return -1; + if (segment->timestamp == startTimestamp) + { + return -1; + } +#endif + + hypre_BigHopscotchBucket *currBucket = &(m->table[hash & m->bucketMask]); + HYPRE_Int i; + for (i = 0; i < HYPRE_HOPSCOTCH_HASH_HOP_RANGE; ++i, ++currBucket) + { + if (hash == currBucket->hash && key == currBucket->key) + { + return currBucket->data; + } + } + return -1; } //status Operations ......................................................... -static inline +static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_Int hypre_UnorderedIntSetSize( hypre_UnorderedIntSet *s ) { - HYPRE_Int counter = 0; - HYPRE_Int n = s->bucketMask + HYPRE_HOPSCOTCH_HASH_INSERT_RANGE; - HYPRE_Int i; - for (i = 0; i < n; ++i) - { - if (HYPRE_HOPSCOTCH_HASH_EMPTY != s->hash[i]) - { - ++counter; - } - } - return counter; + HYPRE_Int counter = 0; + HYPRE_Int n = s->bucketMask + HYPRE_HOPSCOTCH_HASH_INSERT_RANGE; + HYPRE_Int i; + for (i = 0; i < n; ++i) + { + if (HYPRE_HOPSCOTCH_HASH_EMPTY != s->hash[i]) + { + ++counter; + } + } + return counter; } -static inline +static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_Int hypre_UnorderedBigIntSetSize( hypre_UnorderedBigIntSet *s ) { - HYPRE_Int counter = 0; - HYPRE_BigInt n = s->bucketMask + HYPRE_HOPSCOTCH_HASH_INSERT_RANGE; - HYPRE_Int i; - for (i = 0; i < n; ++i) - { - if (HYPRE_HOPSCOTCH_HASH_EMPTY != s->hash[i]) - { - ++counter; - } - } - return counter; + HYPRE_Int counter = 0; + HYPRE_BigInt n = s->bucketMask + HYPRE_HOPSCOTCH_HASH_INSERT_RANGE; + HYPRE_Int i; + for (i = 0; i < n; ++i) + { + if (HYPRE_HOPSCOTCH_HASH_EMPTY != s->hash[i]) + { + ++counter; + } + } + return counter; } -static inline HYPRE_Int +static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_Int hypre_UnorderedIntMapSize( hypre_UnorderedIntMap *m ) { - HYPRE_Int counter = 0; - HYPRE_Int n = m->bucketMask + HYPRE_HOPSCOTCH_HASH_INSERT_RANGE; - HYPRE_Int i; - for (i = 0; i < n; ++i) - { - if( HYPRE_HOPSCOTCH_HASH_EMPTY != m->table[i].hash ) - { - ++counter; - } - } - return counter; + HYPRE_Int counter = 0; + HYPRE_Int n = m->bucketMask + HYPRE_HOPSCOTCH_HASH_INSERT_RANGE; + HYPRE_Int i; + for (i = 0; i < n; ++i) + { + if ( HYPRE_HOPSCOTCH_HASH_EMPTY != m->table[i].hash ) + { + ++counter; + } + } + return counter; } -static inline HYPRE_Int +static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_Int hypre_UnorderedBigIntMapSize( hypre_UnorderedBigIntMap *m ) { - HYPRE_Int counter = 0; - HYPRE_Int n = m->bucketMask + HYPRE_HOPSCOTCH_HASH_INSERT_RANGE; - HYPRE_Int i; - for (i = 0; i < n; ++i) - { - if( HYPRE_HOPSCOTCH_HASH_EMPTY != m->table[i].hash ) - { - ++counter; - } - } - return counter; + HYPRE_Int counter = 0; + HYPRE_Int n = m->bucketMask + HYPRE_HOPSCOTCH_HASH_INSERT_RANGE; + HYPRE_Int i; + for (i = 0; i < n; ++i) + { + if ( HYPRE_HOPSCOTCH_HASH_EMPTY != m->table[i].hash ) + { + ++counter; + } + } + return counter; } HYPRE_Int *hypre_UnorderedIntSetCopyToArray( hypre_UnorderedIntSet *s, HYPRE_Int *len ); HYPRE_BigInt *hypre_UnorderedBigIntSetCopyToArray( hypre_UnorderedBigIntSet *s, HYPRE_Int *len ); //modification Operations ................................................... -static inline void +static inline HYPRE_MAYBE_UNUSED_FUNC void hypre_UnorderedIntSetPut( hypre_UnorderedIntSet *s, HYPRE_Int key ) { - //CALCULATE HASH .......................... + //CALCULATE HASH .......................... #ifdef HYPRE_BIGINT - HYPRE_Int hash = hypre_BigHash(key); + HYPRE_Int hash = hypre_BigHash(key); #else - HYPRE_Int hash = hypre_Hash(key); + HYPRE_Int hash = hypre_Hash(key); #endif - //LOCK KEY HASH ENTERY .................... + //LOCK KEY HASH ENTERY .................... #ifdef HYPRE_CONCURRENT_HOPSCOTCH - hypre_HopscotchSegment *segment = &s->segments[hash & s->segmentMask]; - omp_set_lock(&segment->lock); + hypre_HopscotchSegment *segment = &s->segments[hash & s->segmentMask]; + omp_set_lock(&segment->lock); #endif - HYPRE_Int bucket = hash&s->bucketMask; + HYPRE_Int bucket = hash & s->bucketMask; - //CHECK IF ALREADY CONTAIN ................ - hypre_uint hopInfo = s->hopInfo[bucket]; - while (0 != hopInfo) - { - HYPRE_Int i = first_lsb_bit_indx(hopInfo); - HYPRE_Int currElm = bucket + i; + //CHECK IF ALREADY CONTAIN ................ + hypre_uint hopInfo = s->hopInfo[bucket]; + while (0 != hopInfo) + { + HYPRE_Int i = first_lsb_bit_indx(hopInfo); + HYPRE_Int currElm = bucket + i; - if(hash == s->hash[currElm] && key == s->key[currElm]) - { + if (hash == s->hash[currElm] && key == s->key[currElm]) + { #ifdef HYPRE_CONCURRENT_HOPSCOTCH - omp_unset_lock(&segment->lock); -#endif - return; - } - hopInfo &= ~(1U << i); - } - - //LOOK FOR FREE BUCKET .................... - HYPRE_Int free_bucket = bucket; - HYPRE_Int free_dist = 0; - for ( ; free_dist < HYPRE_HOPSCOTCH_HASH_INSERT_RANGE; ++free_dist, ++free_bucket) - { - if( (HYPRE_HOPSCOTCH_HASH_EMPTY == s->hash[free_bucket]) && - (HYPRE_HOPSCOTCH_HASH_EMPTY == - hypre_compare_and_swap((HYPRE_Int *)&s->hash[free_bucket], - (HYPRE_Int)HYPRE_HOPSCOTCH_HASH_EMPTY, - (HYPRE_Int)HYPRE_HOPSCOTCH_HASH_BUSY)) ) - break; - } - - //PLACE THE NEW KEY ....................... - if (free_dist < HYPRE_HOPSCOTCH_HASH_INSERT_RANGE) - { - do - { - if (free_dist < HYPRE_HOPSCOTCH_HASH_HOP_RANGE) + omp_unset_lock(&segment->lock); +#endif + return; + } + hopInfo &= ~(1U << i); + } + + //LOOK FOR FREE BUCKET .................... + HYPRE_Int free_bucket = bucket; + HYPRE_Int free_dist = 0; + for ( ; free_dist < HYPRE_HOPSCOTCH_HASH_INSERT_RANGE; ++free_dist, ++free_bucket) + { + if ( (HYPRE_HOPSCOTCH_HASH_EMPTY == s->hash[free_bucket]) && + (HYPRE_HOPSCOTCH_HASH_EMPTY == + hypre_compare_and_swap((HYPRE_Int *)&s->hash[free_bucket], + (HYPRE_Int)HYPRE_HOPSCOTCH_HASH_EMPTY, + (HYPRE_Int)HYPRE_HOPSCOTCH_HASH_BUSY)) ) { - s->key[free_bucket] = key; - s->hash[free_bucket] = hash; - s->hopInfo[bucket] |= 1U << free_dist; + break; + } + } + + //PLACE THE NEW KEY ....................... + if (free_dist < HYPRE_HOPSCOTCH_HASH_INSERT_RANGE) + { + do + { + if (free_dist < HYPRE_HOPSCOTCH_HASH_HOP_RANGE) + { + s->key[free_bucket] = key; + s->hash[free_bucket] = hash; + s->hopInfo[bucket] |= 1U << free_dist; #ifdef HYPRE_CONCURRENT_HOPSCOTCH - omp_unset_lock(&segment->lock); + omp_unset_lock(&segment->lock); #endif - return; - } - hypre_UnorderedIntSetFindCloserFreeBucket(s, + return; + } + hypre_UnorderedIntSetFindCloserFreeBucket(s, #ifdef HYPRE_CONCURRENT_HOPSCOTCH - segment, + segment, #endif - &free_bucket, &free_dist); - } while (-1 != free_bucket); - } + &free_bucket, &free_dist); + } + while (-1 != free_bucket); + } - //NEED TO RESIZE .......................... - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"ERROR - RESIZE is not implemented\n"); - /*fprintf(stderr, "ERROR - RESIZE is not implemented\n");*/ - exit(1); - return; + //NEED TO RESIZE .......................... + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ERROR - RESIZE is not implemented\n"); + /*fprintf(stderr, "ERROR - RESIZE is not implemented\n");*/ + exit(1); + return; } -static inline void +static inline HYPRE_MAYBE_UNUSED_FUNC void hypre_UnorderedBigIntSetPut( hypre_UnorderedBigIntSet *s, HYPRE_BigInt key ) { - //CALCULATE HASH .......................... + //CALCULATE HASH .......................... #if defined(HYPRE_BIGINT) || defined(HYPRE_MIXEDINT) - HYPRE_BigInt hash = hypre_BigHash(key); + HYPRE_BigInt hash = hypre_BigHash(key); #else - HYPRE_BigInt hash = hypre_Hash(key); + HYPRE_BigInt hash = hypre_Hash(key); #endif - //LOCK KEY HASH ENTERY .................... + //LOCK KEY HASH ENTERY .................... #ifdef HYPRE_CONCURRENT_HOPSCOTCH - hypre_HopscotchSegment *segment = &s->segments[hash & s->segmentMask]; - omp_set_lock(&segment->lock); + hypre_HopscotchSegment *segment = &s->segments[hash & s->segmentMask]; + omp_set_lock(&segment->lock); #endif - HYPRE_Int bucket = (HYPRE_Int)(hash&s->bucketMask); + HYPRE_Int bucket = (HYPRE_Int)(hash & s->bucketMask); - //CHECK IF ALREADY CONTAIN ................ - hypre_uint hopInfo = s->hopInfo[bucket]; - while (0 != hopInfo) - { - HYPRE_Int i = first_lsb_bit_indx(hopInfo); - HYPRE_Int currElm = bucket + i; + //CHECK IF ALREADY CONTAIN ................ + hypre_uint hopInfo = s->hopInfo[bucket]; + while (0 != hopInfo) + { + HYPRE_Int i = first_lsb_bit_indx(hopInfo); + HYPRE_Int currElm = bucket + i; - if(hash == s->hash[currElm] && key == s->key[currElm]) - { + if (hash == s->hash[currElm] && key == s->key[currElm]) + { #ifdef HYPRE_CONCURRENT_HOPSCOTCH - omp_unset_lock(&segment->lock); -#endif - return; - } - hopInfo &= ~(1U << i); - } - - //LOOK FOR FREE BUCKET .................... - HYPRE_Int free_bucket = bucket; - HYPRE_Int free_dist = 0; - for ( ; free_dist < HYPRE_HOPSCOTCH_HASH_INSERT_RANGE; ++free_dist, ++free_bucket) - { - if( (HYPRE_HOPSCOTCH_HASH_EMPTY == s->hash[free_bucket]) && - (HYPRE_HOPSCOTCH_HASH_EMPTY == - hypre_compare_and_swap((HYPRE_Int *)&s->hash[free_bucket], - (HYPRE_Int)HYPRE_HOPSCOTCH_HASH_EMPTY, - (HYPRE_Int)HYPRE_HOPSCOTCH_HASH_BUSY)) ) - break; - } - - //PLACE THE NEW KEY ....................... - if (free_dist < HYPRE_HOPSCOTCH_HASH_INSERT_RANGE) - { - do - { - if (free_dist < HYPRE_HOPSCOTCH_HASH_HOP_RANGE) + omp_unset_lock(&segment->lock); +#endif + return; + } + hopInfo &= ~(1U << i); + } + + //LOOK FOR FREE BUCKET .................... + HYPRE_Int free_bucket = bucket; + HYPRE_Int free_dist = 0; + for ( ; free_dist < HYPRE_HOPSCOTCH_HASH_INSERT_RANGE; ++free_dist, ++free_bucket) + { + if ( (HYPRE_HOPSCOTCH_HASH_EMPTY == s->hash[free_bucket]) && + (HYPRE_HOPSCOTCH_HASH_EMPTY == + hypre_compare_and_swap((HYPRE_Int *)&s->hash[free_bucket], + (HYPRE_Int)HYPRE_HOPSCOTCH_HASH_EMPTY, + (HYPRE_Int)HYPRE_HOPSCOTCH_HASH_BUSY)) ) { - s->key[free_bucket] = key; - s->hash[free_bucket] = hash; - s->hopInfo[bucket] |= 1U << free_dist; + break; + } + } + + //PLACE THE NEW KEY ....................... + if (free_dist < HYPRE_HOPSCOTCH_HASH_INSERT_RANGE) + { + do + { + if (free_dist < HYPRE_HOPSCOTCH_HASH_HOP_RANGE) + { + s->key[free_bucket] = key; + s->hash[free_bucket] = hash; + s->hopInfo[bucket] |= 1U << free_dist; #ifdef HYPRE_CONCURRENT_HOPSCOTCH - omp_unset_lock(&segment->lock); + omp_unset_lock(&segment->lock); #endif - return; - } - hypre_UnorderedBigIntSetFindCloserFreeBucket(s, + return; + } + hypre_UnorderedBigIntSetFindCloserFreeBucket(s, #ifdef HYPRE_CONCURRENT_HOPSCOTCH - segment, + segment, #endif - &free_bucket, &free_dist); - } while (-1 != free_bucket); - } - - //NEED TO RESIZE .......................... - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"ERROR - RESIZE is not implemented\n"); - /*fprintf(stderr, "ERROR - RESIZE is not implemented\n");*/ - exit(1); - return; + &free_bucket, &free_dist); + } + while (-1 != free_bucket); + } + + //NEED TO RESIZE .......................... + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ERROR - RESIZE is not implemented\n"); + /*fprintf(stderr, "ERROR - RESIZE is not implemented\n");*/ + exit(1); + return; } -static inline HYPRE_Int +static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_Int hypre_UnorderedIntMapPutIfAbsent( hypre_UnorderedIntMap *m, HYPRE_Int key, HYPRE_Int data ) { - //CALCULATE HASH .......................... + //CALCULATE HASH .......................... #ifdef HYPRE_BIGINT - HYPRE_Int hash = hypre_BigHash(key); + HYPRE_Int hash = hypre_BigHash(key); #else - HYPRE_Int hash = hypre_Hash(key); + HYPRE_Int hash = hypre_Hash(key); #endif - //LOCK KEY HASH ENTERY .................... + //LOCK KEY HASH ENTERY .................... #ifdef HYPRE_CONCURRENT_HOPSCOTCH - hypre_HopscotchSegment *segment = &m->segments[hash & m->segmentMask]; - omp_set_lock(&segment->lock); -#endif - hypre_HopscotchBucket* startBucket = &(m->table[hash & m->bucketMask]); - - //CHECK IF ALREADY CONTAIN ................ - hypre_uint hopInfo = startBucket->hopInfo; - while (0 != hopInfo) - { - HYPRE_Int i = first_lsb_bit_indx(hopInfo); - hypre_HopscotchBucket* currElm = startBucket + i; - if (hash == currElm->hash && key == currElm->key) - { - HYPRE_Int rc = currElm->data; + hypre_HopscotchSegment *segment = &m->segments[hash & m->segmentMask]; + omp_set_lock(&segment->lock); +#endif + hypre_HopscotchBucket* startBucket = &(m->table[hash & m->bucketMask]); + + //CHECK IF ALREADY CONTAIN ................ + hypre_uint hopInfo = startBucket->hopInfo; + while (0 != hopInfo) + { + HYPRE_Int i = first_lsb_bit_indx(hopInfo); + hypre_HopscotchBucket* currElm = startBucket + i; + if (hash == currElm->hash && key == currElm->key) + { + HYPRE_Int rc = currElm->data; #ifdef HYPRE_CONCURRENT_HOPSCOTCH - omp_unset_lock(&segment->lock); -#endif - return rc; - } - hopInfo &= ~(1U << i); - } - - //LOOK FOR FREE BUCKET .................... - hypre_HopscotchBucket* free_bucket = startBucket; - HYPRE_Int free_dist = 0; - for ( ; free_dist < HYPRE_HOPSCOTCH_HASH_INSERT_RANGE; ++free_dist, ++free_bucket) - { - if( (HYPRE_HOPSCOTCH_HASH_EMPTY == free_bucket->hash) && - (HYPRE_HOPSCOTCH_HASH_EMPTY == + omp_unset_lock(&segment->lock); +#endif + return rc; + } + hopInfo &= ~(1U << i); + } + + //LOOK FOR FREE BUCKET .................... + hypre_HopscotchBucket* free_bucket = startBucket; + HYPRE_Int free_dist = 0; + for ( ; free_dist < HYPRE_HOPSCOTCH_HASH_INSERT_RANGE; ++free_dist, ++free_bucket) + { + if ( (HYPRE_HOPSCOTCH_HASH_EMPTY == free_bucket->hash) && + (HYPRE_HOPSCOTCH_HASH_EMPTY == hypre_compare_and_swap((HYPRE_Int *)&free_bucket->hash, (HYPRE_Int)HYPRE_HOPSCOTCH_HASH_EMPTY, (HYPRE_Int)HYPRE_HOPSCOTCH_HASH_BUSY)) ) - break; - } - - //PLACE THE NEW KEY ....................... - if (free_dist < HYPRE_HOPSCOTCH_HASH_INSERT_RANGE) - { - do - { - if (free_dist < HYPRE_HOPSCOTCH_HASH_HOP_RANGE) { - free_bucket->data = data; - free_bucket->key = key; - free_bucket->hash = hash; - startBucket->hopInfo |= 1U << free_dist; + break; + } + } + + //PLACE THE NEW KEY ....................... + if (free_dist < HYPRE_HOPSCOTCH_HASH_INSERT_RANGE) + { + do + { + if (free_dist < HYPRE_HOPSCOTCH_HASH_HOP_RANGE) + { + free_bucket->data = data; + free_bucket->key = key; + free_bucket->hash = hash; + startBucket->hopInfo = startBucket->hopInfo | (1U << free_dist); #ifdef HYPRE_CONCURRENT_HOPSCOTCH - omp_unset_lock(&segment->lock); + omp_unset_lock(&segment->lock); #endif - return HYPRE_HOPSCOTCH_HASH_EMPTY; - } - hypre_UnorderedIntMapFindCloserFreeBucket(m, + return HYPRE_HOPSCOTCH_HASH_EMPTY; + } + hypre_UnorderedIntMapFindCloserFreeBucket(m, #ifdef HYPRE_CONCURRENT_HOPSCOTCH - segment, + segment, #endif - &free_bucket, &free_dist); - } while (NULL != free_bucket); - } + &free_bucket, &free_dist); + } + while (NULL != free_bucket); + } - //NEED TO RESIZE .......................... - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"ERROR - RESIZE is not implemented\n"); - /*fprintf(stderr, "ERROR - RESIZE is not implemented\n");*/ - exit(1); - return HYPRE_HOPSCOTCH_HASH_EMPTY; + //NEED TO RESIZE .......................... + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ERROR - RESIZE is not implemented\n"); + /*fprintf(stderr, "ERROR - RESIZE is not implemented\n");*/ + exit(1); + return HYPRE_HOPSCOTCH_HASH_EMPTY; } -static inline HYPRE_Int +static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_Int hypre_UnorderedBigIntMapPutIfAbsent( hypre_UnorderedBigIntMap *m, HYPRE_BigInt key, HYPRE_Int data) { - //CALCULATE HASH .......................... + //CALCULATE HASH .......................... #if defined(HYPRE_BIGINT) || defined(HYPRE_MIXEDINT) - HYPRE_BigInt hash = hypre_BigHash(key); + HYPRE_BigInt hash = hypre_BigHash(key); #else - HYPRE_BigInt hash = hypre_Hash(key); + HYPRE_BigInt hash = hypre_Hash(key); #endif - //LOCK KEY HASH ENTERY .................... + //LOCK KEY HASH ENTERY .................... #ifdef HYPRE_CONCURRENT_HOPSCOTCH - hypre_HopscotchSegment *segment = &m->segments[hash & m->segmentMask]; - omp_set_lock(&segment->lock); -#endif - hypre_BigHopscotchBucket* startBucket = &(m->table[hash & m->bucketMask]); - - //CHECK IF ALREADY CONTAIN ................ - hypre_uint hopInfo = startBucket->hopInfo; - while (0 != hopInfo) - { - HYPRE_Int i = first_lsb_bit_indx(hopInfo); - hypre_BigHopscotchBucket* currElm = startBucket + i; - if (hash == currElm->hash && key == currElm->key) - { - HYPRE_Int rc = currElm->data; -#ifdef HYPRE_CONCURRENT_HOPSCOTCH - omp_unset_lock(&segment->lock); -#endif - return rc; - } - hopInfo &= ~(1U << i); - } - - //LOOK FOR FREE BUCKET .................... - hypre_BigHopscotchBucket* free_bucket = startBucket; - HYPRE_Int free_dist = 0; - for ( ; free_dist < HYPRE_HOPSCOTCH_HASH_INSERT_RANGE; ++free_dist, ++free_bucket) - { - if( (HYPRE_HOPSCOTCH_HASH_EMPTY == free_bucket->hash) && - (HYPRE_HOPSCOTCH_HASH_EMPTY == - hypre_compare_and_swap((HYPRE_Int *)&free_bucket->hash, - (HYPRE_Int)HYPRE_HOPSCOTCH_HASH_EMPTY, - (HYPRE_Int)HYPRE_HOPSCOTCH_HASH_BUSY)) ) - break; - } - - //PLACE THE NEW KEY ....................... - if (free_dist < HYPRE_HOPSCOTCH_HASH_INSERT_RANGE) - { - do - { - if (free_dist < HYPRE_HOPSCOTCH_HASH_HOP_RANGE) + hypre_HopscotchSegment *segment = &m->segments[hash & m->segmentMask]; + omp_set_lock(&segment->lock); +#endif + hypre_BigHopscotchBucket* startBucket = &(m->table[hash & m->bucketMask]); + + //CHECK IF ALREADY CONTAIN ................ + hypre_uint hopInfo = startBucket->hopInfo; + while (0 != hopInfo) + { + HYPRE_Int i = first_lsb_bit_indx(hopInfo); + hypre_BigHopscotchBucket* currElm = startBucket + i; + if (hash == currElm->hash && key == currElm->key) { - free_bucket->data = data; - free_bucket->key = key; - free_bucket->hash = hash; - startBucket->hopInfo |= 1U << free_dist; + HYPRE_Int rc = currElm->data; #ifdef HYPRE_CONCURRENT_HOPSCOTCH - omp_unset_lock(&segment->lock); + omp_unset_lock(&segment->lock); #endif - return HYPRE_HOPSCOTCH_HASH_EMPTY; + return rc; } - hypre_UnorderedBigIntMapFindCloserFreeBucket(m, + hopInfo &= ~(1U << i); + } + + //LOOK FOR FREE BUCKET .................... + hypre_BigHopscotchBucket* free_bucket = startBucket; + HYPRE_Int free_dist = 0; + for ( ; free_dist < HYPRE_HOPSCOTCH_HASH_INSERT_RANGE; ++free_dist, ++free_bucket) + { + if ( (HYPRE_HOPSCOTCH_HASH_EMPTY == free_bucket->hash) && + (HYPRE_HOPSCOTCH_HASH_EMPTY == + hypre_compare_and_swap((HYPRE_Int *)&free_bucket->hash, + (HYPRE_Int)HYPRE_HOPSCOTCH_HASH_EMPTY, + (HYPRE_Int)HYPRE_HOPSCOTCH_HASH_BUSY)) ) + { + break; + } + } + + //PLACE THE NEW KEY ....................... + if (free_dist < HYPRE_HOPSCOTCH_HASH_INSERT_RANGE) + { + do + { + if (free_dist < HYPRE_HOPSCOTCH_HASH_HOP_RANGE) + { + free_bucket->data = data; + free_bucket->key = key; + free_bucket->hash = hash; + startBucket->hopInfo = startBucket->hopInfo | (1U << free_dist); #ifdef HYPRE_CONCURRENT_HOPSCOTCH - segment, + omp_unset_lock(&segment->lock); #endif - &free_bucket, &free_dist); - } while (NULL != free_bucket); - } - - //NEED TO RESIZE .......................... - hypre_error_w_msg(HYPRE_ERROR_GENERIC,"ERROR - RESIZE is not implemented\n"); - /*fprintf(stderr, "ERROR - RESIZE is not implemented\n");*/ - exit(1); - return HYPRE_HOPSCOTCH_HASH_EMPTY; + return HYPRE_HOPSCOTCH_HASH_EMPTY; + } + hypre_UnorderedBigIntMapFindCloserFreeBucket(m, +#ifdef HYPRE_CONCURRENT_HOPSCOTCH + segment, +#endif + &free_bucket, &free_dist); + } + while (NULL != free_bucket); + } + + //NEED TO RESIZE .......................... + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "ERROR - RESIZE is not implemented\n"); + /*fprintf(stderr, "ERROR - RESIZE is not implemented\n");*/ + exit(1); + return HYPRE_HOPSCOTCH_HASH_EMPTY; } #ifdef __cplusplus diff --git a/external/hypre/src/utilities/int_array.c b/external/hypre/src/utilities/int_array.c index d0e02224..6ba520f2 100644 --- a/external/hypre/src/utilities/int_array.c +++ b/external/hypre/src/utilities/int_array.c @@ -1,12 +1,11 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ #include "_hypre_utilities.h" -#include "_hypre_utilities.hpp" /****************************************************************************** * @@ -40,8 +39,6 @@ hypre_IntArrayCreate( HYPRE_Int size ) HYPRE_Int hypre_IntArrayDestroy( hypre_IntArray *array ) { - HYPRE_Int ierr=0; - if (array) { HYPRE_MemoryLocation memory_location = hypre_IntArrayMemoryLocation(array); @@ -51,7 +48,7 @@ hypre_IntArrayDestroy( hypre_IntArray *array ) hypre_TFree(array, HYPRE_MEMORY_HOST); } - return ierr; + return hypre_error_flag; } /*-------------------------------------------------------------------------- @@ -62,7 +59,6 @@ HYPRE_Int hypre_IntArrayInitialize_v2( hypre_IntArray *array, HYPRE_MemoryLocation memory_location ) { HYPRE_Int size = hypre_IntArraySize(array); - HYPRE_Int ierr = 0; hypre_IntArrayMemoryLocation(array) = memory_location; @@ -70,37 +66,38 @@ hypre_IntArrayInitialize_v2( hypre_IntArray *array, HYPRE_MemoryLocation memory_ * to be consistent with `memory_location' * Otherwise, mismatches will exist and problems will be encountered * when being used, and freed */ - if ( !hypre_IntArrayData(array) ) + if (!hypre_IntArrayData(array)) { hypre_IntArrayData(array) = hypre_CTAlloc(HYPRE_Int, size, memory_location); } - return ierr; + return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_IntArrayInitialize + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_IntArrayInitialize( hypre_IntArray *array ) { - HYPRE_Int ierr; + hypre_IntArrayInitialize_v2( array, hypre_IntArrayMemoryLocation(array) ); - ierr = hypre_IntArrayInitialize_v2( array, hypre_IntArrayMemoryLocation(array) ); - - return ierr; + return hypre_error_flag; } - /*-------------------------------------------------------------------------- * hypre_IntArrayCopy - * copies data from x to y + * + * Copies data from x to y * if size of x is larger than y only the first size_y elements of x are * copied to y *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_IntArrayCopy( hypre_IntArray *x, hypre_IntArray *y ) { - HYPRE_Int ierr = 0; - size_t size = hypre_min( hypre_IntArraySize(x), hypre_IntArraySize(y) ); hypre_TMemcpy( hypre_IntArrayData(y), @@ -110,12 +107,11 @@ hypre_IntArrayCopy( hypre_IntArray *x, hypre_IntArrayMemoryLocation(y), hypre_IntArrayMemoryLocation(x) ); - return ierr; + return hypre_error_flag; } /*-------------------------------------------------------------------------- - * hypre_IntArrayCloneDeep - * Returns a complete copy of x - a deep copy, with its own copy of the data. + * hypre_IntArrayCloneDeep_v2 *--------------------------------------------------------------------------*/ hypre_IntArray * @@ -131,12 +127,169 @@ hypre_IntArrayCloneDeep_v2( hypre_IntArray *x, HYPRE_MemoryLocation memory_locat return y; } +/*-------------------------------------------------------------------------- + * hypre_IntArrayCloneDeep + * Returns a complete copy of x - a deep copy, with its own copy of the data. + *--------------------------------------------------------------------------*/ + hypre_IntArray * hypre_IntArrayCloneDeep( hypre_IntArray *x ) { return hypre_IntArrayCloneDeep_v2(x, hypre_IntArrayMemoryLocation(x)); } +/*-------------------------------------------------------------------------- + * hypre_IntArrayMigrate + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IntArrayMigrate( hypre_IntArray *v, + HYPRE_MemoryLocation memory_location ) +{ + HYPRE_Int size = hypre_IntArraySize(v); + HYPRE_Int *v_data = hypre_IntArrayData(v); + HYPRE_MemoryLocation old_memory_location = hypre_IntArrayMemoryLocation(v); + + HYPRE_Int *w_data; + + /* Update v's memory location */ + hypre_IntArrayMemoryLocation(v) = memory_location; + + if ( hypre_GetActualMemLocation(memory_location) != + hypre_GetActualMemLocation(old_memory_location) ) + { + w_data = hypre_TAlloc(HYPRE_Int, size, memory_location); + hypre_TMemcpy(w_data, v_data, HYPRE_Int, size, + memory_location, old_memory_location); + hypre_TFree(v_data, old_memory_location); + hypre_IntArrayData(v) = w_data; + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_IntArrayPrint + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IntArrayPrint( MPI_Comm comm, + hypre_IntArray *array, + const char *filename ) +{ + HYPRE_Int size = hypre_IntArraySize(array); + HYPRE_MemoryLocation memory_location = hypre_IntArrayMemoryLocation(array); + + hypre_IntArray *h_array; + HYPRE_Int *data; + + FILE *file; + HYPRE_Int i, myid; + char new_filename[1024]; + + hypre_MPI_Comm_rank(comm, &myid); + + /* Move data to host if needed*/ + h_array = (hypre_GetActualMemLocation(memory_location) == hypre_MEMORY_DEVICE) ? + hypre_IntArrayCloneDeep_v2(array, HYPRE_MEMORY_HOST) : array; + data = hypre_IntArrayData(h_array); + + /* Open file */ + hypre_sprintf(new_filename, "%s.%05d", filename, myid); + if ((file = fopen(new_filename, "w")) == NULL) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Error: can't open output file\n"); + return hypre_error_flag; + } + + /* Print to file */ + hypre_fprintf(file, "%d\n", size); + for (i = 0; i < size; i++) + { + hypre_fprintf(file, "%d\n", data[i]); + } + fclose(file); + + /* Free memory */ + if (h_array != array) + { + hypre_IntArrayDestroy(h_array); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_IntArrayRead + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IntArrayRead( MPI_Comm comm, + const char *filename, + hypre_IntArray **array_ptr ) +{ + hypre_IntArray *array; + HYPRE_Int size; + FILE *file; + HYPRE_Int i, myid; + char new_filename[1024]; + + hypre_MPI_Comm_rank(comm, &myid); + + /* Open file */ + hypre_sprintf(new_filename, "%s.%05d", filename, myid); + if ((file = fopen(new_filename, "r")) == NULL) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Error: can't open input file\n"); + return hypre_error_flag; + } + + /* Read array size from file */ + hypre_fscanf(file, "%d\n", &size); + + /* Create IntArray on the host */ + array = hypre_IntArrayCreate(size); + hypre_IntArrayInitialize_v2(array, HYPRE_MEMORY_HOST); + + /* Read array values from file */ + for (i = 0; i < size; i++) + { + hypre_fscanf(file, "%d\n", &hypre_IntArrayData(array)[i]); + } + fclose(file); + + /* Migrate to final memory location */ + hypre_IntArrayMigrate(array, hypre_HandleMemoryLocation(hypre_handle())); + + /* Set output pointer */ + *array_ptr = array; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_IntArraySetConstantValuesHost + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IntArraySetConstantValuesHost( hypre_IntArray *v, + HYPRE_Int value ) +{ + HYPRE_Int *array_data = hypre_IntArrayData(v); + HYPRE_Int size = hypre_IntArraySize(v); + HYPRE_Int i; + +#if defined(HYPRE_USING_OPENMP) + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < size; i++) + { + array_data[i] = value; + } + + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- * hypre_IntArraySetConstantValues *--------------------------------------------------------------------------*/ @@ -145,32 +298,430 @@ HYPRE_Int hypre_IntArraySetConstantValues( hypre_IntArray *v, HYPRE_Int value ) { - HYPRE_Int *array_data = hypre_IntArrayData(v); - HYPRE_Int size = hypre_IntArraySize(v); - HYPRE_Int ierr = 0; + if (hypre_IntArraySize(v) <= 0) + { + return hypre_error_flag; + } + +#if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1(hypre_IntArrayMemoryLocation(v)); -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - if (size > 0) + if (exec == HYPRE_EXEC_DEVICE) { - HYPRE_THRUST_CALL( fill_n, array_data, size, value ); + hypre_IntArraySetConstantValuesDevice(v, value); } -#else - HYPRE_Int i; -#if defined(HYPRE_USING_DEVICE_OPENMP) -#pragma omp target teams distribute parallel for private(i) is_device_ptr(array_data) -#elif defined(HYPRE_USING_OPENMP) -#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE + else +#endif + { + hypre_IntArraySetConstantValuesHost(v, value); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_IntArraySetInterleavedValuesHost + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IntArraySetInterleavedValuesHost( hypre_IntArray *v, + HYPRE_Int cycle ) +{ + HYPRE_Int *array_data = hypre_IntArrayData(v); + HYPRE_Int size = hypre_IntArraySize(v); + HYPRE_Int i; + +#if defined(HYPRE_USING_OPENMP) + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE #endif for (i = 0; i < size; i++) { - array_data[i] = value; + array_data[i] = i % cycle; + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_IntArraySetInterleavedValues + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IntArraySetInterleavedValues( hypre_IntArray *v, + HYPRE_Int cycle ) +{ + if (cycle < 1) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Invalid cycle value!"); + return hypre_error_flag; + } + +#if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1(hypre_IntArrayMemoryLocation(v)); + + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_IntArraySetInterleavedValuesDevice(v, cycle); + } + else +#endif + { + hypre_IntArraySetInterleavedValuesHost(v, cycle); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_IntArrayCountHost + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IntArrayCountHost( hypre_IntArray *v, + HYPRE_Int value, + HYPRE_Int *num_values_ptr ) +{ + HYPRE_Int *array_data = hypre_IntArrayData(v); + HYPRE_Int size = hypre_IntArraySize(v); + HYPRE_Int num_values = 0; + HYPRE_Int i; + +#if !defined(_MSC_VER) && defined(HYPRE_USING_OPENMP) + #pragma omp parallel for private(i) reduction(+:num_values) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < size; i++) + { + num_values += (array_data[i] == value) ? 1 : 0; + } + + *num_values_ptr = num_values; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_IntArrayCount + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IntArrayCount( hypre_IntArray *v, + HYPRE_Int value, + HYPRE_Int *num_values_ptr ) +{ + if (hypre_IntArraySize(v) <= 0) + { + *num_values_ptr = 0; + return hypre_error_flag; + } + +#if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1(hypre_IntArrayMemoryLocation(v)); + + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_IntArrayCountDevice(v, value, num_values_ptr); + } + else +#endif + { + hypre_IntArrayCountHost(v, value, num_values_ptr); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_IntArrayInverseMappingHost + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IntArrayInverseMappingHost( hypre_IntArray *v, + hypre_IntArray *w ) +{ + HYPRE_Int size = hypre_IntArraySize(v); + HYPRE_Int *v_data = hypre_IntArrayData(v); + HYPRE_Int *w_data = hypre_IntArrayData(w); + + HYPRE_Int i; + +#if defined(HYPRE_USING_OPENMP) + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < size; i++) + { + w_data[v_data[i]] = i; + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_IntArrayInverseMapping + * + * Compute the reverse mapping (w) given an input array (v) + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IntArrayInverseMapping( hypre_IntArray *v, + hypre_IntArray **w_ptr ) +{ + HYPRE_Int size = hypre_IntArraySize(v); + HYPRE_MemoryLocation memory_location = hypre_IntArrayMemoryLocation(v); + hypre_IntArray *w; + + /* Create and initialize output array */ + w = hypre_IntArrayCreate(size); + hypre_IntArrayInitialize_v2(w, memory_location); + + /* Exit if array has no elements */ + if (hypre_IntArraySize(w) <= 0) + { + *w_ptr = w; + + return hypre_error_flag; + } + +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1(memory_location); + + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_IntArrayInverseMappingDevice(v, w); + } + else +#endif + { + hypre_IntArrayInverseMappingHost(v, w); + } + + /* Set output pointer */ + *w_ptr = w; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_IntArrayNegate + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IntArrayNegate( hypre_IntArray *v ) +{ + HYPRE_Int *array_data = hypre_IntArrayData(v); + HYPRE_Int size = hypre_IntArraySize(v); + HYPRE_Int i; + + if (size <= 0) + { + return hypre_error_flag; } -#endif /* defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) */ #if defined(HYPRE_USING_GPU) - hypre_SyncCudaComputeStream(hypre_handle()); + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1(hypre_IntArrayMemoryLocation(v)); + + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_IntArrayNegateDevice(v); + } + else +#endif + { +#if defined(HYPRE_USING_OPENMP) + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < size; i++) + { + array_data[i] = - array_data[i]; + } + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_IntArraySeparateByValue + * + * This function separates the indices of an array "v" based on + * specified values. + * + * Input parameters: + * - num_values: number of unique values found in "v" + * - values: array of size "num_values" containing a list of unique values + * - sizes: array of size "num_values" containing the number of occurrences + * in "v" of each value from "values". + * - v: object of type hypre_IntArray containing values for categorization. + * + * Output parameter: + * - w: object of type hypre_IntArrayArray containing pointers to "num_values" + * arrays. Each array contains the set of indices in "v" that map to a + * particular value of the array "values". + * + * Example: + * Consider the following: + * - v = {-1, -1, 1, -1, -1, 1, 1, -1} + * - values = {-1, 1} + * - num_values = 2 + * + * This function computes: + * - w[0] = {0, 1, 3, 4, 7} + * - w[1] = {2, 5, 6} + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IntArraySeparateByValue( HYPRE_Int num_values, + HYPRE_Int *values, + HYPRE_Int *sizes, + hypre_IntArray *v, + hypre_IntArrayArray **w_ptr ) +{ + hypre_IntArrayArray *w; + + HYPRE_Int *v_data = hypre_IntArrayData(v); + HYPRE_Int v_size = hypre_IntArraySize(v); + HYPRE_Int i, k, val; + HYPRE_Int *count; + + /* Create output array */ + w = hypre_IntArrayArrayCreate(num_values, sizes); + hypre_IntArrayArrayInitializeIn(w, hypre_IntArrayMemoryLocation(v)); + + /* Fill arrays */ +#if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1(hypre_IntArrayMemoryLocation(v)); + + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_IntArraySeparateByValueDevice(num_values, values, sizes, v, w); + } + else #endif + { + count = hypre_CTAlloc(HYPRE_Int, num_values, HYPRE_MEMORY_HOST); + for (k = 0; k < v_size; k++) + { + val = v_data[k]; + + /* Find which entry "val" belongs to */ + for (i = 0; i < num_values; i++) + { + if (values[i] == val) + { + hypre_IntArrayArrayEntryIDataJ(w, i, count[i]++) = k; + break; + } + } + } + hypre_TFree(count, HYPRE_MEMORY_HOST); + } + + /* Set output pointer */ + *w_ptr = w; + + return hypre_error_flag; +} + +/****************************************************************************** + * + * Routines for hypre_IntArrayArray struct + * + *****************************************************************************/ + +/*-------------------------------------------------------------------------- + * hypre_IntArrayArrayCreate + *--------------------------------------------------------------------------*/ + +hypre_IntArrayArray * +hypre_IntArrayArrayCreate( HYPRE_Int num_entries, + HYPRE_Int *sizes ) +{ + hypre_IntArrayArray *w; + HYPRE_Int i; + + w = hypre_CTAlloc(hypre_IntArrayArray, 1, HYPRE_MEMORY_HOST); + + hypre_IntArrayArraySize(w) = num_entries; + hypre_IntArrayArrayEntries(w) = hypre_TAlloc(hypre_IntArray*, num_entries, HYPRE_MEMORY_HOST); + + for (i = 0; i < num_entries; i++) + { + hypre_IntArrayArrayEntryI(w, i) = hypre_IntArrayCreate(sizes[i]); + } + + return w; +} + +/*-------------------------------------------------------------------------- + * hypre_IntArrayArrayDestroy + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IntArrayArrayDestroy( hypre_IntArrayArray *w ) +{ + HYPRE_Int i; - return ierr; + if (w) + { + for (i = 0; i < hypre_IntArrayArraySize(w); i++) + { + hypre_IntArrayDestroy(hypre_IntArrayArrayEntryI(w, i)); + } + hypre_TFree(hypre_IntArrayArrayEntries(w), HYPRE_MEMORY_HOST); + hypre_TFree(w, HYPRE_MEMORY_HOST); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_IntArrayArrayInitializeIn + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IntArrayArrayInitializeIn( hypre_IntArrayArray *w, + HYPRE_MemoryLocation memory_location ) +{ + HYPRE_Int i; + + for (i = 0; i < hypre_IntArrayArraySize(w); i++) + { + hypre_IntArrayInitialize_v2(hypre_IntArrayArrayEntryI(w, i), memory_location); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_IntArrayArrayInitialize + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IntArrayArrayInitialize( hypre_IntArrayArray *w ) +{ + hypre_IntArray *v = hypre_IntArrayArrayEntryI(w, 0); + HYPRE_Int i; + + for (i = 0; i < hypre_IntArrayArraySize(w); i++) + { + hypre_IntArrayInitialize_v2(v, hypre_IntArrayMemoryLocation(v)); + } + + return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_IntArrayArrayMigrate + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IntArrayArrayMigrate( hypre_IntArrayArray *w, + HYPRE_MemoryLocation memory_location ) +{ + HYPRE_Int i; + + for (i = 0; i < hypre_IntArrayArraySize(w); i++) + { + hypre_IntArrayMigrate(hypre_IntArrayArrayEntryI(w, i), memory_location); + } + + return hypre_error_flag; +} diff --git a/external/hypre/src/utilities/int_array.h b/external/hypre/src/utilities/int_array.h index b1acaa7c..e26d7cfa 100644 --- a/external/hypre/src/utilities/int_array.h +++ b/external/hypre/src/utilities/int_array.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -18,9 +18,9 @@ * hypre_IntArray *--------------------------------------------------------------------------*/ -typedef struct +typedef struct { - /* pointer to data and size of data */ + /* pointer to data and size of data */ HYPRE_Int *data; HYPRE_Int size; @@ -33,7 +33,34 @@ typedef struct *--------------------------------------------------------------------------*/ #define hypre_IntArrayData(array) ((array) -> data) +#define hypre_IntArrayDataI(array, i) ((array) -> data[i]) #define hypre_IntArraySize(array) ((array) -> size) #define hypre_IntArrayMemoryLocation(array) ((array) -> memory_location) +/****************************************************************************** + * + * hypre_IntArrayArray: struct for holding an array of hypre_IntArray + * + *****************************************************************************/ + +/*-------------------------------------------------------------------------- + * hypre_IntArrayArray + *--------------------------------------------------------------------------*/ + +typedef struct +{ + hypre_IntArray **entries; + HYPRE_Int size; +} hypre_IntArrayArray; + +/*-------------------------------------------------------------------------- + * Accessor functions for the IntArrayArray structure + *--------------------------------------------------------------------------*/ + +#define hypre_IntArrayArrayEntries(array) ((array) -> entries) +#define hypre_IntArrayArrayEntryI(array, i) ((array) -> entries[i]) +#define hypre_IntArrayArrayEntryIData(array, i) ((array) -> entries[i] -> data) +#define hypre_IntArrayArrayEntryIDataJ(array, i, j) ((array) -> entries[i] -> data[j]) +#define hypre_IntArrayArraySize(array) ((array) -> size) + #endif diff --git a/external/hypre/src/utilities/int_array_device.c b/external/hypre/src/utilities/int_array_device.c new file mode 100644 index 00000000..813c3f67 --- /dev/null +++ b/external/hypre/src/utilities/int_array_device.c @@ -0,0 +1,225 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#include "_hypre_utilities.h" +#include "_hypre_utilities.hpp" +#include "_hypre_onedpl.hpp" + +/* GPU kernels */ +#if defined(HYPRE_USING_GPU) + +/*-------------------------------------------------------------------------- + * hypreGPUKernel_IntArrayInverseMapping + *--------------------------------------------------------------------------*/ + +__global__ void +hypreGPUKernel_IntArrayInverseMapping( hypre_DeviceItem &item, + HYPRE_Int size, + HYPRE_Int *v_data, + HYPRE_Int *w_data ) +{ + HYPRE_Int i = hypre_gpu_get_grid_thread_id<1, 1>(item); + + if (i < size) + { + w_data[v_data[i]] = i; + } +} +#endif + +/* Functions */ +#if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) + +/*-------------------------------------------------------------------------- + * hypre_IntArraySetConstantValuesDevice + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IntArraySetConstantValuesDevice( hypre_IntArray *v, + HYPRE_Int value ) +{ + HYPRE_Int *array_data = hypre_IntArrayData(v); + HYPRE_Int size = hypre_IntArraySize(v); + +#if defined(HYPRE_USING_GPU) + hypreDevice_IntFilln( array_data, size, value ); + + hypre_SyncComputeStream(); + +#elif defined(HYPRE_USING_DEVICE_OPENMP) + HYPRE_Int i; + #pragma omp target teams distribute parallel for private(i) is_device_ptr(array_data) + for (i = 0; i < size; i++) + { + array_data[i] = value; + } +#endif + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_IntArrayInverseMappingDevice + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IntArrayInverseMappingDevice( hypre_IntArray *v, + hypre_IntArray *w ) +{ + HYPRE_Int size = hypre_IntArraySize(v); + HYPRE_Int *v_data = hypre_IntArrayData(v); + HYPRE_Int *w_data = hypre_IntArrayData(w); + +#if defined(HYPRE_USING_GPU) + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(size, "thread", bDim); + + HYPRE_GPU_LAUNCH( hypreGPUKernel_IntArrayInverseMapping, gDim, bDim, size, v_data, w_data ); + hypre_SyncComputeStream(); + +#elif defined(HYPRE_USING_DEVICE_OPENMP) + HYPRE_Int i; + + #pragma omp target teams distribute parallel for private(i) is_device_ptr(v_data, w_data) + for (i = 0; i < size; i++) + { + w_data[v_data[i]] = i; + } +#endif + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_IntArrayCountDevice + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IntArrayCountDevice( hypre_IntArray *v, + HYPRE_Int value, + HYPRE_Int *num_values_ptr ) +{ + HYPRE_Int *array_data = hypre_IntArrayData(v); + HYPRE_Int size = hypre_IntArraySize(v); + +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + *num_values_ptr = HYPRE_THRUST_CALL( count, + array_data, + array_data + size, + value ); + +#elif defined(HYPRE_USING_SYCL) + *num_values_ptr = HYPRE_ONEDPL_CALL( std::count, + array_data, + array_data + size, + value ); + +#elif defined (HYPRE_USING_DEVICE_OPENMP) + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Function not implemented for Device OpenMP"); + *num_values_ptr = 0; +#endif + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_IntArrayNegateDevice + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IntArrayNegateDevice( hypre_IntArray *v ) +{ +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + HYPRE_THRUST_CALL( transform, + hypre_IntArrayData(v), + hypre_IntArrayData(v) + hypre_IntArraySize(v), + hypre_IntArrayData(v), + thrust::negate() ); +#elif defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::transform, + hypre_IntArrayData(v), + hypre_IntArrayData(v) + hypre_IntArraySize(v), + hypre_IntArrayData(v), + std::negate() ); +#else + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Not implemented yet!"); +#endif + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_IntArraySetInterleavedValuesDevice + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IntArraySetInterleavedValuesDevice( hypre_IntArray *v, + HYPRE_Int cycle ) +{ +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + HYPRE_THRUST_CALL( sequence, + hypre_IntArrayData(v), + hypre_IntArrayData(v) + hypre_IntArraySize(v)); + + HYPRE_THRUST_CALL( transform, + hypre_IntArrayData(v), + hypre_IntArrayData(v) + hypre_IntArraySize(v), + hypre_IntArrayData(v), + hypreFunctor_IndexCycle(cycle) ); + +#else + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Not implemented yet!"); +#endif + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_IntArraySeparateByValueDevice + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IntArraySeparateByValueDevice( HYPRE_Int num_values, + HYPRE_Int *values, + HYPRE_Int *sizes, + hypre_IntArray *v, + hypre_IntArrayArray *w ) +{ +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + HYPRE_Int v_size = hypre_IntArraySize(v); + HYPRE_Int *v_data = hypre_IntArrayData(v); + HYPRE_Int *indices, *buffer; + HYPRE_Int i, val; + + /* Create a sequence of all indices */ + indices = hypre_TAlloc(HYPRE_Int, v_size, HYPRE_MEMORY_DEVICE); + HYPRE_THRUST_CALL(sequence, indices, indices + v_size); + + /* Create a buffer array */ + buffer = hypre_TAlloc(HYPRE_Int, v_size, HYPRE_MEMORY_DEVICE); + + for (i = 0; i < num_values; i++) + { + val = values[i]; + + HYPRE_THRUST_CALL(copy_if, indices, indices + v_size, v_data, buffer, equal(val)); + + hypre_TMemcpy(hypre_IntArrayArrayEntryIData(w, i), buffer, HYPRE_Int, sizes[i], + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + } + + /* Free memory */ + hypre_TFree(indices, HYPRE_MEMORY_DEVICE); + hypre_TFree(buffer, HYPRE_MEMORY_DEVICE); +#else + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Not implemented yet!"); +#endif + + return hypre_error_flag; +} + +#endif diff --git a/external/hypre/src/utilities/log.c b/external/hypre/src/utilities/log.c index 4308d7e5..fed79113 100644 --- a/external/hypre/src/utilities/log.c +++ b/external/hypre/src/utilities/log.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/utilities/magma.c b/external/hypre/src/utilities/magma.c new file mode 100644 index 00000000..f03a671e --- /dev/null +++ b/external/hypre/src/utilities/magma.c @@ -0,0 +1,46 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#include "_hypre_utilities.h" + +#if defined(HYPRE_USING_MAGMA) + +/*-------------------------------------------------------------------------- + * hypre_MagmaInitialize + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MagmaInitialize(void) +{ + /* Initialize MAGMA */ + magma_init(); + + /* Create device queue */ +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + hypre_int device_id; + + hypre_GetDevice(&device_id); + magma_queue_create((magma_int_t) device_id, &hypre_HandleMagmaQueue(hypre_handle())); +#endif + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_MagmaFinalize + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MagmaFinalize(void) +{ + /* Finalize MAGMA */ + magma_finalize(); + + return hypre_error_flag; +} + +#endif /* HYPRE_USING_MAGMA */ diff --git a/external/hypre/src/utilities/magma.h b/external/hypre/src/utilities/magma.h new file mode 100644 index 00000000..a4e5ac9f --- /dev/null +++ b/external/hypre/src/utilities/magma.h @@ -0,0 +1,71 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#ifndef HYPRE_MAGMA_HEADER +#define HYPRE_MAGMA_HEADER + +#include "HYPRE_config.h" + +#if defined(HYPRE_USING_MAGMA) + +#include "error.h" + +#ifdef __cplusplus +extern "C++" +{ +#endif + +#if !defined(MAGMA_GLOBAL) +#define ADD_ +#endif +#include + +#ifdef __cplusplus +} +#endif + +/*-------------------------------------------------------------------------- + * Wrappers to MAGMA functions according to hypre's precision + *--------------------------------------------------------------------------*/ + +#if defined(HYPRE_COMPLEX) || defined(HYPRE_LONG_DOUBLE) +#error "MAGMA interface does not support (yet) HYPRE_COMPLEX and HYPRE_LONG_DOUBLE" + +#elif defined(HYPRE_SINGLE) +#define hypre_magma_getrf_gpu magma_sgetrf_gpu +#define hypre_magma_getrf_nat magma_sgetrf_native +#define hypre_magma_getrs_gpu magma_sgetrs_gpu +#define hypre_magma_getri_gpu magma_sgetri_gpu +#define hypre_magma_getri_nb magma_get_dgetri_nb +#define hypre_magma_gemv magma_sgemv + +#else /* Double precision */ +#define hypre_magma_getrf_gpu magma_dgetrf_gpu +#define hypre_magma_getrf_nat magma_dgetrf_native +#define hypre_magma_getrs_gpu magma_dgetrs_gpu +#define hypre_magma_getri_gpu magma_dgetri_gpu +#define hypre_magma_getri_nb magma_get_sgetri_nb +#define hypre_magma_gemv magma_dgemv + +#endif + +/*-------------------------------------------------------------------------- + * General wrapper call to MAGMA functions + *--------------------------------------------------------------------------*/ + +#define HYPRE_MAGMA_CALL(call) do { \ + magma_int_t err = call; \ + if (MAGMA_SUCCESS != err) { \ + printf("MAGMA ERROR (code = %d) at %s:%d\n", \ + err, __FILE__, __LINE__); \ + hypre_assert(0); \ + } } while(0) + +#define HYPRE_MAGMA_VCALL(call) call + +#endif /* HYPRE_USING_MAGMA */ +#endif /* HYPRE_MAGMA_HEADER */ diff --git a/external/hypre/src/utilities/matrix_stats.c b/external/hypre/src/utilities/matrix_stats.c new file mode 100644 index 00000000..caf7fb2d --- /dev/null +++ b/external/hypre/src/utilities/matrix_stats.c @@ -0,0 +1,477 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#include "_hypre_utilities.h" + +/****************************************************************************** + * + * Member functions for hypre_MatrixStats class. + * + *****************************************************************************/ + +/*-------------------------------------------------------------------------- + * hypre_MatrixStatsCreate + *--------------------------------------------------------------------------*/ + +hypre_MatrixStats* +hypre_MatrixStatsCreate(void) +{ + hypre_MatrixStats *stats; + + stats = hypre_CTAlloc(hypre_MatrixStats, 1, HYPRE_MEMORY_HOST); + + hypre_MatrixStatsNumRows(stats) = 0; + hypre_MatrixStatsNumCols(stats) = 0; + hypre_MatrixStatsNumNonzeros(stats) = 0ULL; + + hypre_MatrixStatsActualNonzeros(stats) = 0ULL; + hypre_MatrixStatsActualThreshold(stats) = HYPRE_REAL_EPSILON; + hypre_MatrixStatsSparsity(stats) = 0.0; + + hypre_MatrixStatsNnzrowMin(stats) = 0; + hypre_MatrixStatsNnzrowMax(stats) = 0; + hypre_MatrixStatsNnzrowAvg(stats) = 0.0; + hypre_MatrixStatsNnzrowStDev(stats) = 0.0; + hypre_MatrixStatsNnzrowSqsum(stats) = 0.0; + + hypre_MatrixStatsRowsumMin(stats) = 0.0; + hypre_MatrixStatsRowsumMax(stats) = 0.0; + hypre_MatrixStatsRowsumAvg(stats) = 0.0; + hypre_MatrixStatsRowsumStDev(stats) = 0.0; + hypre_MatrixStatsRowsumSqsum(stats) = 0.0; + + return stats; +} + +/*-------------------------------------------------------------------------- + * hypre_MatrixStatsDestroy + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MatrixStatsDestroy(hypre_MatrixStats *stats) +{ + if (stats) + { + hypre_TFree(stats, HYPRE_MEMORY_HOST); + } + + return hypre_error_flag; +} + +/****************************************************************************** + * + * Member functions for hypre_MatrixStatsArray class. + * + *****************************************************************************/ + +/*-------------------------------------------------------------------------- + * hypre_MatrixStatsArrayCreate + *--------------------------------------------------------------------------*/ + +hypre_MatrixStatsArray* +hypre_MatrixStatsArrayCreate(HYPRE_Int capacity) +{ + hypre_MatrixStatsArray *stats_array; + HYPRE_Int i; + + stats_array = hypre_CTAlloc(hypre_MatrixStatsArray, 1, HYPRE_MEMORY_HOST); + + hypre_MatrixStatsArrayCapacity(stats_array) = capacity; + hypre_MatrixStatsArrayEntries(stats_array) = hypre_TAlloc(hypre_MatrixStats *, + capacity, + HYPRE_MEMORY_HOST); + for (i = 0; i < capacity; i++) + { + hypre_MatrixStatsArrayEntry(stats_array, i) = hypre_MatrixStatsCreate(); + } + + return stats_array; +} + +/*-------------------------------------------------------------------------- + * hypre_MatrixStatsArrayDestroy + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MatrixStatsArrayDestroy(hypre_MatrixStatsArray *stats_array) +{ + HYPRE_Int i; + HYPRE_Int capacity; + + if (stats_array) + { + capacity = hypre_MatrixStatsArrayCapacity(stats_array); + + for (i = 0; i < capacity; i++) + { + hypre_MatrixStatsDestroy(hypre_MatrixStatsArrayEntry(stats_array, i)); + } + hypre_TFree(hypre_MatrixStatsArrayEntries(stats_array), HYPRE_MEMORY_HOST); + hypre_TFree(stats_array, HYPRE_MEMORY_HOST); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_MatrixStatsArrayPrint + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MatrixStatsArrayPrint(HYPRE_Int num_hierarchies, + HYPRE_Int *num_levels, + HYPRE_Int use_divisors, + HYPRE_Int shift, + const char **messages, + hypre_MatrixStatsArray *stats_array) +{ + HYPRE_Int capacity = hypre_MatrixStatsArrayCapacity(stats_array); + + hypre_MatrixStats *stats; + hypre_MatrixStats *stats_finest; + hypre_MatrixStats *stats_next; + + HYPRE_Int ndigits[HYPRE_NDIGITS_SIZE]; + HYPRE_Int offsets[6]; + HYPRE_Int divisors[3]; + HYPRE_Int i, square; + HYPRE_Int square_count; + HYPRE_Int num_levels_total; + HYPRE_BigInt fine_num_rows; + HYPRE_BigInt coarse_num_rows; + HYPRE_BigInt total_num_rows; + + /* Compute total number of levels */ + num_levels_total = 0; + for (i = 0; i < num_hierarchies; i++) + { + num_levels_total += num_levels[i]; + } + + /* Sanity check */ + if (capacity < num_levels_total) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "Matrix statistics array does not have enough capacity!"); + return hypre_error_flag; + } + + /* Check if all matrices are square or rectangular */ + square_count = 0; + for (i = 0; i < num_levels_total; i++) + { + stats = hypre_MatrixStatsArrayEntry(stats_array, i); + + if (hypre_MatrixStatsNumRows(stats) == + hypre_MatrixStatsNumCols(stats)) + { + square_count += 1; + } + } + + if (square_count == 0) + { + square = 0; + } + else if (square_count == num_levels_total) + { + square = 1; + } + else + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "Cannot process square and rectangular matrices at the same time!"); + return hypre_error_flag; + } + + /* Set some shortcuts */ + stats_finest = hypre_MatrixStatsArrayEntry(stats_array, 0); + + /* Digits computation */ + ndigits[0] = hypre_max(7, hypre_ndigits(hypre_MatrixStatsNumRows(stats_finest))); + ndigits[1] = 7; + ndigits[2] = hypre_max(8, hypre_ndigits(hypre_MatrixStatsNumNonzeros(stats_finest))); + ndigits[3] = 7; + ndigits[4] = 4; + ndigits[5] = 4; + ndigits[6] = 4; + ndigits[7] = 5; + ndigits[8] = 8; + ndigits[9] = 8; + ndigits[10] = 8; + ndigits[11] = 8; + + for (i = 0; i < num_levels_total; i++) + { + stats = hypre_MatrixStatsArrayEntry(stats_array, i); + stats_next = hypre_MatrixStatsArrayEntry(stats_array, i + 1); + + total_num_rows = hypre_MatrixStatsNumRows(stats); + if (square) + { + if (i < num_levels_total - 1) + { + coarse_num_rows = hypre_MatrixStatsNumRows(stats_next); + } + else + { + coarse_num_rows = 0; + } + } + else + { + coarse_num_rows = hypre_MatrixStatsNumCols(stats); + } + fine_num_rows = total_num_rows - coarse_num_rows; + + ndigits[1] = hypre_max(ndigits[1], 1 + hypre_ndigits(fine_num_rows)); + ndigits[3] = hypre_max(ndigits[3], + 4 + hypre_ndigits((HYPRE_Int) hypre_MatrixStatsSparsity(stats))); + ndigits[4] = hypre_max(ndigits[4], + 1 + hypre_ndigits(hypre_MatrixStatsNnzrowMin(stats))); + ndigits[5] = hypre_max(ndigits[5], + 1 + hypre_ndigits(hypre_MatrixStatsNnzrowMax(stats))); + ndigits[6] = hypre_max(ndigits[6], + 4 + hypre_ndigits((HYPRE_Int) hypre_MatrixStatsNnzrowAvg(stats))); + ndigits[7] = hypre_max(ndigits[7], + 4 + hypre_ndigits((HYPRE_Int) hypre_MatrixStatsNnzrowStDev(stats))); + } + + /* Column offsets calculation */ + offsets[0] = 6 + ndigits[0] + ndigits[1] + ndigits[2]; + offsets[1] = 0 + ndigits[2]; + offsets[2] = 2 + ndigits[3]; + offsets[3] = 7 + (ndigits[4] + ndigits[5] + ndigits[6] + ndigits[7]) / 2; + offsets[4] = (1 + ndigits[4] + ndigits[5] + ndigits[6] + ndigits[7]) / 2 - 3; + offsets[5] = 4 + (ndigits[8] + ndigits[9] + ndigits[10] + ndigits[11]) / 2; + if (!square) + { + offsets[0] += 2; + } + + /* Table divisors */ + if (use_divisors) + { + divisors[0] = 9 + ndigits[0] + ndigits[1] + ndigits[3] + 2 * ndigits[2]; + divisors[1] = 5 + ndigits[4] + ndigits[5] + ndigits[6] + ndigits[7]; + divisors[2] = 5 + ndigits[8] + ndigits[9] + ndigits[10] + ndigits[11]; + if (!square) + { + divisors[0] += 2; + } + } + else + { + divisors[0] = 4 + ndigits[2]; /* Note: ndigits[2] happens twice */ + for (i = 0; i < HYPRE_NDIGITS_SIZE; i++) + { + divisors[0] += ndigits[i] + 1; + } + } + + /* Header first line */ + HYPRE_PRINT_INDENT(shift); + { + hypre_printf("\n%s", messages[0]); + } + HYPRE_PRINT_INDENT(shift); + { + hypre_printf("%*s ", offsets[0], "nonzero"); + hypre_printf("%*s ", offsets[1], "actual"); + } + if (use_divisors) + { + hypre_printf("%*s ", offsets[2], "|"); + } + { + hypre_printf("%*s ", offsets[3], "entries/row"); + } + if (use_divisors) + { + hypre_printf("%*s ", offsets[4], "|"); + } + { + hypre_printf("%*s ", offsets[5], "rowsums"); + hypre_printf("\n"); + } + + /* Header second line */ + HYPRE_PRINT_INDENT(shift); + { + hypre_printf("%s ", "lev"); + } + if (square) + { + hypre_printf("%*s ", ndigits[0], "rows"); + hypre_printf("%*s ", ndigits[1], "fine"); + hypre_printf("%*s ", ndigits[2], "entries"); + } + else + { + hypre_printf("%*s ", ndigits[0], "rows"); + hypre_printf("%-*s ", ndigits[1], "x cols"); + hypre_printf("%*s ", ndigits[2], " entries"); + } + { + hypre_printf("%*s ", ndigits[2], "entries"); + hypre_printf("%*s ", ndigits[3], "sparse"); + } + if (use_divisors) + { + hypre_printf("| "); + } + { + // entries per row + hypre_printf("%*s ", ndigits[4], "min"); + hypre_printf("%*s ", ndigits[5], "max"); + hypre_printf("%*s ", ndigits[6], "avg"); + hypre_printf("%*s ", ndigits[7], "stdev"); + } + if (use_divisors) + { + hypre_printf("| "); + } + { + // rowsums + hypre_printf("%*s ", ndigits[8], "min"); + hypre_printf("%*s ", ndigits[9], "max"); + hypre_printf("%*s ", ndigits[10], "avg"); + hypre_printf("%*s ", ndigits[11], "stdev"); + } + { + hypre_printf("\n"); + } + HYPRE_PRINT_INDENT(shift); + if (use_divisors) + { + HYPRE_PRINT_TOP_DIVISOR(3, divisors); + } + else + { + HYPRE_PRINT_TOP_DIVISOR(1, divisors); + } + + /* Values */ + for (i = 0; i < num_levels_total; i++) + { + stats = hypre_MatrixStatsArrayEntry(stats_array, i); + stats_next = hypre_MatrixStatsArrayEntry(stats_array, i + 1); + + total_num_rows = hypre_MatrixStatsNumRows(stats); + if (square) + { + if (i < num_levels_total - 1) + { + coarse_num_rows = hypre_MatrixStatsNumRows(stats_next); + } + else + { + coarse_num_rows = 0; + } + } + else + { + coarse_num_rows = hypre_MatrixStatsNumCols(stats); + } + fine_num_rows = total_num_rows - coarse_num_rows; + + /* General info */ + HYPRE_PRINT_INDENT(shift); + if (square) + { + hypre_printf("%3d %*b %*b %*b %*b %*.3f ", + i, + ndigits[0], hypre_MatrixStatsNumRows(stats), + ndigits[1], fine_num_rows, + ndigits[2], hypre_MatrixStatsNumNonzeros(stats), + ndigits[2], hypre_MatrixStatsActualNonzeros(stats), + ndigits[3], hypre_MatrixStatsSparsity(stats)); + } + else + { + hypre_printf("%3d %*b x %-*b %*b %*b %*.3f ", + i, + ndigits[0], hypre_MatrixStatsNumRows(stats), + ndigits[1], coarse_num_rows, + ndigits[2], hypre_MatrixStatsNumNonzeros(stats), + ndigits[2], hypre_MatrixStatsActualNonzeros(stats), + ndigits[3], hypre_MatrixStatsSparsity(stats)); + } + if (use_divisors) + { + hypre_printf("| "); + } + + /* Entries per row info */ + hypre_printf("%*d %*d %*.1f %*.2f ", + ndigits[4], hypre_MatrixStatsNnzrowMin(stats), + ndigits[5], hypre_MatrixStatsNnzrowMax(stats), + ndigits[6], hypre_MatrixStatsNnzrowAvg(stats), + ndigits[7], hypre_MatrixStatsNnzrowStDev(stats)); + if (use_divisors) + { + hypre_printf("| "); + } + + /* Row sum info */ + hypre_printf("%*.1e %*.1e %*.1e %*.1e", + ndigits[8], hypre_MatrixStatsRowsumMin(stats), + ndigits[9], hypre_MatrixStatsRowsumMax(stats), + ndigits[10], hypre_MatrixStatsRowsumAvg(stats), + ndigits[11], hypre_MatrixStatsRowsumStDev(stats)); + + if (use_divisors) + { + if (num_hierarchies == 1) + { + hypre_printf("\n"); + } + else if (num_hierarchies == 2) + { + if (i == num_levels[0] / 2) + { + hypre_printf(messages[2]); + } + + if ((num_levels[1] > 1) && + (i == num_levels[0] + num_levels[1] / 2)) + { + hypre_printf(messages[3]); + } + + hypre_printf("\n"); + HYPRE_PRINT_INDENT(shift); + if (square) + { + if (i == num_levels[0]) + { + HYPRE_PRINT_MID_DIVISOR(3, divisors, messages[1]); + } + } + else + { + if (i == (num_levels[0] - 1)) + { + HYPRE_PRINT_MID_DIVISOR(3, divisors, messages[1]); + } + } + } + else + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "num_hierarchies > 2 not implemented!"); + return hypre_error_flag; + } + } + else + { + hypre_printf("\n"); + } + } + hypre_printf("\n\n"); + + return hypre_error_flag; +} diff --git a/external/hypre/src/utilities/matrix_stats.h b/external/hypre/src/utilities/matrix_stats.h new file mode 100644 index 00000000..e583868e --- /dev/null +++ b/external/hypre/src/utilities/matrix_stats.h @@ -0,0 +1,130 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#ifndef hypre_MATRIX_STATS_HEADER +#define hypre_MATRIX_STATS_HEADER + +/****************************************************************************** + * + * Header info for (generic) matrix statistics data structure + * + *****************************************************************************/ + +typedef struct hypre_MatrixStats_struct +{ + /* General info */ + HYPRE_BigInt num_rows; + HYPRE_BigInt num_cols; + hypre_ulonglongint num_nonzeros; + + /* Actual nonzeros statistics */ + hypre_ulonglongint actual_nonzeros; + HYPRE_Real actual_threshold; + HYPRE_Real sparsity; + + /* Nonzeros per row statistics */ + HYPRE_Int nnzrow_min; + HYPRE_Int nnzrow_max; + HYPRE_Real nnzrow_avg; + HYPRE_Real nnzrow_stdev; + HYPRE_Real nnzrow_sqsum; + + /* Row sum statistics */ + HYPRE_Real rowsum_min; + HYPRE_Real rowsum_max; + HYPRE_Real rowsum_avg; + HYPRE_Real rowsum_stdev; + HYPRE_Real rowsum_sqsum; +} hypre_MatrixStats; + +/*-------------------------------------------------------------------------- + * Accessor macros + *--------------------------------------------------------------------------*/ + +#define hypre_MatrixStatsNumRows(data) ((data) -> num_rows) +#define hypre_MatrixStatsNumCols(data) ((data) -> num_cols) +#define hypre_MatrixStatsNumNonzeros(data) ((data) -> num_nonzeros) + +#define hypre_MatrixStatsSparsity(data) ((data) -> sparsity) +#define hypre_MatrixStatsActualNonzeros(data) ((data) -> actual_nonzeros) +#define hypre_MatrixStatsActualThreshold(data) ((data) -> actual_threshold) + +#define hypre_MatrixStatsNnzrowMin(data) ((data) -> nnzrow_min) +#define hypre_MatrixStatsNnzrowMax(data) ((data) -> nnzrow_max) +#define hypre_MatrixStatsNnzrowAvg(data) ((data) -> nnzrow_avg) +#define hypre_MatrixStatsNnzrowStDev(data) ((data) -> nnzrow_stdev) +#define hypre_MatrixStatsNnzrowSqsum(data) ((data) -> nnzrow_sqsum) + +#define hypre_MatrixStatsRowsumMin(data) ((data) -> rowsum_min) +#define hypre_MatrixStatsRowsumMax(data) ((data) -> rowsum_max) +#define hypre_MatrixStatsRowsumAvg(data) ((data) -> rowsum_avg) +#define hypre_MatrixStatsRowsumStDev(data) ((data) -> rowsum_stdev) +#define hypre_MatrixStatsRowsumSqsum(data) ((data) -> rowsum_sqsum) + +/****************************************************************************** + * + * Header info for array of (generic) matrix statistics data structure + * + *****************************************************************************/ + +typedef struct hypre_MatrixStatsArray_struct +{ + HYPRE_Int capacity; + hypre_MatrixStats **entries; +} hypre_MatrixStatsArray; + +/*-------------------------------------------------------------------------- + * Accessor macros + *--------------------------------------------------------------------------*/ + +#define hypre_MatrixStatsArrayCapacity(data) ((data) -> capacity) +#define hypre_MatrixStatsArrayEntries(data) ((data) -> entries) +#define hypre_MatrixStatsArrayEntry(data, i) ((data) -> entries[i]) + +/*-------------------------------------------------------------------------- + * Helper macros for table formatting + *--------------------------------------------------------------------------*/ + +#define HYPRE_PRINT_TOP_DIVISOR(m, d) \ + for (HYPRE_Int __i = 0; __i < m; __i++) \ + { \ + for (HYPRE_Int __j = 0; __j < d[__i]; __j++) \ + { \ + hypre_printf("%s", "="); \ + } \ + if (__i < m - 1) \ + { \ + hypre_printf("+"); \ + } \ + } \ + hypre_printf("\n"); + +#define HYPRE_PRINT_MID_DIVISOR(m, d, msg) \ + for (HYPRE_Int __i = 0; __i < m; __i++) \ + { \ + for (HYPRE_Int __j = 0; __j < d[__i]; __j++) \ + { \ + hypre_printf("%s", "-"); \ + } \ + if (__i < m - 1) \ + { \ + hypre_printf("+"); \ + } \ + } \ + hypre_printf(" %s\n", msg); + +#define HYPRE_PRINT_INDENT(n) \ + hypre_printf("%*s", (n > 0) ? n : 0, ""); + + +#define HYPRE_PRINT_SHIFTED_PARAM(n, ...) \ + HYPRE_PRINT_INDENT(n) \ + hypre_printf(__VA_ARGS__) + +#define HYPRE_NDIGITS_SIZE 12 + +#endif /* hypre_MATRIX_STATS_HEADER */ diff --git a/external/hypre/src/utilities/memory.c b/external/hypre/src/utilities/memory.c index 322d355d..22a32edf 100644 --- a/external/hypre/src/utilities/memory.c +++ b/external/hypre/src/utilities/memory.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -13,8 +13,16 @@ #include "_hypre_utilities.h" #include "_hypre_utilities.hpp" +#if defined(__APPLE__) +#include +#include +#include +#include +#elif defined(__linux__) +#include +#endif -#ifdef HYPRE_USE_UMALLOC +#if defined(HYPRE_USE_UMALLOC) #undef HYPRE_USE_UMALLOC #endif @@ -24,25 +32,77 @@ * *****************************************************************************/ +HYPRE_Int +hypre_GetMemoryLocationName(hypre_MemoryLocation memory_location, + char *memory_location_name) +{ + if (memory_location == hypre_MEMORY_HOST) + { + sprintf(memory_location_name, "%s", "HOST"); + } + else if (memory_location == hypre_MEMORY_HOST_PINNED) + { + sprintf(memory_location_name, "%s", "HOST PINNED"); + } + else if (memory_location == hypre_MEMORY_DEVICE) + { + sprintf(memory_location_name, "%s", "DEVICE"); + } + else if (memory_location == hypre_MEMORY_UNIFIED) + { + sprintf(memory_location_name, "%s", "UNIFIED"); + } + else + { + sprintf(memory_location_name, "%s", ""); + } + + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- * hypre_OutOfMemory *--------------------------------------------------------------------------*/ + static inline void hypre_OutOfMemory(size_t size) { - hypre_error_w_msg(HYPRE_ERROR_MEMORY,"Out of memory trying to allocate too many bytes\n"); + char msg[1024]; + + hypre_sprintf(msg, "Out of memory trying to allocate %zu bytes\n", size); + hypre_error_w_msg(HYPRE_ERROR_MEMORY, msg); hypre_assert(0); fflush(stdout); } static inline void -hypre_WrongMemoryLocation() +hypre_WrongMemoryLocation(void) { - hypre_error_w_msg(HYPRE_ERROR_MEMORY, "Wrong HYPRE MEMORY location: Only HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE and HYPRE_MEMORY_HOST_PINNED are supported!\n"); + hypre_error_w_msg(HYPRE_ERROR_MEMORY, "Unrecognized hypre_MemoryLocation\n"); hypre_assert(0); fflush(stdout); } +void +hypre_CheckMemoryLocation(void *ptr, hypre_MemoryLocation location) +{ +#if defined(HYPRE_DEBUG) && defined(HYPRE_USING_GPU) + if (!ptr) + { + return; + } + + hypre_MemoryLocation location_ptr; + hypre_GetPointerLocation(ptr, &location_ptr); + /* do not use hypre_assert, which has alloc and free; + * will create an endless loop otherwise */ + assert(location == location_ptr); +#else + HYPRE_UNUSED_VAR(ptr); + HYPRE_UNUSED_VAR(location); +#endif +} + /*========================================================================== * Physical memory location (hypre_MemoryLocation) interface *==========================================================================*/ @@ -61,20 +121,30 @@ hypre_DeviceMemset(void *ptr, HYPRE_Int value, size_t num) { #if defined(HYPRE_USING_DEVICE_OPENMP) #if defined(HYPRE_DEVICE_OPENMP_ALLOC) - HYPRE_CUDA_CALL( cudaMemset(ptr, value, num) ); + #pragma omp target teams distribute parallel for is_device_ptr(ptr) + for (size_t i = 0; i < num; i++) + { + ((unsigned char *) ptr)[i] = (unsigned char) value; + } #else memset(ptr, value, num); HYPRE_OMPOffload(hypre__offload_device_num, ptr, num, "update", "to"); #endif - HYPRE_CUDA_CALL( cudaDeviceSynchronize() ); -#endif + /* HYPRE_CUDA_CALL( cudaDeviceSynchronize() ); */ -#if defined(HYPRE_USING_CUDA) +#elif defined(HYPRE_USING_CUDA) HYPRE_CUDA_CALL( cudaMemset(ptr, value, num) ); -#endif -#if defined(HYPRE_USING_HIP) +#elif defined(HYPRE_USING_HIP) HYPRE_HIP_CALL( hipMemset(ptr, value, num) ); + +#elif defined(HYPRE_USING_SYCL) + HYPRE_SYCL_CALL( (hypre_HandleComputeStream(hypre_handle()))->memset(ptr, value, num).wait() ); + +#else + HYPRE_UNUSED_VAR(ptr); + HYPRE_UNUSED_VAR(value); + HYPRE_UNUSED_VAR(num); #endif } @@ -82,16 +152,31 @@ static inline void hypre_UnifiedMemset(void *ptr, HYPRE_Int value, size_t num) { #if defined(HYPRE_USING_DEVICE_OPENMP) - HYPRE_CUDA_CALL( cudaMemset(ptr, value, num) ); - HYPRE_CUDA_CALL( cudaDeviceSynchronize() ); +#if defined(HYPRE_DEVICE_OPENMP_ALLOC) + #pragma omp target teams distribute parallel for is_device_ptr(ptr) + for (size_t i = 0; i < num; i++) + { + ((unsigned char *) ptr)[i] = (unsigned char) value; + } +#else + memset(ptr, value, num); + HYPRE_OMPOffload(hypre__offload_device_num, ptr, num, "update", "to"); #endif + /* HYPRE_CUDA_CALL( cudaDeviceSynchronize() ); */ -#if defined(HYPRE_USING_CUDA) +#elif defined(HYPRE_USING_CUDA) HYPRE_CUDA_CALL( cudaMemset(ptr, value, num) ); -#endif -#if defined(HYPRE_USING_HIP) +#elif defined(HYPRE_USING_HIP) HYPRE_HIP_CALL( hipMemset(ptr, value, num) ); + +#elif defined(HYPRE_USING_SYCL) + HYPRE_SYCL_CALL( (hypre_HandleComputeStream(hypre_handle()))->memset(ptr, value, num).wait() ); + +#else + HYPRE_UNUSED_VAR(ptr); + HYPRE_UNUSED_VAR(value); + HYPRE_UNUSED_VAR(num); #endif } @@ -101,56 +186,59 @@ hypre_UnifiedMemset(void *ptr, HYPRE_Int value, size_t num) static inline void hypre_UnifiedMemPrefetch(void *ptr, size_t size, hypre_MemoryLocation location) { -#if defined(HYPRE_USING_GPU) -#ifdef HYPRE_DEBUG - hypre_MemoryLocation tmp; - hypre_GetPointerLocation(ptr, &tmp); - /* do not use hypre_assert, which has alloc and free; - * will create an endless loop otherwise */ - assert(hypre_MEMORY_UNIFIED == tmp); -#endif -#endif - -#if defined(HYPRE_USING_DEVICE_OPENMP) - if (location == hypre_MEMORY_DEVICE) + if (!size) { - HYPRE_CUDA_CALL( cudaMemPrefetchAsync(ptr, size, hypre_HandleCudaDevice(hypre_handle()), - hypre_HandleCudaComputeStream(hypre_handle())) ); - } - else if (location == hypre_MEMORY_HOST) - { - HYPRE_CUDA_CALL( cudaMemPrefetchAsync(ptr, size, cudaCpuDeviceId, - hypre_HandleCudaComputeStream(hypre_handle())) ); + return; } -#endif + + hypre_CheckMemoryLocation(ptr, hypre_MEMORY_UNIFIED); #if defined(HYPRE_USING_CUDA) if (location == hypre_MEMORY_DEVICE) { - HYPRE_CUDA_CALL( cudaMemPrefetchAsync(ptr, size, hypre_HandleCudaDevice(hypre_handle()), - hypre_HandleCudaComputeStream(hypre_handle())) ); + HYPRE_CUDA_CALL( cudaMemPrefetchAsync(ptr, size, hypre_HandleDevice(hypre_handle()), + hypre_HandleComputeStream(hypre_handle())) ); } else if (location == hypre_MEMORY_HOST) { HYPRE_CUDA_CALL( cudaMemPrefetchAsync(ptr, size, cudaCpuDeviceId, - hypre_HandleCudaComputeStream(hypre_handle())) ); + hypre_HandleComputeStream(hypre_handle())) ); } -#endif -#if defined(HYPRE_USING_HIP) +#elif defined(HYPRE_USING_HIP) + HYPRE_UNUSED_VAR(ptr); + HYPRE_UNUSED_VAR(size); + HYPRE_UNUSED_VAR(location); // Not currently implemented for HIP, but leaving place holder /* *if (location == hypre_MEMORY_DEVICE) *{ - * HYPRE_HIP_CALL( hipMemPrefetchAsync(ptr, size, hypre_HandleCudaDevice(hypre_handle()), - * hypre_HandleCudaComputeStream(hypre_handle())) ); + * HYPRE_HIP_CALL( hipMemPrefetchAsync(ptr, size, hypre_HandleDevice(hypre_handle()), + * hypre_HandleComputeStream(hypre_handle())) ); *} *else if (location == hypre_MEMORY_HOST) *{ * HYPRE_CUDA_CALL( hipMemPrefetchAsync(ptr, size, cudaCpuDeviceId, - * hypre_HandleCudaComputeStream(hypre_handle())) ); + * hypre_HandleComputeStream(hypre_handle())) ); *} */ + +#elif defined(HYPRE_USING_SYCL) + HYPRE_UNUSED_VAR(ptr); + HYPRE_UNUSED_VAR(size); + HYPRE_UNUSED_VAR(location); + if (location == hypre_MEMORY_DEVICE) + { + /* WM: todo - the call below seems like it may occasionally result in an error: */ + /* Native API returns: -997 (The plugin has emitted a backend specific error) */ + /* or a seg fault. On the other hand, removing this line can also cause the code + * to hang (or run excessively slow?). */ + /* HYPRE_SYCL_CALL( hypre_HandleComputeStream(hypre_handle())->prefetch(ptr, size).wait() ); */ + } +#else + HYPRE_UNUSED_VAR(ptr); + HYPRE_UNUSED_VAR(size); + HYPRE_UNUSED_VAR(location); #endif } @@ -212,6 +300,8 @@ hypre_DeviceMalloc(size_t size, HYPRE_Int zeroinit) #if defined(HYPRE_USING_CUDA) #if defined(HYPRE_USING_DEVICE_POOL) HYPRE_CUDA_CALL( hypre_CachingMallocDevice(&ptr, size) ); +#elif defined(HYPRE_USING_DEVICE_MALLOC_ASYNC) + HYPRE_CUDA_CALL( cudaMallocAsync(&ptr, size, NULL) ); #else HYPRE_CUDA_CALL( cudaMalloc(&ptr, size) ); #endif @@ -221,6 +311,10 @@ hypre_DeviceMalloc(size_t size, HYPRE_Int zeroinit) HYPRE_HIP_CALL( hipMalloc(&ptr, size) ); #endif +#if defined(HYPRE_USING_SYCL) + ptr = (void *)sycl::malloc_device(size, *(hypre_HandleComputeStream(hypre_handle()))); +#endif + #endif /* #if defined(HYPRE_USING_UMPIRE_DEVICE) */ } @@ -242,7 +336,15 @@ hypre_UnifiedMalloc(size_t size, HYPRE_Int zeroinit) #else #if defined(HYPRE_USING_DEVICE_OPENMP) - HYPRE_CUDA_CALL( cudaMallocManaged(&ptr, size, cudaMemAttachGlobal) ); +#if defined(HYPRE_DEVICE_OPENMP_ALLOC) + ptr = omp_target_alloc(size, hypre__offload_device_num); +#else + ptr = malloc(size + sizeof(size_t)); + size_t *sp = (size_t*) ptr; + sp[0] = size; + ptr = (void *) (&sp[1]); + HYPRE_OMPOffload(hypre__offload_device_num, ptr, size, "enter", "alloc"); +#endif #endif #if defined(HYPRE_USING_CUDA) @@ -257,6 +359,11 @@ hypre_UnifiedMalloc(size_t size, HYPRE_Int zeroinit) HYPRE_HIP_CALL( hipMallocManaged(&ptr, size, hipMemAttachGlobal) ); #endif +#if defined(HYPRE_USING_SYCL) + HYPRE_SYCL_CALL( ptr = (void *)sycl::malloc_shared(size, + *(hypre_HandleComputeStream(hypre_handle()))) ); +#endif + #endif /* #if defined(HYPRE_USING_UMPIRE_UM) */ /* prefecth to device */ @@ -282,10 +389,6 @@ hypre_HostPinnedMalloc(size_t size, HYPRE_Int zeroinit) hypre_umpire_pinned_pooled_allocate(&ptr, size); #else -#if defined(HYPRE_USING_DEVICE_OPENMP) - HYPRE_CUDA_CALL( cudaMallocHost(&ptr, size) ); -#endif - #if defined(HYPRE_USING_CUDA) HYPRE_CUDA_CALL( cudaMallocHost(&ptr, size) ); #endif @@ -294,6 +397,11 @@ hypre_HostPinnedMalloc(size_t size, HYPRE_Int zeroinit) HYPRE_HIP_CALL( hipHostMalloc(&ptr, size) ); #endif +#if defined(HYPRE_USING_SYCL) + HYPRE_SYCL_CALL( ptr = (void *)sycl::malloc_host(size, + *(hypre_HandleComputeStream(hypre_handle()))) ); +#endif + #endif /* #if defined(HYPRE_USING_UMPIRE_PINNED) */ if (ptr && zeroinit) @@ -384,6 +492,8 @@ hypre_DeviceFree(void *ptr) #if defined(HYPRE_USING_CUDA) #if defined(HYPRE_USING_DEVICE_POOL) HYPRE_CUDA_CALL( hypre_CachingFreeDevice(ptr) ); +#elif defined(HYPRE_USING_DEVICE_MALLOC_ASYNC) + HYPRE_CUDA_CALL( cudaFreeAsync(ptr, NULL) ); #else HYPRE_CUDA_CALL( cudaFree(ptr) ); #endif @@ -393,6 +503,10 @@ hypre_DeviceFree(void *ptr) HYPRE_HIP_CALL( hipFree(ptr) ); #endif +#if defined(HYPRE_USING_SYCL) + HYPRE_SYCL_CALL( sycl::free(ptr, *(hypre_HandleComputeStream(hypre_handle()))) ); +#endif + #endif /* #if defined(HYPRE_USING_UMPIRE_DEVICE) */ } } @@ -402,23 +516,27 @@ hypre_UnifiedFree(void *ptr) { #if defined(HYPRE_USING_UMPIRE_UM) hypre_umpire_um_pooled_free(ptr); -#else -#if defined(HYPRE_USING_DEVICE_OPENMP) - HYPRE_CUDA_CALL( cudaFree(ptr) ); -#endif +#elif defined(HYPRE_USING_DEVICE_OPENMP) && defined(HYPRE_DEVICE_OPENMP_ALLOC) + omp_target_free(ptr, hypre__offload_device_num); -#if defined(HYPRE_USING_CUDA) -#if defined(HYPRE_USING_DEVICE_POOL) +#elif defined(HYPRE_USING_DEVICE_OPENMP) && !defined(HYPRE_DEVICE_OPENMP_ALLOC) + HYPRE_OMPOffload(hypre__offload_device_num, ptr, ((size_t *) ptr)[-1], "exit", "delete"); + +#elif defined(HYPRE_USING_CUDA) && defined(HYPRE_USING_DEVICE_POOL) HYPRE_CUDA_CALL( hypre_CachingFreeManaged(ptr) ); -#else + +#elif defined(HYPRE_USING_CUDA) && !defined(HYPRE_USING_DEVICE_POOL) HYPRE_CUDA_CALL( cudaFree(ptr) ); -#endif -#endif -#if defined(HYPRE_USING_HIP) +#elif defined(HYPRE_USING_HIP) HYPRE_HIP_CALL( hipFree(ptr) ); -#endif + +#elif defined(HYPRE_USING_SYCL) + HYPRE_SYCL_CALL( sycl::free(ptr, *(hypre_HandleComputeStream(hypre_handle()))) ); + +#else + HYPRE_UNUSED_VAR(ptr); #endif /* #if defined(HYPRE_USING_UMPIRE_UM) */ } @@ -428,19 +546,18 @@ hypre_HostPinnedFree(void *ptr) { #if defined(HYPRE_USING_UMPIRE_PINNED) hypre_umpire_pinned_pooled_free(ptr); -#else - -#if defined(HYPRE_USING_DEVICE_OPENMP) - HYPRE_CUDA_CALL( cudaFreeHost(ptr) ); -#endif -#if defined(HYPRE_USING_CUDA) +#elif defined(HYPRE_USING_CUDA) HYPRE_CUDA_CALL( cudaFreeHost(ptr) ); -#endif -#if defined(HYPRE_USING_HIP) +#elif defined(HYPRE_USING_HIP) HYPRE_HIP_CALL( hipHostFree(ptr) ); -#endif + +#elif defined(HYPRE_USING_SYCL) + HYPRE_SYCL_CALL( sycl::free(ptr, *(hypre_HandleComputeStream(hypre_handle()))) ); + +#else + HYPRE_UNUSED_VAR(ptr); #endif /* #if defined(HYPRE_USING_UMPIRE_PINNED) */ } @@ -453,13 +570,7 @@ hypre_Free_core(void *ptr, hypre_MemoryLocation location) return; } -#ifdef HYPRE_DEBUG - hypre_MemoryLocation tmp; - hypre_GetPointerLocation(ptr, &tmp); - /* do not use hypre_assert, which has alloc and free; - * will create an endless loop otherwise */ - assert(location == tmp); -#endif + hypre_CheckMemoryLocation(ptr, location); switch (location) { @@ -491,8 +602,18 @@ _hypre_Free(void *ptr, hypre_MemoryLocation location) * Memcpy *--------------------------------------------------------------------------*/ static inline void -hypre_Memcpy_core(void *dst, void *src, size_t size, hypre_MemoryLocation loc_dst, hypre_MemoryLocation loc_src) +hypre_Memcpy_core(void *dst, void *src, size_t size, hypre_MemoryLocation loc_dst, + hypre_MemoryLocation loc_src) { + if (size == 0) + { + return; + } + +#if defined(HYPRE_USING_SYCL) + sycl::queue* q = hypre_HandleComputeStream(hypre_handle()); +#endif + if (dst == NULL || src == NULL) { if (size) @@ -509,6 +630,12 @@ hypre_Memcpy_core(void *dst, void *src, size_t size, hypre_MemoryLocation loc_ds return; } + if (size > 0) + { + hypre_CheckMemoryLocation(dst, loc_dst); + hypre_CheckMemoryLocation(src, loc_src); + } + /* Totally 4 x 4 = 16 cases */ /* 4: Host <-- Host, Host <-- Pinned, @@ -528,7 +655,7 @@ hypre_Memcpy_core(void *dst, void *src, size_t size, hypre_MemoryLocation loc_ds (loc_dst == hypre_MEMORY_UNIFIED && loc_src == hypre_MEMORY_UNIFIED) ) { #if defined(HYPRE_USING_DEVICE_OPENMP) - HYPRE_CUDA_CALL( cudaMemcpy(dst, src, size, cudaMemcpyDeviceToDevice) ); + omp_target_memcpy(dst, src, size, 0, 0, hypre__offload_device_num, hypre__offload_device_num); #endif #if defined(HYPRE_USING_CUDA) @@ -536,7 +663,14 @@ hypre_Memcpy_core(void *dst, void *src, size_t size, hypre_MemoryLocation loc_ds #endif #if defined(HYPRE_USING_HIP) - HYPRE_HIP_CALL( hipMemcpy(dst, src, size, hipMemcpyDeviceToDevice) ); + // hipMemcpy(DtoD) causes a host-side synchronization, unlike cudaMemcpy(DtoD), + // use hipMemcpyAsync to get cuda's more performant behavior. For more info see: + // https://github.com/mfem/mfem/pull/2780 + HYPRE_HIP_CALL( hipMemcpyAsync(dst, src, size, hipMemcpyDeviceToDevice) ); +#endif + +#if defined(HYPRE_USING_SYCL) + HYPRE_SYCL_CALL( q->memcpy(dst, src, size).wait() ); #endif return; } @@ -546,7 +680,7 @@ hypre_Memcpy_core(void *dst, void *src, size_t size, hypre_MemoryLocation loc_ds if (loc_dst == hypre_MEMORY_UNIFIED) { #if defined(HYPRE_USING_DEVICE_OPENMP) - HYPRE_CUDA_CALL( cudaMemcpy(dst, src, size, cudaMemcpyHostToDevice) ); + omp_target_memcpy(dst, src, size, 0, 0, hypre__offload_device_num, hypre__offload_host_num); #endif #if defined(HYPRE_USING_CUDA) @@ -556,6 +690,10 @@ hypre_Memcpy_core(void *dst, void *src, size_t size, hypre_MemoryLocation loc_ds #if defined(HYPRE_USING_HIP) HYPRE_HIP_CALL( hipMemcpy(dst, src, size, hipMemcpyHostToDevice) ); #endif + +#if defined(HYPRE_USING_SYCL) + HYPRE_SYCL_CALL( q->memcpy(dst, src, size).wait() ); +#endif return; } @@ -564,7 +702,7 @@ hypre_Memcpy_core(void *dst, void *src, size_t size, hypre_MemoryLocation loc_ds if (loc_src == hypre_MEMORY_UNIFIED) { #if defined(HYPRE_USING_DEVICE_OPENMP) - HYPRE_CUDA_CALL( cudaMemcpy(dst, src, size, cudaMemcpyDeviceToHost) ); + omp_target_memcpy(dst, src, size, 0, 0, hypre__offload_host_num, hypre__offload_device_num); #endif #if defined(HYPRE_USING_CUDA) @@ -574,12 +712,17 @@ hypre_Memcpy_core(void *dst, void *src, size_t size, hypre_MemoryLocation loc_ds #if defined(HYPRE_USING_HIP) HYPRE_HIP_CALL( hipMemcpy(dst, src, size, hipMemcpyDeviceToHost) ); #endif + +#if defined(HYPRE_USING_SYCL) + HYPRE_SYCL_CALL( q->memcpy(dst, src, size).wait() ); +#endif return; } /* 2: Device <-- Host, Device <-- Pinned */ - if ( loc_dst == hypre_MEMORY_DEVICE && (loc_src == hypre_MEMORY_HOST || loc_src == hypre_MEMORY_HOST_PINNED) ) + if ( loc_dst == hypre_MEMORY_DEVICE && (loc_src == hypre_MEMORY_HOST || + loc_src == hypre_MEMORY_HOST_PINNED) ) { #if defined(HYPRE_USING_DEVICE_OPENMP) #if defined(HYPRE_DEVICE_OPENMP_ALLOC) @@ -597,12 +740,17 @@ hypre_Memcpy_core(void *dst, void *src, size_t size, hypre_MemoryLocation loc_ds #if defined(HYPRE_USING_HIP) HYPRE_HIP_CALL( hipMemcpy(dst, src, size, hipMemcpyHostToDevice) ); #endif + +#if defined(HYPRE_USING_SYCL) + HYPRE_SYCL_CALL( q->memcpy(dst, src, size).wait() ); +#endif return; } /* 2: Host <-- Device, Pinned <-- Device */ - if ( (loc_dst == hypre_MEMORY_HOST || loc_dst == hypre_MEMORY_HOST_PINNED) && loc_src == hypre_MEMORY_DEVICE ) + if ( (loc_dst == hypre_MEMORY_HOST || loc_dst == hypre_MEMORY_HOST_PINNED) && + loc_src == hypre_MEMORY_DEVICE ) { #if defined(HYPRE_USING_DEVICE_OPENMP) #if defined(HYPRE_DEVICE_OPENMP_ALLOC) @@ -620,6 +768,10 @@ hypre_Memcpy_core(void *dst, void *src, size_t size, hypre_MemoryLocation loc_ds #if defined(HYPRE_USING_HIP) HYPRE_HIP_CALL( hipMemcpy(dst, src, size, hipMemcpyDeviceToHost) ); #endif + +#if defined(HYPRE_USING_SYCL) + HYPRE_SYCL_CALL( q->memcpy(dst, src, size).wait() ); +#endif return; } @@ -642,7 +794,14 @@ hypre_Memcpy_core(void *dst, void *src, size_t size, hypre_MemoryLocation loc_ds #endif #if defined(HYPRE_USING_HIP) - HYPRE_HIP_CALL( hipMemcpy(dst, src, size, hipMemcpyDeviceToDevice) ); + // hipMemcpy(DtoD) causes a host-side synchronization, unlike cudaMemcpy(DtoD), + // use hipMemcpyAsync to get cuda's more performant behavior. For more info see: + // https://github.com/mfem/mfem/pull/2780 + HYPRE_HIP_CALL( hipMemcpyAsync(dst, src, size, hipMemcpyDeviceToDevice) ); +#endif + +#if defined(HYPRE_USING_SYCL) + HYPRE_SYCL_CALL( q->memcpy(dst, src, size).wait() ); #endif return; } @@ -653,6 +812,7 @@ hypre_Memcpy_core(void *dst, void *src, size_t size, hypre_MemoryLocation loc_ds /*--------------------------------------------------------------------------* * ExecPolicy *--------------------------------------------------------------------------*/ + static inline HYPRE_ExecutionPolicy hypre_GetExecPolicy1_core(hypre_MemoryLocation location) { @@ -668,7 +828,7 @@ hypre_GetExecPolicy1_core(hypre_MemoryLocation location) exec = HYPRE_EXEC_DEVICE; break; case hypre_MEMORY_UNIFIED : -#if defined(HYPRE_USING_GPU) +#if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) exec = hypre_HandleDefaultExecPolicy(hypre_handle()); #endif break; @@ -715,7 +875,7 @@ hypre_GetExecPolicy2_core(hypre_MemoryLocation location1, if (location1 == hypre_MEMORY_UNIFIED && location2 == hypre_MEMORY_UNIFIED) { -#if defined(HYPRE_USING_GPU) +#if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) exec = hypre_HandleDefaultExecPolicy(hypre_handle()); #endif } @@ -762,6 +922,8 @@ hypre_Memset(void *ptr, HYPRE_Int value, size_t num, HYPRE_MemoryLocation locati return ptr; } + hypre_CheckMemoryLocation(ptr, hypre_GetActualMemLocation(location)); + switch (hypre_GetActualMemLocation(location)) { case hypre_MEMORY_HOST : @@ -821,9 +983,11 @@ hypre_Free(void *ptr, HYPRE_MemoryLocation location) *--------------------------------------------------------------------------*/ void -hypre_Memcpy(void *dst, void *src, size_t size, HYPRE_MemoryLocation loc_dst, HYPRE_MemoryLocation loc_src) +hypre_Memcpy(void *dst, void *src, size_t size, HYPRE_MemoryLocation loc_dst, + HYPRE_MemoryLocation loc_src) { - hypre_Memcpy_core( dst, src, size, hypre_GetActualMemLocation(loc_dst), hypre_GetActualMemLocation(loc_src) ); + hypre_Memcpy_core( dst, src, size, hypre_GetActualMemLocation(loc_dst), + hypre_GetActualMemLocation(loc_src) ); } /*-------------------------------------------------------------------------- @@ -879,6 +1043,11 @@ hypre_ReAlloc_v2(void *ptr, size_t old_size, size_t new_size, HYPRE_MemoryLocati return hypre_MAlloc(new_size, location); } + if (old_size == new_size) + { + return ptr; + } + void *new_ptr = hypre_MAlloc(new_size, location); size_t smaller_size = new_size > old_size ? old_size : new_size; hypre_Memcpy(new_ptr, ptr, smaller_size, location, location); @@ -924,7 +1093,7 @@ hypre_GetPointerLocation(const void *ptr, hypre_MemoryLocation *memory_location) #if defined(HYPRE_USING_GPU) *memory_location = hypre_MEMORY_UNDEFINED; -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_DEVICE_OPENMP) +#if defined(HYPRE_USING_CUDA) struct cudaPointerAttributes attr; #if (CUDART_VERSION >= 10000) @@ -982,7 +1151,7 @@ hypre_GetPointerLocation(const void *ptr, hypre_MemoryLocation *memory_location) *memory_location = hypre_MEMORY_HOST_PINNED; } #endif // CUDART_VERSION >= 10000 -#endif // defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_DEVICE_OPENMP) +#endif // defined(HYPRE_USING_CUDA) #if defined(HYPRE_USING_HIP) @@ -995,7 +1164,7 @@ hypre_GetPointerLocation(const void *ptr, hypre_MemoryLocation *memory_location) ierr = 1; /* clear the error */ - hipGetLastError(); + (void) hipGetLastError(); if (err == hipErrorInvalidValue) { @@ -1006,271 +1175,479 @@ hypre_GetPointerLocation(const void *ptr, hypre_MemoryLocation *memory_location) { *memory_location = hypre_MEMORY_UNIFIED; } +#if (HIP_VERSION_MAJOR >= 6) + else if (attr.type == hipMemoryTypeDevice) +#else // (HIP_VERSION_MAJOR < 6) else if (attr.memoryType == hipMemoryTypeDevice) +#endif // (HIP_VERSION_MAJOR >= 6) { *memory_location = hypre_MEMORY_DEVICE; } +#if (HIP_VERSION_MAJOR >= 6) + else if (attr.type == hipMemoryTypeHost) +#else // (HIP_VERSION_MAJOR < 6) else if (attr.memoryType == hipMemoryTypeHost) +#endif // (HIP_VERSION_MAJOR >= 6) { *memory_location = hypre_MEMORY_HOST_PINNED; } +#if (HIP_VERSION_MAJOR >= 6) + else if (attr.type == hipMemoryTypeUnregistered) +#else + else +#endif + { + *memory_location = hypre_MEMORY_HOST; + } #endif // defined(HYPRE_USING_HIP) +#if defined(HYPRE_USING_SYCL) + /* If the device is not setup, then all allocations are assumed to be on the host */ + *memory_location = hypre_MEMORY_HOST; + if (hypre_HandleDeviceData(hypre_handle())) + { + if (hypre_HandleDevice(hypre_handle())) + { + sycl::usm::alloc allocType; + allocType = sycl::get_pointer_type(ptr, (hypre_HandleComputeStream(hypre_handle()))->get_context()); + + if (allocType == sycl::usm::alloc::unknown) + { + *memory_location = hypre_MEMORY_HOST; + } + else if (allocType == sycl::usm::alloc::host) + { + *memory_location = hypre_MEMORY_HOST_PINNED; + } + else if (allocType == sycl::usm::alloc::device) + { + *memory_location = hypre_MEMORY_DEVICE; + } + else if (allocType == sycl::usm::alloc::shared) + { + *memory_location = hypre_MEMORY_UNIFIED; + } + } + } +#endif //HYPRE_USING_SYCL + #else /* #if defined(HYPRE_USING_GPU) */ *memory_location = hypre_MEMORY_HOST; + HYPRE_UNUSED_VAR(ptr); #endif return ierr; } -#ifdef HYPRE_USING_MEMORY_TRACKER - /*-------------------------------------------------------------------------- - * Memory tracker - * do not use hypre_T* in the following since we don't want to track them * + * hypre_HostMemoryGetUsage + * + * Retrieves various memory usage statistics involving CPU RAM. The function + * fills an array with the memory data, converted to gibibytes (GiB). + * Detailed info is given below: + * + * - mem[0]: VmSize + * The current virtual memory size used by the process. This includes + * all memory the process can access, including memory that is swapped + * out and memory allocated but not used. + * + * - mem[1]: VmPeak + * The peak virtual memory size used by the process during its lifetime. + * + * - mem[2]: VmRSS + * The resident set size, which is the portion of the process' memory + * that is held in CPU RAM. This includes code, data, and stack space + * but excludes swapped-out memory. + * + * - mem[3]: VmHWM + * The peak resident set size, which is the maximum amount of memory + * that the process has had in CPU RAM at any point in time, aka. + * high water mark. + * + * - mem[4]: used + * The amount of used CPU RAM in the system. + * + * - mem[5]: total + * The total amount of CPU RAM installed in the system. + * + * This function doesn't return correct memory info for Windows environments. *--------------------------------------------------------------------------*/ -hypre_MemoryTracker * -hypre_MemoryTrackerCreate() -{ - hypre_MemoryTracker *ptr = (hypre_MemoryTracker *) calloc(1, sizeof(hypre_MemoryTracker)); - return ptr; -} -void -hypre_MemoryTrackerDestroy(hypre_MemoryTracker *tracker) +HYPRE_Int +hypre_HostMemoryGetUsage(HYPRE_Real *mem) { - if (tracker) + size_t vm_size = 0; + size_t vm_rss = 0; + size_t vm_hwm = 0; + size_t vm_peak = 0; + size_t tot_mem = 0; + size_t free_mem = 0; + HYPRE_Real b_to_gib = (HYPRE_Real) (1 << 30); + + /* Sanity check */ + if (!mem) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Mem is a NULL pointer!"); + return hypre_error_flag; + } + + /* Get system memory info */ +#if defined(__APPLE__) + struct task_basic_info t_info; + mach_msg_type_number_t t_info_count = TASK_BASIC_INFO_COUNT; + mach_msg_type_number_t count = HOST_VM_INFO_COUNT; + vm_statistics_data_t vm_stat; + hypre_int mib[2] = {CTL_HW, HW_MEMSIZE}; + size_t length = sizeof(size_t); + + if (sysctl(mib, 2, &tot_mem, &length, NULL, 0)) { - free(tracker->data); - free(tracker); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Problem running sysctl!"); + return hypre_error_flag; } -} -void -hypre_MemoryTrackerInsert(const char *action, - void *ptr, - size_t nbytes, - hypre_MemoryLocation memory_location, - const char *filename, - const char *function, - HYPRE_Int line) -{ + if (host_statistics(mach_host_self(), HOST_VM_INFO, (host_info_t)&vm_stat, &count) != + KERN_SUCCESS) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Problem running host_statistics!"); + return hypre_error_flag; + } - if (ptr == NULL) + free_mem = (size_t) vm_stat.free_count * (size_t) vm_page_size; + + /* Get the task info */ + if (task_info(mach_task_self(), TASK_BASIC_INFO, (task_info_t)&t_info, + &t_info_count) != KERN_SUCCESS) { - return; + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Problem running task_info!"); + return hypre_error_flag; } - hypre_MemoryTracker *tracker = hypre_memory_tracker(); + /* vm_peak is not directly available, so we set it to vm_size */ + vm_size = vm_peak = (size_t) t_info.virtual_size; + + /* vm_hwm is not directly available, so we set it to vm_rss */ + vm_rss = vm_hwm = (size_t) t_info.resident_size; + +#elif defined(__linux__) + struct sysinfo info; + char line[512]; + FILE *file; + + if (sysinfo(&info) != 0) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Problem running sysinfo!"); + return hypre_error_flag; + } + tot_mem = info.totalram * info.mem_unit; + free_mem = info.freeram * info.mem_unit; - if (tracker->alloced_size <= tracker->actual_size) + /* Function to get process memory info */ + file = fopen("/proc/self/status", "r"); + if (file == NULL) { - tracker->alloced_size = 2 * tracker->alloced_size + 1; - tracker->data = (hypre_MemoryTrackerEntry *) realloc(tracker->data, tracker->alloced_size * sizeof(hypre_MemoryTrackerEntry)); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Cannot open /proc/self/status!"); + return hypre_error_flag; } - hypre_assert(tracker->actual_size < tracker->alloced_size); + while (fgets(line, sizeof(line), file)) + { + (void) sscanf(line, "VmPeak: %zu kB", &vm_peak); + (void) sscanf(line, "VmSize: %zu kB", &vm_size); + (void) sscanf(line, "VmRSS: %zu kB", &vm_rss); + (void) sscanf(line, "VmHWM: %zu kB", &vm_hwm); + } + fclose(file); - hypre_MemoryTrackerEntry *entry = tracker->data + tracker->actual_size; + /* Convert KB to bytes */ + vm_peak *= 1024; + vm_size *= 1024; + vm_rss *= 1024; + vm_hwm *= 1024; +#endif - sprintf(entry->_action, "%s", action); - entry->_ptr = ptr; - entry->_nbytes = nbytes; - entry->_memory_location = memory_location; - sprintf(entry->_filename, "%s", filename); - sprintf(entry->_function, "%s", function); - entry->_line = line; - /* -1 is the initial value */ - entry->_pair = (size_t) -1; + /* Convert data from bytes to GiB (HYPRE_Real) */ + mem[0] = vm_size / b_to_gib; + mem[1] = vm_peak / b_to_gib; + mem[2] = vm_rss / b_to_gib; + mem[3] = vm_hwm / b_to_gib; + mem[4] = (tot_mem - free_mem) / b_to_gib; + mem[5] = tot_mem / b_to_gib; - tracker->actual_size ++; + return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_MemoryPrintUsage + *--------------------------------------------------------------------------*/ -/* do not use hypre_printf, hypre_fprintf, which have TAlloc - * endless loop "for (i = 0; i < tracker->actual_size; i++)" otherwise */ HYPRE_Int -hypre_PrintMemoryTracker() +hypre_MemoryPrintUsage(MPI_Comm comm, + HYPRE_Int log_level, + const char *function, + HYPRE_Int line) { - HYPRE_Int myid, ierr = 0; - char filename[256]; - FILE *file; - size_t i, j; + HYPRE_Int offset = 0; + HYPRE_Int ne = 6; + HYPRE_Real lmem[16]; + HYPRE_Real min[16]; + HYPRE_Real max[16]; + HYPRE_Real avg[16]; + HYPRE_Real ssq[16]; + HYPRE_Real std[16]; + HYPRE_Real *gmem = NULL; + HYPRE_Int i, j, myid, nprocs, ndigits; + const char *labels[] = {"Min", "Max", "Avg", "Std"}; + HYPRE_Real *data[] = {min, max, avg, std}; + +#if defined(HYPRE_USING_GPU) + offset = 2; + ne += offset; +#endif - hypre_MemoryTracker *tracker = hypre_memory_tracker(); +#if defined(HYPRE_USING_UMPIRE) + ne += 8; +#endif - hypre_MPI_Comm_rank(hypre_MPI_COMM_WORLD, &myid); - hypre_sprintf(filename,"HypreMemoryTrack.log.%05d", myid); - if ((file = fopen(filename, "a")) == NULL) + /* Return if neither the 1st nor 2nd bits of log_level are set */ + if (!(log_level & 0x3)) { - fprintf(stderr, "Error: can't open output file %s\n", filename); return hypre_error_flag; } - fprintf(file, "==== Operations:\n"); - fprintf(file, " ID EVENT ADDRESS BYTE LOCATION FILE(LINE) FUNCTION | Memory ( H P D U )\n"); + /* Initialize locals */ + for (j = 0; j < ne; j++) + { + lmem[j] = 0.0; + min[j] = HYPRE_REAL_MAX; + max[j] = 0.0; + avg[j] = 0.0; + ssq[j] = 0.0; + std[j] = 0.0; + } - size_t totl_bytes[hypre_MEMORY_UNIFIED+1] = {0}; - size_t peak_bytes[hypre_MEMORY_UNIFIED+1] = {0}; - size_t curr_bytes[hypre_MEMORY_UNIFIED+1] = {0}; + /* MPI variables */ + hypre_MPI_Comm_size(comm, &nprocs); + hypre_MPI_Comm_rank(comm, &myid); + ndigits = hypre_ndigits(nprocs); - for (i = 0; i < tracker->actual_size; i++) + /* Work space for gathering memory info */ + if (!myid) { - if (strstr(tracker->data[i]._action, "alloc") != NULL) - { - totl_bytes[tracker->data[i]._memory_location] += tracker->data[i]._nbytes; - curr_bytes[tracker->data[i]._memory_location] += tracker->data[i]._nbytes; - peak_bytes[tracker->data[i]._memory_location] = - hypre_max( curr_bytes[tracker->data[i]._memory_location], - peak_bytes[tracker->data[i]._memory_location] ); - - /* for each unpaired "alloc", find its "free" */ - if (tracker->data[i]._pair != (size_t) -1) - { - if ( tracker->data[i]._pair >= tracker->actual_size || - tracker->data[tracker->data[i]._pair]._pair != i) - { - fprintf(stderr, "hypre memory tracker internal error!\n"); - hypre_MPI_Abort(hypre_MPI_COMM_WORLD, 1); - } + gmem = hypre_CTAlloc(HYPRE_Real, ne * nprocs, HYPRE_MEMORY_HOST); + } - continue; - } + /* Get host memory info */ + hypre_HostMemoryGetUsage(lmem); - for (j = i+1; j < tracker->actual_size; j++) - { - if ( strstr(tracker->data[j]._action, "free") != NULL && - tracker->data[j]._pair == (size_t) -1 && - tracker->data[i]._ptr == tracker->data[j]._ptr && - tracker->data[i]._memory_location == tracker->data[j]._memory_location ) - { - tracker->data[i]._pair = j; - tracker->data[j]._pair = i; - tracker->data[j]._nbytes = tracker->data[i]._nbytes; - break; - } - } + /* Get device memory info */ +#if defined(HYPRE_USING_GPU) + hypre_DeviceMemoryGetUsage(&lmem[6]); +#endif + + /* Get umpire memory info */ +#if defined(HYPRE_USING_UMPIRE) + hypre_UmpireMemoryGetUsage(&lmem[6 + offset]); + +#elif !defined(HYPRE_USING_GPU) + HYPRE_UNUSED_VAR(offset); +#endif + + /* Gather memory info to rank 0 */ + hypre_MPI_Gather(lmem, ne, hypre_MPI_REAL, gmem, ne, hypre_MPI_REAL, 0, comm); - if (tracker->data[i]._pair == (size_t) -1) + /* Rank 0 computes min/max/avg/stddev statistics */ + if (!myid && (log_level & 0x2)) + { + for (i = 0; i < nprocs; i++) + { + for (j = 0; j < ne; j++) { - fprintf(stderr, "%6zu: %16p may not freed\n", i, tracker->data[i]._ptr ); + if (gmem[ne * i + j] < min[j]) { min[j] = gmem[ne * i + j]; } + if (gmem[ne * i + j] > max[j]) { max[j] = gmem[ne * i + j]; } + avg[j] += gmem[ne * i + j]; } } - else if (strstr(tracker->data[i]._action, "free") != NULL) + + for (j = 0; j < ne; j++) { - size_t pair = tracker->data[i]._pair; + avg[j] /= (HYPRE_Real) nprocs; + } - if (pair == (size_t) -1) - { - fprintf(stderr, "%6zu: unpaired free at %16p\n", i, tracker->data[i]._ptr ); - } - else + for (i = 0; i < nprocs; i++) + { + for (j = 0; j < ne; j++) { - curr_bytes[tracker->data[i]._memory_location] -= tracker->data[pair]._nbytes; + ssq[j] += hypre_pow(gmem[ne * i + j] - avg[j], 2) / (HYPRE_Real) nprocs; } } - if (i < tracker->prev_end) + for (j = 0; j < ne; j++) { - continue; + std[j] = hypre_sqrt(ssq[j]); } + } - char memory_location[256]; - char nbytes[32]; - - if (tracker->data[i]._memory_location == hypre_MEMORY_HOST) - { - sprintf(memory_location, "%s", "HOST"); - } - else if (tracker->data[i]._memory_location == hypre_MEMORY_HOST_PINNED) - { - sprintf(memory_location, "%s", "HOST_PINNED"); - } - else if (tracker->data[i]._memory_location == hypre_MEMORY_DEVICE) - { - sprintf(memory_location, "%s", "DEVICE"); - } - else if (tracker->data[i]._memory_location == hypre_MEMORY_UNIFIED) - { - sprintf(memory_location, "%s", "UNIFIED"); - } - else + /* Rank 0 prints the data */ + if (!myid) + { + /* Local memory usage statistics */ + if (log_level & 0x1) { - sprintf(memory_location, "%s", "UNDEFINED"); + for (i = 0; i < nprocs; i++) + { + if (line > 0) + { + hypre_printf("[%*d]: %s at line %d", ndigits, i, function, line); + } + else + { + hypre_printf("[%*d]: %s", ndigits, i, function); + } + hypre_printf(" | Vm[Size,RSS]/[Peak,HWM]: (%.2f, %.2f / %.2f, %.2f) GiB", + gmem[ne * i + 0], gmem[ne * i + 2], + gmem[ne * i + 1], gmem[ne * i + 3]); + hypre_printf(" | Used/Total RAM: (%.2f / %.2f)", gmem[ne * i + 4], gmem[ne * i + 5]); +#if defined(HYPRE_USING_GPU) + hypre_printf(" | Used/Total VRAM: (%.2f / %.2f)", gmem[ne * i + 6], gmem[ne * i + 7]); +#endif +#if defined(HYPRE_USING_UMPIRE) + if (gmem[ne * i + 9]) + { + hypre_printf(" | UmpHSize/UmpHPeak: (%.2f / %.2f)", + gmem[ne * i + 8], gmem[ne * i + 9]); + } + if (gmem[ne * i + 11]) + { + hypre_printf(" | UmpDSize/UmpDPeak: (%.2f / %.2f)", + gmem[ne * i + 10], gmem[ne * i + 11]); + } + if (gmem[ne * i + 13]) + { + hypre_printf(" | UmpUSize/UmpUPeak: (%.2f / %.2f)", + gmem[ne * i + 12], gmem[ne * i + 13]); + } + if (gmem[ne * i + 15]) + { + hypre_printf(" | UmpPSize/UmpPPeak: (%.2f / %.2f)", + gmem[ne * i + 14], gmem[ne * i + 15]); + } +#endif + hypre_printf("\n"); + } } - if (tracker->data[i]._nbytes != (size_t) -1) + /* Global memory usage statistics */ + if (log_level & 0x2) { - sprintf(nbytes, "%zu", tracker->data[i]._nbytes); - } - else - { - sprintf(nbytes, "%s", ""); - } + hypre_printf("\nMemory usage across ranks - "); + if (line > 0) + { + hypre_printf("%s at line %d\n\n", function, line); + } + else + { + hypre_printf("%s\n\n", function); + } - fprintf(file, " %6zu %12s %16p %10s %16s %40s (%5d) %50s | %12zu %12zu %12zu %12zu\n", - i, - tracker->data[i]._action, - tracker->data[i]._ptr, - nbytes, - memory_location, - tracker->data[i]._filename, - tracker->data[i]._line, - tracker->data[i]._function, - curr_bytes[hypre_MEMORY_HOST], - curr_bytes[hypre_MEMORY_HOST_PINNED], - curr_bytes[hypre_MEMORY_DEVICE], - curr_bytes[hypre_MEMORY_UNIFIED] - ); - } - - fprintf(file, "\n==== Total allocated (byte):\n"); - fprintf(file, "HOST: %16zu, HOST_PINNED %16zu, DEVICE %16zu, UNIFIED %16zu\n", - totl_bytes[hypre_MEMORY_HOST], - totl_bytes[hypre_MEMORY_HOST_PINNED], - totl_bytes[hypre_MEMORY_DEVICE], - totl_bytes[hypre_MEMORY_UNIFIED]); - - fprintf(file, "\n==== Peak (byte):\n"); - fprintf(file, "HOST: %16zu, HOST_PINNED %16zu, DEVICE %16zu, UNIFIED %16zu\n", - peak_bytes[hypre_MEMORY_HOST], - peak_bytes[hypre_MEMORY_HOST_PINNED], - peak_bytes[hypre_MEMORY_DEVICE], - peak_bytes[hypre_MEMORY_UNIFIED]); - - fprintf(file, "\n==== Reachable (byte):\n"); - fprintf(file, "HOST: %16zu, HOST_PINNED %16zu, DEVICE %16zu, UNIFIED %16zu\n", - curr_bytes[hypre_MEMORY_HOST], - curr_bytes[hypre_MEMORY_HOST_PINNED], - curr_bytes[hypre_MEMORY_DEVICE], - curr_bytes[hypre_MEMORY_UNIFIED]); - - fprintf(file, "\n==== Warnings:\n"); - for (i = 0; i < tracker->actual_size; i++) - { - if (tracker->data[i]._pair == (size_t) -1) - { - if (strstr(tracker->data[i]._action, "alloc") != NULL) + /* Print header */ + hypre_printf(" | %12s | %12s | %12s | %12s", + "VmSize (GiB)", "VmPeak (GiB)", "VmRSS (GiB)", "VmHWM (GiB)"); +#if defined(HYPRE_USING_GPU) + hypre_printf(" | %14s | %15s", "VRAMsize (GiB)", "VRAMtotal (GiB)"); +#endif +#if defined(HYPRE_USING_UMPIRE_HOST) + hypre_printf(" | %14s | %14s", "UmpHSize (GiB)", "UmpHPeak (GiB)"); +#endif +#if defined(HYPRE_USING_UMPIRE_DEVICE) + hypre_printf(" | %14s | %14s", "UmpDSize (GiB)", "UmpDPeak (GiB)"); +#endif +#if defined(HYPRE_USING_UMPIRE_UM) + if (max[12] > 0.0) + { + hypre_printf(" | %13s | %13s", "UmpUSize (GiB)", "UmpUPeak (GiB)"); + } +#endif +#if defined(HYPRE_USING_UMPIRE_PINNED) + hypre_printf(" | %13s | %13s", "UmpPSize (GiB)", "UmpPPeak (GiB)") +#endif + hypre_printf("\n"); + hypre_printf(" ----+--------------+--------------+--------------+-------------"); +#if defined(HYPRE_USING_GPU) + hypre_printf("-+----------------+----------------"); +#endif +#if defined(HYPRE_USING_UMPIRE_HOST) + if (max[8] > 0.0) + { + hypre_printf("-+----------------+---------------"); + } +#endif +#if defined(HYPRE_USING_UMPIRE_DEVICE) + if (max[10] > 0.0) { - fprintf(file, "%6zu: %p may have not been freed\n", i, tracker->data[i]._ptr ); + hypre_printf("-+----------------+---------------"); } - else if (strstr(tracker->data[i]._action, "free") != NULL) +#endif +#if defined(HYPRE_USING_UMPIRE_UM) + if (max[12] > 0.0) + { + hypre_printf("-+----------------+---------------"); + } +#endif +#if defined(HYPRE_USING_UMPIRE_PINNED) + if (max[14] > 0.0) { - fprintf(file, "%6zu: unpaired free at %16p\n", i, tracker->data[i]._ptr ); + hypre_printf("-+----------------+---------------"); + } +#endif + hypre_printf("\n"); + + /* Print table */ + for (i = 0; i < 4; i++) + { + hypre_printf(" %-3s", labels[i]); + hypre_printf(" | %12.3f | %12.3f | %12.3f | %12.3f", + data[i][0], data[i][1], data[i][2], data[i][3]); +#if defined(HYPRE_USING_GPU) + hypre_printf(" | %14.3f | %15.3f", data[i][6], data[i][7]); +#endif +#if defined(HYPRE_USING_UMPIRE_HOST) + if (max[8] > 0.0) + { + hypre_printf(" | %14.3f | %14.3f", data[i][8], data[i][9]); + } +#endif +#if defined(HYPRE_USING_UMPIRE_DEVICE) + if (max[10] > 0.0) + { + hypre_printf(" | %14.3f | %14.3f", data[i][10], data[i][11]); + } +#endif +#if defined(HYPRE_USING_UMPIRE_UM) + if (max[12] > 0.0) + { + hypre_printf(" | %14.3f | %14.3f", data[i][12], data[i][13]); + } +#endif +#if defined(HYPRE_USING_UMPIRE_PINNED) + if (max[14] > 0.0) + { + hypre_printf(" | %14.3f | %14.3f", data[i][14], data[i][15]); + } +#endif + hypre_printf("\n"); } } } + hypre_MPI_Barrier(comm); - fclose(file); - - tracker->prev_end = tracker->actual_size; + hypre_TFree(gmem, HYPRE_MEMORY_HOST); - return ierr; + return hypre_error_flag; } -#endif -/*--------------------------------------------------------------------------* - * Memory Pool +/*-------------------------------------------------------------------------- + * hypre_SetCubMemPoolSize *--------------------------------------------------------------------------*/ HYPRE_Int @@ -1279,8 +1656,7 @@ hypre_SetCubMemPoolSize(hypre_uint cub_bin_growth, hypre_uint cub_max_bin, size_t cub_max_cached_bytes) { -#if defined(HYPRE_USING_CUDA) -#ifdef HYPRE_USING_DEVICE_POOL +#if defined(HYPRE_USING_CUDA) && defined(HYPRE_USING_DEVICE_POOL) hypre_HandleCubBinGrowth(hypre_handle()) = cub_bin_growth; hypre_HandleCubMinBin(hypre_handle()) = cub_min_bin; hypre_HandleCubMaxBin(hypre_handle()) = cub_max_bin; @@ -1296,12 +1672,20 @@ hypre_SetCubMemPoolSize(hypre_uint cub_bin_growth, { hypre_HandleCubUvmAllocator(hypre_handle()) -> SetMaxCachedBytes(cub_max_cached_bytes); } -#endif +#else + HYPRE_UNUSED_VAR(cub_bin_growth); + HYPRE_UNUSED_VAR(cub_min_bin); + HYPRE_UNUSED_VAR(cub_max_bin); + HYPRE_UNUSED_VAR(cub_max_cached_bytes); #endif return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * HYPRE_SetGPUMemoryPoolSize + *--------------------------------------------------------------------------*/ + HYPRE_Int HYPRE_SetGPUMemoryPoolSize(HYPRE_Int bin_growth, HYPRE_Int min_bin, @@ -1311,63 +1695,84 @@ HYPRE_SetGPUMemoryPoolSize(HYPRE_Int bin_growth, return hypre_SetCubMemPoolSize(bin_growth, min_bin, max_bin, max_cached_bytes); } -#ifdef HYPRE_USING_DEVICE_POOL +#if defined(HYPRE_USING_DEVICE_POOL) && defined(HYPRE_USING_CUDA) + +/*-------------------------------------------------------------------------- + * hypre_CachingMallocDevice + *--------------------------------------------------------------------------*/ + cudaError_t hypre_CachingMallocDevice(void **ptr, size_t nbytes) { if (!hypre_HandleCubDevAllocator(hypre_handle())) { hypre_HandleCubDevAllocator(hypre_handle()) = - hypre_CudaDataCubCachingAllocatorCreate( hypre_HandleCubBinGrowth(hypre_handle()), - hypre_HandleCubMinBin(hypre_handle()), - hypre_HandleCubMaxBin(hypre_handle()), - hypre_HandleCubMaxCachedBytes(hypre_handle()), - false, - false, - false ); + hypre_DeviceDataCubCachingAllocatorCreate( hypre_HandleCubBinGrowth(hypre_handle()), + hypre_HandleCubMinBin(hypre_handle()), + hypre_HandleCubMaxBin(hypre_handle()), + hypre_HandleCubMaxCachedBytes(hypre_handle()), + false, + false, + false ); } return hypre_HandleCubDevAllocator(hypre_handle()) -> DeviceAllocate(ptr, nbytes); } +/*-------------------------------------------------------------------------- + * hypre_CachingFreeDevice + *--------------------------------------------------------------------------*/ + cudaError_t hypre_CachingFreeDevice(void *ptr) { return hypre_HandleCubDevAllocator(hypre_handle()) -> DeviceFree(ptr); } +/*-------------------------------------------------------------------------- + * hypre_CachingMallocManaged + *--------------------------------------------------------------------------*/ + cudaError_t hypre_CachingMallocManaged(void **ptr, size_t nbytes) { if (!hypre_HandleCubUvmAllocator(hypre_handle())) { hypre_HandleCubUvmAllocator(hypre_handle()) = - hypre_CudaDataCubCachingAllocatorCreate( hypre_HandleCubBinGrowth(hypre_handle()), - hypre_HandleCubMinBin(hypre_handle()), - hypre_HandleCubMaxBin(hypre_handle()), - hypre_HandleCubMaxCachedBytes(hypre_handle()), - false, - false, - true ); + hypre_DeviceDataCubCachingAllocatorCreate( hypre_HandleCubBinGrowth(hypre_handle()), + hypre_HandleCubMinBin(hypre_handle()), + hypre_HandleCubMaxBin(hypre_handle()), + hypre_HandleCubMaxCachedBytes(hypre_handle()), + false, + false, + true ); } return hypre_HandleCubUvmAllocator(hypre_handle()) -> DeviceAllocate(ptr, nbytes); } +/*-------------------------------------------------------------------------- + * hypre_CachingFreeManaged + *--------------------------------------------------------------------------*/ + cudaError_t hypre_CachingFreeManaged(void *ptr) { return hypre_HandleCubUvmAllocator(hypre_handle()) -> DeviceFree(ptr); } +/*-------------------------------------------------------------------------- + * hypre_DeviceDataCubCachingAllocatorCreate + *--------------------------------------------------------------------------*/ + hypre_cub_CachingDeviceAllocator * -hypre_CudaDataCubCachingAllocatorCreate(hypre_uint bin_growth, - hypre_uint min_bin, - hypre_uint max_bin, - size_t max_cached_bytes, - bool skip_cleanup, - bool debug, - bool use_managed_memory) +hypre_DeviceDataCubCachingAllocatorCreate(hypre_uint bin_growth, + hypre_uint min_bin, + hypre_uint max_bin, + size_t max_cached_bytes, + bool skip_cleanup, + bool debug, + bool use_managed_memory) { hypre_cub_CachingDeviceAllocator *allocator = new hypre_cub_CachingDeviceAllocator( bin_growth, @@ -1381,16 +1786,25 @@ hypre_CudaDataCubCachingAllocatorCreate(hypre_uint bin_growth, return allocator; } +/*-------------------------------------------------------------------------- + * hypre_DeviceDataCubCachingAllocatorDestroy + *--------------------------------------------------------------------------*/ + void -hypre_CudaDataCubCachingAllocatorDestroy(hypre_CudaData *data) +hypre_DeviceDataCubCachingAllocatorDestroy(hypre_DeviceData *data) { - delete hypre_CudaDataCubDevAllocator(data); - delete hypre_CudaDataCubUvmAllocator(data); + delete hypre_DeviceDataCubDevAllocator(data); + delete hypre_DeviceDataCubUvmAllocator(data); } -#endif // #ifdef HYPRE_USING_DEVICE_POOL +#endif // #if defined(HYPRE_USING_DEVICE_POOL) && defined(HYPRE_USING_CUDA) #if defined(HYPRE_USING_UMPIRE_HOST) + +/*-------------------------------------------------------------------------- + * hypre_umpire_host_pooled_allocate + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_umpire_host_pooled_allocate(void **ptr, size_t nbytes) { @@ -1409,9 +1823,9 @@ hypre_umpire_host_pooled_allocate(void **ptr, size_t nbytes) { umpire_allocator allocator; umpire_resourcemanager_get_allocator_by_name(rm_ptr, resource_name, &allocator); - umpire_resourcemanager_make_allocator_pool(rm_ptr, pool_name, allocator, - hypre_HandleUmpireHostPoolSize(handle), - hypre_HandleUmpireBlockSize(handle), &pooled_allocator); + hypre_umpire_resourcemanager_make_allocator_pool(rm_ptr, pool_name, allocator, + hypre_HandleUmpireHostPoolSize(handle), + hypre_HandleUmpireBlockSize(handle), &pooled_allocator); hypre_HandleOwnUmpireHostPool(handle) = 1; } @@ -1420,6 +1834,10 @@ hypre_umpire_host_pooled_allocate(void **ptr, size_t nbytes) return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_umpire_host_pooled_free + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_umpire_host_pooled_free(void *ptr) { @@ -1437,6 +1855,10 @@ hypre_umpire_host_pooled_free(void *ptr) return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_umpire_host_pooled_realloc + *--------------------------------------------------------------------------*/ + void * hypre_umpire_host_pooled_realloc(void *ptr, size_t size) { @@ -1456,11 +1878,16 @@ hypre_umpire_host_pooled_realloc(void *ptr, size_t size) #endif #if defined(HYPRE_USING_UMPIRE_DEVICE) + +/*-------------------------------------------------------------------------- + * hypre_umpire_device_pooled_allocate + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_umpire_device_pooled_allocate(void **ptr, size_t nbytes) { hypre_Handle *handle = hypre_handle(); - const hypre_int device_id = hypre_HandleCudaDevice(handle); + const hypre_int device_id = hypre_HandleDevice(handle); char resource_name[16]; const char *pool_name = hypre_HandleUmpireDevicePoolName(handle); @@ -1477,9 +1904,9 @@ hypre_umpire_device_pooled_allocate(void **ptr, size_t nbytes) { umpire_allocator allocator; umpire_resourcemanager_get_allocator_by_name(rm_ptr, resource_name, &allocator); - umpire_resourcemanager_make_allocator_pool(rm_ptr, pool_name, allocator, - hypre_HandleUmpireDevicePoolSize(handle), - hypre_HandleUmpireBlockSize(handle), &pooled_allocator); + hypre_umpire_resourcemanager_make_allocator_pool(rm_ptr, pool_name, allocator, + hypre_HandleUmpireDevicePoolSize(handle), + hypre_HandleUmpireBlockSize(handle), &pooled_allocator); hypre_HandleOwnUmpireDevicePool(handle) = 1; } @@ -1489,6 +1916,10 @@ hypre_umpire_device_pooled_allocate(void **ptr, size_t nbytes) return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_umpire_device_pooled_free + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_umpire_device_pooled_free(void *ptr) { @@ -1508,6 +1939,11 @@ hypre_umpire_device_pooled_free(void *ptr) #endif #if defined(HYPRE_USING_UMPIRE_UM) + +/*-------------------------------------------------------------------------- + * hypre_umpire_um_pooled_allocate + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_umpire_um_pooled_allocate(void **ptr, size_t nbytes) { @@ -1526,9 +1962,9 @@ hypre_umpire_um_pooled_allocate(void **ptr, size_t nbytes) { umpire_allocator allocator; umpire_resourcemanager_get_allocator_by_name(rm_ptr, resource_name, &allocator); - umpire_resourcemanager_make_allocator_pool(rm_ptr, pool_name, allocator, - hypre_HandleUmpireUMPoolSize(handle), - hypre_HandleUmpireBlockSize(handle), &pooled_allocator); + hypre_umpire_resourcemanager_make_allocator_pool(rm_ptr, pool_name, allocator, + hypre_HandleUmpireUMPoolSize(handle), + hypre_HandleUmpireBlockSize(handle), &pooled_allocator); hypre_HandleOwnUmpireUMPool(handle) = 1; } @@ -1538,6 +1974,10 @@ hypre_umpire_um_pooled_allocate(void **ptr, size_t nbytes) return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_umpire_um_pooled_free + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_umpire_um_pooled_free(void *ptr) { @@ -1557,6 +1997,11 @@ hypre_umpire_um_pooled_free(void *ptr) #endif #if defined(HYPRE_USING_UMPIRE_PINNED) + +/*-------------------------------------------------------------------------- + * hypre_umpire_pinned_pooled_allocate + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_umpire_pinned_pooled_allocate(void **ptr, size_t nbytes) { @@ -1575,9 +2020,9 @@ hypre_umpire_pinned_pooled_allocate(void **ptr, size_t nbytes) { umpire_allocator allocator; umpire_resourcemanager_get_allocator_by_name(rm_ptr, resource_name, &allocator); - umpire_resourcemanager_make_allocator_pool(rm_ptr, pool_name, allocator, - hypre_HandleUmpirePinnedPoolSize(handle), - hypre_HandleUmpireBlockSize(handle), &pooled_allocator); + hypre_umpire_resourcemanager_make_allocator_pool(rm_ptr, pool_name, allocator, + hypre_HandleUmpirePinnedPoolSize(handle), + hypre_HandleUmpireBlockSize(handle), &pooled_allocator); hypre_HandleOwnUmpirePinnedPool(handle) = 1; } @@ -1587,10 +2032,14 @@ hypre_umpire_pinned_pooled_allocate(void **ptr, size_t nbytes) return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_umpire_pinned_pooled_free + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_umpire_pinned_pooled_free(void *ptr) { - const hypre_Handle *handle = hypre_handle(); + hypre_Handle *handle = hypre_handle(); const char *pool_name = hypre_HandleUmpirePinnedPoolName(handle); umpire_allocator pooled_allocator; @@ -1605,3 +2054,280 @@ hypre_umpire_pinned_pooled_free(void *ptr) } #endif +/****************************************************************************** + * + * hypre Umpire + * + *****************************************************************************/ + +#if defined(HYPRE_USING_UMPIRE) + +/*-------------------------------------------------------------------------- + * hypre_UmpireInit + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_UmpireInit(hypre_Handle *hypre_handle_) +{ + umpire_resourcemanager_get_instance(&hypre_HandleUmpireResourceMan(hypre_handle_)); + + hypre_HandleUmpireDevicePoolSize(hypre_handle_) = 4LL * (1 << 30); // 4 GiB + hypre_HandleUmpireUMPoolSize(hypre_handle_) = 4LL * (1 << 30); // 4 GiB + hypre_HandleUmpireHostPoolSize(hypre_handle_) = 4LL * (1 << 30); // 4 GiB + hypre_HandleUmpirePinnedPoolSize(hypre_handle_) = 4LL * (1 << 30); // 4 GiB + + hypre_HandleUmpireBlockSize(hypre_handle_) = 512; + + strcpy(hypre_HandleUmpireDevicePoolName(hypre_handle_), "HYPRE_DEVICE_POOL"); + strcpy(hypre_HandleUmpireUMPoolName(hypre_handle_), "HYPRE_UM_POOL"); + strcpy(hypre_HandleUmpireHostPoolName(hypre_handle_), "HYPRE_HOST_POOL"); + strcpy(hypre_HandleUmpirePinnedPoolName(hypre_handle_), "HYPRE_PINNED_POOL"); + + hypre_HandleOwnUmpireDevicePool(hypre_handle_) = 0; + hypre_HandleOwnUmpireUMPool(hypre_handle_) = 0; + hypre_HandleOwnUmpireHostPool(hypre_handle_) = 0; + hypre_HandleOwnUmpirePinnedPool(hypre_handle_) = 0; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_UmpireFinalize + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_UmpireFinalize(hypre_Handle *hypre_handle_) +{ + umpire_resourcemanager *rm_ptr = &hypre_HandleUmpireResourceMan(hypre_handle_); + umpire_allocator allocator; + +#if defined(HYPRE_USING_UMPIRE_HOST) + if (hypre_HandleOwnUmpireHostPool(hypre_handle_)) + { + const char *pool_name = hypre_HandleUmpireHostPoolName(hypre_handle_); + umpire_resourcemanager_get_allocator_by_name(rm_ptr, pool_name, &allocator); + umpire_allocator_release(&allocator); + } +#endif + +#if defined(HYPRE_USING_UMPIRE_DEVICE) + if (hypre_HandleOwnUmpireDevicePool(hypre_handle_)) + { + const char *pool_name = hypre_HandleUmpireDevicePoolName(hypre_handle_); + umpire_resourcemanager_get_allocator_by_name(rm_ptr, pool_name, &allocator); + umpire_allocator_release(&allocator); + } +#endif + +#if defined(HYPRE_USING_UMPIRE_UM) + if (hypre_HandleOwnUmpireUMPool(hypre_handle_)) + { + const char *pool_name = hypre_HandleUmpireUMPoolName(hypre_handle_); + umpire_resourcemanager_get_allocator_by_name(rm_ptr, pool_name, &allocator); + umpire_allocator_release(&allocator); + } +#endif + +#if defined(HYPRE_USING_UMPIRE_PINNED) + if (hypre_HandleOwnUmpirePinnedPool(hypre_handle_)) + { + const char *pool_name = hypre_HandleUmpirePinnedPoolName(hypre_handle_); + umpire_resourcemanager_get_allocator_by_name(rm_ptr, pool_name, &allocator); + umpire_allocator_release(&allocator); + } +#endif + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_UmpireMemoryGetUsage + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_UmpireMemoryGetUsage(HYPRE_Real *memory) +{ + hypre_Handle *handle = hypre_handle(); + umpire_resourcemanager *rm_ptr = &hypre_HandleUmpireResourceMan(handle); + umpire_allocator allocator; + + size_t memoryB[8] = {0, 0, 0, 0, 0, 0, 0, 0}; + HYPRE_Int i; + + /* Sanity check */ + if (!memory) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "memory is a NULL pointer!"); + return hypre_error_flag; + } + +#if defined(HYPRE_USING_UMPIRE_HOST) + if (hypre_HandleOwnUmpireHostPool(handle)) + { + const char *pool_name = hypre_HandleUmpireHostPoolName(handle); + umpire_resourcemanager_get_allocator_by_name(rm_ptr, pool_name, &allocator); + memoryB[0] = umpire_allocator_get_current_size(&allocator); + memoryB[1] = umpire_allocator_get_high_watermark(&allocator); + } +#endif + +#if defined(HYPRE_USING_UMPIRE_DEVICE) + if (hypre_HandleOwnUmpireDevicePool(handle)) + { + const char *pool_name = hypre_HandleUmpireDevicePoolName(handle); + umpire_resourcemanager_get_allocator_by_name(rm_ptr, pool_name, &allocator); + memoryB[2] = umpire_allocator_get_current_size(&allocator); + memoryB[3] = umpire_allocator_get_high_watermark(&allocator); + } +#endif + +#if defined(HYPRE_USING_UMPIRE_UM) + if (hypre_HandleOwnUmpireUMPool(handle)) + { + const char *pool_name = hypre_HandleUmpireUMPoolName(handle); + umpire_resourcemanager_get_allocator_by_name(rm_ptr, pool_name, &allocator); + memoryB[4] = umpire_allocator_get_current_size(&allocator); + memoryB[5] = umpire_allocator_get_high_watermark(&allocator); + } +#endif + +#if defined(HYPRE_USING_UMPIRE_PINNED) + if (hypre_HandleOwnUmpirePinnedPool(handle)) + { + const char *pool_name = hypre_HandleUmpirePinnedPoolName(handle); + umpire_resourcemanager_get_allocator_by_name(rm_ptr, pool_name, &allocator); + memoryB[6] = umpire_allocator_get_current_size(&allocator); + memoryB[7] = umpire_allocator_get_high_watermark(&allocator); + } +#endif + + /* Convert bytes to GiB */ + for (i = 0; i < 8; i++) + { + memory[i] = ((HYPRE_Real) memoryB[i]) / ((HYPRE_Real) (1 << 30)); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * HYPRE_SetUmpireDevicePoolSize + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SetUmpireDevicePoolSize(size_t nbytes) +{ + hypre_HandleUmpireDevicePoolSize(hypre_handle()) = nbytes; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * HYPRE_SetUmpireUMPoolSize + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SetUmpireUMPoolSize(size_t nbytes) +{ + hypre_HandleUmpireUMPoolSize(hypre_handle()) = nbytes; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * HYPRE_SetUmpireHostPoolSize + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SetUmpireHostPoolSize(size_t nbytes) +{ + hypre_HandleUmpireHostPoolSize(hypre_handle()) = nbytes; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * HYPRE_SetUmpirePinnedPoolSize + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SetUmpirePinnedPoolSize(size_t nbytes) +{ + hypre_HandleUmpirePinnedPoolSize(hypre_handle()) = nbytes; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * HYPRE_SetUmpireDevicePoolName + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SetUmpireDevicePoolName(const char *pool_name) +{ + if (strlen(pool_name) > HYPRE_UMPIRE_POOL_NAME_MAX_LEN) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + strcpy(hypre_HandleUmpireDevicePoolName(hypre_handle()), pool_name); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * HYPRE_SetUmpireUMPoolName + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SetUmpireUMPoolName(const char *pool_name) +{ + if (strlen(pool_name) > HYPRE_UMPIRE_POOL_NAME_MAX_LEN) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + strcpy(hypre_HandleUmpireUMPoolName(hypre_handle()), pool_name); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * HYPRE_SetUmpireHostPoolName + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SetUmpireHostPoolName(const char *pool_name) +{ + if (strlen(pool_name) > HYPRE_UMPIRE_POOL_NAME_MAX_LEN) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + strcpy(hypre_HandleUmpireHostPoolName(hypre_handle()), pool_name); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * HYPRE_SetUmpirePinnedPoolName + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SetUmpirePinnedPoolName(const char *pool_name) +{ + if (strlen(pool_name) > HYPRE_UMPIRE_POOL_NAME_MAX_LEN) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + strcpy(hypre_HandleUmpirePinnedPoolName(hypre_handle()), pool_name); + + return hypre_error_flag; +} + +#endif /* #if defined(HYPRE_USING_UMPIRE) */ diff --git a/external/hypre/src/utilities/memory.h b/external/hypre/src/utilities/memory.h index d4f66e4c..64c44f44 100644 --- a/external/hypre/src/utilities/memory.h +++ b/external/hypre/src/utilities/memory.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -71,9 +71,8 @@ #include #include -#if defined(HYPRE_USING_UMPIRE) -#include "umpire/interface/umpire.h" -#define HYPRE_UMPIRE_POOL_NAME_MAX_LEN 1024 +#if defined(HYPRE_USING_UNIFIED_MEMORY) && defined(HYPRE_USING_DEVICE_OPENMP) +//#pragma omp requires unified_shared_memory #endif /* stringification: @@ -91,17 +90,18 @@ extern "C" { typedef enum _hypre_MemoryLocation { hypre_MEMORY_UNDEFINED = -1, - hypre_MEMORY_HOST , - hypre_MEMORY_HOST_PINNED , - hypre_MEMORY_DEVICE , - hypre_MEMORY_UNIFIED + hypre_MEMORY_HOST, + hypre_MEMORY_HOST_PINNED, + hypre_MEMORY_DEVICE, + hypre_MEMORY_UNIFIED, + hypre_NUM_MEMORY_LOCATION } hypre_MemoryLocation; /*------------------------------------------------------- * hypre_GetActualMemLocation * return actual location based on the selected memory model *-------------------------------------------------------*/ -static inline hypre_MemoryLocation +static inline HYPRE_MAYBE_UNUSED_FUNC hypre_MemoryLocation hypre_GetActualMemLocation(HYPRE_MemoryLocation location) { if (location == HYPRE_MEMORY_HOST) @@ -125,102 +125,8 @@ hypre_GetActualMemLocation(HYPRE_MemoryLocation location) return hypre_MEMORY_UNDEFINED; } -#ifdef HYPRE_USING_MEMORY_TRACKER -typedef struct -{ - char _action[16]; - void *_ptr; - size_t _nbytes; - hypre_MemoryLocation _memory_location; - char _filename[256]; - char _function[256]; - HYPRE_Int _line; - size_t _pair; -} hypre_MemoryTrackerEntry; - -typedef struct -{ - size_t actual_size; - size_t alloced_size; - size_t prev_end; - hypre_MemoryTrackerEntry *data; -} hypre_MemoryTracker; - -/* These Allocs are with memory tracker, for debug */ -#define hypre_TAlloc(type, count, location) \ -( \ -{ \ - void *ptr = hypre_MAlloc((size_t)(sizeof(type) * (count)), location); \ - hypre_MemoryTrackerInsert("malloc", ptr, sizeof(type)*(count), hypre_GetActualMemLocation(location), __FILE__, __func__, __LINE__);\ - (type *) ptr; \ -} \ -) - -#define _hypre_TAlloc(type, count, location) \ -( \ -{ \ - void *ptr = _hypre_MAlloc((size_t)(sizeof(type) * (count)), location); \ - hypre_MemoryTrackerInsert("malloc", ptr, sizeof(type)*(count), location, __FILE__, __func__, __LINE__); \ - (type *) ptr; \ -} \ -) - -#define hypre_CTAlloc(type, count, location) \ -( \ -{ \ - void *ptr = hypre_CAlloc((size_t)(count), (size_t)sizeof(type), location); \ - hypre_MemoryTrackerInsert("calloc", ptr, sizeof(type)*(count), hypre_GetActualMemLocation(location), __FILE__, __func__, __LINE__);\ - (type *) ptr; \ -} \ -) - -#define hypre_TReAlloc(ptr, type, count, location) \ -( \ -{ \ - hypre_MemoryTrackerInsert("rfree", ptr, (size_t) -1, hypre_GetActualMemLocation(location), __FILE__, __func__, __LINE__); \ - void *new_ptr = hypre_ReAlloc((char *)ptr, (size_t)(sizeof(type) * (count)), location); \ - hypre_MemoryTrackerInsert("rmalloc", new_ptr, sizeof(type)*(count), hypre_GetActualMemLocation(location), __FILE__, __func__, __LINE__);\ - (type *) new_ptr; \ -} \ -) - -#define hypre_TReAlloc_v2(ptr, old_type, old_count, new_type, new_count, location) \ -( \ -{ \ - hypre_MemoryTrackerInsert("rfree", ptr, sizeof(old_type)*(old_count), hypre_GetActualMemLocation(location), __FILE__, __func__, __LINE__); \ - void *new_ptr = hypre_ReAlloc_v2((char *)ptr, (size_t)(sizeof(old_type)*(old_count)), (size_t)(sizeof(new_type)*(new_count)), location); \ - hypre_MemoryTrackerInsert("rmalloc", new_ptr, sizeof(new_type)*(new_count), hypre_GetActualMemLocation(location), __FILE__, __func__, __LINE__);\ - (new_type *) new_ptr; \ -} \ -) - -#define hypre_TMemcpy(dst, src, type, count, locdst, locsrc) \ -( \ -{ \ - hypre_Memcpy((void *)(dst), (void *)(src), (size_t)(sizeof(type) * (count)), locdst, locsrc); \ -} \ -) - -#define hypre_TFree(ptr, location) \ -( \ -{ \ - hypre_MemoryTrackerInsert("free", ptr, (size_t) -1, hypre_GetActualMemLocation(location), __FILE__, __func__, __LINE__); \ - hypre_Free((void *)ptr, location); \ - ptr = NULL; \ -} \ -) - -#define _hypre_TFree(ptr, location) \ -( \ -{ \ - hypre_MemoryTrackerInsert("free", ptr, (size_t) -1, location, __FILE__, __func__, __LINE__); \ - _hypre_Free((void *)ptr, location); \ - ptr = NULL; \ -} \ -) - -#else /* #ifdef HYPRE_USING_MEMORY_TRACKER */ +#if !defined(HYPRE_USING_MEMORY_TRACKER) #define hypre_TAlloc(type, count, location) \ ( (type *) hypre_MAlloc((size_t)(sizeof(type) * (count)), location) ) @@ -246,7 +152,7 @@ typedef struct #define _hypre_TFree(ptr, location) \ ( _hypre_Free((void *)ptr, location), ptr = NULL ) -#endif /* #ifdef HYPRE_USING_MEMORY_TRACKER */ +#endif /* #if !defined(HYPRE_USING_MEMORY_TRACKER) */ /*-------------------------------------------------------------------------- @@ -254,12 +160,16 @@ typedef struct *--------------------------------------------------------------------------*/ /* memory.c */ +HYPRE_Int hypre_GetMemoryLocationName(hypre_MemoryLocation memory_location, + char *memory_location_name); +void hypre_CheckMemoryLocation(void *ptr, hypre_MemoryLocation location); void * hypre_Memset(void *ptr, HYPRE_Int value, size_t num, HYPRE_MemoryLocation location); void hypre_MemPrefetch(void *ptr, size_t size, HYPRE_MemoryLocation location); void * hypre_MAlloc(size_t size, HYPRE_MemoryLocation location); void * hypre_CAlloc( size_t count, size_t elt_size, HYPRE_MemoryLocation location); void hypre_Free(void *ptr, HYPRE_MemoryLocation location); -void hypre_Memcpy(void *dst, void *src, size_t size, HYPRE_MemoryLocation loc_dst, HYPRE_MemoryLocation loc_src); +void hypre_Memcpy(void *dst, void *src, size_t size, HYPRE_MemoryLocation loc_dst, + HYPRE_MemoryLocation loc_src); void * hypre_ReAlloc(void *ptr, size_t size, HYPRE_MemoryLocation location); void * hypre_ReAlloc_v2(void *ptr, size_t old_size, size_t new_size, HYPRE_MemoryLocation location); @@ -267,11 +177,12 @@ void * _hypre_MAlloc(size_t size, hypre_MemoryLocation location); void _hypre_Free(void *ptr, hypre_MemoryLocation location); HYPRE_ExecutionPolicy hypre_GetExecPolicy1(HYPRE_MemoryLocation location); -HYPRE_ExecutionPolicy hypre_GetExecPolicy2(HYPRE_MemoryLocation location1, HYPRE_MemoryLocation location2); +HYPRE_ExecutionPolicy hypre_GetExecPolicy2(HYPRE_MemoryLocation location1, + HYPRE_MemoryLocation location2); HYPRE_Int hypre_GetPointerLocation(const void *ptr, hypre_MemoryLocation *memory_location); -HYPRE_Int hypre_PrintMemoryTracker(); -HYPRE_Int hypre_SetCubMemPoolSize( hypre_uint bin_growth, hypre_uint min_bin, hypre_uint max_bin, size_t max_cached_bytes ); +HYPRE_Int hypre_SetCubMemPoolSize( hypre_uint bin_growth, hypre_uint min_bin, hypre_uint max_bin, + size_t max_cached_bytes ); HYPRE_Int hypre_umpire_host_pooled_allocate(void **ptr, size_t nbytes); HYPRE_Int hypre_umpire_host_pooled_free(void *ptr); void *hypre_umpire_host_pooled_realloc(void *ptr, size_t size); @@ -281,29 +192,27 @@ HYPRE_Int hypre_umpire_um_pooled_allocate(void **ptr, size_t nbytes); HYPRE_Int hypre_umpire_um_pooled_free(void *ptr); HYPRE_Int hypre_umpire_pinned_pooled_allocate(void **ptr, size_t nbytes); HYPRE_Int hypre_umpire_pinned_pooled_free(void *ptr); - -#ifdef HYPRE_USING_MEMORY_TRACKER -hypre_MemoryTracker * hypre_MemoryTrackerCreate(); -void hypre_MemoryTrackerDestroy(hypre_MemoryTracker *tracker); -void hypre_MemoryTrackerInsert(const char *action, void *ptr, size_t nbytes, hypre_MemoryLocation memory_location, const char *filename, const char *function, HYPRE_Int line); -HYPRE_Int hypre_PrintMemoryTracker(); -#endif - +HYPRE_Int hypre_UmpireInit(hypre_Handle *hypre_handle_); +HYPRE_Int hypre_UmpireFinalize(hypre_Handle *hypre_handle_); +HYPRE_Int hypre_UmpireGetCurrentMemoryUsage(MPI_Comm comm, HYPRE_Real *current); +HYPRE_Int hypre_UmpireMemoryGetUsage(HYPRE_Real *memory); +HYPRE_Int hypre_HostMemoryGetUsage(HYPRE_Real *mem); +HYPRE_Int hypre_MemoryPrintUsage(MPI_Comm comm, HYPRE_Int level, + const char *function, HYPRE_Int line); +#define HYPRE_PRINT_MEMORY_USAGE(comm) hypre_MemoryPrintUsage(comm,\ + hypre_HandleLogLevel(hypre_handle()),\ + __func__,\ + __LINE__) /* memory_dmalloc.c */ HYPRE_Int hypre_InitMemoryDebugDML( HYPRE_Int id ); HYPRE_Int hypre_FinalizeMemoryDebugDML( void ); -char *hypre_MAllocDML( HYPRE_Int size , char *file , HYPRE_Int line ); -char *hypre_CAllocDML( HYPRE_Int count , HYPRE_Int elt_size , char *file , HYPRE_Int line ); -char *hypre_ReAllocDML( char *ptr , HYPRE_Int size , char *file , HYPRE_Int line ); -void hypre_FreeDML( char *ptr , char *file , HYPRE_Int line ); - -/* GPU malloc prototype */ -typedef void (*GPUMallocFunc)(void **, size_t); -typedef void (*GPUMfreeFunc)(void *); +char *hypre_MAllocDML( HYPRE_Int size, char *file, HYPRE_Int line ); +char *hypre_CAllocDML( HYPRE_Int count, HYPRE_Int elt_size, char *file, HYPRE_Int line ); +char *hypre_ReAllocDML( char *ptr, HYPRE_Int size, char *file, HYPRE_Int line ); +void hypre_FreeDML( char *ptr, char *file, HYPRE_Int line ); #ifdef __cplusplus } #endif -#endif - +#endif /* hypre_MEMORY_HEADER */ diff --git a/external/hypre/src/utilities/memory_dmalloc.c b/external/hypre/src/utilities/memory_dmalloc.c index 00c7df3f..5c4971df 100644 --- a/external/hypre/src/utilities/memory_dmalloc.c +++ b/external/hypre/src/utilities/memory_dmalloc.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -63,9 +63,13 @@ hypre_MAllocDML( HYPRE_Int size, char *ptr; if (size > 0) + { ptr = _malloc_leap(file, line, size); + } else + { ptr = NULL; + } return ptr; } @@ -81,7 +85,7 @@ hypre_CAllocDML( HYPRE_Int count, HYPRE_Int line ) { char *ptr; - HYPRE_Int size = count*elt_size; + HYPRE_Int size = count * elt_size; if (size > 0) { diff --git a/external/hypre/src/utilities/memory_tracker.c b/external/hypre/src/utilities/memory_tracker.c new file mode 100644 index 00000000..895611e3 --- /dev/null +++ b/external/hypre/src/utilities/memory_tracker.c @@ -0,0 +1,638 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +/*-------------------------------------------------------------------------- + * Memory tracker + * Do NOT use hypre_T* in this file since we don't want to track them, + * Do NOT use hypre_printf, hypre_fprintf, which have hypre_TAlloc/Free + * endless for-loop otherwise + *--------------------------------------------------------------------------*/ + +#include "_hypre_utilities.h" + +#if defined(HYPRE_USING_MEMORY_TRACKER) + +hypre_MemoryTracker *_hypre_memory_tracker = NULL; + +/* accessor to the global ``_hypre_memory_tracker'' */ +hypre_MemoryTracker* +hypre_memory_tracker(void) +{ +#ifdef HYPRE_USING_OPENMP + #pragma omp critical +#endif + { + if (!_hypre_memory_tracker) + { + _hypre_memory_tracker = hypre_MemoryTrackerCreate(); + } + } + + return _hypre_memory_tracker; +} + +size_t hypre_total_bytes[hypre_NUM_MEMORY_LOCATION]; +size_t hypre_peak_bytes[hypre_NUM_MEMORY_LOCATION]; +size_t hypre_current_bytes[hypre_NUM_MEMORY_LOCATION]; +HYPRE_Int hypre_memory_tracker_print = 0; +char hypre_memory_tracker_filename[HYPRE_MAX_FILE_NAME_LEN] = "HypreMemoryTrack.log"; + +char *hypre_basename(const char *name) +{ + const char *base = name; + while (*name) + { + if (*name++ == '/') + { + base = name; + } + } + return (char *) base; +} + +hypre_MemcpyType +hypre_GetMemcpyType(hypre_MemoryLocation dst, + hypre_MemoryLocation src) +{ + HYPRE_Int d = 0, s = 0; + + if (dst == hypre_MEMORY_HOST || dst == hypre_MEMORY_HOST_PINNED) { d = 0; } + else if (dst == hypre_MEMORY_DEVICE || dst == hypre_MEMORY_UNIFIED) { d = 1; } + + if (src == hypre_MEMORY_HOST || src == hypre_MEMORY_HOST_PINNED) { s = 0; } + else if (src == hypre_MEMORY_DEVICE || src == hypre_MEMORY_UNIFIED) { s = 1; } + + if (d == 0 && s == 0) { return hypre_MEMCPY_H2H; } + if (d == 0 && s == 1) { return hypre_MEMCPY_D2H; } + if (d == 1 && s == 0) { return hypre_MEMCPY_H2D; } + if (d == 1 && s == 1) { return hypre_MEMCPY_D2D; } + + return hypre_MEMCPY_NUM_TYPES; +} + +hypre_int +hypre_MemoryTrackerQueueCompSort(const void *e1, + const void *e2) +{ + void *p1 = ((hypre_MemoryTrackerEntry *) e1) -> ptr; + void *p2 = ((hypre_MemoryTrackerEntry *) e2) -> ptr; + + if (p1 < p2) { return -1; } + if (p1 > p2) { return 1; } + + size_t t1 = ((hypre_MemoryTrackerEntry *) e1) -> time_step; + size_t t2 = ((hypre_MemoryTrackerEntry *) e2) -> time_step; + + if (t1 < t2) { return -1; } + if (t1 > t2) { return 1; } + + return 0; +} + + +hypre_int +hypre_MemoryTrackerQueueCompSearch(const void *e1, + const void *e2) +{ + void *p1 = ((hypre_MemoryTrackerEntry **) e1)[0] -> ptr; + void *p2 = ((hypre_MemoryTrackerEntry **) e2)[0] -> ptr; + + if (p1 < p2) { return -1; } + if (p1 > p2) { return 1; } + + return 0; +} + +hypre_MemoryTrackerEvent +hypre_MemoryTrackerGetNext(hypre_MemoryTracker *tracker) +{ + hypre_MemoryTrackerEvent i, k = HYPRE_MEMORY_NUM_EVENTS; + hypre_MemoryTrackerQueue *q = tracker->queue; + + for (i = HYPRE_MEMORY_EVENT_ALLOC; i < HYPRE_MEMORY_NUM_EVENTS; i++) + { + if (q[i].head >= q[i].actual_size) + { + continue; + } + + if (k == HYPRE_MEMORY_NUM_EVENTS || q[i].data[q[i].head].time_step < q[k].data[q[k].head].time_step) + { + k = i; + } + } + + return k; +} + +HYPRE_Int +hypre_MemoryTrackerSortQueue(hypre_MemoryTrackerQueue *q) +{ + size_t i = 0; + + if (!q) { return hypre_error_flag; } + + free(q->sorted_data); + free(q->sorted_data_compressed_offset); + free(q->sorted_data_compressed); + + q->sorted_data = (hypre_MemoryTrackerEntry *) malloc(q->actual_size * sizeof( + hypre_MemoryTrackerEntry)); + memcpy(q->sorted_data, q->data, q->actual_size * sizeof(hypre_MemoryTrackerEntry)); + qsort(q->sorted_data, q->actual_size, sizeof(hypre_MemoryTrackerEntry), + hypre_MemoryTrackerQueueCompSort); + + q->sorted_data_compressed_len = 0; + q->sorted_data_compressed_offset = (size_t *) malloc(q->actual_size * sizeof(size_t)); + q->sorted_data_compressed = (hypre_MemoryTrackerEntry **) malloc((q->actual_size + 1) * sizeof( + hypre_MemoryTrackerEntry *)); + + for (i = 0; i < q->actual_size; i++) + { + if (i == 0 || q->sorted_data[i].ptr != q->sorted_data[i - 1].ptr) + { + q->sorted_data_compressed_offset[q->sorted_data_compressed_len] = i; + q->sorted_data_compressed[q->sorted_data_compressed_len] = &q->sorted_data[i]; + q->sorted_data_compressed_len ++; + } + } + q->sorted_data_compressed[q->sorted_data_compressed_len] = q->sorted_data + q->actual_size; + + q->sorted_data_compressed_offset = (size_t *) + realloc(q->sorted_data_compressed_offset, q->sorted_data_compressed_len * sizeof(size_t)); + + q->sorted_data_compressed = (hypre_MemoryTrackerEntry **) + realloc(q->sorted_data_compressed, + (q->sorted_data_compressed_len + 1) * sizeof(hypre_MemoryTrackerEntry *)); + + return hypre_error_flag; +} + +hypre_MemoryTracker * +hypre_MemoryTrackerCreate() +{ + hypre_MemoryTracker *ptr = (hypre_MemoryTracker *) calloc(1, sizeof(hypre_MemoryTracker)); + return ptr; +} + +void +hypre_MemoryTrackerDestroy(hypre_MemoryTracker *tracker) +{ + if (tracker) + { + HYPRE_Int i; + + for (i = 0; i < HYPRE_MEMORY_NUM_EVENTS; i++) + { + free(tracker->queue[i].data); + free(tracker->queue[i].sorted_data); + free(tracker->queue[i].sorted_data_compressed_offset); + free(tracker->queue[i].sorted_data_compressed); + } + + free(tracker); + } +} + +HYPRE_Int +hypre_MemoryTrackerSetPrint(HYPRE_Int do_print) +{ + hypre_memory_tracker_print = do_print; + + return hypre_error_flag; +} + +HYPRE_Int +hypre_MemoryTrackerSetFileName(const char *file_name) +{ + snprintf(hypre_memory_tracker_filename, HYPRE_MAX_FILE_NAME_LEN, "%s", file_name); + + return hypre_error_flag; +} + +void +hypre_MemoryTrackerInsert1(const char *action, + void *ptr, + size_t nbytes, + hypre_MemoryLocation memory_location, + const char *filename, + const char *function, + HYPRE_Int line) +{ + hypre_MemoryTrackerInsert2(action, ptr, NULL, nbytes, memory_location, hypre_MEMORY_UNDEFINED, + filename, function, line); +} + +void +hypre_MemoryTrackerInsert2(const char *action, + void *ptr, + void *ptr2, + size_t nbytes, + hypre_MemoryLocation memory_location, + hypre_MemoryLocation memory_location2, + const char *filename, + const char *function, + HYPRE_Int line) +{ + if (ptr == NULL) + { + return; + } + + hypre_MemoryTracker *tracker = hypre_memory_tracker(); + + hypre_MemoryTrackerEvent q; + + /* Get the proper queue based on the action */ + + if (strstr(action, "alloc") != NULL) + { + /* including malloc, alloc and the malloc in realloc */ + q = HYPRE_MEMORY_EVENT_ALLOC; + } + else if (strstr(action, "free") != NULL) + { + /* including free and the free in realloc */ + q = HYPRE_MEMORY_EVENT_FREE; + } + else if (strstr(action, "memcpy") != NULL) + { + /* including memcpy */ + q = HYPRE_MEMORY_EVENT_COPY; + } + else + { + return; + } + + hypre_MemoryTrackerQueue *queue = &tracker->queue[q]; + +#ifdef HYPRE_USING_OPENMP + #pragma omp critical +#endif + { + /* resize if not enough space */ + + if (queue->alloced_size <= queue->actual_size) + { + queue->alloced_size = 2 * queue->alloced_size + 1; + queue->data = (hypre_MemoryTrackerEntry *) realloc(queue->data, + queue->alloced_size * sizeof(hypre_MemoryTrackerEntry)); + } + + hypre_assert(queue->actual_size < queue->alloced_size); + + /* insert an entry */ + hypre_MemoryTrackerEntry *entry = queue->data + queue->actual_size; + + entry->index = queue->actual_size; + entry->time_step = tracker->curr_time_step; + sprintf(entry->action, "%s", action); + entry->ptr = ptr; + entry->ptr2 = ptr2; + entry->nbytes = nbytes; + entry->memory_location = memory_location; + entry->memory_location2 = memory_location2; + sprintf(entry->filename, "%s", filename); + sprintf(entry->function, "%s", function); + entry->line = line; + entry->pair = (size_t) -1; + +#if 0 + HYPRE_Int myid; + hypre_MPI_Comm_rank(hypre_MPI_COMM_WORLD, &myid); + if (myid == 0 && entry->time_step == 28111) {assert(0);} +#endif + + /* increase the time step */ + tracker->curr_time_step ++; + + /* increase the queue length by 1 */ + queue->actual_size ++; + } +} + +HYPRE_Int +hypre_PrintMemoryTracker( size_t *totl_bytes_o, + size_t *peak_bytes_o, + size_t *curr_bytes_o, + HYPRE_Int do_print, + const char *fname ) +{ + char filename[HYPRE_MAX_FILE_NAME_LEN + 16]; + FILE *file = NULL; + size_t totl_bytes[hypre_NUM_MEMORY_LOCATION] = {0}; + size_t peak_bytes[hypre_NUM_MEMORY_LOCATION] = {0}; + size_t curr_bytes[hypre_NUM_MEMORY_LOCATION] = {0}; + size_t copy_bytes[hypre_MEMCPY_NUM_TYPES] = {0}; + size_t j; + hypre_MemoryTrackerEvent i; + //HYPRE_Real t0 = hypre_MPI_Wtime(); + + HYPRE_Int leakcheck = 1; + + hypre_MemoryTracker *tracker = hypre_memory_tracker(); + hypre_MemoryTrackerQueue *qq = tracker->queue; + hypre_MemoryTrackerQueue *qa = &qq[HYPRE_MEMORY_EVENT_ALLOC]; + hypre_MemoryTrackerQueue *qf = &qq[HYPRE_MEMORY_EVENT_FREE]; + + if (do_print) + { + HYPRE_Int myid; + hypre_MPI_Comm_rank(hypre_MPI_COMM_WORLD, &myid); + + if (fname) + { + hypre_sprintf(filename, "%s.%05d.csv", fname, myid); + } + else + { + hypre_sprintf(filename, "HypreMemoryTrack.log.%05d.csv", myid); + } + + if ((file = fopen(filename, "w")) == NULL) + { + fprintf(stderr, "Error: can't open output file %s\n", filename); + return hypre_error_flag; + } + + fprintf(file, "\"==== Operations:\"\n"); + fprintf(file, " %6s, %9s, %16s, %16s, %10s, %10s, %10s, %28s, %8s, %54s, %11s, %11s, %11s, %11s\n", + "ID", "EVENT", "ADDRESS1", "ADDRESS2", "BYTE", "LOCATION1", "LOCATION2", + "FILE", "LINE", "FUNCTION", "HOST", "PINNED", "DEVICE", "UNIFIED"); + } + + if (leakcheck) + { + //HYPRE_Real t0 = hypre_MPI_Wtime(); + hypre_MemoryTrackerSortQueue(qf); + //HYPRE_Real t1 = hypre_MPI_Wtime() - t0; + //printf("Sort Time %.2f\n", t1); + } + + size_t total_num_events = 0; + size_t total_num_events_2 = 0; + for (i = HYPRE_MEMORY_EVENT_ALLOC; i < HYPRE_MEMORY_NUM_EVENTS; i++) + { + total_num_events_2 += qq[i].actual_size; + } + + for (i = hypre_MemoryTrackerGetNext(tracker); i < HYPRE_MEMORY_NUM_EVENTS; + i = hypre_MemoryTrackerGetNext(tracker)) + { + total_num_events ++; + + hypre_MemoryTrackerEntry *entry = &qq[i].data[qq[i].head++]; + + if (strstr(entry->action, "alloc") != NULL) + { + totl_bytes[entry->memory_location] += entry->nbytes; + + if (leakcheck) + { + curr_bytes[entry->memory_location] += entry->nbytes; + peak_bytes[entry->memory_location] = hypre_max( curr_bytes[entry->memory_location], + peak_bytes[entry->memory_location] ); + } + + if (leakcheck && entry->pair == (size_t) -1) + { + hypre_MemoryTrackerEntry key = { .ptr = entry->ptr }; + hypre_MemoryTrackerEntry *key_ptr = &key; + + hypre_MemoryTrackerEntry **result = bsearch(&key_ptr, + qf->sorted_data_compressed, + qf->sorted_data_compressed_len, + sizeof(hypre_MemoryTrackerEntry *), + hypre_MemoryTrackerQueueCompSearch); + if (result) + { + j = result - qf->sorted_data_compressed; + hypre_MemoryTrackerEntry *p = qf->sorted_data + qf->sorted_data_compressed_offset[j]; + + if (p < qf->sorted_data_compressed[j + 1]) + { + hypre_assert(p->ptr == entry->ptr); + entry->pair = p->index; + hypre_assert(qf->data[p->index].pair == -1); + hypre_assert(qq[i].head - 1 == entry->index); + qf->data[p->index].pair = entry->index; + qf->data[p->index].nbytes = entry->nbytes; + + qf->sorted_data_compressed_offset[j] ++; + } + } + } + } + else if (leakcheck && strstr(entry->action, "free") != NULL) + { + if (entry->pair < qa->actual_size) + { + curr_bytes[entry->memory_location] -= qa->data[entry->pair].nbytes; + } + } + else if (strstr(entry->action, "memcpy") != NULL) + { + copy_bytes[hypre_GetMemcpyType(entry->memory_location, entry->memory_location2)] += entry->nbytes; + } + + if (do_print) + { + char memory_location[256]; + char memory_location2[256]; + char nbytes[32]; + + hypre_GetMemoryLocationName(entry->memory_location, memory_location); + hypre_GetMemoryLocationName(entry->memory_location2, memory_location2); + + if (entry->nbytes != (size_t) -1) + { + sprintf(nbytes, "%zu", entry->nbytes); + } + else + { + sprintf(nbytes, "%s", "--"); + } + + fprintf(file, + " %6zu, %9s, %16p, %16p, %10s, %10s, %10s, %28s, %8d, %54s, %11zu, %11zu, %11zu, %11zu\n", + entry->time_step, + entry->action, + entry->ptr, + entry->ptr2, + nbytes, + memory_location, + memory_location2, + hypre_basename(entry->filename), + entry->line, + entry->function, + curr_bytes[hypre_MEMORY_HOST], + curr_bytes[hypre_MEMORY_HOST_PINNED], + curr_bytes[hypre_MEMORY_DEVICE], + curr_bytes[hypre_MEMORY_UNIFIED] + ); + } + } + + hypre_assert(total_num_events == total_num_events_2); + + if (do_print) + { + fprintf(file, "\n\"==== Total Allocation (byte):\"\n"); + fprintf(file, " %6s, %9s, %16s, %16s, %10s, %10s, %10s, %28s, %8s, %54s, %11s, %11s, %11s, %11s\n", + "", "", "", "", "", "", "", "", "", "", "HOST", "PINNED", "DEVICE", "UNIFIED"); + fprintf(file, + " %6s, %9s, %16s, %16s, %10s, %10s, %10s, %28s, %8s, %54s, %11zu, %11zu, %11zu, %11zu\n", + "", "", "", "", "", "", "", "", "", "", + totl_bytes[hypre_MEMORY_HOST], + totl_bytes[hypre_MEMORY_HOST_PINNED], + totl_bytes[hypre_MEMORY_DEVICE], + totl_bytes[hypre_MEMORY_UNIFIED]); + + fprintf(file, "\n\"==== Peak Allocation (byte):\"\n"); + /*fprintf(file, " %6s, %9s, %16s, %16s, %10s, %10s, %10s, %28s, %8s, %54s, %11s, %11s, %11s, %11s\n", + "", "", "", "", "", "", "", "", "", "", "HOST", "PINNED", "DEVICE", "UNIFIED"); */ + fprintf(file, + " %6s, %9s, %16s, %16s, %10s, %10s, %10s, %28s, %8s, %54s, %11zu, %11zu, %11zu, %11zu\n", + "", "", "", "", "", "", "", "", "", "", + peak_bytes[hypre_MEMORY_HOST], + peak_bytes[hypre_MEMORY_HOST_PINNED], + peak_bytes[hypre_MEMORY_DEVICE], + peak_bytes[hypre_MEMORY_UNIFIED]); + + fprintf(file, "\n\"==== Reachable Allocation (byte):\"\n"); + /* fprintf(file, " %6s, %9s, %16s, %16s, %10s, %10s, %10s, %28s, %8s, %54s, %11s, %11s, %11s, %11s\n", + "", "", "", "", "", "", "", "", "", "", "HOST", "PINNED", "DEVICE", "UNIFIED"); */ + fprintf(file, + " %6s, %9s, %16s, %16s, %10s, %10s, %10s, %28s, %8s, %54s, %11zu, %11zu, %11zu, %11zu\n", + "", "", "", "", "", "", "", "", "", "", + curr_bytes[hypre_MEMORY_HOST], + curr_bytes[hypre_MEMORY_HOST_PINNED], + curr_bytes[hypre_MEMORY_DEVICE], + curr_bytes[hypre_MEMORY_UNIFIED]); + + fprintf(file, "\n\"==== Memory Copy (byte):\"\n"); + fprintf(file, " %6s, %9s, %16s, %16s, %10s, %10s, %10s, %28s, %8s, %54s, %11s, %11s, %11s, %11s\n", + "", "", "", "", "", "", "", "", "", "", "H2H", "D2H", "H2D", "D2D"); + fprintf(file, + " %6s, %9s, %16s, %16s, %10s, %10s, %10s, %28s, %8s, %54s, %11zu, %11zu, %11zu, %11zu\n", + "", "", "", "", "", "", "", "", "", "", + copy_bytes[hypre_MEMCPY_H2H], + copy_bytes[hypre_MEMCPY_D2H], + copy_bytes[hypre_MEMCPY_H2D], + copy_bytes[hypre_MEMCPY_D2D]); + + } + + if (totl_bytes_o) + { + totl_bytes_o[hypre_MEMORY_HOST] = totl_bytes[hypre_MEMORY_HOST]; + totl_bytes_o[hypre_MEMORY_HOST_PINNED] = totl_bytes[hypre_MEMORY_HOST_PINNED]; + totl_bytes_o[hypre_MEMORY_DEVICE] = totl_bytes[hypre_MEMORY_DEVICE]; + totl_bytes_o[hypre_MEMORY_UNIFIED] = totl_bytes[hypre_MEMORY_UNIFIED]; + } + + if (peak_bytes_o) + { + peak_bytes_o[hypre_MEMORY_HOST] = peak_bytes[hypre_MEMORY_HOST]; + peak_bytes_o[hypre_MEMORY_HOST_PINNED] = peak_bytes[hypre_MEMORY_HOST_PINNED]; + peak_bytes_o[hypre_MEMORY_DEVICE] = peak_bytes[hypre_MEMORY_DEVICE]; + peak_bytes_o[hypre_MEMORY_UNIFIED] = peak_bytes[hypre_MEMORY_UNIFIED]; + } + + if (curr_bytes_o) + { + curr_bytes_o[hypre_MEMORY_HOST] = curr_bytes[hypre_MEMORY_HOST]; + curr_bytes_o[hypre_MEMORY_HOST_PINNED] = curr_bytes[hypre_MEMORY_HOST_PINNED]; + curr_bytes_o[hypre_MEMORY_DEVICE] = curr_bytes[hypre_MEMORY_DEVICE]; + curr_bytes_o[hypre_MEMORY_UNIFIED] = curr_bytes[hypre_MEMORY_UNIFIED]; + } + +#if defined(HYPRE_DEBUG) + for (i = HYPRE_MEMORY_EVENT_ALLOC; i < HYPRE_MEMORY_NUM_EVENTS; i++) + { + hypre_assert(qq[i].head == qq[i].actual_size); + } +#endif + + if (leakcheck && do_print) + { + fprintf(file, "\n\"==== Warnings:\"\n"); + + for (j = 0; j < qa->actual_size; j++) + { + hypre_MemoryTrackerEntry *entry = &qa->data[j]; + if (entry->pair == (size_t) -1) + { + fprintf(file, " %6zu, %9s, %16p, %16s, %10s, %10s, %10s, %28s, %8s, %54s, %11s, %11s, %11s, %11s\n", + entry->time_step, entry->action, entry->ptr, "", "", "", "", "", "", "Not freed", "", "", "", ""); + } + else + { + hypre_assert(entry->pair < qf->actual_size); + hypre_assert(qf->data[entry->pair].ptr == entry->ptr); + hypre_assert(qf->data[entry->pair].nbytes == entry->nbytes); + hypre_assert(qf->data[entry->pair].memory_location == entry->memory_location); + hypre_assert(qf->data[entry->pair].pair == j); + } + } + + for (j = 0; j < qf->actual_size; j++) + { + hypre_MemoryTrackerEntry *entry = &qf->data[j]; + if (entry->pair == (size_t) -1) + { + fprintf(file, " %6zu, %9s, %16p, %16s, %10s, %10s, %10s, %28s, %8s, %54s, %11s, %11s, %11s, %11s\n", + entry->time_step, entry->action, entry->ptr, "", "", "", "", "", "", "Unpaired free", "", "", "", + ""); + } + else + { + hypre_assert(entry->pair < qa->actual_size); + hypre_assert(qa->data[entry->pair].ptr == entry->ptr); + hypre_assert(qa->data[entry->pair].nbytes == entry->nbytes); + hypre_assert(qa->data[entry->pair].memory_location == entry->memory_location); + hypre_assert(qa->data[entry->pair].pair == j); + } + } + } + + if (file) + { + fclose(file); + } + + if (leakcheck) + { + hypre_MemoryLocation t; + + for (t = hypre_MEMORY_HOST; t <= hypre_MEMORY_UNIFIED; t++) + { + if (curr_bytes[t]) + { + char memory_location[256]; + hypre_GetMemoryLocationName(t, memory_location); + fprintf(stderr, "%zu bytes of %s memory may not be freed\n", curr_bytes[t], memory_location); + } + + } + + /* + for (t = hypre_MEMORY_HOST; t <= hypre_MEMORY_UNIFIED; t++) + { + hypre_assert(curr_bytes[t] == 0); + } + */ + } + + //HYPRE_Real t1 = hypre_MPI_Wtime() - t0; + //printf("Tracker Print Time %.2f\n", t1); + + return hypre_error_flag; +} + +#endif diff --git a/external/hypre/src/utilities/memory_tracker.h b/external/hypre/src/utilities/memory_tracker.h new file mode 100644 index 00000000..72eb0146 --- /dev/null +++ b/external/hypre/src/utilities/memory_tracker.h @@ -0,0 +1,176 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#ifndef hypre_MEMORY_TRACKER_HEADER +#define hypre_MEMORY_TRACKER_HEADER + +#if defined(HYPRE_USING_MEMORY_TRACKER) + +extern size_t hypre_total_bytes[hypre_MEMORY_UNIFIED + 1]; +extern size_t hypre_peak_bytes[hypre_MEMORY_UNIFIED + 1]; +extern size_t hypre_current_bytes[hypre_MEMORY_UNIFIED + 1]; +extern HYPRE_Int hypre_memory_tracker_print; +extern char hypre_memory_tracker_filename[HYPRE_MAX_FILE_NAME_LEN]; + +typedef enum _hypre_MemoryTrackerEvent +{ + HYPRE_MEMORY_EVENT_ALLOC = 0, + HYPRE_MEMORY_EVENT_FREE, + HYPRE_MEMORY_EVENT_COPY, + HYPRE_MEMORY_NUM_EVENTS, +} hypre_MemoryTrackerEvent; + +typedef enum _hypre_MemcpyType +{ + hypre_MEMCPY_H2H = 0, + hypre_MEMCPY_D2H, + hypre_MEMCPY_H2D, + hypre_MEMCPY_D2D, + hypre_MEMCPY_NUM_TYPES, +} hypre_MemcpyType; + +typedef struct +{ + size_t index; + size_t time_step; + char action[16]; + void *ptr; + void *ptr2; + size_t nbytes; + hypre_MemoryLocation memory_location; + hypre_MemoryLocation memory_location2; + char filename[HYPRE_MAX_FILE_NAME_LEN]; + char function[256]; + HYPRE_Int line; + size_t pair; +} hypre_MemoryTrackerEntry; + +typedef struct +{ + size_t head; + size_t actual_size; + size_t alloced_size; + hypre_MemoryTrackerEntry *data; + /* Free Queue is sorted based on (ptr, time_step) ascendingly */ + hypre_MemoryTrackerEntry *sorted_data; + /* compressed sorted_data with the same ptr */ + size_t sorted_data_compressed_len; + size_t *sorted_data_compressed_offset; + hypre_MemoryTrackerEntry **sorted_data_compressed; +} hypre_MemoryTrackerQueue; + +typedef struct +{ + size_t curr_time_step; + hypre_MemoryTrackerQueue queue[HYPRE_MEMORY_NUM_EVENTS]; +} hypre_MemoryTracker; + +extern hypre_MemoryTracker *_hypre_memory_tracker; + +#define hypre_TAlloc(type, count, location) \ +( \ +{ \ + void *ptr = hypre_MAlloc((size_t)(sizeof(type) * (count)), location); \ + \ + hypre_MemoryLocation alocation = hypre_GetActualMemLocation(location); \ + hypre_MemoryTrackerInsert1("malloc", ptr, sizeof(type)*(count), alocation, \ + __FILE__, __func__, __LINE__); \ + (type *) ptr; \ +} \ +) + +#define hypre_CTAlloc(type, count, location) \ +( \ +{ \ + void *ptr = hypre_CAlloc((size_t)(count), (size_t)sizeof(type), location); \ + \ + hypre_MemoryLocation alocation = hypre_GetActualMemLocation(location); \ + hypre_MemoryTrackerInsert1("calloc", ptr, sizeof(type)*(count), alocation, \ + __FILE__, __func__, __LINE__); \ + (type *) ptr; \ +} \ +) + +#define hypre_TReAlloc(ptr, type, count, location) \ +( \ +{ \ + void *new_ptr = hypre_ReAlloc((char *)ptr, (size_t)(sizeof(type) * (count)), location); \ + \ + hypre_MemoryLocation alocation = hypre_GetActualMemLocation(location); \ + hypre_MemoryTrackerInsert1("rfree", ptr, (size_t) -1, alocation, \ + __FILE__, __func__, __LINE__); \ + hypre_MemoryTrackerInsert1("rmalloc", new_ptr, sizeof(type)*(count), alocation, \ + __FILE__, __func__, __LINE__); \ + (type *) new_ptr; \ +} \ +) + +#define hypre_TReAlloc_v2(ptr, old_type, old_count, new_type, new_count, location) \ +( \ +{ \ + void *new_ptr = hypre_ReAlloc_v2((char *)ptr, (size_t)(sizeof(old_type)*(old_count)), \ + (size_t)(sizeof(new_type)*(new_count)), location); \ + \ + hypre_MemoryLocation alocation = hypre_GetActualMemLocation(location); \ + hypre_MemoryTrackerInsert1("rfree", ptr, sizeof(old_type)*(old_count), alocation, \ + __FILE__, __func__, __LINE__); \ + hypre_MemoryTrackerInsert1("rmalloc", new_ptr, sizeof(new_type)*(new_count), alocation, \ + __FILE__, __func__, __LINE__); \ + (new_type *) new_ptr; \ +} \ +) + +#define hypre_TMemcpy(dst, src, type, count, locdst, locsrc) \ +( \ +{ \ + hypre_Memcpy((void *)(dst), (void *)(src), (size_t)(sizeof(type) * (count)), locdst, locsrc); \ + \ + hypre_MemoryLocation alocation_dst = hypre_GetActualMemLocation(locdst); \ + hypre_MemoryLocation alocation_src = hypre_GetActualMemLocation(locsrc); \ + hypre_MemoryTrackerInsert2("memcpy", (void *) (dst), (void *) (src), sizeof(type)*(count), \ + alocation_dst, alocation_src, \ + __FILE__, __func__, __LINE__); \ +} \ +) + +#define hypre_TFree(ptr, location) \ +( \ +{ \ + hypre_Free((void *)ptr, location); \ + \ + hypre_MemoryLocation alocation = hypre_GetActualMemLocation(location); \ + hypre_MemoryTrackerInsert1("free", ptr, (size_t) -1, alocation, \ + __FILE__, __func__, __LINE__); \ + ptr = NULL; \ +} \ +) + +#define _hypre_TAlloc(type, count, location) \ +( \ +{ \ + void *ptr = _hypre_MAlloc((size_t)(sizeof(type) * (count)), location); \ + \ + hypre_MemoryTrackerInsert1("malloc", ptr, sizeof(type)*(count), location, \ + __FILE__, __func__, __LINE__); \ + (type *) ptr; \ +} \ +) + +#define _hypre_TFree(ptr, location) \ +( \ +{ \ + _hypre_Free((void *)ptr, location); \ + \ + hypre_MemoryTrackerInsert1("free", ptr, (size_t) -1, location, \ + __FILE__, __func__, __LINE__); \ + ptr = NULL; \ +} \ +) + +#endif /* #if defined(HYPRE_USING_MEMORY_TRACKER) */ +#endif /* #ifndef hypre_MEMORY_TRACKER_HEADER */ + diff --git a/external/hypre/src/utilities/merge_sort.c b/external/hypre/src/utilities/merge_sort.c index 05ceb384..0f033abf 100644 --- a/external/hypre/src/utilities/merge_sort.c +++ b/external/hypre/src/utilities/merge_sort.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -16,50 +16,56 @@ #define SWAP(T, a, b) do { T tmp = a; a = b; b = tmp; } while (0) /*-------------------------------------------------------------------------- - * hypre_MergeOrderedArrays: merge two ordered arrays + * hypre_IntArrayMergeOrdered: merge two ordered arrays *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_MergeOrderedArrays( HYPRE_Int size1, HYPRE_Int *array1, - HYPRE_Int size2, HYPRE_Int *array2, - HYPRE_Int *size3_ptr, HYPRE_Int **array3_ptr ) +hypre_IntArrayMergeOrdered( hypre_IntArray *array1, + hypre_IntArray *array2, + hypre_IntArray *array3 ) { - HYPRE_Int *array3; - HYPRE_Int i, j, k; + HYPRE_Int i = 0, j = 0, k = 0; + const HYPRE_Int size1 = hypre_IntArraySize(array1); + const HYPRE_Int size2 = hypre_IntArraySize(array2); + + HYPRE_MemoryLocation memory_location = hypre_IntArrayMemoryLocation(array3); - array3 = hypre_CTAlloc(HYPRE_Int, (size1 + size2), HYPRE_MEMORY_HOST); + HYPRE_Int *array1_data = hypre_IntArrayData(array1); + HYPRE_Int *array2_data = hypre_IntArrayData(array2); + HYPRE_Int *array3_data = hypre_TAlloc(HYPRE_Int, size1 + size2, memory_location); - i = j = k = 0; while (i < size1 && j < size2) { - if (array1[i] > array2[j]) + if (array1_data[i] > array2_data[j]) { - array3[k++] = array2[j++]; + array3_data[k++] = array2_data[j++]; } - else if (array1[i] < array2[j]) + else if (array1_data[i] < array2_data[j]) { - array3[k++] = array1[i++]; + array3_data[k++] = array1_data[i++]; } else { - array3[k++] = array1[i++]; + array3_data[k++] = array1_data[i++]; j++; } } while (i < size1) { - array3[k++] = array1[i++]; + array3_data[k++] = array1_data[i++]; } while (j < size2) { - array3[k++] = array2[j++]; + array3_data[k++] = array2_data[j++]; } - /* Set pointers */ - *size3_ptr = k; - *array3_ptr = hypre_TReAlloc(array3, HYPRE_Int, k, HYPRE_MEMORY_HOST); + array3_data = hypre_TReAlloc_v2(array3_data, HYPRE_Int, size1 + size2, HYPRE_Int, k, + memory_location); + + hypre_IntArraySize(array3) = k; + hypre_IntArrayData(array3) = array3_data; return hypre_error_flag; } @@ -194,7 +200,7 @@ static void kth_element_( HYPRE_Int *out1, HYPRE_Int *out2, { while (1) { - HYPRE_Int i = (left + right)/2; // right < k -> i < k + HYPRE_Int i = (left + right) / 2; // right < k -> i < k HYPRE_Int j = k - i - 1; #ifdef DBG_MERGE_SORT hypre_assert(left <= right && right <= k); @@ -212,7 +218,7 @@ static void kth_element_( HYPRE_Int *out1, HYPRE_Int *out2, *out1 = i + 1; *out2 = j; return; } - else if (a1[i] > a2[j] && j != n2 - 1 && a1[i] > a2[j+1]) + else if (a1[i] > a2[j] && j != n2 - 1 && a1[i] > a2[j + 1]) { // search in left half of a1 right = i - 1; @@ -289,7 +295,7 @@ static void kth_element( HYPRE_Int *out1, HYPRE_Int *out2, SWAP(HYPRE_Int *, out1, out2); } - if (k < (n1 + n2)/2) + if (k < (n1 + n2) / 2) { kth_element_(out1, out2, a1, a2, 0, hypre_min(n1 - 1, k), n1, n2, k); } @@ -322,7 +328,7 @@ static void big_kth_element_( HYPRE_Int *out1, HYPRE_Int *out2, { while (1) { - HYPRE_Int i = (left + right)/2; // right < k -> i < k + HYPRE_Int i = (left + right) / 2; // right < k -> i < k HYPRE_Int j = k - i - 1; #ifdef DBG_MERGE_SORT hypre_assert(left <= right && right <= k); @@ -340,7 +346,7 @@ static void big_kth_element_( HYPRE_Int *out1, HYPRE_Int *out2, *out1 = i + 1; *out2 = j; return; } - else if (a1[i] > a2[j] && j != n2 - 1 && a1[i] > a2[j+1]) + else if (a1[i] > a2[j] && j != n2 - 1 && a1[i] > a2[j + 1]) { // search in left half of a1 right = i - 1; @@ -412,7 +418,7 @@ static void big_kth_element( HYPRE_Int *out1, HYPRE_Int *out2, SWAP(HYPRE_Int *, out1, out2); } - if (k < (n1 + n2)/2) + if (k < (n1 + n2) / 2) { big_kth_element_(out1, out2, a1, a2, 0, hypre_min(n1 - 1, k), n1, n2, k); } @@ -424,7 +430,8 @@ static void big_kth_element( HYPRE_Int *out1, HYPRE_Int *out2, HYPRE_Int new_n1 = hypre_min(n1 - offset1, new_k + 1); HYPRE_Int new_n2 = hypre_min(n2 - offset2, new_k + 1); - big_kth_element_(out1, out2, a1 + (HYPRE_BigInt)offset1, a2 + (HYPRE_BigInt)offset2, 0, new_n1 - 1, new_n1, new_n2, new_k); + big_kth_element_(out1, out2, a1 + (HYPRE_BigInt)offset1, a2 + (HYPRE_BigInt)offset2, 0, new_n1 - 1, + new_n1, new_n2, new_k); *out1 += offset1; *out2 += offset2; @@ -450,8 +457,8 @@ static void hypre_parallel_merge( HYPRE_Int *first1, HYPRE_Int *last1, HYPRE_Int n1 = last1 - first1; HYPRE_Int n2 = last2 - first2; HYPRE_Int n = n1 + n2; - HYPRE_Int n_per_thread = (n + num_threads - 1)/num_threads; - HYPRE_Int begin_rank = hypre_min(n_per_thread*my_thread_num, n); + HYPRE_Int n_per_thread = (n + num_threads - 1) / num_threads; + HYPRE_Int begin_rank = hypre_min(n_per_thread * my_thread_num, n); HYPRE_Int end_rank = hypre_min(begin_rank + n_per_thread, n); #ifdef DBG_MERGE_SORT @@ -509,8 +516,8 @@ static void hypre_big_parallel_merge( HYPRE_Int n1 = (HYPRE_Int)(last1 - first1); HYPRE_Int n2 = (HYPRE_Int)(last2 - first2); HYPRE_Int n = n1 + n2; - HYPRE_Int n_per_thread = (n + num_threads - 1)/num_threads; - HYPRE_Int begin_rank = hypre_min(n_per_thread*my_thread_num, n); + HYPRE_Int n_per_thread = (n + num_threads - 1) / num_threads; + HYPRE_Int begin_rank = hypre_min(n_per_thread * my_thread_num, n); HYPRE_Int end_rank = hypre_min(begin_rank + n_per_thread, n); #ifdef DBG_MERGE_SORT @@ -558,7 +565,7 @@ static void hypre_big_parallel_merge( void hypre_merge_sort( HYPRE_Int *in, HYPRE_Int *temp, HYPRE_Int len, HYPRE_Int **out ) { - if (0 == len) return; + if (0 == len) { return; } #ifdef HYPRE_PROFILE hypre_profile_times[HYPRE_TIMER_ID_MERGE] -= hypre_MPI_Wtime(); @@ -574,15 +581,15 @@ void hypre_merge_sort( HYPRE_Int *in, HYPRE_Int *temp, HYPRE_Int len, HYPRE_Int // HYPRE_Int out_len = 0; #ifdef HYPRE_USING_OPENMP -#pragma omp parallel + #pragma omp parallel #endif { HYPRE_Int num_threads = hypre_NumActiveThreads(); HYPRE_Int my_thread_num = hypre_GetThreadNum(); // thread-private sort - HYPRE_Int i_per_thread = (len + num_threads - 1)/num_threads; - HYPRE_Int i_begin = hypre_min(i_per_thread*my_thread_num, len); + HYPRE_Int i_per_thread = (len + num_threads - 1) / num_threads; + HYPRE_Int i_begin = hypre_min(i_per_thread * my_thread_num, len); HYPRE_Int i_end = hypre_min(i_begin + i_per_thread, len); hypre_qsort0(in, i_begin, i_end - 1); @@ -594,22 +601,22 @@ void hypre_merge_sort( HYPRE_Int *in, HYPRE_Int *temp, HYPRE_Int len, HYPRE_Int for (in_group_size = 1; in_group_size < num_threads; in_group_size *= 2) { #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif // merge 2 in-groups into 1 out-group - HYPRE_Int out_group_size = in_group_size*2; - HYPRE_Int group_leader = my_thread_num/out_group_size*out_group_size; + HYPRE_Int out_group_size = in_group_size * 2; + HYPRE_Int group_leader = my_thread_num / out_group_size * out_group_size; // HYPRE_Int group_sub_leader = hypre_min(group_leader + in_group_size, num_threads - 1); - HYPRE_Int id_in_group = my_thread_num%out_group_size; + HYPRE_Int id_in_group = my_thread_num % out_group_size; HYPRE_Int num_threads_in_group = hypre_min(group_leader + out_group_size, num_threads) - group_leader; - HYPRE_Int in_group1_begin = hypre_min(i_per_thread*group_leader, len); - HYPRE_Int in_group1_end = hypre_min(in_group1_begin + i_per_thread*in_group_size, len); + HYPRE_Int in_group1_begin = hypre_min(i_per_thread * group_leader, len); + HYPRE_Int in_group1_end = hypre_min(in_group1_begin + i_per_thread * in_group_size, len); - HYPRE_Int in_group2_begin = hypre_min(in_group1_begin + i_per_thread*in_group_size, len); - HYPRE_Int in_group2_end = hypre_min(in_group2_begin + i_per_thread*in_group_size, len); + HYPRE_Int in_group2_begin = hypre_min(in_group1_begin + i_per_thread * in_group_size, len); + HYPRE_Int in_group2_end = hypre_min(in_group2_begin + i_per_thread * in_group_size, len); hypre_parallel_merge( in_buf + in_group1_begin, in_buf + in_group1_end, @@ -637,6 +644,8 @@ void hypre_merge_sort( HYPRE_Int *in, HYPRE_Int *temp, HYPRE_Int len, HYPRE_Int #endif } +#if defined(HYPRE_USING_HOPSCOTCH) + /*-------------------------------------------------------------------------- * hypre_sort_and_create_inverse_map * @@ -646,8 +655,11 @@ void hypre_merge_sort( HYPRE_Int *in, HYPRE_Int *temp, HYPRE_Int len, HYPRE_Int * inverse_map[i] = j iff (*out)[j] = i *--------------------------------------------------------------------------*/ -void hypre_sort_and_create_inverse_map(HYPRE_Int *in, HYPRE_Int len, HYPRE_Int **out, - hypre_UnorderedIntMap *inverse_map) +void +hypre_sort_and_create_inverse_map(HYPRE_Int *in, + HYPRE_Int len, + HYPRE_Int **out, + hypre_UnorderedIntMap *inverse_map) { if (len == 0) { @@ -660,10 +672,10 @@ void hypre_sort_and_create_inverse_map(HYPRE_Int *in, HYPRE_Int len, HYPRE_Int * HYPRE_Int *temp = hypre_TAlloc(HYPRE_Int, len, HYPRE_MEMORY_HOST); hypre_merge_sort(in, temp, len, out); - hypre_UnorderedIntMapCreate(inverse_map, 2*len, 16*hypre_NumThreads()); + hypre_UnorderedIntMapCreate(inverse_map, 2 * len, 16 * hypre_NumThreads()); HYPRE_Int i; #ifdef HYPRE_CONCURRENT_HOPSCOTCH -#pragma omp parallel for HYPRE_SMP_SCHEDULE + #pragma omp parallel for HYPRE_SMP_SCHEDULE #endif for (i = 0; i < len; i++) { @@ -679,16 +691,17 @@ void hypre_sort_and_create_inverse_map(HYPRE_Int *in, HYPRE_Int len, HYPRE_Int * } #ifdef DBG_MERGE_SORT - std::unordered_map inverse_map2(len); - for (HYPRE_Int i = 0; i < len; ++i) { - inverse_map2[(*out)[i]] = i; - if (hypre_UnorderedIntMapGet(inverse_map, (*out)[i]) != i) - { - fprintf(stderr, "%d %d\n", i, (*out)[i]); - hypre_assert(false); - } - } - hypre_assert(hypre_UnorderedIntMapSize(inverse_map) == len); + std::unordered_map inverse_map2(len); + for (HYPRE_Int i = 0; i < len; ++i) + { + inverse_map2[(*out)[i]] = i; + if (hypre_UnorderedIntMapGet(inverse_map, (*out)[i]) != i) + { + fprintf(stderr, "%d %d\n", i, (*out)[i]); + hypre_assert(false); + } + } + hypre_assert(hypre_UnorderedIntMapSize(inverse_map) == len); #endif if (*out == in) @@ -705,6 +718,8 @@ void hypre_sort_and_create_inverse_map(HYPRE_Int *in, HYPRE_Int len, HYPRE_Int * #endif } +#endif /* if defined(HYPRE_USING_HOPSCOTCH) */ + /*-------------------------------------------------------------------------- * hypre_big_merge_sort *--------------------------------------------------------------------------*/ @@ -712,7 +727,7 @@ void hypre_sort_and_create_inverse_map(HYPRE_Int *in, HYPRE_Int len, HYPRE_Int * void hypre_big_merge_sort(HYPRE_BigInt *in, HYPRE_BigInt *temp, HYPRE_Int len, HYPRE_BigInt **out) { - if (0 == len) return; + if (0 == len) { return; } #ifdef HYPRE_PROFILE hypre_profile_times[HYPRE_TIMER_ID_MERGE] -= hypre_MPI_Wtime(); @@ -728,15 +743,15 @@ void hypre_big_merge_sort(HYPRE_BigInt *in, HYPRE_BigInt *temp, HYPRE_Int len, // HYPRE_Int out_len = 0; #ifdef HYPRE_USING_OPENMP -#pragma omp parallel + #pragma omp parallel #endif { HYPRE_Int num_threads = hypre_NumActiveThreads(); HYPRE_Int my_thread_num = hypre_GetThreadNum(); // thread-private sort - HYPRE_Int i_per_thread = (len + num_threads - 1)/num_threads; - HYPRE_Int i_begin = hypre_min(i_per_thread*my_thread_num, len); + HYPRE_Int i_per_thread = (len + num_threads - 1) / num_threads; + HYPRE_Int i_begin = hypre_min(i_per_thread * my_thread_num, len); HYPRE_Int i_end = hypre_min(i_begin + i_per_thread, len); hypre_BigQsort0(in, i_begin, i_end - 1); @@ -748,22 +763,22 @@ void hypre_big_merge_sort(HYPRE_BigInt *in, HYPRE_BigInt *temp, HYPRE_Int len, for (in_group_size = 1; in_group_size < num_threads; in_group_size *= 2) { #ifdef HYPRE_USING_OPENMP -#pragma omp barrier + #pragma omp barrier #endif // merge 2 in-groups into 1 out-group - HYPRE_Int out_group_size = in_group_size*2; - HYPRE_Int group_leader = my_thread_num/out_group_size*out_group_size; + HYPRE_Int out_group_size = in_group_size * 2; + HYPRE_Int group_leader = my_thread_num / out_group_size * out_group_size; // HYPRE_Int group_sub_leader = hypre_min(group_leader + in_group_size, num_threads - 1); - HYPRE_Int id_in_group = my_thread_num%out_group_size; + HYPRE_Int id_in_group = my_thread_num % out_group_size; HYPRE_Int num_threads_in_group = hypre_min(group_leader + out_group_size, num_threads) - group_leader; - HYPRE_Int in_group1_begin = hypre_min(i_per_thread*group_leader, len); - HYPRE_Int in_group1_end = hypre_min(in_group1_begin + i_per_thread*in_group_size, len); + HYPRE_Int in_group1_begin = hypre_min(i_per_thread * group_leader, len); + HYPRE_Int in_group1_end = hypre_min(in_group1_begin + i_per_thread * in_group_size, len); - HYPRE_Int in_group2_begin = hypre_min(in_group1_begin + i_per_thread*in_group_size, len); - HYPRE_Int in_group2_end = hypre_min(in_group2_begin + i_per_thread*in_group_size, len); + HYPRE_Int in_group2_begin = hypre_min(in_group1_begin + i_per_thread * in_group_size, len); + HYPRE_Int in_group2_end = hypre_min(in_group2_begin + i_per_thread * in_group_size, len); hypre_big_parallel_merge( in_buf + (HYPRE_BigInt)in_group1_begin, in_buf + (HYPRE_BigInt)in_group1_end, @@ -795,8 +810,11 @@ void hypre_big_merge_sort(HYPRE_BigInt *in, HYPRE_BigInt *temp, HYPRE_Int len, * hypre_big_sort_and_create_inverse_map *--------------------------------------------------------------------------*/ -void hypre_big_sort_and_create_inverse_map(HYPRE_BigInt *in, HYPRE_Int len, HYPRE_BigInt **out, - hypre_UnorderedBigIntMap *inverse_map) +void +hypre_big_sort_and_create_inverse_map(HYPRE_BigInt *in, + HYPRE_Int len, + HYPRE_BigInt **out, + hypre_UnorderedBigIntMap *inverse_map) { if (len == 0) { @@ -809,10 +827,10 @@ void hypre_big_sort_and_create_inverse_map(HYPRE_BigInt *in, HYPRE_Int len, HYPR HYPRE_BigInt *temp = hypre_TAlloc(HYPRE_BigInt, len, HYPRE_MEMORY_HOST); hypre_big_merge_sort(in, temp, len, out); - hypre_UnorderedBigIntMapCreate(inverse_map, 2*len, 16*hypre_NumThreads()); + hypre_UnorderedBigIntMapCreate(inverse_map, 2 * len, 16 * hypre_NumThreads()); HYPRE_Int i; #ifdef HYPRE_CONCURRENT_HOPSCOTCH -#pragma omp parallel for HYPRE_SMP_SCHEDULE + #pragma omp parallel for HYPRE_SMP_SCHEDULE #endif for (i = 0; i < len; i++) { @@ -828,16 +846,17 @@ void hypre_big_sort_and_create_inverse_map(HYPRE_BigInt *in, HYPRE_Int len, HYPR } #ifdef DBG_MERGE_SORT - std::unordered_map inverse_map2(len); - for (HYPRE_Int i = 0; i < len; ++i) { - inverse_map2[(*out)[i]] = i; - if (hypre_UnorderedBigIntMapGet(inverse_map, (*out)[i]) != i) - { - fprintf(stderr, "%d %d\n", i, (*out)[i]); - hypre_assert(false); - } - } - hypre_assert(hypre_UnorderedBigIntMapSize(inverse_map) == len); + std::unordered_map inverse_map2(len); + for (HYPRE_Int i = 0; i < len; ++i) + { + inverse_map2[(*out)[i]] = i; + if (hypre_UnorderedBigIntMapGet(inverse_map, (*out)[i]) != i) + { + fprintf(stderr, "%d %d\n", i, (*out)[i]); + hypre_assert(false); + } + } + hypre_assert(hypre_UnorderedBigIntMapSize(inverse_map) == len); #endif if (*out == in) @@ -853,5 +872,3 @@ void hypre_big_sort_and_create_inverse_map(HYPRE_BigInt *in, HYPRE_Int len, HYPR hypre_profile_times[HYPRE_TIMER_ID_MERGE] += hypre_MPI_Wtime(); #endif } - -/* vim: set tabstop=8 softtabstop=3 sw=3 expandtab: */ diff --git a/external/hypre/src/utilities/mmio.c b/external/hypre/src/utilities/mmio.c new file mode 100644 index 00000000..811b3338 --- /dev/null +++ b/external/hypre/src/utilities/mmio.c @@ -0,0 +1,175 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +/* +* Matrix Market I/O library for ANSI C +* +* See http://math.nist.gov/MatrixMarket for details. +* +* +*/ +#include +#include +#include +#include +#include "_hypre_utilities.h" + +HYPRE_Int hypre_mm_is_valid(MM_typecode matcode) +{ + if (!hypre_mm_is_matrix(matcode)) { return 0; } + if (hypre_mm_is_dense(matcode) && hypre_mm_is_pattern(matcode)) { return 0; } + if (hypre_mm_is_real(matcode) && hypre_mm_is_hermitian(matcode)) { return 0; } + if (hypre_mm_is_pattern(matcode) && (hypre_mm_is_hermitian(matcode) || hypre_mm_is_skew(matcode))) { return 0; } + return 1; +} + +HYPRE_Int hypre_mm_read_banner(FILE *f, MM_typecode *matcode) +{ + char line[MM_MAX_LINE_LENGTH]; + char banner[MM_MAX_TOKEN_LENGTH]; + char mtx[MM_MAX_TOKEN_LENGTH]; + char crd[MM_MAX_TOKEN_LENGTH]; + char data_type[MM_MAX_TOKEN_LENGTH]; + char storage_scheme[MM_MAX_TOKEN_LENGTH]; + char *p; + + hypre_mm_clear_typecode(matcode); + + if (fgets(line, MM_MAX_LINE_LENGTH, f) == NULL) + { + return MM_PREMATURE_EOF; + } + + if (sscanf(line, "%s %s %s %s %s", banner, mtx, crd, data_type, + storage_scheme) != 5) + { + return MM_PREMATURE_EOF; + } + + for (p = mtx; *p != '\0'; *p = tolower(*p), p++); /* convert to lower case */ + for (p = crd; *p != '\0'; *p = tolower(*p), p++); + for (p = data_type; *p != '\0'; *p = tolower(*p), p++); + for (p = storage_scheme; *p != '\0'; *p = tolower(*p), p++); + + /* check for banner */ + if (strncmp(banner, MatrixMarketBanner, strlen(MatrixMarketBanner)) != 0) + { + return MM_NO_HEADER; + } + + /* first field should be "mtx" */ + if (strcmp(mtx, MM_MTX_STR) != 0) + { + return MM_UNSUPPORTED_TYPE; + } + hypre_mm_set_matrix(matcode); + + + /* second field describes whether this is a sparse matrix (in coordinate + storgae) or a dense array */ + + + if (strcmp(crd, MM_SPARSE_STR) == 0) + { + hypre_mm_set_sparse(matcode); + } + else if (strcmp(crd, MM_DENSE_STR) == 0) + { + hypre_mm_set_dense(matcode); + } + else + { + return MM_UNSUPPORTED_TYPE; + } + + + /* third field */ + + if (strcmp(data_type, MM_REAL_STR) == 0) + { + hypre_mm_set_real(matcode); + } + else if (strcmp(data_type, MM_COMPLEX_STR) == 0) + { + hypre_mm_set_complex(matcode); + } + else if (strcmp(data_type, MM_PATTERN_STR) == 0) + { + hypre_mm_set_pattern(matcode); + } + else if (strcmp(data_type, MM_INT_STR) == 0) + { + hypre_mm_set_integer(matcode); + } + else + { + return MM_UNSUPPORTED_TYPE; + } + + + /* fourth field */ + + if (strcmp(storage_scheme, MM_GENERAL_STR) == 0) + { + hypre_mm_set_general(matcode); + } + else if (strcmp(storage_scheme, MM_SYMM_STR) == 0) + { + hypre_mm_set_symmetric(matcode); + } + else if (strcmp(storage_scheme, MM_HERM_STR) == 0) + { + hypre_mm_set_hermitian(matcode); + } + else if (strcmp(storage_scheme, MM_SKEW_STR) == 0) + { + hypre_mm_set_skew(matcode); + } + else + { + return MM_UNSUPPORTED_TYPE; + } + + return 0; +} + +HYPRE_Int hypre_mm_read_mtx_crd_size(FILE *f, HYPRE_Int *M, HYPRE_Int *N, HYPRE_Int *nz ) +{ + char line[MM_MAX_LINE_LENGTH]; + HYPRE_Int num_items_read; + + /* set return null parameter values, in case we exit with errors */ + *M = *N = *nz = 0; + + /* now continue scanning until you reach the end-of-comments */ + do + { + if (fgets(line, MM_MAX_LINE_LENGTH, f) == NULL) + { + return MM_PREMATURE_EOF; + } + } + while (line[0] == '%'); + + /* line[] is either blank or has M,N, nz */ + if (hypre_sscanf(line, "%d %d %d", M, N, nz) == 3) + { + return 0; + } + else + { + do + { + num_items_read = hypre_fscanf(f, "%d %d %d", M, N, nz); + if (num_items_read == EOF) { return MM_PREMATURE_EOF; } + } + while (num_items_read != 3); + } + + return 0; +} + diff --git a/external/hypre/src/utilities/mmio.h b/external/hypre/src/utilities/mmio.h new file mode 100644 index 00000000..2bb67a8a --- /dev/null +++ b/external/hypre/src/utilities/mmio.h @@ -0,0 +1,120 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +/* +* Matrix Market I/O library for ANSI C +* +* See http://math.nist.gov/MatrixMarket for details. +* +* +*/ + +#ifndef MM_IO_H +#define MM_IO_H + +#define MM_MAX_LINE_LENGTH 1025 +#define MatrixMarketBanner "%%MatrixMarket" +#define MM_MAX_TOKEN_LENGTH 64 + +typedef char MM_typecode[4]; + +HYPRE_Int hypre_mm_is_valid(MM_typecode matcode); /* too complex for a macro */ +HYPRE_Int hypre_mm_read_banner(FILE *f, MM_typecode *matcode); +HYPRE_Int hypre_mm_read_mtx_crd_size(FILE *f, HYPRE_Int *M, HYPRE_Int *N, HYPRE_Int *nz); + +/********************* MM_typecode query fucntions ***************************/ + +#define hypre_mm_is_matrix(typecode) ((typecode)[0]=='M') + +#define hypre_mm_is_sparse(typecode) ((typecode)[1]=='C') +#define hypre_mm_is_coordinate(typecode)((typecode)[1]=='C') +#define hypre_mm_is_dense(typecode) ((typecode)[1]=='A') +#define hypre_mm_is_array(typecode) ((typecode)[1]=='A') + +#define hypre_mm_is_complex(typecode) ((typecode)[2]=='C') +#define hypre_mm_is_real(typecode) ((typecode)[2]=='R') +#define hypre_mm_is_pattern(typecode) ((typecode)[2]=='P') +#define hypre_mm_is_integer(typecode) ((typecode)[2]=='I') + +#define hypre_mm_is_symmetric(typecode)((typecode)[3]=='S') +#define hypre_mm_is_general(typecode) ((typecode)[3]=='G') +#define hypre_mm_is_skew(typecode) ((typecode)[3]=='K') +#define hypre_mm_is_hermitian(typecode)((typecode)[3]=='H') + + + +/********************* MM_typecode modify fucntions ***************************/ + +#define hypre_mm_set_matrix(typecode) ((*typecode)[0]='M') +#define hypre_mm_set_coordinate(typecode) ((*typecode)[1]='C') +#define hypre_mm_set_array(typecode) ((*typecode)[1]='A') +#define hypre_mm_set_dense(typecode) hypre_mm_set_array(typecode) +#define hypre_mm_set_sparse(typecode) hypre_mm_set_coordinate(typecode) + +#define hypre_mm_set_complex(typecode)((*typecode)[2]='C') +#define hypre_mm_set_real(typecode) ((*typecode)[2]='R') +#define hypre_mm_set_pattern(typecode)((*typecode)[2]='P') +#define hypre_mm_set_integer(typecode)((*typecode)[2]='I') + + +#define hypre_mm_set_symmetric(typecode)((*typecode)[3]='S') +#define hypre_mm_set_general(typecode) ((*typecode)[3]='G') +#define hypre_mm_set_skew(typecode) ((*typecode)[3]='K') +#define hypre_mm_set_hermitian(typecode)((*typecode)[3]='H') + +#define hypre_mm_clear_typecode(typecode) ((*typecode)[0]=(*typecode)[1]= \ + (*typecode)[2]=' ',(*typecode)[3]='G') + +#define hypre_mm_initialize_typecode(typecode) hypre_mm_clear_typecode(typecode) + + +/********************* Matrix Market error codes ***************************/ + + +#define MM_COULD_NOT_READ_FILE 11 +#define MM_PREMATURE_EOF 12 +#define MM_NOT_MTX 13 +#define MM_NO_HEADER 14 +#define MM_UNSUPPORTED_TYPE 15 +#define MM_LINE_TOO_LONG 16 +#define MM_COULD_NOT_WRITE_FILE 17 + + +/******************** Matrix Market internal definitions ******************** + + MM_matrix_typecode: 4-character sequence + + object sparse/data storage + dense type scheme + + string position: [0] [1] [2] [3] + + Matrix typecode: M(atrix) C(oord) R(eal) G(eneral) + A(array) C(omplex) H(ermitian) + P(attern) S(ymmetric) + I(nteger) K(kew) + + ***********************************************************************/ + +#define MM_MTX_STR "matrix" +#define MM_ARRAY_STR "array" +#define MM_DENSE_STR "array" +#define MM_COORDINATE_STR "coordinate" +#define MM_SPARSE_STR "coordinate" +#define MM_COMPLEX_STR "complex" +#define MM_REAL_STR "real" +#define MM_INT_STR "integer" +#define MM_GENERAL_STR "general" +#define MM_SYMM_STR "symmetric" +#define MM_HERM_STR "hermitian" +#define MM_SKEW_STR "skew-symmetric" +#define MM_PATTERN_STR "pattern" + + +/* high level routines */ + +#endif diff --git a/external/hypre/src/utilities/mpi_comm_f2c.c b/external/hypre/src/utilities/mpi_comm_f2c.c index 96fcbc17..81534db4 100644 --- a/external/hypre/src/utilities/mpi_comm_f2c.c +++ b/external/hypre/src/utilities/mpi_comm_f2c.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -17,11 +17,11 @@ #if 0 /* This function is problematic and no longer needed anyway. */ void hypre_F90_IFACE(hypre_mpi_comm_f2c, HYPRE_MPI_COMM_F2C) - (hypre_F90_Obj *c_comm, - hypre_F90_Comm *f_comm, - hypre_F90_Int *ierr) +(hypre_F90_Obj *c_comm, + hypre_F90_Comm *f_comm, + hypre_F90_Int *ierr) { - *c_comm = (hypre_F90_Obj) hypre_MPI_Comm_f2c( (hypre_int) *f_comm ); + *c_comm = (hypre_F90_Obj) hypre_MPI_Comm_f2c( (hypre_int) * f_comm ); *ierr = 0; } #endif diff --git a/external/hypre/src/utilities/mpistubs.c b/external/hypre/src/utilities/mpistubs.c index 7e5db5d7..a33455c1 100644 --- a/external/hypre/src/utilities/mpistubs.c +++ b/external/hypre/src/utilities/mpistubs.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -28,44 +28,51 @@ hypre_MPI_Comm_f2c( hypre_int comm ) * MPI stubs to generate serial codes without mpi *****************************************************************************/ -#ifdef HYPRE_SEQUENTIAL +#if defined(HYPRE_SEQUENTIAL) HYPRE_Int hypre_MPI_Init( hypre_int *argc, char ***argv ) { - return(0); + HYPRE_UNUSED_VAR(argc); + HYPRE_UNUSED_VAR(argv); + + return (0); } HYPRE_Int -hypre_MPI_Finalize( ) +hypre_MPI_Finalize( void ) { - return(0); + return (0); } HYPRE_Int hypre_MPI_Abort( hypre_MPI_Comm comm, HYPRE_Int errorcode ) { - return(0); + HYPRE_UNUSED_VAR(comm); + HYPRE_UNUSED_VAR(errorcode); + + return (0); } HYPRE_Real -hypre_MPI_Wtime( ) +hypre_MPI_Wtime( void ) { - return(0.0); + return (0.0); } HYPRE_Real -hypre_MPI_Wtick( ) +hypre_MPI_Wtick( void ) { - return(0.0); + return (0.0); } HYPRE_Int hypre_MPI_Barrier( hypre_MPI_Comm comm ) { - return(0); + HYPRE_UNUSED_VAR(comm); + return (0); } HYPRE_Int @@ -73,35 +80,42 @@ hypre_MPI_Comm_create( hypre_MPI_Comm comm, hypre_MPI_Group group, hypre_MPI_Comm *newcomm ) { - return(0); + HYPRE_UNUSED_VAR(comm); + HYPRE_UNUSED_VAR(group); + *newcomm = hypre_MPI_COMM_NULL; + return (0); } HYPRE_Int hypre_MPI_Comm_dup( hypre_MPI_Comm comm, hypre_MPI_Comm *newcomm ) { - return(0); + *newcomm = comm; + return (0); } HYPRE_Int hypre_MPI_Comm_size( hypre_MPI_Comm comm, HYPRE_Int *size ) { + HYPRE_UNUSED_VAR(comm); *size = 1; - return(0); + return (0); } HYPRE_Int hypre_MPI_Comm_rank( hypre_MPI_Comm comm, HYPRE_Int *rank ) { + HYPRE_UNUSED_VAR(comm); *rank = 0; - return(0); + return (0); } HYPRE_Int hypre_MPI_Comm_free( hypre_MPI_Comm *comm ) { + HYPRE_UNUSED_VAR(comm); return 0; } @@ -109,7 +123,9 @@ HYPRE_Int hypre_MPI_Comm_group( hypre_MPI_Comm comm, hypre_MPI_Group *group ) { - return(0); + HYPRE_UNUSED_VAR(comm); + HYPRE_UNUSED_VAR(group); + return (0); } HYPRE_Int @@ -118,7 +134,11 @@ hypre_MPI_Comm_split( hypre_MPI_Comm comm, HYPRE_Int m, hypre_MPI_Comm *comms ) { - return(0); + HYPRE_UNUSED_VAR(comm); + HYPRE_UNUSED_VAR(n); + HYPRE_UNUSED_VAR(m); + HYPRE_UNUSED_VAR(comms); + return (0); } HYPRE_Int @@ -127,12 +147,17 @@ hypre_MPI_Group_incl( hypre_MPI_Group group, HYPRE_Int *ranks, hypre_MPI_Group *newgroup ) { - return(0); + HYPRE_UNUSED_VAR(group); + HYPRE_UNUSED_VAR(n); + HYPRE_UNUSED_VAR(ranks); + HYPRE_UNUSED_VAR(newgroup); + return (0); } HYPRE_Int hypre_MPI_Group_free( hypre_MPI_Group *group ) { + HYPRE_UNUSED_VAR(group); return 0; } @@ -140,7 +165,9 @@ HYPRE_Int hypre_MPI_Address( void *location, hypre_MPI_Aint *address ) { - return(0); + HYPRE_UNUSED_VAR(location); + HYPRE_UNUSED_VAR(address); + return (0); } HYPRE_Int @@ -148,7 +175,10 @@ hypre_MPI_Get_count( hypre_MPI_Status *status, hypre_MPI_Datatype datatype, HYPRE_Int *count ) { - return(0); + HYPRE_UNUSED_VAR(status); + HYPRE_UNUSED_VAR(datatype); + HYPRE_UNUSED_VAR(count); + return (0); } HYPRE_Int @@ -160,7 +190,14 @@ hypre_MPI_Alltoall( void *sendbuf, hypre_MPI_Datatype recvtype, hypre_MPI_Comm comm ) { - return(0); + HYPRE_UNUSED_VAR(sendbuf); + HYPRE_UNUSED_VAR(sendcount); + HYPRE_UNUSED_VAR(sendtype); + HYPRE_UNUSED_VAR(recvbuf); + HYPRE_UNUSED_VAR(recvcount); + HYPRE_UNUSED_VAR(recvtype); + HYPRE_UNUSED_VAR(comm); + return (0); } HYPRE_Int @@ -174,6 +211,9 @@ hypre_MPI_Allgather( void *sendbuf, { HYPRE_Int i; + HYPRE_UNUSED_VAR(comm); + HYPRE_UNUSED_VAR(recvcount); + HYPRE_UNUSED_VAR(recvtype); switch (sendtype) { case hypre_MPI_INT: @@ -182,7 +222,29 @@ hypre_MPI_Allgather( void *sendbuf, HYPRE_Int *csendbuf = (HYPRE_Int *)sendbuf; for (i = 0; i < sendcount; i++) { - crecvbuf[i] = csendbuf[i]; + crecvbuf[i] = csendbuf[i]; + } + } + break; + + case hypre_MPI_LONG_LONG_INT: + { + HYPRE_BigInt *crecvbuf = (HYPRE_BigInt *)recvbuf; + HYPRE_BigInt *csendbuf = (HYPRE_BigInt *)sendbuf; + for (i = 0; i < sendcount; i++) + { + crecvbuf[i] = csendbuf[i]; + } + } + break; + + case hypre_MPI_FLOAT: + { + float *crecvbuf = (float *)recvbuf; + float *csendbuf = (float *)sendbuf; + for (i = 0; i < sendcount; i++) + { + crecvbuf[i] = csendbuf[i]; } } break; @@ -193,7 +255,18 @@ hypre_MPI_Allgather( void *sendbuf, double *csendbuf = (double *)sendbuf; for (i = 0; i < sendcount; i++) { - crecvbuf[i] = csendbuf[i]; + crecvbuf[i] = csendbuf[i]; + } + } + break; + + case hypre_MPI_LONG_DOUBLE: + { + long double *crecvbuf = (long double *)recvbuf; + long double *csendbuf = (long double *)sendbuf; + for (i = 0; i < sendcount; i++) + { + crecvbuf[i] = csendbuf[i]; } } break; @@ -204,14 +277,25 @@ hypre_MPI_Allgather( void *sendbuf, char *csendbuf = (char *)sendbuf; for (i = 0; i < sendcount; i++) { - crecvbuf[i] = csendbuf[i]; + crecvbuf[i] = csendbuf[i]; + } + } + break; + + case hypre_MPI_LONG: + { + hypre_longint *crecvbuf = (hypre_longint *)recvbuf; + hypre_longint *csendbuf = (hypre_longint *)sendbuf; + for (i = 0; i < sendcount; i++) + { + crecvbuf[i] = csendbuf[i]; } } break; case hypre_MPI_BYTE: { - hypre_Memcpy(recvbuf, sendbuf, sendcount, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + hypre_TMemcpy(recvbuf, sendbuf, char, sendcount, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); } break; @@ -221,7 +305,7 @@ hypre_MPI_Allgather( void *sendbuf, HYPRE_Real *csendbuf = (HYPRE_Real *)sendbuf; for (i = 0; i < sendcount; i++) { - crecvbuf[i] = csendbuf[i]; + crecvbuf[i] = csendbuf[i]; } } break; @@ -232,13 +316,13 @@ hypre_MPI_Allgather( void *sendbuf, HYPRE_Complex *csendbuf = (HYPRE_Complex *)sendbuf; for (i = 0; i < sendcount; i++) { - crecvbuf[i] = csendbuf[i]; + crecvbuf[i] = csendbuf[i]; } } break; } - return(0); + return (0); } HYPRE_Int @@ -251,6 +335,7 @@ hypre_MPI_Allgatherv( void *sendbuf, hypre_MPI_Datatype recvtype, hypre_MPI_Comm comm ) { + HYPRE_UNUSED_VAR(displs); return ( hypre_MPI_Allgather(sendbuf, sendcount, sendtype, recvbuf, *recvcounts, recvtype, comm) ); } @@ -265,21 +350,24 @@ hypre_MPI_Gather( void *sendbuf, HYPRE_Int root, hypre_MPI_Comm comm ) { + HYPRE_UNUSED_VAR(root); return ( hypre_MPI_Allgather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm) ); } HYPRE_Int hypre_MPI_Gatherv( void *sendbuf, - HYPRE_Int sendcount, - hypre_MPI_Datatype sendtype, - void *recvbuf, - HYPRE_Int *recvcounts, - HYPRE_Int *displs, - hypre_MPI_Datatype recvtype, - HYPRE_Int root, - hypre_MPI_Comm comm ) + HYPRE_Int sendcount, + hypre_MPI_Datatype sendtype, + void *recvbuf, + HYPRE_Int *recvcounts, + HYPRE_Int *displs, + hypre_MPI_Datatype recvtype, + HYPRE_Int root, + hypre_MPI_Comm comm ) { + HYPRE_UNUSED_VAR(displs); + HYPRE_UNUSED_VAR(root); return ( hypre_MPI_Allgather(sendbuf, sendcount, sendtype, recvbuf, *recvcounts, recvtype, comm) ); } @@ -294,21 +382,24 @@ hypre_MPI_Scatter( void *sendbuf, HYPRE_Int root, hypre_MPI_Comm comm ) { + HYPRE_UNUSED_VAR(root); return ( hypre_MPI_Allgather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm) ); } HYPRE_Int hypre_MPI_Scatterv( void *sendbuf, - HYPRE_Int *sendcounts, - HYPRE_Int *displs, - hypre_MPI_Datatype sendtype, - void *recvbuf, - HYPRE_Int recvcount, - hypre_MPI_Datatype recvtype, - HYPRE_Int root, - hypre_MPI_Comm comm ) -{ + HYPRE_Int *sendcounts, + HYPRE_Int *displs, + hypre_MPI_Datatype sendtype, + void *recvbuf, + HYPRE_Int recvcount, + hypre_MPI_Datatype recvtype, + HYPRE_Int root, + hypre_MPI_Comm comm ) +{ + HYPRE_UNUSED_VAR(displs); + HYPRE_UNUSED_VAR(root); return ( hypre_MPI_Allgather(sendbuf, *sendcounts, sendtype, recvbuf, recvcount, recvtype, comm) ); } @@ -320,7 +411,12 @@ hypre_MPI_Bcast( void *buffer, HYPRE_Int root, hypre_MPI_Comm comm ) { - return(0); + HYPRE_UNUSED_VAR(buffer); + HYPRE_UNUSED_VAR(count); + HYPRE_UNUSED_VAR(datatype); + HYPRE_UNUSED_VAR(root); + HYPRE_UNUSED_VAR(comm); + return (0); } HYPRE_Int @@ -331,7 +427,13 @@ hypre_MPI_Send( void *buf, HYPRE_Int tag, hypre_MPI_Comm comm ) { - return(0); + HYPRE_UNUSED_VAR(buf); + HYPRE_UNUSED_VAR(count); + HYPRE_UNUSED_VAR(datatype); + HYPRE_UNUSED_VAR(dest); + HYPRE_UNUSED_VAR(tag); + HYPRE_UNUSED_VAR(comm); + return (0); } HYPRE_Int @@ -343,7 +445,14 @@ hypre_MPI_Recv( void *buf, hypre_MPI_Comm comm, hypre_MPI_Status *status ) { - return(0); + HYPRE_UNUSED_VAR(buf); + HYPRE_UNUSED_VAR(count); + HYPRE_UNUSED_VAR(datatype); + HYPRE_UNUSED_VAR(source); + HYPRE_UNUSED_VAR(tag); + HYPRE_UNUSED_VAR(comm); + HYPRE_UNUSED_VAR(status); + return (0); } HYPRE_Int @@ -355,7 +464,14 @@ hypre_MPI_Isend( void *buf, hypre_MPI_Comm comm, hypre_MPI_Request *request ) { - return(0); + HYPRE_UNUSED_VAR(buf); + HYPRE_UNUSED_VAR(count); + HYPRE_UNUSED_VAR(datatype); + HYPRE_UNUSED_VAR(dest); + HYPRE_UNUSED_VAR(tag); + HYPRE_UNUSED_VAR(comm); + HYPRE_UNUSED_VAR(request); + return (0); } HYPRE_Int @@ -367,7 +483,14 @@ hypre_MPI_Irecv( void *buf, hypre_MPI_Comm comm, hypre_MPI_Request *request ) { - return(0); + HYPRE_UNUSED_VAR(buf); + HYPRE_UNUSED_VAR(count); + HYPRE_UNUSED_VAR(datatype); + HYPRE_UNUSED_VAR(source); + HYPRE_UNUSED_VAR(tag); + HYPRE_UNUSED_VAR(comm); + HYPRE_UNUSED_VAR(request); + return (0); } HYPRE_Int @@ -379,6 +502,13 @@ hypre_MPI_Send_init( void *buf, hypre_MPI_Comm comm, hypre_MPI_Request *request ) { + HYPRE_UNUSED_VAR(buf); + HYPRE_UNUSED_VAR(count); + HYPRE_UNUSED_VAR(datatype); + HYPRE_UNUSED_VAR(dest); + HYPRE_UNUSED_VAR(tag); + HYPRE_UNUSED_VAR(comm); + HYPRE_UNUSED_VAR(request); return 0; } @@ -391,6 +521,13 @@ hypre_MPI_Recv_init( void *buf, hypre_MPI_Comm comm, hypre_MPI_Request *request ) { + HYPRE_UNUSED_VAR(buf); + HYPRE_UNUSED_VAR(count); + HYPRE_UNUSED_VAR(datatype); + HYPRE_UNUSED_VAR(dest); + HYPRE_UNUSED_VAR(tag); + HYPRE_UNUSED_VAR(comm); + HYPRE_UNUSED_VAR(request); return 0; } @@ -403,6 +540,13 @@ hypre_MPI_Irsend( void *buf, hypre_MPI_Comm comm, hypre_MPI_Request *request ) { + HYPRE_UNUSED_VAR(buf); + HYPRE_UNUSED_VAR(count); + HYPRE_UNUSED_VAR(datatype); + HYPRE_UNUSED_VAR(dest); + HYPRE_UNUSED_VAR(tag); + HYPRE_UNUSED_VAR(comm); + HYPRE_UNUSED_VAR(request); return 0; } @@ -410,6 +554,8 @@ HYPRE_Int hypre_MPI_Startall( HYPRE_Int count, hypre_MPI_Request *array_of_requests ) { + HYPRE_UNUSED_VAR(count); + HYPRE_UNUSED_VAR(array_of_requests); return 0; } @@ -419,6 +565,10 @@ hypre_MPI_Probe( HYPRE_Int source, hypre_MPI_Comm comm, hypre_MPI_Status *status ) { + HYPRE_UNUSED_VAR(source); + HYPRE_UNUSED_VAR(tag); + HYPRE_UNUSED_VAR(comm); + HYPRE_UNUSED_VAR(status); return 0; } @@ -429,6 +579,11 @@ hypre_MPI_Iprobe( HYPRE_Int source, HYPRE_Int *flag, hypre_MPI_Status *status ) { + HYPRE_UNUSED_VAR(source); + HYPRE_UNUSED_VAR(tag); + HYPRE_UNUSED_VAR(comm); + HYPRE_UNUSED_VAR(flag); + HYPRE_UNUSED_VAR(status); return 0; } @@ -437,8 +592,10 @@ hypre_MPI_Test( hypre_MPI_Request *request, HYPRE_Int *flag, hypre_MPI_Status *status ) { + HYPRE_UNUSED_VAR(request); + HYPRE_UNUSED_VAR(status); *flag = 1; - return(0); + return (0); } HYPRE_Int @@ -447,15 +604,21 @@ hypre_MPI_Testall( HYPRE_Int count, HYPRE_Int *flag, hypre_MPI_Status *array_of_statuses ) { + HYPRE_UNUSED_VAR(count); + HYPRE_UNUSED_VAR(array_of_requests); + HYPRE_UNUSED_VAR(flag); + HYPRE_UNUSED_VAR(array_of_statuses); *flag = 1; - return(0); + return (0); } HYPRE_Int hypre_MPI_Wait( hypre_MPI_Request *request, hypre_MPI_Status *status ) { - return(0); + HYPRE_UNUSED_VAR(request); + HYPRE_UNUSED_VAR(status); + return (0); } HYPRE_Int @@ -463,7 +626,10 @@ hypre_MPI_Waitall( HYPRE_Int count, hypre_MPI_Request *array_of_requests, hypre_MPI_Status *array_of_statuses ) { - return(0); + HYPRE_UNUSED_VAR(count); + HYPRE_UNUSED_VAR(array_of_requests); + HYPRE_UNUSED_VAR(array_of_statuses); + return (0); } HYPRE_Int @@ -472,7 +638,11 @@ hypre_MPI_Waitany( HYPRE_Int count, HYPRE_Int *index, hypre_MPI_Status *status ) { - return(0); + HYPRE_UNUSED_VAR(count); + HYPRE_UNUSED_VAR(array_of_requests); + HYPRE_UNUSED_VAR(index); + HYPRE_UNUSED_VAR(status); + return (0); } HYPRE_Int @@ -485,6 +655,8 @@ hypre_MPI_Allreduce( void *sendbuf, { HYPRE_Int i; + HYPRE_UNUSED_VAR(op); + HYPRE_UNUSED_VAR(comm); switch (datatype) { case hypre_MPI_INT: @@ -495,7 +667,28 @@ hypre_MPI_Allreduce( void *sendbuf, { crecvbuf[i] = csendbuf[i]; } + } + break; + case hypre_MPI_LONG_LONG_INT: + { + HYPRE_BigInt *crecvbuf = (HYPRE_BigInt *)recvbuf; + HYPRE_BigInt *csendbuf = (HYPRE_BigInt *)sendbuf; + for (i = 0; i < count; i++) + { + crecvbuf[i] = csendbuf[i]; + } + } + break; + + case hypre_MPI_FLOAT: + { + float *crecvbuf = (float *)recvbuf; + float *csendbuf = (float *)sendbuf; + for (i = 0; i < count; i++) + { + crecvbuf[i] = csendbuf[i]; + } } break; @@ -510,6 +703,17 @@ hypre_MPI_Allreduce( void *sendbuf, } break; + case hypre_MPI_LONG_DOUBLE: + { + long double *crecvbuf = (long double *)recvbuf; + long double *csendbuf = (long double *)sendbuf; + for (i = 0; i < count; i++) + { + crecvbuf[i] = csendbuf[i]; + } + } + break; + case hypre_MPI_CHAR: { char *crecvbuf = (char *)recvbuf; @@ -521,9 +725,20 @@ hypre_MPI_Allreduce( void *sendbuf, } break; + case hypre_MPI_LONG: + { + hypre_longint *crecvbuf = (hypre_longint *)recvbuf; + hypre_longint *csendbuf = (hypre_longint *)sendbuf; + for (i = 0; i < count; i++) + { + crecvbuf[i] = csendbuf[i]; + } + } + break; + case hypre_MPI_BYTE: { - hypre_Memcpy(recvbuf, sendbuf, count, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + hypre_TMemcpy(recvbuf, sendbuf, char, count, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); } break; @@ -562,6 +777,7 @@ hypre_MPI_Reduce( void *sendbuf, HYPRE_Int root, hypre_MPI_Comm comm ) { + HYPRE_UNUSED_VAR(root); hypre_MPI_Allreduce(sendbuf, recvbuf, count, datatype, op, comm); return 0; } @@ -581,6 +797,7 @@ hypre_MPI_Scan( void *sendbuf, HYPRE_Int hypre_MPI_Request_free( hypre_MPI_Request *request ) { + HYPRE_UNUSED_VAR(request); return 0; } @@ -589,7 +806,10 @@ hypre_MPI_Type_contiguous( HYPRE_Int count, hypre_MPI_Datatype oldtype, hypre_MPI_Datatype *newtype ) { - return(0); + HYPRE_UNUSED_VAR(count); + HYPRE_UNUSED_VAR(oldtype); + HYPRE_UNUSED_VAR(newtype); + return (0); } HYPRE_Int @@ -599,7 +819,12 @@ hypre_MPI_Type_vector( HYPRE_Int count, hypre_MPI_Datatype oldtype, hypre_MPI_Datatype *newtype ) { - return(0); + HYPRE_UNUSED_VAR(count); + HYPRE_UNUSED_VAR(blocklength); + HYPRE_UNUSED_VAR(stride); + HYPRE_UNUSED_VAR(oldtype); + HYPRE_UNUSED_VAR(newtype); + return (0); } HYPRE_Int @@ -609,7 +834,12 @@ hypre_MPI_Type_hvector( HYPRE_Int count, hypre_MPI_Datatype oldtype, hypre_MPI_Datatype *newtype ) { - return(0); + HYPRE_UNUSED_VAR(count); + HYPRE_UNUSED_VAR(blocklength); + HYPRE_UNUSED_VAR(stride); + HYPRE_UNUSED_VAR(oldtype); + HYPRE_UNUSED_VAR(newtype); + return (0); } HYPRE_Int @@ -619,46 +849,65 @@ hypre_MPI_Type_struct( HYPRE_Int count, hypre_MPI_Datatype *array_of_types, hypre_MPI_Datatype *newtype ) { - return(0); + HYPRE_UNUSED_VAR(count); + HYPRE_UNUSED_VAR(array_of_blocklengths); + HYPRE_UNUSED_VAR(array_of_displacements); + HYPRE_UNUSED_VAR(array_of_types); + HYPRE_UNUSED_VAR(newtype); + return (0); } HYPRE_Int hypre_MPI_Type_commit( hypre_MPI_Datatype *datatype ) { - return(0); + HYPRE_UNUSED_VAR(datatype); + return (0); } HYPRE_Int hypre_MPI_Type_free( hypre_MPI_Datatype *datatype ) { - return(0); + HYPRE_UNUSED_VAR(datatype); + return (0); } HYPRE_Int hypre_MPI_Op_create( hypre_MPI_User_function *function, hypre_int commute, hypre_MPI_Op *op ) { - return(0); + HYPRE_UNUSED_VAR(function); + HYPRE_UNUSED_VAR(commute); + HYPRE_UNUSED_VAR(op); + return (0); } HYPRE_Int hypre_MPI_Op_free( hypre_MPI_Op *op ) { - return(0); + HYPRE_UNUSED_VAR(op); + return (0); } #if defined(HYPRE_USING_GPU) -HYPRE_Int hypre_MPI_Comm_split_type( hypre_MPI_Comm comm, HYPRE_Int split_type, HYPRE_Int key, hypre_MPI_Info info, hypre_MPI_Comm *newcomm ) -{ +HYPRE_Int hypre_MPI_Comm_split_type( hypre_MPI_Comm comm, HYPRE_Int split_type, HYPRE_Int key, + hypre_MPI_Info info, hypre_MPI_Comm *newcomm ) +{ + HYPRE_UNUSED_VAR(comm); + HYPRE_UNUSED_VAR(split_type); + HYPRE_UNUSED_VAR(key); + HYPRE_UNUSED_VAR(info); + HYPRE_UNUSED_VAR(newcomm); return (0); } HYPRE_Int hypre_MPI_Info_create( hypre_MPI_Info *info ) { + HYPRE_UNUSED_VAR(info); return (0); } HYPRE_Int hypre_MPI_Info_free( hypre_MPI_Info *info ) { + HYPRE_UNUSED_VAR(info); return (0); } #endif @@ -677,7 +926,7 @@ hypre_MPI_Init( hypre_int *argc, } HYPRE_Int -hypre_MPI_Finalize( ) +hypre_MPI_Finalize( void ) { return (HYPRE_Int) MPI_Finalize(); } @@ -690,15 +939,15 @@ hypre_MPI_Abort( hypre_MPI_Comm comm, } HYPRE_Real -hypre_MPI_Wtime( ) +hypre_MPI_Wtime( void ) { - return MPI_Wtime(); + return (HYPRE_Real)MPI_Wtime(); } HYPRE_Real -hypre_MPI_Wtick( ) +hypre_MPI_Wtick( void ) { - return MPI_Wtick(); + return (HYPRE_Real)MPI_Wtick(); } HYPRE_Int @@ -918,8 +1167,8 @@ hypre_MPI_Gatherv(void *sendbuf, } } ierr = (HYPRE_Int) MPI_Gatherv(sendbuf, (hypre_int)sendcount, sendtype, - recvbuf, mpi_recvcounts, mpi_displs, - recvtype, (hypre_int) root, comm); + recvbuf, mpi_recvcounts, mpi_displs, + recvtype, (hypre_int) root, comm); hypre_TFree(mpi_recvcounts, HYPRE_MEMORY_HOST); hypre_TFree(mpi_displs, HYPRE_MEMORY_HOST); @@ -971,8 +1220,8 @@ hypre_MPI_Scatterv(void *sendbuf, } } ierr = (HYPRE_Int) MPI_Scatterv(sendbuf, mpi_sendcounts, mpi_displs, sendtype, - recvbuf, (hypre_int) recvcount, - recvtype, (hypre_int) root, comm); + recvbuf, (hypre_int) recvcount, + recvtype, (hypre_int) root, comm); hypre_TFree(mpi_sendcounts, HYPRE_MEMORY_HOST); hypre_TFree(mpi_displs, HYPRE_MEMORY_HOST); @@ -1177,8 +1426,14 @@ hypre_MPI_Allreduce( void *sendbuf, hypre_MPI_Op op, hypre_MPI_Comm comm ) { - return (HYPRE_Int) MPI_Allreduce(sendbuf, recvbuf, (hypre_int)count, + hypre_GpuProfilingPushRange("MPI_Allreduce"); + + HYPRE_Int result = MPI_Allreduce(sendbuf, recvbuf, (hypre_int)count, datatype, op, comm); + + hypre_GpuProfilingPopRange(); + + return result; } HYPRE_Int @@ -1239,8 +1494,8 @@ hypre_MPI_Type_hvector( HYPRE_Int count, hypre_MPI_Datatype *newtype ) { #if MPI_VERSION > 1 - return (HYPRE_Int) MPI_Type_create_hvector((hypre_int)count, (hypre_int)blocklength, - stride, oldtype, newtype); + return (HYPRE_Int) MPI_Type_create_hvector((hypre_int)count, (hypre_int)blocklength, + stride, oldtype, newtype); #else return (HYPRE_Int) MPI_Type_hvector((hypre_int)count, (hypre_int)blocklength, stride, oldtype, newtype); @@ -1265,13 +1520,13 @@ hypre_MPI_Type_struct( HYPRE_Int count, } #if MPI_VERSION > 1 - ierr = (HYPRE_Int) MPI_Type_create_struct((hypre_int)count, mpi_array_of_blocklengths, - array_of_displacements, array_of_types, - newtype); + ierr = (HYPRE_Int) MPI_Type_create_struct((hypre_int)count, mpi_array_of_blocklengths, + array_of_displacements, array_of_types, + newtype); #else - ierr = (HYPRE_Int) MPI_Type_struct((hypre_int)count, mpi_array_of_blocklengths, - array_of_displacements, array_of_types, - newtype); + ierr = (HYPRE_Int) MPI_Type_struct((hypre_int)count, mpi_array_of_blocklengths, + array_of_displacements, array_of_types, + newtype); #endif hypre_TFree(mpi_array_of_blocklengths, HYPRE_MEMORY_HOST); @@ -1303,9 +1558,10 @@ hypre_MPI_Op_create( hypre_MPI_User_function *function, hypre_int commute, hypre return (HYPRE_Int) MPI_Op_create(function, commute, op); } -#if defined(HYPRE_USING_GPU) +#if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) HYPRE_Int -hypre_MPI_Comm_split_type( hypre_MPI_Comm comm, HYPRE_Int split_type, HYPRE_Int key, hypre_MPI_Info info, hypre_MPI_Comm *newcomm ) +hypre_MPI_Comm_split_type( hypre_MPI_Comm comm, HYPRE_Int split_type, HYPRE_Int key, + hypre_MPI_Info info, hypre_MPI_Comm *newcomm ) { return (HYPRE_Int) MPI_Comm_split_type(comm, split_type, key, info, newcomm ); } diff --git a/external/hypre/src/utilities/mpistubs.h b/external/hypre/src/utilities/mpistubs.h index cedbe2ba..50cf780e 100644 --- a/external/hypre/src/utilities/mpistubs.h +++ b/external/hypre/src/utilities/mpistubs.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -45,16 +45,19 @@ extern "C" { #define MPI_COMM_SELF hypre_MPI_COMM_SELF #define MPI_COMM_TYPE_SHARED hypre_MPI_COMM_TYPE_SHARED -#define MPI_BOTTOM hypre_MPI_BOTTOM +#define MPI_BOTTOM hypre_MPI_BOTTOM #define MPI_FLOAT hypre_MPI_FLOAT #define MPI_DOUBLE hypre_MPI_DOUBLE #define MPI_LONG_DOUBLE hypre_MPI_LONG_DOUBLE #define MPI_INT hypre_MPI_INT -#define MPI_LONG_LONG_INT hypre_MPI_INT +#define MPI_LONG_LONG_INT hypre_MPI_LONG_LONG_INT #define MPI_CHAR hypre_MPI_CHAR #define MPI_LONG hypre_MPI_LONG #define MPI_BYTE hypre_MPI_BYTE + +#define MPI_C_FLOAT_COMPLEX hypre_MPI_COMPLEX +#define MPI_C_LONG_DOUBLE_COMPLEX hypre_MPI_COMPLEX #define MPI_C_DOUBLE_COMPLEX hypre_MPI_COMPLEX #define MPI_SUM hypre_MPI_SUM @@ -62,6 +65,7 @@ extern "C" { #define MPI_MAX hypre_MPI_MAX #define MPI_LOR hypre_MPI_LOR #define MPI_LAND hypre_MPI_LAND +#define MPI_BOR hypre_MPI_BOR #define MPI_SUCCESS hypre_MPI_SUCCESS #define MPI_STATUSES_IGNORE hypre_MPI_STATUSES_IGNORE @@ -139,7 +143,7 @@ typedef HYPRE_Int hypre_MPI_Comm; typedef HYPRE_Int hypre_MPI_Group; typedef HYPRE_Int hypre_MPI_Request; typedef HYPRE_Int hypre_MPI_Datatype; -typedef void (hypre_MPI_User_function) (); +typedef void (hypre_MPI_User_function) (void); typedef struct { @@ -168,12 +172,14 @@ typedef HYPRE_Int hypre_MPI_Info; #define hypre_MPI_BYTE 6 #define hypre_MPI_REAL 7 #define hypre_MPI_COMPLEX 8 +#define hypre_MPI_LONG_LONG_INT 9 #define hypre_MPI_SUM 0 #define hypre_MPI_MIN 1 #define hypre_MPI_MAX 2 #define hypre_MPI_LOR 3 #define hypre_MPI_LAND 4 +#define hypre_MPI_BOR 5 #define hypre_MPI_SUCCESS 0 #define hypre_MPI_STATUSES_IGNORE 0 @@ -222,6 +228,7 @@ typedef MPI_User_function hypre_MPI_User_function; #define hypre_MPI_MIN MPI_MIN #define hypre_MPI_MAX MPI_MAX #define hypre_MPI_LOR MPI_LOR +#define hypre_MPI_BOR MPI_BOR #define hypre_MPI_SUCCESS MPI_SUCCESS #define hypre_MPI_STATUSES_IGNORE MPI_STATUSES_IGNORE @@ -245,61 +252,100 @@ typedef MPI_User_function hypre_MPI_User_function; *--------------------------------------------------------------------------*/ /* mpistubs.c */ -HYPRE_Int hypre_MPI_Init( hypre_int *argc , char ***argv ); +HYPRE_Int hypre_MPI_Init( hypre_int *argc, char ***argv ); HYPRE_Int hypre_MPI_Finalize( void ); -HYPRE_Int hypre_MPI_Abort( hypre_MPI_Comm comm , HYPRE_Int errorcode ); +HYPRE_Int hypre_MPI_Abort( hypre_MPI_Comm comm, HYPRE_Int errorcode ); HYPRE_Real hypre_MPI_Wtime( void ); HYPRE_Real hypre_MPI_Wtick( void ); HYPRE_Int hypre_MPI_Barrier( hypre_MPI_Comm comm ); -HYPRE_Int hypre_MPI_Comm_create( hypre_MPI_Comm comm , hypre_MPI_Group group , hypre_MPI_Comm *newcomm ); -HYPRE_Int hypre_MPI_Comm_dup( hypre_MPI_Comm comm , hypre_MPI_Comm *newcomm ); +HYPRE_Int hypre_MPI_Comm_create( hypre_MPI_Comm comm, hypre_MPI_Group group, + hypre_MPI_Comm *newcomm ); +HYPRE_Int hypre_MPI_Comm_dup( hypre_MPI_Comm comm, hypre_MPI_Comm *newcomm ); hypre_MPI_Comm hypre_MPI_Comm_f2c( hypre_int comm ); -HYPRE_Int hypre_MPI_Comm_size( hypre_MPI_Comm comm , HYPRE_Int *size ); -HYPRE_Int hypre_MPI_Comm_rank( hypre_MPI_Comm comm , HYPRE_Int *rank ); +HYPRE_Int hypre_MPI_Comm_size( hypre_MPI_Comm comm, HYPRE_Int *size ); +HYPRE_Int hypre_MPI_Comm_rank( hypre_MPI_Comm comm, HYPRE_Int *rank ); HYPRE_Int hypre_MPI_Comm_free( hypre_MPI_Comm *comm ); -HYPRE_Int hypre_MPI_Comm_group( hypre_MPI_Comm comm , hypre_MPI_Group *group ); -HYPRE_Int hypre_MPI_Comm_split( hypre_MPI_Comm comm, HYPRE_Int n, HYPRE_Int m, hypre_MPI_Comm * comms ); -HYPRE_Int hypre_MPI_Group_incl( hypre_MPI_Group group , HYPRE_Int n , HYPRE_Int *ranks , hypre_MPI_Group *newgroup ); +HYPRE_Int hypre_MPI_Comm_group( hypre_MPI_Comm comm, hypre_MPI_Group *group ); +HYPRE_Int hypre_MPI_Comm_split( hypre_MPI_Comm comm, HYPRE_Int n, HYPRE_Int m, + hypre_MPI_Comm * comms ); +HYPRE_Int hypre_MPI_Group_incl( hypre_MPI_Group group, HYPRE_Int n, HYPRE_Int *ranks, + hypre_MPI_Group *newgroup ); HYPRE_Int hypre_MPI_Group_free( hypre_MPI_Group *group ); -HYPRE_Int hypre_MPI_Address( void *location , hypre_MPI_Aint *address ); -HYPRE_Int hypre_MPI_Get_count( hypre_MPI_Status *status , hypre_MPI_Datatype datatype , HYPRE_Int *count ); -HYPRE_Int hypre_MPI_Alltoall( void *sendbuf , HYPRE_Int sendcount , hypre_MPI_Datatype sendtype , void *recvbuf , HYPRE_Int recvcount , hypre_MPI_Datatype recvtype , hypre_MPI_Comm comm ); -HYPRE_Int hypre_MPI_Allgather( void *sendbuf , HYPRE_Int sendcount , hypre_MPI_Datatype sendtype , void *recvbuf , HYPRE_Int recvcount , hypre_MPI_Datatype recvtype , hypre_MPI_Comm comm ); -HYPRE_Int hypre_MPI_Allgatherv( void *sendbuf , HYPRE_Int sendcount , hypre_MPI_Datatype sendtype , void *recvbuf , HYPRE_Int *recvcounts , HYPRE_Int *displs , hypre_MPI_Datatype recvtype , hypre_MPI_Comm comm ); -HYPRE_Int hypre_MPI_Gather( void *sendbuf , HYPRE_Int sendcount , hypre_MPI_Datatype sendtype , void *recvbuf , HYPRE_Int recvcount , hypre_MPI_Datatype recvtype , HYPRE_Int root , hypre_MPI_Comm comm ); -HYPRE_Int hypre_MPI_Gatherv( void *sendbuf , HYPRE_Int sendcount , hypre_MPI_Datatype sendtype , void *recvbuf , HYPRE_Int *recvcounts , HYPRE_Int *displs , hypre_MPI_Datatype recvtype , HYPRE_Int root , hypre_MPI_Comm comm ); -HYPRE_Int hypre_MPI_Scatter( void *sendbuf , HYPRE_Int sendcount , hypre_MPI_Datatype sendtype , void *recvbuf , HYPRE_Int recvcount , hypre_MPI_Datatype recvtype , HYPRE_Int root , hypre_MPI_Comm comm ); -HYPRE_Int hypre_MPI_Scatterv( void *sendbuf , HYPRE_Int *sendcounts , HYPRE_Int *displs, hypre_MPI_Datatype sendtype , void *recvbuf , HYPRE_Int recvcount , hypre_MPI_Datatype recvtype , HYPRE_Int root , hypre_MPI_Comm comm ); -HYPRE_Int hypre_MPI_Bcast( void *buffer , HYPRE_Int count , hypre_MPI_Datatype datatype , HYPRE_Int root , hypre_MPI_Comm comm ); -HYPRE_Int hypre_MPI_Send( void *buf , HYPRE_Int count , hypre_MPI_Datatype datatype , HYPRE_Int dest , HYPRE_Int tag , hypre_MPI_Comm comm ); -HYPRE_Int hypre_MPI_Recv( void *buf , HYPRE_Int count , hypre_MPI_Datatype datatype , HYPRE_Int source , HYPRE_Int tag , hypre_MPI_Comm comm , hypre_MPI_Status *status ); -HYPRE_Int hypre_MPI_Isend( void *buf , HYPRE_Int count , hypre_MPI_Datatype datatype , HYPRE_Int dest , HYPRE_Int tag , hypre_MPI_Comm comm , hypre_MPI_Request *request ); -HYPRE_Int hypre_MPI_Irecv( void *buf , HYPRE_Int count , hypre_MPI_Datatype datatype , HYPRE_Int source , HYPRE_Int tag , hypre_MPI_Comm comm , hypre_MPI_Request *request ); -HYPRE_Int hypre_MPI_Send_init( void *buf , HYPRE_Int count , hypre_MPI_Datatype datatype , HYPRE_Int dest , HYPRE_Int tag , hypre_MPI_Comm comm , hypre_MPI_Request *request ); -HYPRE_Int hypre_MPI_Recv_init( void *buf , HYPRE_Int count , hypre_MPI_Datatype datatype , HYPRE_Int dest , HYPRE_Int tag , hypre_MPI_Comm comm , hypre_MPI_Request *request ); -HYPRE_Int hypre_MPI_Irsend( void *buf , HYPRE_Int count , hypre_MPI_Datatype datatype , HYPRE_Int dest , HYPRE_Int tag , hypre_MPI_Comm comm , hypre_MPI_Request *request ); -HYPRE_Int hypre_MPI_Startall( HYPRE_Int count , hypre_MPI_Request *array_of_requests ); -HYPRE_Int hypre_MPI_Probe( HYPRE_Int source , HYPRE_Int tag , hypre_MPI_Comm comm , hypre_MPI_Status *status ); -HYPRE_Int hypre_MPI_Iprobe( HYPRE_Int source , HYPRE_Int tag , hypre_MPI_Comm comm , HYPRE_Int *flag , hypre_MPI_Status *status ); -HYPRE_Int hypre_MPI_Test( hypre_MPI_Request *request , HYPRE_Int *flag , hypre_MPI_Status *status ); -HYPRE_Int hypre_MPI_Testall( HYPRE_Int count , hypre_MPI_Request *array_of_requests , HYPRE_Int *flag , hypre_MPI_Status *array_of_statuses ); -HYPRE_Int hypre_MPI_Wait( hypre_MPI_Request *request , hypre_MPI_Status *status ); -HYPRE_Int hypre_MPI_Waitall( HYPRE_Int count , hypre_MPI_Request *array_of_requests , hypre_MPI_Status *array_of_statuses ); -HYPRE_Int hypre_MPI_Waitany( HYPRE_Int count , hypre_MPI_Request *array_of_requests , HYPRE_Int *index , hypre_MPI_Status *status ); -HYPRE_Int hypre_MPI_Allreduce( void *sendbuf , void *recvbuf , HYPRE_Int count , hypre_MPI_Datatype datatype , hypre_MPI_Op op , hypre_MPI_Comm comm ); -HYPRE_Int hypre_MPI_Reduce( void *sendbuf , void *recvbuf , HYPRE_Int count , hypre_MPI_Datatype datatype , hypre_MPI_Op op , HYPRE_Int root , hypre_MPI_Comm comm ); -HYPRE_Int hypre_MPI_Scan( void *sendbuf , void *recvbuf , HYPRE_Int count , hypre_MPI_Datatype datatype , hypre_MPI_Op op , hypre_MPI_Comm comm ); +HYPRE_Int hypre_MPI_Address( void *location, hypre_MPI_Aint *address ); +HYPRE_Int hypre_MPI_Get_count( hypre_MPI_Status *status, hypre_MPI_Datatype datatype, + HYPRE_Int *count ); +HYPRE_Int hypre_MPI_Alltoall( void *sendbuf, HYPRE_Int sendcount, hypre_MPI_Datatype sendtype, + void *recvbuf, HYPRE_Int recvcount, hypre_MPI_Datatype recvtype, hypre_MPI_Comm comm ); +HYPRE_Int hypre_MPI_Allgather( void *sendbuf, HYPRE_Int sendcount, hypre_MPI_Datatype sendtype, + void *recvbuf, HYPRE_Int recvcount, hypre_MPI_Datatype recvtype, hypre_MPI_Comm comm ); +HYPRE_Int hypre_MPI_Allgatherv( void *sendbuf, HYPRE_Int sendcount, hypre_MPI_Datatype sendtype, + void *recvbuf, HYPRE_Int *recvcounts, HYPRE_Int *displs, hypre_MPI_Datatype recvtype, + hypre_MPI_Comm comm ); +HYPRE_Int hypre_MPI_Gather( void *sendbuf, HYPRE_Int sendcount, hypre_MPI_Datatype sendtype, + void *recvbuf, HYPRE_Int recvcount, hypre_MPI_Datatype recvtype, HYPRE_Int root, + hypre_MPI_Comm comm ); +HYPRE_Int hypre_MPI_Gatherv( void *sendbuf, HYPRE_Int sendcount, hypre_MPI_Datatype sendtype, + void *recvbuf, HYPRE_Int *recvcounts, HYPRE_Int *displs, hypre_MPI_Datatype recvtype, + HYPRE_Int root, hypre_MPI_Comm comm ); +HYPRE_Int hypre_MPI_Scatter( void *sendbuf, HYPRE_Int sendcount, hypre_MPI_Datatype sendtype, + void *recvbuf, HYPRE_Int recvcount, hypre_MPI_Datatype recvtype, HYPRE_Int root, + hypre_MPI_Comm comm ); +HYPRE_Int hypre_MPI_Scatterv( void *sendbuf, HYPRE_Int *sendcounts, HYPRE_Int *displs, + hypre_MPI_Datatype sendtype, void *recvbuf, HYPRE_Int recvcount, hypre_MPI_Datatype recvtype, + HYPRE_Int root, hypre_MPI_Comm comm ); +HYPRE_Int hypre_MPI_Bcast( void *buffer, HYPRE_Int count, hypre_MPI_Datatype datatype, + HYPRE_Int root, hypre_MPI_Comm comm ); +HYPRE_Int hypre_MPI_Send( void *buf, HYPRE_Int count, hypre_MPI_Datatype datatype, HYPRE_Int dest, + HYPRE_Int tag, hypre_MPI_Comm comm ); +HYPRE_Int hypre_MPI_Recv( void *buf, HYPRE_Int count, hypre_MPI_Datatype datatype, HYPRE_Int source, + HYPRE_Int tag, hypre_MPI_Comm comm, hypre_MPI_Status *status ); +HYPRE_Int hypre_MPI_Isend( void *buf, HYPRE_Int count, hypre_MPI_Datatype datatype, HYPRE_Int dest, + HYPRE_Int tag, hypre_MPI_Comm comm, hypre_MPI_Request *request ); +HYPRE_Int hypre_MPI_Irecv( void *buf, HYPRE_Int count, hypre_MPI_Datatype datatype, + HYPRE_Int source, HYPRE_Int tag, hypre_MPI_Comm comm, hypre_MPI_Request *request ); +HYPRE_Int hypre_MPI_Send_init( void *buf, HYPRE_Int count, hypre_MPI_Datatype datatype, + HYPRE_Int dest, HYPRE_Int tag, hypre_MPI_Comm comm, hypre_MPI_Request *request ); +HYPRE_Int hypre_MPI_Recv_init( void *buf, HYPRE_Int count, hypre_MPI_Datatype datatype, + HYPRE_Int dest, HYPRE_Int tag, hypre_MPI_Comm comm, hypre_MPI_Request *request ); +HYPRE_Int hypre_MPI_Irsend( void *buf, HYPRE_Int count, hypre_MPI_Datatype datatype, HYPRE_Int dest, + HYPRE_Int tag, hypre_MPI_Comm comm, hypre_MPI_Request *request ); +HYPRE_Int hypre_MPI_Startall( HYPRE_Int count, hypre_MPI_Request *array_of_requests ); +HYPRE_Int hypre_MPI_Probe( HYPRE_Int source, HYPRE_Int tag, hypre_MPI_Comm comm, + hypre_MPI_Status *status ); +HYPRE_Int hypre_MPI_Iprobe( HYPRE_Int source, HYPRE_Int tag, hypre_MPI_Comm comm, HYPRE_Int *flag, + hypre_MPI_Status *status ); +HYPRE_Int hypre_MPI_Test( hypre_MPI_Request *request, HYPRE_Int *flag, hypre_MPI_Status *status ); +HYPRE_Int hypre_MPI_Testall( HYPRE_Int count, hypre_MPI_Request *array_of_requests, HYPRE_Int *flag, + hypre_MPI_Status *array_of_statuses ); +HYPRE_Int hypre_MPI_Wait( hypre_MPI_Request *request, hypre_MPI_Status *status ); +HYPRE_Int hypre_MPI_Waitall( HYPRE_Int count, hypre_MPI_Request *array_of_requests, + hypre_MPI_Status *array_of_statuses ); +HYPRE_Int hypre_MPI_Waitany( HYPRE_Int count, hypre_MPI_Request *array_of_requests, + HYPRE_Int *index, hypre_MPI_Status *status ); +HYPRE_Int hypre_MPI_Allreduce( void *sendbuf, void *recvbuf, HYPRE_Int count, + hypre_MPI_Datatype datatype, hypre_MPI_Op op, hypre_MPI_Comm comm ); +HYPRE_Int hypre_MPI_Reduce( void *sendbuf, void *recvbuf, HYPRE_Int count, + hypre_MPI_Datatype datatype, hypre_MPI_Op op, HYPRE_Int root, hypre_MPI_Comm comm ); +HYPRE_Int hypre_MPI_Scan( void *sendbuf, void *recvbuf, HYPRE_Int count, + hypre_MPI_Datatype datatype, hypre_MPI_Op op, hypre_MPI_Comm comm ); HYPRE_Int hypre_MPI_Request_free( hypre_MPI_Request *request ); -HYPRE_Int hypre_MPI_Type_contiguous( HYPRE_Int count , hypre_MPI_Datatype oldtype , hypre_MPI_Datatype *newtype ); -HYPRE_Int hypre_MPI_Type_vector( HYPRE_Int count , HYPRE_Int blocklength , HYPRE_Int stride , hypre_MPI_Datatype oldtype , hypre_MPI_Datatype *newtype ); -HYPRE_Int hypre_MPI_Type_hvector( HYPRE_Int count , HYPRE_Int blocklength , hypre_MPI_Aint stride , hypre_MPI_Datatype oldtype , hypre_MPI_Datatype *newtype ); -HYPRE_Int hypre_MPI_Type_struct( HYPRE_Int count , HYPRE_Int *array_of_blocklengths , hypre_MPI_Aint *array_of_displacements , hypre_MPI_Datatype *array_of_types , hypre_MPI_Datatype *newtype ); +HYPRE_Int hypre_MPI_Type_contiguous( HYPRE_Int count, hypre_MPI_Datatype oldtype, + hypre_MPI_Datatype *newtype ); +HYPRE_Int hypre_MPI_Type_vector( HYPRE_Int count, HYPRE_Int blocklength, HYPRE_Int stride, + hypre_MPI_Datatype oldtype, hypre_MPI_Datatype *newtype ); +HYPRE_Int hypre_MPI_Type_hvector( HYPRE_Int count, HYPRE_Int blocklength, hypre_MPI_Aint stride, + hypre_MPI_Datatype oldtype, hypre_MPI_Datatype *newtype ); +HYPRE_Int hypre_MPI_Type_struct( HYPRE_Int count, HYPRE_Int *array_of_blocklengths, + hypre_MPI_Aint *array_of_displacements, hypre_MPI_Datatype *array_of_types, + hypre_MPI_Datatype *newtype ); HYPRE_Int hypre_MPI_Type_commit( hypre_MPI_Datatype *datatype ); HYPRE_Int hypre_MPI_Type_free( hypre_MPI_Datatype *datatype ); HYPRE_Int hypre_MPI_Op_free( hypre_MPI_Op *op ); -HYPRE_Int hypre_MPI_Op_create( hypre_MPI_User_function *function , hypre_int commute , hypre_MPI_Op *op ); -#if defined(HYPRE_USING_GPU) -HYPRE_Int hypre_MPI_Comm_split_type(hypre_MPI_Comm comm, HYPRE_Int split_type, HYPRE_Int key, hypre_MPI_Info info, hypre_MPI_Comm *newcomm); +HYPRE_Int hypre_MPI_Op_create( hypre_MPI_User_function *function, hypre_int commute, + hypre_MPI_Op *op ); +#if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) +HYPRE_Int hypre_MPI_Comm_split_type(hypre_MPI_Comm comm, HYPRE_Int split_type, HYPRE_Int key, + hypre_MPI_Info info, hypre_MPI_Comm *newcomm); HYPRE_Int hypre_MPI_Info_create(hypre_MPI_Info *info); HYPRE_Int hypre_MPI_Info_free( hypre_MPI_Info *info ); #endif diff --git a/external/hypre/src/utilities/nvtx.c b/external/hypre/src/utilities/nvtx.c index 6515d456..0b06f966 100644 --- a/external/hypre/src/utilities/nvtx.c +++ b/external/hypre/src/utilities/nvtx.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -9,10 +9,9 @@ #if defined(HYPRE_USING_ROCTX) #include "hip/hip_runtime_api.h" -#include "roctx.h" -#endif +#include "roctracer/roctx.h" -#if defined(HYPRE_USING_NVTX) +#elif defined(HYPRE_USING_NVTX) #include #include @@ -70,7 +69,7 @@ static std::vector hypre_nvtx_range_names; void hypre_GpuProfilingPushRangeColor(const char *name, HYPRE_Int color_id) { -#ifdef HYPRE_USING_NVTX +#if defined (HYPRE_USING_NVTX) color_id = color_id % hypre_nvtx_num_colors; nvtxEventAttributes_t eventAttrib = {0}; eventAttrib.version = NVTX_VERSION; @@ -80,16 +79,19 @@ void hypre_GpuProfilingPushRangeColor(const char *name, HYPRE_Int color_id) eventAttrib.messageType = NVTX_MESSAGE_TYPE_ASCII; eventAttrib.message.ascii = name; nvtxRangePushEx(&eventAttrib); -#endif -#ifdef HYPRE_USING_ROCTX +#elif defined (HYPRE_USING_ROCTX) roctxRangePush(name); + +#else + HYPRE_UNUSED_VAR(name); + HYPRE_UNUSED_VAR(color_id); #endif } void hypre_GpuProfilingPushRange(const char *name) { -#ifdef HYPRE_USING_NVTX +#if defined (HYPRE_USING_NVTX) std::vector::iterator p = std::find(hypre_nvtx_range_names.begin(), hypre_nvtx_range_names.end(), name); @@ -103,23 +105,24 @@ void hypre_GpuProfilingPushRange(const char *name) HYPRE_Int color = p - hypre_nvtx_range_names.begin(); hypre_GpuProfilingPushRangeColor(name, color); -#endif -#ifdef HYPRE_USING_ROCTX +#elif defined (HYPRE_USING_ROCTX) roctxRangePush(name); + +#else + HYPRE_UNUSED_VAR(name); #endif } -void hypre_GpuProfilingPopRange() +void hypre_GpuProfilingPopRange(void) { -#ifdef HYPRE_USING_NVTX +#if defined (HYPRE_USING_NVTX) hypre_GpuProfilingPushRangeColor("StreamSync0", Red); cudaStreamSynchronize(0); nvtxRangePop(); nvtxRangePop(); -#endif -#ifdef HYPRE_USING_ROCTX +#elif defined (HYPRE_USING_ROCTX) roctxRangePush("StreamSync0"); hipStreamSynchronize(0); roctxRangePop(); diff --git a/external/hypre/src/utilities/omp_device.c b/external/hypre/src/utilities/omp_device.c index 25bd957c..e939c534 100644 --- a/external/hypre/src/utilities/omp_device.c +++ b/external/hypre/src/utilities/omp_device.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -38,7 +38,8 @@ HYPRE_OMPOffload(HYPRE_Int device, void *ptr, size_t num, HYPRE_Int HYPRE_OMPPtrIsMapped(void *p, HYPRE_Int device_num) { - if (hypre__global_offload && !omp_target_is_present(p, device_num)) { + if (hypre__global_offload && !omp_target_is_present(p, device_num)) + { printf("HYPRE mapping error: %p has not been mapped to device %d!\n", p, device_num); return 1; } diff --git a/external/hypre/src/utilities/omp_device.h b/external/hypre/src/utilities/omp_device.h index 0e27316c..cd493a2a 100644 --- a/external/hypre/src/utilities/omp_device.h +++ b/external/hypre/src/utilities/omp_device.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -102,11 +102,12 @@ extern size_t hypre__target_dtoh_bytes; } \ } -HYPRE_Int HYPRE_OMPOffload(HYPRE_Int device, void *ptr, size_t num, const char *type1, const char *type2); +HYPRE_Int HYPRE_OMPOffload(HYPRE_Int device, void *ptr, size_t num, const char *type1, + const char *type2); HYPRE_Int HYPRE_OMPPtrIsMapped(void *p, HYPRE_Int device_num); -HYPRE_Int HYPRE_OMPOffloadOn(); -HYPRE_Int HYPRE_OMPOffloadOff(); -HYPRE_Int HYPRE_OMPOffloadStatPrint(); +HYPRE_Int HYPRE_OMPOffloadOn(void); +HYPRE_Int HYPRE_OMPOffloadOff(void); +HYPRE_Int HYPRE_OMPOffloadStatPrint(void); #endif /* HYPRE_USING_DEVICE_OPENMP */ #endif /* HYPRE_OMP_DEVICE_H */ diff --git a/external/hypre/src/utilities/predicates.h b/external/hypre/src/utilities/predicates.h new file mode 100644 index 00000000..0f01d5c9 --- /dev/null +++ b/external/hypre/src/utilities/predicates.h @@ -0,0 +1,43 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#ifndef HYPRE_PREDICATES_H +#define HYPRE_PREDICATES_H + +/****************************************************************************** + * + * Header file defining predicates for thrust used throughout hypre + * + *****************************************************************************/ + +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + +/*-------------------------------------------------------------------------- + * hyprePred_StridedAccess + * + * This struct defines a predicate for strided access in array-like data. + * + * It is used to determine if an element at a given index should be processed + * or not, based on a specified stride. The operator() returns true when the + * index is a multiple of the stride, indicating the element at that index + * is part of the strided subset. + *--------------------------------------------------------------------------*/ + +struct hyprePred_StridedAccess +{ + HYPRE_Int s_; + + hyprePred_StridedAccess(HYPRE_Int s) : s_(s) {} + + __host__ __device__ HYPRE_Int operator()(const HYPRE_Int i) const + { + return (!(i % s_)); + } +}; + +#endif /* if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) */ +#endif /* ifndef HYPRE_PREDICATES_H */ diff --git a/external/hypre/src/utilities/prefix_sum.c b/external/hypre/src/utilities/prefix_sum.c index 6043196f..92dff2cc 100644 --- a/external/hypre/src/utilities/prefix_sum.c +++ b/external/hypre/src/utilities/prefix_sum.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -16,8 +16,8 @@ void hypre_prefix_sum(HYPRE_Int *in_out, HYPRE_Int *sum, HYPRE_Int *workspace) workspace[my_thread_num + 1] = *in_out; -#pragma omp barrier -#pragma omp master + #pragma omp barrier + #pragma omp master { HYPRE_Int i; workspace[0] = 0; @@ -27,7 +27,7 @@ void hypre_prefix_sum(HYPRE_Int *in_out, HYPRE_Int *sum, HYPRE_Int *workspace) } *sum = workspace[num_threads]; } -#pragma omp barrier + #pragma omp barrier *in_out = workspace[my_thread_num]; #else /* !HYPRE_USING_OPENMP */ @@ -39,18 +39,19 @@ void hypre_prefix_sum(HYPRE_Int *in_out, HYPRE_Int *sum, HYPRE_Int *workspace) #endif /* !HYPRE_USING_OPENMP */ } -void hypre_prefix_sum_pair(HYPRE_Int *in_out1, HYPRE_Int *sum1, HYPRE_Int *in_out2, HYPRE_Int *sum2, HYPRE_Int *workspace) +void hypre_prefix_sum_pair(HYPRE_Int *in_out1, HYPRE_Int *sum1, HYPRE_Int *in_out2, HYPRE_Int *sum2, + HYPRE_Int *workspace) { #ifdef HYPRE_USING_OPENMP HYPRE_Int my_thread_num = hypre_GetThreadNum(); HYPRE_Int num_threads = hypre_NumActiveThreads(); hypre_assert(1 == num_threads || omp_in_parallel()); - workspace[(my_thread_num + 1)*2] = *in_out1; - workspace[(my_thread_num + 1)*2 + 1] = *in_out2; + workspace[(my_thread_num + 1) * 2] = *in_out1; + workspace[(my_thread_num + 1) * 2 + 1] = *in_out2; -#pragma omp barrier -#pragma omp master + #pragma omp barrier + #pragma omp master { HYPRE_Int i; workspace[0] = 0; @@ -58,16 +59,16 @@ void hypre_prefix_sum_pair(HYPRE_Int *in_out1, HYPRE_Int *sum1, HYPRE_Int *in_ou for (i = 1; i < num_threads; i++) { - workspace[(i + 1)*2] += workspace[i*2]; - workspace[(i + 1)*2 + 1] += workspace[i*2 + 1]; + workspace[(i + 1) * 2] += workspace[i * 2]; + workspace[(i + 1) * 2 + 1] += workspace[i * 2 + 1]; } - *sum1 = workspace[num_threads*2]; - *sum2 = workspace[num_threads*2 + 1]; + *sum1 = workspace[num_threads * 2]; + *sum2 = workspace[num_threads * 2 + 1]; } -#pragma omp barrier + #pragma omp barrier - *in_out1 = workspace[my_thread_num*2]; - *in_out2 = workspace[my_thread_num*2 + 1]; + *in_out1 = workspace[my_thread_num * 2]; + *in_out2 = workspace[my_thread_num * 2 + 1]; #else /* !HYPRE_USING_OPENMP */ *sum1 = *in_out1; *sum2 = *in_out2; @@ -81,19 +82,20 @@ void hypre_prefix_sum_pair(HYPRE_Int *in_out1, HYPRE_Int *sum1, HYPRE_Int *in_ou #endif /* !HYPRE_USING_OPENMP */ } -void hypre_prefix_sum_triple(HYPRE_Int *in_out1, HYPRE_Int *sum1, HYPRE_Int *in_out2, HYPRE_Int *sum2, HYPRE_Int *in_out3, HYPRE_Int *sum3, HYPRE_Int *workspace) +void hypre_prefix_sum_triple(HYPRE_Int *in_out1, HYPRE_Int *sum1, HYPRE_Int *in_out2, + HYPRE_Int *sum2, HYPRE_Int *in_out3, HYPRE_Int *sum3, HYPRE_Int *workspace) { #ifdef HYPRE_USING_OPENMP HYPRE_Int my_thread_num = hypre_GetThreadNum(); HYPRE_Int num_threads = hypre_NumActiveThreads(); hypre_assert(1 == num_threads || omp_in_parallel()); - workspace[(my_thread_num + 1)*3] = *in_out1; - workspace[(my_thread_num + 1)*3 + 1] = *in_out2; - workspace[(my_thread_num + 1)*3 + 2] = *in_out3; + workspace[(my_thread_num + 1) * 3] = *in_out1; + workspace[(my_thread_num + 1) * 3 + 1] = *in_out2; + workspace[(my_thread_num + 1) * 3 + 2] = *in_out3; -#pragma omp barrier -#pragma omp master + #pragma omp barrier + #pragma omp master { HYPRE_Int i; workspace[0] = 0; @@ -102,19 +104,19 @@ void hypre_prefix_sum_triple(HYPRE_Int *in_out1, HYPRE_Int *sum1, HYPRE_Int *in_ for (i = 1; i < num_threads; i++) { - workspace[(i + 1)*3] += workspace[i*3]; - workspace[(i + 1)*3 + 1] += workspace[i*3 + 1]; - workspace[(i + 1)*3 + 2] += workspace[i*3 + 2]; + workspace[(i + 1) * 3] += workspace[i * 3]; + workspace[(i + 1) * 3 + 1] += workspace[i * 3 + 1]; + workspace[(i + 1) * 3 + 2] += workspace[i * 3 + 2]; } - *sum1 = workspace[num_threads*3]; - *sum2 = workspace[num_threads*3 + 1]; - *sum3 = workspace[num_threads*3 + 2]; + *sum1 = workspace[num_threads * 3]; + *sum2 = workspace[num_threads * 3 + 1]; + *sum3 = workspace[num_threads * 3 + 2]; } -#pragma omp barrier + #pragma omp barrier - *in_out1 = workspace[my_thread_num*3]; - *in_out2 = workspace[my_thread_num*3 + 1]; - *in_out3 = workspace[my_thread_num*3 + 2]; + *in_out1 = workspace[my_thread_num * 3]; + *in_out2 = workspace[my_thread_num * 3 + 1]; + *in_out3 = workspace[my_thread_num * 3 + 2]; #else /* !HYPRE_USING_OPENMP */ *sum1 = *in_out1; *sum2 = *in_out2; @@ -142,11 +144,11 @@ void hypre_prefix_sum_multiple(HYPRE_Int *in_out, HYPRE_Int *sum, HYPRE_Int n, H for (i = 0; i < n; i++) { - workspace[(my_thread_num + 1)*n + i] = in_out[i]; + workspace[(my_thread_num + 1)*n + i] = in_out[i]; } -#pragma omp barrier -#pragma omp master + #pragma omp barrier + #pragma omp master { HYPRE_Int t; for (i = 0; i < n; i++) @@ -159,20 +161,20 @@ void hypre_prefix_sum_multiple(HYPRE_Int *in_out, HYPRE_Int *sum, HYPRE_Int n, H { for (i = 0; i < n; i++) { - workspace[(t + 1)*n + i] += workspace[t*n + i]; + workspace[(t + 1)*n + i] += workspace[t * n + i]; } } for (i = 0; i < n; i++) { - sum[i] = workspace[num_threads*n + i]; + sum[i] = workspace[num_threads * n + i]; } } -#pragma omp barrier + #pragma omp barrier for (i = 0; i < n; i++) { - in_out[i] = workspace[my_thread_num*n + i]; + in_out[i] = workspace[my_thread_num * n + i]; } #else /* !HYPRE_USING_OPENMP */ for (i = 0; i < n; i++) diff --git a/external/hypre/src/utilities/printf.c b/external/hypre/src/utilities/printf.c index 173e5537..7e0531d9 100644 --- a/external/hypre/src/utilities/printf.c +++ b/external/hypre/src/utilities/printf.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -9,6 +9,9 @@ #include #include +#define hypre_printf_buffer_len 4096 +char hypre_printf_buffer[hypre_printf_buffer_len]; + // #ifdef HYPRE_BIGINT /* these prototypes are missing by default for some compilers */ @@ -28,8 +31,16 @@ new_format( const char *format, HYPRE_Int copychar; HYPRE_Int foundpercent = 0; - newformatlen = 2*strlen(format)+1; /* worst case is all %d's to %lld's */ - newformat = hypre_TAlloc(char, newformatlen, HYPRE_MEMORY_HOST); + newformatlen = 2 * strlen(format) + 1; /* worst case is all %d's to %lld's */ + + if (newformatlen > hypre_printf_buffer_len) + { + newformat = hypre_TAlloc(char, newformatlen, HYPRE_MEMORY_HOST); + } + else + { + newformat = hypre_printf_buffer; + } nfp = newformat; for (fp = format; *fp != '\0'; fp++) @@ -49,7 +60,7 @@ new_format( const char *format, fp++; /* remove second 'l' if present */ } } - switch(*fp) + switch (*fp) { case 'b': /* used for BigInt type in hypre */ #if defined(HYPRE_BIGINT) || defined(HYPRE_MIXEDINT) @@ -98,7 +109,7 @@ new_format( const char *format, *newformat_ptr = newformat; -/* printf("\nNEWFORMAT: %s\n", *newformat_ptr);*/ + /* printf("\nNEWFORMAT: %s\n", *newformat_ptr);*/ return 0; } @@ -106,7 +117,10 @@ new_format( const char *format, HYPRE_Int free_format( char *newformat ) { - hypre_TFree(newformat, HYPRE_MEMORY_HOST); + if (newformat != hypre_printf_buffer) + { + hypre_TFree(newformat, HYPRE_MEMORY_HOST); + } return 0; } @@ -116,7 +130,7 @@ hypre_ndigits( HYPRE_BigInt number ) { HYPRE_Int ndigits = 0; - while(number) + while (number) { number /= 10; ndigits++; @@ -140,6 +154,8 @@ hypre_printf( const char *format, ...) free_format(newformat); va_end(ap); + fflush(stdout); + return ierr; } @@ -175,6 +191,22 @@ hypre_sprintf( char *s, const char *format, ...) return ierr; } +HYPRE_Int +hypre_snprintf( char *s, size_t size, const char *format, ...) +{ + va_list ap; + char *newformat; + HYPRE_Int ierr = 0; + + va_start(ap, format); + new_format(format, &newformat); + ierr = vsnprintf(s, size, newformat, ap); + free_format(newformat); + va_end(ap); + + return ierr; +} + /* scanf functions */ HYPRE_Int @@ -225,9 +257,36 @@ hypre_sscanf( char *s, const char *format, ...) return ierr; } +HYPRE_Int +hypre_ParPrintf(MPI_Comm comm, const char *format, ...) +{ + HYPRE_Int my_id; + HYPRE_Int ierr = hypre_MPI_Comm_rank(comm, &my_id); + + if (ierr) + { + return ierr; + } + + if (!my_id) + { + va_list ap; + char *newformat; + + va_start(ap, format); + new_format(format, &newformat); + ierr = vprintf(newformat, ap); + free_format(newformat); + va_end(ap); + + fflush(stdout); + } + + return ierr; +} // #else -// +// // /* this is used only to eliminate compiler warnings */ // HYPRE_Int hypre_printf_empty; -// +// // #endif diff --git a/external/hypre/src/utilities/printf.h b/external/hypre/src/utilities/printf.h index 41b1242c..3741c8fd 100644 --- a/external/hypre/src/utilities/printf.h +++ b/external/hypre/src/utilities/printf.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -13,12 +13,14 @@ /* printf.c */ // #ifdef HYPRE_BIGINT HYPRE_Int hypre_ndigits( HYPRE_BigInt number ); -HYPRE_Int hypre_printf( const char *format , ... ); -HYPRE_Int hypre_fprintf( FILE *stream , const char *format, ... ); -HYPRE_Int hypre_sprintf( char *s , const char *format, ... ); -HYPRE_Int hypre_scanf( const char *format , ... ); -HYPRE_Int hypre_fscanf( FILE *stream , const char *format, ... ); -HYPRE_Int hypre_sscanf( char *s , const char *format, ... ); +HYPRE_Int hypre_printf( const char *format, ... ); +HYPRE_Int hypre_fprintf( FILE *stream, const char *format, ... ); +HYPRE_Int hypre_sprintf( char *s, const char *format, ... ); +HYPRE_Int hypre_snprintf( char *s, size_t size, const char *format, ...); +HYPRE_Int hypre_scanf( const char *format, ... ); +HYPRE_Int hypre_fscanf( FILE *stream, const char *format, ... ); +HYPRE_Int hypre_sscanf( char *s, const char *format, ... ); +HYPRE_Int hypre_ParPrintf(MPI_Comm comm, const char *format, ...); // #else // #define hypre_printf printf // #define hypre_fprintf fprintf diff --git a/external/hypre/src/utilities/protos b/external/hypre/src/utilities/protos old mode 100644 new mode 100755 index 48605c72..1ce068a9 --- a/external/hypre/src/utilities/protos +++ b/external/hypre/src/utilities/protos @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/utilities/protos.h b/external/hypre/src/utilities/protos.h index e1474a0d..0fe65c07 100644 --- a/external/hypre/src/utilities/protos.h +++ b/external/hypre/src/utilities/protos.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -7,14 +7,17 @@ /* amg_linklist.c */ void hypre_dispose_elt ( hypre_LinkList element_ptr ); -void hypre_remove_point ( hypre_LinkList *LoL_head_ptr , hypre_LinkList *LoL_tail_ptr , HYPRE_Int measure , HYPRE_Int index , HYPRE_Int *lists , HYPRE_Int *where ); +void hypre_remove_point ( hypre_LinkList *LoL_head_ptr, hypre_LinkList *LoL_tail_ptr, + HYPRE_Int measure, HYPRE_Int index, HYPRE_Int *lists, HYPRE_Int *where ); hypre_LinkList hypre_create_elt ( HYPRE_Int Item ); -void hypre_enter_on_lists ( hypre_LinkList *LoL_head_ptr , hypre_LinkList *LoL_tail_ptr , HYPRE_Int measure , HYPRE_Int index , HYPRE_Int *lists , HYPRE_Int *where ); +void hypre_enter_on_lists ( hypre_LinkList *LoL_head_ptr, hypre_LinkList *LoL_tail_ptr, + HYPRE_Int measure, HYPRE_Int index, HYPRE_Int *lists, HYPRE_Int *where ); /* binsearch.c */ -HYPRE_Int hypre_BinarySearch ( HYPRE_Int *list , HYPRE_Int value , HYPRE_Int list_length ); -HYPRE_Int hypre_BigBinarySearch ( HYPRE_BigInt *list , HYPRE_BigInt value , HYPRE_Int list_length ); -HYPRE_Int hypre_BinarySearch2 ( HYPRE_Int *list , HYPRE_Int value , HYPRE_Int low , HYPRE_Int high , HYPRE_Int *spot ); +HYPRE_Int hypre_BinarySearch ( HYPRE_Int *list, HYPRE_Int value, HYPRE_Int list_length ); +HYPRE_Int hypre_BigBinarySearch ( HYPRE_BigInt *list, HYPRE_BigInt value, HYPRE_Int list_length ); +HYPRE_Int hypre_BinarySearch2 ( HYPRE_Int *list, HYPRE_Int value, HYPRE_Int low, HYPRE_Int high, + HYPRE_Int *spot ); HYPRE_Int *hypre_LowerBound( HYPRE_Int *first, HYPRE_Int *last, HYPRE_Int value ); HYPRE_BigInt *hypre_BigLowerBound( HYPRE_BigInt *first, HYPRE_BigInt *last, HYPRE_BigInt value ); @@ -27,65 +30,87 @@ HYPRE_Complex hypre_conj( HYPRE_Complex value ); HYPRE_Real hypre_cabs( HYPRE_Complex value ); HYPRE_Real hypre_creal( HYPRE_Complex value ); HYPRE_Real hypre_cimag( HYPRE_Complex value ); +HYPRE_Complex hypre_csqrt( HYPRE_Complex value ); #else #define hypre_conj(value) value -#define hypre_cabs(value) fabs(value) +#define hypre_cabs(value) hypre_abs(value) #define hypre_creal(value) value #define hypre_cimag(value) 0.0 +#define hypre_csqrt(value) hypre_sqrt(value) #endif +/* state.c */ +HYPRE_Int hypre_Initialized( void ); +HYPRE_Int hypre_Finalized( void ); +HYPRE_Int hypre_SetInitialized( void ); +HYPRE_Int hypre_SetFinalized( void ); + /* general.c */ -#ifdef HYPRE_USING_MEMORY_TRACKER -hypre_MemoryTracker* hypre_memory_tracker(); -#endif -hypre_Handle* hypre_handle(); -hypre_Handle* hypre_HandleCreate(); +hypre_Handle* hypre_handle(void); +hypre_Handle* hypre_HandleCreate(void); HYPRE_Int hypre_HandleDestroy(hypre_Handle *hypre_handle_); HYPRE_Int hypre_SetDevice(hypre_int device_id, hypre_Handle *hypre_handle_); HYPRE_Int hypre_GetDevice(hypre_int *device_id); HYPRE_Int hypre_GetDeviceCount(hypre_int *device_count); -HYPRE_Int hypre_GetDeviceLastError(); -HYPRE_Int hypre_UmpireInit(hypre_Handle *hypre_handle_); -HYPRE_Int hypre_UmpireFinalize(hypre_Handle *hypre_handle_); +HYPRE_Int hypre_GetDeviceLastError(void); +HYPRE_Int hypre_GetDeviceMaxShmemSize(hypre_int device_id, hypre_int *max_size_ptr, + hypre_int *max_size_optin_ptr); + +/* matrix_stats.h */ +hypre_MatrixStats* hypre_MatrixStatsCreate( void ); +HYPRE_Int hypre_MatrixStatsDestroy( hypre_MatrixStats *stats ); +hypre_MatrixStatsArray* hypre_MatrixStatsArrayCreate( HYPRE_Int capacity ); +HYPRE_Int hypre_MatrixStatsArrayDestroy( hypre_MatrixStatsArray *stats_array ); +HYPRE_Int hypre_MatrixStatsArrayPrint( HYPRE_Int num_hierarchies, HYPRE_Int *num_levels, + HYPRE_Int use_divisors, HYPRE_Int shift, + const char **messages, + hypre_MatrixStatsArray *stats_array ); /* qsort.c */ -void hypre_swap ( HYPRE_Int *v , HYPRE_Int i , HYPRE_Int j ); -void hypre_swap_c ( HYPRE_Complex *v , HYPRE_Int i , HYPRE_Int j ); -void hypre_swap2 ( HYPRE_Int *v , HYPRE_Real *w , HYPRE_Int i , HYPRE_Int j ); -void hypre_BigSwap2 ( HYPRE_BigInt *v , HYPRE_Real *w , HYPRE_Int i , HYPRE_Int j ); -void hypre_swap2i ( HYPRE_Int *v , HYPRE_Int *w , HYPRE_Int i , HYPRE_Int j ); -void hypre_BigSwap2i ( HYPRE_BigInt *v , HYPRE_Int *w , HYPRE_Int i , HYPRE_Int j ); -void hypre_swap3i ( HYPRE_Int *v , HYPRE_Int *w , HYPRE_Int *z , HYPRE_Int i , HYPRE_Int j ); -void hypre_swap3_d ( HYPRE_Real *v , HYPRE_Int *w , HYPRE_Int *z , HYPRE_Int i , HYPRE_Int j ); +void hypre_swap ( HYPRE_Int *v, HYPRE_Int i, HYPRE_Int j ); +void hypre_swap_c ( HYPRE_Complex *v, HYPRE_Int i, HYPRE_Int j ); +void hypre_swap2 ( HYPRE_Int *v, HYPRE_Real *w, HYPRE_Int i, HYPRE_Int j ); +void hypre_BigSwap2 ( HYPRE_BigInt *v, HYPRE_Real *w, HYPRE_Int i, HYPRE_Int j ); +void hypre_swap2i ( HYPRE_Int *v, HYPRE_Int *w, HYPRE_Int i, HYPRE_Int j ); +void hypre_BigSwap2i ( HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int i, HYPRE_Int j ); +void hypre_swap3i ( HYPRE_Int *v, HYPRE_Int *w, HYPRE_Int *z, HYPRE_Int i, HYPRE_Int j ); +void hypre_swap3_d ( HYPRE_Real *v, HYPRE_Int *w, HYPRE_Int *z, HYPRE_Int i, HYPRE_Int j ); void hypre_swap3_d_perm(HYPRE_Int *v, HYPRE_Real *w, HYPRE_Int *z, HYPRE_Int i, HYPRE_Int j ); -void hypre_BigSwap4_d ( HYPRE_Real *v , HYPRE_BigInt *w , HYPRE_Int *z , HYPRE_Int *y , HYPRE_Int i , HYPRE_Int j ); -void hypre_swap_d ( HYPRE_Real *v , HYPRE_Int i , HYPRE_Int j ); -void hypre_qsort0 ( HYPRE_Int *v , HYPRE_Int left , HYPRE_Int right ); -void hypre_qsort1 ( HYPRE_Int *v , HYPRE_Real *w , HYPRE_Int left , HYPRE_Int right ); -void hypre_BigQsort1 ( HYPRE_BigInt *v , HYPRE_Real *w , HYPRE_Int left , HYPRE_Int right ); -void hypre_qsort2i ( HYPRE_Int *v , HYPRE_Int *w , HYPRE_Int left , HYPRE_Int right ); +void hypre_BigSwap4_d ( HYPRE_Real *v, HYPRE_BigInt *w, HYPRE_Int *z, HYPRE_Int *y, HYPRE_Int i, + HYPRE_Int j ); +void hypre_swap_d ( HYPRE_Real *v, HYPRE_Int i, HYPRE_Int j ); +void hypre_qsort0 ( HYPRE_Int *v, HYPRE_Int left, HYPRE_Int right ); +void hypre_qsort1 ( HYPRE_Int *v, HYPRE_Real *w, HYPRE_Int left, HYPRE_Int right ); +void hypre_BigQsort1 ( HYPRE_BigInt *v, HYPRE_Real *w, HYPRE_Int left, HYPRE_Int right ); +void hypre_qsort2i ( HYPRE_Int *v, HYPRE_Int *w, HYPRE_Int left, HYPRE_Int right ); void hypre_BigQsort2i( HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int left, HYPRE_Int right ); -void hypre_qsort2 ( HYPRE_Int *v , HYPRE_Real *w , HYPRE_Int left , HYPRE_Int right ); -void hypre_qsort2_abs ( HYPRE_Int *v , HYPRE_Real *w , HYPRE_Int left , HYPRE_Int right ); -void hypre_qsort3i ( HYPRE_Int *v , HYPRE_Int *w , HYPRE_Int *z , HYPRE_Int left , HYPRE_Int right ); -void hypre_qsort3ir ( HYPRE_Int *v , HYPRE_Real *w , HYPRE_Int *z , HYPRE_Int left , HYPRE_Int right ); +void hypre_qsort2 ( HYPRE_Int *v, HYPRE_Real *w, HYPRE_Int left, HYPRE_Int right ); +void hypre_qsort2_abs ( HYPRE_Int *v, HYPRE_Real *w, HYPRE_Int left, HYPRE_Int right ); +void hypre_qsort3i ( HYPRE_Int *v, HYPRE_Int *w, HYPRE_Int *z, HYPRE_Int left, HYPRE_Int right ); +void hypre_qsort3ir ( HYPRE_Int *v, HYPRE_Real *w, HYPRE_Int *z, HYPRE_Int left, HYPRE_Int right ); void hypre_qsort3( HYPRE_Real *v, HYPRE_Int *w, HYPRE_Int *z, HYPRE_Int left, HYPRE_Int right ); -void hypre_qsort3_abs ( HYPRE_Real *v , HYPRE_Int *w , HYPRE_Int *z , HYPRE_Int left , HYPRE_Int right ); -void hypre_BigQsort4_abs ( HYPRE_Real *v , HYPRE_BigInt *w , HYPRE_Int *z , HYPRE_Int *y , HYPRE_Int left , HYPRE_Int right ); -void hypre_qsort_abs ( HYPRE_Real *w , HYPRE_Int left , HYPRE_Int right ); +void hypre_qsort3_abs ( HYPRE_Real *v, HYPRE_Int *w, HYPRE_Int *z, HYPRE_Int left, + HYPRE_Int right ); +void hypre_BigQsort4_abs ( HYPRE_Real *v, HYPRE_BigInt *w, HYPRE_Int *z, HYPRE_Int *y, + HYPRE_Int left, HYPRE_Int right ); +void hypre_qsort_abs ( HYPRE_Real *w, HYPRE_Int left, HYPRE_Int right ); void hypre_BigSwapbi(HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int i, HYPRE_Int j ); void hypre_BigQsortbi( HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int left, HYPRE_Int right ); void hypre_BigSwapLoc(HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int i, HYPRE_Int j ); void hypre_BigQsortbLoc( HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int left, HYPRE_Int right ); void hypre_BigSwapb2i(HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int *z, HYPRE_Int i, HYPRE_Int j ); -void hypre_BigQsortb2i( HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int *z, HYPRE_Int left, HYPRE_Int right ); +void hypre_BigQsortb2i( HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int *z, HYPRE_Int left, + HYPRE_Int right ); void hypre_BigSwap( HYPRE_BigInt *v, HYPRE_Int i, HYPRE_Int j ); void hypre_BigQsort0( HYPRE_BigInt *v, HYPRE_Int left, HYPRE_Int right ); -void hypre_topo_sort(const HYPRE_Int *row_ptr, const HYPRE_Int *col_inds, const HYPRE_Complex *data, HYPRE_Int *ordering, HYPRE_Int n); -void hypre_dense_topo_sort(const HYPRE_Complex *L, HYPRE_Int *ordering, HYPRE_Int n, HYPRE_Int is_col_major); +void hypre_topo_sort(const HYPRE_Int *row_ptr, const HYPRE_Int *col_inds, const HYPRE_Complex *data, + HYPRE_Int *ordering, HYPRE_Int n); +void hypre_dense_topo_sort(const HYPRE_Complex *L, HYPRE_Int *ordering, HYPRE_Int n, + HYPRE_Int is_col_major); /* qsplit.c */ -HYPRE_Int hypre_DoubleQuickSplit ( HYPRE_Real *values , HYPRE_Int *indices , HYPRE_Int list_length , HYPRE_Int NumberKept ); +HYPRE_Int hypre_DoubleQuickSplit ( HYPRE_Real *values, HYPRE_Int *indices, HYPRE_Int list_length, + HYPRE_Int NumberKept ); /* random.c */ /* HYPRE_CUDA_GLOBAL */ void hypre_SeedRand ( HYPRE_Int seed ); @@ -113,12 +138,14 @@ void hypre_prefix_sum(HYPRE_Int *in_out, HYPRE_Int *sum, HYPRE_Int *workspace); * workspace[2*tid] and workspace[2*tid+1] will contain results for tid * workspace[3*nthreads] and workspace[3*nthreads + 1] will contain sums */ -void hypre_prefix_sum_pair(HYPRE_Int *in_out1, HYPRE_Int *sum1, HYPRE_Int *in_out2, HYPRE_Int *sum2, HYPRE_Int *workspace); +void hypre_prefix_sum_pair(HYPRE_Int *in_out1, HYPRE_Int *sum1, HYPRE_Int *in_out2, HYPRE_Int *sum2, + HYPRE_Int *workspace); /** * @param workspace at least with length 3*(nthreads+1) * workspace[3*tid:3*tid+3) will contain results for tid */ -void hypre_prefix_sum_triple(HYPRE_Int *in_out1, HYPRE_Int *sum1, HYPRE_Int *in_out2, HYPRE_Int *sum2, HYPRE_Int *in_out3, HYPRE_Int *sum3, HYPRE_Int *workspace); +void hypre_prefix_sum_triple(HYPRE_Int *in_out1, HYPRE_Int *sum1, HYPRE_Int *in_out2, + HYPRE_Int *sum2, HYPRE_Int *in_out3, HYPRE_Int *sum3, HYPRE_Int *workspace); /** * n prefix-sums together. @@ -127,7 +154,8 @@ void hypre_prefix_sum_triple(HYPRE_Int *in_out1, HYPRE_Int *sum1, HYPRE_Int *in_ * * @param workspace at least with length n*(nthreads+1) */ -void hypre_prefix_sum_multiple(HYPRE_Int *in_out, HYPRE_Int *sum, HYPRE_Int n, HYPRE_Int *workspace); +void hypre_prefix_sum_multiple(HYPRE_Int *in_out, HYPRE_Int *sum, HYPRE_Int n, + HYPRE_Int *workspace); /* hopscotch_hash.c */ @@ -146,7 +174,7 @@ void hypre_prefix_sum_multiple(HYPRE_Int *in_out, HYPRE_Int *sum, HYPRE_Int n, H #endif // HYPRE_USING_OPENMP -#ifdef HYPRE_HOPSCOTCH +#ifdef HYPRE_USING_HOPSCOTCH #ifdef HYPRE_USING_ATOMIC // concurrent hopscotch hashing is possible only with atomic supports #define HYPRE_CONCURRENT_HOPSCOTCH @@ -156,8 +184,8 @@ void hypre_prefix_sum_multiple(HYPRE_Int *in_out, HYPRE_Int *sum, HYPRE_Int n, H #ifdef HYPRE_CONCURRENT_HOPSCOTCH typedef struct { - HYPRE_Int volatile timestamp; - omp_lock_t lock; + HYPRE_Int volatile timestamp; + omp_lock_t lock; } hypre_HopscotchSegment; #endif @@ -197,18 +225,18 @@ typedef struct typedef struct { - hypre_uint volatile hopInfo; - HYPRE_Int volatile hash; - HYPRE_Int volatile key; - HYPRE_Int volatile data; + hypre_uint volatile hopInfo; + HYPRE_Int volatile hash; + HYPRE_Int volatile key; + HYPRE_Int volatile data; } hypre_HopscotchBucket; typedef struct { - hypre_uint volatile hopInfo; - HYPRE_BigInt volatile hash; - HYPRE_BigInt volatile key; - HYPRE_Int volatile data; + hypre_uint volatile hopInfo; + HYPRE_BigInt volatile hash; + HYPRE_BigInt volatile key; + HYPRE_Int volatile data; } hypre_BigHopscotchBucket; /** @@ -243,49 +271,124 @@ typedef struct * 1) Merge sort can take advantage of eliminating duplicates. * 2) Merge sort is more efficiently parallelizable than qsort */ -HYPRE_Int hypre_MergeOrderedArrays( HYPRE_Int size1 , HYPRE_Int *array1 , HYPRE_Int size2 , HYPRE_Int *array2 , HYPRE_Int *size3_ptr , HYPRE_Int **array3_ptr); -void hypre_union2(HYPRE_Int n1, HYPRE_BigInt *arr1, HYPRE_Int n2, HYPRE_BigInt *arr2, HYPRE_Int *n3, HYPRE_BigInt *arr3, HYPRE_Int *map1, HYPRE_Int *map2); +HYPRE_Int hypre_IntArrayMergeOrdered( hypre_IntArray *array1, hypre_IntArray *array2, + hypre_IntArray *array3 ); +void hypre_union2(HYPRE_Int n1, HYPRE_BigInt *arr1, HYPRE_Int n2, HYPRE_BigInt *arr2, HYPRE_Int *n3, + HYPRE_BigInt *arr3, HYPRE_Int *map1, HYPRE_Int *map2); void hypre_merge_sort(HYPRE_Int *in, HYPRE_Int *temp, HYPRE_Int len, HYPRE_Int **sorted); -void hypre_big_merge_sort(HYPRE_BigInt *in, HYPRE_BigInt *temp, HYPRE_Int len, HYPRE_BigInt **sorted); -void hypre_sort_and_create_inverse_map(HYPRE_Int *in, HYPRE_Int len, HYPRE_Int **out, hypre_UnorderedIntMap *inverse_map); -void hypre_big_sort_and_create_inverse_map(HYPRE_BigInt *in, HYPRE_Int len, HYPRE_BigInt **out, hypre_UnorderedBigIntMap *inverse_map); +void hypre_big_merge_sort(HYPRE_BigInt *in, HYPRE_BigInt *temp, HYPRE_Int len, + HYPRE_BigInt **sorted); +void hypre_sort_and_create_inverse_map(HYPRE_Int *in, HYPRE_Int len, HYPRE_Int **out, + hypre_UnorderedIntMap *inverse_map); +void hypre_big_sort_and_create_inverse_map(HYPRE_BigInt *in, HYPRE_Int len, HYPRE_BigInt **out, + hypre_UnorderedBigIntMap *inverse_map); +/* device_utils.c */ #if defined(HYPRE_USING_GPU) -HYPRE_Int hypre_SyncCudaComputeStream(hypre_Handle *hypre_handle); -HYPRE_Int hypre_SyncCudaDevice(hypre_Handle *hypre_handle); -HYPRE_Int hypre_ResetCudaDevice(hypre_Handle *hypre_handle); -HYPRE_Int hypreDevice_DiagScaleVector(HYPRE_Int n, HYPRE_Int *A_i, HYPRE_Complex *A_data, HYPRE_Complex *x, HYPRE_Complex beta, HYPRE_Complex *y); -HYPRE_Int hypreDevice_DiagScaleVector2(HYPRE_Int n, HYPRE_Int *A_i, HYPRE_Complex *A_data, HYPRE_Complex *x, HYPRE_Complex beta, HYPRE_Complex *y, HYPRE_Complex *z); +HYPRE_Int hypre_DeviceMemoryGetUsage(HYPRE_Real *mem); +HYPRE_Int hypre_ForceSyncComputeStream(); +HYPRE_Int hypre_SyncComputeStream(); +HYPRE_Int hypre_SyncDevice(); +HYPRE_Int hypre_ResetDevice(); + +HYPRE_Int hypreDevice_DiagScaleVector(HYPRE_Int num_vectors, HYPRE_Int num_rows, + HYPRE_Int *A_i, HYPRE_Complex *A_data, + HYPRE_Complex *x, HYPRE_Complex beta, + HYPRE_Complex *y); +HYPRE_Int hypreDevice_DiagScaleVector2(HYPRE_Int num_vectors, HYPRE_Int num_rows, + HYPRE_Complex *diag, HYPRE_Complex *x, + HYPRE_Complex beta, HYPRE_Complex *y, + HYPRE_Complex *z, HYPRE_Int computeY); +HYPRE_Int hypreDevice_ComplexArrayToArrayOfPtrs(HYPRE_Int n, HYPRE_Int m, + HYPRE_Complex *data, HYPRE_Complex **data_aop); +HYPRE_Int hypreDevice_zeqxmydd(HYPRE_Int n, HYPRE_Complex *x, HYPRE_Complex alpha, + HYPRE_Complex *y, HYPRE_Complex *z, HYPRE_Complex *d); HYPRE_Int hypreDevice_IVAXPY(HYPRE_Int n, HYPRE_Complex *a, HYPRE_Complex *x, HYPRE_Complex *y); -HYPRE_Int hypreDevice_IVAXPYMarked(HYPRE_Int n, HYPRE_Complex *a, HYPRE_Complex *x, HYPRE_Complex *y, HYPRE_Int *marker, HYPRE_Int marker_val); +HYPRE_Int hypreDevice_IVAXPYMarked(HYPRE_Int n, HYPRE_Complex *a, HYPRE_Complex *x, + HYPRE_Complex *y, HYPRE_Int *marker, HYPRE_Int marker_val); +HYPRE_Int hypreDevice_IVAMXPMY(HYPRE_Int m, HYPRE_Int n, HYPRE_Complex *a, + HYPRE_Complex *x, HYPRE_Complex *y); +HYPRE_Int hypreDevice_IntFilln(HYPRE_Int *d_x, size_t n, HYPRE_Int v); HYPRE_Int hypreDevice_BigIntFilln(HYPRE_BigInt *d_x, size_t n, HYPRE_BigInt v); -HYPRE_Int hypreDevice_Filln(HYPRE_Complex *d_x, size_t n, HYPRE_Complex v); -HYPRE_Int hypreDevice_Scalen(HYPRE_Complex *d_x, size_t n, HYPRE_Complex v); +HYPRE_Int hypreDevice_ComplexFilln(HYPRE_Complex *d_x, size_t n, HYPRE_Complex v); +HYPRE_Int hypreDevice_CharFilln(char *d_x, size_t n, char v); +HYPRE_Int hypreDevice_IntStridedCopy ( HYPRE_Int size, HYPRE_Int stride, + HYPRE_Int *in, HYPRE_Int *out ); +HYPRE_Int hypreDevice_ComplexStridedCopy ( HYPRE_Int size, HYPRE_Int stride, + HYPRE_Complex *in, HYPRE_Complex *out ); +HYPRE_Int hypreDevice_IntScalen(HYPRE_Int *d_x, size_t n, HYPRE_Int *d_y, HYPRE_Int v); +HYPRE_Int hypreDevice_ComplexScalen(HYPRE_Complex *d_x, size_t n, HYPRE_Complex *d_y, + HYPRE_Complex v); +HYPRE_Int hypreDevice_ComplexAxpyn(HYPRE_Complex *d_x, size_t n, HYPRE_Complex *d_y, + HYPRE_Complex *d_z, HYPRE_Complex a); +HYPRE_Int hypreDevice_ComplexAxpyzn(HYPRE_Int n, HYPRE_Complex *d_x, HYPRE_Complex *d_y, + HYPRE_Complex *d_z, HYPRE_Complex a, HYPRE_Complex b); +HYPRE_Int hypreDevice_IntAxpyn(HYPRE_Int *d_x, size_t n, HYPRE_Int *d_y, HYPRE_Int *d_z, + HYPRE_Int a); +HYPRE_Int hypreDevice_BigIntAxpyn(HYPRE_BigInt *d_x, size_t n, HYPRE_BigInt *d_y, + HYPRE_BigInt *d_z, HYPRE_BigInt a); +HYPRE_Int* hypreDevice_CsrRowPtrsToIndices(HYPRE_Int nrows, HYPRE_Int nnz, HYPRE_Int *d_row_ptr); +HYPRE_Int hypreDevice_CsrRowPtrsToIndices_v2(HYPRE_Int nrows, HYPRE_Int nnz, HYPRE_Int *d_row_ptr, + HYPRE_Int *d_row_ind); +HYPRE_Int* hypreDevice_CsrRowIndicesToPtrs(HYPRE_Int nrows, HYPRE_Int nnz, HYPRE_Int *d_row_ind); +HYPRE_Int hypreDevice_CsrRowIndicesToPtrs_v2(HYPRE_Int nrows, HYPRE_Int nnz, HYPRE_Int *d_row_ind, + HYPRE_Int *d_row_ptr); +HYPRE_Int hypreDevice_GetRowNnz(HYPRE_Int nrows, HYPRE_Int *d_row_indices, HYPRE_Int *d_diag_ia, + HYPRE_Int *d_offd_ia, HYPRE_Int *d_rownnz); +HYPRE_Int hypreDevice_CopyParCSRRows(HYPRE_Int nrows, HYPRE_Int *d_row_indices, HYPRE_Int job, + HYPRE_Int has_offd, HYPRE_BigInt first_col, + HYPRE_BigInt *d_col_map_offd_A, HYPRE_Int *d_diag_i, + HYPRE_Int *d_diag_j, HYPRE_Complex *d_diag_a, + HYPRE_Int *d_offd_i, HYPRE_Int *d_offd_j, + HYPRE_Complex *d_offd_a, HYPRE_Int *d_ib, + HYPRE_BigInt *d_jb, HYPRE_Complex *d_ab); +HYPRE_Int hypreDevice_IntegerReduceSum(HYPRE_Int m, HYPRE_Int *d_i); +HYPRE_Complex hypreDevice_ComplexReduceSum(HYPRE_Int m, HYPRE_Complex *d_x); +HYPRE_Int hypreDevice_IntegerInclusiveScan(HYPRE_Int n, HYPRE_Int *d_i); +HYPRE_Int hypreDevice_IntegerExclusiveScan(HYPRE_Int n, HYPRE_Int *d_i); +HYPRE_Int hypre_CudaCompileFlagCheck(void); #endif -HYPRE_Int hypre_CurandUniform( HYPRE_Int n, HYPRE_Real *urand, HYPRE_Int set_seed, hypre_ulonglongint seed, HYPRE_Int set_offset, hypre_ulonglongint offset); -HYPRE_Int hypre_CurandUniformSingle( HYPRE_Int n, float *urand, HYPRE_Int set_seed, hypre_ulonglongint seed, HYPRE_Int set_offset, hypre_ulonglongint offset); +HYPRE_Int hypre_CurandUniform( HYPRE_Int n, HYPRE_Real *urand, HYPRE_Int set_seed, + hypre_ulonglongint seed, HYPRE_Int set_offset, hypre_ulonglongint offset); +HYPRE_Int hypre_CurandUniformSingle( HYPRE_Int n, float *urand, HYPRE_Int set_seed, + hypre_ulonglongint seed, HYPRE_Int set_offset, hypre_ulonglongint offset); + +HYPRE_Int hypre_ResetDeviceRandGenerator( hypre_ulonglongint seed, hypre_ulonglongint offset ); +HYPRE_Int hypre_bind_device_id(HYPRE_Int device_id_in, HYPRE_Int myid, + HYPRE_Int nproc, MPI_Comm comm); HYPRE_Int hypre_bind_device(HYPRE_Int myid, HYPRE_Int nproc, MPI_Comm comm); +/* stl_ops.c */ +HYPRE_Int hypre_IntSequence(HYPRE_MemoryLocation memory_location, HYPRE_Int size, HYPRE_Int *data); + /* nvtx.c */ void hypre_GpuProfilingPushRangeColor(const char *name, HYPRE_Int cid); void hypre_GpuProfilingPushRange(const char *name); -void hypre_GpuProfilingPopRange(); +void hypre_GpuProfilingPopRange(void); /* utilities.c */ HYPRE_Int hypre_multmod(HYPRE_Int a, HYPRE_Int b, HYPRE_Int mod); void hypre_partition1D(HYPRE_Int n, HYPRE_Int p, HYPRE_Int j, HYPRE_Int *s, HYPRE_Int *e); char *hypre_strcpy(char *destination, const char *source); +HYPRE_Int hypre_CheckDirExists(const char *path); +HYPRE_Int hypre_CreateDir(const char *path); +HYPRE_Int hypre_CreateNextDirOfSequence(const char *basepath, const char *prefix, + char **fullpath_ptr); +char* hypre_ConvertIndicesToString(HYPRE_Int size, HYPRE_Int *indices); HYPRE_Int hypre_SetSyncCudaCompute(HYPRE_Int action); -HYPRE_Int hypre_RestoreSyncCudaCompute(); +HYPRE_Int hypre_RestoreSyncCudaCompute(void); HYPRE_Int hypre_GetSyncCudaCompute(HYPRE_Int *cuda_compute_stream_sync_ptr); -HYPRE_Int hypre_SyncCudaComputeStream(hypre_Handle *hypre_handle); /* handle.c */ -HYPRE_Int hypre_SetSpGemmUseCusparse( HYPRE_Int use_cusparse ); +HYPRE_Int hypre_SetLogLevel( HYPRE_Int log_level ); +HYPRE_Int hypre_SetSpTransUseVendor( HYPRE_Int use_vendor ); +HYPRE_Int hypre_SetSpMVUseVendor( HYPRE_Int use_vendor ); +HYPRE_Int hypre_SetSpGemmUseVendor( HYPRE_Int use_vendor ); HYPRE_Int hypre_SetSpGemmAlgorithm( HYPRE_Int value ); +HYPRE_Int hypre_SetSpGemmBinned( HYPRE_Int value ); HYPRE_Int hypre_SetSpGemmRownnzEstimateMethod( HYPRE_Int value ); HYPRE_Int hypre_SetSpGemmRownnzEstimateNSamples( HYPRE_Int value ); HYPRE_Int hypre_SetSpGemmRownnzEstimateMultFactor( HYPRE_Real value ); @@ -294,13 +397,76 @@ HYPRE_Int hypre_SetUseGpuRand( HYPRE_Int use_gpurand ); HYPRE_Int hypre_SetGaussSeidelMethod( HYPRE_Int gs_method ); HYPRE_Int hypre_SetUserDeviceMalloc(GPUMallocFunc func); HYPRE_Int hypre_SetUserDeviceMfree(GPUMfreeFunc func); +HYPRE_Int hypre_SetGpuAwareMPI( HYPRE_Int use_gpu_aware_mpi ); +HYPRE_Int hypre_GetGpuAwareMPI(void); /* int_array.c */ hypre_IntArray* hypre_IntArrayCreate( HYPRE_Int size ); HYPRE_Int hypre_IntArrayDestroy( hypre_IntArray *array ); -HYPRE_Int hypre_IntArrayInitialize_v2( hypre_IntArray *array, HYPRE_MemoryLocation memory_location ); +HYPRE_Int hypre_IntArrayInitialize_v2( hypre_IntArray *array, + HYPRE_MemoryLocation memory_location ); HYPRE_Int hypre_IntArrayInitialize( hypre_IntArray *array ); HYPRE_Int hypre_IntArrayCopy( hypre_IntArray *x, hypre_IntArray *y ); -hypre_IntArray* hypre_IntArrayCloneDeep_v2( hypre_IntArray *x, HYPRE_MemoryLocation memory_location ); +hypre_IntArray* hypre_IntArrayCloneDeep_v2( hypre_IntArray *x, + HYPRE_MemoryLocation memory_location ); hypre_IntArray* hypre_IntArrayCloneDeep( hypre_IntArray *x ); +HYPRE_Int hypre_IntArrayMigrate( hypre_IntArray *v, HYPRE_MemoryLocation memory_location ); +HYPRE_Int hypre_IntArrayPrint( MPI_Comm comm, hypre_IntArray *array, const char *filename ); +HYPRE_Int hypre_IntArrayRead( MPI_Comm comm, const char *filename, hypre_IntArray **array_ptr ); +HYPRE_Int hypre_IntArraySetConstantValuesHost( hypre_IntArray *v, HYPRE_Int value ); HYPRE_Int hypre_IntArraySetConstantValues( hypre_IntArray *v, HYPRE_Int value ); +HYPRE_Int hypre_IntArraySetInterleavedValues( hypre_IntArray *v, HYPRE_Int cycle ); +HYPRE_Int hypre_IntArrayCountHost( hypre_IntArray *v, HYPRE_Int value, + HYPRE_Int *num_values_ptr ); +HYPRE_Int hypre_IntArrayCount( hypre_IntArray *v, HYPRE_Int value, + HYPRE_Int *num_values_ptr ); +HYPRE_Int hypre_IntArrayInverseMapping( hypre_IntArray *v, hypre_IntArray **w_ptr ); +HYPRE_Int hypre_IntArrayNegate( hypre_IntArray *v ); +HYPRE_Int hypre_IntArraySeparateByValue( HYPRE_Int num_values, HYPRE_Int *values, + HYPRE_Int *sizes, hypre_IntArray *v, + hypre_IntArrayArray **w_ptr ); +hypre_IntArrayArray* hypre_IntArrayArrayCreate( HYPRE_Int num_entries, HYPRE_Int *sizes ); +HYPRE_Int hypre_IntArrayArrayDestroy( hypre_IntArrayArray *w ); +HYPRE_Int hypre_IntArrayArrayInitializeIn( hypre_IntArrayArray *w, + HYPRE_MemoryLocation memory_location ); +HYPRE_Int hypre_IntArrayArrayInitialize( hypre_IntArrayArray *w ); +HYPRE_Int hypre_IntArrayArrayMigrate( hypre_IntArrayArray *w, + HYPRE_MemoryLocation memory_location ); + +/* int_array_device.c */ +#if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) +HYPRE_Int hypre_IntArraySetConstantValuesDevice( hypre_IntArray *v, HYPRE_Int value ); +HYPRE_Int hypre_IntArrayCountDevice ( hypre_IntArray *v, HYPRE_Int value, + HYPRE_Int *num_values_ptr ); +HYPRE_Int hypre_IntArrayInverseMappingDevice( hypre_IntArray *v, hypre_IntArray *w ); +HYPRE_Int hypre_IntArrayNegateDevice( hypre_IntArray *v ); +HYPRE_Int hypre_IntArraySetInterleavedValuesDevice( hypre_IntArray *v, HYPRE_Int cycle ); +HYPRE_Int hypre_IntArraySeparateByValueDevice( HYPRE_Int num_values, HYPRE_Int *values, + HYPRE_Int *sizes, hypre_IntArray *v, + hypre_IntArrayArray *w ); +#endif + +/* memory_tracker.c */ +#ifdef HYPRE_USING_MEMORY_TRACKER +hypre_MemoryTracker* hypre_memory_tracker(void); +hypre_MemoryTracker * hypre_MemoryTrackerCreate(void); +void hypre_MemoryTrackerDestroy(hypre_MemoryTracker *tracker); +void hypre_MemoryTrackerInsert1(const char *action, void *ptr, size_t nbytes, + hypre_MemoryLocation memory_location, const char *filename, + const char *function, HYPRE_Int line); +void hypre_MemoryTrackerInsert2(const char *action, void *ptr, void *ptr2, size_t nbytes, + hypre_MemoryLocation memory_location, + hypre_MemoryLocation memory_location2, + const char *filename, + const char *function, HYPRE_Int line); +HYPRE_Int hypre_PrintMemoryTracker( size_t *totl_bytes_o, size_t *peak_bytes_o, + size_t *curr_bytes_o, HYPRE_Int do_print, const char *fname ); +HYPRE_Int hypre_MemoryTrackerSetPrint(HYPRE_Int do_print); +HYPRE_Int hypre_MemoryTrackerSetFileName(const char *file_name); +#endif + +/* magma.c */ +#if defined(HYPRE_USING_MAGMA) +HYPRE_Int hypre_MagmaInitialize(void); +HYPRE_Int hypre_MagmaFinalize(void); +#endif diff --git a/external/hypre/src/utilities/qsort.c b/external/hypre/src/utilities/qsort.c index 7a8d564c..1b03d00a 100644 --- a/external/hypre/src/utilities/qsort.c +++ b/external/hypre/src/utilities/qsort.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -232,9 +232,9 @@ void hypre_qsort0( HYPRE_Int *v, { return; } - hypre_swap(v, left, (left+right)/2); + hypre_swap(v, left, (left + right) / 2); last = left; - for (i = left+1; i <= right; i++) + for (i = left + 1; i <= right; i++) { if (v[i] < v[left]) { @@ -242,8 +242,8 @@ void hypre_qsort0( HYPRE_Int *v, } } hypre_swap(v, left, last); - hypre_qsort0(v, left, last-1); - hypre_qsort0(v, last+1, right); + hypre_qsort0(v, left, last - 1); + hypre_qsort0(v, last + 1, right); } /*-------------------------------------------------------------------------- @@ -260,9 +260,9 @@ void hypre_qsort1( HYPRE_Int *v, { return; } - hypre_swap2( v, w, left, (left+right)/2); + hypre_swap2( v, w, left, (left + right) / 2); last = left; - for (i = left+1; i <= right; i++) + for (i = left + 1; i <= right; i++) { if (v[i] < v[left]) { @@ -270,8 +270,8 @@ void hypre_qsort1( HYPRE_Int *v, } } hypre_swap2(v, w, left, last); - hypre_qsort1(v, w, left, last-1); - hypre_qsort1(v, w, last+1, right); + hypre_qsort1(v, w, left, last - 1); + hypre_qsort1(v, w, last + 1, right); } /*-------------------------------------------------------------------------- @@ -288,9 +288,9 @@ void hypre_BigQsort1( HYPRE_BigInt *v, { return; } - hypre_BigSwap2(v, w, left, (left+right)/2); + hypre_BigSwap2(v, w, left, (left + right) / 2); last = left; - for (i = left+1; i <= right; i++) + for (i = left + 1; i <= right; i++) { if (v[i] < v[left]) { @@ -298,8 +298,8 @@ void hypre_BigQsort1( HYPRE_BigInt *v, } } hypre_BigSwap2(v, w, left, last); - hypre_BigQsort1(v, w, left, last-1); - hypre_BigQsort1(v, w, last+1, right); + hypre_BigQsort1(v, w, left, last - 1); + hypre_BigQsort1(v, w, last + 1, right); } /*-------------------------------------------------------------------------- @@ -316,9 +316,9 @@ void hypre_qsort2i( HYPRE_Int *v, { return; } - hypre_swap2i( v, w, left, (left+right)/2); + hypre_swap2i( v, w, left, (left + right) / 2); last = left; - for (i = left+1; i <= right; i++) + for (i = left + 1; i <= right; i++) { if (v[i] < v[left]) { @@ -326,17 +326,17 @@ void hypre_qsort2i( HYPRE_Int *v, } } hypre_swap2i(v, w, left, last); - hypre_qsort2i(v, w, left, last-1); - hypre_qsort2i(v, w, last+1, right); + hypre_qsort2i(v, w, left, last - 1); + hypre_qsort2i(v, w, last + 1, right); } /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ void hypre_BigQsort2i( HYPRE_BigInt *v, - HYPRE_Int *w, - HYPRE_Int left, - HYPRE_Int right ) + HYPRE_Int *w, + HYPRE_Int left, + HYPRE_Int right ) { HYPRE_Int i, last; @@ -344,9 +344,9 @@ void hypre_BigQsort2i( HYPRE_BigInt *v, { return; } - hypre_BigSwap2i( v, w, left, (left+right)/2); + hypre_BigSwap2i( v, w, left, (left + right) / 2); last = left; - for (i = left+1; i <= right; i++) + for (i = left + 1; i <= right; i++) { if (v[i] < v[left]) { @@ -354,8 +354,8 @@ void hypre_BigQsort2i( HYPRE_BigInt *v, } } hypre_BigSwap2i(v, w, left, last); - hypre_BigQsort2i(v, w, left, last-1); - hypre_BigQsort2i(v, w, last+1, right); + hypre_BigQsort2i(v, w, left, last - 1); + hypre_BigQsort2i(v, w, last + 1, right); } /*-------------------------------------------------------------------------- @@ -374,9 +374,9 @@ void hypre_qsort2( HYPRE_Int *v, { return; } - hypre_swap2( v, w, left, (left+right)/2); + hypre_swap2( v, w, left, (left + right) / 2); last = left; - for (i = left+1; i <= right; i++) + for (i = left + 1; i <= right; i++) { if (w[i] < w[left]) { @@ -384,8 +384,8 @@ void hypre_qsort2( HYPRE_Int *v, } } hypre_swap2(v, w, left, last); - hypre_qsort2(v, w, left, last-1); - hypre_qsort2(v, w, last+1, right); + hypre_qsort2(v, w, left, last - 1); + hypre_qsort2(v, w, last + 1, right); } /*-------------------------------------------------------------------------- @@ -402,18 +402,18 @@ void hypre_qsort2_abs( HYPRE_Int *v, { return; } - hypre_swap2( v, w, left, (left+right)/2); + hypre_swap2( v, w, left, (left + right) / 2); last = left; - for (i = left+1; i <= right; i++) + for (i = left + 1; i <= right; i++) { - if (fabs(w[i]) > fabs(w[left])) + if (hypre_abs(w[i]) > hypre_abs(w[left])) { hypre_swap2(v, w, ++last, i); } } hypre_swap2(v, w, left, last); - hypre_qsort2_abs(v, w, left, last-1); - hypre_qsort2_abs(v, w, last+1, right); + hypre_qsort2_abs(v, w, left, last - 1); + hypre_qsort2_abs(v, w, last + 1, right); } /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ @@ -432,9 +432,9 @@ void hypre_qsort3i( HYPRE_Int *v, { return; } - hypre_swap3i( v, w, z, left, (left+right)/2); + hypre_swap3i( v, w, z, left, (left + right) / 2); last = left; - for (i = left+1; i <= right; i++) + for (i = left + 1; i <= right; i++) { if (v[i] < v[left]) { @@ -442,8 +442,8 @@ void hypre_qsort3i( HYPRE_Int *v, } } hypre_swap3i(v, w, z, left, last); - hypre_qsort3i(v, w, z, left, last-1); - hypre_qsort3i(v, w, z, last+1, right); + hypre_qsort3i(v, w, z, left, last - 1); + hypre_qsort3i(v, w, z, last + 1, right); } /* sort on v, move w and z DOK */ @@ -459,9 +459,9 @@ void hypre_qsort3ir( HYPRE_Int *v, { return; } - hypre_swap3_d_perm( v, w, z, left, (left+right)/2); + hypre_swap3_d_perm( v, w, z, left, (left + right) / 2); last = left; - for (i = left+1; i <= right; i++) + for (i = left + 1; i <= right; i++) { if (v[i] < v[left]) { @@ -469,8 +469,8 @@ void hypre_qsort3ir( HYPRE_Int *v, } } hypre_swap3_d_perm(v, w, z, left, last); - hypre_qsort3ir(v, w, z, left, last-1); - hypre_qsort3ir(v, w, z, last+1, right); + hypre_qsort3ir(v, w, z, left, last - 1); + hypre_qsort3ir(v, w, z, last + 1, right); } /*-------------------------------------------------------------------------- @@ -489,18 +489,18 @@ void hypre_qsort3( HYPRE_Real *v, { return; } - hypre_swap3_d( v, w, z, left, (left+right)/2); + hypre_swap3_d( v, w, z, left, (left + right) / 2); last = left; - for (i = left+1; i <= right; i++) + for (i = left + 1; i <= right; i++) { if (v[i] < v[left]) { - hypre_swap3_d(v,w, z, ++last, i); + hypre_swap3_d(v, w, z, ++last, i); } } hypre_swap3_d(v, w, z, left, last); - hypre_qsort3(v, w, z, left, last-1); - hypre_qsort3(v, w, z, last+1, right); + hypre_qsort3(v, w, z, left, last - 1); + hypre_qsort3(v, w, z, last + 1, right); } /*-------------------------------------------------------------------------- @@ -520,18 +520,18 @@ void hypre_qsort3_abs(HYPRE_Real *v, { return; } - hypre_swap3_d( v, w, z, left, (left+right)/2); + hypre_swap3_d( v, w, z, left, (left + right) / 2); last = left; - for (i = left+1; i <= right; i++) + for (i = left + 1; i <= right; i++) { - if (fabs(v[i]) < fabs(v[left])) + if (hypre_abs(v[i]) < hypre_abs(v[left])) { - hypre_swap3_d(v,w, z, ++last, i); + hypre_swap3_d(v, w, z, ++last, i); } } hypre_swap3_d(v, w, z, left, last); - hypre_qsort3_abs(v, w, z, left, last-1); - hypre_qsort3_abs(v, w, z, last+1, right); + hypre_qsort3_abs(v, w, z, left, last - 1); + hypre_qsort3_abs(v, w, z, last + 1, right); } /*-------------------------------------------------------------------------- @@ -552,18 +552,18 @@ void hypre_BigQsort4_abs( HYPRE_Real *v, { return; } - hypre_BigSwap4_d( v, w, z, y, left, (left+right)/2); + hypre_BigSwap4_d( v, w, z, y, left, (left + right) / 2); last = left; - for (i = left+1; i <= right; i++) + for (i = left + 1; i <= right; i++) { - if (fabs(v[i]) < fabs(v[left])) + if (hypre_abs(v[i]) < hypre_abs(v[left])) { - hypre_BigSwap4_d(v,w, z, y, ++last, i); + hypre_BigSwap4_d(v, w, z, y, ++last, i); } } hypre_BigSwap4_d(v, w, z, y, left, last); - hypre_BigQsort4_abs(v, w, z, y, left, last-1); - hypre_BigQsort4_abs(v, w, z, y, last+1, right); + hypre_BigQsort4_abs(v, w, z, y, left, last - 1); + hypre_BigQsort4_abs(v, w, z, y, last + 1, right); } /*-------------------------------------------------------------------------- @@ -580,18 +580,18 @@ void hypre_qsort_abs( HYPRE_Real *w, { return; } - hypre_swap_d( w, left, (left+right)/2); + hypre_swap_d( w, left, (left + right) / 2); last = left; - for (i = left+1; i <= right; i++) + for (i = left + 1; i <= right; i++) { - if (fabs(w[i]) < fabs(w[left])) + if (hypre_abs(w[i]) < hypre_abs(w[left])) { hypre_swap_d(w, ++last, i); } } hypre_swap_d(w, left, last); - hypre_qsort_abs(w, left, last-1); - hypre_qsort_abs(w, last+1, right); + hypre_qsort_abs(w, left, last - 1); + hypre_qsort_abs(w, last + 1, right); } @@ -628,9 +628,9 @@ void hypre_BigQsortbi( HYPRE_BigInt *v, { return; } - hypre_BigSwapbi( v, w, left, (left+right)/2); + hypre_BigSwapbi( v, w, left, (left + right) / 2); last = left; - for (i = left+1; i <= right; i++) + for (i = left + 1; i <= right; i++) { if (v[i] < v[left]) { @@ -638,8 +638,8 @@ void hypre_BigQsortbi( HYPRE_BigInt *v, } } hypre_BigSwapbi(v, w, left, last); - hypre_BigQsortbi(v, w, left, last-1); - hypre_BigQsortbi(v, w, last+1, right); + hypre_BigQsortbi(v, w, left, last - 1); + hypre_BigQsortbi(v, w, last + 1, right); } /*-------------------------------------------------------------------------- @@ -673,9 +673,9 @@ void hypre_BigQsortbLoc( HYPRE_BigInt *v, { return; } - hypre_BigSwapLoc( v, w, left, (left+right)/2); + hypre_BigSwapLoc( v, w, left, (left + right) / 2); last = left; - for (i = left+1; i <= right; i++) + for (i = left + 1; i <= right; i++) { if (v[i] < v[left]) { @@ -683,8 +683,8 @@ void hypre_BigQsortbLoc( HYPRE_BigInt *v, } } hypre_BigSwapLoc(v, w, left, last); - hypre_BigQsortbLoc(v, w, left, last-1); - hypre_BigQsortbLoc(v, w, last+1, right); + hypre_BigQsortbLoc(v, w, left, last - 1); + hypre_BigQsortbLoc(v, w, last + 1, right); } /*-------------------------------------------------------------------------- @@ -726,9 +726,9 @@ void hypre_BigQsortb2i( HYPRE_BigInt *v, { return; } - hypre_BigSwapb2i( v, w, z, left, (left+right)/2); + hypre_BigSwapb2i( v, w, z, left, (left + right) / 2); last = left; - for (i = left+1; i <= right; i++) + for (i = left + 1; i <= right; i++) { if (v[i] < v[left]) { @@ -736,8 +736,8 @@ void hypre_BigQsortb2i( HYPRE_BigInt *v, } } hypre_BigSwapb2i(v, w, z, left, last); - hypre_BigQsortb2i(v, w, z, left, last-1); - hypre_BigQsortb2i(v, w, z, last+1, right); + hypre_BigQsortb2i(v, w, z, left, last - 1); + hypre_BigQsortb2i(v, w, z, last + 1, right); } /*-------------------------------------------------------------------------- @@ -767,9 +767,9 @@ void hypre_BigQsort0( HYPRE_BigInt *v, { return; } - hypre_BigSwap( v, left, (left+right)/2); + hypre_BigSwap( v, left, (left + right) / 2); last = left; - for (i = left+1; i <= right; i++) + for (i = left + 1; i <= right; i++) { if (v[i] < v[left]) { @@ -777,8 +777,8 @@ void hypre_BigQsort0( HYPRE_BigInt *v, } } hypre_BigSwap(v, left, last); - hypre_BigQsort0(v, left, last-1); - hypre_BigQsort0(v, last+1, right); + hypre_BigQsort0(v, left, last - 1); + hypre_BigQsort0(v, last + 1, right); } // Recursive DFS search. @@ -796,11 +796,11 @@ static void hypre_search_row(HYPRE_Int row, { HYPRE_Int j; visited[row] = 1; - for (j=row_ptr[row]; j 1e-14) + if (hypre_cabs(val) > 1e-14) { hypre_dense_search_row(col, L, visited, ordering, order_ind, n, is_col_major); } diff --git a/external/hypre/src/utilities/qsplit.c b/external/hypre/src/utilities/qsplit.c index bc990fc9..2c6382fb 100644 --- a/external/hypre/src/utilities/qsplit.c +++ b/external/hypre/src/utilities/qsplit.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -7,17 +7,17 @@ #include "_hypre_utilities.h" #include - + /*-------------------------------------------------------------------------- * hypre_DoubleQuickSplit * C version of the routine "qsplit" from SPARSKIT - * Uses a quicksort-type algorithm to split data into + * Uses a quicksort-type algorithm to split data into * highest "NumberCut" values without completely sorting them. * Data is HYPRE_Real precision data. *--------------------------------------------------------------------------*/ - -HYPRE_Int hypre_DoubleQuickSplit(HYPRE_Real *values, HYPRE_Int *indices, - HYPRE_Int list_length, HYPRE_Int NumberKept ) + +HYPRE_Int hypre_DoubleQuickSplit(HYPRE_Real *values, HYPRE_Int *indices, + HYPRE_Int list_length, HYPRE_Int NumberKept ) { HYPRE_Int ierr = 0; HYPRE_Real interchange_value; @@ -28,10 +28,12 @@ HYPRE_Int hypre_DoubleQuickSplit(HYPRE_Real *values, HYPRE_Int *indices, HYPRE_Int done; first = 0; - last = list_length-1; + last = list_length - 1; - if ( (NumberKept < first+1) || (NumberKept > last+1) ) - return( ierr ); + if ( (NumberKept < first + 1) || (NumberKept > last + 1) ) + { + return ( ierr ); + } /* Loop until the "midpoint" is NumberKept */ done = 0; @@ -39,11 +41,11 @@ HYPRE_Int hypre_DoubleQuickSplit(HYPRE_Real *values, HYPRE_Int *indices, for ( ; !done; ) { mid = first; - abskey = fabs( values[ mid ]); + abskey = hypre_abs( values[ mid ]); - for( j = first+1; j <= last; j ++) + for ( j = first + 1; j <= last; j ++) { - if( fabs( values[ j ]) > abskey ) + if ( hypre_abs( values[ j ]) > abskey ) { mid ++; /* interchange values */ @@ -53,8 +55,8 @@ HYPRE_Int hypre_DoubleQuickSplit(HYPRE_Real *values, HYPRE_Int *indices, indices[ mid] = indices[ j]; values[ j] = interchange_value; indices[ j] = interchange_index; - } - } + } + } /* interchange the first and mid value */ interchange_value = values[ mid]; @@ -64,15 +66,19 @@ HYPRE_Int hypre_DoubleQuickSplit(HYPRE_Real *values, HYPRE_Int *indices, values[ first] = interchange_value; indices[ first] = interchange_index; - if ( mid+1 == NumberKept ) + if ( mid + 1 == NumberKept ) { done = 1; break; } - if ( mid+1 > NumberKept ) + if ( mid + 1 > NumberKept ) + { last = mid - 1; + } else + { first = mid + 1; + } } return ( ierr ); diff --git a/external/hypre/src/utilities/random.c b/external/hypre/src/utilities/random.c index d52c401a..e2adc7f2 100644 --- a/external/hypre/src/utilities/random.c +++ b/external/hypre/src/utilities/random.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -53,13 +53,13 @@ static HYPRE_Int Seed = 13579; void hypre_SeedRand( HYPRE_Int seed ) { /* RL: seed must be between 1 and 2^31-2 */ - if (seed < 1) + if (seed < 1) { seed = 1; } else if (seed >= m) { - seed = m - 1; + seed = m - 1; } Seed = seed; @@ -71,13 +71,13 @@ void hypre_SeedRand( HYPRE_Int seed ) * * @return a HYPRE_Int between (0, 2147483647] *--------------------------------------------------------------------------*/ -HYPRE_Int hypre_RandI() +HYPRE_Int hypre_RandI( void ) { HYPRE_Int low, high, test; high = Seed / q; low = Seed % q; test = a * low - r * high; - if(test > 0) + if (test > 0) { Seed = test; } @@ -96,8 +96,8 @@ HYPRE_Int hypre_RandI() * @return a HYPRE_Real containing the next number in the sequence divided by * 2147483647 so that the numbers are in (0, 1]. *--------------------------------------------------------------------------*/ -HYPRE_Real hypre_Rand() +HYPRE_Real hypre_Rand( void ) { - return ((HYPRE_Real)(hypre_RandI()) / m); + return ((HYPRE_Real)(hypre_RandI()) / (HYPRE_Real)m); } diff --git a/external/hypre/src/utilities/smp.h b/external/hypre/src/utilities/smp.h index 34cfe87b..8d255f64 100644 --- a/external/hypre/src/utilities/smp.h +++ b/external/hypre/src/utilities/smp.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/utilities/state.c b/external/hypre/src/utilities/state.c new file mode 100644 index 00000000..ed3caca0 --- /dev/null +++ b/external/hypre/src/utilities/state.c @@ -0,0 +1,88 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#include "_hypre_utilities.h" + +/* Global variable: library state (initialized, finalized, or none) */ +hypre_State hypre__global_state = HYPRE_STATE_NONE; + +/*-------------------------------------------------------------------------- + * HYPRE_Initialized + * + * Public function for hypre_Initialized + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_Initialized( void ) +{ + return hypre_Initialized(); +} + +/*-------------------------------------------------------------------------- + * HYPRE_Finalized + * + * Public function for hypre_Finalized + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_Finalized( void ) +{ + return hypre_Finalized(); +} + +/*-------------------------------------------------------------------------- + * hypre_Initialized + * + * This function returns True when the library has been initialized, but not + * finalized yet. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_Initialized( void ) +{ + return (hypre__global_state == HYPRE_STATE_INITIALIZED); +} + +/*-------------------------------------------------------------------------- + * hypre_Finalized + * + * This function returns True when the library is in finalized state; + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_Finalized( void ) +{ + return (hypre__global_state == HYPRE_STATE_FINALIZED); +} + +/*-------------------------------------------------------------------------- + * hypre_SetInitialized + * + * This function sets the library state to initialized + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SetInitialized( void ) +{ + hypre__global_state = HYPRE_STATE_INITIALIZED; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_SetFinalized + * + * This function sets the library state to finalized + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SetFinalized( void ) +{ + hypre__global_state = HYPRE_STATE_FINALIZED; + + return hypre_error_flag; +} diff --git a/external/hypre/src/utilities/state.h b/external/hypre/src/utilities/state.h new file mode 100644 index 00000000..07944999 --- /dev/null +++ b/external/hypre/src/utilities/state.h @@ -0,0 +1,24 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#ifndef hypre_STATE_HEADER +#define hypre_STATE_HEADER + +/*-------------------------------------------------------------------------- + * hypre library state + *--------------------------------------------------------------------------*/ + +typedef enum hypre_State_enum +{ + HYPRE_STATE_NONE = 0, + HYPRE_STATE_INITIALIZED = 1, + HYPRE_STATE_FINALIZED = 2 +} hypre_State; + +extern hypre_State hypre__global_state; + +#endif /* hypre_STATE_HEADER */ diff --git a/external/hypre/src/utilities/stl_ops.c b/external/hypre/src/utilities/stl_ops.c new file mode 100644 index 00000000..3f867d9b --- /dev/null +++ b/external/hypre/src/utilities/stl_ops.c @@ -0,0 +1,53 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +#include "_hypre_onedpl.hpp" +#include "_hypre_utilities.h" +#include "_hypre_utilities.hpp" +#include + +/*-------------------------------------------------------------------- + * hypre_IntSequence + * + * Generate a linear sequence of integers from 0 to size-1 and store + * them in the provided data array. + *--------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IntSequence(HYPRE_MemoryLocation memory_location, + HYPRE_Int size, + HYPRE_Int *data) +{ +#if !defined (HYPRE_USING_GPU) + HYPRE_UNUSED_VAR(memory_location); +#endif + + HYPRE_Int i; + +#if defined (HYPRE_USING_GPU) + if (hypre_GetExecPolicy1(memory_location) == HYPRE_EXEC_DEVICE) + { +#if defined(HYPRE_USING_SYCL) + hypreSycl_sequence(data, data + size, 0); +#else + HYPRE_THRUST_CALL(sequence, data, data + size); +#endif + } + else +#endif + { +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < size; i++) + { + data[i] = i; + } + } + + return hypre_error_flag; +} diff --git a/external/hypre/src/utilities/thread_protos.awk b/external/hypre/src/utilities/thread_protos.awk index 7cd04b09..7af8ba01 100644 --- a/external/hypre/src/utilities/thread_protos.awk +++ b/external/hypre/src/utilities/thread_protos.awk @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/utilities/thread_wrappers.awk b/external/hypre/src/utilities/thread_wrappers.awk index 6b7f1779..67a3a291 100644 --- a/external/hypre/src/utilities/thread_wrappers.awk +++ b/external/hypre/src/utilities/thread_wrappers.awk @@ -1,4 +1,4 @@ -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/utilities/threading.c b/external/hypre/src/utilities/threading.c index e6e113ea..fbd12ffc 100644 --- a/external/hypre/src/utilities/threading.c +++ b/external/hypre/src/utilities/threading.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -12,7 +12,7 @@ #ifdef HYPRE_USING_OPENMP HYPRE_Int -hypre_NumThreads( ) +hypre_NumThreads( void ) { HYPRE_Int num_threads; @@ -24,7 +24,7 @@ hypre_NumThreads( ) /* This next function must be called from within a parallel region! */ HYPRE_Int -hypre_NumActiveThreads( ) +hypre_NumActiveThreads( void ) { HYPRE_Int num_threads; @@ -36,7 +36,7 @@ hypre_NumActiveThreads( ) /* This next function must be called from within a parallel region! */ HYPRE_Int -hypre_GetThreadNum( ) +hypre_GetThreadNum( void ) { HYPRE_Int my_thread_num; @@ -46,7 +46,7 @@ hypre_GetThreadNum( ) } void -hypre_SetNumThreads(HYPRE_Int nt) +hypre_SetNumThreads( HYPRE_Int nt ) { omp_set_num_threads(nt); } @@ -61,8 +61,8 @@ hypre_GetSimpleThreadPartition( HYPRE_Int *begin, HYPRE_Int *end, HYPRE_Int n ) HYPRE_Int num_threads = hypre_NumActiveThreads(); HYPRE_Int my_thread_num = hypre_GetThreadNum(); - HYPRE_Int n_per_thread = (n + num_threads - 1)/num_threads; + HYPRE_Int n_per_thread = (n + num_threads - 1) / num_threads; - *begin = hypre_min(n_per_thread*my_thread_num, n); + *begin = hypre_min(n_per_thread * my_thread_num, n); *end = hypre_min(*begin + n_per_thread, n); } diff --git a/external/hypre/src/utilities/threading.h b/external/hypre/src/utilities/threading.h index f9b81eef..d5621645 100644 --- a/external/hypre/src/utilities/threading.h +++ b/external/hypre/src/utilities/threading.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/external/hypre/src/utilities/timer.c b/external/hypre/src/utilities/timer.c index bf09df50..3bdfda5c 100644 --- a/external/hypre/src/utilities/timer.c +++ b/external/hypre/src/utilities/timer.c @@ -1,14 +1,14 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ /* - * File: timer.c - * Author: Scott Kohn (skohn@llnl.gov) - * Description: somewhat portable timing routines for C++, C, and Fortran + * File: timer.c + * Author: Scott Kohn (skohn@llnl.gov) + * Description: somewhat portable timing routines for C++, C, and Fortran * * This has been modified many times since the original author's version. */ @@ -24,15 +24,15 @@ HYPRE_Real time_getWallclockSeconds(void) { #ifndef HYPRE_SEQUENTIAL - return(hypre_MPI_Wtime()); + return (hypre_MPI_Wtime()); #else #ifdef WIN32 - clock_t cl=clock(); - return(((HYPRE_Real) cl)/((HYPRE_Real) CLOCKS_PER_SEC)); + clock_t cl = clock(); + return (((HYPRE_Real) cl) / ((HYPRE_Real) CLOCKS_PER_SEC)); #else struct tms usage; hypre_longint wallclock = times(&usage); - return(((HYPRE_Real) wallclock)/((HYPRE_Real) sysconf(_SC_CLK_TCK))); + return (((HYPRE_Real) wallclock) / ((HYPRE_Real) sysconf(_SC_CLK_TCK))); #endif #endif } @@ -41,18 +41,18 @@ HYPRE_Real time_getCPUSeconds(void) { #ifndef TIMER_NO_SYS clock_t cpuclock = clock(); - return(((HYPRE_Real) (cpuclock))/((HYPRE_Real) CLOCKS_PER_SEC)); + return (((HYPRE_Real) (cpuclock)) / ((HYPRE_Real) CLOCKS_PER_SEC)); #else - return(0.0); + return (0.0); #endif } HYPRE_Real time_get_wallclock_seconds_(void) { - return(time_getWallclockSeconds()); + return (time_getWallclockSeconds()); } HYPRE_Real time_get_cpu_seconds_(void) { - return(time_getCPUSeconds()); + return (time_getCPUSeconds()); } diff --git a/external/hypre/src/utilities/timing.c b/external/hypre/src/utilities/timing.c index 0becaf36..0c03b27c 100644 --- a/external/hypre/src/utilities/timing.c +++ b/external/hypre/src/utilities/timing.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -79,7 +79,7 @@ hypre_InitializeTiming( const char *name ) if (new_name) { - for (i = 0; i < hypre_global_timing_ref(threadid ,size); i++) + for (i = 0; i < hypre_global_timing_ref(threadid, size); i++) { if (hypre_TimingNumRegs(i) == 0) { @@ -105,17 +105,17 @@ hypre_InitializeTiming( const char *name ) old_num_regs = (hypre_global_timing_ref(threadid, num_regs)); (hypre_global_timing_ref(threadid, wall_time)) = - hypre_CTAlloc(HYPRE_Real, (time_index+1), HYPRE_MEMORY_HOST); + hypre_CTAlloc(HYPRE_Real, (time_index + 1), HYPRE_MEMORY_HOST); (hypre_global_timing_ref(threadid, cpu_time)) = - hypre_CTAlloc(HYPRE_Real, (time_index+1), HYPRE_MEMORY_HOST); + hypre_CTAlloc(HYPRE_Real, (time_index + 1), HYPRE_MEMORY_HOST); (hypre_global_timing_ref(threadid, flops)) = - hypre_CTAlloc(HYPRE_Real, (time_index+1), HYPRE_MEMORY_HOST); + hypre_CTAlloc(HYPRE_Real, (time_index + 1), HYPRE_MEMORY_HOST); (hypre_global_timing_ref(threadid, name)) = - hypre_CTAlloc(char *, (time_index+1), HYPRE_MEMORY_HOST); + hypre_CTAlloc(char *, (time_index + 1), HYPRE_MEMORY_HOST); (hypre_global_timing_ref(threadid, state)) = - hypre_CTAlloc(HYPRE_Int, (time_index+1), HYPRE_MEMORY_HOST); + hypre_CTAlloc(HYPRE_Int, (time_index + 1), HYPRE_MEMORY_HOST); (hypre_global_timing_ref(threadid, num_regs)) = - hypre_CTAlloc(HYPRE_Int, (time_index+1), HYPRE_MEMORY_HOST); + hypre_CTAlloc(HYPRE_Int, (time_index + 1), HYPRE_MEMORY_HOST); (hypre_global_timing_ref(threadid, size)) ++; for (i = 0; i < time_index; i++) @@ -157,7 +157,9 @@ hypre_FinalizeTiming( HYPRE_Int time_index ) HYPRE_Int i; if (hypre_global_timing == NULL) + { return ierr; + } if (time_index < (hypre_global_timing_ref(threadid, size))) { @@ -192,6 +194,26 @@ hypre_FinalizeTiming( HYPRE_Int time_index ) return ierr; } +HYPRE_Int +hypre_FinalizeAllTimings( void ) +{ + HYPRE_Int time_index, ierr = 0; + + if (hypre_global_timing == NULL) + { + return ierr; + } + + HYPRE_Int size = hypre_global_timing_ref(threadid, size); + + for (time_index = 0; time_index < size; time_index++) + { + ierr += hypre_FinalizeTiming(time_index); + } + + return ierr; +} + /*-------------------------------------------------------------------------- * hypre_IncFLOPCount *--------------------------------------------------------------------------*/ @@ -202,7 +224,9 @@ hypre_IncFLOPCount( HYPRE_BigInt inc ) HYPRE_Int ierr = 0; if (hypre_global_timing == NULL) + { return ierr; + } hypre_TimingFLOPCount += (HYPRE_Real) (inc); @@ -219,7 +243,9 @@ hypre_BeginTiming( HYPRE_Int time_index ) HYPRE_Int ierr = 0; if (hypre_global_timing == NULL) + { return ierr; + } if (hypre_TimingState(time_index) == 0) { @@ -245,11 +271,20 @@ hypre_EndTiming( HYPRE_Int time_index ) HYPRE_Int ierr = 0; if (hypre_global_timing == NULL) + { return ierr; + } hypre_TimingState(time_index) --; if (hypre_TimingState(time_index) == 0) { +#if defined(HYPRE_USING_GPU) + hypre_Handle *hypre_handle_ = hypre_handle(); + if (hypre_HandleDefaultExecPolicy(hypre_handle_) == HYPRE_EXEC_DEVICE) + { + hypre_SyncDevice(); + } +#endif hypre_StopTiming(); hypre_TimingWallTime(time_index) += hypre_TimingWallCount; hypre_TimingCPUTime(time_index) += hypre_TimingCPUCount; @@ -265,15 +300,17 @@ hypre_EndTiming( HYPRE_Int time_index ) *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_ClearTiming( ) +hypre_ClearTiming( void ) { HYPRE_Int ierr = 0; HYPRE_Int i; if (hypre_global_timing == NULL) + { return ierr; + } - for (i = 0; i < (hypre_global_timing_ref(threadid,size)); i++) + for (i = 0; i < (hypre_global_timing_ref(threadid, size)); i++) { hypre_TimingWallTime(i) = 0.0; hypre_TimingCPUTime(i) = 0.0; @@ -304,7 +341,9 @@ hypre_PrintTiming( const char *heading, HYPRE_Int myrank; if (hypre_global_timing == NULL) + { return ierr; + } hypre_MPI_Comm_rank(comm, &myrank ); @@ -323,9 +362,9 @@ hypre_PrintTiming( const char *heading, local_wall_time = hypre_TimingWallTime(i); local_cpu_time = hypre_TimingCPUTime(i); hypre_MPI_Allreduce(&local_wall_time, &wall_time, 1, - hypre_MPI_REAL, hypre_MPI_MAX, comm); + hypre_MPI_REAL, hypre_MPI_MAX, comm); hypre_MPI_Allreduce(&local_cpu_time, &cpu_time, 1, - hypre_MPI_REAL, hypre_MPI_MAX, comm); + hypre_MPI_REAL, hypre_MPI_MAX, comm); if (myrank == 0) { @@ -334,17 +373,25 @@ hypre_PrintTiming( const char *heading, /* print wall clock info */ hypre_printf(" wall clock time = %f seconds\n", wall_time); if (wall_time) + { wall_mflops = hypre_TimingFLOPS(i) / wall_time / 1.0E6; + } else + { wall_mflops = 0.0; + } hypre_printf(" wall MFLOPS = %f\n", wall_mflops); /* print CPU clock info */ hypre_printf(" cpu clock time = %f seconds\n", cpu_time); if (cpu_time) + { cpu_mflops = hypre_TimingFLOPS(i) / cpu_time / 1.0E6; + } else + { cpu_mflops = 0.0; + } hypre_printf(" cpu MFLOPS = %f\n\n", cpu_mflops); } } @@ -352,3 +399,57 @@ hypre_PrintTiming( const char *heading, return ierr; } + +/*-------------------------------------------------------------------------- + * hypre_GetTiming + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GetTiming( const char *heading, + HYPRE_Real *wall_time_ptr, + MPI_Comm comm ) +{ + HYPRE_Int ierr = 0; + + HYPRE_Real local_wall_time; + HYPRE_Real wall_time; + + HYPRE_Int i; + HYPRE_Int myrank; + + if (hypre_global_timing == NULL) + { + return ierr; + } + + hypre_MPI_Comm_rank(comm, &myrank ); + + /* print heading */ + if (myrank == 0) + { + hypre_printf("=============================================\n"); + hypre_printf("%s:\n", heading); + hypre_printf("=============================================\n"); + } + + for (i = 0; i < (hypre_global_timing -> size); i++) + { + if (hypre_TimingNumRegs(i) > 0) + { + local_wall_time = hypre_TimingWallTime(i); + hypre_MPI_Allreduce(&local_wall_time, &wall_time, 1, + hypre_MPI_REAL, hypre_MPI_MAX, comm); + + if (myrank == 0) + { + hypre_printf("%s:\n", hypre_TimingName(i)); + + /* print wall clock info */ + hypre_printf(" wall clock time = %f seconds\n", wall_time); + } + } + } + + *wall_time_ptr = wall_time; + return ierr; +} diff --git a/external/hypre/src/utilities/timing.h b/external/hypre/src/utilities/timing.h index a2f41eb1..f09fb1db 100644 --- a/external/hypre/src/utilities/timing.h +++ b/external/hypre/src/utilities/timing.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -40,11 +40,13 @@ HYPRE_Real time_get_cpu_seconds_( void ); #define hypre_InitializeTiming(name) 0 #define hypre_FinalizeTiming(index) +#define hypre_FinalizeAllTimings() #define hypre_IncFLOPCount(inc) #define hypre_BeginTiming(i) #define hypre_EndTiming(i) #define hypre_PrintTiming(heading, comm) #define hypre_ClearTiming() +#define hypre_GetTiming(heading, comm, time) /*-------------------------------------------------------------------------- * With timing on @@ -101,11 +103,13 @@ extern hypre_TimingType *hypre_global_timing; /* timing.c */ HYPRE_Int hypre_InitializeTiming( const char *name ); HYPRE_Int hypre_FinalizeTiming( HYPRE_Int time_index ); +HYPRE_Int hypre_FinalizeAllTimings( void ); HYPRE_Int hypre_IncFLOPCount( HYPRE_BigInt inc ); HYPRE_Int hypre_BeginTiming( HYPRE_Int time_index ); HYPRE_Int hypre_EndTiming( HYPRE_Int time_index ); HYPRE_Int hypre_ClearTiming( void ); -HYPRE_Int hypre_PrintTiming( const char *heading , MPI_Comm comm ); +HYPRE_Int hypre_PrintTiming( const char *heading, MPI_Comm comm ); +HYPRE_Int hypre_GetTiming( const char *heading, HYPRE_Real *wall_time_ptr, MPI_Comm comm ); #endif diff --git a/external/hypre/src/utilities/utilities.c b/external/hypre/src/utilities/utilities.c index 9f388f9d..454a0e30 100644 --- a/external/hypre/src/utilities/utilities.c +++ b/external/hypre/src/utilities/utilities.c @@ -1,11 +1,22 @@ /****************************************************************************** - * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ #include "_hypre_utilities.h" +#include + +#ifdef _WIN32 +#include +#include +#define mkdir(path, mode) _mkdir(path) +#else +#include +#include +#include +#endif /*-------------------------------------------------------------------------- * hypre_multmod @@ -17,21 +28,21 @@ hypre_multmod(HYPRE_Int a, HYPRE_Int b, HYPRE_Int mod) { - HYPRE_Int res = 0; // Initialize result - a %= mod; - while (b) - { - // If b is odd, add a with result - if (b & 1) - { - res = (res + a) % mod; - } - // Here we assume that doing 2*a - // doesn't cause overflow - a = (2 * a) % mod; - b >>= 1; // b = b / 2 - } - return res; + HYPRE_Int res = 0; // Initialize result + a %= mod; + while (b) + { + // If b is odd, add a with result + if (b & 1) + { + res = (res + a) % mod; + } + // Here we assume that doing 2*a + // doesn't cause overflow + a = (2 * a) % mod; + b >>= 1; // b = b / 2 + } + return res; } /*-------------------------------------------------------------------------- @@ -88,3 +99,169 @@ hypre_strcpy(char *destination, const char *source) return ((char *) memmove(destination, source, len + 1)); } } + +/*-------------------------------------------------------------------------- + * hypre_CheckDirExists + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CheckDirExists(const char *path) +{ +#ifndef _WIN32 + DIR *dir = opendir(path); + + if (dir) + { + closedir(dir); + return 1; + } +#else + DWORD att = GetFileAttributesA(path); + + if (att == INVALID_FILE_ATTRIBUTES) + { + return 0; + } + + if (att & FILE_ATTRIBUTE_DIRECTORY) + { + return 1; + } +#endif + + return 0; +} + +/*-------------------------------------------------------------------------- + * hypre_CreateDir + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CreateDir(const char *path) +{ + char msg[HYPRE_MAX_MSG_LEN]; + + if (mkdir(path, 0777)) + { + hypre_sprintf(msg, "Could not create directory: %s", path); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, msg); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_CreateNextDirOfSequence + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CreateNextDirOfSequence(const char *basepath, const char *prefix, char **fullpath_ptr) +{ + HYPRE_Int max_suffix = -1; + char *fullpath; + +#ifndef _WIN32 + HYPRE_Int suffix; + char msg[HYPRE_MAX_MSG_LEN]; + DIR *dir; + struct dirent *entry; + + if ((dir = opendir(basepath)) == NULL) + { + hypre_sprintf(msg, "Could not open directory: %s", basepath); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, msg); + return hypre_error_flag; + } + + max_suffix = -1; + while ((entry = readdir(dir)) != NULL) + { + if (strncmp(entry->d_name, prefix, strlen(prefix)) == 0) + { + if (hypre_sscanf(entry->d_name + strlen(prefix), "%d", &suffix) == 1) + { + if (suffix > max_suffix) + { + max_suffix = suffix; + } + } + } + } + closedir(dir); +#else + /* TODO (VPM) */ +#endif + + /* Create directory */ + fullpath = hypre_TAlloc(char, strlen(basepath) + 10, HYPRE_MEMORY_HOST); + hypre_sprintf(fullpath, "%s/%s%05d", basepath, prefix, max_suffix + 1); + hypre_CreateDir(fullpath); + + /* Set output pointer */ + *fullpath_ptr = fullpath; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------- + * hypre_ConvertIndicesToString + * + * Converts an array of integers (indices) into a formatted string. + * The function creates a string representing the array in a comma- + * separated format, enclosed within square brackets ("[]"). + * + * - If the input array is empty (size = 0), it returns a string "[]". + * - The resulting string includes the list of integers with proper + * formatting: each integer is separated by a comma and a space. + * + * Parameters: + * - size: Number of elements in the input array. + * - indices: Pointer to the array of integers (HYPRE_Int) to convert. + * + * Returns: + * - A dynamically allocated string representing the integer array. + *--------------------------------------------------------------------*/ + +char* +hypre_ConvertIndicesToString(HYPRE_Int size, + HYPRE_Int *indices) +{ + HYPRE_Int max_length; + HYPRE_Int i, length; + char *string; + char *pos; + + if (!size) + { + string = hypre_TAlloc(char, 3, HYPRE_MEMORY_HOST); + hypre_sprintf(string, "[]"); + + return string; + } + + /* Estimate maximum string needed */ + max_length = 12 * size + 3; + string = hypre_TAlloc(char, max_length, HYPRE_MEMORY_HOST); + + pos = string; + length = hypre_sprintf(pos, "["); + pos += length; + + for (i = 0; i < size; i++) + { + /* Add comma before all but the first element */ + if (i > 0) + { + length = hypre_sprintf(pos, ", "); + pos += length; + } + + /* Write integer as string */ + length = hypre_sprintf(pos, "%d", indices[i]); + pos += length; + } + + hypre_sprintf(pos, "]"); + + return string; +} diff --git a/external/hypre/src/utilities/version.sh b/external/hypre/src/utilities/version.sh old mode 100644 new mode 100755 index c9e2a6b4..6413b408 --- a/external/hypre/src/utilities/version.sh +++ b/external/hypre/src/utilities/version.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 1998-2019 Lawrence Livermore National Security, LLC and other +#!/bin/bash +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other # HYPRE Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) From bef5035794d7668871908843cd62c1d8b1dee75b Mon Sep 17 00:00:00 2001 From: Luohao Wang Date: Sun, 1 Jun 2025 00:37:23 +0800 Subject: [PATCH 04/31] [Core] Enable C++ 26 --- CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d80e6e8e..e0de3af0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -178,11 +178,11 @@ target_include_directories(opflow INTERFACE # Compile options # ---------------------------------------------------------------------------- include(CheckCXXCompilerFlag) -check_cxx_compiler_flag(-std=c++20 c++20support) -if (NOT c++20support) - message(FATAL_ERROR "OpFlow requires C++20 to compile.") +check_cxx_compiler_flag(-std=c++26 c++26support) +if (NOT c++26support) + message(FATAL_ERROR "OpFlow requires C++26 to compile.") endif () -target_compile_options(opflow INTERFACE -std=c++20) +target_compile_options(opflow INTERFACE -std=c++26) # ---------------------------------------------------------------------------- # Use spdlog package From e34bd1da49178bb81c8e94727332816fbeee3b59 Mon Sep 17 00:00:00 2001 From: Luohao Wang Date: Sun, 1 Jun 2025 10:53:42 +0800 Subject: [PATCH 05/31] [Core] Move external configs to `external` dir --- CMakeLists.txt | 153 ++------------------------------------- cmake/AMGCLConfig.cmake | 2 +- cmake/FMTConfig.cmake | 2 +- cmake/HYPREConfig.cmake | 2 +- cmake/SPDLOGConfig.cmake | 2 +- cmake/TBBConfig.cmake | 2 +- cmake/TECIOConfig.cmake | 36 ++++----- external/CMakeLists.txt | 117 ++++++++++++++++++++++++++++++ 8 files changed, 146 insertions(+), 170 deletions(-) create mode 100644 external/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index e0de3af0..c3c2b268 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -174,6 +174,11 @@ target_include_directories(opflow INTERFACE "$" "$") +# ---------------------------------------------------------------------------- +# External dependencies +# ---------------------------------------------------------------------------- +add_subdirectory(external) + # ---------------------------------------------------------------------------- # Compile options # ---------------------------------------------------------------------------- @@ -183,54 +188,7 @@ if (NOT c++26support) message(FATAL_ERROR "OpFlow requires C++26 to compile.") endif () target_compile_options(opflow INTERFACE -std=c++26) - -# ---------------------------------------------------------------------------- -# Use spdlog package -# ---------------------------------------------------------------------------- -if (OPFLOW_INSTALL) - # Same as libfmt - include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/SPDLOGConfig.cmake) - CONFIG_AND_INSTALL_SPDLOG() - find_package(spdlog REQUIRED PATHS ${CMAKE_INSTALL_PREFIX} NO_DEFAULT_PATH) -else () - add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/external/spdlog EXCLUDE_FROM_ALL) -endif () -target_link_libraries(opflow INTERFACE spdlog::spdlog) - -# ---------------------------------------------------------------------------- -# Use AMGCL -# ---------------------------------------------------------------------------- -if (OPFLOW_INSTALL) - include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/AMGCLConfig.cmake) - CONFIG_AND_INSTALL_AMGCL() - find_package(amgcl REQUIRED PATHS ${CMAKE_INSTALL_PREFIX} NO_DEFAULT_PATH) -else () - add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/external/amgcl EXCLUDE_FROM_ALL) -endif () -target_link_libraries(opflow INTERFACE amgcl::amgcl) - -# ---------------------------------------------------------------------------- -# Use TBB -# ---------------------------------------------------------------------------- -if (OPFLOW_TBB_EXTERNAL) - if (NOT DEFINED TBB_DIR) - message(FATAL "Variable TBB_DIR not defined. Use -DTBB_DIR to specify TBB's install path.") - endif () - find_package(TBB REQUIRED PATHS ${TBB_DIR} NO_DEFAULT_PATH) -else () - if (OPFLOW_INSTALL) - include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/TBBConfig.cmake) - CONFIG_AND_INSTALL_TBB() - find_package(tbb NAMES tbb TBB REQUIRED PATHS ${CMAKE_INSTALL_PREFIX} NO_DEFAULT_PATH) - else () - set(BUILD_SHARED_LIBS ON) - set(TBB_TEST OFF) - set(CMAKE_POLICY_DEFAULT_CMP0077 NEW) - add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/external/tbb EXCLUDE_FROM_ALL) - find_package(tbb NAMES tbb TBB REQUIRED) - endif () -endif () -target_link_libraries(opflow INTERFACE TBB::tbb) +set_property(TARGET opflow PROPERTY CXX_SCAN_FOR_MODULES ON) # ---------------------------------------------------------------------------- # Find MPI @@ -273,105 +231,6 @@ if (OPFLOW_WITH_OPENMP) list(APPEND PKG_CONFIG_REQUIRES OpenMP) endif () -# ---------------------------------------------------------------------------- -# Use HYPRE package -# ---------------------------------------------------------------------------- -if (OPFLOW_HYPRE_EXTERNAL) - if (NOT DEFINED HYPRE_DIR) - message(FATAL "Variable HYPRE_DIR not set. Use -DHYPRE_DIR to specify HYPRE's install path") - endif () - # Use external HYPRE - find_package(HYPRE REQUIRED PATHS ${HYPRE_DIR} NO_DEFAULT_PATH) - # Here we hard link to the found HYPRE to avoid find again at client - target_link_libraries(opflow INTERFACE HYPRE) -else () - # Use bundled HYPRE - if (OPFLOW_INSTALL) - include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/HYPREConfig.cmake) - CONFIG_AND_INSTALL_HYPRE() - find_package(HYPRE REQUIRED PATHS ${CMAKE_INSTALL_PREFIX} NO_DEFAULT_PATH) - # HYPRE::HYPRE is only exported on install - target_link_libraries(opflow INTERFACE HYPRE::HYPRE) - else () - set(HYPRE_BUILD_TYPE Debug) - set(HYPRE_WITH_OPENMP ${OPFLOW_WITH_OPENMP}) - set(HYPRE_ENABLE_SINGLE ${OPFLOW_SINGLE_PRECISION}) - set(HYPRE_WITH_MPI ${OPFLOW_WITH_MPI}) - add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/external/hypre/src EXCLUDE_FROM_ALL) - target_link_libraries(opflow INTERFACE HYPRE) - endif () -endif () - -# ---------------------------------------------------------------------------- -# Use VTK package -# ---------------------------------------------------------------------------- -if (OPFLOW_WITH_VTK) - target_compile_definitions(opflow INTERFACE OPFLOW_WITH_VTK) - if (OPFLOW_VTK_EXTERNAL) - if (NOT TARGET VTK) - if (NOT DEFINED VTK_DIR) - message(FATAL "Variable VTK_DIR not defined. Use -DVTK_DIR to specify VTK's install path") - endif () - find_package(VTK REQUIRED PATHS ${VTK_DIR} NO_DEFAULT_PATH) - target_compile_definitions(opflow INTERFACE OPFLOW_VTK_EXTERNAL) - endif () - else () - include(cmake/VTKConfig.cmake) - CONFIG_VTK() - endif () - list(APPEND PKG_CONFIG_REQUIRES VTK) - target_include_directories(opflow INTERFACE ${VTK_INCLUDE_DIRS}) - target_link_directories(opflow INTERFACE ${VTK_LIBRARY_DIRS}) - target_link_libraries(opflow INTERFACE ${VTK_LIBRARIES}) -endif () - -# ---------------------------------------------------------------------------- -# Use HDF5 package -# ---------------------------------------------------------------------------- -if (OPFLOW_WITH_HDF5) - if (OPFLOW_WITH_MPI) - set(HDF5_PREFER_PARALLEL TRUE) - endif () - set(HDF5_USE_STATIC_LIBRARIES ON) - include(FindHDF5) - find_package(HDF5 COMPONENTS C REQUIRED) - if (HDF5_PREFER_PARALLEL AND NOT HDF5_IS_PARALLEL) - message(FATAL_ERROR "Cannot find parallel HDF5 library") - endif () - target_include_directories(opflow INTERFACE ${HDF5_C_INCLUDE_DIRS}) - target_link_libraries(opflow INTERFACE ${HDF5_C_LIBRARIES}) - target_compile_definitions(opflow INTERFACE OPFLOW_WITH_HDF5 ${HDF5_C_DEFINITIONS}) - if (OPFLOW_WITH_MPI) - target_compile_definitions(opflow INTERFACE H5_HAVE_PARALLEL) - endif () -endif () - -# ---------------------------------------------------------------------------- -# Use TecIO library -# ---------------------------------------------------------------------------- -if (OPFLOW_INSTALL) - include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/TECIOConfig.cmake) - CONFIG_AND_INSTALL_TECIO() - target_include_directories(opflow INTERFACE ${CMAKE_INSTALL_PREFIX}/include/tecio) - target_link_directories(opflow INTERFACE ${CMAKE_INSTALL_PREFIX}/lib) - if (OPFLOW_WITH_MPI) - target_link_libraries(opflow INTERFACE teciompi) - target_compile_definitions(opflow INTERFACE TECIOMPI) - else () - target_link_libraries(opflow INTERFACE tecio) - endif () -else () - if (OPFLOW_WITH_MPI) - add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/external/tecio/teciompisrc EXCLUDE_FROM_ALL) - target_include_directories(opflow INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/external/tecio/teciompisrc) - target_link_libraries(opflow INTERFACE teciompi) - else () - add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/external/tecio/teciosrc EXCLUDE_FROM_ALL) - include_directories(${CMAKE_CURRENT_SOURCE_DIR}/external/tecio/teciosrc) - target_link_libraries(opflow INTERFACE tecio) - endif () -endif () - # ---------------------------------------------------------------------------- # Platform detection # ---------------------------------------------------------------------------- diff --git a/cmake/AMGCLConfig.cmake b/cmake/AMGCLConfig.cmake index dfc433d1..c96f55c3 100644 --- a/cmake/AMGCLConfig.cmake +++ b/cmake/AMGCLConfig.cmake @@ -19,7 +19,7 @@ macro(CONFIG_AND_INSTALL_AMGCL) execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} - -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} ${CMAKE_CURRENT_SOURCE_DIR}/external/amgcl + -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} ${CMAKE_CURRENT_LIST_DIR}/../external/amgcl RESULT_VARIABLE result WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/amgcl-build) if (result) diff --git a/cmake/FMTConfig.cmake b/cmake/FMTConfig.cmake index 2518c16c..cbe08c87 100644 --- a/cmake/FMTConfig.cmake +++ b/cmake/FMTConfig.cmake @@ -21,7 +21,7 @@ macro(CONFIG_AND_INSTALL_FMT) -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DFMT_DOC=OFF -DFMT_TEST=OFF -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} - -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} ${CMAKE_CURRENT_SOURCE_DIR}/external/fmt + -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} ${CMAKE_CURRENT_LIST_DIR}/../external/fmt RESULT_VARIABLE result WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/fmt-build) if (result) diff --git a/cmake/HYPREConfig.cmake b/cmake/HYPREConfig.cmake index 9e789c02..ba8690f6 100644 --- a/cmake/HYPREConfig.cmake +++ b/cmake/HYPREConfig.cmake @@ -35,7 +35,7 @@ macro(CONFIG_AND_INSTALL_HYPRE) -DHYPRE_ENABLE_OPENMP=${OPFLOW_WITH_OPENMP} -DHYPRE_ENABLE_MPI=${OPFLOW_WITH_MPI} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} - ${CMAKE_CURRENT_SOURCE_DIR}/external/hypre/src + ${CMAKE_CURRENT_LIST_DIR}/../external/hypre/src RESULT_VARIABLE _result WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/hypre-build) if (_result) diff --git a/cmake/SPDLOGConfig.cmake b/cmake/SPDLOGConfig.cmake index b5a4c2d6..254ea995 100644 --- a/cmake/SPDLOGConfig.cmake +++ b/cmake/SPDLOGConfig.cmake @@ -20,7 +20,7 @@ macro(CONFIG_AND_INSTALL_SPDLOG) -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DSPDLOG_BUILD_EXAMPLE=OFF -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} - -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} ${CMAKE_CURRENT_SOURCE_DIR}/external/spdlog + -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} ${CMAKE_CURRENT_LIST_DIR}/../external/spdlog RESULT_VARIABLE result WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/spdlog-build) if (result) diff --git a/cmake/TBBConfig.cmake b/cmake/TBBConfig.cmake index 9c928dad..baeab705 100644 --- a/cmake/TBBConfig.cmake +++ b/cmake/TBBConfig.cmake @@ -19,7 +19,7 @@ macro(CONFIG_AND_INSTALL_TBB) execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DTBB_TEST=OFF -DTBB_STRICT=OFF - -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} ${CMAKE_CURRENT_SOURCE_DIR}/external/tbb + -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} ${CMAKE_CURRENT_LIST_DIR}/../external/tbb RESULT_VARIABLE result WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/tbb-build) if (result) diff --git a/cmake/TECIOConfig.cmake b/cmake/TECIOConfig.cmake index e64b2e24..4dacb60e 100644 --- a/cmake/TECIOConfig.cmake +++ b/cmake/TECIOConfig.cmake @@ -19,14 +19,14 @@ macro(CONFIG_AND_INSTALL_TECIO) if (OPFLOW_WITH_MPI) execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} - -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} ${CMAKE_CURRENT_SOURCE_DIR}/external/tecio/teciompisrc + -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} ${CMAKE_CURRENT_LIST_DIR}/../external/tecio/teciompisrc RESULT_VARIABLE result WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/tecio-build) else () execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} - -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} ${CMAKE_CURRENT_SOURCE_DIR}/external/tecio/teciosrc + -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} ${CMAKE_CURRENT_LIST_DIR}/../external/tecio/teciosrc RESULT_VARIABLE result WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/tecio-build) endif () @@ -42,25 +42,25 @@ macro(CONFIG_AND_INSTALL_TECIO) # Manually install file(MAKE_DIRECTORY ${CMAKE_INSTALL_PREFIX}/include/tecio) if (OPFLOW_WITH_MPI) - file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/external/tecio/teciompisrc/TECIO.h - ${CMAKE_CURRENT_SOURCE_DIR}/external/tecio/teciompisrc/tecio_Exports.h - ${CMAKE_CURRENT_SOURCE_DIR}/external/tecio/teciompisrc/tecio.inc - ${CMAKE_CURRENT_SOURCE_DIR}/external/tecio/teciompisrc/tecio.for - ${CMAKE_CURRENT_SOURCE_DIR}/external/tecio/teciompisrc/tecio.f90 - ${CMAKE_CURRENT_SOURCE_DIR}/external/tecio/teciompisrc/tecio_license_agreement.txt - ${CMAKE_CURRENT_SOURCE_DIR}/external/tecio/teciompisrc/StandardIntegralTypes.h - DESTINATION ${CMAKE_INSTALL_PREFIX}/include/tecio) + file(COPY ${CMAKE_CURRENT_LIST_DIR}/../external/tecio/teciompisrc/TECIO.h + ${CMAKE_CURRENT_LIST_DIR}/../external/tecio/teciompisrc/tecio_Exports.h + ${CMAKE_CURRENT_LIST_DIR}/../external/tecio/teciompisrc/tecio.inc + ${CMAKE_CURRENT_LIST_DIR}/../external/tecio/teciompisrc/tecio.for + ${CMAKE_CURRENT_LIST_DIR}/../external/tecio/teciompisrc/tecio.f90 + ${CMAKE_CURRENT_LIST_DIR}/../external/tecio/teciompisrc/tecio_license_agreement.txt + ${CMAKE_CURRENT_LIST_DIR}/../external/tecio/teciompisrc/StandardIntegralTypes.h + DESTINATION ${CMAKE_INSTALL_PREFIX}/include/tecio) file(COPY ${CMAKE_CURRENT_BINARY_DIR}/tecio-build/libteciompi.a DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) else () - file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/external/tecio/teciosrc/TECIO.h - ${CMAKE_CURRENT_SOURCE_DIR}/external/tecio/teciosrc/tecio_Exports.h - ${CMAKE_CURRENT_SOURCE_DIR}/external/tecio/teciosrc/tecio.inc - ${CMAKE_CURRENT_SOURCE_DIR}/external/tecio/teciosrc/tecio.for - ${CMAKE_CURRENT_SOURCE_DIR}/external/tecio/teciosrc/tecio.f90 - ${CMAKE_CURRENT_SOURCE_DIR}/external/tecio/teciosrc/tecio_license_agreement.txt - ${CMAKE_CURRENT_SOURCE_DIR}/external/tecio/teciosrc/StandardIntegralTypes.h - DESTINATION ${CMAKE_INSTALL_PREFIX}/include/tecio) + file(COPY ${CMAKE_CURRENT_LIST_DIR}/../external/tecio/teciosrc/TECIO.h + ${CMAKE_CURRENT_LIST_DIR}/../external/tecio/teciosrc/tecio_Exports.h + ${CMAKE_CURRENT_LIST_DIR}/../external/tecio/teciosrc/tecio.inc + ${CMAKE_CURRENT_LIST_DIR}/../external/tecio/teciosrc/tecio.for + ${CMAKE_CURRENT_LIST_DIR}/../external/tecio/teciosrc/tecio.f90 + ${CMAKE_CURRENT_LIST_DIR}/../external/tecio/teciosrc/tecio_license_agreement.txt + ${CMAKE_CURRENT_LIST_DIR}/../external/tecio/teciosrc/StandardIntegralTypes.h + DESTINATION ${CMAKE_INSTALL_PREFIX}/include/tecio) file(COPY ${CMAKE_CURRENT_BINARY_DIR}/tecio-build/libtecio.a DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) endif () diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt new file mode 100644 index 00000000..7c43cc4b --- /dev/null +++ b/external/CMakeLists.txt @@ -0,0 +1,117 @@ +# ---------------------------------------------------------------------------- +# External dependencies configuration +# ---------------------------------------------------------------------------- + +# Use spdlog package +if (OPFLOW_INSTALL) + # Same as libfmt + include(${CMAKE_SOURCE_DIR}/cmake/SPDLOGConfig.cmake) + CONFIG_AND_INSTALL_SPDLOG() + find_package(spdlog REQUIRED PATHS ${CMAKE_INSTALL_PREFIX} NO_DEFAULT_PATH) +else () + add_subdirectory(${CMAKE_SOURCE_DIR}/external/spdlog EXCLUDE_FROM_ALL) +endif () +target_link_libraries(opflow INTERFACE spdlog::spdlog) + +# Use AMGCL +if (OPFLOW_INSTALL) + include(${CMAKE_SOURCE_DIR}/cmake/AMGCLConfig.cmake) + CONFIG_AND_INSTALL_AMGCL() + find_package(amgcl REQUIRED PATHS ${CMAKE_INSTALL_PREFIX} NO_DEFAULT_PATH) +else () + add_subdirectory(${CMAKE_SOURCE_DIR}/external/amgcl EXCLUDE_FROM_ALL) +endif () +target_link_libraries(opflow INTERFACE amgcl::amgcl) + +# Use TBB +if (OPFLOW_TBB_EXTERNAL) + if (NOT DEFINED TBB_DIR) + message(FATAL "Variable TBB_DIR not defined. Use -DTBB_DIR to specify TBB's install path.") + endif () + find_package(TBB REQUIRED PATHS ${TBB_DIR} NO_DEFAULT_PATH) +else () + if (OPFLOW_INSTALL) + include(${CMAKE_SOURCE_DIR}/cmake/TBBConfig.cmake) + CONFIG_AND_INSTALL_TBB() + find_package(tbb NAMES tbb TBB REQUIRED PATHS ${CMAKE_INSTALL_PREFIX} NO_DEFAULT_PATH) + else () + set(BUILD_SHARED_LIBS ON) + set(TBB_TEST OFF) + set(CMAKE_POLICY_DEFAULT_CMP0077 NEW) + add_subdirectory(${CMAKE_SOURCE_DIR}/external/tbb EXCLUDE_FROM_ALL) + find_package(tbb NAMES tbb TBB REQUIRED) + endif () +endif () +target_link_libraries(opflow INTERFACE TBB::tbb) + +# Use HYPRE package +if (OPFLOW_HYPRE_EXTERNAL) + if (NOT DEFINED HYPRE_DIR) + message(FATAL "Variable HYPRE_DIR not set. Use -DHYPRE_DIR to specify HYPRE's install path") + endif () + # Use external HYPRE + find_package(HYPRE REQUIRED PATHS ${HYPRE_DIR} NO_DEFAULT_PATH) + # Here we hard link to the found HYPRE to avoid find again at client + target_link_libraries(opflow INTERFACE HYPRE) +else () + # Use bundled HYPRE + if (OPFLOW_INSTALL) + include(${CMAKE_SOURCE_DIR}/cmake/HYPREConfig.cmake) + CONFIG_AND_INSTALL_HYPRE() + find_package(HYPRE REQUIRED PATHS ${CMAKE_INSTALL_PREFIX} NO_DEFAULT_PATH) + # HYPRE::HYPRE is only exported on install + target_link_libraries(opflow INTERFACE HYPRE::HYPRE) + else () + set(HYPRE_BUILD_TYPE Debug) + set(HYPRE_WITH_OPENMP ${OPFLOW_WITH_OPENMP}) + set(HYPRE_ENABLE_SINGLE ${OPFLOW_SINGLE_PRECISION}) + set(HYPRE_WITH_MPI ${OPFLOW_WITH_MPI}) + add_subdirectory(${CMAKE_SOURCE_DIR}/external/hypre/src EXCLUDE_FROM_ALL) + target_link_libraries(opflow INTERFACE HYPRE) + endif () +endif () + +# Use VTK package +if (OPFLOW_WITH_VTK) + target_compile_definitions(opflow INTERFACE OPFLOW_WITH_VTK) + if (OPFLOW_VTK_EXTERNAL) + if (NOT TARGET VTK) + if (NOT DEFINED VTK_DIR) + message(FATAL "Variable VTK_DIR not defined. Use -DVTK_DIR to specify VTK's install path") + endif () + find_package(VTK REQUIRED PATHS ${VTK_DIR} NO_DEFAULT_PATH) + target_compile_definitions(opflow INTERFACE OPFLOW_VTK_EXTERNAL) + endif () + else () + include(${CMAKE_SOURCE_DIR}/cmake/VTKConfig.cmake) + CONFIG_VTK() + endif () + list(APPEND PKG_CONFIG_REQUIRES VTK) + target_include_directories(opflow INTERFACE ${VTK_INCLUDE_DIRS}) + target_link_directories(opflow INTERFACE ${VTK_LIBRARY_DIRS}) + target_link_libraries(opflow INTERFACE ${VTK_LIBRARIES}) +endif () + +# Use TecIO library +if (OPFLOW_INSTALL) + include(${CMAKE_SOURCE_DIR}/cmake/TECIOConfig.cmake) + CONFIG_AND_INSTALL_TECIO() + target_include_directories(opflow INTERFACE ${CMAKE_INSTALL_PREFIX}/include/tecio) + target_link_directories(opflow INTERFACE ${CMAKE_INSTALL_PREFIX}/lib) + if (OPFLOW_WITH_MPI) + target_link_libraries(opflow INTERFACE teciompi) + target_compile_definitions(opflow INTERFACE TECIOMPI) + else () + target_link_libraries(opflow INTERFACE tecio) + endif () +else () + if (OPFLOW_WITH_MPI) + add_subdirectory(${CMAKE_SOURCE_DIR}/external/tecio/teciompisrc EXCLUDE_FROM_ALL) + target_include_directories(opflow INTERFACE ${CMAKE_SOURCE_DIR}/external/tecio/teciompisrc) + target_link_libraries(opflow INTERFACE teciompi) + else () + add_subdirectory(${CMAKE_SOURCE_DIR}/external/tecio/teciosrc EXCLUDE_FROM_ALL) + include_directories(${CMAKE_SOURCE_DIR}/external/tecio/teciosrc) + target_link_libraries(opflow INTERFACE tecio) + endif () +endif () From 6aa6189128021b3ee8ff2dd4397384e21b784785 Mon Sep 17 00:00:00 2001 From: Luohao Wang Date: Sun, 1 Jun 2025 16:25:45 +0800 Subject: [PATCH 06/31] [Core] Add seperate CMakeList for src --- CMakeLists.txt | 257 +++++++++++++++++++++------------------------ src/CMakeLists.txt | 75 +++++++++++++ 2 files changed, 195 insertions(+), 137 deletions(-) create mode 100644 src/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index c3c2b268..8f3f5189 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,68 +38,68 @@ include(GNUInstallDirs) # ---------------------------------------------------------------------------- # Set CMake policies to support later version behaviour # ---------------------------------------------------------------------------- -if (POLICY CMP0077) +if(POLICY CMP0077) cmake_policy(SET CMP0077 NEW) # option() honors variables already set -endif () +endif() # ---------------------------------------------------------------------------- # Set default build to release # ---------------------------------------------------------------------------- -if (NOT CMAKE_BUILD_TYPE) +if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose Release or Debug" FORCE) -endif () +endif() # ---------------------------------------------------------------------------- # Compiler config # ---------------------------------------------------------------------------- -if (NOT CMAKE_C_STANDARD) +if(NOT CMAKE_C_STANDARD) set(CMAKE_C_STANDARD 11) set(CMAKE_C_STANDARD_REQUIRED ON) -elseif (CMAKE_C_STANDARD LESS 11) +elseif(CMAKE_C_STANDARD LESS 11) message(WARNING "OpFlow needs C11 to compile. Changing the standard to C11.") set(CMAKE_C_STANDARD 11) set(CMAKE_C_STANDARD_REQUIRED ON) -endif () +endif() # make sure __cplusplus is defined when using msvc -if (MSVC) +if(MSVC) string(APPEND CMAKE_CXX_FLAGS " /Zc:__cplusplus /wd4267 /wd4390 /wd4244") -endif () +endif() # supress possible abi warning by upgrade compiler set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-psabi") # temporary fix for macOS 14 & CLT 15 -if (CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin" - AND CMAKE_HOST_SYSTEM_VERSION VERSION_GREATER_EQUAL 23) +if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin" + AND CMAKE_HOST_SYSTEM_VERSION VERSION_GREATER_EQUAL 23) add_link_options(-Wl,-ld_classic) -endif () +endif() set(CMAKE_CXX_EXTENSIONS OFF) -if (CMAKE_SYSTEM_NAME MATCHES "CYGWIN" OR CMAKE_SYSTEM_NAME MATCHES "MSYS") +if(CMAKE_SYSTEM_NAME MATCHES "CYGWIN" OR CMAKE_SYSTEM_NAME MATCHES "MSYS") set(CMAKE_CXX_EXTENSIONS ON) -endif () +endif() -if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") +if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") set(CMAKE_THREAD_LIBS_INIT "-lpthread") set(CMAKE_HAVE_THREADS_LIBRARY 1) set(CMAKE_USE_WIN32_THREADS_INIT 0) set(CMAKE_USE_PTHREADS_INIT 1) set(THREADS_PREFER_PTHREAD_FLAG ON) #set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++ -lc++abi") -endif () +endif() # ---------------------------------------------------------------------------- # Set OPFLOW_MASTER_PROJECT to ON if we are building opflow # ---------------------------------------------------------------------------- # Check if opflow is being used directly or via add_subdirectory, but allow overriding -if (NOT DEFINED OPFLOW_MASTER_PROJECT) - if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) +if(NOT DEFINED OPFLOW_MASTER_PROJECT) + if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) set(OPFLOW_MASTER_PROJECT ON) - else () + else() set(OPFLOW_MASTER_PROJECT OFF) - endif () -endif () + endif() +endif() option(OPFLOW_BUILD_ALL "Build all artifacts" OFF) @@ -146,142 +146,125 @@ option(OPFLOW_VTK_EXTERNAL "Use external VTK library instead of bundled" OFF) option(OPFLOW_TBB_EXTERNAL "Use external Intel TBB library instead of bundled" OFF) # clang-tidy -if (${CMAKE_VERSION} VERSION_GREATER "3.5") +if(${CMAKE_VERSION} VERSION_GREATER "3.5") option(OPFLOW_TIDY "run clang-tidy" OFF) -endif () +endif() -if (OPFLOW_TIDY) +if(OPFLOW_TIDY) set(CMAKE_CXX_CLANG_TIDY "clang-tidy") set(CMAKE_EXPORT_COMPILE_COMMANDS ON) message(STATUS "Enabled clang-tidy") -endif () - -message(STATUS "Build type: " ${CMAKE_BUILD_TYPE}) +endif() # ---------------------------------------------------------------------------- -# Header only version +# Compile options # ---------------------------------------------------------------------------- -add_library(opflow INTERFACE) -add_library(opflow::opflow ALIAS opflow) - -# Create & include the version header -configure_file(${CMAKE_CURRENT_LIST_DIR}/cmake/Version.hpp.in ${CMAKE_CURRENT_BINARY_DIR}/Version.hpp @ONLY) +include(CheckCXXCompilerFlag) +check_cxx_compiler_flag(-std=c++26 c++26support) +if(NOT c++26support) + message(FATAL_ERROR "OpFlow requires C++26 to compile.") +endif() -target_include_directories(opflow INTERFACE - "$" - "$" - "$" - "$" - "$") +message(STATUS "Build type: " ${CMAKE_BUILD_TYPE}) +add_subdirectory(src) # ---------------------------------------------------------------------------- # External dependencies # ---------------------------------------------------------------------------- add_subdirectory(external) -# ---------------------------------------------------------------------------- -# Compile options -# ---------------------------------------------------------------------------- -include(CheckCXXCompilerFlag) -check_cxx_compiler_flag(-std=c++26 c++26support) -if (NOT c++26support) - message(FATAL_ERROR "OpFlow requires C++26 to compile.") -endif () -target_compile_options(opflow INTERFACE -std=c++26) -set_property(TARGET opflow PROPERTY CXX_SCAN_FOR_MODULES ON) - # ---------------------------------------------------------------------------- # Find MPI # ---------------------------------------------------------------------------- -if (OPFLOW_WITH_MPI) +if(OPFLOW_WITH_MPI) find_package(MPI REQUIRED) target_link_libraries(opflow INTERFACE MPI::MPI_C MPI::MPI_CXX) list(APPEND PKG_CONFIG_REQUIRES MPI) -endif () +endif() # ---------------------------------------------------------------------------- # Find OpenMP # ---------------------------------------------------------------------------- -if (OPFLOW_WITH_OPENMP) +if(OPFLOW_WITH_OPENMP) # workarounds for CI to find the correct libomp - if (APPLE) - if (EXISTS /usr/local/opt/llvm/lib) + if(APPLE) + if(EXISTS /usr/local/opt/llvm/lib) link_directories("/usr/local/opt/llvm/lib") - elseif (EXISTS /opt/homebrew/lib) + elseif(EXISTS /opt/homebrew/lib) link_directories("/opt/homebrew/lib") - endif () - endif () - if (CMAKE_C_COMPILER_ID MATCHES "Clang") + endif() + endif() + if(CMAKE_C_COMPILER_ID MATCHES "Clang") set(OpenMP_C "${CMAKE_C_COMPILER}") set(OpenMP_C_FLAGS "-fopenmp=libomp -Wno-unused-command-line-argument -Wno-deprecated-pragma") set(OpenMP_C_LIB_NAMES "omp") set(OpenMP_omp_LIBRARY ${OpenMP_C_LIB_NAMES}) - endif () - if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + endif() + if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") set(OpenMP_CXX "${CMAKE_CXX_COMPILER}") set(OpenMP_CXX_FLAGS "-fopenmp=libomp -Wno-unused-command-line-argument") set(OpenMP_CXX_LIB_NAMES "omp") set(OpenMP_omp_LIBRARY ${OpenMP_CXX_LIB_NAMES}) - endif () + endif() find_package(OpenMP REQUIRED) target_link_libraries(opflow INTERFACE OpenMP::OpenMP_C OpenMP::OpenMP_CXX) target_compile_options(opflow INTERFACE ${OpenMP_CXX_FLAGS}) list(APPEND PKG_CONFIG_REQUIRES OpenMP) -endif () +endif() # ---------------------------------------------------------------------------- # Platform detection # ---------------------------------------------------------------------------- -if (UNIX) +if(UNIX) target_compile_definitions(opflow INTERFACE OPFLOW_PLATFORM_UNIX) -elseif (APPLE) +elseif(APPLE) target_compile_definitions(opflow INTERFACE OPFLOW_PLATFORM_APPLE) -elseif (WIN32) +elseif(WIN32) target_compile_definitions(opflow INTERFACE OPFLOW_PLATFORM_WIN) -endif () +endif() # ---------------------------------------------------------------------------- # Language & library features detection # ---------------------------------------------------------------------------- include(CheckIncludeFiles) check_include_files("sys/mman.h" HAS_SYS_MMAN_H) -if (HAS_SYS_MMAN_H) +if(HAS_SYS_MMAN_H) target_compile_definitions(opflow INTERFACE OPFLOW_HAS_MMAN_H) -endif () +endif() # ---------------------------------------------------------------------------- # Misc definitions according to tweak options # ---------------------------------------------------------------------------- -foreach ( - OPFLOW_OPTION - OPFLOW_SINGLE_PRECISION - OPFLOW_WITH_MPI - OPFLOW_WITH_OPENMP) - if (${OPFLOW_OPTION}) +foreach( + OPFLOW_OPTION + OPFLOW_SINGLE_PRECISION + OPFLOW_WITH_MPI + OPFLOW_WITH_OPENMP) + if(${OPFLOW_OPTION}) target_compile_definitions(opflow INTERFACE ${OPFLOW_OPTION}) - endif () -endforeach () -if (OPFLOW_WITH_MPI) + endif() +endforeach() +if(OPFLOW_WITH_MPI) target_compile_definitions(opflow INTERFACE OPFLOW_DISTRIBUTE_MODEL_MPI) -endif () +endif() -if (OPFLOW_NO_EXCEPTIONS AND NOT MSVC) +if(OPFLOW_NO_EXCEPTIONS AND NOT MSVC) target_compile_options(opflow INTERFACE -fno-exceptions) -endif () +endif() # sanitizer flags target_compile_options(opflow - INTERFACE $<$: -fsanitize=address> - INTERFACE $<$: -fsanitize=leak> - INTERFACE $<$: -fsanitize=thread> - INTERFACE $<$: -fsanitize=undefined>) + INTERFACE $<$: -fsanitize=address> + INTERFACE $<$: -fsanitize=leak> + INTERFACE $<$: -fsanitize=thread> + INTERFACE $<$: -fsanitize=undefined>) target_link_options(opflow - INTERFACE $<$: -fsanitize=address> - INTERFACE $<$: -fsanitize=leak> - INTERFACE $<$: -fsanitize=thread> - INTERFACE $<$: -fsanitize=undefined>) + INTERFACE $<$: -fsanitize=address> + INTERFACE $<$: -fsanitize=leak> + INTERFACE $<$: -fsanitize=thread> + INTERFACE $<$: -fsanitize=undefined>) # ---------------------------------------------------------------------------- # All_CI target (= AllExamples + AllBenchmarks + AllTests) @@ -291,24 +274,24 @@ add_custom_target(All_CI) # ---------------------------------------------------------------------------- # Build binaries # ---------------------------------------------------------------------------- -if (OPFLOW_BUILD_EXAMPLES OR OPFLOW_BUILD_ALL) +if(OPFLOW_BUILD_EXAMPLES OR OPFLOW_BUILD_ALL) message(STATUS "Generating examples") add_subdirectory(examples) -endif () +endif() # ---------------------------------------------------------------------------- # Build tests # ---------------------------------------------------------------------------- -if (OPFLOW_BUILD_TESTS OR OPFLOW_BUILD_ALL) +if(OPFLOW_BUILD_TESTS OR OPFLOW_BUILD_ALL) message(STATUS "Generating tests") enable_testing() add_subdirectory(test) -endif () +endif() # ---------------------------------------------------------------------------- # Build benchmarks # ---------------------------------------------------------------------------- -if (OPFLOW_BUILD_BENCHMARKS OR OPFLOW_BUILD_ALL) +if(OPFLOW_BUILD_BENCHMARKS OR OPFLOW_BUILD_ALL) message(STATUS "Generating benchmarks") # config google benchmark as part of the project set(BENCHMARK_ENABLE_INSTALL OFF) @@ -316,61 +299,61 @@ if (OPFLOW_BUILD_BENCHMARKS OR OPFLOW_BUILD_ALL) set(BENCHMARK_ENABLE_GTEST_TESTS OFF) add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/external/benchmark EXCLUDE_FROM_ALL) add_subdirectory(benchmark) -endif () +endif() # ---------------------------------------------------------------------------- # Build docs # ---------------------------------------------------------------------------- -if (OPFLOW_BUILD_DOCS OR OPFLOW_BUILD_ALL) +if(OPFLOW_BUILD_DOCS OR OPFLOW_BUILD_ALL) message(STATUS "Generating docs") find_program(SPHINX_PATH sphinx-build - HINTS $ENV{PATH} ${SPHINX_DIR}) - if (NOT SPHINX_PATH) + HINTS $ENV{PATH} ${SPHINX_DIR}) + if(NOT SPHINX_PATH) message(FATAL_ERROR "sphinx-build not found. Please install it via \ instructions at https://www.sphinx-doc.org/en/master/usage/installation.html") - else () + else() message(STATUS "Found sphinx-build at ${SPHINX_PATH}") - endif () + endif() find_program(DOXYGEN_PATH doxygen - HINTS ${DOXYGEN_DIR} - REQUIRED - ) - if (NOT DOXYGEN_PATH) + HINTS ${DOXYGEN_DIR} + REQUIRED + ) + if(NOT DOXYGEN_PATH) message(FATAL_ERROR "Doxygen not found. Please install doxygen with version >= 1.9.2") - else () + else() execute_process( - COMMAND ${DOXYGEN_PATH} --version - RESULT_VARIABLE _ - OUTPUT_VARIABLE _out + COMMAND ${DOXYGEN_PATH} --version + RESULT_VARIABLE _ + OUTPUT_VARIABLE _out ) string(REGEX REPLACE "\n$" "" _out "${_out}") - if (${_out} VERSION_LESS "1.9.2") + if(${_out} VERSION_LESS "1.9.2") message(FATAL_ERROR "Doxygen version too low. Found v${_out}, require >= v1.9.2") - endif () - endif () + endif() + endif() message(STATUS "Found Doxygen version: ${_out}") configure_file(doc/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY) file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc/doxygen) add_custom_target(doxygen_doc - COMMAND ${DOXYGEN_PATH} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + COMMAND ${DOXYGEN_PATH} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) add_custom_target(doc - COMMAND ${SPHINX_PATH} -b html - -Dbreathe_projects.OpFlow=${CMAKE_CURRENT_BINARY_DIR}/doc/doxygen/xml - ${CMAKE_CURRENT_LIST_DIR}/doc ${CMAKE_CURRENT_BINARY_DIR}/doc - DEPENDS doxygen_doc - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) -endif () + COMMAND ${SPHINX_PATH} -b html + -Dbreathe_projects.OpFlow=${CMAKE_CURRENT_BINARY_DIR}/doc/doxygen/xml + ${CMAKE_CURRENT_LIST_DIR}/doc ${CMAKE_CURRENT_BINARY_DIR}/doc + DEPENDS doxygen_doc + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +endif() # ---------------------------------------------------------------------------- # Install # ---------------------------------------------------------------------------- -if (OPFLOW_INSTALL) +if(OPFLOW_INSTALL) message(STATUS "Generating install") - IF (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) SET(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}" CACHE PATH "" FORCE) message(STATUS "Install prefix set to: ${CMAKE_INSTALL_PREFIX}") - ENDIF (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(project_config_in "${CMAKE_CURRENT_LIST_DIR}/cmake/opflowConfig.cmake.in") set(project_config_out "${CMAKE_CURRENT_BINARY_DIR}/opflowConfig.cmake") set(config_targets_file "opflowConfigTargets.cmake") @@ -386,16 +369,16 @@ if (OPFLOW_INSTALL) install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/src/ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/src") install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Version.hpp DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") install( - TARGETS opflow - EXPORT opflow - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + TARGETS opflow + EXPORT opflow + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - if (OPFLOW_WITH_VTK AND NOT OPFLOW_VTK_EXTERNAL) + if(OPFLOW_WITH_VTK AND NOT OPFLOW_VTK_EXTERNAL) install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/vtk/ - DESTINATION "${CMAKE_INSTALL_PREFIX}") - endif () + DESTINATION "${CMAKE_INSTALL_PREFIX}") + endif() # ---------------------------------------------------------------------------- # Install CMake config files @@ -412,15 +395,15 @@ if (OPFLOW_INSTALL) # Support creation of installable packages # ---------------------------------------------------------------------------- #include(cmake/opflowCPack.cmake) -endif () +endif() # uninstall target -if (NOT TARGET uninstall) +if(NOT TARGET uninstall) configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" - IMMEDIATE @ONLY) + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" + IMMEDIATE @ONLY) add_custom_target(uninstall - COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) -endif () + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) +endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 00000000..6c45b1fa --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,75 @@ +# ---------------------------------------------------------------------------- +# CMakeLists.txt for the opflow library +# ---------------------------------------------------------------------------- +cmake_minimum_required(VERSION 3.16) + +# ---------------------------------------------------------------------------- +# Header only version +# ---------------------------------------------------------------------------- +add_library(opflow INTERFACE) +add_library(opflow::opflow ALIAS opflow) + +target_compile_options(opflow INTERFACE -std=c++26) +set_property(TARGET opflow PROPERTY CXX_SCAN_FOR_MODULES ON) + +# Create & include the version header +configure_file(${CMAKE_CURRENT_LIST_DIR}/../cmake/Version.hpp.in ${CMAKE_BINARY_DIR}/Version.hpp @ONLY) + +target_include_directories(opflow INTERFACE + "$" + "$" + "$" + "$" + "$") + +# ---------------------------------------------------------------------------- +# Platform detection +# ---------------------------------------------------------------------------- +if(UNIX) + target_compile_definitions(opflow INTERFACE OPFLOW_PLATFORM_UNIX) +elseif(APPLE) + target_compile_definitions(opflow INTERFACE OPFLOW_PLATFORM_APPLE) +elseif(WIN32) + target_compile_definitions(opflow INTERFACE OPFLOW_PLATFORM_WIN) +endif() + +# ---------------------------------------------------------------------------- +# Language & library features detection +# ---------------------------------------------------------------------------- +include(CheckIncludeFiles) +check_include_files("sys/mman.h" HAS_SYS_MMAN_H) +if(HAS_SYS_MMAN_H) + target_compile_definitions(opflow INTERFACE OPFLOW_HAS_MMAN_H) +endif() + +# ---------------------------------------------------------------------------- +# Misc definitions according to tweak options +# ---------------------------------------------------------------------------- +foreach( + OPFLOW_OPTION + OPFLOW_SINGLE_PRECISION + OPFLOW_WITH_MPI + OPFLOW_WITH_OPENMP) + if(${OPFLOW_OPTION}) + target_compile_definitions(opflow INTERFACE ${OPFLOW_OPTION}) + endif() +endforeach() +if(OPFLOW_WITH_MPI) + target_compile_definitions(opflow INTERFACE OPFLOW_DISTRIBUTE_MODEL_MPI) +endif() + +if(OPFLOW_NO_EXCEPTIONS AND NOT MSVC) + target_compile_options(opflow INTERFACE -fno-exceptions) +endif() + +# sanitizer flags +target_compile_options(opflow + INTERFACE $<$: -fsanitize=address> + INTERFACE $<$: -fsanitize=leak> + INTERFACE $<$: -fsanitize=thread> + INTERFACE $<$: -fsanitize=undefined>) +target_link_options(opflow + INTERFACE $<$: -fsanitize=address> + INTERFACE $<$: -fsanitize=leak> + INTERFACE $<$: -fsanitize=thread> + INTERFACE $<$: -fsanitize=undefined>) From 44b9314ceca522513c1b1d0bbded1051c2aa70cd Mon Sep 17 00:00:00 2001 From: Luohao Wang Date: Mon, 2 Jun 2025 12:58:19 +0800 Subject: [PATCH 07/31] [Ext] Update external deps --- external/amgcl/CMakeLists.txt | 4 +- external/googletest/.clang-format | 4 +- .../.github/ISSUE_TEMPLATE/00-bug_report.md | 35 - .../.github/ISSUE_TEMPLATE/00-bug_report.yml | 53 + .../ISSUE_TEMPLATE/10-feature_request.md | 21 - .../ISSUE_TEMPLATE/10-feature_request.yml | 33 + .../.github/ISSUE_TEMPLATE/config.yml | 4 + external/googletest/.gitignore | 5 + external/googletest/BUILD.bazel | 78 +- external/googletest/CMakeLists.txt | 45 +- external/googletest/CONTRIBUTING.md | 152 +- external/googletest/CONTRIBUTORS | 3 + .../scripts/upload_gtest.py => MODULE.bazel} | 86 +- external/googletest/README.md | 161 +- external/googletest/WORKSPACE | 63 +- external/googletest/WORKSPACE.bzlmod | 35 + external/googletest/ci/linux-presubmit.sh | 85 +- external/googletest/ci/macos-presubmit.sh | 13 +- external/googletest/ci/windows-presubmit.bat | 75 + external/googletest/docs/_data/navigation.yml | 84 +- .../googletest/docs/_layouts/default.html | 79 +- external/googletest/docs/_sass/main.scss | 2 +- external/googletest/docs/advanced.md | 1706 ++-- .../docs/community_created_documentation.md | 7 +- external/googletest/docs/faq.md | 567 +- external/googletest/docs/gmock_cheat_sheet.md | 76 +- external/googletest/docs/gmock_cook_book.md | 2180 +++-- external/googletest/docs/gmock_faq.md | 216 +- external/googletest/docs/gmock_for_dummies.md | 594 +- external/googletest/docs/index.md | 28 +- external/googletest/docs/pkgconfig.md | 95 +- external/googletest/docs/platforms.md | 36 +- external/googletest/docs/primer.md | 389 +- external/googletest/docs/quickstart-bazel.md | 119 +- external/googletest/docs/quickstart-cmake.md | 84 +- external/googletest/docs/reference/actions.md | 44 +- .../googletest/docs/reference/assertions.md | 279 +- .../googletest/docs/reference/matchers.md | 209 +- external/googletest/docs/reference/mocking.md | 259 +- external/googletest/docs/reference/testing.md | 590 +- external/googletest/docs/samples.md | 31 +- external/googletest/fake_fuchsia_sdk.bzl | 61 + external/googletest/googlemock/CMakeLists.txt | 295 +- external/googletest/googlemock/README.md | 47 +- external/googletest/googlemock/docs/README.md | 4 +- .../googlemock/include/gmock/gmock-actions.h | 1146 ++- .../include/gmock/gmock-cardinalities.h | 7 +- .../include/gmock/gmock-function-mocker.h | 142 +- .../googlemock/include/gmock/gmock-matchers.h | 1347 ++- .../include/gmock/gmock-more-actions.h | 630 +- .../include/gmock/gmock-more-matchers.h | 64 +- .../include/gmock/gmock-nice-strict.h | 40 +- .../include/gmock/gmock-spec-builders.h | 648 +- .../googlemock/include/gmock/gmock.h | 22 +- .../include/gmock/internal/custom/README.md | 14 +- .../internal/custom/gmock-generated-actions.h | 3 +- .../gmock/internal/custom/gmock-matchers.h | 7 +- .../gmock/internal/custom/gmock-port.h | 5 +- .../gmock/internal/gmock-internal-utils.h | 91 +- .../include/gmock/internal/gmock-port.h | 78 +- .../googletest/googlemock/scripts/README.md | 4 - .../googlemock/scripts/fuse_gmock_files.py | 256 - .../googlemock/scripts/generator/LICENSE | 203 - .../googlemock/scripts/generator/README | 34 - .../scripts/generator/README.cppclean | 115 - .../scripts/generator/cpp/__init__.py | 0 .../googlemock/scripts/generator/cpp/ast.py | 1772 ---- .../scripts/generator/cpp/gmock_class.py | 247 - .../scripts/generator/cpp/gmock_class_test.py | 570 -- .../scripts/generator/cpp/keywords.py | 55 - .../scripts/generator/cpp/tokenize.py | 279 - .../googlemock/scripts/generator/cpp/utils.py | 37 - .../googlemock/scripts/generator/gmock_gen.py | 30 - .../googlemock/src/gmock-cardinalities.cc | 11 +- .../googlemock/src/gmock-internal-utils.cc | 98 +- .../googlemock/src/gmock-matchers.cc | 37 +- .../googlemock/src/gmock-spec-builders.cc | 225 +- external/googletest/googlemock/src/gmock.cc | 61 +- .../googletest/googlemock/src/gmock_main.cc | 9 +- .../googletest/googlemock/test/BUILD.bazel | 4 +- .../googlemock/test/gmock-actions_test.cc | 858 +- .../test/gmock-cardinalities_test.cc | 7 +- .../test/gmock-function-mocker_test.cc | 184 +- .../test/gmock-internal-utils_test.cc | 105 +- .../test/gmock-matchers-arithmetic_test.cc | 1699 ++++ .../test/gmock-matchers-comparisons_test.cc | 2496 +++++ .../test/gmock-matchers-containers_test.cc | 3446 +++++++ .../test/gmock-matchers-misc_test.cc | 1882 ++++ .../googlemock/test/gmock-matchers_test.cc | 8498 ----------------- .../googlemock/test/gmock-matchers_test.h | 192 + .../test/gmock-more-actions_test.cc | 125 +- .../googlemock/test/gmock-nice-strict_test.cc | 60 +- .../googlemock/test/gmock-pp_test.cc | 2 +- .../test/gmock-spec-builders_test.cc | 242 +- .../googlemock/test/gmock_all_test.cc | 5 +- .../googlemock/test/gmock_ex_test.cc | 2 + .../googlemock/test/gmock_leak_test.py | 99 +- .../googlemock/test/gmock_leak_test_.cc | 7 +- .../googlemock/test/gmock_link_test.h | 31 +- .../googlemock/test/gmock_output_test.py | 162 +- .../googlemock/test/gmock_output_test_.cc | 26 +- .../test/gmock_output_test_golden.txt | 30 +- .../googlemock/test/gmock_stress_test.cc | 53 +- .../googletest/googlemock/test/gmock_test.cc | 38 +- .../googlemock/test/gmock_test_utils.py | 78 +- external/googletest/googletest/CMakeLists.txt | 461 +- external/googletest/googletest/README.md | 202 +- .../googletest/cmake/Config.cmake.in | 4 + .../googletest/cmake/internal_utils.cmake | 510 +- external/googletest/googletest/docs/README.md | 4 +- .../include/gtest/gtest-assertion-result.h | 244 + .../include/gtest/gtest-death-test.h | 28 +- .../googletest/include/gtest/gtest-matchers.h | 106 +- .../googletest/include/gtest/gtest-message.h | 44 +- .../include/gtest/gtest-param-test.h | 180 +- .../googletest/include/gtest/gtest-printers.h | 250 +- .../googletest/include/gtest/gtest-spi.h | 23 +- .../include/gtest/gtest-test-part.h | 18 +- .../include/gtest/gtest-typed-test.h | 52 +- .../googletest/include/gtest/gtest.h | 411 +- .../include/gtest/gtest_pred_impl.h | 12 +- .../googletest/include/gtest/gtest_prod.h | 3 +- .../include/gtest/internal/custom/README.md | 44 +- .../internal/gtest-death-test-internal.h | 84 +- .../include/gtest/internal/gtest-filepath.h | 31 +- .../include/gtest/internal/gtest-internal.h | 323 +- .../include/gtest/internal/gtest-param-util.h | 320 +- .../include/gtest/internal/gtest-port-arch.h | 12 +- .../include/gtest/internal/gtest-port.h | 1469 +-- .../include/gtest/internal/gtest-string.h | 9 +- .../include/gtest/internal/gtest-type-util.h | 38 +- .../googletest/samples/prime_tables.h | 7 +- .../googletest/samples/sample10_unittest.cc | 1 - .../googletest/samples/sample3_unittest.cc | 2 +- .../googletest/samples/sample5_unittest.cc | 2 +- .../googletest/samples/sample6_unittest.cc | 2 +- .../googletest/samples/sample7_unittest.cc | 2 +- .../googletest/samples/sample8_unittest.cc | 8 +- .../googletest/samples/sample9_unittest.cc | 7 +- .../googletest/googletest/scripts/README.md | 4 - .../googletest/googletest/scripts/common.py | 81 - .../googletest/scripts/fuse_gtest_files.py | 254 - .../googletest/scripts/gen_gtest_pred_impl.py | 737 -- .../googletest/scripts/gtest-config.in | 274 - .../googletest/scripts/release_docs.py | 160 - .../googletest/scripts/run_with_path.py | 34 - .../googletest/googletest/scripts/upload.py | 1410 --- .../googletest/googletest/src/gtest-all.cc | 1 + .../googletest/src/gtest-assertion-result.cc | 77 + .../googletest/src/gtest-death-test.cc | 246 +- .../googletest/src/gtest-filepath.cc | 189 +- .../googletest/src/gtest-internal-inl.h | 250 +- .../googletest/googletest/src/gtest-port.cc | 258 +- .../googletest/src/gtest-printers.cc | 59 +- .../googletest/src/gtest-test-part.cc | 5 +- .../googletest/src/gtest-typed-test.cc | 6 +- external/googletest/googletest/src/gtest.cc | 1551 +-- .../googletest/googletest/src/gtest_main.cc | 19 +- .../googletest/googletest/test/BUILD.bazel | 75 +- .../googletest-break-on-failure-unittest.py | 232 +- .../googletest-break-on-failure-unittest_.cc | 8 +- .../test/googletest-catch-exceptions-test.py | 392 +- .../googletest/test/googletest-color-test.py | 147 +- .../test/googletest-death-test-test.cc | 502 +- .../test/googletest-death-test_ex_test.cc | 8 +- .../test/googletest-env-var-test.py | 101 +- .../test/googletest-env-var-test_.cc | 30 +- ...no-test-linked-test-with-disabled-test_.cc | 38 + ...-no-test-linked-test-with-enabled-test_.cc | 38 + .../googletest-fail-if-no-test-linked-test.py | 169 + .../test/googletest-failfast-unittest.py | 696 +- .../test/googletest-filepath-test.cc | 50 +- .../test/googletest-filter-unittest.py | 918 +- .../googletest-global-environment-unittest.py | 111 +- .../test/googletest-json-outfiles-test.py | 263 +- .../test/googletest-json-output-unittest.py | 1609 ++-- .../test/googletest-list-tests-unittest.py | 195 +- .../test/googletest-list-tests-unittest_.cc | 3 + .../test/googletest-listener-test.cc | 45 +- .../test/googletest-message-test.cc | 44 +- .../test/googletest-options-test.cc | 55 +- .../googletest-output-test-golden-lin.txt | 33 +- .../googletest/test/googletest-output-test.py | 437 +- .../test/googletest-output-test_.cc | 37 +- ...oogletest-param-test-invalid-name1-test.py | 24 +- ...oogletest-param-test-invalid-name2-test.py | 24 +- ...ogletest-param-test-invalid-name2-test_.cc | 2 + .../test/googletest-param-test-test.cc | 161 +- .../googletest/test/googletest-port-test.cc | 146 +- .../test/googletest-printers-test.cc | 538 +- .../test/googletest-setuptestsuite-test.py | 27 +- .../test/googletest-setuptestsuite-test_.cc | 4 +- .../test/googletest-shuffle-test.py | 512 +- .../test/googletest-shuffle-test_.cc | 4 +- .../test/googletest-throw-on-failure-test.py | 203 +- .../test/googletest-uninitialized-test.py | 37 +- .../googletest/test/gtest-typed-test_test.cc | 5 +- .../test/gtest-unittest-api_test.cc | 24 +- .../googletest/test/gtest_dirs_test.cc | 101 + .../googletest/test/gtest_environment_test.cc | 102 +- .../googletest/test/gtest_help_test.py | 208 +- .../googletest/test/gtest_help_test_.cc | 2 +- .../googletest/test/gtest_json_test_utils.py | 57 +- .../test/gtest_list_output_unittest.py | 103 +- .../test/gtest_pred_impl_unittest.cc | 14 +- .../googletest/test/gtest_prod_test.cc | 2 +- .../googletest/test/gtest_repeat_test.cc | 38 +- .../test/gtest_skip_check_output_test.py | 19 +- ...test_skip_environment_check_output_test.py | 13 +- .../googletest/test/gtest_stress_test.cc | 9 +- .../googletest/test/gtest_test_utils.py | 364 +- .../googletest/test/gtest_testbridge_test.py | 26 +- .../test/gtest_throw_on_failure_ex_test.cc | 2 +- .../googletest/test/gtest_unittest.cc | 2169 ++--- .../test/gtest_xml_outfile2_test_.cc | 38 +- .../test/gtest_xml_outfiles_test.py | 142 +- .../test/gtest_xml_output_unittest.py | 560 +- .../test/gtest_xml_output_unittest_.cc | 55 +- .../googletest/test/gtest_xml_test_utils.py | 357 +- external/googletest/googletest_deps.bzl | 28 + external/googletest/library.json | 62 - external/tbb/CMakeLists.txt | 2 +- external/tecio/teciompisrc/CMakeLists.txt | 2 +- external/tecio/teciosrc/CMakeLists.txt | 2 +- 224 files changed, 31023 insertions(+), 29583 deletions(-) delete mode 100644 external/googletest/.github/ISSUE_TEMPLATE/00-bug_report.md create mode 100644 external/googletest/.github/ISSUE_TEMPLATE/00-bug_report.yml delete mode 100644 external/googletest/.github/ISSUE_TEMPLATE/10-feature_request.md create mode 100644 external/googletest/.github/ISSUE_TEMPLATE/10-feature_request.yml rename external/googletest/{googletest/scripts/upload_gtest.py => MODULE.bazel} (50%) create mode 100644 external/googletest/WORKSPACE.bzlmod create mode 100644 external/googletest/ci/windows-presubmit.bat create mode 100644 external/googletest/fake_fuchsia_sdk.bzl delete mode 100644 external/googletest/googlemock/scripts/README.md delete mode 100644 external/googletest/googlemock/scripts/fuse_gmock_files.py delete mode 100644 external/googletest/googlemock/scripts/generator/LICENSE delete mode 100644 external/googletest/googlemock/scripts/generator/README delete mode 100644 external/googletest/googlemock/scripts/generator/README.cppclean delete mode 100644 external/googletest/googlemock/scripts/generator/cpp/__init__.py delete mode 100644 external/googletest/googlemock/scripts/generator/cpp/ast.py delete mode 100644 external/googletest/googlemock/scripts/generator/cpp/gmock_class.py delete mode 100644 external/googletest/googlemock/scripts/generator/cpp/gmock_class_test.py delete mode 100644 external/googletest/googlemock/scripts/generator/cpp/keywords.py delete mode 100644 external/googletest/googlemock/scripts/generator/cpp/tokenize.py delete mode 100644 external/googletest/googlemock/scripts/generator/cpp/utils.py delete mode 100644 external/googletest/googlemock/scripts/generator/gmock_gen.py create mode 100644 external/googletest/googlemock/test/gmock-matchers-arithmetic_test.cc create mode 100644 external/googletest/googlemock/test/gmock-matchers-comparisons_test.cc create mode 100644 external/googletest/googlemock/test/gmock-matchers-containers_test.cc create mode 100644 external/googletest/googlemock/test/gmock-matchers-misc_test.cc delete mode 100644 external/googletest/googlemock/test/gmock-matchers_test.cc create mode 100644 external/googletest/googlemock/test/gmock-matchers_test.h mode change 100644 => 100755 external/googletest/googlemock/test/gmock_leak_test.py mode change 100644 => 100755 external/googletest/googlemock/test/gmock_output_test.py mode change 100644 => 100755 external/googletest/googlemock/test/gmock_test_utils.py create mode 100644 external/googletest/googletest/include/gtest/gtest-assertion-result.h delete mode 100644 external/googletest/googletest/scripts/README.md delete mode 100644 external/googletest/googletest/scripts/common.py delete mode 100644 external/googletest/googletest/scripts/fuse_gtest_files.py delete mode 100644 external/googletest/googletest/scripts/gen_gtest_pred_impl.py delete mode 100644 external/googletest/googletest/scripts/gtest-config.in delete mode 100644 external/googletest/googletest/scripts/release_docs.py delete mode 100644 external/googletest/googletest/scripts/run_with_path.py delete mode 100644 external/googletest/googletest/scripts/upload.py create mode 100644 external/googletest/googletest/src/gtest-assertion-result.cc mode change 100644 => 100755 external/googletest/googletest/test/googletest-break-on-failure-unittest.py mode change 100644 => 100755 external/googletest/googletest/test/googletest-catch-exceptions-test.py mode change 100644 => 100755 external/googletest/googletest/test/googletest-color-test.py mode change 100644 => 100755 external/googletest/googletest/test/googletest-env-var-test.py create mode 100644 external/googletest/googletest/test/googletest-fail-if-no-test-linked-test-with-disabled-test_.cc create mode 100644 external/googletest/googletest/test/googletest-fail-if-no-test-linked-test-with-enabled-test_.cc create mode 100755 external/googletest/googletest/test/googletest-fail-if-no-test-linked-test.py mode change 100644 => 100755 external/googletest/googletest/test/googletest-failfast-unittest.py mode change 100644 => 100755 external/googletest/googletest/test/googletest-filter-unittest.py mode change 100644 => 100755 external/googletest/googletest/test/googletest-list-tests-unittest.py mode change 100644 => 100755 external/googletest/googletest/test/googletest-output-test.py mode change 100644 => 100755 external/googletest/googletest/test/googletest-setuptestsuite-test.py mode change 100644 => 100755 external/googletest/googletest/test/googletest-shuffle-test.py mode change 100644 => 100755 external/googletest/googletest/test/googletest-throw-on-failure-test.py mode change 100644 => 100755 external/googletest/googletest/test/googletest-uninitialized-test.py create mode 100644 external/googletest/googletest/test/gtest_dirs_test.cc mode change 100644 => 100755 external/googletest/googletest/test/gtest_help_test.py mode change 100644 => 100755 external/googletest/googletest/test/gtest_skip_check_output_test.py mode change 100644 => 100755 external/googletest/googletest/test/gtest_skip_environment_check_output_test.py mode change 100644 => 100755 external/googletest/googletest/test/gtest_test_utils.py mode change 100644 => 100755 external/googletest/googletest/test/gtest_testbridge_test.py mode change 100644 => 100755 external/googletest/googletest/test/gtest_xml_outfiles_test.py mode change 100644 => 100755 external/googletest/googletest/test/gtest_xml_output_unittest.py mode change 100644 => 100755 external/googletest/googletest/test/gtest_xml_test_utils.py create mode 100644 external/googletest/googletest_deps.bzl delete mode 100644 external/googletest/library.json diff --git a/external/amgcl/CMakeLists.txt b/external/amgcl/CMakeLists.txt index f2288442..44162c72 100755 --- a/external/amgcl/CMakeLists.txt +++ b/external/amgcl/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.1...3.28) if (NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Build type") message(STATUS "No build type selected, default to ${CMAKE_BUILD_TYPE}") @@ -7,7 +7,7 @@ endif() project(AMGCL) if (NOT (CMAKE_VERSION LESS 3.3)) - cmake_policy(SET CMP0058 OLD) + #cmake_policy(SET CMP0058 OLD) endif() set(AMGCL_MASTER_PROJECT OFF) diff --git a/external/googletest/.clang-format b/external/googletest/.clang-format index 56ba7ee4..5b9bfe6d 100644 --- a/external/googletest/.clang-format +++ b/external/googletest/.clang-format @@ -1,4 +1,4 @@ # Run manually to reformat a file: # clang-format -i --style=file -Language: Cpp -BasedOnStyle: Google +Language: Cpp +BasedOnStyle: Google diff --git a/external/googletest/.github/ISSUE_TEMPLATE/00-bug_report.md b/external/googletest/.github/ISSUE_TEMPLATE/00-bug_report.md deleted file mode 100644 index 8bfa24a3..00000000 --- a/external/googletest/.github/ISSUE_TEMPLATE/00-bug_report.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -name: Bug report about: Create a report to help us improve title: '' -labels: 'bug' assignees: '' ---- - -**Describe the bug** - -Include a clear and concise description of what the problem is, including what you expected to happen, and what actually -happened. - -**Steps to reproduce the bug** - -It's important that we are able to reproduce the problem that you are experiencing. Please provide all code and relevant -steps to reproduce the problem, including your `BUILD`/`CMakeLists.txt` file and build commands. Links to a GitHub -branch or [godbolt.org](https://godbolt.org/) that demonstrate the problem are also helpful. - -**Does the bug persist in the most recent commit?** - -We recommend using the latest commit in the master branch in your projects. - -**What operating system and version are you using?** - -If you are using a Linux distribution please include the name and version of the distribution as well. - -**What compiler and version are you using?** - -Please include the output of `gcc -v` or `clang -v`, or the equivalent for your compiler. - -**What build system are you using?** - -Please include the output of `bazel --version` or `cmake --version`, or the equivalent for your build system. - -**Additional context** - -Add any other context about the problem here. diff --git a/external/googletest/.github/ISSUE_TEMPLATE/00-bug_report.yml b/external/googletest/.github/ISSUE_TEMPLATE/00-bug_report.yml new file mode 100644 index 00000000..586779ad --- /dev/null +++ b/external/googletest/.github/ISSUE_TEMPLATE/00-bug_report.yml @@ -0,0 +1,53 @@ +name: Bug Report +description: Let us know that something does not work as expected. +title: "[Bug]: Please title this bug report" +body: + - type: textarea + id: what-happened + attributes: + label: Describe the issue + description: What happened, and what did you expect to happen? + validations: + required: true + - type: textarea + id: steps + attributes: + label: Steps to reproduce the problem + description: It is important that we are able to reproduce the problem that you are experiencing. Please provide all code and relevant steps to reproduce the problem, including your `BUILD`/`CMakeLists.txt` file and build commands. Links to a GitHub branch or [godbolt.org](https://godbolt.org/) that demonstrate the problem are also helpful. + validations: + required: true + - type: textarea + id: version + attributes: + label: What version of GoogleTest are you using? + description: Please include the output of `git rev-parse HEAD` or the GoogleTest release version number that you are using. + validations: + required: true + - type: textarea + id: os + attributes: + label: What operating system and version are you using? + description: If you are using a Linux distribution please include the name and version of the distribution as well. + validations: + required: true + - type: textarea + id: compiler + attributes: + label: What compiler and version are you using? + description: Please include the output of `gcc -v` or `clang -v`, or the equivalent for your compiler. + validations: + required: true + - type: textarea + id: buildsystem + attributes: + label: What build system are you using? + description: Please include the output of `bazel --version` or `cmake --version`, or the equivalent for your build system. + validations: + required: true + - type: textarea + id: additional + attributes: + label: Additional context + description: Add any other context about the problem here. + validations: + required: false diff --git a/external/googletest/.github/ISSUE_TEMPLATE/10-feature_request.md b/external/googletest/.github/ISSUE_TEMPLATE/10-feature_request.md deleted file mode 100644 index 586b9b2e..00000000 --- a/external/googletest/.github/ISSUE_TEMPLATE/10-feature_request.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -name: Feature request about: Propose a new feature title: '' -labels: 'enhancement' assignees: '' ---- - -**Does the feature exist in the most recent commit?** - -We recommend using the latest commit from GitHub in your projects. - -**Why do we need this feature?** - -Ideally, explain why a combination of existing features cannot be used instead. - -**Describe the proposal** - -Include a detailed description of the feature, with usage examples. - -**Is the feature specific to an operating system, compiler, or build system version?** - -If it is, please specify which versions. - diff --git a/external/googletest/.github/ISSUE_TEMPLATE/10-feature_request.yml b/external/googletest/.github/ISSUE_TEMPLATE/10-feature_request.yml new file mode 100644 index 00000000..f3bbc091 --- /dev/null +++ b/external/googletest/.github/ISSUE_TEMPLATE/10-feature_request.yml @@ -0,0 +1,33 @@ +name: Feature request +description: Propose a new feature. +title: "[FR]: Please title this feature request" +labels: "enhancement" +body: + - type: textarea + id: version + attributes: + label: Does the feature exist in the most recent commit? + description: We recommend using the latest commit from GitHub in your projects. + validations: + required: true + - type: textarea + id: why + attributes: + label: Why do we need this feature? + description: Ideally, explain why a combination of existing features cannot be used instead. + validations: + required: true + - type: textarea + id: proposal + attributes: + label: Describe the proposal. + description: Include a detailed description of the feature, with usage examples. + validations: + required: true + - type: textarea + id: platform + attributes: + label: Is the feature specific to an operating system, compiler, or build system version? + description: If it is, please specify which versions. + validations: + required: true diff --git a/external/googletest/.github/ISSUE_TEMPLATE/config.yml b/external/googletest/.github/ISSUE_TEMPLATE/config.yml index 3ba13e0c..65170d10 100644 --- a/external/googletest/.github/ISSUE_TEMPLATE/config.yml +++ b/external/googletest/.github/ISSUE_TEMPLATE/config.yml @@ -1 +1,5 @@ blank_issues_enabled: false +contact_links: + - name: Get Help + url: https://github.com/google/googletest/discussions + about: Please ask and answer questions here. diff --git a/external/googletest/.gitignore b/external/googletest/.gitignore index f08cb72a..f0df39db 100644 --- a/external/googletest/.gitignore +++ b/external/googletest/.gitignore @@ -8,6 +8,7 @@ bazel-genfiles bazel-googletest bazel-out bazel-testlogs +MODULE.bazel.lock # python *.pyc @@ -24,6 +25,10 @@ Win32-Release/ x64-Debug/ x64-Release/ +# VSCode files +.cache/ +cmake-variants.yaml + # Ignore autoconf / automake files Makefile.in aclocal.m4 diff --git a/external/googletest/BUILD.bazel b/external/googletest/BUILD.bazel index 965c518d..53501454 100644 --- a/external/googletest/BUILD.bazel +++ b/external/googletest/BUILD.bazel @@ -30,19 +30,38 @@ # # Bazel Build for Google C++ Testing Framework(Google Test) -load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test") - package(default_visibility = ["//visibility:public"]) licenses(["notice"]) exports_files(["LICENSE"]) +config_setting( + name = "qnx", + constraint_values = ["@platforms//os:qnx"], +) + config_setting( name = "windows", constraint_values = ["@platforms//os:windows"], ) +config_setting( + name = "freebsd", + constraint_values = ["@platforms//os:freebsd"], +) + +config_setting( + name = "openbsd", + constraint_values = ["@platforms//os:openbsd"], +) + +# NOTE: Fuchsia is not an officially supported platform. +config_setting( + name = "fuchsia", + constraint_values = ["@platforms//os:fuchsia"], +) + config_setting( name = "msvc_compiler", flag_values = { @@ -64,6 +83,10 @@ cc_library( ) # Google Test including Google Mock + +# For an actual test, use `gtest` and also `gtest_main` if you depend on gtest's +# main(). For a library, use `gtest_for_library` instead if the library can be +# testonly. cc_library( name = "gtest", srcs = glob( @@ -86,6 +109,7 @@ cc_library( "googlemock/include/gmock/*.h", ]), copts = select({ + ":qnx": [], ":windows": [], "//conditions:default": ["-pthread"], }), @@ -104,23 +128,59 @@ cc_library( "googletest/include", ], linkopts = select({ + ":qnx": ["-lregex"], ":windows": [], + ":freebsd": [ + "-lm", + "-pthread", + ], + ":openbsd": [ + "-lm", + "-pthread", + ], "//conditions:default": ["-pthread"], }), deps = select({ ":has_absl": [ - "@com_google_absl//absl/debugging:failure_signal_handler", - "@com_google_absl//absl/debugging:stacktrace", - "@com_google_absl//absl/debugging:symbolize", - "@com_google_absl//absl/strings", - "@com_google_absl//absl/types:any", - "@com_google_absl//absl/types:optional", - "@com_google_absl//absl/types:variant", + "@abseil-cpp//absl/container:flat_hash_set", + "@abseil-cpp//absl/debugging:failure_signal_handler", + "@abseil-cpp//absl/debugging:stacktrace", + "@abseil-cpp//absl/debugging:symbolize", + "@abseil-cpp//absl/flags:flag", + "@abseil-cpp//absl/flags:parse", + "@abseil-cpp//absl/flags:reflection", + "@abseil-cpp//absl/flags:usage", + "@abseil-cpp//absl/strings", + "@abseil-cpp//absl/types:any", + "@abseil-cpp//absl/types:optional", + "@abseil-cpp//absl/types:variant", + "@re2//:re2", + ], + "//conditions:default": [], + }) + select({ + # `gtest-death-test.cc` has `EXPECT_DEATH` that spawns a process, + # expects it to crash and inspects its logs with the given matcher, + # so that's why these libraries are needed. + # Otherwise, builds targeting Fuchsia would fail to compile. + ":fuchsia": [ + "@fuchsia_sdk//pkg/fdio", + "@fuchsia_sdk//pkg/syslog", + "@fuchsia_sdk//pkg/zx", ], "//conditions:default": [], }), ) +# `gtest`, but testonly. See guidance on `gtest` for when to use this. +alias( + name = "gtest_for_library", + actual = ":gtest", + testonly = True, +) + +# Implements main() for tests using gtest. Prefer to depend on `gtest` as well +# to ensure compliance with the layering_check Bazel feature where only the +# direct hdrs values are available. cc_library( name = "gtest_main", srcs = ["googlemock/src/gmock_main.cc"], diff --git a/external/googletest/CMakeLists.txt b/external/googletest/CMakeLists.txt index c94dc57c..0567ae7d 100644 --- a/external/googletest/CMakeLists.txt +++ b/external/googletest/CMakeLists.txt @@ -1,37 +1,36 @@ # Note: CMake support is community-based. The maintainers do not use CMake # internally. -cmake_minimum_required(VERSION 2.8.12) - -if (POLICY CMP0048) - cmake_policy(SET CMP0048 NEW) -endif (POLICY CMP0048) +cmake_minimum_required(VERSION 3.16) project(googletest-distribution) -set(GOOGLETEST_VERSION 1.11.0) +set(GOOGLETEST_VERSION 1.17.0) -if (CMAKE_VERSION VERSION_GREATER "3.0.2") - if (NOT CYGWIN AND NOT MSYS AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL QNX) - set(CMAKE_CXX_EXTENSIONS OFF) - endif () -endif () +if(NOT CYGWIN AND NOT MSYS AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL QNX) + set(CMAKE_CXX_EXTENSIONS OFF) +endif() enable_testing() include(CMakeDependentOption) include(GNUInstallDirs) -#Note that googlemock target already builds googletest +# Note that googlemock target already builds googletest. option(BUILD_GMOCK "Builds the googlemock subproject" ON) option(INSTALL_GTEST "Enable installation of googletest. (Projects embedding googletest may want to turn this OFF.)" ON) - -# temporary fix for macOS 14 & CLT 15 -if (CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin" - AND CMAKE_HOST_SYSTEM_VERSION VERSION_GREATER_EQUAL 23) - add_link_options(-Wl,-ld_classic) -endif () -if (BUILD_GMOCK) - add_subdirectory(googlemock) -else () - add_subdirectory(googletest) -endif () +option(GTEST_HAS_ABSL "Use Abseil and RE2. Requires Abseil and RE2 to be separately added to the build." OFF) + +if(GTEST_HAS_ABSL) + if(NOT TARGET absl::base) + find_package(absl REQUIRED) + endif() + if(NOT TARGET re2::re2) + find_package(re2 REQUIRED) + endif() +endif() + +if(BUILD_GMOCK) + add_subdirectory( googlemock ) +else() + add_subdirectory( googletest ) +endif() diff --git a/external/googletest/CONTRIBUTING.md b/external/googletest/CONTRIBUTING.md index e93fe630..ab5a47bf 100644 --- a/external/googletest/CONTRIBUTING.md +++ b/external/googletest/CONTRIBUTING.md @@ -2,80 +2,95 @@ ## Contributor License Agreements -We'd love to accept your patches! Before we can take them, we have to jump a couple of legal hurdles. +We'd love to accept your patches! Before we can take them, we have to jump a +couple of legal hurdles. Please fill out either the individual or corporate Contributor License Agreement (CLA). -* If you are an individual writing original source code and you're sure you own the intellectual property, then you'll - need to sign an - [individual CLA](https://developers.google.com/open-source/cla/individual). -* If you work for a company that wants to allow you to contribute your work, then you'll need to sign a - [corporate CLA](https://developers.google.com/open-source/cla/corporate). +* If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an + [individual CLA](https://developers.google.com/open-source/cla/individual). +* If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a + [corporate CLA](https://developers.google.com/open-source/cla/corporate). -Follow either of the two links above to access the appropriate CLA and instructions for how to sign and return it. Once -we receive it, we'll be able to accept your pull requests. +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. ## Are you a Googler? -If you are a Googler, please make an attempt to submit an internal change rather than a GitHub Pull Request. If you are -not able to submit an internal change a PR is acceptable as an alternative. +If you are a Googler, please make an attempt to submit an internal contribution +rather than a GitHub Pull Request. If you are not able to submit internally, a +PR is acceptable as an alternative. ## Contributing A Patch -1. Submit an issue describing your proposed change to the - [issue tracker](https://github.com/google/googletest/issues). -2. Please don't mix more than one logical change per submittal, because it makes the history hard to follow. If you want - to make a change that doesn't have a corresponding issue in the issue tracker, please create one. -3. Also, coordinate with team members that are listed on the issue in question. This ensures that work isn't being - duplicated and communicating your plan early also generally leads to better patches. -4. If your proposed change is accepted, and you haven't already done so, sign a Contributor License Agreement (see - details above). -5. Fork the desired repo, develop and test your code changes. -6. Ensure that your code adheres to the existing style in the sample to which you are contributing. -7. Ensure that your code has an appropriate set of unit tests which all pass. -8. Submit a pull request. +1. Submit an issue describing your proposed change to the + [issue tracker](https://github.com/google/googletest/issues). +2. Please don't mix more than one logical change per submittal, because it + makes the history hard to follow. If you want to make a change that doesn't + have a corresponding issue in the issue tracker, please create one. +3. Also, coordinate with team members that are listed on the issue in question. + This ensures that work isn't being duplicated and communicating your plan + early also generally leads to better patches. +4. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement + ([see details above](#contributor-license-agreements)). +5. Fork the desired repo, develop and test your code changes. +6. Ensure that your code adheres to the existing style in the sample to which + you are contributing. +7. Ensure that your code has an appropriate set of unit tests which all pass. +8. Submit a pull request. ## The Google Test and Google Mock Communities The Google Test community exists primarily through the -[discussion group](http://groups.google.com/group/googletestframework) and the GitHub repository. Likewise, the Google -Mock community exists primarily through their own [discussion group](http://groups.google.com/group/googlemock). You are -definitely encouraged to contribute to the discussion and you can also help us to keep the effectiveness of the group -high by following and promoting the guidelines listed here. +[discussion group](https://groups.google.com/group/googletestframework) and the +GitHub repository. Likewise, the Google Mock community exists primarily through +their own [discussion group](https://groups.google.com/group/googlemock). You +are definitely encouraged to contribute to the discussion and you can also help +us to keep the effectiveness of the group high by following and promoting the +guidelines listed here. ### Please Be Friendly -Showing courtesy and respect to others is a vital part of the Google culture, and we strongly encourage everyone -participating in Google Test development to join us in accepting nothing less. Of course, being courteous is not the -same as failing to constructively disagree with each other, but it does mean that we should be respectful of each other -when enumerating the 42 technical reasons that a particular proposal may not be the best choice. There's never a reason -to be antagonistic or dismissive toward anyone who is sincerely trying to contribute to a discussion. +Showing courtesy and respect to others is a vital part of the Google culture, +and we strongly encourage everyone participating in Google Test development to +join us in accepting nothing less. Of course, being courteous is not the same as +failing to constructively disagree with each other, but it does mean that we +should be respectful of each other when enumerating the 42 technical reasons +that a particular proposal may not be the best choice. There's never a reason to +be antagonistic or dismissive toward anyone who is sincerely trying to +contribute to a discussion. -Sure, C++ testing is serious business and all that, but it's also a lot of fun. Let's keep it that way. Let's strive to -be one of the friendliest communities in all of open source. +Sure, C++ testing is serious business and all that, but it's also a lot of fun. +Let's keep it that way. Let's strive to be one of the friendliest communities in +all of open source. -As always, discuss Google Test in the official GoogleTest discussion group. You don't have to actually submit code in -order to sign up. Your participation itself is a valuable contribution. +As always, discuss Google Test in the official GoogleTest discussion group. You +don't have to actually submit code in order to sign up. Your participation +itself is a valuable contribution. ## Style -To keep the source consistent, readable, diffable and easy to merge, we use a fairly rigid coding style, as defined by -the -[google-styleguide](https://github.com/google/styleguide) project. All patches will be expected to conform to the style -outlined +To keep the source consistent, readable, diffable and easy to merge, we use a +fairly rigid coding style, as defined by the +[google-styleguide](https://github.com/google/styleguide) project. All patches +will be expected to conform to the style outlined [here](https://google.github.io/styleguide/cppguide.html). Use -[.clang-format](https://github.com/google/googletest/blob/master/.clang-format) -to check your formatting. +[.clang-format](https://github.com/google/googletest/blob/main/.clang-format) to +check your formatting. ## Requirements for Contributors -If you plan to contribute a patch, you need to build Google Test, Google Mock, and their own tests from a git checkout, -which has further requirements: +If you plan to contribute a patch, you need to build Google Test, Google Mock, +and their own tests from a git checkout, which has further requirements: -* [Python](https://www.python.org/) v2.3 or newer (for running some of the tests and re-generating certain source files - from templates) -* [CMake](https://cmake.org/) v2.8.12 or newer +* [Python](https://www.python.org/) v3.6 or newer (for running some of the + tests and re-generating certain source files from templates) +* [CMake](https://cmake.org/) v2.8.12 or newer ## Developing Google Test and Google Mock @@ -83,31 +98,44 @@ This section discusses how to make your own changes to the Google Test project. ### Testing Google Test and Google Mock Themselves -To make sure your changes work as intended and don't break existing functionality, you'll want to compile and run Google -Test and GoogleMock's own tests. For that you can use CMake: +To make sure your changes work as intended and don't break existing +functionality, you'll want to compile and run Google Test and GoogleMock's own +tests. For that you can use CMake: - mkdir mybuild - cd mybuild - cmake -Dgtest_build_tests=ON -Dgmock_build_tests=ON ${GTEST_REPO_DIR} +``` +mkdir mybuild +cd mybuild +cmake -Dgtest_build_tests=ON -Dgmock_build_tests=ON ${GTEST_REPO_DIR} +``` -To choose between building only Google Test or Google Mock, you may modify your cmake command to be one of each +To choose between building only Google Test or Google Mock, you may modify your +cmake command to be one of each - cmake -Dgtest_build_tests=ON ${GTEST_DIR} # sets up Google Test tests - cmake -Dgmock_build_tests=ON ${GMOCK_DIR} # sets up Google Mock tests +``` +cmake -Dgtest_build_tests=ON ${GTEST_DIR} # sets up Google Test tests +cmake -Dgmock_build_tests=ON ${GMOCK_DIR} # sets up Google Mock tests +``` -Make sure you have Python installed, as some of Google Test's tests are written in Python. If the cmake command -complains about not being able to find Python -(`Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE)`), try telling it explicitly where your Python executable can -be found: +Make sure you have Python installed, as some of Google Test's tests are written +in Python. If the cmake command complains about not being able to find Python +(`Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE)`), try telling it +explicitly where your Python executable can be found: - cmake -DPYTHON_EXECUTABLE=path/to/python ... +``` +cmake -DPYTHON_EXECUTABLE=path/to/python ... +``` -Next, you can build Google Test and / or Google Mock and all desired tests. On \*nix, this is usually done by +Next, you can build Google Test and / or Google Mock and all desired tests. On +\*nix, this is usually done by - make +``` +make +``` To run the tests, do - make test +``` +make test +``` All tests should pass. diff --git a/external/googletest/CONTRIBUTORS b/external/googletest/CONTRIBUTORS index 76db0b40..ccea41ea 100644 --- a/external/googletest/CONTRIBUTORS +++ b/external/googletest/CONTRIBUTORS @@ -34,6 +34,7 @@ Manuel Klimek Mario Tanev Mark Paskin Markus Heule +Martijn Vels Matthew Simmons Mika Raento Mike Bland @@ -54,7 +55,9 @@ Russ Cox Russ Rufer Sean Mcafee Sigurður Ásgeirsson +Soyeon Kim Sverre Sundsdal +Szymon Sobik Takeshi Yoshino Tracy Bialik Vadim Berman diff --git a/external/googletest/googletest/scripts/upload_gtest.py b/external/googletest/MODULE.bazel similarity index 50% rename from external/googletest/googletest/scripts/upload_gtest.py rename to external/googletest/MODULE.bazel index efb7101b..5cb0b156 100644 --- a/external/googletest/googletest/scripts/upload_gtest.py +++ b/external/googletest/MODULE.bazel @@ -1,7 +1,6 @@ -#!/usr/bin/env python +# Copyright 2024 Google Inc. +# All Rights Reserved. # -# Copyright 2009, Google Inc. -# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -29,50 +28,49 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -"""upload_gtest.py v0.1.0 -- uploads a Google Test patch for review. +# https://bazel.build/external/overview#bzlmod -This simple wrapper passes all command line flags and ---cc=googletestframework@googlegroups.com to upload.py. +module( + name = "googletest", + version = "1.17.0", + compatibility_level = 1, +) -USAGE: upload_gtest.py [options for upload.py] -""" +# Only direct dependencies need to be listed below. +# Please keep the versions in sync with the versions in the WORKSPACE file. -__author__ = 'wan@google.com (Zhanyong Wan)' +bazel_dep( + name = "abseil-cpp", + version = "20250127.1", +) +bazel_dep( + name = "platforms", + version = "0.0.11", +) +bazel_dep( + name = "re2", + version = "2024-07-02.bcr.1", +) -import os -import sys +bazel_dep( + name = "rules_python", + version = "1.3.0", + dev_dependency = True, +) -CC_FLAG = '--cc=' -GTEST_GROUP = 'googletestframework@googlegroups.com' +# https://rules-python.readthedocs.io/en/stable/toolchains.html#library-modules-with-dev-only-python-usage +python = use_extension( + "@rules_python//python/extensions:python.bzl", + "python", + dev_dependency = True, +) +python.toolchain( + ignore_root_user_error = True, + is_default = True, + python_version = "3.12", +) - -def main(): - # Finds the path to upload.py, assuming it is in the same directory - # as this file. - my_dir = os.path.dirname(os.path.abspath(__file__)) - upload_py_path = os.path.join(my_dir, 'upload.py') - - # Adds Google Test discussion group to the cc line if it's not there - # already. - upload_py_argv = [upload_py_path] - found_cc_flag = False - for arg in sys.argv[1:]: - if arg.startswith(CC_FLAG): - found_cc_flag = True - cc_line = arg[len(CC_FLAG):] - cc_list = [addr for addr in cc_line.split(',') if addr] - if GTEST_GROUP not in cc_list: - cc_list.append(GTEST_GROUP) - upload_py_argv.append(CC_FLAG + ','.join(cc_list)) - else: - upload_py_argv.append(arg) - - if not found_cc_flag: - upload_py_argv.append(CC_FLAG + GTEST_GROUP) - - # Invokes upload.py with the modified command line flags. - os.execv(upload_py_path, upload_py_argv) - - -if __name__ == '__main__': - main() +# See fake_fuchsia_sdk.bzl for instructions on how to override this with a real SDK, if needed. +fuchsia_sdk = use_extension("//:fake_fuchsia_sdk.bzl", "fuchsia_sdk") +fuchsia_sdk.create_fake() +use_repo(fuchsia_sdk, "fuchsia_sdk") diff --git a/external/googletest/README.md b/external/googletest/README.md index 95ada68a..598cf312 100644 --- a/external/googletest/README.md +++ b/external/googletest/README.md @@ -2,38 +2,38 @@ ### Announcements -#### Live at Head - -GoogleTest now follows the -[Abseil Live at Head philosophy](https://abseil.io/about/philosophy#upgrade-support). We recommend using the latest -commit in the `master` branch in your projects. - #### Documentation Updates Our documentation is now live on GitHub Pages at -https://google.github.io/googletest/. We recommend browsing the documentation on GitHub Pages rather than directly in -the repository. +https://google.github.io/googletest/. We recommend browsing the documentation on +GitHub Pages rather than directly in the repository. + +#### Release 1.17.0 + +[Release 1.17.0](https://github.com/google/googletest/releases/tag/v1.17.0) is +now available. -#### Release 1.10.x +The 1.17.x branch [requires at least C++17]((https://opensource.google/documentation/policies/cplusplus-support#c_language_standard). -[Release 1.10.x](https://github.com/google/googletest/releases/tag/release-1.10.0) -is now available. +#### Continuous Integration + +We use Google's internal systems for continuous integration. #### Coming Soon -* We are planning to take a dependency on - [Abseil](https://github.com/abseil/abseil-cpp). -* More documentation improvements are planned. +* We are planning to take a dependency on + [Abseil](https://github.com/abseil/abseil-cpp). ## Welcome to **GoogleTest**, Google's C++ test framework! -This repository is a merger of the formerly separate GoogleTest and GoogleMock projects. These were so closely related -that it makes sense to maintain and release them together. +This repository is a merger of the formerly separate GoogleTest and GoogleMock +projects. These were so closely related that it makes sense to maintain and +release them together. ### Getting Started -See the [GoogleTest User's Guide](https://google.github.io/googletest/) for documentation. We recommend starting with -the +See the [GoogleTest User's Guide](https://google.github.io/googletest/) for +documentation. We recommend starting with the [GoogleTest Primer](https://google.github.io/googletest/primer.html). More information about building GoogleTest can be found at @@ -41,88 +41,93 @@ More information about building GoogleTest can be found at ## Features -* An [xUnit](https://en.wikipedia.org/wiki/XUnit) test framework. -* Test discovery. -* A rich set of assertions. -* User-defined assertions. -* Death tests. -* Fatal and non-fatal failures. -* Value-parameterized tests. -* Type-parameterized tests. -* Various options for running the tests. -* XML test report generation. +* xUnit test framework: \ + Googletest is based on the [xUnit](https://en.wikipedia.org/wiki/XUnit) + testing framework, a popular architecture for unit testing +* Test discovery: \ + Googletest automatically discovers and runs your tests, eliminating the need + to manually register your tests +* Rich set of assertions: \ + Googletest provides a variety of assertions, such as equality, inequality, + exceptions, and more, making it easy to test your code +* User-defined assertions: \ + You can define your own assertions with Googletest, making it simple to + write tests that are specific to your code +* Death tests: \ + Googletest supports death tests, which verify that your code exits in a + certain way, making it useful for testing error-handling code +* Fatal and non-fatal failures: \ + You can specify whether a test failure should be treated as fatal or + non-fatal with Googletest, allowing tests to continue running even if a + failure occurs +* Value-parameterized tests: \ + Googletest supports value-parameterized tests, which run multiple times with + different input values, making it useful for testing functions that take + different inputs +* Type-parameterized tests: \ + Googletest also supports type-parameterized tests, which run with different + data types, making it useful for testing functions that work with different + data types +* Various options for running tests: \ + Googletest provides many options for running tests including running + individual tests, running tests in a specific order and running tests in + parallel ## Supported Platforms -GoogleTest requires a codebase and compiler compliant with the C++11 standard or newer. - -The GoogleTest code is officially supported on the following platforms. Operating systems or tools not listed below are -community-supported. For community-supported platforms, patches that do not complicate the code may be considered. - -If you notice any problems on your platform, please file an issue on the -[GoogleTest GitHub Issue Tracker](https://github.com/google/googletest/issues). Pull requests containing fixes are -welcome! - -### Operating Systems - -* Linux -* macOS -* Windows - -### Compilers - -* gcc 5.0+ -* clang 5.0+ -* MSVC 2015+ - -**macOS users:** Xcode 9.3+ provides clang 5.0+. - -### Build Systems - -* [Bazel](https://bazel.build/) -* [CMake](https://cmake.org/) - -**Note:** Bazel is the build system used by the team internally and in tests. CMake is supported on a best-effort basis -and by the community. +GoogleTest follows Google's +[Foundational C++ Support Policy](https://opensource.google/documentation/policies/cplusplus-support). +See +[this table](https://github.com/google/oss-policies-info/blob/main/foundational-cxx-support-matrix.md) +for a list of currently supported versions of compilers, platforms, and build +tools. ## Who Is Using GoogleTest? -In addition to many internal projects at Google, GoogleTest is also used by the following notable projects: +In addition to many internal projects at Google, GoogleTest is also used by the +following notable projects: -* The [Chromium projects](http://www.chromium.org/) (behind the Chrome browser and Chrome OS). -* The [LLVM](http://llvm.org/) compiler. -* [Protocol Buffers](https://github.com/google/protobuf), Google's data interchange format. -* The [OpenCV](http://opencv.org/) computer vision library. +* The [Chromium projects](https://www.chromium.org/) (behind the Chrome + browser and Chrome OS). +* The [LLVM](https://llvm.org/) compiler. +* [Protocol Buffers](https://github.com/google/protobuf), Google's data + interchange format. +* The [OpenCV](https://opencv.org/) computer vision library. ## Related Open Source Projects -[GTest Runner](https://github.com/nholthaus/gtest-runner) is a Qt5 based automated test-runner and Graphical User -Interface with powerful features for Windows and Linux platforms. +[GTest Runner](https://github.com/nholthaus/gtest-runner) is a Qt5 based +automated test-runner and Graphical User Interface with powerful features for +Windows and Linux platforms. -[GoogleTest UI](https://github.com/ospector/gtest-gbar) is a test runner that runs your test binary, allows you to track -its progress via a progress bar, and displays a list of test failures. Clicking on one shows failure text. Google Test +[GoogleTest UI](https://github.com/ospector/gtest-gbar) is a test runner that +runs your test binary, allows you to track its progress via a progress bar, and +displays a list of test failures. Clicking on one shows failure text. GoogleTest UI is written in C#. -[GTest TAP Listener](https://github.com/kinow/gtest-tap-listener) is an event listener for GoogleTest that implements -the -[TAP protocol](https://en.wikipedia.org/wiki/Test_Anything_Protocol) for test result output. If your test runner -understands TAP, you may find it useful. +[GTest TAP Listener](https://github.com/kinow/gtest-tap-listener) is an event +listener for GoogleTest that implements the +[TAP protocol](https://en.wikipedia.org/wiki/Test_Anything_Protocol) for test +result output. If your test runner understands TAP, you may find it useful. -[gtest-parallel](https://github.com/google/gtest-parallel) is a test runner that runs tests from your binary in parallel -to provide significant speed-up. +[gtest-parallel](https://github.com/google/gtest-parallel) is a test runner that +runs tests from your binary in parallel to provide significant speed-up. [GoogleTest Adapter](https://marketplace.visualstudio.com/items?itemName=DavidSchuldenfrei.gtest-adapter) -is a VS Code extension allowing to view GoogleTest in a tree view, and run/debug your tests. +is a VS Code extension allowing to view GoogleTest in a tree view and run/debug +your tests. -[C++ TestMate](https://github.com/matepek/vscode-catch2-test-adapter) is a VS Code extension allowing to view GoogleTest -in a tree view, and run/debug your tests. +[C++ TestMate](https://github.com/matepek/vscode-catch2-test-adapter) is a VS +Code extension allowing to view GoogleTest in a tree view and run/debug your +tests. -[Cornichon](https://pypi.org/project/cornichon/) is a small Gherkin DSL parser that generates stub code for GoogleTest. +[Cornichon](https://pypi.org/project/cornichon/) is a small Gherkin DSL parser +that generates stub code for GoogleTest. ## Contributing Changes Please read -[`CONTRIBUTING.md`](https://github.com/google/googletest/blob/master/CONTRIBUTING.md) +[`CONTRIBUTING.md`](https://github.com/google/googletest/blob/main/CONTRIBUTING.md) for details on how to contribute to this project. Happy testing! diff --git a/external/googletest/WORKSPACE b/external/googletest/WORKSPACE index 614f5577..0ae5dee9 100644 --- a/external/googletest/WORKSPACE +++ b/external/googletest/WORKSPACE @@ -1,24 +1,61 @@ -workspace(name = "com_google_googletest") +# Copyright 2024 Google Inc. +# All Rights Reserved. +# +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +workspace(name = "googletest") + +load("//:googletest_deps.bzl", "googletest_deps") +googletest_deps() load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( - name = "com_google_absl", - urls = ["https://github.com/abseil/abseil-cpp/archive/7971fb358ae376e016d2d4fc9327aad95659b25e.zip"], # 2021-05-20T02:59:16Z - strip_prefix = "abseil-cpp-7971fb358ae376e016d2d4fc9327aad95659b25e", - sha256 = "aeba534f7307e36fe084b452299e49b97420667a8d28102cf9a0daeed340b859", + name = "rules_python", + sha256 = "2cc26bbd53854ceb76dd42a834b1002cd4ba7f8df35440cf03482e045affc244", + strip_prefix = "rules_python-1.3.0", + url = "https://github.com/bazelbuild/rules_python/releases/download/1.3.0/rules_python-1.3.0.tar.gz", ) +# https://github.com/bazelbuild/rules_python/releases/tag/1.1.0 +load("@rules_python//python:repositories.bzl", "py_repositories") +py_repositories() http_archive( - name = "rules_cc", - urls = ["https://github.com/bazelbuild/rules_cc/archive/68cb652a71e7e7e2858c50593e5a9e3b94e5b9a9.zip"], # 2021-05-14T14:51:14Z - strip_prefix = "rules_cc-68cb652a71e7e7e2858c50593e5a9e3b94e5b9a9", - sha256 = "1e19e9a3bc3d4ee91d7fcad00653485ee6c798efbbf9588d40b34cbfbded143d", + name = "bazel_skylib", + sha256 = "cd55a062e763b9349921f0f5db8c3933288dc8ba4f76dd9416aac68acee3cb94", + urls = ["https://github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz"], ) http_archive( - name = "rules_python", - urls = ["https://github.com/bazelbuild/rules_python/archive/ed6cc8f2c3692a6a7f013ff8bc185ba77eb9b4d2.zip"], # 2021-05-17T00:24:16Z - strip_prefix = "rules_python-ed6cc8f2c3692a6a7f013ff8bc185ba77eb9b4d2", - sha256 = "98b3c592faea9636ac8444bfd9de7f3fb4c60590932d6e6ac5946e3f8dbd5ff6", + name = "platforms", + urls = [ + "https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.11/platforms-0.0.11.tar.gz", + "https://github.com/bazelbuild/platforms/releases/download/0.0.11/platforms-0.0.11.tar.gz", + ], + sha256 = "29742e87275809b5e598dc2f04d86960cc7a55b3067d97221c9abbc9926bff0f", ) diff --git a/external/googletest/WORKSPACE.bzlmod b/external/googletest/WORKSPACE.bzlmod new file mode 100644 index 00000000..381432c5 --- /dev/null +++ b/external/googletest/WORKSPACE.bzlmod @@ -0,0 +1,35 @@ +# Copyright 2024 Google Inc. +# All Rights Reserved. +# +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# https://bazel.build/external/migration#workspace.bzlmod +# +# This file is intentionally empty. When bzlmod is enabled and this +# file exists, the content of WORKSPACE is ignored. This prevents +# bzlmod builds from unintentionally depending on the WORKSPACE file. diff --git a/external/googletest/ci/linux-presubmit.sh b/external/googletest/ci/linux-presubmit.sh index 6bea1cde..6491e798 100644 --- a/external/googletest/ci/linux-presubmit.sh +++ b/external/googletest/ci/linux-presubmit.sh @@ -31,39 +31,59 @@ set -euox pipefail -readonly LINUX_LATEST_CONTAINER="gcr.io/google.com/absl-177019/linux_hybrid-latest:20210525" -readonly LINUX_GCC_FLOOR_CONTAINER="gcr.io/google.com/absl-177019/linux_gcc-floor:20201015" +readonly LINUX_LATEST_CONTAINER="gcr.io/google.com/absl-177019/linux_hybrid-latest:20241218" +readonly LINUX_GCC_FLOOR_CONTAINER="gcr.io/google.com/absl-177019/linux_gcc-floor:20250205" if [[ -z ${GTEST_ROOT:-} ]]; then GTEST_ROOT="$(realpath $(dirname ${0})/..)" fi if [[ -z ${STD:-} ]]; then - STD="c++11 c++14 c++17 c++20" + STD="c++17 c++20" fi -# Test the CMake build -for cc in /usr/local/bin/gcc /opt/llvm/clang/bin/clang; do - for cmake_off_on in OFF ON; do - time docker run \ - --volume="${GTEST_ROOT}:/src:ro" \ - --tmpfs="/build:exec" \ - --workdir="/build" \ - --rm \ - --env="CC=${cc}" \ - --env="CXX_FLAGS=\"-Werror -Wdeprecated\"" \ - ${LINUX_LATEST_CONTAINER} \ - /bin/bash -c " - cmake /src \ - -DCMAKE_CXX_STANDARD=11 \ - -Dgtest_build_samples=ON \ - -Dgtest_build_tests=ON \ - -Dgmock_build_tests=ON \ - -Dcxx_no_exception=${cmake_off_on} \ - -Dcxx_no_rtti=${cmake_off_on} && \ - make -j$(nproc) && \ - ctest -j$(nproc) --output-on-failure" - done +# Test CMake + GCC +for cmake_off_on in OFF ON; do + time docker run \ + --volume="${GTEST_ROOT}:/src:ro" \ + --tmpfs="/build:exec" \ + --workdir="/build" \ + --rm \ + --env="CC=/usr/local/bin/gcc" \ + --env=CXXFLAGS="-Werror -Wdeprecated" \ + ${LINUX_LATEST_CONTAINER} \ + /bin/bash -c " + cmake /src \ + -DCMAKE_CXX_STANDARD=17 \ + -Dgtest_build_samples=ON \ + -Dgtest_build_tests=ON \ + -Dgmock_build_tests=ON \ + -Dcxx_no_exception=${cmake_off_on} \ + -Dcxx_no_rtti=${cmake_off_on} && \ + make -j$(nproc) && \ + ctest -j$(nproc) --output-on-failure" +done + +# Test CMake + Clang +for cmake_off_on in OFF ON; do + time docker run \ + --volume="${GTEST_ROOT}:/src:ro" \ + --tmpfs="/build:exec" \ + --workdir="/build" \ + --rm \ + --env="CC=/opt/llvm/clang/bin/clang" \ + --env=CXXFLAGS="-Werror -Wdeprecated --gcc-toolchain=/usr/local" \ + ${LINUX_LATEST_CONTAINER} \ + /bin/bash -c " + cmake /src \ + -DCMAKE_CXX_STANDARD=17 \ + -Dgtest_build_samples=ON \ + -Dgtest_build_tests=ON \ + -Dgmock_build_tests=ON \ + -Dcxx_no_exception=${cmake_off_on} \ + -Dcxx_no_rtti=${cmake_off_on} && \ + make -j$(nproc) && \ + ctest -j$(nproc) --output-on-failure" done # Do one test with an older version of GCC @@ -72,11 +92,16 @@ time docker run \ --workdir="/src" \ --rm \ --env="CC=/usr/local/bin/gcc" \ + --env="BAZEL_CXXOPTS=-std=c++17" \ ${LINUX_GCC_FLOOR_CONTAINER} \ /usr/local/bin/bazel test ... \ --copt="-Wall" \ --copt="-Werror" \ + --copt="-Wuninitialized" \ + --copt="-Wundef" \ --copt="-Wno-error=pragmas" \ + --enable_bzlmod=false \ + --features=external_include_paths \ --keep_going \ --show_timestamps \ --test_output=errors @@ -94,8 +119,11 @@ for std in ${STD}; do /usr/local/bin/bazel test ... \ --copt="-Wall" \ --copt="-Werror" \ + --copt="-Wuninitialized" \ + --copt="-Wundef" \ --define="absl=${absl}" \ - --distdir="/bazel-distdir" \ + --enable_bzlmod=true \ + --features=external_include_paths \ --keep_going \ --show_timestamps \ --test_output=errors @@ -116,8 +144,11 @@ for std in ${STD}; do --copt="--gcc-toolchain=/usr/local" \ --copt="-Wall" \ --copt="-Werror" \ + --copt="-Wuninitialized" \ + --copt="-Wundef" \ --define="absl=${absl}" \ - --distdir="/bazel-distdir" \ + --enable_bzlmod=true \ + --features=external_include_paths \ --keep_going \ --linkopt="--gcc-toolchain=/usr/local" \ --show_timestamps \ diff --git a/external/googletest/ci/macos-presubmit.sh b/external/googletest/ci/macos-presubmit.sh index d6423faa..5370ed60 100644 --- a/external/googletest/ci/macos-presubmit.sh +++ b/external/googletest/ci/macos-presubmit.sh @@ -31,6 +31,9 @@ set -euox pipefail +# Use Xcode 16.0 +sudo xcode-select -s /Applications/Xcode_16.0.app/Contents/Developer + if [[ -z ${GTEST_ROOT:-} ]]; then GTEST_ROOT="$(realpath $(dirname ${0})/..)" fi @@ -40,20 +43,20 @@ for cmake_off_on in OFF ON; do BUILD_DIR=$(mktemp -d build_dir.XXXXXXXX) cd ${BUILD_DIR} time cmake ${GTEST_ROOT} \ - -DCMAKE_CXX_STANDARD=11 \ + -DCMAKE_CXX_STANDARD=17 \ -Dgtest_build_samples=ON \ -Dgtest_build_tests=ON \ -Dgmock_build_tests=ON \ -Dcxx_no_exception=${cmake_off_on} \ -Dcxx_no_rtti=${cmake_off_on} - time make + time make -j$(nproc) time ctest -j$(nproc) --output-on-failure done # Test the Bazel build # If we are running on Kokoro, check for a versioned Bazel binary. -KOKORO_GFILE_BAZEL_BIN="bazel-3.7.0-darwin-x86_64" +KOKORO_GFILE_BAZEL_BIN="bazel-8.0.0-darwin-x86_64" if [[ ${KOKORO_GFILE_DIR:-} ]] && [[ -f ${KOKORO_GFILE_DIR}/${KOKORO_GFILE_BAZEL_BIN} ]]; then BAZEL_BIN="${KOKORO_GFILE_DIR}/${KOKORO_GFILE_BAZEL_BIN}" chmod +x ${BAZEL_BIN} @@ -66,7 +69,11 @@ for absl in 0 1; do ${BAZEL_BIN} test ... \ --copt="-Wall" \ --copt="-Werror" \ + --copt="-Wundef" \ + --cxxopt="-std=c++17" \ --define="absl=${absl}" \ + --enable_bzlmod=true \ + --features=external_include_paths \ --keep_going \ --show_timestamps \ --test_output=errors diff --git a/external/googletest/ci/windows-presubmit.bat b/external/googletest/ci/windows-presubmit.bat new file mode 100644 index 00000000..e2664c53 --- /dev/null +++ b/external/googletest/ci/windows-presubmit.bat @@ -0,0 +1,75 @@ +SETLOCAL ENABLEDELAYEDEXPANSION + +SET BAZEL_EXE=%KOKORO_GFILE_DIR%\bazel-8.0.0-windows-x86_64.exe + +SET PATH=C:\Python34;%PATH% +SET BAZEL_PYTHON=C:\python34\python.exe +SET BAZEL_SH=C:\tools\msys64\usr\bin\bash.exe +SET CMAKE_BIN="cmake.exe" +SET CTEST_BIN="ctest.exe" +SET CTEST_OUTPUT_ON_FAILURE=1 +SET CMAKE_BUILD_PARALLEL_LEVEL=16 +SET CTEST_PARALLEL_LEVEL=16 + +SET GTEST_ROOT=%~dp0\.. +IF %errorlevel% neq 0 EXIT /B 1 + +:: ---------------------------------------------------------------------------- +:: CMake +SET CMAKE_BUILD_PATH=cmake_msvc2022 +MKDIR %CMAKE_BUILD_PATH% +CD %CMAKE_BUILD_PATH% + +%CMAKE_BIN% %GTEST_ROOT% ^ + -G "Visual Studio 17 2022" ^ + -DCMAKE_CXX_STANDARD=17 ^ + -DPYTHON_EXECUTABLE:FILEPATH=c:\python37\python.exe ^ + -DPYTHON_INCLUDE_DIR:PATH=c:\python37\include ^ + -DPYTHON_LIBRARY:FILEPATH=c:\python37\lib\site-packages\pip ^ + -Dgtest_build_samples=ON ^ + -Dgtest_build_tests=ON ^ + -Dgmock_build_tests=ON +IF %errorlevel% neq 0 EXIT /B 1 + +%CMAKE_BIN% --build . --target ALL_BUILD --config Debug -- -maxcpucount +IF %errorlevel% neq 0 EXIT /B 1 + +%CTEST_BIN% -C Debug --timeout 600 +IF %errorlevel% neq 0 EXIT /B 1 + +CD %GTEST_ROOT% +RMDIR /S /Q %CMAKE_BUILD_PATH% + +:: ---------------------------------------------------------------------------- +:: Bazel + +:: The default home directory on Kokoro is a long path which causes errors +:: because of Windows limitations on path length. +:: --output_user_root=C:\tmp causes Bazel to use a shorter path. +SET BAZEL_VS=C:\Program Files\Microsoft Visual Studio\2022\Community + +:: C++17 +%BAZEL_EXE% ^ + --output_user_root=C:\tmp ^ + test ... ^ + --compilation_mode=dbg ^ + --copt=/std:c++17 ^ + --copt=/WX ^ + --enable_bzlmod=true ^ + --keep_going ^ + --test_output=errors ^ + --test_tag_filters=-no_test_msvc2017 +IF %errorlevel% neq 0 EXIT /B 1 + +:: C++20 +%BAZEL_EXE% ^ + --output_user_root=C:\tmp ^ + test ... ^ + --compilation_mode=dbg ^ + --copt=/std:c++20 ^ + --copt=/WX ^ + --enable_bzlmod=true ^ + --keep_going ^ + --test_output=errors ^ + --test_tag_filters=-no_test_msvc2017 +IF %errorlevel% neq 0 EXIT /B 1 diff --git a/external/googletest/docs/_data/navigation.yml b/external/googletest/docs/_data/navigation.yml index 8d13e343..9f333270 100644 --- a/external/googletest/docs/_data/navigation.yml +++ b/external/googletest/docs/_data/navigation.yml @@ -1,43 +1,43 @@ nav: - - section: "Get Started" - items: - - title: "Supported Platforms" - url: "/platforms.html" - - title: "Quickstart: Bazel" - url: "/quickstart-bazel.html" - - title: "Quickstart: CMake" - url: "/quickstart-cmake.html" - - section: "Guides" - items: - - title: "GoogleTest Primer" - url: "/primer.html" - - title: "Advanced Topics" - url: "/advanced.html" - - title: "Mocking for Dummies" - url: "/gmock_for_dummies.html" - - title: "Mocking Cookbook" - url: "/gmock_cook_book.html" - - title: "Mocking Cheat Sheet" - url: "/gmock_cheat_sheet.html" - - section: "References" - items: - - title: "Testing Reference" - url: "/reference/testing.html" - - title: "Mocking Reference" - url: "/reference/mocking.html" - - title: "Assertions" - url: "/reference/assertions.html" - - title: "Matchers" - url: "/reference/matchers.html" - - title: "Actions" - url: "/reference/actions.html" - - title: "Testing FAQ" - url: "/faq.html" - - title: "Mocking FAQ" - url: "/gmock_faq.html" - - title: "Code Samples" - url: "/samples.html" - - title: "Using pkg-config" - url: "/pkgconfig.html" - - title: "Community Documentation" - url: "/community_created_documentation.html" +- section: "Get Started" + items: + - title: "Supported Platforms" + url: "/platforms.html" + - title: "Quickstart: Bazel" + url: "/quickstart-bazel.html" + - title: "Quickstart: CMake" + url: "/quickstart-cmake.html" +- section: "Guides" + items: + - title: "GoogleTest Primer" + url: "/primer.html" + - title: "Advanced Topics" + url: "/advanced.html" + - title: "Mocking for Dummies" + url: "/gmock_for_dummies.html" + - title: "Mocking Cookbook" + url: "/gmock_cook_book.html" + - title: "Mocking Cheat Sheet" + url: "/gmock_cheat_sheet.html" +- section: "References" + items: + - title: "Testing Reference" + url: "/reference/testing.html" + - title: "Mocking Reference" + url: "/reference/mocking.html" + - title: "Assertions" + url: "/reference/assertions.html" + - title: "Matchers" + url: "/reference/matchers.html" + - title: "Actions" + url: "/reference/actions.html" + - title: "Testing FAQ" + url: "/faq.html" + - title: "Mocking FAQ" + url: "/gmock_faq.html" + - title: "Code Samples" + url: "/samples.html" + - title: "Using pkg-config" + url: "/pkgconfig.html" + - title: "Community Documentation" + url: "/community_created_documentation.html" diff --git a/external/googletest/docs/_layouts/default.html b/external/googletest/docs/_layouts/default.html index db30419f..c7f331b8 100644 --- a/external/googletest/docs/_layouts/default.html +++ b/external/googletest/docs/_layouts/default.html @@ -1,63 +1,58 @@ - - + + - {% seo %} - +{% seo %} + - - -